@burdenoff/microfe-support 2026.1031.1 → 2026.1109.1

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 (147) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +6 -0
  2. package/dist/dev/main.d.ts +0 -0
  3. package/dist/generated/global-operations.d.ts +60 -60
  4. package/dist/node_modules/@tiptap/core/dist/index.js +949 -674
  5. package/dist/node_modules/@tiptap/core/dist/index.js.map +1 -1
  6. package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +1 -1
  7. package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +1 -1
  8. package/dist/node_modules/@tiptap/extension-code/dist/index.js +14 -3
  9. package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +1 -1
  10. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +1 -3
  11. package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +1 -1
  12. package/dist/node_modules/@tiptap/extension-document/dist/index.js.map +1 -1
  13. package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +1 -1
  14. package/dist/node_modules/@tiptap/extension-heading/dist/index.js +4 -1
  15. package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +1 -1
  16. package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +1 -1
  17. package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +1 -1
  18. package/dist/node_modules/@tiptap/extension-link/dist/index.js +76 -51
  19. package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +1 -1
  20. package/dist/node_modules/@tiptap/extension-list/dist/index.js +143 -127
  21. package/dist/node_modules/@tiptap/extension-list/dist/index.js.map +1 -1
  22. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +3 -2
  23. package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +1 -1
  24. package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js.map +1 -1
  25. package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +1 -1
  26. package/dist/node_modules/@tiptap/extension-text/dist/index.js.map +1 -1
  27. package/dist/node_modules/@tiptap/extension-underline/dist/index.js +21 -11
  28. package/dist/node_modules/@tiptap/extension-underline/dist/index.js.map +1 -1
  29. package/dist/node_modules/@tiptap/extensions/dist/index.js +8 -9
  30. package/dist/node_modules/@tiptap/extensions/dist/index.js.map +1 -1
  31. package/dist/node_modules/@tiptap/react/dist/index.js +70 -49
  32. package/dist/node_modules/@tiptap/react/dist/index.js.map +1 -1
  33. package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +1 -1
  34. package/dist/node_modules/fast-equals/dist/es/index.js +108 -76
  35. package/dist/node_modules/fast-equals/dist/es/index.js.map +1 -1
  36. package/dist/node_modules/linkifyjs/dist/linkify.js +127 -113
  37. package/dist/node_modules/linkifyjs/dist/linkify.js.map +1 -1
  38. package/dist/node_modules/prosemirror-dropcursor/dist/index.js +1 -1
  39. package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +1 -1
  40. package/dist/node_modules/prosemirror-history/dist/index.js +21 -14
  41. package/dist/node_modules/prosemirror-history/dist/index.js.map +1 -1
  42. package/dist/node_modules/prosemirror-model/dist/index.js +98 -105
  43. package/dist/node_modules/prosemirror-model/dist/index.js.map +1 -1
  44. package/dist/node_modules/prosemirror-schema-list/dist/index.js +37 -34
  45. package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +1 -1
  46. package/dist/node_modules/prosemirror-transform/dist/index.js +153 -101
  47. package/dist/node_modules/prosemirror-transform/dist/index.js.map +1 -1
  48. package/dist/node_modules/prosemirror-view/dist/index.js +742 -693
  49. package/dist/node_modules/prosemirror-view/dist/index.js.map +1 -1
  50. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +96 -17
  51. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
  52. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +55 -0
  53. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +1 -0
  54. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +53 -0
  55. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js.map +1 -0
  56. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +53 -0
  57. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -0
  58. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +45 -0
  59. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +1 -0
  60. package/dist/node_modules/use-sync-external-store/shim/index.js +11 -0
  61. package/dist/node_modules/use-sync-external-store/shim/index.js.map +1 -0
  62. package/dist/node_modules/use-sync-external-store/shim/with-selector.js +11 -0
  63. package/dist/node_modules/use-sync-external-store/shim/with-selector.js.map +1 -0
  64. package/dist/support/SupportAdminRoot.d.ts +2 -2
  65. package/dist/support/SupportAdminRoutes.d.ts +1 -1
  66. package/dist/support/SupportUserRoot.d.ts +2 -2
  67. package/dist/support/SupportUserRoutes.d.ts +1 -1
  68. package/dist/support/components/NotificationToast.d.ts +2 -2
  69. package/dist/support/components/PageLayout.d.ts +4 -4
  70. package/dist/support/components/RouteHelpers.d.ts +1 -1
  71. package/dist/support/components/analytics/CategoryBreakdown.d.ts +1 -1
  72. package/dist/support/components/analytics/MetricCard.d.ts +1 -1
  73. package/dist/support/components/analytics/PriorityBreakdown.d.ts +1 -1
  74. package/dist/support/components/analytics/SLAReport.d.ts +1 -1
  75. package/dist/support/components/analytics/SatisfactionDistribution.d.ts +1 -1
  76. package/dist/support/components/analytics/TopAgents.d.ts +1 -1
  77. package/dist/support/components/analytics/TrendChart.d.ts +1 -1
  78. package/dist/support/components/careers/BulkCandidateActionGuidance.d.ts +1 -1
  79. package/dist/support/components/careers/BulkCandidateDialogs.d.ts +7 -7
  80. package/dist/support/components/careers/BulkOperationFeedback.d.ts +8 -8
  81. package/dist/support/components/careers/BulkSelectionSummary.d.ts +2 -2
  82. package/dist/support/components/careers/RichTextEditor.d.ts +1 -2
  83. package/dist/support/components/careers/RichTextEditor.js.map +1 -1
  84. package/dist/support/components/kb/ArticleForm.d.ts +1 -1
  85. package/dist/support/components/settings/CannedResponsesSettings.d.ts +1 -1
  86. package/dist/support/components/settings/SLAPoliciesSettings.d.ts +1 -1
  87. package/dist/support/components/settings/TicketCategoriesSettings.d.ts +1 -1
  88. package/dist/support/components/tickets/AttachmentList.d.ts +1 -1
  89. package/dist/support/components/tickets/MarkdownContent.d.ts +1 -1
  90. package/dist/support/components/tickets/MessageComposer.d.ts +1 -1
  91. package/dist/support/components/tickets/MessageThread.d.ts +2 -2
  92. package/dist/support/components/tickets/TicketDetailHeader.d.ts +2 -2
  93. package/dist/support/components/tickets/TicketHeader.d.ts +2 -2
  94. package/dist/support/components/tickets/TicketSidebar.d.ts +2 -2
  95. package/dist/support/components/tickets/TriagePanel.d.ts +2 -2
  96. package/dist/support/constants/pipeline.d.ts +0 -6
  97. package/dist/support/events/rybbit.d.ts +1 -1
  98. package/dist/support/hooks/useAnalyticsOperations.d.ts +10 -25
  99. package/dist/support/hooks/useAnalyticsOperations.js +40 -39
  100. package/dist/support/hooks/useAnalyticsOperations.js.map +1 -1
  101. package/dist/support/hooks/useAttachmentsFailedToast.d.ts +1 -1
  102. package/dist/support/hooks/useChatOperations.d.ts +2 -2
  103. package/dist/support/hooks/useKnowledgeBaseOperations.d.ts +7 -13
  104. package/dist/support/hooks/useKnowledgeBaseOperations.js +84 -83
  105. package/dist/support/hooks/useKnowledgeBaseOperations.js.map +1 -1
  106. package/dist/support/hooks/useRegisterFooter.d.ts +1 -1
  107. package/dist/support/hooks/useSettingsOperations.d.ts +7 -16
  108. package/dist/support/hooks/useSupportAttachments.d.ts +1 -1
  109. package/dist/support/hooks/useTicketListOperations.d.ts +3 -6
  110. package/dist/support/hooks/useTicketOperations.d.ts +5 -11
  111. package/dist/support/hooks/useTicketOperations.js +80 -79
  112. package/dist/support/hooks/useTicketOperations.js.map +1 -1
  113. package/dist/support/pages/AnalyticsPage.d.ts +1 -1
  114. package/dist/support/pages/ArticleDetailAdminPage.d.ts +1 -1
  115. package/dist/support/pages/ArticleDetailUserPage.d.ts +1 -1
  116. package/dist/support/pages/ContactInquiriesPage.d.ts +1 -1
  117. package/dist/support/pages/ContactInquiryDetailPage.d.ts +1 -1
  118. package/dist/support/pages/CreateArticlePage.d.ts +1 -1
  119. package/dist/support/pages/CreateTicketPage.d.ts +1 -1
  120. package/dist/support/pages/EditArticlePage.d.ts +1 -1
  121. package/dist/support/pages/InterviewersPage.d.ts +1 -1
  122. package/dist/support/pages/JobApplicationDetailPage.d.ts +1 -2
  123. package/dist/support/pages/JobApplicationsPage.d.ts +1 -1
  124. package/dist/support/pages/JobPostingDetailPage.d.ts +1 -1
  125. package/dist/support/pages/JobPostingsPage.d.ts +1 -1
  126. package/dist/support/pages/KnowledgeBaseAdminPage.d.ts +1 -1
  127. package/dist/support/pages/KnowledgeBaseUserPage.d.ts +1 -1
  128. package/dist/support/pages/SettingsPage.d.ts +1 -1
  129. package/dist/support/pages/SettingsPage.js.map +1 -1
  130. package/dist/support/pages/TicketDetailAdminPage.d.ts +1 -1
  131. package/dist/support/pages/TicketDetailUserPage.d.ts +1 -1
  132. package/dist/support/pages/TicketDetailUserPage.js.map +1 -1
  133. package/dist/support/pages/TicketListPage.d.ts +1 -1
  134. package/dist/support/providers/SupportProvider.d.ts +2 -2
  135. package/dist/support/store/supportStore.d.ts +2 -2
  136. package/dist/support/utils/bulkCandidateTargetQuery.d.ts +1 -1
  137. package/dist/support/utils/cn.d.ts +1 -1
  138. package/dist/support/utils/index.d.ts +1 -1
  139. package/dist/support/utils/markdown.d.ts +0 -1
  140. package/dist/support/utils/refetch.d.ts +12 -0
  141. package/dist/support/utils/refetch.js +7 -0
  142. package/dist/support/utils/refetch.js.map +1 -0
  143. package/dist/support/utils/ticketFilters.d.ts +2 -2
  144. package/dist/support/utils/uiTokens.d.ts +1 -1
  145. package/dist/test/dom.d.ts +1 -0
  146. package/dist/test/setup.d.ts +1 -0
  147. package/package.json +65 -54
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["useState2","useSyncExternalStore2","createContext2","useContext2","React3","React4","createContext3","useContext3","useMemo2","commands_exports","React","ReactDOM","mergeRefs","refs","ref","node","Portals","renderers","useSyncExternalStore","contentComponent","Fragment","createContentComponent","subscribers","isNotificationQueued","notifySubscribers","subscriber","callback","id","renderer","nextRenderers","PureEditorContent","props","editor","element","newElement","rest","innerRef","EditorContentWithKey","forwardRef","key","EditorContent","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","EditorStateManager","initialEditor","nextEditor","lastTransaction","fn","currentEditor","useEditorState","editorStateManager","useState","options","selectedState","useSyncExternalStoreWithSelector","deepEqual","useDebugValue","isDev","isSSR","isNext","EditorInstanceManager","_EditorInstanceManager","cb","explicit","immediatelyRender","optionsToApply","args","_a","Editor","onStoreChange","a","b","extension","index","deps","dep","currentInstanceId","useEditor","mostRecentOptions","useRef","instanceManager","transactionNumber","EditorContext","createContext","ReactNodeViewContext","useReactNodeView","useContext","Tag","TiptapContext","useTiptap","TiptapWrapper","resolvedEditor","tiptapContextValue","useMemo","legacyContextValue","TiptapContent","CommandManager","DECORATION_MANAGER_PLUGIN_KEY","DecorationManager","Extendable","Extension","InputRule","MappablePosition","Mark","Node","NodePos","PasteRule","callOrReturn","canInsertNode","combineTransactionSteps","createChainableState","createDocument","createMappablePosition","createNodeFromContent","createStyleTag","defaultBlockAt","deleteProps","elementFromString","findChildrenInRange","findDuplicates","findParentNode","findParentNodeClosestToPos","flattenExtensions","fromString","getAttributes","getAttributesFromExtensions","getChangedRanges","getExtensionField","getHTMLFromFragment","getMarkAttributes","getMarkRange","getMarkType","getMarksBetween","getNodeAtPosition","getNodeAttributes","getNodeType","getPreviousBlockSibling","getRenderedAttributes","getSchemaByResolvedExtensions","getSchemaTypeByName","getSchemaTypeNameByName","getSplittedAttributes","getText","getTextBetween","getTextContentFromNodes","getTextSerializersFromSchema","getUpdatedPosition","injectExtensionAttributesToParseRule","inputRulesPlugin","isActive","isAndroid","isAtEndOfNode","isAtStartOfNode","isEmptyObject","isExtensionRulesEnabled","isFunction","isList","isMacOS","isMarkActive","isNodeActive","isNodeEmpty","isNodeSelection","isNumber","isPlainObject","isRegExp","isSafari","isTextSelection","isiOS","markInputRule","markPasteRule","mergeAttributes","mergeDeep","minMax","nodeInputRule","objectIncludes","parseIndentedBlocks","pasteRulesPlugin","removeDuplicates","renderNestedMarkdownContent","resolveExtensions","resolveFocusPosition","selectionToInsertionEnd","sortExtensions","splitExtensions","textblockTypeInputRule","updateMarkViewAttributes","wrappingInputRule"],"sources":["../../../../../node_modules/@tiptap/react/dist/index.js"],"sourcesContent":["\"use client\";\n\n// src/Context.tsx\nimport { createContext, useContext, useMemo } from \"react\";\n\n// src/EditorContent.tsx\nimport React, { forwardRef } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { useSyncExternalStore } from \"use-sync-external-store/shim/index.js\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar mergeRefs = (...refs) => {\n return (node) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ;\n ref.current = node;\n }\n });\n };\n};\nvar Portals = ({ contentComponent }) => {\n const renderers = useSyncExternalStore(\n contentComponent.subscribe,\n contentComponent.getSnapshot,\n contentComponent.getServerSnapshot\n );\n return /* @__PURE__ */ jsx(Fragment, { children: Object.values(renderers) });\n};\nfunction createContentComponent() {\n const subscribers = /* @__PURE__ */ new Set();\n let renderers = {};\n let isNotificationQueued = false;\n const notifySubscribers = () => {\n if (isNotificationQueued || !subscribers.size) {\n return;\n }\n isNotificationQueued = true;\n queueMicrotask(() => {\n isNotificationQueued = false;\n subscribers.forEach((subscriber) => subscriber());\n });\n };\n return {\n /**\n * Subscribe to the editor instance's changes.\n */\n subscribe(callback) {\n subscribers.add(callback);\n return () => {\n subscribers.delete(callback);\n };\n },\n getSnapshot() {\n return renderers;\n },\n getServerSnapshot() {\n return renderers;\n },\n /**\n * Adds a new NodeView Renderer to the editor.\n */\n setRenderer(id, renderer) {\n renderers = {\n ...renderers,\n [id]: ReactDOM.createPortal(renderer.reactElement, renderer.element, id)\n };\n notifySubscribers();\n },\n /**\n * Removes a NodeView Renderer from the editor.\n */\n removeRenderer(id) {\n const nextRenderers = { ...renderers };\n delete nextRenderers[id];\n renderers = nextRenderers;\n notifySubscribers();\n }\n };\n}\nvar PureEditorContent = class extends React.Component {\n constructor(props) {\n super(props);\n this.editorContentRef = React.createRef();\n }\n componentDidMount() {\n this.init();\n }\n componentDidUpdate() {\n this.init();\n }\n init() {\n var _a;\n const editor = this.props.editor;\n if (editor && !editor.isDestroyed && ((_a = editor.view.dom) == null ? void 0 : _a.parentNode)) {\n if (editor.contentComponent) {\n return;\n }\n const element = this.editorContentRef.current;\n element.append(...editor.view.dom.parentNode.childNodes);\n editor.setOptions({\n element\n });\n editor.contentComponent = createContentComponent();\n editor.createNodeViews();\n editor.isEditorContentInitialized = true;\n this.forceUpdate();\n }\n }\n componentWillUnmount() {\n var _a;\n const editor = this.props.editor;\n if (!editor) {\n return;\n }\n editor.isEditorContentInitialized = false;\n if (!editor.isDestroyed) {\n editor.view.setProps({\n nodeViews: {}\n });\n }\n editor.contentComponent = null;\n try {\n if (!((_a = editor.view.dom) == null ? void 0 : _a.parentNode)) {\n return;\n }\n const newElement = document.createElement(\"div\");\n newElement.append(...editor.view.dom.parentNode.childNodes);\n editor.setOptions({\n element: newElement\n });\n } catch {\n }\n }\n render() {\n const { editor, innerRef, ...rest } = this.props;\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\"div\", { ref: mergeRefs(innerRef, this.editorContentRef), ...rest }),\n (editor == null ? void 0 : editor.contentComponent) && /* @__PURE__ */ jsx(Portals, { contentComponent: editor.contentComponent })\n ] });\n }\n};\nvar EditorContentWithKey = forwardRef(\n (props, ref) => {\n const key = React.useMemo(() => {\n return Math.floor(Math.random() * 4294967295).toString();\n }, [props.editor]);\n return React.createElement(PureEditorContent, {\n key,\n innerRef: ref,\n ...props\n });\n }\n);\nvar EditorContent = React.memo(EditorContentWithKey);\n\n// src/useEditor.ts\nimport { Editor } from \"@tiptap/core\";\nimport { useDebugValue as useDebugValue2, useEffect as useEffect2, useRef, useState as useState2 } from \"react\";\nimport { useSyncExternalStore as useSyncExternalStore2 } from \"use-sync-external-store/shim/index.js\";\n\n// src/useEditorState.ts\nimport { deepEqual } from \"fast-equals\";\nimport { useDebugValue, useEffect, useLayoutEffect, useState } from \"react\";\nimport { useSyncExternalStoreWithSelector } from \"use-sync-external-store/shim/with-selector.js\";\nvar useIsomorphicLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\nvar EditorStateManager = class {\n constructor(initialEditor) {\n this.transactionNumber = 0;\n this.lastTransactionNumber = 0;\n this.subscribers = /* @__PURE__ */ new Set();\n this.editor = initialEditor;\n this.lastSnapshot = { editor: initialEditor, transactionNumber: 0 };\n this.getSnapshot = this.getSnapshot.bind(this);\n this.getServerSnapshot = this.getServerSnapshot.bind(this);\n this.watch = this.watch.bind(this);\n this.subscribe = this.subscribe.bind(this);\n }\n /**\n * Get the current editor instance.\n */\n getSnapshot() {\n if (this.transactionNumber === this.lastTransactionNumber) {\n return this.lastSnapshot;\n }\n this.lastTransactionNumber = this.transactionNumber;\n this.lastSnapshot = { editor: this.editor, transactionNumber: this.transactionNumber };\n return this.lastSnapshot;\n }\n /**\n * Always disable the editor on the server-side.\n */\n getServerSnapshot() {\n return { editor: null, transactionNumber: 0 };\n }\n /**\n * Subscribe to the editor instance's changes.\n */\n subscribe(callback) {\n this.subscribers.add(callback);\n return () => {\n this.subscribers.delete(callback);\n };\n }\n /**\n * Watch the editor instance for changes.\n */\n watch(nextEditor) {\n this.editor = nextEditor;\n if (this.editor) {\n let lastTransaction;\n const fn = (props) => {\n if ((props == null ? void 0 : props.transaction) !== void 0 && props.transaction === lastTransaction) {\n return;\n }\n lastTransaction = props == null ? void 0 : props.transaction;\n this.transactionNumber += 1;\n this.subscribers.forEach((callback) => callback());\n };\n const currentEditor = this.editor;\n currentEditor.on(\"transaction\", fn);\n currentEditor.on(\"update\", fn);\n return () => {\n currentEditor.off(\"transaction\", fn);\n currentEditor.off(\"update\", fn);\n };\n }\n return void 0;\n }\n};\nfunction useEditorState(options) {\n var _a;\n const [editorStateManager] = useState(() => new EditorStateManager(options.editor));\n const selectedState = useSyncExternalStoreWithSelector(\n editorStateManager.subscribe,\n editorStateManager.getSnapshot,\n editorStateManager.getServerSnapshot,\n options.selector,\n (_a = options.equalityFn) != null ? _a : deepEqual\n );\n useIsomorphicLayoutEffect(() => {\n return editorStateManager.watch(options.editor);\n }, [options.editor, editorStateManager]);\n useDebugValue(selectedState);\n return selectedState;\n}\n\n// src/useEditor.ts\nvar isDev = process.env.NODE_ENV !== \"production\";\nvar isSSR = typeof window === \"undefined\";\nvar isNext = isSSR || Boolean(typeof window !== \"undefined\" && window.next);\nvar EditorInstanceManager = class _EditorInstanceManager {\n constructor(options) {\n /**\n * The current editor instance.\n */\n this.editor = null;\n /**\n * The subscriptions to notify when the editor instance\n * has been created or destroyed.\n */\n this.subscriptions = /* @__PURE__ */ new Set();\n /**\n * Whether the editor has been mounted.\n */\n this.isComponentMounted = false;\n /**\n * The most recent dependencies array.\n */\n this.previousDeps = null;\n /**\n * The unique instance ID. This is used to identify the editor instance. And will be re-generated for each new instance.\n */\n this.instanceId = \"\";\n this.options = options;\n this.subscriptions = /* @__PURE__ */ new Set();\n this.setEditor(this.getInitialEditor());\n this.scheduleDestroy();\n this.getEditor = this.getEditor.bind(this);\n this.getServerSnapshot = this.getServerSnapshot.bind(this);\n this.subscribe = this.subscribe.bind(this);\n this.refreshEditorInstance = this.refreshEditorInstance.bind(this);\n this.scheduleDestroy = this.scheduleDestroy.bind(this);\n this.onRender = this.onRender.bind(this);\n this.createEditor = this.createEditor.bind(this);\n }\n setEditor(editor) {\n this.editor = editor;\n this.instanceId = Math.random().toString(36).slice(2, 9);\n this.subscriptions.forEach((cb) => cb());\n }\n getInitialEditor() {\n const explicit = this.options.current.immediatelyRender;\n let immediatelyRender = explicit != null ? explicit : true;\n if (isSSR) {\n if (immediatelyRender && isDev) {\n console.warn(\n \"SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches\"\n );\n }\n immediatelyRender = false;\n } else if (isNext && explicit === void 0) {\n immediatelyRender = false;\n if (isDev) {\n console.warn(\n \"Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.\"\n );\n }\n }\n return immediatelyRender ? this.createEditor() : null;\n }\n /**\n * Create a new editor instance. And attach event listeners.\n */\n createEditor() {\n const optionsToApply = {\n ...this.options.current,\n // Always call the most recent version of the callback function by default\n onBeforeCreate: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onBeforeCreate) == null ? void 0 : _b.call(_a, ...args);\n },\n onBlur: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onBlur) == null ? void 0 : _b.call(_a, ...args);\n },\n onCreate: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onCreate) == null ? void 0 : _b.call(_a, ...args);\n },\n onDestroy: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onDestroy) == null ? void 0 : _b.call(_a, ...args);\n },\n onFocus: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onFocus) == null ? void 0 : _b.call(_a, ...args);\n },\n onSelectionUpdate: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onSelectionUpdate) == null ? void 0 : _b.call(_a, ...args);\n },\n onTransaction: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onTransaction) == null ? void 0 : _b.call(_a, ...args);\n },\n onUpdate: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onUpdate) == null ? void 0 : _b.call(_a, ...args);\n },\n onContentError: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onContentError) == null ? void 0 : _b.call(_a, ...args);\n },\n onDrop: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onDrop) == null ? void 0 : _b.call(_a, ...args);\n },\n onPaste: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onPaste) == null ? void 0 : _b.call(_a, ...args);\n },\n onDelete: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onDelete) == null ? void 0 : _b.call(_a, ...args);\n },\n onMount: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onMount) == null ? void 0 : _b.call(_a, ...args);\n },\n onUnmount: (...args) => {\n var _a, _b;\n return (_b = (_a = this.options.current).onUnmount) == null ? void 0 : _b.call(_a, ...args);\n }\n };\n const editor = new Editor(optionsToApply);\n return editor;\n }\n /**\n * Get the current editor instance.\n */\n getEditor() {\n return this.editor;\n }\n /**\n * Always disable the editor on the server-side.\n */\n getServerSnapshot() {\n return null;\n }\n /**\n * Subscribe to the editor instance's changes.\n */\n subscribe(onStoreChange) {\n this.subscriptions.add(onStoreChange);\n return () => {\n this.subscriptions.delete(onStoreChange);\n };\n }\n static compareOptions(a, b) {\n return Object.keys(a).every((key) => {\n if ([\n \"onCreate\",\n \"onBeforeCreate\",\n \"onDestroy\",\n \"onUpdate\",\n \"onTransaction\",\n \"onFocus\",\n \"onBlur\",\n \"onSelectionUpdate\",\n \"onContentError\",\n \"onDrop\",\n \"onPaste\"\n ].includes(key)) {\n return true;\n }\n if (key === \"extensions\" && a.extensions && b.extensions) {\n if (a.extensions.length !== b.extensions.length) {\n return false;\n }\n return a.extensions.every((extension, index) => {\n var _a;\n if (extension !== ((_a = b.extensions) == null ? void 0 : _a[index])) {\n return false;\n }\n return true;\n });\n }\n if (a[key] !== b[key]) {\n return false;\n }\n return true;\n });\n }\n /**\n * On each render, we will create, update, or destroy the editor instance.\n * @param deps The dependencies to watch for changes\n * @returns A cleanup function\n */\n onRender(deps) {\n return () => {\n this.isComponentMounted = true;\n clearTimeout(this.scheduledDestructionTimeout);\n if (this.editor && !this.editor.isDestroyed && deps.length === 0) {\n if (!_EditorInstanceManager.compareOptions(this.options.current, this.editor.options)) {\n this.editor.setOptions({\n ...this.options.current,\n editable: this.editor.isEditable\n });\n }\n } else {\n this.refreshEditorInstance(deps);\n }\n return () => {\n this.isComponentMounted = false;\n this.scheduleDestroy();\n };\n };\n }\n /**\n * Recreate the editor instance if the dependencies have changed.\n */\n refreshEditorInstance(deps) {\n if (this.editor && !this.editor.isDestroyed) {\n if (this.previousDeps === null) {\n this.previousDeps = deps;\n return;\n }\n const depsAreEqual = this.previousDeps.length === deps.length && this.previousDeps.every((dep, index) => dep === deps[index]);\n if (depsAreEqual) {\n return;\n }\n }\n if (this.editor && !this.editor.isDestroyed) {\n this.editor.destroy();\n }\n this.setEditor(this.createEditor());\n this.previousDeps = deps;\n }\n /**\n * Schedule the destruction of the editor instance.\n * This will only destroy the editor if it was not mounted on the next tick.\n * This is to avoid destroying the editor instance when it's actually still mounted.\n */\n scheduleDestroy() {\n const currentInstanceId = this.instanceId;\n const currentEditor = this.editor;\n this.scheduledDestructionTimeout = setTimeout(() => {\n if (this.isComponentMounted && this.instanceId === currentInstanceId) {\n if (currentEditor) {\n currentEditor.setOptions(this.options.current);\n }\n return;\n }\n if (currentEditor && !currentEditor.isDestroyed) {\n currentEditor.destroy();\n if (this.instanceId === currentInstanceId) {\n this.setEditor(null);\n }\n }\n }, 1);\n }\n};\nfunction useEditor(options = {}, deps = []) {\n const mostRecentOptions = useRef(options);\n mostRecentOptions.current = options;\n const [instanceManager] = useState2(() => new EditorInstanceManager(mostRecentOptions));\n const editor = useSyncExternalStore2(\n instanceManager.subscribe,\n instanceManager.getEditor,\n instanceManager.getServerSnapshot\n );\n useDebugValue2(editor);\n useEffect2(instanceManager.onRender(deps));\n useEditorState({\n editor,\n selector: ({ transactionNumber }) => {\n if (options.shouldRerenderOnTransaction === false || options.shouldRerenderOnTransaction === void 0) {\n return null;\n }\n if (options.immediatelyRender && transactionNumber === 0) {\n return 0;\n }\n return transactionNumber + 1;\n }\n });\n return editor;\n}\n\n// src/Context.tsx\nimport { jsx as jsx2, jsxs as jsxs2 } from \"react/jsx-runtime\";\nvar EditorContext = createContext({\n editor: null\n});\nvar EditorConsumer = EditorContext.Consumer;\nvar useCurrentEditor = () => useContext(EditorContext);\nfunction EditorProvider({\n children,\n slotAfter,\n slotBefore,\n editorContainerProps = {},\n ...editorOptions\n}) {\n const editor = useEditor(editorOptions);\n const contextValue = useMemo(() => ({ editor }), [editor]);\n if (!editor) {\n return null;\n }\n return /* @__PURE__ */ jsxs2(EditorContext.Provider, { value: contextValue, children: [\n slotBefore,\n /* @__PURE__ */ jsx2(EditorConsumer, { children: ({ editor: currentEditor }) => /* @__PURE__ */ jsx2(EditorContent, { editor: currentEditor, ...editorContainerProps }) }),\n children,\n slotAfter\n ] });\n}\n\n// src/useReactNodeView.ts\nimport { createContext as createContext2, createElement, useContext as useContext2 } from \"react\";\nvar ReactNodeViewContext = createContext2({\n onDragStart: () => {\n },\n nodeViewContentChildren: void 0,\n nodeViewContentRef: () => {\n }\n});\nvar ReactNodeViewContentProvider = ({\n children,\n content\n}) => {\n return createElement(\n ReactNodeViewContext.Provider,\n { value: { nodeViewContentChildren: content } },\n children\n );\n};\nvar useReactNodeView = () => useContext2(ReactNodeViewContext);\n\n// src/NodeViewContent.tsx\nimport { jsx as jsx3 } from \"react/jsx-runtime\";\nfunction NodeViewContent({\n as: Tag = \"div\",\n ...props\n}) {\n const { nodeViewContentRef, nodeViewContentChildren } = useReactNodeView();\n return (\n // @ts-ignore\n /* @__PURE__ */ jsx3(\n Tag,\n {\n ...props,\n ref: nodeViewContentRef,\n \"data-node-view-content\": \"\",\n style: {\n whiteSpace: \"pre-wrap\",\n ...props.style\n },\n children: nodeViewContentChildren\n }\n )\n );\n}\n\n// src/NodeViewWrapper.tsx\nimport React3 from \"react\";\nimport { jsx as jsx4 } from \"react/jsx-runtime\";\nvar NodeViewWrapper = React3.forwardRef((props, ref) => {\n const { onDragStart } = useReactNodeView();\n const Tag = props.as || \"div\";\n return (\n // @ts-ignore\n /* @__PURE__ */ jsx4(\n Tag,\n {\n ...props,\n ref,\n \"data-node-view-wrapper\": \"\",\n onDragStart,\n style: {\n whiteSpace: \"normal\",\n ...props.style\n }\n }\n )\n );\n});\n\n// src/ReactMarkViewRenderer.tsx\nimport { MarkView } from \"@tiptap/core\";\nimport React4 from \"react\";\n\n// src/ReactRenderer.tsx\nimport { version as reactVersion } from \"react\";\nimport { flushSync } from \"react-dom\";\nimport { jsx as jsx5 } from \"react/jsx-runtime\";\nfunction isClassComponent(Component) {\n return !!(typeof Component === \"function\" && Component.prototype && Component.prototype.isReactComponent);\n}\nfunction isForwardRefComponent(Component) {\n return !!(typeof Component === \"object\" && Component.$$typeof && (Component.$$typeof.toString() === \"Symbol(react.forward_ref)\" || Component.$$typeof.description === \"react.forward_ref\"));\n}\nfunction isMemoComponent(Component) {\n return !!(typeof Component === \"object\" && Component.$$typeof && (Component.$$typeof.toString() === \"Symbol(react.memo)\" || Component.$$typeof.description === \"react.memo\"));\n}\nfunction canReceiveRef(Component) {\n if (isClassComponent(Component)) {\n return true;\n }\n if (isForwardRefComponent(Component)) {\n return true;\n }\n if (isMemoComponent(Component)) {\n const wrappedComponent = Component.type;\n if (wrappedComponent) {\n return isClassComponent(wrappedComponent) || isForwardRefComponent(wrappedComponent);\n }\n }\n return false;\n}\nfunction isReact19Plus() {\n try {\n if (reactVersion) {\n const majorVersion = parseInt(reactVersion.split(\".\")[0], 10);\n return majorVersion >= 19;\n }\n } catch {\n }\n return false;\n}\nvar ReactRenderer = class {\n /**\n * Immediately creates element and renders the provided React component.\n */\n constructor(component, { editor, props = {}, as = \"div\", className = \"\" }) {\n this.ref = null;\n /**\n * Flag to track if the renderer has been destroyed, preventing queued or asynchronous renders from executing after teardown.\n */\n this.destroyed = false;\n this.id = Math.floor(Math.random() * 4294967295).toString();\n this.component = component;\n this.editor = editor;\n this.props = props;\n this.element = document.createElement(as);\n this.element.classList.add(\"react-renderer\");\n if (className) {\n this.element.classList.add(...className.split(\" \"));\n }\n if (this.editor.isEditorContentInitialized) {\n flushSync(() => {\n this.render();\n });\n } else {\n queueMicrotask(() => {\n if (this.destroyed) {\n return;\n }\n this.render();\n });\n }\n }\n /**\n * Render the React component.\n */\n render() {\n var _a;\n if (this.destroyed) {\n return;\n }\n const Component = this.component;\n const props = this.props;\n const editor = this.editor;\n const isReact19 = isReact19Plus();\n const componentCanReceiveRef = canReceiveRef(Component);\n const elementProps = { ...props };\n if (elementProps.ref && !(isReact19 || componentCanReceiveRef)) {\n delete elementProps.ref;\n }\n if (!elementProps.ref && (isReact19 || componentCanReceiveRef)) {\n elementProps.ref = (ref) => {\n this.ref = ref;\n };\n }\n this.reactElement = /* @__PURE__ */ jsx5(Component, { ...elementProps });\n (_a = editor == null ? void 0 : editor.contentComponent) == null ? void 0 : _a.setRenderer(this.id, this);\n }\n /**\n * Re-renders the React component with new props.\n * Skips the render if none of the supplied props actually changed,\n * to avoid unnecessary portal re-creation.\n */\n updateProps(props = {}) {\n if (this.destroyed) {\n return;\n }\n let changed = false;\n const keys = Object.keys(props);\n for (let i = 0; i < keys.length; i += 1) {\n const key = keys[i];\n if (props[key] !== this.props[key]) {\n changed = true;\n break;\n }\n }\n if (!changed) {\n return;\n }\n this.props = {\n ...this.props,\n ...props\n };\n this.render();\n }\n /**\n * Destroy the React component.\n */\n destroy() {\n var _a;\n this.destroyed = true;\n const editor = this.editor;\n (_a = editor == null ? void 0 : editor.contentComponent) == null ? void 0 : _a.removeRenderer(this.id);\n try {\n if (this.element && this.element.parentNode) {\n this.element.parentNode.removeChild(this.element);\n }\n } catch {\n }\n }\n /**\n * Update the attributes of the element that holds the React component.\n */\n updateAttributes(attributes) {\n Object.keys(attributes).forEach((key) => {\n this.element.setAttribute(key, attributes[key]);\n });\n }\n};\n\n// src/ReactMarkViewRenderer.tsx\nimport { jsx as jsx6 } from \"react/jsx-runtime\";\nvar ReactMarkViewContext = React4.createContext({\n markViewContentRef: () => {\n }\n});\nvar MarkViewContent = (props) => {\n const { as: Tag = \"span\", ...rest } = props;\n const { markViewContentRef } = React4.useContext(ReactMarkViewContext);\n return (\n // @ts-ignore\n /* @__PURE__ */ jsx6(Tag, { ...rest, ref: markViewContentRef, \"data-mark-view-content\": \"\" })\n );\n};\nvar ReactMarkView = class extends MarkView {\n constructor(component, props, options) {\n super(component, props, options);\n const { as = \"span\", attrs, className = \"\" } = options || {};\n const componentProps = {\n ...props,\n updateAttributes: this.updateAttributes.bind(this)\n };\n this.contentDOMElement = document.createElement(\"span\");\n const markViewContentRef = (el) => {\n if (el && !el.contains(this.contentDOMElement)) {\n el.appendChild(this.contentDOMElement);\n }\n };\n const context = {\n markViewContentRef\n };\n const ReactMarkViewProvider = React4.memo(\n (componentProps2) => {\n return /* @__PURE__ */ jsx6(ReactMarkViewContext.Provider, { value: context, children: React4.createElement(component, componentProps2) });\n }\n );\n ReactMarkViewProvider.displayName = \"ReactMarkView\";\n this.renderer = new ReactRenderer(ReactMarkViewProvider, {\n editor: props.editor,\n props: componentProps,\n as,\n className: `mark-${props.mark.type.name} ${className}`.trim()\n });\n if (attrs) {\n this.renderer.updateAttributes(attrs);\n }\n }\n get dom() {\n return this.renderer.element;\n }\n get contentDOM() {\n return this.contentDOMElement;\n }\n};\nfunction ReactMarkViewRenderer(component, options = {}) {\n return (props) => new ReactMarkView(component, props, options);\n}\n\n// src/ReactNodeViewRenderer.tsx\nimport { getRenderedAttributes, isNodeViewSelected, NodeView } from \"@tiptap/core\";\nimport { createElement as createElement2, createRef, memo } from \"react\";\n\n// src/captureDOMSelection.ts\nfunction captureDOMSelection(element) {\n var _a, _b;\n const root = element.getRootNode();\n const selection = typeof root.getSelection === \"function\" ? root.getSelection() : (_b = (_a = element.ownerDocument) == null ? void 0 : _a.defaultView) == null ? void 0 : _b.getSelection();\n if (!selection || selection.rangeCount === 0) {\n return null;\n }\n const { anchorNode, anchorOffset, focusNode, focusOffset } = selection;\n if (!anchorNode || !focusNode) {\n return null;\n }\n if (!element.contains(anchorNode) || !element.contains(focusNode)) {\n return null;\n }\n return () => {\n try {\n selection.setBaseAndExtent(anchorNode, anchorOffset, focusNode, focusOffset);\n } catch {\n }\n };\n}\n\n// src/ReactNodeViewRenderer.tsx\nimport { jsx as jsx7 } from \"react/jsx-runtime\";\nvar ReactNodeView = class extends NodeView {\n constructor(component, props, options) {\n super(component, props, options);\n /**\n * The requestAnimationFrame ID used for selection updates.\n */\n this.selectionRafId = null;\n /**\n * Fires on editor updates when trackNodeViewPosition is enabled.\n * Detects position shifts where update() is NOT called (e.g. typing above).\n */\n this.handlePositionUpdate = () => {\n const newPos = this.getPos();\n if (typeof newPos !== \"number\" || newPos === this.currentPos) {\n return;\n }\n this.currentPos = newPos;\n this.renderer.updateProps({ getPos: () => this.getPos() });\n if (typeof this.options.attrs === \"function\") {\n this.updateElementAttributes();\n }\n };\n this.cachedExtensionWithSyncedStorage = null;\n if (!this.node.isLeaf) {\n if (this.options.contentDOMElementTag) {\n this.contentDOMElement = document.createElement(this.options.contentDOMElementTag);\n } else {\n this.contentDOMElement = document.createElement(this.node.isInline ? \"span\" : \"div\");\n }\n this.contentDOMElement.dataset.nodeViewContentReact = \"\";\n this.contentDOMElement.dataset.nodeViewWrapper = \"\";\n this.contentDOMElement.style.whiteSpace = \"inherit\";\n const contentTarget = this.dom.querySelector(\"[data-node-view-content]\");\n if (contentTarget) {\n contentTarget.appendChild(this.contentDOMElement);\n } else {\n this.dom.appendChild(this.contentDOMElement);\n }\n }\n if (this.options.trackNodeViewPosition) {\n this.editor.on(\"update\", this.handlePositionUpdate);\n }\n }\n /**\n * Returns a proxy of the extension that redirects storage access to the editor's mutable storage.\n * This preserves the original prototype chain (instanceof checks, methods like configure/extend work).\n * Cached to avoid proxy creation on every update.\n */\n get extensionWithSyncedStorage() {\n if (!this.cachedExtensionWithSyncedStorage) {\n const editor = this.editor;\n const extension = this.extension;\n this.cachedExtensionWithSyncedStorage = new Proxy(extension, {\n get(target, prop, receiver) {\n var _a;\n if (prop === \"storage\") {\n return (_a = editor.storage[extension.name]) != null ? _a : {};\n }\n return Reflect.get(target, prop, receiver);\n }\n });\n }\n return this.cachedExtensionWithSyncedStorage;\n }\n /**\n * Setup the React component.\n * Called on initialization.\n */\n mount() {\n const props = {\n editor: this.editor,\n node: this.node,\n decorations: this.decorations,\n innerDecorations: this.innerDecorations,\n view: this.view,\n selected: false,\n extension: this.extensionWithSyncedStorage,\n HTMLAttributes: this.HTMLAttributes,\n getPos: () => this.getPos(),\n updateAttributes: (attributes = {}) => this.updateAttributes(attributes),\n deleteNode: () => this.deleteNode(),\n ref: createRef()\n };\n const mountProps = props;\n if (!this.component.displayName) {\n const capitalizeFirstChar = (string) => {\n return string.charAt(0).toUpperCase() + string.substring(1);\n };\n this.component.displayName = capitalizeFirstChar(this.extension.name);\n }\n const onDragStart = this.onDragStart.bind(this);\n const nodeViewContentRef = (element) => {\n if (element && this.contentDOMElement && element.firstChild !== this.contentDOMElement) {\n if (element.hasAttribute(\"data-node-view-wrapper\")) {\n element.removeAttribute(\"data-node-view-wrapper\");\n }\n const restoreSelection = captureDOMSelection(this.contentDOMElement);\n element.appendChild(this.contentDOMElement);\n restoreSelection == null ? void 0 : restoreSelection();\n }\n };\n const context = { onDragStart, nodeViewContentRef };\n const Component = this.component;\n const ReactNodeViewProvider = memo(\n (componentProps) => {\n return /* @__PURE__ */ jsx7(ReactNodeViewContext.Provider, { value: context, children: createElement2(Component, componentProps) });\n }\n );\n ReactNodeViewProvider.displayName = \"ReactNodeView\";\n let as = this.node.isInline ? \"span\" : \"div\";\n if (this.options.as) {\n as = this.options.as;\n }\n const { className = \"\" } = this.options;\n this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this);\n this.renderer = new ReactRenderer(ReactNodeViewProvider, {\n editor: this.editor,\n props: mountProps,\n as,\n className: `node-${this.node.type.name} ${className}`.trim()\n });\n this.editor.on(\"selectionUpdate\", this.handleSelectionUpdate);\n this.updateElementAttributes();\n this.currentPos = this.getPos();\n }\n /**\n * Return the DOM element.\n * This is the element that will be used to display the node view.\n */\n get dom() {\n var _a;\n if (this.renderer.element.firstElementChild && !((_a = this.renderer.element.firstElementChild) == null ? void 0 : _a.hasAttribute(\"data-node-view-wrapper\"))) {\n throw Error(\"Please use the NodeViewWrapper component for your node view.\");\n }\n return this.renderer.element;\n }\n /**\n * Return the content DOM element.\n * This is the element that will be used to display the rich-text content of the node.\n */\n get contentDOM() {\n if (this.node.isLeaf) {\n return null;\n }\n return this.contentDOMElement;\n }\n /**\n * On editor selection update, check if the node is selected.\n * If it is, call `selectNode`, otherwise call `deselectNode`.\n */\n handleSelectionUpdate() {\n if (this.selectionRafId) {\n cancelAnimationFrame(this.selectionRafId);\n this.selectionRafId = null;\n }\n this.selectionRafId = requestAnimationFrame(() => {\n var _a;\n this.selectionRafId = null;\n const pos = (_a = this.getPos()) != null ? _a : this.currentPos;\n if (typeof pos !== \"number\") {\n return;\n }\n const isSelected = isNodeViewSelected({\n selection: this.editor.state.selection,\n pos,\n nodeSize: this.node.nodeSize,\n selectedOnTextSelection: this.options.selectedOnTextSelection\n });\n if (isSelected) {\n if (this.renderer.props.selected) {\n return;\n }\n this.selectNode();\n } else {\n if (!this.renderer.props.selected) {\n return;\n }\n this.deselectNode();\n }\n });\n }\n /**\n * On update, update the React component.\n * To prevent unnecessary updates, the `update` option can be used.\n */\n update(node, decorations, innerDecorations) {\n const rerenderComponent = (props) => {\n this.renderer.updateProps(props);\n if (typeof this.options.attrs === \"function\") {\n this.updateElementAttributes();\n }\n };\n if (node.type !== this.node.type) {\n return false;\n }\n if (typeof this.options.update === \"function\") {\n const oldNode = this.node;\n const oldDecorations = this.decorations;\n const oldInnerDecorations = this.innerDecorations;\n this.node = node;\n this.decorations = decorations;\n this.innerDecorations = innerDecorations;\n this.currentPos = this.getPos();\n return this.options.update({\n oldNode,\n oldDecorations,\n newNode: node,\n newDecorations: decorations,\n oldInnerDecorations,\n innerDecorations,\n updateProps: () => rerenderComponent({\n node,\n decorations,\n innerDecorations,\n extension: this.extensionWithSyncedStorage\n })\n });\n }\n const nodeChanged = node !== this.node;\n if (!nodeChanged) {\n this.node = node;\n this.decorations = decorations;\n this.innerDecorations = innerDecorations;\n return true;\n }\n const newPos = this.getPos();\n this.node = node;\n this.decorations = decorations;\n this.innerDecorations = innerDecorations;\n this.currentPos = newPos;\n const extraProps = {\n node,\n decorations,\n innerDecorations,\n extension: this.extensionWithSyncedStorage\n };\n if (this.options.trackNodeViewPosition) {\n extraProps.getPos = () => this.getPos();\n }\n rerenderComponent(extraProps);\n return true;\n }\n /**\n * Select the node.\n * Add the `selected` prop and the `ProseMirror-selectednode` class.\n */\n selectNode() {\n this.renderer.updateProps({\n selected: true\n });\n this.renderer.element.classList.add(\"ProseMirror-selectednode\");\n }\n /**\n * Deselect the node.\n * Remove the `selected` prop and the `ProseMirror-selectednode` class.\n */\n deselectNode() {\n this.renderer.updateProps({\n selected: false\n });\n this.renderer.element.classList.remove(\"ProseMirror-selectednode\");\n }\n /**\n * Destroy the React component instance.\n */\n destroy() {\n this.renderer.destroy();\n this.editor.off(\"selectionUpdate\", this.handleSelectionUpdate);\n if (this.options.trackNodeViewPosition) {\n this.editor.off(\"update\", this.handlePositionUpdate);\n }\n this.contentDOMElement = null;\n if (this.selectionRafId) {\n cancelAnimationFrame(this.selectionRafId);\n this.selectionRafId = null;\n }\n }\n /**\n * Update the attributes of the top-level element that holds the React component.\n * Applying the attributes defined in the `attrs` option.\n */\n updateElementAttributes() {\n if (this.options.attrs) {\n let attrsObj = {};\n if (typeof this.options.attrs === \"function\") {\n const extensionAttributes = this.editor.extensionManager.attributes;\n const HTMLAttributes = getRenderedAttributes(this.node, extensionAttributes);\n attrsObj = this.options.attrs({ node: this.node, HTMLAttributes });\n } else {\n attrsObj = this.options.attrs;\n }\n this.renderer.updateAttributes(attrsObj);\n }\n }\n};\nfunction ReactNodeViewRenderer(component, options) {\n return (props) => {\n if (!props.editor.contentComponent) {\n return {};\n }\n return new ReactNodeView(component, props, options);\n };\n}\n\n// src/ReactWidgetRenderer.tsx\nimport { createWidgetDecoration } from \"@tiptap/core\";\nvar WIDGET_CACHE = /* @__PURE__ */ Symbol(\"tiptapReactWidgetCache\");\nfunction ReactWidgetRenderer(component, options) {\n const { editor, props = {}, as = \"span\", className } = options;\n return createWidgetDecoration({\n // Forwards editor, pos, key and the ProseMirror widget options unchanged.\n ...options,\n props,\n cacheKey: WIDGET_CACHE,\n context: (getPos) => ({ editor, getPos }),\n create: (renderProps) => new ReactRenderer(component, {\n editor,\n as,\n className,\n props: renderProps\n }),\n materialize: (renderer) => {\n renderer.render();\n return renderer.element;\n }\n });\n}\n\n// src/Tiptap.tsx\nimport { createContext as createContext3, useContext as useContext3, useMemo as useMemo2 } from \"react\";\nimport { jsx as jsx8 } from \"react/jsx-runtime\";\nvar TiptapContext = createContext3({\n get editor() {\n throw new Error(\"useTiptap must be used within a <Tiptap> provider\");\n }\n});\nTiptapContext.displayName = \"TiptapContext\";\nvar useTiptap = () => useContext3(TiptapContext);\nfunction useTiptapState(selector, equalityFn) {\n const { editor } = useTiptap();\n return useEditorState({\n editor,\n selector,\n equalityFn\n });\n}\nfunction TiptapWrapper({ children, ...props }) {\n const resolvedEditor = \"editor\" in props ? props.editor : props.instance;\n if (!resolvedEditor) {\n throw new Error(\"Tiptap: An editor instance is required. Pass a non-null `editor` prop.\");\n }\n const tiptapContextValue = useMemo2(\n () => ({ editor: resolvedEditor }),\n [resolvedEditor]\n );\n const legacyContextValue = useMemo2(() => ({ editor: resolvedEditor }), [resolvedEditor]);\n return /* @__PURE__ */ jsx8(EditorContext.Provider, { value: legacyContextValue, children: /* @__PURE__ */ jsx8(TiptapContext.Provider, { value: tiptapContextValue, children }) });\n}\nTiptapWrapper.displayName = \"Tiptap\";\nfunction TiptapContent({ ...rest }) {\n const { editor } = useTiptap();\n return /* @__PURE__ */ jsx8(EditorContent, { editor, ...rest });\n}\nTiptapContent.displayName = \"Tiptap.Content\";\nvar Tiptap = Object.assign(TiptapWrapper, {\n /**\n * The Tiptap Content component that renders the EditorContent with the editor instance from the context.\n * @see TiptapContent\n */\n Content: TiptapContent\n});\n\n// src/index.ts\nexport * from \"@tiptap/core\";\nexport {\n EditorConsumer,\n EditorContent,\n EditorContext,\n EditorProvider,\n MarkViewContent,\n NodeViewContent,\n NodeViewWrapper,\n PureEditorContent,\n ReactMarkView,\n ReactMarkViewContext,\n ReactMarkViewRenderer,\n ReactNodeView,\n ReactNodeViewContentProvider,\n ReactNodeViewContext,\n ReactNodeViewRenderer,\n ReactRenderer,\n ReactWidgetRenderer,\n Tiptap,\n TiptapContent,\n TiptapContext,\n TiptapWrapper,\n createContentComponent,\n useCurrentEditor,\n useEditor,\n useEditorState,\n useReactNodeView,\n useTiptap,\n useTiptapState\n};\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;;;;;;;;AAUA,IAAIY,MAAa,GAAGC,OACV,MAAS;CACf,EAAK,SAAS,MAAQ;EACpB,AAAI,OAAOC,KAAQ,aACjBA,EAAIC,CAAI,IACCD,MAET,EAAI,UAAUC;CAElB,CAAC;AACH,GAEEC,MAAW,EAAE,0BAAuB;CACtC,IAAMC,IAAYC,EAChBC,EAAiB,WACjBA,EAAiB,aACjBA,EAAiB,iBACnB;CACA,OAAuB,kBAAIC,GAAU,EAAE,UAAU,OAAO,OAAOH,CAAS,EAAE,CAAC;AAC7E;AACA,SAASI,IAAyB;CAChC,IAAMC,oBAA8B,IAAI,IAAI,GACxCL,IAAY,CAAC,GACbM,IAAuB,IACrBC,UAA0B;EAC9B,AAAI,MAAyBF,EAAY,SAGzC,IAAuB,IACvB,qBAAqB;GAEnB,AADA,IAAuB,IACvBA,EAAY,SAAS,MAAeG,EAAW,CAAC;EAClD,CAAC;CACH;CACA,OAAO;EAIL,UAAU,GAAU;GAElB,OADA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AWGoF,UAAyBnF,EAAYkF,CAAoB;AA8BvCjF,EAAO,YAAY,GAAO,MAAQ;CACtD,IAAM,EAAE,mBAAgBkF,EAAiB,GACnCE,IAAMzD,EAAM,MAAM;CACxB,OAEkB,kBACdyD,GACA;EACE,GAAGzD;EACH;EACA,0BAA0B;EAC1B;EACA,OAAO;GACL,YAAY;GACZ,GAAGA,EAAM;EACX;CACF,CACF;AAEJ,CAAC,GA2J0B1B,EAAO,cAAc,EAC9C,0BAA0B,CAC1B,EACF,CAAC;AA6ZD,IAAIoF,IAAgBnF,EAAe,EACjC,IAAI,SAAS;CACX,MAAU,MAAM,mDAAmD;AACrE,EACF,CAAC;AACD,EAAc,cAAc;AAC5B,IAAIoF,UAAkBnF,EAAYkF,CAAa;AAS/C,SAASE,EAAc,EAAE,aAAU,GAAG5D,KAAS;CAC7C,IAAM6D,IAAiB,YAAY7D,IAAQA,EAAM,SAASA,EAAM;CAChE,IAAI,CAAC6D,GACH,MAAU,MAAM,wEAAwE;CAE1F,IAAMC,IAAqBrF,SAClB,EAAE,QAAQoF,EAAe,IAChC,CAACA,CAAc,CACjB,GACMG,IAAqBvF,SAAgB,EAAE,QAAQoF,EAAe,IAAI,CAACA,CAAc,CAAC;CACxF,OAAuB,kBAAKT,EAAc,UAAU;EAAE,OAAOY;EAAoB,UAA0B,kBAAKN,EAAc,UAAU;GAAE,OAAOI;GAAoB;EAAS,CAAC;CAAE,CAAC;AACpL;AACA,EAAc,cAAc;AAC5B,SAASG,EAAc,EAAE,GAAG7D,KAAQ;CAClC,IAAM,EAAE,cAAWuD,EAAU;CAC7B,OAAuB,kBAAKlD,GAAe;EAAE;EAAQ,GAAGL;CAAK,CAAC;AAChE;AACA,EAAc,cAAc,kBACf,OAAO,OAAOwD,GAAe,EAKxC,SAASK,EACX,CAAC"}
1
+ {"version":3,"file":"index.js","names":["useSyncExternalStore","useSyncExternalStoreWithSelector","commands_exports","React","ReactDOM","import_shim","require_shim","import_with_selector","require_with_selector","handleMobileEnter","editor","event","isiOS","isAndroid","view","root","anchor","contentDOM","lastKeyCode","keyEvent","handleKeyDown","mobileEnterPluginKey","PluginKey","mergeRefs","refs","ref","node","Portals","renderers","contentComponent","Fragment","createContentComponent","subscribers","isNotificationQueued","notifySubscribers","subscriber","callback","id","renderer","nextRenderers","PureEditorContent","props","element","Plugin","newElement","rest","innerRef","EditorContentWithKey","forwardRef","key","EditorContent","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","EditorStateManager","initialEditor","nextEditor","lastTransaction","fn","currentEditor","useEditorState","editorStateManager","useState","options","selectedState","circularDeepEqual","useDebugValue","isDev","isSSR","isNext","EditorInstanceManager","cb","explicit","immediatelyRender","optionsToApply","args","_this$options$current2","_this$options$current4","_this$options$current6","_this$options$current8","_this$options$current10","_this$options$current12","_this$options$current14","_this$options$current16","_this$options$current18","_this$options$current20","_this$options$current22","_this$options$current24","_this$options$current26","_this$options$current28","Editor","onStoreChange","a","b","extension","index","deps","dep","currentInstanceId","useEditor","mostRecentOptions","useRef","instanceManager","transactionNumber","EditorContext","createContext","ReactNodeViewContext","useReactNodeView","useContext","Tag","TiptapContext","useTiptap","TiptapWrapper","resolvedEditor","tiptapContextValue","useMemo","legacyContextValue","TiptapContent","CommandManager","DECORATION_MANAGER_PLUGIN_KEY","DecorationManager","Extendable","Extension","InputRule","MappablePosition","Mark","Node","NodePos","PasteRule","callOrReturn","canInsertNode","combineTransactionSteps","createChainableState","createDocument","createMappablePosition","createNodeFromContent","createStyleTag","defaultBlockAt","deleteProps","elementFromString","findChildrenInRange","findDuplicates","findParentNode","findParentNodeClosestToPos","flattenExtensions","fromString","getAttributes","getAttributesFromExtensions","getChangedRanges","getExtensionField","getHTMLFromFragment","getMarkAttributes","getMarkRange","getMarkType","getMarksBetween","getNodeAtPosition","getNodeAttributes","getNodeType","getPreviousBlockSibling","getRenderedAttributes","getSchemaByResolvedExtensions","getSchemaTypeByName","getSchemaTypeNameByName","getSplittedAttributes","getText","getTextBetween","getTextContentFromNodes","getTextSerializersFromSchema","getUpdatedPosition","injectExtensionAttributesToParseRule","inputRulesPlugin","isActive","isAtEndOfNode","isAtStartOfNode","isEmptyObject","isExtensionRulesEnabled","isFunction","isList","isMacOS","isMarkActive","isNodeActive","isNodeEmpty","isNodeSelection","isNumber","isPlainObject","isProseMirrorReplaceStep","isProseMirrorStep","isRegExp","isSafari","isTextSelection","markInputRule","markPasteRule","mergeAttributes","mergeDeep","minMax","nodeInputRule","objectIncludes","parseIndentedBlocks","pasteRulesPlugin","removeDuplicates","renderNestedMarkdownContent","resolveExtensions","resolveFocusPosition","selectionToInsertionEnd","sortExtensions","splitExtensions","textblockTypeInputRule","updateMarkViewAttributes","wrappingInputRule"],"sources":["../../../../../node_modules/@tiptap/react/dist/index.js"],"sourcesContent":["\"use client\";\nimport React, { createContext, createElement, createRef, forwardRef, memo, useContext, useDebugValue, useEffect, useLayoutEffect, useMemo, useRef, useState, version } from \"react\";\nimport { Plugin, PluginKey } from \"@tiptap/pm/state\";\nimport ReactDOM from \"react-dom\";\nimport { useSyncExternalStore } from \"use-sync-external-store/shim/index.js\";\nimport { Editor, MarkView, NodeView, createWidgetDecoration, getRenderedAttributes, isAndroid, isTextSelection, isiOS } from \"@tiptap/core\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport { circularDeepEqual } from \"fast-equals\";\nimport { useSyncExternalStoreWithSelector } from \"use-sync-external-store/shim/with-selector.js\";\nexport * from \"@tiptap/core\";\n//#region src/handleMobileEnter.ts\nfunction handleMobileEnter(editor, event) {\n\tvar _root$getSelection, _root$getSelection2;\n\tif (editor.isDestroyed || event.defaultPrevented || !event.cancelable || !editor.isEditable || event.inputType !== \"insertParagraph\" && event.inputType !== \"insertLineBreak\" || !isiOS() && !isAndroid()) return;\n\tconst view = editor.view;\n\tconst root = view.root;\n\tconst selection = (_root$getSelection = (_root$getSelection2 = root.getSelection) === null || _root$getSelection2 === void 0 ? void 0 : _root$getSelection2.call(root)) !== null && _root$getSelection !== void 0 ? _root$getSelection : view.dom.ownerDocument.getSelection();\n\tconst anchor = selection === null || selection === void 0 ? void 0 : selection.anchorNode;\n\tconst element = (anchor === null || anchor === void 0 ? void 0 : anchor.nodeType) === 1 ? anchor : anchor === null || anchor === void 0 ? void 0 : anchor.parentElement;\n\tconst contentDOM = element === null || element === void 0 ? void 0 : element.closest(\"[data-node-view-content-react]\");\n\tif (!contentDOM || !view.dom.contains(contentDOM)) return;\n\tconst lastKeyCode = view.input.lastKeyCode;\n\tif (lastKeyCode === 13) view.input.lastKeyCode = null;\n\tview.domObserver.forceFlush();\n\tview.domObserver.flush();\n\tconst keyEvent = new KeyboardEvent(\"keydown\", {\n\t\tkey: \"Enter\",\n\t\tcode: \"Enter\",\n\t\tkeyCode: 13,\n\t\tshiftKey: event.inputType === \"insertLineBreak\",\n\t\tbubbles: true,\n\t\tcancelable: true\n\t});\n\tif (view.someProp(\"handleKeyDown\", (handleKeyDown) => handleKeyDown(view, keyEvent))) {\n\t\tevent.preventDefault();\n\t\tview.input.lastIOSEnter = 0;\n\t\tclearTimeout(view.input.lastIOSEnterFallbackTimeout);\n\t} else if (lastKeyCode === 13) view.input.lastKeyCode = lastKeyCode;\n}\n//#endregion\n//#region src/EditorContent.tsx\nconst mobileEnterPluginKey = new PluginKey(\"reactMobileEnter\");\nconst mergeRefs = (...refs) => {\n\treturn (node) => {\n\t\trefs.forEach((ref) => {\n\t\t\tif (typeof ref === \"function\") ref(node);\n\t\t\telse if (ref) ref.current = node;\n\t\t});\n\t};\n};\n/**\n* This component renders all of the editor's node views.\n*/\nconst Portals = ({ contentComponent }) => {\n\tconst renderers = useSyncExternalStore(contentComponent.subscribe, contentComponent.getSnapshot, contentComponent.getServerSnapshot);\n\treturn /* @__PURE__ */ jsx(Fragment, { children: Object.values(renderers) });\n};\nfunction createContentComponent() {\n\tconst subscribers = /* @__PURE__ */ new Set();\n\tlet renderers = {};\n\tlet isNotificationQueued = false;\n\tconst notifySubscribers = () => {\n\t\tif (isNotificationQueued || !subscribers.size) return;\n\t\tisNotificationQueued = true;\n\t\tqueueMicrotask(() => {\n\t\t\tisNotificationQueued = false;\n\t\t\tsubscribers.forEach((subscriber) => subscriber());\n\t\t});\n\t};\n\treturn {\n\t\t/**\n\t\t* Subscribe to the editor instance's changes.\n\t\t*/\n\t\tsubscribe(callback) {\n\t\t\tsubscribers.add(callback);\n\t\t\treturn () => {\n\t\t\t\tsubscribers.delete(callback);\n\t\t\t};\n\t\t},\n\t\tgetSnapshot() {\n\t\t\treturn renderers;\n\t\t},\n\t\tgetServerSnapshot() {\n\t\t\treturn renderers;\n\t\t},\n\t\t/**\n\t\t* Adds a new NodeView Renderer to the editor.\n\t\t*/\n\t\tsetRenderer(id, renderer) {\n\t\t\trenderers = {\n\t\t\t\t...renderers,\n\t\t\t\t[id]: ReactDOM.createPortal(renderer.reactElement, renderer.element, id)\n\t\t\t};\n\t\t\tnotifySubscribers();\n\t\t},\n\t\t/**\n\t\t* Removes a NodeView Renderer from the editor.\n\t\t*/\n\t\tremoveRenderer(id) {\n\t\t\tconst nextRenderers = { ...renderers };\n\t\t\tdelete nextRenderers[id];\n\t\t\trenderers = nextRenderers;\n\t\t\tnotifySubscribers();\n\t\t}\n\t};\n}\nvar PureEditorContent = class extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.editorContentRef = React.createRef();\n\t}\n\tcomponentDidMount() {\n\t\tthis.init();\n\t}\n\tcomponentDidUpdate() {\n\t\tthis.init();\n\t}\n\tinit() {\n\t\tvar _editor$view$dom;\n\t\tconst editor = this.props.editor;\n\t\tif (editor && !editor.isDestroyed && ((_editor$view$dom = editor.view.dom) === null || _editor$view$dom === void 0 ? void 0 : _editor$view$dom.parentNode)) {\n\t\t\tif (editor.contentComponent) return;\n\t\t\tconst element = this.editorContentRef.current;\n\t\t\telement.append(...editor.view.dom.parentNode.childNodes);\n\t\t\teditor.view.updateRoot();\n\t\t\teditor.setOptions({ element });\n\t\t\teditor.contentComponent = createContentComponent();\n\t\t\teditor.createNodeViews();\n\t\t\teditor.registerPlugin(new Plugin({\n\t\t\t\tkey: mobileEnterPluginKey,\n\t\t\t\tprops: { handleDOMEvents: { beforeinput: (_view, event) => handleMobileEnter(editor, event) } }\n\t\t\t}));\n\t\t\teditor.isEditorContentInitialized = true;\n\t\t\tthis.forceUpdate();\n\t\t}\n\t}\n\tcomponentWillUnmount() {\n\t\tconst editor = this.props.editor;\n\t\tif (!editor) return;\n\t\teditor.isEditorContentInitialized = false;\n\t\tif (!editor.isDestroyed) {\n\t\t\teditor.unregisterPlugin(mobileEnterPluginKey);\n\t\t\teditor.view.setProps({ nodeViews: {} });\n\t\t}\n\t\teditor.contentComponent = null;\n\t\ttry {\n\t\t\tvar _editor$view$dom2;\n\t\t\tif (!((_editor$view$dom2 = editor.view.dom) === null || _editor$view$dom2 === void 0 ? void 0 : _editor$view$dom2.parentNode)) return;\n\t\t\tconst newElement = document.createElement(\"div\");\n\t\t\tnewElement.append(...editor.view.dom.parentNode.childNodes);\n\t\t\teditor.setOptions({ element: newElement });\n\t\t} catch {}\n\t}\n\trender() {\n\t\tconst { editor, innerRef, ...rest } = this.props;\n\t\treturn /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(\"div\", {\n\t\t\tref: mergeRefs(innerRef, this.editorContentRef),\n\t\t\t...rest\n\t\t}), (editor === null || editor === void 0 ? void 0 : editor.contentComponent) && /* @__PURE__ */ jsx(Portals, { contentComponent: editor.contentComponent })] });\n\t}\n};\nconst EditorContentWithKey = forwardRef((props, ref) => {\n\tconst key = React.useMemo(() => {\n\t\treturn Math.floor(Math.random() * 4294967295).toString();\n\t}, [props.editor]);\n\treturn React.createElement(PureEditorContent, {\n\t\tkey,\n\t\tinnerRef: ref,\n\t\t...props\n\t});\n});\nconst EditorContent = React.memo(EditorContentWithKey);\n//#endregion\n//#region src/useEditorState.ts\nconst useIsomorphicLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n/**\n* To synchronize the editor instance with the component state,\n* we need to create a separate instance that is not affected by the component re-renders.\n*/\nvar EditorStateManager = class {\n\tconstructor(initialEditor) {\n\t\tthis.transactionNumber = 0;\n\t\tthis.lastTransactionNumber = 0;\n\t\tthis.subscribers = /* @__PURE__ */ new Set();\n\t\tthis.editor = initialEditor;\n\t\tthis.lastSnapshot = {\n\t\t\teditor: initialEditor,\n\t\t\ttransactionNumber: 0\n\t\t};\n\t\tthis.getSnapshot = this.getSnapshot.bind(this);\n\t\tthis.getServerSnapshot = this.getServerSnapshot.bind(this);\n\t\tthis.watch = this.watch.bind(this);\n\t\tthis.subscribe = this.subscribe.bind(this);\n\t}\n\t/**\n\t* Get the current editor instance.\n\t*/\n\tgetSnapshot() {\n\t\tif (this.transactionNumber === this.lastTransactionNumber) return this.lastSnapshot;\n\t\tthis.lastTransactionNumber = this.transactionNumber;\n\t\tthis.lastSnapshot = {\n\t\t\teditor: this.editor,\n\t\t\ttransactionNumber: this.transactionNumber\n\t\t};\n\t\treturn this.lastSnapshot;\n\t}\n\t/**\n\t* Always disable the editor on the server-side.\n\t*/\n\tgetServerSnapshot() {\n\t\treturn {\n\t\t\teditor: null,\n\t\t\ttransactionNumber: 0\n\t\t};\n\t}\n\t/**\n\t* Subscribe to the editor instance's changes.\n\t*/\n\tsubscribe(callback) {\n\t\tthis.subscribers.add(callback);\n\t\treturn () => {\n\t\t\tthis.subscribers.delete(callback);\n\t\t};\n\t}\n\t/**\n\t* Watch the editor instance for changes.\n\t*/\n\twatch(nextEditor) {\n\t\tthis.editor = nextEditor;\n\t\tif (this.editor) {\n\t\t\t/**\n\t\t\t* This will force a re-render when the editor state changes.\n\t\t\t* This is to support things like `editor.can().toggleBold()` in components that `useEditor`.\n\t\t\t* This could be more efficient, but it's a good trade-off for now.\n\t\t\t*/\n\t\t\tlet lastTransaction;\n\t\t\tconst fn = (props) => {\n\t\t\t\tif ((props === null || props === void 0 ? void 0 : props.transaction) !== void 0 && props.transaction === lastTransaction) return;\n\t\t\t\tlastTransaction = props === null || props === void 0 ? void 0 : props.transaction;\n\t\t\t\tthis.transactionNumber += 1;\n\t\t\t\tthis.subscribers.forEach((callback) => callback());\n\t\t\t};\n\t\t\tconst currentEditor = this.editor;\n\t\t\tcurrentEditor.on(\"transaction\", fn);\n\t\t\tcurrentEditor.on(\"update\", fn);\n\t\t\treturn () => {\n\t\t\t\tcurrentEditor.off(\"transaction\", fn);\n\t\t\t\tcurrentEditor.off(\"update\", fn);\n\t\t\t};\n\t\t}\n\t}\n};\n/**\n* This hook allows you to watch for changes on the editor instance.\n* It will allow you to select a part of the editor state and re-render the component when it changes.\n* @example\n* ```tsx\n* const editor = useEditor({...options})\n* const { currentSelection } = useEditorState({\n* editor,\n* selector: snapshot => ({ currentSelection: snapshot.editor.state.selection }),\n* })\n*/\nfunction useEditorState(options) {\n\tvar _options$equalityFn;\n\tconst [editorStateManager] = useState(() => new EditorStateManager(options.editor));\n\tconst selectedState = useSyncExternalStoreWithSelector(editorStateManager.subscribe, editorStateManager.getSnapshot, editorStateManager.getServerSnapshot, options.selector, (_options$equalityFn = options.equalityFn) !== null && _options$equalityFn !== void 0 ? _options$equalityFn : circularDeepEqual);\n\tuseIsomorphicLayoutEffect(() => {\n\t\treturn editorStateManager.watch(options.editor);\n\t}, [options.editor, editorStateManager]);\n\tuseDebugValue(selectedState);\n\treturn selectedState;\n}\n//#endregion\n//#region src/useEditor.ts\nconst isDev = process.env.NODE_ENV !== \"production\";\nconst isSSR = typeof window === \"undefined\";\nconst isNext = isSSR || Boolean(typeof window !== \"undefined\" && window.next);\n/**\n* This class handles the creation, destruction, and re-creation of the editor instance.\n*/\nvar EditorInstanceManager = class EditorInstanceManager {\n\tconstructor(options) {\n\t\tthis.editor = null;\n\t\tthis.subscriptions = /* @__PURE__ */ new Set();\n\t\tthis.isComponentMounted = false;\n\t\tthis.previousDeps = null;\n\t\tthis.instanceId = \"\";\n\t\tthis.options = options;\n\t\tthis.subscriptions = /* @__PURE__ */ new Set();\n\t\tthis.setEditor(this.getInitialEditor());\n\t\tthis.scheduleDestroy();\n\t\tthis.getEditor = this.getEditor.bind(this);\n\t\tthis.getServerSnapshot = this.getServerSnapshot.bind(this);\n\t\tthis.subscribe = this.subscribe.bind(this);\n\t\tthis.refreshEditorInstance = this.refreshEditorInstance.bind(this);\n\t\tthis.scheduleDestroy = this.scheduleDestroy.bind(this);\n\t\tthis.onRender = this.onRender.bind(this);\n\t\tthis.createEditor = this.createEditor.bind(this);\n\t}\n\tsetEditor(editor) {\n\t\tthis.editor = editor;\n\t\tthis.instanceId = Math.random().toString(36).slice(2, 9);\n\t\tthis.subscriptions.forEach((cb) => cb());\n\t}\n\tgetInitialEditor() {\n\t\tconst explicit = this.options.current.immediatelyRender;\n\t\tlet immediatelyRender = explicit !== null && explicit !== void 0 ? explicit : true;\n\t\tif (isSSR) {\n\t\t\tif (immediatelyRender && isDev) console.warn(\"SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches\");\n\t\t\timmediatelyRender = false;\n\t\t} else if (isNext && explicit === void 0) {\n\t\t\timmediatelyRender = false;\n\t\t\tif (isDev) console.warn(\"Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.\");\n\t\t}\n\t\treturn immediatelyRender ? this.createEditor() : null;\n\t}\n\t/**\n\t* Create a new editor instance. And attach event listeners.\n\t*/\n\tcreateEditor() {\n\t\tconst optionsToApply = {\n\t\t\t...this.options.current,\n\t\t\tonBeforeCreate: (...args) => {\n\t\t\t\tvar _this$options$current, _this$options$current2;\n\t\t\t\treturn (_this$options$current = (_this$options$current2 = this.options.current).onBeforeCreate) === null || _this$options$current === void 0 ? void 0 : _this$options$current.call(_this$options$current2, ...args);\n\t\t\t},\n\t\t\tonBlur: (...args) => {\n\t\t\t\tvar _this$options$current3, _this$options$current4;\n\t\t\t\treturn (_this$options$current3 = (_this$options$current4 = this.options.current).onBlur) === null || _this$options$current3 === void 0 ? void 0 : _this$options$current3.call(_this$options$current4, ...args);\n\t\t\t},\n\t\t\tonCreate: (...args) => {\n\t\t\t\tvar _this$options$current5, _this$options$current6;\n\t\t\t\treturn (_this$options$current5 = (_this$options$current6 = this.options.current).onCreate) === null || _this$options$current5 === void 0 ? void 0 : _this$options$current5.call(_this$options$current6, ...args);\n\t\t\t},\n\t\t\tonDestroy: (...args) => {\n\t\t\t\tvar _this$options$current7, _this$options$current8;\n\t\t\t\treturn (_this$options$current7 = (_this$options$current8 = this.options.current).onDestroy) === null || _this$options$current7 === void 0 ? void 0 : _this$options$current7.call(_this$options$current8, ...args);\n\t\t\t},\n\t\t\tonFocus: (...args) => {\n\t\t\t\tvar _this$options$current9, _this$options$current10;\n\t\t\t\treturn (_this$options$current9 = (_this$options$current10 = this.options.current).onFocus) === null || _this$options$current9 === void 0 ? void 0 : _this$options$current9.call(_this$options$current10, ...args);\n\t\t\t},\n\t\t\tonSelectionUpdate: (...args) => {\n\t\t\t\tvar _this$options$current11, _this$options$current12;\n\t\t\t\treturn (_this$options$current11 = (_this$options$current12 = this.options.current).onSelectionUpdate) === null || _this$options$current11 === void 0 ? void 0 : _this$options$current11.call(_this$options$current12, ...args);\n\t\t\t},\n\t\t\tonTransaction: (...args) => {\n\t\t\t\tvar _this$options$current13, _this$options$current14;\n\t\t\t\treturn (_this$options$current13 = (_this$options$current14 = this.options.current).onTransaction) === null || _this$options$current13 === void 0 ? void 0 : _this$options$current13.call(_this$options$current14, ...args);\n\t\t\t},\n\t\t\tonUpdate: (...args) => {\n\t\t\t\tvar _this$options$current15, _this$options$current16;\n\t\t\t\treturn (_this$options$current15 = (_this$options$current16 = this.options.current).onUpdate) === null || _this$options$current15 === void 0 ? void 0 : _this$options$current15.call(_this$options$current16, ...args);\n\t\t\t},\n\t\t\tonContentError: (...args) => {\n\t\t\t\tvar _this$options$current17, _this$options$current18;\n\t\t\t\treturn (_this$options$current17 = (_this$options$current18 = this.options.current).onContentError) === null || _this$options$current17 === void 0 ? void 0 : _this$options$current17.call(_this$options$current18, ...args);\n\t\t\t},\n\t\t\tonDrop: (...args) => {\n\t\t\t\tvar _this$options$current19, _this$options$current20;\n\t\t\t\treturn (_this$options$current19 = (_this$options$current20 = this.options.current).onDrop) === null || _this$options$current19 === void 0 ? void 0 : _this$options$current19.call(_this$options$current20, ...args);\n\t\t\t},\n\t\t\tonPaste: (...args) => {\n\t\t\t\tvar _this$options$current21, _this$options$current22;\n\t\t\t\treturn (_this$options$current21 = (_this$options$current22 = this.options.current).onPaste) === null || _this$options$current21 === void 0 ? void 0 : _this$options$current21.call(_this$options$current22, ...args);\n\t\t\t},\n\t\t\tonDelete: (...args) => {\n\t\t\t\tvar _this$options$current23, _this$options$current24;\n\t\t\t\treturn (_this$options$current23 = (_this$options$current24 = this.options.current).onDelete) === null || _this$options$current23 === void 0 ? void 0 : _this$options$current23.call(_this$options$current24, ...args);\n\t\t\t},\n\t\t\tonMount: (...args) => {\n\t\t\t\tvar _this$options$current25, _this$options$current26;\n\t\t\t\treturn (_this$options$current25 = (_this$options$current26 = this.options.current).onMount) === null || _this$options$current25 === void 0 ? void 0 : _this$options$current25.call(_this$options$current26, ...args);\n\t\t\t},\n\t\t\tonUnmount: (...args) => {\n\t\t\t\tvar _this$options$current27, _this$options$current28;\n\t\t\t\treturn (_this$options$current27 = (_this$options$current28 = this.options.current).onUnmount) === null || _this$options$current27 === void 0 ? void 0 : _this$options$current27.call(_this$options$current28, ...args);\n\t\t\t}\n\t\t};\n\t\treturn new Editor(optionsToApply);\n\t}\n\t/**\n\t* Get the current editor instance.\n\t*/\n\tgetEditor() {\n\t\treturn this.editor;\n\t}\n\t/**\n\t* Always disable the editor on the server-side.\n\t*/\n\tgetServerSnapshot() {\n\t\treturn null;\n\t}\n\t/**\n\t* Subscribe to the editor instance's changes.\n\t*/\n\tsubscribe(onStoreChange) {\n\t\tthis.subscriptions.add(onStoreChange);\n\t\treturn () => {\n\t\t\tthis.subscriptions.delete(onStoreChange);\n\t\t};\n\t}\n\tstatic compareOptions(a, b) {\n\t\treturn Object.keys(a).every((key) => {\n\t\t\tif ([\n\t\t\t\t\"onCreate\",\n\t\t\t\t\"onBeforeCreate\",\n\t\t\t\t\"onDestroy\",\n\t\t\t\t\"onUpdate\",\n\t\t\t\t\"onTransaction\",\n\t\t\t\t\"onFocus\",\n\t\t\t\t\"onBlur\",\n\t\t\t\t\"onSelectionUpdate\",\n\t\t\t\t\"onContentError\",\n\t\t\t\t\"onDrop\",\n\t\t\t\t\"onPaste\"\n\t\t\t].includes(key)) return true;\n\t\t\tif (key === \"extensions\" && a.extensions && b.extensions) {\n\t\t\t\tif (a.extensions.length !== b.extensions.length) return false;\n\t\t\t\treturn a.extensions.every((extension, index) => {\n\t\t\t\t\tvar _b$extensions;\n\t\t\t\t\tif (extension !== ((_b$extensions = b.extensions) === null || _b$extensions === void 0 ? void 0 : _b$extensions[index])) return false;\n\t\t\t\t\treturn true;\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (a[key] !== b[key]) return false;\n\t\t\treturn true;\n\t\t});\n\t}\n\t/**\n\t* On each render, we will create, update, or destroy the editor instance.\n\t* @param deps The dependencies to watch for changes\n\t* @returns A cleanup function\n\t*/\n\tonRender(deps) {\n\t\treturn () => {\n\t\t\tthis.isComponentMounted = true;\n\t\t\tclearTimeout(this.scheduledDestructionTimeout);\n\t\t\tif (this.editor && !this.editor.isDestroyed && deps.length === 0) {\n\t\t\t\tif (!EditorInstanceManager.compareOptions(this.options.current, this.editor.options)) this.editor.setOptions({\n\t\t\t\t\t...this.options.current,\n\t\t\t\t\teditable: this.editor.isEditable\n\t\t\t\t});\n\t\t\t} else this.refreshEditorInstance(deps);\n\t\t\treturn () => {\n\t\t\t\tthis.isComponentMounted = false;\n\t\t\t\tthis.scheduleDestroy();\n\t\t\t};\n\t\t};\n\t}\n\t/**\n\t* Recreate the editor instance if the dependencies have changed.\n\t*/\n\trefreshEditorInstance(deps) {\n\t\tif (this.editor && !this.editor.isDestroyed) {\n\t\t\tif (this.previousDeps === null) {\n\t\t\t\tthis.previousDeps = deps;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (this.previousDeps.length === deps.length && this.previousDeps.every((dep, index) => dep === deps[index])) return;\n\t\t}\n\t\tif (this.editor && !this.editor.isDestroyed) this.editor.destroy();\n\t\tthis.setEditor(this.createEditor());\n\t\tthis.previousDeps = deps;\n\t}\n\t/**\n\t* Schedule the destruction of the editor instance.\n\t* This will only destroy the editor if it was not mounted on the next tick.\n\t* This is to avoid destroying the editor instance when it's actually still mounted.\n\t*/\n\tscheduleDestroy() {\n\t\tconst currentInstanceId = this.instanceId;\n\t\tconst currentEditor = this.editor;\n\t\tthis.scheduledDestructionTimeout = setTimeout(() => {\n\t\t\tif (this.isComponentMounted && this.instanceId === currentInstanceId) {\n\t\t\t\tif (currentEditor) currentEditor.setOptions(this.options.current);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (currentEditor && !currentEditor.isDestroyed) {\n\t\t\t\tcurrentEditor.destroy();\n\t\t\t\tif (this.instanceId === currentInstanceId) this.setEditor(null);\n\t\t\t}\n\t\t}, 1);\n\t}\n};\nfunction useEditor(options = {}, deps = []) {\n\tconst mostRecentOptions = useRef(options);\n\tmostRecentOptions.current = options;\n\tconst [instanceManager] = useState(() => new EditorInstanceManager(mostRecentOptions));\n\tconst editor = useSyncExternalStore(instanceManager.subscribe, instanceManager.getEditor, instanceManager.getServerSnapshot);\n\tuseDebugValue(editor);\n\tuseEffect(instanceManager.onRender(deps));\n\tuseEditorState({\n\t\teditor,\n\t\tselector: ({ transactionNumber }) => {\n\t\t\tif (options.shouldRerenderOnTransaction === false || options.shouldRerenderOnTransaction === void 0) return null;\n\t\t\tif (options.immediatelyRender && transactionNumber === 0) return 0;\n\t\t\treturn transactionNumber + 1;\n\t\t}\n\t});\n\treturn editor;\n}\n//#endregion\n//#region src/Context.tsx\nconst EditorContext = createContext({ editor: null });\nconst EditorConsumer = EditorContext.Consumer;\n/**\n* A hook to get the current editor instance.\n*/\nconst useCurrentEditor = () => useContext(EditorContext);\n/**\n* This is the provider component for the editor.\n* It allows the editor to be accessible across the entire component tree\n* with `useCurrentEditor`.\n*/\nfunction EditorProvider({ children, slotAfter, slotBefore, editorContainerProps = {}, ...editorOptions }) {\n\tconst editor = useEditor(editorOptions);\n\tconst contextValue = useMemo(() => ({ editor }), [editor]);\n\tif (!editor) return null;\n\treturn /* @__PURE__ */ jsxs(EditorContext.Provider, {\n\t\tvalue: contextValue,\n\t\tchildren: [\n\t\t\tslotBefore,\n\t\t\t/* @__PURE__ */ jsx(EditorConsumer, { children: ({ editor: currentEditor }) => /* @__PURE__ */ jsx(EditorContent, {\n\t\t\t\teditor: currentEditor,\n\t\t\t\t...editorContainerProps\n\t\t\t}) }),\n\t\t\tchildren,\n\t\t\tslotAfter\n\t\t]\n\t});\n}\n//#endregion\n//#region src/useReactNodeView.ts\nconst ReactNodeViewContext = createContext({\n\tonDragStart: () => {},\n\tnodeViewContentChildren: void 0,\n\tnodeViewContentRef: () => {}\n});\nconst ReactNodeViewContentProvider = ({ children, content }) => {\n\treturn createElement(ReactNodeViewContext.Provider, { value: { nodeViewContentChildren: content } }, children);\n};\nconst useReactNodeView = () => useContext(ReactNodeViewContext);\n//#endregion\n//#region src/NodeViewContent.tsx\nfunction NodeViewContent({ as: Tag = \"div\", ...props }) {\n\tconst { nodeViewContentRef, nodeViewContentChildren } = useReactNodeView();\n\treturn /* @__PURE__ */ jsx(Tag, {\n\t\t...props,\n\t\tref: nodeViewContentRef,\n\t\t\"data-node-view-content\": \"\",\n\t\tstyle: {\n\t\t\twhiteSpace: \"pre-wrap\",\n\t\t\t...props.style\n\t\t},\n\t\tchildren: nodeViewContentChildren\n\t});\n}\n//#endregion\n//#region src/NodeViewWrapper.tsx\nconst NodeViewWrapper = React.forwardRef((props, ref) => {\n\tconst { onDragStart } = useReactNodeView();\n\tconst Tag = props.as || \"div\";\n\treturn /* @__PURE__ */ jsx(Tag, {\n\t\t...props,\n\t\tref,\n\t\t\"data-node-view-wrapper\": \"\",\n\t\tonDragStart,\n\t\tstyle: {\n\t\t\twhiteSpace: \"normal\",\n\t\t\t...props.style\n\t\t}\n\t});\n});\n//#endregion\n//#region src/ReactRenderer.tsx\n/**\n* Check if a component is a class component.\n* @param Component\n* @returns {boolean}\n*/\nfunction isClassComponent(Component) {\n\treturn !!(typeof Component === \"function\" && Component.prototype && Component.prototype.isReactComponent);\n}\n/**\n* Check if a component is a forward ref component.\n* @param Component\n* @returns {boolean}\n*/\nfunction isForwardRefComponent(Component) {\n\treturn !!(typeof Component === \"object\" && Component.$$typeof && (Component.$$typeof.toString() === \"Symbol(react.forward_ref)\" || Component.$$typeof.description === \"react.forward_ref\"));\n}\n/**\n* Check if a component is a memoized component.\n* @param Component\n* @returns {boolean}\n*/\nfunction isMemoComponent(Component) {\n\treturn !!(typeof Component === \"object\" && Component.$$typeof && (Component.$$typeof.toString() === \"Symbol(react.memo)\" || Component.$$typeof.description === \"react.memo\"));\n}\n/**\n* Check if a component can safely receive a ref prop.\n* This includes class components, forwardRef components, and memoized components\n* that wrap forwardRef or class components.\n* @param Component\n* @returns {boolean}\n*/\nfunction canReceiveRef(Component) {\n\tif (isClassComponent(Component)) return true;\n\tif (isForwardRefComponent(Component)) return true;\n\tif (isMemoComponent(Component)) {\n\t\tconst wrappedComponent = Component.type;\n\t\tif (wrappedComponent) return isClassComponent(wrappedComponent) || isForwardRefComponent(wrappedComponent);\n\t}\n\treturn false;\n}\n/**\n* Check if we're running React 19+ by detecting if function components support ref props\n* @returns {boolean}\n*/\nfunction isReact19Plus() {\n\ttry {\n\t\tif (version) return parseInt(version.split(\".\")[0], 10) >= 19;\n\t} catch {}\n\treturn false;\n}\n/**\n* The ReactRenderer class. It's responsible for rendering React components inside the editor.\n* @example\n* new ReactRenderer(MyComponent, {\n* editor,\n* props: {\n* foo: 'bar',\n* },\n* as: 'span',\n* })\n*/\nvar ReactRenderer = class {\n\t/**\n\t* Immediately creates element and renders the provided React component.\n\t*/\n\tconstructor(component, { editor, props = {}, as = \"div\", className = \"\" }) {\n\t\tthis.ref = null;\n\t\tthis.destroyed = false;\n\t\tthis.id = Math.floor(Math.random() * 4294967295).toString();\n\t\tthis.component = component;\n\t\tthis.editor = editor;\n\t\tthis.props = props;\n\t\tthis.element = document.createElement(as);\n\t\tthis.element.classList.add(\"react-renderer\");\n\t\tif (className) this.element.classList.add(...className.split(\" \"));\n\t\tif (this.editor.isEditorContentInitialized) this.render();\n\t\telse queueMicrotask(() => {\n\t\t\tif (this.destroyed) return;\n\t\t\tthis.render();\n\t\t});\n\t}\n\t/**\n\t* Render the React component.\n\t*/\n\trender() {\n\t\tvar _editor$contentCompon;\n\t\tif (this.destroyed) return;\n\t\tconst Component = this.component;\n\t\tconst props = this.props;\n\t\tconst editor = this.editor;\n\t\tconst isReact19 = isReact19Plus();\n\t\tconst componentCanReceiveRef = canReceiveRef(Component);\n\t\tconst elementProps = { ...props };\n\t\tif (elementProps.ref && !(isReact19 || componentCanReceiveRef)) delete elementProps.ref;\n\t\tif (!elementProps.ref && (isReact19 || componentCanReceiveRef)) elementProps.ref = (ref) => {\n\t\t\tthis.ref = ref;\n\t\t};\n\t\tthis.reactElement = /* @__PURE__ */ jsx(Component, { ...elementProps });\n\t\teditor === null || editor === void 0 || (_editor$contentCompon = editor.contentComponent) === null || _editor$contentCompon === void 0 || _editor$contentCompon.setRenderer(this.id, this);\n\t}\n\t/**\n\t* Re-renders the React component with new props.\n\t* Skips the render if none of the supplied props actually changed,\n\t* to avoid unnecessary portal re-creation.\n\t*/\n\tupdateProps(props = {}) {\n\t\tif (this.destroyed) return;\n\t\tlet changed = false;\n\t\tconst keys = Object.keys(props);\n\t\tfor (let i = 0; i < keys.length; i += 1) {\n\t\t\tconst key = keys[i];\n\t\t\tif (props[key] !== this.props[key]) {\n\t\t\t\tchanged = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!changed) return;\n\t\tthis.props = {\n\t\t\t...this.props,\n\t\t\t...props\n\t\t};\n\t\tthis.render();\n\t}\n\t/**\n\t* Destroy the React component.\n\t*/\n\tdestroy() {\n\t\tvar _editor$contentCompon2;\n\t\tthis.destroyed = true;\n\t\tconst editor = this.editor;\n\t\teditor === null || editor === void 0 || (_editor$contentCompon2 = editor.contentComponent) === null || _editor$contentCompon2 === void 0 || _editor$contentCompon2.removeRenderer(this.id);\n\t\ttry {\n\t\t\tif (this.element && this.element.parentNode) this.element.parentNode.removeChild(this.element);\n\t\t} catch {}\n\t}\n\t/**\n\t* Update the attributes of the element that holds the React component.\n\t*/\n\tupdateAttributes(attributes) {\n\t\tObject.keys(attributes).forEach((key) => {\n\t\t\tthis.element.setAttribute(key, attributes[key]);\n\t\t});\n\t}\n};\n//#endregion\n//#region src/ReactMarkViewRenderer.tsx\nconst ReactMarkViewContext = React.createContext({ markViewContentRef: () => {} });\nconst MarkViewContent = (props) => {\n\tconst { as: Tag = \"span\", ...rest } = props;\n\tconst { markViewContentRef } = React.useContext(ReactMarkViewContext);\n\treturn /* @__PURE__ */ jsx(Tag, {\n\t\t...rest,\n\t\tref: markViewContentRef,\n\t\t\"data-mark-view-content\": \"\"\n\t});\n};\nvar ReactMarkView = class extends MarkView {\n\tconstructor(component, props, options) {\n\t\tsuper(component, props, options);\n\t\tconst { as = \"span\", attrs, className = \"\" } = options || {};\n\t\tconst componentProps = {\n\t\t\t...props,\n\t\t\tupdateAttributes: this.updateAttributes.bind(this)\n\t\t};\n\t\tthis.contentDOMElement = document.createElement(\"span\");\n\t\tconst markViewContentRef = (el) => {\n\t\t\tif (el && !el.contains(this.contentDOMElement)) el.appendChild(this.contentDOMElement);\n\t\t};\n\t\tconst context = { markViewContentRef };\n\t\tconst ReactMarkViewProvider = React.memo((componentProps) => {\n\t\t\treturn /* @__PURE__ */ jsx(ReactMarkViewContext.Provider, {\n\t\t\t\tvalue: context,\n\t\t\t\tchildren: React.createElement(component, componentProps)\n\t\t\t});\n\t\t});\n\t\tReactMarkViewProvider.displayName = \"ReactMarkView\";\n\t\tthis.renderer = new ReactRenderer(ReactMarkViewProvider, {\n\t\t\teditor: props.editor,\n\t\t\tprops: componentProps,\n\t\t\tas,\n\t\t\tclassName: `mark-${props.mark.type.name} ${className}`.trim()\n\t\t});\n\t\tif (attrs) this.renderer.updateAttributes(attrs);\n\t}\n\tget dom() {\n\t\treturn this.renderer.element;\n\t}\n\tget contentDOM() {\n\t\treturn this.contentDOMElement;\n\t}\n};\nfunction ReactMarkViewRenderer(component, options = {}) {\n\treturn (props) => new ReactMarkView(component, props, options);\n}\n//#endregion\n//#region src/captureDOMSelection.ts\n/**\n* Saves the DOM selection inside `element`, returns a function to put it back.\n* Browsers drop the selection when an element moves, so restore it after the move.\n*/\nfunction captureDOMSelection(element) {\n\tvar _element$ownerDocumen;\n\tconst root = element.getRootNode();\n\tconst selection = typeof root.getSelection === \"function\" ? root.getSelection() : (_element$ownerDocumen = element.ownerDocument) === null || _element$ownerDocumen === void 0 || (_element$ownerDocumen = _element$ownerDocumen.defaultView) === null || _element$ownerDocumen === void 0 ? void 0 : _element$ownerDocumen.getSelection();\n\tif (!selection || selection.rangeCount === 0) return null;\n\tconst { anchorNode, anchorOffset, focusNode, focusOffset } = selection;\n\tif (!anchorNode || !focusNode) return null;\n\tif (!element.contains(anchorNode) || !element.contains(focusNode)) return null;\n\treturn () => {\n\t\ttry {\n\t\t\tselection.setBaseAndExtent(anchorNode, anchorOffset, focusNode, focusOffset);\n\t\t} catch {}\n\t};\n}\n//#endregion\n//#region src/lib/utils/getTextSelectionAncestorPositions.ts\nfunction isSameAncestor($from, $to, depth) {\n\treturn $from.node(depth) === $to.node(depth) && $from.before(depth) === $to.before(depth);\n}\nfunction getTextSelectionAncestorPositions(selection) {\n\tif (!isTextSelection(selection)) return [];\n\tconst { $from, $to } = selection;\n\tconst positions = [];\n\tconst maxDepth = Math.min($from.depth, $to.depth);\n\tfor (let depth = 1; depth <= maxDepth; depth += 1) {\n\t\tif (!isSameAncestor($from, $to, depth)) break;\n\t\tpositions.push($from.before(depth));\n\t}\n\treturn positions;\n}\n//#endregion\n//#region src/ReactNodeViewSelectionTracker.ts\nvar ReactNodeViewSelectionTracker = class {\n\tconstructor(editor) {\n\t\tthis.views = /* @__PURE__ */ new WeakMap();\n\t\tthis.viewCount = 0;\n\t\tthis.insideViews = /* @__PURE__ */ new Set();\n\t\tthis.syncQueued = false;\n\t\tthis.scheduleSync = () => {\n\t\t\tif (this.syncQueued) return;\n\t\t\tthis.syncQueued = true;\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tthis.syncQueued = false;\n\t\t\t\tthis.sync();\n\t\t\t});\n\t\t};\n\t\tthis.handleTransaction = () => this.scheduleSync();\n\t\tthis.editor = editor;\n\t}\n\tregister(view) {\n\t\tif (this.viewCount === 0) this.editor.on(\"transaction\", this.handleTransaction);\n\t\tthis.views.set(view.dom, view);\n\t\tthis.viewCount += 1;\n\t\tthis.scheduleSync();\n\t}\n\tunregister(view) {\n\t\tthis.views.delete(view.dom);\n\t\tthis.viewCount -= 1;\n\t\tthis.insideViews.delete(view);\n\t\tif (this.viewCount === 0) this.editor.off(\"transaction\", this.handleTransaction);\n\t}\n\tsync() {\n\t\tif (this.viewCount === 0 || this.editor.isDestroyed) return;\n\t\tconst nextInsideViews = this.findInsideViews();\n\t\tthis.updateViews(this.insideViews, nextInsideViews, false);\n\t\tthis.updateViews(nextInsideViews, this.insideViews, true);\n\t\tthis.insideViews = nextInsideViews;\n\t}\n\tupdateViews(views, unchangedViews, selectionInside) {\n\t\tfor (const view of views) if (!unchangedViews.has(view)) view.setSelectionInside(selectionInside);\n\t}\n\tfindInsideViews() {\n\t\tconst insideViews = /* @__PURE__ */ new Set();\n\t\tfor (const position of getTextSelectionAncestorPositions(this.editor.state.selection)) {\n\t\t\tconst dom = this.editor.view.nodeDOM(position);\n\t\t\tconst view = dom ? this.views.get(dom) : void 0;\n\t\t\tif (view) insideViews.add(view);\n\t\t}\n\t\treturn insideViews;\n\t}\n};\nconst trackers = /* @__PURE__ */ new WeakMap();\nfunction getReactNodeViewSelectionTracker(editor) {\n\tlet tracker = trackers.get(editor);\n\tif (!tracker) {\n\t\ttracker = new ReactNodeViewSelectionTracker(editor);\n\t\ttrackers.set(editor, tracker);\n\t}\n\treturn tracker;\n}\n//#endregion\n//#region src/ReactNodeViewRenderer.tsx\nvar ReactNodeView = class extends NodeView {\n\tconstructor(component, props, options) {\n\t\tsuper(component, props, options);\n\t\tthis.nodeSelected = false;\n\t\tthis.handlePositionUpdate = () => {\n\t\t\tconst newPos = this.getPos();\n\t\t\tif (typeof newPos !== \"number\" || newPos === this.currentPos) return;\n\t\t\tthis.currentPos = newPos;\n\t\t\tthis.renderer.updateProps({ getPos: () => this.getPos() });\n\t\t\tif (typeof this.options.attrs === \"function\") this.updateElementAttributes();\n\t\t};\n\t\tthis.cachedExtensionWithSyncedStorage = null;\n\t\tif (!this.node.isLeaf) {\n\t\t\tif (this.options.contentDOMElementTag) this.contentDOMElement = document.createElement(this.options.contentDOMElementTag);\n\t\t\telse this.contentDOMElement = document.createElement(this.node.isInline ? \"span\" : \"div\");\n\t\t\tthis.contentDOMElement.dataset.nodeViewContentReact = \"\";\n\t\t\tthis.contentDOMElement.dataset.nodeViewWrapper = \"\";\n\t\t\tthis.contentDOMElement.style.whiteSpace = \"inherit\";\n\t\t\tconst contentTarget = this.dom.querySelector(\"[data-node-view-content]\");\n\t\t\tif (contentTarget) contentTarget.appendChild(this.contentDOMElement);\n\t\t\telse this.dom.appendChild(this.contentDOMElement);\n\t\t}\n\t\tif (this.options.trackNodeViewPosition) this.editor.on(\"update\", this.handlePositionUpdate);\n\t}\n\t/**\n\t* Returns a proxy of the extension that redirects storage access to the editor's mutable storage.\n\t* This preserves the original prototype chain (instanceof checks, methods like configure/extend work).\n\t* Cached to avoid proxy creation on every update.\n\t*/\n\tget extensionWithSyncedStorage() {\n\t\tif (!this.cachedExtensionWithSyncedStorage) {\n\t\t\tconst editor = this.editor;\n\t\t\tconst extension = this.extension;\n\t\t\tthis.cachedExtensionWithSyncedStorage = new Proxy(extension, { get(target, prop, receiver) {\n\t\t\t\tif (prop === \"storage\") {\n\t\t\t\t\tvar _editor$storage;\n\t\t\t\t\treturn (_editor$storage = editor.storage[extension.name]) !== null && _editor$storage !== void 0 ? _editor$storage : {};\n\t\t\t\t}\n\t\t\t\treturn Reflect.get(target, prop, receiver);\n\t\t\t} });\n\t\t}\n\t\treturn this.cachedExtensionWithSyncedStorage;\n\t}\n\t/**\n\t* Setup the React component.\n\t* Called on initialization.\n\t*/\n\tmount() {\n\t\tconst mountProps = {\n\t\t\teditor: this.editor,\n\t\t\tnode: this.node,\n\t\t\tdecorations: this.decorations,\n\t\t\tinnerDecorations: this.innerDecorations,\n\t\t\tview: this.view,\n\t\t\tselected: false,\n\t\t\tselectionInside: false,\n\t\t\textension: this.extensionWithSyncedStorage,\n\t\t\tHTMLAttributes: this.HTMLAttributes,\n\t\t\tgetPos: () => this.getPos(),\n\t\t\tupdateAttributes: (attributes = {}) => this.updateAttributes(attributes),\n\t\t\tdeleteNode: () => this.deleteNode(),\n\t\t\tref: createRef()\n\t\t};\n\t\tif (!this.component.displayName) {\n\t\t\tconst capitalizeFirstChar = (string) => {\n\t\t\t\treturn string.charAt(0).toUpperCase() + string.substring(1);\n\t\t\t};\n\t\t\tthis.component.displayName = capitalizeFirstChar(this.extension.name);\n\t\t}\n\t\tconst onDragStart = this.onDragStart.bind(this);\n\t\tconst nodeViewContentRef = (element) => {\n\t\t\tif (element && this.contentDOMElement && element.firstChild !== this.contentDOMElement) {\n\t\t\t\tif (element.hasAttribute(\"data-node-view-wrapper\")) element.removeAttribute(\"data-node-view-wrapper\");\n\t\t\t\tconst restoreSelection = captureDOMSelection(this.contentDOMElement);\n\t\t\t\telement.appendChild(this.contentDOMElement);\n\t\t\t\trestoreSelection === null || restoreSelection === void 0 || restoreSelection();\n\t\t\t}\n\t\t};\n\t\tconst context = {\n\t\t\tonDragStart,\n\t\t\tnodeViewContentRef\n\t\t};\n\t\tconst Component = this.component;\n\t\tconst ReactNodeViewProvider = memo((componentProps) => {\n\t\t\treturn /* @__PURE__ */ jsx(ReactNodeViewContext.Provider, {\n\t\t\t\tvalue: context,\n\t\t\t\tchildren: createElement(Component, componentProps)\n\t\t\t});\n\t\t});\n\t\tReactNodeViewProvider.displayName = \"ReactNodeView\";\n\t\tlet as = this.node.isInline ? \"span\" : \"div\";\n\t\tif (this.options.as) as = this.options.as;\n\t\tconst { className = \"\" } = this.options;\n\t\tthis.renderer = new ReactRenderer(ReactNodeViewProvider, {\n\t\t\teditor: this.editor,\n\t\t\tprops: mountProps,\n\t\t\tas,\n\t\t\tclassName: `node-${this.node.type.name} ${className}`.trim()\n\t\t});\n\t\tgetReactNodeViewSelectionTracker(this.editor).register(this);\n\t\tthis.updateElementAttributes();\n\t\tthis.currentPos = this.getPos();\n\t}\n\t/**\n\t* Return the DOM element.\n\t* This is the element that will be used to display the node view.\n\t*/\n\tget dom() {\n\t\tvar _this$renderer$elemen;\n\t\tif (this.renderer.element.firstElementChild && !((_this$renderer$elemen = this.renderer.element.firstElementChild) === null || _this$renderer$elemen === void 0 ? void 0 : _this$renderer$elemen.hasAttribute(\"data-node-view-wrapper\"))) throw Error(\"Please use the NodeViewWrapper component for your node view.\");\n\t\treturn this.renderer.element;\n\t}\n\t/**\n\t* Return the content DOM element.\n\t* This is the element that will be used to display the rich-text content of the node.\n\t*/\n\tget contentDOM() {\n\t\tif (this.node.isLeaf) return null;\n\t\treturn this.contentDOMElement;\n\t}\n\t/**\n\t* On update, update the React component.\n\t* To prevent unnecessary updates, the `update` option can be used.\n\t*/\n\tupdate(node, decorations, innerDecorations) {\n\t\tconst rerenderComponent = (props) => {\n\t\t\tthis.renderer.updateProps(props);\n\t\t\tif (typeof this.options.attrs === \"function\") this.updateElementAttributes();\n\t\t};\n\t\tif (node.type !== this.node.type) return false;\n\t\tif (typeof this.options.update === \"function\") {\n\t\t\tconst oldNode = this.node;\n\t\t\tconst oldDecorations = this.decorations;\n\t\t\tconst oldInnerDecorations = this.innerDecorations;\n\t\t\tthis.node = node;\n\t\t\tthis.decorations = decorations;\n\t\t\tthis.innerDecorations = innerDecorations;\n\t\t\tthis.currentPos = this.getPos();\n\t\t\treturn this.options.update({\n\t\t\t\toldNode,\n\t\t\t\toldDecorations,\n\t\t\t\tnewNode: node,\n\t\t\t\tnewDecorations: decorations,\n\t\t\t\toldInnerDecorations,\n\t\t\t\tinnerDecorations,\n\t\t\t\tupdateProps: () => rerenderComponent({\n\t\t\t\t\tnode,\n\t\t\t\t\tdecorations,\n\t\t\t\t\tinnerDecorations,\n\t\t\t\t\textension: this.extensionWithSyncedStorage\n\t\t\t\t})\n\t\t\t});\n\t\t}\n\t\tif (!(node !== this.node)) {\n\t\t\tthis.node = node;\n\t\t\tthis.decorations = decorations;\n\t\t\tthis.innerDecorations = innerDecorations;\n\t\t\treturn true;\n\t\t}\n\t\tconst newPos = this.getPos();\n\t\tthis.node = node;\n\t\tthis.decorations = decorations;\n\t\tthis.innerDecorations = innerDecorations;\n\t\tthis.currentPos = newPos;\n\t\tconst extraProps = {\n\t\t\tnode,\n\t\t\tdecorations,\n\t\t\tinnerDecorations,\n\t\t\textension: this.extensionWithSyncedStorage\n\t\t};\n\t\tif (this.options.trackNodeViewPosition) extraProps.getPos = () => this.getPos();\n\t\trerenderComponent(extraProps);\n\t\treturn true;\n\t}\n\t/**\n\t* Select the node.\n\t* Add the `selected` prop and the `ProseMirror-selectednode` class.\n\t*/\n\tselectNode() {\n\t\tthis.nodeSelected = true;\n\t\tthis.updateSelectedState(true);\n\t}\n\t/**\n\t* Deselect the node.\n\t* Remove the `selected` prop and the `ProseMirror-selectednode` class.\n\t*/\n\tdeselectNode() {\n\t\tthis.nodeSelected = false;\n\t\tthis.updateSelectedState(this.options.selectedOnTextSelection === true && this.isTextSelectionInside());\n\t}\n\tsetSelectionInside(selectionInside) {\n\t\tconst selected = this.nodeSelected || this.options.selectedOnTextSelection === true && selectionInside;\n\t\tthis.renderer.updateProps({\n\t\t\tselectionInside,\n\t\t\tselected\n\t\t});\n\t\tthis.renderer.element.classList.toggle(\"ProseMirror-selectednode\", selected);\n\t}\n\tupdateSelectedState(selected) {\n\t\tthis.renderer.updateProps({ selected });\n\t\tthis.renderer.element.classList.toggle(\"ProseMirror-selectednode\", selected);\n\t}\n\tisTextSelectionInside() {\n\t\tconst pos = this.getPos();\n\t\treturn typeof pos === \"number\" && getTextSelectionAncestorPositions(this.editor.state.selection).includes(pos);\n\t}\n\t/**\n\t* Destroy the React component instance.\n\t*/\n\tdestroy() {\n\t\tthis.renderer.destroy();\n\t\tgetReactNodeViewSelectionTracker(this.editor).unregister(this);\n\t\tif (this.options.trackNodeViewPosition) this.editor.off(\"update\", this.handlePositionUpdate);\n\t\tthis.contentDOMElement = null;\n\t}\n\t/**\n\t* Update the attributes of the top-level element that holds the React component.\n\t* Applying the attributes defined in the `attrs` option.\n\t*/\n\tupdateElementAttributes() {\n\t\tif (this.options.attrs) {\n\t\t\tlet attrsObj = {};\n\t\t\tif (typeof this.options.attrs === \"function\") {\n\t\t\t\tconst extensionAttributes = this.editor.extensionManager.attributes;\n\t\t\t\tconst HTMLAttributes = getRenderedAttributes(this.node, extensionAttributes);\n\t\t\t\tattrsObj = this.options.attrs({\n\t\t\t\t\tnode: this.node,\n\t\t\t\t\tHTMLAttributes\n\t\t\t\t});\n\t\t\t} else attrsObj = this.options.attrs;\n\t\t\tthis.renderer.updateAttributes(attrsObj);\n\t\t}\n\t}\n};\n/**\n* Create a React node view renderer.\n*/\nfunction ReactNodeViewRenderer(component, options) {\n\treturn (props) => {\n\t\tif (!props.editor.contentComponent) return {\n\t\t\tdom: document.createElement(\"span\"),\n\t\t\tcontentDOM: null,\n\t\t\tupdate: () => false,\n\t\t\tdestroy: () => {},\n\t\t\tselectNode: () => {},\n\t\t\tdeselectNode: () => {},\n\t\t\tstopEvent: () => false,\n\t\t\tignoreMutation: () => true\n\t\t};\n\t\treturn new ReactNodeView(component, props, options);\n\t};\n}\n//#endregion\n//#region src/ReactWidgetRenderer.tsx\nconst WIDGET_CACHE = Symbol(\"tiptapReactWidgetCache\");\n/**\n* Renders a React component into a ProseMirror widget decoration.\n* Reuses Tiptap's `ReactRenderer` so the component lives in the editor's\n* React tree (context and hooks work as usual). Use a stable `key` for\n* stateful widgets.\n* @example\n* addDecorations() {\n* return {\n* create: ({ editor, state }) =>\n* findMatches(state.doc).map(match =>\n* ReactWidgetRenderer(MyWidget, {\n* editor, pos: match.pos, key: `match-${match.id}`,\n* props: { label: match.label },\n* }),\n* ),\n* }\n* }\n*/\nfunction ReactWidgetRenderer(component, options) {\n\tconst { editor, props = {}, as = \"span\", className } = options;\n\treturn createWidgetDecoration({\n\t\t...options,\n\t\tprops,\n\t\tcacheKey: WIDGET_CACHE,\n\t\tcontext: (getPos) => ({\n\t\t\teditor,\n\t\t\tgetPos\n\t\t}),\n\t\tcreate: (renderProps) => new ReactRenderer(component, {\n\t\t\teditor,\n\t\t\tas,\n\t\t\tclassName,\n\t\t\tprops: renderProps\n\t\t}),\n\t\tmaterialize: (renderer) => {\n\t\t\trenderer.render();\n\t\t\treturn renderer.element;\n\t\t}\n\t});\n}\n//#endregion\n//#region src/Tiptap.tsx\n/**\n* React context that stores the current editor instance.\n*\n* Use `useTiptap()` to read from this context in child components.\n*/\nconst TiptapContext = createContext({ get editor() {\n\tthrow new Error(\"useTiptap must be used within a <Tiptap> provider\");\n} });\nTiptapContext.displayName = \"TiptapContext\";\n/**\n* Hook to read the Tiptap context and access the editor instance.\n*\n* This is a small convenience wrapper around `useContext(TiptapContext)`.\n* The editor is always available when used within a `<Tiptap>` provider.\n*\n* @returns The current `TiptapContextType` value from the provider.\n*\n* @example\n* ```tsx\n* import { useTiptap } from '@tiptap/react'\n*\n* function Toolbar() {\n* const { editor } = useTiptap()\n*\n* return (\n* <button onClick={() => editor.chain().focus().toggleBold().run()}>\n* Bold\n* </button>\n* )\n* }\n* ```\n*/\nconst useTiptap = () => useContext(TiptapContext);\n/**\n* Select a slice of the editor state using the context-provided editor.\n*\n* This is a thin wrapper around `useEditorState` that reads the `editor`\n* instance from `useTiptap()` so callers don't have to pass it manually.\n*\n* @typeParam TSelectorResult - The type returned by the selector.\n* @param selector - Function that receives the editor state snapshot and\n* returns the piece of state you want to subscribe to.\n* @param equalityFn - Optional function to compare previous/next selected\n* values and avoid unnecessary updates.\n* @returns The selected slice of the editor state.\n*\n* @example\n* ```tsx\n* function WordCount() {\n* const wordCount = useTiptapState(state => {\n* const text = state.editor.state.doc.textContent\n* return text.split(/\\s+/).filter(Boolean).length\n* })\n*\n* return <span>{wordCount} words</span>\n* }\n* ```\n*/\nfunction useTiptapState(selector, equalityFn) {\n\tconst { editor } = useTiptap();\n\treturn useEditorState({\n\t\teditor,\n\t\tselector,\n\t\tequalityFn\n\t});\n}\n/**\n* Top-level provider component that makes the editor instance available via\n* React context to all child components.\n*\n* This component also provides backwards compatibility with the legacy\n* `EditorContext`, so components using `useCurrentEditor()` will work\n* inside a `<Tiptap>` provider.\n*\n* @param props - Component props.\n* @returns A context provider element wrapping `children`.\n*\n* @example\n* ```tsx\n* import { Tiptap, useEditor } from '@tiptap/react'\n*\n* function App() {\n* const editor = useEditor({ extensions: [...] })\n*\n* return (\n* <Tiptap editor={editor}>\n* <Toolbar />\n* <Tiptap.Content />\n* </Tiptap>\n* )\n* }\n* ```\n*/\nfunction TiptapWrapper({ children, ...props }) {\n\tconst resolvedEditor = \"editor\" in props ? props.editor : props.instance;\n\tif (!resolvedEditor) throw new Error(\"Tiptap: An editor instance is required. Pass a non-null `editor` prop.\");\n\tconst tiptapContextValue = useMemo(() => ({ editor: resolvedEditor }), [resolvedEditor]);\n\tconst legacyContextValue = useMemo(() => ({ editor: resolvedEditor }), [resolvedEditor]);\n\treturn /* @__PURE__ */ jsx(EditorContext.Provider, {\n\t\tvalue: legacyContextValue,\n\t\tchildren: /* @__PURE__ */ jsx(TiptapContext.Provider, {\n\t\t\tvalue: tiptapContextValue,\n\t\t\tchildren\n\t\t})\n\t});\n}\nTiptapWrapper.displayName = \"Tiptap\";\n/**\n* Convenience component that renders `EditorContent` using the context-provided\n* editor instance. Use this instead of manually passing the `editor` prop.\n*\n* @param props - All `EditorContent` props except `editor` and `ref`.\n* @returns An `EditorContent` element bound to the context editor.\n*\n* @example\n* ```tsx\n* // inside a Tiptap provider\n* <Tiptap.Content className=\"editor\" />\n* ```\n*/\nfunction TiptapContent({ ...rest }) {\n\tconst { editor } = useTiptap();\n\treturn /* @__PURE__ */ jsx(EditorContent, {\n\t\teditor,\n\t\t...rest\n\t});\n}\nTiptapContent.displayName = \"Tiptap.Content\";\n/**\n* Root `Tiptap` component. Use it as the provider for all child components.\n*\n* The exported object includes the `Content` subcomponent for rendering the\n* editor content area.\n*\n* This component provides both the new `TiptapContext` (accessed via `useTiptap()`)\n* and the legacy `EditorContext` (accessed via `useCurrentEditor()`) for\n* backwards compatibility.\n*\n* For bubble menus and floating menus, import them separately from\n* `@tiptap/react/menus` to keep floating-ui as an optional dependency.\n*\n* @example\n* ```tsx\n* import { Tiptap, useEditor } from '@tiptap/react'\n* import { BubbleMenu } from '@tiptap/react/menus'\n*\n* function App() {\n* const editor = useEditor({ extensions: [...] })\n*\n* return (\n* <Tiptap editor={editor}>\n* <Tiptap.Content />\n* <BubbleMenu>\n* <button onClick={() => editor.chain().focus().toggleBold().run()}>Bold</button>\n* </BubbleMenu>\n* </Tiptap>\n* )\n* }\n* ```\n*/\nconst Tiptap = Object.assign(TiptapWrapper, { \n/**\n* The Tiptap Content component that renders the EditorContent with the editor instance from the context.\n* @see TiptapContent\n*/\nContent: TiptapContent });\n//#endregion\nexport { EditorConsumer, EditorContent, EditorContext, EditorProvider, MarkViewContent, NodeViewContent, NodeViewWrapper, PureEditorContent, ReactMarkView, ReactMarkViewContext, ReactMarkViewRenderer, ReactNodeView, ReactNodeViewContentProvider, ReactNodeViewContext, ReactNodeViewRenderer, ReactRenderer, ReactWidgetRenderer, Tiptap, TiptapContent, TiptapContext, TiptapWrapper, createContentComponent, useCurrentEditor, useEditor, useEditorState, useReactNodeView, useTiptap, useTiptapState };\n\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;;;;;;;;;;AAWA,SAASS,GAAkB,GAAQ,GAAO;CAEzC,IAAIC,EAAO,eAAeC,EAAM,oBAAoB,CAACA,EAAM,cAAc,CAACD,EAAO,cAAcC,EAAM,cAAc,qBAAqBA,EAAM,cAAc,qBAAqB,CAACC,EAAM,KAAK,CAACC,EAAU,GAAG;CAC3M,IAAMC,IAAOJ,EAAO,MACdK,IAAOD,EAAK,MAEZE,KADyDD,EAAK,cAAwF,KAAKA,CAAI,KAAoED,EAAK,IAAI,cAAc,aAAa,EAC9P,EAAgE,YAEzEG,KADWD,GAAuD,aAAc,IAAIA,IAASA,GAAuD,cACvI,EAA0D,QAAQ,gCAAgC;CACrH,IAAI,CAACC,KAAc,CAACH,EAAK,IAAI,SAASG,CAAU,GAAG;CACnD,IAAMC,IAAcJ,EAAK,MAAM;CAG/B,AAFII,MAAgB,OAAI,EAAK,MAAM,cAAc,OACjDJ,EAAK,YAAY,WAAW,GAC5BA,EAAK,YAAY,MAAM;CACvB,IAAMK,IAAW,IAAI,cAAc,WAAW;EAC7C,KAAK;EACL,MAAM;EACN,SAAS;EACT,UAAUR,EAAM,cAAc;EAC9B,SAAS;EACT,YAAY;CACb,CAAC;CACD,AAAIG,EAAK,SAAS,kBAAkB,MAAkBM,EAAcN,GAAMK,CAAQ,CAAC,KAClFR,EAAM,eAAe,GACrB,EAAK,MAAM,eAAe,GAC1B,aAAaG,EAAK,MAAM,2BAA2B,KACzCI,MAAgB,OAAI,EAAK,MAAM,cAAcA;AACzD;AAGA,IAAMG,IAAuB,IAAIC,EAAU,kBAAkB,GACvDC,MAAa,GAAGC,OACb,MAAS;CAChB,EAAK,SAAS,MAAQ;EACrB,AAAI,OAAOC,KAAQ,aAAYA,EAAIC,CAAI,IAC9BD,MAAK,EAAI,UAAUC;CAC7B,CAAC;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,SAAS;CAClD,MAAU,MAAM,mDAAmD;AACpE,EAAE,CAAC;AACH,EAAc,cAAc;AAwB5B,IAAMM,UAAkBH,EAAWE,CAAa;AA6DhD,SAASE,EAAc,EAAE,aAAU,GAAGvE,KAAS;CAC9C,IAAMwE,IAAiB,YAAYxE,IAAQA,EAAM,SAASA,EAAM;CAChE,IAAI,CAACwE,GAAgB,MAAU,MAAM,wEAAwE;CAC7G,IAAMC,IAAqBC,SAAe,EAAE,QAAQF,EAAe,IAAI,CAACA,CAAc,CAAC,GACjFG,IAAqBD,SAAe,EAAE,QAAQF,EAAe,IAAI,CAACA,CAAc,CAAC;CACvF,OAAuB,kBAAIT,EAAc,UAAU;EAClD,OAAOY;EACP,UAA0B,kBAAIN,EAAc,UAAU;GACrD,OAAOI;GACP;EACD,CAAC;CACF,CAAC;AACF;AACA,EAAc,cAAc;AAc5B,SAASG,EAAc,EAAE,GAAGxE,KAAQ;CACnC,IAAM,EAAE,cAAWkE,EAAU;CAC7B,OAAuB,kBAAI7D,GAAe;EACzC;EACA,GAAGL;CACJ,CAAC;AACF;AACA,EAAc,cAAc,kBAiCb,OAAO,OAAOmE,GAAe,EAK5C,SAASK,EAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["StarterKit","Extension","extensions","Bold","Blockquote","BulletList","Code","CodeBlock","Document","Dropcursor","Gapcursor","HardBreak","Heading","UndoRedo","HorizontalRule","Italic","ListItem","ListKeymap","Link","OrderedList","Paragraph","Strike","Text","Underline","TrailingNode","index_default"],"sources":["../../../../../node_modules/@tiptap/starter-kit/dist/index.js"],"sourcesContent":["// src/starter-kit.ts\nimport { Extension } from \"@tiptap/core\";\nimport { Blockquote } from \"@tiptap/extension-blockquote\";\nimport { Bold } from \"@tiptap/extension-bold\";\nimport { Code } from \"@tiptap/extension-code\";\nimport { CodeBlock } from \"@tiptap/extension-code-block\";\nimport { Document } from \"@tiptap/extension-document\";\nimport { HardBreak } from \"@tiptap/extension-hard-break\";\nimport { Heading } from \"@tiptap/extension-heading\";\nimport { HorizontalRule } from \"@tiptap/extension-horizontal-rule\";\nimport { Italic } from \"@tiptap/extension-italic\";\nimport { Link } from \"@tiptap/extension-link\";\nimport { BulletList, ListItem, ListKeymap, OrderedList } from \"@tiptap/extension-list\";\nimport { Paragraph } from \"@tiptap/extension-paragraph\";\nimport { Strike } from \"@tiptap/extension-strike\";\nimport { Text } from \"@tiptap/extension-text\";\nimport { Underline } from \"@tiptap/extension-underline\";\nimport { Dropcursor, Gapcursor, TrailingNode, UndoRedo } from \"@tiptap/extensions\";\nvar StarterKit = Extension.create({\n name: \"starterKit\",\n addExtensions() {\n var _a, _b, _c, _d;\n const extensions = [];\n if (this.options.bold !== false) {\n extensions.push(Bold.configure(this.options.bold));\n }\n if (this.options.blockquote !== false) {\n extensions.push(Blockquote.configure(this.options.blockquote));\n }\n if (this.options.bulletList !== false) {\n extensions.push(BulletList.configure(this.options.bulletList));\n }\n if (this.options.code !== false) {\n extensions.push(Code.configure(this.options.code));\n }\n if (this.options.codeBlock !== false) {\n extensions.push(CodeBlock.configure(this.options.codeBlock));\n }\n if (this.options.document !== false) {\n extensions.push(Document.configure(this.options.document));\n }\n if (this.options.dropcursor !== false) {\n extensions.push(Dropcursor.configure(this.options.dropcursor));\n }\n if (this.options.gapcursor !== false) {\n extensions.push(Gapcursor.configure(this.options.gapcursor));\n }\n if (this.options.hardBreak !== false) {\n extensions.push(HardBreak.configure(this.options.hardBreak));\n }\n if (this.options.heading !== false) {\n extensions.push(Heading.configure(this.options.heading));\n }\n if (this.options.undoRedo !== false) {\n extensions.push(UndoRedo.configure(this.options.undoRedo));\n }\n if (this.options.horizontalRule !== false) {\n extensions.push(HorizontalRule.configure(this.options.horizontalRule));\n }\n if (this.options.italic !== false) {\n extensions.push(Italic.configure(this.options.italic));\n }\n if (this.options.listItem !== false) {\n extensions.push(ListItem.configure(this.options.listItem));\n }\n if (this.options.listKeymap !== false) {\n extensions.push(ListKeymap.configure((_a = this.options) == null ? void 0 : _a.listKeymap));\n }\n if (this.options.link !== false) {\n extensions.push(Link.configure((_b = this.options) == null ? void 0 : _b.link));\n }\n if (this.options.orderedList !== false) {\n extensions.push(OrderedList.configure(this.options.orderedList));\n }\n if (this.options.paragraph !== false) {\n extensions.push(Paragraph.configure(this.options.paragraph));\n }\n if (this.options.strike !== false) {\n extensions.push(Strike.configure(this.options.strike));\n }\n if (this.options.text !== false) {\n extensions.push(Text.configure(this.options.text));\n }\n if (this.options.underline !== false) {\n extensions.push(Underline.configure((_c = this.options) == null ? void 0 : _c.underline));\n }\n if (this.options.trailingNode !== false) {\n extensions.push(TrailingNode.configure((_d = this.options) == null ? void 0 : _d.trailingNode));\n }\n return extensions;\n }\n});\n\n// src/index.ts\nvar index_default = StarterKit;\nexport {\n StarterKit,\n index_default as default\n};\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,IAAIA,IAAaC,EAAU,OAAO;CAChC,MAAM;CACN,gBAAgB;EAEd,IAAMC,IAAa,CAAC;EAmEpB,OAlEI,KAAK,QAAQ,SAAS,MACxBA,EAAW,KAAKC,EAAK,UAAU,KAAK,QAAQ,IAAI,CAAC,GAE/C,KAAK,QAAQ,eAAe,MAC9BD,EAAW,KAAKE,EAAW,UAAU,KAAK,QAAQ,UAAU,CAAC,GAE3D,KAAK,QAAQ,eAAe,MAC9BF,EAAW,KAAKG,EAAW,UAAU,KAAK,QAAQ,UAAU,CAAC,GAE3D,KAAK,QAAQ,SAAS,MACxBH,EAAW,KAAKI,EAAK,UAAU,KAAK,QAAQ,IAAI,CAAC,GAE/C,KAAK,QAAQ,cAAc,MAC7BJ,EAAW,KAAKK,EAAU,UAAU,KAAK,QAAQ,SAAS,CAAC,GAEzD,KAAK,QAAQ,aAAa,MAC5BL,EAAW,KAAKM,EAAS,UAAU,KAAK,QAAQ,QAAQ,CAAC,GAEvD,KAAK,QAAQ,eAAe,MAC9BN,EAAW,KAAKO,EAAW,U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AA+B,SAAS,CAAC,GAEtF,KAAK,QAAQ,iBAAiB,MAChCrB,EAAW,KAAKsB,EAAa,UAAgB,KAAK,SAA+B,YAAY,CAAC,GAEzFtB;CACT;AACF,CAAC,GAGGuB,IAAgBzB"}
1
+ {"version":3,"file":"index.js","names":["StarterKit","Extension","extensions","Bold","Blockquote","BulletList","Code","CodeBlock","Document","Dropcursor","Gapcursor","HardBreak","Heading","UndoRedo","HorizontalRule","Italic","ListItem","ListKeymap","Link","OrderedList","Paragraph","Strike","Text","Underline","TrailingNode","src_default"],"sources":["../../../../../node_modules/@tiptap/starter-kit/dist/index.js"],"sourcesContent":["import { Extension } from \"@tiptap/core\";\nimport { Blockquote } from \"@tiptap/extension-blockquote\";\nimport { Bold } from \"@tiptap/extension-bold\";\nimport { Code } from \"@tiptap/extension-code\";\nimport { CodeBlock } from \"@tiptap/extension-code-block\";\nimport { Document } from \"@tiptap/extension-document\";\nimport { HardBreak } from \"@tiptap/extension-hard-break\";\nimport { Heading } from \"@tiptap/extension-heading\";\nimport { HorizontalRule } from \"@tiptap/extension-horizontal-rule\";\nimport { Italic } from \"@tiptap/extension-italic\";\nimport { Link } from \"@tiptap/extension-link\";\nimport { BulletList, ListItem, ListKeymap, OrderedList } from \"@tiptap/extension-list\";\nimport { Paragraph } from \"@tiptap/extension-paragraph\";\nimport { Strike } from \"@tiptap/extension-strike\";\nimport { Text } from \"@tiptap/extension-text\";\nimport { Underline } from \"@tiptap/extension-underline\";\nimport { Dropcursor, Gapcursor, TrailingNode, UndoRedo } from \"@tiptap/extensions\";\n//#region src/starter-kit.ts\n/**\n* The starter kit is a collection of essential editor extensions.\n*\n* It’s a good starting point for building your own editor.\n*/\nconst StarterKit = Extension.create({\n\tname: \"starterKit\",\n\taddExtensions() {\n\t\tconst extensions = [];\n\t\tif (this.options.bold !== false) extensions.push(Bold.configure(this.options.bold));\n\t\tif (this.options.blockquote !== false) extensions.push(Blockquote.configure(this.options.blockquote));\n\t\tif (this.options.bulletList !== false) extensions.push(BulletList.configure(this.options.bulletList));\n\t\tif (this.options.code !== false) extensions.push(Code.configure(this.options.code));\n\t\tif (this.options.codeBlock !== false) extensions.push(CodeBlock.configure(this.options.codeBlock));\n\t\tif (this.options.document !== false) extensions.push(Document.configure(this.options.document));\n\t\tif (this.options.dropcursor !== false) extensions.push(Dropcursor.configure(this.options.dropcursor));\n\t\tif (this.options.gapcursor !== false) extensions.push(Gapcursor.configure(this.options.gapcursor));\n\t\tif (this.options.hardBreak !== false) extensions.push(HardBreak.configure(this.options.hardBreak));\n\t\tif (this.options.heading !== false) extensions.push(Heading.configure(this.options.heading));\n\t\tif (this.options.undoRedo !== false) extensions.push(UndoRedo.configure(this.options.undoRedo));\n\t\tif (this.options.horizontalRule !== false) extensions.push(HorizontalRule.configure(this.options.horizontalRule));\n\t\tif (this.options.italic !== false) extensions.push(Italic.configure(this.options.italic));\n\t\tif (this.options.listItem !== false) extensions.push(ListItem.configure(this.options.listItem));\n\t\tif (this.options.listKeymap !== false) {\n\t\t\tvar _this$options;\n\t\t\textensions.push(ListKeymap.configure((_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.listKeymap));\n\t\t}\n\t\tif (this.options.link !== false) {\n\t\t\tvar _this$options2;\n\t\t\textensions.push(Link.configure((_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.link));\n\t\t}\n\t\tif (this.options.orderedList !== false) extensions.push(OrderedList.configure(this.options.orderedList));\n\t\tif (this.options.paragraph !== false) extensions.push(Paragraph.configure(this.options.paragraph));\n\t\tif (this.options.strike !== false) extensions.push(Strike.configure(this.options.strike));\n\t\tif (this.options.text !== false) extensions.push(Text.configure(this.options.text));\n\t\tif (this.options.underline !== false) {\n\t\t\tvar _this$options3;\n\t\t\textensions.push(Underline.configure((_this$options3 = this.options) === null || _this$options3 === void 0 ? void 0 : _this$options3.underline));\n\t\t}\n\t\tif (this.options.trailingNode !== false) {\n\t\t\tvar _this$options4;\n\t\t\textensions.push(TrailingNode.configure((_this$options4 = this.options) === null || _this$options4 === void 0 ? void 0 : _this$options4.trailingNode));\n\t\t}\n\t\treturn extensions;\n\t}\n});\n//#endregion\n//#region src/index.ts\nvar src_default = StarterKit;\n//#endregion\nexport { StarterKit, src_default as default };\n\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,IAAMA,IAAaC,EAAU,OAAO;CACnC,MAAM;CACN,gBAAgB;EACf,IAAMC,IAAa,CAAC;EAmCpB,OAlCI,KAAK,QAAQ,SAAS,MAAOA,EAAW,KAAKC,EAAK,UAAU,KAAK,QAAQ,IAAI,CAAC,GAC9E,KAAK,QAAQ,eAAe,MAAOD,EAAW,KAAKE,EAAW,UAAU,KAAK,QAAQ,UAAU,CAAC,GAChG,KAAK,QAAQ,eAAe,MAAOF,EAAW,KAAKG,EAAW,UAAU,KAAK,QAAQ,UAAU,CAAC,GAChG,KAAK,QAAQ,SAAS,MAAOH,EAAW,KAAKI,EAAK,UAAU,KAAK,QAAQ,IAAI,CAAC,GAC9E,KAAK,QAAQ,cAAc,MAAOJ,EAAW,KAAKK,EAAU,UAAU,KAAK,QAAQ,SAAS,CAAC,GAC7F,KAAK,QAAQ,aAAa,MAAOL,EAAW,KAAKM,EAAS,UAAU,KAAK,QAAQ,QAAQ,CAAC,GAC1F,KAAK,QAAQ,eAAe,MAAON,EAAW,KAAKO,EAAW,UAAU,KAAK,QAAQ,UAAU,CAAC,GAChG,KAAK,QAAQ,cAAc,MAAOP,EAAW,KAAKQ,EAAU,UAAU,KAAK,QAAQ,SAAS,CAAC,GAC7F,KAAK,QAAQ,cAAc,MAAOR,EAAW,KAAKS,EAAU,UAAU,KAAK,QAAQ,SAAS,CAAC,GAC7F,KAAK,QAAQ,YAAY,MAAOT,EAAW,KAAKU,EAAQ,UAAU,KAAK,QAAQ,OAAO,CAAC,GACvF,KAAK,QAAQ,aAAa,MAAOV,EAAW,KAAKW,EAAS,UAAU,KAAK,QAAQ,QAAQ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