@tiptap/extension-list 3.24.0 → 3.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +180 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +157 -44
- package/dist/index.js.map +1 -1
- package/dist/item/index.cjs +120 -3
- package/dist/item/index.cjs.map +1 -1
- package/dist/item/index.js +117 -0
- package/dist/item/index.js.map +1 -1
- package/dist/keymap/index.cjs +37 -47
- package/dist/keymap/index.cjs.map +1 -1
- package/dist/keymap/index.js +30 -40
- package/dist/keymap/index.js.map +1 -1
- package/dist/kit/index.cjs +180 -67
- package/dist/kit/index.cjs.map +1 -1
- package/dist/kit/index.js +157 -44
- package/dist/kit/index.js.map +1 -1
- package/dist/task-item/index.cjs +120 -5
- package/dist/task-item/index.cjs.map +1 -1
- package/dist/task-item/index.js +115 -0
- package/dist/task-item/index.js.map +1 -1
- package/package.json +5 -5
- package/src/helpers/createBranchingListDeleteKeymap.ts +24 -0
- package/src/helpers/getBranchingNestedListAtCursor.ts +116 -0
- package/src/helpers/handleDeleteBranchingNestedList.ts +25 -0
- package/src/helpers/hasBranchingNestedListAfterCursor.ts +30 -0
- package/src/helpers/hoistBranchingNestedList.ts +56 -0
- package/src/item/list-item.ts +11 -0
- package/src/keymap/listHelpers/handleBackspace.ts +3 -22
- package/src/task-item/task-item.ts +10 -0
|
@@ -8,6 +8,8 @@ import {
|
|
|
8
8
|
} from '@tiptap/core'
|
|
9
9
|
import type { Node as ProseMirrorNode } from '@tiptap/pm/model'
|
|
10
10
|
|
|
11
|
+
import { createBranchingListDeleteKeymap } from '../helpers/createBranchingListDeleteKeymap.js'
|
|
12
|
+
|
|
11
13
|
export interface TaskItemOptions {
|
|
12
14
|
/**
|
|
13
15
|
* A callback function that is called when the checkbox is clicked while the editor is in readonly mode.
|
|
@@ -158,6 +160,14 @@ export const TaskItem = Node.create<TaskItemOptions>({
|
|
|
158
160
|
return renderNestedMarkdownContent(node, h, prefix)
|
|
159
161
|
},
|
|
160
162
|
|
|
163
|
+
addExtensions() {
|
|
164
|
+
if (!this.options.nested) {
|
|
165
|
+
return []
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return [createBranchingListDeleteKeymap(this.name, [this.options.taskListTypeName])]
|
|
169
|
+
},
|
|
170
|
+
|
|
161
171
|
addKeyboardShortcuts() {
|
|
162
172
|
const shortcuts: {
|
|
163
173
|
[key: string]: KeyboardShortcutCommand
|