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

2194 Commits

Author SHA1 Message Date
Ben Gotow
73392b9596 Update search-highlighting example per #1454 (#1526) 2018-01-12 10:41:17 -08:00
Sunny Hirai
6673e1ec6d
Merge pull request #1515 from thesunny/ios-fix
Fixed scroll-to-selection jumping to top on iOS 11
2018-01-11 15:41:53 -08:00
Ian Storm Taylor
6cfc864472 Publish
- slate-base64-serializer@0.2.20
 - slate-html-serializer@0.5.1
 - slate-hyperscript@0.5.1
 - slate-plain-serializer@0.5.1
 - slate-prop-types@0.4.18
 - slate-react@0.11.1
 - slate-simulator@0.4.18
 - slate@0.32.1
slate@0.32.1 slate-simulator@0.4.18 slate-react@0.11.1 slate-prop-types@0.4.18 slate-plain-serializer@0.5.1 slate-hyperscript@0.5.1 slate-html-serializer@0.5.1 slate-base64-serializer@0.2.20
2018-01-11 12:02:39 -08:00
David Hrdlicka
6f1fd08fcd Expose core plugins (#1524) 2018-01-11 12:01:03 -08:00
Francesco Agnoletto
32dd6f5ecc Update links to Plugins (#1522)
* Update links to Plugins

Links to ianstormtaylor were deprected.

* Fix typo
2018-01-11 10:54:30 -08:00
Sunny Hirai
3d86533b5b Updated scroll-to-selection so it skips the scroll only on version 11 of iOS. 2018-01-11 10:06:41 -08:00
Sunny Hirai
69e53cb556 Merged upstream/master 2018-01-11 09:55:07 -08:00
Ian Storm Taylor
db0fd84bbc update cache time for readme badge images 2018-01-10 22:30:29 -08:00
Ian Storm Taylor
9e2c42297c update plugins link in readme 2018-01-10 22:28:12 -08:00
Ryan Grove
b991d71abf Fix double-handling of iOS return and backspace keypresses (#1520)
Fixes #1519
2018-01-10 22:26:42 -08:00
Ian Storm Taylor
c9f98525b2 remove editors section from plugins docs 2018-01-10 22:22:52 -08:00
Ian Storm Taylor
9f358d1d29 update plugins reference links 2018-01-10 22:21:10 -08:00
Ian Storm Taylor
a5c0f668ca update plugins doc 2018-01-10 22:19:05 -08:00
Ian Storm Taylor
17a1c49cea update plugins doc 2018-01-10 22:15:45 -08:00
Ian Storm Taylor
a51180cfb7 add plugins doc 2018-01-10 22:10:55 -08:00
Sunny Hirai
9d2c6d4e05 Merge remote-tracking branch 'upstream/master' into ios-fix 2018-01-10 17:13:50 -08:00
Sunny Hirai
7dee55d066 Updated scroll-to-selection to abort only if on iOS 11 2018-01-10 16:57:39 -08:00
Justin Weiss
1a2a75bf94
Merge pull request #1514 from aha-app/fix-text-delete-selection-changes
Move selection to the offset of remove_text if it's in its bounds
2018-01-10 16:46:13 -08:00
Justin Weiss
4781a0ea66 Change operation tests to take a list of operations 2018-01-10 15:36:09 -08:00
Sunny Hirai
d96a528ac0 Fixed scroll-to-selection jumping to top on iOS 2018-01-09 13:07:40 -08:00
Justin Weiss
a6b069603f Move selection to the offset of remove_text if it's in its bounds
If selection is inside a block of text that's removed, the part of the
selection that's inside the bounds should clamp to the offset of the
removed text. So if your cursor is at offset 5, and you're deleting
from 2-10, your cursor should end up at offset 2.
2018-01-09 11:13:44 -08:00
Spencer Baynton
2d7c470c94 Changed metaKey to crtlKey (#1508)
Fixes documentation suggested in issue #690.
2018-01-08 13:38:46 -08:00
Ryan Grove
df5b4a5d61 Fix iOS autocorrect issues with Backspace and Return (#1475)
* Fix iOS autocorrect issues with Backspace and Return

Handling Backspace and Return keystrokes in `onNativeBeforeInput`
ensures that iOS recognizes word and paragraph breaks and generates
appropriate autocorrect suggestions.

Fixes #1471

* Cleaner `onKeyDown` iOS check courtesy of @davidlibland
2018-01-08 13:34:59 -08:00
Ryan Yurkanin
7b8760fe60 Adding normalize false to the moveNodeByKey call in deleteAtRange (#1506) 2018-01-05 16:06:18 -08:00
Ian Storm Taylor
fc121b5821 Publish
- slate-base64-serializer@0.2.19
 - slate-html-serializer@0.5.0
 - slate-hyperscript@0.5.0
 - slate-plain-serializer@0.5.0
 - slate-prop-types@0.4.17
 - slate-react@0.11.0
 - slate-simulator@0.4.17
 - slate@0.32.0
slate@0.32.0 slate-simulator@0.4.17 slate-react@0.11.0 slate-prop-types@0.4.17 slate-plain-serializer@0.5.0 slate-hyperscript@0.5.0 slate-html-serializer@0.5.0 slate-base64-serializer@0.2.19
2018-01-04 15:39:37 -08:00
Ian Storm Taylor
68bf8a00bf fix syncing-operations example 2018-01-04 15:38:16 -08:00
Ian Storm Taylor
1b73d5531c update changelogs 2018-01-04 15:32:04 -08:00
Ian Storm Taylor
85f4a7618c Merge branch 'master' of github.com:ianstormtaylor/slate 2018-01-04 15:27:06 -08:00
Ian Storm Taylor
5444a300b8
rename kind to object for clarity (#1501)
* rename `kind` to `object` for clarity

* add deprecation warning for direct access

* add deprecation warning for node creation
2018-01-04 15:26:53 -08:00
Ian Storm Taylor
e01a2e2dfb switch html-serializer tests to use jsdom 2018-01-04 15:20:02 -08:00
Yoel
a6c56a2c56 slate-html-serializer: consistent element.value lookups (#1503)
* consistent element.value lookups

* fix JSDOC / lint

* remove getValue util in favor of element.nodeValue lookup
2018-01-04 15:08:25 -08:00
Ian Storm Taylor
bfe3124b01 Publish
- slate-base64-serializer@0.2.18
 - slate-html-serializer@0.4.16
 - slate-hyperscript@0.4.16
 - slate-plain-serializer@0.4.16
 - slate-prop-types@0.4.16
 - slate-react@0.10.23
 - slate-simulator@0.4.16
 - slate@0.31.8
slate@0.31.8 slate-simulator@0.4.16 slate-react@0.10.23 slate-prop-types@0.4.16 slate-plain-serializer@0.4.16 slate-hyperscript@0.4.16 slate-html-serializer@0.4.16 slate-base64-serializer@0.2.18
2018-01-02 17:02:19 -08:00
Stan Chang Khin Boon
9c07a6baa4 Flush change immediately (#1479) (#1480)
Propose to flush change immediately instead of delaying it using `setTimeout()`.

- Flushing change is only use for `props.onChange()` callback and invoked at the end of render lifecycle (didMount/didUpdate), can't find the rationale for delaying it.
- `setTimeout()` delay are not dependable for a predictive behaviour
- `onChange()` is an important callback for a controlled component, delaying it can cause race condition. e.g. any changes outside of the component lifecycle that happen between the delay of flushing change will be overridden
2017-12-29 11:07:55 -08:00
Justin Weiss
23ab02626f Properly invert merge_node operations (#1477) 2017-12-29 10:57:21 -08:00
Charlie Martin
29bcb1c8d6 Don't attempt to remove event listeners from non-existent window (#1495)
```
<IFrameComponent>
  <SlateEditor {...props} />
</IFrameComponent>
```

Since react unmounts from top down, `IFrameComponent` will unmount first (destroying its window), then `SlateEditor` will unmount and attempt to access the iframe window (which no longer exists) throwing `Uncaught TypeError: Cannot read property 'document' of undefined`.

It should be safe to skip removing event listeners from windows that no longer exist since they will be garbage collected upon destruction of the window anyway
2017-12-29 10:49:54 -08:00
Stan Chang Khin Boon
02c4837d4c this.element might be null when the callback is executed (#1489) 2017-12-29 10:48:53 -08:00
Brian Kim
6f5f2db271 fix #1487 (#1488) 2017-12-29 10:48:28 -08:00
Julien Poissonnier
0e33c8bb35 Fix schema marks validation (#1483) 2017-12-29 10:47:06 -08:00
Ryan
7dc93dced9 Docs: Fix method capitalization on resetKeyGenerator (#1474) 2017-12-29 10:43:02 -08:00
Stan Chang Khin Boon
1b9d3944a9 change.operations is immutable List thus we should size property instead of length (#1478) 2017-12-29 10:42:32 -08:00
Ian Storm Taylor
22576e521f Publish
- slate-base64-serializer@0.2.17
 - slate-html-serializer@0.4.15
 - slate-hyperscript@0.4.15
 - slate-plain-serializer@0.4.15
 - slate-prop-types@0.4.15
 - slate-react@0.10.22
 - slate-simulator@0.4.15
 - slate@0.31.7
slate@0.31.7 slate-simulator@0.4.15 slate-react@0.10.22 slate-prop-types@0.4.15 slate-plain-serializer@0.4.15 slate-hyperscript@0.4.15 slate-html-serializer@0.4.15 slate-base64-serializer@0.2.17
2017-12-12 18:10:57 -05:00
Justin Weiss
8be1f9f3a1 Remove value from operation.fromJSON (#1451)
* Remove `value` from `operation.fromJSON`

Value is only used for local undo / redo, so it shouldn't be
serialized along with the rest of the data.

* Continue to parse a specified `value` into an Operation
2017-12-12 18:09:15 -05:00
Evan Henley
a3d91b6daa fix: account for container padding in scrollToSelection (#1462) 2017-12-11 10:35:02 -08:00
Ian Storm Taylor
fafa607e54 Publish
- slate-base64-serializer@0.2.16
 - slate-html-serializer@0.4.14
 - slate-hyperscript@0.4.14
 - slate-plain-serializer@0.4.14
 - slate-prop-types@0.4.14
 - slate-react@0.10.21
 - slate-simulator@0.4.14
 - slate@0.31.6
slate@0.31.6 slate-simulator@0.4.14 slate-react@0.10.21 slate-prop-types@0.4.14 slate-plain-serializer@0.4.14 slate-hyperscript@0.4.14 slate-html-serializer@0.4.14 slate-base64-serializer@0.2.16
2017-12-11 10:40:51 -05:00
David Silva
f8c74426a5 fix(at-range): forward deletion now stays with next block. (#1459)
* fix(at-range): forward deletion now stays with next block.

* fix(at-range): use select instead of moveToRangeOf

* Revert "fix(at-range): use select instead of moveToRangeOf"

This reverts commit 43bf33e29daeaa609bf92196df1b25de42c12d96.

* fix(at-range): moveOffsetsTo

* fix(at-range): change to change.moveToStartOf(nextBlock)
2017-12-11 07:14:25 -08:00
David Silva
c58e53364f fix(scroll-to-selection): use getClientRects when selectionRect.top/height is still 0 in Safari (#1446)
* fix(scroll-to-selection): use getClientRects when startContainer.length is 1

* fix(scroll-to-selection): rewrite and check if selectionRect.top/height still 0, use getClientRects

* fix(scroll-to-selection): identation whoopsie

* fix(scroll-to-selection): tabs !== spaces

* fix(scroll-to-selection): check for getClientRects length

* feat(scroll-to-selection): add IS_SAFARI check
2017-12-11 06:59:31 -08:00
Justin Weiss
082fb53633 Add a copyFragment helper for plugin onCut/onCopy functions (#1429)
* Add a `copyFragment` helper for plugin onCut/onCopy functions

* Rename `copyFragment` to `cloneFragment`

* Fix a missing clone-fragment reference
2017-12-11 06:56:38 -08:00
Conor Cussell
b2e0612149 Deal with invalid range passed to getSelectionIndexes (#1443)
* Deal with invalid range in getSelectionIndexes

* Use range is unset
2017-12-11 06:54:46 -08:00
Ian Storm Taylor
cef33de6aa Publish
- slate-base64-serializer@0.2.15
 - slate-html-serializer@0.4.13
 - slate-hyperscript@0.4.13
 - slate-plain-serializer@0.4.13
 - slate-prop-types@0.4.13
 - slate-react@0.10.20
 - slate-simulator@0.4.13
 - slate@0.31.5
slate@0.31.5 slate-simulator@0.4.13 slate-react@0.10.20 slate-prop-types@0.4.13 slate-plain-serializer@0.4.13 slate-hyperscript@0.4.13 slate-html-serializer@0.4.13 slate-base64-serializer@0.2.15
2017-12-04 11:31:07 -08:00
Evan Henley
4f1c26961d refactor scroll logic (#1428) 2017-12-04 11:27:54 -08:00