1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-03-23 14:49:44 +01:00

56 Commits

Author SHA1 Message Date
Sihong
4b373dc290
fix: hide placeholder when composing (#4352) 2021-08-05 11:05:42 -07:00
gyh9457
bde6e80476
fix(slate-react): use Text.equals to compare leaf (#4175)
* fix(slate-react): use Text.equals to compare leaf

* refactor(slate-react): simplify MenoizedLeaf logic

* Create breezy-lizards-travel.md

* Update packages/slate-react/src/components/leaf.tsx

Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-08-05 10:42:41 -07:00
liangxiwei
13b3f9c783
Do not remove empty node in merge operation if it is first children i… (#4287)
* Do not remove empty node in merge operation if it is first children in parent(#4228)

* Create merge-nodes-issue

* fix typo in changeset

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-08-05 10:38:31 -07:00
Jake Donham
0188980796
fix bug: decorate is not called for immediate children of editor (#4394)
* fix bug: decorate is not called for immediate children of editor

* short-circuit return instead of else in Child

Co-authored-by: Tim Buckley <timothypbuckley@gmail.com>

* oops missing brace

* changeset

Co-authored-by: Tim Buckley <timothypbuckley@gmail.com>
2021-08-05 13:22:48 -04:00
Andrew Herron
0214b63077
Skip wrapping nodes when the only match is an editor (#4253)
* Skip wrapping nodes when the only match is an editor

* Check for empty path instead of using isEditor
2021-08-05 10:12:53 -07:00
Sunny Hirai
c217dbb5b9
Fix scroll into view to scroll parent scrollables (#4369) 2021-07-09 15:12:13 -07:00
Krzysztof Mędrzycki
46c8871c9c
Re-render leaf when new properties were added to it (#4347) 2021-07-09 08:52:06 -07:00
github-actions[bot]
ea5e3e4ebf
Version Packages (#4332)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2021-06-09 12:04:11 -04:00
Szymon Wiszczuk
a3bc97af3e
Fix deletion of selected inline void nodes in Safari (#4331)
Co-authored-by: Claudéric Demers <clauderic.d@gmail.com>
2021-06-09 11:54:41 -04:00
github-actions[bot]
6c993523ca
Version Packages (#4325)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2021-06-09 11:07:27 -04:00
Claudéric Demers
61171a2382
Fix backward typing bug in Safari by ensuring the selection is removed on blur (#4324)
Safari doesn't always remove the selection, even if the contenteditable element no longer has focus. In this scenario, we need to forcefully remove the selection on blur https://stackoverflow.com/questions/12353247/force-contenteditable-div-to-stop-accepting-input-after-it-loses-focus-under-web
2021-06-07 15:25:48 -04:00
github-actions[bot]
dbf9962af1
Version Packages (#4273)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2021-06-01 15:08:20 -04:00
Andrew Herron
411e5a193b
Don't import slate-history in slate-react (#4266) 2021-06-01 14:22:54 -04:00
Claudéric Demers
a7e3a18187
Fix deletion in Chrome when inline void node is selected (#4307) 2021-06-01 14:11:05 -04:00
georgberecz
2c17e2b7f9
Allow control of Slate's event handler execution in custom event handler API (#4299)
Co-authored-by: Georg Berecz <gberecz@palantir.com>
Co-authored-by: Claudéric Demers <clauderic.d@gmail.com>
2021-06-01 10:26:08 -04:00
Nicolas DUBIEN
dfc039601f
Fix warnings related to autoCorrect and autoCapitalize (#4295)
Related to https://github.com/ianstormtaylor/slate/issues/4248
2021-05-26 22:27:41 -04:00
Omer Gurarslan
ff267767f6
chore(slate-react) typo - rename extractMatch to exactMatch (#4271)
* Fix typo - rename extractMatch to exactMatch

* update changelog

* update changelog
2021-05-20 17:21:38 +01:00
Claudéric Demers
294d5120ae
Fix errors accessing globalThis in browsers that do not implement it (#4272) 2021-05-20 11:49:29 -04:00
github-actions[bot]
7632d4d0e5
Version Packages (#4259)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2021-05-14 15:35:42 -04:00
Claudéric Demers
4f0d1120d4
(Re)-Introduce Android support via a MutationObserver based reconciliation layer
* Revert "Temporarily revert Android commits in order to create a release of Slate focused solely on Android (#4256)"

This reverts commit 4f502119841d013ea2749e91f4bd1f793dc7f98e. 

* Updates to android composition manager

* Add user input tracking

It's necessary to only track mutations that result from user input. Some mutations that happen inside block or leaf nodes can happen outside of the render loop of the Editable component.
2021-05-14 15:25:52 -04:00
github-actions[bot]
39b0254867
Version Packages (#4243)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2021-05-12 21:29:31 -04:00
Claudéric Demers
4f50211984
Temporarily revert Android commits in order to create a release of Slate focused solely on Android (#4256)
* Revert "Add DefaultEditable and AndroidEditable to exports (#4255)"

This reverts commit 5298e51f6e8a7d62acb71092f7afd6565cbdc65e.

* Revert "Feature/android keyboard support (#4200)"

This reverts commit e03ce7c5614a1a69d039bfbeea94696376585fd0.
2021-05-12 21:24:57 -04:00
Wayne Leroux
e03ce7c561
Feature/android keyboard support (#4200)
* Added Android Keyboard Support

* Added changeset for android keyboard support

* Removed dead code in android editable that supported non-android environments

* Removed unnecessary attributes observation for android-editable

* Removed dead code

* Added no-error boundary

* Fixed issues with linters
2021-05-12 16:30:39 -07:00
Jonas Kruckenberg
b33a531bd0
replace lodash depency in slate (#4245)
* replace lodash/omit with custom fn

* replace lodash/isEqual with fast-deep-equal
2021-05-13 06:45:45 +10:00
Ulion
e6413d4625
Fix addMark/removeMark caused unexpected onChange. (#4227)
* Fix addMark/removeMark caused unexpected onChange.

* Create three-parrots-remember.md

Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
2021-05-05 20:30:17 -04:00
Dylan Schiemann
623960a7d1
Update IS_FIREFOX_LEGACY flag to prevent FF crash (#4237)
* Update IS_FIREFOX_LEGACY flag to prevent FF crash

#4118 and #4150 introduced IS_FIREFOX_LEGACY, but this block of code was not updated to reflect that. This breaks insertion of emoji and unicode characters in slate-react. This change fixes #3855.

* Update editable.tsx

* Create forty-mails-roll.md

* Update editable.tsx

Apologies, in my tests I was using yarn patch and didn't need to modify the import statement, hopefully this will pass CI now.

Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
2021-05-05 19:56:10 -04:00
Andrew Herron
feb293aaa2
Apply no-children normalization fix before normalization (#4208)
* Test cases for failure condition

* Before normalizing ensure all elements have at least one text child. This is a normalization requirement that some normalization fixes require, so it must be done as an initial dedicated pass.
2021-05-05 19:39:37 -04:00
Andrew Herron
796389c7d3
Added insert_node path checking to match how other operations are applied (#4230)
* Added try/finally to editor.apply and Editor.withoutNormalizing for state cleanup

* Added insert_node path checking to match how other operations are applied
2021-05-05 19:31:13 -04:00
Claudéric Demers
c14e1fbc77
Fix duplicated content and other bugs related to drag and drop handling (#4238)
* Fix drag and drop logic

* Add changeset
2021-05-05 19:26:43 -04:00
github-actions[bot]
f2d110100b
Version Packages (#4198)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2021-05-05 19:10:11 -04:00
Claudéric Demers
1c32b97d23
Collapse expanded selection before move word (#4211) 2021-05-03 15:29:27 -04:00
Julian Krispel-Samsel
737aaa9cde
Fix iframe crash (#4219)
* fixes #4170

* add smoke test for iframe example

* add changeset

* update changeset wording
2021-04-26 14:47:12 +01:00
Julian Krispel-Samsel
ea2eefefb8
Add renderPlaceholder (#4190) 2021-04-23 21:22:11 +01:00
kamilkazmierczak
6a1376332b
Make HAS_BEFORE_INPUT_SUPPORT flag more generic. (#4118)
* Change "HAS_BEFORE_INPUT_SUPPORT" flag to more generic.

* Fix patterns and styles issues.

* Fix lint issues.

* Create dirty-rabbits-speak.md

* Update dirty-rabbits-speak.md

* Update editable.tsx

Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
2021-04-13 11:20:09 -04:00
Ian Storm Taylor
d79267c144
Update silent-bees-sing.md 2021-04-13 11:17:02 -04:00
Ridham Bhat
95f402c594
Correcting the splitting logic in setNodes (#4168)
* Defined conditions to always split nodes

Those conditions are:
- When the anchor does not lie at the start of a node.
- When the focus does not lie at the end of a node.

* prev variable now points to correct updated node.

Previously, in the case the previous node gets merged in last iteration,
prev pointer could be pointing to the wrong node.
That posed problems, especially when normalizing empty text nodes.
So, now in every iteration, we get a copy of updated node structure,
and take value of prev from that.

* Test to check splitting and normalization logic.

- In this, since anchor and focus bleeds on both sides, splits happen.
- Empty text nodes are introduced on either side.
- New properties are set in the new node selection.
- Normalization happens and takes care of those empty text nodes.

* Create two-lies-appear.md

* Update two-lies-appear.md

Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
2021-04-13 11:15:47 -04:00
Bjørn Stabell
fd70dc0b2c
Save some remove_text calls if the text is zero length (#4193)
* Save some remove_text calls if the text is zero length.

* Remove unnecessary !text check - text is always string, and add similar check to 'insert_text' as well

* Create giant-adults-matter.md

Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
2021-04-13 11:14:30 -04:00
Andrew Herron
2dad21d1d7
set_node operations did not invert correctly after serialization (#4078)
* Use null instead of undefined as the old value for set_node operations that add a property

* Changelog

* Omit undefined values from `set_node` operations completely. Delete missing property values in `Transforms.apply()` instead.

* Add tests for removing set_node properties with null and undefined
2021-04-13 11:06:07 -04:00
Githoniel
ea6dc08913
fix ime double input with mark (#4158)
* fix ime double when apply mark

* add changeset

* refactor to use auto-incrementing key and add comments for it

* Update lovely-walls-knock.md

* Update lovely-walls-knock.md

Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
2021-04-13 10:59:07 -04:00
Githoniel
de5cc7e5ed
feat: sync selection to extactly matched DOM selection (#4157)
* feat: sync selection to extractly dom selection

* revert mistakenly modified files

* add changeset

* toSlatePoint will throw error again when not extractMatch

* Fix misspellings, rename extractMatch to exactMatch

* rename option to match code style

* Update four-poets-move.md

Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
2021-04-13 10:58:46 -04:00
Ian Storm Taylor
4eec49de16 rename master to main 2021-04-01 13:40:25 -04:00
github-actions[bot]
f76ff2a276 v0.62.0 (#4156)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2021-04-01 01:38:28 -04:00
Ian Storm Taylor
d5e27bedbd try updating changesets config 2021-03-31 22:36:02 -04:00
Ian Storm Taylor
d5589279e8 add changesets 2021-03-31 22:07:22 -04:00
Ian Storm Taylor
c60020244b update changesets 2021-03-31 21:55:10 -04:00
cvlmtg
469e6b26f5
fix onPaste handler on Chrome / Safari (#3396)
* fix onDOMBeforeInput callback definition

* fix onPaste on chrome / safari

* improve comment

* Update editable.tsx

* Create real-suns-matter.md

Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
2021-03-31 18:34:04 -04:00
Mikel Canovas
7fe41f1566
Fix error when trying to grab selection of a void node while read only (#3894)
* 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>
2021-03-31 18:33:28 -04:00
nivekithan
bbd7d9c330
replace IS_FIREFOX with IS_FIREFOX_LEGACY in HAS_BEFORE_INPUT_SUPPORT (#4150)
* replace IS_FIREFOX with IS_FIREFOX_LEGACY in HAS_BEFORE_INPUT_SUPPORT

* fix linting errors

* Create afraid-donuts-flow.md

* Update environment.ts

Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
2021-03-31 18:09:46 -04:00
pubuzhixing8
bf83f333e6
fix DOM selection can not be updated when use composition input on Safari #3196 (#3698)
* 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>
2021-03-31 17:06:31 -04:00
Mateusz Burzyński
f3fb40cce0
Fixed an issue with controlled value messing up editor.selection (#3652)
* Fixed an issue with controlled value messing up editor.selection

* Create fifty-ducks-sip.md

Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
2021-03-31 16:13:42 -04:00