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

408 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Irwan Fario Subastian
cab3f71e7a fix removeText with Mark of length 1 (#1917) 2018-06-19 19:29:19 -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
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
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
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
Jinxuan Zhu
b26535fd94 Fix cycle reference in slate-core (#1881)
* Switch to isType

* Fix fromJSON in circular reference

* Remove un-necessary files

* fix characters

* Import from node.js

* Export from block... models file
2018-06-10 17:23:11 -07:00
Jinxuan Zhu
e04021f02e Perhaps Faster stack (#1847)
* Faster stack

* Faster stack

* Use memoize; but use reduceRight still

* Use memoize; but use reduceRight still
2018-06-10 17:16:01 -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
Irwan Fario Subastian
7f91d0b557 Inline Void block cursor (#1886)
* add contentEditable=false to void block wrapper

* put contentEditable fals on inline void

fix from https://github.com/ianstormtaylor/slate/pull/1734 works for block but inline void have a cursor which shouldn’t be there as typing inside inline void won’t work. so only removing contentEditable on blocks but not inline

* update test
2018-06-10 16:59:16 -07:00
Tobias Andersen
ee8bc1b695 Use cleaned up text content when copying into plain/text (#1865) 2018-06-10 16:48:28 -07:00
Jinxuan Zhu
1383b38546 Fix the characters count in deleteForward (#1864)
* Fix the characters bug in deleteForward

* Adding tests

* Fix void positions in tests

* add tests for n===0
2018-06-10 16:35:24 -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
Irwan Fario Subastian
dd3e9effff InsertTextAtRange normalize (#1875)
* fix normalization condition on insertTextAtRange

* normalize if marks exists

* add comments

* add test for expanded insertion with mark
2018-06-10 16:31:36 -07:00
Alban Suchaire
9fc8b1085a Set position data-slate-spacer block (#1862)
* Add position absolute to `data-slate-spacer` block

* Fix lint && update test
2018-06-10 16:26:51 -07:00
Cyril Auburtin
48caf855eb avoid innerText (#1837)
better to avoid innerText https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent#Differences_from_innerText
2018-05-20 23:32:09 -07:00
Tobias Andersen
b4422ad6b3 Fix invalid ranges in getEventRange (#1849) 2018-05-20 23:30:37 -07:00
Tobias Andersen
ffb19cac1a Remove legacy COMPAT code from cloneFragment (#1836) 2018-05-11 08:54:19 -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
Tobias Andersen
62d87b23c0 Set clipboard data programmitcally on copy when supported (#1815) 2018-05-10 19:45:40 -07:00
Nicolas Gaborit
0cfd54fc19 Speed up decorations rendering (#1801)
* order, assign decoration ranges to node children

* move decorations ordering method to utils

* Add immutable dep. Prettify

* Try to improve perfs

* Fix orderChildDecorations

* Compute correct order from the start for range starts

* Add tests for order-child-decorations

* Optimize text decoration rendering

* Rewrite with simpler API. Apply it to Content as well

* Lint

* Fix tests
2018-05-10 19:43:59 -07:00
Jinxuan Zhu
49c84cfaec Optimize getMarks(AtRange), getActiveMarksAtRange, getInsertMarksAtRange, remove the dependency of getCharacters (#1808)
* Rewrite getCharacters(AtRange); rewrite getMarks

* Single concat for getMarks

* getActiveMarksAtRange

* getMarksAtRange and getInsertMakrsAtRange

* fix typo

* import getTextsBetweenPositionsAsArray to run getMarks

* Fix eslint error

* Restore getTextsAtRange

* Remove getMarksAtCollapsedRange; Add annotations

* Annotation

* Fix endTexts

* Fix typos

* Fix long line

* Fix getTextsAtRange List; Fix getTextsAtRangeAsArray

* Explain early return for character.marks short cut

* Styling

* Styling

* Styling
2018-05-10 19:15:33 -07:00
Ben Southgate
f37c3a4776 fix: prevent IE11 from throwing if selection contains tables (#1825)
* fix: prevent IE11 from throwing if selection contains tables

* fix: run prettier

* fix: lint
2018-05-10 19:07:11 -07:00
Nikolay Kazakov
7684fff545 Fix issue when a nested in mark node a "void" inline node is the cause of error in applyMark method (#1831) 2018-05-10 19:05:55 -07:00
Jinxuan Zhu
e394ab450c Fix lint problem (#1810) 2018-05-02 10:57:49 -07:00
Irwan Fario Subastian
a501d273f4 remove spellcheck force disable on firefox (#1802) 2018-05-01 18:03:24 -07:00
Jérémie van der Sande
3f2e924f69 [Fix] Copy with empty Block as first-child (#1748)
* [Fix] Copy with empty Block as first-child
+ Added Opera support for only-Mark copy

* [Fix] Fixed one missing remove from merge
2018-05-01 17:44:49 -07:00
Tobias Andersen
794e705c72 remove draggable attribute from void nodes (#1731) 2018-05-01 17:38:31 -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
Ian Storm Taylor
f07fc92f2e fix selection logic for non-merging fragments 2018-04-27 16:36:42 -07:00
Yifeng Wang
7c76fe7120 Limit melding behavior in insertFragmentAtRange (#1366)
* fix insert nested single block fragment

* disable merging multi nested blocks
2018-04-27 15:54:31 -07:00