* Switch back to using inline styles for default editor styles
* Add example page and test for editor styling
* Add section in docs for editor styling
* Add test for editor height being set to placeholder height
* Add changeset
* Official custom inlines example
This generalizes the "links" example to an "inlines" example, adding
a new example of an inline: an "editable button".
Firstly, this is important to demonstrate that Slate really does allow
_custom_ elements, and not just "standard" ones like links that you'll
find in any editor.
Secondly, it's important to show an example of an inline where "offset"
movement should be used. With links, it's arguable that the cursor
positions <link>foo<cursor/></link> and <link>foo</link><cursor/>
should be considered the same, because they display in the same
position. But with the editable button, the cursor is clearly in a
different position, and so offset movement should be used.
* lint
* fix integration test
* update readme
* try again
* 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>
* mvp implementation for working with non-global window instances
* remove unused element renderer
* fix typo in comment
* fix wrong example reference
* Add @babel/helper-call-delegate to fix build error
Co-authored-by: Lukas Buenger <lukasbuenger@gmail.com>