1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-06 15:26:34 +02:00
Commit Graph

984 Commits

Author SHA1 Message Date
github-actions[bot]
5838e36229 Version Packages (#5678)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-08 10:49:56 -07:00
Ivan Sysoi
ec9e5f0a36 fix: focus loss inside Shadow DOM in Firefox. (#5676) 2024-07-08 07:13:29 -07:00
github-actions[bot]
97c88dbc25 Version Packages (#5662)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-25 04:09:04 -07:00
Joe Anderson
0016f9843f Make drop and dragend event handlers global (#5664) 2024-06-23 14:13:40 -07:00
Czy
ab3570d166 chore: export WeakMap for on-demand retrieval of Path (#5657)
* chore: export node path utils

* chore: code style empty line
2024-06-20 16:24:10 -07:00
Mahmoud Elsayad
e6254f706a Enable Shadow DOM fix for Safari 17. (#5659)
* Enable Safari Shadow DOM fix for Safari 17.

* Create weak-files-jam.md

* Update changeset.
2024-06-20 16:20:53 -07:00
github-actions[bot]
f3be9f1292 Version Packages (#5656)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-04 08:47:44 -07:00
Alexey Starostin
2a8b4e958b Make capitalizing work for iOS (#5654)
* Make capitalizing work for iOS

* Add changeset

---------

Co-authored-by: Alexey Starostin <astarostin@astarostin-pc.local>
2024-06-03 20:22:33 -07:00
github-actions[bot]
9ee604e17a Version Packages (#5651)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-15 15:47:43 -07:00
Mahmoud Elsayad
0bb7be5496 Add Safari workaround inside shadow DOM. (#5648)
* Add Safari workaround inside shadow DOM.

* Add E2E test.

* Move browser checks to environment.ts

* Remove leftover @ts-ignore.
Fix linting change.

* Update `getActiveElement`

* Create red-poems-wave.md

* Fix prettier.

* Update E2E test.
2024-05-15 08:17:18 -07:00
github-actions[bot]
b48f1d64d6 Version Packages (#5626)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-21 13:19:27 -07:00
github-actions[bot]
b04b7e0e98 Version Packages (#5602)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-02-07 05:06:40 -07:00
Joe Anderson
c2ae1eda91 Do not move selection outside inline node when composition starts (#5541) 2024-02-07 04:50:25 -07:00
github-actions[bot]
f5253cdd4a Version Packages (#5595)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-01-24 07:09:44 -07:00
Joe Anderson
54594d0f81 Fix useFocused not updated when calling ReactEditor.focus (#5593) 2024-01-24 07:05:16 -07:00
github-actions[bot]
cee8e7e421 Version Packages (#5583)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-21 17:01:53 -07:00
Elvin
884ab42494 Fix onCompositionEnd not updating isComposing (#5584)
* fix: onCompositionEnd not updating isComposing

* Add changeset
2023-12-21 15:46:14 -07:00
github-actions[bot]
bf5a4abbe9 Version Packages (#5579)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-06 09:05:41 -07:00
qirong77
8ce52fd494 fix: fix onCompositionEnd update error (#5576)
* fix: fix onCompositionEnd update error

* Update packages/slate-react/src/components/editable.tsx

* add changeset

* Update .changeset/lazy-trainers-learn.md

---------

Co-authored-by: linqirong <609413692@qq.com>
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2023-12-06 08:59:21 -07:00
github-actions[bot]
26351b900f Version Packages (#5573)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-04 12:25:10 -07:00
Bryan Haakman
54d78c100d Upgrade yarn to 4.0.2 (#5578)
* Upgrade yarn to 4.0.2

* Correct react versions for yarn.lock
2023-12-04 12:17:05 -07:00
Tima Gixe
07f59e3607 Adjust cursor position when on selection collapse for RTL direction (#5567)
* fix: adjust edge on collapse RTL selection

* style: fix linting issue

* chore: add changeset
2023-11-30 09:11:49 -07:00
github-actions[bot]
03125312fb Version Packages (#5565)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-11-22 06:26:57 -07:00
Joe Anderson
9aa573e9b8 Apply placeholder delay only on Android devices (#5564) 2023-11-22 06:22:40 -07:00
github-actions[bot]
6be95f8885 Version Packages (#5552)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-11-10 09:53:24 -07:00
Dylan Schiemann
22495e143d Revert #5542 (#5556)
* Revert #5542

Revert due to issues introduced.

* Add changeset
2023-11-10 09:25:29 -07:00
Per-Kristian Nordnes
fc081816e0 Fix issue with ReactEditor.focus + tests (#5527)
* Fix issue with slate-react static ReactEditor.focus method

This will make sure we don't try to focus the editor while it's in the midst of applying operations.
If this is the case, retry setting focus in the next tick.

* Replace react-test-renderer with @testing-library/react

We need to be able to test against window features, like the DOM selection.
@testing-library/react has a very similar API, but have also these features,
which react-test-renderer is missing.

* Rewrite tests for @testing-library/react

This will rewrite the existing tests for Editable and move them into a own file.

* Add tests for ReactEditor.focus

* Add changeset
2023-11-10 09:19:10 -07:00
Joe Anderson
f9cca97f00 Fix firefox newline crash (#5549) 2023-11-09 06:02:46 -07:00
github-actions[bot]
32def91713 Version Packages (#5545)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-31 11:09:45 -07:00
Mathew Kleppin
8688ed5c68 [editable] Fix Memory Leak when switching between focused editables (#5542)
* [editable] Fix Memory Leak when switching between focused editable containers

I've found a memory leak in Slate React where-in when you'd switch between two pages, each with their own editor instance, auto-focusing on these elements causes a memory leak, where there would be a lot of Detached HTML Element's just floating around.

At first I thought it a bunch of different bugs with chromium, but noticed that when I force removed the input elements from the dom before the component would unmount, we would still see small leak referencing "latestElement" (while simultaniously, I would still the element & children references in the `IN_FOCUSE` WeakMap) Looking at editable's code, I realized that we're storing state in a weird way, directly mutating it using `useMemo`, and React isn't removing all references (probably because its still stored in the WeakMap.

The simple fix for this is what I've commited; using `useLayoutEffect`, we forcably remove the `latestElement` and references to it.

* Update editable.tsx

* Add changeset

---------

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2023-10-31 10:51:42 -07:00
github-actions[bot]
a5f03871fe Version Packages (#5529)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-20 09:00:54 -07:00
Dylan Schiemann
c4c14882ed Update dependencies to React 18, Node 20, TS 5.2, etc. (#5528)
* incremental upgrade to React 18, TS 4.9, etc.

* update yarn config

* fix build

* minor cleanup in type definitions

* incremental updates for TS 5.0

* fix build

* upgrade to typescript 5.2

* update dependencies

* fix lint issues

* update to latest Playwright version

* update changesets dep

* update emotion/css

* incremental dependency updates

* more small dependency updates

* upgrade prettier and eslint

* fix lint issues

* update dependencies rollup

* fix @types/node resolution to restore linting

* update tiny-invariant dependency

* update dependencies

* update dependencies lerna

* upgrade react-router-dom

* update @types/react and @types/node

* update babel dependencies

* udpate simple-git-hooks

* update @types/node resolution

* update lint-staged

* remove cypress from dependency list

* update @types/node to support Node 20

* update workflows to Node 20

* set resolutions for @types/react

* downgrade @types/react to 18.2.28

* update mocha

* update rimraf

* update @types/js-dom

* remove .lintstagedrc.js

* upgrade next to latest

* v0.61.4

* update lerna

* update faker and rollup

* update immer

* fix yarn clean command

* attempt to fix integration tests

* attempt to stabilize integration tests

* wip fix integration tests

* skip unstable integration test

* Add changeset

---------

Co-authored-by: Dalibor Tosic <dalibortosic00@gmail.com>
Co-authored-by: Nikola <nikolabijelic14@gmail.com>
2023-10-20 08:34:24 -07:00
LW
623f44521e Add onSelectionChange and onValueChange in Slate React component (#5526)
* Add `onSelectorChange` and `onValueChange` in Slate React component

* docs: add changeset

* fix: fixed lint error

* Rename Slate React component `onSelectorChange` to `onSelectionChange`.
Add more unit tests.

* docs: update changeset

---------

Co-authored-by: willliu <willliu@distinctclinic.com>
2023-10-20 05:00:48 -07:00
github-actions[bot]
0bdff51a08 Version Packages (#5517)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-25 07:58:55 -07:00
yaokailun
ff7db22120 Fix move_node triggers nodes re-render (#5513) (#5514)
* Fix move_node triggers nodes re-render (#5513)

* Add changeset
2023-09-25 07:55:13 -07:00
Joseph Rollins
300dc57a00 Retain editor selection when using ReactEditor.focus() (#5516)
* Retain editor selection on ReactEditor.focus()

* Add changeset

* Fix lint
2023-09-21 15:40:02 -07:00
github-actions[bot]
fd753b8bf1 Version Packages (#5512)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-18 10:40:46 -07:00
Ivan Voskoboinyk
13c7d271e3 Drop a leftover useRef() call (#5510)
* Drop a leftover `useRef()` call

It was first introduced in #4819
but then the usage of this ref was removed with #4874

So the ref remained unused since then.

* Add a changeset
2023-09-18 10:32:55 -07:00
github-actions[bot]
a81f76f3a3 Version Packages (#5504)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-29 05:01:28 -07:00
Jan Paepke
e308cd664d bugfix: avoid lookbehind (#5503) 2023-08-29 04:49:34 -07:00
github-actions[bot]
f8d8d017d1 Version Packages (#5501)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-26 05:03:55 -07:00
Dimitri Wei
76ba375983 fix: no composing text inserted on mac wechat browser (#5497)
* fix: no composing text inserted on mac wechat browser

* chore: add changeset

* Update packages/slate-react/src/utils/environment.ts

---------

Co-authored-by: wei lingfeng <lfwei@inftech.ai>
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2023-08-26 04:23:00 -07:00
github-actions[bot]
a25d7a40e5 Version Packages (#5492)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-07-31 17:31:52 -07:00
WcaleNieWolny
a5576e56a7 Fix contenteditalbe firefox table selection (#5491)
* Fix firefox contenteditable table selection

* Add changeset

* Update changeset
2023-07-31 04:41:12 -07:00
github-actions[bot]
c8236ee112 Version Packages (#5489)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-07-26 07:18:42 -07:00
WcaleNieWolny
8b548fb53a Fix firefox disconnected selection api usage (#5486)
* Fix firefox disconnected selection api usage

* Add changeset

* Fix typo + add link to explanation

* Fix integration tests
2023-07-26 07:09:26 -07:00
github-actions[bot]
dd6dbf1b99 Version Packages (#5474)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-07-12 05:04:35 -07:00
Ben Wormald
a6b606d804 update hotkeys util to use isHotkey (#5462) 2023-06-30 00:04:48 -07:00
Joseph Rollins
4bd15ed395 Revert to prev behavior on Android to fix caret (#5470)
* Revert to prev behavior on Android to fix caret

* add changeset
2023-06-28 08:29:43 -07:00
github-actions[bot]
511014afa0 Version Packages (#5461)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-06-21 11:31:52 -07:00