asma-ui-richeditor 0.3.7 → 0.3.8
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.
|
@@ -2,25 +2,25 @@ import * as e from "react";
|
|
|
2
2
|
import t, { Component as n, Fragment as r, Suspense as i, createContext as a, createElement as o, createRef as s, forwardRef as c, memo as l, useCallback as u, useContext as d, useDebugValue as f, useEffect as p, useImperativeHandle as m, useLayoutEffect as h, useMemo as g, useRef as _, useState as v } from "react";
|
|
3
3
|
import y from "react-dom";
|
|
4
4
|
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
5
|
-
import { DotsVerticalIcon as ee, ErrorOutlineIcon as te, LinkOutlineIcon as ne, LoadingIcon as re, StyledButton as
|
|
6
|
-
var
|
|
7
|
-
function
|
|
5
|
+
import { DotsVerticalIcon as ee, ErrorOutlineIcon as te, LinkOutlineIcon as ne, LoadingIcon as re, StyledButton as C, StyledChip as ie, StyledDialog as ae, StyledFormControl as oe, StyledFormHelperText as se, StyledInputField as ce, StyledMenuItem as le, StyledPopover as ue, StyledTooltip as de } from "asma-ui-core";
|
|
6
|
+
var fe = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports);
|
|
7
|
+
function pe(e) {
|
|
8
8
|
var t, n, r = "";
|
|
9
9
|
if (typeof e == "string" || typeof e == "number") r += e;
|
|
10
10
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
11
11
|
var i = e.length;
|
|
12
|
-
for (t = 0; t < i; t++) e[t] && (n =
|
|
12
|
+
for (t = 0; t < i; t++) e[t] && (n = pe(e[t])) && (r && (r += " "), r += n);
|
|
13
13
|
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
14
14
|
return r;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t =
|
|
16
|
+
function me() {
|
|
17
|
+
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = pe(e)) && (r && (r += " "), r += t);
|
|
18
18
|
return r;
|
|
19
19
|
}
|
|
20
|
-
var
|
|
20
|
+
var he = fe(((t, n) => {
|
|
21
21
|
n.exports = { ...e };
|
|
22
|
-
})),
|
|
23
|
-
var t =
|
|
22
|
+
})), ge = fe(((e) => {
|
|
23
|
+
var t = he(), n = typeof Object.is == "function" ? Object.is : function(e, t) {
|
|
24
24
|
return e === t && (e !== 0 || 1 / e == 1 / t) || e != e && t != t;
|
|
25
25
|
}, r = t.useState, i = t.useEffect, a = t.useLayoutEffect, o = t.useDebugValue;
|
|
26
26
|
function s(e) {
|
|
@@ -53,13 +53,13 @@ var ge = pe(((t, n) => {
|
|
|
53
53
|
}), [e]), o(n), n;
|
|
54
54
|
};
|
|
55
55
|
e.useSyncExternalStore = t.useSyncExternalStore === void 0 ? c : t.useSyncExternalStore;
|
|
56
|
-
})),
|
|
57
|
-
t.exports =
|
|
56
|
+
})), _e = fe(((e, t) => {
|
|
57
|
+
t.exports = ge();
|
|
58
58
|
}));
|
|
59
59
|
function w(e) {
|
|
60
60
|
this.content = e;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function T(e, t, n) {
|
|
63
63
|
for (let r = 0;; r++) {
|
|
64
64
|
if (r == e.childCount || r == t.childCount) return e.childCount == t.childCount ? null : n;
|
|
65
65
|
let i = e.child(r), a = t.child(r);
|
|
@@ -68,17 +68,17 @@ function ve(e, t, n) {
|
|
|
68
68
|
if (i.isText && i.text != a.text) {
|
|
69
69
|
let e = i.text, t = a.text, r = 0;
|
|
70
70
|
for (; e[r] == t[r]; r++) n++;
|
|
71
|
-
return r && r < e.length && r < t.length &&
|
|
71
|
+
return r && r < e.length && r < t.length && be(e.charCodeAt(r - 1)) && ye(e.charCodeAt(r)) && n--, n;
|
|
72
72
|
}
|
|
73
73
|
if (i.content.size || a.content.size) {
|
|
74
|
-
let e =
|
|
74
|
+
let e = T(i.content, a.content, n + 1);
|
|
75
75
|
if (e != null) return e;
|
|
76
76
|
}
|
|
77
77
|
n += i.nodeSize;
|
|
78
78
|
} else n += i.nodeSize;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function ve(e, t, n, r) {
|
|
82
82
|
for (let i = e.childCount, a = t.childCount;;) {
|
|
83
83
|
if (i == 0 || a == 0) return i == a ? null : {
|
|
84
84
|
a: n,
|
|
@@ -93,23 +93,23 @@ function ye(e, t, n, r) {
|
|
|
93
93
|
if (o.isText && o.text != s.text) {
|
|
94
94
|
let e = o.text, t = s.text, i = e.length, a = t.length;
|
|
95
95
|
for (; i > 0 && a > 0 && e[i - 1] == t[a - 1];) i--, a--, n--, r--;
|
|
96
|
-
return i && a && i < e.length &&
|
|
96
|
+
return i && a && i < e.length && be(e.charCodeAt(i - 1)) && ye(e.charCodeAt(i)) && (n++, r++), {
|
|
97
97
|
a: n,
|
|
98
98
|
b: r
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
101
|
if (o.content.size || s.content.size) {
|
|
102
|
-
let e =
|
|
102
|
+
let e = ve(o.content, s.content, n - 1, r - 1);
|
|
103
103
|
if (e) return e;
|
|
104
104
|
}
|
|
105
105
|
n -= c, r -= c;
|
|
106
106
|
} else n -= c, r -= c;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function ye(e) {
|
|
110
110
|
return e >= 56320 && e < 57344;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function be(e) {
|
|
113
113
|
return e >= 55296 && e < 56320;
|
|
114
114
|
}
|
|
115
115
|
w.prototype = {
|
|
@@ -173,7 +173,7 @@ w.prototype = {
|
|
|
173
173
|
if (e) for (var n in e) t.push(n, e[n]);
|
|
174
174
|
return new w(t);
|
|
175
175
|
};
|
|
176
|
-
var
|
|
176
|
+
var E = class e {
|
|
177
177
|
constructor(e, t) {
|
|
178
178
|
if (this.content = e, this.size = t || 0, t == null) for (let t = 0; t < e.length; t++) this.size += e[t].nodeSize;
|
|
179
179
|
}
|
|
@@ -257,18 +257,18 @@ var T = class e {
|
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
findDiffStart(e, t = 0) {
|
|
260
|
-
return
|
|
260
|
+
return T(this, e, t);
|
|
261
261
|
}
|
|
262
262
|
findDiffEnd(e, t = this.size, n = e.size) {
|
|
263
|
-
return
|
|
263
|
+
return ve(this, e, t, n);
|
|
264
264
|
}
|
|
265
265
|
findIndex(e) {
|
|
266
|
-
if (e == 0) return
|
|
267
|
-
if (e == this.size) return
|
|
266
|
+
if (e == 0) return Se(0, e);
|
|
267
|
+
if (e == this.size) return Se(this.content.length, e);
|
|
268
268
|
if (e > this.size || e < 0) throw RangeError(`Position ${e} outside of fragment (${this})`);
|
|
269
269
|
for (let t = 0, n = 0;; t++) {
|
|
270
270
|
let r = n + this.child(t).nodeSize;
|
|
271
|
-
if (r >= e) return r == e ?
|
|
271
|
+
if (r >= e) return r == e ? Se(t + 1, r) : Se(t, n);
|
|
272
272
|
n = r;
|
|
273
273
|
}
|
|
274
274
|
}
|
|
@@ -303,13 +303,13 @@ var T = class e {
|
|
|
303
303
|
throw RangeError("Can not convert " + t + " to a Fragment" + (t.nodesBetween ? " (looks like multiple versions of prosemirror-model were loaded)" : ""));
|
|
304
304
|
}
|
|
305
305
|
};
|
|
306
|
-
|
|
307
|
-
var
|
|
306
|
+
E.empty = new E([], 0);
|
|
307
|
+
var xe = {
|
|
308
308
|
index: 0,
|
|
309
309
|
offset: 0
|
|
310
310
|
};
|
|
311
|
-
function
|
|
312
|
-
return
|
|
311
|
+
function Se(e, t) {
|
|
312
|
+
return xe.index = e, xe.offset = t, xe;
|
|
313
313
|
}
|
|
314
314
|
function Ce(e, t) {
|
|
315
315
|
if (e === t) return !0;
|
|
@@ -411,7 +411,7 @@ var we = class extends Error {}, O = class e {
|
|
|
411
411
|
if (!n) return e.empty;
|
|
412
412
|
let r = n.openStart || 0, i = n.openEnd || 0;
|
|
413
413
|
if (typeof r != "number" || typeof i != "number") throw RangeError("Invalid input for Slice.fromJSON");
|
|
414
|
-
return new e(
|
|
414
|
+
return new e(E.fromJSON(t, n.content), r, i);
|
|
415
415
|
}
|
|
416
416
|
static maxOpen(t, n = !0) {
|
|
417
417
|
let r = 0, i = 0;
|
|
@@ -450,7 +450,7 @@ function Oe(e, t, n, r) {
|
|
|
450
450
|
if (n.openStart || n.openEnd || e.depth != r || t.depth != r) {
|
|
451
451
|
let { start: i, end: o } = function(e, t) {
|
|
452
452
|
let n = t.depth - e.openStart, r = t.node(n).copy(e.content);
|
|
453
|
-
for (let e = n - 1; e >= 0; e--) r = t.node(e).copy(
|
|
453
|
+
for (let e = n - 1; e >= 0; e--) r = t.node(e).copy(E.from(r));
|
|
454
454
|
return {
|
|
455
455
|
start: r.resolveNoCache(e.openStart + n),
|
|
456
456
|
end: r.resolveNoCache(r.content.size - e.openEnd - n)
|
|
@@ -488,13 +488,13 @@ function Ne(e, t) {
|
|
|
488
488
|
}
|
|
489
489
|
function Pe(e, t, n, r, i) {
|
|
490
490
|
let a = e.depth > i && Ae(e, t, i + 1), o = r.depth > i && Ae(n, r, i + 1), s = [];
|
|
491
|
-
return Me(null, e, i, s), a && o && t.index(i) == n.index(i) ? (ke(a, o), je(Ne(a, Pe(e, t, n, r, i + 1)), s)) : (a && je(Ne(a, Fe(e, t, i + 1)), s), Me(t, n, i, s), o && je(Ne(o, Fe(n, r, i + 1)), s)), Me(r, null, i, s), new
|
|
491
|
+
return Me(null, e, i, s), a && o && t.index(i) == n.index(i) ? (ke(a, o), je(Ne(a, Pe(e, t, n, r, i + 1)), s)) : (a && je(Ne(a, Fe(e, t, i + 1)), s), Me(t, n, i, s), o && je(Ne(o, Fe(n, r, i + 1)), s)), Me(r, null, i, s), new E(s);
|
|
492
492
|
}
|
|
493
493
|
function Fe(e, t, n) {
|
|
494
494
|
let r = [];
|
|
495
|
-
return Me(null, e, n, r), e.depth > n && je(Ne(Ae(e, t, n + 1), Fe(e, t, n + 1)), r), Me(t, null, n, r), new
|
|
495
|
+
return Me(null, e, n, r), e.depth > n && je(Ne(Ae(e, t, n + 1), Fe(e, t, n + 1)), r), Me(t, null, n, r), new E(r);
|
|
496
496
|
}
|
|
497
|
-
O.empty = new O(
|
|
497
|
+
O.empty = new O(E.empty, 0, 0);
|
|
498
498
|
var Ie = class e {
|
|
499
499
|
constructor(e, t, n) {
|
|
500
500
|
this.pos = e, this.path = t, this.parentOffset = n, this.depth = t.length / 3 - 1;
|
|
@@ -638,7 +638,7 @@ var Ie = class e {
|
|
|
638
638
|
}
|
|
639
639
|
}, Ve = Object.create(null), He = class e {
|
|
640
640
|
constructor(e, t, n, r = D.none) {
|
|
641
|
-
this.type = e, this.attrs = t, this.marks = r, this.content = n ||
|
|
641
|
+
this.type = e, this.attrs = t, this.marks = r, this.content = n || E.empty;
|
|
642
642
|
}
|
|
643
643
|
get children() {
|
|
644
644
|
return this.content.content;
|
|
@@ -778,7 +778,7 @@ var Ie = class e {
|
|
|
778
778
|
if (!t) throw Error("Called contentMatchAt on a node with invalid content");
|
|
779
779
|
return t;
|
|
780
780
|
}
|
|
781
|
-
canReplace(e, t, n =
|
|
781
|
+
canReplace(e, t, n = E.empty, r = 0, i = n.childCount) {
|
|
782
782
|
let a = this.contentMatchAt(e).matchFragment(n, r, i), o = a && a.matchFragment(this.content, t);
|
|
783
783
|
if (!o || !o.validEnd) return !1;
|
|
784
784
|
for (let e = r; e < i; e++) if (!this.type.allowsMarks(n.child(e).marks)) return !1;
|
|
@@ -821,7 +821,7 @@ var Ie = class e {
|
|
|
821
821
|
if (typeof t.text != "string") throw RangeError("Invalid text node in JSON");
|
|
822
822
|
return e.text(t.text, n);
|
|
823
823
|
}
|
|
824
|
-
let r =
|
|
824
|
+
let r = E.fromJSON(e, t.content), i = e.nodeType(t.type).create(t.attrs, r, n);
|
|
825
825
|
return i.type.checkAttrs(i.attrs), i;
|
|
826
826
|
}
|
|
827
827
|
};
|
|
@@ -962,7 +962,7 @@ var Ge = class e {
|
|
|
962
962
|
let r = [this];
|
|
963
963
|
return function i(a, o) {
|
|
964
964
|
let s = a.matchFragment(e, n);
|
|
965
|
-
if (s && (!t || s.validEnd)) return
|
|
965
|
+
if (s && (!t || s.validEnd)) return E.from(o.map(((e) => e.createAndFill())));
|
|
966
966
|
for (let e = 0; e < a.next.length; e++) {
|
|
967
967
|
let { type: t, next: n } = a.next[e];
|
|
968
968
|
if (!t.isText && !t.hasRequiredAttrs() && r.indexOf(n) == -1) {
|
|
@@ -1221,18 +1221,18 @@ var at = class e {
|
|
|
1221
1221
|
}
|
|
1222
1222
|
create(e = null, t, n) {
|
|
1223
1223
|
if (this.isText) throw Error("NodeType.create can't construct text nodes");
|
|
1224
|
-
return new He(this, this.computeAttrs(e),
|
|
1224
|
+
return new He(this, this.computeAttrs(e), E.from(t), D.setFrom(n));
|
|
1225
1225
|
}
|
|
1226
1226
|
createChecked(e = null, t, n) {
|
|
1227
|
-
return t =
|
|
1227
|
+
return t = E.from(t), this.checkContent(t), new He(this, this.computeAttrs(e), t, D.setFrom(n));
|
|
1228
1228
|
}
|
|
1229
1229
|
createAndFill(e = null, t, n) {
|
|
1230
|
-
if (e = this.computeAttrs(e), (t =
|
|
1230
|
+
if (e = this.computeAttrs(e), (t = E.from(t)).size) {
|
|
1231
1231
|
let e = this.contentMatch.fillBefore(t);
|
|
1232
1232
|
if (!e) return null;
|
|
1233
1233
|
t = e.append(t);
|
|
1234
1234
|
}
|
|
1235
|
-
let r = this.contentMatch.matchFragment(t), i = r && r.fillBefore(
|
|
1235
|
+
let r = this.contentMatch.matchFragment(t), i = r && r.fillBefore(E.empty, !0);
|
|
1236
1236
|
return i ? new He(this, e, t.append(i), D.setFrom(n)) : null;
|
|
1237
1237
|
}
|
|
1238
1238
|
validContent(e) {
|
|
@@ -1501,7 +1501,7 @@ var ht = class {
|
|
|
1501
1501
|
findWrapping(e) {
|
|
1502
1502
|
if (!this.match) {
|
|
1503
1503
|
if (!this.type) return [];
|
|
1504
|
-
let t = this.type.contentMatch.fillBefore(
|
|
1504
|
+
let t = this.type.contentMatch.fillBefore(E.from(e));
|
|
1505
1505
|
if (!t) {
|
|
1506
1506
|
let t, n = this.type.contentMatch;
|
|
1507
1507
|
return (t = n.findWrapping(e.type)) ? (this.match = n, t) : null;
|
|
@@ -1518,8 +1518,8 @@ var ht = class {
|
|
|
1518
1518
|
t.text.length == e[0].length ? this.content.pop() : this.content[this.content.length - 1] = n.withText(n.text.slice(0, n.text.length - e[0].length));
|
|
1519
1519
|
}
|
|
1520
1520
|
}
|
|
1521
|
-
let t =
|
|
1522
|
-
return !e && this.match && (t = t.append(this.match.fillBefore(
|
|
1521
|
+
let t = E.from(this.content);
|
|
1522
|
+
return !e && this.match && (t = t.append(this.match.fillBefore(E.empty, !0))), this.type ? this.type.create(this.attrs, t, this.marks) : t;
|
|
1523
1523
|
}
|
|
1524
1524
|
inlineContext(e) {
|
|
1525
1525
|
return this.type ? this.type.inlineContent : this.content.length ? this.content[0].isInline : e.parentNode && !dt.hasOwnProperty(e.parentNode.nodeName.toLowerCase());
|
|
@@ -2080,7 +2080,7 @@ function Pt(e, t, n) {
|
|
|
2080
2080
|
let a = e.child(i);
|
|
2081
2081
|
a.content.size && (a = a.copy(Pt(a.content, t, a))), a.isInline && (a = t(a, n, i)), r.push(a);
|
|
2082
2082
|
}
|
|
2083
|
-
return
|
|
2083
|
+
return E.fromArray(r);
|
|
2084
2084
|
}
|
|
2085
2085
|
var Ft = class e extends Mt {
|
|
2086
2086
|
constructor(e, t, n) {
|
|
@@ -2154,7 +2154,7 @@ var Lt = class e extends Mt {
|
|
|
2154
2154
|
let t = e.nodeAt(this.pos);
|
|
2155
2155
|
if (!t) return Nt.fail("No node at mark step's position");
|
|
2156
2156
|
let n = t.type.create(t.attrs, null, this.mark.addToSet(t.marks));
|
|
2157
|
-
return Nt.fromReplace(e, this.pos, this.pos + 1, new O(
|
|
2157
|
+
return Nt.fromReplace(e, this.pos, this.pos + 1, new O(E.from(n), 0, +!t.isLeaf));
|
|
2158
2158
|
}
|
|
2159
2159
|
invert(t) {
|
|
2160
2160
|
let n = t.nodeAt(this.pos);
|
|
@@ -2192,7 +2192,7 @@ var Rt = class e extends Mt {
|
|
|
2192
2192
|
let t = e.nodeAt(this.pos);
|
|
2193
2193
|
if (!t) return Nt.fail("No node at mark step's position");
|
|
2194
2194
|
let n = t.type.create(t.attrs, null, this.mark.removeFromSet(t.marks));
|
|
2195
|
-
return Nt.fromReplace(e, this.pos, this.pos + 1, new O(
|
|
2195
|
+
return Nt.fromReplace(e, this.pos, this.pos + 1, new O(E.from(n), 0, +!t.isLeaf));
|
|
2196
2196
|
}
|
|
2197
2197
|
invert(e) {
|
|
2198
2198
|
let t = e.nodeAt(this.pos);
|
|
@@ -2330,13 +2330,13 @@ function Ht(e, t, n, r = n.contentMatch, i = !0) {
|
|
|
2330
2330
|
for (let t = 0; t < c.marks.length; t++) n.allowsMarkType(c.marks[t].type) || e.step(new It(s, l, c.marks[t]));
|
|
2331
2331
|
if (i && c.isText && n.whitespace != "pre") {
|
|
2332
2332
|
let e, t, r = /\r?\n|\r/g;
|
|
2333
|
-
for (; e = r.exec(c.text);) t ||= new O(
|
|
2333
|
+
for (; e = r.exec(c.text);) t ||= new O(E.from(n.schema.text(" ", n.allowedMarks(c.marks))), 0, 0), o.push(new zt(s + e.index, s + e.index + e[0].length, t));
|
|
2334
2334
|
}
|
|
2335
2335
|
} else o.push(new zt(s, l, O.empty));
|
|
2336
2336
|
s = l;
|
|
2337
2337
|
}
|
|
2338
2338
|
if (!r.validEnd) {
|
|
2339
|
-
let t = r.fillBefore(
|
|
2339
|
+
let t = r.fillBefore(E.empty, !0);
|
|
2340
2340
|
e.replace(s, s, new O(t, 0, 0));
|
|
2341
2341
|
}
|
|
2342
2342
|
for (let t = o.length - 1; t >= 0; t--) e.step(o[t]);
|
|
@@ -2462,7 +2462,7 @@ function tn(e, t, n) {
|
|
|
2462
2462
|
Mt.jsonID("replaceAround", Bt);
|
|
2463
2463
|
var nn = class {
|
|
2464
2464
|
constructor(e, t, n) {
|
|
2465
|
-
this.$from = e, this.$to = t, this.unplaced = n, this.frontier = [], this.placed =
|
|
2465
|
+
this.$from = e, this.$to = t, this.unplaced = n, this.frontier = [], this.placed = E.empty;
|
|
2466
2466
|
for (let t = 0; t <= e.depth; t++) {
|
|
2467
2467
|
let n = e.node(t);
|
|
2468
2468
|
this.frontier.push({
|
|
@@ -2470,7 +2470,7 @@ var nn = class {
|
|
|
2470
2470
|
match: n.contentMatchAt(e.indexAfter(t))
|
|
2471
2471
|
});
|
|
2472
2472
|
}
|
|
2473
|
-
for (let t = e.depth; t > 0; t--) this.placed =
|
|
2473
|
+
for (let t = e.depth; t > 0; t--) this.placed = E.from(e.node(t).copy(this.placed));
|
|
2474
2474
|
}
|
|
2475
2475
|
get depth() {
|
|
2476
2476
|
return this.frontier.length - 1;
|
|
@@ -2503,7 +2503,7 @@ var nn = class {
|
|
|
2503
2503
|
let i = e.firstChild;
|
|
2504
2504
|
for (let e = this.depth; e >= 0; e--) {
|
|
2505
2505
|
let a, { type: o, match: s } = this.frontier[e], c = null;
|
|
2506
|
-
if (t == 1 && (i ? s.matchType(i.type) || (c = s.fillBefore(
|
|
2506
|
+
if (t == 1 && (i ? s.matchType(i.type) || (c = s.fillBefore(E.from(i), !1)) : r && o.compatibleContent(r.type))) return {
|
|
2507
2507
|
sliceDepth: n,
|
|
2508
2508
|
frontierDepth: e,
|
|
2509
2509
|
parent: r,
|
|
@@ -2545,7 +2545,7 @@ var nn = class {
|
|
|
2545
2545
|
c++, (c > 1 || s == 0 || e.content.size) && (u = t, l.push(sn(e.mark(d.allowedMarks(e.marks)), c == 1 ? s : 0, c == o.childCount ? f : -1)));
|
|
2546
2546
|
}
|
|
2547
2547
|
let p = c == o.childCount;
|
|
2548
|
-
p || (f = -1), this.placed = an(this.placed, t,
|
|
2548
|
+
p || (f = -1), this.placed = an(this.placed, t, E.from(l)), this.frontier[t].match = u, p && f < 0 && n && n.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
|
|
2549
2549
|
for (let e = 0, t = o; e < f; e++) {
|
|
2550
2550
|
let e = t.lastChild;
|
|
2551
2551
|
this.frontier.push({
|
|
@@ -2592,13 +2592,13 @@ var nn = class {
|
|
|
2592
2592
|
}
|
|
2593
2593
|
openFrontierNode(e, t = null, n) {
|
|
2594
2594
|
let r = this.frontier[this.depth];
|
|
2595
|
-
r.match = r.match.matchType(e), this.placed = an(this.placed, this.depth,
|
|
2595
|
+
r.match = r.match.matchType(e), this.placed = an(this.placed, this.depth, E.from(e.create(t, n))), this.frontier.push({
|
|
2596
2596
|
type: e,
|
|
2597
2597
|
match: e.contentMatch
|
|
2598
2598
|
});
|
|
2599
2599
|
}
|
|
2600
2600
|
closeFrontierNode() {
|
|
2601
|
-
let e = this.frontier.pop().match.fillBefore(
|
|
2601
|
+
let e = this.frontier.pop().match.fillBefore(E.empty, !0);
|
|
2602
2602
|
e.childCount && (this.placed = an(this.placed, this.frontier.length, e));
|
|
2603
2603
|
}
|
|
2604
2604
|
};
|
|
@@ -2615,7 +2615,7 @@ function on(e, t) {
|
|
|
2615
2615
|
function sn(e, t, n) {
|
|
2616
2616
|
if (t <= 0) return e;
|
|
2617
2617
|
let r = e.content;
|
|
2618
|
-
return t > 1 && (r = r.replaceChild(0, sn(r.firstChild, t - 1, r.childCount == 1 ? n - 1 : 0))), t > 0 && (r = e.type.contentMatch.fillBefore(r).append(r), n <= 0 && (r = r.append(e.type.contentMatch.matchFragment(r).fillBefore(
|
|
2618
|
+
return t > 1 && (r = r.replaceChild(0, sn(r.firstChild, t - 1, r.childCount == 1 ? n - 1 : 0))), t > 0 && (r = e.type.contentMatch.fillBefore(r).append(r), n <= 0 && (r = r.append(e.type.contentMatch.matchFragment(r).fillBefore(E.empty, !0)))), e.copy(r);
|
|
2619
2619
|
}
|
|
2620
2620
|
function cn(e, t, n, r, i) {
|
|
2621
2621
|
let a = e.node(t), o = i ? e.indexAfter(t) : e.index(t);
|
|
@@ -2633,7 +2633,7 @@ function ln(e, t, n, r, i) {
|
|
|
2633
2633
|
}
|
|
2634
2634
|
if (t > r) {
|
|
2635
2635
|
let t = i.contentMatchAt(0), n = t.fillBefore(e).append(e);
|
|
2636
|
-
e = n.append(t.matchFragment(n).fillBefore(
|
|
2636
|
+
e = n.append(t.matchFragment(n).fillBefore(E.empty, !0));
|
|
2637
2637
|
}
|
|
2638
2638
|
return e;
|
|
2639
2639
|
}
|
|
@@ -2657,7 +2657,7 @@ var dn = class e extends Mt {
|
|
|
2657
2657
|
for (let e in t.attrs) n[e] = t.attrs[e];
|
|
2658
2658
|
n[this.attr] = this.value;
|
|
2659
2659
|
let r = t.type.create(n, null, t.marks);
|
|
2660
|
-
return Nt.fromReplace(e, this.pos, this.pos + 1, new O(
|
|
2660
|
+
return Nt.fromReplace(e, this.pos, this.pos + 1, new O(E.from(r), 0, +!t.isLeaf));
|
|
2661
2661
|
}
|
|
2662
2662
|
getMap() {
|
|
2663
2663
|
return kt.empty;
|
|
@@ -2761,7 +2761,7 @@ var mn = class {
|
|
|
2761
2761
|
return r && this.step(r), this;
|
|
2762
2762
|
}
|
|
2763
2763
|
replaceWith(e, t, n) {
|
|
2764
|
-
return this.replace(e, t, new O(
|
|
2764
|
+
return this.replace(e, t, new O(E.from(n), 0, 0));
|
|
2765
2765
|
}
|
|
2766
2766
|
delete(e, t) {
|
|
2767
2767
|
return this.replace(e, t, O.empty);
|
|
@@ -2831,7 +2831,7 @@ var mn = class {
|
|
|
2831
2831
|
}(e.doc, t, r.type);
|
|
2832
2832
|
i != null && (t = n = i);
|
|
2833
2833
|
}
|
|
2834
|
-
e.replaceRange(t, n, new O(
|
|
2834
|
+
e.replaceRange(t, n, new O(E.from(r), 0, 0));
|
|
2835
2835
|
}(this, e, t, n), this;
|
|
2836
2836
|
}
|
|
2837
2837
|
deleteRange(e, t) {
|
|
@@ -2859,10 +2859,10 @@ var mn = class {
|
|
|
2859
2859
|
}
|
|
2860
2860
|
lift(e, t) {
|
|
2861
2861
|
return function(e, t, n) {
|
|
2862
|
-
let { $from: r, $to: i, depth: a } = t, o = r.before(a + 1), s = i.after(a + 1), c = o, l = s, u =
|
|
2863
|
-
for (let e = a, t = !1; e > n; e--) t || r.index(e) > 0 ? (t = !0, u =
|
|
2864
|
-
let f =
|
|
2865
|
-
for (let e = a, t = !1; e > n; e--) t || i.after(e + 1) < i.end(e) ? (t = !0, f =
|
|
2862
|
+
let { $from: r, $to: i, depth: a } = t, o = r.before(a + 1), s = i.after(a + 1), c = o, l = s, u = E.empty, d = 0;
|
|
2863
|
+
for (let e = a, t = !1; e > n; e--) t || r.index(e) > 0 ? (t = !0, u = E.from(r.node(e).copy(u)), d++) : c--;
|
|
2864
|
+
let f = E.empty, p = 0;
|
|
2865
|
+
for (let e = a, t = !1; e > n; e--) t || i.after(e + 1) < i.end(e) ? (t = !0, f = E.from(i.node(e).copy(f)), p++) : l++;
|
|
2866
2866
|
e.step(new Bt(c, l, o, s, new O(u.append(f), d, p), u.size - d, !0));
|
|
2867
2867
|
}(this, e, t), this;
|
|
2868
2868
|
}
|
|
@@ -2888,13 +2888,13 @@ var mn = class {
|
|
|
2888
2888
|
}
|
|
2889
2889
|
wrap(e, t) {
|
|
2890
2890
|
return function(e, t, n) {
|
|
2891
|
-
let r =
|
|
2891
|
+
let r = E.empty;
|
|
2892
2892
|
for (let e = n.length - 1; e >= 0; e--) {
|
|
2893
2893
|
if (r.size) {
|
|
2894
2894
|
let t = n[e].type.contentMatch.matchFragment(r);
|
|
2895
2895
|
if (!t || !t.validEnd) throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper");
|
|
2896
2896
|
}
|
|
2897
|
-
r =
|
|
2897
|
+
r = E.from(n[e].type.create(n[e].attrs, r));
|
|
2898
2898
|
}
|
|
2899
2899
|
let i = t.start, a = t.end;
|
|
2900
2900
|
e.step(new Bt(i, a, i, a, new O(r, 0, 0), n.length, !0));
|
|
@@ -2917,7 +2917,7 @@ var mn = class {
|
|
|
2917
2917
|
}
|
|
2918
2918
|
!1 === i && Jt(e, t, n, a), Ht(e, e.mapping.slice(a).map(n, 1), r, void 0, i === null);
|
|
2919
2919
|
let s = e.mapping.slice(a), c = s.map(n, 1), l = s.map(n + t.nodeSize, 1);
|
|
2920
|
-
return e.step(new Bt(c, l, c + 1, l - 1, new O(
|
|
2920
|
+
return e.step(new Bt(c, l, c + 1, l - 1, new O(E.from(r.create(o, null, t.marks)), 0, 0), 1, !0)), !0 === i && qt(e, t, n, a), !1;
|
|
2921
2921
|
}
|
|
2922
2922
|
}));
|
|
2923
2923
|
}(this, e, t, n, r), this;
|
|
@@ -2930,7 +2930,7 @@ var mn = class {
|
|
|
2930
2930
|
let o = n.create(r, null, i || a.marks);
|
|
2931
2931
|
if (a.isLeaf) return e.replaceWith(t, t + a.nodeSize, o);
|
|
2932
2932
|
if (!n.validContent(a.content)) throw RangeError("Invalid content for node type " + n.name);
|
|
2933
|
-
e.step(new Bt(t, t + a.nodeSize, t + 1, t + a.nodeSize - 1, new O(
|
|
2933
|
+
e.step(new Bt(t, t + a.nodeSize, t + 1, t + a.nodeSize - 1, new O(E.from(o), 0, 0), 1, !0));
|
|
2934
2934
|
}(this, e, t, n, r), this;
|
|
2935
2935
|
}
|
|
2936
2936
|
setNodeAttribute(e, t, n) {
|
|
@@ -2955,11 +2955,11 @@ var mn = class {
|
|
|
2955
2955
|
}
|
|
2956
2956
|
split(e, t = 1, n) {
|
|
2957
2957
|
return function(e, t, n = 1, r) {
|
|
2958
|
-
let i = e.doc.resolve(t), a =
|
|
2958
|
+
let i = e.doc.resolve(t), a = E.empty, o = E.empty;
|
|
2959
2959
|
for (let e = i.depth, t = i.depth - n, s = n - 1; e > t; e--, s--) {
|
|
2960
|
-
a =
|
|
2960
|
+
a = E.from(i.node(e).copy(a));
|
|
2961
2961
|
let t = r && r[s];
|
|
2962
|
-
o =
|
|
2962
|
+
o = E.from(t ? t.type.create(t.attrs, o) : i.node(e).copy(o));
|
|
2963
2963
|
}
|
|
2964
2964
|
e.step(new zt(t, t, new O(a.append(o), n, n), !0));
|
|
2965
2965
|
}(this, e, t, n), this;
|
|
@@ -3169,7 +3169,7 @@ var yn = class e {
|
|
|
3169
3169
|
return r ? k.near(a) : new e(a);
|
|
3170
3170
|
}
|
|
3171
3171
|
content() {
|
|
3172
|
-
return new O(
|
|
3172
|
+
return new O(E.from(this.node), 0, 0);
|
|
3173
3173
|
}
|
|
3174
3174
|
eq(t) {
|
|
3175
3175
|
return t instanceof e && t.anchor == this.anchor;
|
|
@@ -3698,9 +3698,9 @@ function Qn(e, t, n, r) {
|
|
|
3698
3698
|
let l = !c && t.parent.canReplace(t.index(), t.index() + 1);
|
|
3699
3699
|
if (l && (i = (a = o.contentMatchAt(o.childCount)).findWrapping(s.type)) && a.matchType(i[0] || s.type).validEnd) {
|
|
3700
3700
|
if (n) {
|
|
3701
|
-
let r = t.pos + s.nodeSize, a =
|
|
3702
|
-
for (let e = i.length - 1; e >= 0; e--) a =
|
|
3703
|
-
a =
|
|
3701
|
+
let r = t.pos + s.nodeSize, a = E.empty;
|
|
3702
|
+
for (let e = i.length - 1; e >= 0; e--) a = E.from(i[e].create(null, a));
|
|
3703
|
+
a = E.from(o.copy(a));
|
|
3704
3704
|
let c = e.tr.step(new Bt(t.pos - 1, r, t.pos, r, new O(a, 1, 0), i.length, !0)), l = c.doc.resolve(r + 2 * i.length);
|
|
3705
3705
|
l.nodeAfter && l.nodeAfter.type == o.type && Xt(c.doc, l.pos) && c.join(l.pos), n(c.scrollIntoView());
|
|
3706
3706
|
}
|
|
@@ -3715,8 +3715,8 @@ function Qn(e, t, n, r) {
|
|
|
3715
3715
|
for (; !a.isTextblock; a = a.firstChild) c++;
|
|
3716
3716
|
if (r.canReplace(r.childCount, r.childCount, a.content)) {
|
|
3717
3717
|
if (n) {
|
|
3718
|
-
let r =
|
|
3719
|
-
for (let e = i.length - 1; e >= 0; e--) r =
|
|
3718
|
+
let r = E.empty;
|
|
3719
|
+
for (let e = i.length - 1; e >= 0; e--) r = E.from(i[e].copy(r));
|
|
3720
3720
|
n(e.tr.step(new Bt(t.pos - i.length, t.pos + s.nodeSize, t.pos + c, t.pos + s.nodeSize - c, new O(r, i.length, 0), 0, !0)).scrollIntoView());
|
|
3721
3721
|
}
|
|
3722
3722
|
return !0;
|
|
@@ -3802,8 +3802,8 @@ function cr(e, t = null) {
|
|
|
3802
3802
|
}
|
|
3803
3803
|
let s = Gt(a, n, r, t);
|
|
3804
3804
|
return s ? (e && function(e, t, n, r, i) {
|
|
3805
|
-
let a =
|
|
3806
|
-
for (let e = n.length - 1; e >= 0; e--) a =
|
|
3805
|
+
let a = E.empty;
|
|
3806
|
+
for (let e = n.length - 1; e >= 0; e--) a = E.from(n[e].type.create(n[e].attrs, a));
|
|
3807
3807
|
e.step(new Bt(t.start - (r ? 2 : 0), t.end, t.start, t.end, new O(a, 0, 0), n.length, !0));
|
|
3808
3808
|
let o = 0;
|
|
3809
3809
|
for (let e = 0; e < n.length; e++) n[e].type == i && (o = e + 1);
|
|
@@ -3818,7 +3818,7 @@ function lr(e) {
|
|
|
3818
3818
|
let { $from: r, $to: i } = t.selection, a = r.blockRange(i, ((t) => t.childCount > 0 && t.firstChild.type == e));
|
|
3819
3819
|
return !!a && (!n || (r.node(a.depth - 1).type == e ? function(e, t, n, r) {
|
|
3820
3820
|
let i = e.tr, a = r.end, o = r.$to.end(r.depth);
|
|
3821
|
-
a < o && (i.step(new Bt(a - 1, o, a, o, new O(
|
|
3821
|
+
a < o && (i.step(new Bt(a - 1, o, a, o, new O(E.from(n.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new Be(i.doc.resolve(r.$from.pos), i.doc.resolve(o), r.depth));
|
|
3822
3822
|
let s = Wt(r);
|
|
3823
3823
|
if (s == null) return !1;
|
|
3824
3824
|
i.lift(r, s);
|
|
@@ -3830,9 +3830,9 @@ function lr(e) {
|
|
|
3830
3830
|
let a = r.doc.resolve(n.start), o = a.nodeAfter;
|
|
3831
3831
|
if (r.mapping.map(n.end) != n.start + a.nodeAfter.nodeSize) return !1;
|
|
3832
3832
|
let s = n.startIndex == 0, c = n.endIndex == i.childCount, l = a.node(-1), u = a.index(-1);
|
|
3833
|
-
if (!l.canReplace(u + +!s, u + 1, o.content.append(c ?
|
|
3833
|
+
if (!l.canReplace(u + +!s, u + 1, o.content.append(c ? E.empty : E.from(i)))) return !1;
|
|
3834
3834
|
let d = a.pos, f = d + o.nodeSize;
|
|
3835
|
-
return r.step(new Bt(d - +!!s, f + +!!c, d + 1, f - 1, new O((s ?
|
|
3835
|
+
return r.step(new Bt(d - +!!s, f + +!!c, d + 1, f - 1, new O((s ? E.empty : E.from(i.copy(E.empty))).append(c ? E.empty : E.from(i.copy(E.empty))), +!s, +!c), +!s)), t(r.scrollIntoView()), !0;
|
|
3836
3836
|
}(t, n, a)));
|
|
3837
3837
|
};
|
|
3838
3838
|
}
|
|
@@ -4640,7 +4640,7 @@ var ci = class {
|
|
|
4640
4640
|
break;
|
|
4641
4641
|
}
|
|
4642
4642
|
}
|
|
4643
|
-
e.contentElement || (e.getContent = () =>
|
|
4643
|
+
e.contentElement || (e.getContent = () => E.empty);
|
|
4644
4644
|
} else e.contentElement = this.contentDOM;
|
|
4645
4645
|
else e.getContent = () => this.node.content;
|
|
4646
4646
|
return e;
|
|
@@ -5440,7 +5440,7 @@ function ta(e, t, n, r, i) {
|
|
|
5440
5440
|
if (c) {
|
|
5441
5441
|
if (e.someProp("transformPastedText", ((n) => {
|
|
5442
5442
|
t = n(t, s || r, e);
|
|
5443
|
-
})), s) return o = new O(
|
|
5443
|
+
})), s) return o = new O(E.from(e.state.schema.text(t.replace(/\r\n?/g, "\n"))), 0, 0), e.someProp("transformPasted", ((t) => {
|
|
5444
5444
|
o = t(o, e, !0);
|
|
5445
5445
|
})), o;
|
|
5446
5446
|
let n = e.someProp("clipboardTextParser", ((n) => n(t, i, r, e)));
|
|
@@ -5503,7 +5503,7 @@ function ta(e, t, n, r, i) {
|
|
|
5503
5503
|
for (let e = n.length - 2; e >= 0; e -= 2) {
|
|
5504
5504
|
let t = r.nodes[n[e]];
|
|
5505
5505
|
if (!t || t.hasRequiredAttrs()) break;
|
|
5506
|
-
i =
|
|
5506
|
+
i = E.from(t.create(n[e + 1], i)), a++, o++;
|
|
5507
5507
|
}
|
|
5508
5508
|
return new O(i, a, o);
|
|
5509
5509
|
}(sa(o, +u[1], +u[2]), u[4]);
|
|
@@ -5521,7 +5521,7 @@ function ta(e, t, n, r, i) {
|
|
|
5521
5521
|
let t = ra(e, n);
|
|
5522
5522
|
a.push(t), i = i.matchType(t.type), r = n;
|
|
5523
5523
|
}
|
|
5524
|
-
})), a) return
|
|
5524
|
+
})), a) return E.from(a);
|
|
5525
5525
|
}
|
|
5526
5526
|
return e;
|
|
5527
5527
|
}(o.content, i), !0), o.openStart || o.openEnd) {
|
|
@@ -5536,24 +5536,24 @@ function ta(e, t, n, r, i) {
|
|
|
5536
5536
|
}
|
|
5537
5537
|
var na = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
|
|
5538
5538
|
function ra(e, t, n = 0) {
|
|
5539
|
-
for (let r = t.length - 1; r >= n; r--) e = t[r].create(null,
|
|
5539
|
+
for (let r = t.length - 1; r >= n; r--) e = t[r].create(null, E.from(e));
|
|
5540
5540
|
return e;
|
|
5541
5541
|
}
|
|
5542
5542
|
function ia(e, t, n, r, i) {
|
|
5543
5543
|
if (i < e.length && i < t.length && e[i] == t[i]) {
|
|
5544
5544
|
let a = ia(e, t, n, r.lastChild, i + 1);
|
|
5545
5545
|
if (a) return r.copy(r.content.replaceChild(r.childCount - 1, a));
|
|
5546
|
-
if (r.contentMatchAt(r.childCount).matchType(i == e.length - 1 ? n.type : e[i + 1])) return r.copy(r.content.append(
|
|
5546
|
+
if (r.contentMatchAt(r.childCount).matchType(i == e.length - 1 ? n.type : e[i + 1])) return r.copy(r.content.append(E.from(ra(n, e, i + 1))));
|
|
5547
5547
|
}
|
|
5548
5548
|
}
|
|
5549
5549
|
function aa(e, t) {
|
|
5550
5550
|
if (t == 0) return e;
|
|
5551
|
-
let n = e.content.replaceChild(e.childCount - 1, aa(e.lastChild, t - 1)), r = e.contentMatchAt(e.childCount).fillBefore(
|
|
5551
|
+
let n = e.content.replaceChild(e.childCount - 1, aa(e.lastChild, t - 1)), r = e.contentMatchAt(e.childCount).fillBefore(E.empty, !0);
|
|
5552
5552
|
return e.copy(n.append(r));
|
|
5553
5553
|
}
|
|
5554
5554
|
function oa(e, t, n, r, i, a) {
|
|
5555
5555
|
let o = t < 0 ? e.firstChild : e.lastChild, s = o.content;
|
|
5556
|
-
return e.childCount > 1 && (a = 0), i < r - 1 && (s = oa(s, t, n, r, i + 1, a)), i >= n && (s = t < 0 ? o.contentMatchAt(0).fillBefore(s, a <= i).append(s) : s.append(o.contentMatchAt(o.childCount).fillBefore(
|
|
5556
|
+
return e.childCount > 1 && (a = 0), i < r - 1 && (s = oa(s, t, n, r, i + 1, a)), i >= n && (s = t < 0 ? o.contentMatchAt(0).fillBefore(s, a <= i).append(s) : s.append(o.contentMatchAt(o.childCount).fillBefore(E.empty, !0))), e.replaceChild(t < 0 ? 0 : e.childCount - 1, o.copy(s));
|
|
5557
5557
|
}
|
|
5558
5558
|
function sa(e, t, n) {
|
|
5559
5559
|
return t < e.openStart && (e = new O(oa(e.content, -1, t, e.openStart, 0, e.openEnd), t, e.openEnd)), n < e.openEnd && (e = new O(oa(e.content, 1, n, e.openEnd, 0, 0), e.openStart, n)), e;
|
|
@@ -6515,7 +6515,7 @@ function go(e, t, n, r, i) {
|
|
|
6515
6515
|
}
|
|
6516
6516
|
let l = [];
|
|
6517
6517
|
for (let e = 0; e < t.childCount; e++) l.push(i(t.child(e)));
|
|
6518
|
-
if (
|
|
6518
|
+
if (E.from(l).eq(e)) return {
|
|
6519
6519
|
mark: r,
|
|
6520
6520
|
type: n
|
|
6521
6521
|
};
|
|
@@ -7145,7 +7145,7 @@ function Fo(e) {
|
|
|
7145
7145
|
return !1;
|
|
7146
7146
|
};
|
|
7147
7147
|
}
|
|
7148
|
-
var Io =
|
|
7148
|
+
var Io = _e(), Lo = Object.defineProperty, Ro = (e, t) => {
|
|
7149
7149
|
for (var n in t) Lo(e, n, {
|
|
7150
7150
|
get: t[n],
|
|
7151
7151
|
enumerable: !0
|
|
@@ -7485,7 +7485,7 @@ function ys(e) {
|
|
|
7485
7485
|
return vs(n);
|
|
7486
7486
|
}
|
|
7487
7487
|
function bs(e, t, n) {
|
|
7488
|
-
if (e instanceof He || e instanceof
|
|
7488
|
+
if (e instanceof He || e instanceof E) return e;
|
|
7489
7489
|
n = {
|
|
7490
7490
|
slice: !0,
|
|
7491
7491
|
parseOptions: {},
|
|
@@ -7493,7 +7493,7 @@ function bs(e, t, n) {
|
|
|
7493
7493
|
};
|
|
7494
7494
|
let r = typeof e == "string";
|
|
7495
7495
|
if (typeof e == "object" && e) try {
|
|
7496
|
-
if (Array.isArray(e) && e.length > 0) return
|
|
7496
|
+
if (Array.isArray(e) && e.length > 0) return E.fromArray(e.map(((e) => t.nodeFromJSON(e))));
|
|
7497
7497
|
let r = t.nodeFromJSON(e);
|
|
7498
7498
|
return n.errorOnInvalidContent && r.check(), r;
|
|
7499
7499
|
} catch (r) {
|
|
@@ -7573,7 +7573,7 @@ var xs = (e, t, n) => ({ tr: r, dispatch: i, editor: a }) => {
|
|
|
7573
7573
|
}
|
|
7574
7574
|
if (f) {
|
|
7575
7575
|
if (Array.isArray(t)) l = t.map(((e) => e.text || "")).join("");
|
|
7576
|
-
else if (t instanceof
|
|
7576
|
+
else if (t instanceof E) {
|
|
7577
7577
|
let e = "";
|
|
7578
7578
|
t.forEach(((t) => {
|
|
7579
7579
|
t.text && (e += t.text);
|
|
@@ -8231,7 +8231,7 @@ var Dc = (e, t = {}) => ({ tr: n, state: r, dispatch: i }) => {
|
|
|
8231
8231
|
let s = a.parent, c = s.child(o - 1);
|
|
8232
8232
|
if (c.type != r) return !1;
|
|
8233
8233
|
if (t) {
|
|
8234
|
-
let n = c.lastChild && c.lastChild.type == s.type, i =
|
|
8234
|
+
let n = c.lastChild && c.lastChild.type == s.type, i = E.from(n ? r.create() : null), o = new O(E.from(r.create(null, E.from(s.type.create(null, i)))), n ? 3 : 1, 0), l = a.start, u = a.end;
|
|
8235
8235
|
t(e.tr.step(new Bt(l - (n ? 3 : 1), u, l, u, o, 1, !0)).scrollIntoView());
|
|
8236
8236
|
}
|
|
8237
8237
|
return !0;
|
|
@@ -8279,13 +8279,13 @@ var Fc = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor
|
|
|
8279
8279
|
if (s.parent.content.size === 0 && s.node(-1).childCount === s.indexAfter(-1)) {
|
|
8280
8280
|
if (s.depth === 2 || s.node(-3).type !== o || s.index(-2) !== s.node(-2).childCount - 1) return !1;
|
|
8281
8281
|
if (i) {
|
|
8282
|
-
let e =
|
|
8283
|
-
for (let t = s.depth - r; t >= s.depth - 3; --t) e =
|
|
8282
|
+
let e = E.empty, r = s.index(-1) ? 1 : s.index(-2) ? 2 : 3;
|
|
8283
|
+
for (let t = s.depth - r; t >= s.depth - 3; --t) e = E.from(s.node(t).copy(e));
|
|
8284
8284
|
let i = s.indexAfter(-1) < s.node(-2).childCount ? 1 : s.indexAfter(-2) < s.node(-3).childCount ? 2 : 3, a = {
|
|
8285
8285
|
..._c(d, s.node().type.name, s.node().attrs),
|
|
8286
8286
|
...t
|
|
8287
8287
|
}, c = o.contentMatch.defaultType?.createAndFill(a) || void 0;
|
|
8288
|
-
e = e.append(
|
|
8288
|
+
e = e.append(E.from(o.createAndFill(null, c) || void 0));
|
|
8289
8289
|
let l = s.before(s.depth - (r - 1));
|
|
8290
8290
|
n.replace(l, s.after(-i), new O(e, 4 - r, 0));
|
|
8291
8291
|
let u = -1;
|
|
@@ -8350,9 +8350,9 @@ var zc = (e, t) => {
|
|
|
8350
8350
|
node: te,
|
|
8351
8351
|
pos: 0,
|
|
8352
8352
|
depth: 0
|
|
8353
|
-
} : null, re = x ?? ne,
|
|
8354
|
-
if ((x && y.depth >= 1 && y.depth - x.depth <= 1 ||
|
|
8355
|
-
if (re.node.type === p) return S &&
|
|
8353
|
+
} : null, re = x ?? ne, C = !!ne;
|
|
8354
|
+
if ((x && y.depth >= 1 && y.depth - x.depth <= 1 || C) && re) {
|
|
8355
|
+
if (re.node.type === p) return S && C ? c().command((({ tr: e, dispatch: t }) => {
|
|
8356
8356
|
let n = function(e) {
|
|
8357
8357
|
let t = e.doc, n = t.firstChild;
|
|
8358
8358
|
if (!n) return null;
|
|
@@ -8980,7 +8980,7 @@ function bl(e) {
|
|
|
8980
8980
|
if (!l && !u && !f) return;
|
|
8981
8981
|
if (f) {
|
|
8982
8982
|
let { text: t } = d;
|
|
8983
|
-
typeof t == "string" || (t = $s(
|
|
8983
|
+
typeof t == "string" || (t = $s(E.from(t), r.schema));
|
|
8984
8984
|
let { from: n } = d, i = n + t.length, a = ((e) => {
|
|
8985
8985
|
var t;
|
|
8986
8986
|
let n = new ClipboardEvent("paste", { clipboardData: new DataTransfer() });
|
|
@@ -9130,7 +9130,7 @@ var xl = class {
|
|
|
9130
9130
|
let s = e.getMeta("applyInputRules");
|
|
9131
9131
|
return s && setTimeout((() => {
|
|
9132
9132
|
let { text: e } = s;
|
|
9133
|
-
typeof e == "string" || (e = $s(
|
|
9133
|
+
typeof e == "string" || (e = $s(E.from(e), a.schema));
|
|
9134
9134
|
let { from: i } = s;
|
|
9135
9135
|
ml({
|
|
9136
9136
|
editor: t,
|
|
@@ -10362,8 +10362,8 @@ function Mu(e = {}) {
|
|
|
10362
10362
|
});
|
|
10363
10363
|
var o;
|
|
10364
10364
|
}
|
|
10365
|
-
var Nu =
|
|
10366
|
-
var t =
|
|
10365
|
+
var Nu = fe(((e) => {
|
|
10366
|
+
var t = he(), n = _e(), r = typeof Object.is == "function" ? Object.is : function(e, t) {
|
|
10367
10367
|
return e === t && (e !== 0 || 1 / e == 1 / t) || e != e && t != t;
|
|
10368
10368
|
}, i = n.useSyncExternalStore, a = t.useRef, o = t.useEffect, s = t.useMemo, c = t.useDebugValue;
|
|
10369
10369
|
e.useSyncExternalStoreWithSelector = function(e, t, n, l, u) {
|
|
@@ -10405,7 +10405,7 @@ var Nu = pe(((e) => {
|
|
|
10405
10405
|
f.hasValue = !0, f.value = p;
|
|
10406
10406
|
}), [p]), c(p), p;
|
|
10407
10407
|
};
|
|
10408
|
-
})), Pu =
|
|
10408
|
+
})), Pu = fe(((e, t) => {
|
|
10409
10409
|
t.exports = Nu();
|
|
10410
10410
|
}))(), Fu = (...e) => (t) => {
|
|
10411
10411
|
e.forEach(((e) => {
|
|
@@ -11658,7 +11658,7 @@ var Af = c(((e, t) => kf({
|
|
|
11658
11658
|
handleOpen: r,
|
|
11659
11659
|
anchorEl: e
|
|
11660
11660
|
};
|
|
11661
|
-
}), Mf = (e) => x(
|
|
11661
|
+
}), Mf = (e) => x(le, {
|
|
11662
11662
|
...e,
|
|
11663
11663
|
sx: { "&.MuiMenuItem-root": {
|
|
11664
11664
|
color: "var(--colors-delta-700)",
|
|
@@ -11714,11 +11714,11 @@ var Ff = {
|
|
|
11714
11714
|
a(Object.keys(Ff).find(((e) => Ff[e] === t)) || "normal");
|
|
11715
11715
|
}
|
|
11716
11716
|
}));
|
|
11717
|
-
}), [t.state.selection, t.state.doc]), S(b, { children: [x(
|
|
11717
|
+
}), [t.state.selection, t.state.doc]), S(b, { children: [x(de, {
|
|
11718
11718
|
title: Pf(r).font_size,
|
|
11719
11719
|
placement: "top",
|
|
11720
11720
|
arrow: !0,
|
|
11721
|
-
children: x("span", { children: x(
|
|
11721
|
+
children: x("span", { children: x(C, {
|
|
11722
11722
|
size: "large",
|
|
11723
11723
|
dataTest: "richeditor-more-menu-button",
|
|
11724
11724
|
variant: "textGray",
|
|
@@ -11735,7 +11735,7 @@ var Ff = {
|
|
|
11735
11735
|
}),
|
|
11736
11736
|
children: i
|
|
11737
11737
|
}) })
|
|
11738
|
-
}), S(
|
|
11738
|
+
}), S(ue, {
|
|
11739
11739
|
disablePortal: !0,
|
|
11740
11740
|
disableEnforceFocus: !0,
|
|
11741
11741
|
disableAutoFocus: !0,
|
|
@@ -11823,11 +11823,11 @@ var Ff = {
|
|
|
11823
11823
|
].find(((e) => t < e.width))?.buttons;
|
|
11824
11824
|
l(n === void 0 ? 8 : n);
|
|
11825
11825
|
let r = [];
|
|
11826
|
-
Number(n) < 9 && r.push(x(
|
|
11826
|
+
Number(n) < 9 && r.push(x(de, {
|
|
11827
11827
|
title: d.link,
|
|
11828
11828
|
placement: "top",
|
|
11829
11829
|
arrow: !0,
|
|
11830
|
-
children: x("span", { children: x(
|
|
11830
|
+
children: x("span", { children: x(le, {
|
|
11831
11831
|
className: "flex items-center justify-center",
|
|
11832
11832
|
onMouseDown: (e) => {
|
|
11833
11833
|
e.preventDefault(), i();
|
|
@@ -11835,11 +11835,11 @@ var Ff = {
|
|
|
11835
11835
|
selected: e.isActive("link"),
|
|
11836
11836
|
children: x(ne, {})
|
|
11837
11837
|
}, "link") })
|
|
11838
|
-
}, "link")), Number(n) < 8 && r.push(x(
|
|
11838
|
+
}, "link")), Number(n) < 8 && r.push(x(de, {
|
|
11839
11839
|
title: d.italic,
|
|
11840
11840
|
placement: "top",
|
|
11841
11841
|
arrow: !0,
|
|
11842
|
-
children: x("span", { children: x(
|
|
11842
|
+
children: x("span", { children: x(le, {
|
|
11843
11843
|
className: "flex items-center justify-center",
|
|
11844
11844
|
onMouseDown: (t) => {
|
|
11845
11845
|
t.preventDefault(), e.chain().focus().toggleItalic().run();
|
|
@@ -11850,11 +11850,11 @@ var Ff = {
|
|
|
11850
11850
|
height: 20
|
|
11851
11851
|
})
|
|
11852
11852
|
}, "italic") })
|
|
11853
|
-
}, "italic")), Number(n) < 7 && r.push(x(
|
|
11853
|
+
}, "italic")), Number(n) < 7 && r.push(x(de, {
|
|
11854
11854
|
title: d.bold,
|
|
11855
11855
|
placement: "top",
|
|
11856
11856
|
arrow: !0,
|
|
11857
|
-
children: x("span", { children: x(
|
|
11857
|
+
children: x("span", { children: x(le, {
|
|
11858
11858
|
className: "flex items-center justify-center",
|
|
11859
11859
|
onMouseDown: (t) => {
|
|
11860
11860
|
t.preventDefault(), e.chain().focus().toggleBold().run();
|
|
@@ -11862,11 +11862,11 @@ var Ff = {
|
|
|
11862
11862
|
selected: e.isActive("bold"),
|
|
11863
11863
|
children: x(Af, { icon: "ooui:bold-b" })
|
|
11864
11864
|
}, "bold") })
|
|
11865
|
-
}, "bold")), Number(n) < 6 && r.push(x(
|
|
11865
|
+
}, "bold")), Number(n) < 6 && r.push(x(de, {
|
|
11866
11866
|
title: d.ordered_list,
|
|
11867
11867
|
placement: "top",
|
|
11868
11868
|
arrow: !0,
|
|
11869
|
-
children: x("span", { children: x(
|
|
11869
|
+
children: x("span", { children: x(le, {
|
|
11870
11870
|
className: "flex items-center justify-center",
|
|
11871
11871
|
onMouseDown: (t) => {
|
|
11872
11872
|
t.preventDefault(), e.chain().focus().toggleOrderedList().run();
|
|
@@ -11877,11 +11877,11 @@ var Ff = {
|
|
|
11877
11877
|
fontSize: 20
|
|
11878
11878
|
})
|
|
11879
11879
|
}, "ordered") })
|
|
11880
|
-
}, "ordered")), Number(n) < 5 && r.push(x(
|
|
11880
|
+
}, "ordered")), Number(n) < 5 && r.push(x(de, {
|
|
11881
11881
|
title: d.bullet_list,
|
|
11882
11882
|
placement: "top",
|
|
11883
11883
|
arrow: !0,
|
|
11884
|
-
children: x("span", { children: x(
|
|
11884
|
+
children: x("span", { children: x(le, {
|
|
11885
11885
|
className: "flex items-center justify-center",
|
|
11886
11886
|
onMouseDown: (t) => {
|
|
11887
11887
|
t.preventDefault(), e.chain().focus().toggleBulletList().run();
|
|
@@ -11901,9 +11901,9 @@ var Ff = {
|
|
|
11901
11901
|
i,
|
|
11902
11902
|
f
|
|
11903
11903
|
]);
|
|
11904
|
-
let { anchorEl: re, open:
|
|
11904
|
+
let { anchorEl: re, open: ie, handleClose: ae, handleOpen: oe } = jf();
|
|
11905
11905
|
return x(b, { children: S("div", {
|
|
11906
|
-
className:
|
|
11906
|
+
className: me("toolbar", {
|
|
11907
11907
|
"toolbar-error": n,
|
|
11908
11908
|
"toolbar-focused": r
|
|
11909
11909
|
}),
|
|
@@ -11911,13 +11911,13 @@ var Ff = {
|
|
|
11911
11911
|
children: [S("div", {
|
|
11912
11912
|
className: "flex flex-row items-center gap-1",
|
|
11913
11913
|
children: [
|
|
11914
|
-
c >= 1 && x(
|
|
11914
|
+
c >= 1 && x(de, {
|
|
11915
11915
|
arrow: !0,
|
|
11916
11916
|
title: d.emojis,
|
|
11917
11917
|
placement: "top",
|
|
11918
11918
|
children: x("span", {
|
|
11919
11919
|
ref: s,
|
|
11920
|
-
children: x(
|
|
11920
|
+
children: x(C, {
|
|
11921
11921
|
dataTest: "richeditor-emoji-button",
|
|
11922
11922
|
size: "large",
|
|
11923
11923
|
variant: "textGray",
|
|
@@ -11936,11 +11936,11 @@ var Ff = {
|
|
|
11936
11936
|
})
|
|
11937
11937
|
})
|
|
11938
11938
|
}),
|
|
11939
|
-
c >= 2 && x(
|
|
11939
|
+
c >= 2 && x(de, {
|
|
11940
11940
|
title: d.heading1,
|
|
11941
11941
|
placement: "top",
|
|
11942
11942
|
arrow: !0,
|
|
11943
|
-
children: x("span", { children: x(
|
|
11943
|
+
children: x("span", { children: x(C, {
|
|
11944
11944
|
dataTest: "richeditor-h1-button",
|
|
11945
11945
|
className: "text-delta-700 text-sm font-semibold",
|
|
11946
11946
|
size: "large",
|
|
@@ -11956,11 +11956,11 @@ var Ff = {
|
|
|
11956
11956
|
children: "H1"
|
|
11957
11957
|
}) })
|
|
11958
11958
|
}),
|
|
11959
|
-
c >= 3 && x(
|
|
11959
|
+
c >= 3 && x(de, {
|
|
11960
11960
|
title: d.heading2,
|
|
11961
11961
|
placement: "top",
|
|
11962
11962
|
arrow: !0,
|
|
11963
|
-
children: x("span", { children: x(
|
|
11963
|
+
children: x("span", { children: x(C, {
|
|
11964
11964
|
dataTest: "richeditor-h2-button",
|
|
11965
11965
|
className: "text-delta-700 text-sm font-semibold",
|
|
11966
11966
|
size: "large",
|
|
@@ -11981,11 +11981,11 @@ var Ff = {
|
|
|
11981
11981
|
isNorsk: f,
|
|
11982
11982
|
locale: o
|
|
11983
11983
|
}),
|
|
11984
|
-
c >= 5 && x(
|
|
11984
|
+
c >= 5 && x(de, {
|
|
11985
11985
|
title: d.bullet_list,
|
|
11986
11986
|
placement: "top",
|
|
11987
11987
|
arrow: !0,
|
|
11988
|
-
children: x("span", { children: x(
|
|
11988
|
+
children: x("span", { children: x(C, {
|
|
11989
11989
|
dataTest: "richeditor-bullet-list-button",
|
|
11990
11990
|
size: "large",
|
|
11991
11991
|
variant: e.isActive("bulletList") ? "text" : "textGray",
|
|
@@ -12003,11 +12003,11 @@ var Ff = {
|
|
|
12003
12003
|
})
|
|
12004
12004
|
}) })
|
|
12005
12005
|
}),
|
|
12006
|
-
c >= 6 && x(
|
|
12006
|
+
c >= 6 && x(de, {
|
|
12007
12007
|
title: d.ordered_list,
|
|
12008
12008
|
placement: "top",
|
|
12009
12009
|
arrow: !0,
|
|
12010
|
-
children: x("span", { children: x(
|
|
12010
|
+
children: x("span", { children: x(C, {
|
|
12011
12011
|
dataTest: "richeditor-ordered-list-button",
|
|
12012
12012
|
size: "large",
|
|
12013
12013
|
variant: e.isActive("orderedList") ? "text" : "textGray",
|
|
@@ -12025,11 +12025,11 @@ var Ff = {
|
|
|
12025
12025
|
})
|
|
12026
12026
|
}) })
|
|
12027
12027
|
}),
|
|
12028
|
-
c >= 7 && x(
|
|
12028
|
+
c >= 7 && x(de, {
|
|
12029
12029
|
title: d.bold,
|
|
12030
12030
|
placement: "top",
|
|
12031
12031
|
arrow: !0,
|
|
12032
|
-
children: x("span", { children: x(
|
|
12032
|
+
children: x("span", { children: x(C, {
|
|
12033
12033
|
dataTest: "richeditor-bold-button",
|
|
12034
12034
|
size: "large",
|
|
12035
12035
|
variant: e.isActive("bold") ? "text" : "textGray",
|
|
@@ -12047,11 +12047,11 @@ var Ff = {
|
|
|
12047
12047
|
})
|
|
12048
12048
|
}) })
|
|
12049
12049
|
}),
|
|
12050
|
-
c >= 8 && x(
|
|
12050
|
+
c >= 8 && x(de, {
|
|
12051
12051
|
title: d.italic,
|
|
12052
12052
|
placement: "top",
|
|
12053
12053
|
arrow: !0,
|
|
12054
|
-
children: x("span", { children: x(
|
|
12054
|
+
children: x("span", { children: x(C, {
|
|
12055
12055
|
dataTest: "richeditor-italic-button",
|
|
12056
12056
|
size: "large",
|
|
12057
12057
|
variant: e.isActive("italic") ? "text" : "textGray",
|
|
@@ -12069,11 +12069,11 @@ var Ff = {
|
|
|
12069
12069
|
})
|
|
12070
12070
|
}) })
|
|
12071
12071
|
}),
|
|
12072
|
-
c >= 9 && x(
|
|
12072
|
+
c >= 9 && x(de, {
|
|
12073
12073
|
title: d.link,
|
|
12074
12074
|
placement: "top",
|
|
12075
12075
|
arrow: !0,
|
|
12076
|
-
children: x("span", { children: x(
|
|
12076
|
+
children: x("span", { children: x(C, {
|
|
12077
12077
|
dataTest: "richeditor-link-button",
|
|
12078
12078
|
size: "large",
|
|
12079
12079
|
variant: e.isActive("link") ? "text" : "textGray",
|
|
@@ -12090,11 +12090,11 @@ var Ff = {
|
|
|
12090
12090
|
})
|
|
12091
12091
|
}) })
|
|
12092
12092
|
}),
|
|
12093
|
-
p && S(b, { children: [x(
|
|
12093
|
+
p && S(b, { children: [x(de, {
|
|
12094
12094
|
title: d.more,
|
|
12095
12095
|
placement: "top",
|
|
12096
12096
|
arrow: !0,
|
|
12097
|
-
children: x("span", { children: x(
|
|
12097
|
+
children: x("span", { children: x(C, {
|
|
12098
12098
|
size: "large",
|
|
12099
12099
|
dataTest: "richeditor-more-menu-button",
|
|
12100
12100
|
variant: "text",
|
|
@@ -12103,7 +12103,7 @@ var Ff = {
|
|
|
12103
12103
|
maxWidth: 40
|
|
12104
12104
|
},
|
|
12105
12105
|
onMouseDown: (e) => {
|
|
12106
|
-
e.stopPropagation(), e.preventDefault(),
|
|
12106
|
+
e.stopPropagation(), e.preventDefault(), oe(e);
|
|
12107
12107
|
},
|
|
12108
12108
|
onMouseUp: (e) => {
|
|
12109
12109
|
e.stopPropagation(), e.preventDefault();
|
|
@@ -12114,20 +12114,20 @@ var Ff = {
|
|
|
12114
12114
|
height: 20
|
|
12115
12115
|
})
|
|
12116
12116
|
}) })
|
|
12117
|
-
}), x(
|
|
12117
|
+
}), x(ue, {
|
|
12118
12118
|
disablePortal: !0,
|
|
12119
12119
|
disableEnforceFocus: !0,
|
|
12120
12120
|
disableAutoFocus: !0,
|
|
12121
|
-
open:
|
|
12121
|
+
open: ie,
|
|
12122
12122
|
anchorEl: re,
|
|
12123
|
-
onClose:
|
|
12123
|
+
onClose: ae,
|
|
12124
12124
|
onMouseDown: (e) => {
|
|
12125
|
-
e.preventDefault(),
|
|
12125
|
+
e.preventDefault(), ae();
|
|
12126
12126
|
},
|
|
12127
12127
|
children: y
|
|
12128
12128
|
})] })
|
|
12129
12129
|
]
|
|
12130
|
-
}), x(
|
|
12130
|
+
}), x(C, {
|
|
12131
12131
|
dataTest: "richeditor-close-toolbar-button",
|
|
12132
12132
|
size: "large",
|
|
12133
12133
|
variant: "text",
|
|
@@ -12149,7 +12149,7 @@ var Ff = {
|
|
|
12149
12149
|
}
|
|
12150
12150
|
})), a(r || ""), document.querySelector("[data-test=\"link-input-field\"]")?.focus();
|
|
12151
12151
|
}
|
|
12152
|
-
}), [e, n]), x(
|
|
12152
|
+
}), [e, n]), x(ae, {
|
|
12153
12153
|
open: e,
|
|
12154
12154
|
dataTest: "link-modal-rte",
|
|
12155
12155
|
onClose: () => t(!1),
|
|
@@ -12162,7 +12162,7 @@ var Ff = {
|
|
|
12162
12162
|
className: Rf,
|
|
12163
12163
|
children: [x("div", {
|
|
12164
12164
|
className: "link-input-field",
|
|
12165
|
-
children: x(
|
|
12165
|
+
children: x(ce, {
|
|
12166
12166
|
autoFocus: !0,
|
|
12167
12167
|
multiline: !0,
|
|
12168
12168
|
className: "w-full",
|
|
@@ -12177,7 +12177,7 @@ var Ff = {
|
|
|
12177
12177
|
})
|
|
12178
12178
|
}), S("div", {
|
|
12179
12179
|
className: "flex gap-2 p-0 w-full justify-end",
|
|
12180
|
-
children: [x(
|
|
12180
|
+
children: [x(C, {
|
|
12181
12181
|
dataTest: "delete-customer-reject-button",
|
|
12182
12182
|
size: "medium",
|
|
12183
12183
|
variant: "outlined",
|
|
@@ -12185,7 +12185,7 @@ var Ff = {
|
|
|
12185
12185
|
t(!1), a("");
|
|
12186
12186
|
},
|
|
12187
12187
|
children: o ? "Avbryt" : "Cancel"
|
|
12188
|
-
}), x(
|
|
12188
|
+
}), x(C, {
|
|
12189
12189
|
dataTest: "delete-customer-confirm-button",
|
|
12190
12190
|
size: "medium",
|
|
12191
12191
|
variant: "contained",
|
|
@@ -27360,8 +27360,8 @@ function J_(e, t) {
|
|
|
27360
27360
|
if (t.inputType != "insertCompositionText" || !(e.state.selection instanceof H_)) return !1;
|
|
27361
27361
|
let { $from: n } = e.state.selection, r = n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);
|
|
27362
27362
|
if (!r) return !1;
|
|
27363
|
-
let i =
|
|
27364
|
-
for (let e = r.length - 1; e >= 0; e--) i =
|
|
27363
|
+
let i = E.empty;
|
|
27364
|
+
for (let e = r.length - 1; e >= 0; e--) i = E.from(r[e].createAndFill(null, i));
|
|
27365
27365
|
let a = e.state.tr.replace(n.pos, n.pos, new O(i, 0, 0));
|
|
27366
27366
|
return a.setSelection(A.near(a.doc.resolve(n.pos + 1))), e.dispatch(a), !1;
|
|
27367
27367
|
}
|
|
@@ -31245,7 +31245,7 @@ var pS = gl.create({
|
|
|
31245
31245
|
let { selection: a } = e, { nestedList: o, nestedListPos: s, insertPos: c, items: l } = i, u = e.tr;
|
|
31246
31246
|
u.delete(s, s + o.nodeSize);
|
|
31247
31247
|
let d = u.mapping.map(c);
|
|
31248
|
-
return u.insert(d,
|
|
31248
|
+
return u.insert(d, E.from(l)), u.setSelection(a.map(u.doc, u.mapping)), t && t(u), !0;
|
|
31249
31249
|
})(e.state, e.view.dispatch, t, n), yS = (e, t) => z.create({
|
|
31250
31250
|
name: `${e}BranchingDeleteKeymap`,
|
|
31251
31251
|
priority: 101,
|
|
@@ -32198,68 +32198,70 @@ var nC = Rl.create({
|
|
|
32198
32198
|
undoRedo: !1,
|
|
32199
32199
|
listKeymap: !1,
|
|
32200
32200
|
trailingNode: !1
|
|
32201
|
-
}), mC = ({ dataTest: e, attachmentsMenu: t, id: n, inputRef: r, className: i, editorClassName: a, disabled: o, readOnly: s, error: c, locale: l, title: d, placeholder: f, placeholderCallback: g, helperText: y, maxScrollableHeight: ee, toolbarDefaultVisible: ne, hideToolbar:
|
|
32202
|
-
let
|
|
32203
|
-
...
|
|
32201
|
+
}), mC = ({ dataTest: e, attachmentsMenu: t, id: n, inputRef: r, className: i, editorClassName: a, disabled: o, readOnly: s, error: c, locale: l, title: d, placeholder: f, placeholderCallback: g, helperText: y, maxScrollableHeight: ee, toolbarDefaultVisible: ne, hideToolbar: ce, noDefaultStyles: le, attachments: ue, replyModeComponent: de, enableImageUpload: fe, imageOptions: pe, onImageUpload: he, onImageUploadError: ge, enableYoutube: _e, youtubeOptions: w, ...T }) => {
|
|
32202
|
+
let ve = _(void 0), ye = _(null), be = _(null), E = _(null), xe = _(null), [Se, Ce] = v(!1), D = Wu({
|
|
32203
|
+
...T,
|
|
32204
32204
|
extensions: [
|
|
32205
32205
|
Ev.configure({ placeholder: g || f }),
|
|
32206
32206
|
pC,
|
|
32207
32207
|
Kv,
|
|
32208
|
-
...
|
|
32208
|
+
...fe ? [jv.configure({
|
|
32209
32209
|
inline: !0,
|
|
32210
|
-
allowBase64: !1
|
|
32210
|
+
allowBase64: !1,
|
|
32211
|
+
...pe
|
|
32211
32212
|
})] : [],
|
|
32212
32213
|
..._e ? [Rv.configure({
|
|
32213
32214
|
addPasteHandler: !0,
|
|
32214
32215
|
controls: !0,
|
|
32215
32216
|
nocookie: !0,
|
|
32216
32217
|
width: 640,
|
|
32217
|
-
height: 480
|
|
32218
|
+
height: 480,
|
|
32219
|
+
...w
|
|
32218
32220
|
})] : [],
|
|
32219
|
-
...
|
|
32221
|
+
...T.extensions || []
|
|
32220
32222
|
],
|
|
32221
32223
|
parseOptions: {
|
|
32222
32224
|
preserveWhitespace: !0,
|
|
32223
|
-
...
|
|
32225
|
+
...T.parseOptions
|
|
32224
32226
|
},
|
|
32225
|
-
shouldRerenderOnTransaction:
|
|
32226
|
-
immediatelyRender:
|
|
32227
|
-
editable:
|
|
32227
|
+
shouldRerenderOnTransaction: T.shouldRerenderOnTransaction || !1,
|
|
32228
|
+
immediatelyRender: T.immediatelyRender || !0,
|
|
32229
|
+
editable: T.editable || !o && !s,
|
|
32228
32230
|
onBlur: (e) => {
|
|
32229
|
-
|
|
32231
|
+
T.onBlur?.(e), Pe(!1);
|
|
32230
32232
|
},
|
|
32231
32233
|
onFocus: (e) => {
|
|
32232
|
-
|
|
32234
|
+
T.onFocus?.(e), Pe(!0);
|
|
32233
32235
|
},
|
|
32234
32236
|
onSelectionUpdate: (e) => {
|
|
32235
|
-
|
|
32237
|
+
T.onSelectionUpdate?.(e), ve.current = e.editor.state.selection.anchor, e.editor.commands.focus();
|
|
32236
32238
|
},
|
|
32237
32239
|
onUpdate: (e) => {
|
|
32238
|
-
|
|
32240
|
+
T.onUpdate?.(e), Oe();
|
|
32239
32241
|
}
|
|
32240
|
-
}, [
|
|
32242
|
+
}, [T.shouldRerenderOnTransaction, T.immediatelyRender]), we = _(null), [O, Te] = v(!1), Ee = u((async (e) => {
|
|
32241
32243
|
let t = e.target.files;
|
|
32242
|
-
if (!t || !
|
|
32243
|
-
if (!
|
|
32244
|
-
|
|
32244
|
+
if (!t || !D) return;
|
|
32245
|
+
if (!he) return console.error("RichInput: \"onImageUpload\" prop is required when \"enableImageUpload\" is true."), void (e.target.value = "");
|
|
32246
|
+
Te(!0);
|
|
32245
32247
|
let n = Array.from(t);
|
|
32246
32248
|
for (let e of n) try {
|
|
32247
|
-
let t = await
|
|
32248
|
-
|
|
32249
|
+
let t = await he(e);
|
|
32250
|
+
D.commands.setImage({
|
|
32249
32251
|
src: t,
|
|
32250
32252
|
alt: e.name
|
|
32251
32253
|
});
|
|
32252
32254
|
} catch (t) {
|
|
32253
32255
|
console.error("Failed to upload:", e.name, t), ge && ge(t instanceof Error ? t : Error(String(t)), e);
|
|
32254
32256
|
}
|
|
32255
|
-
|
|
32257
|
+
Te(!1), e.target.value = "";
|
|
32256
32258
|
}), [
|
|
32257
|
-
|
|
32258
|
-
|
|
32259
|
+
D,
|
|
32260
|
+
he,
|
|
32259
32261
|
ge
|
|
32260
|
-
]),
|
|
32261
|
-
if (!
|
|
32262
|
-
let e =
|
|
32262
|
+
]), De = u((() => {
|
|
32263
|
+
if (!D || !ye.current || !be.current) return;
|
|
32264
|
+
let e = D.view.dom, t = be.current, n = ye.current.parentElement ?? ye.current, r = Math.max(0, n.clientWidth - 80);
|
|
32263
32265
|
t.className = e.className;
|
|
32264
32266
|
let i = window.getComputedStyle(e);
|
|
32265
32267
|
Object.assign(t.style, {
|
|
@@ -32278,39 +32280,39 @@ var nC = Rl.create({
|
|
|
32278
32280
|
padding: i.padding
|
|
32279
32281
|
}), xe.current ??= (t.innerHTML = "<p><br /></p>", t.scrollHeight), t.innerHTML = e.innerHTML || "<p><br /></p>";
|
|
32280
32282
|
let a = t.scrollHeight > (xe.current ?? 0) + 2;
|
|
32281
|
-
|
|
32282
|
-
}), [
|
|
32283
|
-
|
|
32284
|
-
|
|
32283
|
+
Ce(((e) => e === a ? e : a));
|
|
32284
|
+
}), [D]), Oe = u((() => {
|
|
32285
|
+
E.current && cancelAnimationFrame(E.current), E.current = requestAnimationFrame((() => {
|
|
32286
|
+
E.current = requestAnimationFrame(De);
|
|
32285
32287
|
}));
|
|
32286
|
-
}), [
|
|
32288
|
+
}), [De]);
|
|
32287
32289
|
h((() => {
|
|
32288
|
-
if (!
|
|
32289
|
-
|
|
32290
|
+
if (!D) return;
|
|
32291
|
+
Oe();
|
|
32290
32292
|
let e = new ResizeObserver((() => {
|
|
32291
|
-
|
|
32293
|
+
Oe();
|
|
32292
32294
|
}));
|
|
32293
|
-
return
|
|
32294
|
-
e.disconnect(),
|
|
32295
|
+
return ye.current && e.observe(ye.current), () => {
|
|
32296
|
+
e.disconnect(), E.current && cancelAnimationFrame(E.current);
|
|
32295
32297
|
};
|
|
32296
|
-
}), [
|
|
32297
|
-
|
|
32298
|
-
}), [
|
|
32299
|
-
|
|
32298
|
+
}), [D, Oe]), p((() => {
|
|
32299
|
+
D && T.content !== D.getHTML() && D.commands.setContent(T.content || "", { emitUpdate: !1 });
|
|
32300
|
+
}), [T.content, D]), p((() => {
|
|
32301
|
+
D?.setEditable(T.editable || !o && !s);
|
|
32300
32302
|
}), [
|
|
32301
32303
|
s,
|
|
32302
32304
|
o,
|
|
32303
|
-
|
|
32304
|
-
|
|
32305
|
+
T.editable,
|
|
32306
|
+
D
|
|
32305
32307
|
]), p((() => {
|
|
32306
|
-
|
|
32307
|
-
}), [
|
|
32308
|
-
let [
|
|
32309
|
-
m(r, (() =>
|
|
32310
|
-
let [
|
|
32311
|
-
if (!
|
|
32312
|
-
let
|
|
32313
|
-
return S(
|
|
32308
|
+
ve.current !== void 0 && D?.commands.setTextSelection(ve.current);
|
|
32309
|
+
}), [T.content?.length, D]);
|
|
32310
|
+
let [ke, Ae] = v(ne), [je, Me] = v(!1);
|
|
32311
|
+
m(r, (() => D));
|
|
32312
|
+
let [Ne, Pe] = v(!1), [Fe, Ie] = v(!1), Le = !s && c;
|
|
32313
|
+
if (!D) return null;
|
|
32314
|
+
let Re = !ke || Se;
|
|
32315
|
+
return S(oe, {
|
|
32314
32316
|
className: i,
|
|
32315
32317
|
children: [
|
|
32316
32318
|
d && x("p", {
|
|
@@ -32318,12 +32320,12 @@ var nC = Rl.create({
|
|
|
32318
32320
|
children: d
|
|
32319
32321
|
}),
|
|
32320
32322
|
S("div", {
|
|
32321
|
-
ref:
|
|
32322
|
-
className:
|
|
32323
|
+
ref: ye,
|
|
32324
|
+
className: me(!le && "rte-wrapper", s === "outlined" && "readonly-outlined", s === "plain" && "readonly-plain", !s && Le && (Ne ? "error-focused-state" : "error-state"), !s && !Le && Ne && "focused-state"),
|
|
32323
32325
|
children: [
|
|
32324
|
-
|
|
32326
|
+
de,
|
|
32325
32327
|
x("div", {
|
|
32326
|
-
ref:
|
|
32328
|
+
ref: be,
|
|
32327
32329
|
"aria-hidden": !0,
|
|
32328
32330
|
className: "pointer-events-none invisible absolute left-[-99999px] top-0"
|
|
32329
32331
|
}),
|
|
@@ -32334,38 +32336,38 @@ var nC = Rl.create({
|
|
|
32334
32336
|
children: x(zu, {
|
|
32335
32337
|
"data-test": e,
|
|
32336
32338
|
id: n,
|
|
32337
|
-
className:
|
|
32338
|
-
editor:
|
|
32339
|
-
onClick: () =>
|
|
32339
|
+
className: me(!le && "core-ui-rte", !ce && !o && !s && !ke && "displace-text", !le && !o && !s && "edit-mode", a, ke && "displace-text"),
|
|
32340
|
+
editor: D,
|
|
32341
|
+
onClick: () => D?.chain().focus().run(),
|
|
32340
32342
|
style: { "--max-scrollable-height": `${ee || 100}px` }
|
|
32341
32343
|
})
|
|
32342
|
-
}), !
|
|
32343
|
-
className:
|
|
32344
|
-
children: [
|
|
32344
|
+
}), !ce && !o && !s && S("div", {
|
|
32345
|
+
className: me("flex shrink-0 items-center justify-end", Se ? "flex-col w-10" : "w-20"),
|
|
32346
|
+
children: [fe ? S(b, { children: [x("input", {
|
|
32345
32347
|
type: "file",
|
|
32346
|
-
ref:
|
|
32348
|
+
ref: we,
|
|
32347
32349
|
hidden: !0,
|
|
32348
32350
|
multiple: !0,
|
|
32349
32351
|
accept: "image/*",
|
|
32350
|
-
onChange:
|
|
32351
|
-
}), x(
|
|
32352
|
+
onChange: Ee
|
|
32353
|
+
}), x(C, {
|
|
32352
32354
|
dataTest: "rich-editor-image-upload",
|
|
32353
32355
|
size: "large",
|
|
32354
32356
|
variant: "textGray",
|
|
32355
|
-
onClick: () =>
|
|
32356
|
-
startIcon:
|
|
32357
|
+
onClick: () => we.current?.click(),
|
|
32358
|
+
startIcon: O ? x(re, {
|
|
32357
32359
|
width: 20,
|
|
32358
32360
|
height: 20
|
|
32359
32361
|
}) : x(Af, {
|
|
32360
32362
|
className: "cursor-pointer text-delta-700 h-6 w-6 min-w-6",
|
|
32361
32363
|
icon: "ic:baseline-attach-file"
|
|
32362
32364
|
})
|
|
32363
|
-
})] }) : t,
|
|
32365
|
+
})] }) : t, Re && x(C, {
|
|
32364
32366
|
dataTest: "richeditor-format-button",
|
|
32365
|
-
className:
|
|
32367
|
+
className: me(Se ? "order-last" : "order-first"),
|
|
32366
32368
|
size: "large",
|
|
32367
32369
|
variant: "textGray",
|
|
32368
|
-
onClick: () =>
|
|
32370
|
+
onClick: () => Ae(!ke),
|
|
32369
32371
|
startIcon: x(Af, {
|
|
32370
32372
|
className: "cursor-pointer text-delta-700 h-6 w-6 min-w-6",
|
|
32371
32373
|
icon: "material-symbols:format-color-text"
|
|
@@ -32373,46 +32375,46 @@ var nC = Rl.create({
|
|
|
32373
32375
|
})]
|
|
32374
32376
|
})]
|
|
32375
32377
|
}),
|
|
32376
|
-
!!
|
|
32378
|
+
!!ue?.length && x("div", {
|
|
32377
32379
|
className: "p-2 flex flex-wrap items-center gap-2",
|
|
32378
|
-
children:
|
|
32380
|
+
children: ue.map(((e) => x(ie, { ...e })))
|
|
32379
32381
|
}),
|
|
32380
|
-
!
|
|
32381
|
-
editor:
|
|
32382
|
-
onClose: () =>
|
|
32382
|
+
!ce && !o && !s && ke && x(Lf, {
|
|
32383
|
+
editor: D,
|
|
32384
|
+
onClose: () => Ae(!1),
|
|
32383
32385
|
error: c,
|
|
32384
|
-
focused:
|
|
32385
|
-
openLinkDialog: () =>
|
|
32386
|
-
openEmojiPicker: () =>
|
|
32386
|
+
focused: Ne,
|
|
32387
|
+
openLinkDialog: () => Me(!0),
|
|
32388
|
+
openEmojiPicker: () => Ie(!0),
|
|
32387
32389
|
locale: l
|
|
32388
32390
|
})
|
|
32389
32391
|
]
|
|
32390
32392
|
}),
|
|
32391
|
-
y && S(
|
|
32392
|
-
className:
|
|
32393
|
-
children: [
|
|
32393
|
+
y && S(se, {
|
|
32394
|
+
className: me("m-0 flex items-center gap-1 pt-1 text-base min-h-6", Le ? "text-error-500" : "text-delta-600"),
|
|
32395
|
+
children: [Le && x(te, {
|
|
32394
32396
|
width: 20,
|
|
32395
32397
|
height: 20
|
|
32396
32398
|
}), y]
|
|
32397
32399
|
}),
|
|
32398
32400
|
x(zf, {
|
|
32399
|
-
open:
|
|
32400
|
-
setOpen:
|
|
32401
|
-
editor:
|
|
32401
|
+
open: je,
|
|
32402
|
+
setOpen: Me,
|
|
32403
|
+
editor: D,
|
|
32402
32404
|
locale: l
|
|
32403
32405
|
}),
|
|
32404
|
-
x(
|
|
32406
|
+
x(ae, {
|
|
32405
32407
|
dataTest: "emoji-picker-dialog",
|
|
32406
|
-
open:
|
|
32407
|
-
onClose: () =>
|
|
32408
|
+
open: Fe,
|
|
32409
|
+
onClose: () => Ie(!1),
|
|
32408
32410
|
dialogTitle: x("span", {
|
|
32409
32411
|
className: "pb-4",
|
|
32410
32412
|
children: "Emoji"
|
|
32411
32413
|
}),
|
|
32412
32414
|
children: x(z_, {
|
|
32413
|
-
open:
|
|
32415
|
+
open: Fe,
|
|
32414
32416
|
onEmojiClick: ({ emoji: e }) => {
|
|
32415
|
-
|
|
32417
|
+
D?.chain().focus().insertContent(e).run(), Ie(!1);
|
|
32416
32418
|
},
|
|
32417
32419
|
allowExpandReactions: !1,
|
|
32418
32420
|
autoFocusSearch: !1,
|