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

819 Commits

Author SHA1 Message Date
Sunny Hirai
bc256e027a Add API version and Input Events Level 2 for Android (#2618)
* Add API version and Input Events Level 2 for Android

* Add input events level 2 for android without matching api version
2019-03-06 17:13:57 -05:00
Dominic Amato
3dce916074 Use strict equality except for null/undefined for improved performance and behavior (#2514)
* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* undo strict null checking

* remove added semicolons

* Prettier Formatting Changes

* Update .eslintrc

add smart strict equality rule

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert Non-strict to strict equality checking
Convert non-strict equality checking, using `==`, to the strict version, using `===`.

* Convert files to use strict equality

* fix prettier eslint errors

* fix remaining prettier complaints

* use strict null equality in serializer
2019-03-06 16:48:41 -05:00
Yoel
2740907b7f fix insert fragment with void children (#2624) 2019-03-06 16:41:39 -05:00
Yoel
9dc53c5d82 Fix insert-node-by-key benchmark, add normalize and insert-fragment benchmarks (#2587)
* fix insert-node-by-key benchmark, add normalize-with-problems

* add benchmark for insertFragment

* more fragment benchmarks
2019-03-06 16:35:12 -05:00
Stefan
9c852b7367 Remove reference to deprecated slate-simulator package (#2591) 2019-02-28 12:20:47 -08:00
Ian Storm Taylor
6302b2d9d2 Publish
- slate-base64-serializer@0.2.95
 - slate-dev-benchmark@0.0.5
 - slate-html-serializer@0.7.34
 - slate-hyperscript@0.11.25
 - slate-plain-serializer@0.6.34
 - slate-prop-types@0.5.25
 - slate-react-placeholder@0.1.13
 - slate-react@0.21.16
 - slate@0.44.10
2019-01-30 16:19:34 -08:00
Yoel
8a0baac696 Fix benchmarks that use value.change (#2569)
* benchmark for large with selection

* inputer -> inputter

* value.change -> editor for slate benchmarks

* use editor in slate-react benchmarks

* prettier

* fix decorations benchmark
2019-01-30 12:10:34 -08:00
Stefan
f677f76559 Improve slate-react-placeholder component. (#2460)
* Improve slate-react-placeholder component.
Now there can be multiple placeholders that do not interfere with each other.
No developer facing changes.

* Fix lint issue

* Unique placeholder marks based on key, not type.
2019-01-29 16:19:43 -08:00
Brendan
861ba522b8 Prevent default browser scroll on content focus (#2526) 2019-01-29 16:13:46 -08:00
Jason Staten
83e45ac054 Fix mouse refocus in IE 11 (#2535)
* Fix mouse focus in IE 11

In IE11, refocusing by click would cause the editor to immediately lose focus.

Fixes #2364

* Skip delect onFocus for EDGE
2019-01-29 16:11:18 -08:00
Charley DAVID
1564c3a031 Fix dirty path normalization on move_node (#2536)
* Add failing tests on undo nested node merge

* Fix PathUtils transform on move_node operations
2019-01-29 16:10:35 -08:00
phy
1ce7c7cc89 fix(at-range): correct findInsertionNode method throw a type error when there arg is a Text node (#2498) 2019-01-29 16:09:18 -08:00
Yoel
91d46b3529 move_node tests and code clean up (#2555)
* tests

* refactor moveNodeByPath

* refactor element.move_node

* refactor invert.move_node
2019-01-29 16:08:17 -08:00
Ian Storm Taylor
391e2cba67
Revert "Android 8.0, 8.1 and 9.0 Support (#2553)" (#2562)
This reverts commit 17cdeae858b4c8a88b408fe743e6d8f2bdcbb72b.
2019-01-28 19:18:03 -08:00
Sunny Hirai
17cdeae858
Android 8.0, 8.1 and 9.0 Support (#2553)
* 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
2019-01-28 12:30:48 -08:00
Jinxuan Zhu
44e47d7ffe Refactor duplicate code in mixin (#2529)
* Refactor duplicate code in mixin

* Remove debugger
2019-01-09 19:48:17 -08:00
Akumatus
09db2c93b6 fix unwrapBlockAtRange disorder (#2512) 2019-01-07 10:05:03 -08:00
Sunny Hirai
92c1ffbcd3
Refactor to utils (#2522)
* Refactored set-selection-from-dom into utils as prep for Android support

* Added and refactored to use set-text-from-dom-node with improved set selection after input
2019-01-04 12:02:33 -08:00
Ian Storm Taylor
d9cc247d45 Publish
- slate-base64-serializer@0.2.94
 - slate-html-serializer@0.7.33
 - slate-hyperscript@0.11.24
 - slate-plain-serializer@0.6.33
 - slate-prop-types@0.5.24
 - slate-react-placeholder@0.1.12
 - slate-react@0.21.15
 - slate@0.44.9
2018-12-11 13:23:21 -08:00
David Gertmenian-Wong
2ad73d73e5 Update Placeholder to be compatible with older versions of React (#2491)
* Make `placeholder` element compatible with older versions of React

`React.Fragment` is only available in react >= 16.2, which does not
meet the dependency requirements specified by the package (react >=
0.14.0). Updates from `React.Fragment` -> `span` to provide coverage
for older versions of react.

* Update `slate-react` placeholder test case
2018-12-11 12:54:26 -08:00
Jinxuan Zhu
c2a3609a09 Use weakmap to prevent memory leak and remove indirect __cache__key (#2471)
* Use global weakmap

* Remove redudant ?:

* Use local Weakmap for objects

* Code refactor

* Annotation refactor

* Annotation refactor

* Annotation refactor

* Fix annotation
2018-12-11 12:04:18 -08:00
Akumatus
fb60d4dfb7 fix(schema): previous node and child node may be exactly the same (#2493) 2018-12-11 11:32:06 -08:00
Dundercover
76a88a649a Add editor.HasCommand and editor.HasQuery (#2438)
* Add `editor.hasCommand` method

* Add `editor.hasQuery` method

* Rename directories `hasCommand` and `hasQuery` to kebab case

* Add tests for `editor.hasCommand` of React component

* Add tests for `editor.hasQuery` of React component
2018-12-11 11:25:53 -08:00
Ian Storm Taylor
37fcaf348c Publish
- slate-base64-serializer@0.2.93
 - slate-dev-environment@0.2.1
 - slate-hotkeys@0.2.8
 - slate-html-serializer@0.7.32
 - slate-hyperscript@0.11.23
 - slate-plain-serializer@0.6.32
 - slate-prop-types@0.5.23
 - slate-react-placeholder@0.1.11
 - slate-react@0.21.14
 - slate@0.44.8
2018-12-04 11:14:33 -08:00
Espen Hovlandsdal
73b4cb423e fix InputEvent global check (#2469) 2018-12-04 11:12:13 -08:00
CameronAckermanSEL
5395931680 undo and redo operations are now wrapped with withoutNormalizing call to prevent normalizing occuring in between application or reversal of batched operations (#2462) 2018-12-04 11:11:22 -08:00
ldavidpace
287875b9e3 Checking to make sure there is only text in the node before removing the whole node on deleteBackward (#2476)
* Checking to make sure there is only text in the node before removing the whole node.

* Make it Prettier
2018-12-04 11:08:45 -08:00
Ian Storm Taylor
e909475ccb Publish
- slate-base64-serializer@0.2.92
 - slate-html-serializer@0.7.31
 - slate-hyperscript@0.11.22
 - slate-plain-serializer@0.6.31
 - slate-prop-types@0.5.22
 - slate-react-placeholder@0.1.10
 - slate-react@0.21.13
 - slate@0.44.7
2018-12-02 16:20:57 -08:00
DamareYoh
b1ff42b534 remove react dependency from slate core (#2443) 2018-12-02 13:12:23 -08:00
Ian Storm Taylor
4cbf57be98 refactor normalization logic to result in shorter callstacks 2018-12-02 13:09:43 -08:00
Dundercover
61be5f8881 Add defaultValue prop to Editor component (#2418)
* Add `defaultValue` prop to `Editor` component

* Use `defaultValue` prop in the `Read Only` example

* Use `defaultValue` prop in the `Check Lists` example

* Use `defaultValue` prop in the `Code Highlighting` example

* Use `defaultValue` prop in the `Embeds` example

* Use `defaultValue` prop in the `Emojis` example

* Use `defaultValue` prop in the `Forced Layout` example

* Use `defaultValue` prop in the `Huge Document` example

* Use `defaultValue` prop in the `Images` example

* Use `defaultValue` prop in the `Input Tester` example

* Use `defaultValue` prop in the `Markdown Preview` example

* Use `defaultValue` prop in the `Markdown Shortcuts` example

* Use `defaultValue` prop in the `Paste HTML` example

* Use `defaultValue` prop in the `Plain Text` example

* Use `defaultValue` prop in the `Plugins` example

* Use `defaultValue` prop in the `RTL` example

* Use `defaultValue` prop in the `Search Highlighting` example

* Use `defaultValue` prop in the `Tables` example
2018-11-15 08:21:42 -08:00
Gersom van Ginkel
0c94ccebce Add changes made to shouldNodeComponentUpdate to changelog of slate-react (#2417)
* When the component unmounts, make sure async commands don't trigger react updates.

* Eslint fix

* Add changes made to shouldNodeComponentUpdate to changelog of slate-react
2018-11-13 10:28:10 -08:00
Ian Storm Taylor
1d0a0e6cf6 Publish
- slate-base64-serializer@0.2.91
 - slate-html-serializer@0.7.30
 - slate-hyperscript@0.11.21
 - slate-plain-serializer@0.6.30
 - slate-prop-types@0.5.21
 - slate-react-placeholder@0.1.9
 - slate-react@0.21.12
 - slate@0.44.6
2018-11-12 11:29:46 -08:00
Ian Storm Taylor
45bc55a076 reduce max normalizations guard 2018-11-12 11:27:34 -08:00
Ian Storm Taylor
b78f6546cd Publish
- slate-base64-serializer@0.2.90
 - slate-html-serializer@0.7.29
 - slate-hyperscript@0.11.20
 - slate-plain-serializer@0.6.29
 - slate-prop-types@0.5.20
 - slate-react-placeholder@0.1.8
 - slate-react@0.21.11
 - slate@0.44.5
2018-11-11 14:42:07 -08:00
Ian Storm Taylor
eb7ad70dde fix to always default operation.data to an object 2018-11-11 14:34:05 -08:00
Malgalad
da2cf83310 Fix deleteBackwardAtRange removing extra character when called at start of both block and inline node (#2408) 2018-11-11 10:59:40 -08:00
Ian Storm Taylor
a75c06b501 Publish
- slate-base64-serializer@0.2.89
 - slate-html-serializer@0.7.28
 - slate-hyperscript@0.11.19
 - slate-plain-serializer@0.6.28
 - slate-prop-types@0.5.19
 - slate-react-placeholder@0.1.7
 - slate-react@0.21.10
 - slate@0.44.4
2018-11-09 17:27:30 -08:00
Ian Storm Taylor
6cd1c0968e fix lint 2018-11-09 17:25:45 -08:00
Ian Storm Taylor
b01992474c add child to child_max_invalid schema errors 2018-11-09 17:24:02 -08:00
Ian Storm Taylor
f13571cb65 Publish
- slate-base64-serializer@0.2.88
 - slate-html-serializer@0.7.27
 - slate-hyperscript@0.11.18
 - slate-plain-serializer@0.6.27
 - slate-prop-types@0.5.18
 - slate-react-placeholder@0.1.6
 - slate-react@0.21.9
 - slate@0.44.3
2018-11-09 16:41:50 -08:00
Ian Storm Taylor
b33605ec06 fix schema normalization bug for child_max_invalid 2018-11-09 16:39:33 -08:00
Ian Storm Taylor
03d531ba77 fix path transformation bug when moving exactly 2018-11-09 16:39:11 -08:00
Ian Storm Taylor
f3922ed2f7 Publish
- slate-base64-serializer@0.2.87
 - slate-html-serializer@0.7.26
 - slate-hyperscript@0.11.17
 - slate-plain-serializer@0.6.26
 - slate-prop-types@0.5.17
 - slate-react-placeholder@0.1.5
 - slate-react@0.21.8
 - slate@0.44.2
2018-11-09 08:31:56 -08:00
Dundercover
3f0f55ff38 Do not show placeholder when document contains multiple text nodes (#2403) 2018-11-09 08:29:22 -08:00
云无心
65d662fea1 when document is very big ,toArray is very time-consuming (#2404)
* when document is very big  ,`toArray` is very time-consuming

* when document is very big  ,`toArray` is very time-consuming
2018-11-09 08:28:11 -08:00
Ian Storm Taylor
6ddba0ea35 Publish
- slate-base64-serializer@0.2.86
 - slate-html-serializer@0.7.25
 - slate-hyperscript@0.11.16
 - slate-plain-serializer@0.6.25
 - slate-prop-types@0.5.16
 - slate-react-placeholder@0.1.4
 - slate-react@0.21.7
 - slate@0.44.1
2018-11-08 15:40:26 -08:00
Dundercover
4df88cfaeb Add node.isNodeInRange (#2401)
* Add `node.isNodeInRange`

* Add tests for `node.isNodeInRange`
2018-11-08 15:38:18 -08:00
Dundercover
13107b0c43 Add optional id prop to the Editor component (#2402) 2018-11-08 15:36:44 -08:00
Dundercover
eb79c3dbff Add path type change to changelog entry (#2400) 2018-11-08 15:36:05 -08:00