1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-23 15:32:59 +02:00
Commit Graph

4279 Commits

Author SHA1 Message Date
Jon Portella
fbe70a1f28 Fix: prop name (#2780)
Nodes weren't properly rendering because the Editor was trying to call the function prop renderBlock but instead another called renderNode was passed.
2019-05-20 13:34:30 -07:00
Cary Dunn
7adf56ffd1 gracefully handle null content ref in findDOMNode query (#2774) 2019-05-20 13:34:16 -07:00
Entkenntnis
020672a2ea fixing order of blocks if inserted at start of node (#2772)
* fixing order of blocks if inserted at start of node

* fix lint errors
2019-05-20 13:31:41 -07:00
Justin Weiss
559bde9a21 Allow deleteAtRange with a zero-length range on the first character (#2800)
deleteAtRange will consider a zero-length range on the first character
of a text node as a hanging selection, which is incorrect. This should
not be considered hanging.

It's still possible to hit the `startKey === endKey && isHanging`
conditional if endKey is in a void node, since we will bump the
selection to the previous node and update endKey (but then endOffset
is no longer 0, so it's not _really_ hanging anymore). We have an
existing test for that, and it still passes after this change.
2019-05-20 13:18:31 -07:00
Justin Weiss
09f4662d31 Use relative path to find a node's text nodes (#2799)
When `block.texts()` is passed a path, it treats that path as relative
to itself. `findSelection` passes it the selection path, which is
relative to the document.

In order to find the correct text nodes, we must convert the selection
path to a path relative to the block we found. Then, when a new path
is returned, we need to convert that new block-relative path back to a
document-relative path.
2019-05-20 13:17:28 -07:00
Sunny Hirai
b9cdaeb6a5 Add debug plugins (#2803)
* Add debug plugins

* Fix lint errors
2019-05-17 18:08:19 -07:00
Sunny Hirai
cf4bf38aca Reconcile node (#2802)
* Add reconcileNode command

* Fix lint errors

* Remove node.path shortcut as path is not a property anymore
2019-05-17 16:28:32 -07:00
Sunny Hirai
79a2d21571 Reconcile dom node (#2801)
* Add reconcileDOMNode command fixes set-text-from-dom-node

* Fix linting and cleanup unused files

* Removed unnecessary console log
2019-05-17 15:26:48 -07:00
Sunny Hirai
48eb6700b7 Add error boundary to save Slate from a crash on corrupt DOM (#2792)
* Working version of restore dom

* Fix linting errors

* Add button to corrupt DOM

* Added error boundary that fixes DOM on render error

* Fix linting errors

* Fix debug output for componentDidCatch

* Improve example by adding a separate restoreDOM button

* Remove key change from error boundary which is not necessary

* Fix linting error
2019-05-16 16:26:13 -07:00
Ralph Feltis
fd8e18b9cf Fix typo in commands.md (#2791)
* Adding Guilded to Products list

* Fixing typo

* Fixing typo
2019-05-16 16:25:49 -07:00
Sunny Hirai
7603415e5d Extract Instruction component into components for examples (#2790) 2019-05-16 13:43:44 -07:00
Sunny Hirai
d24f3b16ec Restore dom (#2782)
* Working version of restore dom

* Fix linting errors
2019-05-16 10:59:51 -07:00
Sunny Hirai
e4fae23454 Separate out EditorValue component for examples (#2785)
* Separate out EditorValue component for examples

* Made it prettier
2019-05-15 14:50:11 -07:00
adjourn
d21cb09a12 Destructure texts iterable (#2764) 2019-05-11 20:29:11 -07:00
Matthew Steedman
f76a00acdc Replace renderNode with renderBlock (#2762) 2019-05-11 18:52:09 -07:00
Dan Schuman
376015df6c Text documentation update (#2758)
`text` property is no longer computed. Add `marks` field.
2019-05-10 10:47:58 -07:00
Ian Storm Taylor
2902899c72 Publish
- slate-base64-serializer@0.2.105
 - slate-html-serializer@0.8.4
 - slate-hyperscript@0.13.2
 - slate-plain-serializer@0.7.4
 - slate-prop-types@0.5.35
 - slate-react-placeholder@0.2.2
 - slate-react@0.22.2
 - slate@0.47.2
slate@0.47.2 slate-react@0.22.2 slate-react-placeholder@0.2.2 slate-prop-types@0.5.35 slate-plain-serializer@0.7.4 slate-hyperscript@0.13.2 slate-html-serializer@0.8.4 slate-base64-serializer@0.2.105
2019-05-09 14:43:28 -07:00
Entkenntnis
5bef253855 fix selection after pasting inline nodes (#2738)
* fix selection after pasting inline nodes

* add forgotten line

* added test case
2019-05-09 13:50:59 -07:00
Ian Storm Taylor
2e197662ae Merge branch 'master' of github.com:ianstormtaylor/slate 2019-05-09 13:42:16 -07:00
Ian Storm Taylor
ebf830c116 fix react-placeholder decoration format, add decoration.mark deprecation, fixes #2750 2019-05-09 13:42:11 -07:00
Jarred Sumner
f62c9b0405 Update Changelog.md (#2749) 2019-05-09 09:32:46 -07:00
Ian Storm Taylor
7845c9534f Publish
- slate-base64-serializer@0.2.104
 - slate-html-serializer@0.8.3
 - slate-hyperscript@0.13.1
 - slate-plain-serializer@0.7.3
 - slate-prop-types@0.5.34
 - slate-react-placeholder@0.2.1
 - slate-react@0.22.1
 - slate@0.47.1
slate@0.47.1 slate-react@0.22.1 slate-react-placeholder@0.2.1 slate-prop-types@0.5.34 slate-plain-serializer@0.7.3 slate-hyperscript@0.13.1 slate-html-serializer@0.8.3 slate-base64-serializer@0.2.104
2019-05-08 20:44:55 -07:00
Ian Storm Taylor
1036503f34 fix annotations toJSON to return an object 2019-05-08 20:42:00 -07:00
Ian Storm Taylor
5bdcbc4d83 Publish
- slate-base64-serializer@0.2.103
 - slate-html-serializer@0.8.2
 - slate-hyperscript@0.13.0
 - slate-plain-serializer@0.7.2
 - slate-prop-types@0.5.33
 - slate-react-placeholder@0.2.0
 - slate-react@0.22.0
 - slate@0.47.0
slate@0.47.0 slate-react@0.22.0 slate-react-placeholder@0.2.0 slate-prop-types@0.5.33 slate-plain-serializer@0.7.2 slate-hyperscript@0.13.0 slate-html-serializer@0.8.2 slate-base64-serializer@0.2.103
2019-05-08 20:36:13 -07:00
Ian Storm Taylor
d00f47256e update changelogs and peer dependencies 2019-05-08 20:33:00 -07:00
Ian Storm Taylor
a5a25f97dd Introduce annotations (#2747)
* first stab at removing leaves with tests passing

* fixes

* add iterables to the element interface

* use iterables in more places

* update examples to use iterables

* update naming

* fix tests

* convert more key-based logic to paths

* add range support to iterables

* refactor many methods to use iterables, deprecate cruft

* clean up existing iterables

* more cleanup

* more cleaning

* fix word count example

* work

* split decoration and annotations

* update examples for `renderNode` useage

* deprecate old DOM-based helpers, update examples

* make formats first class, refactor leaf rendering

* fix examples, fix isAtomic checking

* deprecate leaf model

* convert Text and Leaf to functional components

* fix lint and tests
2019-05-08 20:26:08 -07:00
Josh Duck
5b8a6bb3b4 Fix type (#2735) 2019-05-06 11:26:29 -07:00
Kurt Madsen
cf46e9d3d4 Update "Check Lists" nav item to "Checklists" (#2731)
;checklist: (noun) a list of items required, things to be done, or points to be considered, used as a reminder.

"Check List" sound like an action, not the thing being shown
2019-05-02 16:06:04 -07:00
Ian Storm Taylor
45b6d245af fix benchmarks 2019-05-01 20:14:06 -07:00
Ian Storm Taylor
dbf6237caf Publish
- slate-base64-serializer@0.2.102
 - slate-html-serializer@0.8.1
 - slate-hyperscript@0.12.1
 - slate-plain-serializer@0.7.1
 - slate-prop-types@0.5.32
 - slate-react-placeholder@0.1.20
 - slate-react@0.21.24
 - slate@0.46.1
slate@0.46.1 slate-react@0.21.24 slate-react-placeholder@0.1.20 slate-prop-types@0.5.32 slate-plain-serializer@0.7.1 slate-hyperscript@0.12.1 slate-html-serializer@0.8.1 slate-base64-serializer@0.2.102
2019-05-01 19:57:28 -07:00
David Hrdlicka
7216fdc1bb Wrap insertTextAtRange in withoutNormalizing (#2728) 2019-05-01 19:55:29 -07:00
Ian Storm Taylor
b448a19b8c Publish
- slate-base64-serializer@0.2.101
 - slate-html-serializer@0.8.0
 - slate-hyperscript@0.12.0
 - slate-plain-serializer@0.7.0
 - slate-prop-types@0.5.31
 - slate-react-placeholder@0.1.19
 - slate-react@0.21.23
 - slate@0.46.0
slate@0.46.0 slate-react@0.21.23 slate-react-placeholder@0.1.19 slate-prop-types@0.5.31 slate-plain-serializer@0.7.0 slate-hyperscript@0.12.0 slate-html-serializer@0.8.0 slate-base64-serializer@0.2.101
2019-05-01 19:54:33 -07:00
Ian Storm Taylor
3453de7bbb fix lint 2019-05-01 19:52:39 -07:00
Ian Storm Taylor
4af9a8b345 update changelogs 2019-05-01 19:49:51 -07:00
Ian Storm Taylor
a220cd5ae1 remove leaves (#2715)
* first stab at removing leaves with tests passing

* add deprecation warning for creating texts with leaves

* fixes

* update examples
2019-04-30 12:15:22 -07:00
Ian Storm Taylor
a431576e73 Publish
- slate-react@0.21.22
slate-react@0.21.22
2019-04-29 14:55:16 -07:00
Yonah Forst
31a4bf4fa9 Improve performance on large documents with many nodes (#2710)
* don't evaluate expensive debug payloads unless debugging is actually enabled

* fix for linter
2019-04-26 14:20:57 -07:00
Ian Storm Taylor
62ca870304 Publish
- slate-base64-serializer@0.2.100
 - slate-html-serializer@0.7.39
 - slate-hyperscript@0.11.30
 - slate-plain-serializer@0.6.39
 - slate-prop-types@0.5.30
 - slate-react-placeholder@0.1.18
 - slate-react@0.21.21
 - slate@0.45.1
slate@0.45.1 slate-react@0.21.21 slate-react-placeholder@0.1.18 slate-prop-types@0.5.30 slate-plain-serializer@0.6.39 slate-hyperscript@0.11.30 slate-html-serializer@0.7.39 slate-base64-serializer@0.2.100
2019-04-24 17:33:49 -07:00
Ian Storm Taylor
16850869d4 fix missing changelog entry 2019-04-24 17:28:36 -07:00
Sunny Hirai
662f584d4d Support decorations without path (#2697)
* Add support with warning for decorations without paths

* Fix linting

* Update text.js

* Update text.js
2019-04-24 17:27:50 -07:00
Stan Gurenkov
feaad7e7cd Fix selection being reset incorrectly after combination of events (#2686)
* Fix selection being reset incorrectly after combination of events

If mouseDown happens inside editor container and mouseUp outside it,
then programmatically calling editor.focus() after that will mess up
the selection

* Update after.js
2019-04-24 17:24:15 -07:00
robinrutten
7855783b2d removed ie/edge condition that causes "node of undefined" TypeError if editor is empty (#2689) 2019-04-24 17:24:01 -07:00
Arrizal Amin
8b27e7e184 fix get marks from previous text on method getMarksAtPosition (#2688) 2019-04-24 17:17:28 -07:00
Velten Heyn
4cb13ee5ca Add path to Range Points (#2537)
* Add path to Range Points

Otherwise 5d0f53da3f/packages/slate-react/src/components/text.js (L122) crashes

* Make prettier happy

* prettier knows what prettier knows

So shut up and delete the fucking whitespace ;)
2019-04-24 17:16:41 -07:00
fchenTelus
7cbf15e3cc insertBlock is missing description (#2682) 2019-04-24 17:09:15 -07:00
Jinxuan Zhu
ad15260993 Allow immutable 4.0.0-rc (#2695) 2019-04-24 16:56:16 -07:00
Sunny Hirai
94a41d791a Add value inspector to composition example (#2703)
* Add value inspector to composition example

* Add Android API Version to composition example
2019-04-24 10:32:04 -07:00
Sunny Hirai
02130902a1 Revert "Switched Map to fromJS in order to convert the whole js object (also nested data structures) to immutable (#2619)" (#2687)
This reverts commit b8c372df93.
2019-04-18 21:16:13 -07:00
Sunny Hirai
2a0bb47379 Fix syntax highlighting (#2698)
* Add support with warning for decorations without paths

* Fix linting

* Fix syntax highlighting crash in examples

* Fix order of imports

* Grab text.js from upstream instead of origin which was outdated
2019-04-18 15:10:10 -07:00
Ian Storm Taylor
b6a59c69a4 Publish
- slate-base64-serializer@0.2.99
 - slate-html-serializer@0.7.38
 - slate-hyperscript@0.11.29
 - slate-plain-serializer@0.6.38
 - slate-prop-types@0.5.29
 - slate-react-placeholder@0.1.17
 - slate-react@0.21.20
 - slate@0.45.0
slate@0.45.0 slate-react@0.21.20 slate-react-placeholder@0.1.17 slate-prop-types@0.5.29 slate-plain-serializer@0.6.38 slate-hyperscript@0.11.29 slate-html-serializer@0.7.38 slate-base64-serializer@0.2.99
2019-04-02 06:42:58 -07:00