1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-01-18 22:08:18 +01:00

579 Commits

Author SHA1 Message Date
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 329e44e43d968700655b1c46f968bfd3147e7339.

* 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
CameronAckermanSEL
e40fd0534d fix #3830 2020-08-19 09:41:28 -07:00
Brent Farese
0468290eee
Replace Iterable with Generator. (#3726)
* Replace Iterable with Generator for correct types.
2020-08-06 20:17:50 -04:00
Jatin Shridhar
1e495a5cde
minor elaboration on decorations (#3747)
* minor elaboration on decorations

 highlights the difference with marks

* instead of pronoun use the word "Decorations"
2020-07-02 08:21:58 -07:00
wendellhu
c8a7883b2a
doc: fix parenthesis missing (#3754) 2020-07-02 08:21:20 -07:00
Frederik Eychenié
32e120af19
docs: remove unused "selection" from code example (#3731) 2020-06-13 09:49:00 -07:00
Frederik Eychenié
0954ffc191
docs: add GraphCMS to products using slate (#3732) 2020-06-13 09:48:12 -07:00
Jack Hanford
5ba551ad48
Update 10-normalizing.md (#3721)
Add `Transforms` to slate import so code runs when copy/pasted 😃
2020-06-04 18:36:30 -07:00
Ziad Beyens
557c51e7d4
slate-plugins-next (#3692)
Co-authored-by: Cameron Ackerman <cameron_ackerman@selinc.com>
2020-05-20 17:03:35 -07:00
Scott Parker
76acd9c449
Remove Outline since they switched to ProseMirror (#3694) 2020-05-20 17:01:56 -07:00
Ali Muqaddas
9834fe4e95
Fix: ESlint Error (#3688)
Value is defined in the upper scope
2020-05-17 08:51:07 -07:00
Jolene Langlinais
c00f246c7e
docs(resources): adjust editor link (#3687)
Adjusting for the new monorepo for Accord Project Markdown Editor.
2020-05-14 23:12:29 -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
CameronAckermanSEL
d82ffe49a5 Revert "Revert "TypeScript Improvement: Use [key: string]: unknown, not [key: string]: any (#3565)""
This reverts commit 81d2f9bb8f6a78590d7868deb289ec36fb208629.
2020-05-04 17:38:14 -07:00
CameronAckermanSEL
81d2f9bb8f Revert "TypeScript Improvement: Use [key: string]: unknown, not [key: string]: any (#3565)"
This reverts commit d8adf51add861c81b51e969de704d93a51a8990f.
2020-05-04 17:33:39 -07:00
Tim Buckley
d8adf51add
TypeScript Improvement: Use [key: string]: unknown, not [key: string]: any (#3566)
* Change all [key:string]:any -> unknown

Skipping slate-hyperscript, since it seems to be an appropriate use of key: any

* Minor typo fix docs/api/locations

* Check/assert unknown attributes when needed
2020-05-04 17:16:03 -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
Jolene Langlinais
970c2aac13
docs(concepts): include normalizing inline default behavior (#3637)
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
2020-04-24 08:28:21 -07:00
Jolene Langlinais
c04672b1f7
docs(resources): add product and editor (#3632)
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
2020-04-23 21:26:31 -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
Charanjit Singh
f86f5ca065
Fix Typo (#3545)
Typo fix in documentation
2020-03-11 08:11:42 -07:00
Cameron Ackerman
1e7d21f7cd
Add API documentation for Slate core package (#3524)
* Create transforms.md

* Create initial documentation for transforms

* Remove extra whitespace in transforms.md

* Create initial documentation for interfaces

* Rearrange API docs by category of interface

* Add documentation of static methods

* Use 'static' notation for transforms
2020-03-05 09:30:29 -08:00
琚致远
2d901f6520
Update 08-rendering.md (#3520) 2020-02-27 14:49:29 -08:00
Ondrej Stanek
ad881564d8
Fix invalid example link (#3517)
Hovering menu => Hovering toolbar
2020-02-26 07:47:59 -08:00
Lucas Willems
c5249c745c
Update 06-editor.md (#3511) 2020-02-21 09:14:47 -08:00
Björn Theart
c4eb7b37bc
Update 06-editor.md (#3510) 2020-02-21 08:22:28 -08: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
Jonathan Wieben
612dbcb3a6 Chore: Typo in docs (#3411)
* Fix: Typo in docs

It should read edit instead of editor.

* Chore: Further typo fix
2020-01-27 15:22:36 -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
fa4ab37b02 Merge branch 'master' of github.com:ianstormtaylor/slate 2019-12-19 14:34:38 -05:00
Ian Storm Taylor
dae32cd473 update docs for removal of commands 2019-12-19 14:34:34 -05:00
Sunny Hirai
3ffd73cd7d
Fix broken link in introduction of docs (#3357) 2019-12-18 18:23:05 -08:00
Sunny Hirai
cc7f035229 Added a warning for Android in faq (#3356) 2019-12-18 21:18:35 -05:00
Ian Storm Taylor
0bbe121d76
Remove commands (#3351)
* remove commands in favor of editor-level functions

* update examples

* fix lint
2019-12-18 15:00:42 -05:00
Ian Storm Taylor
235a578967
rename Node.text to Node.string (#3341) 2019-12-17 22:17:21 -05:00
Ian Storm Taylor
4ee9f8b4e6 fix LOC estimates with new version of cloc 2019-12-16 16:41:35 -05:00
Ian Storm Taylor
7d832b5e12
Standardize node matching APIs (#3327)
* add lowest mode and universal flag to `Editor.nodes`

* add `mode` handling to all transforms

* add extra `Editor.is*` helpers

* change `Editor.previous` to make all optional

* change `Editor.next` to make all optional

* change `Editor.match` to make all optional

* add `Editor.void` helper

* remove non-function match arguments

* remove NodeMatch interface

* change to lowest match by default everywhere

* rename `Editor.match` to `Editor.above`

* use new helpers

* cleanup

* make NodeEntry generic, cleanup

* fix NodeEntry generics

* ensure only ancestors are returned from Editor.above

* add type-narrowing to `Editor.nodes`, remove extras

* remove other Node entry types

* cleanup

* remove `Editor.block` and `Editor.inline` helpers
2019-12-15 19:36:05 -05:00
Ian Storm Taylor
6552da940a
Add format_text command, and editor.marks state (#3308)
* add format_text command, refactor command extensions

* update onChange to not receive selection

* update docs

* fix tests
2019-12-12 15:37:55 -05:00
Ian Storm Taylor
e68a5cd305
remove the slate-schema package (#3291) 2019-12-10 17:53:27 -05:00
Ian Storm Taylor
faf73d4521 fix normalizing guide 2019-12-10 14:26:09 -05:00
Ian Storm Taylor
c35ca628f2 typo 2019-12-10 14:01:21 -05:00
Ian Storm Taylor
dbac72cc8e add normalizing guide to docs 2019-12-10 13:55:44 -05:00
Ryan Gurney
1141f59f4f Small docs changes (#3279)
* Small docs changes

Fixes a couple of small typos in the plugins documentation.

* Update 07-plugins.md
2019-12-09 13:16:50 -05:00
Yoz Grahame
ff516ccad8 Fix introduction links to examples (#3266)
Existing links (to Github) were 404ing, so I changed them to point to slatejs.org.
Removed the final list item linking to the rest of the examples, since I can't see a page on slatejs.org that does that. Instead, I added a line after the examples list that talks about "View Source" and links to the Github folder listing.
2019-12-06 17:22:56 -05:00