* 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: types for richtext.tsx
* fix: types for check-lists, code-highlighting and custom placeholder
* fix: types for editable-voids, embeds, forced-layout, hovering-toolbar
* fix: types for remaining examples
* fix: typescript error for files in image element
* fix: types for examples and some minor fixes
* fix: normalize-tokens.ts type
* fix: types for [example].tsx
I noticed that the current example for toggling a code block using the backtick (`) key doesn't work as expected. The issue occurs because `Editor.nodes()` can return text nodes instead of block elements, causing`Transforms.setNodes()` to fail.
To fix this, I added an extra check using `Element.isElement(n)`, ensuring that only block elements are transformed.
Clarify in the documentation that the default value for `edge` in `Editor.point` is `start`.
This is helpful for developers who are not deeply familiar with the framework but need to quickly use it for development.
They no longer need to inspect the source code or experiment with sample code to understand the default behavior.
* 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
* chore: moved all ts files for examples to examples/ts
* add: tsc to eject js and jsx output
* example: add js transpiled examples
* example: update example site to show both js and ts code
* chore: fix yarn lint
* fix(example): getAllExamplesPath