1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-06 08:09:41 +01:00

3766 Commits

Author SHA1 Message Date
github-actions[bot]
6ef6454e44
Version Packages (#4799)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate-react@0.72.7
2022-01-27 21:55:12 -07:00
Eric Meier
a5fd62ddd6
fix: toSlatePoint suppressThrow leaf without text node (#4813) 2022-01-27 18:09:05 -07:00
Eric Meier
e998752989
fix: flush onDOMSelectionChange on onDOMBeforeInput (#4809) 2022-01-27 07:20:08 -07:00
Alexey Toksarov
2a18e75c21
Fix links example link in the readme (#4803) 2022-01-27 07:12:21 -07:00
Sihong
3796c514d6
fix: text content not rendered on ssr (#4798) 2022-01-22 03:53:56 -07:00
github-actions[bot]
33c93a90c5
Version Packages (#4797)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate-react@0.72.6
2022-01-20 04:50:46 -07:00
Sihong
5d8a160669
fix: text not rendered on server-side rendering (#4796) 2022-01-20 03:32:15 -07:00
github-actions[bot]
a65aec1c27
Version Packages (#4794)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate-react@0.72.5
2022-01-19 09:23:34 -07:00
Vsevolod Rodionov
a3dfb151d4
Fix: when switching between editors, Slate selection and DOM Selection can mismatch which causes React to break (#4749) 2022-01-19 07:53:26 -07:00
David Brito
9f3aee5536
Merge layout effects for adding focus and blur event listeners (#4790)
* Merge layout effects for adding focus and blur event listeners

* run yarn fix
2022-01-19 07:51:42 -07:00
github-actions[bot]
11253c5c3b
Version Packages (#4761)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate-react@0.72.4
2022-01-13 10:14:25 -07:00
陈耀耀
a8c08a4e01
Android merge Editor.insertText logic. (#4788)
* fix: Android merge Editor.insertText logic

* feat: add changeset
2022-01-13 06:24:36 -07:00
Alessio Galdy
67aa1f1010
Rollback 4779 and always call Transforms.setSelection (#4786)
* Revert "Fix Android editor.insertText regression (#4779)"

This reverts commit 345b8fc9e8f073674c006098bd843823309db2e2.

* * Restore logic to delay text insertion on android
* Always call Trasform.setSelection before calling Editor.insertText

* change set

* yarn fix

* Fix changeset

* Restore old changeset file
2022-01-12 10:53:14 -07:00
Dylan Schiemann
ce1e096df7
update emotion dependency for site (#4783) 2022-01-11 08:36:04 -07:00
Alessio Galdy
345b8fc9e8
Fix Android editor.insertText regression (#4779)
* * remove scheduling of text updates using setTimeout
* call Transforms.setSelection before Editor.insertText

* changeset

* Restore logic to set isComposing to false
2022-01-11 04:37:05 -07:00
Adrian
e3a325f8a6
iframe example - use an onLoad callback instead of the ref (#4758)
* use an onLoad callback instead of the ref

* expect body to not be null on the iframe test

* remove onLoad prop
2022-01-10 16:21:20 -07:00
Jacob Hurwitz
8daa77e9fa
run focus event listener after existing onFocus handlers (#4755)
* run focus event listener after existing onFocus handlers

* change window.setTimeout to setTimeout
2022-01-10 16:20:47 -07:00
Antonio Sanchez Gomez
51e02de9de
Update docs to reflect Slate is an uncontrolled component (#4768)
* Updated documentation

* Update docs/walkthroughs/01-installing-slate.md

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

* fix: formatting errors

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2022-01-10 03:42:46 -07:00
Desmond Brand
1b0e7c6b92
Docs shouldn't useMemo for editor (#4766)
As already discussed almost a year ago in #3198, `useMemo` doesn't guarantee persistence. This breaks Fast Refresh.

`useState` without a setter is a straightforward fix that avoids dependencies; let's get the docs updated so Fast Refresh works again.

Fixes #3198
2022-01-08 04:34:40 -07:00
Dylan Schiemann
cc9cba017a
Revert "Warn when normalization removes node (#4769)" (#4776)
This reverts commit 0ca31e74985cc15e81f941a34c00c10b88f2ca76.
2022-01-07 16:21:54 -07:00
Jim Fisher
4b2d4de4bf
Show example of a workaround for Chrome bug that puts cursor in wrong place (#4772)
There is a Chromium bug where, if you have an inline at the end of a block,
clicking the end of a block puts the cursor inside the inline
instead of inside the final {text: ''} node.

This commit updates the inlines example to show the problem, and to show
a known workaround for the problem.

See for context: https://github.com/ianstormtaylor/slate/issues/4704
2022-01-06 13:15:14 -07:00
Jim Fisher
0ca31e7498
Warn when normalization removes node (#4769)
* Warn when normalization removes node

Slate requires the invariant that children are all blocks or all inlines.
It enforces this in default normalization by removing children.
When such a node is removed, it's almost certainly due to a programming
error: the developer needs to fix their application to ensure it
maintains this invariant. But currently Slate does not tell the
developer this.

I made such a programming error, and spent a long time debugging nodes
that mysteriously went missing. I would have fixed it within 30 seconds
if Slate had warned me when it detected this error.

(Note I have used console.warn despite the eslint rule. As far as I can
see, Slate has no other facility for runtime warnings.)

* Add changeset
2022-01-05 17:44:48 -07:00
Alessio Galdy
e9a46ad29e
Fix editor.insertText never gets called inside plugins on Android (#4753)
* Call Editor.insertText instead of Transforms.insertText to allow overriding by plugins

* Use Editor.insertText in android-input-manager

* changeset
2022-01-04 06:10:35 -07:00
github-actions[bot]
735d2d047a
Version Packages (#4743)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate@0.72.3
2021-12-23 05:22:05 -07:00
github-actions[bot]
a54a8e317f
Version Packages (#4736)
* Version Packages

* Update CHANGELOG.md

Add a missing changeset from one of the PRs.

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-12-22 05:05:07 -07:00
Doug Reeder
c90ec8e837
Adds documentation for PathRef (#4740) 2021-12-22 05:04:14 -07:00
Ivan Voskoboinyk
205d4b7e66
Add tests for Editor.unhangRange() (#4703)
* Add tests for Editor.unhangRange()

* Extend tests for `Editor.unhangRange()` to cover voids

* Fix lint

* Add changeset
2021-12-22 05:02:50 -07:00
Steve Marquis
e5427dddfc
Avoid transforming dirty paths if the op won't touch them (#4735)
* Avoid transforming dirty paths if the op won't touch them

* Avoid the loop entirely if op doesn't affect path
2021-12-18 08:39:09 -07:00
Peter Sipos
ccafb6982f
Optimize TextString rendering to support browser/OS text features, eg fix native spellcheck (#4733)
* slate-react: use a layout effect to render leaf text nodes instead of via virtual DOM, which implements diffing with real DOM avoiding interference with native TextNode behaviors for example spellcheck

* lint

* clarify and simplify extreme case of null text in TextString rendering

* code style: use string interpolation in TextString

Co-authored-by: Nemanja Tosic <netosic90@gmail.com>

Co-authored-by: Peter Sipos <schipy@craft.do>
Co-authored-by: Nemanja Tosic <netosic90@gmail.com>
2021-12-18 08:38:51 -07:00
Doug Reeder
228cee56a1
Clarifies when to use Editor.insertNode vs. Transforms.insertNodes (#4731) 2021-12-18 07:05:10 -07:00
Dan Tello
65708358bb
fix: isBlockActive should use Array.from() (#4662)
* fix: isBlockActive should use Array.from()

The richtext.tsx example `isBlockActive`  was not working for me in my environtment because `Editor.nodes` returns a Generator, not an Array. So `isBlockActive` always returned false. Wrapping it in `Array.from` fixes the example.

* run prettier

Co-authored-by: Dan Tello <dtello@medallia.com>
2021-12-17 05:34:18 -07:00
Alex
ab62da2064
chore: add vscode launch.json debug config (#4729)
* chore: add vscode launch.json debug config

* add changeset
2021-12-17 05:01:10 -07:00
Doug Reeder
5d3eccf262
Documents use of Editor.withoutNormalizing in conjunction with normalization (#4737) 2021-12-16 22:15:22 -07:00
陈耀耀
3c07a8706e
fix: [AndroidEditor] Solve input association problems and add click events. (#4734)
Co-authored-by: 陈耀耀 <chenyaoyao@taptap.com>
2021-12-16 14:33:50 -07:00
github-actions[bot]
7bfb61c769
Version Packages (#4723)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate-react@0.72.1
2021-12-10 08:58:00 -07:00
Doug Reeder
e04671ffe8
Clarifies docs for RangeRef & PointRef; fixes TOC for Editor API (#4724) 2021-12-10 05:53:37 -07:00
Alex
0334851cb1
Fix "Cannot resolve from DOM point" error on onDomSelectionChange for readonly void elements (#4727)
* fix error caused by selecting void nodes in readonly editor

* add changeset
2021-12-10 05:52:03 -07:00
Bryan Haakman
1217021a9a
Add origin event type to setFragmentData to be able to distinguish copy, cut and drag (#4720)
* Add origin event to setFragmentData to be able to distinguish copy, cut, drag

* fix lint

* add changeset

* Make originEvent optional
2021-12-08 10:56:11 -07:00
github-actions[bot]
dc2999a1aa
Version Packages (#4713)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate@0.72.0 slate-react@0.72.0
2021-12-07 06:57:26 -07:00
ttitoo
8bc6a46460
Fix CJK IME(like Chinese, Japanese) double input (#4702)
* fix: resolve CJK IME double input

* fix: resolve UC mobile no input issue

* feat: add changeset

* Update .changeset/large-melons-warn.md

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

* fix: more specific way to deal with browsers

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-12-05 11:35:24 +00:00
Alex
c020ca23b6
Fix onDragStart callback dependency on 'readonly' (#4707)
* fix: add 'readonly' dependency for onDragStart callback

* add changeset
2021-12-04 09:08:48 -07:00
Eric Meier
6d19407776
Update android restoreDOM to allow partial dom restoring (#4706)
* Update android restoreDOM to allow partial dom restoring

* Fix useContentKey re-render timing
2021-12-04 08:57:30 -07:00
Bryan Haakman
2fc7ad924c
Allow Operation type to be extended (#4708)
* Allow Operation type to be extended

* fix lint

* add changeset
2021-12-04 08:54:16 -07:00
github-actions[bot]
fece5c1570
Version Packages (#4683)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate@0.71.0 slate-react@0.71.0
2021-11-23 03:17:06 -07:00
unageek
e3afda9466
fix: cursor jumps more than one character unexpectedly (#4671)
* Add test cases suggested in https://github.com/ianstormtaylor/slate/issues/4649#issuecomment-974015248

* fix: cursor jumping more than one character

* Optimization

* Make ZWJs in test strings visible
2021-11-23 01:45:08 -07:00
Matthew Keil
e538065572
fix ssr prop mismatch (#4682)
* fix ssr prop mismatch

* added changeset
2021-11-22 09:29:14 -07:00
Victor Baron
2523dc4f6e
Fix deep-equality for array properties (#4672) 2021-11-22 09:09:51 -07:00
github-actions[bot]
0540fea6a8
Version Packages (#4675)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate-react@0.70.2
2021-11-20 15:09:22 -07:00
Eric Meier
807716d7df
fix: flush selection change on before input (#4669)
* fix: flush selection change on before input

* chore: remove redundant option from debounce
2021-11-20 11:26:13 -07:00
Leo
0f194a86a0
fix: use ownerDocument to create element (#4661)
* fix: use ownerDocument to create element

* chore: add changeset
2021-11-20 11:24:53 -07:00