@tiptap/extension-list-item 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,47 +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
- ListItem: () => ListItem,
23
+ ListItem: () => import_extension_list2.ListItem,
24
+ ListItemOptions: () => import_extension_list2.ListItemOptions,
24
25
  default: () => index_default
25
26
  });
26
27
  module.exports = __toCommonJS(index_exports);
27
-
28
- // src/list-item.ts
29
- var import_core = require("@tiptap/core");
30
- var ListItem = import_core.Node.create({
31
- name: "listItem",
32
- addOptions() {
33
- return {
34
- HTMLAttributes: {},
35
- bulletListTypeName: "bulletList",
36
- orderedListTypeName: "orderedList"
37
- };
38
- },
39
- content: "paragraph block*",
40
- defining: true,
41
- parseHTML() {
42
- return [
43
- {
44
- tag: "li"
45
- }
46
- ];
47
- },
48
- renderHTML({ HTMLAttributes }) {
49
- return ["li", (0, import_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes), 0];
50
- },
51
- addKeyboardShortcuts() {
52
- return {
53
- Enter: () => this.editor.commands.splitListItem(this.name),
54
- Tab: () => this.editor.commands.sinkListItem(this.name),
55
- "Shift-Tab": () => this.editor.commands.liftListItem(this.name)
56
- };
57
- }
58
- });
59
-
60
- // src/index.ts
61
- var index_default = ListItem;
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.ListItem;
62
31
  // Annotate the CommonJS export names for ESM import in node:
63
32
  0 && (module.exports = {
64
- ListItem
33
+ ListItem,
34
+ ListItemOptions
65
35
  });
66
36
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/list-item.ts"],"sourcesContent":["import { ListItem } from './list-item.js'\n\nexport * from './list-item.js'\n\nexport default ListItem\n","import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface ListItemOptions {\n /**\n * The HTML attributes for a list item node.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>\n\n /**\n * The node type for bulletList nodes\n * @default 'bulletList'\n * @example 'myCustomBulletList'\n */\n bulletListTypeName: string\n\n /**\n * The node type for orderedList nodes\n * @default 'orderedList'\n * @example 'myCustomOrderedList'\n */\n orderedListTypeName: string\n}\n\n/**\n * This extension allows you to create list items.\n * @see https://www.tiptap.dev/api/nodes/list-item\n */\nexport const ListItem = Node.create<ListItemOptions>({\n name: 'listItem',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n bulletListTypeName: 'bulletList',\n orderedListTypeName: 'orderedList',\n }\n },\n\n content: 'paragraph block*',\n\n defining: true,\n\n parseHTML() {\n return [\n {\n tag: 'li',\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['li', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addKeyboardShortcuts() {\n return {\n Enter: () => this.editor.commands.splitListItem(this.name),\n Tab: () => this.editor.commands.sinkListItem(this.name),\n 'Shift-Tab': () => this.editor.commands.liftListItem(this.name),\n }\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAsC;AA6B/B,IAAM,WAAW,iBAAK,OAAwB;AAAA,EACnD,MAAM;AAAA,EAEN,aAAa;AACX,WAAO;AAAA,MACL,gBAAgB,CAAC;AAAA,MACjB,oBAAoB;AAAA,MACpB,qBAAqB;AAAA,IACvB;AAAA,EACF;AAAA,EAEA,SAAS;AAAA,EAET,UAAU;AAAA,EAEV,YAAY;AACV,WAAO;AAAA,MACL;AAAA,QACE,KAAK;AAAA,MACP;AAAA,IACF;AAAA,EACF;AAAA,EAEA,WAAW,EAAE,eAAe,GAAG;AAC7B,WAAO,CAAC,UAAM,6BAAgB,KAAK,QAAQ,gBAAgB,cAAc,GAAG,CAAC;AAAA,EAC/E;AAAA,EAEA,uBAAuB;AACrB,WAAO;AAAA,MACL,OAAO,MAAM,KAAK,OAAO,SAAS,cAAc,KAAK,IAAI;AAAA,MACzD,KAAK,MAAM,KAAK,OAAO,SAAS,aAAa,KAAK,IAAI;AAAA,MACtD,aAAa,MAAM,KAAK,OAAO,SAAS,aAAa,KAAK,IAAI;AAAA,IAChE;AAAA,EACF;AACF,CAAC;;;AD3DD,IAAO,gBAAQ;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { ListItem } from '@tiptap/extension-list'\n\nexport { ListItem, ListItemOptions } from '@tiptap/extension-list'\n\nexport default ListItem\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,29 +1,2 @@
1
- import { Node } from '@tiptap/core';
2
-
3
- interface ListItemOptions {
4
- /**
5
- * The HTML attributes for a list item node.
6
- * @default {}
7
- * @example { class: 'foo' }
8
- */
9
- HTMLAttributes: Record<string, any>;
10
- /**
11
- * The node type for bulletList nodes
12
- * @default 'bulletList'
13
- * @example 'myCustomBulletList'
14
- */
15
- bulletListTypeName: string;
16
- /**
17
- * The node type for orderedList nodes
18
- * @default 'orderedList'
19
- * @example 'myCustomOrderedList'
20
- */
21
- orderedListTypeName: string;
22
- }
23
- /**
24
- * This extension allows you to create list items.
25
- * @see https://www.tiptap.dev/api/nodes/list-item
26
- */
27
- declare const ListItem: Node<ListItemOptions, any>;
28
-
29
- export { ListItem, type ListItemOptions, ListItem as default };
1
+ import { ListItem } from '@tiptap/extension-list';
2
+ export { ListItem, ListItemOptions, ListItem as default } from '@tiptap/extension-list';
package/dist/index.d.ts CHANGED
@@ -1,29 +1,2 @@
1
- import { Node } from '@tiptap/core';
2
-
3
- interface ListItemOptions {
4
- /**
5
- * The HTML attributes for a list item node.
6
- * @default {}
7
- * @example { class: 'foo' }
8
- */
9
- HTMLAttributes: Record<string, any>;
10
- /**
11
- * The node type for bulletList nodes
12
- * @default 'bulletList'
13
- * @example 'myCustomBulletList'
14
- */
15
- bulletListTypeName: string;
16
- /**
17
- * The node type for orderedList nodes
18
- * @default 'orderedList'
19
- * @example 'myCustomOrderedList'
20
- */
21
- orderedListTypeName: string;
22
- }
23
- /**
24
- * This extension allows you to create list items.
25
- * @see https://www.tiptap.dev/api/nodes/list-item
26
- */
27
- declare const ListItem: Node<ListItemOptions, any>;
28
-
29
- export { ListItem, type ListItemOptions, ListItem as default };
1
+ import { ListItem } from '@tiptap/extension-list';
2
+ export { ListItem, ListItemOptions, ListItem as default } from '@tiptap/extension-list';
package/dist/index.js CHANGED
@@ -1,39 +1,10 @@
1
- // src/list-item.ts
2
- import { mergeAttributes, Node } from "@tiptap/core";
3
- var ListItem = Node.create({
4
- name: "listItem",
5
- addOptions() {
6
- return {
7
- HTMLAttributes: {},
8
- bulletListTypeName: "bulletList",
9
- orderedListTypeName: "orderedList"
10
- };
11
- },
12
- content: "paragraph block*",
13
- defining: true,
14
- parseHTML() {
15
- return [
16
- {
17
- tag: "li"
18
- }
19
- ];
20
- },
21
- renderHTML({ HTMLAttributes }) {
22
- return ["li", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
23
- },
24
- addKeyboardShortcuts() {
25
- return {
26
- Enter: () => this.editor.commands.splitListItem(this.name),
27
- Tab: () => this.editor.commands.sinkListItem(this.name),
28
- "Shift-Tab": () => this.editor.commands.liftListItem(this.name)
29
- };
30
- }
31
- });
32
-
33
1
  // src/index.ts
2
+ import { ListItem } from "@tiptap/extension-list";
3
+ import { ListItem as ListItem2, ListItemOptions } from "@tiptap/extension-list";
34
4
  var index_default = ListItem;
35
5
  export {
36
- ListItem,
6
+ ListItem2 as ListItem,
7
+ ListItemOptions,
37
8
  index_default as default
38
9
  };
39
10
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/list-item.ts","../src/index.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface ListItemOptions {\n /**\n * The HTML attributes for a list item node.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>\n\n /**\n * The node type for bulletList nodes\n * @default 'bulletList'\n * @example 'myCustomBulletList'\n */\n bulletListTypeName: string\n\n /**\n * The node type for orderedList nodes\n * @default 'orderedList'\n * @example 'myCustomOrderedList'\n */\n orderedListTypeName: string\n}\n\n/**\n * This extension allows you to create list items.\n * @see https://www.tiptap.dev/api/nodes/list-item\n */\nexport const ListItem = Node.create<ListItemOptions>({\n name: 'listItem',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n bulletListTypeName: 'bulletList',\n orderedListTypeName: 'orderedList',\n }\n },\n\n content: 'paragraph block*',\n\n defining: true,\n\n parseHTML() {\n return [\n {\n tag: 'li',\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['li', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addKeyboardShortcuts() {\n return {\n Enter: () => this.editor.commands.splitListItem(this.name),\n Tab: () => this.editor.commands.sinkListItem(this.name),\n 'Shift-Tab': () => this.editor.commands.liftListItem(this.name),\n }\n },\n})\n","import { ListItem } from './list-item.js'\n\nexport * from './list-item.js'\n\nexport default ListItem\n"],"mappings":";AAAA,SAAS,iBAAiB,YAAY;AA6B/B,IAAM,WAAW,KAAK,OAAwB;AAAA,EACnD,MAAM;AAAA,EAEN,aAAa;AACX,WAAO;AAAA,MACL,gBAAgB,CAAC;AAAA,MACjB,oBAAoB;AAAA,MACpB,qBAAqB;AAAA,IACvB;AAAA,EACF;AAAA,EAEA,SAAS;AAAA,EAET,UAAU;AAAA,EAEV,YAAY;AACV,WAAO;AAAA,MACL;AAAA,QACE,KAAK;AAAA,MACP;AAAA,IACF;AAAA,EACF;AAAA,EAEA,WAAW,EAAE,eAAe,GAAG;AAC7B,WAAO,CAAC,MAAM,gBAAgB,KAAK,QAAQ,gBAAgB,cAAc,GAAG,CAAC;AAAA,EAC/E;AAAA,EAEA,uBAAuB;AACrB,WAAO;AAAA,MACL,OAAO,MAAM,KAAK,OAAO,SAAS,cAAc,KAAK,IAAI;AAAA,MACzD,KAAK,MAAM,KAAK,OAAO,SAAS,aAAa,KAAK,IAAI;AAAA,MACtD,aAAa,MAAM,KAAK,OAAO,SAAS,aAAa,KAAK,IAAI;AAAA,IAChE;AAAA,EACF;AACF,CAAC;;;AC3DD,IAAO,gBAAQ;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { ListItem } from '@tiptap/extension-list'\n\nexport { ListItem, ListItemOptions } from '@tiptap/extension-list'\n\nexport default ListItem\n"],"mappings":";AAAA,SAAS,gBAAgB;AAEzB,SAAS,YAAAA,WAAU,uBAAuB;AAE1C,IAAO,gBAAQ;","names":["ListItem"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tiptap/extension-list-item",
3
3
  "description": "list item 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 { ListItem } from './list-item.js'
1
+ import { ListItem } from '@tiptap/extension-list'
2
2
 
3
- export * from './list-item.js'
3
+ export { ListItem, ListItemOptions } from '@tiptap/extension-list'
4
4
 
5
5
  export default ListItem
package/src/list-item.ts DELETED
@@ -1,64 +0,0 @@
1
- import { mergeAttributes, Node } from '@tiptap/core'
2
-
3
- export interface ListItemOptions {
4
- /**
5
- * The HTML attributes for a list item node.
6
- * @default {}
7
- * @example { class: 'foo' }
8
- */
9
- HTMLAttributes: Record<string, any>
10
-
11
- /**
12
- * The node type for bulletList nodes
13
- * @default 'bulletList'
14
- * @example 'myCustomBulletList'
15
- */
16
- bulletListTypeName: string
17
-
18
- /**
19
- * The node type for orderedList nodes
20
- * @default 'orderedList'
21
- * @example 'myCustomOrderedList'
22
- */
23
- orderedListTypeName: string
24
- }
25
-
26
- /**
27
- * This extension allows you to create list items.
28
- * @see https://www.tiptap.dev/api/nodes/list-item
29
- */
30
- export const ListItem = Node.create<ListItemOptions>({
31
- name: 'listItem',
32
-
33
- addOptions() {
34
- return {
35
- HTMLAttributes: {},
36
- bulletListTypeName: 'bulletList',
37
- orderedListTypeName: 'orderedList',
38
- }
39
- },
40
-
41
- content: 'paragraph block*',
42
-
43
- defining: true,
44
-
45
- parseHTML() {
46
- return [
47
- {
48
- tag: 'li',
49
- },
50
- ]
51
- },
52
-
53
- renderHTML({ HTMLAttributes }) {
54
- return ['li', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]
55
- },
56
-
57
- addKeyboardShortcuts() {
58
- return {
59
- Enter: () => this.editor.commands.splitListItem(this.name),
60
- Tab: () => this.editor.commands.sinkListItem(this.name),
61
- 'Shift-Tab': () => this.editor.commands.liftListItem(this.name),
62
- }
63
- },
64
- })