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

961 Commits

Author SHA1 Message Date
Samy Pesse
4c9e138d04 Merge remote-tracking branch 'slate/master' into schema-normalize 2016-10-25 21:55:53 +02:00
Soreine
b2b4a4d565 Fix rule INLINE_VOID_TEXTS_AROUND
Added an additional test. Was working previously because the
normalization was called several times recursively.
2016-10-25 21:13:14 +02:00
Soreine
b7693213a0 No lint in npm run test. Lint is done on Travis 2016-10-25 21:13:14 +02:00
Samy Pessé
f380943926 Add transform "unwrapBlockByKey" and "unwrapInlineByKey" (#390)
* Add transform .unwrapInlineByKey with test and documentation

* Add transform .unwrapBlockByKey with test and documentation

* add failing test for unwrap limited to a range

* Improve creation of selection in unwrap[Inline|Block]ByKey

* Adapt unwrapInlineAtRange to take range in consideration

* Add test to unwrapInline only one in the document
2016-10-25 12:04:12 -07:00
Samy Pesse
5477754f63 Fix #397: resolve to leaf text in selection methods 2016-10-25 18:50:03 +02:00
Samy Pessé
0e32043315 Merge branch 'schema-normalize' of https://github.com/GitbookIO/slate into schema-normalize 2016-10-25 17:52:03 +02:00
Samy Pessé
c59ae7a544 Adapt transform deleteAtRange 2016-10-25 17:26:07 +02:00
Samy Pessé
11698bd6fc Merge branch 'pr393' into schema-normalize 2016-10-25 15:48:46 +02:00
Soreine
ce0a5579e7 Remove a most of unused vars 2016-10-25 13:12:10 +02:00
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