* optimize editor#apply and allow potential paths as input
* fix Editor#above regression for cross-node ranges
* add test to prevent regressions
* add changeset
* improve comment
* factor out for-loop that will never actually loop
* aw crud I didnt lint. fixing
* Refactor `insertFragment` without altering behaviour
* Fix inserting a fragment containing exactly two blocks
* Fix and unskip insertFragment list test
* fix(docs): Consider passed options when overriding normalizeNode
* feat: Allow to prevent data-loss on normalizeNode
When overriding normalizeNode, you can specify a `wrapperElement`
that is used to wrap text & inline nodes which would otherwise be
deleted in the normalization path if they are not allowed.
* changeset
* Remove the `isPlainObject` check from `isText` and `isElement` for performance
* Optimise `isElement`, `isNodeList` and `isText` further
* Update changeset
* Fix changeset
* Refactor object check into `isObject`
* fix: correct dirty path update for Text nodes
Previously, the condition used was "if (!Text.isText)" without passing the node, which always evaluated to false. This caused the code to always take the branch intended for non-Text nodes, even for Text nodes. The fix now correctly checks "if (Text.isText(node))" to determine if the node is a Text node. Text nodes, which have no children, will now correctly add only their own path, while non-Text nodes continue to have all their descendant paths added. This change ensures that the dirty path update logic behaves as intended.
* Add changeset
---------
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
* fix: fix data loss in base `normalizeData` if no blocks allowed
Use `unwrapNodes` instead of `removeNodes` to
convert block to inline/text nodes.
* changeset
* Use extended `Editor` type in `useSlateWithV` return type
So it matches the return types of `useSlate` and `useSlateStatic`. The
`useSlateWithV` return object's `editor` property is currently typed as
just a `ReactEditor`, which causes type errors in our app when we try to
use it as the extended `Editor` type.
* Fix return types in "Editor hooks" docs
* Copied some things from slate-react into new react-dom package
* Refactor slate-react to use slate-dom
* Fixed failing tests
* Created changeset
* Ran fix:prettier
* Fixed name
* Removed duplicate code
* Fixed import
* Restored linting rule
* Bumped slate-dom version
* Bumped slate dependency version
* Added export of IS_NODE_MAP_DIRTY after rebase
* Fix selections with non-void non-editable focus
"Non-void non-editable" refers to `contentEditable={false}` DOM nodes
that are rendered by a Slate element render but which are not void
elements. For instance, [the checkboxes in the checklists example][1].
[1]: 7e77a932f0/site/examples/check-lists.tsx (L153-L170)
* fixup! Fix selections with non-void non-editable focus
Optimize leaf node search
* fixup! Fix selections with non-void non-editable focus
Rename `focusNodeSelectable` to `focusNodeIsSelectable`
A more accurate name given this PR's changes.
* fixup! Fix selections with non-void non-editable focus
Remove inapplicable `if` branch
* fixup! Fix selections with non-void non-editable focus
Improve comment