1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-28 17:39:57 +02:00
Commit Graph

4121 Commits

Author SHA1 Message Date
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
Eric Meier
341041f0b7 Cleanup and fix insertion placeholder mark compare (#5127) 2022-09-19 05:07:33 -07:00
github-actions[bot]
b64af40cd5 Version Packages (#5114)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate-react@0.82.2
2022-09-10 06:17:16 -07:00
Julian Benegas
16a9292aaf only preventDefault if the input is actually a format action (#5113) 2022-09-09 20:15:34 -07:00
Sihong
9815bdabdd fix: selection out of sync in readonly mode (#5120) 2022-09-09 20:14:54 -07:00
Kitty Giraudel
8eb1972b5b Add aria-multiline attribute to textbox editor (#5100)
* Add `aria-multiline` attribute to textbox editor

* Add a changeset
2022-09-05 21:16:10 -07:00
Simon Chan
55b9574097 Use callback-style ref in Element component (#5105)
* Use callback-style ref in Element component

* Add changeset
2022-09-05 21:15:47 -07:00
github-actions[bot]
98afb5abf8 Version Packages (#5086)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate@0.82.1 slate-react@0.82.1
2022-08-22 17:27:28 -07:00
Samy Rahmani
56ab505485 Added missing brackets to resolve inconsistancy (#5097) 2022-08-22 17:15:40 -07:00
Twiggeh
a10cb2564a Fix children being undefined on HMR uploads. (#5094) 2022-08-22 16:56:40 -07:00
Ivan Voskoboinyk
e18879e728 Fix - withReact type signature (#5091)
* Fix signature of `withReact` function

Fixes #4144

* Fix code to pass type checks

* Add a changeset entry
2022-08-22 16:48:27 -07:00
donaldkicksyourass
e9273366b9 fix(example): no action when cancel a file prompt (#5082) 2022-08-18 05:19:14 -07:00
Eric Meier
50de780b1c Fix selection handling with slow flush in mark placeholders on android, fix auto-capitalize after placeholder (#5084)
* Fix selection handling with slow flush in mark placeholders on android, fix auto-capitalize after placeholder

* Add changeset

* Correct typos
2022-08-18 05:18:39 -07:00
krenzke
46d113fe1e Customize get dirty paths (#5069)
* Move getDirtyPaths to the Editor object to allow for customization

* Add changeset for getDirtyPaths customization

Co-authored-by: Tom Krenzke <tom@daybreakhealth.com>
2022-08-17 23:54:21 -07:00
Eric Meier
82a10a38e6 Prevent swiftkey from closing when typing next to the placeholder element (#5070) 2022-08-02 08:02:19 -07:00
github-actions[bot]
1d5984cccd Version Packages (#5058)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
slate@0.82.0 slate-react@0.82.0
2022-07-29 04:08:20 -07:00
Eric Meier
fbab6331a5 Android input handing rewrite (#4988)
* wip

* wip

* wip - fully working without hard marks

* fix editor crashes when inserting/deleting at the edges of marks

* fix various restore dom related crashes

* fix delete with pending changes, zero widths on android, mutation tracking

* track placeholder delete in detached strings, zero-widths

* wip mark placeholders

* get rid of mutation detection in favor of beforeinput

* fix various selection race conditions

* fix various crashes when deleting at the beginning of nodes

* wip diff transforms, selection handling fixes

* cleanup restoreDOM and fix noop restore edge-case

* fix mark placeholders

* fix toSlatePoint edge-case

* properly flush user select with pending changes

* Prevent editor crash when deleting before a non-contenteditable element

* wip markdown shortcut example

* transform pending changes and selection by remote changes, simplify pending actions, handle all input types

* improve change transform, mark(-placeholder) handling

* manually handle gboard bug, fix restoredom nested editor

* fix parent mutation condition

* cleanup, mark placeholder fixes

* mark placeholder fixes

* fix mark placeholder condition

* hide placeholder if we have pending diffs

* cleanup

* yarn install

* add workaround for swiftkey placeholder issue

* cleanup

* add changeset

* feat(slate-react): fix edge-case crash, add androidPendingDiffs, rename scheduleFlushPendingChanges

* flush pending selection on same line without pending changes/action

* keep formatting of pending diffs when adding/removing selection marks

* unref selection ref on unmatching dom state

* improve markdown shortcut example flush trigger to show how a more generic solution would work

* fix markdown shortcut example trigger logic

* fix isInsertAfterMarkPlaceholder logic
2022-07-29 04:04:33 -07:00
Liy
f273647984 Fix wrong 'Transforms' name. (#5065) 2022-07-28 05:06:42 -07:00
Dylan Schiemann
b440fc7577 Release workflow: Replace master with main (#5062)
* Replace master with main

npm tags sometimes failing to get applied with releases, warning mentioned this error.

* Update .github/workflows/release.yml
2022-07-28 05:02:35 -07:00
github-actions[bot]
f55026f0ba Version Packages (#5049)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-22 16:37:11 -07:00
Bryan Haakman
9bc0b6132a Change how Slate context updates and introduce useSlateSelection hook (#5041)
* Fix DOM selection sync when there are unexpected rerenders

* Create a useSlateSelection hook and expose it

* update docs

* add changeset

* Undo the useEffect change and add a useSlateValue method

* Use a version counter instead for SlateContext

* comment out layout effect prevention for now

* Undo useV comparison for now

* Change the changeset

* Fix lint

* Remove the useSlateValue hook

* remove some unused imports

* Add useSlateWithV to the docs

* fix changeset lint

* Change changeset to minor instead
2022-07-22 16:27:26 -07:00
Eric Meier
1cc0797f53 Fix toSlatePoint in void nodes with nested editors if children are rendered as the last child (#5054) 2022-07-22 16:27:10 -07:00
Ulion
f13cd6b918 support insertFragment with text/inline + block mixed fragments. (#5018) 2022-07-15 15:22:37 -07:00
github-actions[bot]
22951adf93 Version Packages (#5040)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-15 06:18:53 -07:00
Bryan Haakman
11a93e65de Upgrade next.js to 12 and related packages (#5042)
* Upgrade next.js and source-map-loader

* Add changeset

* Upgrade eslint and typescript

* improve reliability of iframe test

* fix lint
2022-07-15 06:14:18 -07:00