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

2191 Commits

Author SHA1 Message Date
Justin Weiss
dce7e2c439 Allow null return values, which will skip serializing that node (#1699)
Sometimes, I have nodes that only make sense temporarily, so it
doesn't make sense to serialize them. Following the pattern in React,
explicitly returning `null` from a serialzation rule should result in
that node (and its children) not making it into the serialized document.
2018-03-22 14:54:35 -07:00
Ian Storm Taylor
86af03dd30 Publish
- slate-base64-serializer@0.2.28
 - slate-html-serializer@0.5.9
 - slate-hyperscript@0.5.9
 - slate-plain-serializer@0.5.9
 - slate-prop-types@0.4.26
 - slate-react@0.12.3
 - slate-schema-violations@0.1.7
 - slate-simulator@0.4.26
 - slate@0.33.3
slate@0.33.3 slate-simulator@0.4.26 slate-schema-violations@0.1.7 slate-react@0.12.3 slate-prop-types@0.4.26 slate-plain-serializer@0.5.9 slate-hyperscript@0.5.9 slate-html-serializer@0.5.9 slate-base64-serializer@0.2.28
2018-03-22 14:51:41 -07:00
Ben Southgate
804ea5d4d0 fix: ensure that offset is positive in findDomRange (#1719) 2018-03-22 14:48:09 -07:00
Stan Chang Khin Boon
bff3d34a2d Don't stop propagation of drop event (#1716)
Summary:

We mirrored the fix in PR #1278 (meant for #1277) but for drop event.
This fixed an issue I faced with Slate swallowing drop event, kind of breaking compatibility with react-dnd.

/cc @AlbertHilb
2018-03-22 14:22:57 -07:00
urugator
3fe60f3795 Fix node.isEmpty (#1718)
* add test for normalization of nested empty inlines

* fix normalization of nested empty inlines

* add test for normalization of inlines with empty void

* fix normalization of inlines containing empty void

* fix linting errors

* Fix node.isEmpty to work properly with void nodes of zero text length

* Take adavantage of fixed node.isEmpty to simplify normalization of empty inlines

* Fix linting errors
2018-03-22 14:22:03 -07:00
Gabin Aureche
29901f0888 Add missing documentation for rule.marks (#1717) 2018-03-22 14:17:00 -07:00
Ian Storm Taylor
b17bf1a7b9 Publish
- slate-base64-serializer@0.2.27
 - slate-html-serializer@0.5.8
 - slate-hyperscript@0.5.8
 - slate-plain-serializer@0.5.8
 - slate-prop-types@0.4.25
 - slate-react@0.12.2
 - slate-schema-violations@0.1.6
 - slate-simulator@0.4.25
 - slate@0.33.2
slate@0.33.2 slate-simulator@0.4.25 slate-schema-violations@0.1.6 slate-react@0.12.2 slate-prop-types@0.4.25 slate-plain-serializer@0.5.8 slate-hyperscript@0.5.8 slate-html-serializer@0.5.8 slate-base64-serializer@0.2.27
2018-03-21 16:58:48 -07:00
Ian Storm Taylor
36c7f4fc32 fix peerDependencies in slate packages, closes #1690 2018-03-21 16:56:20 -07:00
Ian Storm Taylor
0587a5f916 Publish
- slate-base64-serializer@0.2.26
 - slate-html-serializer@0.5.7
 - slate-hyperscript@0.5.7
 - slate-plain-serializer@0.5.7
 - slate-prop-types@0.4.24
 - slate-react@0.12.1
 - slate-schema-violations@0.1.5
 - slate-simulator@0.4.24
 - slate@0.33.1
slate@0.33.1 slate-simulator@0.4.24 slate-schema-violations@0.1.5 slate-react@0.12.1 slate-prop-types@0.4.24 slate-plain-serializer@0.5.7 slate-hyperscript@0.5.7 slate-html-serializer@0.5.7 slate-base64-serializer@0.2.26
2018-03-21 16:38:29 -07:00
Ian Storm Taylor
b65b47a50e update lock 2018-03-21 16:37:46 -07:00
Jinxuan Zhu
c569569729 Perhaps faster normalization: Never visit a descendant twice in normalizaton (#1661)
* Perhaps faster normalization: Never visit a descendant twice in normalizaton

* Change getFirstInvalidaDescendantKey to getFirstInvalidaDescendant

* Add from-JSON-big in benchmark

* Better annotation

* Remove un-used test change
2018-03-21 15:36:25 -07:00
Francesco Agnoletto
6ad3aada5b Make serialize/deserialize friendlier (#1705) 2018-03-21 15:34:20 -07:00
Jinxuan Zhu
ecc165740d Fix skip this in getFurtherstLonelyAncestor (#1628)
* Fix skip this in getFurtherstLonelyAncestor

* export runTest in models/

* Change the path of test getOnlyChildAncestor

* Update index.js

* Update get-furthest-only-child.js

* Fix for linting
2018-03-21 15:26:56 -07:00
徐凯
09b15adb96 fix applying-custom-formatting.md demo (#1715) 2018-03-21 14:09:51 -07:00
vilicvane
44d8021921 Fix #474 (#1700)
e0978a31e9 (commitcomment-28060594)
2018-03-21 14:09:04 -07:00
urugator
edb7c3bd3c Fix normalize empty inline (#1698)
* add test for normalization of nested empty inlines

* fix normalization of nested empty inlines

* add test for normalization of inlines with empty void

* fix normalization of inlines containing empty void

* fix linting errors
2018-03-21 14:08:15 -07:00
vilicvane
7cf6e1d5a8 Handle readOnly inside contentEditable check list (#1689) 2018-03-21 13:48:49 -07:00
Philip Proplesch
35f101c80f Update Readme.md (#1687) 2018-03-21 13:16:30 -07:00
dmitrizzle
67afc010c3 Added another editor package built on top of Slate (#1707) 2018-03-21 13:15:55 -07:00
nschlehe
8689c671f6 Add key prop to <br /> elements in html-serializer (#1704) 2018-03-21 13:15:29 -07:00
Andrew Fleming
6678245fba Fix broken link in schema.md (#1684)
Correct broken link to `slate-schema-violations`
2018-03-03 19:01:40 -05:00
Andrew Fleming
7238c6a82e Improve grammar in schemas.md (#1685)
Grammar correction
2018-03-03 18:59:14 -05:00
Andrew Fleming
91101465fa Update data-model.md (#1682)
Typo corrected
2018-03-03 18:58:30 -05:00
Jinxuan Zhu
0688a193a2 Add quotes to fix typo (#1683) 2018-03-03 18:57:23 -05:00
Zach Schneider
2bf04b4a8c Use source-map-loader for more fine-grained sourcemaps. (#1666) 2018-02-21 19:35:27 -08:00
Ian Storm Taylor
0935f20c11 update webpack config 2018-02-21 18:35:27 -08:00
Ian Storm Taylor
257580052d Publish
- slate-base64-serializer@0.2.25
 - slate-html-serializer@0.5.6
 - slate-hyperscript@0.5.6
 - slate-plain-serializer@0.5.6
 - slate-prop-types@0.4.23
 - slate-react@0.12.0
 - slate-schema-violations@0.1.4
 - slate-simulator@0.4.23
 - slate@0.33.0
slate@0.33.0 slate-simulator@0.4.23 slate-schema-violations@0.1.4 slate-react@0.12.0 slate-prop-types@0.4.23 slate-plain-serializer@0.5.6 slate-hyperscript@0.5.6 slate-html-serializer@0.5.6 slate-base64-serializer@0.2.25
2018-02-21 18:12:43 -08:00
Ian Storm Taylor
2e2ab66b60 update changelogs 2018-02-21 18:11:54 -08:00
Ian Storm Taylor
38020c73a6 fix deprecated kind usage in leaf components 2018-02-21 18:05:54 -08:00
Ian Storm Taylor
514f3de1be
remove the void text content restriction, closes #1504 (#1663) 2018-02-21 18:03:41 -08:00
Zach Schneider
c5f0626a05 Convert setBlock and setInline to plurals for more intuitive naming. (#1558) 2018-02-21 18:03:30 -08:00
Ian Storm Taylor
e6638f7822 update webpack building 2018-02-21 18:03:17 -08:00
Ian Storm Taylor
35f96c27d4 Publish
- slate-react@0.11.6
slate-react@0.11.6
2018-02-21 17:54:46 -08:00
Ian Storm Taylor
c6f5aa2487 update prettierignore 2018-02-21 17:50:52 -08:00
Ian Storm Taylor
bc524bd43a update webpack and rollup configs 2018-02-21 17:48:08 -08:00
Zach Schneider
1fbf999c41 Add back babel-cli as a development dependency. (#1665) 2018-02-21 17:44:13 -08:00
Zach Schneider
2ebf3b462b Set up webpack configuration for building examples (#1642)
* Set up webpack configuration for building examples

* Configure react-hot-loader in development

* Improve config, set gh-pages to use examples/dist directory

* PR feedback

* Rename App.js in git
2018-02-21 17:19:56 -08:00
Tom Moor
670ef391a8 Account for text being null in an onDrop event (#1647) 2018-02-21 16:54:28 -08:00
Ian Storm Taylor
fba5bc73e4 Publish
- slate-base64-serializer@0.2.24
 - slate-html-serializer@0.5.5
 - slate-hyperscript@0.5.5
 - slate-plain-serializer@0.5.5
 - slate-prop-types@0.4.22
 - slate-react@0.11.5
 - slate-schema-violations@0.1.3
 - slate-simulator@0.4.22
 - slate@0.32.5
slate@0.32.5 slate-simulator@0.4.22 slate-schema-violations@0.1.3 slate-react@0.11.5 slate-prop-types@0.4.22 slate-plain-serializer@0.5.5 slate-hyperscript@0.5.5 slate-html-serializer@0.5.5 slate-base64-serializer@0.2.24
2018-02-21 15:07:33 -08:00
Tomasz Sodzawiczny
8ab88871bc Use pageXOffset instead of scrollX (#1631)
`scrollX`/`scrollY` do not work on some browsers, using `pageXOffset`/`pageYOffset` instead: https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX#Notes
2018-02-21 12:47:40 -08:00
Conor Cussell
a43c3fbb61 Update plugins used in plugins example (#1637) 2018-02-21 12:40:55 -08:00
Irwan Fario Subastian
1269be7ba8 Fix marks of undefined on char.marks (#1643)
* fix typo on getMarksAtCollapsedRangeAsArray

* making sure that char is defined on char.marks
2018-02-21 12:40:02 -08:00
Blake Embrey
07788eb2d9 Replace zero width blocks with newline before copy (#1644)
* Replace zero width blocks with newline before copy

* Fix linting issue

* Fixing linting again, sorry Github
2018-02-21 12:38:56 -08:00
Jinxuan Zhu
1776d8e64c Fixing the bug that getMarks steals mark from the previous block (#1645) 2018-02-21 12:36:34 -08:00
Julien Poissonnier
324a025ee9 Remove redundant memoization (#1630)
* Remove memoization from node.getKeys

* Remove memoization from methods that are directly backed by AsArray variants

* Remove memoization from hasChild/Descendant/Node

These are thin wrappers on top of functions that are themselves
memoized.
2018-02-21 12:32:29 -08:00
Julien Poissonnier
e3abba0a29 Fix drag and dropping a node "forward" in the document (#1621)
When drag and dropping a node to a position earlier in the document,
the node is inserted and then removed right after.
Regenerate the key to make sure the old node is removed instead of the
new one.
2018-02-12 14:36:51 -08:00
Andrei Railean
a17ea2cc21 update example readme with dev server info (#1620)
* update example readme with dev server info

* Update Readme.md
2018-02-08 17:17:25 -08:00
Jinxuan Zhu
f7546d3c7c Fix getInsertMarksAtRangeAsArray for empty Text Node (#1614) 2018-02-08 17:13:05 -08:00
Francesco Agnoletto
5cec47541d Fix triple selection extending to next block (#1605)
* Fix triple selection extending to next block

* Remove unused startOffset

* Add Iscollapsed check to prevent failing setBlock on initial block position

* Fix across-blocks.js test

* Test new hanging selection behaviour

* Lint

* Revert e902fa1acbbcec94a82474b5fea86923c8f2c5ad

* Lint

* Use ternary operator instead of if/else
2018-02-08 17:10:46 -08:00
Andrei Railean
0c7703e206 add ability to click multiple emojis in example (#1619)
* add ability to click multiple emojis

currently, after clicking one emoji, user needs to click in the editor before being able to add another emoji
this fixes that by jumping to next text block and focusing selection to make it obvious where next insertion will take place.

* lint code
2018-02-08 17:09:06 -08:00