@alxgrn/prose-editor 0.0.27 → 0.0.28
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/prose-editor.es.js
CHANGED
|
@@ -322,7 +322,7 @@ function Kf() {
|
|
|
322
322
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
323
323
|
)), b = this.props.ref, b !== void 0 ? b : null;
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function p(b, A, R, L, le, K) {
|
|
326
326
|
return R = K.ref, b = {
|
|
327
327
|
$$typeof: O,
|
|
328
328
|
type: b,
|
|
@@ -344,7 +344,7 @@ function Kf() {
|
|
|
344
344
|
value: null
|
|
345
345
|
}), Object.freeze && (Object.freeze(b.props), Object.freeze(b)), b;
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function h(b, A, R, L, le, K) {
|
|
348
348
|
if (typeof b == "string" || typeof b == "function" || b === S || b === j || b === $ || b === dt || b === Ee || b === on || typeof b == "object" && b !== null && (b.$$typeof === $t || b.$$typeof === $e || b.$$typeof === _ || b.$$typeof === E || b.$$typeof === Se || b.$$typeof === Rf || b.getModuleId !== void 0)) {
|
|
349
349
|
var F = A.children;
|
|
350
350
|
if (F !== void 0)
|
|
@@ -390,7 +390,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
390
390
|
return F && f(
|
|
391
391
|
R,
|
|
392
392
|
typeof b == "function" ? b.displayName || b.name || "Unknown" : b
|
|
393
|
-
),
|
|
393
|
+
), p(b, F, K, le, c(), R);
|
|
394
394
|
}
|
|
395
395
|
function y(b, A) {
|
|
396
396
|
if (typeof b == "object" && b && b.$$typeof !== If) {
|
|
@@ -437,9 +437,9 @@ Check the top-level render call using <` + b + ">."), A;
|
|
|
437
437
|
r.__reactDisabledLog = !0;
|
|
438
438
|
var ws, Ai, Ms = !1, Ns = new (typeof WeakMap == "function" ? WeakMap : Map)(), If = Symbol.for("react.client.reference"), Ri, Ii = {}, Pi = {}, vi = {};
|
|
439
439
|
Pn.Fragment = S, Pn.jsx = function(b, A, R, L, le) {
|
|
440
|
-
return
|
|
440
|
+
return h(b, A, R, !1, L, le);
|
|
441
441
|
}, Pn.jsxs = function(b, A, R, L, le) {
|
|
442
|
-
return
|
|
442
|
+
return h(b, A, R, !0, L, le);
|
|
443
443
|
};
|
|
444
444
|
}()), Pn;
|
|
445
445
|
}
|
|
@@ -3258,11 +3258,11 @@ function Ar(n, e, t, r) {
|
|
|
3258
3258
|
throw new RangeError("Content hole must be the only child of its parent node");
|
|
3259
3259
|
return { dom: a, contentDOM: a };
|
|
3260
3260
|
} else {
|
|
3261
|
-
let { dom:
|
|
3262
|
-
if (a.appendChild(
|
|
3261
|
+
let { dom: p, contentDOM: h } = Ar(n, d, t, r);
|
|
3262
|
+
if (a.appendChild(p), h) {
|
|
3263
3263
|
if (l)
|
|
3264
3264
|
throw new RangeError("Multiple content holes");
|
|
3265
|
-
l =
|
|
3265
|
+
l = h;
|
|
3266
3266
|
}
|
|
3267
3267
|
}
|
|
3268
3268
|
}
|
|
@@ -3352,11 +3352,11 @@ class we {
|
|
|
3352
3352
|
break;
|
|
3353
3353
|
let c = this.ranges[l + o], u = this.ranges[l + i], f = a + c;
|
|
3354
3354
|
if (e <= f) {
|
|
3355
|
-
let d = c ? e == a ? -1 : e == f ? 1 : t : t,
|
|
3355
|
+
let d = c ? e == a ? -1 : e == f ? 1 : t : t, p = a + s + (d < 0 ? 0 : u);
|
|
3356
3356
|
if (r)
|
|
3357
|
-
return
|
|
3358
|
-
let
|
|
3359
|
-
return (t < 0 ? e != a : e != f) && (y |= oc), new lo(
|
|
3357
|
+
return p;
|
|
3358
|
+
let h = e == (t < 0 ? a : f) ? null : gd(l / 3, e - a), y = e == a ? sc : e == f ? rc : Rr;
|
|
3359
|
+
return (t < 0 ? e != a : e != f) && (y |= oc), new lo(p, y, h);
|
|
3360
3360
|
}
|
|
3361
3361
|
s += u - c;
|
|
3362
3362
|
}
|
|
@@ -3891,10 +3891,10 @@ function bd(n, e, t, r) {
|
|
|
3891
3891
|
return;
|
|
3892
3892
|
let f = a.marks;
|
|
3893
3893
|
if (!r.isInSet(f) && u.type.allowsMarkType(r.type)) {
|
|
3894
|
-
let d = Math.max(c, e),
|
|
3894
|
+
let d = Math.max(c, e), p = Math.min(c + a.nodeSize, t), h = r.addToSet(f);
|
|
3895
3895
|
for (let y = 0; y < f.length; y++)
|
|
3896
|
-
f[y].isInSet(
|
|
3897
|
-
l && l.to == d ? l.to =
|
|
3896
|
+
f[y].isInSet(h) || (i && i.to == d && i.mark.eq(f[y]) ? i.to = p : s.push(i = new _e(d, p, f[y])));
|
|
3897
|
+
l && l.to == d ? l.to = p : o.push(l = new St(d, p, r));
|
|
3898
3898
|
}
|
|
3899
3899
|
}), s.forEach((a) => n.step(a)), o.forEach((a) => n.step(a));
|
|
3900
3900
|
}
|
|
@@ -3914,9 +3914,9 @@ function xd(n, e, t, r) {
|
|
|
3914
3914
|
let c = Math.min(l + i.nodeSize, t);
|
|
3915
3915
|
for (let u = 0; u < a.length; u++) {
|
|
3916
3916
|
let f = a[u], d;
|
|
3917
|
-
for (let
|
|
3918
|
-
let
|
|
3919
|
-
|
|
3917
|
+
for (let p = 0; p < s.length; p++) {
|
|
3918
|
+
let h = s[p];
|
|
3919
|
+
h.step == o - 1 && f.eq(s[p].style) && (d = h);
|
|
3920
3920
|
}
|
|
3921
3921
|
d ? (d.to = c, d.step = o) : s.push({ style: f, from: Math.max(l, e), to: c, step: o });
|
|
3922
3922
|
}
|
|
@@ -3934,9 +3934,9 @@ function Bo(n, e, t, r = t.contentMatch, s = !0) {
|
|
|
3934
3934
|
for (let d = 0; d < c.marks.length; d++)
|
|
3935
3935
|
t.allowsMarkType(c.marks[d].type) || n.step(new _e(l, u, c.marks[d]));
|
|
3936
3936
|
if (s && c.isText && t.whitespace != "pre") {
|
|
3937
|
-
let d,
|
|
3938
|
-
for (; d =
|
|
3939
|
-
|
|
3937
|
+
let d, p = /\r?\n|\r/g, h;
|
|
3938
|
+
for (; d = p.exec(c.text); )
|
|
3939
|
+
h || (h = new M(k.from(t.schema.text(" ", t.allowedMarks(c.marks))), 0, 0)), i.push(new ce(l + d.index, l + d.index + d[0].length, h));
|
|
3940
3940
|
}
|
|
3941
3941
|
}
|
|
3942
3942
|
l = u;
|
|
@@ -3964,12 +3964,12 @@ function ur(n) {
|
|
|
3964
3964
|
}
|
|
3965
3965
|
function Sd(n, e, t) {
|
|
3966
3966
|
let { $from: r, $to: s, depth: o } = e, i = r.before(o + 1), l = s.after(o + 1), a = i, c = l, u = k.empty, f = 0;
|
|
3967
|
-
for (let
|
|
3968
|
-
y || r.index(
|
|
3969
|
-
let d = k.empty,
|
|
3970
|
-
for (let
|
|
3971
|
-
y || s.after(
|
|
3972
|
-
n.step(new oe(a, c, i, l, new M(u.append(d), f,
|
|
3967
|
+
for (let h = o, y = !1; h > t; h--)
|
|
3968
|
+
y || r.index(h) > 0 ? (y = !0, u = k.from(r.node(h).copy(u)), f++) : a--;
|
|
3969
|
+
let d = k.empty, p = 0;
|
|
3970
|
+
for (let h = o, y = !1; h > t; h--)
|
|
3971
|
+
y || s.after(h + 1) < s.end(h) ? (y = !0, d = k.from(s.node(h).copy(d)), p++) : c++;
|
|
3972
|
+
n.step(new oe(a, c, i, l, new M(u.append(d), f, p), u.size - f, !0));
|
|
3973
3973
|
}
|
|
3974
3974
|
function Lo(n, e, t = null, r = n) {
|
|
3975
3975
|
let s = Cd(n, e), o = s && wd(r, e);
|
|
@@ -4016,8 +4016,8 @@ function Nd(n, e, t, r, s) {
|
|
|
4016
4016
|
if (i.isTextblock && !i.hasMarkup(r, a) && Dd(n.doc, n.mapping.slice(o).map(l), r)) {
|
|
4017
4017
|
let c = null;
|
|
4018
4018
|
if (r.schema.linebreakReplacement) {
|
|
4019
|
-
let
|
|
4020
|
-
|
|
4019
|
+
let p = r.whitespace == "pre", h = !!r.contentMatch.matchType(r.schema.linebreakReplacement);
|
|
4020
|
+
p && !h ? c = !1 : !p && h && (c = !0);
|
|
4021
4021
|
}
|
|
4022
4022
|
c === !1 && lc(n, i, l, o), Bo(n, n.mapping.slice(o).map(l, 1), r, void 0, c === null);
|
|
4023
4023
|
let u = n.mapping.slice(o), f = u.map(l, 1), d = u.map(l + i.nodeSize, 1);
|
|
@@ -4069,10 +4069,10 @@ function bn(n, e, t = 1, r) {
|
|
|
4069
4069
|
let f = s.node(c), d = s.index(c);
|
|
4070
4070
|
if (f.type.spec.isolating)
|
|
4071
4071
|
return !1;
|
|
4072
|
-
let
|
|
4073
|
-
|
|
4072
|
+
let p = f.content.cutByIndex(d, f.childCount), h = r && r[u + 1];
|
|
4073
|
+
h && (p = p.replaceChild(0, h.type.create(h.attrs)));
|
|
4074
4074
|
let y = r && r[u] || f;
|
|
4075
|
-
if (!f.canReplace(d + 1, f.childCount) || !y.type.validContent(
|
|
4075
|
+
if (!f.canReplace(d + 1, f.childCount) || !y.type.validContent(p))
|
|
4076
4076
|
return !1;
|
|
4077
4077
|
}
|
|
4078
4078
|
let l = s.indexAfter(o), a = r && r[0];
|
|
@@ -4272,20 +4272,20 @@ class Id {
|
|
|
4272
4272
|
u.push(s.child(y));
|
|
4273
4273
|
f = f.matchFragment(s);
|
|
4274
4274
|
}
|
|
4275
|
-
let
|
|
4275
|
+
let p = l.size + e - (i.content.size - i.openEnd);
|
|
4276
4276
|
for (; c < l.childCount; ) {
|
|
4277
4277
|
let y = l.child(c), m = f.matchType(y.type);
|
|
4278
4278
|
if (!m)
|
|
4279
4279
|
break;
|
|
4280
|
-
c++, (c > 1 || a == 0 || y.content.size) && (f = m, u.push(fc(y.mark(d.allowedMarks(y.marks)), c == 1 ? a : 0, c == l.childCount ?
|
|
4280
|
+
c++, (c > 1 || a == 0 || y.content.size) && (f = m, u.push(fc(y.mark(d.allowedMarks(y.marks)), c == 1 ? a : 0, c == l.childCount ? p : -1)));
|
|
4281
4281
|
}
|
|
4282
|
-
let
|
|
4283
|
-
|
|
4284
|
-
for (let y = 0, m = l; y <
|
|
4282
|
+
let h = c == l.childCount;
|
|
4283
|
+
h || (p = -1), this.placed = $n(this.placed, t, k.from(u)), this.frontier[t].match = f, h && p < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
|
|
4284
|
+
for (let y = 0, m = l; y < p; y++) {
|
|
4285
4285
|
let x = m.lastChild;
|
|
4286
4286
|
this.frontier.push({ type: x.type, match: x.contentMatchAt(x.childCount) }), m = x.content;
|
|
4287
4287
|
}
|
|
4288
|
-
this.unplaced =
|
|
4288
|
+
this.unplaced = h ? e == 0 ? M.empty : new M(Vn(i.content, e - 1, 1), e - 1, p < 0 ? i.openEnd : e - 1) : new M(Vn(i.content, e, c), i.openStart, i.openEnd);
|
|
4289
4289
|
}
|
|
4290
4290
|
mustMoveInline() {
|
|
4291
4291
|
if (!this.$to.parent.isTextblock)
|
|
@@ -4376,41 +4376,41 @@ function Vd(n, e, t, r) {
|
|
|
4376
4376
|
i[i.length - 1] == 0 && i.pop();
|
|
4377
4377
|
let l = -(s.depth + 1);
|
|
4378
4378
|
i.unshift(l);
|
|
4379
|
-
for (let d = s.depth,
|
|
4380
|
-
let
|
|
4381
|
-
if (
|
|
4379
|
+
for (let d = s.depth, p = s.pos - 1; d > 0; d--, p--) {
|
|
4380
|
+
let h = s.node(d).type.spec;
|
|
4381
|
+
if (h.defining || h.definingAsContext || h.isolating)
|
|
4382
4382
|
break;
|
|
4383
|
-
i.indexOf(d) > -1 ? l = d : s.before(d) ==
|
|
4383
|
+
i.indexOf(d) > -1 ? l = d : s.before(d) == p && i.splice(1, 0, -d);
|
|
4384
4384
|
}
|
|
4385
4385
|
let a = i.indexOf(l), c = [], u = r.openStart;
|
|
4386
|
-
for (let d = r.content,
|
|
4387
|
-
let
|
|
4388
|
-
if (c.push(
|
|
4386
|
+
for (let d = r.content, p = 0; ; p++) {
|
|
4387
|
+
let h = d.firstChild;
|
|
4388
|
+
if (c.push(h), p == r.openStart)
|
|
4389
4389
|
break;
|
|
4390
|
-
d =
|
|
4390
|
+
d = h.content;
|
|
4391
4391
|
}
|
|
4392
4392
|
for (let d = u - 1; d >= 0; d--) {
|
|
4393
|
-
let
|
|
4394
|
-
if (
|
|
4393
|
+
let p = c[d], h = vd(p.type);
|
|
4394
|
+
if (h && !p.sameMarkup(s.node(Math.abs(l) - 1)))
|
|
4395
4395
|
u = d;
|
|
4396
|
-
else if (
|
|
4396
|
+
else if (h || !p.type.isTextblock)
|
|
4397
4397
|
break;
|
|
4398
4398
|
}
|
|
4399
4399
|
for (let d = r.openStart; d >= 0; d--) {
|
|
4400
|
-
let
|
|
4401
|
-
if (
|
|
4400
|
+
let p = (d + u + 1) % (r.openStart + 1), h = c[p];
|
|
4401
|
+
if (h)
|
|
4402
4402
|
for (let y = 0; y < i.length; y++) {
|
|
4403
4403
|
let m = i[(y + a) % i.length], x = !0;
|
|
4404
4404
|
m < 0 && (x = !1, m = -m);
|
|
4405
4405
|
let C = s.node(m - 1), w = s.index(m - 1);
|
|
4406
|
-
if (C.canReplaceWith(w, w,
|
|
4407
|
-
return n.replace(s.before(m), x ? o.after(m) : t, new M(dc(r.content, 0, r.openStart,
|
|
4406
|
+
if (C.canReplaceWith(w, w, h.type, h.marks))
|
|
4407
|
+
return n.replace(s.before(m), x ? o.after(m) : t, new M(dc(r.content, 0, r.openStart, p), p, r.openEnd));
|
|
4408
4408
|
}
|
|
4409
4409
|
}
|
|
4410
4410
|
let f = n.steps.length;
|
|
4411
4411
|
for (let d = i.length - 1; d >= 0 && (n.replace(e, t, r), !(n.steps.length > f)); d--) {
|
|
4412
|
-
let
|
|
4413
|
-
|
|
4412
|
+
let p = i[d];
|
|
4413
|
+
p < 0 || (e = s.before(p), t = o.after(p));
|
|
4414
4414
|
}
|
|
4415
4415
|
}
|
|
4416
4416
|
function dc(n, e, t, r, s) {
|
|
@@ -5693,8 +5693,8 @@ class ze {
|
|
|
5693
5693
|
}
|
|
5694
5694
|
if (s) {
|
|
5695
5695
|
u.push(new We(f.map));
|
|
5696
|
-
let
|
|
5697
|
-
|
|
5696
|
+
let p = f.step.map(s.slice(o)), h;
|
|
5697
|
+
p && i.maybeStep(p).doc && (h = i.mapping.maps[i.mapping.maps.length - 1], c.push(new We(h, void 0, void 0, c.length + u.length))), o--, h && s.appendMap(h, o);
|
|
5698
5698
|
} else
|
|
5699
5699
|
i.maybeStep(f.step);
|
|
5700
5700
|
if (f.selection)
|
|
@@ -5705,8 +5705,8 @@ class ze {
|
|
|
5705
5705
|
addTransform(e, t, r, s) {
|
|
5706
5706
|
let o = [], i = this.eventCount, l = this.items, a = !s && l.length ? l.get(l.length - 1) : null;
|
|
5707
5707
|
for (let u = 0; u < e.steps.length; u++) {
|
|
5708
|
-
let f = e.steps[u].invert(e.docs[u]), d = new We(e.mapping.maps[u], f, t),
|
|
5709
|
-
(
|
|
5708
|
+
let f = e.steps[u].invert(e.docs[u]), d = new We(e.mapping.maps[u], f, t), p;
|
|
5709
|
+
(p = a && a.merge(d)) && (d = p, u ? o.pop() : l = l.slice(0, l.length - 1)), o.push(d), t && (i++, t = void 0), s || (a = d);
|
|
5710
5710
|
}
|
|
5711
5711
|
let c = i - r.depth;
|
|
5712
5712
|
return c > qd && (l = _d(l, c), i -= c), new ze(l.append(o), i);
|
|
@@ -5734,16 +5734,16 @@ class ze {
|
|
|
5734
5734
|
}, s);
|
|
5735
5735
|
let a = t;
|
|
5736
5736
|
this.items.forEach((d) => {
|
|
5737
|
-
let
|
|
5738
|
-
if (
|
|
5737
|
+
let p = o.getMirror(--a);
|
|
5738
|
+
if (p == null)
|
|
5739
5739
|
return;
|
|
5740
|
-
i = Math.min(i,
|
|
5741
|
-
let
|
|
5740
|
+
i = Math.min(i, p);
|
|
5741
|
+
let h = o.maps[p];
|
|
5742
5742
|
if (d.step) {
|
|
5743
|
-
let y = e.steps[
|
|
5744
|
-
m && l++, r.push(new We(
|
|
5743
|
+
let y = e.steps[p].invert(e.docs[p]), m = d.selection && d.selection.map(o.slice(a + 1, p));
|
|
5744
|
+
m && l++, r.push(new We(h, y, m));
|
|
5745
5745
|
} else
|
|
5746
|
-
r.push(new We(
|
|
5746
|
+
r.push(new We(h));
|
|
5747
5747
|
}, s);
|
|
5748
5748
|
let c = [];
|
|
5749
5749
|
for (let d = t; d < i; d++)
|
|
@@ -5773,8 +5773,8 @@ class ze {
|
|
|
5773
5773
|
if (r--, c && t.appendMap(c, r), a) {
|
|
5774
5774
|
let u = i.selection && i.selection.map(t.slice(r));
|
|
5775
5775
|
u && o++;
|
|
5776
|
-
let f = new We(c.invert(), a, u), d,
|
|
5777
|
-
(d = s.length && s[
|
|
5776
|
+
let f = new We(c.invert(), a, u), d, p = s.length - 1;
|
|
5777
|
+
(d = s.length && s[p].merge(f)) ? s[p] = d : s.push(f);
|
|
5778
5778
|
}
|
|
5779
5779
|
} else i.map && r--;
|
|
5780
5780
|
}, this.items.length, 0), new ze(ee.from(s.reverse()), o);
|
|
@@ -6247,12 +6247,12 @@ function dh(n) {
|
|
|
6247
6247
|
if (!r.depth)
|
|
6248
6248
|
return !1;
|
|
6249
6249
|
let o = [], i, l, a = !1, c = !1;
|
|
6250
|
-
for (let
|
|
6251
|
-
if (r.node(
|
|
6252
|
-
a = r.end(
|
|
6250
|
+
for (let p = r.depth; ; p--)
|
|
6251
|
+
if (r.node(p).isBlock) {
|
|
6252
|
+
a = r.end(p) == r.pos + (r.depth - p), c = r.start(p) == r.pos - (r.depth - p), l = Uo(r.node(p - 1).contentMatchAt(r.indexAfter(p - 1))), o.unshift(a && l ? { type: l } : null), i = p;
|
|
6253
6253
|
break;
|
|
6254
6254
|
} else {
|
|
6255
|
-
if (
|
|
6255
|
+
if (p == 1)
|
|
6256
6256
|
return !1;
|
|
6257
6257
|
o.unshift(null);
|
|
6258
6258
|
}
|
|
@@ -6262,8 +6262,8 @@ function dh(n) {
|
|
|
6262
6262
|
if (d || (o[0] = l ? { type: l } : null, d = bn(u.doc, f, o.length, o)), !d)
|
|
6263
6263
|
return !1;
|
|
6264
6264
|
if (u.split(f, o.length, o), !a && c && r.node(i).type != l) {
|
|
6265
|
-
let
|
|
6266
|
-
l && r.node(i - 1).canReplaceWith(
|
|
6265
|
+
let p = u.mapping.map(r.before(i)), h = u.doc.resolve(p);
|
|
6266
|
+
l && r.node(i - 1).canReplaceWith(h.index(), h.index() + 1, l) && u.setNodeMarkup(u.mapping.map(r.before(i)), l);
|
|
6267
6267
|
}
|
|
6268
6268
|
return t && t(u.scrollIntoView()), !0;
|
|
6269
6269
|
};
|
|
@@ -6283,11 +6283,11 @@ function Nc(n, e, t, r) {
|
|
|
6283
6283
|
let c = !a && e.parent.canReplace(e.index(), e.index() + 1);
|
|
6284
6284
|
if (c && (i = (l = s.contentMatchAt(s.childCount)).findWrapping(o.type)) && l.matchType(i[0] || o.type).validEnd) {
|
|
6285
6285
|
if (t) {
|
|
6286
|
-
let
|
|
6286
|
+
let p = e.pos + o.nodeSize, h = k.empty;
|
|
6287
6287
|
for (let x = i.length - 1; x >= 0; x--)
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
let y = n.tr.step(new oe(e.pos - 1,
|
|
6288
|
+
h = k.from(i[x].create(null, h));
|
|
6289
|
+
h = k.from(s.copy(h));
|
|
6290
|
+
let y = n.tr.step(new oe(e.pos - 1, p, e.pos, p, new M(h, 1, 0), i.length, !0)), m = y.doc.resolve(p + 2 * i.length);
|
|
6291
6291
|
m.nodeAfter && m.nodeAfter.type == s.type && En(y.doc, m.pos) && y.join(m.pos), t(y.scrollIntoView());
|
|
6292
6292
|
}
|
|
6293
6293
|
return !0;
|
|
@@ -6296,18 +6296,18 @@ function Nc(n, e, t, r) {
|
|
|
6296
6296
|
if (d != null && d >= e.depth)
|
|
6297
6297
|
return t && t(n.tr.lift(f, d).scrollIntoView()), !0;
|
|
6298
6298
|
if (c && Nn(o, "start", !0) && Nn(s, "end")) {
|
|
6299
|
-
let
|
|
6300
|
-
for (;
|
|
6301
|
-
|
|
6299
|
+
let p = s, h = [];
|
|
6300
|
+
for (; h.push(p), !p.isTextblock; )
|
|
6301
|
+
p = p.lastChild;
|
|
6302
6302
|
let y = o, m = 1;
|
|
6303
6303
|
for (; !y.isTextblock; y = y.firstChild)
|
|
6304
6304
|
m++;
|
|
6305
|
-
if (
|
|
6305
|
+
if (p.canReplace(p.childCount, p.childCount, y.content)) {
|
|
6306
6306
|
if (t) {
|
|
6307
6307
|
let x = k.empty;
|
|
6308
|
-
for (let w =
|
|
6309
|
-
x = k.from(
|
|
6310
|
-
let C = n.tr.step(new oe(e.pos -
|
|
6308
|
+
for (let w = h.length - 1; w >= 0; w--)
|
|
6309
|
+
x = k.from(h[w].copy(x));
|
|
6310
|
+
let C = n.tr.step(new oe(e.pos - h.length, e.pos + o.nodeSize, e.pos + m, e.pos + o.nodeSize - m, new M(x, h.length, 0), 0, !0));
|
|
6311
6311
|
t(C.scrollIntoView());
|
|
6312
6312
|
}
|
|
6313
6313
|
return !0;
|
|
@@ -6391,8 +6391,8 @@ function Ce(n, e = null, t) {
|
|
|
6391
6391
|
if (!a)
|
|
6392
6392
|
c.removeMark(f.pos, d.pos, n);
|
|
6393
6393
|
else {
|
|
6394
|
-
let
|
|
6395
|
-
|
|
6394
|
+
let p = f.pos, h = d.pos, y = f.nodeAfter, m = d.nodeBefore, x = y && y.isText ? /^\s*/.exec(y.text)[0].length : 0, C = m && m.isText ? /\s*$/.exec(m.text)[0].length : 0;
|
|
6395
|
+
p + x < h && (p += x, h -= C), c.addMark(p, h, n.create(e));
|
|
6396
6396
|
}
|
|
6397
6397
|
}
|
|
6398
6398
|
s(c.scrollIntoView());
|
|
@@ -6462,12 +6462,12 @@ class Ch {
|
|
|
6462
6462
|
if (t) {
|
|
6463
6463
|
let f = e.nodeBefore, d = e.nodeAfter;
|
|
6464
6464
|
if (f || d) {
|
|
6465
|
-
let
|
|
6466
|
-
if (
|
|
6467
|
-
let
|
|
6465
|
+
let p = this.editorView.nodeDOM(this.cursorPos - (f ? f.nodeSize : 0));
|
|
6466
|
+
if (p) {
|
|
6467
|
+
let h = p.getBoundingClientRect(), y = f ? h.bottom : h.top;
|
|
6468
6468
|
f && d && (y = (y + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2);
|
|
6469
6469
|
let m = this.width / 2 * l;
|
|
6470
|
-
r = { left:
|
|
6470
|
+
r = { left: h.left, right: h.right, top: y - m, bottom: y + m };
|
|
6471
6471
|
}
|
|
6472
6472
|
}
|
|
6473
6473
|
}
|
|
@@ -6481,8 +6481,8 @@ class Ch {
|
|
|
6481
6481
|
if (!a || a == document.body && getComputedStyle(a).position == "static")
|
|
6482
6482
|
c = -pageXOffset, u = -pageYOffset;
|
|
6483
6483
|
else {
|
|
6484
|
-
let f = a.getBoundingClientRect(), d = f.width / a.offsetWidth,
|
|
6485
|
-
c = f.left - a.scrollLeft * d, u = f.top - a.scrollTop *
|
|
6484
|
+
let f = a.getBoundingClientRect(), d = f.width / a.offsetWidth, p = f.height / a.offsetHeight;
|
|
6485
|
+
c = f.left - a.scrollLeft * d, u = f.top - a.scrollTop * p;
|
|
6486
6486
|
}
|
|
6487
6487
|
this.element.style.left = (r.left - c) / i + "px", this.element.style.top = (r.top - u) / l + "px", this.element.style.width = (r.right - r.left) / i + "px", this.element.style.height = (r.bottom - r.top) / l + "px";
|
|
6488
6488
|
}
|
|
@@ -6659,10 +6659,10 @@ function cl(n, e, t) {
|
|
|
6659
6659
|
if (a)
|
|
6660
6660
|
o.defaultView.scrollBy(u, f);
|
|
6661
6661
|
else {
|
|
6662
|
-
let d = l.scrollLeft,
|
|
6662
|
+
let d = l.scrollLeft, p = l.scrollTop;
|
|
6663
6663
|
f && (l.scrollTop += f), u && (l.scrollLeft += u);
|
|
6664
|
-
let
|
|
6665
|
-
e = { left: e.left -
|
|
6664
|
+
let h = l.scrollLeft - d, y = l.scrollTop - p;
|
|
6665
|
+
e = { left: e.left - h, top: e.top - y, right: e.right - h, bottom: e.bottom - y };
|
|
6666
6666
|
}
|
|
6667
6667
|
if (a || /^(fixed|sticky)$/.test(getComputedStyle(i).position))
|
|
6668
6668
|
break;
|
|
@@ -6721,20 +6721,20 @@ function Pc(n, e) {
|
|
|
6721
6721
|
d = ot(u).getClientRects();
|
|
6722
6722
|
else
|
|
6723
6723
|
continue;
|
|
6724
|
-
for (let
|
|
6725
|
-
let
|
|
6726
|
-
if (
|
|
6727
|
-
i = Math.max(
|
|
6728
|
-
let y =
|
|
6724
|
+
for (let p = 0; p < d.length; p++) {
|
|
6725
|
+
let h = d[p];
|
|
6726
|
+
if (h.top <= i && h.bottom >= l) {
|
|
6727
|
+
i = Math.max(h.bottom, i), l = Math.min(h.top, l);
|
|
6728
|
+
let y = h.left > e.left ? h.left - e.left : h.right < e.left ? e.left - h.right : 0;
|
|
6729
6729
|
if (y < r) {
|
|
6730
6730
|
t = u, r = y, s = y && t.nodeType == 3 ? {
|
|
6731
|
-
left:
|
|
6731
|
+
left: h.right < e.left ? h.right : h.left,
|
|
6732
6732
|
top: e.top
|
|
6733
|
-
} : e, u.nodeType == 1 && y && (o = f + (e.left >= (
|
|
6733
|
+
} : e, u.nodeType == 1 && y && (o = f + (e.left >= (h.left + h.right) / 2 ? 1 : 0));
|
|
6734
6734
|
continue;
|
|
6735
6735
|
}
|
|
6736
|
-
} else
|
|
6737
|
-
!t && (e.left >=
|
|
6736
|
+
} else h.top > e.top && !a && h.left <= e.left && h.right >= e.left && (a = u, c = { left: Math.max(h.left, Math.min(h.right, e.left)), top: h.top });
|
|
6737
|
+
!t && (e.left >= h.right && e.top >= h.top || e.left >= h.left && e.top >= h.bottom) && (o = f + 1);
|
|
6738
6738
|
}
|
|
6739
6739
|
}
|
|
6740
6740
|
return !t && a && (t = a, s = c, r = 0), t && t.nodeType == 3 ? zh(t, s) : !t || r && t.nodeType == 1 ? { node: n, offset: o } : Pc(t, s);
|
|
@@ -6940,7 +6940,7 @@ function Hh(n, e, t) {
|
|
|
6940
6940
|
return l ? !qh.test(r.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? o : i : $c(n, e, () => {
|
|
6941
6941
|
let { focusNode: a, focusOffset: c, anchorNode: u, anchorOffset: f } = n.domSelectionRange(), d = l.caretBidiLevel;
|
|
6942
6942
|
l.modify("move", t, "character");
|
|
6943
|
-
let
|
|
6943
|
+
let p = r.depth ? n.docView.domAfterPos(r.before()) : n.dom, { focusNode: h, focusOffset: y } = n.domSelectionRange(), m = h && !p.contains(h.nodeType == 1 ? h : h.parentNode) || a == h && c == y;
|
|
6944
6944
|
try {
|
|
6945
6945
|
l.collapse(u, f), a && (a != u || c != f) && l.extend && l.extend(a, c);
|
|
6946
6946
|
} catch {
|
|
@@ -7199,19 +7199,19 @@ let hr = class {
|
|
|
7199
7199
|
// case we just use whatever domFromPos produces as a best effort.
|
|
7200
7200
|
setSelection(e, t, r, s = !1) {
|
|
7201
7201
|
let o = Math.min(e, t), i = Math.max(e, t);
|
|
7202
|
-
for (let
|
|
7203
|
-
let y = this.children[
|
|
7204
|
-
if (o >
|
|
7205
|
-
return y.setSelection(e -
|
|
7206
|
-
|
|
7202
|
+
for (let p = 0, h = 0; p < this.children.length; p++) {
|
|
7203
|
+
let y = this.children[p], m = h + y.size;
|
|
7204
|
+
if (o > h && i < m)
|
|
7205
|
+
return y.setSelection(e - h - y.border, t - h - y.border, r, s);
|
|
7206
|
+
h = m;
|
|
7207
7207
|
}
|
|
7208
7208
|
let l = this.domFromPos(e, e ? -1 : 1), a = t == e ? l : this.domFromPos(t, t ? -1 : 1), c = r.root.getSelection(), u = r.domSelectionRange(), f = !1;
|
|
7209
7209
|
if ((je || me) && e == t) {
|
|
7210
|
-
let { node:
|
|
7211
|
-
if (
|
|
7212
|
-
if (f = !!(
|
|
7213
|
-
`), f &&
|
|
7214
|
-
for (let y =
|
|
7210
|
+
let { node: p, offset: h } = l;
|
|
7211
|
+
if (p.nodeType == 3) {
|
|
7212
|
+
if (f = !!(h && p.nodeValue[h - 1] == `
|
|
7213
|
+
`), f && h == p.nodeValue.length)
|
|
7214
|
+
for (let y = p, m; y; y = y.parentNode) {
|
|
7215
7215
|
if (m = y.nextSibling) {
|
|
7216
7216
|
m.nodeName == "BR" && (l = a = { node: m.parentNode, offset: re(m) + 1 });
|
|
7217
7217
|
break;
|
|
@@ -7221,13 +7221,13 @@ let hr = class {
|
|
|
7221
7221
|
break;
|
|
7222
7222
|
}
|
|
7223
7223
|
} else {
|
|
7224
|
-
let y =
|
|
7224
|
+
let y = p.childNodes[h - 1];
|
|
7225
7225
|
f = y && (y.nodeName == "BR" || y.contentEditable == "false");
|
|
7226
7226
|
}
|
|
7227
7227
|
}
|
|
7228
7228
|
if (je && u.focusNode && u.focusNode != a.node && u.focusNode.nodeType == 1) {
|
|
7229
|
-
let
|
|
7230
|
-
|
|
7229
|
+
let p = u.focusNode.childNodes[u.focusOffset];
|
|
7230
|
+
p && p.contentEditable == "false" && (s = !0);
|
|
7231
7231
|
}
|
|
7232
7232
|
if (!(s || f && me) && Zt(l.node, l.offset, u.anchorNode, u.anchorOffset) && Zt(a.node, a.offset, u.focusNode, u.focusOffset))
|
|
7233
7233
|
return;
|
|
@@ -7241,11 +7241,11 @@ let hr = class {
|
|
|
7241
7241
|
}
|
|
7242
7242
|
if (!d) {
|
|
7243
7243
|
if (e > t) {
|
|
7244
|
-
let
|
|
7245
|
-
l = a, a =
|
|
7244
|
+
let h = l;
|
|
7245
|
+
l = a, a = h;
|
|
7246
7246
|
}
|
|
7247
|
-
let
|
|
7248
|
-
|
|
7247
|
+
let p = document.createRange();
|
|
7248
|
+
p.setEnd(a.node, a.offset), p.setStart(l.node, l.offset), c.removeAllRanges(), c.addRange(p);
|
|
7249
7249
|
}
|
|
7250
7250
|
}
|
|
7251
7251
|
ignoreMutation(e) {
|
|
@@ -7446,8 +7446,8 @@ let hr = class {
|
|
|
7446
7446
|
c.spec.marks ? a.syncToMarks(c.spec.marks, r, e) : c.type.side >= 0 && !f && a.syncToMarks(u == this.node.childCount ? W.none : this.node.child(u).marks, r, e), a.placeWidget(c, e, s);
|
|
7447
7447
|
}, (c, u, f, d) => {
|
|
7448
7448
|
a.syncToMarks(c.marks, r, e);
|
|
7449
|
-
let
|
|
7450
|
-
a.findNodeMatch(c, u, f, d) || l && e.state.selection.from > s && e.state.selection.to < s + c.nodeSize && (
|
|
7449
|
+
let p;
|
|
7450
|
+
a.findNodeMatch(c, u, f, d) || l && e.state.selection.from > s && e.state.selection.to < s + c.nodeSize && (p = a.findIndexWithChild(o.node)) > -1 && a.updateNodeAt(c, u, f, p, e) || a.updateNextNode(c, u, f, e, d, s) || a.addNode(c, u, f, e, s), s += c.nodeSize;
|
|
7451
7451
|
}), a.syncToMarks([], r, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Wt) && (i && this.protectLocalComposition(e, i), Wc(this.contentDOM, this.children, e), Dn && ep(this.dom));
|
|
7452
7452
|
}
|
|
7453
7453
|
localCompositionInfo(e, t) {
|
|
@@ -7892,29 +7892,29 @@ function Zh(n, e, t, r) {
|
|
|
7892
7892
|
t(f[m], c, !!a);
|
|
7893
7893
|
} else
|
|
7894
7894
|
t(u, c, !!a);
|
|
7895
|
-
let d,
|
|
7895
|
+
let d, p;
|
|
7896
7896
|
if (a)
|
|
7897
|
-
|
|
7897
|
+
p = -1, d = a, a = null;
|
|
7898
7898
|
else if (c < n.childCount)
|
|
7899
|
-
|
|
7899
|
+
p = c, d = n.child(c++);
|
|
7900
7900
|
else
|
|
7901
7901
|
break;
|
|
7902
7902
|
for (let m = 0; m < l.length; m++)
|
|
7903
7903
|
l[m].to <= o && l.splice(m--, 1);
|
|
7904
7904
|
for (; i < s.length && s[i].from <= o && s[i].to > o; )
|
|
7905
7905
|
l.push(s[i++]);
|
|
7906
|
-
let
|
|
7906
|
+
let h = o + d.nodeSize;
|
|
7907
7907
|
if (d.isText) {
|
|
7908
|
-
let m =
|
|
7908
|
+
let m = h;
|
|
7909
7909
|
i < s.length && s[i].from < m && (m = s[i].from);
|
|
7910
7910
|
for (let x = 0; x < l.length; x++)
|
|
7911
7911
|
l[x].to < m && (m = l[x].to);
|
|
7912
|
-
m <
|
|
7912
|
+
m < h && (a = d.cut(m - o), d = d.cut(0, m - o), h = m, p = -1);
|
|
7913
7913
|
} else
|
|
7914
|
-
for (; i < s.length && s[i].to <
|
|
7914
|
+
for (; i < s.length && s[i].to < h; )
|
|
7915
7915
|
i++;
|
|
7916
7916
|
let y = d.isInline && !d.isLeaf ? l.filter((m) => !m.inline) : l.slice();
|
|
7917
|
-
r(d, y, e.forChild(o, d),
|
|
7917
|
+
r(d, y, e.forChild(o, d), p), o = h;
|
|
7918
7918
|
}
|
|
7919
7919
|
}
|
|
7920
7920
|
function ep(n) {
|
|
@@ -7974,9 +7974,9 @@ function Go(n, e = null) {
|
|
|
7974
7974
|
} else {
|
|
7975
7975
|
if (t instanceof n.dom.ownerDocument.defaultView.Selection && t.rangeCount > 1) {
|
|
7976
7976
|
let f = i, d = i;
|
|
7977
|
-
for (let
|
|
7978
|
-
let
|
|
7979
|
-
f = Math.min(f, n.docView.posFromDOM(
|
|
7977
|
+
for (let p = 0; p < t.rangeCount; p++) {
|
|
7978
|
+
let h = t.getRangeAt(p);
|
|
7979
|
+
f = Math.min(f, n.docView.posFromDOM(h.startContainer, h.startOffset, 1)), d = Math.max(d, n.docView.posFromDOM(h.endContainer, h.endOffset, -1));
|
|
7980
7980
|
}
|
|
7981
7981
|
if (f < 0)
|
|
7982
7982
|
return null;
|
|
@@ -8333,29 +8333,29 @@ function fp(n, e) {
|
|
|
8333
8333
|
return !1;
|
|
8334
8334
|
}
|
|
8335
8335
|
function Yc(n, e) {
|
|
8336
|
-
n.someProp("transformCopied", (
|
|
8337
|
-
e =
|
|
8336
|
+
n.someProp("transformCopied", (p) => {
|
|
8337
|
+
e = p(e, n);
|
|
8338
8338
|
});
|
|
8339
8339
|
let t = [], { content: r, openStart: s, openEnd: o } = e;
|
|
8340
8340
|
for (; s > 1 && o > 1 && r.childCount == 1 && r.firstChild.childCount == 1; ) {
|
|
8341
8341
|
s--, o--;
|
|
8342
|
-
let
|
|
8343
|
-
t.push(
|
|
8342
|
+
let p = r.firstChild;
|
|
8343
|
+
t.push(p.type.name, p.attrs != p.type.defaultAttrs ? p.attrs : null), r = p.content;
|
|
8344
8344
|
}
|
|
8345
8345
|
let i = n.someProp("clipboardSerializer") || Xe.fromSchema(n.state.schema), l = tu(), a = l.createElement("div");
|
|
8346
8346
|
a.appendChild(i.serializeFragment(r, { document: l }));
|
|
8347
8347
|
let c = a.firstChild, u, f = 0;
|
|
8348
8348
|
for (; c && c.nodeType == 1 && (u = eu[c.nodeName.toLowerCase()]); ) {
|
|
8349
|
-
for (let
|
|
8350
|
-
let
|
|
8349
|
+
for (let p = u.length - 1; p >= 0; p--) {
|
|
8350
|
+
let h = l.createElement(u[p]);
|
|
8351
8351
|
for (; a.firstChild; )
|
|
8352
|
-
|
|
8353
|
-
a.appendChild(
|
|
8352
|
+
h.appendChild(a.firstChild);
|
|
8353
|
+
a.appendChild(h), f++;
|
|
8354
8354
|
}
|
|
8355
8355
|
c = a.firstChild;
|
|
8356
8356
|
}
|
|
8357
8357
|
c && c.nodeType == 1 && c.setAttribute("data-pm-slice", `${s} ${o}${f ? ` -${f}` : ""} ${JSON.stringify(t)}`);
|
|
8358
|
-
let d = n.someProp("clipboardTextSerializer", (
|
|
8358
|
+
let d = n.someProp("clipboardTextSerializer", (p) => p(e, n)) || e.content.textBetween(0, e.content.size, `
|
|
8359
8359
|
|
|
8360
8360
|
`);
|
|
8361
8361
|
return { dom: a, text: d, slice: e };
|
|
@@ -8375,10 +8375,10 @@ function Gc(n, e, t, r, s) {
|
|
|
8375
8375
|
if (f)
|
|
8376
8376
|
l = f;
|
|
8377
8377
|
else {
|
|
8378
|
-
let d = s.marks(), { schema:
|
|
8378
|
+
let d = s.marks(), { schema: p } = n.state, h = Xe.fromSchema(p);
|
|
8379
8379
|
i = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((y) => {
|
|
8380
8380
|
let m = i.appendChild(document.createElement("p"));
|
|
8381
|
-
y && m.appendChild(
|
|
8381
|
+
y && m.appendChild(h.serializeNode(p.text(y, d)));
|
|
8382
8382
|
});
|
|
8383
8383
|
}
|
|
8384
8384
|
} else
|
|
@@ -8405,9 +8405,9 @@ function Gc(n, e, t, r, s) {
|
|
|
8405
8405
|
l = yp(Ol(l, +u[1], +u[2]), u[4]);
|
|
8406
8406
|
else if (l = M.maxOpen(hp(l.content, s), !0), l.openStart || l.openEnd) {
|
|
8407
8407
|
let f = 0, d = 0;
|
|
8408
|
-
for (let
|
|
8408
|
+
for (let p = l.content.firstChild; f < l.openStart && !p.type.spec.isolating; f++, p = p.firstChild)
|
|
8409
8409
|
;
|
|
8410
|
-
for (let
|
|
8410
|
+
for (let p = l.content.lastChild; d < l.openEnd && !p.type.spec.isolating; d++, p = p.lastChild)
|
|
8411
8411
|
;
|
|
8412
8412
|
l = Ol(l, f, d);
|
|
8413
8413
|
}
|
|
@@ -8892,11 +8892,11 @@ ye.drop = (n, e) => {
|
|
|
8892
8892
|
if (!s)
|
|
8893
8893
|
return;
|
|
8894
8894
|
let o = n.state.doc.resolve(s.pos), i = r && r.slice;
|
|
8895
|
-
i ? n.someProp("transformPasted", (
|
|
8896
|
-
i =
|
|
8895
|
+
i ? n.someProp("transformPasted", (h) => {
|
|
8896
|
+
i = h(i, n);
|
|
8897
8897
|
}) : i = Gc(n, iu(t.dataTransfer), Qn ? null : t.dataTransfer.getData("text/html"), !1, o);
|
|
8898
8898
|
let l = !!(r && !t[au]);
|
|
8899
|
-
if (n.someProp("handleDrop", (
|
|
8899
|
+
if (n.someProp("handleDrop", (h) => h(n, t, i || M.empty, l))) {
|
|
8900
8900
|
t.preventDefault();
|
|
8901
8901
|
return;
|
|
8902
8902
|
}
|
|
@@ -8907,18 +8907,18 @@ ye.drop = (n, e) => {
|
|
|
8907
8907
|
a == null && (a = o.pos);
|
|
8908
8908
|
let c = n.state.tr;
|
|
8909
8909
|
if (l) {
|
|
8910
|
-
let { node:
|
|
8911
|
-
|
|
8910
|
+
let { node: h } = r;
|
|
8911
|
+
h ? h.replace(c) : c.deleteSelection();
|
|
8912
8912
|
}
|
|
8913
8913
|
let u = c.mapping.map(a), f = i.openStart == 0 && i.openEnd == 0 && i.content.childCount == 1, d = c.doc;
|
|
8914
8914
|
if (f ? c.replaceRangeWith(u, u, i.content.firstChild) : c.replaceRange(u, u, i), c.doc.eq(d))
|
|
8915
8915
|
return;
|
|
8916
|
-
let
|
|
8917
|
-
if (f && D.isSelectable(i.content.firstChild) &&
|
|
8918
|
-
c.setSelection(new D(
|
|
8916
|
+
let p = c.doc.resolve(u);
|
|
8917
|
+
if (f && D.isSelectable(i.content.firstChild) && p.nodeAfter && p.nodeAfter.sameMarkup(i.content.firstChild))
|
|
8918
|
+
c.setSelection(new D(p));
|
|
8919
8919
|
else {
|
|
8920
|
-
let
|
|
8921
|
-
c.mapping.maps[c.mapping.maps.length - 1].forEach((y, m, x, C) =>
|
|
8920
|
+
let h = c.mapping.map(a);
|
|
8921
|
+
c.mapping.maps[c.mapping.maps.length - 1].forEach((y, m, x, C) => h = C), c.setSelection(Xo(n, p, c.doc.resolve(h)));
|
|
8922
8922
|
}
|
|
8923
8923
|
n.focus(), n.dispatch(c.setMeta("uiEvent", "drop"));
|
|
8924
8924
|
};
|
|
@@ -9320,14 +9320,14 @@ function Fp(n, e, t, r, s, o, i) {
|
|
|
9320
9320
|
let l = n.slice();
|
|
9321
9321
|
for (let c = 0, u = o; c < t.maps.length; c++) {
|
|
9322
9322
|
let f = 0;
|
|
9323
|
-
t.maps[c].forEach((d,
|
|
9324
|
-
let m = y -
|
|
9323
|
+
t.maps[c].forEach((d, p, h, y) => {
|
|
9324
|
+
let m = y - h - (p - d);
|
|
9325
9325
|
for (let x = 0; x < l.length; x += 3) {
|
|
9326
9326
|
let C = l[x + 1];
|
|
9327
9327
|
if (C < 0 || d > C + u - f)
|
|
9328
9328
|
continue;
|
|
9329
9329
|
let w = l[x] + u - f;
|
|
9330
|
-
|
|
9330
|
+
p >= w ? l[x + 1] = d <= w ? -2 : -1 : d >= u && m && (l[x] += m, l[x + 1] += m);
|
|
9331
9331
|
}
|
|
9332
9332
|
f += m;
|
|
9333
9333
|
}), u = t.maps[c].map(u, -1);
|
|
@@ -9344,10 +9344,10 @@ function Fp(n, e, t, r, s, o, i) {
|
|
|
9344
9344
|
a = !0;
|
|
9345
9345
|
continue;
|
|
9346
9346
|
}
|
|
9347
|
-
let d = t.map(n[c + 1] + o, -1),
|
|
9348
|
-
if (m && y == f && y + m.nodeSize ==
|
|
9347
|
+
let d = t.map(n[c + 1] + o, -1), p = d - s, { index: h, offset: y } = r.content.findIndex(f), m = r.maybeChild(h);
|
|
9348
|
+
if (m && y == f && y + m.nodeSize == p) {
|
|
9349
9349
|
let x = l[c + 2].mapInner(t, m, u + 1, n[c] + o + 1, i);
|
|
9350
|
-
x != ae ? (l[c] = f, l[c + 1] =
|
|
9350
|
+
x != ae ? (l[c] = f, l[c + 1] = p, l[c + 2] = x) : (l[c + 1] = -2, a = !0);
|
|
9351
9351
|
} else
|
|
9352
9352
|
a = !0;
|
|
9353
9353
|
}
|
|
@@ -9357,8 +9357,8 @@ function Fp(n, e, t, r, s, o, i) {
|
|
|
9357
9357
|
for (let f = 0; f < l.length; f += 3)
|
|
9358
9358
|
l[f + 1] < 0 && (l.splice(f, 3), f -= 3);
|
|
9359
9359
|
for (let f = 0, d = 0; f < u.children.length; f += 3) {
|
|
9360
|
-
let
|
|
9361
|
-
for (; d < l.length && l[d] <
|
|
9360
|
+
let p = u.children[f];
|
|
9361
|
+
for (; d < l.length && l[d] < p; )
|
|
9362
9362
|
d += 3;
|
|
9363
9363
|
l.splice(d, 0, u.children[f], u.children[f + 1], u.children[f + 2]);
|
|
9364
9364
|
}
|
|
@@ -9573,8 +9573,8 @@ class qp {
|
|
|
9573
9573
|
} else {
|
|
9574
9574
|
let { focusNode: f } = this.currentSelection;
|
|
9575
9575
|
for (let d of u) {
|
|
9576
|
-
let
|
|
9577
|
-
|
|
9576
|
+
let p = d.parentNode;
|
|
9577
|
+
p && p.nodeName == "LI" && (!f || Jp(e, f) != p) && d.remove();
|
|
9578
9578
|
}
|
|
9579
9579
|
}
|
|
9580
9580
|
}
|
|
@@ -9658,22 +9658,22 @@ function Up(n, e, t) {
|
|
|
9658
9658
|
if (!C || C.size)
|
|
9659
9659
|
break;
|
|
9660
9660
|
}
|
|
9661
|
-
let f = n.state.doc, d = n.someProp("domParser") || Xt.fromSchema(n.state.schema),
|
|
9662
|
-
topNode:
|
|
9663
|
-
topMatch:
|
|
9661
|
+
let f = n.state.doc, d = n.someProp("domParser") || Xt.fromSchema(n.state.schema), p = f.resolve(i), h = null, y = d.parse(r, {
|
|
9662
|
+
topNode: p.parent,
|
|
9663
|
+
topMatch: p.parent.contentMatchAt(p.index()),
|
|
9664
9664
|
topOpen: !0,
|
|
9665
9665
|
from: s,
|
|
9666
9666
|
to: o,
|
|
9667
|
-
preserveWhitespace:
|
|
9667
|
+
preserveWhitespace: p.parent.type.whitespace == "pre" ? "full" : !0,
|
|
9668
9668
|
findPositions: c,
|
|
9669
9669
|
ruleFromNode: Yp,
|
|
9670
|
-
context:
|
|
9670
|
+
context: p
|
|
9671
9671
|
});
|
|
9672
9672
|
if (c && c[0].pos != null) {
|
|
9673
9673
|
let m = c[0].pos, x = c[1] && c[1].pos;
|
|
9674
|
-
x == null && (x = m),
|
|
9674
|
+
x == null && (x = m), h = { anchor: m + i, head: x + i };
|
|
9675
9675
|
}
|
|
9676
|
-
return { doc: y, sel:
|
|
9676
|
+
return { doc: y, sel: h, from: i, to: l };
|
|
9677
9677
|
}
|
|
9678
9678
|
function Yp(n) {
|
|
9679
9679
|
let e = n.pmViewDesc;
|
|
@@ -9704,16 +9704,16 @@ function Xp(n, e, t, r, s) {
|
|
|
9704
9704
|
}
|
|
9705
9705
|
let i = n.state.doc.resolve(e), l = i.sharedDepth(t);
|
|
9706
9706
|
e = i.before(l + 1), t = n.state.doc.resolve(t).after(l + 1);
|
|
9707
|
-
let a = n.state.selection, c = Up(n, e, t), u = n.state.doc, f = u.slice(c.from, c.to), d,
|
|
9708
|
-
n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (d = n.state.selection.to,
|
|
9709
|
-
let
|
|
9710
|
-
if (
|
|
9707
|
+
let a = n.state.selection, c = Up(n, e, t), u = n.state.doc, f = u.slice(c.from, c.to), d, p;
|
|
9708
|
+
n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (d = n.state.selection.to, p = "end") : (d = n.state.selection.from, p = "start"), n.input.lastKeyCode = null;
|
|
9709
|
+
let h = em(f.content, c.doc.content, c.from, d, p);
|
|
9710
|
+
if (h && n.input.domChangeCount++, (Dn && n.input.lastIOSEnter > Date.now() - 225 || at) && s.some((E) => E.nodeType == 1 && !Gp.test(E.nodeName)) && (!h || h.endA >= h.endB) && n.someProp("handleKeyDown", (E) => E(n, Lt(13, "Enter")))) {
|
|
9711
9711
|
n.input.lastIOSEnter = 0;
|
|
9712
9712
|
return;
|
|
9713
9713
|
}
|
|
9714
|
-
if (!
|
|
9714
|
+
if (!h)
|
|
9715
9715
|
if (r && a instanceof V && !a.empty && a.$head.sameParent(a.$anchor) && !n.composing && !(c.sel && c.sel.anchor != c.sel.head))
|
|
9716
|
-
|
|
9716
|
+
h = { start: a.from, endA: a.to, endB: a.to };
|
|
9717
9717
|
else {
|
|
9718
9718
|
if (c.sel) {
|
|
9719
9719
|
let E = vl(n, n.state.doc, c.sel);
|
|
@@ -9724,28 +9724,28 @@ function Xp(n, e, t, r, s) {
|
|
|
9724
9724
|
}
|
|
9725
9725
|
return;
|
|
9726
9726
|
}
|
|
9727
|
-
n.state.selection.from < n.state.selection.to &&
|
|
9728
|
-
let y = c.doc.resolveNoCache(
|
|
9727
|
+
n.state.selection.from < n.state.selection.to && h.start == h.endB && n.state.selection instanceof V && (h.start > n.state.selection.from && h.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? h.start = n.state.selection.from : h.endA < n.state.selection.to && h.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (h.endB += n.state.selection.to - h.endA, h.endA = n.state.selection.to)), ke && Ot <= 11 && h.endB == h.start + 1 && h.endA == h.start && h.start > c.from && c.doc.textBetween(h.start - c.from - 1, h.start - c.from + 1) == " " && (h.start--, h.endA--, h.endB--);
|
|
9728
|
+
let y = c.doc.resolveNoCache(h.start - c.from), m = c.doc.resolveNoCache(h.endB - c.from), x = u.resolve(h.start), C = y.sameParent(m) && y.parent.inlineContent && x.end() >= h.endA, w;
|
|
9729
9729
|
if ((Dn && n.input.lastIOSEnter > Date.now() - 225 && (!C || s.some((E) => E.nodeName == "DIV" || E.nodeName == "P")) || !C && y.pos < c.doc.content.size && !y.sameParent(m) && (w = z.findFrom(c.doc.resolve(y.pos + 1), 1, !0)) && w.head == m.pos) && n.someProp("handleKeyDown", (E) => E(n, Lt(13, "Enter")))) {
|
|
9730
9730
|
n.input.lastIOSEnter = 0;
|
|
9731
9731
|
return;
|
|
9732
9732
|
}
|
|
9733
|
-
if (n.state.selection.anchor >
|
|
9733
|
+
if (n.state.selection.anchor > h.start && Zp(u, h.start, h.endA, y, m) && n.someProp("handleKeyDown", (E) => E(n, Lt(8, "Backspace")))) {
|
|
9734
9734
|
at && ue && n.domObserver.suppressSelectionUpdates();
|
|
9735
9735
|
return;
|
|
9736
9736
|
}
|
|
9737
|
-
ue &&
|
|
9737
|
+
ue && h.endB == h.start && (n.input.lastChromeDelete = Date.now()), at && !C && y.start() != m.start() && m.parentOffset == 0 && y.depth == m.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == h.endA && (h.endB -= 2, m = c.doc.resolveNoCache(h.endB - c.from), setTimeout(() => {
|
|
9738
9738
|
n.someProp("handleKeyDown", function(E) {
|
|
9739
9739
|
return E(n, Lt(13, "Enter"));
|
|
9740
9740
|
});
|
|
9741
9741
|
}, 20));
|
|
9742
|
-
let O =
|
|
9742
|
+
let O = h.start, v = h.endA, S, $, j;
|
|
9743
9743
|
if (C) {
|
|
9744
9744
|
if (y.pos == m.pos)
|
|
9745
|
-
ke && Ot <= 11 && y.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => ut(n), 20)), S = n.state.tr.delete(O, v), $ = u.resolve(
|
|
9745
|
+
ke && Ot <= 11 && y.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => ut(n), 20)), S = n.state.tr.delete(O, v), $ = u.resolve(h.start).marksAcross(u.resolve(h.endA));
|
|
9746
9746
|
else if (
|
|
9747
9747
|
// Adding or removing a mark
|
|
9748
|
-
|
|
9748
|
+
h.endA == h.endB && (j = Qp(y.parent.content.cut(y.parentOffset, m.parentOffset), x.parent.content.cut(x.parentOffset, h.endA - x.start())))
|
|
9749
9749
|
)
|
|
9750
9750
|
S = n.state.tr, j.type == "add" ? S.addMark(O, v, j.mark) : S.removeMark(O, v, j.mark);
|
|
9751
9751
|
else if (y.parent.child(y.index()).isText && y.index() == m.index() - (m.textOffset ? 0 : 1)) {
|
|
@@ -9755,9 +9755,9 @@ function Xp(n, e, t, r, s) {
|
|
|
9755
9755
|
S = n.state.tr.insertText(E, O, v);
|
|
9756
9756
|
}
|
|
9757
9757
|
}
|
|
9758
|
-
if (S || (S = n.state.tr.replace(O, v, c.doc.slice(
|
|
9758
|
+
if (S || (S = n.state.tr.replace(O, v, c.doc.slice(h.start - c.from, h.endB - c.from))), c.sel) {
|
|
9759
9759
|
let E = vl(n, S.doc, c.sel);
|
|
9760
|
-
E && !(ue && n.composing && E.empty && (
|
|
9760
|
+
E && !(ue && n.composing && E.empty && (h.start != h.endB || n.input.lastChromeDelete < Date.now() - 100) && (E.head == O || E.head == S.mapping.map(v) - 1) || ke && E.empty && E.head == O) && S.setSelection(E);
|
|
9761
9761
|
}
|
|
9762
9762
|
$ && S.ensureMarks($), o && S.setMeta("composition", o), n.dispatch(S.scrollIntoView());
|
|
9763
9763
|
}
|
|
@@ -9902,8 +9902,8 @@ class tm {
|
|
|
9902
9902
|
e.storedMarks && this.composing && (ou(this), i = !0), this.state = e;
|
|
9903
9903
|
let l = s.plugins != e.plugins || this._props.plugins != t.plugins;
|
|
9904
9904
|
if (l || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
|
|
9905
|
-
let
|
|
9906
|
-
rm(
|
|
9905
|
+
let p = Fl(this);
|
|
9906
|
+
rm(p, this.nodeViews) && (this.nodeViews = p, o = !0);
|
|
9907
9907
|
}
|
|
9908
9908
|
(l || t.handleDOMEvents != this._props.handleDOMEvents) && Co(this), this.editable = jl(this), zl(this);
|
|
9909
9909
|
let a = _s(this), c = $l(this), u = s.plugins != e.plugins && !s.doc.eq(e.doc) ? "reset" : e.scrollToSelection > s.scrollToSelection ? "to selection" : "preserve", f = o || !this.docView.matchesNode(e.doc, c, a);
|
|
@@ -9911,12 +9911,12 @@ class tm {
|
|
|
9911
9911
|
let d = u == "preserve" && i && this.dom.style.overflowAnchor == null && vh(this);
|
|
9912
9912
|
if (i) {
|
|
9913
9913
|
this.domObserver.stop();
|
|
9914
|
-
let
|
|
9914
|
+
let p = f && (ke || ue) && !this.composing && !s.selection.empty && !e.selection.empty && nm(s.selection, e.selection);
|
|
9915
9915
|
if (f) {
|
|
9916
|
-
let
|
|
9917
|
-
this.composing && (this.input.compositionNode = Pp(this)), (o || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = ml(e.doc, c, a, this.dom, this)),
|
|
9916
|
+
let h = ue ? this.trackWrites = this.domSelectionRange().focusNode : null;
|
|
9917
|
+
this.composing && (this.input.compositionNode = Pp(this)), (o || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = ml(e.doc, c, a, this.dom, this)), h && !this.trackWrites && (p = !0);
|
|
9918
9918
|
}
|
|
9919
|
-
|
|
9919
|
+
p || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && sp(this)) ? ut(this, p) : (Kc(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
|
|
9920
9920
|
}
|
|
9921
9921
|
this.updatePluginViews(s), !((r = this.dragging) === null || r === void 0) && r.node && !s.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, s), u == "reset" ? this.dom.scrollTop = 0 : u == "to selection" ? this.scrollToSelection() : d && Vh(d);
|
|
9922
9922
|
}
|
|
@@ -10487,10 +10487,10 @@ function km(n, e) {
|
|
|
10487
10487
|
let f = k.empty, d = s.index(-1) ? 1 : s.index(-2) ? 2 : 3;
|
|
10488
10488
|
for (let x = s.depth - d; x >= s.depth - 3; x--)
|
|
10489
10489
|
f = k.from(s.node(x).copy(f));
|
|
10490
|
-
let
|
|
10490
|
+
let p = s.indexAfter(-1) < s.node(-2).childCount ? 1 : s.indexAfter(-2) < s.node(-3).childCount ? 2 : 3;
|
|
10491
10491
|
f = f.append(k.from(n.createAndFill()));
|
|
10492
|
-
let
|
|
10493
|
-
y.doc.nodesBetween(
|
|
10492
|
+
let h = s.before(s.depth - (d - 1)), y = t.tr.replace(h, s.after(-p), new M(f, 4 - d, 0)), m = -1;
|
|
10493
|
+
y.doc.nodesBetween(h, y.doc.content.size, (x, C) => {
|
|
10494
10494
|
if (m > -1)
|
|
10495
10495
|
return !1;
|
|
10496
10496
|
x.isTextblock && x.content.size == 0 && (m = C + 1);
|
|
@@ -10520,8 +10520,8 @@ function Cm(n, e, t, r) {
|
|
|
10520
10520
|
}
|
|
10521
10521
|
function wm(n, e, t) {
|
|
10522
10522
|
let r = n.tr, s = t.parent;
|
|
10523
|
-
for (let
|
|
10524
|
-
|
|
10523
|
+
for (let p = t.end, h = t.endIndex - 1, y = t.startIndex; h > y; h--)
|
|
10524
|
+
p -= s.child(h).nodeSize, r.delete(p - 1, p + 1);
|
|
10525
10525
|
let o = r.doc.resolve(t.start), i = o.nodeAfter;
|
|
10526
10526
|
if (r.mapping.map(t.end) != t.start + o.nodeAfter.nodeSize)
|
|
10527
10527
|
return !1;
|
|
@@ -10543,8 +10543,8 @@ function Mm(n) {
|
|
|
10543
10543
|
if (a.type != n)
|
|
10544
10544
|
return !1;
|
|
10545
10545
|
if (t) {
|
|
10546
|
-
let c = a.lastChild && a.lastChild.type == l.type, u = k.from(c ? n.create() : null), f = new M(k.from(n.create(null, k.from(l.type.create(null, u)))), c ? 3 : 1, 0), d = o.start,
|
|
10547
|
-
t(e.tr.step(new oe(d - (c ? 3 : 1),
|
|
10546
|
+
let c = a.lastChild && a.lastChild.type == l.type, u = k.from(c ? n.create() : null), f = new M(k.from(n.create(null, k.from(l.type.create(null, u)))), c ? 3 : 1, 0), d = o.start, p = o.end;
|
|
10547
|
+
t(e.tr.step(new oe(d - (c ? 3 : 1), p, d, p, f, 1, !0)).scrollIntoView());
|
|
10548
10548
|
}
|
|
10549
10549
|
return !0;
|
|
10550
10550
|
};
|
|
@@ -10617,7 +10617,7 @@ function Ll(n, e, t, r, s, o) {
|
|
|
10617
10617
|
let i = n.state, l = i.doc.resolve(e), a = l.parent.textBetween(Math.max(0, l.parentOffset - Dm), l.parentOffset, null, "") + r;
|
|
10618
10618
|
for (let c = 0; c < s.length; c++) {
|
|
10619
10619
|
let u = s[c];
|
|
10620
|
-
if (!u.inCodeMark && l.marks().some((
|
|
10620
|
+
if (!u.inCodeMark && l.marks().some((p) => p.type.spec.code))
|
|
10621
10621
|
continue;
|
|
10622
10622
|
if (l.parent.type.spec.code) {
|
|
10623
10623
|
if (!u.inCode)
|
|
@@ -10657,8 +10657,8 @@ function ri(n, e, t = null, r) {
|
|
|
10657
10657
|
if (!d)
|
|
10658
10658
|
return null;
|
|
10659
10659
|
c.wrap(f, d);
|
|
10660
|
-
let
|
|
10661
|
-
return
|
|
10660
|
+
let p = c.doc.resolve(i - 1).nodeBefore;
|
|
10661
|
+
return p && p.type == e && En(c.doc, i - 1) && (!r || r(o, p)) && c.join(i - 1), c;
|
|
10662
10662
|
});
|
|
10663
10663
|
}
|
|
10664
10664
|
function mu(n, e, t = null) {
|
|
@@ -10830,9 +10830,9 @@ function Xm(n, e = null) {
|
|
|
10830
10830
|
} else {
|
|
10831
10831
|
if (t instanceof n.dom.ownerDocument.defaultView.Selection && t.rangeCount > 1) {
|
|
10832
10832
|
let f = i, d = i;
|
|
10833
|
-
for (let
|
|
10834
|
-
let
|
|
10835
|
-
f = Math.min(f, n.docView.posFromDOM(
|
|
10833
|
+
for (let p = 0; p < t.rangeCount; p++) {
|
|
10834
|
+
let h = t.getRangeAt(p);
|
|
10835
|
+
f = Math.min(f, n.docView.posFromDOM(h.startContainer, h.startOffset, 1)), d = Math.max(d, n.docView.posFromDOM(h.endContainer, h.endOffset, -1));
|
|
10836
10836
|
}
|
|
10837
10837
|
if (f < 0)
|
|
10838
10838
|
return null;
|
|
@@ -11182,29 +11182,29 @@ function ag(n, e) {
|
|
|
11182
11182
|
return !1;
|
|
11183
11183
|
}
|
|
11184
11184
|
function Nu(n, e) {
|
|
11185
|
-
n.someProp("transformCopied", (
|
|
11186
|
-
e =
|
|
11185
|
+
n.someProp("transformCopied", (p) => {
|
|
11186
|
+
e = p(e, n);
|
|
11187
11187
|
});
|
|
11188
11188
|
let t = [], { content: r, openStart: s, openEnd: o } = e;
|
|
11189
11189
|
for (; s > 1 && o > 1 && r.childCount == 1 && r.firstChild.childCount == 1; ) {
|
|
11190
11190
|
s--, o--;
|
|
11191
|
-
let
|
|
11192
|
-
t.push(
|
|
11191
|
+
let p = r.firstChild;
|
|
11192
|
+
t.push(p.type.name, p.attrs != p.type.defaultAttrs ? p.attrs : null), r = p.content;
|
|
11193
11193
|
}
|
|
11194
11194
|
let i = n.someProp("clipboardSerializer") || Xe.fromSchema(n.state.schema), l = Ru(), a = l.createElement("div");
|
|
11195
11195
|
a.appendChild(i.serializeFragment(r, { document: l }));
|
|
11196
11196
|
let c = a.firstChild, u, f = 0;
|
|
11197
11197
|
for (; c && c.nodeType == 1 && (u = Au[c.nodeName.toLowerCase()]); ) {
|
|
11198
|
-
for (let
|
|
11199
|
-
let
|
|
11198
|
+
for (let p = u.length - 1; p >= 0; p--) {
|
|
11199
|
+
let h = l.createElement(u[p]);
|
|
11200
11200
|
for (; a.firstChild; )
|
|
11201
|
-
|
|
11202
|
-
a.appendChild(
|
|
11201
|
+
h.appendChild(a.firstChild);
|
|
11202
|
+
a.appendChild(h), f++;
|
|
11203
11203
|
}
|
|
11204
11204
|
c = a.firstChild;
|
|
11205
11205
|
}
|
|
11206
11206
|
c && c.nodeType == 1 && c.setAttribute("data-pm-slice", `${s} ${o}${f ? ` -${f}` : ""} ${JSON.stringify(t)}`);
|
|
11207
|
-
let d = n.someProp("clipboardTextSerializer", (
|
|
11207
|
+
let d = n.someProp("clipboardTextSerializer", (p) => p(e, n)) || e.content.textBetween(0, e.content.size, `
|
|
11208
11208
|
|
|
11209
11209
|
`);
|
|
11210
11210
|
return { dom: a, text: d, slice: e };
|
|
@@ -11224,10 +11224,10 @@ function Du(n, e, t, r, s) {
|
|
|
11224
11224
|
if (f)
|
|
11225
11225
|
l = f;
|
|
11226
11226
|
else {
|
|
11227
|
-
let d = s.marks(), { schema:
|
|
11227
|
+
let d = s.marks(), { schema: p } = n.state, h = Xe.fromSchema(p);
|
|
11228
11228
|
i = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((y) => {
|
|
11229
11229
|
let m = i.appendChild(document.createElement("p"));
|
|
11230
|
-
y && m.appendChild(
|
|
11230
|
+
y && m.appendChild(h.serializeNode(p.text(y, d)));
|
|
11231
11231
|
});
|
|
11232
11232
|
}
|
|
11233
11233
|
} else
|
|
@@ -11254,9 +11254,9 @@ function Du(n, e, t, r, s) {
|
|
|
11254
11254
|
l = pg(ea(l, +u[1], +u[2]), u[4]);
|
|
11255
11255
|
else if (l = M.maxOpen(ug(l.content, s), !0), l.openStart || l.openEnd) {
|
|
11256
11256
|
let f = 0, d = 0;
|
|
11257
|
-
for (let
|
|
11257
|
+
for (let p = l.content.firstChild; f < l.openStart && !p.type.spec.isolating; f++, p = p.firstChild)
|
|
11258
11258
|
;
|
|
11259
|
-
for (let
|
|
11259
|
+
for (let p = l.content.lastChild; d < l.openEnd && !p.type.spec.isolating; d++, p = p.lastChild)
|
|
11260
11260
|
;
|
|
11261
11261
|
l = ea(l, f, d);
|
|
11262
11262
|
}
|
|
@@ -11681,11 +11681,11 @@ De.drop = (n, e) => {
|
|
|
11681
11681
|
if (!s)
|
|
11682
11682
|
return;
|
|
11683
11683
|
let o = n.state.doc.resolve(s.pos), i = r && r.slice;
|
|
11684
|
-
i ? n.someProp("transformPasted", (
|
|
11685
|
-
i =
|
|
11684
|
+
i ? n.someProp("transformPasted", (h) => {
|
|
11685
|
+
i = h(i, n);
|
|
11686
11686
|
}) : i = Du(n, Vu(t.dataTransfer), tr ? null : t.dataTransfer.getData("text/html"), !1, o);
|
|
11687
11687
|
let l = !!(r && $u(n, t));
|
|
11688
|
-
if (n.someProp("handleDrop", (
|
|
11688
|
+
if (n.someProp("handleDrop", (h) => h(n, t, i || M.empty, l))) {
|
|
11689
11689
|
t.preventDefault();
|
|
11690
11690
|
return;
|
|
11691
11691
|
}
|
|
@@ -11696,18 +11696,18 @@ De.drop = (n, e) => {
|
|
|
11696
11696
|
a == null && (a = o.pos);
|
|
11697
11697
|
let c = n.state.tr;
|
|
11698
11698
|
if (l) {
|
|
11699
|
-
let { node:
|
|
11700
|
-
|
|
11699
|
+
let { node: h } = r;
|
|
11700
|
+
h ? h.replace(c) : c.deleteSelection();
|
|
11701
11701
|
}
|
|
11702
11702
|
let u = c.mapping.map(a), f = i.openStart == 0 && i.openEnd == 0 && i.content.childCount == 1, d = c.doc;
|
|
11703
11703
|
if (f ? c.replaceRangeWith(u, u, i.content.firstChild) : c.replaceRange(u, u, i), c.doc.eq(d))
|
|
11704
11704
|
return;
|
|
11705
|
-
let
|
|
11706
|
-
if (f && D.isSelectable(i.content.firstChild) &&
|
|
11707
|
-
c.setSelection(new D(
|
|
11705
|
+
let p = c.doc.resolve(u);
|
|
11706
|
+
if (f && D.isSelectable(i.content.firstChild) && p.nodeAfter && p.nodeAfter.sameMarkup(i.content.firstChild))
|
|
11707
|
+
c.setSelection(new D(p));
|
|
11708
11708
|
else {
|
|
11709
|
-
let
|
|
11710
|
-
c.mapping.maps[c.mapping.maps.length - 1].forEach((y, m, x, C) =>
|
|
11709
|
+
let h = c.mapping.map(a);
|
|
11710
|
+
c.mapping.maps[c.mapping.maps.length - 1].forEach((y, m, x, C) => h = C), c.setSelection(wu(n, p, c.doc.resolve(h)));
|
|
11711
11711
|
}
|
|
11712
11712
|
n.focus(), n.dispatch(c.setMeta("uiEvent", "drop"));
|
|
11713
11713
|
};
|
|
@@ -12112,14 +12112,14 @@ function Ig(n, e, t, r, s, o, i) {
|
|
|
12112
12112
|
let l = n.slice();
|
|
12113
12113
|
for (let c = 0, u = o; c < t.maps.length; c++) {
|
|
12114
12114
|
let f = 0;
|
|
12115
|
-
t.maps[c].forEach((d,
|
|
12116
|
-
let m = y -
|
|
12115
|
+
t.maps[c].forEach((d, p, h, y) => {
|
|
12116
|
+
let m = y - h - (p - d);
|
|
12117
12117
|
for (let x = 0; x < l.length; x += 3) {
|
|
12118
12118
|
let C = l[x + 1];
|
|
12119
12119
|
if (C < 0 || d > C + u - f)
|
|
12120
12120
|
continue;
|
|
12121
12121
|
let w = l[x] + u - f;
|
|
12122
|
-
|
|
12122
|
+
p >= w ? l[x + 1] = d <= w ? -2 : -1 : d >= u && m && (l[x] += m, l[x + 1] += m);
|
|
12123
12123
|
}
|
|
12124
12124
|
f += m;
|
|
12125
12125
|
}), u = t.maps[c].map(u, -1);
|
|
@@ -12136,10 +12136,10 @@ function Ig(n, e, t, r, s, o, i) {
|
|
|
12136
12136
|
a = !0;
|
|
12137
12137
|
continue;
|
|
12138
12138
|
}
|
|
12139
|
-
let d = t.map(n[c + 1] + o, -1),
|
|
12140
|
-
if (m && y == f && y + m.nodeSize ==
|
|
12139
|
+
let d = t.map(n[c + 1] + o, -1), p = d - s, { index: h, offset: y } = r.content.findIndex(f), m = r.maybeChild(h);
|
|
12140
|
+
if (m && y == f && y + m.nodeSize == p) {
|
|
12141
12141
|
let x = l[c + 2].mapInner(t, m, u + 1, n[c] + o + 1, i);
|
|
12142
|
-
x != pe ? (l[c] = f, l[c + 1] =
|
|
12142
|
+
x != pe ? (l[c] = f, l[c + 1] = p, l[c + 2] = x) : (l[c + 1] = -2, a = !0);
|
|
12143
12143
|
} else
|
|
12144
12144
|
a = !0;
|
|
12145
12145
|
}
|
|
@@ -12149,8 +12149,8 @@ function Ig(n, e, t, r, s, o, i) {
|
|
|
12149
12149
|
for (let f = 0; f < l.length; f += 3)
|
|
12150
12150
|
l[f + 1] < 0 && (l.splice(f, 3), f -= 3);
|
|
12151
12151
|
for (let f = 0, d = 0; f < u.children.length; f += 3) {
|
|
12152
|
-
let
|
|
12153
|
-
for (; d < l.length && l[d] <
|
|
12152
|
+
let p = u.children[f];
|
|
12153
|
+
for (; d < l.length && l[d] < p; )
|
|
12154
12154
|
d += 3;
|
|
12155
12155
|
l.splice(d, 0, u.children[f], u.children[f + 1], u.children[f + 2]);
|
|
12156
12156
|
}
|
|
@@ -12339,10 +12339,10 @@ function vg(n) {
|
|
|
12339
12339
|
for (let c = 0, u = 0; c < t; c++) {
|
|
12340
12340
|
const f = n.child(c);
|
|
12341
12341
|
u++;
|
|
12342
|
-
for (let
|
|
12342
|
+
for (let h = 0; ; h++) {
|
|
12343
12343
|
for (; s < r.length && r[s] != 0; ) s++;
|
|
12344
|
-
if (
|
|
12345
|
-
const y = f.child(
|
|
12344
|
+
if (h == f.childCount) break;
|
|
12345
|
+
const y = f.child(h), { colspan: m, rowspan: x, colwidth: C } = y.attrs;
|
|
12346
12346
|
for (let w = 0; w < x; w++) {
|
|
12347
12347
|
if (w + c >= t) {
|
|
12348
12348
|
(o || (o = [])).push({
|
|
@@ -12370,9 +12370,9 @@ function vg(n) {
|
|
|
12370
12370
|
s += m, u += y.nodeSize;
|
|
12371
12371
|
}
|
|
12372
12372
|
const d = (c + 1) * e;
|
|
12373
|
-
let
|
|
12374
|
-
for (; s < d; ) r[s++] == 0 &&
|
|
12375
|
-
|
|
12373
|
+
let p = 0;
|
|
12374
|
+
for (; s < d; ) r[s++] == 0 && p++;
|
|
12375
|
+
p && (o || (o = [])).push({ type: "missing", row: c, n: p }), u++;
|
|
12376
12376
|
}
|
|
12377
12377
|
(e === 0 || t === 0) && (o || (o = [])).push({ type: "zero_sized" });
|
|
12378
12378
|
const l = new Z(e, t, r, o);
|
|
@@ -12648,33 +12648,33 @@ var H = class st extends z {
|
|
|
12648
12648
|
const d = t.map[u];
|
|
12649
12649
|
if (o[d]) continue;
|
|
12650
12650
|
o[d] = !0;
|
|
12651
|
-
const
|
|
12652
|
-
let
|
|
12653
|
-
if (!
|
|
12651
|
+
const p = t.findCell(d);
|
|
12652
|
+
let h = e.nodeAt(d);
|
|
12653
|
+
if (!h)
|
|
12654
12654
|
throw RangeError(`No cell with offset ${d} found`);
|
|
12655
|
-
const y = s.left -
|
|
12655
|
+
const y = s.left - p.left, m = p.right - s.right;
|
|
12656
12656
|
if (y > 0 || m > 0) {
|
|
12657
|
-
let x =
|
|
12657
|
+
let x = h.attrs;
|
|
12658
12658
|
if (y > 0 && (x = en(x, 0, y)), m > 0 && (x = en(
|
|
12659
12659
|
x,
|
|
12660
12660
|
x.colspan - m,
|
|
12661
12661
|
m
|
|
12662
|
-
)),
|
|
12663
|
-
if (
|
|
12662
|
+
)), p.left < s.left) {
|
|
12663
|
+
if (h = h.type.createAndFill(x), !h)
|
|
12664
12664
|
throw RangeError(
|
|
12665
12665
|
`Could not create cell with attrs ${JSON.stringify(x)}`
|
|
12666
12666
|
);
|
|
12667
12667
|
} else
|
|
12668
|
-
|
|
12668
|
+
h = h.type.create(x, h.content);
|
|
12669
12669
|
}
|
|
12670
|
-
if (
|
|
12670
|
+
if (p.top < s.top || p.bottom > s.bottom) {
|
|
12671
12671
|
const x = {
|
|
12672
|
-
...
|
|
12673
|
-
rowspan: Math.min(
|
|
12672
|
+
...h.attrs,
|
|
12673
|
+
rowspan: Math.min(p.bottom, s.bottom) - Math.max(p.top, s.top)
|
|
12674
12674
|
};
|
|
12675
|
-
|
|
12675
|
+
p.top < s.top ? h = h.type.createAndFill(x) : h = h.type.create(x, h.content);
|
|
12676
12676
|
}
|
|
12677
|
-
c.push(
|
|
12677
|
+
c.push(h);
|
|
12678
12678
|
}
|
|
12679
12679
|
i.push(e.child(a).copy(k.from(c)));
|
|
12680
12680
|
}
|
|
@@ -12899,15 +12899,15 @@ function Gg(n, e, t, r) {
|
|
|
12899
12899
|
for (let a = 0, c = t + 1; a < s.height; a++) {
|
|
12900
12900
|
const u = e.child(a), f = c + u.nodeSize, d = o[a];
|
|
12901
12901
|
if (d > 0) {
|
|
12902
|
-
let
|
|
12903
|
-
u.firstChild && (
|
|
12904
|
-
const
|
|
12902
|
+
let p = "cell";
|
|
12903
|
+
u.firstChild && (p = u.firstChild.type.spec.tableRole);
|
|
12904
|
+
const h = [];
|
|
12905
12905
|
for (let m = 0; m < d; m++) {
|
|
12906
|
-
const x = be(n.schema)[
|
|
12907
|
-
x &&
|
|
12906
|
+
const x = be(n.schema)[p].createAndFill();
|
|
12907
|
+
x && h.push(x);
|
|
12908
12908
|
}
|
|
12909
12909
|
const y = (a == 0 || i == a - 1) && l == a ? c + 1 : f - 1;
|
|
12910
|
-
r.insert(r.mapping.map(y),
|
|
12910
|
+
r.insert(r.mapping.map(y), h);
|
|
12911
12911
|
}
|
|
12912
12912
|
c = f;
|
|
12913
12913
|
}
|
|
@@ -13047,11 +13047,11 @@ function sy(n, { map: e, table: t, tableStart: r }, s) {
|
|
|
13047
13047
|
rowspan: d.rowspan - 1
|
|
13048
13048
|
}), c += d.colspan - 1;
|
|
13049
13049
|
} else if (s < e.height && f == e.map[u + e.width]) {
|
|
13050
|
-
const d = t.nodeAt(f),
|
|
13051
|
-
{ ...
|
|
13050
|
+
const d = t.nodeAt(f), p = d.attrs, h = d.type.create(
|
|
13051
|
+
{ ...p, rowspan: d.attrs.rowspan - 1 },
|
|
13052
13052
|
d.content
|
|
13053
13053
|
), y = e.positionAt(s + 1, c, t);
|
|
13054
|
-
n.insert(n.mapping.slice(l).map(r + y),
|
|
13054
|
+
n.insert(n.mapping.slice(l).map(r + y), h), c += p.colspan - 1;
|
|
13055
13055
|
}
|
|
13056
13056
|
}
|
|
13057
13057
|
}
|
|
@@ -13100,14 +13100,14 @@ function ly(n, e) {
|
|
|
13100
13100
|
let l = k.empty, a, c;
|
|
13101
13101
|
for (let u = r.top; u < r.bottom; u++)
|
|
13102
13102
|
for (let f = r.left; f < r.right; f++) {
|
|
13103
|
-
const d = s.map[u * s.width + f],
|
|
13104
|
-
if (!(i[d] || !
|
|
13103
|
+
const d = s.map[u * s.width + f], p = r.table.nodeAt(d);
|
|
13104
|
+
if (!(i[d] || !p))
|
|
13105
13105
|
if (i[d] = !0, a == null)
|
|
13106
|
-
a = d, c =
|
|
13106
|
+
a = d, c = p;
|
|
13107
13107
|
else {
|
|
13108
|
-
ia(
|
|
13109
|
-
const
|
|
13110
|
-
o.delete(
|
|
13108
|
+
ia(p) || (l = l.append(p.content));
|
|
13109
|
+
const h = o.mapping.map(d + r.tableStart);
|
|
13110
|
+
o.delete(h, h + p.nodeSize);
|
|
13111
13111
|
}
|
|
13112
13112
|
}
|
|
13113
13113
|
if (a == null || c == null)
|
|
@@ -13152,21 +13152,21 @@ function cy(n) {
|
|
|
13152
13152
|
const a = [], c = l.colwidth;
|
|
13153
13153
|
l.rowspan > 1 && (l = { ...l, rowspan: 1 }), l.colspan > 1 && (l = { ...l, colspan: 1 });
|
|
13154
13154
|
const u = Ze(e), f = e.tr;
|
|
13155
|
-
for (let
|
|
13155
|
+
for (let p = 0; p < u.right - u.left; p++)
|
|
13156
13156
|
a.push(
|
|
13157
13157
|
c ? {
|
|
13158
13158
|
...l,
|
|
13159
|
-
colwidth: c && c[
|
|
13159
|
+
colwidth: c && c[p] ? [c[p]] : null
|
|
13160
13160
|
} : l
|
|
13161
13161
|
);
|
|
13162
13162
|
let d;
|
|
13163
|
-
for (let
|
|
13164
|
-
let
|
|
13165
|
-
|
|
13163
|
+
for (let p = u.top; p < u.bottom; p++) {
|
|
13164
|
+
let h = u.map.positionAt(p, u.left, u.table);
|
|
13165
|
+
p == u.top && (h += o.nodeSize);
|
|
13166
13166
|
for (let y = u.left, m = 0; y < u.right; y++, m++)
|
|
13167
|
-
y == u.left &&
|
|
13168
|
-
d = f.mapping.map(
|
|
13169
|
-
n({ node: o, row:
|
|
13167
|
+
y == u.left && p == u.top || f.insert(
|
|
13168
|
+
d = f.mapping.map(h + u.tableStart, 1),
|
|
13169
|
+
n({ node: o, row: p, col: y }).createAndFill(a[m])
|
|
13170
13170
|
);
|
|
13171
13171
|
}
|
|
13172
13172
|
f.setNodeMarkup(
|
|
@@ -13271,9 +13271,9 @@ function pi(n, e) {
|
|
|
13271
13271
|
right: o.map.width,
|
|
13272
13272
|
bottom: 1
|
|
13273
13273
|
} : o, d = n == "column" ? a ? s.cell : s.header_cell : n == "row" ? l ? s.cell : s.header_cell : s.cell;
|
|
13274
|
-
o.map.cellsInRect(f).forEach((
|
|
13275
|
-
const
|
|
13276
|
-
y && i.setNodeMarkup(
|
|
13274
|
+
o.map.cellsInRect(f).forEach((p) => {
|
|
13275
|
+
const h = p + o.tableStart, y = i.doc.nodeAt(h);
|
|
13276
|
+
y && i.setNodeMarkup(h, d, y.attrs);
|
|
13277
13277
|
}), r(i);
|
|
13278
13278
|
}
|
|
13279
13279
|
return !0;
|
|
@@ -13412,8 +13412,8 @@ function by({ width: n, height: e, rows: t }, r, s) {
|
|
|
13412
13412
|
),
|
|
13413
13413
|
d.content
|
|
13414
13414
|
)), c.push(d), u += d.attrs.colspan;
|
|
13415
|
-
for (let
|
|
13416
|
-
o[l +
|
|
13415
|
+
for (let p = 1; p < d.attrs.rowspan; p++)
|
|
13416
|
+
o[l + p] = (o[l + p] || 0) + d.attrs.colspan;
|
|
13417
13417
|
}
|
|
13418
13418
|
i.push(k.from(c));
|
|
13419
13419
|
}
|
|
@@ -13444,25 +13444,25 @@ function xy(n, e, t, r, s, o, i) {
|
|
|
13444
13444
|
let c, u;
|
|
13445
13445
|
if (s > e.width)
|
|
13446
13446
|
for (let f = 0, d = 0; f < e.height; f++) {
|
|
13447
|
-
const
|
|
13448
|
-
d +=
|
|
13449
|
-
const
|
|
13447
|
+
const p = t.child(f);
|
|
13448
|
+
d += p.nodeSize;
|
|
13449
|
+
const h = [];
|
|
13450
13450
|
let y;
|
|
13451
|
-
|
|
13452
|
-
for (let m = e.width; m < s; m++)
|
|
13453
|
-
n.insert(n.mapping.slice(i).map(d - 1 + r),
|
|
13451
|
+
p.lastChild == null || p.lastChild.type == a.cell ? y = c || (c = a.cell.createAndFill()) : y = u || (u = a.header_cell.createAndFill());
|
|
13452
|
+
for (let m = e.width; m < s; m++) h.push(y);
|
|
13453
|
+
n.insert(n.mapping.slice(i).map(d - 1 + r), h);
|
|
13454
13454
|
}
|
|
13455
13455
|
if (o > e.height) {
|
|
13456
13456
|
const f = [];
|
|
13457
|
-
for (let
|
|
13458
|
-
const m =
|
|
13457
|
+
for (let h = 0, y = (e.height - 1) * e.width; h < Math.max(e.width, s); h++) {
|
|
13458
|
+
const m = h >= e.width ? !1 : t.nodeAt(e.map[y + h]).type == a.header_cell;
|
|
13459
13459
|
f.push(
|
|
13460
13460
|
m ? u || (u = a.header_cell.createAndFill()) : c || (c = a.cell.createAndFill())
|
|
13461
13461
|
);
|
|
13462
13462
|
}
|
|
13463
|
-
const d = a.row.create(null, k.from(f)),
|
|
13464
|
-
for (let
|
|
13465
|
-
n.insert(n.mapping.slice(i).map(r + t.nodeSize - 2),
|
|
13463
|
+
const d = a.row.create(null, k.from(f)), p = [];
|
|
13464
|
+
for (let h = e.height; h < o; h++) p.push(d);
|
|
13465
|
+
n.insert(n.mapping.slice(i).map(r + t.nodeSize - 2), p);
|
|
13466
13466
|
}
|
|
13467
13467
|
return !!(c || u);
|
|
13468
13468
|
}
|
|
@@ -13473,15 +13473,15 @@ function ca(n, e, t, r, s, o, i, l) {
|
|
|
13473
13473
|
const u = i * e.width + c, f = e.map[u];
|
|
13474
13474
|
if (e.map[u - e.width] == f) {
|
|
13475
13475
|
a = !0;
|
|
13476
|
-
const d = t.nodeAt(f), { top:
|
|
13476
|
+
const d = t.nodeAt(f), { top: p, left: h } = e.findCell(f);
|
|
13477
13477
|
n.setNodeMarkup(n.mapping.slice(l).map(f + r), null, {
|
|
13478
13478
|
...d.attrs,
|
|
13479
|
-
rowspan: i -
|
|
13479
|
+
rowspan: i - p
|
|
13480
13480
|
}), n.insert(
|
|
13481
|
-
n.mapping.slice(l).map(e.positionAt(i,
|
|
13481
|
+
n.mapping.slice(l).map(e.positionAt(i, h, t)),
|
|
13482
13482
|
d.type.createAndFill({
|
|
13483
13483
|
...d.attrs,
|
|
13484
|
-
rowspan:
|
|
13484
|
+
rowspan: p + d.attrs.rowspan - i
|
|
13485
13485
|
})
|
|
13486
13486
|
), c += d.attrs.colspan - 1;
|
|
13487
13487
|
}
|
|
@@ -13495,19 +13495,19 @@ function ua(n, e, t, r, s, o, i, l) {
|
|
|
13495
13495
|
const u = c * e.width + i, f = e.map[u];
|
|
13496
13496
|
if (e.map[u - 1] == f) {
|
|
13497
13497
|
a = !0;
|
|
13498
|
-
const d = t.nodeAt(f),
|
|
13498
|
+
const d = t.nodeAt(f), p = e.colCount(f), h = n.mapping.slice(l).map(f + r);
|
|
13499
13499
|
n.setNodeMarkup(
|
|
13500
|
-
|
|
13500
|
+
h,
|
|
13501
13501
|
null,
|
|
13502
13502
|
en(
|
|
13503
13503
|
d.attrs,
|
|
13504
|
-
i -
|
|
13505
|
-
d.attrs.colspan - (i -
|
|
13504
|
+
i - p,
|
|
13505
|
+
d.attrs.colspan - (i - p)
|
|
13506
13506
|
)
|
|
13507
13507
|
), n.insert(
|
|
13508
|
-
|
|
13508
|
+
h + d.nodeSize,
|
|
13509
13509
|
d.type.createAndFill(
|
|
13510
|
-
en(d.attrs, 0, i -
|
|
13510
|
+
en(d.attrs, 0, i - p)
|
|
13511
13511
|
)
|
|
13512
13512
|
), c += d.attrs.rowspan - 1;
|
|
13513
13513
|
}
|
|
@@ -13521,21 +13521,21 @@ function fa(n, e, t, r, s) {
|
|
|
13521
13521
|
let i = Z.get(o);
|
|
13522
13522
|
const { top: l, left: a } = r, c = a + s.width, u = l + s.height, f = n.tr;
|
|
13523
13523
|
let d = 0;
|
|
13524
|
-
function
|
|
13524
|
+
function p() {
|
|
13525
13525
|
if (o = t ? f.doc.nodeAt(t - 1) : f.doc, !o)
|
|
13526
13526
|
throw new Error("No table found");
|
|
13527
13527
|
i = Z.get(o), d = f.mapping.maps.length;
|
|
13528
13528
|
}
|
|
13529
|
-
xy(f, i, o, t, c, u, d) &&
|
|
13530
|
-
for (let
|
|
13531
|
-
const y = i.positionAt(
|
|
13529
|
+
xy(f, i, o, t, c, u, d) && p(), ca(f, i, o, t, a, c, l, d) && p(), ca(f, i, o, t, a, c, u, d) && p(), ua(f, i, o, t, l, u, a, d) && p(), ua(f, i, o, t, l, u, c, d) && p();
|
|
13530
|
+
for (let h = l; h < u; h++) {
|
|
13531
|
+
const y = i.positionAt(h, a, o), m = i.positionAt(h, c, o);
|
|
13532
13532
|
f.replace(
|
|
13533
13533
|
f.mapping.slice(d).map(y + t),
|
|
13534
13534
|
f.mapping.slice(d).map(m + t),
|
|
13535
|
-
new M(s.rows[
|
|
13535
|
+
new M(s.rows[h - l], 0, 0)
|
|
13536
13536
|
);
|
|
13537
13537
|
}
|
|
13538
|
-
|
|
13538
|
+
p(), f.setSelection(
|
|
13539
13539
|
new H(
|
|
13540
13540
|
f.doc.resolve(t + i.positionAt(l, a, o)),
|
|
13541
13541
|
f.doc.resolve(t + i.positionAt(u - 1, c - 1, o))
|
|
@@ -13659,8 +13659,8 @@ function wy(n, e) {
|
|
|
13659
13659
|
else return;
|
|
13660
13660
|
const d = new H(a, u);
|
|
13661
13661
|
if (f || !n.state.selection.eq(d)) {
|
|
13662
|
-
const
|
|
13663
|
-
f &&
|
|
13662
|
+
const p = n.state.tr.setSelection(d);
|
|
13663
|
+
f && p.setMeta(kt, a.pos), n.dispatch(p);
|
|
13664
13664
|
}
|
|
13665
13665
|
}
|
|
13666
13666
|
function i() {
|
|
@@ -14024,8 +14024,8 @@ function By() {
|
|
|
14024
14024
|
for (const [c, u] of a) {
|
|
14025
14025
|
const { pos: f, deleted: d } = e.mapping.mapResult(c);
|
|
14026
14026
|
if (d) continue;
|
|
14027
|
-
let
|
|
14028
|
-
i === u && (
|
|
14027
|
+
let p = u;
|
|
14028
|
+
i === u && (p = Gs()), l.posToKey.set(f, p), l.keyToPos.set(p, f);
|
|
14029
14029
|
}
|
|
14030
14030
|
return s.doc.descendants((c, u) => {
|
|
14031
14031
|
if (l.posToKey.has(u)) return !0;
|
|
@@ -14130,8 +14130,8 @@ function Ly(n) {
|
|
|
14130
14130
|
case "deleteContent": {
|
|
14131
14131
|
const l = s.getTargetRanges(), { tr: a } = r.state;
|
|
14132
14132
|
for (const c of l) {
|
|
14133
|
-
const u = r.posAtDOM(c.startContainer, c.startOffset), f = r.posAtDOM(c.endContainer, c.endOffset), { doc: d } = r.state,
|
|
14134
|
-
a.delete(u, f).setStoredMarks(
|
|
14133
|
+
const u = r.posAtDOM(c.startContainer, c.startOffset), f = r.posAtDOM(c.endContainer, c.endOffset), { doc: d } = r.state, p = d.resolve(u).marksAcross(d.resolve(f));
|
|
14134
|
+
a.delete(u, f).setStoredMarks(p);
|
|
14135
14135
|
}
|
|
14136
14136
|
r.dispatch(a);
|
|
14137
14137
|
break;
|
|
@@ -14202,16 +14202,16 @@ function xa(n) {
|
|
|
14202
14202
|
t instanceof n.dom.ownerDocument.defaultView.Selection && t.rangeCount > 1
|
|
14203
14203
|
) {
|
|
14204
14204
|
let f = i, d = i;
|
|
14205
|
-
for (let
|
|
14206
|
-
const
|
|
14205
|
+
for (let p = 0; p < t.rangeCount; p++) {
|
|
14206
|
+
const h = t.getRangeAt(p);
|
|
14207
14207
|
f = Math.min(
|
|
14208
14208
|
f,
|
|
14209
14209
|
// @ts-expect-error Internal method
|
|
14210
|
-
n.docView.posFromDOM(
|
|
14210
|
+
n.docView.posFromDOM(h.startContainer, h.startOffset, 1)
|
|
14211
14211
|
), d = Math.max(
|
|
14212
14212
|
d,
|
|
14213
14213
|
// @ts-expect-error Internal method
|
|
14214
|
-
n.docView.posFromDOM(
|
|
14214
|
+
n.docView.posFromDOM(h.endContainer, h.endOffset, -1)
|
|
14215
14215
|
);
|
|
14216
14216
|
}
|
|
14217
14217
|
if (f < 0) return null;
|
|
@@ -14784,11 +14784,11 @@ class yr {
|
|
|
14784
14784
|
// a selection starts in such a node and ends in another, in which
|
|
14785
14785
|
// case we just use whatever domFromPos produces as a best effort.
|
|
14786
14786
|
setSelection(e, t, r) {
|
|
14787
|
-
var
|
|
14787
|
+
var p;
|
|
14788
14788
|
let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
|
|
14789
14789
|
const o = Math.min(e, t), i = Math.max(e, t);
|
|
14790
|
-
for (let
|
|
14791
|
-
const m = this.children[
|
|
14790
|
+
for (let h = 0, y = 0; h < this.children.length; h++) {
|
|
14791
|
+
const m = this.children[h], x = y + m.size;
|
|
14792
14792
|
if (o > y && i < x) return m.setSelection(e - y - m.border, t - y - m.border, r, s);
|
|
14793
14793
|
y = x;
|
|
14794
14794
|
}
|
|
@@ -14796,11 +14796,11 @@ class yr {
|
|
|
14796
14796
|
const c = r.root.getSelection(), u = r.domSelectionRange();
|
|
14797
14797
|
let f = !1;
|
|
14798
14798
|
if ((fe.gecko || fe.safari) && e == t) {
|
|
14799
|
-
const { node:
|
|
14800
|
-
if (
|
|
14801
|
-
if (f = !!(y && ((
|
|
14802
|
-
`), f && y ==
|
|
14803
|
-
for (let m =
|
|
14799
|
+
const { node: h, offset: y } = l;
|
|
14800
|
+
if (h.nodeType == 3) {
|
|
14801
|
+
if (f = !!(y && ((p = h.nodeValue) == null ? void 0 : p[y - 1]) == `
|
|
14802
|
+
`), f && y == h.nodeValue.length)
|
|
14803
|
+
for (let m = h, x; m; m = m.parentNode) {
|
|
14804
14804
|
if (x = m.nextSibling) {
|
|
14805
14805
|
x.nodeName == "BR" && (l = a = {
|
|
14806
14806
|
node: x.parentNode,
|
|
@@ -14812,13 +14812,13 @@ class yr {
|
|
|
14812
14812
|
if (C && C.node && C.node.isBlock) break;
|
|
14813
14813
|
}
|
|
14814
14814
|
} else {
|
|
14815
|
-
const m =
|
|
14815
|
+
const m = h.childNodes[y - 1];
|
|
14816
14816
|
f = m && (m.nodeName == "BR" || m.contentEditable == "false");
|
|
14817
14817
|
}
|
|
14818
14818
|
}
|
|
14819
14819
|
if (fe.gecko && u.focusNode && u.focusNode != a.node && u.focusNode.nodeType == 1) {
|
|
14820
|
-
const
|
|
14821
|
-
|
|
14820
|
+
const h = u.focusNode.childNodes[u.focusOffset];
|
|
14821
|
+
h && h.contentEditable == "false" && (s = !0);
|
|
14822
14822
|
}
|
|
14823
14823
|
if (!(s || f && fe.safari) && rs(l.node, l.offset, u.anchorNode, u.anchorOffset) && rs(a.node, a.offset, u.focusNode, u.focusOffset)) return;
|
|
14824
14824
|
let d = !1;
|
|
@@ -14834,8 +14834,8 @@ class yr {
|
|
|
14834
14834
|
const y = l;
|
|
14835
14835
|
l = a, a = y;
|
|
14836
14836
|
}
|
|
14837
|
-
const
|
|
14838
|
-
|
|
14837
|
+
const h = document.createRange();
|
|
14838
|
+
h.setEnd(a.node, a.offset), h.setStart(l.node, l.offset), c.removeAllRanges(), c.addRange(h);
|
|
14839
14839
|
}
|
|
14840
14840
|
}
|
|
14841
14841
|
ignoreMutation(e) {
|
|
@@ -14958,7 +14958,7 @@ class sb extends yr {
|
|
|
14958
14958
|
}
|
|
14959
14959
|
}
|
|
14960
14960
|
class yi extends yr {
|
|
14961
|
-
constructor(t, r, s, o, i, l, a, c, u, f, d,
|
|
14961
|
+
constructor(t, r, s, o, i, l, a, c, u, f, d, p, h) {
|
|
14962
14962
|
super(t, r, s, a, c);
|
|
14963
14963
|
B(this, "node");
|
|
14964
14964
|
B(this, "outerDeco");
|
|
@@ -14968,7 +14968,7 @@ class yi extends yr {
|
|
|
14968
14968
|
B(this, "selectNode");
|
|
14969
14969
|
B(this, "deselectNode");
|
|
14970
14970
|
B(this, "ignoreMutation");
|
|
14971
|
-
this.node = o, this.outerDeco = i, this.innerDeco = l, this.nodeDOM = u, this.stopEvent = f, this.selectNode = d, this.deselectNode =
|
|
14971
|
+
this.node = o, this.outerDeco = i, this.innerDeco = l, this.nodeDOM = u, this.stopEvent = f, this.selectNode = d, this.deselectNode = p, this.ignoreMutation = h;
|
|
14972
14972
|
}
|
|
14973
14973
|
updateOuterDeco() {
|
|
14974
14974
|
}
|
|
@@ -15224,18 +15224,18 @@ const db = new cs({
|
|
|
15224
15224
|
let Aa = !1;
|
|
15225
15225
|
function pb(n, e) {
|
|
15226
15226
|
process.env.NODE_ENV !== "production" && e.defaultState !== void 0 && e.state !== void 0 && !Aa && (console.error("A component contains a ProseMirror editor with both value and defaultValue props. ProseMirror editors must be either controlled or uncontrolled (specify either the state prop, or the defaultState prop, but not both). Decide between using a controlled or uncontrolled ProseMirror editor and remove one of these props. More info: https://reactjs.org/link/controlled-components"), Aa = !0);
|
|
15227
|
-
const t = I(!0), [r, s] = N(null), o = bi(), i = e.defaultState ?? hb, [l, a] = N(i), c = e.state ?? l, { componentEventListenersPlugin: u, registerEventListener: f, unregisterEventListener: d } = ab(),
|
|
15227
|
+
const t = I(!0), [r, s] = N(null), o = bi(), i = e.defaultState ?? hb, [l, a] = N(i), c = e.state ?? l, { componentEventListenersPlugin: u, registerEventListener: f, unregisterEventListener: d } = ab(), p = He(($) => {
|
|
15228
15228
|
Vi(() => {
|
|
15229
15229
|
s($);
|
|
15230
15230
|
});
|
|
15231
|
-
}, []),
|
|
15231
|
+
}, []), h = Me(() => [
|
|
15232
15232
|
...e.plugins ?? [],
|
|
15233
15233
|
u,
|
|
15234
|
-
Ly(
|
|
15234
|
+
Ly(p)
|
|
15235
15235
|
], [
|
|
15236
15236
|
e.plugins,
|
|
15237
15237
|
u,
|
|
15238
|
-
|
|
15238
|
+
p
|
|
15239
15239
|
]), y = He(function(j) {
|
|
15240
15240
|
t.current ? Vi(() => {
|
|
15241
15241
|
e.state || a((E) => E.apply(j)), e.dispatchTransaction && e.dispatchTransaction.call(this, j);
|
|
@@ -15250,7 +15250,7 @@ function pb(n, e) {
|
|
|
15250
15250
|
}, () => !1)), w = {
|
|
15251
15251
|
...e,
|
|
15252
15252
|
state: c,
|
|
15253
|
-
plugins:
|
|
15253
|
+
plugins: h,
|
|
15254
15254
|
dispatchTransaction: y,
|
|
15255
15255
|
docView: C.current
|
|
15256
15256
|
}, [O, v] = N(
|
|
@@ -15333,10 +15333,10 @@ const Oe = ft({
|
|
|
15333
15333
|
}
|
|
15334
15334
|
});
|
|
15335
15335
|
function xi(n, e, t, r, s, o, i, l) {
|
|
15336
|
-
const { view: a } = ie(Vt), [c, u] = N(!0), f = I(i), d = I(() => !1),
|
|
15336
|
+
const { view: a } = ie(Vt), [c, u] = N(!0), f = I(i), d = I(() => !1), p = He((S) => {
|
|
15337
15337
|
d.current = S;
|
|
15338
|
-
}, []),
|
|
15339
|
-
|
|
15338
|
+
}, []), h = I(() => !1), y = He((S) => {
|
|
15339
|
+
h.current = S;
|
|
15340
15340
|
}, []), m = I(() => {
|
|
15341
15341
|
!r.current || !n || (r.current.nodeType == 1 && r.current.classList.add("ProseMirror-selectednode"), (l != null && l.current || !n.type.spec.draggable) && (((t == null ? void 0 : t.current) ?? r.current).draggable = !0));
|
|
15342
15342
|
}), x = I(() => {
|
|
@@ -15362,7 +15362,7 @@ function xi(n, e, t, r, s, o, i, l) {
|
|
|
15362
15362
|
// keep it; it won't have changed. This is especially
|
|
15363
15363
|
// important during compositions, where the
|
|
15364
15364
|
// firstChildDesc might not have a correct dom node set yet.
|
|
15365
|
-
(l == null ? void 0 : l.current) ?? f.current.contentDOM ?? (S == null ? void 0 : S.dom.parentElement) ?? null, f.current.nodeDOM = r.current) : f.current = new yi(O.current, v.current, e, n, o, s, (t == null ? void 0 : t.current) ?? r.current, (S == null ? void 0 : S.dom.parentElement) ?? null, r.current, (j) => !!d.current(j), () => m.current(), () => x.current(), (j) =>
|
|
15365
|
+
(l == null ? void 0 : l.current) ?? f.current.contentDOM ?? (S == null ? void 0 : S.dom.parentElement) ?? null, f.current.nodeDOM = r.current) : f.current = new yi(O.current, v.current, e, n, o, s, (t == null ? void 0 : t.current) ?? r.current, (S == null ? void 0 : S.dom.parentElement) ?? null, r.current, (j) => !!d.current(j), () => m.current(), () => x.current(), (j) => h.current(j)), u(f.current.contentDOM !== null), w.current.includes(f.current) || w.current.push(f.current), w.current.sort(sn);
|
|
15366
15366
|
for (const j of v.current)
|
|
15367
15367
|
if (j.parent = f.current, j instanceof ss) {
|
|
15368
15368
|
const E = ($ = f.current.contentDOM) == null ? void 0 : $.firstChild;
|
|
@@ -15381,7 +15381,7 @@ function xi(n, e, t, r, s, o, i, l) {
|
|
|
15381
15381
|
hasContentDOM: c,
|
|
15382
15382
|
childDescriptors: v,
|
|
15383
15383
|
nodeViewDescRef: f,
|
|
15384
|
-
setStopEvent:
|
|
15384
|
+
setStopEvent: p,
|
|
15385
15385
|
setSelectNode: C,
|
|
15386
15386
|
setIgnoreMutation: y
|
|
15387
15387
|
};
|
|
@@ -15404,10 +15404,10 @@ function yb(n, e, t, r) {
|
|
|
15404
15404
|
let a = null;
|
|
15405
15405
|
for (let c = 0; ; ) {
|
|
15406
15406
|
if (i < s.length && s[i].to == o) {
|
|
15407
|
-
const
|
|
15407
|
+
const h = s[i++];
|
|
15408
15408
|
let y;
|
|
15409
15409
|
for (; i < s.length && s[i].to == o; ) (y || (y = [
|
|
15410
|
-
|
|
15410
|
+
h
|
|
15411
15411
|
])).push(s[i++]);
|
|
15412
15412
|
if (y) {
|
|
15413
15413
|
y.sort(gb);
|
|
@@ -15421,9 +15421,9 @@ function yb(n, e, t, r) {
|
|
|
15421
15421
|
);
|
|
15422
15422
|
} else
|
|
15423
15423
|
t(
|
|
15424
|
-
|
|
15424
|
+
h,
|
|
15425
15425
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15426
|
-
!(
|
|
15426
|
+
!(h.type instanceof rr),
|
|
15427
15427
|
o,
|
|
15428
15428
|
c,
|
|
15429
15429
|
!!a
|
|
@@ -15436,17 +15436,17 @@ function yb(n, e, t, r) {
|
|
|
15436
15436
|
f = c, u = n.child(c++);
|
|
15437
15437
|
else
|
|
15438
15438
|
break;
|
|
15439
|
-
for (let
|
|
15439
|
+
for (let h = 0; h < l.length; h++) l[h].to <= o && l.splice(h--, 1);
|
|
15440
15440
|
for (; i < s.length && s[i].from <= o && s[i].to > o; ) l.push(s[i++]);
|
|
15441
15441
|
let d = o + u.nodeSize;
|
|
15442
15442
|
if (u.isText) {
|
|
15443
|
-
let
|
|
15444
|
-
i < s.length && s[i].from <
|
|
15445
|
-
for (let y = 0; y < l.length; y++) l[y].to <
|
|
15446
|
-
|
|
15443
|
+
let h = d;
|
|
15444
|
+
i < s.length && s[i].from < h && (h = s[i].from);
|
|
15445
|
+
for (let y = 0; y < l.length; y++) l[y].to < h && (h = l[y].to);
|
|
15446
|
+
h < d && (a = u.cut(h - o), u = u.cut(0, h - o), d = h, f = -1);
|
|
15447
15447
|
}
|
|
15448
|
-
const
|
|
15449
|
-
r(u,
|
|
15448
|
+
const p = u.isInline && !u.isLeaf ? l.filter((h) => !h.inline) : l.slice();
|
|
15449
|
+
r(u, p, e.forChild(o, u), o, f), o = d;
|
|
15450
15450
|
}
|
|
15451
15451
|
}
|
|
15452
15452
|
function bb() {
|
|
@@ -15706,15 +15706,15 @@ const ki = /* @__PURE__ */ Fe(/* @__PURE__ */ Ge(function(e, t) {
|
|
|
15706
15706
|
}, f = 1;
|
|
15707
15707
|
c && typeof c == "object" && c.nodeType == null && !Array.isArray(c) && (f = 2, u = sf(of(c), u));
|
|
15708
15708
|
const d = [];
|
|
15709
|
-
for (let
|
|
15710
|
-
const
|
|
15711
|
-
if (
|
|
15712
|
-
if (
|
|
15709
|
+
for (let p = f; p < r.length; p++) {
|
|
15710
|
+
const h = r[p];
|
|
15711
|
+
if (h === 0) {
|
|
15712
|
+
if (p < r.length - 1 || p > f)
|
|
15713
15713
|
throw new RangeError("Content hole must be the only child of its parent node");
|
|
15714
15714
|
return /* @__PURE__ */ Kn(a, u, o);
|
|
15715
15715
|
}
|
|
15716
15716
|
d.push(/* @__PURE__ */ P.createElement(ki, {
|
|
15717
|
-
outputSpec:
|
|
15717
|
+
outputSpec: h
|
|
15718
15718
|
}, o));
|
|
15719
15719
|
}
|
|
15720
15720
|
return s && !lf(r) && d.push(o), /* @__PURE__ */ Kn(a, u, ...d);
|
|
@@ -15723,31 +15723,31 @@ const ki = /* @__PURE__ */ Fe(/* @__PURE__ */ Ge(function(e, t) {
|
|
|
15723
15723
|
const { siblingsRef: i, parentRef: l } = ie(Oe), a = I(void 0), c = I([]), u = I(null);
|
|
15724
15724
|
is(t, () => u.current, []);
|
|
15725
15725
|
const f = Me(() => {
|
|
15726
|
-
var
|
|
15727
|
-
return (
|
|
15726
|
+
var p, h;
|
|
15727
|
+
return (h = (p = r.type.spec).toDOM) == null ? void 0 : h.call(p, r, !0);
|
|
15728
15728
|
}, [
|
|
15729
15729
|
r
|
|
15730
15730
|
]);
|
|
15731
15731
|
if (!f) throw new Error(`Mark spec for ${r.type.name} is missing toDOM`);
|
|
15732
15732
|
X(() => {
|
|
15733
|
-
const
|
|
15733
|
+
const p = i.current;
|
|
15734
15734
|
return () => {
|
|
15735
|
-
if (a.current &&
|
|
15736
|
-
const
|
|
15737
|
-
|
|
15735
|
+
if (a.current && p.includes(a.current)) {
|
|
15736
|
+
const h = p.indexOf(a.current);
|
|
15737
|
+
p.splice(h, 1);
|
|
15738
15738
|
}
|
|
15739
15739
|
};
|
|
15740
15740
|
}, [
|
|
15741
15741
|
i
|
|
15742
15742
|
]), X(() => {
|
|
15743
15743
|
if (!u.current) return;
|
|
15744
|
-
const
|
|
15745
|
-
a.current ? (a.current.parent = l.current, a.current.spec.dom = a.current.dom = u.current, a.current.children = c.current, a.current.spec.contentDOM = a.current.contentDOM = (
|
|
15744
|
+
const p = c.current[0];
|
|
15745
|
+
a.current ? (a.current.parent = l.current, a.current.spec.dom = a.current.dom = u.current, a.current.children = c.current, a.current.spec.contentDOM = a.current.contentDOM = (p == null ? void 0 : p.dom.parentElement) ?? u.current, a.current.mark = r, a.current.getPos = () => s.current()) : a.current = new sb(l.current, c.current, () => s.current(), r, u.current, (p == null ? void 0 : p.dom.parentElement) ?? u.current, {
|
|
15746
15746
|
dom: u.current,
|
|
15747
|
-
contentDOM: (
|
|
15747
|
+
contentDOM: (p == null ? void 0 : p.dom.parentElement) ?? u.current
|
|
15748
15748
|
}), i.current.includes(a.current) || i.current.push(a.current), i.current.sort(sn);
|
|
15749
|
-
for (const
|
|
15750
|
-
|
|
15749
|
+
for (const h of c.current)
|
|
15750
|
+
h.parent = a.current;
|
|
15751
15751
|
});
|
|
15752
15752
|
const d = Me(() => ({
|
|
15753
15753
|
parentRef: a,
|
|
@@ -15808,10 +15808,10 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
|
|
|
15808
15808
|
let { customNodeView: t, node: r, getPos: s, innerDeco: o, outerDeco: i } = e;
|
|
15809
15809
|
const { view: l } = ie(Vt), a = I(null), c = I(null), u = I(null), f = I(() => s.current()).current, d = I(r);
|
|
15810
15810
|
d.current = r;
|
|
15811
|
-
const
|
|
15812
|
-
|
|
15813
|
-
const
|
|
15814
|
-
|
|
15811
|
+
const p = I(i);
|
|
15812
|
+
p.current = i;
|
|
15813
|
+
const h = I(o);
|
|
15814
|
+
h.current = o;
|
|
15815
15815
|
const y = I(null), m = I(null), x = bi(), C = Db();
|
|
15816
15816
|
X(() => {
|
|
15817
15817
|
var $t, on, Tn;
|
|
@@ -15822,8 +15822,8 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
|
|
|
15822
15822
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
15823
15823
|
l,
|
|
15824
15824
|
f,
|
|
15825
|
-
|
|
15826
|
-
|
|
15825
|
+
p.current,
|
|
15826
|
+
h.current
|
|
15827
15827
|
), m.current.stopEvent && v(m.current.stopEvent.bind(m.current)), m.current.selectNode && S(m.current.selectNode.bind(m.current), (($t = m.current.deselectNode) == null ? void 0 : $t.bind(m.current)) ?? (() => {
|
|
15828
15828
|
})), m.current.ignoreMutation && $(m.current.ignoreMutation.bind(m.current)), x()), !y.current) return;
|
|
15829
15829
|
const { dom: Ee } = m.current;
|
|
@@ -15850,8 +15850,8 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
|
|
|
15850
15850
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
15851
15851
|
l,
|
|
15852
15852
|
f,
|
|
15853
|
-
|
|
15854
|
-
|
|
15853
|
+
p.current,
|
|
15854
|
+
h.current
|
|
15855
15855
|
);
|
|
15856
15856
|
const { dom: on } = m.current;
|
|
15857
15857
|
c.current = y.current, y.current.appendChild(on);
|
|
@@ -15879,8 +15879,8 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
|
|
|
15879
15879
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
15880
15880
|
l,
|
|
15881
15881
|
() => s.current(),
|
|
15882
|
-
|
|
15883
|
-
|
|
15882
|
+
p.current,
|
|
15883
|
+
h.current
|
|
15884
15884
|
), m.current.stopEvent && v(m.current.stopEvent.bind(m.current)), m.current.selectNode && S(m.current.selectNode.bind(m.current), ((dt = m.current.deselectNode) == null ? void 0 : dt.bind(m.current)) ?? (() => {
|
|
15885
15885
|
})), m.current.ignoreMutation && $(m.current.ignoreMutation.bind(m.current)));
|
|
15886
15886
|
const { contentDOM: E } = m.current;
|
|
@@ -15911,7 +15911,7 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
|
|
|
15911
15911
|
let { outerDeco: t, getPos: r, node: s, innerDeco: o, ...i } = e;
|
|
15912
15912
|
const l = I(null), a = I(null), c = I(null), u = I(() => r.current()).current, { nodeViews: f } = ie(Ju);
|
|
15913
15913
|
let d = null;
|
|
15914
|
-
const
|
|
15914
|
+
const p = f[s.type.name], h = Me(() => {
|
|
15915
15915
|
var E, _;
|
|
15916
15916
|
return (_ = (E = s.type.spec).toDOM) == null ? void 0 : _.call(E, s);
|
|
15917
15917
|
}, [
|
|
@@ -15932,7 +15932,7 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
|
|
|
15932
15932
|
s,
|
|
15933
15933
|
t
|
|
15934
15934
|
]);
|
|
15935
|
-
if (
|
|
15935
|
+
if (p ? d = /* @__PURE__ */ P.createElement(p, {
|
|
15936
15936
|
...v,
|
|
15937
15937
|
ref: a,
|
|
15938
15938
|
nodeProps: S
|
|
@@ -15940,10 +15940,10 @@ const Ob = /* @__PURE__ */ Fe(function(e) {
|
|
|
15940
15940
|
getPos: r,
|
|
15941
15941
|
node: s,
|
|
15942
15942
|
innerDecorations: o
|
|
15943
|
-
})) :
|
|
15943
|
+
})) : h && (d = /* @__PURE__ */ P.createElement(ki, {
|
|
15944
15944
|
...v,
|
|
15945
15945
|
ref: a,
|
|
15946
|
-
outputSpec:
|
|
15946
|
+
outputSpec: h
|
|
15947
15947
|
}, /* @__PURE__ */ P.createElement(lr, {
|
|
15948
15948
|
getPos: r,
|
|
15949
15949
|
node: s,
|
|
@@ -16084,28 +16084,28 @@ function Ib() {
|
|
|
16084
16084
|
}
|
|
16085
16085
|
if (a.return !== c.return) a = u, c = f;
|
|
16086
16086
|
else {
|
|
16087
|
-
for (var d = !1,
|
|
16088
|
-
if (
|
|
16087
|
+
for (var d = !1, p = u.child; p; ) {
|
|
16088
|
+
if (p === a) {
|
|
16089
16089
|
d = !0, a = u, c = f;
|
|
16090
16090
|
break;
|
|
16091
16091
|
}
|
|
16092
|
-
if (
|
|
16092
|
+
if (p === c) {
|
|
16093
16093
|
d = !0, c = u, a = f;
|
|
16094
16094
|
break;
|
|
16095
16095
|
}
|
|
16096
|
-
|
|
16096
|
+
p = p.sibling;
|
|
16097
16097
|
}
|
|
16098
16098
|
if (!d) {
|
|
16099
|
-
for (
|
|
16100
|
-
if (
|
|
16099
|
+
for (p = f.child; p; ) {
|
|
16100
|
+
if (p === a) {
|
|
16101
16101
|
d = !0, a = f, c = u;
|
|
16102
16102
|
break;
|
|
16103
16103
|
}
|
|
16104
|
-
if (
|
|
16104
|
+
if (p === c) {
|
|
16105
16105
|
d = !0, c = f, a = u;
|
|
16106
16106
|
break;
|
|
16107
16107
|
}
|
|
16108
|
-
|
|
16108
|
+
p = p.sibling;
|
|
16109
16109
|
}
|
|
16110
16110
|
if (!d) throw Error(n(189));
|
|
16111
16111
|
}
|
|
@@ -16601,14 +16601,14 @@ const lr = /* @__PURE__ */ Fe(function(e) {
|
|
|
16601
16601
|
if (!r) return null;
|
|
16602
16602
|
const a = /* @__PURE__ */ new Set();
|
|
16603
16603
|
let c = [], u = null;
|
|
16604
|
-
yb(r, s, (
|
|
16605
|
-
const C =
|
|
16604
|
+
yb(r, s, (h, y, m, x) => {
|
|
16605
|
+
const C = h.type.spec.marks ?? [];
|
|
16606
16606
|
let w;
|
|
16607
16607
|
if (y) {
|
|
16608
|
-
w = eo(i.current(), m, "native-widget", o == null ? void 0 : o.posToKey,
|
|
16608
|
+
w = eo(i.current(), m, "native-widget", o == null ? void 0 : o.posToKey, h, x);
|
|
16609
16609
|
const v = {
|
|
16610
16610
|
type: "native-widget",
|
|
16611
|
-
widget:
|
|
16611
|
+
widget: h,
|
|
16612
16612
|
marks: C,
|
|
16613
16613
|
offset: m,
|
|
16614
16614
|
index: x,
|
|
@@ -16616,10 +16616,10 @@ const lr = /* @__PURE__ */ Fe(function(e) {
|
|
|
16616
16616
|
}, S = l.get(w);
|
|
16617
16617
|
S && Zs(S, v) ? S.offset = m : l.set(w, v), a.add(w);
|
|
16618
16618
|
} else {
|
|
16619
|
-
w = eo(i.current(), m, "widget", o == null ? void 0 : o.posToKey,
|
|
16619
|
+
w = eo(i.current(), m, "widget", o == null ? void 0 : o.posToKey, h, x);
|
|
16620
16620
|
const v = {
|
|
16621
16621
|
type: "widget",
|
|
16622
|
-
widget:
|
|
16622
|
+
widget: h,
|
|
16623
16623
|
marks: C,
|
|
16624
16624
|
offset: m,
|
|
16625
16625
|
index: x,
|
|
@@ -16629,11 +16629,11 @@ const lr = /* @__PURE__ */ Fe(function(e) {
|
|
|
16629
16629
|
}
|
|
16630
16630
|
const O = l.get(w);
|
|
16631
16631
|
c.push(O), qb(u, l.get(w));
|
|
16632
|
-
}, (
|
|
16632
|
+
}, (h, y, m, x) => {
|
|
16633
16633
|
const C = eo(i.current(), x, "node", o == null ? void 0 : o.posToKey), w = {
|
|
16634
16634
|
type: "node",
|
|
16635
|
-
node:
|
|
16636
|
-
marks:
|
|
16635
|
+
node: h,
|
|
16636
|
+
marks: h.marks,
|
|
16637
16637
|
innerDeco: m,
|
|
16638
16638
|
outerDeco: y,
|
|
16639
16639
|
offset: x,
|
|
@@ -16641,12 +16641,12 @@ const lr = /* @__PURE__ */ Fe(function(e) {
|
|
|
16641
16641
|
}, O = l.get(C);
|
|
16642
16642
|
O && Zs(O, w) ? (O.offset = x, u = O) : (l.set(C, w), u = w), a.add(C), Hb(c, u), c = [];
|
|
16643
16643
|
});
|
|
16644
|
-
for (const
|
|
16645
|
-
a.has(
|
|
16646
|
-
const f = Array.from(l.values()).sort((
|
|
16647
|
-
return (!
|
|
16644
|
+
for (const h of l.keys())
|
|
16645
|
+
a.has(h) || l.delete(h);
|
|
16646
|
+
const f = Array.from(l.values()).sort((h, y) => h.offset - y.offset), d = Jb(f, i), p = f[f.length - 1];
|
|
16647
|
+
return (!p || p.type !== "node" || p.node.isInline && !p.node.isText || // RegExp.test actually handles undefined just fine
|
|
16648
16648
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
16649
|
-
/\n$/.test(
|
|
16649
|
+
/\n$/.test(p.node.text)) && d.push(/* @__PURE__ */ P.createElement(Rb, {
|
|
16650
16650
|
getPos: i,
|
|
16651
16651
|
key: "trailing-hack-img"
|
|
16652
16652
|
}), /* @__PURE__ */ P.createElement(Bb, {
|
|
@@ -16661,25 +16661,25 @@ const lr = /* @__PURE__ */ Fe(function(e) {
|
|
|
16661
16661
|
let { className: r, node: s, innerDeco: o, outerDeco: i, as: l, viewDesc: a, ...c } = e;
|
|
16662
16662
|
const u = I(null);
|
|
16663
16663
|
is(t, () => u.current, []);
|
|
16664
|
-
const { childDescriptors: f, nodeViewDescRef: d } = xi(s, () => to.current(), u, u, o, i, a),
|
|
16664
|
+
const { childDescriptors: f, nodeViewDescRef: d } = xi(s, () => to.current(), u, u, o, i, a), p = Me(() => ({
|
|
16665
16665
|
parentRef: d,
|
|
16666
16666
|
siblingsRef: f
|
|
16667
16667
|
}), [
|
|
16668
16668
|
f,
|
|
16669
16669
|
d
|
|
16670
|
-
]),
|
|
16670
|
+
]), h = {
|
|
16671
16671
|
...c,
|
|
16672
16672
|
ref: u,
|
|
16673
16673
|
className: r,
|
|
16674
16674
|
suppressContentEditableWarning: !0
|
|
16675
|
-
}, y = l ? /* @__PURE__ */ ls(l,
|
|
16676
|
-
value:
|
|
16675
|
+
}, y = l ? /* @__PURE__ */ ls(l, h, /* @__PURE__ */ P.createElement(Oe.Provider, {
|
|
16676
|
+
value: p
|
|
16677
16677
|
}, /* @__PURE__ */ P.createElement(lr, {
|
|
16678
16678
|
getPos: to,
|
|
16679
16679
|
node: s,
|
|
16680
16680
|
innerDecorations: o
|
|
16681
|
-
}))) : /* @__PURE__ */ Kn("div",
|
|
16682
|
-
value:
|
|
16681
|
+
}))) : /* @__PURE__ */ Kn("div", h, /* @__PURE__ */ P.createElement(Oe.Provider, {
|
|
16682
|
+
value: p
|
|
16683
16683
|
}, /* @__PURE__ */ P.createElement(lr, {
|
|
16684
16684
|
getPos: to,
|
|
16685
16685
|
node: s,
|
|
@@ -16713,7 +16713,7 @@ function Yb(n, e) {
|
|
|
16713
16713
|
}
|
|
16714
16714
|
const df = /* @__PURE__ */ Ge(Yb), Gb = [];
|
|
16715
16715
|
function Xb(n) {
|
|
16716
|
-
var
|
|
16716
|
+
var h;
|
|
16717
16717
|
let { className: e, children: t, nodeViews: r, customNodeViews: s, ...o } = n;
|
|
16718
16718
|
const [i, l] = N(null), { editor: a, state: c } = pb(i, {
|
|
16719
16719
|
...o,
|
|
@@ -16722,7 +16722,7 @@ function Xb(n) {
|
|
|
16722
16722
|
nodeViews: r ?? {}
|
|
16723
16723
|
}), [
|
|
16724
16724
|
r
|
|
16725
|
-
]),
|
|
16725
|
+
]), p = Me(() => {
|
|
16726
16726
|
var y;
|
|
16727
16727
|
return {
|
|
16728
16728
|
className: e,
|
|
@@ -16735,7 +16735,7 @@ function Xb(n) {
|
|
|
16735
16735
|
}, [
|
|
16736
16736
|
e,
|
|
16737
16737
|
a.docViewDescRef,
|
|
16738
|
-
(
|
|
16738
|
+
(h = a.view) == null ? void 0 : h.state.doc,
|
|
16739
16739
|
u,
|
|
16740
16740
|
f
|
|
16741
16741
|
]);
|
|
@@ -16746,7 +16746,7 @@ function Xb(n) {
|
|
|
16746
16746
|
}, /* @__PURE__ */ P.createElement(Ju.Provider, {
|
|
16747
16747
|
value: d
|
|
16748
16748
|
}, /* @__PURE__ */ P.createElement(ff.Provider, {
|
|
16749
|
-
value:
|
|
16749
|
+
value: p
|
|
16750
16750
|
}, t))));
|
|
16751
16751
|
}
|
|
16752
16752
|
function hf(n) {
|
|
@@ -17349,8 +17349,8 @@ const Cf = () => /* @__PURE__ */ g.jsxs("div", { className: "MenuBlock", childre
|
|
|
17349
17349
|
s(""), a(""), i(void 0);
|
|
17350
17350
|
}, [e]), et((d) => {
|
|
17351
17351
|
if (!d || !e) return;
|
|
17352
|
-
const
|
|
17353
|
-
u(
|
|
17352
|
+
const p = ct.getState(d.state);
|
|
17353
|
+
u(p.upload !== void 0);
|
|
17354
17354
|
}, [e]);
|
|
17355
17355
|
const f = se((d) => {
|
|
17356
17356
|
d && (c ? Hm(d, o, l, n) : Km(d, r, l, n), d.focus(), t());
|
|
@@ -17552,12 +17552,12 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
17552
17552
|
}), d(O ? `${O} / ${w.childCount}` : "");
|
|
17553
17553
|
}
|
|
17554
17554
|
});
|
|
17555
|
-
const
|
|
17555
|
+
const p = se((x, C) => {
|
|
17556
17556
|
if (!x) return;
|
|
17557
17557
|
i(C);
|
|
17558
17558
|
const w = x.state.tr, O = t.getPos();
|
|
17559
17559
|
x.dispatch(w.setNodeMarkup(O, null, { ...t.node.attrs, alt: C })), x.focus();
|
|
17560
|
-
}),
|
|
17560
|
+
}), h = se((x, C) => {
|
|
17561
17561
|
if (!x) return;
|
|
17562
17562
|
a(C);
|
|
17563
17563
|
const w = x.state.tr, O = t.getPos();
|
|
@@ -17589,7 +17589,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
17589
17589
|
{
|
|
17590
17590
|
value: o,
|
|
17591
17591
|
placeholder: "Alt: описание изображения (не обязательно)",
|
|
17592
|
-
onChange:
|
|
17592
|
+
onChange: p,
|
|
17593
17593
|
empty: !0,
|
|
17594
17594
|
style: {
|
|
17595
17595
|
textAlign: "center",
|
|
@@ -17610,7 +17610,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
17610
17610
|
{
|
|
17611
17611
|
value: l,
|
|
17612
17612
|
placeholder: "Title: подпись под изображением (не обязательно)",
|
|
17613
|
-
onChange:
|
|
17613
|
+
onChange: h,
|
|
17614
17614
|
empty: !0,
|
|
17615
17615
|
style: {
|
|
17616
17616
|
textAlign: "center",
|
|
@@ -17631,7 +17631,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
17631
17631
|
const u = se((f, d) => {
|
|
17632
17632
|
if (!f) return;
|
|
17633
17633
|
a(d);
|
|
17634
|
-
const { $from:
|
|
17634
|
+
const { $from: p, $to: h } = f.state.selection, y = p.blockRange(h);
|
|
17635
17635
|
if (y) {
|
|
17636
17636
|
const m = f.state.doc;
|
|
17637
17637
|
let x = f.state.tr;
|
|
@@ -17701,15 +17701,15 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
17701
17701
|
}, d1 = ({ title: n = !1, content: e, onSave: t, onCancel: r, onChange: s, onUpload: o }) => {
|
|
17702
17702
|
const [i, l] = N(""), [a, c] = N();
|
|
17703
17703
|
q(() => {
|
|
17704
|
-
const
|
|
17704
|
+
const p = lt.create({
|
|
17705
17705
|
doc: y0(e),
|
|
17706
17706
|
schema: Vr,
|
|
17707
17707
|
plugins: mf({ schema: Vr, upload: o })
|
|
17708
17708
|
});
|
|
17709
|
-
c(
|
|
17709
|
+
c(p), n !== !1 && l(typeof n == "string" ? n : "");
|
|
17710
17710
|
}, [n, e]);
|
|
17711
|
-
const u = () => n !== !1 ? i.trim().length > 0 : !0, f = (
|
|
17712
|
-
!t || !u() || t({ ...
|
|
17711
|
+
const u = () => n !== !1 ? i.trim().length > 0 : !0, f = (p) => {
|
|
17712
|
+
!t || !u() || t({ ...p, name: i });
|
|
17713
17713
|
}, d = () => {
|
|
17714
17714
|
r && r();
|
|
17715
17715
|
};
|
|
@@ -17718,7 +17718,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
17718
17718
|
"input",
|
|
17719
17719
|
{
|
|
17720
17720
|
className: "ProseNotesTitle",
|
|
17721
|
-
onChange: (
|
|
17721
|
+
onChange: (p) => l(p.currentTarget.value),
|
|
17722
17722
|
value: i,
|
|
17723
17723
|
placeholder: "Укажите заголовок"
|
|
17724
17724
|
}
|
|
@@ -17727,8 +17727,8 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
17727
17727
|
hf,
|
|
17728
17728
|
{
|
|
17729
17729
|
state: a,
|
|
17730
|
-
dispatchTransaction: (
|
|
17731
|
-
const y =
|
|
17730
|
+
dispatchTransaction: (p) => c((h) => {
|
|
17731
|
+
const y = h == null ? void 0 : h.apply(p);
|
|
17732
17732
|
return y && s && s(!!Ko(y)), y;
|
|
17733
17733
|
}),
|
|
17734
17734
|
nodeViews: {
|
|
@@ -17754,12 +17754,12 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
17754
17754
|
const u = n.nodes.heading;
|
|
17755
17755
|
if (!c || !u || !i) return;
|
|
17756
17756
|
const f = [], d = [];
|
|
17757
|
-
for (let
|
|
17758
|
-
const y = kn(u, { level:
|
|
17759
|
-
d[
|
|
17760
|
-
id:
|
|
17761
|
-
icon: /* @__PURE__ */ g.jsx(w0, { level:
|
|
17762
|
-
text: `уровень ${
|
|
17757
|
+
for (let p = 2; p < 7; p++) {
|
|
17758
|
+
const y = kn(u, { level: p });
|
|
17759
|
+
d[p] = y, f[p] = {
|
|
17760
|
+
id: p,
|
|
17761
|
+
icon: /* @__PURE__ */ g.jsx(w0, { level: p }),
|
|
17762
|
+
text: `уровень ${p}`,
|
|
17763
17763
|
disabled: !y(c.state)
|
|
17764
17764
|
};
|
|
17765
17765
|
}
|
|
@@ -17828,8 +17828,8 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
17828
17828
|
if (u) {
|
|
17829
17829
|
const f = o.state.doc;
|
|
17830
17830
|
let d = o.state.tr;
|
|
17831
|
-
f.nodesBetween(u.start, u.end, (
|
|
17832
|
-
|
|
17831
|
+
f.nodesBetween(u.start, u.end, (p, h) => {
|
|
17832
|
+
p.type.name === "paragraph" && (d = d.setNodeMarkup(h, null, { align: l }));
|
|
17833
17833
|
}), o.dispatch(d);
|
|
17834
17834
|
}
|
|
17835
17835
|
o.focus(), r(!1);
|
|
@@ -17868,15 +17868,15 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
17868
17868
|
/* @__PURE__ */ g.jsx(Df, { schema: n }),
|
|
17869
17869
|
/* @__PURE__ */ g.jsx(Cf, {}),
|
|
17870
17870
|
/* @__PURE__ */ g.jsx("div", { className: "MenuBlock", children: /* @__PURE__ */ g.jsx(Tf, { onSave: e }) })
|
|
17871
|
-
] }), O0 =
|
|
17872
|
-
const [r, s] = N(!1), [o, i] = N(0), [l, a] = N(0), [c, u] = N(n), f = (
|
|
17871
|
+
] }), O0 = 5, Af = 1, Fn = 50, E0 = ({ width: n, onChange: e, onWidth: t }) => {
|
|
17872
|
+
const [r, s] = N(!1), [o, i] = N(0), [l, a] = N(0), [c, u] = N(n), f = (h) => {
|
|
17873
17873
|
const y = n[l], m = n[l + 1], x = [...c];
|
|
17874
|
-
return y +
|
|
17874
|
+
return y + h < Fn && (h = Fn - y), m - h < Fn && (h = m - Fn), x[l] = y + h, x[l + 1] = m - h, x;
|
|
17875
17875
|
};
|
|
17876
17876
|
q(() => {
|
|
17877
17877
|
u(n);
|
|
17878
17878
|
}, [n]), q(() => {
|
|
17879
|
-
const
|
|
17879
|
+
const h = (m) => {
|
|
17880
17880
|
if (!r) return;
|
|
17881
17881
|
s(!1), m.preventDefault(), m.stopPropagation();
|
|
17882
17882
|
const x = m.clientX - o, C = f(x);
|
|
@@ -17887,17 +17887,17 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
17887
17887
|
const x = m.clientX - o, C = f(x);
|
|
17888
17888
|
u(C), e(C);
|
|
17889
17889
|
};
|
|
17890
|
-
return document.addEventListener("mouseup",
|
|
17891
|
-
document.removeEventListener("mouseup",
|
|
17890
|
+
return document.addEventListener("mouseup", h), document.addEventListener("mousemove", y), () => {
|
|
17891
|
+
document.removeEventListener("mouseup", h), document.removeEventListener("mousemove", y);
|
|
17892
17892
|
};
|
|
17893
17893
|
}, [r, l]);
|
|
17894
|
-
const d = (
|
|
17895
|
-
y !== n.length - 1 && (
|
|
17896
|
-
},
|
|
17897
|
-
return /* @__PURE__ */ g.jsx("div", { className: "table-resizer", children: c.map((
|
|
17894
|
+
const d = (h, y) => {
|
|
17895
|
+
y !== n.length - 1 && (h.preventDefault(), h.stopPropagation(), s(!0), i(h.clientX), a(y));
|
|
17896
|
+
}, p = (h) => c.slice(0, h + 1).reduce((y, m) => y + m, 0) + h + Af - Math.floor(O0 / 2);
|
|
17897
|
+
return /* @__PURE__ */ g.jsx("div", { className: "table-resizer", children: c.map((h, y) => /* @__PURE__ */ g.jsx(
|
|
17898
17898
|
"div",
|
|
17899
17899
|
{
|
|
17900
|
-
style: { left:
|
|
17900
|
+
style: { left: p(y) + "px" },
|
|
17901
17901
|
onMouseDown: (m) => d(m, y)
|
|
17902
17902
|
},
|
|
17903
17903
|
y
|
|
@@ -17905,29 +17905,29 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
17905
17905
|
}, T0 = Ge(
|
|
17906
17906
|
function({ children: e, nodeProps: t, ...r }, s) {
|
|
17907
17907
|
var f;
|
|
17908
|
-
const o = I(null), i = I(null), [l, a] = N([]), c = se((d,
|
|
17908
|
+
const o = I(null), i = I(null), [l, a] = N([]), c = se((d, p) => {
|
|
17909
17909
|
if (!d) return;
|
|
17910
|
-
const
|
|
17910
|
+
const h = t.node, y = t.getPos() + 1, m = Z.get(h), x = d.state.tr;
|
|
17911
17911
|
for (let C = 0; C < m.height; C++)
|
|
17912
17912
|
for (let w = 0; w < m.width; ) {
|
|
17913
|
-
const O = C * m.width + w, v = m.map[O], S =
|
|
17913
|
+
const O = C * m.width + w, v = m.map[O], S = h.nodeAt(v).attrs, $ = p.slice(w, w + S.colspan);
|
|
17914
17914
|
C && m.map[O] == m.map[O - m.width] || x.setNodeMarkup(y + v, null, { ...S, colwidth: $ }), w += S.colspan;
|
|
17915
17915
|
}
|
|
17916
17916
|
x.docChanged && d.dispatch(x);
|
|
17917
17917
|
});
|
|
17918
17918
|
q(() => {
|
|
17919
17919
|
if (!o.current || !i.current) return;
|
|
17920
|
-
const
|
|
17921
|
-
if (!
|
|
17922
|
-
let
|
|
17923
|
-
for (let S = 0; S <
|
|
17924
|
-
const $ =
|
|
17925
|
-
|
|
17926
|
-
}
|
|
17927
|
-
const y =
|
|
17928
|
-
|
|
17929
|
-
const w =
|
|
17930
|
-
|
|
17920
|
+
const p = t.node.firstChild;
|
|
17921
|
+
if (!p) return;
|
|
17922
|
+
let h = [];
|
|
17923
|
+
for (let S = 0; S < p.childCount; S++) {
|
|
17924
|
+
const $ = p.child(S), { colspan: j, colwidth: E } = $.attrs;
|
|
17925
|
+
h = h.concat(Array.isArray(E) ? E : Array(j).fill(0));
|
|
17926
|
+
}
|
|
17927
|
+
const y = h.filter((S) => !S).length, m = h.reduce((S, $) => S + $, 0), x = (h.length + 1) * Af, C = Math.max(y ? (o.current.offsetWidth - m - x) / y : 0, Fn);
|
|
17928
|
+
h = h.map((S) => S || C);
|
|
17929
|
+
const w = h.reduce((S, $) => S + $, 0), O = i.current.offsetWidth - x - 16, v = O / w;
|
|
17930
|
+
h = h.map((S) => Math.round(S * v)), h[h.length - 1] += O - h.reduce((S, $) => S + $, 0), a(h);
|
|
17931
17931
|
}, [t, o, i, (f = i.current) == null ? void 0 : f.offsetWidth]);
|
|
17932
17932
|
const u = se((d) => {
|
|
17933
17933
|
my(d.state, d.dispatch);
|
|
@@ -17943,7 +17943,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
17943
17943
|
children: [
|
|
17944
17944
|
/* @__PURE__ */ g.jsx(E0, { width: l, onChange: a, onWidth: c }),
|
|
17945
17945
|
/* @__PURE__ */ g.jsxs("table", { ref: o, children: [
|
|
17946
|
-
/* @__PURE__ */ g.jsx("colgroup", { children: l.map((d,
|
|
17946
|
+
/* @__PURE__ */ g.jsx("colgroup", { children: l.map((d, p) => /* @__PURE__ */ g.jsx("col", { width: d }, p)) }),
|
|
17947
17947
|
/* @__PURE__ */ g.jsx("caption", { onClick: u, children: /* @__PURE__ */ g.jsx(T.Trash, {}) }),
|
|
17948
17948
|
/* @__PURE__ */ g.jsx("tbody", { children: e })
|
|
17949
17949
|
] })
|
|
@@ -18128,15 +18128,25 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
18128
18128
|
function({ children: e, nodeProps: t, ...r }, s) {
|
|
18129
18129
|
const o = I(null), [i, l] = N(!1), [a, c] = N(!1), [u, f] = N(!1);
|
|
18130
18130
|
q(() => {
|
|
18131
|
-
const h = (
|
|
18132
|
-
o.current !==
|
|
18131
|
+
const h = (y) => {
|
|
18132
|
+
o.current !== y.target && (l(!1), c(!1), f(!1));
|
|
18133
18133
|
};
|
|
18134
18134
|
return document.addEventListener("contextmenu", h, !0), () => document.removeEventListener("contextmenu", h, !0);
|
|
18135
18135
|
}, []);
|
|
18136
18136
|
const d = (h) => {
|
|
18137
18137
|
h.preventDefault(), h.stopPropagation(), l(!1), c(!1), f(!1);
|
|
18138
|
-
const
|
|
18139
|
-
h.clientY <
|
|
18138
|
+
const y = h.currentTarget.getBoundingClientRect();
|
|
18139
|
+
h.clientY < y.y ? f(!0) : h.clientX < y.x ? l(!0) : c(!0);
|
|
18140
|
+
}, p = (h) => {
|
|
18141
|
+
l(!1), c(!1), f(!1);
|
|
18142
|
+
const y = h.currentTarget.getBoundingClientRect();
|
|
18143
|
+
if (h.clientY < y.y)
|
|
18144
|
+
f(!0);
|
|
18145
|
+
else if (h.clientX < y.x)
|
|
18146
|
+
l(!0);
|
|
18147
|
+
else
|
|
18148
|
+
return;
|
|
18149
|
+
h.preventDefault(), h.stopPropagation();
|
|
18140
18150
|
};
|
|
18141
18151
|
return t.node.type.spec.tableRole === "header_cell" ? /* @__PURE__ */ g.jsxs(
|
|
18142
18152
|
"th",
|
|
@@ -18149,6 +18159,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
18149
18159
|
textAlign: t.node.attrs.halign,
|
|
18150
18160
|
verticalAlign: t.node.attrs.valign
|
|
18151
18161
|
},
|
|
18162
|
+
onClick: p,
|
|
18152
18163
|
onContextMenu: d,
|
|
18153
18164
|
ref: (h) => {
|
|
18154
18165
|
o.current = h, s && (typeof s == "function" ? s(h) : s.current = h);
|
|
@@ -18180,6 +18191,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
18180
18191
|
textAlign: t.node.attrs.halign,
|
|
18181
18192
|
verticalAlign: t.node.attrs.valign
|
|
18182
18193
|
},
|
|
18194
|
+
onClick: p,
|
|
18183
18195
|
onContextMenu: d,
|
|
18184
18196
|
ref: (h) => {
|
|
18185
18197
|
o.current = h, s && (typeof s == "function" ? s(h) : s.current = h);
|
|
@@ -18205,14 +18217,14 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
18205
18217
|
), P0 = Ge(
|
|
18206
18218
|
function({ children: e, nodeProps: t, ...r }, s) {
|
|
18207
18219
|
var v;
|
|
18208
|
-
const o = I(null), [i, l] = N(!1), [a, c] = N(!1), [u, f] = N(!1), [d,
|
|
18220
|
+
const o = I(null), [i, l] = N(!1), [a, c] = N(!1), [u, f] = N(!1), [d, p] = N(), [h, y] = N(), m = (S) => {
|
|
18209
18221
|
const $ = S.scrollLeft, j = S.clientWidth, E = S.scrollWidth;
|
|
18210
18222
|
c($ > 0), f($ < E - j * 1.5);
|
|
18211
18223
|
};
|
|
18212
18224
|
q(() => {
|
|
18213
|
-
o.current && (
|
|
18225
|
+
o.current && (h && o.current.scrollWidth > h && (o.current.scrollLeft = o.current.scrollWidth - o.current.clientWidth), y(o.current.scrollWidth));
|
|
18214
18226
|
}, [(v = o.current) == null ? void 0 : v.scrollWidth]), q(() => {
|
|
18215
|
-
|
|
18227
|
+
p(t.getPos() + t.node.nodeSize - 1), o.current && t.node.childCount > 1 && m(o.current);
|
|
18216
18228
|
}, [t, o]), et((S) => {
|
|
18217
18229
|
if (!S || t.node.childCount > 0) return;
|
|
18218
18230
|
const $ = S.state.tr, j = t.getPos(), E = t.node.nodeSize;
|
|
@@ -18322,8 +18334,8 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
18322
18334
|
};
|
|
18323
18335
|
return document.addEventListener("fullscreenchange", f), () => document.removeEventListener("fullscreenchange", f);
|
|
18324
18336
|
}, []), q(() => {
|
|
18325
|
-
var
|
|
18326
|
-
let f = (
|
|
18337
|
+
var p, h, y, m, x, C, w;
|
|
18338
|
+
let f = (p = n.attrs) == null ? void 0 : p.fid, d = (h = n.attrs) != null && h.src ? `${(y = n.attrs) == null ? void 0 : y.src}` : "";
|
|
18327
18339
|
f && (d = `${xs}/files/${f}`), d || (d = ks), r(d), o((m = n.attrs) != null && m.alt ? `${(x = n.attrs) == null ? void 0 : x.alt}` : ""), l((C = n.attrs) != null && C.title ? `${(w = n.attrs) == null ? void 0 : w.title}` : "");
|
|
18328
18340
|
}, [n]);
|
|
18329
18341
|
const u = (f) => {
|
|
@@ -18415,7 +18427,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
18415
18427
|
t((i = n.attrs) != null && i.src ? `${(l = n.attrs) == null ? void 0 : l.src}` : ""), s((a = n.attrs) != null && a.title ? `${(c = n.attrs) == null ? void 0 : c.title}` : "");
|
|
18416
18428
|
}, [n]), Ss(e) ? /* @__PURE__ */ g.jsx("div", { title: r, className: "video", children: /* @__PURE__ */ g.jsx("iframe", { src: e, allow: o }) }) : /* @__PURE__ */ g.jsx("div", { title: r, className: "image", children: /* @__PURE__ */ g.jsx("img", { src: ks }) });
|
|
18417
18429
|
}, Y0 = () => /* @__PURE__ */ g.jsx("br", {}), G0 = ({ node: n }) => {
|
|
18418
|
-
const e = I(null), t = I(null), [r, s] = N(!1), [o, i] = N(!1), [l, a] = N(!1), [c, u] = N(1), [f, d] = N(1),
|
|
18430
|
+
const e = I(null), t = I(null), [r, s] = N(!1), [o, i] = N(!1), [l, a] = N(!1), [c, u] = N(1), [f, d] = N(1), p = (m) => {
|
|
18419
18431
|
const x = m.scrollLeft, C = m.clientWidth, w = m.scrollWidth;
|
|
18420
18432
|
i(x > C / 2), a(x < w - C * 1.5), u(Math.round(x / C + 1));
|
|
18421
18433
|
};
|
|
@@ -18434,7 +18446,7 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
18434
18446
|
};
|
|
18435
18447
|
return document.body.addEventListener("keydown", m), () => document.body.removeEventListener("keydown", m);
|
|
18436
18448
|
}, [r]);
|
|
18437
|
-
const
|
|
18449
|
+
const h = (m) => {
|
|
18438
18450
|
var x;
|
|
18439
18451
|
m.stopPropagation(), r ? document.exitFullscreen() : (x = t.current) == null || x.requestFullscreen();
|
|
18440
18452
|
}, y = (m, x) => {
|
|
@@ -18444,21 +18456,21 @@ const Df = ({ schema: n }) => n.nodes.carousel ? /* @__PURE__ */ g.jsx(cr, { ite
|
|
|
18444
18456
|
e.current.scrollLeft = w;
|
|
18445
18457
|
};
|
|
18446
18458
|
return Array.isArray(n.content) ? /* @__PURE__ */ g.jsxs("div", { className: "carousel", ref: t, children: [
|
|
18447
|
-
/* @__PURE__ */ g.jsx("div", { className: "carousel-list", ref: e, onScroll: (m) =>
|
|
18459
|
+
/* @__PURE__ */ g.jsx("div", { className: "carousel-list", ref: e, onScroll: (m) => p(m.currentTarget), children: n.content.map((m, x) => /* @__PURE__ */ g.jsx(X0, { node: m, onClick: h }, x)) }),
|
|
18448
18460
|
/* @__PURE__ */ g.jsxs("div", { className: "carousel-numb", children: [
|
|
18449
18461
|
c,
|
|
18450
18462
|
" / ",
|
|
18451
18463
|
f
|
|
18452
18464
|
] }),
|
|
18453
|
-
/* @__PURE__ */ g.jsx("div", { className: "carousel-full", onClick:
|
|
18465
|
+
/* @__PURE__ */ g.jsx("div", { className: "carousel-full", onClick: h, children: r ? /* @__PURE__ */ g.jsx(T.Minimize, {}) : /* @__PURE__ */ g.jsx(T.Maximize, {}) }),
|
|
18454
18466
|
o && /* @__PURE__ */ g.jsx("div", { className: "carousel-prev", onClick: (m) => y(m, -1), children: /* @__PURE__ */ g.jsx(T.ChevronLeft, {}) }),
|
|
18455
18467
|
l && /* @__PURE__ */ g.jsx("div", { className: "carousel-next", onClick: (m) => y(m, 1), children: /* @__PURE__ */ g.jsx(T.ChevronRight, {}) })
|
|
18456
18468
|
] }) : null;
|
|
18457
18469
|
}, X0 = ({ node: n, onClick: e }) => {
|
|
18458
18470
|
const [t, r] = N(""), [s, o] = N(""), [i, l] = N("");
|
|
18459
18471
|
return q(() => {
|
|
18460
|
-
var d,
|
|
18461
|
-
let a = (d = n.attrs) == null ? void 0 : d.fid, c = (
|
|
18472
|
+
var d, p, h, y;
|
|
18473
|
+
let a = (d = n.attrs) == null ? void 0 : d.fid, c = (p = n.attrs) != null && p.src ? `${n.attrs.src}` : "", u = (h = n.attrs) != null && h.alt ? `${n.attrs.alt}` : "", f = (y = n.attrs) != null && y.title ? `${n.attrs.title}` : "";
|
|
18462
18474
|
a && (c = `${xs}/files/${a}`), c || (c = ks), r(c), o(u), l(f);
|
|
18463
18475
|
}, [n]), n.type !== "image" ? null : /* @__PURE__ */ g.jsxs("div", { className: "image", children: [
|
|
18464
18476
|
t && /* @__PURE__ */ g.jsx("img", { src: t, onClick: e, alt: s, title: i }),
|