mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-31 02:49:56 +02:00
fixes for style and consistency
This commit is contained in:
@@ -13,7 +13,7 @@ Transform methods can either operate on the [`Document`](./document.md), the [`S
|
|||||||
|
|
||||||
- [Methods](#methods)
|
- [Methods](#methods)
|
||||||
- [`apply`](#apply)
|
- [`apply`](#apply)
|
||||||
- [Document & Selection Transforms](#document-selection-transforms)
|
- [Current State Transforms](#current-state-transforms)
|
||||||
- [`deleteBackward`](#deletebackward)
|
- [`deleteBackward`](#deletebackward)
|
||||||
- [`deleteForward`](#deleteforward)
|
- [`deleteForward`](#deleteforward)
|
||||||
- [`delete`](#delete)
|
- [`delete`](#delete)
|
||||||
@@ -43,6 +43,8 @@ Transform methods can either operate on the [`Document`](./document.md), the [`S
|
|||||||
- [`moveToRangeOf`](#movetorangeof)
|
- [`moveToRangeOf`](#movetorangeof)
|
||||||
- [`moveTo`](#moveto)
|
- [`moveTo`](#moveto)
|
||||||
- [`move{Direction}`](#movedirection)
|
- [`move{Direction}`](#movedirection)
|
||||||
|
- [Node Transforms](#node-transforms)
|
||||||
|
- [`setNodeByKey`](#setNodeByKey)
|
||||||
- [Document Transforms](#document-transforms)
|
- [Document Transforms](#document-transforms)
|
||||||
- [`deleteAtRange`](#deleteatrange)
|
- [`deleteAtRange`](#deleteatrange)
|
||||||
- [`deleteBackwardAtRange`](#deletebackwardatrange)
|
- [`deleteBackwardAtRange`](#deletebackwardatrange)
|
||||||
@@ -60,7 +62,6 @@ Transform methods can either operate on the [`Document`](./document.md), the [`S
|
|||||||
- [`unwrapInlineAtRange`](#unwrapinlineatrange)
|
- [`unwrapInlineAtRange`](#unwrapinlineatrange)
|
||||||
- [`wrapBlockAtRange`](#wrapblockatrange)
|
- [`wrapBlockAtRange`](#wrapblockatrange)
|
||||||
- [`wrapInlineAtRange`](#wrapinlineatrange)
|
- [`wrapInlineAtRange`](#wrapinlineatrange)
|
||||||
- [`setNodeByKey`](#setNodeByKey)
|
|
||||||
- [History Transforms](#history-transforms)
|
- [History Transforms](#history-transforms)
|
||||||
- [`redo`](#redo)
|
- [`redo`](#redo)
|
||||||
- [`undo`](#undo)
|
- [`undo`](#undo)
|
||||||
@@ -76,7 +77,7 @@ Applies all of the current transform steps, returning the newly transformed [`St
|
|||||||
- `snapshot: Boolean` — override the editor's built-in logic of whether to create a new snapshot in the history, that can be reverted to later.
|
- `snapshot: Boolean` — override the editor's built-in logic of whether to create a new snapshot in the history, that can be reverted to later.
|
||||||
|
|
||||||
|
|
||||||
## Document & Selection Transforms
|
## Current State Transforms
|
||||||
|
|
||||||
### `deleteBackward`
|
### `deleteBackward`
|
||||||
`deleteBackward(n: Number) => Transform`
|
`deleteBackward(n: Number) => Transform`
|
||||||
@@ -230,6 +231,15 @@ Move the current selection's anchor point to the start of a `node` and its focus
|
|||||||
Move the current selection to a selection with merged `properties`. The `properties` can either be a [`Selection`](./selection.md) object or a plain Javascript object of selection properties.
|
Move the current selection to a selection with merged `properties`. The `properties` can either be a [`Selection`](./selection.md) object or a plain Javascript object of selection properties.
|
||||||
|
|
||||||
|
|
||||||
|
## Node Transforms
|
||||||
|
|
||||||
|
### `setNodeByKey`
|
||||||
|
`setNodeByKey(key: String, properties: Object) => Transform`
|
||||||
|
`setNodeByKey(key: String, type: String) => Transform`
|
||||||
|
|
||||||
|
Set a dictionary of `properties` on the [`Node`](./node.md) with a `key`. For convenience, you can pass a `type` string or `properties` object.
|
||||||
|
|
||||||
|
|
||||||
## Document Transforms
|
## Document Transforms
|
||||||
|
|
||||||
### `deleteBackwardAtRange`
|
### `deleteBackwardAtRange`
|
||||||
@@ -320,12 +330,6 @@ Wrap the [`Block`](./block.md) nodes in a `range` with a new [`Block`](./block.m
|
|||||||
|
|
||||||
Wrap the [`Inline`](./inline.md) nodes in a `range` with a new [`Inline`](./inline.md) node of `type`, with optional `data`.
|
Wrap the [`Inline`](./inline.md) nodes in a `range` with a new [`Inline`](./inline.md) node of `type`, with optional `data`.
|
||||||
|
|
||||||
### `setNodeByKey`
|
|
||||||
`setNodeByKey(key: String, properties: Object) => Transform`
|
|
||||||
`setNodeByKey(key: String, type: String) => Transform`
|
|
||||||
|
|
||||||
Set the properties of the [`Node`](./node.md) having the specified `key`.
|
|
||||||
|
|
||||||
|
|
||||||
## History Transforms
|
## History Transforms
|
||||||
|
|
||||||
|
@@ -902,7 +902,7 @@ const Transforms = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modify a block.
|
* Set `properties` on a node by `key`.
|
||||||
*
|
*
|
||||||
* @param {String} key
|
* @param {String} key
|
||||||
* @param {Object or String} properties
|
* @param {Object or String} properties
|
||||||
|
Reference in New Issue
Block a user