1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-30 10:29:48 +02:00

update changelog

This commit is contained in:
Ian Storm Taylor
2018-08-03 15:18:02 -07:00
parent ea6c4d9da2
commit 38918c5e1c

View File

@@ -38,7 +38,7 @@ const range = document.createRange({
focus: { focus: {
key: 'a', key: 'a',
offset: 4, offset: 4,
} },
}) })
``` ```
@@ -57,6 +57,8 @@ const anchor = document.createPoint({
**The `Range.focus` method was removed. (Not `Change.focus`!)** This was necessary to make way for the new `range.focus` point property. Usually this would have been done in a migration-friendly way like the rest of the method changes in this release, but this was an exception. However the `change.focus()` method is still available and works as expected. **The `Range.focus` method was removed. (Not `Change.focus`!)** This was necessary to make way for the new `range.focus` point property. Usually this would have been done in a migration-friendly way like the rest of the method changes in this release, but this was an exception. However the `change.focus()` method is still available and works as expected.
**`Range.set` and `Range.merge` are dangerous.** If you were previously using the super low-level Immutable.js methods `range.set` or `range.merge` with any of the now-removed properties of ranges, these invocations will fail. Instead, you should use the `range.set*` helpers going forward which can be migrated with deprecations warnings instead of failing outright.
**The `Range.toJSON()` structure has changed.** With the introduction of points, the range now returns its `anchor` and `focus` properties as nested point JSON objects instead of directly as properties. For example: **The `Range.toJSON()` structure has changed.** With the introduction of points, the range now returns its `anchor` and `focus` properties as nested point JSON objects instead of directly as properties. For example:
```json ```json
@@ -72,10 +74,10 @@ const anchor = document.createPoint({
"object": "point", "object": "point",
"key": "a", "key": "a",
"offset": 3, "offset": 3,
"path": [0, 0], "path": [0, 0]
}, },
"isFocused": false,
"isAtomic": false, "isAtomic": false,
"isFocused": false,
"marks": [] "marks": []
} }
``` ```
@@ -237,7 +239,6 @@ moveToStartOf -> moveToStartOfNode
selectAll -> moveToRangeOfDocument selectAll -> moveToRangeOfDocument
``` ```
--- ---
### `0.36.0` — July 27, 2018 ### `0.36.0` — July 27, 2018