1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-03-11 16:59:43 +01:00

1737 Commits

Author SHA1 Message Date
AlbertHilb
17cfde67ce Add data field to editor State. (#830)
* Add `data` field to editor `State`.
Plugins can use it to store their own internal state.

* Remove `serialize` and `deserialize` plugin methods.

* Add operation to set `data` on a state.

* Add `setDataOperation` tests.

* Remove the possibility to use keys different from strings.
Add `preserveData` option to `raw.serialize`.
Rewrite `set-data` test exploiting the new option.
2017-07-11 13:41:13 -07:00
Samy Pessé
74bf684ec9 Add property "isEmpty" (#863)
* Add property isEmpty to State

* Update hovering menu example

* Document isEmpty

* Improve perf of isEmpty with @Soreine 's suggestion

* Fix return of isEmpty
2017-07-11 13:34:02 -07:00
Nicolas Gaborit
4e01f80b1b Ignore Void nodes onClick in read-only (#908)
* Ignore Void nodes onClick in read-only

* Sort prop types alphabetically
2017-07-11 13:29:29 -07:00
Samy Pessé
0746582cc4 Fix dragging text in the editor (#884)
* Fix dragging text in the editor

* Only use transfer type "node" when dragging a void node

* Move onDropNode to core plugin
2017-07-11 13:28:45 -07:00
mjadobson
e81f4e24e9 Fix image drop in example (#919)
* Fix image drop in example

Dropped images were being inserted at previous selection rather than drop target.

* Fix linting errors
2017-07-11 13:14:39 -07:00
Shawn Erquhart
ccb7a23ba3 enable source maps during development (#916) 2017-07-11 13:10:52 -07:00
Eamon Taaffe
e66adf1295 Issue with the Overriding Defaults example. (#914)
I tried using the exact code from the example to be met by errors.

The order of arguments in the function example is wrong, it should be use the API described in the [docs](https://docs.slatejs.org/reference/plugins/plugin.html#onbeforeinput).

```
Function onBeforeInput(event: Event, data: Object, state: State, editor: Editor) => State || Void
```
2017-07-11 13:08:50 -07:00
Michael McCombie
91619616ac Fix "Auto-Markdown" Doc Link (#906)
Fixes the auto markdown preview link in the list of examples
2017-07-11 13:01:38 -07:00
Joshua Li
17b1a455cc Update README.md (#905)
Fixed some doc links.
2017-07-11 12:49:26 -07:00
Ian Storm Taylor
5d8a9b99cc 0.20.4 v0.20.4 2017-06-22 09:11:22 -07:00
Conor Cussell
a3a7949fc4 Add example of using plugin.render to /examples/plugins (#890) 2017-06-21 17:32:32 -04:00
Dylan Phelan
c7f14e1254 Updated findDOMNode function (#892)
Newer implementations of findDOMNode take the node to find as the argument, not the key of the node
2017-06-21 17:31:12 -04:00
AlbertHilb
b6fc16593e Don't mutate path array, use instead a copy. (#894) 2017-06-21 17:29:51 -04:00
Ian Storm Taylor
13160a97b8 0.20.3 v0.20.3 2017-06-10 10:56:50 -07:00
AlbertHilb
56e568d063 When the parameter passed to isInEditor is a text node use its parent instead (#857)
* When the parameter passed to `isInEditor` is a text node use its parent
for the check.

* Don't reuse `target` parameter. Add details to the comment.
2017-06-10 13:47:00 -04:00
pa-nam
b967cf7c79 Clear scroll timer when component unmount (#867) 2017-06-10 13:41:27 -04:00
Samy Pessé
57da8da4b4 Fix selection after transform.wrapInline (#872)
* Add failing test for wrapInline

* Adapt tests for wrap-twice and whole-block

* Adapt transform to move selection correctly

* Fix lint errors

* Use keys in yaml
2017-06-10 13:34:57 -04:00
Samy Pessé
54d204b87e Move condition about onBeforeChange (#878) 2017-06-10 13:33:23 -04:00
Ian Storm Taylor
b4883ea552 0.20.2 v0.20.2 2017-05-30 13:17:47 -07:00
Leon Koole
b6541854fa Fix missing isAltKey (#855) 2017-05-30 13:15:11 -07:00
pa-nam
890d790d42 Wrap scrolling logic in setTimeout (#847)
The native selection will be updated after componentDidMount or componentDidUpdate.
Use setTimeout to queue scrolling to the last when the native selection has been updated to the correct value.
2017-05-30 13:13:21 -07:00
Kelly Joseph Price
53542cb55b Ignore comments in Html deserializer (#856) 2017-05-30 13:08:51 -07:00
Anuj
c26f2dc71b Documenting node's getFurther* functions (#845)
I remembered coming across these functions and then didn't find them in the docs. So, here they are now!
2017-05-30 12:07:24 -07:00
Mike Hearn
4013d0b18a Minor update to Saving to Database doc (#831) 2017-05-23 18:36:13 -07:00
Asaf Katz
06c54bd991 Docs improvements suggestions (#801)
* Fix typo

* Make it clearer that addMark has changed too
2017-05-21 10:36:23 -07:00
Alex Zajac
da1210da0f Local examples url update (#822)
* Update url when testing locally

When attempting to mess around locally I could never get anything to update. Sure enough I was looking in the wrong place and had missed the `/dev.html` on the end of my url.

Here's to hoping no one else struggles with this again.

* Update Readme.md
2017-05-20 10:58:10 -07:00
Ian Storm Taylor
579e12e2cb 0.20.1 v0.20.1 2017-05-17 10:24:00 -07:00
Ian Storm Taylor
ac07cfd510 fix html serializer to not deserialize children when null 2017-05-17 10:21:43 -07:00
Ian Storm Taylor
190071c758 0.20.0 v0.20.0 2017-05-17 09:16:07 -07:00
Ian Storm Taylor
c260725e65 add support for skipping elements in html serializer, closes #821 2017-05-17 09:14:33 -07:00
Ian Storm Taylor
e363f88b71 0.19.30 v0.19.30 2017-05-09 22:30:06 -07:00
Ian Storm Taylor
77277cccef Merge branch 'master' of github.com:ianstormtaylor/slate 2017-05-09 22:28:43 -07:00
Ian Storm Taylor
12bbb630e1 fix *ByTypeAsArray node methods to always return arrays 2017-05-09 22:28:39 -07:00
Dae-Ho Kim
873f1b1124 Fix json (#798)
Remove comma
2017-05-06 09:19:27 -07:00
Ian Storm Taylor
cb03f02d68 update readme 2017-05-05 18:41:21 -07:00
Ian Storm Taylor
0a9ef10664 0.19.29 v0.19.29 2017-05-05 17:46:38 -07:00
Ian Storm Taylor
7a5dfe6fda allow memoization without arguments for faster lookups (#796) 2017-05-05 17:44:53 -07:00
Ian Storm Taylor
c7cc980732 0.19.28 v0.19.28 2017-05-05 11:53:07 -07:00
Max Stoiber
142ba2ba18 Add tests for plugins (#792)
* Add tests for plugins

The first test fails because the rules property of plugins doesn't work
as expected.

* Fix plugins tes
2017-05-05 11:46:44 -07:00
Ian Storm Taylor
d7fa54a631 improve perf delaying conversion to immutable objects (#794) 2017-05-05 11:45:19 -07:00
Ian Storm Taylor
3889c379d9 0.19.27 v0.19.27 2017-05-05 09:02:50 -07:00
Ian Storm Taylor
a17d707665 fix schema normalizing to merge into history 2017-05-05 09:01:15 -07:00
Ian Storm Taylor
5bde3b3ecd 0.19.26 v0.19.26 2017-05-04 17:17:10 -07:00
AlbertHilb
e396941963 moveNode operation fix (#782)
* Fix `moveNode` operation.
When `parent` is an ancestor of `target` and the index of `node` is
less than the index of the ancestor of `target` with the same depth
of `node`, removing `node` changes the path to `target`.
As consequence of that, `newPath` needs to be adjusted.

* Add test.

* Improve code.
2017-05-04 17:14:24 -07:00
Ian Storm Taylor
526d162002 fix large document example imports 2017-05-04 17:14:09 -07:00
Ian Storm Taylor
13a99a9b73 refactor examples, upgrade dependencies 2017-05-04 16:48:42 -07:00
Ian Storm Taylor
a3f7f9bd02 v0.19.25 v0.19.25 2017-05-04 15:57:03 -07:00
Ian Storm Taylor
8208633091 fix void copying to attach to the right dom element 2017-05-04 15:55:24 -07:00
Ian Storm Taylor
75c76a6dea 0.19.24 v0.19.24 2017-05-04 15:30:58 -07:00
Ian Storm Taylor
c9644a5a53 0.19.23 v0.19.23 2017-05-04 15:14:17 -07:00