1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-13 11:44:55 +01:00

1803 Commits

Author SHA1 Message Date
Conor Cussell
1e3cdafb59 Omit version on gzip size badge (#947)
I noticed that the file size badge didn't change when Cheerio was removed in 0.21.0. Because I stupidly pinned it to version 0.19.0 😳  - this will now always show the gzip size of the latest release
2017-07-25 09:51:32 -07:00
Ian Storm Taylor
3eebb71a9c update issue template and contributing docs 2017-07-20 10:30:40 -07:00
Ian Storm Taylor
6123985c4f add reboo editor to resources 2017-07-20 10:03:40 -07:00
Ian Storm Taylor
1a01c6f6d2 add showcase to resources 2017-07-20 10:01:59 -07:00
Ian Storm Taylor
f376911566 0.21.0 v0.21.0 2017-07-20 09:51:24 -07:00
Ian Storm Taylor
8003117c56 update changelog 2017-07-20 09:50:06 -07:00
Zach Schneider
4bbf7487ea Replace cheerio with parse5 (#934)
* Replace cheerio with parse5

* Convert to dependency injection for HTML parser
* Add options.domParser to HTML serializer
* Fallback to native DOMParser if present and no option provided
* Error if no DOM parser is available (option or native)
* Update tests to pass parse5 as config option

* Update test so it passes.
Cheerio interprets `<p><hr /></p>` as one `p` node with a child `hr`
node, but both parse5 and native DOMParser interpret it as 3 nodes: a
blank `p` node, `hr` node, and second blank `p` node. Update test
expectation to match new API.

* Remove cheerio-esque compatibility conversion.

* Use `application/xml` in native DOMParser
Using `text/html` causes it to wrap the fragment in html, body, etc

* Change error message to single line.
Was inserting an undesired newline char

* Add documentation for new `domParser` option to html serializer
Also boyscout missing documentation for `defaultBlockType` option

* Rename `domParser` option to `parseHtml`
Rename the option to make it clearer what it does, since it accepts a
function and not a `DOMParser` analogue object.
2017-07-20 09:46:02 -07:00
Ian Storm Taylor
cf85c6e3fb 0.20.7 v0.20.7 2017-07-20 09:41:28 -07:00
Ian Storm Taylor
55dcd70fad Rename History.md to Changelog.md 2017-07-19 08:31:13 -07:00
Conor Cussell
30f1a9ef1d Allow HTMLSerializer to deserialize an empty doc (#915)
* Allow HTML serializer to deserialize an empty document

This specially handles the case where the HTML is empty.

Test by running:
```
const html = new HTML()
html.deserialize('')
```

Closes #539

* Use defaultBlockType in HTML serializer

* Add test case for deserialising empty string

* Use fixtures
2017-07-18 18:44:10 -07:00
Ian Storm Taylor
a1d4de3b20 0.20.6 v0.20.6 2017-07-12 12:59:05 -07:00
Ian Storm Taylor
c2ff4122fd Merge branch 'master' of github.com:ianstormtaylor/slate 2017-07-12 12:58:00 -07:00
Shawn Erquhart
c0d82c0392 improve mark handling performance for large selections (#926) 2017-07-12 12:13:53 -07:00
Ian Storm Taylor
b5761a1410 0.20.5 v0.20.5 2017-07-12 08:56:20 -07:00
mjadobson
37ba8e9e6d Allow drop events on void nodes (#921)
* Allow drop events on void nodes

Text will be inserted in next non-void text node

* Fix linting errors

* Fixed formatting
2017-07-12 08:44:59 -07:00
mjadobson
31c75590ae Fix Edge Drag & Drop Issues (#923)
* Fix Edge doctype warning

* Remove getData() calls in onDragOver

Access to data within ondragover is prohibited

* Handle Edge errors accessing `dataTransfer.dropEffect`

* Work around Edge not supporting custom data in drag events

If unable to use `setData()` with custom type, then uses JSON obj to store data in 'text/plain'

* Fix more Edge errors

Edge sometimes throws 'NotSupportedError' whena accessing `items` property on `dataTransfer`

* Fix linting errors

* Fix formatting
2017-07-12 08:43:38 -07:00
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