1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-01-17 13:38:37 +01:00

3795 Commits

Author SHA1 Message Date
Dylan Schiemann
111f8ca9e3
Update release to use Node.js v16 (#4879)
* Update release to use Node.js v16

* Update comment workflow to  Node.js v16

* Update ci.yml node config

* Fix slack invite link in issue template
2022-03-08 22:17:34 -07:00
Dylan Schiemann
456d9baece
Attempt to clear GH actions cache with key (#4878) 2022-03-08 21:20:30 -07:00
Bryan Haakman
4d28948b90
Invert https://github.com/ianstormtaylor/slate/pull/4755 (#4874) 2022-03-08 19:40:50 -07:00
Marc
1356f2afc3
Fix a teeny tiny typo (#4875) 2022-03-08 19:32:39 -07:00
Dylan Schiemann
9907ad004e
Update to Node v16 for infrastructure (#4877)
* Update to Node v16 for infrastructure

* update node type def to Node 16
2022-03-08 19:25:28 -07:00
github-actions[bot]
7122454583
Version Packages (#4872)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate-react@0.74.1
2022-03-07 16:26:25 -07:00
Dylan Schiemann
ff2ca84772
Fix slate-react relase (#4870) 2022-03-07 16:20:55 -07:00
yongzs
7499d4b4c0
fixed cursor when we triple click on text and type over it #4862 (#4868)
* fixed cursor when we triple click on text and type over it

* fixed

* fixed

* Add changeset

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2022-03-07 03:58:34 -07:00
Jan Paepke
53f47b01d1
EXAMPLES: fix focus bug for hovering toolbar example (#4866)
* fix focus bug for hovering toolbar example

* added test
2022-03-06 21:43:58 -07:00
Daniel Shotonwa
8f646ce84e
Add Simple Alignment to richtext example (#4867) 2022-03-06 21:43:22 -07:00
github-actions[bot]
68aff89e89
Version Packages (#4863)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate-react@0.74.0
2022-03-03 18:47:48 -07:00
Jan Paepke
df1720d311
DOCS: improved deserialization example (#4856)
* Updated deserialize function

* forgot the .flat()

* made prettier happier
2022-03-03 18:27:19 -07:00
Fabio Moretti
47f2403e3a
Feature/slate selectors (#4841)
* Added a redux inspired slate selector

* added changeset
2022-03-03 18:25:56 -07:00
github-actions[bot]
f0530d2097
Version Packages (#4859)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate@0.73.1
2022-03-01 22:50:27 -07:00
Andrew Herron
33be22f3e3
Reverted 03861af (#4804) and added a test for the exception it caused (#4858) 2022-03-01 22:47:00 -07:00
github-actions[bot]
442d263672
Version Packages (#4843)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate@0.73.0 slate-react@0.73.0
2022-02-23 13:16:57 -07:00
Jim Fisher
465cf777cd
Define "hanging range" and intended behavior of unhangRange (#4852)
There is currently no definition of this in the docs, so it's very hard
to understand what this function is supposed to do, and whether it's
buggy. I've written this definition based on Ian Taylor's messages on
Slack [1]:

    Jason: Why does unhangRange only unhang the end of a range and not
    the start as well? Trying to tell if this is a bug or some logic I'm
    not following. If the start of the range is at the last index of a
    text shouldn't unhangRange advance that to the next node?

    ianstormtaylor: I don’t believe it’s a bug. It was designed to
    handle ranges that result from triple-clicks. Not that there might
    not be improvements, or that there might not be some other better
    way to solve for triple-clicks, or that there might be a better
    name for it

    Jason: When you say triple-click handling you mean the fact that
    the browser selection by default gets placed from start of line to
    start of next line? In that cause yes the end of the selection is
    where the problem is. If looked at as a more generic implementation
    it seems like unhanging the start in cases where you have
    {text: 'foo|'}, {text: 'bar|', bold: true} and it makes sense to
    normalize the selection to {text: 'foo'},
    {text: '|bar|', bold: true} which helps in some cases by avoiding
    splits that immediately get merged back, etc.

    ianstormtaylor: Yup, that’s exactly right. It was created for the
    triple-click case. I agree that something to handle the
    start-edged cases would be nice too. But folks in GitHub
    discussions have been kind of assuming that the code meant to be
    written for both, and that it’s a bug to fix, which isn’t true.
    I’m not sure if there are gotchas to expanding the scope to
    handle both edges

[1]: https://slate-js.slack.com/archives/CC58ZGGU9/p1632188507024300
2022-02-23 13:13:09 -07:00
Samu
482b090e6f
fix point transform for insert_text to account for affinity (#4848)
* fix point transform for insert_text

* add changeset
2022-02-23 13:08:00 -07:00
Eric Meier
100448d55c
render void spacer in readonly mode (#4840) 2022-02-17 04:57:30 -07:00
Jim Fisher
b8020ee6fc
Document additional schema constraints due to design of operations (#4838)
As discussed in https://github.com/ianstormtaylor/slate/issues/4836
2022-02-16 09:22:08 -07:00
github-actions[bot]
9267355d22
Version Packages (#4820)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate-react@0.72.9
2022-02-11 04:18:07 -07:00
Eric Meier
d5ac82373b
fix isDraggingInternally reset logic (#4828) 2022-02-10 21:00:17 -07:00
Masanori Onoue
80661509ec
fix not update state when unmounted (#4819)
* fix not update state when unmounted

* add changeset
2022-02-05 04:36:25 -07:00
github-actions[bot]
4b97197f9a
Version Packages (#4815)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate@0.72.8 slate-react@0.72.8
2022-01-31 12:43:10 -07:00
Dylan Schiemann
d54bc12f33
Update olive-bags-talk.md 2022-01-31 12:22:39 -07:00
Dylan Schiemann
27deaf3175
fix build (prettier) (#4817)
* fix build (prettier)

* fix build (prettier)
2022-01-31 11:50:34 -07:00
Dylan Schiemann
6d62abc103
Revert #4749 (#4816)
* Revert #4749

See note at https://github.com/ianstormtaylor/slate/pull/4749#issuecomment-1025742142

* Create olive-bags-talk.md

Add changeset
2022-01-31 07:57:41 -07:00
V_Lute
03861afc62
update insertText logic when selection is not collapsed (#4804)
* update insertText logic when selection is not collapsed

* add changeset

* fix bug when end of range is void

Co-authored-by: zhangpengcheng15 <zhangpengcheng15@jd.com>
2022-01-28 09:33:57 -07:00
Bryan Haakman
01dc0c57b2
Fix failing unhangRange test case with inlines (#4814)
* Add failing unhangRange test case

* Fix failing inline case?

* fix lint
2022-01-28 09:33:20 -07:00
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