fable-editor 1.2.1 → 1.2.3
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/LICENSE +20 -18
- package/README.md +226 -226
- package/dist/angular/LICENSE +20 -18
- package/dist/angular/README.md +226 -224
- package/dist/angular/core/editor.d.ts +10 -0
- package/dist/angular/core/i18n.d.ts +1 -0
- package/dist/angular/esm2022/core/editor.mjs +153 -82
- package/dist/angular/esm2022/core/i18n.mjs +3 -1
- package/dist/angular/fesm2022/fable-editor.mjs +154 -81
- package/dist/angular/fesm2022/fable-editor.mjs.map +1 -1
- package/dist/core/editor.css +34 -0
- package/dist/core/editor.d.ts +10 -0
- package/dist/core/editor.d.ts.map +1 -1
- package/dist/core/i18n.d.ts +1 -0
- package/dist/core/i18n.d.ts.map +1 -1
- package/dist/core/index.cjs +3 -3
- package/dist/core/index.mjs +486 -443
- package/dist/react/index.cjs +12 -12
- package/dist/react/index.mjs +489 -446
- package/package.json +113 -113
- package/style.css +34 -0
package/dist/react/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ce, { forwardRef as _e, useRef as z, useImperativeHandle as Fe, useEffect as ot } from "react";
|
|
2
2
|
var Et = { exports: {} }, J = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
@@ -9,17 +9,17 @@ var Et = { exports: {} }, J = {};
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
var
|
|
12
|
+
var Gt;
|
|
13
|
+
function $e() {
|
|
14
|
+
if (Gt) return J;
|
|
15
|
+
Gt = 1;
|
|
16
|
+
var p = ce, t = Symbol.for("react.element"), e = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, s = p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, n = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
17
|
function l(r, o, c) {
|
|
18
|
-
var d,
|
|
18
|
+
var d, u = {}, m = null, b = null;
|
|
19
19
|
c !== void 0 && (m = "" + c), o.key !== void 0 && (m = "" + o.key), o.ref !== void 0 && (b = o.ref);
|
|
20
|
-
for (d in o) i.call(o, d) && !n.hasOwnProperty(d) && (
|
|
21
|
-
if (r && r.defaultProps) for (d in o = r.defaultProps, o)
|
|
22
|
-
return { $$typeof: t, type: r, key: m, ref: b, props:
|
|
20
|
+
for (d in o) i.call(o, d) && !n.hasOwnProperty(d) && (u[d] = o[d]);
|
|
21
|
+
if (r && r.defaultProps) for (d in o = r.defaultProps, o) u[d] === void 0 && (u[d] = o[d]);
|
|
22
|
+
return { $$typeof: t, type: r, key: m, ref: b, props: u, _owner: s.current };
|
|
23
23
|
}
|
|
24
24
|
return J.Fragment = e, J.jsx = l, J.jsxs = l, J;
|
|
25
25
|
}
|
|
@@ -34,50 +34,50 @@ var tt = {};
|
|
|
34
34
|
* LICENSE file in the root directory of this source tree.
|
|
35
35
|
*/
|
|
36
36
|
var Kt;
|
|
37
|
-
function
|
|
37
|
+
function je() {
|
|
38
38
|
return Kt || (Kt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
39
|
-
var
|
|
39
|
+
var p = ce, t = Symbol.for("react.element"), e = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), n = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), r = Symbol.for("react.context"), o = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), u = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), b = Symbol.for("react.offscreen"), y = Symbol.iterator, g = "@@iterator";
|
|
40
40
|
function x(a) {
|
|
41
41
|
if (a === null || typeof a != "object")
|
|
42
42
|
return null;
|
|
43
43
|
var f = y && a[y] || a[g];
|
|
44
44
|
return typeof f == "function" ? f : null;
|
|
45
45
|
}
|
|
46
|
-
var w =
|
|
46
|
+
var w = p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
47
47
|
function E(a) {
|
|
48
48
|
{
|
|
49
49
|
for (var f = arguments.length, v = new Array(f > 1 ? f - 1 : 0), T = 1; T < f; T++)
|
|
50
50
|
v[T - 1] = arguments[T];
|
|
51
|
-
|
|
51
|
+
A("error", a, v);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function A(a, f, v) {
|
|
55
55
|
{
|
|
56
|
-
var T = w.ReactDebugCurrentFrame,
|
|
57
|
-
|
|
58
|
-
var
|
|
56
|
+
var T = w.ReactDebugCurrentFrame, L = T.getStackAddendum();
|
|
57
|
+
L !== "" && (f += "%s", v = v.concat([L]));
|
|
58
|
+
var I = v.map(function(M) {
|
|
59
59
|
return String(M);
|
|
60
60
|
});
|
|
61
|
-
|
|
61
|
+
I.unshift("Warning: " + f), Function.prototype.apply.call(console[a], console, I);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
var H = !1, $ = !1, O = !1, _ = !1, et = !1, Mt;
|
|
65
65
|
Mt = Symbol.for("react.module.reference");
|
|
66
|
-
function
|
|
67
|
-
return !!(typeof a == "string" || typeof a == "function" || a === i || a === n || et || a === s || a === c || a === d || _ || a === b || H || $ || O || typeof a == "object" && a !== null && (a.$$typeof === m || a.$$typeof ===
|
|
66
|
+
function de(a) {
|
|
67
|
+
return !!(typeof a == "string" || typeof a == "function" || a === i || a === n || et || a === s || a === c || a === d || _ || a === b || H || $ || O || typeof a == "object" && a !== null && (a.$$typeof === m || a.$$typeof === u || a.$$typeof === l || a.$$typeof === r || a.$$typeof === o || // This needs to include all possible module reference object
|
|
68
68
|
// types supported by any Flight configuration anywhere since
|
|
69
69
|
// we don't know which Flight build this will end up being used
|
|
70
70
|
// with.
|
|
71
71
|
a.$$typeof === Mt || a.getModuleId !== void 0));
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function ue(a, f, v) {
|
|
74
74
|
var T = a.displayName;
|
|
75
75
|
if (T)
|
|
76
76
|
return T;
|
|
77
|
-
var
|
|
78
|
-
return
|
|
77
|
+
var L = f.displayName || f.name || "";
|
|
78
|
+
return L !== "" ? v + "(" + L + ")" : v;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function kt(a) {
|
|
81
81
|
return a.displayName || "Context";
|
|
82
82
|
}
|
|
83
83
|
function W(a) {
|
|
@@ -105,19 +105,19 @@ function _e() {
|
|
|
105
105
|
switch (a.$$typeof) {
|
|
106
106
|
case r:
|
|
107
107
|
var f = a;
|
|
108
|
-
return
|
|
108
|
+
return kt(f) + ".Consumer";
|
|
109
109
|
case l:
|
|
110
110
|
var v = a;
|
|
111
|
-
return
|
|
111
|
+
return kt(v._context) + ".Provider";
|
|
112
112
|
case o:
|
|
113
|
-
return
|
|
114
|
-
case
|
|
113
|
+
return ue(a, a.render, "ForwardRef");
|
|
114
|
+
case u:
|
|
115
115
|
var T = a.displayName || null;
|
|
116
116
|
return T !== null ? T : W(a.type) || "Memo";
|
|
117
117
|
case m: {
|
|
118
|
-
var
|
|
118
|
+
var L = a, I = L._payload, M = L._init;
|
|
119
119
|
try {
|
|
120
|
-
return W(M(
|
|
120
|
+
return W(M(I));
|
|
121
121
|
} catch {
|
|
122
122
|
return null;
|
|
123
123
|
}
|
|
@@ -125,18 +125,18 @@ function _e() {
|
|
|
125
125
|
}
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
|
-
var V = Object.assign,
|
|
129
|
-
function
|
|
128
|
+
var V = Object.assign, G = 0, Lt, Ht, It, At, qt, Rt, Pt;
|
|
129
|
+
function Bt() {
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
function
|
|
131
|
+
Bt.__reactDisabledLog = !0;
|
|
132
|
+
function pe() {
|
|
133
133
|
{
|
|
134
|
-
if (
|
|
135
|
-
|
|
134
|
+
if (G === 0) {
|
|
135
|
+
Lt = console.log, Ht = console.info, It = console.warn, At = console.error, qt = console.group, Rt = console.groupCollapsed, Pt = console.groupEnd;
|
|
136
136
|
var a = {
|
|
137
137
|
configurable: !0,
|
|
138
138
|
enumerable: !0,
|
|
139
|
-
value:
|
|
139
|
+
value: Bt,
|
|
140
140
|
writable: !0
|
|
141
141
|
};
|
|
142
142
|
Object.defineProperties(console, {
|
|
@@ -149,12 +149,12 @@ function _e() {
|
|
|
149
149
|
groupEnd: a
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
G++;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function me() {
|
|
156
156
|
{
|
|
157
|
-
if (
|
|
157
|
+
if (G--, G === 0) {
|
|
158
158
|
var a = {
|
|
159
159
|
configurable: !0,
|
|
160
160
|
enumerable: !0,
|
|
@@ -162,16 +162,16 @@ function _e() {
|
|
|
162
162
|
};
|
|
163
163
|
Object.defineProperties(console, {
|
|
164
164
|
log: V({}, a, {
|
|
165
|
-
value:
|
|
165
|
+
value: Lt
|
|
166
166
|
}),
|
|
167
167
|
info: V({}, a, {
|
|
168
168
|
value: Ht
|
|
169
169
|
}),
|
|
170
170
|
warn: V({}, a, {
|
|
171
|
-
value:
|
|
171
|
+
value: It
|
|
172
172
|
}),
|
|
173
173
|
error: V({}, a, {
|
|
174
|
-
value:
|
|
174
|
+
value: At
|
|
175
175
|
}),
|
|
176
176
|
group: V({}, a, {
|
|
177
177
|
value: qt
|
|
@@ -184,17 +184,17 @@ function _e() {
|
|
|
184
184
|
})
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
|
|
187
|
+
G < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
var
|
|
190
|
+
var pt = w.ReactCurrentDispatcher, mt;
|
|
191
191
|
function it(a, f, v) {
|
|
192
192
|
{
|
|
193
193
|
if (mt === void 0)
|
|
194
194
|
try {
|
|
195
195
|
throw Error();
|
|
196
|
-
} catch (
|
|
197
|
-
var T =
|
|
196
|
+
} catch (L) {
|
|
197
|
+
var T = L.stack.trim().match(/\n( *(at )?)/);
|
|
198
198
|
mt = T && T[1] || "";
|
|
199
199
|
}
|
|
200
200
|
return `
|
|
@@ -203,10 +203,10 @@ function _e() {
|
|
|
203
203
|
}
|
|
204
204
|
var ft = !1, st;
|
|
205
205
|
{
|
|
206
|
-
var
|
|
207
|
-
st = new
|
|
206
|
+
var fe = typeof WeakMap == "function" ? WeakMap : Map;
|
|
207
|
+
st = new fe();
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function Nt(a, f) {
|
|
210
210
|
if (!a || ft)
|
|
211
211
|
return "";
|
|
212
212
|
{
|
|
@@ -216,10 +216,10 @@ function _e() {
|
|
|
216
216
|
}
|
|
217
217
|
var T;
|
|
218
218
|
ft = !0;
|
|
219
|
-
var
|
|
219
|
+
var L = Error.prepareStackTrace;
|
|
220
220
|
Error.prepareStackTrace = void 0;
|
|
221
|
-
var
|
|
222
|
-
|
|
221
|
+
var I;
|
|
222
|
+
I = pt.current, pt.current = null, pe();
|
|
223
223
|
try {
|
|
224
224
|
if (f) {
|
|
225
225
|
var M = function() {
|
|
@@ -232,37 +232,37 @@ function _e() {
|
|
|
232
232
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
233
233
|
try {
|
|
234
234
|
Reflect.construct(M, []);
|
|
235
|
-
} catch (
|
|
236
|
-
T =
|
|
235
|
+
} catch (D) {
|
|
236
|
+
T = D;
|
|
237
237
|
}
|
|
238
238
|
Reflect.construct(a, [], M);
|
|
239
239
|
} else {
|
|
240
240
|
try {
|
|
241
241
|
M.call();
|
|
242
|
-
} catch (
|
|
243
|
-
T =
|
|
242
|
+
} catch (D) {
|
|
243
|
+
T = D;
|
|
244
244
|
}
|
|
245
245
|
a.call(M.prototype);
|
|
246
246
|
}
|
|
247
247
|
} else {
|
|
248
248
|
try {
|
|
249
249
|
throw Error();
|
|
250
|
-
} catch (
|
|
251
|
-
T =
|
|
250
|
+
} catch (D) {
|
|
251
|
+
T = D;
|
|
252
252
|
}
|
|
253
253
|
a();
|
|
254
254
|
}
|
|
255
|
-
} catch (
|
|
256
|
-
if (
|
|
257
|
-
for (var S =
|
|
258
|
-
`),
|
|
259
|
-
`), R = S.length - 1, P =
|
|
255
|
+
} catch (D) {
|
|
256
|
+
if (D && T && typeof D.stack == "string") {
|
|
257
|
+
for (var S = D.stack.split(`
|
|
258
|
+
`), N = T.stack.split(`
|
|
259
|
+
`), R = S.length - 1, P = N.length - 1; R >= 1 && P >= 0 && S[R] !== N[P]; )
|
|
260
260
|
P--;
|
|
261
261
|
for (; R >= 1 && P >= 0; R--, P--)
|
|
262
|
-
if (S[R] !==
|
|
262
|
+
if (S[R] !== N[P]) {
|
|
263
263
|
if (R !== 1 || P !== 1)
|
|
264
264
|
do
|
|
265
|
-
if (R--, P--, P < 0 || S[R] !==
|
|
265
|
+
if (R--, P--, P < 0 || S[R] !== N[P]) {
|
|
266
266
|
var F = `
|
|
267
267
|
` + S[R].replace(" at new ", " at ");
|
|
268
268
|
return a.displayName && F.includes("<anonymous>") && (F = F.replace("<anonymous>", a.displayName)), typeof a == "function" && st.set(a, F), F;
|
|
@@ -272,15 +272,15 @@ function _e() {
|
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
} finally {
|
|
275
|
-
ft = !1,
|
|
275
|
+
ft = !1, pt.current = I, me(), Error.prepareStackTrace = L;
|
|
276
276
|
}
|
|
277
|
-
var
|
|
277
|
+
var Q = a ? a.displayName || a.name : "", U = Q ? it(Q) : "";
|
|
278
278
|
return typeof a == "function" && st.set(a, U), U;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
return
|
|
280
|
+
function ge(a, f, v) {
|
|
281
|
+
return Nt(a, !1);
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function ve(a) {
|
|
284
284
|
var f = a.prototype;
|
|
285
285
|
return !!(f && f.isReactComponent);
|
|
286
286
|
}
|
|
@@ -288,7 +288,7 @@ function _e() {
|
|
|
288
288
|
if (a == null)
|
|
289
289
|
return "";
|
|
290
290
|
if (typeof a == "function")
|
|
291
|
-
return
|
|
291
|
+
return Nt(a, ve(a));
|
|
292
292
|
if (typeof a == "string")
|
|
293
293
|
return it(a);
|
|
294
294
|
switch (a) {
|
|
@@ -300,20 +300,20 @@ function _e() {
|
|
|
300
300
|
if (typeof a == "object")
|
|
301
301
|
switch (a.$$typeof) {
|
|
302
302
|
case o:
|
|
303
|
-
return
|
|
304
|
-
case
|
|
303
|
+
return ge(a.render);
|
|
304
|
+
case u:
|
|
305
305
|
return nt(a.type, f, v);
|
|
306
306
|
case m: {
|
|
307
|
-
var T = a,
|
|
307
|
+
var T = a, L = T._payload, I = T._init;
|
|
308
308
|
try {
|
|
309
|
-
return nt(
|
|
309
|
+
return nt(I(L), f, v);
|
|
310
310
|
} catch {
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
return "";
|
|
315
315
|
}
|
|
316
|
-
var K = Object.prototype.hasOwnProperty,
|
|
316
|
+
var K = Object.prototype.hasOwnProperty, Dt = {}, Zt = w.ReactDebugCurrentFrame;
|
|
317
317
|
function lt(a) {
|
|
318
318
|
if (a) {
|
|
319
319
|
var f = a._owner, v = nt(a.type, a._source, f ? f.type : null);
|
|
@@ -321,36 +321,36 @@ function _e() {
|
|
|
321
321
|
} else
|
|
322
322
|
Zt.setExtraStackFrame(null);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function be(a, f, v, T, L) {
|
|
325
325
|
{
|
|
326
|
-
var
|
|
326
|
+
var I = Function.call.bind(K);
|
|
327
327
|
for (var M in a)
|
|
328
|
-
if (
|
|
328
|
+
if (I(a, M)) {
|
|
329
329
|
var S = void 0;
|
|
330
330
|
try {
|
|
331
331
|
if (typeof a[M] != "function") {
|
|
332
|
-
var
|
|
333
|
-
throw
|
|
332
|
+
var N = Error((T || "React class") + ": " + v + " type `" + M + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof a[M] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
333
|
+
throw N.name = "Invariant Violation", N;
|
|
334
334
|
}
|
|
335
335
|
S = a[M](f, M, T, v, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
336
336
|
} catch (R) {
|
|
337
337
|
S = R;
|
|
338
338
|
}
|
|
339
|
-
S && !(S instanceof Error) && (lt(
|
|
339
|
+
S && !(S instanceof Error) && (lt(L), E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", T || "React class", v, M, typeof S), lt(null)), S instanceof Error && !(S.message in Dt) && (Dt[S.message] = !0, lt(L), E("Failed %s type: %s", v, S.message), lt(null));
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
var
|
|
343
|
+
var ye = Array.isArray;
|
|
344
344
|
function gt(a) {
|
|
345
|
-
return
|
|
345
|
+
return ye(a);
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function xe(a) {
|
|
348
348
|
{
|
|
349
349
|
var f = typeof Symbol == "function" && Symbol.toStringTag, v = f && a[Symbol.toStringTag] || a.constructor.name || "Object";
|
|
350
350
|
return v;
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function Ce(a) {
|
|
354
354
|
try {
|
|
355
355
|
return Ot(a), !1;
|
|
356
356
|
} catch {
|
|
@@ -361,16 +361,16 @@ function _e() {
|
|
|
361
361
|
return "" + a;
|
|
362
362
|
}
|
|
363
363
|
function _t(a) {
|
|
364
|
-
if (
|
|
365
|
-
return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
364
|
+
if (Ce(a))
|
|
365
|
+
return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", xe(a)), Ot(a);
|
|
366
366
|
}
|
|
367
|
-
var Ft = w.ReactCurrentOwner,
|
|
367
|
+
var Ft = w.ReactCurrentOwner, we = {
|
|
368
368
|
key: !0,
|
|
369
369
|
ref: !0,
|
|
370
370
|
__self: !0,
|
|
371
371
|
__source: !0
|
|
372
372
|
}, $t, jt;
|
|
373
|
-
function
|
|
373
|
+
function Te(a) {
|
|
374
374
|
if (K.call(a, "ref")) {
|
|
375
375
|
var f = Object.getOwnPropertyDescriptor(a, "ref").get;
|
|
376
376
|
if (f && f.isReactWarning)
|
|
@@ -378,7 +378,7 @@ function _e() {
|
|
|
378
378
|
}
|
|
379
379
|
return a.ref !== void 0;
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function Ee(a) {
|
|
382
382
|
if (K.call(a, "key")) {
|
|
383
383
|
var f = Object.getOwnPropertyDescriptor(a, "key").get;
|
|
384
384
|
if (f && f.isReactWarning)
|
|
@@ -386,10 +386,10 @@ function _e() {
|
|
|
386
386
|
}
|
|
387
387
|
return a.key !== void 0;
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function Se(a, f) {
|
|
390
390
|
typeof a.ref == "string" && Ft.current;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function Me(a, f) {
|
|
393
393
|
{
|
|
394
394
|
var v = function() {
|
|
395
395
|
$t || ($t = !0, E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", f));
|
|
@@ -400,7 +400,7 @@ function _e() {
|
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function ke(a, f) {
|
|
404
404
|
{
|
|
405
405
|
var v = function() {
|
|
406
406
|
jt || (jt = !0, E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", f));
|
|
@@ -411,7 +411,7 @@ function _e() {
|
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
var
|
|
414
|
+
var Le = function(a, f, v, T, L, I, M) {
|
|
415
415
|
var S = {
|
|
416
416
|
// This tag allows us to uniquely identify this as a React Element
|
|
417
417
|
$$typeof: t,
|
|
@@ -421,7 +421,7 @@ function _e() {
|
|
|
421
421
|
ref: v,
|
|
422
422
|
props: M,
|
|
423
423
|
// Record the component responsible for creating this element.
|
|
424
|
-
_owner:
|
|
424
|
+
_owner: I
|
|
425
425
|
};
|
|
426
426
|
return S._store = {}, Object.defineProperty(S._store, "validated", {
|
|
427
427
|
configurable: !1,
|
|
@@ -437,25 +437,25 @@ function _e() {
|
|
|
437
437
|
configurable: !1,
|
|
438
438
|
enumerable: !1,
|
|
439
439
|
writable: !1,
|
|
440
|
-
value:
|
|
440
|
+
value: L
|
|
441
441
|
}), Object.freeze && (Object.freeze(S.props), Object.freeze(S)), S;
|
|
442
442
|
};
|
|
443
|
-
function
|
|
443
|
+
function He(a, f, v, T, L) {
|
|
444
444
|
{
|
|
445
|
-
var
|
|
446
|
-
v !== void 0 && (_t(v), S = "" + v),
|
|
447
|
-
for (
|
|
448
|
-
K.call(f,
|
|
445
|
+
var I, M = {}, S = null, N = null;
|
|
446
|
+
v !== void 0 && (_t(v), S = "" + v), Ee(f) && (_t(f.key), S = "" + f.key), Te(f) && (N = f.ref, Se(f, L));
|
|
447
|
+
for (I in f)
|
|
448
|
+
K.call(f, I) && !we.hasOwnProperty(I) && (M[I] = f[I]);
|
|
449
449
|
if (a && a.defaultProps) {
|
|
450
450
|
var R = a.defaultProps;
|
|
451
|
-
for (
|
|
452
|
-
M[
|
|
451
|
+
for (I in R)
|
|
452
|
+
M[I] === void 0 && (M[I] = R[I]);
|
|
453
453
|
}
|
|
454
|
-
if (S ||
|
|
454
|
+
if (S || N) {
|
|
455
455
|
var P = typeof a == "function" ? a.displayName || a.name || "Unknown" : a;
|
|
456
|
-
S &&
|
|
456
|
+
S && Me(M, P), N && ke(M, P);
|
|
457
457
|
}
|
|
458
|
-
return
|
|
458
|
+
return Le(a, S, N, L, T, Ft.current, M);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
var vt = w.ReactCurrentOwner, Wt = w.ReactDebugCurrentFrame;
|
|
@@ -483,11 +483,11 @@ Check the render method of \`` + a + "`.";
|
|
|
483
483
|
return "";
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
|
-
function
|
|
486
|
+
function Ie(a) {
|
|
487
487
|
return "";
|
|
488
488
|
}
|
|
489
489
|
var Ut = {};
|
|
490
|
-
function
|
|
490
|
+
function Ae(a) {
|
|
491
491
|
{
|
|
492
492
|
var f = Vt();
|
|
493
493
|
if (!f) {
|
|
@@ -504,7 +504,7 @@ Check the top-level render call using <` + v + ">.");
|
|
|
504
504
|
if (!a._store || a._store.validated || a.key != null)
|
|
505
505
|
return;
|
|
506
506
|
a._store.validated = !0;
|
|
507
|
-
var v =
|
|
507
|
+
var v = Ae(f);
|
|
508
508
|
if (Ut[v])
|
|
509
509
|
return;
|
|
510
510
|
Ut[v] = !0;
|
|
@@ -524,14 +524,14 @@ Check the top-level render call using <` + v + ">.");
|
|
|
524
524
|
else if (yt(a))
|
|
525
525
|
a._store && (a._store.validated = !0);
|
|
526
526
|
else if (a) {
|
|
527
|
-
var
|
|
528
|
-
if (typeof
|
|
529
|
-
for (var
|
|
527
|
+
var L = x(a);
|
|
528
|
+
if (typeof L == "function" && L !== a.entries)
|
|
529
|
+
for (var I = L.call(a), M; !(M = I.next()).done; )
|
|
530
530
|
yt(M.value) && zt(M.value, f);
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function qe(a) {
|
|
535
535
|
{
|
|
536
536
|
var f = a.type;
|
|
537
537
|
if (f == null || typeof f == "string")
|
|
@@ -541,22 +541,22 @@ Check the top-level render call using <` + v + ">.");
|
|
|
541
541
|
v = f.propTypes;
|
|
542
542
|
else if (typeof f == "object" && (f.$$typeof === o || // Note: Memo only checks outer props here.
|
|
543
543
|
// Inner props are checked in the reconciler.
|
|
544
|
-
f.$$typeof ===
|
|
544
|
+
f.$$typeof === u))
|
|
545
545
|
v = f.propTypes;
|
|
546
546
|
else
|
|
547
547
|
return;
|
|
548
548
|
if (v) {
|
|
549
549
|
var T = W(f);
|
|
550
|
-
|
|
550
|
+
be(v, a.props, "prop", T, a);
|
|
551
551
|
} else if (f.PropTypes !== void 0 && !bt) {
|
|
552
552
|
bt = !0;
|
|
553
|
-
var
|
|
554
|
-
E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",
|
|
553
|
+
var L = W(f);
|
|
554
|
+
E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", L || "Unknown");
|
|
555
555
|
}
|
|
556
556
|
typeof f.getDefaultProps == "function" && !f.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function Re(a) {
|
|
560
560
|
{
|
|
561
561
|
for (var f = Object.keys(a.props), v = 0; v < f.length; v++) {
|
|
562
562
|
var T = f[v];
|
|
@@ -569,18 +569,18 @@ Check the top-level render call using <` + v + ">.");
|
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
571
|
var Yt = {};
|
|
572
|
-
function
|
|
572
|
+
function Qt(a, f, v, T, L, I) {
|
|
573
573
|
{
|
|
574
|
-
var M =
|
|
574
|
+
var M = de(a);
|
|
575
575
|
if (!M) {
|
|
576
576
|
var S = "";
|
|
577
577
|
(a === void 0 || typeof a == "object" && a !== null && Object.keys(a).length === 0) && (S += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
578
|
-
var
|
|
579
|
-
|
|
578
|
+
var N = Ie();
|
|
579
|
+
N ? S += N : S += Vt();
|
|
580
580
|
var R;
|
|
581
581
|
a === null ? R = "null" : gt(a) ? R = "array" : a !== void 0 && a.$$typeof === t ? (R = "<" + (W(a.type) || "Unknown") + " />", S = " Did you accidentally export a JSX literal instead of a component?") : R = typeof a, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", R, S);
|
|
582
582
|
}
|
|
583
|
-
var P =
|
|
583
|
+
var P = He(a, f, v, L, I);
|
|
584
584
|
if (P == null)
|
|
585
585
|
return P;
|
|
586
586
|
if (M) {
|
|
@@ -588,8 +588,8 @@ Check the top-level render call using <` + v + ">.");
|
|
|
588
588
|
if (F !== void 0)
|
|
589
589
|
if (T)
|
|
590
590
|
if (gt(F)) {
|
|
591
|
-
for (var
|
|
592
|
-
Xt(F[
|
|
591
|
+
for (var Q = 0; Q < F.length; Q++)
|
|
592
|
+
Xt(F[Q], a);
|
|
593
593
|
Object.freeze && Object.freeze(F);
|
|
594
594
|
} else
|
|
595
595
|
E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
@@ -597,35 +597,35 @@ Check the top-level render call using <` + v + ">.");
|
|
|
597
597
|
Xt(F, a);
|
|
598
598
|
}
|
|
599
599
|
if (K.call(f, "key")) {
|
|
600
|
-
var U = W(a),
|
|
601
|
-
return
|
|
602
|
-
}), xt =
|
|
600
|
+
var U = W(a), D = Object.keys(f).filter(function(Oe) {
|
|
601
|
+
return Oe !== "key";
|
|
602
|
+
}), xt = D.length > 0 ? "{key: someKey, " + D.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
603
603
|
if (!Yt[U + xt]) {
|
|
604
|
-
var
|
|
604
|
+
var Ze = D.length > 0 ? "{" + D.join(": ..., ") + ": ...}" : "{}";
|
|
605
605
|
E(`A props object containing a "key" prop is being spread into JSX:
|
|
606
606
|
let props = %s;
|
|
607
607
|
<%s {...props} />
|
|
608
608
|
React keys must be passed directly to JSX without using spread:
|
|
609
609
|
let props = %s;
|
|
610
|
-
<%s key={someKey} {...props} />`, xt, U,
|
|
610
|
+
<%s key={someKey} {...props} />`, xt, U, Ze, U), Yt[U + xt] = !0;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
return a === i ?
|
|
613
|
+
return a === i ? Re(P) : qe(P), P;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
function
|
|
617
|
-
return
|
|
616
|
+
function Pe(a, f, v) {
|
|
617
|
+
return Qt(a, f, v, !0);
|
|
618
618
|
}
|
|
619
|
-
function
|
|
620
|
-
return
|
|
619
|
+
function Be(a, f, v) {
|
|
620
|
+
return Qt(a, f, v, !1);
|
|
621
621
|
}
|
|
622
|
-
var
|
|
623
|
-
tt.Fragment = i, tt.jsx =
|
|
622
|
+
var Ne = Be, De = Pe;
|
|
623
|
+
tt.Fragment = i, tt.jsx = Ne, tt.jsxs = De;
|
|
624
624
|
}()), tt;
|
|
625
625
|
}
|
|
626
|
-
process.env.NODE_ENV === "production" ? Et.exports =
|
|
627
|
-
var
|
|
628
|
-
const
|
|
626
|
+
process.env.NODE_ENV === "production" ? Et.exports = $e() : Et.exports = je();
|
|
627
|
+
var We = Et.exports;
|
|
628
|
+
const Ve = {
|
|
629
629
|
en: {
|
|
630
630
|
dir: "ltr",
|
|
631
631
|
file: "File",
|
|
@@ -680,6 +680,7 @@ const $e = {
|
|
|
680
680
|
aligncenter: "Align center",
|
|
681
681
|
alignright: "Align right",
|
|
682
682
|
alignjustify: "Justify",
|
|
683
|
+
align: "Align",
|
|
683
684
|
numlist: "Numbered list",
|
|
684
685
|
bullist: "Bullet list",
|
|
685
686
|
forecolor: "Text color",
|
|
@@ -871,6 +872,7 @@ const $e = {
|
|
|
871
872
|
aligncenter: "توسيط",
|
|
872
873
|
alignright: "محاذاة لليمين",
|
|
873
874
|
alignjustify: "ضبط",
|
|
875
|
+
align: "محاذاة",
|
|
874
876
|
numlist: "قائمة رقمية",
|
|
875
877
|
bullist: "قائمة نقطية",
|
|
876
878
|
forecolor: "لون النص",
|
|
@@ -1009,10 +1011,10 @@ const $e = {
|
|
|
1009
1011
|
emcat_flags: "أعلام"
|
|
1010
1012
|
}
|
|
1011
1013
|
};
|
|
1012
|
-
function Ct(
|
|
1013
|
-
return
|
|
1014
|
+
function Ct(p) {
|
|
1015
|
+
return Ve[p];
|
|
1014
1016
|
}
|
|
1015
|
-
const
|
|
1017
|
+
const Ue = "undo redo | preview print | importword revhistory | fontfamily fontsize | fontsizeincrease fontsizedecrease | bold italic underline strikethrough | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent | link blockquote code changecase lineheight wordspacing letterspacing | removeformat | blocks | ltr rtl | quickimage quickvideo quicktable codesample template charmap emoji | fullscreen sourcecode", ze = "file edit view insert format tools table help", Xe = [
|
|
1016
1018
|
["Andale Mono", "andale mono,times"],
|
|
1017
1019
|
["Arial", "arial,helvetica,sans-serif"],
|
|
1018
1020
|
["Arial Black", "arial black,avant garde"],
|
|
@@ -1032,7 +1034,7 @@ const je = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1032
1034
|
["Verdana", "verdana,geneva"],
|
|
1033
1035
|
["Webdings", "webdings"],
|
|
1034
1036
|
["Wingdings", "wingdings,zapf dingbats"]
|
|
1035
|
-
],
|
|
1037
|
+
], Ye = ["8px", "9px", "10px", "11px", "12px", "14px", "16px", "18px", "20px", "24px", "28px", "32px", "36px", "48px", "72px", "96px"], Qe = 1, Ge = 100, Jt = ["1", "1.15", "1.4", "1.5", "1.75", "2", "2.5", "3"], te = ["1px", "2px", "4px", "6px", "8px", "12px"], ee = ["0.5px", "1px", "1.5px", "2px", "3px", "4px"], ie = [
|
|
1036
1038
|
["plain", "Plain text"],
|
|
1037
1039
|
["html", "HTML/XML"],
|
|
1038
1040
|
["css", "CSS"],
|
|
@@ -1049,7 +1051,7 @@ const je = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1049
1051
|
["rust", "Rust"],
|
|
1050
1052
|
["sql", "SQL"],
|
|
1051
1053
|
["bash", "Bash/Shell"]
|
|
1052
|
-
],
|
|
1054
|
+
], se = [
|
|
1053
1055
|
["p", "para"],
|
|
1054
1056
|
["h1", "heading1"],
|
|
1055
1057
|
["h2", "heading2"],
|
|
@@ -2149,8 +2151,8 @@ const je = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
2149
2151
|
"🇲🇦"
|
|
2150
2152
|
]
|
|
2151
2153
|
}
|
|
2152
|
-
],
|
|
2153
|
-
'<path d="M10 6h10M10 12h10M10 18h10"/>' +
|
|
2154
|
+
], k = (p, t) => `<svg viewBox="${t || "0 0 24 24"}">${p}</svg>`, C = (p) => k(`<path class="f" d="${p}"/>`, "0 -960 960 960"), rt = (p, t = 7.5) => k(
|
|
2155
|
+
'<path d="M10 6h10M10 12h10M10 18h10"/>' + p.map(
|
|
2154
2156
|
(e, i) => `<text x="2.5" y="${8.4 + i * 6}" font-size="${t}" stroke="none" fill="#222f3e" font-family="Arial">${e}</text>`
|
|
2155
2157
|
).join("")
|
|
2156
2158
|
), h = {
|
|
@@ -2196,7 +2198,7 @@ const je = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
2196
2198
|
bullist: C(
|
|
2197
2199
|
"M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm-56.5-263.5Q120-687 120-720t23.5-56.5Q167-800 200-800t56.5 23.5Q280-753 280-720t-23.5 56.5Q233-640 200-640t-56.5-23.5Z"
|
|
2198
2200
|
),
|
|
2199
|
-
chev:
|
|
2201
|
+
chev: k('<path d="M2 3.5 6 7.5 10 3.5"/>', "0 0 12 11"),
|
|
2200
2202
|
backcolor: C(
|
|
2201
2203
|
"M440-80q-33 0-56.5-23.5T360-160v-160H240q-33 0-56.5-23.5T160-400v-280q0-66 47-113t113-47h480v440q0 33-23.5 56.5T720-320H600v160q0 33-23.5 56.5T520-80h-80ZM240-560h480v-200h-40v160h-80v-160h-40v80h-80v-80H320q-33 0-56.5 23.5T240-680v120Zm0 160h480v-80H240v80Zm0 0v-80 80Z"
|
|
2202
2204
|
),
|
|
@@ -2206,7 +2208,7 @@ const je = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
2206
2208
|
indent: C(
|
|
2207
2209
|
"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z"
|
|
2208
2210
|
),
|
|
2209
|
-
more:
|
|
2211
|
+
more: k(
|
|
2210
2212
|
'<circle class="f" cx="5" cy="12" r="1.7"/><circle class="f" cx="12" cy="12" r="1.7"/><circle class="f" cx="19" cy="12" r="1.7"/>'
|
|
2211
2213
|
),
|
|
2212
2214
|
image: C(
|
|
@@ -2218,17 +2220,17 @@ const je = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
2218
2220
|
tableic: C(
|
|
2219
2221
|
"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z"
|
|
2220
2222
|
),
|
|
2221
|
-
hric:
|
|
2223
|
+
hric: k('<path d="M4 12h16"/>'),
|
|
2222
2224
|
charic: C(
|
|
2223
2225
|
"M120-120v-120h200q-84-45-132-125t-48-175q0-142 99-241t241-99q142 0 241 99t99 241q0 95-48 175T640-240h200v120H520v-204q78-14 129-75t51-141q0-92-64-156t-156-64q-92 0-156 64t-64 156q0 80 51 141t129 75v204H120Z"
|
|
2224
2226
|
),
|
|
2225
|
-
dateic:
|
|
2227
|
+
dateic: k(
|
|
2226
2228
|
'<rect x="4" y="6" width="16" height="14" rx="1.5"/><path d="M4 10h16M8 4v4M16 4v4"/>'
|
|
2227
2229
|
),
|
|
2228
2230
|
pbic: C(
|
|
2229
2231
|
"M240-80q-33 0-56.5-23.5T160-160v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-80H240Zm-80-440v-280q0-33 23.5-56.5T240-880h320l240 240v120h-80v-80H520v-200H240v280h-80Zm200 160v-80h240v80H360Zm320 0v-80h240v80H680Zm-640 0v-80h240v80H40Zm440-160Zm0 240Z"
|
|
2230
2232
|
),
|
|
2231
|
-
nbspic:
|
|
2233
|
+
nbspic: k('<path d="M6 12v4h12v-4"/>'),
|
|
2232
2234
|
srcic: C(
|
|
2233
2235
|
"M240-280 40-480l200-200 56 56-143 144 143 144-56 56Zm178 132-76-24 200-640 76 24-200 640Zm302-132-56-56 143-144-143-144 56-56 200 200-200 200Z"
|
|
2234
2236
|
),
|
|
@@ -2256,11 +2258,11 @@ const je = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
2256
2258
|
subscriptic: C(
|
|
2257
2259
|
"M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z"
|
|
2258
2260
|
),
|
|
2259
|
-
newic:
|
|
2260
|
-
helpic:
|
|
2261
|
+
newic: k('<path d="M6 3h8l5 5v13H6z"/><path d="M14 3v5h5"/>'),
|
|
2262
|
+
helpic: k(
|
|
2261
2263
|
'<circle cx="12" cy="12" r="8.5"/><path d="M9.6 9.6a2.5 2.5 0 1 1 3.4 2.6c-.8.3-1 .9-1 1.8"/><circle class="f" cx="12" cy="16.6" r="1.1"/>'
|
|
2262
2264
|
),
|
|
2263
|
-
wcic:
|
|
2265
|
+
wcic: k('<path d="M4 6h16M4 10h16M4 14h9"/><path d="M15 17.5l2 2 3.6-4"/>'),
|
|
2264
2266
|
rowbefore: C(
|
|
2265
2267
|
"M200-160h560v-240H200v240Zm640 80H120v-720h160v80h-80v240h560v-240h-80v-80h160v720ZM480-480Zm0 80v-80 80Zm0 0Zm-40-240v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80Z"
|
|
2266
2268
|
),
|
|
@@ -2312,44 +2314,44 @@ const je = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
2312
2314
|
historyic: C(
|
|
2313
2315
|
"M480-120q-138 0-240.5-91.5T122-440h82q14 104 92.5 172T480-200q117 0 198.5-81.5T760-480q0-117-81.5-198.5T480-760q-69 0-129 32t-101 88h110v80H120v-240h80v94q51-64 124.5-99T480-840q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-480q0 75-28.5 140.5t-77 114q-48.5 48.5-114 77T480-120Zm112-192L440-464v-216h80v184l128 128-56 56Z"
|
|
2314
2316
|
),
|
|
2315
|
-
wordic:
|
|
2317
|
+
wordic: k(
|
|
2316
2318
|
'<path d="M6 3h8l5 5v13H6z"/><path d="M14 3v5h5"/><text x="8" y="17" font-size="8.5" stroke="none" fill="#222f3e" font-family="Arial" font-weight="bold">W</text>'
|
|
2317
2319
|
),
|
|
2318
2320
|
draftic: C(
|
|
2319
2321
|
"M480-160q-134 0-227-93t-93-227q0-134 93-227t227-93q69 0 132 28.5T720-690v-110h80v280H520v-80h168q-32-56-87.5-88T480-720q-100 0-170 70t-70 170q0 100 70 170t170 70q77 0 139-44t87-116h84q-28 106-114 173t-196 67Z"
|
|
2320
2322
|
),
|
|
2321
|
-
trash:
|
|
2323
|
+
trash: k(
|
|
2322
2324
|
'<path d="M5 7h14M10 7V5h4v2M7.5 7l1 13h7l1-13"/>'
|
|
2323
2325
|
),
|
|
2324
|
-
templateic:
|
|
2326
|
+
templateic: k(
|
|
2325
2327
|
'<rect x="4" y="4" width="16" height="16" rx="1.5"/><rect x="6.5" y="6.5" width="5" height="5" rx=".5"/><path d="M14 7.5h3.5M14 10h3.5M6.5 14h11M6.5 17h11"/>'
|
|
2326
2328
|
),
|
|
2327
|
-
tplleft:
|
|
2329
|
+
tplleft: k(
|
|
2328
2330
|
'<rect x="3" y="5" width="8" height="8" rx=".8"/><path d="M13.5 6.5H21M13.5 9.5H21M13.5 12.5H21M3 15.5h18M3 18.5h18"/>'
|
|
2329
2331
|
),
|
|
2330
|
-
tplright:
|
|
2332
|
+
tplright: k(
|
|
2331
2333
|
'<rect x="13" y="5" width="8" height="8" rx=".8"/><path d="M3 6.5h7.5M3 9.5h7.5M3 12.5h7.5M3 15.5h18M3 18.5h18"/>'
|
|
2332
2334
|
),
|
|
2333
|
-
tpltop:
|
|
2335
|
+
tpltop: k(
|
|
2334
2336
|
'<rect x="5" y="3" width="14" height="9" rx=".8"/><path d="M3 15h18M3 18h18M3 21h12"/>'
|
|
2335
2337
|
),
|
|
2336
|
-
tplcenter:
|
|
2338
|
+
tplcenter: k(
|
|
2337
2339
|
'<path d="M3 4h18M3 7h18M3 10h12"/><rect x="5" y="12.5" width="14" height="9" rx=".8"/>'
|
|
2338
2340
|
),
|
|
2339
|
-
rotateleft:
|
|
2341
|
+
rotateleft: k(
|
|
2340
2342
|
'<polyline points="1 4 1 10 7 10"/><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"/>'
|
|
2341
2343
|
),
|
|
2342
|
-
rotateright:
|
|
2344
|
+
rotateright: k(
|
|
2343
2345
|
'<polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/>'
|
|
2344
2346
|
),
|
|
2345
|
-
fliphorizontal:
|
|
2347
|
+
fliphorizontal: k(
|
|
2346
2348
|
'<path d="M12 3v18"/><path d="M7 8l-4 4 4 4"/><path d="M17 8l4 4-4 4"/>'
|
|
2347
2349
|
),
|
|
2348
|
-
flipvertical:
|
|
2350
|
+
flipvertical: k(
|
|
2349
2351
|
'<path d="M3 12h18"/><path d="M8 7l4-4 4 4"/><path d="M8 17l4 4 4-4"/>'
|
|
2350
2352
|
),
|
|
2351
|
-
check:
|
|
2352
|
-
palette:
|
|
2353
|
+
check: k('<path d="M5 12.5 9.5 17 19 7"/>'),
|
|
2354
|
+
palette: k(
|
|
2353
2355
|
'<path d="M12 3a9 9 0 1 0 0 18h1.2a2 2 0 0 0 2-2 2 2 0 0 1 2-2H18a3 3 0 0 0 3-3c0-6.1-4.5-11-9-11z"/><circle class="f" cx="7.8" cy="10.2" r="1.3"/><circle class="f" cx="11.6" cy="7.3" r="1.3"/><circle class="f" cx="15.8" cy="9.6" r="1.3"/><circle class="f" cx="9" cy="14.8" r="1.3"/>'
|
|
2354
2356
|
),
|
|
2355
2357
|
ul_circle: C(
|
|
@@ -2362,20 +2364,20 @@ const je = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
2362
2364
|
ol_roman: rt(["i", "ii", "iii"], 6.5),
|
|
2363
2365
|
ol_alphau: rt(["A", "B", "C"]),
|
|
2364
2366
|
ol_romanu: rt(["I", "II", "III"], 6.5),
|
|
2365
|
-
video:
|
|
2366
|
-
editic:
|
|
2367
|
-
letterspacing:
|
|
2367
|
+
video: k('<rect x="3" y="6" width="13" height="12" rx="1.5"/><path d="M16 10l5-3v10l-5-3z"/>'),
|
|
2368
|
+
editic: k('<path d="M4 20l1-4.5L15.5 5 19 8.5 8.5 19 4 20z"/><path d="M13.5 6.5l4 4"/>'),
|
|
2369
|
+
letterspacing: k(
|
|
2368
2370
|
'<text x="2.5" y="13" font-size="12" stroke="none" fill="#222f3e" font-family="Arial" font-weight="bold">A</text><text x="13" y="13" font-size="12" stroke="none" fill="#222f3e" font-family="Arial" font-weight="bold">B</text><path d="M7 18.5h10"/><path class="f" d="M7.5 18.5 4.5 16.6v3.8z"/><path class="f" d="M16.5 18.5l3-1.9v3.8z"/>'
|
|
2369
2371
|
),
|
|
2370
|
-
emojiic:
|
|
2372
|
+
emojiic: k(
|
|
2371
2373
|
'<circle cx="12" cy="12" r="8.5"/><path d="M8.6 14.3a4.6 4.6 0 0 0 6.8 0"/><path d="M9.2 9.6v.7M14.8 9.6v.7"/>'
|
|
2372
2374
|
),
|
|
2373
|
-
inlinecodeic:
|
|
2374
|
-
moverowup:
|
|
2375
|
-
moverowdown:
|
|
2376
|
-
movecolleft:
|
|
2377
|
-
movecolright:
|
|
2378
|
-
codesampleic:
|
|
2375
|
+
inlinecodeic: k('<path d="M8.5 8 4.5 12l4 4M15.5 8l4 4-4 4"/><path d="M13 6l-2 12"/>'),
|
|
2376
|
+
moverowup: k('<rect x="4" y="15.5" width="16" height="5" rx="1"/><path d="M12 12.5V4M8.5 7.5 12 4l3.5 3.5"/>'),
|
|
2377
|
+
moverowdown: k('<rect x="4" y="3.5" width="16" height="5" rx="1"/><path d="M12 11.5V20M8.5 16.5 12 20l3.5-3.5"/>'),
|
|
2378
|
+
movecolleft: k('<rect x="15.5" y="4" width="5" height="16" rx="1"/><path d="M12.5 12H4M7.5 8.5 4 12l3.5 3.5"/>'),
|
|
2379
|
+
movecolright: k('<rect x="3.5" y="4" width="5" height="16" rx="1"/><path d="M11.5 12H20M16.5 8.5 20 12l-3.5 3.5"/>'),
|
|
2380
|
+
codesampleic: k(
|
|
2379
2381
|
'<rect x="3.5" y="4" width="17" height="16" rx="2"/><path d="M3.5 8.5h17"/><path d="M9.5 12 7 14.25l2.5 2.25M14.5 12l2.5 2.25-2.5 2.25"/>'
|
|
2380
2382
|
)
|
|
2381
2383
|
}, ii = /* @__PURE__ */ new Set([
|
|
@@ -2476,7 +2478,7 @@ const je = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
2476
2478
|
"box-sizing",
|
|
2477
2479
|
"list-style-type",
|
|
2478
2480
|
"white-space"
|
|
2479
|
-
]),
|
|
2481
|
+
]), ne = {
|
|
2480
2482
|
"*": ["dir", "lang", "colspan", "rowspan"],
|
|
2481
2483
|
a: ["href", "target", "rel", "title"],
|
|
2482
2484
|
img: ["src", "alt", "width", "height", "title"],
|
|
@@ -2485,26 +2487,26 @@ const je = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
2485
2487
|
th: ["width", "valign"],
|
|
2486
2488
|
table: ["width", "cellpadding", "cellspacing"]
|
|
2487
2489
|
};
|
|
2488
|
-
function
|
|
2489
|
-
const t = {}, e =
|
|
2490
|
+
function ut(p) {
|
|
2491
|
+
const t = {}, e = p.getAttribute && p.getAttribute("style");
|
|
2490
2492
|
return e && e.split(";").forEach((i) => {
|
|
2491
2493
|
const s = i.indexOf(":");
|
|
2492
2494
|
s < 1 || (t[i.slice(0, s).trim().toLowerCase()] = i.slice(s + 1).trim());
|
|
2493
2495
|
}), t;
|
|
2494
2496
|
}
|
|
2495
|
-
function ni(
|
|
2496
|
-
return
|
|
2497
|
+
function ni(p) {
|
|
2498
|
+
return p.replace(/<!--\[if !supportLists\]-->([\s\S]*?)<!--\[endif\]-->/gi, "$1").replace(/<!--\[if !supportLists\]>([\s\S]*?)<!\[endif\]-->/gi, "$1").replace(/<!\[if !supportLists\]>([\s\S]*?)<!\[endif\]>/gi, "$1").replace(/<!--\[if [\s\S]*?<!\[endif\]-->/gi, "").replace(/<!--[\s\S]*?-->/g, "").replace(/<(script|style|xml|title)[\s\S]*?<\/\1>/gi, "").replace(/<\/?(meta|link)[^>]*>/gi, "").replace(/<\?xml[\s\S]*?\?>/gi, "").replace(/<\/?(o|v|w|m|st1):[^>]*>/gi, "");
|
|
2497
2499
|
}
|
|
2498
|
-
function li(
|
|
2499
|
-
return /^[0-9]+[\.\)،]/.test(
|
|
2500
|
+
function li(p) {
|
|
2501
|
+
return /^[0-9]+[\.\)،]/.test(p) ? { ordered: !0 } : /^[٠-٩۰-۹]+/.test(p) ? { ordered: !0, style: "arabic-indic" } : /^[ivxlc]{2,}[\.\)]/.test(p) ? { ordered: !0, style: "lower-roman" } : /^[IVXLC]{2,}[\.\)]/.test(p) ? { ordered: !0, style: "upper-roman" } : /^[a-z][\.\)]/.test(p) ? { ordered: !0, style: "lower-alpha" } : /^[A-Z][\.\)]/.test(p) ? { ordered: !0, style: "upper-alpha" } : /^[ء-ي][\.\)،-]/.test(p) ? { ordered: !0, style: "arabic-indic" } : { ordered: !1 };
|
|
2500
2502
|
}
|
|
2501
|
-
function oi(
|
|
2503
|
+
function oi(p) {
|
|
2502
2504
|
const t = (s) => {
|
|
2503
2505
|
const n = (s.getAttribute("style") || "") + " " + (s.className || "");
|
|
2504
2506
|
return /mso-list\s*:(?!\s*ignore)/i.test(n) || /MsoListParagraph/i.test(n);
|
|
2505
2507
|
}, e = [];
|
|
2506
2508
|
let i = null;
|
|
2507
|
-
Array.from(
|
|
2509
|
+
Array.from(p.body.querySelectorAll("p")).forEach((s) => {
|
|
2508
2510
|
if (!t(s)) {
|
|
2509
2511
|
i = null;
|
|
2510
2512
|
return;
|
|
@@ -2514,13 +2516,13 @@ function oi(u) {
|
|
|
2514
2516
|
}), e.forEach((s) => {
|
|
2515
2517
|
const n = [], l = s[0];
|
|
2516
2518
|
s.forEach((r) => {
|
|
2517
|
-
var w, E,
|
|
2519
|
+
var w, E, A;
|
|
2518
2520
|
const c = +(((w = (r.getAttribute("style") || "").match(/level(\d+)/i)) == null ? void 0 : w[1]) || 1), d = Array.from(r.querySelectorAll("span")).find(
|
|
2519
2521
|
(H) => /mso-list\s*:\s*ignore/i.test(H.getAttribute("style") || "")
|
|
2520
|
-
),
|
|
2522
|
+
), u = d ? ((E = d.textContent) == null ? void 0 : E.trim()) || "" : (((A = r.textContent) == null ? void 0 : A.trim().match(/^\S{1,4}/)) || [""])[0], { ordered: m, style: b } = li(u);
|
|
2521
2523
|
for (d && d.remove(); n.length && n[n.length - 1].level > c; ) n.pop();
|
|
2522
2524
|
if (!n.length || n[n.length - 1].level < c) {
|
|
2523
|
-
const H =
|
|
2525
|
+
const H = p.createElement(m ? "ol" : "ul");
|
|
2524
2526
|
if (m && b && (H.style.listStyleType = b), n.length) {
|
|
2525
2527
|
const $ = n[n.length - 1].list;
|
|
2526
2528
|
($.lastElementChild || $).appendChild(H);
|
|
@@ -2528,39 +2530,39 @@ function oi(u) {
|
|
|
2528
2530
|
l.parentNode.insertBefore(H, l);
|
|
2529
2531
|
n.push({ list: H, level: c });
|
|
2530
2532
|
}
|
|
2531
|
-
const y =
|
|
2533
|
+
const y = p.createElement("li"), g = ut(r), x = ["text-align", "direction", "unicode-bidi", "color", "font-size", "font-family", "background-color"].filter((H) => g[H]).map((H) => H + ":" + g[H]).join(";");
|
|
2532
2534
|
for (x && y.setAttribute("style", x), r.getAttribute("dir") && y.setAttribute("dir", r.getAttribute("dir")); r.firstChild; ) y.appendChild(r.firstChild);
|
|
2533
2535
|
n[n.length - 1].list.appendChild(y), r.remove();
|
|
2534
2536
|
});
|
|
2535
2537
|
});
|
|
2536
2538
|
}
|
|
2537
|
-
function ri(
|
|
2538
|
-
|
|
2539
|
+
function ri(p) {
|
|
2540
|
+
p.querySelectorAll('b[id^="docs-internal-guid"]').forEach((t) => {
|
|
2539
2541
|
for (; t.firstChild; ) t.parentNode.insertBefore(t.firstChild, t);
|
|
2540
2542
|
t.remove();
|
|
2541
2543
|
});
|
|
2542
2544
|
}
|
|
2543
|
-
function ai(
|
|
2544
|
-
|
|
2545
|
+
function ai(p) {
|
|
2546
|
+
p.querySelectorAll("table").forEach((t) => {
|
|
2545
2547
|
const e = t;
|
|
2546
|
-
|
|
2547
|
-
}),
|
|
2548
|
+
ut(e)["border-collapse"] || (e.style.borderCollapse = "collapse");
|
|
2549
|
+
}), p.querySelectorAll("[align]").forEach((t) => {
|
|
2548
2550
|
const e = t, i = e.getAttribute("align").toLowerCase();
|
|
2549
2551
|
e.tagName.toLowerCase() === "table" ? i === "center" ? (e.style.marginLeft = e.style.marginLeft || "auto", e.style.marginRight = e.style.marginRight || "auto") : i === "right" ? e.style.marginLeft = e.style.marginLeft || "auto" : i === "left" && (e.style.marginRight = e.style.marginRight || "auto") : ["left", "right", "center", "justify"].includes(i) && (e.style.textAlign = e.style.textAlign || i, Array.from(e.children).forEach((s) => {
|
|
2550
2552
|
if (s.tagName.toLowerCase() !== "table") return;
|
|
2551
2553
|
const n = s;
|
|
2552
2554
|
i === "center" ? (n.style.marginLeft = n.style.marginLeft || "auto", n.style.marginRight = n.style.marginRight || "auto") : i === "right" ? n.style.marginLeft = n.style.marginLeft || "auto" : i === "left" && (n.style.marginRight = n.style.marginRight || "auto");
|
|
2553
2555
|
})), e.removeAttribute("align");
|
|
2554
|
-
}),
|
|
2556
|
+
}), p.querySelectorAll("center table").forEach((t) => {
|
|
2555
2557
|
const e = t;
|
|
2556
2558
|
e.style.marginLeft = e.style.marginLeft || "auto", e.style.marginRight = e.style.marginRight || "auto";
|
|
2557
|
-
}),
|
|
2559
|
+
}), p.querySelectorAll("[bgcolor]").forEach((t) => {
|
|
2558
2560
|
const e = t;
|
|
2559
2561
|
e.style.backgroundColor = e.style.backgroundColor || e.getAttribute("bgcolor"), e.removeAttribute("bgcolor");
|
|
2560
2562
|
});
|
|
2561
2563
|
}
|
|
2562
|
-
function ht(
|
|
2563
|
-
Array.from(
|
|
2564
|
+
function ht(p, t) {
|
|
2565
|
+
Array.from(p.childNodes).forEach((e) => {
|
|
2564
2566
|
if (e.nodeType === Node.COMMENT_NODE) {
|
|
2565
2567
|
e.remove();
|
|
2566
2568
|
return;
|
|
@@ -2592,7 +2594,7 @@ function ht(u, t) {
|
|
|
2592
2594
|
i.remove();
|
|
2593
2595
|
return;
|
|
2594
2596
|
}
|
|
2595
|
-
const n = /* @__PURE__ */ new Set([...
|
|
2597
|
+
const n = /* @__PURE__ */ new Set([...ne["*"] || [], ...ne[s] || []]);
|
|
2596
2598
|
if (Array.from(i.attributes).forEach((o) => {
|
|
2597
2599
|
const c = o.name.toLowerCase();
|
|
2598
2600
|
c !== "style" && !n.has(c) && i.removeAttribute(o.name);
|
|
@@ -2608,7 +2610,7 @@ function ht(u, t) {
|
|
|
2608
2610
|
return;
|
|
2609
2611
|
}
|
|
2610
2612
|
}
|
|
2611
|
-
const l =
|
|
2613
|
+
const l = ut(i), r = [];
|
|
2612
2614
|
for (const [o, c] of Object.entries(l))
|
|
2613
2615
|
si.has(o) && (/expression|javascript|url\s*\(\s*['"]?\s*file:/i.test(c) || o === "font-weight" && /^(400|normal)$/i.test(c) || o === "font-style" && /^normal$/i.test(c) || o === "text-decoration" && /^none$/i.test(c) || r.push(o + ":" + c));
|
|
2614
2616
|
if (r.length ? i.setAttribute("style", r.join(";")) : i.removeAttribute("style"), i.removeAttribute("class"), ht(i, t), s === "span" && !i.attributes.length) {
|
|
@@ -2617,10 +2619,10 @@ function ht(u, t) {
|
|
|
2617
2619
|
}
|
|
2618
2620
|
});
|
|
2619
2621
|
}
|
|
2620
|
-
function ci(
|
|
2622
|
+
function ci(p) {
|
|
2621
2623
|
const t = [], e = /<style[^>]*>([\s\S]*?)<\/style>/gi;
|
|
2622
2624
|
let i;
|
|
2623
|
-
for (; i = e.exec(
|
|
2625
|
+
for (; i = e.exec(p); ) {
|
|
2624
2626
|
let s = i[1].replace(/<!--|-->/g, "").replace(/\/\*[\s\S]*?\*\//g, "");
|
|
2625
2627
|
s = s.replace(/@media[^{]*\{(?:[^{}]*\{[^{}]*\})*[^{}]*\}/gi, ""), s = s.replace(/@[\w-]+[^{]*\{[^{}]*\}/g, "");
|
|
2626
2628
|
let n;
|
|
@@ -2635,13 +2637,13 @@ function ci(u) {
|
|
|
2635
2637
|
}
|
|
2636
2638
|
return t;
|
|
2637
2639
|
}
|
|
2638
|
-
function hi(
|
|
2640
|
+
function hi(p, t) {
|
|
2639
2641
|
if (!t.length) return;
|
|
2640
2642
|
const e = /* @__PURE__ */ new Map();
|
|
2641
2643
|
t.forEach(({ sel: i, decls: s }) => {
|
|
2642
2644
|
let n;
|
|
2643
2645
|
try {
|
|
2644
|
-
n =
|
|
2646
|
+
n = p.querySelectorAll(i);
|
|
2645
2647
|
} catch {
|
|
2646
2648
|
return;
|
|
2647
2649
|
}
|
|
@@ -2652,23 +2654,23 @@ function hi(u, t) {
|
|
|
2652
2654
|
});
|
|
2653
2655
|
});
|
|
2654
2656
|
}), e.forEach((i, s) => {
|
|
2655
|
-
const n =
|
|
2657
|
+
const n = ut(s), l = s.hasAttribute("dir"), r = s.hasAttribute("align"), o = Object.entries(i).filter(([u]) => !(u in n || (u === "direction" || u === "unicode-bidi") && l || u === "text-align" && (r || l) || (u === "background" || u === "background-color") && s.hasAttribute("bgcolor")));
|
|
2656
2658
|
if (!o.length) return;
|
|
2657
|
-
const c = o.map(([
|
|
2659
|
+
const c = o.map(([u, m]) => u + ":" + m).join(";"), d = s.getAttribute("style");
|
|
2658
2660
|
s.setAttribute("style", d ? c + ";" + d : c);
|
|
2659
2661
|
});
|
|
2660
2662
|
}
|
|
2661
|
-
function
|
|
2662
|
-
return
|
|
2663
|
+
function he(p) {
|
|
2664
|
+
return p.replace(/[ﭐ-﷿ﹰ-ﻼ]+/g, (t) => t.normalize("NFKC"));
|
|
2663
2665
|
}
|
|
2664
|
-
function di(
|
|
2665
|
-
const t =
|
|
2666
|
+
function di(p) {
|
|
2667
|
+
const t = p.createTreeWalker(p.body, NodeFilter.SHOW_TEXT, null);
|
|
2666
2668
|
let e;
|
|
2667
2669
|
for (; e = t.nextNode(); )
|
|
2668
|
-
/[ﭐ-﷿ﹰ-ﻼ]/.test(e.nodeValue || "") && (e.nodeValue =
|
|
2670
|
+
/[ﭐ-﷿ﹰ-ﻼ]/.test(e.nodeValue || "") && (e.nodeValue = he(e.nodeValue || ""));
|
|
2669
2671
|
}
|
|
2670
|
-
function
|
|
2671
|
-
const e = ci(
|
|
2672
|
+
function ui(p, t = "ltr") {
|
|
2673
|
+
const e = ci(p), i = new DOMParser().parseFromString(ni(p), "text/html");
|
|
2672
2674
|
hi(i, e), /class="?Mso|mso-|urn:schemas-microsoft-com/i.test(i.body.innerHTML) && oi(i), ri(i), ai(i), ht(i.body, i), di(i);
|
|
2673
2675
|
const s = (n) => {
|
|
2674
2676
|
var l;
|
|
@@ -2678,14 +2680,14 @@ function pi(u, t = "ltr") {
|
|
|
2678
2680
|
for (; s(i.body.lastElementChild); ) i.body.lastElementChild.remove();
|
|
2679
2681
|
return i.body.innerHTML.trim();
|
|
2680
2682
|
}
|
|
2681
|
-
function
|
|
2682
|
-
const t =
|
|
2683
|
+
function pi(p) {
|
|
2684
|
+
const t = he(p).replace(/\r/g, ""), e = (i) => i.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
2683
2685
|
return /\n/.test(t) ? t.split(/\n{2,}/).map((i) => `<p dir="auto">${e(i).replace(/\n/g, "<br>") || "<br>"}</p>`).join("") : e(t);
|
|
2684
2686
|
}
|
|
2685
|
-
function mi(
|
|
2686
|
-
const t = new DataView(
|
|
2687
|
+
function mi(p) {
|
|
2688
|
+
const t = new DataView(p), e = /* @__PURE__ */ new Map();
|
|
2687
2689
|
let i = -1;
|
|
2688
|
-
for (let r =
|
|
2690
|
+
for (let r = p.byteLength - 22; r >= Math.max(0, p.byteLength - 22 - 65535); r--)
|
|
2689
2691
|
if (t.getUint32(r, !0) === 101010256) {
|
|
2690
2692
|
i = r;
|
|
2691
2693
|
break;
|
|
@@ -2695,38 +2697,38 @@ function mi(u) {
|
|
|
2695
2697
|
let n = t.getUint32(i + 16, !0);
|
|
2696
2698
|
const l = new TextDecoder();
|
|
2697
2699
|
for (let r = 0; r < s && t.getUint32(n, !0) === 33639248; r++) {
|
|
2698
|
-
const o = t.getUint16(n + 10, !0), c = t.getUint32(n + 20, !0), d = t.getUint16(n + 28, !0),
|
|
2699
|
-
e.set(y, { name: y, method: o, compSize: c, localOffset: b }), n += 46 + d +
|
|
2700
|
+
const o = t.getUint16(n + 10, !0), c = t.getUint32(n + 20, !0), d = t.getUint16(n + 28, !0), u = t.getUint16(n + 30, !0), m = t.getUint16(n + 32, !0), b = t.getUint32(n + 42, !0), y = l.decode(new Uint8Array(p, n + 46, d));
|
|
2701
|
+
e.set(y, { name: y, method: o, compSize: c, localOffset: b }), n += 46 + d + u + m;
|
|
2700
2702
|
}
|
|
2701
2703
|
return e;
|
|
2702
2704
|
}
|
|
2703
|
-
async function
|
|
2704
|
-
const e = new DataView(
|
|
2705
|
+
async function le(p, t) {
|
|
2706
|
+
const e = new DataView(p, t.localOffset);
|
|
2705
2707
|
if (e.getUint32(0, !0) !== 67324752) throw new Error("Bad local header");
|
|
2706
|
-
const i = e.getUint16(26, !0), s = e.getUint16(28, !0), n = t.localOffset + 30 + i + s, l = new Uint8Array(
|
|
2708
|
+
const i = e.getUint16(26, !0), s = e.getUint16(28, !0), n = t.localOffset + 30 + i + s, l = new Uint8Array(p.slice(n, n + t.compSize));
|
|
2707
2709
|
if (t.method === 0) return l;
|
|
2708
2710
|
if (t.method !== 8) throw new Error("Unsupported compression method " + t.method);
|
|
2709
2711
|
const r = new Blob([l]).stream().pipeThrough(new DecompressionStream("deflate-raw"));
|
|
2710
2712
|
return new Uint8Array(await new Response(r).arrayBuffer());
|
|
2711
2713
|
}
|
|
2712
|
-
const
|
|
2713
|
-
let e =
|
|
2714
|
+
const oe = (p) => p.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """), dt = (p, t) => Array.from(p.children).filter((e) => e.localName === t), B = (p, ...t) => {
|
|
2715
|
+
let e = p;
|
|
2714
2716
|
for (const i of t) {
|
|
2715
2717
|
if (!e) return null;
|
|
2716
2718
|
e = Array.from(e.children).find((s) => s.localName === i) || null;
|
|
2717
2719
|
}
|
|
2718
2720
|
return e;
|
|
2719
|
-
}, q = (
|
|
2720
|
-
if (!
|
|
2721
|
-
for (const e of Array.from(
|
|
2721
|
+
}, q = (p, t = "val") => {
|
|
2722
|
+
if (!p) return "";
|
|
2723
|
+
for (const e of Array.from(p.attributes))
|
|
2722
2724
|
if (e.localName === t) return e.value;
|
|
2723
2725
|
return "";
|
|
2724
|
-
}, at = (
|
|
2725
|
-
const e =
|
|
2726
|
+
}, at = (p, t) => {
|
|
2727
|
+
const e = p ? B(p, t) : null;
|
|
2726
2728
|
if (!e) return !1;
|
|
2727
2729
|
const i = q(e);
|
|
2728
2730
|
return i !== "false" && i !== "0";
|
|
2729
|
-
},
|
|
2731
|
+
}, re = {
|
|
2730
2732
|
yellow: "#FFFF00",
|
|
2731
2733
|
green: "#00FF00",
|
|
2732
2734
|
cyan: "#00FFFF",
|
|
@@ -2751,10 +2753,10 @@ const se = (u) => u.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, "
|
|
|
2751
2753
|
bmp: "image/bmp",
|
|
2752
2754
|
webp: "image/webp"
|
|
2753
2755
|
};
|
|
2754
|
-
function gi(
|
|
2756
|
+
function gi(p) {
|
|
2755
2757
|
let t = "";
|
|
2756
|
-
for (let e = 0; e <
|
|
2757
|
-
t += String.fromCharCode(...
|
|
2758
|
+
for (let e = 0; e < p.length; e += 32768)
|
|
2759
|
+
t += String.fromCharCode(...p.subarray(e, e + 32768));
|
|
2758
2760
|
return btoa(t);
|
|
2759
2761
|
}
|
|
2760
2762
|
class vi {
|
|
@@ -2782,20 +2784,20 @@ class vi {
|
|
|
2782
2784
|
return s(0), e || "<p><br></p>";
|
|
2783
2785
|
}
|
|
2784
2786
|
paraList(t) {
|
|
2785
|
-
const e =
|
|
2787
|
+
const e = B(t, "pPr", "numPr");
|
|
2786
2788
|
if (!e) return null;
|
|
2787
|
-
const i = q(
|
|
2789
|
+
const i = q(B(e, "numId"));
|
|
2788
2790
|
if (!i || i === "0") return null;
|
|
2789
|
-
const s = parseInt(q(
|
|
2791
|
+
const s = parseInt(q(B(e, "ilvl")) || "0", 10) || 0;
|
|
2790
2792
|
return { type: this.numFmt.get(i) || "ul", ilvl: Math.min(s, 8) };
|
|
2791
2793
|
}
|
|
2792
2794
|
convertPara(t) {
|
|
2793
|
-
const e =
|
|
2795
|
+
const e = B(t, "pPr"), i = q(B(t, "pPr", "pStyle"));
|
|
2794
2796
|
let s = "p";
|
|
2795
2797
|
const n = /^Heading([1-6])$/i.exec(i);
|
|
2796
2798
|
n ? s = "h" + n[1] : /^Title$/i.test(i) && (s = "h1");
|
|
2797
|
-
const l = [], r = q(
|
|
2798
|
-
r === "center" ? l.push("text-align:center") : r === "right" || r === "end" ? l.push("text-align:right") : (r === "both" || r === "distribute") && l.push("text-align:justify"), e &&
|
|
2799
|
+
const l = [], r = q(B(t, "pPr", "jc"));
|
|
2800
|
+
r === "center" ? l.push("text-align:center") : r === "right" || r === "end" ? l.push("text-align:right") : (r === "both" || r === "distribute") && l.push("text-align:justify"), e && B(e, "bidi") && l.push("direction:rtl");
|
|
2799
2801
|
const o = this.runsOf(t), c = l.length ? ` style="${l.join(";")}"` : "";
|
|
2800
2802
|
return `<${s}${c}>${o || "<br>"}</${s}>`;
|
|
2801
2803
|
}
|
|
@@ -2808,25 +2810,25 @@ class vi {
|
|
|
2808
2810
|
const n = q(i, "anchor");
|
|
2809
2811
|
!s && n && (s = "#" + n);
|
|
2810
2812
|
const l = this.runsOf(i);
|
|
2811
|
-
e += s ? `<a href="${
|
|
2813
|
+
e += s ? `<a href="${oe(s)}">${l}</a>` : l;
|
|
2812
2814
|
} else (i.localName === "smartTag" || i.localName === "ins") && (e += this.runsOf(i));
|
|
2813
2815
|
return e;
|
|
2814
2816
|
}
|
|
2815
2817
|
convertRun(t) {
|
|
2816
|
-
const e =
|
|
2818
|
+
const e = B(t, "rPr");
|
|
2817
2819
|
let i = "";
|
|
2818
|
-
for (const
|
|
2819
|
-
|
|
2820
|
+
for (const u of Array.from(t.children))
|
|
2821
|
+
u.localName === "t" ? i += oe(u.textContent || "") : u.localName === "br" || u.localName === "cr" ? i += "<br>" : u.localName === "tab" ? i += " " : (u.localName === "drawing" || u.localName === "pict" || u.localName === "object") && (i += this.convertImage(u));
|
|
2820
2822
|
if (!i) return "";
|
|
2821
|
-
const s = [], n = q(e ?
|
|
2823
|
+
const s = [], n = q(e ? B(e, "color") : null);
|
|
2822
2824
|
n && n !== "auto" && s.push("color:#" + n);
|
|
2823
|
-
const l = q(e ?
|
|
2824
|
-
l &&
|
|
2825
|
-
const r = parseFloat(q(e ?
|
|
2825
|
+
const l = q(e ? B(e, "highlight") : null);
|
|
2826
|
+
l && re[l] && s.push("background-color:" + re[l]);
|
|
2827
|
+
const r = parseFloat(q(e ? B(e, "sz") : null));
|
|
2826
2828
|
r && s.push("font-size:" + Math.round(r / 2 * (4 / 3)) + "px");
|
|
2827
|
-
const o = e ?
|
|
2828
|
-
c && s.push(`font-family:'${c}'`), s.length && (i = `<span style="${s.join(";")}">${i}</span>`), at(e, "b") && (i = `<strong>${i}</strong>`), at(e, "i") && (i = `<em>${i}</em>`), at(e, "u") && q(
|
|
2829
|
-
const d = q(e ?
|
|
2829
|
+
const o = e ? B(e, "rFonts") : null, c = q(o, "ascii") || q(o, "cs");
|
|
2830
|
+
c && s.push(`font-family:'${c}'`), s.length && (i = `<span style="${s.join(";")}">${i}</span>`), at(e, "b") && (i = `<strong>${i}</strong>`), at(e, "i") && (i = `<em>${i}</em>`), at(e, "u") && q(B(e, "u")) !== "none" && (i = `<u>${i}</u>`), at(e, "strike") && (i = `<s>${i}</s>`);
|
|
2831
|
+
const d = q(e ? B(e, "vertAlign") : null);
|
|
2830
2832
|
return d === "superscript" ? i = `<sup>${i}</sup>` : d === "subscript" && (i = `<sub>${i}</sub>`), i;
|
|
2831
2833
|
}
|
|
2832
2834
|
convertImage(t) {
|
|
@@ -2849,7 +2851,7 @@ class vi {
|
|
|
2849
2851
|
for (const i of dt(t, "tr")) {
|
|
2850
2852
|
e += "<tr>";
|
|
2851
2853
|
for (const s of dt(i, "tc")) {
|
|
2852
|
-
const n = parseInt(q(
|
|
2854
|
+
const n = parseInt(q(B(s, "tcPr", "gridSpan")) || "1", 10) || 1, l = n > 1 ? ` colspan="${n}"` : "";
|
|
2853
2855
|
let r = "";
|
|
2854
2856
|
for (const o of Array.from(s.children))
|
|
2855
2857
|
o.localName === "p" ? r += this.convertPara(o) : o.localName === "tbl" && (r += this.convertTable(o));
|
|
@@ -2860,10 +2862,10 @@ class vi {
|
|
|
2860
2862
|
return e + "</tbody></table>";
|
|
2861
2863
|
}
|
|
2862
2864
|
}
|
|
2863
|
-
async function bi(
|
|
2864
|
-
const t =
|
|
2865
|
+
async function bi(p) {
|
|
2866
|
+
const t = p instanceof ArrayBuffer ? p : await p.arrayBuffer(), e = mi(t), i = new TextDecoder(), s = async (y) => {
|
|
2865
2867
|
const g = e.get(y);
|
|
2866
|
-
return g ? new DOMParser().parseFromString(i.decode(await
|
|
2868
|
+
return g ? new DOMParser().parseFromString(i.decode(await le(t, g)), "application/xml") : null;
|
|
2867
2869
|
}, n = await s("word/document.xml"), l = n == null ? void 0 : n.getElementsByTagName("*");
|
|
2868
2870
|
let r = null;
|
|
2869
2871
|
if (l) {
|
|
@@ -2881,14 +2883,14 @@ async function bi(u) {
|
|
|
2881
2883
|
const g = y.getAttribute("Id") || "", x = y.getAttribute("Target") || "", w = y.getAttribute("Type") || "";
|
|
2882
2884
|
/hyperlink/i.test(w) ? o.set(g, x) : /image/i.test(w) && c.set(g, x);
|
|
2883
2885
|
}
|
|
2884
|
-
const
|
|
2886
|
+
const u = /* @__PURE__ */ new Map();
|
|
2885
2887
|
for (const [y, g] of c) {
|
|
2886
2888
|
const x = g.startsWith("/") ? g.slice(1) : "word/" + g.replace(/^\.\//, ""), w = e.get(x);
|
|
2887
2889
|
if (!w) continue;
|
|
2888
|
-
const E = (x.split(".").pop() || "").toLowerCase(),
|
|
2889
|
-
if (
|
|
2890
|
+
const E = (x.split(".").pop() || "").toLowerCase(), A = fi[E];
|
|
2891
|
+
if (A)
|
|
2890
2892
|
try {
|
|
2891
|
-
|
|
2893
|
+
u.set(y, `data:${A};base64,${gi(await le(t, w))}`);
|
|
2892
2894
|
} catch {
|
|
2893
2895
|
}
|
|
2894
2896
|
}
|
|
@@ -2897,16 +2899,16 @@ async function bi(u) {
|
|
|
2897
2899
|
const y = /* @__PURE__ */ new Map(), g = Array.from(b.getElementsByTagName("*"));
|
|
2898
2900
|
for (const x of g) {
|
|
2899
2901
|
if (x.localName !== "abstractNum") continue;
|
|
2900
|
-
const w = q(x, "abstractNumId"), E = dt(x, "lvl").find((H) => q(H, "ilvl") === "0") || dt(x, "lvl")[0],
|
|
2901
|
-
y.set(w,
|
|
2902
|
+
const w = q(x, "abstractNumId"), E = dt(x, "lvl").find((H) => q(H, "ilvl") === "0") || dt(x, "lvl")[0], A = E ? q(B(E, "numFmt")) : "";
|
|
2903
|
+
y.set(w, A === "bullet" ? "ul" : "ol");
|
|
2902
2904
|
}
|
|
2903
2905
|
for (const x of g) {
|
|
2904
2906
|
if (x.localName !== "num") continue;
|
|
2905
|
-
const w = q(x, "numId"), E = q(
|
|
2907
|
+
const w = q(x, "numId"), E = q(B(x, "abstractNumId"));
|
|
2906
2908
|
m.set(w, y.get(E) || "ul");
|
|
2907
2909
|
}
|
|
2908
2910
|
}
|
|
2909
|
-
return new vi(o,
|
|
2911
|
+
return new vi(o, u, m).convertBody(r);
|
|
2910
2912
|
}
|
|
2911
2913
|
const yi = ["nw", "ne", "sw", "se"], wt = ["img-left", "img-right", "img-top", "img-center"], Tt = {
|
|
2912
2914
|
"img-left": "tplimgleft",
|
|
@@ -2919,19 +2921,19 @@ const yi = ["nw", "ne", "sw", "se"], wt = ["img-left", "img-right", "img-top", "
|
|
|
2919
2921
|
"img-top": h.tpltop,
|
|
2920
2922
|
"img-center": h.tplcenter
|
|
2921
2923
|
}, Ci = ".tox,.pop,.tblctx,.imgctx,.selctx,.dlg";
|
|
2922
|
-
let Z = null, X = null, St = 0,
|
|
2924
|
+
let Z = null, X = null, St = 0, ae = !1;
|
|
2923
2925
|
function ct() {
|
|
2924
2926
|
clearTimeout(St), X = null, Z && Z.classList.remove("show");
|
|
2925
2927
|
}
|
|
2926
|
-
function wi(
|
|
2927
|
-
const t =
|
|
2928
|
+
function wi(p) {
|
|
2929
|
+
const t = p.dataset.tip;
|
|
2928
2930
|
if (!t) return;
|
|
2929
|
-
X =
|
|
2931
|
+
X = p, clearTimeout(St);
|
|
2930
2932
|
const e = Z && Z.classList.contains("show") ? 60 : 350;
|
|
2931
2933
|
St = window.setTimeout(() => {
|
|
2932
|
-
if (X !==
|
|
2934
|
+
if (X !== p || !document.contains(p)) return;
|
|
2933
2935
|
Z || (Z = document.createElement("div"), Z.className = "etip", document.body.appendChild(Z)), Z.textContent = t, Z.classList.add("show");
|
|
2934
|
-
const i =
|
|
2936
|
+
const i = p.getBoundingClientRect(), s = Z.offsetWidth, n = Z.offsetHeight;
|
|
2935
2937
|
let l = i.left + i.width / 2 - s / 2;
|
|
2936
2938
|
l = Math.max(6, Math.min(l, innerWidth - s - 6));
|
|
2937
2939
|
let r = i.bottom + 7;
|
|
@@ -2939,16 +2941,16 @@ function wi(u) {
|
|
|
2939
2941
|
}, e);
|
|
2940
2942
|
}
|
|
2941
2943
|
function Ti() {
|
|
2942
|
-
|
|
2943
|
-
const t =
|
|
2944
|
+
ae || (ae = !0, document.addEventListener("mouseover", (p) => {
|
|
2945
|
+
const t = p.target, e = t.closest ? t.closest("[title],[data-tip]") : null;
|
|
2944
2946
|
if (!e || !e.closest(Ci) || e.closest(".earea")) {
|
|
2945
2947
|
e !== X && ct();
|
|
2946
2948
|
return;
|
|
2947
2949
|
}
|
|
2948
2950
|
const i = e.getAttribute("title");
|
|
2949
2951
|
i && (e.dataset.tip = i, e.removeAttribute("title"), e.getAttribute("aria-label") || e.setAttribute("aria-label", i)), e !== X && wi(e);
|
|
2950
|
-
}), document.addEventListener("mouseout", (
|
|
2951
|
-
X && !X.contains(
|
|
2952
|
+
}), document.addEventListener("mouseout", (p) => {
|
|
2953
|
+
X && !X.contains(p.relatedTarget) && ct();
|
|
2952
2954
|
}), document.addEventListener("mousedown", ct, !0), addEventListener("scroll", ct, !0));
|
|
2953
2955
|
}
|
|
2954
2956
|
var j;
|
|
@@ -2968,7 +2970,7 @@ let Ei = (j = class {
|
|
|
2968
2970
|
statusbar: t.statusbar ?? !0,
|
|
2969
2971
|
readonly: t.readonly ?? !1,
|
|
2970
2972
|
draftKey: t.draftKey ?? (typeof location < "u" ? location.pathname : "default"),
|
|
2971
|
-
fontFamilyFormats: t.fontFamilyFormats ??
|
|
2973
|
+
fontFamilyFormats: t.fontFamilyFormats ?? Xe,
|
|
2972
2974
|
imageFileTypes: t.imageFileTypes ?? ["image/jpeg", "image/jpg", "image/png", "image/gif", "image/bmp", "image/webp"],
|
|
2973
2975
|
videoFileTypes: t.videoFileTypes ?? ["video/mp4", "video/webm", "video/ogg"]
|
|
2974
2976
|
}, this.imageUploadHandler = t.imageUploadHandler, this.onImageUploadError = t.onImageUploadError, this.videoUploadHandler = t.videoUploadHandler, this.onVideoUploadError = t.onVideoUploadError, this.contentStyle = t.contentStyle, this.applyTheme(t), this.lang = this.options.language, this.draftStorageKey = "tmclone-draft:" + this.options.draftKey, this.initDOM(), this.bindEvents(), this.initUI(), this.recordRevision(), this.options.onReady(this);
|
|
@@ -3035,7 +3037,7 @@ let Ei = (j = class {
|
|
|
3035
3037
|
}), this.on(this.ed, "input", () => {
|
|
3036
3038
|
this.refreshState(), this.onChange(), this.positionTableHandles(), this.positionImageHandles(), this.positionImgPhCtx(), this.positionTplCtx(), this.positionVphCtx(), this.positionVidCtx(), this.positionCodeCtx();
|
|
3037
3039
|
}), this.on(this.ed, "keydown", (t) => {
|
|
3038
|
-
t.altKey && t.key === "0" && (t.preventDefault(), this.helpDlg()), (t.key === "Delete" || t.key === "Backspace") && this.phActive && (t.preventDefault(), this.removeImgPlaceholder()), (t.key === "Delete" || t.key === "Backspace") && this.vphActive && (t.preventDefault(), this.removeVphPlaceholder()), t.key === "`" && !t.ctrlKey && !t.metaKey && !t.altKey && this.tryCodeTyping(t);
|
|
3040
|
+
t.altKey && t.key === "0" && (t.preventDefault(), this.helpDlg()), (t.key === "Delete" || t.key === "Backspace") && this.phActive && (t.preventDefault(), this.removeImgPlaceholder()), (t.key === "Delete" || t.key === "Backspace") && this.vphActive && (t.preventDefault(), this.removeVphPlaceholder()), t.key === "`" && !t.ctrlKey && !t.metaKey && !t.altKey && this.tryCodeTyping(t), t.key === "Enter" && !t.shiftKey && !t.ctrlKey && !t.metaKey && !t.altKey && this.tryExitBlockquote(t);
|
|
3039
3041
|
}), this.on(this.ed, "paste", (t) => this.handlePaste(t)), this.on(this.ed, "drop", (t) => {
|
|
3040
3042
|
var n, l, r, o;
|
|
3041
3043
|
t.preventDefault();
|
|
@@ -3051,10 +3053,10 @@ let Ei = (j = class {
|
|
|
3051
3053
|
c && this.readVideoFileInto(c, s);
|
|
3052
3054
|
}
|
|
3053
3055
|
}), this.on(this.ed, "dragover", (t) => t.preventDefault()), this.on(this.ed, "mousedown", (t) => {
|
|
3054
|
-
var d,
|
|
3056
|
+
var d, u, m, b, y, g, x;
|
|
3055
3057
|
const e = t.target, i = (d = e.closest) == null ? void 0 : d.call(e, "table");
|
|
3056
3058
|
i && this.ed.contains(i) ? this.selectTableForResize(i) : this.clearTableHandles();
|
|
3057
|
-
const s = (
|
|
3059
|
+
const s = (u = e.closest) == null ? void 0 : u.call(e, ".img-ph:not(.vid-ph)");
|
|
3058
3060
|
s && this.ed.contains(s) && !this.options.readonly ? (t.preventDefault(), this.ed.focus(), this.selectImgPlaceholder(s)) : this.clearImgPlaceholderSel();
|
|
3059
3061
|
const n = (m = e.closest) == null ? void 0 : m.call(e, ".vid-ph");
|
|
3060
3062
|
n && this.ed.contains(n) && !this.options.readonly ? (t.preventDefault(), this.ed.focus(), this.selectVphPlaceholder(n)) : this.clearVphPlaceholderSel();
|
|
@@ -3207,6 +3209,20 @@ let Ei = (j = class {
|
|
|
3207
3209
|
}
|
|
3208
3210
|
return null;
|
|
3209
3211
|
}
|
|
3212
|
+
/** Enter on an empty last line inside a blockquote exits it into a plain paragraph, mirroring how lists exit on an empty item. */
|
|
3213
|
+
tryExitBlockquote(t) {
|
|
3214
|
+
const e = window.getSelection();
|
|
3215
|
+
if (!e || !e.isCollapsed || !e.anchorNode || !this.ed.contains(e.anchorNode)) return;
|
|
3216
|
+
const i = this.closestBlock(e.anchorNode);
|
|
3217
|
+
if (!i || i.tagName === "BLOCKQUOTE" || (i.textContent || "").trim() !== "") return;
|
|
3218
|
+
const s = i.closest("blockquote");
|
|
3219
|
+
if (!s || !this.ed.contains(s) || i !== s.lastElementChild) return;
|
|
3220
|
+
t.preventDefault();
|
|
3221
|
+
const n = document.createElement("p");
|
|
3222
|
+
n.appendChild(document.createElement("br")), s.after(n), i.remove(), s.firstElementChild || s.remove();
|
|
3223
|
+
const l = document.createRange();
|
|
3224
|
+
l.setStart(n, 0), l.collapse(!0), e.removeAllRanges(), e.addRange(l), this.saveSel(), this.onChange();
|
|
3225
|
+
}
|
|
3210
3226
|
selectedBlocks() {
|
|
3211
3227
|
const t = window.getSelection();
|
|
3212
3228
|
if (!t || !t.rangeCount || !this.ed.contains(t.anchorNode)) return [];
|
|
@@ -3264,16 +3280,16 @@ let Ei = (j = class {
|
|
|
3264
3280
|
minute: "2-digit",
|
|
3265
3281
|
second: "2-digit"
|
|
3266
3282
|
}), o = {}, c = (d) => {
|
|
3267
|
-
l = d, this.revisions.forEach((
|
|
3283
|
+
l = d, this.revisions.forEach((u, m) => {
|
|
3268
3284
|
var b;
|
|
3269
3285
|
return (b = o[m]) == null ? void 0 : b.classList.toggle("on", m === d);
|
|
3270
3286
|
}), s.innerHTML = this.revisions[d].html, n.disabled = d === this.revisions.length - 1;
|
|
3271
3287
|
};
|
|
3272
3288
|
for (let d = this.revisions.length - 1; d >= 0; d--) {
|
|
3273
|
-
const
|
|
3289
|
+
const u = this.revisions[d], m = document.createElement("button");
|
|
3274
3290
|
m.type = "button";
|
|
3275
|
-
const b = (new DOMParser().parseFromString(
|
|
3276
|
-
m.innerHTML = `<span>${g ? this.t("currentver") : r.format(new Date(
|
|
3291
|
+
const b = (new DOMParser().parseFromString(u.html, "text/html").body.textContent || "").trim(), y = b ? b.split(/\s+/).length : 0, g = d === this.revisions.length - 1;
|
|
3292
|
+
m.innerHTML = `<span>${g ? this.t("currentver") : r.format(new Date(u.time))}</span><span class="wc">${y} ${this.t("words")}</span>`, m.addEventListener("click", () => c(d)), o[d] = m, i.appendChild(m);
|
|
3277
3293
|
}
|
|
3278
3294
|
i.append(n), n.addEventListener("click", () => {
|
|
3279
3295
|
const d = this.revisions[l];
|
|
@@ -3403,13 +3419,13 @@ let Ei = (j = class {
|
|
|
3403
3419
|
action: () => this.exec(i)
|
|
3404
3420
|
}
|
|
3405
3421
|
]), d.insertAdjacentHTML("beforeend", '<div class="sep"></div>');
|
|
3406
|
-
const
|
|
3407
|
-
|
|
3422
|
+
const u = document.createElement("div");
|
|
3423
|
+
u.className = "mi-grid", s.forEach(([m, b], y) => {
|
|
3408
3424
|
const g = document.createElement("button");
|
|
3409
3425
|
g.className = "mi" + (o === m ? " on" : ""), g.innerHTML = `<span class="ic">${b}</span><span class="prev">${n[y]}</span>`, g.addEventListener("click", () => {
|
|
3410
3426
|
this.closePop(), this.setListStyle(e, m);
|
|
3411
|
-
}),
|
|
3412
|
-
}), d.appendChild(
|
|
3427
|
+
}), u.appendChild(g);
|
|
3428
|
+
}), d.appendChild(u);
|
|
3413
3429
|
});
|
|
3414
3430
|
}
|
|
3415
3431
|
/** Shared color-picker popup body — swatch grid plus the current-color /
|
|
@@ -3417,10 +3433,10 @@ let Ei = (j = class {
|
|
|
3417
3433
|
* table cell-background menu all show the identical popup. */
|
|
3418
3434
|
buildPaletteInto(t, e, i) {
|
|
3419
3435
|
const s = document.createElement("div");
|
|
3420
|
-
s.className = "cpal", Je.forEach((
|
|
3436
|
+
s.className = "cpal", Je.forEach((u) => {
|
|
3421
3437
|
const m = document.createElement("button");
|
|
3422
|
-
m.type = "button", m.style.background =
|
|
3423
|
-
this.closePop(), i(
|
|
3438
|
+
m.type = "button", m.style.background = u, m.title = u, m.addEventListener("click", () => {
|
|
3439
|
+
this.closePop(), i(u);
|
|
3424
3440
|
}), s.appendChild(m);
|
|
3425
3441
|
}), t.appendChild(s), t.insertAdjacentHTML("beforeend", '<div class="sep"></div>');
|
|
3426
3442
|
const n = document.createElement("div");
|
|
@@ -3454,30 +3470,26 @@ let Ei = (j = class {
|
|
|
3454
3470
|
syncColorSwatches(t) {
|
|
3455
3471
|
t.querySelectorAll("[data-cb=fore]").forEach((e) => e.style.background = this.foreColor), t.querySelectorAll("[data-cb=back]").forEach((e) => e.style.background = this.backColor);
|
|
3456
3472
|
}
|
|
3473
|
+
fontItems() {
|
|
3474
|
+
return this.options.fontFamilyFormats.map(([t, e]) => ({
|
|
3475
|
+
label: t,
|
|
3476
|
+
previewStyle: `font-family:${e}`,
|
|
3477
|
+
on: this.currentFont() === t,
|
|
3478
|
+
action: () => this.exec("fontName", e)
|
|
3479
|
+
}));
|
|
3480
|
+
}
|
|
3457
3481
|
fontMenu(t) {
|
|
3458
|
-
this.popup(t, (e) =>
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
}))
|
|
3467
|
-
);
|
|
3468
|
-
});
|
|
3482
|
+
this.popup(t, (e) => this.menuItems(e, this.fontItems()));
|
|
3483
|
+
}
|
|
3484
|
+
sizeItems() {
|
|
3485
|
+
return Ye.map((t) => ({
|
|
3486
|
+
label: t,
|
|
3487
|
+
on: this.currentSize() === t,
|
|
3488
|
+
action: () => this.applyFontSize(t)
|
|
3489
|
+
}));
|
|
3469
3490
|
}
|
|
3470
3491
|
sizeMenu(t) {
|
|
3471
|
-
this.popup(t, (e) =>
|
|
3472
|
-
this.menuItems(
|
|
3473
|
-
e,
|
|
3474
|
-
Ue.map((i) => ({
|
|
3475
|
-
label: i,
|
|
3476
|
-
on: this.currentSize() === i,
|
|
3477
|
-
action: () => this.applyFontSize(i)
|
|
3478
|
-
}))
|
|
3479
|
-
);
|
|
3480
|
-
});
|
|
3492
|
+
this.popup(t, (e) => this.menuItems(e, this.sizeItems()));
|
|
3481
3493
|
}
|
|
3482
3494
|
/** Font sizing needs a non-collapsed range. With a bare caret, grow the
|
|
3483
3495
|
selection to the word under it; in an empty spot, select a zero-width
|
|
@@ -3523,7 +3535,7 @@ let Ei = (j = class {
|
|
|
3523
3535
|
this.saveSel(), this.refreshState(), this.onChange();
|
|
3524
3536
|
}
|
|
3525
3537
|
stepFontSize(t) {
|
|
3526
|
-
const e = parseInt(this.currentSize(), 10) || 14, i = Math.min(
|
|
3538
|
+
const e = parseInt(this.currentSize(), 10) || 14, i = Math.min(Ge, Math.max(Qe, e + t));
|
|
3527
3539
|
i !== e && this.applyFontSize(i + "px");
|
|
3528
3540
|
}
|
|
3529
3541
|
/* ------------------------------------------------ case / spacing / link */
|
|
@@ -3538,18 +3550,19 @@ let Ei = (j = class {
|
|
|
3538
3550
|
const o = r === i.startContainer ? i.startOffset : 0, c = r === i.endContainer ? i.endOffset : r.data.length;
|
|
3539
3551
|
if (c <= o) return;
|
|
3540
3552
|
const d = r.data.slice(o, c);
|
|
3541
|
-
let
|
|
3542
|
-
t === "lower" ?
|
|
3553
|
+
let u = d;
|
|
3554
|
+
t === "lower" ? u = d.toLowerCase() : t === "upper" ? u = d.toUpperCase() : u = d.replace(/(^|\s)(\S)/g, (m, b, y) => b + y.toUpperCase()), r.replaceData(o, c - o, u);
|
|
3543
3555
|
}), this.saveSel(), this.refreshState(), this.onChange();
|
|
3544
3556
|
}
|
|
3557
|
+
caseItems() {
|
|
3558
|
+
return [
|
|
3559
|
+
{ label: this.t("lowercase"), icon: h.lowercaseic, action: () => this.transformCase("lower") },
|
|
3560
|
+
{ label: this.t("uppercase"), icon: h.uppercaseic, action: () => this.transformCase("upper") },
|
|
3561
|
+
{ label: this.t("capitalize"), icon: h.capitalizeic, action: () => this.transformCase("capitalize") }
|
|
3562
|
+
];
|
|
3563
|
+
}
|
|
3545
3564
|
caseMenu(t) {
|
|
3546
|
-
this.popup(t, (e) =>
|
|
3547
|
-
this.menuItems(e, [
|
|
3548
|
-
{ label: this.t("lowercase"), icon: h.lowercaseic, action: () => this.transformCase("lower") },
|
|
3549
|
-
{ label: this.t("uppercase"), icon: h.uppercaseic, action: () => this.transformCase("upper") },
|
|
3550
|
-
{ label: this.t("capitalize"), icon: h.capitalizeic, action: () => this.transformCase("capitalize") }
|
|
3551
|
-
]);
|
|
3552
|
-
});
|
|
3565
|
+
this.popup(t, (e) => this.menuItems(e, this.caseItems()));
|
|
3553
3566
|
}
|
|
3554
3567
|
applyBlockStyle(t, e) {
|
|
3555
3568
|
this.restoreSel();
|
|
@@ -3562,44 +3575,25 @@ let Ei = (j = class {
|
|
|
3562
3575
|
const e = window.getSelection(), i = e ? this.closestBlock(e.anchorNode) : null;
|
|
3563
3576
|
return i && i.style[t] || "";
|
|
3564
3577
|
}
|
|
3578
|
+
blockStyleItems(t, e) {
|
|
3579
|
+
const i = this.currentBlockStyle(t);
|
|
3580
|
+
return [
|
|
3581
|
+
{ label: this.t("normal"), on: !i, action: () => this.applyBlockStyle(t, "") },
|
|
3582
|
+
...e.map((s) => ({
|
|
3583
|
+
label: s,
|
|
3584
|
+
on: i === s,
|
|
3585
|
+
action: () => this.applyBlockStyle(t, s)
|
|
3586
|
+
}))
|
|
3587
|
+
];
|
|
3588
|
+
}
|
|
3565
3589
|
lineHeightMenu(t) {
|
|
3566
|
-
|
|
3567
|
-
this.popup(t, (i) => {
|
|
3568
|
-
this.menuItems(i, [
|
|
3569
|
-
{ label: this.t("normal"), on: !e, action: () => this.applyBlockStyle("lineHeight", "") },
|
|
3570
|
-
...Ye.map((s) => ({
|
|
3571
|
-
label: s,
|
|
3572
|
-
on: e === s,
|
|
3573
|
-
action: () => this.applyBlockStyle("lineHeight", s)
|
|
3574
|
-
}))
|
|
3575
|
-
]);
|
|
3576
|
-
});
|
|
3590
|
+
this.popup(t, (e) => this.menuItems(e, this.blockStyleItems("lineHeight", Jt)));
|
|
3577
3591
|
}
|
|
3578
3592
|
wordSpacingMenu(t) {
|
|
3579
|
-
|
|
3580
|
-
this.popup(t, (i) => {
|
|
3581
|
-
this.menuItems(i, [
|
|
3582
|
-
{ label: this.t("normal"), on: !e, action: () => this.applyBlockStyle("wordSpacing", "") },
|
|
3583
|
-
...Ge.map((s) => ({
|
|
3584
|
-
label: s,
|
|
3585
|
-
on: e === s,
|
|
3586
|
-
action: () => this.applyBlockStyle("wordSpacing", s)
|
|
3587
|
-
}))
|
|
3588
|
-
]);
|
|
3589
|
-
});
|
|
3593
|
+
this.popup(t, (e) => this.menuItems(e, this.blockStyleItems("wordSpacing", te)));
|
|
3590
3594
|
}
|
|
3591
3595
|
letterSpacingMenu(t) {
|
|
3592
|
-
|
|
3593
|
-
this.popup(t, (i) => {
|
|
3594
|
-
this.menuItems(i, [
|
|
3595
|
-
{ label: this.t("normal"), on: !e, action: () => this.applyBlockStyle("letterSpacing", "") },
|
|
3596
|
-
...Qe.map((s) => ({
|
|
3597
|
-
label: s,
|
|
3598
|
-
on: e === s,
|
|
3599
|
-
action: () => this.applyBlockStyle("letterSpacing", s)
|
|
3600
|
-
}))
|
|
3601
|
-
]);
|
|
3602
|
-
});
|
|
3596
|
+
this.popup(t, (e) => this.menuItems(e, this.blockStyleItems("letterSpacing", ee)));
|
|
3603
3597
|
}
|
|
3604
3598
|
closestAnchor() {
|
|
3605
3599
|
const t = window.getSelection();
|
|
@@ -3651,18 +3645,29 @@ let Ei = (j = class {
|
|
|
3651
3645
|
i
|
|
3652
3646
|
);
|
|
3653
3647
|
}
|
|
3648
|
+
blockItems() {
|
|
3649
|
+
return se.map(([t]) => ({
|
|
3650
|
+
label: this.blockLabel(t),
|
|
3651
|
+
previewStyle: t.startsWith("h") ? `font-weight:700;font-size:${22 - 2 * +t[1]}px` : t === "pre" ? "font-family:monospace" : "",
|
|
3652
|
+
on: this.currentBlock() === t,
|
|
3653
|
+
action: () => this.exec("formatBlock", "<" + t + ">")
|
|
3654
|
+
}));
|
|
3655
|
+
}
|
|
3654
3656
|
blocksMenu(t) {
|
|
3655
|
-
this.popup(t, (e) =>
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
)
|
|
3665
|
-
|
|
3657
|
+
this.popup(t, (e) => this.menuItems(e, this.blockItems()));
|
|
3658
|
+
}
|
|
3659
|
+
alignItems() {
|
|
3660
|
+
return [
|
|
3661
|
+
["justifyLeft", "alignleft", h.alignleft],
|
|
3662
|
+
["justifyCenter", "aligncenter", h.aligncenter],
|
|
3663
|
+
["justifyRight", "alignright", h.alignright],
|
|
3664
|
+
["justifyFull", "alignjustify", h.alignjustify]
|
|
3665
|
+
].map(([e, i, s]) => ({
|
|
3666
|
+
label: this.t(i),
|
|
3667
|
+
icon: s,
|
|
3668
|
+
on: document.queryCommandState(e),
|
|
3669
|
+
action: () => this.exec(e)
|
|
3670
|
+
}));
|
|
3666
3671
|
}
|
|
3667
3672
|
blockLabel(t) {
|
|
3668
3673
|
return t === "p" ? this.t("para") : t === "pre" ? this.t("pre") : this.t("heading") + " " + t[1];
|
|
@@ -3771,7 +3776,7 @@ let Ei = (j = class {
|
|
|
3771
3776
|
}
|
|
3772
3777
|
buildToolbar() {
|
|
3773
3778
|
this.toolbar.innerHTML = "";
|
|
3774
|
-
const t = this.options.toolbar === !0 ?
|
|
3779
|
+
const t = this.options.toolbar === !0 ? Ue : this.options.toolbar, e = this.buildToolbarRegistry();
|
|
3775
3780
|
this.parseToolbarString(t).forEach((i) => {
|
|
3776
3781
|
const s = [];
|
|
3777
3782
|
i.forEach((n) => {
|
|
@@ -3875,10 +3880,28 @@ let Ei = (j = class {
|
|
|
3875
3880
|
this.mItem("superscript", h.superscriptic, () => this.exec("superscript")),
|
|
3876
3881
|
this.mItem("subscript", h.subscriptic, () => this.exec("subscript")),
|
|
3877
3882
|
this.mItem("code", h.inlinecodeic, () => this.toggleInlineCode()),
|
|
3883
|
+
this.mItem("quote", h.quote, () => this.toggleBlock("blockquote")),
|
|
3884
|
+
"|",
|
|
3885
|
+
{ label: this.t("fontfamily"), subBuild: (s) => this.menuItems(s, this.fontItems()) },
|
|
3886
|
+
{ label: this.t("fontsize"), subBuild: (s) => this.menuItems(s, this.sizeItems()) },
|
|
3887
|
+
{ label: this.t("blocks"), subBuild: (s) => this.menuItems(s, this.blockItems()) },
|
|
3888
|
+
{ label: this.t("align"), subBuild: (s) => this.menuItems(s, this.alignItems()) },
|
|
3889
|
+
{ label: this.t("lineheight"), icon: h.lineheight, subBuild: (s) => this.menuItems(s, this.blockStyleItems("lineHeight", Jt)) },
|
|
3890
|
+
{ label: this.t("wordspacing"), icon: h.wordspacing, subBuild: (s) => this.menuItems(s, this.blockStyleItems("wordSpacing", te)) },
|
|
3891
|
+
{ label: this.t("letterspacing"), icon: h.letterspacing, subBuild: (s) => this.menuItems(s, this.blockStyleItems("letterSpacing", ee)) },
|
|
3892
|
+
"|",
|
|
3893
|
+
{ label: this.t("forecolor"), icon: h.palette, subBuild: (s) => this.buildPaletteInto(s, this.foreColor, (n) => this.applyColor("fore", n)) },
|
|
3894
|
+
{ label: this.t("backcolor"), icon: h.backcolor, subBuild: (s) => this.buildPaletteInto(s, this.backColor, (n) => this.applyColor("back", n)) },
|
|
3895
|
+
"|",
|
|
3896
|
+
this.mItem("bullist", h.bullist, () => this.exec("insertUnorderedList")),
|
|
3897
|
+
this.mItem("numlist", h.numlist, () => this.exec("insertOrderedList")),
|
|
3898
|
+
this.mItem("outdent", h.outdent, () => this.exec("outdent")),
|
|
3899
|
+
this.mItem("indent", h.indent, () => this.exec("indent")),
|
|
3900
|
+
"|",
|
|
3901
|
+
this.mItem("ltr", h.ltr, () => this.setDir("ltr")),
|
|
3902
|
+
this.mItem("rtl", h.rtl, () => this.setDir("rtl")),
|
|
3878
3903
|
"|",
|
|
3879
|
-
this.
|
|
3880
|
-
this.mItem("uppercase", h.uppercaseic, () => this.transformCase("upper")),
|
|
3881
|
-
this.mItem("capitalize", h.capitalizeic, () => this.transformCase("capitalize")),
|
|
3904
|
+
{ label: this.t("changecase"), icon: h.caseic, sub: this.caseItems() },
|
|
3882
3905
|
"|",
|
|
3883
3906
|
this.mItem("clearformat", h.clearformatic, () => this.exec("removeFormat"))
|
|
3884
3907
|
],
|
|
@@ -3935,7 +3958,7 @@ let Ei = (j = class {
|
|
|
3935
3958
|
{ label: this.t("deltable"), icon: h.trash, action: () => this.tableOp("deltable") }
|
|
3936
3959
|
],
|
|
3937
3960
|
help: [this.mItem("helpttl", h.helpic, () => this.helpDlg(), "Alt+0")]
|
|
3938
|
-
}, e = this.options.menubar === !0 ?
|
|
3961
|
+
}, e = this.options.menubar === !0 ? ze : this.options.menubar, i = /* @__PURE__ */ new Set();
|
|
3939
3962
|
e.split(/\s+/).filter(Boolean).forEach((s) => {
|
|
3940
3963
|
if (i.has(s)) return;
|
|
3941
3964
|
if (i.add(s), !t[s]) {
|
|
@@ -3957,22 +3980,22 @@ let Ei = (j = class {
|
|
|
3957
3980
|
const i = ((o = this.closestBlock(e.anchorNode)) == null ? void 0 : o.closest("td,th")) || (e.anchorNode && e.anchorNode.nodeType === 1 ? (d = (c = e.anchorNode).closest) == null ? void 0 : d.call(c, "td,th") : null);
|
|
3958
3981
|
if (!i) return;
|
|
3959
3982
|
const s = i.parentElement, n = i.closest("table"), l = Array.from(s.children).indexOf(i), r = () => {
|
|
3960
|
-
const
|
|
3983
|
+
const u = s.cloneNode(!1);
|
|
3961
3984
|
return Array.from(s.children).forEach((m) => {
|
|
3962
3985
|
const b = document.createElement("td"), y = m.getAttribute("style");
|
|
3963
|
-
y && b.setAttribute("style", y), b.style.removeProperty("background-color"), b.innerHTML = "<br>",
|
|
3964
|
-
}),
|
|
3986
|
+
y && b.setAttribute("style", y), b.style.removeProperty("background-color"), b.innerHTML = "<br>", u.appendChild(b);
|
|
3987
|
+
}), u;
|
|
3965
3988
|
};
|
|
3966
3989
|
if (t === "rowabove" && s.before(r()), t === "rowbelow" && s.after(r()), t === "delrow") {
|
|
3967
|
-
const
|
|
3968
|
-
s.remove(),
|
|
3990
|
+
const u = s.parentElement;
|
|
3991
|
+
s.remove(), u.querySelector("tr") || n.remove();
|
|
3969
3992
|
}
|
|
3970
|
-
(t === "colbefore" || t === "colafter") && n.querySelectorAll("tr").forEach((
|
|
3971
|
-
const m =
|
|
3993
|
+
(t === "colbefore" || t === "colafter") && n.querySelectorAll("tr").forEach((u) => {
|
|
3994
|
+
const m = u.children[Math.min(l, u.children.length - 1)], b = document.createElement("td"), y = m.getAttribute("style");
|
|
3972
3995
|
y && b.setAttribute("style", y), b.style.removeProperty("width"), b.style.removeProperty("background-color"), b.innerHTML = "<br>", t === "colbefore" ? m.before(b) : m.after(b);
|
|
3973
|
-
}), t === "delcol" && (n.querySelectorAll("tr").forEach((
|
|
3996
|
+
}), t === "delcol" && (n.querySelectorAll("tr").forEach((u) => {
|
|
3974
3997
|
var m;
|
|
3975
|
-
return (m =
|
|
3998
|
+
return (m = u.children[l]) == null ? void 0 : m.remove();
|
|
3976
3999
|
}), n.querySelector("td,th") || n.remove()), t === "deltable" && n.remove(), this.onChange(), this.positionTableHandles();
|
|
3977
4000
|
}
|
|
3978
4001
|
/** Reorders the current row/column: 'rowup'/'rowdown' swap the caret's row with
|
|
@@ -4039,17 +4062,17 @@ let Ei = (j = class {
|
|
|
4039
4062
|
const t = this.tblActive;
|
|
4040
4063
|
if (!t) return;
|
|
4041
4064
|
let e, i, s, n, l;
|
|
4042
|
-
const r = "display:flex;align-items:center;gap:10px;margin:10px 0", o = "width:120px;color:#556;flex:none", c = "flex:1;border:1px solid #cfd6df;border-radius:6px;padding:7px 9px;font:14px inherit", d = t.querySelector("td,th"),
|
|
4065
|
+
const r = "display:flex;align-items:center;gap:10px;margin:10px 0", o = "width:120px;color:#556;flex:none", c = "flex:1;border:1px solid #cfd6df;border-radius:6px;padding:7px 9px;font:14px inherit", d = t.querySelector("td,th"), u = t.style.width || "", m = d && d.style.padding ? parseFloat(d.style.padding) : "", b = t.style.borderSpacing ? parseFloat(t.style.borderSpacing) : "", y = t.style.borderWidth ? parseFloat(t.style.borderWidth) : "", g = t.style.marginLeft, x = t.style.marginRight, w = g === "auto" && x === "auto" ? "center" : g === "auto" ? "right" : x === "auto" && g === "0" ? "left" : "";
|
|
4043
4066
|
this.dialog(
|
|
4044
4067
|
this.t("tablepropsttl"),
|
|
4045
4068
|
(E) => {
|
|
4046
|
-
const
|
|
4069
|
+
const A = (H, $) => {
|
|
4047
4070
|
const O = document.createElement("div");
|
|
4048
4071
|
O.style.cssText = r;
|
|
4049
4072
|
const _ = document.createElement("span");
|
|
4050
4073
|
_.style.cssText = o, _.textContent = this.t(H), O.append(_, $), E.appendChild(O);
|
|
4051
4074
|
};
|
|
4052
|
-
e = document.createElement("input"), e.type = "text", e.style.cssText = c, e.placeholder = "e.g. 600px or 100%", e.value =
|
|
4075
|
+
e = document.createElement("input"), e.type = "text", e.style.cssText = c, e.placeholder = "e.g. 600px or 100%", e.value = u, A("tblwidth", e), i = document.createElement("input"), i.type = "number", i.min = "0", i.style.cssText = c, i.value = String(m), A("tblcellpadding", i), s = document.createElement("input"), s.type = "number", s.min = "0", s.style.cssText = c, s.value = String(b), A("tblcellspacing", s), n = document.createElement("input"), n.type = "number", n.min = "0", n.style.cssText = c, n.value = String(y), A("tblborder", n), l = document.createElement("select"), l.style.cssText = c, [
|
|
4053
4076
|
["", "alignnone"],
|
|
4054
4077
|
["left", "alignleft"],
|
|
4055
4078
|
["center", "aligncenter"],
|
|
@@ -4057,7 +4080,7 @@ let Ei = (j = class {
|
|
|
4057
4080
|
].forEach(([H, $]) => {
|
|
4058
4081
|
const O = document.createElement("option");
|
|
4059
4082
|
O.value = H, O.textContent = this.t($), H === w && (O.selected = !0), l.appendChild(O);
|
|
4060
|
-
}),
|
|
4083
|
+
}), A("tblalign", l);
|
|
4061
4084
|
},
|
|
4062
4085
|
[
|
|
4063
4086
|
{ label: this.t("cancel"), action: () => this.closeDlg() },
|
|
@@ -4295,16 +4318,16 @@ let Ei = (j = class {
|
|
|
4295
4318
|
const o = document.createElement("div");
|
|
4296
4319
|
o.className = "chgrid" + (i ? " emgrid" : ""), r.appendChild(o);
|
|
4297
4320
|
const c = (d) => {
|
|
4298
|
-
l.querySelectorAll("button").forEach((
|
|
4321
|
+
l.querySelectorAll("button").forEach((u, m) => u.classList.toggle("on", m === d)), o.innerHTML = "", e[d].chars.forEach((u) => {
|
|
4299
4322
|
const m = document.createElement("button");
|
|
4300
|
-
m.type = "button", m.textContent =
|
|
4301
|
-
this.closeDlg(), this.exec("insertText",
|
|
4323
|
+
m.type = "button", m.textContent = u, m.onclick = () => {
|
|
4324
|
+
this.closeDlg(), this.exec("insertText", u);
|
|
4302
4325
|
}, o.appendChild(m);
|
|
4303
4326
|
}), r.scrollTop = 0;
|
|
4304
4327
|
};
|
|
4305
|
-
e.forEach((d,
|
|
4328
|
+
e.forEach((d, u) => {
|
|
4306
4329
|
const m = document.createElement("button");
|
|
4307
|
-
m.type = "button", m.textContent = this.t(d.key), m.addEventListener("click", () => c(
|
|
4330
|
+
m.type = "button", m.textContent = this.t(d.key), m.addEventListener("click", () => c(u)), l.appendChild(m);
|
|
4308
4331
|
}), n.append(l, r), s.appendChild(n), c(0);
|
|
4309
4332
|
});
|
|
4310
4333
|
}
|
|
@@ -4560,9 +4583,9 @@ let Ei = (j = class {
|
|
|
4560
4583
|
(d = this.vidCtx) == null || d.replaceWith(c), this.vidCtx = c, this.positionVidCtx();
|
|
4561
4584
|
}, s = (c) => {
|
|
4562
4585
|
this.setVideoAlign(t, c), i();
|
|
4563
|
-
}, n = t.style.float === "left", l = t.style.float === "right", r = !n && !l && t.style.marginLeft === "auto" && t.style.marginRight === "auto", o = (c, d,
|
|
4586
|
+
}, n = t.style.float === "left", l = t.style.float === "right", r = !n && !l && t.style.marginLeft === "auto" && t.style.marginRight === "auto", o = (c, d, u, m) => {
|
|
4564
4587
|
const b = this.ctxBtn(c, d, m);
|
|
4565
|
-
return b.classList.toggle("on",
|
|
4588
|
+
return b.classList.toggle("on", u), b;
|
|
4566
4589
|
};
|
|
4567
4590
|
return e.append(
|
|
4568
4591
|
o(h.alignleft, this.t("alignleft"), n, () => s("left")),
|
|
@@ -4611,10 +4634,10 @@ let Ei = (j = class {
|
|
|
4611
4634
|
this.saveSel();
|
|
4612
4635
|
let t, e, i, s, n, l;
|
|
4613
4636
|
const r = (c, d) => {
|
|
4614
|
-
const
|
|
4615
|
-
|
|
4637
|
+
const u = document.createElement("div");
|
|
4638
|
+
u.className = "dfield";
|
|
4616
4639
|
const m = document.createElement("label");
|
|
4617
|
-
return m.textContent = this.t(c),
|
|
4640
|
+
return m.textContent = this.t(c), u.append(m, d), u;
|
|
4618
4641
|
}, o = () => {
|
|
4619
4642
|
const c = document.createElement("input");
|
|
4620
4643
|
return c.type = "url", c;
|
|
@@ -4624,15 +4647,15 @@ let Ei = (j = class {
|
|
|
4624
4647
|
(c) => {
|
|
4625
4648
|
const d = document.createElement("div");
|
|
4626
4649
|
d.className = "dtabs";
|
|
4627
|
-
const
|
|
4650
|
+
const u = [], m = (g, x) => {
|
|
4628
4651
|
const w = document.createElement("button");
|
|
4629
4652
|
w.type = "button", w.textContent = this.t(g);
|
|
4630
4653
|
const E = document.createElement("div");
|
|
4631
4654
|
E.className = "dtabpanel", x(E);
|
|
4632
|
-
const
|
|
4633
|
-
|
|
4655
|
+
const A = u.length;
|
|
4656
|
+
u.push(E), w.addEventListener("click", () => b(A)), d.appendChild(w);
|
|
4634
4657
|
}, b = (g) => {
|
|
4635
|
-
d.querySelectorAll("button").forEach((x, w) => x.classList.toggle("on", w === g)),
|
|
4658
|
+
d.querySelectorAll("button").forEach((x, w) => x.classList.toggle("on", w === g)), u.forEach((x, w) => x.style.display = w === g ? "" : "none");
|
|
4636
4659
|
};
|
|
4637
4660
|
m("vidgeneral", (g) => {
|
|
4638
4661
|
t = o(), t.placeholder = this.t("videourlph");
|
|
@@ -4661,8 +4684,8 @@ let Ei = (j = class {
|
|
|
4661
4684
|
_.onload = () => $(_.result), _.readAsDataURL(H);
|
|
4662
4685
|
}
|
|
4663
4686
|
}), x.append(t, w, E), t.style.flex = "1", g.appendChild(r("vidsource", x));
|
|
4664
|
-
const
|
|
4665
|
-
|
|
4687
|
+
const A = document.createElement("div");
|
|
4688
|
+
A.className = "drow", e = document.createElement("input"), e.type = "number", e.value = "560", i = document.createElement("input"), i.type = "number", i.value = "314", A.append(r("tblwidth", e), r("tblheight", i)), g.appendChild(A);
|
|
4666
4689
|
}), m("vidembed", (g) => {
|
|
4667
4690
|
const x = document.createElement("p");
|
|
4668
4691
|
x.textContent = this.t("vidembedhint"), x.style.cssText = "margin:0 0 8px;color:#556;font-size:13.5px", s = document.createElement("textarea"), s.style.cssText = "width:100%;box-sizing:border-box;height:160px", g.append(x, s);
|
|
@@ -4670,7 +4693,7 @@ let Ei = (j = class {
|
|
|
4670
4693
|
n = o(), l = o(), g.append(r("vidaltsource", n), r("vidposter", l));
|
|
4671
4694
|
});
|
|
4672
4695
|
const y = document.createElement("div");
|
|
4673
|
-
y.className = "dtabbody",
|
|
4696
|
+
y.className = "dtabbody", u.forEach((g) => y.appendChild(g)), c.append(d, y), b(0), setTimeout(() => t.focus(), 0);
|
|
4674
4697
|
},
|
|
4675
4698
|
[
|
|
4676
4699
|
{ label: this.t("cancel"), action: () => this.closeDlg() },
|
|
@@ -4678,7 +4701,7 @@ let Ei = (j = class {
|
|
|
4678
4701
|
label: this.t("save"),
|
|
4679
4702
|
primary: !0,
|
|
4680
4703
|
action: () => {
|
|
4681
|
-
const c = s.value.trim(), d = t.value.trim(),
|
|
4704
|
+
const c = s.value.trim(), d = t.value.trim(), u = parseInt(e.value, 10) || 560, m = parseInt(i.value, 10) || 314;
|
|
4682
4705
|
if (this.closeDlg(), !c && !d) return;
|
|
4683
4706
|
if (this.restoreSel(), c) {
|
|
4684
4707
|
document.execCommand("insertHTML", !1, `<span class="video-embed" contenteditable="false">${c}</span>`), this.onChange();
|
|
@@ -4686,13 +4709,13 @@ let Ei = (j = class {
|
|
|
4686
4709
|
}
|
|
4687
4710
|
const b = this.videoEmbedUrl(d);
|
|
4688
4711
|
if (b)
|
|
4689
|
-
document.execCommand("insertHTML", !1, this.videoEmbedHTML(b,
|
|
4712
|
+
document.execCommand("insertHTML", !1, this.videoEmbedHTML(b, u, m));
|
|
4690
4713
|
else {
|
|
4691
4714
|
const y = n.value.trim(), g = l.value.trim();
|
|
4692
4715
|
document.execCommand(
|
|
4693
4716
|
"insertHTML",
|
|
4694
4717
|
!1,
|
|
4695
|
-
`<video controls width="${
|
|
4718
|
+
`<video controls width="${u}" height="${m}"${g ? ` poster="${this.escapeAttr(g)}"` : ""}><source src="${this.escapeAttr(d)}">${y ? `<source src="${this.escapeAttr(y)}">` : ""}</video>`
|
|
4696
4719
|
);
|
|
4697
4720
|
}
|
|
4698
4721
|
this.onChange();
|
|
@@ -4774,10 +4797,10 @@ let Ei = (j = class {
|
|
|
4774
4797
|
l.className = "lbl", l.textContent = ((o = t.find(([c]) => c === e)) == null ? void 0 : o[1]) || "", n.append(l), n.insertAdjacentHTML("beforeend", h.chev);
|
|
4775
4798
|
const r = document.createElement("div");
|
|
4776
4799
|
return r.className = "dsel-list", t.forEach(([c, d]) => {
|
|
4777
|
-
const
|
|
4778
|
-
|
|
4779
|
-
i = c, l.textContent = d, r.querySelectorAll("button").forEach((m) => m.classList.toggle("on", m ===
|
|
4780
|
-
}), r.appendChild(
|
|
4800
|
+
const u = document.createElement("button");
|
|
4801
|
+
u.type = "button", u.textContent = d, u.classList.toggle("on", c === i), u.addEventListener("click", () => {
|
|
4802
|
+
i = c, l.textContent = d, r.querySelectorAll("button").forEach((m) => m.classList.toggle("on", m === u)), s.classList.remove("open"), n.focus();
|
|
4803
|
+
}), r.appendChild(u);
|
|
4781
4804
|
}), n.addEventListener("click", () => {
|
|
4782
4805
|
var c;
|
|
4783
4806
|
s.classList.toggle("open"), s.classList.contains("open") && ((c = r.querySelector(".on")) == null || c.scrollIntoView({ block: "nearest" }));
|
|
@@ -4800,7 +4823,7 @@ let Ei = (j = class {
|
|
|
4800
4823
|
const n = document.createElement("div");
|
|
4801
4824
|
n.className = "dfield";
|
|
4802
4825
|
const l = document.createElement("label");
|
|
4803
|
-
l.textContent = this.t("codelang"), e = this.dlgSelect(
|
|
4826
|
+
l.textContent = this.t("codelang"), e = this.dlgSelect(ie, (t == null ? void 0 : t.dataset.lang) || "plain"), n.append(l, e.el), i = document.createElement("textarea"), i.className = "code-input", i.spellcheck = !1, i.value = ((r = t == null ? void 0 : t.querySelector("code")) == null ? void 0 : r.textContent) || "", i.placeholder = "const answer = 42;", s.append(n, i), setTimeout(() => i.focus(), 0);
|
|
4804
4827
|
},
|
|
4805
4828
|
[
|
|
4806
4829
|
{ label: this.t("cancel"), action: () => this.closeDlg() },
|
|
@@ -4809,7 +4832,7 @@ let Ei = (j = class {
|
|
|
4809
4832
|
primary: !0,
|
|
4810
4833
|
action: () => {
|
|
4811
4834
|
var r;
|
|
4812
|
-
const s = i.value.replace(/\s+$/, ""), n = e.value(), l = ((r =
|
|
4835
|
+
const s = i.value.replace(/\s+$/, ""), n = e.value(), l = ((r = ie.find(([o]) => o === n)) == null ? void 0 : r[1]) || n;
|
|
4813
4836
|
if (this.closeDlg(), !!s.trim()) {
|
|
4814
4837
|
if (t) {
|
|
4815
4838
|
t.dataset.lang = n, t.setAttribute("data-lang-label", l);
|
|
@@ -5022,15 +5045,15 @@ let Ei = (j = class {
|
|
|
5022
5045
|
const o = this.tblCtx.offsetWidth, c = this.tblCtx.offsetHeight;
|
|
5023
5046
|
let d = s + (n - s) / 2 - o / 2;
|
|
5024
5047
|
d = Math.max(8 + scrollX, Math.min(d, scrollX + innerWidth - o - 8));
|
|
5025
|
-
let
|
|
5026
|
-
|
|
5048
|
+
let u = i - c - 8;
|
|
5049
|
+
u < this.ctxMinTop() && (u = l + 8), this.tblCtx.style.left = d + "px", this.tblCtx.style.top = u + "px";
|
|
5027
5050
|
}
|
|
5028
5051
|
this.tblColBars.forEach((o) => o.remove()), this.tblColBars = [];
|
|
5029
5052
|
const r = this.tblActive.rows[0];
|
|
5030
5053
|
if (r)
|
|
5031
5054
|
for (let o = 0; o < r.cells.length - 1; o++) {
|
|
5032
|
-
const c = r.cells[o].getBoundingClientRect(), d = (t ? c.left : c.right) + scrollX,
|
|
5033
|
-
|
|
5055
|
+
const c = r.cells[o].getBoundingClientRect(), d = (t ? c.left : c.right) + scrollX, u = document.createElement("div");
|
|
5056
|
+
u.className = "tbl-colbar", u.style.top = i + "px", u.style.left = d + "px", u.style.height = l - i + "px", document.body.appendChild(u), u.addEventListener("mousedown", (m) => this.startColBarDrag(m, o)), this.tblColBars.push(u);
|
|
5034
5057
|
}
|
|
5035
5058
|
this.positionCellMarker(), this.positionOpMark();
|
|
5036
5059
|
}
|
|
@@ -5062,15 +5085,15 @@ let Ei = (j = class {
|
|
|
5062
5085
|
t.preventDefault(), t.stopPropagation();
|
|
5063
5086
|
const i = this.tblActive;
|
|
5064
5087
|
if (!i) return;
|
|
5065
|
-
const s = this.ed.getAttribute("dir") === "rtl", n = Array.from(i.rows), l = n.map((
|
|
5088
|
+
const s = this.ed.getAttribute("dir") === "rtl", n = Array.from(i.rows), l = n.map((u) => u.cells[e]).filter(Boolean), r = n.map((u) => u.cells[e + 1]).filter(Boolean);
|
|
5066
5089
|
if (!l.length || !r.length) return;
|
|
5067
5090
|
const o = t.clientX, c = l[0].getBoundingClientRect().width, d = r[0].getBoundingClientRect().width;
|
|
5068
|
-
i.style.tableLayout = "fixed", this.withNoTextSelect((
|
|
5091
|
+
i.style.tableLayout = "fixed", this.withNoTextSelect((u) => {
|
|
5069
5092
|
const m = (y) => {
|
|
5070
5093
|
const g = (s ? -1 : 1) * (y.clientX - o);
|
|
5071
5094
|
l.forEach((x) => x.style.width = Math.max(24, Math.round(c + g)) + "px"), r.forEach((x) => x.style.width = Math.max(24, Math.round(d - g)) + "px"), this.positionTableHandles();
|
|
5072
5095
|
}, b = () => {
|
|
5073
|
-
window.removeEventListener("mousemove", m), window.removeEventListener("mouseup", b),
|
|
5096
|
+
window.removeEventListener("mousemove", m), window.removeEventListener("mouseup", b), u(), this.onChange();
|
|
5074
5097
|
};
|
|
5075
5098
|
window.addEventListener("mousemove", m), window.addEventListener("mouseup", b);
|
|
5076
5099
|
});
|
|
@@ -5101,9 +5124,9 @@ let Ei = (j = class {
|
|
|
5101
5124
|
(d = this.imgCtx) == null || d.replaceWith(c), this.imgCtx = c, this.positionImageHandles();
|
|
5102
5125
|
}, s = (c) => {
|
|
5103
5126
|
this.setImageAlign(t, c), i();
|
|
5104
|
-
}, n = t.style.float === "left", l = t.style.float === "right", r = !n && !l && t.style.marginLeft === "auto" && t.style.marginRight === "auto", o = (c, d,
|
|
5127
|
+
}, n = t.style.float === "left", l = t.style.float === "right", r = !n && !l && t.style.marginLeft === "auto" && t.style.marginRight === "auto", o = (c, d, u, m) => {
|
|
5105
5128
|
const b = this.ctxBtn(c, d, m);
|
|
5106
|
-
return b.classList.toggle("on",
|
|
5129
|
+
return b.classList.toggle("on", u), b;
|
|
5107
5130
|
};
|
|
5108
5131
|
return e.append(
|
|
5109
5132
|
o(h.alignleft, this.t("alignleft"), n, () => s("left")),
|
|
@@ -5184,7 +5207,22 @@ let Ei = (j = class {
|
|
|
5184
5207
|
}
|
|
5185
5208
|
/* ---------------------------------------------------------- selection bubble toolbar */
|
|
5186
5209
|
toggleBlock(t) {
|
|
5187
|
-
|
|
5210
|
+
const e = this.currentBlock() === t;
|
|
5211
|
+
this.exec("formatBlock", e ? "<p>" : "<" + t + ">"), t === "blockquote" && e && this.unwrapBlockquote();
|
|
5212
|
+
}
|
|
5213
|
+
/** Some browsers leave the <blockquote> wrapper in place after formatBlock('<p>'); strip it manually if so. */
|
|
5214
|
+
unwrapBlockquote() {
|
|
5215
|
+
const t = window.getSelection();
|
|
5216
|
+
let e = t && this.ed.contains(t.anchorNode) ? t.anchorNode : null;
|
|
5217
|
+
for (; e && e !== this.ed; ) {
|
|
5218
|
+
if (e.nodeType === 1 && e.tagName === "BLOCKQUOTE") {
|
|
5219
|
+
const i = e, s = i.parentNode;
|
|
5220
|
+
for (; i.firstChild; ) s.insertBefore(i.firstChild, i);
|
|
5221
|
+
s.removeChild(i), this.onChange();
|
|
5222
|
+
return;
|
|
5223
|
+
}
|
|
5224
|
+
e = e.parentNode;
|
|
5225
|
+
}
|
|
5188
5226
|
}
|
|
5189
5227
|
clearSelToolbar() {
|
|
5190
5228
|
var t;
|
|
@@ -5247,8 +5285,13 @@ let Ei = (j = class {
|
|
|
5247
5285
|
currentBlock() {
|
|
5248
5286
|
const t = window.getSelection();
|
|
5249
5287
|
if (!t || !t.anchorNode || !this.ed.contains(t.anchorNode)) return "p";
|
|
5250
|
-
|
|
5251
|
-
|
|
5288
|
+
let e = t.anchorNode;
|
|
5289
|
+
for (; e && e !== this.ed; ) {
|
|
5290
|
+
if (e.nodeType === 1 && e.tagName === "BLOCKQUOTE") return "blockquote";
|
|
5291
|
+
e = e.parentNode;
|
|
5292
|
+
}
|
|
5293
|
+
const i = this.closestBlock(t.anchorNode);
|
|
5294
|
+
return i ? i.tagName.toLowerCase().replace("div", "p") : "p";
|
|
5252
5295
|
}
|
|
5253
5296
|
/** Element whose computed font reflects the current caret, falling back to the editor root before any selection lands inside it. */
|
|
5254
5297
|
fontRefEl() {
|
|
@@ -5266,7 +5309,7 @@ let Ei = (j = class {
|
|
|
5266
5309
|
refreshState() {
|
|
5267
5310
|
var o, c, d;
|
|
5268
5311
|
const t = window.getSelection(), e = t ? this.ed.contains(t.anchorNode) : !1, i = this.currentBlock();
|
|
5269
|
-
[this.toolbar, this.selCtx].filter(Boolean).forEach((
|
|
5312
|
+
[this.toolbar, this.selCtx].filter(Boolean).forEach((u) => {
|
|
5270
5313
|
[
|
|
5271
5314
|
"bold",
|
|
5272
5315
|
"italic",
|
|
@@ -5279,22 +5322,22 @@ let Ei = (j = class {
|
|
|
5279
5322
|
"insertOrderedList",
|
|
5280
5323
|
"insertUnorderedList"
|
|
5281
5324
|
].forEach((b) => {
|
|
5282
|
-
const y =
|
|
5325
|
+
const y = u.querySelector(`[data-id=${b}]`);
|
|
5283
5326
|
y && y.classList.toggle("on", e && document.queryCommandState(b));
|
|
5284
5327
|
}), ["h2", "h3", "blockquote"].forEach((b) => {
|
|
5285
|
-
const y =
|
|
5328
|
+
const y = u.querySelector(`[data-id=${b}]`);
|
|
5286
5329
|
y && y.classList.toggle("on", e && i === b);
|
|
5287
5330
|
});
|
|
5288
|
-
const m =
|
|
5331
|
+
const m = u.querySelector("[data-id=code]");
|
|
5289
5332
|
m && m.classList.toggle("on", e && !!this.closestInlineCode());
|
|
5290
5333
|
});
|
|
5291
5334
|
const n = t ? this.closestBlock(t.anchorNode) : null, l = ((o = n == null ? void 0 : n.closest("[dir]")) == null ? void 0 : o.getAttribute("dir")) || this.ed.getAttribute("dir") || this.dir();
|
|
5292
5335
|
(c = this.toolbar.querySelector("[data-id=ltr]")) == null || c.classList.toggle("on", e && l === "ltr"), (d = this.toolbar.querySelector("[data-id=rtl]")) == null || d.classList.toggle("on", e && l === "rtl");
|
|
5293
|
-
const r = (
|
|
5294
|
-
const y = this.toolbar.querySelector(`[data-id=${
|
|
5336
|
+
const r = (u, m, b) => {
|
|
5337
|
+
const y = this.toolbar.querySelector(`[data-id=${u}] .lbl`);
|
|
5295
5338
|
y && (y.textContent = m || b || "", y.classList.toggle("empty", !m));
|
|
5296
5339
|
};
|
|
5297
|
-
r("fontsel", this.currentFont()), r("sizesel", this.currentSize().replace("px", "")), e && r("blocksel",
|
|
5340
|
+
r("fontsel", this.currentFont()), r("sizesel", this.currentSize().replace("px", "")), e && r("blocksel", se.some((u) => u[0] === i) ? this.blockLabel(i) : this.t("para")), this.sbWords.textContent = this.countWords() + " " + this.t("words");
|
|
5298
5341
|
}
|
|
5299
5342
|
countWords() {
|
|
5300
5343
|
const t = (this.ed.textContent || "").trim();
|
|
@@ -5320,17 +5363,17 @@ let Ei = (j = class {
|
|
|
5320
5363
|
return;
|
|
5321
5364
|
}
|
|
5322
5365
|
}
|
|
5323
|
-
i ? document.execCommand("insertHTML", !1,
|
|
5366
|
+
i ? document.execCommand("insertHTML", !1, ui(i, this.dir())) : document.execCommand("insertHTML", !1, pi(e.getData("text/plain"))), this.onChange();
|
|
5324
5367
|
}
|
|
5325
5368
|
/* ---------------------------------------------------------- init */
|
|
5326
5369
|
initUI() {
|
|
5327
5370
|
this.closePop(), this.closeDlg(), this.clearTableHandles(), this.clearImgPlaceholderSel(), this.clearVphPlaceholderSel(), this.clearVidHandles(), this.clearCodeSel(), this.shell.dir = this.dir(), this.ed.dir = this.dir(), this.options.menubar ? this.buildMenubar() : this.menubar.style.display = "none", this.options.toolbar ? this.buildToolbar() : this.toolbar.style.display = "none", this.sbHelp.textContent = this.t("statushelp"), this.refreshState();
|
|
5328
5371
|
}
|
|
5329
5372
|
}, j.instanceCounter = 0, j.TBR_COLLAPSE_MAX = 992, j);
|
|
5330
|
-
const Si =
|
|
5331
|
-
({ value:
|
|
5332
|
-
const o = z(null), c = z(null), d = z(!1),
|
|
5333
|
-
return b.current = e, y.current = i,
|
|
5373
|
+
const Si = _e(
|
|
5374
|
+
({ value: p, defaultValue: t, onChange: e, onReady: i, className: s, style: n, ...l }, r) => {
|
|
5375
|
+
const o = z(null), c = z(null), d = z(!1), u = z(p ?? t), m = z(null), b = z(e), y = z(i);
|
|
5376
|
+
return b.current = e, y.current = i, Fe(r, () => ({
|
|
5334
5377
|
getContent: () => {
|
|
5335
5378
|
var g;
|
|
5336
5379
|
return ((g = c.current) == null ? void 0 : g.getContent()) ?? "";
|
|
@@ -5371,10 +5414,10 @@ const Si = Ne(
|
|
|
5371
5414
|
if (!o.current) return;
|
|
5372
5415
|
const g = new Ei({
|
|
5373
5416
|
target: o.current,
|
|
5374
|
-
initialContent:
|
|
5417
|
+
initialContent: u.current,
|
|
5375
5418
|
onChange: (x) => {
|
|
5376
5419
|
var w;
|
|
5377
|
-
d.current = !0,
|
|
5420
|
+
d.current = !0, u.current = x, (w = b.current) == null || w.call(b, x);
|
|
5378
5421
|
},
|
|
5379
5422
|
onReady: (x) => {
|
|
5380
5423
|
var w;
|
|
@@ -5387,18 +5430,18 @@ const Si = Ne(
|
|
|
5387
5430
|
};
|
|
5388
5431
|
}, []), ot(() => {
|
|
5389
5432
|
var g, x;
|
|
5390
|
-
if (
|
|
5433
|
+
if (p !== void 0 && p !== u.current) {
|
|
5391
5434
|
if (d.current) {
|
|
5392
5435
|
d.current = !1;
|
|
5393
5436
|
return;
|
|
5394
5437
|
}
|
|
5395
5438
|
if ((g = o.current) != null && g.contains(document.activeElement)) {
|
|
5396
|
-
m.current =
|
|
5439
|
+
m.current = p;
|
|
5397
5440
|
return;
|
|
5398
5441
|
}
|
|
5399
|
-
|
|
5442
|
+
u.current = p, (x = c.current) == null || x.setContent(p);
|
|
5400
5443
|
}
|
|
5401
|
-
}, [
|
|
5444
|
+
}, [p]), ot(() => {
|
|
5402
5445
|
const g = o.current;
|
|
5403
5446
|
if (!g) return;
|
|
5404
5447
|
const x = (w) => {
|
|
@@ -5406,14 +5449,14 @@ const Si = Ne(
|
|
|
5406
5449
|
if (m.current === null) return;
|
|
5407
5450
|
const E = w.relatedTarget;
|
|
5408
5451
|
if (E && g.contains(E)) return;
|
|
5409
|
-
const
|
|
5410
|
-
m.current = null,
|
|
5452
|
+
const A = m.current;
|
|
5453
|
+
m.current = null, u.current = A, (H = c.current) == null || H.setContent(A);
|
|
5411
5454
|
};
|
|
5412
5455
|
return g.addEventListener("focusout", x), () => g.removeEventListener("focusout", x);
|
|
5413
5456
|
}, []), ot(() => {
|
|
5414
5457
|
var g;
|
|
5415
5458
|
l.language && ((g = c.current) == null || g.setLanguage(l.language));
|
|
5416
|
-
}, [l.language]), /* @__PURE__ */
|
|
5459
|
+
}, [l.language]), /* @__PURE__ */ We.jsx("div", { ref: o, className: s, style: n });
|
|
5417
5460
|
}
|
|
5418
5461
|
);
|
|
5419
5462
|
Si.displayName = "FableEditor";
|