@pie-element/shared-editor-runtime 0.1.2 → 0.1.3-next.20261019151920

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.
Files changed (45) hide show
  1. package/dist/browser/{dist-CbvLhouk.js → dist-1Ah9gEL8.js} +315 -290
  2. package/dist/browser/dist-1Ah9gEL8.js.map +1 -0
  3. package/dist/browser/{dist-Pg4oVkv2.js → dist-BVA3Sgbc.js} +66 -57
  4. package/dist/browser/dist-BVA3Sgbc.js.map +1 -0
  5. package/dist/browser/{dist-BLT2aMxu.js → dist-C2dWnbCz.js} +9 -18
  6. package/dist/browser/dist-C2dWnbCz.js.map +1 -0
  7. package/dist/browser/{dist-DwhlRAyY.js → dist-COqKtKEY.js} +27 -20
  8. package/dist/browser/dist-COqKtKEY.js.map +1 -0
  9. package/dist/browser/{dist-CJhbhuk0.js → dist-C_bRf4Tj.js} +17 -17
  10. package/dist/browser/dist-C_bRf4Tj.js.map +1 -0
  11. package/dist/browser/prosemirror-state/index.js +1 -2
  12. package/dist/browser/tiptap-core/index.js +1 -2
  13. package/dist/browser/tiptap-extension-character-count/index.js +1 -1
  14. package/dist/browser/tiptap-extension-character-count/index.js.map +1 -1
  15. package/dist/browser/tiptap-extension-image/index.js +6 -10
  16. package/dist/browser/tiptap-extension-image/index.js.map +1 -1
  17. package/dist/browser/tiptap-extension-list-item/index.js +1 -1
  18. package/dist/browser/tiptap-extension-list-item/index.js.map +1 -1
  19. package/dist/browser/tiptap-extension-placeholder/index.js +1 -1
  20. package/dist/browser/tiptap-extension-placeholder/index.js.map +1 -1
  21. package/dist/browser/tiptap-extension-subscript/index.js +1 -1
  22. package/dist/browser/tiptap-extension-subscript/index.js.map +1 -1
  23. package/dist/browser/tiptap-extension-superscript/index.js +1 -1
  24. package/dist/browser/tiptap-extension-superscript/index.js.map +1 -1
  25. package/dist/browser/tiptap-extension-table/index.js +1 -2
  26. package/dist/browser/tiptap-extension-table-cell/index.js +1 -1
  27. package/dist/browser/tiptap-extension-table-cell/index.js.map +1 -1
  28. package/dist/browser/tiptap-extension-table-header/index.js +1 -1
  29. package/dist/browser/tiptap-extension-table-header/index.js.map +1 -1
  30. package/dist/browser/tiptap-extension-table-row/index.js +1 -1
  31. package/dist/browser/tiptap-extension-table-row/index.js.map +1 -1
  32. package/dist/browser/tiptap-extension-text-align/index.js +1 -1
  33. package/dist/browser/tiptap-extension-text-align/index.js.map +1 -1
  34. package/dist/browser/tiptap-extension-text-style/index.js +1 -1
  35. package/dist/browser/tiptap-extension-text-style/index.js.map +1 -1
  36. package/dist/browser/tiptap-extensions/index.js +1 -2
  37. package/dist/browser/tiptap-pm-state/index.js +1 -2
  38. package/dist/browser/tiptap-starter-kit/index.js +6 -14
  39. package/dist/browser/tiptap-starter-kit/index.js.map +1 -1
  40. package/package.json +1 -1
  41. package/dist/browser/dist-BLT2aMxu.js.map +0 -1
  42. package/dist/browser/dist-CJhbhuk0.js.map +0 -1
  43. package/dist/browser/dist-CbvLhouk.js.map +0 -1
  44. package/dist/browser/dist-DwhlRAyY.js.map +0 -1
  45. package/dist/browser/dist-Pg4oVkv2.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/shared-editor-runtime",
3
- "version": "0.1.2",
3
+ "version": "0.1.3-next.20261019151920",
4
4
  "description": "Browser ESM build of the tiptap editor engine that PIE element editor-runtime variants share",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"dist-BLT2aMxu.js","names":[],"sources":["../../../../../node_modules/.bun/@tiptap+extension-list@3.31.4+e39601fe346c19ab/node_modules/@tiptap/extension-list/dist/index.js"],"sourcesContent":["import { t as __exportAll } from \"./rolldown-runtime-D7D4PA-g.js\";\nimport { Extension, Node, getNodeAtPosition, getNodeType, getPreviousBlockSibling, getRenderedAttributes, isAtEndOfNode, isAtStartOfNode, isNodeActive, mergeAttributes, parseIndentedBlocks, renderNestedMarkdownContent, wrappingInputRule } from \"@tiptap/core\";\nimport { Fragment } from \"@tiptap/pm/model\";\nimport { Plugin, TextSelection } from \"@tiptap/pm/state\";\n//#region src/bullet-list/bullet-list.ts\nconst ListItemName$1 = \"listItem\";\nconst TextStyleName$1 = \"textStyle\";\n/**\n* Matches a bullet list to a dash or asterisk.\n*/\nconst bulletListInputRegex = /^\\s*([-+*])\\s$/;\n/**\n* This extension allows you to create bullet lists.\n* This requires the ListItem extension\n* @see https://tiptap.dev/api/nodes/bullet-list\n* @see https://tiptap.dev/api/nodes/list-item.\n*/\nconst BulletList = Node.create({\n\tname: \"bulletList\",\n\taddOptions() {\n\t\treturn {\n\t\t\titemTypeName: \"listItem\",\n\t\t\tHTMLAttributes: {},\n\t\t\tkeepMarks: false,\n\t\t\tkeepAttributes: false\n\t\t};\n\t},\n\tgroup: \"block list\",\n\tcontent() {\n\t\treturn `${this.options.itemTypeName}+`;\n\t},\n\tparseHTML() {\n\t\treturn [{ tag: \"ul\" }];\n\t},\n\trenderHTML({ HTMLAttributes }) {\n\t\treturn [\n\t\t\t\"ul\",\n\t\t\tmergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n\t\t\t0\n\t\t];\n\t},\n\tmarkdownTokenName: \"list\",\n\tparseMarkdown: (token, helpers) => {\n\t\tif (token.type !== \"list\" || token.ordered) return [];\n\t\treturn {\n\t\t\ttype: \"bulletList\",\n\t\t\tcontent: token.items ? helpers.parseChildren(token.items) : []\n\t\t};\n\t},\n\trenderMarkdown: (node, h) => {\n\t\tif (!node.content) return \"\";\n\t\treturn h.renderChildren(node.content, \"\\n\");\n\t},\n\tmarkdownOptions: { indentsContent: true },\n\taddCommands() {\n\t\treturn { toggleBulletList: () => ({ commands, chain }) => {\n\t\t\tif (this.options.keepAttributes) return chain().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ListItemName$1, this.editor.getAttributes(TextStyleName$1)).run();\n\t\t\treturn commands.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks);\n\t\t} };\n\t},\n\taddKeyboardShortcuts() {\n\t\treturn { \"Mod-Shift-8\": () => this.editor.commands.toggleBulletList() };\n\t},\n\taddInputRules() {\n\t\tlet inputRule = wrappingInputRule({\n\t\t\tfind: bulletListInputRegex,\n\t\t\ttype: this.type\n\t\t});\n\t\tif (this.options.keepMarks || this.options.keepAttributes) inputRule = wrappingInputRule({\n\t\t\tfind: bulletListInputRegex,\n\t\t\ttype: this.type,\n\t\t\tkeepMarks: this.options.keepMarks,\n\t\t\tkeepAttributes: this.options.keepAttributes,\n\t\t\tgetAttributes: () => {\n\t\t\t\treturn this.editor.getAttributes(TextStyleName$1);\n\t\t\t},\n\t\t\teditor: this.editor\n\t\t});\n\t\treturn [inputRule];\n\t}\n});\n//#endregion\n//#region src/helpers/getBranchingNestedListAtCursor.ts\n/**\n* Resolves a branching nested list immediately after the cursor when the selection is\n* collapsed at the end of a textblock inside a list item.\n*\n* @param state - The editor state to inspect.\n* @param itemName - The list item node name (for example `listItem` or `taskItem`).\n* @param wrapperNames - List wrapper node names (for example `bulletList` and `orderedList`).\n* @returns Resolved positions and nodes for hoisting, or `null` when not applicable.\n*\n* @example\n* ```ts\n* const context = getBranchingNestedListAtCursor(editor.state, 'listItem', [\n* 'bulletList',\n* 'orderedList',\n* ])\n*\n* if (context) {\n* // cursor is at the end of Item 1 before a branching nested sublist\n* }\n* ```\n*/\nconst getBranchingNestedListAtCursor = (state, itemName, wrapperNames) => {\n\tconst { selection } = state;\n\tif (!selection.empty) return null;\n\tconst { $from } = selection;\n\tif (!$from.parent.isTextblock) return null;\n\tif ($from.parentOffset !== $from.parent.content.size) return null;\n\tlet listItemDepth = -1;\n\tfor (let depth = $from.depth; depth > 0; depth -= 1) if ($from.node(depth).type.name === itemName) {\n\t\tlistItemDepth = depth;\n\t\tbreak;\n\t}\n\tif (listItemDepth < 0) return null;\n\tconst listItem = $from.node(listItemDepth);\n\tconst indexInListItem = $from.index(listItemDepth);\n\tif (indexInListItem + 1 >= listItem.childCount) return null;\n\tconst nextChild = listItem.child(indexInListItem + 1);\n\tif (!wrapperNames.includes(nextChild.type.name)) return null;\n\tconst itemType = state.schema.nodes[itemName];\n\tlet hasBranching = false;\n\tnextChild.forEach((child) => {\n\t\tif (child.type === itemType && child.childCount > 1) hasBranching = true;\n\t});\n\tif (!hasBranching) return null;\n\tconst nodeAfter = state.doc.resolve($from.after()).nodeAfter;\n\tif (!nodeAfter || !wrapperNames.includes(nodeAfter.type.name)) return null;\n\tconst items = [];\n\tnodeAfter.forEach((child) => {\n\t\titems.push(child);\n\t});\n\tif (items.length === 0) return null;\n\treturn {\n\t\tlistItemDepth,\n\t\tnestedList: nodeAfter,\n\t\tnestedListPos: $from.after(),\n\t\tinsertPos: $from.after(listItemDepth),\n\t\titems\n\t};\n};\n//#endregion\n//#region src/helpers/hoistBranchingNestedList.ts\n/**\n* Hoists all list items from a branching nested list after the cursor into the parent list.\n*\n* Use this when `joinForward` cannot restructure a nested list that contains list items\n* with sublists (see issue #6906).\n*\n* @param state - The editor state to transform.\n* @param dispatch - Optional dispatch function for the transaction.\n* @param itemName - The list item node name (for example `listItem` or `taskItem`).\n* @param wrapperNames - List wrapper node names (for example `bulletList` and `orderedList`).\n* @returns `true` when the nested list was hoisted, otherwise `false`.\n*\n* @example\n* ```ts\n* // Cursor at the end of \"Item 1\" before a nested list with branching items.\n* hoistBranchingNestedList(editor.state, editor.view.dispatch, 'listItem', [\n* 'bulletList',\n* 'orderedList',\n* ])\n* ```\n*/\nconst hoistBranchingNestedList = (state, dispatch, itemName, wrapperNames) => {\n\tconst context = getBranchingNestedListAtCursor(state, itemName, wrapperNames);\n\tif (!context) return false;\n\tconst { selection } = state;\n\tconst { nestedList, nestedListPos, insertPos, items } = context;\n\tconst tr = state.tr;\n\ttr.delete(nestedListPos, nestedListPos + nestedList.nodeSize);\n\tconst mappedInsertPos = tr.mapping.map(insertPos);\n\ttr.insert(mappedInsertPos, Fragment.from(items));\n\ttr.setSelection(selection.map(tr.doc, tr.mapping));\n\tif (dispatch) dispatch(tr);\n\treturn true;\n};\n//#endregion\n//#region src/helpers/handleDeleteBranchingNestedList.ts\n/**\n* Handles Delete for a list item when a branching nested sublist follows the cursor.\n*\n* @param editor - The editor instance whose state should be updated.\n* @param itemName - The list item node name (for example `listItem` or `taskItem`).\n* @param wrapperNames - List wrapper node names (for example `bulletList` and `orderedList`).\n* @returns `true` when the nested list was hoisted, otherwise `false`.\n*\n* @example\n* ```ts\n* Delete: () =>\n* handleDeleteBranchingNestedList(editor, 'listItem', ['bulletList', 'orderedList']),\n* ```\n*/\nconst handleDeleteBranchingNestedList = (editor, itemName, wrapperNames) => {\n\treturn hoistBranchingNestedList(editor.state, editor.view.dispatch, itemName, wrapperNames);\n};\n//#endregion\n//#region src/helpers/createBranchingListDeleteKeymap.ts\n/**\n* Creates a high-priority keymap extension that handles Delete for branching nested lists.\n* Kept separate from the list item node so Enter/Tab shortcuts keep their default priority.\n*/\nconst createBranchingListDeleteKeymap = (itemName, wrapperNames) => {\n\treturn Extension.create({\n\t\tname: `${itemName}BranchingDeleteKeymap`,\n\t\tpriority: 101,\n\t\taddKeyboardShortcuts() {\n\t\t\tconst handleDelete = () => handleDeleteBranchingNestedList(this.editor, itemName, wrapperNames);\n\t\t\treturn {\n\t\t\t\tDelete: handleDelete,\n\t\t\t\t\"Mod-Delete\": handleDelete\n\t\t\t};\n\t\t}\n\t});\n};\n//#endregion\n//#region src/ordered-list/roman.ts\nconst ROMAN_NUMERALS = [\n\t[1e3, \"m\"],\n\t[900, \"cm\"],\n\t[500, \"d\"],\n\t[400, \"cd\"],\n\t[100, \"c\"],\n\t[90, \"xc\"],\n\t[50, \"l\"],\n\t[40, \"xl\"],\n\t[10, \"x\"],\n\t[9, \"ix\"],\n\t[5, \"v\"],\n\t[4, \"iv\"],\n\t[1, \"i\"]\n];\nconst ALPHA_NUMERALS = \"abcdefghijklmnopqrstuvwxyz\";\n/**\n* Marker segment for ordered list lines: numeric, roman, or 1–2 letter alpha.\n* Roman is matched before alpha so \"iii\" is roman; invalid romans like \"aa\" fall through to alpha.\n*/\nconst ORDERED_LIST_MARKER_PATTERN = String.raw`\\d+|[ivxlcdmIVXLCDM]+|${\"[a-zA-Z]{1,2}\"}`;\n/**\n* Convert a number to lowercase roman numerals.\n* @example toRoman(1) // 'i'\n* @example toRoman(4) // 'iv'\n*/\nfunction toRoman(num) {\n\tlet remaining = num;\n\tlet result = \"\";\n\tfor (const [value, numeral] of ROMAN_NUMERALS) while (remaining >= value) {\n\t\tresult += numeral;\n\t\tremaining -= value;\n\t}\n\treturn result;\n}\n/**\n* Convert a number to uppercase roman numerals.\n* @example toRomanUpper(1) // 'I'\n* @example toRomanUpper(4) // 'IV'\n*/\nfunction toRomanUpper(num) {\n\treturn toRoman(num).toUpperCase();\n}\nfunction fromRoman(roman) {\n\tconst lower = roman.toLowerCase();\n\tlet index = 0;\n\tlet result = 0;\n\twhile (index < lower.length) {\n\t\tlet matched = false;\n\t\tfor (const [value, numeral] of ROMAN_NUMERALS) if (lower.startsWith(numeral, index)) {\n\t\t\tresult += value;\n\t\t\tindex += numeral.length;\n\t\t\tmatched = true;\n\t\t\tbreak;\n\t\t}\n\t\tif (!matched) return 0;\n\t}\n\treturn result;\n}\nfunction isValidRoman(marker) {\n\tif (!/^[ivxlcdmIVXLCDM]+$/.test(marker)) return false;\n\tconst value = fromRoman(marker);\n\tif (value <= 0) return false;\n\treturn (marker === marker.toLowerCase() ? toRoman(value) : toRomanUpper(value)) === marker;\n}\nfunction fromAlpha(marker) {\n\tconst lower = marker.toLowerCase();\n\tif (lower.length === 1) return lower.charCodeAt(0) - \"a\".charCodeAt(0) + 1;\n\tif (lower.length === 2) {\n\t\tconst first = lower.charCodeAt(0) - \"a\".charCodeAt(0);\n\t\tconst second = lower.charCodeAt(1) - \"a\".charCodeAt(0);\n\t\treturn (first + 1) * 26 + second + 1;\n\t}\n\treturn 0;\n}\nfunction toRomanAlpha(num) {\n\tif (num <= 26) return ALPHA_NUMERALS[num - 1];\n\tconst first = Math.floor((num - 1) / 26) - 1;\n\tconst second = (num - 1) % 26;\n\tif (first < 0) return ALPHA_NUMERALS[second];\n\treturn ALPHA_NUMERALS[first] + ALPHA_NUMERALS[second];\n}\n/**\n* Extract the list marker type from a marker string.\n* Supports \"1\", \"a\", \"A\", \"i\", \"I\" marker styles.\n*\n* @param marker The text content of the list marker (e.g. \"a\", \"1\", \"iii\", \"b\")\n* @returns The normalized type string, or undefined for default numeric type\n*/\nfunction detectMarkerType(marker) {\n\tif (!marker || /^\\d+$/.test(marker)) return;\n\tif (isValidRoman(marker)) return marker === marker.toLowerCase() ? \"i\" : \"I\";\n\tif (/^[a-z]{1,2}$/.test(marker)) return \"a\";\n\tif (/^[A-Z]{1,2}$/.test(marker)) return \"A\";\n}\n/**\n* Convert a list marker string to its numeric start position.\n*\n* @param marker The text content of the list marker (e.g. \"3\", \"b\", \"II\")\n* @returns The 1-based start value for the ordered list\n*/\nfunction markerToStart(marker) {\n\tif (/^\\d+$/.test(marker)) return parseInt(marker, 10);\n\tconst type = detectMarkerType(marker);\n\tif (type === \"i\" || type === \"I\") return fromRoman(marker);\n\tif (type === \"a\" || type === \"A\") {\n\t\tconst start = fromAlpha(marker);\n\t\treturn start > 0 ? start : 1;\n\t}\n\tconst parsed = parseInt(marker, 10);\n\treturn Number.isNaN(parsed) ? 1 : parsed;\n}\nfunction startToMarker(type, start) {\n\tif (type === \"numeric\") return String(start);\n\tswitch (type) {\n\t\tcase \"a\": return toRomanAlpha(start);\n\t\tcase \"A\": return toRomanAlpha(start).toUpperCase();\n\t\tcase \"i\": return toRoman(start);\n\t\tcase \"I\": return toRomanUpper(start);\n\t\tdefault: return String(start);\n\t}\n}\n/**\n* Returns true when all markers share the same style and increment by 1.\n* Style is inferred from the first marker so ambiguous letters (e.g. \"c\", \"i\")\n* are not re-classified differently on later lines.\n*/\nfunction areOrderedListMarkersSequential(markers) {\n\tvar _detectMarkerType;\n\tif (markers.length === 0) return false;\n\tconst firstType = (_detectMarkerType = detectMarkerType(markers[0])) !== null && _detectMarkerType !== void 0 ? _detectMarkerType : \"numeric\";\n\tconst firstStart = markerToStart(markers[0]);\n\tif (firstStart < 1) return false;\n\tfor (let i = 0; i < markers.length; i++) {\n\t\tconst expected = startToMarker(firstType, firstStart + i);\n\t\tif (markers[i] !== expected) return false;\n\t}\n\treturn true;\n}\n/**\n* Parse a list marker into HTML ordered-list attrs (type + start).\n*/\nfunction parseListMarker(marker) {\n\treturn {\n\t\ttype: detectMarkerType(marker),\n\t\tstart: markerToStart(marker)\n\t};\n}\n/**\n* Build orderedList node attrs from the first list item marker.\n*/\nfunction buildOrderedListAttrsFromMarker(marker) {\n\tconst { type, start } = parseListMarker(marker);\n\tconst attrs = {};\n\tif (type) attrs.type = type;\n\tif (start !== 1) attrs.start = start;\n\treturn attrs;\n}\n/**\n* Returns the list marker prefix for a given item at a given index.\n*\n* @param type The list type attribute (e.g. \"a\", \"A\", \"i\", \"I\", null/undefined for default)\n* @param index The zero-based index of the list item\n* @param separator The separator to use (default: \". \")\n* @returns The marker string (e.g. \"a. \", \"I. \", \"1. \")\n*/\nfunction getListMarker(type, index, separator = \". \") {\n\tconst position = index + 1;\n\tif (!type || type === \"1\") return `${position}${separator}`;\n\tswitch (type) {\n\t\tcase \"a\": return `${toRomanAlpha(position)}${separator}`;\n\t\tcase \"A\": return `${toRomanAlpha(position).toUpperCase()}${separator}`;\n\t\tcase \"i\": return `${toRoman(position)}${separator}`;\n\t\tcase \"I\": return `${toRomanUpper(position)}${separator}`;\n\t\tdefault: return `${position}${separator}`;\n\t}\n}\n//#endregion\n//#region src/item/list-item.ts\nfunction isSameLineOrderedListToken(token) {\n\tvar _token$tokens, _token$tokens2;\n\tconst nestedToken = (_token$tokens = token.tokens) === null || _token$tokens === void 0 ? void 0 : _token$tokens[0];\n\treturn Boolean(token.text && ((_token$tokens2 = token.tokens) === null || _token$tokens2 === void 0 ? void 0 : _token$tokens2.length) === 1 && (nestedToken === null || nestedToken === void 0 ? void 0 : nestedToken.type) === \"list\" && nestedToken.ordered && nestedToken.raw === token.text);\n}\nfunction parseSameLineOrderedListText(text, helpers) {\n\tif (helpers.tokenizeInline) return helpers.parseInline(helpers.tokenizeInline(text));\n\treturn helpers.parseInline([{\n\t\ttype: \"text\",\n\t\traw: text,\n\t\ttext\n\t}]);\n}\n/**\n* This extension allows you to create list items.\n* @see https://www.tiptap.dev/api/nodes/list-item\n*/\nconst ListItem = Node.create({\n\tname: \"listItem\",\n\taddOptions() {\n\t\treturn {\n\t\t\tHTMLAttributes: {},\n\t\t\tbulletListTypeName: \"bulletList\",\n\t\t\torderedListTypeName: \"orderedList\"\n\t\t};\n\t},\n\tcontent: \"paragraph block*\",\n\tdefining: true,\n\tparseHTML() {\n\t\treturn [{ tag: \"li\" }];\n\t},\n\trenderHTML({ HTMLAttributes }) {\n\t\treturn [\n\t\t\t\"li\",\n\t\t\tmergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n\t\t\t0\n\t\t];\n\t},\n\tmarkdownTokenName: \"list_item\",\n\tparseMarkdown: (token, helpers) => {\n\t\tvar _helpers$parseBlockCh;\n\t\tif (token.type !== \"list_item\") return [];\n\t\tconst parseBlockChildren = (_helpers$parseBlockCh = helpers.parseBlockChildren) !== null && _helpers$parseBlockCh !== void 0 ? _helpers$parseBlockCh : helpers.parseChildren;\n\t\tlet content = [];\n\t\tif (token.tokens && token.tokens.length > 0) {\n\t\t\tif (isSameLineOrderedListToken(token)) return {\n\t\t\t\ttype: \"listItem\",\n\t\t\t\tcontent: [{\n\t\t\t\t\ttype: \"paragraph\",\n\t\t\t\t\tcontent: parseSameLineOrderedListText(token.text || \"\", helpers)\n\t\t\t\t}]\n\t\t\t};\n\t\t\tif (token.tokens.some((t) => t.type === \"paragraph\")) content = parseBlockChildren(token.tokens);\n\t\t\telse {\n\t\t\t\tconst firstToken = token.tokens[0];\n\t\t\t\tif (firstToken && firstToken.type === \"text\" && firstToken.tokens && firstToken.tokens.length > 0) {\n\t\t\t\t\tcontent = [{\n\t\t\t\t\t\ttype: \"paragraph\",\n\t\t\t\t\t\tcontent: helpers.parseInline(firstToken.tokens)\n\t\t\t\t\t}];\n\t\t\t\t\tif (token.tokens.length > 1) {\n\t\t\t\t\t\tconst additionalContent = parseBlockChildren(token.tokens.slice(1));\n\t\t\t\t\t\tcontent.push(...additionalContent);\n\t\t\t\t\t}\n\t\t\t\t} else content = parseBlockChildren(token.tokens);\n\t\t\t}\n\t\t}\n\t\tif (content.length === 0) content = [{\n\t\t\ttype: \"paragraph\",\n\t\t\tcontent: []\n\t\t}];\n\t\treturn {\n\t\t\ttype: \"listItem\",\n\t\t\tcontent\n\t\t};\n\t},\n\trenderMarkdown: (node, h, ctx) => {\n\t\treturn renderNestedMarkdownContent(node, h, (context) => {\n\t\t\tif (context.parentType === \"bulletList\") return \"- \";\n\t\t\tif (context.parentType === \"orderedList\") {\n\t\t\t\tvar _context$meta, _context$meta2;\n\t\t\t\tconst start = ((_context$meta = context.meta) === null || _context$meta === void 0 || (_context$meta = _context$meta.parentAttrs) === null || _context$meta === void 0 ? void 0 : _context$meta.start) || 1;\n\t\t\t\treturn getListMarker((_context$meta2 = context.meta) === null || _context$meta2 === void 0 || (_context$meta2 = _context$meta2.parentAttrs) === null || _context$meta2 === void 0 ? void 0 : _context$meta2.type, start - 1 + (context.index || 0), \". \");\n\t\t\t}\n\t\t\treturn \"- \";\n\t\t}, ctx, { alignNestedToPrefix: (ctx === null || ctx === void 0 ? void 0 : ctx.parentType) === \"orderedList\" });\n\t},\n\taddExtensions() {\n\t\treturn [createBranchingListDeleteKeymap(this.name, [this.options.bulletListTypeName, this.options.orderedListTypeName])];\n\t},\n\taddKeyboardShortcuts() {\n\t\treturn {\n\t\t\tEnter: () => this.editor.commands.splitListItem(this.name),\n\t\t\tTab: () => this.editor.commands.sinkListItem(this.name),\n\t\t\t\"Shift-Tab\": () => this.editor.commands.liftListItem(this.name)\n\t\t};\n\t}\n});\n//#endregion\n//#region src/keymap/listHelpers/findListItemPos.ts\nconst findListItemPos = (typeOrName, state) => {\n\tconst { $from } = state.selection;\n\tconst nodeType = getNodeType(typeOrName, state.schema);\n\tlet currentNode = null;\n\tlet currentDepth = $from.depth;\n\tlet currentPos = $from.pos;\n\tlet targetDepth = null;\n\twhile (currentDepth > 0 && targetDepth === null) {\n\t\tcurrentNode = $from.node(currentDepth);\n\t\tif (currentNode.type === nodeType) targetDepth = currentDepth;\n\t\telse {\n\t\t\tcurrentDepth -= 1;\n\t\t\tcurrentPos -= 1;\n\t\t}\n\t}\n\tif (targetDepth === null) return null;\n\treturn {\n\t\t$pos: state.doc.resolve(currentPos),\n\t\tdepth: targetDepth\n\t};\n};\n//#endregion\n//#region src/keymap/listHelpers/getNextListDepth.ts\nconst getNextListDepth = (typeOrName, state) => {\n\tconst listItemPos = findListItemPos(typeOrName, state);\n\tif (!listItemPos) return false;\n\tconst [, depth] = getNodeAtPosition(state, typeOrName, listItemPos.$pos.pos + 4);\n\treturn depth;\n};\n//#endregion\n//#region src/keymap/listHelpers/hasListBefore.ts\nconst hasListBefore = (editorState, name, parentListTypes) => {\n\tconst { $anchor } = editorState.selection;\n\tconst previousNodePos = Math.max(0, $anchor.pos - 2);\n\tconst previousNode = editorState.doc.resolve(previousNodePos).node();\n\tif (!previousNode || !parentListTypes.includes(previousNode.type.name)) return false;\n\treturn true;\n};\n//#endregion\n//#region src/keymap/listHelpers/handleBackspace.ts\nconst handleBackspace = (editor, name, parentListTypes) => {\n\tif (editor.commands.undoInputRule()) return true;\n\tif (editor.state.selection.from !== editor.state.selection.to) return false;\n\tif (!isNodeActive(editor.state, name) && hasListBefore(editor.state, name, parentListTypes)) {\n\t\tconst { $anchor } = editor.state.selection;\n\t\tconst $listPos = editor.state.doc.resolve($anchor.before() - 1);\n\t\tconst listDescendants = [];\n\t\t$listPos.node().descendants((node, pos) => {\n\t\t\tif (node.type.name === name) listDescendants.push({\n\t\t\t\tnode,\n\t\t\t\tpos\n\t\t\t});\n\t\t});\n\t\tconst lastItem = listDescendants.at(-1);\n\t\tif (!lastItem) return false;\n\t\tconst $lastItemPos = editor.state.doc.resolve($listPos.start() + lastItem.pos + 1);\n\t\treturn editor.chain().cut({\n\t\t\tfrom: $anchor.start() - 1,\n\t\t\tto: $anchor.end() + 1\n\t\t}, $lastItemPos.end()).joinForward().run();\n\t}\n\tif (!isNodeActive(editor.state, name)) return false;\n\tif (!isAtStartOfNode(editor.state)) return false;\n\tconst { $from } = editor.state.selection;\n\tconst itemDepth = $from.depth - 1;\n\tif ($from.node(itemDepth).type !== editor.schema.nodes[name] || $from.index(itemDepth) !== 0) return false;\n\treturn editor.chain().liftListItem(name).run();\n};\n//#endregion\n//#region src/keymap/listHelpers/nextListIsDeeper.ts\nconst nextListIsDeeper = (typeOrName, state) => {\n\tconst listDepth = getNextListDepth(typeOrName, state);\n\tconst listItemPos = findListItemPos(typeOrName, state);\n\tif (!listItemPos || !listDepth) return false;\n\tif (listDepth > listItemPos.depth) return true;\n\treturn false;\n};\n//#endregion\n//#region src/keymap/listHelpers/nextListIsHigher.ts\nconst nextListIsHigher = (typeOrName, state) => {\n\tconst listDepth = getNextListDepth(typeOrName, state);\n\tconst listItemPos = findListItemPos(typeOrName, state);\n\tif (!listItemPos || !listDepth) return false;\n\tif (listDepth < listItemPos.depth) return true;\n\treturn false;\n};\n//#endregion\n//#region src/keymap/listHelpers/handleDelete.ts\nconst handleDelete = (editor, name) => {\n\tif (!isNodeActive(editor.state, name)) return false;\n\tif (!isAtEndOfNode(editor.state, name)) return false;\n\tconst { selection } = editor.state;\n\tconst { $from, $to } = selection;\n\tif (!selection.empty && $from.sameParent($to)) return false;\n\tif (nextListIsDeeper(name, editor.state)) return editor.chain().focus(editor.state.selection.from + 4).lift(name).joinBackward().run();\n\tif (nextListIsHigher(name, editor.state)) return editor.chain().joinForward().joinBackward().run();\n\treturn editor.commands.joinItemForward();\n};\n//#endregion\n//#region src/keymap/listHelpers/handleTab.ts\nconst handleTab = (editor, name, parentListTypes) => {\n\tconst { state } = editor;\n\tconst { selection } = state;\n\tif (!selection.empty) return false;\n\tconst { $from } = selection;\n\tif ($from.parentOffset !== 0) return false;\n\tif (!$from.parent.isTextblock) return false;\n\tif (isNodeActive(state, name)) return false;\n\tconst previous = getPreviousBlockSibling($from);\n\tif (!previous || !parentListTypes.includes(previous.type.name)) return false;\n\tconst lastItem = previous.lastChild;\n\tif (!lastItem || lastItem.type.name !== name) return false;\n\tconst block = $from.parent;\n\tif (!lastItem.canReplace(lastItem.childCount, lastItem.childCount, Fragment.from(block))) return false;\n\tconst blockStart = $from.before();\n\tconst blockEnd = $from.after();\n\tconst insideLastItemEnd = blockStart - 2;\n\treturn editor.commands.command(({ tr, dispatch }) => {\n\t\tif (dispatch) {\n\t\t\ttr.delete(blockStart, blockEnd).insert(insideLastItemEnd, Fragment.from(block));\n\t\t\ttr.setSelection(TextSelection.create(tr.doc, insideLastItemEnd + 1));\n\t\t\ttr.scrollIntoView();\n\t\t}\n\t\treturn true;\n\t});\n};\n//#endregion\n//#region src/keymap/listHelpers/hasListItemAfter.ts\nconst hasListItemAfter = (typeOrName, state) => {\n\tvar _$targetPos$nodeAfter;\n\tconst { $anchor } = state.selection;\n\tconst $targetPos = state.doc.resolve($anchor.pos - $anchor.parentOffset - 2);\n\tif ($targetPos.index() === $targetPos.parent.childCount - 1) return false;\n\tif (((_$targetPos$nodeAfter = $targetPos.nodeAfter) === null || _$targetPos$nodeAfter === void 0 ? void 0 : _$targetPos$nodeAfter.type.name) !== typeOrName) return false;\n\treturn true;\n};\n//#endregion\n//#region src/keymap/listHelpers/hasListItemBefore.ts\nconst hasListItemBefore = (typeOrName, state) => {\n\tvar _$targetPos$nodeBefor;\n\tconst { $anchor } = state.selection;\n\tconst $targetPos = state.doc.resolve($anchor.pos - 2);\n\tif ($targetPos.index() === 0) return false;\n\tif (((_$targetPos$nodeBefor = $targetPos.nodeBefore) === null || _$targetPos$nodeBefor === void 0 ? void 0 : _$targetPos$nodeBefor.type.name) !== typeOrName) return false;\n\treturn true;\n};\n//#endregion\n//#region src/keymap/listHelpers/listItemHasSubList.ts\nconst listItemHasSubList = (typeOrName, state, node) => {\n\tif (!node) return false;\n\tconst nodeType = getNodeType(typeOrName, state.schema);\n\tlet hasSubList = false;\n\tnode.descendants((child) => {\n\t\tif (child.type === nodeType) hasSubList = true;\n\t});\n\treturn hasSubList;\n};\n//#endregion\n//#region src/keymap/listHelpers/index.ts\nvar listHelpers_exports = /* @__PURE__ */ __exportAll({\n\tfindListItemPos: () => findListItemPos,\n\tgetNextListDepth: () => getNextListDepth,\n\thandleBackspace: () => handleBackspace,\n\thandleDelete: () => handleDelete,\n\thandleTab: () => handleTab,\n\thasListBefore: () => hasListBefore,\n\thasListItemAfter: () => hasListItemAfter,\n\thasListItemBefore: () => hasListItemBefore,\n\tlistItemHasSubList: () => listItemHasSubList,\n\tnextListIsDeeper: () => nextListIsDeeper,\n\tnextListIsHigher: () => nextListIsHigher\n});\n//#endregion\n//#region src/keymap/list-keymap.ts\n/**\n* This extension registers custom keymaps to change the behaviour of the backspace and delete keys.\n* By default Prosemirror keyhandling will always lift or sink items so paragraphs are joined into\n* the adjacent or previous list item. This extension will prevent this behaviour and instead will\n* try to join paragraphs from two list items into a single list item.\n* @see https://www.tiptap.dev/api/extensions/list-keymap\n*/\nconst ListKeymap = Extension.create({\n\tname: \"listKeymap\",\n\taddOptions() {\n\t\treturn { listTypes: [{\n\t\t\titemName: \"listItem\",\n\t\t\twrapperNames: [\"bulletList\", \"orderedList\"]\n\t\t}, {\n\t\t\titemName: \"taskItem\",\n\t\t\twrapperNames: [\"taskList\"]\n\t\t}] };\n\t},\n\taddKeyboardShortcuts() {\n\t\treturn {\n\t\t\tDelete: ({ editor }) => {\n\t\t\t\tlet handled = false;\n\t\t\t\tthis.options.listTypes.forEach(({ itemName }) => {\n\t\t\t\t\tif (editor.state.schema.nodes[itemName] === void 0) return;\n\t\t\t\t\tif (handleDelete(editor, itemName)) handled = true;\n\t\t\t\t});\n\t\t\t\treturn handled;\n\t\t\t},\n\t\t\t\"Mod-Delete\": ({ editor }) => {\n\t\t\t\tlet handled = false;\n\t\t\t\tthis.options.listTypes.forEach(({ itemName }) => {\n\t\t\t\t\tif (editor.state.schema.nodes[itemName] === void 0) return;\n\t\t\t\t\tif (handleDelete(editor, itemName)) handled = true;\n\t\t\t\t});\n\t\t\t\treturn handled;\n\t\t\t},\n\t\t\tBackspace: ({ editor }) => {\n\t\t\t\tlet handled = false;\n\t\t\t\tthis.options.listTypes.forEach(({ itemName, wrapperNames }) => {\n\t\t\t\t\tif (editor.state.schema.nodes[itemName] === void 0) return;\n\t\t\t\t\tif (handleBackspace(editor, itemName, wrapperNames)) handled = true;\n\t\t\t\t});\n\t\t\t\treturn handled;\n\t\t\t},\n\t\t\t\"Mod-Backspace\": ({ editor }) => {\n\t\t\t\tlet handled = false;\n\t\t\t\tthis.options.listTypes.forEach(({ itemName, wrapperNames }) => {\n\t\t\t\t\tif (editor.state.schema.nodes[itemName] === void 0) return;\n\t\t\t\t\tif (handleBackspace(editor, itemName, wrapperNames)) handled = true;\n\t\t\t\t});\n\t\t\t\treturn handled;\n\t\t\t},\n\t\t\tTab: ({ editor }) => {\n\t\t\t\tfor (const { itemName, wrapperNames } of this.options.listTypes) {\n\t\t\t\t\tif (editor.state.schema.nodes[itemName] === void 0) continue;\n\t\t\t\t\tif (handleTab(editor, itemName, wrapperNames)) return true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\t}\n});\n//#endregion\n//#region src/ordered-list/utils.ts\n/**\n* Matches an ordered list item line with optional leading whitespace.\n* Captures: (1) indentation spaces, (2) item marker (number, letter, or roman numeral),\n* (3) separator (. or )), (4) content after marker\n*\n* Examples: \"1. Item\", \" a) Nested item\", \" I. Roman item\", \"iii. Another\", \"aa. Item 27\"\n*/\nconst ORDERED_LIST_ITEM_REGEX = new RegExp(`^(\\\\s*)(${ORDERED_LIST_MARKER_PATTERN})([.)])\\\\s+(.*)$`);\n/**\n* Matches any line that starts with whitespace (indented content).\n* Used to identify continuation content that belongs to a list item.\n*/\nconst INDENTED_LINE_REGEX = /^\\s/;\n/**\n* This are blocks that can interrupt a paragraph, so a line starting with one of\n* them can never be lazy continuation text of a list item\n*/\nconst PARAGRAPH_INTERRUPTERS = {\n\theading: /^#{1,6}(?:\\s|$)/,\n\tbulletItem: /^[-+*]\\s+/,\n\tcodeFence: /^(?:```|~~~)/,\n\tblockMath: /^\\$\\$/,\n\tthematicBreak: /^(?:(?:-[ \\t]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})$/\n};\nfunction isOrderedListMarkerLine(line) {\n\treturn ORDERED_LIST_ITEM_REGEX.test(line.trimStart());\n}\nfunction isBlockContentLine(line) {\n\tconst trimmedLine = line.trimStart();\n\treturn PARAGRAPH_INTERRUPTERS.bulletItem.test(trimmedLine) || isOrderedListMarkerLine(trimmedLine) || PARAGRAPH_INTERRUPTERS.heading.test(trimmedLine) || PARAGRAPH_INTERRUPTERS.thematicBreak.test(trimmedLine) && !trimmedLine.startsWith(\"-\") || /^>\\s?/.test(trimmedLine) || PARAGRAPH_INTERRUPTERS.codeFence.test(trimmedLine) || PARAGRAPH_INTERRUPTERS.blockMath.test(trimmedLine);\n}\nfunction interruptsLazyContinuation(line) {\n\treturn Object.values(PARAGRAPH_INTERRUPTERS).some((pattern) => pattern.test(line));\n}\nfunction splitItemContent(contentLines) {\n\tconst paragraphLines = [];\n\tconst blockLines = [];\n\tlet reachedBlockBoundary = false;\n\tcontentLines.forEach((line) => {\n\t\tif (reachedBlockBoundary) {\n\t\t\tblockLines.push(line);\n\t\t\treturn;\n\t\t}\n\t\tif (line.trim() === \"\") {\n\t\t\treachedBlockBoundary = true;\n\t\t\tblockLines.push(line);\n\t\t\treturn;\n\t\t}\n\t\tif (paragraphLines.length > 0 && isBlockContentLine(line)) {\n\t\t\treachedBlockBoundary = true;\n\t\t\tblockLines.push(line);\n\t\t\treturn;\n\t\t}\n\t\tparagraphLines.push(line);\n\t});\n\treturn {\n\t\tparagraphLines,\n\t\tblockLines\n\t};\n}\n/**\n* Collects all ordered list items from lines, parsing them into a flat array\n* with indentation information. Stops collecting continuation content when\n* encountering nested list items, allowing them to be processed separately.\n*\n* @param lines - Array of source lines to parse\n* @returns Tuple of [listItems array, number of lines consumed]\n*/\nfunction collectOrderedListItems(lines) {\n\tconst listItems = [];\n\tlet currentLineIndex = 0;\n\tlet consumed = 0;\n\twhile (currentLineIndex < lines.length) {\n\t\tconst line = lines[currentLineIndex];\n\t\tconst match = line.match(ORDERED_LIST_ITEM_REGEX);\n\t\tif (!match) break;\n\t\tconst [, indent, marker, _separator, content] = match;\n\t\tconst indentLevel = indent.length;\n\t\tconst number = parseInt(marker, 10);\n\t\tconst markerType = isNaN(number) ? detectMarkerType(marker) : void 0;\n\t\tconst itemNumber = isNaN(number) ? markerToStart(marker) : number;\n\t\tconst itemContentLines = [content];\n\t\tlet nextLineIndex = currentLineIndex + 1;\n\t\tconst itemLines = [line];\n\t\tlet sawBlankLine = false;\n\t\twhile (nextLineIndex < lines.length) {\n\t\t\tconst nextLine = lines[nextLineIndex];\n\t\t\tif (nextLine.match(ORDERED_LIST_ITEM_REGEX)) break;\n\t\t\tif (nextLine.trim() === \"\") {\n\t\t\t\titemLines.push(nextLine);\n\t\t\t\titemContentLines.push(\"\");\n\t\t\t\tsawBlankLine = true;\n\t\t\t\tnextLineIndex += 1;\n\t\t\t} else if (nextLine.match(INDENTED_LINE_REGEX)) {\n\t\t\t\tconst leadingWhitespace = nextLine.length - nextLine.trimStart().length;\n\t\t\t\tconst contentIndent = indentLevel + marker.length + 1;\n\t\t\t\titemLines.push(nextLine);\n\t\t\t\titemContentLines.push(nextLine.slice(Math.min(leadingWhitespace, contentIndent)));\n\t\t\t\tnextLineIndex += 1;\n\t\t\t} else {\n\t\t\t\tif (sawBlankLine || interruptsLazyContinuation(nextLine)) break;\n\t\t\t\titemLines.push(nextLine);\n\t\t\t\titemContentLines.push(nextLine);\n\t\t\t\tnextLineIndex += 1;\n\t\t\t}\n\t\t}\n\t\tlistItems.push({\n\t\t\tindent: indentLevel,\n\t\t\tnumber: itemNumber,\n\t\t\ttype: markerType,\n\t\t\tcontent: itemContentLines.join(\"\\n\").trim(),\n\t\t\tcontentLines: itemContentLines,\n\t\t\traw: itemLines.join(\"\\n\")\n\t\t});\n\t\tconsumed = nextLineIndex;\n\t\tcurrentLineIndex = nextLineIndex;\n\t}\n\treturn [listItems, consumed];\n}\nconst PLAIN_TEXT_ORDERED_LIST_LINE_REGEX = new RegExp(`^(${ORDERED_LIST_MARKER_PATTERN})([.)])\\\\s+(.+)$`);\n/**\n* Parse plain-text pasted ordered list lines into JSONContent, or null if not a typed list.\n*/\nfunction parsePlainTextOrderedListPaste(text) {\n\tconst lines = text.split(\"\\n\").filter((l) => l.trim().length > 0);\n\tif (lines.length === 0) return null;\n\tconst parsedItems = [];\n\tfor (const line of lines) {\n\t\tconst match = line.trim().match(PLAIN_TEXT_ORDERED_LIST_LINE_REGEX);\n\t\tif (!match) return null;\n\t\tparsedItems.push({\n\t\t\tmarker: match[1],\n\t\t\tcontent: match[3]\n\t\t});\n\t}\n\tif (!areOrderedListMarkersSequential(parsedItems.map((item) => item.marker))) return null;\n\treturn {\n\t\ttype: \"orderedList\",\n\t\tattrs: buildOrderedListAttrsFromMarker(parsedItems[0].marker),\n\t\tcontent: parsedItems.map((item) => ({\n\t\t\ttype: \"listItem\",\n\t\t\tcontent: [{\n\t\t\t\ttype: \"paragraph\",\n\t\t\t\tcontent: [{\n\t\t\t\t\ttype: \"text\",\n\t\t\t\t\ttext: item.content\n\t\t\t\t}]\n\t\t\t}]\n\t\t}))\n\t};\n}\n/**\n* Recursively builds a nested structure from a flat array of list items\n* based on their indentation levels. Creates proper markdown tokens with\n* nested lists where appropriate.\n*\n* @param items - Flat array of list items with indentation info\n* @param baseIndent - The indentation level to process at this recursion level\n* @param lexer - Markdown lexer for parsing inline and block content\n* @returns Array of list_item tokens with proper nesting\n*/\nfunction buildNestedStructure(items, baseIndent, lexer) {\n\tconst result = [];\n\tlet currentIndex = 0;\n\twhile (currentIndex < items.length) {\n\t\tconst item = items[currentIndex];\n\t\tif (item.indent === baseIndent) {\n\t\t\tconst { paragraphLines, blockLines } = splitItemContent(item.contentLines);\n\t\t\tconst mainText = paragraphLines.join(\"\\n\").trim();\n\t\t\tconst tokens = [];\n\t\t\tif (mainText) tokens.push({\n\t\t\t\ttype: \"paragraph\",\n\t\t\t\traw: mainText,\n\t\t\t\ttokens: lexer.inlineTokens(mainText)\n\t\t\t});\n\t\t\tconst additionalContent = blockLines.join(\"\\n\").trim();\n\t\t\tif (additionalContent) {\n\t\t\t\tconst blockTokens = lexer.blockTokens(additionalContent);\n\t\t\t\ttokens.push(...blockTokens);\n\t\t\t}\n\t\t\tlet lookAheadIndex = currentIndex + 1;\n\t\t\tconst nestedItems = [];\n\t\t\twhile (lookAheadIndex < items.length && items[lookAheadIndex].indent > baseIndent) {\n\t\t\t\tnestedItems.push(items[lookAheadIndex]);\n\t\t\t\tlookAheadIndex += 1;\n\t\t\t}\n\t\t\tif (nestedItems.length > 0) {\n\t\t\t\tconst nestedListItems = buildNestedStructure(nestedItems, Math.min(...nestedItems.map((nestedItem) => nestedItem.indent)), lexer);\n\t\t\t\ttokens.push({\n\t\t\t\t\ttype: \"list\",\n\t\t\t\t\tordered: true,\n\t\t\t\t\tstart: nestedItems[0].number,\n\t\t\t\t\ttypeMarker: nestedItems[0].type,\n\t\t\t\t\titems: nestedListItems,\n\t\t\t\t\traw: nestedItems.map((nestedItem) => nestedItem.raw).join(\"\\n\")\n\t\t\t\t});\n\t\t\t}\n\t\t\tresult.push({\n\t\t\t\ttype: \"list_item\",\n\t\t\t\traw: item.raw,\n\t\t\t\ttokens\n\t\t\t});\n\t\t\tcurrentIndex = lookAheadIndex;\n\t\t} else currentIndex += 1;\n\t}\n\treturn result;\n}\n/**\n* Parses markdown list item tokens into Tiptap JSONContent structure,\n* ensuring text content is properly wrapped in paragraph nodes.\n*\n* @param items - Array of markdown tokens representing list items\n* @param helpers - Markdown parse helpers for recursive parsing\n* @returns Array of listItem JSONContent nodes\n*/\nfunction parseListItems(items, helpers) {\n\treturn items.map((item) => {\n\t\tif (item.type !== \"list_item\") return helpers.parseChildren([item])[0];\n\t\tconst content = [];\n\t\tif (item.tokens && item.tokens.length > 0) item.tokens.forEach((itemToken) => {\n\t\t\tif (itemToken.type === \"paragraph\" || itemToken.type === \"list\" || itemToken.type === \"blockquote\" || itemToken.type === \"code\") content.push(...helpers.parseChildren([itemToken]));\n\t\t\telse if (itemToken.type === \"text\" && itemToken.tokens) {\n\t\t\t\tconst inlineContent = helpers.parseChildren([itemToken]);\n\t\t\t\tcontent.push({\n\t\t\t\t\ttype: \"paragraph\",\n\t\t\t\t\tcontent: inlineContent\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst parsed = helpers.parseChildren([itemToken]);\n\t\t\t\tif (parsed.length > 0) content.push(...parsed);\n\t\t\t}\n\t\t});\n\t\treturn {\n\t\t\ttype: \"listItem\",\n\t\t\tcontent\n\t\t};\n\t});\n}\n//#endregion\n//#region src/ordered-list/collectOrderedListItemsFromSource.ts\nconst ORDERED_LIST_SCAN_WINDOW = 64;\nfunction takeLines(source, max) {\n\tconst lines = [];\n\tlet start = 0;\n\twhile (lines.length < max) {\n\t\tconst lineEnd = source.indexOf(\"\\n\", start);\n\t\tif (lineEnd === -1) {\n\t\t\tlines.push(source.slice(start));\n\t\t\treturn lines;\n\t\t}\n\t\tlines.push(source.slice(start, lineEnd));\n\t\tstart = lineEnd + 1;\n\t}\n\treturn lines;\n}\n/**\n* Collect ordered list items from the start of `source`, reading only the lines the list needs.\n*\n* @param source Markdown beginning at a block boundary.\n* @returns The items, how many lines they consumed, and the lines that were read.\n* @example\n* collectOrderedListItemsFromSource('1. one\\n2. two\\n\\nAfter')\n* // → [[item, item], 3, ['1. one', '2. two', '', 'After']]\n*/\nfunction collectOrderedListItemsFromSource(source) {\n\tconst firstLineEnd = source.indexOf(\"\\n\");\n\tconst firstLine = firstLineEnd === -1 ? source : source.slice(0, firstLineEnd);\n\tif (!ORDERED_LIST_ITEM_REGEX.test(firstLine)) return [\n\t\t[],\n\t\t0,\n\t\t[]\n\t];\n\tlet windowSize = ORDERED_LIST_SCAN_WINDOW;\n\tlet lines = takeLines(source, windowSize);\n\tlet collected = collectOrderedListItems(lines);\n\twhile (collected[1] === lines.length && lines.length === windowSize) {\n\t\twindowSize *= 2;\n\t\tlines = takeLines(source, windowSize);\n\t\tcollected = collectOrderedListItems(lines);\n\t}\n\treturn [\n\t\tcollected[0],\n\t\tcollected[1],\n\t\tlines\n\t];\n}\n//#endregion\n//#region src/ordered-list/ordered-list.ts\nconst ListItemName = \"listItem\";\nconst TextStyleName = \"textStyle\";\n/**\n* Matches an ordered list to a 1. on input (or any number followed by a dot).\n*/\nconst orderedListInputRegex = /^(\\d+)\\.\\s$/;\n/**\n* Maps CSS list-style-type values to HTML type attribute values.\n* Google Docs and Word often use CSS instead of the HTML type attribute.\n*/\nfunction cssListStyleTypeToHtmlType(style) {\n\tconst match = style.match(/list-style-type\\s*:\\s*([^;]+)/i);\n\tif (!match) return null;\n\tswitch (match[1].trim().toLowerCase()) {\n\t\tcase \"upper-roman\": return \"I\";\n\t\tcase \"lower-roman\": return \"i\";\n\t\tcase \"upper-alpha\":\n\t\tcase \"upper-latin\": return \"A\";\n\t\tcase \"lower-alpha\":\n\t\tcase \"lower-latin\": return \"a\";\n\t\tdefault: return null;\n\t}\n}\n/**\n* This extension allows you to create ordered lists.\n* This requires the ListItem extension\n* @see https://www.tiptap.dev/api/nodes/ordered-list\n* @see https://www.tiptap.dev/api/nodes/list-item\n*/\nconst OrderedList = Node.create({\n\tname: \"orderedList\",\n\taddOptions() {\n\t\treturn {\n\t\t\titemTypeName: \"listItem\",\n\t\t\tHTMLAttributes: {},\n\t\t\tkeepMarks: false,\n\t\t\tkeepAttributes: false\n\t\t};\n\t},\n\tgroup: \"block list\",\n\tcontent() {\n\t\treturn `${this.options.itemTypeName}+`;\n\t},\n\taddAttributes() {\n\t\treturn {\n\t\t\tstart: {\n\t\t\t\tdefault: 1,\n\t\t\t\tparseHTML: (element) => {\n\t\t\t\t\treturn element.hasAttribute(\"start\") ? parseInt(element.getAttribute(\"start\") || \"\", 10) : 1;\n\t\t\t\t}\n\t\t\t},\n\t\t\ttype: {\n\t\t\t\tdefault: null,\n\t\t\t\tparseHTML: (element) => {\n\t\t\t\t\tconst htmlType = element.getAttribute(\"type\");\n\t\t\t\t\tif (htmlType) return htmlType;\n\t\t\t\t\tconst style = element.getAttribute(\"style\");\n\t\t\t\t\tif (style) {\n\t\t\t\t\t\tconst mappedFromOl = cssListStyleTypeToHtmlType(style);\n\t\t\t\t\t\tif (mappedFromOl) return mappedFromOl;\n\t\t\t\t\t}\n\t\t\t\t\tconst firstLi = element.querySelector(\"li\");\n\t\t\t\t\tif (firstLi) {\n\t\t\t\t\t\tconst liStyle = firstLi.getAttribute(\"style\");\n\t\t\t\t\t\tif (liStyle) {\n\t\t\t\t\t\t\tconst mappedFromLi = cssListStyleTypeToHtmlType(liStyle);\n\t\t\t\t\t\t\tif (mappedFromLi) return mappedFromLi;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t},\n\tparseHTML() {\n\t\treturn [{ tag: \"ol\" }];\n\t},\n\trenderHTML({ HTMLAttributes }) {\n\t\tconst { start, type, ...attributesWithoutType } = HTMLAttributes;\n\t\tconst attrs = mergeAttributes(this.options.HTMLAttributes, attributesWithoutType);\n\t\tif (start !== 1) attrs.start = start;\n\t\tif (type && type !== \"1\") attrs.type = type;\n\t\treturn [\n\t\t\t\"ol\",\n\t\t\tattrs,\n\t\t\t0\n\t\t];\n\t},\n\tmarkdownTokenName: \"list\",\n\tparseMarkdown: (token, helpers) => {\n\t\tif (token.type !== \"list\" || !token.ordered) return [];\n\t\tconst startValue = token.start || 1;\n\t\tconst typeValue = token.typeMarker;\n\t\tconst content = token.items ? parseListItems(token.items, helpers) : [];\n\t\tconst attrs = {};\n\t\tif (startValue !== 1) attrs.start = startValue;\n\t\tif (typeValue) attrs.type = typeValue;\n\t\tif (Object.keys(attrs).length > 0) return {\n\t\t\ttype: \"orderedList\",\n\t\t\tattrs,\n\t\t\tcontent\n\t\t};\n\t\treturn {\n\t\t\ttype: \"orderedList\",\n\t\t\tcontent\n\t\t};\n\t},\n\trenderMarkdown: (node, h) => {\n\t\tif (!node.content) return \"\";\n\t\treturn h.renderChildren(node.content, \"\\n\");\n\t},\n\tmarkdownTokenizer: {\n\t\tname: \"orderedList\",\n\t\tlevel: \"block\",\n\t\tstart: () => -1,\n\t\ttokenize: (src, _tokens, lexer) => {\n\t\t\tvar _listItems$, _listItems$2;\n\t\t\tconst [listItems, consumed, lines] = collectOrderedListItemsFromSource(src);\n\t\t\tif (listItems.length === 0) return;\n\t\t\tconst items = buildNestedStructure(listItems, listItems[0].indent, lexer);\n\t\t\tif (items.length === 0) return;\n\t\t\treturn {\n\t\t\t\ttype: \"list\",\n\t\t\t\tordered: true,\n\t\t\t\tstart: ((_listItems$ = listItems[0]) === null || _listItems$ === void 0 ? void 0 : _listItems$.number) || 1,\n\t\t\t\ttypeMarker: (_listItems$2 = listItems[0]) === null || _listItems$2 === void 0 ? void 0 : _listItems$2.type,\n\t\t\t\titems,\n\t\t\t\traw: lines.slice(0, consumed).join(\"\\n\")\n\t\t\t};\n\t\t}\n\t},\n\tmarkdownOptions: { indentsContent: true },\n\taddCommands() {\n\t\treturn { toggleOrderedList: () => ({ commands, chain }) => {\n\t\t\tif (this.options.keepAttributes) return chain().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ListItemName, this.editor.getAttributes(TextStyleName)).run();\n\t\t\treturn commands.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks);\n\t\t} };\n\t},\n\taddKeyboardShortcuts() {\n\t\treturn { \"Mod-Shift-7\": () => this.editor.commands.toggleOrderedList() };\n\t},\n\taddProseMirrorPlugins() {\n\t\treturn [new Plugin({ props: { handlePaste: (view, event) => {\n\t\t\tvar _event$clipboardData, _event$clipboardData2;\n\t\t\tconst html = (_event$clipboardData = event.clipboardData) === null || _event$clipboardData === void 0 ? void 0 : _event$clipboardData.getData(\"text/html\");\n\t\t\tif (html === null || html === void 0 ? void 0 : html.trim()) return false;\n\t\t\tconst text = (_event$clipboardData2 = event.clipboardData) === null || _event$clipboardData2 === void 0 ? void 0 : _event$clipboardData2.getData(\"text/plain\");\n\t\t\tif (!text) return false;\n\t\t\tconst orderedListContent = parsePlainTextOrderedListPaste(text);\n\t\t\tif (!orderedListContent) return false;\n\t\t\ttry {\n\t\t\t\tconst orderedListNode = view.state.schema.nodeFromJSON(orderedListContent);\n\t\t\t\tconst tr = view.state.tr.replaceSelectionWith(orderedListNode);\n\t\t\t\tview.dispatch(tr);\n\t\t\t\treturn true;\n\t\t\t} catch {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} } })];\n\t},\n\taddInputRules() {\n\t\tconst joinPredicate = (match, node) => {\n\t\t\treturn (!node.attrs.type || node.attrs.type === \"1\") && node.childCount + node.attrs.start === +match[1];\n\t\t};\n\t\tlet inputRule = wrappingInputRule({\n\t\t\tfind: orderedListInputRegex,\n\t\t\ttype: this.type,\n\t\t\tgetAttributes: (match) => ({ start: +match[1] }),\n\t\t\tjoinPredicate\n\t\t});\n\t\tif (this.options.keepMarks || this.options.keepAttributes) inputRule = wrappingInputRule({\n\t\t\tfind: orderedListInputRegex,\n\t\t\ttype: this.type,\n\t\t\tkeepMarks: this.options.keepMarks,\n\t\t\tkeepAttributes: this.options.keepAttributes,\n\t\t\tgetAttributes: (match) => ({\n\t\t\t\tstart: +match[1],\n\t\t\t\t...this.editor.getAttributes(TextStyleName)\n\t\t\t}),\n\t\t\tjoinPredicate,\n\t\t\teditor: this.editor\n\t\t});\n\t\treturn [inputRule];\n\t}\n});\n//#endregion\n//#region src/task-item/task-item.ts\n/**\n* Matches a task item to a - [ ] on input.\n*/\nconst inputRegex = /^\\s*(\\[([( |x])?\\])\\s$/;\n/**\n* Hides the checkbox label visually while keeping it in the accessibility tree.\n*/\nconst visuallyHiddenStyle = \"position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0\";\nconst getCheckboxLabel = (node, checked, a11y) => {\n\tvar _a11y$checkboxLabel;\n\treturn (a11y === null || a11y === void 0 || (_a11y$checkboxLabel = a11y.checkboxLabel) === null || _a11y$checkboxLabel === void 0 ? void 0 : _a11y$checkboxLabel.call(a11y, node, checked)) || `Task item checkbox for ${node.textContent || \"empty task item\"}`;\n};\n/**\n* This extension allows you to create task items.\n* @see https://www.tiptap.dev/api/nodes/task-item\n*/\nconst TaskItem = Node.create({\n\tname: \"taskItem\",\n\taddOptions() {\n\t\treturn {\n\t\t\tnested: false,\n\t\t\tHTMLAttributes: {},\n\t\t\ttaskListTypeName: \"taskList\",\n\t\t\ta11y: void 0\n\t\t};\n\t},\n\tcontent() {\n\t\treturn this.options.nested ? \"paragraph block*\" : \"paragraph+\";\n\t},\n\tdefining: true,\n\taddAttributes() {\n\t\treturn { checked: {\n\t\t\tdefault: false,\n\t\t\tkeepOnSplit: false,\n\t\t\tparseHTML: (element) => {\n\t\t\t\tconst dataChecked = element.getAttribute(\"data-checked\");\n\t\t\t\treturn dataChecked === \"\" || dataChecked === \"true\";\n\t\t\t},\n\t\t\trenderHTML: (attributes) => ({ \"data-checked\": attributes.checked })\n\t\t} };\n\t},\n\tparseHTML() {\n\t\treturn [{\n\t\t\ttag: `li[data-type=\"${this.name}\"]`,\n\t\t\tpriority: 51,\n\t\t\tcontentElement: (element) => {\n\t\t\t\tvar _element$querySelecto;\n\t\t\t\treturn (_element$querySelecto = element.querySelector(\"div\")) !== null && _element$querySelecto !== void 0 ? _element$querySelecto : element;\n\t\t\t}\n\t\t}];\n\t},\n\trenderHTML({ node, HTMLAttributes }) {\n\t\treturn [\n\t\t\t\"li\",\n\t\t\tmergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { \"data-type\": this.name }),\n\t\t\t[\n\t\t\t\t\"label\",\n\t\t\t\t[\"input\", {\n\t\t\t\t\ttype: \"checkbox\",\n\t\t\t\t\tchecked: node.attrs.checked ? \"checked\" : null\n\t\t\t\t}],\n\t\t\t\t[\"span\"]\n\t\t\t],\n\t\t\t[\"div\", 0]\n\t\t];\n\t},\n\tparseMarkdown: (token, h) => {\n\t\tconst content = [];\n\t\tif (token.tokens && token.tokens.length > 0) content.push(h.createNode(\"paragraph\", {}, h.parseInline(token.tokens)));\n\t\telse if (token.text) content.push(h.createNode(\"paragraph\", {}, [h.createNode(\"text\", { text: token.text })]));\n\t\telse content.push(h.createNode(\"paragraph\", {}, []));\n\t\tif (token.nestedTokens && token.nestedTokens.length > 0) {\n\t\t\tconst nestedContent = h.parseChildren(token.nestedTokens);\n\t\t\tcontent.push(...nestedContent);\n\t\t}\n\t\treturn h.createNode(\"taskItem\", { checked: token.checked || false }, content);\n\t},\n\trenderMarkdown: (node, h) => {\n\t\tvar _node$attrs;\n\t\tconst prefix = `- [${((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.checked) ? \"x\" : \" \"}] `;\n\t\treturn renderNestedMarkdownContent(node, h, prefix);\n\t},\n\taddExtensions() {\n\t\tif (!this.options.nested) return [];\n\t\treturn [createBranchingListDeleteKeymap(this.name, [this.options.taskListTypeName])];\n\t},\n\taddKeyboardShortcuts() {\n\t\tconst shortcuts = {\n\t\t\tEnter: () => this.editor.commands.splitListItem(this.name),\n\t\t\t\"Shift-Tab\": () => this.editor.commands.liftListItem(this.name)\n\t\t};\n\t\tif (!this.options.nested) return shortcuts;\n\t\treturn {\n\t\t\t...shortcuts,\n\t\t\tTab: () => this.editor.commands.sinkListItem(this.name)\n\t\t};\n\t},\n\taddNodeView() {\n\t\treturn ({ node, HTMLAttributes, getPos, editor }) => {\n\t\t\tconst listItem = document.createElement(\"li\");\n\t\t\tconst checkboxWrapper = document.createElement(\"label\");\n\t\t\tconst checkboxStyler = document.createElement(\"span\");\n\t\t\tconst checkbox = document.createElement(\"input\");\n\t\t\tconst content = document.createElement(\"div\");\n\t\t\tcheckboxStyler.style.cssText = visuallyHiddenStyle;\n\t\t\tconst updateA11Y = (currentNode) => {\n\t\t\t\tconst label = getCheckboxLabel(currentNode, currentNode.attrs.checked, this.options.a11y);\n\t\t\t\tcheckbox.setAttribute(\"aria-label\", label);\n\t\t\t\tcheckboxStyler.textContent = label;\n\t\t\t};\n\t\t\tupdateA11Y(node);\n\t\t\tcheckboxWrapper.contentEditable = \"false\";\n\t\t\tcheckbox.type = \"checkbox\";\n\t\t\tcheckbox.addEventListener(\"mousedown\", (event) => event.preventDefault());\n\t\t\tcheckbox.addEventListener(\"change\", (event) => {\n\t\t\t\tif (!editor.isEditable && !this.options.onReadOnlyChecked) {\n\t\t\t\t\tcheckbox.checked = !checkbox.checked;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst { checked } = event.target;\n\t\t\t\tif (editor.isEditable && typeof getPos === \"function\") editor.chain().focus(void 0, { scrollIntoView: false }).command(({ tr }) => {\n\t\t\t\t\tconst position = getPos();\n\t\t\t\t\tif (typeof position !== \"number\") return false;\n\t\t\t\t\tconst currentNode = tr.doc.nodeAt(position);\n\t\t\t\t\ttr.setNodeMarkup(position, void 0, {\n\t\t\t\t\t\t...currentNode === null || currentNode === void 0 ? void 0 : currentNode.attrs,\n\t\t\t\t\t\tchecked\n\t\t\t\t\t});\n\t\t\t\t\treturn true;\n\t\t\t\t}).run();\n\t\t\t\tif (!editor.isEditable && this.options.onReadOnlyChecked) {\n\t\t\t\t\tif (!this.options.onReadOnlyChecked(node, checked)) checkbox.checked = !checkbox.checked;\n\t\t\t\t}\n\t\t\t});\n\t\t\tObject.entries(this.options.HTMLAttributes).forEach(([key, value]) => {\n\t\t\t\tlistItem.setAttribute(key, value);\n\t\t\t});\n\t\t\tlistItem.dataset.checked = node.attrs.checked;\n\t\t\tcheckbox.checked = node.attrs.checked;\n\t\t\tcheckboxWrapper.append(checkbox, checkboxStyler);\n\t\t\tlistItem.append(checkboxWrapper, content);\n\t\t\tObject.entries(HTMLAttributes).forEach(([key, value]) => {\n\t\t\t\tlistItem.setAttribute(key, value);\n\t\t\t});\n\t\t\tlet prevRenderedAttributeKeys = new Set(Object.keys(HTMLAttributes));\n\t\t\treturn {\n\t\t\t\tdom: listItem,\n\t\t\t\tcontentDOM: content,\n\t\t\t\tupdate: (updatedNode) => {\n\t\t\t\t\tif (updatedNode.type !== this.type) return false;\n\t\t\t\t\tlistItem.dataset.checked = updatedNode.attrs.checked;\n\t\t\t\t\tcheckbox.checked = updatedNode.attrs.checked;\n\t\t\t\t\tupdateA11Y(updatedNode);\n\t\t\t\t\tconst extensionAttributes = editor.extensionManager.attributes;\n\t\t\t\t\tconst newHTMLAttributes = getRenderedAttributes(updatedNode, extensionAttributes);\n\t\t\t\t\tconst newKeys = new Set(Object.keys(newHTMLAttributes));\n\t\t\t\t\tconst staticAttrs = this.options.HTMLAttributes;\n\t\t\t\t\tprevRenderedAttributeKeys.forEach((key) => {\n\t\t\t\t\t\tif (!newKeys.has(key)) {\n\t\t\t\t\t\t\tif (key in staticAttrs) listItem.setAttribute(key, staticAttrs[key]);\n\t\t\t\t\t\t\telse listItem.removeAttribute(key);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tObject.entries(newHTMLAttributes).forEach(([key, value]) => {\n\t\t\t\t\t\tif (value === null || value === void 0) {\n\t\t\t\t\t\t\tif (key in staticAttrs) listItem.setAttribute(key, staticAttrs[key]);\n\t\t\t\t\t\t\telse listItem.removeAttribute(key);\n\t\t\t\t\t\t} else listItem.setAttribute(key, value);\n\t\t\t\t\t});\n\t\t\t\t\tprevRenderedAttributeKeys = newKeys;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t},\n\taddInputRules() {\n\t\treturn [wrappingInputRule({\n\t\t\tfind: inputRegex,\n\t\t\ttype: this.type,\n\t\t\tgetAttributes: (match) => ({ checked: match[match.length - 1] === \"x\" })\n\t\t})];\n\t}\n});\n//#endregion\n//#region src/task-list/task-list.ts\n/**\n* This extension allows you to create task lists.\n* @see https://www.tiptap.dev/api/nodes/task-list\n*/\nconst TaskList = Node.create({\n\tname: \"taskList\",\n\taddOptions() {\n\t\treturn {\n\t\t\titemTypeName: \"taskItem\",\n\t\t\tHTMLAttributes: {}\n\t\t};\n\t},\n\tgroup: \"block list\",\n\tcontent() {\n\t\treturn `${this.options.itemTypeName}+`;\n\t},\n\tparseHTML() {\n\t\treturn [{\n\t\t\ttag: `ul[data-type=\"${this.name}\"]`,\n\t\t\tpriority: 51\n\t\t}];\n\t},\n\trenderHTML({ HTMLAttributes }) {\n\t\treturn [\n\t\t\t\"ul\",\n\t\t\tmergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { \"data-type\": this.name }),\n\t\t\t0\n\t\t];\n\t},\n\tparseMarkdown: (token, h) => {\n\t\treturn h.createNode(\"taskList\", {}, h.parseChildren(token.items || []));\n\t},\n\trenderMarkdown: (node, h) => {\n\t\tif (!node.content) return \"\";\n\t\treturn h.renderChildren(node.content, \"\\n\");\n\t},\n\tmarkdownTokenizer: {\n\t\tname: \"taskList\",\n\t\tlevel: \"block\",\n\t\tstart(src) {\n\t\t\tvar _src$match;\n\t\t\tconst index = (_src$match = src.match(/^\\s*[-+*]\\s+\\[([ xX])\\]\\s+/)) === null || _src$match === void 0 ? void 0 : _src$match.index;\n\t\t\treturn index !== void 0 ? index : -1;\n\t\t},\n\t\ttokenize(src, tokens, lexer) {\n\t\t\tconst parseTaskListContent = (content) => {\n\t\t\t\tconst nestedResult = parseIndentedBlocks(content, {\n\t\t\t\t\titemPattern: /^(\\s*)([-+*])\\s+\\[([ xX])\\]\\s+(.*)$/,\n\t\t\t\t\textractItemData: (match) => ({\n\t\t\t\t\t\tindentLevel: match[1].length,\n\t\t\t\t\t\tmainContent: match[4],\n\t\t\t\t\t\tchecked: match[3].toLowerCase() === \"x\"\n\t\t\t\t\t}),\n\t\t\t\t\tcreateToken: (data, nestedTokens) => ({\n\t\t\t\t\t\ttype: \"taskItem\",\n\t\t\t\t\t\traw: \"\",\n\t\t\t\t\t\tmainContent: data.mainContent,\n\t\t\t\t\t\tindentLevel: data.indentLevel,\n\t\t\t\t\t\tchecked: data.checked,\n\t\t\t\t\t\ttext: data.mainContent,\n\t\t\t\t\t\ttokens: lexer.inlineTokens(data.mainContent),\n\t\t\t\t\t\tnestedTokens\n\t\t\t\t\t}),\n\t\t\t\t\tcustomNestedParser: parseTaskListContent\n\t\t\t\t}, lexer);\n\t\t\t\tif (nestedResult) {\n\t\t\t\t\tconst taskListToken = {\n\t\t\t\t\t\ttype: \"taskList\",\n\t\t\t\t\t\traw: nestedResult.raw,\n\t\t\t\t\t\titems: nestedResult.items\n\t\t\t\t\t};\n\t\t\t\t\tconst remainder = content.slice(nestedResult.raw.length);\n\t\t\t\t\tif (remainder.trim()) return [taskListToken, ...lexer.blockTokens(remainder)];\n\t\t\t\t\treturn [taskListToken];\n\t\t\t\t}\n\t\t\t\treturn lexer.blockTokens(content);\n\t\t\t};\n\t\t\tconst result = parseIndentedBlocks(src, {\n\t\t\t\titemPattern: /^(\\s*)([-+*])\\s+\\[([ xX])\\]\\s+(.*)$/,\n\t\t\t\textractItemData: (match) => ({\n\t\t\t\t\tindentLevel: match[1].length,\n\t\t\t\t\tmainContent: match[4],\n\t\t\t\t\tchecked: match[3].toLowerCase() === \"x\"\n\t\t\t\t}),\n\t\t\t\tcreateToken: (data, nestedTokens) => ({\n\t\t\t\t\ttype: \"taskItem\",\n\t\t\t\t\traw: \"\",\n\t\t\t\t\tmainContent: data.mainContent,\n\t\t\t\t\tindentLevel: data.indentLevel,\n\t\t\t\t\tchecked: data.checked,\n\t\t\t\t\ttext: data.mainContent,\n\t\t\t\t\ttokens: lexer.inlineTokens(data.mainContent),\n\t\t\t\t\tnestedTokens\n\t\t\t\t}),\n\t\t\t\tcustomNestedParser: parseTaskListContent\n\t\t\t}, lexer);\n\t\t\tif (!result) return;\n\t\t\treturn {\n\t\t\t\ttype: \"taskList\",\n\t\t\t\traw: result.raw,\n\t\t\t\titems: result.items\n\t\t\t};\n\t\t}\n\t},\n\tmarkdownOptions: { indentsContent: true },\n\taddCommands() {\n\t\treturn { toggleTaskList: () => ({ commands }) => {\n\t\t\treturn commands.toggleList(this.name, this.options.itemTypeName);\n\t\t} };\n\t},\n\taddKeyboardShortcuts() {\n\t\treturn { \"Mod-Shift-9\": () => this.editor.commands.toggleTaskList() };\n\t}\n});\n//#endregion\n//#region src/kit/index.ts\n/**\n* The table kit is a collection of table editor extensions.\n*\n* It’s a good starting point for building your own table in Tiptap.\n*/\nconst ListKit = Extension.create({\n\tname: \"listKit\",\n\taddExtensions() {\n\t\tconst extensions = [];\n\t\tif (this.options.bulletList !== false) extensions.push(BulletList.configure(this.options.bulletList));\n\t\tif (this.options.listItem !== false) extensions.push(ListItem.configure(this.options.listItem));\n\t\tif (this.options.listKeymap !== false) extensions.push(ListKeymap.configure(this.options.listKeymap));\n\t\tif (this.options.orderedList !== false) extensions.push(OrderedList.configure(this.options.orderedList));\n\t\tif (this.options.taskItem !== false) extensions.push(TaskItem.configure(this.options.taskItem));\n\t\tif (this.options.taskList !== false) extensions.push(TaskList.configure(this.options.taskList));\n\t\treturn extensions;\n\t}\n});\n//#endregion\nexport { BulletList, ListItem, ListKeymap, ListKit, ORDERED_LIST_MARKER_PATTERN, OrderedList, TaskItem, TaskList, areOrderedListMarkersSequential, buildOrderedListAttrsFromMarker, bulletListInputRegex, detectMarkerType, getListMarker, inputRegex, listHelpers_exports as listHelpers, markerToStart, orderedListInputRegex, parseListMarker, parsePlainTextOrderedListPaste, toRoman, toRomanUpper };\n\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[0],"mappings":";;;AAKA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B,GAAK;CACxC,cAAc;EACb,OAAO,EAAE,uBAAuB,EAAE,kBAC1B,EAAS,WAAW,KAAK,MAAM,KAAK,QAAQ,YAAY,EAC9D;CACH;CACA,uBAAuB;EACtB,OAAO,EAAE,qBAAqB,KAAK,OAAO,SAAS,eAAe,EAAE;CACrE;AACD,CAAC;AAQe,EAAU,OAAO;CAChC,MAAM;CACN,gBAAgB;EACf,IAAM,IAAa,CAAC;EAOpB,OANI,KAAK,QAAQ,eAAe,MAAO,EAAW,KAAK,EAAW,UAAU,KAAK,QAAQ,UAAU,CAAC,GAChG,KAAK,QAAQ,aAAa,MAAO,EAAW,KAAK,EAAS,UAAU,KAAK,QAAQ,QAAQ,CAAC,GAC1F,KAAK,QAAQ,eAAe,MAAO,EAAW,KAAK,EAAW,UAAU,KAAK,QAAQ,UAAU,CAAC,GAChG,KAAK,QAAQ,gBAAgB,MAAO,EAAW,KAAK,EAAY,UAAU,KAAK,QAAQ,WAAW,CAAC,GACnG,KAAK,QAAQ,aAAa,MAAO,EAAW,KAAK,GAAS,UAAU,KAAK,QAAQ,QAAQ,CAAC,GAC1F,KAAK,QAAQ,aAAa,MAAO,EAAW,KAAK,GAAS,UAAU,KAAK,QAAQ,QAAQ,CAAC,GACvF;CACR;AACD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"dist-CJhbhuk0.js","names":["Selection"],"sources":["../../../../../node_modules/.bun/prosemirror-dropcursor@1.8.4/node_modules/prosemirror-dropcursor/dist/index.js","../../../../../node_modules/.bun/prosemirror-gapcursor@1.4.1/node_modules/prosemirror-gapcursor/dist/index.js","../../../../../node_modules/.bun/@tiptap+extensions@3.31.4+e39601fe346c19ab/node_modules/@tiptap/extensions/dist/index.js"],"sourcesContent":["import { Plugin } from 'prosemirror-state';\nimport { dropPoint } from 'prosemirror-transform';\n\n/**\nCreate a plugin that, when added to a ProseMirror instance,\ncauses a decoration to show up at the drop position when something\nis dragged over the editor.\n\nNodes may add a `disableDropCursor` property to their spec to\ncontrol the showing of a drop cursor inside them. This may be a\nboolean or a function, which will be called with a view and a\nposition, and should return a boolean.\n*/\nfunction dropCursor(options = {}) {\n return new Plugin({\n view(editorView) { return new DropCursorView(editorView, options); }\n });\n}\nclass DropCursorView {\n constructor(editorView, options) {\n var _a;\n this.editorView = editorView;\n this.cursorPos = null;\n this.element = null;\n this.timeout = -1;\n this.lastDragEvent = null;\n this.width = (_a = options.width) !== null && _a !== void 0 ? _a : 1;\n this.color = options.color === false ? undefined : (options.color || \"black\");\n this.class = options.class;\n this.handlers = [\"dragover\", \"dragend\", \"drop\", \"dragleave\"].map(name => {\n let handler = (e) => { this[name](e); };\n editorView.dom.addEventListener(name, handler);\n return { name, handler };\n });\n }\n destroy() {\n this.setCursor(null);\n this.handlers.forEach(({ name, handler }) => this.editorView.dom.removeEventListener(name, handler));\n }\n update(editorView, prevState) {\n if (this.cursorPos != null && prevState.doc != editorView.state.doc) {\n // if we currently have an on-going drag event\n // we need to update the cursor position again and update the overlay\n if (this.lastDragEvent) {\n let target = this.computeTarget(this.lastDragEvent);\n if (target == this.cursorPos)\n this.updateOverlay();\n else\n this.setCursor(target);\n }\n else {\n this.updateOverlay();\n }\n }\n }\n setCursor(pos) {\n if (pos == this.cursorPos)\n return;\n this.cursorPos = pos;\n if (pos == null) {\n this.element.parentNode.removeChild(this.element);\n this.element = null;\n }\n else {\n this.updateOverlay();\n }\n }\n updateOverlay() {\n let $pos = this.editorView.state.doc.resolve(this.cursorPos);\n let isBlock = !$pos.parent.inlineContent, rect;\n let editorDOM = this.editorView.dom, editorRect = editorDOM.getBoundingClientRect();\n let scaleX = editorRect.width / editorDOM.offsetWidth, scaleY = editorRect.height / editorDOM.offsetHeight;\n if (isBlock) {\n let before = $pos.nodeBefore, after = $pos.nodeAfter;\n if (before || after) {\n let node = this.editorView.nodeDOM(this.cursorPos - (before ? before.nodeSize : 0));\n if (node) {\n let nodeRect = node.getBoundingClientRect();\n let top = before ? nodeRect.bottom : nodeRect.top;\n if (before && after)\n top = (top + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2;\n let halfWidth = (this.width / 2) * scaleY;\n rect = { left: nodeRect.left, right: nodeRect.right, top: top - halfWidth, bottom: top + halfWidth };\n }\n }\n }\n if (!rect) {\n let coords = this.editorView.coordsAtPos(this.cursorPos);\n let halfWidth = (this.width / 2) * scaleX;\n rect = { left: coords.left - halfWidth, right: coords.left + halfWidth, top: coords.top, bottom: coords.bottom };\n }\n let parent = this.editorView.dom.offsetParent;\n if (!this.element) {\n this.element = parent.appendChild(document.createElement(\"div\"));\n if (this.class)\n this.element.className = this.class;\n this.element.style.cssText = \"position: absolute; z-index: 50; pointer-events: none;\";\n if (this.color) {\n this.element.style.backgroundColor = this.color;\n }\n }\n this.element.classList.toggle(\"prosemirror-dropcursor-block\", isBlock);\n this.element.classList.toggle(\"prosemirror-dropcursor-inline\", !isBlock);\n let parentLeft, parentTop;\n if (!parent || parent == document.body && getComputedStyle(parent).position == \"static\") {\n parentLeft = -pageXOffset;\n parentTop = -pageYOffset;\n }\n else {\n let rect = parent.getBoundingClientRect();\n let parentScaleX = rect.width / parent.offsetWidth, parentScaleY = rect.height / parent.offsetHeight;\n parentLeft = rect.left - parent.scrollLeft * parentScaleX;\n parentTop = rect.top - parent.scrollTop * parentScaleY;\n }\n this.element.style.left = (rect.left - parentLeft) / scaleX + \"px\";\n this.element.style.top = (rect.top - parentTop) / scaleY + \"px\";\n this.element.style.width = (rect.right - rect.left) / scaleX + \"px\";\n this.element.style.height = (rect.bottom - rect.top) / scaleY + \"px\";\n }\n scheduleRemoval(timeout) {\n clearTimeout(this.timeout);\n this.timeout = setTimeout(() => this.setCursor(null), timeout);\n }\n computeTarget(event) {\n let pos = this.editorView.posAtCoords({ left: event.clientX, top: event.clientY });\n let node = pos && pos.inside >= 0 && this.editorView.state.doc.nodeAt(pos.inside);\n let disableDropCursor = node && node.type.spec.disableDropCursor;\n let disabled = typeof disableDropCursor == \"function\"\n ? disableDropCursor(this.editorView, pos, event)\n : disableDropCursor;\n if (!pos || disabled)\n return null;\n let target = pos.pos;\n if (this.editorView.dragging && this.editorView.dragging.slice) {\n let point = dropPoint(this.editorView.state.doc, target, this.editorView.dragging.slice);\n if (point != null)\n target = point;\n }\n return target;\n }\n dragover(event) {\n if (!this.editorView.editable)\n return;\n this.lastDragEvent = event;\n let target = this.computeTarget(event);\n if (target != null) {\n this.setCursor(target);\n this.scheduleRemoval(5000);\n }\n }\n dragend() {\n this.scheduleRemoval(20);\n }\n drop() {\n this.scheduleRemoval(20);\n }\n dragleave(event) {\n if (!this.editorView.dom.contains(event.relatedTarget))\n this.setCursor(null);\n }\n}\n\nexport { dropCursor };\n","import { keydownHandler } from 'prosemirror-keymap';\nimport { Selection, NodeSelection, TextSelection, Plugin } from 'prosemirror-state';\nimport { Slice, Fragment } from 'prosemirror-model';\nimport { DecorationSet, Decoration } from 'prosemirror-view';\n\n/**\nGap cursor selections are represented using this class. Its\n`$anchor` and `$head` properties both point at the cursor position.\n*/\nclass GapCursor extends Selection {\n /**\n Create a gap cursor.\n */\n constructor($pos) {\n super($pos, $pos);\n }\n map(doc, mapping) {\n let $pos = doc.resolve(mapping.map(this.head));\n return GapCursor.valid($pos) ? new GapCursor($pos) : Selection.near($pos);\n }\n content() { return Slice.empty; }\n eq(other) {\n return other instanceof GapCursor && other.head == this.head;\n }\n toJSON() {\n return { type: \"gapcursor\", pos: this.head };\n }\n /**\n @internal\n */\n static fromJSON(doc, json) {\n if (typeof json.pos != \"number\")\n throw new RangeError(\"Invalid input for GapCursor.fromJSON\");\n return new GapCursor(doc.resolve(json.pos));\n }\n /**\n @internal\n */\n getBookmark() { return new GapBookmark(this.anchor); }\n /**\n @internal\n */\n static valid($pos) {\n let parent = $pos.parent;\n if (parent.inlineContent || !closedBefore($pos) || !closedAfter($pos))\n return false;\n let override = parent.type.spec.allowGapCursor;\n if (override != null)\n return override;\n let deflt = parent.contentMatchAt($pos.index()).defaultType;\n return deflt && deflt.isTextblock;\n }\n /**\n @internal\n */\n static findGapCursorFrom($pos, dir, mustMove = false) {\n search: for (;;) {\n if (!mustMove && GapCursor.valid($pos))\n return $pos;\n let pos = $pos.pos, next = null;\n // Scan up from this position\n for (let d = $pos.depth;; d--) {\n let parent = $pos.node(d);\n if (dir > 0 ? $pos.indexAfter(d) < parent.childCount : $pos.index(d) > 0) {\n next = parent.child(dir > 0 ? $pos.indexAfter(d) : $pos.index(d) - 1);\n break;\n }\n else if (d == 0) {\n return null;\n }\n pos += dir;\n let $cur = $pos.doc.resolve(pos);\n if (GapCursor.valid($cur))\n return $cur;\n }\n // And then down into the next node\n for (;;) {\n let inside = dir > 0 ? next.firstChild : next.lastChild;\n if (!inside) {\n if (next.isAtom && !next.isText && !NodeSelection.isSelectable(next)) {\n $pos = $pos.doc.resolve(pos + next.nodeSize * dir);\n mustMove = false;\n continue search;\n }\n break;\n }\n next = inside;\n pos += dir;\n let $cur = $pos.doc.resolve(pos);\n if (GapCursor.valid($cur))\n return $cur;\n }\n return null;\n }\n }\n}\nGapCursor.prototype.visible = false;\nGapCursor.findFrom = GapCursor.findGapCursorFrom;\nSelection.jsonID(\"gapcursor\", GapCursor);\nclass GapBookmark {\n constructor(pos) {\n this.pos = pos;\n }\n map(mapping) {\n return new GapBookmark(mapping.map(this.pos));\n }\n resolve(doc) {\n let $pos = doc.resolve(this.pos);\n return GapCursor.valid($pos) ? new GapCursor($pos) : Selection.near($pos);\n }\n}\nfunction needsGap(type) {\n return type.isAtom || type.spec.isolating || type.spec.createGapCursor;\n}\nfunction closedBefore($pos) {\n for (let d = $pos.depth; d >= 0; d--) {\n let index = $pos.index(d), parent = $pos.node(d);\n // At the start of this parent, look at next one\n if (index == 0) {\n if (parent.type.spec.isolating)\n return true;\n continue;\n }\n // See if the node before (or its first ancestor) is closed\n for (let before = parent.child(index - 1);; before = before.lastChild) {\n if ((before.childCount == 0 && !before.inlineContent) || needsGap(before.type))\n return true;\n if (before.inlineContent)\n return false;\n }\n }\n // Hit start of document\n return true;\n}\nfunction closedAfter($pos) {\n for (let d = $pos.depth; d >= 0; d--) {\n let index = $pos.indexAfter(d), parent = $pos.node(d);\n if (index == parent.childCount) {\n if (parent.type.spec.isolating)\n return true;\n continue;\n }\n for (let after = parent.child(index);; after = after.firstChild) {\n if ((after.childCount == 0 && !after.inlineContent) || needsGap(after.type))\n return true;\n if (after.inlineContent)\n return false;\n }\n }\n return true;\n}\n\n/**\nCreate a gap cursor plugin. When enabled, this will capture clicks\nnear and arrow-key-motion past places that don't have a normally\nselectable position nearby, and create a gap cursor selection for\nthem. The cursor is drawn as an element with class\n`ProseMirror-gapcursor`. You can either include\n`style/gapcursor.css` from the package's directory or add your own\nstyles to make it visible.\n*/\nfunction gapCursor() {\n return new Plugin({\n props: {\n decorations: drawGapCursor,\n createSelectionBetween(_view, $anchor, $head) {\n return $anchor.pos == $head.pos && GapCursor.valid($head) ? new GapCursor($head) : null;\n },\n handleClick,\n handleKeyDown,\n handleDOMEvents: { beforeinput: beforeinput }\n }\n });\n}\nconst handleKeyDown = keydownHandler({\n \"ArrowLeft\": arrow(\"horiz\", -1),\n \"ArrowRight\": arrow(\"horiz\", 1),\n \"ArrowUp\": arrow(\"vert\", -1),\n \"ArrowDown\": arrow(\"vert\", 1)\n});\nfunction arrow(axis, dir) {\n const dirStr = axis == \"vert\" ? (dir > 0 ? \"down\" : \"up\") : (dir > 0 ? \"right\" : \"left\");\n return function (state, dispatch, view) {\n let sel = state.selection;\n let $start = dir > 0 ? sel.$to : sel.$from, mustMove = sel.empty;\n if (sel instanceof TextSelection) {\n if (!view.endOfTextblock(dirStr) || $start.depth == 0)\n return false;\n mustMove = false;\n $start = state.doc.resolve(dir > 0 ? $start.after() : $start.before());\n }\n let $found = GapCursor.findGapCursorFrom($start, dir, mustMove);\n if (!$found)\n return false;\n if (dispatch)\n dispatch(state.tr.setSelection(new GapCursor($found)));\n return true;\n };\n}\nfunction handleClick(view, pos, event) {\n if (!view || !view.editable)\n return false;\n let $pos = view.state.doc.resolve(pos);\n if (!GapCursor.valid($pos))\n return false;\n let clickPos = view.posAtCoords({ left: event.clientX, top: event.clientY });\n if (clickPos && clickPos.inside > -1 && NodeSelection.isSelectable(view.state.doc.nodeAt(clickPos.inside)))\n return false;\n view.dispatch(view.state.tr.setSelection(new GapCursor($pos)));\n return true;\n}\n// This is a hack that, when a composition starts while a gap cursor\n// is active, quickly creates an inline context for the composition to\n// happen in, to avoid it being aborted by the DOM selection being\n// moved into a valid position.\nfunction beforeinput(view, event) {\n if (event.inputType != \"insertCompositionText\" || !(view.state.selection instanceof GapCursor))\n return false;\n let { $from } = view.state.selection;\n let insert = $from.parent.contentMatchAt($from.index()).findWrapping(view.state.schema.nodes.text);\n if (!insert)\n return false;\n let frag = Fragment.empty;\n for (let i = insert.length - 1; i >= 0; i--)\n frag = Fragment.from(insert[i].createAndFill(null, frag));\n let tr = view.state.tr.replace($from.pos, $from.pos, new Slice(frag, 0, 0));\n tr.setSelection(TextSelection.near(tr.doc.resolve($from.pos + 1)));\n view.dispatch(tr);\n return false;\n}\nfunction drawGapCursor(state) {\n if (!(state.selection instanceof GapCursor))\n return null;\n let node = document.createElement(\"div\");\n node.className = \"ProseMirror-gapcursor\";\n return DecorationSet.create(state.doc, [Decoration.widget(state.selection.head, node, { key: \"gapcursor\" })]);\n}\n\nexport { GapCursor, gapCursor };\n","import { Extension, callOrReturn, getChangedRanges, getExtensionField, isNodeEmpty, isNodeSelection } from \"@tiptap/core\";\nimport { Plugin, PluginKey } from \"@tiptap/pm/state\";\nimport { dropCursor } from \"@tiptap/pm/dropcursor\";\nimport { Decoration, DecorationSet } from \"@tiptap/pm/view\";\nimport { gapCursor } from \"@tiptap/pm/gapcursor\";\nimport { history, redo, undo } from \"@tiptap/pm/history\";\n//#region src/character-count/character-count.ts\n/**\n* This extension allows you to count the characters and words of your document.\n* @see https://tiptap.dev/api/extensions/character-count\n*/\nconst CharacterCount = Extension.create({\n\tname: \"characterCount\",\n\taddOptions() {\n\t\treturn {\n\t\t\tlimit: null,\n\t\t\tautoTrim: true,\n\t\t\tmode: \"textSize\",\n\t\t\ttextCounter: (text) => text.length,\n\t\t\twordCounter: (text) => text.split(\" \").filter((word) => word !== \"\").length\n\t\t};\n\t},\n\taddStorage() {\n\t\treturn {\n\t\t\tcharacters: () => 0,\n\t\t\twords: () => 0\n\t\t};\n\t},\n\tonBeforeCreate() {\n\t\tthis.storage.characters = (options) => {\n\t\t\tconst node = (options === null || options === void 0 ? void 0 : options.node) || this.editor.state.doc;\n\t\t\tif (((options === null || options === void 0 ? void 0 : options.mode) || this.options.mode) === \"textSize\") {\n\t\t\t\tconst text = node.textBetween(0, node.content.size, void 0, \" \");\n\t\t\t\treturn this.options.textCounter(text);\n\t\t\t}\n\t\t\treturn node.nodeSize;\n\t\t};\n\t\tthis.storage.words = (options) => {\n\t\t\tconst node = (options === null || options === void 0 ? void 0 : options.node) || this.editor.state.doc;\n\t\t\tconst text = node.textBetween(0, node.content.size, \" \", \" \");\n\t\t\treturn this.options.wordCounter(text);\n\t\t};\n\t},\n\taddProseMirrorPlugins() {\n\t\tlet initialEvaluationDone = false;\n\t\treturn [new Plugin({\n\t\t\tkey: new PluginKey(\"characterCount\"),\n\t\t\tappendTransaction: (transactions, oldState, newState) => {\n\t\t\t\tif (initialEvaluationDone) return;\n\t\t\t\tconst limit = this.options.limit;\n\t\t\t\tconst autoTrim = this.options.autoTrim;\n\t\t\t\tif (limit === null || limit === void 0 || limit === 0 || autoTrim === false) {\n\t\t\t\t\tinitialEvaluationDone = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst initialContentSize = this.storage.characters({ node: newState.doc });\n\t\t\t\tif (initialContentSize > limit) {\n\t\t\t\t\tconst over = initialContentSize - limit;\n\t\t\t\t\tconst from = 0;\n\t\t\t\t\tconst to = over;\n\t\t\t\t\tconsole.warn(`[CharacterCount] Initial content exceeded limit of ${limit} characters. Content was automatically trimmed.`);\n\t\t\t\t\tconst tr = newState.tr.deleteRange(from, to);\n\t\t\t\t\tinitialEvaluationDone = true;\n\t\t\t\t\treturn tr;\n\t\t\t\t}\n\t\t\t\tinitialEvaluationDone = true;\n\t\t\t},\n\t\t\tfilterTransaction: (transaction, state) => {\n\t\t\t\tconst limit = this.options.limit;\n\t\t\t\tif (!transaction.docChanged || limit === 0 || limit === null || limit === void 0) return true;\n\t\t\t\tconst oldSize = this.storage.characters({ node: state.doc });\n\t\t\t\tconst newSize = this.storage.characters({ node: transaction.doc });\n\t\t\t\tif (newSize <= limit) return true;\n\t\t\t\tif (oldSize > limit && newSize > limit && newSize <= oldSize) return true;\n\t\t\t\tif (oldSize > limit && newSize > limit && newSize > oldSize) return false;\n\t\t\t\tif (!transaction.getMeta(\"paste\")) return false;\n\t\t\t\tconst pos = transaction.selection.$head.pos;\n\t\t\t\tconst from = pos - (newSize - limit);\n\t\t\t\tconst to = pos;\n\t\t\t\ttransaction.deleteRange(from, to);\n\t\t\t\tif (this.storage.characters({ node: transaction.doc }) > limit) return false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t})];\n\t}\n});\n//#endregion\n//#region src/drop-cursor/drop-cursor.ts\n/**\n* This extension allows you to add a drop cursor to your editor.\n* A drop cursor is a line that appears when you drag and drop content\n* in-between nodes.\n* @see https://tiptap.dev/api/extensions/dropcursor\n*/\nconst Dropcursor = Extension.create({\n\tname: \"dropCursor\",\n\taddOptions() {\n\t\treturn {\n\t\t\tcolor: \"currentColor\",\n\t\t\twidth: 1,\n\t\t\tclass: void 0\n\t\t};\n\t},\n\taddProseMirrorPlugins() {\n\t\treturn [dropCursor(this.options)];\n\t}\n});\n//#endregion\n//#region src/focus/focus.ts\n/**\n* This extension allows you to add a class to the focused node.\n* @see https://www.tiptap.dev/api/extensions/focus\n*/\nconst Focus = Extension.create({\n\tname: \"focus\",\n\taddOptions() {\n\t\treturn {\n\t\t\tclassName: \"has-focus\",\n\t\t\tmode: \"all\"\n\t\t};\n\t},\n\taddProseMirrorPlugins() {\n\t\treturn [new Plugin({\n\t\t\tkey: new PluginKey(\"focus\"),\n\t\t\tprops: { decorations: ({ doc, selection }) => {\n\t\t\t\tconst { isEditable, isFocused } = this.editor;\n\t\t\t\tconst { anchor } = selection;\n\t\t\t\tconst decorations = [];\n\t\t\t\tif (!isEditable || !isFocused) return DecorationSet.create(doc, []);\n\t\t\t\tlet maxLevels = 0;\n\t\t\t\tif (this.options.mode === \"deepest\") doc.descendants((node, pos) => {\n\t\t\t\t\tif (node.isText) return;\n\t\t\t\t\tif (!(anchor >= pos && anchor <= pos + node.nodeSize - 1)) return false;\n\t\t\t\t\tmaxLevels += 1;\n\t\t\t\t});\n\t\t\t\tlet currentLevel = 0;\n\t\t\t\tdoc.descendants((node, pos) => {\n\t\t\t\t\tif (node.isText) return false;\n\t\t\t\t\tif (!(anchor >= pos && anchor <= pos + node.nodeSize - 1)) return false;\n\t\t\t\t\tcurrentLevel += 1;\n\t\t\t\t\tif (this.options.mode === \"deepest\" && maxLevels - currentLevel > 0 || this.options.mode === \"shallowest\" && currentLevel > 1) return this.options.mode === \"deepest\";\n\t\t\t\t\tdecorations.push(Decoration.node(pos, pos + node.nodeSize, { class: this.options.className }));\n\t\t\t\t});\n\t\t\t\treturn DecorationSet.create(doc, decorations);\n\t\t\t} }\n\t\t})];\n\t}\n});\n//#endregion\n//#region src/gap-cursor/gap-cursor.ts\n/**\n* This extension allows you to add a gap cursor to your editor.\n* A gap cursor is a cursor that appears when you click on a place\n* where no content is present, for example inbetween nodes.\n* @see https://tiptap.dev/api/extensions/gapcursor\n*/\nconst Gapcursor = Extension.create({\n\tname: \"gapCursor\",\n\taddProseMirrorPlugins() {\n\t\treturn [gapCursor()];\n\t},\n\textendNodeSchema(extension) {\n\t\tvar _callOrReturn;\n\t\tconst context = {\n\t\t\tname: extension.name,\n\t\t\toptions: extension.options,\n\t\t\tstorage: extension.storage\n\t\t};\n\t\treturn { allowGapCursor: (_callOrReturn = callOrReturn(getExtensionField(extension, \"allowGapCursor\", context))) !== null && _callOrReturn !== void 0 ? _callOrReturn : null };\n\t}\n});\n//#endregion\n//#region src/placeholder/constants.ts\n/** The default data attribute label */\nconst DEFAULT_DATA_ATTRIBUTE = \"placeholder\";\n/** The plugin key used to store and read the placeholder decoration set */\nconst PLUGIN_KEY = new PluginKey(\"tiptap__placeholder\");\n//#endregion\n//#region src/placeholder/utils/createPlaceholderDecoration.ts\n/**\n* Creates a ProseMirror node decoration that applies a placeholder\n* CSS class and data attribute to an empty node.\n* @param options.editor - The editor instance\n* @param options.pos - The position of the node in the document\n* @param options.node - The ProseMirror node\n* @param options.isEmptyDoc - Whether the entire document is empty\n* @param options.hasAnchor - Whether the selection anchor is within the node\n* @param options.dataAttribute - The data attribute name (e.g. `data-placeholder`)\n* @param options.classes - CSS classes for empty nodes and the empty editor\n* @param options.placeholder - The placeholder text or a function that returns it\n* @returns A ProseMirror node decoration with placeholder classes and data attribute\n*/\nfunction createPlaceholderDecoration(options) {\n\tconst { editor, placeholder, dataAttribute, pos, node, isEmptyDoc, hasAnchor, classes: { emptyNode, emptyEditor } } = options;\n\tconst classes = [emptyNode];\n\tif (isEmptyDoc) classes.push(emptyEditor);\n\treturn Decoration.node(pos, pos + node.nodeSize, {\n\t\tclass: classes.join(\" \"),\n\t\t[dataAttribute]: typeof placeholder === \"function\" ? placeholder({\n\t\t\teditor,\n\t\t\tnode,\n\t\t\tpos,\n\t\t\thasAnchor\n\t\t}) : placeholder\n\t});\n}\n//#endregion\n//#region src/placeholder/utils/buildPlaceholderDecorations.ts\nfunction resolveEmptyNodeClass(emptyNodeClass, props) {\n\treturn typeof emptyNodeClass === \"function\" ? emptyNodeClass(props) : emptyNodeClass;\n}\n/**\n* Scans a document range for empty textblocks that should receive placeholder\n* decorations. Used by the slow path and incremental state updates.\n*/\nfunction scanRangeForDecorations({ editor, options, dataAttribute, doc, selection, from, to }) {\n\tconst { anchor } = selection;\n\tconst decorations = [];\n\tconst isEmptyDoc = editor.isEmpty;\n\tdoc.nodesBetween(from, to, (node, pos) => {\n\t\tconst hasAnchor = anchor >= pos && anchor <= pos + node.nodeSize;\n\t\tconst isEmpty = !node.isLeaf && isNodeEmpty(node);\n\t\tif (!node.type.isTextblock) return options.includeChildren;\n\t\tif ((hasAnchor || !options.showOnlyCurrent) && isEmpty) decorations.push(createPlaceholderDecoration({\n\t\t\teditor,\n\t\t\tisEmptyDoc,\n\t\t\tdataAttribute,\n\t\t\thasAnchor,\n\t\t\tplaceholder: options.placeholder,\n\t\t\tclasses: {\n\t\t\t\temptyEditor: options.emptyEditorClass,\n\t\t\t\temptyNode: resolveEmptyNodeClass(options.emptyNodeClass, {\n\t\t\t\t\teditor,\n\t\t\t\t\tnode,\n\t\t\t\t\tpos,\n\t\t\t\t\thasAnchor\n\t\t\t\t})\n\t\t\t},\n\t\t\tnode,\n\t\t\tpos\n\t\t}));\n\t\treturn options.includeChildren;\n\t});\n\treturn decorations;\n}\n/**\n* Builds the placeholder decorations for the current document state.\n* @param options.editor - The editor instance.\n* @param options.options - The resolved placeholder options.\n* @param options.dataAttribute - The prepared `data-*` attribute name.\n* @param options.doc - The current document node.\n* @param options.selection - The current selection.\n* @returns A decoration set, or `null` when no placeholders should be shown.\n*/\nfunction buildPlaceholderDecorations({ editor, options, dataAttribute, doc, selection }) {\n\tif (!(editor.isEditable || !options.showOnlyWhenEditable)) return null;\n\tconst { anchor } = selection;\n\tconst decorations = [];\n\tconst isEmptyDoc = editor.isEmpty;\n\tif (options.showOnlyCurrent && !options.includeChildren) {\n\t\tconst resolved = doc.resolve(anchor);\n\t\tconst node = resolved.depth > 0 ? resolved.node(1) : resolved.nodeAfter;\n\t\tconst nodeStart = resolved.depth > 0 ? resolved.before(1) : anchor;\n\t\tif (node && node.type.isTextblock && isNodeEmpty(node)) {\n\t\t\tconst hasAnchor = anchor >= nodeStart && anchor <= nodeStart + node.nodeSize;\n\t\t\tdecorations.push(createPlaceholderDecoration({\n\t\t\t\teditor,\n\t\t\t\tisEmptyDoc,\n\t\t\t\tdataAttribute,\n\t\t\t\thasAnchor,\n\t\t\t\tplaceholder: options.placeholder,\n\t\t\t\tclasses: {\n\t\t\t\t\temptyEditor: options.emptyEditorClass,\n\t\t\t\t\temptyNode: resolveEmptyNodeClass(options.emptyNodeClass, {\n\t\t\t\t\t\teditor,\n\t\t\t\t\t\tnode,\n\t\t\t\t\t\tpos: nodeStart,\n\t\t\t\t\t\thasAnchor\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t\tnode,\n\t\t\t\tpos: nodeStart\n\t\t\t}));\n\t\t}\n\t} else decorations.push(...scanRangeForDecorations({\n\t\teditor,\n\t\toptions,\n\t\tdataAttribute,\n\t\tdoc,\n\t\tselection,\n\t\tfrom: 0,\n\t\tto: doc.content.size\n\t}));\n\treturn DecorationSet.create(doc, decorations);\n}\n//#endregion\n//#region src/placeholder/utils/resolveTopLevelRange.ts\n/**\n* Resolves a document position to the `[from, to)` range of its containing\n* top-level block node in absolute document positions.\n*/\nfunction resolveTopLevelRange(doc, pos) {\n\tconst resolved = doc.resolve(pos);\n\tif (resolved.depth === 0) {\n\t\tvar _resolved$nodeAfter;\n\t\tconst node = (_resolved$nodeAfter = resolved.nodeAfter) !== null && _resolved$nodeAfter !== void 0 ? _resolved$nodeAfter : resolved.nodeBefore;\n\t\tif (!node) return {\n\t\t\tfrom: pos,\n\t\t\tto: pos\n\t\t};\n\t\tconst nodePos = resolved.nodeAfter ? pos : pos - node.nodeSize;\n\t\treturn {\n\t\t\tfrom: nodePos,\n\t\t\tto: nodePos + node.nodeSize\n\t\t};\n\t}\n\tconst topLevelPos = resolved.before(1);\n\treturn {\n\t\tfrom: topLevelPos,\n\t\tto: topLevelPos + resolved.node(1).nodeSize\n\t};\n}\n/**\n* Converts an absolute document range to content-relative positions used by\n* `Node#nodesBetween` and `Node#forEach` offsets.\n*/\nfunction toContentRelativeRange(doc, range) {\n\treturn {\n\t\tfrom: Math.max(0, range.from - 1),\n\t\tto: Math.min(doc.content.size, range.to - 1)\n\t};\n}\n/**\n* Returns the top-level block ranges that intersect a document change range.\n* Input `from`/`to` are absolute positions (e.g. from `getChangedRanges`).\n* Returned ranges are content-relative, matching `Node#forEach` offsets.\n*/\nfunction getTopLevelBlocksInRange(doc, from, to) {\n\tconst ranges = [];\n\tdoc.forEach((node, offset) => {\n\t\tconst nodeStart = offset;\n\t\tconst nodeEnd = nodeStart + node.nodeSize;\n\t\tconst absNodeStart = nodeStart + 1;\n\t\tconst absNodeEnd = nodeEnd + 1;\n\t\tif (absNodeStart < to && absNodeEnd > from) ranges.push({\n\t\t\tfrom: nodeStart,\n\t\t\tto: nodeEnd\n\t\t});\n\t});\n\treturn ranges;\n}\n/**\n* Sorts ranges by start position and merges overlapping or adjacent ranges.\n*/\nfunction mergeRanges(ranges) {\n\tif (ranges.length === 0) return [];\n\tconst sorted = [...ranges].sort((a, b) => a.from - b.from);\n\tconst merged = [{ ...sorted[0] }];\n\tfor (let i = 1; i < sorted.length; i += 1) {\n\t\tconst last = merged[merged.length - 1];\n\t\tconst current = sorted[i];\n\t\tif (current.from <= last.to) last.to = Math.max(last.to, current.to);\n\t\telse merged.push({ ...current });\n\t}\n\treturn merged;\n}\n//#endregion\n//#region src/placeholder/utils/placeholderStateField.ts\n/**\n* Expands a single changed range to the top-level blocks it touches.\n* Also resolves blocks at range boundaries so split/merge edits update\n* adjacent empty nodes (e.g. a new paragraph after Enter).\n*/\nfunction collectBlocksForChange(doc, change) {\n\tconst ranges = getTopLevelBlocksInRange(doc, change.from, change.to);\n\tranges.push(toContentRelativeRange(doc, resolveTopLevelRange(doc, change.from)));\n\tif (change.to > change.from) ranges.push(toContentRelativeRange(doc, resolveTopLevelRange(doc, Math.min(change.to, doc.content.size + 1) - 1)));\n\telse if (change.from < doc.content.size + 1) ranges.push(toContentRelativeRange(doc, resolveTopLevelRange(doc, Math.min(change.from + 1, doc.content.size))));\n\treturn ranges;\n}\n/**\n* Collects content-relative top-level block ranges that need placeholder\n* decorations recomputed after a transaction.\n*/\nfunction collectRescanRanges(tr, oldState, newState) {\n\tconst ranges = [];\n\tif (tr.docChanged) {\n\t\tconst changes = getChangedRanges(tr);\n\t\tfor (const change of changes) ranges.push(...collectBlocksForChange(newState.doc, change.newRange));\n\t}\n\tif (tr.selectionSet) {\n\t\tranges.push(toContentRelativeRange(newState.doc, resolveTopLevelRange(newState.doc, tr.mapping.map(oldState.selection.anchor))));\n\t\tranges.push(toContentRelativeRange(newState.doc, resolveTopLevelRange(newState.doc, newState.selection.anchor)));\n\t}\n\treturn mergeRanges(ranges);\n}\n/** Clamps a content-relative range to `[0, doc.content.size]`. */\nfunction clampRange(from, to, doc) {\n\tconst clampedFrom = Math.max(0, Math.min(from, doc.content.size));\n\treturn {\n\t\tfrom: clampedFrom,\n\t\tto: Math.max(clampedFrom, Math.min(to, doc.content.size))\n\t};\n}\n/**\n* Removes and rebuilds placeholder decorations within the given ranges.\n* Only drops decorations fully contained in a range so mapped decorations\n* on neighbouring blocks (e.g. at a block boundary) are kept intact.\n*/\nfunction updateDecorationsInRanges({ decorations, ranges, editor, options, dataAttribute, doc, selection }) {\n\tlet next = decorations;\n\tfor (const range of ranges) {\n\t\tconst { from, to } = clampRange(range.from, range.to, doc);\n\t\tconst existing = next.find(from, to).filter((decoration) => decoration.from >= from && decoration.to <= to);\n\t\tif (existing.length) next = next.remove(existing);\n\t\tconst newDecos = scanRangeForDecorations({\n\t\t\teditor,\n\t\t\toptions,\n\t\t\tdataAttribute,\n\t\t\tdoc,\n\t\t\tselection,\n\t\t\tfrom,\n\t\t\tto\n\t\t});\n\t\tif (newDecos.length) next = next.add(doc, newDecos);\n\t}\n\treturn next;\n}\n/**\n* Creates the incremental `StateField<DecorationSet>` used by the slow path\n* (`showOnlyCurrent: false` or `includeChildren: true`).\n*\n* Decorations are mapped through each transaction and only recomputed for\n* top-level blocks touched by document or selection changes.\n* @param options.editor - The editor instance.\n* @param options.options - The resolved placeholder options.\n* @param options.dataAttribute - The prepared `data-*` attribute name.\n* @returns A ProseMirror state field storing the placeholder decoration set.\n*/\nfunction createPlaceholderStateField({ editor, options, dataAttribute }) {\n\treturn {\n\t\tinit(_config, state) {\n\t\t\tconst decorations = buildPlaceholderDecorations({\n\t\t\t\teditor,\n\t\t\t\toptions,\n\t\t\t\tdataAttribute,\n\t\t\t\tdoc: state.doc,\n\t\t\t\tselection: state.selection\n\t\t\t});\n\t\t\treturn decorations !== null && decorations !== void 0 ? decorations : DecorationSet.empty;\n\t\t},\n\t\tapply(tr, prev, oldState, newState) {\n\t\t\tif (!tr.docChanged && !tr.selectionSet) return prev;\n\t\t\treturn updateDecorationsInRanges({\n\t\t\t\tdecorations: prev.map(tr.mapping, tr.doc),\n\t\t\t\tranges: collectRescanRanges(tr, oldState, newState),\n\t\t\t\teditor,\n\t\t\t\toptions,\n\t\t\t\tdataAttribute,\n\t\t\t\tdoc: newState.doc,\n\t\t\t\tselection: newState.selection\n\t\t\t});\n\t\t}\n\t};\n}\n//#endregion\n//#region src/placeholder/utils/preparePlaceholderAttribute.ts\n/**\n* Prepares the placeholder attribute by ensuring it is properly formatted.\n* @param attr - The placeholder attribute string.\n* @returns The prepared placeholder attribute string.\n*/\nfunction preparePlaceholderAttribute(attr) {\n\treturn attr.replace(/\\s+/g, \"-\").replace(/[^a-zA-Z0-9-]/g, \"\").replace(/^[0-9-]+/, \"\").replace(/^-+/, \"\").toLowerCase();\n}\n//#endregion\n//#region src/placeholder/plugins/PlaceholderPlugin.ts\n/**\n* Creates the ProseMirror plugin that renders placeholder decorations.\n* @param options.editor - The editor instance.\n* @param options.options - The resolved placeholder options.\n* @returns The configured placeholder plugin.\n*/\nfunction createPlaceholderPlugin({ editor, options }) {\n\tconst dataAttribute = options.dataAttribute ? `data-${preparePlaceholderAttribute(options.dataAttribute)}` : `data-${DEFAULT_DATA_ATTRIBUTE}`;\n\tconst useResolvedPath = options.showOnlyCurrent && !options.includeChildren;\n\treturn new Plugin({\n\t\tkey: PLUGIN_KEY,\n\t\t...useResolvedPath ? {} : { state: createPlaceholderStateField({\n\t\t\teditor,\n\t\t\toptions,\n\t\t\tdataAttribute\n\t\t}) },\n\t\tprops: { decorations: useResolvedPath ? ({ doc, selection }) => buildPlaceholderDecorations({\n\t\t\teditor,\n\t\t\toptions,\n\t\t\tdataAttribute,\n\t\t\tdoc,\n\t\t\tselection\n\t\t}) : (state) => {\n\t\t\tvar _PLUGIN_KEY$getState;\n\t\t\tif (options.showOnlyWhenEditable && !editor.isEditable) return DecorationSet.empty;\n\t\t\treturn (_PLUGIN_KEY$getState = PLUGIN_KEY.getState(state)) !== null && _PLUGIN_KEY$getState !== void 0 ? _PLUGIN_KEY$getState : DecorationSet.empty;\n\t\t} }\n\t});\n}\n//#endregion\n//#region src/placeholder/placeholder.ts\n/**\n* This extension allows you to add a placeholder to your editor.\n* A placeholder is a text that appears when the editor or a node is empty.\n* @see https://www.tiptap.dev/api/extensions/placeholder\n*/\nconst Placeholder = Extension.create({\n\tname: \"placeholder\",\n\taddOptions() {\n\t\treturn {\n\t\t\temptyEditorClass: \"is-editor-empty\",\n\t\t\temptyNodeClass: \"is-empty\",\n\t\t\tdataAttribute: DEFAULT_DATA_ATTRIBUTE,\n\t\t\tplaceholder: \"Write something …\",\n\t\t\tshowOnlyWhenEditable: true,\n\t\t\tshowOnlyCurrent: true,\n\t\t\tincludeChildren: false\n\t\t};\n\t},\n\taddProseMirrorPlugins() {\n\t\treturn [createPlaceholderPlugin({\n\t\t\teditor: this.editor,\n\t\t\toptions: this.options\n\t\t})];\n\t}\n});\n//#endregion\n//#region src/selection/selection.ts\n/**\n* Whether the native browser selection should be cleared on blur and restored on focus.\n* Only applies to non-empty text selections in an editable editor.\n*/\nfunction shouldSyncDomSelection(state, editor) {\n\treturn !state.selection.empty && !isNodeSelection(state.selection) && editor.isEditable;\n}\n/**\n* Whether the selection decoration should be rendered to keep the selection\n* visible while the editor is blurred (and not dragging).\n*/\nfunction shouldPreserveSelection(state, editor) {\n\treturn shouldSyncDomSelection(state, editor) && !editor.isFocused && !editor.view.dragging;\n}\nfunction clearDomSelection() {\n\tvar _window$getSelection;\n\t(_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 || _window$getSelection.removeAllRanges();\n}\n/**\n* Sync the native selection from the editor state.\n* @see https://prosemirror.net/docs/ref/#view.EditorView.focus\n*/\nfunction restoreDomSelection(view) {\n\tview.focus();\n}\n/**\n* This extension allows you to add a class to the selected text when the editor is blurred.\n* It clears the native browser selection on blur (so `::selection` styles do not overlap the\n* decoration) and restores it when the editor is focused again.\n* @see https://www.tiptap.dev/api/extensions/selection\n*/\nconst Selection = Extension.create({\n\tname: \"selection\",\n\taddOptions() {\n\t\treturn { className: \"selection\" };\n\t},\n\taddProseMirrorPlugins() {\n\t\tconst { editor, options } = this;\n\t\treturn [new Plugin({\n\t\t\tkey: new PluginKey(\"selection\"),\n\t\t\tprops: {\n\t\t\t\tdecorations(state) {\n\t\t\t\t\tif (!shouldPreserveSelection(state, editor)) return null;\n\t\t\t\t\treturn DecorationSet.create(state.doc, [Decoration.inline(state.selection.from, state.selection.to, { class: options.className })]);\n\t\t\t\t},\n\t\t\t\thandleDOMEvents: {\n\t\t\t\t\tblur(view) {\n\t\t\t\t\t\tif (!shouldSyncDomSelection(view.state, editor)) return false;\n\t\t\t\t\t\tclearDomSelection();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t},\n\t\t\t\t\tfocus(view) {\n\t\t\t\t\t\tif (!shouldSyncDomSelection(view.state, editor)) return false;\n\t\t\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\t\t\tif (!editor.isDestroyed && view.hasFocus()) restoreDomSelection(view);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})];\n\t}\n});\n//#endregion\n//#region src/trailing-node/trailing-node.ts\nconst skipTrailingNodeMeta = \"skipTrailingNode\";\nfunction nodeEqualsType({ types, node }) {\n\treturn node && Array.isArray(types) && types.includes(node.type) || (node === null || node === void 0 ? void 0 : node.type) === types;\n}\n/**\n* This extension allows you to add an extra node at the end of the document.\n* @see https://www.tiptap.dev/api/extensions/trailing-node\n*/\nconst TrailingNode = Extension.create({\n\tname: \"trailingNode\",\n\taddOptions() {\n\t\treturn {\n\t\t\tnode: void 0,\n\t\t\tnotAfter: []\n\t\t};\n\t},\n\taddProseMirrorPlugins() {\n\t\tvar _this$editor$schema$t;\n\t\tconst plugin = new PluginKey(this.name);\n\t\tconst defaultNode = this.options.node || ((_this$editor$schema$t = this.editor.schema.topNodeType.contentMatch.defaultType) === null || _this$editor$schema$t === void 0 ? void 0 : _this$editor$schema$t.name) || \"paragraph\";\n\t\tconst disabledNodes = Object.entries(this.editor.schema.nodes).map(([, value]) => value).filter((node) => (this.options.notAfter || []).concat(defaultNode).includes(node.name));\n\t\treturn [new Plugin({\n\t\t\tkey: plugin,\n\t\t\tappendTransaction: (transactions, __, state) => {\n\t\t\t\tconst { doc, tr, schema } = state;\n\t\t\t\tconst shouldInsertNodeAtEnd = plugin.getState(state);\n\t\t\t\tconst endPosition = doc.content.size;\n\t\t\t\tconst type = schema.nodes[defaultNode];\n\t\t\t\tif (transactions.some((transaction) => transaction.getMeta(\"skipTrailingNode\"))) return;\n\t\t\t\tif (!shouldInsertNodeAtEnd) return;\n\t\t\t\treturn tr.insert(endPosition, type.create());\n\t\t\t},\n\t\t\tstate: {\n\t\t\t\tinit: (_, state) => {\n\t\t\t\t\tconst lastNode = state.tr.doc.lastChild;\n\t\t\t\t\treturn !nodeEqualsType({\n\t\t\t\t\t\tnode: lastNode,\n\t\t\t\t\t\ttypes: disabledNodes\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tapply: (tr, value) => {\n\t\t\t\t\tif (!tr.docChanged) return value;\n\t\t\t\t\tif (tr.getMeta(\"__uniqueIDTransaction\")) return value;\n\t\t\t\t\tconst lastNode = tr.doc.lastChild;\n\t\t\t\t\treturn !nodeEqualsType({\n\t\t\t\t\t\tnode: lastNode,\n\t\t\t\t\t\ttypes: disabledNodes\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t})];\n\t}\n});\n//#endregion\n//#region src/undo-redo/undo-redo.ts\n/**\n* This extension allows you to undo and redo recent changes.\n* @see https://www.tiptap.dev/api/extensions/undo-redo\n*\n* **Important**: If the `@tiptap/extension-collaboration` package is used, make sure to remove\n* the `undo-redo` extension, as it is not compatible with the `collaboration` extension.\n*\n* `@tiptap/extension-collaboration` uses its own history implementation.\n*/\nconst UndoRedo = Extension.create({\n\tname: \"undoRedo\",\n\taddOptions() {\n\t\treturn {\n\t\t\tdepth: 100,\n\t\t\tnewGroupDelay: 500\n\t\t};\n\t},\n\taddCommands() {\n\t\treturn {\n\t\t\tundo: () => ({ state, dispatch }) => {\n\t\t\t\treturn undo(state, dispatch);\n\t\t\t},\n\t\t\tredo: () => ({ state, dispatch }) => {\n\t\t\t\treturn redo(state, dispatch);\n\t\t\t}\n\t\t};\n\t},\n\taddProseMirrorPlugins() {\n\t\treturn [history(this.options)];\n\t},\n\taddKeyboardShortcuts() {\n\t\treturn {\n\t\t\t\"Mod-z\": () => this.editor.commands.undo(),\n\t\t\t\"Shift-Mod-z\": () => this.editor.commands.redo(),\n\t\t\t\"Mod-y\": () => this.editor.commands.redo(),\n\t\t\t\"Mod-я\": () => this.editor.commands.undo(),\n\t\t\t\"Shift-Mod-я\": () => this.editor.commands.redo()\n\t\t};\n\t}\n});\n//#endregion\nexport { CharacterCount, DEFAULT_DATA_ATTRIBUTE, Dropcursor, Focus, Gapcursor, PLUGIN_KEY, Placeholder, Selection, TrailingNode, UndoRedo, preparePlaceholderAttribute, skipTrailingNodeMeta };\n\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[0,1,2],"mappings":";;;AAaA,SAAS,EAAW,IAAU,CAAC,GAAG;CAC9B,OAAO,IAAI,EAAO,EACd,KAAK,GAAY;EAAE,OAAO,IAAI,EAAe,GAAY,CAAO;CAAG,EACvE,CAAC;AACL;AACA,IAAM,IAAN,MAAqB;CACjB,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