mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-21 22:45:18 +02:00
fix documentation references for "fragments", closes #228
This commit is contained in:
@@ -5,10 +5,12 @@
|
|||||||
import { Document } from 'slate'
|
import { Document } from 'slate'
|
||||||
```
|
```
|
||||||
|
|
||||||
The top-level node in Slate.
|
The top-level node in Slate's document model.
|
||||||
|
|
||||||
Documents are made up of block nodes, inline nodes, and text nodes—just like in the DOM.
|
Documents are made up of block nodes, inline nodes, and text nodes—just like in the DOM.
|
||||||
|
|
||||||
|
In some places, you'll see mention of "fragments", which are also `Document` objects, just that aren't attached to the main `State`. For example, when cutting-and-pasting a selection of content, that content will be referred to as a document "fragment".
|
||||||
|
|
||||||
- [Properties](#properties)
|
- [Properties](#properties)
|
||||||
- [`nodes`](#nodes)
|
- [`nodes`](#nodes)
|
||||||
- [Computed Properties](#computed-properties)
|
- [Computed Properties](#computed-properties)
|
||||||
|
@@ -109,7 +109,7 @@ Insert a new block at the same level as the current block, splitting the current
|
|||||||
### `insertFragment`
|
### `insertFragment`
|
||||||
`insertFragment(fragment: Document) => Transform`
|
`insertFragment(fragment: Document) => Transform`
|
||||||
|
|
||||||
Insert a `fragment` at the current selection. If the selection is expanded, it will be deleted first.
|
Insert a [`fragment`](./document.md) at the current selection. If the selection is expanded, it will be deleted first.
|
||||||
|
|
||||||
### `insertInline`
|
### `insertInline`
|
||||||
`insertInline(inline: Inline) => Transform`
|
`insertInline(inline: Inline) => Transform`
|
||||||
@@ -290,7 +290,7 @@ Insert a new block at the same level as the leaf block at a `range`, splitting t
|
|||||||
### `insertFragmentAtRange`
|
### `insertFragmentAtRange`
|
||||||
`insertFragmentAtRange(range: Selection, fragment: Document) => Transform`
|
`insertFragmentAtRange(range: Selection, fragment: Document) => Transform`
|
||||||
|
|
||||||
Insert a `fragment` at a `range`. If the selection is expanded, it will be deleted first.
|
Insert a [`fragment`](./document.md) at a `range`. If the selection is expanded, it will be deleted first.
|
||||||
|
|
||||||
### `insertInlineAtRange`
|
### `insertInlineAtRange`
|
||||||
`insertInlineAtRange(range: Selection, inline: Inline) => Transform`
|
`insertInlineAtRange(range: Selection, inline: Inline) => Transform`
|
||||||
|
@@ -785,7 +785,7 @@ class State extends new Record(DEFAULTS) {
|
|||||||
/**
|
/**
|
||||||
* Insert a `fragment` at the current selection.
|
* Insert a `fragment` at the current selection.
|
||||||
*
|
*
|
||||||
* @param {List} fragment
|
* @param {Document} fragment
|
||||||
* @return {State} state
|
* @return {State} state
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -294,7 +294,7 @@ const Transforms = {
|
|||||||
* Insert a `fragment` at a `range`.
|
* Insert a `fragment` at a `range`.
|
||||||
*
|
*
|
||||||
* @param {Selection} range
|
* @param {Selection} range
|
||||||
* @param {List} fragment
|
* @param {Document} fragment
|
||||||
* @return {Node} node
|
* @return {Node} node
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user