1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-07-31 20:40:19 +02:00
Commit Graph

463 Commits

Author SHA1 Message Date
Sergei Dedkov
9635b992a0 Compare only decorations offsets in MemoizedText. Code highlighting example improvements. (#5271)
* add basePath prop to Range inside slate-react custom types, calculate absolute ranges on passing them into TextComponent

* code highlighting example improvements, minor markdown preview refactoring

* changeset added

* Revert "add basePath prop to Range inside slate-react custom types, calculate absolute ranges on passing them into TextComponent"

This reverts commit afa085c289bc67ce3d27dd33b1f074ab8153efe8.

* add basePath prop to Point inside slate-react custom types, resolve relative ranges on passing them to TextComponent

* Update changeset

* linter fixes

* remove redundant checks inside renderElement function

* custom types fixes for Range and Point in examples

* wrap intervals and ranges extractors in useMemo hook for running them only if editor.children is changed

* revert basePath changes, compare only offsets for MemoizedText decorations

* use an element as a key in decorations ranges map instead of id

* simplify code highlighting implementation, make code block nested

* fix code-highlighting example, add toolbar code block button

* remove redundant code

* fix code highlighting playwright integration test
2023-02-09 11:53:21 -07:00
Gary Borton
5dc4396f6b Switch from cypress to playwright. (#5248)
* empty

* empty

* empty

* Begin move from cypress to playwright.

* Switch remaining tests to playwright, remove old cypress suppport files.

* Clean up playwright config

* Enable ff, and safari when on mac.

* Fix safari/ff mentions test

* Fix code-highlighting test on ff/safari

* Add a local retry as a few tests are flaky.

* Replace cypress w/ playwright in gitignore.

* Update to latest yarn to fix ci install?

* Update yarn.lock w/ yarn command.

* Fix mocha tests.

* Fix prettier
2023-01-13 20:36:04 -07:00
Michael
cb133a785f upgrade yarn (#5242)
Signed-off-by: Michael Darr <michael.e.darr@gmail.com>

Signed-off-by: Michael Darr <michael.e.darr@gmail.com>
2023-01-07 05:58:12 -07:00
Bryan Haakman
11a93e65de Upgrade next.js to 12 and related packages (#5042)
* Upgrade next.js and source-map-loader

* Add changeset

* Upgrade eslint and typescript

* improve reliability of iframe test

* fix lint
2022-07-15 06:14:18 -07:00
Nemanja Tosic
1b205c087b Fix stale decorations (#4876)
* test changes

* fix decoration not updating

* Add changeset

* Fix lint issues

* Tests with earlier version of Node.js

* Bump node version on CI

The base typescript config uses ESNext as target, so presumably the
latest node should be used.

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2022-03-09 04:06:18 -07:00
Dylan Schiemann
9907ad004e Update to Node v16 for infrastructure (#4877)
* Update to Node v16 for infrastructure

* update node type def to Node 16
2022-03-08 19:25:28 -07:00
Dylan Schiemann
ce1e096df7 update emotion dependency for site (#4783) 2022-01-11 08:36:04 -07:00
Dylan Schiemann
d528ad4008 Fix release versioning 3 (#4517)
* another attempt to fix the version packages release

* more work to fix automated changeset workflow
2021-09-13 15:09:59 -07:00
Dylan Schiemann
59ca7a8f51 Fix release versioning (#4516)
* correct immutability lockfile flag for yarn 3

* More experiments to re-enable the Version Packages action

* add changeset

* more work to fix automated changeset workflow
2021-09-13 14:09:00 -07:00
Eric Charles
d338dcc7ce Jest testing for slate-react (#4459)
* initial skeleton for jest testing

* run in serial mocha, then jest on slate-react only

* run-s without glob patterns https://github.com/yarnpkg/berry/issues/22

* don't run mocha on slate-react package

* use yarn run instead of run-s
2021-09-01 14:25:11 -07:00
Bryan Haakman
8eb1abac87 Migrate yarn to berry v3 (#4417)
* Migrate to yarn berry v3

* Fix yarn dependencies for linting

* Specifically invoke bash in yarn clean to make brace expansion work

* Upgrade cypress to 8.x to support yarn berry

* Try out yarn berry workaround for netlify

From https://answers.netlify.com/t/using-the-new-yarn-release-2-0-0-berry/8270

* Update .yarnrc.yml for syntax consistency

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

* use rimraf for clean command with escaped glob pattern

* Use workspace:* resolution for workspace packages and rewrite yarn.lock

* set workspace package versions explicit again

* update peer dependencies

* disable import/named for ts and tsx files

* Replace 'key' with 'key=true' wherever babel complains

* replace all instances of key to someKey in tests to satisfy eslint and babel

* remove unnecessary yarn packageExtension and remove cross-env dependency

* upgrade yarn to latest

* Upgrade next.js to 10.x to support yarn berry

* update .yarnrc to satisfy netlify

Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
2021-08-28 04:59:10 -07:00
Bryan Haakman
8a5a50d904 Upgrade cypress to 8.x and next to 10.x (#4469) 2021-08-24 21:41:15 -07:00
Jimmy Oliger
0025900349 Add unicode sequences support (#4326)
* Add failing test

* Handle sequences

* Uncomment test cases

* Handle RTL unicode sequences

* Remove esrever

* Add tests

* Use iterator instead of Array.from

* Add changeset

* Rename split to splitByCharacterDistance

* Make reverse optional

* Fix casing

* Fix yarn.lock

* Fix tests

* Remove fast-deep-equal after bad merge
2021-08-13 03:50:52 -07:00
Sunny Hirai
506d9bce53 Add syntax highlighting example to menu 2021-07-01 17:10:35 -07:00
Julian Krispel-Samsel
4181107e56 4196 integration tests with cypress (#4206)
* - update gitignore
- add cypress configuration and example test

* add integration tests to ci workflow

* add note about running integration tests

* Update docs/general/contributing.md

Co-authored-by: Tim Buckley <timothypbuckley@gmail.com>

* Update .gitignore

Co-authored-by: Tim Buckley <timothypbuckley@gmail.com>

* Update cypress.json

Co-authored-by: Tim Buckley <timothypbuckley@gmail.com>

* add baseUrl, remove goTo command

Co-authored-by: Tim Buckley <timothypbuckley@gmail.com>
2021-04-16 11:17:24 +01:00
Ian Storm Taylor
c5d412f5c6 add lint-staged for auto-formatting commits 2021-04-01 01:41:07 -04:00
Ian Storm Taylor
a406c6a738 add typescript linting 2021-04-01 01:19:21 -04:00
Ian Storm Taylor
914e085be2 add github changelog to changesets 2021-03-31 13:56:28 -04:00
Ian Storm Taylor
7283c51feb Add changesets (#4154)
* add first changesets integration

* remove readme

* readd readme

* update auto-release workflow logic

* update auto-release script order, fix prettier

* change access to public

* update release script

* try to fix changesets

* add experimental snapshot version config

* try fixing

* remove excess

* switch auto-release branch to master

* add release pull request workflow

* add changeset todo to pr template

* update changeset
2021-03-31 13:14:40 -04:00
Ian Storm Taylor
a036ce1a88 fix auto-release script to yes prompts 2021-03-29 17:30:27 -04:00
Ian Storm Taylor
1ecc472cc7 add first stab at release workflow 2021-03-29 17:07:39 -04:00
Sunny Hirai
eca1f4163a Added lint:prettier back into the lint script now that all linting passes 2021-03-29 01:45:17 -07:00
Sunny Hirai
fe2a23066f Minor change to lint:prettier to show error message on failure 2021-03-29 01:36:45 -07:00
Sunny Hirai
a1c314e2e9 Add --force-publish tag to lerna for latest and next releases to force matching version numbers 2021-03-29 01:16:44 -07:00
Sunny Hirai
a72958e6c3 Improved Types (#4119)
* Experimental release to see if CustomTypes holds up through a publish

* Add experimental release script

* Fix lint

* v0.60.5-alpha.0

* Allow null properties in setNodes

* v0.60.6-alpha.0

* Revert null properties on Transforms.setNodes

* v0.60.7-alpha.0

* Update examples to use custom Element and Text with discriminated unions

* Add documentation for using TypeScript improvements

* Be explicit about typescript version in package.json

* Force lerna bootstrap to fix build issues on CI and fix a few type examples

* Add slate devDependencies with * back

* v0.60.7

* Switch to a non prerelease version to fix lerna not linking in root

* Add documentation for not using prerelease versions and on how to create experimental releases

* Try removing lerna bootstrap and see if it works
2021-03-11 11:48:31 -08:00
Sunny Hirai
513771c82a slate-react: MVP for working with non-global window objects (fix for #3819) (#4079)
* mvp implementation for working with non-global window instances

* remove unused element renderer

* fix typo in comment

* fix wrong example reference

* Add @babel/helper-call-delegate to fix build error

Co-authored-by: Lukas Buenger <lukasbuenger@gmail.com>
2021-02-16 19:40:15 -08:00
Sunny Hirai
1d3b3b1dad Clean up publish scripts 2020-12-11 13:26:31 -08:00
Sunny Hirai
e70b488253 Improve release scripts in package.json 2020-12-11 13:06:00 -08:00
Sunny Hirai
db3f52517f Merge TypeScript types from master into main 2020-11-27 16:31:16 -08:00
Sunny Hirai
12ea586d82 Add release:next script 2020-11-24 12:56:55 -08: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
Jason Tamulonis
b616e75d63 Upgrade rollup packages to remove security vulnerability (#3844) 2020-08-27 14:18:39 -04:00
Jason Tamulonis
b27c3fde3b Remove unused dependency (#3843) 2020-08-27 12:32:47 -04:00
Wendell Hu
912d4b79da docs: convert examples to typescript (#3766)
* docs: convert examples to typescript

* docs: convert remaining examples

* docs: update next.js

* ci: fix lint

* docs: fix next.js path

* docs: cleanup

* update

Co-authored-by: wendellhu <wendellhu@tencent.com>
2020-08-19 09:14:51 -07:00
Cameron Ackerman
07c375f82e Bugfix/fix bundles (#3673)
* fix index.js main bundles to be commonjs instead of modules

* Change rm -rf to rimraf to be cross os compatible

* add rimraf as  dependency

Co-authored-by: damareyoh <chackerman@wsu.edu>
2020-05-11 10:18:00 -07:00
Cameron Ackerman
7369bb9e97 upgrade next to 9.3.5 to fix security finding (#3640) 2020-04-26 16:58:34 -07:00
Cameron Ackerman
4f1cbf9418 [WIP] add cross-env to enable inline ENV set on multiple environments (#3595)
* add cross-env to enable inline ENV set on multiple environments
2020-04-08 10:58:50 -07:00
CameronAckermanSEL
41aacc009d Revert "add crossenv to allow ENV dependent scripts to work on windows"
This reverts commit b91a0cdd49.
2020-04-08 10:36:10 -07:00
CameronAckermanSEL
b91a0cdd49 add crossenv to allow ENV dependent scripts to work on windows 2020-04-07 13:17:16 -07:00
Ryan Mitts
d17a1e86e3 Added source-map-loader to the Next Webpack config to pass through the source maps from the compiles Slate libraries. (#3445) 2020-02-26 08:02:47 -08:00
Ian Storm Taylor
e68a5cd305 remove the slate-schema package (#3291) 2019-12-10 17:53:27 -05:00
Ian Storm Taylor
b54e98f46c unpin slate dev deps 2019-12-05 15:07:44 -05:00
Ian Storm Taylor
f3fc2c2a54 Change <Slate> to a controlled component (#3216)
* change <Slate> to be a controlled component

* add comment about unstable React API
2019-12-05 11:36:44 -05:00
Ian Storm Taylor
4c03b497d9 remove marks, in favor of text properties (#3235)
* remove marks, in favor of text properties

* fix lint

* fix more examples

* update docs
2019-12-05 11:21:15 -05:00
Ian Storm Taylor
20da67e691 update test inspect script 2019-12-03 00:07:11 -05:00
Ian Storm Taylor
76afb00631 fix lint 2019-11-30 01:40:01 -05:00
Ian Storm Taylor
68569f286e improve Editor.marks and Editor.nodes abstraction 2019-11-29 23:15:08 -05:00
Irwan Fario Subastian
cedc7dc2a5 lint & example fixes (#3160)
* fix import extensions of eslint

* revert next.config.cjs

* fix eslint globbing

* add migrating to docs’ sidebar

* fix prettier error on Contributing.md

* put quotes for glob matching for windows user

* remove type: module from  package.json
2019-11-29 00:16:39 -05:00
Ian Storm Taylor
42c9753742 fix test script 2019-11-28 17:37:38 -05:00
DamareYoh
4bbbfba142 Nodejs 13 compat and eslint/prettier glob fix (#3149) 2019-11-28 17:32:26 -05:00