1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-04-21 05:42:00 +02:00

3744 Commits

Author SHA1 Message Date
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
github-actions[bot]
3ad3aaccad
Version Packages (#4651)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate-react@0.70.1
2021-11-16 04:31:36 -07:00
Karthikeyan
95389ed7b0
fix: default scroll selection (#4652)
* fix: default scroll selection

* feat: use Range.isCollapsed to check the selection

* chore: add changeset

* fix: grammer correction

* fix: grammer correction
2021-11-16 02:21:14 -07:00
Doug Reeder
7d9d25e179
Adds clarification & examples to demystify Transforms. (#4653)
* Adds clarification & examples to demystify Transforms.

* Fleshes out documentation of NodeOptions for Transforms

* Update docs/concepts/04-transforms.md

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

* Uses 'API' in the title of all API documents

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-11-16 02:20:43 -07:00
meri-leeworthy
5dc9dc5227
missing dependency (#4656) 2021-11-15 02:02:51 -07:00
Andreas Hörnicke
2c7750cac5
fix: weak guard on DataTransfer to not rely on current window (#4654) 2021-11-15 01:59:02 -07:00
Ivan Voskoboinyk
b6643132f1
Do not try to disable Grammarly in Slate (#4650)
* Do not try to disable Grammarly in Slate

As the `data-gramm` attribute is no longer working actually. See #4124 

The Grammarly extension is not causing the DOM issues anymore, as they have reworked their highlighting logic: 
https://www.grammarly.com/blog/engineering/making-grammarly-feel-native-on-every-website/

* Add changeset
2021-11-09 16:52:31 -07:00
github-actions[bot]
9874ed704f
Version Packages (#4637)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate@0.70.0 slate-react@0.70.0
2021-11-07 07:09:15 -07:00
Jimmy Oliger
5818aca503
Fix issue with unicode 1.1 smileys (#4565) 2021-11-04 08:06:41 -07:00
Ivan Voskoboinyk
e0f41514a1
Improve props argument type in Transforms.setNodes() (#4638)
* Fix `setNodes()` props argument type

Because Typescript can know which type of nodes we are modifying thanks to the `T` inferred from `match` function, 
it can also properly narrow down the `props` argument type.

* Fix TS errors in examples

* Add a changeset
2021-11-04 04:43:18 -07:00
Charlie Martin
9e8d5e2b9b
fix: drag and drop in iframes (#4506) (#4636)
* fix: drag and drop in iframes (#4506)

* Create changeset

* Update iframe-drop-actions.md
2021-10-28 12:36:46 -07:00
github-actions[bot]
35abac13b0
Version Packages (#4632)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate-react@0.69.0
2021-10-26 21:48:52 -07:00
zhugexinxin
2ee2753d72
fix: image disappears when the drag fails (#4631) 2021-10-26 21:44:09 -07:00
Jim Fisher
0b256b211e
Editable button example: emulate button to work around browser bug (#4630)
It's important to have 100% working examples. Unfortunately this example
I introduced has a bug on Chrome and Safari, where the cursor jumps
around wrongly when using the "up" and "down" keys to navigate. This
is due to a browser bug with display:inline-block elements, and there
is no known workaround except to use display:inline.
2021-10-26 21:12:36 -07:00
Eric Charles
e54f2a0ea0
Fix double insertion due to insertTextData being called when it should not (#4625)
* fix double paste due to insertTextData being called when it should not

* Document return type of insertTextData and insert FragmentData

* Add changeset
2021-10-26 21:09:36 -07:00
github-actions[bot]
02e9245646
Version Packages (#4629)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate-react@0.68.1
2021-10-25 09:44:43 -07:00
Jim Fisher
d94b229121
Fix examples/images integration test (#4628)
Sorry, I broke this test in https://github.com/ianstormtaylor/slate/pull/4616
by adding a second image to the example!
2021-10-25 08:58:34 -07:00
Jim Fisher
ec01e75fff
Revert "Do NOT use exact match when updating dom selection" (#4627)
* Revert "Do NOT use exact match when updating dom selection"

The change to `exactMatch: false` in https://github.com/ianstormtaylor/slate/pull/4304
was intended to fix https://github.com/ianstormtaylor/slate/issues/4293,
a bug where "backwards typing" happened in nested editors.

But this change has introduced at least two new bugs:

- https://github.com/ianstormtaylor/slate/issues/4601
- https://github.com/ianstormtaylor/slate/issues/4626

These are (IMO) worse than the original "backwards typing" bug.

From discussion in https://github.com/ianstormtaylor/slate/pull/4304,
the true underlying bug is in ReactEditor.toSlateRange. I'll attempt to
fix this underlying bug instead.

* changeset
2021-10-25 08:43:06 -07:00
github-actions[bot]
381f91b1dd
Version Packages (#4624)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate-react@0.68.0
2021-10-24 22:18:10 -07:00
github-actions[bot]
d467e33c33
Version Packages (#4610)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2021-10-24 08:11:55 -07:00
Nicklas Andersson
0b59ad5414
Feat: Enable selection when editor in readonly=true (#4620)
* make editor.selection avaliable when Editor is contenteditable="false"

* remove dom selection limition of read-only

* Improve grammar of comments regarding selection when read-only is true

* Add Changeset

Co-authored-by: Xheldon <c1006044256@gmail.com>
2021-10-24 07:31:31 -07:00
Jim Fisher
77d9f60ab5
Fix crash when a void node deletes itself on click (#4616)
* Fix crash when a void node deletes itself on click

Fixes https://github.com/ianstormtaylor/slate/issues/4240

* Add 'image delete' feature to example

My immediate motivation is to demonstrate the bug that this fixes. But
this is also a very common editor feature, and I think it's valuable
to show how to achieve it.

* add changeset

* fix:eslint

* revert changes to mentions.tsx
2021-10-24 07:31:00 -07:00
Eric Charles
b50a772136
Add missing insertFragmentData and insertTextData on the ReactEditor class (#4622) 2021-10-23 03:48:05 -07:00