@burdenoff/microfe-support 2026.1029.2 → 2026.1031.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.
- package/dist/generated/global-operations.js +1 -2
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.js +1 -2
- package/dist/generated/global-types.js.map +1 -1
- package/dist/node_modules/@tiptap/core/dist/index.js +701 -712
- package/dist/node_modules/@tiptap/core/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +1 -2
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +1 -1
- package/dist/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js +1 -2
- package/dist/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +15 -16
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-code/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +25 -26
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-document/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-document/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +16 -17
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-link/dist/index.js +71 -80
- package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-list/dist/index.js +77 -90
- package/dist/node_modules/@tiptap/extension-list/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-text/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-text/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extensions/dist/index.js +112 -113
- package/dist/node_modules/@tiptap/extensions/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/react/dist/index.js +5 -10
- package/dist/node_modules/@tiptap/react/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +1 -1
- package/dist/node_modules/clsx/dist/clsx.js +1 -2
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/dompurify/dist/purify.es.js +357 -347
- package/dist/node_modules/dompurify/dist/purify.es.js.map +1 -1
- package/dist/node_modules/fast-equals/dist/es/index.js +1 -2
- package/dist/node_modules/fast-equals/dist/es/index.js.map +1 -1
- package/dist/node_modules/linkifyjs/dist/linkify.js +1 -2
- package/dist/node_modules/linkifyjs/dist/linkify.js.map +1 -1
- package/dist/node_modules/marked/lib/marked.esm.js +10 -70
- package/dist/node_modules/marked/lib/marked.esm.js.map +1 -1
- package/dist/node_modules/orderedmap/dist/index.js +1 -2
- package/dist/node_modules/orderedmap/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-commands/dist/index.js +107 -108
- package/dist/node_modules/prosemirror-commands/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js +12 -13
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js +42 -47
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-history/dist/index.js +47 -49
- package/dist/node_modules/prosemirror-history/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-keymap/dist/index.js +15 -16
- package/dist/node_modules/prosemirror-keymap/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-model/dist/index.js +37 -41
- package/dist/node_modules/prosemirror-model/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-schema-list/dist/index.js +36 -37
- package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-state/dist/index.js +1 -2
- package/dist/node_modules/prosemirror-state/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-transform/dist/index.js +1 -2
- package/dist/node_modules/prosemirror-transform/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-view/dist/index.js +302 -304
- package/dist/node_modules/prosemirror-view/dist/index.js.map +1 -1
- package/dist/node_modules/rope-sequence/dist/index.js +1 -2
- package/dist/node_modules/rope-sequence/dist/index.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +4 -21
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/node_modules/w3c-keyname/index.js +0 -1
- package/dist/node_modules/w3c-keyname/index.js.map +1 -1
- package/dist/support/SupportAdminRoot.js +14 -15
- package/dist/support/SupportAdminRoot.js.map +1 -1
- package/dist/support/SupportAdminRoutes.js +5 -6
- package/dist/support/SupportAdminRoutes.js.map +1 -1
- package/dist/support/SupportUserRoot.js +10 -11
- package/dist/support/SupportUserRoot.js.map +1 -1
- package/dist/support/SupportUserRoutes.js +1 -2
- package/dist/support/SupportUserRoutes.js.map +1 -1
- package/dist/support/components/NotificationToast.js +1 -2
- package/dist/support/components/NotificationToast.js.map +1 -1
- package/dist/support/components/PageLayout.js +15 -16
- package/dist/support/components/PageLayout.js.map +1 -1
- package/dist/support/components/RouteHelpers.js +1 -2
- package/dist/support/components/RouteHelpers.js.map +1 -1
- package/dist/support/components/analytics/CategoryBreakdown.js +9 -10
- package/dist/support/components/analytics/CategoryBreakdown.js.map +1 -1
- package/dist/support/components/analytics/MetricCard.js +1 -2
- package/dist/support/components/analytics/MetricCard.js.map +1 -1
- package/dist/support/components/analytics/PriorityBreakdown.js +9 -10
- package/dist/support/components/analytics/PriorityBreakdown.js.map +1 -1
- package/dist/support/components/analytics/SLAReport.js +5 -6
- package/dist/support/components/analytics/SLAReport.js.map +1 -1
- package/dist/support/components/analytics/SatisfactionDistribution.js +5 -6
- package/dist/support/components/analytics/SatisfactionDistribution.js.map +1 -1
- package/dist/support/components/analytics/TopAgents.js +5 -6
- package/dist/support/components/analytics/TopAgents.js.map +1 -1
- package/dist/support/components/analytics/TrendChart.js +5 -6
- package/dist/support/components/analytics/TrendChart.js.map +1 -1
- package/dist/support/components/careers/BulkCandidateActionGuidance.js +1 -2
- package/dist/support/components/careers/BulkCandidateActionGuidance.js.map +1 -1
- package/dist/support/components/careers/BulkCandidateDialogs.js +321 -322
- package/dist/support/components/careers/BulkCandidateDialogs.js.map +1 -1
- package/dist/support/components/careers/BulkOperationFeedback.js +1 -2
- package/dist/support/components/careers/BulkOperationFeedback.js.map +1 -1
- package/dist/support/components/careers/BulkSelectionSummary.js +1 -2
- package/dist/support/components/careers/BulkSelectionSummary.js.map +1 -1
- package/dist/support/components/careers/JobApplicationFilterContextGuard.js +1 -2
- package/dist/support/components/careers/JobApplicationFilterContextGuard.js.map +1 -1
- package/dist/support/components/careers/RichTextEditor.js +17 -18
- package/dist/support/components/careers/RichTextEditor.js.map +1 -1
- package/dist/support/components/kb/ArticleForm.js +10 -11
- package/dist/support/components/kb/ArticleForm.js.map +1 -1
- package/dist/support/components/settings/CannedResponsesSettings.js +2 -3
- package/dist/support/components/settings/CannedResponsesSettings.js.map +1 -1
- package/dist/support/components/settings/SLAPoliciesSettings.js +1 -2
- package/dist/support/components/settings/SLAPoliciesSettings.js.map +1 -1
- package/dist/support/components/settings/TicketCategoriesSettings.js +3 -8
- package/dist/support/components/settings/TicketCategoriesSettings.js.map +1 -1
- package/dist/support/components/tickets/AttachmentList.js +4 -5
- package/dist/support/components/tickets/AttachmentList.js.map +1 -1
- package/dist/support/components/tickets/MarkdownContent.js +1 -2
- package/dist/support/components/tickets/MarkdownContent.js.map +1 -1
- package/dist/support/components/tickets/MessageComposer.js +1 -2
- package/dist/support/components/tickets/MessageComposer.js.map +1 -1
- package/dist/support/components/tickets/MessageThread.js +13 -14
- package/dist/support/components/tickets/MessageThread.js.map +1 -1
- package/dist/support/components/tickets/TicketDetailHeader.js +13 -14
- package/dist/support/components/tickets/TicketDetailHeader.js.map +1 -1
- package/dist/support/components/tickets/TicketHeader.js +1 -2
- package/dist/support/components/tickets/TicketHeader.js.map +1 -1
- package/dist/support/components/tickets/TicketSidebar.js +6 -7
- package/dist/support/components/tickets/TicketSidebar.js.map +1 -1
- package/dist/support/components/tickets/TriagePanel.js +25 -26
- package/dist/support/components/tickets/TriagePanel.js.map +1 -1
- package/dist/support/components/ui.js +1 -2
- package/dist/support/constants/pipeline.js +1 -2
- package/dist/support/constants/pipeline.js.map +1 -1
- package/dist/support/constants.js +1 -2
- package/dist/support/constants.js.map +1 -1
- package/dist/support/events/rybbit.js +1 -2
- package/dist/support/events/rybbit.js.map +1 -1
- package/dist/support/hooks/index.js +6 -6
- package/dist/support/hooks/useAnalyticsOperations.js +1 -2
- package/dist/support/hooks/useAnalyticsOperations.js.map +1 -1
- package/dist/support/hooks/useAttachmentsFailedToast.js +1 -2
- package/dist/support/hooks/useAttachmentsFailedToast.js.map +1 -1
- package/dist/support/hooks/useChatOperations.js +14 -15
- package/dist/support/hooks/useChatOperations.js.map +1 -1
- package/dist/support/hooks/useDebouncedUrlText.js +1 -2
- package/dist/support/hooks/useDebouncedUrlText.js.map +1 -1
- package/dist/support/hooks/useKnowledgeBaseOperations.js +62 -63
- package/dist/support/hooks/useKnowledgeBaseOperations.js.map +1 -1
- package/dist/support/hooks/useNotification.js +1 -2
- package/dist/support/hooks/useNotification.js.map +1 -1
- package/dist/support/hooks/useRegisterFooter.js +1 -2
- package/dist/support/hooks/useRegisterFooter.js.map +1 -1
- package/dist/support/hooks/useSettingsOperations.js +1 -2
- package/dist/support/hooks/useSettingsOperations.js.map +1 -1
- package/dist/support/hooks/useSupportAttachments.js +1 -2
- package/dist/support/hooks/useSupportAttachments.js.map +1 -1
- package/dist/support/hooks/useTicketListOperations.js +9 -10
- package/dist/support/hooks/useTicketListOperations.js.map +1 -1
- package/dist/support/hooks/useTicketOperations.d.ts +8 -0
- package/dist/support/hooks/useTicketOperations.js +92 -93
- package/dist/support/hooks/useTicketOperations.js.map +1 -1
- package/dist/support/hooks/useTr.js +1 -2
- package/dist/support/hooks/useTr.js.map +1 -1
- package/dist/support/index.js +4 -4
- package/dist/support/pages/AnalyticsPage.js +34 -35
- package/dist/support/pages/AnalyticsPage.js.map +1 -1
- package/dist/support/pages/ArticleDetailAdminPage.js +33 -38
- package/dist/support/pages/ArticleDetailAdminPage.js.map +1 -1
- package/dist/support/pages/ArticleDetailUserPage.js +22 -23
- package/dist/support/pages/ArticleDetailUserPage.js.map +1 -1
- package/dist/support/pages/ContactInquiriesPage.js +5 -6
- package/dist/support/pages/ContactInquiriesPage.js.map +1 -1
- package/dist/support/pages/ContactInquiryDetailPage.js +13 -14
- package/dist/support/pages/ContactInquiryDetailPage.js.map +1 -1
- package/dist/support/pages/CreateArticlePage.js +15 -16
- package/dist/support/pages/CreateArticlePage.js.map +1 -1
- package/dist/support/pages/CreateTicketPage.js +37 -44
- package/dist/support/pages/CreateTicketPage.js.map +1 -1
- package/dist/support/pages/EditArticlePage.js +20 -21
- package/dist/support/pages/EditArticlePage.js.map +1 -1
- package/dist/support/pages/InterviewersPage.js +121 -122
- package/dist/support/pages/InterviewersPage.js.map +1 -1
- package/dist/support/pages/JobApplicationDetailPage.js +322 -332
- package/dist/support/pages/JobApplicationDetailPage.js.map +1 -1
- package/dist/support/pages/JobApplicationsPage.js +556 -561
- package/dist/support/pages/JobApplicationsPage.js.map +1 -1
- package/dist/support/pages/JobPostingDetailPage.js +489 -490
- package/dist/support/pages/JobPostingDetailPage.js.map +1 -1
- package/dist/support/pages/JobPostingsPage.js +279 -280
- package/dist/support/pages/JobPostingsPage.js.map +1 -1
- package/dist/support/pages/KnowledgeBaseAdminPage.js +26 -27
- package/dist/support/pages/KnowledgeBaseAdminPage.js.map +1 -1
- package/dist/support/pages/KnowledgeBaseUserPage.js +23 -24
- package/dist/support/pages/KnowledgeBaseUserPage.js.map +1 -1
- package/dist/support/pages/SettingsPage.js +43 -44
- package/dist/support/pages/SettingsPage.js.map +1 -1
- package/dist/support/pages/TicketDetailAdminPage.js +54 -55
- package/dist/support/pages/TicketDetailAdminPage.js.map +1 -1
- package/dist/support/pages/TicketDetailUserPage.js +61 -62
- package/dist/support/pages/TicketDetailUserPage.js.map +1 -1
- package/dist/support/pages/TicketListPage.js +77 -78
- package/dist/support/pages/TicketListPage.js.map +1 -1
- package/dist/support/providers/SupportProvider.js +1 -2
- package/dist/support/providers/SupportProvider.js.map +1 -1
- package/dist/support/store/supportStore.js +1 -2
- package/dist/support/store/supportStore.js.map +1 -1
- package/dist/support/translations/en.js +1 -2
- package/dist/support/translations/en.js.map +1 -1
- package/dist/support/utils/attachments.js +1 -2
- package/dist/support/utils/attachments.js.map +1 -1
- package/dist/support/utils/breadcrumbRegistry.js +3 -4
- package/dist/support/utils/breadcrumbRegistry.js.map +1 -1
- package/dist/support/utils/bulkCandidateOperations.js +0 -1
- package/dist/support/utils/bulkCandidateOperations.js.map +1 -1
- package/dist/support/utils/bulkCandidateTargetQuery.js +1 -2
- package/dist/support/utils/bulkCandidateTargetQuery.js.map +1 -1
- package/dist/support/utils/categoryColors.js +1 -2
- package/dist/support/utils/categoryColors.js.map +1 -1
- package/dist/support/utils/cn.js +1 -2
- package/dist/support/utils/cn.js.map +1 -1
- package/dist/support/utils/context.js +3 -4
- package/dist/support/utils/context.js.map +1 -1
- package/dist/support/utils/errors.js +1 -2
- package/dist/support/utils/errors.js.map +1 -1
- package/dist/support/utils/i18n.js +1 -2
- package/dist/support/utils/i18n.js.map +1 -1
- package/dist/support/utils/index.js +1 -2
- package/dist/support/utils/index.js.map +1 -1
- package/dist/support/utils/jobApplicationFilterParams.js +1 -2
- package/dist/support/utils/jobApplicationFilterParams.js.map +1 -1
- package/dist/support/utils/markdown.js +1 -2
- package/dist/support/utils/markdown.js.map +1 -1
- package/dist/support/utils/supportFiles.js +2 -11
- package/dist/support/utils/supportFiles.js.map +1 -1
- package/dist/support/utils/ticketFilters.js +1 -2
- package/dist/support/utils/ticketFilters.js.map +1 -1
- package/dist/support/utils/uiTokens.js +1 -2
- package/dist/support/utils/uiTokens.js.map +1 -1
- package/dist/utils/nativeBridge.js +1 -2
- package/package.json +21 -14
|
@@ -6,7 +6,7 @@ import { Fragment as R, jsx as z, jsxs as ft } from "react/jsx-runtime";
|
|
|
6
6
|
import pt from "react-dom";
|
|
7
7
|
import { useSyncExternalStore as B } from "use-sync-external-store/shim/index.js";
|
|
8
8
|
import { useSyncExternalStoreWithSelector as mt } from "use-sync-external-store/shim/with-selector.js";
|
|
9
|
-
|
|
9
|
+
// node_modules/@tiptap/react/dist/index.js
|
|
10
10
|
var ht = (...e) => (t) => {
|
|
11
11
|
e.forEach((e) => {
|
|
12
12
|
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
@@ -17,7 +17,7 @@ var ht = (...e) => (t) => {
|
|
|
17
17
|
};
|
|
18
18
|
function V() {
|
|
19
19
|
let e = /* @__PURE__ */ new Set(), t = {}, n = !1, r = () => {
|
|
20
|
-
n
|
|
20
|
+
!n && e.size && (n = !0, queueMicrotask(() => {
|
|
21
21
|
n = !1, e.forEach((e) => e());
|
|
22
22
|
}));
|
|
23
23
|
};
|
|
@@ -96,10 +96,10 @@ var H = class extends j.Component {
|
|
|
96
96
|
}, this.getSnapshot = this.getSnapshot.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.watch = this.watch.bind(this), this.subscribe = this.subscribe.bind(this);
|
|
97
97
|
}
|
|
98
98
|
getSnapshot() {
|
|
99
|
-
return this.transactionNumber === this.lastTransactionNumber
|
|
99
|
+
return this.transactionNumber === this.lastTransactionNumber || (this.lastTransactionNumber = this.transactionNumber, this.lastSnapshot = {
|
|
100
100
|
editor: this.editor,
|
|
101
101
|
transactionNumber: this.transactionNumber
|
|
102
|
-
}, this.lastSnapshot
|
|
102
|
+
}), this.lastSnapshot;
|
|
103
103
|
}
|
|
104
104
|
getServerSnapshot() {
|
|
105
105
|
return {
|
|
@@ -247,11 +247,7 @@ var G = process.env.NODE_ENV !== "production", K = typeof window > "u", bt = K |
|
|
|
247
247
|
scheduleDestroy() {
|
|
248
248
|
let e = this.instanceId, t = this.editor;
|
|
249
249
|
this.scheduledDestructionTimeout = setTimeout(() => {
|
|
250
|
-
|
|
251
|
-
t && t.setOptions(this.options.current);
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
t && !t.isDestroyed && (t.destroy(), this.instanceId === e && this.setEditor(null));
|
|
250
|
+
this.isComponentMounted && this.instanceId === e ? t && t.setOptions(this.options.current) : t && !t.isDestroyed && (t.destroy(), this.instanceId === e && this.setEditor(null));
|
|
255
251
|
}, 1);
|
|
256
252
|
}
|
|
257
253
|
};
|
|
@@ -310,7 +306,6 @@ function $({ ...e }) {
|
|
|
310
306
|
});
|
|
311
307
|
}
|
|
312
308
|
$.displayName = "Tiptap.Content", Object.assign(Q, { Content: $ });
|
|
313
|
-
//#endregion
|
|
314
309
|
export { e as CommandManager, t as DECORATION_MANAGER_PLUGIN_KEY, n as DecorationManager, r as Editor, U as EditorContent, q as EditorContext, i as Extendable, ee as Extension, te as InputRule, ne as MappablePosition, re as Mark, ie as Node, ae as NodePos, oe as PasteRule, H as PureEditorContent, J as ReactNodeViewContext, $ as TiptapContent, X as TiptapContext, Q as TiptapWrapper, se as callOrReturn, ce as canInsertNode, le as combineTransactionSteps, ue as commands, de as createChainableState, V as createContentComponent, fe as createDocument, pe as createMappablePosition, me as createNodeFromContent, he as createStyleTag, ge as defaultBlockAt, _e as deleteProps, ve as elementFromString, ye as findChildrenInRange, be as findDuplicates, xe as findParentNode, Se as findParentNodeClosestToPos, Ce as flattenExtensions, we as fromString, a as getAttributes, o as getAttributesFromExtensions, s as getChangedRanges, c as getExtensionField, l as getHTMLFromFragment, u as getMarkAttributes, d as getMarkRange, f as getMarkType, p as getMarksBetween, m as getNodeAtPosition, h as getNodeAttributes, g as getNodeType, _ as getPreviousBlockSibling, v as getRenderedAttributes, y as getSchemaByResolvedExtensions, b as getSchemaTypeByName, x as getSchemaTypeNameByName, S as getSplittedAttributes, C as getText, w as getTextBetween, T as getTextContentFromNodes, E as getTextSerializersFromSchema, D as getUpdatedPosition, O as injectExtensionAttributesToParseRule, k as inputRulesPlugin, Te as isActive, Ee as isAndroid, De as isAtEndOfNode, Oe as isAtStartOfNode, ke as isEmptyObject, Ae as isExtensionRulesEnabled, je as isFunction, Me as isList, Ne as isMacOS, Pe as isMarkActive, Fe as isNodeActive, Ie as isNodeEmpty, Le as isNodeSelection, Re as isNumber, ze as isPlainObject, Be as isRegExp, Ve as isSafari, A as isTextSelection, He as isiOS, Ue as markInputRule, We as markPasteRule, Ge as mergeAttributes, Ke as mergeDeep, qe as minMax, Je as nodeInputRule, Ye as objectIncludes, Xe as parseIndentedBlocks, Ze as pasteRulesPlugin, Qe as removeDuplicates, $e as renderNestedMarkdownContent, et as resolveExtensions, tt as resolveFocusPosition, nt as selectionToInsertionEnd, rt as sortExtensions, it as splitExtensions, at as textblockTypeInputRule, ot as updateMarkViewAttributes, St as useEditor, W as useEditorState, Y as useReactNodeView, Z as useTiptap, st as wrappingInputRule };
|
|
315
310
|
|
|
316
311
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useState2","useSyncExternalStore2","createContext2","useContext2","React3","React4","createContext3","useContext3","useMemo2"],"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"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;AAUA,IAAI,MAAa,GAAG,OACV,MAAS;CACf,EAAK,SAAS,MAAQ;EACpB,AAAI,OAAO,KAAQ,aACjB,EAAI,CAAI,IACC,MAET,EAAI,UAAU;CAElB,CAAC;AACH,GAEE,MAAW,EAAE,0BAAuB;CACtC,IAAM,IAAY,EAChB,EAAiB,WACjB,EAAiB,aACjB,EAAiB,iBACnB;CACA,OAAuB,kBAAI,GAAU,EAAE,UAAU,OAAO,OAAO,CAAS,EAAE,CAAC;AAC7E;AACA,SAAS,IAAyB;CAChC,IAAM,oBAA8B,IAAI,IAAI,GACxC,IAAY,CAAC,GACb,IAAuB,IACrB,UAA0B;EAC1B,KAAwB,CAAC,EAAY,SAGzC,IAAuB,IACvB,qBAAqB;GAEnB,AADA,IAAuB,IACvB,EAAY,SAAS,MAAe,EAAW,CAAC;EAClD,CAAC;CACH;CACA,OAAO;EAIL,UAAU,GAAU;GAElB,OADA,EAAY,IAAI,CAAQ,SACX;IACX,EAAY,OAAO,CAAQ;GAC7B;EACF;EACA,cAAc;GACZ,OAAO;EACT;EACA,oB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AAc,cAAc;AAC5B,IAAI,UAAkBC,EAAY,CAAa;AAS/C,SAAS,EAAc,EAAE,aAAU,GAAG,KAAS;CAC7C,IAAM,IAAiB,YAAY,IAAQ,EAAM,SAAS,EAAM;CAChE,IAAI,CAAC,GACH,MAAU,MAAM,wEAAwE;CAE1F,IAAM,IAAqBC,SAClB,EAAE,QAAQ,EAAe,IAChC,CAAC,CAAc,CACjB,GACM,IAAqBA,SAAgB,EAAE,QAAQ,EAAe,IAAI,CAAC,CAAc,CAAC;CACxF,OAAuB,kBAAK,EAAc,UAAU;EAAE,OAAO;EAAoB,UAA0B,kBAAK,EAAc,UAAU;GAAE,OAAO;GAAoB;EAAS,CAAC;CAAE,CAAC;AACpL;AACA,EAAc,cAAc;AAC5B,SAAS,EAAc,EAAE,GAAG,KAAQ;CAClC,IAAM,EAAE,cAAW,EAAU;CAC7B,OAAuB,kBAAK,GAAe;EAAE;EAAQ,GAAG;CAAK,CAAC;AAChE;AACA,EAAc,cAAc,kBACf,OAAO,OAAO,GAAe,EAKxC,SAAS,EACX,CAAC"}
|
|
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,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,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"}
|
|
@@ -15,7 +15,7 @@ import { Strike as g } from "../../extension-strike/dist/index.js";
|
|
|
15
15
|
import { Text as _ } from "../../extension-text/dist/index.js";
|
|
16
16
|
import { Underline as v } from "../../extension-underline/dist/index.js";
|
|
17
17
|
import { Dropcursor as y, Gapcursor as b, TrailingNode as x, UndoRedo as S } from "../../extensions/dist/index.js";
|
|
18
|
-
|
|
18
|
+
// node_modules/@tiptap/starter-kit/dist/index.js
|
|
19
19
|
var C = e.create({
|
|
20
20
|
name: "starterKit",
|
|
21
21
|
addExtensions() {
|
|
@@ -23,7 +23,6 @@ var C = e.create({
|
|
|
23
23
|
return this.options.bold !== !1 && e.push(n.configure(this.options.bold)), this.options.blockquote !== !1 && e.push(t.configure(this.options.blockquote)), this.options.bulletList !== !1 && e.push(d.configure(this.options.bulletList)), this.options.code !== !1 && e.push(r.configure(this.options.code)), this.options.codeBlock !== !1 && e.push(i.configure(this.options.codeBlock)), this.options.document !== !1 && e.push(a.configure(this.options.document)), this.options.dropcursor !== !1 && e.push(y.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && e.push(b.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && e.push(o.configure(this.options.hardBreak)), this.options.heading !== !1 && e.push(s.configure(this.options.heading)), this.options.undoRedo !== !1 && e.push(S.configure(this.options.undoRedo)), this.options.horizontalRule !== !1 && e.push(c.configure(this.options.horizontalRule)), this.options.italic !== !1 && e.push(l.configure(this.options.italic)), this.options.listItem !== !1 && e.push(f.configure(this.options.listItem)), this.options.listKeymap !== !1 && e.push(p.configure(this.options?.listKeymap)), this.options.link !== !1 && e.push(u.configure(this.options?.link)), this.options.orderedList !== !1 && e.push(m.configure(this.options.orderedList)), this.options.paragraph !== !1 && e.push(h.configure(this.options.paragraph)), this.options.strike !== !1 && e.push(g.configure(this.options.strike)), this.options.text !== !1 && e.push(_.configure(this.options.text)), this.options.underline !== !1 && e.push(v.configure(this.options?.underline)), this.options.trailingNode !== !1 && e.push(x.configure(this.options?.trailingNode)), e;
|
|
24
24
|
}
|
|
25
25
|
}), w = C;
|
|
26
|
-
//#endregion
|
|
27
26
|
export { C as StarterKit, w as default };
|
|
28
27
|
|
|
29
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"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"],"
|
|
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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M,CAAC,GAEnD,KAAK,QAAQ,aAAa,MAC5Bb,EAAW,KAAKc,EAAS,UAAU,KAAK,QAAQ,QAAQ,CAAC,GAEvD,KAAK,QAAQ,eAAe,MAC9Bd,EAAW,KAAKe,EAAW,UAAgB,KAAK,SAA+B,UAAU,CAAC,GAExF,KAAK,QAAQ,SAAS,MACxBf,EAAW,KAAKgB,EAAK,UAAgB,KAAK,SAA+B,IAAI,CAAC,GAE5E,KAAK,QAAQ,gBAAgB,MAC/BhB,EAAW,KAAKiB,EAAY,UAAU,KAAK,QAAQ,WAAW,CAAC,GAE7D,KAAK,QAAQ,cAAc,MAC7BjB,EAAW,KAAKkB,EAAU,UAAU,KAAK,QAAQ,SAAS,CAAC,GAEzD,KAAK,QAAQ,WAAW,MAC1BlB,EAAW,KAAKmB,EAAO,UAAU,KAAK,QAAQ,MAAM,CAAC,GAEnD,KAAK,QAAQ,SAAS,MACxBnB,EAAW,KAAKoB,EAAK,UAAU,KAAK,QAAQ,IAAI,CAAC,GAE/C,KAAK,QAAQ,cAAc,MAC7BpB,EAAW,KAAKqB,EAAU,UAAgB,KAAK,SAA+B,SAAS,CAAC,GAEtF,KAAK,QAAQ,iBAAiB,MAChCrB,EAAW,KAAKsB,EAAa,UAAgB,KAAK,SAA+B,YAAY,CAAC,GAEzFtB;CACT;AACF,CAAC,GAGGuB,IAAgBzB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// node_modules/clsx/dist/clsx.mjs
|
|
2
2
|
function e(t) {
|
|
3
3
|
var n, r, i = "";
|
|
4
4
|
if (typeof t == "string" || typeof t == "number") i += t;
|
|
@@ -14,7 +14,6 @@ function t() {
|
|
|
14
14
|
for (var t, n, r = 0, i = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (n = e(t)) && (i && (i += " "), i += n);
|
|
15
15
|
return i;
|
|
16
16
|
}
|
|
17
|
-
//#endregion
|
|
18
17
|
export { t as clsx, t as default };
|
|
19
18
|
|
|
20
19
|
//# sourceMappingURL=clsx.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clsx.js","names":[],"sources":["../../../../node_modules/clsx/dist/clsx.mjs"],"sourcesContent":["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;"],"
|
|
1
|
+
{"version":3,"file":"clsx.js","names":["r","t","f","n","e","o","clsx"],"sources":["../../../../node_modules/clsx/dist/clsx.mjs"],"sourcesContent":["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;"],"ignoreList":[0],"mappings":";AAAA,SAASA,EAAE,GAAE;CAAC,IAAIC,GAAEC,GAAEC,IAAE;CAAG,IAAa,OAAOC,KAAjB,YAA8B,OAAOA,KAAjB,UAAmB,KAAGA;MAAO,IAAa,OAAOA,KAAjB,UAAmB;MAAG,MAAM,QAAQA,CAAC,GAAE;GAAC,IAAIC,IAAED,EAAE;GAAO,KAAI,IAAE,GAAEH,IAAEI,GAAE,KAAI,EAAEJ,OAAK,IAAED,EAAEI,EAAEH,EAAE,OAAKE,MAAI,KAAG,MAAK,KAAGD;EAAE,OAAM,KAAIA,KAAKE,GAAE,EAAEF,OAAKC,MAAI,KAAG,MAAK,KAAGD;CAAA;CAAG,OAAOC;AAAC;AAAC,SAAgBG,IAAM;CAAC,KAAI,IAAIF,GAAEH,GAAEC,IAAE,GAAEC,IAAE,IAAGE,IAAE,UAAU,QAAOH,IAAEG,GAAE,KAAI,CAAC,IAAE,UAAUH,QAAM,IAAEF,EAAEI,CAAC,OAAKD,MAAI,KAAG,MAAK,KAAGF;CAAG,OAAOE;AAAC"}
|