@burdenoff/microfe-support 2026.1029.3 → 2026.1031.2
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.js +57 -58
- 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,13 +1,13 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { AllSelection as
|
|
5
|
-
import {
|
|
6
|
-
import { liftListItem as
|
|
7
|
-
import { DecorationSet as
|
|
8
|
-
import { keymap as
|
|
9
|
-
|
|
10
|
-
function
|
|
2
|
+
import { RemoveMarkStep as t, ReplaceAroundStep as n, ReplaceStep as r, Transform as i, canJoin as a, canSplit as o, findWrapping as s, joinPoint as c, liftTarget as l } from "../../../prosemirror-transform/dist/index.js";
|
|
3
|
+
import { createParagraphNear as u, exitCode as d, joinBackward as f, joinDown as p, joinForward as m, joinTextblockBackward as h, joinTextblockForward as g, joinUp as _, lift as ee, liftEmptyBlock as te, newlineInCode as ne, selectNodeBackward as re, selectNodeForward as ie, selectParentNode as ae, selectTextblockEnd as v, selectTextblockStart as oe, setBlockType as y, wrapIn as se } from "../../../prosemirror-commands/dist/index.js";
|
|
4
|
+
import { AllSelection as ce, EditorState as le, NodeSelection as ue, Plugin as b, PluginKey as x, Selection as S, TextSelection as C } from "../../../prosemirror-state/dist/index.js";
|
|
5
|
+
import { DOMParser as de, DOMSerializer as fe, Fragment as w, Schema as pe, Slice as me } from "../../../prosemirror-model/dist/index.js";
|
|
6
|
+
import { liftListItem as he, sinkListItem as ge, wrapInList as _e } from "../../../prosemirror-schema-list/dist/index.js";
|
|
7
|
+
import { DecorationSet as T, EditorView as ve } from "../../../prosemirror-view/dist/index.js";
|
|
8
|
+
import { keymap as ye } from "../../../prosemirror-keymap/dist/index.js";
|
|
9
|
+
// node_modules/@tiptap/core/dist/index.js
|
|
10
|
+
function E(e) {
|
|
11
11
|
let { state: t, transaction: n } = e, { selection: r } = n, { doc: i } = n, { storedMarks: a } = n;
|
|
12
12
|
return {
|
|
13
13
|
...t,
|
|
@@ -31,7 +31,7 @@ function w(e) {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
var
|
|
34
|
+
var D = class e {
|
|
35
35
|
constructor(e) {
|
|
36
36
|
this.editor = e.editor, this.rawCommands = this.editor.extensionManager.commands, this.customState = e.state;
|
|
37
37
|
}
|
|
@@ -91,7 +91,7 @@ var T = class e {
|
|
|
91
91
|
tr: e,
|
|
92
92
|
editor: r,
|
|
93
93
|
view: a,
|
|
94
|
-
state:
|
|
94
|
+
state: E({
|
|
95
95
|
state: i,
|
|
96
96
|
transaction: e
|
|
97
97
|
}),
|
|
@@ -104,19 +104,19 @@ var T = class e {
|
|
|
104
104
|
};
|
|
105
105
|
return o;
|
|
106
106
|
}
|
|
107
|
-
},
|
|
107
|
+
}, be = () => ({ editor: e, view: t }) => (requestAnimationFrame(() => {
|
|
108
108
|
if (!e.isDestroyed) {
|
|
109
109
|
var n;
|
|
110
110
|
t.dom.blur(), (n = window) == null || (n = n.getSelection()) == null || n.removeAllRanges();
|
|
111
111
|
}
|
|
112
|
-
}), !0),
|
|
112
|
+
}), !0), xe = (e = !0) => ({ commands: t }) => t.setContent("", { emitUpdate: e }), Se = () => ({ state: e, tr: t, dispatch: n }) => {
|
|
113
113
|
let { selection: r } = t, { ranges: i } = r;
|
|
114
114
|
return n && i.forEach(({ $from: n, $to: r }) => {
|
|
115
115
|
e.doc.nodesBetween(n.pos, r.pos, (e, n) => {
|
|
116
116
|
if (e.type.isText) return;
|
|
117
117
|
let { doc: r, mapping: i } = t, a = r.resolve(i.map(n)), o = r.resolve(i.map(n + e.nodeSize)), s = a.blockRange(o);
|
|
118
118
|
if (!s) return;
|
|
119
|
-
let c =
|
|
119
|
+
let c = l(s);
|
|
120
120
|
if (e.type.isTextblock) {
|
|
121
121
|
let { defaultType: e } = a.parent.contentMatchAt(a.index());
|
|
122
122
|
t.setNodeMarkup(s.start, e);
|
|
@@ -124,12 +124,12 @@ var T = class e {
|
|
|
124
124
|
(c || c === 0) && t.lift(s, c);
|
|
125
125
|
});
|
|
126
126
|
}), !0;
|
|
127
|
-
},
|
|
127
|
+
}, Ce = (e) => (t) => e(t), we = () => ({ state: e, dispatch: t }) => u(e, t), Te = (e, t) => ({ editor: n, tr: r }) => {
|
|
128
128
|
let { state: i } = n, a = i.doc.slice(e.from, e.to);
|
|
129
129
|
r.deleteRange(e.from, e.to);
|
|
130
130
|
let o = r.mapping.map(t);
|
|
131
|
-
return r.insert(o, a.content), r.setSelection(new
|
|
132
|
-
},
|
|
131
|
+
return r.insert(o, a.content), r.setSelection(new C(r.doc.resolve(Math.max(o - 1, 0)))), !0;
|
|
132
|
+
}, Ee = () => ({ tr: e, dispatch: t }) => {
|
|
133
133
|
let { selection: n } = e, r = n.$anchor.node();
|
|
134
134
|
if (r.content.size > 0) return !1;
|
|
135
135
|
let i = e.selection.$anchor;
|
|
@@ -142,15 +142,15 @@ var T = class e {
|
|
|
142
142
|
}
|
|
143
143
|
return !1;
|
|
144
144
|
};
|
|
145
|
-
function
|
|
145
|
+
function O(e, t) {
|
|
146
146
|
if (typeof e == "string") {
|
|
147
147
|
if (!t.nodes[e]) throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);
|
|
148
148
|
return t.nodes[e];
|
|
149
149
|
}
|
|
150
150
|
return e;
|
|
151
151
|
}
|
|
152
|
-
var
|
|
153
|
-
let i =
|
|
152
|
+
var De = (e) => ({ tr: t, state: n, dispatch: r }) => {
|
|
153
|
+
let i = O(e, n.schema), a = t.selection.$anchor;
|
|
154
154
|
for (let e = a.depth; e > 0; --e) if (a.node(e).type === i) {
|
|
155
155
|
if (r) {
|
|
156
156
|
let n = a.before(e), r = a.after(e);
|
|
@@ -159,92 +159,92 @@ var ke = (e) => ({ tr: t, state: n, dispatch: r }) => {
|
|
|
159
159
|
return !0;
|
|
160
160
|
}
|
|
161
161
|
return !1;
|
|
162
|
-
},
|
|
162
|
+
}, Oe = (e) => ({ tr: t, dispatch: n }) => {
|
|
163
163
|
let { from: r, to: i } = e;
|
|
164
164
|
return n && t.delete(r, i), !0;
|
|
165
|
-
},
|
|
165
|
+
}, ke = (e) => e.content ? /^text(\*|\+)/.test(e.content) : !1, Ae = (e, t, n) => {
|
|
166
166
|
if (!e.parent.isInline || n === "left" && e.pos > e.start() || n === "right" && e.pos < e.end()) return e.pos;
|
|
167
167
|
let r = t.nodes[e.parent.type.name].spec;
|
|
168
|
-
return
|
|
169
|
-
},
|
|
170
|
-
from:
|
|
171
|
-
to:
|
|
172
|
-
}),
|
|
168
|
+
return ke(r) ? n === "left" ? e.start() - 1 : e.end() + 1 : e.pos;
|
|
169
|
+
}, je = (e, t, n) => ({
|
|
170
|
+
from: Ae(e, n, "left"),
|
|
171
|
+
to: Ae(t, n, "right")
|
|
172
|
+
}), Me = () => ({ state: e, dispatch: t }) => {
|
|
173
173
|
if (e.selection.empty) return !1;
|
|
174
174
|
if (t) {
|
|
175
175
|
let n = e.tr, { ranges: r } = e.selection, i = n.steps.length;
|
|
176
176
|
r.forEach((t) => {
|
|
177
|
-
let r = n.mapping.slice(i), { from: a, to: o } =
|
|
177
|
+
let r = n.mapping.slice(i), { from: a, to: o } = je(n.doc.resolve(r.map(t.$from.pos)), n.doc.resolve(r.map(t.$to.pos)), e.schema);
|
|
178
178
|
n.deleteRange(a, o);
|
|
179
|
-
}), n.selection.empty || n.setSelection(
|
|
179
|
+
}), n.selection.empty || n.setSelection(C.near(n.doc.resolve(n.selection.from))), n.scrollIntoView(), t(n);
|
|
180
180
|
}
|
|
181
181
|
return !0;
|
|
182
|
-
},
|
|
183
|
-
function
|
|
182
|
+
}, Ne = () => ({ commands: e }) => e.keyboardShortcut("Enter"), Pe = () => ({ state: e, dispatch: t }) => d(e, t);
|
|
183
|
+
function Fe(e) {
|
|
184
184
|
return Object.prototype.toString.call(e) === "[object RegExp]";
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function k(e, t, n = { strict: !0 }) {
|
|
187
187
|
let r = Object.keys(t);
|
|
188
|
-
return !r.length || r.every((r) => n.strict ? t[r] === e[r] :
|
|
188
|
+
return !r.length || r.every((r) => n.strict ? t[r] === e[r] : Fe(t[r]) ? t[r].test(e[r]) : t[r] === e[r]);
|
|
189
189
|
}
|
|
190
|
-
function
|
|
191
|
-
return e.find((e) => e.type === t &&
|
|
190
|
+
function Ie(e, t, n = {}) {
|
|
191
|
+
return e.find((e) => e.type === t && k(Object.fromEntries(Object.keys(n).map((t) => [t, e.attrs[t]])), n));
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
return !!
|
|
193
|
+
function Le(e, t, n = {}) {
|
|
194
|
+
return !!Ie(e, t, n);
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function Re(e, t, n) {
|
|
197
197
|
if (!e || !t) return;
|
|
198
198
|
let r = e.parent.childAfter(e.parentOffset);
|
|
199
|
-
if (
|
|
199
|
+
if (r.node && r.node.marks.some((e) => e.type === t) || (r = e.parent.childBefore(e.parentOffset)), !r.node || !r.node.marks.some((e) => e.type === t)) return;
|
|
200
200
|
if (!n) {
|
|
201
201
|
let e = r.node.marks.find((e) => e.type === t);
|
|
202
202
|
e && (n = e.attrs);
|
|
203
203
|
}
|
|
204
|
-
if (!
|
|
204
|
+
if (!Ie([...r.node.marks], t, n)) return;
|
|
205
205
|
let i = r.index, a = e.start() + r.offset, o = i + 1, s = a + r.node.nodeSize;
|
|
206
|
-
for (; i > 0 &&
|
|
207
|
-
for (; o < e.parent.childCount &&
|
|
206
|
+
for (; i > 0 && Le([...e.parent.child(i - 1).marks], t, n);) --i, a -= e.parent.child(i).nodeSize;
|
|
207
|
+
for (; o < e.parent.childCount && Le([...e.parent.child(o).marks], t, n);) s += e.parent.child(o).nodeSize, o += 1;
|
|
208
208
|
return {
|
|
209
209
|
from: a,
|
|
210
210
|
to: s
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function A(e, t) {
|
|
214
214
|
if (typeof e == "string") {
|
|
215
215
|
if (!t.marks[e]) throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);
|
|
216
216
|
return t.marks[e];
|
|
217
217
|
}
|
|
218
218
|
return e;
|
|
219
219
|
}
|
|
220
|
-
var
|
|
221
|
-
let a =
|
|
220
|
+
var ze = (e, t) => ({ tr: n, state: r, dispatch: i }) => {
|
|
221
|
+
let a = A(e, r.schema), { doc: o, selection: s } = n, { $from: c, from: l, to: u } = s;
|
|
222
222
|
if (i) {
|
|
223
|
-
let e =
|
|
223
|
+
let e = Re(c, a, t);
|
|
224
224
|
if (e && e.from <= l && e.to >= u) {
|
|
225
|
-
let t =
|
|
225
|
+
let t = C.create(o, e.from, e.to);
|
|
226
226
|
n.setSelection(t);
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
return !0;
|
|
230
|
-
},
|
|
230
|
+
}, Be = (e) => (t) => {
|
|
231
231
|
let n = typeof e == "function" ? e(t) : e;
|
|
232
232
|
for (let e = 0; e < n.length; e += 1) if (n[e](t)) return !0;
|
|
233
233
|
return !1;
|
|
234
234
|
};
|
|
235
|
-
function
|
|
236
|
-
return e instanceof
|
|
235
|
+
function Ve(e) {
|
|
236
|
+
return e instanceof C;
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function j(e = 0, t = 0, n = 0) {
|
|
239
239
|
return Math.min(Math.max(e, t), n);
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function He(e, t = null) {
|
|
242
242
|
if (!t) return null;
|
|
243
|
-
let n =
|
|
243
|
+
let n = S.atStart(e), r = S.atEnd(e);
|
|
244
244
|
if (t === "start" || t === !0) return n;
|
|
245
245
|
if (t === "end") return r;
|
|
246
246
|
let i = n.from, a = r.to;
|
|
247
|
-
return t === "all" ?
|
|
247
|
+
return t === "all" ? C.create(e, j(0, i, a), j(e.content.size, i, a)) : C.create(e, j(t, i, a), j(t, i, a));
|
|
248
248
|
}
|
|
249
249
|
function Ue() {
|
|
250
250
|
return ["Android"].includes(navigator.platform) || /android/i.test(navigator.userAgent);
|
|
@@ -277,8 +277,8 @@ var Ge = (e = null, t = {}) => ({ editor: n, view: r, tr: i, dispatch: a }) => {
|
|
|
277
277
|
} catch {
|
|
278
278
|
return !1;
|
|
279
279
|
}
|
|
280
|
-
if (a && e === null && !
|
|
281
|
-
let s =
|
|
280
|
+
if (a && e === null && !Ve(n.state.selection)) return o(), !0;
|
|
281
|
+
let s = He(i.doc, e) || n.state.selection, c = n.state.selection.eq(s);
|
|
282
282
|
return a && (c || i.setSelection(s), c && i.storedMarks && i.setStoredMarks(i.storedMarks), o()), !0;
|
|
283
283
|
}, Ke = (e, t) => (n) => e.every((e, r) => t(e, {
|
|
284
284
|
...n,
|
|
@@ -302,120 +302,120 @@ function N(e) {
|
|
|
302
302
|
function Ye(e) {
|
|
303
303
|
return typeof e?.nodesBetween == "function";
|
|
304
304
|
}
|
|
305
|
-
function P(e,
|
|
305
|
+
function P(e, t, n) {
|
|
306
306
|
if (Ye(e)) return e;
|
|
307
|
-
let
|
|
308
|
-
|
|
307
|
+
let r = typeof e == "object" && !!e;
|
|
308
|
+
n = {
|
|
309
309
|
slice: !0,
|
|
310
310
|
parseOptions: {},
|
|
311
|
-
...
|
|
311
|
+
...n
|
|
312
312
|
};
|
|
313
|
-
let
|
|
314
|
-
if (
|
|
315
|
-
if (Array.isArray(e) && e.length > 0) return
|
|
316
|
-
let
|
|
317
|
-
return
|
|
318
|
-
} catch (
|
|
319
|
-
if (
|
|
320
|
-
return console.warn("[tiptap warn]: Invalid content.", "Passed value:", e, "Error:",
|
|
321
|
-
}
|
|
322
|
-
if (
|
|
323
|
-
if (
|
|
324
|
-
let r = !1,
|
|
325
|
-
topNode:
|
|
326
|
-
marks:
|
|
327
|
-
nodes:
|
|
313
|
+
let i = typeof e == "string";
|
|
314
|
+
if (r) try {
|
|
315
|
+
if (Array.isArray(e) && e.length > 0) return w.fromArray(e.map((e) => t.nodeFromJSON(e)));
|
|
316
|
+
let r = t.nodeFromJSON(e);
|
|
317
|
+
return n.errorOnInvalidContent && r.check(), r;
|
|
318
|
+
} catch (r) {
|
|
319
|
+
if (n.errorOnInvalidContent) throw Error("[tiptap error]: Invalid JSON content", { cause: r });
|
|
320
|
+
return console.warn("[tiptap warn]: Invalid content.", "Passed value:", e, "Error:", r), P("", t, n);
|
|
321
|
+
}
|
|
322
|
+
if (i) {
|
|
323
|
+
if (n.errorOnInvalidContent) {
|
|
324
|
+
let r = !1, i = "", a = new pe({
|
|
325
|
+
topNode: t.spec.topNode,
|
|
326
|
+
marks: t.spec.marks,
|
|
327
|
+
nodes: t.spec.nodes.append({ __tiptap__private__unknown__catch__all__node: {
|
|
328
328
|
content: "inline*",
|
|
329
329
|
group: "block",
|
|
330
330
|
parseDOM: [{
|
|
331
331
|
tag: "*",
|
|
332
|
-
getAttrs: (e) => (r = !0,
|
|
332
|
+
getAttrs: (e) => (r = !0, i = typeof e == "string" ? e : e.outerHTML, null)
|
|
333
333
|
}]
|
|
334
334
|
} })
|
|
335
335
|
});
|
|
336
|
-
if (
|
|
336
|
+
if (n.slice ? de.fromSchema(a).parseSlice(N(e), n.parseOptions) : de.fromSchema(a).parse(N(e), n.parseOptions), n.errorOnInvalidContent && r) throw Error("[tiptap error]: Invalid HTML content", { cause: /* @__PURE__ */ Error(`Invalid element found: ${i}`) });
|
|
337
337
|
}
|
|
338
|
-
let r =
|
|
339
|
-
return
|
|
338
|
+
let r = de.fromSchema(t);
|
|
339
|
+
return n.slice ? r.parseSlice(N(e), n.parseOptions).content : r.parse(N(e), n.parseOptions);
|
|
340
340
|
}
|
|
341
|
-
return P("",
|
|
341
|
+
return P("", t, n);
|
|
342
342
|
}
|
|
343
343
|
function Xe(e) {
|
|
344
344
|
return !("type" in e);
|
|
345
345
|
}
|
|
346
|
-
function Ze(e, t,
|
|
347
|
-
let
|
|
348
|
-
if (
|
|
349
|
-
let
|
|
350
|
-
if (!(
|
|
351
|
-
let
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}), e.setSelection(
|
|
355
|
-
}
|
|
356
|
-
var Qe = (e, t, n) => ({ tr:
|
|
357
|
-
if (
|
|
346
|
+
function Ze(e, t, i) {
|
|
347
|
+
let a = e.steps.length - 1;
|
|
348
|
+
if (a < t) return;
|
|
349
|
+
let o = e.steps[a];
|
|
350
|
+
if (!(o instanceof r || o instanceof n)) return;
|
|
351
|
+
let s = e.mapping.maps[a], c = 0;
|
|
352
|
+
s.forEach((e, t, n, r) => {
|
|
353
|
+
c === 0 && (c = r);
|
|
354
|
+
}), e.setSelection(S.near(e.doc.resolve(c), i));
|
|
355
|
+
}
|
|
356
|
+
var Qe = (e, t, n) => ({ tr: r, dispatch: i, editor: a }) => {
|
|
357
|
+
if (i) {
|
|
358
358
|
n = {
|
|
359
|
-
parseOptions:
|
|
359
|
+
parseOptions: a.options.parseOptions,
|
|
360
360
|
updateSelection: !0,
|
|
361
361
|
applyInputRules: !1,
|
|
362
362
|
applyPasteRules: !1,
|
|
363
363
|
...n
|
|
364
364
|
};
|
|
365
|
-
let
|
|
366
|
-
|
|
367
|
-
editor:
|
|
365
|
+
let i, o = (e) => {
|
|
366
|
+
a.emit("contentError", {
|
|
367
|
+
editor: a,
|
|
368
368
|
error: e,
|
|
369
369
|
disableCollaboration: () => {
|
|
370
|
-
"collaboration" in
|
|
370
|
+
"collaboration" in a.storage && typeof a.storage.collaboration == "object" && a.storage.collaboration && (a.storage.collaboration.isDisabled = !0);
|
|
371
371
|
}
|
|
372
372
|
});
|
|
373
|
-
},
|
|
373
|
+
}, s = {
|
|
374
374
|
preserveWhitespace: "full",
|
|
375
375
|
...n.parseOptions
|
|
376
376
|
};
|
|
377
|
-
if (!n.errorOnInvalidContent && !
|
|
378
|
-
P(t,
|
|
379
|
-
parseOptions:
|
|
377
|
+
if (!n.errorOnInvalidContent && !a.options.enableContentCheck && a.options.emitContentError) try {
|
|
378
|
+
P(t, a.schema, {
|
|
379
|
+
parseOptions: s,
|
|
380
380
|
errorOnInvalidContent: !0
|
|
381
381
|
});
|
|
382
382
|
} catch (e) {
|
|
383
|
-
|
|
383
|
+
o(e);
|
|
384
384
|
}
|
|
385
385
|
try {
|
|
386
|
-
|
|
387
|
-
parseOptions:
|
|
388
|
-
errorOnInvalidContent: n.errorOnInvalidContent ??
|
|
386
|
+
i = P(t, a.schema, {
|
|
387
|
+
parseOptions: s,
|
|
388
|
+
errorOnInvalidContent: n.errorOnInvalidContent ?? a.options.enableContentCheck
|
|
389
389
|
});
|
|
390
390
|
} catch (e) {
|
|
391
|
-
return
|
|
391
|
+
return o(e), !1;
|
|
392
392
|
}
|
|
393
|
-
let { from:
|
|
393
|
+
let { from: c, to: l } = typeof e == "number" ? {
|
|
394
394
|
from: e,
|
|
395
395
|
to: e
|
|
396
396
|
} : {
|
|
397
397
|
from: e.from,
|
|
398
398
|
to: e.to
|
|
399
|
-
},
|
|
400
|
-
if (
|
|
401
|
-
e.check(),
|
|
402
|
-
}),
|
|
403
|
-
let { parent: e } =
|
|
404
|
-
e.isTextblock && !e.type.spec.code && !e.childCount && (--
|
|
399
|
+
}, u = !0, d = !0, f = Xe(i) ? i.content : [i];
|
|
400
|
+
if (f.forEach((e) => {
|
|
401
|
+
e.check(), u = u ? e.isText && e.marks.length === 0 : !1, d = d ? e.isBlock : !1;
|
|
402
|
+
}), c === l && d) {
|
|
403
|
+
let { parent: e } = r.doc.resolve(c);
|
|
404
|
+
e.isTextblock && !e.type.spec.code && !e.childCount && (--c, l += 1);
|
|
405
405
|
}
|
|
406
|
-
let
|
|
407
|
-
if (
|
|
406
|
+
let p;
|
|
407
|
+
if (u) p = Array.isArray(t) ? t.map((e) => e.text || "").join("") : Ye(t) ? f.map((e) => e.text ?? "").join("") : typeof t == "object" && t && t.text ? t.text : t, r.insertText(p, c, l);
|
|
408
408
|
else {
|
|
409
|
-
|
|
410
|
-
let e =
|
|
411
|
-
n &&
|
|
409
|
+
p = w.from(f);
|
|
410
|
+
let e = r.doc.resolve(c), t = e.node(), n = e.parentOffset === 0, i = t.isText || t.isTextblock, a = t.content.size > 0;
|
|
411
|
+
n && i && a && d && (c = Math.max(0, c - 1)), r.replaceWith(c, l, f);
|
|
412
412
|
}
|
|
413
|
-
n.updateSelection && Ze(
|
|
414
|
-
from:
|
|
415
|
-
text:
|
|
416
|
-
}), n.applyPasteRules &&
|
|
417
|
-
from:
|
|
418
|
-
text:
|
|
413
|
+
n.updateSelection && Ze(r, r.steps.length - 1, -1), n.applyInputRules && r.setMeta("applyInputRules", {
|
|
414
|
+
from: c,
|
|
415
|
+
text: p
|
|
416
|
+
}), n.applyPasteRules && r.setMeta("applyPasteRules", {
|
|
417
|
+
from: c,
|
|
418
|
+
text: p
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
421
|
return !0;
|
|
@@ -438,21 +438,21 @@ var et = (e = {}) => ({ tr: t, dispatch: n, editor: r }) => {
|
|
|
438
438
|
f = l.createAndFill(d, e);
|
|
439
439
|
} else f = l.createAndFill(d);
|
|
440
440
|
return f ? (n && (t.insert(c.pos, f), s && Ze(t, t.steps.length - 1, -1)), !0) : !1;
|
|
441
|
-
}, tt = () => ({ state: e, dispatch: t }) =>
|
|
441
|
+
}, tt = () => ({ state: e, dispatch: t }) => _(e, t), nt = () => ({ state: e, dispatch: t }) => p(e, t), rt = () => ({ state: e, dispatch: t }) => f(e, t), it = () => ({ state: e, dispatch: t }) => m(e, t), at = () => ({ state: e, dispatch: t, tr: n }) => {
|
|
442
442
|
try {
|
|
443
|
-
let r =
|
|
443
|
+
let r = c(e.doc, e.selection.$from.pos, -1);
|
|
444
444
|
return r != null && (n.join(r, 2), t && t(n), !0);
|
|
445
445
|
} catch {
|
|
446
446
|
return !1;
|
|
447
447
|
}
|
|
448
448
|
}, ot = () => ({ state: e, dispatch: t, tr: n }) => {
|
|
449
449
|
try {
|
|
450
|
-
let r =
|
|
450
|
+
let r = c(e.doc, e.selection.$from.pos, 1);
|
|
451
451
|
return r != null && (n.join(r, 2), t && t(n), !0);
|
|
452
452
|
} catch {
|
|
453
453
|
return !1;
|
|
454
454
|
}
|
|
455
|
-
}, st = () => ({ state: e, dispatch: t }) =>
|
|
455
|
+
}, st = () => ({ state: e, dispatch: t }) => h(e, t), ct = () => ({ state: e, dispatch: t }) => g(e, t);
|
|
456
456
|
function lt() {
|
|
457
457
|
return typeof navigator < "u" && /Mac/.test(navigator.platform);
|
|
458
458
|
}
|
|
@@ -494,7 +494,7 @@ var dt = (e) => ({ editor: t, view: n, tr: r, dispatch: i }) => {
|
|
|
494
494
|
}), !0;
|
|
495
495
|
};
|
|
496
496
|
function F(e, t, n = {}) {
|
|
497
|
-
let { from: r, to: i, empty: a } = e.selection, o = t ?
|
|
497
|
+
let { from: r, to: i, empty: a } = e.selection, o = t ? O(t, e.schema) : null, s = [];
|
|
498
498
|
e.doc.nodesBetween(r, i, (e, t) => {
|
|
499
499
|
if (e.isText) return;
|
|
500
500
|
let n = Math.max(r, t), a = Math.min(i, t + e.nodeSize);
|
|
@@ -504,13 +504,13 @@ function F(e, t, n = {}) {
|
|
|
504
504
|
to: a
|
|
505
505
|
});
|
|
506
506
|
});
|
|
507
|
-
let c = i - r, l = s.filter((e) => !o || o.name === e.node.type.name).filter((e) =>
|
|
507
|
+
let c = i - r, l = s.filter((e) => !o || o.name === e.node.type.name).filter((e) => k(e.node.attrs, n, { strict: !1 }));
|
|
508
508
|
return a ? !!l.length : l.reduce((e, t) => e + t.to - t.from, 0) >= c;
|
|
509
509
|
}
|
|
510
|
-
var ft = (e, t = {}) => ({ state: n, dispatch: r }) => F(n,
|
|
511
|
-
let r =
|
|
512
|
-
return
|
|
513
|
-
}, ht = () => ({ state: e, dispatch: t }) =>
|
|
510
|
+
var ft = (e, t = {}) => ({ state: n, dispatch: r }) => F(n, O(e, n.schema), t) ? ee(n, r) : !1, pt = () => ({ state: e, dispatch: t }) => te(e, t), mt = (e) => ({ state: t, dispatch: n }) => {
|
|
511
|
+
let r = O(e, t.schema);
|
|
512
|
+
return he(r)(t, n);
|
|
513
|
+
}, ht = () => ({ state: e, dispatch: t }) => ne(e, t);
|
|
514
514
|
function I(e, t) {
|
|
515
515
|
return t.nodes[e] ? "node" : t.marks[e] ? "mark" : null;
|
|
516
516
|
}
|
|
@@ -521,7 +521,7 @@ function gt(e, t) {
|
|
|
521
521
|
var _t = (e, t) => ({ tr: n, state: r, dispatch: i }) => {
|
|
522
522
|
let a = null, o = null, s = I(typeof e == "string" ? e : e.name, r.schema);
|
|
523
523
|
if (!s) return !1;
|
|
524
|
-
s === "node" && (a =
|
|
524
|
+
s === "node" && (a = O(e, r.schema)), s === "mark" && (o = A(e, r.schema));
|
|
525
525
|
let c = !1;
|
|
526
526
|
return n.selection.ranges.forEach((e) => {
|
|
527
527
|
r.doc.nodesBetween(e.$from.pos, e.$to.pos, (e, r) => {
|
|
@@ -532,11 +532,11 @@ var _t = (e, t) => ({ tr: n, state: r, dispatch: i }) => {
|
|
|
532
532
|
}), c;
|
|
533
533
|
}, vt = () => ({ tr: e, dispatch: t }) => (t && e.scrollIntoView(), !0), yt = () => ({ tr: e, dispatch: t }) => {
|
|
534
534
|
if (t) {
|
|
535
|
-
let t = new
|
|
535
|
+
let t = new ce(e.doc);
|
|
536
536
|
e.setSelection(t);
|
|
537
537
|
}
|
|
538
538
|
return !0;
|
|
539
|
-
}, bt = () => ({ state: e, dispatch: t }) =>
|
|
539
|
+
}, bt = () => ({ state: e, dispatch: t }) => re(e, t), xt = () => ({ state: e, dispatch: t }) => ie(e, t), St = () => ({ state: e, dispatch: t }) => ae(e, t), Ct = () => ({ state: e, dispatch: t }) => v(e, t), wt = () => ({ state: e, dispatch: t }) => oe(e, t);
|
|
540
540
|
function L(e, t, n = {}, r = {}) {
|
|
541
541
|
return P(e, t, {
|
|
542
542
|
slice: !1,
|
|
@@ -563,7 +563,7 @@ var Tt = (e, { errorOnInvalidContent: t, emitUpdate: n = !0, parseOptions: r = {
|
|
|
563
563
|
});
|
|
564
564
|
};
|
|
565
565
|
function Et(e, t) {
|
|
566
|
-
let n =
|
|
566
|
+
let n = A(t, e.schema), { from: r, to: i, empty: a } = e.selection, o = [];
|
|
567
567
|
a ? (e.storedMarks && o.push(...e.storedMarks), o.push(...e.selection.$head.marks())) : e.doc.nodesBetween(r, i, (e) => {
|
|
568
568
|
o.push(...e.marks);
|
|
569
569
|
});
|
|
@@ -571,7 +571,7 @@ function Et(e, t) {
|
|
|
571
571
|
return s ? { ...s.attrs } : {};
|
|
572
572
|
}
|
|
573
573
|
function Dt(e, t) {
|
|
574
|
-
let n = new
|
|
574
|
+
let n = new i(e);
|
|
575
575
|
return t.forEach((e) => {
|
|
576
576
|
e.steps.forEach((e) => {
|
|
577
577
|
n.step(e);
|
|
@@ -607,38 +607,38 @@ function z(e, t, n) {
|
|
|
607
607
|
parent: e.parent ? z(e.parent, t, n) : null
|
|
608
608
|
}) : e.config[t];
|
|
609
609
|
}
|
|
610
|
-
function
|
|
610
|
+
function B(e) {
|
|
611
611
|
return e.map((e) => {
|
|
612
612
|
let t = z(e, "addExtensions", {
|
|
613
613
|
name: e.name,
|
|
614
614
|
options: e.options,
|
|
615
615
|
storage: e.storage
|
|
616
616
|
});
|
|
617
|
-
return t ? [e, ...
|
|
617
|
+
return t ? [e, ...B(t())] : e;
|
|
618
618
|
}).flat(10);
|
|
619
619
|
}
|
|
620
|
-
function
|
|
621
|
-
let
|
|
622
|
-
return
|
|
620
|
+
function At(e, t) {
|
|
621
|
+
let n = fe.fromSchema(t).serializeFragment(e), r = document.implementation.createHTMLDocument().createElement("div");
|
|
622
|
+
return r.appendChild(n), r.innerHTML;
|
|
623
623
|
}
|
|
624
|
-
function
|
|
624
|
+
function jt(e) {
|
|
625
625
|
return typeof e == "function";
|
|
626
626
|
}
|
|
627
|
-
function
|
|
628
|
-
return
|
|
627
|
+
function V(e, t = void 0, ...n) {
|
|
628
|
+
return jt(e) ? t ? e.bind(t)(...n) : e(...n) : e;
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function Mt(e = {}) {
|
|
631
631
|
return Object.keys(e).length === 0 && e.constructor === Object;
|
|
632
632
|
}
|
|
633
|
-
function
|
|
633
|
+
function H(e) {
|
|
634
634
|
return {
|
|
635
635
|
baseExtensions: e.filter((e) => e.type === "extension"),
|
|
636
636
|
nodeExtensions: e.filter((e) => e.type === "node"),
|
|
637
637
|
markExtensions: e.filter((e) => e.type === "mark")
|
|
638
638
|
};
|
|
639
639
|
}
|
|
640
|
-
function
|
|
641
|
-
let t = [], { nodeExtensions: n, markExtensions: r } =
|
|
640
|
+
function Nt(e) {
|
|
641
|
+
let t = [], { nodeExtensions: n, markExtensions: r } = H(e), i = [...n, ...r], a = {
|
|
642
642
|
default: null,
|
|
643
643
|
validate: void 0,
|
|
644
644
|
rendered: !0,
|
|
@@ -690,38 +690,34 @@ function Pt(e) {
|
|
|
690
690
|
});
|
|
691
691
|
}), t;
|
|
692
692
|
}
|
|
693
|
-
function
|
|
693
|
+
function Pt(e) {
|
|
694
694
|
let t = [], n = "", r = !1, i = !1, a = 0, o = e.length;
|
|
695
695
|
for (let s = 0; s < o; s += 1) {
|
|
696
696
|
let o = e[s];
|
|
697
|
-
if (o === "'" && !i)
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
}
|
|
714
|
-
if (o === ";" && a === 0) {
|
|
715
|
-
t.push(n), n = "";
|
|
716
|
-
continue;
|
|
697
|
+
if (o === "'" && !i) r = !r, n += o;
|
|
698
|
+
else if (o === "\"" && !r) i = !i, n += o;
|
|
699
|
+
else {
|
|
700
|
+
if (!r && !i) {
|
|
701
|
+
if (o === "(") {
|
|
702
|
+
a += 1, n += o;
|
|
703
|
+
continue;
|
|
704
|
+
}
|
|
705
|
+
if (o === ")" && a > 0) {
|
|
706
|
+
--a, n += o;
|
|
707
|
+
continue;
|
|
708
|
+
}
|
|
709
|
+
if (o === ";" && a === 0) {
|
|
710
|
+
t.push(n), n = "";
|
|
711
|
+
continue;
|
|
712
|
+
}
|
|
717
713
|
}
|
|
714
|
+
n += o;
|
|
718
715
|
}
|
|
719
|
-
n += o;
|
|
720
716
|
}
|
|
721
717
|
return n && t.push(n), t;
|
|
722
718
|
}
|
|
723
|
-
function
|
|
724
|
-
let t = [], n =
|
|
719
|
+
function Ft(e) {
|
|
720
|
+
let t = [], n = Pt(e || ""), r = n.length;
|
|
725
721
|
for (let e = 0; e < r; e += 1) {
|
|
726
722
|
let r = n[e], i = r.indexOf(":");
|
|
727
723
|
if (i === -1) continue;
|
|
@@ -730,47 +726,41 @@ function It(e) {
|
|
|
730
726
|
}
|
|
731
727
|
return t;
|
|
732
728
|
}
|
|
733
|
-
function
|
|
729
|
+
function It(...e) {
|
|
734
730
|
return e.filter((e) => !!e).reduce((e, t) => {
|
|
735
731
|
let n = { ...e };
|
|
736
732
|
return Object.entries(t).forEach(([e, t]) => {
|
|
737
|
-
if (e === "__proto__") {
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
}
|
|
746
|
-
if (!n[e]) {
|
|
747
|
-
n[e] = t;
|
|
748
|
-
return;
|
|
749
|
-
}
|
|
750
|
-
if (e === "class") {
|
|
733
|
+
if (e === "__proto__") Object.defineProperty(n, e, {
|
|
734
|
+
configurable: !0,
|
|
735
|
+
enumerable: !0,
|
|
736
|
+
value: t,
|
|
737
|
+
writable: !0
|
|
738
|
+
});
|
|
739
|
+
else if (!n[e]) n[e] = t;
|
|
740
|
+
else if (e === "class") {
|
|
751
741
|
let r = t ? String(t).split(" ") : [], i = n[e] ? n[e].split(" ") : [], a = r.filter((e) => !i.includes(e));
|
|
752
742
|
n[e] = [...i, ...a].join(" ");
|
|
753
743
|
} else if (e === "style") {
|
|
754
|
-
let r = new Map([...
|
|
744
|
+
let r = new Map([...Ft(n[e]), ...Ft(t)]);
|
|
755
745
|
n[e] = Array.from(r.entries()).map(([e, t]) => `${e}: ${t}`).join("; ");
|
|
756
746
|
} else n[e] = t;
|
|
757
747
|
}), n;
|
|
758
748
|
}, {});
|
|
759
749
|
}
|
|
760
|
-
function
|
|
761
|
-
return t.filter((t) => t.type === e.type.name).filter((e) => e.attribute.rendered).map((t) => t.attribute.renderHTML ? t.attribute.renderHTML(e.attrs) || {} : { [t.name]: e.attrs[t.name] }).reduce((e, t) =>
|
|
750
|
+
function U(e, t) {
|
|
751
|
+
return t.filter((t) => t.type === e.type.name).filter((e) => e.attribute.rendered).map((t) => t.attribute.renderHTML ? t.attribute.renderHTML(e.attrs) || {} : { [t.name]: e.attrs[t.name] }).reduce((e, t) => It(e, t), {});
|
|
762
752
|
}
|
|
763
|
-
function
|
|
753
|
+
function Lt(e) {
|
|
764
754
|
return typeof e == "string" ? e.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(e) : e === "true" || e !== "false" && e : e;
|
|
765
755
|
}
|
|
766
|
-
function
|
|
756
|
+
function Rt(e, t) {
|
|
767
757
|
return "style" in e ? e : {
|
|
768
758
|
...e,
|
|
769
759
|
getAttrs: (n) => {
|
|
770
760
|
let r = e.getAttrs ? e.getAttrs(n) : e.attrs;
|
|
771
761
|
if (r === !1) return !1;
|
|
772
762
|
let i = t.reduce((e, t) => {
|
|
773
|
-
let r = t.attribute.parseHTML ? t.attribute.parseHTML(n) :
|
|
763
|
+
let r = t.attribute.parseHTML ? t.attribute.parseHTML(n) : Lt(n.getAttribute(t.name));
|
|
774
764
|
return r == null ? e : {
|
|
775
765
|
...e,
|
|
776
766
|
[t.name]: r
|
|
@@ -783,22 +773,22 @@ function zt(e, t) {
|
|
|
783
773
|
}
|
|
784
774
|
};
|
|
785
775
|
}
|
|
786
|
-
function
|
|
787
|
-
return Object.fromEntries(Object.entries(e).filter(([e, t]) => e === "attrs" &&
|
|
776
|
+
function zt(e) {
|
|
777
|
+
return Object.fromEntries(Object.entries(e).filter(([e, t]) => e === "attrs" && Mt(t) ? !1 : t != null));
|
|
788
778
|
}
|
|
789
|
-
function
|
|
779
|
+
function Bt(e) {
|
|
790
780
|
var t, n;
|
|
791
781
|
let r = {};
|
|
792
782
|
return !(e != null && (t = e.attribute) != null && t.isRequired) && "default" in (e?.attribute || {}) && (r.default = e.attribute.default), (e == null || (n = e.attribute) == null ? void 0 : n.validate) !== void 0 && (r.validate = e.attribute.validate), [e.name, r];
|
|
793
783
|
}
|
|
794
|
-
function
|
|
795
|
-
let n =
|
|
784
|
+
function Vt(e, t) {
|
|
785
|
+
let n = Nt(e), { nodeExtensions: r, markExtensions: i } = H(e), a = r.find((e) => z(e, "topNode"))?.name, o = Object.fromEntries(r.map((r) => {
|
|
796
786
|
let i = n.filter((e) => e.type === r.name), a = {
|
|
797
787
|
name: r.name,
|
|
798
788
|
options: r.options,
|
|
799
789
|
storage: r.storage,
|
|
800
790
|
editor: t
|
|
801
|
-
}, o =
|
|
791
|
+
}, o = zt({
|
|
802
792
|
...e.reduce((e, t) => {
|
|
803
793
|
let n = z(t, "extendNodeSchema", a);
|
|
804
794
|
return {
|
|
@@ -806,35 +796,35 @@ function Ht(e, t) {
|
|
|
806
796
|
...n ? n(r) : {}
|
|
807
797
|
};
|
|
808
798
|
}, {}),
|
|
809
|
-
content:
|
|
810
|
-
marks:
|
|
811
|
-
group:
|
|
812
|
-
inline:
|
|
813
|
-
atom:
|
|
814
|
-
selectable:
|
|
815
|
-
draggable:
|
|
816
|
-
code:
|
|
817
|
-
whitespace:
|
|
818
|
-
linebreakReplacement:
|
|
819
|
-
defining:
|
|
820
|
-
isolating:
|
|
821
|
-
attrs: Object.fromEntries(i.map(
|
|
822
|
-
}), s =
|
|
823
|
-
s && (o.parseDOM = s.map((e) =>
|
|
799
|
+
content: V(z(r, "content", a)),
|
|
800
|
+
marks: V(z(r, "marks", a)),
|
|
801
|
+
group: V(z(r, "group", a)),
|
|
802
|
+
inline: V(z(r, "inline", a)),
|
|
803
|
+
atom: V(z(r, "atom", a)),
|
|
804
|
+
selectable: V(z(r, "selectable", a)),
|
|
805
|
+
draggable: V(z(r, "draggable", a)),
|
|
806
|
+
code: V(z(r, "code", a)),
|
|
807
|
+
whitespace: V(z(r, "whitespace", a)),
|
|
808
|
+
linebreakReplacement: V(z(r, "linebreakReplacement", a)),
|
|
809
|
+
defining: V(z(r, "defining", a)),
|
|
810
|
+
isolating: V(z(r, "isolating", a)),
|
|
811
|
+
attrs: Object.fromEntries(i.map(Bt))
|
|
812
|
+
}), s = V(z(r, "parseHTML", a));
|
|
813
|
+
s && (o.parseDOM = s.map((e) => Rt(e, i)));
|
|
824
814
|
let c = z(r, "renderHTML", a);
|
|
825
815
|
c && (o.toDOM = (e) => c({
|
|
826
816
|
node: e,
|
|
827
|
-
HTMLAttributes:
|
|
817
|
+
HTMLAttributes: U(e, i)
|
|
828
818
|
}));
|
|
829
819
|
let l = z(r, "renderText", a);
|
|
830
820
|
return l && (o.toText = l), [r.name, o];
|
|
831
|
-
})),
|
|
821
|
+
})), s = Object.fromEntries(i.map((r) => {
|
|
832
822
|
let i = n.filter((e) => e.type === r.name), a = {
|
|
833
823
|
name: r.name,
|
|
834
824
|
options: r.options,
|
|
835
825
|
storage: r.storage,
|
|
836
826
|
editor: t
|
|
837
|
-
}, o =
|
|
827
|
+
}, o = zt({
|
|
838
828
|
...e.reduce((e, t) => {
|
|
839
829
|
let n = z(t, "extendMarkSchema", a);
|
|
840
830
|
return {
|
|
@@ -842,41 +832,41 @@ function Ht(e, t) {
|
|
|
842
832
|
...n ? n(r) : {}
|
|
843
833
|
};
|
|
844
834
|
}, {}),
|
|
845
|
-
inclusive:
|
|
846
|
-
excludes:
|
|
847
|
-
group:
|
|
848
|
-
spanning:
|
|
849
|
-
code:
|
|
850
|
-
attrs: Object.fromEntries(i.map(
|
|
851
|
-
}), s =
|
|
852
|
-
s && (o.parseDOM = s.map((e) =>
|
|
835
|
+
inclusive: V(z(r, "inclusive", a)),
|
|
836
|
+
excludes: V(z(r, "excludes", a)),
|
|
837
|
+
group: V(z(r, "group", a)),
|
|
838
|
+
spanning: V(z(r, "spanning", a)),
|
|
839
|
+
code: V(z(r, "code", a)),
|
|
840
|
+
attrs: Object.fromEntries(i.map(Bt))
|
|
841
|
+
}), s = V(z(r, "parseHTML", a));
|
|
842
|
+
s && (o.parseDOM = s.map((e) => Rt(e, i)));
|
|
853
843
|
let c = z(r, "renderHTML", a);
|
|
854
844
|
return c && (o.toDOM = (e) => c({
|
|
855
845
|
mark: e,
|
|
856
|
-
HTMLAttributes:
|
|
846
|
+
HTMLAttributes: U(e, i)
|
|
857
847
|
})), [r.name, o];
|
|
858
848
|
}));
|
|
859
|
-
return new
|
|
860
|
-
topNode:
|
|
861
|
-
nodes:
|
|
862
|
-
marks:
|
|
849
|
+
return new pe({
|
|
850
|
+
topNode: a,
|
|
851
|
+
nodes: o,
|
|
852
|
+
marks: s
|
|
863
853
|
});
|
|
864
854
|
}
|
|
865
|
-
function
|
|
855
|
+
function Ht(e) {
|
|
866
856
|
let t = e.filter((t, n) => e.indexOf(t) !== n);
|
|
867
857
|
return Array.from(new Set(t));
|
|
868
858
|
}
|
|
869
|
-
function
|
|
859
|
+
function W(e) {
|
|
870
860
|
return e.sort((e, t) => {
|
|
871
861
|
let n = z(e, "priority") || 100, r = z(t, "priority") || 100;
|
|
872
862
|
return n > r ? -1 : +(n < r);
|
|
873
863
|
});
|
|
874
864
|
}
|
|
875
|
-
function
|
|
876
|
-
let t =
|
|
865
|
+
function Ut(e) {
|
|
866
|
+
let t = W(B(e)), n = Ht(t.map((e) => e.name));
|
|
877
867
|
return n.length && console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((e) => `'${e}'`).join(", ")}]. This can lead to issues.`), t;
|
|
878
868
|
}
|
|
879
|
-
function
|
|
869
|
+
function Wt(e, t, n) {
|
|
880
870
|
let { from: r, to: i } = t, { blockSeparator: a = "\n\n", textSerializers: o = {} } = n || {}, s = "";
|
|
881
871
|
return e.nodesBetween(r, i, (e, n, c, l) => {
|
|
882
872
|
e.isBlock && n > r && (s += a);
|
|
@@ -894,39 +884,39 @@ function Gt(e, t, n) {
|
|
|
894
884
|
}
|
|
895
885
|
}), s;
|
|
896
886
|
}
|
|
897
|
-
function
|
|
898
|
-
return
|
|
887
|
+
function Gt(e, t) {
|
|
888
|
+
return Wt(e, {
|
|
899
889
|
from: 0,
|
|
900
890
|
to: e.content.size
|
|
901
891
|
}, t);
|
|
902
892
|
}
|
|
903
|
-
function
|
|
893
|
+
function Kt(e) {
|
|
904
894
|
return Object.fromEntries(Object.entries(e.nodes).filter(([, e]) => e.spec.toText).map(([e, t]) => [e, t.spec.toText]));
|
|
905
895
|
}
|
|
906
|
-
function
|
|
907
|
-
let n =
|
|
896
|
+
function qt(e, t) {
|
|
897
|
+
let n = O(t, e.schema), { from: r, to: i } = e.selection, a = [];
|
|
908
898
|
e.doc.nodesBetween(r, i, (e) => {
|
|
909
899
|
a.push(e);
|
|
910
900
|
});
|
|
911
901
|
let o = a.reverse().find((e) => e.type.name === n.name);
|
|
912
902
|
return o ? { ...o.attrs } : {};
|
|
913
903
|
}
|
|
914
|
-
function
|
|
904
|
+
function Jt(e, t) {
|
|
915
905
|
let n = I(typeof t == "string" ? t : t.name, e.schema);
|
|
916
|
-
return n === "node" ?
|
|
906
|
+
return n === "node" ? qt(e, t) : n === "mark" ? Et(e, t) : {};
|
|
917
907
|
}
|
|
918
|
-
function
|
|
908
|
+
function Yt(e, t = JSON.stringify) {
|
|
919
909
|
let n = {};
|
|
920
910
|
return e.filter((e) => {
|
|
921
911
|
let r = t(e);
|
|
922
912
|
return Object.prototype.hasOwnProperty.call(n, r) ? !1 : n[r] = !0;
|
|
923
913
|
});
|
|
924
914
|
}
|
|
925
|
-
function
|
|
926
|
-
let t =
|
|
915
|
+
function Xt(e) {
|
|
916
|
+
let t = Yt(e);
|
|
927
917
|
return t.length === 1 ? t : t.filter((e, n) => !t.filter((e, t) => t !== n).some((t) => e.oldRange.from >= t.oldRange.from && e.oldRange.to <= t.oldRange.to && e.newRange.from >= t.newRange.from && e.newRange.to <= t.newRange.to));
|
|
928
918
|
}
|
|
929
|
-
function
|
|
919
|
+
function Zt(e) {
|
|
930
920
|
let { mapping: t, steps: n } = e, r = [];
|
|
931
921
|
return t.maps.forEach((e, i) => {
|
|
932
922
|
let a = [];
|
|
@@ -957,47 +947,47 @@ function Qt(e) {
|
|
|
957
947
|
}
|
|
958
948
|
});
|
|
959
949
|
});
|
|
960
|
-
}),
|
|
950
|
+
}), Xt(r);
|
|
961
951
|
}
|
|
962
|
-
function
|
|
952
|
+
function Qt(e, t, n) {
|
|
963
953
|
let r = [];
|
|
964
954
|
return e === t ? n.resolve(e).marks().forEach((t) => {
|
|
965
|
-
let i =
|
|
955
|
+
let i = Re(n.resolve(e), t.type);
|
|
966
956
|
i && r.push({
|
|
967
957
|
mark: t,
|
|
968
958
|
...i
|
|
969
959
|
});
|
|
970
960
|
}) : n.nodesBetween(e, t, (e, t) => {
|
|
971
|
-
|
|
961
|
+
e && e?.nodeSize !== void 0 && r.push(...e.marks.map((n) => ({
|
|
972
962
|
from: t,
|
|
973
963
|
to: t + e.nodeSize,
|
|
974
964
|
mark: n
|
|
975
965
|
})));
|
|
976
966
|
}), r;
|
|
977
967
|
}
|
|
978
|
-
var
|
|
968
|
+
var $t = (e, t, n, r = 20) => {
|
|
979
969
|
let i = e.doc.resolve(n), a = r, o = null;
|
|
980
970
|
for (; a > 0 && o === null;) {
|
|
981
971
|
let e = i.node(a);
|
|
982
972
|
e?.type.name === t ? o = e : --a;
|
|
983
973
|
}
|
|
984
974
|
return [o, a];
|
|
985
|
-
},
|
|
975
|
+
}, en = (e) => {
|
|
986
976
|
let t = e.depth - 1;
|
|
987
977
|
if (t < 0) return null;
|
|
988
978
|
let n = e.index(t);
|
|
989
979
|
return n === 0 ? null : e.node(t).child(n - 1);
|
|
990
980
|
};
|
|
991
|
-
function
|
|
981
|
+
function G(e, t) {
|
|
992
982
|
return t.nodes[e] || t.marks[e] || null;
|
|
993
983
|
}
|
|
994
|
-
function
|
|
984
|
+
function K(e, t, n) {
|
|
995
985
|
return Object.fromEntries(Object.entries(n).filter(([n]) => {
|
|
996
986
|
let r = e.find((e) => e.type === t && e.name === n);
|
|
997
987
|
return r ? r.attribute.keepOnSplit : !1;
|
|
998
988
|
}));
|
|
999
989
|
}
|
|
1000
|
-
var
|
|
990
|
+
var tn = (e, t = 500) => {
|
|
1001
991
|
let n = "", r = e.parentOffset;
|
|
1002
992
|
return e.parent.nodesBetween(Math.max(0, r - t), r, (e, t, i, a) => {
|
|
1003
993
|
var o;
|
|
@@ -1010,9 +1000,9 @@ var nn = (e, t = 500) => {
|
|
|
1010
1000
|
n += e.isAtom && !e.isText ? s : s.slice(0, Math.max(0, r - t));
|
|
1011
1001
|
}), n;
|
|
1012
1002
|
};
|
|
1013
|
-
function
|
|
1014
|
-
let { empty: r, ranges: i } = e.selection, a = t ?
|
|
1015
|
-
if (r) return !!(e.storedMarks || e.selection.$from.marks()).filter((e) => !a || a.name === e.type.name).find((e) =>
|
|
1003
|
+
function nn(e, t, n = {}) {
|
|
1004
|
+
let { empty: r, ranges: i } = e.selection, a = t ? A(t, e.schema) : null;
|
|
1005
|
+
if (r) return !!(e.storedMarks || e.selection.$from.marks()).filter((e) => !a || a.name === e.type.name).find((e) => k(e.attrs, n, { strict: !1 }));
|
|
1016
1006
|
let o = 0, s = [];
|
|
1017
1007
|
if (i.forEach(({ $from: t, $to: n }) => {
|
|
1018
1008
|
let r = t.pos, i = n.pos;
|
|
@@ -1027,13 +1017,13 @@ function K(e, t, n = {}) {
|
|
|
1027
1017
|
})));
|
|
1028
1018
|
});
|
|
1029
1019
|
}), o === 0) return !1;
|
|
1030
|
-
let c = s.filter((e) => !a || a.name === e.mark.type.name).filter((e) =>
|
|
1020
|
+
let c = s.filter((e) => !a || a.name === e.mark.type.name).filter((e) => k(e.mark.attrs, n, { strict: !1 })).reduce((e, t) => e + t.to - t.from, 0), l = s.filter((e) => !a || e.mark.type !== a && e.mark.type.excludes(a)).reduce((e, t) => e + t.to - t.from, 0);
|
|
1031
1021
|
return (c > 0 ? c + l : c) >= o;
|
|
1032
1022
|
}
|
|
1033
1023
|
function rn(e, t, n = {}) {
|
|
1034
|
-
if (!t) return F(e, null, n) ||
|
|
1024
|
+
if (!t) return F(e, null, n) || nn(e, null, n);
|
|
1035
1025
|
let r = I(t, e.schema);
|
|
1036
|
-
return r === "node" ? F(e, t, n) : r === "mark" &&
|
|
1026
|
+
return r === "node" ? F(e, t, n) : r === "mark" && nn(e, t, n);
|
|
1037
1027
|
}
|
|
1038
1028
|
var an = (e, t) => {
|
|
1039
1029
|
let { $from: n, $to: r, $anchor: i } = e.selection;
|
|
@@ -1052,16 +1042,16 @@ function sn(e, t) {
|
|
|
1052
1042
|
return Array.isArray(t) ? t.some((t) => (typeof t == "string" ? t : t.name) === e.name) : t;
|
|
1053
1043
|
}
|
|
1054
1044
|
function q(e, t) {
|
|
1055
|
-
let { nodeExtensions: n } =
|
|
1045
|
+
let { nodeExtensions: n } = H(t), r = n.find((t) => t.name === e);
|
|
1056
1046
|
if (!r) return !1;
|
|
1057
|
-
let i =
|
|
1047
|
+
let i = V(z(r, "group", {
|
|
1058
1048
|
name: r.name,
|
|
1059
1049
|
options: r.options,
|
|
1060
1050
|
storage: r.storage
|
|
1061
1051
|
}));
|
|
1062
1052
|
return typeof i == "string" && i.split(" ").includes("list");
|
|
1063
1053
|
}
|
|
1064
|
-
function
|
|
1054
|
+
function cn(e, { checkChildren: t = !0, ignoreWhitespace: n = !1 } = {}) {
|
|
1065
1055
|
if (n) {
|
|
1066
1056
|
if (e.type.name === "hardBreak") return !0;
|
|
1067
1057
|
if (e.isText) return !/\S/.test(e.text ?? "");
|
|
@@ -1072,7 +1062,7 @@ function J(e, { checkChildren: t = !0, ignoreWhitespace: n = !1 } = {}) {
|
|
|
1072
1062
|
if (t) {
|
|
1073
1063
|
let r = !0;
|
|
1074
1064
|
return e.content.forEach((e) => {
|
|
1075
|
-
r !== !1 && (
|
|
1065
|
+
r !== !1 && (cn(e, {
|
|
1076
1066
|
ignoreWhitespace: n,
|
|
1077
1067
|
checkChildren: t
|
|
1078
1068
|
}) || (r = !1));
|
|
@@ -1080,10 +1070,10 @@ function J(e, { checkChildren: t = !0, ignoreWhitespace: n = !1 } = {}) {
|
|
|
1080
1070
|
}
|
|
1081
1071
|
return !1;
|
|
1082
1072
|
}
|
|
1083
|
-
function
|
|
1084
|
-
return e instanceof
|
|
1073
|
+
function ln(e) {
|
|
1074
|
+
return e instanceof ue;
|
|
1085
1075
|
}
|
|
1086
|
-
var
|
|
1076
|
+
var un = class e {
|
|
1087
1077
|
constructor(e) {
|
|
1088
1078
|
this.position = e;
|
|
1089
1079
|
}
|
|
@@ -1094,19 +1084,19 @@ var ln = class e {
|
|
|
1094
1084
|
return { position: this.position };
|
|
1095
1085
|
}
|
|
1096
1086
|
};
|
|
1097
|
-
function
|
|
1087
|
+
function dn(e, t) {
|
|
1098
1088
|
let n = t.mapping.mapResult(e.position);
|
|
1099
1089
|
return {
|
|
1100
|
-
position: new
|
|
1090
|
+
position: new un(n.pos),
|
|
1101
1091
|
mapResult: n
|
|
1102
1092
|
};
|
|
1103
1093
|
}
|
|
1104
|
-
function
|
|
1105
|
-
return new
|
|
1094
|
+
function fn(e) {
|
|
1095
|
+
return new un(e);
|
|
1106
1096
|
}
|
|
1107
|
-
function
|
|
1097
|
+
function pn(e, t, n) {
|
|
1108
1098
|
let { selection: r } = t, i = null;
|
|
1109
|
-
if (
|
|
1099
|
+
if (Ve(r) && (i = r.$cursor), i) {
|
|
1110
1100
|
let t = e.storedMarks ?? i.marks();
|
|
1111
1101
|
return i.parent.type.allowsMarkType(n) && (!!n.isInSet(t) || !t.some((e) => e.type.excludes(n)));
|
|
1112
1102
|
}
|
|
@@ -1123,8 +1113,8 @@ function fn(e, t, n) {
|
|
|
1123
1113
|
}), i;
|
|
1124
1114
|
});
|
|
1125
1115
|
}
|
|
1126
|
-
var
|
|
1127
|
-
let { selection: a } = n, { empty: o, ranges: s } = a, c =
|
|
1116
|
+
var mn = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
1117
|
+
let { selection: a } = n, { empty: o, ranges: s } = a, c = A(e, r.schema);
|
|
1128
1118
|
if (i) {
|
|
1129
1119
|
if (o) {
|
|
1130
1120
|
let e = Et(r, c);
|
|
@@ -1145,23 +1135,23 @@ var pn = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
|
1145
1135
|
});
|
|
1146
1136
|
});
|
|
1147
1137
|
}
|
|
1148
|
-
return
|
|
1149
|
-
},
|
|
1150
|
-
let a =
|
|
1151
|
-
return n.selection.$anchor.sameParent(n.selection.$head) && (o = n.selection.$anchor.parent.attrs), a.isTextblock ? i().command(({ commands: e }) =>
|
|
1138
|
+
return pn(r, n, c);
|
|
1139
|
+
}, hn = (e, t) => ({ tr: n }) => (n.setMeta(e, t), !0), gn = (e, t = {}) => ({ state: n, dispatch: r, chain: i }) => {
|
|
1140
|
+
let a = O(e, n.schema), o;
|
|
1141
|
+
return n.selection.$anchor.sameParent(n.selection.$head) && (o = n.selection.$anchor.parent.attrs), a.isTextblock ? i().command(({ commands: e }) => y(a, {
|
|
1152
1142
|
...o,
|
|
1153
1143
|
...t
|
|
1154
|
-
})(n) ? !0 : e.clearNodes()).command(({ state: e }) =>
|
|
1144
|
+
})(n) ? !0 : e.clearNodes()).command(({ state: e }) => y(a, {
|
|
1155
1145
|
...o,
|
|
1156
1146
|
...t
|
|
1157
1147
|
})(e, r)).run() : (console.warn("[tiptap warn]: Currently \"setNode()\" only supports text block nodes."), !1);
|
|
1158
|
-
},
|
|
1148
|
+
}, _n = (e) => ({ tr: t, dispatch: n }) => {
|
|
1159
1149
|
if (n) {
|
|
1160
|
-
let { doc: n } = t, r =
|
|
1150
|
+
let { doc: n } = t, r = j(e, 0, n.content.size), i = ue.create(n, r);
|
|
1161
1151
|
t.setSelection(i);
|
|
1162
1152
|
}
|
|
1163
1153
|
return !0;
|
|
1164
|
-
},
|
|
1154
|
+
}, vn = (e, t) => ({ tr: n, state: r, dispatch: i }) => {
|
|
1165
1155
|
let { selection: a } = r, o, s;
|
|
1166
1156
|
return typeof t == "number" ? (o = t, s = t) : t && "from" in t && "to" in t ? (o = t.from, s = t.to) : (o = a.from, s = a.to), i && n.doc.nodesBetween(o, s, (t, r) => {
|
|
1167
1157
|
t.isText || n.setNodeMarkup(r, void 0, {
|
|
@@ -1169,157 +1159,157 @@ var pn = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
|
1169
1159
|
dir: e
|
|
1170
1160
|
});
|
|
1171
1161
|
}), !0;
|
|
1172
|
-
},
|
|
1162
|
+
}, yn = (e) => ({ tr: t, dispatch: n }) => {
|
|
1173
1163
|
if (n) {
|
|
1174
1164
|
let { doc: n } = t, { from: r, to: i } = typeof e == "number" ? {
|
|
1175
1165
|
from: e,
|
|
1176
1166
|
to: e
|
|
1177
|
-
} : e, a =
|
|
1167
|
+
} : e, a = C.atStart(n).from, o = C.atEnd(n).to, s = j(r, a, o), c = j(i, a, o), l = C.create(n, s, c);
|
|
1178
1168
|
t.setSelection(l);
|
|
1179
1169
|
}
|
|
1180
1170
|
return !0;
|
|
1181
|
-
},
|
|
1182
|
-
let r =
|
|
1183
|
-
return
|
|
1171
|
+
}, bn = (e) => ({ state: t, dispatch: n }) => {
|
|
1172
|
+
let r = O(e, t.schema);
|
|
1173
|
+
return ge(r)(t, n);
|
|
1184
1174
|
};
|
|
1185
|
-
function
|
|
1175
|
+
function xn(e, t) {
|
|
1186
1176
|
let n = e.storedMarks || e.selection.$to.parentOffset && e.selection.$from.marks();
|
|
1187
1177
|
if (n) {
|
|
1188
1178
|
let r = n.filter((e) => t?.includes(e.type.name));
|
|
1189
1179
|
e.tr.ensureMarks(r);
|
|
1190
1180
|
}
|
|
1191
1181
|
}
|
|
1192
|
-
var
|
|
1193
|
-
let { selection: a, doc:
|
|
1194
|
-
if (a instanceof
|
|
1195
|
-
if (!
|
|
1196
|
-
let f =
|
|
1182
|
+
var Sn = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor: i }) => {
|
|
1183
|
+
let { selection: a, doc: s } = t, { $from: c, $to: l } = a, u = i.extensionManager.attributes, d = K(u, c.node().type.name, c.node().attrs);
|
|
1184
|
+
if (a instanceof ue && a.node.isBlock) return !c.parentOffset || !o(s, c.pos) ? !1 : (r && (e && xn(n, i.extensionManager.splittableMarks), t.split(c.pos).scrollIntoView()), !0);
|
|
1185
|
+
if (!c.parent.isBlock) return !1;
|
|
1186
|
+
let f = l.parentOffset === l.parent.content.size, p = c.depth === 0 ? void 0 : $e(c.node(-1).contentMatchAt(c.indexAfter(-1))), m = f && p ? [{
|
|
1197
1187
|
type: p,
|
|
1198
|
-
attrs:
|
|
1199
|
-
}] : void 0, h =
|
|
1200
|
-
if (!m && !h &&
|
|
1188
|
+
attrs: d
|
|
1189
|
+
}] : void 0, h = o(t.doc, t.mapping.map(c.pos), 1, m);
|
|
1190
|
+
if (!m && !h && o(t.doc, t.mapping.map(c.pos), 1, p ? [{ type: p }] : void 0) && (h = !0, m = p ? [{
|
|
1201
1191
|
type: p,
|
|
1202
|
-
attrs:
|
|
1192
|
+
attrs: d
|
|
1203
1193
|
}] : void 0), r) {
|
|
1204
|
-
if (h && (a instanceof
|
|
1205
|
-
let e = t.mapping.map(
|
|
1206
|
-
|
|
1194
|
+
if (h && (a instanceof C && t.deleteSelection(), t.split(t.mapping.map(c.pos), 1, m), p && !f && !c.parentOffset && c.parent.type !== p)) {
|
|
1195
|
+
let e = t.mapping.map(c.before()), n = t.doc.resolve(e);
|
|
1196
|
+
c.node(-1).canReplaceWith(n.index(), n.index() + 1, p) && t.setNodeMarkup(t.mapping.map(c.before()), p);
|
|
1207
1197
|
}
|
|
1208
|
-
e &&
|
|
1198
|
+
e && xn(n, i.extensionManager.splittableMarks), t.scrollIntoView();
|
|
1209
1199
|
}
|
|
1210
1200
|
return h;
|
|
1211
|
-
},
|
|
1212
|
-
let
|
|
1213
|
-
if (
|
|
1214
|
-
let
|
|
1215
|
-
if (
|
|
1216
|
-
let
|
|
1217
|
-
if (
|
|
1218
|
-
if (
|
|
1219
|
-
if (
|
|
1220
|
-
let e =
|
|
1221
|
-
for (let t =
|
|
1222
|
-
let
|
|
1223
|
-
...
|
|
1201
|
+
}, Cn = (e, t = {}) => ({ tr: n, state: r, dispatch: i, editor: a }) => {
|
|
1202
|
+
let s = O(e, r.schema), { $from: c, $to: l } = r.selection, u = r.selection.node;
|
|
1203
|
+
if (u && u.isBlock || c.depth < 2 || !c.sameParent(l)) return !1;
|
|
1204
|
+
let d = c.node(-1);
|
|
1205
|
+
if (d.type !== s) return !1;
|
|
1206
|
+
let f = a.extensionManager.attributes;
|
|
1207
|
+
if (c.parent.content.size === 0 && c.node(-1).childCount === c.indexAfter(-1)) {
|
|
1208
|
+
if (c.depth === 2 || c.node(-3).type !== s || c.index(-2) !== c.node(-2).childCount - 1) return !1;
|
|
1209
|
+
if (i) {
|
|
1210
|
+
let e = w.empty, r = c.index(-1) ? 1 : c.index(-2) ? 2 : 3;
|
|
1211
|
+
for (let t = c.depth - r; t >= c.depth - 3; --t) e = w.from(c.node(t).copy(e));
|
|
1212
|
+
let i = c.indexAfter(-1) < c.node(-2).childCount ? 1 : c.indexAfter(-2) < c.node(-3).childCount ? 2 : 3, a = {
|
|
1213
|
+
...K(f, c.node().type.name, c.node().attrs),
|
|
1224
1214
|
...t
|
|
1225
|
-
},
|
|
1226
|
-
e = e.append(
|
|
1227
|
-
let
|
|
1228
|
-
n.replace(
|
|
1229
|
-
let
|
|
1230
|
-
n.doc.nodesBetween(
|
|
1231
|
-
if (
|
|
1232
|
-
e.isTextblock && e.content.size === 0 && (
|
|
1233
|
-
}),
|
|
1215
|
+
}, o = s.contentMatch.defaultType?.createAndFill(a) || void 0;
|
|
1216
|
+
e = e.append(w.from(s.createAndFill(null, o) || void 0));
|
|
1217
|
+
let l = c.before(c.depth - (r - 1));
|
|
1218
|
+
n.replace(l, c.after(-i), new me(e, 4 - r, 0));
|
|
1219
|
+
let u = -1;
|
|
1220
|
+
n.doc.nodesBetween(l, n.doc.content.size, (e, t) => {
|
|
1221
|
+
if (u > -1) return !1;
|
|
1222
|
+
e.isTextblock && e.content.size === 0 && (u = t + 1);
|
|
1223
|
+
}), u > -1 && n.setSelection(C.near(n.doc.resolve(u))), n.scrollIntoView();
|
|
1234
1224
|
}
|
|
1235
1225
|
return !0;
|
|
1236
1226
|
}
|
|
1237
|
-
let
|
|
1238
|
-
...
|
|
1227
|
+
let p = l.pos === c.end() ? d.contentMatchAt(0).defaultType : null, m = {
|
|
1228
|
+
...K(f, d.type.name, d.attrs),
|
|
1239
1229
|
...t
|
|
1240
|
-
},
|
|
1241
|
-
...
|
|
1230
|
+
}, h = {
|
|
1231
|
+
...K(f, c.node().type.name, c.node().attrs),
|
|
1242
1232
|
...t
|
|
1243
1233
|
};
|
|
1244
|
-
n.delete(
|
|
1245
|
-
let
|
|
1246
|
-
type:
|
|
1247
|
-
attrs:
|
|
1234
|
+
n.delete(c.pos, l.pos);
|
|
1235
|
+
let g = p ? [{
|
|
1236
|
+
type: s,
|
|
1237
|
+
attrs: m
|
|
1248
1238
|
}, {
|
|
1249
|
-
type:
|
|
1250
|
-
attrs:
|
|
1239
|
+
type: p,
|
|
1240
|
+
attrs: h
|
|
1251
1241
|
}] : [{
|
|
1252
|
-
type:
|
|
1253
|
-
attrs:
|
|
1242
|
+
type: s,
|
|
1243
|
+
attrs: m
|
|
1254
1244
|
}];
|
|
1255
|
-
if (!
|
|
1256
|
-
if (
|
|
1257
|
-
let { selection: e, storedMarks: t } =
|
|
1258
|
-
if (n.split(
|
|
1259
|
-
let
|
|
1260
|
-
n.ensureMarks(
|
|
1245
|
+
if (!o(n.doc, c.pos, 2)) return !1;
|
|
1246
|
+
if (i) {
|
|
1247
|
+
let { selection: e, storedMarks: t } = r, { splittableMarks: o } = a.extensionManager, s = t || e.$to.parentOffset && e.$from.marks();
|
|
1248
|
+
if (n.split(c.pos, 2, g).scrollIntoView(), !s || !i) return !0;
|
|
1249
|
+
let l = s.filter((e) => o.includes(e.type.name));
|
|
1250
|
+
n.ensureMarks(l);
|
|
1261
1251
|
}
|
|
1262
1252
|
return !0;
|
|
1263
1253
|
};
|
|
1264
|
-
function
|
|
1254
|
+
function wn(e) {
|
|
1265
1255
|
return !e || e === "1" ? null : e;
|
|
1266
1256
|
}
|
|
1267
|
-
function
|
|
1268
|
-
return
|
|
1257
|
+
function Tn(e, t) {
|
|
1258
|
+
return wn(e) === wn(t);
|
|
1269
1259
|
}
|
|
1270
|
-
var
|
|
1260
|
+
var En = (e, t) => {
|
|
1271
1261
|
let n = R((e) => e.type === t)(e.selection);
|
|
1272
1262
|
if (!n) return !0;
|
|
1273
1263
|
let r = e.doc.resolve(Math.max(0, n.pos - 1)).before(n.depth);
|
|
1274
1264
|
if (r === void 0) return !0;
|
|
1275
1265
|
let i = e.doc.nodeAt(r);
|
|
1276
|
-
return !(n.node.type === i?.type &&
|
|
1277
|
-
},
|
|
1266
|
+
return !(n.node.type === i?.type && a(e.doc, n.pos)) || !Tn(n.node.attrs.type, i?.attrs.type) || e.join(n.pos), !0;
|
|
1267
|
+
}, Dn = (e, t) => {
|
|
1278
1268
|
let n = R((e) => e.type === t)(e.selection);
|
|
1279
1269
|
if (!n) return !0;
|
|
1280
1270
|
let r = e.doc.resolve(n.start).after(n.depth);
|
|
1281
1271
|
if (r === void 0) return !0;
|
|
1282
1272
|
let i = e.doc.nodeAt(r);
|
|
1283
|
-
return !(n.node.type === i?.type &&
|
|
1273
|
+
return !(n.node.type === i?.type && a(e.doc, r)) || !Tn(n.node.attrs.type, i?.attrs.type) || e.join(r), !0;
|
|
1284
1274
|
};
|
|
1285
|
-
function
|
|
1275
|
+
function On(e) {
|
|
1286
1276
|
let t = e.doc, n = t.firstChild;
|
|
1287
1277
|
if (!n) return null;
|
|
1288
1278
|
let r = t.resolve(1), i = t.resolve(n.nodeSize - 1);
|
|
1289
|
-
return
|
|
1279
|
+
return C.between(r, i);
|
|
1290
1280
|
}
|
|
1291
|
-
var
|
|
1292
|
-
let { extensions: d, splittableMarks: f } = i.extensionManager, p =
|
|
1293
|
-
if (!
|
|
1294
|
-
let
|
|
1295
|
-
node:
|
|
1281
|
+
var kn = (e, t, n, r = {}) => ({ editor: i, tr: a, state: o, dispatch: s, chain: c, commands: l, can: u }) => {
|
|
1282
|
+
let { extensions: d, splittableMarks: f } = i.extensionManager, p = O(e, o.schema), m = O(t, o.schema), { selection: h, storedMarks: g } = o, { $from: _, $to: ee } = h, te = _.blockRange(ee), ne = g || h.$to.parentOffset && h.$from.marks();
|
|
1283
|
+
if (!te) return !1;
|
|
1284
|
+
let re = R((e) => q(e.type.name, d))(h), ie = h.from === 0 && h.to === o.doc.content.size, ae = o.doc.content.content, v = ae.length === 1 ? ae[0] : null, oe = ie && v && q(v.type.name, d) ? {
|
|
1285
|
+
node: v,
|
|
1296
1286
|
pos: 0,
|
|
1297
1287
|
depth: 0
|
|
1298
|
-
} : null,
|
|
1299
|
-
if ((
|
|
1300
|
-
if (
|
|
1301
|
-
let n =
|
|
1288
|
+
} : null, y = re ?? oe, se = !!re && te.depth >= 1 && te.depth - re.depth <= 1, ce = !!oe;
|
|
1289
|
+
if ((se || ce) && y) {
|
|
1290
|
+
if (y.node.type === p) return ie && ce ? c().command(({ tr: e, dispatch: t }) => {
|
|
1291
|
+
let n = On(e);
|
|
1302
1292
|
return n ? (e.setSelection(n), t && t(e), !0) : !1;
|
|
1303
1293
|
}).liftListItem(m).run() : l.liftListItem(m);
|
|
1304
|
-
if (q(
|
|
1294
|
+
if (q(y.node.type.name, d) && p.validContent(y.node.content)) return c().command(() => (a.setNodeMarkup(y.pos, p), !0)).command(() => En(a, p)).command(() => Dn(a, p)).run();
|
|
1305
1295
|
}
|
|
1306
|
-
return !n || !
|
|
1307
|
-
let e = u().wrapInList(p, r), t =
|
|
1296
|
+
return !n || !ne || !s ? c().command(() => u().wrapInList(p, r) ? !0 : l.clearNodes()).wrapInList(p, r).command(() => En(a, p)).command(() => Dn(a, p)).run() : c().command(() => {
|
|
1297
|
+
let e = u().wrapInList(p, r), t = ne.filter((e) => f.includes(e.type.name));
|
|
1308
1298
|
return a.ensureMarks(t), e ? !0 : l.clearNodes();
|
|
1309
|
-
}).wrapInList(p, r).command(() =>
|
|
1310
|
-
},
|
|
1311
|
-
let { extendEmptyMarkRange: a = !1 } = n, o =
|
|
1312
|
-
return
|
|
1313
|
-
},
|
|
1314
|
-
let a =
|
|
1299
|
+
}).wrapInList(p, r).command(() => En(a, p)).command(() => Dn(a, p)).run();
|
|
1300
|
+
}, An = (e, t = {}, n = {}) => ({ state: r, commands: i }) => {
|
|
1301
|
+
let { extendEmptyMarkRange: a = !1 } = n, o = A(e, r.schema);
|
|
1302
|
+
return nn(r, o, t) ? i.unsetMark(o, { extendEmptyMarkRange: a }) : i.setMark(o, t);
|
|
1303
|
+
}, jn = (e, t, n = {}) => ({ state: r, commands: i }) => {
|
|
1304
|
+
let a = O(e, r.schema), o = O(t, r.schema), s = F(r, a, n), c;
|
|
1315
1305
|
return r.selection.$anchor.sameParent(r.selection.$head) && (c = r.selection.$anchor.parent.attrs), s ? i.setNode(o, c) : i.setNode(a, {
|
|
1316
1306
|
...c,
|
|
1317
1307
|
...n
|
|
1318
1308
|
});
|
|
1319
|
-
},
|
|
1320
|
-
let i =
|
|
1309
|
+
}, Mn = (e, t = {}) => ({ state: n, commands: r }) => {
|
|
1310
|
+
let i = O(e, n.schema);
|
|
1321
1311
|
return F(n, i, t) ? r.lift(i) : r.wrapIn(i, t);
|
|
1322
|
-
},
|
|
1312
|
+
}, Nn = () => ({ state: e, dispatch: t }) => {
|
|
1323
1313
|
let n = e.plugins;
|
|
1324
1314
|
for (let r = 0; r < n.length; r += 1) {
|
|
1325
1315
|
let i = n[r], a;
|
|
@@ -1336,7 +1326,7 @@ var On = (e, t, n, r = {}) => ({ editor: i, tr: a, state: o, dispatch: s, chain:
|
|
|
1336
1326
|
}
|
|
1337
1327
|
}
|
|
1338
1328
|
return !1;
|
|
1339
|
-
},
|
|
1329
|
+
}, Pn = (e = {}) => ({ tr: t, dispatch: n, editor: r }) => {
|
|
1340
1330
|
let { ignoreClearable: i = !1 } = e, { selection: a } = t, { empty: o, ranges: s } = a;
|
|
1341
1331
|
if (o) return !0;
|
|
1342
1332
|
let { nonClearableMarks: c } = r.extensionManager;
|
|
@@ -1347,27 +1337,27 @@ var On = (e, t, n, r = {}) => ({ editor: i, tr: a, state: o, dispatch: s, chain:
|
|
|
1347
1337
|
});
|
|
1348
1338
|
}
|
|
1349
1339
|
return !0;
|
|
1350
|
-
},
|
|
1351
|
-
let { extendEmptyMarkRange: a = !1 } = t, { selection: o } = n, s =
|
|
1340
|
+
}, Fn = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
1341
|
+
let { extendEmptyMarkRange: a = !1 } = t, { selection: o } = n, s = A(e, r.schema), { $from: c, empty: l, ranges: u } = o;
|
|
1352
1342
|
if (!i) return !0;
|
|
1353
1343
|
if (l && a) {
|
|
1354
|
-
let { from: e, to: t } = o, r =
|
|
1344
|
+
let { from: e, to: t } = o, r = Re(c, s, c.marks().find((e) => e.type === s)?.attrs);
|
|
1355
1345
|
r && (e = r.from, t = r.to), n.removeMark(e, t, s);
|
|
1356
1346
|
} else u.forEach((e) => {
|
|
1357
1347
|
n.removeMark(e.$from.pos, e.$to.pos, s);
|
|
1358
1348
|
});
|
|
1359
1349
|
return n.removeStoredMark(s), !0;
|
|
1360
|
-
},
|
|
1350
|
+
}, In = (e) => ({ tr: t, state: n, dispatch: r }) => {
|
|
1361
1351
|
let { selection: i } = n, a, o;
|
|
1362
1352
|
return typeof e == "number" ? (a = e, o = e) : e && "from" in e && "to" in e ? (a = e.from, o = e.to) : (a = i.from, o = i.to), r && t.doc.nodesBetween(a, o, (e, n) => {
|
|
1363
1353
|
if (e.isText) return;
|
|
1364
1354
|
let r = { ...e.attrs };
|
|
1365
1355
|
delete r.dir, t.setNodeMarkup(n, void 0, r);
|
|
1366
1356
|
}), !0;
|
|
1367
|
-
},
|
|
1357
|
+
}, Ln = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
1368
1358
|
let a = null, o = null, s = I(typeof e == "string" ? e : e.name, r.schema);
|
|
1369
1359
|
if (!s) return !1;
|
|
1370
|
-
s === "node" && (a =
|
|
1360
|
+
s === "node" && (a = O(e, r.schema)), s === "mark" && (o = A(e, r.schema));
|
|
1371
1361
|
let c = !1;
|
|
1372
1362
|
return n.selection.ranges.forEach((e) => {
|
|
1373
1363
|
let s = e.$from.pos, l = e.$to.pos, u, d, f, p;
|
|
@@ -1396,30 +1386,30 @@ var On = (e, t, n, r = {}) => ({ editor: i, tr: a, state: o, dispatch: s, chain:
|
|
|
1396
1386
|
}));
|
|
1397
1387
|
}));
|
|
1398
1388
|
}), c;
|
|
1399
|
-
},
|
|
1389
|
+
}, J = new x("__tiptap_decorations__"), Rn = (e) => ({ tr: t, dispatch: n }) => (n && t.setMeta(J, {
|
|
1400
1390
|
type: "force",
|
|
1401
1391
|
name: e
|
|
1402
|
-
}), !0),
|
|
1403
|
-
let i =
|
|
1404
|
-
return
|
|
1405
|
-
},
|
|
1406
|
-
let i =
|
|
1407
|
-
return
|
|
1408
|
-
},
|
|
1409
|
-
blur: () =>
|
|
1410
|
-
clearContent: () =>
|
|
1411
|
-
clearNodes: () =>
|
|
1412
|
-
command: () =>
|
|
1413
|
-
createParagraphNear: () =>
|
|
1414
|
-
cut: () =>
|
|
1415
|
-
deleteCurrentNode: () =>
|
|
1416
|
-
deleteNode: () =>
|
|
1417
|
-
deleteRange: () =>
|
|
1418
|
-
deleteSelection: () =>
|
|
1419
|
-
enter: () =>
|
|
1420
|
-
exitCode: () =>
|
|
1421
|
-
extendMarkRange: () =>
|
|
1422
|
-
first: () =>
|
|
1392
|
+
}), !0), zn = (e, t = {}) => ({ state: n, dispatch: r }) => {
|
|
1393
|
+
let i = O(e, n.schema);
|
|
1394
|
+
return se(i, t)(n, r);
|
|
1395
|
+
}, Bn = (e, t = {}) => ({ state: n, dispatch: r }) => {
|
|
1396
|
+
let i = O(e, n.schema);
|
|
1397
|
+
return _e(i, t)(n, r);
|
|
1398
|
+
}, Vn = /* @__PURE__ */ e({
|
|
1399
|
+
blur: () => be,
|
|
1400
|
+
clearContent: () => xe,
|
|
1401
|
+
clearNodes: () => Se,
|
|
1402
|
+
command: () => Ce,
|
|
1403
|
+
createParagraphNear: () => we,
|
|
1404
|
+
cut: () => Te,
|
|
1405
|
+
deleteCurrentNode: () => Ee,
|
|
1406
|
+
deleteNode: () => De,
|
|
1407
|
+
deleteRange: () => Oe,
|
|
1408
|
+
deleteSelection: () => Me,
|
|
1409
|
+
enter: () => Ne,
|
|
1410
|
+
exitCode: () => Pe,
|
|
1411
|
+
extendMarkRange: () => ze,
|
|
1412
|
+
first: () => Be,
|
|
1423
1413
|
focus: () => Ge,
|
|
1424
1414
|
forEach: () => Ke,
|
|
1425
1415
|
insertContent: () => qe,
|
|
@@ -1447,41 +1437,41 @@ var On = (e, t, n, r = {}) => ({ editor: i, tr: a, state: o, dispatch: s, chain:
|
|
|
1447
1437
|
selectTextblockEnd: () => Ct,
|
|
1448
1438
|
selectTextblockStart: () => wt,
|
|
1449
1439
|
setContent: () => Tt,
|
|
1450
|
-
setMark: () =>
|
|
1451
|
-
setMeta: () =>
|
|
1452
|
-
setNode: () =>
|
|
1453
|
-
setNodeSelection: () =>
|
|
1454
|
-
setTextDirection: () =>
|
|
1455
|
-
setTextSelection: () =>
|
|
1456
|
-
sinkListItem: () =>
|
|
1457
|
-
splitBlock: () =>
|
|
1458
|
-
splitListItem: () =>
|
|
1459
|
-
toggleList: () =>
|
|
1460
|
-
toggleMark: () =>
|
|
1461
|
-
toggleNode: () =>
|
|
1462
|
-
toggleWrap: () =>
|
|
1463
|
-
undoInputRule: () =>
|
|
1464
|
-
unsetAllMarks: () =>
|
|
1465
|
-
unsetMark: () =>
|
|
1466
|
-
unsetTextDirection: () =>
|
|
1467
|
-
updateAttributes: () =>
|
|
1468
|
-
updateDecorations: () =>
|
|
1469
|
-
wrapIn: () =>
|
|
1470
|
-
wrapInList: () =>
|
|
1471
|
-
}),
|
|
1472
|
-
function
|
|
1473
|
-
|
|
1440
|
+
setMark: () => mn,
|
|
1441
|
+
setMeta: () => hn,
|
|
1442
|
+
setNode: () => gn,
|
|
1443
|
+
setNodeSelection: () => _n,
|
|
1444
|
+
setTextDirection: () => vn,
|
|
1445
|
+
setTextSelection: () => yn,
|
|
1446
|
+
sinkListItem: () => bn,
|
|
1447
|
+
splitBlock: () => Sn,
|
|
1448
|
+
splitListItem: () => Cn,
|
|
1449
|
+
toggleList: () => kn,
|
|
1450
|
+
toggleMark: () => An,
|
|
1451
|
+
toggleNode: () => jn,
|
|
1452
|
+
toggleWrap: () => Mn,
|
|
1453
|
+
undoInputRule: () => Nn,
|
|
1454
|
+
unsetAllMarks: () => Pn,
|
|
1455
|
+
unsetMark: () => Fn,
|
|
1456
|
+
unsetTextDirection: () => In,
|
|
1457
|
+
updateAttributes: () => Ln,
|
|
1458
|
+
updateDecorations: () => Rn,
|
|
1459
|
+
wrapIn: () => zn,
|
|
1460
|
+
wrapInList: () => Bn
|
|
1461
|
+
}), Y = /* @__PURE__ */ new WeakMap();
|
|
1462
|
+
function Hn(e, t) {
|
|
1463
|
+
Y.set(e, (Y.get(e) ?? 0) + 1);
|
|
1474
1464
|
try {
|
|
1475
1465
|
return t();
|
|
1476
1466
|
} finally {
|
|
1477
|
-
let t = (
|
|
1478
|
-
t > 0 ?
|
|
1467
|
+
let t = (Y.get(e) ?? 1) - 1;
|
|
1468
|
+
t > 0 ? Y.set(e, t) : Y.delete(e);
|
|
1479
1469
|
}
|
|
1480
1470
|
}
|
|
1481
|
-
function
|
|
1482
|
-
return
|
|
1471
|
+
function Un(e) {
|
|
1472
|
+
return Y.has(e);
|
|
1483
1473
|
}
|
|
1484
|
-
var
|
|
1474
|
+
var Wn = class {
|
|
1485
1475
|
constructor() {
|
|
1486
1476
|
this.callbacks = {};
|
|
1487
1477
|
}
|
|
@@ -1505,44 +1495,44 @@ var Un = class {
|
|
|
1505
1495
|
removeAllListeners() {
|
|
1506
1496
|
this.callbacks = {};
|
|
1507
1497
|
}
|
|
1508
|
-
},
|
|
1509
|
-
function
|
|
1498
|
+
}, Gn = typeof process < "u" && process.env.NODE_ENV !== "production";
|
|
1499
|
+
function Kn(e) {
|
|
1510
1500
|
return e.kind === "widget";
|
|
1511
1501
|
}
|
|
1512
|
-
function
|
|
1502
|
+
function qn(e, t) {
|
|
1513
1503
|
let n = [], r = /* @__PURE__ */ new Set();
|
|
1514
|
-
for (let i of e) i.kind === "widget" &&
|
|
1504
|
+
for (let i of e) i.kind === "widget" && Kn(i) && r.add(i.key), n.push(i.toPMDecoration(t));
|
|
1515
1505
|
return {
|
|
1516
1506
|
decorations: n,
|
|
1517
1507
|
widgetKeys: r
|
|
1518
1508
|
};
|
|
1519
1509
|
}
|
|
1520
|
-
function
|
|
1521
|
-
let { decorations: r, widgetKeys: i } =
|
|
1510
|
+
function Jn(e, t, n) {
|
|
1511
|
+
let { decorations: r, widgetKeys: i } = qn(t, n);
|
|
1522
1512
|
return {
|
|
1523
|
-
set:
|
|
1513
|
+
set: T.create(e, r),
|
|
1524
1514
|
widgetKeys: i
|
|
1525
1515
|
};
|
|
1526
1516
|
}
|
|
1527
|
-
function
|
|
1517
|
+
function Yn({ position: e, from: t, to: n, docSize: r }) {
|
|
1528
1518
|
return e < t ? !1 : e < n || e === n && n === r;
|
|
1529
1519
|
}
|
|
1530
|
-
function
|
|
1531
|
-
return e.filter((e) =>
|
|
1520
|
+
function Xn({ decorations: e, from: t, to: n, docSize: r, extensionName: i, warnedExtensions: a }) {
|
|
1521
|
+
return e.filter((e) => Yn({
|
|
1532
1522
|
position: e.anchor,
|
|
1533
1523
|
from: t,
|
|
1534
1524
|
to: n,
|
|
1535
1525
|
docSize: r
|
|
1536
1526
|
}) ? !0 : (e.anchor === n || a.has(i) || (a.add(i), console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)), !1));
|
|
1537
1527
|
}
|
|
1538
|
-
function
|
|
1528
|
+
function Zn(e) {
|
|
1539
1529
|
let t = e.spec?.key;
|
|
1540
1530
|
return typeof t == "string" ? t : void 0;
|
|
1541
1531
|
}
|
|
1542
|
-
function
|
|
1532
|
+
function Qn(e) {
|
|
1543
1533
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
1544
1534
|
for (let r of e.find()) {
|
|
1545
|
-
let e =
|
|
1535
|
+
let e = Zn(r);
|
|
1546
1536
|
if (!e) continue;
|
|
1547
1537
|
let i = r.spec.extensionName ?? "unknown", a = t.get(e) ?? /* @__PURE__ */ new Set();
|
|
1548
1538
|
a.add(i), t.set(e, a), n.set(e, (n.get(e) ?? 0) + 1);
|
|
@@ -1552,18 +1542,18 @@ function Zn(e) {
|
|
|
1552
1542
|
extensions: t
|
|
1553
1543
|
})).filter(({ key: e }) => (n.get(e) ?? 0) > 1);
|
|
1554
1544
|
}
|
|
1555
|
-
function
|
|
1545
|
+
function $n(e) {
|
|
1556
1546
|
return e.jsonID === "attr";
|
|
1557
1547
|
}
|
|
1558
|
-
function
|
|
1548
|
+
function er(e) {
|
|
1559
1549
|
let t = !1;
|
|
1560
1550
|
if (e.getMap().forEach(() => {
|
|
1561
1551
|
t = !0;
|
|
1562
|
-
}), t ||
|
|
1552
|
+
}), t || $n(e)) return !0;
|
|
1563
1553
|
let n = e;
|
|
1564
1554
|
return typeof n.from == "number" && typeof n.to == "number";
|
|
1565
1555
|
}
|
|
1566
|
-
function
|
|
1556
|
+
function tr(e, t) {
|
|
1567
1557
|
let n = null, r = 0, i = 0;
|
|
1568
1558
|
for (let a = 0; a < e.childCount && !(i > t.to); a += 1) {
|
|
1569
1559
|
let o = i + e.child(a).nodeSize;
|
|
@@ -1574,11 +1564,11 @@ function er(e, t) {
|
|
|
1574
1564
|
to: r
|
|
1575
1565
|
};
|
|
1576
1566
|
}
|
|
1577
|
-
function
|
|
1578
|
-
if (e.steps.some((e) =>
|
|
1579
|
-
let n =
|
|
1567
|
+
function nr(e, t) {
|
|
1568
|
+
if (e.steps.some((e) => !er(e))) return { type: "full" };
|
|
1569
|
+
let n = Zt(e).map(({ newRange: e }) => e);
|
|
1580
1570
|
e.steps.forEach((t, r) => {
|
|
1581
|
-
if (
|
|
1571
|
+
if (!$n(t)) return;
|
|
1582
1572
|
let i = e.mapping.slice(r);
|
|
1583
1573
|
n.push({
|
|
1584
1574
|
from: i.map(t.pos, -1),
|
|
@@ -1587,7 +1577,7 @@ function tr(e, t) {
|
|
|
1587
1577
|
});
|
|
1588
1578
|
let r = [];
|
|
1589
1579
|
for (let e of n) {
|
|
1590
|
-
let n =
|
|
1580
|
+
let n = tr(t, e);
|
|
1591
1581
|
n && r.push(n);
|
|
1592
1582
|
}
|
|
1593
1583
|
r.sort((e, t) => e.from - t.from);
|
|
@@ -1601,29 +1591,29 @@ function tr(e, t) {
|
|
|
1601
1591
|
ranges: i
|
|
1602
1592
|
};
|
|
1603
1593
|
}
|
|
1604
|
-
function
|
|
1594
|
+
function rr(e, t, n, r) {
|
|
1605
1595
|
return e.map(t, n, { onRemove: (e) => {
|
|
1606
1596
|
let t = e?.key;
|
|
1607
1597
|
typeof t == "string" && r.delete(t);
|
|
1608
1598
|
} });
|
|
1609
1599
|
}
|
|
1610
|
-
function
|
|
1611
|
-
let r = t.decorationSetsByExtension[e] ??
|
|
1600
|
+
function ir(e, t, n) {
|
|
1601
|
+
let r = t.decorationSetsByExtension[e] ?? T.empty, i = new Set(t.widgetKeysByExtension[e] ?? []);
|
|
1612
1602
|
return {
|
|
1613
|
-
set:
|
|
1603
|
+
set: rr(r, n.mapping, n.doc, i),
|
|
1614
1604
|
widgetKeys: i
|
|
1615
1605
|
};
|
|
1616
1606
|
}
|
|
1617
|
-
function
|
|
1607
|
+
function ar(e, t) {
|
|
1618
1608
|
let n = Object.values(t).flatMap((e) => e.find());
|
|
1619
|
-
return
|
|
1609
|
+
return T.create(e, n);
|
|
1620
1610
|
}
|
|
1621
|
-
function
|
|
1611
|
+
function or(e) {
|
|
1622
1612
|
let t = /* @__PURE__ */ new Set();
|
|
1623
1613
|
for (let n of Object.values(e)) for (let e of n) t.add(e);
|
|
1624
1614
|
return t;
|
|
1625
1615
|
}
|
|
1626
|
-
function
|
|
1616
|
+
function sr(e, t) {
|
|
1627
1617
|
switch (t.update ?? "document") {
|
|
1628
1618
|
case "document":
|
|
1629
1619
|
if (t.createInRange) throw Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);
|
|
@@ -1638,21 +1628,21 @@ function or(e, t) {
|
|
|
1638
1628
|
default: throw Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`);
|
|
1639
1629
|
}
|
|
1640
1630
|
}
|
|
1641
|
-
function
|
|
1631
|
+
function cr(e, t, n) {
|
|
1642
1632
|
return n ? !0 : e.update === "manual" ? !1 : e.shouldUpdate ? e.shouldUpdate(t) : t.tr.docChanged;
|
|
1643
1633
|
}
|
|
1644
|
-
var
|
|
1634
|
+
var lr = /* @__PURE__ */ new Set(), ur = class {
|
|
1645
1635
|
constructor(e) {
|
|
1646
1636
|
this.warnedWidgetKeys = /* @__PURE__ */ new Set(), this.warnedOutOfRangeExtensions = /* @__PURE__ */ new Set(), this.handleBeforeTransaction = ({ nextState: e }) => {
|
|
1647
|
-
let t =
|
|
1637
|
+
let t = J.getState(e);
|
|
1648
1638
|
t && this.warnDuplicateWidgetKeys(t);
|
|
1649
|
-
}, this.editor = e.editor, this.entries = this.resolveEntries(e.entries), this.entries.forEach(({ name: e, spec: t }) =>
|
|
1639
|
+
}, this.editor = e.editor, this.entries = this.resolveEntries(e.entries), this.entries.forEach(({ name: e, spec: t }) => sr(e, t)), this.plugin = this.entries.length > 0 ? this.createPlugin() : null, this.editor.on("beforeTransaction", this.handleBeforeTransaction);
|
|
1650
1640
|
}
|
|
1651
1641
|
destroy() {
|
|
1652
1642
|
this.editor.off("beforeTransaction", this.handleBeforeTransaction);
|
|
1653
1643
|
}
|
|
1654
1644
|
liveWidgetKeys() {
|
|
1655
|
-
return
|
|
1645
|
+
return J.getState(this.editor.state)?.widgetKeys ?? lr;
|
|
1656
1646
|
}
|
|
1657
1647
|
get mountedView() {
|
|
1658
1648
|
return this.editor.isDestroyed ? null : this.editor.view;
|
|
@@ -1670,8 +1660,8 @@ var cr = /* @__PURE__ */ new Set(), lr = class {
|
|
|
1670
1660
|
}
|
|
1671
1661
|
createPlugin() {
|
|
1672
1662
|
let { editor: e, entries: t } = this;
|
|
1673
|
-
return new
|
|
1674
|
-
key:
|
|
1663
|
+
return new b({
|
|
1664
|
+
key: J,
|
|
1675
1665
|
state: {
|
|
1676
1666
|
init: (e, n) => {
|
|
1677
1667
|
let r = {}, i = {};
|
|
@@ -1683,22 +1673,22 @@ var cr = /* @__PURE__ */ new Set(), lr = class {
|
|
|
1683
1673
|
decorationSetsByExtension: r,
|
|
1684
1674
|
widgetKeysByExtension: i,
|
|
1685
1675
|
mergedDecorationSet: this.buildMergedSet(n.doc, r),
|
|
1686
|
-
widgetKeys:
|
|
1676
|
+
widgetKeys: or(i)
|
|
1687
1677
|
};
|
|
1688
1678
|
return this.warnDuplicateWidgetKeys(a), a;
|
|
1689
1679
|
},
|
|
1690
1680
|
apply: (n, r, i, a) => {
|
|
1691
|
-
let o = n.getMeta(
|
|
1692
|
-
return
|
|
1681
|
+
let o = n.getMeta(J), s = o?.type === "force" && !o.name, c = o?.type === "force" ? o.name : void 0, l = {}, u = {}, d = /* @__PURE__ */ new Set();
|
|
1682
|
+
return Hn(e, () => {
|
|
1693
1683
|
for (let { name: o, spec: f } of t) {
|
|
1694
1684
|
let t = s || c === o;
|
|
1695
|
-
if (!
|
|
1685
|
+
if (!cr(f, {
|
|
1696
1686
|
editor: e,
|
|
1697
1687
|
tr: n,
|
|
1698
1688
|
oldState: i,
|
|
1699
1689
|
newState: a
|
|
1700
1690
|
}, t)) {
|
|
1701
|
-
let e =
|
|
1691
|
+
let e = ir(o, r, n);
|
|
1702
1692
|
l[o] = e.set, u[o] = e.widgetKeys;
|
|
1703
1693
|
} else if (f.update === "changedRanges" && n.docChanged && !t) {
|
|
1704
1694
|
let e = this.applyChangedRangesRecompute(o, f, r, n, a);
|
|
@@ -1718,34 +1708,34 @@ var cr = /* @__PURE__ */ new Set(), lr = class {
|
|
|
1718
1708
|
decorationSetsByExtension: l,
|
|
1719
1709
|
recomputedNames: d
|
|
1720
1710
|
}),
|
|
1721
|
-
widgetKeys:
|
|
1711
|
+
widgetKeys: or(u)
|
|
1722
1712
|
};
|
|
1723
1713
|
}
|
|
1724
1714
|
},
|
|
1725
1715
|
props: { decorations(e) {
|
|
1726
|
-
return
|
|
1716
|
+
return J.getState(e)?.mergedDecorationSet ?? T.empty;
|
|
1727
1717
|
} }
|
|
1728
1718
|
});
|
|
1729
1719
|
}
|
|
1730
1720
|
applyChangedRangesRecompute(e, t, n, r, i) {
|
|
1731
|
-
let a =
|
|
1721
|
+
let a = nr(r, i.doc);
|
|
1732
1722
|
return a.type === "full" ? this.buildFullSet(e, t, i) : this.rebuildRanges(e, t, n, r, i, a.ranges);
|
|
1733
1723
|
}
|
|
1734
1724
|
rebuildRanges(e, t, n, r, i, a) {
|
|
1735
|
-
let o = n.decorationSetsByExtension[e] ??
|
|
1725
|
+
let o = n.decorationSetsByExtension[e] ?? T.empty, s = new Set(n.widgetKeysByExtension[e] ?? []), c = rr(o, r.mapping, r.doc, s), l = i.doc.content.size;
|
|
1736
1726
|
for (let { from: n, to: r } of a) {
|
|
1737
|
-
let a = c.find(n, r).filter((e) =>
|
|
1727
|
+
let a = c.find(n, r).filter((e) => Yn({
|
|
1738
1728
|
position: e.from,
|
|
1739
1729
|
from: n,
|
|
1740
1730
|
to: r,
|
|
1741
1731
|
docSize: l
|
|
1742
1732
|
}));
|
|
1743
1733
|
for (let e of a) {
|
|
1744
|
-
let t =
|
|
1734
|
+
let t = Zn(e);
|
|
1745
1735
|
t && s.delete(t);
|
|
1746
1736
|
}
|
|
1747
1737
|
c = c.remove(a);
|
|
1748
|
-
let { decorations: o, widgetKeys: u } =
|
|
1738
|
+
let { decorations: o, widgetKeys: u } = qn(Xn({
|
|
1749
1739
|
decorations: this.runCreate(e, "createInRange", () => t.createInRange({
|
|
1750
1740
|
editor: this.editor,
|
|
1751
1741
|
state: i,
|
|
@@ -1773,7 +1763,7 @@ var cr = /* @__PURE__ */ new Set(), lr = class {
|
|
|
1773
1763
|
state: n,
|
|
1774
1764
|
view: this.mountedView
|
|
1775
1765
|
}));
|
|
1776
|
-
return
|
|
1766
|
+
return Jn(n.doc, r, e);
|
|
1777
1767
|
}
|
|
1778
1768
|
runCreate(e, t, n) {
|
|
1779
1769
|
try {
|
|
@@ -1783,12 +1773,12 @@ var cr = /* @__PURE__ */ new Set(), lr = class {
|
|
|
1783
1773
|
}
|
|
1784
1774
|
}
|
|
1785
1775
|
warnDuplicateWidgetKeys(e) {
|
|
1786
|
-
if (!
|
|
1776
|
+
if (!Gn) return;
|
|
1787
1777
|
if (e.widgetKeys.size === 0) {
|
|
1788
1778
|
this.warnedWidgetKeys.clear();
|
|
1789
1779
|
return;
|
|
1790
1780
|
}
|
|
1791
|
-
let t =
|
|
1781
|
+
let t = Qn(e.mergedDecorationSet), n = new Set(t.map(({ key: e }) => e));
|
|
1792
1782
|
for (let { key: e, extensions: n } of t) {
|
|
1793
1783
|
if (this.warnedWidgetKeys.has(e)) continue;
|
|
1794
1784
|
let t = Array.from(n).map((e) => `"${e}"`).join(", ");
|
|
@@ -1798,15 +1788,15 @@ var cr = /* @__PURE__ */ new Set(), lr = class {
|
|
|
1798
1788
|
}
|
|
1799
1789
|
buildMergedSet(e, t) {
|
|
1800
1790
|
let n = Object.keys(t);
|
|
1801
|
-
return n.length === 1 ? t[n[0]] :
|
|
1791
|
+
return n.length === 1 ? t[n[0]] : ar(e, t);
|
|
1802
1792
|
}
|
|
1803
1793
|
mergeAfterApply({ entries: e, previous: t, tr: n, decorationSetsByExtension: r, recomputedNames: i }) {
|
|
1804
|
-
return e.length === 1 ? r[e[0].name] : i.size === 0 ? t.mergedDecorationSet.map(n.mapping, n.doc) :
|
|
1794
|
+
return e.length === 1 ? r[e[0].name] : i.size === 0 ? t.mergedDecorationSet.map(n.mapping, n.doc) : ar(n.doc, r);
|
|
1805
1795
|
}
|
|
1806
1796
|
};
|
|
1807
|
-
function
|
|
1797
|
+
function dr(e, t) {
|
|
1808
1798
|
let { selection: n } = e, { $from: r } = n;
|
|
1809
|
-
if (n instanceof
|
|
1799
|
+
if (n instanceof ue) {
|
|
1810
1800
|
let e = r.index();
|
|
1811
1801
|
return r.parent.canReplaceWith(e, e + 1, t);
|
|
1812
1802
|
}
|
|
@@ -1818,22 +1808,22 @@ function ur(e, t) {
|
|
|
1818
1808
|
}
|
|
1819
1809
|
return !1;
|
|
1820
1810
|
}
|
|
1821
|
-
function
|
|
1811
|
+
function fr(e, t, n) {
|
|
1822
1812
|
let r = document.querySelector(`style[data-tiptap-style${n ? `-${n}` : ""}]`);
|
|
1823
1813
|
if (r !== null) return r;
|
|
1824
1814
|
let i = document.createElement("style");
|
|
1825
1815
|
return t && i.setAttribute("nonce", t), i.setAttribute(`data-tiptap-style${n ? `-${n}` : ""}`, ""), i.innerHTML = e, document.getElementsByTagName("head")[0].appendChild(i), i;
|
|
1826
1816
|
}
|
|
1827
|
-
function
|
|
1817
|
+
function pr(e) {
|
|
1828
1818
|
return typeof e == "number";
|
|
1829
1819
|
}
|
|
1830
|
-
function
|
|
1820
|
+
function mr(e) {
|
|
1831
1821
|
return Object.prototype.toString.call(e).slice(8, -1);
|
|
1832
1822
|
}
|
|
1833
|
-
function
|
|
1834
|
-
return
|
|
1823
|
+
function X(e) {
|
|
1824
|
+
return mr(e) === "Object" && e.constructor === Object && Object.getPrototypeOf(e) === Object.prototype;
|
|
1835
1825
|
}
|
|
1836
|
-
function
|
|
1826
|
+
function hr(e, t, n) {
|
|
1837
1827
|
let r = e.split("\n"), i = [], a = "", o = 0, s = t.baseIndentSize || 2;
|
|
1838
1828
|
for (; o < r.length;) {
|
|
1839
1829
|
let e = r[o], u = e.match(t.itemPattern);
|
|
@@ -1877,7 +1867,7 @@ function mr(e, t, n) {
|
|
|
1877
1867
|
raw: a
|
|
1878
1868
|
};
|
|
1879
1869
|
}
|
|
1880
|
-
function
|
|
1870
|
+
function gr(e, t, n, r) {
|
|
1881
1871
|
if (!e || !Array.isArray(e.content)) return "";
|
|
1882
1872
|
let i = typeof n == "function" ? n(r) : n, [a, ...o] = e.content, s = `${i}${t.renderChildren([a])}`;
|
|
1883
1873
|
return o && o.length > 0 && o.forEach((e, n) => {
|
|
@@ -1888,13 +1878,13 @@ function hr(e, t, n, r) {
|
|
|
1888
1878
|
}
|
|
1889
1879
|
}), s;
|
|
1890
1880
|
}
|
|
1891
|
-
function
|
|
1881
|
+
function _r(e, t) {
|
|
1892
1882
|
let n = { ...e };
|
|
1893
|
-
return
|
|
1894
|
-
|
|
1883
|
+
return X(e) && X(t) && Object.keys(t).forEach((r) => {
|
|
1884
|
+
X(t[r]) && X(e[r]) ? n[r] = _r(e[r], t[r]) : n[r] = t[r];
|
|
1895
1885
|
}), n;
|
|
1896
1886
|
}
|
|
1897
|
-
function
|
|
1887
|
+
function vr(e, t, n = {}) {
|
|
1898
1888
|
let { state: r } = t, { doc: i, tr: a } = r, o = e;
|
|
1899
1889
|
i.descendants((t, r) => {
|
|
1900
1890
|
let i = a.mapping.map(r), s = a.mapping.map(r) + t.nodeSize, c = null;
|
|
@@ -1914,39 +1904,39 @@ function _r(e, t, n = {}) {
|
|
|
1914
1904
|
}
|
|
1915
1905
|
}), a.docChanged && t.view.dispatch(a);
|
|
1916
1906
|
}
|
|
1917
|
-
var
|
|
1907
|
+
var Z = class {
|
|
1918
1908
|
constructor(e) {
|
|
1919
1909
|
this.find = e.find, this.handler = e.handler, this.undoable = e.undoable ?? !0;
|
|
1920
1910
|
}
|
|
1921
|
-
},
|
|
1922
|
-
if (
|
|
1911
|
+
}, yr = (e, t) => {
|
|
1912
|
+
if (Fe(t)) return t.exec(e);
|
|
1923
1913
|
let n = t(e);
|
|
1924
1914
|
if (!n) return null;
|
|
1925
1915
|
let r = [n.text];
|
|
1926
1916
|
return r.index = n.index, r.input = e, r.data = n.data, n.replaceWith && (n.text.includes(n.replaceWith) || console.warn("[tiptap warn]: \"inputRuleMatch.replaceWith\" must be part of \"inputRuleMatch.text\"."), r.push(n.replaceWith)), r;
|
|
1927
1917
|
};
|
|
1928
|
-
function
|
|
1918
|
+
function br(e) {
|
|
1929
1919
|
let { editor: t, from: n, to: r, text: i, rules: a, plugin: o } = e, { view: s } = t;
|
|
1930
1920
|
if (s.composing) return !1;
|
|
1931
1921
|
let c = s.state.doc.resolve(n);
|
|
1932
1922
|
if (c.parent.type.spec.code || (c.nodeBefore || c.nodeAfter)?.marks.find((e) => e.type.spec.code)) return !1;
|
|
1933
|
-
let l = !1, u =
|
|
1923
|
+
let l = !1, u = tn(c) + i;
|
|
1934
1924
|
return a.forEach((e) => {
|
|
1935
1925
|
if (l) return;
|
|
1936
|
-
let a =
|
|
1926
|
+
let a = yr(u, e.find);
|
|
1937
1927
|
if (!a) return;
|
|
1938
1928
|
let d = a[0].length - i.length;
|
|
1939
1929
|
if (d > 0) {
|
|
1940
1930
|
let e = c.parentOffset - d;
|
|
1941
1931
|
if (e < 0 || c.parent.textBetween(e, c.parentOffset) !== a[0].slice(0, d)) return;
|
|
1942
1932
|
}
|
|
1943
|
-
let f = s.state.tr, p =
|
|
1933
|
+
let f = s.state.tr, p = E({
|
|
1944
1934
|
state: s.state,
|
|
1945
1935
|
transaction: f
|
|
1946
1936
|
}), m = {
|
|
1947
1937
|
from: n - (a[0].length - i.length),
|
|
1948
1938
|
to: r
|
|
1949
|
-
}, { commands: h, chain: g, can: _ } = new
|
|
1939
|
+
}, { commands: h, chain: g, can: _ } = new D({
|
|
1950
1940
|
editor: t,
|
|
1951
1941
|
state: p
|
|
1952
1942
|
});
|
|
@@ -1957,7 +1947,7 @@ function yr(e) {
|
|
|
1957
1947
|
commands: h,
|
|
1958
1948
|
chain: g,
|
|
1959
1949
|
can: _
|
|
1960
|
-
})
|
|
1950
|
+
}) !== null && f.steps.length && (e.undoable && f.setMeta(o, {
|
|
1961
1951
|
transform: f,
|
|
1962
1952
|
from: n,
|
|
1963
1953
|
to: r,
|
|
@@ -1965,71 +1955,71 @@ function yr(e) {
|
|
|
1965
1955
|
}), s.dispatch(f), l = !0);
|
|
1966
1956
|
}), l;
|
|
1967
1957
|
}
|
|
1968
|
-
function
|
|
1969
|
-
let { editor: t, rules: n } = e,
|
|
1958
|
+
function xr(e) {
|
|
1959
|
+
let { editor: t, rules: n } = e, r = new b({
|
|
1970
1960
|
state: {
|
|
1971
1961
|
init() {
|
|
1972
1962
|
return null;
|
|
1973
1963
|
},
|
|
1974
|
-
apply(e,
|
|
1975
|
-
let
|
|
1976
|
-
if (
|
|
1977
|
-
let
|
|
1978
|
-
return
|
|
1979
|
-
let { text: e } =
|
|
1980
|
-
e = typeof e == "string" ? e :
|
|
1981
|
-
let { from:
|
|
1982
|
-
|
|
1964
|
+
apply(e, i, a) {
|
|
1965
|
+
let o = e.getMeta(r);
|
|
1966
|
+
if (o) return o;
|
|
1967
|
+
let s = e.getMeta("applyInputRules");
|
|
1968
|
+
return s && setTimeout(() => {
|
|
1969
|
+
let { text: e } = s;
|
|
1970
|
+
e = typeof e == "string" ? e : At(w.from(e), a.schema);
|
|
1971
|
+
let { from: i } = s, o = i + e.length;
|
|
1972
|
+
br({
|
|
1983
1973
|
editor: t,
|
|
1984
|
-
from:
|
|
1985
|
-
to:
|
|
1974
|
+
from: i,
|
|
1975
|
+
to: o,
|
|
1986
1976
|
text: e,
|
|
1987
1977
|
rules: n,
|
|
1988
|
-
plugin:
|
|
1978
|
+
plugin: r
|
|
1989
1979
|
});
|
|
1990
|
-
}), e.selectionSet || e.docChanged ? null :
|
|
1980
|
+
}), e.selectionSet || e.docChanged ? null : i;
|
|
1991
1981
|
}
|
|
1992
1982
|
},
|
|
1993
1983
|
props: {
|
|
1994
|
-
handleTextInput(e,
|
|
1995
|
-
return
|
|
1984
|
+
handleTextInput(e, i, a, o) {
|
|
1985
|
+
return br({
|
|
1996
1986
|
editor: t,
|
|
1997
|
-
from:
|
|
1987
|
+
from: i,
|
|
1998
1988
|
to: a,
|
|
1999
1989
|
text: o,
|
|
2000
1990
|
rules: n,
|
|
2001
|
-
plugin:
|
|
1991
|
+
plugin: r
|
|
2002
1992
|
});
|
|
2003
1993
|
},
|
|
2004
1994
|
handleDOMEvents: { compositionend: (e) => (setTimeout(() => {
|
|
2005
|
-
let { $cursor:
|
|
2006
|
-
|
|
1995
|
+
let { $cursor: i } = e.state.selection;
|
|
1996
|
+
i && br({
|
|
2007
1997
|
editor: t,
|
|
2008
|
-
from:
|
|
2009
|
-
to:
|
|
1998
|
+
from: i.pos,
|
|
1999
|
+
to: i.pos,
|
|
2010
2000
|
text: "",
|
|
2011
2001
|
rules: n,
|
|
2012
|
-
plugin:
|
|
2002
|
+
plugin: r
|
|
2013
2003
|
});
|
|
2014
2004
|
}), !1) },
|
|
2015
|
-
handleKeyDown(e,
|
|
2016
|
-
if (
|
|
2005
|
+
handleKeyDown(e, i) {
|
|
2006
|
+
if (i.key !== "Enter") return !1;
|
|
2017
2007
|
let { $cursor: a } = e.state.selection;
|
|
2018
|
-
return a ?
|
|
2008
|
+
return a ? br({
|
|
2019
2009
|
editor: t,
|
|
2020
2010
|
from: a.pos,
|
|
2021
2011
|
to: a.pos,
|
|
2022
2012
|
text: "\n",
|
|
2023
2013
|
rules: n,
|
|
2024
|
-
plugin:
|
|
2014
|
+
plugin: r
|
|
2025
2015
|
}) : !1;
|
|
2026
2016
|
}
|
|
2027
2017
|
},
|
|
2028
2018
|
isInputRules: !0
|
|
2029
2019
|
});
|
|
2030
|
-
return
|
|
2020
|
+
return r;
|
|
2031
2021
|
}
|
|
2032
|
-
var
|
|
2022
|
+
var Sr = class {
|
|
2033
2023
|
constructor(e = {}) {
|
|
2034
2024
|
this.type = "extendable", this.parent = null, this.child = null, this.name = "", this.config = { name: this.name }, this.config = {
|
|
2035
2025
|
...this.config,
|
|
@@ -2037,10 +2027,10 @@ var xr = class {
|
|
|
2037
2027
|
}, this.name = this.config.name;
|
|
2038
2028
|
}
|
|
2039
2029
|
get options() {
|
|
2040
|
-
return { ...
|
|
2030
|
+
return { ...V(z(this, "addOptions", { name: this.name })) };
|
|
2041
2031
|
}
|
|
2042
2032
|
get storage() {
|
|
2043
|
-
return { ...
|
|
2033
|
+
return { ...V(z(this, "addStorage", {
|
|
2044
2034
|
name: this.name,
|
|
2045
2035
|
options: this.options
|
|
2046
2036
|
})) };
|
|
@@ -2048,7 +2038,7 @@ var xr = class {
|
|
|
2048
2038
|
configure(e = {}) {
|
|
2049
2039
|
let t = this.extend({
|
|
2050
2040
|
...this.config,
|
|
2051
|
-
addOptions: () =>
|
|
2041
|
+
addOptions: () => _r(this.options, e)
|
|
2052
2042
|
});
|
|
2053
2043
|
return t.name = this.name, t.parent = this.parent, this.child = null, t;
|
|
2054
2044
|
}
|
|
@@ -2059,7 +2049,7 @@ var xr = class {
|
|
|
2059
2049
|
});
|
|
2060
2050
|
return t.parent = this, this.child = t, t.name = "name" in e ? e.name : t.parent.name, t;
|
|
2061
2051
|
}
|
|
2062
|
-
},
|
|
2052
|
+
}, Cr = class e extends Sr {
|
|
2063
2053
|
constructor(...e) {
|
|
2064
2054
|
super(...e), this.type = "mark";
|
|
2065
2055
|
}
|
|
@@ -2084,20 +2074,20 @@ var xr = class {
|
|
|
2084
2074
|
let t = typeof e == "function" ? e() : e;
|
|
2085
2075
|
return super.extend(t);
|
|
2086
2076
|
}
|
|
2087
|
-
},
|
|
2077
|
+
}, wr = class {
|
|
2088
2078
|
constructor(e) {
|
|
2089
2079
|
this.find = e.find, this.handler = e.handler;
|
|
2090
2080
|
}
|
|
2091
|
-
},
|
|
2092
|
-
if (
|
|
2081
|
+
}, Tr = (e, t, n) => {
|
|
2082
|
+
if (Fe(t)) return [...e.matchAll(t)];
|
|
2093
2083
|
let r = t(e, n);
|
|
2094
2084
|
return r ? r.map((t) => {
|
|
2095
2085
|
let n = [t.text];
|
|
2096
2086
|
return n.index = t.index, n.input = e, n.data = t.data, t.replaceWith && (t.text.includes(t.replaceWith) || console.warn("[tiptap warn]: \"pasteRuleMatch.replaceWith\" must be part of \"pasteRuleMatch.text\"."), n.push(t.replaceWith)), n;
|
|
2097
2087
|
}) : [];
|
|
2098
2088
|
};
|
|
2099
|
-
function
|
|
2100
|
-
let { editor: t, state: n, from: r, to: i, rule: a, pasteEvent: o, dropEvent: s } = e, { commands: c, chain: l, can: u } = new
|
|
2089
|
+
function Er(e) {
|
|
2090
|
+
let { editor: t, state: n, from: r, to: i, rule: a, pasteEvent: o, dropEvent: s } = e, { commands: c, chain: l, can: u } = new D({
|
|
2101
2091
|
editor: t,
|
|
2102
2092
|
state: n
|
|
2103
2093
|
}), d = [];
|
|
@@ -2105,7 +2095,7 @@ function Tr(e) {
|
|
|
2105
2095
|
var f;
|
|
2106
2096
|
if ((f = e.type) != null && (f = f.spec) != null && f.code || !(e.isText || e.isTextblock || e.isInline)) return;
|
|
2107
2097
|
let p = e.content?.size ?? e.nodeSize ?? 0, m = Math.max(r, t), h = Math.min(i, t + p);
|
|
2108
|
-
m >= h ||
|
|
2098
|
+
m >= h || Tr(e.isText ? e.text || "" : e.textBetween(m - t, h - t, void 0, ""), a.find, o).forEach((e) => {
|
|
2109
2099
|
if (e.index === void 0) return;
|
|
2110
2100
|
let t = m + e.index + 1, r = t + e[0].length, i = {
|
|
2111
2101
|
from: n.tr.mapping.map(t),
|
|
@@ -2124,55 +2114,55 @@ function Tr(e) {
|
|
|
2124
2114
|
});
|
|
2125
2115
|
}), d.every((e) => e !== null);
|
|
2126
2116
|
}
|
|
2127
|
-
var
|
|
2117
|
+
var Dr = null, Or = (e) => {
|
|
2128
2118
|
var t;
|
|
2129
2119
|
let n = new ClipboardEvent("paste", { clipboardData: new DataTransfer() });
|
|
2130
2120
|
return (t = n.clipboardData) == null || t.setData("text/html", e), n;
|
|
2131
2121
|
};
|
|
2132
|
-
function
|
|
2133
|
-
let { editor: t, rules: n } = e,
|
|
2122
|
+
function kr(e) {
|
|
2123
|
+
let { editor: t, rules: n } = e, r = null, i = !1, a = !1, o = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, s;
|
|
2134
2124
|
try {
|
|
2135
|
-
|
|
2125
|
+
s = typeof DragEvent < "u" ? new DragEvent("drop") : null;
|
|
2136
2126
|
} catch {
|
|
2137
|
-
|
|
2127
|
+
s = null;
|
|
2138
2128
|
}
|
|
2139
|
-
let
|
|
2140
|
-
let
|
|
2129
|
+
let c = ({ state: e, from: n, to: r, rule: i, pasteEvt: a }) => {
|
|
2130
|
+
let c = e.tr, l = E({
|
|
2141
2131
|
state: e,
|
|
2142
|
-
transaction:
|
|
2132
|
+
transaction: c
|
|
2143
2133
|
});
|
|
2144
|
-
if (
|
|
2134
|
+
if (Er({
|
|
2145
2135
|
editor: t,
|
|
2146
2136
|
state: l,
|
|
2147
2137
|
from: Math.max(n - 1, 0),
|
|
2148
2138
|
to: r.b - 1,
|
|
2149
2139
|
rule: i,
|
|
2150
2140
|
pasteEvent: a,
|
|
2151
|
-
dropEvent:
|
|
2152
|
-
})
|
|
2141
|
+
dropEvent: s
|
|
2142
|
+
}) && c.steps.length) {
|
|
2153
2143
|
try {
|
|
2154
|
-
|
|
2144
|
+
s = typeof DragEvent < "u" ? new DragEvent("drop") : null;
|
|
2155
2145
|
} catch {
|
|
2156
|
-
|
|
2146
|
+
s = null;
|
|
2157
2147
|
}
|
|
2158
|
-
return
|
|
2148
|
+
return o = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, c;
|
|
2159
2149
|
}
|
|
2160
2150
|
};
|
|
2161
|
-
return n.map((e) => new
|
|
2151
|
+
return n.map((e) => new b({
|
|
2162
2152
|
view(e) {
|
|
2163
2153
|
let n = (n) => {
|
|
2164
|
-
|
|
2165
|
-
},
|
|
2166
|
-
|
|
2154
|
+
r = e.dom.parentElement?.contains(n.target) ? e.dom.parentElement : null, r && (Dr = t);
|
|
2155
|
+
}, i = () => {
|
|
2156
|
+
Dr &&= null;
|
|
2167
2157
|
};
|
|
2168
|
-
return window.addEventListener("dragstart", n), window.addEventListener("dragend",
|
|
2169
|
-
window.removeEventListener("dragstart", n), window.removeEventListener("dragend",
|
|
2158
|
+
return window.addEventListener("dragstart", n), window.addEventListener("dragend", i), { destroy() {
|
|
2159
|
+
window.removeEventListener("dragstart", n), window.removeEventListener("dragend", i);
|
|
2170
2160
|
} };
|
|
2171
2161
|
},
|
|
2172
2162
|
props: { handleDOMEvents: {
|
|
2173
2163
|
drop: (e, t) => {
|
|
2174
|
-
if (
|
|
2175
|
-
let e =
|
|
2164
|
+
if (a = r === e.dom.parentElement, s = t, !a) {
|
|
2165
|
+
let e = Dr;
|
|
2176
2166
|
e?.isEditable && setTimeout(() => {
|
|
2177
2167
|
let t = e.state.selection;
|
|
2178
2168
|
t && e.commands.deleteRange({
|
|
@@ -2185,38 +2175,38 @@ function Or(e) {
|
|
|
2185
2175
|
},
|
|
2186
2176
|
paste: (e, t) => {
|
|
2187
2177
|
let n = t.clipboardData?.getData("text/html");
|
|
2188
|
-
return
|
|
2178
|
+
return o = t, i = !!n?.includes("data-pm-slice"), !1;
|
|
2189
2179
|
}
|
|
2190
2180
|
} },
|
|
2191
|
-
appendTransaction: (t, n,
|
|
2192
|
-
let
|
|
2193
|
-
if (!
|
|
2194
|
-
if (
|
|
2195
|
-
let { text: t } =
|
|
2196
|
-
t = typeof t == "string" ? t :
|
|
2197
|
-
let { from: n } =
|
|
2198
|
-
return
|
|
2181
|
+
appendTransaction: (t, n, r) => {
|
|
2182
|
+
let s = t[0], l = s.getMeta("uiEvent") === "paste" && !i, u = s.getMeta("uiEvent") === "drop" && !a, d = s.getMeta("applyPasteRules"), f = !!d;
|
|
2183
|
+
if (!l && !u && !f) return;
|
|
2184
|
+
if (f) {
|
|
2185
|
+
let { text: t } = d;
|
|
2186
|
+
t = typeof t == "string" ? t : At(w.from(t), r.schema);
|
|
2187
|
+
let { from: n } = d, i = n + t.length, a = Or(t);
|
|
2188
|
+
return c({
|
|
2199
2189
|
rule: e,
|
|
2200
|
-
state:
|
|
2190
|
+
state: r,
|
|
2201
2191
|
from: n,
|
|
2202
|
-
to: { b:
|
|
2203
|
-
pasteEvt:
|
|
2192
|
+
to: { b: i },
|
|
2193
|
+
pasteEvt: a
|
|
2204
2194
|
});
|
|
2205
2195
|
}
|
|
2206
|
-
let
|
|
2207
|
-
if (
|
|
2196
|
+
let p = n.doc.content.findDiffStart(r.doc.content), m = n.doc.content.findDiffEnd(r.doc.content);
|
|
2197
|
+
if (pr(p) && m && p !== m.b) return c({
|
|
2208
2198
|
rule: e,
|
|
2209
|
-
state:
|
|
2210
|
-
from:
|
|
2211
|
-
to:
|
|
2212
|
-
pasteEvt:
|
|
2199
|
+
state: r,
|
|
2200
|
+
from: p,
|
|
2201
|
+
to: m,
|
|
2202
|
+
pasteEvt: o
|
|
2213
2203
|
});
|
|
2214
2204
|
}
|
|
2215
2205
|
}));
|
|
2216
2206
|
}
|
|
2217
|
-
var
|
|
2207
|
+
var Q = class {
|
|
2218
2208
|
constructor(e, t) {
|
|
2219
|
-
this.splittableMarks = [], this.nonClearableMarks = [], this.decorationManager = null, this.editor = t, this.baseExtensions = e, this.extensions =
|
|
2209
|
+
this.splittableMarks = [], this.nonClearableMarks = [], this.decorationManager = null, this.editor = t, this.baseExtensions = e, this.extensions = Ut(e), this.schema = Vt(this.extensions, t), this.setupExtensions();
|
|
2220
2210
|
}
|
|
2221
2211
|
get commands() {
|
|
2222
2212
|
return this.extensions.reduce((e, t) => {
|
|
@@ -2225,7 +2215,7 @@ var kr = class {
|
|
|
2225
2215
|
options: t.options,
|
|
2226
2216
|
storage: this.editor.extensionStorage[t.name],
|
|
2227
2217
|
editor: this.editor,
|
|
2228
|
-
type:
|
|
2218
|
+
type: G(t.name, this.schema)
|
|
2229
2219
|
});
|
|
2230
2220
|
return n ? {
|
|
2231
2221
|
...e,
|
|
@@ -2234,15 +2224,15 @@ var kr = class {
|
|
|
2234
2224
|
}, {});
|
|
2235
2225
|
}
|
|
2236
2226
|
get plugins() {
|
|
2237
|
-
let { editor: e } = this, t =
|
|
2227
|
+
let { editor: e } = this, t = W([...this.extensions].reverse()).flatMap((t) => {
|
|
2238
2228
|
let n = {
|
|
2239
2229
|
name: t.name,
|
|
2240
2230
|
options: t.options,
|
|
2241
2231
|
storage: this.editor.extensionStorage[t.name],
|
|
2242
2232
|
editor: e,
|
|
2243
|
-
type:
|
|
2233
|
+
type: G(t.name, this.schema)
|
|
2244
2234
|
}, r = [], i = z(t, "addKeyboardShortcuts", n), a = {};
|
|
2245
|
-
if (t.type === "mark" && z(t, "exitable", n) && (a.ArrowRight = () =>
|
|
2235
|
+
if (t.type === "mark" && z(t, "exitable", n) && (a.ArrowRight = () => Cr.handleExit({
|
|
2246
2236
|
editor: e,
|
|
2247
2237
|
mark: t
|
|
2248
2238
|
})), i) {
|
|
@@ -2252,13 +2242,13 @@ var kr = class {
|
|
|
2252
2242
|
...t
|
|
2253
2243
|
};
|
|
2254
2244
|
}
|
|
2255
|
-
let o =
|
|
2245
|
+
let o = ye(a);
|
|
2256
2246
|
r.push(o);
|
|
2257
2247
|
let s = z(t, "addInputRules", n);
|
|
2258
2248
|
if (sn(t, e.options.enableInputRules) && s) {
|
|
2259
2249
|
let t = s();
|
|
2260
2250
|
if (t && t.length) {
|
|
2261
|
-
let n =
|
|
2251
|
+
let n = xr({
|
|
2262
2252
|
editor: e,
|
|
2263
2253
|
rules: t
|
|
2264
2254
|
}), i = Array.isArray(n) ? n : [n];
|
|
@@ -2269,7 +2259,7 @@ var kr = class {
|
|
|
2269
2259
|
if (sn(t, e.options.enablePasteRules) && c) {
|
|
2270
2260
|
let t = c();
|
|
2271
2261
|
if (t && t.length) {
|
|
2272
|
-
let n =
|
|
2262
|
+
let n = kr({
|
|
2273
2263
|
editor: e,
|
|
2274
2264
|
rules: t
|
|
2275
2265
|
});
|
|
@@ -2296,34 +2286,34 @@ var kr = class {
|
|
|
2296
2286
|
options: e.options,
|
|
2297
2287
|
storage: this.editor.extensionStorage[e.name],
|
|
2298
2288
|
editor: t,
|
|
2299
|
-
type:
|
|
2289
|
+
type: G(e.name, this.schema)
|
|
2300
2290
|
});
|
|
2301
2291
|
r && n.push({
|
|
2302
2292
|
name: e.name,
|
|
2303
2293
|
addDecorations: r
|
|
2304
2294
|
});
|
|
2305
|
-
}), this.decorationManager = new
|
|
2295
|
+
}), this.decorationManager = new ur({
|
|
2306
2296
|
editor: t,
|
|
2307
2297
|
entries: n
|
|
2308
2298
|
}), this.decorationManager.plugin;
|
|
2309
2299
|
}
|
|
2310
2300
|
get attributes() {
|
|
2311
|
-
return
|
|
2301
|
+
return Nt(this.extensions);
|
|
2312
2302
|
}
|
|
2313
2303
|
get nodeViews() {
|
|
2314
|
-
let { editor: e } = this, { nodeExtensions: t } =
|
|
2304
|
+
let { editor: e } = this, { nodeExtensions: t } = H(this.extensions);
|
|
2315
2305
|
return Object.fromEntries(t.filter((e) => !!z(e, "addNodeView")).map((t) => {
|
|
2316
2306
|
let n = this.attributes.filter((e) => e.type === t.name), r = z(t, "addNodeView", {
|
|
2317
2307
|
name: t.name,
|
|
2318
2308
|
options: t.options,
|
|
2319
2309
|
storage: this.editor.extensionStorage[t.name],
|
|
2320
2310
|
editor: e,
|
|
2321
|
-
type:
|
|
2311
|
+
type: O(t.name, this.schema)
|
|
2322
2312
|
});
|
|
2323
2313
|
if (!r) return [];
|
|
2324
2314
|
let i = r();
|
|
2325
2315
|
return i ? [t.name, (r, a, o, s, c) => {
|
|
2326
|
-
let l =
|
|
2316
|
+
let l = U(r, n);
|
|
2327
2317
|
return i({
|
|
2328
2318
|
node: r,
|
|
2329
2319
|
view: a,
|
|
@@ -2339,13 +2329,13 @@ var kr = class {
|
|
|
2339
2329
|
}
|
|
2340
2330
|
dispatchTransaction(e) {
|
|
2341
2331
|
let { editor: t } = this;
|
|
2342
|
-
return
|
|
2332
|
+
return W([...this.extensions].reverse()).reduceRight((e, n) => {
|
|
2343
2333
|
let r = {
|
|
2344
2334
|
name: n.name,
|
|
2345
2335
|
options: n.options,
|
|
2346
2336
|
storage: this.editor.extensionStorage[n.name],
|
|
2347
2337
|
editor: t,
|
|
2348
|
-
type:
|
|
2338
|
+
type: G(n.name, this.schema)
|
|
2349
2339
|
}, i = z(n, "dispatchTransaction", r);
|
|
2350
2340
|
return i ? (t) => {
|
|
2351
2341
|
i.call(r, {
|
|
@@ -2357,13 +2347,13 @@ var kr = class {
|
|
|
2357
2347
|
}
|
|
2358
2348
|
transformPastedHTML(e) {
|
|
2359
2349
|
let { editor: t } = this;
|
|
2360
|
-
return
|
|
2350
|
+
return W([...this.extensions]).reduce((e, n) => {
|
|
2361
2351
|
let r = {
|
|
2362
2352
|
name: n.name,
|
|
2363
2353
|
options: n.options,
|
|
2364
2354
|
storage: this.editor.extensionStorage[n.name],
|
|
2365
2355
|
editor: t,
|
|
2366
|
-
type:
|
|
2356
|
+
type: G(n.name, this.schema)
|
|
2367
2357
|
}, i = z(n, "transformPastedHTML", r);
|
|
2368
2358
|
return i ? (t, n) => {
|
|
2369
2359
|
let a = e(t, n);
|
|
@@ -2372,17 +2362,17 @@ var kr = class {
|
|
|
2372
2362
|
}, e || ((e) => e));
|
|
2373
2363
|
}
|
|
2374
2364
|
get markViews() {
|
|
2375
|
-
let { editor: e } = this, { markExtensions: t } =
|
|
2365
|
+
let { editor: e } = this, { markExtensions: t } = H(this.extensions);
|
|
2376
2366
|
return Object.fromEntries(t.filter((e) => !!z(e, "addMarkView")).map((t) => {
|
|
2377
2367
|
let n = this.attributes.filter((e) => e.type === t.name), r = z(t, "addMarkView", {
|
|
2378
2368
|
name: t.name,
|
|
2379
2369
|
options: t.options,
|
|
2380
2370
|
storage: this.editor.extensionStorage[t.name],
|
|
2381
2371
|
editor: e,
|
|
2382
|
-
type:
|
|
2372
|
+
type: A(t.name, this.schema)
|
|
2383
2373
|
});
|
|
2384
2374
|
return r ? [t.name, (i, a, o) => {
|
|
2385
|
-
let s =
|
|
2375
|
+
let s = U(i, n);
|
|
2386
2376
|
return r()({
|
|
2387
2377
|
mark: i,
|
|
2388
2378
|
view: a,
|
|
@@ -2391,7 +2381,7 @@ var kr = class {
|
|
|
2391
2381
|
extension: t,
|
|
2392
2382
|
HTMLAttributes: s,
|
|
2393
2383
|
updateAttributes: (t) => {
|
|
2394
|
-
|
|
2384
|
+
vr(i, e, t);
|
|
2395
2385
|
}
|
|
2396
2386
|
});
|
|
2397
2387
|
}] : [];
|
|
@@ -2415,16 +2405,16 @@ var kr = class {
|
|
|
2415
2405
|
options: e.options,
|
|
2416
2406
|
storage: this.editor.extensionStorage[e.name],
|
|
2417
2407
|
editor: this.editor,
|
|
2418
|
-
type:
|
|
2408
|
+
type: G(e.name, this.schema)
|
|
2419
2409
|
};
|
|
2420
|
-
e.type === "mark" && ((
|
|
2410
|
+
e.type === "mark" && ((V(z(e, "keepOnSplit", t)) ?? !0) && this.splittableMarks.push(e.name), (V(z(e, "clearable", t)) ?? !0) || this.nonClearableMarks.push(e.name));
|
|
2421
2411
|
let n = z(e, "onBeforeCreate", t), r = z(e, "onCreate", t), i = z(e, "onUpdate", t), a = z(e, "onSelectionUpdate", t), o = z(e, "onTransaction", t), s = z(e, "onFocus", t), c = z(e, "onBlur", t), l = z(e, "onDestroy", t);
|
|
2422
2412
|
n && this.editor.on("beforeCreate", n), r && this.editor.on("create", r), i && this.editor.on("update", i), a && this.editor.on("selectionUpdate", a), o && this.editor.on("transaction", o), s && this.editor.on("focus", s), c && this.editor.on("blur", c), l && this.editor.on("destroy", l);
|
|
2423
2413
|
});
|
|
2424
2414
|
}
|
|
2425
2415
|
};
|
|
2426
|
-
|
|
2427
|
-
var $ = class e extends
|
|
2416
|
+
Q.resolve = Ut, Q.sort = W, Q.flatten = B;
|
|
2417
|
+
var $ = class e extends Sr {
|
|
2428
2418
|
constructor(...e) {
|
|
2429
2419
|
super(...e), this.type = "extension";
|
|
2430
2420
|
}
|
|
@@ -2445,14 +2435,14 @@ var $ = class e extends xr {
|
|
|
2445
2435
|
return { blockSeparator: void 0 };
|
|
2446
2436
|
},
|
|
2447
2437
|
addProseMirrorPlugins() {
|
|
2448
|
-
return [new
|
|
2449
|
-
key: new
|
|
2438
|
+
return [new b({
|
|
2439
|
+
key: new x("clipboardTextSerializer"),
|
|
2450
2440
|
props: { clipboardTextSerializer: () => {
|
|
2451
|
-
let { editor: e } = this, { state: t, schema: n } = e, { doc: r, selection: i } = t, a =
|
|
2441
|
+
let { editor: e } = this, { state: t, schema: n } = e, { doc: r, selection: i } = t, a = Kt(n), { blockSeparator: o } = this.options, s = {
|
|
2452
2442
|
...o === void 0 ? {} : { blockSeparator: o },
|
|
2453
2443
|
textSerializers: a
|
|
2454
2444
|
};
|
|
2455
|
-
return [...i.ranges].sort((e, t) => e.$from.pos - t.$from.pos).map(({ $from: e, $to: t }) =>
|
|
2445
|
+
return [...i.ranges].sort((e, t) => e.$from.pos - t.$from.pos).map(({ $from: e, $to: t }) => Wt(r, {
|
|
2456
2446
|
from: e.pos,
|
|
2457
2447
|
to: t.pos
|
|
2458
2448
|
}, s)).join(o ?? "\n\n");
|
|
@@ -2462,67 +2452,67 @@ var $ = class e extends xr {
|
|
|
2462
2452
|
}), jr = $.create({
|
|
2463
2453
|
name: "commands",
|
|
2464
2454
|
addCommands() {
|
|
2465
|
-
return { ...
|
|
2455
|
+
return { ...Vn };
|
|
2466
2456
|
}
|
|
2467
2457
|
}), Mr = $.create({
|
|
2468
2458
|
name: "delete",
|
|
2469
|
-
onUpdate({ transaction: e, appendedTransactions:
|
|
2470
|
-
var
|
|
2471
|
-
let
|
|
2472
|
-
var
|
|
2473
|
-
if (((
|
|
2474
|
-
let
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
let
|
|
2459
|
+
onUpdate({ transaction: e, appendedTransactions: n }) {
|
|
2460
|
+
var r;
|
|
2461
|
+
let i = () => {
|
|
2462
|
+
var r, i;
|
|
2463
|
+
if (((r = this.editor.options.coreExtensionOptions) == null || (r = r.delete) == null || (i = r.filterTransaction) == null ? void 0 : i.call(r, e)) ?? e.getMeta("y-sync$")) return;
|
|
2464
|
+
let a = Dt(e.before, [e, ...n]);
|
|
2465
|
+
Zt(a).forEach((t) => {
|
|
2466
|
+
a.mapping.mapResult(t.oldRange.from).deletedAfter && a.mapping.mapResult(t.oldRange.to).deletedBefore && a.before.nodesBetween(t.oldRange.from, t.oldRange.to, (n, r) => {
|
|
2467
|
+
let i = r + n.nodeSize - 2, o = t.oldRange.from <= r && i <= t.oldRange.to;
|
|
2478
2468
|
this.editor.emit("delete", {
|
|
2479
2469
|
type: "node",
|
|
2480
2470
|
node: n,
|
|
2481
2471
|
from: r,
|
|
2482
|
-
to:
|
|
2483
|
-
newFrom:
|
|
2484
|
-
newTo:
|
|
2472
|
+
to: i,
|
|
2473
|
+
newFrom: a.mapping.map(r),
|
|
2474
|
+
newTo: a.mapping.map(i),
|
|
2485
2475
|
deletedRange: t.oldRange,
|
|
2486
2476
|
newRange: t.newRange,
|
|
2487
2477
|
partial: !o,
|
|
2488
2478
|
editor: this.editor,
|
|
2489
2479
|
transaction: e,
|
|
2490
|
-
combinedTransform:
|
|
2480
|
+
combinedTransform: a
|
|
2491
2481
|
});
|
|
2492
2482
|
});
|
|
2493
2483
|
});
|
|
2494
|
-
let
|
|
2495
|
-
|
|
2496
|
-
if (
|
|
2497
|
-
let
|
|
2484
|
+
let o = a.mapping;
|
|
2485
|
+
a.steps.forEach((n, r) => {
|
|
2486
|
+
if (n instanceof t) {
|
|
2487
|
+
let t = o.slice(r).map(n.from, -1), i = o.slice(r).map(n.to), s = o.invert().map(t, -1), c = o.invert().map(i), l = t > 0 && a.doc.nodeAt(t - 1)?.marks.some((e) => e.eq(n.mark)), u = a.doc.nodeAt(i)?.marks.some((e) => e.eq(n.mark));
|
|
2498
2488
|
this.editor.emit("delete", {
|
|
2499
2489
|
type: "mark",
|
|
2500
|
-
mark:
|
|
2501
|
-
from:
|
|
2502
|
-
to:
|
|
2490
|
+
mark: n.mark,
|
|
2491
|
+
from: n.from,
|
|
2492
|
+
to: n.to,
|
|
2503
2493
|
deletedRange: {
|
|
2504
2494
|
from: s,
|
|
2505
2495
|
to: c
|
|
2506
2496
|
},
|
|
2507
2497
|
newRange: {
|
|
2508
|
-
from:
|
|
2509
|
-
to:
|
|
2498
|
+
from: t,
|
|
2499
|
+
to: i
|
|
2510
2500
|
},
|
|
2511
2501
|
partial: !!(u || l),
|
|
2512
2502
|
editor: this.editor,
|
|
2513
2503
|
transaction: e,
|
|
2514
|
-
combinedTransform:
|
|
2504
|
+
combinedTransform: a
|
|
2515
2505
|
});
|
|
2516
2506
|
}
|
|
2517
2507
|
});
|
|
2518
2508
|
};
|
|
2519
|
-
((
|
|
2509
|
+
((r = this.editor.options.coreExtensionOptions) == null || (r = r.delete) == null ? void 0 : r.async) ?? !0 ? setTimeout(i, 0) : i();
|
|
2520
2510
|
}
|
|
2521
2511
|
}), Nr = $.create({
|
|
2522
2512
|
name: "drop",
|
|
2523
2513
|
addProseMirrorPlugins() {
|
|
2524
|
-
return [new
|
|
2525
|
-
key: new
|
|
2514
|
+
return [new b({
|
|
2515
|
+
key: new x("tiptapDrop"),
|
|
2526
2516
|
props: { handleDrop: (e, t, n, r) => {
|
|
2527
2517
|
this.editor.emit("drop", {
|
|
2528
2518
|
editor: this.editor,
|
|
@@ -2536,16 +2526,16 @@ var $ = class e extends xr {
|
|
|
2536
2526
|
}), Pr = $.create({
|
|
2537
2527
|
name: "editable",
|
|
2538
2528
|
addProseMirrorPlugins() {
|
|
2539
|
-
return [new
|
|
2540
|
-
key: new
|
|
2529
|
+
return [new b({
|
|
2530
|
+
key: new x("editable"),
|
|
2541
2531
|
props: { editable: () => this.editor.options.editable }
|
|
2542
2532
|
})];
|
|
2543
2533
|
}
|
|
2544
|
-
}), Fr = new
|
|
2534
|
+
}), Fr = new x("focusEvents"), Ir = $.create({
|
|
2545
2535
|
name: "focusEvents",
|
|
2546
2536
|
addProseMirrorPlugins() {
|
|
2547
2537
|
let { editor: e } = this;
|
|
2548
|
-
return [new
|
|
2538
|
+
return [new b({
|
|
2549
2539
|
key: Fr,
|
|
2550
2540
|
props: { handleDOMEvents: {
|
|
2551
2541
|
focus: (t, n) => {
|
|
@@ -2567,7 +2557,7 @@ var $ = class e extends xr {
|
|
|
2567
2557
|
let e = () => this.editor.commands.first(({ commands: e }) => [
|
|
2568
2558
|
() => e.undoInputRule(),
|
|
2569
2559
|
() => e.command(({ tr: t }) => {
|
|
2570
|
-
let { selection: n, doc: r } = t, { empty: i, $anchor: a } = n, { pos: o, parent: s } = a, c = a.parent.isTextblock && o > 0 ? t.doc.resolve(o - 1) : a, l = c.parent.type.spec.isolating, u = a.pos - a.parentOffset, d = l && c.parent.childCount === 1 ? u === a.pos :
|
|
2560
|
+
let { selection: n, doc: r } = t, { empty: i, $anchor: a } = n, { pos: o, parent: s } = a, c = a.parent.isTextblock && o > 0 ? t.doc.resolve(o - 1) : a, l = c.parent.type.spec.isolating, u = a.pos - a.parentOffset, d = l && c.parent.childCount === 1 ? u === a.pos : S.atStart(r).from === o;
|
|
2571
2561
|
return !i || !s.type.isTextblock || s.textContent.length || !d || d && a.parent.type.name === "paragraph" ? !1 : e.clearNodes();
|
|
2572
2562
|
}),
|
|
2573
2563
|
() => e.deleteSelection(),
|
|
@@ -2606,18 +2596,18 @@ var $ = class e extends xr {
|
|
|
2606
2596
|
return M() || lt() ? i : r;
|
|
2607
2597
|
},
|
|
2608
2598
|
addProseMirrorPlugins() {
|
|
2609
|
-
return [new
|
|
2610
|
-
key: new
|
|
2599
|
+
return [new b({
|
|
2600
|
+
key: new x("clearDocument"),
|
|
2611
2601
|
appendTransaction: (e, t, n) => {
|
|
2612
2602
|
if (e.some((e) => e.getMeta("composition"))) return;
|
|
2613
2603
|
let r = e.some((e) => e.docChanged) && !t.doc.eq(n.doc), i = e.some((e) => e.getMeta("preventClearDocument"));
|
|
2614
2604
|
if (!r || i) return;
|
|
2615
|
-
let { empty: a, from: o, to: s } = t.selection, c =
|
|
2616
|
-
if (a || o !== c || s !== l || !
|
|
2617
|
-
let u = n.tr, d =
|
|
2605
|
+
let { empty: a, from: o, to: s } = t.selection, c = S.atStart(t.doc).from, l = S.atEnd(t.doc).to;
|
|
2606
|
+
if (a || o !== c || s !== l || !cn(n.doc)) return;
|
|
2607
|
+
let u = n.tr, d = E({
|
|
2618
2608
|
state: n,
|
|
2619
2609
|
transaction: u
|
|
2620
|
-
}), { commands: f } = new
|
|
2610
|
+
}), { commands: f } = new D({
|
|
2621
2611
|
editor: this.editor,
|
|
2622
2612
|
state: d
|
|
2623
2613
|
});
|
|
@@ -2628,8 +2618,8 @@ var $ = class e extends xr {
|
|
|
2628
2618
|
}), Rr = $.create({
|
|
2629
2619
|
name: "paste",
|
|
2630
2620
|
addProseMirrorPlugins() {
|
|
2631
|
-
return [new
|
|
2632
|
-
key: new
|
|
2621
|
+
return [new b({
|
|
2622
|
+
key: new x("tiptapPaste"),
|
|
2633
2623
|
props: { handlePaste: (e, t, n) => {
|
|
2634
2624
|
this.editor.emit("paste", {
|
|
2635
2625
|
editor: this.editor,
|
|
@@ -2645,8 +2635,8 @@ var $ = class e extends xr {
|
|
|
2645
2635
|
return { value: void 0 };
|
|
2646
2636
|
},
|
|
2647
2637
|
addProseMirrorPlugins() {
|
|
2648
|
-
return [new
|
|
2649
|
-
key: new
|
|
2638
|
+
return [new b({
|
|
2639
|
+
key: new x("tabindex"),
|
|
2650
2640
|
props: { attributes: () => !this.editor.isEditable && this.options.value === void 0 ? {} : { tabindex: this.options.value ?? "0" } }
|
|
2651
2641
|
})];
|
|
2652
2642
|
}
|
|
@@ -2657,7 +2647,7 @@ var $ = class e extends xr {
|
|
|
2657
2647
|
},
|
|
2658
2648
|
addGlobalAttributes() {
|
|
2659
2649
|
if (!this.options.direction) return [];
|
|
2660
|
-
let { nodeExtensions: e } =
|
|
2650
|
+
let { nodeExtensions: e } = H(this.extensions);
|
|
2661
2651
|
return [{
|
|
2662
2652
|
types: e.filter((e) => e.name !== "text").map((e) => e.name),
|
|
2663
2653
|
attributes: { dir: {
|
|
@@ -2671,8 +2661,8 @@ var $ = class e extends xr {
|
|
|
2671
2661
|
}];
|
|
2672
2662
|
},
|
|
2673
2663
|
addProseMirrorPlugins() {
|
|
2674
|
-
return [new
|
|
2675
|
-
key: new
|
|
2664
|
+
return [new b({
|
|
2665
|
+
key: new x("textDirection"),
|
|
2676
2666
|
props: { attributes: () => {
|
|
2677
2667
|
let e = this.options.direction;
|
|
2678
2668
|
return e ? { dir: e } : {};
|
|
@@ -2685,14 +2675,14 @@ function Hr(e) {
|
|
|
2685
2675
|
Vr = !0;
|
|
2686
2676
|
let t;
|
|
2687
2677
|
try {
|
|
2688
|
-
t =
|
|
2678
|
+
t = r.fromJSON(e, {
|
|
2689
2679
|
from: 0,
|
|
2690
2680
|
to: 0
|
|
2691
2681
|
}).slice.content;
|
|
2692
2682
|
} catch {
|
|
2693
2683
|
return;
|
|
2694
2684
|
}
|
|
2695
|
-
t instanceof
|
|
2685
|
+
t instanceof w || console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.");
|
|
2696
2686
|
}
|
|
2697
2687
|
var Ur = class e {
|
|
2698
2688
|
get name() {
|
|
@@ -2806,7 +2796,7 @@ var Ur = class e {
|
|
|
2806
2796
|
if (!this.children || this.children.length === 0) return r;
|
|
2807
2797
|
let i = Object.keys(t);
|
|
2808
2798
|
return this.children.forEach((a) => {
|
|
2809
|
-
n && r.length > 0 || (a.node.type.name === e && i.every((e) => t[e] === a.node.attrs[e]) && r.push(a),
|
|
2799
|
+
n && r.length > 0 || (a.node.type.name === e && i.every((e) => t[e] === a.node.attrs[e]) && r.push(a), n && r.length > 0 || (r = r.concat(a.querySelectorAll(e, t, n))));
|
|
2810
2800
|
}), r;
|
|
2811
2801
|
}
|
|
2812
2802
|
setAttribute(e) {
|
|
@@ -2816,7 +2806,7 @@ var Ur = class e {
|
|
|
2816
2806
|
...e
|
|
2817
2807
|
}), this.editor.view.dispatch(t);
|
|
2818
2808
|
}
|
|
2819
|
-
}, Wr = ".ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: \"liga\" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable=\"false\"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable=\"false\"] [contenteditable=\"true\"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}", Gr = class extends
|
|
2809
|
+
}, Wr = ".ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: \"liga\" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable=\"false\"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable=\"false\"] [contenteditable=\"true\"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}", Gr = class extends Wn {
|
|
2820
2810
|
constructor(e = {}) {
|
|
2821
2811
|
super(), this.css = null, this.className = "tiptap", this.editorView = null, this.isFocused = !1, this.destroyed = !1, this.isInitialized = !1, this.extensionStorage = {}, this.instanceId = Math.random().toString(36).slice(2, 9), this.hasWarnedStaleDecorationRead = !1, this.options = {
|
|
2822
2812
|
element: typeof document < "u" ? document.createElement("div") : null,
|
|
@@ -2853,13 +2843,13 @@ var Ur = class e {
|
|
|
2853
2843
|
onDelete: () => null,
|
|
2854
2844
|
enableExtensionDispatchTransaction: !0
|
|
2855
2845
|
}, this.isCapturingTransaction = !1, this.capturedTransaction = null, this.utils = {
|
|
2856
|
-
getUpdatedPosition:
|
|
2857
|
-
createMappablePosition:
|
|
2846
|
+
getUpdatedPosition: dn,
|
|
2847
|
+
createMappablePosition: fn
|
|
2858
2848
|
}, this.setOptions(e), this.createExtensionManager(), this.createCommandManager(), this.createSchema(), this.on("beforeCreate", this.options.onBeforeCreate), this.emit("beforeCreate", { editor: this }), this.on("mount", this.options.onMount), this.on("unmount", this.options.onUnmount), this.on("contentError", this.options.onContentError), this.on("create", this.options.onCreate), this.on("update", this.options.onUpdate), this.on("selectionUpdate", this.options.onSelectionUpdate), this.on("transaction", this.options.onTransaction), this.on("focus", this.options.onFocus), this.on("blur", this.options.onBlur), this.on("destroy", this.options.onDestroy), this.on("drop", ({ event: e, slice: t, moved: n }) => this.options.onDrop(e, t, n)), this.on("paste", ({ event: e, slice: t }) => this.options.onPaste(e, t)), this.on("delete", this.options.onDelete);
|
|
2859
2849
|
let t = this.createDoc();
|
|
2860
2850
|
if (!this.editorState) {
|
|
2861
|
-
let e =
|
|
2862
|
-
this.editorState =
|
|
2851
|
+
let e = He(t, this.options.autofocus);
|
|
2852
|
+
this.editorState = le.create({
|
|
2863
2853
|
doc: t,
|
|
2864
2854
|
schema: this.schema,
|
|
2865
2855
|
selection: e || void 0
|
|
@@ -2893,19 +2883,19 @@ var Ur = class e {
|
|
|
2893
2883
|
return this.commandManager.commands;
|
|
2894
2884
|
}
|
|
2895
2885
|
chain() {
|
|
2896
|
-
return this.commandManager ? this.commandManager.chain() :
|
|
2886
|
+
return this.commandManager ? this.commandManager.chain() : D.createFakeChain();
|
|
2897
2887
|
}
|
|
2898
2888
|
can() {
|
|
2899
|
-
return this.commandManager ? this.commandManager.can() :
|
|
2889
|
+
return this.commandManager ? this.commandManager.can() : D.createFallbackCan();
|
|
2900
2890
|
}
|
|
2901
2891
|
injectCSS() {
|
|
2902
|
-
this.options.injectCSS && typeof document < "u" && (this.css =
|
|
2892
|
+
this.options.injectCSS && typeof document < "u" && (this.css = fr(Wr, this.options.injectNonce));
|
|
2903
2893
|
}
|
|
2904
2894
|
setOptions(e = {}) {
|
|
2905
2895
|
this.options = {
|
|
2906
2896
|
...this.options,
|
|
2907
2897
|
...e
|
|
2908
|
-
},
|
|
2898
|
+
}, this.editorView && this.state && !this.isDestroyed && (this.options.editorProps && this.view.setProps(this.options.editorProps), this.view.updateState(this.state));
|
|
2909
2899
|
}
|
|
2910
2900
|
setEditable(e, t = !0) {
|
|
2911
2901
|
this.setOptions({ editable: e }), t && this.emit("update", {
|
|
@@ -2938,10 +2928,10 @@ var Ur = class e {
|
|
|
2938
2928
|
} });
|
|
2939
2929
|
}
|
|
2940
2930
|
get state() {
|
|
2941
|
-
return
|
|
2931
|
+
return Gn && !this.hasWarnedStaleDecorationRead && Un(this) && (this.hasWarnedStaleDecorationRead = !0, console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")), this.editorView && (this.editorState = this.view.state), this.editorState;
|
|
2942
2932
|
}
|
|
2943
2933
|
registerPlugin(e, t) {
|
|
2944
|
-
let n =
|
|
2934
|
+
let n = jt(t) ? t(e, [...this.state.plugins]) : [...this.state.plugins, e], r = this.state.reconfigure({ plugins: n });
|
|
2945
2935
|
return this.view.updateState(r), r;
|
|
2946
2936
|
}
|
|
2947
2937
|
unregisterPlugin(e) {
|
|
@@ -2972,10 +2962,10 @@ var Ur = class e {
|
|
|
2972
2962
|
"node",
|
|
2973
2963
|
"mark"
|
|
2974
2964
|
].includes(e?.type));
|
|
2975
|
-
this.extensionManager = new
|
|
2965
|
+
this.extensionManager = new Q(n, this);
|
|
2976
2966
|
}
|
|
2977
2967
|
createCommandManager() {
|
|
2978
|
-
this.commandManager = new
|
|
2968
|
+
this.commandManager = new D({ editor: this });
|
|
2979
2969
|
}
|
|
2980
2970
|
createSchema() {
|
|
2981
2971
|
this.schema = this.extensionManager.schema;
|
|
@@ -2987,10 +2977,10 @@ var Ur = class e {
|
|
|
2987
2977
|
} catch (e) {
|
|
2988
2978
|
if (!(e instanceof Error) || !["[tiptap error]: Invalid JSON content", "[tiptap error]: Invalid HTML content"].includes(e.message)) throw e;
|
|
2989
2979
|
let t = L(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
|
|
2990
|
-
return this.editorState =
|
|
2980
|
+
return this.editorState = le.create({
|
|
2991
2981
|
doc: t,
|
|
2992
2982
|
schema: this.schema,
|
|
2993
|
-
selection:
|
|
2983
|
+
selection: He(t, this.options.autofocus) || void 0
|
|
2994
2984
|
}), this.emit("contentError", {
|
|
2995
2985
|
editor: this,
|
|
2996
2986
|
error: e,
|
|
@@ -3003,7 +2993,7 @@ var Ur = class e {
|
|
|
3003
2993
|
}
|
|
3004
2994
|
createView(e) {
|
|
3005
2995
|
let { editorProps: t, enableExtensionDispatchTransaction: n } = this.options, r = t.dispatchTransaction || this.dispatchTransaction.bind(this), i = n ? this.extensionManager.dispatchTransaction(r) : r, a = t.transformPastedHTML, o = this.extensionManager.transformPastedHTML(a);
|
|
3006
|
-
this.editorView = new
|
|
2996
|
+
this.editorView = new ve(e, {
|
|
3007
2997
|
...t,
|
|
3008
2998
|
attributes: {
|
|
3009
2999
|
role: "textbox",
|
|
@@ -3067,14 +3057,14 @@ var Ur = class e {
|
|
|
3067
3057
|
editor: this,
|
|
3068
3058
|
event: c.event,
|
|
3069
3059
|
transaction: o
|
|
3070
|
-
}),
|
|
3060
|
+
}), e.getMeta("preventUpdate") || !n.some((e) => e.docChanged) || a.doc.eq(t.doc) || this.emit("update", {
|
|
3071
3061
|
editor: this,
|
|
3072
3062
|
transaction: e,
|
|
3073
3063
|
appendedTransactions: n.slice(1)
|
|
3074
3064
|
});
|
|
3075
3065
|
}
|
|
3076
3066
|
getAttributes(e) {
|
|
3077
|
-
return
|
|
3067
|
+
return Jt(this.state, e);
|
|
3078
3068
|
}
|
|
3079
3069
|
isActive(e, t) {
|
|
3080
3070
|
let n = typeof e == "string" ? e : null, r = typeof e == "string" ? t : e;
|
|
@@ -3084,20 +3074,20 @@ var Ur = class e {
|
|
|
3084
3074
|
return this.state.doc.toJSON();
|
|
3085
3075
|
}
|
|
3086
3076
|
getHTML() {
|
|
3087
|
-
return
|
|
3077
|
+
return At(this.state.doc.content, this.schema);
|
|
3088
3078
|
}
|
|
3089
3079
|
getText(e) {
|
|
3090
3080
|
let { blockSeparator: t = "\n\n", textSerializers: n = {} } = e || {};
|
|
3091
|
-
return
|
|
3081
|
+
return Gt(this.state.doc, {
|
|
3092
3082
|
blockSeparator: t,
|
|
3093
3083
|
textSerializers: {
|
|
3094
|
-
...
|
|
3084
|
+
...Kt(this.schema),
|
|
3095
3085
|
...n
|
|
3096
3086
|
}
|
|
3097
3087
|
});
|
|
3098
3088
|
}
|
|
3099
3089
|
get isEmpty() {
|
|
3100
|
-
return
|
|
3090
|
+
return cn(this.state.doc);
|
|
3101
3091
|
}
|
|
3102
3092
|
destroy() {
|
|
3103
3093
|
this.destroyed || (this.destroyed = !0, this.emit("destroy"), this.unmount(), this.removeAllListeners(), this.extensionManager.destroy(), this.extensionManager = null, this.schema = null, this.commandManager = null, this.extensionStorage = {});
|
|
@@ -3120,15 +3110,15 @@ var Ur = class e {
|
|
|
3120
3110
|
}
|
|
3121
3111
|
};
|
|
3122
3112
|
function Kr(e) {
|
|
3123
|
-
return new
|
|
3113
|
+
return new Z({
|
|
3124
3114
|
find: e.find,
|
|
3125
3115
|
handler: ({ state: t, range: n, match: r }) => {
|
|
3126
|
-
let i =
|
|
3116
|
+
let i = V(e.getAttributes, void 0, r);
|
|
3127
3117
|
if (i === !1 || i === null) return null;
|
|
3128
3118
|
let { tr: a } = t, o = r[r.length - 1], s = r[0];
|
|
3129
3119
|
if (o) {
|
|
3130
3120
|
let r = s.search(/\S/), c = n.from + s.indexOf(o), l = c + o.length;
|
|
3131
|
-
if (
|
|
3121
|
+
if (Qt(n.from, n.to, t.doc).filter((t) => t.mark.type.excluded.find((n) => n === e.type && n !== t.mark.type)).filter((e) => e.to > c).length) return null;
|
|
3132
3122
|
l < n.to && a.delete(l, n.to), c > n.from && a.delete(n.from + r, c);
|
|
3133
3123
|
let u = n.from + r + o.length;
|
|
3134
3124
|
a.addMark(n.from + r, u, e.type.create(i || {})), a.removeStoredMark(e.type);
|
|
@@ -3138,10 +3128,10 @@ function Kr(e) {
|
|
|
3138
3128
|
});
|
|
3139
3129
|
}
|
|
3140
3130
|
function qr(e) {
|
|
3141
|
-
return new
|
|
3131
|
+
return new Z({
|
|
3142
3132
|
find: e.find,
|
|
3143
3133
|
handler: ({ state: t, range: n, match: r }) => {
|
|
3144
|
-
let i =
|
|
3134
|
+
let i = V(e.getAttributes, void 0, r) || {}, { tr: a } = t, o = n.from, s = n.to, c = e.type.create(i);
|
|
3145
3135
|
if (r[1]) {
|
|
3146
3136
|
let e = o + r[0].lastIndexOf(r[1]);
|
|
3147
3137
|
e > s ? e = s : s = e + r[1].length;
|
|
@@ -3157,10 +3147,10 @@ function qr(e) {
|
|
|
3157
3147
|
});
|
|
3158
3148
|
}
|
|
3159
3149
|
function Jr(e) {
|
|
3160
|
-
return new
|
|
3150
|
+
return new Z({
|
|
3161
3151
|
find: e.find,
|
|
3162
3152
|
handler: ({ state: t, range: n, match: r }) => {
|
|
3163
|
-
let i = t.doc.resolve(n.from), a =
|
|
3153
|
+
let i = t.doc.resolve(n.from), a = V(e.getAttributes, void 0, r) || {};
|
|
3164
3154
|
if (!i.node(-1).canReplaceWith(i.index(-1), i.indexAfter(-1), e.type)) return null;
|
|
3165
3155
|
t.tr.delete(n.from, n.to).setBlockType(n.from, n.from, e.type, a);
|
|
3166
3156
|
},
|
|
@@ -3168,29 +3158,29 @@ function Jr(e) {
|
|
|
3168
3158
|
});
|
|
3169
3159
|
}
|
|
3170
3160
|
function Yr(e) {
|
|
3171
|
-
return new
|
|
3161
|
+
return new Z({
|
|
3172
3162
|
find: e.find,
|
|
3173
3163
|
handler: ({ state: t, range: n, match: r, chain: i }) => {
|
|
3174
|
-
let
|
|
3175
|
-
if (!
|
|
3176
|
-
if (
|
|
3164
|
+
let o = V(e.getAttributes, void 0, r) || {}, c = t.tr.delete(n.from, n.to), l = c.doc.resolve(n.from).blockRange(), u = l && s(l, e.type, o);
|
|
3165
|
+
if (!u) return null;
|
|
3166
|
+
if (c.wrap(l, u), e.keepMarks && e.editor) {
|
|
3177
3167
|
let { selection: n, storedMarks: r } = t, { splittableMarks: i } = e.editor.extensionManager, a = r || n.$to.parentOffset && n.$from.marks();
|
|
3178
3168
|
if (a) {
|
|
3179
3169
|
let e = a.filter((e) => i.includes(e.type.name));
|
|
3180
|
-
|
|
3170
|
+
c.ensureMarks(e);
|
|
3181
3171
|
}
|
|
3182
3172
|
}
|
|
3183
3173
|
if (e.keepAttributes) {
|
|
3184
3174
|
let t = e.type.name === "bulletList" || e.type.name === "orderedList" ? "listItem" : "taskList";
|
|
3185
|
-
i().updateAttributes(t,
|
|
3175
|
+
i().updateAttributes(t, o).run();
|
|
3186
3176
|
}
|
|
3187
|
-
let
|
|
3188
|
-
|
|
3177
|
+
let d = c.doc.resolve(n.from - 1).nodeBefore;
|
|
3178
|
+
d && d.type === e.type && a(c.doc, n.from - 1) && (!e.joinPredicate || e.joinPredicate(r, d)) && c.join(n.from - 1);
|
|
3189
3179
|
},
|
|
3190
3180
|
undoable: e.undoable
|
|
3191
3181
|
});
|
|
3192
3182
|
}
|
|
3193
|
-
var Xr = class e extends
|
|
3183
|
+
var Xr = class e extends Sr {
|
|
3194
3184
|
constructor(...e) {
|
|
3195
3185
|
super(...e), this.type = "node";
|
|
3196
3186
|
}
|
|
@@ -3207,21 +3197,20 @@ var Xr = class e extends xr {
|
|
|
3207
3197
|
}
|
|
3208
3198
|
};
|
|
3209
3199
|
function Zr(e) {
|
|
3210
|
-
return new
|
|
3200
|
+
return new wr({
|
|
3211
3201
|
find: e.find,
|
|
3212
3202
|
handler: ({ state: t, range: n, match: r, pasteEvent: i }) => {
|
|
3213
|
-
let a =
|
|
3203
|
+
let a = V(e.getAttributes, void 0, r, i);
|
|
3214
3204
|
if (a === !1 || a === null) return null;
|
|
3215
3205
|
let { tr: o } = t, s = r[r.length - 1], c = r[0], l = n.to;
|
|
3216
3206
|
if (s) {
|
|
3217
3207
|
let i = c.search(/\S/), u = n.from + c.indexOf(s), d = u + s.length;
|
|
3218
|
-
if (
|
|
3208
|
+
if (Qt(n.from, n.to, t.doc).filter((t) => t.mark.type.excluded.find((n) => n === e.type && n !== t.mark.type)).filter((e) => e.to > u).length) return null;
|
|
3219
3209
|
d < n.to && o.delete(d, n.to), u > n.from && o.delete(n.from + i, u), l = n.from + i + s.length, o.addMark(n.from + i, l, e.type.create(a || {})), r.index !== void 0 && r.input !== void 0 && r.index + r[0].length >= r.input.length || o.removeStoredMark(e.type);
|
|
3220
3210
|
}
|
|
3221
3211
|
}
|
|
3222
3212
|
});
|
|
3223
3213
|
}
|
|
3224
|
-
|
|
3225
|
-
export { T as CommandManager, Y as DECORATION_MANAGER_PLUGIN_KEY, lr as DecorationManager, Gr as Editor, xr as Extendable, $ as Extension, Q as InputRule, ln as MappablePosition, Sr as Mark, Xr as Node, Ur as NodePos, Cr as PasteRule, B as callOrReturn, ur as canInsertNode, Dt as combineTransactionSteps, Bn as commands, w as createChainableState, L as createDocument, dn as createMappablePosition, P as createNodeFromContent, dr as createStyleTag, $e as defaultBlockAt, gt as deleteProps, N as elementFromString, Ot as findChildrenInRange, Ut as findDuplicates, R as findParentNode, kt as findParentNodeClosestToPos, At as flattenExtensions, Rt as fromString, Yt as getAttributes, Pt as getAttributesFromExtensions, Qt as getChangedRanges, z as getExtensionField, jt as getHTMLFromFragment, Et as getMarkAttributes, O as getMarkRange, k as getMarkType, $t as getMarksBetween, en as getNodeAtPosition, Jt as getNodeAttributes, E as getNodeType, tn as getPreviousBlockSibling, H as getRenderedAttributes, Ht as getSchemaByResolvedExtensions, W as getSchemaTypeByName, I as getSchemaTypeNameByName, G as getSplittedAttributes, Kt as getText, Gt as getTextBetween, nn as getTextContentFromNodes, qt as getTextSerializersFromSchema, un as getUpdatedPosition, zt as injectExtensionAttributesToParseRule, br as inputRulesPlugin, rn as isActive, Ue as isAndroid, an as isAtEndOfNode, on as isAtStartOfNode, Nt as isEmptyObject, sn as isExtensionRulesEnabled, Mt as isFunction, q as isList, lt as isMacOS, K as isMarkActive, F as isNodeActive, J as isNodeEmpty, cn as isNodeSelection, fr as isNumber, Z as isPlainObject, Le as isRegExp, We as isSafari, He as isTextSelection, M as isiOS, Kr as markInputRule, Zr as markPasteRule, Lt as mergeAttributes, gr as mergeDeep, A as minMax, qr as nodeInputRule, D as objectIncludes, mr as parseIndentedBlocks, Or as pasteRulesPlugin, Xt as removeDuplicates, hr as renderNestedMarkdownContent, Wt as resolveExtensions, j as resolveFocusPosition, Ze as selectionToInsertionEnd, U as sortExtensions, V as splitExtensions, Jr as textblockTypeInputRule, _r as updateMarkViewAttributes, Yr as wrappingInputRule };
|
|
3214
|
+
export { D as CommandManager, J as DECORATION_MANAGER_PLUGIN_KEY, ur as DecorationManager, Gr as Editor, Sr as Extendable, $ as Extension, Z as InputRule, un as MappablePosition, Cr as Mark, Xr as Node, Ur as NodePos, wr as PasteRule, V as callOrReturn, dr as canInsertNode, Dt as combineTransactionSteps, Vn as commands, E as createChainableState, L as createDocument, fn as createMappablePosition, P as createNodeFromContent, fr as createStyleTag, $e as defaultBlockAt, gt as deleteProps, N as elementFromString, Ot as findChildrenInRange, Ht as findDuplicates, R as findParentNode, kt as findParentNodeClosestToPos, B as flattenExtensions, Lt as fromString, Jt as getAttributes, Nt as getAttributesFromExtensions, Zt as getChangedRanges, z as getExtensionField, At as getHTMLFromFragment, Et as getMarkAttributes, Re as getMarkRange, A as getMarkType, Qt as getMarksBetween, $t as getNodeAtPosition, qt as getNodeAttributes, O as getNodeType, en as getPreviousBlockSibling, U as getRenderedAttributes, Vt as getSchemaByResolvedExtensions, G as getSchemaTypeByName, I as getSchemaTypeNameByName, K as getSplittedAttributes, Gt as getText, Wt as getTextBetween, tn as getTextContentFromNodes, Kt as getTextSerializersFromSchema, dn as getUpdatedPosition, Rt as injectExtensionAttributesToParseRule, xr as inputRulesPlugin, rn as isActive, Ue as isAndroid, an as isAtEndOfNode, on as isAtStartOfNode, Mt as isEmptyObject, sn as isExtensionRulesEnabled, jt as isFunction, q as isList, lt as isMacOS, nn as isMarkActive, F as isNodeActive, cn as isNodeEmpty, ln as isNodeSelection, pr as isNumber, X as isPlainObject, Fe as isRegExp, We as isSafari, Ve as isTextSelection, M as isiOS, Kr as markInputRule, Zr as markPasteRule, It as mergeAttributes, _r as mergeDeep, j as minMax, qr as nodeInputRule, k as objectIncludes, hr as parseIndentedBlocks, kr as pasteRulesPlugin, Yt as removeDuplicates, gr as renderNestedMarkdownContent, Ut as resolveExtensions, He as resolveFocusPosition, Ze as selectionToInsertionEnd, W as sortExtensions, H as splitExtensions, Jr as textblockTypeInputRule, vr as updateMarkViewAttributes, Yr as wrappingInputRule };
|
|
3226
3215
|
|
|
3227
3216
|
//# sourceMappingURL=index.js.map
|