@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js
|
|
2
2
|
var e = /* @__PURE__ */ new WeakSet(), t = /* @__PURE__ */ new WeakSet();
|
|
3
3
|
function n(t) {
|
|
4
4
|
let n = t;
|
|
@@ -39,7 +39,6 @@ function a(e, a) {
|
|
|
39
39
|
]);
|
|
40
40
|
}
|
|
41
41
|
var o = (e, t) => a(e, t);
|
|
42
|
-
//#endregion
|
|
43
42
|
export { o as createElement, o as h, o as jsx };
|
|
44
43
|
|
|
45
44
|
//# sourceMappingURL=jsx-runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx-runtime.js","names":[],"sources":["../../../../../../node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js"],"sourcesContent":["//#region src/jsx-runtime.ts\nconst jsxElements = /* @__PURE__ */ new WeakSet();\nconst jsxFragments = /* @__PURE__ */ new WeakSet();\n/** Create a new JSX element from the given spec */\nfunction createJSXElement(spec) {\n\tconst element = spec;\n\tjsxElements.add(element);\n\treturn element;\n}\n/** Check if a spec is a JSX element */\nfunction isJSXElement(value) {\n\treturn Array.isArray(value) && jsxElements.has(value);\n}\nfunction flattenFragmentChildren(children) {\n\treturn children.flatMap((child) => {\n\t\tif (child == null) return [];\n\t\tif (Array.isArray(child) && jsxFragments.has(child) && !isJSXElement(child)) return flattenFragmentChildren(child);\n\t\treturn [child];\n\t});\n}\nfunction Fragment(props) {\n\tjsxFragments.add(props.children);\n\treturn props.children;\n}\nfunction render(tag, attributes) {\n\tif (tag === \"slot\") return 0;\n\tif (tag instanceof Function) {\n\t\tconst result = tag(attributes);\n\t\tif (Array.isArray(result) && !isJSXElement(result) && !jsxFragments.has(result)) return createJSXElement(result);\n\t\treturn result;\n\t}\n\tconst { children, ...rest } = attributes !== null && attributes !== void 0 ? attributes : {};\n\tif (tag === \"svg\") throw new Error(\"SVG elements are not supported in the JSX syntax, use the array syntax instead\");\n\tif (Array.isArray(children)) {\n\t\tif (isJSXElement(children)) return createJSXElement([\n\t\t\ttag,\n\t\t\trest,\n\t\t\tchildren\n\t\t]);\n\t\tif (children.length === 0) return createJSXElement([tag, rest]);\n\t\tconst flattenedChildren = flattenFragmentChildren(children);\n\t\tif (flattenedChildren.length === 0) return createJSXElement([tag, rest]);\n\t\treturn createJSXElement([\n\t\t\ttag,\n\t\t\trest,\n\t\t\t...flattenedChildren\n\t\t]);\n\t}\n\tif (children !== void 0 && children !== null) return createJSXElement([\n\t\ttag,\n\t\trest,\n\t\tchildren\n\t]);\n\treturn createJSXElement([tag, rest]);\n}\nconst h = (tag, attributes) => render(tag, attributes);\nconst jsxs = (tag, attributes) => render(tag, attributes);\nconst jsxDEV = (tag, attributes, _key, _isStaticChildren) => {\n\treturn render(tag, attributes);\n};\n//#endregion\nexport { Fragment, h as createElement, h, h as jsx, jsxDEV, jsxs };\n\n//# sourceMappingURL=jsx-runtime.js.map"],"
|
|
1
|
+
{"version":3,"file":"jsx-runtime.js","names":["jsxElements","jsxFragments","createJSXElement","element","spec","isJSXElement","value","flattenFragmentChildren","children","child","render","tag","result","attributes","rest","flattenedChildren","h"],"sources":["../../../../../../node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js"],"sourcesContent":["//#region src/jsx-runtime.ts\nconst jsxElements = /* @__PURE__ */ new WeakSet();\nconst jsxFragments = /* @__PURE__ */ new WeakSet();\n/** Create a new JSX element from the given spec */\nfunction createJSXElement(spec) {\n\tconst element = spec;\n\tjsxElements.add(element);\n\treturn element;\n}\n/** Check if a spec is a JSX element */\nfunction isJSXElement(value) {\n\treturn Array.isArray(value) && jsxElements.has(value);\n}\nfunction flattenFragmentChildren(children) {\n\treturn children.flatMap((child) => {\n\t\tif (child == null) return [];\n\t\tif (Array.isArray(child) && jsxFragments.has(child) && !isJSXElement(child)) return flattenFragmentChildren(child);\n\t\treturn [child];\n\t});\n}\nfunction Fragment(props) {\n\tjsxFragments.add(props.children);\n\treturn props.children;\n}\nfunction render(tag, attributes) {\n\tif (tag === \"slot\") return 0;\n\tif (tag instanceof Function) {\n\t\tconst result = tag(attributes);\n\t\tif (Array.isArray(result) && !isJSXElement(result) && !jsxFragments.has(result)) return createJSXElement(result);\n\t\treturn result;\n\t}\n\tconst { children, ...rest } = attributes !== null && attributes !== void 0 ? attributes : {};\n\tif (tag === \"svg\") throw new Error(\"SVG elements are not supported in the JSX syntax, use the array syntax instead\");\n\tif (Array.isArray(children)) {\n\t\tif (isJSXElement(children)) return createJSXElement([\n\t\t\ttag,\n\t\t\trest,\n\t\t\tchildren\n\t\t]);\n\t\tif (children.length === 0) return createJSXElement([tag, rest]);\n\t\tconst flattenedChildren = flattenFragmentChildren(children);\n\t\tif (flattenedChildren.length === 0) return createJSXElement([tag, rest]);\n\t\treturn createJSXElement([\n\t\t\ttag,\n\t\t\trest,\n\t\t\t...flattenedChildren\n\t\t]);\n\t}\n\tif (children !== void 0 && children !== null) return createJSXElement([\n\t\ttag,\n\t\trest,\n\t\tchildren\n\t]);\n\treturn createJSXElement([tag, rest]);\n}\nconst h = (tag, attributes) => render(tag, attributes);\nconst jsxs = (tag, attributes) => render(tag, attributes);\nconst jsxDEV = (tag, attributes, _key, _isStaticChildren) => {\n\treturn render(tag, attributes);\n};\n//#endregion\nexport { Fragment, h as createElement, h, h as jsx, jsxDEV, jsxs };\n\n//# sourceMappingURL=jsx-runtime.js.map"],"ignoreList":[0],"mappings":";AACA,IAAMA,oBAA8B,IAAI,QAAQ,GAC1CC,oBAA+B,IAAI,QAAQ;AAEjD,SAASC,EAAiB,GAAM;CAC/B,IAAMC,IAAUC;CAEhB,OADAJ,EAAY,IAAIG,CAAO,GAChBA;AACR;AAEA,SAASE,EAAa,GAAO;CAC5B,OAAO,MAAM,QAAQC,CAAK,KAAKN,EAAY,IAAIM,CAAK;AACrD;AACA,SAASC,EAAwB,GAAU;CAC1C,OAAOC,EAAS,SAAS,MACpBC,KAAS,OAAa,CAAC,IACvB,MAAM,QAAQA,CAAK,KAAKR,EAAa,IAAIQ,CAAK,KAAK,CAACJ,EAAaI,CAAK,IAAUF,EAAwBE,CAAK,IAC1G,CAACA,CAAK,CACb;AACF;AAKA,SAASC,EAAO,GAAK,GAAY;CAChC,IAAIC,MAAQ,QAAQ,OAAO;CAC3B,IAAIA,aAAe,UAAU;EAC5B,IAAMC,IAASD,EAAIE,CAAU;EAE7B,OADI,MAAM,QAAQD,CAAM,KAAK,CAACP,EAAaO,CAAM,KAAK,CAACX,EAAa,IAAIW,CAAM,IAAUV,EAAiBU,CAAM,IACxGA;CACR;CACA,IAAM,EAAE,aAAU,GAAGE,MAASD,KAA4D,CAAC;CAC3F,IAAIF,MAAQ,OAAO,MAAU,MAAM,gFAAgF;CACnH,IAAI,MAAM,QAAQH,CAAQ,GAAG;EAC5B,IAAIH,EAAaG,CAAQ,GAAG,OAAON,EAAiB;GACnDS;GACAG;GACAN;EACD,CAAC;EACD,IAAIA,EAAS,WAAW,GAAG,OAAON,EAAiB,CAACS,GAAKG,CAAI,CAAC;EAC9D,IAAMC,IAAoBR,EAAwBC,CAAQ;EAE1D,OADIO,EAAkB,WAAW,IAAUb,EAAiB,CAACS,GAAKG,CAAI,CAAC,IAChEZ,EAAiB;GACvBS;GACAG;GACA,GAAGC;EACJ,CAAC;CACF;CAMA,OAAOb,EALHM,KAAoC,OAKhB,CAACG,GAAKG,CAAI,IALoC;EACrEH;EACAG;EACAN;CACD,CAAC;AAEF;AACA,IAAMQ,KAAK,GAAK,MAAeN,EAAOC,GAAKE,CAAU"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js
|
|
2
2
|
var e = Object.defineProperty, t = (t, n) => {
|
|
3
3
|
let r = {};
|
|
4
4
|
for (var i in t) e(r, i, {
|
|
@@ -7,7 +7,6 @@ var e = Object.defineProperty, t = (t, n) => {
|
|
|
7
7
|
});
|
|
8
8
|
return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
9
|
};
|
|
10
|
-
//#endregion
|
|
11
10
|
export { t };
|
|
12
11
|
|
|
13
12
|
//# sourceMappingURL=rolldown-runtime-D7D4PA-g.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rolldown-runtime-D7D4PA-g.js","names":[],"sources":["../../../../../node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js"],"sourcesContent":["//#region \\0rolldown/runtime.js\nvar __defProp = Object.defineProperty;\nvar __exportAll = (all, no_symbols) => {\n\tlet target = {};\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n\tif (!no_symbols) __defProp(target, Symbol.toStringTag, { value: \"Module\" });\n\treturn target;\n};\n//#endregion\nexport { __exportAll as t };\n"],"
|
|
1
|
+
{"version":3,"file":"rolldown-runtime-D7D4PA-g.js","names":["__defProp","__exportAll","target","name","all","no_symbols"],"sources":["../../../../../node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js"],"sourcesContent":["//#region \\0rolldown/runtime.js\nvar __defProp = Object.defineProperty;\nvar __exportAll = (all, no_symbols) => {\n\tlet target = {};\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n\tif (!no_symbols) __defProp(target, Symbol.toStringTag, { value: \"Module\" });\n\treturn target;\n};\n//#endregion\nexport { __exportAll as t };\n"],"ignoreList":[0],"mappings":";AACA,IAAIA,IAAY,OAAO,gBACnBC,KAAe,GAAK,MAAe;CACtC,IAAIC,IAAS,CAAC;CACd,KAAK,IAAIC,KAAQC,GAAK,EAAUF,GAAQC,GAAM;EAC7C,KAAKC,EAAID;EACT,YAAY;CACb,CAAC;CAED,OADKE,KAAYL,EAAUE,GAAQ,OAAO,aAAa,EAAE,OAAO,SAAS,CAAC,GACnEA;AACR"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Node as e, mergeAttributes as t, wrappingInputRule as n } from "../../core/dist/index.js";
|
|
2
|
+
import { Slice as r } from "../../../prosemirror-model/dist/index.js";
|
|
3
|
+
import { TextSelection as i } from "../../../prosemirror-state/dist/index.js";
|
|
4
4
|
import { createElement as a } from "../../core/dist/jsx-runtime/jsx-runtime.js";
|
|
5
|
-
|
|
6
|
-
var o = (
|
|
7
|
-
let { state:
|
|
5
|
+
// node_modules/@tiptap/extension-blockquote/dist/index.js
|
|
6
|
+
var o = (e, t) => {
|
|
7
|
+
let { state: n } = e, { selection: a } = n;
|
|
8
8
|
if (!a.empty) return !1;
|
|
9
9
|
let { $from: o } = a;
|
|
10
10
|
if (o.parentOffset !== 0) return !1;
|
|
@@ -12,16 +12,16 @@ var o = (n, r) => {
|
|
|
12
12
|
if (s < 0) return !1;
|
|
13
13
|
let c = o.node(s), l = o.index(s);
|
|
14
14
|
if (l === 0) return !1;
|
|
15
|
-
if (c.type ===
|
|
15
|
+
if (c.type === t) return e.commands.lift(t.name);
|
|
16
16
|
let u = c.child(l - 1);
|
|
17
|
-
if (u.type !==
|
|
17
|
+
if (u.type !== t || !u.lastChild?.isTextblock) return !1;
|
|
18
18
|
let d = o.before() - 1 - 1;
|
|
19
|
-
return
|
|
20
|
-
if (!
|
|
21
|
-
let
|
|
22
|
-
return
|
|
19
|
+
return e.commands.command(({ tr: e, dispatch: t }) => {
|
|
20
|
+
if (!t) return !0;
|
|
21
|
+
let n = o.parent.content, a = new r(n, 0, 0);
|
|
22
|
+
return e.replace(d, o.after(), a), e.setSelection(i.create(e.doc, d + n.size)), e.scrollIntoView(), t(e), !0;
|
|
23
23
|
});
|
|
24
|
-
}, s = /^\s*>\s$/, c =
|
|
24
|
+
}, s = /^\s*>\s$/, c = e.create({
|
|
25
25
|
name: "blockquote",
|
|
26
26
|
addOptions() {
|
|
27
27
|
return { HTMLAttributes: {} };
|
|
@@ -34,7 +34,7 @@ var o = (n, r) => {
|
|
|
34
34
|
},
|
|
35
35
|
renderHTML({ HTMLAttributes: e }) {
|
|
36
36
|
return /* @__PURE__ */ a("blockquote", {
|
|
37
|
-
...
|
|
37
|
+
...t(this.options.HTMLAttributes, e),
|
|
38
38
|
children: /* @__PURE__ */ a("slot", {})
|
|
39
39
|
});
|
|
40
40
|
},
|
|
@@ -64,13 +64,12 @@ var o = (n, r) => {
|
|
|
64
64
|
};
|
|
65
65
|
},
|
|
66
66
|
addInputRules() {
|
|
67
|
-
return [
|
|
67
|
+
return [n({
|
|
68
68
|
find: s,
|
|
69
69
|
type: this.type
|
|
70
70
|
})];
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
|
-
//#endregion
|
|
74
73
|
export { c as Blockquote, s as inputRegex };
|
|
75
74
|
|
|
76
75
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../node_modules/@tiptap/extension-blockquote/dist/index.js"],"sourcesContent":["// src/blockquote.tsx\nimport { mergeAttributes, Node, wrappingInputRule } from \"@tiptap/core\";\n\n// src/handleBackspace.ts\nimport { Slice } from \"@tiptap/pm/model\";\nimport { TextSelection } from \"@tiptap/pm/state\";\nvar handleBackspace = (editor, type) => {\n var _a;\n const { state } = editor;\n const { selection } = state;\n if (!selection.empty) return false;\n const { $from } = selection;\n if ($from.parentOffset !== 0) return false;\n const parentDepth = $from.depth - 1;\n if (parentDepth < 0) return false;\n const parent = $from.node(parentDepth);\n const index = $from.index(parentDepth);\n if (index === 0) return false;\n if (parent.type === type) {\n return editor.commands.lift(type.name);\n }\n const previous = parent.child(index - 1);\n if (previous.type !== type || !((_a = previous.lastChild) == null ? void 0 : _a.isTextblock)) {\n return false;\n }\n const blockStart = $from.before();\n const insideBlockquoteEnd = blockStart - 1;\n const targetPos = insideBlockquoteEnd - 1;\n return editor.commands.command(({ tr, dispatch }) => {\n if (!dispatch) {\n return true;\n }\n const content = $from.parent.content;\n const slice = new Slice(content, 0, 0);\n tr.replace(targetPos, $from.after(), slice);\n tr.setSelection(TextSelection.create(tr.doc, targetPos + content.size));\n tr.scrollIntoView();\n dispatch(tr);\n return true;\n });\n};\n\n// src/blockquote.tsx\nimport { jsx } from \"@tiptap/core/jsx-runtime\";\nvar inputRegex = /^\\s*>\\s$/;\nvar Blockquote = Node.create({\n name: \"blockquote\",\n addOptions() {\n return {\n HTMLAttributes: {}\n };\n },\n content: \"block+\",\n group: \"block\",\n defining: true,\n parseHTML() {\n return [{ tag: \"blockquote\" }];\n },\n renderHTML({ HTMLAttributes }) {\n return /* @__PURE__ */ jsx(\"blockquote\", { ...mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), children: /* @__PURE__ */ jsx(\"slot\", {}) });\n },\n parseMarkdown: (token, helpers) => {\n var _a;\n const parseBlockChildren = (_a = helpers.parseBlockChildren) != null ? _a : helpers.parseChildren;\n return helpers.createNode(\"blockquote\", void 0, parseBlockChildren(token.tokens || []));\n },\n renderMarkdown: (node, h) => {\n if (!node.content) {\n return \"\";\n }\n const prefix = \">\";\n const result = [];\n node.content.forEach((child, index) => {\n var _a, _b;\n const childContent = (_b = (_a = h.renderChild) == null ? void 0 : _a.call(h, child, index)) != null ? _b : h.renderChildren([child]);\n const lines = childContent.split(\"\\n\");\n const linesWithPrefix = lines.map((line) => {\n if (line.trim() === \"\") {\n return prefix;\n }\n return `${prefix} ${line}`;\n });\n result.push(linesWithPrefix.join(\"\\n\"));\n });\n return result.join(`\n${prefix}\n`);\n },\n addCommands() {\n return {\n setBlockquote: () => ({ commands }) => {\n return commands.wrapIn(this.name);\n },\n toggleBlockquote: () => ({ commands }) => {\n return commands.toggleWrap(this.name);\n },\n unsetBlockquote: () => ({ commands }) => {\n return commands.lift(this.name);\n }\n };\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-Shift-b\": () => this.editor.commands.toggleBlockquote(),\n Backspace: () => handleBackspace(this.editor, this.type)\n };\n },\n addInputRules() {\n return [\n wrappingInputRule({\n find: inputRegex,\n type: this.type\n })\n ];\n }\n});\n\n// src/index.ts\nvar index_default = Blockquote;\nexport {\n Blockquote,\n index_default as default,\n inputRegex\n};\n//# sourceMappingURL=index.js.map"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":["h","handleBackspace","editor","state","selection","$from","parentDepth","parent","index","type","previous","targetPos","dispatch","content","slice","Slice","tr","TextSelection","inputRegex","Blockquote","Node","mergeAttributes","HTMLAttributes","parseBlockChildren","helpers","token","node","result","linesWithPrefix","child","line","commands","wrappingInputRule"],"sources":["../../../../../node_modules/@tiptap/extension-blockquote/dist/index.js"],"sourcesContent":["// src/blockquote.tsx\nimport { mergeAttributes, Node, wrappingInputRule } from \"@tiptap/core\";\n\n// src/handleBackspace.ts\nimport { Slice } from \"@tiptap/pm/model\";\nimport { TextSelection } from \"@tiptap/pm/state\";\nvar handleBackspace = (editor, type) => {\n var _a;\n const { state } = editor;\n const { selection } = state;\n if (!selection.empty) return false;\n const { $from } = selection;\n if ($from.parentOffset !== 0) return false;\n const parentDepth = $from.depth - 1;\n if (parentDepth < 0) return false;\n const parent = $from.node(parentDepth);\n const index = $from.index(parentDepth);\n if (index === 0) return false;\n if (parent.type === type) {\n return editor.commands.lift(type.name);\n }\n const previous = parent.child(index - 1);\n if (previous.type !== type || !((_a = previous.lastChild) == null ? void 0 : _a.isTextblock)) {\n return false;\n }\n const blockStart = $from.before();\n const insideBlockquoteEnd = blockStart - 1;\n const targetPos = insideBlockquoteEnd - 1;\n return editor.commands.command(({ tr, dispatch }) => {\n if (!dispatch) {\n return true;\n }\n const content = $from.parent.content;\n const slice = new Slice(content, 0, 0);\n tr.replace(targetPos, $from.after(), slice);\n tr.setSelection(TextSelection.create(tr.doc, targetPos + content.size));\n tr.scrollIntoView();\n dispatch(tr);\n return true;\n });\n};\n\n// src/blockquote.tsx\nimport { jsx } from \"@tiptap/core/jsx-runtime\";\nvar inputRegex = /^\\s*>\\s$/;\nvar Blockquote = Node.create({\n name: \"blockquote\",\n addOptions() {\n return {\n HTMLAttributes: {}\n };\n },\n content: \"block+\",\n group: \"block\",\n defining: true,\n parseHTML() {\n return [{ tag: \"blockquote\" }];\n },\n renderHTML({ HTMLAttributes }) {\n return /* @__PURE__ */ jsx(\"blockquote\", { ...mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), children: /* @__PURE__ */ jsx(\"slot\", {}) });\n },\n parseMarkdown: (token, helpers) => {\n var _a;\n const parseBlockChildren = (_a = helpers.parseBlockChildren) != null ? _a : helpers.parseChildren;\n return helpers.createNode(\"blockquote\", void 0, parseBlockChildren(token.tokens || []));\n },\n renderMarkdown: (node, h) => {\n if (!node.content) {\n return \"\";\n }\n const prefix = \">\";\n const result = [];\n node.content.forEach((child, index) => {\n var _a, _b;\n const childContent = (_b = (_a = h.renderChild) == null ? void 0 : _a.call(h, child, index)) != null ? _b : h.renderChildren([child]);\n const lines = childContent.split(\"\\n\");\n const linesWithPrefix = lines.map((line) => {\n if (line.trim() === \"\") {\n return prefix;\n }\n return `${prefix} ${line}`;\n });\n result.push(linesWithPrefix.join(\"\\n\"));\n });\n return result.join(`\n${prefix}\n`);\n },\n addCommands() {\n return {\n setBlockquote: () => ({ commands }) => {\n return commands.wrapIn(this.name);\n },\n toggleBlockquote: () => ({ commands }) => {\n return commands.toggleWrap(this.name);\n },\n unsetBlockquote: () => ({ commands }) => {\n return commands.lift(this.name);\n }\n };\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-Shift-b\": () => this.editor.commands.toggleBlockquote(),\n Backspace: () => handleBackspace(this.editor, this.type)\n };\n },\n addInputRules() {\n return [\n wrappingInputRule({\n find: inputRegex,\n type: this.type\n })\n ];\n }\n});\n\n// src/index.ts\nvar index_default = Blockquote;\nexport {\n Blockquote,\n index_default as default,\n inputRegex\n};\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;;;;AAMA,IAAIC,KAAmB,GAAQ,MAAS;CAEtC,IAAM,EAAE,aAAUC,GACZ,EAAE,iBAAcC;CACtB,IAAI,CAACC,EAAU,OAAO,OAAO;CAC7B,IAAM,EAAE,aAAUA;CAClB,IAAIC,EAAM,iBAAiB,GAAG,OAAO;CACrC,IAAMC,IAAcD,EAAM,QAAQ;CAClC,IAAIC,IAAc,GAAG,OAAO;CAC5B,IAAMC,IAASF,EAAM,KAAKC,CAAW,GAC/BE,IAAQH,EAAM,MAAMC,CAAW;CACrC,IAAIE,MAAU,GAAG,OAAO;CACxB,IAAID,EAAO,SAASE,GAClB,OAAOP,EAAO,SAAS,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OrB,CAAK,KAAkBR,EAAE,eAAe,CAAC6B,CAAK,CAAC,EAAA,CACzG,MAAM,IACL,CAAC,CAAC,KAAK,MAC7BC,EAAK,KAAK,MAAM,KACX,MAEF,KAAaA,GACrB;GACD,EAAO,KAAKF,EAAgB,KAAK,IAAI,CAAC;EACxC,CAAC,GACMD,EAAO,KAAK,OAEtB;CACC;CACA,cAAc;EACZ,OAAO;GACL,sBAAsB,EAAE,kBACfI,EAAS,OAAO,KAAK,IAAI;GAElC,yBAAyB,EAAE,kBAClBA,EAAS,WAAW,KAAK,IAAI;GAEtC,wBAAwB,EAAE,kBACjBA,EAAS,KAAK,KAAK,IAAI;EAElC;CACF;CACA,uBAAuB;EACrB,OAAO;GACL,qBAAqB,KAAK,OAAO,SAAS,iBAAiB;GAC3D,iBAAiB9B,EAAgB,KAAK,QAAQ,KAAK,IAAI;EACzD;CACF;CACA,gBAAgB;EACd,OAAO,CACL+B,EAAkB;GAChB,MAAMd;GACN,MAAM,KAAK;EACb,CAAC,CACH;CACF;AACF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Mark as e, markInputRule as t, markPasteRule as n, mergeAttributes as r } from "../../core/dist/index.js";
|
|
2
2
|
import { createElement as i } from "../../core/dist/jsx-runtime/jsx-runtime.js";
|
|
3
|
-
|
|
3
|
+
// node_modules/@tiptap/extension-bold/dist/index.js
|
|
4
4
|
var a = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, o = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, s = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, c = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, l = e.create({
|
|
5
5
|
name: "bold",
|
|
6
6
|
addOptions() {
|
|
@@ -68,7 +68,6 @@ var a = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, o = /(?:^|\s)(\*
|
|
|
68
68
|
})];
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
|
-
//#endregion
|
|
72
71
|
export { l as Bold, a as starInputRegex, o as starPasteRegex, s as underscoreInputRegex, c as underscorePasteRegex };
|
|
73
72
|
|
|
74
73
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../node_modules/@tiptap/extension-bold/dist/index.js"],"sourcesContent":["// src/bold.tsx\nimport { Mark, markInputRule, markPasteRule, mergeAttributes } from \"@tiptap/core\";\nimport { jsx } from \"@tiptap/core/jsx-runtime\";\nvar starInputRegex = /(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))$/;\nvar starPasteRegex = /(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))/g;\nvar underscoreInputRegex = /(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))$/;\nvar underscorePasteRegex = /(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))/g;\nvar Bold = Mark.create({\n name: \"bold\",\n addOptions() {\n return {\n HTMLAttributes: {}\n };\n },\n parseHTML() {\n return [\n {\n tag: \"strong\"\n },\n {\n tag: \"b\",\n getAttrs: (node) => node.style.fontWeight !== \"normal\" && null\n },\n {\n style: \"font-weight=400\",\n clearMark: (mark) => mark.type.name === this.name\n },\n {\n style: \"font-weight\",\n getAttrs: (value) => /^(bold(er)?|[5-9]\\d{2,})$/.test(value) && null\n }\n ];\n },\n renderHTML({ HTMLAttributes }) {\n return /* @__PURE__ */ jsx(\"strong\", { ...mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), children: /* @__PURE__ */ jsx(\"slot\", {}) });\n },\n markdownTokenName: \"strong\",\n parseMarkdown: (token, helpers) => {\n return helpers.applyMark(\"bold\", helpers.parseInline(token.tokens || []));\n },\n markdownOptions: {\n htmlReopen: {\n open: \"<strong>\",\n close: \"</strong>\"\n }\n },\n renderMarkdown: (node, h) => {\n return `**${h.renderChildren(node)}**`;\n },\n addCommands() {\n return {\n setBold: () => ({ commands }) => {\n return commands.setMark(this.name);\n },\n toggleBold: () => ({ commands }) => {\n return commands.toggleMark(this.name);\n },\n unsetBold: () => ({ commands }) => {\n return commands.unsetMark(this.name);\n }\n };\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-b\": () => this.editor.commands.toggleBold(),\n \"Mod-B\": () => this.editor.commands.toggleBold()\n };\n },\n addInputRules() {\n return [\n markInputRule({\n find: starInputRegex,\n type: this.type\n }),\n markInputRule({\n find: underscoreInputRegex,\n type: this.type\n })\n ];\n },\n addPasteRules() {\n return [\n markPasteRule({\n find: starPasteRegex,\n type: this.type\n }),\n markPasteRule({\n find: underscorePasteRegex,\n type: this.type\n })\n ];\n }\n});\n\n// src/index.ts\nvar index_default = Bold;\nexport {\n Bold,\n index_default as default,\n starInputRegex,\n starPasteRegex,\n underscoreInputRegex,\n underscorePasteRegex\n};\n//# sourceMappingURL=index.js.map"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":["h","starInputRegex","starPasteRegex","underscoreInputRegex","underscorePasteRegex","Bold","Mark","node","mark","value","mergeAttributes","HTMLAttributes","helpers","token","commands","markInputRule","markPasteRule"],"sources":["../../../../../node_modules/@tiptap/extension-bold/dist/index.js"],"sourcesContent":["// src/bold.tsx\nimport { Mark, markInputRule, markPasteRule, mergeAttributes } from \"@tiptap/core\";\nimport { jsx } from \"@tiptap/core/jsx-runtime\";\nvar starInputRegex = /(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))$/;\nvar starPasteRegex = /(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))/g;\nvar underscoreInputRegex = /(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))$/;\nvar underscorePasteRegex = /(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))/g;\nvar Bold = Mark.create({\n name: \"bold\",\n addOptions() {\n return {\n HTMLAttributes: {}\n };\n },\n parseHTML() {\n return [\n {\n tag: \"strong\"\n },\n {\n tag: \"b\",\n getAttrs: (node) => node.style.fontWeight !== \"normal\" && null\n },\n {\n style: \"font-weight=400\",\n clearMark: (mark) => mark.type.name === this.name\n },\n {\n style: \"font-weight\",\n getAttrs: (value) => /^(bold(er)?|[5-9]\\d{2,})$/.test(value) && null\n }\n ];\n },\n renderHTML({ HTMLAttributes }) {\n return /* @__PURE__ */ jsx(\"strong\", { ...mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), children: /* @__PURE__ */ jsx(\"slot\", {}) });\n },\n markdownTokenName: \"strong\",\n parseMarkdown: (token, helpers) => {\n return helpers.applyMark(\"bold\", helpers.parseInline(token.tokens || []));\n },\n markdownOptions: {\n htmlReopen: {\n open: \"<strong>\",\n close: \"</strong>\"\n }\n },\n renderMarkdown: (node, h) => {\n return `**${h.renderChildren(node)}**`;\n },\n addCommands() {\n return {\n setBold: () => ({ commands }) => {\n return commands.setMark(this.name);\n },\n toggleBold: () => ({ commands }) => {\n return commands.toggleMark(this.name);\n },\n unsetBold: () => ({ commands }) => {\n return commands.unsetMark(this.name);\n }\n };\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-b\": () => this.editor.commands.toggleBold(),\n \"Mod-B\": () => this.editor.commands.toggleBold()\n };\n },\n addInputRules() {\n return [\n markInputRule({\n find: starInputRegex,\n type: this.type\n }),\n markInputRule({\n find: underscoreInputRegex,\n type: this.type\n })\n ];\n },\n addPasteRules() {\n return [\n markPasteRule({\n find: starPasteRegex,\n type: this.type\n }),\n markPasteRule({\n find: underscorePasteRegex,\n type: this.type\n })\n ];\n }\n});\n\n// src/index.ts\nvar index_default = Bold;\nexport {\n Bold,\n index_default as default,\n starInputRegex,\n starPasteRegex,\n underscore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,GACDc,EAAc;GACZ,MAAMZ;GACN,MAAM,KAAK;EACb,CAAC,CACH;CACF;CACA,gBAAgB;EACd,OAAO,CACLa,EAAc;GACZ,MAAMd;GACN,MAAM,KAAK;EACb,CAAC,GACDc,EAAc;GACZ,MAAMZ;GACN,MAAM,KAAK;EACb,CAAC,CACH;CACF;AACF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Mark as e, markInputRule as t, markPasteRule as n, mergeAttributes as r } from "../../core/dist/index.js";
|
|
2
|
-
|
|
2
|
+
// node_modules/@tiptap/extension-code/dist/index.js
|
|
3
3
|
var i = (e) => {
|
|
4
4
|
let t = /`([^`]+)`(?!`)$/.exec(e);
|
|
5
5
|
return !t || t.index > 0 && e[t.index - 1] === "`" ? null : {
|
|
@@ -62,7 +62,6 @@ var i = (e) => {
|
|
|
62
62
|
})];
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
|
-
//#endregion
|
|
66
65
|
export { o as Code, i as inputRegexMatch, a as pasteRegexMatch };
|
|
67
66
|
|
|
68
67
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../node_modules/@tiptap/extension-code/dist/index.js"],"sourcesContent":["// src/code.ts\nimport { Mark, markInputRule, markPasteRule, mergeAttributes } from \"@tiptap/core\";\nvar inputRegex = /(^|[^`])`([^`]+)`(?!`)$/;\nvar pasteRegex = /(^|[^`])`([^`]+)`(?!`)/g;\nvar inputRegexMatch = (text) => {\n const match = /`([^`]+)`(?!`)$/.exec(text);\n if (!match) {\n return null;\n }\n if (match.index > 0 && text[match.index - 1] === \"`\") {\n return null;\n }\n return {\n index: match.index,\n text: match[0],\n replaceWith: match[1]\n };\n};\nvar pasteRegexMatch = (text) => {\n const regex = /`([^`]+)`(?!`)/g;\n const matches = [];\n let match;\n while ((match = regex.exec(text)) !== null) {\n if (match.index > 0 && text[match.index - 1] === \"`\") {\n continue;\n }\n matches.push({\n index: match.index,\n text: match[0],\n replaceWith: match[1]\n });\n }\n return matches;\n};\nvar Code = Mark.create({\n name: \"code\",\n addOptions() {\n return {\n HTMLAttributes: {}\n };\n },\n excludes: \"_\",\n code: true,\n exitable: true,\n parseHTML() {\n return [{ tag: \"code\" }];\n },\n renderHTML({ HTMLAttributes }) {\n return [\"code\", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];\n },\n markdownTokenName: \"codespan\",\n parseMarkdown: (token, helpers) => {\n return helpers.applyMark(\"code\", [{ type: \"text\", text: token.text || \"\" }]);\n },\n renderMarkdown: (node, h) => {\n if (!node.content) {\n return \"\";\n }\n return `\\`${h.renderChildren(node.content)}\\``;\n },\n addCommands() {\n return {\n setCode: () => ({ commands }) => {\n return commands.setMark(this.name);\n },\n toggleCode: () => ({ commands }) => {\n return commands.toggleMark(this.name);\n },\n unsetCode: () => ({ commands }) => {\n return commands.unsetMark(this.name);\n }\n };\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-e\": () => this.editor.commands.toggleCode()\n };\n },\n addInputRules() {\n return [\n markInputRule({\n find: inputRegexMatch,\n type: this.type\n })\n ];\n },\n addPasteRules() {\n return [\n markPasteRule({\n find: pasteRegexMatch,\n type: this.type\n })\n ];\n }\n});\n\n// src/index.ts\nvar index_default = Code;\nexport {\n Code,\n index_default as default,\n inputRegex,\n inputRegexMatch,\n pasteRegex,\n pasteRegexMatch\n};\n//# sourceMappingURL=index.js.map"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":["inputRegexMatch","match","text","pasteRegexMatch","regex","matches","Code","Mark","mergeAttributes","HTMLAttributes","helpers","token","node","h","commands","markInputRule","markPasteRule"],"sources":["../../../../../node_modules/@tiptap/extension-code/dist/index.js"],"sourcesContent":["// src/code.ts\nimport { Mark, markInputRule, markPasteRule, mergeAttributes } from \"@tiptap/core\";\nvar inputRegex = /(^|[^`])`([^`]+)`(?!`)$/;\nvar pasteRegex = /(^|[^`])`([^`]+)`(?!`)/g;\nvar inputRegexMatch = (text) => {\n const match = /`([^`]+)`(?!`)$/.exec(text);\n if (!match) {\n return null;\n }\n if (match.index > 0 && text[match.index - 1] === \"`\") {\n return null;\n }\n return {\n index: match.index,\n text: match[0],\n replaceWith: match[1]\n };\n};\nvar pasteRegexMatch = (text) => {\n const regex = /`([^`]+)`(?!`)/g;\n const matches = [];\n let match;\n while ((match = regex.exec(text)) !== null) {\n if (match.index > 0 && text[match.index - 1] === \"`\") {\n continue;\n }\n matches.push({\n index: match.index,\n text: match[0],\n replaceWith: match[1]\n });\n }\n return matches;\n};\nvar Code = Mark.create({\n name: \"code\",\n addOptions() {\n return {\n HTMLAttributes: {}\n };\n },\n excludes: \"_\",\n code: true,\n exitable: true,\n parseHTML() {\n return [{ tag: \"code\" }];\n },\n renderHTML({ HTMLAttributes }) {\n return [\"code\", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];\n },\n markdownTokenName: \"codespan\",\n parseMarkdown: (token, helpers) => {\n return helpers.applyMark(\"code\", [{ type: \"text\", text: token.text || \"\" }]);\n },\n renderMarkdown: (node, h) => {\n if (!node.content) {\n return \"\";\n }\n return `\\`${h.renderChildren(node.content)}\\``;\n },\n addCommands() {\n return {\n setCode: () => ({ commands }) => {\n return commands.setMark(this.name);\n },\n toggleCode: () => ({ commands }) => {\n return commands.toggleMark(this.name);\n },\n unsetCode: () => ({ commands }) => {\n return commands.unsetMark(this.name);\n }\n };\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-e\": () => this.editor.commands.toggleCode()\n };\n },\n addInputRules() {\n return [\n markInputRule({\n find: inputRegexMatch,\n type: this.type\n })\n ];\n },\n addPasteRules() {\n return [\n markPasteRule({\n find: pasteRegexMatch,\n type: this.type\n })\n ];\n }\n});\n\n// src/index.ts\nvar index_default = Code;\nexport {\n Code,\n index_default as default,\n inputRegex,\n inputRegexMatch,\n pasteRegex,\n pasteRegexMatch\n};\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;AAIA,IAAI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,WAAW,EACjD;CACF;CACA,gBAAgB;EACd,OAAO,CACLC,EAAc;GACZ,MAAMf;GACN,MAAM,KAAK;EACb,CAAC,CACH;CACF;CACA,gBAAgB;EACd,OAAO,CACLgB,EAAc;GACZ,MAAMb;GACN,MAAM,KAAK;EACb,CAAC,CACH;CACF;AACF,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
var s = 4, c = /^```([a-z]+)?[\s\n]$/, l = /^~~~([a-z]+)?[\s\n]$/, u =
|
|
1
|
+
import { Node as e, mergeAttributes as t, textblockTypeInputRule as n } from "../../core/dist/index.js";
|
|
2
|
+
import { Plugin as r, PluginKey as i, Selection as a, TextSelection as o } from "../../../prosemirror-state/dist/index.js";
|
|
3
|
+
// node_modules/@tiptap/extension-code-block/dist/index.js
|
|
4
|
+
var s = 4, c = /^```([a-z]+)?[\s\n]$/, l = /^~~~([a-z]+)?[\s\n]$/, u = e.create({
|
|
5
5
|
name: "codeBlock",
|
|
6
6
|
addOptions() {
|
|
7
7
|
return {
|
|
@@ -36,10 +36,10 @@ var s = 4, c = /^```([a-z]+)?[\s\n]$/, l = /^~~~([a-z]+)?[\s\n]$/, u = i.create(
|
|
|
36
36
|
preserveWhitespace: "full"
|
|
37
37
|
}];
|
|
38
38
|
},
|
|
39
|
-
renderHTML({ node: e, HTMLAttributes:
|
|
39
|
+
renderHTML({ node: e, HTMLAttributes: n }) {
|
|
40
40
|
return [
|
|
41
41
|
"pre",
|
|
42
|
-
|
|
42
|
+
t(this.options.HTMLAttributes, n),
|
|
43
43
|
[
|
|
44
44
|
"code",
|
|
45
45
|
{ class: e.attrs.language ? this.options.languageClassPrefix + e.attrs.language : null },
|
|
@@ -84,9 +84,9 @@ var s = 4, c = /^```([a-z]+)?[\s\n]$/, l = /^~~~([a-z]+)?[\s\n]$/, u = i.create(
|
|
|
84
84
|
},
|
|
85
85
|
"Shift-Tab": ({ editor: e }) => {
|
|
86
86
|
if (!this.options.enableTabIndentation) return !1;
|
|
87
|
-
let t = this.options.tabSize ?? s, { state: n } = e, { selection:
|
|
88
|
-
return
|
|
89
|
-
let { pos:
|
|
87
|
+
let t = this.options.tabSize ?? s, { state: n } = e, { selection: r } = n, { $from: i, empty: a } = r;
|
|
88
|
+
return i.parent.type === this.type ? a ? e.commands.command(({ tr: e }) => {
|
|
89
|
+
let { pos: r } = i, a = i.start(), s = i.end(), c = n.doc.textBetween(a, s, "\n", "\n").split("\n"), l = 0, u = 0, d = r - a;
|
|
90
90
|
for (let e = 0; e < c.length; e += 1) {
|
|
91
91
|
if (u + c[e].length >= d) {
|
|
92
92
|
l = e;
|
|
@@ -96,15 +96,15 @@ var s = 4, c = /^```([a-z]+)?[\s\n]$/, l = /^~~~([a-z]+)?[\s\n]$/, u = i.create(
|
|
|
96
96
|
}
|
|
97
97
|
let f = c[l].match(/^ */)?.[0] || "", p = Math.min(f.length, t);
|
|
98
98
|
if (p === 0) return !0;
|
|
99
|
-
let m =
|
|
99
|
+
let m = a;
|
|
100
100
|
for (let e = 0; e < l; e += 1) m += c[e].length + 1;
|
|
101
|
-
return e.delete(m, m + p),
|
|
101
|
+
return e.delete(m, m + p), r - m <= p && e.setSelection(o.create(e.doc, m)), !0;
|
|
102
102
|
}) : e.commands.command(({ tr: e }) => {
|
|
103
|
-
let { from:
|
|
103
|
+
let { from: i, to: a } = r, o = n.doc.textBetween(i, a, "\n", "\n").split("\n").map((e) => {
|
|
104
104
|
let n = e.match(/^ */)?.[0] || "", r = Math.min(n.length, t);
|
|
105
105
|
return e.slice(r);
|
|
106
106
|
}).join("\n");
|
|
107
|
-
return e.replaceWith(
|
|
107
|
+
return e.replaceWith(i, a, n.schema.text(o)), !0;
|
|
108
108
|
}) : !1;
|
|
109
109
|
},
|
|
110
110
|
Enter: ({ editor: e }) => {
|
|
@@ -123,38 +123,37 @@ var s = 4, c = /^```([a-z]+)?[\s\n]$/, l = /^~~~([a-z]+)?[\s\n]$/, u = i.create(
|
|
|
123
123
|
},
|
|
124
124
|
ArrowDown: ({ editor: e }) => {
|
|
125
125
|
if (!this.options.exitOnArrowDown) return !1;
|
|
126
|
-
let { state: t } = e, { selection:
|
|
127
|
-
if (!o ||
|
|
128
|
-
let s =
|
|
129
|
-
return s === void 0 ? !1 :
|
|
126
|
+
let { state: t } = e, { selection: n, doc: r } = t, { $from: i, empty: o } = n;
|
|
127
|
+
if (!o || i.parent.type !== this.type || i.parentOffset !== i.parent.nodeSize - 2) return !1;
|
|
128
|
+
let s = i.after();
|
|
129
|
+
return s === void 0 ? !1 : r.nodeAt(s) ? e.commands.command(({ tr: e }) => (e.setSelection(a.near(r.resolve(s))), !0)) : e.commands.exitCode();
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
132
|
},
|
|
133
133
|
addInputRules() {
|
|
134
|
-
return [
|
|
134
|
+
return [n({
|
|
135
135
|
find: c,
|
|
136
136
|
type: this.type,
|
|
137
137
|
getAttributes: (e) => ({ language: e[1] })
|
|
138
|
-
}),
|
|
138
|
+
}), n({
|
|
139
139
|
find: l,
|
|
140
140
|
type: this.type,
|
|
141
141
|
getAttributes: (e) => ({ language: e[1] })
|
|
142
142
|
})];
|
|
143
143
|
},
|
|
144
144
|
addProseMirrorPlugins() {
|
|
145
|
-
return [new
|
|
146
|
-
key: new
|
|
145
|
+
return [new r({
|
|
146
|
+
key: new i("codeBlockVSCodeHandler"),
|
|
147
147
|
props: { handlePaste: (e, t) => {
|
|
148
148
|
if (!t.clipboardData || this.editor.isActive(this.type.name)) return !1;
|
|
149
|
-
let n = t.clipboardData.getData("text/plain"),
|
|
150
|
-
if (!n || !
|
|
151
|
-
let { tr:
|
|
152
|
-
return
|
|
149
|
+
let n = t.clipboardData.getData("text/plain"), r = t.clipboardData.getData("vscode-editor-data"), i = (r ? JSON.parse(r) : void 0)?.mode;
|
|
150
|
+
if (!n || !i) return !1;
|
|
151
|
+
let { tr: a, schema: s } = e.state, c = s.text(n.replace(/\r\n?/g, "\n"));
|
|
152
|
+
return a.replaceSelectionWith(this.type.create({ language: i }, c)), a.selection.$from.parent.type !== this.type && a.setSelection(o.near(a.doc.resolve(Math.max(0, a.selection.from - 2)))), a.setMeta("paste", !0), e.dispatch(a), !0;
|
|
153
153
|
} }
|
|
154
154
|
})];
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
|
-
//#endregion
|
|
158
157
|
export { u as CodeBlock, c as backtickInputRegex, l as tildeInputRegex };
|
|
159
158
|
|
|
160
159
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../node_modules/@tiptap/extension-code-block/dist/index.js"],"sourcesContent":["// src/code-block.ts\nimport { mergeAttributes, Node, textblockTypeInputRule } from \"@tiptap/core\";\nimport { Plugin, PluginKey, Selection, TextSelection } from \"@tiptap/pm/state\";\nvar DEFAULT_TAB_SIZE = 4;\nvar backtickInputRegex = /^```([a-z]+)?[\\s\\n]$/;\nvar tildeInputRegex = /^~~~([a-z]+)?[\\s\\n]$/;\nvar CodeBlock = Node.create({\n name: \"codeBlock\",\n addOptions() {\n return {\n languageClassPrefix: \"language-\",\n exitOnTripleEnter: true,\n exitOnArrowDown: true,\n exitOnArrowUp: true,\n defaultLanguage: null,\n enableTabIndentation: false,\n tabSize: DEFAULT_TAB_SIZE,\n HTMLAttributes: {}\n };\n },\n content: \"text*\",\n marks: \"\",\n group: \"block\",\n code: true,\n defining: true,\n addAttributes() {\n return {\n language: {\n default: this.options.defaultLanguage,\n parseHTML: (element) => {\n var _a;\n const { languageClassPrefix } = this.options;\n if (!languageClassPrefix) {\n return null;\n }\n const classNames = [...((_a = element.firstElementChild) == null ? void 0 : _a.classList) || []];\n const languages = classNames.filter((className) => className.startsWith(languageClassPrefix)).map((className) => className.replace(languageClassPrefix, \"\"));\n const language = languages[0];\n if (!language) {\n return null;\n }\n return language;\n },\n rendered: false\n }\n };\n },\n parseHTML() {\n return [\n {\n tag: \"pre\",\n preserveWhitespace: \"full\"\n }\n ];\n },\n renderHTML({ node, HTMLAttributes }) {\n return [\n \"pre\",\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n [\n \"code\",\n {\n class: node.attrs.language ? this.options.languageClassPrefix + node.attrs.language : null\n },\n 0\n ]\n ];\n },\n markdownTokenName: \"code\",\n parseMarkdown: (token, helpers) => {\n var _a, _b;\n if (((_a = token.raw) == null ? void 0 : _a.startsWith(\"```\")) === false && ((_b = token.raw) == null ? void 0 : _b.startsWith(\"~~~\")) === false && token.codeBlockStyle !== \"indented\") {\n return [];\n }\n return helpers.createNode(\n \"codeBlock\",\n { language: token.lang || null },\n token.text ? [helpers.createTextNode(token.text)] : []\n );\n },\n renderMarkdown: (node, h) => {\n var _a;\n let output = \"\";\n const language = ((_a = node.attrs) == null ? void 0 : _a.language) || \"\";\n if (!node.content) {\n output = `\\`\\`\\`${language}\n\n\\`\\`\\``;\n } else {\n const lines = [`\\`\\`\\`${language}`, h.renderChildren(node.content), \"```\"];\n output = lines.join(\"\\n\");\n }\n return output;\n },\n addCommands() {\n return {\n setCodeBlock: (attributes) => ({ commands }) => {\n return commands.setNode(this.name, attributes);\n },\n toggleCodeBlock: (attributes) => ({ commands }) => {\n return commands.toggleNode(this.name, \"paragraph\", attributes);\n }\n };\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-Alt-c\": () => this.editor.commands.toggleCodeBlock(),\n // remove code block when at start of document or code block is empty\n Backspace: () => {\n const { empty, $anchor } = this.editor.state.selection;\n const isAtStart = $anchor.pos === 1;\n if (!empty || $anchor.parent.type.name !== this.name) {\n return false;\n }\n if (isAtStart || !$anchor.parent.textContent.length) {\n return this.editor.commands.clearNodes();\n }\n return false;\n },\n // handle tab indentation\n Tab: ({ editor }) => {\n var _a;\n if (!this.options.enableTabIndentation) {\n return false;\n }\n const tabSize = (_a = this.options.tabSize) != null ? _a : DEFAULT_TAB_SIZE;\n const { state } = editor;\n const { selection } = state;\n const { $from, empty } = selection;\n if ($from.parent.type !== this.type) {\n return false;\n }\n const indent = \" \".repeat(tabSize);\n if (empty) {\n return editor.commands.insertContent(indent);\n }\n return editor.commands.command(({ tr }) => {\n const { from, to } = selection;\n const text = state.doc.textBetween(from, to, \"\\n\", \"\\n\");\n const lines = text.split(\"\\n\");\n const indentedText = lines.map((line) => indent + line).join(\"\\n\");\n tr.replaceWith(from, to, state.schema.text(indentedText));\n return true;\n });\n },\n // handle shift+tab reverse indentation\n \"Shift-Tab\": ({ editor }) => {\n var _a;\n if (!this.options.enableTabIndentation) {\n return false;\n }\n const tabSize = (_a = this.options.tabSize) != null ? _a : DEFAULT_TAB_SIZE;\n const { state } = editor;\n const { selection } = state;\n const { $from, empty } = selection;\n if ($from.parent.type !== this.type) {\n return false;\n }\n if (empty) {\n return editor.commands.command(({ tr }) => {\n var _a2;\n const { pos } = $from;\n const codeBlockStart = $from.start();\n const codeBlockEnd = $from.end();\n const allText = state.doc.textBetween(codeBlockStart, codeBlockEnd, \"\\n\", \"\\n\");\n const lines = allText.split(\"\\n\");\n let currentLineIndex = 0;\n let charCount = 0;\n const relativeCursorPos = pos - codeBlockStart;\n for (let i = 0; i < lines.length; i += 1) {\n if (charCount + lines[i].length >= relativeCursorPos) {\n currentLineIndex = i;\n break;\n }\n charCount += lines[i].length + 1;\n }\n const currentLine = lines[currentLineIndex];\n const leadingSpaces = ((_a2 = currentLine.match(/^ */)) == null ? void 0 : _a2[0]) || \"\";\n const spacesToRemove = Math.min(leadingSpaces.length, tabSize);\n if (spacesToRemove === 0) {\n return true;\n }\n let lineStartPos = codeBlockStart;\n for (let i = 0; i < currentLineIndex; i += 1) {\n lineStartPos += lines[i].length + 1;\n }\n tr.delete(lineStartPos, lineStartPos + spacesToRemove);\n const cursorPosInLine = pos - lineStartPos;\n if (cursorPosInLine <= spacesToRemove) {\n tr.setSelection(TextSelection.create(tr.doc, lineStartPos));\n }\n return true;\n });\n }\n return editor.commands.command(({ tr }) => {\n const { from, to } = selection;\n const text = state.doc.textBetween(from, to, \"\\n\", \"\\n\");\n const lines = text.split(\"\\n\");\n const reverseIndentText = lines.map((line) => {\n var _a2;\n const leadingSpaces = ((_a2 = line.match(/^ */)) == null ? void 0 : _a2[0]) || \"\";\n const spacesToRemove = Math.min(leadingSpaces.length, tabSize);\n return line.slice(spacesToRemove);\n }).join(\"\\n\");\n tr.replaceWith(from, to, state.schema.text(reverseIndentText));\n return true;\n });\n },\n // exit node on triple enter\n Enter: ({ editor }) => {\n if (!this.options.exitOnTripleEnter) {\n return false;\n }\n const { state } = editor;\n const { selection } = state;\n const { $from, empty } = selection;\n if (!empty || $from.parent.type !== this.type) {\n return false;\n }\n const isAtEnd = $from.parentOffset === $from.parent.nodeSize - 2;\n const endsWithDoubleNewline = $from.parent.textContent.endsWith(\"\\n\\n\");\n if (!isAtEnd || !endsWithDoubleNewline) {\n return false;\n }\n return editor.chain().command(({ tr }) => {\n tr.delete($from.pos - 2, $from.pos);\n return true;\n }).exitCode().run();\n },\n // exit node on arrow up if there is no node before it\n ArrowUp: ({ editor }) => {\n if (!this.options.exitOnArrowUp) {\n return false;\n }\n const { state } = editor;\n const { selection } = state;\n const { $from, empty } = selection;\n if (!empty || $from.parent.type !== this.type) {\n return false;\n }\n if ($from.parentOffset !== 0) {\n return false;\n }\n const before = $from.before();\n if (before > 0) {\n return false;\n }\n return editor.commands.insertDefaultBlock({ pos: before });\n },\n // exit node on arrow down\n ArrowDown: ({ editor }) => {\n if (!this.options.exitOnArrowDown) {\n return false;\n }\n const { state } = editor;\n const { selection, doc } = state;\n const { $from, empty } = selection;\n if (!empty || $from.parent.type !== this.type) {\n return false;\n }\n const isAtEnd = $from.parentOffset === $from.parent.nodeSize - 2;\n if (!isAtEnd) {\n return false;\n }\n const after = $from.after();\n if (after === void 0) {\n return false;\n }\n const nodeAfter = doc.nodeAt(after);\n if (nodeAfter) {\n return editor.commands.command(({ tr }) => {\n tr.setSelection(Selection.near(doc.resolve(after)));\n return true;\n });\n }\n return editor.commands.exitCode();\n }\n };\n },\n addInputRules() {\n return [\n textblockTypeInputRule({\n find: backtickInputRegex,\n type: this.type,\n getAttributes: (match) => ({\n language: match[1]\n })\n }),\n textblockTypeInputRule({\n find: tildeInputRegex,\n type: this.type,\n getAttributes: (match) => ({\n language: match[1]\n })\n })\n ];\n },\n addProseMirrorPlugins() {\n return [\n // this plugin creates a code block for pasted content from VS Code\n // we can also detect the copied code language\n new Plugin({\n key: new PluginKey(\"codeBlockVSCodeHandler\"),\n props: {\n handlePaste: (view, event) => {\n if (!event.clipboardData) {\n return false;\n }\n if (this.editor.isActive(this.type.name)) {\n return false;\n }\n const text = event.clipboardData.getData(\"text/plain\");\n const vscode = event.clipboardData.getData(\"vscode-editor-data\");\n const vscodeData = vscode ? JSON.parse(vscode) : void 0;\n const language = vscodeData == null ? void 0 : vscodeData.mode;\n if (!text || !language) {\n return false;\n }\n const { tr, schema } = view.state;\n const textNode = schema.text(text.replace(/\\r\\n?/g, \"\\n\"));\n tr.replaceSelectionWith(this.type.create({ language }, textNode));\n if (tr.selection.$from.parent.type !== this.type) {\n tr.setSelection(\n TextSelection.near(tr.doc.resolve(Math.max(0, tr.selection.from - 2)))\n );\n }\n tr.setMeta(\"paste\", true);\n view.dispatch(tr);\n return true;\n }\n }\n })\n ];\n }\n});\n\n// src/index.ts\nvar index_default = CodeBlock;\nexport {\n CodeBlock,\n backtickInputRegex,\n index_default as default,\n tildeInputRegex\n};\n//# sourceMappingURL=index.js.map"],"x_google_ignoreList":[0],"mappings":";;;AAGA,IAAI,IAAmB,GACnB,IAAqB,wBACrB,IAAkB,wBAClB,IAAY,EAAK,OAAO;CAC1B,MAAM;CACN,aAAa;EACX,OAAO;GACL,qBAAqB;GACrB,mBAAmB;GACnB,iBAAiB;GACjB,eAAe;GACf,iBAAiB;GACjB,sBAAsB;GACtB,SAAS;GACT,gBAAgB,CAAC;EACnB;CACF;CACA,SAAS;CACT,OAAO;CACP,OAAO;CACP,MAAM;CACN,UAAU;CACV,gBA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UAAU,EAAM,GAClB;EACF,CAAC,GACD,EAAuB;GACrB,MAAM;GACN,MAAM,KAAK;GACX,gBAAgB,OAAW,EACzB,UAAU,EAAM,GAClB;EACF,CAAC,CACH;CACF;CACA,wBAAwB;EACtB,OAAO,CAGL,IAAI,EAAO;GACT,KAAK,IAAI,EAAU,wBAAwB;GAC3C,OAAO,EACL,cAAc,GAAM,MAAU;IAI5B,IAHI,CAAC,EAAM,iBAGP,KAAK,OAAO,SAAS,KAAK,KAAK,IAAI,GACrC,OAAO;IAET,IAAM,IAAO,EAAM,cAAc,QAAQ,YAAY,GAC/C,IAAS,EAAM,cAAc,QAAQ,oBAAoB,GAEzD,KADa,IAAS,KAAK,MAAM,CAAM,IAAI,KAAK,EACrC,EAAyC;IAC1D,IAAI,CAAC,KAAQ,CAAC,GACZ,OAAO;IAET,IAAM,EAAE,OAAI,cAAW,EAAK,OACtB,IAAW,EAAO,KAAK,EAAK,QAAQ,UAAU,IAAI,CAAC;IASzD,OARA,EAAG,qBAAqB,KAAK,KAAK,OAAO,EAAE,YAAS,GAAG,CAAQ,CAAC,GAC5D,EAAG,UAAU,MAAM,OAAO,SAAS,KAAK,QAC1C,EAAG,aACD,EAAc,KAAK,EAAG,IAAI,QAAQ,KAAK,IAAI,GAAG,EAAG,UAAU,OAAO,CAAC,CAAC,CAAC,CACvE,GAEF,EAAG,QAAQ,SAAS,EAAI,GACxB,EAAK,SAAS,CAAE,GACT;GACT,EACF;EACF,CAAC,CACH;CACF;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["DEFAULT_TAB_SIZE","backtickInputRegex","tildeInputRegex","CodeBlock","Node","languageClassPrefix","element","className","mergeAttributes","HTMLAttributes","node","token","helpers","output","language","h","commands","attributes","isAtStart","$anchor","empty","tabSize","editor","state","selection","$from","indent","indentedText","from","to","line","tr","codeBlockStart","codeBlockEnd","lines","currentLineIndex","charCount","relativeCursorPos","pos","i","leadingSpaces","spacesToRemove","lineStartPos","TextSelection","reverseIndentText","isAtEnd","endsWithDoubleNewline","before","after","doc","Selection","textblockTypeInputRule","match","Plugin","PluginKey","event","text","vscode","view","textNode","schema"],"sources":["../../../../../node_modules/@tiptap/extension-code-block/dist/index.js"],"sourcesContent":["// src/code-block.ts\nimport { mergeAttributes, Node, textblockTypeInputRule } from \"@tiptap/core\";\nimport { Plugin, PluginKey, Selection, TextSelection } from \"@tiptap/pm/state\";\nvar DEFAULT_TAB_SIZE = 4;\nvar backtickInputRegex = /^```([a-z]+)?[\\s\\n]$/;\nvar tildeInputRegex = /^~~~([a-z]+)?[\\s\\n]$/;\nvar CodeBlock = Node.create({\n name: \"codeBlock\",\n addOptions() {\n return {\n languageClassPrefix: \"language-\",\n exitOnTripleEnter: true,\n exitOnArrowDown: true,\n exitOnArrowUp: true,\n defaultLanguage: null,\n enableTabIndentation: false,\n tabSize: DEFAULT_TAB_SIZE,\n HTMLAttributes: {}\n };\n },\n content: \"text*\",\n marks: \"\",\n group: \"block\",\n code: true,\n defining: true,\n addAttributes() {\n return {\n language: {\n default: this.options.defaultLanguage,\n parseHTML: (element) => {\n var _a;\n const { languageClassPrefix } = this.options;\n if (!languageClassPrefix) {\n return null;\n }\n const classNames = [...((_a = element.firstElementChild) == null ? void 0 : _a.classList) || []];\n const languages = classNames.filter((className) => className.startsWith(languageClassPrefix)).map((className) => className.replace(languageClassPrefix, \"\"));\n const language = languages[0];\n if (!language) {\n return null;\n }\n return language;\n },\n rendered: false\n }\n };\n },\n parseHTML() {\n return [\n {\n tag: \"pre\",\n preserveWhitespace: \"full\"\n }\n ];\n },\n renderHTML({ node, HTMLAttributes }) {\n return [\n \"pre\",\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n [\n \"code\",\n {\n class: node.attrs.language ? this.options.languageClassPrefix + node.attrs.language : null\n },\n 0\n ]\n ];\n },\n markdownTokenName: \"code\",\n parseMarkdown: (token, helpers) => {\n var _a, _b;\n if (((_a = token.raw) == null ? void 0 : _a.startsWith(\"```\")) === false && ((_b = token.raw) == null ? void 0 : _b.startsWith(\"~~~\")) === false && token.codeBlockStyle !== \"indented\") {\n return [];\n }\n return helpers.createNode(\n \"codeBlock\",\n { language: token.lang || null },\n token.text ? [helpers.createTextNode(token.text)] : []\n );\n },\n renderMarkdown: (node, h) => {\n var _a;\n let output = \"\";\n const language = ((_a = node.attrs) == null ? void 0 : _a.language) || \"\";\n if (!node.content) {\n output = `\\`\\`\\`${language}\n\n\\`\\`\\``;\n } else {\n const lines = [`\\`\\`\\`${language}`, h.renderChildren(node.content), \"```\"];\n output = lines.join(\"\\n\");\n }\n return output;\n },\n addCommands() {\n return {\n setCodeBlock: (attributes) => ({ commands }) => {\n return commands.setNode(this.name, attributes);\n },\n toggleCodeBlock: (attributes) => ({ commands }) => {\n return commands.toggleNode(this.name, \"paragraph\", attributes);\n }\n };\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-Alt-c\": () => this.editor.commands.toggleCodeBlock(),\n // remove code block when at start of document or code block is empty\n Backspace: () => {\n const { empty, $anchor } = this.editor.state.selection;\n const isAtStart = $anchor.pos === 1;\n if (!empty || $anchor.parent.type.name !== this.name) {\n return false;\n }\n if (isAtStart || !$anchor.parent.textContent.length) {\n return this.editor.commands.clearNodes();\n }\n return false;\n },\n // handle tab indentation\n Tab: ({ editor }) => {\n var _a;\n if (!this.options.enableTabIndentation) {\n return false;\n }\n const tabSize = (_a = this.options.tabSize) != null ? _a : DEFAULT_TAB_SIZE;\n const { state } = editor;\n const { selection } = state;\n const { $from, empty } = selection;\n if ($from.parent.type !== this.type) {\n return false;\n }\n const indent = \" \".repeat(tabSize);\n if (empty) {\n return editor.commands.insertContent(indent);\n }\n return editor.commands.command(({ tr }) => {\n const { from, to } = selection;\n const text = state.doc.textBetween(from, to, \"\\n\", \"\\n\");\n const lines = text.split(\"\\n\");\n const indentedText = lines.map((line) => indent + line).join(\"\\n\");\n tr.replaceWith(from, to, state.schema.text(indentedText));\n return true;\n });\n },\n // handle shift+tab reverse indentation\n \"Shift-Tab\": ({ editor }) => {\n var _a;\n if (!this.options.enableTabIndentation) {\n return false;\n }\n const tabSize = (_a = this.options.tabSize) != null ? _a : DEFAULT_TAB_SIZE;\n const { state } = editor;\n const { selection } = state;\n const { $from, empty } = selection;\n if ($from.parent.type !== this.type) {\n return false;\n }\n if (empty) {\n return editor.commands.command(({ tr }) => {\n var _a2;\n const { pos } = $from;\n const codeBlockStart = $from.start();\n const codeBlockEnd = $from.end();\n const allText = state.doc.textBetween(codeBlockStart, codeBlockEnd, \"\\n\", \"\\n\");\n const lines = allText.split(\"\\n\");\n let currentLineIndex = 0;\n let charCount = 0;\n const relativeCursorPos = pos - codeBlockStart;\n for (let i = 0; i < lines.length; i += 1) {\n if (charCount + lines[i].length >= relativeCursorPos) {\n currentLineIndex = i;\n break;\n }\n charCount += lines[i].length + 1;\n }\n const currentLine = lines[currentLineIndex];\n const leadingSpaces = ((_a2 = currentLine.match(/^ */)) == null ? void 0 : _a2[0]) || \"\";\n const spacesToRemove = Math.min(leadingSpaces.length, tabSize);\n if (spacesToRemove === 0) {\n return true;\n }\n let lineStartPos = codeBlockStart;\n for (let i = 0; i < currentLineIndex; i += 1) {\n lineStartPos += lines[i].length + 1;\n }\n tr.delete(lineStartPos, lineStartPos + spacesToRemove);\n const cursorPosInLine = pos - lineStartPos;\n if (cursorPosInLine <= spacesToRemove) {\n tr.setSelection(TextSelection.create(tr.doc, lineStartPos));\n }\n return true;\n });\n }\n return editor.commands.command(({ tr }) => {\n const { from, to } = selection;\n const text = state.doc.textBetween(from, to, \"\\n\", \"\\n\");\n const lines = text.split(\"\\n\");\n const reverseIndentText = lines.map((line) => {\n var _a2;\n const leadingSpaces = ((_a2 = line.match(/^ */)) == null ? void 0 : _a2[0]) || \"\";\n const spacesToRemove = Math.min(leadingSpaces.length, tabSize);\n return line.slice(spacesToRemove);\n }).join(\"\\n\");\n tr.replaceWith(from, to, state.schema.text(reverseIndentText));\n return true;\n });\n },\n // exit node on triple enter\n Enter: ({ editor }) => {\n if (!this.options.exitOnTripleEnter) {\n return false;\n }\n const { state } = editor;\n const { selection } = state;\n const { $from, empty } = selection;\n if (!empty || $from.parent.type !== this.type) {\n return false;\n }\n const isAtEnd = $from.parentOffset === $from.parent.nodeSize - 2;\n const endsWithDoubleNewline = $from.parent.textContent.endsWith(\"\\n\\n\");\n if (!isAtEnd || !endsWithDoubleNewline) {\n return false;\n }\n return editor.chain().command(({ tr }) => {\n tr.delete($from.pos - 2, $from.pos);\n return true;\n }).exitCode().run();\n },\n // exit node on arrow up if there is no node before it\n ArrowUp: ({ editor }) => {\n if (!this.options.exitOnArrowUp) {\n return false;\n }\n const { state } = editor;\n const { selection } = state;\n const { $from, empty } = selection;\n if (!empty || $from.parent.type !== this.type) {\n return false;\n }\n if ($from.parentOffset !== 0) {\n return false;\n }\n const before = $from.before();\n if (before > 0) {\n return false;\n }\n return editor.commands.insertDefaultBlock({ pos: before });\n },\n // exit node on arrow down\n ArrowDown: ({ editor }) => {\n if (!this.options.exitOnArrowDown) {\n return false;\n }\n const { state } = editor;\n const { selection, doc } = state;\n const { $from, empty } = selection;\n if (!empty || $from.parent.type !== this.type) {\n return false;\n }\n const isAtEnd = $from.parentOffset === $from.parent.nodeSize - 2;\n if (!isAtEnd) {\n return false;\n }\n const after = $from.after();\n if (after === void 0) {\n return false;\n }\n const nodeAfter = doc.nodeAt(after);\n if (nodeAfter) {\n return editor.commands.command(({ tr }) => {\n tr.setSelection(Selection.near(doc.resolve(after)));\n return true;\n });\n }\n return editor.commands.exitCode();\n }\n };\n },\n addInputRules() {\n return [\n textblockTypeInputRule({\n find: backtickInputRegex,\n type: this.type,\n getAttributes: (match) => ({\n language: match[1]\n })\n }),\n textblockTypeInputRule({\n find: tildeInputRegex,\n type: this.type,\n getAttributes: (match) => ({\n language: match[1]\n })\n })\n ];\n },\n addProseMirrorPlugins() {\n return [\n // this plugin creates a code block for pasted content from VS Code\n // we can also detect the copied code language\n new Plugin({\n key: new PluginKey(\"codeBlockVSCodeHandler\"),\n props: {\n handlePaste: (view, event) => {\n if (!event.clipboardData) {\n return false;\n }\n if (this.editor.isActive(this.type.name)) {\n return false;\n }\n const text = event.clipboardData.getData(\"text/plain\");\n const vscode = event.clipboardData.getData(\"vscode-editor-data\");\n const vscodeData = vscode ? JSON.parse(vscode) : void 0;\n const language = vscodeData == null ? void 0 : vscodeData.mode;\n if (!text || !language) {\n return false;\n }\n const { tr, schema } = view.state;\n const textNode = schema.text(text.replace(/\\r\\n?/g, \"\\n\"));\n tr.replaceSelectionWith(this.type.create({ language }, textNode));\n if (tr.selection.$from.parent.type !== this.type) {\n tr.setSelection(\n TextSelection.near(tr.doc.resolve(Math.max(0, tr.selection.from - 2)))\n );\n }\n tr.setMeta(\"paste\", true);\n view.dispatch(tr);\n return true;\n }\n }\n })\n ];\n }\n});\n\n// src/index.ts\nvar index_default = CodeBlock;\nexport {\n CodeBlock,\n backtickInputRegex,\n index_default as default,\n tildeInputRegex\n};\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;;AAGA,IAAIA,IAAmB,GACnBC,IAAqB,wBACrBC,IAAkB,wBAClBC,IAAYC,EAAK,OAAO;CAC1B,MAAM;CACN,aAAa;EACX,OAAO;GACL,qBAAqB;GACrB,mBAAmB;GACnB,iBAAiB;GACjB,eAAe;GACf,iBAAiB;GACjB,sBAAsB;GACtB,SAASJ;GACT,gBAAgB,CAAC;EACnB;CACF;CACA,SAAS;CACT,OAAO;CACP,OAAO;CACP,MAAM;CACN,UAAU;CACV,gBAAgB;EACd,OAAO,EACL,UAAU;GACR,SAAS,KAAK,QAAQ;GACtB,YAAY,MAAY;IAEtB,IAAM,EAAE,2BAAwB,KAAK;IAUrC,OATKK,KAIa,CADE,GAAUC,EAAQ,mBAAyC,aAAc,CAAC,CACnE,CAAC,CAAC,QAAQ,MAAcC,EAAU,WAAWF,CAAmB,CAAC,CAAC,CAAC,KAAK,MAAcE,EAAU,QAAQF,GAAqB,EAAE,CACjI,CAAC,CAAC,MA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ACN,MAAM,KAAK;GACX,gBAAgB,OAAW,EACzB,UAAUkD,EAAM,GAClB;EACF,CAAC,CACH;CACF;CACA,wBAAwB;EACtB,OAAO,CAGL,IAAIC,EAAO;GACT,KAAK,IAAIC,EAAU,wBAAwB;GAC3C,OAAO,EACL,cAAc,GAAM,MAAU;IAI5B,IAHI,CAACC,EAAM,iBAGP,KAAK,OAAO,SAAS,KAAK,KAAK,IAAI,GACrC,OAAO;IAET,IAAMC,IAAOD,EAAM,cAAc,QAAQ,YAAY,GAC/CE,IAASF,EAAM,cAAc,QAAQ,oBAAoB,GAEzDzC,KADa2C,IAAS,KAAK,MAAMA,CAAM,IAAI,KAAK,EACrC,EAAyC;IAC1D,IAAI,CAACD,KAAQ,CAAC1C,GACZ,OAAO;IAET,IAAM,EAAE,OAAI,cAAW4C,EAAK,OACtBC,IAAWC,EAAO,KAAKJ,EAAK,QAAQ,UAAU,IAAI,CAAC;IASzD,OARAzB,EAAG,qBAAqB,KAAK,KAAK,OAAO,EAAE,YAAS,GAAG4B,CAAQ,CAAC,GAC5D5B,EAAG,UAAU,MAAM,OAAO,SAAS,KAAK,QAC1CA,EAAG,aACDY,EAAc,KAAKZ,EAAG,IAAI,QAAQ,KAAK,IAAI,GAAGA,EAAG,UAAU,OAAO,CAAC,CAAC,CAAC,CACvE,GAEFA,EAAG,QAAQ,SAAS,EAAI,GACxB2B,EAAK,SAAS3B,CAAE,GACT;GACT,EACF;EACF,CAAC,CACH;CACF;AACF,CAAC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Node as e } from "../../core/dist/index.js";
|
|
2
|
-
|
|
2
|
+
// node_modules/@tiptap/extension-document/dist/index.js
|
|
3
3
|
var t = e.create({
|
|
4
4
|
name: "doc",
|
|
5
5
|
topNode: !0,
|
|
6
6
|
content: "block+",
|
|
7
7
|
renderMarkdown: (e, t) => e.content ? t.renderChildren(e.content, "\n\n") : ""
|
|
8
8
|
});
|
|
9
|
-
//#endregion
|
|
10
9
|
export { t as Document };
|
|
11
10
|
|
|
12
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../node_modules/@tiptap/extension-document/dist/index.js"],"sourcesContent":["// src/document.ts\nimport { Node } from \"@tiptap/core\";\nvar Document = Node.create({\n name: \"doc\",\n topNode: true,\n content: \"block+\",\n renderMarkdown: (node, h) => {\n if (!node.content) {\n return \"\";\n }\n return h.renderChildren(node.content, \"\\n\\n\");\n }\n});\n\n// src/index.ts\nvar index_default = Document;\nexport {\n Document,\n index_default as default\n};\n//# sourceMappingURL=index.js.map"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":["Document","Node","node","h"],"sources":["../../../../../node_modules/@tiptap/extension-document/dist/index.js"],"sourcesContent":["// src/document.ts\nimport { Node } from \"@tiptap/core\";\nvar Document = Node.create({\n name: \"doc\",\n topNode: true,\n content: \"block+\",\n renderMarkdown: (node, h) => {\n if (!node.content) {\n return \"\";\n }\n return h.renderChildren(node.content, \"\\n\\n\");\n }\n});\n\n// src/index.ts\nvar index_default = Document;\nexport {\n Document,\n index_default as default\n};\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;AAEA,IAAIA,IAAWC,EAAK,OAAO;CACzB,MAAM;CACN,SAAS;CACT,SAAS;CACT,iBAAiB,GAAM,MAChBC,EAAK,UAGHC,EAAE,eAAeD,EAAK,SAAS,MAAM,IAFnC;AAIb,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Node as e, mergeAttributes as t } from "../../core/dist/index.js";
|
|
2
|
-
|
|
2
|
+
// node_modules/@tiptap/extension-hard-break/dist/index.js
|
|
3
3
|
var n = e.create({
|
|
4
4
|
name: "hardBreak",
|
|
5
5
|
markdownTokenName: "br",
|
|
@@ -45,7 +45,6 @@ var n = e.create({
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
-
//#endregion
|
|
49
48
|
export { n as HardBreak };
|
|
50
49
|
|
|
51
50
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../node_modules/@tiptap/extension-hard-break/dist/index.js"],"sourcesContent":["// src/hard-break.ts\nimport { mergeAttributes, Node } from \"@tiptap/core\";\nvar HardBreak = Node.create({\n name: \"hardBreak\",\n markdownTokenName: \"br\",\n addOptions() {\n return {\n keepMarks: true,\n HTMLAttributes: {}\n };\n },\n inline: true,\n group: \"inline\",\n selectable: false,\n linebreakReplacement: true,\n parseHTML() {\n return [{ tag: \"br\" }];\n },\n renderHTML({ HTMLAttributes }) {\n return [\"br\", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];\n },\n renderText() {\n return \"\\n\";\n },\n renderMarkdown: () => ` \n`,\n parseMarkdown: () => {\n return {\n type: \"hardBreak\"\n };\n },\n addCommands() {\n return {\n setHardBreak: () => ({ commands, chain, state, editor }) => {\n return commands.first([\n () => commands.exitCode(),\n () => commands.command(() => {\n const { selection, storedMarks } = state;\n if (selection.$from.parent.type.spec.isolating) {\n return false;\n }\n const { keepMarks } = this.options;\n const { splittableMarks } = editor.extensionManager;\n const marks = storedMarks || selection.$to.parentOffset && selection.$from.marks();\n return chain().insertContent({ type: this.name }).command(({ tr, dispatch }) => {\n if (dispatch && marks && keepMarks) {\n const filteredMarks = marks.filter(\n (mark) => splittableMarks.includes(mark.type.name)\n );\n tr.ensureMarks(filteredMarks);\n }\n return true;\n }).scrollIntoView().run();\n })\n ]);\n }\n };\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-Enter\": () => this.editor.commands.setHardBreak(),\n \"Shift-Enter\": () => this.editor.commands.setHardBreak()\n };\n }\n});\n\n// src/index.ts\nvar index_default = HardBreak;\nexport {\n HardBreak,\n index_default as default\n};\n//# sourceMappingURL=index.js.map"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":["HardBreak","Node","mergeAttributes","HTMLAttributes","commands","state","selection","editor","marks","storedMarks","chain","dispatch","keepMarks","filteredMarks","splittableMarks","mark"],"sources":["../../../../../node_modules/@tiptap/extension-hard-break/dist/index.js"],"sourcesContent":["// src/hard-break.ts\nimport { mergeAttributes, Node } from \"@tiptap/core\";\nvar HardBreak = Node.create({\n name: \"hardBreak\",\n markdownTokenName: \"br\",\n addOptions() {\n return {\n keepMarks: true,\n HTMLAttributes: {}\n };\n },\n inline: true,\n group: \"inline\",\n selectable: false,\n linebreakReplacement: true,\n parseHTML() {\n return [{ tag: \"br\" }];\n },\n renderHTML({ HTMLAttributes }) {\n return [\"br\", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)];\n },\n renderText() {\n return \"\\n\";\n },\n renderMarkdown: () => ` \n`,\n parseMarkdown: () => {\n return {\n type: \"hardBreak\"\n };\n },\n addCommands() {\n return {\n setHardBreak: () => ({ commands, chain, state, editor }) => {\n return commands.first([\n () => commands.exitCode(),\n () => commands.command(() => {\n const { selection, storedMarks } = state;\n if (selection.$from.parent.type.spec.isolating) {\n return false;\n }\n const { keepMarks } = this.options;\n const { splittableMarks } = editor.extensionManager;\n const marks = storedMarks || selection.$to.parentOffset && selection.$from.marks();\n return chain().insertContent({ type: this.name }).command(({ tr, dispatch }) => {\n if (dispatch && marks && keepMarks) {\n const filteredMarks = marks.filter(\n (mark) => splittableMarks.includes(mark.type.name)\n );\n tr.ensureMarks(filteredMarks);\n }\n return true;\n }).scrollIntoView().run();\n })\n ]);\n }\n };\n },\n addKeyboardShortcuts() {\n return {\n \"Mod-Enter\": () => this.editor.commands.setHardBreak(),\n \"Shift-Enter\": () => this.editor.commands.setHardBreak()\n };\n }\n});\n\n// src/index.ts\nvar index_default = HardBreak;\nexport {\n HardBreak,\n index_default as default\n};\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;AAEA,IAAIA,IAAYC,EAAK,OAAO;CAC1B,MAAM;CACN,mBAAmB;CACnB,aAAa;EACX,OAAO;GACL,WAAW;GACX,gBAAgB,CAAC;EACnB;CACF;CACA,QAAQ;CACR,OAAO;CACP,YAAY;CACZ,sBAAsB;CACtB,YAAY;EACV,OAAO,CAAC,EAAE,KAAK,KAAK,CAAC;CACvB;CACA,WAAW,EAAE,qBAAkB;EAC7B,OAAO,CAAC,MAAMC,EAAgB,KAAK,QAAQ,gBAAgBC,CAAc,CAAC;CAC5E;CACA,aAAa;EACX,OAAO;CACT;CACA,sBAAsB;CAEtB,sBACS,EACL,MAAM,YACR;CAEF,cAAc;EACZ,OAAO,EACL,qBAAqB,EAAE,aAAU,UAAO,UAAO,gBACtCC,EAAS,MAAM,OACdA,EAAS,SAAS,SAClBA,EAAS,cAAc;GAC3B,IAAM,EAAE,cAAW,mBAAgBC;GACnC,IAAIC,EAAU,MAAM,OAAO,KAAK,KAAK,WACnC,OAAO;GAET,IAAM,EAAE,iBAAc,KAAK,SACrB,EAAE,uBAAoBC,EAAO,kBAC7BC,IAAQC,KAAeH,EAAU,IAAI,gBAAgBA,EAAU,MAAM,MAAM;GACjF,OAAOI,EAAM,CAAC,CAAC,cAAc,EAAE,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,EAAE,OAAI,kBAAe;IAC9E,IAAIC,KAAYH,KAASI,GAAW;KAClC,IAAMC,IAAgBL,EAAM,QACzB,MAASM,EAAgB,SAASC,EAAK,KAAK,IAAI,CACnD;KACA,EAAG,YAAYF,CAAa;IAC9B;IACA,OAAO;GACT,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,IAAI;EAC1B,CAAC,CACH,CAAC,EAEL;CACF;CACA,uBAAuB;EACrB,OAAO;GACL,mBAAmB,KAAK,OAAO,SAAS,aAAa;GACrD,qBAAqB,KAAK,OAAO,SAAS,aAAa;EACzD;CACF;AACF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Node as e, mergeAttributes as t, textblockTypeInputRule as n } from "../../core/dist/index.js";
|
|
2
|
-
|
|
2
|
+
// node_modules/@tiptap/extension-heading/dist/index.js
|
|
3
3
|
var r = e.create({
|
|
4
4
|
name: "heading",
|
|
5
5
|
addOptions() {
|
|
@@ -62,7 +62,6 @@ var r = e.create({
|
|
|
62
62
|
}));
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
|
-
//#endregion
|
|
66
65
|
export { r as Heading };
|
|
67
66
|
|
|
68
67
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../node_modules/@tiptap/extension-heading/dist/index.js"],"sourcesContent":["// src/heading.ts\nimport { mergeAttributes, Node, textblockTypeInputRule } from \"@tiptap/core\";\nvar Heading = Node.create({\n name: \"heading\",\n addOptions() {\n return {\n levels: [1, 2, 3, 4, 5, 6],\n HTMLAttributes: {}\n };\n },\n content: \"inline*\",\n group: \"block\",\n defining: true,\n addAttributes() {\n return {\n level: {\n default: 1,\n rendered: false\n }\n };\n },\n parseHTML() {\n return this.options.levels.map((level) => ({\n tag: `h${level}`,\n attrs: { level }\n }));\n },\n renderHTML({ node, HTMLAttributes }) {\n const hasLevel = this.options.levels.includes(node.attrs.level);\n const level = hasLevel ? node.attrs.level : this.options.levels[0];\n return [`h${level}`, mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];\n },\n parseMarkdown: (token, helpers) => {\n return helpers.createNode(\n \"heading\",\n { level: token.depth || 1 },\n helpers.parseInline(token.tokens || [])\n );\n },\n renderMarkdown: (node, h) => {\n var _a;\n const level = ((_a = node.attrs) == null ? void 0 : _a.level) ? parseInt(node.attrs.level, 10) : 1;\n const headingChars = \"#\".repeat(level);\n if (!node.content) {\n return \"\";\n }\n return `${headingChars} ${h.renderChildren(node.content)}`;\n },\n addCommands() {\n return {\n setHeading: (attributes) => ({ commands }) => {\n if (!this.options.levels.includes(attributes.level)) {\n return false;\n }\n return commands.setNode(this.name, attributes);\n },\n toggleHeading: (attributes) => ({ commands }) => {\n if (!this.options.levels.includes(attributes.level)) {\n return false;\n }\n return commands.toggleNode(this.name, \"paragraph\", attributes);\n }\n };\n },\n addKeyboardShortcuts() {\n return this.options.levels.reduce(\n (items, level) => ({\n ...items,\n [`Mod-Alt-${level}`]: () => this.editor.commands.toggleHeading({ level })\n }),\n {}\n );\n },\n addInputRules() {\n return this.options.levels.map((level) => {\n return textblockTypeInputRule({\n find: new RegExp(`^(#{${Math.min(...this.options.levels)},${level}})\\\\s$`),\n type: this.type,\n getAttributes: {\n level\n }\n });\n });\n }\n});\n\n// src/index.ts\nvar index_default = Heading;\nexport {\n Heading,\n index_default as default\n};\n//# sourceMappingURL=index.js.map"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":["Heading","Node","level","node","mergeAttributes","HTMLAttributes","helpers","token","headingChars","h","attributes","commands","items","textblockTypeInputRule"],"sources":["../../../../../node_modules/@tiptap/extension-heading/dist/index.js"],"sourcesContent":["// src/heading.ts\nimport { mergeAttributes, Node, textblockTypeInputRule } from \"@tiptap/core\";\nvar Heading = Node.create({\n name: \"heading\",\n addOptions() {\n return {\n levels: [1, 2, 3, 4, 5, 6],\n HTMLAttributes: {}\n };\n },\n content: \"inline*\",\n group: \"block\",\n defining: true,\n addAttributes() {\n return {\n level: {\n default: 1,\n rendered: false\n }\n };\n },\n parseHTML() {\n return this.options.levels.map((level) => ({\n tag: `h${level}`,\n attrs: { level }\n }));\n },\n renderHTML({ node, HTMLAttributes }) {\n const hasLevel = this.options.levels.includes(node.attrs.level);\n const level = hasLevel ? node.attrs.level : this.options.levels[0];\n return [`h${level}`, mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];\n },\n parseMarkdown: (token, helpers) => {\n return helpers.createNode(\n \"heading\",\n { level: token.depth || 1 },\n helpers.parseInline(token.tokens || [])\n );\n },\n renderMarkdown: (node, h) => {\n var _a;\n const level = ((_a = node.attrs) == null ? void 0 : _a.level) ? parseInt(node.attrs.level, 10) : 1;\n const headingChars = \"#\".repeat(level);\n if (!node.content) {\n return \"\";\n }\n return `${headingChars} ${h.renderChildren(node.content)}`;\n },\n addCommands() {\n return {\n setHeading: (attributes) => ({ commands }) => {\n if (!this.options.levels.includes(attributes.level)) {\n return false;\n }\n return commands.setNode(this.name, attributes);\n },\n toggleHeading: (attributes) => ({ commands }) => {\n if (!this.options.levels.includes(attributes.level)) {\n return false;\n }\n return commands.toggleNode(this.name, \"paragraph\", attributes);\n }\n };\n },\n addKeyboardShortcuts() {\n return this.options.levels.reduce(\n (items, level) => ({\n ...items,\n [`Mod-Alt-${level}`]: () => this.editor.commands.toggleHeading({ level })\n }),\n {}\n );\n },\n addInputRules() {\n return this.options.levels.map((level) => {\n return textblockTypeInputRule({\n find: new RegExp(`^(#{${Math.min(...this.options.levels)},${level}})\\\\s$`),\n type: this.type,\n getAttributes: {\n level\n }\n });\n });\n }\n});\n\n// src/index.ts\nvar index_default = Heading;\nexport {\n Heading,\n index_default as default\n};\n//# sourceMappingURL=index.js.map"],"ignoreList":[0],"mappings":";;AAEA,IAAIA,IAAUC,EAAK,OAAO;CACxB,MAAM;CACN,aAAa;EACX,OAAO;GACL,QAAQ;IAAC;IAAG;IAAG;IAAG;IAAG;IAAG;GAAC;GACzB,gBAAgB,CAAC;EACnB;CACF;CACA,SAAS;CACT,OAAO;CACP,UAAU;CACV,gBAAgB;EACd,OAAO,EACL,OAAO;GACL,SAAS;GACT,UAAU;EACZ,EACF;CACF;CACA,YAAY;EACV,OAAO,KAAK,QAAQ,OAAO,KAAK,OAAW;GACzC,KAAK,IAAIC;GACT,OAAO,EAAE,SAAM;EACjB,EAAE;CACJ;CACA,WAAW,EAAE,SAAM,qBAAkB;EAGnC,OAAO;GAAC,IAFS,KAAK,QAAQ,OAAO,SAASC,EAAK,MAAM,KACpC,IAAIA,EAAK,MAAM,QAAQ,KAAK,QAAQ,OAAO;GAC3CC,EAAgB,KAAK,QAAQ,gBAAgBC,CAAc;GAAG;EAAC;CACtF;CACA,gBAAgB,GAAO,MACdC,EAAQ,WACb,WACA,EAAE,OAAOC,EAAM,SAAS,EAAE,GAC1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