@arkitektbedriftene/fe-lib 0.3.6 → 0.3.7
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/rich-text.es.js +1091 -1313
- package/package.json +10 -10
package/dist/rich-text.es.js
CHANGED
|
@@ -1,1192 +1,970 @@
|
|
|
1
|
-
import { createHeadlessEditor as
|
|
2
|
-
import { $generateHtmlFromNodes as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { AutoLinkNode as
|
|
6
|
-
import { ListNode as
|
|
7
|
-
import
|
|
8
|
-
import { TableNode as
|
|
9
|
-
import { j } from "./jsx-runtime-d0aa4c5b.js";
|
|
10
|
-
import { c as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
const
|
|
14
|
-
text:
|
|
15
|
-
maxChars:
|
|
16
|
-
maxLines:
|
|
1
|
+
import { createHeadlessEditor as je } from "@lexical/headless";
|
|
2
|
+
import { $generateHtmlFromNodes as Ve } from "@lexical/html";
|
|
3
|
+
import A, { $getRoot as De, ParagraphNode as ze, $createParagraphNode as He, $createTextNode as Ke } from "lexical";
|
|
4
|
+
import qe, { trimTextContentFromAnchor as We } from "@lexical/selection";
|
|
5
|
+
import { AutoLinkNode as Ge, LinkNode as Je } from "@lexical/link";
|
|
6
|
+
import { ListNode as Ye, ListItemNode as Qe } from "@lexical/list";
|
|
7
|
+
import Oe, { HeadingNode as Xe, QuoteNode as Ze } from "@lexical/rich-text";
|
|
8
|
+
import { TableNode as et, TableRowNode as tt, TableCellNode as rt } from "@lexical/table";
|
|
9
|
+
import { j as O } from "./jsx-runtime-d0aa4c5b.js";
|
|
10
|
+
import { c as U, s as Fe, u as nt, B as ke, S as ot } from "./Popover-e50ca73e.js";
|
|
11
|
+
import q, { createContext as it, useState as st, useRef as lt, useCallback as ae } from "react";
|
|
12
|
+
import Ae from "react-dom";
|
|
13
|
+
const at = ({
|
|
14
|
+
text: l,
|
|
15
|
+
maxChars: s,
|
|
16
|
+
maxLines: g
|
|
17
17
|
}) => {
|
|
18
|
-
if (
|
|
18
|
+
if (l.length === 0)
|
|
19
19
|
return 0;
|
|
20
|
-
const
|
|
21
|
-
if (!
|
|
22
|
-
return
|
|
23
|
-
let
|
|
24
|
-
for (;
|
|
25
|
-
|
|
26
|
-
` &&
|
|
27
|
-
return
|
|
28
|
-
},
|
|
29
|
-
editor:
|
|
30
|
-
maxChars:
|
|
31
|
-
maxLines:
|
|
20
|
+
const C = typeof g == "number", d = typeof s == "number";
|
|
21
|
+
if (!C && !d)
|
|
22
|
+
return l.length;
|
|
23
|
+
let p = 0, e = 0;
|
|
24
|
+
for (; e < l.length && (!C || p < g) && (!d || e < s); )
|
|
25
|
+
l[e] === `
|
|
26
|
+
` && p++, e++;
|
|
27
|
+
return l.slice(0, e).length;
|
|
28
|
+
}, ct = ({
|
|
29
|
+
editor: l,
|
|
30
|
+
maxChars: s,
|
|
31
|
+
maxLines: g
|
|
32
32
|
}) => {
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
return
|
|
37
|
-
},
|
|
38
|
-
let
|
|
39
|
-
const
|
|
40
|
-
nodes:
|
|
33
|
+
const C = De(), d = C.getTextContent(), p = at({ text: d, maxChars: s, maxLines: g }), e = d.length - p, n = C.select().anchor;
|
|
34
|
+
We(l, n, e);
|
|
35
|
+
const o = C.getLastChild();
|
|
36
|
+
return o instanceof ze && o.getChildrenSize() === 0 && o.remove(), e;
|
|
37
|
+
}, ut = (l) => l[0] === "{", sr = (l, s, g) => {
|
|
38
|
+
let C = 0;
|
|
39
|
+
const d = je({
|
|
40
|
+
nodes: s,
|
|
41
41
|
editable: !1
|
|
42
42
|
});
|
|
43
|
-
if (
|
|
43
|
+
if (l)
|
|
44
44
|
try {
|
|
45
|
-
if (typeof
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
45
|
+
if (typeof l == "string" && !ut(l))
|
|
46
|
+
d.update(() => {
|
|
47
|
+
const e = De(), t = He();
|
|
48
|
+
t.append(Ke(l.trim())), e.append(t);
|
|
49
49
|
});
|
|
50
50
|
else {
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
editor:
|
|
54
|
-
maxLines:
|
|
51
|
+
const e = d.parseEditorState(l, () => {
|
|
52
|
+
C = ct({
|
|
53
|
+
editor: d,
|
|
54
|
+
maxLines: g == null ? void 0 : g.maxLines
|
|
55
55
|
});
|
|
56
56
|
});
|
|
57
|
-
|
|
57
|
+
e.isEmpty() || d.setEditorState(e);
|
|
58
58
|
}
|
|
59
|
-
} catch (
|
|
60
|
-
console.error(
|
|
59
|
+
} catch (e) {
|
|
60
|
+
console.error(e);
|
|
61
61
|
}
|
|
62
|
-
let
|
|
63
|
-
return
|
|
64
|
-
|
|
65
|
-
}), { html:
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
62
|
+
let p = "";
|
|
63
|
+
return d.update(() => {
|
|
64
|
+
p = Ve(d);
|
|
65
|
+
}), { html: p, trimCount: C };
|
|
66
|
+
}, lr = [
|
|
67
|
+
Xe,
|
|
68
|
+
Ze,
|
|
69
|
+
Ye,
|
|
70
|
+
Qe,
|
|
71
|
+
Ge,
|
|
72
|
+
Je,
|
|
73
|
+
et,
|
|
74
|
+
tt,
|
|
75
|
+
rt
|
|
76
76
|
];
|
|
77
|
-
var
|
|
78
|
-
function
|
|
79
|
-
if (
|
|
80
|
-
return
|
|
81
|
-
|
|
82
|
-
var
|
|
83
|
-
const
|
|
84
|
-
function
|
|
85
|
-
let
|
|
86
|
-
|
|
87
|
-
function
|
|
88
|
-
return
|
|
77
|
+
var z = {}, B = {}, ce;
|
|
78
|
+
function dt() {
|
|
79
|
+
if (ce)
|
|
80
|
+
return B;
|
|
81
|
+
ce = 1;
|
|
82
|
+
var l = q;
|
|
83
|
+
const s = /* @__PURE__ */ l.createContext(null);
|
|
84
|
+
function g(d, p) {
|
|
85
|
+
let e = null;
|
|
86
|
+
d != null && (e = d[1]);
|
|
87
|
+
function t() {
|
|
88
|
+
return p ?? (e != null ? e.getTheme() : null);
|
|
89
89
|
}
|
|
90
90
|
return {
|
|
91
|
-
getTheme:
|
|
91
|
+
getTheme: t
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
const
|
|
96
|
-
if (
|
|
94
|
+
function C() {
|
|
95
|
+
const d = l.useContext(s);
|
|
96
|
+
if (d == null)
|
|
97
97
|
throw Error("LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext");
|
|
98
|
-
return
|
|
98
|
+
return d;
|
|
99
99
|
}
|
|
100
|
-
return
|
|
100
|
+
return B.LexicalComposerContext = s, B.createLexicalComposerContext = g, B.useLexicalComposerContext = C, B;
|
|
101
101
|
}
|
|
102
|
-
var
|
|
103
|
-
function
|
|
104
|
-
if (
|
|
105
|
-
return
|
|
106
|
-
|
|
107
|
-
var
|
|
108
|
-
function
|
|
109
|
-
let
|
|
110
|
-
|
|
111
|
-
for (let
|
|
112
|
-
|
|
113
|
-
throw Error(`Minified Lexical error #${
|
|
114
|
-
}
|
|
115
|
-
let
|
|
116
|
-
return
|
|
117
|
-
let
|
|
118
|
-
return
|
|
119
|
-
return
|
|
102
|
+
var I = {}, ue;
|
|
103
|
+
function ft() {
|
|
104
|
+
if (ue)
|
|
105
|
+
return I;
|
|
106
|
+
ue = 1;
|
|
107
|
+
var l = q;
|
|
108
|
+
function s(C) {
|
|
109
|
+
let d = new URLSearchParams();
|
|
110
|
+
d.append("code", C);
|
|
111
|
+
for (let p = 1; p < arguments.length; p++)
|
|
112
|
+
d.append("v", arguments[p]);
|
|
113
|
+
throw Error(`Minified Lexical error #${C}; visit https://lexical.dev/docs/error?${d} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
114
|
+
}
|
|
115
|
+
let g = l.createContext(null);
|
|
116
|
+
return I.LexicalComposerContext = g, I.createLexicalComposerContext = function(C, d) {
|
|
117
|
+
let p = null;
|
|
118
|
+
return C != null && (p = C[1]), { getTheme: function() {
|
|
119
|
+
return d ?? (p != null ? p.getTheme() : null);
|
|
120
120
|
} };
|
|
121
|
-
},
|
|
122
|
-
let
|
|
123
|
-
return
|
|
124
|
-
},
|
|
121
|
+
}, I.useLexicalComposerContext = function() {
|
|
122
|
+
let C = l.useContext(g);
|
|
123
|
+
return C == null && s(8), C;
|
|
124
|
+
}, I;
|
|
125
125
|
}
|
|
126
|
-
var
|
|
127
|
-
function
|
|
128
|
-
return
|
|
126
|
+
var H, de;
|
|
127
|
+
function M() {
|
|
128
|
+
return de || (de = 1, H = process.env.NODE_ENV === "development" ? dt() : ft()), H;
|
|
129
129
|
}
|
|
130
|
-
var
|
|
131
|
-
function
|
|
132
|
-
if (
|
|
133
|
-
return
|
|
134
|
-
|
|
135
|
-
var
|
|
136
|
-
const
|
|
137
|
-
var
|
|
138
|
-
const
|
|
130
|
+
var fe;
|
|
131
|
+
function pt() {
|
|
132
|
+
if (fe)
|
|
133
|
+
return z;
|
|
134
|
+
fe = 1;
|
|
135
|
+
var l = M(), s = A, g = q;
|
|
136
|
+
const C = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
|
|
137
|
+
var p = C ? g.useLayoutEffect : g.useEffect;
|
|
138
|
+
const e = {
|
|
139
139
|
tag: "history-merge"
|
|
140
140
|
};
|
|
141
|
-
function
|
|
142
|
-
initialConfig:
|
|
143
|
-
children:
|
|
141
|
+
function t({
|
|
142
|
+
initialConfig: o,
|
|
143
|
+
children: r
|
|
144
144
|
}) {
|
|
145
|
-
const
|
|
145
|
+
const i = g.useMemo(
|
|
146
146
|
() => {
|
|
147
147
|
const {
|
|
148
|
-
theme:
|
|
149
|
-
namespace:
|
|
150
|
-
editor__DEPRECATED:
|
|
151
|
-
nodes:
|
|
148
|
+
theme: u,
|
|
149
|
+
namespace: f,
|
|
150
|
+
editor__DEPRECATED: a,
|
|
151
|
+
nodes: h,
|
|
152
152
|
onError: v,
|
|
153
|
-
editorState:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
onError: (R) => v(R, w),
|
|
164
|
-
theme: s
|
|
153
|
+
editorState: E
|
|
154
|
+
} = o, $ = l.createLexicalComposerContext(null, u);
|
|
155
|
+
let c = a || null;
|
|
156
|
+
if (c === null) {
|
|
157
|
+
const m = s.createEditor({
|
|
158
|
+
editable: o.editable,
|
|
159
|
+
namespace: f,
|
|
160
|
+
nodes: h,
|
|
161
|
+
onError: (x) => v(x, m),
|
|
162
|
+
theme: u
|
|
165
163
|
});
|
|
166
|
-
|
|
164
|
+
n(m, E), c = m;
|
|
167
165
|
}
|
|
168
|
-
return [
|
|
166
|
+
return [c, $];
|
|
169
167
|
},
|
|
170
168
|
// We only do this for init
|
|
171
169
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
172
170
|
[]
|
|
173
171
|
);
|
|
174
|
-
return
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
}, []), /* @__PURE__ */
|
|
178
|
-
value:
|
|
179
|
-
},
|
|
180
|
-
}
|
|
181
|
-
function
|
|
182
|
-
if (
|
|
183
|
-
if (
|
|
184
|
-
|
|
185
|
-
const
|
|
186
|
-
if (
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
const
|
|
190
|
-
(
|
|
172
|
+
return p(() => {
|
|
173
|
+
const u = o.editable, [f] = i;
|
|
174
|
+
f.setEditable(u !== void 0 ? u : !0);
|
|
175
|
+
}, []), /* @__PURE__ */ g.createElement(l.LexicalComposerContext.Provider, {
|
|
176
|
+
value: i
|
|
177
|
+
}, r);
|
|
178
|
+
}
|
|
179
|
+
function n(o, r) {
|
|
180
|
+
if (r !== null) {
|
|
181
|
+
if (r === void 0)
|
|
182
|
+
o.update(() => {
|
|
183
|
+
const i = s.$getRoot();
|
|
184
|
+
if (i.isEmpty()) {
|
|
185
|
+
const u = s.$createParagraphNode();
|
|
186
|
+
i.append(u);
|
|
187
|
+
const f = C ? document.activeElement : null;
|
|
188
|
+
(s.$getSelection() !== null || f !== null && f === o.getRootElement()) && u.select();
|
|
191
189
|
}
|
|
192
|
-
},
|
|
193
|
-
else if (
|
|
194
|
-
switch (typeof
|
|
190
|
+
}, e);
|
|
191
|
+
else if (r !== null)
|
|
192
|
+
switch (typeof r) {
|
|
195
193
|
case "string": {
|
|
196
|
-
const
|
|
197
|
-
|
|
194
|
+
const i = o.parseEditorState(r);
|
|
195
|
+
o.setEditorState(i, e);
|
|
198
196
|
break;
|
|
199
197
|
}
|
|
200
198
|
case "object": {
|
|
201
|
-
|
|
199
|
+
o.setEditorState(r, e);
|
|
202
200
|
break;
|
|
203
201
|
}
|
|
204
202
|
case "function": {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
},
|
|
203
|
+
o.update(() => {
|
|
204
|
+
s.$getRoot().isEmpty() && r(o);
|
|
205
|
+
}, e);
|
|
208
206
|
break;
|
|
209
207
|
}
|
|
210
208
|
}
|
|
211
209
|
}
|
|
212
210
|
}
|
|
213
|
-
return
|
|
211
|
+
return z.LexicalComposer = t, z;
|
|
214
212
|
}
|
|
215
|
-
var
|
|
216
|
-
function
|
|
217
|
-
if (
|
|
218
|
-
return
|
|
219
|
-
|
|
220
|
-
var
|
|
221
|
-
let
|
|
222
|
-
var
|
|
223
|
-
let
|
|
224
|
-
function
|
|
225
|
-
if (
|
|
226
|
-
if (
|
|
227
|
-
|
|
228
|
-
var
|
|
229
|
-
if (
|
|
230
|
-
let
|
|
231
|
-
|
|
213
|
+
var K = {}, pe;
|
|
214
|
+
function mt() {
|
|
215
|
+
if (pe)
|
|
216
|
+
return K;
|
|
217
|
+
pe = 1;
|
|
218
|
+
var l = M(), s = A, g = q;
|
|
219
|
+
let C = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
|
|
220
|
+
var d = C ? g.useLayoutEffect : g.useEffect;
|
|
221
|
+
let p = { tag: "history-merge" };
|
|
222
|
+
function e(t, n) {
|
|
223
|
+
if (n !== null) {
|
|
224
|
+
if (n === void 0)
|
|
225
|
+
t.update(() => {
|
|
226
|
+
var o = s.$getRoot();
|
|
227
|
+
if (o.isEmpty()) {
|
|
228
|
+
let r = s.$createParagraphNode();
|
|
229
|
+
o.append(r), o = C ? document.activeElement : null, (s.$getSelection() !== null || o !== null && o === t.getRootElement()) && r.select();
|
|
232
230
|
}
|
|
233
|
-
},
|
|
234
|
-
else if (
|
|
235
|
-
switch (typeof
|
|
231
|
+
}, p);
|
|
232
|
+
else if (n !== null)
|
|
233
|
+
switch (typeof n) {
|
|
236
234
|
case "string":
|
|
237
|
-
let
|
|
238
|
-
|
|
235
|
+
let o = t.parseEditorState(n);
|
|
236
|
+
t.setEditorState(o, p);
|
|
239
237
|
break;
|
|
240
238
|
case "object":
|
|
241
|
-
|
|
239
|
+
t.setEditorState(n, p);
|
|
242
240
|
break;
|
|
243
241
|
case "function":
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
},
|
|
242
|
+
t.update(() => {
|
|
243
|
+
s.$getRoot().isEmpty() && n(t);
|
|
244
|
+
}, p);
|
|
247
245
|
}
|
|
248
246
|
}
|
|
249
247
|
}
|
|
250
|
-
return
|
|
251
|
-
let
|
|
252
|
-
const { theme:
|
|
253
|
-
let
|
|
254
|
-
if (
|
|
255
|
-
const
|
|
256
|
-
|
|
248
|
+
return K.LexicalComposer = function({ initialConfig: t, children: n }) {
|
|
249
|
+
let o = g.useMemo(() => {
|
|
250
|
+
const { theme: r, namespace: i, editor__DEPRECATED: u, nodes: f, onError: a, editorState: h } = t, v = l.createLexicalComposerContext(null, r);
|
|
251
|
+
let E = u || null;
|
|
252
|
+
if (E === null) {
|
|
253
|
+
const $ = s.createEditor({ editable: t.editable, namespace: i, nodes: f, onError: (c) => a(c, $), theme: r });
|
|
254
|
+
e($, h), E = $;
|
|
257
255
|
}
|
|
258
|
-
return [
|
|
256
|
+
return [E, v];
|
|
259
257
|
}, []);
|
|
260
|
-
return
|
|
261
|
-
let
|
|
262
|
-
|
|
263
|
-
}, []),
|
|
264
|
-
|
|
265
|
-
{ value: t },
|
|
266
|
-
e
|
|
267
|
-
);
|
|
268
|
-
}, fe;
|
|
258
|
+
return d(() => {
|
|
259
|
+
let r = t.editable, [i] = o;
|
|
260
|
+
i.setEditable(r !== void 0 ? r : !0);
|
|
261
|
+
}, []), g.createElement(l.LexicalComposerContext.Provider, { value: o }, n);
|
|
262
|
+
}, K;
|
|
269
263
|
}
|
|
270
|
-
const
|
|
271
|
-
var
|
|
272
|
-
function
|
|
273
|
-
if (
|
|
274
|
-
return
|
|
275
|
-
|
|
276
|
-
var
|
|
277
|
-
function
|
|
278
|
-
const [
|
|
279
|
-
return
|
|
264
|
+
const gt = process.env.NODE_ENV === "development" ? pt() : mt();
|
|
265
|
+
var xt = gt, W = {}, G, me;
|
|
266
|
+
function ht() {
|
|
267
|
+
if (me)
|
|
268
|
+
return G;
|
|
269
|
+
me = 1;
|
|
270
|
+
var l = M(), s = q, d = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? s.useLayoutEffect : s.useEffect;
|
|
271
|
+
function p(n) {
|
|
272
|
+
const [o] = l.useLexicalComposerContext(), r = s.useMemo(() => n(o), [o, n]), i = s.useRef(r.initialValueFn()), [u, f] = s.useState(i.current);
|
|
273
|
+
return d(() => {
|
|
280
274
|
const {
|
|
281
|
-
initialValueFn:
|
|
282
|
-
subscribe:
|
|
283
|
-
} =
|
|
284
|
-
return
|
|
285
|
-
|
|
275
|
+
initialValueFn: a,
|
|
276
|
+
subscribe: h
|
|
277
|
+
} = r, v = a();
|
|
278
|
+
return i.current !== v && (i.current = v, f(v)), h((E) => {
|
|
279
|
+
i.current = E, f(E);
|
|
286
280
|
});
|
|
287
|
-
}, [
|
|
281
|
+
}, [r, n]), u;
|
|
288
282
|
}
|
|
289
|
-
function
|
|
283
|
+
function e(n) {
|
|
290
284
|
return {
|
|
291
|
-
initialValueFn: () =>
|
|
292
|
-
subscribe: (
|
|
285
|
+
initialValueFn: () => n.isEditable(),
|
|
286
|
+
subscribe: (o) => n.registerEditableListener(o)
|
|
293
287
|
};
|
|
294
288
|
}
|
|
295
|
-
function
|
|
296
|
-
return
|
|
289
|
+
function t() {
|
|
290
|
+
return p(e);
|
|
297
291
|
}
|
|
298
|
-
return
|
|
292
|
+
return G = t, G;
|
|
299
293
|
}
|
|
300
|
-
var
|
|
301
|
-
function
|
|
302
|
-
if (
|
|
303
|
-
return
|
|
304
|
-
|
|
305
|
-
var
|
|
306
|
-
function
|
|
307
|
-
let [
|
|
308
|
-
return
|
|
309
|
-
let { initialValueFn:
|
|
310
|
-
return
|
|
311
|
-
|
|
294
|
+
var J, ge;
|
|
295
|
+
function Et() {
|
|
296
|
+
if (ge)
|
|
297
|
+
return J;
|
|
298
|
+
ge = 1;
|
|
299
|
+
var l = M(), s = q, g = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? s.useLayoutEffect : s.useEffect;
|
|
300
|
+
function C(p) {
|
|
301
|
+
let [e] = l.useLexicalComposerContext(), t = s.useMemo(() => p(e), [e, p]), n = s.useRef(t.initialValueFn()), [o, r] = s.useState(n.current);
|
|
302
|
+
return g(() => {
|
|
303
|
+
let { initialValueFn: i, subscribe: u } = t, f = i();
|
|
304
|
+
return n.current !== f && (n.current = f, r(f)), u((a) => {
|
|
305
|
+
n.current = a, r(a);
|
|
312
306
|
});
|
|
313
|
-
}, [
|
|
307
|
+
}, [t, p]), o;
|
|
314
308
|
}
|
|
315
|
-
function p
|
|
316
|
-
return { initialValueFn: () =>
|
|
309
|
+
function d(p) {
|
|
310
|
+
return { initialValueFn: () => p.isEditable(), subscribe: (e) => p.registerEditableListener(e) };
|
|
317
311
|
}
|
|
318
|
-
return
|
|
319
|
-
return
|
|
320
|
-
},
|
|
312
|
+
return J = function() {
|
|
313
|
+
return C(d);
|
|
314
|
+
}, J;
|
|
321
315
|
}
|
|
322
|
-
var
|
|
323
|
-
function
|
|
324
|
-
return
|
|
316
|
+
var Y, xe;
|
|
317
|
+
function Me() {
|
|
318
|
+
return xe || (xe = 1, Y = process.env.NODE_ENV === "development" ? ht() : Et()), Y;
|
|
325
319
|
}
|
|
326
|
-
var
|
|
327
|
-
function
|
|
328
|
-
if (
|
|
329
|
-
return
|
|
330
|
-
|
|
331
|
-
var
|
|
332
|
-
function
|
|
333
|
-
let
|
|
320
|
+
var F = {}, he;
|
|
321
|
+
function vt() {
|
|
322
|
+
if (he)
|
|
323
|
+
return F;
|
|
324
|
+
he = 1;
|
|
325
|
+
var l = A;
|
|
326
|
+
function s(n, o) {
|
|
327
|
+
let r = n.getFirstChild(), i = 0;
|
|
334
328
|
e:
|
|
335
|
-
for (;
|
|
336
|
-
if (
|
|
337
|
-
const
|
|
338
|
-
if (
|
|
339
|
-
|
|
329
|
+
for (; r !== null; ) {
|
|
330
|
+
if (l.$isElementNode(r)) {
|
|
331
|
+
const a = r.getFirstChild();
|
|
332
|
+
if (a !== null) {
|
|
333
|
+
r = a;
|
|
340
334
|
continue;
|
|
341
335
|
}
|
|
342
|
-
} else if (
|
|
343
|
-
const
|
|
344
|
-
if (
|
|
336
|
+
} else if (l.$isTextNode(r)) {
|
|
337
|
+
const a = r.getTextContentSize();
|
|
338
|
+
if (i + a > o)
|
|
345
339
|
return {
|
|
346
|
-
node:
|
|
347
|
-
offset:
|
|
340
|
+
node: r,
|
|
341
|
+
offset: o - i
|
|
348
342
|
};
|
|
349
|
-
|
|
343
|
+
i += a;
|
|
350
344
|
}
|
|
351
|
-
const
|
|
352
|
-
if (
|
|
353
|
-
|
|
345
|
+
const u = r.getNextSibling();
|
|
346
|
+
if (u !== null) {
|
|
347
|
+
r = u;
|
|
354
348
|
continue;
|
|
355
349
|
}
|
|
356
|
-
let
|
|
357
|
-
for (;
|
|
358
|
-
const
|
|
359
|
-
if (
|
|
360
|
-
|
|
350
|
+
let f = r.getParent();
|
|
351
|
+
for (; f !== null; ) {
|
|
352
|
+
const a = f.getNextSibling();
|
|
353
|
+
if (a !== null) {
|
|
354
|
+
r = a;
|
|
361
355
|
continue e;
|
|
362
356
|
}
|
|
363
|
-
|
|
357
|
+
f = f.getParent();
|
|
364
358
|
}
|
|
365
359
|
break;
|
|
366
360
|
}
|
|
367
361
|
return null;
|
|
368
362
|
}
|
|
369
|
-
function
|
|
370
|
-
if (
|
|
363
|
+
function g(n, o = !0) {
|
|
364
|
+
if (n)
|
|
371
365
|
return !1;
|
|
372
|
-
let
|
|
373
|
-
return
|
|
366
|
+
let r = d();
|
|
367
|
+
return o && (r = r.trim()), r === "";
|
|
374
368
|
}
|
|
375
|
-
function
|
|
376
|
-
return () =>
|
|
369
|
+
function C(n, o) {
|
|
370
|
+
return () => g(n, o);
|
|
377
371
|
}
|
|
378
|
-
function
|
|
379
|
-
return
|
|
372
|
+
function d() {
|
|
373
|
+
return l.$getRoot().getTextContent();
|
|
380
374
|
}
|
|
381
|
-
function
|
|
382
|
-
if (!
|
|
375
|
+
function p(n) {
|
|
376
|
+
if (!g(n, !1))
|
|
383
377
|
return !1;
|
|
384
|
-
const
|
|
385
|
-
if (
|
|
378
|
+
const r = l.$getRoot().getChildren(), i = r.length;
|
|
379
|
+
if (i > 1)
|
|
386
380
|
return !1;
|
|
387
|
-
for (let
|
|
388
|
-
const
|
|
389
|
-
if (
|
|
381
|
+
for (let u = 0; u < i; u++) {
|
|
382
|
+
const f = r[u];
|
|
383
|
+
if (l.$isDecoratorNode(f))
|
|
390
384
|
return !1;
|
|
391
|
-
if (
|
|
392
|
-
if (!
|
|
385
|
+
if (l.$isElementNode(f)) {
|
|
386
|
+
if (!l.$isParagraphNode(f) || f.__indent !== 0)
|
|
393
387
|
return !1;
|
|
394
|
-
const
|
|
395
|
-
for (let v = 0; v <
|
|
396
|
-
const
|
|
397
|
-
if (!
|
|
388
|
+
const a = f.getChildren(), h = a.length;
|
|
389
|
+
for (let v = 0; v < h; v++) {
|
|
390
|
+
const E = a[u];
|
|
391
|
+
if (!l.$isTextNode(E))
|
|
398
392
|
return !1;
|
|
399
393
|
}
|
|
400
394
|
}
|
|
401
395
|
}
|
|
402
396
|
return !0;
|
|
403
397
|
}
|
|
404
|
-
function
|
|
405
|
-
return () =>
|
|
398
|
+
function e(n) {
|
|
399
|
+
return () => p(n);
|
|
406
400
|
}
|
|
407
|
-
function
|
|
408
|
-
const
|
|
409
|
-
const
|
|
410
|
-
|
|
411
|
-
},
|
|
412
|
-
if (!
|
|
401
|
+
function t(n, o, r, i) {
|
|
402
|
+
const u = (c) => c instanceof r, f = (c) => {
|
|
403
|
+
const m = l.$createTextNode(c.getTextContent());
|
|
404
|
+
m.setFormat(c.getFormat()), c.replace(m);
|
|
405
|
+
}, a = (c) => c.getLatest().__mode, h = (c) => {
|
|
406
|
+
if (!c.isSimpleText())
|
|
413
407
|
return;
|
|
414
|
-
const
|
|
415
|
-
let
|
|
416
|
-
if (
|
|
417
|
-
const
|
|
418
|
-
if (
|
|
419
|
-
if (
|
|
420
|
-
|
|
408
|
+
const m = c.getPreviousSibling();
|
|
409
|
+
let x = c.getTextContent(), y = c, T;
|
|
410
|
+
if (l.$isTextNode(m)) {
|
|
411
|
+
const L = m.getTextContent(), w = L + x, b = o(w);
|
|
412
|
+
if (u(m))
|
|
413
|
+
if (b === null || a(m) !== 0) {
|
|
414
|
+
f(m);
|
|
421
415
|
return;
|
|
422
416
|
} else {
|
|
423
|
-
const
|
|
424
|
-
if (
|
|
425
|
-
const
|
|
426
|
-
if (
|
|
427
|
-
|
|
417
|
+
const N = b.end - L.length;
|
|
418
|
+
if (N > 0) {
|
|
419
|
+
const S = x.slice(0, N), P = L + S;
|
|
420
|
+
if (m.select(), m.setTextContent(P), N === x.length)
|
|
421
|
+
c.remove();
|
|
428
422
|
else {
|
|
429
|
-
const
|
|
430
|
-
|
|
423
|
+
const D = x.slice(N);
|
|
424
|
+
c.setTextContent(D);
|
|
431
425
|
}
|
|
432
426
|
return;
|
|
433
427
|
}
|
|
434
428
|
}
|
|
435
|
-
else if (
|
|
429
|
+
else if (b === null || b.start < L.length)
|
|
436
430
|
return;
|
|
437
431
|
}
|
|
438
432
|
for (; ; ) {
|
|
439
|
-
|
|
440
|
-
let
|
|
441
|
-
if (
|
|
442
|
-
const
|
|
443
|
-
if (
|
|
444
|
-
|
|
445
|
-
const
|
|
446
|
-
if (
|
|
447
|
-
|
|
433
|
+
T = o(x);
|
|
434
|
+
let L = T === null ? "" : x.slice(T.end);
|
|
435
|
+
if (x = L, L === "") {
|
|
436
|
+
const N = y.getNextSibling();
|
|
437
|
+
if (l.$isTextNode(N)) {
|
|
438
|
+
L = y.getTextContent() + N.getTextContent();
|
|
439
|
+
const S = o(L);
|
|
440
|
+
if (S === null) {
|
|
441
|
+
u(N) ? f(N) : N.markDirty();
|
|
448
442
|
return;
|
|
449
|
-
} else if (
|
|
443
|
+
} else if (S.start !== 0)
|
|
450
444
|
return;
|
|
451
445
|
}
|
|
452
446
|
} else {
|
|
453
|
-
const
|
|
454
|
-
if (
|
|
447
|
+
const N = o(L);
|
|
448
|
+
if (N !== null && N.start === 0)
|
|
455
449
|
return;
|
|
456
450
|
}
|
|
457
|
-
if (
|
|
451
|
+
if (T === null)
|
|
458
452
|
return;
|
|
459
|
-
if (
|
|
453
|
+
if (T.start === 0 && l.$isTextNode(m) && m.isTextEntity())
|
|
460
454
|
continue;
|
|
461
|
-
let
|
|
462
|
-
|
|
463
|
-
const
|
|
464
|
-
if (
|
|
455
|
+
let w;
|
|
456
|
+
T.start === 0 ? [w, y] = y.splitText(T.end) : [, w, y] = y.splitText(T.start, T.end);
|
|
457
|
+
const b = i(w);
|
|
458
|
+
if (b.setFormat(w.getFormat()), w.replace(b), y == null)
|
|
465
459
|
return;
|
|
466
460
|
}
|
|
467
|
-
}, v = (
|
|
468
|
-
const
|
|
469
|
-
if (
|
|
470
|
-
|
|
461
|
+
}, v = (c) => {
|
|
462
|
+
const m = c.getTextContent(), x = o(m);
|
|
463
|
+
if (x === null || x.start !== 0) {
|
|
464
|
+
f(c);
|
|
471
465
|
return;
|
|
472
466
|
}
|
|
473
|
-
if (
|
|
474
|
-
|
|
467
|
+
if (m.length > x.end) {
|
|
468
|
+
c.splitText(x.end);
|
|
475
469
|
return;
|
|
476
470
|
}
|
|
477
|
-
const
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
-
},
|
|
482
|
-
return [
|
|
483
|
-
}
|
|
484
|
-
return
|
|
471
|
+
const y = c.getPreviousSibling();
|
|
472
|
+
l.$isTextNode(y) && y.isTextEntity() && (f(y), f(c));
|
|
473
|
+
const T = c.getNextSibling();
|
|
474
|
+
l.$isTextNode(T) && T.isTextEntity() && (f(T), u(c) && f(c));
|
|
475
|
+
}, E = n.registerNodeTransform(l.TextNode, h), $ = n.registerNodeTransform(r, v);
|
|
476
|
+
return [E, $];
|
|
477
|
+
}
|
|
478
|
+
return F.$canShowPlaceholder = p, F.$canShowPlaceholderCurry = e, F.$findTextIntersectionFromCharacters = s, F.$isRootTextContentEmpty = g, F.$isRootTextContentEmptyCurry = C, F.$rootTextContent = d, F.registerLexicalTextEntity = t, F;
|
|
485
479
|
}
|
|
486
|
-
var
|
|
487
|
-
function
|
|
488
|
-
if (
|
|
489
|
-
return
|
|
490
|
-
|
|
491
|
-
var
|
|
492
|
-
function
|
|
493
|
-
return
|
|
494
|
-
}
|
|
495
|
-
function
|
|
496
|
-
return
|
|
497
|
-
}
|
|
498
|
-
function
|
|
499
|
-
if (!
|
|
480
|
+
var k = {}, Ee;
|
|
481
|
+
function Ct() {
|
|
482
|
+
if (Ee)
|
|
483
|
+
return k;
|
|
484
|
+
Ee = 1;
|
|
485
|
+
var l = A;
|
|
486
|
+
function s(d, p = !0) {
|
|
487
|
+
return d ? !1 : (d = g(), p && (d = d.trim()), d === "");
|
|
488
|
+
}
|
|
489
|
+
function g() {
|
|
490
|
+
return l.$getRoot().getTextContent();
|
|
491
|
+
}
|
|
492
|
+
function C(d) {
|
|
493
|
+
if (!s(d, !1))
|
|
500
494
|
return !1;
|
|
501
|
-
|
|
502
|
-
let
|
|
503
|
-
if (1 <
|
|
495
|
+
d = l.$getRoot().getChildren();
|
|
496
|
+
let p = d.length;
|
|
497
|
+
if (1 < p)
|
|
504
498
|
return !1;
|
|
505
|
-
for (let
|
|
506
|
-
var
|
|
507
|
-
if (
|
|
499
|
+
for (let t = 0; t < p; t++) {
|
|
500
|
+
var e = d[t];
|
|
501
|
+
if (l.$isDecoratorNode(e))
|
|
508
502
|
return !1;
|
|
509
|
-
if (
|
|
510
|
-
if (!
|
|
503
|
+
if (l.$isElementNode(e)) {
|
|
504
|
+
if (!l.$isParagraphNode(e) || e.__indent !== 0)
|
|
511
505
|
return !1;
|
|
512
|
-
|
|
513
|
-
let
|
|
514
|
-
for (let
|
|
515
|
-
if (!
|
|
506
|
+
e = e.getChildren();
|
|
507
|
+
let n = e.length;
|
|
508
|
+
for (let o = 0; o < n; o++)
|
|
509
|
+
if (!l.$isTextNode(e[t]))
|
|
516
510
|
return !1;
|
|
517
511
|
}
|
|
518
512
|
}
|
|
519
513
|
return !0;
|
|
520
514
|
}
|
|
521
|
-
return
|
|
522
|
-
return () =>
|
|
523
|
-
},
|
|
524
|
-
var
|
|
525
|
-
|
|
515
|
+
return k.$canShowPlaceholder = C, k.$canShowPlaceholderCurry = function(d) {
|
|
516
|
+
return () => C(d);
|
|
517
|
+
}, k.$findTextIntersectionFromCharacters = function(d, p) {
|
|
518
|
+
var e = d.getFirstChild();
|
|
519
|
+
d = 0;
|
|
526
520
|
e:
|
|
527
|
-
for (;
|
|
528
|
-
if (
|
|
529
|
-
var
|
|
530
|
-
if (
|
|
531
|
-
|
|
521
|
+
for (; e !== null; ) {
|
|
522
|
+
if (l.$isElementNode(e)) {
|
|
523
|
+
var t = e.getFirstChild();
|
|
524
|
+
if (t !== null) {
|
|
525
|
+
e = t;
|
|
532
526
|
continue;
|
|
533
527
|
}
|
|
534
|
-
} else if (
|
|
535
|
-
if (
|
|
536
|
-
return { node:
|
|
537
|
-
|
|
528
|
+
} else if (l.$isTextNode(e)) {
|
|
529
|
+
if (t = e.getTextContentSize(), d + t > p)
|
|
530
|
+
return { node: e, offset: p - d };
|
|
531
|
+
d += t;
|
|
538
532
|
}
|
|
539
|
-
if (
|
|
540
|
-
|
|
533
|
+
if (t = e.getNextSibling(), t !== null)
|
|
534
|
+
e = t;
|
|
541
535
|
else {
|
|
542
|
-
for (
|
|
543
|
-
if (
|
|
544
|
-
|
|
536
|
+
for (e = e.getParent(); e !== null; ) {
|
|
537
|
+
if (t = e.getNextSibling(), t !== null) {
|
|
538
|
+
e = t;
|
|
545
539
|
continue e;
|
|
546
540
|
}
|
|
547
|
-
|
|
541
|
+
e = e.getParent();
|
|
548
542
|
}
|
|
549
543
|
break;
|
|
550
544
|
}
|
|
551
545
|
}
|
|
552
546
|
return null;
|
|
553
|
-
},
|
|
554
|
-
return () =>
|
|
555
|
-
},
|
|
556
|
-
let
|
|
557
|
-
const
|
|
558
|
-
|
|
559
|
-
},
|
|
560
|
-
if (
|
|
561
|
-
var
|
|
562
|
-
if (
|
|
563
|
-
var
|
|
564
|
-
if (
|
|
565
|
-
if (
|
|
566
|
-
|
|
547
|
+
}, k.$isRootTextContentEmpty = s, k.$isRootTextContentEmptyCurry = function(d, p) {
|
|
548
|
+
return () => s(d, p);
|
|
549
|
+
}, k.$rootTextContent = g, k.registerLexicalTextEntity = function(d, p, e, t) {
|
|
550
|
+
let n = (r) => {
|
|
551
|
+
const i = l.$createTextNode(r.getTextContent());
|
|
552
|
+
i.setFormat(r.getFormat()), r.replace(i);
|
|
553
|
+
}, o = d.registerNodeTransform(l.TextNode, (r) => {
|
|
554
|
+
if (r.isSimpleText()) {
|
|
555
|
+
var i = r.getPreviousSibling(), u = r.getTextContent(), f = r;
|
|
556
|
+
if (l.$isTextNode(i)) {
|
|
557
|
+
var a = i.getTextContent(), h = p(a + u);
|
|
558
|
+
if (i instanceof e) {
|
|
559
|
+
if (h === null || i.getLatest().__mode !== 0) {
|
|
560
|
+
n(i);
|
|
567
561
|
return;
|
|
568
562
|
}
|
|
569
|
-
if (
|
|
570
|
-
|
|
563
|
+
if (h = h.end - a.length, 0 < h) {
|
|
564
|
+
f = u.slice(0, h), f = a + f, i.select(), i.setTextContent(f), h === u.length ? r.remove() : (i = u.slice(h), r.setTextContent(i));
|
|
571
565
|
return;
|
|
572
566
|
}
|
|
573
|
-
} else if (
|
|
567
|
+
} else if (h === null || h.start < a.length)
|
|
574
568
|
return;
|
|
575
569
|
}
|
|
576
570
|
for (; ; ) {
|
|
577
|
-
if (
|
|
578
|
-
if (
|
|
579
|
-
if (
|
|
580
|
-
|
|
571
|
+
if (r = p(u), u = h = r === null ? "" : u.slice(r.end), h === "") {
|
|
572
|
+
if (a = f.getNextSibling(), l.$isTextNode(a)) {
|
|
573
|
+
if (h = f.getTextContent() + a.getTextContent(), h = p(h), h === null) {
|
|
574
|
+
a instanceof e ? n(a) : a.markDirty();
|
|
581
575
|
break;
|
|
582
|
-
} else if (
|
|
576
|
+
} else if (h.start !== 0)
|
|
583
577
|
break;
|
|
584
578
|
}
|
|
585
|
-
} else if (
|
|
579
|
+
} else if (a = p(h), a !== null && a.start === 0)
|
|
586
580
|
break;
|
|
587
|
-
if (
|
|
581
|
+
if (r === null)
|
|
588
582
|
break;
|
|
589
|
-
if (
|
|
583
|
+
if (r.start === 0 && l.$isTextNode(i) && i.isTextEntity())
|
|
590
584
|
continue;
|
|
591
585
|
let v;
|
|
592
|
-
if (
|
|
586
|
+
if (r.start === 0 ? [v, f] = f.splitText(r.end) : [, v, f] = f.splitText(r.start, r.end), r = t(v), r.setFormat(v.getFormat()), v.replace(r), f == null)
|
|
593
587
|
break;
|
|
594
588
|
}
|
|
595
589
|
}
|
|
596
590
|
});
|
|
597
|
-
return
|
|
598
|
-
var
|
|
599
|
-
const
|
|
600
|
-
|
|
601
|
-
}), [
|
|
602
|
-
},
|
|
591
|
+
return d = d.registerNodeTransform(e, (r) => {
|
|
592
|
+
var i = r.getTextContent();
|
|
593
|
+
const u = p(i);
|
|
594
|
+
u === null || u.start !== 0 ? n(r) : i.length > u.end ? r.splitText(u.end) : (i = r.getPreviousSibling(), l.$isTextNode(i) && i.isTextEntity() && (n(i), n(r)), i = r.getNextSibling(), l.$isTextNode(i) && i.isTextEntity() && (n(i), r instanceof e && n(r)));
|
|
595
|
+
}), [o, d];
|
|
596
|
+
}, k;
|
|
603
597
|
}
|
|
604
|
-
var
|
|
605
|
-
function
|
|
606
|
-
return
|
|
598
|
+
var Q, ve;
|
|
599
|
+
function Be() {
|
|
600
|
+
return ve || (ve = 1, Q = process.env.NODE_ENV === "development" ? vt() : Ct()), Q;
|
|
607
601
|
}
|
|
608
|
-
var
|
|
609
|
-
function
|
|
610
|
-
if (
|
|
611
|
-
return
|
|
612
|
-
|
|
613
|
-
var
|
|
614
|
-
function
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
function L(d) {
|
|
620
|
-
return `${d}px`;
|
|
621
|
-
}
|
|
622
|
-
const p = {
|
|
623
|
-
attributes: !0,
|
|
624
|
-
characterData: !0,
|
|
625
|
-
childList: !0,
|
|
626
|
-
subtree: !0
|
|
627
|
-
};
|
|
628
|
-
function m(d, E, f) {
|
|
629
|
-
let N = null, C = null, b = null, _ = [];
|
|
630
|
-
const $ = document.createElement("div");
|
|
631
|
-
function M() {
|
|
632
|
-
if (N === null)
|
|
633
|
-
throw Error("Unexpected null rootDOMNode");
|
|
634
|
-
if (C === null)
|
|
635
|
-
throw Error("Unexpected null parentDOMNode");
|
|
636
|
-
const {
|
|
637
|
-
left: q,
|
|
638
|
-
top: K
|
|
639
|
-
} = N.getBoundingClientRect(), H = C, A = c.createRectsFromDOMRange(d, E);
|
|
640
|
-
$.isConnected || H.append($);
|
|
641
|
-
let I = !1;
|
|
642
|
-
for (let z = 0; z < A.length; z++) {
|
|
643
|
-
const X = A[z], V = _[z] || document.createElement("div"), W = V.style;
|
|
644
|
-
W.position !== "absolute" && (W.position = "absolute", I = !0);
|
|
645
|
-
const ie = L(X.left - q);
|
|
646
|
-
W.left !== ie && (W.left = ie, I = !0);
|
|
647
|
-
const Z = L(X.top - K);
|
|
648
|
-
W.top !== Z && (V.style.top = Z, I = !0);
|
|
649
|
-
const ee = L(X.width);
|
|
650
|
-
W.width !== ee && (V.style.width = ee, I = !0);
|
|
651
|
-
const te = L(X.height);
|
|
652
|
-
W.height !== te && (V.style.height = te, I = !0), V.parentNode !== $ && ($.append(V), I = !0), _[z] = V;
|
|
602
|
+
var _ = {}, Ce;
|
|
603
|
+
function Lt() {
|
|
604
|
+
if (Ce)
|
|
605
|
+
return _;
|
|
606
|
+
Ce = 1;
|
|
607
|
+
var l = qe, s = A;
|
|
608
|
+
function g(c, ...m) {
|
|
609
|
+
m.forEach((x) => {
|
|
610
|
+
if (typeof x == "string") {
|
|
611
|
+
const y = x.split(" ").filter((T) => T !== "");
|
|
612
|
+
c.classList.add(...y);
|
|
653
613
|
}
|
|
654
|
-
for (; _.length > A.length; )
|
|
655
|
-
_.pop();
|
|
656
|
-
I && f(_);
|
|
657
|
-
}
|
|
658
|
-
function O() {
|
|
659
|
-
C = null, N = null, b !== null && b.disconnect(), b = null, $.remove();
|
|
660
|
-
for (const q of _)
|
|
661
|
-
q.remove();
|
|
662
|
-
_ = [];
|
|
663
|
-
}
|
|
664
|
-
function F() {
|
|
665
|
-
const q = d.getRootElement();
|
|
666
|
-
if (q === null)
|
|
667
|
-
return O();
|
|
668
|
-
const K = q.parentElement;
|
|
669
|
-
if (!(K instanceof HTMLElement))
|
|
670
|
-
return O();
|
|
671
|
-
O(), N = q, C = K, b = new MutationObserver((H) => {
|
|
672
|
-
const A = d.getRootElement(), I = A && A.parentElement;
|
|
673
|
-
if (A !== N || I !== C)
|
|
674
|
-
return F();
|
|
675
|
-
for (const z of H)
|
|
676
|
-
if (!$.contains(z.target))
|
|
677
|
-
return M();
|
|
678
|
-
}), b.observe(K, p), M();
|
|
679
|
-
}
|
|
680
|
-
const B = d.registerRootListener(F);
|
|
681
|
-
return () => {
|
|
682
|
-
B(), O();
|
|
683
|
-
};
|
|
684
|
-
}
|
|
685
|
-
function a(d, E) {
|
|
686
|
-
let f = null, N = null, C = null, b = null, _ = () => {
|
|
687
|
-
};
|
|
688
|
-
function $(M) {
|
|
689
|
-
M.read(() => {
|
|
690
|
-
const O = i.$getSelection();
|
|
691
|
-
if (!i.$isRangeSelection(O)) {
|
|
692
|
-
f = null, N = null, C = null, b = null, _(), _ = () => {
|
|
693
|
-
};
|
|
694
|
-
return;
|
|
695
|
-
}
|
|
696
|
-
const {
|
|
697
|
-
anchor: F,
|
|
698
|
-
focus: B
|
|
699
|
-
} = O, q = F.getNode(), K = q.getKey(), H = F.offset, A = B.getNode(), I = A.getKey(), z = B.offset, X = d.getElementByKey(K), V = d.getElementByKey(I), W = f === null || X === null || H !== N || K !== f.getKey() || q !== f && (!(f instanceof i.TextNode) || q.updateDOM(f, X, d._config)), ie = C === null || V === null || z !== b || I !== C.getKey() || A !== C && (!(C instanceof i.TextNode) || A.updateDOM(C, V, d._config));
|
|
700
|
-
if (W || ie) {
|
|
701
|
-
const Z = d.getElementByKey(F.getNode().getKey()), ee = d.getElementByKey(B.getNode().getKey());
|
|
702
|
-
if (Z !== null && ee !== null && Z.tagName === "SPAN" && ee.tagName === "SPAN") {
|
|
703
|
-
const te = document.createRange();
|
|
704
|
-
let le, se, ae, ce;
|
|
705
|
-
B.isBefore(F) ? (le = ee, se = B.offset, ae = Z, ce = F.offset) : (le = Z, se = F.offset, ae = ee, ce = B.offset);
|
|
706
|
-
const we = le.firstChild;
|
|
707
|
-
if (we === null)
|
|
708
|
-
throw Error("Expected text node to be first child of span");
|
|
709
|
-
const Se = ae.firstChild;
|
|
710
|
-
if (Se === null)
|
|
711
|
-
throw Error("Expected text node to be first child of span");
|
|
712
|
-
te.setStart(we, se), te.setEnd(Se, ce), _(), _ = m(d, te, (Re) => {
|
|
713
|
-
for (const ut of Re) {
|
|
714
|
-
const k = ut.style;
|
|
715
|
-
k.background !== "Highlight" && (k.background = "Highlight"), k.color !== "HighlightText" && (k.color = "HighlightText"), k.zIndex !== "-1" && (k.zIndex = "-1"), k.pointerEvents !== "none" && (k.pointerEvents = "none"), k.marginTop !== L(-1.5) && (k.marginTop = L(-1.5)), k.paddingTop !== L(4) && (k.paddingTop = L(4)), k.paddingBottom !== L(0) && (k.paddingBottom = L(0));
|
|
716
|
-
}
|
|
717
|
-
E !== void 0 && E(Re);
|
|
718
|
-
});
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
f = q, N = H, C = A, b = z;
|
|
722
|
-
});
|
|
723
|
-
}
|
|
724
|
-
return $(d.getEditorState()), h(d.registerUpdateListener(({
|
|
725
|
-
editorState: M
|
|
726
|
-
}) => $(M)), _, () => {
|
|
727
|
-
_();
|
|
728
614
|
});
|
|
729
615
|
}
|
|
730
|
-
function
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
const N = f.split(" ").filter((C) => C !== "");
|
|
734
|
-
d.classList.add(...N);
|
|
735
|
-
}
|
|
616
|
+
function C(c, ...m) {
|
|
617
|
+
m.forEach((x) => {
|
|
618
|
+
typeof x == "string" && c.classList.remove(...x.split(" "));
|
|
736
619
|
});
|
|
737
620
|
}
|
|
738
|
-
function
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
});
|
|
742
|
-
}
|
|
743
|
-
function t(d, E) {
|
|
744
|
-
for (const f of E)
|
|
745
|
-
if (d.type.startsWith(f))
|
|
621
|
+
function d(c, m) {
|
|
622
|
+
for (const x of m)
|
|
623
|
+
if (c.type.startsWith(x))
|
|
746
624
|
return !0;
|
|
747
625
|
return !1;
|
|
748
626
|
}
|
|
749
|
-
function
|
|
750
|
-
const
|
|
751
|
-
return new Promise((
|
|
752
|
-
const
|
|
627
|
+
function p(c, m) {
|
|
628
|
+
const x = c[Symbol.iterator]();
|
|
629
|
+
return new Promise((y, T) => {
|
|
630
|
+
const L = [], w = () => {
|
|
753
631
|
const {
|
|
754
|
-
done:
|
|
755
|
-
value:
|
|
756
|
-
} =
|
|
757
|
-
if (
|
|
758
|
-
return
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
const
|
|
762
|
-
typeof
|
|
763
|
-
file:
|
|
764
|
-
result:
|
|
765
|
-
}),
|
|
766
|
-
}),
|
|
632
|
+
done: b,
|
|
633
|
+
value: N
|
|
634
|
+
} = x.next();
|
|
635
|
+
if (b)
|
|
636
|
+
return y(L);
|
|
637
|
+
const S = new FileReader();
|
|
638
|
+
S.addEventListener("error", T), S.addEventListener("load", () => {
|
|
639
|
+
const P = S.result;
|
|
640
|
+
typeof P == "string" && L.push({
|
|
641
|
+
file: N,
|
|
642
|
+
result: P
|
|
643
|
+
}), w();
|
|
644
|
+
}), d(N, m) ? S.readAsDataURL(N) : w();
|
|
767
645
|
};
|
|
768
|
-
|
|
646
|
+
w();
|
|
769
647
|
});
|
|
770
648
|
}
|
|
771
|
-
function
|
|
772
|
-
const
|
|
773
|
-
let
|
|
774
|
-
for (;
|
|
775
|
-
if (
|
|
776
|
-
depth:
|
|
777
|
-
node:
|
|
778
|
-
}),
|
|
779
|
-
|
|
649
|
+
function e(c, m) {
|
|
650
|
+
const x = [], y = (c || s.$getRoot()).getLatest(), T = m || (s.$isElementNode(y) ? y.getLastDescendant() : y);
|
|
651
|
+
let L = y, w = t(L);
|
|
652
|
+
for (; L !== null && !L.is(T); )
|
|
653
|
+
if (x.push({
|
|
654
|
+
depth: w,
|
|
655
|
+
node: L
|
|
656
|
+
}), s.$isElementNode(L) && L.getChildrenSize() > 0)
|
|
657
|
+
L = L.getFirstChild(), w++;
|
|
780
658
|
else {
|
|
781
|
-
let
|
|
782
|
-
for (;
|
|
783
|
-
|
|
659
|
+
let b = null;
|
|
660
|
+
for (; b === null && L !== null; )
|
|
661
|
+
b = L.getNextSibling(), b === null ? (L = L.getParent(), w--) : L = b;
|
|
784
662
|
}
|
|
785
|
-
return
|
|
786
|
-
depth:
|
|
787
|
-
node:
|
|
788
|
-
}),
|
|
789
|
-
}
|
|
790
|
-
function
|
|
791
|
-
let
|
|
792
|
-
for (; (
|
|
793
|
-
|
|
794
|
-
return
|
|
795
|
-
}
|
|
796
|
-
function
|
|
797
|
-
let
|
|
798
|
-
for (;
|
|
799
|
-
if (
|
|
800
|
-
return
|
|
801
|
-
|
|
663
|
+
return L !== null && L.is(T) && x.push({
|
|
664
|
+
depth: w,
|
|
665
|
+
node: L
|
|
666
|
+
}), x;
|
|
667
|
+
}
|
|
668
|
+
function t(c) {
|
|
669
|
+
let m = c, x = 0;
|
|
670
|
+
for (; (m = m.getParent()) !== null; )
|
|
671
|
+
x++;
|
|
672
|
+
return x;
|
|
673
|
+
}
|
|
674
|
+
function n(c, m) {
|
|
675
|
+
let x = c;
|
|
676
|
+
for (; x != null; ) {
|
|
677
|
+
if (x instanceof m)
|
|
678
|
+
return x;
|
|
679
|
+
x = x.getParent();
|
|
802
680
|
}
|
|
803
681
|
return null;
|
|
804
682
|
}
|
|
805
|
-
function o(
|
|
806
|
-
const
|
|
807
|
-
if (!
|
|
808
|
-
throw Error(`Expected node ${
|
|
809
|
-
return
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
let
|
|
813
|
-
for (;
|
|
814
|
-
if (
|
|
815
|
-
return
|
|
816
|
-
|
|
683
|
+
function o(c) {
|
|
684
|
+
const m = r(c, (x) => s.$isElementNode(x) && !x.isInline());
|
|
685
|
+
if (!s.$isElementNode(m))
|
|
686
|
+
throw Error(`Expected node ${c.__key} to have closest block element node.`);
|
|
687
|
+
return m;
|
|
688
|
+
}
|
|
689
|
+
function r(c, m) {
|
|
690
|
+
let x = c;
|
|
691
|
+
for (; x !== s.$getRoot() && x != null; ) {
|
|
692
|
+
if (m(x))
|
|
693
|
+
return x;
|
|
694
|
+
x = x.getParent();
|
|
817
695
|
}
|
|
818
696
|
return null;
|
|
819
|
-
}
|
|
820
|
-
function
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
697
|
+
}
|
|
698
|
+
function i(...c) {
|
|
699
|
+
return () => {
|
|
700
|
+
c.forEach((m) => m());
|
|
701
|
+
};
|
|
702
|
+
}
|
|
703
|
+
function u(c, m, x, y) {
|
|
704
|
+
const T = (b) => b instanceof m, L = (b) => {
|
|
705
|
+
const N = b.getChildren();
|
|
706
|
+
for (let D = 0; D < N.length; D++) {
|
|
707
|
+
const j = N[D];
|
|
708
|
+
if (T(j))
|
|
826
709
|
return null;
|
|
827
710
|
}
|
|
828
|
-
let
|
|
829
|
-
for (;
|
|
830
|
-
if (
|
|
711
|
+
let S = b, P = b;
|
|
712
|
+
for (; S !== null; )
|
|
713
|
+
if (P = S, S = S.getParent(), T(S))
|
|
831
714
|
return {
|
|
832
|
-
child:
|
|
833
|
-
parent:
|
|
715
|
+
child: P,
|
|
716
|
+
parent: S
|
|
834
717
|
};
|
|
835
718
|
return null;
|
|
836
|
-
},
|
|
837
|
-
const
|
|
838
|
-
if (
|
|
719
|
+
}, w = (b) => {
|
|
720
|
+
const N = L(b);
|
|
721
|
+
if (N !== null) {
|
|
839
722
|
const {
|
|
840
|
-
child:
|
|
841
|
-
parent:
|
|
842
|
-
} =
|
|
843
|
-
if (
|
|
844
|
-
|
|
845
|
-
const
|
|
846
|
-
if (
|
|
847
|
-
const
|
|
848
|
-
|
|
849
|
-
for (let
|
|
850
|
-
|
|
723
|
+
child: S,
|
|
724
|
+
parent: P
|
|
725
|
+
} = N;
|
|
726
|
+
if (S.is(b)) {
|
|
727
|
+
y(P, b);
|
|
728
|
+
const D = S.getNextSiblings(), j = D.length;
|
|
729
|
+
if (P.insertAfter(S), j !== 0) {
|
|
730
|
+
const le = x(P);
|
|
731
|
+
S.insertAfter(le);
|
|
732
|
+
for (let V = 0; V < j; V++)
|
|
733
|
+
le.append(D[V]);
|
|
851
734
|
}
|
|
852
|
-
!
|
|
735
|
+
!P.canBeEmpty() && P.getChildrenSize() === 0 && P.remove();
|
|
853
736
|
}
|
|
854
737
|
}
|
|
855
738
|
};
|
|
856
|
-
return
|
|
857
|
-
}
|
|
858
|
-
function
|
|
859
|
-
const
|
|
860
|
-
for (const [
|
|
861
|
-
const
|
|
862
|
-
|
|
863
|
-
if (!i.$isTextNode($))
|
|
864
|
-
throw Error("Expected node be a TextNode");
|
|
865
|
-
M.__text = $.__text;
|
|
866
|
-
}
|
|
867
|
-
N.set(_, M);
|
|
739
|
+
return c.registerNodeTransform(m, w);
|
|
740
|
+
}
|
|
741
|
+
function f(c, m) {
|
|
742
|
+
const y = /* @__PURE__ */ new Map(), T = c._pendingEditorState;
|
|
743
|
+
for (const [w, b] of m._nodeMap) {
|
|
744
|
+
const N = l.$cloneWithProperties(b);
|
|
745
|
+
s.$isTextNode(N) && (N.__text = b.__text), y.set(w, N);
|
|
868
746
|
}
|
|
869
|
-
|
|
870
|
-
const
|
|
871
|
-
|
|
747
|
+
T && (T._nodeMap = y), c._dirtyType = 2;
|
|
748
|
+
const L = m._selection;
|
|
749
|
+
s.$setSelection(L === null ? null : L.clone());
|
|
872
750
|
}
|
|
873
|
-
function
|
|
874
|
-
const
|
|
875
|
-
if (
|
|
751
|
+
function a(c) {
|
|
752
|
+
const m = s.$getSelection() || s.$getPreviousSelection();
|
|
753
|
+
if (s.$isRangeSelection(m)) {
|
|
876
754
|
const {
|
|
877
|
-
focus:
|
|
878
|
-
} =
|
|
879
|
-
if (
|
|
880
|
-
const
|
|
881
|
-
|
|
755
|
+
focus: x
|
|
756
|
+
} = m, y = x.getNode(), T = x.offset;
|
|
757
|
+
if (s.$isRootOrShadowRoot(y)) {
|
|
758
|
+
const L = y.getChildAtIndex(T);
|
|
759
|
+
L == null ? y.append(c) : L.insertBefore(c), c.selectNext();
|
|
882
760
|
} else {
|
|
883
|
-
let
|
|
884
|
-
|
|
885
|
-
const [,
|
|
886
|
-
|
|
761
|
+
let L, w;
|
|
762
|
+
s.$isTextNode(y) ? (L = y.getParentOrThrow(), w = y.getIndexWithinParent(), T > 0 && (w += 1, y.splitText(T))) : (L = y, w = T);
|
|
763
|
+
const [, b] = s.$splitNode(L, w);
|
|
764
|
+
b.insertBefore(c), b.selectStart();
|
|
887
765
|
}
|
|
888
766
|
} else {
|
|
889
|
-
if (
|
|
890
|
-
const
|
|
891
|
-
|
|
767
|
+
if (s.$isNodeSelection(m) || s.DEPRECATED_$isGridSelection(m)) {
|
|
768
|
+
const y = m.getNodes();
|
|
769
|
+
y[y.length - 1].getTopLevelElementOrThrow().insertAfter(c);
|
|
892
770
|
} else
|
|
893
|
-
|
|
894
|
-
const
|
|
895
|
-
|
|
771
|
+
s.$getRoot().append(c);
|
|
772
|
+
const x = s.$createParagraphNode();
|
|
773
|
+
c.insertAfter(x), x.select();
|
|
896
774
|
}
|
|
897
|
-
return
|
|
775
|
+
return c.getLatest();
|
|
898
776
|
}
|
|
899
|
-
function
|
|
900
|
-
const
|
|
901
|
-
return
|
|
777
|
+
function h(c, m) {
|
|
778
|
+
const x = m();
|
|
779
|
+
return c.replace(x), x.append(c), x;
|
|
902
780
|
}
|
|
903
|
-
function
|
|
904
|
-
return
|
|
781
|
+
function v(c) {
|
|
782
|
+
return E(c) && c.tagName === "A";
|
|
905
783
|
}
|
|
906
|
-
function
|
|
907
|
-
|
|
908
|
-
for (let N = 0; N < d.length; N++) {
|
|
909
|
-
const C = E(d[N]);
|
|
910
|
-
C !== null && f.push(C);
|
|
911
|
-
}
|
|
912
|
-
return f;
|
|
784
|
+
function E(c) {
|
|
785
|
+
return c.nodeType === 1;
|
|
913
786
|
}
|
|
914
|
-
function
|
|
915
|
-
|
|
916
|
-
f !== null ? f.insertBefore(E) : d.append(E);
|
|
787
|
+
function $(c, m) {
|
|
788
|
+
return c !== null ? Object.getPrototypeOf(c).constructor.name === m.name : !1;
|
|
917
789
|
}
|
|
918
|
-
return
|
|
790
|
+
return _.$splitNode = s.$splitNode, _.$dfs = e, _.$findMatchingParent = r, _.$getNearestBlockElementAncestorOrThrow = o, _.$getNearestNodeOfType = n, _.$insertNodeToNearestRoot = a, _.$restoreEditorState = f, _.$wrapNodeInElement = h, _.addClassNamesToElement = g, _.isHTMLAnchorElement = v, _.isHTMLElement = E, _.isMimeType = d, _.mediaFileReader = p, _.mergeRegister = i, _.objectKlassEquals = $, _.registerNestedElementResolver = u, _.removeClassNamesFromElement = C, _;
|
|
919
791
|
}
|
|
920
|
-
var
|
|
921
|
-
function
|
|
922
|
-
if (
|
|
923
|
-
return
|
|
924
|
-
|
|
925
|
-
var
|
|
926
|
-
function
|
|
792
|
+
var R = {}, Le;
|
|
793
|
+
function yt() {
|
|
794
|
+
if (Le)
|
|
795
|
+
return R;
|
|
796
|
+
Le = 1;
|
|
797
|
+
var l = qe, s = A;
|
|
798
|
+
function g(e) {
|
|
927
799
|
let t = new URLSearchParams();
|
|
928
800
|
t.append("code", e);
|
|
929
801
|
for (let n = 1; n < arguments.length; n++)
|
|
930
802
|
t.append("v", arguments[n]);
|
|
931
803
|
throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
932
804
|
}
|
|
933
|
-
function
|
|
934
|
-
return () => {
|
|
935
|
-
e.forEach((t) => t());
|
|
936
|
-
};
|
|
937
|
-
}
|
|
938
|
-
let p = { attributes: !0, characterData: !0, childList: !0, subtree: !0 };
|
|
939
|
-
function m(e, t, n) {
|
|
940
|
-
function r() {
|
|
941
|
-
if (o === null)
|
|
942
|
-
throw Error("Unexpected null rootDOMNode");
|
|
943
|
-
if (x === null)
|
|
944
|
-
throw Error("Unexpected null parentDOMNode");
|
|
945
|
-
let { left: y, top: w } = o.getBoundingClientRect();
|
|
946
|
-
var R = x;
|
|
947
|
-
let d = c.createRectsFromDOMRange(e, t);
|
|
948
|
-
S.isConnected || R.append(S), R = !1;
|
|
949
|
-
for (let N = 0; N < d.length; N++) {
|
|
950
|
-
var E = d[N];
|
|
951
|
-
let C = g[N] || document.createElement("div"), b = C.style;
|
|
952
|
-
b.position !== "absolute" && (b.position = "absolute", R = !0);
|
|
953
|
-
var f = `${E.left - y}px`;
|
|
954
|
-
b.left !== f && (b.left = f, R = !0), f = `${E.top - w}px`, b.top !== f && (C.style.top = f, R = !0), f = `${E.width}px`, b.width !== f && (C.style.width = f, R = !0), E = `${E.height}px`, b.height !== E && (C.style.height = E, R = !0), C.parentNode !== S && (S.append(C), R = !0), g[N] = C;
|
|
955
|
-
}
|
|
956
|
-
for (; g.length > d.length; )
|
|
957
|
-
g.pop();
|
|
958
|
-
R && n(g);
|
|
959
|
-
}
|
|
960
|
-
function s() {
|
|
961
|
-
o = x = null, v !== null && v.disconnect(), v = null, S.remove();
|
|
962
|
-
for (let y of g)
|
|
963
|
-
y.remove();
|
|
964
|
-
g = [];
|
|
965
|
-
}
|
|
966
|
-
function l() {
|
|
967
|
-
let y = e.getRootElement();
|
|
968
|
-
if (y === null)
|
|
969
|
-
return s();
|
|
970
|
-
let w = y.parentElement;
|
|
971
|
-
if (!(w instanceof HTMLElement))
|
|
972
|
-
return s();
|
|
973
|
-
s(), o = y, x = w, v = new MutationObserver((R) => {
|
|
974
|
-
let d = e.getRootElement(), E = d && d.parentElement;
|
|
975
|
-
if (d !== o || E !== x)
|
|
976
|
-
return l();
|
|
977
|
-
for (let f of R)
|
|
978
|
-
if (!S.contains(f.target))
|
|
979
|
-
return r();
|
|
980
|
-
}), v.observe(w, p), r();
|
|
981
|
-
}
|
|
982
|
-
let o = null, x = null, v = null, g = [], S = document.createElement("div"), T = e.registerRootListener(l);
|
|
983
|
-
return () => {
|
|
984
|
-
T(), s();
|
|
985
|
-
};
|
|
986
|
-
}
|
|
987
|
-
function a(e, t) {
|
|
805
|
+
function C(e, t) {
|
|
988
806
|
for (let n of t)
|
|
989
807
|
if (e.type.startsWith(n))
|
|
990
808
|
return !0;
|
|
991
809
|
return !1;
|
|
992
810
|
}
|
|
993
|
-
|
|
994
|
-
for (; e !==
|
|
811
|
+
function d(e, t) {
|
|
812
|
+
for (; e !== s.$getRoot() && e != null; ) {
|
|
995
813
|
if (t(e))
|
|
996
814
|
return e;
|
|
997
815
|
e = e.getParent();
|
|
998
816
|
}
|
|
999
817
|
return null;
|
|
1000
|
-
}
|
|
1001
|
-
|
|
818
|
+
}
|
|
819
|
+
function p(e) {
|
|
820
|
+
return e.nodeType === 1;
|
|
821
|
+
}
|
|
822
|
+
return R.$splitNode = s.$splitNode, R.$dfs = function(e, t) {
|
|
1002
823
|
let n = [];
|
|
1003
|
-
e = (e ||
|
|
1004
|
-
for (var
|
|
1005
|
-
|
|
1006
|
-
for (
|
|
1007
|
-
if (n.push({ depth:
|
|
1008
|
-
e = e.getFirstChild(),
|
|
824
|
+
e = (e || s.$getRoot()).getLatest(), t = t || (s.$isElementNode(e) ? e.getLastDescendant() : e);
|
|
825
|
+
for (var o = e, r = 0; (o = o.getParent()) !== null; )
|
|
826
|
+
r++;
|
|
827
|
+
for (o = r; e !== null && !e.is(t); )
|
|
828
|
+
if (n.push({ depth: o, node: e }), s.$isElementNode(e) && 0 < e.getChildrenSize())
|
|
829
|
+
e = e.getFirstChild(), o++;
|
|
1009
830
|
else
|
|
1010
|
-
for (
|
|
1011
|
-
|
|
1012
|
-
return e !== null && e.is(t) && n.push({ depth:
|
|
1013
|
-
},
|
|
1014
|
-
let
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
s !== null && n.push(s);
|
|
1018
|
-
}
|
|
1019
|
-
return n;
|
|
1020
|
-
}, D.$findMatchingParent = u, D.$getNearestBlockElementAncestorOrThrow = function(e) {
|
|
1021
|
-
let t = u(e, (n) => i.$isElementNode(n) && !n.isInline());
|
|
1022
|
-
return i.$isElementNode(t) || h(4, e.__key), t;
|
|
1023
|
-
}, D.$getNearestNodeOfType = function(e, t) {
|
|
831
|
+
for (r = null; r === null && e !== null; )
|
|
832
|
+
r = e.getNextSibling(), r === null ? (e = e.getParent(), o--) : e = r;
|
|
833
|
+
return e !== null && e.is(t) && n.push({ depth: o, node: e }), n;
|
|
834
|
+
}, R.$findMatchingParent = d, R.$getNearestBlockElementAncestorOrThrow = function(e) {
|
|
835
|
+
let t = d(e, (n) => s.$isElementNode(n) && !n.isInline());
|
|
836
|
+
return s.$isElementNode(t) || g(4, e.__key), t;
|
|
837
|
+
}, R.$getNearestNodeOfType = function(e, t) {
|
|
1024
838
|
for (; e != null; ) {
|
|
1025
839
|
if (e instanceof t)
|
|
1026
840
|
return e;
|
|
1027
841
|
e = e.getParent();
|
|
1028
842
|
}
|
|
1029
843
|
return null;
|
|
1030
|
-
},
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
}, D.$insertNodeToNearestRoot = function(e) {
|
|
1034
|
-
var t = i.$getSelection() || i.$getPreviousSelection();
|
|
1035
|
-
if (i.$isRangeSelection(t)) {
|
|
844
|
+
}, R.$insertNodeToNearestRoot = function(e) {
|
|
845
|
+
var t = s.$getSelection() || s.$getPreviousSelection();
|
|
846
|
+
if (s.$isRangeSelection(t)) {
|
|
1036
847
|
var { focus: n } = t;
|
|
1037
|
-
if (t = n.getNode(), n = n.offset,
|
|
848
|
+
if (t = n.getNode(), n = n.offset, s.$isRootOrShadowRoot(t))
|
|
1038
849
|
n = t.getChildAtIndex(n), n == null ? t.append(e) : n.insertBefore(e), e.selectNext();
|
|
1039
850
|
else {
|
|
1040
|
-
let
|
|
1041
|
-
|
|
851
|
+
let o, r;
|
|
852
|
+
s.$isTextNode(t) ? (o = t.getParentOrThrow(), r = t.getIndexWithinParent(), 0 < n && (r += 1, t.splitText(n))) : (o = t, r = n), [, t] = s.$splitNode(o, r), t.insertBefore(e), t.selectStart();
|
|
1042
853
|
}
|
|
1043
854
|
} else
|
|
1044
|
-
t
|
|
855
|
+
s.$isNodeSelection(t) || s.DEPRECATED_$isGridSelection(t) ? (t = t.getNodes(), t[t.length - 1].getTopLevelElementOrThrow().insertAfter(e)) : s.$getRoot().append(e), t = s.$createParagraphNode(), e.insertAfter(t), t.select();
|
|
1045
856
|
return e.getLatest();
|
|
1046
|
-
},
|
|
1047
|
-
let n = /* @__PURE__ */ new Map(),
|
|
1048
|
-
for (let [
|
|
1049
|
-
let
|
|
1050
|
-
|
|
1051
|
-
if (!i.$isTextNode(l))
|
|
1052
|
-
throw Error("Expected node be a TextNode");
|
|
1053
|
-
o.__text = l.__text;
|
|
1054
|
-
}
|
|
1055
|
-
n.set(s, o);
|
|
857
|
+
}, R.$restoreEditorState = function(e, t) {
|
|
858
|
+
let n = /* @__PURE__ */ new Map(), o = e._pendingEditorState;
|
|
859
|
+
for (let [r, i] of t._nodeMap) {
|
|
860
|
+
let u = l.$cloneWithProperties(i);
|
|
861
|
+
s.$isTextNode(u) && (u.__text = i.__text), n.set(r, u);
|
|
1056
862
|
}
|
|
1057
|
-
|
|
1058
|
-
},
|
|
863
|
+
o && (o._nodeMap = n), e._dirtyType = 2, e = t._selection, s.$setSelection(e === null ? null : e.clone());
|
|
864
|
+
}, R.$wrapNodeInElement = function(e, t) {
|
|
1059
865
|
return t = t(), e.replace(t), t.append(e), t;
|
|
1060
|
-
},
|
|
866
|
+
}, R.addClassNamesToElement = function(e, ...t) {
|
|
1061
867
|
t.forEach((n) => {
|
|
1062
|
-
typeof n == "string" && (n = n.split(" ").filter((
|
|
868
|
+
typeof n == "string" && (n = n.split(" ").filter((o) => o !== ""), e.classList.add(...n));
|
|
1063
869
|
});
|
|
1064
|
-
},
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
var g = i.$getSelection();
|
|
1068
|
-
if (i.$isRangeSelection(g)) {
|
|
1069
|
-
var { anchor: S, focus: T } = g;
|
|
1070
|
-
g = S.getNode();
|
|
1071
|
-
var y = g.getKey(), w = S.offset, R = T.getNode(), d = R.getKey(), E = T.offset, f = e.getElementByKey(y), N = e.getElementByKey(d);
|
|
1072
|
-
if (y = r === null || f === null || w !== s || y !== r.getKey() || g !== r && (!(r instanceof i.TextNode) || g.updateDOM(r, f, e._config)), d = l === null || N === null || E !== o || d !== l.getKey() || R !== l && (!(l instanceof i.TextNode) || R.updateDOM(l, N, e._config)), y || d) {
|
|
1073
|
-
f = e.getElementByKey(S.getNode().getKey());
|
|
1074
|
-
var C = e.getElementByKey(T.getNode().getKey());
|
|
1075
|
-
if (f !== null && C !== null && f.tagName === "SPAN" && C.tagName === "SPAN") {
|
|
1076
|
-
if (d = document.createRange(), T.isBefore(S) ? (y = C, N = T.offset, C = f, f = S.offset) : (y = f, N = S.offset, f = T.offset), y = y.firstChild, y === null || (C = C.firstChild, C === null))
|
|
1077
|
-
throw Error("Expected text node to be first child of span");
|
|
1078
|
-
d.setStart(y, N), d.setEnd(C, f), x(), x = m(e, d, (b) => {
|
|
1079
|
-
for (let _ of b) {
|
|
1080
|
-
let $ = _.style;
|
|
1081
|
-
$.background !== "Highlight" && ($.background = "Highlight"), $.color !== "HighlightText" && ($.color = "HighlightText"), $.zIndex !== "-1" && ($.zIndex = "-1"), $.pointerEvents !== "none" && ($.pointerEvents = "none"), $.marginTop !== "-1.5px" && ($.marginTop = "-1.5px"), $.paddingTop !== "4px" && ($.paddingTop = "4px"), $.paddingBottom !== "0px" && ($.paddingBottom = "0px");
|
|
1082
|
-
}
|
|
1083
|
-
t !== void 0 && t(b);
|
|
1084
|
-
});
|
|
1085
|
-
}
|
|
1086
|
-
}
|
|
1087
|
-
r = g, s = w, l = R, o = E;
|
|
1088
|
-
} else
|
|
1089
|
-
o = l = s = r = null, x(), x = () => {
|
|
1090
|
-
};
|
|
1091
|
-
});
|
|
1092
|
-
}
|
|
1093
|
-
let r = null, s = null, l = null, o = null, x = () => {
|
|
1094
|
-
};
|
|
1095
|
-
return n(e.getEditorState()), L(e.registerUpdateListener(({ editorState: v }) => n(v)), x, () => {
|
|
1096
|
-
x();
|
|
1097
|
-
});
|
|
1098
|
-
}, D.mediaFileReader = function(e, t) {
|
|
870
|
+
}, R.isHTMLAnchorElement = function(e) {
|
|
871
|
+
return p(e) && e.tagName === "A";
|
|
872
|
+
}, R.isHTMLElement = p, R.isMimeType = C, R.mediaFileReader = function(e, t) {
|
|
1099
873
|
let n = e[Symbol.iterator]();
|
|
1100
|
-
return new Promise((
|
|
1101
|
-
let
|
|
1102
|
-
const { done:
|
|
1103
|
-
if (
|
|
1104
|
-
return
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1107
|
-
const
|
|
1108
|
-
typeof
|
|
1109
|
-
}), a
|
|
874
|
+
return new Promise((o, r) => {
|
|
875
|
+
let i = [], u = () => {
|
|
876
|
+
const { done: f, value: a } = n.next();
|
|
877
|
+
if (f)
|
|
878
|
+
return o(i);
|
|
879
|
+
const h = new FileReader();
|
|
880
|
+
h.addEventListener("error", r), h.addEventListener("load", () => {
|
|
881
|
+
const v = h.result;
|
|
882
|
+
typeof v == "string" && i.push({ file: a, result: v }), u();
|
|
883
|
+
}), C(a, t) ? h.readAsDataURL(a) : u();
|
|
1110
884
|
};
|
|
1111
|
-
|
|
885
|
+
u();
|
|
1112
886
|
});
|
|
1113
|
-
},
|
|
887
|
+
}, R.mergeRegister = function(...e) {
|
|
888
|
+
return () => {
|
|
889
|
+
e.forEach((t) => t());
|
|
890
|
+
};
|
|
891
|
+
}, R.objectKlassEquals = function(e, t) {
|
|
1114
892
|
return e !== null ? Object.getPrototypeOf(e).constructor.name === t.name : !1;
|
|
1115
|
-
},
|
|
1116
|
-
return e.registerNodeTransform(t, (
|
|
893
|
+
}, R.registerNestedElementResolver = function(e, t, n, o) {
|
|
894
|
+
return e.registerNodeTransform(t, (r) => {
|
|
1117
895
|
e: {
|
|
1118
|
-
for (var
|
|
1119
|
-
if (
|
|
1120
|
-
|
|
896
|
+
for (var i = r.getChildren(), u = 0; u < i.length; u++)
|
|
897
|
+
if (i[u] instanceof t) {
|
|
898
|
+
i = null;
|
|
1121
899
|
break e;
|
|
1122
900
|
}
|
|
1123
|
-
for (
|
|
1124
|
-
if (
|
|
1125
|
-
|
|
901
|
+
for (i = r; i !== null; )
|
|
902
|
+
if (u = i, i = i.getParent(), i instanceof t) {
|
|
903
|
+
i = { child: u, parent: i };
|
|
1126
904
|
break e;
|
|
1127
905
|
}
|
|
1128
|
-
|
|
906
|
+
i = null;
|
|
1129
907
|
}
|
|
1130
|
-
if (
|
|
1131
|
-
const { child:
|
|
1132
|
-
if (
|
|
1133
|
-
if (
|
|
1134
|
-
|
|
1135
|
-
for (let
|
|
1136
|
-
|
|
908
|
+
if (i !== null) {
|
|
909
|
+
const { child: f, parent: a } = i;
|
|
910
|
+
if (f.is(r)) {
|
|
911
|
+
if (o(a, r), r = f.getNextSiblings(), i = r.length, a.insertAfter(f), i !== 0) {
|
|
912
|
+
u = n(a), f.insertAfter(u);
|
|
913
|
+
for (let h = 0; h < i; h++)
|
|
914
|
+
u.append(r[h]);
|
|
1137
915
|
}
|
|
1138
|
-
|
|
916
|
+
a.canBeEmpty() || a.getChildrenSize() !== 0 || a.remove();
|
|
1139
917
|
}
|
|
1140
918
|
}
|
|
1141
919
|
});
|
|
1142
|
-
},
|
|
920
|
+
}, R.removeClassNamesFromElement = function(e, ...t) {
|
|
1143
921
|
t.forEach((n) => {
|
|
1144
922
|
typeof n == "string" && e.classList.remove(...n.split(" "));
|
|
1145
923
|
});
|
|
1146
|
-
},
|
|
924
|
+
}, R;
|
|
1147
925
|
}
|
|
1148
|
-
var
|
|
1149
|
-
function
|
|
1150
|
-
return
|
|
926
|
+
var X, ye;
|
|
927
|
+
function Ie() {
|
|
928
|
+
return ye || (ye = 1, X = process.env.NODE_ENV === "development" ? Lt() : yt()), X;
|
|
1151
929
|
}
|
|
1152
|
-
var
|
|
1153
|
-
function
|
|
1154
|
-
if (
|
|
1155
|
-
return
|
|
1156
|
-
|
|
1157
|
-
var
|
|
1158
|
-
function
|
|
1159
|
-
const
|
|
1160
|
-
if (
|
|
930
|
+
var Z = {}, Te;
|
|
931
|
+
function Tt() {
|
|
932
|
+
if (Te)
|
|
933
|
+
return Z;
|
|
934
|
+
Te = 1;
|
|
935
|
+
var l = A;
|
|
936
|
+
function s(g) {
|
|
937
|
+
const C = window.location.origin, d = (p) => {
|
|
938
|
+
if (p.origin !== C)
|
|
1161
939
|
return;
|
|
1162
|
-
const
|
|
1163
|
-
if (document.activeElement !==
|
|
940
|
+
const e = g.getRootElement();
|
|
941
|
+
if (document.activeElement !== e)
|
|
1164
942
|
return;
|
|
1165
|
-
const
|
|
1166
|
-
if (typeof
|
|
1167
|
-
let
|
|
943
|
+
const t = p.data;
|
|
944
|
+
if (typeof t == "string") {
|
|
945
|
+
let n;
|
|
1168
946
|
try {
|
|
1169
|
-
|
|
947
|
+
n = JSON.parse(t);
|
|
1170
948
|
} catch {
|
|
1171
949
|
return;
|
|
1172
950
|
}
|
|
1173
|
-
if (
|
|
1174
|
-
const
|
|
1175
|
-
if (
|
|
1176
|
-
const
|
|
1177
|
-
if (
|
|
1178
|
-
const [
|
|
1179
|
-
|
|
1180
|
-
const
|
|
1181
|
-
if (
|
|
1182
|
-
const
|
|
1183
|
-
let
|
|
1184
|
-
if (
|
|
1185
|
-
|
|
1186
|
-
const
|
|
1187
|
-
|
|
951
|
+
if (n && n.protocol === "nuanria_messaging" && n.type === "request") {
|
|
952
|
+
const o = n.payload;
|
|
953
|
+
if (o && o.functionId === "makeChanges") {
|
|
954
|
+
const r = o.args;
|
|
955
|
+
if (r) {
|
|
956
|
+
const [i, u, f, a, h, v] = r;
|
|
957
|
+
g.update(() => {
|
|
958
|
+
const E = l.$getSelection();
|
|
959
|
+
if (l.$isRangeSelection(E)) {
|
|
960
|
+
const $ = E.anchor;
|
|
961
|
+
let c = $.getNode(), m = 0, x = 0;
|
|
962
|
+
if (l.$isTextNode(c) && i >= 0 && u >= 0 && (m = i, x = i + u, E.setTextNodeRange(c, m, c, x)), (m !== x || f !== "") && (E.insertRawText(f), c = $.getNode()), l.$isTextNode(c)) {
|
|
963
|
+
m = a, x = a + h;
|
|
964
|
+
const y = c.getTextContentSize();
|
|
965
|
+
m = m > y ? y : m, x = x > y ? y : x, E.setTextNodeRange(c, m, c, x);
|
|
1188
966
|
}
|
|
1189
|
-
|
|
967
|
+
p.stopImmediatePropagation();
|
|
1190
968
|
}
|
|
1191
969
|
});
|
|
1192
970
|
}
|
|
@@ -1194,459 +972,459 @@ function Vt() {
|
|
|
1194
972
|
}
|
|
1195
973
|
}
|
|
1196
974
|
};
|
|
1197
|
-
return window.addEventListener("message",
|
|
1198
|
-
window.removeEventListener("message",
|
|
975
|
+
return window.addEventListener("message", d, !0), () => {
|
|
976
|
+
window.removeEventListener("message", d, !0);
|
|
1199
977
|
};
|
|
1200
978
|
}
|
|
1201
|
-
return
|
|
979
|
+
return Z.registerDragonSupport = s, Z;
|
|
1202
980
|
}
|
|
1203
|
-
var
|
|
1204
|
-
function
|
|
1205
|
-
if (
|
|
1206
|
-
return
|
|
1207
|
-
|
|
1208
|
-
var
|
|
1209
|
-
return
|
|
1210
|
-
let
|
|
1211
|
-
if (
|
|
1212
|
-
var
|
|
1213
|
-
if (document.activeElement ===
|
|
981
|
+
var ee = {}, be;
|
|
982
|
+
function bt() {
|
|
983
|
+
if (be)
|
|
984
|
+
return ee;
|
|
985
|
+
be = 1;
|
|
986
|
+
var l = A;
|
|
987
|
+
return ee.registerDragonSupport = function(s) {
|
|
988
|
+
let g = window.location.origin, C = (d) => {
|
|
989
|
+
if (d.origin === g) {
|
|
990
|
+
var p = s.getRootElement();
|
|
991
|
+
if (document.activeElement === p && (p = d.data, typeof p == "string")) {
|
|
1214
992
|
try {
|
|
1215
|
-
var
|
|
993
|
+
var e = JSON.parse(p);
|
|
1216
994
|
} catch {
|
|
1217
995
|
return;
|
|
1218
996
|
}
|
|
1219
|
-
if (
|
|
1220
|
-
const [
|
|
1221
|
-
|
|
1222
|
-
const
|
|
1223
|
-
if (
|
|
1224
|
-
var
|
|
1225
|
-
let
|
|
1226
|
-
|
|
997
|
+
if (e && e.protocol === "nuanria_messaging" && e.type === "request" && (e = e.payload) && e.functionId === "makeChanges" && (e = e.args)) {
|
|
998
|
+
const [t, n, o, r, i] = e;
|
|
999
|
+
s.update(() => {
|
|
1000
|
+
const u = l.$getSelection();
|
|
1001
|
+
if (l.$isRangeSelection(u)) {
|
|
1002
|
+
var f = u.anchor;
|
|
1003
|
+
let a = f.getNode(), h = 0, v = 0;
|
|
1004
|
+
l.$isTextNode(a) && 0 <= t && 0 <= n && (h = t, v = t + n, u.setTextNodeRange(a, h, a, v)), (h !== v || o !== "") && (u.insertRawText(o), a = f.getNode()), l.$isTextNode(a) && (h = r, v = r + i, f = a.getTextContentSize(), h = h > f ? f : h, v = v > f ? f : v, u.setTextNodeRange(a, h, a, v)), d.stopImmediatePropagation();
|
|
1227
1005
|
}
|
|
1228
1006
|
});
|
|
1229
1007
|
}
|
|
1230
1008
|
}
|
|
1231
1009
|
}
|
|
1232
1010
|
};
|
|
1233
|
-
return window.addEventListener("message",
|
|
1234
|
-
window.removeEventListener("message",
|
|
1011
|
+
return window.addEventListener("message", C, !0), () => {
|
|
1012
|
+
window.removeEventListener("message", C, !0);
|
|
1235
1013
|
};
|
|
1236
|
-
},
|
|
1014
|
+
}, ee;
|
|
1237
1015
|
}
|
|
1238
|
-
var
|
|
1239
|
-
function
|
|
1240
|
-
return
|
|
1016
|
+
var te, Ne;
|
|
1017
|
+
function Ue() {
|
|
1018
|
+
return Ne || (Ne = 1, te = process.env.NODE_ENV === "development" ? Tt() : bt()), te;
|
|
1241
1019
|
}
|
|
1242
|
-
var
|
|
1243
|
-
function
|
|
1244
|
-
if (
|
|
1245
|
-
return
|
|
1246
|
-
|
|
1247
|
-
var
|
|
1248
|
-
function
|
|
1249
|
-
return
|
|
1250
|
-
}
|
|
1251
|
-
function
|
|
1252
|
-
const [
|
|
1253
|
-
return
|
|
1254
|
-
function
|
|
1255
|
-
const
|
|
1256
|
-
|
|
1020
|
+
var $e;
|
|
1021
|
+
function Nt() {
|
|
1022
|
+
if ($e)
|
|
1023
|
+
return W;
|
|
1024
|
+
$e = 1;
|
|
1025
|
+
var l = M(), s = Me(), g = q, C = Be(), d = Ie(), p = Ae, e = Ue(), t = Oe, r = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? g.useLayoutEffect : g.useEffect;
|
|
1026
|
+
function i(E) {
|
|
1027
|
+
return E.getEditorState().read(C.$canShowPlaceholderCurry(E.isComposing()));
|
|
1028
|
+
}
|
|
1029
|
+
function u(E) {
|
|
1030
|
+
const [$, c] = g.useState(() => i(E));
|
|
1031
|
+
return r(() => {
|
|
1032
|
+
function m() {
|
|
1033
|
+
const x = i(E);
|
|
1034
|
+
c(x);
|
|
1257
1035
|
}
|
|
1258
|
-
return
|
|
1259
|
-
|
|
1260
|
-
}),
|
|
1261
|
-
|
|
1036
|
+
return m(), d.mergeRegister(E.registerUpdateListener(() => {
|
|
1037
|
+
m();
|
|
1038
|
+
}), E.registerEditableListener(() => {
|
|
1039
|
+
m();
|
|
1262
1040
|
}));
|
|
1263
|
-
}, [
|
|
1041
|
+
}, [E]), $;
|
|
1264
1042
|
}
|
|
1265
|
-
function
|
|
1266
|
-
const [
|
|
1267
|
-
return
|
|
1268
|
-
|
|
1269
|
-
|
|
1043
|
+
function f(E, $) {
|
|
1044
|
+
const [c, m] = g.useState(() => E.getDecorators());
|
|
1045
|
+
return r(() => E.registerDecoratorListener((x) => {
|
|
1046
|
+
p.flushSync(() => {
|
|
1047
|
+
m(x);
|
|
1270
1048
|
});
|
|
1271
|
-
}), [
|
|
1272
|
-
|
|
1273
|
-
}, [
|
|
1274
|
-
const
|
|
1275
|
-
for (let
|
|
1276
|
-
const
|
|
1277
|
-
onError: (
|
|
1278
|
-
}, /* @__PURE__ */
|
|
1049
|
+
}), [E]), g.useEffect(() => {
|
|
1050
|
+
m(E.getDecorators());
|
|
1051
|
+
}, [E]), g.useMemo(() => {
|
|
1052
|
+
const x = [], y = Object.keys(c);
|
|
1053
|
+
for (let T = 0; T < y.length; T++) {
|
|
1054
|
+
const L = y[T], w = /* @__PURE__ */ g.createElement($, {
|
|
1055
|
+
onError: (N) => E._onError(N)
|
|
1056
|
+
}, /* @__PURE__ */ g.createElement(g.Suspense, {
|
|
1279
1057
|
fallback: null
|
|
1280
|
-
},
|
|
1281
|
-
|
|
1058
|
+
}, c[L])), b = E.getElementByKey(L);
|
|
1059
|
+
b !== null && x.push(/* @__PURE__ */ p.createPortal(w, b, L));
|
|
1282
1060
|
}
|
|
1283
|
-
return
|
|
1284
|
-
}, [
|
|
1061
|
+
return x;
|
|
1062
|
+
}, [$, c, E]);
|
|
1285
1063
|
}
|
|
1286
|
-
function
|
|
1287
|
-
|
|
1064
|
+
function a(E) {
|
|
1065
|
+
r(() => d.mergeRegister(t.registerRichText(E), e.registerDragonSupport(E)), [E]);
|
|
1288
1066
|
}
|
|
1289
|
-
function
|
|
1290
|
-
contentEditable:
|
|
1291
|
-
placeholder:
|
|
1292
|
-
ErrorBoundary:
|
|
1067
|
+
function h({
|
|
1068
|
+
contentEditable: E,
|
|
1069
|
+
placeholder: $,
|
|
1070
|
+
ErrorBoundary: c
|
|
1293
1071
|
}) {
|
|
1294
|
-
const [
|
|
1295
|
-
return
|
|
1296
|
-
content:
|
|
1297
|
-
}),
|
|
1072
|
+
const [m] = l.useLexicalComposerContext(), x = f(m, c);
|
|
1073
|
+
return a(m), /* @__PURE__ */ g.createElement(g.Fragment, null, E, /* @__PURE__ */ g.createElement(v, {
|
|
1074
|
+
content: $
|
|
1075
|
+
}), x);
|
|
1298
1076
|
}
|
|
1299
1077
|
function v({
|
|
1300
|
-
content:
|
|
1078
|
+
content: E
|
|
1301
1079
|
}) {
|
|
1302
|
-
const [
|
|
1303
|
-
return
|
|
1080
|
+
const [$] = l.useLexicalComposerContext(), c = u($), m = s();
|
|
1081
|
+
return c ? typeof E == "function" ? E(m) : E : null;
|
|
1304
1082
|
}
|
|
1305
|
-
return
|
|
1083
|
+
return W.RichTextPlugin = h, W;
|
|
1306
1084
|
}
|
|
1307
|
-
var
|
|
1308
|
-
function
|
|
1309
|
-
if (
|
|
1310
|
-
return
|
|
1311
|
-
|
|
1312
|
-
var
|
|
1313
|
-
function
|
|
1314
|
-
return
|
|
1315
|
-
}
|
|
1316
|
-
function
|
|
1317
|
-
let [
|
|
1318
|
-
return
|
|
1319
|
-
function
|
|
1320
|
-
let
|
|
1321
|
-
v(
|
|
1085
|
+
var re = {}, we;
|
|
1086
|
+
function $t() {
|
|
1087
|
+
if (we)
|
|
1088
|
+
return re;
|
|
1089
|
+
we = 1;
|
|
1090
|
+
var l = M(), s = Me(), g = q, C = Be(), d = Ie(), p = Ae, e = Ue(), t = Oe, n = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? g.useLayoutEffect : g.useEffect;
|
|
1091
|
+
function o(a) {
|
|
1092
|
+
return a.getEditorState().read(C.$canShowPlaceholderCurry(a.isComposing()));
|
|
1093
|
+
}
|
|
1094
|
+
function r(a) {
|
|
1095
|
+
let [h, v] = g.useState(() => o(a));
|
|
1096
|
+
return n(() => {
|
|
1097
|
+
function E() {
|
|
1098
|
+
let $ = o(a);
|
|
1099
|
+
v($);
|
|
1322
1100
|
}
|
|
1323
|
-
return
|
|
1324
|
-
|
|
1325
|
-
}),
|
|
1326
|
-
|
|
1101
|
+
return E(), d.mergeRegister(a.registerUpdateListener(() => {
|
|
1102
|
+
E();
|
|
1103
|
+
}), a.registerEditableListener(() => {
|
|
1104
|
+
E();
|
|
1327
1105
|
}));
|
|
1328
|
-
}, [
|
|
1106
|
+
}, [a]), h;
|
|
1329
1107
|
}
|
|
1330
|
-
function
|
|
1331
|
-
let [v,
|
|
1332
|
-
return
|
|
1333
|
-
|
|
1334
|
-
|
|
1108
|
+
function i(a, h) {
|
|
1109
|
+
let [v, E] = g.useState(() => a.getDecorators());
|
|
1110
|
+
return n(() => a.registerDecoratorListener(($) => {
|
|
1111
|
+
p.flushSync(() => {
|
|
1112
|
+
E($);
|
|
1335
1113
|
});
|
|
1336
|
-
}), [
|
|
1337
|
-
|
|
1338
|
-
}, [
|
|
1339
|
-
let
|
|
1340
|
-
for (let
|
|
1341
|
-
let
|
|
1342
|
-
|
|
1114
|
+
}), [a]), g.useEffect(() => {
|
|
1115
|
+
E(a.getDecorators());
|
|
1116
|
+
}, [a]), g.useMemo(() => {
|
|
1117
|
+
let $ = [], c = Object.keys(v);
|
|
1118
|
+
for (let m = 0; m < c.length; m++) {
|
|
1119
|
+
let x = c[m], y = g.createElement(h, { onError: (L) => a._onError(L) }, g.createElement(g.Suspense, { fallback: null }, v[x])), T = a.getElementByKey(x);
|
|
1120
|
+
T !== null && $.push(p.createPortal(y, T, x));
|
|
1343
1121
|
}
|
|
1344
|
-
return
|
|
1345
|
-
}, [
|
|
1346
|
-
}
|
|
1347
|
-
function
|
|
1348
|
-
|
|
1349
|
-
}
|
|
1350
|
-
function
|
|
1351
|
-
var [
|
|
1352
|
-
|
|
1353
|
-
let v =
|
|
1354
|
-
return
|
|
1355
|
-
}
|
|
1356
|
-
return
|
|
1357
|
-
let [
|
|
1358
|
-
return v =
|
|
1359
|
-
},
|
|
1122
|
+
return $;
|
|
1123
|
+
}, [h, v, a]);
|
|
1124
|
+
}
|
|
1125
|
+
function u(a) {
|
|
1126
|
+
n(() => d.mergeRegister(t.registerRichText(a), e.registerDragonSupport(a)), [a]);
|
|
1127
|
+
}
|
|
1128
|
+
function f({ content: a }) {
|
|
1129
|
+
var [h] = l.useLexicalComposerContext();
|
|
1130
|
+
h = r(h);
|
|
1131
|
+
let v = s();
|
|
1132
|
+
return h ? typeof a == "function" ? a(v) : a : null;
|
|
1133
|
+
}
|
|
1134
|
+
return re.RichTextPlugin = function({ contentEditable: a, placeholder: h, ErrorBoundary: v }) {
|
|
1135
|
+
let [E] = l.useLexicalComposerContext();
|
|
1136
|
+
return v = i(E, v), u(E), g.createElement(g.Fragment, null, a, g.createElement(f, { content: h }), v);
|
|
1137
|
+
}, re;
|
|
1360
1138
|
}
|
|
1361
|
-
const
|
|
1362
|
-
var
|
|
1363
|
-
function
|
|
1364
|
-
if (
|
|
1365
|
-
return
|
|
1366
|
-
|
|
1367
|
-
var
|
|
1368
|
-
function
|
|
1369
|
-
return
|
|
1370
|
-
for (var
|
|
1371
|
-
var
|
|
1372
|
-
for (var
|
|
1373
|
-
Object.prototype.hasOwnProperty.call(
|
|
1139
|
+
const wt = process.env.NODE_ENV === "development" ? Nt() : $t();
|
|
1140
|
+
var St = wt, ne = {}, Se;
|
|
1141
|
+
function _t() {
|
|
1142
|
+
if (Se)
|
|
1143
|
+
return ne;
|
|
1144
|
+
Se = 1;
|
|
1145
|
+
var l = M(), s = q;
|
|
1146
|
+
function g() {
|
|
1147
|
+
return g = Object.assign ? Object.assign.bind() : function(t) {
|
|
1148
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
1149
|
+
var o = arguments[n];
|
|
1150
|
+
for (var r in o)
|
|
1151
|
+
Object.prototype.hasOwnProperty.call(o, r) && (t[r] = o[r]);
|
|
1374
1152
|
}
|
|
1375
|
-
return
|
|
1376
|
-
},
|
|
1377
|
-
}
|
|
1378
|
-
var
|
|
1379
|
-
function
|
|
1380
|
-
ariaActiveDescendant:
|
|
1381
|
-
ariaAutoComplete:
|
|
1382
|
-
ariaControls:
|
|
1383
|
-
ariaDescribedBy:
|
|
1384
|
-
ariaExpanded:
|
|
1385
|
-
ariaLabel:
|
|
1386
|
-
ariaLabelledBy:
|
|
1387
|
-
ariaMultiline:
|
|
1388
|
-
ariaOwns:
|
|
1153
|
+
return t;
|
|
1154
|
+
}, g.apply(this, arguments);
|
|
1155
|
+
}
|
|
1156
|
+
var p = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? s.useLayoutEffect : s.useEffect;
|
|
1157
|
+
function e({
|
|
1158
|
+
ariaActiveDescendant: t,
|
|
1159
|
+
ariaAutoComplete: n,
|
|
1160
|
+
ariaControls: o,
|
|
1161
|
+
ariaDescribedBy: r,
|
|
1162
|
+
ariaExpanded: i,
|
|
1163
|
+
ariaLabel: u,
|
|
1164
|
+
ariaLabelledBy: f,
|
|
1165
|
+
ariaMultiline: a,
|
|
1166
|
+
ariaOwns: h,
|
|
1389
1167
|
ariaRequired: v,
|
|
1390
|
-
autoCapitalize:
|
|
1391
|
-
className:
|
|
1392
|
-
id:
|
|
1393
|
-
role:
|
|
1394
|
-
spellCheck:
|
|
1395
|
-
style:
|
|
1396
|
-
tabIndex:
|
|
1397
|
-
"data-testid":
|
|
1398
|
-
...
|
|
1168
|
+
autoCapitalize: E,
|
|
1169
|
+
className: $,
|
|
1170
|
+
id: c,
|
|
1171
|
+
role: m = "textbox",
|
|
1172
|
+
spellCheck: x = !0,
|
|
1173
|
+
style: y,
|
|
1174
|
+
tabIndex: T,
|
|
1175
|
+
"data-testid": L,
|
|
1176
|
+
...w
|
|
1399
1177
|
}) {
|
|
1400
|
-
const [
|
|
1401
|
-
|
|
1402
|
-
}, [
|
|
1403
|
-
return
|
|
1404
|
-
|
|
1405
|
-
})), [
|
|
1406
|
-
"aria-activedescendant":
|
|
1407
|
-
"aria-autocomplete":
|
|
1408
|
-
"aria-controls":
|
|
1409
|
-
"aria-describedby":
|
|
1410
|
-
"aria-expanded":
|
|
1411
|
-
"aria-label":
|
|
1412
|
-
"aria-labelledby":
|
|
1413
|
-
"aria-multiline":
|
|
1414
|
-
"aria-owns":
|
|
1415
|
-
"aria-readonly":
|
|
1178
|
+
const [b] = l.useLexicalComposerContext(), [N, S] = s.useState(!1), P = s.useCallback((D) => {
|
|
1179
|
+
b.setRootElement(D);
|
|
1180
|
+
}, [b]);
|
|
1181
|
+
return p(() => (S(b.isEditable()), b.registerEditableListener((D) => {
|
|
1182
|
+
S(D);
|
|
1183
|
+
})), [b]), /* @__PURE__ */ s.createElement("div", g({}, w, {
|
|
1184
|
+
"aria-activedescendant": N ? t : void 0,
|
|
1185
|
+
"aria-autocomplete": N ? n : "none",
|
|
1186
|
+
"aria-controls": N ? o : void 0,
|
|
1187
|
+
"aria-describedby": r,
|
|
1188
|
+
"aria-expanded": N && m === "combobox" ? !!i : void 0,
|
|
1189
|
+
"aria-label": u,
|
|
1190
|
+
"aria-labelledby": f,
|
|
1191
|
+
"aria-multiline": a,
|
|
1192
|
+
"aria-owns": N ? h : void 0,
|
|
1193
|
+
"aria-readonly": N ? void 0 : !0,
|
|
1416
1194
|
"aria-required": v,
|
|
1417
|
-
autoCapitalize:
|
|
1418
|
-
className:
|
|
1419
|
-
contentEditable:
|
|
1420
|
-
"data-testid":
|
|
1421
|
-
id:
|
|
1422
|
-
ref:
|
|
1423
|
-
role:
|
|
1424
|
-
spellCheck:
|
|
1425
|
-
style:
|
|
1426
|
-
tabIndex:
|
|
1195
|
+
autoCapitalize: E,
|
|
1196
|
+
className: $,
|
|
1197
|
+
contentEditable: N,
|
|
1198
|
+
"data-testid": L,
|
|
1199
|
+
id: c,
|
|
1200
|
+
ref: P,
|
|
1201
|
+
role: m,
|
|
1202
|
+
spellCheck: x,
|
|
1203
|
+
style: y,
|
|
1204
|
+
tabIndex: T
|
|
1427
1205
|
}));
|
|
1428
1206
|
}
|
|
1429
|
-
return
|
|
1207
|
+
return ne.ContentEditable = e, ne;
|
|
1430
1208
|
}
|
|
1431
|
-
var
|
|
1432
|
-
function
|
|
1433
|
-
if (
|
|
1434
|
-
return
|
|
1435
|
-
|
|
1436
|
-
var
|
|
1437
|
-
function
|
|
1438
|
-
return
|
|
1439
|
-
for (var
|
|
1440
|
-
var
|
|
1441
|
-
for (
|
|
1442
|
-
Object.prototype.hasOwnProperty.call(
|
|
1209
|
+
var oe = {}, _e;
|
|
1210
|
+
function Rt() {
|
|
1211
|
+
if (_e)
|
|
1212
|
+
return oe;
|
|
1213
|
+
_e = 1;
|
|
1214
|
+
var l = M(), s = q;
|
|
1215
|
+
function g() {
|
|
1216
|
+
return g = Object.assign ? Object.assign.bind() : function(d) {
|
|
1217
|
+
for (var p = 1; p < arguments.length; p++) {
|
|
1218
|
+
var e = arguments[p], t;
|
|
1219
|
+
for (t in e)
|
|
1220
|
+
Object.prototype.hasOwnProperty.call(e, t) && (d[t] = e[t]);
|
|
1443
1221
|
}
|
|
1444
|
-
return
|
|
1445
|
-
},
|
|
1446
|
-
}
|
|
1447
|
-
var
|
|
1448
|
-
return
|
|
1449
|
-
let [
|
|
1450
|
-
|
|
1451
|
-
}, [
|
|
1452
|
-
return
|
|
1453
|
-
|
|
1454
|
-
})), [
|
|
1222
|
+
return d;
|
|
1223
|
+
}, g.apply(this, arguments);
|
|
1224
|
+
}
|
|
1225
|
+
var C = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? s.useLayoutEffect : s.useEffect;
|
|
1226
|
+
return oe.ContentEditable = function({ ariaActiveDescendant: d, ariaAutoComplete: p, ariaControls: e, ariaDescribedBy: t, ariaExpanded: n, ariaLabel: o, ariaLabelledBy: r, ariaMultiline: i, ariaOwns: u, ariaRequired: f, autoCapitalize: a, className: h, id: v, role: E = "textbox", spellCheck: $ = !0, style: c, tabIndex: m, "data-testid": x, ...y }) {
|
|
1227
|
+
let [T] = l.useLexicalComposerContext(), [L, w] = s.useState(!1), b = s.useCallback((N) => {
|
|
1228
|
+
T.setRootElement(N);
|
|
1229
|
+
}, [T]);
|
|
1230
|
+
return C(() => (w(T.isEditable()), T.registerEditableListener((N) => {
|
|
1231
|
+
w(N);
|
|
1232
|
+
})), [T]), s.createElement(
|
|
1455
1233
|
"div",
|
|
1456
|
-
|
|
1234
|
+
g({}, y, { "aria-activedescendant": L ? d : void 0, "aria-autocomplete": L ? p : "none", "aria-controls": L ? e : void 0, "aria-describedby": t, "aria-expanded": L && E === "combobox" ? !!n : void 0, "aria-label": o, "aria-labelledby": r, "aria-multiline": i, "aria-owns": L ? u : void 0, "aria-readonly": L ? void 0 : !0, "aria-required": f, autoCapitalize: a, className: h, contentEditable: L, "data-testid": x, id: v, ref: b, role: E, spellCheck: $, style: c, tabIndex: m })
|
|
1457
1235
|
);
|
|
1458
|
-
},
|
|
1236
|
+
}, oe;
|
|
1459
1237
|
}
|
|
1460
|
-
const
|
|
1461
|
-
var
|
|
1462
|
-
function
|
|
1463
|
-
if (
|
|
1464
|
-
return
|
|
1465
|
-
|
|
1466
|
-
var
|
|
1467
|
-
function
|
|
1468
|
-
return
|
|
1469
|
-
return
|
|
1470
|
-
},
|
|
1471
|
-
}
|
|
1472
|
-
function
|
|
1473
|
-
|
|
1474
|
-
}
|
|
1475
|
-
var
|
|
1476
|
-
return
|
|
1477
|
-
return !Object.is(
|
|
1238
|
+
const Pt = process.env.NODE_ENV === "development" ? _t() : Rt();
|
|
1239
|
+
var Dt = Pt, ie, Re;
|
|
1240
|
+
function qt() {
|
|
1241
|
+
if (Re)
|
|
1242
|
+
return ie;
|
|
1243
|
+
Re = 1;
|
|
1244
|
+
var l = q;
|
|
1245
|
+
function s(t, n) {
|
|
1246
|
+
return s = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
|
|
1247
|
+
return r.__proto__ = i, r;
|
|
1248
|
+
}, s(t, n);
|
|
1249
|
+
}
|
|
1250
|
+
function g(t, n) {
|
|
1251
|
+
t.prototype = Object.create(n.prototype), t.prototype.constructor = t, s(t, n);
|
|
1252
|
+
}
|
|
1253
|
+
var C = function(n, o) {
|
|
1254
|
+
return n === void 0 && (n = []), o === void 0 && (o = []), n.length !== o.length || n.some(function(r, i) {
|
|
1255
|
+
return !Object.is(r, o[i]);
|
|
1478
1256
|
});
|
|
1479
|
-
},
|
|
1257
|
+
}, d = {
|
|
1480
1258
|
error: null
|
|
1481
|
-
},
|
|
1482
|
-
|
|
1483
|
-
function
|
|
1484
|
-
for (var
|
|
1485
|
-
|
|
1486
|
-
return
|
|
1487
|
-
for (var
|
|
1488
|
-
v[
|
|
1489
|
-
|
|
1490
|
-
},
|
|
1259
|
+
}, p = /* @__PURE__ */ function(t) {
|
|
1260
|
+
g(n, t);
|
|
1261
|
+
function n() {
|
|
1262
|
+
for (var r, i = arguments.length, u = new Array(i), f = 0; f < i; f++)
|
|
1263
|
+
u[f] = arguments[f];
|
|
1264
|
+
return r = t.call.apply(t, [this].concat(u)) || this, r.state = d, r.resetErrorBoundary = function() {
|
|
1265
|
+
for (var a, h = arguments.length, v = new Array(h), E = 0; E < h; E++)
|
|
1266
|
+
v[E] = arguments[E];
|
|
1267
|
+
r.props.onReset == null || (a = r.props).onReset.apply(a, v), r.reset();
|
|
1268
|
+
}, r;
|
|
1491
1269
|
}
|
|
1492
|
-
|
|
1270
|
+
n.getDerivedStateFromError = function(i) {
|
|
1493
1271
|
return {
|
|
1494
|
-
error:
|
|
1272
|
+
error: i
|
|
1495
1273
|
};
|
|
1496
1274
|
};
|
|
1497
|
-
var
|
|
1498
|
-
return
|
|
1499
|
-
this.setState(
|
|
1500
|
-
},
|
|
1501
|
-
var
|
|
1502
|
-
(
|
|
1503
|
-
},
|
|
1504
|
-
var
|
|
1505
|
-
if (
|
|
1506
|
-
var
|
|
1507
|
-
(
|
|
1275
|
+
var o = n.prototype;
|
|
1276
|
+
return o.reset = function() {
|
|
1277
|
+
this.setState(d);
|
|
1278
|
+
}, o.componentDidCatch = function(i, u) {
|
|
1279
|
+
var f, a;
|
|
1280
|
+
(f = (a = this.props).onError) == null || f.call(a, i, u);
|
|
1281
|
+
}, o.componentDidUpdate = function(i, u) {
|
|
1282
|
+
var f = this.state.error, a = this.props.resetKeys;
|
|
1283
|
+
if (f !== null && u.error !== null && C(i.resetKeys, a)) {
|
|
1284
|
+
var h, v;
|
|
1285
|
+
(h = (v = this.props).onResetKeysChange) == null || h.call(v, i.resetKeys, a), this.reset();
|
|
1508
1286
|
}
|
|
1509
|
-
},
|
|
1510
|
-
var
|
|
1511
|
-
if (
|
|
1287
|
+
}, o.render = function() {
|
|
1288
|
+
var i = this.state.error, u = this.props, f = u.fallbackRender, a = u.FallbackComponent, h = u.fallback;
|
|
1289
|
+
if (i !== null) {
|
|
1512
1290
|
var v = {
|
|
1513
|
-
error:
|
|
1291
|
+
error: i,
|
|
1514
1292
|
resetErrorBoundary: this.resetErrorBoundary
|
|
1515
1293
|
};
|
|
1516
|
-
if (/* @__PURE__ */
|
|
1517
|
-
return
|
|
1518
|
-
if (typeof
|
|
1519
|
-
return
|
|
1520
|
-
if (
|
|
1521
|
-
return /* @__PURE__ */
|
|
1294
|
+
if (/* @__PURE__ */ l.isValidElement(h))
|
|
1295
|
+
return h;
|
|
1296
|
+
if (typeof f == "function")
|
|
1297
|
+
return f(v);
|
|
1298
|
+
if (a)
|
|
1299
|
+
return /* @__PURE__ */ l.createElement(a, v);
|
|
1522
1300
|
throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
|
|
1523
1301
|
}
|
|
1524
1302
|
return this.props.children;
|
|
1525
|
-
},
|
|
1526
|
-
}(
|
|
1527
|
-
function
|
|
1528
|
-
children:
|
|
1529
|
-
onError:
|
|
1303
|
+
}, n;
|
|
1304
|
+
}(l.Component);
|
|
1305
|
+
function e({
|
|
1306
|
+
children: t,
|
|
1307
|
+
onError: n
|
|
1530
1308
|
}) {
|
|
1531
|
-
return /* @__PURE__ */
|
|
1532
|
-
fallback: /* @__PURE__ */
|
|
1309
|
+
return /* @__PURE__ */ l.createElement(p, {
|
|
1310
|
+
fallback: /* @__PURE__ */ l.createElement("div", {
|
|
1533
1311
|
style: {
|
|
1534
1312
|
border: "1px solid #f00",
|
|
1535
1313
|
color: "#f00",
|
|
1536
1314
|
padding: "8px"
|
|
1537
1315
|
}
|
|
1538
1316
|
}, "An error was thrown."),
|
|
1539
|
-
onError:
|
|
1540
|
-
},
|
|
1317
|
+
onError: n
|
|
1318
|
+
}, t);
|
|
1541
1319
|
}
|
|
1542
|
-
return
|
|
1320
|
+
return ie = e, ie;
|
|
1543
1321
|
}
|
|
1544
|
-
var
|
|
1545
|
-
function
|
|
1546
|
-
if (
|
|
1547
|
-
return
|
|
1548
|
-
|
|
1549
|
-
var
|
|
1550
|
-
function
|
|
1551
|
-
return
|
|
1552
|
-
return
|
|
1553
|
-
},
|
|
1554
|
-
}
|
|
1555
|
-
function
|
|
1556
|
-
|
|
1557
|
-
}
|
|
1558
|
-
function
|
|
1559
|
-
return
|
|
1560
|
-
return !Object.is(
|
|
1322
|
+
var se, Pe;
|
|
1323
|
+
function Ot() {
|
|
1324
|
+
if (Pe)
|
|
1325
|
+
return se;
|
|
1326
|
+
Pe = 1;
|
|
1327
|
+
var l = q;
|
|
1328
|
+
function s(e, t) {
|
|
1329
|
+
return s = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, o) {
|
|
1330
|
+
return n.__proto__ = o, n;
|
|
1331
|
+
}, s(e, t);
|
|
1332
|
+
}
|
|
1333
|
+
function g(e, t) {
|
|
1334
|
+
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, s(e, t);
|
|
1335
|
+
}
|
|
1336
|
+
function C(e, t) {
|
|
1337
|
+
return e === void 0 && (e = []), t === void 0 && (t = []), e.length !== t.length || e.some(function(n, o) {
|
|
1338
|
+
return !Object.is(n, t[o]);
|
|
1561
1339
|
});
|
|
1562
1340
|
}
|
|
1563
|
-
var
|
|
1564
|
-
function
|
|
1565
|
-
for (var
|
|
1566
|
-
|
|
1567
|
-
return
|
|
1568
|
-
for (var
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
},
|
|
1341
|
+
var d = { error: null }, p = function(e) {
|
|
1342
|
+
function t() {
|
|
1343
|
+
for (var o, r = arguments.length, i = Array(r), u = 0; u < r; u++)
|
|
1344
|
+
i[u] = arguments[u];
|
|
1345
|
+
return o = e.call.apply(e, [this].concat(i)) || this, o.state = d, o.resetErrorBoundary = function() {
|
|
1346
|
+
for (var f, a = arguments.length, h = Array(a), v = 0; v < a; v++)
|
|
1347
|
+
h[v] = arguments[v];
|
|
1348
|
+
o.props.onReset == null || (f = o.props).onReset.apply(f, h), o.reset();
|
|
1349
|
+
}, o;
|
|
1572
1350
|
}
|
|
1573
|
-
|
|
1574
|
-
return { error:
|
|
1351
|
+
g(t, e), t.getDerivedStateFromError = function(o) {
|
|
1352
|
+
return { error: o };
|
|
1575
1353
|
};
|
|
1576
|
-
var
|
|
1577
|
-
return
|
|
1578
|
-
this.setState(
|
|
1579
|
-
},
|
|
1580
|
-
var
|
|
1581
|
-
(
|
|
1582
|
-
},
|
|
1583
|
-
var
|
|
1584
|
-
if (this.state.error !== null &&
|
|
1585
|
-
var
|
|
1586
|
-
(
|
|
1354
|
+
var n = t.prototype;
|
|
1355
|
+
return n.reset = function() {
|
|
1356
|
+
this.setState(d);
|
|
1357
|
+
}, n.componentDidCatch = function(o, r) {
|
|
1358
|
+
var i, u;
|
|
1359
|
+
(i = (u = this.props).onError) == null || i.call(u, o, r);
|
|
1360
|
+
}, n.componentDidUpdate = function(o, r) {
|
|
1361
|
+
var i = this.props.resetKeys;
|
|
1362
|
+
if (this.state.error !== null && r.error !== null && C(o.resetKeys, i)) {
|
|
1363
|
+
var u, f;
|
|
1364
|
+
(u = (f = this.props).onResetKeysChange) == null || u.call(f, o.resetKeys, i), this.reset();
|
|
1587
1365
|
}
|
|
1588
|
-
},
|
|
1589
|
-
var
|
|
1590
|
-
if (
|
|
1591
|
-
if (
|
|
1592
|
-
return
|
|
1593
|
-
if (typeof
|
|
1594
|
-
return
|
|
1595
|
-
if (
|
|
1596
|
-
return
|
|
1366
|
+
}, n.render = function() {
|
|
1367
|
+
var o = this.state.error, r = this.props, i = r.fallbackRender, u = r.FallbackComponent;
|
|
1368
|
+
if (r = r.fallback, o !== null) {
|
|
1369
|
+
if (o = { error: o, resetErrorBoundary: this.resetErrorBoundary }, l.isValidElement(r))
|
|
1370
|
+
return r;
|
|
1371
|
+
if (typeof i == "function")
|
|
1372
|
+
return i(o);
|
|
1373
|
+
if (u)
|
|
1374
|
+
return l.createElement(u, o);
|
|
1597
1375
|
throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
|
|
1598
1376
|
}
|
|
1599
1377
|
return this.props.children;
|
|
1600
|
-
},
|
|
1601
|
-
}(
|
|
1602
|
-
return
|
|
1603
|
-
return
|
|
1604
|
-
},
|
|
1378
|
+
}, t;
|
|
1379
|
+
}(l.Component);
|
|
1380
|
+
return se = function({ children: e, onError: t }) {
|
|
1381
|
+
return l.createElement(p, { fallback: l.createElement("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" } }, "An error was thrown."), onError: t }, e);
|
|
1382
|
+
}, se;
|
|
1605
1383
|
}
|
|
1606
|
-
const
|
|
1607
|
-
var
|
|
1608
|
-
const
|
|
1384
|
+
const Ft = process.env.NODE_ENV === "development" ? qt() : Ot();
|
|
1385
|
+
var kt = Ft;
|
|
1386
|
+
const At = U({
|
|
1609
1387
|
fontWeight: "bold"
|
|
1610
|
-
}),
|
|
1388
|
+
}), Mt = U({
|
|
1611
1389
|
fontStyle: "italic"
|
|
1612
|
-
}),
|
|
1390
|
+
}), Bt = U({
|
|
1613
1391
|
textDecoration: "underline"
|
|
1614
|
-
}),
|
|
1392
|
+
}), It = U({
|
|
1615
1393
|
listStyleType: "none"
|
|
1616
|
-
}),
|
|
1394
|
+
}), Ut = U({
|
|
1617
1395
|
borderLeft: "4px solid #ccc",
|
|
1618
1396
|
color: "#666",
|
|
1619
1397
|
fontStyle: "italic",
|
|
1620
1398
|
margin: "1.5em 10px",
|
|
1621
1399
|
padding: "0.5em 10px"
|
|
1622
|
-
}),
|
|
1623
|
-
quote:
|
|
1400
|
+
}), jt = {
|
|
1401
|
+
quote: Ut().className,
|
|
1624
1402
|
text: {
|
|
1625
|
-
bold:
|
|
1626
|
-
italic:
|
|
1627
|
-
underline:
|
|
1403
|
+
bold: At().className,
|
|
1404
|
+
italic: Mt().className,
|
|
1405
|
+
underline: Bt().className
|
|
1628
1406
|
},
|
|
1629
1407
|
list: {
|
|
1630
1408
|
nested: {
|
|
1631
|
-
listitem:
|
|
1409
|
+
listitem: It().className
|
|
1632
1410
|
}
|
|
1633
1411
|
}
|
|
1634
|
-
},
|
|
1635
|
-
const [
|
|
1636
|
-
|
|
1637
|
-
}, []),
|
|
1638
|
-
|
|
1639
|
-
|
|
1412
|
+
}, Vt = it(!1), zt = ({ onBlur: l }) => {
|
|
1413
|
+
const [s, g] = st(!1), C = lt(null), d = ae(() => {
|
|
1414
|
+
g(!0), C.current && window.clearTimeout(C.current);
|
|
1415
|
+
}, []), p = ae(() => {
|
|
1416
|
+
C.current = window.setTimeout(() => {
|
|
1417
|
+
g(!1), l == null || l();
|
|
1640
1418
|
}, 0);
|
|
1641
|
-
}, [
|
|
1419
|
+
}, [l]);
|
|
1642
1420
|
return {
|
|
1643
|
-
hasFocus:
|
|
1421
|
+
hasFocus: s,
|
|
1644
1422
|
attributes: {
|
|
1645
|
-
onFocus:
|
|
1646
|
-
onBlur:
|
|
1423
|
+
onFocus: d,
|
|
1424
|
+
onBlur: p
|
|
1647
1425
|
}
|
|
1648
1426
|
};
|
|
1649
|
-
},
|
|
1427
|
+
}, Ht = Fe("div", {
|
|
1650
1428
|
border: "1px solid $borderDarker",
|
|
1651
1429
|
borderRadius: "$md",
|
|
1652
1430
|
position: "relative",
|
|
@@ -1676,7 +1454,7 @@ const sn = oe({
|
|
|
1676
1454
|
}
|
|
1677
1455
|
}
|
|
1678
1456
|
]
|
|
1679
|
-
}),
|
|
1457
|
+
}), Kt = Fe(Dt.ContentEditable, {}, {
|
|
1680
1458
|
padding: "0 $4",
|
|
1681
1459
|
overflowY: "auto",
|
|
1682
1460
|
maxHeight: "30rem",
|
|
@@ -1700,55 +1478,55 @@ const sn = oe({
|
|
|
1700
1478
|
color: "$gray500"
|
|
1701
1479
|
}
|
|
1702
1480
|
}
|
|
1703
|
-
}),
|
|
1704
|
-
isLoading:
|
|
1705
|
-
}) => /* @__PURE__ */
|
|
1706
|
-
|
|
1481
|
+
}), Wt = ({
|
|
1482
|
+
isLoading: l
|
|
1483
|
+
}) => /* @__PURE__ */ O.jsx(
|
|
1484
|
+
ke,
|
|
1707
1485
|
{
|
|
1708
1486
|
css: {
|
|
1709
|
-
visibility:
|
|
1487
|
+
visibility: l ? "visible" : "hidden",
|
|
1710
1488
|
position: "absolute",
|
|
1711
1489
|
bottom: "1rem",
|
|
1712
1490
|
right: "1rem",
|
|
1713
1491
|
display: "flex"
|
|
1714
1492
|
},
|
|
1715
|
-
children: /* @__PURE__ */
|
|
1716
|
-
}
|
|
1717
|
-
),
|
|
1718
|
-
isLoading:
|
|
1719
|
-
children:
|
|
1720
|
-
placeholderText:
|
|
1721
|
-
nodes:
|
|
1722
|
-
plugins:
|
|
1723
|
-
toolbar:
|
|
1724
|
-
refs:
|
|
1493
|
+
children: /* @__PURE__ */ O.jsx(ot, {})
|
|
1494
|
+
}
|
|
1495
|
+
), ar = ({
|
|
1496
|
+
isLoading: l,
|
|
1497
|
+
children: s,
|
|
1498
|
+
placeholderText: g,
|
|
1499
|
+
nodes: C,
|
|
1500
|
+
plugins: d,
|
|
1501
|
+
toolbar: p,
|
|
1502
|
+
refs: e
|
|
1725
1503
|
}) => {
|
|
1726
|
-
const { hasFocus:
|
|
1727
|
-
return /* @__PURE__ */
|
|
1728
|
-
|
|
1504
|
+
const { hasFocus: t, attributes: n } = zt({});
|
|
1505
|
+
return /* @__PURE__ */ O.jsx(Vt.Provider, { value: t, children: /* @__PURE__ */ O.jsxs(
|
|
1506
|
+
xt.LexicalComposer,
|
|
1729
1507
|
{
|
|
1730
1508
|
initialConfig: {
|
|
1731
1509
|
namespace: "CommentEditor",
|
|
1732
|
-
onError: (
|
|
1733
|
-
console.error(
|
|
1510
|
+
onError: (o) => {
|
|
1511
|
+
console.error(o);
|
|
1734
1512
|
},
|
|
1735
|
-
theme:
|
|
1736
|
-
nodes:
|
|
1513
|
+
theme: jt,
|
|
1514
|
+
nodes: C,
|
|
1737
1515
|
editable: !0
|
|
1738
1516
|
},
|
|
1739
1517
|
children: [
|
|
1740
|
-
/* @__PURE__ */
|
|
1741
|
-
|
|
1518
|
+
/* @__PURE__ */ O.jsxs(
|
|
1519
|
+
Ht,
|
|
1742
1520
|
{
|
|
1743
|
-
ref:
|
|
1744
|
-
hasFocus:
|
|
1745
|
-
...
|
|
1521
|
+
ref: e ? nt(e) : void 0,
|
|
1522
|
+
hasFocus: t,
|
|
1523
|
+
...n,
|
|
1746
1524
|
children: [
|
|
1747
|
-
/* @__PURE__ */
|
|
1748
|
-
|
|
1525
|
+
/* @__PURE__ */ O.jsx(
|
|
1526
|
+
St.RichTextPlugin,
|
|
1749
1527
|
{
|
|
1750
|
-
contentEditable: /* @__PURE__ */
|
|
1751
|
-
|
|
1528
|
+
contentEditable: /* @__PURE__ */ O.jsx(
|
|
1529
|
+
Kt,
|
|
1752
1530
|
{
|
|
1753
1531
|
css: {
|
|
1754
1532
|
paddingTop: 16,
|
|
@@ -1756,8 +1534,8 @@ const sn = oe({
|
|
|
1756
1534
|
}
|
|
1757
1535
|
}
|
|
1758
1536
|
),
|
|
1759
|
-
placeholder:
|
|
1760
|
-
|
|
1537
|
+
placeholder: g ? /* @__PURE__ */ O.jsx(
|
|
1538
|
+
ke,
|
|
1761
1539
|
{
|
|
1762
1540
|
css: {
|
|
1763
1541
|
position: "absolute",
|
|
@@ -1767,26 +1545,26 @@ const sn = oe({
|
|
|
1767
1545
|
pointerEvents: "none",
|
|
1768
1546
|
fontSize: "$sm"
|
|
1769
1547
|
},
|
|
1770
|
-
children:
|
|
1548
|
+
children: g
|
|
1771
1549
|
}
|
|
1772
1550
|
) : null,
|
|
1773
|
-
ErrorBoundary:
|
|
1551
|
+
ErrorBoundary: kt
|
|
1774
1552
|
}
|
|
1775
1553
|
),
|
|
1776
|
-
|
|
1777
|
-
/* @__PURE__ */
|
|
1778
|
-
|
|
1554
|
+
d,
|
|
1555
|
+
/* @__PURE__ */ O.jsx(Wt, { isLoading: l }),
|
|
1556
|
+
p
|
|
1779
1557
|
]
|
|
1780
1558
|
}
|
|
1781
1559
|
),
|
|
1782
|
-
/* @__PURE__ */
|
|
1560
|
+
/* @__PURE__ */ O.jsx(O.Fragment, { children: s })
|
|
1783
1561
|
]
|
|
1784
1562
|
}
|
|
1785
1563
|
) });
|
|
1786
1564
|
};
|
|
1787
1565
|
export {
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1566
|
+
ar as RichTextEditor,
|
|
1567
|
+
lr as defaultNodes,
|
|
1568
|
+
ut as isJSON,
|
|
1569
|
+
sr as stateToHTML
|
|
1792
1570
|
};
|