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

45 Commits

Author SHA1 Message Date
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
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
Sunny Hirai
34776c6e01 Normalize Slat and Editable component documentation. Add under construction message to Editable component. 2023-04-13 09:23:20 -07:00
Sunny Hirai
36ea10b88d Add return types to Slate React components 2023-04-13 09:18:48 -07:00
Sunny Hirai
0faa1476c1 Fix typo in Slate Component docs 2023-04-13 09:16:02 -07:00
Sunny Hirai
db3e0f8a81 Rename Slate and Editable to Slate Component and Editable Component in table of contents to improve discoverability 2023-04-13 09:14:48 -07:00
Sunny Hirai
cc2000b583 Provide a more detailed description of useSlateSelector in docs 2023-04-13 09:13:19 -07:00
Sunny Hirai
c6b7db2e13 Organize hooks documentation and add subheadings 2023-04-13 09:10:12 -07:00
Sunny Hirai
d193160fbd Add return values to SlateReact hooks documentation 2023-04-13 09:07:35 -07:00
Sunny Hirai
5f1baec200 Add return types to documentation of ReactEditor 2023-04-13 08:47:53 -07:00
Sunny Hirai
3d1c6936dc Remove redundant material from the main Slate React docs 2023-04-12 23:05:41 -07:00
Sunny Hirai
67e8709f45 Add separate page for Slate component in docs 2023-04-12 23:03:19 -07:00
Sunny Hirai
161c9d8f45 Fix table of contents for doc related to Slate React 2023-04-12 22:47:16 -07:00
Sunny Hirai
0e34b35aed Fix typo in ReactEditor docs 2023-04-12 22:45:50 -07:00
Sunny Hirai
036d58fa98 Add Editable and event handling docs for Slate React 2023-04-12 22:44:50 -07:00
Sunny Hirai
76544747e8 Remove plugins section from main SlateReact docs because it is redundant 2023-04-12 22:26:46 -07:00
Sunny Hirai
36abe94ded Improve the documentation for withReact plugin 2023-04-12 22:26:11 -07:00
Sunny Hirai
f80ecaf165 Extract SlateReact hooks documentation onto its own page 2023-04-12 22:20:54 -07:00
Sunny Hirai
083424eeb0 Extract ReactEditor docs into its own page and organize the methods with subheadings 2023-04-12 22:14:00 -07:00
Sunny Hirai
92b03170f7 Add docs for with-react 2023-04-12 22:01:59 -07:00
Sunny Hirai
cf5563a74d Move SlateReact docs into a separate folder slate-react 2023-04-12 21:47:10 -07:00
Sunny Hirai
2f3fb37ffc Add withHistory page to docs, reorganize the History docs in general and update Summary.md 2023-04-12 21:44:53 -07:00
Sunny Hirai
0861663a5c Add links in SlateHistory main docs 2023-04-11 23:16:56 -07:00
Sunny Hirai
72d2d84b85 Improve docs for the main page for SlateHistory with more descriptions 2023-04-11 23:14:49 -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
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
Eric Meier
cb8a551508 Add ReactEditor.isComposing(editor) (#4981)
* Add ReactEditor.isComposing(editor)

* Upate changeset from patch to minor
2022-05-02 12:09:42 -07:00
Bryan Haakman
1217021a9a Add origin event type to setFragmentData to be able to distinguish copy, cut and drag (#4720)
* Add origin event to setFragmentData to be able to distinguish copy, cut, drag

* fix lint

* add changeset

* Make originEvent optional
2021-12-08 10:56:11 -07:00
Eric Charles
e54f2a0ea0 Fix double insertion due to insertTextData being called when it should not (#4625)
* fix double paste due to insertTextData being called when it should not

* Document return type of insertTextData and insert FragmentData

* Add changeset
2021-10-26 21:09:36 -07:00
Eric Charles
72160fac08 Add insertFragmentData and insertTextData to the ReactEditor API (#4614)
* Add insertFragmentData and insertTextData to the ReactEditor API

* Add patch changeset

* Docs for insertFragment and insertTextData
2021-10-22 06:44:56 -07:00
Doug Reeder
43e740c88d docs: clarifies not setting editor values directly & plugin order (#4571)
* 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

* docs: clarifies not setting editor values directly & plugin order

* Changes reccommended order of withReact & withHistory, to match current knowleged

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-10-11 17:40:38 -07:00
Guilherme Samuel
15f8f866dd docs: fix typo (#4538) 2021-09-19 13:44:28 -07:00
Trang Le
ba8e5d8bc2 feat(docs): mention third parameter to toSlateRange method in the docs (#4416)
* Add third parameter to `toSlateRange` method

The `toSlateRange` method accepts an optional third parameter that is an object with property `exactMatch` and value is a boolean.

Example of this implementation can be found at the `Editable` component of `slate-react`, inside the custom `onDOMSelectionChange`.

* toSlateRange third param is optional

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

No changeset as it's a doc update.
2021-08-08 10:12:02 -07:00
georgberecz
2c17e2b7f9 Allow control of Slate's event handler execution in custom event handler API (#4299)
Co-authored-by: Georg Berecz <gberecz@palantir.com>
Co-authored-by: Claudéric Demers <clauderic.d@gmail.com>
2021-06-01 10:26:08 -04: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
nivekithan
4a12c3dac4 docs : Update duplicated toSlatePoint to toSlateRange (#4105) 2021-03-31 14:28:44 -04: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
Song You
4ae58e5c95 Differentiate between useSlate and useEditor hooks (#3941)
* Rename useEditor function to useSlateStatic

* Expose useEditor hook with deprecated flag

* Clarify useEditor deprecation in file and in docs
2020-10-29 15:39:21 -04:00
Jolene Langlinais
aacfde3bad docs(libraries): init docs for slate sub-libraries (#3645)
* docs(libraries): init docs for slate sub-libraries

Signed-off-by: irmerk <jolenelanglinais@gmail.com>

* docs(libraries): reword slate history summary

Co-authored-by: Cameron Ackerman <cameron_ackerman@selinc.com>

Co-authored-by: Cameron Ackerman <cameron_ackerman@selinc.com>
2020-05-01 12:16:36 -07:00