1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-10 09:13:59 +02:00
Commit Graph

925 Commits

Author SHA1 Message Date
Joe Anderson
fb87646e86 Experimental chunking optimisation and other performance improvements (#5871)
* Chunking optimization

* Fix comments

* Remove redundant `insertionsMinusRemovals` variable

* Fix typo

* Unblock Netlify builds

* Add placeholder

* Upgrade Playwright (fixes crash when debugging)

* Fix `autoFocus` not working

* Fix huge document test

* Fix the previous issue without changing `useSlateSelector`

* Retry `test:integration`

* Re-implement `useSlateWithV`

* Retry `test:integration`

* Update docs

* Update JS examples to match TS examples

* Upload Playwright's `test-results` directory in CI to access traces

* Change trace mode to `retain-on-first-failure`

* Fix: `Locator.fill(text)` is flaky on Editable

* Add changesets

* Increase minimum `slate-dom` version

* Update changeset

* Update 09-performance.md

* Deprecate the `useSlateWithV` hook

* Fix errors and improve clarity in 09-performance.md

* Minimum `slate-dom` version is now 0.116

* Update `yarn.lock`
2025-06-06 16:42:11 -07:00
Joe Anderson
8f8b957ba6 Reintroduce manual Android tests (#5884)
* Re-add manual Android tests

* Remove trailing slash

* Disable autofocus
2025-05-27 14:44:02 -07:00
Alex
11b957a441 Add way to prevent data loss in normalizeNode (#5878)
* fix(docs): Consider passed options when overriding normalizeNode

* feat: Allow to prevent data-loss on normalizeNode

When overriding normalizeNode, you can specify a `wrapperElement`
that is used to wrap text & inline nodes which would otherwise be
deleted in the normalization path if they are not allowed.

* changeset
2025-05-24 13:53:02 -07:00
Guan-Erjia
9e4b0a3faa feat(docs): add another member for slate (#5838) (#5865) 2025-05-14 07:19:13 -07:00
Ziad Beyens
22a3dda36d Add renderText and leafPosition (#5850)
* feat

* revert

* revert

* docs

* test

* refactor

* test

* revert

* refactor

* doc

* docs

* refactor

* docs

* test

* docs

* docs

* docs

* refactor
2025-04-29 07:30:57 -07:00
Joe Anderson
63c0db5b86 Add pass option to Editor.nodes (#5843) 2025-04-15 08:41:31 -07:00
Deepak Kharah
5adb8ededf doc: add missing APIs in the doc (#5835)
* doc: add missing APIs in the doc

* refactor: apply lint
2025-04-03 22:10:34 -07:00
Dylan Schiemann
6eb4bdff06 fix prettier formatting (#5831) 2025-03-21 14:14:24 -07:00
Mohataseem Khan
8b8fc58efc Update scrubber.md (#5818)
improve readability
2025-03-16 19:28:09 -07:00
Mohataseem Khan
c183827ca8 Update transforms.md (#5819)
1.improved grammar
2.improved puntuations
3.improved the readability
2025-03-16 19:27:15 -07:00
Czy
a94fe72bd1 fix: unexpected table selection behavior (#5821) 2025-03-16 19:26:29 -07:00
jerry-lllman
1022682d82 fix(docs): correct block matching condition in Executing Commands example (#5808) 2025-03-10 09:21:29 -07:00
Ravi Lamkoti
4f992cff5c Fix example types (#5812)
* fix: types for richtext.tsx

* fix: types for check-lists, code-highlighting and custom placeholder

* fix: types for editable-voids, embeds, forced-layout, hovering-toolbar

* fix: types for remaining examples

* fix: typescript error for files in image element

* fix: types for examples and some minor fixes

* fix: normalize-tokens.ts type

* fix: types for [example].tsx
2025-03-10 09:20:10 -07:00
aberllin
7a8ab18c52 Fix: Ensure block transformation works in the example (#5803)
I noticed that the current example for toggling a code block using the backtick (`) key doesn't work as expected. The issue occurs because `Editor.nodes()` can return text nodes instead of block elements, causing`Transforms.setNodes()` to fail.

To fix this, I added an extra check using `Element.isElement(n)`, ensuring that only block elements are transformed.
2025-02-09 18:51:48 -07:00
Sunny Hirai
6aace0d017 Fix docs on useSlateSelector 2024-12-30 21:35:10 -08:00
Sunny Hirai
aecc957a9e Improve docs for Slate Component 2024-12-30 20:09:52 -08:00
Christian Grøngaard
2c9cc3cd81 docs: document props.onValueChange and props.onSelectionChange (#5788) 2024-12-30 13:21:28 -07:00
yf-yang
5a1c728c62 feat: add optional method to decoration object (#5776) 2024-12-07 00:19:30 -07:00
Pengfei Han
6bc5758358 docs: specify default value of edge in Editor.point as start (#5765)
Clarify in the documentation that the default value for `edge` in `Editor.point` is `start`.
This is helpful for developers who are not deeply familiar with the framework but need to quickly use it for development.
They no longer need to inspect the source code or experiment with sample code to understand the default behavior.
2024-11-26 11:49:43 -07:00
Ty Mick
40686c2ebb Add HistoryEditor.withNewBatch to docs (#5769) 2024-11-22 17:01:22 -07:00
Ty Mick
644ebdc8f5 Use extended Editor type in useSlateWithV return type (#5763)
* Use extended `Editor` type in `useSlateWithV` return type

So it matches the return types of `useSlate` and `useSlateStatic`. The
`useSlateWithV` return object's `editor` property is currently typed as
just a `ReactEditor`, which causes type errors in our app when we try to
use it as the extended `Editor` type.

* Fix return types in "Editor hooks" docs
2024-11-19 11:14:47 -07:00
Danny
f18383ba72 docs: add context to useComposing hook (#5715)
* docs: add context to useComposing hook

* fix: run prettier
2024-11-01 10:44:18 -07:00
Ty Mick
c9d94711cc Add HistoryEditor.withMerging to docs (#5738) 2024-10-15 12:29:29 -07:00
Electrolux
b1a1021612 feat: add prop surrounds with range (#5729)
* feat: add prop surrounds with range

* Create small-carrots-jam.md

* fix: docx about range.included

---------

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2024-09-26 06:18:05 -07:00
yf-yang
6cb38e37a4 feat: add useComposing hook (#5695) 2024-08-20 16:03:03 -07:00
Sunny Hirai
2c9d5ec87f Update Transforms.setNodes documentation 2024-08-08 08:21:29 -07:00
Tim Farnam
754ad5596d Update Products listing to include Hot Page, rename Netlify CMS to Decap (#5675) 2024-07-15 12:25:23 -07:00
fortyoneplustwo
ca8110605c Add Notestamp to resources.md (#5660)
* List Notestamp (both app and text-editor) under Products and Editors

* List Notestamp in alphabetical order in resources.md
2024-06-24 14:52:03 -07:00
Ryan
c6b4669d15 Add EasyEmailPro to resources.md (#5641) 2024-04-29 20:35:35 -07:00
Ravi Lamkoti
e71e6ce247 Update 07-enabling-collaborative-editing.md (#5618)
Fix color code for user. It doesn't work with today's color code
2024-03-16 16:57:03 -07:00
Abner Yang
cd93871ae6 Fix relative url to normalizing-11.md (#5596) 2024-01-27 23:05:04 -07:00
Dylan Schiemann
1d817bca0f Updates docs and @types/node (#5534)
* remove @types/node resolution

* fix playwright config import error

* fix react batching workaround

* update docs for running integration tests

* Revert "fix react batching workaround"

This reverts commit c0ea6a62bc.

---------

Co-authored-by: Dalibor Tosic <dalibortosic00@gmail.com>
Co-authored-by: Nikola <nikolabijelic14@gmail.com>
2023-10-24 05:29:35 -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
Chris Nicholas
70166d6386 Add "Enabling Collaborative Editing" Yjs guide to the docs (#5505)
* feat: Making a start

* feat: Draft guide, showing all Yjs, then Liveblocks, then Slate-yjs

* feat: Fixed code snippets

* feat: websocket -> WebSocket

* feat: Renaming page

* feat: Title change

* feat: Add provider to resources

* feat: Clarity

* feat: Update Plate link

* feat: Mention Yjs providers

* feat: Actually update the Plate link

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>

---------

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2023-09-05 10:23:24 -07:00
Sunny Hirai
ca77e934bc Add docs for as in Editable 2023-07-24 02:27:57 -07:00
Sunny Hirai
8effdf92cd Update Editable docs but with more concise documentation 2023-07-24 02:23:11 -07:00
Sunny Hirai
61ecfea24e Improve the Editable docs 2023-07-24 02:16:30 -07:00
Ben Dahl
711c2298dd Fix a few typos in the docs (#5463)
* fix: typo in with-react docs

* fix: typo in range docs

* fix: typo in faq docs

* fix: typo in react-editor docs
2023-06-30 00:03:00 -07:00
Dylan Schiemann
25e5eee4af Fix docs typo for unref (#5448) 2023-06-12 18:58:28 -07:00
Brian Bucknam
5eb589dbbb Use mark functions for docs and examples (#5441)
When documenting how to apply character-level styling, use `addMark` and `removeMark` instead of `setNodes`. This avoids new users creating code that only works in the simplest cases.

Similarly, update the Hovering Toolbar example to apply marks instead of setting nodes.

This change was prompted by a discussion on Slack where the developer was disappointed that `markableVoid` did not appear to be working. The problem was they were using `setNodes` to apply Marks, and did not use the same `match` function that `addMark` uses.
2023-06-12 15:08:10 -07:00
Davi Alexandre
a94d64ec09 missed import Element from slate (#5446)
Not importing it results in:

Property 'isElement' does not exist on type '{ new (): Element; prototype: Element; }'.ts(2339)
2023-06-12 15:06:24 -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
Ravi Lamkoti
869d1240d3 chore: rename imageElmnts to imageElements in 04-transforms.md (#5431)
It will make code more readable and character difference is very less so it's worth changing.
2023-05-25 10:55:24 -07:00
Ziad Beyens
01f0210bcc Consistent insert* methods (#5415)
* feat: add reviewpad.yml file

* Update reviewpad.yml

*  options to `Editor.insert*`

* 📝 options to `Editor.insert*`

*  getDefaultInsertLocation

*  getDefaultInsertLocation

*  getDefaultInsertLocation

* 📝 consistent selection

* Create tasty-lizards-remain.md

* Update tasty-lizards-remain.md

---------

Co-authored-by: reviewpad[bot] <104832597+reviewpad[bot]@users.noreply.github.com>
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2023-05-06 15:41:42 -07:00
Cyrille Perois
48c18b5368 docs(walkthroughs): fix broken code example (#5409)
The `match` condition was updated between two examples. The later didn't work because it was missing a part of the condition.
2023-05-05 04:04:05 -07:00
trevorbye
161af4c70d Update 01-installing-slate.md (#5388)
add initial value with children so other examples don't break
2023-04-18 05:01:19 -07:00
Vitomir Budimir
00bce4c880 docs(walkthroughs): fix incomplete code block keyboard shortcut example (#5392) 2023-04-18 05:01:02 -07:00
Sunny Hirai
832e75f47a docs: Add details about the scrollSelectionIntoView prop for the Editable component 2023-04-17 14:46:17 -07:00
Sunny Hirai
3c4e4b6ab3 Remove export from EditableProps in docs 2023-04-13 09:42:39 -07:00
Sunny Hirai
20cff0e35d Add props. prefix to Slate component docs where it was missing 2023-04-13 09:38:46 -07:00