@tiptap/extension-task-list 3.0.0-next.4 → 3.0.0-next.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024, Tiptap GmbH
3
+ Copyright (c) 2025, Tiptap GmbH
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/index.cjs CHANGED
@@ -20,54 +20,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
- TaskList: () => TaskList,
23
+ TaskList: () => import_extension_list2.TaskList,
24
+ TaskListOptions: () => import_extension_list2.TaskListOptions,
24
25
  default: () => index_default
25
26
  });
26
27
  module.exports = __toCommonJS(index_exports);
27
-
28
- // src/task-list.ts
29
- var import_core = require("@tiptap/core");
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 index_default = TaskList;
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
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/task-list.ts"],"sourcesContent":["import { TaskList } from './task-list.js'\n\nexport * from './task-list.js'\n\nexport default TaskList\n","import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface TaskListOptions {\n /**\n * The node type name for a task item.\n * @default 'taskItem'\n * @example 'myCustomTaskItem'\n */\n itemTypeName: string\n\n /**\n * The HTML attributes for a task list node.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n taskList: {\n /**\n * Toggle a task list\n * @example editor.commands.toggleTaskList()\n */\n toggleTaskList: () => ReturnType\n }\n }\n}\n\n/**\n * This extension allows you to create task lists.\n * @see https://www.tiptap.dev/api/nodes/task-list\n */\nexport const TaskList = Node.create<TaskListOptions>({\n name: 'taskList',\n\n addOptions() {\n return {\n itemTypeName: 'taskItem',\n HTMLAttributes: {},\n }\n },\n\n group: 'block list',\n\n content() {\n return `${this.options.itemTypeName}+`\n },\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:\n () =>\n ({ commands }) => {\n return commands.toggleList(this.name, this.options.itemTypeName)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Shift-9': () => this.editor.commands.toggleTaskList(),\n }\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAsC;AAkC/B,IAAM,WAAW,iBAAK,OAAwB;AAAA,EACnD,MAAM;AAAA,EAEN,aAAa;AACX,WAAO;AAAA,MACL,cAAc;AAAA,MACd,gBAAgB,CAAC;AAAA,IACnB;AAAA,EACF;AAAA,EAEA,OAAO;AAAA,EAEP,UAAU;AACR,WAAO,GAAG,KAAK,QAAQ,YAAY;AAAA,EACrC;AAAA,EAEA,YAAY;AACV,WAAO;AAAA,MACL;AAAA,QACE,KAAK,iBAAiB,KAAK,IAAI;AAAA,QAC/B,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAAA,EAEA,WAAW,EAAE,eAAe,GAAG;AAC7B,WAAO,CAAC,UAAM,6BAAgB,KAAK,QAAQ,gBAAgB,gBAAgB,EAAE,aAAa,KAAK,KAAK,CAAC,GAAG,CAAC;AAAA,EAC3G;AAAA,EAEA,cAAc;AACZ,WAAO;AAAA,MACL,gBACE,MACA,CAAC,EAAE,SAAS,MAAM;AAChB,eAAO,SAAS,WAAW,KAAK,MAAM,KAAK,QAAQ,YAAY;AAAA,MACjE;AAAA,IACJ;AAAA,EACF;AAAA,EAEA,uBAAuB;AACrB,WAAO;AAAA,MACL,eAAe,MAAM,KAAK,OAAO,SAAS,eAAe;AAAA,IAC3D;AAAA,EACF;AACF,CAAC;;;AD1ED,IAAO,gBAAQ;","names":[]}
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 { Node } from '@tiptap/core';
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 { Node } from '@tiptap/core';
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
2
+ import { TaskList } from "@tiptap/extension-list";
3
+ import { TaskList as TaskList2, TaskListOptions } from "@tiptap/extension-list";
41
4
  var index_default = TaskList;
42
5
  export {
43
- TaskList,
6
+ TaskList2 as TaskList,
7
+ TaskListOptions,
44
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/task-list.ts","../src/index.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface TaskListOptions {\n /**\n * The node type name for a task item.\n * @default 'taskItem'\n * @example 'myCustomTaskItem'\n */\n itemTypeName: string\n\n /**\n * The HTML attributes for a task list node.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n taskList: {\n /**\n * Toggle a task list\n * @example editor.commands.toggleTaskList()\n */\n toggleTaskList: () => ReturnType\n }\n }\n}\n\n/**\n * This extension allows you to create task lists.\n * @see https://www.tiptap.dev/api/nodes/task-list\n */\nexport const TaskList = Node.create<TaskListOptions>({\n name: 'taskList',\n\n addOptions() {\n return {\n itemTypeName: 'taskItem',\n HTMLAttributes: {},\n }\n },\n\n group: 'block list',\n\n content() {\n return `${this.options.itemTypeName}+`\n },\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:\n () =>\n ({ commands }) => {\n return commands.toggleList(this.name, this.options.itemTypeName)\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Shift-9': () => this.editor.commands.toggleTaskList(),\n }\n },\n})\n","import { TaskList } from './task-list.js'\n\nexport * from './task-list.js'\n\nexport default TaskList\n"],"mappings":";AAAA,SAAS,iBAAiB,YAAY;AAkC/B,IAAM,WAAW,KAAK,OAAwB;AAAA,EACnD,MAAM;AAAA,EAEN,aAAa;AACX,WAAO;AAAA,MACL,cAAc;AAAA,MACd,gBAAgB,CAAC;AAAA,IACnB;AAAA,EACF;AAAA,EAEA,OAAO;AAAA,EAEP,UAAU;AACR,WAAO,GAAG,KAAK,QAAQ,YAAY;AAAA,EACrC;AAAA,EAEA,YAAY;AACV,WAAO;AAAA,MACL;AAAA,QACE,KAAK,iBAAiB,KAAK,IAAI;AAAA,QAC/B,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAAA,EAEA,WAAW,EAAE,eAAe,GAAG;AAC7B,WAAO,CAAC,MAAM,gBAAgB,KAAK,QAAQ,gBAAgB,gBAAgB,EAAE,aAAa,KAAK,KAAK,CAAC,GAAG,CAAC;AAAA,EAC3G;AAAA,EAEA,cAAc;AACZ,WAAO;AAAA,MACL,gBACE,MACA,CAAC,EAAE,SAAS,MAAM;AAChB,eAAO,SAAS,WAAW,KAAK,MAAM,KAAK,QAAQ,YAAY;AAAA,MACjE;AAAA,IACJ;AAAA,EACF;AAAA,EAEA,uBAAuB;AACrB,WAAO;AAAA,MACL,eAAe,MAAM,KAAK,OAAO,SAAS,eAAe;AAAA,IAC3D;AAAA,EACF;AACF,CAAC;;;AC1ED,IAAO,gBAAQ;","names":[]}
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",
4
+ "version": "3.0.0-next.6",
5
5
  "homepage": "https://tiptap.dev",
6
6
  "keywords": [
7
7
  "tiptap",
@@ -31,10 +31,10 @@
31
31
  "dist"
32
32
  ],
33
33
  "devDependencies": {
34
- "@tiptap/core": "^3.0.0-next.4"
34
+ "@tiptap/extension-list": "^3.0.0-next.6"
35
35
  },
36
36
  "peerDependencies": {
37
- "@tiptap/core": "^3.0.0-next.1"
37
+ "@tiptap/extension-list": "^3.0.0-next.4"
38
38
  },
39
39
  "repository": {
40
40
  "type": "git",
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { TaskList } from './task-list.js'
1
+ import { TaskList } from '@tiptap/extension-list'
2
2
 
3
- export * from './task-list.js'
3
+ export { TaskList, TaskListOptions } from '@tiptap/extension-list'
4
4
 
5
5
  export default TaskList
package/src/task-list.ts DELETED
@@ -1,79 +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:
67
- () =>
68
- ({ commands }) => {
69
- return commands.toggleList(this.name, this.options.itemTypeName)
70
- },
71
- }
72
- },
73
-
74
- addKeyboardShortcuts() {
75
- return {
76
- 'Mod-Shift-9': () => this.editor.commands.toggleTaskList(),
77
- }
78
- },
79
- })