@dialpad/dialtone-vue 3.110.0 → 3.110.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/CHANGELOG.json +1 -1
- package/CHANGELOG.md +22 -0
- package/dist/component-documentation.json +1 -1
- package/dist/dialtone-vue.cjs +2 -2
- package/dist/dialtone-vue.js +25 -28
- package/dist/{emoji-Sc_SzVCR.js → emoji-acqIsOA0.js} +1 -1
- package/dist/emoji-gFUvTgzf.cjs +1 -0
- package/dist/emoji.cjs +1 -1
- package/dist/emoji.js +3 -3
- package/dist/{emoji_picker-CZ0cEXh2.js → emoji_picker-7KBwg94e.js} +1 -1
- package/dist/{emoji_picker-grujwrLW.cjs → emoji_picker-XmAzvsvD.cjs} +1 -1
- package/dist/{emoji_text_wrapper-f58KMEzk.cjs → emoji_text_wrapper-Cr15_VcH.cjs} +1 -1
- package/dist/{emoji_text_wrapper-PsH5vDPn.js → emoji_text_wrapper-TK25xXF3.js} +1 -1
- package/dist/message_input.cjs +1 -1
- package/dist/message_input.js +3 -3
- package/dist/{rich_text_editor-g3YVFGwk.cjs → rich_text_editor-2jqjuGrZ.cjs} +17 -17
- package/dist/{rich_text_editor-ILEwVbEw.js → rich_text_editor-NWAFxCaY.js} +714 -694
- package/dist/style.css +1 -1
- package/dist/types/components/avatar/avatar.vue.d.ts +29 -11
- package/dist/types/components/avatar/avatar.vue.d.ts.map +1 -1
- package/dist/types/components/list_item/list_item.vue.d.ts +2 -0
- package/dist/types/components/list_item/list_item.vue.d.ts.map +1 -1
- package/dist/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts +4 -2
- package/dist/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts.map +1 -1
- package/dist/types/recipes/item_layout/contact_info/contact_info.vue.d.ts +11 -11
- package/dist/types/recipes/leftbar/callbox/callbox.vue.d.ts +4 -4
- package/dist/types/recipes/leftbar/contact_row/contact_row.vue.d.ts +0 -17
- package/dist/types/recipes/leftbar/contact_row/contact_row.vue.d.ts.map +1 -1
- package/package.json +5 -4
- package/dist/emoji-czIMeeWW.cjs +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as de, g as gi, d as Ga, h as qi, u as Ya, T as Xa, B as Qa, e as Za, i as ec, j as tc, k as nc, l as Es, t as Cr, m as rc, n as ic } from "./tooltip-Od71Luh6.js";
|
|
2
|
-
import { B as sc, w as Er, I as oc, L as lc, C as ac, t as el, D as tl, E as cc, m as dc, o as nl } from "./emoji-
|
|
2
|
+
import { B as sc, w as Er, I as oc, L as lc, C as ac, t as el, D as tl, E as cc, m as dc, o as nl } from "./emoji-acqIsOA0.js";
|
|
3
3
|
import { openBlock as O, createElementBlock as j, toDisplayString as ut, createCommentVNode as J, createElementVNode as ht, normalizeClass as X, resolveComponent as $, createBlock as z, resolveDynamicComponent as kt, withCtx as q, mergeProps as Tr, renderSlot as se, withKeys as Ot, withModifiers as Xt, createVNode as nt, toHandlers as rl, createSlots as uc, renderList as il, Teleport as sl, defineComponent as $t, ref as Mr, onMounted as ol, onBeforeUnmount as Ki, h as ft, getCurrentInstance as hc, watchEffect as fc, nextTick as pc, unref as mc, markRaw as wr, reactive as ll, provide as Ts, customRef as gc, withDirectives as yc, Fragment as bc, vShow as kc, createTextVNode as Wi } from "vue";
|
|
4
4
|
const Ut = {
|
|
5
5
|
BUSY: "busy",
|
|
@@ -227,12 +227,13 @@ const Dc = (n) => {
|
|
|
227
227
|
default: ""
|
|
228
228
|
},
|
|
229
229
|
/**
|
|
230
|
-
* Alt attribute of the image,
|
|
231
|
-
*
|
|
230
|
+
* Alt attribute of the image, required if imageSrc is provided.
|
|
231
|
+
* Can be set to '' (empty string) if the image is described
|
|
232
|
+
* in text nearby
|
|
232
233
|
*/
|
|
233
234
|
imageAlt: {
|
|
234
235
|
type: String,
|
|
235
|
-
default:
|
|
236
|
+
default: void 0
|
|
236
237
|
},
|
|
237
238
|
/**
|
|
238
239
|
* Icon name to be displayed on the avatar
|
|
@@ -252,7 +253,7 @@ const Dc = (n) => {
|
|
|
252
253
|
validator: (n) => !n || Object.keys(oc).includes(n)
|
|
253
254
|
},
|
|
254
255
|
/**
|
|
255
|
-
* Full name used to extract initials
|
|
256
|
+
* Full name used to extract initials.
|
|
256
257
|
*/
|
|
257
258
|
fullName: {
|
|
258
259
|
type: String,
|
|
@@ -265,6 +266,14 @@ const Dc = (n) => {
|
|
|
265
266
|
clickable: {
|
|
266
267
|
type: Boolean,
|
|
267
268
|
default: !1
|
|
269
|
+
},
|
|
270
|
+
/**
|
|
271
|
+
* Descriptive label for the icon.
|
|
272
|
+
* To avoid a11y issues, set this prop if clickable and iconName are set.
|
|
273
|
+
*/
|
|
274
|
+
iconAriaLabel: {
|
|
275
|
+
type: String,
|
|
276
|
+
default: void 0
|
|
268
277
|
}
|
|
269
278
|
},
|
|
270
279
|
emits: [
|
|
@@ -320,17 +329,25 @@ const Dc = (n) => {
|
|
|
320
329
|
},
|
|
321
330
|
showImage() {
|
|
322
331
|
return this.imageLoadedSuccessfully !== !1 && this.imageSrc;
|
|
323
|
-
},
|
|
324
|
-
buttonAriaLabel() {
|
|
325
|
-
if (this.clickable)
|
|
326
|
-
return this.fullName || this.imageAlt || this.$attrs["aria-label"];
|
|
327
332
|
}
|
|
328
333
|
},
|
|
329
334
|
watch: {
|
|
330
335
|
fullName: {
|
|
331
336
|
immediate: !0,
|
|
332
|
-
handler(
|
|
333
|
-
this.formatInitials(
|
|
337
|
+
handler() {
|
|
338
|
+
this.formatInitials();
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
size: {
|
|
342
|
+
immediate: !0,
|
|
343
|
+
handler() {
|
|
344
|
+
this.formatInitials();
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
group: {
|
|
348
|
+
immediate: !0,
|
|
349
|
+
handler() {
|
|
350
|
+
this.formatInitials();
|
|
334
351
|
}
|
|
335
352
|
},
|
|
336
353
|
imageSrc(n) {
|
|
@@ -346,9 +363,9 @@ const Dc = (n) => {
|
|
|
346
363
|
const n = this.$refs.avatarImage;
|
|
347
364
|
n && (n.addEventListener("load", () => this._loadedImageEventHandler(n), { once: !0 }), n.addEventListener("error", () => this._erroredImageEventHandler(n), { once: !0 }));
|
|
348
365
|
},
|
|
349
|
-
formatInitials(
|
|
350
|
-
const
|
|
351
|
-
this.validatedSize === "xs" ? this.formattedInitials = "" : this.validatedSize === "sm" ? this.formattedInitials =
|
|
366
|
+
formatInitials() {
|
|
367
|
+
const n = Dc(this.fullName);
|
|
368
|
+
this.validatedSize === "xs" ? this.formattedInitials = "" : this.validatedSize === "sm" ? this.formattedInitials = n[0] : this.formattedInitials = n;
|
|
352
369
|
},
|
|
353
370
|
getColor() {
|
|
354
371
|
return this.color ?? Ga(Ac, this.seed);
|
|
@@ -360,7 +377,7 @@ const Dc = (n) => {
|
|
|
360
377
|
this.imageLoadedSuccessfully = !1, n.classList.add("d-d-none");
|
|
361
378
|
},
|
|
362
379
|
validateProps() {
|
|
363
|
-
if (this.imageSrc &&
|
|
380
|
+
if (this.imageSrc && this.imageAlt === void 0)
|
|
364
381
|
throw new Error("full-name or image-alt must be set if image-src is provided");
|
|
365
382
|
},
|
|
366
383
|
handleClick(n) {
|
|
@@ -381,7 +398,6 @@ function _c(n, e, t, r, i, s) {
|
|
|
381
398
|
id: t.id,
|
|
382
399
|
class: X(s.avatarClasses),
|
|
383
400
|
"data-qa": "dt-avatar",
|
|
384
|
-
"aria-label": s.buttonAriaLabel,
|
|
385
401
|
onClick: s.handleClick
|
|
386
402
|
}, {
|
|
387
403
|
default: q(() => [
|
|
@@ -399,14 +415,15 @@ function _c(n, e, t, r, i, s) {
|
|
|
399
415
|
class: "d-avatar__image",
|
|
400
416
|
"data-qa": "dt-avatar-image",
|
|
401
417
|
src: t.imageSrc,
|
|
402
|
-
alt: t.imageAlt
|
|
418
|
+
alt: t.imageAlt
|
|
403
419
|
}, null, 8, Pc)) : t.iconName ? (O(), z(o, {
|
|
404
420
|
key: 1,
|
|
405
421
|
name: t.iconName,
|
|
422
|
+
"aria-label": t.iconAriaLabel,
|
|
406
423
|
size: t.iconSize || i.AVATAR_ICON_SIZES[t.size],
|
|
407
424
|
class: X([t.iconClass, i.AVATAR_KIND_MODIFIERS.icon]),
|
|
408
425
|
"data-qa": "dt-avatar-icon"
|
|
409
|
-
}, null, 8, ["name", "size", "class"])) : (O(), j("span", {
|
|
426
|
+
}, null, 8, ["name", "aria-label", "size", "class"])) : (O(), j("span", {
|
|
410
427
|
key: 2,
|
|
411
428
|
class: X([i.AVATAR_KIND_MODIFIERS.initials])
|
|
412
429
|
}, ut(i.formattedInitials), 3))
|
|
@@ -432,7 +449,7 @@ function _c(n, e, t, r, i, s) {
|
|
|
432
449
|
}, t.presenceProps, { "data-qa": "dt-presence" }), null, 16, ["presence", "class"])) : J("", !0)
|
|
433
450
|
]),
|
|
434
451
|
_: 1
|
|
435
|
-
}, 8, ["id", "class", "
|
|
452
|
+
}, 8, ["id", "class", "onClick"]);
|
|
436
453
|
}
|
|
437
454
|
const Fc = /* @__PURE__ */ de(Rc, [["render", _c]]), zc = {
|
|
438
455
|
name: "DtLink",
|
|
@@ -696,7 +713,7 @@ function rd(n, e, t, r, i, s) {
|
|
|
696
713
|
_: 3
|
|
697
714
|
}, 8, ["class"]);
|
|
698
715
|
}
|
|
699
|
-
const Os = /* @__PURE__ */ de(Yc, [["render", rd]]), id = {
|
|
716
|
+
const Os = /* @__PURE__ */ de(Yc, [["render", rd]]), id = ["listitem", "option"], sd = {
|
|
700
717
|
name: "DtListItem",
|
|
701
718
|
components: {
|
|
702
719
|
DtItemLayout: Os,
|
|
@@ -723,7 +740,8 @@ const Os = /* @__PURE__ */ de(Yc, [["render", rd]]), id = {
|
|
|
723
740
|
*/
|
|
724
741
|
role: {
|
|
725
742
|
type: String,
|
|
726
|
-
default: "listitem"
|
|
743
|
+
default: "listitem",
|
|
744
|
+
validator: (n) => id.includes(n)
|
|
727
745
|
},
|
|
728
746
|
/**
|
|
729
747
|
* HTML element type (tag name) of the content wrapper element.
|
|
@@ -847,7 +865,7 @@ const Os = /* @__PURE__ */ de(Yc, [["render", rd]]), id = {
|
|
|
847
865
|
}
|
|
848
866
|
}
|
|
849
867
|
};
|
|
850
|
-
function
|
|
868
|
+
function od(n, e, t, r, i, s) {
|
|
851
869
|
const o = $("dt-icon");
|
|
852
870
|
return O(), z(kt(t.elementType), Tr({
|
|
853
871
|
id: t.id,
|
|
@@ -858,7 +876,7 @@ function sd(n, e, t, r, i, s) {
|
|
|
858
876
|
}],
|
|
859
877
|
tabindex: s.isFocusable ? 0 : -1,
|
|
860
878
|
role: t.role,
|
|
861
|
-
"aria-selected": s.isHighlighted
|
|
879
|
+
"aria-selected": t.role === "option" ? s.isHighlighted : void 0
|
|
862
880
|
}, rl(s.listItemListeners)), {
|
|
863
881
|
default: q(() => [
|
|
864
882
|
s.listItemType ? (O(), z(kt(s.listItemType), { key: 0 }, uc({ _: 2 }, [
|
|
@@ -884,7 +902,7 @@ function sd(n, e, t, r, i, s) {
|
|
|
884
902
|
_: 3
|
|
885
903
|
}, 16, ["id", "class", "tabindex", "role", "aria-selected"]);
|
|
886
904
|
}
|
|
887
|
-
const
|
|
905
|
+
const ld = /* @__PURE__ */ de(sd, [["render", od]]), St = {
|
|
888
906
|
default: "column",
|
|
889
907
|
column: "column",
|
|
890
908
|
row: "row",
|
|
@@ -895,16 +913,16 @@ const od = /* @__PURE__ */ de(id, [["render", sd]]), St = {
|
|
|
895
913
|
small: "d-p4",
|
|
896
914
|
medium: "d-p8",
|
|
897
915
|
large: "d-p16"
|
|
898
|
-
},
|
|
916
|
+
}, ad = {
|
|
899
917
|
none: void 0,
|
|
900
918
|
small: "d-pl4",
|
|
901
919
|
medium: "d-pl8",
|
|
902
920
|
large: "d-pl16"
|
|
903
|
-
},
|
|
921
|
+
}, cd = ["dialog", "menu", "listbox", "tree", "grid"], dd = ["", "anchor"], ud = ["none", "dialog", "first"], hd = ["parent", "body"], fd = [
|
|
904
922
|
...Xa
|
|
905
|
-
],
|
|
923
|
+
], gy = [
|
|
906
924
|
...Qa
|
|
907
|
-
],
|
|
925
|
+
], pd = {
|
|
908
926
|
name: "PopoverHeaderFooter",
|
|
909
927
|
components: {
|
|
910
928
|
DtButton: el,
|
|
@@ -965,7 +983,7 @@ const od = /* @__PURE__ */ de(id, [["render", sd]]), St = {
|
|
|
965
983
|
}
|
|
966
984
|
}
|
|
967
985
|
};
|
|
968
|
-
function
|
|
986
|
+
function md(n, e, t, r, i, s) {
|
|
969
987
|
const o = $("dt-icon"), l = $("dt-button");
|
|
970
988
|
return O(), j("div", {
|
|
971
989
|
"data-qa": "dt-popover-header-footer",
|
|
@@ -1008,7 +1026,7 @@ function pd(n, e, t, r, i, s) {
|
|
|
1008
1026
|
}, 16, ["class"])) : J("", !0)
|
|
1009
1027
|
], 2);
|
|
1010
1028
|
}
|
|
1011
|
-
const
|
|
1029
|
+
const gd = /* @__PURE__ */ de(pd, [["render", md]]), yd = {
|
|
1012
1030
|
name: "DtPopover",
|
|
1013
1031
|
/********************
|
|
1014
1032
|
* CHILD COMPONENTS *
|
|
@@ -1016,7 +1034,7 @@ const md = /* @__PURE__ */ de(fd, [["render", pd]]), gd = {
|
|
|
1016
1034
|
components: {
|
|
1017
1035
|
SrOnlyCloseButton: Wc,
|
|
1018
1036
|
DtLazyShow: Za,
|
|
1019
|
-
PopoverHeaderFooter:
|
|
1037
|
+
PopoverHeaderFooter: gd
|
|
1020
1038
|
},
|
|
1021
1039
|
mixins: [Gc, jc],
|
|
1022
1040
|
props: {
|
|
@@ -1061,7 +1079,7 @@ const md = /* @__PURE__ */ de(fd, [["render", pd]]), gd = {
|
|
|
1061
1079
|
role: {
|
|
1062
1080
|
type: String,
|
|
1063
1081
|
default: "dialog",
|
|
1064
|
-
validator: (n) =>
|
|
1082
|
+
validator: (n) => cd.includes(n)
|
|
1065
1083
|
},
|
|
1066
1084
|
/**
|
|
1067
1085
|
* ID of the element that serves as the label for the popover content.
|
|
@@ -1114,7 +1132,7 @@ const md = /* @__PURE__ */ de(fd, [["render", pd]]), gd = {
|
|
|
1114
1132
|
contentWidth: {
|
|
1115
1133
|
type: String,
|
|
1116
1134
|
default: "",
|
|
1117
|
-
validator: (n) =>
|
|
1135
|
+
validator: (n) => dd.includes(n)
|
|
1118
1136
|
},
|
|
1119
1137
|
/**
|
|
1120
1138
|
* Whether to apply transition on initial render in the content lazy show component.
|
|
@@ -1248,7 +1266,7 @@ const md = /* @__PURE__ */ de(fd, [["render", pd]]), gd = {
|
|
|
1248
1266
|
sticky: {
|
|
1249
1267
|
type: [Boolean, String],
|
|
1250
1268
|
default: !1,
|
|
1251
|
-
validator: (n) =>
|
|
1269
|
+
validator: (n) => fd.includes(n)
|
|
1252
1270
|
},
|
|
1253
1271
|
/**
|
|
1254
1272
|
* Determines maximum height for the popover before overflow.
|
|
@@ -1306,7 +1324,7 @@ const md = /* @__PURE__ */ de(fd, [["render", pd]]), gd = {
|
|
|
1306
1324
|
initialFocusElement: {
|
|
1307
1325
|
type: [String, HTMLElement],
|
|
1308
1326
|
default: "first",
|
|
1309
|
-
validator: (n) =>
|
|
1327
|
+
validator: (n) => ud.includes(n) || n instanceof HTMLElement || n.startsWith("#")
|
|
1310
1328
|
},
|
|
1311
1329
|
/**
|
|
1312
1330
|
* If the popover should open pressing up or down arrow key on the anchor element.
|
|
@@ -1325,7 +1343,7 @@ const md = /* @__PURE__ */ de(fd, [["render", pd]]), gd = {
|
|
|
1325
1343
|
appendTo: {
|
|
1326
1344
|
type: [HTMLElement, String],
|
|
1327
1345
|
default: "body",
|
|
1328
|
-
validator: (n) =>
|
|
1346
|
+
validator: (n) => hd.includes(n) || n instanceof HTMLElement
|
|
1329
1347
|
},
|
|
1330
1348
|
/**
|
|
1331
1349
|
* Set this prop to true and popover component will support hovercard behaviour
|
|
@@ -1371,7 +1389,7 @@ const md = /* @__PURE__ */ de(fd, [["render", pd]]), gd = {
|
|
|
1371
1389
|
data() {
|
|
1372
1390
|
return {
|
|
1373
1391
|
POPOVER_PADDING_CLASSES: vs,
|
|
1374
|
-
POPOVER_HEADER_FOOTER_PADDING_CLASSES:
|
|
1392
|
+
POPOVER_HEADER_FOOTER_PADDING_CLASSES: ad,
|
|
1375
1393
|
intersectionObserver: null,
|
|
1376
1394
|
isOutsideViewport: !1,
|
|
1377
1395
|
isOpen: !1,
|
|
@@ -1551,10 +1569,12 @@ const md = /* @__PURE__ */ de(fd, [["render", pd]]), gd = {
|
|
|
1551
1569
|
* since it is no longer the active modal. This puts it underneath the overlay and prevents scrolling.
|
|
1552
1570
|
**/
|
|
1553
1571
|
preventScrolling() {
|
|
1554
|
-
var n;
|
|
1572
|
+
var n, e;
|
|
1555
1573
|
if (this.modal) {
|
|
1556
|
-
const
|
|
1557
|
-
|
|
1574
|
+
const t = (n = this.anchorEl) == null ? void 0 : n.closest("body, .tippy-box");
|
|
1575
|
+
if (!t)
|
|
1576
|
+
return;
|
|
1577
|
+
((e = t.tagName) == null ? void 0 : e.toLowerCase()) === "body" ? (t.classList.add("d-of-hidden"), this.tip.setProps({ offset: this.offset })) : t.classList.add("d-zi-popover");
|
|
1558
1578
|
}
|
|
1559
1579
|
},
|
|
1560
1580
|
/*
|
|
@@ -1654,8 +1674,8 @@ const md = /* @__PURE__ */ de(fd, [["render", pd]]), gd = {
|
|
|
1654
1674
|
// $ HOVERCARD
|
|
1655
1675
|
// ----------------------------------------------------------------------------
|
|
1656
1676
|
}
|
|
1657
|
-
},
|
|
1658
|
-
function
|
|
1677
|
+
}, bd = ["aria-hidden"], kd = ["id", "data-qa", "tabindex"], Sd = ["data-qa"];
|
|
1678
|
+
function xd(n, e, t, r, i, s) {
|
|
1659
1679
|
const o = $("popover-header-footer"), l = $("sr-only-close-button"), a = $("dt-lazy-show");
|
|
1660
1680
|
return O(), j("div", null, [
|
|
1661
1681
|
t.modal && i.isOpen ? (O(), z(sl, {
|
|
@@ -1667,7 +1687,7 @@ function Sd(n, e, t, r, i, s) {
|
|
|
1667
1687
|
"aria-hidden": t.modal && i.isOpen ? "false" : "true",
|
|
1668
1688
|
onClick: e[0] || (e[0] = Xt(() => {
|
|
1669
1689
|
}, ["prevent", "stop"]))
|
|
1670
|
-
}, null, 8,
|
|
1690
|
+
}, null, 8, bd)
|
|
1671
1691
|
])) : J("", !0),
|
|
1672
1692
|
(O(), z(kt(t.elementType), {
|
|
1673
1693
|
ref: "popover",
|
|
@@ -1699,7 +1719,7 @@ function Sd(n, e, t, r, i, s) {
|
|
|
1699
1719
|
"aria-haspopup": t.role
|
|
1700
1720
|
}
|
|
1701
1721
|
})
|
|
1702
|
-
], 40,
|
|
1722
|
+
], 40, kd),
|
|
1703
1723
|
nt(a, Tr({
|
|
1704
1724
|
id: t.id,
|
|
1705
1725
|
ref: "content",
|
|
@@ -1749,7 +1769,7 @@ function Sd(n, e, t, r, i, s) {
|
|
|
1749
1769
|
])
|
|
1750
1770
|
}, [
|
|
1751
1771
|
se(n.$slots, "content", { close: s.closePopover })
|
|
1752
|
-
], 10,
|
|
1772
|
+
], 10, Sd),
|
|
1753
1773
|
i.hasSlotContent(n.$slots.footerContent) ? (O(), z(o, {
|
|
1754
1774
|
key: 1,
|
|
1755
1775
|
ref: "popover__footer",
|
|
@@ -1775,7 +1795,7 @@ function Sd(n, e, t, r, i, s) {
|
|
|
1775
1795
|
}, 8, ["class"]))
|
|
1776
1796
|
]);
|
|
1777
1797
|
}
|
|
1778
|
-
const
|
|
1798
|
+
const yy = /* @__PURE__ */ de(yd, [["render", xd]]);
|
|
1779
1799
|
function As(n) {
|
|
1780
1800
|
return n === St.default;
|
|
1781
1801
|
}
|
|
@@ -1791,18 +1811,18 @@ function Ns(n) {
|
|
|
1791
1811
|
function ln(n) {
|
|
1792
1812
|
return typeof n;
|
|
1793
1813
|
}
|
|
1794
|
-
function
|
|
1814
|
+
function Cd(n) {
|
|
1795
1815
|
return Ns(n) ? `d-stack--${St[Ns(n)]}` : null;
|
|
1796
1816
|
}
|
|
1797
|
-
function
|
|
1817
|
+
function Ed(n) {
|
|
1798
1818
|
return ln(n) === "object" ? [
|
|
1799
1819
|
...cl.map((e) => n[e] ? `d-stack--${e}--${n[e]}` : null)
|
|
1800
1820
|
] : null;
|
|
1801
1821
|
}
|
|
1802
|
-
function
|
|
1822
|
+
function Td(n) {
|
|
1803
1823
|
return Ui.includes(n) ? `d-stack--gap-${n}` : null;
|
|
1804
1824
|
}
|
|
1805
|
-
function
|
|
1825
|
+
function Md(n) {
|
|
1806
1826
|
if (ln(n) === "string")
|
|
1807
1827
|
return Object.keys(St).includes(n);
|
|
1808
1828
|
if (ln(n) === "object") {
|
|
@@ -1811,10 +1831,10 @@ function Td(n) {
|
|
|
1811
1831
|
} else
|
|
1812
1832
|
return null;
|
|
1813
1833
|
}
|
|
1814
|
-
function
|
|
1834
|
+
function wd(n) {
|
|
1815
1835
|
return Ui.includes(n);
|
|
1816
1836
|
}
|
|
1817
|
-
const
|
|
1837
|
+
const Od = {
|
|
1818
1838
|
name: "DtStack",
|
|
1819
1839
|
props: {
|
|
1820
1840
|
/**
|
|
@@ -1828,7 +1848,7 @@ const wd = {
|
|
|
1828
1848
|
direction: {
|
|
1829
1849
|
type: [String, Object],
|
|
1830
1850
|
default: "column",
|
|
1831
|
-
validator: (n) =>
|
|
1851
|
+
validator: (n) => Md(n)
|
|
1832
1852
|
},
|
|
1833
1853
|
/**
|
|
1834
1854
|
* Set this prop to render stack as a specific HTML element.
|
|
@@ -1844,7 +1864,7 @@ const wd = {
|
|
|
1844
1864
|
gap: {
|
|
1845
1865
|
type: String,
|
|
1846
1866
|
default: "0",
|
|
1847
|
-
validator: (n) =>
|
|
1867
|
+
validator: (n) => wd(n)
|
|
1848
1868
|
}
|
|
1849
1869
|
},
|
|
1850
1870
|
data() {
|
|
@@ -1856,17 +1876,17 @@ const wd = {
|
|
|
1856
1876
|
},
|
|
1857
1877
|
computed: {
|
|
1858
1878
|
stackGap() {
|
|
1859
|
-
return
|
|
1879
|
+
return Td(this.gap);
|
|
1860
1880
|
},
|
|
1861
1881
|
defaultDirection() {
|
|
1862
|
-
return
|
|
1882
|
+
return Cd(this.direction);
|
|
1863
1883
|
},
|
|
1864
1884
|
stackResponsive() {
|
|
1865
|
-
return
|
|
1885
|
+
return Ed(this.direction);
|
|
1866
1886
|
}
|
|
1867
1887
|
}
|
|
1868
1888
|
};
|
|
1869
|
-
function
|
|
1889
|
+
function vd(n, e, t, r, i, s) {
|
|
1870
1890
|
return O(), z(kt(t.as), {
|
|
1871
1891
|
class: X([
|
|
1872
1892
|
"d-stack",
|
|
@@ -1881,7 +1901,7 @@ function Od(n, e, t, r, i, s) {
|
|
|
1881
1901
|
_: 3
|
|
1882
1902
|
}, 8, ["class"]);
|
|
1883
1903
|
}
|
|
1884
|
-
const dl = /* @__PURE__ */ de(
|
|
1904
|
+
const dl = /* @__PURE__ */ de(Od, [["render", vd]]);
|
|
1885
1905
|
function U(n) {
|
|
1886
1906
|
this.content = n;
|
|
1887
1907
|
}
|
|
@@ -2522,7 +2542,7 @@ function pl(n, e, t, r) {
|
|
|
2522
2542
|
let l = pl(o.content, e - s - 1, t);
|
|
2523
2543
|
return l && n.replaceChild(i, o.copy(l));
|
|
2524
2544
|
}
|
|
2525
|
-
function
|
|
2545
|
+
function Ad(n, e, t) {
|
|
2526
2546
|
if (t.openStart > n.depth)
|
|
2527
2547
|
throw new Pn("Inserted content deeper than insertion position");
|
|
2528
2548
|
if (n.depth - t.openStart != e.depth - t.openEnd)
|
|
@@ -2539,7 +2559,7 @@ function ml(n, e, t, r) {
|
|
|
2539
2559
|
let o = n.parent, l = o.content;
|
|
2540
2560
|
return mt(o, l.cut(0, n.parentOffset).append(t.content).append(l.cut(e.parentOffset)));
|
|
2541
2561
|
} else {
|
|
2542
|
-
let { start: o, end: l } =
|
|
2562
|
+
let { start: o, end: l } = Nd(t, n);
|
|
2543
2563
|
return mt(s, yl(n, o, l, e, r));
|
|
2544
2564
|
}
|
|
2545
2565
|
else
|
|
@@ -2579,7 +2599,7 @@ function Ln(n, e, t) {
|
|
|
2579
2599
|
}
|
|
2580
2600
|
return Qt(e, null, t, r), new b(r);
|
|
2581
2601
|
}
|
|
2582
|
-
function
|
|
2602
|
+
function Nd(n, e) {
|
|
2583
2603
|
let t = e.depth - n.openStart, i = e.node(t).copy(n.content);
|
|
2584
2604
|
for (let s = t - 1; s >= 0; s--)
|
|
2585
2605
|
i = e.node(s).copy(b.from(i));
|
|
@@ -2828,10 +2848,10 @@ class an {
|
|
|
2828
2848
|
return s;
|
|
2829
2849
|
}
|
|
2830
2850
|
let r = Wr[Ur] = an.resolve(e, t);
|
|
2831
|
-
return Ur = (Ur + 1) %
|
|
2851
|
+
return Ur = (Ur + 1) % Dd, r;
|
|
2832
2852
|
}
|
|
2833
2853
|
}
|
|
2834
|
-
let Wr = [], Ur = 0,
|
|
2854
|
+
let Wr = [], Ur = 0, Dd = 12;
|
|
2835
2855
|
class Bn {
|
|
2836
2856
|
/**
|
|
2837
2857
|
Construct a node range. `$from` and `$to` should point into the
|
|
@@ -2872,7 +2892,7 @@ class Bn {
|
|
|
2872
2892
|
return this.$to.indexAfter(this.depth);
|
|
2873
2893
|
}
|
|
2874
2894
|
}
|
|
2875
|
-
const
|
|
2895
|
+
const Id = /* @__PURE__ */ Object.create(null);
|
|
2876
2896
|
let gt = class ki {
|
|
2877
2897
|
/**
|
|
2878
2898
|
@internal
|
|
@@ -2985,7 +3005,7 @@ let gt = class ki {
|
|
|
2985
3005
|
attributes, and marks.
|
|
2986
3006
|
*/
|
|
2987
3007
|
hasMarkup(e, t, r) {
|
|
2988
|
-
return this.type == e && Rn(this.attrs, t || e.defaultAttrs ||
|
|
3008
|
+
return this.type == e && Rn(this.attrs, t || e.defaultAttrs || Id) && B.sameSet(this.marks, r || B.none);
|
|
2989
3009
|
}
|
|
2990
3010
|
/**
|
|
2991
3011
|
Create a new node with the same markup as this node, containing
|
|
@@ -3028,7 +3048,7 @@ let gt = class ki {
|
|
|
3028
3048
|
[`ReplaceError`](https://prosemirror.net/docs/ref/#model.ReplaceError) is thrown.
|
|
3029
3049
|
*/
|
|
3030
3050
|
replace(e, t, r) {
|
|
3031
|
-
return
|
|
3051
|
+
return Ad(this.resolve(e), this.resolve(t), r);
|
|
3032
3052
|
}
|
|
3033
3053
|
/**
|
|
3034
3054
|
Find the node directly after the given position.
|
|
@@ -3289,13 +3309,13 @@ class xt {
|
|
|
3289
3309
|
@internal
|
|
3290
3310
|
*/
|
|
3291
3311
|
static parse(e, t) {
|
|
3292
|
-
let r = new
|
|
3312
|
+
let r = new Rd(e, t);
|
|
3293
3313
|
if (r.next == null)
|
|
3294
3314
|
return xt.empty;
|
|
3295
3315
|
let i = kl(r);
|
|
3296
3316
|
r.next && r.err("Unexpected trailing text");
|
|
3297
|
-
let s = zd(
|
|
3298
|
-
return
|
|
3317
|
+
let s = Hd(zd(i));
|
|
3318
|
+
return Vd(s, r), s;
|
|
3299
3319
|
}
|
|
3300
3320
|
/**
|
|
3301
3321
|
Match a node type, returning a match after that node if
|
|
@@ -3441,7 +3461,7 @@ class xt {
|
|
|
3441
3461
|
}
|
|
3442
3462
|
}
|
|
3443
3463
|
xt.empty = new xt(!0);
|
|
3444
|
-
class
|
|
3464
|
+
class Rd {
|
|
3445
3465
|
constructor(e, t) {
|
|
3446
3466
|
this.string = e, this.nodeTypes = t, this.inline = null, this.pos = 0, this.tokens = e.split(/\s*(?=\b|\W|$)/), this.tokens[this.tokens.length - 1] == "" && this.tokens.pop(), this.tokens[0] == "" && this.tokens.shift();
|
|
3447
3467
|
}
|
|
@@ -3458,19 +3478,19 @@ class Id {
|
|
|
3458
3478
|
function kl(n) {
|
|
3459
3479
|
let e = [];
|
|
3460
3480
|
do
|
|
3461
|
-
e.push(
|
|
3481
|
+
e.push(Pd(n));
|
|
3462
3482
|
while (n.eat("|"));
|
|
3463
3483
|
return e.length == 1 ? e[0] : { type: "choice", exprs: e };
|
|
3464
3484
|
}
|
|
3465
|
-
function
|
|
3485
|
+
function Pd(n) {
|
|
3466
3486
|
let e = [];
|
|
3467
3487
|
do
|
|
3468
|
-
e.push(
|
|
3488
|
+
e.push(Ld(n));
|
|
3469
3489
|
while (n.next && n.next != ")" && n.next != "|");
|
|
3470
3490
|
return e.length == 1 ? e[0] : { type: "seq", exprs: e };
|
|
3471
3491
|
}
|
|
3472
|
-
function
|
|
3473
|
-
let e =
|
|
3492
|
+
function Ld(n) {
|
|
3493
|
+
let e = Fd(n);
|
|
3474
3494
|
for (; ; )
|
|
3475
3495
|
if (n.eat("+"))
|
|
3476
3496
|
e = { type: "plus", expr: e };
|
|
@@ -3479,7 +3499,7 @@ function Pd(n) {
|
|
|
3479
3499
|
else if (n.eat("?"))
|
|
3480
3500
|
e = { type: "opt", expr: e };
|
|
3481
3501
|
else if (n.eat("{"))
|
|
3482
|
-
e =
|
|
3502
|
+
e = Bd(n, e);
|
|
3483
3503
|
else
|
|
3484
3504
|
break;
|
|
3485
3505
|
return e;
|
|
@@ -3489,11 +3509,11 @@ function Ds(n) {
|
|
|
3489
3509
|
let e = Number(n.next);
|
|
3490
3510
|
return n.pos++, e;
|
|
3491
3511
|
}
|
|
3492
|
-
function
|
|
3512
|
+
function Bd(n, e) {
|
|
3493
3513
|
let t = Ds(n), r = t;
|
|
3494
3514
|
return n.eat(",") && (n.next != "}" ? r = Ds(n) : r = -1), n.eat("}") || n.err("Unclosed braced range"), { type: "range", min: t, max: r, expr: e };
|
|
3495
3515
|
}
|
|
3496
|
-
function
|
|
3516
|
+
function _d(n, e) {
|
|
3497
3517
|
let t = n.nodeTypes, r = t[e];
|
|
3498
3518
|
if (r)
|
|
3499
3519
|
return [r];
|
|
@@ -3504,18 +3524,18 @@ function Bd(n, e) {
|
|
|
3504
3524
|
}
|
|
3505
3525
|
return i.length == 0 && n.err("No node type or group '" + e + "' found"), i;
|
|
3506
3526
|
}
|
|
3507
|
-
function
|
|
3527
|
+
function Fd(n) {
|
|
3508
3528
|
if (n.eat("(")) {
|
|
3509
3529
|
let e = kl(n);
|
|
3510
3530
|
return n.eat(")") || n.err("Missing closing paren"), e;
|
|
3511
3531
|
} else if (/\W/.test(n.next))
|
|
3512
3532
|
n.err("Unexpected token '" + n.next + "'");
|
|
3513
3533
|
else {
|
|
3514
|
-
let e =
|
|
3534
|
+
let e = _d(n, n.next).map((t) => (n.inline == null ? n.inline = t.isInline : n.inline != t.isInline && n.err("Mixing inline and block content"), { type: "name", value: t }));
|
|
3515
3535
|
return n.pos++, e.length == 1 ? e[0] : { type: "choice", exprs: e };
|
|
3516
3536
|
}
|
|
3517
3537
|
}
|
|
3518
|
-
function
|
|
3538
|
+
function zd(n) {
|
|
3519
3539
|
let e = [[]];
|
|
3520
3540
|
return i(s(n, 0), t()), e;
|
|
3521
3541
|
function t() {
|
|
@@ -3586,7 +3606,7 @@ function Is(n, e) {
|
|
|
3586
3606
|
}
|
|
3587
3607
|
}
|
|
3588
3608
|
}
|
|
3589
|
-
function
|
|
3609
|
+
function Hd(n) {
|
|
3590
3610
|
let e = /* @__PURE__ */ Object.create(null);
|
|
3591
3611
|
return t(Is(n, 0));
|
|
3592
3612
|
function t(r) {
|
|
@@ -3611,7 +3631,7 @@ function zd(n) {
|
|
|
3611
3631
|
return s;
|
|
3612
3632
|
}
|
|
3613
3633
|
}
|
|
3614
|
-
function
|
|
3634
|
+
function Vd(n, e) {
|
|
3615
3635
|
for (let t = 0, r = [n]; t < r.length; t++) {
|
|
3616
3636
|
let i = r[t], s = !i.validEnd, o = [];
|
|
3617
3637
|
for (let l = 0; l < i.next.length; l++) {
|
|
@@ -3650,7 +3670,7 @@ function El(n) {
|
|
|
3650
3670
|
let e = /* @__PURE__ */ Object.create(null);
|
|
3651
3671
|
if (n)
|
|
3652
3672
|
for (let t in n)
|
|
3653
|
-
e[t] = new
|
|
3673
|
+
e[t] = new $d(n[t]);
|
|
3654
3674
|
return e;
|
|
3655
3675
|
}
|
|
3656
3676
|
let Rs = class Tl {
|
|
@@ -3819,7 +3839,7 @@ let Rs = class Tl {
|
|
|
3819
3839
|
return r;
|
|
3820
3840
|
}
|
|
3821
3841
|
};
|
|
3822
|
-
class
|
|
3842
|
+
class $d {
|
|
3823
3843
|
constructor(e) {
|
|
3824
3844
|
this.hasDefault = Object.prototype.hasOwnProperty.call(e, "default"), this.default = e.default;
|
|
3825
3845
|
}
|
|
@@ -3876,7 +3896,7 @@ class Or {
|
|
|
3876
3896
|
return this.excluded.indexOf(e) > -1;
|
|
3877
3897
|
}
|
|
3878
3898
|
}
|
|
3879
|
-
class
|
|
3899
|
+
class jd {
|
|
3880
3900
|
/**
|
|
3881
3901
|
Construct a schema from a schema [specification](https://prosemirror.net/docs/ref/#model.SchemaSpec).
|
|
3882
3902
|
*/
|
|
@@ -4009,7 +4029,7 @@ let Ji = class Si {
|
|
|
4009
4029
|
matchTag(e, t, r) {
|
|
4010
4030
|
for (let i = r ? this.tags.indexOf(r) + 1 : 0; i < this.tags.length; i++) {
|
|
4011
4031
|
let s = this.tags[i];
|
|
4012
|
-
if (
|
|
4032
|
+
if (Wd(e, s.tag) && (s.namespace === void 0 || e.namespaceURI == s.namespace) && (!s.context || t.matchesContext(s.context))) {
|
|
4013
4033
|
if (s.getAttrs) {
|
|
4014
4034
|
let o = s.getAttrs(e);
|
|
4015
4035
|
if (o === !1)
|
|
@@ -4110,7 +4130,7 @@ const Ml = {
|
|
|
4110
4130
|
table: !0,
|
|
4111
4131
|
tfoot: !0,
|
|
4112
4132
|
ul: !0
|
|
4113
|
-
},
|
|
4133
|
+
}, qd = {
|
|
4114
4134
|
head: !0,
|
|
4115
4135
|
noscript: !0,
|
|
4116
4136
|
object: !0,
|
|
@@ -4158,7 +4178,7 @@ class En {
|
|
|
4158
4178
|
applyPending(e) {
|
|
4159
4179
|
for (let t = 0, r = this.pendingMarks; t < r.length; t++) {
|
|
4160
4180
|
let i = r[t];
|
|
4161
|
-
(this.type ? this.type.allowsMarkType(i.type) :
|
|
4181
|
+
(this.type ? this.type.allowsMarkType(i.type) : Jd(i.type, e)) && !i.isInSet(this.activeMarks) && (this.activeMarks = i.addToSet(this.activeMarks), this.pendingMarks = i.removeFromSet(this.pendingMarks));
|
|
4162
4182
|
}
|
|
4163
4183
|
}
|
|
4164
4184
|
inlineContext(e) {
|
|
@@ -4184,7 +4204,7 @@ class Bs {
|
|
|
4184
4204
|
let r = e.getAttribute("style");
|
|
4185
4205
|
if (!r)
|
|
4186
4206
|
return t();
|
|
4187
|
-
let i = this.readStyles(
|
|
4207
|
+
let i = this.readStyles(Ud(r));
|
|
4188
4208
|
if (!i)
|
|
4189
4209
|
return;
|
|
4190
4210
|
let [s, o] = i, l = this.top;
|
|
@@ -4216,9 +4236,9 @@ class Bs {
|
|
|
4216
4236
|
// none is found, the element's content nodes are added directly.
|
|
4217
4237
|
addElement(e, t) {
|
|
4218
4238
|
let r = e.nodeName.toLowerCase(), i;
|
|
4219
|
-
wl.hasOwnProperty(r) && this.parser.normalizeLists &&
|
|
4239
|
+
wl.hasOwnProperty(r) && this.parser.normalizeLists && Kd(e);
|
|
4220
4240
|
let s = this.options.ruleFromNode && this.options.ruleFromNode(e) || (i = this.parser.matchTag(e, this, t));
|
|
4221
|
-
if (s ? s.ignore :
|
|
4241
|
+
if (s ? s.ignore : qd.hasOwnProperty(r))
|
|
4222
4242
|
this.findInside(e), this.ignoreFallback(e);
|
|
4223
4243
|
else if (!s || s.skip || s.closeParent) {
|
|
4224
4244
|
s && s.closeParent ? this.open = Math.max(0, this.open - 1) : s && s.skip.nodeType && (e = s.skip);
|
|
@@ -4431,7 +4451,7 @@ class Bs {
|
|
|
4431
4451
|
}
|
|
4432
4452
|
}
|
|
4433
4453
|
addPendingMark(e) {
|
|
4434
|
-
let t =
|
|
4454
|
+
let t = Gd(e, this.top.pendingMarks);
|
|
4435
4455
|
t && this.top.stashMarks.push(t), this.top.pendingMarks = e.addToSet(this.top.pendingMarks);
|
|
4436
4456
|
}
|
|
4437
4457
|
removePendingMark(e, t) {
|
|
@@ -4449,16 +4469,16 @@ class Bs {
|
|
|
4449
4469
|
}
|
|
4450
4470
|
}
|
|
4451
4471
|
}
|
|
4452
|
-
function
|
|
4472
|
+
function Kd(n) {
|
|
4453
4473
|
for (let e = n.firstChild, t = null; e; e = e.nextSibling) {
|
|
4454
4474
|
let r = e.nodeType == 1 ? e.nodeName.toLowerCase() : null;
|
|
4455
4475
|
r && wl.hasOwnProperty(r) && t ? (t.appendChild(e), e = t) : r == "li" ? t = e : r && (t = null);
|
|
4456
4476
|
}
|
|
4457
4477
|
}
|
|
4458
|
-
function
|
|
4478
|
+
function Wd(n, e) {
|
|
4459
4479
|
return (n.matches || n.msMatchesSelector || n.webkitMatchesSelector || n.mozMatchesSelector).call(n, e);
|
|
4460
4480
|
}
|
|
4461
|
-
function
|
|
4481
|
+
function Ud(n) {
|
|
4462
4482
|
let e = /\s*([\w-]+)\s*:\s*([^;]+)/g, t, r = [];
|
|
4463
4483
|
for (; t = e.exec(n); )
|
|
4464
4484
|
r.push(t[1], t[2].trim());
|
|
@@ -4470,7 +4490,7 @@ function _s(n) {
|
|
|
4470
4490
|
e[t] = n[t];
|
|
4471
4491
|
return e;
|
|
4472
4492
|
}
|
|
4473
|
-
function
|
|
4493
|
+
function Jd(n, e) {
|
|
4474
4494
|
let t = e.schema.nodes;
|
|
4475
4495
|
for (let r in t) {
|
|
4476
4496
|
let i = t[r];
|
|
@@ -4488,7 +4508,7 @@ function Ud(n, e) {
|
|
|
4488
4508
|
return !0;
|
|
4489
4509
|
}
|
|
4490
4510
|
}
|
|
4491
|
-
function
|
|
4511
|
+
function Gd(n, e) {
|
|
4492
4512
|
for (let t = 0; t < e.length; t++)
|
|
4493
4513
|
if (n.eq(e[t]))
|
|
4494
4514
|
return e[t];
|
|
@@ -4646,13 +4666,13 @@ function Jr(n) {
|
|
|
4646
4666
|
return n.document || window.document;
|
|
4647
4667
|
}
|
|
4648
4668
|
const Ol = 65535, vl = Math.pow(2, 16);
|
|
4649
|
-
function
|
|
4669
|
+
function Yd(n, e) {
|
|
4650
4670
|
return n + e * vl;
|
|
4651
4671
|
}
|
|
4652
4672
|
function zs(n) {
|
|
4653
4673
|
return n & Ol;
|
|
4654
4674
|
}
|
|
4655
|
-
function
|
|
4675
|
+
function Xd(n) {
|
|
4656
4676
|
return (n - (n & Ol)) / vl;
|
|
4657
4677
|
}
|
|
4658
4678
|
const Al = 1, Nl = 2, An = 4, Dl = 8;
|
|
@@ -4710,7 +4730,7 @@ class pe {
|
|
|
4710
4730
|
if (!this.inverted)
|
|
4711
4731
|
for (let i = 0; i < r; i++)
|
|
4712
4732
|
t += this.ranges[i * 3 + 2] - this.ranges[i * 3 + 1];
|
|
4713
|
-
return this.ranges[r * 3] + t +
|
|
4733
|
+
return this.ranges[r * 3] + t + Xd(e);
|
|
4714
4734
|
}
|
|
4715
4735
|
mapResult(e, t = 1) {
|
|
4716
4736
|
return this._map(e, t, !1);
|
|
@@ -4732,7 +4752,7 @@ class pe {
|
|
|
4732
4752
|
let h = c ? e == a ? -1 : e == u ? 1 : t : t, f = a + i + (h < 0 ? 0 : d);
|
|
4733
4753
|
if (r)
|
|
4734
4754
|
return f;
|
|
4735
|
-
let p = e == (t < 0 ? a : u) ? null :
|
|
4755
|
+
let p = e == (t < 0 ? a : u) ? null : Yd(l / 3, e - a), m = e == a ? Nl : e == u ? Al : An;
|
|
4736
4756
|
return (t < 0 ? e != a : e != u) && (m |= Dl), new xi(f, m, p);
|
|
4737
4757
|
}
|
|
4738
4758
|
i += d - c;
|
|
@@ -5261,7 +5281,7 @@ function Ci(n, e, t) {
|
|
|
5261
5281
|
}
|
|
5262
5282
|
return !1;
|
|
5263
5283
|
}
|
|
5264
|
-
function
|
|
5284
|
+
function Qd(n, e, t, r) {
|
|
5265
5285
|
let i = [], s = [], o, l;
|
|
5266
5286
|
n.doc.nodesBetween(e, t, (a, c, d) => {
|
|
5267
5287
|
if (!a.isInline)
|
|
@@ -5275,7 +5295,7 @@ function Xd(n, e, t, r) {
|
|
|
5275
5295
|
}
|
|
5276
5296
|
}), i.forEach((a) => n.step(a)), s.forEach((a) => n.step(a));
|
|
5277
5297
|
}
|
|
5278
|
-
function
|
|
5298
|
+
function Zd(n, e, t, r) {
|
|
5279
5299
|
let i = [], s = 0;
|
|
5280
5300
|
n.doc.nodesBetween(e, t, (o, l) => {
|
|
5281
5301
|
if (!o.isInline)
|
|
@@ -5301,7 +5321,7 @@ function Qd(n, e, t, r) {
|
|
|
5301
5321
|
}
|
|
5302
5322
|
}), i.forEach((o) => n.step(new De(o.from, o.to, o.style)));
|
|
5303
5323
|
}
|
|
5304
|
-
function
|
|
5324
|
+
function eu(n, e, t, r = t.contentMatch) {
|
|
5305
5325
|
let i = n.doc.nodeAt(e), s = [], o = e + 1;
|
|
5306
5326
|
for (let l = 0; l < i.childCount; l++) {
|
|
5307
5327
|
let a = i.child(l), c = o + a.nodeSize, d = r.matchType(a.type);
|
|
@@ -5326,7 +5346,7 @@ function Zd(n, e, t, r = t.contentMatch) {
|
|
|
5326
5346
|
for (let l = s.length - 1; l >= 0; l--)
|
|
5327
5347
|
n.step(s[l]);
|
|
5328
5348
|
}
|
|
5329
|
-
function
|
|
5349
|
+
function tu(n, e, t) {
|
|
5330
5350
|
return (e == 0 || n.canReplace(e, n.childCount)) && (t == n.childCount || n.canReplace(0, t));
|
|
5331
5351
|
}
|
|
5332
5352
|
function jt(n) {
|
|
@@ -5335,12 +5355,12 @@ function jt(n) {
|
|
|
5335
5355
|
let i = n.$from.node(r), s = n.$from.index(r), o = n.$to.indexAfter(r);
|
|
5336
5356
|
if (r < n.depth && i.canReplace(s, o, t))
|
|
5337
5357
|
return r;
|
|
5338
|
-
if (r == 0 || i.type.spec.isolating || !
|
|
5358
|
+
if (r == 0 || i.type.spec.isolating || !tu(i, s, o))
|
|
5339
5359
|
break;
|
|
5340
5360
|
}
|
|
5341
5361
|
return null;
|
|
5342
5362
|
}
|
|
5343
|
-
function
|
|
5363
|
+
function nu(n, e, t) {
|
|
5344
5364
|
let { $from: r, $to: i, depth: s } = e, o = r.before(s + 1), l = i.after(s + 1), a = o, c = l, d = b.empty, u = 0;
|
|
5345
5365
|
for (let p = s, m = !1; p > t; p--)
|
|
5346
5366
|
m || r.index(p) > 0 ? (m = !0, d = b.from(r.node(p).copy(d)), u++) : a--;
|
|
@@ -5350,20 +5370,20 @@ function tu(n, e, t) {
|
|
|
5350
5370
|
n.step(new K(a, c, o, l, new S(d.append(h), u, f), d.size - u, !0));
|
|
5351
5371
|
}
|
|
5352
5372
|
function Yi(n, e, t = null, r = n) {
|
|
5353
|
-
let i =
|
|
5373
|
+
let i = ru(n, e), s = i && iu(r, e);
|
|
5354
5374
|
return s ? i.map(Hs).concat({ type: e, attrs: t }).concat(s.map(Hs)) : null;
|
|
5355
5375
|
}
|
|
5356
5376
|
function Hs(n) {
|
|
5357
5377
|
return { type: n, attrs: null };
|
|
5358
5378
|
}
|
|
5359
|
-
function
|
|
5379
|
+
function ru(n, e) {
|
|
5360
5380
|
let { parent: t, startIndex: r, endIndex: i } = n, s = t.contentMatchAt(r).findWrapping(e);
|
|
5361
5381
|
if (!s)
|
|
5362
5382
|
return null;
|
|
5363
5383
|
let o = s.length ? s[0] : e;
|
|
5364
5384
|
return t.canReplaceWith(r, i, o) ? s : null;
|
|
5365
5385
|
}
|
|
5366
|
-
function
|
|
5386
|
+
function iu(n, e) {
|
|
5367
5387
|
let { parent: t, startIndex: r, endIndex: i } = n, s = t.child(r), o = e.contentMatch.findWrapping(s.type);
|
|
5368
5388
|
if (!o)
|
|
5369
5389
|
return null;
|
|
@@ -5372,7 +5392,7 @@ function ru(n, e) {
|
|
|
5372
5392
|
a = a.matchType(t.child(c).type);
|
|
5373
5393
|
return !a || !a.validEnd ? null : o;
|
|
5374
5394
|
}
|
|
5375
|
-
function
|
|
5395
|
+
function su(n, e, t) {
|
|
5376
5396
|
let r = b.empty;
|
|
5377
5397
|
for (let o = t.length - 1; o >= 0; o--) {
|
|
5378
5398
|
if (r.size) {
|
|
@@ -5385,23 +5405,23 @@ function iu(n, e, t) {
|
|
|
5385
5405
|
let i = e.start, s = e.end;
|
|
5386
5406
|
n.step(new K(i, s, i, s, new S(r, 0, 0), t.length, !0));
|
|
5387
5407
|
}
|
|
5388
|
-
function
|
|
5408
|
+
function ou(n, e, t, r, i) {
|
|
5389
5409
|
if (!r.isTextblock)
|
|
5390
5410
|
throw new RangeError("Type given to setBlockType should be a textblock");
|
|
5391
5411
|
let s = n.steps.length;
|
|
5392
5412
|
n.doc.nodesBetween(e, t, (o, l) => {
|
|
5393
|
-
if (o.isTextblock && !o.hasMarkup(r, i) &&
|
|
5413
|
+
if (o.isTextblock && !o.hasMarkup(r, i) && lu(n.doc, n.mapping.slice(s).map(l), r)) {
|
|
5394
5414
|
n.clearIncompatible(n.mapping.slice(s).map(l, 1), r);
|
|
5395
5415
|
let a = n.mapping.slice(s), c = a.map(l, 1), d = a.map(l + o.nodeSize, 1);
|
|
5396
5416
|
return n.step(new K(c, d, c + 1, d - 1, new S(b.from(r.create(i, null, o.marks)), 0, 0), 1, !0)), !1;
|
|
5397
5417
|
}
|
|
5398
5418
|
});
|
|
5399
5419
|
}
|
|
5400
|
-
function
|
|
5420
|
+
function lu(n, e, t) {
|
|
5401
5421
|
let r = n.resolve(e), i = r.index();
|
|
5402
5422
|
return r.parent.canReplaceWith(i, i + 1, t);
|
|
5403
5423
|
}
|
|
5404
|
-
function
|
|
5424
|
+
function au(n, e, t, r, i) {
|
|
5405
5425
|
let s = n.doc.nodeAt(e);
|
|
5406
5426
|
if (!s)
|
|
5407
5427
|
throw new RangeError("No node at given position");
|
|
@@ -5430,7 +5450,7 @@ function Rt(n, e, t = 1, r) {
|
|
|
5430
5450
|
let l = i.indexAfter(s), a = r && r[0];
|
|
5431
5451
|
return i.node(s).canReplaceWith(l, l, a ? a.type : i.node(s + 1).type);
|
|
5432
5452
|
}
|
|
5433
|
-
function
|
|
5453
|
+
function cu(n, e, t = 1, r) {
|
|
5434
5454
|
let i = n.doc.resolve(e), s = b.empty, o = b.empty;
|
|
5435
5455
|
for (let l = i.depth, a = i.depth - t, c = t - 1; l > a; l--, c--) {
|
|
5436
5456
|
s = b.from(i.node(l).copy(s));
|
|
@@ -5457,11 +5477,11 @@ function Rl(n, e, t = -1) {
|
|
|
5457
5477
|
e = t < 0 ? r.before(i) : r.after(i);
|
|
5458
5478
|
}
|
|
5459
5479
|
}
|
|
5460
|
-
function
|
|
5480
|
+
function du(n, e, t) {
|
|
5461
5481
|
let r = new G(e - t, e + t, S.empty, !0);
|
|
5462
5482
|
n.step(r);
|
|
5463
5483
|
}
|
|
5464
|
-
function
|
|
5484
|
+
function uu(n, e, t) {
|
|
5465
5485
|
let r = n.resolve(e);
|
|
5466
5486
|
if (r.parent.canReplaceWith(r.index(), r.index(), t))
|
|
5467
5487
|
return e;
|
|
@@ -5483,7 +5503,7 @@ function du(n, e, t) {
|
|
|
5483
5503
|
}
|
|
5484
5504
|
return null;
|
|
5485
5505
|
}
|
|
5486
|
-
function
|
|
5506
|
+
function hu(n, e, t) {
|
|
5487
5507
|
let r = n.resolve(e);
|
|
5488
5508
|
if (!t.content.size)
|
|
5489
5509
|
return e;
|
|
@@ -5508,12 +5528,12 @@ function Xi(n, e, t = e, r = S.empty) {
|
|
|
5508
5528
|
if (e == t && !r.size)
|
|
5509
5529
|
return null;
|
|
5510
5530
|
let i = n.resolve(e), s = n.resolve(t);
|
|
5511
|
-
return Pl(i, s, r) ? new G(e, t, r) : new
|
|
5531
|
+
return Pl(i, s, r) ? new G(e, t, r) : new fu(i, s, r).fit();
|
|
5512
5532
|
}
|
|
5513
5533
|
function Pl(n, e, t) {
|
|
5514
5534
|
return !t.openStart && !t.openEnd && n.start() == e.start() && n.parent.canReplace(n.index(), e.index(), t.content);
|
|
5515
5535
|
}
|
|
5516
|
-
class
|
|
5536
|
+
class fu {
|
|
5517
5537
|
constructor(e, t, r) {
|
|
5518
5538
|
this.$from = e, this.$to = t, this.unplaced = r, this.frontier = [], this.placed = b.empty;
|
|
5519
5539
|
for (let i = 0; i <= e.depth; i++) {
|
|
@@ -5683,18 +5703,18 @@ function Xr(n, e, t, r, i) {
|
|
|
5683
5703
|
if (o == s.childCount && !t.compatibleContent(s.type))
|
|
5684
5704
|
return null;
|
|
5685
5705
|
let l = r.fillBefore(s.content, !0, o);
|
|
5686
|
-
return l && !
|
|
5706
|
+
return l && !pu(t, s.content, o) ? l : null;
|
|
5687
5707
|
}
|
|
5688
|
-
function
|
|
5708
|
+
function pu(n, e, t) {
|
|
5689
5709
|
for (let r = t; r < e.childCount; r++)
|
|
5690
5710
|
if (!n.allowsMarks(e.child(r).marks))
|
|
5691
5711
|
return !0;
|
|
5692
5712
|
return !1;
|
|
5693
5713
|
}
|
|
5694
|
-
function
|
|
5714
|
+
function mu(n) {
|
|
5695
5715
|
return n.spec.defining || n.spec.definingForContent;
|
|
5696
5716
|
}
|
|
5697
|
-
function
|
|
5717
|
+
function gu(n, e, t, r) {
|
|
5698
5718
|
if (!r.size)
|
|
5699
5719
|
return n.deleteRange(e, t);
|
|
5700
5720
|
let i = n.doc.resolve(e), s = n.doc.resolve(t);
|
|
@@ -5718,7 +5738,7 @@ function mu(n, e, t, r) {
|
|
|
5718
5738
|
h = p.content;
|
|
5719
5739
|
}
|
|
5720
5740
|
for (let h = d - 1; h >= 0; h--) {
|
|
5721
|
-
let f = c[h], p =
|
|
5741
|
+
let f = c[h], p = mu(f.type);
|
|
5722
5742
|
if (p && !f.sameMarkup(i.node(Math.abs(l) - 1)))
|
|
5723
5743
|
d = h;
|
|
5724
5744
|
else if (p || !f.type.isTextblock)
|
|
@@ -5752,14 +5772,14 @@ function Bl(n, e, t, r, i) {
|
|
|
5752
5772
|
}
|
|
5753
5773
|
return n;
|
|
5754
5774
|
}
|
|
5755
|
-
function
|
|
5775
|
+
function yu(n, e, t, r) {
|
|
5756
5776
|
if (!r.isInline && e == t && n.doc.resolve(e).parent.content.size) {
|
|
5757
|
-
let i =
|
|
5777
|
+
let i = uu(n.doc, e, r.type);
|
|
5758
5778
|
i != null && (e = t = i);
|
|
5759
5779
|
}
|
|
5760
5780
|
n.replaceRange(e, t, new S(b.from(r), 0, 0));
|
|
5761
5781
|
}
|
|
5762
|
-
function
|
|
5782
|
+
function bu(n, e, t) {
|
|
5763
5783
|
let r = n.doc.resolve(e), i = n.doc.resolve(t), s = _l(r, i);
|
|
5764
5784
|
for (let o = 0; o < s.length; o++) {
|
|
5765
5785
|
let l = s[o], a = o == s.length - 1;
|
|
@@ -5955,7 +5975,7 @@ class Fl {
|
|
|
5955
5975
|
control over what happens.
|
|
5956
5976
|
*/
|
|
5957
5977
|
replaceRange(e, t, r) {
|
|
5958
|
-
return
|
|
5978
|
+
return gu(this, e, t, r), this;
|
|
5959
5979
|
}
|
|
5960
5980
|
/**
|
|
5961
5981
|
Replace the given range with a node, but use `from` and `to` as
|
|
@@ -5967,14 +5987,14 @@ class Fl {
|
|
|
5967
5987
|
that parent node.
|
|
5968
5988
|
*/
|
|
5969
5989
|
replaceRangeWith(e, t, r) {
|
|
5970
|
-
return
|
|
5990
|
+
return yu(this, e, t, r), this;
|
|
5971
5991
|
}
|
|
5972
5992
|
/**
|
|
5973
5993
|
Delete the given range, expanding it to cover fully covered
|
|
5974
5994
|
parent nodes until a valid replace is found.
|
|
5975
5995
|
*/
|
|
5976
5996
|
deleteRange(e, t) {
|
|
5977
|
-
return
|
|
5997
|
+
return bu(this, e, t), this;
|
|
5978
5998
|
}
|
|
5979
5999
|
/**
|
|
5980
6000
|
Split the content in the given range off from its parent, if there
|
|
@@ -5984,14 +6004,14 @@ class Fl {
|
|
|
5984
6004
|
sure the lift is valid.
|
|
5985
6005
|
*/
|
|
5986
6006
|
lift(e, t) {
|
|
5987
|
-
return
|
|
6007
|
+
return nu(this, e, t), this;
|
|
5988
6008
|
}
|
|
5989
6009
|
/**
|
|
5990
6010
|
Join the blocks around the given position. If depth is 2, their
|
|
5991
6011
|
last and first siblings are also joined, and so on.
|
|
5992
6012
|
*/
|
|
5993
6013
|
join(e, t = 1) {
|
|
5994
|
-
return
|
|
6014
|
+
return du(this, e, t), this;
|
|
5995
6015
|
}
|
|
5996
6016
|
/**
|
|
5997
6017
|
Wrap the given [range](https://prosemirror.net/docs/ref/#model.NodeRange) in the given set of wrappers.
|
|
@@ -5999,21 +6019,21 @@ class Fl {
|
|
|
5999
6019
|
probably be computed with [`findWrapping`](https://prosemirror.net/docs/ref/#transform.findWrapping).
|
|
6000
6020
|
*/
|
|
6001
6021
|
wrap(e, t) {
|
|
6002
|
-
return
|
|
6022
|
+
return su(this, e, t), this;
|
|
6003
6023
|
}
|
|
6004
6024
|
/**
|
|
6005
6025
|
Set the type of all textblocks (partly) between `from` and `to` to
|
|
6006
6026
|
the given node type with the given attributes.
|
|
6007
6027
|
*/
|
|
6008
6028
|
setBlockType(e, t = e, r, i = null) {
|
|
6009
|
-
return
|
|
6029
|
+
return ou(this, e, t, r, i), this;
|
|
6010
6030
|
}
|
|
6011
6031
|
/**
|
|
6012
6032
|
Change the type, attributes, and/or marks of the node at `pos`.
|
|
6013
6033
|
When `type` isn't given, the existing node type is preserved,
|
|
6014
6034
|
*/
|
|
6015
6035
|
setNodeMarkup(e, t, r = null, i) {
|
|
6016
|
-
return
|
|
6036
|
+
return au(this, e, t, r, i), this;
|
|
6017
6037
|
}
|
|
6018
6038
|
/**
|
|
6019
6039
|
Set a single attribute on a given node to a new value.
|
|
@@ -6057,13 +6077,13 @@ class Fl {
|
|
|
6057
6077
|
use after the split.
|
|
6058
6078
|
*/
|
|
6059
6079
|
split(e, t = 1, r) {
|
|
6060
|
-
return
|
|
6080
|
+
return cu(this, e, t, r), this;
|
|
6061
6081
|
}
|
|
6062
6082
|
/**
|
|
6063
6083
|
Add the given mark to the inline content between `from` and `to`.
|
|
6064
6084
|
*/
|
|
6065
6085
|
addMark(e, t, r) {
|
|
6066
|
-
return
|
|
6086
|
+
return Qd(this, e, t, r), this;
|
|
6067
6087
|
}
|
|
6068
6088
|
/**
|
|
6069
6089
|
Remove marks from inline nodes between `from` and `to`. When
|
|
@@ -6072,7 +6092,7 @@ class Fl {
|
|
|
6072
6092
|
remove all marks of any type.
|
|
6073
6093
|
*/
|
|
6074
6094
|
removeMark(e, t, r) {
|
|
6075
|
-
return
|
|
6095
|
+
return Zd(this, e, t, r), this;
|
|
6076
6096
|
}
|
|
6077
6097
|
/**
|
|
6078
6098
|
Removes all marks and nodes from the content of the node at
|
|
@@ -6081,7 +6101,7 @@ class Fl {
|
|
|
6081
6101
|
third argument.
|
|
6082
6102
|
*/
|
|
6083
6103
|
clearIncompatible(e, t, r) {
|
|
6084
|
-
return
|
|
6104
|
+
return eu(this, e, t, r), this;
|
|
6085
6105
|
}
|
|
6086
6106
|
}
|
|
6087
6107
|
const Qr = /* @__PURE__ */ Object.create(null);
|
|
@@ -6092,7 +6112,7 @@ class N {
|
|
|
6092
6112
|
`$head`.
|
|
6093
6113
|
*/
|
|
6094
6114
|
constructor(e, t, r) {
|
|
6095
|
-
this.$anchor = e, this.$head = t, this.ranges = r || [new
|
|
6115
|
+
this.$anchor = e, this.$head = t, this.ranges = r || [new ku(e.min(t), e.max(t))];
|
|
6096
6116
|
}
|
|
6097
6117
|
/**
|
|
6098
6118
|
The selection's anchor, as an unresolved position.
|
|
@@ -6250,7 +6270,7 @@ class N {
|
|
|
6250
6270
|
}
|
|
6251
6271
|
}
|
|
6252
6272
|
N.prototype.visible = !0;
|
|
6253
|
-
class
|
|
6273
|
+
class ku {
|
|
6254
6274
|
/**
|
|
6255
6275
|
Create a range.
|
|
6256
6276
|
*/
|
|
@@ -6438,11 +6458,11 @@ class Te extends N {
|
|
|
6438
6458
|
return e instanceof Te;
|
|
6439
6459
|
}
|
|
6440
6460
|
getBookmark() {
|
|
6441
|
-
return
|
|
6461
|
+
return Su;
|
|
6442
6462
|
}
|
|
6443
6463
|
}
|
|
6444
6464
|
N.jsonID("all", Te);
|
|
6445
|
-
const
|
|
6465
|
+
const Su = {
|
|
6446
6466
|
map() {
|
|
6447
6467
|
return this;
|
|
6448
6468
|
},
|
|
@@ -6480,7 +6500,7 @@ function js(n, e, t) {
|
|
|
6480
6500
|
}), n.setSelection(N.near(n.doc.resolve(o), t));
|
|
6481
6501
|
}
|
|
6482
6502
|
const qs = 1, Tn = 2, Ks = 4;
|
|
6483
|
-
class
|
|
6503
|
+
class xu extends Fl {
|
|
6484
6504
|
/**
|
|
6485
6505
|
@internal
|
|
6486
6506
|
*/
|
|
@@ -6639,7 +6659,7 @@ class Yt {
|
|
|
6639
6659
|
this.name = e, this.init = Ws(t.init, r), this.apply = Ws(t.apply, r);
|
|
6640
6660
|
}
|
|
6641
6661
|
}
|
|
6642
|
-
const
|
|
6662
|
+
const Cu = [
|
|
6643
6663
|
new Yt("doc", {
|
|
6644
6664
|
init(n) {
|
|
6645
6665
|
return n.doc || n.schema.topNodeType.createAndFill();
|
|
@@ -6675,7 +6695,7 @@ const xu = [
|
|
|
6675
6695
|
];
|
|
6676
6696
|
class Zr {
|
|
6677
6697
|
constructor(e, t) {
|
|
6678
|
-
this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields =
|
|
6698
|
+
this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = Cu.slice(), t && t.forEach((r) => {
|
|
6679
6699
|
if (this.pluginsByKey[r.key])
|
|
6680
6700
|
throw new RangeError("Adding different instances of a keyed plugin (" + r.key + ")");
|
|
6681
6701
|
this.plugins.push(r), this.pluginsByKey[r.key] = r, r.spec.state && this.fields.push(new Yt(r.key, r.spec.state, r));
|
|
@@ -6768,7 +6788,7 @@ class Dt {
|
|
|
6768
6788
|
Start a [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.
|
|
6769
6789
|
*/
|
|
6770
6790
|
get tr() {
|
|
6771
|
-
return new
|
|
6791
|
+
return new xu(this);
|
|
6772
6792
|
}
|
|
6773
6793
|
/**
|
|
6774
6794
|
Create a new state.
|
|
@@ -6907,14 +6927,14 @@ const Be = function(n, e, t) {
|
|
|
6907
6927
|
return r.setEnd(n, t ?? n.nodeValue.length), r.setStart(n, e || 0), r;
|
|
6908
6928
|
}, Ct = function(n, e, t, r) {
|
|
6909
6929
|
return t && (Js(n, e, t, r, -1) || Js(n, e, t, r, 1));
|
|
6910
|
-
},
|
|
6930
|
+
}, Eu = /^(img|br|input|textarea|hr)$/i;
|
|
6911
6931
|
function Js(n, e, t, r, i) {
|
|
6912
6932
|
for (; ; ) {
|
|
6913
6933
|
if (n == t && e == r)
|
|
6914
6934
|
return !0;
|
|
6915
6935
|
if (e == (i < 0 ? 0 : Ae(n))) {
|
|
6916
6936
|
let s = n.parentNode;
|
|
6917
|
-
if (!s || s.nodeType != 1 || Zi(n) ||
|
|
6937
|
+
if (!s || s.nodeType != 1 || Zi(n) || Eu.test(n.nodeName) || n.contentEditable == "false")
|
|
6918
6938
|
return !1;
|
|
6919
6939
|
e = oe(n) + (i < 0 ? 0 : 1), n = s;
|
|
6920
6940
|
} else if (n.nodeType == 1) {
|
|
@@ -6928,7 +6948,7 @@ function Js(n, e, t, r, i) {
|
|
|
6928
6948
|
function Ae(n) {
|
|
6929
6949
|
return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
|
|
6930
6950
|
}
|
|
6931
|
-
function
|
|
6951
|
+
function Tu(n, e, t) {
|
|
6932
6952
|
for (let r = e == 0, i = e == Ae(n); r || i; ) {
|
|
6933
6953
|
if (n == t)
|
|
6934
6954
|
return !0;
|
|
@@ -6951,13 +6971,13 @@ function lt(n, e) {
|
|
|
6951
6971
|
let t = document.createEvent("Event");
|
|
6952
6972
|
return t.initEvent("keydown", !0, !0), t.keyCode = n, t.key = t.code = e, t;
|
|
6953
6973
|
}
|
|
6954
|
-
function
|
|
6974
|
+
function Mu(n) {
|
|
6955
6975
|
let e = n.activeElement;
|
|
6956
6976
|
for (; e && e.shadowRoot; )
|
|
6957
6977
|
e = e.shadowRoot.activeElement;
|
|
6958
6978
|
return e;
|
|
6959
6979
|
}
|
|
6960
|
-
function
|
|
6980
|
+
function wu(n, e, t) {
|
|
6961
6981
|
if (n.caretPositionFromPoint)
|
|
6962
6982
|
try {
|
|
6963
6983
|
let r = n.caretPositionFromPoint(e, t);
|
|
@@ -6973,8 +6993,8 @@ function Mu(n, e, t) {
|
|
|
6973
6993
|
}
|
|
6974
6994
|
const Ie = typeof navigator < "u" ? navigator : null, Gs = typeof document < "u" ? document : null, it = Ie && Ie.userAgent || "", Ei = /Edge\/(\d+)/.exec(it), Vl = /MSIE \d/.exec(it), Ti = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(it), he = !!(Vl || Ti || Ei), Qe = Vl ? document.documentMode : Ti ? +Ti[1] : Ei ? +Ei[1] : 0, Me = !he && /gecko\/(\d+)/i.test(it);
|
|
6975
6995
|
Me && +(/Firefox\/(\d+)/.exec(it) || [0, 0])[1];
|
|
6976
|
-
const Mi = !he && /Chrome\/(\d+)/.exec(it), te = !!Mi,
|
|
6977
|
-
function
|
|
6996
|
+
const Mi = !he && /Chrome\/(\d+)/.exec(it), te = !!Mi, Ou = Mi ? +Mi[1] : 0, le = !he && !!Ie && /Apple Computer/.test(Ie.vendor), Ft = le && (/Mobile\/\w+/.test(it) || !!Ie && Ie.maxTouchPoints > 2), ke = Ft || (Ie ? /Mac/.test(Ie.platform) : !1), vu = Ie ? /Win/.test(Ie.platform) : !1, Ee = /Android \d/.test(it), kn = !!Gs && "webkitFontSmoothing" in Gs.documentElement.style, Au = kn ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
6997
|
+
function Nu(n) {
|
|
6978
6998
|
return {
|
|
6979
6999
|
left: 0,
|
|
6980
7000
|
right: n.documentElement.clientWidth,
|
|
@@ -6985,7 +7005,7 @@ function Au(n) {
|
|
|
6985
7005
|
function Pe(n, e) {
|
|
6986
7006
|
return typeof n == "number" ? n : n[e];
|
|
6987
7007
|
}
|
|
6988
|
-
function
|
|
7008
|
+
function Du(n) {
|
|
6989
7009
|
let e = n.getBoundingClientRect(), t = e.width / n.offsetWidth || 1, r = e.height / n.offsetHeight || 1;
|
|
6990
7010
|
return {
|
|
6991
7011
|
left: e.left,
|
|
@@ -6999,7 +7019,7 @@ function Ys(n, e, t) {
|
|
|
6999
7019
|
for (let o = t || n.dom; o; o = dn(o)) {
|
|
7000
7020
|
if (o.nodeType != 1)
|
|
7001
7021
|
continue;
|
|
7002
|
-
let l = o, a = l == s.body, c = a ?
|
|
7022
|
+
let l = o, a = l == s.body, c = a ? Nu(s) : Du(l), d = 0, u = 0;
|
|
7003
7023
|
if (e.top < c.top + Pe(r, "top") ? u = -(c.top - e.top + Pe(i, "top")) : e.bottom > c.bottom - Pe(r, "bottom") && (u = e.bottom - e.top > c.bottom - c.top ? e.top + Pe(i, "top") - c.top : e.bottom - c.bottom + Pe(i, "bottom")), e.left < c.left + Pe(r, "left") ? d = -(c.left - e.left + Pe(i, "left")) : e.right > c.right - Pe(r, "right") && (d = e.right - c.right + Pe(i, "right")), d || u)
|
|
7004
7024
|
if (a)
|
|
7005
7025
|
s.defaultView.scrollBy(d, u);
|
|
@@ -7013,7 +7033,7 @@ function Ys(n, e, t) {
|
|
|
7013
7033
|
break;
|
|
7014
7034
|
}
|
|
7015
7035
|
}
|
|
7016
|
-
function
|
|
7036
|
+
function Iu(n) {
|
|
7017
7037
|
let e = n.dom.getBoundingClientRect(), t = Math.max(0, e.top), r, i;
|
|
7018
7038
|
for (let s = (e.left + e.right) / 2, o = t + 1; o < Math.min(innerHeight, e.bottom); o += 5) {
|
|
7019
7039
|
let l = n.root.elementFromPoint(s, o);
|
|
@@ -7033,7 +7053,7 @@ function $l(n) {
|
|
|
7033
7053
|
;
|
|
7034
7054
|
return e;
|
|
7035
7055
|
}
|
|
7036
|
-
function
|
|
7056
|
+
function Ru({ refDOM: n, refTop: e, stack: t }) {
|
|
7037
7057
|
let r = n ? n.getBoundingClientRect().top : 0;
|
|
7038
7058
|
jl(t, r == 0 ? 0 : r - e);
|
|
7039
7059
|
}
|
|
@@ -7044,7 +7064,7 @@ function jl(n, e) {
|
|
|
7044
7064
|
}
|
|
7045
7065
|
}
|
|
7046
7066
|
let Tt = null;
|
|
7047
|
-
function
|
|
7067
|
+
function Pu(n) {
|
|
7048
7068
|
if (n.setActive)
|
|
7049
7069
|
return n.setActive();
|
|
7050
7070
|
if (Tt)
|
|
@@ -7083,9 +7103,9 @@ function ql(n, e) {
|
|
|
7083
7103
|
!t && (e.left >= p.right && e.top >= p.top || e.left >= p.left && e.top >= p.bottom) && (s = u + 1);
|
|
7084
7104
|
}
|
|
7085
7105
|
}
|
|
7086
|
-
return !t && a && (t = a, i = c, r = 0), t && t.nodeType == 3 ?
|
|
7106
|
+
return !t && a && (t = a, i = c, r = 0), t && t.nodeType == 3 ? Lu(t, i) : !t || r && t.nodeType == 1 ? { node: n, offset: s } : ql(t, i);
|
|
7087
7107
|
}
|
|
7088
|
-
function
|
|
7108
|
+
function Lu(n, e) {
|
|
7089
7109
|
let t = n.nodeValue.length, r = document.createRange();
|
|
7090
7110
|
for (let i = 0; i < t; i++) {
|
|
7091
7111
|
r.setEnd(n, i + 1), r.setStart(n, i);
|
|
@@ -7098,11 +7118,11 @@ function Pu(n, e) {
|
|
|
7098
7118
|
function es(n, e) {
|
|
7099
7119
|
return n.left >= e.left - 1 && n.left <= e.right + 1 && n.top >= e.top - 1 && n.top <= e.bottom + 1;
|
|
7100
7120
|
}
|
|
7101
|
-
function
|
|
7121
|
+
function Bu(n, e) {
|
|
7102
7122
|
let t = n.parentNode;
|
|
7103
7123
|
return t && /^li$/i.test(t.nodeName) && e.left < n.getBoundingClientRect().left ? t : n;
|
|
7104
7124
|
}
|
|
7105
|
-
function
|
|
7125
|
+
function _u(n, e, t) {
|
|
7106
7126
|
let { node: r, offset: i } = ql(e, t), s = -1;
|
|
7107
7127
|
if (r.nodeType == 1 && !r.firstChild) {
|
|
7108
7128
|
let o = r.getBoundingClientRect();
|
|
@@ -7110,7 +7130,7 @@ function Bu(n, e, t) {
|
|
|
7110
7130
|
}
|
|
7111
7131
|
return n.docView.posFromDOM(r, i, s);
|
|
7112
7132
|
}
|
|
7113
|
-
function
|
|
7133
|
+
function Fu(n, e, t, r) {
|
|
7114
7134
|
let i = -1;
|
|
7115
7135
|
for (let s = e, o = !1; s != n.dom; ) {
|
|
7116
7136
|
let l = n.docView.nearestDesc(s, !0);
|
|
@@ -7143,8 +7163,8 @@ function Kl(n, e, t) {
|
|
|
7143
7163
|
}
|
|
7144
7164
|
return n;
|
|
7145
7165
|
}
|
|
7146
|
-
function
|
|
7147
|
-
let t = n.dom.ownerDocument, r, i = 0, s =
|
|
7166
|
+
function zu(n, e) {
|
|
7167
|
+
let t = n.dom.ownerDocument, r, i = 0, s = wu(t, e.left, e.top);
|
|
7148
7168
|
s && ({ node: r, offset: i } = s);
|
|
7149
7169
|
let o = (n.root.elementFromPoint ? n.root : t).elementFromPoint(e.left, e.top), l;
|
|
7150
7170
|
if (!o || !n.dom.contains(o.nodeType != 1 ? o.parentNode : o)) {
|
|
@@ -7155,15 +7175,15 @@ function Fu(n, e) {
|
|
|
7155
7175
|
if (le)
|
|
7156
7176
|
for (let c = o; r && c; c = dn(c))
|
|
7157
7177
|
c.draggable && (r = void 0);
|
|
7158
|
-
if (o =
|
|
7178
|
+
if (o = Bu(o, e), r) {
|
|
7159
7179
|
if (Me && r.nodeType == 1 && (i = Math.min(i, r.childNodes.length), i < r.childNodes.length)) {
|
|
7160
7180
|
let d = r.childNodes[i], u;
|
|
7161
7181
|
d.nodeName == "IMG" && (u = d.getBoundingClientRect()).right <= e.left && u.bottom > e.top && i++;
|
|
7162
7182
|
}
|
|
7163
7183
|
let c;
|
|
7164
|
-
kn && i && r.nodeType == 1 && (c = r.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, r == n.dom && i == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && e.top > r.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (i == 0 || r.nodeType != 1 || r.childNodes[i - 1].nodeName != "BR") && (l =
|
|
7184
|
+
kn && i && r.nodeType == 1 && (c = r.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, r == n.dom && i == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && e.top > r.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (i == 0 || r.nodeType != 1 || r.childNodes[i - 1].nodeName != "BR") && (l = Fu(n, r, i, e));
|
|
7165
7185
|
}
|
|
7166
|
-
l == null && (l =
|
|
7186
|
+
l == null && (l = _u(n, o, e));
|
|
7167
7187
|
let a = n.docView.nearestDesc(o, !0);
|
|
7168
7188
|
return { pos: l, inside: a ? a.posAtStart - a.border : -1 };
|
|
7169
7189
|
}
|
|
@@ -7179,11 +7199,11 @@ function qe(n, e) {
|
|
|
7179
7199
|
}
|
|
7180
7200
|
return Array.prototype.find.call(t, Xs) || n.getBoundingClientRect();
|
|
7181
7201
|
}
|
|
7182
|
-
const
|
|
7202
|
+
const Hu = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
|
|
7183
7203
|
function Wl(n, e, t) {
|
|
7184
7204
|
let { node: r, offset: i, atom: s } = n.docView.domFromPos(e, t < 0 ? -1 : 1), o = kn || Me;
|
|
7185
7205
|
if (r.nodeType == 3)
|
|
7186
|
-
if (o && (
|
|
7206
|
+
if (o && (Hu.test(r.nodeValue) || (t < 0 ? !i : i == r.nodeValue.length))) {
|
|
7187
7207
|
let a = qe(Be(r, i, i), t);
|
|
7188
7208
|
if (Me && i && /\s/.test(r.nodeValue[i - 1]) && i < r.nodeValue.length) {
|
|
7189
7209
|
let c = qe(Be(r, i - 1, i - 1), -1);
|
|
@@ -7247,7 +7267,7 @@ function Ul(n, e, t) {
|
|
|
7247
7267
|
r != e && n.updateState(r), i != n.dom && i && i.focus();
|
|
7248
7268
|
}
|
|
7249
7269
|
}
|
|
7250
|
-
function
|
|
7270
|
+
function Vu(n, e, t) {
|
|
7251
7271
|
let r = e.selection, i = t == "up" ? r.$from : r.$to;
|
|
7252
7272
|
return Ul(n, e, () => {
|
|
7253
7273
|
let { node: s } = n.docView.domFromPos(i.pos, t == "up" ? -1 : 1);
|
|
@@ -7279,13 +7299,13 @@ function Hu(n, e, t) {
|
|
|
7279
7299
|
return !0;
|
|
7280
7300
|
});
|
|
7281
7301
|
}
|
|
7282
|
-
const
|
|
7283
|
-
function
|
|
7302
|
+
const $u = /[\u0590-\u08ac]/;
|
|
7303
|
+
function ju(n, e, t) {
|
|
7284
7304
|
let { $head: r } = e.selection;
|
|
7285
7305
|
if (!r.parent.isTextblock)
|
|
7286
7306
|
return !1;
|
|
7287
7307
|
let i = r.parentOffset, s = !i, o = i == r.parent.content.size, l = n.domSelection();
|
|
7288
|
-
return
|
|
7308
|
+
return !$u.test(r.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? s : o : Ul(n, e, () => {
|
|
7289
7309
|
let { focusNode: a, focusOffset: c, anchorNode: d, anchorOffset: u } = n.domSelectionRange(), h = l.caretBidiLevel;
|
|
7290
7310
|
l.modify("move", t, "character");
|
|
7291
7311
|
let f = r.depth ? n.docView.domAfterPos(r.before()) : n.dom, { focusNode: p, focusOffset: m } = n.domSelectionRange(), g = p && !f.contains(p.nodeType == 1 ? p : p.parentNode) || a == p && c == m;
|
|
@@ -7297,8 +7317,8 @@ function $u(n, e, t) {
|
|
|
7297
7317
|
});
|
|
7298
7318
|
}
|
|
7299
7319
|
let Qs = null, Zs = null, eo = !1;
|
|
7300
|
-
function
|
|
7301
|
-
return Qs == e && Zs == t ? eo : (Qs = e, Zs = t, eo = t == "up" || t == "down" ?
|
|
7320
|
+
function qu(n, e, t) {
|
|
7321
|
+
return Qs == e && Zs == t ? eo : (Qs = e, Zs = t, eo = t == "up" || t == "down" ? Vu(n, e, t) : ju(n, e, t));
|
|
7302
7322
|
}
|
|
7303
7323
|
const Se = 0, to = 1, at = 2, Re = 3;
|
|
7304
7324
|
class Sn {
|
|
@@ -7673,7 +7693,7 @@ class Jl extends Sn {
|
|
|
7673
7693
|
return this.widget.type.side;
|
|
7674
7694
|
}
|
|
7675
7695
|
}
|
|
7676
|
-
class
|
|
7696
|
+
class Ku extends Sn {
|
|
7677
7697
|
constructor(e, t, r, i) {
|
|
7678
7698
|
super(e, [], t, null), this.textDOM = r, this.text = i;
|
|
7679
7699
|
}
|
|
@@ -7749,7 +7769,7 @@ class Ze extends Sn {
|
|
|
7749
7769
|
d || ({ dom: d, contentDOM: u } = Ne.renderSpec(document, t.type.spec.toDOM(t)));
|
|
7750
7770
|
!u && !t.isText && d.nodeName != "BR" && (d.hasAttribute("contenteditable") || (d.contentEditable = "false"), t.type.spec.draggable && (d.draggable = !0));
|
|
7751
7771
|
let h = d;
|
|
7752
|
-
return d = Ql(d, r, t), c ? a = new
|
|
7772
|
+
return d = Ql(d, r, t), c ? a = new Wu(e, t, r, i, d, u || null, h, c, s, o + 1) : t.isText ? new Nr(e, t, r, i, d, h, s) : new Ze(e, t, r, i, d, u || null, h, s, o + 1);
|
|
7753
7773
|
}
|
|
7754
7774
|
parseRule() {
|
|
7755
7775
|
if (this.node.type.spec.reparseInView)
|
|
@@ -7785,24 +7805,24 @@ class Ze extends Sn {
|
|
|
7785
7805
|
// separate step, syncs the DOM inside `this.contentDOM` to
|
|
7786
7806
|
// `this.children`.
|
|
7787
7807
|
updateChildren(e, t) {
|
|
7788
|
-
let r = this.node.inlineContent, i = t, s = e.composing ? this.localCompositionInfo(e, t) : null, o = s && s.pos > -1 ? s : null, l = s && s.pos < 0, a = new
|
|
7789
|
-
|
|
7808
|
+
let r = this.node.inlineContent, i = t, s = e.composing ? this.localCompositionInfo(e, t) : null, o = s && s.pos > -1 ? s : null, l = s && s.pos < 0, a = new Ju(this, o && o.node, e);
|
|
7809
|
+
Xu(this.node, this.innerDeco, (c, d, u) => {
|
|
7790
7810
|
c.spec.marks ? a.syncToMarks(c.spec.marks, r, e) : c.type.side >= 0 && !u && a.syncToMarks(d == this.node.childCount ? B.none : this.node.child(d).marks, r, e), a.placeWidget(c, e, i);
|
|
7791
7811
|
}, (c, d, u, h) => {
|
|
7792
7812
|
a.syncToMarks(c.marks, r, e);
|
|
7793
7813
|
let f;
|
|
7794
7814
|
a.findNodeMatch(c, d, u, h) || l && e.state.selection.from > i && e.state.selection.to < i + c.nodeSize && (f = a.findIndexWithChild(s.node)) > -1 && a.updateNodeAt(c, d, u, f, e) || a.updateNextNode(c, d, u, e, h, i) || a.addNode(c, d, u, e, i), i += c.nodeSize;
|
|
7795
|
-
}), a.syncToMarks([], r, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == at) && (o && this.protectLocalComposition(e, o), Yl(this.contentDOM, this.children, e), Ft &&
|
|
7815
|
+
}), a.syncToMarks([], r, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == at) && (o && this.protectLocalComposition(e, o), Yl(this.contentDOM, this.children, e), Ft && Qu(this.dom));
|
|
7796
7816
|
}
|
|
7797
7817
|
localCompositionInfo(e, t) {
|
|
7798
7818
|
let { from: r, to: i } = e.state.selection;
|
|
7799
7819
|
if (!(e.state.selection instanceof D) || r < t || i > t + this.node.content.size)
|
|
7800
7820
|
return null;
|
|
7801
|
-
let s = e.domSelectionRange(), o =
|
|
7821
|
+
let s = e.domSelectionRange(), o = Zu(s.focusNode, s.focusOffset);
|
|
7802
7822
|
if (!o || !this.dom.contains(o.parentNode))
|
|
7803
7823
|
return null;
|
|
7804
7824
|
if (this.node.inlineContent) {
|
|
7805
|
-
let l = o.nodeValue, a =
|
|
7825
|
+
let l = o.nodeValue, a = eh(this.node.content, l, r - t, i - t);
|
|
7806
7826
|
return a < 0 ? null : { node: o, pos: a, text: l };
|
|
7807
7827
|
} else
|
|
7808
7828
|
return { node: o, pos: -1, text: "" };
|
|
@@ -7818,7 +7838,7 @@ class Ze extends Sn {
|
|
|
7818
7838
|
s.parentNode.removeChild(s.nextSibling);
|
|
7819
7839
|
s.pmViewDesc && (s.pmViewDesc = void 0);
|
|
7820
7840
|
}
|
|
7821
|
-
let o = new
|
|
7841
|
+
let o = new Ku(this, s, t, i);
|
|
7822
7842
|
e.input.compositionNodes.push(o), this.children = vi(this.children, r, r + i.length, e, o);
|
|
7823
7843
|
}
|
|
7824
7844
|
// If this desc must be updated to match the given node decoration,
|
|
@@ -7906,7 +7926,7 @@ class Gl extends Sn {
|
|
|
7906
7926
|
return this.dom.nodeName == "IMG";
|
|
7907
7927
|
}
|
|
7908
7928
|
}
|
|
7909
|
-
class
|
|
7929
|
+
class Wu extends Ze {
|
|
7910
7930
|
constructor(e, t, r, i, s, o, l, a, c, d) {
|
|
7911
7931
|
super(e, t, r, i, s, o, l, c, d), this.spec = a;
|
|
7912
7932
|
}
|
|
@@ -7991,11 +8011,11 @@ function Xl(n, e, t, r) {
|
|
|
7991
8011
|
let a;
|
|
7992
8012
|
l && l.nodeName == o.nodeName && i != n && (a = i.parentNode) && a.nodeName.toLowerCase() == o.nodeName || (a = document.createElement(o.nodeName), a.pmIsDeco = !0, a.appendChild(i), l = ct[0]), i = a;
|
|
7993
8013
|
}
|
|
7994
|
-
|
|
8014
|
+
Uu(i, l || ct[0], o);
|
|
7995
8015
|
}
|
|
7996
8016
|
return i;
|
|
7997
8017
|
}
|
|
7998
|
-
function
|
|
8018
|
+
function Uu(n, e, t) {
|
|
7999
8019
|
for (let r in e)
|
|
8000
8020
|
r != "class" && r != "style" && r != "nodeName" && !(r in t) && n.removeAttribute(r);
|
|
8001
8021
|
for (let r in t)
|
|
@@ -8032,9 +8052,9 @@ function ro(n) {
|
|
|
8032
8052
|
let e = n.nextSibling;
|
|
8033
8053
|
return n.parentNode.removeChild(n), e;
|
|
8034
8054
|
}
|
|
8035
|
-
class
|
|
8055
|
+
class Ju {
|
|
8036
8056
|
constructor(e, t, r) {
|
|
8037
|
-
this.lock = t, this.view = r, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch =
|
|
8057
|
+
this.lock = t, this.view = r, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = Gu(e.node.content, e);
|
|
8038
8058
|
}
|
|
8039
8059
|
// Destroy and remove the children between the given indices in
|
|
8040
8060
|
// `this.top`.
|
|
@@ -8182,7 +8202,7 @@ class Uu {
|
|
|
8182
8202
|
return this.lock && (e == this.lock || e.nodeType == 1 && e.contains(this.lock.parentNode));
|
|
8183
8203
|
}
|
|
8184
8204
|
}
|
|
8185
|
-
function
|
|
8205
|
+
function Gu(n, e) {
|
|
8186
8206
|
let t = e, r = t.children.length, i = n.childCount, s = /* @__PURE__ */ new Map(), o = [];
|
|
8187
8207
|
e:
|
|
8188
8208
|
for (; i > 0; ) {
|
|
@@ -8210,10 +8230,10 @@ function Ju(n, e) {
|
|
|
8210
8230
|
}
|
|
8211
8231
|
return { index: i, matched: s, matches: o.reverse() };
|
|
8212
8232
|
}
|
|
8213
|
-
function
|
|
8233
|
+
function Yu(n, e) {
|
|
8214
8234
|
return n.type.side - e.type.side;
|
|
8215
8235
|
}
|
|
8216
|
-
function
|
|
8236
|
+
function Xu(n, e, t, r) {
|
|
8217
8237
|
let i = e.locals(n), s = 0;
|
|
8218
8238
|
if (i.length == 0) {
|
|
8219
8239
|
for (let c = 0; c < n.childCount; c++) {
|
|
@@ -8231,7 +8251,7 @@ function Yu(n, e, t, r) {
|
|
|
8231
8251
|
}
|
|
8232
8252
|
if (d)
|
|
8233
8253
|
if (u) {
|
|
8234
|
-
u.sort(
|
|
8254
|
+
u.sort(Yu);
|
|
8235
8255
|
for (let g = 0; g < u.length; g++)
|
|
8236
8256
|
t(u[g], c, !!a);
|
|
8237
8257
|
} else
|
|
@@ -8259,13 +8279,13 @@ function Yu(n, e, t, r) {
|
|
|
8259
8279
|
r(h, m, e.forChild(s, h), f), s = p;
|
|
8260
8280
|
}
|
|
8261
8281
|
}
|
|
8262
|
-
function
|
|
8282
|
+
function Qu(n) {
|
|
8263
8283
|
if (n.nodeName == "UL" || n.nodeName == "OL") {
|
|
8264
8284
|
let e = n.style.cssText;
|
|
8265
8285
|
n.style.cssText = e + "; list-style: square !important", window.getComputedStyle(n).listStyle, n.style.cssText = e;
|
|
8266
8286
|
}
|
|
8267
8287
|
}
|
|
8268
|
-
function
|
|
8288
|
+
function Zu(n, e) {
|
|
8269
8289
|
for (; ; ) {
|
|
8270
8290
|
if (n.nodeType == 3)
|
|
8271
8291
|
return n;
|
|
@@ -8279,7 +8299,7 @@ function Qu(n, e) {
|
|
|
8279
8299
|
return null;
|
|
8280
8300
|
}
|
|
8281
8301
|
}
|
|
8282
|
-
function
|
|
8302
|
+
function eh(n, e, t, r) {
|
|
8283
8303
|
for (let i = 0, s = 0; i < n.childCount && s <= r; ) {
|
|
8284
8304
|
let o = n.child(i++), l = s;
|
|
8285
8305
|
if (s += o.nodeSize, !o.isText)
|
|
@@ -8323,7 +8343,7 @@ function ts(n, e = null) {
|
|
|
8323
8343
|
for (a = l; i && !i.node; )
|
|
8324
8344
|
i = i.parent;
|
|
8325
8345
|
let d = i.node;
|
|
8326
|
-
if (i && d.isAtom && w.isSelectable(d) && i.parent && !(d.isInline &&
|
|
8346
|
+
if (i && d.isAtom && w.isSelectable(d) && i.parent && !(d.isInline && Tu(t.focusNode, t.focusOffset, i.dom))) {
|
|
8327
8347
|
let u = i.posBefore;
|
|
8328
8348
|
c = new w(o == u ? l : r.resolve(u));
|
|
8329
8349
|
}
|
|
@@ -8353,15 +8373,15 @@ function Fe(n, e = !1) {
|
|
|
8353
8373
|
}
|
|
8354
8374
|
}
|
|
8355
8375
|
if (n.domObserver.disconnectSelection(), n.cursorWrapper)
|
|
8356
|
-
|
|
8376
|
+
nh(n);
|
|
8357
8377
|
else {
|
|
8358
8378
|
let { anchor: r, head: i } = t, s, o;
|
|
8359
|
-
io && !(t instanceof D) && (t.$from.parent.inlineContent || (s = so(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (o = so(n, t.to))), n.docView.setSelection(r, i, n.root, e), io && (s && oo(s), o && oo(o)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document &&
|
|
8379
|
+
io && !(t instanceof D) && (t.$from.parent.inlineContent || (s = so(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (o = so(n, t.to))), n.docView.setSelection(r, i, n.root, e), io && (s && oo(s), o && oo(o)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && th(n));
|
|
8360
8380
|
}
|
|
8361
8381
|
n.domObserver.setCurSelection(), n.domObserver.connectSelection();
|
|
8362
8382
|
}
|
|
8363
8383
|
}
|
|
8364
|
-
const io = le || te &&
|
|
8384
|
+
const io = le || te && Ou < 63;
|
|
8365
8385
|
function so(n, e) {
|
|
8366
8386
|
let { node: t, offset: r } = n.docView.domFromPos(e, 0), i = r < t.childNodes.length ? t.childNodes[r] : null, s = r ? t.childNodes[r - 1] : null;
|
|
8367
8387
|
if (le && i && i.contentEditable == "false")
|
|
@@ -8379,7 +8399,7 @@ function ni(n) {
|
|
|
8379
8399
|
function oo(n) {
|
|
8380
8400
|
n.contentEditable = "false", n.wasDraggable && (n.draggable = !0, n.wasDraggable = null);
|
|
8381
8401
|
}
|
|
8382
|
-
function
|
|
8402
|
+
function th(n) {
|
|
8383
8403
|
let e = n.dom.ownerDocument;
|
|
8384
8404
|
e.removeEventListener("selectionchange", n.input.hideSelectionGuard);
|
|
8385
8405
|
let t = n.domSelectionRange(), r = t.anchorNode, i = t.anchorOffset;
|
|
@@ -8389,7 +8409,7 @@ function eh(n) {
|
|
|
8389
8409
|
}, 20));
|
|
8390
8410
|
});
|
|
8391
8411
|
}
|
|
8392
|
-
function
|
|
8412
|
+
function nh(n) {
|
|
8393
8413
|
let e = n.domSelection(), t = document.createRange(), r = n.cursorWrapper.dom, i = r.nodeName == "IMG";
|
|
8394
8414
|
i ? t.setEnd(r.parentNode, oe(r) + 1) : t.setEnd(r, 0), t.collapse(!1), e.removeAllRanges(), e.addRange(t), !i && !n.state.selection.visible && he && Qe <= 11 && (r.disabled = !0, r.disabled = !1);
|
|
8395
8415
|
}
|
|
@@ -8419,7 +8439,7 @@ function ta(n) {
|
|
|
8419
8439
|
return !1;
|
|
8420
8440
|
}
|
|
8421
8441
|
}
|
|
8422
|
-
function
|
|
8442
|
+
function rh(n) {
|
|
8423
8443
|
let e = n.docView.domFromPos(n.state.selection.anchor, 0), t = n.domSelectionRange();
|
|
8424
8444
|
return Ct(e.node, e.offset, t.anchorNode, t.anchorOffset);
|
|
8425
8445
|
}
|
|
@@ -8469,9 +8489,9 @@ function nn(n, e) {
|
|
|
8469
8489
|
return t && t.size == 0 && (e < 0 || n.nextSibling || n.nodeName != "BR");
|
|
8470
8490
|
}
|
|
8471
8491
|
function Mt(n, e) {
|
|
8472
|
-
return e < 0 ?
|
|
8492
|
+
return e < 0 ? ih(n) : sh(n);
|
|
8473
8493
|
}
|
|
8474
|
-
function
|
|
8494
|
+
function ih(n) {
|
|
8475
8495
|
let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
|
|
8476
8496
|
if (!t)
|
|
8477
8497
|
return;
|
|
@@ -8507,7 +8527,7 @@ function rh(n) {
|
|
|
8507
8527
|
}
|
|
8508
8528
|
o ? Ni(n, t, r) : i && Ni(n, i, s);
|
|
8509
8529
|
}
|
|
8510
|
-
function
|
|
8530
|
+
function sh(n) {
|
|
8511
8531
|
let e = n.domSelectionRange(), t = e.focusNode, r = e.focusOffset;
|
|
8512
8532
|
if (!t)
|
|
8513
8533
|
return;
|
|
@@ -8543,7 +8563,7 @@ function na(n) {
|
|
|
8543
8563
|
let e = n.pmViewDesc;
|
|
8544
8564
|
return e && e.node && e.node.isBlock;
|
|
8545
8565
|
}
|
|
8546
|
-
function
|
|
8566
|
+
function oh(n, e) {
|
|
8547
8567
|
for (; n && e == n.childNodes.length && !Zi(n); )
|
|
8548
8568
|
e = oe(n) + 1, n = n.parentNode;
|
|
8549
8569
|
for (; n && e < n.childNodes.length; ) {
|
|
@@ -8555,7 +8575,7 @@ function sh(n, e) {
|
|
|
8555
8575
|
n = t, e = 0;
|
|
8556
8576
|
}
|
|
8557
8577
|
}
|
|
8558
|
-
function
|
|
8578
|
+
function lh(n, e) {
|
|
8559
8579
|
for (; n && !e && !Zi(n); )
|
|
8560
8580
|
e = oe(n), n = n.parentNode;
|
|
8561
8581
|
for (; n && e; ) {
|
|
@@ -8570,7 +8590,7 @@ function oh(n, e) {
|
|
|
8570
8590
|
function Ni(n, e, t) {
|
|
8571
8591
|
if (e.nodeType != 3) {
|
|
8572
8592
|
let s, o;
|
|
8573
|
-
(o =
|
|
8593
|
+
(o = oh(e, t)) ? (e = o, t = 0) : (s = lh(e, t)) && (e = s, t = s.nodeValue.length);
|
|
8574
8594
|
}
|
|
8575
8595
|
let r = n.domSelection();
|
|
8576
8596
|
if (Ar(r)) {
|
|
@@ -8586,7 +8606,7 @@ function Ni(n, e, t) {
|
|
|
8586
8606
|
}
|
|
8587
8607
|
function uo(n, e) {
|
|
8588
8608
|
let t = n.state.doc.resolve(e);
|
|
8589
|
-
if (!(te ||
|
|
8609
|
+
if (!(te || vu) && t.parent.inlineContent) {
|
|
8590
8610
|
let i = n.coordsAtPos(e);
|
|
8591
8611
|
if (e > t.start()) {
|
|
8592
8612
|
let s = n.coordsAtPos(e - 1), o = (s.top + s.bottom) / 2;
|
|
@@ -8637,7 +8657,7 @@ function fo(n, e) {
|
|
|
8637
8657
|
function po(n, e, t) {
|
|
8638
8658
|
n.domObserver.stop(), e.contentEditable = t, n.domObserver.start();
|
|
8639
8659
|
}
|
|
8640
|
-
function
|
|
8660
|
+
function ah(n) {
|
|
8641
8661
|
if (!le || n.state.selection.$head.parentOffset > 0)
|
|
8642
8662
|
return !1;
|
|
8643
8663
|
let { focusNode: e, focusOffset: t } = n.domSelectionRange();
|
|
@@ -8647,12 +8667,12 @@ function lh(n) {
|
|
|
8647
8667
|
}
|
|
8648
8668
|
return !1;
|
|
8649
8669
|
}
|
|
8650
|
-
function
|
|
8670
|
+
function ch(n) {
|
|
8651
8671
|
let e = "";
|
|
8652
8672
|
return n.ctrlKey && (e += "c"), n.metaKey && (e += "m"), n.altKey && (e += "a"), n.shiftKey && (e += "s"), e;
|
|
8653
8673
|
}
|
|
8654
|
-
function
|
|
8655
|
-
let t = e.keyCode, r =
|
|
8674
|
+
function dh(n, e) {
|
|
8675
|
+
let t = e.keyCode, r = ch(e);
|
|
8656
8676
|
if (t == 8 || ke && t == 72 && r == "c")
|
|
8657
8677
|
return fo(n, -1) || Mt(n, -1);
|
|
8658
8678
|
if (t == 46 && !e.shiftKey || ke && t == 68 && r == "c")
|
|
@@ -8669,7 +8689,7 @@ function ch(n, e) {
|
|
|
8669
8689
|
if (t == 38 || ke && t == 80 && r == "c")
|
|
8670
8690
|
return ho(n, -1, r) || Mt(n, -1);
|
|
8671
8691
|
if (t == 40 || ke && t == 78 && r == "c")
|
|
8672
|
-
return
|
|
8692
|
+
return ah(n) || ho(n, 1, r) || Mt(n, 1);
|
|
8673
8693
|
if (r == (ke ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
|
|
8674
8694
|
return !0;
|
|
8675
8695
|
}
|
|
@@ -8727,7 +8747,7 @@ function ia(n, e, t, r, i) {
|
|
|
8727
8747
|
} else
|
|
8728
8748
|
n.someProp("transformPastedHTML", (u) => {
|
|
8729
8749
|
t = u(t, n);
|
|
8730
|
-
}), o =
|
|
8750
|
+
}), o = fh(t), kn && ph(o);
|
|
8731
8751
|
let c = o && o.querySelector("[data-pm-slice]"), d = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
|
|
8732
8752
|
if (d && d[3])
|
|
8733
8753
|
for (let u = +d[3]; u > 0; u--) {
|
|
@@ -8742,11 +8762,11 @@ function ia(n, e, t, r, i) {
|
|
|
8742
8762
|
preserveWhitespace: !!(a || d),
|
|
8743
8763
|
context: i,
|
|
8744
8764
|
ruleFromNode(h) {
|
|
8745
|
-
return h.nodeName == "BR" && !h.nextSibling && h.parentNode && !
|
|
8765
|
+
return h.nodeName == "BR" && !h.nextSibling && h.parentNode && !uh.test(h.parentNode.nodeName) ? { ignore: !0 } : null;
|
|
8746
8766
|
}
|
|
8747
8767
|
})), d)
|
|
8748
|
-
l =
|
|
8749
|
-
else if (l = S.maxOpen(
|
|
8768
|
+
l = mh(mo(l, +d[1], +d[2]), d[4]);
|
|
8769
|
+
else if (l = S.maxOpen(hh(l.content, i), !0), l.openStart || l.openEnd) {
|
|
8750
8770
|
let u = 0, h = 0;
|
|
8751
8771
|
for (let f = l.content.firstChild; u < l.openStart && !f.type.spec.isolating; u++, f = f.firstChild)
|
|
8752
8772
|
;
|
|
@@ -8758,8 +8778,8 @@ function ia(n, e, t, r, i) {
|
|
|
8758
8778
|
l = u(l, n);
|
|
8759
8779
|
}), l;
|
|
8760
8780
|
}
|
|
8761
|
-
const
|
|
8762
|
-
function
|
|
8781
|
+
const uh = /^(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;
|
|
8782
|
+
function hh(n, e) {
|
|
8763
8783
|
if (n.childCount < 2)
|
|
8764
8784
|
return n;
|
|
8765
8785
|
for (let t = e.depth; t >= 0; t--) {
|
|
@@ -8824,7 +8844,7 @@ let go = null;
|
|
|
8824
8844
|
function ca() {
|
|
8825
8845
|
return go || (go = document.implementation.createHTMLDocument("title"));
|
|
8826
8846
|
}
|
|
8827
|
-
function
|
|
8847
|
+
function fh(n) {
|
|
8828
8848
|
let e = /^(\s*<meta [^>]*>)*/.exec(n);
|
|
8829
8849
|
e && (n = n.slice(e[0].length));
|
|
8830
8850
|
let t = ca().createElement("div"), r = /<([a-z][^>\s]+)/i.exec(n), i;
|
|
@@ -8833,14 +8853,14 @@ function hh(n) {
|
|
|
8833
8853
|
t = t.querySelector(i[s]) || t;
|
|
8834
8854
|
return t;
|
|
8835
8855
|
}
|
|
8836
|
-
function
|
|
8856
|
+
function ph(n) {
|
|
8837
8857
|
let e = n.querySelectorAll(te ? "span:not([class]):not([style])" : "span.Apple-converted-space");
|
|
8838
8858
|
for (let t = 0; t < e.length; t++) {
|
|
8839
8859
|
let r = e[t];
|
|
8840
8860
|
r.childNodes.length == 1 && r.textContent == " " && r.parentNode && r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "), r);
|
|
8841
8861
|
}
|
|
8842
8862
|
}
|
|
8843
|
-
function
|
|
8863
|
+
function mh(n, e) {
|
|
8844
8864
|
if (!n.size)
|
|
8845
8865
|
return n;
|
|
8846
8866
|
let t = n.content.firstChild.type.schema, r;
|
|
@@ -8858,25 +8878,25 @@ function ph(n, e) {
|
|
|
8858
8878
|
}
|
|
8859
8879
|
return new S(i, s, o);
|
|
8860
8880
|
}
|
|
8861
|
-
const ae = {}, ce = {},
|
|
8862
|
-
class
|
|
8881
|
+
const ae = {}, ce = {}, gh = { touchstart: !0, touchmove: !0 };
|
|
8882
|
+
class yh {
|
|
8863
8883
|
constructor() {
|
|
8864
8884
|
this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: "" }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastAndroidDelete = 0, this.composing = !1, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;
|
|
8865
8885
|
}
|
|
8866
8886
|
}
|
|
8867
|
-
function
|
|
8887
|
+
function bh(n) {
|
|
8868
8888
|
for (let e in ae) {
|
|
8869
8889
|
let t = ae[e];
|
|
8870
8890
|
n.dom.addEventListener(e, n.input.eventHandlers[e] = (r) => {
|
|
8871
|
-
|
|
8872
|
-
},
|
|
8891
|
+
Sh(n, r) && !rs(n, r) && (n.editable || !(r.type in ce)) && t(n, r);
|
|
8892
|
+
}, gh[e] ? { passive: !0 } : void 0);
|
|
8873
8893
|
}
|
|
8874
8894
|
le && n.dom.addEventListener("input", () => null), Ii(n);
|
|
8875
8895
|
}
|
|
8876
8896
|
function Xe(n, e) {
|
|
8877
8897
|
n.input.lastSelectionOrigin = e, n.input.lastSelectionTime = Date.now();
|
|
8878
8898
|
}
|
|
8879
|
-
function
|
|
8899
|
+
function kh(n) {
|
|
8880
8900
|
n.domObserver.stop();
|
|
8881
8901
|
for (let e in n.input.eventHandlers)
|
|
8882
8902
|
n.dom.removeEventListener(e, n.input.eventHandlers[e]);
|
|
@@ -8894,7 +8914,7 @@ function rs(n, e) {
|
|
|
8894
8914
|
return r ? r(n, e) || e.defaultPrevented : !1;
|
|
8895
8915
|
});
|
|
8896
8916
|
}
|
|
8897
|
-
function
|
|
8917
|
+
function Sh(n, e) {
|
|
8898
8918
|
if (!e.bubbles)
|
|
8899
8919
|
return !0;
|
|
8900
8920
|
if (e.defaultPrevented)
|
|
@@ -8904,7 +8924,7 @@ function kh(n, e) {
|
|
|
8904
8924
|
return !1;
|
|
8905
8925
|
return !0;
|
|
8906
8926
|
}
|
|
8907
|
-
function
|
|
8927
|
+
function xh(n, e) {
|
|
8908
8928
|
!rs(n, e) && ae[e.type] && (n.editable || !(e.type in ce)) && ae[e.type](n, e);
|
|
8909
8929
|
}
|
|
8910
8930
|
ce.keydown = (n, e) => {
|
|
@@ -8916,7 +8936,7 @@ ce.keydown = (n, e) => {
|
|
|
8916
8936
|
n.input.lastIOSEnter == r && (n.someProp("handleKeyDown", (i) => i(n, lt(13, "Enter"))), n.input.lastIOSEnter = 0);
|
|
8917
8937
|
}, 200);
|
|
8918
8938
|
} else
|
|
8919
|
-
n.someProp("handleKeyDown", (r) => r(n, t)) ||
|
|
8939
|
+
n.someProp("handleKeyDown", (r) => r(n, t)) || dh(n, t) ? t.preventDefault() : Xe(n, "key");
|
|
8920
8940
|
};
|
|
8921
8941
|
ce.keyup = (n, e) => {
|
|
8922
8942
|
e.keyCode == 16 && (n.input.shiftKey = !1);
|
|
@@ -8938,7 +8958,7 @@ ce.keypress = (n, e) => {
|
|
|
8938
8958
|
function Dr(n) {
|
|
8939
8959
|
return { left: n.clientX, top: n.clientY };
|
|
8940
8960
|
}
|
|
8941
|
-
function
|
|
8961
|
+
function Ch(n, e) {
|
|
8942
8962
|
let t = e.x - n.clientX, r = e.y - n.clientY;
|
|
8943
8963
|
return t * t + r * r < 100;
|
|
8944
8964
|
}
|
|
@@ -8956,13 +8976,13 @@ function Lt(n, e, t) {
|
|
|
8956
8976
|
let r = n.state.tr.setSelection(e);
|
|
8957
8977
|
t == "pointer" && r.setMeta("pointer", !0), n.dispatch(r);
|
|
8958
8978
|
}
|
|
8959
|
-
function
|
|
8979
|
+
function Eh(n, e) {
|
|
8960
8980
|
if (e == -1)
|
|
8961
8981
|
return !1;
|
|
8962
8982
|
let t = n.state.doc.resolve(e), r = t.nodeAfter;
|
|
8963
8983
|
return r && r.isAtom && w.isSelectable(r) ? (Lt(n, new w(t), "pointer"), !0) : !1;
|
|
8964
8984
|
}
|
|
8965
|
-
function
|
|
8985
|
+
function Th(n, e) {
|
|
8966
8986
|
if (e == -1)
|
|
8967
8987
|
return !1;
|
|
8968
8988
|
let t = n.state.selection, r, i;
|
|
@@ -8977,16 +8997,16 @@ function Eh(n, e) {
|
|
|
8977
8997
|
}
|
|
8978
8998
|
return i != null ? (Lt(n, w.create(n.state.doc, i), "pointer"), !0) : !1;
|
|
8979
8999
|
}
|
|
8980
|
-
function
|
|
8981
|
-
return is(n, "handleClickOn", e, t, r) || n.someProp("handleClick", (s) => s(n, e, r)) || (i ?
|
|
9000
|
+
function Mh(n, e, t, r, i) {
|
|
9001
|
+
return is(n, "handleClickOn", e, t, r) || n.someProp("handleClick", (s) => s(n, e, r)) || (i ? Th(n, t) : Eh(n, t));
|
|
8982
9002
|
}
|
|
8983
|
-
function
|
|
9003
|
+
function wh(n, e, t, r) {
|
|
8984
9004
|
return is(n, "handleDoubleClickOn", e, t, r) || n.someProp("handleDoubleClick", (i) => i(n, e, r));
|
|
8985
9005
|
}
|
|
8986
|
-
function
|
|
8987
|
-
return is(n, "handleTripleClickOn", e, t, r) || n.someProp("handleTripleClick", (i) => i(n, e, r)) ||
|
|
9006
|
+
function Oh(n, e, t, r) {
|
|
9007
|
+
return is(n, "handleTripleClickOn", e, t, r) || n.someProp("handleTripleClick", (i) => i(n, e, r)) || vh(n, t, r);
|
|
8988
9008
|
}
|
|
8989
|
-
function
|
|
9009
|
+
function vh(n, e, t) {
|
|
8990
9010
|
if (t.button != 0)
|
|
8991
9011
|
return !1;
|
|
8992
9012
|
let r = n.state.doc;
|
|
@@ -9012,11 +9032,11 @@ ae.mousedown = (n, e) => {
|
|
|
9012
9032
|
let t = e;
|
|
9013
9033
|
n.input.shiftKey = t.shiftKey;
|
|
9014
9034
|
let r = ss(n), i = Date.now(), s = "singleClick";
|
|
9015
|
-
i - n.input.lastClick.time < 500 &&
|
|
9035
|
+
i - n.input.lastClick.time < 500 && Ch(t, n.input.lastClick) && !t[da] && (n.input.lastClick.type == "singleClick" ? s = "doubleClick" : n.input.lastClick.type == "doubleClick" && (s = "tripleClick")), n.input.lastClick = { time: i, x: t.clientX, y: t.clientY, type: s };
|
|
9016
9036
|
let o = n.posAtCoords(Dr(t));
|
|
9017
|
-
o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new
|
|
9037
|
+
o && (s == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Ah(n, o, t, !!r)) : (s == "doubleClick" ? wh : Oh)(n, o.pos, o.inside, t) ? t.preventDefault() : Xe(n, "pointer"));
|
|
9018
9038
|
};
|
|
9019
|
-
class
|
|
9039
|
+
class Ah {
|
|
9020
9040
|
constructor(e, t, r, i) {
|
|
9021
9041
|
this.view = e, this.pos = t, this.event = r, this.flushed = i, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!r[da], this.allowDefault = r.shiftKey;
|
|
9022
9042
|
let s, o;
|
|
@@ -9045,7 +9065,7 @@ class vh {
|
|
|
9045
9065
|
if (this.done(), !this.view.dom.contains(e.target))
|
|
9046
9066
|
return;
|
|
9047
9067
|
let t = this.pos;
|
|
9048
|
-
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(Dr(e))), this.updateAllowDefault(e), this.allowDefault || !t ? Xe(this.view, "pointer") :
|
|
9068
|
+
this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(Dr(e))), this.updateAllowDefault(e), this.allowDefault || !t ? Xe(this.view, "pointer") : Mh(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
|
|
9049
9069
|
le && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
|
|
9050
9070
|
// cursor, but still report that the node is selected
|
|
9051
9071
|
// when asked through getSelection. You'll then get a
|
|
@@ -9072,7 +9092,7 @@ ae.contextmenu = (n) => ss(n);
|
|
|
9072
9092
|
function ua(n, e) {
|
|
9073
9093
|
return n.composing ? !0 : le && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
|
|
9074
9094
|
}
|
|
9075
|
-
const
|
|
9095
|
+
const Nh = Ee ? 5e3 : -1;
|
|
9076
9096
|
ce.compositionstart = ce.compositionupdate = (n) => {
|
|
9077
9097
|
if (!n.composing) {
|
|
9078
9098
|
n.domObserver.flush();
|
|
@@ -9094,7 +9114,7 @@ ce.compositionstart = ce.compositionupdate = (n) => {
|
|
|
9094
9114
|
}
|
|
9095
9115
|
n.input.composing = !0;
|
|
9096
9116
|
}
|
|
9097
|
-
ha(n,
|
|
9117
|
+
ha(n, Nh);
|
|
9098
9118
|
};
|
|
9099
9119
|
ce.compositionend = (n, e) => {
|
|
9100
9120
|
n.composing && (n.input.composing = !1, n.input.compositionEndedAt = e.timeStamp, n.input.compositionPendingChanges = n.domObserver.pendingRecords().length ? n.input.compositionID : 0, n.input.compositionPendingChanges && Promise.resolve().then(() => n.domObserver.flush()), n.input.compositionID++, ha(n, 20));
|
|
@@ -9103,10 +9123,10 @@ function ha(n, e) {
|
|
|
9103
9123
|
clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => Vn(n), e));
|
|
9104
9124
|
}
|
|
9105
9125
|
function fa(n) {
|
|
9106
|
-
for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt =
|
|
9126
|
+
for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Dh()); n.input.compositionNodes.length > 0; )
|
|
9107
9127
|
n.input.compositionNodes.pop().markParentsDirty();
|
|
9108
9128
|
}
|
|
9109
|
-
function
|
|
9129
|
+
function Dh() {
|
|
9110
9130
|
let n = document.createEvent("Event");
|
|
9111
9131
|
return n.initEvent("event", !0, !0), n.timeStamp;
|
|
9112
9132
|
}
|
|
@@ -9119,7 +9139,7 @@ function Vn(n, e = !1) {
|
|
|
9119
9139
|
return !1;
|
|
9120
9140
|
}
|
|
9121
9141
|
}
|
|
9122
|
-
function
|
|
9142
|
+
function Ih(n, e) {
|
|
9123
9143
|
if (!n.dom.parentNode)
|
|
9124
9144
|
return;
|
|
9125
9145
|
let t = n.dom.parentNode.appendChild(document.createElement("div"));
|
|
@@ -9129,18 +9149,18 @@ function Dh(n, e) {
|
|
|
9129
9149
|
t.parentNode && t.parentNode.removeChild(t), n.focus();
|
|
9130
9150
|
}, 50);
|
|
9131
9151
|
}
|
|
9132
|
-
const un = he && Qe < 15 || Ft &&
|
|
9152
|
+
const un = he && Qe < 15 || Ft && Au < 604;
|
|
9133
9153
|
ae.copy = ce.cut = (n, e) => {
|
|
9134
9154
|
let t = e, r = n.state.selection, i = t.type == "cut";
|
|
9135
9155
|
if (r.empty)
|
|
9136
9156
|
return;
|
|
9137
9157
|
let s = un ? null : t.clipboardData, o = r.content(), { dom: l, text: a } = ra(n, o);
|
|
9138
|
-
s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) :
|
|
9158
|
+
s ? (t.preventDefault(), s.clearData(), s.setData("text/html", l.innerHTML), s.setData("text/plain", a)) : Ih(n, l), i && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
|
|
9139
9159
|
};
|
|
9140
|
-
function
|
|
9160
|
+
function Rh(n) {
|
|
9141
9161
|
return n.openStart == 0 && n.openEnd == 0 && n.content.childCount == 1 ? n.content.firstChild : null;
|
|
9142
9162
|
}
|
|
9143
|
-
function
|
|
9163
|
+
function Ph(n, e) {
|
|
9144
9164
|
if (!n.dom.parentNode)
|
|
9145
9165
|
return;
|
|
9146
9166
|
let t = n.input.shiftKey || n.state.selection.$from.parent.type.spec.code, r = n.dom.parentNode.appendChild(document.createElement(t ? "textarea" : "div"));
|
|
@@ -9156,7 +9176,7 @@ function hn(n, e, t, r, i) {
|
|
|
9156
9176
|
return !0;
|
|
9157
9177
|
if (!s)
|
|
9158
9178
|
return !1;
|
|
9159
|
-
let o =
|
|
9179
|
+
let o = Rh(s), l = o ? n.state.tr.replaceSelectionWith(o, r) : n.state.tr.replaceSelection(s);
|
|
9160
9180
|
return n.dispatch(l.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
|
|
9161
9181
|
}
|
|
9162
9182
|
function pa(n) {
|
|
@@ -9171,9 +9191,9 @@ ce.paste = (n, e) => {
|
|
|
9171
9191
|
if (n.composing && !Ee)
|
|
9172
9192
|
return;
|
|
9173
9193
|
let r = un ? null : t.clipboardData, i = n.input.shiftKey && n.input.lastKeyCode != 45;
|
|
9174
|
-
r && hn(n, pa(r), r.getData("text/html"), i, t) ? t.preventDefault() :
|
|
9194
|
+
r && hn(n, pa(r), r.getData("text/html"), i, t) ? t.preventDefault() : Ph(n, t);
|
|
9175
9195
|
};
|
|
9176
|
-
class
|
|
9196
|
+
class Lh {
|
|
9177
9197
|
constructor(e, t) {
|
|
9178
9198
|
this.slice = e, this.move = t;
|
|
9179
9199
|
}
|
|
@@ -9193,7 +9213,7 @@ ae.dragstart = (n, e) => {
|
|
|
9193
9213
|
}
|
|
9194
9214
|
}
|
|
9195
9215
|
let o = n.state.selection.content(), { dom: l, text: a } = ra(n, o);
|
|
9196
|
-
t.dataTransfer.clearData(), t.dataTransfer.setData(un ? "Text" : "text/html", l.innerHTML), t.dataTransfer.effectAllowed = "copyMove", un || t.dataTransfer.setData("text/plain", a), n.dragging = new
|
|
9216
|
+
t.dataTransfer.clearData(), t.dataTransfer.setData(un ? "Text" : "text/html", l.innerHTML), t.dataTransfer.effectAllowed = "copyMove", un || t.dataTransfer.setData("text/plain", a), n.dragging = new Lh(o, !t[ma]);
|
|
9197
9217
|
};
|
|
9198
9218
|
ae.dragend = (n) => {
|
|
9199
9219
|
let e = n.dragging;
|
|
@@ -9221,7 +9241,7 @@ ce.drop = (n, e) => {
|
|
|
9221
9241
|
if (!o)
|
|
9222
9242
|
return;
|
|
9223
9243
|
t.preventDefault();
|
|
9224
|
-
let a = o ?
|
|
9244
|
+
let a = o ? hu(n.state.doc, s.pos, o) : s.pos;
|
|
9225
9245
|
a == null && (a = s.pos);
|
|
9226
9246
|
let c = n.state.tr;
|
|
9227
9247
|
l && c.deleteSelection();
|
|
@@ -9456,7 +9476,7 @@ class H {
|
|
|
9456
9476
|
let a = this.local[l].map(e, r, i);
|
|
9457
9477
|
a && a.type.valid(t, a) ? (o || (o = [])).push(a) : s.onRemove && s.onRemove(this.local[l].spec);
|
|
9458
9478
|
}
|
|
9459
|
-
return this.children.length ?
|
|
9479
|
+
return this.children.length ? Bh(this.children, o || [], e, t, r, i, s) : o ? new H(o.sort(bt), At) : ee;
|
|
9460
9480
|
}
|
|
9461
9481
|
/**
|
|
9462
9482
|
Add the given array of decorations to the ones in the set,
|
|
@@ -9630,7 +9650,7 @@ class Ue {
|
|
|
9630
9650
|
}
|
|
9631
9651
|
}
|
|
9632
9652
|
}
|
|
9633
|
-
function
|
|
9653
|
+
function Bh(n, e, t, r, i, s, o) {
|
|
9634
9654
|
let l = n.slice();
|
|
9635
9655
|
for (let c = 0, d = s; c < t.maps.length; c++) {
|
|
9636
9656
|
let u = 0;
|
|
@@ -9666,7 +9686,7 @@ function Lh(n, e, t, r, i, s, o) {
|
|
|
9666
9686
|
a = !0;
|
|
9667
9687
|
}
|
|
9668
9688
|
if (a) {
|
|
9669
|
-
let c =
|
|
9689
|
+
let c = _h(l, n, e, t, i, s, o), d = jn(c, r, 0, o);
|
|
9670
9690
|
e = d.local;
|
|
9671
9691
|
for (let u = 0; u < l.length; u += 3)
|
|
9672
9692
|
l[u + 1] < 0 && (l.splice(u, 3), u -= 3);
|
|
@@ -9689,7 +9709,7 @@ function ga(n, e) {
|
|
|
9689
9709
|
}
|
|
9690
9710
|
return t;
|
|
9691
9711
|
}
|
|
9692
|
-
function
|
|
9712
|
+
function _h(n, e, t, r, i, s, o) {
|
|
9693
9713
|
function l(a, c) {
|
|
9694
9714
|
for (let d = 0; d < a.local.length; d++) {
|
|
9695
9715
|
let u = a.local[d].map(r, i, c);
|
|
@@ -9764,15 +9784,15 @@ function ri(n) {
|
|
|
9764
9784
|
r && r != ee && e.push(r);
|
|
9765
9785
|
}), n.cursorWrapper && e.push(H.create(n.state.doc, [n.cursorWrapper.deco])), Ue.from(e);
|
|
9766
9786
|
}
|
|
9767
|
-
const
|
|
9787
|
+
const Fh = {
|
|
9768
9788
|
childList: !0,
|
|
9769
9789
|
characterData: !0,
|
|
9770
9790
|
characterDataOldValue: !0,
|
|
9771
9791
|
attributes: !0,
|
|
9772
9792
|
attributeOldValue: !0,
|
|
9773
9793
|
subtree: !0
|
|
9774
|
-
},
|
|
9775
|
-
class
|
|
9794
|
+
}, zh = he && Qe <= 11;
|
|
9795
|
+
class Hh {
|
|
9776
9796
|
constructor() {
|
|
9777
9797
|
this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
|
|
9778
9798
|
}
|
|
@@ -9786,13 +9806,13 @@ class zh {
|
|
|
9786
9806
|
return e.anchorNode == this.anchorNode && e.anchorOffset == this.anchorOffset && e.focusNode == this.focusNode && e.focusOffset == this.focusOffset;
|
|
9787
9807
|
}
|
|
9788
9808
|
}
|
|
9789
|
-
class
|
|
9809
|
+
class Vh {
|
|
9790
9810
|
constructor(e, t) {
|
|
9791
|
-
this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new
|
|
9811
|
+
this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new Hh(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.observer = window.MutationObserver && new window.MutationObserver((r) => {
|
|
9792
9812
|
for (let i = 0; i < r.length; i++)
|
|
9793
9813
|
this.queue.push(r[i]);
|
|
9794
9814
|
he && Qe <= 11 && r.some((i) => i.type == "childList" && i.removedNodes.length || i.type == "characterData" && i.oldValue.length > i.target.nodeValue.length) ? this.flushSoon() : this.flush();
|
|
9795
|
-
}),
|
|
9815
|
+
}), zh && (this.onCharData = (r) => {
|
|
9796
9816
|
this.queue.push({ target: r.target, type: "characterData", oldValue: r.prevValue }), this.flushSoon();
|
|
9797
9817
|
}), this.onSelectionChange = this.onSelectionChange.bind(this);
|
|
9798
9818
|
}
|
|
@@ -9805,7 +9825,7 @@ class Hh {
|
|
|
9805
9825
|
this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush());
|
|
9806
9826
|
}
|
|
9807
9827
|
start() {
|
|
9808
|
-
this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom,
|
|
9828
|
+
this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, Fh)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
|
|
9809
9829
|
}
|
|
9810
9830
|
stop() {
|
|
9811
9831
|
if (this.observer) {
|
|
@@ -9887,7 +9907,7 @@ class Hh {
|
|
|
9887
9907
|
}
|
|
9888
9908
|
}
|
|
9889
9909
|
let c = null;
|
|
9890
|
-
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Ar(r) && (c = ts(e)) && c.eq(N.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Fe(e), this.currentSelection.set(r), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o),
|
|
9910
|
+
s < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Ar(r) && (c = ts(e)) && c.eq(N.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Fe(e), this.currentSelection.set(r), e.scrollToSelection()) : (s > -1 || i) && (s > -1 && (e.docView.markDirty(s, o), $h(e)), this.handleDOMChange(s, o, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || Fe(e), this.currentSelection.set(r));
|
|
9891
9911
|
}
|
|
9892
9912
|
registerMutation(e, t) {
|
|
9893
9913
|
if (t.indexOf(e.target) > -1)
|
|
@@ -9922,14 +9942,14 @@ class Hh {
|
|
|
9922
9942
|
}
|
|
9923
9943
|
}
|
|
9924
9944
|
let bo = /* @__PURE__ */ new WeakMap(), ko = !1;
|
|
9925
|
-
function
|
|
9945
|
+
function $h(n) {
|
|
9926
9946
|
if (!bo.has(n) && (bo.set(n, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace) !== -1)) {
|
|
9927
9947
|
if (n.requiresGeckoHackNode = Me, ko)
|
|
9928
9948
|
return;
|
|
9929
9949
|
console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."), ko = !0;
|
|
9930
9950
|
}
|
|
9931
9951
|
}
|
|
9932
|
-
function
|
|
9952
|
+
function jh(n) {
|
|
9933
9953
|
let e;
|
|
9934
9954
|
function t(a) {
|
|
9935
9955
|
a.preventDefault(), a.stopImmediatePropagation(), e = a.getTargetRanges()[0];
|
|
@@ -9938,7 +9958,7 @@ function $h(n) {
|
|
|
9938
9958
|
let r = e.startContainer, i = e.startOffset, s = e.endContainer, o = e.endOffset, l = n.domAtPos(n.state.selection.anchor);
|
|
9939
9959
|
return Ct(l.node, l.offset, s, o) && ([r, i, s, o] = [s, o, r, i]), { anchorNode: r, anchorOffset: i, focusNode: s, focusOffset: o };
|
|
9940
9960
|
}
|
|
9941
|
-
function
|
|
9961
|
+
function qh(n, e, t) {
|
|
9942
9962
|
let { node: r, fromOffset: i, toOffset: s, from: o, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, d = a.anchorNode;
|
|
9943
9963
|
if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], Ar(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), te && n.input.lastKeyCode === 8)
|
|
9944
9964
|
for (let g = s; g > i; g--) {
|
|
@@ -9958,7 +9978,7 @@ function jh(n, e, t) {
|
|
|
9958
9978
|
to: s,
|
|
9959
9979
|
preserveWhitespace: f.parent.type.whitespace == "pre" ? "full" : !0,
|
|
9960
9980
|
findPositions: c,
|
|
9961
|
-
ruleFromNode:
|
|
9981
|
+
ruleFromNode: Kh,
|
|
9962
9982
|
context: f
|
|
9963
9983
|
});
|
|
9964
9984
|
if (c && c[0].pos != null) {
|
|
@@ -9967,7 +9987,7 @@ function jh(n, e, t) {
|
|
|
9967
9987
|
}
|
|
9968
9988
|
return { doc: m, sel: p, from: o, to: l };
|
|
9969
9989
|
}
|
|
9970
|
-
function
|
|
9990
|
+
function Kh(n) {
|
|
9971
9991
|
let e = n.pmViewDesc;
|
|
9972
9992
|
if (e)
|
|
9973
9993
|
return e.parseRule();
|
|
@@ -9981,8 +10001,8 @@ function qh(n) {
|
|
|
9981
10001
|
return { ignore: !0 };
|
|
9982
10002
|
return null;
|
|
9983
10003
|
}
|
|
9984
|
-
const
|
|
9985
|
-
function
|
|
10004
|
+
const Wh = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
|
|
10005
|
+
function Uh(n, e, t, r, i) {
|
|
9986
10006
|
let s = n.input.compositionPendingChanges || (n.composing ? n.input.compositionID : 0);
|
|
9987
10007
|
if (n.input.compositionPendingChanges = 0, e < 0) {
|
|
9988
10008
|
let M = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, Z = ts(n, M);
|
|
@@ -9996,10 +10016,10 @@ function Wh(n, e, t, r, i) {
|
|
|
9996
10016
|
}
|
|
9997
10017
|
let o = n.state.doc.resolve(e), l = o.sharedDepth(t);
|
|
9998
10018
|
e = o.before(l + 1), t = n.state.doc.resolve(t).after(l + 1);
|
|
9999
|
-
let a = n.state.selection, c =
|
|
10019
|
+
let a = n.state.selection, c = qh(n, e, t), d = n.state.doc, u = d.slice(c.from, c.to), h, f;
|
|
10000
10020
|
n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (h = n.state.selection.to, f = "end") : (h = n.state.selection.from, f = "start"), n.input.lastKeyCode = null;
|
|
10001
|
-
let p =
|
|
10002
|
-
if ((Ft && n.input.lastIOSEnter > Date.now() - 225 || Ee) && i.some((M) => M.nodeType == 1 && !
|
|
10021
|
+
let p = Yh(u.content, c.doc.content, c.from, h, f);
|
|
10022
|
+
if ((Ft && n.input.lastIOSEnter > Date.now() - 225 || Ee) && i.some((M) => M.nodeType == 1 && !Wh.test(M.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (M) => M(n, lt(13, "Enter")))) {
|
|
10003
10023
|
n.input.lastIOSEnter = 0;
|
|
10004
10024
|
return;
|
|
10005
10025
|
}
|
|
@@ -10026,7 +10046,7 @@ function Wh(n, e, t, r, i) {
|
|
|
10026
10046
|
n.input.lastIOSEnter = 0;
|
|
10027
10047
|
return;
|
|
10028
10048
|
}
|
|
10029
|
-
if (n.state.selection.anchor > p.start &&
|
|
10049
|
+
if (n.state.selection.anchor > p.start && Gh(d, p.start, p.endA, m, g) && n.someProp("handleKeyDown", (M) => M(n, lt(8, "Backspace")))) {
|
|
10030
10050
|
Ee && te && n.domObserver.suppressSelectionUpdates();
|
|
10031
10051
|
return;
|
|
10032
10052
|
}
|
|
@@ -10041,7 +10061,7 @@ function Wh(n, e, t, r, i) {
|
|
|
10041
10061
|
he && Qe <= 11 && m.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => Fe(n), 20)), E = n.state.tr.delete(R, P), L = d.resolve(p.start).marksAcross(d.resolve(p.endA));
|
|
10042
10062
|
else if (
|
|
10043
10063
|
// Adding or removing a mark
|
|
10044
|
-
p.endA == p.endB && (I =
|
|
10064
|
+
p.endA == p.endB && (I = Jh(m.parent.content.cut(m.parentOffset, g.parentOffset), y.parent.content.cut(y.parentOffset, p.endA - y.start())))
|
|
10045
10065
|
)
|
|
10046
10066
|
E = n.state.tr, I.type == "add" ? E.addMark(R, P, I.mark) : E.removeMark(R, P, I.mark);
|
|
10047
10067
|
else if (m.parent.child(m.index()).isText && m.index() == g.index() - (g.textOffset ? 0 : 1)) {
|
|
@@ -10060,7 +10080,7 @@ function Wh(n, e, t, r, i) {
|
|
|
10060
10080
|
function So(n, e, t) {
|
|
10061
10081
|
return Math.max(t.anchor, t.head) > e.content.size ? null : ns(n, e.resolve(t.anchor), e.resolve(t.head));
|
|
10062
10082
|
}
|
|
10063
|
-
function
|
|
10083
|
+
function Jh(n, e) {
|
|
10064
10084
|
let t = n.firstChild.marks, r = e.firstChild.marks, i = t, s = r, o, l, a;
|
|
10065
10085
|
for (let d = 0; d < r.length; d++)
|
|
10066
10086
|
i = r[d].removeFromSet(i);
|
|
@@ -10078,7 +10098,7 @@ function Uh(n, e) {
|
|
|
10078
10098
|
if (b.from(c).eq(n))
|
|
10079
10099
|
return { mark: l, type: o };
|
|
10080
10100
|
}
|
|
10081
|
-
function
|
|
10101
|
+
function Gh(n, e, t, r, i) {
|
|
10082
10102
|
if (!r.parent.isTextblock || // The content must have shrunk
|
|
10083
10103
|
t - e <= i.pos - r.pos || // newEnd must point directly at or after the end of the block that newStart points into
|
|
10084
10104
|
ii(r, !0, !1) < i.pos)
|
|
@@ -10100,7 +10120,7 @@ function ii(n, e, t) {
|
|
|
10100
10120
|
}
|
|
10101
10121
|
return i;
|
|
10102
10122
|
}
|
|
10103
|
-
function
|
|
10123
|
+
function Yh(n, e, t, r, i) {
|
|
10104
10124
|
let s = n.findDiffStart(e, t);
|
|
10105
10125
|
if (s == null)
|
|
10106
10126
|
return null;
|
|
@@ -10118,7 +10138,7 @@ function Gh(n, e, t, r, i) {
|
|
|
10118
10138
|
}
|
|
10119
10139
|
return { start: s, endA: o, endB: l };
|
|
10120
10140
|
}
|
|
10121
|
-
class
|
|
10141
|
+
class Xh {
|
|
10122
10142
|
/**
|
|
10123
10143
|
Create a view. `place` may be a DOM node that the editor should
|
|
10124
10144
|
be appended to, a function that will place it into the document,
|
|
@@ -10127,7 +10147,7 @@ class Yh {
|
|
|
10127
10147
|
added to the document.
|
|
10128
10148
|
*/
|
|
10129
10149
|
constructor(e, t) {
|
|
10130
|
-
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new
|
|
10150
|
+
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new yh(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(Mo), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Eo(this), Co(this), this.nodeViews = To(this), this.docView = no(this.state.doc, xo(this), ri(this), this.dom, this), this.domObserver = new Vh(this, (r, i, s, o) => Uh(this, r, i, s, o)), this.domObserver.start(), bh(this), this.updatePluginViews();
|
|
10131
10151
|
}
|
|
10132
10152
|
/**
|
|
10133
10153
|
Holds `true` when a
|
|
@@ -10186,22 +10206,22 @@ class Yh {
|
|
|
10186
10206
|
let o = r.plugins != e.plugins || this._props.plugins != t.plugins;
|
|
10187
10207
|
if (o || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
|
|
10188
10208
|
let h = To(this);
|
|
10189
|
-
|
|
10209
|
+
Zh(h, this.nodeViews) && (this.nodeViews = h, i = !0);
|
|
10190
10210
|
}
|
|
10191
10211
|
(o || t.handleDOMEvents != this._props.handleDOMEvents) && Ii(this), this.editable = Eo(this), Co(this);
|
|
10192
10212
|
let l = ri(this), a = xo(this), c = r.plugins != e.plugins && !r.doc.eq(e.doc) ? "reset" : e.scrollToSelection > r.scrollToSelection ? "to selection" : "preserve", d = i || !this.docView.matchesNode(e.doc, a, l);
|
|
10193
10213
|
(d || !e.selection.eq(r.selection)) && (s = !0);
|
|
10194
|
-
let u = c == "preserve" && s && this.dom.style.overflowAnchor == null &&
|
|
10214
|
+
let u = c == "preserve" && s && this.dom.style.overflowAnchor == null && Iu(this);
|
|
10195
10215
|
if (s) {
|
|
10196
10216
|
this.domObserver.stop();
|
|
10197
|
-
let h = d && (he || te) && !this.composing && !r.selection.empty && !e.selection.empty &&
|
|
10217
|
+
let h = d && (he || te) && !this.composing && !r.selection.empty && !e.selection.empty && Qh(r.selection, e.selection);
|
|
10198
10218
|
if (d) {
|
|
10199
10219
|
let f = te ? this.trackWrites = this.domSelectionRange().focusNode : null;
|
|
10200
10220
|
(i || !this.docView.update(e.doc, a, l, this)) && (this.docView.updateOuterDeco([]), this.docView.destroy(), this.docView = no(e.doc, a, l, this.dom, this)), f && !this.trackWrites && (h = !0);
|
|
10201
10221
|
}
|
|
10202
|
-
h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) &&
|
|
10222
|
+
h || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && rh(this)) ? Fe(this, h) : (ea(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
|
|
10203
10223
|
}
|
|
10204
|
-
this.updatePluginViews(r), c == "reset" ? this.dom.scrollTop = 0 : c == "to selection" ? this.scrollToSelection() : u &&
|
|
10224
|
+
this.updatePluginViews(r), c == "reset" ? this.dom.scrollTop = 0 : c == "to selection" ? this.scrollToSelection() : u && Ru(u);
|
|
10205
10225
|
}
|
|
10206
10226
|
/**
|
|
10207
10227
|
@internal
|
|
@@ -10277,7 +10297,7 @@ class Yh {
|
|
|
10277
10297
|
Focus the editor.
|
|
10278
10298
|
*/
|
|
10279
10299
|
focus() {
|
|
10280
|
-
this.domObserver.stop(), this.editable &&
|
|
10300
|
+
this.domObserver.stop(), this.editable && Pu(this.dom), Fe(this), this.domObserver.start();
|
|
10281
10301
|
}
|
|
10282
10302
|
/**
|
|
10283
10303
|
Get the document root in which the editor exists. This will
|
|
@@ -10311,7 +10331,7 @@ class Yh {
|
|
|
10311
10331
|
the top level, not in any node.
|
|
10312
10332
|
*/
|
|
10313
10333
|
posAtCoords(e) {
|
|
10314
|
-
return
|
|
10334
|
+
return zu(this, e);
|
|
10315
10335
|
}
|
|
10316
10336
|
/**
|
|
10317
10337
|
Returns the viewport rectangle at a given document position.
|
|
@@ -10376,7 +10396,7 @@ class Yh {
|
|
|
10376
10396
|
pass a different state.
|
|
10377
10397
|
*/
|
|
10378
10398
|
endOfTextblock(e, t) {
|
|
10379
|
-
return
|
|
10399
|
+
return qu(this, t || this.state, e);
|
|
10380
10400
|
}
|
|
10381
10401
|
/**
|
|
10382
10402
|
Run the editor's paste logic with the given HTML string. The
|
|
@@ -10397,7 +10417,7 @@ class Yh {
|
|
|
10397
10417
|
views](https://prosemirror.net/docs/ref/#view.NodeView).
|
|
10398
10418
|
*/
|
|
10399
10419
|
destroy() {
|
|
10400
|
-
this.docView && (
|
|
10420
|
+
this.docView && (kh(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], ri(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null);
|
|
10401
10421
|
}
|
|
10402
10422
|
/**
|
|
10403
10423
|
This is true when the view has been
|
|
@@ -10411,7 +10431,7 @@ class Yh {
|
|
|
10411
10431
|
Used for testing.
|
|
10412
10432
|
*/
|
|
10413
10433
|
dispatchEvent(e) {
|
|
10414
|
-
return
|
|
10434
|
+
return xh(this, e);
|
|
10415
10435
|
}
|
|
10416
10436
|
/**
|
|
10417
10437
|
Dispatch a transaction. Will call
|
|
@@ -10430,7 +10450,7 @@ class Yh {
|
|
|
10430
10450
|
@internal
|
|
10431
10451
|
*/
|
|
10432
10452
|
domSelectionRange() {
|
|
10433
|
-
return le && this.root.nodeType === 11 &&
|
|
10453
|
+
return le && this.root.nodeType === 11 && Mu(this.dom.ownerDocument) == this.dom ? jh(this) : this.domSelection();
|
|
10434
10454
|
}
|
|
10435
10455
|
/**
|
|
10436
10456
|
@internal
|
|
@@ -10457,7 +10477,7 @@ function Co(n) {
|
|
|
10457
10477
|
function Eo(n) {
|
|
10458
10478
|
return !n.someProp("editable", (e) => e(n.state) === !1);
|
|
10459
10479
|
}
|
|
10460
|
-
function
|
|
10480
|
+
function Qh(n, e) {
|
|
10461
10481
|
let t = Math.min(n.$anchor.sharedDepth(n.head), e.$anchor.sharedDepth(e.head));
|
|
10462
10482
|
return n.$anchor.start(t) != e.$anchor.start(t);
|
|
10463
10483
|
}
|
|
@@ -10469,7 +10489,7 @@ function To(n) {
|
|
|
10469
10489
|
}
|
|
10470
10490
|
return n.someProp("nodeViews", t), n.someProp("markViews", t), e;
|
|
10471
10491
|
}
|
|
10472
|
-
function
|
|
10492
|
+
function Zh(n, e) {
|
|
10473
10493
|
let t = 0, r = 0;
|
|
10474
10494
|
for (let i in n) {
|
|
10475
10495
|
if (n[i] != e[i])
|
|
@@ -10562,7 +10582,7 @@ var tt = {
|
|
|
10562
10582
|
220: "|",
|
|
10563
10583
|
221: "}",
|
|
10564
10584
|
222: '"'
|
|
10565
|
-
},
|
|
10585
|
+
}, ef = typeof navigator < "u" && /Mac/.test(navigator.platform), tf = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
|
10566
10586
|
for (var Y = 0; Y < 10; Y++)
|
|
10567
10587
|
tt[48 + Y] = tt[96 + Y] = String(Y);
|
|
10568
10588
|
for (var Y = 1; Y <= 24; Y++)
|
|
@@ -10571,12 +10591,12 @@ for (var Y = 65; Y <= 90; Y++)
|
|
|
10571
10591
|
tt[Y] = String.fromCharCode(Y + 32), qn[Y] = String.fromCharCode(Y);
|
|
10572
10592
|
for (var si in tt)
|
|
10573
10593
|
qn.hasOwnProperty(si) || (qn[si] = tt[si]);
|
|
10574
|
-
function
|
|
10575
|
-
var e =
|
|
10594
|
+
function nf(n) {
|
|
10595
|
+
var e = ef && n.metaKey && n.shiftKey && !n.ctrlKey && !n.altKey || tf && n.shiftKey && n.key && n.key.length == 1 || n.key == "Unidentified", t = !e && n.key || (n.shiftKey ? qn : tt)[n.keyCode] || n.key || "Unidentified";
|
|
10576
10596
|
return t == "Esc" && (t = "Escape"), t == "Del" && (t = "Delete"), t == "Left" && (t = "ArrowLeft"), t == "Up" && (t = "ArrowUp"), t == "Right" && (t = "ArrowRight"), t == "Down" && (t = "ArrowDown"), t;
|
|
10577
10597
|
}
|
|
10578
|
-
const
|
|
10579
|
-
function
|
|
10598
|
+
const rf = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : !1;
|
|
10599
|
+
function sf(n) {
|
|
10580
10600
|
let e = n.split(/-(?!$)/), t = e[e.length - 1];
|
|
10581
10601
|
t == "Space" && (t = " ");
|
|
10582
10602
|
let r, i, s, o;
|
|
@@ -10591,28 +10611,28 @@ function rf(n) {
|
|
|
10591
10611
|
else if (/^s(hift)?$/i.test(a))
|
|
10592
10612
|
s = !0;
|
|
10593
10613
|
else if (/^mod$/i.test(a))
|
|
10594
|
-
|
|
10614
|
+
rf ? o = !0 : i = !0;
|
|
10595
10615
|
else
|
|
10596
10616
|
throw new Error("Unrecognized modifier name: " + a);
|
|
10597
10617
|
}
|
|
10598
10618
|
return r && (t = "Alt-" + t), i && (t = "Ctrl-" + t), o && (t = "Meta-" + t), s && (t = "Shift-" + t), t;
|
|
10599
10619
|
}
|
|
10600
|
-
function
|
|
10620
|
+
function of(n) {
|
|
10601
10621
|
let e = /* @__PURE__ */ Object.create(null);
|
|
10602
10622
|
for (let t in n)
|
|
10603
|
-
e[
|
|
10623
|
+
e[sf(t)] = n[t];
|
|
10604
10624
|
return e;
|
|
10605
10625
|
}
|
|
10606
10626
|
function oi(n, e, t = !0) {
|
|
10607
10627
|
return e.altKey && (n = "Alt-" + n), e.ctrlKey && (n = "Ctrl-" + n), e.metaKey && (n = "Meta-" + n), t && e.shiftKey && (n = "Shift-" + n), n;
|
|
10608
10628
|
}
|
|
10609
|
-
function of(n) {
|
|
10610
|
-
return new Q({ props: { handleKeyDown: lf(n) } });
|
|
10611
|
-
}
|
|
10612
10629
|
function lf(n) {
|
|
10613
|
-
|
|
10630
|
+
return new Q({ props: { handleKeyDown: af(n) } });
|
|
10631
|
+
}
|
|
10632
|
+
function af(n) {
|
|
10633
|
+
let e = of(n);
|
|
10614
10634
|
return function(t, r) {
|
|
10615
|
-
let i =
|
|
10635
|
+
let i = nf(r), s, o = e[oi(i, r)];
|
|
10616
10636
|
if (o && o(t.state, t.dispatch, t))
|
|
10617
10637
|
return !0;
|
|
10618
10638
|
if (i.length == 1 && i != " ") {
|
|
@@ -10630,13 +10650,13 @@ function lf(n) {
|
|
|
10630
10650
|
return !1;
|
|
10631
10651
|
};
|
|
10632
10652
|
}
|
|
10633
|
-
const
|
|
10634
|
-
function
|
|
10653
|
+
const cf = (n, e) => n.selection.empty ? !1 : (e && e(n.tr.deleteSelection().scrollIntoView()), !0);
|
|
10654
|
+
function df(n, e) {
|
|
10635
10655
|
let { $cursor: t } = n.selection;
|
|
10636
10656
|
return !t || (e ? !e.endOfTextblock("backward", n) : t.parentOffset > 0) ? null : t;
|
|
10637
10657
|
}
|
|
10638
|
-
const
|
|
10639
|
-
let r =
|
|
10658
|
+
const uf = (n, e, t) => {
|
|
10659
|
+
let r = df(n, t);
|
|
10640
10660
|
if (!r)
|
|
10641
10661
|
return !1;
|
|
10642
10662
|
let i = ka(r);
|
|
@@ -10668,7 +10688,7 @@ function zt(n, e, t = !1) {
|
|
|
10668
10688
|
}
|
|
10669
10689
|
return !1;
|
|
10670
10690
|
}
|
|
10671
|
-
const
|
|
10691
|
+
const hf = (n, e, t) => {
|
|
10672
10692
|
let { $head: r, empty: i } = n.selection, s = r;
|
|
10673
10693
|
if (!i)
|
|
10674
10694
|
return !1;
|
|
@@ -10690,12 +10710,12 @@ function ka(n) {
|
|
|
10690
10710
|
}
|
|
10691
10711
|
return null;
|
|
10692
10712
|
}
|
|
10693
|
-
function
|
|
10713
|
+
function ff(n, e) {
|
|
10694
10714
|
let { $cursor: t } = n.selection;
|
|
10695
10715
|
return !t || (e ? !e.endOfTextblock("forward", n) : t.parentOffset < t.parent.content.size) ? null : t;
|
|
10696
10716
|
}
|
|
10697
|
-
const
|
|
10698
|
-
let r =
|
|
10717
|
+
const pf = (n, e, t) => {
|
|
10718
|
+
let r = ff(n, t);
|
|
10699
10719
|
if (!r)
|
|
10700
10720
|
return !1;
|
|
10701
10721
|
let i = Sa(r);
|
|
@@ -10715,7 +10735,7 @@ const ff = (n, e, t) => {
|
|
|
10715
10735
|
}
|
|
10716
10736
|
}
|
|
10717
10737
|
return s.isAtom && i.depth == r.depth - 1 ? (e && e(n.tr.delete(i.pos, i.pos + s.nodeSize).scrollIntoView()), !0) : !1;
|
|
10718
|
-
},
|
|
10738
|
+
}, mf = (n, e, t) => {
|
|
10719
10739
|
let { $head: r, empty: i } = n.selection, s = r;
|
|
10720
10740
|
if (!i)
|
|
10721
10741
|
return !1;
|
|
@@ -10738,7 +10758,7 @@ function Sa(n) {
|
|
|
10738
10758
|
}
|
|
10739
10759
|
return null;
|
|
10740
10760
|
}
|
|
10741
|
-
const
|
|
10761
|
+
const gf = (n, e) => {
|
|
10742
10762
|
let t = n.selection, r = t instanceof w, i;
|
|
10743
10763
|
if (r) {
|
|
10744
10764
|
if (t.node.isTextblock || !rt(n.doc, t.from))
|
|
@@ -10751,7 +10771,7 @@ const mf = (n, e) => {
|
|
|
10751
10771
|
r && s.setSelection(w.create(s.doc, i - n.doc.resolve(i).nodeBefore.nodeSize)), e(s.scrollIntoView());
|
|
10752
10772
|
}
|
|
10753
10773
|
return !0;
|
|
10754
|
-
},
|
|
10774
|
+
}, yf = (n, e) => {
|
|
10755
10775
|
let t = n.selection, r;
|
|
10756
10776
|
if (t instanceof w) {
|
|
10757
10777
|
if (t.node.isTextblock || !rt(n.doc, t.to))
|
|
@@ -10760,10 +10780,10 @@ const mf = (n, e) => {
|
|
|
10760
10780
|
} else if (r = Rl(n.doc, t.to, 1), r == null)
|
|
10761
10781
|
return !1;
|
|
10762
10782
|
return e && e(n.tr.join(r).scrollIntoView()), !0;
|
|
10763
|
-
},
|
|
10783
|
+
}, bf = (n, e) => {
|
|
10764
10784
|
let { $from: t, $to: r } = n.selection, i = t.blockRange(r), s = i && jt(i);
|
|
10765
10785
|
return s == null ? !1 : (e && e(n.tr.lift(i, s).scrollIntoView()), !0);
|
|
10766
|
-
},
|
|
10786
|
+
}, kf = (n, e) => {
|
|
10767
10787
|
let { $head: t, $anchor: r } = n.selection;
|
|
10768
10788
|
return !t.parent.type.spec.code || !t.sameParent(r) ? !1 : (e && e(n.tr.insertText(`
|
|
10769
10789
|
`).scrollIntoView()), !0);
|
|
@@ -10776,7 +10796,7 @@ function xa(n) {
|
|
|
10776
10796
|
}
|
|
10777
10797
|
return null;
|
|
10778
10798
|
}
|
|
10779
|
-
const
|
|
10799
|
+
const Sf = (n, e) => {
|
|
10780
10800
|
let { $head: t, $anchor: r } = n.selection;
|
|
10781
10801
|
if (!t.parent.type.spec.code || !t.sameParent(r))
|
|
10782
10802
|
return !1;
|
|
@@ -10788,7 +10808,7 @@ const kf = (n, e) => {
|
|
|
10788
10808
|
a.setSelection(N.near(a.doc.resolve(l), 1)), e(a.scrollIntoView());
|
|
10789
10809
|
}
|
|
10790
10810
|
return !0;
|
|
10791
|
-
},
|
|
10811
|
+
}, xf = (n, e) => {
|
|
10792
10812
|
let t = n.selection, { $from: r, $to: i } = t;
|
|
10793
10813
|
if (t instanceof Te || r.parent.inlineContent || i.parent.inlineContent)
|
|
10794
10814
|
return !1;
|
|
@@ -10800,7 +10820,7 @@ const kf = (n, e) => {
|
|
|
10800
10820
|
l.setSelection(D.create(l.doc, o + 1)), e(l.scrollIntoView());
|
|
10801
10821
|
}
|
|
10802
10822
|
return !0;
|
|
10803
|
-
},
|
|
10823
|
+
}, Cf = (n, e) => {
|
|
10804
10824
|
let { $cursor: t } = n.selection;
|
|
10805
10825
|
if (!t || t.parent.content.size)
|
|
10806
10826
|
return !1;
|
|
@@ -10811,11 +10831,11 @@ const kf = (n, e) => {
|
|
|
10811
10831
|
}
|
|
10812
10832
|
let r = t.blockRange(), i = r && jt(r);
|
|
10813
10833
|
return i == null ? !1 : (e && e(n.tr.lift(r, i).scrollIntoView()), !0);
|
|
10814
|
-
},
|
|
10834
|
+
}, Ef = (n, e) => {
|
|
10815
10835
|
let { $from: t, to: r } = n.selection, i, s = t.sharedDepth(r);
|
|
10816
10836
|
return s == 0 ? !1 : (i = t.before(s), e && e(n.tr.setSelection(w.create(n.doc, i))), !0);
|
|
10817
10837
|
};
|
|
10818
|
-
function
|
|
10838
|
+
function Tf(n, e, t) {
|
|
10819
10839
|
let r = e.nodeBefore, i = e.nodeAfter, s = e.index();
|
|
10820
10840
|
return !r || !i || !r.type.compatibleContent(i.type) ? !1 : !r.content.size && e.parent.canReplace(s - 1, s) ? (t && t(n.tr.delete(e.pos - r.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(s, s + 1) || !(i.isTextblock || rt(n.doc, e.pos)) ? !1 : (t && t(n.tr.clearIncompatible(e.pos, r.type, r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()), !0);
|
|
10821
10841
|
}
|
|
@@ -10823,7 +10843,7 @@ function Ca(n, e, t) {
|
|
|
10823
10843
|
let r = e.nodeBefore, i = e.nodeAfter, s, o;
|
|
10824
10844
|
if (r.type.spec.isolating || i.type.spec.isolating)
|
|
10825
10845
|
return !1;
|
|
10826
|
-
if (
|
|
10846
|
+
if (Tf(n, e, t))
|
|
10827
10847
|
return !0;
|
|
10828
10848
|
let l = e.parent.canReplace(e.index(), e.index() + 1);
|
|
10829
10849
|
if (l && (s = (o = r.contentMatchAt(r.childCount)).findWrapping(i.type)) && o.matchType(s[0] || i.type).validEnd) {
|
|
@@ -10871,8 +10891,8 @@ function Ea(n) {
|
|
|
10871
10891
|
return i.node(s).isTextblock ? (t && t(e.tr.setSelection(D.create(e.doc, n < 0 ? i.start(s) : i.end(s)))), !0) : !1;
|
|
10872
10892
|
};
|
|
10873
10893
|
}
|
|
10874
|
-
const
|
|
10875
|
-
function
|
|
10894
|
+
const Mf = Ea(-1), wf = Ea(1);
|
|
10895
|
+
function Of(n, e = null) {
|
|
10876
10896
|
return function(t, r) {
|
|
10877
10897
|
let { $from: i, $to: s } = t.selection, o = i.blockRange(s), l = o && Yi(o, n, e);
|
|
10878
10898
|
return l ? (r && r(t.tr.wrap(o, l).scrollIntoView()), !0) : !1;
|
|
@@ -10909,7 +10929,7 @@ function wo(n, e = null) {
|
|
|
10909
10929
|
};
|
|
10910
10930
|
}
|
|
10911
10931
|
typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform && os.platform() == "darwin";
|
|
10912
|
-
function
|
|
10932
|
+
function vf(n, e = null) {
|
|
10913
10933
|
return function(t, r) {
|
|
10914
10934
|
let { $from: i, $to: s } = t.selection, o = i.blockRange(s), l = !1, a = o;
|
|
10915
10935
|
if (!o)
|
|
@@ -10921,10 +10941,10 @@ function Of(n, e = null) {
|
|
|
10921
10941
|
a = new Bn(d, d, o.depth), o.endIndex < o.parent.childCount && (o = new Bn(i, t.doc.resolve(s.end(o.depth)), o.depth)), l = !0;
|
|
10922
10942
|
}
|
|
10923
10943
|
let c = Yi(a, n, e, o);
|
|
10924
|
-
return c ? (r && r(
|
|
10944
|
+
return c ? (r && r(Af(t.tr, o, c, l, n).scrollIntoView()), !0) : !1;
|
|
10925
10945
|
};
|
|
10926
10946
|
}
|
|
10927
|
-
function
|
|
10947
|
+
function Af(n, e, t, r, i) {
|
|
10928
10948
|
let s = b.empty;
|
|
10929
10949
|
for (let d = t.length - 1; d >= 0; d--)
|
|
10930
10950
|
s = b.from(t[d].type.create(t[d].attrs, s));
|
|
@@ -10937,13 +10957,13 @@ function vf(n, e, t, r, i) {
|
|
|
10937
10957
|
!h && Rt(n.doc, a, l) && (n.split(a, l), a += 2 * l), a += c.child(d).nodeSize;
|
|
10938
10958
|
return n;
|
|
10939
10959
|
}
|
|
10940
|
-
function
|
|
10960
|
+
function Nf(n) {
|
|
10941
10961
|
return function(e, t) {
|
|
10942
10962
|
let { $from: r, $to: i } = e.selection, s = r.blockRange(i, (o) => o.childCount > 0 && o.firstChild.type == n);
|
|
10943
|
-
return s ? t ? r.node(s.depth - 1).type == n ?
|
|
10963
|
+
return s ? t ? r.node(s.depth - 1).type == n ? Df(e, t, n, s) : If(e, t, s) : !0 : !1;
|
|
10944
10964
|
};
|
|
10945
10965
|
}
|
|
10946
|
-
function
|
|
10966
|
+
function Df(n, e, t, r) {
|
|
10947
10967
|
let i = n.tr, s = r.end, o = r.$to.end(r.depth);
|
|
10948
10968
|
s < o && (i.step(new K(s - 1, o, s, o, new S(b.from(t.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new Bn(i.doc.resolve(r.$from.pos), i.doc.resolve(o), r.depth));
|
|
10949
10969
|
const l = jt(r);
|
|
@@ -10953,7 +10973,7 @@ function Nf(n, e, t, r) {
|
|
|
10953
10973
|
let a = i.mapping.map(s, -1) - 1;
|
|
10954
10974
|
return rt(i.doc, a) && i.join(a), e(i.scrollIntoView()), !0;
|
|
10955
10975
|
}
|
|
10956
|
-
function
|
|
10976
|
+
function If(n, e, t) {
|
|
10957
10977
|
let r = n.tr, i = t.parent;
|
|
10958
10978
|
for (let f = t.end, p = t.endIndex - 1, m = t.startIndex; p > m; p--)
|
|
10959
10979
|
f -= i.child(p).nodeSize, r.delete(f - 1, f + 1);
|
|
@@ -10966,7 +10986,7 @@ function Df(n, e, t) {
|
|
|
10966
10986
|
let u = s.pos, h = u + o.nodeSize;
|
|
10967
10987
|
return r.step(new K(u - (l ? 1 : 0), h + (a ? 1 : 0), u + 1, h - 1, new S((l ? b.empty : b.from(i.copy(b.empty))).append(a ? b.empty : b.from(i.copy(b.empty))), l ? 0 : 1, a ? 0 : 1), l ? 0 : 1)), e(r.scrollIntoView()), !0;
|
|
10968
10988
|
}
|
|
10969
|
-
function
|
|
10989
|
+
function Rf(n) {
|
|
10970
10990
|
return function(e, t) {
|
|
10971
10991
|
let { $from: r, $to: i } = e.selection, s = r.blockRange(i, (c) => c.childCount > 0 && c.firstChild.type == n);
|
|
10972
10992
|
if (!s)
|
|
@@ -11072,7 +11092,7 @@ class Rr {
|
|
|
11072
11092
|
return l;
|
|
11073
11093
|
}
|
|
11074
11094
|
}
|
|
11075
|
-
class
|
|
11095
|
+
class Pf {
|
|
11076
11096
|
constructor() {
|
|
11077
11097
|
this.callbacks = {};
|
|
11078
11098
|
}
|
|
@@ -11189,10 +11209,10 @@ function Ma(n) {
|
|
|
11189
11209
|
function A(n, e = void 0, ...t) {
|
|
11190
11210
|
return Ma(n) ? e ? n.bind(e)(...t) : n(...t) : n;
|
|
11191
11211
|
}
|
|
11192
|
-
function
|
|
11212
|
+
function Lf(n = {}) {
|
|
11193
11213
|
return Object.keys(n).length === 0 && n.constructor === Object;
|
|
11194
11214
|
}
|
|
11195
|
-
function
|
|
11215
|
+
function Bf(n) {
|
|
11196
11216
|
return typeof n != "string" ? n : n.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(n) : n === "true" ? !0 : n === "false" ? !1 : n;
|
|
11197
11217
|
}
|
|
11198
11218
|
function Oo(n, e) {
|
|
@@ -11203,7 +11223,7 @@ function Oo(n, e) {
|
|
|
11203
11223
|
if (r === !1)
|
|
11204
11224
|
return !1;
|
|
11205
11225
|
const i = e.reduce((s, o) => {
|
|
11206
|
-
const l = o.attribute.parseHTML ? o.attribute.parseHTML(t) :
|
|
11226
|
+
const l = o.attribute.parseHTML ? o.attribute.parseHTML(t) : Bf(t.getAttribute(o.name));
|
|
11207
11227
|
return l == null ? s : {
|
|
11208
11228
|
...s,
|
|
11209
11229
|
[o.name]: l
|
|
@@ -11216,10 +11236,10 @@ function Oo(n, e) {
|
|
|
11216
11236
|
function vo(n) {
|
|
11217
11237
|
return Object.fromEntries(
|
|
11218
11238
|
// @ts-ignore
|
|
11219
|
-
Object.entries(n).filter(([e, t]) => e === "attrs" &&
|
|
11239
|
+
Object.entries(n).filter(([e, t]) => e === "attrs" && Lf(t) ? !1 : t != null)
|
|
11220
11240
|
);
|
|
11221
11241
|
}
|
|
11222
|
-
function
|
|
11242
|
+
function _f(n, e) {
|
|
11223
11243
|
var t;
|
|
11224
11244
|
const r = Ta(n), { nodeExtensions: i, markExtensions: s } = Pr(n), o = (t = i.find((c) => C(c, "topNode"))) === null || t === void 0 ? void 0 : t.name, l = Object.fromEntries(i.map((c) => {
|
|
11225
11245
|
const d = r.filter((y) => y.type === c.name), u = {
|
|
@@ -11289,7 +11309,7 @@ function Bf(n, e) {
|
|
|
11289
11309
|
HTMLAttributes: Ri(g, d)
|
|
11290
11310
|
})), [c.name, f];
|
|
11291
11311
|
}));
|
|
11292
|
-
return new
|
|
11312
|
+
return new jd({
|
|
11293
11313
|
topNode: o,
|
|
11294
11314
|
nodes: l,
|
|
11295
11315
|
marks: a
|
|
@@ -11301,7 +11321,7 @@ function li(n, e) {
|
|
|
11301
11321
|
function Ao(n, e) {
|
|
11302
11322
|
return Array.isArray(e) ? e.some((t) => (typeof t == "string" ? t : t.name) === n.name) : e;
|
|
11303
11323
|
}
|
|
11304
|
-
const
|
|
11324
|
+
const Ff = (n, e = 500) => {
|
|
11305
11325
|
let t = "";
|
|
11306
11326
|
const r = n.parentOffset;
|
|
11307
11327
|
return n.parent.nodesBetween(Math.max(0, r - e), r, (i, s, o, l) => {
|
|
@@ -11323,7 +11343,7 @@ class Lr {
|
|
|
11323
11343
|
this.find = e.find, this.handler = e.handler;
|
|
11324
11344
|
}
|
|
11325
11345
|
}
|
|
11326
|
-
const
|
|
11346
|
+
const zf = (n, e) => {
|
|
11327
11347
|
if (cs(e))
|
|
11328
11348
|
return e.exec(n);
|
|
11329
11349
|
const t = e(n);
|
|
@@ -11344,11 +11364,11 @@ function ai(n) {
|
|
|
11344
11364
|
)
|
|
11345
11365
|
return !1;
|
|
11346
11366
|
let d = !1;
|
|
11347
|
-
const u =
|
|
11367
|
+
const u = Ff(c) + s;
|
|
11348
11368
|
return o.forEach((h) => {
|
|
11349
11369
|
if (d)
|
|
11350
11370
|
return;
|
|
11351
|
-
const f =
|
|
11371
|
+
const f = zf(u, h.find);
|
|
11352
11372
|
if (!f)
|
|
11353
11373
|
return;
|
|
11354
11374
|
const p = a.state.tr, m = Ir({
|
|
@@ -11376,7 +11396,7 @@ function ai(n) {
|
|
|
11376
11396
|
}), a.dispatch(p), d = !0);
|
|
11377
11397
|
}), d;
|
|
11378
11398
|
}
|
|
11379
|
-
function
|
|
11399
|
+
function Hf(n) {
|
|
11380
11400
|
const { editor: e, rules: t } = n, r = new Q({
|
|
11381
11401
|
state: {
|
|
11382
11402
|
init() {
|
|
@@ -11433,7 +11453,7 @@ function zf(n) {
|
|
|
11433
11453
|
});
|
|
11434
11454
|
return r;
|
|
11435
11455
|
}
|
|
11436
|
-
function
|
|
11456
|
+
function Vf(n) {
|
|
11437
11457
|
return typeof n == "number";
|
|
11438
11458
|
}
|
|
11439
11459
|
class wa {
|
|
@@ -11441,7 +11461,7 @@ class wa {
|
|
|
11441
11461
|
this.find = e.find, this.handler = e.handler;
|
|
11442
11462
|
}
|
|
11443
11463
|
}
|
|
11444
|
-
const
|
|
11464
|
+
const $f = (n, e) => {
|
|
11445
11465
|
if (cs(e))
|
|
11446
11466
|
return [...n.matchAll(e)];
|
|
11447
11467
|
const t = e(n);
|
|
@@ -11450,7 +11470,7 @@ const Vf = (n, e) => {
|
|
|
11450
11470
|
return i.index = r.index, i.input = n, i.data = r.data, r.replaceWith && (r.text.includes(r.replaceWith) || console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'), i.push(r.replaceWith)), i;
|
|
11451
11471
|
}) : [];
|
|
11452
11472
|
};
|
|
11453
|
-
function
|
|
11473
|
+
function jf(n) {
|
|
11454
11474
|
const { editor: e, state: t, from: r, to: i, rule: s } = n, { commands: o, chain: l, can: a } = new Rr({
|
|
11455
11475
|
editor: e,
|
|
11456
11476
|
state: t
|
|
@@ -11459,7 +11479,7 @@ function $f(n) {
|
|
|
11459
11479
|
if (!u.isTextblock || u.type.spec.code)
|
|
11460
11480
|
return;
|
|
11461
11481
|
const f = Math.max(r, h), p = Math.min(i, h + u.content.size), m = u.textBetween(f - h, p - h, void 0, "");
|
|
11462
|
-
|
|
11482
|
+
$f(m, s.find).forEach((y) => {
|
|
11463
11483
|
if (y.index === void 0)
|
|
11464
11484
|
return;
|
|
11465
11485
|
const x = f + y.index + 1, T = x + y[0].length, R = {
|
|
@@ -11477,7 +11497,7 @@ function $f(n) {
|
|
|
11477
11497
|
});
|
|
11478
11498
|
}), c.every((u) => u !== null);
|
|
11479
11499
|
}
|
|
11480
|
-
function
|
|
11500
|
+
function qf(n) {
|
|
11481
11501
|
const { editor: e, rules: t } = n;
|
|
11482
11502
|
let r = null, i = !1, s = !1;
|
|
11483
11503
|
return t.map((l) => new Q({
|
|
@@ -11508,13 +11528,13 @@ function jf(n) {
|
|
|
11508
11528
|
if (!h && !f)
|
|
11509
11529
|
return;
|
|
11510
11530
|
const p = c.doc.content.findDiffStart(d.doc.content), m = c.doc.content.findDiffEnd(d.doc.content);
|
|
11511
|
-
if (!
|
|
11531
|
+
if (!Vf(p) || !m || p === m.b)
|
|
11512
11532
|
return;
|
|
11513
11533
|
const g = d.tr, y = Ir({
|
|
11514
11534
|
state: d,
|
|
11515
11535
|
transaction: g
|
|
11516
11536
|
});
|
|
11517
|
-
if (!(
|
|
11537
|
+
if (!(!jf({
|
|
11518
11538
|
editor: e,
|
|
11519
11539
|
state: y,
|
|
11520
11540
|
from: Math.max(p - 1, 0),
|
|
@@ -11525,13 +11545,13 @@ function jf(n) {
|
|
|
11525
11545
|
}
|
|
11526
11546
|
}));
|
|
11527
11547
|
}
|
|
11528
|
-
function
|
|
11548
|
+
function Kf(n) {
|
|
11529
11549
|
const e = n.filter((t, r) => n.indexOf(t) !== r);
|
|
11530
11550
|
return [...new Set(e)];
|
|
11531
11551
|
}
|
|
11532
11552
|
class It {
|
|
11533
11553
|
constructor(e, t) {
|
|
11534
|
-
this.splittableMarks = [], this.editor = t, this.extensions = It.resolve(e), this.schema =
|
|
11554
|
+
this.splittableMarks = [], this.editor = t, this.extensions = It.resolve(e), this.schema = _f(this.extensions, t), this.extensions.forEach((r) => {
|
|
11535
11555
|
var i;
|
|
11536
11556
|
this.editor.extensionStorage[r.name] = r.storage;
|
|
11537
11557
|
const s = {
|
|
@@ -11561,7 +11581,7 @@ class It {
|
|
|
11561
11581
|
});
|
|
11562
11582
|
}
|
|
11563
11583
|
static resolve(e) {
|
|
11564
|
-
const t = It.sort(It.flatten(e)), r =
|
|
11584
|
+
const t = It.sort(It.flatten(e)), r = Kf(t.map((i) => i.name));
|
|
11565
11585
|
return r.length && console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map((i) => `'${i}'`).join(", ")}]. This can lead to issues.`), t;
|
|
11566
11586
|
}
|
|
11567
11587
|
static flatten(e) {
|
|
@@ -11609,7 +11629,7 @@ class It {
|
|
|
11609
11629
|
const m = Object.fromEntries(Object.entries(c()).map(([g, y]) => [g, () => y({ editor: e })]));
|
|
11610
11630
|
d = { ...d, ...m };
|
|
11611
11631
|
}
|
|
11612
|
-
const u =
|
|
11632
|
+
const u = lf(d);
|
|
11613
11633
|
a.push(u);
|
|
11614
11634
|
const h = C(o, "addInputRules", l);
|
|
11615
11635
|
Ao(o, e.options.enableInputRules) && h && r.push(...h());
|
|
@@ -11623,11 +11643,11 @@ class It {
|
|
|
11623
11643
|
return a;
|
|
11624
11644
|
}).flat();
|
|
11625
11645
|
return [
|
|
11626
|
-
|
|
11646
|
+
Hf({
|
|
11627
11647
|
editor: e,
|
|
11628
11648
|
rules: r
|
|
11629
11649
|
}),
|
|
11630
|
-
...
|
|
11650
|
+
...qf({
|
|
11631
11651
|
editor: e,
|
|
11632
11652
|
rules: i
|
|
11633
11653
|
}),
|
|
@@ -11664,11 +11684,11 @@ class It {
|
|
|
11664
11684
|
}));
|
|
11665
11685
|
}
|
|
11666
11686
|
}
|
|
11667
|
-
function
|
|
11687
|
+
function Wf(n) {
|
|
11668
11688
|
return Object.prototype.toString.call(n).slice(8, -1);
|
|
11669
11689
|
}
|
|
11670
11690
|
function ci(n) {
|
|
11671
|
-
return
|
|
11691
|
+
return Wf(n) !== "Object" ? !1 : n.constructor === Object && Object.getPrototypeOf(n) === Object.prototype;
|
|
11672
11692
|
}
|
|
11673
11693
|
function Br(n, e) {
|
|
11674
11694
|
const t = { ...n };
|
|
@@ -11731,7 +11751,7 @@ function Oa(n, e, t) {
|
|
|
11731
11751
|
function va(n) {
|
|
11732
11752
|
return Object.fromEntries(Object.entries(n.nodes).filter(([, e]) => e.spec.toText).map(([e, t]) => [e, t.spec.toText]));
|
|
11733
11753
|
}
|
|
11734
|
-
const
|
|
11754
|
+
const Uf = ge.create({
|
|
11735
11755
|
name: "clipboardTextSerializer",
|
|
11736
11756
|
addProseMirrorPlugins() {
|
|
11737
11757
|
return [
|
|
@@ -11748,10 +11768,10 @@ const Wf = ge.create({
|
|
|
11748
11768
|
})
|
|
11749
11769
|
];
|
|
11750
11770
|
}
|
|
11751
|
-
}),
|
|
11771
|
+
}), Jf = () => ({ editor: n, view: e }) => (requestAnimationFrame(() => {
|
|
11752
11772
|
var t;
|
|
11753
11773
|
n.isDestroyed || (e.dom.blur(), (t = window == null ? void 0 : window.getSelection()) === null || t === void 0 || t.removeAllRanges());
|
|
11754
|
-
}), !0),
|
|
11774
|
+
}), !0), Gf = (n = !1) => ({ commands: e }) => e.setContent("", n), Yf = () => ({ state: n, tr: e, dispatch: t }) => {
|
|
11755
11775
|
const { selection: r } = e, { ranges: i } = r;
|
|
11756
11776
|
return t && i.forEach(({ $from: s, $to: o }) => {
|
|
11757
11777
|
n.doc.nodesBetween(s.pos, o.pos, (l, a) => {
|
|
@@ -11768,7 +11788,7 @@ const Wf = ge.create({
|
|
|
11768
11788
|
(p || p === 0) && e.lift(f, p);
|
|
11769
11789
|
});
|
|
11770
11790
|
}), !0;
|
|
11771
|
-
},
|
|
11791
|
+
}, Xf = (n) => (e) => n(e), Qf = () => ({ state: n, dispatch: e }) => xf(n, e), Zf = () => ({ tr: n, dispatch: e }) => {
|
|
11772
11792
|
const { selection: t } = n, r = t.$anchor.node();
|
|
11773
11793
|
if (r.content.size > 0)
|
|
11774
11794
|
return !1;
|
|
@@ -11782,7 +11802,7 @@ const Wf = ge.create({
|
|
|
11782
11802
|
return !0;
|
|
11783
11803
|
}
|
|
11784
11804
|
return !1;
|
|
11785
|
-
},
|
|
11805
|
+
}, ep = (n) => ({ tr: e, state: t, dispatch: r }) => {
|
|
11786
11806
|
const i = W(n, t.schema), s = e.selection.$anchor;
|
|
11787
11807
|
for (let o = s.depth; o > 0; o -= 1)
|
|
11788
11808
|
if (s.node(o).type === i) {
|
|
@@ -11793,10 +11813,10 @@ const Wf = ge.create({
|
|
|
11793
11813
|
return !0;
|
|
11794
11814
|
}
|
|
11795
11815
|
return !1;
|
|
11796
|
-
},
|
|
11816
|
+
}, tp = (n) => ({ tr: e, dispatch: t }) => {
|
|
11797
11817
|
const { from: r, to: i } = n;
|
|
11798
11818
|
return t && e.delete(r, i), !0;
|
|
11799
|
-
},
|
|
11819
|
+
}, np = () => ({ state: n, dispatch: e }) => cf(n, e), rp = () => ({ commands: n }) => n.keyboardShortcut("Enter"), ip = () => ({ state: n, dispatch: e }) => Sf(n, e);
|
|
11800
11820
|
function Kn(n, e, t = { strict: !0 }) {
|
|
11801
11821
|
const r = Object.keys(e);
|
|
11802
11822
|
return r.length ? r.every((i) => t.strict ? e[i] === n[i] : cs(e[i]) ? e[i].test(n[i]) : e[i] === n[i]) : !0;
|
|
@@ -11804,7 +11824,7 @@ function Kn(n, e, t = { strict: !0 }) {
|
|
|
11804
11824
|
function Pi(n, e, t = {}) {
|
|
11805
11825
|
return n.find((r) => r.type === e && Kn(r.attrs, t));
|
|
11806
11826
|
}
|
|
11807
|
-
function
|
|
11827
|
+
function sp(n, e, t = {}) {
|
|
11808
11828
|
return !!Pi(n, e, t);
|
|
11809
11829
|
}
|
|
11810
11830
|
function ds(n, e, t = {}) {
|
|
@@ -11819,7 +11839,7 @@ function ds(n, e, t = {}) {
|
|
|
11819
11839
|
let s = r.index, o = n.start() + r.offset, l = s + 1, a = o + r.node.nodeSize;
|
|
11820
11840
|
for (Pi([...r.node.marks], e, t); s > 0 && i.isInSet(n.parent.child(s - 1).marks); )
|
|
11821
11841
|
s -= 1, o -= n.parent.child(s).nodeSize;
|
|
11822
|
-
for (; l < n.parent.childCount &&
|
|
11842
|
+
for (; l < n.parent.childCount && sp([...n.parent.child(l).marks], e, t); )
|
|
11823
11843
|
a += n.parent.child(l).nodeSize, l += 1;
|
|
11824
11844
|
return {
|
|
11825
11845
|
from: o,
|
|
@@ -11834,7 +11854,7 @@ function st(n, e) {
|
|
|
11834
11854
|
}
|
|
11835
11855
|
return n;
|
|
11836
11856
|
}
|
|
11837
|
-
const
|
|
11857
|
+
const op = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
11838
11858
|
const s = st(n, r.schema), { doc: o, selection: l } = t, { $from: a, from: c, to: d } = l;
|
|
11839
11859
|
if (i) {
|
|
11840
11860
|
const u = ds(a, s, e);
|
|
@@ -11844,7 +11864,7 @@ const sp = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
11844
11864
|
}
|
|
11845
11865
|
}
|
|
11846
11866
|
return !0;
|
|
11847
|
-
},
|
|
11867
|
+
}, lp = (n) => (e) => {
|
|
11848
11868
|
const t = typeof n == "function" ? n(e) : n;
|
|
11849
11869
|
for (let r = 0; r < t.length; r += 1)
|
|
11850
11870
|
if (t[r](e))
|
|
@@ -11878,7 +11898,7 @@ function _r() {
|
|
|
11878
11898
|
"iPod"
|
|
11879
11899
|
].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
|
|
11880
11900
|
}
|
|
11881
|
-
const
|
|
11901
|
+
const ap = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) => {
|
|
11882
11902
|
e = {
|
|
11883
11903
|
scrollIntoView: !0,
|
|
11884
11904
|
...e
|
|
@@ -11894,7 +11914,7 @@ const lp = (n = null, e = {}) => ({ editor: t, view: r, tr: i, dispatch: s }) =>
|
|
|
11894
11914
|
return o(), !0;
|
|
11895
11915
|
const l = Aa(i.doc, n) || t.state.selection, a = t.state.selection.eq(l);
|
|
11896
11916
|
return s && (a || i.setSelection(l), a && i.storedMarks && i.setStoredMarks(i.storedMarks), o()), !0;
|
|
11897
|
-
},
|
|
11917
|
+
}, cp = (n, e) => (t) => n.every((r, i) => e(r, { ...t, index: i })), dp = (n, e) => ({ tr: t, commands: r }) => r.insertContentAt({ from: t.selection.from, to: t.selection.to }, n, e);
|
|
11898
11918
|
function No(n) {
|
|
11899
11919
|
const e = `<body>${n}</body>`;
|
|
11900
11920
|
return new window.DOMParser().parseFromString(e, "text/html").body;
|
|
@@ -11916,7 +11936,7 @@ function Wn(n, e, t) {
|
|
|
11916
11936
|
}
|
|
11917
11937
|
return Wn("", e, t);
|
|
11918
11938
|
}
|
|
11919
|
-
function
|
|
11939
|
+
function up(n, e, t) {
|
|
11920
11940
|
const r = n.steps.length - 1;
|
|
11921
11941
|
if (r < e)
|
|
11922
11942
|
return;
|
|
@@ -11929,7 +11949,7 @@ function dp(n, e, t) {
|
|
|
11929
11949
|
o === 0 && (o = d);
|
|
11930
11950
|
}), n.setSelection(N.near(n.doc.resolve(o), t));
|
|
11931
11951
|
}
|
|
11932
|
-
const
|
|
11952
|
+
const hp = (n) => n.toString().startsWith("<"), fp = (n, e, t) => ({ tr: r, dispatch: i, editor: s }) => {
|
|
11933
11953
|
if (i) {
|
|
11934
11954
|
t = {
|
|
11935
11955
|
parseOptions: {},
|
|
@@ -11945,20 +11965,20 @@ const up = (n) => n.toString().startsWith("<"), hp = (n, e, t) => ({ tr: r, disp
|
|
|
11945
11965
|
if (o.toString() === "<>")
|
|
11946
11966
|
return !0;
|
|
11947
11967
|
let { from: l, to: a } = typeof n == "number" ? { from: n, to: n } : n, c = !0, d = !0;
|
|
11948
|
-
if ((
|
|
11968
|
+
if ((hp(o) ? o : [o]).forEach((h) => {
|
|
11949
11969
|
h.check(), c = c ? h.isText && h.marks.length === 0 : !1, d = d ? h.isBlock : !1;
|
|
11950
11970
|
}), l === a && d) {
|
|
11951
11971
|
const { parent: h } = r.doc.resolve(l);
|
|
11952
11972
|
h.isTextblock && !h.type.spec.code && !h.childCount && (l -= 1, a += 1);
|
|
11953
11973
|
}
|
|
11954
|
-
c ? Array.isArray(e) ? r.insertText(e.map((h) => h.text || "").join(""), l, a) : typeof e == "object" && e && e.text ? r.insertText(e.text, l, a) : r.insertText(e, l, a) : r.replaceWith(l, a, o), t.updateSelection &&
|
|
11974
|
+
c ? Array.isArray(e) ? r.insertText(e.map((h) => h.text || "").join(""), l, a) : typeof e == "object" && e && e.text ? r.insertText(e.text, l, a) : r.insertText(e, l, a) : r.replaceWith(l, a, o), t.updateSelection && up(r, r.steps.length - 1, -1);
|
|
11955
11975
|
}
|
|
11956
11976
|
return !0;
|
|
11957
|
-
},
|
|
11977
|
+
}, pp = () => ({ state: n, dispatch: e }) => gf(n, e), mp = () => ({ state: n, dispatch: e }) => yf(n, e), gp = () => ({ state: n, dispatch: e }) => uf(n, e), yp = () => ({ state: n, dispatch: e }) => pf(n, e);
|
|
11958
11978
|
function hs() {
|
|
11959
11979
|
return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
|
|
11960
11980
|
}
|
|
11961
|
-
function
|
|
11981
|
+
function bp(n) {
|
|
11962
11982
|
const e = n.split(/-(?!$)/);
|
|
11963
11983
|
let t = e[e.length - 1];
|
|
11964
11984
|
t === "Space" && (t = " ");
|
|
@@ -11980,8 +12000,8 @@ function yp(n) {
|
|
|
11980
12000
|
}
|
|
11981
12001
|
return r && (t = `Alt-${t}`), i && (t = `Ctrl-${t}`), o && (t = `Meta-${t}`), s && (t = `Shift-${t}`), t;
|
|
11982
12002
|
}
|
|
11983
|
-
const
|
|
11984
|
-
const s =
|
|
12003
|
+
const kp = (n) => ({ editor: e, view: t, tr: r, dispatch: i }) => {
|
|
12004
|
+
const s = bp(n).split(/-(?!$)/), o = s.find((c) => !["Alt", "Ctrl", "Meta", "Shift"].includes(c)), l = new KeyboardEvent("keydown", {
|
|
11985
12005
|
key: o === "Space" ? " " : o,
|
|
11986
12006
|
altKey: s.includes("Alt"),
|
|
11987
12007
|
ctrlKey: s.includes("Ctrl"),
|
|
@@ -12012,13 +12032,13 @@ function pn(n, e, t = {}) {
|
|
|
12012
12032
|
const a = i - r, c = l.filter((u) => o ? o.name === u.node.type.name : !0).filter((u) => Kn(u.node.attrs, t, { strict: !1 }));
|
|
12013
12033
|
return s ? !!c.length : c.reduce((u, h) => u + h.to - h.from, 0) >= a;
|
|
12014
12034
|
}
|
|
12015
|
-
const
|
|
12035
|
+
const Sp = (n, e = {}) => ({ state: t, dispatch: r }) => {
|
|
12016
12036
|
const i = W(n, t.schema);
|
|
12017
|
-
return pn(t, i, e) ?
|
|
12018
|
-
},
|
|
12037
|
+
return pn(t, i, e) ? bf(t, r) : !1;
|
|
12038
|
+
}, xp = () => ({ state: n, dispatch: e }) => Cf(n, e), Cp = (n) => ({ state: e, dispatch: t }) => {
|
|
12019
12039
|
const r = W(n, e.schema);
|
|
12020
|
-
return
|
|
12021
|
-
},
|
|
12040
|
+
return Nf(r)(e, t);
|
|
12041
|
+
}, Ep = () => ({ state: n, dispatch: e }) => kf(n, e);
|
|
12022
12042
|
function Fr(n, e) {
|
|
12023
12043
|
return e.nodes[n] ? "node" : e.marks[n] ? "mark" : null;
|
|
12024
12044
|
}
|
|
@@ -12026,7 +12046,7 @@ function Do(n, e) {
|
|
|
12026
12046
|
const t = typeof e == "string" ? [e] : e;
|
|
12027
12047
|
return Object.keys(n).reduce((r, i) => (t.includes(i) || (r[i] = n[i]), r), {});
|
|
12028
12048
|
}
|
|
12029
|
-
const
|
|
12049
|
+
const Tp = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
|
|
12030
12050
|
let s = null, o = null;
|
|
12031
12051
|
const l = Fr(typeof n == "string" ? n : n.name, r.schema);
|
|
12032
12052
|
return l ? (l === "node" && (s = W(n, r.schema)), l === "mark" && (o = st(n, r.schema)), i && t.selection.ranges.forEach((a) => {
|
|
@@ -12036,14 +12056,14 @@ const Ep = (n, e) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
12036
12056
|
});
|
|
12037
12057
|
});
|
|
12038
12058
|
}), !0) : !1;
|
|
12039
|
-
},
|
|
12059
|
+
}, Mp = () => ({ tr: n, dispatch: e }) => (e && n.scrollIntoView(), !0), wp = () => ({ tr: n, commands: e }) => e.setTextSelection({
|
|
12040
12060
|
from: 0,
|
|
12041
12061
|
to: n.doc.content.size
|
|
12042
|
-
}),
|
|
12062
|
+
}), Op = () => ({ state: n, dispatch: e }) => hf(n, e), vp = () => ({ state: n, dispatch: e }) => mf(n, e), Ap = () => ({ state: n, dispatch: e }) => Ef(n, e), Np = () => ({ state: n, dispatch: e }) => wf(n, e), Dp = () => ({ state: n, dispatch: e }) => Mf(n, e);
|
|
12043
12063
|
function Na(n, e, t = {}) {
|
|
12044
12064
|
return Wn(n, e, { slice: !1, parseOptions: t });
|
|
12045
12065
|
}
|
|
12046
|
-
const
|
|
12066
|
+
const Ip = (n, e = !1, t = {}) => ({ tr: r, editor: i, dispatch: s }) => {
|
|
12047
12067
|
const { doc: o } = r, l = Na(n, i.schema, t);
|
|
12048
12068
|
return s && r.replaceWith(0, o.content.size, l).setMeta("preventUpdate", !e), !0;
|
|
12049
12069
|
};
|
|
@@ -12055,7 +12075,7 @@ function Da(n, e) {
|
|
|
12055
12075
|
});
|
|
12056
12076
|
}), t;
|
|
12057
12077
|
}
|
|
12058
|
-
function
|
|
12078
|
+
function Rp(n) {
|
|
12059
12079
|
for (let e = 0; e < n.edgeCount; e += 1) {
|
|
12060
12080
|
const { type: t } = n.edge(e);
|
|
12061
12081
|
if (t.isTextblock && !t.hasRequiredAttrs())
|
|
@@ -12072,7 +12092,7 @@ function Ia(n, e, t) {
|
|
|
12072
12092
|
});
|
|
12073
12093
|
}), r;
|
|
12074
12094
|
}
|
|
12075
|
-
function
|
|
12095
|
+
function Pp(n, e) {
|
|
12076
12096
|
for (let t = n.depth; t > 0; t -= 1) {
|
|
12077
12097
|
const r = n.node(t);
|
|
12078
12098
|
if (e(r))
|
|
@@ -12085,13 +12105,13 @@ function Rp(n, e) {
|
|
|
12085
12105
|
}
|
|
12086
12106
|
}
|
|
12087
12107
|
function fs(n) {
|
|
12088
|
-
return (e) =>
|
|
12108
|
+
return (e) => Pp(e.$from, n);
|
|
12089
12109
|
}
|
|
12090
|
-
function
|
|
12110
|
+
function Lp(n, e) {
|
|
12091
12111
|
const t = Ne.fromSchema(e).serializeFragment(n), i = document.implementation.createHTMLDocument().createElement("div");
|
|
12092
12112
|
return i.appendChild(t), i.innerHTML;
|
|
12093
12113
|
}
|
|
12094
|
-
function
|
|
12114
|
+
function Bp(n, e) {
|
|
12095
12115
|
const t = {
|
|
12096
12116
|
from: 0,
|
|
12097
12117
|
to: n.content.size
|
|
@@ -12106,7 +12126,7 @@ function zr(n, e) {
|
|
|
12106
12126
|
const l = o.find((a) => a.type.name === t.name);
|
|
12107
12127
|
return l ? { ...l.attrs } : {};
|
|
12108
12128
|
}
|
|
12109
|
-
function
|
|
12129
|
+
function _p(n, e) {
|
|
12110
12130
|
const t = W(e, n.schema), { from: r, to: i } = n.selection, s = [];
|
|
12111
12131
|
n.doc.nodesBetween(r, i, (l) => {
|
|
12112
12132
|
s.push(l);
|
|
@@ -12116,17 +12136,17 @@ function Bp(n, e) {
|
|
|
12116
12136
|
}
|
|
12117
12137
|
function Ra(n, e) {
|
|
12118
12138
|
const t = Fr(typeof e == "string" ? e : e.name, n.schema);
|
|
12119
|
-
return t === "node" ?
|
|
12139
|
+
return t === "node" ? _p(n, e) : t === "mark" ? zr(n, e) : {};
|
|
12120
12140
|
}
|
|
12121
|
-
function
|
|
12141
|
+
function Fp(n, e = JSON.stringify) {
|
|
12122
12142
|
const t = {};
|
|
12123
12143
|
return n.filter((r) => {
|
|
12124
12144
|
const i = e(r);
|
|
12125
12145
|
return Object.prototype.hasOwnProperty.call(t, i) ? !1 : t[i] = !0;
|
|
12126
12146
|
});
|
|
12127
12147
|
}
|
|
12128
|
-
function
|
|
12129
|
-
const e =
|
|
12148
|
+
function zp(n) {
|
|
12149
|
+
const e = Fp(n);
|
|
12130
12150
|
return e.length === 1 ? e : e.filter((t, r) => !e.filter((s, o) => o !== r).some((s) => t.oldRange.from >= s.oldRange.from && t.oldRange.to <= s.oldRange.to && t.newRange.from >= s.newRange.from && t.newRange.to <= s.newRange.to));
|
|
12131
12151
|
}
|
|
12132
12152
|
function Pa(n) {
|
|
@@ -12156,7 +12176,7 @@ function Pa(n) {
|
|
|
12156
12176
|
}
|
|
12157
12177
|
});
|
|
12158
12178
|
});
|
|
12159
|
-
}),
|
|
12179
|
+
}), zp(r);
|
|
12160
12180
|
}
|
|
12161
12181
|
function Hr(n, e, t) {
|
|
12162
12182
|
const r = [];
|
|
@@ -12203,7 +12223,7 @@ function Li(n, e, t = {}) {
|
|
|
12203
12223
|
const a = l.filter((u) => s ? s.name === u.mark.type.name : !0).filter((u) => Kn(u.mark.attrs, t, { strict: !1 })).reduce((u, h) => u + h.to - h.from, 0), c = l.filter((u) => s ? u.mark.type !== s && u.mark.type.excludes(s) : !0).reduce((u, h) => u + h.to - h.from, 0);
|
|
12204
12224
|
return (a > 0 ? a + c : a) >= o;
|
|
12205
12225
|
}
|
|
12206
|
-
function
|
|
12226
|
+
function Hp(n, e, t = {}) {
|
|
12207
12227
|
if (!e)
|
|
12208
12228
|
return pn(n, null, t) || Li(n, null, t);
|
|
12209
12229
|
const r = Fr(e, n.schema);
|
|
@@ -12220,12 +12240,12 @@ function Io(n, e) {
|
|
|
12220
12240
|
}, s = A(C(r, "group", i));
|
|
12221
12241
|
return typeof s != "string" ? !1 : s.split(" ").includes("list");
|
|
12222
12242
|
}
|
|
12223
|
-
function
|
|
12243
|
+
function Vp(n) {
|
|
12224
12244
|
var e;
|
|
12225
12245
|
const t = (e = n.type.createAndFill()) === null || e === void 0 ? void 0 : e.toJSON(), r = n.toJSON();
|
|
12226
12246
|
return JSON.stringify(t) === JSON.stringify(r);
|
|
12227
12247
|
}
|
|
12228
|
-
function
|
|
12248
|
+
function $p(n) {
|
|
12229
12249
|
return n instanceof w;
|
|
12230
12250
|
}
|
|
12231
12251
|
function La(n, e, t) {
|
|
@@ -12244,7 +12264,7 @@ function La(n, e, t) {
|
|
|
12244
12264
|
toJSON: () => y
|
|
12245
12265
|
};
|
|
12246
12266
|
}
|
|
12247
|
-
function
|
|
12267
|
+
function jp(n, e, t) {
|
|
12248
12268
|
var r;
|
|
12249
12269
|
const { selection: i } = e;
|
|
12250
12270
|
let s = null;
|
|
@@ -12266,7 +12286,7 @@ function $p(n, e, t) {
|
|
|
12266
12286
|
}), c;
|
|
12267
12287
|
});
|
|
12268
12288
|
}
|
|
12269
|
-
const
|
|
12289
|
+
const qp = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
12270
12290
|
const { selection: s } = t, { empty: o, ranges: l } = s, a = st(n, r.schema);
|
|
12271
12291
|
if (i)
|
|
12272
12292
|
if (o) {
|
|
@@ -12288,25 +12308,25 @@ const jp = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
|
12288
12308
|
}) : t.addMark(p, m, a.create(e));
|
|
12289
12309
|
});
|
|
12290
12310
|
});
|
|
12291
|
-
return
|
|
12292
|
-
},
|
|
12311
|
+
return jp(r, t, a);
|
|
12312
|
+
}, Kp = (n, e) => ({ tr: t }) => (t.setMeta(n, e), !0), Wp = (n, e = {}) => ({ state: t, dispatch: r, chain: i }) => {
|
|
12293
12313
|
const s = W(n, t.schema);
|
|
12294
12314
|
return s.isTextblock ? i().command(({ commands: o }) => wo(s, e)(t) ? !0 : o.clearNodes()).command(({ state: o }) => wo(s, e)(o, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
|
|
12295
|
-
},
|
|
12315
|
+
}, Up = (n) => ({ tr: e, dispatch: t }) => {
|
|
12296
12316
|
if (t) {
|
|
12297
12317
|
const { doc: r } = e, i = _e(n, 0, r.content.size), s = w.create(r, i);
|
|
12298
12318
|
e.setSelection(s);
|
|
12299
12319
|
}
|
|
12300
12320
|
return !0;
|
|
12301
|
-
},
|
|
12321
|
+
}, Jp = (n) => ({ tr: e, dispatch: t }) => {
|
|
12302
12322
|
if (t) {
|
|
12303
12323
|
const { doc: r } = e, { from: i, to: s } = typeof n == "number" ? { from: n, to: n } : n, o = D.atStart(r).from, l = D.atEnd(r).to, a = _e(i, o, l), c = _e(s, o, l), d = D.create(r, a, c);
|
|
12304
12324
|
e.setSelection(d);
|
|
12305
12325
|
}
|
|
12306
12326
|
return !0;
|
|
12307
|
-
},
|
|
12327
|
+
}, Gp = (n) => ({ state: e, dispatch: t }) => {
|
|
12308
12328
|
const r = W(n, e.schema);
|
|
12309
|
-
return
|
|
12329
|
+
return Rf(r)(e, t);
|
|
12310
12330
|
};
|
|
12311
12331
|
function Ro(n, e) {
|
|
12312
12332
|
const t = n.storedMarks || n.selection.$to.parentOffset && n.selection.$from.marks();
|
|
@@ -12315,7 +12335,7 @@ function Ro(n, e) {
|
|
|
12315
12335
|
n.tr.ensureMarks(r);
|
|
12316
12336
|
}
|
|
12317
12337
|
}
|
|
12318
|
-
const
|
|
12338
|
+
const Yp = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, editor: i }) => {
|
|
12319
12339
|
const { selection: s, doc: o } = e, { $from: l, $to: a } = s, c = i.extensionManager.attributes, d = Nn(c, l.node().type.name, l.node().attrs);
|
|
12320
12340
|
if (s instanceof w && s.node.isBlock)
|
|
12321
12341
|
return !l.parentOffset || !Rt(o, l.pos) ? !1 : (r && (n && Ro(t, i.extensionManager.splittableMarks), e.split(l.pos).scrollIntoView()), !0);
|
|
@@ -12324,7 +12344,7 @@ const Gp = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
12324
12344
|
if (r) {
|
|
12325
12345
|
const u = a.parentOffset === a.parent.content.size;
|
|
12326
12346
|
s instanceof D && e.deleteSelection();
|
|
12327
|
-
const h = l.depth === 0 ? void 0 :
|
|
12347
|
+
const h = l.depth === 0 ? void 0 : Rp(l.node(-1).contentMatchAt(l.indexAfter(-1)));
|
|
12328
12348
|
let f = u && h ? [
|
|
12329
12349
|
{
|
|
12330
12350
|
type: h,
|
|
@@ -12343,7 +12363,7 @@ const Gp = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
12343
12363
|
n && Ro(t, i.extensionManager.splittableMarks), e.scrollIntoView();
|
|
12344
12364
|
}
|
|
12345
12365
|
return !0;
|
|
12346
|
-
},
|
|
12366
|
+
}, Xp = (n) => ({ tr: e, state: t, dispatch: r, editor: i }) => {
|
|
12347
12367
|
var s;
|
|
12348
12368
|
const o = W(n, t.schema), { $from: l, $to: a } = t.selection, c = t.selection.node;
|
|
12349
12369
|
if (c && c.isBlock || l.depth < 2 || !l.sameParent(a))
|
|
@@ -12407,7 +12427,7 @@ const Gp = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
12407
12427
|
return !0;
|
|
12408
12428
|
const i = n.doc.nodeAt(r);
|
|
12409
12429
|
return t.node.type === (i == null ? void 0 : i.type) && rt(n.doc, r) && n.join(r), !0;
|
|
12410
|
-
},
|
|
12430
|
+
}, Qp = (n, e, t, r = {}) => ({ editor: i, tr: s, state: o, dispatch: l, chain: a, commands: c, can: d }) => {
|
|
12411
12431
|
const { extensions: u, splittableMarks: h } = i.extensionManager, f = W(n, o.schema), p = W(e, o.schema), { selection: m, storedMarks: g } = o, { $from: y, $to: x } = m, T = y.blockRange(x), R = g || m.$to.parentOffset && m.$from.marks();
|
|
12412
12432
|
if (!T)
|
|
12413
12433
|
return !1;
|
|
@@ -12422,16 +12442,16 @@ const Gp = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
12422
12442
|
const E = d().wrapInList(f, r), L = R.filter((I) => h.includes(I.type.name));
|
|
12423
12443
|
return s.ensureMarks(L), E ? !0 : c.clearNodes();
|
|
12424
12444
|
}).wrapInList(f, r).command(() => di(s, f)).command(() => ui(s, f)).run();
|
|
12425
|
-
},
|
|
12445
|
+
}, Zp = (n, e = {}, t = {}) => ({ state: r, commands: i }) => {
|
|
12426
12446
|
const { extendEmptyMarkRange: s = !1 } = t, o = st(n, r.schema);
|
|
12427
12447
|
return Li(r, o, e) ? i.unsetMark(o, { extendEmptyMarkRange: s }) : i.setMark(o, e);
|
|
12428
|
-
},
|
|
12448
|
+
}, em = (n, e, t = {}) => ({ state: r, commands: i }) => {
|
|
12429
12449
|
const s = W(n, r.schema), o = W(e, r.schema);
|
|
12430
12450
|
return pn(r, s, t) ? i.setNode(o) : i.setNode(s, t);
|
|
12431
|
-
},
|
|
12451
|
+
}, tm = (n, e = {}) => ({ state: t, commands: r }) => {
|
|
12432
12452
|
const i = W(n, t.schema);
|
|
12433
12453
|
return pn(t, i, e) ? r.lift(i) : r.wrapIn(i, e);
|
|
12434
|
-
},
|
|
12454
|
+
}, nm = () => ({ state: n, dispatch: e }) => {
|
|
12435
12455
|
const t = n.plugins;
|
|
12436
12456
|
for (let r = 0; r < t.length; r += 1) {
|
|
12437
12457
|
const i = t[r];
|
|
@@ -12451,12 +12471,12 @@ const Gp = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
12451
12471
|
}
|
|
12452
12472
|
}
|
|
12453
12473
|
return !1;
|
|
12454
|
-
},
|
|
12474
|
+
}, rm = () => ({ tr: n, dispatch: e }) => {
|
|
12455
12475
|
const { selection: t } = n, { empty: r, ranges: i } = t;
|
|
12456
12476
|
return r || e && i.forEach((s) => {
|
|
12457
12477
|
n.removeMark(s.$from.pos, s.$to.pos);
|
|
12458
12478
|
}), !0;
|
|
12459
|
-
},
|
|
12479
|
+
}, im = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
12460
12480
|
var s;
|
|
12461
12481
|
const { extendEmptyMarkRange: o = !1 } = e, { selection: l } = t, a = st(n, r.schema), { $from: c, empty: d, ranges: u } = l;
|
|
12462
12482
|
if (!i)
|
|
@@ -12470,7 +12490,7 @@ const Gp = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
12470
12490
|
t.removeMark(h.$from.pos, h.$to.pos, a);
|
|
12471
12491
|
});
|
|
12472
12492
|
return t.removeStoredMark(a), !0;
|
|
12473
|
-
},
|
|
12493
|
+
}, sm = (n, e = {}) => ({ tr: t, state: r, dispatch: i }) => {
|
|
12474
12494
|
let s = null, o = null;
|
|
12475
12495
|
const l = Fr(typeof n == "string" ? n : n.name, r.schema);
|
|
12476
12496
|
return l ? (l === "node" && (s = W(n, r.schema)), l === "mark" && (o = st(n, r.schema)), i && t.selection.ranges.forEach((a) => {
|
|
@@ -12490,77 +12510,77 @@ const Gp = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: r, edit
|
|
|
12490
12510
|
});
|
|
12491
12511
|
});
|
|
12492
12512
|
}), !0) : !1;
|
|
12493
|
-
}, sm = (n, e = {}) => ({ state: t, dispatch: r }) => {
|
|
12494
|
-
const i = W(n, t.schema);
|
|
12495
|
-
return wf(i, e)(t, r);
|
|
12496
12513
|
}, om = (n, e = {}) => ({ state: t, dispatch: r }) => {
|
|
12497
12514
|
const i = W(n, t.schema);
|
|
12498
12515
|
return Of(i, e)(t, r);
|
|
12516
|
+
}, lm = (n, e = {}) => ({ state: t, dispatch: r }) => {
|
|
12517
|
+
const i = W(n, t.schema);
|
|
12518
|
+
return vf(i, e)(t, r);
|
|
12499
12519
|
};
|
|
12500
|
-
var
|
|
12520
|
+
var am = /* @__PURE__ */ Object.freeze({
|
|
12501
12521
|
__proto__: null,
|
|
12502
|
-
blur:
|
|
12503
|
-
clearContent:
|
|
12504
|
-
clearNodes:
|
|
12505
|
-
command:
|
|
12506
|
-
createParagraphNear:
|
|
12507
|
-
deleteCurrentNode:
|
|
12508
|
-
deleteNode:
|
|
12509
|
-
deleteRange:
|
|
12510
|
-
deleteSelection:
|
|
12511
|
-
enter:
|
|
12512
|
-
exitCode:
|
|
12513
|
-
extendMarkRange:
|
|
12514
|
-
first:
|
|
12515
|
-
focus:
|
|
12516
|
-
forEach:
|
|
12517
|
-
insertContent:
|
|
12518
|
-
insertContentAt:
|
|
12519
|
-
joinUp:
|
|
12520
|
-
joinDown:
|
|
12521
|
-
joinBackward:
|
|
12522
|
-
joinForward:
|
|
12523
|
-
keyboardShortcut:
|
|
12524
|
-
lift:
|
|
12525
|
-
liftEmptyBlock:
|
|
12526
|
-
liftListItem:
|
|
12527
|
-
newlineInCode:
|
|
12528
|
-
resetAttributes:
|
|
12529
|
-
scrollIntoView:
|
|
12530
|
-
selectAll:
|
|
12531
|
-
selectNodeBackward:
|
|
12532
|
-
selectNodeForward:
|
|
12533
|
-
selectParentNode:
|
|
12534
|
-
selectTextblockEnd:
|
|
12535
|
-
selectTextblockStart:
|
|
12536
|
-
setContent:
|
|
12537
|
-
setMark:
|
|
12538
|
-
setMeta:
|
|
12539
|
-
setNode:
|
|
12540
|
-
setNodeSelection:
|
|
12541
|
-
setTextSelection:
|
|
12542
|
-
sinkListItem:
|
|
12543
|
-
splitBlock:
|
|
12544
|
-
splitListItem:
|
|
12545
|
-
toggleList:
|
|
12546
|
-
toggleMark:
|
|
12547
|
-
toggleNode:
|
|
12548
|
-
toggleWrap:
|
|
12549
|
-
undoInputRule:
|
|
12550
|
-
unsetAllMarks:
|
|
12551
|
-
unsetMark:
|
|
12552
|
-
updateAttributes:
|
|
12553
|
-
wrapIn:
|
|
12554
|
-
wrapInList:
|
|
12522
|
+
blur: Jf,
|
|
12523
|
+
clearContent: Gf,
|
|
12524
|
+
clearNodes: Yf,
|
|
12525
|
+
command: Xf,
|
|
12526
|
+
createParagraphNear: Qf,
|
|
12527
|
+
deleteCurrentNode: Zf,
|
|
12528
|
+
deleteNode: ep,
|
|
12529
|
+
deleteRange: tp,
|
|
12530
|
+
deleteSelection: np,
|
|
12531
|
+
enter: rp,
|
|
12532
|
+
exitCode: ip,
|
|
12533
|
+
extendMarkRange: op,
|
|
12534
|
+
first: lp,
|
|
12535
|
+
focus: ap,
|
|
12536
|
+
forEach: cp,
|
|
12537
|
+
insertContent: dp,
|
|
12538
|
+
insertContentAt: fp,
|
|
12539
|
+
joinUp: pp,
|
|
12540
|
+
joinDown: mp,
|
|
12541
|
+
joinBackward: gp,
|
|
12542
|
+
joinForward: yp,
|
|
12543
|
+
keyboardShortcut: kp,
|
|
12544
|
+
lift: Sp,
|
|
12545
|
+
liftEmptyBlock: xp,
|
|
12546
|
+
liftListItem: Cp,
|
|
12547
|
+
newlineInCode: Ep,
|
|
12548
|
+
resetAttributes: Tp,
|
|
12549
|
+
scrollIntoView: Mp,
|
|
12550
|
+
selectAll: wp,
|
|
12551
|
+
selectNodeBackward: Op,
|
|
12552
|
+
selectNodeForward: vp,
|
|
12553
|
+
selectParentNode: Ap,
|
|
12554
|
+
selectTextblockEnd: Np,
|
|
12555
|
+
selectTextblockStart: Dp,
|
|
12556
|
+
setContent: Ip,
|
|
12557
|
+
setMark: qp,
|
|
12558
|
+
setMeta: Kp,
|
|
12559
|
+
setNode: Wp,
|
|
12560
|
+
setNodeSelection: Up,
|
|
12561
|
+
setTextSelection: Jp,
|
|
12562
|
+
sinkListItem: Gp,
|
|
12563
|
+
splitBlock: Yp,
|
|
12564
|
+
splitListItem: Xp,
|
|
12565
|
+
toggleList: Qp,
|
|
12566
|
+
toggleMark: Zp,
|
|
12567
|
+
toggleNode: em,
|
|
12568
|
+
toggleWrap: tm,
|
|
12569
|
+
undoInputRule: nm,
|
|
12570
|
+
unsetAllMarks: rm,
|
|
12571
|
+
unsetMark: im,
|
|
12572
|
+
updateAttributes: sm,
|
|
12573
|
+
wrapIn: om,
|
|
12574
|
+
wrapInList: lm
|
|
12555
12575
|
});
|
|
12556
|
-
const
|
|
12576
|
+
const cm = ge.create({
|
|
12557
12577
|
name: "commands",
|
|
12558
12578
|
addCommands() {
|
|
12559
12579
|
return {
|
|
12560
|
-
...
|
|
12580
|
+
...am
|
|
12561
12581
|
};
|
|
12562
12582
|
}
|
|
12563
|
-
}),
|
|
12583
|
+
}), dm = ge.create({
|
|
12564
12584
|
name: "editable",
|
|
12565
12585
|
addProseMirrorPlugins() {
|
|
12566
12586
|
return [
|
|
@@ -12572,7 +12592,7 @@ const am = ge.create({
|
|
|
12572
12592
|
})
|
|
12573
12593
|
];
|
|
12574
12594
|
}
|
|
12575
|
-
}),
|
|
12595
|
+
}), um = ge.create({
|
|
12576
12596
|
name: "focusEvents",
|
|
12577
12597
|
addProseMirrorPlugins() {
|
|
12578
12598
|
const { editor: n } = this;
|
|
@@ -12596,7 +12616,7 @@ const am = ge.create({
|
|
|
12596
12616
|
})
|
|
12597
12617
|
];
|
|
12598
12618
|
}
|
|
12599
|
-
}),
|
|
12619
|
+
}), hm = ge.create({
|
|
12600
12620
|
name: "keymap",
|
|
12601
12621
|
addKeyboardShortcuts() {
|
|
12602
12622
|
const n = () => this.editor.commands.first(({ commands: o }) => [
|
|
@@ -12671,7 +12691,7 @@ const am = ge.create({
|
|
|
12671
12691
|
})
|
|
12672
12692
|
];
|
|
12673
12693
|
}
|
|
12674
|
-
}),
|
|
12694
|
+
}), fm = ge.create({
|
|
12675
12695
|
name: "tabindex",
|
|
12676
12696
|
addProseMirrorPlugins() {
|
|
12677
12697
|
return [
|
|
@@ -12684,16 +12704,16 @@ const am = ge.create({
|
|
|
12684
12704
|
];
|
|
12685
12705
|
}
|
|
12686
12706
|
});
|
|
12687
|
-
var
|
|
12707
|
+
var pm = /* @__PURE__ */ Object.freeze({
|
|
12688
12708
|
__proto__: null,
|
|
12689
|
-
ClipboardTextSerializer:
|
|
12690
|
-
Commands:
|
|
12691
|
-
Editable:
|
|
12692
|
-
FocusEvents:
|
|
12693
|
-
Keymap:
|
|
12694
|
-
Tabindex:
|
|
12709
|
+
ClipboardTextSerializer: Uf,
|
|
12710
|
+
Commands: cm,
|
|
12711
|
+
Editable: dm,
|
|
12712
|
+
FocusEvents: um,
|
|
12713
|
+
Keymap: hm,
|
|
12714
|
+
Tabindex: fm
|
|
12695
12715
|
});
|
|
12696
|
-
const
|
|
12716
|
+
const mm = `.ProseMirror {
|
|
12697
12717
|
position: relative;
|
|
12698
12718
|
}
|
|
12699
12719
|
|
|
@@ -12768,14 +12788,14 @@ img.ProseMirror-separator {
|
|
|
12768
12788
|
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
12769
12789
|
opacity: 0
|
|
12770
12790
|
}`;
|
|
12771
|
-
function
|
|
12791
|
+
function gm(n, e) {
|
|
12772
12792
|
const t = document.querySelector("style[data-tiptap-style]");
|
|
12773
12793
|
if (t !== null)
|
|
12774
12794
|
return t;
|
|
12775
12795
|
const r = document.createElement("style");
|
|
12776
12796
|
return e && r.setAttribute("nonce", e), r.setAttribute("data-tiptap-style", ""), r.innerHTML = n, document.getElementsByTagName("head")[0].appendChild(r), r;
|
|
12777
12797
|
}
|
|
12778
|
-
let
|
|
12798
|
+
let ym = class extends Pf {
|
|
12779
12799
|
constructor(e = {}) {
|
|
12780
12800
|
super(), this.isFocused = !1, this.extensionStorage = {}, this.options = {
|
|
12781
12801
|
element: document.createElement("div"),
|
|
@@ -12830,7 +12850,7 @@ let gm = class extends Rf {
|
|
|
12830
12850
|
* Inject CSS styles.
|
|
12831
12851
|
*/
|
|
12832
12852
|
injectCSS() {
|
|
12833
|
-
this.options.injectCSS && document && (this.css = mm
|
|
12853
|
+
this.options.injectCSS && document && (this.css = gm(mm, this.options.injectNonce));
|
|
12834
12854
|
}
|
|
12835
12855
|
/**
|
|
12836
12856
|
* Update editor options.
|
|
@@ -12889,7 +12909,7 @@ let gm = class extends Rf {
|
|
|
12889
12909
|
* Creates an extension manager.
|
|
12890
12910
|
*/
|
|
12891
12911
|
createExtensionManager() {
|
|
12892
|
-
const t = [...this.options.enableCoreExtensions ? Object.values(
|
|
12912
|
+
const t = [...this.options.enableCoreExtensions ? Object.values(pm) : [], ...this.options.extensions].filter((r) => ["extension", "node", "mark"].includes(r == null ? void 0 : r.type));
|
|
12893
12913
|
this.extensionManager = new It(t, this);
|
|
12894
12914
|
}
|
|
12895
12915
|
/**
|
|
@@ -12911,7 +12931,7 @@ let gm = class extends Rf {
|
|
|
12911
12931
|
*/
|
|
12912
12932
|
createView() {
|
|
12913
12933
|
const e = Na(this.options.content, this.schema, this.options.parseOptions), t = Aa(e, this.options.autofocus);
|
|
12914
|
-
this.view = new
|
|
12934
|
+
this.view = new Xh(this.options.element, {
|
|
12915
12935
|
...this.options.editorProps,
|
|
12916
12936
|
dispatchTransaction: this.dispatchTransaction.bind(this),
|
|
12917
12937
|
state: Dt.create({
|
|
@@ -12988,7 +13008,7 @@ let gm = class extends Rf {
|
|
|
12988
13008
|
}
|
|
12989
13009
|
isActive(e, t) {
|
|
12990
13010
|
const r = typeof e == "string" ? e : null, i = typeof e == "string" ? t : e;
|
|
12991
|
-
return
|
|
13011
|
+
return Hp(this.state, r, i);
|
|
12992
13012
|
}
|
|
12993
13013
|
/**
|
|
12994
13014
|
* Get the document as JSON.
|
|
@@ -13000,7 +13020,7 @@ let gm = class extends Rf {
|
|
|
13000
13020
|
* Get the document as HTML.
|
|
13001
13021
|
*/
|
|
13002
13022
|
getHTML() {
|
|
13003
|
-
return
|
|
13023
|
+
return Lp(this.state.doc.content, this.schema);
|
|
13004
13024
|
}
|
|
13005
13025
|
/**
|
|
13006
13026
|
* Get the document as text.
|
|
@@ -13009,7 +13029,7 @@ let gm = class extends Rf {
|
|
|
13009
13029
|
const { blockSeparator: t = `
|
|
13010
13030
|
|
|
13011
13031
|
`, textSerializers: r = {} } = e || {};
|
|
13012
|
-
return
|
|
13032
|
+
return Bp(this.state.doc, {
|
|
13013
13033
|
blockSeparator: t,
|
|
13014
13034
|
textSerializers: {
|
|
13015
13035
|
...va(this.schema),
|
|
@@ -13021,7 +13041,7 @@ let gm = class extends Rf {
|
|
|
13021
13041
|
* Check if there is no content.
|
|
13022
13042
|
*/
|
|
13023
13043
|
get isEmpty() {
|
|
13024
|
-
return
|
|
13044
|
+
return Vp(this.state.doc);
|
|
13025
13045
|
}
|
|
13026
13046
|
/**
|
|
13027
13047
|
* Get the number of characters for the current document.
|
|
@@ -13195,7 +13215,7 @@ class ne {
|
|
|
13195
13215
|
})), t;
|
|
13196
13216
|
}
|
|
13197
13217
|
}
|
|
13198
|
-
class
|
|
13218
|
+
class bm {
|
|
13199
13219
|
constructor(e, t, r) {
|
|
13200
13220
|
this.isDragging = !1, this.component = e, this.editor = t.editor, this.options = {
|
|
13201
13221
|
stopEvent: null,
|
|
@@ -13290,7 +13310,7 @@ function Ht(n) {
|
|
|
13290
13310
|
}
|
|
13291
13311
|
});
|
|
13292
13312
|
}
|
|
13293
|
-
function
|
|
13313
|
+
function km(n) {
|
|
13294
13314
|
return n.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
13295
13315
|
}
|
|
13296
13316
|
function Bo(n) {
|
|
@@ -13307,7 +13327,7 @@ function Bo(n) {
|
|
|
13307
13327
|
}
|
|
13308
13328
|
});
|
|
13309
13329
|
}
|
|
13310
|
-
class
|
|
13330
|
+
class Sm {
|
|
13311
13331
|
constructor({ editor: e, element: t, view: r, tippyOptions: i = {}, updateDelay: s = 250, shouldShow: o }) {
|
|
13312
13332
|
this.preventHide = !1, this.shouldShow = ({ view: l, state: a, from: c, to: d }) => {
|
|
13313
13333
|
const { doc: u, selection: h } = a, { empty: f } = h, p = !u.textBetween(c, d).length && us(a.selection), m = this.element.contains(document.activeElement);
|
|
@@ -13352,7 +13372,7 @@ class km {
|
|
|
13352
13372
|
}
|
|
13353
13373
|
(h = this.tippy) === null || h === void 0 || h.setProps({
|
|
13354
13374
|
getReferenceClientRect: ((f = this.tippyOptions) === null || f === void 0 ? void 0 : f.getReferenceClientRect) || (() => {
|
|
13355
|
-
if (
|
|
13375
|
+
if ($p(p.selection)) {
|
|
13356
13376
|
let E = l.nodeDOM(T);
|
|
13357
13377
|
const L = E.dataset.nodeViewWrapper ? E : E.querySelector("[data-node-view-wrapper]");
|
|
13358
13378
|
if (L && (E = L.firstChild), E)
|
|
@@ -13400,7 +13420,7 @@ class km {
|
|
|
13400
13420
|
}
|
|
13401
13421
|
const Ba = (n) => new Q({
|
|
13402
13422
|
key: typeof n.pluginKey == "string" ? new ie(n.pluginKey) : n.pluginKey,
|
|
13403
|
-
view: (e) => new
|
|
13423
|
+
view: (e) => new Sm({ view: e, ...n })
|
|
13404
13424
|
});
|
|
13405
13425
|
ge.create({
|
|
13406
13426
|
name: "bubbleMenu",
|
|
@@ -13426,7 +13446,7 @@ ge.create({
|
|
|
13426
13446
|
] : [];
|
|
13427
13447
|
}
|
|
13428
13448
|
});
|
|
13429
|
-
class
|
|
13449
|
+
class xm {
|
|
13430
13450
|
constructor({ editor: e, element: t, view: r, tippyOptions: i = {}, shouldShow: s }) {
|
|
13431
13451
|
this.preventHide = !1, this.shouldShow = ({ view: o, state: l }) => {
|
|
13432
13452
|
const { selection: a } = l, { $anchor: c, empty: d } = a, u = c.depth === 1, h = c.parent.isTextblock && !c.parent.type.spec.code && !c.parent.textContent;
|
|
@@ -13492,7 +13512,7 @@ class Sm {
|
|
|
13492
13512
|
}
|
|
13493
13513
|
const _a = (n) => new Q({
|
|
13494
13514
|
key: typeof n.pluginKey == "string" ? new ie(n.pluginKey) : n.pluginKey,
|
|
13495
|
-
view: (e) => new
|
|
13515
|
+
view: (e) => new xm({ view: e, ...n })
|
|
13496
13516
|
});
|
|
13497
13517
|
ge.create({
|
|
13498
13518
|
name: "floatingMenu",
|
|
@@ -13575,7 +13595,7 @@ function _o(n) {
|
|
|
13575
13595
|
}
|
|
13576
13596
|
}));
|
|
13577
13597
|
}
|
|
13578
|
-
class
|
|
13598
|
+
class Cm extends ym {
|
|
13579
13599
|
constructor(e = {}) {
|
|
13580
13600
|
return super(e), this.vueRenderers = ll(/* @__PURE__ */ new Map()), this.contentComponent = null, this.reactiveState = _o(this.view.state), this.reactiveExtensionStorage = _o(this.extensionStorage), this.on("transaction", () => {
|
|
13581
13601
|
this.reactiveState.value = this.view.state, this.reactiveExtensionStorage.value = this.extensionStorage;
|
|
@@ -13600,7 +13620,7 @@ class xm extends gm {
|
|
|
13600
13620
|
super.unregisterPlugin(e), this.reactiveState.value = this.view.state;
|
|
13601
13621
|
}
|
|
13602
13622
|
}
|
|
13603
|
-
const
|
|
13623
|
+
const Em = $t({
|
|
13604
13624
|
name: "EditorContent",
|
|
13605
13625
|
props: {
|
|
13606
13626
|
editor: {
|
|
@@ -13787,7 +13807,7 @@ const za = {
|
|
|
13787
13807
|
required: !0
|
|
13788
13808
|
}
|
|
13789
13809
|
};
|
|
13790
|
-
class
|
|
13810
|
+
class Tm extends bm {
|
|
13791
13811
|
mount() {
|
|
13792
13812
|
const e = {
|
|
13793
13813
|
editor: this.editor,
|
|
@@ -13874,9 +13894,9 @@ class Em extends ym {
|
|
|
13874
13894
|
}
|
|
13875
13895
|
}
|
|
13876
13896
|
function Ha(n, e) {
|
|
13877
|
-
return (t) => t.editor.contentComponent ? new
|
|
13897
|
+
return (t) => t.editor.contentComponent ? new Tm(n, t, e) : {};
|
|
13878
13898
|
}
|
|
13879
|
-
const
|
|
13899
|
+
const Mm = /^\s*>\s$/, wm = ne.create({
|
|
13880
13900
|
name: "blockquote",
|
|
13881
13901
|
addOptions() {
|
|
13882
13902
|
return {
|
|
@@ -13909,12 +13929,12 @@ const Tm = /^\s*>\s$/, Mm = ne.create({
|
|
|
13909
13929
|
addInputRules() {
|
|
13910
13930
|
return [
|
|
13911
13931
|
gn({
|
|
13912
|
-
find:
|
|
13932
|
+
find: Mm,
|
|
13913
13933
|
type: this.type
|
|
13914
13934
|
})
|
|
13915
13935
|
];
|
|
13916
13936
|
}
|
|
13917
|
-
}),
|
|
13937
|
+
}), Om = /^```([a-z]+)?[\s\n]$/, vm = /^~~~([a-z]+)?[\s\n]$/, Am = ne.create({
|
|
13918
13938
|
name: "codeBlock",
|
|
13919
13939
|
addOptions() {
|
|
13920
13940
|
return {
|
|
@@ -14004,14 +14024,14 @@ const Tm = /^\s*>\s$/, Mm = ne.create({
|
|
|
14004
14024
|
addInputRules() {
|
|
14005
14025
|
return [
|
|
14006
14026
|
Lo({
|
|
14007
|
-
find:
|
|
14027
|
+
find: Om,
|
|
14008
14028
|
type: this.type,
|
|
14009
14029
|
getAttributes: (n) => ({
|
|
14010
14030
|
language: n[1]
|
|
14011
14031
|
})
|
|
14012
14032
|
}),
|
|
14013
14033
|
Lo({
|
|
14014
|
-
find:
|
|
14034
|
+
find: vm,
|
|
14015
14035
|
type: this.type,
|
|
14016
14036
|
getAttributes: (n) => ({
|
|
14017
14037
|
language: n[1]
|
|
@@ -14040,11 +14060,11 @@ const Tm = /^\s*>\s$/, Mm = ne.create({
|
|
|
14040
14060
|
})
|
|
14041
14061
|
];
|
|
14042
14062
|
}
|
|
14043
|
-
}),
|
|
14063
|
+
}), Nm = ne.create({
|
|
14044
14064
|
name: "doc",
|
|
14045
14065
|
topNode: !0,
|
|
14046
14066
|
content: "block+"
|
|
14047
|
-
}),
|
|
14067
|
+
}), Dm = ne.create({
|
|
14048
14068
|
name: "hardBreak",
|
|
14049
14069
|
addOptions() {
|
|
14050
14070
|
return {
|
|
@@ -14093,7 +14113,7 @@ const Tm = /^\s*>\s$/, Mm = ne.create({
|
|
|
14093
14113
|
"Shift-Enter": () => this.editor.commands.setHardBreak()
|
|
14094
14114
|
};
|
|
14095
14115
|
}
|
|
14096
|
-
}),
|
|
14116
|
+
}), Im = ne.create({
|
|
14097
14117
|
name: "paragraph",
|
|
14098
14118
|
priority: 1e3,
|
|
14099
14119
|
addOptions() {
|
|
@@ -14121,7 +14141,7 @@ const Tm = /^\s*>\s$/, Mm = ne.create({
|
|
|
14121
14141
|
"Mod-Alt-0": () => this.editor.commands.setParagraph()
|
|
14122
14142
|
};
|
|
14123
14143
|
}
|
|
14124
|
-
}),
|
|
14144
|
+
}), Rm = ge.create({
|
|
14125
14145
|
name: "placeholder",
|
|
14126
14146
|
addOptions() {
|
|
14127
14147
|
return {
|
|
@@ -14166,7 +14186,7 @@ const Tm = /^\s*>\s$/, Mm = ne.create({
|
|
|
14166
14186
|
})
|
|
14167
14187
|
];
|
|
14168
14188
|
}
|
|
14169
|
-
}),
|
|
14189
|
+
}), Pm = /(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/, Lm = /(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g, Bm = /(?:^|\s)((?:__)((?:[^__]+))(?:__))$/, _m = /(?:^|\s)((?:__)((?:[^__]+))(?:__))/g, Fm = xe.create({
|
|
14170
14190
|
name: "bold",
|
|
14171
14191
|
addOptions() {
|
|
14172
14192
|
return {
|
|
@@ -14207,11 +14227,11 @@ const Tm = /^\s*>\s$/, Mm = ne.create({
|
|
|
14207
14227
|
addInputRules() {
|
|
14208
14228
|
return [
|
|
14209
14229
|
mn({
|
|
14210
|
-
find:
|
|
14230
|
+
find: Pm,
|
|
14211
14231
|
type: this.type
|
|
14212
14232
|
}),
|
|
14213
14233
|
mn({
|
|
14214
|
-
find:
|
|
14234
|
+
find: Bm,
|
|
14215
14235
|
type: this.type
|
|
14216
14236
|
})
|
|
14217
14237
|
];
|
|
@@ -14219,16 +14239,16 @@ const Tm = /^\s*>\s$/, Mm = ne.create({
|
|
|
14219
14239
|
addPasteRules() {
|
|
14220
14240
|
return [
|
|
14221
14241
|
Ht({
|
|
14222
|
-
find:
|
|
14242
|
+
find: Lm,
|
|
14223
14243
|
type: this.type
|
|
14224
14244
|
}),
|
|
14225
14245
|
Ht({
|
|
14226
|
-
find:
|
|
14246
|
+
find: _m,
|
|
14227
14247
|
type: this.type
|
|
14228
14248
|
})
|
|
14229
14249
|
];
|
|
14230
14250
|
}
|
|
14231
|
-
}),
|
|
14251
|
+
}), zm = ne.create({
|
|
14232
14252
|
name: "listItem",
|
|
14233
14253
|
addOptions() {
|
|
14234
14254
|
return {
|
|
@@ -14282,7 +14302,7 @@ const Tm = /^\s*>\s$/, Mm = ne.create({
|
|
|
14282
14302
|
}
|
|
14283
14303
|
};
|
|
14284
14304
|
}
|
|
14285
|
-
}), zo = /^\s*([-+*])\s$/,
|
|
14305
|
+
}), zo = /^\s*([-+*])\s$/, Hm = ne.create({
|
|
14286
14306
|
name: "bulletList",
|
|
14287
14307
|
addOptions() {
|
|
14288
14308
|
return {
|
|
@@ -14306,7 +14326,7 @@ const Tm = /^\s*>\s$/, Mm = ne.create({
|
|
|
14306
14326
|
},
|
|
14307
14327
|
addCommands() {
|
|
14308
14328
|
return {
|
|
14309
|
-
toggleBulletList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(
|
|
14329
|
+
toggleBulletList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(zm.name, this.editor.getAttributes(Fo.name)).run() : n.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
|
|
14310
14330
|
};
|
|
14311
14331
|
},
|
|
14312
14332
|
addKeyboardShortcuts() {
|
|
@@ -14330,7 +14350,7 @@ const Tm = /^\s*>\s$/, Mm = ne.create({
|
|
|
14330
14350
|
n
|
|
14331
14351
|
];
|
|
14332
14352
|
}
|
|
14333
|
-
}),
|
|
14353
|
+
}), Vm = /(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/, $m = /(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g, jm = /(?:^|\s)((?:_)((?:[^_]+))(?:_))$/, qm = /(?:^|\s)((?:_)((?:[^_]+))(?:_))/g, Km = xe.create({
|
|
14334
14354
|
name: "italic",
|
|
14335
14355
|
addOptions() {
|
|
14336
14356
|
return {
|
|
@@ -14370,11 +14390,11 @@ const Tm = /^\s*>\s$/, Mm = ne.create({
|
|
|
14370
14390
|
addInputRules() {
|
|
14371
14391
|
return [
|
|
14372
14392
|
mn({
|
|
14373
|
-
find:
|
|
14393
|
+
find: Vm,
|
|
14374
14394
|
type: this.type
|
|
14375
14395
|
}),
|
|
14376
14396
|
mn({
|
|
14377
|
-
find:
|
|
14397
|
+
find: jm,
|
|
14378
14398
|
type: this.type
|
|
14379
14399
|
})
|
|
14380
14400
|
];
|
|
@@ -14382,31 +14402,31 @@ const Tm = /^\s*>\s$/, Mm = ne.create({
|
|
|
14382
14402
|
addPasteRules() {
|
|
14383
14403
|
return [
|
|
14384
14404
|
Ht({
|
|
14385
|
-
find:
|
|
14405
|
+
find: $m,
|
|
14386
14406
|
type: this.type
|
|
14387
14407
|
}),
|
|
14388
14408
|
Ht({
|
|
14389
|
-
find:
|
|
14409
|
+
find: qm,
|
|
14390
14410
|
type: this.type
|
|
14391
14411
|
})
|
|
14392
14412
|
];
|
|
14393
14413
|
}
|
|
14394
|
-
}),
|
|
14414
|
+
}), Wm = "aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2", Um = "ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2", Vt = (n, e) => {
|
|
14395
14415
|
for (const t in e)
|
|
14396
14416
|
n[t] = e[t];
|
|
14397
14417
|
return n;
|
|
14398
|
-
}, Bi = "numeric", _i = "ascii", Fi = "alpha", Dn = "asciinumeric", Mn = "alphanumeric", zi = "domain", Va = "emoji",
|
|
14399
|
-
function
|
|
14418
|
+
}, Bi = "numeric", _i = "ascii", Fi = "alpha", Dn = "asciinumeric", Mn = "alphanumeric", zi = "domain", Va = "emoji", Jm = "scheme", Gm = "slashscheme", Ho = "whitespace";
|
|
14419
|
+
function Ym(n, e) {
|
|
14400
14420
|
return n in e || (e[n] = []), e[n];
|
|
14401
14421
|
}
|
|
14402
14422
|
function dt(n, e, t) {
|
|
14403
14423
|
e[Bi] && (e[Dn] = !0, e[Mn] = !0), e[_i] && (e[Dn] = !0, e[Fi] = !0), e[Dn] && (e[Mn] = !0), e[Fi] && (e[Mn] = !0), e[Mn] && (e[zi] = !0), e[Va] && (e[zi] = !0);
|
|
14404
14424
|
for (const r in e) {
|
|
14405
|
-
const i =
|
|
14425
|
+
const i = Ym(r, t);
|
|
14406
14426
|
i.indexOf(n) < 0 && i.push(n);
|
|
14407
14427
|
}
|
|
14408
14428
|
}
|
|
14409
|
-
function
|
|
14429
|
+
function Xm(n, e) {
|
|
14410
14430
|
const t = {};
|
|
14411
14431
|
for (const r in e)
|
|
14412
14432
|
e[r].indexOf(n) >= 0 && (t[r] = !0);
|
|
@@ -14528,7 +14548,7 @@ ue.prototype = {
|
|
|
14528
14548
|
if (l ? (o = new ue(), Vt(o.j, l.j), o.jr.push.apply(o.jr, l.jr), o.jd = l.jd, o.t = l.t) : o = new ue(), s) {
|
|
14529
14549
|
if (r)
|
|
14530
14550
|
if (o.t && typeof o.t == "string") {
|
|
14531
|
-
const a = Vt(
|
|
14551
|
+
const a = Vt(Xm(o.t, r), t);
|
|
14532
14552
|
dt(s, a, r);
|
|
14533
14553
|
} else
|
|
14534
14554
|
t && dt(s, t, r);
|
|
@@ -14594,14 +14614,14 @@ var qa = /* @__PURE__ */ Object.freeze({
|
|
|
14594
14614
|
SYM: xr
|
|
14595
14615
|
});
|
|
14596
14616
|
const wt = /[a-z]/, hi = new RegExp("\\p{L}", "u"), fi = new RegExp("\\p{Emoji}", "u"), pi = /\d/, $o = /\s/, jo = `
|
|
14597
|
-
`,
|
|
14617
|
+
`, Qm = "️", Zm = "";
|
|
14598
14618
|
let wn = null, On = null;
|
|
14599
|
-
function
|
|
14619
|
+
function eg(n) {
|
|
14600
14620
|
n === void 0 && (n = []);
|
|
14601
14621
|
const e = {};
|
|
14602
14622
|
ue.groups = e;
|
|
14603
14623
|
const t = new ue();
|
|
14604
|
-
wn == null && (wn = qo(
|
|
14624
|
+
wn == null && (wn = qo(Wm)), On == null && (On = qo(Um)), k(t, "'", ar), k(t, "{", rn), k(t, "}", sn), k(t, "[", Un), k(t, "]", Jn), k(t, "(", Gn), k(t, ")", Yn), k(t, "<", Xn), k(t, ">", Qn), k(t, "(", Zn), k(t, ")", er), k(t, "「", tr), k(t, "」", nr), k(t, "『", rr), k(t, "』", ir), k(t, "<", sr), k(t, ">", or), k(t, "&", lr), k(t, "*", cr), k(t, "@", We), k(t, "`", ur), k(t, "^", hr), k(t, ":", Je), k(t, ",", ys), k(t, "$", fr), k(t, ".", we), k(t, "=", pr), k(t, "!", bs), k(t, "-", Oe), k(t, "%", mr), k(t, "|", gr), k(t, "+", yr), k(t, "#", br), k(t, "?", kr), k(t, '"', ks), k(t, "/", ve), k(t, ";", Ss), k(t, "~", on), k(t, "_", Sr), k(t, "\\", dr);
|
|
14605
14625
|
const r = ye(t, pi, ms, {
|
|
14606
14626
|
[Bi]: !0
|
|
14607
14627
|
});
|
|
@@ -14623,8 +14643,8 @@ function Zm(n) {
|
|
|
14623
14643
|
const l = ye(t, fi, ja, {
|
|
14624
14644
|
[Va]: !0
|
|
14625
14645
|
});
|
|
14626
|
-
ye(l, fi, l), k(l,
|
|
14627
|
-
const a = k(l,
|
|
14646
|
+
ye(l, fi, l), k(l, Qm, l);
|
|
14647
|
+
const a = k(l, Zm);
|
|
14628
14648
|
ye(a, fi, l);
|
|
14629
14649
|
const c = [[wt, i]], d = [[wt, null], [hi, s]];
|
|
14630
14650
|
for (let u = 0; u < wn.length; u++)
|
|
@@ -14646,9 +14666,9 @@ function Zm(n) {
|
|
|
14646
14666
|
}, e), n = n.sort((u, h) => u[0] > h[0] ? 1 : -1);
|
|
14647
14667
|
for (let u = 0; u < n.length; u++) {
|
|
14648
14668
|
const h = n[u][0], p = n[u][1] ? {
|
|
14649
|
-
[Um]: !0
|
|
14650
|
-
} : {
|
|
14651
14669
|
[Jm]: !0
|
|
14670
|
+
} : {
|
|
14671
|
+
[Gm]: !0
|
|
14652
14672
|
};
|
|
14653
14673
|
h.indexOf("-") >= 0 ? p[zi] = !0 : wt.test(h) ? pi.test(h) ? p[Dn] = !0 : p[_i] = !0 : p[Bi] = !0, Vo(t, h, h, p);
|
|
14654
14674
|
}
|
|
@@ -14661,8 +14681,8 @@ function Zm(n) {
|
|
|
14661
14681
|
}, qa)
|
|
14662
14682
|
};
|
|
14663
14683
|
}
|
|
14664
|
-
function
|
|
14665
|
-
const t =
|
|
14684
|
+
function tg(n, e) {
|
|
14685
|
+
const t = ng(e.replace(/[A-Z]/g, (l) => l.toLowerCase())), r = t.length, i = [];
|
|
14666
14686
|
let s = 0, o = 0;
|
|
14667
14687
|
for (; o < r; ) {
|
|
14668
14688
|
let l = n, a = null, c = 0, d = null, u = -1, h = -1;
|
|
@@ -14681,7 +14701,7 @@ function eg(n, e) {
|
|
|
14681
14701
|
}
|
|
14682
14702
|
return i;
|
|
14683
14703
|
}
|
|
14684
|
-
function
|
|
14704
|
+
function ng(n) {
|
|
14685
14705
|
const e = [], t = n.length;
|
|
14686
14706
|
let r = 0;
|
|
14687
14707
|
for (; r < t; ) {
|
|
@@ -14928,7 +14948,7 @@ const Wo = Vr("email", {
|
|
|
14928
14948
|
toHref() {
|
|
14929
14949
|
return "mailto:" + this.toString();
|
|
14930
14950
|
}
|
|
14931
|
-
}), Uo = Vr("text"),
|
|
14951
|
+
}), Uo = Vr("text"), rg = Vr("nl"), vn = Vr("url", {
|
|
14932
14952
|
isLink: !0,
|
|
14933
14953
|
/**
|
|
14934
14954
|
Lowercases relevant parts of the domain and adds the protocol if
|
|
@@ -14949,7 +14969,7 @@ const Wo = Vr("email", {
|
|
|
14949
14969
|
return n.length >= 2 && n[0].t !== yn && n[1].t === Je;
|
|
14950
14970
|
}
|
|
14951
14971
|
}), be = (n) => new ue(n);
|
|
14952
|
-
function
|
|
14972
|
+
function ig(n) {
|
|
14953
14973
|
let {
|
|
14954
14974
|
groups: e
|
|
14955
14975
|
} = n;
|
|
@@ -15007,12 +15027,12 @@ function rg(n) {
|
|
|
15007
15027
|
const $e = be();
|
|
15008
15028
|
v(Ve, r), v(fe, t, fe), v(fe, r, $e), v($e, t, fe), v($e, r, $e), k(fe, He, E), k($e, He, E);
|
|
15009
15029
|
}
|
|
15010
|
-
return k(s, yn, T), k(s, gs,
|
|
15030
|
+
return k(s, yn, T), k(s, gs, rg), {
|
|
15011
15031
|
start: s,
|
|
15012
15032
|
tokens: qa
|
|
15013
15033
|
};
|
|
15014
15034
|
}
|
|
15015
|
-
function
|
|
15035
|
+
function sg(n, e, t) {
|
|
15016
15036
|
let r = t.length, i = 0, s = [], o = [];
|
|
15017
15037
|
for (; i < r; ) {
|
|
15018
15038
|
let l = n, a = null, c = null, d = 0, u = null, h = -1;
|
|
@@ -15034,8 +15054,8 @@ function mi(n, e, t) {
|
|
|
15034
15054
|
const r = t[0].s, i = t[t.length - 1].e, s = e.slice(r, i);
|
|
15035
15055
|
return new n(s, t);
|
|
15036
15056
|
}
|
|
15037
|
-
const
|
|
15038
|
-
}),
|
|
15057
|
+
const og = typeof console < "u" && console && console.warn || (() => {
|
|
15058
|
+
}), lg = "until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.", _ = {
|
|
15039
15059
|
scanner: null,
|
|
15040
15060
|
parser: null,
|
|
15041
15061
|
tokenQueue: [],
|
|
@@ -15043,24 +15063,24 @@ const sg = typeof console < "u" && console && console.warn || (() => {
|
|
|
15043
15063
|
customSchemes: [],
|
|
15044
15064
|
initialized: !1
|
|
15045
15065
|
};
|
|
15046
|
-
function
|
|
15066
|
+
function ag() {
|
|
15047
15067
|
ue.groups = {}, _.scanner = null, _.parser = null, _.tokenQueue = [], _.pluginQueue = [], _.customSchemes = [], _.initialized = !1;
|
|
15048
15068
|
}
|
|
15049
15069
|
function Jo(n, e) {
|
|
15050
|
-
if (e === void 0 && (e = !1), _.initialized &&
|
|
15070
|
+
if (e === void 0 && (e = !1), _.initialized && og(`linkifyjs: already initialized - will not register custom scheme "${n}" ${lg}`), !/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))
|
|
15051
15071
|
throw new Error(`linkifyjs: incorrect scheme format.
|
|
15052
15072
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
15053
15073
|
2. Cannot start or end with "-"
|
|
15054
15074
|
3. "-" cannot repeat`);
|
|
15055
15075
|
_.customSchemes.push([n, e]);
|
|
15056
15076
|
}
|
|
15057
|
-
function
|
|
15058
|
-
_.scanner =
|
|
15077
|
+
function cg() {
|
|
15078
|
+
_.scanner = eg(_.customSchemes);
|
|
15059
15079
|
for (let n = 0; n < _.tokenQueue.length; n++)
|
|
15060
15080
|
_.tokenQueue[n][1]({
|
|
15061
15081
|
scanner: _.scanner
|
|
15062
15082
|
});
|
|
15063
|
-
_.parser =
|
|
15083
|
+
_.parser = ig(_.scanner.tokens);
|
|
15064
15084
|
for (let n = 0; n < _.pluginQueue.length; n++)
|
|
15065
15085
|
_.pluginQueue[n][1]({
|
|
15066
15086
|
scanner: _.scanner,
|
|
@@ -15068,8 +15088,8 @@ function ag() {
|
|
|
15068
15088
|
});
|
|
15069
15089
|
_.initialized = !0;
|
|
15070
15090
|
}
|
|
15071
|
-
function
|
|
15072
|
-
return _.initialized ||
|
|
15091
|
+
function dg(n) {
|
|
15092
|
+
return _.initialized || cg(), sg(_.parser.start, n, tg(_.scanner.start, n));
|
|
15073
15093
|
}
|
|
15074
15094
|
function Cs(n, e, t) {
|
|
15075
15095
|
if (e === void 0 && (e = null), t === void 0 && (t = null), e && typeof e == "object") {
|
|
@@ -15077,14 +15097,14 @@ function Cs(n, e, t) {
|
|
|
15077
15097
|
throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);
|
|
15078
15098
|
t = e, e = null;
|
|
15079
15099
|
}
|
|
15080
|
-
const r = new xs(t), i =
|
|
15100
|
+
const r = new xs(t), i = dg(n), s = [];
|
|
15081
15101
|
for (let o = 0; o < i.length; o++) {
|
|
15082
15102
|
const l = i[o];
|
|
15083
15103
|
l.isLink && (!e || l.t === e) && r.check(l) && s.push(l.toFormattedObject(r));
|
|
15084
15104
|
}
|
|
15085
15105
|
return s;
|
|
15086
15106
|
}
|
|
15087
|
-
function
|
|
15107
|
+
function ug(n) {
|
|
15088
15108
|
return new Q({
|
|
15089
15109
|
key: new ie("autolink"),
|
|
15090
15110
|
appendTransaction: (e, t, r) => {
|
|
@@ -15117,7 +15137,7 @@ function dg(n) {
|
|
|
15117
15137
|
}
|
|
15118
15138
|
});
|
|
15119
15139
|
}
|
|
15120
|
-
function
|
|
15140
|
+
function hg(n) {
|
|
15121
15141
|
return new Q({
|
|
15122
15142
|
key: new ie("handleClickLink"),
|
|
15123
15143
|
props: {
|
|
@@ -15131,7 +15151,7 @@ function ug(n) {
|
|
|
15131
15151
|
}
|
|
15132
15152
|
});
|
|
15133
15153
|
}
|
|
15134
|
-
function
|
|
15154
|
+
function fg(n) {
|
|
15135
15155
|
return new Q({
|
|
15136
15156
|
key: new ie("handlePasteLink"),
|
|
15137
15157
|
props: {
|
|
@@ -15151,7 +15171,7 @@ function hg(n) {
|
|
|
15151
15171
|
}
|
|
15152
15172
|
});
|
|
15153
15173
|
}
|
|
15154
|
-
const
|
|
15174
|
+
const pg = xe.create({
|
|
15155
15175
|
name: "link",
|
|
15156
15176
|
priority: 1e3,
|
|
15157
15177
|
keepOnSplit: !1,
|
|
@@ -15165,7 +15185,7 @@ const fg = xe.create({
|
|
|
15165
15185
|
});
|
|
15166
15186
|
},
|
|
15167
15187
|
onDestroy() {
|
|
15168
|
-
|
|
15188
|
+
ag();
|
|
15169
15189
|
},
|
|
15170
15190
|
inclusive() {
|
|
15171
15191
|
return this.options.autolink;
|
|
@@ -15256,17 +15276,17 @@ const fg = xe.create({
|
|
|
15256
15276
|
},
|
|
15257
15277
|
addProseMirrorPlugins() {
|
|
15258
15278
|
const n = [];
|
|
15259
|
-
return this.options.autolink && n.push(
|
|
15279
|
+
return this.options.autolink && n.push(ug({
|
|
15260
15280
|
type: this.type,
|
|
15261
15281
|
validate: this.options.validate
|
|
15262
|
-
})), this.options.openOnClick && n.push(
|
|
15282
|
+
})), this.options.openOnClick && n.push(hg({
|
|
15263
15283
|
type: this.type
|
|
15264
|
-
})), this.options.linkOnPaste && n.push(
|
|
15284
|
+
})), this.options.linkOnPaste && n.push(fg({
|
|
15265
15285
|
editor: this.editor,
|
|
15266
15286
|
type: this.type
|
|
15267
15287
|
})), n;
|
|
15268
15288
|
}
|
|
15269
|
-
}),
|
|
15289
|
+
}), mg = ne.create({
|
|
15270
15290
|
name: "listItem",
|
|
15271
15291
|
addOptions() {
|
|
15272
15292
|
return {
|
|
@@ -15294,7 +15314,7 @@ const fg = xe.create({
|
|
|
15294
15314
|
"Shift-Tab": () => this.editor.commands.liftListItem(this.name)
|
|
15295
15315
|
};
|
|
15296
15316
|
}
|
|
15297
|
-
}),
|
|
15317
|
+
}), gg = ne.create({
|
|
15298
15318
|
name: "listItem",
|
|
15299
15319
|
addOptions() {
|
|
15300
15320
|
return {
|
|
@@ -15348,7 +15368,7 @@ const fg = xe.create({
|
|
|
15348
15368
|
}
|
|
15349
15369
|
};
|
|
15350
15370
|
}
|
|
15351
|
-
}), Yo = /^(\d+)\.\s$/,
|
|
15371
|
+
}), Yo = /^(\d+)\.\s$/, yg = ne.create({
|
|
15352
15372
|
name: "orderedList",
|
|
15353
15373
|
addOptions() {
|
|
15354
15374
|
return {
|
|
@@ -15383,7 +15403,7 @@ const fg = xe.create({
|
|
|
15383
15403
|
},
|
|
15384
15404
|
addCommands() {
|
|
15385
15405
|
return {
|
|
15386
|
-
toggleOrderedList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(
|
|
15406
|
+
toggleOrderedList: () => ({ commands: n, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(gg.name, this.editor.getAttributes(Go.name)).run() : n.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
|
|
15387
15407
|
};
|
|
15388
15408
|
},
|
|
15389
15409
|
addKeyboardShortcuts() {
|
|
@@ -15410,7 +15430,7 @@ const fg = xe.create({
|
|
|
15410
15430
|
n
|
|
15411
15431
|
];
|
|
15412
15432
|
}
|
|
15413
|
-
}),
|
|
15433
|
+
}), bg = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/, kg = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g, Sg = xe.create({
|
|
15414
15434
|
name: "strike",
|
|
15415
15435
|
addOptions() {
|
|
15416
15436
|
return {
|
|
@@ -15452,7 +15472,7 @@ const fg = xe.create({
|
|
|
15452
15472
|
addInputRules() {
|
|
15453
15473
|
return [
|
|
15454
15474
|
mn({
|
|
15455
|
-
find:
|
|
15475
|
+
find: bg,
|
|
15456
15476
|
type: this.type
|
|
15457
15477
|
})
|
|
15458
15478
|
];
|
|
@@ -15460,12 +15480,12 @@ const fg = xe.create({
|
|
|
15460
15480
|
addPasteRules() {
|
|
15461
15481
|
return [
|
|
15462
15482
|
Ht({
|
|
15463
|
-
find:
|
|
15483
|
+
find: kg,
|
|
15464
15484
|
type: this.type
|
|
15465
15485
|
})
|
|
15466
15486
|
];
|
|
15467
15487
|
}
|
|
15468
|
-
}),
|
|
15488
|
+
}), xg = xe.create({
|
|
15469
15489
|
name: "underline",
|
|
15470
15490
|
addOptions() {
|
|
15471
15491
|
return {
|
|
@@ -15500,10 +15520,10 @@ const fg = xe.create({
|
|
|
15500
15520
|
"Mod-U": () => this.editor.commands.toggleUnderline()
|
|
15501
15521
|
};
|
|
15502
15522
|
}
|
|
15503
|
-
}),
|
|
15523
|
+
}), Cg = ne.create({
|
|
15504
15524
|
name: "text",
|
|
15505
15525
|
group: "inline"
|
|
15506
|
-
}),
|
|
15526
|
+
}), Eg = ge.create({
|
|
15507
15527
|
name: "textAlign",
|
|
15508
15528
|
addOptions() {
|
|
15509
15529
|
return {
|
|
@@ -15540,7 +15560,7 @@ const fg = xe.create({
|
|
|
15540
15560
|
"Mod-Shift-j": () => this.editor.commands.setTextAlign("justify")
|
|
15541
15561
|
};
|
|
15542
15562
|
}
|
|
15543
|
-
}),
|
|
15563
|
+
}), Tg = {
|
|
15544
15564
|
name: "EmojiComponent",
|
|
15545
15565
|
components: {
|
|
15546
15566
|
NodeViewWrapper: Fa,
|
|
@@ -15548,7 +15568,7 @@ const fg = xe.create({
|
|
|
15548
15568
|
},
|
|
15549
15569
|
props: za
|
|
15550
15570
|
};
|
|
15551
|
-
function
|
|
15571
|
+
function Mg(n, e, t, r, i, s) {
|
|
15552
15572
|
const o = $("dt-emoji"), l = $("node-view-wrapper");
|
|
15553
15573
|
return O(), z(l, { class: "d-d-inline-block d-va-bottom d-lh0" }, {
|
|
15554
15574
|
default: q(() => [
|
|
@@ -15560,10 +15580,10 @@ function Tg(n, e, t, r, i, s) {
|
|
|
15560
15580
|
_: 1
|
|
15561
15581
|
});
|
|
15562
15582
|
}
|
|
15563
|
-
const
|
|
15564
|
-
function
|
|
15583
|
+
const wg = /* @__PURE__ */ de(Tg, [["render", Mg]]);
|
|
15584
|
+
function Og(n) {
|
|
15565
15585
|
var e;
|
|
15566
|
-
const { char: t, allowSpaces: r, allowedPrefixes: i, startOfLine: s, $position: o } = n, l =
|
|
15586
|
+
const { char: t, allowSpaces: r, allowedPrefixes: i, startOfLine: s, $position: o } = n, l = km(t), a = new RegExp(`\\s${l}$`), c = s ? "^" : "", d = r ? new RegExp(`${c}${l}.*?(?=\\s${l}|$)`, "gm") : new RegExp(`${c}(?:^)?${l}[^\\s${l}]*`, "gm"), u = ((e = o.nodeBefore) === null || e === void 0 ? void 0 : e.isText) && o.nodeBefore.text;
|
|
15567
15587
|
if (!u)
|
|
15568
15588
|
return null;
|
|
15569
15589
|
const h = o.pos - u.length, f = Array.from(u.matchAll(d)).pop();
|
|
@@ -15583,8 +15603,8 @@ function wg(n) {
|
|
|
15583
15603
|
text: f[0]
|
|
15584
15604
|
} : null;
|
|
15585
15605
|
}
|
|
15586
|
-
const
|
|
15587
|
-
function Wa({ pluginKey: n =
|
|
15606
|
+
const vg = new ie("suggestion");
|
|
15607
|
+
function Wa({ pluginKey: n = vg, editor: e, char: t = "@", allowSpaces: r = !1, allowedPrefixes: i = [" "], startOfLine: s = !1, decorationTag: o = "span", decorationClass: l = "suggestion", command: a = () => null, items: c = () => [], render: d = () => ({}), allow: u = () => !0 }) {
|
|
15588
15608
|
let h;
|
|
15589
15609
|
const f = d == null ? void 0 : d(), p = new Q({
|
|
15590
15610
|
key: n,
|
|
@@ -15647,7 +15667,7 @@ function Wa({ pluginKey: n = Og, editor: e, char: t = "@", allowSpaces: r = !1,
|
|
|
15647
15667
|
const { isEditable: T } = e, { composing: R } = e.view, { selection: P } = m, { empty: E, from: L } = P, I = { ...g };
|
|
15648
15668
|
if (I.composing = R, T && (E || e.view.composing)) {
|
|
15649
15669
|
(L < g.range.from || L > g.range.to) && !R && !g.composing && (I.active = !1);
|
|
15650
|
-
const M =
|
|
15670
|
+
const M = Og({
|
|
15651
15671
|
char: t,
|
|
15652
15672
|
allowSpaces: r,
|
|
15653
15673
|
allowedPrefixes: i,
|
|
@@ -15682,10 +15702,10 @@ function Wa({ pluginKey: n = Og, editor: e, char: t = "@", allowSpaces: r = !1,
|
|
|
15682
15702
|
});
|
|
15683
15703
|
return p;
|
|
15684
15704
|
}
|
|
15685
|
-
const
|
|
15705
|
+
const Ag = {
|
|
15686
15706
|
name: "SuggestionList",
|
|
15687
15707
|
components: {
|
|
15688
|
-
DtListItem:
|
|
15708
|
+
DtListItem: ld
|
|
15689
15709
|
},
|
|
15690
15710
|
props: {
|
|
15691
15711
|
items: {
|
|
@@ -15747,14 +15767,14 @@ const vg = {
|
|
|
15747
15767
|
}
|
|
15748
15768
|
}
|
|
15749
15769
|
}
|
|
15750
|
-
},
|
|
15770
|
+
}, Ng = { class: "d-popover__dialog" }, Dg = {
|
|
15751
15771
|
ref: "suggestionList",
|
|
15752
15772
|
class: "dt-suggestion-list"
|
|
15753
15773
|
};
|
|
15754
|
-
function
|
|
15774
|
+
function Ig(n, e, t, r, i, s) {
|
|
15755
15775
|
const o = $("dt-list-item");
|
|
15756
|
-
return O(), j("div",
|
|
15757
|
-
yc(ht("ul",
|
|
15776
|
+
return O(), j("div", Ng, [
|
|
15777
|
+
yc(ht("ul", Dg, [
|
|
15758
15778
|
(O(!0), j(bc, null, il(t.items, (l, a) => (O(), z(o, {
|
|
15759
15779
|
key: l.id,
|
|
15760
15780
|
class: X([
|
|
@@ -15775,7 +15795,7 @@ function Dg(n, e, t, r, i, s) {
|
|
|
15775
15795
|
])
|
|
15776
15796
|
]);
|
|
15777
15797
|
}
|
|
15778
|
-
const Ua = /* @__PURE__ */ de(
|
|
15798
|
+
const Ua = /* @__PURE__ */ de(Ag, [["render", Ig]]), Rg = {
|
|
15779
15799
|
name: "EmojiSuggestion",
|
|
15780
15800
|
components: {
|
|
15781
15801
|
DtEmoji: tl,
|
|
@@ -15788,7 +15808,7 @@ const Ua = /* @__PURE__ */ de(vg, [["render", Dg]]), Ig = {
|
|
|
15788
15808
|
}
|
|
15789
15809
|
}
|
|
15790
15810
|
};
|
|
15791
|
-
function
|
|
15811
|
+
function Pg(n, e, t, r, i, s) {
|
|
15792
15812
|
const o = $("dt-emoji"), l = $("dt-stack");
|
|
15793
15813
|
return O(), z(l, {
|
|
15794
15814
|
direction: "row",
|
|
@@ -15804,7 +15824,7 @@ function Rg(n, e, t, r, i, s) {
|
|
|
15804
15824
|
_: 1
|
|
15805
15825
|
});
|
|
15806
15826
|
}
|
|
15807
|
-
const
|
|
15827
|
+
const Lg = /* @__PURE__ */ de(Rg, [["render", Pg]]), Bg = {
|
|
15808
15828
|
items: ({ query: n }) => n.length < 2 ? [] : Object.values(cc).filter(function(r) {
|
|
15809
15829
|
return !!r.shortname.substring(1, r.shortname.length - 1).startsWith(n.toLowerCase());
|
|
15810
15830
|
}).map((r) => ({ id: r.unicode_character, code: r.shortname })),
|
|
@@ -15828,7 +15848,7 @@ const Pg = /* @__PURE__ */ de(Ig, [["render", Rg]]), Lg = {
|
|
|
15828
15848
|
onStart: (t) => {
|
|
15829
15849
|
n = new ps(Ua, {
|
|
15830
15850
|
props: {
|
|
15831
|
-
itemComponent: wr(
|
|
15851
|
+
itemComponent: wr(Lg),
|
|
15832
15852
|
itemType: "emoji",
|
|
15833
15853
|
...t
|
|
15834
15854
|
},
|
|
@@ -15859,24 +15879,24 @@ const Pg = /* @__PURE__ */ de(Ig, [["render", Rg]]), Lg = {
|
|
|
15859
15879
|
}
|
|
15860
15880
|
};
|
|
15861
15881
|
}
|
|
15862
|
-
},
|
|
15882
|
+
}, _g = new ie("emoji"), Fg = /:\w+:$/, zg = /:\w+:/g, Hg = /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])$/, Vg = /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/g, Xo = (n) => {
|
|
15863
15883
|
if (n && nl(n[0]))
|
|
15864
15884
|
return {
|
|
15865
15885
|
index: n.index,
|
|
15866
15886
|
text: n[0],
|
|
15867
15887
|
match: n
|
|
15868
15888
|
};
|
|
15869
|
-
},
|
|
15889
|
+
}, $g = (n) => [...n.matchAll(zg)].filter((t) => nl(t[0])).map((t) => ({
|
|
15870
15890
|
index: t.index,
|
|
15871
15891
|
text: t[0],
|
|
15872
15892
|
match: t
|
|
15873
|
-
})),
|
|
15893
|
+
})), jg = ne.create({
|
|
15874
15894
|
addOptions() {
|
|
15875
15895
|
return {
|
|
15876
15896
|
HTMLAttributes: {},
|
|
15877
15897
|
suggestion: {
|
|
15878
15898
|
char: ":",
|
|
15879
|
-
pluginKey:
|
|
15899
|
+
pluginKey: _g
|
|
15880
15900
|
}
|
|
15881
15901
|
};
|
|
15882
15902
|
},
|
|
@@ -15885,7 +15905,7 @@ const Pg = /* @__PURE__ */ de(Ig, [["render", Rg]]), Lg = {
|
|
|
15885
15905
|
inline: !0,
|
|
15886
15906
|
selectable: !0,
|
|
15887
15907
|
addNodeView() {
|
|
15888
|
-
return Ha(
|
|
15908
|
+
return Ha(wg);
|
|
15889
15909
|
},
|
|
15890
15910
|
addAttributes() {
|
|
15891
15911
|
return {
|
|
@@ -15915,7 +15935,7 @@ const Pg = /* @__PURE__ */ de(Ig, [["render", Rg]]), Lg = {
|
|
|
15915
15935
|
// shortcode input
|
|
15916
15936
|
Po({
|
|
15917
15937
|
find: (n) => {
|
|
15918
|
-
const e = n.match(
|
|
15938
|
+
const e = n.match(Fg);
|
|
15919
15939
|
return Xo(e);
|
|
15920
15940
|
},
|
|
15921
15941
|
type: this.type,
|
|
@@ -15927,7 +15947,7 @@ const Pg = /* @__PURE__ */ de(Ig, [["render", Rg]]), Lg = {
|
|
|
15927
15947
|
}),
|
|
15928
15948
|
Po({
|
|
15929
15949
|
find: (n) => {
|
|
15930
|
-
const e = n.match(
|
|
15950
|
+
const e = n.match(Hg);
|
|
15931
15951
|
return Xo(e);
|
|
15932
15952
|
},
|
|
15933
15953
|
type: this.type,
|
|
@@ -15944,7 +15964,7 @@ const Pg = /* @__PURE__ */ de(Ig, [["render", Rg]]), Lg = {
|
|
|
15944
15964
|
addPasteRules() {
|
|
15945
15965
|
return [
|
|
15946
15966
|
Bo({
|
|
15947
|
-
find:
|
|
15967
|
+
find: $g,
|
|
15948
15968
|
type: this.type,
|
|
15949
15969
|
getAttributes(n) {
|
|
15950
15970
|
return {
|
|
@@ -15953,7 +15973,7 @@ const Pg = /* @__PURE__ */ de(Ig, [["render", Rg]]), Lg = {
|
|
|
15953
15973
|
}
|
|
15954
15974
|
}),
|
|
15955
15975
|
Bo({
|
|
15956
|
-
find:
|
|
15976
|
+
find: Vg,
|
|
15957
15977
|
type: this.type,
|
|
15958
15978
|
getAttributes(n) {
|
|
15959
15979
|
return {
|
|
@@ -15968,12 +15988,12 @@ const Pg = /* @__PURE__ */ de(Ig, [["render", Rg]]), Lg = {
|
|
|
15968
15988
|
Wa({
|
|
15969
15989
|
editor: this.editor,
|
|
15970
15990
|
...this.options.suggestion,
|
|
15971
|
-
...
|
|
15991
|
+
...Bg
|
|
15972
15992
|
})
|
|
15973
15993
|
];
|
|
15974
15994
|
}
|
|
15975
15995
|
});
|
|
15976
|
-
function
|
|
15996
|
+
function qg(n, e, t = () => !0) {
|
|
15977
15997
|
const r = [];
|
|
15978
15998
|
e.lastIndex = 0;
|
|
15979
15999
|
let i;
|
|
@@ -15981,10 +16001,10 @@ function jg(n, e, t = () => !0) {
|
|
|
15981
16001
|
t(n, i) && r.push(i);
|
|
15982
16002
|
return r;
|
|
15983
16003
|
}
|
|
15984
|
-
function
|
|
16004
|
+
function Kg(n, e) {
|
|
15985
16005
|
return !["#", "@"].includes(n.charAt(e.index)) && !["#", "@"].includes(n.charAt(e.index - 1));
|
|
15986
16006
|
}
|
|
15987
|
-
function
|
|
16007
|
+
function Wg(n) {
|
|
15988
16008
|
const e = new RegExp(
|
|
15989
16009
|
"(?:" + [
|
|
15990
16010
|
`[!?.,:;'"]`,
|
|
@@ -15994,7 +16014,7 @@ function Kg(n) {
|
|
|
15994
16014
|
);
|
|
15995
16015
|
return n.replace(e, "");
|
|
15996
16016
|
}
|
|
15997
|
-
function
|
|
16017
|
+
function Ug(n, e) {
|
|
15998
16018
|
const t = n.slice(0, e + 1).search(/\S+\s*$/), r = n.slice(e).search(/\s/);
|
|
15999
16019
|
if (r < 0) {
|
|
16000
16020
|
const i = n.slice(t);
|
|
@@ -16011,13 +16031,13 @@ function Wg(n, e) {
|
|
|
16011
16031
|
};
|
|
16012
16032
|
}
|
|
16013
16033
|
function ji(n, e, t, r) {
|
|
16014
|
-
const i =
|
|
16034
|
+
const i = Ug(n, e);
|
|
16015
16035
|
if (r.lastIndex = 0, !r.test(i.text))
|
|
16016
16036
|
return i;
|
|
16017
16037
|
const s = t === "left" ? i.from - 1 : i.to + 1;
|
|
16018
16038
|
return s <= 0 || s >= n.length || s === e ? i : ji(n, s, t, r);
|
|
16019
16039
|
}
|
|
16020
|
-
function
|
|
16040
|
+
function Jg(n, e, t, r) {
|
|
16021
16041
|
const i = Math.max(n.from - 1, 0), s = Math.min(n.to + 1, e.content.size), o = Hr(i, s, e);
|
|
16022
16042
|
for (const l of o)
|
|
16023
16043
|
l.mark.type === r && t.removeMark(l.from, l.to, r);
|
|
@@ -16039,12 +16059,12 @@ function Zo(n, e, t, r, i, s) {
|
|
|
16039
16059
|
"right",
|
|
16040
16060
|
Qo
|
|
16041
16061
|
), d = n.slice(a.from, c.to);
|
|
16042
|
-
|
|
16043
|
-
const f =
|
|
16062
|
+
qg(d, ic, Kg).forEach((h) => {
|
|
16063
|
+
const f = Wg(h[0]), p = e + a.from + h.index + 1, m = p + f.length;
|
|
16044
16064
|
i.addMark(p, m, s.create());
|
|
16045
16065
|
});
|
|
16046
16066
|
}
|
|
16047
|
-
function
|
|
16067
|
+
function Gg(n) {
|
|
16048
16068
|
let e = !1;
|
|
16049
16069
|
return new Q({
|
|
16050
16070
|
key: new ie("autolink"),
|
|
@@ -16059,7 +16079,7 @@ function Jg(n) {
|
|
|
16059
16079
|
[...t]
|
|
16060
16080
|
);
|
|
16061
16081
|
return Pa(a).forEach(({ oldRange: d, newRange: u }) => {
|
|
16062
|
-
|
|
16082
|
+
Jg(u, i.doc, o, n.type), Ia(
|
|
16063
16083
|
i.doc,
|
|
16064
16084
|
u,
|
|
16065
16085
|
(f) => f.isTextblock
|
|
@@ -16077,10 +16097,10 @@ function Jg(n) {
|
|
|
16077
16097
|
}
|
|
16078
16098
|
});
|
|
16079
16099
|
}
|
|
16080
|
-
const
|
|
16100
|
+
const Yg = {
|
|
16081
16101
|
class: "d-link d-c-text d-d-inline-block",
|
|
16082
16102
|
rel: "noopener noreferrer nofollow"
|
|
16083
|
-
},
|
|
16103
|
+
}, Xg = xe.create({
|
|
16084
16104
|
name: "Link",
|
|
16085
16105
|
renderHTML({ HTMLAttributes: n }) {
|
|
16086
16106
|
return [
|
|
@@ -16088,7 +16108,7 @@ const Gg = {
|
|
|
16088
16108
|
F(
|
|
16089
16109
|
this.options.HTMLAttributes,
|
|
16090
16110
|
n,
|
|
16091
|
-
|
|
16111
|
+
Yg
|
|
16092
16112
|
),
|
|
16093
16113
|
0
|
|
16094
16114
|
];
|
|
@@ -16098,10 +16118,10 @@ const Gg = {
|
|
|
16098
16118
|
},
|
|
16099
16119
|
addProseMirrorPlugins() {
|
|
16100
16120
|
return [
|
|
16101
|
-
|
|
16121
|
+
Gg({ type: this.type })
|
|
16102
16122
|
];
|
|
16103
16123
|
}
|
|
16104
|
-
}),
|
|
16124
|
+
}), Qg = new ie("mention"), Zg = ne.create({
|
|
16105
16125
|
name: "mention",
|
|
16106
16126
|
addOptions() {
|
|
16107
16127
|
return {
|
|
@@ -16112,7 +16132,7 @@ const Gg = {
|
|
|
16112
16132
|
},
|
|
16113
16133
|
suggestion: {
|
|
16114
16134
|
char: "@",
|
|
16115
|
-
pluginKey:
|
|
16135
|
+
pluginKey: Qg,
|
|
16116
16136
|
command: ({ editor: n, range: e, props: t }) => {
|
|
16117
16137
|
var r, i;
|
|
16118
16138
|
const s = n.view.state.selection.$to.nodeAfter;
|
|
@@ -16199,7 +16219,7 @@ const Gg = {
|
|
|
16199
16219
|
})
|
|
16200
16220
|
];
|
|
16201
16221
|
}
|
|
16202
|
-
}),
|
|
16222
|
+
}), ey = {
|
|
16203
16223
|
name: "MentionComponent",
|
|
16204
16224
|
components: {
|
|
16205
16225
|
NodeViewWrapper: Fa,
|
|
@@ -16212,7 +16232,7 @@ const Gg = {
|
|
|
16212
16232
|
}
|
|
16213
16233
|
}
|
|
16214
16234
|
};
|
|
16215
|
-
function
|
|
16235
|
+
function ty(n, e, t, r, i, s) {
|
|
16216
16236
|
const o = $("dt-link"), l = $("node-view-wrapper");
|
|
16217
16237
|
return O(), z(l, { class: "d-d-inline-block" }, {
|
|
16218
16238
|
default: q(() => [
|
|
@@ -16230,9 +16250,9 @@ function ey(n, e, t, r, i, s) {
|
|
|
16230
16250
|
_: 1
|
|
16231
16251
|
});
|
|
16232
16252
|
}
|
|
16233
|
-
const
|
|
16253
|
+
const ny = /* @__PURE__ */ de(ey, [["render", ty]]), ry = Zg.extend({
|
|
16234
16254
|
addNodeView() {
|
|
16235
|
-
return Ha(
|
|
16255
|
+
return Ha(ny);
|
|
16236
16256
|
},
|
|
16237
16257
|
parseHTML() {
|
|
16238
16258
|
return [
|
|
@@ -16260,22 +16280,22 @@ const ty = /* @__PURE__ */ de(Zg, [["render", ey]]), ny = Qg.extend({
|
|
|
16260
16280
|
renderHTML({ HTMLAttributes: n }) {
|
|
16261
16281
|
return ["mention-component", F(this.options.HTMLAttributes, n), 0];
|
|
16262
16282
|
}
|
|
16263
|
-
}),
|
|
16283
|
+
}), iy = [
|
|
16264
16284
|
"text",
|
|
16265
16285
|
"json",
|
|
16266
16286
|
"html"
|
|
16267
|
-
],
|
|
16287
|
+
], sy = [
|
|
16268
16288
|
"start",
|
|
16269
16289
|
"end",
|
|
16270
16290
|
"all"
|
|
16271
|
-
],
|
|
16291
|
+
], oy = [
|
|
16272
16292
|
"https",
|
|
16273
16293
|
"http",
|
|
16274
16294
|
"ftp",
|
|
16275
16295
|
"ftps",
|
|
16276
16296
|
"sftp",
|
|
16277
16297
|
"mailto"
|
|
16278
|
-
],
|
|
16298
|
+
], ly = {
|
|
16279
16299
|
name: "MentionSuggestion",
|
|
16280
16300
|
components: {
|
|
16281
16301
|
DtAvatar: Fc,
|
|
@@ -16296,7 +16316,7 @@ const ty = /* @__PURE__ */ de(Zg, [["render", ey]]), ny = Qg.extend({
|
|
|
16296
16316
|
}
|
|
16297
16317
|
}
|
|
16298
16318
|
};
|
|
16299
|
-
function
|
|
16319
|
+
function ay(n, e, t, r, i, s) {
|
|
16300
16320
|
const o = $("dt-avatar"), l = $("dt-stack");
|
|
16301
16321
|
return O(), z(l, {
|
|
16302
16322
|
direction: "row",
|
|
@@ -16313,7 +16333,7 @@ function ly(n, e, t, r, i, s) {
|
|
|
16313
16333
|
_: 1
|
|
16314
16334
|
});
|
|
16315
16335
|
}
|
|
16316
|
-
const
|
|
16336
|
+
const cy = /* @__PURE__ */ de(ly, [["render", ay]]), dy = {
|
|
16317
16337
|
// This function comes from the user and passed to the editor directly.
|
|
16318
16338
|
// This will also activate the mention plugin on the editor
|
|
16319
16339
|
// items: ({ query }) => { return [] },
|
|
@@ -16323,7 +16343,7 @@ const ay = /* @__PURE__ */ de(oy, [["render", ly]]), cy = {
|
|
|
16323
16343
|
onStart: (t) => {
|
|
16324
16344
|
n = new ps(Ua, {
|
|
16325
16345
|
props: {
|
|
16326
|
-
itemComponent: wr(
|
|
16346
|
+
itemComponent: wr(cy),
|
|
16327
16347
|
itemType: "mention",
|
|
16328
16348
|
...t
|
|
16329
16349
|
},
|
|
@@ -16352,10 +16372,10 @@ const ay = /* @__PURE__ */ de(oy, [["render", ly]]), cy = {
|
|
|
16352
16372
|
}
|
|
16353
16373
|
};
|
|
16354
16374
|
}
|
|
16355
|
-
},
|
|
16375
|
+
}, uy = {
|
|
16356
16376
|
name: "DtRichTextEditor",
|
|
16357
16377
|
components: {
|
|
16358
|
-
EditorContent:
|
|
16378
|
+
EditorContent: Em
|
|
16359
16379
|
},
|
|
16360
16380
|
props: {
|
|
16361
16381
|
/**
|
|
@@ -16411,7 +16431,7 @@ const ay = /* @__PURE__ */ de(oy, [["render", ly]]), cy = {
|
|
|
16411
16431
|
type: [Boolean, String, Number],
|
|
16412
16432
|
default: !1,
|
|
16413
16433
|
validator(n) {
|
|
16414
|
-
return typeof n == "string" ?
|
|
16434
|
+
return typeof n == "string" ? sy.includes(n) : !0;
|
|
16415
16435
|
}
|
|
16416
16436
|
},
|
|
16417
16437
|
/**
|
|
@@ -16424,7 +16444,7 @@ const ay = /* @__PURE__ */ de(oy, [["render", ly]]), cy = {
|
|
|
16424
16444
|
type: String,
|
|
16425
16445
|
default: "text",
|
|
16426
16446
|
validator(n) {
|
|
16427
|
-
return
|
|
16447
|
+
return iy.includes(n);
|
|
16428
16448
|
}
|
|
16429
16449
|
},
|
|
16430
16450
|
/**
|
|
@@ -16492,21 +16512,21 @@ const ay = /* @__PURE__ */ de(oy, [["render", ly]]), cy = {
|
|
|
16492
16512
|
computed: {
|
|
16493
16513
|
extensions() {
|
|
16494
16514
|
const n = [
|
|
16495
|
-
|
|
16496
|
-
|
|
16497
|
-
|
|
16498
|
-
|
|
16499
|
-
|
|
16500
|
-
|
|
16501
|
-
|
|
16502
|
-
|
|
16503
|
-
|
|
16504
|
-
|
|
16515
|
+
wm,
|
|
16516
|
+
Fm,
|
|
16517
|
+
Hm,
|
|
16518
|
+
Nm,
|
|
16519
|
+
Km,
|
|
16520
|
+
mg,
|
|
16521
|
+
Im,
|
|
16522
|
+
Sg,
|
|
16523
|
+
Cg,
|
|
16524
|
+
xg
|
|
16505
16525
|
];
|
|
16506
|
-
if (this.link && n.push(this.getExtension(
|
|
16507
|
-
|
|
16526
|
+
if (this.link && n.push(this.getExtension(Xg, this.link)), n.push(
|
|
16527
|
+
Rm.configure({ placeholder: this.placeholder })
|
|
16508
16528
|
), this.allowLineBreaks || n.push(
|
|
16509
|
-
|
|
16529
|
+
Dm.extend({
|
|
16510
16530
|
addKeyboardShortcuts() {
|
|
16511
16531
|
return {
|
|
16512
16532
|
Enter: () => !0,
|
|
@@ -16519,21 +16539,21 @@ const ay = /* @__PURE__ */ de(oy, [["render", ly]]), cy = {
|
|
|
16519
16539
|
};
|
|
16520
16540
|
}
|
|
16521
16541
|
})
|
|
16522
|
-
), n.push(
|
|
16542
|
+
), n.push(pg.extend({ inclusive: !1 }).configure({
|
|
16523
16543
|
autolink: !0,
|
|
16524
|
-
protocols:
|
|
16544
|
+
protocols: oy
|
|
16525
16545
|
})), this.mentionSuggestion) {
|
|
16526
|
-
const e = { ...this.mentionSuggestion, ...
|
|
16527
|
-
n.push(
|
|
16546
|
+
const e = { ...this.mentionSuggestion, ...dy };
|
|
16547
|
+
n.push(ry.configure({ suggestion: e }));
|
|
16528
16548
|
}
|
|
16529
|
-
return n.push(
|
|
16549
|
+
return n.push(jg), n.push(Eg.configure({
|
|
16530
16550
|
types: ["paragraph"],
|
|
16531
16551
|
defaultAlignment: "left"
|
|
16532
|
-
})), n.push(
|
|
16552
|
+
})), n.push(Am.configure({
|
|
16533
16553
|
HTMLAttributes: {
|
|
16534
16554
|
class: "dt-rich-text-editor--code-block"
|
|
16535
16555
|
}
|
|
16536
|
-
})), n.push(
|
|
16556
|
+
})), n.push(yg.configure({
|
|
16537
16557
|
itemTypeName: "listItem"
|
|
16538
16558
|
})), n;
|
|
16539
16559
|
},
|
|
@@ -16577,7 +16597,7 @@ const ay = /* @__PURE__ */ de(oy, [["render", ly]]), cy = {
|
|
|
16577
16597
|
},
|
|
16578
16598
|
methods: {
|
|
16579
16599
|
createEditor() {
|
|
16580
|
-
this.editor = new
|
|
16600
|
+
this.editor = new Cm({
|
|
16581
16601
|
autofocus: this.autoFocus,
|
|
16582
16602
|
content: this.modelValue,
|
|
16583
16603
|
editable: this.editable,
|
|
@@ -16630,33 +16650,33 @@ const ay = /* @__PURE__ */ de(oy, [["render", ly]]), cy = {
|
|
|
16630
16650
|
}
|
|
16631
16651
|
}
|
|
16632
16652
|
};
|
|
16633
|
-
function
|
|
16653
|
+
function hy(n, e, t, r, i, s) {
|
|
16634
16654
|
const o = $("editor-content");
|
|
16635
16655
|
return O(), z(o, {
|
|
16636
16656
|
editor: i.editor,
|
|
16637
16657
|
"data-qa": "dt-rich-text-editor"
|
|
16638
16658
|
}, null, 8, ["editor"]);
|
|
16639
16659
|
}
|
|
16640
|
-
const
|
|
16660
|
+
const ky = /* @__PURE__ */ de(uy, [["render", hy]]);
|
|
16641
16661
|
export {
|
|
16642
16662
|
jr as A,
|
|
16643
16663
|
St as B,
|
|
16644
16664
|
cl as C,
|
|
16645
|
-
|
|
16665
|
+
yy as D,
|
|
16646
16666
|
xn as L,
|
|
16647
16667
|
Gc as M,
|
|
16648
|
-
|
|
16649
|
-
|
|
16668
|
+
hd as P,
|
|
16669
|
+
sy as R,
|
|
16650
16670
|
Wc as S,
|
|
16651
|
-
|
|
16652
|
-
|
|
16671
|
+
ky as a,
|
|
16672
|
+
iy as b,
|
|
16653
16673
|
jc as c,
|
|
16654
16674
|
$c as d,
|
|
16655
|
-
|
|
16675
|
+
ld as e,
|
|
16656
16676
|
Ui as f,
|
|
16657
16677
|
vs as g,
|
|
16658
16678
|
dl as h,
|
|
16659
|
-
|
|
16679
|
+
dd as i,
|
|
16660
16680
|
Fc as j,
|
|
16661
16681
|
Os as k,
|
|
16662
16682
|
wc as l,
|
|
@@ -16666,11 +16686,11 @@ export {
|
|
|
16666
16686
|
Ac as p,
|
|
16667
16687
|
ws as q,
|
|
16668
16688
|
qr as r,
|
|
16669
|
-
|
|
16670
|
-
|
|
16671
|
-
|
|
16672
|
-
|
|
16673
|
-
|
|
16689
|
+
ad as s,
|
|
16690
|
+
cd as t,
|
|
16691
|
+
ud as u,
|
|
16692
|
+
fd as v,
|
|
16693
|
+
gy as w,
|
|
16674
16694
|
Mc as x,
|
|
16675
16695
|
Ut as y,
|
|
16676
16696
|
Sc as z
|