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

63 Commits

Author SHA1 Message Date
Ian Storm Taylor
628165eb3f merge master changes 2016-09-10 17:24:07 -07:00
Andrew Cobby
d6901aa416 Add failing test showing splitBlock with isVoid bug (#276)
* Add failing test showing splitBlock with isVoid bug

Not sure what I actually expected calling `splitBlock()` on void block, but I
would expect `splitBlock()` to respect a given block type's isVoid property.
This failing test demonstrates that `splitBlock()` always creates a the new
block with `isVoid: false`.

* Fix isVoid not being copied when using splitBlock()

The bug was actually inside `splitBlockAtRange`, as that's what actual drives
`splitBlock()` (I assume the bug was therefore present in both methods). The
fix is to simply copy across the `isVoid` value from the block being copied.
2016-09-04 21:19:00 -07:00
Ian Storm Taylor
da274c818f fix tests to ignore .DS_Store 2016-09-03 17:52:00 -07:00
Ian Storm Taylor
68e8be229d fix selection transform tests 2016-08-30 15:35:07 -07:00
Ian Storm Taylor
b0cf3d795f add more selection tests 2016-08-29 17:27:31 -07:00
Ian Storm Taylor
16617061ee refactor transform tests, add selection transform tests 2016-08-29 15:01:55 -07:00
Ian Storm Taylor
24f36862d6 fix normalization for inserting inlines and blocks 2016-08-18 12:39:54 -07:00
Ian Storm Taylor
417e1484c5 refactor wrap inline transform 2016-08-18 12:38:35 -07:00
Ian Storm Taylor
84ba78582f more refactoring transforms 2016-08-17 20:36:32 -07:00
Ian Storm Taylor
4e24f2666a refactor transforms 2016-08-17 15:59:03 -07:00
Ian Storm Taylor
31924c5314 fix delete when end block has inline nodes 2016-08-15 16:21:41 -07:00
Ian Storm Taylor
8b5305f239 first stab at adding a schema to core 2016-08-12 11:33:48 -07:00
Ian Storm Taylor
7ee58a55e2 fix insertFragment for nested blocks 2016-08-11 14:41:51 -07:00
Ian Storm Taylor
90d4eced95 add wrapTextAtRange tests, cleanup wrapText style and backwards handling 2016-08-09 09:32:46 -07:00
Samy Pessé
17f703cecb WIP: Add transform wrapText (#227)
* Add basic implementation of wrapText

* Default suffix for wrapText to prefix

* Add more tests for afterText

* Add tests "whole-block" and "empty-block" for wrapText

* Add tests for across-blocks and across-inlines

* Preserve selection on wrapText

* Remove comment about cursor position

* Document transformation "wratTextAtRange"
2016-08-09 09:11:21 -07:00
Suwijak Chaipipat
10cfb6e48b Change concat into insertChildrenAfter and insertChildrenBefore (#232)
* Change concat into insertChildrenAfter and insertChildrenBefore

* Update input and out yaml of insert block at range block-end

* Update input and out yaml of insert block at range block-start
2016-08-09 09:10:03 -07:00
Ian Storm Taylor
772aadb70a fix insertText to do nothing in void nodes 2016-08-05 10:32:00 -07:00
Ian Storm Taylor
90abc993b9 fix for insertBlockAtRange in empty blocks, closes #224 2016-08-05 10:25:52 -07:00
Ian Storm Taylor
9521b1abf6 fix selection handling for insertFragment and wrapInline 2016-08-01 19:23:21 -07:00
Ian Storm Taylor
c4e1e475eb add insertInline with tests 2016-08-01 18:53:05 -07:00
Ian Storm Taylor
dfcd791b3b fix deleteAtRange to split only to common ancestor 2016-07-28 17:17:18 -07:00
Ian Storm Taylor
a892c6b800 change wrapping transform arguments for consistency 2016-07-28 16:24:24 -07:00
Ian Storm Taylor
5f73c63208 fix selection setting in wrapInline transform 2016-07-28 12:32:33 -07:00
Tyler Johnson
84829f5439 add tests for calling wrapInline twice (#197) 2016-07-28 11:43:44 -07:00
Ian Storm Taylor
1c86b2fcf7 fix deleting sibling inline node 2016-07-27 22:30:37 -07:00
Ian Storm Taylor
fc8fb18fda fix deleting sibling text node 2016-07-27 17:09:10 -07:00
Ian Storm Taylor
42cbcb7e8d change void nodes to have a single space, prevent text-less inlines 2016-07-27 16:21:55 -07:00
Ian Storm Taylor
8916ee0891 fix to remove extra empty text nodes, closes #171 2016-07-26 11:51:20 -07:00
Ian Storm Taylor
98c78e4d96 refactor raw serializer to not be terse by default 2016-07-25 13:29:29 -07:00
Ian Storm Taylor
81c956228b more work on draggable nodes 2016-07-24 18:57:09 -07:00
Ian Storm Taylor
3bd000d118 add draggable nodes, first steps 2016-07-24 18:04:11 -07:00
Ian Storm Taylor
466f377ffa fixes for style and consistency 2016-07-24 17:59:26 -07:00
Mathieu Dutour
8407023e5f add setNodeByKey transform (#157)
* modifyNode transform

* create DOCUMENT_NODE_TRANSFORMS and use assertDescendant to get the node directly

* rename to setNodeByKey
2016-07-24 17:53:28 -07:00
Ian Storm Taylor
f8f01949e4 add tests for insertText with marks 2016-07-22 20:22:01 -07:00
Ian Storm Taylor
0dc348dec8 add insertText transform tests 2016-07-21 16:08:12 -07:00
Ian Storm Taylor
eb95b79a00 add wrapInline transform tests 2016-07-21 16:03:02 -07:00
Ian Storm Taylor
1bf729db5f add wrapBlock transform tests 2016-07-21 15:50:08 -07:00
Ian Storm Taylor
dd189f7385 add unwrapInline transform tests 2016-07-21 15:48:05 -07:00
Ian Storm Taylor
49c5754c8e add unwrapBlock transform tests 2016-07-21 15:41:59 -07:00
Ian Storm Taylor
986e49aaac add splitBlock and splitInline transforms tests 2016-07-21 15:35:29 -07:00
Ian Storm Taylor
37829137c6 add setBlock and setInline transform tests 2016-07-21 15:15:50 -07:00
Ian Storm Taylor
f5ca91df8a add deleteForward and deleteBackward transform tests 2016-07-21 14:57:26 -07:00
Ian Storm Taylor
7615ce8611 add insertFragment transform tests 2016-07-21 14:57:17 -07:00
Ian Storm Taylor
33b1b1379b add delete() tests 2016-07-21 12:30:29 -07:00
Ian Storm Taylor
00261eded9 add toggleMarkAtRange remove tests 2016-07-21 12:26:11 -07:00
Ian Storm Taylor
4d69df224a add removeMark tests, update toggleMark tests 2016-07-21 12:23:47 -07:00
Ian Storm Taylor
4197921946 add selection assertions to addMark tests 2016-07-21 12:17:12 -07:00
Ian Storm Taylor
035ae4451a add more mark tests 2016-07-21 11:59:39 -07:00
Ian Storm Taylor
0ebe5b4b64 add toggleMark and toggleMarkAtRange transforms 2016-07-21 11:59:21 -07:00
Ian Storm Taylor
f1b961fc35 add memoization and clean up node methods (#141)
* cleanup node methods

* add first stab at memoization of node methods

* rename getTextNodes() to getTexts() for consistency
2016-07-20 21:36:52 -07:00