Soreine
e81708e82f
Update eslint and add sensible rules (including important React rules)
2016-10-25 13:11:19 +02:00
Soreine
0bd52d35cd
Don't normalize on insertText if selection is not expanded
2016-10-25 12:01:18 +02:00
Soreine
dc8a588e41
Optimize transforms by-key to lookup parent only if normalize
2016-10-25 11:56:35 +02:00
Samy Pessé
efaa5deae9
Merge branch 'schema-normalize-transforms' into schema-normalize
2016-10-25 10:36:17 +02:00
Soreine
4b3a51396c
Merge branch 'master' into schema-normalize
2016-10-25 10:27:10 +02:00
Samy Pessé
c2c1fc9c9f
Remove console logs in normalize transforms
2016-10-25 10:18:29 +02:00
Samy Pessé
218bb0c472
Don't normalize when schema has no normalization rules
2016-10-25 10:15:37 +02:00
Samy Pesse
b1cfc8be93
Merge branch 'schema-normalize-transforms' into schema-normalize
2016-10-25 00:07:45 +02:00
Nicolas Gaborit
f1a5d6f3b4
Add benchmarks ( #368 )
...
* Add script for benchmark
* Add error handling
* Rename folder to perf/benchmarks
* Add README
* Avoid memoization between benchmark runs
* Handle multiple benchmark. Add setup to benchmarks
* Run benchmarks through Travis
* Add command line options for JSON output
* Add export to JSON, and comparison with reference
* Improve serialize and fix results display
* Add perf/ to .npmignore
* Print error message
* Create normal example for normalize
* Add normalize-document wide and deep
* Add split-block normal, deep and wide
* Add delete-backward benchmarks
* Fix too much newlines
* Use microtime for better results maybe?
* Print number of runs
* Add minSamples options for better accuracy
* Use babel-node to launch benchmarks
* Use jsdom-global instead of mocha-jsdom (deprecated)
* Add rendering benchmark example
* Fix jsdom usage.
* Use JSX because we can
* Only use on('cycle') that is called even on error
* Example of successive rendering benchmark
* Rename README, and explain how to add a benchmark
* Add C++11 to Travis to install microtime
* Update Readme.md # Understanding the results
* Try to fix Travis build with microtime
* Travis: use before_install
Instead of overwriting install
* Forgot to remove mocha-jsdom import
Thanks node_modules...
* Add jsdom as devDependency
(required as peer dependency by jsdom-global)
* Add --only option to run only a specific benchmark
* Print name onStart rather than at end
2016-10-24 15:06:17 -07:00
Samy Pesse
b09e326426
Normalize selection after all transforms
2016-10-24 23:51:28 +02:00
Samy Pesse
9562845ca5
Add logging/timing for normalize calls
2016-10-24 23:38:08 +02:00
Samy Pesse
d6e57d297e
Fix normalize calls after moveNodeByKey
2016-10-24 23:30:54 +02:00
Samy Pesse
684d51e4b6
Add another tests for removeTextByKey with inline
2016-10-24 23:23:13 +02:00
Samy Pesse
5ded81e335
Add transform normalizeParentsByKey
2016-10-24 23:16:26 +02:00
Samy Pesse
07de7bf596
Fix transform moveNodeByKey when container is the parent
2016-10-24 21:28:30 +02:00
Samy Pesse
ddf2221929
Fix transform "wrapTextAtRange" throwing JS error
2016-10-24 21:03:48 +02:00
Samy Pesse
c8f69a4f94
Remove useless code
2016-10-24 19:59:02 +02:00
Samy Pessé
ee62f3c339
Merge branch 'schema-normalize-transforms' of https://github.com/GitbookIO/slate into schema-normalize-transforms
2016-10-24 18:32:31 +02:00
Samy Pessé
cdc2d6d4ea
Add option normalize on AtRange transforms
2016-10-24 18:30:24 +02:00
Soreine
b64681aae0
Fix rule INLINE_NO_EMPTY to act on parent block
2016-10-24 17:26:19 +02:00
Soreine
25909b7867
Remove unreachable code
2016-10-24 16:22:12 +02:00
Samy Pessé
b122a2a464
Use ByKey instead of NodeOperation in wrapBlockAtRange
2016-10-24 12:56:29 +02:00
Samy Pesse
c7f0c655ab
Add normalize nodes to transforms bykey
2016-10-24 09:33:58 +02:00
Samy Pesse
1377e28bcb
Don't normalize when applying transforms
2016-10-24 00:22:21 +02:00
Samy Pesse
4f1fc842a8
Fix inline void inside an inline node
2016-10-23 23:53:01 +02:00
Samy Pesse
4d0f067250
Add failing test for schema rule
2016-10-23 23:08:01 +02:00
Samy Pesse
1689e6408a
Fix stupid error in recursive normalize calls
2016-10-23 01:12:44 +02:00
Samy Pesse
d2850870e3
Don't call onBeforeChange when emitting new state
2016-10-22 20:58:02 +02:00
Samy Pesse
112b7c8406
Don't normalize document when selection is changing
2016-10-22 20:04:54 +02:00
Samy Pesse
f31ac63e97
Use normalizNodeByKey instead of normalizeDocument when possible
2016-10-22 19:35:59 +02:00
Samy Pesse
7ed21fde63
Add more unit tests for normalize of "text around isVoid"
2016-10-22 18:13:29 +02:00
Samy Pesse
7d1279ffe9
Refactor tests for schema
2016-10-22 18:04:31 +02:00
Samy Pesse
f73f63e6b9
Normalize children before normalizing a node itself
2016-10-22 18:03:49 +02:00
Samy Pesse
798a0a90f8
Adapt test for unwrapInline across blocks
2016-10-22 01:07:55 +02:00
Samy Pesse
0682f59954
Adapt tests for setBlock/setInline with isVoid
2016-10-22 01:03:52 +02:00
Samy Pesse
3c7914b354
Enforce selection to be correct after final normalization
2016-10-22 00:48:55 +02:00
Samy Pesse
1dbc90604d
Add utils/warning.js
2016-10-22 00:36:42 +02:00
Samy Pesse
8ed3f12aba
Remove no longer existant normalize operation
2016-10-20 23:48:42 +02:00
Samy Pesse
a0a57f36f9
Use node level normalization in transform "removeTextByKey"
2016-10-20 00:17:39 +02:00
Samy Pesse
8346bfc72f
Normalize selection after normalizing document
2016-10-19 22:54:38 +02:00
Samy Pesse
a67f612065
Fix normalization to prevent extra empty text nodes
2016-10-19 18:44:08 +02:00
Samy Pesse
d9669f73b5
Add rule to remove empty extra text nodes
2016-10-19 17:43:42 +02:00
Samy Pesse
8402df138e
Add rules to prevent empty inline nodes
2016-10-19 13:45:14 +02:00
Samy Pesse
4c5ce86333
Add schema rule to ensure that inline nodes have a space as content
2016-10-19 12:49:06 +02:00
Samy Pesse
0f80230776
Remove transform "unwrapInlineByKey" done by another PR
2016-10-19 12:01:52 +02:00
Samy Pesse
a51061f094
Improve normalize and validation to be recursive
2016-10-19 11:52:55 +02:00
Samy Pesse
d2d7122ffc
Move normalize logic to src/transforms/normalize.js
2016-10-19 00:41:01 +02:00
Samy Pesse
808ae3c1fb
Fix rule NO_ADJACENT_TEXT_RULE
2016-10-18 22:43:18 +02:00
Samy Pesse
0246c3085b
Remove normalization from transform calls
2016-10-18 22:00:50 +02:00
Samy Pesse
a49f8e1bfa
Fix normalization to join adjacent text nodes
2016-10-18 21:50:42 +02:00