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

1720 Commits

Author SHA1 Message Date
Ian Storm Taylor
f0e1965e4c Update Contributing.md 2017-08-15 10:36:10 -07:00
Ryan Yurkanin
ff57cd697f Allow Data to be passed to Marks when using HTML Deserializer (#986)
* making it possible to pass in data to marks on deserialize

* adding a test to make sure this doesn't happen again
2017-08-15 10:26:49 -07:00
Ian Storm Taylor
18f41e72ce 0.21.2 v0.21.2 2017-08-09 12:16:12 -07:00
Ian Storm Taylor
d7a82e81fa Merge branch 'cdd-master' 2017-08-09 12:11:50 -07:00
Ian Storm Taylor
207f459625 alphabetize package.json scripts 2017-08-09 12:08:35 -07:00
jacobbloomCDD
e0d993617d Speed up getting blocks at a range
Old implementation was far too slow if a selection included many nodes.
The performance hit occurred when converting each and every text node
into a block.  This is now avoided by using the same logic as
getTextsAtRangeAsArray for getBlocksAtRangeAsArray, but using blocks
directly.
2017-08-08 11:37:45 -07:00
Ryan Yurkanin
3eb72a8642 Remove instanceOf checks to allow Slate objects to be identifiable across module instances (#930)
* putting in the correct type pseudo-symbols

* getting the pseudo symbols everywhere that the instance of's are

* Making Ian's suggestions on checking types with static methods

* cleaning up leftover hard checks

* adding in slate proptypes, cleaning up unneeded whitespace

* updating documentation, moving keys to prototypes finally, al tests passing

* organizing types, prop-types, more succint type names

* eslint fix

* fixing model-types bug, changing proptype names
2017-08-02 10:49:09 -07:00
Hans-Wilhelm Warlo
469d8b394c Refactor render arrow functions (#969) 2017-08-02 09:36:33 -07:00
Ian Storm Taylor
f89f0f875c update prosemirror description in readme 2017-08-02 09:27:22 -07:00
Ian Storm Taylor
5d25699e5a update prosemirror description in docs 2017-08-02 09:25:32 -07:00
Ian Storm Taylor
c59ca5628e update prosemirror comparison in readme 2017-08-02 09:24:39 -07:00
Ian Storm Taylor
85fce2dd46 0.21.1 v0.21.1 2017-08-01 09:47:28 -07:00
Phil Mahlero
6a2de0ac4d Fix for HTML pasting not working in IE (#882)
* imported babel-polyfill to make examples run in IE

* Fix for HTML pasting not working in IE

* Revert "imported babel-polyfill to make examples run in IE"

This reverts commit a8405075d6a44de8cae8092e3773829b56dadd93.

* Refactored and corrected comments of fix: HTML pasting not working in IE

* Removed handleData and tuned getTransferData call of fix: HTML pasting not working in IE
2017-08-01 09:09:12 -07:00
Zach Schneider
78bb1508ac Remove unneeded check. (#961)
Even if the el.tagName is a span, it will fall through to the child
text node so the check is unneeded.
2017-08-01 09:06:55 -07:00
Zach Schneider
56fa2c4208 Upgrade react-frame-component. (#962)
Gets rid of warning in dev about directly accessing `React.PropTypes`
2017-08-01 09:06:39 -07:00
Ryan Yurkanin
af84cf2511 adding forced-layout-example (#954) 2017-07-31 18:19:45 -07:00
Zach Schneider
f8b103d75e Reckon with inconsistencies between parse5 and native DOMParser (#952) 2017-07-31 18:18:30 -07:00
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