1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-01-17 21:49:20 +01:00

3973 Commits

Author SHA1 Message Date
Ivan Voskoboinyk
1ff6e69093
Export createText from slate-hyperscript (#4932)
* Update index.ts

* Fix code style

* Add changeset
2022-04-11 06:10:12 -07:00
Sunny Hirai
bb4f1934c9 Moved documentation for refs in the Editor into its own section 2022-04-10 15:35:48 -07:00
Sunny Hirai
daa68dab89 Add descriptions of affinity to PathRef, PointRef and RangeRef documentation 2022-04-10 15:31:43 -07:00
Sunny Hirai
e7aa292323 Fixed several broken and missing links in the Location Types API Reference 2022-04-10 15:09:43 -07:00
Sunny Hirai
5400296e45 Add PathRef to Table of Contents of Documentation 2022-04-10 15:06:26 -07:00
Doug Reeder
2b94e17874
Documents how to implement a Void Element. (#4924)
* Documents how to implement a Void Element.

* Tightens up phrasing
2022-04-03 16:34:33 -07:00
github-actions[bot]
4df23c6e41
Version Packages (#4921)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate@0.76.1 slate-react@0.76.1
2022-04-03 10:02:04 -07:00
Eric Meier
f17413086e
Update examples in docs, editable voids example (#4925)
* Update examples in docs, editable voids example

* Update typescript docs
2022-04-03 09:57:38 -07:00
yongzs
aff67312cb
Fixed Triple click selection and copy&paste in read-only mode (#4914)
* Fixed Triple click selection and copy&paste in read-only mode

* Create khaki-candles-serve.md

* Update editable.tsx

make sense

* fixed 3871

* Update .changeset/khaki-candles-serve.md

* Update .changeset/khaki-candles-serve.md

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2022-04-03 09:09:03 -07:00
Adrien Wald
f6b7ca1f97
Run <Slate />'s focus event listeners after <Editable />'s focus handlers in React >= 17 (#4920)
* use focusin and focusout without capture if react >= 17

See https://github.com/facebook/react/pull/19186 for details on changes to `onFocus` and `onBlur`

* more accurate name for react version check const

* add changeset

* add comment about react >= 17 focus event listeners
2022-04-03 09:08:25 -07:00
Eric Meier
9892cf0ffb
Make onChange prop optional, update examples and docs to treat slate as uncontrolled (#4922)
* Make onChange prop optional, update examples and docs to treat slate as uncontrolled

* Add changeset
2022-04-03 08:52:32 -07:00
Eric Meier
08d5a12c91
Call keyDown handler while composing (#4923) 2022-04-03 08:44:46 -07:00
Eric Meier
7de7cdcf56
Restore user selection after beforeinput with target range (#4919)
* Restore user selection after beforeinput with target range

* Add changeset
2022-03-31 04:18:23 -07:00
github-actions[bot]
ce63a08c8e
Version Packages (#4898)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate@0.76.0 slate-react@0.76.0
2022-03-25 01:03:44 +00:00
Bryan Haakman
5ef346feb9
Fix NODE_TO_KEY correction for split_node and merge_node (#4901)
* Fix NODE_TO_KEY correction for split_node and merge_node

* fix lint

* add changeset

* Add NODE_TO_KEY tests for number of mounts for split_node and merge_node
2022-03-25 00:57:17 +00:00
jasonphillips
2a8d86f1a4
Fix child element decorations (#4910)
* fix slate-react handling of nested element decorations

* chore: add changeset

* changes from review
2022-03-25 00:31:35 +00:00
zhugexinxin
43ca2b56c8
feat: add merge to setNodes and test (#4912)
* feat: add merge to setNodes and test

* Add changset

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2022-03-24 00:25:36 -07:00
Dylan Schiemann
3453432f7a
Revert "Add merge to set node (#4905)" (#4913)
This reverts commit 9c758bb4cb9a5866beeda46f997fdac200aecfea.
2022-03-24 00:24:48 -07:00
zhugexinxin
9c758bb4cb
Add merge to set node (#4905)
* feat: add merge to setNodes

* chore: add merge to setNodes test

* chore: prettier

* chore: change to PropsMerge

* chore: restore the changes for addMark
2022-03-23 22:56:17 -07:00
Dylan Schiemann
947883435f
Fix logic in test, fixes #4764 (#4899) 2022-03-20 04:44:54 -07:00
Bryan Haakman
20acca4bc8
Add soft break as a separate overridable editor method (#4873)
add changeset
2022-03-20 04:30:08 -07:00
Ryan Mitts
07669dca4b
When resolving a slate Point from a DOM selection (toSlatePoint), consider that a node is only void if it's within the same editor that is resolving the Point. (#4885)
If you have a nested editor setup. For example, one editor has a void node that contains another editor. In this case, a resolution of a selection by the nested editor previously would consider that the selection is for a void node since an ancestor void node does exist. However, this selection is only a void node in the context of this editor if the ancestor void node is contained in the editor.
2022-03-20 04:04:33 -07:00
github-actions[bot]
1433499e98
Version Packages (#4890)
* Version Packages

* Update packages/slate/CHANGELOG.md

* Update packages/slate/CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
slate@0.75.0 slate-react@0.75.0
2022-03-14 22:36:10 -07:00
Dylan Schiemann
b5714a1d68
add missing changeset from #4889 (#4891) 2022-03-14 22:28:04 -07:00
zhugexinxin
970523f881
feat: add custom compare node props (#4889)
* feat: add custom compare props

* chore: add test for custom compare props
2022-03-14 16:21:44 -07:00
Mohammad ali Ali panah
3b3b0e32df
Fix chrome and edge three digit version check (#4883)
* fix chrome and edge three digit version check #4869

* add changelist
2022-03-14 16:19:36 -07:00
github-actions[bot]
2a620dc20d
Version Packages (#4880)
* Version Packages

* Update changelog

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
slate-react@0.74.2
2022-03-09 04:23:12 -07:00
Nemanja Tosic
1b205c087b
Fix stale decorations (#4876)
* test changes

* fix decoration not updating

* Add changeset

* Fix lint issues

* Tests with earlier version of Node.js

* Bump node version on CI

The base typescript config uses ESNext as target, so presumably the
latest node should be used.

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2022-03-09 04:06:18 -07:00
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