1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-17 04:34:00 +02:00
Commit Graph

4195 Commits

Author SHA1 Message Date
Soreine
0dc3c4ef8a Add memoize-util benchmark 2016-11-02 16:23:40 +01:00
Samy Pessé
13d7cb07c6 Improve unicity of uid used to generate keys 2016-11-02 15:52:37 +01:00
Samy Pessé
a9807c949b Add method to return all keys in a node 2016-11-02 15:52:36 +01:00
Soreine
ee29523789 Rewrite getFirstText to not use findDescendant 2016-11-02 12:35:31 +01:00
Soreine
cb333a4882 Rewrite getDescendant to be recursively memoized 2016-11-02 12:35:31 +01:00
Samy Pessé
afc413f5c7 Fix lint errors 2016-11-01 16:46:21 +01:00
Soreine
bc3fe73487 Merge branch 'schema-normalize-memoization' into schema-normalize 2016-11-01 16:33:14 +01:00
Soreine
17fa721801 Revert "Memoize Schema.__validate"
It's useless because we already compare with previous node in normalize

This reverts commit 6f49c3fcbc.
2016-11-01 15:51:21 +01:00
Soreine
6f49c3fcbc Memoize Schema.__validate 2016-11-01 15:50:44 +01:00
Samy Pessé
42b5e893a3 Use different build for test/lint/benchmarks 2016-11-01 15:20:04 +01:00
Samy Pessé
37d99e0edb Lint after running tests and benchmarks 2016-11-01 15:02:07 +01:00
Soreine
321a71ef25 Remove old validate methods 2016-11-01 14:56:02 +01:00
Soreine
f9eda89c33 Unmemoize filterDescendant 2016-11-01 14:35:44 +01:00
Samy Pessé
e9f05bc1b4 Don't normalize the selection twice when moving the cursor 2016-11-01 14:35:40 +01:00
Soreine
c50b124d58 Unmemoize getFurthest and make it use getAncestors 2016-11-01 14:33:14 +01:00
Soreine
966e2c472d Unmemoize getClosest 2016-11-01 14:28:45 +01:00
Soreine
5c6e4b944c Memoize getDescendantAtPath 2016-11-01 13:31:22 +01:00
Soreine
136867d240 Only lookup entry once on memoize cache hit 2016-11-01 13:27:38 +01:00
Soreine
fea1e69e72 Unmemoize findDescendant 2016-11-01 13:27:38 +01:00
Soreine
22dd861233 Small optimization for normalize
Avoid calling refreshNode needlessly
2016-11-01 13:27:38 +01:00
Samy Pessé
247e546b3b Fix error 💣 in shouldComponentUpdate 2016-11-01 13:24:50 +01:00
Samy Pessé
af6b0e0388 Add unit test for undo of setNodeByKey 2016-11-01 11:53:36 +01:00
Samy Pessé
925189eb94 Don't normalize with schema when moving selection 2016-10-31 17:59:01 +01:00
Soreine
74695d80f0 Small optimization for deleteBackward/deleteForward 2016-10-31 16:38:57 +01:00
Samy Pessé
2aeaae445e Add node compare to improve normalize calls 2016-10-31 16:28:51 +01:00
Samy Pessé
d048d7bb35 Fix indent in src/utils/warning.js 2016-10-31 13:52:46 +01:00
Samy Pessé
74523dfe0c Use Immutable.is only in development for node comparaison 2016-10-31 11:45:18 +01:00
Samy Pessé
d6e7fb6bf0 Preserve node reference when splitting 2016-10-31 10:43:27 +01:00
Soreine
6d88672e83 Fix insert-text benchmark 2016-10-28 12:35:00 +02:00
Soreine
2a6fc88bfe Merge branch 'more-benchmarks' into schema-normalize 2016-10-28 12:34:27 +02:00
Soreine
2f3dda35aa Adapt benchmarks 2016-10-28 11:45:14 +02:00
Soreine
164ecc6d76 Fix _normalizeNodeWith 2016-10-28 10:30:33 +02:00
Soreine
ddb8522584 Recursive safety fixed, and throw error instead 2016-10-27 18:08:51 +02:00
Soreine
4fa097ab0b Add maximum number of recursivity for normalization 2016-10-27 17:11:08 +02:00
Soreine
eb9b97d79e Add newline for better readability in console 2016-10-27 16:14:00 +02:00
Soreine
8e963c75a6 Immutable check warning: Log concerned node 2016-10-27 16:06:42 +02:00
Soreine
4374eb9b33 Document wrapBlockByKey 2016-10-27 15:13:30 +02:00
Soreine
6a77aa1cf3 Export wrapBlockByKey and add tests 2016-10-27 14:56:04 +02:00
Soreine
6e0799010c Add transform wrapBlockByKey, to wrap any node
This can be used to simply wrap a Text node. This is not possible with
the current implementation of `wrapBlockAtRange`, which wraps the
closest parent block of the text node.
2016-10-27 14:38:02 +02:00
Samy Pessé
081ade234e Update condition for shouldComponentUpdate and immutable.is 2016-10-27 11:59:51 +02:00
Soreine
19f56c8cdb Merge branch 'master' into schema-normalize 2016-10-27 10:36:58 +02:00
Samy Pessé
6a5a7f37b2 Add warning log when references are different in shouldComponentUpdate(Fix #373) 2016-10-27 10:17:08 +02:00
Samy Pessé
e5abd9e0b4 Merge pull request #1 from GitbookIO/schema-normalize-selection-ops
Update selection in low-level operations
2016-10-27 09:56:30 +02:00
Samy Pessé
379640d7e1 Simplify deleteForward and deleteBackward 2016-10-27 09:55:25 +02:00
Ian Storm Taylor
d4eb53fd6f 0.14.16 v0.14.16 2016-10-26 13:02:01 -07:00
Tyler Johnson
db95f4bdec fix for deleting across an inline (#384)
* failing test for deleting across an inline

* fix deleting across inlines (#384)

* Add jsdom devDepencency

Required as peer dependency by mocha-jsdom
2016-10-26 12:59:03 -07:00
Nicolas Gaborit
8851855b5b Node methods optimizations (#364)
* Node.getParent exits earlier

* Add Node.getAncestors method

* Remove numerous getParent in Node.getClosest

* Remove use of assertDescendant in getPath

Still throws when not finding the descendant though

* Remove assertDescendant from Node.updateDescendant

* Remove assertDescendant from Node.removeDescendant

* Fix Node.findDescendant, which always returned first level descendants

* Add Node.findDescendantDeep

* Memoize Node.getAncestors

* Implement and use Node.get{First|Last}Text

* Add jsdom devDepencency

Required as peer dependency by mocha-jsdom
2016-10-26 12:46:40 -07:00
jasonphillips
dca60c42ce Html serializer: optionally return React elements (#408)
* Html serializer optionally returns React elements

* update heredoc to indicate optional return value of array

* update documentation for html serializer to include React return option

* move returnElements argument to render:false
2016-10-26 12:46:24 -07:00
Nikita Zyulyaev
270c2ab219 Fix inserting fragment at the end of current text node (#405)
* fix insertFragment

* insert multi-block fragment at the end of current text node test case
2016-10-26 11:30:45 -07:00
Soreine
40456a0e4a Add tests for splitNode operation 2016-10-26 19:00:59 +02:00