1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-13 11:44:55 +01:00

2521 Commits

Author SHA1 Message Date
Jinxuan Zhu
715fde4f43 Fix a missing focus in test (#1976) 2018-07-19 12:08:05 -07:00
Michael Telatynski
f83b3114db rebuild selection from anchorPath and focusPath if keys were dropped (#1980) 2018-07-19 12:07:22 -07:00
Justin Weiss
6e749e2f0e Fix drag-and-drop issues in IE11 (#1967)
There were three problems preventing drag-and-drop in IE:

* IE [doesn't consider contentEditables as inputs](https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/913982/) when it comes to calling `onDrop`.
* Setting `dropEffect` causes an `unspecified error`.
* You can only get a cursor position from a point with `createTextRange` and `moveToPoint`. Also, `moveToPoint` raises an error if it's called during a dropEvent.
2018-07-19 12:01:46 -07:00
Enzo Ferey
31ca817f18 Added onKeyUp event suppor to slate-simulator and updated docs. (#1973) 2018-07-19 12:00:32 -07:00
Enzo Ferey
39d50b39e5 Added slate-instante-replace plugin to docs and direct links to NPM and Yarn for slate plugins. (#1968) 2018-07-19 11:57:26 -07:00
Michael Telatynski
ad9831f458 add null-guard in case marks = undefined (default state) (#1958) 2018-07-19 11:56:07 -07:00
Nicolas Gaborit
910e983215 More tests for addMarks and Leaf.splitLeaves (#1953)
* Add tests

* Add failing test

* Start adding tests for Leaf.splitLeaves

* More tests for splitLeaves

* Fix test actually

* Lint and rename test
2018-07-05 08:59:51 -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
slate@0.34.5 slate-simulator@0.4.37 slate-schema-violations@0.1.18 slate-react@0.13.2 slate-prop-types@0.4.37 slate-plain-serializer@0.5.20 slate-hyperscript@0.5.20 slate-html-serializer@0.6.11 slate-base64-serializer@0.2.39
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
slate@0.34.4 slate-simulator@0.4.36 slate-schema-violations@0.1.17 slate-react@0.13.1 slate-prop-types@0.4.36 slate-plain-serializer@0.5.19 slate-hyperscript@0.5.19 slate-html-serializer@0.6.10 slate-base64-serializer@0.2.38
2018-07-05 08:47:29 -07:00
Nicolas Gaborit
ec2b17c2d6 Fix newText condition (#1838) 2018-07-05 08:43:17 -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
slate@0.34.3 slate-simulator@0.4.35 slate-schema-violations@0.1.16 slate-react@0.13.0 slate-prop-types@0.4.35 slate-plain-serializer@0.5.18 slate-hyperscript@0.5.18 slate-html-serializer@0.6.9 slate-base64-serializer@0.2.37
2018-07-03 16:12:47 -07:00
Ian Storm Taylor
e2135c3853 update changelog 2018-07-03 16:11:02 -07:00
Samy Pessé
0ceefea2e7 Add prop "isFocused" / "isSelected" for custom nodes (#1950)
* Change the definition of isSelected and add isFocused

* Document prop "isFocused"

* Add unit tests for isFocused / isSelected

* Adapt examples

* Lint
2018-07-03 16:07:38 -07:00
Ian Storm Taylor
37418643e2
add start of glossary (#1946)
This is the start of a glossary in the docs for terms that folks might not know when first learning Slate. Hopefully it makes it easier to learn. If anyone wants to help fill it out, that would be amazing. Thanks!
2018-07-02 10:27:35 -06:00
Zach Schneider
001460fa52 Define NODE_ENV to use the production build of React on slatejs.org (#1939) 2018-07-01 15:21:51 -06:00
Enzo Ferey
a698d4a74e Added missing paste event handler. (#1942)
Acording to https://github.com/ianstormtaylor/slate/blob/master/packages/slate-simulator/src/index.js onPaste event is suported by slate-simulator.
2018-07-01 15:15:36 -06:00
Ian Storm Taylor
257b28aa84
Improve and refactor examples (#1930)
This just refactors the examples to make the styled defined inline with each example, to make it easier to follow for folks. And in the process fixes a few issues that people brought up.

Fixes https://github.com/ianstormtaylor/slate/issues/1920
Fixes https://github.com/ianstormtaylor/slate/issues/1925
2018-07-01 15:13:29 -06:00
Ian Storm Taylor
1923888af1
Update resources.md 2018-06-30 15:08:28 -07:00
Jan Vlcek
6518afc83e Update schema rule marks documentation (#1931) 2018-06-23 06:20:28 -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
slate@0.34.2 slate-simulator@0.4.34 slate-schema-violations@0.1.15 slate-react@0.12.11 slate-prop-types@0.4.34 slate-plain-serializer@0.5.17 slate-hyperscript@0.5.17 slate-html-serializer@0.6.8 slate-base64-serializer@0.2.36
2018-06-22 08:56:51 -07:00
Quentin Gérôme
ec51444df1 fix(Safari): Set a text value in dataTransfer to have the cursor on Safari when dragging a text node (#1927) 2018-06-22 08:52:02 -07:00
Quentin Gérôme
d8d0b5ff3c fix(DragAndDrop): isDraggingInternally should not be reset by the onDragOver handler (#1929)
Fixes #1871
2018-06-22 08:50:51 -07:00
Jinxuan Zhu
0322f7a1b8 Fix a linter bug in a semi-colon case (#1928) 2018-06-22 08:48:36 -07:00
David Chang
2652680850 [core/models] add replaceMark method on Change, tests, docs (#1910)
* [core/models/change] add replaceMark method on Change, tests, docs

* Update change.md
2018-06-21 19:46:40 -07:00
Rik
270321b5dc docs: call correct changes function (#1921) 2018-06-21 19:31:37 -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
slate@0.34.1 slate-simulator@0.4.33 slate-schema-violations@0.1.14 slate-react@0.12.10 slate-prop-types@0.4.33 slate-plain-serializer@0.5.16 slate-hyperscript@0.5.16 slate-html-serializer@0.6.7 slate-base64-serializer@0.2.35
2018-06-19 19:36:03 -07:00
Irwan Fario Subastian
cab3f71e7a fix removeText with Mark of length 1 (#1917) 2018-06-19 19:29:19 -07:00
Ian Storm Taylor
518d299600
Update resources.md 2018-06-19 12:14:53 -07:00
Ian Storm Taylor
91a8f5b393
Update resources.md 2018-06-19 12:14:33 -07:00
Ian Storm Taylor
0d594fe226
Update resources.md 2018-06-19 12:11:21 -07:00
Ian Storm Taylor
93052ca3b9
Update resources.md 2018-06-19 11:56:20 -07:00
Ian Storm Taylor
c3b44dbe57
Update resources.md 2018-06-19 11:54:38 -07:00
Ian Storm Taylor
62240ff484
Update resources.md 2018-06-19 11:53:11 -07:00
Ian Storm Taylor
c8534283e1
Update resources.md 2018-06-19 11:51:40 -07:00
Ian Storm Taylor
efefe6f1db
Update resources.md 2018-06-19 11:51:26 -07:00
Irwan Fario Subastian
afb9dce48a use updated leaves instead of taking this.leaves (#1904) 2018-06-15 08:41:56 -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
slate@0.34.0 slate-simulator@0.4.32 slate-schema-violations@0.1.13 slate-react@0.12.9 slate-prop-types@0.4.32 slate-plain-serializer@0.5.15 slate-hyperscript@0.5.15 slate-html-serializer@0.6.6 slate-base64-serializer@0.2.34
2018-06-14 19:55:55 -07:00
Ian Storm Taylor
2f8708149d update changelog 2018-06-14 19:53:03 -07:00
Ian Storm Taylor
e94cb01a29 update changelog 2018-06-14 19:47:49 -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
slate@0.33.8 slate-simulator@0.4.31 slate-schema-violations@0.1.12 slate-react@0.12.8 slate-prop-types@0.4.31 slate-plain-serializer@0.5.14 slate-hyperscript@0.5.14 slate-html-serializer@0.6.5 slate-base64-serializer@0.2.33
2018-06-14 19:22:05 -07:00
David Chang
5eb04f3650 [slate-react] Pass renderEditor prop through into editor plugin (#1899) 2018-06-14 18:17:44 -07:00
Guy Edwards
1385e5c837 Move data desc below data (#1900) 2018-06-14 18:17:15 -07:00
DylanPaulusSEL
9660c4bdaa Fix issue with pasting in IE11 (#1901)
* Fix issue with pasting in IE11

Fixing the issue where dataTransfer or clipboardData are not populated,
in IE 11 under event.NativeEvent. Instead, if we are using IE11, use
the base event object instead which contains a valid dataTrasnfer/clipboardData object.

* Run prettier on code changes
2018-06-14 18:15:09 -07:00
Jinxuan Zhu
5aa993e81d Allow user to use immutable 4.0.0-rc without yarn warning (#1869)
* Allow user to use immutable 4.0.0-rc without yarn warning

* Fix versions

* Fix immutable version to most recent

* Fix versions for react
2018-06-14 18:08:45 -07:00
Irwan Fario Subastian
9afffd418d update schema customizer to merge marks (#1839)
* update schema customizer to merge marks

* update comment
2018-06-14 17:53:33 -07:00
David Chang
844a4c0221 [docs] add Change.normalize into the docs, add some caveats about perf (#1898) 2018-06-13 16:45:37 -07:00