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

2513 Commits

Author SHA1 Message Date
Ian Storm Taylor
ea6c4dcb08 Publish
- slate-base64-serializer@0.2.73
 - slate-hotkeys@0.2.6
 - slate-html-serializer@0.7.12
 - slate-hyperscript@0.11.3
 - slate-plain-serializer@0.6.12
 - slate-prop-types@0.5.3
 - slate-react@0.19.4
 - slate@0.42.3
slate@0.42.3 slate-react@0.19.4 slate-prop-types@0.5.3 slate-plain-serializer@0.6.12 slate-hyperscript@0.11.3 slate-html-serializer@0.7.12 slate-hotkeys@0.2.6 slate-base64-serializer@0.2.73
2018-10-22 15:24:10 -07:00
Ian Storm Taylor
93df22a128 add unwrapChildrenByPath/Key command 2018-10-22 15:21:45 -07:00
Eric Edem
805c329e5d fix: use text utils to move forward and backward by word (#2169)
* fix: don't check for adjacent void with modified move

This was causing a problem where when the current text was followed by a void node using a modifier key to move forward would force the selection to creep forward a character at a time.

With this change, now the modifier will move as expected, but will jump over void nodes. This is not ideal, but seems like a behavior that will be slightly better than the current one.

* fix: modified key movement.

Use TextUtils.getWordOffsetForward and TextUtils.getWordOffsetBackward to move around by words.

The idea now is that if you move forward or backward, it is completely controlled by slate instead of trying to rely on a combination of browser behavior and slate trying to stop the browser from doing something wrong. This makes things quite a bit more intuitive in the implementation, and gives us a bit more control.

* tests: a whole bunch of selection movement tests.

* tests: more movement tests.
2018-10-22 11:21:20 -07:00
kyrisu
f56f28a8fa Fixed KeyDown handler signature in code snippet (#2294)
The paragraph mentioned handle signature being `event, change, next` but the snippet had a signature with `event, change, editor`
2018-10-22 11:19:55 -07:00
Eric Edem
4c52f7ceff add favicon to the examples (#2283)
Was tired of seeing the error so I stoled this from the gitbook documentation.
2018-10-20 13:11:40 -07:00
Alan Christopher Thomas
175b25ae51 Fix docs on queries to show editor argument (#2285) 2018-10-20 00:05:53 -07:00
Brian Bucknam
53fd59bc62 Fix bolded text in input-tester initial value (#2277) 2018-10-17 11:59:28 -07:00
Eric Edem
63ad062083 feat: add a basic mention implementation example (#2233)
* feat: add a basic mention implementation example

Just a simple example to get people started when trying to implement their own mentions implementation.

* feat(MentionsExample): use a floating suggestions menu.

* fix(MentionsExample): update to slate 0.42
2018-10-16 20:14:22 -07:00
Francis Belanger
861f30a3f9 Add possibility to specify a custom delimiter to slate-plain-serializer (#2266)
* Add possibility to specify a custom delimiter

* Add custom delimiter to the serialize method

* Fix lint
2018-10-16 11:38:19 -07:00
Pier Bover
0deb2e2695 Fixed link (#2270) 2018-10-16 11:35:14 -07:00
Alan Christopher Thomas
996edd19f5 Fix insertTextAtRange selection (#2256)
* Make a test case for buggy insertTextAtRange selection behavior

* Insert text at previous path, not selection key, closes #2209
2018-10-15 15:48:00 -07:00
Dundercover
7192a97600 Add range comparison methods to Point (#2248)
* Rename compare function in path-utils to compareOfSameSize
To make way for a new function that makes a full comparison

* Add compare function to path-utils that handles paths of different sizes

* Add function isAfterRange to Point

* Add function isBeforeRange to Point

* Add function isAtStartOfRange to Point

* Add function isAtEndOfRange to Point

* Add function isInRange to Point

* Add range comparison methods to the documentation of the Point model

* Remove `compareOfSameSize` in `path-utils.js`
Using `compare` instead

* Add `Point.isBeforePoint`

* Add `Point.isAfterPoint`

* Use own methods internally for range comparisons in `Point`

* Return null if paths don't finally match in `compare` method of `path-utils`
To convey that it is not a normal scenario

* Add first test for `Point` model (testing `isAfterPoint`)

* Add tests for `Point.isAfterPoint`

* Add tests for `Point.isBeforePoint`

* Add tests for `Point.isAfterRange`

* Add tests for `Point.isBeforeRange`

* Add tests for `Point.isAtEndOfRange`

* Add tests for `Point.isAtStartOfRange`

* Add tests for `Point.isInRange`
2018-10-15 15:44:09 -07:00
Stephen O'Brien
6c2168c8fe Update ‘Submitting Pull Requests’ to refer to an active label (#2265)
I’m hoping to start making a few contributions myself and was checking this guide out, but noticed that the `✓ easy one` label hasn’t been used in a while and has no open issues.

Instead, we now recommend the `♥ help please` label as a source of issues to fix for potential contributors.
2018-10-15 11:47:17 -07:00
Kashif
c0c0eb65f2 Add missing import (#2252) 2018-10-11 21:34:23 -07:00
Jinxuan Zhu
3c1e3a1574 Fix word counting (#2247) 2018-10-10 14:00:45 -07:00
Ian Storm Taylor
10bf13804f refactor plugins example, fixes #2243 2018-10-10 10:10:27 -07:00
Ian Storm Taylor
d7123453c2 Publish
- slate-react@0.19.3
slate-react@0.19.3
2018-10-10 09:52:54 -07:00
Ian Storm Taylor
6168ce932e fix editor resolution, remove constructor 2018-10-10 09:51:18 -07:00
Ian Storm Taylor
9c597cf97f fix hover manu example 2018-10-10 01:04:35 -07:00
Ian Storm Taylor
f939d168af Publish
- slate-base64-serializer@0.2.72
 - slate-html-serializer@0.7.11
 - slate-hyperscript@0.11.2
 - slate-plain-serializer@0.6.11
 - slate-prop-types@0.5.2
 - slate-react@0.19.2
 - slate@0.42.2
slate@0.42.2 slate-react@0.19.2 slate-prop-types@0.5.2 slate-plain-serializer@0.6.11 slate-hyperscript@0.11.2 slate-html-serializer@0.7.11 slate-base64-serializer@0.2.72
2018-10-09 18:46:54 -07:00
Ian Storm Taylor
3528bb7366 fix plugins stack ordering and defaulting 2018-10-09 18:43:47 -07:00
Ian Storm Taylor
7304c9b343 Publish
- slate-base64-serializer@0.2.71
 - slate-html-serializer@0.7.10
 - slate-hyperscript@0.11.1
 - slate-plain-serializer@0.6.10
 - slate-prop-types@0.5.1
 - slate-react@0.19.1
 - slate@0.42.1
slate@0.42.1 slate-react@0.19.1 slate-prop-types@0.5.1 slate-plain-serializer@0.6.10 slate-hyperscript@0.11.1 slate-html-serializer@0.7.10 slate-base64-serializer@0.2.71
2018-10-09 15:11:57 -07:00
Ian Storm Taylor
bd24739411 fix to pass editor to queries 2018-10-09 15:06:35 -07:00
Ian Storm Taylor
02c0f8e763 Publish
- slate-base64-serializer@0.2.70
 - slate-html-serializer@0.7.9
 - slate-hyperscript@0.11.0
 - slate-plain-serializer@0.6.9
 - slate-prop-types@0.5.0
 - slate-react@0.19.0
 - slate@0.42.0
slate@0.42.0 slate-react@0.19.0 slate-prop-types@0.5.0 slate-plain-serializer@0.6.9 slate-hyperscript@0.11.0 slate-html-serializer@0.7.9 slate-base64-serializer@0.2.70
2018-10-09 14:17:15 -07:00
Ian Storm Taylor
cfa904bb1f update readme beta notice 2018-10-09 14:13:27 -07:00
Ian Storm Taylor
5ad951f08a update badge labels 2018-10-09 14:11:57 -07:00
Ian Storm Taylor
9f53d60bd1 remove packages-specific readme 2018-10-09 14:11:20 -07:00
Ian Storm Taylor
abbe67dc31 remove more badges 2018-10-09 14:11:04 -07:00
Ian Storm Taylor
6ece0158bf add packages section to readme 2018-10-09 14:10:02 -07:00
Ian Storm Taylor
4983d89368 remove travisci badge, since github covers it 2018-10-09 14:08:34 -07:00
Ian Storm Taylor
9da50c3b9c remove some readme badges 2018-10-09 14:07:36 -07:00
Ian Storm Taylor
7a71de387c
Add controller (#2221)
* fold Stack into Editor

* switch Change objects to be tied to editors, not values

* introduce controller

* add the "commands" concept

* convert history into commands on `value.data`

* add the ability to not normalize on editor creation/setting

* convert schema to a mutable constructor

* add editor.command method

* convert plugin handlers to receive `next`

* switch commands to use the onCommand middleware

* add queries support, convert schema to queries

* split out browser plugin

* remove noop util

* fixes

* fixes

* start fixing tests, refactor hyperscript to be more literal

* fix slate-html-serializer tests

* fix schema tests with hyperscript

* fix text model tests with hyperscript

* fix more tests

* get all tests passing

* fix lint

* undo decorations example update

* update examples

* small changes to the api to make it nicer

* update docs

* update commands/queries plugin logic

* change normalizeNode and validateNode to be middleware

* fix decoration removal

* rename commands tests

* add useful errors to existing APIs

* update changelogs

* cleanup

* fixes

* update docs

* add editor docs
2018-10-09 14:03:27 -07:00
Ian Storm Taylor
e6372d829a Publish
- slate-base64-serializer@0.2.69
 - slate-html-serializer@0.7.8
 - slate-hyperscript@0.10.8
 - slate-plain-serializer@0.6.8
 - slate-prop-types@0.4.67
 - slate-react@0.18.11
 - slate-simulator@0.4.67
 - slate@0.41.3
slate@0.41.3 slate-simulator@0.4.67 slate-react@0.18.11 slate-prop-types@0.4.67 slate-plain-serializer@0.6.8 slate-hyperscript@0.10.8 slate-html-serializer@0.7.8 slate-base64-serializer@0.2.69
2018-10-09 12:49:32 -07:00
Kaspars Dancis
b1ec914467 Replace "zero width whitspace" with "zero width no break" character (#2234)
This fixes https://github.com/ianstormtaylor/slate/issues/2231 where
a rogue empty line appears before an inline block.
2018-10-09 12:30:01 -07:00
inkubux
933c938765 Fix delete undo (#2240)
* Fix undo after a selection snapshot

* Add a test to cover the text deletion case

* Fix lint

* Use the new whitoutMerging flag instead

* cleanup + fix function call
2018-10-09 12:13:03 -07:00
Andrei Cacio
de9a07900e Fixed broken HTML serializer link (#2239) 2018-10-09 08:51:36 -07:00
0xflotus
2a024a6806 fixed repositories (#2238) 2018-10-09 08:50:42 -07:00
Kaspars Dancis
1ff050265b Fix an occasional crash in Firefox in isInEditor (#2229)
* Fix an occasional crash in Firefox in isInEditor

* Update content.js
2018-10-05 14:25:32 -07:00
Bryan Haakman
10e8ab4db6 serialize path as well in Operation.toJSON (#2227)
* serialize path as well in Operation.toJSON

* add on the next statement instead
2018-10-04 09:39:34 -07:00
Dmitry Zarva
dda0628c04 fix activeMarks for intersecting marks text (#2226) 2018-10-04 09:14:34 -07:00
Ian Storm Taylor
d84f5072c1
Fix normalizing dirty paths (#2222)
#### Is this adding or improving a _feature_ or fixing a _bug_?

Fix.

#### What's the new behavior?

The dirty paths in a change are now transformed against incoming operations, such that they don't get out of sync as normalizations occur. This is a rough pass to get correctness and the bug fixed, and we can later optimize lots of the little details for performance.

#### Have you checked that...?

<!-- 
Please run through this checklist for your pull request: 
-->

* [x] The new code matches the existing patterns and styles.
* [x] The tests pass with `yarn test`.
* [x] The linter passes with `yarn lint`. (Fix errors with `yarn prettier`.)
* [x] The relevant examples still work. (Run examples with `yarn watch`.)

#### Does this fix any issues or need any specific reviewers?

Fixes: #2211
Fixes: #2215
Fixes: #2194
2018-10-02 15:57:48 -07:00
Ian Storm Taylor
9ed08c1544 remove debugger 2018-10-02 08:36:27 -07:00
Eric Edem
6dc8b4baa5 docs(plugins): update signature docs (#2057)
`onChange()` also receives the editor as an argument.
2018-09-27 23:37:01 -07:00
Ian Storm Taylor
e7ab7f8279 cleanup object type checking and interface 2018-09-27 16:36:37 -07:00
Ian Storm Taylor
aba8f19d0e Publish
- slate-base64-serializer@0.2.68
 - slate-html-serializer@0.7.7
 - slate-hyperscript@0.10.7
 - slate-plain-serializer@0.6.7
 - slate-prop-types@0.4.66
 - slate-react@0.18.10
 - slate-simulator@0.4.66
 - slate@0.41.2
slate@0.41.2 slate-simulator@0.4.66 slate-react@0.18.10 slate-prop-types@0.4.66 slate-plain-serializer@0.6.7 slate-hyperscript@0.10.7 slate-html-serializer@0.7.7 slate-base64-serializer@0.2.68
2018-09-26 13:20:34 -07:00
Ian Storm Taylor
7b4eca5e16 Merge branch 'master' of github.com:ianstormtaylor/slate 2018-09-26 13:12:42 -07:00
Ian Storm Taylor
af8432f639 fix onClick when not finding a node 2018-09-26 13:12:35 -07:00
Bryan Haakman
6813ac41b5 Add a version example (#2205)
* add a versions example, first try

* lint fixes

* set version to latest on mount
2018-09-25 13:33:11 -07:00
Eric Edem
f60100bd93 Update products to include Cake (#2207)
Now that Cake is coming out of invite only mode, figured it was a good time to add it. :)
2018-09-25 13:29:15 -07:00
Nick Quaranto
237dd8395f Update resources with Chatterslate (#2204)
Just a quick update here with a link to https://github.com/chatterbugapp/chatterslate !
2018-09-25 11:27:39 -07:00