@burdenoff/microfe-support 2026.1029.2 → 2026.1031.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/global-operations.js +1 -2
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.js +1 -2
- package/dist/generated/global-types.js.map +1 -1
- package/dist/node_modules/@tiptap/core/dist/index.js +701 -712
- package/dist/node_modules/@tiptap/core/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +1 -2
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +1 -1
- package/dist/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js +1 -2
- package/dist/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js +15 -16
- package/dist/node_modules/@tiptap/extension-blockquote/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-bold/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-code/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-code/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +25 -26
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-document/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-document/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-hard-break/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-heading/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +16 -17
- package/dist/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-italic/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-link/dist/index.js +71 -80
- package/dist/node_modules/@tiptap/extension-link/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-list/dist/index.js +77 -90
- package/dist/node_modules/@tiptap/extension-list/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-placeholder/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-strike/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-text/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-text/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/extension-underline/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/extensions/dist/index.js +112 -113
- package/dist/node_modules/@tiptap/extensions/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/react/dist/index.js +5 -10
- package/dist/node_modules/@tiptap/react/dist/index.js.map +1 -1
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js +1 -2
- package/dist/node_modules/@tiptap/starter-kit/dist/index.js.map +1 -1
- package/dist/node_modules/clsx/dist/clsx.js +1 -2
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/dompurify/dist/purify.es.js +357 -347
- package/dist/node_modules/dompurify/dist/purify.es.js.map +1 -1
- package/dist/node_modules/fast-equals/dist/es/index.js +1 -2
- package/dist/node_modules/fast-equals/dist/es/index.js.map +1 -1
- package/dist/node_modules/linkifyjs/dist/linkify.js +1 -2
- package/dist/node_modules/linkifyjs/dist/linkify.js.map +1 -1
- package/dist/node_modules/marked/lib/marked.esm.js +10 -70
- package/dist/node_modules/marked/lib/marked.esm.js.map +1 -1
- package/dist/node_modules/orderedmap/dist/index.js +1 -2
- package/dist/node_modules/orderedmap/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-commands/dist/index.js +107 -108
- package/dist/node_modules/prosemirror-commands/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js +12 -13
- package/dist/node_modules/prosemirror-dropcursor/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js +42 -47
- package/dist/node_modules/prosemirror-gapcursor/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-history/dist/index.js +47 -49
- package/dist/node_modules/prosemirror-history/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-keymap/dist/index.js +15 -16
- package/dist/node_modules/prosemirror-keymap/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-model/dist/index.js +37 -41
- package/dist/node_modules/prosemirror-model/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-schema-list/dist/index.js +36 -37
- package/dist/node_modules/prosemirror-schema-list/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-state/dist/index.js +1 -2
- package/dist/node_modules/prosemirror-state/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-transform/dist/index.js +1 -2
- package/dist/node_modules/prosemirror-transform/dist/index.js.map +1 -1
- package/dist/node_modules/prosemirror-view/dist/index.js +302 -304
- package/dist/node_modules/prosemirror-view/dist/index.js.map +1 -1
- package/dist/node_modules/rope-sequence/dist/index.js +1 -2
- package/dist/node_modules/rope-sequence/dist/index.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +4 -21
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/node_modules/w3c-keyname/index.js +0 -1
- package/dist/node_modules/w3c-keyname/index.js.map +1 -1
- package/dist/support/SupportAdminRoot.js +14 -15
- package/dist/support/SupportAdminRoot.js.map +1 -1
- package/dist/support/SupportAdminRoutes.js +5 -6
- package/dist/support/SupportAdminRoutes.js.map +1 -1
- package/dist/support/SupportUserRoot.js +10 -11
- package/dist/support/SupportUserRoot.js.map +1 -1
- package/dist/support/SupportUserRoutes.js +1 -2
- package/dist/support/SupportUserRoutes.js.map +1 -1
- package/dist/support/components/NotificationToast.js +1 -2
- package/dist/support/components/NotificationToast.js.map +1 -1
- package/dist/support/components/PageLayout.js +15 -16
- package/dist/support/components/PageLayout.js.map +1 -1
- package/dist/support/components/RouteHelpers.js +1 -2
- package/dist/support/components/RouteHelpers.js.map +1 -1
- package/dist/support/components/analytics/CategoryBreakdown.js +9 -10
- package/dist/support/components/analytics/CategoryBreakdown.js.map +1 -1
- package/dist/support/components/analytics/MetricCard.js +1 -2
- package/dist/support/components/analytics/MetricCard.js.map +1 -1
- package/dist/support/components/analytics/PriorityBreakdown.js +9 -10
- package/dist/support/components/analytics/PriorityBreakdown.js.map +1 -1
- package/dist/support/components/analytics/SLAReport.js +5 -6
- package/dist/support/components/analytics/SLAReport.js.map +1 -1
- package/dist/support/components/analytics/SatisfactionDistribution.js +5 -6
- package/dist/support/components/analytics/SatisfactionDistribution.js.map +1 -1
- package/dist/support/components/analytics/TopAgents.js +5 -6
- package/dist/support/components/analytics/TopAgents.js.map +1 -1
- package/dist/support/components/analytics/TrendChart.js +5 -6
- package/dist/support/components/analytics/TrendChart.js.map +1 -1
- package/dist/support/components/careers/BulkCandidateActionGuidance.js +1 -2
- package/dist/support/components/careers/BulkCandidateActionGuidance.js.map +1 -1
- package/dist/support/components/careers/BulkCandidateDialogs.js +321 -322
- package/dist/support/components/careers/BulkCandidateDialogs.js.map +1 -1
- package/dist/support/components/careers/BulkOperationFeedback.js +1 -2
- package/dist/support/components/careers/BulkOperationFeedback.js.map +1 -1
- package/dist/support/components/careers/BulkSelectionSummary.js +1 -2
- package/dist/support/components/careers/BulkSelectionSummary.js.map +1 -1
- package/dist/support/components/careers/JobApplicationFilterContextGuard.js +1 -2
- package/dist/support/components/careers/JobApplicationFilterContextGuard.js.map +1 -1
- package/dist/support/components/careers/RichTextEditor.js +17 -18
- package/dist/support/components/careers/RichTextEditor.js.map +1 -1
- package/dist/support/components/kb/ArticleForm.js +10 -11
- package/dist/support/components/kb/ArticleForm.js.map +1 -1
- package/dist/support/components/settings/CannedResponsesSettings.js +2 -3
- package/dist/support/components/settings/CannedResponsesSettings.js.map +1 -1
- package/dist/support/components/settings/SLAPoliciesSettings.js +1 -2
- package/dist/support/components/settings/SLAPoliciesSettings.js.map +1 -1
- package/dist/support/components/settings/TicketCategoriesSettings.js +3 -8
- package/dist/support/components/settings/TicketCategoriesSettings.js.map +1 -1
- package/dist/support/components/tickets/AttachmentList.js +4 -5
- package/dist/support/components/tickets/AttachmentList.js.map +1 -1
- package/dist/support/components/tickets/MarkdownContent.js +1 -2
- package/dist/support/components/tickets/MarkdownContent.js.map +1 -1
- package/dist/support/components/tickets/MessageComposer.js +1 -2
- package/dist/support/components/tickets/MessageComposer.js.map +1 -1
- package/dist/support/components/tickets/MessageThread.js +13 -14
- package/dist/support/components/tickets/MessageThread.js.map +1 -1
- package/dist/support/components/tickets/TicketDetailHeader.js +13 -14
- package/dist/support/components/tickets/TicketDetailHeader.js.map +1 -1
- package/dist/support/components/tickets/TicketHeader.js +1 -2
- package/dist/support/components/tickets/TicketHeader.js.map +1 -1
- package/dist/support/components/tickets/TicketSidebar.js +6 -7
- package/dist/support/components/tickets/TicketSidebar.js.map +1 -1
- package/dist/support/components/tickets/TriagePanel.js +25 -26
- package/dist/support/components/tickets/TriagePanel.js.map +1 -1
- package/dist/support/components/ui.js +1 -2
- package/dist/support/constants/pipeline.js +1 -2
- package/dist/support/constants/pipeline.js.map +1 -1
- package/dist/support/constants.js +1 -2
- package/dist/support/constants.js.map +1 -1
- package/dist/support/events/rybbit.js +1 -2
- package/dist/support/events/rybbit.js.map +1 -1
- package/dist/support/hooks/index.js +6 -6
- package/dist/support/hooks/useAnalyticsOperations.js +1 -2
- package/dist/support/hooks/useAnalyticsOperations.js.map +1 -1
- package/dist/support/hooks/useAttachmentsFailedToast.js +1 -2
- package/dist/support/hooks/useAttachmentsFailedToast.js.map +1 -1
- package/dist/support/hooks/useChatOperations.js +14 -15
- package/dist/support/hooks/useChatOperations.js.map +1 -1
- package/dist/support/hooks/useDebouncedUrlText.js +1 -2
- package/dist/support/hooks/useDebouncedUrlText.js.map +1 -1
- package/dist/support/hooks/useKnowledgeBaseOperations.js +62 -63
- package/dist/support/hooks/useKnowledgeBaseOperations.js.map +1 -1
- package/dist/support/hooks/useNotification.js +1 -2
- package/dist/support/hooks/useNotification.js.map +1 -1
- package/dist/support/hooks/useRegisterFooter.js +1 -2
- package/dist/support/hooks/useRegisterFooter.js.map +1 -1
- package/dist/support/hooks/useSettingsOperations.js +1 -2
- package/dist/support/hooks/useSettingsOperations.js.map +1 -1
- package/dist/support/hooks/useSupportAttachments.js +1 -2
- package/dist/support/hooks/useSupportAttachments.js.map +1 -1
- package/dist/support/hooks/useTicketListOperations.js +9 -10
- package/dist/support/hooks/useTicketListOperations.js.map +1 -1
- package/dist/support/hooks/useTicketOperations.d.ts +8 -0
- package/dist/support/hooks/useTicketOperations.js +92 -93
- package/dist/support/hooks/useTicketOperations.js.map +1 -1
- package/dist/support/hooks/useTr.js +1 -2
- package/dist/support/hooks/useTr.js.map +1 -1
- package/dist/support/index.js +4 -4
- package/dist/support/pages/AnalyticsPage.js +34 -35
- package/dist/support/pages/AnalyticsPage.js.map +1 -1
- package/dist/support/pages/ArticleDetailAdminPage.js +33 -38
- package/dist/support/pages/ArticleDetailAdminPage.js.map +1 -1
- package/dist/support/pages/ArticleDetailUserPage.js +22 -23
- package/dist/support/pages/ArticleDetailUserPage.js.map +1 -1
- package/dist/support/pages/ContactInquiriesPage.js +5 -6
- package/dist/support/pages/ContactInquiriesPage.js.map +1 -1
- package/dist/support/pages/ContactInquiryDetailPage.js +13 -14
- package/dist/support/pages/ContactInquiryDetailPage.js.map +1 -1
- package/dist/support/pages/CreateArticlePage.js +15 -16
- package/dist/support/pages/CreateArticlePage.js.map +1 -1
- package/dist/support/pages/CreateTicketPage.js +37 -44
- package/dist/support/pages/CreateTicketPage.js.map +1 -1
- package/dist/support/pages/EditArticlePage.js +20 -21
- package/dist/support/pages/EditArticlePage.js.map +1 -1
- package/dist/support/pages/InterviewersPage.js +121 -122
- package/dist/support/pages/InterviewersPage.js.map +1 -1
- package/dist/support/pages/JobApplicationDetailPage.js +322 -332
- package/dist/support/pages/JobApplicationDetailPage.js.map +1 -1
- package/dist/support/pages/JobApplicationsPage.js +556 -561
- package/dist/support/pages/JobApplicationsPage.js.map +1 -1
- package/dist/support/pages/JobPostingDetailPage.js +489 -490
- package/dist/support/pages/JobPostingDetailPage.js.map +1 -1
- package/dist/support/pages/JobPostingsPage.js +279 -280
- package/dist/support/pages/JobPostingsPage.js.map +1 -1
- package/dist/support/pages/KnowledgeBaseAdminPage.js +26 -27
- package/dist/support/pages/KnowledgeBaseAdminPage.js.map +1 -1
- package/dist/support/pages/KnowledgeBaseUserPage.js +23 -24
- package/dist/support/pages/KnowledgeBaseUserPage.js.map +1 -1
- package/dist/support/pages/SettingsPage.js +43 -44
- package/dist/support/pages/SettingsPage.js.map +1 -1
- package/dist/support/pages/TicketDetailAdminPage.js +54 -55
- package/dist/support/pages/TicketDetailAdminPage.js.map +1 -1
- package/dist/support/pages/TicketDetailUserPage.js +61 -62
- package/dist/support/pages/TicketDetailUserPage.js.map +1 -1
- package/dist/support/pages/TicketListPage.js +77 -78
- package/dist/support/pages/TicketListPage.js.map +1 -1
- package/dist/support/providers/SupportProvider.js +1 -2
- package/dist/support/providers/SupportProvider.js.map +1 -1
- package/dist/support/store/supportStore.js +1 -2
- package/dist/support/store/supportStore.js.map +1 -1
- package/dist/support/translations/en.js +1 -2
- package/dist/support/translations/en.js.map +1 -1
- package/dist/support/utils/attachments.js +1 -2
- package/dist/support/utils/attachments.js.map +1 -1
- package/dist/support/utils/breadcrumbRegistry.js +3 -4
- package/dist/support/utils/breadcrumbRegistry.js.map +1 -1
- package/dist/support/utils/bulkCandidateOperations.js +0 -1
- package/dist/support/utils/bulkCandidateOperations.js.map +1 -1
- package/dist/support/utils/bulkCandidateTargetQuery.js +1 -2
- package/dist/support/utils/bulkCandidateTargetQuery.js.map +1 -1
- package/dist/support/utils/categoryColors.js +1 -2
- package/dist/support/utils/categoryColors.js.map +1 -1
- package/dist/support/utils/cn.js +1 -2
- package/dist/support/utils/cn.js.map +1 -1
- package/dist/support/utils/context.js +3 -4
- package/dist/support/utils/context.js.map +1 -1
- package/dist/support/utils/errors.js +1 -2
- package/dist/support/utils/errors.js.map +1 -1
- package/dist/support/utils/i18n.js +1 -2
- package/dist/support/utils/i18n.js.map +1 -1
- package/dist/support/utils/index.js +1 -2
- package/dist/support/utils/index.js.map +1 -1
- package/dist/support/utils/jobApplicationFilterParams.js +1 -2
- package/dist/support/utils/jobApplicationFilterParams.js.map +1 -1
- package/dist/support/utils/markdown.js +1 -2
- package/dist/support/utils/markdown.js.map +1 -1
- package/dist/support/utils/supportFiles.js +2 -11
- package/dist/support/utils/supportFiles.js.map +1 -1
- package/dist/support/utils/ticketFilters.js +1 -2
- package/dist/support/utils/ticketFilters.js.map +1 -1
- package/dist/support/utils/uiTokens.js +1 -2
- package/dist/support/utils/uiTokens.js.map +1 -1
- package/dist/utils/nativeBridge.js +1 -2
- package/package.json +21 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { AllSelection as e, NodeSelection as t, Selection as n, TextSelection as r } from "../../prosemirror-state/dist/index.js";
|
|
2
|
+
import { DOMParser as i, DOMSerializer as a, Fragment as o, Mark as s, Slice as c } from "../../prosemirror-model/dist/index.js";
|
|
3
|
+
import { dropPoint as l } from "../../prosemirror-transform/dist/index.js";
|
|
4
|
+
// node_modules/prosemirror-view/dist/index.js
|
|
5
5
|
var u = function(e) {
|
|
6
6
|
for (var t = 0;; t++) if (e = e.previousSibling, !e) return t;
|
|
7
7
|
}, d = function(e) {
|
|
@@ -592,7 +592,7 @@ var L = 0, Ve = 1, R = 2, z = 3, He = class {
|
|
|
592
592
|
for (let e; n && !(e = this.children[n - 1]).size && e instanceof Ue && e.side >= 0; n--);
|
|
593
593
|
if (t <= 0) {
|
|
594
594
|
let e, r = !0;
|
|
595
|
-
for (; e = n ? this.children[n - 1] : null,
|
|
595
|
+
for (; e = n ? this.children[n - 1] : null, e && e.dom.parentNode != this.contentDOM; n--, r = !1);
|
|
596
596
|
return e && t && r && !e.border && !e.domAtom ? e.domFromPos(e.size, t) : {
|
|
597
597
|
node: this.contentDOM,
|
|
598
598
|
offset: e ? u(e.dom) + 1 : 0
|
|
@@ -600,7 +600,7 @@ var L = 0, Ve = 1, R = 2, z = 3, He = class {
|
|
|
600
600
|
}
|
|
601
601
|
{
|
|
602
602
|
let e, r = !0;
|
|
603
|
-
for (; e = n < this.children.length ? this.children[n] : null,
|
|
603
|
+
for (; e = n < this.children.length ? this.children[n] : null, e && e.dom.parentNode != this.contentDOM; n++, r = !1);
|
|
604
604
|
return e && r && !e.border && !e.domAtom ? e.domFromPos(0, t) : {
|
|
605
605
|
node: this.contentDOM,
|
|
606
606
|
offset: e ? u(e.dom) : this.contentDOM.childNodes.length
|
|
@@ -816,9 +816,9 @@ var L = 0, Ve = 1, R = 2, z = 3, He = class {
|
|
|
816
816
|
constructor(e, t, n, r, i) {
|
|
817
817
|
super(e, [], n, r), this.mark = t, this.spec = i;
|
|
818
818
|
}
|
|
819
|
-
static create(n, r, i
|
|
820
|
-
let o =
|
|
821
|
-
return
|
|
819
|
+
static create(t, n, r, i) {
|
|
820
|
+
let o = i.nodeViews[n.type.name], s = o && o(n, i, r);
|
|
821
|
+
return s && s.dom || (s = a.renderSpec(document, n.type.spec.toDOM(n, r), null, n.attrs)), new e(t, n, s.dom, s.contentDOM || s.dom, s);
|
|
822
822
|
}
|
|
823
823
|
parseRule() {
|
|
824
824
|
return this.dirty & z || this.mark.type.spec.reparseInView ? null : {
|
|
@@ -853,21 +853,21 @@ var L = 0, Ve = 1, R = 2, z = 3, He = class {
|
|
|
853
853
|
constructor(e, t, n, r, i, a, o) {
|
|
854
854
|
super(e, [], i, a), this.node = t, this.outerDeco = n, this.innerDeco = r, this.nodeDOM = o;
|
|
855
855
|
}
|
|
856
|
-
static create(n, r, i,
|
|
857
|
-
let c = o.nodeViews[
|
|
856
|
+
static create(t, n, r, i, o, s) {
|
|
857
|
+
let c = o.nodeViews[n.type.name], l, u = c && c(n, o, () => {
|
|
858
858
|
if (!l) return s;
|
|
859
859
|
if (l.parent) return l.parent.posBeforeChild(l);
|
|
860
|
-
},
|
|
861
|
-
if (
|
|
862
|
-
if (!d) d = document.createTextNode(
|
|
860
|
+
}, r, i), d = u && u.dom, f = u && u.contentDOM;
|
|
861
|
+
if (n.isText) {
|
|
862
|
+
if (!d) d = document.createTextNode(n.text);
|
|
863
863
|
else if (d.nodeType != 3) throw RangeError("Text must be rendered as a DOM text node");
|
|
864
864
|
} else if (!d) {
|
|
865
|
-
let e =
|
|
865
|
+
let e = a.renderSpec(document, n.type.spec.toDOM(n), null, n.attrs);
|
|
866
866
|
({dom: d, contentDOM: f} = e);
|
|
867
867
|
}
|
|
868
|
-
!f && !
|
|
868
|
+
!f && !n.isText && d.nodeName != "BR" && (d.hasAttribute("contenteditable") || (d.contentEditable = "false"), n.type.spec.draggable && (d.draggable = !0));
|
|
869
869
|
let p = d;
|
|
870
|
-
return d = tt(d,
|
|
870
|
+
return d = tt(d, r, n), u ? l = new Ye(t, n, r, i, d, f || null, p, u) : n.isText ? new qe(t, n, r, i, d, p) : new e(t, n, r, i, d, f || null, p);
|
|
871
871
|
}
|
|
872
872
|
parseRule(e) {
|
|
873
873
|
if (this.node.type.spec.reparseInView) return null;
|
|
@@ -886,8 +886,8 @@ var L = 0, Ve = 1, R = 2, z = 3, He = class {
|
|
|
886
886
|
}
|
|
887
887
|
}
|
|
888
888
|
if (!t.contentElement) {
|
|
889
|
-
let
|
|
890
|
-
|
|
889
|
+
let n = e && e.find((t) => t.nodeType == 1 && e.indexOf(t.parentNode) < 0 && this.dom.contains(t));
|
|
890
|
+
n ? t.contentElement = n : t.getContent = () => o.empty;
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
893
|
return t;
|
|
@@ -902,30 +902,30 @@ var L = 0, Ve = 1, R = 2, z = 3, He = class {
|
|
|
902
902
|
return +!this.node.isLeaf;
|
|
903
903
|
}
|
|
904
904
|
updateChildren(e, t) {
|
|
905
|
-
let n = this.node.inlineContent,
|
|
906
|
-
st(this.node, this.innerDeco, (t,
|
|
907
|
-
t.spec.marks ? c.syncToMarks(t.spec.marks, n, e,
|
|
908
|
-
}, (t,
|
|
905
|
+
let n = this.node.inlineContent, r = t, i = e.composing ? this.localCompositionInfo(e, t) : null, a = i && i.pos > -1 ? i : null, o = i && i.pos < 0, c = new it(this, a && a.node, e);
|
|
906
|
+
st(this.node, this.innerDeco, (t, i, a) => {
|
|
907
|
+
t.spec.marks ? c.syncToMarks(t.spec.marks, n, e, i) : t.type.side >= 0 && !a && c.syncToMarks(i == this.node.childCount ? s.none : this.node.child(i).marks, n, e, i), c.placeWidget(t, e, r);
|
|
908
|
+
}, (t, a, s, l) => {
|
|
909
909
|
c.syncToMarks(t.marks, n, e, l);
|
|
910
910
|
let u;
|
|
911
|
-
c.findNodeMatch(t,
|
|
912
|
-
}), c.syncToMarks([], n, e, 0), this.node.isTextblock && c.addTextblockHacks(), c.destroyRest(), (c.changed || this.dirty == R) && (
|
|
911
|
+
c.findNodeMatch(t, a, s, l) || o && e.state.selection.from > r && e.state.selection.to < r + t.nodeSize && (u = c.findIndexWithChild(i.node)) > -1 && c.updateNodeAt(t, a, s, u, e) || c.updateNextNode(t, a, s, e, l, r) || c.addNode(t, a, s, e, r), r += t.nodeSize;
|
|
912
|
+
}), c.syncToMarks([], n, e, 0), this.node.isTextblock && c.addTextblockHacks(), c.destroyRest(), (c.changed || this.dirty == R) && (a && this.protectLocalComposition(e, a), Xe(this.contentDOM, this.children, e), j && ct(this.dom));
|
|
913
913
|
}
|
|
914
914
|
localCompositionInfo(e, t) {
|
|
915
|
-
let { from: n, to:
|
|
916
|
-
if (!(e.state.selection instanceof
|
|
917
|
-
let
|
|
918
|
-
if (!
|
|
915
|
+
let { from: n, to: i } = e.state.selection;
|
|
916
|
+
if (!(e.state.selection instanceof r) || n < t || i > t + this.node.content.size) return null;
|
|
917
|
+
let a = e.input.compositionNode;
|
|
918
|
+
if (!a || !this.dom.contains(a.parentNode)) return null;
|
|
919
919
|
if (this.node.inlineContent) {
|
|
920
|
-
let e =
|
|
921
|
-
return
|
|
922
|
-
node:
|
|
923
|
-
pos:
|
|
920
|
+
let e = a.nodeValue, r = lt(this.node.content, e, n - t, i - t);
|
|
921
|
+
return r < 0 ? null : {
|
|
922
|
+
node: a,
|
|
923
|
+
pos: r,
|
|
924
924
|
text: e
|
|
925
925
|
};
|
|
926
926
|
}
|
|
927
927
|
return {
|
|
928
|
-
node:
|
|
928
|
+
node: a,
|
|
929
929
|
pos: -1,
|
|
930
930
|
text: ""
|
|
931
931
|
};
|
|
@@ -1096,7 +1096,7 @@ function $e(e, t, n, r) {
|
|
|
1096
1096
|
let a = r[t], o = n[t];
|
|
1097
1097
|
if (t) {
|
|
1098
1098
|
let t;
|
|
1099
|
-
o && o.nodeName == a.nodeName && i != e && (t = i.parentNode) && t.nodeName.toLowerCase() == a.nodeName
|
|
1099
|
+
o && o.nodeName == a.nodeName && i != e && (t = i.parentNode) && t.nodeName.toLowerCase() == a.nodeName || (t = document.createElement(a.nodeName), t.pmIsDeco = !0, t.appendChild(i), o = V[0]), i = t;
|
|
1100
1100
|
}
|
|
1101
1101
|
et(i, o || V[0], a);
|
|
1102
1102
|
}
|
|
@@ -1354,35 +1354,35 @@ function ut(e, t, n, r, i) {
|
|
|
1354
1354
|
}
|
|
1355
1355
|
return a;
|
|
1356
1356
|
}
|
|
1357
|
-
function dt(e,
|
|
1358
|
-
let
|
|
1359
|
-
if (!
|
|
1360
|
-
let
|
|
1361
|
-
if (
|
|
1362
|
-
let c =
|
|
1363
|
-
if (S(
|
|
1364
|
-
for (l =
|
|
1365
|
-
let e =
|
|
1366
|
-
if (
|
|
1367
|
-
let e =
|
|
1368
|
-
u = new s
|
|
1357
|
+
function dt(e, n = null) {
|
|
1358
|
+
let r = e.domSelectionRange(), i = e.state.doc;
|
|
1359
|
+
if (!r.focusNode) return null;
|
|
1360
|
+
let a = e.docView.nearestDesc(r.focusNode), o = a && a.size == 0, s = e.docView.posFromDOM(r.focusNode, r.focusOffset, 1);
|
|
1361
|
+
if (s < 0) return null;
|
|
1362
|
+
let c = i.resolve(s), l, u;
|
|
1363
|
+
if (S(r)) {
|
|
1364
|
+
for (l = s; a && !a.node;) a = a.parent;
|
|
1365
|
+
let e = a.node;
|
|
1366
|
+
if (a && e.isAtom && t.isSelectable(e) && a.parent && !(e.isInline && b(r.focusNode, r.focusOffset, a.dom))) {
|
|
1367
|
+
let e = a.posBefore;
|
|
1368
|
+
u = new t(s == e ? c : i.resolve(e));
|
|
1369
1369
|
}
|
|
1370
1370
|
} else {
|
|
1371
|
-
if (
|
|
1372
|
-
let t =
|
|
1373
|
-
for (let
|
|
1374
|
-
let a =
|
|
1375
|
-
t = Math.min(t, e.docView.posFromDOM(a.startContainer, a.startOffset, 1)),
|
|
1371
|
+
if (r instanceof e.dom.ownerDocument.defaultView.Selection && r.rangeCount > 1) {
|
|
1372
|
+
let t = s, n = s;
|
|
1373
|
+
for (let i = 0; i < r.rangeCount; i++) {
|
|
1374
|
+
let a = r.getRangeAt(i);
|
|
1375
|
+
t = Math.min(t, e.docView.posFromDOM(a.startContainer, a.startOffset, 1)), n = Math.max(n, e.docView.posFromDOM(a.endContainer, a.endOffset, -1));
|
|
1376
1376
|
}
|
|
1377
1377
|
if (t < 0) return null;
|
|
1378
|
-
[l,
|
|
1379
|
-
} else l = e.docView.posFromDOM(
|
|
1378
|
+
[l, s] = n == e.state.selection.anchor ? [n, t] : [t, n], c = i.resolve(s);
|
|
1379
|
+
} else l = e.docView.posFromDOM(r.anchorNode, r.anchorOffset, 1);
|
|
1380
1380
|
if (l < 0) return null;
|
|
1381
1381
|
}
|
|
1382
|
-
let d =
|
|
1382
|
+
let d = i.resolve(l);
|
|
1383
1383
|
if (!u) {
|
|
1384
|
-
let
|
|
1385
|
-
u = xt(e, d, c,
|
|
1384
|
+
let t = n == "pointer" || e.state.selection.head < c.pos && !o ? 1 : -1;
|
|
1385
|
+
u = xt(e, d, c, t);
|
|
1386
1386
|
}
|
|
1387
1387
|
return u;
|
|
1388
1388
|
}
|
|
@@ -1392,18 +1392,18 @@ function ft(e) {
|
|
|
1392
1392
|
function H(e, t = !1) {
|
|
1393
1393
|
let n = e.state.selection;
|
|
1394
1394
|
if (yt(e, n), !ft(e)) return;
|
|
1395
|
-
let
|
|
1396
|
-
if (!t && k &&
|
|
1395
|
+
let i = e.input.mouseDown;
|
|
1396
|
+
if (!t && k && i) {
|
|
1397
1397
|
let t = e.domSelectionRange(), n = e.domObserver.currentSelection;
|
|
1398
|
-
if (t.anchorNode && n.anchorNode && h(t.anchorNode, t.anchorOffset, n.anchorNode, n.anchorOffset) &&
|
|
1398
|
+
if (t.anchorNode && n.anchorNode && h(t.anchorNode, t.anchorOffset, n.anchorNode, n.anchorOffset) && i.delaySelUpdate()) {
|
|
1399
1399
|
e.domObserver.setCurSelection();
|
|
1400
1400
|
return;
|
|
1401
1401
|
}
|
|
1402
1402
|
}
|
|
1403
1403
|
if (e.domObserver.disconnectSelection(), e.cursorWrapper) vt(e);
|
|
1404
1404
|
else {
|
|
1405
|
-
let { anchor:
|
|
1406
|
-
pt && !(n instanceof
|
|
1405
|
+
let { anchor: i, head: a } = n, o, s;
|
|
1406
|
+
pt && !(n instanceof r) && (n.$from.parent.inlineContent || (o = mt(e, n.from)), !n.empty && !n.$from.parent.inlineContent && (s = mt(e, n.to))), e.docView.setSelection(i, a, e, t), pt && (o && gt(o), s && gt(s)), n.visible ? e.dom.classList.remove("ProseMirror-hideselection") : (e.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && _t(e));
|
|
1407
1407
|
}
|
|
1408
1408
|
e.domObserver.setCurSelection(), e.domObserver.connectSelection();
|
|
1409
1409
|
}
|
|
@@ -1438,17 +1438,17 @@ function vt(e) {
|
|
|
1438
1438
|
let n = e.cursorWrapper.dom, r = n.nodeName == "IMG";
|
|
1439
1439
|
r ? t.collapse(n.parentNode, u(n) + 1) : t.collapse(n, 0), !r && !e.state.selection.visible && E && D <= 11 && (n.disabled = !0, n.disabled = !1);
|
|
1440
1440
|
}
|
|
1441
|
-
function yt(e,
|
|
1442
|
-
if (
|
|
1443
|
-
let
|
|
1444
|
-
|
|
1441
|
+
function yt(e, n) {
|
|
1442
|
+
if (n instanceof t) {
|
|
1443
|
+
let t = e.docView.descAt(n.from);
|
|
1444
|
+
t != e.lastSelectedViewDesc && (bt(e), t && t.selectNode(), e.lastSelectedViewDesc = t);
|
|
1445
1445
|
} else bt(e);
|
|
1446
1446
|
}
|
|
1447
1447
|
function bt(e) {
|
|
1448
1448
|
e.lastSelectedViewDesc &&= (e.lastSelectedViewDesc.parent && e.lastSelectedViewDesc.deselectNode(), void 0);
|
|
1449
1449
|
}
|
|
1450
|
-
function xt(e, t, n,
|
|
1451
|
-
return e.someProp("createSelectionBetween", (r) => r(e, t, n)) ||
|
|
1450
|
+
function xt(e, t, n, i) {
|
|
1451
|
+
return e.someProp("createSelectionBetween", (r) => r(e, t, n)) || r.between(t, n, i);
|
|
1452
1452
|
}
|
|
1453
1453
|
function St(e) {
|
|
1454
1454
|
return e.editable && !e.hasFocus() ? !1 : Ct(e);
|
|
@@ -1467,36 +1467,36 @@ function wt(e) {
|
|
|
1467
1467
|
return h(t.node, t.offset, n.anchorNode, n.anchorOffset);
|
|
1468
1468
|
}
|
|
1469
1469
|
function Tt(e, t) {
|
|
1470
|
-
let { $anchor:
|
|
1471
|
-
return
|
|
1470
|
+
let { $anchor: r, $head: i } = e.selection, a = t > 0 ? r.max(i) : r.min(i), o = a.parent.inlineContent ? a.depth ? e.doc.resolve(t > 0 ? a.after() : a.before()) : null : a;
|
|
1471
|
+
return o && n.findFrom(o, t);
|
|
1472
1472
|
}
|
|
1473
1473
|
function U(e, t) {
|
|
1474
1474
|
return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()), !0;
|
|
1475
1475
|
}
|
|
1476
|
-
function Et(e,
|
|
1477
|
-
let
|
|
1478
|
-
if (
|
|
1479
|
-
if (
|
|
1480
|
-
let { $head:
|
|
1476
|
+
function Et(e, n, i) {
|
|
1477
|
+
let a = e.state.selection;
|
|
1478
|
+
if (a instanceof r) {
|
|
1479
|
+
if (i.indexOf("s") > -1) {
|
|
1480
|
+
let { $head: t } = a, i = t.textOffset ? null : n < 0 ? t.nodeBefore : t.nodeAfter;
|
|
1481
1481
|
if (!i || i.isText || !i.isLeaf) return !1;
|
|
1482
|
-
let
|
|
1483
|
-
return U(e, new
|
|
1482
|
+
let o = e.state.doc.resolve(t.pos + i.nodeSize * (n < 0 ? -1 : 1));
|
|
1483
|
+
return U(e, new r(a.$anchor, o));
|
|
1484
1484
|
}
|
|
1485
|
-
if (!
|
|
1486
|
-
if (e.endOfTextblock(
|
|
1487
|
-
let
|
|
1488
|
-
return
|
|
1485
|
+
if (!a.empty) return !1;
|
|
1486
|
+
if (e.endOfTextblock(n > 0 ? "forward" : "backward")) {
|
|
1487
|
+
let r = Tt(e.state, n);
|
|
1488
|
+
return r && r instanceof t ? U(e, r) : !1;
|
|
1489
1489
|
}
|
|
1490
|
-
if (!(M &&
|
|
1491
|
-
let
|
|
1492
|
-
if (!
|
|
1493
|
-
let
|
|
1494
|
-
return
|
|
1490
|
+
if (!(M && i.indexOf("m") > -1)) {
|
|
1491
|
+
let i = a.$head, o = i.textOffset ? null : n < 0 ? i.nodeBefore : i.nodeAfter, s;
|
|
1492
|
+
if (!o || o.isText) return !1;
|
|
1493
|
+
let c = n < 0 ? i.pos - o.nodeSize : i.pos;
|
|
1494
|
+
return o.isAtom || (s = e.docView.descAt(c)) && !s.contentDOM ? t.isSelectable(o) ? U(e, new t(n < 0 ? e.state.doc.resolve(i.pos - o.nodeSize) : i)) : ue ? U(e, new r(e.state.doc.resolve(n < 0 ? c : c + o.nodeSize))) : !1 : !1;
|
|
1495
1495
|
}
|
|
1496
|
-
} else if (
|
|
1496
|
+
} else if (a instanceof t && a.node.isInline) return U(e, new r(n > 0 ? a.$to : a.$from));
|
|
1497
1497
|
else {
|
|
1498
|
-
let
|
|
1499
|
-
return
|
|
1498
|
+
let t = Tt(e.state, n);
|
|
1499
|
+
return t ? U(e, t) : !1;
|
|
1500
1500
|
}
|
|
1501
1501
|
}
|
|
1502
1502
|
function Dt(e) {
|
|
@@ -1608,30 +1608,30 @@ function Ft(e, t) {
|
|
|
1608
1608
|
}
|
|
1609
1609
|
return getComputedStyle(e.dom).direction == "rtl" ? "rtl" : "ltr";
|
|
1610
1610
|
}
|
|
1611
|
-
function It(
|
|
1612
|
-
let
|
|
1613
|
-
if (
|
|
1614
|
-
let { $from:
|
|
1615
|
-
if (!
|
|
1616
|
-
let
|
|
1617
|
-
if (
|
|
1611
|
+
function It(i, a, o) {
|
|
1612
|
+
let s = i.state.selection;
|
|
1613
|
+
if (s instanceof r && !s.empty || o.indexOf("s") > -1 || M && o.indexOf("m") > -1) return !1;
|
|
1614
|
+
let { $from: c, $to: l } = s;
|
|
1615
|
+
if (!c.parent.inlineContent || i.endOfTextblock(a < 0 ? "up" : "down")) {
|
|
1616
|
+
let e = Tt(i.state, a);
|
|
1617
|
+
if (e && e instanceof t) return U(i, e);
|
|
1618
1618
|
}
|
|
1619
|
-
if (!
|
|
1620
|
-
let
|
|
1621
|
-
return
|
|
1619
|
+
if (!c.parent.inlineContent) {
|
|
1620
|
+
let t = a < 0 ? c : l, r = s instanceof e ? n.near(t, a) : n.findFrom(t, a);
|
|
1621
|
+
return r ? U(i, r) : !1;
|
|
1622
1622
|
}
|
|
1623
1623
|
return !1;
|
|
1624
1624
|
}
|
|
1625
1625
|
function Lt(e, t) {
|
|
1626
|
-
if (!(e.state.selection instanceof
|
|
1627
|
-
let { $head: n, $anchor:
|
|
1628
|
-
if (!n.sameParent(
|
|
1629
|
-
if (!
|
|
1626
|
+
if (!(e.state.selection instanceof r)) return !0;
|
|
1627
|
+
let { $head: n, $anchor: i, empty: a } = e.state.selection;
|
|
1628
|
+
if (!n.sameParent(i)) return !0;
|
|
1629
|
+
if (!a) return !1;
|
|
1630
1630
|
if (e.endOfTextblock(t > 0 ? "forward" : "backward")) return !0;
|
|
1631
|
-
let
|
|
1632
|
-
if (
|
|
1631
|
+
let o = !n.textOffset && (t < 0 ? n.nodeBefore : n.nodeAfter);
|
|
1632
|
+
if (o && !o.isText) {
|
|
1633
1633
|
let r = e.state.tr;
|
|
1634
|
-
return t < 0 ? r.delete(n.pos -
|
|
1634
|
+
return t < 0 ? r.delete(n.pos - o.nodeSize, n.pos) : r.delete(n.pos, n.pos + o.nodeSize), e.dispatch(r), !0;
|
|
1635
1635
|
}
|
|
1636
1636
|
return !1;
|
|
1637
1637
|
}
|
|
@@ -1666,18 +1666,18 @@ function Vt(e, t) {
|
|
|
1666
1666
|
}
|
|
1667
1667
|
return n == 38 || M && n == 80 && r == "c" ? It(e, -1, r) || W(e, -1) : n == 40 || M && n == 78 && r == "c" ? zt(e) || It(e, 1, r) || W(e, 1) : !(r != (M ? "m" : "c") || n != 66 && n != 73 && n != 89 && n != 90);
|
|
1668
1668
|
}
|
|
1669
|
-
function Ht(e,
|
|
1670
|
-
e.someProp("transformCopied", (
|
|
1671
|
-
|
|
1669
|
+
function Ht(e, t) {
|
|
1670
|
+
e.someProp("transformCopied", (n) => {
|
|
1671
|
+
t = n(t, e);
|
|
1672
1672
|
});
|
|
1673
|
-
let
|
|
1674
|
-
for (;
|
|
1675
|
-
|
|
1676
|
-
let e =
|
|
1677
|
-
|
|
1678
|
-
}
|
|
1679
|
-
let s = e.someProp("clipboardSerializer") ||
|
|
1680
|
-
l.appendChild(s.serializeFragment(
|
|
1673
|
+
let n = [], { content: r, openStart: i, openEnd: o } = t;
|
|
1674
|
+
for (; i > 1 && o > 1 && r.childCount == 1 && r.firstChild.childCount == 1;) {
|
|
1675
|
+
i--, o--;
|
|
1676
|
+
let e = r.firstChild;
|
|
1677
|
+
n.push(e.type.name, e.attrs == e.type.defaultAttrs ? null : e.attrs), r = e.content;
|
|
1678
|
+
}
|
|
1679
|
+
let s = e.someProp("clipboardSerializer") || a.fromSchema(e.state.schema), c = Qt(), l = c.createElement("div");
|
|
1680
|
+
l.appendChild(s.serializeFragment(r, { document: c }));
|
|
1681
1681
|
let u = l.firstChild, d, f = 0;
|
|
1682
1682
|
for (; u && u.nodeType == 1 && (d = Zt[u.nodeName.toLowerCase()]);) {
|
|
1683
1683
|
for (let e = d.length - 1; e >= 0; e--) {
|
|
@@ -1687,34 +1687,34 @@ function Ht(e, n) {
|
|
|
1687
1687
|
}
|
|
1688
1688
|
u = l.firstChild;
|
|
1689
1689
|
}
|
|
1690
|
-
return u && u.nodeType == 1 && u.setAttribute("data-pm-slice", `${
|
|
1690
|
+
return u && u.nodeType == 1 && u.setAttribute("data-pm-slice", `${i} ${o}${f ? ` -${f}` : ""} ${JSON.stringify(n)}`), {
|
|
1691
1691
|
dom: l,
|
|
1692
|
-
text: e.someProp("clipboardTextSerializer", (
|
|
1693
|
-
slice:
|
|
1692
|
+
text: e.someProp("clipboardTextSerializer", (n) => n(t, e)) || t.content.textBetween(0, t.content.size, "\n\n"),
|
|
1693
|
+
slice: t
|
|
1694
1694
|
};
|
|
1695
1695
|
}
|
|
1696
|
-
function Ut(
|
|
1697
|
-
let l =
|
|
1698
|
-
if (!
|
|
1699
|
-
let f = !!
|
|
1696
|
+
function Ut(e, t, n, r, s) {
|
|
1697
|
+
let l = s.parent.type.spec.code, u, d;
|
|
1698
|
+
if (!n && !t) return null;
|
|
1699
|
+
let f = !!t && (r || l || !n);
|
|
1700
1700
|
if (f) {
|
|
1701
|
-
if (
|
|
1702
|
-
|
|
1703
|
-
}), l) return d = new
|
|
1704
|
-
d =
|
|
1701
|
+
if (e.someProp("transformPastedText", (n) => {
|
|
1702
|
+
t = n(t, l || r, e);
|
|
1703
|
+
}), l) return d = new c(o.from(e.state.schema.text(t.replace(/\r\n?/g, "\n"))), 0, 0), e.someProp("transformPasted", (t) => {
|
|
1704
|
+
d = t(d, e, !0);
|
|
1705
1705
|
}), d;
|
|
1706
|
-
let
|
|
1707
|
-
if (
|
|
1706
|
+
let n = e.someProp("clipboardTextParser", (n) => n(t, s, r, e));
|
|
1707
|
+
if (n) d = n;
|
|
1708
1708
|
else {
|
|
1709
|
-
let
|
|
1710
|
-
u = document.createElement("div"),
|
|
1711
|
-
let
|
|
1712
|
-
|
|
1709
|
+
let n = s.marks(), { schema: r } = e.state, i = a.fromSchema(r);
|
|
1710
|
+
u = document.createElement("div"), t.split(/(?:\r\n?|\n)+/).forEach((e) => {
|
|
1711
|
+
let t = u.appendChild(document.createElement("p"));
|
|
1712
|
+
e && t.appendChild(i.serializeNode(r.text(e, n)));
|
|
1713
1713
|
});
|
|
1714
1714
|
}
|
|
1715
|
-
} else
|
|
1716
|
-
|
|
1717
|
-
}), u = tn(
|
|
1715
|
+
} else e.someProp("transformPastedHTML", (t) => {
|
|
1716
|
+
n = t(n, e);
|
|
1717
|
+
}), u = tn(n), ue && nn(u);
|
|
1718
1718
|
let p = u && u.querySelector("[data-pm-slice]"), m = p && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(p.getAttribute("data-pm-slice") || "");
|
|
1719
1719
|
if (m && m[3]) for (let e = +m[3]; e > 0; e--) {
|
|
1720
1720
|
let e = u.firstChild;
|
|
@@ -1722,64 +1722,64 @@ function Ut(r, a, o, s, c) {
|
|
|
1722
1722
|
if (!e) break;
|
|
1723
1723
|
u = e;
|
|
1724
1724
|
}
|
|
1725
|
-
if (d ||= (
|
|
1725
|
+
if (d ||= (e.someProp("clipboardParser") || e.someProp("domParser") || i.fromSchema(e.state.schema)).parseSlice(u, {
|
|
1726
1726
|
preserveWhitespace: !!(f || m),
|
|
1727
|
-
context:
|
|
1727
|
+
context: s,
|
|
1728
1728
|
ruleFromNode(e) {
|
|
1729
1729
|
return e.nodeName == "BR" && !e.nextSibling && e.parentNode && !Wt.test(e.parentNode.nodeName) ? { ignore: !0 } : null;
|
|
1730
1730
|
}
|
|
1731
1731
|
}), m) d = rn(Xt(d, +m[1], +m[2]), m[4]);
|
|
1732
|
-
else if (d =
|
|
1732
|
+
else if (d = c.maxOpen(Gt(d.content, s), !0), d.openStart || d.openEnd) {
|
|
1733
1733
|
let e = 0, t = 0;
|
|
1734
1734
|
for (let t = d.content.firstChild; e < d.openStart && !t.type.spec.isolating; e++, t = t.firstChild);
|
|
1735
1735
|
for (let e = d.content.lastChild; t < d.openEnd && !e.type.spec.isolating; t++, e = e.lastChild);
|
|
1736
1736
|
d = Xt(d, e, t);
|
|
1737
1737
|
}
|
|
1738
|
-
return
|
|
1739
|
-
d =
|
|
1738
|
+
return e.someProp("transformPasted", (t) => {
|
|
1739
|
+
d = t(d, e, f);
|
|
1740
1740
|
}), d;
|
|
1741
1741
|
}
|
|
1742
1742
|
var Wt = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
|
|
1743
1743
|
function Gt(e, t) {
|
|
1744
1744
|
if (e.childCount < 2) return e;
|
|
1745
|
-
for (let
|
|
1746
|
-
let
|
|
1745
|
+
for (let n = t.depth; n >= 0; n--) {
|
|
1746
|
+
let r = t.node(n).contentMatchAt(t.index(n)), i, a = [];
|
|
1747
1747
|
if (e.forEach((e) => {
|
|
1748
|
-
if (!
|
|
1749
|
-
let t =
|
|
1750
|
-
if (!t) return
|
|
1751
|
-
if (n =
|
|
1748
|
+
if (!a) return;
|
|
1749
|
+
let t = r.findWrapping(e.type), n;
|
|
1750
|
+
if (!t) return a = null;
|
|
1751
|
+
if (n = a.length && i.length && qt(t, i, e, a[a.length - 1], 0)) a[a.length - 1] = n;
|
|
1752
1752
|
else {
|
|
1753
|
-
|
|
1753
|
+
a.length && (a[a.length - 1] = Jt(a[a.length - 1], i.length));
|
|
1754
1754
|
let n = Kt(e, t);
|
|
1755
|
-
|
|
1755
|
+
a.push(n), r = r.matchType(n.type), i = t;
|
|
1756
1756
|
}
|
|
1757
|
-
}),
|
|
1757
|
+
}), a) return o.from(a);
|
|
1758
1758
|
}
|
|
1759
1759
|
return e;
|
|
1760
1760
|
}
|
|
1761
|
-
function Kt(e, t,
|
|
1762
|
-
for (let
|
|
1761
|
+
function Kt(e, t, n = 0) {
|
|
1762
|
+
for (let r = t.length - 1; r >= n; r--) e = t[r].create(null, o.from(e));
|
|
1763
1763
|
return e;
|
|
1764
1764
|
}
|
|
1765
|
-
function qt(e, t, r, i
|
|
1766
|
-
if (
|
|
1767
|
-
let
|
|
1768
|
-
if (
|
|
1769
|
-
if (
|
|
1765
|
+
function qt(e, t, n, r, i) {
|
|
1766
|
+
if (i < e.length && i < t.length && e[i] == t[i]) {
|
|
1767
|
+
let a = qt(e, t, n, r.lastChild, i + 1);
|
|
1768
|
+
if (a) return r.copy(r.content.replaceChild(r.childCount - 1, a));
|
|
1769
|
+
if (r.contentMatchAt(r.childCount).matchType(i == e.length - 1 ? n.type : e[i + 1])) return r.copy(r.content.append(o.from(Kt(n, e, i + 1))));
|
|
1770
1770
|
}
|
|
1771
1771
|
}
|
|
1772
1772
|
function Jt(e, t) {
|
|
1773
1773
|
if (t == 0) return e;
|
|
1774
|
-
let
|
|
1775
|
-
return e.copy(
|
|
1774
|
+
let n = e.content.replaceChild(e.childCount - 1, Jt(e.lastChild, t - 1)), r = e.contentMatchAt(e.childCount).fillBefore(o.empty, !0);
|
|
1775
|
+
return e.copy(n.append(r));
|
|
1776
1776
|
}
|
|
1777
|
-
function Yt(e, t, r, i, a
|
|
1777
|
+
function Yt(e, t, n, r, i, a) {
|
|
1778
1778
|
let s = t < 0 ? e.firstChild : e.lastChild, c = s.content;
|
|
1779
|
-
return e.childCount > 1 && (
|
|
1779
|
+
return e.childCount > 1 && (a = 0), i < r - 1 && (c = Yt(c, t, n, r, i + 1, a)), i >= n && (c = t < 0 ? s.contentMatchAt(0).fillBefore(c, a <= i).append(c) : c.append(s.contentMatchAt(s.childCount).fillBefore(o.empty, !0))), e.replaceChild(t < 0 ? 0 : e.childCount - 1, s.copy(c));
|
|
1780
1780
|
}
|
|
1781
1781
|
function Xt(e, t, n) {
|
|
1782
|
-
return t < e.openStart && (e = new
|
|
1782
|
+
return t < e.openStart && (e = new c(Yt(e.content, -1, t, e.openStart, 0, e.openEnd), t, e.openEnd)), n < e.openEnd && (e = new c(Yt(e.content, 1, n, e.openEnd, 0, 0), e.openStart, n)), e;
|
|
1783
1783
|
}
|
|
1784
1784
|
var Zt = {
|
|
1785
1785
|
thead: ["table"],
|
|
@@ -1841,24 +1841,24 @@ function nn(e) {
|
|
|
1841
1841
|
}
|
|
1842
1842
|
function rn(e, t) {
|
|
1843
1843
|
if (!e.size) return e;
|
|
1844
|
-
let
|
|
1844
|
+
let n = e.content.firstChild.type.schema, r;
|
|
1845
1845
|
try {
|
|
1846
|
-
|
|
1846
|
+
r = JSON.parse(t);
|
|
1847
1847
|
} catch {
|
|
1848
1848
|
return e;
|
|
1849
1849
|
}
|
|
1850
|
-
let { content:
|
|
1851
|
-
for (let e =
|
|
1852
|
-
let t =
|
|
1850
|
+
let { content: i, openStart: a, openEnd: s } = e;
|
|
1851
|
+
for (let e = r.length - 2; e >= 0; e -= 2) {
|
|
1852
|
+
let t = n.nodes[r[e]];
|
|
1853
1853
|
if (!t || t.hasRequiredAttrs()) break;
|
|
1854
1854
|
try {
|
|
1855
|
-
t.checkAttrs(
|
|
1855
|
+
t.checkAttrs(r[e + 1]);
|
|
1856
1856
|
} catch {
|
|
1857
1857
|
break;
|
|
1858
1858
|
}
|
|
1859
|
-
|
|
1859
|
+
i = o.from(t.create(r[e + 1], i)), a++, s++;
|
|
1860
1860
|
}
|
|
1861
|
-
return new i
|
|
1861
|
+
return new c(i, a, s);
|
|
1862
1862
|
}
|
|
1863
1863
|
var G = {}, K = {}, an = {
|
|
1864
1864
|
touchstart: !0,
|
|
@@ -1930,10 +1930,10 @@ K.keydown = (e, t) => {
|
|
|
1930
1930
|
n.preventDefault();
|
|
1931
1931
|
return;
|
|
1932
1932
|
}
|
|
1933
|
-
let
|
|
1934
|
-
if (!(
|
|
1935
|
-
let t = String.fromCharCode(n.charCode),
|
|
1936
|
-
!/[\r\n]/.test(t) && !e.someProp("handleTextInput", (n) => n(e,
|
|
1933
|
+
let i = e.state.selection;
|
|
1934
|
+
if (!(i instanceof r) || !i.$from.sameParent(i.$to)) {
|
|
1935
|
+
let t = String.fromCharCode(n.charCode), r = () => e.state.tr.insertText(t).scrollIntoView();
|
|
1936
|
+
!/[\r\n]/.test(t) && !e.someProp("handleTextInput", (n) => n(e, i.$from.pos, i.$to.pos, t, r)) && e.dispatch(r()), n.preventDefault();
|
|
1937
1937
|
}
|
|
1938
1938
|
};
|
|
1939
1939
|
function pn(e) {
|
|
@@ -1957,24 +1957,24 @@ function gn(e, t, n) {
|
|
|
1957
1957
|
let r = e.state.tr.setSelection(t);
|
|
1958
1958
|
n == "pointer" && r.setMeta("pointer", !0), e.dispatch(r);
|
|
1959
1959
|
}
|
|
1960
|
-
function _n(e,
|
|
1961
|
-
if (
|
|
1962
|
-
let
|
|
1963
|
-
return
|
|
1964
|
-
}
|
|
1965
|
-
function vn(e,
|
|
1966
|
-
if (
|
|
1967
|
-
let
|
|
1968
|
-
|
|
1969
|
-
let
|
|
1970
|
-
for (let e =
|
|
1971
|
-
let
|
|
1972
|
-
if (
|
|
1973
|
-
|
|
1960
|
+
function _n(e, n) {
|
|
1961
|
+
if (n == -1) return !1;
|
|
1962
|
+
let r = e.state.doc.resolve(n), i = r.nodeAfter;
|
|
1963
|
+
return i && i.isAtom && t.isSelectable(i) ? (gn(e, new t(r), "pointer"), !0) : !1;
|
|
1964
|
+
}
|
|
1965
|
+
function vn(e, n) {
|
|
1966
|
+
if (n == -1) return !1;
|
|
1967
|
+
let r = e.state.selection, i, a;
|
|
1968
|
+
r instanceof t && (i = r.node);
|
|
1969
|
+
let o = e.state.doc.resolve(n);
|
|
1970
|
+
for (let e = o.depth + 1; e > 0; e--) {
|
|
1971
|
+
let n = e > o.depth ? o.nodeAfter : o.node(e);
|
|
1972
|
+
if (t.isSelectable(n)) {
|
|
1973
|
+
a = i && r.$from.depth > 0 && e >= r.$from.depth && o.before(r.$from.depth + 1) == r.$from.pos ? o.before(r.$from.depth) : o.before(e);
|
|
1974
1974
|
break;
|
|
1975
1975
|
}
|
|
1976
1976
|
}
|
|
1977
|
-
return
|
|
1977
|
+
return a != null && (gn(e, t.create(e.state.doc, a), "pointer"), !0);
|
|
1978
1978
|
}
|
|
1979
1979
|
function yn(e, t, n, r, i) {
|
|
1980
1980
|
return hn(e, "handleClickOn", t, n, r) || e.someProp("handleClick", (n) => n(e, t, r)) || (i ? vn(e, n) : _n(e, n));
|
|
@@ -1987,17 +1987,17 @@ function xn(e, t, n, r) {
|
|
|
1987
1987
|
}
|
|
1988
1988
|
function Sn(e, t, n) {
|
|
1989
1989
|
if (n.button != 0) return !1;
|
|
1990
|
-
let
|
|
1991
|
-
return
|
|
1992
|
-
}
|
|
1993
|
-
function Cn(e,
|
|
1994
|
-
let
|
|
1995
|
-
if (
|
|
1996
|
-
let
|
|
1997
|
-
for (let e =
|
|
1998
|
-
let
|
|
1999
|
-
if (
|
|
2000
|
-
if (
|
|
1990
|
+
let i = Cn(e, t, !0), a = e.state.doc;
|
|
1991
|
+
return i ? (gn(e, i, "pointer"), i instanceof r && a.eq(e.state.doc) && (e.input.mouseDown = new On(e, i)), !0) : !1;
|
|
1992
|
+
}
|
|
1993
|
+
function Cn(e, n, i) {
|
|
1994
|
+
let a = e.state.doc;
|
|
1995
|
+
if (n == -1) return a.inlineContent ? r.create(a, 0, a.content.size) : null;
|
|
1996
|
+
let o = a.resolve(n);
|
|
1997
|
+
for (let e = o.depth + 1; e > 0; e--) {
|
|
1998
|
+
let n = e > o.depth ? o.nodeAfter : o.node(e), s = o.before(e);
|
|
1999
|
+
if (n.inlineContent) return r.create(a, s + 1, s + 1 + n.content.size);
|
|
2000
|
+
if (i && t.isSelectable(n)) return t.create(a, s);
|
|
2001
2001
|
}
|
|
2002
2002
|
return null;
|
|
2003
2003
|
}
|
|
@@ -2036,21 +2036,21 @@ var En = class {
|
|
|
2036
2036
|
return !1;
|
|
2037
2037
|
}
|
|
2038
2038
|
}, Dn = class extends En {
|
|
2039
|
-
constructor(e,
|
|
2040
|
-
super(e), this.pos =
|
|
2041
|
-
let
|
|
2042
|
-
if (
|
|
2039
|
+
constructor(e, n, r, i) {
|
|
2040
|
+
super(e), this.pos = n, this.event = r, this.flushed = i, this.delayedSelectionSync = !1, this.startDoc = e.state.doc, this.selectNode = !!r[Tn], this.allowDefault = r.shiftKey;
|
|
2041
|
+
let a, o;
|
|
2042
|
+
if (n.inside > -1) a = e.state.doc.nodeAt(n.inside), o = n.inside;
|
|
2043
2043
|
else {
|
|
2044
|
-
let
|
|
2045
|
-
|
|
2044
|
+
let t = e.state.doc.resolve(n.pos);
|
|
2045
|
+
a = t.parent, o = t.depth ? t.before() : 0;
|
|
2046
2046
|
}
|
|
2047
|
-
let
|
|
2047
|
+
let s = i ? null : r.target, c = s ? e.docView.nearestDesc(s, !0) : null;
|
|
2048
2048
|
this.target = c && c.nodeDOM.nodeType == 1 ? c.nodeDOM : null;
|
|
2049
2049
|
let { selection: l } = e.state;
|
|
2050
|
-
|
|
2051
|
-
node:
|
|
2052
|
-
pos:
|
|
2053
|
-
addAttr:
|
|
2050
|
+
r.button == 0 && (a.type.spec.draggable && a.type.spec.selectable !== !1 || l instanceof t && l.from <= o && l.to > o) && (this.mightDrag = {
|
|
2051
|
+
node: a,
|
|
2052
|
+
pos: o,
|
|
2053
|
+
addAttr: !(!this.target || this.target.draggable),
|
|
2054
2054
|
setUneditable: !!(this.target && O && !this.target.hasAttribute("contentEditable"))
|
|
2055
2055
|
}), this.target && this.mightDrag && (this.mightDrag.addAttr || this.mightDrag.setUneditable) && (this.view.domObserver.stop(), this.mightDrag.addAttr && (this.target.draggable = !0), this.mightDrag.setUneditable && setTimeout(() => {
|
|
2056
2056
|
this.view.input.mouseDown == this && this.target.setAttribute("contentEditable", "false");
|
|
@@ -2064,7 +2064,7 @@ var En = class {
|
|
|
2064
2064
|
up(e) {
|
|
2065
2065
|
if (this.done(), !this.view.dom.contains(e.target)) return;
|
|
2066
2066
|
let t = this.pos;
|
|
2067
|
-
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(pn(e))), this.updateAllowDefault(e), this.allowDefault || !t ? q(this.view, "pointer") : yn(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || A && this.mightDrag && !this.mightDrag.node.isAtom || k && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (gn(this.view,
|
|
2067
|
+
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(pn(e))), this.updateAllowDefault(e), this.allowDefault || !t ? q(this.view, "pointer") : yn(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || A && this.mightDrag && !this.mightDrag.node.isAtom || k && !this.view.state.selection.visible && Math.min(Math.abs(t.pos - this.view.state.selection.from), Math.abs(t.pos - this.view.state.selection.to)) <= 2) ? (gn(this.view, n.near(this.view.state.doc.resolve(t.pos)), "pointer"), e.preventDefault()) : q(this.view, "pointer");
|
|
2068
2068
|
}
|
|
2069
2069
|
move(e) {
|
|
2070
2070
|
this.updateAllowDefault(e), q(this.view, "pointer"), super.move(e);
|
|
@@ -2087,8 +2087,8 @@ var En = class {
|
|
|
2087
2087
|
e.preventDefault(), q(this.view, "pointer");
|
|
2088
2088
|
let t = this.view.posAtCoords(pn(e)), n = t && Cn(this.view, t.inside, !1);
|
|
2089
2089
|
if (!n) return;
|
|
2090
|
-
let { doc:
|
|
2091
|
-
gn(this.view,
|
|
2090
|
+
let { doc: i } = this.view.state, a = this.startSelection, [o, s] = n.from < a.from ? [a.to, n.from] : [a.from, n.to];
|
|
2091
|
+
gn(this.view, r.create(i, o, s), "pointer");
|
|
2092
2092
|
}
|
|
2093
2093
|
};
|
|
2094
2094
|
G.touchstart = (e) => {
|
|
@@ -2104,7 +2104,7 @@ K.compositionstart = K.compositionupdate = (e) => {
|
|
|
2104
2104
|
if (!e.composing) {
|
|
2105
2105
|
e.domObserver.flush();
|
|
2106
2106
|
let { state: t } = e, n = t.selection.$to;
|
|
2107
|
-
if (t.selection instanceof
|
|
2107
|
+
if (t.selection instanceof r && (t.storedMarks || !n.textOffset && n.parentOffset && n.nodeBefore.marks.some((e) => e.type.spec.inclusive === !1) || k && le && jn(e))) e.markCursor = e.state.storedMarks || n.marks(), Fn(e, !0), e.markCursor = null;
|
|
2108
2108
|
else if (Fn(e, !t.selection.empty), O && t.selection.empty && n.parentOffset && !n.textOffset && n.nodeBefore.marks.length) {
|
|
2109
2109
|
let t = e.domSelectionRange();
|
|
2110
2110
|
for (let n = t.focusNode, r = t.focusOffset; n && n.nodeType == 1 && r != 0;) {
|
|
@@ -2147,7 +2147,7 @@ function Pn(e) {
|
|
|
2147
2147
|
if (!t || !t.isText(r.nodeValue)) return r;
|
|
2148
2148
|
if (e.input.compositionNode == r) {
|
|
2149
2149
|
let e = n.pmViewDesc;
|
|
2150
|
-
if (
|
|
2150
|
+
if (e && e.isText(n.nodeValue)) return r;
|
|
2151
2151
|
}
|
|
2152
2152
|
}
|
|
2153
2153
|
return n || r;
|
|
@@ -2189,12 +2189,12 @@ function zn(e, t) {
|
|
|
2189
2189
|
e.focus(), r.parentNode && r.parentNode.removeChild(r), n ? Bn(e, r.value, null, i, t) : Bn(e, r.textContent, r.innerHTML, i, t);
|
|
2190
2190
|
}, 50);
|
|
2191
2191
|
}
|
|
2192
|
-
function Bn(e, t, n, r,
|
|
2193
|
-
let
|
|
2194
|
-
if (e.someProp("handlePaste", (t) => t(e,
|
|
2195
|
-
if (!
|
|
2196
|
-
let
|
|
2197
|
-
return e.dispatch(
|
|
2192
|
+
function Bn(e, t, n, r, i) {
|
|
2193
|
+
let a = Ut(e, t, n, r, e.state.selection.$from);
|
|
2194
|
+
if (e.someProp("handlePaste", (t) => t(e, i, a || c.empty))) return !0;
|
|
2195
|
+
if (!a) return !1;
|
|
2196
|
+
let o = Rn(a), s = o ? e.state.tr.replaceSelectionWith(o, r) : e.state.tr.replaceSelection(a);
|
|
2197
|
+
return e.dispatch(s.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
|
|
2198
2198
|
}
|
|
2199
2199
|
function Vn(e) {
|
|
2200
2200
|
let t = e.getData("text/plain") || e.getData("Text");
|
|
@@ -2219,19 +2219,19 @@ function Wn(e, t) {
|
|
|
2219
2219
|
n ||= e(t);
|
|
2220
2220
|
}), n == null ? !t[Un] : !n;
|
|
2221
2221
|
}
|
|
2222
|
-
G.dragstart = (e,
|
|
2223
|
-
let
|
|
2224
|
-
if (
|
|
2225
|
-
let
|
|
2226
|
-
if (!(
|
|
2227
|
-
if (
|
|
2228
|
-
else if (
|
|
2229
|
-
let
|
|
2230
|
-
|
|
2222
|
+
G.dragstart = (e, n) => {
|
|
2223
|
+
let r = n, i = e.input.mouseDown;
|
|
2224
|
+
if (i && i.done(), !r.dataTransfer) return;
|
|
2225
|
+
let a = e.state.selection, o = a.empty ? null : e.posAtCoords(pn(r)), s;
|
|
2226
|
+
if (!(o && o.pos >= a.from && o.pos <= (a instanceof t ? a.to - 1 : a.to))) {
|
|
2227
|
+
if (i && i.mightDrag) s = t.create(e.state.doc, i.mightDrag.pos);
|
|
2228
|
+
else if (r.target && r.target.nodeType == 1) {
|
|
2229
|
+
let n = e.docView.nearestDesc(r.target, !0);
|
|
2230
|
+
n && n.node.type.spec.draggable && n != e.docView && (s = t.create(e.state.doc, n.posBefore));
|
|
2231
2231
|
}
|
|
2232
2232
|
}
|
|
2233
|
-
let { dom: c, text: l, slice: u } = Ht(e, (
|
|
2234
|
-
(!
|
|
2233
|
+
let { dom: c, text: l, slice: u } = Ht(e, (s || e.state.selection).content());
|
|
2234
|
+
(!r.dataTransfer.files.length || !k || ce > 120) && r.dataTransfer.clearData(), r.dataTransfer.setData(Ln ? "Text" : "text/html", c.innerHTML), r.dataTransfer.effectAllowed = "copyMove", Ln || r.dataTransfer.setData("text/plain", l), e.dragging = new Hn(u, Wn(e, r), s);
|
|
2235
2235
|
}, G.dragend = (e) => {
|
|
2236
2236
|
let t = e.dragging;
|
|
2237
2237
|
window.setTimeout(() => {
|
|
@@ -2244,32 +2244,32 @@ G.dragstart = (e, t) => {
|
|
|
2244
2244
|
e.dragging = null;
|
|
2245
2245
|
}
|
|
2246
2246
|
};
|
|
2247
|
-
function Gn(e,
|
|
2248
|
-
if (!
|
|
2249
|
-
let
|
|
2250
|
-
if (!
|
|
2251
|
-
let
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
}) :
|
|
2255
|
-
let
|
|
2256
|
-
if (e.someProp("handleDrop", (
|
|
2257
|
-
|
|
2247
|
+
function Gn(e, n, r) {
|
|
2248
|
+
if (!n.dataTransfer) return;
|
|
2249
|
+
let i = e.posAtCoords(pn(n));
|
|
2250
|
+
if (!i) return;
|
|
2251
|
+
let a = e.state.doc.resolve(i.pos), o = r && r.slice;
|
|
2252
|
+
o ? e.someProp("transformPasted", (t) => {
|
|
2253
|
+
o = t(o, e, !1);
|
|
2254
|
+
}) : o = Ut(e, Vn(n.dataTransfer), Ln ? null : n.dataTransfer.getData("text/html"), !1, a);
|
|
2255
|
+
let s = !!(r && Wn(e, n));
|
|
2256
|
+
if (e.someProp("handleDrop", (t) => t(e, n, o || c.empty, s))) {
|
|
2257
|
+
n.preventDefault();
|
|
2258
2258
|
return;
|
|
2259
2259
|
}
|
|
2260
|
-
if (!
|
|
2261
|
-
|
|
2262
|
-
let u =
|
|
2263
|
-
u ??=
|
|
2260
|
+
if (!o) return;
|
|
2261
|
+
n.preventDefault();
|
|
2262
|
+
let u = o ? l(e.state.doc, a.pos, o) : a.pos;
|
|
2263
|
+
u ??= a.pos;
|
|
2264
2264
|
let d = e.state.tr;
|
|
2265
|
-
if (
|
|
2266
|
-
let { node: e } =
|
|
2265
|
+
if (s) {
|
|
2266
|
+
let { node: e } = r;
|
|
2267
2267
|
e ? e.replace(d) : d.deleteSelection();
|
|
2268
2268
|
}
|
|
2269
|
-
let f = d.mapping.map(u), p =
|
|
2270
|
-
if (p ? d.replaceRangeWith(f, f,
|
|
2269
|
+
let f = d.mapping.map(u), p = o.openStart == 0 && o.openEnd == 0 && o.content.childCount == 1, m = d.doc;
|
|
2270
|
+
if (p ? d.replaceRangeWith(f, f, o.content.firstChild) : d.replaceRange(f, f, o), d.doc.eq(m)) return;
|
|
2271
2271
|
let h = d.doc.resolve(f);
|
|
2272
|
-
if (p &&
|
|
2272
|
+
if (p && t.isSelectable(o.content.firstChild) && h.nodeAfter && h.nodeAfter.sameMarkup(o.content.firstChild)) d.setSelection(new t(h));
|
|
2273
2273
|
else {
|
|
2274
2274
|
let t = d.mapping.map(u);
|
|
2275
2275
|
d.mapping.maps[d.mapping.maps.length - 1].forEach((e, n, r, i) => t = i), d.setSelection(xt(e, h, d.doc.resolve(t)));
|
|
@@ -2640,12 +2640,11 @@ function rr(e) {
|
|
|
2640
2640
|
let r = t[n];
|
|
2641
2641
|
if (r.from != r.to) for (let i = n + 1; i < t.length; i++) {
|
|
2642
2642
|
let a = t[i];
|
|
2643
|
-
if (a.from == r.from)
|
|
2644
|
-
|
|
2645
|
-
|
|
2643
|
+
if (a.from == r.from) a.to != r.to && (t == e && (t = e.slice()), t[i] = a.copy(a.from, r.to), ir(t, i + 1, a.copy(r.to, a.to)));
|
|
2644
|
+
else {
|
|
2645
|
+
a.from < r.to && (t == e && (t = e.slice()), t[n] = r.copy(r.from, a.from), ir(t, i, r.copy(a.from, r.to)));
|
|
2646
|
+
break;
|
|
2646
2647
|
}
|
|
2647
|
-
a.from < r.to && (t == e && (t = e.slice()), t[n] = r.copy(r.from, a.from), ir(t, i, r.copy(a.from, r.to)));
|
|
2648
|
-
break;
|
|
2649
2648
|
}
|
|
2650
2649
|
}
|
|
2651
2650
|
return t;
|
|
@@ -2761,13 +2760,13 @@ var or = {
|
|
|
2761
2760
|
if (!e.docView || this.flushingSoon > -1) return;
|
|
2762
2761
|
let t = this.pendingRecords();
|
|
2763
2762
|
t.length && (this.queue = []);
|
|
2764
|
-
let
|
|
2763
|
+
let r = e.domSelectionRange(), i = !this.suppressingSelectionUpdates && !this.currentSelection.eq(r) && St(e) && !this.ignoreSelectionChange(r), a = -1, o = -1, s = !1, c = [];
|
|
2765
2764
|
if (e.editable) for (let e = 0; e < t.length; e++) {
|
|
2766
|
-
let n = this.registerMutation(t[e],
|
|
2767
|
-
n && (
|
|
2765
|
+
let n = this.registerMutation(t[e], c);
|
|
2766
|
+
n && (a = a < 0 ? n.from : Math.min(n.from, a), o = o < 0 ? n.to : Math.max(n.to, o), n.typeOver && (s = !0));
|
|
2768
2767
|
}
|
|
2769
|
-
if (
|
|
2770
|
-
for (let e of
|
|
2768
|
+
if (c.some((e) => e.nodeName == "BR") && (e.input.lastKeyCode == 8 || e.input.lastKeyCode == 46 || k && (e.composing || e.input.compositionEndedAt > Date.now() - 50) && t.some((e) => e.type == "childList" && e.removedNodes.length))) {
|
|
2769
|
+
for (let e of c) if (e.nodeName == "BR" && e.parentNode) {
|
|
2771
2770
|
let t = e.nextSibling;
|
|
2772
2771
|
for (; t && t.nodeType == 1;) {
|
|
2773
2772
|
if (t.contentEditable == "false") {
|
|
@@ -2777,8 +2776,8 @@ var or = {
|
|
|
2777
2776
|
t = t.firstChild;
|
|
2778
2777
|
}
|
|
2779
2778
|
}
|
|
2780
|
-
} else if (O &&
|
|
2781
|
-
let t =
|
|
2779
|
+
} else if (O && c.length) {
|
|
2780
|
+
let t = c.filter((e) => e.nodeName == "BR");
|
|
2782
2781
|
if (t.length == 2) {
|
|
2783
2782
|
let [e, n] = t;
|
|
2784
2783
|
e.parentNode && e.parentNode.parentNode == n.parentNode ? n.remove() : e.remove();
|
|
@@ -2791,7 +2790,7 @@ var or = {
|
|
|
2791
2790
|
}
|
|
2792
2791
|
}
|
|
2793
2792
|
let l = null;
|
|
2794
|
-
|
|
2793
|
+
a < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && S(r) && (l = dt(e)) && l.eq(n.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, H(e), this.currentSelection.set(r), e.scrollToSelection()) : (a > -1 || i) && (a > -1 && (e.docView.markDirty(a, o), fr(e)), e.input.badSafariComposition && (e.input.badSafariComposition = !1, gr(e, c)), this.handleDOMChange(a, o, s, c), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || H(e), this.currentSelection.set(r));
|
|
2795
2794
|
}
|
|
2796
2795
|
registerMutation(e, t) {
|
|
2797
2796
|
if (t.indexOf(e.target) > -1) return null;
|
|
@@ -2885,15 +2884,15 @@ function gr(e, t) {
|
|
|
2885
2884
|
} else i.parentNode.removeChild(i);
|
|
2886
2885
|
}
|
|
2887
2886
|
}
|
|
2888
|
-
function _r(t, n, r
|
|
2889
|
-
let { node: a, fromOffset: o, toOffset: s, from: c, to: l } =
|
|
2890
|
-
if (f &&
|
|
2887
|
+
function _r(e, t, n, r) {
|
|
2888
|
+
let { node: a, fromOffset: o, toOffset: s, from: c, to: l } = e.docView.parseRange(t, n), u = e.domSelectionRange(), d, f = u.anchorNode;
|
|
2889
|
+
if (f && e.dom.contains(f.nodeType == 1 ? f : f.parentNode) && (d = [{
|
|
2891
2890
|
node: f,
|
|
2892
2891
|
offset: u.anchorOffset
|
|
2893
2892
|
}], S(u) || d.push({
|
|
2894
2893
|
node: u.focusNode,
|
|
2895
2894
|
offset: u.focusOffset
|
|
2896
|
-
})), k &&
|
|
2895
|
+
})), k && e.input.lastKeyCode === 8) for (let e = s; e > o; e--) {
|
|
2897
2896
|
let t = a.childNodes[e - 1], n = t.pmViewDesc;
|
|
2898
2897
|
if (t.nodeName == "BR" && !n) {
|
|
2899
2898
|
s = e;
|
|
@@ -2901,7 +2900,7 @@ function _r(t, n, r, i) {
|
|
|
2901
2900
|
}
|
|
2902
2901
|
if (!n || n.size) break;
|
|
2903
2902
|
}
|
|
2904
|
-
let p =
|
|
2903
|
+
let p = e.state.doc, m = e.someProp("domParser") || i.fromSchema(e.state.schema), h = p.resolve(c), g = null, _ = m.parse(a, {
|
|
2905
2904
|
topNode: h.parent,
|
|
2906
2905
|
topMatch: h.parent.contentMatchAt(h.index()),
|
|
2907
2906
|
topOpen: !0,
|
|
@@ -2909,7 +2908,7 @@ function _r(t, n, r, i) {
|
|
|
2909
2908
|
to: s,
|
|
2910
2909
|
preserveWhitespace: h.parent.type.whitespace != "pre" || "full",
|
|
2911
2910
|
findPositions: d,
|
|
2912
|
-
ruleFromNode: vr(
|
|
2911
|
+
ruleFromNode: vr(r),
|
|
2913
2912
|
context: h
|
|
2914
2913
|
});
|
|
2915
2914
|
if (d && d[0].pos != null) {
|
|
@@ -2938,46 +2937,46 @@ var vr = (e) => (t) => {
|
|
|
2938
2937
|
} else if (t.nodeName == "IMG" && t.getAttribute("mark-placeholder")) return { ignore: !0 };
|
|
2939
2938
|
return null;
|
|
2940
2939
|
}, yr = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
|
|
2941
|
-
function br(e, t, n,
|
|
2942
|
-
let
|
|
2940
|
+
function br(e, t, n, i, a) {
|
|
2941
|
+
let o = e.input.compositionPendingChanges || (e.composing ? e.input.compositionID : 0);
|
|
2943
2942
|
if (e.input.compositionPendingChanges = 0, t < 0) {
|
|
2944
2943
|
let t = e.input.lastSelectionTime > Date.now() - 50 ? e.input.lastSelectionOrigin : null, n = dt(e, t);
|
|
2945
2944
|
if (n && !e.state.selection.eq(n)) {
|
|
2946
2945
|
if (k && N && e.input.lastKeyCode === 13 && Date.now() - 100 < e.input.lastKeyCodeTime && e.someProp("handleKeyDown", (t) => t(e, C(13, "Enter")))) return;
|
|
2947
2946
|
let r = e.state.tr.setSelection(n);
|
|
2948
|
-
t == "pointer" ? r.setMeta("pointer", !0) : t == "key" && r.scrollIntoView(),
|
|
2947
|
+
t == "pointer" ? r.setMeta("pointer", !0) : t == "key" && r.scrollIntoView(), o && r.setMeta("composition", o), e.dispatch(r);
|
|
2949
2948
|
}
|
|
2950
2949
|
return;
|
|
2951
2950
|
}
|
|
2952
|
-
let
|
|
2953
|
-
t =
|
|
2954
|
-
let
|
|
2951
|
+
let s = e.state.doc.resolve(t), c = s.sharedDepth(n);
|
|
2952
|
+
t = s.before(c + 1), n = e.state.doc.resolve(n).after(c + 1);
|
|
2953
|
+
let l = e.state.selection, u = _r(e, t, n, a), d = e.state.doc, f = d.slice(u.from, u.to), p, m;
|
|
2955
2954
|
e.input.lastKeyCode === 8 && Date.now() - 100 < e.input.lastKeyCodeTime ? (p = e.state.selection.to, m = "end") : (p = e.state.selection.from, m = "start"), e.input.lastKeyCode = null;
|
|
2956
2955
|
let h = Tr(f.content, u.doc.content, u.from, p, m);
|
|
2957
|
-
if (h && e.input.domChangeCount++, (j && e.input.lastIOSEnter > Date.now() - 225 || N) &&
|
|
2956
|
+
if (h && e.input.domChangeCount++, (j && e.input.lastIOSEnter > Date.now() - 225 || N) && a.some((e) => e.nodeType == 1 && !yr.test(e.nodeName)) && (!h || h.endA >= h.endB) && e.someProp("handleKeyDown", (t) => t(e, C(13, "Enter")))) {
|
|
2958
2957
|
e.input.lastIOSEnter = 0;
|
|
2959
2958
|
return;
|
|
2960
2959
|
}
|
|
2961
2960
|
if (!h) {
|
|
2962
|
-
if (
|
|
2963
|
-
start:
|
|
2964
|
-
endA:
|
|
2965
|
-
endB:
|
|
2961
|
+
if (i && l instanceof r && !l.empty && l.$head.sameParent(l.$anchor) && !e.composing && !(u.sel && u.sel.anchor != u.sel.head)) h = {
|
|
2962
|
+
start: l.from,
|
|
2963
|
+
endA: l.to,
|
|
2964
|
+
endB: l.to
|
|
2966
2965
|
};
|
|
2967
2966
|
else {
|
|
2968
2967
|
if (u.sel) {
|
|
2969
2968
|
let t = xr(e, e.state.doc, u.sel);
|
|
2970
2969
|
if (t && !t.eq(e.state.selection)) {
|
|
2971
2970
|
let n = e.state.tr.setSelection(t);
|
|
2972
|
-
|
|
2971
|
+
o && n.setMeta("composition", o), e.dispatch(n);
|
|
2973
2972
|
}
|
|
2974
2973
|
}
|
|
2975
2974
|
return;
|
|
2976
2975
|
}
|
|
2977
2976
|
}
|
|
2978
|
-
e.state.selection.from < e.state.selection.to && h.start == h.endB && e.state.selection instanceof
|
|
2977
|
+
e.state.selection.from < e.state.selection.to && h.start == h.endB && e.state.selection instanceof r && (h.start > e.state.selection.from && h.start <= e.state.selection.from + 2 && e.state.selection.from >= u.from ? h.start = e.state.selection.from : h.endA < e.state.selection.to && h.endA >= e.state.selection.to - 2 && e.state.selection.to <= u.to && (h.endB += e.state.selection.to - h.endA, h.endA = e.state.selection.to)), E && D <= 11 && h.endB == h.start + 1 && h.endA == h.start && h.start > u.from && u.doc.textBetween(h.start - u.from - 1, h.start - u.from + 1) == " \xA0" && (h.start--, h.endA--, h.endB--);
|
|
2979
2978
|
let g = u.doc.resolveNoCache(h.start - u.from), _ = u.doc.resolveNoCache(h.endB - u.from), v = d.resolve(h.start), ee = g.sameParent(_) && g.parent.inlineContent && v.end() >= h.endA;
|
|
2980
|
-
if ((j && e.input.lastIOSEnter > Date.now() - 225 && (!ee ||
|
|
2979
|
+
if ((j && e.input.lastIOSEnter > Date.now() - 225 && (!ee || a.some((e) => e.nodeName == "DIV" || e.nodeName == "P")) || !ee && g.pos < u.doc.content.size && (!g.sameParent(_) || !g.parent.inlineContent) && g.pos < _.pos && !/\S/.test(u.doc.textBetween(g.pos, _.pos, "", ""))) && e.someProp("handleKeyDown", (t) => t(e, C(13, "Enter")))) {
|
|
2981
2980
|
e.input.lastIOSEnter = 0;
|
|
2982
2981
|
return;
|
|
2983
2982
|
}
|
|
@@ -2996,7 +2995,7 @@ function br(e, t, n, r, i) {
|
|
|
2996
2995
|
let t = xr(e, n.doc, u.sel);
|
|
2997
2996
|
t && !(k && e.composing && t.empty && (h.start != h.endB || e.input.lastChromeDelete < Date.now() - 100) && (t.head == y || t.head == n.mapping.map(b) - 1) || E && t.empty && t.head == y) && n.setSelection(t);
|
|
2998
2997
|
}
|
|
2999
|
-
return
|
|
2998
|
+
return o && n.setMeta("composition", o), n.scrollIntoView();
|
|
3000
2999
|
}, S;
|
|
3001
3000
|
if (ee) {
|
|
3002
3001
|
if (g.pos == _.pos) {
|
|
@@ -3016,15 +3015,15 @@ function xr(e, t, n) {
|
|
|
3016
3015
|
return Math.max(n.anchor, n.head) > t.content.size ? null : xt(e, t.resolve(n.anchor), t.resolve(n.head));
|
|
3017
3016
|
}
|
|
3018
3017
|
function Sr(e, t) {
|
|
3019
|
-
let
|
|
3020
|
-
for (let e = 0; e <
|
|
3021
|
-
for (let e = 0; e <
|
|
3022
|
-
if (
|
|
3023
|
-
else if (
|
|
3018
|
+
let n = e.firstChild.marks, r = t.firstChild.marks, i = n, a = r, s, c, l;
|
|
3019
|
+
for (let e = 0; e < r.length; e++) i = r[e].removeFromSet(i);
|
|
3020
|
+
for (let e = 0; e < n.length; e++) a = n[e].removeFromSet(a);
|
|
3021
|
+
if (i.length == 1 && a.length == 0) c = i[0], s = "add", l = (e) => e.mark(c.addToSet(e.marks));
|
|
3022
|
+
else if (i.length == 0 && a.length == 1) c = a[0], s = "remove", l = (e) => e.mark(c.removeFromSet(e.marks));
|
|
3024
3023
|
else return null;
|
|
3025
3024
|
let u = [];
|
|
3026
3025
|
for (let e = 0; e < t.childCount; e++) u.push(l(t.child(e)));
|
|
3027
|
-
if (
|
|
3026
|
+
if (o.from(u).eq(e)) return {
|
|
3028
3027
|
mark: c,
|
|
3029
3028
|
type: s
|
|
3030
3029
|
};
|
|
@@ -3118,7 +3117,7 @@ var Er = class {
|
|
|
3118
3117
|
let t = l && (E || k) && !this.composing && !n.selection.empty && !e.selection.empty && Ar(n.selection, e.selection);
|
|
3119
3118
|
if (l) {
|
|
3120
3119
|
let n = k ? this.trackWrites = this.domSelectionRange().focusNode : null;
|
|
3121
|
-
this.composing && (this.input.compositionNode = Pn(this)), (r || !this.docView.update(e.doc, s, o, this)) && (this.docView.updateOuterDeco(s), this.docView.destroy(), this.docView = Ke(e.doc, s, o, this.dom, this)), n
|
|
3120
|
+
this.composing && (this.input.compositionNode = Pn(this)), (r || !this.docView.update(e.doc, s, o, this)) && (this.docView.updateOuterDeco(s), this.docView.destroy(), this.docView = Ke(e.doc, s, o, this.dom, this)), !n || this.trackWrites && this.dom.contains(this.trackWrites) || (t = !0);
|
|
3122
3121
|
}
|
|
3123
3122
|
let i = this.input.mouseDown;
|
|
3124
3123
|
t || !(i && this.domObserver.currentSelection.eq(this.domSelectionRange()) && wt(this) && i.delaySelUpdate()) ? H(this, t) : (yt(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
|
|
@@ -3127,8 +3126,8 @@ var Er = class {
|
|
|
3127
3126
|
}
|
|
3128
3127
|
scrollToSelection() {
|
|
3129
3128
|
let e = this.domSelectionRange().focusNode;
|
|
3130
|
-
if (
|
|
3131
|
-
if (this.state.selection instanceof
|
|
3129
|
+
if (e && this.dom.contains(e.nodeType == 1 ? e : e.parentNode) && !this.someProp("handleScrollToSelection", (e) => e(this))) {
|
|
3130
|
+
if (this.state.selection instanceof t) {
|
|
3132
3131
|
let t = this.docView.domAfterPos(this.state.selection.from);
|
|
3133
3132
|
t.nodeType == 1 && me(this, t.getBoundingClientRect(), e);
|
|
3134
3133
|
} else me(this, this.coordsAtPos(this.state.selection.head, 1), e);
|
|
@@ -3154,14 +3153,14 @@ var Er = class {
|
|
|
3154
3153
|
n.update && n.update(this, e);
|
|
3155
3154
|
}
|
|
3156
3155
|
}
|
|
3157
|
-
updateDraggedNode(e,
|
|
3158
|
-
let
|
|
3159
|
-
if (
|
|
3156
|
+
updateDraggedNode(e, n) {
|
|
3157
|
+
let r = e.node, i = -1;
|
|
3158
|
+
if (r.from < this.state.doc.content.size && this.state.doc.nodeAt(r.from) == r.node) i = r.from;
|
|
3160
3159
|
else {
|
|
3161
|
-
let e =
|
|
3162
|
-
(e > 0 && e < this.state.doc.content.size && this.state.doc.nodeAt(e)) ==
|
|
3160
|
+
let e = r.from + (this.state.doc.content.size - n.doc.content.size);
|
|
3161
|
+
(e > 0 && e < this.state.doc.content.size && this.state.doc.nodeAt(e)) == r.node && (i = e);
|
|
3163
3162
|
}
|
|
3164
|
-
this.dragging = new Hn(e.slice, e.move,
|
|
3163
|
+
this.dragging = new Hn(e.slice, e.move, i < 0 ? void 0 : t.create(this.state.doc, i));
|
|
3165
3164
|
}
|
|
3166
3165
|
someProp(e, t) {
|
|
3167
3166
|
let n = this._props && this._props[e], r;
|
|
@@ -3302,7 +3301,6 @@ function Mr(e, t) {
|
|
|
3302
3301
|
function Nr(e) {
|
|
3303
3302
|
if (e.spec.state || e.spec.filterTransaction || e.spec.appendTransaction) throw RangeError("Plugins passed directly to the view must not have a state component");
|
|
3304
3303
|
}
|
|
3305
|
-
//#endregion
|
|
3306
3304
|
export { J as Decoration, Z as DecorationSet, Er as EditorView };
|
|
3307
3305
|
|
|
3308
3306
|
//# sourceMappingURL=index.js.map
|