diff --git a/docs/reference/models/document.md b/docs/reference/models/document.md index 9d6cd0f82..129cd6d07 100644 --- a/docs/reference/models/document.md +++ b/docs/reference/models/document.md @@ -5,9 +5,11 @@ 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) - [`nodes`](#nodes) diff --git a/docs/reference/models/transform.md b/docs/reference/models/transform.md index b13108e51..f3927c5af 100644 --- a/docs/reference/models/transform.md +++ b/docs/reference/models/transform.md @@ -109,7 +109,7 @@ Insert a new block at the same level as the current block, splitting the current ### `insertFragment` `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(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(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(range: Selection, inline: Inline) => Transform` diff --git a/lib/models/state.js b/lib/models/state.js index f0c7e9e5e..23fa45a1e 100644 --- a/lib/models/state.js +++ b/lib/models/state.js @@ -785,7 +785,7 @@ class State extends new Record(DEFAULTS) { /** * Insert a `fragment` at the current selection. * - * @param {List} fragment + * @param {Document} fragment * @return {State} state */ diff --git a/lib/models/transforms.js b/lib/models/transforms.js index bbe57ab3f..1b12c6306 100644 --- a/lib/models/transforms.js +++ b/lib/models/transforms.js @@ -294,7 +294,7 @@ const Transforms = { * Insert a `fragment` at a `range`. * * @param {Selection} range - * @param {List} fragment + * @param {Document} fragment * @return {Node} node */