mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-03-06 13:59:47 +01:00
#### Is this adding or improving a _feature_ or fixing a _bug_? Feature. #### What's the new behavior? This pull request adds paths to `Range` objects, including the selection. The paths and keys are kept in sync automatically, so that you can use whichever is ideal for your use case. This should allow us to use paths for lots of the internal logic, which are much quicker to work with than keys since they avoid having to lookup the key in the document and can just traverse right to the node in question. #### How does this change work? `Range` objects have two new properties: ```js range.anchorPath range.focusPath ``` (Eventually these will be `range.anchor.path` and `range.focus.path` when points are introduced.) When operations occur and whenever ranges are created/normalized, the paths are updated and kept in sync with the keys. #### 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: https://github.com/ianstormtaylor/slate/issues/1408 Fixes: https://github.com/ianstormtaylor/slate/issues/1567
36 lines
1.3 KiB
Markdown
36 lines
1.3 KiB
Markdown
# Changelog
|
|
|
|
This document maintains a list of changes to the `slate-simulator` package with each new version. Until `1.0.0` is released, breaking changes will be added as minor version bumps, and smaller changes won't be accounted for since the library is moving quickly.
|
|
|
|
---
|
|
|
|
### `0.4.0` — October 27, 2017
|
|
|
|
###### BREAKING
|
|
|
|
**Remove all previously deprecated code paths.** This helps to reduce some of the complexity in Slate by not having to handle these code paths anymore. And it helps to reduce file size. When upgrading, it's _highly_ recommended that you upgrade to the previous version first and ensure there are no deprecation warnings being logged, then upgrade to this version.
|
|
|
|
---
|
|
|
|
### `0.3.0` — October 27, 2017
|
|
|
|
###### DEPRECATED
|
|
|
|
**The `props.state` prop has been renamed to `props.value`.** This is to stay in line with `slate-react@0.9.0` where the same change was made to the `<Editor>`.
|
|
|
|
**The `simulator.state` property is now `simulator.value`** This is to stay in line with `slate@0.29.0` where the same change as made to the `Change` objects.
|
|
|
|
---
|
|
|
|
### `0.2.0` — October 25, 2017
|
|
|
|
###### BREAKING
|
|
|
|
**Updated to work with `slate@0.28.0`.** Along with the new Schema, the `Stack` which is used internally by the simulator has changed slightly.
|
|
|
|
---
|
|
|
|
### `0.1.0` — September 17, 2017
|
|
|
|
:tada:
|