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>
* Add version 100.0.0 to package.json
* Revert "Add version 100.0.0 to package.json"
This reverts commit 329e44e43d968700655b1c46f968bfd3147e7339.
* fixed typo in html file
Co-authored-by: Tim Buckley <timothypbuckley@gmail.com>
* 3536 support flat functionality + beforeinput in Edge
* 3536 support flat functionality + beforeinput in Edge
* 3536 remove support for flat functionality
* 3536 added description of regexp
Co-authored-by: Pavlyna Bevz <pavlynabevz@pbevz-mbp.local>
Made a fix for the fact that if you were standing in a <li> wrapped in an <ul> with no text and pressed backspace, the <ul> would go away while the <li>'s stay.
* fixed some bugs with the input event handler on the embeds example, got rid of the non functional 'is selected and is focused' conditions for showing the input.
* fix linting error
Co-authored-by: DamareYoh <34608378+DamareYoh@users.noreply.github.com>
* 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
* fix: ts
Fix:
- Argument of type 'Point | undefined' is not assignable to parameter of type 'Location'.
Type 'undefined' is not assignable to type 'Location'.
- Types of property 'zIndex' are incompatible.
* use &&
* use optional chaining
* revert optional chaining (not supported)