@jinntec/jinntap 1.13.5 → 1.13.6
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/jinn-tap.css +22 -0
- package/dist/jinn-tap.es.js +449 -451
- package/package.json +1 -1
package/dist/jinn-tap.es.js
CHANGED
|
@@ -653,7 +653,7 @@ function Ec(n, e, t, i) {
|
|
|
653
653
|
return Pt(o, a.cut(0, n.parentOffset).append(t.content).append(a.cut(e.parentOffset)));
|
|
654
654
|
} else {
|
|
655
655
|
let { start: o, end: a } = Bh(t, n);
|
|
656
|
-
return Pt(s,
|
|
656
|
+
return Pt(s, Ac(n, o, a, e, i));
|
|
657
657
|
}
|
|
658
658
|
else return Pt(s, ir(n, e, i));
|
|
659
659
|
}
|
|
@@ -679,9 +679,9 @@ function Ln(n, e, t, i) {
|
|
|
679
679
|
function Pt(n, e) {
|
|
680
680
|
return n.type.checkContent(e), n.copy(e);
|
|
681
681
|
}
|
|
682
|
-
function
|
|
682
|
+
function Ac(n, e, t, i, r) {
|
|
683
683
|
let s = n.depth > r && Is(n, e, r + 1), o = i.depth > r && Is(t, i, r + 1), a = [];
|
|
684
|
-
return Ln(null, n, r, a), s && o && e.index(r) == t.index(r) ? (Mc(s, o), zt(Pt(s,
|
|
684
|
+
return Ln(null, n, r, a), s && o && e.index(r) == t.index(r) ? (Mc(s, o), zt(Pt(s, Ac(n, e, t, i, r + 1)), a)) : (s && zt(Pt(s, ir(n, e, r + 1)), a), Ln(e, t, r, a), o && zt(Pt(o, ir(t, i, r + 1)), a)), Ln(i, null, r, a), new y(a);
|
|
685
685
|
}
|
|
686
686
|
function ir(n, e, t) {
|
|
687
687
|
let i = [];
|
|
@@ -1270,7 +1270,7 @@ let mt = class zs {
|
|
|
1270
1270
|
if (this.type.spec.toDebugString)
|
|
1271
1271
|
return this.type.spec.toDebugString(this);
|
|
1272
1272
|
let e = this.type.name;
|
|
1273
|
-
return this.content.size && (e += "(" + this.content.toStringInner() + ")"),
|
|
1273
|
+
return this.content.size && (e += "(" + this.content.toStringInner() + ")"), Tc(this.marks, e);
|
|
1274
1274
|
}
|
|
1275
1275
|
/**
|
|
1276
1276
|
Get the content match in this node at the given index.
|
|
@@ -1374,7 +1374,7 @@ class sr extends mt {
|
|
|
1374
1374
|
this.text = i;
|
|
1375
1375
|
}
|
|
1376
1376
|
toString() {
|
|
1377
|
-
return this.type.spec.toDebugString ? this.type.spec.toDebugString(this) :
|
|
1377
|
+
return this.type.spec.toDebugString ? this.type.spec.toDebugString(this) : Tc(this.marks, JSON.stringify(this.text));
|
|
1378
1378
|
}
|
|
1379
1379
|
get textContent() {
|
|
1380
1380
|
return this.text;
|
|
@@ -1402,7 +1402,7 @@ class sr extends mt {
|
|
|
1402
1402
|
return e.text = this.text, e;
|
|
1403
1403
|
}
|
|
1404
1404
|
}
|
|
1405
|
-
function
|
|
1405
|
+
function Tc(n, e) {
|
|
1406
1406
|
for (let t = n.length - 1; t >= 0; t--)
|
|
1407
1407
|
e = n[t].type.name + "(" + e + ")";
|
|
1408
1408
|
return e;
|
|
@@ -1986,7 +1986,7 @@ class Qh {
|
|
|
1986
1986
|
return !this.hasDefault;
|
|
1987
1987
|
}
|
|
1988
1988
|
}
|
|
1989
|
-
class
|
|
1989
|
+
class Tr {
|
|
1990
1990
|
/**
|
|
1991
1991
|
@internal
|
|
1992
1992
|
*/
|
|
@@ -2008,7 +2008,7 @@ class Ar {
|
|
|
2008
2008
|
*/
|
|
2009
2009
|
static compile(e, t) {
|
|
2010
2010
|
let i = /* @__PURE__ */ Object.create(null), r = 0;
|
|
2011
|
-
return e.forEach((s, o) => i[s] = new
|
|
2011
|
+
return e.forEach((s, o) => i[s] = new Tr(s, r++, t, o)), i;
|
|
2012
2012
|
}
|
|
2013
2013
|
/**
|
|
2014
2014
|
When there is a mark of this type in the given set, a new set
|
|
@@ -2050,7 +2050,7 @@ class _c {
|
|
|
2050
2050
|
let t = this.spec = {};
|
|
2051
2051
|
for (let r in e)
|
|
2052
2052
|
t[r] = e[r];
|
|
2053
|
-
t.nodes = Z.from(e.nodes), t.marks = Z.from(e.marks || {}), this.nodes = Ea.compile(this.spec.nodes, this), this.marks =
|
|
2053
|
+
t.nodes = Z.from(e.nodes), t.marks = Z.from(e.marks || {}), this.nodes = Ea.compile(this.spec.nodes, this), this.marks = Tr.compile(this.spec.marks, this);
|
|
2054
2054
|
let i = /* @__PURE__ */ Object.create(null);
|
|
2055
2055
|
for (let r in this.nodes) {
|
|
2056
2056
|
if (r in this.marks)
|
|
@@ -2172,7 +2172,7 @@ let Bn = class Ps {
|
|
|
2172
2172
|
Parse a document from the content of a DOM node.
|
|
2173
2173
|
*/
|
|
2174
2174
|
parse(e, t = {}) {
|
|
2175
|
-
let i = new
|
|
2175
|
+
let i = new Ta(this, t, !1);
|
|
2176
2176
|
return i.addAll(e, P.none, t.from, t.to), i.finish();
|
|
2177
2177
|
}
|
|
2178
2178
|
/**
|
|
@@ -2184,7 +2184,7 @@ let Bn = class Ps {
|
|
|
2184
2184
|
the left of the input and the end of nodes at the end.
|
|
2185
2185
|
*/
|
|
2186
2186
|
parseSlice(e, t = {}) {
|
|
2187
|
-
let i = new
|
|
2187
|
+
let i = new Ta(this, t, !0);
|
|
2188
2188
|
return i.addAll(e, P.none, t.from, t.to), w.maxOpen(i.finish());
|
|
2189
2189
|
}
|
|
2190
2190
|
/**
|
|
@@ -2302,7 +2302,7 @@ const Lc = {
|
|
|
2302
2302
|
style: !0,
|
|
2303
2303
|
title: !0
|
|
2304
2304
|
}, Bc = { ol: !0, ul: !0 }, Yn = 1, Rs = 2, Fi = 4;
|
|
2305
|
-
function
|
|
2305
|
+
function Aa(n, e, t) {
|
|
2306
2306
|
return e != null ? (e ? Yn : 0) | (e === "full" ? Rs : 0) : n && n.whitespace == "pre" ? Yn | Rs : t & -5;
|
|
2307
2307
|
}
|
|
2308
2308
|
class Ii {
|
|
@@ -2338,10 +2338,10 @@ class Ii {
|
|
|
2338
2338
|
return this.type ? this.type.inlineContent : this.content.length ? this.content[0].isInline : e.parentNode && !Lc.hasOwnProperty(e.parentNode.nodeName.toLowerCase());
|
|
2339
2339
|
}
|
|
2340
2340
|
}
|
|
2341
|
-
class
|
|
2341
|
+
class Ta {
|
|
2342
2342
|
constructor(e, t, i) {
|
|
2343
2343
|
this.parser = e, this.options = t, this.isOpen = i, this.open = 0, this.localPreserveWS = !1;
|
|
2344
|
-
let r = t.topNode, s, o =
|
|
2344
|
+
let r = t.topNode, s, o = Aa(null, t.preserveWhitespace, 0) | (i ? Fi : 0);
|
|
2345
2345
|
r ? s = new Ii(r.type, r.attrs, P.none, !0, t.topMatch || r.type.contentMatch, o) : i ? s = new Ii(null, null, P.none, !0, null, o) : s = new Ii(e.schema.topNodeType, null, P.none, !0, null, o), this.nodes = [s], this.find = t.findPositions, this.needsBlock = !1;
|
|
2346
2346
|
}
|
|
2347
2347
|
get top() {
|
|
@@ -2515,7 +2515,7 @@ class Aa {
|
|
|
2515
2515
|
this.closeExtra();
|
|
2516
2516
|
let o = this.top;
|
|
2517
2517
|
o.match = o.match && o.match.matchType(e);
|
|
2518
|
-
let a =
|
|
2518
|
+
let a = Aa(e, s, o.options);
|
|
2519
2519
|
o.options & Fi && o.content.length == 0 && (a |= Fi);
|
|
2520
2520
|
let l = P.none;
|
|
2521
2521
|
return i = i.filter((c) => (o.type ? o.type.allowsMarkType(c.type) : Da(c.type, e)) ? (l = c.addToSet(l), !1) : !0), this.nodes.push(new Ii(e, t, l, r, null, a)), this.open++, i;
|
|
@@ -3458,7 +3458,7 @@ function cp(n, e, t, i) {
|
|
|
3458
3458
|
return;
|
|
3459
3459
|
s++;
|
|
3460
3460
|
let l = null;
|
|
3461
|
-
if (i instanceof
|
|
3461
|
+
if (i instanceof Tr) {
|
|
3462
3462
|
let c = o.marks, u;
|
|
3463
3463
|
for (; u = i.isInSet(c); )
|
|
3464
3464
|
(l || (l = [])).push(u), c = u.removeFromSet(c);
|
|
@@ -3955,8 +3955,8 @@ function Mp(n, e, t, i) {
|
|
|
3955
3955
|
for (let m = 0; m < o.length; m++) {
|
|
3956
3956
|
let g = o[(m + l) % o.length], b = !0;
|
|
3957
3957
|
g < 0 && (b = !1, g = -g);
|
|
3958
|
-
let k = r.node(g - 1),
|
|
3959
|
-
if (k.canReplaceWith(
|
|
3958
|
+
let k = r.node(g - 1), x = r.index(g - 1);
|
|
3959
|
+
if (k.canReplaceWith(x, x, f.type, f.marks))
|
|
3960
3960
|
return n.replace(r.before(g), b ? s.after(g) : t, new w(Gc(i.content, 0, i.openStart, p), p, i.openEnd));
|
|
3961
3961
|
}
|
|
3962
3962
|
}
|
|
@@ -3977,14 +3977,14 @@ function Gc(n, e, t, i, r) {
|
|
|
3977
3977
|
}
|
|
3978
3978
|
return n;
|
|
3979
3979
|
}
|
|
3980
|
-
function
|
|
3980
|
+
function Ap(n, e, t, i) {
|
|
3981
3981
|
if (!i.isInline && e == t && n.doc.resolve(e).parent.content.size) {
|
|
3982
3982
|
let r = vp(n.doc, e, i.type);
|
|
3983
3983
|
r != null && (e = t = r);
|
|
3984
3984
|
}
|
|
3985
3985
|
n.replaceRange(e, t, new w(y.from(i), 0, 0));
|
|
3986
3986
|
}
|
|
3987
|
-
function
|
|
3987
|
+
function Tp(n, e, t) {
|
|
3988
3988
|
let i = n.doc.resolve(e), r = n.doc.resolve(t), s = Yc(i, r);
|
|
3989
3989
|
for (let o = 0; o < s.length; o++) {
|
|
3990
3990
|
let a = s[o], l = o == s.length - 1;
|
|
@@ -4192,14 +4192,14 @@ class Op {
|
|
|
4192
4192
|
that parent node.
|
|
4193
4193
|
*/
|
|
4194
4194
|
replaceRangeWith(e, t, i) {
|
|
4195
|
-
return
|
|
4195
|
+
return Ap(this, e, t, i), this;
|
|
4196
4196
|
}
|
|
4197
4197
|
/**
|
|
4198
4198
|
Delete the given range, expanding it to cover fully covered
|
|
4199
4199
|
parent nodes until a valid replace is found.
|
|
4200
4200
|
*/
|
|
4201
4201
|
deleteRange(e, t) {
|
|
4202
|
-
return
|
|
4202
|
+
return Tp(this, e, t), this;
|
|
4203
4203
|
}
|
|
4204
4204
|
/**
|
|
4205
4205
|
Split the content in the given range off from its parent, if there
|
|
@@ -4409,7 +4409,7 @@ class D {
|
|
|
4409
4409
|
found.
|
|
4410
4410
|
*/
|
|
4411
4411
|
static findFrom(e, t, i = !1) {
|
|
4412
|
-
let r = e.parent.inlineContent ? new
|
|
4412
|
+
let r = e.parent.inlineContent ? new E(e) : Zt(e.node(0), e.parent, e.pos, e.index(), t, i);
|
|
4413
4413
|
if (r)
|
|
4414
4414
|
return r;
|
|
4415
4415
|
for (let s = e.depth - 1; s >= 0; s--) {
|
|
@@ -4476,7 +4476,7 @@ class D {
|
|
|
4476
4476
|
returns the bookmark for that.
|
|
4477
4477
|
*/
|
|
4478
4478
|
getBookmark() {
|
|
4479
|
-
return
|
|
4479
|
+
return E.between(this.$anchor, this.$head).getBookmark();
|
|
4480
4480
|
}
|
|
4481
4481
|
}
|
|
4482
4482
|
D.prototype.visible = !0;
|
|
@@ -4492,7 +4492,7 @@ let Ra = !1;
|
|
|
4492
4492
|
function _a(n) {
|
|
4493
4493
|
!Ra && !n.parent.inlineContent && (Ra = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + n.parent.type.name + ")"));
|
|
4494
4494
|
}
|
|
4495
|
-
class
|
|
4495
|
+
class E extends D {
|
|
4496
4496
|
/**
|
|
4497
4497
|
Construct a text selection between the given points.
|
|
4498
4498
|
*/
|
|
@@ -4511,7 +4511,7 @@ class C extends D {
|
|
|
4511
4511
|
if (!i.parent.inlineContent)
|
|
4512
4512
|
return D.near(i);
|
|
4513
4513
|
let r = e.resolve(t.map(this.anchor));
|
|
4514
|
-
return new
|
|
4514
|
+
return new E(r.parent.inlineContent ? r : i, i);
|
|
4515
4515
|
}
|
|
4516
4516
|
replace(e, t = w.empty) {
|
|
4517
4517
|
if (super.replace(e, t), t == w.empty) {
|
|
@@ -4520,7 +4520,7 @@ class C extends D {
|
|
|
4520
4520
|
}
|
|
4521
4521
|
}
|
|
4522
4522
|
eq(e) {
|
|
4523
|
-
return e instanceof
|
|
4523
|
+
return e instanceof E && e.anchor == this.anchor && e.head == this.head;
|
|
4524
4524
|
}
|
|
4525
4525
|
getBookmark() {
|
|
4526
4526
|
return new Nr(this.anchor, this.head);
|
|
@@ -4534,7 +4534,7 @@ class C extends D {
|
|
|
4534
4534
|
static fromJSON(e, t) {
|
|
4535
4535
|
if (typeof t.anchor != "number" || typeof t.head != "number")
|
|
4536
4536
|
throw new RangeError("Invalid input for TextSelection.fromJSON");
|
|
4537
|
-
return new
|
|
4537
|
+
return new E(e.resolve(t.anchor), e.resolve(t.head));
|
|
4538
4538
|
}
|
|
4539
4539
|
/**
|
|
4540
4540
|
Create a text selection from non-resolved positions.
|
|
@@ -4560,10 +4560,10 @@ class C extends D {
|
|
|
4560
4560
|
else
|
|
4561
4561
|
return D.near(t, i);
|
|
4562
4562
|
}
|
|
4563
|
-
return e.parent.inlineContent || (r == 0 ? e = t : (e = (D.findFrom(e, -i, !0) || D.findFrom(e, i, !0)).$anchor, e.pos < t.pos != r < 0 && (e = t))), new
|
|
4563
|
+
return e.parent.inlineContent || (r == 0 ? e = t : (e = (D.findFrom(e, -i, !0) || D.findFrom(e, i, !0)).$anchor, e.pos < t.pos != r < 0 && (e = t))), new E(e, t);
|
|
4564
4564
|
}
|
|
4565
4565
|
}
|
|
4566
|
-
D.jsonID("text",
|
|
4566
|
+
D.jsonID("text", E);
|
|
4567
4567
|
class Nr {
|
|
4568
4568
|
constructor(e, t) {
|
|
4569
4569
|
this.anchor = e, this.head = t;
|
|
@@ -4572,10 +4572,10 @@ class Nr {
|
|
|
4572
4572
|
return new Nr(e.map(this.anchor), e.map(this.head));
|
|
4573
4573
|
}
|
|
4574
4574
|
resolve(e) {
|
|
4575
|
-
return
|
|
4575
|
+
return E.between(e.resolve(this.anchor), e.resolve(this.head));
|
|
4576
4576
|
}
|
|
4577
4577
|
}
|
|
4578
|
-
class
|
|
4578
|
+
class S extends D {
|
|
4579
4579
|
/**
|
|
4580
4580
|
Create a node selection. Does not verify the validity of its
|
|
4581
4581
|
argument.
|
|
@@ -4586,13 +4586,13 @@ class x extends D {
|
|
|
4586
4586
|
}
|
|
4587
4587
|
map(e, t) {
|
|
4588
4588
|
let { deleted: i, pos: r } = t.mapResult(this.anchor), s = e.resolve(r);
|
|
4589
|
-
return i ? D.near(s) : new
|
|
4589
|
+
return i ? D.near(s) : new S(s);
|
|
4590
4590
|
}
|
|
4591
4591
|
content() {
|
|
4592
4592
|
return new w(y.from(this.node), 0, 0);
|
|
4593
4593
|
}
|
|
4594
4594
|
eq(e) {
|
|
4595
|
-
return e instanceof
|
|
4595
|
+
return e instanceof S && e.anchor == this.anchor;
|
|
4596
4596
|
}
|
|
4597
4597
|
toJSON() {
|
|
4598
4598
|
return { type: "node", anchor: this.anchor };
|
|
@@ -4606,13 +4606,13 @@ class x extends D {
|
|
|
4606
4606
|
static fromJSON(e, t) {
|
|
4607
4607
|
if (typeof t.anchor != "number")
|
|
4608
4608
|
throw new RangeError("Invalid input for NodeSelection.fromJSON");
|
|
4609
|
-
return new
|
|
4609
|
+
return new S(e.resolve(t.anchor));
|
|
4610
4610
|
}
|
|
4611
4611
|
/**
|
|
4612
4612
|
Create a node selection from non-resolved positions.
|
|
4613
4613
|
*/
|
|
4614
4614
|
static create(e, t) {
|
|
4615
|
-
return new
|
|
4615
|
+
return new S(e.resolve(t));
|
|
4616
4616
|
}
|
|
4617
4617
|
/**
|
|
4618
4618
|
Determines whether the given node may be selected as a node
|
|
@@ -4622,8 +4622,8 @@ class x extends D {
|
|
|
4622
4622
|
return !e.isText && e.type.spec.selectable !== !1;
|
|
4623
4623
|
}
|
|
4624
4624
|
}
|
|
4625
|
-
|
|
4626
|
-
D.jsonID("node",
|
|
4625
|
+
S.prototype.visible = !1;
|
|
4626
|
+
D.jsonID("node", S);
|
|
4627
4627
|
class Co {
|
|
4628
4628
|
constructor(e) {
|
|
4629
4629
|
this.anchor = e;
|
|
@@ -4634,7 +4634,7 @@ class Co {
|
|
|
4634
4634
|
}
|
|
4635
4635
|
resolve(e) {
|
|
4636
4636
|
let t = e.resolve(this.anchor), i = t.nodeAfter;
|
|
4637
|
-
return i &&
|
|
4637
|
+
return i && S.isSelectable(i) ? new S(t) : D.near(t);
|
|
4638
4638
|
}
|
|
4639
4639
|
}
|
|
4640
4640
|
class ge extends D {
|
|
@@ -4682,12 +4682,12 @@ const Np = {
|
|
|
4682
4682
|
};
|
|
4683
4683
|
function Zt(n, e, t, i, r, s = !1) {
|
|
4684
4684
|
if (e.inlineContent)
|
|
4685
|
-
return
|
|
4685
|
+
return E.create(n, t);
|
|
4686
4686
|
for (let o = i - (r > 0 ? 0 : 1); r > 0 ? o < e.childCount : o >= 0; o += r) {
|
|
4687
4687
|
let a = e.child(o);
|
|
4688
4688
|
if (a.isAtom) {
|
|
4689
|
-
if (!s &&
|
|
4690
|
-
return
|
|
4689
|
+
if (!s && S.isSelectable(a))
|
|
4690
|
+
return S.create(n, t - (r < 0 ? a.nodeSize : 0));
|
|
4691
4691
|
} else {
|
|
4692
4692
|
let l = Zt(n, a, t + r, r < 0 ? a.childCount : 0, r, s);
|
|
4693
4693
|
if (l)
|
|
@@ -5207,7 +5207,7 @@ function ki(n) {
|
|
|
5207
5207
|
const Ir = function(n) {
|
|
5208
5208
|
return n.focusNode && Ft(n.focusNode, n.focusOffset, n.anchorNode, n.anchorOffset);
|
|
5209
5209
|
};
|
|
5210
|
-
function
|
|
5210
|
+
function At(n, e) {
|
|
5211
5211
|
let t = document.createEvent("Event");
|
|
5212
5212
|
return t.initEvent("keydown", !0, !0), t.keyCode = n, t.key = t.code = e, t;
|
|
5213
5213
|
}
|
|
@@ -5567,10 +5567,10 @@ let Wa = null, Ja = null, Ka = !1;
|
|
|
5567
5567
|
function rf(n, e, t) {
|
|
5568
5568
|
return Wa == e && Ja == t ? Ka : (Wa = e, Ja = t, Ka = t == "up" || t == "down" ? ef(n, e, t) : nf(n, e, t));
|
|
5569
5569
|
}
|
|
5570
|
-
const
|
|
5570
|
+
const Te = 0, Ga = 1, Dt = 2, Ue = 3;
|
|
5571
5571
|
class xi {
|
|
5572
5572
|
constructor(e, t, i, r) {
|
|
5573
|
-
this.parent = e, this.children = t, this.dom = i, this.contentDOM = r, this.dirty =
|
|
5573
|
+
this.parent = e, this.children = t, this.dom = i, this.contentDOM = r, this.dirty = Te, i.pmViewDesc = this;
|
|
5574
5574
|
}
|
|
5575
5575
|
// Used to check whether a given description corresponds to a
|
|
5576
5576
|
// widget/mark/node.
|
|
@@ -5927,7 +5927,7 @@ class au extends xi {
|
|
|
5927
5927
|
super(e, [], o, null), this.widget = t, this.widget = t, s = this;
|
|
5928
5928
|
}
|
|
5929
5929
|
matchesWidget(e) {
|
|
5930
|
-
return this.dirty ==
|
|
5930
|
+
return this.dirty == Te && e.type.eq(this.widget.type);
|
|
5931
5931
|
}
|
|
5932
5932
|
parseRule() {
|
|
5933
5933
|
return { ignore: !0 };
|
|
@@ -5981,11 +5981,11 @@ class qt extends xi {
|
|
|
5981
5981
|
return this.dirty != Ue && this.mark.eq(e);
|
|
5982
5982
|
}
|
|
5983
5983
|
markDirty(e, t) {
|
|
5984
|
-
if (super.markDirty(e, t), this.dirty !=
|
|
5984
|
+
if (super.markDirty(e, t), this.dirty != Te) {
|
|
5985
5985
|
let i = this.parent;
|
|
5986
5986
|
for (; !i.node; )
|
|
5987
5987
|
i = i.parent;
|
|
5988
|
-
i.dirty < this.dirty && (i.dirty = this.dirty), this.dirty =
|
|
5988
|
+
i.dirty < this.dirty && (i.dirty = this.dirty), this.dirty = Te;
|
|
5989
5989
|
}
|
|
5990
5990
|
}
|
|
5991
5991
|
slice(e, t, i) {
|
|
@@ -6053,7 +6053,7 @@ class bt extends xi {
|
|
|
6053
6053
|
return e;
|
|
6054
6054
|
}
|
|
6055
6055
|
matchesNode(e, t, i) {
|
|
6056
|
-
return this.dirty ==
|
|
6056
|
+
return this.dirty == Te && e.eq(this.node) && or(t, this.outerDeco) && i.eq(this.innerDeco);
|
|
6057
6057
|
}
|
|
6058
6058
|
get size() {
|
|
6059
6059
|
return this.node.nodeSize;
|
|
@@ -6077,7 +6077,7 @@ class bt extends xi {
|
|
|
6077
6077
|
}
|
|
6078
6078
|
localCompositionInfo(e, t) {
|
|
6079
6079
|
let { from: i, to: r } = e.state.selection;
|
|
6080
|
-
if (!(e.state.selection instanceof
|
|
6080
|
+
if (!(e.state.selection instanceof E) || i < t || r > t + this.node.content.size)
|
|
6081
6081
|
return null;
|
|
6082
6082
|
let s = e.input.compositionNode;
|
|
6083
6083
|
if (!s || !this.dom.contains(s.parentNode))
|
|
@@ -6108,7 +6108,7 @@ class bt extends xi {
|
|
|
6108
6108
|
return this.dirty == Ue || !e.sameMarkup(this.node) ? !1 : (this.updateInner(e, t, i, r), !0);
|
|
6109
6109
|
}
|
|
6110
6110
|
updateInner(e, t, i, r) {
|
|
6111
|
-
this.updateOuterDeco(t), this.node = e, this.innerDeco = i, this.contentDOM && this.updateChildren(r, this.posAtStart), this.dirty =
|
|
6111
|
+
this.updateOuterDeco(t), this.node = e, this.innerDeco = i, this.contentDOM && this.updateChildren(r, this.posAtStart), this.dirty = Te;
|
|
6112
6112
|
}
|
|
6113
6113
|
updateOuterDeco(e) {
|
|
6114
6114
|
if (or(e, this.outerDeco))
|
|
@@ -6144,7 +6144,7 @@ class zr extends bt {
|
|
|
6144
6144
|
return { skip: e || !0 };
|
|
6145
6145
|
}
|
|
6146
6146
|
update(e, t, i, r) {
|
|
6147
|
-
return this.dirty == Ue || this.dirty !=
|
|
6147
|
+
return this.dirty == Ue || this.dirty != Te && !this.inParent() || !e.sameMarkup(this.node) ? !1 : (this.updateOuterDeco(t), (this.dirty != Te || e.text != this.node.text) && e.text != this.nodeDOM.nodeValue && (this.nodeDOM.nodeValue = e.text, r.trackWrites == this.nodeDOM && (r.trackWrites = null)), this.node = e, this.dirty = Te, !0);
|
|
6148
6148
|
}
|
|
6149
6149
|
inParent() {
|
|
6150
6150
|
let e = this.parent.contentDOM;
|
|
@@ -6181,7 +6181,7 @@ class lu extends xi {
|
|
|
6181
6181
|
return { ignore: !0 };
|
|
6182
6182
|
}
|
|
6183
6183
|
matchesHack(e) {
|
|
6184
|
-
return this.dirty ==
|
|
6184
|
+
return this.dirty == Te && this.dom.nodeName == e;
|
|
6185
6185
|
}
|
|
6186
6186
|
get domAtom() {
|
|
6187
6187
|
return !0;
|
|
@@ -6339,7 +6339,7 @@ class lf {
|
|
|
6339
6339
|
for (; r < o && (r == s - 1 ? this.top : this.stack[r + 1 << 1]).matchesMark(e[r]) && e[r].type.spec.spanning !== !1; )
|
|
6340
6340
|
r++;
|
|
6341
6341
|
for (; r < s; )
|
|
6342
|
-
this.destroyRest(), this.top.dirty =
|
|
6342
|
+
this.destroyRest(), this.top.dirty = Te, this.index = this.stack.pop(), this.top = this.stack.pop(), s--;
|
|
6343
6343
|
for (; s < e.length; ) {
|
|
6344
6344
|
this.stack.push(this.top, this.index + 1);
|
|
6345
6345
|
let a = -1;
|
|
@@ -6409,7 +6409,7 @@ class lf {
|
|
|
6409
6409
|
if (!h && l.update(e, t, i, r))
|
|
6410
6410
|
return this.destroyBetween(this.index, a), l.dom != u && (this.changed = !0), this.index++, !0;
|
|
6411
6411
|
if (!h && (d = this.recreateWrapper(l, e, t, i, r, o)))
|
|
6412
|
-
return this.destroyBetween(this.index, a), this.top.children[this.index] = d, d.contentDOM && (d.dirty = Dt, d.updateChildren(r, o + 1), d.dirty =
|
|
6412
|
+
return this.destroyBetween(this.index, a), this.top.children[this.index] = d, d.contentDOM && (d.dirty = Dt, d.updateChildren(r, o + 1), d.dirty = Te), this.changed = !0, this.index++, !0;
|
|
6413
6413
|
break;
|
|
6414
6414
|
}
|
|
6415
6415
|
}
|
|
@@ -6593,9 +6593,9 @@ function Mo(n, e = null) {
|
|
|
6593
6593
|
for (l = o; r && !r.node; )
|
|
6594
6594
|
r = r.parent;
|
|
6595
6595
|
let d = r.node;
|
|
6596
|
-
if (r && d.isAtom &&
|
|
6596
|
+
if (r && d.isAtom && S.isSelectable(d) && r.parent && !(d.isInline && Bp(t.focusNode, t.focusOffset, r.dom))) {
|
|
6597
6597
|
let h = r.posBefore;
|
|
6598
|
-
c = new
|
|
6598
|
+
c = new S(o == h ? a : i.resolve(h));
|
|
6599
6599
|
}
|
|
6600
6600
|
} else {
|
|
6601
6601
|
if (t instanceof n.dom.ownerDocument.defaultView.Selection && t.rangeCount > 1) {
|
|
@@ -6615,7 +6615,7 @@ function Mo(n, e = null) {
|
|
|
6615
6615
|
let u = i.resolve(l);
|
|
6616
6616
|
if (!c) {
|
|
6617
6617
|
let d = e == "pointer" || n.state.selection.head < a.pos && !s ? 1 : -1;
|
|
6618
|
-
c =
|
|
6618
|
+
c = Ao(n, u, a, d);
|
|
6619
6619
|
}
|
|
6620
6620
|
return c;
|
|
6621
6621
|
}
|
|
@@ -6636,7 +6636,7 @@ function Qe(n, e = !1) {
|
|
|
6636
6636
|
mf(n);
|
|
6637
6637
|
else {
|
|
6638
6638
|
let { anchor: i, head: r } = t, s, o;
|
|
6639
|
-
Qa && !(t instanceof
|
|
6639
|
+
Qa && !(t instanceof E) && (t.$from.parent.inlineContent || (s = Za(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (o = Za(n, t.to))), n.docView.setSelection(i, r, n, e), Qa && (s && el(s), o && el(o)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && ff(n));
|
|
6640
6640
|
}
|
|
6641
6641
|
n.domObserver.setCurSelection(), n.domObserver.connectSelection();
|
|
6642
6642
|
}
|
|
@@ -6677,7 +6677,7 @@ function mf(n) {
|
|
|
6677
6677
|
r ? t.setStart(i.parentNode, ee(i) + 1) : t.setStart(i, 0), t.collapse(!0), e.removeAllRanges(), e.addRange(t), !r && !n.state.selection.visible && be && gt <= 11 && (i.disabled = !0, i.disabled = !1);
|
|
6678
6678
|
}
|
|
6679
6679
|
function pu(n, e) {
|
|
6680
|
-
if (e instanceof
|
|
6680
|
+
if (e instanceof S) {
|
|
6681
6681
|
let t = n.docView.descAt(e.from);
|
|
6682
6682
|
t != n.lastSelectedViewDesc && (tl(n), t && t.selectNode(), n.lastSelectedViewDesc = t);
|
|
6683
6683
|
} else
|
|
@@ -6686,8 +6686,8 @@ function pu(n, e) {
|
|
|
6686
6686
|
function tl(n) {
|
|
6687
6687
|
n.lastSelectedViewDesc && (n.lastSelectedViewDesc.parent && n.lastSelectedViewDesc.deselectNode(), n.lastSelectedViewDesc = void 0);
|
|
6688
6688
|
}
|
|
6689
|
-
function
|
|
6690
|
-
return n.someProp("createSelectionBetween", (r) => r(n, e, t)) ||
|
|
6689
|
+
function Ao(n, e, t, i) {
|
|
6690
|
+
return n.someProp("createSelectionBetween", (r) => r(n, e, t)) || E.between(e, t, i);
|
|
6691
6691
|
}
|
|
6692
6692
|
function nl(n) {
|
|
6693
6693
|
return n.editable && !n.hasFocus() ? !1 : fu(n);
|
|
@@ -6715,28 +6715,28 @@ function at(n, e) {
|
|
|
6715
6715
|
}
|
|
6716
6716
|
function il(n, e, t) {
|
|
6717
6717
|
let i = n.state.selection;
|
|
6718
|
-
if (i instanceof
|
|
6718
|
+
if (i instanceof E)
|
|
6719
6719
|
if (t.indexOf("s") > -1) {
|
|
6720
6720
|
let { $head: r } = i, s = r.textOffset ? null : e < 0 ? r.nodeBefore : r.nodeAfter;
|
|
6721
6721
|
if (!s || s.isText || !s.isLeaf)
|
|
6722
6722
|
return !1;
|
|
6723
6723
|
let o = n.state.doc.resolve(r.pos + s.nodeSize * (e < 0 ? -1 : 1));
|
|
6724
|
-
return at(n, new
|
|
6724
|
+
return at(n, new E(i.$anchor, o));
|
|
6725
6725
|
} else if (i.empty) {
|
|
6726
6726
|
if (n.endOfTextblock(e > 0 ? "forward" : "backward")) {
|
|
6727
6727
|
let r = Us(n.state, e);
|
|
6728
|
-
return r && r instanceof
|
|
6728
|
+
return r && r instanceof S ? at(n, r) : !1;
|
|
6729
6729
|
} else if (!(Ce && t.indexOf("m") > -1)) {
|
|
6730
6730
|
let r = i.$head, s = r.textOffset ? null : e < 0 ? r.nodeBefore : r.nodeAfter, o;
|
|
6731
6731
|
if (!s || s.isText)
|
|
6732
6732
|
return !1;
|
|
6733
6733
|
let a = e < 0 ? r.pos - s.nodeSize : r.pos;
|
|
6734
|
-
return s.isAtom || (o = n.docView.descAt(a)) && !o.contentDOM ?
|
|
6734
|
+
return s.isAtom || (o = n.docView.descAt(a)) && !o.contentDOM ? S.isSelectable(s) ? at(n, new S(e < 0 ? n.state.doc.resolve(r.pos - s.nodeSize) : r)) : vi ? at(n, new E(n.state.doc.resolve(e < 0 ? a : a + s.nodeSize))) : !1 : !1;
|
|
6735
6735
|
}
|
|
6736
6736
|
} else return !1;
|
|
6737
6737
|
else {
|
|
6738
|
-
if (i instanceof
|
|
6739
|
-
return at(n, new
|
|
6738
|
+
if (i instanceof S && i.node.isInline)
|
|
6739
|
+
return at(n, new E(e > 0 ? i.$to : i.$from));
|
|
6740
6740
|
{
|
|
6741
6741
|
let r = Us(n.state, e);
|
|
6742
6742
|
return r ? at(n, r) : !1;
|
|
@@ -6886,12 +6886,12 @@ function rl(n, e) {
|
|
|
6886
6886
|
}
|
|
6887
6887
|
function sl(n, e, t) {
|
|
6888
6888
|
let i = n.state.selection;
|
|
6889
|
-
if (i instanceof
|
|
6889
|
+
if (i instanceof E && !i.empty || t.indexOf("s") > -1 || Ce && t.indexOf("m") > -1)
|
|
6890
6890
|
return !1;
|
|
6891
6891
|
let { $from: r, $to: s } = i;
|
|
6892
6892
|
if (!r.parent.inlineContent || n.endOfTextblock(e < 0 ? "up" : "down")) {
|
|
6893
6893
|
let o = Us(n.state, e);
|
|
6894
|
-
if (o && o instanceof
|
|
6894
|
+
if (o && o instanceof S)
|
|
6895
6895
|
return at(n, o);
|
|
6896
6896
|
}
|
|
6897
6897
|
if (!r.parent.inlineContent) {
|
|
@@ -6901,7 +6901,7 @@ function sl(n, e, t) {
|
|
|
6901
6901
|
return !1;
|
|
6902
6902
|
}
|
|
6903
6903
|
function ol(n, e) {
|
|
6904
|
-
if (!(n.state.selection instanceof
|
|
6904
|
+
if (!(n.state.selection instanceof E))
|
|
6905
6905
|
return !0;
|
|
6906
6906
|
let { $head: t, $anchor: i, empty: r } = n.state.selection;
|
|
6907
6907
|
if (!t.sameParent(i))
|
|
@@ -6958,7 +6958,7 @@ function Sf(n, e) {
|
|
|
6958
6958
|
}
|
|
6959
6959
|
return !1;
|
|
6960
6960
|
}
|
|
6961
|
-
function
|
|
6961
|
+
function To(n, e) {
|
|
6962
6962
|
n.someProp("transformCopied", (p) => {
|
|
6963
6963
|
e = p(e, n);
|
|
6964
6964
|
});
|
|
@@ -7010,7 +7010,7 @@ function gu(n, e, t, i, r) {
|
|
|
7010
7010
|
} else
|
|
7011
7011
|
n.someProp("transformPastedHTML", (d) => {
|
|
7012
7012
|
t = d(t, n);
|
|
7013
|
-
}), o =
|
|
7013
|
+
}), o = Af(t), vi && Tf(o);
|
|
7014
7014
|
let c = o && o.querySelector("[data-pm-slice]"), u = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
|
|
7015
7015
|
if (u && u[3])
|
|
7016
7016
|
for (let d = +u[3]; d > 0; d--) {
|
|
@@ -7112,7 +7112,7 @@ function Mf(n) {
|
|
|
7112
7112
|
let e = window.trustedTypes;
|
|
7113
7113
|
return e ? (ls || (ls = e.defaultPolicy || e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), ls.createHTML(n)) : n;
|
|
7114
7114
|
}
|
|
7115
|
-
function
|
|
7115
|
+
function Af(n) {
|
|
7116
7116
|
let e = /^(\s*<meta [^>]*>)*/.exec(n);
|
|
7117
7117
|
e && (n = n.slice(e[0].length));
|
|
7118
7118
|
let t = vu().createElement("div"), i = /<([a-z][^>\s]+)/i.exec(n), r;
|
|
@@ -7121,7 +7121,7 @@ function Tf(n) {
|
|
|
7121
7121
|
t = t.querySelector(r[s]) || t;
|
|
7122
7122
|
return t;
|
|
7123
7123
|
}
|
|
7124
|
-
function
|
|
7124
|
+
function Tf(n) {
|
|
7125
7125
|
let e = n.querySelectorAll(se ? "span:not([class]):not([style])" : "span.Apple-converted-space");
|
|
7126
7126
|
for (let t = 0; t < e.length; t++) {
|
|
7127
7127
|
let i = e[t];
|
|
@@ -7201,7 +7201,7 @@ he.keydown = (n, e) => {
|
|
|
7201
7201
|
if (t.keyCode != 229 && n.domObserver.forceFlush(), gn && t.keyCode == 13 && !t.ctrlKey && !t.altKey && !t.metaKey) {
|
|
7202
7202
|
let i = Date.now();
|
|
7203
7203
|
n.input.lastIOSEnter = i, n.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
|
|
7204
|
-
n.input.lastIOSEnter == i && (n.someProp("handleKeyDown", (r) => r(n,
|
|
7204
|
+
n.input.lastIOSEnter == i && (n.someProp("handleKeyDown", (r) => r(n, At(13, "Enter"))), n.input.lastIOSEnter = 0);
|
|
7205
7205
|
}, 200);
|
|
7206
7206
|
} else n.someProp("handleKeyDown", (i) => i(n, t)) || Sf(n, t) ? t.preventDefault() : pt(n, "key");
|
|
7207
7207
|
};
|
|
@@ -7217,7 +7217,7 @@ he.keypress = (n, e) => {
|
|
|
7217
7217
|
return;
|
|
7218
7218
|
}
|
|
7219
7219
|
let i = n.state.selection;
|
|
7220
|
-
if (!(i instanceof
|
|
7220
|
+
if (!(i instanceof E) || !i.$from.sameParent(i.$to)) {
|
|
7221
7221
|
let r = String.fromCharCode(t.charCode);
|
|
7222
7222
|
!/[\r\n]/.test(r) && !n.someProp("handleTextInput", (s) => s(n, i.$from.pos, i.$to.pos, r)) && n.dispatch(n.state.tr.insertText(r).scrollIntoView()), t.preventDefault();
|
|
7223
7223
|
}
|
|
@@ -7248,22 +7248,22 @@ function Lf(n, e) {
|
|
|
7248
7248
|
if (e == -1)
|
|
7249
7249
|
return !1;
|
|
7250
7250
|
let t = n.state.doc.resolve(e), i = t.nodeAfter;
|
|
7251
|
-
return i && i.isAtom &&
|
|
7251
|
+
return i && i.isAtom && S.isSelectable(i) ? (on(n, new S(t)), !0) : !1;
|
|
7252
7252
|
}
|
|
7253
7253
|
function Bf(n, e) {
|
|
7254
7254
|
if (e == -1)
|
|
7255
7255
|
return !1;
|
|
7256
7256
|
let t = n.state.selection, i, r;
|
|
7257
|
-
t instanceof
|
|
7257
|
+
t instanceof S && (i = t.node);
|
|
7258
7258
|
let s = n.state.doc.resolve(e);
|
|
7259
7259
|
for (let o = s.depth + 1; o > 0; o--) {
|
|
7260
7260
|
let a = o > s.depth ? s.nodeAfter : s.node(o);
|
|
7261
|
-
if (
|
|
7261
|
+
if (S.isSelectable(a)) {
|
|
7262
7262
|
i && t.$from.depth > 0 && o >= t.$from.depth && s.before(t.$from.depth + 1) == t.$from.pos ? r = s.before(t.$from.depth) : r = s.before(o);
|
|
7263
7263
|
break;
|
|
7264
7264
|
}
|
|
7265
7265
|
}
|
|
7266
|
-
return r != null ? (on(n,
|
|
7266
|
+
return r != null ? (on(n, S.create(n.state.doc, r)), !0) : !1;
|
|
7267
7267
|
}
|
|
7268
7268
|
function jf(n, e, t, i, r) {
|
|
7269
7269
|
return Do(n, "handleClickOn", e, t, i) || n.someProp("handleClick", (s) => s(n, e, i)) || (r ? Bf(n, t) : Lf(n, t));
|
|
@@ -7279,14 +7279,14 @@ function Ff(n, e, t) {
|
|
|
7279
7279
|
return !1;
|
|
7280
7280
|
let i = n.state.doc;
|
|
7281
7281
|
if (e == -1)
|
|
7282
|
-
return i.inlineContent ? (on(n,
|
|
7282
|
+
return i.inlineContent ? (on(n, E.create(i, 0, i.content.size)), !0) : !1;
|
|
7283
7283
|
let r = i.resolve(e);
|
|
7284
7284
|
for (let s = r.depth + 1; s > 0; s--) {
|
|
7285
7285
|
let o = s > r.depth ? r.nodeAfter : r.node(s), a = r.before(s);
|
|
7286
7286
|
if (o.inlineContent)
|
|
7287
|
-
on(n,
|
|
7288
|
-
else if (
|
|
7289
|
-
on(n,
|
|
7287
|
+
on(n, E.create(i, a + 1, a + 1 + o.content.size));
|
|
7288
|
+
else if (S.isSelectable(o))
|
|
7289
|
+
on(n, S.create(i, a));
|
|
7290
7290
|
else
|
|
7291
7291
|
continue;
|
|
7292
7292
|
return !0;
|
|
@@ -7317,7 +7317,7 @@ class qf {
|
|
|
7317
7317
|
const a = r ? null : i.target, l = a ? e.docView.nearestDesc(a, !0) : null;
|
|
7318
7318
|
this.target = l && l.dom.nodeType == 1 ? l.dom : null;
|
|
7319
7319
|
let { selection: c } = e.state;
|
|
7320
|
-
(i.button == 0 && s.type.spec.draggable && s.type.spec.selectable !== !1 || c instanceof
|
|
7320
|
+
(i.button == 0 && s.type.spec.draggable && s.type.spec.selectable !== !1 || c instanceof S && c.from <= o && c.to > o) && (this.mightDrag = {
|
|
7321
7321
|
node: s,
|
|
7322
7322
|
pos: o,
|
|
7323
7323
|
addAttr: !!(this.target && !this.target.draggable),
|
|
@@ -7365,7 +7365,7 @@ he.compositionstart = he.compositionupdate = (n) => {
|
|
|
7365
7365
|
if (!n.composing) {
|
|
7366
7366
|
n.domObserver.flush();
|
|
7367
7367
|
let { state: e } = n, t = e.selection.$to;
|
|
7368
|
-
if (e.selection instanceof
|
|
7368
|
+
if (e.selection instanceof E && (e.storedMarks || !t.textOffset && t.parentOffset && t.nodeBefore.marks.some((i) => i.type.spec.inclusive === !1)))
|
|
7369
7369
|
n.markCursor = n.state.storedMarks || t.marks(), lr(n, !0), n.markCursor = null;
|
|
7370
7370
|
else if (lr(n, !e.selection.empty), ze && e.selection.empty && t.parentOffset && !t.textOffset && t.nodeBefore.marks.length) {
|
|
7371
7371
|
let i = n.domSelectionRange();
|
|
@@ -7442,7 +7442,7 @@ de.copy = he.cut = (n, e) => {
|
|
|
7442
7442
|
let t = e, i = n.state.selection, r = t.type == "cut";
|
|
7443
7443
|
if (i.empty)
|
|
7444
7444
|
return;
|
|
7445
|
-
let s = Zn ? null : t.clipboardData, o = i.content(), { dom: a, text: l } =
|
|
7445
|
+
let s = Zn ? null : t.clipboardData, o = i.content(), { dom: a, text: l } = To(n, o);
|
|
7446
7446
|
s ? (t.preventDefault(), s.clearData(), s.setData("text/html", a.innerHTML), s.setData("text/plain", l)) : Jf(n, a), r && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
|
|
7447
7447
|
};
|
|
7448
7448
|
function Kf(n) {
|
|
@@ -7481,13 +7481,13 @@ he.paste = (n, e) => {
|
|
|
7481
7481
|
let i = Zn ? null : t.clipboardData, r = n.input.shiftKey && n.input.lastKeyCode != 45;
|
|
7482
7482
|
i && ei(n, Mu(i), i.getData("text/html"), r, t) ? t.preventDefault() : Gf(n, t);
|
|
7483
7483
|
};
|
|
7484
|
-
class
|
|
7484
|
+
class Au {
|
|
7485
7485
|
constructor(e, t, i) {
|
|
7486
7486
|
this.slice = e, this.move = t, this.node = i;
|
|
7487
7487
|
}
|
|
7488
7488
|
}
|
|
7489
7489
|
const Yf = Ce ? "altKey" : "ctrlKey";
|
|
7490
|
-
function
|
|
7490
|
+
function Tu(n, e) {
|
|
7491
7491
|
let t = n.someProp("dragCopies", (i) => !i(e));
|
|
7492
7492
|
return t ?? !e[Yf];
|
|
7493
7493
|
}
|
|
@@ -7496,16 +7496,16 @@ de.dragstart = (n, e) => {
|
|
|
7496
7496
|
if (i && i.done(), !t.dataTransfer)
|
|
7497
7497
|
return;
|
|
7498
7498
|
let r = n.state.selection, s = r.empty ? null : n.posAtCoords(Pr(t)), o;
|
|
7499
|
-
if (!(s && s.pos >= r.from && s.pos <= (r instanceof
|
|
7499
|
+
if (!(s && s.pos >= r.from && s.pos <= (r instanceof S ? r.to - 1 : r.to))) {
|
|
7500
7500
|
if (i && i.mightDrag)
|
|
7501
|
-
o =
|
|
7501
|
+
o = S.create(n.state.doc, i.mightDrag.pos);
|
|
7502
7502
|
else if (t.target && t.target.nodeType == 1) {
|
|
7503
7503
|
let d = n.docView.nearestDesc(t.target, !0);
|
|
7504
|
-
d && d.node.type.spec.draggable && d != n.docView && (o =
|
|
7504
|
+
d && d.node.type.spec.draggable && d != n.docView && (o = S.create(n.state.doc, d.posBefore));
|
|
7505
7505
|
}
|
|
7506
7506
|
}
|
|
7507
|
-
let a = (o || n.state.selection).content(), { dom: l, text: c, slice: u } =
|
|
7508
|
-
(!t.dataTransfer.files.length || !se || eu > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(Zn ? "Text" : "text/html", l.innerHTML), t.dataTransfer.effectAllowed = "copyMove", Zn || t.dataTransfer.setData("text/plain", c), n.dragging = new
|
|
7507
|
+
let a = (o || n.state.selection).content(), { dom: l, text: c, slice: u } = To(n, a);
|
|
7508
|
+
(!t.dataTransfer.files.length || !se || eu > 120) && t.dataTransfer.clearData(), t.dataTransfer.setData(Zn ? "Text" : "text/html", l.innerHTML), t.dataTransfer.effectAllowed = "copyMove", Zn || t.dataTransfer.setData("text/plain", c), n.dragging = new Au(u, Tu(n, t), o);
|
|
7509
7509
|
};
|
|
7510
7510
|
de.dragend = (n) => {
|
|
7511
7511
|
let e = n.dragging;
|
|
@@ -7525,7 +7525,7 @@ he.drop = (n, e) => {
|
|
|
7525
7525
|
o ? n.someProp("transformPasted", (f) => {
|
|
7526
7526
|
o = f(o, n);
|
|
7527
7527
|
}) : o = gu(n, Mu(t.dataTransfer), Zn ? null : t.dataTransfer.getData("text/html"), !1, s);
|
|
7528
|
-
let a = !!(i &&
|
|
7528
|
+
let a = !!(i && Tu(n, t));
|
|
7529
7529
|
if (n.someProp("handleDrop", (f) => f(n, t, o || w.empty, a))) {
|
|
7530
7530
|
t.preventDefault();
|
|
7531
7531
|
return;
|
|
@@ -7544,11 +7544,11 @@ he.drop = (n, e) => {
|
|
|
7544
7544
|
if (d ? c.replaceRangeWith(u, u, o.content.firstChild) : c.replaceRange(u, u, o), c.doc.eq(h))
|
|
7545
7545
|
return;
|
|
7546
7546
|
let p = c.doc.resolve(u);
|
|
7547
|
-
if (d &&
|
|
7548
|
-
c.setSelection(new
|
|
7547
|
+
if (d && S.isSelectable(o.content.firstChild) && p.nodeAfter && p.nodeAfter.sameMarkup(o.content.firstChild))
|
|
7548
|
+
c.setSelection(new S(p));
|
|
7549
7549
|
else {
|
|
7550
7550
|
let f = c.mapping.map(l);
|
|
7551
|
-
c.mapping.maps[c.mapping.maps.length - 1].forEach((m, g, b, k) => f = k), c.setSelection(
|
|
7551
|
+
c.mapping.maps[c.mapping.maps.length - 1].forEach((m, g, b, k) => f = k), c.setSelection(Ao(n, p, c.doc.resolve(f)));
|
|
7552
7552
|
}
|
|
7553
7553
|
n.focus(), n.dispatch(c.setMeta("uiEvent", "drop"));
|
|
7554
7554
|
};
|
|
@@ -7566,7 +7566,7 @@ de.beforeinput = (n, e) => {
|
|
|
7566
7566
|
n.domObserver.flushSoon();
|
|
7567
7567
|
let { domChangeCount: i } = n.input;
|
|
7568
7568
|
setTimeout(() => {
|
|
7569
|
-
if (n.input.domChangeCount != i || (n.dom.blur(), n.focus(), n.someProp("handleKeyDown", (s) => s(n,
|
|
7569
|
+
if (n.input.domChangeCount != i || (n.dom.blur(), n.focus(), n.someProp("handleKeyDown", (s) => s(n, At(8, "Backspace")))))
|
|
7570
7570
|
return;
|
|
7571
7571
|
let { $cursor: r } = n.state.selection;
|
|
7572
7572
|
r && r.pos > 0 && n.dispatch(n.state.tr.delete(r.pos - 1, r.pos).scrollIntoView());
|
|
@@ -7959,8 +7959,8 @@ function Xf(n, e, t, i, r, s, o) {
|
|
|
7959
7959
|
let k = a[b + 1];
|
|
7960
7960
|
if (k < 0 || h > k + u - d)
|
|
7961
7961
|
continue;
|
|
7962
|
-
let
|
|
7963
|
-
p >=
|
|
7962
|
+
let x = a[b] + u - d;
|
|
7963
|
+
p >= x ? a[b + 1] = h <= x ? -2 : -1 : h >= u && g && (a[b] += g, a[b + 1] += g);
|
|
7964
7964
|
}
|
|
7965
7965
|
d += g;
|
|
7966
7966
|
}), u = t.maps[c].map(u, -1);
|
|
@@ -8326,12 +8326,12 @@ const lm = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|df
|
|
|
8326
8326
|
function cm(n, e, t, i, r) {
|
|
8327
8327
|
let s = n.input.compositionPendingChanges || (n.composing ? n.input.compositionID : 0);
|
|
8328
8328
|
if (n.input.compositionPendingChanges = 0, e < 0) {
|
|
8329
|
-
let
|
|
8329
|
+
let A = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, Se = Mo(n, A);
|
|
8330
8330
|
if (Se && !n.state.selection.eq(Se)) {
|
|
8331
|
-
if (se && Ye && n.input.lastKeyCode === 13 && Date.now() - 100 < n.input.lastKeyCodeTime && n.someProp("handleKeyDown", (_h) => _h(n,
|
|
8331
|
+
if (se && Ye && n.input.lastKeyCode === 13 && Date.now() - 100 < n.input.lastKeyCodeTime && n.someProp("handleKeyDown", (_h) => _h(n, At(13, "Enter"))))
|
|
8332
8332
|
return;
|
|
8333
8333
|
let Di = n.state.tr.setSelection(Se);
|
|
8334
|
-
|
|
8334
|
+
A == "pointer" ? Di.setMeta("pointer", !0) : A == "key" && Di.scrollIntoView(), s && Di.setMeta("composition", s), n.dispatch(Di);
|
|
8335
8335
|
}
|
|
8336
8336
|
return;
|
|
8337
8337
|
}
|
|
@@ -8340,62 +8340,62 @@ function cm(n, e, t, i, r) {
|
|
|
8340
8340
|
let l = n.state.selection, c = om(n, e, t), u = n.state.doc, d = u.slice(c.from, c.to), h, p;
|
|
8341
8341
|
n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (h = n.state.selection.to, p = "end") : (h = n.state.selection.from, p = "start"), n.input.lastKeyCode = null;
|
|
8342
8342
|
let f = hm(d.content, c.doc.content, c.from, h, p);
|
|
8343
|
-
if (f && n.input.domChangeCount++, (gn && n.input.lastIOSEnter > Date.now() - 225 || Ye) && r.some((
|
|
8343
|
+
if (f && n.input.domChangeCount++, (gn && n.input.lastIOSEnter > Date.now() - 225 || Ye) && r.some((A) => A.nodeType == 1 && !lm.test(A.nodeName)) && (!f || f.endA >= f.endB) && n.someProp("handleKeyDown", (A) => A(n, At(13, "Enter")))) {
|
|
8344
8344
|
n.input.lastIOSEnter = 0;
|
|
8345
8345
|
return;
|
|
8346
8346
|
}
|
|
8347
8347
|
if (!f)
|
|
8348
|
-
if (i && l instanceof
|
|
8348
|
+
if (i && l instanceof E && !l.empty && l.$head.sameParent(l.$anchor) && !n.composing && !(c.sel && c.sel.anchor != c.sel.head))
|
|
8349
8349
|
f = { start: l.from, endA: l.to, endB: l.to };
|
|
8350
8350
|
else {
|
|
8351
8351
|
if (c.sel) {
|
|
8352
|
-
let
|
|
8353
|
-
if (
|
|
8354
|
-
let Se = n.state.tr.setSelection(
|
|
8352
|
+
let A = fl(n, n.state.doc, c.sel);
|
|
8353
|
+
if (A && !A.eq(n.state.selection)) {
|
|
8354
|
+
let Se = n.state.tr.setSelection(A);
|
|
8355
8355
|
s && Se.setMeta("composition", s), n.dispatch(Se);
|
|
8356
8356
|
}
|
|
8357
8357
|
}
|
|
8358
8358
|
return;
|
|
8359
8359
|
}
|
|
8360
|
-
n.state.selection.from < n.state.selection.to && f.start == f.endB && n.state.selection instanceof
|
|
8361
|
-
let m = c.doc.resolveNoCache(f.start - c.from), g = c.doc.resolveNoCache(f.endB - c.from), b = u.resolve(f.start), k = m.sameParent(g) && m.parent.inlineContent && b.end() >= f.endA,
|
|
8362
|
-
if ((gn && n.input.lastIOSEnter > Date.now() - 225 && (!k || r.some((
|
|
8360
|
+
n.state.selection.from < n.state.selection.to && f.start == f.endB && n.state.selection instanceof E && (f.start > n.state.selection.from && f.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? f.start = n.state.selection.from : f.endA < n.state.selection.to && f.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (f.endB += n.state.selection.to - f.endA, f.endA = n.state.selection.to)), be && gt <= 11 && f.endB == f.start + 1 && f.endA == f.start && f.start > c.from && c.doc.textBetween(f.start - c.from - 1, f.start - c.from + 1) == " " && (f.start--, f.endA--, f.endB--);
|
|
8361
|
+
let m = c.doc.resolveNoCache(f.start - c.from), g = c.doc.resolveNoCache(f.endB - c.from), b = u.resolve(f.start), k = m.sameParent(g) && m.parent.inlineContent && b.end() >= f.endA, x;
|
|
8362
|
+
if ((gn && n.input.lastIOSEnter > Date.now() - 225 && (!k || r.some((A) => A.nodeName == "DIV" || A.nodeName == "P")) || !k && m.pos < c.doc.content.size && (!m.sameParent(g) || !m.parent.inlineContent) && !/\S/.test(c.doc.textBetween(m.pos, g.pos, "", "")) && (x = D.findFrom(c.doc.resolve(m.pos + 1), 1, !0)) && x.head > m.pos) && n.someProp("handleKeyDown", (A) => A(n, At(13, "Enter")))) {
|
|
8363
8363
|
n.input.lastIOSEnter = 0;
|
|
8364
8364
|
return;
|
|
8365
8365
|
}
|
|
8366
|
-
if (n.state.selection.anchor > f.start && dm(u, f.start, f.endA, m, g) && n.someProp("handleKeyDown", (
|
|
8366
|
+
if (n.state.selection.anchor > f.start && dm(u, f.start, f.endA, m, g) && n.someProp("handleKeyDown", (A) => A(n, At(8, "Backspace")))) {
|
|
8367
8367
|
Ye && se && n.domObserver.suppressSelectionUpdates();
|
|
8368
8368
|
return;
|
|
8369
8369
|
}
|
|
8370
8370
|
se && f.endB == f.start && (n.input.lastChromeDelete = Date.now()), Ye && !k && m.start() != g.start() && g.parentOffset == 0 && m.depth == g.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == f.endA && (f.endB -= 2, g = c.doc.resolveNoCache(f.endB - c.from), setTimeout(() => {
|
|
8371
|
-
n.someProp("handleKeyDown", function(
|
|
8372
|
-
return
|
|
8371
|
+
n.someProp("handleKeyDown", function(A) {
|
|
8372
|
+
return A(n, At(13, "Enter"));
|
|
8373
8373
|
});
|
|
8374
8374
|
}, 20));
|
|
8375
|
-
let z = f.start, I = f.endA,
|
|
8375
|
+
let z = f.start, I = f.endA, C, L, ie;
|
|
8376
8376
|
if (k) {
|
|
8377
8377
|
if (m.pos == g.pos)
|
|
8378
|
-
be && gt <= 11 && m.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => Qe(n), 20)),
|
|
8378
|
+
be && gt <= 11 && m.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => Qe(n), 20)), C = n.state.tr.delete(z, I), L = u.resolve(f.start).marksAcross(u.resolve(f.endA));
|
|
8379
8379
|
else if (
|
|
8380
8380
|
// Adding or removing a mark
|
|
8381
8381
|
f.endA == f.endB && (ie = um(m.parent.content.cut(m.parentOffset, g.parentOffset), b.parent.content.cut(b.parentOffset, f.endA - b.start())))
|
|
8382
8382
|
)
|
|
8383
|
-
|
|
8383
|
+
C = n.state.tr, ie.type == "add" ? C.addMark(z, I, ie.mark) : C.removeMark(z, I, ie.mark);
|
|
8384
8384
|
else if (m.parent.child(m.index()).isText && m.index() == g.index() - (g.textOffset ? 0 : 1)) {
|
|
8385
|
-
let
|
|
8386
|
-
if (n.someProp("handleTextInput", (Se) => Se(n, z, I,
|
|
8385
|
+
let A = m.parent.textBetween(m.parentOffset, g.parentOffset);
|
|
8386
|
+
if (n.someProp("handleTextInput", (Se) => Se(n, z, I, A)))
|
|
8387
8387
|
return;
|
|
8388
|
-
|
|
8388
|
+
C = n.state.tr.insertText(A, z, I);
|
|
8389
8389
|
}
|
|
8390
8390
|
}
|
|
8391
|
-
if (
|
|
8392
|
-
let
|
|
8393
|
-
|
|
8391
|
+
if (C || (C = n.state.tr.replace(z, I, c.doc.slice(f.start - c.from, f.endB - c.from))), c.sel) {
|
|
8392
|
+
let A = fl(n, C.doc, c.sel);
|
|
8393
|
+
A && !(se && n.composing && A.empty && (f.start != f.endB || n.input.lastChromeDelete < Date.now() - 100) && (A.head == z || A.head == C.mapping.map(I) - 1) || be && A.empty && A.head == z) && C.setSelection(A);
|
|
8394
8394
|
}
|
|
8395
|
-
L &&
|
|
8395
|
+
L && C.ensureMarks(L), s && C.setMeta("composition", s), n.dispatch(C.scrollIntoView());
|
|
8396
8396
|
}
|
|
8397
8397
|
function fl(n, e, t) {
|
|
8398
|
-
return Math.max(t.anchor, t.head) > e.content.size ? null :
|
|
8398
|
+
return Math.max(t.anchor, t.head) > e.content.size ? null : Ao(n, e.resolve(t.anchor), e.resolve(t.head));
|
|
8399
8399
|
}
|
|
8400
8400
|
function um(n, e) {
|
|
8401
8401
|
let t = n.firstChild.marks, i = e.firstChild.marks, r = t, s = i, o, a, l;
|
|
@@ -8559,7 +8559,7 @@ class pm {
|
|
|
8559
8559
|
scrollToSelection() {
|
|
8560
8560
|
let e = this.domSelectionRange().focusNode;
|
|
8561
8561
|
if (!(!e || !this.dom.contains(e.nodeType == 1 ? e : e.parentNode))) {
|
|
8562
|
-
if (!this.someProp("handleScrollToSelection", (t) => t(this))) if (this.state.selection instanceof
|
|
8562
|
+
if (!this.someProp("handleScrollToSelection", (t) => t(this))) if (this.state.selection instanceof S) {
|
|
8563
8563
|
let t = this.docView.domAfterPos(this.state.selection.from);
|
|
8564
8564
|
t.nodeType == 1 && Ua(this, t.getBoundingClientRect(), e);
|
|
8565
8565
|
} else
|
|
@@ -8596,7 +8596,7 @@ class pm {
|
|
|
8596
8596
|
let s = i.from + (this.state.doc.content.size - t.doc.content.size);
|
|
8597
8597
|
(s > 0 && this.state.doc.nodeAt(s)) == i.node && (r = s);
|
|
8598
8598
|
}
|
|
8599
|
-
this.dragging = new
|
|
8599
|
+
this.dragging = new Au(e.slice, e.move, r < 0 ? void 0 : S.create(this.state.doc, r));
|
|
8600
8600
|
}
|
|
8601
8601
|
someProp(e, t) {
|
|
8602
8602
|
let i = this._props && this._props[e], r;
|
|
@@ -8762,7 +8762,7 @@ class pm {
|
|
|
8762
8762
|
[`transformCopied`](https://prosemirror.net/docs/ref/#view.EditorProps.transformCopied)).
|
|
8763
8763
|
*/
|
|
8764
8764
|
serializeForClipboard(e) {
|
|
8765
|
-
return
|
|
8765
|
+
return To(this, e);
|
|
8766
8766
|
}
|
|
8767
8767
|
/**
|
|
8768
8768
|
Removes the editor from the DOM and destroys all [node
|
|
@@ -9017,13 +9017,13 @@ const zu = (n, e, t) => {
|
|
|
9017
9017
|
let s = r.nodeBefore;
|
|
9018
9018
|
if (Fu(n, r, e, -1))
|
|
9019
9019
|
return !0;
|
|
9020
|
-
if (i.parent.content.size == 0 && (bn(s, "end") ||
|
|
9020
|
+
if (i.parent.content.size == 0 && (bn(s, "end") || S.isSelectable(s)))
|
|
9021
9021
|
for (let o = i.depth; ; o--) {
|
|
9022
9022
|
let a = Dr(n.doc, i.before(o), i.after(o), w.empty);
|
|
9023
9023
|
if (a && a.slice.size < a.to - a.from) {
|
|
9024
9024
|
if (e) {
|
|
9025
9025
|
let l = n.tr.step(a);
|
|
9026
|
-
l.setSelection(bn(s, "end") ? D.findFrom(l.doc.resolve(l.mapping.map(r.pos, -1)), -1) :
|
|
9026
|
+
l.setSelection(bn(s, "end") ? D.findFrom(l.doc.resolve(l.mapping.map(r.pos, -1)), -1) : S.create(l.doc, r.pos - s.nodeSize)), e(l.scrollIntoView());
|
|
9027
9027
|
}
|
|
9028
9028
|
return !0;
|
|
9029
9029
|
}
|
|
@@ -9068,7 +9068,7 @@ function Pu(n, e, t) {
|
|
|
9068
9068
|
return !1;
|
|
9069
9069
|
if (t) {
|
|
9070
9070
|
let u = n.tr.step(c);
|
|
9071
|
-
u.setSelection(
|
|
9071
|
+
u.setSelection(E.create(u.doc, s)), t(u.scrollIntoView());
|
|
9072
9072
|
}
|
|
9073
9073
|
return !0;
|
|
9074
9074
|
}
|
|
@@ -9091,7 +9091,7 @@ const Ru = (n, e, t) => {
|
|
|
9091
9091
|
s = Ro(i);
|
|
9092
9092
|
}
|
|
9093
9093
|
let o = s && s.nodeBefore;
|
|
9094
|
-
return !o || !
|
|
9094
|
+
return !o || !S.isSelectable(o) ? !1 : (e && e(n.tr.setSelection(S.create(n.doc, s.pos - o.nodeSize)).scrollIntoView()), !0);
|
|
9095
9095
|
};
|
|
9096
9096
|
function Ro(n) {
|
|
9097
9097
|
if (!n.parent.type.spec.isolating)
|
|
@@ -9117,12 +9117,12 @@ const Lu = (n, e, t) => {
|
|
|
9117
9117
|
let s = r.nodeAfter;
|
|
9118
9118
|
if (Fu(n, r, e, 1))
|
|
9119
9119
|
return !0;
|
|
9120
|
-
if (i.parent.content.size == 0 && (bn(s, "start") ||
|
|
9120
|
+
if (i.parent.content.size == 0 && (bn(s, "start") || S.isSelectable(s))) {
|
|
9121
9121
|
let o = Dr(n.doc, i.before(), i.after(), w.empty);
|
|
9122
9122
|
if (o && o.slice.size < o.to - o.from) {
|
|
9123
9123
|
if (e) {
|
|
9124
9124
|
let a = n.tr.step(o);
|
|
9125
|
-
a.setSelection(bn(s, "start") ? D.findFrom(a.doc.resolve(a.mapping.map(r.pos)), 1) :
|
|
9125
|
+
a.setSelection(bn(s, "start") ? D.findFrom(a.doc.resolve(a.mapping.map(r.pos)), 1) : S.create(a.doc, a.mapping.map(r.pos))), e(a.scrollIntoView());
|
|
9126
9126
|
}
|
|
9127
9127
|
return !0;
|
|
9128
9128
|
}
|
|
@@ -9138,7 +9138,7 @@ const Lu = (n, e, t) => {
|
|
|
9138
9138
|
s = _o(i);
|
|
9139
9139
|
}
|
|
9140
9140
|
let o = s && s.nodeAfter;
|
|
9141
|
-
return !o || !
|
|
9141
|
+
return !o || !S.isSelectable(o) ? !1 : (e && e(n.tr.setSelection(S.create(n.doc, s.pos)).scrollIntoView()), !0);
|
|
9142
9142
|
};
|
|
9143
9143
|
function _o(n) {
|
|
9144
9144
|
if (!n.parent.type.spec.isolating)
|
|
@@ -9152,7 +9152,7 @@ function _o(n) {
|
|
|
9152
9152
|
return null;
|
|
9153
9153
|
}
|
|
9154
9154
|
const Mm = (n, e) => {
|
|
9155
|
-
let t = n.selection, i = t instanceof
|
|
9155
|
+
let t = n.selection, i = t instanceof S, r;
|
|
9156
9156
|
if (i) {
|
|
9157
9157
|
if (t.node.isTextblock || !Ct(n.doc, t.from))
|
|
9158
9158
|
return !1;
|
|
@@ -9161,19 +9161,19 @@ const Mm = (n, e) => {
|
|
|
9161
9161
|
return !1;
|
|
9162
9162
|
if (e) {
|
|
9163
9163
|
let s = n.tr.join(r);
|
|
9164
|
-
i && s.setSelection(
|
|
9164
|
+
i && s.setSelection(S.create(s.doc, r - n.doc.resolve(r).nodeBefore.nodeSize)), e(s.scrollIntoView());
|
|
9165
9165
|
}
|
|
9166
9166
|
return !0;
|
|
9167
|
-
},
|
|
9167
|
+
}, Am = (n, e) => {
|
|
9168
9168
|
let t = n.selection, i;
|
|
9169
|
-
if (t instanceof
|
|
9169
|
+
if (t instanceof S) {
|
|
9170
9170
|
if (t.node.isTextblock || !Ct(n.doc, t.to))
|
|
9171
9171
|
return !1;
|
|
9172
9172
|
i = t.to;
|
|
9173
9173
|
} else if (i = Or(n.doc, t.to, 1), i == null)
|
|
9174
9174
|
return !1;
|
|
9175
9175
|
return e && e(n.tr.join(i).scrollIntoView()), !0;
|
|
9176
|
-
},
|
|
9176
|
+
}, Tm = (n, e) => {
|
|
9177
9177
|
let { $from: t, $to: i } = n.selection, r = t.blockRange(i), s = r && En(r);
|
|
9178
9178
|
return s == null ? !1 : (e && e(n.tr.lift(r, s).scrollIntoView()), !0);
|
|
9179
9179
|
}, ju = (n, e) => {
|
|
@@ -9210,7 +9210,7 @@ const Om = (n, e) => {
|
|
|
9210
9210
|
return !1;
|
|
9211
9211
|
if (e) {
|
|
9212
9212
|
let o = (!i.parentOffset && r.index() < r.parent.childCount ? i : r).pos, a = n.tr.insert(o, s.createAndFill());
|
|
9213
|
-
a.setSelection(
|
|
9213
|
+
a.setSelection(E.create(a.doc, o + 1)), e(a.scrollIntoView());
|
|
9214
9214
|
}
|
|
9215
9215
|
return !0;
|
|
9216
9216
|
}, Vu = (n, e) => {
|
|
@@ -9228,7 +9228,7 @@ const Om = (n, e) => {
|
|
|
9228
9228
|
function Dm(n) {
|
|
9229
9229
|
return (e, t) => {
|
|
9230
9230
|
let { $from: i, $to: r } = e.selection;
|
|
9231
|
-
if (e.selection instanceof
|
|
9231
|
+
if (e.selection instanceof S && e.selection.node.isBlock)
|
|
9232
9232
|
return !i.parentOffset || !Xe(e.doc, i.pos) ? !1 : (t && t(e.tr.split(i.pos).scrollIntoView()), !0);
|
|
9233
9233
|
if (!i.depth)
|
|
9234
9234
|
return !1;
|
|
@@ -9243,7 +9243,7 @@ function Dm(n) {
|
|
|
9243
9243
|
s.unshift(null);
|
|
9244
9244
|
}
|
|
9245
9245
|
let u = e.tr;
|
|
9246
|
-
(e.selection instanceof
|
|
9246
|
+
(e.selection instanceof E || e.selection instanceof ge) && u.deleteSelection();
|
|
9247
9247
|
let d = u.mapping.map(i.pos), h = Xe(u.doc, d, s.length, s);
|
|
9248
9248
|
if (h || (s[0] = a ? { type: a } : null, h = Xe(u.doc, d, s.length, s)), !h)
|
|
9249
9249
|
return !1;
|
|
@@ -9256,7 +9256,7 @@ function Dm(n) {
|
|
|
9256
9256
|
}
|
|
9257
9257
|
const Nm = Dm(), Im = (n, e) => {
|
|
9258
9258
|
let { $from: t, to: i } = n.selection, r, s = t.sharedDepth(i);
|
|
9259
|
-
return s == 0 ? !1 : (r = t.before(s), e && e(n.tr.setSelection(
|
|
9259
|
+
return s == 0 ? !1 : (r = t.before(s), e && e(n.tr.setSelection(S.create(n.doc, r))), !0);
|
|
9260
9260
|
};
|
|
9261
9261
|
function zm(n, e, t) {
|
|
9262
9262
|
let i = e.nodeBefore, r = e.nodeAfter, s = e.index();
|
|
@@ -9291,8 +9291,8 @@ function Fu(n, e, t, i) {
|
|
|
9291
9291
|
if (p.canReplace(p.childCount, p.childCount, m.content)) {
|
|
9292
9292
|
if (t) {
|
|
9293
9293
|
let b = y.empty;
|
|
9294
|
-
for (let
|
|
9295
|
-
b = y.from(f[
|
|
9294
|
+
for (let x = f.length - 1; x >= 0; x--)
|
|
9295
|
+
b = y.from(f[x].copy(b));
|
|
9296
9296
|
let k = n.tr.step(new J(e.pos - f.length, e.pos + s.nodeSize, e.pos + g, e.pos + s.nodeSize - g, new w(b, f.length, 0), 0, !0));
|
|
9297
9297
|
t(k.scrollIntoView());
|
|
9298
9298
|
}
|
|
@@ -9309,7 +9309,7 @@ function qu(n) {
|
|
|
9309
9309
|
return !1;
|
|
9310
9310
|
s--;
|
|
9311
9311
|
}
|
|
9312
|
-
return r.node(s).isTextblock ? (t && t(e.tr.setSelection(
|
|
9312
|
+
return r.node(s).isTextblock ? (t && t(e.tr.setSelection(E.create(e.doc, n < 0 ? r.start(s) : r.end(s)))), !0) : !1;
|
|
9313
9313
|
};
|
|
9314
9314
|
}
|
|
9315
9315
|
const Pm = qu(-1), Rm = qu(1);
|
|
@@ -9702,10 +9702,10 @@ function Km(n, e) {
|
|
|
9702
9702
|
storage: c.storage,
|
|
9703
9703
|
editor: e
|
|
9704
9704
|
}, h = n.reduce((b, k) => {
|
|
9705
|
-
const
|
|
9705
|
+
const x = v(k, "extendNodeSchema", d);
|
|
9706
9706
|
return {
|
|
9707
9707
|
...b,
|
|
9708
|
-
...
|
|
9708
|
+
...x ? x(c) : {}
|
|
9709
9709
|
};
|
|
9710
9710
|
}, {}), p = Sl({
|
|
9711
9711
|
...h,
|
|
@@ -9837,7 +9837,7 @@ function zi(n) {
|
|
|
9837
9837
|
}), g = {
|
|
9838
9838
|
from: i - (p[0].length - s.length),
|
|
9839
9839
|
to: r
|
|
9840
|
-
}, { commands: b, chain: k, can:
|
|
9840
|
+
}, { commands: b, chain: k, can: x } = new _r({
|
|
9841
9841
|
editor: t,
|
|
9842
9842
|
state: m
|
|
9843
9843
|
});
|
|
@@ -9847,7 +9847,7 @@ function zi(n) {
|
|
|
9847
9847
|
match: p,
|
|
9848
9848
|
commands: b,
|
|
9849
9849
|
chain: k,
|
|
9850
|
-
can:
|
|
9850
|
+
can: x
|
|
9851
9851
|
}) === null || !f.steps.length || (f.setMeta(a, {
|
|
9852
9852
|
transform: f,
|
|
9853
9853
|
from: i,
|
|
@@ -10007,16 +10007,16 @@ function tg(n) {
|
|
|
10007
10007
|
if (!p.isTextblock || p.type.spec.code)
|
|
10008
10008
|
return;
|
|
10009
10009
|
const m = Math.max(i, f), g = Math.min(r, f + p.content.size), b = p.textBetween(m - f, g - f, void 0, "");
|
|
10010
|
-
eg(b, s.find, o).forEach((
|
|
10011
|
-
if (
|
|
10010
|
+
eg(b, s.find, o).forEach((x) => {
|
|
10011
|
+
if (x.index === void 0)
|
|
10012
10012
|
return;
|
|
10013
|
-
const z = m +
|
|
10013
|
+
const z = m + x.index + 1, I = z + x[0].length, C = {
|
|
10014
10014
|
from: t.tr.mapping.map(z),
|
|
10015
10015
|
to: t.tr.mapping.map(I)
|
|
10016
10016
|
}, L = s.handler({
|
|
10017
10017
|
state: t,
|
|
10018
|
-
range:
|
|
10019
|
-
match:
|
|
10018
|
+
range: C,
|
|
10019
|
+
match: x,
|
|
10020
10020
|
commands: l,
|
|
10021
10021
|
chain: c,
|
|
10022
10022
|
can: u,
|
|
@@ -10106,21 +10106,21 @@ function ig(n) {
|
|
|
10106
10106
|
if (k) {
|
|
10107
10107
|
let { text: I } = b;
|
|
10108
10108
|
typeof I == "string" ? I = I : I = jo(y.from(I), p.schema);
|
|
10109
|
-
const { from:
|
|
10109
|
+
const { from: C } = b, L = C + I.length, ie = ng(I);
|
|
10110
10110
|
return l({
|
|
10111
10111
|
rule: u,
|
|
10112
10112
|
state: p,
|
|
10113
|
-
from:
|
|
10113
|
+
from: C,
|
|
10114
10114
|
to: { b: L },
|
|
10115
10115
|
pasteEvt: ie
|
|
10116
10116
|
});
|
|
10117
10117
|
}
|
|
10118
|
-
const
|
|
10119
|
-
if (!(!Zm(
|
|
10118
|
+
const x = h.doc.content.findDiffStart(p.doc.content), z = h.doc.content.findDiffEnd(p.doc.content);
|
|
10119
|
+
if (!(!Zm(x) || !z || x === z.b))
|
|
10120
10120
|
return l({
|
|
10121
10121
|
rule: u,
|
|
10122
10122
|
state: p,
|
|
10123
|
-
from:
|
|
10123
|
+
from: x,
|
|
10124
10124
|
to: z,
|
|
10125
10125
|
pasteEvt: o
|
|
10126
10126
|
});
|
|
@@ -10400,7 +10400,7 @@ const sg = Q.create({
|
|
|
10400
10400
|
const { state: r } = t, s = r.doc.slice(n.from, n.to);
|
|
10401
10401
|
i.deleteRange(n.from, n.to);
|
|
10402
10402
|
const o = i.mapping.map(e);
|
|
10403
|
-
return i.insert(o, s.content), i.setSelection(new
|
|
10403
|
+
return i.insert(o, s.content), i.setSelection(new E(i.doc.resolve(o - 1))), !0;
|
|
10404
10404
|
}, hg = () => ({ tr: n, dispatch: e }) => {
|
|
10405
10405
|
const { selection: t } = n, i = t.$anchor.node();
|
|
10406
10406
|
if (i.content.size > 0)
|
|
@@ -10474,7 +10474,7 @@ const yg = (n, e = {}) => ({ tr: t, state: i, dispatch: r }) => {
|
|
|
10474
10474
|
if (r) {
|
|
10475
10475
|
const d = Fo(l, s, e);
|
|
10476
10476
|
if (d && d.from <= c && d.to >= u) {
|
|
10477
|
-
const h =
|
|
10477
|
+
const h = E.create(o, d.from, d.to);
|
|
10478
10478
|
t.setSelection(h);
|
|
10479
10479
|
}
|
|
10480
10480
|
}
|
|
@@ -10487,7 +10487,7 @@ const yg = (n, e = {}) => ({ tr: t, state: i, dispatch: r }) => {
|
|
|
10487
10487
|
return !1;
|
|
10488
10488
|
};
|
|
10489
10489
|
function Gu(n) {
|
|
10490
|
-
return n instanceof
|
|
10490
|
+
return n instanceof E;
|
|
10491
10491
|
}
|
|
10492
10492
|
function It(n = 0, e = 0, t = 0) {
|
|
10493
10493
|
return Math.min(Math.max(n, e), t);
|
|
@@ -10501,7 +10501,7 @@ function Yu(n, e = null) {
|
|
|
10501
10501
|
if (e === "end")
|
|
10502
10502
|
return i;
|
|
10503
10503
|
const r = t.from, s = i.to;
|
|
10504
|
-
return e === "all" ?
|
|
10504
|
+
return e === "all" ? E.create(n, It(0, r, s), It(n.content.size, r, s)) : E.create(n, It(e, r, s), It(e, r, s));
|
|
10505
10505
|
}
|
|
10506
10506
|
function kg() {
|
|
10507
10507
|
return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
|
|
@@ -10657,7 +10657,7 @@ const Eg = (n) => !("type" in n), Mg = (n, e, t) => ({ tr: i, dispatch: r, edito
|
|
|
10657
10657
|
t.updateSelection && Cg(i, i.steps.length - 1, -1), t.applyInputRules && i.setMeta("applyInputRules", { from: l, text: p }), t.applyPasteRules && i.setMeta("applyPasteRules", { from: l, text: p });
|
|
10658
10658
|
}
|
|
10659
10659
|
return !0;
|
|
10660
|
-
},
|
|
10660
|
+
}, Ag = () => ({ state: n, dispatch: e }) => Mm(n, e), Tg = () => ({ state: n, dispatch: e }) => Am(n, e), Og = () => ({ state: n, dispatch: e }) => zu(n, e), Dg = () => ({ state: n, dispatch: e }) => Lu(n, e), Ng = () => ({ state: n, dispatch: e, tr: t }) => {
|
|
10661
10661
|
try {
|
|
10662
10662
|
const i = Or(n.doc, n.selection.$from.pos, -1);
|
|
10663
10663
|
return i == null ? !1 : (t.join(i, 2), e && e(t), !0);
|
|
@@ -10731,7 +10731,7 @@ function ri(n, e, t = {}) {
|
|
|
10731
10731
|
}
|
|
10732
10732
|
const Lg = (n, e = {}) => ({ state: t, dispatch: i }) => {
|
|
10733
10733
|
const r = X(n, t.schema);
|
|
10734
|
-
return ri(t, r, e) ?
|
|
10734
|
+
return ri(t, r, e) ? Tm(t, i) : !1;
|
|
10735
10735
|
}, Bg = () => ({ state: n, dispatch: e }) => Vu(n, e), jg = (n) => ({ state: e, dispatch: t }) => {
|
|
10736
10736
|
const i = X(n, e.schema);
|
|
10737
10737
|
return $m(i)(e, t);
|
|
@@ -10848,8 +10848,8 @@ function Ys(n, e, t = {}) {
|
|
|
10848
10848
|
n.doc.nodesBetween(p, f, (m, g) => {
|
|
10849
10849
|
if (!m.isText && !m.marks.length)
|
|
10850
10850
|
return;
|
|
10851
|
-
const b = Math.max(p, g), k = Math.min(f, g + m.nodeSize),
|
|
10852
|
-
o +=
|
|
10851
|
+
const b = Math.max(p, g), k = Math.min(f, g + m.nodeSize), x = k - b;
|
|
10852
|
+
o += x, a.push(...m.marks.map((z) => ({
|
|
10853
10853
|
mark: z,
|
|
10854
10854
|
from: b,
|
|
10855
10855
|
to: k
|
|
@@ -10866,7 +10866,7 @@ function eb(n, e, t = {}) {
|
|
|
10866
10866
|
const i = jr(e, n.schema);
|
|
10867
10867
|
return i === "node" ? ri(n, e, t) : i === "mark" ? Ys(n, e, t) : !1;
|
|
10868
10868
|
}
|
|
10869
|
-
function
|
|
10869
|
+
function Al(n, e) {
|
|
10870
10870
|
const { nodeExtensions: t } = Lr(e), i = t.find((o) => o.name === n);
|
|
10871
10871
|
if (!i)
|
|
10872
10872
|
return !1;
|
|
@@ -10950,13 +10950,13 @@ const nb = (n, e = {}) => ({ tr: t, state: i, dispatch: r }) => {
|
|
|
10950
10950
|
return t.selection.$anchor.sameParent(t.selection.$head) && (o = t.selection.$anchor.parent.attrs), s.isTextblock ? r().command(({ commands: a }) => vl(s, { ...o, ...e })(t) ? !0 : a.clearNodes()).command(({ state: a }) => vl(s, { ...o, ...e })(a, i)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
|
|
10951
10951
|
}, sb = (n) => ({ tr: e, dispatch: t }) => {
|
|
10952
10952
|
if (t) {
|
|
10953
|
-
const { doc: i } = e, r = It(n, 0, i.content.size), s =
|
|
10953
|
+
const { doc: i } = e, r = It(n, 0, i.content.size), s = S.create(i, r);
|
|
10954
10954
|
e.setSelection(s);
|
|
10955
10955
|
}
|
|
10956
10956
|
return !0;
|
|
10957
10957
|
}, ob = (n) => ({ tr: e, dispatch: t }) => {
|
|
10958
10958
|
if (t) {
|
|
10959
|
-
const { doc: i } = e, { from: r, to: s } = typeof n == "number" ? { from: n, to: n } : n, o =
|
|
10959
|
+
const { doc: i } = e, { from: r, to: s } = typeof n == "number" ? { from: n, to: n } : n, o = E.atStart(i).from, a = E.atEnd(i).to, l = It(r, o, a), c = It(s, o, a), u = E.create(i, l, c);
|
|
10960
10960
|
e.setSelection(u);
|
|
10961
10961
|
}
|
|
10962
10962
|
return !0;
|
|
@@ -10964,7 +10964,7 @@ const nb = (n, e = {}) => ({ tr: t, state: i, dispatch: r }) => {
|
|
|
10964
10964
|
const i = X(n, e.schema);
|
|
10965
10965
|
return qm(i)(e, t);
|
|
10966
10966
|
};
|
|
10967
|
-
function
|
|
10967
|
+
function Tl(n, e) {
|
|
10968
10968
|
const t = n.storedMarks || n.selection.$to.parentOffset && n.selection.$from.marks();
|
|
10969
10969
|
if (t) {
|
|
10970
10970
|
const i = t.filter((r) => e == null ? void 0 : e.includes(r.type.name));
|
|
@@ -10973,8 +10973,8 @@ function Al(n, e) {
|
|
|
10973
10973
|
}
|
|
10974
10974
|
const lb = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, editor: r }) => {
|
|
10975
10975
|
const { selection: s, doc: o } = e, { $from: a, $to: l } = s, c = r.extensionManager.attributes, u = Hi(c, a.node().type.name, a.node().attrs);
|
|
10976
|
-
if (s instanceof
|
|
10977
|
-
return !a.parentOffset || !Xe(o, a.pos) ? !1 : (i && (n &&
|
|
10976
|
+
if (s instanceof S && s.node.isBlock)
|
|
10977
|
+
return !a.parentOffset || !Xe(o, a.pos) ? !1 : (i && (n && Tl(t, r.extensionManager.splittableMarks), e.split(a.pos).scrollIntoView()), !0);
|
|
10978
10978
|
if (!a.parent.isBlock)
|
|
10979
10979
|
return !1;
|
|
10980
10980
|
const d = l.parentOffset === l.parent.content.size, h = a.depth === 0 ? void 0 : Yg(a.node(-1).contentMatchAt(a.indexAfter(-1)));
|
|
@@ -10990,11 +10990,11 @@ const lb = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, edit
|
|
|
10990
10990
|
attrs: u
|
|
10991
10991
|
}
|
|
10992
10992
|
] : void 0), i) {
|
|
10993
|
-
if (f && (s instanceof
|
|
10993
|
+
if (f && (s instanceof E && e.deleteSelection(), e.split(e.mapping.map(a.pos), 1, p), h && !d && !a.parentOffset && a.parent.type !== h)) {
|
|
10994
10994
|
const m = e.mapping.map(a.before()), g = e.doc.resolve(m);
|
|
10995
10995
|
a.node(-1).canReplaceWith(g.index(), g.index() + 1, h) && e.setNodeMarkup(e.mapping.map(a.before()), h);
|
|
10996
10996
|
}
|
|
10997
|
-
n &&
|
|
10997
|
+
n && Tl(t, r.extensionManager.splittableMarks), e.scrollIntoView();
|
|
10998
10998
|
}
|
|
10999
10999
|
return f;
|
|
11000
11000
|
}, cb = (n, e = {}) => ({ tr: t, state: i, dispatch: r, editor: s }) => {
|
|
@@ -11014,19 +11014,19 @@ const lb = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, edit
|
|
|
11014
11014
|
const k = l.index(-1) ? 1 : l.index(-2) ? 2 : 3;
|
|
11015
11015
|
for (let ie = l.depth - k; ie >= l.depth - 3; ie -= 1)
|
|
11016
11016
|
b = y.from(l.node(ie).copy(b));
|
|
11017
|
-
const
|
|
11017
|
+
const x = l.indexAfter(-1) < l.node(-2).childCount ? 1 : l.indexAfter(-2) < l.node(-3).childCount ? 2 : 3, z = {
|
|
11018
11018
|
...Hi(h, l.node().type.name, l.node().attrs),
|
|
11019
11019
|
...e
|
|
11020
11020
|
}, I = ((o = a.contentMatch.defaultType) === null || o === void 0 ? void 0 : o.createAndFill(z)) || void 0;
|
|
11021
11021
|
b = b.append(y.from(a.createAndFill(null, I) || void 0));
|
|
11022
|
-
const
|
|
11023
|
-
t.replace(
|
|
11022
|
+
const C = l.before(l.depth - (k - 1));
|
|
11023
|
+
t.replace(C, l.after(-x), new w(b, 4 - k, 0));
|
|
11024
11024
|
let L = -1;
|
|
11025
|
-
t.doc.nodesBetween(
|
|
11025
|
+
t.doc.nodesBetween(C, t.doc.content.size, (ie, A) => {
|
|
11026
11026
|
if (L > -1)
|
|
11027
11027
|
return !1;
|
|
11028
|
-
ie.isTextblock && ie.content.size === 0 && (L =
|
|
11029
|
-
}), L > -1 && t.setSelection(
|
|
11028
|
+
ie.isTextblock && ie.content.size === 0 && (L = A + 1);
|
|
11029
|
+
}), L > -1 && t.setSelection(E.near(t.doc.resolve(L))), t.scrollIntoView();
|
|
11030
11030
|
}
|
|
11031
11031
|
return !0;
|
|
11032
11032
|
}
|
|
@@ -11045,10 +11045,10 @@ const lb = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, edit
|
|
|
11045
11045
|
if (!Xe(t.doc, l.pos, 2))
|
|
11046
11046
|
return !1;
|
|
11047
11047
|
if (r) {
|
|
11048
|
-
const { selection: b, storedMarks: k } = i, { splittableMarks:
|
|
11048
|
+
const { selection: b, storedMarks: k } = i, { splittableMarks: x } = s.extensionManager, z = k || b.$to.parentOffset && b.$from.marks();
|
|
11049
11049
|
if (t.split(l.pos, 2, g).scrollIntoView(), !z || !r)
|
|
11050
11050
|
return !0;
|
|
11051
|
-
const I = z.filter((
|
|
11051
|
+
const I = z.filter((C) => x.includes(C.type.name));
|
|
11052
11052
|
t.ensureMarks(I);
|
|
11053
11053
|
}
|
|
11054
11054
|
return !0;
|
|
@@ -11071,19 +11071,19 @@ const lb = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, edit
|
|
|
11071
11071
|
const r = n.doc.nodeAt(i);
|
|
11072
11072
|
return t.node.type === (r == null ? void 0 : r.type) && Ct(n.doc, i) && n.join(i), !0;
|
|
11073
11073
|
}, ub = (n, e, t, i = {}) => ({ editor: r, tr: s, state: o, dispatch: a, chain: l, commands: c, can: u }) => {
|
|
11074
|
-
const { extensions: d, splittableMarks: h } = r.extensionManager, p = X(n, o.schema), f = X(e, o.schema), { selection: m, storedMarks: g } = o, { $from: b, $to: k } = m,
|
|
11075
|
-
if (!
|
|
11074
|
+
const { extensions: d, splittableMarks: h } = r.extensionManager, p = X(n, o.schema), f = X(e, o.schema), { selection: m, storedMarks: g } = o, { $from: b, $to: k } = m, x = b.blockRange(k), z = g || m.$to.parentOffset && m.$from.marks();
|
|
11075
|
+
if (!x)
|
|
11076
11076
|
return !1;
|
|
11077
|
-
const I = Uo((
|
|
11078
|
-
if (
|
|
11077
|
+
const I = Uo((C) => Al(C.type.name, d))(m);
|
|
11078
|
+
if (x.depth >= 1 && I && x.depth - I.depth <= 1) {
|
|
11079
11079
|
if (I.node.type === p)
|
|
11080
11080
|
return c.liftListItem(f);
|
|
11081
|
-
if (
|
|
11081
|
+
if (Al(I.node.type.name, d) && p.validContent(I.node.content) && a)
|
|
11082
11082
|
return l().command(() => (s.setNodeMarkup(I.pos, p), !0)).command(() => fs(s, p)).command(() => ms(s, p)).run();
|
|
11083
11083
|
}
|
|
11084
11084
|
return !t || !z || !a ? l().command(() => u().wrapInList(p, i) ? !0 : c.clearNodes()).wrapInList(p, i).command(() => fs(s, p)).command(() => ms(s, p)).run() : l().command(() => {
|
|
11085
|
-
const
|
|
11086
|
-
return s.ensureMarks(L),
|
|
11085
|
+
const C = u().wrapInList(p, i), L = z.filter((ie) => h.includes(ie.type.name));
|
|
11086
|
+
return s.ensureMarks(L), C ? !0 : c.clearNodes();
|
|
11087
11087
|
}).wrapInList(p, i).command(() => fs(s, p)).command(() => ms(s, p)).run();
|
|
11088
11088
|
}, db = (n, e = {}, t = {}) => ({ state: i, commands: r }) => {
|
|
11089
11089
|
const { extendEmptyMarkRange: s = !1 } = t, o = Mt(n, i.schema);
|
|
@@ -11148,8 +11148,8 @@ const lb = ({ keepMarks: n = !0 } = {}) => ({ tr: e, state: t, dispatch: i, edit
|
|
|
11148
11148
|
...e
|
|
11149
11149
|
}), o && m.marks.length && m.marks.forEach((b) => {
|
|
11150
11150
|
if (o === b.type) {
|
|
11151
|
-
const k = Math.max(g, c),
|
|
11152
|
-
t.addMark(k,
|
|
11151
|
+
const k = Math.max(g, c), x = Math.min(g + m.nodeSize, u);
|
|
11152
|
+
t.addMark(k, x, o.create({
|
|
11153
11153
|
...b.attrs,
|
|
11154
11154
|
...e
|
|
11155
11155
|
}));
|
|
@@ -11193,13 +11193,13 @@ var kb = /* @__PURE__ */ Object.freeze({
|
|
|
11193
11193
|
insertContent: Sg,
|
|
11194
11194
|
insertContentAt: Mg,
|
|
11195
11195
|
joinBackward: Og,
|
|
11196
|
-
joinDown:
|
|
11196
|
+
joinDown: Tg,
|
|
11197
11197
|
joinForward: Dg,
|
|
11198
11198
|
joinItemBackward: Ng,
|
|
11199
11199
|
joinItemForward: Ig,
|
|
11200
11200
|
joinTextblockBackward: zg,
|
|
11201
11201
|
joinTextblockForward: Pg,
|
|
11202
|
-
joinUp:
|
|
11202
|
+
joinUp: Ag,
|
|
11203
11203
|
keyboardShortcut: _g,
|
|
11204
11204
|
lift: Lg,
|
|
11205
11205
|
liftEmptyBlock: Bg,
|
|
@@ -11373,7 +11373,7 @@ const vb = Q.create({
|
|
|
11373
11373
|
})
|
|
11374
11374
|
];
|
|
11375
11375
|
}
|
|
11376
|
-
}),
|
|
11376
|
+
}), Ab = Q.create({
|
|
11377
11377
|
name: "paste",
|
|
11378
11378
|
addProseMirrorPlugins() {
|
|
11379
11379
|
return [
|
|
@@ -11391,7 +11391,7 @@ const vb = Q.create({
|
|
|
11391
11391
|
})
|
|
11392
11392
|
];
|
|
11393
11393
|
}
|
|
11394
|
-
}),
|
|
11394
|
+
}), Tb = Q.create({
|
|
11395
11395
|
name: "tabindex",
|
|
11396
11396
|
addProseMirrorPlugins() {
|
|
11397
11397
|
return [
|
|
@@ -11404,7 +11404,7 @@ const vb = Q.create({
|
|
|
11404
11404
|
];
|
|
11405
11405
|
}
|
|
11406
11406
|
});
|
|
11407
|
-
class
|
|
11407
|
+
class Tt {
|
|
11408
11408
|
get name() {
|
|
11409
11409
|
return this.node.type.name;
|
|
11410
11410
|
}
|
|
@@ -11463,15 +11463,15 @@ class At {
|
|
|
11463
11463
|
if (this.depth === 0)
|
|
11464
11464
|
return null;
|
|
11465
11465
|
const e = this.resolvedPos.start(this.resolvedPos.depth - 1), t = this.resolvedPos.doc.resolve(e);
|
|
11466
|
-
return new
|
|
11466
|
+
return new Tt(t, this.editor);
|
|
11467
11467
|
}
|
|
11468
11468
|
get before() {
|
|
11469
11469
|
let e = this.resolvedPos.doc.resolve(this.from - (this.isBlock ? 1 : 2));
|
|
11470
|
-
return e.depth !== this.depth && (e = this.resolvedPos.doc.resolve(this.from - 3)), new
|
|
11470
|
+
return e.depth !== this.depth && (e = this.resolvedPos.doc.resolve(this.from - 3)), new Tt(e, this.editor);
|
|
11471
11471
|
}
|
|
11472
11472
|
get after() {
|
|
11473
11473
|
let e = this.resolvedPos.doc.resolve(this.to + (this.isBlock ? 2 : 1));
|
|
11474
|
-
return e.depth !== this.depth && (e = this.resolvedPos.doc.resolve(this.to + 3)), new
|
|
11474
|
+
return e.depth !== this.depth && (e = this.resolvedPos.doc.resolve(this.to + 3)), new Tt(e, this.editor);
|
|
11475
11475
|
}
|
|
11476
11476
|
get children() {
|
|
11477
11477
|
const e = [];
|
|
@@ -11479,8 +11479,8 @@ class At {
|
|
|
11479
11479
|
const r = t.isBlock && !t.isTextblock, s = t.isAtom && !t.isText, o = this.pos + i + (s ? 0 : 1), a = this.resolvedPos.doc.resolve(o);
|
|
11480
11480
|
if (!r && a.depth <= this.depth)
|
|
11481
11481
|
return;
|
|
11482
|
-
const l = new
|
|
11483
|
-
r && (l.actualDepth = this.depth + 1), e.push(new
|
|
11482
|
+
const l = new Tt(a, this.editor, r, r ? t : null);
|
|
11483
|
+
r && (l.actualDepth = this.depth + 1), e.push(new Tt(a, this.editor, r, r ? t : null));
|
|
11484
11484
|
}), e;
|
|
11485
11485
|
}
|
|
11486
11486
|
get firstChild() {
|
|
@@ -11747,9 +11747,9 @@ class Nb extends Um {
|
|
|
11747
11747
|
vb,
|
|
11748
11748
|
Eb,
|
|
11749
11749
|
Mb,
|
|
11750
|
-
|
|
11750
|
+
Tb,
|
|
11751
11751
|
xb,
|
|
11752
|
-
|
|
11752
|
+
Ab
|
|
11753
11753
|
].filter((s) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[s.name] !== !1 : !0) : [], ...this.options.extensions].filter((s) => ["extension", "node", "mark"].includes(s == null ? void 0 : s.type));
|
|
11754
11754
|
this.extensionManager = new nn(r, this);
|
|
11755
11755
|
}
|
|
@@ -11949,7 +11949,7 @@ class Nb extends Um {
|
|
|
11949
11949
|
}
|
|
11950
11950
|
$pos(e) {
|
|
11951
11951
|
const t = this.state.doc.resolve(e);
|
|
11952
|
-
return new
|
|
11952
|
+
return new Tt(t, this);
|
|
11953
11953
|
}
|
|
11954
11954
|
get $doc() {
|
|
11955
11955
|
return this.$pos(0);
|
|
@@ -12745,7 +12745,7 @@ let qr = class {
|
|
|
12745
12745
|
const Mn = (n) => new qr(n), by = (n) => n.pos !== n.arr.length, yy = (n, e) => {
|
|
12746
12746
|
const t = new Uint8Array(n.arr.buffer, n.pos + n.arr.byteOffset, e);
|
|
12747
12747
|
return n.pos += e, t;
|
|
12748
|
-
}, ve = (n) => yy(n,
|
|
12748
|
+
}, ve = (n) => yy(n, T(n)), wn = (n) => n.arr[n.pos++], T = (n) => {
|
|
12749
12749
|
let e = 0, t = 1;
|
|
12750
12750
|
const i = n.arr.length;
|
|
12751
12751
|
for (; n.pos < i; ) {
|
|
@@ -12770,7 +12770,7 @@ const Mn = (n) => new qr(n), by = (n) => n.pos !== n.arr.length, yy = (n, e) =>
|
|
|
12770
12770
|
}
|
|
12771
12771
|
throw cd;
|
|
12772
12772
|
}, wy = (n) => {
|
|
12773
|
-
let e =
|
|
12773
|
+
let e = T(n);
|
|
12774
12774
|
if (e === 0)
|
|
12775
12775
|
return "";
|
|
12776
12776
|
{
|
|
@@ -12819,7 +12819,7 @@ const Mn = (n) => new qr(n), by = (n) => n.pos !== n.arr.length, yy = (n, e) =>
|
|
|
12819
12819
|
ln,
|
|
12820
12820
|
// CASE 119: string
|
|
12821
12821
|
(n) => {
|
|
12822
|
-
const e =
|
|
12822
|
+
const e = T(n), t = {};
|
|
12823
12823
|
for (let i = 0; i < e; i++) {
|
|
12824
12824
|
const r = ln(n);
|
|
12825
12825
|
t[r] = ai(n);
|
|
@@ -12827,7 +12827,7 @@ const Mn = (n) => new qr(n), by = (n) => n.pos !== n.arr.length, yy = (n, e) =>
|
|
|
12827
12827
|
return t;
|
|
12828
12828
|
},
|
|
12829
12829
|
(n) => {
|
|
12830
|
-
const e =
|
|
12830
|
+
const e = T(n), t = [];
|
|
12831
12831
|
for (let i = 0; i < e; i++)
|
|
12832
12832
|
t.push(ai(n));
|
|
12833
12833
|
return t;
|
|
@@ -12844,7 +12844,7 @@ class Bl extends qr {
|
|
|
12844
12844
|
super(e), this.reader = t, this.s = null, this.count = 0;
|
|
12845
12845
|
}
|
|
12846
12846
|
read() {
|
|
12847
|
-
return this.count === 0 && (this.s = this.reader(this), by(this) ? this.count =
|
|
12847
|
+
return this.count === 0 && (this.s = this.reader(this), by(this) ? this.count = T(this) + 1 : this.count = -1), this.count--, /** @type {T} */
|
|
12848
12848
|
this.s;
|
|
12849
12849
|
}
|
|
12850
12850
|
}
|
|
@@ -12859,7 +12859,7 @@ class Gi extends qr {
|
|
|
12859
12859
|
if (this.count === 0) {
|
|
12860
12860
|
this.s = Ko(this);
|
|
12861
12861
|
const e = ad(this.s);
|
|
12862
|
-
this.count = 1, e && (this.s = -this.s, this.count =
|
|
12862
|
+
this.count = 1, e && (this.s = -this.s, this.count = T(this) + 2);
|
|
12863
12863
|
}
|
|
12864
12864
|
return this.count--, /** @type {number} */
|
|
12865
12865
|
this.s;
|
|
@@ -12878,7 +12878,7 @@ class xs extends qr {
|
|
|
12878
12878
|
read() {
|
|
12879
12879
|
if (this.count === 0) {
|
|
12880
12880
|
const e = Ko(this), t = e & 1;
|
|
12881
|
-
this.diff = nt(e / 2), this.count = 1, t && (this.count =
|
|
12881
|
+
this.diff = nt(e / 2), this.count = 1, t && (this.count = T(this) + 2);
|
|
12882
12882
|
}
|
|
12883
12883
|
return this.s += this.diff, this.count--, this.s;
|
|
12884
12884
|
}
|
|
@@ -12898,7 +12898,7 @@ class Ey {
|
|
|
12898
12898
|
return this.spos = e, t;
|
|
12899
12899
|
}
|
|
12900
12900
|
}
|
|
12901
|
-
const My = crypto.getRandomValues.bind(crypto),
|
|
12901
|
+
const My = crypto.getRandomValues.bind(crypto), Ay = Math.random, dd = () => My(new Uint32Array(1))[0], Ty = (n) => n[nt(Ay() * n.length)], Oy = "10000000-1000-4000-8000" + -1e11, Dy = () => Oy.replace(
|
|
12902
12902
|
/[018]/g,
|
|
12903
12903
|
/** @param {number} c */
|
|
12904
12904
|
(n) => (n ^ dd() & 15 >> n / 4).toString(16)
|
|
@@ -13101,7 +13101,7 @@ class Zo {
|
|
|
13101
13101
|
this.clock = e, this.len = t;
|
|
13102
13102
|
}
|
|
13103
13103
|
}
|
|
13104
|
-
class
|
|
13104
|
+
class An {
|
|
13105
13105
|
constructor() {
|
|
13106
13106
|
this.clients = /* @__PURE__ */ new Map();
|
|
13107
13107
|
}
|
|
@@ -13128,7 +13128,7 @@ const xt = (n, e, t) => e.clients.forEach((i, r) => {
|
|
|
13128
13128
|
i = r - 1;
|
|
13129
13129
|
}
|
|
13130
13130
|
return null;
|
|
13131
|
-
},
|
|
13131
|
+
}, Tn = (n, e) => {
|
|
13132
13132
|
const t = n.clients.get(e.client);
|
|
13133
13133
|
return t !== void 0 && pw(t, e.clock) !== null;
|
|
13134
13134
|
}, ea = (n) => {
|
|
@@ -13142,7 +13142,7 @@ const xt = (n, e, t) => e.clients.forEach((i, r) => {
|
|
|
13142
13142
|
e.length = i;
|
|
13143
13143
|
});
|
|
13144
13144
|
}, ro = (n) => {
|
|
13145
|
-
const e = new
|
|
13145
|
+
const e = new An();
|
|
13146
13146
|
for (let t = 0; t < n.length; t++)
|
|
13147
13147
|
n[t].clients.forEach((i, r) => {
|
|
13148
13148
|
if (!e.clients.has(r)) {
|
|
@@ -13158,7 +13158,7 @@ const xt = (n, e, t) => e.clients.forEach((i, r) => {
|
|
|
13158
13158
|
/** @type {Array<DeleteItem>} */
|
|
13159
13159
|
[]
|
|
13160
13160
|
)).push(new Zo(t, i));
|
|
13161
|
-
}, Ed = () => new
|
|
13161
|
+
}, Ed = () => new An(), Md = (n) => {
|
|
13162
13162
|
const e = Ed();
|
|
13163
13163
|
return n.clients.forEach((t, i) => {
|
|
13164
13164
|
const r = [];
|
|
@@ -13186,10 +13186,10 @@ const xt = (n, e, t) => e.clients.forEach((i, r) => {
|
|
|
13186
13186
|
}
|
|
13187
13187
|
});
|
|
13188
13188
|
}, ta = (n) => {
|
|
13189
|
-
const e = new
|
|
13189
|
+
const e = new An(), t = T(n.restDecoder);
|
|
13190
13190
|
for (let i = 0; i < t; i++) {
|
|
13191
13191
|
n.resetDsCurVal();
|
|
13192
|
-
const r =
|
|
13192
|
+
const r = T(n.restDecoder), s = T(n.restDecoder);
|
|
13193
13193
|
if (s > 0) {
|
|
13194
13194
|
const o = We(e.clients, r, () => (
|
|
13195
13195
|
/** @type {Array<DeleteItem>} */
|
|
@@ -13201,10 +13201,10 @@ const xt = (n, e, t) => e.clients.forEach((i, r) => {
|
|
|
13201
13201
|
}
|
|
13202
13202
|
return e;
|
|
13203
13203
|
}, Fl = (n, e, t) => {
|
|
13204
|
-
const i = new
|
|
13204
|
+
const i = new An(), r = T(n.restDecoder);
|
|
13205
13205
|
for (let s = 0; s < r; s++) {
|
|
13206
13206
|
n.resetDsCurVal();
|
|
13207
|
-
const o =
|
|
13207
|
+
const o = T(n.restDecoder), a = T(n.restDecoder), l = t.clients.get(o) || [], c = $(t, o);
|
|
13208
13208
|
for (let u = 0; u < a; u++) {
|
|
13209
13209
|
const d = n.readDsClock(), h = d + n.readDsLen();
|
|
13210
13210
|
if (d < c) {
|
|
@@ -13221,13 +13221,13 @@ const xt = (n, e, t) => e.clients.forEach((i, r) => {
|
|
|
13221
13221
|
return O(s.restEncoder, 0), On(s, i), s.toUint8Array();
|
|
13222
13222
|
}
|
|
13223
13223
|
return null;
|
|
13224
|
-
},
|
|
13224
|
+
}, Ad = dd;
|
|
13225
13225
|
class rt extends od {
|
|
13226
13226
|
/**
|
|
13227
13227
|
* @param {DocOpts} opts configuration
|
|
13228
13228
|
*/
|
|
13229
13229
|
constructor({ guid: e = Dy(), collectionid: t = null, gc: i = !0, gcFilter: r = () => !0, meta: s = null, autoLoad: o = !1, shouldLoad: a = !0 } = {}) {
|
|
13230
|
-
super(), this.gc = i, this.gcFilter = r, this.clientID =
|
|
13230
|
+
super(), this.gc = i, this.gcFilter = r, this.clientID = Ad(), this.guid = e, this.collectionid = t, this.share = /* @__PURE__ */ new Map(), this.store = new _d(), this._transaction = null, this._transactionCleanups = [], this.subdocs = /* @__PURE__ */ new Set(), this._item = null, this.shouldLoad = a, this.autoLoad = o, this.meta = s, this.isLoaded = !1, this.isSynced = !1, this.isDestroyed = !1, this.whenLoaded = jl((c) => {
|
|
13231
13231
|
this.on("load", () => {
|
|
13232
13232
|
this.isLoaded = !0, c(this);
|
|
13233
13233
|
});
|
|
@@ -13435,7 +13435,7 @@ class rt extends od {
|
|
|
13435
13435
|
this.emit("destroyed", [!0]), this.emit("destroy", [this]), super.destroy();
|
|
13436
13436
|
}
|
|
13437
13437
|
}
|
|
13438
|
-
class
|
|
13438
|
+
class Td {
|
|
13439
13439
|
/**
|
|
13440
13440
|
* @param {decoding.Decoder} decoder
|
|
13441
13441
|
*/
|
|
@@ -13448,34 +13448,34 @@ class Ad {
|
|
|
13448
13448
|
* @return {number}
|
|
13449
13449
|
*/
|
|
13450
13450
|
readDsClock() {
|
|
13451
|
-
return
|
|
13451
|
+
return T(this.restDecoder);
|
|
13452
13452
|
}
|
|
13453
13453
|
/**
|
|
13454
13454
|
* @return {number}
|
|
13455
13455
|
*/
|
|
13456
13456
|
readDsLen() {
|
|
13457
|
-
return
|
|
13457
|
+
return T(this.restDecoder);
|
|
13458
13458
|
}
|
|
13459
13459
|
}
|
|
13460
|
-
class Od extends
|
|
13460
|
+
class Od extends Td {
|
|
13461
13461
|
/**
|
|
13462
13462
|
* @return {ID}
|
|
13463
13463
|
*/
|
|
13464
13464
|
readLeftID() {
|
|
13465
|
-
return
|
|
13465
|
+
return M(T(this.restDecoder), T(this.restDecoder));
|
|
13466
13466
|
}
|
|
13467
13467
|
/**
|
|
13468
13468
|
* @return {ID}
|
|
13469
13469
|
*/
|
|
13470
13470
|
readRightID() {
|
|
13471
|
-
return
|
|
13471
|
+
return M(T(this.restDecoder), T(this.restDecoder));
|
|
13472
13472
|
}
|
|
13473
13473
|
/**
|
|
13474
13474
|
* Read the next client id.
|
|
13475
13475
|
* Use this in favor of readID whenever possible to reduce the number of objects created.
|
|
13476
13476
|
*/
|
|
13477
13477
|
readClient() {
|
|
13478
|
-
return
|
|
13478
|
+
return T(this.restDecoder);
|
|
13479
13479
|
}
|
|
13480
13480
|
/**
|
|
13481
13481
|
* @return {number} info An unsigned 8-bit integer
|
|
@@ -13493,13 +13493,13 @@ class Od extends Ad {
|
|
|
13493
13493
|
* @return {boolean} isKey
|
|
13494
13494
|
*/
|
|
13495
13495
|
readParentInfo() {
|
|
13496
|
-
return
|
|
13496
|
+
return T(this.restDecoder) === 1;
|
|
13497
13497
|
}
|
|
13498
13498
|
/**
|
|
13499
13499
|
* @return {number} info An unsigned 8-bit integer
|
|
13500
13500
|
*/
|
|
13501
13501
|
readTypeRef() {
|
|
13502
|
-
return
|
|
13502
|
+
return T(this.restDecoder);
|
|
13503
13503
|
}
|
|
13504
13504
|
/**
|
|
13505
13505
|
* Write len of a struct - well suited for Opt RLE encoder.
|
|
@@ -13507,7 +13507,7 @@ class Od extends Ad {
|
|
|
13507
13507
|
* @return {number} len
|
|
13508
13508
|
*/
|
|
13509
13509
|
readLen() {
|
|
13510
|
-
return
|
|
13510
|
+
return T(this.restDecoder);
|
|
13511
13511
|
}
|
|
13512
13512
|
/**
|
|
13513
13513
|
* @return {any}
|
|
@@ -13550,13 +13550,13 @@ class fw {
|
|
|
13550
13550
|
* @return {number}
|
|
13551
13551
|
*/
|
|
13552
13552
|
readDsClock() {
|
|
13553
|
-
return this.dsCurrVal +=
|
|
13553
|
+
return this.dsCurrVal += T(this.restDecoder), this.dsCurrVal;
|
|
13554
13554
|
}
|
|
13555
13555
|
/**
|
|
13556
13556
|
* @return {number}
|
|
13557
13557
|
*/
|
|
13558
13558
|
readDsLen() {
|
|
13559
|
-
const e =
|
|
13559
|
+
const e = T(this.restDecoder) + 1;
|
|
13560
13560
|
return this.dsCurrVal += e, e;
|
|
13561
13561
|
}
|
|
13562
13562
|
}
|
|
@@ -13565,7 +13565,7 @@ class vn extends fw {
|
|
|
13565
13565
|
* @param {decoding.Decoder} decoder
|
|
13566
13566
|
*/
|
|
13567
13567
|
constructor(e) {
|
|
13568
|
-
super(e), this.keys = [],
|
|
13568
|
+
super(e), this.keys = [], T(e), this.keyClockDecoder = new xs(ve(e)), this.clientDecoder = new Gi(ve(e)), this.leftClockDecoder = new xs(ve(e)), this.rightClockDecoder = new xs(ve(e)), this.infoDecoder = new Bl(ve(e), wn), this.stringDecoder = new Ey(ve(e)), this.parentInfoDecoder = new Bl(ve(e), wn), this.typeRefDecoder = new Gi(ve(e)), this.lenDecoder = new Gi(ve(e));
|
|
13569
13569
|
}
|
|
13570
13570
|
/**
|
|
13571
13571
|
* @return {ID}
|
|
@@ -13896,27 +13896,27 @@ const mw = (n, e, t, i) => {
|
|
|
13896
13896
|
);
|
|
13897
13897
|
});
|
|
13898
13898
|
}, gw = (n, e) => {
|
|
13899
|
-
const t = Oe(), i =
|
|
13899
|
+
const t = Oe(), i = T(n.restDecoder);
|
|
13900
13900
|
for (let r = 0; r < i; r++) {
|
|
13901
|
-
const s =
|
|
13902
|
-
let l =
|
|
13901
|
+
const s = T(n.restDecoder), o = new Array(s), a = n.readClient();
|
|
13902
|
+
let l = T(n.restDecoder);
|
|
13903
13903
|
t.set(a, { i: 0, refs: o });
|
|
13904
13904
|
for (let c = 0; c < s; c++) {
|
|
13905
13905
|
const u = n.readInfo();
|
|
13906
13906
|
switch (Vr & u) {
|
|
13907
13907
|
case 0: {
|
|
13908
13908
|
const d = n.readLen();
|
|
13909
|
-
o[c] = new Me(
|
|
13909
|
+
o[c] = new Me(M(a, l), d), l += d;
|
|
13910
13910
|
break;
|
|
13911
13911
|
}
|
|
13912
13912
|
case 10: {
|
|
13913
|
-
const d =
|
|
13914
|
-
o[c] = new
|
|
13913
|
+
const d = T(n.restDecoder);
|
|
13914
|
+
o[c] = new Ae(M(a, l), d), l += d;
|
|
13915
13915
|
break;
|
|
13916
13916
|
}
|
|
13917
13917
|
default: {
|
|
13918
13918
|
const d = (u & (et | ce)) === 0, h = new R(
|
|
13919
|
-
|
|
13919
|
+
M(a, l),
|
|
13920
13920
|
null,
|
|
13921
13921
|
// left
|
|
13922
13922
|
(u & ce) === ce ? n.readLeftID() : null,
|
|
@@ -13980,7 +13980,7 @@ const mw = (n, e, t, i) => {
|
|
|
13980
13980
|
i.length = 0;
|
|
13981
13981
|
};
|
|
13982
13982
|
for (; ; ) {
|
|
13983
|
-
if (u.constructor !==
|
|
13983
|
+
if (u.constructor !== Ae) {
|
|
13984
13984
|
const f = We(d, u.id.client, () => $(e, u.id.client)) - u.id.clock;
|
|
13985
13985
|
if (f < 0)
|
|
13986
13986
|
i.push(u), c(u.id.client, u.id.clock - 1), h();
|
|
@@ -14045,7 +14045,7 @@ const mw = (n, e, t, i) => {
|
|
|
14045
14045
|
const d = Fl(i, r, a);
|
|
14046
14046
|
if (a.pendingDs) {
|
|
14047
14047
|
const h = new vn(Mn(a.pendingDs));
|
|
14048
|
-
|
|
14048
|
+
T(h.restDecoder);
|
|
14049
14049
|
const p = Fl(h, r, a);
|
|
14050
14050
|
d && p ? a.pendingDs = gr([d, p]) : a.pendingDs = d || p;
|
|
14051
14051
|
} else
|
|
@@ -14074,21 +14074,21 @@ const mw = (n, e, t, i) => {
|
|
|
14074
14074
|
}
|
|
14075
14075
|
return r[0];
|
|
14076
14076
|
}, Sw = (n, e) => xw(n, e, new Ei()), Cw = (n) => {
|
|
14077
|
-
const e = /* @__PURE__ */ new Map(), t =
|
|
14077
|
+
const e = /* @__PURE__ */ new Map(), t = T(n.restDecoder);
|
|
14078
14078
|
for (let i = 0; i < t; i++) {
|
|
14079
|
-
const r =
|
|
14079
|
+
const r = T(n.restDecoder), s = T(n.restDecoder);
|
|
14080
14080
|
e.set(r, s);
|
|
14081
14081
|
}
|
|
14082
14082
|
return e;
|
|
14083
|
-
}, Id = (n) => Cw(new
|
|
14083
|
+
}, Id = (n) => Cw(new Td(Mn(n))), zd = (n, e) => (O(n.restEncoder, e.size), kt(e.entries()).sort((t, i) => i[0] - t[0]).forEach(([t, i]) => {
|
|
14084
14084
|
O(n.restEncoder, t), O(n.restEncoder, i);
|
|
14085
|
-
}), n), Ew = (n, e) => zd(n, Mi(e.store)), Mw = (n, e = new Nd()) => (n instanceof Map ? zd(e, n) : Ew(e, n), e.toUint8Array()),
|
|
14086
|
-
class
|
|
14085
|
+
}), n), Ew = (n, e) => zd(n, Mi(e.store)), Mw = (n, e = new Nd()) => (n instanceof Map ? zd(e, n) : Ew(e, n), e.toUint8Array()), Aw = (n) => Mw(n, new Dd());
|
|
14086
|
+
class Tw {
|
|
14087
14087
|
constructor() {
|
|
14088
14088
|
this.l = [];
|
|
14089
14089
|
}
|
|
14090
14090
|
}
|
|
14091
|
-
const ql = () => new
|
|
14091
|
+
const ql = () => new Tw(), Ul = (n, e) => n.l.push(e), Hl = (n, e) => {
|
|
14092
14092
|
const t = n.l, i = t.length;
|
|
14093
14093
|
n.l = t.filter((r) => e !== r), i === n.l.length && console.error("[yjs] Tried to remove event handler that doesn't exist.");
|
|
14094
14094
|
}, Pd = (n, e, t) => Yo(n.l, [e, t]);
|
|
@@ -14101,7 +14101,7 @@ class cn {
|
|
|
14101
14101
|
this.client = e, this.clock = t;
|
|
14102
14102
|
}
|
|
14103
14103
|
}
|
|
14104
|
-
const rn = (n, e) => n === e || n !== null && e !== null && n.client === e.client && n.clock === e.clock,
|
|
14104
|
+
const rn = (n, e) => n === e || n !== null && e !== null && n.client === e.client && n.clock === e.clock, M = (n, e) => new cn(n, e), ci = (n) => {
|
|
14105
14105
|
for (const [e, t] of n.doc.share.entries())
|
|
14106
14106
|
if (t === n)
|
|
14107
14107
|
return e;
|
|
@@ -14126,7 +14126,7 @@ class di {
|
|
|
14126
14126
|
this.type = e, this.tname = t, this.item = i, this.assoc = r;
|
|
14127
14127
|
}
|
|
14128
14128
|
}
|
|
14129
|
-
const qn = (n) => new di(n.type == null ? null :
|
|
14129
|
+
const qn = (n) => new di(n.type == null ? null : M(n.type.client, n.type.clock), n.tname ?? null, n.item == null ? null : M(n.item.client, n.item.clock), n.assoc == null ? 0 : n.assoc);
|
|
14130
14130
|
class Ow {
|
|
14131
14131
|
/**
|
|
14132
14132
|
* @param {AbstractType<any>} type
|
|
@@ -14139,7 +14139,7 @@ class Ow {
|
|
|
14139
14139
|
}
|
|
14140
14140
|
const Dw = (n, e, t = 0) => new Ow(n, e, t), Li = (n, e, t) => {
|
|
14141
14141
|
let i = null, r = null;
|
|
14142
|
-
return n._item === null ? r = ci(n) : i =
|
|
14142
|
+
return n._item === null ? r = ci(n) : i = M(n._item.id.client, n._item.id.clock), new di(i, r, e, t);
|
|
14143
14143
|
}, Cs = (n, e, t = 0) => {
|
|
14144
14144
|
let i = n._start;
|
|
14145
14145
|
if (t < 0) {
|
|
@@ -14150,7 +14150,7 @@ const Dw = (n, e, t = 0) => new Ow(n, e, t), Li = (n, e, t) => {
|
|
|
14150
14150
|
for (; i !== null; ) {
|
|
14151
14151
|
if (!i.deleted && i.countable) {
|
|
14152
14152
|
if (i.length > e)
|
|
14153
|
-
return Li(n,
|
|
14153
|
+
return Li(n, M(i.id.client, i.id.clock + e), t);
|
|
14154
14154
|
e -= i.length;
|
|
14155
14155
|
}
|
|
14156
14156
|
if (i.right === null && t < 0)
|
|
@@ -14206,10 +14206,10 @@ class ia {
|
|
|
14206
14206
|
this.ds = e, this.sv = t;
|
|
14207
14207
|
}
|
|
14208
14208
|
}
|
|
14209
|
-
const Rd = (n, e) => new ia(n, e), Es = (n) => Rd(Md(n.store), Mi(n.store)), Ot = (n, e) => e === void 0 ? !n.deleted : e.sv.has(n.id.client) && (e.sv.get(n.id.client) || 0) > n.id.clock && !
|
|
14209
|
+
const Rd = (n, e) => new ia(n, e), Es = (n) => Rd(Md(n.store), Mi(n.store)), Ot = (n, e) => e === void 0 ? !n.deleted : e.sv.has(n.id.client) && (e.sv.get(n.id.client) || 0) > n.id.clock && !Tn(e.ds, n.id), so = (n, e) => {
|
|
14210
14210
|
const t = We(n.meta, so, Ut), i = n.doc.store;
|
|
14211
14211
|
t.has(e) || (e.sv.forEach((r, s) => {
|
|
14212
|
-
r < $(i, s) && fe(n,
|
|
14212
|
+
r < $(i, s) && fe(n, M(s, r));
|
|
14213
14213
|
}), xt(n, e.ds, (r) => {
|
|
14214
14214
|
}), t.add(e));
|
|
14215
14215
|
};
|
|
@@ -14295,7 +14295,7 @@ class Rw {
|
|
|
14295
14295
|
* @param {boolean} local
|
|
14296
14296
|
*/
|
|
14297
14297
|
constructor(e, t, i) {
|
|
14298
|
-
this.doc = e, this.deleteSet = new
|
|
14298
|
+
this.doc = e, this.deleteSet = new An(), this.beforeState = Mi(e.store), this.afterState = /* @__PURE__ */ new Map(), this.changed = /* @__PURE__ */ new Map(), this.changedParentTypes = /* @__PURE__ */ new Map(), this._mergeStructs = [], this.origin = t, this.meta = /* @__PURE__ */ new Map(), this.local = i, this.subdocsAdded = /* @__PURE__ */ new Set(), this.subdocsRemoved = /* @__PURE__ */ new Set(), this.subdocsLoaded = /* @__PURE__ */ new Set(), this._needFormattingCleanup = !1;
|
|
14299
14299
|
}
|
|
14300
14300
|
}
|
|
14301
14301
|
const Kl = (n, e) => e.deleteSet.clients.size === 0 && !Wb(e.afterState, (t, i) => e.beforeState.get(i) !== t) ? !1 : (ea(e.deleteSet), yw(n, e), On(n, e.deleteSet), !0), Gl = (n, e, t) => {
|
|
@@ -14383,7 +14383,7 @@ const Kl = (n, e) => e.deleteSet.clients.size === 0 && !Wb(e.afterState, (t, i)
|
|
|
14383
14383
|
), f = Re(p, h);
|
|
14384
14384
|
f + 1 < p.length && Yi(p, f + 1) > 1 || f > 0 && Yi(p, f);
|
|
14385
14385
|
}
|
|
14386
|
-
if (!t.local && t.afterState.get(i.clientID) !== t.beforeState.get(i.clientID) && (dw(Qo, yd, "[yjs] ", wd, kd, "Changed the client-id because another client seems to be using it."), i.clientID =
|
|
14386
|
+
if (!t.local && t.afterState.get(i.clientID) !== t.beforeState.get(i.clientID) && (dw(Qo, yd, "[yjs] ", wd, kd, "Changed the client-id because another client seems to be using it."), i.clientID = Ad()), i.emit("afterTransactionCleanup", [t, i]), i._observers.has("update")) {
|
|
14387
14387
|
const u = new Ei();
|
|
14388
14388
|
Kl(u, t) && i.emit("update", [u.toUint8Array(), t.origin, i, t]);
|
|
14389
14389
|
}
|
|
@@ -14442,7 +14442,7 @@ const Yl = (n, e, t) => {
|
|
|
14442
14442
|
if (p instanceof R) {
|
|
14443
14443
|
if (p.redone !== null) {
|
|
14444
14444
|
let { item: f, diff: m } = lo(l, p.id);
|
|
14445
|
-
m > 0 && (f = fe(a,
|
|
14445
|
+
m > 0 && (f = fe(a, M(f.id.client, f.id.clock + m))), p = f;
|
|
14446
14446
|
}
|
|
14447
14447
|
!p.deleted && s.some((f) => f === a.doc || ui(
|
|
14448
14448
|
/** @type {AbstractType<any>} */
|
|
@@ -14457,7 +14457,7 @@ const Yl = (n, e, t) => {
|
|
|
14457
14457
|
f,
|
|
14458
14458
|
p
|
|
14459
14459
|
)) && // Never redo structs in stackItem.insertions because they were created and deleted in the same capture interval.
|
|
14460
|
-
!
|
|
14460
|
+
!Tn(c.insertions, p.id) && u.add(p);
|
|
14461
14461
|
}), u.forEach((p) => {
|
|
14462
14462
|
h = sh(a, p, u, c.insertions, n.ignoreRemoteMapChanges, n) !== null || h;
|
|
14463
14463
|
});
|
|
@@ -14502,10 +14502,10 @@ class $d extends od {
|
|
|
14502
14502
|
return;
|
|
14503
14503
|
const c = this.undoing, u = this.redoing, d = c ? this.redoStack : this.undoStack;
|
|
14504
14504
|
c ? this.stopCapturing() : u || this.clear(!1, !0);
|
|
14505
|
-
const h = new
|
|
14505
|
+
const h = new An();
|
|
14506
14506
|
l.afterState.forEach((g, b) => {
|
|
14507
|
-
const k = l.beforeState.get(b) || 0,
|
|
14508
|
-
|
|
14507
|
+
const k = l.beforeState.get(b) || 0, x = g - k;
|
|
14508
|
+
x > 0 && li(h, b, k, x);
|
|
14509
14509
|
});
|
|
14510
14510
|
const p = Ny();
|
|
14511
14511
|
let f = !1;
|
|
@@ -14634,18 +14634,18 @@ class $d extends od {
|
|
|
14634
14634
|
}
|
|
14635
14635
|
}
|
|
14636
14636
|
function* jw(n) {
|
|
14637
|
-
const e =
|
|
14637
|
+
const e = T(n.restDecoder);
|
|
14638
14638
|
for (let t = 0; t < e; t++) {
|
|
14639
|
-
const i =
|
|
14640
|
-
let s =
|
|
14639
|
+
const i = T(n.restDecoder), r = n.readClient();
|
|
14640
|
+
let s = T(n.restDecoder);
|
|
14641
14641
|
for (let o = 0; o < i; o++) {
|
|
14642
14642
|
const a = n.readInfo();
|
|
14643
14643
|
if (a === 10) {
|
|
14644
|
-
const l =
|
|
14645
|
-
yield new
|
|
14644
|
+
const l = T(n.restDecoder);
|
|
14645
|
+
yield new Ae(M(r, s), l), s += l;
|
|
14646
14646
|
} else if (Vr & a) {
|
|
14647
14647
|
const l = (a & (et | ce)) === 0, c = new R(
|
|
14648
|
-
|
|
14648
|
+
M(r, s),
|
|
14649
14649
|
null,
|
|
14650
14650
|
// left
|
|
14651
14651
|
(a & ce) === ce ? n.readLeftID() : null,
|
|
@@ -14665,7 +14665,7 @@ function* jw(n) {
|
|
|
14665
14665
|
yield c, s += c.length;
|
|
14666
14666
|
} else {
|
|
14667
14667
|
const l = n.readLen();
|
|
14668
|
-
yield new Me(
|
|
14668
|
+
yield new Me(M(r, s), l), s += l;
|
|
14669
14669
|
}
|
|
14670
14670
|
}
|
|
14671
14671
|
}
|
|
@@ -14684,7 +14684,7 @@ class ra {
|
|
|
14684
14684
|
next() {
|
|
14685
14685
|
do
|
|
14686
14686
|
this.curr = this.gen.next().value || null;
|
|
14687
|
-
while (this.filterSkips && this.curr !== null && this.curr.constructor ===
|
|
14687
|
+
while (this.filterSkips && this.curr !== null && this.curr.constructor === Ae);
|
|
14688
14688
|
return this.curr;
|
|
14689
14689
|
}
|
|
14690
14690
|
}
|
|
@@ -14699,19 +14699,19 @@ class sa {
|
|
|
14699
14699
|
const $w = (n) => gr(n, Od, Ei), Vw = (n, e) => {
|
|
14700
14700
|
if (n.constructor === Me) {
|
|
14701
14701
|
const { client: t, clock: i } = n.id;
|
|
14702
|
-
return new Me(
|
|
14703
|
-
} else if (n.constructor ===
|
|
14702
|
+
return new Me(M(t, i + e), n.length - e);
|
|
14703
|
+
} else if (n.constructor === Ae) {
|
|
14704
14704
|
const { client: t, clock: i } = n.id;
|
|
14705
|
-
return new
|
|
14705
|
+
return new Ae(M(t, i + e), n.length - e);
|
|
14706
14706
|
} else {
|
|
14707
14707
|
const t = (
|
|
14708
14708
|
/** @type {Item} */
|
|
14709
14709
|
n
|
|
14710
14710
|
), { client: i, clock: r } = t.id;
|
|
14711
14711
|
return new R(
|
|
14712
|
-
|
|
14712
|
+
M(i, r + e),
|
|
14713
14713
|
null,
|
|
14714
|
-
|
|
14714
|
+
M(i, r + e - 1),
|
|
14715
14715
|
null,
|
|
14716
14716
|
t.rightOrigin,
|
|
14717
14717
|
t.parent,
|
|
@@ -14730,7 +14730,7 @@ const $w = (n) => gr(n, Od, Ei), Vw = (n, e) => {
|
|
|
14730
14730
|
(h, p) => {
|
|
14731
14731
|
if (h.curr.id.client === p.curr.id.client) {
|
|
14732
14732
|
const f = h.curr.id.clock - p.curr.id.clock;
|
|
14733
|
-
return f === 0 ? h.curr.constructor === p.curr.constructor ? 0 : h.curr.constructor ===
|
|
14733
|
+
return f === 0 ? h.curr.constructor === p.curr.constructor ? 0 : h.curr.constructor === Ae ? 1 : -1 : f;
|
|
14734
14734
|
} else
|
|
14735
14735
|
return p.curr.id.client - h.curr.id.client;
|
|
14736
14736
|
}
|
|
@@ -14753,16 +14753,16 @@ const $w = (n) => gr(n, Od, Ei), Vw = (n, e) => {
|
|
|
14753
14753
|
if (d !== s.struct.id.client)
|
|
14754
14754
|
ut(a, s.struct, s.offset), s = { struct: h, offset: 0 }, u.next();
|
|
14755
14755
|
else if (s.struct.id.clock + s.struct.length < h.id.clock)
|
|
14756
|
-
if (s.struct.constructor ===
|
|
14756
|
+
if (s.struct.constructor === Ae)
|
|
14757
14757
|
s.struct.length = h.id.clock + h.length - s.struct.id.clock;
|
|
14758
14758
|
else {
|
|
14759
14759
|
ut(a, s.struct, s.offset);
|
|
14760
14760
|
const f = h.id.clock - s.struct.id.clock - s.struct.length;
|
|
14761
|
-
s = { struct: new
|
|
14761
|
+
s = { struct: new Ae(M(d, s.struct.id.clock + s.struct.length), f), offset: 0 };
|
|
14762
14762
|
}
|
|
14763
14763
|
else {
|
|
14764
14764
|
const f = s.struct.id.clock + s.struct.length - h.id.clock;
|
|
14765
|
-
f > 0 && (s.struct.constructor ===
|
|
14765
|
+
f > 0 && (s.struct.constructor === Ae ? s.struct.length -= f : h = Vw(h, f)), s.struct.mergeWith(
|
|
14766
14766
|
/** @type {any} */
|
|
14767
14767
|
h
|
|
14768
14768
|
) || (ut(a, s.struct, s.offset), s = { struct: h, offset: 0 }, u.next());
|
|
@@ -14772,7 +14772,7 @@ const $w = (n) => gr(n, Od, Ei), Vw = (n, e) => {
|
|
|
14772
14772
|
/** @type {Item | GC} */
|
|
14773
14773
|
u.curr
|
|
14774
14774
|
), offset: 0 }, u.next();
|
|
14775
|
-
for (let h = u.curr; h !== null && h.id.client === d && h.id.clock === s.struct.id.clock + s.struct.length && h.constructor !==
|
|
14775
|
+
for (let h = u.curr; h !== null && h.id.client === d && h.id.clock === s.struct.id.clock + s.struct.length && h.constructor !== Ae; h = u.next())
|
|
14776
14776
|
ut(a, s.struct, s.offset), s = { struct: h, offset: 0 };
|
|
14777
14777
|
}
|
|
14778
14778
|
s !== null && (ut(a, s.struct, s.offset), s = null), oa(a);
|
|
@@ -14782,7 +14782,7 @@ const $w = (n) => gr(n, Od, Ei), Vw = (n, e) => {
|
|
|
14782
14782
|
const r = Id(e), s = new i(), o = new sa(s), a = new t(Mn(n)), l = new ra(a, !1);
|
|
14783
14783
|
for (; l.curr; ) {
|
|
14784
14784
|
const u = l.curr, d = u.id.client, h = r.get(d) || 0;
|
|
14785
|
-
if (l.curr.constructor ===
|
|
14785
|
+
if (l.curr.constructor === Ae) {
|
|
14786
14786
|
l.next();
|
|
14787
14787
|
continue;
|
|
14788
14788
|
}
|
|
@@ -14849,7 +14849,7 @@ class Ur {
|
|
|
14849
14849
|
* @return {boolean}
|
|
14850
14850
|
*/
|
|
14851
14851
|
deletes(e) {
|
|
14852
|
-
return
|
|
14852
|
+
return Tn(this.transaction.deleteSet, e.id);
|
|
14853
14853
|
}
|
|
14854
14854
|
/**
|
|
14855
14855
|
* @type {Map<string, { action: 'add' | 'update' | 'delete', oldValue: any, newValue: any }>}
|
|
@@ -15237,7 +15237,7 @@ const Ud = (n, e, t) => {
|
|
|
15237
15237
|
const s = n.doc, o = s.clientID, a = s.store, l = t === null ? e._start : t.right;
|
|
15238
15238
|
let c = [];
|
|
15239
15239
|
const u = () => {
|
|
15240
|
-
c.length > 0 && (r = new R(
|
|
15240
|
+
c.length > 0 && (r = new R(M(o, $(a, o)), r, r && r.lastId, l, l && l.id, e, null, new Jt(c)), r.integrate(n, 0), c = []);
|
|
15241
15241
|
};
|
|
15242
15242
|
i.forEach((d) => {
|
|
15243
15243
|
if (d === null)
|
|
@@ -15255,20 +15255,20 @@ const Ud = (n, e, t) => {
|
|
|
15255
15255
|
switch (u(), d.constructor) {
|
|
15256
15256
|
case Uint8Array:
|
|
15257
15257
|
case ArrayBuffer:
|
|
15258
|
-
r = new R(
|
|
15258
|
+
r = new R(M(o, $(a, o)), r, r && r.lastId, l, l && l.id, e, null, new Ai(new Uint8Array(
|
|
15259
15259
|
/** @type {Uint8Array} */
|
|
15260
15260
|
d
|
|
15261
15261
|
))), r.integrate(n, 0);
|
|
15262
15262
|
break;
|
|
15263
15263
|
case rt:
|
|
15264
|
-
r = new R(
|
|
15264
|
+
r = new R(M(o, $(a, o)), r, r && r.lastId, l, l && l.id, e, null, new Ti(
|
|
15265
15265
|
/** @type {Doc} */
|
|
15266
15266
|
d
|
|
15267
15267
|
)), r.integrate(n, 0);
|
|
15268
15268
|
break;
|
|
15269
15269
|
default:
|
|
15270
15270
|
if (d instanceof G)
|
|
15271
|
-
r = new R(
|
|
15271
|
+
r = new R(M(o, $(a, o)), r, r && r.lastId, l, l && l.id, e, null, new Be(d)), r.integrate(n, 0);
|
|
15272
15272
|
else
|
|
15273
15273
|
throw new Error("Unexpected content type in insert operation");
|
|
15274
15274
|
}
|
|
@@ -15284,7 +15284,7 @@ const Ud = (n, e, t) => {
|
|
|
15284
15284
|
for (s !== null && (o = s.p, t -= s.index, t === 0 && (o = o.prev, t += o && o.countable && !o.deleted ? o.length : 0)); o !== null; o = o.right)
|
|
15285
15285
|
if (!o.deleted && o.countable) {
|
|
15286
15286
|
if (t <= o.length) {
|
|
15287
|
-
t < o.length && fe(n,
|
|
15287
|
+
t < o.length && fe(n, M(o.id.client, o.id.clock + t));
|
|
15288
15288
|
break;
|
|
15289
15289
|
}
|
|
15290
15290
|
t -= o.length;
|
|
@@ -15302,9 +15302,9 @@ const Ud = (n, e, t) => {
|
|
|
15302
15302
|
const r = t, s = i, o = Hr(e, t);
|
|
15303
15303
|
let a = e._start;
|
|
15304
15304
|
for (o !== null && (a = o.p, t -= o.index); a !== null && t > 0; a = a.right)
|
|
15305
|
-
!a.deleted && a.countable && (t < a.length && fe(n,
|
|
15305
|
+
!a.deleted && a.countable && (t < a.length && fe(n, M(a.id.client, a.id.clock + t)), t -= a.length);
|
|
15306
15306
|
for (; i > 0 && a !== null; )
|
|
15307
|
-
a.deleted || (i < a.length && fe(n,
|
|
15307
|
+
a.deleted || (i < a.length && fe(n, M(a.id.client, a.id.clock + i)), a.delete(n), i -= a.length), a = a.right;
|
|
15308
15308
|
if (i > 0)
|
|
15309
15309
|
throw Gd();
|
|
15310
15310
|
e._searchMarker && hi(
|
|
@@ -15331,13 +15331,13 @@ const Ud = (n, e, t) => {
|
|
|
15331
15331
|
a = new Jt([i]);
|
|
15332
15332
|
break;
|
|
15333
15333
|
case Uint8Array:
|
|
15334
|
-
a = new
|
|
15334
|
+
a = new Ai(
|
|
15335
15335
|
/** @type {Uint8Array} */
|
|
15336
15336
|
i
|
|
15337
15337
|
);
|
|
15338
15338
|
break;
|
|
15339
15339
|
case rt:
|
|
15340
|
-
a = new
|
|
15340
|
+
a = new Ti(
|
|
15341
15341
|
/** @type {Doc} */
|
|
15342
15342
|
i
|
|
15343
15343
|
);
|
|
@@ -15348,7 +15348,7 @@ const Ud = (n, e, t) => {
|
|
|
15348
15348
|
else
|
|
15349
15349
|
throw new Error("Unexpected content type");
|
|
15350
15350
|
}
|
|
15351
|
-
new R(
|
|
15351
|
+
new R(M(o, $(s.store, o)), r, r && r.lastId, null, null, e, t, a).integrate(n, 0);
|
|
15352
15352
|
}, ca = (n, e) => {
|
|
15353
15353
|
n.doc ?? ae();
|
|
15354
15354
|
const t = n._map.get(e);
|
|
@@ -15831,7 +15831,7 @@ const Zl = (n, e, t) => {
|
|
|
15831
15831
|
);
|
|
15832
15832
|
break;
|
|
15833
15833
|
default:
|
|
15834
|
-
e.right.deleted || (t < e.right.length && fe(n,
|
|
15834
|
+
e.right.deleted || (t < e.right.length && fe(n, M(e.right.id.client, e.right.id.clock + t)), e.index += e.right.length, t -= e.right.length);
|
|
15835
15835
|
break;
|
|
15836
15836
|
}
|
|
15837
15837
|
e.left = e.right, e.right = e.right.right;
|
|
@@ -15861,7 +15861,7 @@ const Zl = (n, e, t) => {
|
|
|
15861
15861
|
), t.forward();
|
|
15862
15862
|
const r = n.doc, s = r.clientID;
|
|
15863
15863
|
i.forEach((o, a) => {
|
|
15864
|
-
const l = t.left, c = t.right, u = new R(
|
|
15864
|
+
const l = t.left, c = t.right, u = new R(M(s, $(r.store, s)), l, l && l.lastId, c, c && c.id, e, null, new q(a, o));
|
|
15865
15865
|
u.integrate(n, 0), t.right = u, t.forward();
|
|
15866
15866
|
});
|
|
15867
15867
|
}, Dn = (n, e) => {
|
|
@@ -15886,7 +15886,7 @@ const Zl = (n, e, t) => {
|
|
|
15886
15886
|
if (!ft(c, l)) {
|
|
15887
15887
|
o.set(a, c);
|
|
15888
15888
|
const { left: u, right: d } = t;
|
|
15889
|
-
t.right = new R(
|
|
15889
|
+
t.right = new R(M(s, $(r.store, s)), u, u && u.lastId, d, d && d.id, e, null, new q(a, l)), t.right.integrate(n, 0), t.forward();
|
|
15890
15890
|
}
|
|
15891
15891
|
}
|
|
15892
15892
|
return o;
|
|
@@ -15901,7 +15901,7 @@ const Zl = (n, e, t) => {
|
|
|
15901
15901
|
i
|
|
15902
15902
|
) : i instanceof G ? new Be(i) : new Yt(i);
|
|
15903
15903
|
let { left: c, right: u, index: d } = t;
|
|
15904
|
-
e._searchMarker && hi(e._searchMarker, t.index, l.getLength()), u = new R(
|
|
15904
|
+
e._searchMarker && hi(e._searchMarker, t.index, l.getLength()), u = new R(M(o, $(s.store, o)), c, c && c.lastId, u, u && u.id, e, null, l), u.integrate(n, 0), t.right = u, t.index = d, t.forward(), eh(n, e, t, a);
|
|
15905
15905
|
}, ec = (n, e, t, i, r) => {
|
|
15906
15906
|
const s = n.doc, o = s.clientID;
|
|
15907
15907
|
th(t, r);
|
|
@@ -15928,7 +15928,7 @@ const Zl = (n, e, t) => {
|
|
|
15928
15928
|
break;
|
|
15929
15929
|
}
|
|
15930
15930
|
default:
|
|
15931
|
-
i < t.right.length && fe(n,
|
|
15931
|
+
i < t.right.length && fe(n, M(t.right.id.client, t.right.id.clock + i)), i -= t.right.length;
|
|
15932
15932
|
break;
|
|
15933
15933
|
}
|
|
15934
15934
|
t.forward();
|
|
@@ -15938,7 +15938,7 @@ const Zl = (n, e, t) => {
|
|
|
15938
15938
|
for (; i > 0; i--)
|
|
15939
15939
|
l += `
|
|
15940
15940
|
`;
|
|
15941
|
-
t.right = new R(
|
|
15941
|
+
t.right = new R(M(o, $(s.store, o)), t.left, t.left && t.left.lastId, t.right, t.right && t.right.id, e, null, new _e(l)), t.right.integrate(n, 0), t.forward();
|
|
15942
15942
|
}
|
|
15943
15943
|
eh(n, e, t, a);
|
|
15944
15944
|
}, ih = (n, e, t, i, r) => {
|
|
@@ -16064,7 +16064,7 @@ const Zl = (n, e, t) => {
|
|
|
16064
16064
|
case Be:
|
|
16065
16065
|
case Yt:
|
|
16066
16066
|
case _e:
|
|
16067
|
-
t < e.right.length && fe(n,
|
|
16067
|
+
t < e.right.length && fe(n, M(e.right.id.client, e.right.id.clock + t)), t -= e.right.length, e.right.delete(n);
|
|
16068
16068
|
break;
|
|
16069
16069
|
}
|
|
16070
16070
|
e.forward();
|
|
@@ -16507,7 +16507,7 @@ class St extends G {
|
|
|
16507
16507
|
}
|
|
16508
16508
|
}
|
|
16509
16509
|
const ok = (n) => new St();
|
|
16510
|
-
class
|
|
16510
|
+
class As {
|
|
16511
16511
|
/**
|
|
16512
16512
|
* @param {YXmlFragment | YXmlElement} root
|
|
16513
16513
|
* @param {function(AbstractType<any>):boolean} [f]
|
|
@@ -16616,7 +16616,7 @@ class Wt extends G {
|
|
|
16616
16616
|
* @public
|
|
16617
16617
|
*/
|
|
16618
16618
|
createTreeWalker(e) {
|
|
16619
|
-
return new
|
|
16619
|
+
return new As(this, e);
|
|
16620
16620
|
}
|
|
16621
16621
|
/**
|
|
16622
16622
|
* Returns the first YXmlElement that matches the query.
|
|
@@ -16635,7 +16635,7 @@ class Wt extends G {
|
|
|
16635
16635
|
*/
|
|
16636
16636
|
querySelector(e) {
|
|
16637
16637
|
e = e.toUpperCase();
|
|
16638
|
-
const i = new
|
|
16638
|
+
const i = new As(this, (r) => r.nodeName && r.nodeName.toUpperCase() === e).next();
|
|
16639
16639
|
return i.done ? null : i.value;
|
|
16640
16640
|
}
|
|
16641
16641
|
/**
|
|
@@ -16650,7 +16650,7 @@ class Wt extends G {
|
|
|
16650
16650
|
* @public
|
|
16651
16651
|
*/
|
|
16652
16652
|
querySelectorAll(e) {
|
|
16653
|
-
return e = e.toUpperCase(), kt(new
|
|
16653
|
+
return e = e.toUpperCase(), kt(new As(this, (t) => t.nodeName && t.nodeName.toUpperCase() === e));
|
|
16654
16654
|
}
|
|
16655
16655
|
/**
|
|
16656
16656
|
* Creates YXmlEvent and calls observers.
|
|
@@ -16809,7 +16809,7 @@ class Wt extends G {
|
|
|
16809
16809
|
* @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.
|
|
16810
16810
|
*/
|
|
16811
16811
|
_write(e) {
|
|
16812
|
-
e.writeTypeRef(
|
|
16812
|
+
e.writeTypeRef(Ak);
|
|
16813
16813
|
}
|
|
16814
16814
|
}
|
|
16815
16815
|
const ak = (n) => new Wt();
|
|
@@ -17077,7 +17077,7 @@ class wr extends xn {
|
|
|
17077
17077
|
* @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.
|
|
17078
17078
|
*/
|
|
17079
17079
|
_write(e) {
|
|
17080
|
-
e.writeTypeRef(
|
|
17080
|
+
e.writeTypeRef(Tk), e.writeKey(this.hookName);
|
|
17081
17081
|
}
|
|
17082
17082
|
}
|
|
17083
17083
|
const uk = (n) => new wr(n.readKey());
|
|
@@ -17254,7 +17254,7 @@ class Me extends ua {
|
|
|
17254
17254
|
return null;
|
|
17255
17255
|
}
|
|
17256
17256
|
}
|
|
17257
|
-
class
|
|
17257
|
+
class Ai {
|
|
17258
17258
|
/**
|
|
17259
17259
|
* @param {Uint8Array} content
|
|
17260
17260
|
*/
|
|
@@ -17283,7 +17283,7 @@ class Ti {
|
|
|
17283
17283
|
* @return {ContentBinary}
|
|
17284
17284
|
*/
|
|
17285
17285
|
copy() {
|
|
17286
|
-
return new
|
|
17286
|
+
return new Ai(this.content);
|
|
17287
17287
|
}
|
|
17288
17288
|
/**
|
|
17289
17289
|
* @param {number} offset
|
|
@@ -17329,7 +17329,7 @@ class Ti {
|
|
|
17329
17329
|
return 3;
|
|
17330
17330
|
}
|
|
17331
17331
|
}
|
|
17332
|
-
const pk = (n) => new
|
|
17332
|
+
const pk = (n) => new Ai(n.readBuf());
|
|
17333
17333
|
class fi {
|
|
17334
17334
|
/**
|
|
17335
17335
|
* @param {number} len
|
|
@@ -17408,7 +17408,7 @@ class fi {
|
|
|
17408
17408
|
}
|
|
17409
17409
|
}
|
|
17410
17410
|
const fk = (n) => new fi(n.readLen()), rh = (n, e) => new rt({ guid: n, ...e, shouldLoad: e.shouldLoad || e.autoLoad || !1 });
|
|
17411
|
-
class
|
|
17411
|
+
class Ti {
|
|
17412
17412
|
/**
|
|
17413
17413
|
* @param {Doc} doc
|
|
17414
17414
|
*/
|
|
@@ -17439,7 +17439,7 @@ class Ai {
|
|
|
17439
17439
|
* @return {ContentDoc}
|
|
17440
17440
|
*/
|
|
17441
17441
|
copy() {
|
|
17442
|
-
return new
|
|
17442
|
+
return new Ti(rh(this.doc.guid, this.opts));
|
|
17443
17443
|
}
|
|
17444
17444
|
/**
|
|
17445
17445
|
* @param {number} offset
|
|
@@ -17487,7 +17487,7 @@ class Ai {
|
|
|
17487
17487
|
return 9;
|
|
17488
17488
|
}
|
|
17489
17489
|
}
|
|
17490
|
-
const mk = (n) => new
|
|
17490
|
+
const mk = (n) => new Ti(rh(n.readString(), n.readAny()));
|
|
17491
17491
|
class Yt {
|
|
17492
17492
|
/**
|
|
17493
17493
|
* @param {Object} embed
|
|
@@ -17908,7 +17908,7 @@ const vk = (n) => new _e(n.readString()), xk = [
|
|
|
17908
17908
|
ak,
|
|
17909
17909
|
uk,
|
|
17910
17910
|
dk
|
|
17911
|
-
], Sk = 0, Ck = 1, Ek = 2, Mk = 3,
|
|
17911
|
+
], Sk = 0, Ck = 1, Ek = 2, Mk = 3, Ak = 4, Tk = 5, Ok = 6;
|
|
17912
17912
|
class Be {
|
|
17913
17913
|
/**
|
|
17914
17914
|
* @param {AbstractType<any>} type
|
|
@@ -18004,7 +18004,7 @@ class Be {
|
|
|
18004
18004
|
const Dk = (n) => new Be(xk[n.readTypeRef()](n)), lo = (n, e) => {
|
|
18005
18005
|
let t = e, i = 0, r;
|
|
18006
18006
|
do
|
|
18007
|
-
i > 0 && (t =
|
|
18007
|
+
i > 0 && (t = M(t.client, t.clock + i)), r = un(n, t), i = t.clock - r.id.clock, t = r.redone;
|
|
18008
18008
|
while (t !== null && r instanceof R);
|
|
18009
18009
|
return {
|
|
18010
18010
|
item: r,
|
|
@@ -18016,20 +18016,20 @@ const Dk = (n) => new Be(xk[n.readTypeRef()](n)), lo = (n, e) => {
|
|
|
18016
18016
|
n.parent._item;
|
|
18017
18017
|
}, vr = (n, e, t) => {
|
|
18018
18018
|
const { client: i, clock: r } = e.id, s = new R(
|
|
18019
|
-
|
|
18019
|
+
M(i, r + t),
|
|
18020
18020
|
e,
|
|
18021
|
-
|
|
18021
|
+
M(i, r + t - 1),
|
|
18022
18022
|
e.right,
|
|
18023
18023
|
e.rightOrigin,
|
|
18024
18024
|
e.parent,
|
|
18025
18025
|
e.parentSub,
|
|
18026
18026
|
e.content.splice(t)
|
|
18027
18027
|
);
|
|
18028
|
-
return e.deleted && s.markDeleted(), e.keep && (s.keep = !0), e.redone !== null && (s.redone =
|
|
18028
|
+
return e.deleted && s.markDeleted(), e.keep && (s.keep = !0), e.redone !== null && (s.redone = M(e.redone.client, e.redone.clock + t)), e.right = s, s.right !== null && (s.right.left = s), n._mergeStructs.push(s), s.parentSub !== null && s.right === null && s.parent._map.set(s.parentSub, s), e.length = t, s;
|
|
18029
18029
|
}, nc = (n, e) => Kb(
|
|
18030
18030
|
n,
|
|
18031
18031
|
/** @param {StackItem} s */
|
|
18032
|
-
(t) =>
|
|
18032
|
+
(t) => Tn(t.deletions, e)
|
|
18033
18033
|
), sh = (n, e, t, i, r, s) => {
|
|
18034
18034
|
const o = n.doc, a = o.store, l = o.clientID, c = e.redone;
|
|
18035
18035
|
if (c !== null)
|
|
@@ -18077,13 +18077,13 @@ const Dk = (n) => new Be(xk[n.readTypeRef()](n)), lo = (n, e) => {
|
|
|
18077
18077
|
h = h.right;
|
|
18078
18078
|
}
|
|
18079
18079
|
} else if (h = null, e.right && !r) {
|
|
18080
|
-
for (d = e; d !== null && d.right !== null && (d.right.redone ||
|
|
18080
|
+
for (d = e; d !== null && d.right !== null && (d.right.redone || Tn(i, d.right.id) || nc(s.undoStack, d.right.id) || nc(s.redoStack, d.right.id)); )
|
|
18081
18081
|
for (d = d.right; d.redone; ) d = fe(n, d.redone);
|
|
18082
18082
|
if (d && d.right !== null)
|
|
18083
18083
|
return null;
|
|
18084
18084
|
} else
|
|
18085
18085
|
d = p._map.get(e.parentSub) || null;
|
|
18086
|
-
const f = $(a, l), m =
|
|
18086
|
+
const f = $(a, l), m = M(l, f), g = new R(
|
|
18087
18087
|
m,
|
|
18088
18088
|
d,
|
|
18089
18089
|
d && d.lastId,
|
|
@@ -18175,7 +18175,7 @@ class R extends ua {
|
|
|
18175
18175
|
* @param {number} offset
|
|
18176
18176
|
*/
|
|
18177
18177
|
integrate(e, t) {
|
|
18178
|
-
if (t > 0 && (this.id.clock += t, this.left = Jl(e, e.doc.store,
|
|
18178
|
+
if (t > 0 && (this.id.clock += t, this.left = Jl(e, e.doc.store, M(this.id.client, this.id.clock - 1)), this.origin = this.left.lastId, this.content = this.content.splice(t), this.length -= t), this.parent) {
|
|
18179
18179
|
if (!this.left && (!this.right || this.right.left !== null) || this.left && this.left.right !== this.right) {
|
|
18180
18180
|
let i = this.left, r;
|
|
18181
18181
|
if (i !== null)
|
|
@@ -18249,7 +18249,7 @@ class R extends ua {
|
|
|
18249
18249
|
* Computes the last content address of this Item.
|
|
18250
18250
|
*/
|
|
18251
18251
|
get lastId() {
|
|
18252
|
-
return this.length === 1 ? this.id :
|
|
18252
|
+
return this.length === 1 ? this.id : M(this.id.client, this.id.clock + this.length - 1);
|
|
18253
18253
|
}
|
|
18254
18254
|
/**
|
|
18255
18255
|
* Try to merge two items
|
|
@@ -18302,7 +18302,7 @@ class R extends ua {
|
|
|
18302
18302
|
* @param {number} offset
|
|
18303
18303
|
*/
|
|
18304
18304
|
write(e, t) {
|
|
18305
|
-
const i = t > 0 ?
|
|
18305
|
+
const i = t > 0 ? M(this.id.client, this.id.clock + t - 1) : this.origin, r = this.rightOrigin, s = this.parentSub, o = this.content.getRef() & Vr | (i === null ? 0 : ce) | // origin is defined
|
|
18306
18306
|
(r === null ? 0 : et) | // right origin is defined
|
|
18307
18307
|
(s === null ? 0 : si);
|
|
18308
18308
|
if (e.writeInfo(o), i !== null && e.writeLeftID(i), r !== null && e.writeRightID(r), i === null && r === null) {
|
|
@@ -18351,7 +18351,7 @@ const oh = (n, e) => Nk[e & Vr](n), Nk = [
|
|
|
18351
18351
|
}
|
|
18352
18352
|
// 10 - Skip is not ItemContent
|
|
18353
18353
|
], Ik = 10;
|
|
18354
|
-
class
|
|
18354
|
+
class Ae extends ua {
|
|
18355
18355
|
get deleted() {
|
|
18356
18356
|
return !0;
|
|
18357
18357
|
}
|
|
@@ -18542,13 +18542,13 @@ const Hk = (n) => new Uk().digest(n), Wk = (n) => {
|
|
|
18542
18542
|
n[t % 6] = n[t % 6] ^ n[t];
|
|
18543
18543
|
return n.slice(0, 6);
|
|
18544
18544
|
}, Jk = (n) => Gy(Wk(Hk(Xy(n)))), xr = (n, e) => e === void 0 ? !n.deleted : e.sv.has(n.id.client) && /** @type {number} */
|
|
18545
|
-
e.sv.get(n.id.client) > n.id.clock && !
|
|
18545
|
+
e.sv.get(n.id.client) > n.id.clock && !Tn(e.ds, n.id), Kk = [{ light: "#ecd44433", dark: "#ecd444" }], Gk = (n, e, t) => {
|
|
18546
18546
|
if (!n.has(t)) {
|
|
18547
18547
|
if (n.size < e.length) {
|
|
18548
18548
|
const i = Ut();
|
|
18549
18549
|
n.forEach((r) => i.add(r)), e = e.filter((r) => !i.has(r));
|
|
18550
18550
|
}
|
|
18551
|
-
n.set(t,
|
|
18551
|
+
n.set(t, Ty(e));
|
|
18552
18552
|
}
|
|
18553
18553
|
return (
|
|
18554
18554
|
/** @type {ColorDef} */
|
|
@@ -18649,7 +18649,7 @@ e.sv.get(n.id.client) > n.id.clock && !An(e.ds, n.id), Kk = [{ light: "#ecd44433
|
|
|
18649
18649
|
e.anchor,
|
|
18650
18650
|
t.mapping
|
|
18651
18651
|
);
|
|
18652
|
-
n.setSelection(
|
|
18652
|
+
n.setSelection(S.create(n.doc, i));
|
|
18653
18653
|
} else {
|
|
18654
18654
|
const i = hn(
|
|
18655
18655
|
t.doc,
|
|
@@ -18662,7 +18662,7 @@ e.sv.get(n.id.client) > n.id.clock && !An(e.ds, n.id), Kk = [{ light: "#ecd44433
|
|
|
18662
18662
|
e.head,
|
|
18663
18663
|
t.mapping
|
|
18664
18664
|
);
|
|
18665
|
-
i !== null && r !== null && n.setSelection(
|
|
18665
|
+
i !== null && r !== null && n.setSelection(E.between(n.doc.resolve(i), n.doc.resolve(r)));
|
|
18666
18666
|
}
|
|
18667
18667
|
}, co = (n, e) => ({
|
|
18668
18668
|
type: (
|
|
@@ -18758,7 +18758,7 @@ class Qk {
|
|
|
18758
18758
|
);
|
|
18759
18759
|
if (e) {
|
|
18760
18760
|
const r = Ze(Pe(e.anchor, 0), i.doc.content.size), s = Ze(Pe(e.head, 0), i.doc.content.size);
|
|
18761
|
-
i.setSelection(
|
|
18761
|
+
i.setSelection(E.create(i.doc, r, s));
|
|
18762
18762
|
}
|
|
18763
18763
|
this.prosemirrorView.dispatch(
|
|
18764
18764
|
i.setMeta(B, { isChangeOrigin: !0, binding: this })
|
|
@@ -19154,14 +19154,14 @@ const ch = (n, e, t, i, r, s) => {
|
|
|
19154
19154
|
/** @type {PModel.Node} */
|
|
19155
19155
|
p,
|
|
19156
19156
|
i
|
|
19157
|
-
),
|
|
19157
|
+
), x = rc(
|
|
19158
19158
|
/** @type {Y.XmlElement} */
|
|
19159
19159
|
f,
|
|
19160
19160
|
/** @type {PModel.Node} */
|
|
19161
19161
|
m,
|
|
19162
19162
|
i
|
|
19163
19163
|
);
|
|
19164
|
-
k.foundMappedChild && !
|
|
19164
|
+
k.foundMappedChild && !x.foundMappedChild ? b = !1 : !k.foundMappedChild && x.foundMappedChild || k.equalityFactor < x.equalityFactor ? g = !1 : b = !1;
|
|
19165
19165
|
}
|
|
19166
19166
|
g ? (ho(
|
|
19167
19167
|
n,
|
|
@@ -19266,7 +19266,7 @@ const ov = () => {
|
|
|
19266
19266
|
return Cs(e, e._length, -1);
|
|
19267
19267
|
}, lv = (n, e) => {
|
|
19268
19268
|
let t = null, i = null;
|
|
19269
|
-
return n._item === null ? i = ci(n) : t =
|
|
19269
|
+
return n._item === null ? i = ci(n) : t = M(n._item.id.client, n._item.id.clock), new di(t, i, e.id);
|
|
19270
19270
|
}, hn = (n, e, t, i) => {
|
|
19271
19271
|
const r = Iw(t, n);
|
|
19272
19272
|
if (r === null || r.type !== e && !ui(e, r.type._item))
|
|
@@ -19656,7 +19656,7 @@ const uv = (n, e, t) => n !== e, dv = (n) => {
|
|
|
19656
19656
|
}, gi = (
|
|
19657
19657
|
/** @type {TextEncoder} */
|
|
19658
19658
|
typeof TextEncoder < "u" ? new TextEncoder() : null
|
|
19659
|
-
), Mv = (n) => gi.encode(n),
|
|
19659
|
+
), Mv = (n) => gi.encode(n), Av = gi ? Mv : Ev;
|
|
19660
19660
|
let Hn = typeof TextDecoder > "u" ? null : new TextDecoder("utf-8", { fatal: !0, ignoreBOM: !0 });
|
|
19661
19661
|
Hn && Hn.decode(new Uint8Array()).length === 1 && (Hn = null);
|
|
19662
19662
|
const Er = (n, e) => {
|
|
@@ -19666,14 +19666,14 @@ const Er = (n, e) => {
|
|
|
19666
19666
|
for (; e > Qi; )
|
|
19667
19667
|
Er(n, ph | Qi & e), e = vv(e / 128);
|
|
19668
19668
|
Er(n, Qi & e);
|
|
19669
|
-
}, fo = new Uint8Array(3e4),
|
|
19670
|
-
if (e.length <
|
|
19669
|
+
}, fo = new Uint8Array(3e4), Tv = fo.length / 3, Ov = (n, e) => {
|
|
19670
|
+
if (e.length < Tv) {
|
|
19671
19671
|
const t = gi.encodeInto(e, fo).written || 0;
|
|
19672
19672
|
Kr(n, t);
|
|
19673
19673
|
for (let i = 0; i < t; i++)
|
|
19674
19674
|
Er(n, fo[i]);
|
|
19675
19675
|
} else
|
|
19676
|
-
zv(n,
|
|
19676
|
+
zv(n, Av(e));
|
|
19677
19677
|
}, Dv = (n, e) => {
|
|
19678
19678
|
const t = unescape(encodeURIComponent(e)), i = t.length;
|
|
19679
19679
|
Kr(n, i);
|
|
@@ -19776,7 +19776,7 @@ function Uv(n) {
|
|
|
19776
19776
|
calculateDelay: n.calculateDelay === void 0 ? null : n.calculateDelay
|
|
19777
19777
|
};
|
|
19778
19778
|
}
|
|
19779
|
-
async function
|
|
19779
|
+
async function Ts(n) {
|
|
19780
19780
|
return new Promise((e) => setTimeout(e, n));
|
|
19781
19781
|
}
|
|
19782
19782
|
function Hv(n, e) {
|
|
@@ -19825,7 +19825,7 @@ async function Wv(n, e) {
|
|
|
19825
19825
|
throw l;
|
|
19826
19826
|
i.attemptNum++;
|
|
19827
19827
|
const c = r(i, t);
|
|
19828
|
-
return c && await
|
|
19828
|
+
return c && await Ts(c), s();
|
|
19829
19829
|
};
|
|
19830
19830
|
return i.attemptsRemaining > 0 && i.attemptsRemaining--, t.timeout ? new Promise((l, c) => {
|
|
19831
19831
|
const u = setTimeout(() => {
|
|
@@ -19848,9 +19848,9 @@ async function Wv(n, e) {
|
|
|
19848
19848
|
}) : n(i, t).catch(a);
|
|
19849
19849
|
}
|
|
19850
19850
|
const o = t.calculateDelay ? t.calculateDelay(i, t) : t.initialDelay;
|
|
19851
|
-
if (o && await
|
|
19851
|
+
if (o && await Ts(o), i.attemptNum < 1 && t.initialJitter) {
|
|
19852
19852
|
const a = r(i, t);
|
|
19853
|
-
a && await
|
|
19853
|
+
a && await Ts(a);
|
|
19854
19854
|
}
|
|
19855
19855
|
return s();
|
|
19856
19856
|
}
|
|
@@ -20001,26 +20001,26 @@ const ga = () => new g0(), xh = (n) => {
|
|
|
20001
20001
|
e.set(r, t), t += r.length;
|
|
20002
20002
|
}
|
|
20003
20003
|
return e.set(new Uint8Array(n.cbuf.buffer, 0, n.cpos), t), e;
|
|
20004
|
-
},
|
|
20004
|
+
}, Ar = (n, e) => {
|
|
20005
20005
|
const t = n.cbuf.length;
|
|
20006
20006
|
n.cpos === t && (n.bufs.push(n.cbuf), n.cbuf = new Uint8Array(t * 2), n.cpos = 0), n.cbuf[n.cpos++] = e;
|
|
20007
20007
|
}, Y = (n, e) => {
|
|
20008
20008
|
for (; e > Kn; )
|
|
20009
|
-
|
|
20010
|
-
|
|
20009
|
+
Ar(n, Mr | Kn & e), e = kh(e / 128);
|
|
20010
|
+
Ar(n, Kn & e);
|
|
20011
20011
|
}, yo = new Uint8Array(3e4), b0 = yo.length / 3, y0 = (n, e) => {
|
|
20012
20012
|
if (e.length < b0) {
|
|
20013
20013
|
const t = yi.encodeInto(e, yo).written || 0;
|
|
20014
20014
|
Y(n, t);
|
|
20015
20015
|
for (let i = 0; i < t; i++)
|
|
20016
|
-
|
|
20016
|
+
Ar(n, yo[i]);
|
|
20017
20017
|
} else
|
|
20018
20018
|
Nn(n, t0(e));
|
|
20019
20019
|
}, w0 = (n, e) => {
|
|
20020
20020
|
const t = unescape(encodeURIComponent(e)), i = t.length;
|
|
20021
20021
|
Y(n, i);
|
|
20022
20022
|
for (let r = 0; r < i; r++)
|
|
20023
|
-
|
|
20023
|
+
Ar(
|
|
20024
20024
|
n,
|
|
20025
20025
|
/** @type {number} */
|
|
20026
20026
|
t.codePointAt(r)
|
|
@@ -20093,20 +20093,20 @@ const Mh = (n) => new v0(n), x0 = (n, e) => {
|
|
|
20093
20093
|
), Yr = Wn ? E0 : C0, M0 = (n) => {
|
|
20094
20094
|
const e = n.pos, t = Yr(n);
|
|
20095
20095
|
return n.pos = e, t;
|
|
20096
|
-
},
|
|
20096
|
+
}, A0 = (n) => new Uint8Array(n), T0 = (n, e, t) => new Uint8Array(n, e, t), O0 = (n) => new Uint8Array(n), D0 = (n) => {
|
|
20097
20097
|
let e = "";
|
|
20098
20098
|
for (let t = 0; t < n.byteLength; t++)
|
|
20099
20099
|
e += Kv(n[t]);
|
|
20100
20100
|
return btoa(e);
|
|
20101
20101
|
}, N0 = (n) => Buffer.from(n.buffer, n.byteOffset, n.byteLength).toString("base64"), I0 = (n) => {
|
|
20102
|
-
const e = atob(n), t =
|
|
20102
|
+
const e = atob(n), t = A0(e.length);
|
|
20103
20103
|
for (let i = 0; i < e.length; i++)
|
|
20104
20104
|
t[i] = e.charCodeAt(i);
|
|
20105
20105
|
return t;
|
|
20106
20106
|
}, z0 = (n) => {
|
|
20107
20107
|
const e = Buffer.from(n, "base64");
|
|
20108
|
-
return
|
|
20109
|
-
}, P0 = wh ? D0 : N0, R0 = wh ? I0 : z0,
|
|
20108
|
+
return T0(e.buffer, e.byteOffset, e.byteLength);
|
|
20109
|
+
}, P0 = wh ? D0 : N0, R0 = wh ? I0 : z0, Ah = /* @__PURE__ */ new Map();
|
|
20110
20110
|
class _0 {
|
|
20111
20111
|
/**
|
|
20112
20112
|
* @param {string} room
|
|
@@ -20124,7 +20124,7 @@ class _0 {
|
|
|
20124
20124
|
r0(this._onChange);
|
|
20125
20125
|
}
|
|
20126
20126
|
}
|
|
20127
|
-
const L0 = typeof BroadcastChannel > "u" ? _0 : BroadcastChannel, ya = (n) => mh(
|
|
20127
|
+
const L0 = typeof BroadcastChannel > "u" ? _0 : BroadcastChannel, ya = (n) => mh(Ah, n, () => {
|
|
20128
20128
|
const e = gh(), t = new L0(n);
|
|
20129
20129
|
return t.onmessage = (i) => e.forEach((r) => r(i.data, "broadcastchannel")), {
|
|
20130
20130
|
bc: t,
|
|
@@ -20132,7 +20132,7 @@ const L0 = typeof BroadcastChannel > "u" ? _0 : BroadcastChannel, ya = (n) => mh
|
|
|
20132
20132
|
};
|
|
20133
20133
|
}), B0 = (n, e) => (ya(n).subs.add(e), e), j0 = (n, e) => {
|
|
20134
20134
|
const t = ya(n), i = t.subs.delete(e);
|
|
20135
|
-
return i && t.subs.size === 0 && (t.bc.close(),
|
|
20135
|
+
return i && t.subs.size === 0 && (t.bc.close(), Ah.delete(n)), i;
|
|
20136
20136
|
}, $0 = (n, e, t = null) => {
|
|
20137
20137
|
const i = ya(n);
|
|
20138
20138
|
i.bc.postMessage(e), i.subs.forEach((r) => r(e, t));
|
|
@@ -20303,7 +20303,7 @@ const Zi = (n, e, t) => {
|
|
|
20303
20303
|
removed: l
|
|
20304
20304
|
}, t]);
|
|
20305
20305
|
};
|
|
20306
|
-
class
|
|
20306
|
+
class Th {
|
|
20307
20307
|
constructor() {
|
|
20308
20308
|
this.callbacks = {};
|
|
20309
20309
|
}
|
|
@@ -20360,7 +20360,7 @@ class er {
|
|
|
20360
20360
|
return xh(this.encoder);
|
|
20361
20361
|
}
|
|
20362
20362
|
}
|
|
20363
|
-
class W0 extends
|
|
20363
|
+
class W0 extends Th {
|
|
20364
20364
|
constructor(e) {
|
|
20365
20365
|
super(), this.messageQueue = [], this.configuration = {
|
|
20366
20366
|
url: "",
|
|
@@ -20545,7 +20545,7 @@ class W0 extends Ah {
|
|
|
20545
20545
|
}
|
|
20546
20546
|
const Oh = 0, wa = 1, Dh = 2, J0 = (n, e) => {
|
|
20547
20547
|
Y(n, Oh);
|
|
20548
|
-
const t =
|
|
20548
|
+
const t = Aw(e);
|
|
20549
20549
|
Nn(n, t);
|
|
20550
20550
|
}, Nh = (n, e, t) => {
|
|
20551
20551
|
Y(n, wa), Nn(n, Sw(e, t));
|
|
@@ -20740,7 +20740,7 @@ class rx extends Error {
|
|
|
20740
20740
|
super(...arguments), this.code = 1001;
|
|
20741
20741
|
}
|
|
20742
20742
|
}
|
|
20743
|
-
class sx extends
|
|
20743
|
+
class sx extends Th {
|
|
20744
20744
|
constructor(e) {
|
|
20745
20745
|
var t, i, r;
|
|
20746
20746
|
super(), this.configuration = {
|
|
@@ -21179,7 +21179,7 @@ const ax = Ho.create({
|
|
|
21179
21179
|
}
|
|
21180
21180
|
});
|
|
21181
21181
|
function hx(n) {
|
|
21182
|
-
return Object.entries(n || {}).map(([e, t]) => `${e}="${t}"`).join(" ");
|
|
21182
|
+
return Object.entries(n || {}).map(([e, t]) => t !== null ? `${e}="${t}"` : "").join(" ");
|
|
21183
21183
|
}
|
|
21184
21184
|
const zh = Oi.extend({
|
|
21185
21185
|
name: "emptyElement",
|
|
@@ -21296,7 +21296,7 @@ function mx(n, e, t, i = null) {
|
|
|
21296
21296
|
const p = n.doc.nodeAt(d);
|
|
21297
21297
|
p && (d += p.nodeSize);
|
|
21298
21298
|
}
|
|
21299
|
-
n = n.setSelection(
|
|
21299
|
+
n = n.setSelection(E.create(
|
|
21300
21300
|
n.doc,
|
|
21301
21301
|
d + 1
|
|
21302
21302
|
));
|
|
@@ -21464,7 +21464,7 @@ const bx = zh.extend({
|
|
|
21464
21464
|
}), p = u + d.nodeSize - 1;
|
|
21465
21465
|
r = r.insert(p, h);
|
|
21466
21466
|
const f = p;
|
|
21467
|
-
r.doc.nodeAt(f) && (r = r.setSelection(
|
|
21467
|
+
r.doc.nodeAt(f) && (r = r.setSelection(E.create(
|
|
21468
21468
|
r.doc,
|
|
21469
21469
|
f + 1
|
|
21470
21470
|
)), r.scrollIntoView());
|
|
@@ -21632,33 +21632,11 @@ function Mx(n, e = []) {
|
|
|
21632
21632
|
});
|
|
21633
21633
|
}), t;
|
|
21634
21634
|
}
|
|
21635
|
-
function
|
|
21635
|
+
function Ax(n) {
|
|
21636
21636
|
const t = new DOMParser().parseFromString(n, "application/xml"), i = t.querySelector("parsererror");
|
|
21637
21637
|
return i ? (console.error("XML Parsing Error:", i.textContent), null) : t;
|
|
21638
21638
|
}
|
|
21639
|
-
function
|
|
21640
|
-
if (!n) return "";
|
|
21641
|
-
const e = [], t = n.querySelectorAll("text > body > *"), i = (r) => {
|
|
21642
|
-
if (r.nodeType === Node.ELEMENT_NODE) {
|
|
21643
|
-
const s = document.createElement(`tei-${r.tagName}`);
|
|
21644
|
-
for (const o of r.attributes)
|
|
21645
|
-
o.name === "xml:id" ? s.setAttribute("id", o.value) : s.setAttribute(o.name, o.value);
|
|
21646
|
-
for (const o of r.childNodes)
|
|
21647
|
-
s.appendChild(i(o));
|
|
21648
|
-
return s;
|
|
21649
|
-
} else
|
|
21650
|
-
return r.cloneNode();
|
|
21651
|
-
};
|
|
21652
|
-
return t.forEach((r) => {
|
|
21653
|
-
const s = i(r);
|
|
21654
|
-
e.push(s.outerHTML);
|
|
21655
|
-
}), e.join("");
|
|
21656
|
-
}
|
|
21657
|
-
function Ox(n) {
|
|
21658
|
-
const e = Tx(n);
|
|
21659
|
-
return e.documentElement.namespaceURI === "http://www.tei-c.org/ns/1.0" ? Ax(e) : xml;
|
|
21660
|
-
}
|
|
21661
|
-
function Dx(n, e, t, i = 3) {
|
|
21639
|
+
function Tx(n, e, t, i = 3) {
|
|
21662
21640
|
let r = e - 1, s = 0;
|
|
21663
21641
|
for (; r >= 0; ) {
|
|
21664
21642
|
if (/[\p{P}\s]/.test(n.charAt(r))) {
|
|
@@ -21681,7 +21659,7 @@ function Dx(n, e, t, i = 3) {
|
|
|
21681
21659
|
}
|
|
21682
21660
|
return `… ${n.substring(r, e)}<mark>${n.substring(e, t)}</mark>${n.substring(t, o + 1)} …`;
|
|
21683
21661
|
}
|
|
21684
|
-
class
|
|
21662
|
+
class Ox {
|
|
21685
21663
|
constructor(e, t) {
|
|
21686
21664
|
this.editor = e.tiptap, this.schemaDef = t, this.panel = e.querySelector(".attribute-panel"), this.currentElement = null, this.currentMark = null, this.setupEventListeners(), this.overlay = document.createElement("div"), this.overlay.className = "jinn-tap overlay", this.overlay.style.display = "block", this.overlay.style.position = "fixed", this.overlay.style.pointerEvents = "none", this.overlay.style.zIndex = "1000", this.overlay.style.display = "none";
|
|
21687
21665
|
}
|
|
@@ -21723,7 +21701,7 @@ class Nx {
|
|
|
21723
21701
|
}
|
|
21724
21702
|
createAttributeInput(e, t, i, r, s = "") {
|
|
21725
21703
|
const o = document.createElement("label");
|
|
21726
|
-
o.textContent = t;
|
|
21704
|
+
o.textContent = t, e.appendChild(o);
|
|
21727
21705
|
let a;
|
|
21728
21706
|
if (i.enum)
|
|
21729
21707
|
if (i.open) {
|
|
@@ -21740,7 +21718,7 @@ class Nx {
|
|
|
21740
21718
|
});
|
|
21741
21719
|
else
|
|
21742
21720
|
a = document.createElement("input"), a.type = "text";
|
|
21743
|
-
return a.placeholder = s, a.value = r || i.default || "", a.name = t,
|
|
21721
|
+
return a.placeholder = s, a.value = r || i.default || "", a.name = t, e.appendChild(a), a;
|
|
21744
21722
|
}
|
|
21745
21723
|
updatePanel(e, t) {
|
|
21746
21724
|
if (!this.panel || (this.panel.innerHTML = "", !e))
|
|
@@ -21756,52 +21734,50 @@ class Nx {
|
|
|
21756
21734
|
this.panel.appendChild(s);
|
|
21757
21735
|
const o = document.createElement("form");
|
|
21758
21736
|
this.panel.appendChild(o);
|
|
21759
|
-
const a =
|
|
21760
|
-
|
|
21761
|
-
|
|
21762
|
-
|
|
21763
|
-
|
|
21764
|
-
|
|
21765
|
-
|
|
21766
|
-
|
|
21767
|
-
|
|
21768
|
-
|
|
21769
|
-
);
|
|
21770
|
-
|
|
21771
|
-
const
|
|
21772
|
-
|
|
21773
|
-
const
|
|
21774
|
-
|
|
21775
|
-
const
|
|
21776
|
-
|
|
21777
|
-
|
|
21778
|
-
|
|
21779
|
-
|
|
21780
|
-
|
|
21781
|
-
|
|
21782
|
-
|
|
21783
|
-
|
|
21784
|
-
const k = b.strings;
|
|
21785
|
-
k.sort((S, z) => z.length - S.length), k.unshift(t), this.updateOccurrences(this.editor, e, k);
|
|
21737
|
+
const a = document.createElement("fieldset");
|
|
21738
|
+
o.appendChild(a);
|
|
21739
|
+
const l = { ...this.schemaDef.attributes, ...i.attributes };
|
|
21740
|
+
if (Object.entries(l).forEach(([c, u]) => {
|
|
21741
|
+
if (!c.startsWith("_"))
|
|
21742
|
+
if (u.connector) {
|
|
21743
|
+
const d = document.createElement("label");
|
|
21744
|
+
d.textContent = c;
|
|
21745
|
+
const h = document.createElement("input");
|
|
21746
|
+
h.type = "text", h.value = e.attrs[c], h.readOnly = !0, h.name = c, h.placeholder = "No reference assigned", o.appendChild(d), o.appendChild(h);
|
|
21747
|
+
const p = document.createElement("details");
|
|
21748
|
+
p.open = !e.attrs[c];
|
|
21749
|
+
const f = document.createElement("summary");
|
|
21750
|
+
f.textContent = "Lookup", p.appendChild(f);
|
|
21751
|
+
const m = document.createElement("pb-authority-lookup"), g = e.attrs[c] || e.attrs[c] === "";
|
|
21752
|
+
m.setAttribute("type", u.connector.type), m.setAttribute("query", t), m.setAttribute("auto", g), m.setAttribute("no-occurrences", !0);
|
|
21753
|
+
const b = document.createElement("pb-authority");
|
|
21754
|
+
if (b.setAttribute("connector", u.connector.name), b.setAttribute("name", u.connector.type), u.connector.user && b.setAttribute("user", u.connector.user), m.appendChild(b), document.addEventListener("pb-authority-select", (k) => {
|
|
21755
|
+
const x = `${u.connector.prefix}-${k.detail.properties.ref}`;
|
|
21756
|
+
h.value = x, p.open = !1, this.handleAttributeUpdate(e, { [c]: x });
|
|
21757
|
+
}), p.appendChild(m), o.appendChild(p), e.attrs[c]) {
|
|
21758
|
+
const k = e.attrs[c].substring(e.attrs[c].indexOf("-") + 1);
|
|
21759
|
+
m.lookup(u.connector.type, k, s).then((x) => {
|
|
21760
|
+
const z = x.strings;
|
|
21761
|
+
z.sort((I, C) => C.length - I.length), z.unshift(t), this.updateOccurrences(this.editor, e, z);
|
|
21786
21762
|
});
|
|
21787
21763
|
}
|
|
21788
21764
|
} else
|
|
21789
21765
|
this.createAttributeInput(
|
|
21790
|
-
|
|
21791
|
-
l,
|
|
21766
|
+
a,
|
|
21792
21767
|
c,
|
|
21793
|
-
|
|
21768
|
+
u,
|
|
21769
|
+
e.attrs[c]
|
|
21794
21770
|
);
|
|
21795
|
-
}), Object.keys(
|
|
21796
|
-
const
|
|
21797
|
-
|
|
21771
|
+
}), Object.keys(l).length > 0 && !(Object.keys(l).length === 1 && l[Object.keys(l)[0]].connector)) {
|
|
21772
|
+
const c = document.createElement("button");
|
|
21773
|
+
c.dataset.tooltip = "Apply Changes", c.type = "submit", c.innerHTML = `
|
|
21798
21774
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" class="bi bi-check2-circle" viewBox="0 0 16 16">
|
|
21799
21775
|
<path d="M2.5 8a5.5 5.5 0 0 1 8.25-4.764.5.5 0 0 0 .5-.866A6.5 6.5 0 1 0 14.5 8a.5.5 0 0 0-1 0 5.5 5.5 0 1 1-11 0"/>
|
|
21800
21776
|
<path d="M15.354 3.354a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
|
|
21801
21777
|
</svg>
|
|
21802
|
-
Apply`,
|
|
21803
|
-
|
|
21804
|
-
}), this.panel.appendChild(
|
|
21778
|
+
Apply`, c.addEventListener("click", (u) => {
|
|
21779
|
+
u.preventDefault(), this.handleAttributeUpdate(e);
|
|
21780
|
+
}), this.panel.appendChild(c);
|
|
21805
21781
|
}
|
|
21806
21782
|
}
|
|
21807
21783
|
handleAttributeUpdate(e, t = {}) {
|
|
@@ -21842,35 +21818,35 @@ class Nx {
|
|
|
21842
21818
|
for (const d of u) {
|
|
21843
21819
|
const h = e.state.doc.resolve(d.pos);
|
|
21844
21820
|
let p = h.node(), f = null;
|
|
21845
|
-
p.isText || e.state.doc.nodesBetween(d.pos, d.pos + d.length, (
|
|
21846
|
-
if (
|
|
21847
|
-
return f =
|
|
21821
|
+
p.isText || e.state.doc.nodesBetween(d.pos, d.pos + d.length, (C, L) => {
|
|
21822
|
+
if (C.isText)
|
|
21823
|
+
return f = C, !1;
|
|
21848
21824
|
});
|
|
21849
|
-
const m = f && f.marks.find((
|
|
21825
|
+
const m = f && f.marks.find((C) => t.eq(C)), g = document.createElement("li"), b = document.createElement("label"), k = document.createElement("input");
|
|
21850
21826
|
k.type = "checkbox", k.checked = m, b.appendChild(k), a.push({
|
|
21851
21827
|
checkbox: k,
|
|
21852
21828
|
from: d.pos + d.index,
|
|
21853
21829
|
to: d.pos + d.index + d.length,
|
|
21854
21830
|
hasMark: m
|
|
21855
21831
|
});
|
|
21856
|
-
const
|
|
21857
|
-
I.innerHTML = z, b.appendChild(I), g.appendChild(b), o.appendChild(g), b.addEventListener("mouseenter", (
|
|
21858
|
-
|
|
21832
|
+
const x = e.state.doc.textBetween(d.pos, h.end()), z = Tx(x, d.index, d.index + d.length), I = document.createElement("span");
|
|
21833
|
+
I.innerHTML = z, b.appendChild(I), g.appendChild(b), o.appendChild(g), b.addEventListener("mouseenter", (C) => {
|
|
21834
|
+
C.preventDefault(), C.stopPropagation();
|
|
21859
21835
|
const L = e.view.nodeDOM(d.pos);
|
|
21860
21836
|
if (L) {
|
|
21861
21837
|
(L.nodeType === window.Node.TEXT_NODE ? L.parentNode : L).scrollIntoView({ behavior: "instant", block: "center" });
|
|
21862
|
-
let
|
|
21838
|
+
let A;
|
|
21863
21839
|
if (L.nodeType === window.Node.TEXT_NODE) {
|
|
21864
21840
|
const Se = document.createRange();
|
|
21865
|
-
Se.setStart(L, d.index), Se.setEnd(L, d.index + d.length),
|
|
21841
|
+
Se.setStart(L, d.index), Se.setEnd(L, d.index + d.length), A = Se.getBoundingClientRect();
|
|
21866
21842
|
} else
|
|
21867
|
-
|
|
21868
|
-
this.overlay.style.display = "block", this.overlay.style.top =
|
|
21843
|
+
A = L.getBoundingClientRect();
|
|
21844
|
+
this.overlay.style.display = "block", this.overlay.style.top = A.top - 4 + "px", this.overlay.style.left = A.left - 4 + "px", this.overlay.style.width = A.width + 4 + "px", this.overlay.style.height = A.height + 4 + "px", document.body.appendChild(this.overlay);
|
|
21869
21845
|
}
|
|
21870
|
-
}), b.addEventListener("mouseleave", (
|
|
21871
|
-
|
|
21872
|
-
}), k.addEventListener("change", (
|
|
21873
|
-
|
|
21846
|
+
}), b.addEventListener("mouseleave", (C) => {
|
|
21847
|
+
C.preventDefault(), C.stopPropagation(), this.overlay.style.display = "none";
|
|
21848
|
+
}), k.addEventListener("change", (C) => {
|
|
21849
|
+
C.preventDefault(), C.stopPropagation(), this.editor.chain().focus().setTextSelection({ from: d.pos + d.index, to: d.pos + d.index + d.length }).toggleMark(t.type, t.attrs).run();
|
|
21874
21850
|
});
|
|
21875
21851
|
}
|
|
21876
21852
|
s.querySelector(".apply-all").addEventListener("click", (c) => {
|
|
@@ -21885,7 +21861,7 @@ class Nx {
|
|
|
21885
21861
|
});
|
|
21886
21862
|
}
|
|
21887
21863
|
}
|
|
21888
|
-
class
|
|
21864
|
+
class Dx {
|
|
21889
21865
|
constructor(e, t) {
|
|
21890
21866
|
this.editor = e.tiptap, this.attributePanel = t, this.panel = e.querySelector(".navigation-panel"), this.setupEventListeners();
|
|
21891
21867
|
}
|
|
@@ -21930,7 +21906,7 @@ class Ix {
|
|
|
21930
21906
|
}), this.panel.appendChild(l);
|
|
21931
21907
|
}
|
|
21932
21908
|
}
|
|
21933
|
-
class
|
|
21909
|
+
class Nx {
|
|
21934
21910
|
/**
|
|
21935
21911
|
* Create a new Toolbar instance.
|
|
21936
21912
|
*
|
|
@@ -22068,7 +22044,7 @@ class zx {
|
|
|
22068
22044
|
}), e.querySelector("ul").appendChild(o);
|
|
22069
22045
|
}
|
|
22070
22046
|
}
|
|
22071
|
-
const
|
|
22047
|
+
const Ix = (n) => {
|
|
22072
22048
|
let e = parseInt(n.substring(1, 3), 16) / 255, t = parseInt(n.substring(3, 5), 16) / 255, i = parseInt(n.substring(5, 7), 16) / 255, r = Math.max(e, t, i), s = Math.min(e, t, i), o, a, l = (r + s) / 2;
|
|
22073
22049
|
if (r === s)
|
|
22074
22050
|
o = a = 0;
|
|
@@ -22088,7 +22064,7 @@ const Px = (n) => {
|
|
|
22088
22064
|
o /= 6;
|
|
22089
22065
|
}
|
|
22090
22066
|
return [o * 360, a * 100, l * 100];
|
|
22091
|
-
},
|
|
22067
|
+
}, zx = (n, e, t) => {
|
|
22092
22068
|
t /= 100;
|
|
22093
22069
|
const i = e * Math.min(t, 1 - t) / 100, r = (s) => {
|
|
22094
22070
|
const o = (s + n / 30) % 12, a = t - i * Math.max(Math.min(o - 3, 9 - o, 1), -1);
|
|
@@ -22096,9 +22072,31 @@ const Px = (n) => {
|
|
|
22096
22072
|
};
|
|
22097
22073
|
return `#${r(0)}${r(8)}${r(4)}`;
|
|
22098
22074
|
};
|
|
22099
|
-
function
|
|
22100
|
-
const n = "#E48500", [e, t, i] =
|
|
22101
|
-
return
|
|
22075
|
+
function Px() {
|
|
22076
|
+
const n = "#E48500", [e, t, i] = Ix(n), r = (e + Math.random() * 360) % 360;
|
|
22077
|
+
return zx(r, t, i);
|
|
22078
|
+
}
|
|
22079
|
+
function Rx(n) {
|
|
22080
|
+
if (!n) return "";
|
|
22081
|
+
const e = [], t = n.querySelectorAll("text > body > *"), i = (r) => {
|
|
22082
|
+
if (r.nodeType === Node.ELEMENT_NODE) {
|
|
22083
|
+
const s = document.createElement(`tei-${r.tagName}`);
|
|
22084
|
+
for (const o of r.attributes)
|
|
22085
|
+
o.name === "xml:id" ? s.setAttribute("id", o.value) : s.setAttribute(o.name, o.value);
|
|
22086
|
+
for (const o of r.childNodes)
|
|
22087
|
+
s.appendChild(i(o));
|
|
22088
|
+
return s;
|
|
22089
|
+
} else
|
|
22090
|
+
return r.cloneNode();
|
|
22091
|
+
};
|
|
22092
|
+
return t.forEach((r) => {
|
|
22093
|
+
const s = i(r);
|
|
22094
|
+
e.push(s.outerHTML);
|
|
22095
|
+
}), e.join("");
|
|
22096
|
+
}
|
|
22097
|
+
function _x(n) {
|
|
22098
|
+
const e = Ax(n);
|
|
22099
|
+
return e.documentElement.namespaceURI === "http://www.tei-c.org/ns/1.0" ? Rx(e) : xml;
|
|
22102
22100
|
}
|
|
22103
22101
|
var Rh = {}, Kt = {}, ka = {};
|
|
22104
22102
|
Object.defineProperty(ka, "__esModule", { value: !0 });
|
|
@@ -38806,7 +38804,7 @@ class Ux extends HTMLElement {
|
|
|
38806
38804
|
let s;
|
|
38807
38805
|
if (r != null && r.includes("application/xml") || r != null && r.includes("text/xml")) {
|
|
38808
38806
|
const o = await i.text();
|
|
38809
|
-
s =
|
|
38807
|
+
s = _x(o);
|
|
38810
38808
|
} else if (r != null && r.includes("text/html"))
|
|
38811
38809
|
s = await i.text();
|
|
38812
38810
|
else
|
|
@@ -38888,9 +38886,9 @@ class Ux extends HTMLElement {
|
|
|
38888
38886
|
provider: this.provider,
|
|
38889
38887
|
user: {
|
|
38890
38888
|
name: this.collabUser,
|
|
38891
|
-
color:
|
|
38889
|
+
color: Px()
|
|
38892
38890
|
}
|
|
38893
|
-
}))) : s.extensions.push(qb), this.editor = new Nb(s), this.attributePanel = new
|
|
38891
|
+
}))) : s.extensions.push(qb), this.editor = new Nb(s), this.attributePanel = new Ox(this, this._schema), this.navigationPanel = new Dx(this, this.attributePanel), this.toolbar = new Nx(this, this._schema), this.collabEnabled || (this.content = t);
|
|
38894
38892
|
}
|
|
38895
38893
|
dispatchContentChange() {
|
|
38896
38894
|
this.dispatchEvent(new CustomEvent("content-change", {
|