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

956 Commits

Author SHA1 Message Date
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
Joe Anderson
53395449e5 Do not try to batch updates in React >= 18 (#5460)
* Do not try to batch updates in React >= 18

* Linter fixes

* Add changeset
2023-06-21 11:09:32 -07:00
github-actions[bot]
4b8ba512e7 Version Packages (#5454)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-06-16 20:47:48 -07:00
Shiba-ligo
cde0a155e2 fix: regular expression for testing Webkit based browser (#5453)
* fix: IS_WEBKIT environment symbol excluding blink based browser

* chore: add changeset

* fix: prettier

---------

Co-authored-by: zhanglixin08 <zhanglixin08@meituan.com>
2023-06-16 09:35:32 -07:00
Ikko Eltociear Ashimine
b01f931942 Fix typo in dom.ts (#5452)
wether -> whether
2023-06-16 05:01:24 -07:00
Grzegorz Tłuszcz
12ff246e10 Fixed triple click workaround breaking void elements selection (#5451)
* Fixed tripple click workaround breaking void selection

* Add changesets

* Fix ts error

* Make code style more consistent
2023-06-16 05:01:12 -07:00
github-actions[bot]
bac37cae81 Version Packages (#5438)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-06-12 18:58:48 -07:00
Old_dream
eb7f598707 fix: caret jump to the start of composition string (#5443)
* fix:  caret jump to the start of composition str

* chore: add changeset

* chore: edit changeset

---------

Co-authored-by: huangyuning <huangyuning@vv.cn>
2023-06-12 15:20:22 -07:00
Joseph Rollins
3ad13d6015 Test for WebKit based browsers instead of Safari (#5437)
* Test for WebKit based browsers instead of Safari

* Add changeset
2023-05-31 05:13:03 -07:00
github-actions[bot]
ad126705ba Version Packages (#5434)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-29 22:27:40 -07:00
Ivan Voskoboinyk
91e388ecd9 Rename <Slate> component value prop to initialValue (#5421)
* Rename `slate-react` Slate component `value` prop to `initialValue`

Fixes #4992

* Update documentation: `value` -> `initialValue`

* Add a changeset record

* Make props order consistent
2023-05-26 07:53:39 -07:00
Alexander Chudesnov
0b1799091a Fix default focus styles (#5422)
* Fix default outline styles

Resolves #5146

* Add changeset

---------

Co-authored-by: Alexander Chudesnov <achudesnov@medallia.com>
2023-05-26 07:52:41 -07:00
github-actions[bot]
b7fd322f01 Version Packages (#5424)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-13 23:34:44 -07:00
Horacio Herrera
042bca167a fix(slate-react): add top css to placeholder (#5423)
solves  #5386
2023-05-13 23:28:00 -07:00
github-actions[bot]
33a1e9b923 Version Packages (#5397)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-20 05:30:24 -07:00
Ziad Beyens
3243c7e34a Refactor editor methods and fix JSDoc (#5307)
* feat

* fix

* docs

* feat

* Create two-books-bow.md

* fix

* feat

* feat

* fix

* refactor

* refactor

* refactor

* refactor

* refactor

* refactor

* refactor

* refactor

* refactor

* refactor

* docs

* docs

* 🔀

* 🔀
2023-04-20 04:55:43 -07:00
github-actions[bot]
07b049f59b Version Packages (#5373)
* 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>
2023-04-03 16:51:02 -07:00
Joe Anderson
3c3ea29a2d Fix issue when tabbing into editor in Safari (#5383)
https://github.com/udecode/plate/issues/2315
2023-04-03 11:00:59 -07:00
Ed Hager
5a0d3974d6 Fix/delete all closes keyboard (#5368)
* fix: clean up ref handling in leaf

* fix: delay rendering of placeholder to allow selections to settle

* fix: move placeholder height calculation into layout effect

* fix: add change set

* fix: handle placeholder resizing in a better way

* fix: fix placeholder integration test
2023-03-20 09:23:54 -07:00
github-actions[bot]
3c0abeb785 Version Packages (#5370)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-17 13:06:36 -07:00
Anthony Ciccarello
d42cd005db enable eslint hooks rules (#5363) 2023-03-17 10:45:54 -07:00
alex-vladut
556a4565d2 fix: allow copying from editable void input (#5369) 2023-03-17 08:30:13 -07:00
github-actions[bot]
4244a8d67c Version Packages (#5365)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-16 06:25:13 -07:00
Jason Cheatham
9825d29b87 Fix pasting content with newlines on Android (#5359)
* Improve InputEvent data type

* Fix insertion of content with newlines on Android

* Slice the trailing newline off of pasted text

* Add changeset
2023-03-16 06:02:15 -07:00
Jason Cheatham
4399935690 Directly paste ClipboardEvents in Safari (#5362)
* Directly paste ClipboardEvents in Safari

* Add changeset
2023-03-16 06:00:41 -07:00
github-actions[bot]
2a0a530931 Version Packages (#5345)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-07 22:28:44 -07:00
Ed Hager
a5e833f655 fix: Editable not calling decorate as it should (#5346) 2023-03-07 19:34:39 -07:00
Joe Anderson
f7f02a8b23 Fix triple-click contenteditable="false" error (#5343) 2023-03-07 10:15:59 -07:00
github-actions[bot]
bc07cf8c86 Version Packages (#5340)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-03-06 08:44:43 -08:00