A State consists of a root block and a selection. State allows you to keep track of and manipulate the contents of the editor.
Creates a State. The arguments are as follows:
root is a block node that represents the root of the editor.
selection is a Maybe Selection that is the selected part of the editor
root : Block
root =
block
(Element.element doc [])
(blockChildren <|
Array.fromList
[ block
(Element.element paragraph [])
(inlineChildren <| Array.fromList [ plainText "" ])
]
)
state root Nothing
--> an empty editor state with no selectiona state with the given selection
A State consists of a root block and a selection. State allows you to keep track of and manipulate the contents of the editor.