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

update changelogs and peer dependencies

This commit is contained in:
Ian Storm Taylor 2019-05-08 20:33:00 -07:00
parent a5a25f97dd
commit d00f47256e
7 changed files with 119 additions and 4 deletions

View File

@ -4,6 +4,16 @@ This document maintains a list of changes to the `slate-hyperscript` package wit
---
### `0.13.0` — May 8, 2019
###### BREAKING
**Updated to work with `slate@0.47`.** The hyperscript creators have been updated to work with the `Annotation` model introduced in the latest version of Slate.
**The `slate-hyperscript` package now uses the "annotations" name.** All of the existing APIs that previously used the word "decorations" in `slate-hyperscript` have been updated.
---
### `0.12.0` — May 1, 2019
###### BREAKING

View File

@ -16,7 +16,7 @@
"is-plain-object": "^2.0.4"
},
"peerDependencies": {
"slate": ">=0.46.0"
"slate": ">=0.47.0"
},
"devDependencies": {
"mocha": "^2.5.3",

View File

@ -4,6 +4,14 @@ This document maintains a list of changes to the `slate-react-placeholder` packa
---
### `0.2.0` — May 8, 2019
###### BREAKING
**Updated to work with `slate@0.47`.** The placeholder decorations have been updated to work alongside the new requirements for decorations in `slate@0.47` and `slate-react@0.22`.
---
### `0.1.0` — November 2, 2017
:tada:

View File

@ -13,8 +13,9 @@
"lib/"
],
"peerDependencies": {
"react": ">=0.14.0",
"slate": ">=0.43.6"
"react": ">=16.0.0",
"slate": ">=0.47.0",
"slate-react": ">=0.22.0"
},
"devDependencies": {
"mocha": "^2.5.3",

View File

@ -4,6 +4,34 @@ This document maintains a list of changes to the `slate-react` package with each
---
### `0.22.0` — May 8, 2019
###### BREAKING
**The `anchor.path` and `focus.path` of decorations must be relative!** Previously they were optional, and they were calculated based on the path in the top-level document. Now they are paths relative to the node being decorated! See the code highlighting example for how this is achieved, it ends up being easier than before.
**The `renderNode` middleware has been split into `renderBlock` and `renderInline`.** Previously the single middleware handled both node types. This change makes it easier to define the most common cases, and paves the way for similar serializers in the future. There is also a new `renderDocument` middleware, but most people don't need to concern themselves with it.
**The `renderMark` middleware is no longer used for decorations!** Previously `renderMark` would be used for rendering both types of decorations. Now there are separate `renderAnnotation` and `renderDecoration` middleware functions to use instead.
**You must now assign `attributes.ref` to a DOM node.** This new attribute that is passed to the rendering functions must be passed into a native DOM component (using `forwardRef` if necessary). This is required to eliminate our dependence on keys. If you are using libraries that don't implement `forwardRef` you may need to use `innerRef` or similar for this.
###### DEPRECATED
**The `find*` and `findDOM*` helpers are deprecated.** Previously you'd use these helpers to find a Slate object from a DOM object or vice versa. Now these helpers are all exposed as queries on the editor itself.
```js
// Before...
findDOMNode(key, window)
findNode(element, editor)
// After...
editor.findDOMNode(path)
editor.findNode(element)
```
---
### `0.21.0` — November 2, 2018
###### NEW

View File

@ -33,7 +33,7 @@
"peerDependencies": {
"immutable": ">=3.8.1 || >4.0.0-rc",
"react": ">=16.6.0",
"slate": ">=0.43.6"
"slate": ">=0.47.0"
},
"devDependencies": {
"immutable": "^3.8.1",

View File

@ -4,6 +4,74 @@ A list of changes to the `slate` package with each new version. Until `1.0.0` is
---
### `0.47.0` — May 8, 2019
###### NEW
**Introducing the `Annotation` model.** This is very similar to what used to be stored in `value.decorations`, except they also contain a unique "key" to be identified by. They can be used for things like comments, suggestions, collaborative cursors, etc.
```js
{
object: 'annotation',
key: String,
type: String,
data: Map,
anchor: Point,
focus: Point,
}
```
**There are three new `*_annotation` operations.** The set of operations now includes `add_annotation`, `remove_annotation` and `set_annotation`. They are similar to the existing `*_mark` operations.
**Introducing "iterable" model methods.** This introduces several iteratable-producing methods on the `Element` interface, which `Document`, `Block` and `Inline` all implement. There are iterables for traversing the entire tree:
```js
element.blocks(options)
element.descendants(options)
element.inlines(options)
element.texts(options)
element.ancestors(path, options)
element.siblings(path, options)
```
You can use them just like the native JavaScript iterables. For example, you can through the next text nodes after a specific node:
```js
for (const next of document.texts({ path: start.path })) {
const [node, path] = next
// do something with the text node or its path
}
```
Or you can traverse all of the "leaf" blocks:
```js
for (const [block] of document.blocks({ onlyLeaves: true })) {
// ...
}
```
And because these iterations use native `for/of` loops, you can easily `break` or `return` out of the loops directly—a much nicer DX than remembering to `return false`.
###### BREAKING
**The `value.decorations` property is now `value.annotations`.** Following with the split of decorations into annotations, this property was also renamed. They must now contain unique `key` properties, as they are stored as a `Map` instead of a `List`. This allows for much more performant updates.
**The `Decoration` model no longer has a nested `mark` property.** Previously a real `Mark` object was used as a property on decorations, but now the `type` and `data` properties are first class properties instead.
```js
{
object: 'decoration',
type: String,
data: Map,
anchor: Point,
focus: Point,
}
```
---
### `0.46.0` — May 1, 2019
###### BREAKING