Ian Storm Taylor
6ab686ae77
Refactor benchmarks ( #675 )
...
* first stab
* refactor to nanobench
* refactor to matcha
* use hand-rolled comparison logic, ugh
* update threshold
* remove unused dependencies
* remove benchmarks from travis ci
2017-03-21 17:38:39 -07:00
yāλu
5ce7d165aa
added onFocus, and docs. fixes #650 ( #666 )
...
* added onFocus, and docs. fixes #650
* sorted prop types declarations alphabetically
2017-03-18 16:55:22 -07:00
Ian Storm Taylor
eb4854006a
add ability to not normalize on state creation
2017-03-05 16:54:26 -08:00
Aliaksei Simanchyk
698a88a24f
fix getting index for inline node in unwrapInlineAtRange, fixes #620 ( #648 )
2017-03-04 18:26:35 -08:00
Ian Storm Taylor
d70f35f537
change selectAll to not focus, and add docs
2017-02-28 19:07:46 -08:00
Victor Pontis
77f939d6c8
Add functionality and test-case for selectAll ( #637 )
...
* Add functionality and test-case for selectAll
* Update to use moveToRange
2017-02-28 19:03:12 -08:00
Ian Storm Taylor
64b1e542b8
refactor the Selection model, deprecating old methods ( #631 )
...
* refactor Selection, deprecating old methods
* fix a few more things
* introduce an alternative for moveToOffsets
* add edge methods for move{start/end}OffsetTo
* fix selection return value
* fix deprecation warnings
* refactor transforms to make auto-generating easier
* refactor and deprecate selection transforms
* remove deprecation warnings from tests
* fix deprecation warnings in examples
2017-02-27 12:55:13 -08:00
Per-Kristian Nordnes
86cbb0d49a
Allow document to have no nodes when deleting a single void-block. Partially fixes #505 ( #622 )
2017-02-23 15:06:20 -08:00
Per-Kristian Nordnes
a67a93dd42
Fix behaviour where deleteBackward/Forward on empty block deleted the void block above/below ( #618 )
2017-02-23 08:51:59 -08:00
Raffaele De Feo
85b901a4d0
Don't rely on CSS positioning to hide text caret inside Void
Inline
nodes,
...
instead make it invisible setting spacer `color` property to `transparent`.
In Chrome, replace zero-with space with hair space to avoid graphics glitches.
Update tests.
2017-02-14 21:12:36 +01:00
Ian Storm Taylor
44303dc22f
fix html serializer default block type logic
2017-02-13 18:21:27 -08:00
Per-Kristian Nordnes
add174ef37
Allow setting a defaultBlockType as object for HTML serializer ( #595 )
...
* Allow setting a defaultBlockType as object for HTML serializer
* Add test for html deserializer default block as object
* Code enhancement/compacting
2017-02-13 18:16:08 -08:00
Stan Chang Khin Boon
3a23c21848
Add props “autoCorrect” to editor and content. ( #596 )
...
This allow user to turn off predictive text input on iOS thus mitigating #540…
2017-02-13 16:30:20 -08:00
Nicolas Gaborit
17a014deac
Fix deleteAtRange with nested blocks ( #594 )
...
* Add failing test for backspace in a nested block
* Fix deleteAtRange
* Move to test to delete-at-range
* Use and improve getHighestOnlyChildParent
2017-02-13 14:27:59 -08:00
Ian Storm Taylor
303b107ca2
Merge branch 'fix-word-char-deletes'
2017-02-07 12:26:04 -08:00
Ian Storm Taylor
cab29ca19c
fix deleteing by word or character
2017-02-07 12:25:53 -08:00
Ian Storm Taylor
99bae0e892
fix tests
2017-02-07 10:08:20 -08:00
Raffaele De Feo
4f439ab3ca
Set the display
ccs property of the void inline wrappers to inline-block
.
...
Update tests.
2017-02-07 18:08:14 +01:00
Ian Storm Taylor
a7f6584179
added toRaw
option to Html and Plain serializers, fixes #583 #584
2017-02-06 17:28:46 -08:00
AlbertHilb
ca1e0d8c6d
Add data property to document
. ( #572 )
...
* Add data property to `document`.
Add `setDocumentDataOperation' to set document data.
Change `Raw` serializer to take into account the document `data` property.
Update docs and tests.
* Make `setNode` operation working with document node.
Rewrite `setDocumentdataOperation` using `setNode`.
* Make 'setNodeByKey' working also with document node.
* Get rid of `setDocumentDataOperation`.
2017-01-31 10:23:04 -08:00
Samy Pessé
98995e7c08
Add props "tabIndex" and "role" ( #552 )
...
* Add prop "tabIndex" to editor
* Add prop "role"
* Typo
* Adapt rendering tests
2017-01-18 17:29:37 -08:00
Ian Storm Taylor
71befd0202
add on-select behavior test
2016-12-09 12:44:12 -08:00
Ian Storm Taylor
ad2642a3b5
Add the Stack
concept ( #513 )
...
* trying to get testing in browser to work
* add the "stack" concept
* remove old things from package.json
* minor fixes
2016-12-09 12:15:36 -08:00
Nicolas Gaborit
ed0395999c
Add unwrapNodeByKey ( #509 )
...
* Add separate splitNodeOperation in two different op
* Add transform unwrapNodeByKey
* Add tests for unwrapNodeByKey
* Add test for undo of unwrapNodeByKey
* Support normalize option
* Handle last/first sibling case
* Document new unwrapNodeByKey transform
2016-12-08 10:37:34 -08:00
Ian Storm Taylor
5808e64635
change zero-width spaces to use data attributes for consistency
2016-12-07 21:16:04 -08:00
Ian Storm Taylor
bd44acb92a
fix void rendering tests
2016-12-07 20:45:10 -08:00
Ian Storm Taylor
d0ccfac77f
rename data-slate-content to data-slate-editor
2016-12-07 15:20:57 -08:00
Ian Storm Taylor
48411c769f
update transforms tests
2016-12-07 15:19:49 -08:00
Sunny Hirai
479ab24320
Added call
to Transforms ( #503 )
...
* Added call method to Transforms to enable calling of custom transforms
* Fixed spacing
2016-12-07 15:17:05 -08:00
Ian Storm Taylor
1f60d4c9ab
Revert jest ( #507 )
...
* remove debugger
* switch back to mocha
* remove jest config from package.json
* remove old browser test support files
* remove unnecessary assert-json helper
2016-12-07 15:16:49 -08:00
AlbertHilb
a1638dd906
Add an attribute to uniquely identify divs used to render content
component ( #470 )
...
* Add `data-slate-content` attribute to the divs used to render `content` components.
Use that attribute to uniquely identify them.
Update test expected results.
* Fix lint complaints.
2016-12-07 15:16:40 -08:00
Ian Storm Taylor
4a513dc06b
remove debugger
2016-12-07 10:56:06 -08:00
Ian Storm Taylor
55fd06449b
update tests to use jest and be async, closes #495 ( #502 )
...
* update tests to use jest and be async, closes #495
* add read-metadata for perf and fragments
2016-12-06 15:21:08 -08:00
Ian Storm Taylor
a1a8c7f65f
fix deleting forward and backward around inlines
2016-12-02 15:44:07 -08:00
Ian Storm Taylor
5b2d2ffd56
got rest of inline tests passing
2016-12-02 15:23:58 -08:00
Ian Storm Taylor
8096761a97
fix lots of tests with inline behavior
2016-12-02 13:09:24 -08:00
Ian Storm Taylor
73cf5fe54f
Merge branch 'fix/483' of https://github.com/SamyPesse/slate into fix-empty-inline
2016-12-02 10:25:35 -08:00
Samy Pessé
174595b51c
Add extra text nodes
2016-12-02 18:51:59 +01:00
Samy Pessé
671c568258
Add extra text nodes
2016-12-02 18:51:34 +01:00
Samy Pessé
db6dfa04ac
Remove comment
2016-12-02 18:50:50 +01:00
Samy Pessé
90000675e1
Remove comment
2016-12-02 18:50:02 +01:00
Samy Pessé
909e7d358f
Adapt tests for schema
2016-12-02 17:57:24 +01:00
Samy Pessé
797b58e5c5
Implement "wrapInlineByKey" and use it in "wrapInlineAtRange"
2016-12-02 14:05:45 +01:00
Samy Pessé
238ed2b3ab
Add failing unit test
2016-12-02 12:57:14 +01:00
Ian Storm Taylor
efd884b4b1
fix offset calculations and splitting near inlines
2016-12-01 14:26:45 -08:00
Ian Storm Taylor
623b1f17b3
refactor core schema rules
2016-12-01 12:19:44 -08:00
Ian Storm Taylor
ff5e67e63f
add test for joining forward on inline voids
2016-11-29 16:21:18 -08:00
Ian Storm Taylor
083df2dd93
fix to always opt for the furthest text node at an offset
2016-11-29 16:19:40 -08:00
Ian Storm Taylor
6346ef3aa2
refactor core schema to remove last for void nodes
2016-11-22 12:57:02 -08:00
Ian Storm Taylor
da85c5ac87
refactor delete at current range
2016-11-22 12:03:47 -08:00