1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-01 13:00:16 +02:00
Commit Graph

2963 Commits

Author SHA1 Message Date
themithy
9e2e2a1cc5 Fix bugs in getRelativeRange. (#2872) 2019-07-03 13:03:26 -07:00
Jorge Valdez
a0b2aa3d4f replaced renderNode and renderMark documentations in slate-react with 0.22.0 changes (#2898) 2019-07-03 12:56:54 -07:00
Matthew Herbst
5222515c0c Improve mentions example by including scroll calculation (#2883) 2019-07-03 12:53:44 -07:00
Sunny Hirai
7d4062cde9 Add Android 8 and 9 compatibility using Mutations (#2853)
* Add debug-mutations

* Fix linting

* Add debug-mutations to o core plugins

* Fix debug output

* Add comment about debug statement

* Add comment explaining the building of debug output object

* Add framework for mutations and mutation observer

* Working splitBlock and mergeBlock

* many things working but not autocorrect

* All later tests pass

* Before adding isComposing to composition-manager

* Fixit

* fix enter enter backspace backspace

* Pass all tests except space-back-space-back

* Passes all tests I think but doesn't continuous backspace or select delete

* Passes all tests and delete selection work

* Fix for merge

* Passes all tests including typing hello world on new line and enter

* Before switching to a function

* Fix enter after last char

* Fix it wasn't me. no. bug

* Remove timeout delay on compositionEnd and everthing works except it wasnt me. no.

* Passes all tests but need to add tests for delete all and select delete

* Pass all tests

* Fix  remove selection

* Added flush onCompositionEnd just in case

* Fix bugs for Android 8 split join and fix side effects on Android 9 to that fix

* Add comments to composition manager

* Clean up code

* Fix bug with delete range

* Add comments

* Fix focus lost bug on change examples

* Improve comments

* Rename clear to clearAction and a comment

* Rename lastEl to last.rootEl

* Remove isListening

* Rename vars

* Fix bug where changing to new example during a composition messes up update

* Add comment to switching examples in composition fix

* Improve comments

* Refactor

* Refactor removeNode

* Remove unused event callbacks

* Refactor connect

* Cleanup mutation plugin

* Remove unnecessary comments

* Remove readme

* Refactor ReactPlugin

* Refactor plugins and injection locations

* Remove dom-observer

* Remove is-input-data helpers

* Move fixSelectionInZeroWidthBlock

* Fix some linting and also a composition manager bug

* Fix linting and remove placeholder on Android

* Refactor

* Update composition-manager description

* Fix comment on composition manager

Co-Authored-By: Nick Anderson <tetramputechture@gmail.com>
2019-06-12 16:14:00 -07:00
Nadeem Shaik
5471343ae8 Fixed mentions example (#2877) 2019-06-12 11:07:35 -07:00
Ian Storm Taylor
67e397100e Publish
- slate-base64-serializer@0.2.107
 - slate-html-serializer@0.8.6
 - slate-hyperscript@0.13.4
 - slate-plain-serializer@0.7.6
 - slate-prop-types@0.5.37
 - slate-react-placeholder@0.2.4
 - slate-react@0.22.4
 - slate@0.47.4
slate@0.47.4 slate-react@0.22.4 slate-react-placeholder@0.2.4 slate-prop-types@0.5.37 slate-plain-serializer@0.7.6 slate-hyperscript@0.13.4 slate-html-serializer@0.8.6 slate-base64-serializer@0.2.107
2019-06-07 11:11:42 -07:00
Victor Pontis
cfa693411a Fix typo on Data Model docs page (#2849) 2019-06-07 18:57:36 +01:00
Justin Weiss
af8a0baafe Fix several errors in the deprecated getEventRange (#2847)
This version of the method has drifted from `editor.findEventRange`,
and now crashes when it's being used. This commit fixes an import and
changes some code to match the new code in `editor.findEventRange`.
2019-06-07 18:57:08 +01:00
Daniil Khanin
5f26890ff9 Update applying-custom-formatting.md (#2843) 2019-06-07 18:56:36 +01:00
Guillaume Racicot
52027ff270 Corrected placeholder alignement on chrome (#2836) 2019-06-07 18:54:19 +01:00
Ken Powers
e4c6beaab4 Remove leaves from walkthough docs (#2831) 2019-06-07 18:53:33 +01:00
Sunny Hirai
f15538d6a5 Normalize target node in debug mutations (#2845)
* Normalize target node in debug mutations

* Added comments and fixed linting
2019-05-30 16:07:04 -07:00
Sunny Hirai
d2f9b4167c Improve debug mutations plugin (#2844) 2019-05-29 18:03:42 -07:00
Sunny Hirai
78264cf117 Hook debug-mutations into lifecycle events (#2841) 2019-05-28 18:10:50 -07:00
Sunny Hirai
2265240c04 Removed pseudo-event object from lifecycle events (#2840) 2019-05-28 17:48:40 -07:00
Sunny Hirai
78a795b40e Add remove composition example (#2838)
* Add remove composition example

* Changed wording a little
2019-05-28 16:42:00 -07:00
Sunny Hirai
d0144b46a7 Add empty composition example (#2835)
* Add empty composition example

* Fix linting
2019-05-27 18:56:51 -07:00
Sunny Hirai
2634c58e32 Add render event for plugins (#2834) 2019-05-27 18:34:00 -07:00
Sunny Hirai
2ec21e7fc4 Add 3 lifecycle event handlers (#2833) 2019-05-27 15:04:59 -07:00
Sunny Hirai
80212943cc Fix Hot Module Reload for plugins (#2825)
* Fix HMR for plugins

* Use TheReactPlugin in resolveController argument inside method
2019-05-22 18:57:29 -07:00
Sunny Hirai
96cb419ccb Second attempt at Debug Mutations (#2823)
* Add debug-mutations

* Fix linting

* Add debug-mutations to o core plugins

* Fix debug output

* Add comment about debug statement

* Add comment explaining the building of debug output object
2019-05-22 18:21:20 -07:00
Sunny Hirai
8311767108 Add noop plugin as detached plugin (#2824) 2019-05-22 17:57:58 -07:00
Sunny Hirai
b73632d42f Add editor to plugin options (#2821) 2019-05-22 12:07:24 -07:00
Sunny Hirai
accba53f56 Add div to editor as editor.el (#2820) 2019-05-22 11:26:11 -07:00
adjourn
d7b37a8dca Fix placeholder not rendering (#2819) 2019-05-22 11:23:32 -07:00
Ian Storm Taylor
1639e8da49 Revert "Add noop plugin (#2814)" (#2817)
This reverts commit b71fdbbb3d.
2019-05-21 23:22:38 -07:00
Ian Storm Taylor
0837db7ce0 Revert "Debug mutations (#2815)" (#2816)
This reverts commit 5948738092.
2019-05-21 23:21:50 -07:00
Sunny Hirai
5948738092 Debug mutations (#2815)
* Add noop plugin

* Add debug mutations
2019-05-21 17:34:22 -07:00
Sunny Hirai
b71fdbbb3d Add noop plugin (#2814) 2019-05-21 17:24:00 -07:00
Sunny Hirai
18ae15f440 Remove restore dom examples (#2811) 2019-05-21 14:27:22 -07:00
Ian Storm Taylor
fd31269c29 Publish
- slate-base64-serializer@0.2.106
 - slate-html-serializer@0.8.5
 - slate-hyperscript@0.13.3
 - slate-plain-serializer@0.7.5
 - slate-prop-types@0.5.36
 - slate-react-placeholder@0.2.3
 - slate-react@0.22.3
 - slate@0.47.3
slate@0.47.3 slate-react@0.22.3 slate-react-placeholder@0.2.3 slate-prop-types@0.5.36 slate-plain-serializer@0.7.5 slate-hyperscript@0.13.3 slate-html-serializer@0.8.5 slate-base64-serializer@0.2.106
2019-05-21 13:26:57 -07:00
Ian Storm Taylor
d2bd71b3d9 Merge branch 'master' of github.com:ianstormtaylor/slate 2019-05-21 13:24:02 -07:00
Cary Dunn
3c013c567a fallback findPath query to find closest element with a data-key (#2794)
* fallback findPath query to find closest element with a data-key

* lint

* move example to findEventRange query

* lint
2019-05-20 14:41:40 -07:00
adjourn
4eff9b5a06 Fix leaf memoization bug (#2766)
* Fix leaf memoization bug

* Update leaf.js
2019-05-20 14:37:31 -07:00
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