1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-01-29 19:27:43 +01:00

794 Commits

Author SHA1 Message Date
Bryan Haakman
20acca4bc8
Add soft break as a separate overridable editor method (#4873)
add changeset
2022-03-20 04:30:08 -07:00
Marc
1356f2afc3
Fix a teeny tiny typo (#4875) 2022-03-08 19:32:39 -07:00
Jan Paepke
df1720d311
DOCS: improved deserialization example (#4856)
* Updated deserialize function

* forgot the .flat()

* made prettier happier
2022-03-03 18:27:19 -07:00
Jim Fisher
465cf777cd
Define "hanging range" and intended behavior of unhangRange (#4852)
There is currently no definition of this in the docs, so it's very hard
to understand what this function is supposed to do, and whether it's
buggy. I've written this definition based on Ian Taylor's messages on
Slack [1]:

    Jason: Why does unhangRange only unhang the end of a range and not
    the start as well? Trying to tell if this is a bug or some logic I'm
    not following. If the start of the range is at the last index of a
    text shouldn't unhangRange advance that to the next node?

    ianstormtaylor: I don’t believe it’s a bug. It was designed to
    handle ranges that result from triple-clicks. Not that there might
    not be improvements, or that there might not be some other better
    way to solve for triple-clicks, or that there might be a better
    name for it

    Jason: When you say triple-click handling you mean the fact that
    the browser selection by default gets placed from start of line to
    start of next line? In that cause yes the end of the selection is
    where the problem is. If looked at as a more generic implementation
    it seems like unhanging the start in cases where you have
    {text: 'foo|'}, {text: 'bar|', bold: true} and it makes sense to
    normalize the selection to {text: 'foo'},
    {text: '|bar|', bold: true} which helps in some cases by avoiding
    splits that immediately get merged back, etc.

    ianstormtaylor: Yup, that’s exactly right. It was created for the
    triple-click case. I agree that something to handle the
    start-edged cases would be nice too. But folks in GitHub
    discussions have been kind of assuming that the code meant to be
    written for both, and that it’s a bug to fix, which isn’t true.
    I’m not sure if there are gotchas to expanding the scope to
    handle both edges

[1]: https://slate-js.slack.com/archives/CC58ZGGU9/p1632188507024300
2022-02-23 13:13:09 -07:00
Jim Fisher
b8020ee6fc
Document additional schema constraints due to design of operations (#4838)
As discussed in https://github.com/ianstormtaylor/slate/issues/4836
2022-02-16 09:22:08 -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
Doug Reeder
c90ec8e837
Adds documentation for PathRef (#4740) 2021-12-22 05:04:14 -07:00
Doug Reeder
228cee56a1
Clarifies when to use Editor.insertNode vs. Transforms.insertNodes (#4731) 2021-12-18 07:05:10 -07:00
Doug Reeder
5d3eccf262
Documents use of Editor.withoutNormalizing in conjunction with normalization (#4737) 2021-12-16 22:15:22 -07:00
Doug Reeder
e04671ffe8
Clarifies docs for RangeRef & PointRef; fixes TOC for Editor API (#4724) 2021-12-10 05:53:37 -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
Doug Reeder
7d9d25e179
Adds clarification & examples to demystify Transforms. (#4653)
* Adds clarification & examples to demystify Transforms.

* Fleshes out documentation of NodeOptions for Transforms

* Update docs/concepts/04-transforms.md

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

* Uses 'API' in the title of all API documents

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-11-16 02:20:43 -07:00
meri-leeworthy
5dc9dc5227
missing dependency (#4656) 2021-11-15 02:02:51 -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
Jim Fisher
08f67d9cbc
Fix typo (#4598) 2021-10-13 15:46:53 -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
Jim Fisher
c76f370826
Link to latest changelogs on main branch, not arbitrary snapshot from the past (#4593)
To see the problem, visit https://docs.slatejs.org/general/changelog and follow the links after "...each package will maintain its own individual changelog, which you can find here:"
2021-10-11 06:50:05 -07:00
Sunny Hirai
8e02c65184 docs: Fix lint maybe. 2021-10-10 21:22:32 -07:00
Sunny Hirai
8a81b0ea3d docs: updated concepts so Editor Interface matches API reference 2021-10-10 15:27:36 -07:00
Slapbox
528d92553b
Fixes broken changelog link (#4587)
Fixes #4586
2021-10-09 16:50:49 -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
Guilherme Samuel
15f8f866dd
docs: fix typo (#4538) 2021-09-19 13:44:28 -07:00
Doug Reeder
8b85aeb205
Adds an example to the docs for Transforms.select (#4507) 2021-09-10 17:49:13 -07:00
Dylan Schiemann
5f6d7b4770
Fix typo in TypeScript concepts documentation (#4468)
Fixed #4467
2021-08-24 21:40:00 -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
Pulkit Singh
69ee04ac14
Update 02-nodes.md (#4442)
* Update 02-nodes.md

* Update 02-nodes.md
2021-08-11 12:55:41 -07:00
Dylan Schiemann
03ffe4596d
Add CoCalc to list of resources (#4437) 2021-08-11 06:28:45 -07:00
Pulkit Singh
706f2fc072
Update 01-interfaces.md (#4424)
* Update 01-interfaces.md

* Update docs/concepts/01-interfaces.md

* Update docs/concepts/01-interfaces.md

* Update docs/concepts/01-interfaces.md

* Update docs/concepts/01-interfaces.md

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-08-08 14:48:16 -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
Marco Wettstein
0765766db3
docs: update link for react-page (former ORY Editor) (#3783)
Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-08-06 09:18:43 -07:00
Dylan Schiemann
f0721ac42a
Update resources.md (#4418)
fix typo
2021-08-06 06:30:09 -07:00
Dylan Schiemann
2614dc3c46
Update resources.md (#4414)
* Update resources.md

Add additional Slate resources

* Update resources.md

remove extra blank line
2021-08-05 14:33:40 -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
Dylan Schiemann
4d133e02fc
Fix broken plugins link in Editor documentation (#4335) 2021-08-04 21:59:10 -07:00
Chase Adams
5169cf5ddb
fix sentence order in doc (#4363) 2021-08-04 21:55:37 -07:00
pubuzhixing8
8860c91300
feat(docs): add another member for slate (#4393) 2021-08-04 21:54:06 -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
354b0092ee docs: Fix links in Span API docs 2021-07-26 23:40:17 -07:00
Sunny Hirai
06a376d727 docs: add Span to documentation 2021-07-26 23:37:14 -07:00
Sunny Hirai
106dd9cb37 docs: describe how empty element children normalization executes before all other normalizations 2021-07-19 17:52:53 -07:00
Sunny Hirai
c3c3670c8b docs: Fix installing slate to pass prettier 2021-07-08 22:51:10 -07:00
Sunny Hirai
acfcd9aaf6 docs: Small change to 12-typescript.md to test linting 2021-07-08 22:47:01 -07:00
Sunny Hirai
e377c8f6d2 docs: Small change to test lint staging 2021-07-08 22:45:47 -07:00
Sunny Hirai
7ea482c3e3 docs: Improve wording on TypeScript docs 2021-07-08 20:05:32 -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
Sunny Hirai
03e8230196 docs: Improve documentation around Editor.before and Editor.after 2021-07-08 13:12:11 -07:00
Sunny Hirai
7d14bef63b docs: Improve documentation for Editor.previous and Editor.next 2021-07-08 13:06:41 -07:00