* Update forced-layout example
Enforce layout to an explicit block index to allow for other block types
* Update site/examples/forced-layout.tsx
* fix layout example to comply with linting rules
Co-authored-by: Lukas Murdock <lukas.murdock@gmail.com>
* Proposal for Remove useCallback from walkthroughs
I have seen in the walkthrough the use of `useCallback` but I don't think are need it, and add a small complexity while understanding the concept, if we moved out the function outside of the component will be stable and will not require to maintain either referential identity or calculated complex logic.
If people think this is a good idea I can go and update all documentation to remove unnecessary `useCallback` from the example.
unless I'm missing something.
* Update docs/walkthroughs/04-applying-custom-formatting.md
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
* fix(android): Fix mark is not inputed on insert text in android
* add changeset
* null mark only when mark exist
Co-authored-by: surya darma <budi.surya@kumparan.com>
* fix(android): clipboard application/x-slate-fragment is missing on paste in android
* add event onCut
* add changeset
* make slate fragment available when props onPaste, call preventDefault
* .
* get the fragment from text/html when it missing
* remove setData
* use getClipboardData instead of hooks
* Do not needlessly JSON.stringify() the whole editor
* Refactor based on feedback
* Linting fix for error messages
* linting fix
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
* use native character insertion to fix browser/OS text features. (flickering spellcheck, autocorrect, text shortcuts, etc.)
move some checks into previous if statement, remove commented out code
move native behavior into `slate-react`, and remove any external interface
dont use native editing if marks are set, as a new node will be inserted
match -> above
remove nativeOperationsQueue from editor
bail out of native queueing and immediately flush events if non insert_text operation is being applied.
* Convert TextString to a functional component
* Batch normalization of native op application
* Add changeset
* only proceed as native event if single character non-special character or space, to limit potential bad side effects.
* Revert "fix ime double input with mark"
* Comment wording tweak
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
* Comment wording tweak
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
* Comment wording tweak
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
* Comment wording tweak
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
* Comment wording tweak
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
Co-authored-by: Ludwig Pettersson <luddep@gmail.com>
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
* Remove fast-deep-equal in favour of a custom slate-specific equality check that only supports nested objects
* Add array comparison to deep equal. Fix bug with multiple nested objects.
* Comment out currently flaky integration test
Even with a longer timeout, this test is intermittently failing, causing most PRs to show as failing.
* Update cypress/integration/examples/code-highlighting.ts
* test: add test case for bug
* prefer next will transforming selection in remove_node
* add remove_node test
* Add changeset
* review: handle nested blocks
* refactor
* Revert "refactor"
This reverts commit 45a8aab7cb8408295c93d48186f5c7ecb135f4ae.
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
* Update `findDocumentOrShadowRoot` to return undefined instead of throwing unnecessarily
* Small refactoring to improve the diff for reviewers
* Add changeset for patch
* Update new-trainers-peel.md
* Resolve PR comments
* Revert undefined checks, return window.document and update changeset
* Simplify findDocumentOrShadowRoot based on PR feedback
* Re-run CI
Thanks everyone for your review and thanks @ben10code for your first contribution!
* Add third parameter to `toSlateRange` method
The `toSlateRange` method accepts an optional third parameter that is an object with property `exactMatch` and value is a boolean.
Example of this implementation can be found at the `Editable` component of `slate-react`, inside the custom `onDOMSelectionChange`.
* toSlateRange third param is optional
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
No changeset as it's a doc update.
* created editable-voids cypress test
* created markdown-preview cypress test
* created images cypress test
* created huge-document cypress test
* added hovering-toolbar, and forced-layout cypress tests
* added embeds cypress test
No changeset as it's adding tests for the examples.