@alxgrn/prose-editor 0.0.8 → 0.0.10
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/lib/types/index.d.ts +16 -10
- package/dist/prose-editor.es.js +379 -379
- package/dist/prose-editor.es.js.map +1 -1
- package/dist/prose-editor.umd.js +10 -10
- package/dist/prose-editor.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/prose-editor.es.js
CHANGED
|
@@ -397,16 +397,16 @@ React keys must be passed directly to JSX without using spread:
|
|
|
397
397
|
if (Ss(b))
|
|
398
398
|
for (var A = 0; A < b.length; A++) {
|
|
399
399
|
var B = b[A];
|
|
400
|
-
|
|
400
|
+
m(B) && x(B, T);
|
|
401
401
|
}
|
|
402
|
-
else if (
|
|
402
|
+
else if (m(b))
|
|
403
403
|
b._store && (b._store.validated = 1);
|
|
404
404
|
else if (b === null || typeof b != "object" ? A = null : (A = Tn && b[Tn] || b["@@iterator"], A = typeof A == "function" ? A : null), typeof A == "function" && A !== b.entries && (A = A.call(b), A !== b))
|
|
405
405
|
for (; !(b = A.next()).done; )
|
|
406
|
-
|
|
406
|
+
m(b.value) && x(b.value, T);
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function m(b) {
|
|
410
410
|
return typeof b == "object" && b !== null && b.$$typeof === D;
|
|
411
411
|
}
|
|
412
412
|
function x(b, T) {
|
|
@@ -444,7 +444,7 @@ Check the top-level render call using <` + b + ">."), T;
|
|
|
444
444
|
}()), Pn;
|
|
445
445
|
}
|
|
446
446
|
process.env.NODE_ENV === "production" ? eo.exports = _f() : eo.exports = qf();
|
|
447
|
-
var
|
|
447
|
+
var g = eo.exports;
|
|
448
448
|
function ee(n) {
|
|
449
449
|
this.content = n;
|
|
450
450
|
}
|
|
@@ -4274,16 +4274,16 @@ class Ad {
|
|
|
4274
4274
|
}
|
|
4275
4275
|
let h = l.size + e - (i.content.size - i.openEnd);
|
|
4276
4276
|
for (; c < l.childCount; ) {
|
|
4277
|
-
let y = l.child(c),
|
|
4278
|
-
if (!
|
|
4277
|
+
let y = l.child(c), m = f.matchType(y.type);
|
|
4278
|
+
if (!m)
|
|
4279
4279
|
break;
|
|
4280
|
-
c++, (c > 1 || a == 0 || y.content.size) && (f =
|
|
4280
|
+
c++, (c > 1 || a == 0 || y.content.size) && (f = m, u.push(cc(y.mark(d.allowedMarks(y.marks)), c == 1 ? a : 0, c == l.childCount ? h : -1)));
|
|
4281
4281
|
}
|
|
4282
4282
|
let p = c == l.childCount;
|
|
4283
4283
|
p || (h = -1), this.placed = $n(this.placed, t, S.from(u)), this.frontier[t].match = f, p && h < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
|
|
4284
|
-
for (let y = 0,
|
|
4285
|
-
let x =
|
|
4286
|
-
this.frontier.push({ type: x.type, match: x.contentMatchAt(x.childCount) }),
|
|
4284
|
+
for (let y = 0, m = l; y < h; y++) {
|
|
4285
|
+
let x = m.lastChild;
|
|
4286
|
+
this.frontier.push({ type: x.type, match: x.contentMatchAt(x.childCount) }), m = x.content;
|
|
4287
4287
|
}
|
|
4288
4288
|
this.unplaced = p ? e == 0 ? w.empty : new w(Vn(i.content, e - 1, 1), e - 1, h < 0 ? i.openEnd : e - 1) : new w(Vn(i.content, e, c), i.openStart, i.openEnd);
|
|
4289
4289
|
}
|
|
@@ -4400,11 +4400,11 @@ function Pd(n, e, t, r) {
|
|
|
4400
4400
|
let h = (d + u + 1) % (r.openStart + 1), p = c[h];
|
|
4401
4401
|
if (p)
|
|
4402
4402
|
for (let y = 0; y < i.length; y++) {
|
|
4403
|
-
let
|
|
4404
|
-
|
|
4405
|
-
let k = s.node(
|
|
4403
|
+
let m = i[(y + a) % i.length], x = !0;
|
|
4404
|
+
m < 0 && (x = !1, m = -m);
|
|
4405
|
+
let k = s.node(m - 1), C = s.index(m - 1);
|
|
4406
4406
|
if (k.canReplaceWith(C, C, p.type, p.marks))
|
|
4407
|
-
return n.replace(s.before(
|
|
4407
|
+
return n.replace(s.before(m), x ? o.after(m) : t, new w(uc(r.content, 0, r.openStart, h), h, r.openEnd));
|
|
4408
4408
|
}
|
|
4409
4409
|
}
|
|
4410
4410
|
let f = n.steps.length;
|
|
@@ -5740,8 +5740,8 @@ class ze {
|
|
|
5740
5740
|
i = Math.min(i, h);
|
|
5741
5741
|
let p = o.maps[h];
|
|
5742
5742
|
if (d.step) {
|
|
5743
|
-
let y = e.steps[h].invert(e.docs[h]),
|
|
5744
|
-
|
|
5743
|
+
let y = e.steps[h].invert(e.docs[h]), m = d.selection && d.selection.map(o.slice(a + 1, h));
|
|
5744
|
+
m && l++, r.push(new We(p, y, m));
|
|
5745
5745
|
} else
|
|
5746
5746
|
r.push(new We(p));
|
|
5747
5747
|
}, s);
|
|
@@ -6287,8 +6287,8 @@ function Nc(n, e, t, r) {
|
|
|
6287
6287
|
for (let x = i.length - 1; x >= 0; x--)
|
|
6288
6288
|
p = S.from(i[x].create(null, p));
|
|
6289
6289
|
p = S.from(s.copy(p));
|
|
6290
|
-
let y = n.tr.step(new se(e.pos - 1, h, e.pos, h, new w(p, 1, 0), i.length, !0)),
|
|
6291
|
-
|
|
6290
|
+
let y = n.tr.step(new se(e.pos - 1, h, e.pos, h, new w(p, 1, 0), i.length, !0)), m = y.doc.resolve(h + 2 * i.length);
|
|
6291
|
+
m.nodeAfter && m.nodeAfter.type == s.type && En(y.doc, m.pos) && y.join(m.pos), t(y.scrollIntoView());
|
|
6292
6292
|
}
|
|
6293
6293
|
return !0;
|
|
6294
6294
|
}
|
|
@@ -6299,15 +6299,15 @@ function Nc(n, e, t, r) {
|
|
|
6299
6299
|
let h = s, p = [];
|
|
6300
6300
|
for (; p.push(h), !h.isTextblock; )
|
|
6301
6301
|
h = h.lastChild;
|
|
6302
|
-
let y = o,
|
|
6302
|
+
let y = o, m = 1;
|
|
6303
6303
|
for (; !y.isTextblock; y = y.firstChild)
|
|
6304
|
-
|
|
6304
|
+
m++;
|
|
6305
6305
|
if (h.canReplace(h.childCount, h.childCount, y.content)) {
|
|
6306
6306
|
if (t) {
|
|
6307
6307
|
let x = S.empty;
|
|
6308
6308
|
for (let C = p.length - 1; C >= 0; C--)
|
|
6309
6309
|
x = S.from(p[C].copy(x));
|
|
6310
|
-
let k = n.tr.step(new se(e.pos - p.length, e.pos + o.nodeSize, e.pos +
|
|
6310
|
+
let k = n.tr.step(new se(e.pos - p.length, e.pos + o.nodeSize, e.pos + m, e.pos + o.nodeSize - m, new w(x, p.length, 0), 0, !0));
|
|
6311
6311
|
t(k.scrollIntoView());
|
|
6312
6312
|
}
|
|
6313
6313
|
return !0;
|
|
@@ -6391,7 +6391,7 @@ function Ce(n, e = null, t) {
|
|
|
6391
6391
|
if (!a)
|
|
6392
6392
|
c.removeMark(f.pos, d.pos, n);
|
|
6393
6393
|
else {
|
|
6394
|
-
let h = f.pos, p = d.pos, y = f.nodeAfter,
|
|
6394
|
+
let h = f.pos, p = d.pos, y = f.nodeAfter, m = d.nodeBefore, x = y && y.isText ? /^\s*/.exec(y.text)[0].length : 0, k = m && m.isText ? /\s*$/.exec(m.text)[0].length : 0;
|
|
6395
6395
|
h + x < p && (h += x, p -= k), c.addMark(h, p, n.create(e));
|
|
6396
6396
|
}
|
|
6397
6397
|
}
|
|
@@ -6466,8 +6466,8 @@ class Sh {
|
|
|
6466
6466
|
if (h) {
|
|
6467
6467
|
let p = h.getBoundingClientRect(), y = f ? p.bottom : p.top;
|
|
6468
6468
|
f && d && (y = (y + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2);
|
|
6469
|
-
let
|
|
6470
|
-
r = { left: p.left, right: p.right, top: y -
|
|
6469
|
+
let m = this.width / 2 * l;
|
|
6470
|
+
r = { left: p.left, right: p.right, top: y - m, bottom: y + m };
|
|
6471
6471
|
}
|
|
6472
6472
|
}
|
|
6473
6473
|
}
|
|
@@ -6940,12 +6940,12 @@ function _h(n, e, t) {
|
|
|
6940
6940
|
return l ? !Wh.test(r.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? o : i : $c(n, e, () => {
|
|
6941
6941
|
let { focusNode: a, focusOffset: c, anchorNode: u, anchorOffset: f } = n.domSelectionRange(), d = l.caretBidiLevel;
|
|
6942
6942
|
l.modify("move", t, "character");
|
|
6943
|
-
let h = r.depth ? n.docView.domAfterPos(r.before()) : n.dom, { focusNode: p, focusOffset: y } = n.domSelectionRange(),
|
|
6943
|
+
let h = r.depth ? n.docView.domAfterPos(r.before()) : n.dom, { focusNode: p, focusOffset: y } = n.domSelectionRange(), m = p && !h.contains(p.nodeType == 1 ? p : p.parentNode) || a == p && c == y;
|
|
6944
6944
|
try {
|
|
6945
6945
|
l.collapse(u, f), a && (a != u || c != f) && l.extend && l.extend(a, c);
|
|
6946
6946
|
} catch {
|
|
6947
6947
|
}
|
|
6948
|
-
return d != null && (l.caretBidiLevel = d),
|
|
6948
|
+
return d != null && (l.caretBidiLevel = d), m;
|
|
6949
6949
|
}) : r.pos == r.start() || r.pos == r.end();
|
|
6950
6950
|
}
|
|
6951
6951
|
let ll = null, al = null, cl = !1;
|
|
@@ -7200,10 +7200,10 @@ let ur = class {
|
|
|
7200
7200
|
setSelection(e, t, r, s = !1) {
|
|
7201
7201
|
let o = Math.min(e, t), i = Math.max(e, t);
|
|
7202
7202
|
for (let h = 0, p = 0; h < this.children.length; h++) {
|
|
7203
|
-
let y = this.children[h],
|
|
7204
|
-
if (o > p && i <
|
|
7203
|
+
let y = this.children[h], m = p + y.size;
|
|
7204
|
+
if (o > p && i < m)
|
|
7205
7205
|
return y.setSelection(e - p - y.border, t - p - y.border, r, s);
|
|
7206
|
-
p =
|
|
7206
|
+
p = m;
|
|
7207
7207
|
}
|
|
7208
7208
|
let l = this.domFromPos(e, e ? -1 : 1), a = t == e ? l : this.domFromPos(t, t ? -1 : 1), c = r.root.getSelection(), u = r.domSelectionRange(), f = !1;
|
|
7209
7209
|
if ((je || me) && e == t) {
|
|
@@ -7211,9 +7211,9 @@ let ur = class {
|
|
|
7211
7211
|
if (h.nodeType == 3) {
|
|
7212
7212
|
if (f = !!(p && h.nodeValue[p - 1] == `
|
|
7213
7213
|
`), f && p == h.nodeValue.length)
|
|
7214
|
-
for (let y = h,
|
|
7215
|
-
if (
|
|
7216
|
-
|
|
7214
|
+
for (let y = h, m; y; y = y.parentNode) {
|
|
7215
|
+
if (m = y.nextSibling) {
|
|
7216
|
+
m.nodeName == "BR" && (l = a = { node: m.parentNode, offset: ne(m) + 1 });
|
|
7217
7217
|
break;
|
|
7218
7218
|
}
|
|
7219
7219
|
let x = y.pmViewDesc;
|
|
@@ -7882,14 +7882,14 @@ function Xh(n, e, t, r) {
|
|
|
7882
7882
|
for (let c = 0; ; ) {
|
|
7883
7883
|
let u, f;
|
|
7884
7884
|
for (; i < s.length && s[i].to == o; ) {
|
|
7885
|
-
let
|
|
7886
|
-
|
|
7885
|
+
let m = s[i++];
|
|
7886
|
+
m.widget && (u ? (f || (f = [u])).push(m) : u = m);
|
|
7887
7887
|
}
|
|
7888
7888
|
if (u)
|
|
7889
7889
|
if (f) {
|
|
7890
7890
|
f.sort(Gh);
|
|
7891
|
-
for (let
|
|
7892
|
-
t(f[
|
|
7891
|
+
for (let m = 0; m < f.length; m++)
|
|
7892
|
+
t(f[m], c, !!a);
|
|
7893
7893
|
} else
|
|
7894
7894
|
t(u, c, !!a);
|
|
7895
7895
|
let d, h;
|
|
@@ -7899,21 +7899,21 @@ function Xh(n, e, t, r) {
|
|
|
7899
7899
|
h = c, d = n.child(c++);
|
|
7900
7900
|
else
|
|
7901
7901
|
break;
|
|
7902
|
-
for (let
|
|
7903
|
-
l[
|
|
7902
|
+
for (let m = 0; m < l.length; m++)
|
|
7903
|
+
l[m].to <= o && l.splice(m--, 1);
|
|
7904
7904
|
for (; i < s.length && s[i].from <= o && s[i].to > o; )
|
|
7905
7905
|
l.push(s[i++]);
|
|
7906
7906
|
let p = o + d.nodeSize;
|
|
7907
7907
|
if (d.isText) {
|
|
7908
|
-
let
|
|
7909
|
-
i < s.length && s[i].from <
|
|
7908
|
+
let m = p;
|
|
7909
|
+
i < s.length && s[i].from < m && (m = s[i].from);
|
|
7910
7910
|
for (let x = 0; x < l.length; x++)
|
|
7911
|
-
l[x].to <
|
|
7912
|
-
|
|
7911
|
+
l[x].to < m && (m = l[x].to);
|
|
7912
|
+
m < p && (a = d.cut(m - o), d = d.cut(0, m - o), p = m, h = -1);
|
|
7913
7913
|
} else
|
|
7914
7914
|
for (; i < s.length && s[i].to < p; )
|
|
7915
7915
|
i++;
|
|
7916
|
-
let y = d.isInline && !d.isLeaf ? l.filter((
|
|
7916
|
+
let y = d.isInline && !d.isLeaf ? l.filter((m) => !m.inline) : l.slice();
|
|
7917
7917
|
r(d, y, e.forChild(o, d), h), o = p;
|
|
7918
7918
|
}
|
|
7919
7919
|
}
|
|
@@ -8377,8 +8377,8 @@ function Gc(n, e, t, r, s) {
|
|
|
8377
8377
|
else {
|
|
8378
8378
|
let d = s.marks(), { schema: h } = n.state, p = Xe.fromSchema(h);
|
|
8379
8379
|
i = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((y) => {
|
|
8380
|
-
let
|
|
8381
|
-
y &&
|
|
8380
|
+
let m = i.appendChild(document.createElement("p"));
|
|
8381
|
+
y && m.appendChild(p.serializeNode(h.text(y, d)));
|
|
8382
8382
|
});
|
|
8383
8383
|
}
|
|
8384
8384
|
} else
|
|
@@ -8918,7 +8918,7 @@ ye.drop = (n, e) => {
|
|
|
8918
8918
|
c.setSelection(new M(h));
|
|
8919
8919
|
else {
|
|
8920
8920
|
let p = c.mapping.map(a);
|
|
8921
|
-
c.mapping.maps[c.mapping.maps.length - 1].forEach((y,
|
|
8921
|
+
c.mapping.maps[c.mapping.maps.length - 1].forEach((y, m, x, k) => p = k), c.setSelection(Jo(n, h, c.doc.resolve(p)));
|
|
8922
8922
|
}
|
|
8923
8923
|
n.focus(), n.dispatch(c.setMeta("uiEvent", "drop"));
|
|
8924
8924
|
};
|
|
@@ -9321,15 +9321,15 @@ function zp(n, e, t, r, s, o, i) {
|
|
|
9321
9321
|
for (let c = 0, u = o; c < t.maps.length; c++) {
|
|
9322
9322
|
let f = 0;
|
|
9323
9323
|
t.maps[c].forEach((d, h, p, y) => {
|
|
9324
|
-
let
|
|
9324
|
+
let m = y - p - (h - d);
|
|
9325
9325
|
for (let x = 0; x < l.length; x += 3) {
|
|
9326
9326
|
let k = l[x + 1];
|
|
9327
9327
|
if (k < 0 || d > k + u - f)
|
|
9328
9328
|
continue;
|
|
9329
9329
|
let C = l[x] + u - f;
|
|
9330
|
-
h >= C ? l[x + 1] = d <= C ? -2 : -1 : d >= u &&
|
|
9330
|
+
h >= C ? l[x + 1] = d <= C ? -2 : -1 : d >= u && m && (l[x] += m, l[x + 1] += m);
|
|
9331
9331
|
}
|
|
9332
|
-
f +=
|
|
9332
|
+
f += m;
|
|
9333
9333
|
}), u = t.maps[c].map(u, -1);
|
|
9334
9334
|
}
|
|
9335
9335
|
let a = !1;
|
|
@@ -9344,9 +9344,9 @@ function zp(n, e, t, r, s, o, i) {
|
|
|
9344
9344
|
a = !0;
|
|
9345
9345
|
continue;
|
|
9346
9346
|
}
|
|
9347
|
-
let d = t.map(n[c + 1] + o, -1), h = d - s, { index: p, offset: y } = r.content.findIndex(f),
|
|
9348
|
-
if (
|
|
9349
|
-
let x = l[c + 2].mapInner(t,
|
|
9347
|
+
let d = t.map(n[c + 1] + o, -1), h = d - s, { index: p, offset: y } = r.content.findIndex(f), m = r.maybeChild(p);
|
|
9348
|
+
if (m && y == f && y + m.nodeSize == h) {
|
|
9349
|
+
let x = l[c + 2].mapInner(t, m, u + 1, n[c] + o + 1, i);
|
|
9350
9350
|
x != le ? (l[c] = f, l[c + 1] = h, l[c + 2] = x) : (l[c + 1] = -2, a = !0);
|
|
9351
9351
|
} else
|
|
9352
9352
|
a = !0;
|
|
@@ -9649,10 +9649,10 @@ function Hp(n, e) {
|
|
|
9649
9649
|
function Jp(n, e, t) {
|
|
9650
9650
|
let { node: r, fromOffset: s, toOffset: o, from: i, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, u = a.anchorNode;
|
|
9651
9651
|
if (u && n.dom.contains(u.nodeType == 1 ? u : u.parentNode) && (c = [{ node: u, offset: a.anchorOffset }], cs(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), ce && n.input.lastKeyCode === 8)
|
|
9652
|
-
for (let
|
|
9653
|
-
let x = r.childNodes[
|
|
9652
|
+
for (let m = o; m > s; m--) {
|
|
9653
|
+
let x = r.childNodes[m - 1], k = x.pmViewDesc;
|
|
9654
9654
|
if (x.nodeName == "BR" && !k) {
|
|
9655
|
-
o =
|
|
9655
|
+
o = m;
|
|
9656
9656
|
break;
|
|
9657
9657
|
}
|
|
9658
9658
|
if (!k || k.size)
|
|
@@ -9670,8 +9670,8 @@ function Jp(n, e, t) {
|
|
|
9670
9670
|
context: h
|
|
9671
9671
|
});
|
|
9672
9672
|
if (c && c[0].pos != null) {
|
|
9673
|
-
let
|
|
9674
|
-
x == null && (x =
|
|
9673
|
+
let m = c[0].pos, x = c[1] && c[1].pos;
|
|
9674
|
+
x == null && (x = m), p = { anchor: m + i, head: x + i };
|
|
9675
9675
|
}
|
|
9676
9676
|
return { doc: y, sel: p, from: i, to: l };
|
|
9677
9677
|
}
|
|
@@ -9725,31 +9725,31 @@ function Yp(n, e, t, r, s) {
|
|
|
9725
9725
|
return;
|
|
9726
9726
|
}
|
|
9727
9727
|
n.state.selection.from < n.state.selection.to && p.start == p.endB && n.state.selection instanceof v && (p.start > n.state.selection.from && p.start <= n.state.selection.from + 2 && n.state.selection.from >= c.from ? p.start = n.state.selection.from : p.endA < n.state.selection.to && p.endA >= n.state.selection.to - 2 && n.state.selection.to <= c.to && (p.endB += n.state.selection.to - p.endA, p.endA = n.state.selection.to)), Se && Ot <= 11 && p.endB == p.start + 1 && p.endA == p.start && p.start > c.from && c.doc.textBetween(p.start - c.from - 1, p.start - c.from + 1) == " " && (p.start--, p.endA--, p.endB--);
|
|
9728
|
-
let y = c.doc.resolveNoCache(p.start - c.from),
|
|
9729
|
-
if ((Dn && n.input.lastIOSEnter > Date.now() - 225 && (!k || s.some((I) => I.nodeName == "DIV" || I.nodeName == "P")) || !k && y.pos < c.doc.content.size && !y.sameParent(
|
|
9728
|
+
let y = c.doc.resolveNoCache(p.start - c.from), m = c.doc.resolveNoCache(p.endB - c.from), x = u.resolve(p.start), k = y.sameParent(m) && y.parent.inlineContent && x.end() >= p.endA, C;
|
|
9729
|
+
if ((Dn && n.input.lastIOSEnter > Date.now() - 225 && (!k || s.some((I) => I.nodeName == "DIV" || I.nodeName == "P")) || !k && y.pos < c.doc.content.size && !y.sameParent(m) && (C = V.findFrom(c.doc.resolve(y.pos + 1), 1, !0)) && C.head == m.pos) && n.someProp("handleKeyDown", (I) => I(n, Lt(13, "Enter")))) {
|
|
9730
9730
|
n.input.lastIOSEnter = 0;
|
|
9731
9731
|
return;
|
|
9732
9732
|
}
|
|
9733
|
-
if (n.state.selection.anchor > p.start && Xp(u, p.start, p.endA, y,
|
|
9733
|
+
if (n.state.selection.anchor > p.start && Xp(u, p.start, p.endA, y, m) && n.someProp("handleKeyDown", (I) => I(n, Lt(8, "Backspace")))) {
|
|
9734
9734
|
it && ce && n.domObserver.suppressSelectionUpdates();
|
|
9735
9735
|
return;
|
|
9736
9736
|
}
|
|
9737
|
-
ce && p.endB == p.start && (n.input.lastChromeDelete = Date.now()), it && !k && y.start() !=
|
|
9737
|
+
ce && p.endB == p.start && (n.input.lastChromeDelete = Date.now()), it && !k && y.start() != m.start() && m.parentOffset == 0 && y.depth == m.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == p.endA && (p.endB -= 2, m = c.doc.resolveNoCache(p.endB - c.from), setTimeout(() => {
|
|
9738
9738
|
n.someProp("handleKeyDown", function(I) {
|
|
9739
9739
|
return I(n, Lt(13, "Enter"));
|
|
9740
9740
|
});
|
|
9741
9741
|
}, 20));
|
|
9742
9742
|
let D = p.start, $ = p.endA, E, L, F;
|
|
9743
9743
|
if (k) {
|
|
9744
|
-
if (y.pos ==
|
|
9744
|
+
if (y.pos == m.pos)
|
|
9745
9745
|
Se && Ot <= 11 && y.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => at(n), 20)), E = n.state.tr.delete(D, $), L = u.resolve(p.start).marksAcross(u.resolve(p.endA));
|
|
9746
9746
|
else if (
|
|
9747
9747
|
// Adding or removing a mark
|
|
9748
|
-
p.endA == p.endB && (F = Gp(y.parent.content.cut(y.parentOffset,
|
|
9748
|
+
p.endA == p.endB && (F = Gp(y.parent.content.cut(y.parentOffset, m.parentOffset), x.parent.content.cut(x.parentOffset, p.endA - x.start())))
|
|
9749
9749
|
)
|
|
9750
9750
|
E = n.state.tr, F.type == "add" ? E.addMark(D, $, F.mark) : E.removeMark(D, $, F.mark);
|
|
9751
|
-
else if (y.parent.child(y.index()).isText && y.index() ==
|
|
9752
|
-
let I = y.parent.textBetween(y.parentOffset,
|
|
9751
|
+
else if (y.parent.child(y.index()).isText && y.index() == m.index() - (m.textOffset ? 0 : 1)) {
|
|
9752
|
+
let I = y.parent.textBetween(y.parentOffset, m.parentOffset);
|
|
9753
9753
|
if (n.someProp("handleTextInput", (_) => _(n, D, $, I)))
|
|
9754
9754
|
return;
|
|
9755
9755
|
E = n.state.tr.insertText(I, D, $);
|
|
@@ -10489,12 +10489,12 @@ function bm(n, e) {
|
|
|
10489
10489
|
f = S.from(s.node(x).copy(f));
|
|
10490
10490
|
let h = s.indexAfter(-1) < s.node(-2).childCount ? 1 : s.indexAfter(-2) < s.node(-3).childCount ? 2 : 3;
|
|
10491
10491
|
f = f.append(S.from(n.createAndFill()));
|
|
10492
|
-
let p = s.before(s.depth - (d - 1)), y = t.tr.replace(p, s.after(-h), new w(f, 4 - d, 0)),
|
|
10492
|
+
let p = s.before(s.depth - (d - 1)), y = t.tr.replace(p, s.after(-h), new w(f, 4 - d, 0)), m = -1;
|
|
10493
10493
|
y.doc.nodesBetween(p, y.doc.content.size, (x, k) => {
|
|
10494
|
-
if (
|
|
10494
|
+
if (m > -1)
|
|
10495
10495
|
return !1;
|
|
10496
|
-
x.isTextblock && x.content.size == 0 && (
|
|
10497
|
-
}),
|
|
10496
|
+
x.isTextblock && x.content.size == 0 && (m = k + 1);
|
|
10497
|
+
}), m > -1 && y.setSelection(V.near(y.doc.resolve(m))), r(y.scrollIntoView());
|
|
10498
10498
|
}
|
|
10499
10499
|
return !0;
|
|
10500
10500
|
}
|
|
@@ -11226,8 +11226,8 @@ function Du(n, e, t, r, s) {
|
|
|
11226
11226
|
else {
|
|
11227
11227
|
let d = s.marks(), { schema: h } = n.state, p = Xe.fromSchema(h);
|
|
11228
11228
|
i = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((y) => {
|
|
11229
|
-
let
|
|
11230
|
-
y &&
|
|
11229
|
+
let m = i.appendChild(document.createElement("p"));
|
|
11230
|
+
y && m.appendChild(p.serializeNode(h.text(y, d)));
|
|
11231
11231
|
});
|
|
11232
11232
|
}
|
|
11233
11233
|
} else
|
|
@@ -11707,7 +11707,7 @@ De.drop = (n, e) => {
|
|
|
11707
11707
|
c.setSelection(new M(h));
|
|
11708
11708
|
else {
|
|
11709
11709
|
let p = c.mapping.map(a);
|
|
11710
|
-
c.mapping.maps[c.mapping.maps.length - 1].forEach((y,
|
|
11710
|
+
c.mapping.maps[c.mapping.maps.length - 1].forEach((y, m, x, k) => p = k), c.setSelection(wu(n, h, c.doc.resolve(p)));
|
|
11711
11711
|
}
|
|
11712
11712
|
n.focus(), n.dispatch(c.setMeta("uiEvent", "drop"));
|
|
11713
11713
|
};
|
|
@@ -12113,15 +12113,15 @@ function Ag(n, e, t, r, s, o, i) {
|
|
|
12113
12113
|
for (let c = 0, u = o; c < t.maps.length; c++) {
|
|
12114
12114
|
let f = 0;
|
|
12115
12115
|
t.maps[c].forEach((d, h, p, y) => {
|
|
12116
|
-
let
|
|
12116
|
+
let m = y - p - (h - d);
|
|
12117
12117
|
for (let x = 0; x < l.length; x += 3) {
|
|
12118
12118
|
let k = l[x + 1];
|
|
12119
12119
|
if (k < 0 || d > k + u - f)
|
|
12120
12120
|
continue;
|
|
12121
12121
|
let C = l[x] + u - f;
|
|
12122
|
-
h >= C ? l[x + 1] = d <= C ? -2 : -1 : d >= u &&
|
|
12122
|
+
h >= C ? l[x + 1] = d <= C ? -2 : -1 : d >= u && m && (l[x] += m, l[x + 1] += m);
|
|
12123
12123
|
}
|
|
12124
|
-
f +=
|
|
12124
|
+
f += m;
|
|
12125
12125
|
}), u = t.maps[c].map(u, -1);
|
|
12126
12126
|
}
|
|
12127
12127
|
let a = !1;
|
|
@@ -12136,9 +12136,9 @@ function Ag(n, e, t, r, s, o, i) {
|
|
|
12136
12136
|
a = !0;
|
|
12137
12137
|
continue;
|
|
12138
12138
|
}
|
|
12139
|
-
let d = t.map(n[c + 1] + o, -1), h = d - s, { index: p, offset: y } = r.content.findIndex(f),
|
|
12140
|
-
if (
|
|
12141
|
-
let x = l[c + 2].mapInner(t,
|
|
12139
|
+
let d = t.map(n[c + 1] + o, -1), h = d - s, { index: p, offset: y } = r.content.findIndex(f), m = r.maybeChild(p);
|
|
12140
|
+
if (m && y == f && y + m.nodeSize == h) {
|
|
12141
|
+
let x = l[c + 2].mapInner(t, m, u + 1, n[c] + o + 1, i);
|
|
12142
12142
|
x != pe ? (l[c] = f, l[c + 1] = h, l[c + 2] = x) : (l[c + 1] = -2, a = !0);
|
|
12143
12143
|
} else
|
|
12144
12144
|
a = !0;
|
|
@@ -12342,7 +12342,7 @@ function Ig(n) {
|
|
|
12342
12342
|
for (let p = 0; ; p++) {
|
|
12343
12343
|
for (; s < r.length && r[s] != 0; ) s++;
|
|
12344
12344
|
if (p == f.childCount) break;
|
|
12345
|
-
const y = f.child(p), { colspan:
|
|
12345
|
+
const y = f.child(p), { colspan: m, rowspan: x, colwidth: k } = y.attrs;
|
|
12346
12346
|
for (let C = 0; C < x; C++) {
|
|
12347
12347
|
if (C + c >= t) {
|
|
12348
12348
|
(o || (o = [])).push({
|
|
@@ -12353,12 +12353,12 @@ function Ig(n) {
|
|
|
12353
12353
|
break;
|
|
12354
12354
|
}
|
|
12355
12355
|
const D = s + C * e;
|
|
12356
|
-
for (let $ = 0; $ <
|
|
12356
|
+
for (let $ = 0; $ < m; $++) {
|
|
12357
12357
|
r[D + $] == 0 ? r[D + $] = u : (o || (o = [])).push({
|
|
12358
12358
|
type: "collision",
|
|
12359
12359
|
row: c,
|
|
12360
12360
|
pos: u,
|
|
12361
|
-
n:
|
|
12361
|
+
n: m - $
|
|
12362
12362
|
});
|
|
12363
12363
|
const E = k && k[$];
|
|
12364
12364
|
if (E) {
|
|
@@ -12367,7 +12367,7 @@ function Ig(n) {
|
|
|
12367
12367
|
}
|
|
12368
12368
|
}
|
|
12369
12369
|
}
|
|
12370
|
-
s +=
|
|
12370
|
+
s += m, u += y.nodeSize;
|
|
12371
12371
|
}
|
|
12372
12372
|
const d = (c + 1) * e;
|
|
12373
12373
|
let h = 0;
|
|
@@ -12652,13 +12652,13 @@ var H = class nt extends V {
|
|
|
12652
12652
|
let p = e.nodeAt(d);
|
|
12653
12653
|
if (!p)
|
|
12654
12654
|
throw RangeError(`No cell with offset ${d} found`);
|
|
12655
|
-
const y = s.left - h.left,
|
|
12656
|
-
if (y > 0 ||
|
|
12655
|
+
const y = s.left - h.left, m = h.right - s.right;
|
|
12656
|
+
if (y > 0 || m > 0) {
|
|
12657
12657
|
let x = p.attrs;
|
|
12658
|
-
if (y > 0 && (x = en(x, 0, y)),
|
|
12658
|
+
if (y > 0 && (x = en(x, 0, y)), m > 0 && (x = en(
|
|
12659
12659
|
x,
|
|
12660
|
-
x.colspan -
|
|
12661
|
-
|
|
12660
|
+
x.colspan - m,
|
|
12661
|
+
m
|
|
12662
12662
|
)), h.left < s.left) {
|
|
12663
12663
|
if (p = p.type.createAndFill(x), !p)
|
|
12664
12664
|
throw RangeError(
|
|
@@ -12902,7 +12902,7 @@ function Ug(n, e, t, r) {
|
|
|
12902
12902
|
let h = "cell";
|
|
12903
12903
|
u.firstChild && (h = u.firstChild.type.spec.tableRole);
|
|
12904
12904
|
const p = [];
|
|
12905
|
-
for (let
|
|
12905
|
+
for (let m = 0; m < d; m++) {
|
|
12906
12906
|
const x = be(n.schema)[h].createAndFill();
|
|
12907
12907
|
x && p.push(x);
|
|
12908
12908
|
}
|
|
@@ -13163,10 +13163,10 @@ function ly(n) {
|
|
|
13163
13163
|
for (let h = u.top; h < u.bottom; h++) {
|
|
13164
13164
|
let p = u.map.positionAt(h, u.left, u.table);
|
|
13165
13165
|
h == u.top && (p += o.nodeSize);
|
|
13166
|
-
for (let y = u.left,
|
|
13166
|
+
for (let y = u.left, m = 0; y < u.right; y++, m++)
|
|
13167
13167
|
y == u.left && h == u.top || f.insert(
|
|
13168
13168
|
d = f.mapping.map(p + u.tableStart, 1),
|
|
13169
|
-
n({ node: o, row: h, col: y }).createAndFill(a[
|
|
13169
|
+
n({ node: o, row: h, col: y }).createAndFill(a[m])
|
|
13170
13170
|
);
|
|
13171
13171
|
}
|
|
13172
13172
|
f.setNodeMarkup(
|
|
@@ -13449,15 +13449,15 @@ function yy(n, e, t, r, s, o, i) {
|
|
|
13449
13449
|
const p = [];
|
|
13450
13450
|
let y;
|
|
13451
13451
|
h.lastChild == null || h.lastChild.type == a.cell ? y = c || (c = a.cell.createAndFill()) : y = u || (u = a.header_cell.createAndFill());
|
|
13452
|
-
for (let
|
|
13452
|
+
for (let m = e.width; m < s; m++) p.push(y);
|
|
13453
13453
|
n.insert(n.mapping.slice(i).map(d - 1 + r), p);
|
|
13454
13454
|
}
|
|
13455
13455
|
if (o > e.height) {
|
|
13456
13456
|
const f = [];
|
|
13457
13457
|
for (let p = 0, y = (e.height - 1) * e.width; p < Math.max(e.width, s); p++) {
|
|
13458
|
-
const
|
|
13458
|
+
const m = p >= e.width ? !1 : t.nodeAt(e.map[y + p]).type == a.header_cell;
|
|
13459
13459
|
f.push(
|
|
13460
|
-
|
|
13460
|
+
m ? u || (u = a.header_cell.createAndFill()) : c || (c = a.cell.createAndFill())
|
|
13461
13461
|
);
|
|
13462
13462
|
}
|
|
13463
13463
|
const d = a.row.create(null, S.from(f)), h = [];
|
|
@@ -13528,10 +13528,10 @@ function la(n, e, t, r, s) {
|
|
|
13528
13528
|
}
|
|
13529
13529
|
yy(f, i, o, t, c, u, d) && h(), oa(f, i, o, t, a, c, l, d) && h(), oa(f, i, o, t, a, c, u, d) && h(), ia(f, i, o, t, l, u, a, d) && h(), ia(f, i, o, t, l, u, c, d) && h();
|
|
13530
13530
|
for (let p = l; p < u; p++) {
|
|
13531
|
-
const y = i.positionAt(p, a, o),
|
|
13531
|
+
const y = i.positionAt(p, a, o), m = i.positionAt(p, c, o);
|
|
13532
13532
|
f.replace(
|
|
13533
13533
|
f.mapping.slice(d).map(y + t),
|
|
13534
|
-
f.mapping.slice(d).map(
|
|
13534
|
+
f.mapping.slice(d).map(m + t),
|
|
13535
13535
|
new w(s.rows[p - l], 0, 0)
|
|
13536
13536
|
);
|
|
13537
13537
|
}
|
|
@@ -14743,8 +14743,8 @@ class pr {
|
|
|
14743
14743
|
let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
|
|
14744
14744
|
const o = Math.min(e, t), i = Math.max(e, t);
|
|
14745
14745
|
for (let p = 0, y = 0; p < this.children.length; p++) {
|
|
14746
|
-
const
|
|
14747
|
-
if (o > y && i < x) return
|
|
14746
|
+
const m = this.children[p], x = y + m.size;
|
|
14747
|
+
if (o > y && i < x) return m.setSelection(e - y - m.border, t - y - m.border, r, s);
|
|
14748
14748
|
y = x;
|
|
14749
14749
|
}
|
|
14750
14750
|
let l = this.domFromPos(e, e ? -1 : 1), a = t == e ? l : this.domFromPos(t, t ? -1 : 1);
|
|
@@ -14755,20 +14755,20 @@ class pr {
|
|
|
14755
14755
|
if (p.nodeType == 3) {
|
|
14756
14756
|
if (f = !!(y && ((h = p.nodeValue) == null ? void 0 : h[y - 1]) == `
|
|
14757
14757
|
`), f && y == p.nodeValue.length)
|
|
14758
|
-
for (let
|
|
14759
|
-
if (x =
|
|
14758
|
+
for (let m = p, x; m; m = m.parentNode) {
|
|
14759
|
+
if (x = m.nextSibling) {
|
|
14760
14760
|
x.nodeName == "BR" && (l = a = {
|
|
14761
14761
|
node: x.parentNode,
|
|
14762
14762
|
offset: xt(x) + 1
|
|
14763
14763
|
});
|
|
14764
14764
|
break;
|
|
14765
14765
|
}
|
|
14766
|
-
const k =
|
|
14766
|
+
const k = m.pmViewDesc;
|
|
14767
14767
|
if (k && k.node && k.node.isBlock) break;
|
|
14768
14768
|
}
|
|
14769
14769
|
} else {
|
|
14770
|
-
const
|
|
14771
|
-
f =
|
|
14770
|
+
const m = p.childNodes[y - 1];
|
|
14771
|
+
f = m && (m.nodeName == "BR" || m.contentEditable == "false");
|
|
14772
14772
|
}
|
|
14773
14773
|
}
|
|
14774
14774
|
if (ue.gecko && u.focusNode && u.focusNode != a.node && u.focusNode.nodeType == 1) {
|
|
@@ -15198,8 +15198,8 @@ function fb(n, e) {
|
|
|
15198
15198
|
}, [
|
|
15199
15199
|
e.dispatchTransaction,
|
|
15200
15200
|
e.state
|
|
15201
|
-
]),
|
|
15202
|
-
|
|
15201
|
+
]), m = rf(), x = document.createElement("div");
|
|
15202
|
+
m();
|
|
15203
15203
|
const k = P(new di(void 0, [], () => -1, c.doc, [], U.empty, x, null, x, () => !1, () => {
|
|
15204
15204
|
}, () => {
|
|
15205
15205
|
}, () => !1)), C = {
|
|
@@ -15292,12 +15292,12 @@ function pi(n, e, t, r, s, o, i, l) {
|
|
|
15292
15292
|
d.current = E;
|
|
15293
15293
|
}, []), p = P(() => !1), y = He((E) => {
|
|
15294
15294
|
p.current = E;
|
|
15295
|
-
}, []),
|
|
15295
|
+
}, []), m = P(() => {
|
|
15296
15296
|
!r.current || !n || (r.current.nodeType == 1 && r.current.classList.add("ProseMirror-selectednode"), (l != null && l.current || !n.type.spec.draggable) && (((t == null ? void 0 : t.current) ?? r.current).draggable = !0));
|
|
15297
15297
|
}), x = P(() => {
|
|
15298
15298
|
!r.current || !n || r.current.nodeType == 1 && (r.current.classList.remove("ProseMirror-selectednode"), (l != null && l.current || !n.type.spec.draggable) && ((t == null ? void 0 : t.current) ?? r.current).removeAttribute("draggable"));
|
|
15299
15299
|
}), k = He((E, L) => {
|
|
15300
|
-
|
|
15300
|
+
m.current = E, x.current = L;
|
|
15301
15301
|
}, []), { siblingsRef: C, parentRef: D } = oe(Oe), $ = P([]);
|
|
15302
15302
|
return X(() => {
|
|
15303
15303
|
const E = C.current;
|
|
@@ -15317,7 +15317,7 @@ function pi(n, e, t, r, s, o, i, l) {
|
|
|
15317
15317
|
// keep it; it won't have changed. This is especially
|
|
15318
15318
|
// important during compositions, where the
|
|
15319
15319
|
// firstChildDesc might not have a correct dom node set yet.
|
|
15320
|
-
(l == null ? void 0 : l.current) ?? f.current.contentDOM ?? (E == null ? void 0 : E.dom.parentElement) ?? null, f.current.nodeDOM = r.current) : f.current = new di(D.current, $.current, e, n, o, s, (t == null ? void 0 : t.current) ?? r.current, (E == null ? void 0 : E.dom.parentElement) ?? null, r.current, (F) => !!d.current(F), () =>
|
|
15320
|
+
(l == null ? void 0 : l.current) ?? f.current.contentDOM ?? (E == null ? void 0 : E.dom.parentElement) ?? null, f.current.nodeDOM = r.current) : f.current = new di(D.current, $.current, e, n, o, s, (t == null ? void 0 : t.current) ?? r.current, (E == null ? void 0 : E.dom.parentElement) ?? null, r.current, (F) => !!d.current(F), () => m.current(), () => x.current(), (F) => p.current(F)), u(f.current.contentDOM !== null), C.current.includes(f.current) || C.current.push(f.current), C.current.sort(sn);
|
|
15321
15321
|
for (const F of $.current)
|
|
15322
15322
|
if (F.parent = f.current, F instanceof ts) {
|
|
15323
15323
|
const I = (L = f.current.contentDOM) == null ? void 0 : L.firstChild;
|
|
@@ -15366,12 +15366,12 @@ function pb(n, e, t, r) {
|
|
|
15366
15366
|
])).push(s[i++]);
|
|
15367
15367
|
if (y) {
|
|
15368
15368
|
y.sort(hb);
|
|
15369
|
-
for (let
|
|
15370
|
-
y[
|
|
15369
|
+
for (let m = 0; m < y.length; m++) t(
|
|
15370
|
+
y[m],
|
|
15371
15371
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15372
|
-
!(y[
|
|
15372
|
+
!(y[m].type instanceof nr),
|
|
15373
15373
|
o,
|
|
15374
|
-
c +
|
|
15374
|
+
c + m,
|
|
15375
15375
|
!!a
|
|
15376
15376
|
);
|
|
15377
15377
|
} else
|
|
@@ -15767,10 +15767,10 @@ const Mb = /* @__PURE__ */ Fe(function(e) {
|
|
|
15767
15767
|
h.current = i;
|
|
15768
15768
|
const p = P(o);
|
|
15769
15769
|
p.current = o;
|
|
15770
|
-
const y = P(null),
|
|
15770
|
+
const y = P(null), m = P(null), x = hi(), k = wb();
|
|
15771
15771
|
X(() => {
|
|
15772
15772
|
var $t, on, Tn;
|
|
15773
|
-
if (
|
|
15773
|
+
if (m.current || (m.current = t(
|
|
15774
15774
|
d.current,
|
|
15775
15775
|
// customNodeView will only be set if view is set, and we can only reach
|
|
15776
15776
|
// this line if customNodeView is set
|
|
@@ -15779,26 +15779,26 @@ const Mb = /* @__PURE__ */ Fe(function(e) {
|
|
|
15779
15779
|
f,
|
|
15780
15780
|
h.current,
|
|
15781
15781
|
p.current
|
|
15782
|
-
),
|
|
15783
|
-
})),
|
|
15784
|
-
const { dom: Ee } =
|
|
15782
|
+
), m.current.stopEvent && $(m.current.stopEvent.bind(m.current)), m.current.selectNode && E(m.current.selectNode.bind(m.current), (($t = m.current.deselectNode) == null ? void 0 : $t.bind(m.current)) ?? (() => {
|
|
15783
|
+
})), m.current.ignoreMutation && L(m.current.ignoreMutation.bind(m.current)), x()), !y.current) return;
|
|
15784
|
+
const { dom: Ee } = m.current;
|
|
15785
15785
|
if (y.current.firstChild === Ee)
|
|
15786
15786
|
return;
|
|
15787
|
-
c.current = y.current, y.current.appendChild(Ee), (l == null ? void 0 : l.state.selection) instanceof M && l.state.selection.node === d.current && ((Tn = (on =
|
|
15788
|
-
const $e =
|
|
15787
|
+
c.current = y.current, y.current.appendChild(Ee), (l == null ? void 0 : l.state.selection) instanceof M && l.state.selection.node === d.current && ((Tn = (on = m.current).selectNode) == null || Tn.call(on));
|
|
15788
|
+
const $e = m.current;
|
|
15789
15789
|
return () => {
|
|
15790
15790
|
var mr;
|
|
15791
|
-
(mr = $e.destroy) == null || mr.call($e),
|
|
15791
|
+
(mr = $e.destroy) == null || mr.call($e), m.current = null;
|
|
15792
15792
|
};
|
|
15793
15793
|
}, [
|
|
15794
15794
|
t,
|
|
15795
15795
|
f,
|
|
15796
15796
|
l
|
|
15797
15797
|
]), X(() => {
|
|
15798
|
-
if (!t || !
|
|
15799
|
-
const { destroy: Ee, update: $e } =
|
|
15800
|
-
if ((($e == null ? void 0 : $e.call(
|
|
15801
|
-
|
|
15798
|
+
if (!t || !m.current) return;
|
|
15799
|
+
const { destroy: Ee, update: $e } = m.current;
|
|
15800
|
+
if ((($e == null ? void 0 : $e.call(m.current, r, i, o)) ?? !0) || (Ee == null || Ee.call(m.current), !y.current)) return;
|
|
15801
|
+
m.current = t(
|
|
15802
15802
|
d.current,
|
|
15803
15803
|
// customNodeView will only be set if view is set, and we can only reach
|
|
15804
15804
|
// this line if customNodeView is set
|
|
@@ -15808,7 +15808,7 @@ const Mb = /* @__PURE__ */ Fe(function(e) {
|
|
|
15808
15808
|
h.current,
|
|
15809
15809
|
p.current
|
|
15810
15810
|
);
|
|
15811
|
-
const { dom: on } =
|
|
15811
|
+
const { dom: on } = m.current;
|
|
15812
15812
|
c.current = y.current, y.current.appendChild(on);
|
|
15813
15813
|
}, [
|
|
15814
15814
|
t,
|
|
@@ -15827,7 +15827,7 @@ const Mb = /* @__PURE__ */ Fe(function(e) {
|
|
|
15827
15827
|
D
|
|
15828
15828
|
]);
|
|
15829
15829
|
if (!k) return null;
|
|
15830
|
-
|
|
15830
|
+
m.current || (m.current = t(
|
|
15831
15831
|
d.current,
|
|
15832
15832
|
// customNodeView will only be set if view is set, and we can only reach
|
|
15833
15833
|
// this line if customNodeView is set
|
|
@@ -15836,9 +15836,9 @@ const Mb = /* @__PURE__ */ Fe(function(e) {
|
|
|
15836
15836
|
() => s.current(),
|
|
15837
15837
|
h.current,
|
|
15838
15838
|
p.current
|
|
15839
|
-
),
|
|
15840
|
-
})),
|
|
15841
|
-
const { contentDOM: I } =
|
|
15839
|
+
), m.current.stopEvent && $(m.current.stopEvent.bind(m.current)), m.current.selectNode && E(m.current.selectNode.bind(m.current), ((dt = m.current.deselectNode) == null ? void 0 : dt.bind(m.current)) ?? (() => {
|
|
15840
|
+
})), m.current.ignoreMutation && L(m.current.ignoreMutation.bind(m.current)));
|
|
15841
|
+
const { contentDOM: I } = m.current;
|
|
15842
15842
|
u.current = I ?? null;
|
|
15843
15843
|
const _ = /* @__PURE__ */ Hn(r.isInline ? "span" : "div", {
|
|
15844
15844
|
ref: y,
|
|
@@ -15871,7 +15871,7 @@ const Mb = /* @__PURE__ */ Fe(function(e) {
|
|
|
15871
15871
|
return (_ = (I = s.type.spec).toDOM) == null ? void 0 : _.call(I, s);
|
|
15872
15872
|
}, [
|
|
15873
15873
|
s
|
|
15874
|
-
]), { hasContentDOM: y, childDescriptors:
|
|
15874
|
+
]), { hasContentDOM: y, childDescriptors: m, setStopEvent: x, setSelectNode: k, setIgnoreMutation: C, nodeViewDescRef: D } = pi(s, () => r.current(), l, a, o, t, void 0, c), $ = {
|
|
15875
15875
|
...i,
|
|
15876
15876
|
...!y && {
|
|
15877
15877
|
contentEditable: !1
|
|
@@ -15917,9 +15917,9 @@ const Mb = /* @__PURE__ */ Fe(function(e) {
|
|
|
15917
15917
|
)
|
|
15918
15918
|
), F = Me(() => ({
|
|
15919
15919
|
parentRef: D,
|
|
15920
|
-
siblingsRef:
|
|
15920
|
+
siblingsRef: m
|
|
15921
15921
|
}), [
|
|
15922
|
-
|
|
15922
|
+
m,
|
|
15923
15923
|
D
|
|
15924
15924
|
]);
|
|
15925
15925
|
return /* @__PURE__ */ R.createElement(Db.Provider, {
|
|
@@ -16556,40 +16556,40 @@ const or = /* @__PURE__ */ Fe(function(e) {
|
|
|
16556
16556
|
if (!r) return null;
|
|
16557
16557
|
const a = /* @__PURE__ */ new Set();
|
|
16558
16558
|
let c = [], u = null;
|
|
16559
|
-
pb(r, s, (p, y,
|
|
16559
|
+
pb(r, s, (p, y, m, x) => {
|
|
16560
16560
|
const k = p.type.spec.marks ?? [];
|
|
16561
16561
|
let C;
|
|
16562
16562
|
if (y) {
|
|
16563
|
-
C = Xs(i.current(),
|
|
16563
|
+
C = Xs(i.current(), m, "native-widget", o == null ? void 0 : o.posToKey, p, x);
|
|
16564
16564
|
const $ = {
|
|
16565
16565
|
type: "native-widget",
|
|
16566
16566
|
widget: p,
|
|
16567
16567
|
marks: k,
|
|
16568
|
-
offset:
|
|
16568
|
+
offset: m,
|
|
16569
16569
|
index: x,
|
|
16570
16570
|
key: C
|
|
16571
16571
|
}, E = l.get(C);
|
|
16572
|
-
E && Gs(E, $) ? E.offset =
|
|
16572
|
+
E && Gs(E, $) ? E.offset = m : l.set(C, $), a.add(C);
|
|
16573
16573
|
} else {
|
|
16574
|
-
C = Xs(i.current(),
|
|
16574
|
+
C = Xs(i.current(), m, "widget", o == null ? void 0 : o.posToKey, p, x);
|
|
16575
16575
|
const $ = {
|
|
16576
16576
|
type: "widget",
|
|
16577
16577
|
widget: p,
|
|
16578
16578
|
marks: k,
|
|
16579
|
-
offset:
|
|
16579
|
+
offset: m,
|
|
16580
16580
|
index: x,
|
|
16581
16581
|
key: C
|
|
16582
16582
|
}, E = l.get(C);
|
|
16583
|
-
E && Gs(E, $) ? E.offset =
|
|
16583
|
+
E && Gs(E, $) ? E.offset = m : l.set(C, $), a.add(C);
|
|
16584
16584
|
}
|
|
16585
16585
|
const D = l.get(C);
|
|
16586
16586
|
c.push(D), Lb(u, l.get(C));
|
|
16587
|
-
}, (p, y,
|
|
16587
|
+
}, (p, y, m, x) => {
|
|
16588
16588
|
const k = Xs(i.current(), x, "node", o == null ? void 0 : o.posToKey), C = {
|
|
16589
16589
|
type: "node",
|
|
16590
16590
|
node: p,
|
|
16591
16591
|
marks: p.marks,
|
|
16592
|
-
innerDeco:
|
|
16592
|
+
innerDeco: m,
|
|
16593
16593
|
outerDeco: y,
|
|
16594
16594
|
offset: x,
|
|
16595
16595
|
key: k
|
|
@@ -16641,8 +16641,8 @@ const or = /* @__PURE__ */ Fe(function(e) {
|
|
|
16641
16641
|
innerDecorations: o
|
|
16642
16642
|
})));
|
|
16643
16643
|
if (!s) return y;
|
|
16644
|
-
const
|
|
16645
|
-
return
|
|
16644
|
+
const m = i.filter((k) => !k.inline);
|
|
16645
|
+
return m.length ? m.reduce(ms, y) : y;
|
|
16646
16646
|
})), df = /* @__PURE__ */ ct(null);
|
|
16647
16647
|
function Jb(n, e) {
|
|
16648
16648
|
let { as: t, ...r } = n;
|
|
@@ -17136,7 +17136,7 @@ const Yb = ["p", 0], Gb = ["blockquote", 0], Xb = ["hr"], Qb = ["pre", ["code",
|
|
|
17136
17136
|
const a = fe((c) => {
|
|
17137
17137
|
c && (s || e.command(c.state, c.dispatch, c), c.focus());
|
|
17138
17138
|
});
|
|
17139
|
-
return i ? null : /* @__PURE__ */
|
|
17139
|
+
return i ? null : /* @__PURE__ */ g.jsx(
|
|
17140
17140
|
"div",
|
|
17141
17141
|
{
|
|
17142
17142
|
ref: n,
|
|
@@ -17153,26 +17153,26 @@ const Yb = ["p", 0], Gb = ["blockquote", 0], Xb = ["hr"], Qb = ["pre", ["code",
|
|
|
17153
17153
|
if (t(void 0), s(void 0), n.nodes.paragraph) {
|
|
17154
17154
|
const o = n.nodes.paragraph;
|
|
17155
17155
|
t({
|
|
17156
|
-
icon: /* @__PURE__ */
|
|
17156
|
+
icon: /* @__PURE__ */ g.jsx(O.Type, {}),
|
|
17157
17157
|
command: Sn(o)
|
|
17158
17158
|
});
|
|
17159
17159
|
}
|
|
17160
17160
|
if (n.nodes.code_block) {
|
|
17161
17161
|
const o = n.nodes.code_block;
|
|
17162
17162
|
s({
|
|
17163
|
-
icon: /* @__PURE__ */
|
|
17163
|
+
icon: /* @__PURE__ */ g.jsx(O.CodeXml, {}),
|
|
17164
17164
|
command: Sn(o)
|
|
17165
17165
|
});
|
|
17166
17166
|
}
|
|
17167
|
-
}, [n]), /* @__PURE__ */
|
|
17168
|
-
e && /* @__PURE__ */
|
|
17169
|
-
r && /* @__PURE__ */
|
|
17167
|
+
}, [n]), /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
|
|
17168
|
+
e && /* @__PURE__ */ g.jsx(ir, { item: e }),
|
|
17169
|
+
r && /* @__PURE__ */ g.jsx(ir, { item: r })
|
|
17170
17170
|
] });
|
|
17171
|
-
}, xs = ({ items: n }) => /* @__PURE__ */
|
|
17171
|
+
}, xs = ({ items: n }) => /* @__PURE__ */ g.jsx("div", { className: "MenuBlock", children: n.map((e, t) => /* @__PURE__ */ g.jsx(ir, { item: e }, t)) }), m0 = ({ schema: n, isOpen: e, onClose: t }) => {
|
|
17172
17172
|
const r = fe((s, o) => {
|
|
17173
17173
|
s && (Ce(n.marks.link, { href: o })(s.state, s.dispatch), t(), s.focus());
|
|
17174
17174
|
});
|
|
17175
|
-
return /* @__PURE__ */
|
|
17175
|
+
return /* @__PURE__ */ g.jsx(
|
|
17176
17176
|
Ff,
|
|
17177
17177
|
{
|
|
17178
17178
|
title: "Введите URL для ссылки",
|
|
@@ -17188,7 +17188,7 @@ const Yb = ["p", 0], Gb = ["blockquote", 0], Xb = ["hr"], Qb = ["pre", ["code",
|
|
|
17188
17188
|
if (n.marks.strong) {
|
|
17189
17189
|
const i = n.marks.strong;
|
|
17190
17190
|
o.push({
|
|
17191
|
-
icon: /* @__PURE__ */
|
|
17191
|
+
icon: /* @__PURE__ */ g.jsx(O.Bold, {}),
|
|
17192
17192
|
command: Ce(i),
|
|
17193
17193
|
isActive: (l) => Bt(l, i)
|
|
17194
17194
|
});
|
|
@@ -17196,7 +17196,7 @@ const Yb = ["p", 0], Gb = ["blockquote", 0], Xb = ["hr"], Qb = ["pre", ["code",
|
|
|
17196
17196
|
if (n.marks.em) {
|
|
17197
17197
|
const i = n.marks.em;
|
|
17198
17198
|
o.push({
|
|
17199
|
-
icon: /* @__PURE__ */
|
|
17199
|
+
icon: /* @__PURE__ */ g.jsx(O.Italic, {}),
|
|
17200
17200
|
command: Ce(i),
|
|
17201
17201
|
isActive: (l) => Bt(l, i)
|
|
17202
17202
|
});
|
|
@@ -17204,7 +17204,7 @@ const Yb = ["p", 0], Gb = ["blockquote", 0], Xb = ["hr"], Qb = ["pre", ["code",
|
|
|
17204
17204
|
if (n.marks.underline) {
|
|
17205
17205
|
const i = n.marks.underline;
|
|
17206
17206
|
o.push({
|
|
17207
|
-
icon: /* @__PURE__ */
|
|
17207
|
+
icon: /* @__PURE__ */ g.jsx(O.Underline, {}),
|
|
17208
17208
|
command: Ce(i),
|
|
17209
17209
|
isActive: (l) => Bt(l, i)
|
|
17210
17210
|
});
|
|
@@ -17212,7 +17212,7 @@ const Yb = ["p", 0], Gb = ["blockquote", 0], Xb = ["hr"], Qb = ["pre", ["code",
|
|
|
17212
17212
|
if (n.marks.strikethrough) {
|
|
17213
17213
|
const i = n.marks.strikethrough;
|
|
17214
17214
|
o.push({
|
|
17215
|
-
icon: /* @__PURE__ */
|
|
17215
|
+
icon: /* @__PURE__ */ g.jsx(O.Strikethrough, {}),
|
|
17216
17216
|
command: Ce(i),
|
|
17217
17217
|
isActive: (l) => Bt(l, i)
|
|
17218
17218
|
});
|
|
@@ -17220,7 +17220,7 @@ const Yb = ["p", 0], Gb = ["blockquote", 0], Xb = ["hr"], Qb = ["pre", ["code",
|
|
|
17220
17220
|
if (n.marks.code) {
|
|
17221
17221
|
const i = n.marks.code;
|
|
17222
17222
|
o.push({
|
|
17223
|
-
icon: /* @__PURE__ */
|
|
17223
|
+
icon: /* @__PURE__ */ g.jsx(O.Code, {}),
|
|
17224
17224
|
command: Ce(i),
|
|
17225
17225
|
isActive: (l) => Bt(l, i)
|
|
17226
17226
|
});
|
|
@@ -17228,29 +17228,29 @@ const Yb = ["p", 0], Gb = ["blockquote", 0], Xb = ["hr"], Qb = ["pre", ["code",
|
|
|
17228
17228
|
if (n.marks.link) {
|
|
17229
17229
|
const i = n.marks.link;
|
|
17230
17230
|
o.push({
|
|
17231
|
-
icon: /* @__PURE__ */
|
|
17231
|
+
icon: /* @__PURE__ */ g.jsx(O.Link, {}),
|
|
17232
17232
|
isActive: (l) => Bt(l, i),
|
|
17233
17233
|
isDisabled: (l) => l.selection.empty ? !0 : !Ce(i)(l),
|
|
17234
17234
|
command: (l, a, c) => (Bt(l, i) ? (Ce(i)(l, a), c == null || c.focus()) : s(!0), !0)
|
|
17235
17235
|
});
|
|
17236
17236
|
}
|
|
17237
17237
|
t(o);
|
|
17238
|
-
}, [n]), e.length < 1 ? null : /* @__PURE__ */
|
|
17239
|
-
/* @__PURE__ */
|
|
17240
|
-
/* @__PURE__ */
|
|
17238
|
+
}, [n]), e.length < 1 ? null : /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
|
|
17239
|
+
/* @__PURE__ */ g.jsx(xs, { items: e }),
|
|
17240
|
+
/* @__PURE__ */ g.jsx(m0, { isOpen: r, schema: n, onClose: () => s(!1) })
|
|
17241
17241
|
] });
|
|
17242
17242
|
};
|
|
17243
17243
|
function Bt(n, e) {
|
|
17244
17244
|
let { from: t, $from: r, to: s, empty: o } = n.selection;
|
|
17245
17245
|
return o ? !!e.isInSet(n.storedMarks || r.marks()) : n.doc.rangeHasMark(t, s, e);
|
|
17246
17246
|
}
|
|
17247
|
-
const kf = () => /* @__PURE__ */
|
|
17248
|
-
/* @__PURE__ */
|
|
17249
|
-
icon: /* @__PURE__ */
|
|
17247
|
+
const kf = () => /* @__PURE__ */ g.jsxs("div", { className: "MenuBlock", children: [
|
|
17248
|
+
/* @__PURE__ */ g.jsx(ir, { item: {
|
|
17249
|
+
icon: /* @__PURE__ */ g.jsx(O.Undo, {}),
|
|
17250
17250
|
command: Bo
|
|
17251
17251
|
} }),
|
|
17252
|
-
/* @__PURE__ */
|
|
17253
|
-
icon: /* @__PURE__ */
|
|
17252
|
+
/* @__PURE__ */ g.jsx(ir, { item: {
|
|
17253
|
+
icon: /* @__PURE__ */ g.jsx(O.Redo, {}),
|
|
17254
17254
|
command: Br
|
|
17255
17255
|
} })
|
|
17256
17256
|
] }), Cf = ({ schema: n }) => {
|
|
@@ -17260,7 +17260,7 @@ const kf = () => /* @__PURE__ */ m.jsxs("div", { className: "MenuBlock", childre
|
|
|
17260
17260
|
if (n.nodes.bullet_list) {
|
|
17261
17261
|
const s = n.nodes.bullet_list;
|
|
17262
17262
|
r.push({
|
|
17263
|
-
icon: /* @__PURE__ */
|
|
17263
|
+
icon: /* @__PURE__ */ g.jsx(O.List, {}),
|
|
17264
17264
|
command: (o, i) => Kr(s)(o, i)
|
|
17265
17265
|
//isSelected: (s) => wrapInList(node)(s),
|
|
17266
17266
|
});
|
|
@@ -17268,7 +17268,7 @@ const kf = () => /* @__PURE__ */ m.jsxs("div", { className: "MenuBlock", childre
|
|
|
17268
17268
|
if (n.nodes.ordered_list) {
|
|
17269
17269
|
const s = n.nodes.ordered_list;
|
|
17270
17270
|
r.push({
|
|
17271
|
-
icon: /* @__PURE__ */
|
|
17271
|
+
icon: /* @__PURE__ */ g.jsx(O.ListOrdered, {}),
|
|
17272
17272
|
command: (o, i) => Kr(s)(o, i)
|
|
17273
17273
|
//isSelected: (s) => wrapInList(node)(s),
|
|
17274
17274
|
});
|
|
@@ -17276,13 +17276,13 @@ const kf = () => /* @__PURE__ */ m.jsxs("div", { className: "MenuBlock", childre
|
|
|
17276
17276
|
if (n.nodes.blockquote) {
|
|
17277
17277
|
const s = n.nodes.blockquote;
|
|
17278
17278
|
r.push({
|
|
17279
|
-
icon: /* @__PURE__ */
|
|
17279
|
+
icon: /* @__PURE__ */ g.jsx(O.Quote, {}),
|
|
17280
17280
|
command: (o, i) => Oc(s)(o, i)
|
|
17281
17281
|
//isSelected: (s) => wrapIn(node)(s),
|
|
17282
17282
|
});
|
|
17283
17283
|
}
|
|
17284
17284
|
t(r);
|
|
17285
|
-
}, [n]), e.length < 1 ? null : /* @__PURE__ */
|
|
17285
|
+
}, [n]), e.length < 1 ? null : /* @__PURE__ */ g.jsx(xs, { items: e });
|
|
17286
17286
|
}, wf = ({ isOpen: n, onClose: e }) => {
|
|
17287
17287
|
const [t, r] = N(""), [s, o] = N(), [i, l] = N(""), [a, c] = N(!1);
|
|
17288
17288
|
q(() => {
|
|
@@ -17295,9 +17295,9 @@ const kf = () => /* @__PURE__ */ m.jsxs("div", { className: "MenuBlock", childre
|
|
|
17295
17295
|
const u = fe((f) => {
|
|
17296
17296
|
f && (a ? _m(f, s, i) : qm(f, t, i), f.focus(), e());
|
|
17297
17297
|
});
|
|
17298
|
-
return /* @__PURE__ */
|
|
17299
|
-
/* @__PURE__ */
|
|
17300
|
-
/* @__PURE__ */
|
|
17298
|
+
return /* @__PURE__ */ g.jsxs(Pa, { isOpen: n, onClose: e, children: [
|
|
17299
|
+
/* @__PURE__ */ g.jsx("h1", { children: "Вставка картинки" }),
|
|
17300
|
+
/* @__PURE__ */ g.jsxs(
|
|
17301
17301
|
va,
|
|
17302
17302
|
{
|
|
17303
17303
|
submit: "Вставить",
|
|
@@ -17305,21 +17305,21 @@ const kf = () => /* @__PURE__ */ m.jsxs("div", { className: "MenuBlock", childre
|
|
|
17305
17305
|
onSubmit: u,
|
|
17306
17306
|
onCancel: e,
|
|
17307
17307
|
children: [
|
|
17308
|
-
a ? /* @__PURE__ */
|
|
17308
|
+
a ? /* @__PURE__ */ g.jsx(
|
|
17309
17309
|
Bf,
|
|
17310
17310
|
{
|
|
17311
17311
|
id: "image",
|
|
17312
17312
|
value: s,
|
|
17313
17313
|
onChange: o,
|
|
17314
|
-
text: /* @__PURE__ */
|
|
17315
|
-
/* @__PURE__ */
|
|
17316
|
-
/* @__PURE__ */
|
|
17314
|
+
text: /* @__PURE__ */ g.jsxs("span", { children: [
|
|
17315
|
+
/* @__PURE__ */ g.jsx(O.Image, {}),
|
|
17316
|
+
/* @__PURE__ */ g.jsx("br", {}),
|
|
17317
17317
|
"Выберите файл"
|
|
17318
17318
|
] }),
|
|
17319
17319
|
required: !0,
|
|
17320
17320
|
label: "Картинка"
|
|
17321
17321
|
}
|
|
17322
|
-
) : /* @__PURE__ */
|
|
17322
|
+
) : /* @__PURE__ */ g.jsx(
|
|
17323
17323
|
Pr,
|
|
17324
17324
|
{
|
|
17325
17325
|
id: "href",
|
|
@@ -17329,7 +17329,7 @@ const kf = () => /* @__PURE__ */ m.jsxs("div", { className: "MenuBlock", childre
|
|
|
17329
17329
|
label: "Ссылка на картинку"
|
|
17330
17330
|
}
|
|
17331
17331
|
),
|
|
17332
|
-
/* @__PURE__ */
|
|
17332
|
+
/* @__PURE__ */ g.jsx(
|
|
17333
17333
|
Pr,
|
|
17334
17334
|
{
|
|
17335
17335
|
id: "value",
|
|
@@ -17353,9 +17353,9 @@ const kf = () => /* @__PURE__ */ m.jsxs("div", { className: "MenuBlock", childre
|
|
|
17353
17353
|
const u = bs(r);
|
|
17354
17354
|
a.dispatch(a.state.tr.replaceSelectionWith(c.create({ src: u, title: o }))), a.focus(), t();
|
|
17355
17355
|
});
|
|
17356
|
-
return n.nodes.video ? /* @__PURE__ */
|
|
17357
|
-
/* @__PURE__ */
|
|
17358
|
-
/* @__PURE__ */
|
|
17356
|
+
return n.nodes.video ? /* @__PURE__ */ g.jsxs(Pa, { isOpen: e, onClose: t, children: [
|
|
17357
|
+
/* @__PURE__ */ g.jsx("h1", { children: "Вставка видео" }),
|
|
17358
|
+
/* @__PURE__ */ g.jsxs(
|
|
17359
17359
|
va,
|
|
17360
17360
|
{
|
|
17361
17361
|
submit: "Вставить",
|
|
@@ -17363,7 +17363,7 @@ const kf = () => /* @__PURE__ */ m.jsxs("div", { className: "MenuBlock", childre
|
|
|
17363
17363
|
onSubmit: l,
|
|
17364
17364
|
onCancel: t,
|
|
17365
17365
|
children: [
|
|
17366
|
-
/* @__PURE__ */
|
|
17366
|
+
/* @__PURE__ */ g.jsx(
|
|
17367
17367
|
Pr,
|
|
17368
17368
|
{
|
|
17369
17369
|
id: "src",
|
|
@@ -17374,7 +17374,7 @@ const kf = () => /* @__PURE__ */ m.jsxs("div", { className: "MenuBlock", childre
|
|
|
17374
17374
|
required: !0
|
|
17375
17375
|
}
|
|
17376
17376
|
),
|
|
17377
|
-
/* @__PURE__ */
|
|
17377
|
+
/* @__PURE__ */ g.jsx(
|
|
17378
17378
|
Pr,
|
|
17379
17379
|
{
|
|
17380
17380
|
id: "value",
|
|
@@ -17394,7 +17394,7 @@ const kf = () => /* @__PURE__ */ m.jsxs("div", { className: "MenuBlock", childre
|
|
|
17394
17394
|
if (n.nodes.image) {
|
|
17395
17395
|
const a = n.nodes.image;
|
|
17396
17396
|
l.push({
|
|
17397
|
-
icon: /* @__PURE__ */
|
|
17397
|
+
icon: /* @__PURE__ */ g.jsx(O.Image, {}),
|
|
17398
17398
|
isDisabled: (c) => !Zs(c, a),
|
|
17399
17399
|
command: () => (s(!0), !0)
|
|
17400
17400
|
});
|
|
@@ -17402,7 +17402,7 @@ const kf = () => /* @__PURE__ */ m.jsxs("div", { className: "MenuBlock", childre
|
|
|
17402
17402
|
if (n.nodes.video) {
|
|
17403
17403
|
const a = n.nodes.video;
|
|
17404
17404
|
l.push({
|
|
17405
|
-
icon: /* @__PURE__ */
|
|
17405
|
+
icon: /* @__PURE__ */ g.jsx(O.Film, {}),
|
|
17406
17406
|
isDisabled: (c) => !Zs(c, a),
|
|
17407
17407
|
command: () => (i(!0), !0)
|
|
17408
17408
|
});
|
|
@@ -17410,20 +17410,20 @@ const kf = () => /* @__PURE__ */ m.jsxs("div", { className: "MenuBlock", childre
|
|
|
17410
17410
|
if (n.nodes.horizontal_rule) {
|
|
17411
17411
|
const a = n.nodes.horizontal_rule;
|
|
17412
17412
|
l.push({
|
|
17413
|
-
icon: /* @__PURE__ */
|
|
17413
|
+
icon: /* @__PURE__ */ g.jsx(O.FlipVertical, {}),
|
|
17414
17414
|
isDisabled: (c) => !Zs(c, a),
|
|
17415
17415
|
command: (c, u) => u ? (u(c.tr.replaceSelectionWith(a.create())), !0) : !1
|
|
17416
17416
|
});
|
|
17417
17417
|
}
|
|
17418
17418
|
n.nodes.table && l.push({
|
|
17419
|
-
icon: /* @__PURE__ */
|
|
17419
|
+
icon: /* @__PURE__ */ g.jsx(O.Table, {}),
|
|
17420
17420
|
isDisabled: Ve,
|
|
17421
17421
|
command: y0()
|
|
17422
17422
|
}), t(l);
|
|
17423
|
-
}, [n]), e.length < 1 ? null : /* @__PURE__ */
|
|
17424
|
-
/* @__PURE__ */
|
|
17425
|
-
/* @__PURE__ */
|
|
17426
|
-
/* @__PURE__ */
|
|
17423
|
+
}, [n]), e.length < 1 ? null : /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
|
|
17424
|
+
/* @__PURE__ */ g.jsx(xs, { items: e }),
|
|
17425
|
+
/* @__PURE__ */ g.jsx(wf, { isOpen: r, onClose: () => s(!1) }),
|
|
17426
|
+
/* @__PURE__ */ g.jsx(g0, { isOpen: o, schema: n, onClose: () => i(!1) })
|
|
17427
17427
|
] });
|
|
17428
17428
|
}, Zs = (n, e) => {
|
|
17429
17429
|
let t = n.selection.$from;
|
|
@@ -17457,50 +17457,50 @@ function y0() {
|
|
|
17457
17457
|
), !0;
|
|
17458
17458
|
};
|
|
17459
17459
|
}
|
|
17460
|
-
const Nf = () => /* @__PURE__ */
|
|
17461
|
-
icon: /* @__PURE__ */
|
|
17460
|
+
const Nf = () => /* @__PURE__ */ g.jsx(xs, { items: [{
|
|
17461
|
+
icon: /* @__PURE__ */ g.jsx(O.JoinUp, {}),
|
|
17462
17462
|
command: kc
|
|
17463
17463
|
}, {
|
|
17464
|
-
icon: /* @__PURE__ */
|
|
17464
|
+
icon: /* @__PURE__ */ g.jsx(O.IndentDecrease, {}),
|
|
17465
17465
|
command: Cc
|
|
17466
17466
|
}, {
|
|
17467
|
-
icon: /* @__PURE__ */
|
|
17467
|
+
icon: /* @__PURE__ */ g.jsx(O.SquareDashed, {}),
|
|
17468
17468
|
command: Mc
|
|
17469
|
-
}] }), b0 = ({ schema: n }) => /* @__PURE__ */
|
|
17470
|
-
/* @__PURE__ */
|
|
17471
|
-
/* @__PURE__ */
|
|
17472
|
-
/* @__PURE__ */
|
|
17473
|
-
/* @__PURE__ */
|
|
17474
|
-
/* @__PURE__ */
|
|
17475
|
-
/* @__PURE__ */
|
|
17469
|
+
}] }), b0 = ({ schema: n }) => /* @__PURE__ */ g.jsxs("div", { className: "SimpleMenuBar", children: [
|
|
17470
|
+
/* @__PURE__ */ g.jsx("div", { className: "MenuBlock", children: /* @__PURE__ */ g.jsx(xf, { schema: n }) }),
|
|
17471
|
+
/* @__PURE__ */ g.jsx(Sf, { schema: n }),
|
|
17472
|
+
/* @__PURE__ */ g.jsx(Mf, { schema: n }),
|
|
17473
|
+
/* @__PURE__ */ g.jsx(Cf, { schema: n }),
|
|
17474
|
+
/* @__PURE__ */ g.jsx(Nf, {}),
|
|
17475
|
+
/* @__PURE__ */ g.jsx(kf, {})
|
|
17476
17476
|
] }), Df = Ge(
|
|
17477
17477
|
function({ children: e, nodeProps: t, ...r }, s) {
|
|
17478
17478
|
const [o, i] = N(t.node.attrs.title ?? ""), [l, a] = N(!1), [c, u] = N("");
|
|
17479
17479
|
yi(() => !0), ft((p) => {
|
|
17480
17480
|
if (u(""), a(!1), !p || !p.state.schema.nodes.carousel) return;
|
|
17481
|
-
const y = t.getPos(),
|
|
17482
|
-
if (a(
|
|
17481
|
+
const y = t.getPos(), m = p.state.doc.resolve(y).parent;
|
|
17482
|
+
if (a(m.type.name !== "carousel"), m.type.name === "carousel") {
|
|
17483
17483
|
let x = 0;
|
|
17484
|
-
|
|
17484
|
+
m.forEach((k, C) => {
|
|
17485
17485
|
k === t.node && (x = C + 1);
|
|
17486
|
-
}), u(x ? `${x} / ${
|
|
17486
|
+
}), u(x ? `${x} / ${m.childCount}` : "");
|
|
17487
17487
|
}
|
|
17488
17488
|
});
|
|
17489
17489
|
const f = fe((p, y) => {
|
|
17490
17490
|
if (!p) return;
|
|
17491
17491
|
i(y);
|
|
17492
|
-
const
|
|
17493
|
-
p.dispatch(
|
|
17492
|
+
const m = p.state.tr, x = t.getPos();
|
|
17493
|
+
p.dispatch(m.setNodeMarkup(x, null, { ...t.node.attrs, title: y })), p.focus();
|
|
17494
17494
|
}), d = fe((p) => {
|
|
17495
17495
|
if (!p) return;
|
|
17496
|
-
const y = t.getPos(),
|
|
17497
|
-
p.dispatch(p.state.tr.replaceWith(y, y +
|
|
17496
|
+
const y = t.getPos(), m = t.node.nodeSize, x = t.node.attrs, k = p.state.schema, C = k.nodes.carousel.create(null, k.nodes.image.create(x));
|
|
17497
|
+
p.dispatch(p.state.tr.replaceWith(y, y + m, C));
|
|
17498
17498
|
}), h = fe((p) => {
|
|
17499
17499
|
if (!p) return;
|
|
17500
|
-
const y = t.getPos(),
|
|
17501
|
-
|
|
17500
|
+
const y = p.state.tr, m = t.getPos(), x = t.node.nodeSize, k = p.state.doc.resolve(m).parent;
|
|
17501
|
+
k.type.name === "carousel" && k.childCount === 1 ? p.dispatch(y.delete(m - 1, m - 1 + k.nodeSize)) : p.dispatch(y.delete(m, m + x));
|
|
17502
17502
|
});
|
|
17503
|
-
return /* @__PURE__ */
|
|
17503
|
+
return /* @__PURE__ */ g.jsxs(
|
|
17504
17504
|
"div",
|
|
17505
17505
|
{
|
|
17506
17506
|
...r,
|
|
@@ -17508,12 +17508,12 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
17508
17508
|
className: "image",
|
|
17509
17509
|
title: t.node.attrs.title,
|
|
17510
17510
|
children: [
|
|
17511
|
-
/* @__PURE__ */
|
|
17512
|
-
l && /* @__PURE__ */
|
|
17513
|
-
c && /* @__PURE__ */
|
|
17514
|
-
/* @__PURE__ */
|
|
17511
|
+
/* @__PURE__ */ g.jsxs("div", { className: "image-buttons", children: [
|
|
17512
|
+
l && /* @__PURE__ */ g.jsx("div", { onClick: d, className: "text-button", children: "Сделать карусель" }),
|
|
17513
|
+
c && /* @__PURE__ */ g.jsx("div", { className: "text-button", children: c }),
|
|
17514
|
+
/* @__PURE__ */ g.jsx("div", { onClick: h, children: /* @__PURE__ */ g.jsx(O.Trash, {}) })
|
|
17515
17515
|
] }),
|
|
17516
|
-
/* @__PURE__ */
|
|
17516
|
+
/* @__PURE__ */ g.jsx(
|
|
17517
17517
|
"img",
|
|
17518
17518
|
{
|
|
17519
17519
|
title: t.node.attrs.title,
|
|
@@ -17521,7 +17521,7 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
17521
17521
|
src: t.node.attrs.fid ? `${gs}/files/${t.node.attrs.fid}` : t.node.attrs.src
|
|
17522
17522
|
}
|
|
17523
17523
|
),
|
|
17524
|
-
/* @__PURE__ */
|
|
17524
|
+
/* @__PURE__ */ g.jsx("div", { children: /* @__PURE__ */ g.jsx(
|
|
17525
17525
|
Va,
|
|
17526
17526
|
{
|
|
17527
17527
|
value: o,
|
|
@@ -17549,15 +17549,15 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
17549
17549
|
a(d);
|
|
17550
17550
|
const { $from: h, $to: p } = f.state.selection, y = h.blockRange(p);
|
|
17551
17551
|
if (y) {
|
|
17552
|
-
const
|
|
17552
|
+
const m = f.state.doc;
|
|
17553
17553
|
let x = f.state.tr;
|
|
17554
|
-
|
|
17554
|
+
m.nodesBetween(y.start, y.end, (k, C) => {
|
|
17555
17555
|
k.type.name === "video" && (x = x.setNodeMarkup(C, null, { ...t.node.attrs, title: d }));
|
|
17556
17556
|
}), f.dispatch(x);
|
|
17557
17557
|
}
|
|
17558
17558
|
f.focus();
|
|
17559
17559
|
});
|
|
17560
|
-
return /* @__PURE__ */
|
|
17560
|
+
return /* @__PURE__ */ g.jsxs(
|
|
17561
17561
|
"div",
|
|
17562
17562
|
{
|
|
17563
17563
|
...r,
|
|
@@ -17565,8 +17565,8 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
17565
17565
|
className: o ? "video" : "image",
|
|
17566
17566
|
title: t.node.attrs.title,
|
|
17567
17567
|
children: [
|
|
17568
|
-
o ? /* @__PURE__ */
|
|
17569
|
-
/* @__PURE__ */
|
|
17568
|
+
o ? /* @__PURE__ */ g.jsx("iframe", { src: o, allow: c }) : /* @__PURE__ */ g.jsx("img", { src: yf }),
|
|
17569
|
+
/* @__PURE__ */ g.jsx("div", { children: /* @__PURE__ */ g.jsx(
|
|
17570
17570
|
Va,
|
|
17571
17571
|
{
|
|
17572
17572
|
value: l,
|
|
@@ -17604,7 +17604,7 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
17604
17604
|
console.error(`Can not save doc: ${a}`);
|
|
17605
17605
|
}
|
|
17606
17606
|
});
|
|
17607
|
-
return /* @__PURE__ */
|
|
17607
|
+
return /* @__PURE__ */ g.jsx(
|
|
17608
17608
|
Lf,
|
|
17609
17609
|
{
|
|
17610
17610
|
type: "Accent",
|
|
@@ -17629,8 +17629,8 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
17629
17629
|
}, d = () => {
|
|
17630
17630
|
r && r();
|
|
17631
17631
|
};
|
|
17632
|
-
return a ? /* @__PURE__ */
|
|
17633
|
-
n !== !1 && /* @__PURE__ */
|
|
17632
|
+
return a ? /* @__PURE__ */ g.jsxs("div", { className: "ProseNotes", children: [
|
|
17633
|
+
n !== !1 && /* @__PURE__ */ g.jsx(
|
|
17634
17634
|
"input",
|
|
17635
17635
|
{
|
|
17636
17636
|
className: "ProseNotesTitle",
|
|
@@ -17639,7 +17639,7 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
17639
17639
|
placeholder: "Укажите заголовок"
|
|
17640
17640
|
}
|
|
17641
17641
|
),
|
|
17642
|
-
/* @__PURE__ */
|
|
17642
|
+
/* @__PURE__ */ g.jsxs(
|
|
17643
17643
|
pf,
|
|
17644
17644
|
{
|
|
17645
17645
|
state: a,
|
|
@@ -17652,13 +17652,13 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
17652
17652
|
video: Of
|
|
17653
17653
|
},
|
|
17654
17654
|
children: [
|
|
17655
|
-
/* @__PURE__ */
|
|
17656
|
-
/* @__PURE__ */
|
|
17657
|
-
/* @__PURE__ */
|
|
17655
|
+
/* @__PURE__ */ g.jsxs("div", { className: "ProseNotesContent", children: [
|
|
17656
|
+
/* @__PURE__ */ g.jsx(b0, { schema: Ir }),
|
|
17657
|
+
/* @__PURE__ */ g.jsx(hf, {})
|
|
17658
17658
|
] }),
|
|
17659
|
-
(t || r) && /* @__PURE__ */
|
|
17660
|
-
r && /* @__PURE__ */
|
|
17661
|
-
t && /* @__PURE__ */
|
|
17659
|
+
(t || r) && /* @__PURE__ */ g.jsxs("div", { className: "ProseNotesButtons", children: [
|
|
17660
|
+
r && /* @__PURE__ */ g.jsx("span", { className: "a small", onClick: d, children: "Отменить" }),
|
|
17661
|
+
t && /* @__PURE__ */ g.jsx(Ef, { onSave: f, disabled: !u(), wasChanged: !1 })
|
|
17662
17662
|
] })
|
|
17663
17663
|
]
|
|
17664
17664
|
}
|
|
@@ -17674,7 +17674,7 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
17674
17674
|
const y = Sn(u, { level: h });
|
|
17675
17675
|
d[h] = y, f[h] = {
|
|
17676
17676
|
id: h,
|
|
17677
|
-
icon: /* @__PURE__ */
|
|
17677
|
+
icon: /* @__PURE__ */ g.jsx(S0, { level: h }),
|
|
17678
17678
|
text: `уровень ${h}`,
|
|
17679
17679
|
disabled: !y(c.state)
|
|
17680
17680
|
};
|
|
@@ -17684,17 +17684,17 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
17684
17684
|
const a = fe((c, u) => {
|
|
17685
17685
|
!c || !u.id || (s[u.id](c.state, c.dispatch, c), l(!1), c.focus());
|
|
17686
17686
|
});
|
|
17687
|
-
return n.nodes.heading ? /* @__PURE__ */
|
|
17688
|
-
/* @__PURE__ */
|
|
17687
|
+
return n.nodes.heading ? /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
|
|
17688
|
+
/* @__PURE__ */ g.jsx(
|
|
17689
17689
|
"div",
|
|
17690
17690
|
{
|
|
17691
17691
|
ref: e,
|
|
17692
17692
|
className: "MenuItem",
|
|
17693
17693
|
onClick: () => l(!0),
|
|
17694
|
-
children: /* @__PURE__ */
|
|
17694
|
+
children: /* @__PURE__ */ g.jsx(O.Heading, {})
|
|
17695
17695
|
}
|
|
17696
17696
|
),
|
|
17697
|
-
e.current && /* @__PURE__ */
|
|
17697
|
+
e.current && /* @__PURE__ */ g.jsx(
|
|
17698
17698
|
Fn,
|
|
17699
17699
|
{
|
|
17700
17700
|
parent: e.current,
|
|
@@ -17709,33 +17709,33 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
17709
17709
|
}, S0 = ({ level: n }) => {
|
|
17710
17710
|
switch (n) {
|
|
17711
17711
|
case 2:
|
|
17712
|
-
return /* @__PURE__ */
|
|
17712
|
+
return /* @__PURE__ */ g.jsx(O.Heading2, {});
|
|
17713
17713
|
case 3:
|
|
17714
|
-
return /* @__PURE__ */
|
|
17714
|
+
return /* @__PURE__ */ g.jsx(O.Heading3, {});
|
|
17715
17715
|
case 4:
|
|
17716
|
-
return /* @__PURE__ */
|
|
17716
|
+
return /* @__PURE__ */ g.jsx(O.Heading4, {});
|
|
17717
17717
|
case 5:
|
|
17718
|
-
return /* @__PURE__ */
|
|
17718
|
+
return /* @__PURE__ */ g.jsx(O.Heading5, {});
|
|
17719
17719
|
case 6:
|
|
17720
|
-
return /* @__PURE__ */
|
|
17720
|
+
return /* @__PURE__ */ g.jsx(O.Heading6, {});
|
|
17721
17721
|
default:
|
|
17722
|
-
return /* @__PURE__ */
|
|
17722
|
+
return /* @__PURE__ */ g.jsx(O.Heading, {});
|
|
17723
17723
|
}
|
|
17724
17724
|
}, k0 = [{
|
|
17725
17725
|
id: "left",
|
|
17726
|
-
icon: /* @__PURE__ */
|
|
17726
|
+
icon: /* @__PURE__ */ g.jsx(O.AlignLeft, {}),
|
|
17727
17727
|
text: "Прижать влево"
|
|
17728
17728
|
}, {
|
|
17729
17729
|
id: "right",
|
|
17730
|
-
icon: /* @__PURE__ */
|
|
17730
|
+
icon: /* @__PURE__ */ g.jsx(O.AlignRight, {}),
|
|
17731
17731
|
text: "Прижать вправо"
|
|
17732
17732
|
}, {
|
|
17733
17733
|
id: "center",
|
|
17734
|
-
icon: /* @__PURE__ */
|
|
17734
|
+
icon: /* @__PURE__ */ g.jsx(O.AlignCenter, {}),
|
|
17735
17735
|
text: "Отцентровать"
|
|
17736
17736
|
}, {
|
|
17737
17737
|
id: "justify",
|
|
17738
|
-
icon: /* @__PURE__ */
|
|
17738
|
+
icon: /* @__PURE__ */ g.jsx(O.AlignJustify, {}),
|
|
17739
17739
|
text: "Выровнять по краям"
|
|
17740
17740
|
}], C0 = ({ schema: n }) => {
|
|
17741
17741
|
const e = P(null), [t, r] = N(!1), s = fe((o, i) => {
|
|
@@ -17750,17 +17750,17 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
17750
17750
|
}
|
|
17751
17751
|
o.focus(), r(!1);
|
|
17752
17752
|
});
|
|
17753
|
-
return n.nodes.paragraph ? /* @__PURE__ */
|
|
17754
|
-
/* @__PURE__ */
|
|
17753
|
+
return n.nodes.paragraph ? /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
|
|
17754
|
+
/* @__PURE__ */ g.jsx(
|
|
17755
17755
|
"div",
|
|
17756
17756
|
{
|
|
17757
17757
|
ref: e,
|
|
17758
17758
|
className: "MenuItem",
|
|
17759
17759
|
onClick: () => r(!0),
|
|
17760
|
-
children: /* @__PURE__ */
|
|
17760
|
+
children: /* @__PURE__ */ g.jsx(O.AlignLeft, {})
|
|
17761
17761
|
}
|
|
17762
17762
|
),
|
|
17763
|
-
e.current && /* @__PURE__ */
|
|
17763
|
+
e.current && /* @__PURE__ */ g.jsx(
|
|
17764
17764
|
Fn,
|
|
17765
17765
|
{
|
|
17766
17766
|
parent: e.current,
|
|
@@ -17772,18 +17772,18 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
17772
17772
|
}
|
|
17773
17773
|
)
|
|
17774
17774
|
] }) : null;
|
|
17775
|
-
}, w0 = ({ schema: n, onSave: e }) => /* @__PURE__ */
|
|
17776
|
-
/* @__PURE__ */
|
|
17777
|
-
/* @__PURE__ */
|
|
17778
|
-
/* @__PURE__ */
|
|
17775
|
+
}, w0 = ({ schema: n, onSave: e }) => /* @__PURE__ */ g.jsxs("div", { className: "MenuBar", children: [
|
|
17776
|
+
/* @__PURE__ */ g.jsxs("div", { className: "MenuBlock", children: [
|
|
17777
|
+
/* @__PURE__ */ g.jsx(x0, { schema: n }),
|
|
17778
|
+
/* @__PURE__ */ g.jsx(xf, { schema: n })
|
|
17779
17779
|
] }),
|
|
17780
|
-
/* @__PURE__ */
|
|
17781
|
-
/* @__PURE__ */
|
|
17782
|
-
/* @__PURE__ */
|
|
17783
|
-
/* @__PURE__ */
|
|
17784
|
-
/* @__PURE__ */
|
|
17785
|
-
/* @__PURE__ */
|
|
17786
|
-
/* @__PURE__ */
|
|
17780
|
+
/* @__PURE__ */ g.jsx(Sf, { schema: n }),
|
|
17781
|
+
/* @__PURE__ */ g.jsx(Mf, { schema: n }),
|
|
17782
|
+
/* @__PURE__ */ g.jsx(Cf, { schema: n }),
|
|
17783
|
+
/* @__PURE__ */ g.jsx(C0, { schema: n }),
|
|
17784
|
+
/* @__PURE__ */ g.jsx(Nf, {}),
|
|
17785
|
+
/* @__PURE__ */ g.jsx(kf, {}),
|
|
17786
|
+
/* @__PURE__ */ g.jsx("div", { className: "MenuBlock", children: /* @__PURE__ */ g.jsx(Ef, { onSave: e }) })
|
|
17787
17787
|
] }), M0 = (n) => {
|
|
17788
17788
|
if (n.type.name !== "table") return [];
|
|
17789
17789
|
let e = [];
|
|
@@ -17831,80 +17831,80 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
17831
17831
|
const l = fe((a) => {
|
|
17832
17832
|
hy(a.state, a.dispatch);
|
|
17833
17833
|
});
|
|
17834
|
-
return /* @__PURE__ */
|
|
17835
|
-
/* @__PURE__ */
|
|
17836
|
-
/* @__PURE__ */
|
|
17837
|
-
/* @__PURE__ */
|
|
17834
|
+
return /* @__PURE__ */ g.jsxs("table", { ref: s, ...r, children: [
|
|
17835
|
+
/* @__PURE__ */ g.jsx("colgroup", { children: o.map((a, c) => /* @__PURE__ */ g.jsx("col", { style: { width: `${a}%` } }, c)) }),
|
|
17836
|
+
/* @__PURE__ */ g.jsx("caption", { onClick: l, children: /* @__PURE__ */ g.jsx(O.Trash, {}) }),
|
|
17837
|
+
/* @__PURE__ */ g.jsx("tbody", { children: e })
|
|
17838
17838
|
] });
|
|
17839
17839
|
}
|
|
17840
17840
|
), O0 = [{
|
|
17841
17841
|
id: "toggleHeaderRow",
|
|
17842
17842
|
text: "Toggle header row",
|
|
17843
|
-
icon: /* @__PURE__ */
|
|
17843
|
+
icon: /* @__PURE__ */ g.jsx(O.Heading, {})
|
|
17844
17844
|
}, {
|
|
17845
17845
|
id: "addRowBefore",
|
|
17846
17846
|
text: "Insert row before",
|
|
17847
|
-
icon: /* @__PURE__ */
|
|
17847
|
+
icon: /* @__PURE__ */ g.jsx(O.RowInsertBefore, {})
|
|
17848
17848
|
}, {
|
|
17849
17849
|
id: "addRowAfter",
|
|
17850
17850
|
text: "Insert row after",
|
|
17851
|
-
icon: /* @__PURE__ */
|
|
17851
|
+
icon: /* @__PURE__ */ g.jsx(O.RowInsertAfter, {})
|
|
17852
17852
|
}, {
|
|
17853
17853
|
id: "deleteRow",
|
|
17854
17854
|
text: "Delete row",
|
|
17855
|
-
icon: /* @__PURE__ */
|
|
17855
|
+
icon: /* @__PURE__ */ g.jsx(O.Trash, {})
|
|
17856
17856
|
}], E0 = [{
|
|
17857
17857
|
id: "toggleHeaderColumn",
|
|
17858
17858
|
text: "Toggle header column",
|
|
17859
|
-
icon: /* @__PURE__ */
|
|
17859
|
+
icon: /* @__PURE__ */ g.jsx(O.Heading, {})
|
|
17860
17860
|
}, {
|
|
17861
17861
|
id: "addColumnBefore",
|
|
17862
17862
|
text: "Insert column before",
|
|
17863
|
-
icon: /* @__PURE__ */
|
|
17863
|
+
icon: /* @__PURE__ */ g.jsx(O.ColumnInsertBefore, {})
|
|
17864
17864
|
}, {
|
|
17865
17865
|
id: "addColumnAfter",
|
|
17866
17866
|
text: "Insert column after",
|
|
17867
|
-
icon: /* @__PURE__ */
|
|
17867
|
+
icon: /* @__PURE__ */ g.jsx(O.ColumnInsertAfter, {})
|
|
17868
17868
|
}, {
|
|
17869
17869
|
id: "deleteColumn",
|
|
17870
17870
|
text: "Delete column",
|
|
17871
|
-
icon: /* @__PURE__ */
|
|
17871
|
+
icon: /* @__PURE__ */ g.jsx(O.Trash, {})
|
|
17872
17872
|
}], T0 = [{
|
|
17873
17873
|
id: "toggleHeaderCell",
|
|
17874
17874
|
text: "Toggle header",
|
|
17875
|
-
icon: /* @__PURE__ */
|
|
17875
|
+
icon: /* @__PURE__ */ g.jsx(O.Heading, {})
|
|
17876
17876
|
}, {
|
|
17877
17877
|
id: "alignLeft",
|
|
17878
17878
|
text: "Horizontal align left",
|
|
17879
|
-
icon: /* @__PURE__ */
|
|
17879
|
+
icon: /* @__PURE__ */ g.jsx(O.AlignLeft, {})
|
|
17880
17880
|
}, {
|
|
17881
17881
|
id: "alignCenter",
|
|
17882
17882
|
text: "Horizontal align center",
|
|
17883
|
-
icon: /* @__PURE__ */
|
|
17883
|
+
icon: /* @__PURE__ */ g.jsx(O.AlignCenter, {})
|
|
17884
17884
|
}, {
|
|
17885
17885
|
id: "alignRight",
|
|
17886
17886
|
text: "Horizontal align Right",
|
|
17887
|
-
icon: /* @__PURE__ */
|
|
17887
|
+
icon: /* @__PURE__ */ g.jsx(O.AlignRight, {})
|
|
17888
17888
|
}, {
|
|
17889
17889
|
id: "alignTop",
|
|
17890
17890
|
text: "Vertical align top",
|
|
17891
|
-
icon: /* @__PURE__ */
|
|
17891
|
+
icon: /* @__PURE__ */ g.jsx(O.AlignTop, {})
|
|
17892
17892
|
}, {
|
|
17893
17893
|
id: "alignMiddle",
|
|
17894
17894
|
text: "Vertical align middle",
|
|
17895
|
-
icon: /* @__PURE__ */
|
|
17895
|
+
icon: /* @__PURE__ */ g.jsx(O.AlignMiddle, {})
|
|
17896
17896
|
}, {
|
|
17897
17897
|
id: "alignBottom",
|
|
17898
17898
|
text: "Vertical align bottom",
|
|
17899
|
-
icon: /* @__PURE__ */
|
|
17899
|
+
icon: /* @__PURE__ */ g.jsx(O.AlignBottom, {})
|
|
17900
17900
|
}, {
|
|
17901
17901
|
id: "mergeCells",
|
|
17902
17902
|
text: "Merge cells",
|
|
17903
|
-
icon: /* @__PURE__ */
|
|
17903
|
+
icon: /* @__PURE__ */ g.jsx(O.CellsMerge, {})
|
|
17904
17904
|
}, {
|
|
17905
17905
|
id: "splitCell",
|
|
17906
17906
|
text: "Split cell",
|
|
17907
|
-
icon: /* @__PURE__ */
|
|
17907
|
+
icon: /* @__PURE__ */ g.jsx(O.CellsSplit, {})
|
|
17908
17908
|
}], Aa = ({
|
|
17909
17909
|
parent: n,
|
|
17910
17910
|
isRowMenuOpen: e,
|
|
@@ -17972,8 +17972,8 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
17972
17972
|
s(), o(), i(), a.focus();
|
|
17973
17973
|
}
|
|
17974
17974
|
});
|
|
17975
|
-
return n ? /* @__PURE__ */
|
|
17976
|
-
/* @__PURE__ */
|
|
17975
|
+
return n ? /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
|
|
17976
|
+
/* @__PURE__ */ g.jsx(
|
|
17977
17977
|
Fn,
|
|
17978
17978
|
{
|
|
17979
17979
|
parent: n,
|
|
@@ -17985,7 +17985,7 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
17985
17985
|
horizontal: "inner-left"
|
|
17986
17986
|
}
|
|
17987
17987
|
),
|
|
17988
|
-
/* @__PURE__ */
|
|
17988
|
+
/* @__PURE__ */ g.jsx(
|
|
17989
17989
|
Fn,
|
|
17990
17990
|
{
|
|
17991
17991
|
parent: n,
|
|
@@ -17996,7 +17996,7 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
17996
17996
|
horizontal: "inner-left"
|
|
17997
17997
|
}
|
|
17998
17998
|
),
|
|
17999
|
-
/* @__PURE__ */
|
|
17999
|
+
/* @__PURE__ */ g.jsx(
|
|
18000
18000
|
Fn,
|
|
18001
18001
|
{
|
|
18002
18002
|
parent: n,
|
|
@@ -18028,7 +18028,7 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
18028
18028
|
const l = (a) => {
|
|
18029
18029
|
a.preventDefault(), a.stopPropagation(), s(!0), i(a.screenX);
|
|
18030
18030
|
};
|
|
18031
|
-
return !n || !e || !t ? null : /* @__PURE__ */
|
|
18031
|
+
return !n || !e || !t ? null : /* @__PURE__ */ g.jsx(
|
|
18032
18032
|
"div",
|
|
18033
18033
|
{
|
|
18034
18034
|
className: `ProseMirror-cell-resizer ${r ? "dragging" : ""}`,
|
|
@@ -18049,14 +18049,14 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
18049
18049
|
const C = Array.prototype.indexOf.call(k.parentNode.children, k);
|
|
18050
18050
|
h(C < k.parentNode.children.length - 1), h(!1);
|
|
18051
18051
|
}, [o]);
|
|
18052
|
-
const
|
|
18052
|
+
const m = (k) => {
|
|
18053
18053
|
k.preventDefault(), k.stopPropagation(), l(!1), c(!1), f(!1);
|
|
18054
18054
|
const C = k.currentTarget.getBoundingClientRect();
|
|
18055
18055
|
k.clientY < C.y ? f(!0) : k.clientX < C.x ? l(!0) : c(!0);
|
|
18056
18056
|
}, x = (k) => {
|
|
18057
18057
|
y(k);
|
|
18058
18058
|
};
|
|
18059
|
-
return t.node.type.spec.tableRole === "header_cell" ? /* @__PURE__ */
|
|
18059
|
+
return t.node.type.spec.tableRole === "header_cell" ? /* @__PURE__ */ g.jsxs(
|
|
18060
18060
|
"th",
|
|
18061
18061
|
{
|
|
18062
18062
|
...r,
|
|
@@ -18067,13 +18067,13 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
18067
18067
|
textAlign: t.node.attrs.halign,
|
|
18068
18068
|
verticalAlign: t.node.attrs.valign
|
|
18069
18069
|
},
|
|
18070
|
-
onContextMenu:
|
|
18070
|
+
onContextMenu: m,
|
|
18071
18071
|
ref: (k) => {
|
|
18072
18072
|
o.current = k, s && (typeof s == "function" ? s(k) : s.current = k);
|
|
18073
18073
|
},
|
|
18074
18074
|
children: [
|
|
18075
18075
|
e,
|
|
18076
|
-
/* @__PURE__ */
|
|
18076
|
+
/* @__PURE__ */ g.jsx(
|
|
18077
18077
|
Ra,
|
|
18078
18078
|
{
|
|
18079
18079
|
parent: o.current,
|
|
@@ -18081,7 +18081,7 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
18081
18081
|
onWidth: x
|
|
18082
18082
|
}
|
|
18083
18083
|
),
|
|
18084
|
-
/* @__PURE__ */
|
|
18084
|
+
/* @__PURE__ */ g.jsx(
|
|
18085
18085
|
Aa,
|
|
18086
18086
|
{
|
|
18087
18087
|
parent: o.current,
|
|
@@ -18095,7 +18095,7 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
18095
18095
|
)
|
|
18096
18096
|
]
|
|
18097
18097
|
}
|
|
18098
|
-
) : /* @__PURE__ */
|
|
18098
|
+
) : /* @__PURE__ */ g.jsxs(
|
|
18099
18099
|
"td",
|
|
18100
18100
|
{
|
|
18101
18101
|
...r,
|
|
@@ -18106,13 +18106,13 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
18106
18106
|
textAlign: t.node.attrs.halign,
|
|
18107
18107
|
verticalAlign: t.node.attrs.valign
|
|
18108
18108
|
},
|
|
18109
|
-
onContextMenu:
|
|
18109
|
+
onContextMenu: m,
|
|
18110
18110
|
ref: (k) => {
|
|
18111
18111
|
o.current = k, s && (typeof s == "function" ? s(k) : s.current = k);
|
|
18112
18112
|
},
|
|
18113
18113
|
children: [
|
|
18114
18114
|
e,
|
|
18115
|
-
/* @__PURE__ */
|
|
18115
|
+
/* @__PURE__ */ g.jsx(
|
|
18116
18116
|
Ra,
|
|
18117
18117
|
{
|
|
18118
18118
|
parent: o.current,
|
|
@@ -18120,7 +18120,7 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
18120
18120
|
onWidth: x
|
|
18121
18121
|
}
|
|
18122
18122
|
),
|
|
18123
|
-
/* @__PURE__ */
|
|
18123
|
+
/* @__PURE__ */ g.jsx(
|
|
18124
18124
|
Aa,
|
|
18125
18125
|
{
|
|
18126
18126
|
parent: o.current,
|
|
@@ -18149,7 +18149,7 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
18149
18149
|
if (!C) return;
|
|
18150
18150
|
const D = t.getPos(), $ = t.node.nodeSize;
|
|
18151
18151
|
C.dispatch(C.state.tr.delete(D, D + $));
|
|
18152
|
-
}),
|
|
18152
|
+
}), m = fe((C) => {
|
|
18153
18153
|
if (!C) return;
|
|
18154
18154
|
const D = t.getPos(), $ = t.node.nodeSize, E = C.state.doc.resolve(D + $ - 1);
|
|
18155
18155
|
C.dispatch(C.state.tr.setSelection(new v(E))), l(!0);
|
|
@@ -18161,17 +18161,17 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
18161
18161
|
let E = o.current.scrollLeft + D * $;
|
|
18162
18162
|
o.current.scrollLeft = E;
|
|
18163
18163
|
};
|
|
18164
|
-
return /* @__PURE__ */
|
|
18165
|
-
/* @__PURE__ */
|
|
18166
|
-
/* @__PURE__ */
|
|
18167
|
-
/* @__PURE__ */
|
|
18168
|
-
/* @__PURE__ */
|
|
18164
|
+
return /* @__PURE__ */ g.jsxs("div", { ref: s, ...r, className: "carousel", children: [
|
|
18165
|
+
/* @__PURE__ */ g.jsx("div", { className: "carousel-list", ref: o, onScroll: x, children: e }),
|
|
18166
|
+
/* @__PURE__ */ g.jsxs("div", { className: "carousel-buttons", children: [
|
|
18167
|
+
/* @__PURE__ */ g.jsx("div", { onClick: y, className: "text-button", children: "Удалить карусель" }),
|
|
18168
|
+
/* @__PURE__ */ g.jsx("div", { onClick: m, children: /* @__PURE__ */ g.jsx(O.Plus, {}) })
|
|
18169
18169
|
] }),
|
|
18170
|
-
a && /* @__PURE__ */
|
|
18171
|
-
u && /* @__PURE__ */
|
|
18172
|
-
d && /* @__PURE__ */
|
|
18170
|
+
a && /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
|
|
18171
|
+
u && /* @__PURE__ */ g.jsx("div", { className: "carousel-prev", onClick: (C) => k(C, -1), children: /* @__PURE__ */ g.jsx(O.ChevronLeft, {}) }),
|
|
18172
|
+
d && /* @__PURE__ */ g.jsx("div", { className: "carousel-next", onClick: (C) => k(C, 1), children: /* @__PURE__ */ g.jsx(O.ChevronRight, {}) })
|
|
18173
18173
|
] }),
|
|
18174
|
-
/* @__PURE__ */
|
|
18174
|
+
/* @__PURE__ */ g.jsx(wf, { isOpen: i, onClose: () => l(!1) })
|
|
18175
18175
|
] });
|
|
18176
18176
|
}
|
|
18177
18177
|
), c1 = ({ content: n, onSave: e, onChange: t, onUpload: r }) => {
|
|
@@ -18191,7 +18191,7 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
18191
18191
|
});
|
|
18192
18192
|
const a = ai(l);
|
|
18193
18193
|
a && (l = l.apply(a.setMeta("addToHistory", !1))), o(l);
|
|
18194
|
-
}, [n]), s ? /* @__PURE__ */
|
|
18194
|
+
}, [n]), s ? /* @__PURE__ */ g.jsx("div", { className: "ProseEditor", children: /* @__PURE__ */ g.jsxs(
|
|
18195
18195
|
pf,
|
|
18196
18196
|
{
|
|
18197
18197
|
state: s,
|
|
@@ -18208,8 +18208,8 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
18208
18208
|
carousel: A0
|
|
18209
18209
|
},
|
|
18210
18210
|
children: [
|
|
18211
|
-
/* @__PURE__ */
|
|
18212
|
-
/* @__PURE__ */
|
|
18211
|
+
/* @__PURE__ */ g.jsx(w0, { schema: Nt, onSave: e }),
|
|
18212
|
+
/* @__PURE__ */ g.jsx(hf, {})
|
|
18213
18213
|
]
|
|
18214
18214
|
}
|
|
18215
18215
|
) }) : null;
|
|
@@ -18219,33 +18219,33 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
18219
18219
|
var s;
|
|
18220
18220
|
const r = (s = n.attrs) == null ? void 0 : s.align;
|
|
18221
18221
|
t(r !== "right" && r !== "center" && r !== "justify" ? void 0 : { textAlign: r });
|
|
18222
|
-
}, [n]), /* @__PURE__ */
|
|
18222
|
+
}, [n]), /* @__PURE__ */ g.jsx("p", { style: e, children: Array.isArray(n.content) && n.content.map((r, s) => /* @__PURE__ */ g.jsx(G, { node: r }, s)) });
|
|
18223
18223
|
}, I0 = ({ node: n }) => {
|
|
18224
18224
|
if (!n.text) return null;
|
|
18225
18225
|
const e = (t, r) => {
|
|
18226
18226
|
var i;
|
|
18227
|
-
if (!Array.isArray(n.marks)) return /* @__PURE__ */
|
|
18228
|
-
if (!t.length) return /* @__PURE__ */
|
|
18227
|
+
if (!Array.isArray(n.marks)) return /* @__PURE__ */ g.jsx(g.Fragment, { children: r });
|
|
18228
|
+
if (!t.length) return /* @__PURE__ */ g.jsx(g.Fragment, { children: r });
|
|
18229
18229
|
const s = t[0].type, o = (i = t[0].attrs) == null ? void 0 : i.href;
|
|
18230
18230
|
switch (s) {
|
|
18231
18231
|
case "em":
|
|
18232
|
-
return /* @__PURE__ */
|
|
18232
|
+
return /* @__PURE__ */ g.jsx("em", { children: e(t.slice(1), r) });
|
|
18233
18233
|
case "code":
|
|
18234
|
-
return /* @__PURE__ */
|
|
18234
|
+
return /* @__PURE__ */ g.jsx("code", { children: e(t.slice(1), r) });
|
|
18235
18235
|
case "strong":
|
|
18236
|
-
return /* @__PURE__ */
|
|
18236
|
+
return /* @__PURE__ */ g.jsx("strong", { children: e(t.slice(1), r) });
|
|
18237
18237
|
case "underline":
|
|
18238
|
-
return /* @__PURE__ */
|
|
18238
|
+
return /* @__PURE__ */ g.jsx("u", { children: e(t.slice(1), r) });
|
|
18239
18239
|
case "strikethrough":
|
|
18240
|
-
return /* @__PURE__ */
|
|
18240
|
+
return /* @__PURE__ */ g.jsx("s", { children: e(t.slice(1), r) });
|
|
18241
18241
|
case "link":
|
|
18242
|
-
return o ? /* @__PURE__ */
|
|
18242
|
+
return o ? /* @__PURE__ */ g.jsx("a", { target: "_blank", href: o, children: e(t.slice(1), r) }) : /* @__PURE__ */ g.jsx(g.Fragment, { children: e(t.slice(1), r) });
|
|
18243
18243
|
default:
|
|
18244
|
-
return /* @__PURE__ */
|
|
18244
|
+
return /* @__PURE__ */ g.jsx(g.Fragment, { children: e(t.slice(1), r) });
|
|
18245
18245
|
}
|
|
18246
18246
|
};
|
|
18247
18247
|
return e(n.marks, n.text);
|
|
18248
|
-
}, P0 = ({ node: n, className: e }) => /* @__PURE__ */
|
|
18248
|
+
}, P0 = ({ node: n, className: e }) => /* @__PURE__ */ g.jsx("div", { className: e, children: Array.isArray(n.content) && n.content.map((t, r) => /* @__PURE__ */ g.jsx(G, { node: t }, r)) }), v0 = ({ node: n }) => {
|
|
18249
18249
|
const e = P(null), [t, r] = N(""), [s, o] = N(""), [i, l] = N(!1);
|
|
18250
18250
|
q(() => {
|
|
18251
18251
|
const c = () => {
|
|
@@ -18261,24 +18261,24 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
18261
18261
|
var u;
|
|
18262
18262
|
c.stopPropagation(), i ? document.exitFullscreen() : (u = e.current) == null || u.requestFullscreen();
|
|
18263
18263
|
};
|
|
18264
|
-
return t ? /* @__PURE__ */
|
|
18264
|
+
return t ? /* @__PURE__ */ g.jsxs(
|
|
18265
18265
|
"div",
|
|
18266
18266
|
{
|
|
18267
18267
|
ref: e,
|
|
18268
18268
|
title: s,
|
|
18269
18269
|
className: "image",
|
|
18270
18270
|
children: [
|
|
18271
|
-
/* @__PURE__ */
|
|
18272
|
-
/* @__PURE__ */
|
|
18271
|
+
/* @__PURE__ */ g.jsx("img", { src: t, onClick: a }),
|
|
18272
|
+
/* @__PURE__ */ g.jsx("div", { className: "image-full", onClick: a, children: i ? /* @__PURE__ */ g.jsx(O.Minimize, {}) : /* @__PURE__ */ g.jsx(O.Maximize, {}) })
|
|
18273
18273
|
]
|
|
18274
18274
|
}
|
|
18275
18275
|
) : null;
|
|
18276
|
-
}, V0 = ({ node: n }) => /* @__PURE__ */
|
|
18276
|
+
}, V0 = ({ node: n }) => /* @__PURE__ */ g.jsx("blockquote", { children: Array.isArray(n.content) && n.content.map((e, t) => /* @__PURE__ */ g.jsx(G, { node: e }, t)) }), $0 = ({ node: n }) => /* @__PURE__ */ g.jsx("table", { children: /* @__PURE__ */ g.jsx("tbody", { children: Array.isArray(n.content) && n.content.map((e, t) => /* @__PURE__ */ g.jsx(G, { node: e }, t)) }) }), z0 = ({ node: n }) => /* @__PURE__ */ g.jsx("tr", { children: Array.isArray(n.content) && n.content.map((e, t) => /* @__PURE__ */ g.jsx(G, { node: e }, t)) }), j0 = ({ node: n }) => {
|
|
18277
18277
|
const [e, t] = N(), [r, s] = N(), [o, i] = N(), [l, a] = N();
|
|
18278
18278
|
return q(() => {
|
|
18279
18279
|
var c, u, f, d;
|
|
18280
18280
|
t((c = n.attrs) == null ? void 0 : c.halign), s((u = n.attrs) == null ? void 0 : u.valign), i((f = n.attrs) != null && f.rowspan ? parseInt(n.attrs.rowspan + "") : 1), a((d = n.attrs) != null && d.colspan ? parseInt(n.attrs.colspan + "") : 1);
|
|
18281
|
-
}, [n]), n.type === "table_header" ? /* @__PURE__ */
|
|
18281
|
+
}, [n]), n.type === "table_header" ? /* @__PURE__ */ g.jsx(
|
|
18282
18282
|
"th",
|
|
18283
18283
|
{
|
|
18284
18284
|
colSpan: l,
|
|
@@ -18287,9 +18287,9 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
18287
18287
|
textAlign: e,
|
|
18288
18288
|
verticalAlign: r
|
|
18289
18289
|
},
|
|
18290
|
-
children: Array.isArray(n.content) && n.content.map((c, u) => /* @__PURE__ */
|
|
18290
|
+
children: Array.isArray(n.content) && n.content.map((c, u) => /* @__PURE__ */ g.jsx(G, { node: c }, u))
|
|
18291
18291
|
}
|
|
18292
|
-
) : /* @__PURE__ */
|
|
18292
|
+
) : /* @__PURE__ */ g.jsx(
|
|
18293
18293
|
"td",
|
|
18294
18294
|
{
|
|
18295
18295
|
colSpan: l,
|
|
@@ -18298,7 +18298,7 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
18298
18298
|
textAlign: e,
|
|
18299
18299
|
verticalAlign: r
|
|
18300
18300
|
},
|
|
18301
|
-
children: Array.isArray(n.content) && n.content.map((c, u) => /* @__PURE__ */
|
|
18301
|
+
children: Array.isArray(n.content) && n.content.map((c, u) => /* @__PURE__ */ g.jsx(G, { node: c }, u))
|
|
18302
18302
|
}
|
|
18303
18303
|
);
|
|
18304
18304
|
}, F0 = ({ node: n }) => {
|
|
@@ -18306,65 +18306,65 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
18306
18306
|
if (!Array.isArray(n.content)) return null;
|
|
18307
18307
|
switch ((e = n.attrs) == null ? void 0 : e.level) {
|
|
18308
18308
|
case 1:
|
|
18309
|
-
return /* @__PURE__ */
|
|
18309
|
+
return /* @__PURE__ */ g.jsx("h1", { children: n.content.map((t, r) => /* @__PURE__ */ g.jsx(G, { node: t }, r)) });
|
|
18310
18310
|
case 2:
|
|
18311
|
-
return /* @__PURE__ */
|
|
18311
|
+
return /* @__PURE__ */ g.jsx("h2", { children: n.content.map((t, r) => /* @__PURE__ */ g.jsx(G, { node: t }, r)) });
|
|
18312
18312
|
case 3:
|
|
18313
|
-
return /* @__PURE__ */
|
|
18313
|
+
return /* @__PURE__ */ g.jsx("h3", { children: n.content.map((t, r) => /* @__PURE__ */ g.jsx(G, { node: t }, r)) });
|
|
18314
18314
|
case 4:
|
|
18315
|
-
return /* @__PURE__ */
|
|
18315
|
+
return /* @__PURE__ */ g.jsx("h4", { children: n.content.map((t, r) => /* @__PURE__ */ g.jsx(G, { node: t }, r)) });
|
|
18316
18316
|
case 5:
|
|
18317
|
-
return /* @__PURE__ */
|
|
18317
|
+
return /* @__PURE__ */ g.jsx("h5", { children: n.content.map((t, r) => /* @__PURE__ */ g.jsx(G, { node: t }, r)) });
|
|
18318
18318
|
case 6:
|
|
18319
|
-
return /* @__PURE__ */
|
|
18319
|
+
return /* @__PURE__ */ g.jsx("h6", { children: n.content.map((t, r) => /* @__PURE__ */ g.jsx(G, { node: t }, r)) });
|
|
18320
18320
|
default:
|
|
18321
|
-
return /* @__PURE__ */
|
|
18321
|
+
return /* @__PURE__ */ g.jsx("h2", { children: n.content.map((t, r) => /* @__PURE__ */ g.jsx(G, { node: t }, r)) });
|
|
18322
18322
|
}
|
|
18323
|
-
}, B0 = ({ node: n }) => Array.isArray(n.content) ? n.type === "bullet_list" ? /* @__PURE__ */
|
|
18323
|
+
}, B0 = ({ node: n }) => Array.isArray(n.content) ? n.type === "bullet_list" ? /* @__PURE__ */ g.jsx("ul", { children: n.content.map((e, t) => /* @__PURE__ */ g.jsx(G, { node: e }, t)) }) : /* @__PURE__ */ g.jsx("ol", { children: n.content.map((e, t) => /* @__PURE__ */ g.jsx(G, { node: e }, t)) }) : null, L0 = ({ node: n }) => /* @__PURE__ */ g.jsx("li", { children: Array.isArray(n.content) && n.content.map((e, t) => /* @__PURE__ */ g.jsx(G, { node: e }, t)) }), W0 = ({ node: n }) => /* @__PURE__ */ g.jsx("pre", { children: Array.isArray(n.content) && n.content.map((e, t) => /* @__PURE__ */ g.jsx(G, { node: e }, t)) }), _0 = () => /* @__PURE__ */ g.jsx("hr", {}), q0 = ({ node: n }) => {
|
|
18324
18324
|
const [e, t] = N(""), [r, s] = N(""), o = "fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share";
|
|
18325
18325
|
return q(() => {
|
|
18326
18326
|
var i, l, a, c;
|
|
18327
18327
|
t((i = n.attrs) != null && i.src ? `${(l = n.attrs) == null ? void 0 : l.src}` : ""), s((a = n.attrs) != null && a.title ? `${(c = n.attrs) == null ? void 0 : c.title}` : "");
|
|
18328
|
-
}, [n]), bs(e) ? /* @__PURE__ */
|
|
18329
|
-
}, H0 = () => /* @__PURE__ */
|
|
18330
|
-
const e = P(null), t = P(null), [r, s] = N(!1), [o, i] = N(!1), [l, a] = N(!1), [c, u] = N(1), [f, d] = N(1), h = (
|
|
18331
|
-
const x =
|
|
18328
|
+
}, [n]), bs(e) ? /* @__PURE__ */ g.jsx("div", { title: r, className: "video", children: /* @__PURE__ */ g.jsx("iframe", { src: e, allow: o }) }) : /* @__PURE__ */ g.jsx("div", { title: r, className: "image", children: /* @__PURE__ */ g.jsx("img", { src: ys }) });
|
|
18329
|
+
}, H0 = () => /* @__PURE__ */ g.jsx("br", {}), J0 = ({ node: n }) => {
|
|
18330
|
+
const e = P(null), t = P(null), [r, s] = N(!1), [o, i] = N(!1), [l, a] = N(!1), [c, u] = N(1), [f, d] = N(1), h = (m) => {
|
|
18331
|
+
const x = m.scrollLeft, k = m.clientWidth, C = m.scrollWidth;
|
|
18332
18332
|
i(x > k / 2), a(x < C - k * 1.5), u(Math.round(x / k + 1));
|
|
18333
18333
|
};
|
|
18334
18334
|
q(() => {
|
|
18335
|
-
var
|
|
18336
|
-
a(Array.isArray(n.content) && n.content.length > 1), d(((
|
|
18335
|
+
var m;
|
|
18336
|
+
a(Array.isArray(n.content) && n.content.length > 1), d(((m = n.content) == null ? void 0 : m.length) ?? 1), u(1);
|
|
18337
18337
|
}, [n]), q(() => {
|
|
18338
|
-
const
|
|
18338
|
+
const m = () => {
|
|
18339
18339
|
s(!!document.fullscreenElement);
|
|
18340
18340
|
};
|
|
18341
|
-
return document.addEventListener("fullscreenchange",
|
|
18341
|
+
return document.addEventListener("fullscreenchange", m), () => document.removeEventListener("fullscreenchange", m);
|
|
18342
18342
|
}, []), q(() => {
|
|
18343
18343
|
if (!r) return;
|
|
18344
|
-
const
|
|
18344
|
+
const m = (x) => {
|
|
18345
18345
|
x.key === "ArrowLeft" && y(null, -1), x.key === "ArrowRight" && y(null, 1);
|
|
18346
18346
|
};
|
|
18347
|
-
return document.body.addEventListener("keydown",
|
|
18347
|
+
return document.body.addEventListener("keydown", m), () => document.body.removeEventListener("keydown", m);
|
|
18348
18348
|
}, [r]);
|
|
18349
|
-
const p = (
|
|
18349
|
+
const p = (m) => {
|
|
18350
18350
|
var x;
|
|
18351
|
-
|
|
18352
|
-
}, y = (
|
|
18353
|
-
if (
|
|
18351
|
+
m.stopPropagation(), r ? document.exitFullscreen() : (x = t.current) == null || x.requestFullscreen();
|
|
18352
|
+
}, y = (m, x) => {
|
|
18353
|
+
if (m == null || m.stopPropagation(), !e.current) return;
|
|
18354
18354
|
const k = e.current.clientWidth;
|
|
18355
18355
|
let C = e.current.scrollLeft + x * k;
|
|
18356
18356
|
e.current.scrollLeft = C;
|
|
18357
18357
|
};
|
|
18358
|
-
return Array.isArray(n.content) ? /* @__PURE__ */
|
|
18359
|
-
/* @__PURE__ */
|
|
18360
|
-
/* @__PURE__ */
|
|
18358
|
+
return Array.isArray(n.content) ? /* @__PURE__ */ g.jsxs("div", { className: "carousel", ref: t, children: [
|
|
18359
|
+
/* @__PURE__ */ g.jsx("div", { className: "carousel-list", ref: e, onScroll: (m) => h(m.currentTarget), children: n.content.map((m, x) => /* @__PURE__ */ g.jsx(K0, { node: m, onClick: p }, x)) }),
|
|
18360
|
+
/* @__PURE__ */ g.jsxs("div", { className: "carousel-numb", children: [
|
|
18361
18361
|
c,
|
|
18362
18362
|
" / ",
|
|
18363
18363
|
f
|
|
18364
18364
|
] }),
|
|
18365
|
-
/* @__PURE__ */
|
|
18366
|
-
o && /* @__PURE__ */
|
|
18367
|
-
l && /* @__PURE__ */
|
|
18365
|
+
/* @__PURE__ */ g.jsx("div", { className: "carousel-full", onClick: p, children: r ? /* @__PURE__ */ g.jsx(O.Minimize, {}) : /* @__PURE__ */ g.jsx(O.Maximize, {}) }),
|
|
18366
|
+
o && /* @__PURE__ */ g.jsx("div", { className: "carousel-prev", onClick: (m) => y(m, -1), children: /* @__PURE__ */ g.jsx(O.ChevronLeft, {}) }),
|
|
18367
|
+
l && /* @__PURE__ */ g.jsx("div", { className: "carousel-next", onClick: (m) => y(m, 1), children: /* @__PURE__ */ g.jsx(O.ChevronRight, {}) })
|
|
18368
18368
|
] }) : null;
|
|
18369
18369
|
}, K0 = ({ node: n, onClick: e }) => {
|
|
18370
18370
|
const [t, r] = N(""), [s, o] = N("");
|
|
@@ -18372,45 +18372,45 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
18372
18372
|
var c, u, f, d;
|
|
18373
18373
|
let i = (c = n.attrs) == null ? void 0 : c.fid, l = (u = n.attrs) != null && u.src ? `${(f = n.attrs) == null ? void 0 : f.src}` : "", a = (d = n.attrs) != null && d.title ? `${n.attrs.title}` : "";
|
|
18374
18374
|
i && (l = `${gs}/files/${i}`), l || (l = ys), r(l), o(a);
|
|
18375
|
-
}, [n]), n.type !== "image" ? null : /* @__PURE__ */
|
|
18375
|
+
}, [n]), n.type !== "image" ? null : /* @__PURE__ */ g.jsx("div", { className: "image", title: s, children: t && /* @__PURE__ */ g.jsx("img", { src: t, onClick: e }) });
|
|
18376
18376
|
}, G = ({ node: n, className: e }) => n ? ((r) => {
|
|
18377
18377
|
switch (r.type) {
|
|
18378
18378
|
case "doc":
|
|
18379
|
-
return /* @__PURE__ */
|
|
18379
|
+
return /* @__PURE__ */ g.jsx(P0, { node: r, className: e });
|
|
18380
18380
|
case "list_item":
|
|
18381
|
-
return /* @__PURE__ */
|
|
18381
|
+
return /* @__PURE__ */ g.jsx(L0, { node: r });
|
|
18382
18382
|
case "bullet_list":
|
|
18383
18383
|
case "ordered_list":
|
|
18384
|
-
return /* @__PURE__ */
|
|
18384
|
+
return /* @__PURE__ */ g.jsx(B0, { node: r });
|
|
18385
18385
|
case "image":
|
|
18386
|
-
return /* @__PURE__ */
|
|
18386
|
+
return /* @__PURE__ */ g.jsx(v0, { node: r });
|
|
18387
18387
|
case "video":
|
|
18388
|
-
return /* @__PURE__ */
|
|
18388
|
+
return /* @__PURE__ */ g.jsx(q0, { node: r });
|
|
18389
18389
|
case "text":
|
|
18390
|
-
return /* @__PURE__ */
|
|
18390
|
+
return /* @__PURE__ */ g.jsx(I0, { node: r });
|
|
18391
18391
|
case "table":
|
|
18392
|
-
return /* @__PURE__ */
|
|
18392
|
+
return /* @__PURE__ */ g.jsx($0, { node: r });
|
|
18393
18393
|
case "table_row":
|
|
18394
|
-
return /* @__PURE__ */
|
|
18394
|
+
return /* @__PURE__ */ g.jsx(z0, { node: r });
|
|
18395
18395
|
case "table_cell":
|
|
18396
18396
|
case "table_header":
|
|
18397
|
-
return /* @__PURE__ */
|
|
18397
|
+
return /* @__PURE__ */ g.jsx(j0, { node: r });
|
|
18398
18398
|
case "heading":
|
|
18399
|
-
return /* @__PURE__ */
|
|
18399
|
+
return /* @__PURE__ */ g.jsx(F0, { node: r });
|
|
18400
18400
|
case "code_block":
|
|
18401
|
-
return /* @__PURE__ */
|
|
18401
|
+
return /* @__PURE__ */ g.jsx(W0, { node: r });
|
|
18402
18402
|
case "paragraph":
|
|
18403
|
-
return /* @__PURE__ */
|
|
18403
|
+
return /* @__PURE__ */ g.jsx(R0, { node: r });
|
|
18404
18404
|
case "blockquote":
|
|
18405
|
-
return /* @__PURE__ */
|
|
18405
|
+
return /* @__PURE__ */ g.jsx(V0, { node: r });
|
|
18406
18406
|
case "carousel":
|
|
18407
|
-
return /* @__PURE__ */
|
|
18407
|
+
return /* @__PURE__ */ g.jsx(J0, { node: r });
|
|
18408
18408
|
case "horizontal_rule":
|
|
18409
|
-
return /* @__PURE__ */
|
|
18409
|
+
return /* @__PURE__ */ g.jsx(_0, {});
|
|
18410
18410
|
case "hard_break":
|
|
18411
|
-
return /* @__PURE__ */
|
|
18411
|
+
return /* @__PURE__ */ g.jsx(H0, {});
|
|
18412
18412
|
default:
|
|
18413
|
-
return /* @__PURE__ */
|
|
18413
|
+
return /* @__PURE__ */ g.jsx("span", { className: "unknown_node_type", children: r.type });
|
|
18414
18414
|
}
|
|
18415
18415
|
})(n) : null, u1 = ({ content: n }) => {
|
|
18416
18416
|
const [e, t] = N(), [r, s] = N(!1);
|
|
@@ -18422,7 +18422,7 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
18422
18422
|
} catch (o) {
|
|
18423
18423
|
s(!0), console.error(`Can not parse Prose format: ${o}`);
|
|
18424
18424
|
}
|
|
18425
|
-
}, [n]), r ? /* @__PURE__ */
|
|
18425
|
+
}, [n]), r ? /* @__PURE__ */ g.jsx("div", { className: "error", children: "ОШИБКА" }) : /* @__PURE__ */ g.jsx(G, { node: e, className: "ProseViewer" });
|
|
18426
18426
|
}, f1 = ({ content: n }) => {
|
|
18427
18427
|
const e = P(null), [t, r] = N(!1);
|
|
18428
18428
|
return q(() => {
|
|
@@ -18434,7 +18434,7 @@ const Nf = () => /* @__PURE__ */ m.jsx(xs, { items: [{
|
|
|
18434
18434
|
} catch (o) {
|
|
18435
18435
|
r(!0), console.error(`Can not parse Prose format: ${o}`);
|
|
18436
18436
|
}
|
|
18437
|
-
}, [e, n]), /* @__PURE__ */
|
|
18437
|
+
}, [e, n]), /* @__PURE__ */ g.jsx("div", { ref: e, className: "ProseViewer", children: t && /* @__PURE__ */ g.jsx("div", { className: "error", children: "ОШИБКА" }) });
|
|
18438
18438
|
};
|
|
18439
18439
|
export {
|
|
18440
18440
|
f1 as DOM,
|