@tiptap/extension-task-list 2.0.0-beta.17 → 2.0.0-beta.194

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.
@@ -1,5 +1,6 @@
1
1
  import { Node } from '@tiptap/core';
2
2
  export interface TaskListOptions {
3
+ itemTypeName: string;
3
4
  HTMLAttributes: Record<string, any>;
4
5
  }
5
6
  declare module '@tiptap/core' {
@@ -12,4 +13,4 @@ declare module '@tiptap/core' {
12
13
  };
13
14
  }
14
15
  }
15
- export declare const TaskList: Node<TaskListOptions>;
16
+ export declare const TaskList: Node<TaskListOptions, any>;
@@ -6,26 +6,31 @@ var core = require('@tiptap/core');
6
6
 
7
7
  const TaskList = core.Node.create({
8
8
  name: 'taskList',
9
- defaultOptions: {
10
- HTMLAttributes: {},
9
+ addOptions() {
10
+ return {
11
+ itemTypeName: 'taskItem',
12
+ HTMLAttributes: {},
13
+ };
11
14
  },
12
15
  group: 'block list',
13
- content: 'taskItem+',
16
+ content() {
17
+ return `${this.options.itemTypeName}+`;
18
+ },
14
19
  parseHTML() {
15
20
  return [
16
21
  {
17
- tag: 'ul[data-type="taskList"]',
22
+ tag: `ul[data-type="${this.name}"]`,
18
23
  priority: 51,
19
24
  },
20
25
  ];
21
26
  },
22
27
  renderHTML({ HTMLAttributes }) {
23
- return ['ul', core.mergeAttributes(HTMLAttributes, { 'data-type': 'taskList' }), 0];
28
+ return ['ul', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type': this.name }), 0];
24
29
  },
25
30
  addCommands() {
26
31
  return {
27
32
  toggleTaskList: () => ({ commands }) => {
28
- return commands.toggleList('taskList', 'taskItem');
33
+ return commands.toggleList(this.name, this.options.itemTypeName);
29
34
  },
30
35
  };
31
36
  },
@@ -37,5 +42,5 @@ const TaskList = core.Node.create({
37
42
  });
38
43
 
39
44
  exports.TaskList = TaskList;
40
- exports.default = TaskList;
45
+ exports["default"] = TaskList;
41
46
  //# sourceMappingURL=tiptap-extension-task-list.cjs.js.map
@@ -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 defaultOptions: {\n HTMLAttributes: {},\n },\n\n group: 'block list',\n\n content: 'taskItem+',\n\n parseHTML() {\n return [\n {\n tag: 'ul[data-type=\"taskList\"]',\n priority: 51,\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['ul', mergeAttributes(HTMLAttributes, { 'data-type': 'taskList' }), 0]\n },\n\n addCommands() {\n return {\n toggleTaskList: () => ({ commands }) => {\n return commands.toggleList('taskList', '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,cAAc,EAAE;QACd,cAAc,EAAE,EAAE;KACnB;IAED,KAAK,EAAE,YAAY;IAEnB,OAAO,EAAE,WAAW;IAEpB,SAAS;QACP,OAAO;YACL;gBACE,GAAG,EAAE,0BAA0B;gBAC/B,QAAQ,EAAE,EAAE;aACb;SACF,CAAA;KACF;IAED,UAAU,CAAC,EAAE,cAAc,EAAE;QAC3B,OAAO,CAAC,IAAI,EAAEC,oBAAe,CAAC,cAAc,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;KAC/E;IAED,WAAW;QACT,OAAO;YACL,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;gBACjC,OAAO,QAAQ,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;aACnD;SACF,CAAA;KACF;IAED,oBAAoB;QAClB,OAAO;YACL,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE;SAC3D,CAAA;KACF;CACF;;;;;"}
1
+ {"version":3,"file":"tiptap-extension-task-list.cjs.js","sources":["../src/task-list.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface TaskListOptions {\n itemTypeName: string,\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 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: () => ({ 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"],"names":["Node","mergeAttributes"],"mappings":";;;;;;AAkBa,MAAA,QAAQ,GAAGA,SAAI,CAAC,MAAM,CAAkB;AACnD,IAAA,IAAI,EAAE,UAAU;IAEhB,UAAU,GAAA;QACR,OAAO;AACL,YAAA,YAAY,EAAE,UAAU;AACxB,YAAA,cAAc,EAAE,EAAE;SACnB,CAAA;KACF;AAED,IAAA,KAAK,EAAE,YAAY;IAEnB,OAAO,GAAA;AACL,QAAA,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,GAAG,CAAA;KACvC;IAED,SAAS,GAAA;QACP,OAAO;AACL,YAAA;AACE,gBAAA,GAAG,EAAE,CAAA,cAAA,EAAiB,IAAI,CAAC,IAAI,CAAI,EAAA,CAAA;AACnC,gBAAA,QAAQ,EAAE,EAAE;AACb,aAAA;SACF,CAAA;KACF;IAED,UAAU,CAAC,EAAE,cAAc,EAAE,EAAA;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,GAAA;QACT,OAAO;YACL,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;AACrC,gBAAA,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;aACjE;SACF,CAAA;KACF;IAED,oBAAoB,GAAA;QAClB,OAAO;YACL,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE;SAC3D,CAAA;KACF;AACF,CAAA;;;;;"}
@@ -2,26 +2,31 @@ import { Node, mergeAttributes } from '@tiptap/core';
2
2
 
3
3
  const TaskList = Node.create({
4
4
  name: 'taskList',
5
- defaultOptions: {
6
- HTMLAttributes: {},
5
+ addOptions() {
6
+ return {
7
+ itemTypeName: 'taskItem',
8
+ HTMLAttributes: {},
9
+ };
7
10
  },
8
11
  group: 'block list',
9
- content: 'taskItem+',
12
+ content() {
13
+ return `${this.options.itemTypeName}+`;
14
+ },
10
15
  parseHTML() {
11
16
  return [
12
17
  {
13
- tag: 'ul[data-type="taskList"]',
18
+ tag: `ul[data-type="${this.name}"]`,
14
19
  priority: 51,
15
20
  },
16
21
  ];
17
22
  },
18
23
  renderHTML({ HTMLAttributes }) {
19
- return ['ul', mergeAttributes(HTMLAttributes, { 'data-type': 'taskList' }), 0];
24
+ return ['ul', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type': this.name }), 0];
20
25
  },
21
26
  addCommands() {
22
27
  return {
23
28
  toggleTaskList: () => ({ commands }) => {
24
- return commands.toggleList('taskList', 'taskItem');
29
+ return commands.toggleList(this.name, this.options.itemTypeName);
25
30
  },
26
31
  };
27
32
  },
@@ -32,6 +37,5 @@ const TaskList = Node.create({
32
37
  },
33
38
  });
34
39
 
35
- export default TaskList;
36
- export { TaskList };
40
+ export { TaskList, TaskList as default };
37
41
  //# sourceMappingURL=tiptap-extension-task-list.esm.js.map
@@ -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 defaultOptions: {\n HTMLAttributes: {},\n },\n\n group: 'block list',\n\n content: 'taskItem+',\n\n parseHTML() {\n return [\n {\n tag: 'ul[data-type=\"taskList\"]',\n priority: 51,\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['ul', mergeAttributes(HTMLAttributes, { 'data-type': 'taskList' }), 0]\n },\n\n addCommands() {\n return {\n toggleTaskList: () => ({ commands }) => {\n return commands.toggleList('taskList', '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,cAAc,EAAE;QACd,cAAc,EAAE,EAAE;KACnB;IAED,KAAK,EAAE,YAAY;IAEnB,OAAO,EAAE,WAAW;IAEpB,SAAS;QACP,OAAO;YACL;gBACE,GAAG,EAAE,0BAA0B;gBAC/B,QAAQ,EAAE,EAAE;aACb;SACF,CAAA;KACF;IAED,UAAU,CAAC,EAAE,cAAc,EAAE;QAC3B,OAAO,CAAC,IAAI,EAAE,eAAe,CAAC,cAAc,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;KAC/E;IAED,WAAW;QACT,OAAO;YACL,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;gBACjC,OAAO,QAAQ,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;aACnD;SACF,CAAA;KACF;IAED,oBAAoB;QAClB,OAAO;YACL,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE;SAC3D,CAAA;KACF;CACF;;;;;"}
1
+ {"version":3,"file":"tiptap-extension-task-list.esm.js","sources":["../src/task-list.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface TaskListOptions {\n itemTypeName: string,\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 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: () => ({ 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"],"names":[],"mappings":";;AAkBa,MAAA,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAkB;AACnD,IAAA,IAAI,EAAE,UAAU;IAEhB,UAAU,GAAA;QACR,OAAO;AACL,YAAA,YAAY,EAAE,UAAU;AACxB,YAAA,cAAc,EAAE,EAAE;SACnB,CAAA;KACF;AAED,IAAA,KAAK,EAAE,YAAY;IAEnB,OAAO,GAAA;AACL,QAAA,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,GAAG,CAAA;KACvC;IAED,SAAS,GAAA;QACP,OAAO;AACL,YAAA;AACE,gBAAA,GAAG,EAAE,CAAA,cAAA,EAAiB,IAAI,CAAC,IAAI,CAAI,EAAA,CAAA;AACnC,gBAAA,QAAQ,EAAE,EAAE;AACb,aAAA;SACF,CAAA;KACF;IAED,UAAU,CAAC,EAAE,cAAc,EAAE,EAAA;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,GAAA;QACT,OAAO;YACL,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;AACrC,gBAAA,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;aACjE;SACF,CAAA;KACF;IAED,oBAAoB,GAAA;QAClB,OAAO;YACL,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE;SAC3D,CAAA;KACF;AACF,CAAA;;;;"}
@@ -1,31 +1,36 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tiptap/core')) :
3
3
  typeof define === 'function' && define.amd ? define(['exports', '@tiptap/core'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['@tiptap/extension-task-list'] = {}, global.core));
5
- }(this, (function (exports, core) { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@tiptap/extension-task-list"] = {}, global.core));
5
+ })(this, (function (exports, core) { 'use strict';
6
6
 
7
7
  const TaskList = core.Node.create({
8
8
  name: 'taskList',
9
- defaultOptions: {
10
- HTMLAttributes: {},
9
+ addOptions() {
10
+ return {
11
+ itemTypeName: 'taskItem',
12
+ HTMLAttributes: {},
13
+ };
11
14
  },
12
15
  group: 'block list',
13
- content: 'taskItem+',
16
+ content() {
17
+ return `${this.options.itemTypeName}+`;
18
+ },
14
19
  parseHTML() {
15
20
  return [
16
21
  {
17
- tag: 'ul[data-type="taskList"]',
22
+ tag: `ul[data-type="${this.name}"]`,
18
23
  priority: 51,
19
24
  },
20
25
  ];
21
26
  },
22
27
  renderHTML({ HTMLAttributes }) {
23
- return ['ul', core.mergeAttributes(HTMLAttributes, { 'data-type': 'taskList' }), 0];
28
+ return ['ul', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type': this.name }), 0];
24
29
  },
25
30
  addCommands() {
26
31
  return {
27
32
  toggleTaskList: () => ({ commands }) => {
28
- return commands.toggleList('taskList', 'taskItem');
33
+ return commands.toggleList(this.name, this.options.itemTypeName);
29
34
  },
30
35
  };
31
36
  },
@@ -37,9 +42,9 @@
37
42
  });
38
43
 
39
44
  exports.TaskList = TaskList;
40
- exports.default = TaskList;
45
+ exports["default"] = TaskList;
41
46
 
42
47
  Object.defineProperty(exports, '__esModule', { value: true });
43
48
 
44
- })));
49
+ }));
45
50
  //# sourceMappingURL=tiptap-extension-task-list.umd.js.map
@@ -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 defaultOptions: {\n HTMLAttributes: {},\n },\n\n group: 'block list',\n\n content: 'taskItem+',\n\n parseHTML() {\n return [\n {\n tag: 'ul[data-type=\"taskList\"]',\n priority: 51,\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['ul', mergeAttributes(HTMLAttributes, { 'data-type': 'taskList' }), 0]\n },\n\n addCommands() {\n return {\n toggleTaskList: () => ({ commands }) => {\n return commands.toggleList('taskList', '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,cAAc,EAAE;UACd,cAAc,EAAE,EAAE;OACnB;MAED,KAAK,EAAE,YAAY;MAEnB,OAAO,EAAE,WAAW;MAEpB,SAAS;UACP,OAAO;cACL;kBACE,GAAG,EAAE,0BAA0B;kBAC/B,QAAQ,EAAE,EAAE;eACb;WACF,CAAA;OACF;MAED,UAAU,CAAC,EAAE,cAAc,EAAE;UAC3B,OAAO,CAAC,IAAI,EAAEC,oBAAe,CAAC,cAAc,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;OAC/E;MAED,WAAW;UACT,OAAO;cACL,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;kBACjC,OAAO,QAAQ,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;eACnD;WACF,CAAA;OACF;MAED,oBAAoB;UAClB,OAAO;cACL,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE;WAC3D,CAAA;OACF;GACF;;;;;;;;;;;"}
1
+ {"version":3,"file":"tiptap-extension-task-list.umd.js","sources":["../src/task-list.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface TaskListOptions {\n itemTypeName: string,\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 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: () => ({ 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"],"names":["Node","mergeAttributes"],"mappings":";;;;;;AAkBa,QAAA,QAAQ,GAAGA,SAAI,CAAC,MAAM,CAAkB;EACnD,IAAA,IAAI,EAAE,UAAU;MAEhB,UAAU,GAAA;UACR,OAAO;EACL,YAAA,YAAY,EAAE,UAAU;EACxB,YAAA,cAAc,EAAE,EAAE;WACnB,CAAA;OACF;EAED,IAAA,KAAK,EAAE,YAAY;MAEnB,OAAO,GAAA;EACL,QAAA,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,GAAG,CAAA;OACvC;MAED,SAAS,GAAA;UACP,OAAO;EACL,YAAA;EACE,gBAAA,GAAG,EAAE,CAAA,cAAA,EAAiB,IAAI,CAAC,IAAI,CAAI,EAAA,CAAA;EACnC,gBAAA,QAAQ,EAAE,EAAE;EACb,aAAA;WACF,CAAA;OACF;MAED,UAAU,CAAC,EAAE,cAAc,EAAE,EAAA;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,GAAA;UACT,OAAO;cACL,cAAc,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAI;EACrC,gBAAA,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;eACjE;WACF,CAAA;OACF;MAED,oBAAoB,GAAA;UAClB,OAAO;cACL,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE;WAC3D,CAAA;OACF;EACF,CAAA;;;;;;;;;;;"}
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.17",
4
+ "version": "2.0.0-beta.194",
5
5
  "homepage": "https://tiptap.dev",
6
6
  "keywords": [
7
7
  "tiptap",
@@ -21,12 +21,11 @@
21
21
  "dist"
22
22
  ],
23
23
  "peerDependencies": {
24
- "@tiptap/core": "^2.0.0-beta.1"
24
+ "@tiptap/core": "^2.0.0-beta.193"
25
25
  },
26
26
  "repository": {
27
27
  "type": "git",
28
28
  "url": "https://github.com/ueberdosis/tiptap",
29
29
  "directory": "packages/extension-task-list"
30
- },
31
- "gitHead": "345ea8cf8abba6422dabc6e548594fb8e2c30409"
30
+ }
32
31
  }
package/src/task-list.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { Node, mergeAttributes } from '@tiptap/core'
1
+ import { mergeAttributes, Node } from '@tiptap/core'
2
2
 
3
3
  export interface TaskListOptions {
4
+ itemTypeName: string,
4
5
  HTMLAttributes: Record<string, any>,
5
6
  }
6
7
 
@@ -18,31 +19,36 @@ declare module '@tiptap/core' {
18
19
  export const TaskList = Node.create<TaskListOptions>({
19
20
  name: 'taskList',
20
21
 
21
- defaultOptions: {
22
- HTMLAttributes: {},
22
+ addOptions() {
23
+ return {
24
+ itemTypeName: 'taskItem',
25
+ HTMLAttributes: {},
26
+ }
23
27
  },
24
28
 
25
29
  group: 'block list',
26
30
 
27
- content: 'taskItem+',
31
+ content() {
32
+ return `${this.options.itemTypeName}+`
33
+ },
28
34
 
29
35
  parseHTML() {
30
36
  return [
31
37
  {
32
- tag: 'ul[data-type="taskList"]',
38
+ tag: `ul[data-type="${this.name}"]`,
33
39
  priority: 51,
34
40
  },
35
41
  ]
36
42
  },
37
43
 
38
44
  renderHTML({ HTMLAttributes }) {
39
- return ['ul', mergeAttributes(HTMLAttributes, { 'data-type': 'taskList' }), 0]
45
+ return ['ul', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type': this.name }), 0]
40
46
  },
41
47
 
42
48
  addCommands() {
43
49
  return {
44
50
  toggleTaskList: () => ({ commands }) => {
45
- return commands.toggleList('taskList', 'taskItem')
51
+ return commands.toggleList(this.name, this.options.itemTypeName)
46
52
  },
47
53
  }
48
54
  },
package/CHANGELOG.md DELETED
@@ -1,252 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [2.0.0-beta.17](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-beta.16...@tiptap/extension-task-list@2.0.0-beta.17) (2021-07-26)
7
-
8
- **Note:** Version bump only for package @tiptap/extension-task-list
9
-
10
-
11
-
12
-
13
-
14
- # [2.0.0-beta.16](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-beta.15...@tiptap/extension-task-list@2.0.0-beta.16) (2021-06-07)
15
-
16
- **Note:** Version bump only for package @tiptap/extension-task-list
17
-
18
-
19
-
20
-
21
-
22
- # [2.0.0-beta.15](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-beta.14...@tiptap/extension-task-list@2.0.0-beta.15) (2021-05-18)
23
-
24
- **Note:** Version bump only for package @tiptap/extension-task-list
25
-
26
-
27
-
28
-
29
-
30
- # [2.0.0-beta.14](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-beta.13...@tiptap/extension-task-list@2.0.0-beta.14) (2021-05-13)
31
-
32
- **Note:** Version bump only for package @tiptap/extension-task-list
33
-
34
-
35
-
36
-
37
-
38
- # [2.0.0-beta.13](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-beta.12...@tiptap/extension-task-list@2.0.0-beta.13) (2021-05-07)
39
-
40
-
41
- ### Bug Fixes
42
-
43
- * revert adding exports ([bc320d0](https://github.com/ueberdosis/tiptap/commit/bc320d0b4b80b0e37a7e47a56e0f6daec6e65d98))
44
-
45
-
46
-
47
-
48
-
49
- # [2.0.0-beta.12](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-beta.11...@tiptap/extension-task-list@2.0.0-beta.12) (2021-05-06)
50
-
51
-
52
- ### Bug Fixes
53
-
54
- * revert adding type: module ([f8d6475](https://github.com/ueberdosis/tiptap/commit/f8d6475e2151faea6f96baecdd6bd75880d50d2c))
55
-
56
-
57
-
58
-
59
-
60
- # [2.0.0-beta.11](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-beta.10...@tiptap/extension-task-list@2.0.0-beta.11) (2021-05-06)
61
-
62
-
63
- ### Bug Fixes
64
-
65
- * add exports to package.json ([1277fa4](https://github.com/ueberdosis/tiptap/commit/1277fa47151e9c039508cdb219bdd0ffe647f4ee))
66
-
67
-
68
-
69
-
70
-
71
- # [2.0.0-beta.10](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-beta.9...@tiptap/extension-task-list@2.0.0-beta.10) (2021-05-06)
72
-
73
- **Note:** Version bump only for package @tiptap/extension-task-list
74
-
75
-
76
-
77
-
78
-
79
- # [2.0.0-beta.9](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-beta.8...@tiptap/extension-task-list@2.0.0-beta.9) (2021-05-05)
80
-
81
- **Note:** Version bump only for package @tiptap/extension-task-list
82
-
83
-
84
-
85
-
86
-
87
- # [2.0.0-beta.8](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-beta.7...@tiptap/extension-task-list@2.0.0-beta.8) (2021-04-23)
88
-
89
- **Note:** Version bump only for package @tiptap/extension-task-list
90
-
91
-
92
-
93
-
94
-
95
- # [2.0.0-beta.7](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-beta.6...@tiptap/extension-task-list@2.0.0-beta.7) (2021-04-22)
96
-
97
- **Note:** Version bump only for package @tiptap/extension-task-list
98
-
99
-
100
-
101
-
102
-
103
- # [2.0.0-beta.6](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-beta.5...@tiptap/extension-task-list@2.0.0-beta.6) (2021-04-21)
104
-
105
- **Note:** Version bump only for package @tiptap/extension-task-list
106
-
107
-
108
-
109
-
110
-
111
- # [2.0.0-beta.5](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-beta.4...@tiptap/extension-task-list@2.0.0-beta.5) (2021-04-16)
112
-
113
- **Note:** Version bump only for package @tiptap/extension-task-list
114
-
115
-
116
-
117
-
118
-
119
- # [2.0.0-beta.4](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-beta.3...@tiptap/extension-task-list@2.0.0-beta.4) (2021-04-15)
120
-
121
- **Note:** Version bump only for package @tiptap/extension-task-list
122
-
123
-
124
-
125
-
126
-
127
- # [2.0.0-beta.3](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-beta.2...@tiptap/extension-task-list@2.0.0-beta.3) (2021-03-31)
128
-
129
- **Note:** Version bump only for package @tiptap/extension-task-list
130
-
131
-
132
-
133
-
134
-
135
- # [2.0.0-beta.2](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-beta.1...@tiptap/extension-task-list@2.0.0-beta.2) (2021-03-28)
136
-
137
- **Note:** Version bump only for package @tiptap/extension-task-list
138
-
139
-
140
-
141
-
142
-
143
- # [2.0.0-beta.1](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-alpha.11...@tiptap/extension-task-list@2.0.0-beta.1) (2021-03-05)
144
-
145
- **Note:** Version bump only for package @tiptap/extension-task-list
146
-
147
-
148
-
149
-
150
-
151
- # [2.0.0-alpha.11](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-alpha.10...@tiptap/extension-task-list@2.0.0-alpha.11) (2021-02-16)
152
-
153
- **Note:** Version bump only for package @tiptap/extension-task-list
154
-
155
-
156
-
157
-
158
-
159
- # [2.0.0-alpha.10](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-alpha.9...@tiptap/extension-task-list@2.0.0-alpha.10) (2021-02-07)
160
-
161
- **Note:** Version bump only for package @tiptap/extension-task-list
162
-
163
-
164
-
165
-
166
-
167
- # [2.0.0-alpha.9](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-alpha.8...@tiptap/extension-task-list@2.0.0-alpha.9) (2021-02-05)
168
-
169
- **Note:** Version bump only for package @tiptap/extension-task-list
170
-
171
-
172
-
173
-
174
-
175
- # [2.0.0-alpha.8](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-alpha.7...@tiptap/extension-task-list@2.0.0-alpha.8) (2021-01-29)
176
-
177
- **Note:** Version bump only for package @tiptap/extension-task-list
178
-
179
-
180
-
181
-
182
-
183
- # [2.0.0-alpha.7](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-alpha.6...@tiptap/extension-task-list@2.0.0-alpha.7) (2021-01-29)
184
-
185
- **Note:** Version bump only for package @tiptap/extension-task-list
186
-
187
-
188
-
189
-
190
-
191
- # [2.0.0-alpha.6](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-alpha.5...@tiptap/extension-task-list@2.0.0-alpha.6) (2021-01-28)
192
-
193
- **Note:** Version bump only for package @tiptap/extension-task-list
194
-
195
-
196
-
197
-
198
-
199
- # [2.0.0-alpha.5](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-alpha.4...@tiptap/extension-task-list@2.0.0-alpha.5) (2020-12-18)
200
-
201
- **Note:** Version bump only for package @tiptap/extension-task-list
202
-
203
-
204
-
205
-
206
-
207
- # [2.0.0-alpha.4](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-alpha.3...@tiptap/extension-task-list@2.0.0-alpha.4) (2020-12-02)
208
-
209
- **Note:** Version bump only for package @tiptap/extension-task-list
210
-
211
-
212
-
213
-
214
-
215
- # [2.0.0-alpha.3](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-alpha.2...@tiptap/extension-task-list@2.0.0-alpha.3) (2020-11-19)
216
-
217
- **Note:** Version bump only for package @tiptap/extension-task-list
218
-
219
-
220
-
221
-
222
-
223
- # [2.0.0-alpha.2](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@2.0.0-alpha.1...@tiptap/extension-task-list@2.0.0-alpha.2) (2020-11-19)
224
-
225
- **Note:** Version bump only for package @tiptap/extension-task-list
226
-
227
-
228
-
229
-
230
-
231
- # [2.0.0-alpha.1](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@1.0.0-alpha.2...@tiptap/extension-task-list@2.0.0-alpha.1) (2020-11-18)
232
-
233
- **Note:** Version bump only for package @tiptap/extension-task-list
234
-
235
-
236
-
237
-
238
-
239
- # [1.0.0-alpha.2](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-task-list@1.0.0-alpha.1...@tiptap/extension-task-list@1.0.0-alpha.2) (2020-11-16)
240
-
241
- **Note:** Version bump only for package @tiptap/extension-task-list
242
-
243
-
244
-
245
-
246
-
247
- # 1.0.0-alpha.1 (2020-11-16)
248
-
249
-
250
- ### Reverts
251
-
252
- * Revert "use global namespace" ([0c9ce26](https://github.com/ueberdosis/tiptap/commit/0c9ce26c02c07d88a757c01b0a9d7f9e2b0b7502))
package/LICENSE.md DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2021, überdosis GbR
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.