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

107 Commits

Author SHA1 Message Date
Ian Storm Taylor
acfffe0c2a Publish
- slate-base64-serializer@0.2.50
 - slate-dev-environment@0.1.5
 - slate-dev-logger@0.1.43
 - slate-hotkeys@0.2.1
 - slate-html-serializer@0.6.22
 - slate-hyperscript@0.7.4
 - slate-plain-serializer@0.5.31
 - slate-prop-types@0.4.48
 - slate-react@0.15.5
 - slate-schema-violations@0.1.29
 - slate-simulator@0.4.48
 - slate@0.37.4
2018-08-15 12:40:25 -07:00
Ian Storm Taylor
a396d013ef Publish
- slate-base64-serializer@0.2.49
 - slate-html-serializer@0.6.21
 - slate-hyperscript@0.7.3
 - slate-plain-serializer@0.5.30
 - slate-prop-types@0.4.47
 - slate-react@0.15.4
 - slate-schema-violations@0.1.28
 - slate-simulator@0.4.47
 - slate@0.37.3
2018-08-08 16:31:10 -07:00
Ian Storm Taylor
d4b52e3eb5 Publish
- slate-base64-serializer@0.2.48
 - slate-html-serializer@0.6.20
 - slate-hyperscript@0.7.2
 - slate-plain-serializer@0.5.29
 - slate-prop-types@0.4.46
 - slate-react@0.15.3
 - slate-schema-violations@0.1.27
 - slate-simulator@0.4.46
 - slate@0.37.2
2018-08-07 19:31:35 -07:00
Ian Storm Taylor
7e0929bd22 Publish
- slate-base64-serializer@0.2.47
 - slate-html-serializer@0.6.19
 - slate-hyperscript@0.7.1
 - slate-plain-serializer@0.5.28
 - slate-prop-types@0.4.45
 - slate-react@0.15.1
 - slate-schema-violations@0.1.26
 - slate-simulator@0.4.45
 - slate@0.37.1
2018-08-06 13:16:46 -07:00
Jinxuan Zhu
58c644323f Add coverage test with mocha and codecov (#2037)
* Run mocha test with module alias

* Running test with babel module alias

* Fix model alias

* Fix model alias

* Resolve module alias

* Running test with babel module alias

* Connect to codecov

* add codecov to travis

* stop if yarn test has errors

* Still cannot collect data from slate modules

* Try to check whether it works with codecov

* Move config to nycrc

* Remove nyc require

* Update nyc to use src

* better before_script
2018-08-06 10:31:42 -07:00
Ian Storm Taylor
07d7f51bbc Publish
- slate-base64-serializer@0.2.46
 - slate-html-serializer@0.6.18
 - slate-hyperscript@0.7.0
 - slate-plain-serializer@0.5.27
 - slate-prop-types@0.4.44
 - slate-react@0.15.0
 - slate-schema-violations@0.1.25
 - slate-simulator@0.4.44
 - slate@0.37.0
2018-08-03 15:41:27 -07:00
Ian Storm Taylor
ea6c4d9da2 update peerDependencies 2018-08-03 15:11:28 -07:00
Ian Storm Taylor
f6065e9eb8 update changelog 2018-08-03 15:05:43 -07:00
Ian Storm Taylor
08f270dc1b
Add a Point model, and standardize Range/Point logic (#2035)
* add `Node.createRange` for range resolution

* fix lint

* fix range offset defaults to be `null`

* change `isBackward` to be computed from paths

* remove debuggers

* add point model, update range with deprecations, update hyperscript

* got all tests passing

* get tests passing, convert changes

* fix lint

* fix examples

* update deprecations

* update docs

* update slate-react point utils

* fix document.normalizeRange

* fix lint
2018-08-03 14:45:40 -07:00
Ian Storm Taylor
b3535e11df
change isBackward to be computed from paths (#2027)
* change `isBackward` to be computed from paths

* remove debuggers

* fix lint
2018-08-03 14:31:55 -07:00
Ian Storm Taylor
6fd185e172 Publish
- slate-base64-serializer@0.2.45
 - slate-dev-benchmark@0.0.4
 - slate-dev-environment@0.1.4
 - slate-dev-logger@0.1.42
 - slate-dev-test-utils@0.0.1
 - slate-hotkeys@0.1.4
 - slate-html-serializer@0.6.17
 - slate-hyperscript@0.6.3
 - slate-plain-serializer@0.5.26
 - slate-prop-types@0.4.43
 - slate-react@0.14.3
 - slate-schema-violations@0.1.24
 - slate-simulator@0.4.43
 - slate@0.36.2
2018-08-01 12:07:02 -07:00
Ian Storm Taylor
1748a4b0c1
Refactor tests (#2021)
* add slate-dev-test-utils, refactor tests to use fixtures util

* cleanup top-level test files

* tweaks
2018-08-01 09:16:02 -07:00
Ian Storm Taylor
64000a97aa Publish
- slate-base64-serializer@0.2.44
 - slate-html-serializer@0.6.16
 - slate-hyperscript@0.6.2
 - slate-plain-serializer@0.5.25
 - slate-prop-types@0.4.42
 - slate-react@0.14.2
 - slate-schema-violations@0.1.23
 - slate-simulator@0.4.42
 - slate@0.36.1
2018-07-31 16:31:54 -07:00
Ian Storm Taylor
638d3e8e61 Publish
- slate-base64-serializer@0.2.43
 - slate-dev-logger@0.1.41
 - slate-html-serializer@0.6.15
 - slate-hyperscript@0.6.1
 - slate-plain-serializer@0.5.24
 - slate-prop-types@0.4.41
 - slate-react@0.14.1
 - slate-schema-violations@0.1.22
 - slate-simulator@0.4.41
 - slate@0.36.0
2018-07-27 15:50:29 -07:00
Ian Storm Taylor
8deecc4461 Publish
- slate-base64-serializer@0.2.42
 - slate-dev-benchmark@0.0.3
 - slate-dev-environment@0.1.3
 - slate-dev-logger@0.1.40
 - slate-hotkeys@0.1.3
 - slate-html-serializer@0.6.14
 - slate-hyperscript@0.6.0
 - slate-plain-serializer@0.5.23
 - slate-prop-types@0.4.40
 - slate-react@0.14.0
 - slate-schema-violations@0.1.21
 - slate-simulator@0.4.40
 - slate@0.35.0
2018-07-27 12:42:43 -07:00
Ian Storm Taylor
01405be31b
add paths to ranges (#1997)
#### Is this adding or improving a _feature_ or fixing a _bug_?

Feature.

#### What's the new behavior?

This pull request adds paths to `Range` objects, including the selection. The paths and keys are kept in sync automatically, so that you can use whichever is ideal for your use case.

This should allow us to use paths for lots of the internal logic, which are much quicker to work with than keys since they avoid having to lookup the key in the document and can just traverse right to the node in question.

#### How does this change work?

`Range` objects have two new properties:

```js
range.anchorPath
range.focusPath
```

(Eventually these will be `range.anchor.path` and `range.focus.path` when points are introduced.)

When operations occur and whenever ranges are created/normalized, the paths are updated and kept in sync with the keys.

#### Have you checked that...?

<!-- 
Please run through this checklist for your pull request: 
-->

* [x] The new code matches the existing patterns and styles.
* [x] The tests pass with `yarn test`.
* [x] The linter passes with `yarn lint`. (Fix errors with `yarn prettier`.)
* [x] The relevant examples still work. (Run examples with `yarn watch`.)

#### Does this fix any issues or need any specific reviewers?

Fixes: https://github.com/ianstormtaylor/slate/issues/1408
Fixes: https://github.com/ianstormtaylor/slate/issues/1567
2018-07-27 12:40:04 -07:00
Ian Storm Taylor
695f83bd40 Publish
- slate-base64-serializer@0.2.41
 - slate-html-serializer@0.6.13
 - slate-hyperscript@0.5.22
 - slate-plain-serializer@0.5.22
 - slate-prop-types@0.4.39
 - slate-react@0.13.4
 - slate-schema-violations@0.1.20
 - slate-simulator@0.4.39
 - slate@0.34.7
2018-07-23 12:57:22 -07:00
Ian Storm Taylor
1c3415b950 Publish
- slate-base64-serializer@0.2.40
 - slate-dev-benchmark@0.0.2
 - slate-html-serializer@0.6.12
 - slate-hyperscript@0.5.21
 - slate-plain-serializer@0.5.21
 - slate-prop-types@0.4.38
 - slate-react@0.13.3
 - slate-schema-violations@0.1.19
 - slate-simulator@0.4.38
 - slate@0.34.6
2018-07-19 14:05:25 -07:00
Ian Storm Taylor
4b15481f92 Publish
- slate-base64-serializer@0.2.39
 - slate-html-serializer@0.6.11
 - slate-hyperscript@0.5.20
 - slate-plain-serializer@0.5.20
 - slate-prop-types@0.4.37
 - slate-react@0.13.2
 - slate-schema-violations@0.1.18
 - slate-simulator@0.4.37
 - slate@0.34.5
2018-07-05 08:57:50 -07:00
Ian Storm Taylor
30d0d055b5 unpeg monorepo dev dependencies 2018-07-05 08:56:08 -07:00
Ian Storm Taylor
facd857111 Publish
- slate-base64-serializer@0.2.38
 - slate-html-serializer@0.6.10
 - slate-hyperscript@0.5.19
 - slate-plain-serializer@0.5.19
 - slate-prop-types@0.4.36
 - slate-react@0.13.1
 - slate-schema-violations@0.1.17
 - slate-simulator@0.4.36
 - slate@0.34.4
2018-07-05 08:47:29 -07:00
Ian Storm Taylor
57138de130 Publish
- slate-base64-serializer@0.2.37
 - slate-html-serializer@0.6.9
 - slate-hyperscript@0.5.18
 - slate-plain-serializer@0.5.18
 - slate-prop-types@0.4.35
 - slate-react@0.13.0
 - slate-schema-violations@0.1.16
 - slate-simulator@0.4.35
 - slate@0.34.3
2018-07-03 16:12:47 -07:00
Ian Storm Taylor
d29fc26edf Publish
- slate-base64-serializer@0.2.36
 - slate-html-serializer@0.6.8
 - slate-hyperscript@0.5.17
 - slate-plain-serializer@0.5.17
 - slate-prop-types@0.4.34
 - slate-react@0.12.11
 - slate-schema-violations@0.1.15
 - slate-simulator@0.4.34
 - slate@0.34.2
2018-06-22 08:56:51 -07:00
Jinxuan Zhu
e4ff1972d7 Ensure multi-line expressions are padded by eslint (#1924)
* Fix eslint rule and upgrade eslint

* Fix for switch case

* Linting files
2018-06-21 19:27:10 -07:00
Ian Storm Taylor
1cc486e28c Publish
- slate-base64-serializer@0.2.35
 - slate-html-serializer@0.6.7
 - slate-hyperscript@0.5.16
 - slate-plain-serializer@0.5.16
 - slate-prop-types@0.4.33
 - slate-react@0.12.10
 - slate-schema-violations@0.1.14
 - slate-simulator@0.4.33
 - slate@0.34.1
2018-06-19 19:36:03 -07:00
Ian Storm Taylor
d884be872d Publish
- slate-base64-serializer@0.2.34
 - slate-html-serializer@0.6.6
 - slate-hyperscript@0.5.15
 - slate-plain-serializer@0.5.15
 - slate-prop-types@0.4.32
 - slate-react@0.12.9
 - slate-schema-violations@0.1.13
 - slate-simulator@0.4.32
 - slate@0.34.0
2018-06-14 19:55:55 -07:00
Jinxuan Zhu
cb3a9a5528 Characters to leaves (#1816)
* Preparing tests

* splitNode replacement

* Remove slow splice; replace mergeNode

* normalize Leaves

* Partially remove characters

* Partially remove characters

* styling

* Fix bugs; almost all characters are replaced

* Fixes almost existing tests; preparing adding tests for text

* Remove un-necessary check

* Empty leaf

* fix characters in getMarks

* Faster fromJSON

* Some corner cases for empty text

* Fix naive bug

* Supporting empty text with marks

* Supporting empty text with marks in hyperscript

* changes tests for marks in empty text

* Support splitNode marks with empty text

* Add tests for splitNode->insert

* Faster removeText

* Add warning ; remove getMarksAtIndex cache

* Remove characters in getInsertMarkAtRange

* Adding tests

* Change names of tests

* Update marks test

* Add a test confirm for invalid offsets:

* Add test for get active marks between offsets

* Fix document

* Add testing for insert-text

* Better remove text

* More sensible marks in empty text

* Allow marks of empty text after deleting partially marked text

* Add test for removing on partially marked text

* chnage test structure

* Add test for removeText

* Add test for removeText

* Avoid conflict between empty marked text and cursor

* Simple style fixes

* Simple style fixes

* Line break fixes

* Line break fixes

* Annotate the createLeaves

* Line breaks in test

* Line breaks fix

* add add-marks test

* add merge test

* Fix version update

* Remove empty_leaf optimization; optimize of that will be other PRs

* Clean up getMarksAtPosition

* Fix get-insert-marks-at-range

* clean up get-marks-at-position

* Fix spaces
2018-06-14 19:39:41 -07:00
jasonphillips
c500becf81 Operations update decorations (#1778)
* initial simple decorations (mark-like), many tests added

* allow decorators to be set by focus, anchor tags - add tests

* handle one more edge case with decorations in hyperscript

* apply prettier cleanup

* apply linting rules

* update changelog

* ensure always normalize decoration ranges

* reapply prettier after latest adjustments

* all operations apply now update decorations with selection

* ranges can now be 'atomic', will invalidate if contents change

* lint, prettier cleanups

* add atomic invalidation tests, update hyperscript usage

* fix linter errors

* minor cleanup

* slight refactor for simplicity

* remove a couple superfluous lines

* update in response to review

* drop unnecessarily committed add'l file

* remove the need for explicit anchor, focus prop on decoration tags

* update hyperscript use to match latest syntax in #1777

* atomic -> isAtomic
2018-06-14 19:33:02 -07:00
Ian Storm Taylor
63eae6b48b Publish
- slate-base64-serializer@0.2.33
 - slate-html-serializer@0.6.5
 - slate-hyperscript@0.5.14
 - slate-plain-serializer@0.5.14
 - slate-prop-types@0.4.31
 - slate-react@0.12.8
 - slate-schema-violations@0.1.12
 - slate-simulator@0.4.31
 - slate@0.33.8
2018-06-14 19:22:05 -07:00
Ian Storm Taylor
b13affefd6 Publish
- slate-base64-serializer@0.2.32
 - slate-html-serializer@0.6.4
 - slate-hyperscript@0.5.13
 - slate-plain-serializer@0.5.13
 - slate-prop-types@0.4.30
 - slate-react@0.12.7
 - slate-schema-violations@0.1.11
 - slate-simulator@0.4.30
 - slate@0.33.7
2018-06-10 17:05:20 -07:00
Jinxuan Zhu
727a7ece26 Fix a hyperscript bug in perserving text-key (#1846)
* Perserve the text key in the right way

* rename assertation to test
2018-06-10 16:34:06 -07:00
Ian Storm Taylor
c1bad2b84c Publish
- slate-base64-serializer@0.2.31
 - slate-dev-environment@0.1.2
 - slate-hotkeys@0.1.2
 - slate-html-serializer@0.6.3
 - slate-hyperscript@0.5.12
 - slate-plain-serializer@0.5.12
 - slate-prop-types@0.4.29
 - slate-react@0.12.6
 - slate-schema-violations@0.1.10
 - slate-simulator@0.4.29
 - slate@0.33.6
2018-05-10 19:50:06 -07:00
Ian Storm Taylor
1fff68d625 remove unreleased from changelog 2018-04-27 16:53:40 -07:00
Ian Storm Taylor
c15f200d10 Publish
- slate-base64-serializer@0.2.30
 - slate-dev-environment@0.1.1
 - slate-hotkeys@0.1.1
 - slate-html-serializer@0.6.2
 - slate-hyperscript@0.5.11
 - slate-plain-serializer@0.5.11
 - slate-prop-types@0.4.28
 - slate-react@0.12.5
 - slate-schema-violations@0.1.9
 - slate-simulator@0.4.28
 - slate@0.33.5
2018-04-27 16:49:53 -07:00
jasonphillips
0dc2a4feab slate-hyperscript tests and decorations (#1777)
* initial simple decorations (mark-like), many tests added

* allow decorators to be set by focus, anchor tags - add tests

* handle one more edge case with decorations in hyperscript

* apply prettier cleanup

* apply linting rules

* update changelog

* ensure always normalize decoration ranges

* reapply prettier after latest adjustments

* update in response to review

* drop unnecessarily committed add'l file

* remove the need for explicit anchor, focus prop on decoration tags
2018-04-27 15:50:20 -07:00
Nicolas Gaborit
099c6ada72 slate-hyperscript: Fix extra empty text at the end of children (#1379)
* Add failing test

* Don't push extra text node at the end of children

* Fix keys in tests

* Add option `normalize` to <value>

* Write Changelog

* Changelog on correct  package

* Fix preserve keys test

* Fix tests (which make more sense now)

* Mark failing test as skipped

* Account for skip option

* Lint and fix changelog version

* Use Unreleased instead of version

* Lint markdown
2018-04-27 13:16:11 -07:00
Ian Storm Taylor
fb8075a233 Publish
- slate-base64-serializer@0.2.29
 - slate-html-serializer@0.6.1
 - slate-hyperscript@0.5.10
 - slate-plain-serializer@0.5.10
 - slate-prop-types@0.4.27
 - slate-react@0.12.4
 - slate-schema-violations@0.1.8
 - slate-simulator@0.4.27
 - slate@0.33.4
2018-03-28 09:50:20 -07:00
Ian Storm Taylor
86af03dd30 Publish
- slate-base64-serializer@0.2.28
 - slate-html-serializer@0.5.9
 - slate-hyperscript@0.5.9
 - slate-plain-serializer@0.5.9
 - slate-prop-types@0.4.26
 - slate-react@0.12.3
 - slate-schema-violations@0.1.7
 - slate-simulator@0.4.26
 - slate@0.33.3
2018-03-22 14:51:41 -07:00
Ian Storm Taylor
b17bf1a7b9 Publish
- slate-base64-serializer@0.2.27
 - slate-html-serializer@0.5.8
 - slate-hyperscript@0.5.8
 - slate-plain-serializer@0.5.8
 - slate-prop-types@0.4.25
 - slate-react@0.12.2
 - slate-schema-violations@0.1.6
 - slate-simulator@0.4.25
 - slate@0.33.2
2018-03-21 16:58:48 -07:00
Ian Storm Taylor
36c7f4fc32 fix peerDependencies in slate packages, closes #1690 2018-03-21 16:56:20 -07:00
Ian Storm Taylor
0587a5f916 Publish
- slate-base64-serializer@0.2.26
 - slate-html-serializer@0.5.7
 - slate-hyperscript@0.5.7
 - slate-plain-serializer@0.5.7
 - slate-prop-types@0.4.24
 - slate-react@0.12.1
 - slate-schema-violations@0.1.5
 - slate-simulator@0.4.24
 - slate@0.33.1
2018-03-21 16:38:29 -07:00
Ian Storm Taylor
257580052d Publish
- slate-base64-serializer@0.2.25
 - slate-html-serializer@0.5.6
 - slate-hyperscript@0.5.6
 - slate-plain-serializer@0.5.6
 - slate-prop-types@0.4.23
 - slate-react@0.12.0
 - slate-schema-violations@0.1.4
 - slate-simulator@0.4.23
 - slate@0.33.0
2018-02-21 18:12:43 -08:00
Ian Storm Taylor
fba5bc73e4 Publish
- slate-base64-serializer@0.2.24
 - slate-html-serializer@0.5.5
 - slate-hyperscript@0.5.5
 - slate-plain-serializer@0.5.5
 - slate-prop-types@0.4.22
 - slate-react@0.11.5
 - slate-schema-violations@0.1.3
 - slate-simulator@0.4.22
 - slate@0.32.5
2018-02-21 15:07:33 -08:00
Ian Storm Taylor
0df151ee52 Publish
- slate-base64-serializer@0.2.23
 - slate-dev-logger@0.1.39
 - slate-html-serializer@0.5.4
 - slate-hyperscript@0.5.4
 - slate-plain-serializer@0.5.4
 - slate-prop-types@0.4.21
 - slate-react@0.11.4
 - slate-schema-violations@0.1.2
 - slate-simulator@0.4.21
 - slate@0.32.4
2018-02-07 10:54:52 -08:00
Renaud Chaput
de4c9e478a Lint JSON, CSS and Markdown files with Prettier (#1612)
* Process and Lint CSS, Markdown and JSON files with Prettier

* Run `yarn prettier` to re-format Markdown, CSS and JSON files
2018-02-07 07:58:41 -08:00
Ian Storm Taylor
6df92950ab Publish
- slate-base64-serializer@0.2.22
 - slate-dev-logger@0.1.38
 - slate-html-serializer@0.5.3
 - slate-hyperscript@0.5.3
 - slate-plain-serializer@0.5.3
 - slate-prop-types@0.4.20
 - slate-react@0.11.3
 - slate-schema-violations@0.1.1
 - slate-simulator@0.4.20
 - slate@0.32.3
2018-02-06 19:59:47 -08:00
Renaud Chaput
3339d088e1 Add Prettier with ESLint integration (#1589)
* Add Prettier, with basic config and ESLint integration

* Apply Prettier to all files using `yarn lint --fix`

* Tell Prettier to ignore an empty text in a test output.

* Run Prettier on JS files not handled by ESLint, and lint them too
2018-02-06 15:12:00 -08:00
Zach Schneider
228b97ff29 Switch to using Rollup for bundling (#1568)
* Implement first working rollup config for main slate pkg

* Convert slate-base64-serializer to rollup

* Convert slate-dev-logger to rollup

* Convert slate-html-serializer to rollup

* Convert slate-hyperscript to rollup

* Convert slate-plain-serializer to rollup

* Convert slate-prop-types to rollup

* Convert (mostly) slate-react to rollup

* Convert slate-simulator to rollup

* Misc cleanup and configuration tweaks/fixes

* Convert slate-schema-violations to rollup

* Successful rollup build for top-level examples

* Add plugin to replace process.env.NODE_ENV

* Only rebuild modules and dev examples in watch mode

* Enable sourcemaps for development builds

* Force debug to use browser version, remove builtins plugin

* Remove is-image from example
It relies on node `path` and wouldn't work well in-browser anyway

* Use browser version of react-dom/server

* Move stray require to import

* Configure examples to watch child package output

* Fix tests

* Remove unneeded preferBuiltins from resolve config

* Use more precise files array to ensure sourcemaps aren't included

* Use lodash instead of lodash.throttle
It's pulled in anyway since slate-react needs slate, so using the
minipackage actually causes code duplication

* Improve naming/fix UMD builds, update UMD doc

* Add rollup configs to linting, add a missing dep to package.json

* Use longform rollup CLI flags

* Add rollup-plugin-auto-external to reduce external module configuration

* Combine rollup config into a unioned helper

* Centralize to a single rollup configuration

* Update dist structure and package field naming for PR feedback

* Add comments and address PR feedback on rollup config

* i.e. -> e.g.

* Add some spacing to the configuration to improve readability

* Add a bit more spacing

* Remove umd from example Slate unpkg link
2018-02-02 15:46:36 -08:00
Ian Storm Taylor
44eccca60a Publish
- slate-base64-serializer@0.2.21
 - slate-dev-logger@0.1.37
 - slate-html-serializer@0.5.2
 - slate-hyperscript@0.5.2
 - slate-plain-serializer@0.5.2
 - slate-prop-types@0.4.19
 - slate-react@0.11.2
 - slate-schema-violations@0.1.0
 - slate-simulator@0.4.19
 - slate@0.32.2
2018-01-26 12:34:47 -08:00
Zach Schneider
1e128fffdd Switch to package.json "files" configuration rather than .npmignore (#1559) 2018-01-26 10:14:05 -08:00