@tempots/beatui 0.53.0 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{2019-BiSy3dQP.cjs → 2019-5RIscTOv.cjs} +1 -1
- package/dist/{2019-Djx2f_nO.js → 2019-i1LHsYdK.js} +2 -2
- package/dist/{2020-BgJxYgaO.cjs → 2020-DeCezjWf.cjs} +1 -1
- package/dist/{2020-C1wOj1GM.js → 2020-S7qY95wq.js} +2 -2
- package/dist/{ar-BEbbig_x.cjs → ar-BqnDsD9v.cjs} +1 -1
- package/dist/{ar-Djuleurf.js → ar-DrBp_VwJ.js} +7 -12
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +353 -360
- package/dist/{de-E8u7Hbc0.js → de-B5oZoraI.js} +5 -10
- package/dist/{de-Br3MCGtv.cjs → de-C_N0wtxQ.cjs} +1 -1
- package/dist/{es-BN0iaBgJ.js → es-DRc5dc_G.js} +1 -6
- package/dist/{es-CAwGEj_N.cjs → es-JnLMDtzg.cjs} +1 -1
- package/dist/{fa-3Qfo8ZXh.js → fa-B0VDVs5B.js} +6 -11
- package/dist/{fa-CEz8tGnY.cjs → fa-BC16IdRL.cjs} +1 -1
- package/dist/{fr-Dbn62iEL.cjs → fr-BupZ6YnU.cjs} +1 -1
- package/dist/{fr-D1ndk0A5.js → fr-DXlfWwI6.js} +8 -13
- package/dist/{he-CIV7rntE.js → he-BX-Az8As.js} +8 -13
- package/dist/{he-OtaTg9wg.cjs → he-C-aQ2yoO.cjs} +1 -1
- package/dist/{hi-CnbarThz.cjs → hi-L3y3Aedb.cjs} +1 -1
- package/dist/{hi-tzWREPMb.js → hi-w4uL7LN1.js} +8 -13
- package/dist/{index-nRXzduHm.cjs → index-B7gVxeO9.cjs} +1 -1
- package/dist/{index-CBT2SLat.js → index-BI5w0jSz.js} +223 -224
- package/dist/{index-B9y4N11q.js → index-BnQvOXw8.js} +3019 -3004
- package/dist/{index-ClFVnBUS.cjs → index-Bv2gn_kV.cjs} +3 -3
- package/dist/{index-BjQW8AsK.cjs → index-CFOxIBGJ.cjs} +12 -12
- package/dist/{index-KPHFBjQB.cjs → index-CKyH3jwP.cjs} +1 -1
- package/dist/{index-TiMfhF1U.cjs → index-C_71zSeN.cjs} +1 -1
- package/dist/index-CkNcU-jd.cjs +8 -0
- package/dist/{index-qWS4IYZX.js → index-CyoxPiTg.js} +1 -1
- package/dist/{index-UMbs0jPr.js → index-DKwuTFYj.js} +377 -378
- package/dist/{index-DDhLWdaz.js → index-DNUXf4K4.js} +1 -1
- package/dist/{index-CAeOFdez.js → index-DjShJtXp.js} +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +2413 -2522
- package/dist/{it-1Hy_Ay2j.js → it-BCKQ5Tu8.js} +6 -11
- package/dist/{it-FOaX_rku.cjs → it-CnHaoq-X.cjs} +1 -1
- package/dist/{ja-C7_PK2VE.js → ja-DC47Nkza.js} +13 -18
- package/dist/{ja-DW4_3EWp.cjs → ja-DpDF4IgX.cjs} +1 -1
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +1 -1
- package/dist/{ko-C-jXKweM.cjs → ko-BMmVJHzm.cjs} +1 -1
- package/dist/{ko-BDOp6dFE.js → ko-ejUHA0Sw.js} +8 -13
- package/dist/markdown/index.cjs.js +1 -1
- package/dist/markdown/index.es.js +1 -1
- package/dist/{modal-BBaPJhi-.js → modal-CKyUdeEz.js} +54 -58
- package/dist/modal-rou7pM0r.cjs +1 -0
- package/dist/{nl-CF5W2Rt4.js → nl-WjgpPUel.js} +6 -11
- package/dist/{nl-Ui8TT45t.cjs → nl-viDlnQWK.cjs} +1 -1
- package/dist/{notice-DTTyRbwh.js → notice-BS0d903Q.js} +385 -387
- package/dist/notice-MF7whf3_.cjs +2 -0
- package/dist/{pl-oLzT5Ole.js → pl-Cw4CYjK_.js} +3 -8
- package/dist/{pl-8PM7rn2L.cjs → pl-Vrfv_fGt.cjs} +1 -1
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/{pt-Bb0T3Cx1.js → pt-B4Rh_ZBF.js} +10 -15
- package/dist/{pt-kRRsG9-4.cjs → pt-CxQV74vS.cjs} +1 -1
- package/dist/{ru-C5AMF9a6.cjs → ru-BB3GRr_J.cjs} +1 -1
- package/dist/{ru-DwLv1myc.js → ru-DFHsLJ9b.js} +14 -19
- package/dist/{toolbar-D_LSJCtv.js → toolbar-D2J_NkKD.js} +1 -1
- package/dist/{toolbar-D6_MB1QI.cjs → toolbar-DRdm9W7H.cjs} +1 -1
- package/dist/{tr-DBQNjaPN.js → tr-Dbktyawl.js} +7 -12
- package/dist/{tr-BwgU2BAj.cjs → tr-mBiHcEl1.cjs} +1 -1
- package/dist/{translations-CG5-f9U8.js → translations-CaTkLRHu.js} +85 -93
- package/dist/{translations-t57jdjWu.js → translations-CpTeFtvW.js} +1 -1
- package/dist/{translations-D77sU1Wl.cjs → translations-ggnrzaCG.cjs} +1 -1
- package/dist/translations-h_OJS1Ut.cjs +1 -0
- package/dist/types/components/data/icon.d.ts +1 -1
- package/dist/types/components/data/page-drop-zone.d.ts +1 -1
- package/dist/types/components/data/unstyled-drop-zone.d.ts +1 -1
- package/dist/types/components/form/input/create-nullable-string-input.d.ts +24 -0
- package/dist/types/components/form/input/create-temporal-input.d.ts +54 -0
- package/dist/types/components/form/input/nullable-email-input.d.ts +1 -2
- package/dist/types/components/form/input/nullable-password-input.d.ts +1 -2
- package/dist/types/components/form/input/nullable-plain-date-input.d.ts +19 -3
- package/dist/types/components/form/input/nullable-plain-date-time-input.d.ts +19 -3
- package/dist/types/components/form/input/nullable-plain-time-input.d.ts +19 -3
- package/dist/types/components/form/input/nullable-plain-year-month-input.d.ts +19 -3
- package/dist/types/components/form/input/nullable-text-area.d.ts +6 -4
- package/dist/types/components/form/input/nullable-text-input.d.ts +3 -4
- package/dist/types/components/form/input/nullable-url-input.d.ts +1 -2
- package/dist/types/components/form/input/nullable-uuid-input.d.ts +1 -2
- package/dist/types/components/form/input/plain-date-input.d.ts +19 -3
- package/dist/types/components/form/input/plain-date-time-input.d.ts +19 -3
- package/dist/types/components/form/input/plain-time-input.d.ts +19 -3
- package/dist/types/components/form/input/plain-year-month-input.d.ts +19 -3
- package/dist/types/components/json-schema/controls/shared-utils.d.ts +8 -0
- package/dist/types/components/json-schema/schema-conditionals.d.ts +26 -0
- package/dist/types/components/json-schema/schema-context.d.ts +4 -107
- package/dist/types/components/json-schema/schema-merge.d.ts +9 -0
- package/dist/types/components/json-schema/schema-types.d.ts +85 -0
- package/dist/{ur-s32jv4mP.cjs → ur-CZ5sgUP1.cjs} +1 -1
- package/dist/{ur-BmK_ieRn.js → ur-Cqh7AYnd.js} +9 -14
- package/dist/utils-U1aNOU3o.cjs +1 -0
- package/dist/utils-w_vUChhV.js +2454 -0
- package/dist/{vi-DK0Fj95H.js → vi-CLBp2oaY.js} +11 -16
- package/dist/{vi-B4qRKlRd.cjs → vi-Ki_Urj_E.cjs} +1 -1
- package/dist/{zh-CUEpc9yf.cjs → zh-C78OkbS0.cjs} +1 -1
- package/dist/{zh-Db8COSme.js → zh-CT4aGkgD.js} +8 -13
- package/package.json +5 -4
- package/dist/index-ClqyVDXY.cjs +0 -8
- package/dist/modal-O7QoP7Zv.cjs +0 -1
- package/dist/notice-DLDzwKkw.cjs +0 -2
- package/dist/translations-BAk3j4bi.cjs +0 -1
- package/dist/utils-CYMdxKSM.js +0 -2516
- package/dist/utils-DI_H4_Gm.cjs +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { When as It, attr as Je, prop as zi, Fragment as Pi, OnDispose as
|
|
2
|
-
import { a as Vi, b as $i, T as rl } from "./toolbar-
|
|
3
|
-
import { I as ul, T as il, a as sl } from "./translations-
|
|
1
|
+
import { When as It, attr as Je, prop as zi, Fragment as Pi, OnDispose as br, Ensure as xr, signal as kr, computedOf as Li, Use as qi, Repeat as el, Value as j, html as fu, Task as tl, WithElement as nl } from "@tempots/dom";
|
|
2
|
+
import { a as Vi, b as $i, T as rl } from "./toolbar-D2J_NkKD.js";
|
|
3
|
+
import { I as ul, T as il, a as sl } from "./translations-CaTkLRHu.js";
|
|
4
4
|
import { L as ol } from "./link-portal-Cr2l9f3k.js";
|
|
5
5
|
import { ticker as ll } from "@tempots/ui";
|
|
6
6
|
import { T as al } from "./theme-B5pmbvQ_.js";
|
|
@@ -36,7 +36,7 @@ function Hi(t, e) {
|
|
|
36
36
|
}
|
|
37
37
|
}), s;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function on(t, e, n) {
|
|
40
40
|
return t.map(() => {
|
|
41
41
|
const r = e.value, u = r.state.schema.marks[n];
|
|
42
42
|
return Wi(r.state, u);
|
|
@@ -145,11 +145,11 @@ function pl({
|
|
|
145
145
|
l != null ? s.set(l.attrs.href ?? "") : s.set(null);
|
|
146
146
|
});
|
|
147
147
|
return Pi(
|
|
148
|
-
|
|
148
|
+
br(o),
|
|
149
149
|
$i(
|
|
150
150
|
he({
|
|
151
151
|
display: kr(!0),
|
|
152
|
-
active:
|
|
152
|
+
active: on(t, e, "link"),
|
|
153
153
|
disabled: n,
|
|
154
154
|
label: r,
|
|
155
155
|
icon: "mdi:link-variant",
|
|
@@ -216,27 +216,27 @@ function ml({
|
|
|
216
216
|
en(
|
|
217
217
|
{ display: [n.$.bold, n.$.italic, n.$.code] },
|
|
218
218
|
he({
|
|
219
|
-
active:
|
|
219
|
+
active: on(e, l, "strong"),
|
|
220
220
|
display: n.$.bold,
|
|
221
|
-
onClick: () =>
|
|
221
|
+
onClick: () => Vn(l.value, "strong"),
|
|
222
222
|
disabled: r,
|
|
223
223
|
label: o.$.bold,
|
|
224
224
|
icon: "mdi:format-bold",
|
|
225
225
|
size: u
|
|
226
226
|
}),
|
|
227
227
|
he({
|
|
228
|
-
active:
|
|
228
|
+
active: on(e, l, "em"),
|
|
229
229
|
display: n.$.italic,
|
|
230
|
-
onClick: () =>
|
|
230
|
+
onClick: () => Vn(l.value, "em"),
|
|
231
231
|
disabled: r,
|
|
232
232
|
label: o.$.italic,
|
|
233
233
|
icon: "mdi:format-italic",
|
|
234
234
|
size: u
|
|
235
235
|
}),
|
|
236
236
|
he({
|
|
237
|
-
active:
|
|
237
|
+
active: on(e, l, "code"),
|
|
238
238
|
display: n.$.code,
|
|
239
|
-
onClick: () =>
|
|
239
|
+
onClick: () => Vn(l.value, "code"),
|
|
240
240
|
disabled: r,
|
|
241
241
|
label: o.$.code,
|
|
242
242
|
icon: "mdi:code-tags",
|
|
@@ -341,16 +341,16 @@ function ml({
|
|
|
341
341
|
})
|
|
342
342
|
);
|
|
343
343
|
}
|
|
344
|
-
async function
|
|
345
|
-
const { toggleMark: n } = await Promise.resolve().then(() =>
|
|
344
|
+
async function Vn(t, e) {
|
|
345
|
+
const { toggleMark: n } = await Promise.resolve().then(() => Pn), r = t.state.schema.marks[e];
|
|
346
346
|
r != null && (n(r)(t.state, t.dispatch), t.focus());
|
|
347
347
|
}
|
|
348
348
|
async function gl(t, e) {
|
|
349
|
-
const { setBlockType: n } = await Promise.resolve().then(() =>
|
|
349
|
+
const { setBlockType: n } = await Promise.resolve().then(() => Pn), r = t.state.schema.nodes.heading;
|
|
350
350
|
r != null && (n(r, { level: e })(t.state, t.dispatch), t.focus());
|
|
351
351
|
}
|
|
352
352
|
async function du(t, e) {
|
|
353
|
-
const { wrapInList: n, liftListItem: r } = await import("./index-
|
|
353
|
+
const { wrapInList: n, liftListItem: r } = await import("./index-CyoxPiTg.js"), u = t.state.schema.nodes[e], i = t.state.schema.nodes.list_item;
|
|
354
354
|
if (u == null || i == null) return;
|
|
355
355
|
const { state: s } = t, { $from: o } = s.selection;
|
|
356
356
|
let l = null;
|
|
@@ -364,7 +364,7 @@ async function du(t, e) {
|
|
|
364
364
|
l === e ? r(i)(s, t.dispatch) : l != null ? r(i)(t.state, t.dispatch) && n(u)(t.state, t.dispatch) : n(u)(s, t.dispatch), t.focus();
|
|
365
365
|
}
|
|
366
366
|
async function bl(t) {
|
|
367
|
-
const { wrapIn: e, lift: n } = await Promise.resolve().then(() =>
|
|
367
|
+
const { wrapIn: e, lift: n } = await Promise.resolve().then(() => Pn), r = t.state.schema.nodes.blockquote;
|
|
368
368
|
if (r == null) return;
|
|
369
369
|
const { state: u } = t, { $from: i } = u.selection;
|
|
370
370
|
let s = !1;
|
|
@@ -376,7 +376,7 @@ async function bl(t) {
|
|
|
376
376
|
s ? n(u, t.dispatch) : e(r)(u, t.dispatch), t.focus();
|
|
377
377
|
}
|
|
378
378
|
async function xl(t) {
|
|
379
|
-
const { setBlockType: e } = await Promise.resolve().then(() =>
|
|
379
|
+
const { setBlockType: e } = await Promise.resolve().then(() => Pn), n = t.state.schema.nodes.code_block, r = t.state.schema.nodes.paragraph;
|
|
380
380
|
if (n == null || r == null) return;
|
|
381
381
|
const { state: u } = t, { $from: i } = u.selection;
|
|
382
382
|
let s = !1;
|
|
@@ -543,7 +543,7 @@ function Ki(t, e, n, r) {
|
|
|
543
543
|
n -= l, r -= l;
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
|
-
class
|
|
546
|
+
class k {
|
|
547
547
|
/**
|
|
548
548
|
@internal
|
|
549
549
|
*/
|
|
@@ -598,7 +598,7 @@ class y {
|
|
|
598
598
|
let n = this.lastChild, r = e.firstChild, u = this.content.slice(), i = 0;
|
|
599
599
|
for (n.isText && n.sameMarkup(r) && (u[u.length - 1] = n.withText(n.text + r.text), i = 1); i < e.content.length; i++)
|
|
600
600
|
u.push(e.content[i]);
|
|
601
|
-
return new
|
|
601
|
+
return new k(u, this.size + e.size);
|
|
602
602
|
}
|
|
603
603
|
/**
|
|
604
604
|
Cut out the sub-fragment between the two given positions.
|
|
@@ -612,13 +612,13 @@ class y {
|
|
|
612
612
|
let o = this.content[i], l = s + o.nodeSize;
|
|
613
613
|
l > e && ((s < e || l > n) && (o.isText ? o = o.cut(Math.max(0, e - s), Math.min(o.text.length, n - s)) : o = o.cut(Math.max(0, e - s - 1), Math.min(o.content.size, n - s - 1))), r.push(o), u += o.nodeSize), s = l;
|
|
614
614
|
}
|
|
615
|
-
return new
|
|
615
|
+
return new k(r, u);
|
|
616
616
|
}
|
|
617
617
|
/**
|
|
618
618
|
@internal
|
|
619
619
|
*/
|
|
620
620
|
cutByIndex(e, n) {
|
|
621
|
-
return e == n ?
|
|
621
|
+
return e == n ? k.empty : e == 0 && n == this.content.length ? this : new k(this.content.slice(e, n));
|
|
622
622
|
}
|
|
623
623
|
/**
|
|
624
624
|
Create a new fragment in which the node at the given index is
|
|
@@ -629,21 +629,21 @@ class y {
|
|
|
629
629
|
if (r == n)
|
|
630
630
|
return this;
|
|
631
631
|
let u = this.content.slice(), i = this.size + n.nodeSize - r.nodeSize;
|
|
632
|
-
return u[e] = n, new
|
|
632
|
+
return u[e] = n, new k(u, i);
|
|
633
633
|
}
|
|
634
634
|
/**
|
|
635
635
|
Create a new fragment by prepending the given node to this
|
|
636
636
|
fragment.
|
|
637
637
|
*/
|
|
638
638
|
addToStart(e) {
|
|
639
|
-
return new
|
|
639
|
+
return new k([e].concat(this.content), this.size + e.nodeSize);
|
|
640
640
|
}
|
|
641
641
|
/**
|
|
642
642
|
Create a new fragment by appending the given node to this
|
|
643
643
|
fragment.
|
|
644
644
|
*/
|
|
645
645
|
addToEnd(e) {
|
|
646
|
-
return new
|
|
646
|
+
return new k(this.content.concat(e), this.size + e.nodeSize);
|
|
647
647
|
}
|
|
648
648
|
/**
|
|
649
649
|
Compare this fragment to another one.
|
|
@@ -758,10 +758,10 @@ class y {
|
|
|
758
758
|
*/
|
|
759
759
|
static fromJSON(e, n) {
|
|
760
760
|
if (!n)
|
|
761
|
-
return
|
|
761
|
+
return k.empty;
|
|
762
762
|
if (!Array.isArray(n))
|
|
763
763
|
throw new RangeError("Invalid input for Fragment.fromJSON");
|
|
764
|
-
return new
|
|
764
|
+
return new k(n.map(e.nodeFromJSON));
|
|
765
765
|
}
|
|
766
766
|
/**
|
|
767
767
|
Build a fragment from an array of nodes. Ensures that adjacent
|
|
@@ -769,13 +769,13 @@ class y {
|
|
|
769
769
|
*/
|
|
770
770
|
static fromArray(e) {
|
|
771
771
|
if (!e.length)
|
|
772
|
-
return
|
|
772
|
+
return k.empty;
|
|
773
773
|
let n, r = 0;
|
|
774
774
|
for (let u = 0; u < e.length; u++) {
|
|
775
775
|
let i = e[u];
|
|
776
776
|
r += i.nodeSize, u && i.isText && e[u - 1].sameMarkup(i) ? (n || (n = e.slice(0, u)), n[n.length - 1] = i.withText(n[n.length - 1].text + i.text)) : n && n.push(i);
|
|
777
777
|
}
|
|
778
|
-
return new
|
|
778
|
+
return new k(n || e, r);
|
|
779
779
|
}
|
|
780
780
|
/**
|
|
781
781
|
Create a fragment from something that can be interpreted as a
|
|
@@ -785,22 +785,22 @@ class y {
|
|
|
785
785
|
*/
|
|
786
786
|
static from(e) {
|
|
787
787
|
if (!e)
|
|
788
|
-
return
|
|
789
|
-
if (e instanceof
|
|
788
|
+
return k.empty;
|
|
789
|
+
if (e instanceof k)
|
|
790
790
|
return e;
|
|
791
791
|
if (Array.isArray(e))
|
|
792
792
|
return this.fromArray(e);
|
|
793
793
|
if (e.attrs)
|
|
794
|
-
return new
|
|
794
|
+
return new k([e], e.nodeSize);
|
|
795
795
|
throw new RangeError("Can not convert " + e + " to a Fragment" + (e.nodesBetween ? " (looks like multiple versions of prosemirror-model were loaded)" : ""));
|
|
796
796
|
}
|
|
797
797
|
}
|
|
798
|
-
|
|
799
|
-
const
|
|
798
|
+
k.empty = new k([], 0);
|
|
799
|
+
const $n = { index: 0, offset: 0 };
|
|
800
800
|
function tn(t, e) {
|
|
801
|
-
return
|
|
801
|
+
return $n.index = t, $n.offset = e, $n;
|
|
802
802
|
}
|
|
803
|
-
function
|
|
803
|
+
function hn(t, e) {
|
|
804
804
|
if (t === e)
|
|
805
805
|
return !0;
|
|
806
806
|
if (!(t && typeof t == "object") || !(e && typeof e == "object"))
|
|
@@ -812,11 +812,11 @@ function pn(t, e) {
|
|
|
812
812
|
if (t.length != e.length)
|
|
813
813
|
return !1;
|
|
814
814
|
for (let r = 0; r < t.length; r++)
|
|
815
|
-
if (!
|
|
815
|
+
if (!hn(t[r], e[r]))
|
|
816
816
|
return !1;
|
|
817
817
|
} else {
|
|
818
818
|
for (let r in t)
|
|
819
|
-
if (!(r in e) || !
|
|
819
|
+
if (!(r in e) || !hn(t[r], e[r]))
|
|
820
820
|
return !1;
|
|
821
821
|
for (let r in e)
|
|
822
822
|
if (!(r in t))
|
|
@@ -878,7 +878,7 @@ class M {
|
|
|
878
878
|
another mark.
|
|
879
879
|
*/
|
|
880
880
|
eq(e) {
|
|
881
|
-
return this == e || this.type == e.type &&
|
|
881
|
+
return this == e || this.type == e.type && hn(this.attrs, e.attrs);
|
|
882
882
|
}
|
|
883
883
|
/**
|
|
884
884
|
Convert this mark to a JSON-serializeable representation.
|
|
@@ -930,7 +930,7 @@ class M {
|
|
|
930
930
|
}
|
|
931
931
|
}
|
|
932
932
|
M.none = [];
|
|
933
|
-
class
|
|
933
|
+
class pn extends Error {
|
|
934
934
|
}
|
|
935
935
|
class D {
|
|
936
936
|
/**
|
|
@@ -997,7 +997,7 @@ class D {
|
|
|
997
997
|
let r = n.openStart || 0, u = n.openEnd || 0;
|
|
998
998
|
if (typeof r != "number" || typeof u != "number")
|
|
999
999
|
throw new RangeError("Invalid input for Slice.fromJSON");
|
|
1000
|
-
return new D(
|
|
1000
|
+
return new D(k.fromJSON(e, n.content), r, u);
|
|
1001
1001
|
}
|
|
1002
1002
|
/**
|
|
1003
1003
|
Create a slice from a fragment by taking the maximum possible
|
|
@@ -1012,7 +1012,7 @@ class D {
|
|
|
1012
1012
|
return new D(e, r, u);
|
|
1013
1013
|
}
|
|
1014
1014
|
}
|
|
1015
|
-
D.empty = new D(
|
|
1015
|
+
D.empty = new D(k.empty, 0, 0);
|
|
1016
1016
|
function Zi(t, e, n) {
|
|
1017
1017
|
let { index: r, offset: u } = t.findIndex(e), i = t.maybeChild(r), { index: s, offset: o } = t.findIndex(n);
|
|
1018
1018
|
if (u == e || i.isText) {
|
|
@@ -1033,9 +1033,9 @@ function Gi(t, e, n, r) {
|
|
|
1033
1033
|
}
|
|
1034
1034
|
function yl(t, e, n) {
|
|
1035
1035
|
if (n.openStart > t.depth)
|
|
1036
|
-
throw new
|
|
1036
|
+
throw new pn("Inserted content deeper than insertion position");
|
|
1037
1037
|
if (t.depth - n.openStart != e.depth - n.openEnd)
|
|
1038
|
-
throw new
|
|
1038
|
+
throw new pn("Inconsistent open depths");
|
|
1039
1039
|
return Yi(t, e, n, 0);
|
|
1040
1040
|
}
|
|
1041
1041
|
function Yi(t, e, n, r) {
|
|
@@ -1051,11 +1051,11 @@ function Yi(t, e, n, r) {
|
|
|
1051
1051
|
let { start: s, end: o } = Cl(n, t);
|
|
1052
1052
|
return Ye(i, Qi(t, s, o, e, r));
|
|
1053
1053
|
}
|
|
1054
|
-
else return Ye(i,
|
|
1054
|
+
else return Ye(i, mn(t, e, r));
|
|
1055
1055
|
}
|
|
1056
1056
|
function Xi(t, e) {
|
|
1057
1057
|
if (!e.type.compatibleContent(t.type))
|
|
1058
|
-
throw new
|
|
1058
|
+
throw new pn("Cannot join " + e.type.name + " onto " + t.type.name);
|
|
1059
1059
|
}
|
|
1060
1060
|
function yr(t, e, n) {
|
|
1061
1061
|
let r = t.node(n);
|
|
@@ -1077,20 +1077,20 @@ function Ye(t, e) {
|
|
|
1077
1077
|
}
|
|
1078
1078
|
function Qi(t, e, n, r, u) {
|
|
1079
1079
|
let i = t.depth > u && yr(t, e, u + 1), s = r.depth > u && yr(n, r, u + 1), o = [];
|
|
1080
|
-
return Tt(null, t, u, o), i && s && e.index(u) == n.index(u) ? (Xi(i, s), Ge(Ye(i, Qi(t, e, n, r, u + 1)), o)) : (i && Ge(Ye(i,
|
|
1080
|
+
return Tt(null, t, u, o), i && s && e.index(u) == n.index(u) ? (Xi(i, s), Ge(Ye(i, Qi(t, e, n, r, u + 1)), o)) : (i && Ge(Ye(i, mn(t, e, u + 1)), o), Tt(e, n, u, o), s && Ge(Ye(s, mn(n, r, u + 1)), o)), Tt(r, null, u, o), new k(o);
|
|
1081
1081
|
}
|
|
1082
|
-
function
|
|
1082
|
+
function mn(t, e, n) {
|
|
1083
1083
|
let r = [];
|
|
1084
1084
|
if (Tt(null, t, n, r), t.depth > n) {
|
|
1085
1085
|
let u = yr(t, e, n + 1);
|
|
1086
|
-
Ge(Ye(u,
|
|
1086
|
+
Ge(Ye(u, mn(t, e, n + 1)), r);
|
|
1087
1087
|
}
|
|
1088
|
-
return Tt(e, null, n, r), new
|
|
1088
|
+
return Tt(e, null, n, r), new k(r);
|
|
1089
1089
|
}
|
|
1090
1090
|
function Cl(t, e) {
|
|
1091
1091
|
let n = e.depth - t.openStart, u = e.node(n).copy(t.content);
|
|
1092
1092
|
for (let i = n - 1; i >= 0; i--)
|
|
1093
|
-
u = e.node(i).copy(
|
|
1093
|
+
u = e.node(i).copy(k.from(u));
|
|
1094
1094
|
return {
|
|
1095
1095
|
start: u.resolveNoCache(t.openStart + n),
|
|
1096
1096
|
end: u.resolveNoCache(u.content.size - t.openEnd - n)
|
|
@@ -1395,7 +1395,7 @@ class ke {
|
|
|
1395
1395
|
@internal
|
|
1396
1396
|
*/
|
|
1397
1397
|
constructor(e, n, r, u = M.none) {
|
|
1398
|
-
this.type = e, this.attrs = n, this.marks = u, this.content = r ||
|
|
1398
|
+
this.type = e, this.attrs = n, this.marks = u, this.content = r || k.empty;
|
|
1399
1399
|
}
|
|
1400
1400
|
/**
|
|
1401
1401
|
The array of this node's child nodes.
|
|
@@ -1508,7 +1508,7 @@ class ke {
|
|
|
1508
1508
|
attributes, and marks.
|
|
1509
1509
|
*/
|
|
1510
1510
|
hasMarkup(e, n, r) {
|
|
1511
|
-
return this.type == e &&
|
|
1511
|
+
return this.type == e && hn(this.attrs, n || e.defaultAttrs || Sl) && M.sameSet(this.marks, r || M.none);
|
|
1512
1512
|
}
|
|
1513
1513
|
/**
|
|
1514
1514
|
Create a new node with the same markup as this node, containing
|
|
@@ -1684,7 +1684,7 @@ class ke {
|
|
|
1684
1684
|
can optionally pass `start` and `end` indices into the
|
|
1685
1685
|
replacement fragment.
|
|
1686
1686
|
*/
|
|
1687
|
-
canReplace(e, n, r =
|
|
1687
|
+
canReplace(e, n, r = k.empty, u = 0, i = r.childCount) {
|
|
1688
1688
|
let s = this.contentMatchAt(e).matchFragment(r, u, i), o = s && s.matchFragment(this.content, n);
|
|
1689
1689
|
if (!o || !o.validEnd)
|
|
1690
1690
|
return !1;
|
|
@@ -1755,12 +1755,12 @@ class ke {
|
|
|
1755
1755
|
throw new RangeError("Invalid text node in JSON");
|
|
1756
1756
|
return e.text(n.text, r);
|
|
1757
1757
|
}
|
|
1758
|
-
let u =
|
|
1758
|
+
let u = k.fromJSON(e, n.content), i = e.nodeType(n.type).create(n.attrs, u, r);
|
|
1759
1759
|
return i.type.checkAttrs(i.attrs), i;
|
|
1760
1760
|
}
|
|
1761
1761
|
}
|
|
1762
1762
|
ke.prototype.text = void 0;
|
|
1763
|
-
class
|
|
1763
|
+
class gn extends ke {
|
|
1764
1764
|
/**
|
|
1765
1765
|
@internal
|
|
1766
1766
|
*/
|
|
@@ -1782,10 +1782,10 @@ class bn extends ke {
|
|
|
1782
1782
|
return this.text.length;
|
|
1783
1783
|
}
|
|
1784
1784
|
mark(e) {
|
|
1785
|
-
return e == this.marks ? this : new
|
|
1785
|
+
return e == this.marks ? this : new gn(this.type, this.attrs, this.text, e);
|
|
1786
1786
|
}
|
|
1787
1787
|
withText(e) {
|
|
1788
|
-
return e == this.text ? this : new
|
|
1788
|
+
return e == this.text ? this : new gn(this.type, this.attrs, e, this.marks);
|
|
1789
1789
|
}
|
|
1790
1790
|
cut(e = 0, n = this.text.length) {
|
|
1791
1791
|
return e == 0 && n == this.text.length ? this : this.withText(this.text.slice(e, n));
|
|
@@ -1883,7 +1883,7 @@ class tt {
|
|
|
1883
1883
|
function i(s, o) {
|
|
1884
1884
|
let l = s.matchFragment(e, r);
|
|
1885
1885
|
if (l && (!n || l.validEnd))
|
|
1886
|
-
return
|
|
1886
|
+
return k.from(o.map((a) => a.createAndFill()));
|
|
1887
1887
|
for (let a = 0; a < s.next.length; a++) {
|
|
1888
1888
|
let { type: c, next: f } = s.next[a];
|
|
1889
1889
|
if (!(c.isText || c.hasRequiredAttrs()) && u.indexOf(f) == -1) {
|
|
@@ -2266,7 +2266,7 @@ let gu = class ls {
|
|
|
2266
2266
|
create(e = null, n, r) {
|
|
2267
2267
|
if (this.isText)
|
|
2268
2268
|
throw new Error("NodeType.create can't construct text nodes");
|
|
2269
|
-
return new ke(this, this.computeAttrs(e),
|
|
2269
|
+
return new ke(this, this.computeAttrs(e), k.from(n), M.setFrom(r));
|
|
2270
2270
|
}
|
|
2271
2271
|
/**
|
|
2272
2272
|
Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content
|
|
@@ -2274,7 +2274,7 @@ let gu = class ls {
|
|
|
2274
2274
|
if it doesn't match.
|
|
2275
2275
|
*/
|
|
2276
2276
|
createChecked(e = null, n, r) {
|
|
2277
|
-
return n =
|
|
2277
|
+
return n = k.from(n), this.checkContent(n), new ke(this, this.computeAttrs(e), n, M.setFrom(r));
|
|
2278
2278
|
}
|
|
2279
2279
|
/**
|
|
2280
2280
|
Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but see if it is
|
|
@@ -2285,13 +2285,13 @@ let gu = class ls {
|
|
|
2285
2285
|
`Fragment.empty` as content.
|
|
2286
2286
|
*/
|
|
2287
2287
|
createAndFill(e = null, n, r) {
|
|
2288
|
-
if (e = this.computeAttrs(e), n =
|
|
2288
|
+
if (e = this.computeAttrs(e), n = k.from(n), n.size) {
|
|
2289
2289
|
let s = this.contentMatch.fillBefore(n);
|
|
2290
2290
|
if (!s)
|
|
2291
2291
|
return null;
|
|
2292
2292
|
n = s.append(n);
|
|
2293
2293
|
}
|
|
2294
|
-
let u = this.contentMatch.matchFragment(n), i = u && u.fillBefore(
|
|
2294
|
+
let u = this.contentMatch.matchFragment(n), i = u && u.fillBefore(k.empty, !0);
|
|
2295
2295
|
return i ? new ke(this, e, n.append(i), M.setFrom(r)) : null;
|
|
2296
2296
|
}
|
|
2297
2297
|
/**
|
|
@@ -2382,7 +2382,7 @@ class vl {
|
|
|
2382
2382
|
return !this.hasDefault;
|
|
2383
2383
|
}
|
|
2384
2384
|
}
|
|
2385
|
-
class
|
|
2385
|
+
class Mn {
|
|
2386
2386
|
/**
|
|
2387
2387
|
@internal
|
|
2388
2388
|
*/
|
|
@@ -2404,7 +2404,7 @@ class wn {
|
|
|
2404
2404
|
*/
|
|
2405
2405
|
static compile(e, n) {
|
|
2406
2406
|
let r = /* @__PURE__ */ Object.create(null), u = 0;
|
|
2407
|
-
return e.forEach((i, s) => r[i] = new
|
|
2407
|
+
return e.forEach((i, s) => r[i] = new Mn(i, u++, n, s)), r;
|
|
2408
2408
|
}
|
|
2409
2409
|
/**
|
|
2410
2410
|
When there is a mark of this type in the given set, a new set
|
|
@@ -2446,7 +2446,7 @@ class Lr {
|
|
|
2446
2446
|
let n = this.spec = {};
|
|
2447
2447
|
for (let u in e)
|
|
2448
2448
|
n[u] = e[u];
|
|
2449
|
-
n.nodes = L.from(e.nodes), n.marks = L.from(e.marks || {}), this.nodes = gu.compile(this.spec.nodes, this), this.marks =
|
|
2449
|
+
n.nodes = L.from(e.nodes), n.marks = L.from(e.marks || {}), this.nodes = gu.compile(this.spec.nodes, this), this.marks = Mn.compile(this.spec.marks, this);
|
|
2450
2450
|
let r = /* @__PURE__ */ Object.create(null);
|
|
2451
2451
|
for (let u in this.nodes) {
|
|
2452
2452
|
if (u in this.marks)
|
|
@@ -2488,7 +2488,7 @@ class Lr {
|
|
|
2488
2488
|
*/
|
|
2489
2489
|
text(e, n) {
|
|
2490
2490
|
let r = this.nodes.text;
|
|
2491
|
-
return new
|
|
2491
|
+
return new gn(r, r.defaultAttrs, e, M.setFrom(n));
|
|
2492
2492
|
}
|
|
2493
2493
|
/**
|
|
2494
2494
|
Create a mark with the given type and attributes.
|
|
@@ -2695,7 +2695,7 @@ class nn {
|
|
|
2695
2695
|
if (!this.match) {
|
|
2696
2696
|
if (!this.type)
|
|
2697
2697
|
return [];
|
|
2698
|
-
let n = this.type.contentMatch.fillBefore(
|
|
2698
|
+
let n = this.type.contentMatch.fillBefore(k.from(e));
|
|
2699
2699
|
if (n)
|
|
2700
2700
|
this.match = this.type.contentMatch.matchFragment(n);
|
|
2701
2701
|
else {
|
|
@@ -2713,8 +2713,8 @@ class nn {
|
|
|
2713
2713
|
r.text.length == u[0].length ? this.content.pop() : this.content[this.content.length - 1] = i.withText(i.text.slice(0, i.text.length - u[0].length));
|
|
2714
2714
|
}
|
|
2715
2715
|
}
|
|
2716
|
-
let n =
|
|
2717
|
-
return !e && this.match && (n = n.append(this.match.fillBefore(
|
|
2716
|
+
let n = k.from(this.content);
|
|
2717
|
+
return !e && this.match && (n = n.append(this.match.fillBefore(k.empty, !0))), this.type ? this.type.create(this.attrs, n, this.marks) : n;
|
|
2718
2718
|
}
|
|
2719
2719
|
inlineContext(e) {
|
|
2720
2720
|
return this.type ? this.type.inlineContent : this.content.length ? this.content[0].isInline : e.parentNode && !as.hasOwnProperty(e.parentNode.nodeName.toLowerCase());
|
|
@@ -3047,7 +3047,7 @@ class kt {
|
|
|
3047
3047
|
nodes.
|
|
3048
3048
|
*/
|
|
3049
3049
|
serializeFragment(e, n = {}, r) {
|
|
3050
|
-
r || (r =
|
|
3050
|
+
r || (r = Wn(n).createDocumentFragment());
|
|
3051
3051
|
let u = r, i = [];
|
|
3052
3052
|
return e.forEach((s) => {
|
|
3053
3053
|
if (i.length || s.marks.length) {
|
|
@@ -3076,7 +3076,7 @@ class kt {
|
|
|
3076
3076
|
@internal
|
|
3077
3077
|
*/
|
|
3078
3078
|
serializeNodeInner(e, n) {
|
|
3079
|
-
let { dom: r, contentDOM: u } =
|
|
3079
|
+
let { dom: r, contentDOM: u } = ln(Wn(n), this.nodes[e.type.name](e), null, e.attrs);
|
|
3080
3080
|
if (u) {
|
|
3081
3081
|
if (e.isLeaf)
|
|
3082
3082
|
throw new RangeError("Content hole not allowed in a leaf node spec");
|
|
@@ -3104,10 +3104,10 @@ class kt {
|
|
|
3104
3104
|
*/
|
|
3105
3105
|
serializeMark(e, n, r = {}) {
|
|
3106
3106
|
let u = this.marks[e.type.name];
|
|
3107
|
-
return u &&
|
|
3107
|
+
return u && ln(Wn(r), u(e, n), null, e.attrs);
|
|
3108
3108
|
}
|
|
3109
3109
|
static renderSpec(e, n, r = null, u) {
|
|
3110
|
-
return
|
|
3110
|
+
return ln(e, n, r, u);
|
|
3111
3111
|
}
|
|
3112
3112
|
/**
|
|
3113
3113
|
Build a serializer using the [`toDOM`](https://prosemirror.net/docs/ref/#model.NodeSpec.toDOM)
|
|
@@ -3139,7 +3139,7 @@ function Du(t) {
|
|
|
3139
3139
|
}
|
|
3140
3140
|
return e;
|
|
3141
3141
|
}
|
|
3142
|
-
function
|
|
3142
|
+
function Wn(t) {
|
|
3143
3143
|
return t.document || window.document;
|
|
3144
3144
|
}
|
|
3145
3145
|
const _u = /* @__PURE__ */ new WeakMap();
|
|
@@ -3163,7 +3163,7 @@ function Wl(t) {
|
|
|
3163
3163
|
}
|
|
3164
3164
|
return n(t), e;
|
|
3165
3165
|
}
|
|
3166
|
-
function
|
|
3166
|
+
function ln(t, e, n, r) {
|
|
3167
3167
|
if (typeof e == "string")
|
|
3168
3168
|
return { dom: t.createTextNode(e) };
|
|
3169
3169
|
if (e.nodeType != null)
|
|
@@ -3193,7 +3193,7 @@ function an(t, e, n, r) {
|
|
|
3193
3193
|
throw new RangeError("Content hole must be the only child of its parent node");
|
|
3194
3194
|
return { dom: l, contentDOM: l };
|
|
3195
3195
|
} else {
|
|
3196
|
-
let { dom: h, contentDOM: d } =
|
|
3196
|
+
let { dom: h, contentDOM: d } = ln(t, p, n, r);
|
|
3197
3197
|
if (l.appendChild(h), d) {
|
|
3198
3198
|
if (o)
|
|
3199
3199
|
throw new RangeError("Multiple content holes");
|
|
@@ -3213,7 +3213,7 @@ function Eu(t) {
|
|
|
3213
3213
|
function Jl(t) {
|
|
3214
3214
|
return (t - (t & fs)) / ds;
|
|
3215
3215
|
}
|
|
3216
|
-
const hs = 1, ps = 2,
|
|
3216
|
+
const hs = 1, ps = 2, an = 4, ms = 8;
|
|
3217
3217
|
class Dr {
|
|
3218
3218
|
/**
|
|
3219
3219
|
@internal
|
|
@@ -3233,13 +3233,13 @@ class Dr {
|
|
|
3233
3233
|
Tells you whether the token before the mapped position was deleted.
|
|
3234
3234
|
*/
|
|
3235
3235
|
get deletedBefore() {
|
|
3236
|
-
return (this.delInfo & (hs |
|
|
3236
|
+
return (this.delInfo & (hs | an)) > 0;
|
|
3237
3237
|
}
|
|
3238
3238
|
/**
|
|
3239
3239
|
True when the token after the mapped position was deleted.
|
|
3240
3240
|
*/
|
|
3241
3241
|
get deletedAfter() {
|
|
3242
|
-
return (this.delInfo & (ps |
|
|
3242
|
+
return (this.delInfo & (ps | an)) > 0;
|
|
3243
3243
|
}
|
|
3244
3244
|
/**
|
|
3245
3245
|
Tells whether any of the steps mapped through deletes across the
|
|
@@ -3247,7 +3247,7 @@ class Dr {
|
|
|
3247
3247
|
position).
|
|
3248
3248
|
*/
|
|
3249
3249
|
get deletedAcross() {
|
|
3250
|
-
return (this.delInfo &
|
|
3250
|
+
return (this.delInfo & an) > 0;
|
|
3251
3251
|
}
|
|
3252
3252
|
}
|
|
3253
3253
|
class X {
|
|
@@ -3290,7 +3290,7 @@ class X {
|
|
|
3290
3290
|
let p = a ? e == l ? -1 : e == f ? 1 : n : n, h = l + u + (p < 0 ? 0 : c);
|
|
3291
3291
|
if (r)
|
|
3292
3292
|
return h;
|
|
3293
|
-
let d = e == (n < 0 ? l : f) ? null : Hl(o / 3, e - l), m = e == l ? ps : e == f ? hs :
|
|
3293
|
+
let d = e == (n < 0 ? l : f) ? null : Hl(o / 3, e - l), m = e == l ? ps : e == f ? hs : an;
|
|
3294
3294
|
return (n < 0 ? e != l : e != f) && (m |= ms), new Dr(h, m, d);
|
|
3295
3295
|
}
|
|
3296
3296
|
u += c - a;
|
|
@@ -3454,7 +3454,7 @@ class zt {
|
|
|
3454
3454
|
return r ? e : new Dr(e, u, null);
|
|
3455
3455
|
}
|
|
3456
3456
|
}
|
|
3457
|
-
const
|
|
3457
|
+
const Hn = /* @__PURE__ */ Object.create(null);
|
|
3458
3458
|
class J {
|
|
3459
3459
|
/**
|
|
3460
3460
|
Get the step map that represents the changes made by this step,
|
|
@@ -3479,7 +3479,7 @@ class J {
|
|
|
3479
3479
|
static fromJSON(e, n) {
|
|
3480
3480
|
if (!n || !n.stepType)
|
|
3481
3481
|
throw new RangeError("Invalid input for Step.fromJSON");
|
|
3482
|
-
let r =
|
|
3482
|
+
let r = Hn[n.stepType];
|
|
3483
3483
|
if (!r)
|
|
3484
3484
|
throw new RangeError(`No step type ${n.stepType} defined`);
|
|
3485
3485
|
return r.fromJSON(e, n);
|
|
@@ -3491,9 +3491,9 @@ class J {
|
|
|
3491
3491
|
that's unlikely to clash with steps from other modules.
|
|
3492
3492
|
*/
|
|
3493
3493
|
static jsonID(e, n) {
|
|
3494
|
-
if (e in
|
|
3494
|
+
if (e in Hn)
|
|
3495
3495
|
throw new RangeError("Duplicate use of step JSON ID " + e);
|
|
3496
|
-
return
|
|
3496
|
+
return Hn[e] = n, n.prototype.jsonID = e, n;
|
|
3497
3497
|
}
|
|
3498
3498
|
}
|
|
3499
3499
|
class R {
|
|
@@ -3524,7 +3524,7 @@ class R {
|
|
|
3524
3524
|
try {
|
|
3525
3525
|
return R.ok(e.replace(n, r, u));
|
|
3526
3526
|
} catch (i) {
|
|
3527
|
-
if (i instanceof
|
|
3527
|
+
if (i instanceof pn)
|
|
3528
3528
|
return R.fail(i.message);
|
|
3529
3529
|
throw i;
|
|
3530
3530
|
}
|
|
@@ -3536,7 +3536,7 @@ function qr(t, e, n) {
|
|
|
3536
3536
|
let i = t.child(u);
|
|
3537
3537
|
i.content.size && (i = i.copy(qr(i.content, e, i))), i.isInline && (i = e(i, n, u)), r.push(i);
|
|
3538
3538
|
}
|
|
3539
|
-
return
|
|
3539
|
+
return k.fromArray(r);
|
|
3540
3540
|
}
|
|
3541
3541
|
class Be extends J {
|
|
3542
3542
|
/**
|
|
@@ -3628,7 +3628,7 @@ class ve extends J {
|
|
|
3628
3628
|
if (!n)
|
|
3629
3629
|
return R.fail("No node at mark step's position");
|
|
3630
3630
|
let r = n.type.create(n.attrs, null, this.mark.addToSet(n.marks));
|
|
3631
|
-
return R.fromReplace(e, this.pos, this.pos + 1, new D(
|
|
3631
|
+
return R.fromReplace(e, this.pos, this.pos + 1, new D(k.from(r), 0, n.isLeaf ? 0 : 1));
|
|
3632
3632
|
}
|
|
3633
3633
|
invert(e) {
|
|
3634
3634
|
let n = e.nodeAt(this.pos);
|
|
@@ -3672,7 +3672,7 @@ class nt extends J {
|
|
|
3672
3672
|
if (!n)
|
|
3673
3673
|
return R.fail("No node at mark step's position");
|
|
3674
3674
|
let r = n.type.create(n.attrs, null, this.mark.removeFromSet(n.marks));
|
|
3675
|
-
return R.fromReplace(e, this.pos, this.pos + 1, new D(
|
|
3675
|
+
return R.fromReplace(e, this.pos, this.pos + 1, new D(k.from(r), 0, n.isLeaf ? 0 : 1));
|
|
3676
3676
|
}
|
|
3677
3677
|
invert(e) {
|
|
3678
3678
|
let n = e.nodeAt(this.pos);
|
|
@@ -3840,7 +3840,7 @@ function Ul(t, e, n, r) {
|
|
|
3840
3840
|
return;
|
|
3841
3841
|
i++;
|
|
3842
3842
|
let l = null;
|
|
3843
|
-
if (r instanceof
|
|
3843
|
+
if (r instanceof Mn) {
|
|
3844
3844
|
let a = s.marks, c;
|
|
3845
3845
|
for (; c = r.isInSet(a); )
|
|
3846
3846
|
(l || (l = [])).push(c), a = c.removeFromSet(a);
|
|
@@ -3871,13 +3871,13 @@ function Vr(t, e, n, r = n.contentMatch, u = !0) {
|
|
|
3871
3871
|
if (u && a.isText && n.whitespace != "pre") {
|
|
3872
3872
|
let p, h = /\r?\n|\r/g, d;
|
|
3873
3873
|
for (; p = h.exec(a.text); )
|
|
3874
|
-
d || (d = new D(
|
|
3874
|
+
d || (d = new D(k.from(n.schema.text(" ", n.allowedMarks(a.marks))), 0, 0)), s.push(new W(o + p.index, o + p.index + p[0].length, d));
|
|
3875
3875
|
}
|
|
3876
3876
|
}
|
|
3877
3877
|
o = c;
|
|
3878
3878
|
}
|
|
3879
3879
|
if (!r.validEnd) {
|
|
3880
|
-
let l = r.fillBefore(
|
|
3880
|
+
let l = r.fillBefore(k.empty, !0);
|
|
3881
3881
|
t.replace(o, o, new D(l, 0, 0));
|
|
3882
3882
|
}
|
|
3883
3883
|
for (let l = s.length - 1; l >= 0; l--)
|
|
@@ -3886,7 +3886,7 @@ function Vr(t, e, n, r = n.contentMatch, u = !0) {
|
|
|
3886
3886
|
function Kl(t, e, n) {
|
|
3887
3887
|
return (e == 0 || t.canReplace(e, t.childCount)) && (n == t.childCount || t.canReplace(0, n));
|
|
3888
3888
|
}
|
|
3889
|
-
function
|
|
3889
|
+
function wn(t) {
|
|
3890
3890
|
let n = t.parent.content.cutByIndex(t.startIndex, t.endIndex);
|
|
3891
3891
|
for (let r = t.depth; ; --r) {
|
|
3892
3892
|
let u = t.$from.node(r), i = t.$from.index(r), s = t.$to.indexAfter(r);
|
|
@@ -3898,12 +3898,12 @@ function Tn(t) {
|
|
|
3898
3898
|
return null;
|
|
3899
3899
|
}
|
|
3900
3900
|
function Zl(t, e, n) {
|
|
3901
|
-
let { $from: r, $to: u, depth: i } = e, s = r.before(i + 1), o = u.after(i + 1), l = s, a = o, c =
|
|
3901
|
+
let { $from: r, $to: u, depth: i } = e, s = r.before(i + 1), o = u.after(i + 1), l = s, a = o, c = k.empty, f = 0;
|
|
3902
3902
|
for (let d = i, m = !1; d > n; d--)
|
|
3903
|
-
m || r.index(d) > 0 ? (m = !0, c =
|
|
3904
|
-
let p =
|
|
3903
|
+
m || r.index(d) > 0 ? (m = !0, c = k.from(r.node(d).copy(c)), f++) : l--;
|
|
3904
|
+
let p = k.empty, h = 0;
|
|
3905
3905
|
for (let d = i, m = !1; d > n; d--)
|
|
3906
|
-
m || u.after(d + 1) < u.end(d) ? (m = !0, p =
|
|
3906
|
+
m || u.after(d + 1) < u.end(d) ? (m = !0, p = k.from(u.node(d).copy(p)), h++) : a++;
|
|
3907
3907
|
t.step(new Q(l, a, s, o, new D(c.append(p), f, h), c.size - f, !0));
|
|
3908
3908
|
}
|
|
3909
3909
|
function Gl(t, e, n = null, r = t) {
|
|
@@ -3930,14 +3930,14 @@ function Xl(t, e) {
|
|
|
3930
3930
|
return !l || !l.validEnd ? null : s;
|
|
3931
3931
|
}
|
|
3932
3932
|
function Ql(t, e, n) {
|
|
3933
|
-
let r =
|
|
3933
|
+
let r = k.empty;
|
|
3934
3934
|
for (let s = n.length - 1; s >= 0; s--) {
|
|
3935
3935
|
if (r.size) {
|
|
3936
3936
|
let o = n[s].type.contentMatch.matchFragment(r);
|
|
3937
3937
|
if (!o || !o.validEnd)
|
|
3938
3938
|
throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper");
|
|
3939
3939
|
}
|
|
3940
|
-
r =
|
|
3940
|
+
r = k.from(n[s].type.create(n[s].attrs, r));
|
|
3941
3941
|
}
|
|
3942
3942
|
let u = e.start, i = e.end;
|
|
3943
3943
|
t.step(new Q(u, i, u, i, new D(r, 0, 0), n.length, !0));
|
|
@@ -3956,7 +3956,7 @@ function ea(t, e, n, r, u) {
|
|
|
3956
3956
|
}
|
|
3957
3957
|
a === !1 && bs(t, s, o, i), Vr(t, t.mapping.slice(i).map(o, 1), r, void 0, a === null);
|
|
3958
3958
|
let c = t.mapping.slice(i), f = c.map(o, 1), p = c.map(o + s.nodeSize, 1);
|
|
3959
|
-
return t.step(new Q(f, p, f + 1, p - 1, new D(
|
|
3959
|
+
return t.step(new Q(f, p, f + 1, p - 1, new D(k.from(r.create(l, null, s.marks)), 0, 0), 1, !0)), a === !0 && gs(t, s, o, i), !1;
|
|
3960
3960
|
}
|
|
3961
3961
|
});
|
|
3962
3962
|
}
|
|
@@ -3994,9 +3994,9 @@ function na(t, e, n, r, u) {
|
|
|
3994
3994
|
return t.replaceWith(e, e + i.nodeSize, s);
|
|
3995
3995
|
if (!n.validContent(i.content))
|
|
3996
3996
|
throw new RangeError("Invalid content for node type " + n.name);
|
|
3997
|
-
t.step(new Q(e, e + i.nodeSize, e + 1, e + i.nodeSize - 1, new D(
|
|
3997
|
+
t.step(new Q(e, e + i.nodeSize, e + 1, e + i.nodeSize - 1, new D(k.from(s), 0, 0), 1, !0));
|
|
3998
3998
|
}
|
|
3999
|
-
function
|
|
3999
|
+
function cn(t, e, n = 1, r) {
|
|
4000
4000
|
let u = t.resolve(e), i = u.depth - n, s = r && r[r.length - 1] || u.parent;
|
|
4001
4001
|
if (i < 0 || u.parent.type.spec.isolating || !u.parent.canReplace(u.index(), u.parent.childCount) || !s.type.validContent(u.parent.content.cutByIndex(u.index(), u.parent.childCount)))
|
|
4002
4002
|
return !1;
|
|
@@ -4014,11 +4014,11 @@ function fn(t, e, n = 1, r) {
|
|
|
4014
4014
|
return u.node(i).canReplaceWith(o, o, l ? l.type : u.node(i + 1).type);
|
|
4015
4015
|
}
|
|
4016
4016
|
function ra(t, e, n = 1, r) {
|
|
4017
|
-
let u = t.doc.resolve(e), i =
|
|
4017
|
+
let u = t.doc.resolve(e), i = k.empty, s = k.empty;
|
|
4018
4018
|
for (let o = u.depth, l = u.depth - n, a = n - 1; o > l; o--, a--) {
|
|
4019
|
-
i =
|
|
4019
|
+
i = k.from(u.node(o).copy(i));
|
|
4020
4020
|
let c = r && r[a];
|
|
4021
|
-
s =
|
|
4021
|
+
s = k.from(c ? c.type.create(c.attrs, s) : u.node(o).copy(s));
|
|
4022
4022
|
}
|
|
4023
4023
|
t.step(new W(e, e, new D(i.append(s), n, n), !0));
|
|
4024
4024
|
}
|
|
@@ -4112,7 +4112,7 @@ function ks(t, e, n) {
|
|
|
4112
4112
|
}
|
|
4113
4113
|
class aa {
|
|
4114
4114
|
constructor(e, n, r) {
|
|
4115
|
-
this.$from = e, this.$to = n, this.unplaced = r, this.frontier = [], this.placed =
|
|
4115
|
+
this.$from = e, this.$to = n, this.unplaced = r, this.frontier = [], this.placed = k.empty;
|
|
4116
4116
|
for (let u = 0; u <= e.depth; u++) {
|
|
4117
4117
|
let i = e.node(u);
|
|
4118
4118
|
this.frontier.push({
|
|
@@ -4121,7 +4121,7 @@ class aa {
|
|
|
4121
4121
|
});
|
|
4122
4122
|
}
|
|
4123
4123
|
for (let u = e.depth; u > 0; u--)
|
|
4124
|
-
this.placed =
|
|
4124
|
+
this.placed = k.from(e.node(u).copy(this.placed));
|
|
4125
4125
|
}
|
|
4126
4126
|
get depth() {
|
|
4127
4127
|
return this.frontier.length - 1;
|
|
@@ -4156,11 +4156,11 @@ class aa {
|
|
|
4156
4156
|
for (let n = 1; n <= 2; n++)
|
|
4157
4157
|
for (let r = n == 1 ? e : this.unplaced.openStart; r >= 0; r--) {
|
|
4158
4158
|
let u, i = null;
|
|
4159
|
-
r ? (i =
|
|
4159
|
+
r ? (i = Jn(this.unplaced.content, r - 1).firstChild, u = i.content) : u = this.unplaced.content;
|
|
4160
4160
|
let s = u.firstChild;
|
|
4161
4161
|
for (let o = this.depth; o >= 0; o--) {
|
|
4162
4162
|
let { type: l, match: a } = this.frontier[o], c, f = null;
|
|
4163
|
-
if (n == 1 && (s ? a.matchType(s.type) || (f = a.fillBefore(
|
|
4163
|
+
if (n == 1 && (s ? a.matchType(s.type) || (f = a.fillBefore(k.from(s), !1)) : i && l.compatibleContent(i.type)))
|
|
4164
4164
|
return { sliceDepth: r, frontierDepth: o, parent: i, inject: f };
|
|
4165
4165
|
if (n == 2 && s && (c = a.findWrapping(s.type)))
|
|
4166
4166
|
return { sliceDepth: r, frontierDepth: o, parent: i, wrap: c };
|
|
@@ -4170,11 +4170,11 @@ class aa {
|
|
|
4170
4170
|
}
|
|
4171
4171
|
}
|
|
4172
4172
|
openMore() {
|
|
4173
|
-
let { content: e, openStart: n, openEnd: r } = this.unplaced, u =
|
|
4173
|
+
let { content: e, openStart: n, openEnd: r } = this.unplaced, u = Jn(e, n);
|
|
4174
4174
|
return !u.childCount || u.firstChild.isLeaf ? !1 : (this.unplaced = new D(e, n + 1, Math.max(r, u.size + n >= e.size - r ? n + 1 : 0)), !0);
|
|
4175
4175
|
}
|
|
4176
4176
|
dropNode() {
|
|
4177
|
-
let { content: e, openStart: n, openEnd: r } = this.unplaced, u =
|
|
4177
|
+
let { content: e, openStart: n, openEnd: r } = this.unplaced, u = Jn(e, n);
|
|
4178
4178
|
if (u.childCount <= 1 && n > 0) {
|
|
4179
4179
|
let i = e.size - n <= n + u.size;
|
|
4180
4180
|
this.unplaced = new D(At(e, n - 1, 1), n - 1, i ? n - 1 : r);
|
|
@@ -4204,7 +4204,7 @@ class aa {
|
|
|
4204
4204
|
a++, (a > 1 || l == 0 || m.content.size) && (f = g, c.push(ys(m.mark(p.allowedMarks(m.marks)), a == 1 ? l : 0, a == o.childCount ? h : -1)));
|
|
4205
4205
|
}
|
|
4206
4206
|
let d = a == o.childCount;
|
|
4207
|
-
d || (h = -1), this.placed = Mt(this.placed, n,
|
|
4207
|
+
d || (h = -1), this.placed = Mt(this.placed, n, k.from(c)), this.frontier[n].match = f, d && h < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
|
|
4208
4208
|
for (let m = 0, g = o; m < h; m++) {
|
|
4209
4209
|
let b = g.lastChild;
|
|
4210
4210
|
this.frontier.push({ type: b.type, match: b.contentMatchAt(b.childCount) }), g = b.content;
|
|
@@ -4215,7 +4215,7 @@ class aa {
|
|
|
4215
4215
|
if (!this.$to.parent.isTextblock)
|
|
4216
4216
|
return -1;
|
|
4217
4217
|
let e = this.frontier[this.depth], n;
|
|
4218
|
-
if (!e.type.isTextblock || !
|
|
4218
|
+
if (!e.type.isTextblock || !jn(this.$to, this.$to.depth, e.type, e.match, !1) || this.$to.depth == this.depth && (n = this.findCloseLevel(this.$to)) && n.depth == this.depth)
|
|
4219
4219
|
return -1;
|
|
4220
4220
|
let { depth: r } = this.$to, u = this.$to.after(r);
|
|
4221
4221
|
for (; r > 1 && u == this.$to.end(--r); )
|
|
@@ -4224,10 +4224,10 @@ class aa {
|
|
|
4224
4224
|
}
|
|
4225
4225
|
findCloseLevel(e) {
|
|
4226
4226
|
e: for (let n = Math.min(this.depth, e.depth); n >= 0; n--) {
|
|
4227
|
-
let { match: r, type: u } = this.frontier[n], i = n < e.depth && e.end(n + 1) == e.pos + (e.depth - (n + 1)), s =
|
|
4227
|
+
let { match: r, type: u } = this.frontier[n], i = n < e.depth && e.end(n + 1) == e.pos + (e.depth - (n + 1)), s = jn(e, n, u, r, i);
|
|
4228
4228
|
if (s) {
|
|
4229
4229
|
for (let o = n - 1; o >= 0; o--) {
|
|
4230
|
-
let { match: l, type: a } = this.frontier[o], c =
|
|
4230
|
+
let { match: l, type: a } = this.frontier[o], c = jn(e, o, a, l, !0);
|
|
4231
4231
|
if (!c || c.childCount)
|
|
4232
4232
|
continue e;
|
|
4233
4233
|
}
|
|
@@ -4250,10 +4250,10 @@ class aa {
|
|
|
4250
4250
|
}
|
|
4251
4251
|
openFrontierNode(e, n = null, r) {
|
|
4252
4252
|
let u = this.frontier[this.depth];
|
|
4253
|
-
u.match = u.match.matchType(e), this.placed = Mt(this.placed, this.depth,
|
|
4253
|
+
u.match = u.match.matchType(e), this.placed = Mt(this.placed, this.depth, k.from(e.create(n, r))), this.frontier.push({ type: e, match: e.contentMatch });
|
|
4254
4254
|
}
|
|
4255
4255
|
closeFrontierNode() {
|
|
4256
|
-
let n = this.frontier.pop().match.fillBefore(
|
|
4256
|
+
let n = this.frontier.pop().match.fillBefore(k.empty, !0);
|
|
4257
4257
|
n.childCount && (this.placed = Mt(this.placed, this.frontier.length, n));
|
|
4258
4258
|
}
|
|
4259
4259
|
}
|
|
@@ -4263,7 +4263,7 @@ function At(t, e, n) {
|
|
|
4263
4263
|
function Mt(t, e, n) {
|
|
4264
4264
|
return e == 0 ? t.append(n) : t.replaceChild(t.childCount - 1, t.lastChild.copy(Mt(t.lastChild.content, e - 1, n)));
|
|
4265
4265
|
}
|
|
4266
|
-
function
|
|
4266
|
+
function Jn(t, e) {
|
|
4267
4267
|
for (let n = 0; n < e; n++)
|
|
4268
4268
|
t = t.firstChild.content;
|
|
4269
4269
|
return t;
|
|
@@ -4272,9 +4272,9 @@ function ys(t, e, n) {
|
|
|
4272
4272
|
if (e <= 0)
|
|
4273
4273
|
return t;
|
|
4274
4274
|
let r = t.content;
|
|
4275
|
-
return e > 1 && (r = r.replaceChild(0, ys(r.firstChild, e - 1, r.childCount == 1 ? n - 1 : 0))), e > 0 && (r = t.type.contentMatch.fillBefore(r).append(r), n <= 0 && (r = r.append(t.type.contentMatch.matchFragment(r).fillBefore(
|
|
4275
|
+
return e > 1 && (r = r.replaceChild(0, ys(r.firstChild, e - 1, r.childCount == 1 ? n - 1 : 0))), e > 0 && (r = t.type.contentMatch.fillBefore(r).append(r), n <= 0 && (r = r.append(t.type.contentMatch.matchFragment(r).fillBefore(k.empty, !0)))), t.copy(r);
|
|
4276
4276
|
}
|
|
4277
|
-
function
|
|
4277
|
+
function jn(t, e, n, r, u) {
|
|
4278
4278
|
let i = t.node(e), s = u ? t.indexAfter(e) : t.index(e);
|
|
4279
4279
|
if (s == i.childCount && !n.compatibleContent(i.type))
|
|
4280
4280
|
return null;
|
|
@@ -4326,8 +4326,8 @@ function da(t, e, n, r) {
|
|
|
4326
4326
|
for (let m = 0; m < s.length; m++) {
|
|
4327
4327
|
let g = s[(m + l) % s.length], b = !0;
|
|
4328
4328
|
g < 0 && (b = !1, g = -g);
|
|
4329
|
-
let x = u.node(g - 1),
|
|
4330
|
-
if (x.canReplaceWith(
|
|
4329
|
+
let x = u.node(g - 1), y = u.index(g - 1);
|
|
4330
|
+
if (x.canReplaceWith(y, y, d.type, d.marks))
|
|
4331
4331
|
return t.replace(u.before(g), b ? i.after(g) : n, new D(Cs(r.content, 0, r.openStart, h), h, r.openEnd));
|
|
4332
4332
|
}
|
|
4333
4333
|
}
|
|
@@ -4344,7 +4344,7 @@ function Cs(t, e, n, r, u) {
|
|
|
4344
4344
|
}
|
|
4345
4345
|
if (e > r) {
|
|
4346
4346
|
let i = u.contentMatchAt(0), s = i.fillBefore(t).append(t);
|
|
4347
|
-
t = s.append(i.matchFragment(s).fillBefore(
|
|
4347
|
+
t = s.append(i.matchFragment(s).fillBefore(k.empty, !0));
|
|
4348
4348
|
}
|
|
4349
4349
|
return t;
|
|
4350
4350
|
}
|
|
@@ -4353,7 +4353,7 @@ function ha(t, e, n, r) {
|
|
|
4353
4353
|
let u = oa(t.doc, e, r.type);
|
|
4354
4354
|
u != null && (e = n = u);
|
|
4355
4355
|
}
|
|
4356
|
-
t.replaceRange(e, n, new D(
|
|
4356
|
+
t.replaceRange(e, n, new D(k.from(r), 0, 0));
|
|
4357
4357
|
}
|
|
4358
4358
|
function pa(t, e, n) {
|
|
4359
4359
|
let r = t.doc.resolve(e), u = t.doc.resolve(n), i = Ds(r, u);
|
|
@@ -4395,7 +4395,7 @@ class ct extends J {
|
|
|
4395
4395
|
r[i] = n.attrs[i];
|
|
4396
4396
|
r[this.attr] = this.value;
|
|
4397
4397
|
let u = n.type.create(r, null, n.marks);
|
|
4398
|
-
return R.fromReplace(e, this.pos, this.pos + 1, new D(
|
|
4398
|
+
return R.fromReplace(e, this.pos, this.pos + 1, new D(k.from(u), 0, n.isLeaf ? 0 : 1));
|
|
4399
4399
|
}
|
|
4400
4400
|
getMap() {
|
|
4401
4401
|
return X.empty;
|
|
@@ -4517,7 +4517,7 @@ class ma {
|
|
|
4517
4517
|
fragment, node, or array of nodes.
|
|
4518
4518
|
*/
|
|
4519
4519
|
replaceWith(e, n, r) {
|
|
4520
|
-
return this.replace(e, n, new D(
|
|
4520
|
+
return this.replace(e, n, new D(k.from(r), 0, 0));
|
|
4521
4521
|
}
|
|
4522
4522
|
/**
|
|
4523
4523
|
Delete the content between the given positions.
|
|
@@ -4685,7 +4685,7 @@ class ma {
|
|
|
4685
4685
|
return Vr(this, e, n, r), this;
|
|
4686
4686
|
}
|
|
4687
4687
|
}
|
|
4688
|
-
const
|
|
4688
|
+
const Un = /* @__PURE__ */ Object.create(null);
|
|
4689
4689
|
class O {
|
|
4690
4690
|
/**
|
|
4691
4691
|
Initialize a selection with the head and anchor and ranges. If no
|
|
@@ -4821,7 +4821,7 @@ class O {
|
|
|
4821
4821
|
static fromJSON(e, n) {
|
|
4822
4822
|
if (!n || !n.type)
|
|
4823
4823
|
throw new RangeError("Invalid input for Selection.fromJSON");
|
|
4824
|
-
let r =
|
|
4824
|
+
let r = Un[n.type];
|
|
4825
4825
|
if (!r)
|
|
4826
4826
|
throw new RangeError(`No selection type ${n.type} defined`);
|
|
4827
4827
|
return r.fromJSON(e, n);
|
|
@@ -4833,9 +4833,9 @@ class O {
|
|
|
4833
4833
|
clash with classes from other modules.
|
|
4834
4834
|
*/
|
|
4835
4835
|
static jsonID(e, n) {
|
|
4836
|
-
if (e in
|
|
4836
|
+
if (e in Un)
|
|
4837
4837
|
throw new RangeError("Duplicate use of selection JSON ID " + e);
|
|
4838
|
-
return
|
|
4838
|
+
return Un[e] = n, n.prototype.jsonID = e, n;
|
|
4839
4839
|
}
|
|
4840
4840
|
/**
|
|
4841
4841
|
Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,
|
|
@@ -4894,7 +4894,7 @@ class F extends O {
|
|
|
4894
4894
|
return e instanceof F && e.anchor == this.anchor && e.head == this.head;
|
|
4895
4895
|
}
|
|
4896
4896
|
getBookmark() {
|
|
4897
|
-
return new
|
|
4897
|
+
return new Tn(this.anchor, this.head);
|
|
4898
4898
|
}
|
|
4899
4899
|
toJSON() {
|
|
4900
4900
|
return { type: "text", anchor: this.anchor, head: this.head };
|
|
@@ -4935,12 +4935,12 @@ class F extends O {
|
|
|
4935
4935
|
}
|
|
4936
4936
|
}
|
|
4937
4937
|
O.jsonID("text", F);
|
|
4938
|
-
class
|
|
4938
|
+
class Tn {
|
|
4939
4939
|
constructor(e, n) {
|
|
4940
4940
|
this.anchor = e, this.head = n;
|
|
4941
4941
|
}
|
|
4942
4942
|
map(e) {
|
|
4943
|
-
return new
|
|
4943
|
+
return new Tn(e.map(this.anchor), e.map(this.head));
|
|
4944
4944
|
}
|
|
4945
4945
|
resolve(e) {
|
|
4946
4946
|
return F.between(e.resolve(this.anchor), e.resolve(this.head));
|
|
@@ -4960,7 +4960,7 @@ class A extends O {
|
|
|
4960
4960
|
return r ? O.near(i) : new A(i);
|
|
4961
4961
|
}
|
|
4962
4962
|
content() {
|
|
4963
|
-
return new D(
|
|
4963
|
+
return new D(k.from(this.node), 0, 0);
|
|
4964
4964
|
}
|
|
4965
4965
|
eq(e) {
|
|
4966
4966
|
return e instanceof A && e.anchor == this.anchor;
|
|
@@ -5001,7 +5001,7 @@ class Wr {
|
|
|
5001
5001
|
}
|
|
5002
5002
|
map(e) {
|
|
5003
5003
|
let { deleted: n, pos: r } = e.mapResult(this.anchor);
|
|
5004
|
-
return n ? new
|
|
5004
|
+
return n ? new Tn(r, r) : new Wr(r);
|
|
5005
5005
|
}
|
|
5006
5006
|
resolve(e) {
|
|
5007
5007
|
let n = e.resolve(this.anchor), r = n.nodeAfter;
|
|
@@ -5274,7 +5274,7 @@ const xa = [
|
|
|
5274
5274
|
}
|
|
5275
5275
|
})
|
|
5276
5276
|
];
|
|
5277
|
-
class
|
|
5277
|
+
class Kn {
|
|
5278
5278
|
constructor(e, n) {
|
|
5279
5279
|
this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = xa.slice(), n && n.forEach((r) => {
|
|
5280
5280
|
if (this.pluginsByKey[r.key])
|
|
@@ -5375,7 +5375,7 @@ class Ue {
|
|
|
5375
5375
|
Create a new state.
|
|
5376
5376
|
*/
|
|
5377
5377
|
static create(e) {
|
|
5378
|
-
let n = new
|
|
5378
|
+
let n = new Kn(e.doc ? e.doc.type.schema : e.schema, e.plugins), r = new Ue(n);
|
|
5379
5379
|
for (let u = 0; u < n.fields.length; u++)
|
|
5380
5380
|
r[n.fields[u].name] = n.fields[u].init(e, r);
|
|
5381
5381
|
return r;
|
|
@@ -5389,7 +5389,7 @@ class Ue {
|
|
|
5389
5389
|
configuration object..
|
|
5390
5390
|
*/
|
|
5391
5391
|
reconfigure(e) {
|
|
5392
|
-
let n = new
|
|
5392
|
+
let n = new Kn(this.schema, e.plugins), r = n.fields, u = new Ue(n);
|
|
5393
5393
|
for (let i = 0; i < r.length; i++) {
|
|
5394
5394
|
let s = r[i].name;
|
|
5395
5395
|
u[s] = this.hasOwnProperty(s) ? this[s] : r[i].init(e, u);
|
|
@@ -5426,7 +5426,7 @@ class Ue {
|
|
|
5426
5426
|
throw new RangeError("Invalid input for EditorState.fromJSON");
|
|
5427
5427
|
if (!e.schema)
|
|
5428
5428
|
throw new RangeError("Required config field 'schema' missing");
|
|
5429
|
-
let u = new
|
|
5429
|
+
let u = new Kn(e.schema, e.plugins), i = new Ue(u);
|
|
5430
5430
|
return u.fields.forEach((s) => {
|
|
5431
5431
|
if (s.name == "doc")
|
|
5432
5432
|
i.doc = ke.fromJSON(e.schema, n.doc);
|
|
@@ -5469,9 +5469,9 @@ class Hr {
|
|
|
5469
5469
|
return e[this.key];
|
|
5470
5470
|
}
|
|
5471
5471
|
}
|
|
5472
|
-
const
|
|
5472
|
+
const Zn = /* @__PURE__ */ Object.create(null);
|
|
5473
5473
|
function Es(t) {
|
|
5474
|
-
return t in
|
|
5474
|
+
return t in Zn ? t + "$" + ++Zn[t] : (Zn[t] = 0, t + "$");
|
|
5475
5475
|
}
|
|
5476
5476
|
class Ss {
|
|
5477
5477
|
/**
|
|
@@ -5580,7 +5580,7 @@ function jt(t) {
|
|
|
5580
5580
|
;
|
|
5581
5581
|
return e && e.node && e.node.isBlock && (e.dom == t || e.contentDOM == t);
|
|
5582
5582
|
}
|
|
5583
|
-
const
|
|
5583
|
+
const On = function(t) {
|
|
5584
5584
|
return t.focusNode && rt(t.focusNode, t.focusOffset, t.anchorNode, t.anchorOffset);
|
|
5585
5585
|
};
|
|
5586
5586
|
function je(t, e) {
|
|
@@ -5845,14 +5845,14 @@ function Ns(t, e, n) {
|
|
|
5845
5845
|
if (i == null && u && (n < 0 || u == re(r))) {
|
|
5846
5846
|
let l = r.childNodes[u - 1];
|
|
5847
5847
|
if (l.nodeType == 1)
|
|
5848
|
-
return
|
|
5848
|
+
return Gn(l.getBoundingClientRect(), !1);
|
|
5849
5849
|
}
|
|
5850
5850
|
if (i == null && u < re(r)) {
|
|
5851
5851
|
let l = r.childNodes[u];
|
|
5852
5852
|
if (l.nodeType == 1)
|
|
5853
|
-
return
|
|
5853
|
+
return Gn(l.getBoundingClientRect(), !0);
|
|
5854
5854
|
}
|
|
5855
|
-
return
|
|
5855
|
+
return Gn(r.getBoundingClientRect(), n >= 0);
|
|
5856
5856
|
}
|
|
5857
5857
|
if (i == null && u && (n < 0 || u == re(r))) {
|
|
5858
5858
|
let l = r.childNodes[u - 1], a = l.nodeType == 3 ? Se(l, re(l) - (s ? 0 : 1)) : l.nodeType == 1 && (l.nodeName != "BR" || !l.nextSibling) ? l : null;
|
|
@@ -5875,7 +5875,7 @@ function Et(t, e) {
|
|
|
5875
5875
|
let n = e ? t.left : t.right;
|
|
5876
5876
|
return { top: t.top, bottom: t.bottom, left: n, right: n };
|
|
5877
5877
|
}
|
|
5878
|
-
function
|
|
5878
|
+
function Gn(t, e) {
|
|
5879
5879
|
if (t.height == 0)
|
|
5880
5880
|
return t;
|
|
5881
5881
|
let n = e ? t.top : t.bottom;
|
|
@@ -6412,7 +6412,7 @@ class qe extends Kt {
|
|
|
6412
6412
|
} else c || ({ dom: c, contentDOM: f } = kt.renderSpec(document, n.type.spec.toDOM(n), null, n.attrs));
|
|
6413
6413
|
!f && !n.isText && c.nodeName != "BR" && (c.hasAttribute("contenteditable") || (c.contentEditable = "false"), n.type.spec.draggable && (c.draggable = !0));
|
|
6414
6414
|
let p = c;
|
|
6415
|
-
return c = Ps(c, r, n), a ? l = new Ha(e, n, r, u, c, f || null, p, a, i, s + 1) : n.isText ? new
|
|
6415
|
+
return c = Ps(c, r, n), a ? l = new Ha(e, n, r, u, c, f || null, p, a, i, s + 1) : n.isText ? new Fn(e, n, r, u, c, p, i) : new qe(e, n, r, u, c, f || null, p, i, s + 1);
|
|
6416
6416
|
}
|
|
6417
6417
|
parseRule() {
|
|
6418
6418
|
if (this.node.type.spec.reparseInView)
|
|
@@ -6430,12 +6430,12 @@ class qe extends Kt {
|
|
|
6430
6430
|
break;
|
|
6431
6431
|
}
|
|
6432
6432
|
}
|
|
6433
|
-
e.contentElement || (e.getContent = () =>
|
|
6433
|
+
e.contentElement || (e.getContent = () => k.empty);
|
|
6434
6434
|
}
|
|
6435
6435
|
return e;
|
|
6436
6436
|
}
|
|
6437
6437
|
matchesNode(e, n, r) {
|
|
6438
|
-
return this.dirty == ie && e.eq(this.node) &&
|
|
6438
|
+
return this.dirty == ie && e.eq(this.node) && bn(n, this.outerDeco) && r.eq(this.innerDeco);
|
|
6439
6439
|
}
|
|
6440
6440
|
get size() {
|
|
6441
6441
|
return this.node.nodeSize;
|
|
@@ -6493,7 +6493,7 @@ class qe extends Kt {
|
|
|
6493
6493
|
this.updateOuterDeco(n), this.node = e, this.innerDeco = r, this.contentDOM && this.updateChildren(u, this.posAtStart), this.dirty = ie;
|
|
6494
6494
|
}
|
|
6495
6495
|
updateOuterDeco(e) {
|
|
6496
|
-
if (
|
|
6496
|
+
if (bn(e, this.outerDeco))
|
|
6497
6497
|
return;
|
|
6498
6498
|
let n = this.nodeDOM.nodeType != 1, r = this.dom;
|
|
6499
6499
|
this.dom = zs(this.dom, this.nodeDOM, Tr(this.outerDeco, this.node, n), Tr(e, this.node, n)), this.dom != r && (r.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
|
|
@@ -6515,7 +6515,7 @@ function qu(t, e, n, r, u) {
|
|
|
6515
6515
|
let i = new qe(void 0, t, e, n, r, r, r, u, 0);
|
|
6516
6516
|
return i.contentDOM && i.updateChildren(u, 0), i;
|
|
6517
6517
|
}
|
|
6518
|
-
class
|
|
6518
|
+
class Fn extends qe {
|
|
6519
6519
|
constructor(e, n, r, u, i, s, o) {
|
|
6520
6520
|
super(e, n, r, u, i, null, s, o, 0);
|
|
6521
6521
|
}
|
|
@@ -6546,7 +6546,7 @@ class Nn extends qe {
|
|
|
6546
6546
|
}
|
|
6547
6547
|
slice(e, n, r) {
|
|
6548
6548
|
let u = this.node.cut(e, n), i = document.createTextNode(u.text);
|
|
6549
|
-
return new
|
|
6549
|
+
return new Fn(this.parent, u, this.outerDeco, this.innerDeco, i, i, r);
|
|
6550
6550
|
}
|
|
6551
6551
|
markDirty(e, n) {
|
|
6552
6552
|
super.markDirty(e, n), this.dom != this.nodeDOM && (e == 0 || n == this.nodeDOM.nodeValue.length) && (this.dirty = Ce);
|
|
@@ -6685,7 +6685,7 @@ function Ja(t, e, n) {
|
|
|
6685
6685
|
function Ps(t, e, n) {
|
|
6686
6686
|
return zs(t, t, Ze, Tr(e, n, t.nodeType != 1));
|
|
6687
6687
|
}
|
|
6688
|
-
function
|
|
6688
|
+
function bn(t, e) {
|
|
6689
6689
|
if (t.length != e.length)
|
|
6690
6690
|
return !1;
|
|
6691
6691
|
for (let n = 0; n < t.length; n++)
|
|
@@ -6787,7 +6787,7 @@ class ja {
|
|
|
6787
6787
|
let a = this.preMatch.matched.get(l);
|
|
6788
6788
|
if (a != null && a != i)
|
|
6789
6789
|
return !1;
|
|
6790
|
-
let c = l.dom, f, p = this.isLocked(c) && !(e.isText && l.node && l.node.isText && l.nodeDOM.nodeValue == e.text && l.dirty != Ce &&
|
|
6790
|
+
let c = l.dom, f, p = this.isLocked(c) && !(e.isText && l.node && l.node.isText && l.nodeDOM.nodeValue == e.text && l.dirty != Ce && bn(n, l.outerDeco));
|
|
6791
6791
|
if (!p && l.update(e, n, r, u))
|
|
6792
6792
|
return this.destroyBetween(this.index, o), l.dom != c && (this.changed = !0), this.index++, !0;
|
|
6793
6793
|
if (!p && (f = this.recreateWrapper(l, e, n, r, u, s)))
|
|
@@ -6800,7 +6800,7 @@ class ja {
|
|
|
6800
6800
|
// When a node with content is replaced by a different node with
|
|
6801
6801
|
// identical content, move over its children.
|
|
6802
6802
|
recreateWrapper(e, n, r, u, i, s) {
|
|
6803
|
-
if (e.dirty || n.isAtom || !e.children.length || !e.node.content.eq(n.content) || !
|
|
6803
|
+
if (e.dirty || n.isAtom || !e.children.length || !e.node.content.eq(n.content) || !bn(r, e.outerDeco) || !u.eq(e.innerDeco))
|
|
6804
6804
|
return null;
|
|
6805
6805
|
let o = qe.create(this.top, n, r, u, i, s);
|
|
6806
6806
|
if (o.contentDOM) {
|
|
@@ -6831,7 +6831,7 @@ class ja {
|
|
|
6831
6831
|
for (; e instanceof ut; )
|
|
6832
6832
|
n = e, e = n.children[n.children.length - 1];
|
|
6833
6833
|
(!e || // Empty textblock
|
|
6834
|
-
!(e instanceof
|
|
6834
|
+
!(e instanceof Fn) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((U || H) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", n), this.addHackNode("BR", this.top));
|
|
6835
6835
|
}
|
|
6836
6836
|
addHackNode(e, n) {
|
|
6837
6837
|
if (n == this.top && this.index < n.children.length && n.children[this.index].matchesHack(e))
|
|
@@ -6971,7 +6971,7 @@ function jr(t, e = null) {
|
|
|
6971
6971
|
if (s < 0)
|
|
6972
6972
|
return null;
|
|
6973
6973
|
let o = r.resolve(s), l, a;
|
|
6974
|
-
if (
|
|
6974
|
+
if (On(n)) {
|
|
6975
6975
|
for (l = s; u && !u.node; )
|
|
6976
6976
|
u = u.parent;
|
|
6977
6977
|
let f = u.node;
|
|
@@ -7027,15 +7027,15 @@ const $u = U || H && Ms < 63;
|
|
|
7027
7027
|
function Wu(t, e) {
|
|
7028
7028
|
let { node: n, offset: r } = t.docView.domFromPos(e, 0), u = r < n.childNodes.length ? n.childNodes[r] : null, i = r ? n.childNodes[r - 1] : null;
|
|
7029
7029
|
if (U && u && u.contentEditable == "false")
|
|
7030
|
-
return
|
|
7030
|
+
return Yn(u);
|
|
7031
7031
|
if ((!u || u.contentEditable == "false") && (!i || i.contentEditable == "false")) {
|
|
7032
7032
|
if (u)
|
|
7033
|
-
return
|
|
7033
|
+
return Yn(u);
|
|
7034
7034
|
if (i)
|
|
7035
|
-
return
|
|
7035
|
+
return Yn(i);
|
|
7036
7036
|
}
|
|
7037
7037
|
}
|
|
7038
|
-
function
|
|
7038
|
+
function Yn(t) {
|
|
7039
7039
|
return t.contentEditable = "true", U && t.draggable && (t.draggable = !1, t.wasDraggable = !0), t;
|
|
7040
7040
|
}
|
|
7041
7041
|
function Hu(t) {
|
|
@@ -7125,7 +7125,7 @@ function Uu(t, e, n) {
|
|
|
7125
7125
|
}
|
|
7126
7126
|
}
|
|
7127
7127
|
}
|
|
7128
|
-
function
|
|
7128
|
+
function xn(t) {
|
|
7129
7129
|
return t.nodeType == 3 ? t.nodeValue.length : t.childNodes.length;
|
|
7130
7130
|
}
|
|
7131
7131
|
function Nt(t, e) {
|
|
@@ -7140,7 +7140,7 @@ function tc(t) {
|
|
|
7140
7140
|
if (!n)
|
|
7141
7141
|
return;
|
|
7142
7142
|
let u, i, s = !1;
|
|
7143
|
-
for (ue && n.nodeType == 1 && r <
|
|
7143
|
+
for (ue && n.nodeType == 1 && r < xn(n) && Nt(n.childNodes[r], -1) && (s = !0); ; )
|
|
7144
7144
|
if (r > 0) {
|
|
7145
7145
|
if (n.nodeType != 1)
|
|
7146
7146
|
break;
|
|
@@ -7161,7 +7161,7 @@ function tc(t) {
|
|
|
7161
7161
|
for (; o && Nt(o, -1); )
|
|
7162
7162
|
u = n.parentNode, i = q(o), o = o.previousSibling;
|
|
7163
7163
|
if (o)
|
|
7164
|
-
n = o, r =
|
|
7164
|
+
n = o, r = xn(n);
|
|
7165
7165
|
else {
|
|
7166
7166
|
if (n = n.parentNode, n == t.dom)
|
|
7167
7167
|
break;
|
|
@@ -7175,7 +7175,7 @@ function nc(t) {
|
|
|
7175
7175
|
let e = t.domSelectionRange(), n = e.focusNode, r = e.focusOffset;
|
|
7176
7176
|
if (!n)
|
|
7177
7177
|
return;
|
|
7178
|
-
let u =
|
|
7178
|
+
let u = xn(n), i, s;
|
|
7179
7179
|
for (; ; )
|
|
7180
7180
|
if (r < u) {
|
|
7181
7181
|
if (n.nodeType != 1)
|
|
@@ -7193,7 +7193,7 @@ function nc(t) {
|
|
|
7193
7193
|
for (; o && Nt(o, 1); )
|
|
7194
7194
|
i = o.parentNode, s = q(o) + 1, o = o.nextSibling;
|
|
7195
7195
|
if (o)
|
|
7196
|
-
n = o, r = 0, u =
|
|
7196
|
+
n = o, r = 0, u = xn(n);
|
|
7197
7197
|
else {
|
|
7198
7198
|
if (n = n.parentNode, n == t.dom)
|
|
7199
7199
|
break;
|
|
@@ -7239,7 +7239,7 @@ function Nr(t, e, n) {
|
|
|
7239
7239
|
let r = t.domSelection();
|
|
7240
7240
|
if (!r)
|
|
7241
7241
|
return;
|
|
7242
|
-
if (
|
|
7242
|
+
if (On(r)) {
|
|
7243
7243
|
let i = document.createRange();
|
|
7244
7244
|
i.setEnd(e, n), i.setStart(e, n), r.removeAllRanges(), r.addRange(i);
|
|
7245
7245
|
} else r.extend && r.extend(e, n);
|
|
@@ -7377,7 +7377,7 @@ function Ws(t, e, n, r, u) {
|
|
|
7377
7377
|
if (t.someProp("transformPastedText", (p) => {
|
|
7378
7378
|
e = p(e, i || r, t);
|
|
7379
7379
|
}), i)
|
|
7380
|
-
return o = new D(
|
|
7380
|
+
return o = new D(k.from(t.state.schema.text(e.replace(/\r\n?/g, `
|
|
7381
7381
|
`))), 0, 0), t.someProp("transformPasted", (p) => {
|
|
7382
7382
|
o = p(o, t, !0);
|
|
7383
7383
|
}), o;
|
|
@@ -7445,13 +7445,13 @@ function ac(t, e) {
|
|
|
7445
7445
|
s.push(c), u = u.matchType(c.type), i = l;
|
|
7446
7446
|
}
|
|
7447
7447
|
}), s)
|
|
7448
|
-
return
|
|
7448
|
+
return k.from(s);
|
|
7449
7449
|
}
|
|
7450
7450
|
return t;
|
|
7451
7451
|
}
|
|
7452
7452
|
function Hs(t, e, n = 0) {
|
|
7453
7453
|
for (let r = e.length - 1; r >= n; r--)
|
|
7454
|
-
t = e[r].create(null,
|
|
7454
|
+
t = e[r].create(null, k.from(t));
|
|
7455
7455
|
return t;
|
|
7456
7456
|
}
|
|
7457
7457
|
function Js(t, e, n, r, u) {
|
|
@@ -7460,18 +7460,18 @@ function Js(t, e, n, r, u) {
|
|
|
7460
7460
|
if (i)
|
|
7461
7461
|
return r.copy(r.content.replaceChild(r.childCount - 1, i));
|
|
7462
7462
|
if (r.contentMatchAt(r.childCount).matchType(u == t.length - 1 ? n.type : t[u + 1]))
|
|
7463
|
-
return r.copy(r.content.append(
|
|
7463
|
+
return r.copy(r.content.append(k.from(Hs(n, t, u + 1))));
|
|
7464
7464
|
}
|
|
7465
7465
|
}
|
|
7466
7466
|
function js(t, e) {
|
|
7467
7467
|
if (e == 0)
|
|
7468
7468
|
return t;
|
|
7469
|
-
let n = t.content.replaceChild(t.childCount - 1, js(t.lastChild, e - 1)), r = t.contentMatchAt(t.childCount).fillBefore(
|
|
7469
|
+
let n = t.content.replaceChild(t.childCount - 1, js(t.lastChild, e - 1)), r = t.contentMatchAt(t.childCount).fillBefore(k.empty, !0);
|
|
7470
7470
|
return t.copy(n.append(r));
|
|
7471
7471
|
}
|
|
7472
7472
|
function Ir(t, e, n, r, u, i) {
|
|
7473
7473
|
let s = e < 0 ? t.firstChild : t.lastChild, o = s.content;
|
|
7474
|
-
return t.childCount > 1 && (i = 0), u < r - 1 && (o = Ir(o, e, n, r, u + 1, i)), u >= n && (o = e < 0 ? s.contentMatchAt(0).fillBefore(o, i <= u).append(o) : o.append(s.contentMatchAt(s.childCount).fillBefore(
|
|
7474
|
+
return t.childCount > 1 && (i = 0), u < r - 1 && (o = Ir(o, e, n, r, u + 1, i)), u >= n && (o = e < 0 ? s.contentMatchAt(0).fillBefore(o, i <= u).append(o) : o.append(s.contentMatchAt(s.childCount).fillBefore(k.empty, !0))), t.replaceChild(e < 0 ? 0 : t.childCount - 1, s.copy(o));
|
|
7475
7475
|
}
|
|
7476
7476
|
function Xu(t, e, n) {
|
|
7477
7477
|
return e < t.openStart && (t = new D(Ir(t.content, -1, e, t.openStart, 0, t.openEnd), e, t.openEnd)), n < t.openEnd && (t = new D(Ir(t.content, 1, n, t.openEnd, 0, 0), t.openStart, n)), t;
|
|
@@ -7491,10 +7491,10 @@ let Qu = null;
|
|
|
7491
7491
|
function Ks() {
|
|
7492
7492
|
return Qu || (Qu = document.implementation.createHTMLDocument("title"));
|
|
7493
7493
|
}
|
|
7494
|
-
let
|
|
7494
|
+
let Xn = null;
|
|
7495
7495
|
function cc(t) {
|
|
7496
7496
|
let e = window.trustedTypes;
|
|
7497
|
-
return e ? (
|
|
7497
|
+
return e ? (Xn || (Xn = e.defaultPolicy || e.createPolicy("ProseMirrorClipboard", { createHTML: (n) => n })), Xn.createHTML(t)) : t;
|
|
7498
7498
|
}
|
|
7499
7499
|
function fc(t) {
|
|
7500
7500
|
let e = /^(\s*<meta [^>]*>)*/.exec(t);
|
|
@@ -7526,7 +7526,7 @@ function hc(t, e) {
|
|
|
7526
7526
|
let l = n.nodes[r[o]];
|
|
7527
7527
|
if (!l || l.hasRequiredAttrs())
|
|
7528
7528
|
break;
|
|
7529
|
-
u =
|
|
7529
|
+
u = k.from(l.create(r[o + 1], u)), i++, s++;
|
|
7530
7530
|
}
|
|
7531
7531
|
return new D(u, i, s);
|
|
7532
7532
|
}
|
|
@@ -7606,7 +7606,7 @@ Z.keypress = (t, e) => {
|
|
|
7606
7606
|
!/[\r\n]/.test(u) && !t.someProp("handleTextInput", (s) => s(t, r.$from.pos, r.$to.pos, u, i)) && t.dispatch(i()), n.preventDefault();
|
|
7607
7607
|
}
|
|
7608
7608
|
};
|
|
7609
|
-
function
|
|
7609
|
+
function Nn(t) {
|
|
7610
7610
|
return { left: t.clientX, top: t.clientY };
|
|
7611
7611
|
}
|
|
7612
7612
|
function yc(t, e) {
|
|
@@ -7677,7 +7677,7 @@ function Ac(t, e, n) {
|
|
|
7677
7677
|
}
|
|
7678
7678
|
}
|
|
7679
7679
|
function Yr(t) {
|
|
7680
|
-
return
|
|
7680
|
+
return kn(t);
|
|
7681
7681
|
}
|
|
7682
7682
|
const Zs = ne ? "metaKey" : "ctrlKey";
|
|
7683
7683
|
K.mousedown = (t, e) => {
|
|
@@ -7685,7 +7685,7 @@ K.mousedown = (t, e) => {
|
|
|
7685
7685
|
t.input.shiftKey = n.shiftKey;
|
|
7686
7686
|
let r = Yr(t), u = Date.now(), i = "singleClick";
|
|
7687
7687
|
u - t.input.lastClick.time < 500 && yc(n, t.input.lastClick) && !n[Zs] && t.input.lastClick.button == n.button && (t.input.lastClick.type == "singleClick" ? i = "doubleClick" : t.input.lastClick.type == "doubleClick" && (i = "tripleClick")), t.input.lastClick = { time: u, x: n.clientX, y: n.clientY, type: i, button: n.button };
|
|
7688
|
-
let s = t.posAtCoords(
|
|
7688
|
+
let s = t.posAtCoords(Nn(n));
|
|
7689
7689
|
s && (i == "singleClick" ? (t.input.mouseDown && t.input.mouseDown.done(), t.input.mouseDown = new Mc(t, s, n, !!r)) : (i == "doubleClick" ? Ec : Sc)(t, s.pos, s.inside, n) ? n.preventDefault() : ze(t, "pointer"));
|
|
7690
7690
|
};
|
|
7691
7691
|
class Mc {
|
|
@@ -7717,7 +7717,7 @@ class Mc {
|
|
|
7717
7717
|
if (this.done(), !this.view.dom.contains(e.target))
|
|
7718
7718
|
return;
|
|
7719
7719
|
let n = this.pos;
|
|
7720
|
-
this.view.state.doc != this.startDoc && (n = this.view.posAtCoords(
|
|
7720
|
+
this.view.state.doc != this.startDoc && (n = this.view.posAtCoords(Nn(e))), this.updateAllowDefault(e), this.allowDefault || !n ? ze(this.view, "pointer") : _c(this.view, n.pos, n.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
|
|
7721
7721
|
U && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
|
|
7722
7722
|
// cursor, but still report that the node is selected
|
|
7723
7723
|
// when asked through getSelection. You'll then get a
|
|
@@ -7750,8 +7750,8 @@ Z.compositionstart = Z.compositionupdate = (t) => {
|
|
|
7750
7750
|
t.domObserver.flush();
|
|
7751
7751
|
let { state: e } = t, n = e.selection.$to;
|
|
7752
7752
|
if (e.selection instanceof F && (e.storedMarks || !n.textOffset && n.parentOffset && n.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1)))
|
|
7753
|
-
t.markCursor = t.state.storedMarks || n.marks(),
|
|
7754
|
-
else if (
|
|
7753
|
+
t.markCursor = t.state.storedMarks || n.marks(), kn(t, !0), t.markCursor = null;
|
|
7754
|
+
else if (kn(t, !e.selection.empty), ue && e.selection.empty && n.parentOffset && !n.textOffset && n.nodeBefore.marks.length) {
|
|
7755
7755
|
let r = t.domSelectionRange();
|
|
7756
7756
|
for (let u = r.focusNode, i = r.focusOffset; u && u.nodeType == 1 && i != 0; ) {
|
|
7757
7757
|
let s = i < 0 ? u.lastChild : u.childNodes[i - 1];
|
|
@@ -7773,7 +7773,7 @@ Z.compositionend = (t, e) => {
|
|
|
7773
7773
|
t.composing && (t.input.composing = !1, t.input.compositionEndedAt = e.timeStamp, t.input.compositionPendingChanges = t.domObserver.pendingRecords().length ? t.input.compositionID : 0, t.input.compositionNode = null, t.input.compositionPendingChanges && Promise.resolve().then(() => t.domObserver.flush()), t.input.compositionID++, Ys(t, 20));
|
|
7774
7774
|
};
|
|
7775
7775
|
function Ys(t, e) {
|
|
7776
|
-
clearTimeout(t.input.composingTimeout), e > -1 && (t.input.composingTimeout = setTimeout(() =>
|
|
7776
|
+
clearTimeout(t.input.composingTimeout), e > -1 && (t.input.composingTimeout = setTimeout(() => kn(t), e));
|
|
7777
7777
|
}
|
|
7778
7778
|
function Xs(t) {
|
|
7779
7779
|
for (t.composing && (t.input.composing = !1, t.input.compositionEndedAt = Oc()); t.input.compositionNodes.length > 0; )
|
|
@@ -7802,7 +7802,7 @@ function Oc() {
|
|
|
7802
7802
|
let t = document.createEvent("Event");
|
|
7803
7803
|
return t.initEvent("event", !0, !0), t.timeStamp;
|
|
7804
7804
|
}
|
|
7805
|
-
function
|
|
7805
|
+
function kn(t, e = !1) {
|
|
7806
7806
|
if (!(Ae && t.domObserver.flushingSoon >= 0)) {
|
|
7807
7807
|
if (t.domObserver.forceFlush(), Xs(t), e || t.docView && t.docView.dirty) {
|
|
7808
7808
|
let n = jr(t), r = t.state.selection;
|
|
@@ -7879,7 +7879,7 @@ K.dragstart = (t, e) => {
|
|
|
7879
7879
|
let n = e, r = t.input.mouseDown;
|
|
7880
7880
|
if (r && r.done(), !n.dataTransfer)
|
|
7881
7881
|
return;
|
|
7882
|
-
let u = t.state.selection, i = u.empty ? null : t.posAtCoords(
|
|
7882
|
+
let u = t.state.selection, i = u.empty ? null : t.posAtCoords(Nn(n)), s;
|
|
7883
7883
|
if (!(i && i.pos >= u.from && i.pos <= (u instanceof A ? u.to - 1 : u.to))) {
|
|
7884
7884
|
if (r && r.mightDrag)
|
|
7885
7885
|
s = A.create(t.state.doc, r.mightDrag.pos);
|
|
@@ -7902,7 +7902,7 @@ Z.drop = (t, e) => {
|
|
|
7902
7902
|
let n = e, r = t.dragging;
|
|
7903
7903
|
if (t.dragging = null, !n.dataTransfer)
|
|
7904
7904
|
return;
|
|
7905
|
-
let u = t.posAtCoords(
|
|
7905
|
+
let u = t.posAtCoords(Nn(n));
|
|
7906
7906
|
if (!u)
|
|
7907
7907
|
return;
|
|
7908
7908
|
let i = t.state.doc.resolve(u.pos), s = r && r.slice;
|
|
@@ -7970,7 +7970,7 @@ function Vt(t, e) {
|
|
|
7970
7970
|
return !1;
|
|
7971
7971
|
return !0;
|
|
7972
7972
|
}
|
|
7973
|
-
class
|
|
7973
|
+
class yn {
|
|
7974
7974
|
constructor(e, n) {
|
|
7975
7975
|
this.toDOM = e, this.spec = n || Xe, this.side = this.spec.side || 0;
|
|
7976
7976
|
}
|
|
@@ -7982,7 +7982,7 @@ class Cn {
|
|
|
7982
7982
|
return !0;
|
|
7983
7983
|
}
|
|
7984
7984
|
eq(e) {
|
|
7985
|
-
return this == e || e instanceof
|
|
7985
|
+
return this == e || e instanceof yn && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && Vt(this.spec, e.spec));
|
|
7986
7986
|
}
|
|
7987
7987
|
destroy(e) {
|
|
7988
7988
|
this.spec.destroy && this.spec.destroy(e);
|
|
@@ -8063,7 +8063,7 @@ class ce {
|
|
|
8063
8063
|
widget's current document position.
|
|
8064
8064
|
*/
|
|
8065
8065
|
static widget(e, n, r) {
|
|
8066
|
-
return new ce(e, e, new
|
|
8066
|
+
return new ce(e, e, new yn(n, r));
|
|
8067
8067
|
}
|
|
8068
8068
|
/**
|
|
8069
8069
|
Creates an inline decoration, which adds the given attributes to
|
|
@@ -8097,7 +8097,7 @@ class ce {
|
|
|
8097
8097
|
@internal
|
|
8098
8098
|
*/
|
|
8099
8099
|
get widget() {
|
|
8100
|
-
return this.type instanceof
|
|
8100
|
+
return this.type instanceof yn;
|
|
8101
8101
|
}
|
|
8102
8102
|
}
|
|
8103
8103
|
const at = [], Xe = {};
|
|
@@ -8114,7 +8114,7 @@ class v {
|
|
|
8114
8114
|
you must make a copy if you want need to preserve that.
|
|
8115
8115
|
*/
|
|
8116
8116
|
static create(e, n) {
|
|
8117
|
-
return n.length ?
|
|
8117
|
+
return n.length ? Cn(n, e, 0, Xe) : $;
|
|
8118
8118
|
}
|
|
8119
8119
|
/**
|
|
8120
8120
|
Find all decorations in this set which touch the given range
|
|
@@ -8173,7 +8173,7 @@ class v {
|
|
|
8173
8173
|
if (c = ro(n, o, a)) {
|
|
8174
8174
|
for (u || (u = this.children.slice()); i < u.length && u[i] < l; )
|
|
8175
8175
|
i += 3;
|
|
8176
|
-
u[i] == l ? u[i + 2] = u[i + 2].addInner(o, c, a + 1) : u.splice(i, 0, l, l + o.nodeSize,
|
|
8176
|
+
u[i] == l ? u[i + 2] = u[i + 2].addInner(o, c, a + 1) : u.splice(i, 0, l, l + o.nodeSize, Cn(c, o, a + 1, Xe)), i += 3;
|
|
8177
8177
|
}
|
|
8178
8178
|
});
|
|
8179
8179
|
let s = no(i ? uo(n) : n, -r);
|
|
@@ -8343,8 +8343,8 @@ function Bc(t, e, n, r, u, i, s) {
|
|
|
8343
8343
|
let x = o[b + 1];
|
|
8344
8344
|
if (x < 0 || p > x + c - f)
|
|
8345
8345
|
continue;
|
|
8346
|
-
let
|
|
8347
|
-
h >=
|
|
8346
|
+
let y = o[b] + c - f;
|
|
8347
|
+
h >= y ? o[b + 1] = p <= y ? -2 : -1 : p >= c && g && (o[b] += g, o[b + 1] += g);
|
|
8348
8348
|
}
|
|
8349
8349
|
f += g;
|
|
8350
8350
|
}), c = n.maps[a].map(c, -1);
|
|
@@ -8369,7 +8369,7 @@ function Bc(t, e, n, r, u, i, s) {
|
|
|
8369
8369
|
l = !0;
|
|
8370
8370
|
}
|
|
8371
8371
|
if (l) {
|
|
8372
|
-
let a = vc(o, t, e, n, u, i, s), c =
|
|
8372
|
+
let a = vc(o, t, e, n, u, i, s), c = Cn(a, r, 0, s);
|
|
8373
8373
|
e = c.local;
|
|
8374
8374
|
for (let f = 0; f < o.length; f += 3)
|
|
8375
8375
|
o[f + 1] < 0 && (o.splice(f, 3), f -= 3);
|
|
@@ -8419,13 +8419,13 @@ function uo(t) {
|
|
|
8419
8419
|
t[n] != null && e.push(t[n]);
|
|
8420
8420
|
return e;
|
|
8421
8421
|
}
|
|
8422
|
-
function
|
|
8422
|
+
function Cn(t, e, n, r) {
|
|
8423
8423
|
let u = [], i = !1;
|
|
8424
8424
|
e.forEach((o, l) => {
|
|
8425
8425
|
let a = ro(t, o, l + n);
|
|
8426
8426
|
if (a) {
|
|
8427
8427
|
i = !0;
|
|
8428
|
-
let c =
|
|
8428
|
+
let c = Cn(a, o, n + l + 1, r);
|
|
8429
8429
|
c != $ && u.push(l, l + o.nodeSize, c);
|
|
8430
8430
|
}
|
|
8431
8431
|
});
|
|
@@ -8460,7 +8460,7 @@ function ei(t, e, n) {
|
|
|
8460
8460
|
e++;
|
|
8461
8461
|
t.splice(e, 0, n);
|
|
8462
8462
|
}
|
|
8463
|
-
function
|
|
8463
|
+
function Qn(t) {
|
|
8464
8464
|
let e = [];
|
|
8465
8465
|
return t.someProp("decorations", (n) => {
|
|
8466
8466
|
let r = n(t.state);
|
|
@@ -8596,7 +8596,7 @@ class qc {
|
|
|
8596
8596
|
}
|
|
8597
8597
|
}
|
|
8598
8598
|
let a = null;
|
|
8599
|
-
i < 0 && u && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 &&
|
|
8599
|
+
i < 0 && u && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && On(r) && (a = jr(e)) && a.eq(O.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Me(e), this.currentSelection.set(r), e.scrollToSelection()) : (i > -1 || u) && (i > -1 && (e.docView.markDirty(i, s), Vc(e)), this.handleDOMChange(i, s, o, l), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || Me(e), this.currentSelection.set(r));
|
|
8600
8600
|
}
|
|
8601
8601
|
registerMutation(e, n) {
|
|
8602
8602
|
if (n.indexOf(e.target) > -1)
|
|
@@ -8665,7 +8665,7 @@ function Wc(t, e) {
|
|
|
8665
8665
|
}
|
|
8666
8666
|
function Hc(t, e, n) {
|
|
8667
8667
|
let { node: r, fromOffset: u, toOffset: i, from: s, to: o } = t.docView.parseRange(e, n), l = t.domSelectionRange(), a, c = l.anchorNode;
|
|
8668
|
-
if (c && t.dom.contains(c.nodeType == 1 ? c : c.parentNode) && (a = [{ node: c, offset: l.anchorOffset }],
|
|
8668
|
+
if (c && t.dom.contains(c.nodeType == 1 ? c : c.parentNode) && (a = [{ node: c, offset: l.anchorOffset }], On(l) || a.push({ node: l.focusNode, offset: l.focusOffset })), H && t.input.lastKeyCode === 8)
|
|
8669
8669
|
for (let g = i; g > u; g--) {
|
|
8670
8670
|
let b = r.childNodes[g - 1], x = b.pmViewDesc;
|
|
8671
8671
|
if (b.nodeName == "BR" && !x) {
|
|
@@ -8756,28 +8756,28 @@ function Uc(t, e, n, r, u) {
|
|
|
8756
8756
|
return _(t, je(13, "Enter"));
|
|
8757
8757
|
});
|
|
8758
8758
|
}, 20));
|
|
8759
|
-
let
|
|
8760
|
-
let w = _ || t.state.tr.replace(
|
|
8759
|
+
let y = d.start, C = d.endA, S = (_) => {
|
|
8760
|
+
let w = _ || t.state.tr.replace(y, C, a.doc.slice(d.start - a.from, d.endB - a.from));
|
|
8761
8761
|
if (a.sel) {
|
|
8762
8762
|
let T = ui(t, w.doc, a.sel);
|
|
8763
|
-
T && !(H && t.composing && T.empty && (d.start != d.endB || t.input.lastChromeDelete < Date.now() - 100) && (T.head ==
|
|
8763
|
+
T && !(H && t.composing && T.empty && (d.start != d.endB || t.input.lastChromeDelete < Date.now() - 100) && (T.head == y || T.head == w.mapping.map(C) - 1) || G && T.empty && T.head == y) && w.setSelection(T);
|
|
8764
8764
|
}
|
|
8765
8765
|
return i && w.setMeta("composition", i), w.scrollIntoView();
|
|
8766
8766
|
}, E;
|
|
8767
8767
|
if (x)
|
|
8768
8768
|
if (m.pos == g.pos) {
|
|
8769
8769
|
G && Le <= 11 && m.parentOffset == 0 && (t.domObserver.suppressSelectionUpdates(), setTimeout(() => Me(t), 20));
|
|
8770
|
-
let _ = S(t.state.tr.delete(
|
|
8770
|
+
let _ = S(t.state.tr.delete(y, C)), w = c.resolve(d.start).marksAcross(c.resolve(d.endA));
|
|
8771
8771
|
w && _.ensureMarks(w), t.dispatch(_);
|
|
8772
8772
|
} else if (
|
|
8773
8773
|
// Adding or removing a mark
|
|
8774
8774
|
d.endA == d.endB && (E = Kc(m.parent.content.cut(m.parentOffset, g.parentOffset), b.parent.content.cut(b.parentOffset, d.endA - b.start())))
|
|
8775
8775
|
) {
|
|
8776
8776
|
let _ = S(t.state.tr);
|
|
8777
|
-
E.type == "add" ? _.addMark(
|
|
8777
|
+
E.type == "add" ? _.addMark(y, C, E.mark) : _.removeMark(y, C, E.mark), t.dispatch(_);
|
|
8778
8778
|
} else if (m.parent.child(m.index()).isText && m.index() == g.index() - (g.textOffset ? 0 : 1)) {
|
|
8779
|
-
let _ = m.parent.textBetween(m.parentOffset, g.parentOffset), w = () => S(t.state.tr.insertText(_,
|
|
8780
|
-
t.someProp("handleTextInput", (T) => T(t,
|
|
8779
|
+
let _ = m.parent.textBetween(m.parentOffset, g.parentOffset), w = () => S(t.state.tr.insertText(_, y, C));
|
|
8780
|
+
t.someProp("handleTextInput", (T) => T(t, y, C, _, w)) || t.dispatch(w());
|
|
8781
8781
|
} else
|
|
8782
8782
|
t.dispatch(S());
|
|
8783
8783
|
else
|
|
@@ -8801,14 +8801,14 @@ function Kc(t, e) {
|
|
|
8801
8801
|
let a = [];
|
|
8802
8802
|
for (let c = 0; c < e.childCount; c++)
|
|
8803
8803
|
a.push(l(e.child(c)));
|
|
8804
|
-
if (
|
|
8804
|
+
if (k.from(a).eq(t))
|
|
8805
8805
|
return { mark: o, type: s };
|
|
8806
8806
|
}
|
|
8807
8807
|
function Zc(t, e, n, r, u) {
|
|
8808
8808
|
if (
|
|
8809
8809
|
// The content must have shrunk
|
|
8810
8810
|
n - e <= u.pos - r.pos || // newEnd must point directly at or after the end of the block that newStart points into
|
|
8811
|
-
|
|
8811
|
+
er(r, !0, !1) < u.pos
|
|
8812
8812
|
)
|
|
8813
8813
|
return !1;
|
|
8814
8814
|
let i = t.resolve(e);
|
|
@@ -8818,10 +8818,10 @@ function Zc(t, e, n, r, u) {
|
|
|
8818
8818
|
}
|
|
8819
8819
|
if (i.parentOffset < i.parent.content.size || !i.parent.isTextblock)
|
|
8820
8820
|
return !1;
|
|
8821
|
-
let s = t.resolve(
|
|
8822
|
-
return !s.parent.isTextblock || s.pos > n ||
|
|
8821
|
+
let s = t.resolve(er(i, !0, !0));
|
|
8822
|
+
return !s.parent.isTextblock || s.pos > n || er(s, !0, !1) < n ? !1 : r.parent.content.cut(r.parentOffset).eq(s.parent.content);
|
|
8823
8823
|
}
|
|
8824
|
-
function
|
|
8824
|
+
function er(t, e, n) {
|
|
8825
8825
|
let r = t.depth, u = e ? t.end() : t.pos;
|
|
8826
8826
|
for (; r > 0 && (e || t.indexAfter(r) == t.node(r).childCount); )
|
|
8827
8827
|
r--, u++, e = !1;
|
|
@@ -8865,7 +8865,7 @@ class io {
|
|
|
8865
8865
|
added to the document.
|
|
8866
8866
|
*/
|
|
8867
8867
|
constructor(e, n) {
|
|
8868
|
-
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 mc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = n, this.state = n.state, this.directPlugins = n.plugins || [], this.directPlugins.forEach(ci), 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 = li(this), oi(this), this.nodeViews = ai(this), this.docView = qu(this.state.doc, si(this),
|
|
8868
|
+
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 mc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = n, this.state = n.state, this.directPlugins = n.plugins || [], this.directPlugins.forEach(ci), 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 = li(this), oi(this), this.nodeViews = ai(this), this.docView = qu(this.state.doc, si(this), Qn(this), this.dom, this), this.domObserver = new qc(this, (r, u, i, s) => Uc(this, r, u, i, s)), this.domObserver.start(), gc(this), this.updatePluginViews();
|
|
8869
8869
|
}
|
|
8870
8870
|
/**
|
|
8871
8871
|
Holds `true` when a
|
|
@@ -8928,7 +8928,7 @@ class io {
|
|
|
8928
8928
|
Xc(h, this.nodeViews) && (this.nodeViews = h, i = !0);
|
|
8929
8929
|
}
|
|
8930
8930
|
(o || n.handleDOMEvents != this._props.handleDOMEvents) && Rr(this), this.editable = li(this), oi(this);
|
|
8931
|
-
let l =
|
|
8931
|
+
let l = Qn(this), a = si(this), c = u.plugins != e.plugins && !u.doc.eq(e.doc) ? "reset" : e.scrollToSelection > u.scrollToSelection ? "to selection" : "preserve", f = i || !this.docView.matchesNode(e.doc, a, l);
|
|
8932
8932
|
(f || !e.selection.eq(u.selection)) && (s = !0);
|
|
8933
8933
|
let p = c == "preserve" && s && this.dom.style.overflowAnchor == null && Oa(this);
|
|
8934
8934
|
if (s) {
|
|
@@ -9158,7 +9158,7 @@ class io {
|
|
|
9158
9158
|
views](https://prosemirror.net/docs/ref/#view.NodeView).
|
|
9159
9159
|
*/
|
|
9160
9160
|
destroy() {
|
|
9161
|
-
this.docView && (bc(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [],
|
|
9161
|
+
this.docView && (bc(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], Qn(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, ka());
|
|
9162
9162
|
}
|
|
9163
9163
|
/**
|
|
9164
9164
|
This is true when the view has been
|
|
@@ -9530,7 +9530,7 @@ function eu(t) {
|
|
|
9530
9530
|
let e = "";
|
|
9531
9531
|
return e += t.protocol || "", e += t.slashes ? "//" : "", e += t.auth ? t.auth + "@" : "", t.hostname && t.hostname.indexOf(":") !== -1 ? e += "[" + t.hostname + "]" : e += t.hostname || "", e += t.port ? ":" + t.port : "", e += t.pathname || "", e += t.search || "", e += t.hash || "", e;
|
|
9532
9532
|
}
|
|
9533
|
-
function
|
|
9533
|
+
function Dn() {
|
|
9534
9534
|
this.protocol = null, this.slashes = null, this.auth = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.pathname = null;
|
|
9535
9535
|
}
|
|
9536
9536
|
const d0 = /^([a-z0-9.+-]+:)/i, h0 = /:[0-9]*$/, p0 = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, m0 = ["<", ">", '"', "`", " ", "\r", `
|
|
@@ -9550,11 +9550,11 @@ const d0 = /^([a-z0-9.+-]+:)/i, h0 = /:[0-9]*$/, p0 = /^(\/\/?(?!\/)[^\?\s]*)(\?
|
|
|
9550
9550
|
"file:": !0
|
|
9551
9551
|
};
|
|
9552
9552
|
function tu(t, e) {
|
|
9553
|
-
if (t && t instanceof
|
|
9554
|
-
const n = new
|
|
9553
|
+
if (t && t instanceof Dn) return t;
|
|
9554
|
+
const n = new Dn();
|
|
9555
9555
|
return n.parse(t, e), n;
|
|
9556
9556
|
}
|
|
9557
|
-
|
|
9557
|
+
Dn.prototype.parse = function(t, e) {
|
|
9558
9558
|
let n, r, u, i = t;
|
|
9559
9559
|
if (i = i.trim(), !e && t.split("#").length === 1) {
|
|
9560
9560
|
const a = p0.exec(i);
|
|
@@ -9580,11 +9580,11 @@ _n.prototype.parse = function(t, e) {
|
|
|
9580
9580
|
const b = d[m];
|
|
9581
9581
|
if (b && !b.match(mi)) {
|
|
9582
9582
|
let x = "";
|
|
9583
|
-
for (let
|
|
9584
|
-
b.charCodeAt(
|
|
9583
|
+
for (let y = 0, C = b.length; y < C; y++)
|
|
9584
|
+
b.charCodeAt(y) > 127 ? x += "x" : x += b[y];
|
|
9585
9585
|
if (!x.match(mi)) {
|
|
9586
|
-
const
|
|
9587
|
-
S && (
|
|
9586
|
+
const y = d.slice(0, m), C = d.slice(m + 1), S = b.match(k0);
|
|
9587
|
+
S && (y.push(S[1]), C.unshift(S[2])), C.length && (i = C.join(".") + i), this.hostname = y.join(".");
|
|
9588
9588
|
break;
|
|
9589
9589
|
}
|
|
9590
9590
|
}
|
|
@@ -9597,7 +9597,7 @@ _n.prototype.parse = function(t, e) {
|
|
|
9597
9597
|
const l = i.indexOf("?");
|
|
9598
9598
|
return l !== -1 && (this.search = i.substr(l), i = i.slice(0, l)), i && (this.pathname = i), bi[n] && this.hostname && !this.pathname && (this.pathname = ""), this;
|
|
9599
9599
|
};
|
|
9600
|
-
|
|
9600
|
+
Dn.prototype.parseHost = function(t) {
|
|
9601
9601
|
let e = h0.exec(t);
|
|
9602
9602
|
e && (e = e[0], e !== ":" && (this.port = e.substr(1)), t = t.substr(0, t.length - e.length)), t && (this.hostname = t);
|
|
9603
9603
|
};
|
|
@@ -9622,7 +9622,7 @@ const y0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
9622
9622
|
// prettier-ignore
|
|
9623
9623
|
"Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((t) => t.charCodeAt(0))
|
|
9624
9624
|
);
|
|
9625
|
-
var
|
|
9625
|
+
var tr;
|
|
9626
9626
|
const S0 = /* @__PURE__ */ new Map([
|
|
9627
9627
|
[0, 65533],
|
|
9628
9628
|
// C1 Unicode control character reference replacements
|
|
@@ -9655,7 +9655,7 @@ const S0 = /* @__PURE__ */ new Map([
|
|
|
9655
9655
|
[159, 376]
|
|
9656
9656
|
]), A0 = (
|
|
9657
9657
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins
|
|
9658
|
-
(
|
|
9658
|
+
(tr = String.fromCodePoint) !== null && tr !== void 0 ? tr : function(t) {
|
|
9659
9659
|
let e = "";
|
|
9660
9660
|
return t > 65535 && (t -= 65536, e += String.fromCharCode(t >>> 10 & 1023 | 55296), t = 56320 | t & 1023), e += String.fromCharCode(t), e;
|
|
9661
9661
|
}
|
|
@@ -9938,7 +9938,7 @@ const v0 = Object.prototype.hasOwnProperty;
|
|
|
9938
9938
|
function z0(t, e) {
|
|
9939
9939
|
return v0.call(t, e);
|
|
9940
9940
|
}
|
|
9941
|
-
function
|
|
9941
|
+
function In(t) {
|
|
9942
9942
|
return Array.prototype.slice.call(arguments, 1).forEach(function(n) {
|
|
9943
9943
|
if (n) {
|
|
9944
9944
|
if (typeof n != "object")
|
|
@@ -9955,7 +9955,7 @@ function ho(t, e, n) {
|
|
|
9955
9955
|
function uu(t) {
|
|
9956
9956
|
return !(t >= 55296 && t <= 57343 || t >= 64976 && t <= 65007 || (t & 65535) === 65535 || (t & 65535) === 65534 || t >= 0 && t <= 8 || t === 11 || t >= 14 && t <= 31 || t >= 127 && t <= 159 || t > 1114111);
|
|
9957
9957
|
}
|
|
9958
|
-
function
|
|
9958
|
+
function _n(t) {
|
|
9959
9959
|
if (t > 65535) {
|
|
9960
9960
|
t -= 65536;
|
|
9961
9961
|
const e = 55296 + (t >> 10), n = 56320 + (t & 1023);
|
|
@@ -9967,7 +9967,7 @@ const po = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g, P0 = /&([a-z#][a-z0-9]{
|
|
|
9967
9967
|
function V0(t, e) {
|
|
9968
9968
|
if (e.charCodeAt(0) === 35 && q0.test(e)) {
|
|
9969
9969
|
const r = e[1].toLowerCase() === "x" ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10);
|
|
9970
|
-
return uu(r) ?
|
|
9970
|
+
return uu(r) ? _n(r) : t;
|
|
9971
9971
|
}
|
|
9972
9972
|
const n = fo(t);
|
|
9973
9973
|
return n !== t ? n : t;
|
|
@@ -10070,16 +10070,16 @@ function Ht(t) {
|
|
|
10070
10070
|
return !1;
|
|
10071
10071
|
}
|
|
10072
10072
|
}
|
|
10073
|
-
function
|
|
10073
|
+
function Rn(t) {
|
|
10074
10074
|
return t = t.trim().replace(/\s+/g, " "), "ẞ".toLowerCase() === "Ṿ" && (t = t.replace(/ẞ/g, "ß")), t.toLowerCase().toUpperCase();
|
|
10075
10075
|
}
|
|
10076
10076
|
const Z0 = { mdurl: y0, ucmicro: D0 }, G0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10077
10077
|
__proto__: null,
|
|
10078
10078
|
arrayReplaceAt: ho,
|
|
10079
|
-
assign:
|
|
10079
|
+
assign: In,
|
|
10080
10080
|
escapeHtml: $e,
|
|
10081
10081
|
escapeRE: K0,
|
|
10082
|
-
fromCodePoint:
|
|
10082
|
+
fromCodePoint: _n,
|
|
10083
10083
|
has: z0,
|
|
10084
10084
|
isMdAsciiPunct: Ht,
|
|
10085
10085
|
isPunctChar: Wt,
|
|
@@ -10088,7 +10088,7 @@ const Z0 = { mdurl: y0, ucmicro: D0 }, G0 = /* @__PURE__ */ Object.freeze(/* @__
|
|
|
10088
10088
|
isValidEntityCode: uu,
|
|
10089
10089
|
isWhiteSpace: $t,
|
|
10090
10090
|
lib: Z0,
|
|
10091
|
-
normalizeReference:
|
|
10091
|
+
normalizeReference: Rn,
|
|
10092
10092
|
unescapeAll: bt,
|
|
10093
10093
|
unescapeMd: $0
|
|
10094
10094
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -10246,7 +10246,7 @@ De.html_inline = function(t, e) {
|
|
|
10246
10246
|
return t[e].content;
|
|
10247
10247
|
};
|
|
10248
10248
|
function yt() {
|
|
10249
|
-
this.rules =
|
|
10249
|
+
this.rules = In({}, De);
|
|
10250
10250
|
}
|
|
10251
10251
|
yt.prototype.renderAttrs = function(e) {
|
|
10252
10252
|
let n, r, u;
|
|
@@ -10491,8 +10491,8 @@ function af(t) {
|
|
|
10491
10491
|
}
|
|
10492
10492
|
const x = new t.Token("link_open", "a", 1);
|
|
10493
10493
|
x.attrs = [["href", m]], x.level = f++, x.markup = "linkify", x.info = "auto", c.push(x);
|
|
10494
|
-
const
|
|
10495
|
-
|
|
10494
|
+
const y = new t.Token("text", "", 0);
|
|
10495
|
+
y.content = g, y.level = f, c.push(y);
|
|
10496
10496
|
const C = new t.Token("link_close", "a", -1);
|
|
10497
10497
|
C.level = --f, C.markup = "linkify", C.info = "auto", c.push(C), p = a[h].lastIndex;
|
|
10498
10498
|
}
|
|
@@ -10574,8 +10574,8 @@ function xf(t, e) {
|
|
|
10574
10574
|
m = t[n].content.charCodeAt(0);
|
|
10575
10575
|
break;
|
|
10576
10576
|
}
|
|
10577
|
-
const g = Ht(d) || Wt(String.fromCharCode(d)), b = Ht(m) || Wt(String.fromCharCode(m)), x = $t(d),
|
|
10578
|
-
if (
|
|
10577
|
+
const g = Ht(d) || Wt(String.fromCharCode(d)), b = Ht(m) || Wt(String.fromCharCode(m)), x = $t(d), y = $t(m);
|
|
10578
|
+
if (y ? f = !1 : b && (x || g || (f = !1)), x ? p = !1 : g && (y || b || (p = !1)), m === 34 && c[0] === '"' && d >= 48 && d <= 57 && (p = f = !1), f && p && (f = g, p = b), !f && !p) {
|
|
10579
10579
|
h && (i.content = un(i.content, c.index, ki));
|
|
10580
10580
|
continue;
|
|
10581
10581
|
}
|
|
@@ -10622,7 +10622,7 @@ function yf(t) {
|
|
|
10622
10622
|
e !== n && (s.length = n);
|
|
10623
10623
|
}
|
|
10624
10624
|
}
|
|
10625
|
-
const
|
|
10625
|
+
const nr = [
|
|
10626
10626
|
["normalize", rf],
|
|
10627
10627
|
["block", uf],
|
|
10628
10628
|
["inline", sf],
|
|
@@ -10635,8 +10635,8 @@ const rr = [
|
|
|
10635
10635
|
];
|
|
10636
10636
|
function iu() {
|
|
10637
10637
|
this.ruler = new Y();
|
|
10638
|
-
for (let t = 0; t <
|
|
10639
|
-
this.ruler.push(
|
|
10638
|
+
for (let t = 0; t < nr.length; t++)
|
|
10639
|
+
this.ruler.push(nr[t][0], nr[t][1]);
|
|
10640
10640
|
}
|
|
10641
10641
|
iu.prototype.process = function(t) {
|
|
10642
10642
|
const e = this.ruler.getRules("");
|
|
@@ -10724,7 +10724,7 @@ _e.prototype.getLines = function(e, n, r, u) {
|
|
|
10724
10724
|
};
|
|
10725
10725
|
_e.prototype.Token = fe;
|
|
10726
10726
|
const Cf = 65536;
|
|
10727
|
-
function
|
|
10727
|
+
function rr(t, e) {
|
|
10728
10728
|
const n = t.bMarks[e] + t.tShift[e], r = t.eMarks[e];
|
|
10729
10729
|
return t.src.slice(n, r);
|
|
10730
10730
|
}
|
|
@@ -10756,7 +10756,7 @@ function Df(t, e, n, r) {
|
|
|
10756
10756
|
return !1;
|
|
10757
10757
|
i++;
|
|
10758
10758
|
}
|
|
10759
|
-
let l =
|
|
10759
|
+
let l = rr(t, e + 1), a = l.split("|");
|
|
10760
10760
|
const c = [];
|
|
10761
10761
|
for (let C = 0; C < a.length; C++) {
|
|
10762
10762
|
const S = a[C].trim();
|
|
@@ -10769,7 +10769,7 @@ function Df(t, e, n, r) {
|
|
|
10769
10769
|
return !1;
|
|
10770
10770
|
S.charCodeAt(S.length - 1) === 58 ? c.push(S.charCodeAt(0) === 58 ? "center" : "right") : S.charCodeAt(0) === 58 ? c.push("left") : c.push("");
|
|
10771
10771
|
}
|
|
10772
|
-
if (l =
|
|
10772
|
+
if (l = rr(t, e).trim(), l.indexOf("|") === -1 || t.sCount[e] - t.blkIndent >= 4)
|
|
10773
10773
|
return !1;
|
|
10774
10774
|
a = yi(l), a.length && a[0] === "" && a.shift(), a.length && a[a.length - 1] === "" && a.pop();
|
|
10775
10775
|
const f = a.length;
|
|
@@ -10792,7 +10792,7 @@ function Df(t, e, n, r) {
|
|
|
10792
10792
|
E.content = a[C].trim(), E.children = [], t.push("th_close", "th", -1);
|
|
10793
10793
|
}
|
|
10794
10794
|
t.push("tr_close", "tr", -1), t.push("thead_close", "thead", -1);
|
|
10795
|
-
let x,
|
|
10795
|
+
let x, y = 0;
|
|
10796
10796
|
for (u = e + 2; u < n && !(t.sCount[u] < t.blkIndent); u++) {
|
|
10797
10797
|
let C = !1;
|
|
10798
10798
|
for (let E = 0, _ = h.length; E < _; E++)
|
|
@@ -10800,7 +10800,7 @@ function Df(t, e, n, r) {
|
|
|
10800
10800
|
C = !0;
|
|
10801
10801
|
break;
|
|
10802
10802
|
}
|
|
10803
|
-
if (C || (l =
|
|
10803
|
+
if (C || (l = rr(t, u).trim(), !l) || t.sCount[u] - t.blkIndent >= 4 || (a = yi(l), a.length && a[0] === "" && a.shift(), a.length && a[a.length - 1] === "" && a.pop(), y += f - a.length, y > Cf))
|
|
10804
10804
|
break;
|
|
10805
10805
|
if (u === e + 2) {
|
|
10806
10806
|
const E = t.push("tbody_open", "tbody", 1);
|
|
@@ -10876,10 +10876,10 @@ function Sf(t, e, n, r) {
|
|
|
10876
10876
|
t.parentType = "blockquote";
|
|
10877
10877
|
let h = !1, d;
|
|
10878
10878
|
for (d = e; d < n; d++) {
|
|
10879
|
-
const
|
|
10879
|
+
const y = t.sCount[d] < t.blkIndent;
|
|
10880
10880
|
if (u = t.bMarks[d] + t.tShift[d], i = t.eMarks[d], u >= i)
|
|
10881
10881
|
break;
|
|
10882
|
-
if (t.src.charCodeAt(u++) === 62 && !
|
|
10882
|
+
if (t.src.charCodeAt(u++) === 62 && !y) {
|
|
10883
10883
|
let S = t.sCount[d] + 1, E, _;
|
|
10884
10884
|
t.src.charCodeAt(u) === 32 ? (u++, S++, _ = !1, E = !0) : t.src.charCodeAt(u) === 9 ? (E = !0, (t.bsCount[d] + S) % 4 === 3 ? (u++, S++, _ = !1) : _ = !0) : E = !1;
|
|
10885
10885
|
let w = S;
|
|
@@ -10916,8 +10916,8 @@ function Sf(t, e, n, r) {
|
|
|
10916
10916
|
g.map = b, t.md.block.tokenize(t, e, d);
|
|
10917
10917
|
const x = t.push("blockquote_close", "blockquote", -1);
|
|
10918
10918
|
x.markup = ">", t.lineMax = s, t.parentType = p, b[1] = t.line;
|
|
10919
|
-
for (let
|
|
10920
|
-
t.bMarks[
|
|
10919
|
+
for (let y = 0; y < c.length; y++)
|
|
10920
|
+
t.bMarks[y + e] = o[y], t.tShift[y + e] = c[y], t.sCount[y + e] = a[y], t.bsCount[y + e] = l[y];
|
|
10921
10921
|
return t.blkIndent = m, !0;
|
|
10922
10922
|
}
|
|
10923
10923
|
function Af(t, e, n, r) {
|
|
@@ -11005,7 +11005,7 @@ function wf(t, e, n, r) {
|
|
|
11005
11005
|
const g = [l, 0];
|
|
11006
11006
|
o.map = g, o.markup = String.fromCharCode(d);
|
|
11007
11007
|
let b = !1;
|
|
11008
|
-
const x = t.md.block.ruler.getRules("list"),
|
|
11008
|
+
const x = t.md.block.ruler.getRules("list"), y = t.parentType;
|
|
11009
11009
|
for (t.parentType = "list"; l < n; ) {
|
|
11010
11010
|
i = h, u = t.eMarks[l];
|
|
11011
11011
|
const C = t.sCount[l] + h - (t.bMarks[l] + t.tShift[l]);
|
|
@@ -11027,11 +11027,11 @@ function wf(t, e, n, r) {
|
|
|
11027
11027
|
o = t.push("list_item_open", "li", 1), o.markup = String.fromCharCode(d);
|
|
11028
11028
|
const T = [l, 0];
|
|
11029
11029
|
o.map = T, f && (o.info = t.src.slice(s, h - 1));
|
|
11030
|
-
const oe = t.tight, Ct = t.tShift[l],
|
|
11031
|
-
if (t.listIndent = t.blkIndent, t.blkIndent = w, t.tight = !0, t.tShift[l] = E - t.bMarks[l], t.sCount[l] = S, E >= u && t.isEmpty(l + 1) ? t.line = Math.min(t.line + 2, n) : t.md.block.tokenize(t, l, n, !0), (!t.tight || b) && (a = !1), b = t.line - l > 1 && t.isEmpty(t.line - 1), t.blkIndent = t.listIndent, t.listIndent = Dt, t.tShift[l] = Ct, t.sCount[l] =
|
|
11030
|
+
const oe = t.tight, Ct = t.tShift[l], Ln = t.sCount[l], Dt = t.listIndent;
|
|
11031
|
+
if (t.listIndent = t.blkIndent, t.blkIndent = w, t.tight = !0, t.tShift[l] = E - t.bMarks[l], t.sCount[l] = S, E >= u && t.isEmpty(l + 1) ? t.line = Math.min(t.line + 2, n) : t.md.block.tokenize(t, l, n, !0), (!t.tight || b) && (a = !1), b = t.line - l > 1 && t.isEmpty(t.line - 1), t.blkIndent = t.listIndent, t.listIndent = Dt, t.tShift[l] = Ct, t.sCount[l] = Ln, t.tight = oe, o = t.push("list_item_close", "li", -1), o.markup = String.fromCharCode(d), l = t.line, T[1] = l, l >= n || t.sCount[l] < t.blkIndent || t.sCount[l] - t.blkIndent >= 4)
|
|
11032
11032
|
break;
|
|
11033
11033
|
let Xt = !1;
|
|
11034
|
-
for (let we = 0,
|
|
11034
|
+
for (let we = 0, qn = x.length; we < qn; we++)
|
|
11035
11035
|
if (x[we](t, l, n, !0)) {
|
|
11036
11036
|
Xt = !0;
|
|
11037
11037
|
break;
|
|
@@ -11047,15 +11047,15 @@ function wf(t, e, n, r) {
|
|
|
11047
11047
|
if (d !== t.src.charCodeAt(h - 1))
|
|
11048
11048
|
break;
|
|
11049
11049
|
}
|
|
11050
|
-
return f ? o = t.push("ordered_list_close", "ol", -1) : o = t.push("bullet_list_close", "ul", -1), o.markup = String.fromCharCode(d), g[1] = l, t.line = l, t.parentType =
|
|
11050
|
+
return f ? o = t.push("ordered_list_close", "ol", -1) : o = t.push("bullet_list_close", "ul", -1), o.markup = String.fromCharCode(d), g[1] = l, t.line = l, t.parentType = y, a && Mf(t, m), !0;
|
|
11051
11051
|
}
|
|
11052
11052
|
function Tf(t, e, n, r) {
|
|
11053
11053
|
let u = t.bMarks[e] + t.tShift[e], i = t.eMarks[e], s = e + 1;
|
|
11054
11054
|
if (t.sCount[e] - t.blkIndent >= 4 || t.src.charCodeAt(u) !== 91)
|
|
11055
11055
|
return !1;
|
|
11056
11056
|
function o(x) {
|
|
11057
|
-
const
|
|
11058
|
-
if (x >=
|
|
11057
|
+
const y = t.lineMax;
|
|
11058
|
+
if (x >= y || t.isEmpty(x))
|
|
11059
11059
|
return null;
|
|
11060
11060
|
let C = !1;
|
|
11061
11061
|
if (t.sCount[x] - t.blkIndent > 3 && (C = !0), t.sCount[x] < 0 && (C = !0), !C) {
|
|
@@ -11063,7 +11063,7 @@ function Tf(t, e, n, r) {
|
|
|
11063
11063
|
t.parentType = "reference";
|
|
11064
11064
|
let T = !1;
|
|
11065
11065
|
for (let oe = 0, Ct = _.length; oe < Ct; oe++)
|
|
11066
|
-
if (_[oe](t, x,
|
|
11066
|
+
if (_[oe](t, x, y, !0)) {
|
|
11067
11067
|
T = !0;
|
|
11068
11068
|
break;
|
|
11069
11069
|
}
|
|
@@ -11084,11 +11084,11 @@ function Tf(t, e, n, r) {
|
|
|
11084
11084
|
a = u;
|
|
11085
11085
|
break;
|
|
11086
11086
|
} else if (x === 10) {
|
|
11087
|
-
const
|
|
11088
|
-
|
|
11087
|
+
const y = o(s);
|
|
11088
|
+
y !== null && (l += y, i = l.length, s++);
|
|
11089
11089
|
} else if (x === 92 && (u++, u < i && l.charCodeAt(u) === 10)) {
|
|
11090
|
-
const
|
|
11091
|
-
|
|
11090
|
+
const y = o(s);
|
|
11091
|
+
y !== null && (l += y, i = l.length, s++);
|
|
11092
11092
|
}
|
|
11093
11093
|
}
|
|
11094
11094
|
if (a < 0 || l.charCodeAt(a + 1) !== 58)
|
|
@@ -11096,8 +11096,8 @@ function Tf(t, e, n, r) {
|
|
|
11096
11096
|
for (u = a + 2; u < i; u++) {
|
|
11097
11097
|
const x = l.charCodeAt(u);
|
|
11098
11098
|
if (x === 10) {
|
|
11099
|
-
const
|
|
11100
|
-
|
|
11099
|
+
const y = o(s);
|
|
11100
|
+
y !== null && (l += y, i = l.length, s++);
|
|
11101
11101
|
} else if (!N(x)) break;
|
|
11102
11102
|
}
|
|
11103
11103
|
const c = t.md.helpers.parseLinkDestination(l, u, i);
|
|
@@ -11111,8 +11111,8 @@ function Tf(t, e, n, r) {
|
|
|
11111
11111
|
for (; u < i; u++) {
|
|
11112
11112
|
const x = l.charCodeAt(u);
|
|
11113
11113
|
if (x === 10) {
|
|
11114
|
-
const
|
|
11115
|
-
|
|
11114
|
+
const y = o(s);
|
|
11115
|
+
y !== null && (l += y, i = l.length, s++);
|
|
11116
11116
|
} else if (!N(x)) break;
|
|
11117
11117
|
}
|
|
11118
11118
|
let m = t.md.helpers.parseLinkTitle(l, u, i);
|
|
@@ -11137,7 +11137,7 @@ function Tf(t, e, n, r) {
|
|
|
11137
11137
|
}
|
|
11138
11138
|
if (u < i && l.charCodeAt(u) !== 10)
|
|
11139
11139
|
return !1;
|
|
11140
|
-
const b =
|
|
11140
|
+
const b = Rn(l.slice(1, a));
|
|
11141
11141
|
return b ? (r || (typeof t.env.references > "u" && (t.env.references = {}), typeof t.env.references[b] > "u" && (t.env.references[b] = { title: g, href: f }), t.line = s), !0) : !1;
|
|
11142
11142
|
}
|
|
11143
11143
|
const Of = [
|
|
@@ -11336,12 +11336,12 @@ const sn = [
|
|
|
11336
11336
|
["lheading", Jf],
|
|
11337
11337
|
["paragraph", jf]
|
|
11338
11338
|
];
|
|
11339
|
-
function
|
|
11339
|
+
function Bn() {
|
|
11340
11340
|
this.ruler = new Y();
|
|
11341
11341
|
for (let t = 0; t < sn.length; t++)
|
|
11342
11342
|
this.ruler.push(sn[t][0], sn[t][1], { alt: (sn[t][2] || []).slice() });
|
|
11343
11343
|
}
|
|
11344
|
-
|
|
11344
|
+
Bn.prototype.tokenize = function(t, e, n) {
|
|
11345
11345
|
const r = this.ruler.getRules(""), u = r.length, i = t.md.options.maxNesting;
|
|
11346
11346
|
let s = e, o = !1;
|
|
11347
11347
|
for (; s < n && (t.line = s = t.skipEmptyLines(s), !(s >= n || t.sCount[s] < t.blkIndent)); ) {
|
|
@@ -11361,13 +11361,13 @@ vn.prototype.tokenize = function(t, e, n) {
|
|
|
11361
11361
|
t.tight = !o, t.isEmpty(t.line - 1) && (o = !0), s = t.line, s < n && t.isEmpty(s) && (o = !0, s++, t.line = s);
|
|
11362
11362
|
}
|
|
11363
11363
|
};
|
|
11364
|
-
|
|
11364
|
+
Bn.prototype.parse = function(t, e, n, r) {
|
|
11365
11365
|
if (!t)
|
|
11366
11366
|
return;
|
|
11367
11367
|
const u = new this.State(t, e, n, r);
|
|
11368
11368
|
this.tokenize(u, u.line, u.lineMax);
|
|
11369
11369
|
};
|
|
11370
|
-
|
|
11370
|
+
Bn.prototype.State = _e;
|
|
11371
11371
|
function Gt(t, e, n, r) {
|
|
11372
11372
|
this.src = t, this.env = n, this.md = e, this.tokens = r, this.tokens_meta = Array(r.length), this.pos = 0, this.posMax = this.src.length, this.level = 0, this.pending = "", this.pendingLevel = 0, this.cache = {}, this.delimiters = [], this._prev_delimiters = [], this.backticks = {}, this.backticksScanned = !1, this.linkLevel = 0;
|
|
11373
11373
|
}
|
|
@@ -11656,7 +11656,7 @@ function ud(t, e) {
|
|
|
11656
11656
|
if (a) {
|
|
11657
11657
|
if (typeof t.env.references > "u")
|
|
11658
11658
|
return !1;
|
|
11659
|
-
if (d < f && t.src.charCodeAt(d) === 91 ? (l = d + 1, d = t.md.helpers.parseLinkLabel(t, d), d >= 0 ? r = t.src.slice(l, d++) : d = h + 1) : d = h + 1, r || (r = t.src.slice(p, h)), i = t.env.references[
|
|
11659
|
+
if (d < f && t.src.charCodeAt(d) === 91 ? (l = d + 1, d = t.md.helpers.parseLinkLabel(t, d), d >= 0 ? r = t.src.slice(l, d++) : d = h + 1) : d = h + 1, r || (r = t.src.slice(p, h)), i = t.env.references[Rn(r)], !i)
|
|
11660
11660
|
return t.pos = c, !1;
|
|
11661
11661
|
s = i.href, o = i.title;
|
|
11662
11662
|
}
|
|
@@ -11693,7 +11693,7 @@ function id(t, e) {
|
|
|
11693
11693
|
} else {
|
|
11694
11694
|
if (typeof t.env.references > "u")
|
|
11695
11695
|
return !1;
|
|
11696
|
-
if (i < p && t.src.charCodeAt(i) === 91 ? (a = i + 1, i = t.md.helpers.parseLinkLabel(t, i), i >= 0 ? u = t.src.slice(a, i++) : i = d + 1) : i = d + 1, u || (u = t.src.slice(h, d)), s = t.env.references[
|
|
11696
|
+
if (i < p && t.src.charCodeAt(i) === 91 ? (a = i + 1, i = t.md.helpers.parseLinkLabel(t, i), i >= 0 ? u = t.src.slice(a, i++) : i = d + 1) : i = d + 1, u || (u = t.src.slice(h, d)), s = t.env.references[Rn(u)], !s)
|
|
11697
11697
|
return t.pos = f, !1;
|
|
11698
11698
|
c = s.href, l = s.title;
|
|
11699
11699
|
}
|
|
@@ -11791,7 +11791,7 @@ function md(t, e) {
|
|
|
11791
11791
|
if (i) {
|
|
11792
11792
|
if (!e) {
|
|
11793
11793
|
const s = i[1][0].toLowerCase() === "x" ? parseInt(i[1].slice(1), 16) : parseInt(i[1], 10), o = t.push("text_special", "", 0);
|
|
11794
|
-
o.content = uu(s) ?
|
|
11794
|
+
o.content = uu(s) ? _n(s) : _n(65533), o.markup = i[0], o.info = "entity";
|
|
11795
11795
|
}
|
|
11796
11796
|
return t.pos += i[0].length, !0;
|
|
11797
11797
|
}
|
|
@@ -11848,7 +11848,7 @@ function bd(t) {
|
|
|
11848
11848
|
u[e].nesting < 0 && r--, u[e].level = r, u[e].nesting > 0 && r++, u[e].type === "text" && e + 1 < i && u[e + 1].type === "text" ? u[e + 1].content = u[e].content + u[e + 1].content : (e !== n && (u[n] = u[e]), n++);
|
|
11849
11849
|
e !== n && (u.length = n);
|
|
11850
11850
|
}
|
|
11851
|
-
const
|
|
11851
|
+
const ur = [
|
|
11852
11852
|
["text", Kf],
|
|
11853
11853
|
["linkify", Gf],
|
|
11854
11854
|
["newline", Yf],
|
|
@@ -11861,7 +11861,7 @@ const ir = [
|
|
|
11861
11861
|
["autolink", ld],
|
|
11862
11862
|
["html_inline", dd],
|
|
11863
11863
|
["entity", md]
|
|
11864
|
-
],
|
|
11864
|
+
], ir = [
|
|
11865
11865
|
["balance_pairs", gd],
|
|
11866
11866
|
["strikethrough", ko.postProcess],
|
|
11867
11867
|
["emphasis", yo.postProcess],
|
|
@@ -11871,11 +11871,11 @@ const ir = [
|
|
|
11871
11871
|
];
|
|
11872
11872
|
function Yt() {
|
|
11873
11873
|
this.ruler = new Y();
|
|
11874
|
-
for (let t = 0; t <
|
|
11875
|
-
this.ruler.push(
|
|
11874
|
+
for (let t = 0; t < ur.length; t++)
|
|
11875
|
+
this.ruler.push(ur[t][0], ur[t][1]);
|
|
11876
11876
|
this.ruler2 = new Y();
|
|
11877
|
-
for (let t = 0; t <
|
|
11878
|
-
this.ruler2.push(
|
|
11877
|
+
for (let t = 0; t < ir.length; t++)
|
|
11878
|
+
this.ruler2.push(ir[t][0], ir[t][1]);
|
|
11879
11879
|
}
|
|
11880
11880
|
Yt.prototype.skipToken = function(t) {
|
|
11881
11881
|
const e = t.pos, n = this.ruler.getRules(""), r = n.length, u = t.md.options.maxNesting, i = t.cache;
|
|
@@ -11944,20 +11944,20 @@ function vr(t) {
|
|
|
11944
11944
|
});
|
|
11945
11945
|
}), t;
|
|
11946
11946
|
}
|
|
11947
|
-
function
|
|
11947
|
+
function vn(t) {
|
|
11948
11948
|
return Object.prototype.toString.call(t);
|
|
11949
11949
|
}
|
|
11950
11950
|
function kd(t) {
|
|
11951
|
-
return
|
|
11951
|
+
return vn(t) === "[object String]";
|
|
11952
11952
|
}
|
|
11953
11953
|
function yd(t) {
|
|
11954
|
-
return
|
|
11954
|
+
return vn(t) === "[object Object]";
|
|
11955
11955
|
}
|
|
11956
11956
|
function Cd(t) {
|
|
11957
|
-
return
|
|
11957
|
+
return vn(t) === "[object RegExp]";
|
|
11958
11958
|
}
|
|
11959
11959
|
function Ai(t) {
|
|
11960
|
-
return
|
|
11960
|
+
return vn(t) === "[object Function]";
|
|
11961
11961
|
}
|
|
11962
11962
|
function Dd(t) {
|
|
11963
11963
|
return t.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
|
|
@@ -12019,7 +12019,7 @@ function Mi() {
|
|
|
12019
12019
|
e.normalize(t);
|
|
12020
12020
|
};
|
|
12021
12021
|
}
|
|
12022
|
-
function
|
|
12022
|
+
function En(t) {
|
|
12023
12023
|
const e = t.re = xd(t.__opts__), n = t.__tlds__.slice();
|
|
12024
12024
|
t.onCompile(), t.__tlds_replaced__ || n.push(Sd), n.push(e.src_xn), e.src_tlds = n.join("|");
|
|
12025
12025
|
function r(o) {
|
|
@@ -12067,10 +12067,10 @@ function zr(t, e) {
|
|
|
12067
12067
|
function te(t, e) {
|
|
12068
12068
|
if (!(this instanceof te))
|
|
12069
12069
|
return new te(t, e);
|
|
12070
|
-
e || _d(t) && (e = t, t = {}), this.__opts__ = vr({}, Co, e), this.__index__ = -1, this.__last_index__ = -1, this.__schema__ = "", this.__text_cache__ = "", this.__schemas__ = vr({}, Ed, t), this.__compiled__ = {}, this.__tlds__ = Ad, this.__tlds_replaced__ = !1, this.re = {},
|
|
12070
|
+
e || _d(t) && (e = t, t = {}), this.__opts__ = vr({}, Co, e), this.__index__ = -1, this.__last_index__ = -1, this.__schema__ = "", this.__text_cache__ = "", this.__schemas__ = vr({}, Ed, t), this.__compiled__ = {}, this.__tlds__ = Ad, this.__tlds_replaced__ = !1, this.re = {}, En(this);
|
|
12071
12071
|
}
|
|
12072
12072
|
te.prototype.add = function(e, n) {
|
|
12073
|
-
return this.__schemas__[e] = n,
|
|
12073
|
+
return this.__schemas__[e] = n, En(this), this;
|
|
12074
12074
|
};
|
|
12075
12075
|
te.prototype.set = function(e) {
|
|
12076
12076
|
return this.__opts__ = vr(this.__opts__, e), this;
|
|
@@ -12113,7 +12113,7 @@ te.prototype.matchAtStart = function(e) {
|
|
|
12113
12113
|
te.prototype.tlds = function(e, n) {
|
|
12114
12114
|
return e = Array.isArray(e) ? e : [e], n ? (this.__tlds__ = this.__tlds__.concat(e).sort().filter(function(r, u, i) {
|
|
12115
12115
|
return r !== i[u - 1];
|
|
12116
|
-
}).reverse(),
|
|
12116
|
+
}).reverse(), En(this), this) : (this.__tlds__ = e.slice(), this.__tlds_replaced__ = !0, En(this), this);
|
|
12117
12117
|
};
|
|
12118
12118
|
te.prototype.normalize = function(e) {
|
|
12119
12119
|
e.schema || (e.url = "http://" + e.url), e.schema === "mailto:" && !/^mailto:/i.test(e.url) && (e.url = "mailto:" + e.url);
|
|
@@ -12124,7 +12124,7 @@ const dt = 2147483647, be = 36, ou = 1, Jt = 26, Od = 38, Fd = 700, Do = 72, _o
|
|
|
12124
12124
|
overflow: "Overflow: input needs wider integers to process",
|
|
12125
12125
|
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
12126
12126
|
"invalid-input": "Invalid input"
|
|
12127
|
-
},
|
|
12127
|
+
}, sr = be - ou, xe = Math.floor, or = String.fromCharCode;
|
|
12128
12128
|
function Fe(t) {
|
|
12129
12129
|
throw new RangeError(Bd[t]);
|
|
12130
12130
|
}
|
|
@@ -12162,9 +12162,9 @@ const zd = (t) => String.fromCodePoint(...t), Pd = function(t) {
|
|
|
12162
12162
|
return t + 22 + 75 * (t < 26) - ((e != 0) << 5);
|
|
12163
12163
|
}, Mo = function(t, e, n) {
|
|
12164
12164
|
let r = 0;
|
|
12165
|
-
for (t = n ? xe(t / Fd) : t >> 1, t += xe(t / e); t >
|
|
12166
|
-
t = xe(t /
|
|
12167
|
-
return xe(r + (
|
|
12165
|
+
for (t = n ? xe(t / Fd) : t >> 1, t += xe(t / e); t > sr * Jt >> 1; r += be)
|
|
12166
|
+
t = xe(t / sr);
|
|
12167
|
+
return xe(r + (sr + 1) * t / (t + Od));
|
|
12168
12168
|
}, wo = function(t) {
|
|
12169
12169
|
const e = [], n = t.length;
|
|
12170
12170
|
let r = 0, u = _o, i = Do, s = t.lastIndexOf(Eo);
|
|
@@ -12193,7 +12193,7 @@ const zd = (t) => String.fromCodePoint(...t), Pd = function(t) {
|
|
|
12193
12193
|
const n = t.length;
|
|
12194
12194
|
let r = _o, u = 0, i = Do;
|
|
12195
12195
|
for (const l of t)
|
|
12196
|
-
l < 128 && e.push(
|
|
12196
|
+
l < 128 && e.push(or(l));
|
|
12197
12197
|
const s = e.length;
|
|
12198
12198
|
let o = s;
|
|
12199
12199
|
for (s && e.push(Eo); o < n; ) {
|
|
@@ -12211,10 +12211,10 @@ const zd = (t) => String.fromCodePoint(...t), Pd = function(t) {
|
|
|
12211
12211
|
break;
|
|
12212
12212
|
const d = f - h, m = be - h;
|
|
12213
12213
|
e.push(
|
|
12214
|
-
|
|
12214
|
+
or(wi(h + d % m, 0))
|
|
12215
12215
|
), f = xe(d / m);
|
|
12216
12216
|
}
|
|
12217
|
-
e.push(
|
|
12217
|
+
e.push(or(wi(f, 0))), i = Mo(u, a, o === s), u = 0, ++o;
|
|
12218
12218
|
}
|
|
12219
12219
|
++u, ++r;
|
|
12220
12220
|
}
|
|
@@ -12445,10 +12445,10 @@ function Zd(t) {
|
|
|
12445
12445
|
function se(t, e) {
|
|
12446
12446
|
if (!(this instanceof se))
|
|
12447
12447
|
return new se(t, e);
|
|
12448
|
-
e || ru(t) || (e = t || {}, t = "default"), this.inline = new Yt(), this.block = new
|
|
12448
|
+
e || ru(t) || (e = t || {}, t = "default"), this.inline = new Yt(), this.block = new Bn(), this.core = new iu(), this.renderer = new yt(), this.linkify = new te(), this.validateLink = Ud, this.normalizeLink = Kd, this.normalizeLinkText = Zd, this.utils = G0, this.helpers = In({}, ef), this.options = {}, this.configure(t), e && this.set(e);
|
|
12449
12449
|
}
|
|
12450
12450
|
se.prototype.set = function(t) {
|
|
12451
|
-
return
|
|
12451
|
+
return In(this.options, t), this;
|
|
12452
12452
|
};
|
|
12453
12453
|
se.prototype.configure = function(t) {
|
|
12454
12454
|
const e = this;
|
|
@@ -12734,14 +12734,14 @@ class Xd {
|
|
|
12734
12734
|
function St(t, e, n, r) {
|
|
12735
12735
|
return t.getAttrs ? t.getAttrs(e, n, r) : t.attrs instanceof Function ? t.attrs(e) : t.attrs;
|
|
12736
12736
|
}
|
|
12737
|
-
function
|
|
12737
|
+
function lr(t, e) {
|
|
12738
12738
|
return t.noCloseToken || e == "code_inline" || e == "code_block" || e == "fence";
|
|
12739
12739
|
}
|
|
12740
12740
|
function Ti(t) {
|
|
12741
12741
|
return t[t.length - 1] == `
|
|
12742
12742
|
` ? t.slice(0, t.length - 1) : t;
|
|
12743
12743
|
}
|
|
12744
|
-
function
|
|
12744
|
+
function ar() {
|
|
12745
12745
|
}
|
|
12746
12746
|
function Qd(t, e) {
|
|
12747
12747
|
let n = /* @__PURE__ */ Object.create(null);
|
|
@@ -12749,7 +12749,7 @@ function Qd(t, e) {
|
|
|
12749
12749
|
let u = e[r];
|
|
12750
12750
|
if (u.block) {
|
|
12751
12751
|
let i = t.nodeType(u.block);
|
|
12752
|
-
|
|
12752
|
+
lr(u, r) ? n[r] = (s, o, l, a) => {
|
|
12753
12753
|
s.openNode(i, St(u, o, l, a)), s.addText(Ti(o.content)), s.closeNode();
|
|
12754
12754
|
} : (n[r + "_open"] = (s, o, l, a) => s.openNode(i, St(u, o, l, a)), n[r + "_close"] = (s) => s.closeNode());
|
|
12755
12755
|
} else if (u.node) {
|
|
@@ -12757,11 +12757,11 @@ function Qd(t, e) {
|
|
|
12757
12757
|
n[r] = (s, o, l, a) => s.addNode(i, St(u, o, l, a));
|
|
12758
12758
|
} else if (u.mark) {
|
|
12759
12759
|
let i = t.marks[u.mark];
|
|
12760
|
-
|
|
12760
|
+
lr(u, r) ? n[r] = (s, o, l, a) => {
|
|
12761
12761
|
s.openMark(i.create(St(u, o, l, a))), s.addText(Ti(o.content)), s.closeMark(i);
|
|
12762
12762
|
} : (n[r + "_open"] = (s, o, l, a) => s.openMark(i.create(St(u, o, l, a))), n[r + "_close"] = (s) => s.closeMark(i));
|
|
12763
12763
|
} else if (u.ignore)
|
|
12764
|
-
|
|
12764
|
+
lr(u, r) ? n[r] = ar : (n[r + "_open"] = ar, n[r + "_close"] = ar);
|
|
12765
12765
|
else
|
|
12766
12766
|
throw new RangeError("Unrecognized parsing spec " + JSON.stringify(u));
|
|
12767
12767
|
}
|
|
@@ -12849,7 +12849,7 @@ class nh {
|
|
|
12849
12849
|
return r.renderContent(e), r.out;
|
|
12850
12850
|
}
|
|
12851
12851
|
}
|
|
12852
|
-
const
|
|
12852
|
+
const cr = new nh({
|
|
12853
12853
|
blockquote(t, e) {
|
|
12854
12854
|
t.wrapBlock("> ", null, e, () => t.renderContent(e));
|
|
12855
12855
|
},
|
|
@@ -13150,10 +13150,10 @@ class uh {
|
|
|
13150
13150
|
};
|
|
13151
13151
|
}
|
|
13152
13152
|
}
|
|
13153
|
-
var
|
|
13153
|
+
var Sn = 200, P = function() {
|
|
13154
13154
|
};
|
|
13155
13155
|
P.prototype.append = function(e) {
|
|
13156
|
-
return e.length ? (e = P.from(e), !this.length && e || e.length <
|
|
13156
|
+
return e.length ? (e = P.from(e), !this.length && e || e.length < Sn && this.leafAppend(e) || this.length < Sn && e.leafPrepend(this) || this.appendInner(e)) : this;
|
|
13157
13157
|
};
|
|
13158
13158
|
P.prototype.prepend = function(e) {
|
|
13159
13159
|
return e.length ? P.from(e).append(this) : this;
|
|
@@ -13202,10 +13202,10 @@ var No = /* @__PURE__ */ function(t) {
|
|
|
13202
13202
|
if (u(this.values[l], o + l) === !1)
|
|
13203
13203
|
return !1;
|
|
13204
13204
|
}, e.prototype.leafAppend = function(u) {
|
|
13205
|
-
if (this.length + u.length <=
|
|
13205
|
+
if (this.length + u.length <= Sn)
|
|
13206
13206
|
return new e(this.values.concat(u.flatten()));
|
|
13207
13207
|
}, e.prototype.leafPrepend = function(u) {
|
|
13208
|
-
if (this.length + u.length <=
|
|
13208
|
+
if (this.length + u.length <= Sn)
|
|
13209
13209
|
return new e(u.flatten().concat(this.values));
|
|
13210
13210
|
}, n.length.get = function() {
|
|
13211
13211
|
return this.values.length;
|
|
@@ -13395,11 +13395,11 @@ function ah(t, e, n, r) {
|
|
|
13395
13395
|
if (n.steps.length == 0)
|
|
13396
13396
|
return t;
|
|
13397
13397
|
if (s && s.getMeta(et))
|
|
13398
|
-
return s.getMeta(et).redo ? new Ne(t.done.addTransform(n, void 0, r,
|
|
13398
|
+
return s.getMeta(et).redo ? new Ne(t.done.addTransform(n, void 0, r, fn(e)), t.undone, Ii(n.mapping.maps), t.prevTime, t.prevComposition) : new Ne(t.done, t.undone.addTransform(n, void 0, r, fn(e)), null, t.prevTime, t.prevComposition);
|
|
13399
13399
|
if (n.getMeta("addToHistory") !== !1 && !(s && s.getMeta("addToHistory") === !1)) {
|
|
13400
|
-
let o = n.getMeta("composition"), l = t.prevTime == 0 || !s && t.prevComposition != o && (t.prevTime < (n.time || 0) - r.newGroupDelay || !ch(n, t.prevRanges)), a = s ?
|
|
13401
|
-
return new Ne(t.done.addTransform(n, l ? e.selection.getBookmark() : void 0, r,
|
|
13402
|
-
} else return (i = n.getMeta("rebased")) ? new Ne(t.done.rebased(n, i), t.undone.rebased(n, i),
|
|
13400
|
+
let o = n.getMeta("composition"), l = t.prevTime == 0 || !s && t.prevComposition != o && (t.prevTime < (n.time || 0) - r.newGroupDelay || !ch(n, t.prevRanges)), a = s ? fr(t.prevRanges, n.mapping) : Ii(n.mapping.maps);
|
|
13401
|
+
return new Ne(t.done.addTransform(n, l ? e.selection.getBookmark() : void 0, r, fn(e)), ae.empty, a, n.time, o ?? t.prevComposition);
|
|
13402
|
+
} else return (i = n.getMeta("rebased")) ? new Ne(t.done.rebased(n, i), t.undone.rebased(n, i), fr(t.prevRanges, n.mapping), t.prevTime, t.prevComposition) : new Ne(t.done.addMaps(n.mapping.maps), t.undone.addMaps(n.mapping.maps), fr(t.prevRanges, n.mapping), t.prevTime, t.prevComposition);
|
|
13403
13403
|
}
|
|
13404
13404
|
function ch(t, e) {
|
|
13405
13405
|
if (!e)
|
|
@@ -13418,7 +13418,7 @@ function Ii(t) {
|
|
|
13418
13418
|
t[n].forEach((r, u, i, s) => e.push(i, s));
|
|
13419
13419
|
return e;
|
|
13420
13420
|
}
|
|
13421
|
-
function
|
|
13421
|
+
function fr(t, e) {
|
|
13422
13422
|
if (!t)
|
|
13423
13423
|
return null;
|
|
13424
13424
|
let n = [];
|
|
@@ -13429,24 +13429,24 @@ function dr(t, e) {
|
|
|
13429
13429
|
return n;
|
|
13430
13430
|
}
|
|
13431
13431
|
function fh(t, e, n) {
|
|
13432
|
-
let r =
|
|
13432
|
+
let r = fn(e), u = et.get(e).spec.config, i = (n ? t.undone : t.done).popEvent(e, r);
|
|
13433
13433
|
if (!i)
|
|
13434
13434
|
return null;
|
|
13435
13435
|
let s = i.selection.resolve(i.transform.doc), o = (n ? t.done : t.undone).addTransform(i.transform, e.selection.getBookmark(), u, r), l = new Ne(n ? o : i.remaining, n ? i.remaining : o, null, 0, -1);
|
|
13436
13436
|
return i.transform.setSelection(s).setMeta(et, { redo: n, historyState: l });
|
|
13437
13437
|
}
|
|
13438
|
-
let
|
|
13439
|
-
function
|
|
13438
|
+
let dr = !1, Ri = null;
|
|
13439
|
+
function fn(t) {
|
|
13440
13440
|
let e = t.plugins;
|
|
13441
13441
|
if (Ri != e) {
|
|
13442
|
-
|
|
13442
|
+
dr = !1, Ri = e;
|
|
13443
13443
|
for (let n = 0; n < e.length; n++)
|
|
13444
13444
|
if (e[n].spec.historyPreserveItems) {
|
|
13445
|
-
|
|
13445
|
+
dr = !0;
|
|
13446
13446
|
break;
|
|
13447
13447
|
}
|
|
13448
13448
|
}
|
|
13449
|
-
return
|
|
13449
|
+
return dr;
|
|
13450
13450
|
}
|
|
13451
13451
|
const et = new Ss("history"), dh = new Ss("closeHistory");
|
|
13452
13452
|
function hh(t = {}) {
|
|
@@ -13540,7 +13540,7 @@ var We = {
|
|
|
13540
13540
|
220: "\\",
|
|
13541
13541
|
221: "]",
|
|
13542
13542
|
222: "'"
|
|
13543
|
-
},
|
|
13543
|
+
}, An = {
|
|
13544
13544
|
48: ")",
|
|
13545
13545
|
49: "!",
|
|
13546
13546
|
50: "@",
|
|
@@ -13569,10 +13569,10 @@ var We = {
|
|
|
13569
13569
|
for (var V = 0; V < 10; V++) We[48 + V] = We[96 + V] = String(V);
|
|
13570
13570
|
for (var V = 1; V <= 24; V++) We[V + 111] = "F" + V;
|
|
13571
13571
|
for (var V = 65; V <= 90; V++)
|
|
13572
|
-
We[V] = String.fromCharCode(V + 32),
|
|
13573
|
-
for (var
|
|
13572
|
+
We[V] = String.fromCharCode(V + 32), An[V] = String.fromCharCode(V);
|
|
13573
|
+
for (var hr in We) An.hasOwnProperty(hr) || (An[hr] = We[hr]);
|
|
13574
13574
|
function gh(t) {
|
|
13575
|
-
var e = ph && t.metaKey && t.shiftKey && !t.ctrlKey && !t.altKey || mh && t.shiftKey && t.key && t.key.length == 1 || t.key == "Unidentified", n = !e && t.key || (t.shiftKey ?
|
|
13575
|
+
var e = ph && t.metaKey && t.shiftKey && !t.ctrlKey && !t.altKey || mh && t.shiftKey && t.key && t.key.length == 1 || t.key == "Unidentified", n = !e && t.key || (t.shiftKey ? An : We)[t.keyCode] || t.key || "Unidentified";
|
|
13576
13576
|
return n == "Esc" && (n = "Escape"), n == "Del" && (n = "Delete"), n == "Left" && (n = "ArrowLeft"), n == "Up" && (n = "ArrowUp"), n == "Right" && (n = "ArrowRight"), n == "Down" && (n = "ArrowDown"), n;
|
|
13577
13577
|
}
|
|
13578
13578
|
const bh = typeof navigator < "u" && /Mac|iP(hone|[oa]d)/.test(navigator.platform), xh = typeof navigator < "u" && /Win/.test(navigator.platform);
|
|
@@ -13603,27 +13603,27 @@ function yh(t) {
|
|
|
13603
13603
|
e[kh(n)] = t[n];
|
|
13604
13604
|
return e;
|
|
13605
13605
|
}
|
|
13606
|
-
function
|
|
13606
|
+
function pr(t, e, n = !0) {
|
|
13607
13607
|
return e.altKey && (t = "Alt-" + t), e.ctrlKey && (t = "Ctrl-" + t), e.metaKey && (t = "Meta-" + t), n && e.shiftKey && (t = "Shift-" + t), t;
|
|
13608
13608
|
}
|
|
13609
|
-
function
|
|
13609
|
+
function mr(t) {
|
|
13610
13610
|
return new Hr({ props: { handleKeyDown: Ch(t) } });
|
|
13611
13611
|
}
|
|
13612
13612
|
function Ch(t) {
|
|
13613
13613
|
let e = yh(t);
|
|
13614
13614
|
return function(n, r) {
|
|
13615
|
-
let u = gh(r), i, s = e[
|
|
13615
|
+
let u = gh(r), i, s = e[pr(u, r)];
|
|
13616
13616
|
if (s && s(n.state, n.dispatch, n))
|
|
13617
13617
|
return !0;
|
|
13618
13618
|
if (u.length == 1 && u != " ") {
|
|
13619
13619
|
if (r.shiftKey) {
|
|
13620
|
-
let o = e[
|
|
13620
|
+
let o = e[pr(u, r, !1)];
|
|
13621
13621
|
if (o && o(n.state, n.dispatch, n))
|
|
13622
13622
|
return !0;
|
|
13623
13623
|
}
|
|
13624
13624
|
if ((r.altKey || r.metaKey || r.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
|
|
13625
13625
|
!(xh && r.ctrlKey && r.altKey) && (i = We[r.keyCode]) && i != u) {
|
|
13626
|
-
let o = e[
|
|
13626
|
+
let o = e[pr(i, r)];
|
|
13627
13627
|
if (o && o(n.state, n.dispatch, n))
|
|
13628
13628
|
return !0;
|
|
13629
13629
|
}
|
|
@@ -13642,7 +13642,7 @@ const Bo = (t, e, n) => {
|
|
|
13642
13642
|
return !1;
|
|
13643
13643
|
let u = zo(r);
|
|
13644
13644
|
if (!u) {
|
|
13645
|
-
let s = r.blockRange(), o = s &&
|
|
13645
|
+
let s = r.blockRange(), o = s && wn(s);
|
|
13646
13646
|
return o == null ? !1 : (e && e(t.tr.lift(s, o).scrollIntoView()), !0);
|
|
13647
13647
|
}
|
|
13648
13648
|
let i = u.nodeBefore;
|
|
@@ -13743,7 +13743,7 @@ function qo(t) {
|
|
|
13743
13743
|
return null;
|
|
13744
13744
|
}
|
|
13745
13745
|
const Eh = (t, e) => {
|
|
13746
|
-
let { $from: n, $to: r } = t.selection, u = n.blockRange(r), i = u &&
|
|
13746
|
+
let { $from: n, $to: r } = t.selection, u = n.blockRange(r), i = u && wn(u);
|
|
13747
13747
|
return i == null ? !1 : (e && e(t.tr.lift(u, i).scrollIntoView()), !0);
|
|
13748
13748
|
}, Vo = (t, e) => {
|
|
13749
13749
|
let { $head: n, $anchor: r } = t.selection;
|
|
@@ -13788,17 +13788,17 @@ const $o = (t, e) => {
|
|
|
13788
13788
|
return !1;
|
|
13789
13789
|
if (n.depth > 1 && n.after() != n.end(-1)) {
|
|
13790
13790
|
let i = n.before();
|
|
13791
|
-
if (
|
|
13791
|
+
if (cn(t.doc, i))
|
|
13792
13792
|
return e && e(t.tr.split(i).scrollIntoView()), !0;
|
|
13793
13793
|
}
|
|
13794
|
-
let r = n.blockRange(), u = r &&
|
|
13794
|
+
let r = n.blockRange(), u = r && wn(r);
|
|
13795
13795
|
return u == null ? !1 : (e && e(t.tr.lift(r, u).scrollIntoView()), !0);
|
|
13796
13796
|
};
|
|
13797
13797
|
function Jo(t) {
|
|
13798
13798
|
return (e, n) => {
|
|
13799
13799
|
let { $from: r, $to: u } = e.selection;
|
|
13800
13800
|
if (e.selection instanceof A && e.selection.node.isBlock)
|
|
13801
|
-
return !r.parentOffset || !
|
|
13801
|
+
return !r.parentOffset || !cn(e.doc, r.pos) ? !1 : (n && n(e.tr.split(r.pos).scrollIntoView()), !0);
|
|
13802
13802
|
if (!r.depth)
|
|
13803
13803
|
return !1;
|
|
13804
13804
|
let i = [], s, o, l = !1, a = !1;
|
|
@@ -13813,8 +13813,8 @@ function Jo(t) {
|
|
|
13813
13813
|
}
|
|
13814
13814
|
let c = e.tr;
|
|
13815
13815
|
(e.selection instanceof F || e.selection instanceof ee) && c.deleteSelection();
|
|
13816
|
-
let f = c.mapping.map(r.pos), p =
|
|
13817
|
-
if (p || (i[0] = o ? { type: o } : null, p =
|
|
13816
|
+
let f = c.mapping.map(r.pos), p = cn(c.doc, f, i.length, i);
|
|
13817
|
+
if (p || (i[0] = o ? { type: o } : null, p = cn(c.doc, f, i.length, i)), !p)
|
|
13818
13818
|
return !1;
|
|
13819
13819
|
if (c.split(f, i.length, i), !l && a && r.node(s).type != o) {
|
|
13820
13820
|
let h = c.mapping.map(r.before(s)), d = c.doc.resolve(h);
|
|
@@ -13835,16 +13835,16 @@ function Ko(t, e, n, r) {
|
|
|
13835
13835
|
let a = !l && e.parent.canReplace(e.index(), e.index() + 1);
|
|
13836
13836
|
if (a && (s = (o = u.contentMatchAt(u.childCount)).findWrapping(i.type)) && o.matchType(s[0] || i.type).validEnd) {
|
|
13837
13837
|
if (n) {
|
|
13838
|
-
let h = e.pos + i.nodeSize, d =
|
|
13838
|
+
let h = e.pos + i.nodeSize, d = k.empty;
|
|
13839
13839
|
for (let b = s.length - 1; b >= 0; b--)
|
|
13840
|
-
d =
|
|
13841
|
-
d =
|
|
13840
|
+
d = k.from(s[b].create(null, d));
|
|
13841
|
+
d = k.from(u.copy(d));
|
|
13842
13842
|
let m = t.tr.step(new Q(e.pos - 1, h, e.pos, h, new D(d, 1, 0), s.length, !0)), g = m.doc.resolve(h + 2 * s.length);
|
|
13843
13843
|
g.nodeAfter && g.nodeAfter.type == u.type && xs(m.doc, g.pos) && m.join(g.pos), n(m.scrollIntoView());
|
|
13844
13844
|
}
|
|
13845
13845
|
return !0;
|
|
13846
13846
|
}
|
|
13847
|
-
let c = i.type.spec.isolating || r > 0 && l ? null : O.findFrom(e, 1), f = c && c.$from.blockRange(c.$to), p = f &&
|
|
13847
|
+
let c = i.type.spec.isolating || r > 0 && l ? null : O.findFrom(e, 1), f = c && c.$from.blockRange(c.$to), p = f && wn(f);
|
|
13848
13848
|
if (p != null && p >= e.depth)
|
|
13849
13849
|
return n && n(t.tr.lift(f, p).scrollIntoView()), !0;
|
|
13850
13850
|
if (a && xt(i, "start", !0) && xt(u, "end")) {
|
|
@@ -13856,9 +13856,9 @@ function Ko(t, e, n, r) {
|
|
|
13856
13856
|
g++;
|
|
13857
13857
|
if (h.canReplace(h.childCount, h.childCount, m.content)) {
|
|
13858
13858
|
if (n) {
|
|
13859
|
-
let b =
|
|
13860
|
-
for (let
|
|
13861
|
-
b =
|
|
13859
|
+
let b = k.empty;
|
|
13860
|
+
for (let y = d.length - 1; y >= 0; y--)
|
|
13861
|
+
b = k.from(d[y].copy(b));
|
|
13862
13862
|
let x = t.tr.step(new Q(e.pos - d.length, e.pos + i.nodeSize, e.pos + g, e.pos + i.nodeSize - g, new D(b, d.length, 0), 0, !0));
|
|
13863
13863
|
n(x.scrollIntoView());
|
|
13864
13864
|
}
|
|
@@ -13938,7 +13938,7 @@ function Th(t) {
|
|
|
13938
13938
|
}
|
|
13939
13939
|
return e;
|
|
13940
13940
|
}
|
|
13941
|
-
function
|
|
13941
|
+
function dn(t, e = null, n) {
|
|
13942
13942
|
let r = (n && n.removeWhenPresent) !== !1, u = (n && n.enterInlineAtoms) !== !1, i = !(n && n.includeWhitespace);
|
|
13943
13943
|
return function(s, o) {
|
|
13944
13944
|
let { empty: l, $cursor: a, ranges: c } = s.selection;
|
|
@@ -13962,7 +13962,7 @@ function hn(t, e = null, n) {
|
|
|
13962
13962
|
if (!f)
|
|
13963
13963
|
p.removeMark(d.pos, m.pos, t);
|
|
13964
13964
|
else {
|
|
13965
|
-
let g = d.pos, b = m.pos, x = d.nodeAfter,
|
|
13965
|
+
let g = d.pos, b = m.pos, x = d.nodeAfter, y = m.nodeBefore, C = i && x && x.isText ? /^\s*/.exec(x.text)[0].length : 0, S = i && y && y.isText ? /\s*$/.exec(y.text)[0].length : 0;
|
|
13966
13966
|
g + C < b && (g += C, b -= S), p.addMark(g, b, t.create(e));
|
|
13967
13967
|
}
|
|
13968
13968
|
}
|
|
@@ -13971,7 +13971,7 @@ function hn(t, e = null, n) {
|
|
|
13971
13971
|
return !0;
|
|
13972
13972
|
};
|
|
13973
13973
|
}
|
|
13974
|
-
function
|
|
13974
|
+
function zn(...t) {
|
|
13975
13975
|
return function(e, n, r) {
|
|
13976
13976
|
for (let u = 0; u < t.length; u++)
|
|
13977
13977
|
if (t[u](e, n, r))
|
|
@@ -13979,13 +13979,13 @@ function Pn(...t) {
|
|
|
13979
13979
|
return !1;
|
|
13980
13980
|
};
|
|
13981
13981
|
}
|
|
13982
|
-
let
|
|
13982
|
+
let gr = zn(lu, Bo, vo), Bi = zn(lu, Po, Lo);
|
|
13983
13983
|
const me = {
|
|
13984
|
-
Enter:
|
|
13984
|
+
Enter: zn(Vo, Wo, Ho, jo),
|
|
13985
13985
|
"Mod-Enter": $o,
|
|
13986
|
-
Backspace:
|
|
13987
|
-
"Mod-Backspace":
|
|
13988
|
-
"Shift-Backspace":
|
|
13986
|
+
Backspace: gr,
|
|
13987
|
+
"Mod-Backspace": gr,
|
|
13988
|
+
"Shift-Backspace": gr,
|
|
13989
13989
|
Delete: Bi,
|
|
13990
13990
|
"Mod-Delete": Bi,
|
|
13991
13991
|
"Mod-a": Uo
|
|
@@ -14001,10 +14001,10 @@ const me = {
|
|
|
14001
14001
|
};
|
|
14002
14002
|
for (let t in me)
|
|
14003
14003
|
cu[t] = me[t];
|
|
14004
|
-
const Oh = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform ? os.platform() == "darwin" : !1, Xo = Oh ? cu : me,
|
|
14004
|
+
const Oh = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform ? os.platform() == "darwin" : !1, Xo = Oh ? cu : me, Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
14005
14005
|
__proto__: null,
|
|
14006
14006
|
baseKeymap: Xo,
|
|
14007
|
-
chainCommands:
|
|
14007
|
+
chainCommands: zn,
|
|
14008
14008
|
createParagraphNear: Wo,
|
|
14009
14009
|
deleteSelection: lu,
|
|
14010
14010
|
exitCode: $o,
|
|
@@ -14023,7 +14023,7 @@ const Oh = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform
|
|
|
14023
14023
|
setBlockType: Mh,
|
|
14024
14024
|
splitBlock: jo,
|
|
14025
14025
|
splitBlockAs: Jo,
|
|
14026
|
-
toggleMark:
|
|
14026
|
+
toggleMark: dn,
|
|
14027
14027
|
wrapIn: Ah
|
|
14028
14028
|
}, Symbol.toStringTag, { value: "Module" })), vi = {
|
|
14029
14029
|
headings: !0,
|
|
@@ -14068,14 +14068,13 @@ const qh = (t) => {
|
|
|
14068
14068
|
} = t, m = j.toSignal(f), g = j.toSignal(a ?? !1), b = j.toSignal(h), x = Li(d ?? vi)((S) => ({
|
|
14069
14069
|
...vi,
|
|
14070
14070
|
...S
|
|
14071
|
-
})),
|
|
14071
|
+
})), y = zi(null), C = ll();
|
|
14072
14072
|
return Pi(
|
|
14073
|
-
on(x),
|
|
14074
14073
|
qi(
|
|
14075
14074
|
al,
|
|
14076
14075
|
({ appearance: S }) => fu.div(
|
|
14077
|
-
|
|
14078
|
-
|
|
14076
|
+
br(() => {
|
|
14077
|
+
y.value?.destroy();
|
|
14079
14078
|
}),
|
|
14080
14079
|
(t.cssInjection ?? "none") === "none" ? null : tl(
|
|
14081
14080
|
() => import("./styles-url-CF_019NX.js"),
|
|
@@ -14095,9 +14094,9 @@ const qh = (t) => {
|
|
|
14095
14094
|
It(
|
|
14096
14095
|
b,
|
|
14097
14096
|
() => It(
|
|
14098
|
-
|
|
14097
|
+
y.map((E) => E != null),
|
|
14099
14098
|
() => ml({
|
|
14100
|
-
view:
|
|
14099
|
+
view: y,
|
|
14101
14100
|
stateUpdate: C,
|
|
14102
14101
|
features: x,
|
|
14103
14102
|
readOnly: m
|
|
@@ -14112,38 +14111,38 @@ const qh = (t) => {
|
|
|
14112
14111
|
const _ = [];
|
|
14113
14112
|
return (() => {
|
|
14114
14113
|
try {
|
|
14115
|
-
const T = j.get(e) ?? "", oe = j.get(m) ?? !1, Ct = j.get(g) ?? !1,
|
|
14114
|
+
const T = j.get(e) ?? "", oe = j.get(m) ?? !1, Ct = j.get(g) ?? !1, Ln = j.get(x), Dt = Ih(
|
|
14116
14115
|
Lr,
|
|
14117
14116
|
a0,
|
|
14118
|
-
|
|
14119
|
-
), Xt = Fi.parse(T) ?? void 0, we = Nh(Dt),
|
|
14117
|
+
Ln
|
|
14118
|
+
), Xt = Fi.parse(T) ?? void 0, we = Nh(Dt), qn = Ue.create({
|
|
14120
14119
|
doc: Xt,
|
|
14121
14120
|
schema: Dt,
|
|
14122
14121
|
plugins: [
|
|
14123
14122
|
hh(),
|
|
14124
|
-
|
|
14123
|
+
mr({
|
|
14125
14124
|
"Mod-z": Ro,
|
|
14126
14125
|
"Mod-y": Pr,
|
|
14127
14126
|
"Mod-Shift-z": Pr
|
|
14128
14127
|
}),
|
|
14129
|
-
|
|
14130
|
-
|
|
14128
|
+
mr(we),
|
|
14129
|
+
mr(Xo),
|
|
14131
14130
|
Fh(C.tick)
|
|
14132
14131
|
]
|
|
14133
14132
|
}), le = new io(E, {
|
|
14134
|
-
state:
|
|
14133
|
+
state: qn,
|
|
14135
14134
|
editable: () => !oe && !Ct,
|
|
14136
14135
|
dispatchTransaction(I) {
|
|
14137
14136
|
const de = le.state.apply(I);
|
|
14138
14137
|
if (le.updateState(de), I.docChanged && r != null) {
|
|
14139
|
-
const Qt =
|
|
14138
|
+
const Qt = cr.serialize(
|
|
14140
14139
|
de.doc
|
|
14141
14140
|
);
|
|
14142
14141
|
r(Qt);
|
|
14143
14142
|
}
|
|
14144
14143
|
}
|
|
14145
14144
|
});
|
|
14146
|
-
if (
|
|
14145
|
+
if (y.set(le), j.get(c) && le.focus(), p != null && _.push(
|
|
14147
14146
|
j.on(p, (I) => {
|
|
14148
14147
|
I != null && I !== "" ? E.setAttribute("data-placeholder", I) : E.removeAttribute("data-placeholder");
|
|
14149
14148
|
})
|
|
@@ -14159,7 +14158,7 @@ const qh = (t) => {
|
|
|
14159
14158
|
})
|
|
14160
14159
|
), _.push(
|
|
14161
14160
|
j.on(e, (I) => {
|
|
14162
|
-
const de =
|
|
14161
|
+
const de = cr.serialize(
|
|
14163
14162
|
le.state.doc
|
|
14164
14163
|
);
|
|
14165
14164
|
if (I !== de) {
|
|
@@ -14176,7 +14175,7 @@ const qh = (t) => {
|
|
|
14176
14175
|
})
|
|
14177
14176
|
), n != null) {
|
|
14178
14177
|
const I = () => {
|
|
14179
|
-
const de =
|
|
14178
|
+
const de = cr.serialize(
|
|
14180
14179
|
le.state.doc
|
|
14181
14180
|
);
|
|
14182
14181
|
n(de);
|
|
@@ -14206,7 +14205,7 @@ const qh = (t) => {
|
|
|
14206
14205
|
const oe = E;
|
|
14207
14206
|
oe.textContent = "Failed to load ProseMirror Editor. Please ensure prosemirror packages are installed.";
|
|
14208
14207
|
}
|
|
14209
|
-
})(),
|
|
14208
|
+
})(), br(() => {
|
|
14210
14209
|
_.forEach((T) => T());
|
|
14211
14210
|
});
|
|
14212
14211
|
})
|
|
@@ -14217,11 +14216,11 @@ const qh = (t) => {
|
|
|
14217
14216
|
};
|
|
14218
14217
|
function Nh(t) {
|
|
14219
14218
|
const e = {}, n = t.marks.strong;
|
|
14220
|
-
n != null && (e["Mod-b"] = (i, s) =>
|
|
14219
|
+
n != null && (e["Mod-b"] = (i, s) => dn(n)(i, s));
|
|
14221
14220
|
const r = t.marks.em;
|
|
14222
|
-
r != null && (e["Mod-i"] = (i, s) =>
|
|
14221
|
+
r != null && (e["Mod-i"] = (i, s) => dn(r)(i, s));
|
|
14223
14222
|
const u = t.marks.code;
|
|
14224
|
-
return u != null && (e["Mod-`"] = (i, s) =>
|
|
14223
|
+
return u != null && (e["Mod-`"] = (i, s) => dn(u)(i, s)), e;
|
|
14225
14224
|
}
|
|
14226
14225
|
function Ih(t, e, n) {
|
|
14227
14226
|
const r = {}, u = {}, i = e.spec.nodes.get("doc"), s = e.spec.nodes.get("text");
|
|
@@ -14277,14 +14276,14 @@ function Ih(t, e, n) {
|
|
|
14277
14276
|
}
|
|
14278
14277
|
export {
|
|
14279
14278
|
vi as D,
|
|
14280
|
-
|
|
14279
|
+
k as F,
|
|
14281
14280
|
El as N,
|
|
14282
14281
|
qh as P,
|
|
14283
14282
|
Q as R,
|
|
14284
14283
|
D as S,
|
|
14285
|
-
|
|
14284
|
+
cn as a,
|
|
14286
14285
|
ml as b,
|
|
14287
14286
|
xs as c,
|
|
14288
14287
|
Gl as f,
|
|
14289
|
-
|
|
14288
|
+
wn as l
|
|
14290
14289
|
};
|