@tiptap/extension-task-list 2.0.0-beta.2 → 2.0.0-beta.20

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) 2020, überdosis GbR
3
+ Copyright (c) 2021, überdosis GbR
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/README.md CHANGED
@@ -7,8 +7,8 @@
7
7
  ## Introduction
8
8
  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
9
 
10
- ## Offical Documentation
10
+ ## Official Documentation
11
11
  Documentation can be found on the [tiptap website](https://tiptap.dev).
12
12
 
13
13
  ## License
14
- tiptap is open-sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap-next/blob/main/LICENSE.md).
14
+ tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md).
@@ -1,17 +1,15 @@
1
- import { Command, Node } from '@tiptap/core';
1
+ import { Node } from '@tiptap/core';
2
2
  export interface TaskListOptions {
3
- HTMLAttributes: {
4
- [key: string]: any;
5
- };
3
+ HTMLAttributes: Record<string, any>;
6
4
  }
7
5
  declare module '@tiptap/core' {
8
- interface Commands {
6
+ interface Commands<ReturnType> {
9
7
  taskList: {
10
8
  /**
11
9
  * Toggle a task list
12
10
  */
13
- toggleTaskList: () => Command;
11
+ toggleTaskList: () => ReturnType;
14
12
  };
15
13
  }
16
14
  }
17
- export declare const TaskList: Node<TaskListOptions>;
15
+ export declare const TaskList: Node<TaskListOptions, any>;
@@ -6,8 +6,10 @@ 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
+ HTMLAttributes: {},
12
+ };
11
13
  },
12
14
  group: 'block list',
13
15
  content: 'taskItem+',
@@ -20,7 +22,7 @@ const TaskList = core.Node.create({
20
22
  ];
21
23
  },
22
24
  renderHTML({ HTMLAttributes }) {
23
- return ['ul', core.mergeAttributes(HTMLAttributes, { 'data-type': 'taskList' }), 0];
25
+ return ['ul', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type': 'taskList' }), 0];
24
26
  },
25
27
  addCommands() {
26
28
  return {
@@ -37,5 +39,5 @@ const TaskList = core.Node.create({
37
39
  });
38
40
 
39
41
  exports.TaskList = TaskList;
40
- exports.default = TaskList;
42
+ exports["default"] = TaskList;
41
43
  //# 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 { Command, Node, mergeAttributes } from '@tiptap/core'\n\nexport interface TaskListOptions {\n HTMLAttributes: {\n [key: string]: any\n },\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n taskList: {\n /**\n * Toggle a task list\n */\n toggleTaskList: () => Command,\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":";;;;;;MAmBa,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 { 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=\"taskList\"]',\n priority: 51,\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['ul', mergeAttributes(this.options.HTMLAttributes, 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,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,0BAA0B;gBAC/B,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,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;KAC5G;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;;;;;"}
@@ -2,8 +2,10 @@ 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
+ HTMLAttributes: {},
8
+ };
7
9
  },
8
10
  group: 'block list',
9
11
  content: 'taskItem+',
@@ -16,7 +18,7 @@ const TaskList = Node.create({
16
18
  ];
17
19
  },
18
20
  renderHTML({ HTMLAttributes }) {
19
- return ['ul', mergeAttributes(HTMLAttributes, { 'data-type': 'taskList' }), 0];
21
+ return ['ul', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type': 'taskList' }), 0];
20
22
  },
21
23
  addCommands() {
22
24
  return {
@@ -32,6 +34,5 @@ const TaskList = Node.create({
32
34
  },
33
35
  });
34
36
 
35
- export default TaskList;
36
- export { TaskList };
37
+ export { TaskList, TaskList as default };
37
38
  //# 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 { Command, Node, mergeAttributes } from '@tiptap/core'\n\nexport interface TaskListOptions {\n HTMLAttributes: {\n [key: string]: any\n },\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n taskList: {\n /**\n * Toggle a task list\n */\n toggleTaskList: () => Command,\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":";;MAmBa,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 { 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=\"taskList\"]',\n priority: 51,\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['ul', mergeAttributes(this.options.HTMLAttributes, 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,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,0BAA0B;gBAC/B,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,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;KAC5G;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,13 +1,15 @@
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
+ HTMLAttributes: {},
12
+ };
11
13
  },
12
14
  group: 'block list',
13
15
  content: 'taskItem+',
@@ -20,7 +22,7 @@
20
22
  ];
21
23
  },
22
24
  renderHTML({ HTMLAttributes }) {
23
- return ['ul', core.mergeAttributes(HTMLAttributes, { 'data-type': 'taskList' }), 0];
25
+ return ['ul', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type': 'taskList' }), 0];
24
26
  },
25
27
  addCommands() {
26
28
  return {
@@ -37,9 +39,9 @@
37
39
  });
38
40
 
39
41
  exports.TaskList = TaskList;
40
- exports.default = TaskList;
42
+ exports["default"] = TaskList;
41
43
 
42
44
  Object.defineProperty(exports, '__esModule', { value: true });
43
45
 
44
- })));
46
+ }));
45
47
  //# 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 { Command, Node, mergeAttributes } from '@tiptap/core'\n\nexport interface TaskListOptions {\n HTMLAttributes: {\n [key: string]: any\n },\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n taskList: {\n /**\n * Toggle a task list\n */\n toggleTaskList: () => Command,\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":";;;;;;QAmBa,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 { 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=\"taskList\"]',\n priority: 51,\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['ul', mergeAttributes(this.options.HTMLAttributes, 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,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,0BAA0B;kBAC/B,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,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;OAC5G;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;;;;;;;;;;;"}
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.2",
4
+ "version": "2.0.0-beta.20",
5
5
  "homepage": "https://tiptap.dev",
6
6
  "keywords": [
7
7
  "tiptap",
@@ -15,7 +15,6 @@
15
15
  "main": "dist/tiptap-extension-task-list.cjs.js",
16
16
  "umd": "dist/tiptap-extension-task-list.umd.js",
17
17
  "module": "dist/tiptap-extension-task-list.esm.js",
18
- "unpkg": "dist/tiptap-extension-task-list.bundle.umd.min.js",
19
18
  "types": "dist/packages/extension-task-list/src/index.d.ts",
20
19
  "files": [
21
20
  "src",
@@ -24,5 +23,10 @@
24
23
  "peerDependencies": {
25
24
  "@tiptap/core": "^2.0.0-beta.1"
26
25
  },
27
- "gitHead": "bb1dad7560554608535eb4ce2063518aefed025d"
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/ueberdosis/tiptap",
29
+ "directory": "packages/extension-task-list"
30
+ },
31
+ "gitHead": "31c23336d0e5d2be8b250530353531b8a241253c"
28
32
  }
package/src/task-list.ts CHANGED
@@ -1,18 +1,16 @@
1
- import { Command, Node, mergeAttributes } from '@tiptap/core'
1
+ import { Node, mergeAttributes } from '@tiptap/core'
2
2
 
3
3
  export interface TaskListOptions {
4
- HTMLAttributes: {
5
- [key: string]: any
6
- },
4
+ HTMLAttributes: Record<string, any>,
7
5
  }
8
6
 
9
7
  declare module '@tiptap/core' {
10
- interface Commands {
8
+ interface Commands<ReturnType> {
11
9
  taskList: {
12
10
  /**
13
11
  * Toggle a task list
14
12
  */
15
- toggleTaskList: () => Command,
13
+ toggleTaskList: () => ReturnType,
16
14
  }
17
15
  }
18
16
  }
@@ -20,8 +18,10 @@ declare module '@tiptap/core' {
20
18
  export const TaskList = Node.create<TaskListOptions>({
21
19
  name: 'taskList',
22
20
 
23
- defaultOptions: {
24
- HTMLAttributes: {},
21
+ addOptions() {
22
+ return {
23
+ HTMLAttributes: {},
24
+ }
25
25
  },
26
26
 
27
27
  group: 'block list',
@@ -38,7 +38,7 @@ export const TaskList = Node.create<TaskListOptions>({
38
38
  },
39
39
 
40
40
  renderHTML({ HTMLAttributes }) {
41
- return ['ul', mergeAttributes(HTMLAttributes, { 'data-type': 'taskList' }), 0]
41
+ return ['ul', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type': 'taskList' }), 0]
42
42
  },
43
43
 
44
44
  addCommands() {
package/CHANGELOG.md DELETED
@@ -1,123 +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.2](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-task-list@2.0.0-beta.1...@tiptap/extension-task-list@2.0.0-beta.2) (2021-03-28)
7
-
8
- **Note:** Version bump only for package @tiptap/extension-task-list
9
-
10
-
11
-
12
-
13
-
14
- # [2.0.0-beta.1](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-task-list@2.0.0-alpha.11...@tiptap/extension-task-list@2.0.0-beta.1) (2021-03-05)
15
-
16
- **Note:** Version bump only for package @tiptap/extension-task-list
17
-
18
-
19
-
20
-
21
-
22
- # [2.0.0-alpha.11](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-task-list@2.0.0-alpha.10...@tiptap/extension-task-list@2.0.0-alpha.11) (2021-02-16)
23
-
24
- **Note:** Version bump only for package @tiptap/extension-task-list
25
-
26
-
27
-
28
-
29
-
30
- # [2.0.0-alpha.10](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-task-list@2.0.0-alpha.9...@tiptap/extension-task-list@2.0.0-alpha.10) (2021-02-07)
31
-
32
- **Note:** Version bump only for package @tiptap/extension-task-list
33
-
34
-
35
-
36
-
37
-
38
- # [2.0.0-alpha.9](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-task-list@2.0.0-alpha.8...@tiptap/extension-task-list@2.0.0-alpha.9) (2021-02-05)
39
-
40
- **Note:** Version bump only for package @tiptap/extension-task-list
41
-
42
-
43
-
44
-
45
-
46
- # [2.0.0-alpha.8](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-task-list@2.0.0-alpha.7...@tiptap/extension-task-list@2.0.0-alpha.8) (2021-01-29)
47
-
48
- **Note:** Version bump only for package @tiptap/extension-task-list
49
-
50
-
51
-
52
-
53
-
54
- # [2.0.0-alpha.7](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-task-list@2.0.0-alpha.6...@tiptap/extension-task-list@2.0.0-alpha.7) (2021-01-29)
55
-
56
- **Note:** Version bump only for package @tiptap/extension-task-list
57
-
58
-
59
-
60
-
61
-
62
- # [2.0.0-alpha.6](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-task-list@2.0.0-alpha.5...@tiptap/extension-task-list@2.0.0-alpha.6) (2021-01-28)
63
-
64
- **Note:** Version bump only for package @tiptap/extension-task-list
65
-
66
-
67
-
68
-
69
-
70
- # [2.0.0-alpha.5](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-task-list@2.0.0-alpha.4...@tiptap/extension-task-list@2.0.0-alpha.5) (2020-12-18)
71
-
72
- **Note:** Version bump only for package @tiptap/extension-task-list
73
-
74
-
75
-
76
-
77
-
78
- # [2.0.0-alpha.4](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-task-list@2.0.0-alpha.3...@tiptap/extension-task-list@2.0.0-alpha.4) (2020-12-02)
79
-
80
- **Note:** Version bump only for package @tiptap/extension-task-list
81
-
82
-
83
-
84
-
85
-
86
- # [2.0.0-alpha.3](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-task-list@2.0.0-alpha.2...@tiptap/extension-task-list@2.0.0-alpha.3) (2020-11-19)
87
-
88
- **Note:** Version bump only for package @tiptap/extension-task-list
89
-
90
-
91
-
92
-
93
-
94
- # [2.0.0-alpha.2](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-task-list@2.0.0-alpha.1...@tiptap/extension-task-list@2.0.0-alpha.2) (2020-11-19)
95
-
96
- **Note:** Version bump only for package @tiptap/extension-task-list
97
-
98
-
99
-
100
-
101
-
102
- # [2.0.0-alpha.1](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-task-list@1.0.0-alpha.2...@tiptap/extension-task-list@2.0.0-alpha.1) (2020-11-18)
103
-
104
- **Note:** Version bump only for package @tiptap/extension-task-list
105
-
106
-
107
-
108
-
109
-
110
- # [1.0.0-alpha.2](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-task-list@1.0.0-alpha.1...@tiptap/extension-task-list@1.0.0-alpha.2) (2020-11-16)
111
-
112
- **Note:** Version bump only for package @tiptap/extension-task-list
113
-
114
-
115
-
116
-
117
-
118
- # 1.0.0-alpha.1 (2020-11-16)
119
-
120
-
121
- ### Reverts
122
-
123
- * Revert "use global namespace" ([0c9ce26](https://github.com/ueberdosis/tiptap-next/commit/0c9ce26c02c07d88a757c01b0a9d7f9e2b0b7502))
@@ -1,2 +0,0 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tiptap/core")):"function"==typeof define&&define.amd?define(["exports","@tiptap/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@tiptap/extension-task-list"]={},t["@tiptap/core"])}(this,(function(t,e){"use strict";const s=e.Node.create({name:"taskList",defaultOptions:{HTMLAttributes:{}},group:"block list",content:"taskItem+",parseHTML:()=>[{tag:'ul[data-type="taskList"]',priority:51}],renderHTML:({HTMLAttributes:t})=>["ul",e.mergeAttributes(t,{"data-type":"taskList"}),0],addCommands:()=>({toggleTaskList:()=>({commands:t})=>t.toggleList("taskList","taskItem")}),addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});t.TaskList=s,t.default=s,Object.defineProperty(t,"__esModule",{value:!0})}));
2
- //# sourceMappingURL=tiptap-extension-task-list.bundle.umd.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tiptap-extension-task-list.bundle.umd.min.js","sources":["../src/task-list.ts"],"sourcesContent":["import { Command, Node, mergeAttributes } from '@tiptap/core'\n\nexport interface TaskListOptions {\n HTMLAttributes: {\n [key: string]: any\n },\n}\n\ndeclare module '@tiptap/core' {\n interface Commands {\n taskList: {\n /**\n * Toggle a task list\n */\n toggleTaskList: () => Command,\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":["TaskList","Node","create","name","defaultOptions","HTMLAttributes","group","content","parseHTML","tag","priority","renderHTML","mergeAttributes","data-type","addCommands","toggleTaskList","commands","toggleList","[object Object]","Mod-Shift-9","this","editor"],"mappings":"uUAmBaA,EAAWC,OAAKC,OAAwB,CACnDC,KAAM,WAENC,eAAgB,CACdC,eAAgB,IAGlBC,MAAO,aAEPC,QAAS,YAETC,UAAS,IACA,CACL,CACEC,IAAK,2BACLC,SAAU,KAKhBC,WAAU,EAACN,eAAEA,KACJ,CAAC,KAAMO,kBAAgBP,EAAgB,CAAEQ,YAAa,aAAe,GAG9EC,YAAW,KACF,CACLC,eAAgB,IAAM,EAAGC,SAAAA,KAChBA,EAASC,WAAW,WAAY,cAK7CC,uBACE,MAAO,CACLC,cAAe,IAAMC,KAAKC,OAAOL,SAASD"}