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

143 Commits

Author SHA1 Message Date
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
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
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
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
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
Ravi Lamkoti
d1f90ebd12 Docs: fix Ctrl-` backticks issue on 03-defining-custom-elements page (#5203) 2022-11-29 14:49:08 -07:00
Samy Rahmani
56ab505485 Added missing brackets to resolve inconsistancy (#5097) 2022-08-22 17:15:40 -07:00
魔王卷子
abea3a3dd4 replace slate to Slate (#5024) 2022-07-10 15:41:51 -07:00
Gabin Aureche
22308b3417 Replace useMemo with useState in the docs (#5022)
* Replace useMemo with useState

* Fix formatting
2022-06-11 07:58:19 -07:00
Gabin Aureche
a66c7315a3 Replace useState with useMemo in the "Installing Slate" walkthrough (#5020)
* Update 01-installing-slate.md

* Revert changes to types definitions
2022-06-07 21:31:52 -07:00
Dylan Schiemann
acdc5c3417 fix linting issue (#4976) 2022-04-26 10:10:55 -07:00
wojtek-kowalczyk
731fdf3457 Fixed a bug in the example code in docs (#4973) 2022-04-26 09:10:00 -07:00
James
34cfc1c704 closed bracket on complete code example (#4950) 2022-04-19 08:48:22 -07:00
cptKNJO
ce02acd2fd Docs remove unused selection (#4927) 2022-04-11 06:10:41 -07:00
Eric Meier
f17413086e Update examples in docs, editable voids example (#4925)
* Update examples in docs, editable voids example

* Update typescript docs
2022-04-03 09:57:38 -07:00
Eric Meier
9892cf0ffb Make onChange prop optional, update examples and docs to treat slate as uncontrolled (#4922)
* Make onChange prop optional, update examples and docs to treat slate as uncontrolled

* Add changeset
2022-04-03 08:52:32 -07:00
Antonio Sanchez Gomez
51e02de9de Update docs to reflect Slate is an uncontrolled component (#4768)
* Updated documentation

* Update docs/walkthroughs/01-installing-slate.md

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

* fix: formatting errors

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2022-01-10 03:42:46 -07:00
Desmond Brand
1b0e7c6b92 Docs shouldn't useMemo for editor (#4766)
As already discussed almost a year ago in #3198, `useMemo` doesn't guarantee persistence. This breaks Fast Refresh.

`useState` without a setter is a straightforward fix that avoids dependencies; let's get the docs updated so Fast Refresh works again.

Fixes #3198
2022-01-08 04:34:40 -07:00
meri-leeworthy
5dc9dc5227 missing dependency (#4656) 2021-11-15 02:02:51 -07:00
Hadrien
81cb2ae659 Fix code sample (#4558)
It's an array of CutsomElement, TS complains about it
2021-09-29 06:08:09 -07:00
Doug Reeder
95e13b0be1 Updates "Saving to a Database" example to distinguish content changes (#4497)
* Updates "Saving to a Database" example to distinguish actual content changes.

* Update docs/walkthroughs/06-saving-to-a-database.md

* Update docs/walkthroughs/06-saving-to-a-database.md

* Update docs/walkthroughs/06-saving-to-a-database.md

* Runs prettier

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-09-26 07:59:32 -07:00
Ind. Puking Rainbows
2fa928103d Proposal for Remove useCallback from walkthroughs documentation (#4091)
* Proposal for Remove useCallback from walkthroughs

I have seen in the walkthrough the use of `useCallback` but I don't think are need it, and add a small complexity while understanding the concept, if we moved out the function outside of the component will be stable and will not require to maintain either referential identity or calculated complex logic. 

If people think this is a good idea I can go and update all documentation to remove unnecessary `useCallback` from the example.

unless I'm missing something.

* Update docs/walkthroughs/04-applying-custom-formatting.md

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-08-18 15:59:31 -07:00
ilovecommits
81d62e129d Remove unused useEffect import (#4406)
It's imported, but not actually being used.
2021-08-04 22:02:14 -07:00
ilovecommits
f3b316e816 Fix display bug in GitBook (#4402)
It appears that GitBook doesn't support ```typescript jsx. See https://docs.slatejs.org/walkthroughs/01-installing-slate
2021-08-04 21:53:37 -07:00
Sunny Hirai
c3c3670c8b docs: Fix installing slate to pass prettier 2021-07-08 22:51:10 -07:00
Coury Ditch
03eed53cf1 Fix typescript docs (#4303)
* Add docs on annotations for useState and initial editor value

* Typescript docs: Use initialValue
2021-07-08 19:50:13 -07:00
Scott Grant
b9f07af5ac Updates outdated TypeScript link in first walkthrough document (#4197) 2021-04-13 11:04:45 -04:00
Michal Srb
734bfb5788 Stop basic installation from throwing typescript errors (#4185) 2021-04-13 10:12:42 -04:00
Sunny Hirai
d0ea3ccb5e docs: Fix link in installing slate 2021-04-06 21:44:48 -07:00
Sunny Hirai
a47c35cd95 merge 2021-04-01 18:13:48 -07:00
Ian Storm Taylor
a38957b849 GitBook: [main] 58 pages and 7 assets modified 2021-04-01 23:20:52 +00:00
Sunny Hirai
4b92b752ef docs: Added TypeScript info to the Installing Slate walkthrough 2021-03-30 14:58:31 -07:00
Sunny Hirai
08275f68f3 Custom TypeScript Types (#3835)
This PR adds better TypeScript types into Slate and is based on the proposal here: https://github.com/ianstormtaylor/slate/issues/3725

* Extend Slate's types like Element and Text

* Supports type discrimination (ie. if an element has type === "table" then we get a reduced set of properties)

* added custom types

* files

* more extensions

* files

* changed fixtures

* changes eslint file

* changed element.children to descendant

* updated types

* more type changes

* changed a lot of typing, still getting building errors

* extended text type in slate-react

* removed type assertions

* Clean up of custom types and a couple uneeded comments.

* Rename headingElement-true.tsx.tsx to headingElement-true.tsx

* moved basetext and baselement

* Update packages/slate/src/interfaces/text.ts

Co-authored-by: Brent Farese <25846953+BrentFarese@users.noreply.github.com>

* Fix some type issues with core functions.

* Clean up text and element files.

* Convert other types to extended types.

* Change the type of editor.marks to the appropriate type.

* Add version 100.0.0 to package.json

* Revert "Add version 100.0.0 to package.json"

This reverts commit 329e44e43d.

* added custom types

* files

* more extensions

* files

* changed fixtures

* changes eslint file

* changed element.children to descendant

* updated types

* more type changes

* changed a lot of typing, still getting building errors

* extended text type in slate-react

* removed type assertions

* Clean up of custom types and a couple uneeded comments.

* Rename headingElement-true.tsx.tsx to headingElement-true.tsx

* moved basetext and baselement

* Update packages/slate/src/interfaces/text.ts

Co-authored-by: Brent Farese <25846953+BrentFarese@users.noreply.github.com>

* Fix some type issues with core functions.

* Clean up text and element files.

* Convert other types to extended types.

* Change the type of editor.marks to the appropriate type.

* Run linter.

* Remove key:string uknown from the base types.

* Clean up types after removing key:string unknown.

* Lint and prettier fixes.

* Implement custom-types

Co-authored-by: mdmjg <mdj308@nyu.edu>

* added custom types to examples

* reset yarn lock

* added ts to fixtures

* examples custom types

* Working fix

* ts-thesunny-try

* Extract interface types.

* Fix minor return type in create-editor.

* Fix the typing issue with Location having compile time CustomTypes

* Extract types for Transforms.

* Update README.

* Fix dependency on slate-history in slate-react

Co-authored-by: mdmjg <mdj308@nyu.edu>
Co-authored-by: Brent Farese <brentfarese@gmail.com>
Co-authored-by: Brent Farese <25846953+BrentFarese@users.noreply.github.com>
Co-authored-by: Tim Buckley <timothypbuckley@gmail.com>
2020-11-24 12:30:06 -08:00
CameronAckermanSEL
e40fd0534d fix #3830 2020-08-19 09:41:28 -07:00
Frederik Eychenié
32e120af19 docs: remove unused "selection" from code example (#3731) 2020-06-13 09:49:00 -07:00
Ali Muqaddas
9834fe4e95 Fix: ESlint Error (#3688)
Value is defined in the upper scope
2020-05-17 08:51:07 -07:00
Kevin Simons
3c80c3e88b Fix a few issues with the documentation (#3679)
* Fix a few issues with the documentation

* Add Kitemaker to the list of sites using Slate
2020-05-13 08:56:24 -07:00
George Rodier
9a6e8fba92 Import Transforms in custom elements walkthough (#3630) 2020-04-22 09:09:42 -07:00
Kirk Swenson
f6bfe034d7 Fix typos and other minor issues in docs (#3597)
Fixed typos and grammatical errors in the documentation
2020-04-10 09:05:03 -07:00
Ken Aoki
5da89b8656 Update 01-installing-slate.md (#3554) 2020-03-24 18:12:06 -07:00
Xleine
217bdd611b fix some doc's bug (with v0.57.1) (#3393)
* fix: code blocks's info string
this info string. should be `jsx`

* fix: editor's exec invoke
now, editor.exec() is not available in Slate v0.57.1
so, use editor.insertText() to instead it

*  refactor: delete a nerver used value

* update add new chinese translate
      update chinese translate to `v0.57.1`

Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
2020-01-27 15:24:15 -05:00
Aykut Kardaş
f813af790e An unused state was deleted. (#3413) 2020-01-27 15:22:54 -05:00
David Calhoun
27db5e6c45 docs: walkthroughs: make implicit React dependencies explicit (#3402) 2020-01-27 15:21:08 -05:00
Leon
8cd9b79352 Update 04-applying-custom-formatting.md (#3371) 2020-01-03 23:02:40 -08:00
Ian Storm Taylor
e1f4ff1f6c fix docs 2019-12-19 14:37:10 -05:00
Ian Storm Taylor
dae32cd473 update docs for removal of commands 2019-12-19 14:34:34 -05:00