* 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.
* 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
* 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`
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.
* 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
* 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
#### 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: #2211Fixes: #2215Fixes: #2194