@tiptap/extension-task-list 3.0.0-next.3 → 3.0.0-next.5
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/LICENSE.md +21 -0
- package/README.md +5 -1
- package/dist/index.cjs +11 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -34
- package/dist/index.d.ts +2 -34
- package/dist/index.js +6 -42
- package/dist/index.js.map +1 -1
- package/package.json +10 -6
- package/src/index.ts +2 -2
- package/src/task-list.ts +0 -77
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025, Tiptap GmbH
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
# @tiptap/extension-task-list
|
|
2
|
+
|
|
2
3
|
[](https://www.npmjs.com/package/@tiptap/extension-task-list)
|
|
3
4
|
[](https://npmcharts.com/compare/tiptap?minimal=true)
|
|
4
5
|
[](https://www.npmjs.com/package/@tiptap/extension-task-list)
|
|
5
6
|
[](https://github.com/sponsors/ueberdosis)
|
|
6
7
|
|
|
7
8
|
## Introduction
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as _New York Times_, _The Guardian_ or _Atlassian_.
|
|
9
11
|
|
|
10
12
|
## Official Documentation
|
|
13
|
+
|
|
11
14
|
Documentation can be found on the [Tiptap website](https://tiptap.dev).
|
|
12
15
|
|
|
13
16
|
## License
|
|
17
|
+
|
|
14
18
|
Tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md).
|
package/dist/index.cjs
CHANGED
|
@@ -18,56 +18,19 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
20
|
// src/index.ts
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
23
|
-
TaskList: () => TaskList,
|
|
24
|
-
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
TaskList: () => import_extension_list2.TaskList,
|
|
24
|
+
TaskListOptions: () => import_extension_list2.TaskListOptions,
|
|
25
|
+
default: () => index_default
|
|
25
26
|
});
|
|
26
|
-
module.exports = __toCommonJS(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
var TaskList = import_core.Node.create({
|
|
31
|
-
name: "taskList",
|
|
32
|
-
addOptions() {
|
|
33
|
-
return {
|
|
34
|
-
itemTypeName: "taskItem",
|
|
35
|
-
HTMLAttributes: {}
|
|
36
|
-
};
|
|
37
|
-
},
|
|
38
|
-
group: "block list",
|
|
39
|
-
content() {
|
|
40
|
-
return `${this.options.itemTypeName}+`;
|
|
41
|
-
},
|
|
42
|
-
parseHTML() {
|
|
43
|
-
return [
|
|
44
|
-
{
|
|
45
|
-
tag: `ul[data-type="${this.name}"]`,
|
|
46
|
-
priority: 51
|
|
47
|
-
}
|
|
48
|
-
];
|
|
49
|
-
},
|
|
50
|
-
renderHTML({ HTMLAttributes }) {
|
|
51
|
-
return ["ul", (0, import_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes, { "data-type": this.name }), 0];
|
|
52
|
-
},
|
|
53
|
-
addCommands() {
|
|
54
|
-
return {
|
|
55
|
-
toggleTaskList: () => ({ commands }) => {
|
|
56
|
-
return commands.toggleList(this.name, this.options.itemTypeName);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
},
|
|
60
|
-
addKeyboardShortcuts() {
|
|
61
|
-
return {
|
|
62
|
-
"Mod-Shift-9": () => this.editor.commands.toggleTaskList()
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
// src/index.ts
|
|
68
|
-
var src_default = TaskList;
|
|
27
|
+
module.exports = __toCommonJS(index_exports);
|
|
28
|
+
var import_extension_list = require("@tiptap/extension-list");
|
|
29
|
+
var import_extension_list2 = require("@tiptap/extension-list");
|
|
30
|
+
var index_default = import_extension_list.TaskList;
|
|
69
31
|
// Annotate the CommonJS export names for ESM import in node:
|
|
70
32
|
0 && (module.exports = {
|
|
71
|
-
TaskList
|
|
33
|
+
TaskList,
|
|
34
|
+
TaskListOptions
|
|
72
35
|
});
|
|
73
36
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { TaskList } from '@tiptap/extension-list'\n\nexport { TaskList, TaskListOptions } from '@tiptap/extension-list'\n\nexport default TaskList\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAyB;AAEzB,IAAAA,yBAA0C;AAE1C,IAAO,gBAAQ;","names":["import_extension_list"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,34 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
interface TaskListOptions {
|
|
4
|
-
/**
|
|
5
|
-
* The node type name for a task item.
|
|
6
|
-
* @default 'taskItem'
|
|
7
|
-
* @example 'myCustomTaskItem'
|
|
8
|
-
*/
|
|
9
|
-
itemTypeName: string;
|
|
10
|
-
/**
|
|
11
|
-
* The HTML attributes for a task list node.
|
|
12
|
-
* @default {}
|
|
13
|
-
* @example { class: 'foo' }
|
|
14
|
-
*/
|
|
15
|
-
HTMLAttributes: Record<string, any>;
|
|
16
|
-
}
|
|
17
|
-
declare module '@tiptap/core' {
|
|
18
|
-
interface Commands<ReturnType> {
|
|
19
|
-
taskList: {
|
|
20
|
-
/**
|
|
21
|
-
* Toggle a task list
|
|
22
|
-
* @example editor.commands.toggleTaskList()
|
|
23
|
-
*/
|
|
24
|
-
toggleTaskList: () => ReturnType;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* This extension allows you to create task lists.
|
|
30
|
-
* @see https://www.tiptap.dev/api/nodes/task-list
|
|
31
|
-
*/
|
|
32
|
-
declare const TaskList: Node<TaskListOptions, any>;
|
|
33
|
-
|
|
34
|
-
export { TaskList, type TaskListOptions, TaskList as default };
|
|
1
|
+
import { TaskList } from '@tiptap/extension-list';
|
|
2
|
+
export { TaskList, TaskListOptions, TaskList as default } from '@tiptap/extension-list';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,34 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
interface TaskListOptions {
|
|
4
|
-
/**
|
|
5
|
-
* The node type name for a task item.
|
|
6
|
-
* @default 'taskItem'
|
|
7
|
-
* @example 'myCustomTaskItem'
|
|
8
|
-
*/
|
|
9
|
-
itemTypeName: string;
|
|
10
|
-
/**
|
|
11
|
-
* The HTML attributes for a task list node.
|
|
12
|
-
* @default {}
|
|
13
|
-
* @example { class: 'foo' }
|
|
14
|
-
*/
|
|
15
|
-
HTMLAttributes: Record<string, any>;
|
|
16
|
-
}
|
|
17
|
-
declare module '@tiptap/core' {
|
|
18
|
-
interface Commands<ReturnType> {
|
|
19
|
-
taskList: {
|
|
20
|
-
/**
|
|
21
|
-
* Toggle a task list
|
|
22
|
-
* @example editor.commands.toggleTaskList()
|
|
23
|
-
*/
|
|
24
|
-
toggleTaskList: () => ReturnType;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* This extension allows you to create task lists.
|
|
30
|
-
* @see https://www.tiptap.dev/api/nodes/task-list
|
|
31
|
-
*/
|
|
32
|
-
declare const TaskList: Node<TaskListOptions, any>;
|
|
33
|
-
|
|
34
|
-
export { TaskList, type TaskListOptions, TaskList as default };
|
|
1
|
+
import { TaskList } from '@tiptap/extension-list';
|
|
2
|
+
export { TaskList, TaskListOptions, TaskList as default } from '@tiptap/extension-list';
|
package/dist/index.js
CHANGED
|
@@ -1,46 +1,10 @@
|
|
|
1
|
-
// src/task-list.ts
|
|
2
|
-
import { mergeAttributes, Node } from "@tiptap/core";
|
|
3
|
-
var TaskList = Node.create({
|
|
4
|
-
name: "taskList",
|
|
5
|
-
addOptions() {
|
|
6
|
-
return {
|
|
7
|
-
itemTypeName: "taskItem",
|
|
8
|
-
HTMLAttributes: {}
|
|
9
|
-
};
|
|
10
|
-
},
|
|
11
|
-
group: "block list",
|
|
12
|
-
content() {
|
|
13
|
-
return `${this.options.itemTypeName}+`;
|
|
14
|
-
},
|
|
15
|
-
parseHTML() {
|
|
16
|
-
return [
|
|
17
|
-
{
|
|
18
|
-
tag: `ul[data-type="${this.name}"]`,
|
|
19
|
-
priority: 51
|
|
20
|
-
}
|
|
21
|
-
];
|
|
22
|
-
},
|
|
23
|
-
renderHTML({ HTMLAttributes }) {
|
|
24
|
-
return ["ul", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { "data-type": this.name }), 0];
|
|
25
|
-
},
|
|
26
|
-
addCommands() {
|
|
27
|
-
return {
|
|
28
|
-
toggleTaskList: () => ({ commands }) => {
|
|
29
|
-
return commands.toggleList(this.name, this.options.itemTypeName);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
},
|
|
33
|
-
addKeyboardShortcuts() {
|
|
34
|
-
return {
|
|
35
|
-
"Mod-Shift-9": () => this.editor.commands.toggleTaskList()
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
|
|
40
1
|
// src/index.ts
|
|
41
|
-
|
|
2
|
+
import { TaskList } from "@tiptap/extension-list";
|
|
3
|
+
import { TaskList as TaskList2, TaskListOptions } from "@tiptap/extension-list";
|
|
4
|
+
var index_default = TaskList;
|
|
42
5
|
export {
|
|
43
|
-
TaskList,
|
|
44
|
-
|
|
6
|
+
TaskList2 as TaskList,
|
|
7
|
+
TaskListOptions,
|
|
8
|
+
index_default as default
|
|
45
9
|
};
|
|
46
10
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { TaskList } from '@tiptap/extension-list'\n\nexport { TaskList, TaskListOptions } from '@tiptap/extension-list'\n\nexport default TaskList\n"],"mappings":";AAAA,SAAS,gBAAgB;AAEzB,SAAS,YAAAA,WAAU,uBAAuB;AAE1C,IAAO,gBAAQ;","names":["TaskList"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/extension-task-list",
|
|
3
3
|
"description": "task list extension for tiptap",
|
|
4
|
-
"version": "3.0.0-next.
|
|
4
|
+
"version": "3.0.0-next.5",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
|
-
"types":
|
|
18
|
+
"types": {
|
|
19
|
+
"import": "./dist/index.d.ts",
|
|
20
|
+
"require": "./dist/index.d.cts"
|
|
21
|
+
},
|
|
19
22
|
"import": "./dist/index.js",
|
|
20
23
|
"require": "./dist/index.cjs"
|
|
21
24
|
}
|
|
@@ -28,10 +31,10 @@
|
|
|
28
31
|
"dist"
|
|
29
32
|
],
|
|
30
33
|
"devDependencies": {
|
|
31
|
-
"@tiptap/
|
|
34
|
+
"@tiptap/extension-list": "^3.0.0-next.5"
|
|
32
35
|
},
|
|
33
36
|
"peerDependencies": {
|
|
34
|
-
"@tiptap/
|
|
37
|
+
"@tiptap/extension-list": "^3.0.0-next.4"
|
|
35
38
|
},
|
|
36
39
|
"repository": {
|
|
37
40
|
"type": "git",
|
|
@@ -39,6 +42,7 @@
|
|
|
39
42
|
"directory": "packages/extension-task-list"
|
|
40
43
|
},
|
|
41
44
|
"scripts": {
|
|
42
|
-
"build": "tsup"
|
|
45
|
+
"build": "tsup",
|
|
46
|
+
"lint": "prettier ./src/ --check && eslint --cache --quiet --no-error-on-unmatched-pattern ./src/"
|
|
43
47
|
}
|
|
44
|
-
}
|
|
48
|
+
}
|
package/src/index.ts
CHANGED
package/src/task-list.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { mergeAttributes, Node } from '@tiptap/core'
|
|
2
|
-
|
|
3
|
-
export interface TaskListOptions {
|
|
4
|
-
/**
|
|
5
|
-
* The node type name for a task item.
|
|
6
|
-
* @default 'taskItem'
|
|
7
|
-
* @example 'myCustomTaskItem'
|
|
8
|
-
*/
|
|
9
|
-
itemTypeName: string,
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* The HTML attributes for a task list node.
|
|
13
|
-
* @default {}
|
|
14
|
-
* @example { class: 'foo' }
|
|
15
|
-
*/
|
|
16
|
-
HTMLAttributes: Record<string, any>,
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
declare module '@tiptap/core' {
|
|
20
|
-
interface Commands<ReturnType> {
|
|
21
|
-
taskList: {
|
|
22
|
-
/**
|
|
23
|
-
* Toggle a task list
|
|
24
|
-
* @example editor.commands.toggleTaskList()
|
|
25
|
-
*/
|
|
26
|
-
toggleTaskList: () => ReturnType,
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* This extension allows you to create task lists.
|
|
33
|
-
* @see https://www.tiptap.dev/api/nodes/task-list
|
|
34
|
-
*/
|
|
35
|
-
export const TaskList = Node.create<TaskListOptions>({
|
|
36
|
-
name: 'taskList',
|
|
37
|
-
|
|
38
|
-
addOptions() {
|
|
39
|
-
return {
|
|
40
|
-
itemTypeName: 'taskItem',
|
|
41
|
-
HTMLAttributes: {},
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
group: 'block list',
|
|
46
|
-
|
|
47
|
-
content() {
|
|
48
|
-
return `${this.options.itemTypeName}+`
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
parseHTML() {
|
|
52
|
-
return [
|
|
53
|
-
{
|
|
54
|
-
tag: `ul[data-type="${this.name}"]`,
|
|
55
|
-
priority: 51,
|
|
56
|
-
},
|
|
57
|
-
]
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
renderHTML({ HTMLAttributes }) {
|
|
61
|
-
return ['ul', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type': this.name }), 0]
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
addCommands() {
|
|
65
|
-
return {
|
|
66
|
-
toggleTaskList: () => ({ commands }) => {
|
|
67
|
-
return commands.toggleList(this.name, this.options.itemTypeName)
|
|
68
|
-
},
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
addKeyboardShortcuts() {
|
|
73
|
-
return {
|
|
74
|
-
'Mod-Shift-9': () => this.editor.commands.toggleTaskList(),
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
})
|