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

110 Commits

Author SHA1 Message Date
Ian Storm Taylor
3ce94b3db7 fix linter 2017-10-26 16:26:16 -07:00
Ian Storm Taylor
5ba34c1152 fix rendering tests 2017-10-26 16:25:32 -07:00
Ian Storm Taylor
34c528b156 add benchmarks, update benchmark reporting 2017-10-26 14:46:34 -07:00
Ian Storm Taylor
e0978a31e9 change offset key serialization to allow dashes in keys, fixes #474 2017-10-26 14:06:22 -07:00
Ian Storm Taylor
db6e29fbe3 remove hairspace compat for chrome/safari 2017-10-26 14:04:08 -07:00
Ian Storm Taylor
753b88747e Publish
- slate-base64-serializer@0.1.21
 - slate-dev-logger@0.1.22
 - slate-html-serializer@0.2.7
 - slate-hyperscript@0.2.7
 - slate-plain-serializer@0.2.7
 - slate-prop-types@0.2.7
 - slate-react@0.8.1
 - slate-simulator@0.2.1
 - slate@0.28.1
2017-10-26 10:38:34 -07:00
Ian Storm Taylor
31b4f67573 fix to reresolve the editor plugin less, add warning (#1300)
* fix to reresolve the editor plugin less, add warning

* update comments
2017-10-26 10:31:09 -07:00
Ian Storm Taylor
1235a0a8c5 fix findRange for text nodes next to inlines (#1298) 2017-10-26 09:26:58 -07:00
Ian Storm Taylor
5b2e53039a update changelogs 2017-10-25 18:32:58 -07:00
Ian Storm Taylor
3e860a1cbe Publish
- slate-base64-serializer@0.1.20
 - slate-dev-logger@0.1.21
 - slate-html-serializer@0.2.6
 - slate-hyperscript@0.2.6
 - slate-plain-serializer@0.2.6
 - slate-prop-types@0.2.6
 - slate-react@0.8.0
 - slate-simulator@0.2.0
 - slate@0.28.0
2017-10-25 18:20:37 -07:00
Ian Storm Taylor
fe863c7d47 fix linter 2017-10-25 18:12:39 -07:00
Ivan Starkov
cd0e577023 Fix IE11 error (#1264)
* Fix IE11 error

* Update find-dom-point.js
2017-10-25 18:09:02 -07:00
Ian Storm Taylor
ed593c732b remove some polyfills (#1288)
* remove some polyfills

* use for-of for iteration when possible
2017-10-25 17:55:18 -07:00
Ian Storm Taylor
509d3d50fc remove rendering from schema & make it expressive (#1262)
* split rendering out of schema

* remove default components

* first stab at new schema

* make default normalizations smarter

* revert to forcing defaults to be verbose?

* refactor reason constants

* split nodes into blocks/inlines

* get tests passing

* restructure schema tests

* add parent test

* cleanup

* remove defaults from schema

* refactor schema rule.nodes validation, update example

* embed schema in state objects

* fixes

* update examples, and fixes

* update walkthroughs

* update docs

* remove old schemas doc page

* add more tests

* update benchmarks
2017-10-25 17:32:29 -07:00
Justin Weiss
6298d5442d Revert "Keep marks after splitting a block (#1273)" (#1289)
This reverts commit 6f676d67712b15216cf611e01dead990ee0dd8c1.

This behavior should be in userland, because there isn't agreement
among text editors on how it should behave.

Resolves #1269.
2017-10-25 17:31:19 -07:00
Ian Storm Taylor
8b72534f63 Publish
- slate-react@0.7.4
2017-10-25 15:38:07 -07:00
Ian Storm Taylor
443be389c3 fix tests 2017-10-25 15:35:32 -07:00
Ian Storm Taylor
d620141efe cleanup void, fix void selections in safari 2017-10-25 15:33:34 -07:00
AlbertHilb
fe0d7fd1ce Reshape Void component. (#1265)
* Reshape `Void` component.
Add some cases where editor blur should be prevented.

* Update tests.
2017-10-25 15:32:10 -07:00
Kelly Joseph Price
b558872b56 Fix Edge pasting exception (#1286) 2017-10-25 14:30:33 -07:00
Ian Storm Taylor
68680f6754 Publish
- slate-base64-serializer@0.1.19
 - slate-dev-logger@0.1.20
 - slate-html-serializer@0.2.5
 - slate-hyperscript@0.2.5
 - slate-plain-serializer@0.2.5
 - slate-prop-types@0.2.5
 - slate-react@0.7.3
 - slate-simulator@0.1.19
 - slate@0.27.5
2017-10-24 22:40:47 -07:00
Justin Weiss
6f676d6771 Keep marks after splitting a block (#1273)
If you have, for example, a bold mark, and you hit "Enter", the new
block won't carry over the formatting. Instead, it should (at least if
you start typing right away).

Fixes #1269.
2017-10-24 22:36:49 -07:00
AlbertHilb
f46cbb1eb7 Don't stop propagation of drag events. (#1278) 2017-10-24 22:31:28 -07:00
Justin Weiss
c3813e18b7 Save marks when creating native ranges in onNativeBeforeInput (#1272)
* Save marks when creating native ranges in onNativeBeforeInput

When we used native ranges in onNativeBeforeInput, we weren't carrying
over the marks from Slate's selection. This made it impossible to know
that the next character typed should have a set of marks.

Fixes #1270.

* Ensure marks are cleared after successfully entering text

* Stop setting marks in findRange

Adding the selection's marks inside findRange was too broad of a
change, and would keep marks after doing things like moving a
selection around. We should use selection.marks directly in
insertTextAtRange instead.

* Update find-range.js
2017-10-24 22:30:40 -07:00
David O'Trakoun
6c347e9d4b typo (#1266) 2017-10-19 13:17:43 -07:00
Ian Storm Taylor
dac9d185cd Publish
- slate-react@0.7.2
2017-10-18 13:31:19 -07:00
Ian Storm Taylor
0c0be8d1d5 fix default placeholder emptiness check, closes #1259 2017-10-18 13:29:59 -07:00
Ian Storm Taylor
2d120c4725 Publish
- slate-react@0.7.1
2017-10-18 01:43:12 -07:00
Ian Storm Taylor
d66e127e7d update editor.change() to use change.call(), update docs 2017-10-18 01:42:36 -07:00
Ian Storm Taylor
96bf3832f6 update changelog 2017-10-18 00:29:44 -07:00
Ian Storm Taylor
2a259df878 Publish
- slate-base64-serializer@0.1.18
 - slate-dev-logger@0.1.19
 - slate-html-serializer@0.2.4
 - slate-hyperscript@0.2.4
 - slate-plain-serializer@0.2.4
 - slate-prop-types@0.2.4
 - slate-react@0.7.0
 - slate-simulator@0.1.18
 - slate@0.27.4
2017-10-18 00:26:34 -07:00
Ian Storm Taylor
f42a64ac8f refactor placeholder to use schema (#1253)
* refactor placeholder to use schema

* update placeholder, remove old export

* add maxWidth to prevent overflow

* update docs
2017-10-18 00:23:39 -07:00
Ian Storm Taylor
a65bdb0169 Publish
- slate-base64-serializer@0.1.17
 - slate-dev-logger@0.1.18
 - slate-html-serializer@0.2.3
 - slate-hyperscript@0.2.3
 - slate-plain-serializer@0.2.3
 - slate-prop-types@0.2.3
 - slate-react@0.6.1
 - slate-simulator@0.1.17
 - slate@0.27.3
2017-10-17 18:24:01 -07:00
Ian Storm Taylor
b375660aa9 refactor hotkeys to constants, and add transforms (#1251)
* refactor hotkeys to constants, and add transforms

* update hotkey helper
2017-10-17 18:18:27 -07:00
Ian Storm Taylor
54ec11e199 update walkthroughs, docs and changelog 2017-10-16 21:13:07 -07:00
Ian Storm Taylor
a9e037a6a7 Publish
- slate-react@0.6.0
2017-10-16 21:04:57 -07:00
Ian Storm Taylor
11b2003f53 Remove data (#1244)
* remove data from event handler signatures

* standardize known transfer types

* add setEventTransfer to docs

* update examples, fix drag/drop

* fix tests and draggable attribute setting
2017-10-16 21:04:16 -07:00
Ian Storm Taylor
ba5263e0f6 Publish
- slate-react@0.5.5
2017-10-16 20:37:03 -07:00
Ian Storm Taylor
fb0bdfa28b fix linter 2017-10-16 20:35:18 -07:00
Ian Storm Taylor
276ed274b1 fix drag/drop 2017-10-16 20:33:04 -07:00
Ian Storm Taylor
6422de5b56 Publish
- slate-react@0.5.4
2017-10-16 19:57:10 -07:00
Ian Storm Taylor
1d140e70fb fix missing return true for before plugin 2017-10-16 19:56:28 -07:00
Ian Storm Taylor
045c1879f4 update changelog and docs 2017-10-16 18:58:31 -07:00
Ian Storm Taylor
c315a38bb5 Publish
- slate-base64-serializer@0.1.16
 - slate-dev-logger@0.1.17
 - slate-html-serializer@0.2.2
 - slate-hyperscript@0.2.2
 - slate-plain-serializer@0.2.2
 - slate-prop-types@0.2.2
 - slate-react@0.5.3
 - slate-simulator@0.1.16
 - slate@0.27.2
2017-10-16 18:51:54 -07:00
Ian Storm Taylor
b462c2ce19 deprecate data, add getEventRange and getEventTransfer helpers (#1243) 2017-10-16 18:50:29 -07:00
Ian Storm Taylor
617fba2ac0 Split core plugin (#1242)
* split core into before/after, add onBeforeInput to before

* migrate handlers to before plugin, add event handlers constants

* cleanup

* refactor hotkeys into constants file

* fix serializer, disable core plugin tests

* fix linter
2017-10-16 17:31:43 -07:00
Ian Storm Taylor
6097f127ef Publish
- slate-react@0.5.2
2017-10-16 13:43:37 -07:00
Ryan Grove
6378c12a98 Use native beforeinput events to handle text insertion when possible (#1232)
* Add support for finding a Slate range from a native StaticRange

* Add a `SUPPORTED_EVENTS` environment constant

This is an object mapping of DOM event names to booleans indicating
whether the browser supports that event.

* Use native `beforeinput` events to handle text insertion when possible

In browsers that support it (currently only Safari has full support),
the native `beforeinput` DOM event provides much more useful information
about text insertion than React's synthetic `onBeforeInput` event.

By handling text insertion with the native event instead of the
synthetic event when possible, we can fully support autocorrect,
spellcheck replacements, and related functionality on iOS without
resorting to hacks.

See the discussion in #1177 for more background on this change.

Fixes #1176
Fixes #1177

* Fix lint error.
2017-10-16 13:38:23 -07:00
Ian Storm Taylor
78cee7d5fb Publish
- slate-react@0.5.1
2017-10-16 10:36:23 -07:00
Ian Storm Taylor
fe24e82d16 fix to check range count before getting ranges, closes #1237 (#1239) 2017-10-16 10:31:27 -07:00