fable-editor 1.2.5 → 1.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular/core/editor.d.ts +7 -2
- package/dist/angular/esm2022/core/editor.mjs +61 -3
- package/dist/angular/fesm2022/fable-editor.mjs +60 -2
- package/dist/angular/fesm2022/fable-editor.mjs.map +1 -1
- package/dist/core/editor.css +1 -1
- package/dist/core/editor.d.ts +7 -2
- package/dist/core/editor.d.ts.map +1 -1
- package/dist/core/index.cjs +3 -3
- package/dist/core/index.mjs +136 -103
- package/dist/react/index.cjs +9 -9
- package/dist/react/index.mjs +173 -140
- package/package.json +1 -1
- package/style.css +1 -1
package/dist/react/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ce, { forwardRef as _e, useRef as z, useImperativeHandle as
|
|
1
|
+
import ce, { forwardRef as _e, useRef as z, useImperativeHandle as $e, useEffect as ot } from "react";
|
|
2
2
|
var Et = { exports: {} }, J = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
@@ -10,7 +10,7 @@ var Et = { exports: {} }, J = {};
|
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
12
|
var Gt;
|
|
13
|
-
function
|
|
13
|
+
function je() {
|
|
14
14
|
if (Gt) return J;
|
|
15
15
|
Gt = 1;
|
|
16
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 };
|
|
@@ -34,7 +34,7 @@ var tt = {};
|
|
|
34
34
|
* LICENSE file in the root directory of this source tree.
|
|
35
35
|
*/
|
|
36
36
|
var Kt;
|
|
37
|
-
function
|
|
37
|
+
function We() {
|
|
38
38
|
return Kt || (Kt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
39
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) {
|
|
@@ -61,16 +61,16 @@ function je() {
|
|
|
61
61
|
A.unshift("Warning: " + f), Function.prototype.apply.call(console[a], console, A);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
var H = !1, $ = !1, O = !1,
|
|
64
|
+
var H = !1, $ = !1, O = !1, F = !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 ||
|
|
66
|
+
function ue(a) {
|
|
67
|
+
return !!(typeof a == "string" || typeof a == "function" || a === i || a === n || et || a === s || a === c || a === d || F || 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 pe(a, f, v) {
|
|
74
74
|
var T = a.displayName;
|
|
75
75
|
if (T)
|
|
76
76
|
return T;
|
|
@@ -110,7 +110,7 @@ function je() {
|
|
|
110
110
|
var v = a;
|
|
111
111
|
return kt(v._context) + ".Provider";
|
|
112
112
|
case o:
|
|
113
|
-
return
|
|
113
|
+
return pe(a, a.render, "ForwardRef");
|
|
114
114
|
case u:
|
|
115
115
|
var T = a.displayName || null;
|
|
116
116
|
return T !== null ? T : W(a.type) || "Memo";
|
|
@@ -129,7 +129,7 @@ function je() {
|
|
|
129
129
|
function Bt() {
|
|
130
130
|
}
|
|
131
131
|
Bt.__reactDisabledLog = !0;
|
|
132
|
-
function
|
|
132
|
+
function me() {
|
|
133
133
|
{
|
|
134
134
|
if (G === 0) {
|
|
135
135
|
Lt = console.log, Ht = console.info, At = console.warn, It = console.error, qt = console.group, Rt = console.groupCollapsed, Pt = console.groupEnd;
|
|
@@ -152,7 +152,7 @@ function je() {
|
|
|
152
152
|
G++;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function fe() {
|
|
156
156
|
{
|
|
157
157
|
if (G--, G === 0) {
|
|
158
158
|
var a = {
|
|
@@ -203,8 +203,8 @@ function je() {
|
|
|
203
203
|
}
|
|
204
204
|
var ft = !1, st;
|
|
205
205
|
{
|
|
206
|
-
var
|
|
207
|
-
st = new
|
|
206
|
+
var ge = typeof WeakMap == "function" ? WeakMap : Map;
|
|
207
|
+
st = new ge();
|
|
208
208
|
}
|
|
209
209
|
function Nt(a, f) {
|
|
210
210
|
if (!a || ft)
|
|
@@ -219,7 +219,7 @@ function je() {
|
|
|
219
219
|
var L = Error.prepareStackTrace;
|
|
220
220
|
Error.prepareStackTrace = void 0;
|
|
221
221
|
var A;
|
|
222
|
-
A = pt.current, pt.current = null,
|
|
222
|
+
A = pt.current, pt.current = null, me();
|
|
223
223
|
try {
|
|
224
224
|
if (f) {
|
|
225
225
|
var M = function() {
|
|
@@ -263,24 +263,24 @@ function je() {
|
|
|
263
263
|
if (R !== 1 || P !== 1)
|
|
264
264
|
do
|
|
265
265
|
if (R--, P--, P < 0 || S[R] !== N[P]) {
|
|
266
|
-
var
|
|
266
|
+
var _ = `
|
|
267
267
|
` + S[R].replace(" at new ", " at ");
|
|
268
|
-
return a.displayName &&
|
|
268
|
+
return a.displayName && _.includes("<anonymous>") && (_ = _.replace("<anonymous>", a.displayName)), typeof a == "function" && st.set(a, _), _;
|
|
269
269
|
}
|
|
270
270
|
while (R >= 1 && P >= 0);
|
|
271
271
|
break;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
} finally {
|
|
275
|
-
ft = !1, pt.current = A,
|
|
275
|
+
ft = !1, pt.current = A, fe(), Error.prepareStackTrace = L;
|
|
276
276
|
}
|
|
277
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
|
|
280
|
+
function ve(a, f, v) {
|
|
281
281
|
return Nt(a, !1);
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function be(a) {
|
|
284
284
|
var f = a.prototype;
|
|
285
285
|
return !!(f && f.isReactComponent);
|
|
286
286
|
}
|
|
@@ -288,7 +288,7 @@ function je() {
|
|
|
288
288
|
if (a == null)
|
|
289
289
|
return "";
|
|
290
290
|
if (typeof a == "function")
|
|
291
|
-
return Nt(a,
|
|
291
|
+
return Nt(a, be(a));
|
|
292
292
|
if (typeof a == "string")
|
|
293
293
|
return it(a);
|
|
294
294
|
switch (a) {
|
|
@@ -300,7 +300,7 @@ function je() {
|
|
|
300
300
|
if (typeof a == "object")
|
|
301
301
|
switch (a.$$typeof) {
|
|
302
302
|
case o:
|
|
303
|
-
return
|
|
303
|
+
return ve(a.render);
|
|
304
304
|
case u:
|
|
305
305
|
return nt(a.type, f, v);
|
|
306
306
|
case m: {
|
|
@@ -321,7 +321,7 @@ function je() {
|
|
|
321
321
|
} else
|
|
322
322
|
Zt.setExtraStackFrame(null);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function ye(a, f, v, T, L) {
|
|
325
325
|
{
|
|
326
326
|
var A = Function.call.bind(K);
|
|
327
327
|
for (var M in a)
|
|
@@ -340,17 +340,17 @@ function je() {
|
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
var
|
|
343
|
+
var xe = Array.isArray;
|
|
344
344
|
function gt(a) {
|
|
345
|
-
return
|
|
345
|
+
return xe(a);
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function Ce(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 we(a) {
|
|
354
354
|
try {
|
|
355
355
|
return Ot(a), !1;
|
|
356
356
|
} catch {
|
|
@@ -360,17 +360,17 @@ function je() {
|
|
|
360
360
|
function Ot(a) {
|
|
361
361
|
return "" + a;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
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.",
|
|
363
|
+
function Ft(a) {
|
|
364
|
+
if (we(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.", Ce(a)), Ot(a);
|
|
366
366
|
}
|
|
367
|
-
var
|
|
367
|
+
var _t = w.ReactCurrentOwner, Te = {
|
|
368
368
|
key: !0,
|
|
369
369
|
ref: !0,
|
|
370
370
|
__self: !0,
|
|
371
371
|
__source: !0
|
|
372
372
|
}, $t, jt;
|
|
373
|
-
function
|
|
373
|
+
function Ee(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 je() {
|
|
|
378
378
|
}
|
|
379
379
|
return a.ref !== void 0;
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function Se(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 je() {
|
|
|
386
386
|
}
|
|
387
387
|
return a.key !== void 0;
|
|
388
388
|
}
|
|
389
|
-
function Se(a, f) {
|
|
390
|
-
typeof a.ref == "string" && Ft.current;
|
|
391
|
-
}
|
|
392
389
|
function Me(a, f) {
|
|
390
|
+
typeof a.ref == "string" && _t.current;
|
|
391
|
+
}
|
|
392
|
+
function ke(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 je() {
|
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function Le(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 je() {
|
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
var
|
|
414
|
+
var He = function(a, f, v, T, L, A, M) {
|
|
415
415
|
var S = {
|
|
416
416
|
// This tag allows us to uniquely identify this as a React Element
|
|
417
417
|
$$typeof: t,
|
|
@@ -440,12 +440,12 @@ function je() {
|
|
|
440
440
|
value: L
|
|
441
441
|
}), Object.freeze && (Object.freeze(S.props), Object.freeze(S)), S;
|
|
442
442
|
};
|
|
443
|
-
function
|
|
443
|
+
function Ae(a, f, v, T, L) {
|
|
444
444
|
{
|
|
445
445
|
var A, M = {}, S = null, N = null;
|
|
446
|
-
v !== void 0 && (
|
|
446
|
+
v !== void 0 && (Ft(v), S = "" + v), Se(f) && (Ft(f.key), S = "" + f.key), Ee(f) && (N = f.ref, Me(f, L));
|
|
447
447
|
for (A in f)
|
|
448
|
-
K.call(f, A) && !
|
|
448
|
+
K.call(f, A) && !Te.hasOwnProperty(A) && (M[A] = f[A]);
|
|
449
449
|
if (a && a.defaultProps) {
|
|
450
450
|
var R = a.defaultProps;
|
|
451
451
|
for (A in R)
|
|
@@ -453,9 +453,9 @@ function je() {
|
|
|
453
453
|
}
|
|
454
454
|
if (S || N) {
|
|
455
455
|
var P = typeof a == "function" ? a.displayName || a.name || "Unknown" : a;
|
|
456
|
-
S &&
|
|
456
|
+
S && ke(M, P), N && Le(M, P);
|
|
457
457
|
}
|
|
458
|
-
return
|
|
458
|
+
return He(a, S, N, L, T, _t.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 qe(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 = qe(f);
|
|
508
508
|
if (Ut[v])
|
|
509
509
|
return;
|
|
510
510
|
Ut[v] = !0;
|
|
@@ -531,7 +531,7 @@ Check the top-level render call using <` + v + ">.");
|
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function Re(a) {
|
|
535
535
|
{
|
|
536
536
|
var f = a.type;
|
|
537
537
|
if (f == null || typeof f == "string")
|
|
@@ -547,7 +547,7 @@ Check the top-level render call using <` + v + ">.");
|
|
|
547
547
|
return;
|
|
548
548
|
if (v) {
|
|
549
549
|
var T = W(f);
|
|
550
|
-
|
|
550
|
+
ye(v, a.props, "prop", T, a);
|
|
551
551
|
} else if (f.PropTypes !== void 0 && !bt) {
|
|
552
552
|
bt = !0;
|
|
553
553
|
var L = W(f);
|
|
@@ -556,7 +556,7 @@ Check the top-level render call using <` + v + ">.");
|
|
|
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 Pe(a) {
|
|
560
560
|
{
|
|
561
561
|
for (var f = Object.keys(a.props), v = 0; v < f.length; v++) {
|
|
562
562
|
var T = f[v];
|
|
@@ -571,61 +571,61 @@ Check the top-level render call using <` + v + ">.");
|
|
|
571
571
|
var Yt = {};
|
|
572
572
|
function Qt(a, f, v, T, L, A) {
|
|
573
573
|
{
|
|
574
|
-
var M =
|
|
574
|
+
var M = ue(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 N =
|
|
578
|
+
var N = Ie();
|
|
579
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 = Ae(a, f, v, L, A);
|
|
584
584
|
if (P == null)
|
|
585
585
|
return P;
|
|
586
586
|
if (M) {
|
|
587
|
-
var
|
|
588
|
-
if (
|
|
587
|
+
var _ = f.children;
|
|
588
|
+
if (_ !== void 0)
|
|
589
589
|
if (T)
|
|
590
|
-
if (gt(
|
|
591
|
-
for (var Q = 0; Q <
|
|
592
|
-
Xt(
|
|
593
|
-
Object.freeze && Object.freeze(
|
|
590
|
+
if (gt(_)) {
|
|
591
|
+
for (var Q = 0; Q < _.length; Q++)
|
|
592
|
+
Xt(_[Q], a);
|
|
593
|
+
Object.freeze && Object.freeze(_);
|
|
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.");
|
|
596
596
|
else
|
|
597
|
-
Xt(
|
|
597
|
+
Xt(_, a);
|
|
598
598
|
}
|
|
599
599
|
if (K.call(f, "key")) {
|
|
600
|
-
var U = W(a), D = Object.keys(f).filter(function(
|
|
601
|
-
return
|
|
600
|
+
var U = W(a), D = Object.keys(f).filter(function(Fe) {
|
|
601
|
+
return Fe !== "key";
|
|
602
602
|
}), xt = D.length > 0 ? "{key: someKey, " + D.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
603
603
|
if (!Yt[U + xt]) {
|
|
604
|
-
var
|
|
604
|
+
var Oe = 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, Oe, U), Yt[U + xt] = !0;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
return a === i ?
|
|
613
|
+
return a === i ? Pe(P) : Re(P), P;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
function
|
|
616
|
+
function Be(a, f, v) {
|
|
617
617
|
return Qt(a, f, v, !0);
|
|
618
618
|
}
|
|
619
|
-
function
|
|
619
|
+
function Ne(a, f, v) {
|
|
620
620
|
return Qt(a, f, v, !1);
|
|
621
621
|
}
|
|
622
|
-
var
|
|
623
|
-
tt.Fragment = i, tt.jsx =
|
|
622
|
+
var De = Ne, Ze = Be;
|
|
623
|
+
tt.Fragment = i, tt.jsx = De, tt.jsxs = Ze;
|
|
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 = je() : Et.exports = We();
|
|
627
|
+
var Ve = Et.exports;
|
|
628
|
+
const Ue = {
|
|
629
629
|
en: {
|
|
630
630
|
dir: "ltr",
|
|
631
631
|
file: "File",
|
|
@@ -1012,9 +1012,9 @@ const Ve = {
|
|
|
1012
1012
|
}
|
|
1013
1013
|
};
|
|
1014
1014
|
function Ct(p) {
|
|
1015
|
-
return
|
|
1015
|
+
return Ue[p];
|
|
1016
1016
|
}
|
|
1017
|
-
const
|
|
1017
|
+
const ze = "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", Xe = "file edit view insert format tools table help", Ye = [
|
|
1018
1018
|
["Andale Mono", "andale mono,times"],
|
|
1019
1019
|
["Arial", "arial,helvetica,sans-serif"],
|
|
1020
1020
|
["Arial Black", "arial black,avant garde"],
|
|
@@ -1034,7 +1034,7 @@ const Ue = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1034
1034
|
["Verdana", "verdana,geneva"],
|
|
1035
1035
|
["Webdings", "webdings"],
|
|
1036
1036
|
["Wingdings", "wingdings,zapf dingbats"]
|
|
1037
|
-
],
|
|
1037
|
+
], Qe = ["8px", "9px", "10px", "11px", "12px", "14px", "16px", "18px", "20px", "24px", "28px", "32px", "36px", "48px", "72px", "96px"], Ge = 1, Ke = 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 = [
|
|
1038
1038
|
["plain", "Plain text"],
|
|
1039
1039
|
["html", "HTML/XML"],
|
|
1040
1040
|
["css", "CSS"],
|
|
@@ -1060,7 +1060,7 @@ const Ue = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1060
1060
|
["h5", "heading5"],
|
|
1061
1061
|
["h6", "heading6"],
|
|
1062
1062
|
["pre", "pre"]
|
|
1063
|
-
],
|
|
1063
|
+
], Je = ["#F76707", "#4263EB", "#CC5DE8"], ti = [
|
|
1064
1064
|
"#FFFFFF",
|
|
1065
1065
|
"#F4F4F4",
|
|
1066
1066
|
"#E8EAED",
|
|
@@ -1086,7 +1086,7 @@ const Ue = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1086
1086
|
"#8E24AA",
|
|
1087
1087
|
"#C2185B",
|
|
1088
1088
|
"#6D4C41"
|
|
1089
|
-
],
|
|
1089
|
+
], ei = [
|
|
1090
1090
|
{
|
|
1091
1091
|
key: "chcat_currency",
|
|
1092
1092
|
chars: [
|
|
@@ -1426,7 +1426,7 @@ const Ue = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1426
1426
|
"ة"
|
|
1427
1427
|
]
|
|
1428
1428
|
}
|
|
1429
|
-
],
|
|
1429
|
+
], ii = [
|
|
1430
1430
|
{
|
|
1431
1431
|
key: "emcat_smileys",
|
|
1432
1432
|
chars: [
|
|
@@ -2380,7 +2380,7 @@ const Ue = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
2380
2380
|
codesampleic: k(
|
|
2381
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"/>'
|
|
2382
2382
|
)
|
|
2383
|
-
},
|
|
2383
|
+
}, si = /* @__PURE__ */ new Set([
|
|
2384
2384
|
"p",
|
|
2385
2385
|
"div",
|
|
2386
2386
|
"span",
|
|
@@ -2422,7 +2422,7 @@ const Ue = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
2422
2422
|
"figure",
|
|
2423
2423
|
"figcaption",
|
|
2424
2424
|
"mark"
|
|
2425
|
-
]),
|
|
2425
|
+
]), ni = /* @__PURE__ */ new Set([
|
|
2426
2426
|
"text-align",
|
|
2427
2427
|
"direction",
|
|
2428
2428
|
"unicode-bidi",
|
|
@@ -2494,13 +2494,13 @@ function ut(p) {
|
|
|
2494
2494
|
s < 1 || (t[i.slice(0, s).trim().toLowerCase()] = i.slice(s + 1).trim());
|
|
2495
2495
|
}), t;
|
|
2496
2496
|
}
|
|
2497
|
-
function
|
|
2497
|
+
function li(p) {
|
|
2498
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, "");
|
|
2499
2499
|
}
|
|
2500
|
-
function
|
|
2500
|
+
function oi(p) {
|
|
2501
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 };
|
|
2502
2502
|
}
|
|
2503
|
-
function
|
|
2503
|
+
function ri(p) {
|
|
2504
2504
|
const t = (s) => {
|
|
2505
2505
|
const n = (s.getAttribute("style") || "") + " " + (s.className || "");
|
|
2506
2506
|
return /mso-list\s*:(?!\s*ignore)/i.test(n) || /MsoListParagraph/i.test(n);
|
|
@@ -2519,7 +2519,7 @@ function oi(p) {
|
|
|
2519
2519
|
var w, E, I;
|
|
2520
2520
|
const c = +(((w = (r.getAttribute("style") || "").match(/level(\d+)/i)) == null ? void 0 : w[1]) || 1), d = Array.from(r.querySelectorAll("span")).find(
|
|
2521
2521
|
(H) => /mso-list\s*:\s*ignore/i.test(H.getAttribute("style") || "")
|
|
2522
|
-
), u = d ? ((E = d.textContent) == null ? void 0 : E.trim()) || "" : (((I = r.textContent) == null ? void 0 : I.trim().match(/^\S{1,4}/)) || [""])[0], { ordered: m, style: b } =
|
|
2522
|
+
), u = d ? ((E = d.textContent) == null ? void 0 : E.trim()) || "" : (((I = r.textContent) == null ? void 0 : I.trim().match(/^\S{1,4}/)) || [""])[0], { ordered: m, style: b } = oi(u);
|
|
2523
2523
|
for (d && d.remove(); n.length && n[n.length - 1].level > c; ) n.pop();
|
|
2524
2524
|
if (!n.length || n[n.length - 1].level < c) {
|
|
2525
2525
|
const H = p.createElement(m ? "ol" : "ul");
|
|
@@ -2536,13 +2536,13 @@ function oi(p) {
|
|
|
2536
2536
|
});
|
|
2537
2537
|
});
|
|
2538
2538
|
}
|
|
2539
|
-
function
|
|
2539
|
+
function ai(p) {
|
|
2540
2540
|
p.querySelectorAll('b[id^="docs-internal-guid"]').forEach((t) => {
|
|
2541
2541
|
for (; t.firstChild; ) t.parentNode.insertBefore(t.firstChild, t);
|
|
2542
2542
|
t.remove();
|
|
2543
2543
|
});
|
|
2544
2544
|
}
|
|
2545
|
-
function
|
|
2545
|
+
function ci(p) {
|
|
2546
2546
|
p.querySelectorAll("table").forEach((t) => {
|
|
2547
2547
|
const e = t;
|
|
2548
2548
|
ut(e)["border-collapse"] || (e.style.borderCollapse = "collapse");
|
|
@@ -2569,7 +2569,7 @@ function ht(p, t) {
|
|
|
2569
2569
|
}
|
|
2570
2570
|
if (e.nodeType !== Node.ELEMENT_NODE) return;
|
|
2571
2571
|
const i = e, s = i.tagName.toLowerCase();
|
|
2572
|
-
if (!
|
|
2572
|
+
if (!si.has(s)) {
|
|
2573
2573
|
if (s === "font") {
|
|
2574
2574
|
const o = t.createElement("span");
|
|
2575
2575
|
i.getAttribute("style") && o.setAttribute("style", i.getAttribute("style")), i.getAttribute("color") && (o.style.color = i.getAttribute("color")), i.getAttribute("face") && (o.style.fontFamily = i.getAttribute("face"));
|
|
@@ -2612,14 +2612,14 @@ function ht(p, t) {
|
|
|
2612
2612
|
}
|
|
2613
2613
|
const l = ut(i), r = [];
|
|
2614
2614
|
for (const [o, c] of Object.entries(l))
|
|
2615
|
-
|
|
2615
|
+
ni.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));
|
|
2616
2616
|
if (r.length ? i.setAttribute("style", r.join(";")) : i.removeAttribute("style"), i.removeAttribute("class"), ht(i, t), s === "span" && !i.attributes.length) {
|
|
2617
2617
|
for (; i.firstChild; ) i.parentNode.insertBefore(i.firstChild, i);
|
|
2618
2618
|
i.remove();
|
|
2619
2619
|
}
|
|
2620
2620
|
});
|
|
2621
2621
|
}
|
|
2622
|
-
function
|
|
2622
|
+
function hi(p) {
|
|
2623
2623
|
const t = [], e = /<style[^>]*>([\s\S]*?)<\/style>/gi;
|
|
2624
2624
|
let i;
|
|
2625
2625
|
for (; i = e.exec(p); ) {
|
|
@@ -2637,7 +2637,7 @@ function ci(p) {
|
|
|
2637
2637
|
}
|
|
2638
2638
|
return t;
|
|
2639
2639
|
}
|
|
2640
|
-
function
|
|
2640
|
+
function di(p, t) {
|
|
2641
2641
|
if (!t.length) return;
|
|
2642
2642
|
const e = /* @__PURE__ */ new Map();
|
|
2643
2643
|
t.forEach(({ sel: i, decls: s }) => {
|
|
@@ -2663,15 +2663,15 @@ function hi(p, t) {
|
|
|
2663
2663
|
function he(p) {
|
|
2664
2664
|
return p.replace(/[ﭐ-﷿ﹰ-ﻼ]+/g, (t) => t.normalize("NFKC"));
|
|
2665
2665
|
}
|
|
2666
|
-
function
|
|
2666
|
+
function ui(p) {
|
|
2667
2667
|
const t = p.createTreeWalker(p.body, NodeFilter.SHOW_TEXT, null);
|
|
2668
2668
|
let e;
|
|
2669
2669
|
for (; e = t.nextNode(); )
|
|
2670
2670
|
/[ﭐ-﷿ﹰ-ﻼ]/.test(e.nodeValue || "") && (e.nodeValue = he(e.nodeValue || ""));
|
|
2671
2671
|
}
|
|
2672
|
-
function
|
|
2673
|
-
const e =
|
|
2674
|
-
|
|
2672
|
+
function pi(p, t = "ltr") {
|
|
2673
|
+
const e = hi(p), i = new DOMParser().parseFromString(li(p), "text/html");
|
|
2674
|
+
di(i, e), /class="?Mso|mso-|urn:schemas-microsoft-com/i.test(i.body.innerHTML) && ri(i), ai(i), ci(i), ht(i.body, i), ui(i);
|
|
2675
2675
|
const s = (n) => {
|
|
2676
2676
|
var l;
|
|
2677
2677
|
return n && n.tagName === "P" && !((l = n.textContent) != null && l.trim()) && !n.querySelector("img,table");
|
|
@@ -2680,11 +2680,11 @@ function ui(p, t = "ltr") {
|
|
|
2680
2680
|
for (; s(i.body.lastElementChild); ) i.body.lastElementChild.remove();
|
|
2681
2681
|
return i.body.innerHTML.trim();
|
|
2682
2682
|
}
|
|
2683
|
-
function
|
|
2683
|
+
function mi(p) {
|
|
2684
2684
|
const t = he(p).replace(/\r/g, ""), e = (i) => i.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
2685
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);
|
|
2686
2686
|
}
|
|
2687
|
-
function
|
|
2687
|
+
function fi(p) {
|
|
2688
2688
|
const t = new DataView(p), e = /* @__PURE__ */ new Map();
|
|
2689
2689
|
let i = -1;
|
|
2690
2690
|
for (let r = p.byteLength - 22; r >= Math.max(0, p.byteLength - 22 - 65535); r--)
|
|
@@ -2745,7 +2745,7 @@ const oe = (p) => p.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, "
|
|
|
2745
2745
|
lightGray: "#D3D3D3",
|
|
2746
2746
|
black: "#000000",
|
|
2747
2747
|
white: "#FFFFFF"
|
|
2748
|
-
},
|
|
2748
|
+
}, gi = {
|
|
2749
2749
|
png: "image/png",
|
|
2750
2750
|
jpg: "image/jpeg",
|
|
2751
2751
|
jpeg: "image/jpeg",
|
|
@@ -2753,13 +2753,13 @@ const oe = (p) => p.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, "
|
|
|
2753
2753
|
bmp: "image/bmp",
|
|
2754
2754
|
webp: "image/webp"
|
|
2755
2755
|
};
|
|
2756
|
-
function
|
|
2756
|
+
function vi(p) {
|
|
2757
2757
|
let t = "";
|
|
2758
2758
|
for (let e = 0; e < p.length; e += 32768)
|
|
2759
2759
|
t += String.fromCharCode(...p.subarray(e, e + 32768));
|
|
2760
2760
|
return btoa(t);
|
|
2761
2761
|
}
|
|
2762
|
-
class
|
|
2762
|
+
class bi {
|
|
2763
2763
|
constructor(t, e, i) {
|
|
2764
2764
|
this.rels = t, this.images = e, this.numFmt = i;
|
|
2765
2765
|
}
|
|
@@ -2862,8 +2862,8 @@ class vi {
|
|
|
2862
2862
|
return e + "</tbody></table>";
|
|
2863
2863
|
}
|
|
2864
2864
|
}
|
|
2865
|
-
async function
|
|
2866
|
-
const t = p instanceof ArrayBuffer ? p : await p.arrayBuffer(), e =
|
|
2865
|
+
async function yi(p) {
|
|
2866
|
+
const t = p instanceof ArrayBuffer ? p : await p.arrayBuffer(), e = fi(t), i = new TextDecoder(), s = async (y) => {
|
|
2867
2867
|
const g = e.get(y);
|
|
2868
2868
|
return g ? new DOMParser().parseFromString(i.decode(await le(t, g)), "application/xml") : null;
|
|
2869
2869
|
}, n = await s("word/document.xml"), l = n == null ? void 0 : n.getElementsByTagName("*");
|
|
@@ -2887,10 +2887,10 @@ async function bi(p) {
|
|
|
2887
2887
|
for (const [y, g] of c) {
|
|
2888
2888
|
const x = g.startsWith("/") ? g.slice(1) : "word/" + g.replace(/^\.\//, ""), w = e.get(x);
|
|
2889
2889
|
if (!w) continue;
|
|
2890
|
-
const E = (x.split(".").pop() || "").toLowerCase(), I =
|
|
2890
|
+
const E = (x.split(".").pop() || "").toLowerCase(), I = gi[E];
|
|
2891
2891
|
if (I)
|
|
2892
2892
|
try {
|
|
2893
|
-
u.set(y, `data:${I};base64,${
|
|
2893
|
+
u.set(y, `data:${I};base64,${vi(await le(t, w))}`);
|
|
2894
2894
|
} catch {
|
|
2895
2895
|
}
|
|
2896
2896
|
}
|
|
@@ -2908,24 +2908,24 @@ async function bi(p) {
|
|
|
2908
2908
|
m.set(w, y.get(E) || "ul");
|
|
2909
2909
|
}
|
|
2910
2910
|
}
|
|
2911
|
-
return new
|
|
2911
|
+
return new bi(o, u, m).convertBody(r);
|
|
2912
2912
|
}
|
|
2913
|
-
const
|
|
2913
|
+
const xi = ["nw", "ne", "sw", "se"], wt = ["img-left", "img-right", "img-top", "img-center"], Tt = {
|
|
2914
2914
|
"img-left": "tplimgleft",
|
|
2915
2915
|
"img-right": "tplimgright",
|
|
2916
2916
|
"img-top": "tplimgtop",
|
|
2917
2917
|
"img-center": "tplimgcenter"
|
|
2918
|
-
},
|
|
2918
|
+
}, Ci = {
|
|
2919
2919
|
"img-left": h.tplleft,
|
|
2920
2920
|
"img-right": h.tplright,
|
|
2921
2921
|
"img-top": h.tpltop,
|
|
2922
2922
|
"img-center": h.tplcenter
|
|
2923
|
-
},
|
|
2923
|
+
}, wi = ".tox,.pop,.tblctx,.imgctx,.selctx,.dlg";
|
|
2924
2924
|
let Z = null, X = null, St = 0, ae = !1;
|
|
2925
2925
|
function ct() {
|
|
2926
2926
|
clearTimeout(St), X = null, Z && Z.classList.remove("show");
|
|
2927
2927
|
}
|
|
2928
|
-
function
|
|
2928
|
+
function Ti(p) {
|
|
2929
2929
|
const t = p.dataset.tip;
|
|
2930
2930
|
if (!t) return;
|
|
2931
2931
|
X = p, clearTimeout(St);
|
|
@@ -2940,21 +2940,41 @@ function wi(p) {
|
|
|
2940
2940
|
r + n > innerHeight - 6 && (r = i.top - n - 7), Z.style.left = l + "px", Z.style.top = r + "px";
|
|
2941
2941
|
}, e);
|
|
2942
2942
|
}
|
|
2943
|
-
function
|
|
2943
|
+
function Ei() {
|
|
2944
2944
|
ae || (ae = !0, document.addEventListener("mouseover", (p) => {
|
|
2945
2945
|
const t = p.target, e = t.closest ? t.closest("[title],[data-tip]") : null;
|
|
2946
|
-
if (!e || !e.closest(
|
|
2946
|
+
if (!e || !e.closest(wi) || e.closest(".earea")) {
|
|
2947
2947
|
e !== X && ct();
|
|
2948
2948
|
return;
|
|
2949
2949
|
}
|
|
2950
2950
|
const i = e.getAttribute("title");
|
|
2951
|
-
i && (e.dataset.tip = i, e.removeAttribute("title"), e.getAttribute("aria-label") || e.setAttribute("aria-label", i)), e !== X &&
|
|
2951
|
+
i && (e.dataset.tip = i, e.removeAttribute("title"), e.getAttribute("aria-label") || e.setAttribute("aria-label", i)), e !== X && Ti(e);
|
|
2952
2952
|
}), document.addEventListener("mouseout", (p) => {
|
|
2953
2953
|
X && !X.contains(p.relatedTarget) && ct();
|
|
2954
2954
|
}), document.addEventListener("mousedown", ct, !0), addEventListener("scroll", ct, !0));
|
|
2955
2955
|
}
|
|
2956
|
+
const Si = /[\u0590-\u05FF\u0600-\u06FF\u0750-\u077F\u0780-\u07BF\u08A0-\u08FF\uFB1D-\uFB4F\uFB50-\uFDFF\uFE70-\uFEFF]/, Mi = new RegExp("\\p{L}", "u"), ki = "p,div,li,td,th,blockquote,h1,h2,h3,h4,h5,h6,pre,figcaption";
|
|
2957
|
+
function Li(p) {
|
|
2958
|
+
for (const t of p) {
|
|
2959
|
+
if (Si.test(t)) return "rtl";
|
|
2960
|
+
if (Mi.test(t)) return "ltr";
|
|
2961
|
+
}
|
|
2962
|
+
return null;
|
|
2963
|
+
}
|
|
2964
|
+
function de(p) {
|
|
2965
|
+
let t = "";
|
|
2966
|
+
return p.childNodes.forEach((e) => {
|
|
2967
|
+
if (e.nodeType === Node.TEXT_NODE)
|
|
2968
|
+
t += e.nodeValue || "";
|
|
2969
|
+
else if (e.nodeType === Node.ELEMENT_NODE) {
|
|
2970
|
+
const i = e, s = (i.getAttribute("dir") || "").toLowerCase();
|
|
2971
|
+
if (s === "rtl" || s === "ltr") return;
|
|
2972
|
+
t += de(i);
|
|
2973
|
+
}
|
|
2974
|
+
}), t;
|
|
2975
|
+
}
|
|
2956
2976
|
var j;
|
|
2957
|
-
let
|
|
2977
|
+
let Hi = (j = class {
|
|
2958
2978
|
constructor(t) {
|
|
2959
2979
|
this.lang = "en", this.contentClass = "fable-content-" + j.instanceCounter++, this.contentStyleEl = null, this.savedRange = null, this.foreColor = "#000000", this.backColor = "#FACC15", this.openPop = null, this.openSubEl = null, this.popAnchor = null, this.dlgOvl = null, this.tblActive = null, this.tblCorner = null, this.tblColBars = [], this.tblCtx = null, this.tblCellMark = null, this.tblOpMark = null, this.tblOpMarkKind = null, this.imgActive = null, this.imgHandles = [], this.imgCtx = null, this.imgHideTimer = null, this.phActive = null, this.phCtx = null, this.phUploadTarget = null, this.vidActive = null, this.vidCtx = null, this.vidHideTimer = null, this.vphActive = null, this.vphCtx = null, this.vphUploadTarget = null, this.selCtx = null, this.tbrMore = null, this.tbrExpanded = !1, this.codeActive = null, this.codeCtx = null, this.tplActive = null, this.tplCtx = null, this.revisions = [], this.revTimer = null, this.draftTimer = null, this.draftStorageKey = "", this.listeners = [], this.isDestroyed = !1, this.options = {
|
|
2960
2980
|
target: t.target,
|
|
@@ -2970,7 +2990,7 @@ let Ei = (j = class {
|
|
|
2970
2990
|
statusbar: t.statusbar ?? !0,
|
|
2971
2991
|
readonly: t.readonly ?? !1,
|
|
2972
2992
|
draftKey: t.draftKey ?? (typeof location < "u" ? location.pathname : "default"),
|
|
2973
|
-
fontFamilyFormats: t.fontFamilyFormats ??
|
|
2993
|
+
fontFamilyFormats: t.fontFamilyFormats ?? Ye,
|
|
2974
2994
|
imageFileTypes: t.imageFileTypes ?? ["image/jpeg", "image/jpg", "image/png", "image/gif", "image/bmp", "image/webp"],
|
|
2975
2995
|
videoFileTypes: t.videoFileTypes ?? ["video/mp4", "video/webm", "video/ogg"]
|
|
2976
2996
|
}, 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);
|
|
@@ -2996,7 +3016,7 @@ let Ei = (j = class {
|
|
|
2996
3016
|
</span>
|
|
2997
3017
|
`, this.sbHelp = this.statusbar.querySelector(".mid"), this.sbWords = this.statusbar.querySelector(".words");
|
|
2998
3018
|
const e = this.statusbar.querySelector(".grip");
|
|
2999
|
-
this.bindGrip(e), this.shell.appendChild(this.menubar), this.shell.appendChild(this.toolbar), this.shell.appendChild(this.ed), this.shell.appendChild(this.statusbar), this.contentStyle && (this.contentStyleEl = document.createElement("style"), this.contentStyleEl.textContent = this.scopeContentStyle(this.contentStyle), this.shell.appendChild(this.contentStyleEl)), t.appendChild(this.shell),
|
|
3019
|
+
this.bindGrip(e), this.shell.appendChild(this.menubar), this.shell.appendChild(this.toolbar), this.shell.appendChild(this.ed), this.shell.appendChild(this.statusbar), this.contentStyle && (this.contentStyleEl = document.createElement("style"), this.contentStyleEl.textContent = this.scopeContentStyle(this.contentStyle), this.shell.appendChild(this.contentStyleEl)), t.appendChild(this.shell), Ei(), this.options.statusbar || (this.statusbar.style.display = "none"), this.imgInput = document.createElement("input"), this.imgInput.type = "file", this.imgInput.accept = this.options.imageFileTypes.join(","), this.imgInput.style.display = "none", t.appendChild(this.imgInput), this.vidInput = document.createElement("input"), this.vidInput.type = "file", this.vidInput.accept = this.options.videoFileTypes.join(","), this.vidInput.style.display = "none", t.appendChild(this.vidInput), this.docInput = document.createElement("input"), this.docInput.type = "file", this.docInput.accept = ".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document", this.docInput.style.display = "none", t.appendChild(this.docInput);
|
|
3000
3020
|
}
|
|
3001
3021
|
/** Theme options land as CSS variables on the document root rather than the editor
|
|
3002
3022
|
* shell, because dialogs, popups and floating context toolbars are appended to
|
|
@@ -3084,7 +3104,7 @@ let Ei = (j = class {
|
|
|
3084
3104
|
}), this.onWin(
|
|
3085
3105
|
"scroll",
|
|
3086
3106
|
() => {
|
|
3087
|
-
this.positionTableHandles(), this.positionImageHandles(), this.positionImgPhCtx(), this.positionTplCtx(), this.positionVphCtx(), this.positionVidCtx(), this.positionCodeCtx(), this.repositionSelToolbar();
|
|
3107
|
+
this.closePop(), this.positionTableHandles(), this.positionImageHandles(), this.positionImgPhCtx(), this.positionTplCtx(), this.positionVphCtx(), this.positionVidCtx(), this.positionCodeCtx(), this.repositionSelToolbar();
|
|
3088
3108
|
},
|
|
3089
3109
|
!0
|
|
3090
3110
|
), this.onWin("resize", () => {
|
|
@@ -3154,8 +3174,13 @@ let Ei = (j = class {
|
|
|
3154
3174
|
* descendant that has no `text-align` of its own — even one with its own
|
|
3155
3175
|
* dir="rtl". Elements that already carry their own dir (preserved as-is by
|
|
3156
3176
|
* the paste engine) each get their own matching text-align only if they
|
|
3157
|
-
* don't already have one
|
|
3158
|
-
*
|
|
3177
|
+
* don't already have one. Blocks with no reliable explicit dir (missing, or
|
|
3178
|
+
* dir="auto" from plain-text paste) get their direction from a first-strong-
|
|
3179
|
+
* character scan of their own text instead of silently inheriting the
|
|
3180
|
+
* editor's configured UI language — mixed-direction content and any
|
|
3181
|
+
* alignment the user explicitly set are left untouched either way. Only
|
|
3182
|
+
* content with no strongly-directional character anywhere falls back to the
|
|
3183
|
+
* editor's current direction. */
|
|
3159
3184
|
getContentForEmail() {
|
|
3160
3185
|
const t = (l, r) => {
|
|
3161
3186
|
const o = (l.getAttribute("style") || "").trim();
|
|
@@ -3168,6 +3193,14 @@ let Ei = (j = class {
|
|
|
3168
3193
|
if (r !== "rtl" && r !== "ltr") return;
|
|
3169
3194
|
const o = r;
|
|
3170
3195
|
i || (i = o), /text-align\s*:/i.test(l.getAttribute("style") || "") || t(l, `text-align:${o === "rtl" ? "right" : "left"}`);
|
|
3196
|
+
}), e.querySelectorAll(ki).forEach((l) => {
|
|
3197
|
+
const r = (l.getAttribute("dir") || "").toLowerCase();
|
|
3198
|
+
if (r === "rtl" || r === "ltr") return;
|
|
3199
|
+
const o = Li(de(l));
|
|
3200
|
+
if (!o) return;
|
|
3201
|
+
i || (i = o), l.setAttribute("dir", o);
|
|
3202
|
+
const c = /text-align\s*:/i.test(l.getAttribute("style") || "");
|
|
3203
|
+
t(l, c ? `direction:${o}` : `direction:${o};text-align:${o === "rtl" ? "right" : "left"}`);
|
|
3171
3204
|
});
|
|
3172
3205
|
const s = i || this.ed.getAttribute("dir") || this.dir();
|
|
3173
3206
|
return e.querySelectorAll("table:not([dir])").forEach((l) => {
|
|
@@ -3187,7 +3220,7 @@ let Ei = (j = class {
|
|
|
3187
3220
|
this.ed.focus();
|
|
3188
3221
|
}
|
|
3189
3222
|
async importWordFile(t) {
|
|
3190
|
-
const e = await
|
|
3223
|
+
const e = await yi(t);
|
|
3191
3224
|
this.recordRevision(), this.setContent(e), this.recordRevision();
|
|
3192
3225
|
}
|
|
3193
3226
|
restoreDraft() {
|
|
@@ -3399,7 +3432,7 @@ let Ei = (j = class {
|
|
|
3399
3432
|
return n.type = "button", n.className = "cchip", n.title = s, n.addEventListener("mousedown", (l) => {
|
|
3400
3433
|
l.preventDefault(), this.saveSel();
|
|
3401
3434
|
}), n;
|
|
3402
|
-
}, e =
|
|
3435
|
+
}, e = Je.map((s) => {
|
|
3403
3436
|
const n = t(this.t("forecolor"));
|
|
3404
3437
|
return n.style.background = s, n.addEventListener("click", () => this.applyColor("fore", s)), n;
|
|
3405
3438
|
}), i = t(this.t("forecolor"));
|
|
@@ -3459,7 +3492,7 @@ let Ei = (j = class {
|
|
|
3459
3492
|
* table cell-background menu all show the identical popup. */
|
|
3460
3493
|
buildPaletteInto(t, e, i) {
|
|
3461
3494
|
const s = document.createElement("div");
|
|
3462
|
-
s.className = "cpal",
|
|
3495
|
+
s.className = "cpal", ti.forEach((u) => {
|
|
3463
3496
|
const m = document.createElement("button");
|
|
3464
3497
|
m.type = "button", m.style.background = u, m.title = u, m.addEventListener("click", () => {
|
|
3465
3498
|
this.closePop(), i(u);
|
|
@@ -3508,7 +3541,7 @@ let Ei = (j = class {
|
|
|
3508
3541
|
this.popup(t, (e) => this.menuItems(e, this.fontItems()));
|
|
3509
3542
|
}
|
|
3510
3543
|
sizeItems() {
|
|
3511
|
-
return
|
|
3544
|
+
return Qe.map((t) => ({
|
|
3512
3545
|
label: t,
|
|
3513
3546
|
on: this.currentSize() === t,
|
|
3514
3547
|
action: () => this.applyFontSize(t)
|
|
@@ -3561,7 +3594,7 @@ let Ei = (j = class {
|
|
|
3561
3594
|
this.saveSel(), this.refreshState(), this.onChange();
|
|
3562
3595
|
}
|
|
3563
3596
|
stepFontSize(t) {
|
|
3564
|
-
const e = parseInt(this.currentSize(), 10) || 14, i = Math.min(
|
|
3597
|
+
const e = parseInt(this.currentSize(), 10) || 14, i = Math.min(Ke, Math.max(Ge, e + t));
|
|
3565
3598
|
i !== e && this.applyFontSize(i + "px");
|
|
3566
3599
|
}
|
|
3567
3600
|
/* ------------------------------------------------ case / spacing / link */
|
|
@@ -3802,7 +3835,7 @@ let Ei = (j = class {
|
|
|
3802
3835
|
}
|
|
3803
3836
|
buildToolbar() {
|
|
3804
3837
|
this.toolbar.innerHTML = "";
|
|
3805
|
-
const t = this.options.toolbar === !0 ?
|
|
3838
|
+
const t = this.options.toolbar === !0 ? ze : this.options.toolbar, e = this.buildToolbarRegistry();
|
|
3806
3839
|
this.parseToolbarString(t).forEach((i) => {
|
|
3807
3840
|
const s = [];
|
|
3808
3841
|
i.forEach((n) => {
|
|
@@ -3984,7 +4017,7 @@ let Ei = (j = class {
|
|
|
3984
4017
|
{ label: this.t("deltable"), icon: h.trash, action: () => this.tableOp("deltable") }
|
|
3985
4018
|
],
|
|
3986
4019
|
help: [this.mItem("helpttl", h.helpic, () => this.helpDlg(), "Alt+0")]
|
|
3987
|
-
}, e = this.options.menubar === !0 ?
|
|
4020
|
+
}, e = this.options.menubar === !0 ? Xe : this.options.menubar, i = /* @__PURE__ */ new Set();
|
|
3988
4021
|
e.split(/\s+/).filter(Boolean).forEach((s) => {
|
|
3989
4022
|
if (i.has(s)) return;
|
|
3990
4023
|
if (i.add(s), !t[s]) {
|
|
@@ -4095,8 +4128,8 @@ let Ei = (j = class {
|
|
|
4095
4128
|
const I = (H, $) => {
|
|
4096
4129
|
const O = document.createElement("div");
|
|
4097
4130
|
O.style.cssText = r;
|
|
4098
|
-
const
|
|
4099
|
-
|
|
4131
|
+
const F = document.createElement("span");
|
|
4132
|
+
F.style.cssText = o, F.textContent = this.t(H), O.append(F, $), E.appendChild(O);
|
|
4100
4133
|
};
|
|
4101
4134
|
e = document.createElement("input"), e.type = "text", e.style.cssText = c, e.placeholder = "e.g. 600px or 100%", e.value = u, I("tblwidth", e), i = document.createElement("input"), i.type = "number", i.min = "0", i.style.cssText = c, i.value = String(m), I("tblcellpadding", i), s = document.createElement("input"), s.type = "number", s.min = "0", s.style.cssText = c, s.value = String(b), I("tblcellspacing", s), n = document.createElement("input"), n.type = "number", n.min = "0", n.style.cssText = c, n.value = String(y), I("tblborder", n), l = document.createElement("select"), l.style.cssText = c, [
|
|
4102
4135
|
["", "alignnone"],
|
|
@@ -4358,10 +4391,10 @@ let Ei = (j = class {
|
|
|
4358
4391
|
});
|
|
4359
4392
|
}
|
|
4360
4393
|
charMap() {
|
|
4361
|
-
this.glyphPickerDlg(this.t("charmap").replace("…", ""),
|
|
4394
|
+
this.glyphPickerDlg(this.t("charmap").replace("…", ""), ei, !1);
|
|
4362
4395
|
}
|
|
4363
4396
|
emojiMap() {
|
|
4364
|
-
this.glyphPickerDlg(this.t("emoji").replace("…", ""),
|
|
4397
|
+
this.glyphPickerDlg(this.t("emoji").replace("…", ""), ii, !0);
|
|
4365
4398
|
}
|
|
4366
4399
|
printDoc() {
|
|
4367
4400
|
const t = window.open("", "_blank");
|
|
@@ -4697,17 +4730,17 @@ let Ei = (j = class {
|
|
|
4697
4730
|
const H = (O = E.files) == null ? void 0 : O[0];
|
|
4698
4731
|
if (!H) return;
|
|
4699
4732
|
w.disabled = !0, w.textContent = this.t("uploading");
|
|
4700
|
-
const $ = (
|
|
4701
|
-
t.value =
|
|
4733
|
+
const $ = (F) => {
|
|
4734
|
+
t.value = F, w.disabled = !1, w.textContent = this.t("uploadvideo");
|
|
4702
4735
|
};
|
|
4703
4736
|
if (this.videoUploadHandler)
|
|
4704
|
-
this.videoUploadHandler(H).then($).catch((
|
|
4737
|
+
this.videoUploadHandler(H).then($).catch((F) => {
|
|
4705
4738
|
var et;
|
|
4706
|
-
w.disabled = !1, w.textContent = this.t("uploadfailed"), (et = this.onVideoUploadError) == null || et.call(this,
|
|
4739
|
+
w.disabled = !1, w.textContent = this.t("uploadfailed"), (et = this.onVideoUploadError) == null || et.call(this, F, H);
|
|
4707
4740
|
});
|
|
4708
4741
|
else {
|
|
4709
|
-
const
|
|
4710
|
-
|
|
4742
|
+
const F = new FileReader();
|
|
4743
|
+
F.onload = () => $(F.result), F.readAsDataURL(H);
|
|
4711
4744
|
}
|
|
4712
4745
|
}), x.append(t, w, E), t.style.flex = "1", g.appendChild(r("vidsource", x));
|
|
4713
4746
|
const I = document.createElement("div");
|
|
@@ -4953,7 +4986,7 @@ let Ei = (j = class {
|
|
|
4953
4986
|
renderTplCtxButtons() {
|
|
4954
4987
|
const t = this.tplCtx, e = this.tplActive;
|
|
4955
4988
|
!t || !e || (t.innerHTML = "", wt.forEach((i) => {
|
|
4956
|
-
const s = this.ctxBtn(
|
|
4989
|
+
const s = this.ctxBtn(Ci[i], this.t(Tt[i]), () => this.setTplLayout(i));
|
|
4957
4990
|
s.classList.toggle("on", e.classList.contains("tpl-" + i)), t.appendChild(s);
|
|
4958
4991
|
}), t.append(this.ctxSep(), this.ctxBtn(h.trash, this.t("deltemplate"), () => this.removeTemplate())), this.positionTplCtx());
|
|
4959
4992
|
}
|
|
@@ -5136,7 +5169,7 @@ let Ei = (j = class {
|
|
|
5136
5169
|
this.cancelImgHide(), this.imgHandles.forEach((i) => i.remove()), this.imgHandles = [], (t = this.imgCtx) == null || t.remove(), this.imgCtx = null, (e = this.imgActive) == null || e.classList.remove("img-selected"), this.imgActive = null;
|
|
5137
5170
|
}
|
|
5138
5171
|
selectImage(t) {
|
|
5139
|
-
this.imgActive !== t && (this.clearImageHandles(), this.imgActive = t, t.classList.add("img-selected"), this.imgHandles =
|
|
5172
|
+
this.imgActive !== t && (this.clearImageHandles(), this.imgActive = t, t.classList.add("img-selected"), this.imgHandles = xi.map((e) => {
|
|
5140
5173
|
const i = document.createElement("div");
|
|
5141
5174
|
return i.className = "img-handle img-handle-" + e, i.dataset.corner = e, i.addEventListener("mousedown", (s) => this.startImageResizeDrag(s, e)), i.addEventListener("mouseenter", () => this.cancelImgHide()), i.addEventListener("mouseleave", () => this.scheduleImgHide()), document.body.appendChild(i), i;
|
|
5142
5175
|
}), this.imgCtx = this.buildImageCtxToolbar(t), this.positionImageHandles());
|
|
@@ -5389,17 +5422,17 @@ let Ei = (j = class {
|
|
|
5389
5422
|
return;
|
|
5390
5423
|
}
|
|
5391
5424
|
}
|
|
5392
|
-
i ? document.execCommand("insertHTML", !1,
|
|
5425
|
+
i ? document.execCommand("insertHTML", !1, pi(i, this.dir())) : document.execCommand("insertHTML", !1, mi(e.getData("text/plain"))), this.onChange();
|
|
5393
5426
|
}
|
|
5394
5427
|
/* ---------------------------------------------------------- init */
|
|
5395
5428
|
initUI() {
|
|
5396
5429
|
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();
|
|
5397
5430
|
}
|
|
5398
5431
|
}, j.instanceCounter = 0, j.TBR_COLLAPSE_MAX = 992, j);
|
|
5399
|
-
const
|
|
5432
|
+
const Ai = _e(
|
|
5400
5433
|
({ value: p, defaultValue: t, onChange: e, onReady: i, className: s, style: n, ...l }, r) => {
|
|
5401
5434
|
const o = z(null), c = z(null), d = z(!1), u = z(p ?? t), m = z(null), b = z(e), y = z(i);
|
|
5402
|
-
return b.current = e, y.current = i,
|
|
5435
|
+
return b.current = e, y.current = i, $e(r, () => ({
|
|
5403
5436
|
getContent: () => {
|
|
5404
5437
|
var g;
|
|
5405
5438
|
return ((g = c.current) == null ? void 0 : g.getContent()) ?? "";
|
|
@@ -5442,7 +5475,7 @@ const Si = _e(
|
|
|
5442
5475
|
}
|
|
5443
5476
|
})), ot(() => {
|
|
5444
5477
|
if (!o.current) return;
|
|
5445
|
-
const g = new
|
|
5478
|
+
const g = new Hi({
|
|
5446
5479
|
target: o.current,
|
|
5447
5480
|
initialContent: u.current,
|
|
5448
5481
|
onChange: (x) => {
|
|
@@ -5486,10 +5519,10 @@ const Si = _e(
|
|
|
5486
5519
|
}, []), ot(() => {
|
|
5487
5520
|
var g;
|
|
5488
5521
|
l.language && ((g = c.current) == null || g.setLanguage(l.language));
|
|
5489
|
-
}, [l.language]), /* @__PURE__ */
|
|
5522
|
+
}, [l.language]), /* @__PURE__ */ Ve.jsx("div", { ref: o, className: s, style: n });
|
|
5490
5523
|
}
|
|
5491
5524
|
);
|
|
5492
|
-
|
|
5525
|
+
Ai.displayName = "FableEditor";
|
|
5493
5526
|
export {
|
|
5494
|
-
|
|
5527
|
+
Ai as FableEditor
|
|
5495
5528
|
};
|