docs(docs): 📝 add missing documentation for commands
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
# sinkListItem
|
# sinkListItem
|
||||||
|
The `sinkListItem` will try to sink the list item around the current selection down into a wrapping child list.
|
||||||
|
|
||||||
:::warning
|
## Usage
|
||||||
Oops, we didn’t find time to fill this page. Writing documentation needs attention to detail, a great understanding of the project and time to write. Though Tiptap is used by thousands of developers all around the world, it’s still a side project for us. Let’s change that and make open source our full-time job! [Become a sponsor!](https://github.com/sponsors/ueberdosis)
|
```js
|
||||||
:::
|
editor.commands.liftListItem()
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,5 +1,16 @@
|
|||||||
# splitBlock
|
# splitBlock
|
||||||
|
`splitBlock` will split the current node into two nodes at the current [NodeSelection](https://prosemirror.net/docs/ref/#state.NodeSelection). If the current selection is not splittable, the command will be ignored.
|
||||||
|
|
||||||
:::warning
|
## Parameters
|
||||||
Oops, we didn’t find time to fill this page. Writing documentation needs attention to detail, a great understanding of the project and time to write. Though Tiptap is used by thousands of developers all around the world, it’s still a side project for us. Let’s change that and make open source our full-time job! [Become a sponsor!](https://github.com/sponsors/ueberdosis)
|
`options: Record<string, any>`
|
||||||
:::
|
|
||||||
|
* `keepMarks: boolean` - Defines if the marks should be kept or removed. Defaults to `true`.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
```js
|
||||||
|
// split the current node and keep marks
|
||||||
|
editor.commands.splitBlock()
|
||||||
|
|
||||||
|
// split the current node and don't keep marks
|
||||||
|
editor.commands.splitBlock({ keepMarks: false })
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
# splitListItem
|
# splitListItem
|
||||||
|
`splitListItem` splits one list item into two separate list items. If this is a nested list, the wrapping list item should be split.
|
||||||
|
|
||||||
:::warning
|
## Parameters
|
||||||
Oops, we didn’t find time to fill this page. Writing documentation needs attention to detail, a great understanding of the project and time to write. Though Tiptap is used by thousands of developers all around the world, it’s still a side project for us. Let’s change that and make open source our full-time job! [Become a sponsor!](https://github.com/sponsors/ueberdosis)
|
`typeOrName: string | NodeType`
|
||||||
:::
|
|
||||||
|
The type of node that should be split into two separate list items.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
```js
|
||||||
|
editor.commands.splitListItem('bullet_list')
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,5 +1,20 @@
|
|||||||
# toggleList
|
# toggleList
|
||||||
|
`toggleList` will toggle between different types of lists.
|
||||||
|
|
||||||
:::warning
|
## Parameters
|
||||||
Oops, we didn’t find time to fill this page. Writing documentation needs attention to detail, a great understanding of the project and time to write. Though Tiptap is used by thousands of developers all around the world, it’s still a side project for us. Let’s change that and make open source our full-time job! [Become a sponsor!](https://github.com/sponsors/ueberdosis)
|
`listTypeOrName: string | NodeType`
|
||||||
:::
|
|
||||||
|
The type of node that should be used for the wrapping list
|
||||||
|
|
||||||
|
`itemTypeOrName: string | NodeType`
|
||||||
|
|
||||||
|
The type of node that should be used for the list items
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
```js
|
||||||
|
// toggle a bullet list with list items
|
||||||
|
editor.commands.toggleList('bullet_list', 'list_item')
|
||||||
|
|
||||||
|
// toggle a numbered list with list items
|
||||||
|
editor.commands.toggleList('ordered_list', 'list_item')
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
# toggleMark
|
# toggleMark
|
||||||
|
The `toggleMark` command toggles a specific mark on and off at the current selection.
|
||||||
|
|
||||||
:::warning
|
## Parameters
|
||||||
Oops, we didn’t find time to fill this page. Writing documentation needs attention to detail, a great understanding of the project and time to write. Though Tiptap is used by thousands of developers all around the world, it’s still a side project for us. Let’s change that and make open source our full-time job! [Become a sponsor!](https://github.com/sponsors/ueberdosis)
|
`typeOrName: string | MarkType`
|
||||||
:::
|
|
||||||
|
The type of mark that should be toggled.
|
||||||
|
|
||||||
|
`attributes?: Record<string, any>`
|
||||||
|
|
||||||
|
The attributes that should be applied to the mark. **This is optional.**
|
||||||
|
|
||||||
|
`options?: Record<string, any>`
|
||||||
|
* `extendEmptyMarkRange: boolean` - Removes the mark even across the current selection. Defaults to `false`
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
```js
|
||||||
|
// toggles a bold mark
|
||||||
|
editor.commands.toggleMark('bold')
|
||||||
|
|
||||||
|
// toggles bold mark with a color attribute
|
||||||
|
editor.commands.toggleMark('bold', { color: 'red' })
|
||||||
|
|
||||||
|
// toggles a bold mark with a color attribute and removes the mark across the current selection
|
||||||
|
editor.commands.toggleMark('bold', { color: 'red' }, { extendEmptyMarkRange: true })
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,5 +1,24 @@
|
|||||||
# toggleNode
|
# toggleNode
|
||||||
|
`toggleNode` will a node with another node.
|
||||||
|
|
||||||
:::warning
|
## Parameters
|
||||||
Oops, we didn’t find time to fill this page. Writing documentation needs attention to detail, a great understanding of the project and time to write. Though Tiptap is used by thousands of developers all around the world, it’s still a side project for us. Let’s change that and make open source our full-time job! [Become a sponsor!](https://github.com/sponsors/ueberdosis)
|
`typeOrName: string | NodeType`
|
||||||
:::
|
|
||||||
|
The type of node that should be toggled.
|
||||||
|
|
||||||
|
`toggleTypeOrName: string | NodeType`
|
||||||
|
|
||||||
|
The type of node that should be used for the toggling.
|
||||||
|
|
||||||
|
`attributes?: Record<string, any>`
|
||||||
|
|
||||||
|
The attributes that should be applied to the node. **This is optional.**
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
```js
|
||||||
|
// toggle a paragraph with a heading node
|
||||||
|
editor.commands.toggleNode('paragraph', 'heading', { level: 1 })
|
||||||
|
|
||||||
|
// toggle a paragraph with a image node
|
||||||
|
editor.commands.toggleNode('paragraph', 'image', { src: 'https://example.com/image.png' })
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
# toggleWrap
|
# toggleWrap
|
||||||
|
`toggleWrap` wraps the current node with a new node or removes a wrapping node.
|
||||||
|
|
||||||
:::warning
|
## Parameters
|
||||||
Oops, we didn’t find time to fill this page. Writing documentation needs attention to detail, a great understanding of the project and time to write. Though Tiptap is used by thousands of developers all around the world, it’s still a side project for us. Let’s change that and make open source our full-time job! [Become a sponsor!](https://github.com/sponsors/ueberdosis)
|
`typeOrName: string | NodeType`
|
||||||
:::
|
|
||||||
|
The type of node that should be used for the wrapping node.
|
||||||
|
|
||||||
|
`attributes?: Record<string, any>`
|
||||||
|
|
||||||
|
The attributes that should be applied to the node. **This is optional.**
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
```js
|
||||||
|
// toggle wrap the current selection with a heading node
|
||||||
|
editor.commands.toggleWrap('heading', { level: 1 })
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# undoInputRule
|
# undoInputRule
|
||||||
|
`undoInputRule` will undo the most recent input rule that was triggered.
|
||||||
|
|
||||||
:::warning
|
## Usage
|
||||||
Oops, we didn’t find time to fill this page. Writing documentation needs attention to detail, a great understanding of the project and time to write. Though Tiptap is used by thousands of developers all around the world, it’s still a side project for us. Let’s change that and make open source our full-time job! [Become a sponsor!](https://github.com/sponsors/ueberdosis)
|
```js
|
||||||
:::
|
editor.commands.undoInputRule()
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# unsetAllMarks
|
# unsetAllMarks
|
||||||
|
`unsetAllMarks` will remove all marks from the current selection.
|
||||||
|
|
||||||
:::warning
|
## Usage
|
||||||
Oops, we didn’t find time to fill this page. Writing documentation needs attention to detail, a great understanding of the project and time to write. Though Tiptap is used by thousands of developers all around the world, it’s still a side project for us. Let’s change that and make open source our full-time job! [Become a sponsor!](https://github.com/sponsors/ueberdosis)
|
```js
|
||||||
:::
|
editor.commands.unsetAllMarks()
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,5 +1,20 @@
|
|||||||
# unsetMark
|
# unsetMark
|
||||||
|
`unsetMark` will remove the mark from the current selection. Can also remove all marks across the current selection.
|
||||||
|
|
||||||
:::warning
|
## Parameters
|
||||||
Oops, we didn’t find time to fill this page. Writing documentation needs attention to detail, a great understanding of the project and time to write. Though Tiptap is used by thousands of developers all around the world, it’s still a side project for us. Let’s change that and make open source our full-time job! [Become a sponsor!](https://github.com/sponsors/ueberdosis)
|
`typeOrName: string | MarkType`
|
||||||
:::
|
|
||||||
|
The type of mark that should be removed.
|
||||||
|
|
||||||
|
`options?: Record<string, any>`
|
||||||
|
|
||||||
|
* `extendEmptyMarkRange?: boolean` - Removes the mark even across the current selection. Defaults to `false`
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
```js
|
||||||
|
// removes a bold mark
|
||||||
|
editor.commands.unsetMark('bold')
|
||||||
|
|
||||||
|
// removes a bold mark across the current selection
|
||||||
|
editor.commands.unsetMark('bold', { extendEmptyMarkRange: true })
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,5 +1,17 @@
|
|||||||
# wrapInList
|
# wrapInList
|
||||||
|
`wrapInList` will wrap a node in the current selection in a list.
|
||||||
|
|
||||||
:::warning
|
## Parameters
|
||||||
Oops, we didn’t find time to fill this page. Writing documentation needs attention to detail, a great understanding of the project and time to write. Though Tiptap is used by thousands of developers all around the world, it’s still a side project for us. Let’s change that and make open source our full-time job! [Become a sponsor!](https://github.com/sponsors/ueberdosis)
|
`typeOrName: string | NodeType`
|
||||||
:::
|
|
||||||
|
The type of node that should be wrapped in a list.
|
||||||
|
|
||||||
|
`attributes?: Record<string, any>`
|
||||||
|
|
||||||
|
The attributes that should be applied to the list. **This is optional.**
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
```js
|
||||||
|
// wrap a paragraph in a bullet list
|
||||||
|
editor.commands.wrapInList('paragraph')
|
||||||
|
```
|
||||||
|
|||||||
@@ -222,39 +222,28 @@
|
|||||||
link: /api/commands/set-text-selection
|
link: /api/commands/set-text-selection
|
||||||
- title: sinkListItem
|
- title: sinkListItem
|
||||||
link: /api/commands/sink-list-item
|
link: /api/commands/sink-list-item
|
||||||
type: draft
|
|
||||||
- title: splitBlock
|
- title: splitBlock
|
||||||
link: /api/commands/split-block
|
link: /api/commands/split-block
|
||||||
type: draft
|
|
||||||
- title: splitListItem
|
- title: splitListItem
|
||||||
link: /api/commands/split-list-item
|
link: /api/commands/split-list-item
|
||||||
type: draft
|
|
||||||
- title: toggleList
|
- title: toggleList
|
||||||
link: /api/commands/toggle-list
|
link: /api/commands/toggle-list
|
||||||
type: draft
|
|
||||||
- title: toggleMark
|
- title: toggleMark
|
||||||
link: /api/commands/toggle-mark
|
link: /api/commands/toggle-mark
|
||||||
type: draft
|
|
||||||
- title: toggleNode
|
- title: toggleNode
|
||||||
link: /api/commands/toggle-node
|
link: /api/commands/toggle-node
|
||||||
type: draft
|
|
||||||
- title: toggleWrap
|
- title: toggleWrap
|
||||||
link: /api/commands/toggle-wrap
|
link: /api/commands/toggle-wrap
|
||||||
type: draft
|
|
||||||
- title: undoInputRule
|
- title: undoInputRule
|
||||||
link: /api/commands/undo-input-rule
|
link: /api/commands/undo-input-rule
|
||||||
type: draft
|
|
||||||
- title: unsetAllMarks
|
- title: unsetAllMarks
|
||||||
link: /api/commands/unset-all-marks
|
link: /api/commands/unset-all-marks
|
||||||
type: draft
|
|
||||||
- title: unsetMark
|
- title: unsetMark
|
||||||
link: /api/commands/unset-mark
|
link: /api/commands/unset-mark
|
||||||
type: draft
|
|
||||||
- title: updateAttributes
|
- title: updateAttributes
|
||||||
link: /api/commands/update-attributes
|
link: /api/commands/update-attributes
|
||||||
- title: wrapInList
|
- title: wrapInList
|
||||||
link: /api/commands/wrap-in-list
|
link: /api/commands/wrap-in-list
|
||||||
type: draft
|
|
||||||
- title: Nodes
|
- title: Nodes
|
||||||
link: /api/nodes
|
link: /api/nodes
|
||||||
items:
|
items:
|
||||||
|
|||||||
Reference in New Issue
Block a user