Some void elements are effectively stand-ins for text, such as with the mentions example,
where the mention element renders the character's name. Users might want to format Void
elements like this with bold, or set their font and size, so `editor.markableVoid` tells
Slate whether or not to apply Marks to the text children of void elements.
- Adds `markableVoid()` as a schema-specific overrideable test.
- Changes `addMark` and `removeMark` so marks can apply to voids. Also changes behavior
of collapsed selection so that if a markable Void is selected, the mark will be applied /
removed.
- Shows how `markableVoid()` can work in the mentions example
* Ensure the min-height for placeholders is set on the correct editor
* Add changeset
* Run prettier on changeset
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
* Move getDirtyPaths to the Editor object to allow for customization
* Add changeset for getDirtyPaths customization
Co-authored-by: Tom Krenzke <tom@daybreakhealth.com>
* wip
* wip
* wip - fully working without hard marks
* fix editor crashes when inserting/deleting at the edges of marks
* fix various restore dom related crashes
* fix delete with pending changes, zero widths on android, mutation tracking
* track placeholder delete in detached strings, zero-widths
* wip mark placeholders
* get rid of mutation detection in favor of beforeinput
* fix various selection race conditions
* fix various crashes when deleting at the beginning of nodes
* wip diff transforms, selection handling fixes
* cleanup restoreDOM and fix noop restore edge-case
* fix mark placeholders
* fix toSlatePoint edge-case
* properly flush user select with pending changes
* Prevent editor crash when deleting before a non-contenteditable element
* wip markdown shortcut example
* transform pending changes and selection by remote changes, simplify pending actions, handle all input types
* improve change transform, mark(-placeholder) handling
* manually handle gboard bug, fix restoredom nested editor
* fix parent mutation condition
* cleanup, mark placeholder fixes
* mark placeholder fixes
* fix mark placeholder condition
* hide placeholder if we have pending diffs
* cleanup
* yarn install
* add workaround for swiftkey placeholder issue
* cleanup
* add changeset
* feat(slate-react): fix edge-case crash, add androidPendingDiffs, rename scheduleFlushPendingChanges
* flush pending selection on same line without pending changes/action
* keep formatting of pending diffs when adding/removing selection marks
* unref selection ref on unmatching dom state
* improve markdown shortcut example flush trigger to show how a more generic solution would work
* fix markdown shortcut example trigger logic
* fix isInsertAfterMarkPlaceholder logic
* Replace master with main
npm tags sometimes failing to get applied with releases, warning mentioned this error.
* Update .github/workflows/release.yml
* Fix DOM selection sync when there are unexpected rerenders
* Create a useSlateSelection hook and expose it
* update docs
* add changeset
* Undo the useEffect change and add a useSlateValue method
* Use a version counter instead for SlateContext
* comment out layout effect prevention for now
* Undo useV comparison for now
* Change the changeset
* Fix lint
* Remove the useSlateValue hook
* remove some unused imports
* Add useSlateWithV to the docs
* fix changeset lint
* Change changeset to minor instead