Minor Changes
-
#6311
a1852f8Thanks @dylans! - Add opt-ininlineEdgeAffinityandleafEdgeAffinityeditor hooks andEditor.insertionPointfor consistent insertion at inline and mark boundaries. Implicit text, fragment and inline-node insertion at collapsed carets follows the configured rules, andEditor.marksreports the receiving leaf’s marks. Both hooks default tonull, preserving existing behavior.BaseEditornow requires the two affinity hooks and theinsertionPointquery. Editors created throughcreateEditorreceive them automatically; structurally constructed editors and editor mocks must supply them. Slate React disables native insertion when affinity changes the receiving point, while retaining compatibility with older supported Slate peers that lack the helper.Committed Android typing that changes receiving leaves uses the existing action reconciliation path, so a native mutation does not remain rendered in the old leaf. Active composition retains its existing diff path.
-
#6310
407a066Thanks @dylans! - Add afilteroption toinsertFragment. It is called for each node in the fragment with the destination block entry and returnsfalseto skip that node.
Patch Changes
- #5937
428fd70Thanks @kinaluo! -insertFragmentnow splits the block when block-level nodes such as a void image are pasted mid-block, so they land between the two halves instead of above the block, and the cursor moves to the start of the second half. Dropping a dragged block void onto the middle of a paragraph splits it the same way. Schemas that don't allow blocks inside a structure (for example a list item's text wrapper) should overrideinsertFragmentto move those nodes elsewhere before calling the original.