mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-30 02:19:52 +02:00
update changelog
This commit is contained in:
@@ -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": []
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -113,7 +115,7 @@ focusOffset -> focus.offset
|
|||||||
focusPath -> focus.path
|
focusPath -> focus.path
|
||||||
hasAnchorAtEndOf -> anchor.isAtEndOfNode
|
hasAnchorAtEndOf -> anchor.isAtEndOfNode
|
||||||
hasAnchorAtStartOf -> anchor.isAtStartOfNode
|
hasAnchorAtStartOf -> anchor.isAtStartOfNode
|
||||||
hasAnchorBetween ->
|
hasAnchorBetween ->
|
||||||
hasAnchorIn -> anchor.isInNode
|
hasAnchorIn -> anchor.isInNode
|
||||||
hasEdgeAtEndOf -> anchor.isAtEndOfNode || focus.isAtEndOfNode
|
hasEdgeAtEndOf -> anchor.isAtEndOfNode || focus.isAtEndOfNode
|
||||||
hasEdgeAtStartOf -> anchor.isAtStartOfNode || focus.isAtStartOfNode
|
hasEdgeAtStartOf -> anchor.isAtStartOfNode || focus.isAtStartOfNode
|
||||||
@@ -121,7 +123,7 @@ hasEdgeBetween ->
|
|||||||
hasEdgeIn -> anchor.isInNode || focus.isInNode
|
hasEdgeIn -> anchor.isInNode || focus.isInNode
|
||||||
hasEndAtEndOf -> end.isAtEndOfNode
|
hasEndAtEndOf -> end.isAtEndOfNode
|
||||||
hasEndAtStartOf -> end.isAtEndOfNode
|
hasEndAtStartOf -> end.isAtEndOfNode
|
||||||
hasEndBetween ->
|
hasEndBetween ->
|
||||||
hasEndIn -> end.isInNode
|
hasEndIn -> end.isInNode
|
||||||
hasFocusAtEndOf -> focus.isAtEndOfNode
|
hasFocusAtEndOf -> focus.isAtEndOfNode
|
||||||
hasFocusAtStartOf -> focus.isAtStartOfNode
|
hasFocusAtStartOf -> focus.isAtStartOfNode
|
||||||
@@ -129,7 +131,7 @@ hasFocusBetween ->
|
|||||||
hasFocusIn -> focus.isInNode
|
hasFocusIn -> focus.isInNode
|
||||||
hasStartAtEndOf -> start.isAtEndOfNode
|
hasStartAtEndOf -> start.isAtEndOfNode
|
||||||
hasStartAtStartOf -> start.isAtStartOfNode
|
hasStartAtStartOf -> start.isAtStartOfNode
|
||||||
hasStartBetween ->
|
hasStartBetween ->
|
||||||
hasStartIn -> start.isInNode
|
hasStartIn -> start.isInNode
|
||||||
isAtEndOf -> isCollapsed && anchor.isAtEndOfNode
|
isAtEndOf -> isCollapsed && anchor.isAtEndOfNode
|
||||||
isAtStartOf -> isCollapsed && anchor.isAtStartOfNode
|
isAtStartOf -> isCollapsed && anchor.isAtStartOfNode
|
||||||
@@ -237,7 +239,6 @@ moveToStartOf -> moveToStartOfNode
|
|||||||
selectAll -> moveToRangeOfDocument
|
selectAll -> moveToRangeOfDocument
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### `0.36.0` — July 27, 2018
|
### `0.36.0` — July 27, 2018
|
||||||
|
Reference in New Issue
Block a user