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

2219 Commits

Author SHA1 Message Date
Jinxuan Zhu
6e6e9cf710 Fix spell check bug (#1753)
* Fix spell check bug by add data-text:true

* Fix spell check bug by spell check add length to a leaf

* Fix tests to use data-text:true for marks

* Rename data-text to data-slate-leaf; Remove setRef; unlift attributes in leaf

* Update examples with data-*

* Add attributes to document

* Fix renderMark in all documents

* Prettier markdown
2018-04-27 14:06:24 -07:00
Jinxuan Zhu
9b39a89f20 Hanging Selection paste in insertFragmentAtRange (#1742) 2018-04-27 14:02:56 -07:00
Nima Mehanian
2dd77c00f1 Update adding-event-handlers.md (#1751)
* Update adding-event-handlers.md

Make clarifying changes to sentence structure and code sample syntax

* Revert to React.Component declaration

* Update adding-event-handlers.md
2018-04-27 14:01:17 -07:00
Gergely Illés
da89f58c4c remove extra force re-renders on onCompositionStart/End (#1711) 2018-04-27 13:57:09 -07:00
Benjy Cui
fb172dec6f fix: make void node selectable for edge case, close: #1639 (#1734) 2018-04-27 13:42:53 -07:00
Nicolas Gaborit
42ff90e9cd Remove unused dependencies (#1796)
* Remove unused slate-sugar

* Remove unused dependencies
2018-04-27 13:27:25 -07:00
Benjy Cui
404862c579 refactor: remove useless .indexOf to improve perf (#1783) 2018-04-27 13:26:43 -07:00
Gabin Aureche
d6245fbadf Fix replaceNodeByKey failing to normalize node's parent (#1791) 2018-04-27 13:24:29 -07:00
Nicolas Gaborit
9e50bc6b1f Pass options to fromJSON from Value.create (#1787)
I guess this was an omission, or the arguments were not updated since a long time
2018-04-27 13:23:15 -07:00
pferdone
4712e64c30 Removed early return in onDragOver (#1772) 2018-04-27 13:20:51 -07:00
Justin Weiss
d4c630c05a Extract hotkey and environment detection into separate packages (#1760)
* Extract hotkey and environment detection into separate packages

Overriding default behavior in plugins can be hard, because you have
to match all of the keybindings that Slate uses. By exporting hotkeys
as its own package, both core Slate plugins and custom plugins can use
the same key detection logic.

* Rename Hotkeys.* to Hotkeys.is*
2018-04-27 13:19:39 -07:00
Jinxuan Zhu
1cd1bcb3e2 Feature: setTextByKey and replaceTextByKey (#1745)
* basic functions

* basic tests

* First Complish: tests and functions for setTextByKey and replaceTextByKey
2018-04-27 13:18:37 -07:00
Nicolas Gaborit
099c6ada72 slate-hyperscript: Fix extra empty text at the end of children (#1379)
* Add failing test

* Don't push extra text node at the end of children

* Fix keys in tests

* Add option `normalize` to <value>

* Write Changelog

* Changelog on correct  package

* Fix preserve keys test

* Fix tests (which make more sense now)

* Mark failing test as skipped

* Account for skip option

* Lint and fix changelog version

* Use Unreleased instead of version

* Lint markdown
2018-04-27 13:16:11 -07:00
DamareYoh
a943eada85 added documentation for wrapNodeByKey (#1774)
* added documentation for wrapNodeByKey

* remove extraneous newline

* fixed weird typo!
2018-04-15 17:40:55 +01:00
Mitchel Humpherys
30143adf60 docs: walkthroughs: saving: Fix grammar (#1766)
Should be possessive (you're => your)
2018-04-10 14:59:21 +01:00
Mateo Ochoa
0a2d68a97f Update faq.md (#1750) 2018-04-03 11:31:20 +01:00
Ian Storm Taylor
fb8075a233 Publish
- slate-base64-serializer@0.2.29
 - slate-html-serializer@0.6.1
 - slate-hyperscript@0.5.10
 - slate-plain-serializer@0.5.10
 - slate-prop-types@0.4.27
 - slate-react@0.12.4
 - slate-schema-violations@0.1.8
 - slate-simulator@0.4.27
 - slate@0.33.4
slate@0.33.4 slate-simulator@0.4.27 slate-schema-violations@0.1.8 slate-react@0.12.4 slate-prop-types@0.4.27 slate-plain-serializer@0.5.10 slate-hyperscript@0.5.10 slate-html-serializer@0.6.1 slate-base64-serializer@0.2.29
2018-03-28 09:50:20 -07:00
Nikolay Kazakov
d2eb362234 Fixed syntax mismatch at normalize method (#1737)
`switch` operator was wrapped around `case` statements
2018-03-28 09:15:12 -07:00
Benjy Cui
950c5a92e1 fix: add missing hotkey for delete line backward, close: #1617 (#1735) 2018-03-28 11:12:41 +02:00
Benjy Cui
15f96fcfce fix: add missing hotkey for delete word backward, close: #1709 (#1729) 2018-03-27 23:17:36 -07:00
Benjy Cui
a325696339 fix: Editor[autoFocus] should work, close: #1669 (#1733) 2018-03-27 23:15:51 -07:00
David Hrdlicka
4346ad0e3f Fix cloneFragment to work with multiple Editor instances (#1728) 2018-03-26 17:52:03 -07:00
Gabin Aureche
25aa1ec952 Make cache management available in non-dev environment (#1721) 2018-03-26 09:56:20 -07:00
Lars Karbo
c071df36ea add js to markdown ``` code syntax (#1727) 2018-03-26 07:08:28 -07:00
Jinxuan Zhu
28220e7007 Fix normalize range of the insertTextAtRange (#1659) 2018-03-23 10:53:54 -07:00
Jinxuan Zhu
4422f8afca Improve memorize interface (#1713)
* Remove takesArguments

* Remove codes of restoring func.length

* Alphabeta fix

* Remove un-necessary code

* Remove un-necessary annotation
2018-03-23 10:53:02 -07:00
Ian Storm Taylor
8478c0291b Publish
- slate-html-serializer@0.6.0
slate-html-serializer@0.6.0
2018-03-22 14:56:27 -07:00
Ian Storm Taylor
d33e9139c9 update changelog 2018-03-22 14:55:43 -07:00
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