@tiptap/extension-ordered-list 2.0.0-beta.17 → 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/dist/packages/extension-ordered-list/src/ordered-list.d.ts +1 -1
- package/dist/tiptap-extension-ordered-list.cjs.js +4 -2
- package/dist/tiptap-extension-ordered-list.cjs.js.map +1 -1
- package/dist/tiptap-extension-ordered-list.esm.js +4 -2
- package/dist/tiptap-extension-ordered-list.esm.js.map +1 -1
- package/dist/tiptap-extension-ordered-list.umd.js +4 -2
- package/dist/tiptap-extension-ordered-list.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/ordered-list.ts +4 -2
|
@@ -7,8 +7,10 @@ var core = require('@tiptap/core');
|
|
|
7
7
|
const inputRegex = /^(\d+)\.\s$/;
|
|
8
8
|
const OrderedList = core.Node.create({
|
|
9
9
|
name: 'orderedList',
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
addOptions() {
|
|
11
|
+
return {
|
|
12
|
+
HTMLAttributes: {},
|
|
13
|
+
};
|
|
12
14
|
},
|
|
13
15
|
group: 'block list',
|
|
14
16
|
content: 'listItem+',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiptap-extension-ordered-list.cjs.js","sources":["../src/ordered-list.ts"],"sourcesContent":["import { Node, mergeAttributes, wrappingInputRule } from '@tiptap/core'\n\nexport interface OrderedListOptions {\n HTMLAttributes: Record<string, any>,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n orderedList: {\n /**\n * Toggle an ordered list\n */\n toggleOrderedList: () => ReturnType,\n }\n }\n}\n\nexport const inputRegex = /^(\\d+)\\.\\s$/\n\nexport const OrderedList = Node.create<OrderedListOptions>({\n name: 'orderedList',\n\n
|
|
1
|
+
{"version":3,"file":"tiptap-extension-ordered-list.cjs.js","sources":["../src/ordered-list.ts"],"sourcesContent":["import { Node, mergeAttributes, wrappingInputRule } from '@tiptap/core'\n\nexport interface OrderedListOptions {\n HTMLAttributes: Record<string, any>,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n orderedList: {\n /**\n * Toggle an ordered list\n */\n toggleOrderedList: () => ReturnType,\n }\n }\n}\n\nexport const inputRegex = /^(\\d+)\\.\\s$/\n\nexport const OrderedList = Node.create<OrderedListOptions>({\n name: 'orderedList',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n group: 'block list',\n\n content: 'listItem+',\n\n addAttributes() {\n return {\n start: {\n default: 1,\n parseHTML: element => {\n return element.hasAttribute('start')\n ? parseInt(element.getAttribute('start') || '', 10)\n : 1\n },\n },\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'ol',\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n const { start, ...attributesWithoutStart } = HTMLAttributes\n\n return start === 1\n ? ['ol', mergeAttributes(this.options.HTMLAttributes, attributesWithoutStart), 0]\n : ['ol', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n toggleOrderedList: () => ({ commands }) => {\n return commands.toggleList('orderedList', 'listItem')\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Shift-7': () => this.editor.commands.toggleOrderedList(),\n }\n },\n\n addInputRules() {\n return [\n wrappingInputRule({\n find: inputRegex,\n type: this.type,\n getAttributes: match => ({ start: +match[1] }),\n joinPredicate: (match, node) => node.childCount + node.attrs.start === +match[1],\n }),\n ]\n },\n})\n"],"names":["Node","mergeAttributes","wrappingInputRule"],"mappings":";;;;;;MAiBa,UAAU,GAAG,cAAa;MAE1B,WAAW,GAAGA,SAAI,CAAC,MAAM,CAAqB;IACzD,IAAI,EAAE,aAAa;IAEnB,UAAU;QACR,OAAO;YACL,cAAc,EAAE,EAAE;SACnB,CAAA;KACF;IAED,KAAK,EAAE,YAAY;IAEnB,OAAO,EAAE,WAAW;IAEpB,aAAa;QACX,OAAO;YACL,KAAK,EAAE;gBACL,OA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,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;aACjF,CAAC;SACH,CAAA;KACF;CACF;;;;;;"}
|
|
@@ -3,8 +3,10 @@ import { Node, mergeAttributes, wrappingInputRule } from '@tiptap/core';
|
|
|
3
3
|
const inputRegex = /^(\d+)\.\s$/;
|
|
4
4
|
const OrderedList = Node.create({
|
|
5
5
|
name: 'orderedList',
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
addOptions() {
|
|
7
|
+
return {
|
|
8
|
+
HTMLAttributes: {},
|
|
9
|
+
};
|
|
8
10
|
},
|
|
9
11
|
group: 'block list',
|
|
10
12
|
content: 'listItem+',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiptap-extension-ordered-list.esm.js","sources":["../src/ordered-list.ts"],"sourcesContent":["import { Node, mergeAttributes, wrappingInputRule } from '@tiptap/core'\n\nexport interface OrderedListOptions {\n HTMLAttributes: Record<string, any>,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n orderedList: {\n /**\n * Toggle an ordered list\n */\n toggleOrderedList: () => ReturnType,\n }\n }\n}\n\nexport const inputRegex = /^(\\d+)\\.\\s$/\n\nexport const OrderedList = Node.create<OrderedListOptions>({\n name: 'orderedList',\n\n
|
|
1
|
+
{"version":3,"file":"tiptap-extension-ordered-list.esm.js","sources":["../src/ordered-list.ts"],"sourcesContent":["import { Node, mergeAttributes, wrappingInputRule } from '@tiptap/core'\n\nexport interface OrderedListOptions {\n HTMLAttributes: Record<string, any>,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n orderedList: {\n /**\n * Toggle an ordered list\n */\n toggleOrderedList: () => ReturnType,\n }\n }\n}\n\nexport const inputRegex = /^(\\d+)\\.\\s$/\n\nexport const OrderedList = Node.create<OrderedListOptions>({\n name: 'orderedList',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n group: 'block list',\n\n content: 'listItem+',\n\n addAttributes() {\n return {\n start: {\n default: 1,\n parseHTML: element => {\n return element.hasAttribute('start')\n ? parseInt(element.getAttribute('start') || '', 10)\n : 1\n },\n },\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'ol',\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n const { start, ...attributesWithoutStart } = HTMLAttributes\n\n return start === 1\n ? ['ol', mergeAttributes(this.options.HTMLAttributes, attributesWithoutStart), 0]\n : ['ol', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n toggleOrderedList: () => ({ commands }) => {\n return commands.toggleList('orderedList', 'listItem')\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Shift-7': () => this.editor.commands.toggleOrderedList(),\n }\n },\n\n addInputRules() {\n return [\n wrappingInputRule({\n find: inputRegex,\n type: this.type,\n getAttributes: match => ({ start: +match[1] }),\n joinPredicate: (match, node) => node.childCount + node.attrs.start === +match[1],\n }),\n ]\n },\n})\n"],"names":[],"mappings":";;MAiBa,UAAU,GAAG,cAAa;MAE1B,WAAW,GAAG,IAAI,CAAC,MAAM,CAAqB;IACzD,IAAI,EAAE,aAAa;IAEnB,UAAU;QACR,OAAO;YACL,cAAc,EAAE,EAAE;SACnB,CAAA;KACF;IAED,KAAK,EAAE,YAAY;IAEnB,OAAO,EAAE,WAAW;IAEpB,aAAa;QACX,OAAO;YACL,KAAK,EAAE;gBACL,OAAO,EAAE,CAAC;gBACV,SAAS,EAAE,OAAO;oBAChB,OAAO,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC;0BAChC,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC;0BACjD,CAAC,CAAA;iBACN;aACF;SACF,CAAA;KACF;IAED,SAAS;QACP,OAAO;YACL;gBACE,GAAG,EAAE,IAAI;aACV;SACF,CAAA;KACF;IAED,UAAU,CAAC,EAAE,cAAc,EAAE;QAC3B,MAAM,EAAE,KAAK,EAAE,GAAG,sBAAsB,EAAE,GAAG,cAAc,CAAA;QAE3D,OAAO,KAAK,KAAK,CAAC;cACd,CAAC,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,sBAAsB,CAAC,EAAE,CAAC,CAAC;cAC/E,CAAC,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC,CAAA;KAC5E;IAED,WAAW;QACT,OAAO;YACL,iBAAiB,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;gBACpC,OAAO,QAAQ,CAAC,UAAU,CAAC,aAAa,EAAE,UAAU,CAAC,CAAA;aACtD;SACF,CAAA;KACF;IAED,oBAAoB;QAClB,OAAO;YACL,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,EAAE;SAC9D,CAAA;KACF;IAED,aAAa;QACX,OAAO;YACL,iBAAiB,CAAC;gBAChB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,aAAa,EAAE,KAAK,KAAK,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC9C,aAAa,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;aACjF,CAAC;SACH,CAAA;KACF;CACF;;;;"}
|
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
const inputRegex = /^(\d+)\.\s$/;
|
|
8
8
|
const OrderedList = core.Node.create({
|
|
9
9
|
name: 'orderedList',
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
addOptions() {
|
|
11
|
+
return {
|
|
12
|
+
HTMLAttributes: {},
|
|
13
|
+
};
|
|
12
14
|
},
|
|
13
15
|
group: 'block list',
|
|
14
16
|
content: 'listItem+',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiptap-extension-ordered-list.umd.js","sources":["../src/ordered-list.ts"],"sourcesContent":["import { Node, mergeAttributes, wrappingInputRule } from '@tiptap/core'\n\nexport interface OrderedListOptions {\n HTMLAttributes: Record<string, any>,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n orderedList: {\n /**\n * Toggle an ordered list\n */\n toggleOrderedList: () => ReturnType,\n }\n }\n}\n\nexport const inputRegex = /^(\\d+)\\.\\s$/\n\nexport const OrderedList = Node.create<OrderedListOptions>({\n name: 'orderedList',\n\n
|
|
1
|
+
{"version":3,"file":"tiptap-extension-ordered-list.umd.js","sources":["../src/ordered-list.ts"],"sourcesContent":["import { Node, mergeAttributes, wrappingInputRule } from '@tiptap/core'\n\nexport interface OrderedListOptions {\n HTMLAttributes: Record<string, any>,\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n orderedList: {\n /**\n * Toggle an ordered list\n */\n toggleOrderedList: () => ReturnType,\n }\n }\n}\n\nexport const inputRegex = /^(\\d+)\\.\\s$/\n\nexport const OrderedList = Node.create<OrderedListOptions>({\n name: 'orderedList',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n group: 'block list',\n\n content: 'listItem+',\n\n addAttributes() {\n return {\n start: {\n default: 1,\n parseHTML: element => {\n return element.hasAttribute('start')\n ? parseInt(element.getAttribute('start') || '', 10)\n : 1\n },\n },\n }\n },\n\n parseHTML() {\n return [\n {\n tag: 'ol',\n },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n const { start, ...attributesWithoutStart } = HTMLAttributes\n\n return start === 1\n ? ['ol', mergeAttributes(this.options.HTMLAttributes, attributesWithoutStart), 0]\n : ['ol', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n addCommands() {\n return {\n toggleOrderedList: () => ({ commands }) => {\n return commands.toggleList('orderedList', 'listItem')\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n 'Mod-Shift-7': () => this.editor.commands.toggleOrderedList(),\n }\n },\n\n addInputRules() {\n return [\n wrappingInputRule({\n find: inputRegex,\n type: this.type,\n getAttributes: match => ({ start: +match[1] }),\n joinPredicate: (match, node) => node.childCount + node.attrs.start === +match[1],\n }),\n ]\n },\n})\n"],"names":["Node","mergeAttributes","wrappingInputRule"],"mappings":";;;;;;QAiBa,UAAU,GAAG,cAAa;QAE1B,WAAW,GAAGA,SAAI,CAAC,MAAM,CAAqB;MACzD,IAAI,EAAE,aAAa;MAEnB,UAAU;UACR,OAAO;cACL,cAAc,EAAE,EAAE;WACnB,CAAA;OACF;MAED,KAAK,EAAE,YAAY;MAEnB,OAAO,EAAE,WAAW;MAEpB,aAAa;UACX,OAAO;cACL,KAAK,EAAE;kBACL,OAAO,EAAE,CAAC;kBACV,SAAS,EAAE,OAAO;sBAChB,OAAO,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC;4BAChC,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC;4BACjD,CAAC,CAAA;mBACN;eACF;WACF,CAAA;OACF;MAED,SAAS;UACP,OAAO;cACL;kBACE,GAAG,EAAE,IAAI;eACV;WACF,CAAA;OACF;MAED,UAAU,CAAC,EAAE,cAAc,EAAE;UAC3B,MAAM,EAAE,KAAK,EAAE,GAAG,sBAAsB,EAAE,GAAG,cAAc,CAAA;UAE3D,OAAO,KAAK,KAAK,CAAC;gBACd,CAAC,IAAI,EAAEC,oBAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,sBAAsB,CAAC,EAAE,CAAC,CAAC;gBAC/E,CAAC,IAAI,EAAEA,oBAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC,CAAA;OAC5E;MAED,WAAW;UACT,OAAO;cACL,iBAAiB,EAAE,MAAM,CAAC,EAAE,QAAQ,EAAE;kBACpC,OAAO,QAAQ,CAAC,UAAU,CAAC,aAAa,EAAE,UAAU,CAAC,CAAA;eACtD;WACF,CAAA;OACF;MAED,oBAAoB;UAClB,OAAO;cACL,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,EAAE;WAC9D,CAAA;OACF;MAED,aAAa;UACX,OAAO;cACLC,sBAAiB,CAAC;kBAChB,IAAI,EAAE,UAAU;kBAChB,IAAI,EAAE,IAAI,CAAC,IAAI;kBACf,aAAa,EAAE,KAAK,KAAK,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;kBAC9C,aAAa,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;eACjF,CAAC;WACH,CAAA;OACF;GACF;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/extension-ordered-list",
|
|
3
3
|
"description": "ordered list extension for tiptap",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.20",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"url": "https://github.com/ueberdosis/tiptap",
|
|
29
29
|
"directory": "packages/extension-ordered-list"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "642627ec3635a1d8fa851887d75bee5f193ec63b"
|
|
32
32
|
}
|
package/src/ordered-list.ts
CHANGED
|
@@ -20,8 +20,10 @@ export const inputRegex = /^(\d+)\.\s$/
|
|
|
20
20
|
export const OrderedList = Node.create<OrderedListOptions>({
|
|
21
21
|
name: 'orderedList',
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
addOptions() {
|
|
24
|
+
return {
|
|
25
|
+
HTMLAttributes: {},
|
|
26
|
+
}
|
|
25
27
|
},
|
|
26
28
|
|
|
27
29
|
group: 'block list',
|