@tiptap/extension-task-list 2.0.0-beta.209 → 2.0.0-beta.210

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/index.cjs ADDED
@@ -0,0 +1,45 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/task-list.ts
2
+ var _core = require('@tiptap/core');
3
+ var TaskList = _core.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", _core.mergeAttributes.call(void 0, 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
+ // src/index.ts
41
+ var src_default = TaskList;
42
+
43
+
44
+
45
+ exports.TaskList = TaskList; exports.default = src_default;
@@ -1,16 +1,19 @@
1
- import { Node } from '@tiptap/core';
2
- export interface TaskListOptions {
3
- itemTypeName: string;
4
- HTMLAttributes: Record<string, any>;
5
- }
6
- declare module '@tiptap/core' {
7
- interface Commands<ReturnType> {
8
- taskList: {
9
- /**
10
- * Toggle a task list
11
- */
12
- toggleTaskList: () => ReturnType;
13
- };
14
- }
15
- }
16
- export declare const TaskList: Node<TaskListOptions, any>;
1
+ import { Node } from '@tiptap/core';
2
+
3
+ interface TaskListOptions {
4
+ itemTypeName: string;
5
+ HTMLAttributes: Record<string, any>;
6
+ }
7
+ declare module '@tiptap/core' {
8
+ interface Commands<ReturnType> {
9
+ taskList: {
10
+ /**
11
+ * Toggle a task list
12
+ */
13
+ toggleTaskList: () => ReturnType;
14
+ };
15
+ }
16
+ }
17
+ declare const TaskList: Node<TaskListOptions, any>;
18
+
19
+ export { TaskList, TaskListOptions, TaskList as default };
package/dist/index.js ADDED
@@ -0,0 +1,45 @@
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
+ // src/index.ts
41
+ var src_default = TaskList;
42
+ export {
43
+ TaskList,
44
+ src_default as default
45
+ };
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.209",
4
+ "version": "2.0.0-beta.210",
5
5
  "homepage": "https://tiptap.dev",
6
6
  "keywords": [
7
7
  "tiptap",
@@ -15,28 +15,41 @@
15
15
  "type": "module",
16
16
  "exports": {
17
17
  ".": {
18
- "types": "./dist/packages/extension-task-list/src/index.d.ts",
19
- "import": "./dist/tiptap-extension-task-list.esm.js",
20
- "require": "./dist/tiptap-extension-task-list.cjs"
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js",
20
+ "require": "./dist/index.cjs"
21
21
  }
22
22
  },
23
- "main": "dist/tiptap-extension-task-list.cjs",
24
- "umd": "dist/tiptap-extension-task-list.umd.js",
25
- "module": "dist/tiptap-extension-task-list.esm.js",
26
- "types": "dist/packages/extension-task-list/src/index.d.ts",
23
+ "main": "dist/index.cjs",
24
+ "module": "dist/index.js",
25
+ "types": "dist/index.d.ts",
27
26
  "files": [
28
27
  "src",
29
28
  "dist"
30
29
  ],
31
30
  "peerDependencies": {
32
- "@tiptap/core": "^2.0.0-beta.193"
31
+ "@tiptap/core": "^2.0.0-beta.209"
33
32
  },
34
33
  "devDependencies": {
35
- "@tiptap/core": "^2.0.0-beta.209"
34
+ "@tiptap/core": "^2.0.0-beta.210"
36
35
  },
37
36
  "repository": {
38
37
  "type": "git",
39
38
  "url": "https://github.com/ueberdosis/tiptap",
40
39
  "directory": "packages/extension-task-list"
40
+ },
41
+ "scripts": {
42
+ "build": "tsup"
43
+ },
44
+ "tsup": {
45
+ "entry": [
46
+ "src/index.ts"
47
+ ],
48
+ "dts": true,
49
+ "splitting": true,
50
+ "format": [
51
+ "esm",
52
+ "cjs"
53
+ ]
41
54
  }
42
55
  }
@@ -1,3 +0,0 @@
1
- import { TaskList } from './task-list';
2
- export * from './task-list';
3
- export default TaskList;
@@ -1,46 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var core = require('@tiptap/core');
6
-
7
- const TaskList = core.Node.create({
8
- name: 'taskList',
9
- addOptions() {
10
- return {
11
- itemTypeName: 'taskItem',
12
- HTMLAttributes: {},
13
- };
14
- },
15
- group: 'block list',
16
- content() {
17
- return `${this.options.itemTypeName}+`;
18
- },
19
- parseHTML() {
20
- return [
21
- {
22
- tag: `ul[data-type="${this.name}"]`,
23
- priority: 51,
24
- },
25
- ];
26
- },
27
- renderHTML({ HTMLAttributes }) {
28
- return ['ul', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type': this.name }), 0];
29
- },
30
- addCommands() {
31
- return {
32
- toggleTaskList: () => ({ commands }) => {
33
- return commands.toggleList(this.name, this.options.itemTypeName);
34
- },
35
- };
36
- },
37
- addKeyboardShortcuts() {
38
- return {
39
- 'Mod-Shift-9': () => this.editor.commands.toggleTaskList(),
40
- };
41
- },
42
- });
43
-
44
- exports.TaskList = TaskList;
45
- exports["default"] = TaskList;
46
- //# sourceMappingURL=tiptap-extension-task-list.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tiptap-extension-task-list.cjs","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;;;;;"}
@@ -1,41 +0,0 @@
1
- import { Node, mergeAttributes } from '@tiptap/core';
2
-
3
- const 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
- export { TaskList, TaskList as default };
41
- //# sourceMappingURL=tiptap-extension-task-list.esm.js.map
@@ -1 +0,0 @@
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,50 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tiptap/core')) :
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';
6
-
7
- const TaskList = core.Node.create({
8
- name: 'taskList',
9
- addOptions() {
10
- return {
11
- itemTypeName: 'taskItem',
12
- HTMLAttributes: {},
13
- };
14
- },
15
- group: 'block list',
16
- content() {
17
- return `${this.options.itemTypeName}+`;
18
- },
19
- parseHTML() {
20
- return [
21
- {
22
- tag: `ul[data-type="${this.name}"]`,
23
- priority: 51,
24
- },
25
- ];
26
- },
27
- renderHTML({ HTMLAttributes }) {
28
- return ['ul', core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { 'data-type': this.name }), 0];
29
- },
30
- addCommands() {
31
- return {
32
- toggleTaskList: () => ({ commands }) => {
33
- return commands.toggleList(this.name, this.options.itemTypeName);
34
- },
35
- };
36
- },
37
- addKeyboardShortcuts() {
38
- return {
39
- 'Mod-Shift-9': () => this.editor.commands.toggleTaskList(),
40
- };
41
- },
42
- });
43
-
44
- exports.TaskList = TaskList;
45
- exports["default"] = TaskList;
46
-
47
- Object.defineProperty(exports, '__esModule', { value: true });
48
-
49
- }));
50
- //# sourceMappingURL=tiptap-extension-task-list.umd.js.map
@@ -1 +0,0 @@
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;;;;;;;;;;;"}