@tiptap/extension-task-list 2.0.0-beta.23 → 2.0.0-beta.24
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/tiptap-extension-task-list.cjs.js +3 -3
- package/dist/tiptap-extension-task-list.cjs.js.map +1 -1
- package/dist/tiptap-extension-task-list.esm.js +3 -3
- package/dist/tiptap-extension-task-list.esm.js.map +1 -1
- package/dist/tiptap-extension-task-list.umd.js +3 -3
- package/dist/tiptap-extension-task-list.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/task-list.ts +3 -3
|
@@ -16,18 +16,18 @@ const TaskList = core.Node.create({
|
|
|
16
16
|
parseHTML() {
|
|
17
17
|
return [
|
|
18
18
|
{
|
|
19
|
-
tag:
|
|
19
|
+
tag: `ul[data-type="${this.name}"]`,
|
|
20
20
|
priority: 51,
|
|
21
21
|
},
|
|
22
22
|
];
|
|
23
23
|
},
|
|
24
24
|
renderHTML({ HTMLAttributes }) {
|
|
25
|
-
return ['ul', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type':
|
|
25
|
+
return ['ul', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type': this.name }), 0];
|
|
26
26
|
},
|
|
27
27
|
addCommands() {
|
|
28
28
|
return {
|
|
29
29
|
toggleTaskList: () => ({ commands }) => {
|
|
30
|
-
return commands.toggleList(
|
|
30
|
+
return commands.toggleList(this.name, 'taskItem');
|
|
31
31
|
},
|
|
32
32
|
};
|
|
33
33
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiptap-extension-task-list.cjs.js","sources":["../src/task-list.ts"],"sourcesContent":["import { Node, mergeAttributes } from '@tiptap/core'\n\nexport interface TaskListOptions {\n HTMLAttributes: Record<string, any>,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n taskList: {\n /**\n * Toggle a task list\n */\n toggleTaskList: () => ReturnType,\n }\n }\n}\n\nexport const TaskList = Node.create<TaskListOptions>({\n name: 'taskList',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n group: 'block list',\n\n content: 'taskItem+',\n\n parseHTML() {\n return [\n {\n tag:
|
|
1
|
+
{"version":3,"file":"tiptap-extension-task-list.cjs.js","sources":["../src/task-list.ts"],"sourcesContent":["import { Node, mergeAttributes } from '@tiptap/core'\n\nexport interface TaskListOptions {\n HTMLAttributes: Record<string, any>,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n taskList: {\n /**\n * Toggle a task list\n */\n toggleTaskList: () => ReturnType,\n }\n }\n}\n\nexport const TaskList = Node.create<TaskListOptions>({\n name: 'taskList',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n group: 'block list',\n\n content: 'taskItem+',\n\n parseHTML() {\n return [\n {\n tag: `ul[data-type=\"${this.name}\"]`,\n priority: 51,\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['ul', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type': this.name }), 0]\n },\n\n addCommands() {\n return {\n toggleTaskList: () => ({ commands }) => {\n return commands.toggleList(this.name, 'taskItem')\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Shift-9': () => this.editor.commands.toggleTaskList(),\n }\n },\n})\n"],"names":["Node","mergeAttributes"],"mappings":";;;;;;MAiBa,QAAQ,GAAGA,SAAI,CAAC,MAAM,CAAkB;IACnD,IAAI,EAAE,UAAU;IAEhB,UAAU;QACR,OAAO;YACL,cAAc,EAAE,EAAE;SACnB,CAAA;KACF;IAED,KAAK,EAAE,YAAY;IAEnB,OAAO,EAAE,WAAW;IAEpB,SAAS;QACP,OAAO;YACL;gBACE,GAAG,EAAE,iBAAiB,IAAI,CAAC,IAAI,IAAI;gBACnC,QAAQ,EAAE,EAAE;aACb;SACF,CAAA;KACF;IAED,UAAU,CAAC,EAAE,cAAc,EAAE;QAC3B,OAAO,CAAC,IAAI,EAAEC,oBAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;KAC3G;IAED,WAAW;QACT,OAAO;YACL,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;gBACjC,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;aAClD;SACF,CAAA;KACF;IAED,oBAAoB;QAClB,OAAO;YACL,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE;SAC3D,CAAA;KACF;CACF;;;;;"}
|
|
@@ -12,18 +12,18 @@ const TaskList = Node.create({
|
|
|
12
12
|
parseHTML() {
|
|
13
13
|
return [
|
|
14
14
|
{
|
|
15
|
-
tag:
|
|
15
|
+
tag: `ul[data-type="${this.name}"]`,
|
|
16
16
|
priority: 51,
|
|
17
17
|
},
|
|
18
18
|
];
|
|
19
19
|
},
|
|
20
20
|
renderHTML({ HTMLAttributes }) {
|
|
21
|
-
return ['ul', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type':
|
|
21
|
+
return ['ul', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type': this.name }), 0];
|
|
22
22
|
},
|
|
23
23
|
addCommands() {
|
|
24
24
|
return {
|
|
25
25
|
toggleTaskList: () => ({ commands }) => {
|
|
26
|
-
return commands.toggleList(
|
|
26
|
+
return commands.toggleList(this.name, 'taskItem');
|
|
27
27
|
},
|
|
28
28
|
};
|
|
29
29
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiptap-extension-task-list.esm.js","sources":["../src/task-list.ts"],"sourcesContent":["import { Node, mergeAttributes } from '@tiptap/core'\n\nexport interface TaskListOptions {\n HTMLAttributes: Record<string, any>,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n taskList: {\n /**\n * Toggle a task list\n */\n toggleTaskList: () => ReturnType,\n }\n }\n}\n\nexport const TaskList = Node.create<TaskListOptions>({\n name: 'taskList',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n group: 'block list',\n\n content: 'taskItem+',\n\n parseHTML() {\n return [\n {\n tag:
|
|
1
|
+
{"version":3,"file":"tiptap-extension-task-list.esm.js","sources":["../src/task-list.ts"],"sourcesContent":["import { Node, mergeAttributes } from '@tiptap/core'\n\nexport interface TaskListOptions {\n HTMLAttributes: Record<string, any>,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n taskList: {\n /**\n * Toggle a task list\n */\n toggleTaskList: () => ReturnType,\n }\n }\n}\n\nexport const TaskList = Node.create<TaskListOptions>({\n name: 'taskList',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n group: 'block list',\n\n content: 'taskItem+',\n\n parseHTML() {\n return [\n {\n tag: `ul[data-type=\"${this.name}\"]`,\n priority: 51,\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['ul', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type': this.name }), 0]\n },\n\n addCommands() {\n return {\n toggleTaskList: () => ({ commands }) => {\n return commands.toggleList(this.name, 'taskItem')\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Shift-9': () => this.editor.commands.toggleTaskList(),\n }\n },\n})\n"],"names":[],"mappings":";;MAiBa,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAkB;IACnD,IAAI,EAAE,UAAU;IAEhB,UAAU;QACR,OAAO;YACL,cAAc,EAAE,EAAE;SACnB,CAAA;KACF;IAED,KAAK,EAAE,YAAY;IAEnB,OAAO,EAAE,WAAW;IAEpB,SAAS;QACP,OAAO;YACL;gBACE,GAAG,EAAE,iBAAiB,IAAI,CAAC,IAAI,IAAI;gBACnC,QAAQ,EAAE,EAAE;aACb;SACF,CAAA;KACF;IAED,UAAU,CAAC,EAAE,cAAc,EAAE;QAC3B,OAAO,CAAC,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;KAC3G;IAED,WAAW;QACT,OAAO;YACL,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;gBACjC,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;aAClD;SACF,CAAA;KACF;IAED,oBAAoB;QAClB,OAAO;YACL,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE;SAC3D,CAAA;KACF;CACF;;;;"}
|
|
@@ -16,18 +16,18 @@
|
|
|
16
16
|
parseHTML() {
|
|
17
17
|
return [
|
|
18
18
|
{
|
|
19
|
-
tag:
|
|
19
|
+
tag: `ul[data-type="${this.name}"]`,
|
|
20
20
|
priority: 51,
|
|
21
21
|
},
|
|
22
22
|
];
|
|
23
23
|
},
|
|
24
24
|
renderHTML({ HTMLAttributes }) {
|
|
25
|
-
return ['ul', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type':
|
|
25
|
+
return ['ul', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type': this.name }), 0];
|
|
26
26
|
},
|
|
27
27
|
addCommands() {
|
|
28
28
|
return {
|
|
29
29
|
toggleTaskList: () => ({ commands }) => {
|
|
30
|
-
return commands.toggleList(
|
|
30
|
+
return commands.toggleList(this.name, 'taskItem');
|
|
31
31
|
},
|
|
32
32
|
};
|
|
33
33
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiptap-extension-task-list.umd.js","sources":["../src/task-list.ts"],"sourcesContent":["import { Node, mergeAttributes } from '@tiptap/core'\n\nexport interface TaskListOptions {\n HTMLAttributes: Record<string, any>,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n taskList: {\n /**\n * Toggle a task list\n */\n toggleTaskList: () => ReturnType,\n }\n }\n}\n\nexport const TaskList = Node.create<TaskListOptions>({\n name: 'taskList',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n group: 'block list',\n\n content: 'taskItem+',\n\n parseHTML() {\n return [\n {\n tag:
|
|
1
|
+
{"version":3,"file":"tiptap-extension-task-list.umd.js","sources":["../src/task-list.ts"],"sourcesContent":["import { Node, mergeAttributes } from '@tiptap/core'\n\nexport interface TaskListOptions {\n HTMLAttributes: Record<string, any>,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n taskList: {\n /**\n * Toggle a task list\n */\n toggleTaskList: () => ReturnType,\n }\n }\n}\n\nexport const TaskList = Node.create<TaskListOptions>({\n name: 'taskList',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n group: 'block list',\n\n content: 'taskItem+',\n\n parseHTML() {\n return [\n {\n tag: `ul[data-type=\"${this.name}\"]`,\n priority: 51,\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['ul', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type': this.name }), 0]\n },\n\n addCommands() {\n return {\n toggleTaskList: () => ({ commands }) => {\n return commands.toggleList(this.name, 'taskItem')\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Shift-9': () => this.editor.commands.toggleTaskList(),\n }\n },\n})\n"],"names":["Node","mergeAttributes"],"mappings":";;;;;;QAiBa,QAAQ,GAAGA,SAAI,CAAC,MAAM,CAAkB;MACnD,IAAI,EAAE,UAAU;MAEhB,UAAU;UACR,OAAO;cACL,cAAc,EAAE,EAAE;WACnB,CAAA;OACF;MAED,KAAK,EAAE,YAAY;MAEnB,OAAO,EAAE,WAAW;MAEpB,SAAS;UACP,OAAO;cACL;kBACE,GAAG,EAAE,iBAAiB,IAAI,CAAC,IAAI,IAAI;kBACnC,QAAQ,EAAE,EAAE;eACb;WACF,CAAA;OACF;MAED,UAAU,CAAC,EAAE,cAAc,EAAE;UAC3B,OAAO,CAAC,IAAI,EAAEC,oBAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;OAC3G;MAED,WAAW;UACT,OAAO;cACL,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;kBACjC,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;eAClD;WACF,CAAA;OACF;MAED,oBAAoB;UAClB,OAAO;cACL,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE;WAC3D,CAAA;OACF;GACF;;;;;;;;;;;"}
|
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": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.24",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"url": "https://github.com/ueberdosis/tiptap",
|
|
29
29
|
"directory": "packages/extension-task-list"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "270543995c92243fc27c4a688af6a93033fb4b7e"
|
|
32
32
|
}
|
package/src/task-list.ts
CHANGED
|
@@ -31,20 +31,20 @@ export const TaskList = Node.create<TaskListOptions>({
|
|
|
31
31
|
parseHTML() {
|
|
32
32
|
return [
|
|
33
33
|
{
|
|
34
|
-
tag:
|
|
34
|
+
tag: `ul[data-type="${this.name}"]`,
|
|
35
35
|
priority: 51,
|
|
36
36
|
},
|
|
37
37
|
]
|
|
38
38
|
},
|
|
39
39
|
|
|
40
40
|
renderHTML({ HTMLAttributes }) {
|
|
41
|
-
return ['ul', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type':
|
|
41
|
+
return ['ul', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type': this.name }), 0]
|
|
42
42
|
},
|
|
43
43
|
|
|
44
44
|
addCommands() {
|
|
45
45
|
return {
|
|
46
46
|
toggleTaskList: () => ({ commands }) => {
|
|
47
|
-
return commands.toggleList(
|
|
47
|
+
return commands.toggleList(this.name, 'taskItem')
|
|
48
48
|
},
|
|
49
49
|
}
|
|
50
50
|
},
|