You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Block.jsx creates a number of state-editing callbacks and various types of editors that use these callbacks, then passes these components as props to its child container component BlockEditor.jsx. This clutters Block.jsx and makes it instantiate many things that are not needed for the current state of the Block Editor. It also confuses the control flow of data.
Task: Make Block.jsx only responsible for the maintaining of local blockState (a working copy of what is saved in the database) then make BlockEditor handle the creation of BlockType-specific editors and their methods needed for updating blockState. Then, have its children editors (whether code editors or "simple" UI editors) implement the BlockType-specific logic for updating the blockState. Also add a consistent, general way for specific block editors to validate their changes.
To do:
Move all blockState-editing methods to BlockEditor
Make the getting of block variables (useVariables) consistent
Make RichTextEditor a type of SimpleUI-type component rather than a separate thing
Have BlockElement handle isValidWorkingState state
Pass setIsValidWorkingState() down to BlockEditor
Wrap state-editing methods created in BlockEditor so that they automatically update isModified and isValidWorkingState variables
The text was updated successfully, but these errors were encountered:
Currently,
Block.jsx
creates a number of state-editing callbacks and various types of editors that use these callbacks, then passes these components as props to its child container componentBlockEditor.jsx
. This cluttersBlock.jsx
and makes it instantiate many things that are not needed for the current state of the Block Editor. It also confuses the control flow of data.Task: Make
Block.jsx
only responsible for the maintaining of localblockState
(a working copy of what is saved in the database) then makeBlockEditor
handle the creation of BlockType-specific editors and their methods needed for updatingblockState
. Then, have its children editors (whether code editors or "simple" UI editors) implement the BlockType-specific logic for updating theblockState
. Also add a consistent, general way for specific block editors to validate their changes.To do:
blockState
-editing methods toBlockEditor
useVariables
) consistentBlockElement
handleisValidWorkingState
statesetIsValidWorkingState()
down toBlockEditor
BlockEditor
so that they automatically updateisModified
andisValidWorkingState
variablesThe text was updated successfully, but these errors were encountered: