* fix(react-editor): text node spacer can be non-existant if editor is in readonly mode
* v0.59.1
* Revert "v0.59.1"
This reverts commit 58cb7f1d61e81788e0257bace9be59bc47be8851.
* Update react-editor.ts
* Update react-editor.ts
* Create rude-lemons-crash.md
Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
* Rename test slate transforms delete unit-character inline-before to inline-afte
* Add missing tests for Transforms.delete, symmetric to existing tests with respect to options.reverse
* In Transforms.delete collapse selection according to options.reverse
* Add directionality to Editor#deleteFragment
* fix DOM selection can not be updated when use composition input on Safari #3196
* Update editable.tsx
* Create dry-deers-applaud.md
Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
* Use lodash.isEqual to compare text nodes
The key improvement here is that this allows Text nodes to have more complex attributes like objects. The previous behavior failed to find equivalent object properties as equal due to JS's !== reference check.
* Install lodash in slate's pkgjson
* Fixed an issue with controlled value messing up editor.selection
* Create fifty-ducks-sip.md
Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
* add guard checks for value and editor in <Slate />
* adding tiny-invariant to slate-react; refactoring errors
* import Editor for guard check
* Create fuzzy-yaks-drive.md
Co-authored-by: Cameron Ackerman <cameron_ackerman@selinc.com>
Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
* Fix cursor movement in RTL elements (#2963)
* Fix cursor movement in RTL elements even when jumping between whole words (using option + arrow key) (#2963)
* feat: delete current line when deleting backward with line unit
* Apply BrentFarase suggestions from code review
Co-authored-by: Brent Farese <25846953+BrentFarese@users.noreply.github.com>
* Update prettier formats and rebase on master
Co-authored-by: Brent Farese <25846953+BrentFarese@users.noreply.github.com>
* getDirtyPaths can now be customized by Slate users (#4012)
* Moved getDirtyPaths() into the editor object so it can be customized via plugin
* docs: Update document in Chinese (#4017)
Co-authored-by: liuchengshuai001 <liuchengshuai001@ke.com>
* Removed unused import
* Use shadowRoot if available
* Removed optional chaining
* Added workaround for chrom bug in ShadowDOM
* Added shadow DOM example
* Add a shadow DOM example
Shadow DOM brings different behaviours for selection and active
elements. This adds an example where the editor is found within a shadow
DOM, in fact, the editor is two levels deep in nested shadow DOMs.
The handling of selections means that this editor doesn't work properly
so Slate will need to be made aware of the shadow DOM in order to fix
this.
* User DocumentOrShadowRoot for selection and active elements
If the editor is within a ShadowDom, the selections and active element
APIs are implemented on the ShadowRoot for Chrome. Other browsers still
use the Document's version of these APIs for the shadow DOM.
Instead of defaulting to `window.document`, find the appropriate root to
use for the editor in question.
* Add compatibility for Chrome's isCollapsed bug
Chrome will always return true for isCollapsed on a selection from the
shadow DOM. Work around this by instead computing this property on
Chrome.
https://bugs.chromium.org/p/chromium/issues/detail?id=447523
* Removed duplicated example
* Fixed possible null value
* Use existing PlainTextExample
* Re-added local Editor to have clear initialValue
* Optimize shadowRoot checkup
* Remove getDocumentOrShadowRoot util in favor of findDocumentOrShadowRoot
* Re-added getDocumentOrShadowRoot
* Put selectionchange listener on window.document
* Resetted changes from main branch
* Create tiny-walls-deliver.md
* Update tiny-walls-deliver.md
* Update tiny-walls-deliver.md
Co-authored-by: Tommy Dong <contact@tomdong.io>
Co-authored-by: Jacob <40483898+jacob-lcs@users.noreply.github.com>
Co-authored-by: liuchengshuai001 <liuchengshuai001@ke.com>
Co-authored-by: Andrew Scull <andrew.scull@live.com>
Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
* fixed bug with Editor.positions slicing beyond the available characters in the current text node
* fixed issues with line and word Editor.positions on fragmented text
* renamed some of the tests and added some more
The element, text, and leaf components do not properly check the decorator list and make sure the properties in
addition to the anchor/focus are the same.
In addition, the renderLeaf function cannot be memoized because the leaf component does not compare the actual
text values within the leafs.
* Have useSlate and useSlateStatic return the Custom Editor
* v0.60.12
* Add generic to useSlate and useSlateStatic
* v0.60.13
* Fix useSlate and useSlateStatic to return customized Editor type
* v0.60.14
* Experimental release to see if CustomTypes holds up through a publish
* Add experimental release script
* Fix lint
* v0.60.5-alpha.0
* Allow null properties in setNodes
* v0.60.6-alpha.0
* Revert null properties on Transforms.setNodes
* v0.60.7-alpha.0
* Update examples to use custom Element and Text with discriminated unions
* Add documentation for using TypeScript improvements
* Be explicit about typescript version in package.json
* Force lerna bootstrap to fix build issues on CI and fix a few type examples
* Add slate devDependencies with * back
* v0.60.7
* Switch to a non prerelease version to fix lerna not linking in root
* Add documentation for not using prerelease versions and on how to create experimental releases
* Try removing lerna bootstrap and see if it works