1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-06 07:17:27 +02:00
Commit Graph

4195 Commits

Author SHA1 Message Date
Michael
cb133a785f upgrade yarn (#5242)
Signed-off-by: Michael Darr <michael.e.darr@gmail.com>

Signed-off-by: Michael Darr <michael.e.darr@gmail.com>
slate@0.88.1
2023-01-07 05:58:12 -07:00
Sim Ho
55effa953c Update Operation API documentation (#5239)
* fix typo in implementation

* doc based on implementation

* fix doc typo
2022-12-29 16:38:03 -07:00
Yoel
d7353677e3 Add Eraser (#5240) 2022-12-29 16:37:21 -07:00
github-actions[bot]
f2fb5aac5d Version Packages (#5238)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-12-22 04:37:32 -07:00
Dylan Schiemann
43a5f6f224 Update ci to Node 18 (#5237)
* Update ci to Node 18

* updates for Node.js, license year
2022-12-21 22:52:41 -07:00
Pawel Piotrowicz
36203b3f10 Fix editor above with point (#5235)
* Fix Editor.above with point

Editor.above should ignore checking text nodes (they're never above
anything) and continue looking for ancestors.
Otherwise it won't be able to find any above nodes when starting to look
from a text node.

* Add changeset
2022-12-21 22:44:41 -07:00
Spencer Zeng
766e0b6d9a Fix broken selection transforms link in editor docs (#5234) 2022-12-21 22:44:22 -07:00
dependabot[bot]
56c4875a4b Bump terser from 5.7.1 to 5.15.1 (#5185)
Bumps [terser](https://github.com/terser/terser) from 5.7.1 to 5.15.1.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.7.1...v5.15.1)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-21 22:23:49 -07:00
dependabot[bot]
db30bbf4bb Bump decode-uri-component from 0.2.0 to 0.2.2 (#5209)
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-21 22:23:38 -07:00
dependabot[bot]
30c1155e51 Bump qs from 6.5.2 to 6.5.3 (#5214)
Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.5.2...v6.5.3)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-21 22:23:21 -07:00
github-actions[bot]
be21439c42 Version Packages (#5232)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate-react@0.88.0
2022-12-20 07:59:35 -07:00
Sim Ho
d96887f909 Note that leaves must be inline elements (#5225)
* Note that leaves must be inline elements

* remove extra space
2022-12-19 10:54:54 -07:00
Laufey Rut Guðmundsdóttir
0141f68365 Check if getBoundingClientRect exist before trying to call bind (#5226)
* Stop trying to call bind on undifined when getBoundingClientRect is not defined. This is happening when testing slate with react testing library

* Add changeset
2022-12-19 10:51:13 -07:00
github-actions[bot]
224b7ebba3 Version Packages (#5224)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate-react@0.87.1
2022-12-14 09:44:32 -07:00
alex-vladut
120437d612 fix: allow input into editable voids (#5223) 2022-12-14 09:36:32 -07:00
github-actions[bot]
a4cc213087 Version Packages (#5210)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate@0.87.0 slate-react@0.87.0
2022-12-04 15:52:04 -07:00
Kyle McLean
96b7fcdbf9 Use stylesheets to give Editable components default styles (#5206)
* Use stylesheet to give Editable components a default style

* Give Editors a unique id

* Use per-editor stylesheets to give editors a min-height

* Make editor min-height respond to changes in placeholder height

* Add changeset for stylesheet changes

* Prevent unnecessary creations of ResizeObservers

* Update yarn.lock
2022-12-03 21:26:17 -07:00
Ravi Lamkoti
d1f90ebd12 Docs: fix Ctrl-` backticks issue on 03-defining-custom-elements page (#5203) 2022-11-29 14:49:08 -07:00
Emmanuel Meric de Bellefon
66fbc0a5b9 Update range-ref.md (#5200) 2022-11-21 09:44:24 +00:00
github-actions[bot]
a24ddd12cd Version Packages (#5198)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate@0.86.0 slate-react@0.86.0 slate-history@0.86.0
2022-11-17 10:59:49 -07:00
Brian Bucknam
e416d00b6c Fix reporting of marks on a markableVoid (#5186)
Add a few unit tests for Editor.marks(), including one for markable void
that fails
2022-11-17 10:19:46 -07:00
Brian Bucknam
fbc9838fd7 Add hanging option to unsetNodes (#5189)
Since this really just calls setNodes, it seems like it should offer the same options.
Without this change, doing something like applying a mark to the contents of a selected block with `hanging` works one way, while trying to do the reverse (remove the mark) cannot include the "hang".
2022-11-17 10:19:01 -07:00
Brian Bucknam
6909a8f7da Fix overly-aggressive unhangRange (#5193)
`Editor.unhangRange()` could decide to proceed with an adjustment in cases where the range was not hanging.
Because the algorithm it uses *always* skips over the first node it encounters, this meant the selection was adjusted in non-hanging cases.
This change reduces the chances of an incorrect decision to adjust.
Transforms now pass the `voids` flag to `unhangRange()` as it seems logical that the adjusted range should reflect the intention of the operation.
This fixes a unit test I added for markable voids that had to be skipped because of the `unhangRange()` error, and fixes a couple other long-skipped tests.
2022-11-17 10:18:11 -07:00
Lagu Longa
c8c75e9e2d remove duplicate useState import (#5194) 2022-11-17 09:21:51 -07:00
Jacob Carpenter
70b64dc8f1 Update isHistory to match new interface. (#5197)
* Update `isHistory` to match new interface.

This change merely preserves the original functionality and does not add verification of Batch's new `selectionBefore` property.

* Add changeset.
2022-11-17 09:21:37 -07:00
GengJun
e139c11235 Fix: Mentions Example (#5191) 2022-11-17 09:17:51 -07:00
Laufey Rut Guðmundsdóttir
06942c6d7e Fix Copy/pasting void elements is not working (#5121)
* Create new function hasSelectableTarget and use it instead of hasEditableTarget. Fixes Copy/pasting void elements is not working https://github.com/ianstormtaylor/slate/issues/4808

* Add changeset

* Revert a change that made editable void not editable and add cypress test for editing editable void

* Extract methoods into easily overridable with help from @alex-vladut
2022-11-17 09:17:10 -07:00
github-actions[bot]
6efe3d9a22 Version Packages (#5162)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate@0.85.0 slate-history@0.85.0
2022-11-08 10:36:36 -07:00
Jacob Carpenter
d8dbbb19f7 Docs: fix incorrect name. (#5182)
A reference to the sample above incorrectly mentions `Editor.unwrapNodes` instead of `Transforms.unwrapNodes`.
2022-11-08 05:38:52 -07:00
Brian Bucknam
346f6572fc Allow void elements to receive marks (#5135)
Some void elements are effectively stand-ins for text, such as with the mentions example,
where the mention element renders the character's name. Users might want to format Void
elements like this with bold, or set their font and size, so `editor.markableVoid` tells
Slate whether or not to apply Marks to the text children of void elements.

- Adds `markableVoid()` as a schema-specific overrideable test.
- Changes `addMark` and `removeMark` so marks can apply to voids. Also changes behavior
of collapsed selection so that if a markable Void is selected, the mark will be applied /
removed.
- Shows how `markableVoid()` can work in the mentions example
2022-11-08 05:38:15 -07:00
Steven.zhong
3c49ff28b3 fix: error getting parentEntry in selection range (#5168)
Co-authored-by: Steven Zhong <stevenzhong@StevendeMacBook-Pro-2.local>
2022-11-08 05:37:53 -07:00
Oli
e61678da14 Fix typos in error messages (#5179) 2022-11-08 05:37:34 -07:00
Doug Reeder
469bec3d04 Adds an example using SlateNode.common() with the editor selection (#5176) 2022-11-01 05:13:15 -07:00
Denis Sokolov
d868c930f6 Fix a typo in docs on Normalizing (#5164) 2022-10-28 08:47:09 -07:00
Brian Bucknam
2f8f6913e4 Simplify / clarify wording (#5170)
Slight improvement to editor documentation
2022-10-26 16:33:33 -07:00
Doug Reeder
5e7815eded Products: adds Quill Forms & renames GraphCMS to Hygraph (#5163) 2022-10-23 21:48:12 -07:00
Bryan Haakman
d73026eed2 Change how slate-history handles selection undo (#4717)
* Change how slate-history handles selection undo

* fix test

* fix lint

* cleanup and simplify

* Fix redo by applying undo beforeSelection before applying the redo

* remove unused shouldClear function

* fix lint

* add changeset
2022-10-23 14:02:05 -07:00
Doug Reeder
4e52e5043e Adds descriptions to list of products (#5161)
* Adds descriptions to list of products

* Products: Add Aline, Campfire, Coda, Dropdeck & Sana. Removes broken link
2022-10-22 06:10:27 -07:00
github-actions[bot]
2adda79e65 Version Packages (#5159)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate@0.84.0
2022-10-19 21:36:54 -07:00
mainhanu
a2184d8657 transform.delete and transform.insertFragment performance optimize (#5137)
* feat: transform.delete and transform.insertFragment performance optimize

* feat: add changeset

* feat: optimize code

Co-authored-by: mainhanu <chijun89@gmail.com>
2022-10-19 05:38:34 -07:00
dependabot[bot]
c19ab7853f Bump shell-quote from 1.7.2 to 1.7.3 (#5156)
Bumps [shell-quote](https://github.com/ljharb/shell-quote) from 1.7.2 to 1.7.3.
- [Release notes](https://github.com/ljharb/shell-quote/releases)
- [Changelog](https://github.com/ljharb/shell-quote/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/shell-quote/compare/v1.7.2...1.7.3)

---
updated-dependencies:
- dependency-name: shell-quote
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-18 11:57:38 -07:00
github-actions[bot]
68c5bda101 Version Packages (#5155)
* 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.83.2
2022-10-15 17:27:57 -07:00
Kevin Simons
a2b6786d19 Ensure the min-height for placeholders is set on the correct editor (#5148)
* Ensure the min-height for placeholders is set on the correct editor

* Add changeset

* Run prettier on changeset

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2022-10-12 08:55:48 -07:00
hujiulong
10d723fa02 Remove unused code (#5149) 2022-10-12 05:19:23 -07:00
Jim Fisher
1b14de5f8e Revert insertText breaking change that deletes fragment (fixes #5153) (#5154)
This reverts commit 7499d4b4c0.

The issue reported at https://github.com/ianstormtaylor/slate/issues/4862
is a valid complaint, but change in https://github.com/ianstormtaylor/slate/pull/4868
is not an appropriate fix. It is a serious breaking change,
reported as bug: https://github.com/ianstormtaylor/slate/issues/5153

We should therefore revert the change. If we wish to fix Chromium's
triple-click bug, we should do so by unhanging the selection when it is
created; not by changing insertText behavior.
2022-10-12 05:18:32 -07:00
github-actions[bot]
d39943741f Version Packages (#5145)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate-react@0.83.1
2022-10-03 13:49:59 -07:00
Alex
8c32d26bfc GitHub Workflows security hardening (#5138)
* build: harden comment.yml permissions

Signed-off-by: Alex <aleksandrosansan@gmail.com>

* build: harden ci.yml permissions

Signed-off-by: Alex <aleksandrosansan@gmail.com>

* build: harden release.yml permissions

Signed-off-by: Alex <aleksandrosansan@gmail.com>

Signed-off-by: Alex <aleksandrosansan@gmail.com>
2022-10-03 08:17:04 -07:00
Eric Meier
347865cafc fix scrollIntoView when selection is collapsed inside mark placeholder (#5143) 2022-10-03 08:00:20 -07:00
github-actions[bot]
e8614d1eec Version Packages (#5128)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate-react@0.83.0
2022-09-20 14:48:57 -07:00
Laufey Rut Guðmundsdóttir
0eb37e7915 Make it possible to delete block elements with backspace on Chrome and Safari (#5123)
* Make it possible to delete block elements with backspace in chrome and safari

* Add changeset
2022-09-20 14:22:24 -07:00