1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-12 02:03:59 +02:00
Commit Graph

1000 Commits

Author SHA1 Message Date
Seiichi Nishikata
220f2d2ce6 Fix invalid cursor when IME converting (#4450) 2021-08-13 03:52:42 -07:00
I Made Budi Surya Darma
a1f925bddf fix(android): Get fragment from text/html when application/x-slate-fragment is missing on copy-paste slate fragment in android (#4433)
* 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
2021-08-13 03:44:41 -07:00
Samarjeet
906e5af1b1 Capture element selections through useSelected (#4365)
* Capture element selections (ianstormtaylor#4338)

* Rebase

* Add changeset
2021-08-12 07:03:22 -07:00
Tomas Carnecky
62d1a068be Do not needlessly JSON.stringify() the whole editor (#4411)
* 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>
2021-08-12 06:59:53 -07:00
Brian Krausz
25afbd4300 Use native character insertion to fix browser/OS text features (#3888)
* 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>
2021-08-11 15:57:10 -07:00
github-actions[bot]
936070738c Version Packages (#4368)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2021-08-10 10:12:29 -07:00
Benny Zhao
3f69a9f395 Update findDocumentOrShadowRoot to return the root node instead of throwing unnecessarily (#4427)
* 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!
2021-08-10 10:03:41 -07:00
Jake Donham
237edc6ea6 fix decorate bug (#4277) without adding extra layers of render tree (#4421)
* fix #4394 without adding extra layers of render tree

* oops unused import

* Add changeset

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-08-09 19:59:59 -07:00
Ulion
ca9e2147c1 Support custom scrollIntoView from user side. (#4037)
simplify scroll into view call
2021-08-07 06:12:07 -07:00
Bryan Haakman
1f3a489afd Fix useTimeout type to use browser type instead of nodejs type (#4419) 2021-08-06 15:30:48 -07:00
Dylan Schiemann
e0776c5c92 Allow setFragmentData without clipboardData object (#4333)
* allow setFragmentData to be used without a copy/paste or DnD data structure

* Add changeset

* return data for use outside of setFragmentData call
2021-08-06 07:43:42 -07:00
Ulion
6c84422721 Fix ios chrome ime double input issue. (#4049)
* Fix ios chrome ime double input issue.

* add changeset

* pretty fix.

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>

Thanks @ulion!
2021-08-05 20:58:46 -07:00
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
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
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 4f50211984. 

* 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 5298e51f6e.

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

This reverts commit e03ce7c561.
2021-05-12 21:24:57 -04:00
Sunny Hirai
5298e51f6e Add DefaultEditable and AndroidEditable to exports (#4255) 2021-05-12 17:02:54 -07: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
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
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
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
c5d412f5c6 add lint-staged for auto-formatting commits 2021-04-01 01:41:07 -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
d288842aee fix typescript errors 2021-04-01 00:43:24 -04:00
Ulion
8a2a60b052 Fix normalizeDOMPoint to do better job. (#4048) 2021-03-31 22:06:30 -04:00
Ian Storm Taylor
00393bb185 port long placeholder pr to master 2021-03-31 22:04:30 -04:00
Ian Storm Taylor
b15fba61f8 port re-rendering on focus pr to master 2021-03-31 22:02:41 -04:00
Ulion
39e47dc518 Decorate re-render optimize to not re-render all elements. (#4138)
* Decorate re-render optimize to not re-render all elements.

* Move provider one level up due to Children no longer component.

* lint fix
2021-03-31 21:24:07 -04:00