1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-24 17:23:07 +01:00

3211 Commits

Author SHA1 Message Date
Ian Storm Taylor
2e197662ae Merge branch 'master' of github.com:ianstormtaylor/slate 2019-05-09 13:42:16 -07:00
Ian Storm Taylor
ebf830c116 fix react-placeholder decoration format, add decoration.mark deprecation, fixes #2750 2019-05-09 13:42:11 -07:00
Jarred Sumner
f62c9b0405 Update Changelog.md (#2749) 2019-05-09 09:32:46 -07:00
Ian Storm Taylor
7845c9534f Publish
- slate-base64-serializer@0.2.104
 - slate-html-serializer@0.8.3
 - slate-hyperscript@0.13.1
 - slate-plain-serializer@0.7.3
 - slate-prop-types@0.5.34
 - slate-react-placeholder@0.2.1
 - slate-react@0.22.1
 - slate@0.47.1
slate@0.47.1 slate-react@0.22.1 slate-react-placeholder@0.2.1 slate-prop-types@0.5.34 slate-plain-serializer@0.7.3 slate-hyperscript@0.13.1 slate-html-serializer@0.8.3 slate-base64-serializer@0.2.104
2019-05-08 20:44:55 -07:00
Ian Storm Taylor
1036503f34 fix annotations toJSON to return an object 2019-05-08 20:42:00 -07:00
Ian Storm Taylor
5bdcbc4d83 Publish
- slate-base64-serializer@0.2.103
 - slate-html-serializer@0.8.2
 - slate-hyperscript@0.13.0
 - slate-plain-serializer@0.7.2
 - slate-prop-types@0.5.33
 - slate-react-placeholder@0.2.0
 - slate-react@0.22.0
 - slate@0.47.0
slate@0.47.0 slate-react@0.22.0 slate-react-placeholder@0.2.0 slate-prop-types@0.5.33 slate-plain-serializer@0.7.2 slate-hyperscript@0.13.0 slate-html-serializer@0.8.2 slate-base64-serializer@0.2.103
2019-05-08 20:36:13 -07:00
Ian Storm Taylor
d00f47256e update changelogs and peer dependencies 2019-05-08 20:33:00 -07:00
Ian Storm Taylor
a5a25f97dd
Introduce annotations (#2747)
* first stab at removing leaves with tests passing

* fixes

* add iterables to the element interface

* use iterables in more places

* update examples to use iterables

* update naming

* fix tests

* convert more key-based logic to paths

* add range support to iterables

* refactor many methods to use iterables, deprecate cruft

* clean up existing iterables

* more cleanup

* more cleaning

* fix word count example

* work

* split decoration and annotations

* update examples for `renderNode` useage

* deprecate old DOM-based helpers, update examples

* make formats first class, refactor leaf rendering

* fix examples, fix isAtomic checking

* deprecate leaf model

* convert Text and Leaf to functional components

* fix lint and tests
2019-05-08 20:26:08 -07:00
Josh Duck
5b8a6bb3b4 Fix type (#2735) 2019-05-06 11:26:29 -07:00
Kurt Madsen
cf46e9d3d4 Update "Check Lists" nav item to "Checklists" (#2731)
;checklist: (noun) a list of items required, things to be done, or points to be considered, used as a reminder.

"Check List" sound like an action, not the thing being shown
2019-05-02 16:06:04 -07:00
Ian Storm Taylor
45b6d245af fix benchmarks 2019-05-01 20:14:06 -07:00
Ian Storm Taylor
dbf6237caf Publish
- slate-base64-serializer@0.2.102
 - slate-html-serializer@0.8.1
 - slate-hyperscript@0.12.1
 - slate-plain-serializer@0.7.1
 - slate-prop-types@0.5.32
 - slate-react-placeholder@0.1.20
 - slate-react@0.21.24
 - slate@0.46.1
slate@0.46.1 slate-react@0.21.24 slate-react-placeholder@0.1.20 slate-prop-types@0.5.32 slate-plain-serializer@0.7.1 slate-hyperscript@0.12.1 slate-html-serializer@0.8.1 slate-base64-serializer@0.2.102
2019-05-01 19:57:28 -07:00
David Hrdlicka
7216fdc1bb Wrap insertTextAtRange in withoutNormalizing (#2728) 2019-05-01 19:55:29 -07:00
Ian Storm Taylor
b448a19b8c Publish
- slate-base64-serializer@0.2.101
 - slate-html-serializer@0.8.0
 - slate-hyperscript@0.12.0
 - slate-plain-serializer@0.7.0
 - slate-prop-types@0.5.31
 - slate-react-placeholder@0.1.19
 - slate-react@0.21.23
 - slate@0.46.0
slate@0.46.0 slate-react@0.21.23 slate-react-placeholder@0.1.19 slate-prop-types@0.5.31 slate-plain-serializer@0.7.0 slate-hyperscript@0.12.0 slate-html-serializer@0.8.0 slate-base64-serializer@0.2.101
2019-05-01 19:54:33 -07:00
Ian Storm Taylor
3453de7bbb fix lint 2019-05-01 19:52:39 -07:00
Ian Storm Taylor
4af9a8b345 update changelogs 2019-05-01 19:49:51 -07:00
Ian Storm Taylor
a220cd5ae1
remove leaves (#2715)
* first stab at removing leaves with tests passing

* add deprecation warning for creating texts with leaves

* fixes

* update examples
2019-04-30 12:15:22 -07:00
Ian Storm Taylor
a431576e73 Publish
- slate-react@0.21.22
slate-react@0.21.22
2019-04-29 14:55:16 -07:00
Yonah Forst
31a4bf4fa9 Improve performance on large documents with many nodes (#2710)
* don't evaluate expensive debug payloads unless debugging is actually enabled

* fix for linter
2019-04-26 14:20:57 -07:00
Ian Storm Taylor
62ca870304 Publish
- slate-base64-serializer@0.2.100
 - slate-html-serializer@0.7.39
 - slate-hyperscript@0.11.30
 - slate-plain-serializer@0.6.39
 - slate-prop-types@0.5.30
 - slate-react-placeholder@0.1.18
 - slate-react@0.21.21
 - slate@0.45.1
slate@0.45.1 slate-react@0.21.21 slate-react-placeholder@0.1.18 slate-prop-types@0.5.30 slate-plain-serializer@0.6.39 slate-hyperscript@0.11.30 slate-html-serializer@0.7.39 slate-base64-serializer@0.2.100
2019-04-24 17:33:49 -07:00
Ian Storm Taylor
16850869d4 fix missing changelog entry 2019-04-24 17:28:36 -07:00
Sunny Hirai
662f584d4d Support decorations without path (#2697)
* Add support with warning for decorations without paths

* Fix linting

* Update text.js

* Update text.js
2019-04-24 17:27:50 -07:00
Stan Gurenkov
feaad7e7cd Fix selection being reset incorrectly after combination of events (#2686)
* Fix selection being reset incorrectly after combination of events

If mouseDown happens inside editor container and mouseUp outside it,
then programmatically calling editor.focus() after that will mess up
the selection

* Update after.js
2019-04-24 17:24:15 -07:00
robinrutten
7855783b2d removed ie/edge condition that causes "node of undefined" TypeError if editor is empty (#2689) 2019-04-24 17:24:01 -07:00
Arrizal Amin
8b27e7e184 fix get marks from previous text on method getMarksAtPosition (#2688) 2019-04-24 17:17:28 -07:00
Velten Heyn
4cb13ee5ca Add path to Range Points (#2537)
* Add path to Range Points

Otherwise 5d0f53da3f/packages/slate-react/src/components/text.js (L122) crashes

* Make prettier happy

* prettier knows what prettier knows

So shut up and delete the fucking whitespace ;)
2019-04-24 17:16:41 -07:00
fchenTelus
7cbf15e3cc insertBlock is missing description (#2682) 2019-04-24 17:09:15 -07:00
Jinxuan Zhu
ad15260993 Allow immutable 4.0.0-rc (#2695) 2019-04-24 16:56:16 -07:00
Sunny Hirai
94a41d791a
Add value inspector to composition example (#2703)
* Add value inspector to composition example

* Add Android API Version to composition example
2019-04-24 10:32:04 -07:00
Sunny Hirai
02130902a1
Revert "Switched Map to fromJS in order to convert the whole js object (also nested data structures) to immutable (#2619)" (#2687)
This reverts commit b8c372df93ac94b3d0449e0c496cdf8bec9af0fc.
2019-04-18 21:16:13 -07:00
Sunny Hirai
2a0bb47379
Fix syntax highlighting (#2698)
* Add support with warning for decorations without paths

* Fix linting

* Fix syntax highlighting crash in examples

* Fix order of imports

* Grab text.js from upstream instead of origin which was outdated
2019-04-18 15:10:10 -07:00
Ian Storm Taylor
b6a59c69a4 Publish
- slate-base64-serializer@0.2.99
 - slate-html-serializer@0.7.38
 - slate-hyperscript@0.11.29
 - slate-plain-serializer@0.6.38
 - slate-prop-types@0.5.29
 - slate-react-placeholder@0.1.17
 - slate-react@0.21.20
 - slate@0.45.0
slate@0.45.0 slate-react@0.21.20 slate-react-placeholder@0.1.17 slate-prop-types@0.5.29 slate-plain-serializer@0.6.38 slate-hyperscript@0.11.29 slate-html-serializer@0.7.38 slate-base64-serializer@0.2.99
2019-04-02 06:42:58 -07:00
Bryan Haakman
bb5d6beffa Make all ops invertible and remove value from ops (#2225) 2019-04-02 06:34:06 -07:00
Ian Storm Taylor
f0e37810a2 Publish
- slate-base64-serializer@0.2.98
 - slate-html-serializer@0.7.37
 - slate-hyperscript@0.11.28
 - slate-plain-serializer@0.6.37
 - slate-prop-types@0.5.28
 - slate-react-placeholder@0.1.16
 - slate-react@0.21.19
 - slate@0.44.13
slate@0.44.13 slate-react@0.21.19 slate-react-placeholder@0.1.16 slate-prop-types@0.5.28 slate-plain-serializer@0.6.37 slate-hyperscript@0.11.28 slate-html-serializer@0.7.37 slate-base64-serializer@0.2.98
2019-04-02 06:29:12 -07:00
Dominik Serafin
071424cda0 Use <s> for strikethrough example (#2676)
`<strike>` is obsolete and discouraged https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strike

`<s>` is better alternative https://developer.mozilla.org/en-US/docs/Web/HTML/Element/s
2019-04-02 06:26:05 -07:00
Arek Mytych
594e891c32 Make use of clientX and clientY in getEventRange (#2675)
Fixes #2570
2019-04-02 06:24:38 -07:00
Hanna Greaves
c688ad7c72 Allow custom placeholder styles (#2667)
* Allow custom placeholder styles

* lint fixes

* review feedback

* lint
2019-04-02 06:23:50 -07:00
Tom Locke
2380aa094f Clarify semantics of return from deserialize (#2665)
This can trip folks up who are using compile-to-JS languages (ClojureScript in my case), where return semantics may be different.
2019-03-26 07:29:41 -07:00
Aaron Greenlee
edbafa6fcb Glossary Enhancements (#2663)
* Rephrased to removed idiom and better describe Slate.

* Added links to educate folks about the core DOM concepts

* Renamed headline to `Slate Mirrors the Dom`

* Rephrased immutable js introduction

* Corrected spelling error

* Simplified language introducing how one can change values.

* Simplified statement about collection methods

* Added encouraging language for Immutable JS learning suggestion

* Quoted mozilla links

* Suggestions to improve readability of data-model documentation

* Added serialized example value

* Resolved one prettier complaints

* `yarn run prettier`

* anchor/focus point glossary content

* normalized term identifiers

* added mark

* Added plugin

* Added schema

* `yarn run prettier` and enhancements to collapsed, focus, and value
2019-03-26 07:27:48 -07:00
Yoel
02f4850930 Convert remaining Node.get* methods to use paths (#2557)
* tests

* faster getSelectionIndeces by passing path during render

* rename var

* fix variables

* revert node component changes

* revert changes to content

* changes to element and path-utils

* fix point normalize

* cleanup

* more cleanup, clearer getDescendant
2019-03-25 19:54:00 -07:00
Ivan Ha
b3107fc142 docs: fix immutablejs doc domain (#2655) 2019-03-25 19:23:53 -07:00
Ellie Strejlau
98fd922915 Fix error when pasting an image into Slate image example. (#2592)
* Fix error when pasting an image into Slate.

* Change isImage to call getExtension, which uses the URL API. Additionally, make sure JSDocs are consistent.
2019-03-11 11:12:19 -05:00
delijah
b8c372df93 Switched Map to fromJS in order to convert the whole js object (also nested data structures) to immutable (#2619)
Looks like a worthwhile improvement to me @delijah and thanks for contributing the PR. Given that nested data structures are permissible this improved the ease of use.
2019-03-10 21:32:36 -07:00
Ian Storm Taylor
5347fe1f3a Publish
- slate-base64-serializer@0.2.97
 - slate-html-serializer@0.7.36
 - slate-hyperscript@0.11.27
 - slate-plain-serializer@0.6.36
 - slate-prop-types@0.5.27
 - slate-react-placeholder@0.1.15
 - slate-react@0.21.18
 - slate@0.44.12
slate@0.44.12 slate-react@0.21.18 slate-react-placeholder@0.1.15 slate-prop-types@0.5.27 slate-plain-serializer@0.6.36 slate-hyperscript@0.11.27 slate-html-serializer@0.7.36 slate-base64-serializer@0.2.97
2019-03-08 13:43:26 -08:00
Sunny Hirai
89adf63e1f
Android 8 and 9 Support (#2565)
* Allow the dev server to work for non localhost host

* Refactored set-selection-from-dom into utils as prep for Android support

* Show debug onInput at start if triggered

* Added and refactored to use set-text-from-dom-node with improved set selection after input

* Remove unnecessary console.log in set-text-from-dom-node

* Fixes to pass linter

* Adds basic composition to Android API27 including fixing one bug where compositionStart does not fire

* Fix some of the enter handling in API 27 and 28

* Add fixes for API 25

* Add debug for slate:update instead of separate render and updateSelection

* Add API 26 fix for ignoring all but Enter in onKeyDown

* Fix enter on Android 26 and 27

* Revert onSelect bug. Editor API 26 and 27 stable-ish

* Fix enter at beginning and end of word in API 26 and 27

* Fix enter handling at end of line API 26 and 27

* Fix reversion of enter bug when not at end of line

* Rename enter to linefeed which is more accurate

* Fix backspace on Android 27 and 28

* Fix enter at end of line then backspace then enter bug in API 26 and 27

* Refactor to simplify reading code

* Refactor to use executor and fix the suggestion problem

* Fix multi point edit in API 27/28

* Update Android documentation on enter handling

* Fix enter in API 26/27 and document 4 different enter cases

* Refactor partial into SlateSnapshot

* Complete SlateSnapshot refactor

* Remove unnecessary plugin comments

* Add smoke tests

* Rename smoke tests to composition in exmaples

* Fix API28 split join and insertion

* Fix space then backspace in middle of word bug in API 28

* Add text for middle word space and backspace bug

* Add note that the space backspace bug does not exist on API 27

* Fix 'It me. No.' bug in API 26/27

* Fix comments

* Update comments to fit Slate style guide

* Move a debug statement

* Fix zero-width selection placement bug.

* Fix 'it is' then enter in middle of 'it' bug

* Partial fix of enter, backspace, enter in word

* Add and fix comments. Fix selection in zero-width for API26-27

* Fix linting

* Fix documentation

* Remove snapback from packages

* Remove snapback from yarn.lock

* Rename SlateSnapshot to DomSnapshot

* Remove guard on DomSnapshot apply method

* Remove debug plugin from plugins/dom

* Remove unnecessary comment in content.js componentDidUpdate

* Remove closest and add function into dom-snapshot directly

* Remove unused DebugPlugin

* Move Android detection related code into slate-dev-environment

* Capitalize to Number in JSDoc

* Add API version and Input Events Level 2 for Android

* Add input events level 2 for android without matching api version

* Fix line failures
2019-03-08 10:14:52 -08:00
董沅鑫
e0fa49315a Fix examples/tables variable "previous" is null when select text and delete all (#2638) 2019-03-08 12:04:54 -05:00
Yoel
9f2edf9512 Fix move_node dirtyPath and PathUtils.transform calculations (#2593)
* test and changes to test runner for move-node edge case

* fix dirtyPaths calculation for move_node

* prettier

* remove commented out code, remove needless toArray call

* remove test assertion

* more lint fixes

* possibly correct test for deleting all nested blocks

* pretty test

* fix PathUtils.transform edge case with move_node

* tests for PathUtils.transform for some move_node cases

* prettier

* element moveNode also uses PathUtils.transform, fix sibling edge case

* refactor for ease of comprehension

* new edge case test, fix move_node invert

* prettier

* revert last move_node transform case for clarity
2019-03-07 18:08:15 -05:00
Jason Staten
4d0ccc8e81 Fix Edge positioning with newlines (#2622)
* Fix Edge positioning with newlines

Edge has a [bug][1] where `Range.prototype.toString()` will convert `\n`
into `\r\n`. The bug causes a loop when slate-react attempts to
reposition its cursor to match the native position.

This change avoids calling `Range.prototype.toString()` by cloning the
content nodes and measuring `textContent` on those instead.

[1]: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10291116/

* Add COMPAT message
2019-03-07 18:01:59 -05:00
Ian Storm Taylor
bc8de50d99 Publish
- slate-base64-serializer@0.2.96
 - slate-dev-environment@0.2.2
 - slate-hotkeys@0.2.9
 - slate-html-serializer@0.7.35
 - slate-hyperscript@0.11.26
 - slate-plain-serializer@0.6.35
 - slate-prop-types@0.5.26
 - slate-react-placeholder@0.1.14
 - slate-react@0.21.17
 - slate@0.44.11
slate@0.44.11 slate-react@0.21.17 slate-react-placeholder@0.1.14 slate-prop-types@0.5.26 slate-plain-serializer@0.6.35 slate-hyperscript@0.11.26 slate-html-serializer@0.7.35 slate-hotkeys@0.2.9 slate-dev-environment@0.2.2 slate-base64-serializer@0.2.96
2019-03-06 14:30:06 -08:00
Ian Storm Taylor
4557c0fba7 fix === equality for linter 2019-03-06 14:26:41 -08:00