fable-editor 1.3.0 → 1.3.2
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/word-image-paste.d.ts +9 -0
- package/dist/angular/esm2022/core/editor.mjs +160 -1
- package/dist/angular/esm2022/core/word-image-paste.mjs +73 -4
- package/dist/angular/fesm2022/fable-editor.mjs +231 -3
- package/dist/angular/fesm2022/fable-editor.mjs.map +1 -1
- package/dist/core/editor.d.ts.map +1 -1
- package/dist/core/index.cjs +4 -4
- package/dist/core/index.mjs +860 -752
- package/dist/core/word-image-paste.d.ts +9 -0
- package/dist/core/word-image-paste.d.ts.map +1 -1
- package/dist/react/index.cjs +13 -13
- package/dist/react/index.mjs +1094 -986
- package/package.json +1 -1
package/dist/react/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
1
|
+
import me, { forwardRef as Ye, useRef as z, useImperativeHandle as Ge, useEffect as lt } from "react";
|
|
2
|
+
var Mt = { exports: {} }, J = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -9,19 +9,19 @@ var St = { 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
|
|
17
|
-
function r
|
|
18
|
-
var
|
|
19
|
-
a !== void 0 && (m = "" + a), o.key !== void 0 && (m = "" + o.key), o.ref !== void 0 && (
|
|
20
|
-
for (
|
|
21
|
-
if (
|
|
22
|
-
return { $$typeof: t, type:
|
|
23
|
-
}
|
|
24
|
-
return J.Fragment = e, J.jsx =
|
|
12
|
+
var Jt;
|
|
13
|
+
function Ke() {
|
|
14
|
+
if (Jt) return J;
|
|
15
|
+
Jt = 1;
|
|
16
|
+
var d = me, t = Symbol.for("react.element"), e = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, s = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, n = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
|
+
function l(r, o, a) {
|
|
18
|
+
var u, p = {}, m = null, v = null;
|
|
19
|
+
a !== void 0 && (m = "" + a), o.key !== void 0 && (m = "" + o.key), o.ref !== void 0 && (v = o.ref);
|
|
20
|
+
for (u in o) i.call(o, u) && !n.hasOwnProperty(u) && (p[u] = o[u]);
|
|
21
|
+
if (r && r.defaultProps) for (u in o = r.defaultProps, o) p[u] === void 0 && (p[u] = o[u]);
|
|
22
|
+
return { $$typeof: t, type: r, key: m, ref: v, props: p, _owner: s.current };
|
|
23
|
+
}
|
|
24
|
+
return J.Fragment = e, J.jsx = l, J.jsxs = l, J;
|
|
25
25
|
}
|
|
26
26
|
var tt = {};
|
|
27
27
|
/**
|
|
@@ -33,51 +33,51 @@ var tt = {};
|
|
|
33
33
|
* This source code is licensed under the MIT license found in the
|
|
34
34
|
* LICENSE file in the root directory of this source tree.
|
|
35
35
|
*/
|
|
36
|
-
var
|
|
37
|
-
function
|
|
38
|
-
return
|
|
39
|
-
var
|
|
40
|
-
function
|
|
36
|
+
var te;
|
|
37
|
+
function Qe() {
|
|
38
|
+
return te || (te = 1, process.env.NODE_ENV !== "production" && function() {
|
|
39
|
+
var d = me, 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"), a = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), v = Symbol.for("react.offscreen"), b = Symbol.iterator, f = "@@iterator";
|
|
40
|
+
function y(c) {
|
|
41
41
|
if (c === null || typeof c != "object")
|
|
42
42
|
return null;
|
|
43
|
-
var
|
|
44
|
-
return typeof
|
|
43
|
+
var g = b && c[b] || c[f];
|
|
44
|
+
return typeof g == "function" ? g : null;
|
|
45
45
|
}
|
|
46
|
-
var
|
|
46
|
+
var C = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
47
47
|
function E(c) {
|
|
48
48
|
{
|
|
49
|
-
for (var
|
|
50
|
-
|
|
51
|
-
I("error", c,
|
|
49
|
+
for (var g = arguments.length, x = new Array(g > 1 ? g - 1 : 0), T = 1; T < g; T++)
|
|
50
|
+
x[T - 1] = arguments[T];
|
|
51
|
+
I("error", c, x);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
function I(c,
|
|
54
|
+
function I(c, g, x) {
|
|
55
55
|
{
|
|
56
|
-
var T =
|
|
57
|
-
k !== "" && (
|
|
58
|
-
var H =
|
|
56
|
+
var T = C.ReactDebugCurrentFrame, k = T.getStackAddendum();
|
|
57
|
+
k !== "" && (g += "%s", x = x.concat([k]));
|
|
58
|
+
var H = x.map(function(M) {
|
|
59
59
|
return String(M);
|
|
60
60
|
});
|
|
61
|
-
H.unshift("Warning: " +
|
|
61
|
+
H.unshift("Warning: " + g), Function.prototype.apply.call(console[c], console, H);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
var A = !1, $ = !1,
|
|
65
|
-
|
|
66
|
-
function
|
|
67
|
-
return !!(typeof c == "string" || typeof c == "function" || c === i || c === n || et || c === s || c === a || c ===
|
|
64
|
+
var A = !1, $ = !1, F = !1, Z = !1, et = !1, kt;
|
|
65
|
+
kt = Symbol.for("react.module.reference");
|
|
66
|
+
function xe(c) {
|
|
67
|
+
return !!(typeof c == "string" || typeof c == "function" || c === i || c === n || et || c === s || c === a || c === u || Z || c === v || A || $ || F || typeof c == "object" && c !== null && (c.$$typeof === m || c.$$typeof === p || c.$$typeof === l || c.$$typeof === r || c.$$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
|
-
c.$$typeof ===
|
|
71
|
+
c.$$typeof === kt || c.getModuleId !== void 0));
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function Ce(c, g, x) {
|
|
74
74
|
var T = c.displayName;
|
|
75
75
|
if (T)
|
|
76
76
|
return T;
|
|
77
|
-
var k =
|
|
78
|
-
return k !== "" ?
|
|
77
|
+
var k = g.displayName || g.name || "";
|
|
78
|
+
return k !== "" ? x + "(" + k + ")" : x;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function At(c) {
|
|
81
81
|
return c.displayName || "Context";
|
|
82
82
|
}
|
|
83
83
|
function W(c) {
|
|
@@ -98,19 +98,19 @@ function Ye() {
|
|
|
98
98
|
return "StrictMode";
|
|
99
99
|
case a:
|
|
100
100
|
return "Suspense";
|
|
101
|
-
case
|
|
101
|
+
case u:
|
|
102
102
|
return "SuspenseList";
|
|
103
103
|
}
|
|
104
104
|
if (typeof c == "object")
|
|
105
105
|
switch (c.$$typeof) {
|
|
106
|
-
case l:
|
|
107
|
-
var f = c;
|
|
108
|
-
return kt(f) + ".Consumer";
|
|
109
106
|
case r:
|
|
110
|
-
var
|
|
111
|
-
return
|
|
107
|
+
var g = c;
|
|
108
|
+
return At(g) + ".Consumer";
|
|
109
|
+
case l:
|
|
110
|
+
var x = c;
|
|
111
|
+
return At(x._context) + ".Provider";
|
|
112
112
|
case o:
|
|
113
|
-
return
|
|
113
|
+
return Ce(c, c.render, "ForwardRef");
|
|
114
114
|
case p:
|
|
115
115
|
var T = c.displayName || null;
|
|
116
116
|
return T !== null ? T : W(c.type) || "Memo";
|
|
@@ -125,14 +125,14 @@ function Ye() {
|
|
|
125
125
|
}
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
|
-
var U = Object.assign,
|
|
128
|
+
var U = Object.assign, K = 0, Ht, It, qt, Rt, Pt, Bt, Dt;
|
|
129
129
|
function Nt() {
|
|
130
130
|
}
|
|
131
131
|
Nt.__reactDisabledLog = !0;
|
|
132
|
-
function
|
|
132
|
+
function we() {
|
|
133
133
|
{
|
|
134
|
-
if (
|
|
135
|
-
|
|
134
|
+
if (K === 0) {
|
|
135
|
+
Ht = console.log, It = console.info, qt = console.warn, Rt = console.error, Pt = console.group, Bt = console.groupCollapsed, Dt = console.groupEnd;
|
|
136
136
|
var c = {
|
|
137
137
|
configurable: !0,
|
|
138
138
|
enumerable: !0,
|
|
@@ -149,12 +149,12 @@ function Ye() {
|
|
|
149
149
|
groupEnd: c
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
K++;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function Te() {
|
|
156
156
|
{
|
|
157
|
-
if (
|
|
157
|
+
if (K--, K === 0) {
|
|
158
158
|
var c = {
|
|
159
159
|
configurable: !0,
|
|
160
160
|
enumerable: !0,
|
|
@@ -162,66 +162,66 @@ function Ye() {
|
|
|
162
162
|
};
|
|
163
163
|
Object.defineProperties(console, {
|
|
164
164
|
log: U({}, c, {
|
|
165
|
-
value:
|
|
165
|
+
value: Ht
|
|
166
166
|
}),
|
|
167
167
|
info: U({}, c, {
|
|
168
|
-
value:
|
|
168
|
+
value: It
|
|
169
169
|
}),
|
|
170
170
|
warn: U({}, c, {
|
|
171
|
-
value:
|
|
171
|
+
value: qt
|
|
172
172
|
}),
|
|
173
173
|
error: U({}, c, {
|
|
174
|
-
value:
|
|
174
|
+
value: Rt
|
|
175
175
|
}),
|
|
176
176
|
group: U({}, c, {
|
|
177
|
-
value:
|
|
177
|
+
value: Pt
|
|
178
178
|
}),
|
|
179
179
|
groupCollapsed: U({}, c, {
|
|
180
|
-
value:
|
|
180
|
+
value: Bt
|
|
181
181
|
}),
|
|
182
182
|
groupEnd: U({}, c, {
|
|
183
|
-
value:
|
|
183
|
+
value: Dt
|
|
184
184
|
})
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
|
|
187
|
+
K < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
var
|
|
191
|
-
function it(c,
|
|
190
|
+
var mt = C.ReactCurrentDispatcher, ft;
|
|
191
|
+
function it(c, g, x) {
|
|
192
192
|
{
|
|
193
|
-
if (
|
|
193
|
+
if (ft === void 0)
|
|
194
194
|
try {
|
|
195
195
|
throw Error();
|
|
196
196
|
} catch (k) {
|
|
197
197
|
var T = k.stack.trim().match(/\n( *(at )?)/);
|
|
198
|
-
|
|
198
|
+
ft = T && T[1] || "";
|
|
199
199
|
}
|
|
200
200
|
return `
|
|
201
|
-
` +
|
|
201
|
+
` + ft + c;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
var
|
|
204
|
+
var gt = !1, st;
|
|
205
205
|
{
|
|
206
|
-
var
|
|
207
|
-
st = new
|
|
206
|
+
var Ee = typeof WeakMap == "function" ? WeakMap : Map;
|
|
207
|
+
st = new Ee();
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
if (!c ||
|
|
209
|
+
function Ot(c, g) {
|
|
210
|
+
if (!c || gt)
|
|
211
211
|
return "";
|
|
212
212
|
{
|
|
213
|
-
var
|
|
214
|
-
if (
|
|
215
|
-
return
|
|
213
|
+
var x = st.get(c);
|
|
214
|
+
if (x !== void 0)
|
|
215
|
+
return x;
|
|
216
216
|
}
|
|
217
217
|
var T;
|
|
218
|
-
|
|
218
|
+
gt = !0;
|
|
219
219
|
var k = Error.prepareStackTrace;
|
|
220
220
|
Error.prepareStackTrace = void 0;
|
|
221
221
|
var H;
|
|
222
|
-
H =
|
|
222
|
+
H = mt.current, mt.current = null, we();
|
|
223
223
|
try {
|
|
224
|
-
if (
|
|
224
|
+
if (g) {
|
|
225
225
|
var M = function() {
|
|
226
226
|
throw Error();
|
|
227
227
|
};
|
|
@@ -232,37 +232,37 @@ function Ye() {
|
|
|
232
232
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
233
233
|
try {
|
|
234
234
|
Reflect.construct(M, []);
|
|
235
|
-
} catch (
|
|
236
|
-
T =
|
|
235
|
+
} catch (N) {
|
|
236
|
+
T = N;
|
|
237
237
|
}
|
|
238
238
|
Reflect.construct(c, [], M);
|
|
239
239
|
} else {
|
|
240
240
|
try {
|
|
241
241
|
M.call();
|
|
242
|
-
} catch (
|
|
243
|
-
T =
|
|
242
|
+
} catch (N) {
|
|
243
|
+
T = N;
|
|
244
244
|
}
|
|
245
245
|
c.call(M.prototype);
|
|
246
246
|
}
|
|
247
247
|
} else {
|
|
248
248
|
try {
|
|
249
249
|
throw Error();
|
|
250
|
-
} catch (
|
|
251
|
-
T =
|
|
250
|
+
} catch (N) {
|
|
251
|
+
T = N;
|
|
252
252
|
}
|
|
253
253
|
c();
|
|
254
254
|
}
|
|
255
|
-
} catch (
|
|
256
|
-
if (
|
|
257
|
-
for (var S =
|
|
258
|
-
`),
|
|
259
|
-
`), R = S.length - 1, P =
|
|
255
|
+
} catch (N) {
|
|
256
|
+
if (N && T && typeof N.stack == "string") {
|
|
257
|
+
for (var S = N.stack.split(`
|
|
258
|
+
`), D = T.stack.split(`
|
|
259
|
+
`), R = S.length - 1, P = D.length - 1; R >= 1 && P >= 0 && S[R] !== D[P]; )
|
|
260
260
|
P--;
|
|
261
261
|
for (; R >= 1 && P >= 0; R--, P--)
|
|
262
|
-
if (S[R] !==
|
|
262
|
+
if (S[R] !== D[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] !== D[P]) {
|
|
266
266
|
var _ = `
|
|
267
267
|
` + S[R].replace(" at new ", " at ");
|
|
268
268
|
return c.displayName && _.includes("<anonymous>") && (_ = _.replace("<anonymous>", c.displayName)), typeof c == "function" && st.set(c, _), _;
|
|
@@ -272,153 +272,153 @@ function Ye() {
|
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
} finally {
|
|
275
|
-
|
|
275
|
+
gt = !1, mt.current = H, Te(), Error.prepareStackTrace = k;
|
|
276
276
|
}
|
|
277
277
|
var G = c ? c.displayName || c.name : "", V = G ? it(G) : "";
|
|
278
278
|
return typeof c == "function" && st.set(c, V), V;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
return
|
|
280
|
+
function Se(c, g, x) {
|
|
281
|
+
return Ot(c, !1);
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
var
|
|
285
|
-
return !!(
|
|
283
|
+
function Me(c) {
|
|
284
|
+
var g = c.prototype;
|
|
285
|
+
return !!(g && g.isReactComponent);
|
|
286
286
|
}
|
|
287
|
-
function nt(c,
|
|
287
|
+
function nt(c, g, x) {
|
|
288
288
|
if (c == null)
|
|
289
289
|
return "";
|
|
290
290
|
if (typeof c == "function")
|
|
291
|
-
return
|
|
291
|
+
return Ot(c, Me(c));
|
|
292
292
|
if (typeof c == "string")
|
|
293
293
|
return it(c);
|
|
294
294
|
switch (c) {
|
|
295
295
|
case a:
|
|
296
296
|
return it("Suspense");
|
|
297
|
-
case
|
|
297
|
+
case u:
|
|
298
298
|
return it("SuspenseList");
|
|
299
299
|
}
|
|
300
300
|
if (typeof c == "object")
|
|
301
301
|
switch (c.$$typeof) {
|
|
302
302
|
case o:
|
|
303
|
-
return
|
|
303
|
+
return Se(c.render);
|
|
304
304
|
case p:
|
|
305
|
-
return nt(c.type,
|
|
305
|
+
return nt(c.type, g, x);
|
|
306
306
|
case m: {
|
|
307
307
|
var T = c, k = T._payload, H = T._init;
|
|
308
308
|
try {
|
|
309
|
-
return nt(H(k),
|
|
309
|
+
return nt(H(k), g, x);
|
|
310
310
|
} catch {
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
return "";
|
|
315
315
|
}
|
|
316
|
-
var
|
|
316
|
+
var Q = Object.prototype.hasOwnProperty, Ft = {}, Zt = C.ReactDebugCurrentFrame;
|
|
317
317
|
function rt(c) {
|
|
318
318
|
if (c) {
|
|
319
|
-
var
|
|
320
|
-
Zt.setExtraStackFrame(
|
|
319
|
+
var g = c._owner, x = nt(c.type, c._source, g ? g.type : null);
|
|
320
|
+
Zt.setExtraStackFrame(x);
|
|
321
321
|
} else
|
|
322
322
|
Zt.setExtraStackFrame(null);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function Le(c, g, x, T, k) {
|
|
325
325
|
{
|
|
326
|
-
var H = Function.call.bind(
|
|
326
|
+
var H = Function.call.bind(Q);
|
|
327
327
|
for (var M in c)
|
|
328
328
|
if (H(c, M)) {
|
|
329
329
|
var S = void 0;
|
|
330
330
|
try {
|
|
331
331
|
if (typeof c[M] != "function") {
|
|
332
|
-
var
|
|
333
|
-
throw
|
|
332
|
+
var D = Error((T || "React class") + ": " + x + " type `" + M + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof c[M] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
333
|
+
throw D.name = "Invariant Violation", D;
|
|
334
334
|
}
|
|
335
|
-
S = c[M](
|
|
335
|
+
S = c[M](g, M, T, x, 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) && (rt(k), 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",
|
|
339
|
+
S && !(S instanceof Error) && (rt(k), 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", x, M, typeof S), rt(null)), S instanceof Error && !(S.message in Ft) && (Ft[S.message] = !0, rt(k), E("Failed %s type: %s", x, S.message), rt(null));
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
var
|
|
344
|
-
function
|
|
345
|
-
return
|
|
343
|
+
var ke = Array.isArray;
|
|
344
|
+
function vt(c) {
|
|
345
|
+
return ke(c);
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function Ae(c) {
|
|
348
348
|
{
|
|
349
|
-
var
|
|
350
|
-
return
|
|
349
|
+
var g = typeof Symbol == "function" && Symbol.toStringTag, x = g && c[Symbol.toStringTag] || c.constructor.name || "Object";
|
|
350
|
+
return x;
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function He(c) {
|
|
354
354
|
try {
|
|
355
|
-
return
|
|
355
|
+
return _t(c), !1;
|
|
356
356
|
} catch {
|
|
357
357
|
return !0;
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function _t(c) {
|
|
361
361
|
return "" + c;
|
|
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 $t(c) {
|
|
364
|
+
if (He(c))
|
|
365
|
+
return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ae(c)), _t(c);
|
|
366
366
|
}
|
|
367
|
-
var
|
|
367
|
+
var jt = C.ReactCurrentOwner, Ie = {
|
|
368
368
|
key: !0,
|
|
369
369
|
ref: !0,
|
|
370
370
|
__self: !0,
|
|
371
371
|
__source: !0
|
|
372
|
-
},
|
|
373
|
-
function
|
|
374
|
-
if (
|
|
375
|
-
var
|
|
376
|
-
if (
|
|
372
|
+
}, Wt, Ut;
|
|
373
|
+
function qe(c) {
|
|
374
|
+
if (Q.call(c, "ref")) {
|
|
375
|
+
var g = Object.getOwnPropertyDescriptor(c, "ref").get;
|
|
376
|
+
if (g && g.isReactWarning)
|
|
377
377
|
return !1;
|
|
378
378
|
}
|
|
379
379
|
return c.ref !== void 0;
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
if (
|
|
383
|
-
var
|
|
384
|
-
if (
|
|
381
|
+
function Re(c) {
|
|
382
|
+
if (Q.call(c, "key")) {
|
|
383
|
+
var g = Object.getOwnPropertyDescriptor(c, "key").get;
|
|
384
|
+
if (g && g.isReactWarning)
|
|
385
385
|
return !1;
|
|
386
386
|
}
|
|
387
387
|
return c.key !== void 0;
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
typeof c.ref == "string" &&
|
|
389
|
+
function Pe(c, g) {
|
|
390
|
+
typeof c.ref == "string" && jt.current;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function Be(c, g) {
|
|
393
393
|
{
|
|
394
|
-
var
|
|
395
|
-
|
|
394
|
+
var x = function() {
|
|
395
|
+
Wt || (Wt = !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)", g));
|
|
396
396
|
};
|
|
397
|
-
|
|
398
|
-
get:
|
|
397
|
+
x.isReactWarning = !0, Object.defineProperty(c, "key", {
|
|
398
|
+
get: x,
|
|
399
399
|
configurable: !0
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function De(c, g) {
|
|
404
404
|
{
|
|
405
|
-
var
|
|
406
|
-
|
|
405
|
+
var x = function() {
|
|
406
|
+
Ut || (Ut = !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)", g));
|
|
407
407
|
};
|
|
408
|
-
|
|
409
|
-
get:
|
|
408
|
+
x.isReactWarning = !0, Object.defineProperty(c, "ref", {
|
|
409
|
+
get: x,
|
|
410
410
|
configurable: !0
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
var
|
|
414
|
+
var Ne = function(c, g, x, T, k, H, M) {
|
|
415
415
|
var S = {
|
|
416
416
|
// This tag allows us to uniquely identify this as a React Element
|
|
417
417
|
$$typeof: t,
|
|
418
418
|
// Built-in properties that belong on the element
|
|
419
419
|
type: c,
|
|
420
|
-
key:
|
|
421
|
-
ref:
|
|
420
|
+
key: g,
|
|
421
|
+
ref: x,
|
|
422
422
|
props: M,
|
|
423
423
|
// Record the component responsible for creating this element.
|
|
424
424
|
_owner: H
|
|
@@ -440,41 +440,41 @@ function Ye() {
|
|
|
440
440
|
value: k
|
|
441
441
|
}), Object.freeze && (Object.freeze(S.props), Object.freeze(S)), S;
|
|
442
442
|
};
|
|
443
|
-
function
|
|
443
|
+
function Oe(c, g, x, T, k) {
|
|
444
444
|
{
|
|
445
|
-
var H, M = {}, S = null,
|
|
446
|
-
|
|
447
|
-
for (H in
|
|
448
|
-
|
|
445
|
+
var H, M = {}, S = null, D = null;
|
|
446
|
+
x !== void 0 && ($t(x), S = "" + x), Re(g) && ($t(g.key), S = "" + g.key), qe(g) && (D = g.ref, Pe(g, k));
|
|
447
|
+
for (H in g)
|
|
448
|
+
Q.call(g, H) && !Ie.hasOwnProperty(H) && (M[H] = g[H]);
|
|
449
449
|
if (c && c.defaultProps) {
|
|
450
450
|
var R = c.defaultProps;
|
|
451
451
|
for (H in R)
|
|
452
452
|
M[H] === void 0 && (M[H] = R[H]);
|
|
453
453
|
}
|
|
454
|
-
if (S ||
|
|
454
|
+
if (S || D) {
|
|
455
455
|
var P = typeof c == "function" ? c.displayName || c.name || "Unknown" : c;
|
|
456
|
-
S &&
|
|
456
|
+
S && Be(M, P), D && De(M, P);
|
|
457
457
|
}
|
|
458
|
-
return
|
|
458
|
+
return Ne(c, S, D, k, T, jt.current, M);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
var
|
|
461
|
+
var bt = C.ReactCurrentOwner, Vt = C.ReactDebugCurrentFrame;
|
|
462
462
|
function Y(c) {
|
|
463
463
|
if (c) {
|
|
464
|
-
var
|
|
465
|
-
|
|
464
|
+
var g = c._owner, x = nt(c.type, c._source, g ? g.type : null);
|
|
465
|
+
Vt.setExtraStackFrame(x);
|
|
466
466
|
} else
|
|
467
|
-
|
|
467
|
+
Vt.setExtraStackFrame(null);
|
|
468
468
|
}
|
|
469
|
-
var
|
|
470
|
-
|
|
471
|
-
function
|
|
469
|
+
var yt;
|
|
470
|
+
yt = !1;
|
|
471
|
+
function xt(c) {
|
|
472
472
|
return typeof c == "object" && c !== null && c.$$typeof === t;
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function zt() {
|
|
475
475
|
{
|
|
476
|
-
if (
|
|
477
|
-
var c = W(
|
|
476
|
+
if (bt.current) {
|
|
477
|
+
var c = W(bt.current.type);
|
|
478
478
|
if (c)
|
|
479
479
|
return `
|
|
480
480
|
|
|
@@ -483,83 +483,83 @@ Check the render method of \`` + c + "`.";
|
|
|
483
483
|
return "";
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
|
-
function
|
|
486
|
+
function Fe(c) {
|
|
487
487
|
return "";
|
|
488
488
|
}
|
|
489
|
-
var
|
|
490
|
-
function
|
|
489
|
+
var Xt = {};
|
|
490
|
+
function Ze(c) {
|
|
491
491
|
{
|
|
492
|
-
var
|
|
493
|
-
if (!
|
|
494
|
-
var
|
|
495
|
-
|
|
492
|
+
var g = zt();
|
|
493
|
+
if (!g) {
|
|
494
|
+
var x = typeof c == "string" ? c : c.displayName || c.name;
|
|
495
|
+
x && (g = `
|
|
496
496
|
|
|
497
|
-
Check the top-level render call using <` +
|
|
497
|
+
Check the top-level render call using <` + x + ">.");
|
|
498
498
|
}
|
|
499
|
-
return
|
|
499
|
+
return g;
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function Yt(c, g) {
|
|
503
503
|
{
|
|
504
504
|
if (!c._store || c._store.validated || c.key != null)
|
|
505
505
|
return;
|
|
506
506
|
c._store.validated = !0;
|
|
507
|
-
var
|
|
508
|
-
if (
|
|
507
|
+
var x = Ze(g);
|
|
508
|
+
if (Xt[x])
|
|
509
509
|
return;
|
|
510
|
-
|
|
510
|
+
Xt[x] = !0;
|
|
511
511
|
var T = "";
|
|
512
|
-
c && c._owner && c._owner !==
|
|
512
|
+
c && c._owner && c._owner !== bt.current && (T = " It was passed a child from " + W(c._owner.type) + "."), Y(c), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', x, T), Y(null);
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function Gt(c, g) {
|
|
516
516
|
{
|
|
517
517
|
if (typeof c != "object")
|
|
518
518
|
return;
|
|
519
|
-
if (
|
|
520
|
-
for (var
|
|
521
|
-
var T = c[
|
|
522
|
-
|
|
519
|
+
if (vt(c))
|
|
520
|
+
for (var x = 0; x < c.length; x++) {
|
|
521
|
+
var T = c[x];
|
|
522
|
+
xt(T) && Yt(T, g);
|
|
523
523
|
}
|
|
524
|
-
else if (
|
|
524
|
+
else if (xt(c))
|
|
525
525
|
c._store && (c._store.validated = !0);
|
|
526
526
|
else if (c) {
|
|
527
|
-
var k =
|
|
527
|
+
var k = y(c);
|
|
528
528
|
if (typeof k == "function" && k !== c.entries)
|
|
529
529
|
for (var H = k.call(c), M; !(M = H.next()).done; )
|
|
530
|
-
|
|
530
|
+
xt(M.value) && Yt(M.value, g);
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function _e(c) {
|
|
535
535
|
{
|
|
536
|
-
var
|
|
537
|
-
if (
|
|
536
|
+
var g = c.type;
|
|
537
|
+
if (g == null || typeof g == "string")
|
|
538
538
|
return;
|
|
539
|
-
var
|
|
540
|
-
if (typeof
|
|
541
|
-
|
|
542
|
-
else if (typeof
|
|
539
|
+
var x;
|
|
540
|
+
if (typeof g == "function")
|
|
541
|
+
x = g.propTypes;
|
|
542
|
+
else if (typeof g == "object" && (g.$$typeof === o || // Note: Memo only checks outer props here.
|
|
543
543
|
// Inner props are checked in the reconciler.
|
|
544
|
-
|
|
545
|
-
|
|
544
|
+
g.$$typeof === p))
|
|
545
|
+
x = g.propTypes;
|
|
546
546
|
else
|
|
547
547
|
return;
|
|
548
|
-
if (
|
|
549
|
-
var T = W(
|
|
550
|
-
|
|
551
|
-
} else if (
|
|
552
|
-
|
|
553
|
-
var k = W(
|
|
548
|
+
if (x) {
|
|
549
|
+
var T = W(g);
|
|
550
|
+
Le(x, c.props, "prop", T, c);
|
|
551
|
+
} else if (g.PropTypes !== void 0 && !yt) {
|
|
552
|
+
yt = !0;
|
|
553
|
+
var k = W(g);
|
|
554
554
|
E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", k || "Unknown");
|
|
555
555
|
}
|
|
556
|
-
typeof
|
|
556
|
+
typeof g.getDefaultProps == "function" && !g.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 $e(c) {
|
|
560
560
|
{
|
|
561
|
-
for (var
|
|
562
|
-
var T =
|
|
561
|
+
for (var g = Object.keys(c.props), x = 0; x < g.length; x++) {
|
|
562
|
+
var T = g[x];
|
|
563
563
|
if (T !== "children" && T !== "key") {
|
|
564
564
|
Y(c), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", T), Y(null);
|
|
565
565
|
break;
|
|
@@ -568,64 +568,64 @@ Check the top-level render call using <` + v + ">.");
|
|
|
568
568
|
c.ref !== null && (Y(c), E("Invalid attribute `ref` supplied to `React.Fragment`."), Y(null));
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
|
-
var
|
|
572
|
-
function Qt(c,
|
|
571
|
+
var Kt = {};
|
|
572
|
+
function Qt(c, g, x, T, k, H) {
|
|
573
573
|
{
|
|
574
|
-
var M =
|
|
574
|
+
var M = xe(c);
|
|
575
575
|
if (!M) {
|
|
576
576
|
var S = "";
|
|
577
577
|
(c === void 0 || typeof c == "object" && c !== null && Object.keys(c).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 D = Fe();
|
|
579
|
+
D ? S += D : S += zt();
|
|
580
580
|
var R;
|
|
581
|
-
c === null ? R = "null" :
|
|
581
|
+
c === null ? R = "null" : vt(c) ? R = "array" : c !== void 0 && c.$$typeof === t ? (R = "<" + (W(c.type) || "Unknown") + " />", S = " Did you accidentally export a JSX literal instead of a component?") : R = typeof c, 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 = Oe(c, g, x, k, H);
|
|
584
584
|
if (P == null)
|
|
585
585
|
return P;
|
|
586
586
|
if (M) {
|
|
587
|
-
var _ =
|
|
587
|
+
var _ = g.children;
|
|
588
588
|
if (_ !== void 0)
|
|
589
589
|
if (T)
|
|
590
|
-
if (
|
|
590
|
+
if (vt(_)) {
|
|
591
591
|
for (var G = 0; G < _.length; G++)
|
|
592
|
-
|
|
592
|
+
Gt(_[G], c);
|
|
593
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
|
-
|
|
597
|
+
Gt(_, c);
|
|
598
598
|
}
|
|
599
|
-
if (
|
|
600
|
-
var V = W(c),
|
|
601
|
-
return
|
|
602
|
-
}),
|
|
603
|
-
if (!
|
|
604
|
-
var
|
|
599
|
+
if (Q.call(g, "key")) {
|
|
600
|
+
var V = W(c), N = Object.keys(g).filter(function(Xe) {
|
|
601
|
+
return Xe !== "key";
|
|
602
|
+
}), Ct = N.length > 0 ? "{key: someKey, " + N.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
603
|
+
if (!Kt[V + Ct]) {
|
|
604
|
+
var ze = N.length > 0 ? "{" + N.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} />`,
|
|
610
|
+
<%s key={someKey} {...props} />`, Ct, V, ze, V), Kt[V + Ct] = !0;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
return c === i ?
|
|
613
|
+
return c === i ? $e(P) : _e(P), P;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
function
|
|
617
|
-
return Qt(c,
|
|
616
|
+
function je(c, g, x) {
|
|
617
|
+
return Qt(c, g, x, !0);
|
|
618
618
|
}
|
|
619
|
-
function
|
|
620
|
-
return Qt(c,
|
|
619
|
+
function We(c, g, x) {
|
|
620
|
+
return Qt(c, g, x, !1);
|
|
621
621
|
}
|
|
622
|
-
var
|
|
623
|
-
tt.Fragment = i, tt.jsx =
|
|
622
|
+
var Ue = We, Ve = je;
|
|
623
|
+
tt.Fragment = i, tt.jsx = Ue, tt.jsxs = Ve;
|
|
624
624
|
}()), tt;
|
|
625
625
|
}
|
|
626
|
-
process.env.NODE_ENV === "production" ?
|
|
627
|
-
var
|
|
628
|
-
const
|
|
626
|
+
process.env.NODE_ENV === "production" ? Mt.exports = Ke() : Mt.exports = Qe();
|
|
627
|
+
var Je = Mt.exports;
|
|
628
|
+
const ti = {
|
|
629
629
|
en: {
|
|
630
630
|
dir: "ltr",
|
|
631
631
|
file: "File",
|
|
@@ -1011,10 +1011,10 @@ const Qe = {
|
|
|
1011
1011
|
emcat_flags: "أعلام"
|
|
1012
1012
|
}
|
|
1013
1013
|
};
|
|
1014
|
-
function
|
|
1015
|
-
return
|
|
1014
|
+
function wt(d) {
|
|
1015
|
+
return ti[d];
|
|
1016
1016
|
}
|
|
1017
|
-
const
|
|
1017
|
+
const ei = "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", ii = "file edit view insert format tools table help", si = [
|
|
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 Ke = "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
|
+
], ni = ["8px", "9px", "10px", "11px", "12px", "14px", "16px", "18px", "20px", "24px", "28px", "32px", "36px", "48px", "72px", "96px"], ri = 1, li = 100, ee = ["1", "1.15", "1.4", "1.5", "1.75", "2", "2.5", "3"], ie = ["1px", "2px", "4px", "6px", "8px", "12px"], se = ["0.5px", "1px", "1.5px", "2px", "3px", "4px"], ne = [
|
|
1038
1038
|
["plain", "Plain text"],
|
|
1039
1039
|
["html", "HTML/XML"],
|
|
1040
1040
|
["css", "CSS"],
|
|
@@ -1051,7 +1051,7 @@ const Ke = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1051
1051
|
["rust", "Rust"],
|
|
1052
1052
|
["sql", "SQL"],
|
|
1053
1053
|
["bash", "Bash/Shell"]
|
|
1054
|
-
],
|
|
1054
|
+
], re = [
|
|
1055
1055
|
["p", "para"],
|
|
1056
1056
|
["h1", "heading1"],
|
|
1057
1057
|
["h2", "heading2"],
|
|
@@ -1060,7 +1060,7 @@ const Ke = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1060
1060
|
["h5", "heading5"],
|
|
1061
1061
|
["h6", "heading6"],
|
|
1062
1062
|
["pre", "pre"]
|
|
1063
|
-
],
|
|
1063
|
+
], oi = ["#F76707", "#4263EB", "#CC5DE8"], ai = [
|
|
1064
1064
|
"#FFFFFF",
|
|
1065
1065
|
"#F4F4F4",
|
|
1066
1066
|
"#E8EAED",
|
|
@@ -1086,7 +1086,7 @@ const Ke = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1086
1086
|
"#8E24AA",
|
|
1087
1087
|
"#C2185B",
|
|
1088
1088
|
"#6D4C41"
|
|
1089
|
-
],
|
|
1089
|
+
], ci = [
|
|
1090
1090
|
{
|
|
1091
1091
|
key: "chcat_currency",
|
|
1092
1092
|
chars: [
|
|
@@ -1426,7 +1426,7 @@ const Ke = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1426
1426
|
"ة"
|
|
1427
1427
|
]
|
|
1428
1428
|
}
|
|
1429
|
-
],
|
|
1429
|
+
], hi = [
|
|
1430
1430
|
{
|
|
1431
1431
|
key: "emcat_smileys",
|
|
1432
1432
|
chars: [
|
|
@@ -2151,111 +2151,111 @@ const Ke = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
2151
2151
|
"🇲🇦"
|
|
2152
2152
|
]
|
|
2153
2153
|
}
|
|
2154
|
-
], L = (
|
|
2155
|
-
'<path d="M10 6h10M10 12h10M10 18h10"/>' +
|
|
2154
|
+
], L = (d, t) => `<svg viewBox="${t || "0 0 24 24"}">${d}</svg>`, w = (d) => L(`<path class="f" d="${d}"/>`, "0 -960 960 960"), ot = (d, t = 7.5) => L(
|
|
2155
|
+
'<path d="M10 6h10M10 12h10M10 18h10"/>' + d.map(
|
|
2156
2156
|
(e, i) => `<text x="2.5" y="${8.4 + i * 6}" font-size="${t}" stroke="none" fill="#222f3e" font-family="Arial">${e}</text>`
|
|
2157
2157
|
).join("")
|
|
2158
2158
|
), h = {
|
|
2159
|
-
bold:
|
|
2159
|
+
bold: w(
|
|
2160
2160
|
"M272-200v-560h221q65 0 120 40t55 111q0 51-23 78.5T602-491q25 11 55.5 41t30.5 90q0 89-65 124.5T501-200H272Zm121-112h104q48 0 58.5-24.5T566-372q0-11-10.5-35.5T494-432H393v120Zm0-228h93q33 0 48-17t15-38q0-24-17-39t-44-15h-95v109Z"
|
|
2161
2161
|
),
|
|
2162
|
-
italic:
|
|
2163
|
-
underline:
|
|
2162
|
+
italic: w("M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z"),
|
|
2163
|
+
underline: w(
|
|
2164
2164
|
"M200-120v-80h560v80H200Zm123-223q-56-63-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63q-101 0-157-63Z"
|
|
2165
2165
|
),
|
|
2166
|
-
strikethrough:
|
|
2166
|
+
strikethrough: w(
|
|
2167
2167
|
"M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z"
|
|
2168
2168
|
),
|
|
2169
|
-
undo:
|
|
2170
|
-
redo:
|
|
2171
|
-
ltr:
|
|
2169
|
+
undo: w("M280-200v-80h284q63 0 109.5-40T720-420q0-60-46.5-100T564-560H312l104 104-56 56-200-200 200-200 56 56-104 104h252q97 0 166.5 63T800-420q0 94-69.5 157T564-200H280Z"),
|
|
2170
|
+
redo: w("M396-200q-97 0-166.5-63T160-420q0-94 69.5-157T396-640h252L544-744l56-56 200 200-200 200-56-56 104-104H396q-63 0-109.5 40T240-420q0 60 46.5 100T396-280h284v80H396Z"),
|
|
2171
|
+
ltr: w(
|
|
2172
2172
|
"M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm0-280v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80ZM680-80l-56-56 64-64H120v-80h568l-64-64 56-56 160 160L680-80Z"
|
|
2173
2173
|
),
|
|
2174
|
-
rtl:
|
|
2174
|
+
rtl: w(
|
|
2175
2175
|
"M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm-88 160 64 64-56 56-160-160 160-160 56 56-64 64h568v80H272Zm88-440v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80Z"
|
|
2176
2176
|
),
|
|
2177
|
-
alignleft:
|
|
2177
|
+
alignleft: w(
|
|
2178
2178
|
"M120-120v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Z"
|
|
2179
2179
|
),
|
|
2180
|
-
aligncenter:
|
|
2180
|
+
aligncenter: w(
|
|
2181
2181
|
"M120-120v-80h720v80H120Zm160-160v-80h400v80H280ZM120-440v-80h720v80H120Zm160-160v-80h400v80H280ZM120-760v-80h720v80H120Z"
|
|
2182
2182
|
),
|
|
2183
|
-
alignright:
|
|
2183
|
+
alignright: w(
|
|
2184
2184
|
"M120-760v-80h720v80H120Zm240 160v-80h480v80H360ZM120-440v-80h720v80H120Zm240 160v-80h480v80H360ZM120-120v-80h720v80H120Z"
|
|
2185
2185
|
),
|
|
2186
|
-
alignjustify:
|
|
2186
|
+
alignjustify: w(
|
|
2187
2187
|
"M120-120v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Z"
|
|
2188
2188
|
),
|
|
2189
|
-
fullscreen:
|
|
2189
|
+
fullscreen: w(
|
|
2190
2190
|
"M120-120v-200h80v120h120v80H120Zm520 0v-80h120v-120h80v200H640ZM120-640v-200h200v80H200v120h-80Zm640 0v-120H640v-80h200v200h-80Z"
|
|
2191
2191
|
),
|
|
2192
|
-
clearformatic:
|
|
2192
|
+
clearformatic: w(
|
|
2193
2193
|
"m528-546-93-93-121-121h486v120H568l-40 94ZM792-56 460-388l-80 188H249l119-280L56-792l56-56 736 736-56 56Z"
|
|
2194
2194
|
),
|
|
2195
|
-
numlist:
|
|
2195
|
+
numlist: w(
|
|
2196
2196
|
"M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z"
|
|
2197
2197
|
),
|
|
2198
|
-
bullist:
|
|
2198
|
+
bullist: w(
|
|
2199
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"
|
|
2200
2200
|
),
|
|
2201
2201
|
chev: L('<path d="M2 3.5 6 7.5 10 3.5"/>', "0 0 12 11"),
|
|
2202
|
-
backcolor:
|
|
2202
|
+
backcolor: w(
|
|
2203
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"
|
|
2204
2204
|
),
|
|
2205
|
-
outdent:
|
|
2205
|
+
outdent: w(
|
|
2206
2206
|
"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z"
|
|
2207
2207
|
),
|
|
2208
|
-
indent:
|
|
2208
|
+
indent: w(
|
|
2209
2209
|
"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z"
|
|
2210
2210
|
),
|
|
2211
2211
|
more: L(
|
|
2212
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"/>'
|
|
2213
2213
|
),
|
|
2214
|
-
image:
|
|
2214
|
+
image: w(
|
|
2215
2215
|
"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-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"
|
|
2216
2216
|
),
|
|
2217
|
-
uploadic:
|
|
2217
|
+
uploadic: w(
|
|
2218
2218
|
"M440-200v-326L336-422l-56-58 200-200 200 200-56 58-104-104v326h-80ZM240-80q-33 0-56.5-23.5T160-160v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-80H240Z"
|
|
2219
2219
|
),
|
|
2220
|
-
tableic:
|
|
2220
|
+
tableic: w(
|
|
2221
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"
|
|
2222
2222
|
),
|
|
2223
2223
|
hric: L('<path d="M4 12h16"/>'),
|
|
2224
|
-
charic:
|
|
2224
|
+
charic: w(
|
|
2225
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"
|
|
2226
2226
|
),
|
|
2227
2227
|
dateic: L(
|
|
2228
2228
|
'<rect x="4" y="6" width="16" height="14" rx="1.5"/><path d="M4 10h16M8 4v4M16 4v4"/>'
|
|
2229
2229
|
),
|
|
2230
|
-
pbic:
|
|
2230
|
+
pbic: w(
|
|
2231
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"
|
|
2232
2232
|
),
|
|
2233
2233
|
nbspic: L('<path d="M6 12v4h12v-4"/>'),
|
|
2234
|
-
srcic:
|
|
2234
|
+
srcic: w(
|
|
2235
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"
|
|
2236
2236
|
),
|
|
2237
|
-
prevw:
|
|
2237
|
+
prevw: w(
|
|
2238
2238
|
"M607.5-372.5Q660-425 660-500t-52.5-127.5Q555-680 480-680t-127.5 52.5Q300-575 300-500t52.5 127.5Q405-320 480-320t127.5-52.5Zm-204-51Q372-455 372-500t31.5-76.5Q435-608 480-608t76.5 31.5Q588-545 588-500t-31.5 76.5Q525-392 480-392t-76.5-31.5ZM214-281.5Q94-363 40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200q-146 0-266-81.5ZM480-500Zm207.5 160.5Q782-399 832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280q113 0 207.5-59.5Z"
|
|
2239
2239
|
),
|
|
2240
|
-
printic:
|
|
2240
|
+
printic: w(
|
|
2241
2241
|
"M640-640v-120H320v120h-80v-200h480v200h-80Zm-480 80h640-640Zm560 100q17 0 28.5-11.5T760-500q0-17-11.5-28.5T720-540q-17 0-28.5 11.5T680-500q0 17 11.5 28.5T720-460Zm-80 260v-160H320v160h320Zm80 80H240v-160H80v-240q0-51 35-85.5t85-34.5h560q51 0 85.5 34.5T880-520v240H720v160Zm80-240v-160q0-17-11.5-28.5T760-560H200q-17 0-28.5 11.5T160-520v160h80v-80h480v80h80Z"
|
|
2242
2242
|
),
|
|
2243
|
-
cutic:
|
|
2243
|
+
cutic: w(
|
|
2244
2244
|
"M760-120 480-400l-94 94q8 15 11 32t3 34q0 66-47 113T240-80q-66 0-113-47T80-240q0-66 47-113t113-47q17 0 34 3t32 11l94-94-94-94q-15 8-32 11t-34 3q-66 0-113-47T80-720q0-66 47-113t113-47q66 0 113 47t47 113q0 17-3 34t-11 32l494 494v40H760ZM600-520l-80-80 240-240h120v40L600-520ZM296.5-663.5Q320-687 320-720t-23.5-56.5Q273-800 240-800t-56.5 23.5Q160-753 160-720t23.5 56.5Q207-640 240-640t56.5-23.5ZM494-466q6-6 6-14t-6-14q-6-6-14-6t-14 6q-6 6-6 14t6 14q6 6 14 6t14-6ZM296.5-183.5Q320-207 320-240t-23.5-56.5Q273-320 240-320t-56.5 23.5Q160-273 160-240t23.5 56.5Q207-160 240-160t56.5-23.5Z"
|
|
2245
2245
|
),
|
|
2246
|
-
copyic:
|
|
2246
|
+
copyic: w(
|
|
2247
2247
|
"M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"
|
|
2248
2248
|
),
|
|
2249
|
-
pasteic:
|
|
2249
|
+
pasteic: w(
|
|
2250
2250
|
"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h167q11-35 43-57.5t70-22.5q40 0 71.5 22.5T594-840h166q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560h-80v120H280v-120h-80v560Zm308.5-571.5Q520-783 520-800t-11.5-28.5Q497-840 480-840t-28.5 11.5Q440-817 440-800t11.5 28.5Q463-760 480-760t28.5-11.5Z"
|
|
2251
2251
|
),
|
|
2252
|
-
selall:
|
|
2252
|
+
selall: w(
|
|
2253
2253
|
"M280-280v-400h400v400H280Zm80-80h240v-240H360v240ZM200-200v80q-33 0-56.5-23.5T120-200h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm80-160h-80q0-33 23.5-56.5T200-840v80Zm80 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm160 640v-80h80q0 33-23.5 56.5T760-120Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80q33 0 56.5 23.5T840-760h-80Z"
|
|
2254
2254
|
),
|
|
2255
|
-
superscriptic:
|
|
2255
|
+
superscriptic: w(
|
|
2256
2256
|
"M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z"
|
|
2257
2257
|
),
|
|
2258
|
-
subscriptic:
|
|
2258
|
+
subscriptic: w(
|
|
2259
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"
|
|
2260
2260
|
),
|
|
2261
2261
|
newic: L('<path d="M6 3h8l5 5v13H6z"/><path d="M14 3v5h5"/>'),
|
|
@@ -2263,61 +2263,61 @@ const Ke = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
2263
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"/>'
|
|
2264
2264
|
),
|
|
2265
2265
|
wcic: L('<path d="M4 6h16M4 10h16M4 14h9"/><path d="M15 17.5l2 2 3.6-4"/>'),
|
|
2266
|
-
rowbefore:
|
|
2266
|
+
rowbefore: w(
|
|
2267
2267
|
"M200-160h560v-240H200v240Zm640 80H120v-720h160v80h-80v240h560v-240h-80v-80h160v720ZM480-480Zm0 80v-80 80Zm0 0Zm-40-240v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80Z"
|
|
2268
2268
|
),
|
|
2269
|
-
rowafter:
|
|
2269
|
+
rowafter: w(
|
|
2270
2270
|
"M200-560h560v-240H200v240Zm-80 400v-720h720v720H680v-80h80v-240H200v240h80v80H120Zm360-320Zm0-80v80-80Zm0 0ZM440-80v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80Z"
|
|
2271
2271
|
),
|
|
2272
|
-
rowdelete:
|
|
2272
|
+
rowdelete: w(
|
|
2273
2273
|
"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-120H200ZM200-200h560v-560H200ZM200-400v-160h560v160H200ZM330-580l250 250 50-50-250-250ZM330-380l250-250 50 50-250 250Z"
|
|
2274
2274
|
),
|
|
2275
|
-
colbefore:
|
|
2275
|
+
colbefore: w(
|
|
2276
2276
|
"M800-200v-560H560v560h240Zm-640 80v-160h80v80h240v-560H240v80h-80v-160h720v720H160Zm320-360Zm80 0h-80 80Zm0 0ZM160-360v-80H80v-80h80v-80h80v80h80v80h-80v80h-80Z"
|
|
2277
2277
|
),
|
|
2278
|
-
colafter:
|
|
2278
|
+
colafter: w(
|
|
2279
2279
|
"M160-760v560h240v-560H160ZM80-120v-720h720v160h-80v-80H480v560h240v-80h80v160H80Zm400-360Zm-80 0h80-80Zm0 0Zm320 120v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80Z"
|
|
2280
2280
|
),
|
|
2281
|
-
coldelete:
|
|
2281
|
+
coldelete: w(
|
|
2282
2282
|
"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-120H200ZM200-200h560v-560H200ZM400-200v-560h160v560H400ZM330-580l250 250 50-50-250-250ZM330-380l250-250 50 50-250 250Z"
|
|
2283
2283
|
),
|
|
2284
|
-
quote:
|
|
2284
|
+
quote: w(
|
|
2285
2285
|
"m228-240 92-160q-66 0-113-47t-47-113q0-66 47-113t113-47q66 0 113 47t47 113q0 23-5.5 42.5T458-480L320-240h-92Zm360 0 92-160q-66 0-113-47t-47-113q0-66 47-113t113-47q66 0 113 47t47 113q0 23-5.5 42.5T818-480L680-240h-92ZM362.5-517.5Q380-535 380-560t-17.5-42.5Q345-620 320-620t-42.5 17.5Q260-585 260-560t17.5 42.5Q295-500 320-500t42.5-17.5Zm360 0Q740-535 740-560t-17.5-42.5Q705-620 680-620t-42.5 17.5Q620-585 620-560t17.5 42.5Q655-500 680-500t42.5-17.5ZM680-560Zm-360 0Z"
|
|
2286
2286
|
),
|
|
2287
|
-
link:
|
|
2287
|
+
link: w(
|
|
2288
2288
|
"M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"
|
|
2289
2289
|
),
|
|
2290
|
-
lineheight:
|
|
2290
|
+
lineheight: w(
|
|
2291
2291
|
"M240-160 80-320l56-56 64 62v-332l-64 62-56-56 160-160 160 160-56 56-64-62v332l64-62 56 56-160 160Zm240-40v-80h400v80H480Zm0-240v-80h400v80H480Zm0-240v-80h400v80H480Z"
|
|
2292
2292
|
),
|
|
2293
|
-
wordspacing:
|
|
2293
|
+
wordspacing: w(
|
|
2294
2294
|
"M320-80 160-240l160-160 57 56-64 64h334l-63-64 56-56 160 160L640-80l-57-56 64-64H313l63 64-56 56ZM200-480v-400h80v400h-80Zm240 0v-400h80v400h-80Zm240 0v-400h80v400h-80Z"
|
|
2295
2295
|
),
|
|
2296
|
-
caseic:
|
|
2296
|
+
caseic: w(
|
|
2297
2297
|
"m131-252 165-440h79l165 440h-76l-39-112H247l-40 112h-76Zm139-176h131l-64-182h-4l-63 182Zm395 186q-51 0-81-27.5T554-342q0-44 34.5-72.5T677-443q23 0 45 4t38 11v-12q0-29-20.5-47T685-505q-23 0-42 9.5T610-468l-47-35q24-29 54.5-43t68.5-14q69 0 103 32.5t34 97.5v178h-63v-37h-4q-14 23-38 35t-53 12Zm12-54q35 0 59.5-24t24.5-56q-14-8-33.5-12.5T689-393q-32 0-50 14t-18 37q0 20 16 33t40 13Z"
|
|
2298
2298
|
),
|
|
2299
|
-
uppercaseic:
|
|
2299
|
+
uppercaseic: w(
|
|
2300
2300
|
"M660-240v-248l-64 64-56-56 160-160 160 160-56 56-64-64v248h-80Zm-540 0 165-440h79l165 440h-76l-39-113H236l-40 113h-76Zm139-177h131l-65-182h-4l-62 182Z"
|
|
2301
2301
|
),
|
|
2302
|
-
lowercaseic:
|
|
2302
|
+
lowercaseic: w(
|
|
2303
2303
|
"M300-240q-51 0-81-27.5T189-340q0-44 34.5-72.5T312-441q23 0 45 4t38 11v-12q0-29-20.5-47T320-503q-23 0-42 9.5T245-466l-47-35q24-29 54.5-43t68.5-14q69 0 103 32.5t34 97.5v178h-63v-37h-4q-14 23-38 35t-53 12Zm12-54q35 0 59.5-24t24.5-56q-14-8-33.5-12.5T324-391q-32 0-50 14t-18 37q0 20 16 33t40 13Zm388 54L540-400l56-56 64 64v-248h80v248l64-64 56 56-160 160Z"
|
|
2304
2304
|
),
|
|
2305
|
-
capitalizeic:
|
|
2305
|
+
capitalizeic: w(
|
|
2306
2306
|
"M344-250v-366H224v-64h308v64H412v366h-68Zm344 10q-44 0-69-25.5T594-336v-162h-54v-58h54v-87h66v87h74v58h-74v148q0 23 10.5 36t28.5 13q9 0 18.5-3.5T736-314v65q-10 5-22 7t-26 2Z"
|
|
2307
2307
|
),
|
|
2308
|
-
fontsizeup:
|
|
2308
|
+
fontsizeup: w(
|
|
2309
2309
|
"m40-200 210-560h100l210 560h-96l-51-143H187l-51 143H40Zm176-224h168l-82-232h-4l-82 232Zm504 104v-120H600v-80h120v-120h80v120h120v80H800v120h-80Z"
|
|
2310
2310
|
),
|
|
2311
|
-
fontsizedown:
|
|
2311
|
+
fontsizedown: w(
|
|
2312
2312
|
"m40-200 210-560h100l210 560h-96l-51-143H187l-51 143H40Zm176-224h168l-82-232h-4l-82 232Zm384-16v-80h320v80H600Z"
|
|
2313
2313
|
),
|
|
2314
|
-
historyic:
|
|
2314
|
+
historyic: w(
|
|
2315
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"
|
|
2316
2316
|
),
|
|
2317
2317
|
wordic: L(
|
|
2318
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>'
|
|
2319
2319
|
),
|
|
2320
|
-
draftic:
|
|
2320
|
+
draftic: w(
|
|
2321
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"
|
|
2322
2322
|
),
|
|
2323
2323
|
trash: L(
|
|
@@ -2354,10 +2354,10 @@ const Ke = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
2354
2354
|
palette: L(
|
|
2355
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"/>'
|
|
2356
2356
|
),
|
|
2357
|
-
ul_circle:
|
|
2357
|
+
ul_circle: w(
|
|
2358
2358
|
"M280-600v-80h560v80H280Zm0 160v-80h560v80H280Zm0 160v-80h560v80H280ZM160-600q-17 0-28.5-11.5T120-640q0-17 11.5-28.5T160-680q17 0 28.5 11.5T200-640q0 17-11.5 28.5T160-600Zm0 160q-17 0-28.5-11.5T120-480q0-17 11.5-28.5T160-520q17 0 28.5 11.5T200-480q0 17-11.5 28.5T160-440Zm0 160q-17 0-28.5-11.5T120-320q0-17 11.5-28.5T160-360q17 0 28.5 11.5T200-320q0 17-11.5 28.5T160-280Z"
|
|
2359
2359
|
),
|
|
2360
|
-
ul_square:
|
|
2360
|
+
ul_square: w(
|
|
2361
2361
|
"M80-160v-160h160v160H80Zm240 0v-160h560v160H320ZM80-400v-160h160v160H80Zm240 0v-160h560v160H320ZM80-640v-160h160v160H80Zm240 0v-160h560v160H320Z"
|
|
2362
2362
|
),
|
|
2363
2363
|
ol_alpha: ot(["a", "b", "c"]),
|
|
@@ -2380,7 +2380,7 @@ const Ke = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
2380
2380
|
codesampleic: L(
|
|
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
|
+
}, di = /* @__PURE__ */ new Set([
|
|
2384
2384
|
"p",
|
|
2385
2385
|
"div",
|
|
2386
2386
|
"span",
|
|
@@ -2422,7 +2422,7 @@ const Ke = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
2422
2422
|
"figure",
|
|
2423
2423
|
"figcaption",
|
|
2424
2424
|
"mark"
|
|
2425
|
-
]),
|
|
2425
|
+
]), ui = /* @__PURE__ */ new Set([
|
|
2426
2426
|
"text-align",
|
|
2427
2427
|
"direction",
|
|
2428
2428
|
"unicode-bidi",
|
|
@@ -2478,7 +2478,7 @@ const Ke = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
2478
2478
|
"box-sizing",
|
|
2479
2479
|
"list-style-type",
|
|
2480
2480
|
"white-space"
|
|
2481
|
-
]),
|
|
2481
|
+
]), le = {
|
|
2482
2482
|
"*": ["dir", "lang", "colspan", "rowspan"],
|
|
2483
2483
|
a: ["href", "target", "rel", "title"],
|
|
2484
2484
|
img: ["src", "alt", "width", "height", "title"],
|
|
@@ -2487,26 +2487,26 @@ const Ke = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
2487
2487
|
th: ["width", "valign"],
|
|
2488
2488
|
table: ["width", "cellpadding", "cellspacing"]
|
|
2489
2489
|
};
|
|
2490
|
-
function
|
|
2491
|
-
const t = {}, e =
|
|
2490
|
+
function pt(d) {
|
|
2491
|
+
const t = {}, e = d.getAttribute && d.getAttribute("style");
|
|
2492
2492
|
return e && e.split(";").forEach((i) => {
|
|
2493
2493
|
const s = i.indexOf(":");
|
|
2494
2494
|
s < 1 || (t[i.slice(0, s).trim().toLowerCase()] = i.slice(s + 1).trim());
|
|
2495
2495
|
}), t;
|
|
2496
2496
|
}
|
|
2497
|
-
function
|
|
2498
|
-
return
|
|
2497
|
+
function pi(d) {
|
|
2498
|
+
return d.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
|
|
2501
|
-
return /^[0-9]+[\.\)،]/.test(
|
|
2500
|
+
function mi(d) {
|
|
2501
|
+
return /^[0-9]+[\.\)،]/.test(d) ? { ordered: !0 } : /^[٠-٩۰-۹]+/.test(d) ? { ordered: !0, style: "arabic-indic" } : /^[ivxlc]{2,}[\.\)]/.test(d) ? { ordered: !0, style: "lower-roman" } : /^[IVXLC]{2,}[\.\)]/.test(d) ? { ordered: !0, style: "upper-roman" } : /^[a-z][\.\)]/.test(d) ? { ordered: !0, style: "lower-alpha" } : /^[A-Z][\.\)]/.test(d) ? { ordered: !0, style: "upper-alpha" } : /^[ء-ي][\.\)،-]/.test(d) ? { ordered: !0, style: "arabic-indic" } : { ordered: !1 };
|
|
2502
2502
|
}
|
|
2503
|
-
function
|
|
2503
|
+
function fi(d) {
|
|
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);
|
|
2507
2507
|
}, e = [];
|
|
2508
2508
|
let i = null;
|
|
2509
|
-
Array.from(
|
|
2509
|
+
Array.from(d.body.querySelectorAll("p")).forEach((s) => {
|
|
2510
2510
|
if (!t(s)) {
|
|
2511
2511
|
i = null;
|
|
2512
2512
|
return;
|
|
@@ -2514,68 +2514,68 @@ function ui(u) {
|
|
|
2514
2514
|
const n = s.previousElementSibling;
|
|
2515
2515
|
i && n && i[i.length - 1] === n ? i.push(s) : (i = [s], e.push(i));
|
|
2516
2516
|
}), e.forEach((s) => {
|
|
2517
|
-
const n = [],
|
|
2518
|
-
s.forEach((
|
|
2519
|
-
var
|
|
2520
|
-
const a = +(((
|
|
2517
|
+
const n = [], l = s[0];
|
|
2518
|
+
s.forEach((r) => {
|
|
2519
|
+
var C, E, I;
|
|
2520
|
+
const a = +(((C = (r.getAttribute("style") || "").match(/level(\d+)/i)) == null ? void 0 : C[1]) || 1), u = Array.from(r.querySelectorAll("span")).find(
|
|
2521
2521
|
(A) => /mso-list\s*:\s*ignore/i.test(A.getAttribute("style") || "")
|
|
2522
|
-
), p =
|
|
2523
|
-
for (
|
|
2522
|
+
), p = u ? ((E = u.textContent) == null ? void 0 : E.trim()) || "" : (((I = r.textContent) == null ? void 0 : I.trim().match(/^\S{1,4}/)) || [""])[0], { ordered: m, style: v } = mi(p);
|
|
2523
|
+
for (u && u.remove(); n.length && n[n.length - 1].level > a; ) n.pop();
|
|
2524
2524
|
if (!n.length || n[n.length - 1].level < a) {
|
|
2525
|
-
const A =
|
|
2526
|
-
if (m &&
|
|
2525
|
+
const A = d.createElement(m ? "ol" : "ul");
|
|
2526
|
+
if (m && v && (A.style.listStyleType = v), n.length) {
|
|
2527
2527
|
const $ = n[n.length - 1].list;
|
|
2528
2528
|
($.lastElementChild || $).appendChild(A);
|
|
2529
2529
|
} else
|
|
2530
|
-
|
|
2530
|
+
l.parentNode.insertBefore(A, l);
|
|
2531
2531
|
n.push({ list: A, level: a });
|
|
2532
2532
|
}
|
|
2533
|
-
const
|
|
2534
|
-
for (
|
|
2535
|
-
n[n.length - 1].list.appendChild(
|
|
2533
|
+
const b = d.createElement("li"), f = pt(r), y = ["text-align", "direction", "unicode-bidi", "color", "font-size", "font-family", "background-color"].filter((A) => f[A]).map((A) => A + ":" + f[A]).join(";");
|
|
2534
|
+
for (y && b.setAttribute("style", y), r.getAttribute("dir") && b.setAttribute("dir", r.getAttribute("dir")); r.firstChild; ) b.appendChild(r.firstChild);
|
|
2535
|
+
n[n.length - 1].list.appendChild(b), r.remove();
|
|
2536
2536
|
});
|
|
2537
2537
|
});
|
|
2538
2538
|
}
|
|
2539
|
-
function
|
|
2540
|
-
|
|
2539
|
+
function gi(d) {
|
|
2540
|
+
d.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
|
|
2546
|
-
|
|
2545
|
+
function vi(d) {
|
|
2546
|
+
d.querySelectorAll("table").forEach((t) => {
|
|
2547
2547
|
const e = t;
|
|
2548
|
-
|
|
2549
|
-
}),
|
|
2548
|
+
pt(e)["border-collapse"] || (e.style.borderCollapse = "collapse");
|
|
2549
|
+
}), d.querySelectorAll("[align]").forEach((t) => {
|
|
2550
2550
|
const e = t, i = e.getAttribute("align").toLowerCase();
|
|
2551
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) => {
|
|
2552
2552
|
if (s.tagName.toLowerCase() !== "table") return;
|
|
2553
2553
|
const n = s;
|
|
2554
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");
|
|
2555
2555
|
})), e.removeAttribute("align");
|
|
2556
|
-
}),
|
|
2556
|
+
}), d.querySelectorAll("center table").forEach((t) => {
|
|
2557
2557
|
const e = t;
|
|
2558
2558
|
e.style.marginLeft = e.style.marginLeft || "auto", e.style.marginRight = e.style.marginRight || "auto";
|
|
2559
|
-
}),
|
|
2559
|
+
}), d.querySelectorAll("[bgcolor]").forEach((t) => {
|
|
2560
2560
|
const e = t;
|
|
2561
2561
|
e.style.backgroundColor = e.style.backgroundColor || e.getAttribute("bgcolor"), e.removeAttribute("bgcolor");
|
|
2562
2562
|
});
|
|
2563
2563
|
}
|
|
2564
|
-
function
|
|
2565
|
-
Array.from(
|
|
2564
|
+
function dt(d, t) {
|
|
2565
|
+
Array.from(d.childNodes).forEach((e) => {
|
|
2566
2566
|
if (e.nodeType === Node.COMMENT_NODE) {
|
|
2567
2567
|
e.remove();
|
|
2568
2568
|
return;
|
|
2569
2569
|
}
|
|
2570
2570
|
if (e.nodeType !== Node.ELEMENT_NODE) return;
|
|
2571
2571
|
const i = e, s = i.tagName.toLowerCase();
|
|
2572
|
-
if (!
|
|
2572
|
+
if (!di.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"));
|
|
2576
2576
|
const a = i.getAttribute("size");
|
|
2577
2577
|
if (a && !o.style.fontSize) {
|
|
2578
|
-
const
|
|
2578
|
+
const u = {
|
|
2579
2579
|
1: "8pt",
|
|
2580
2580
|
2: "10pt",
|
|
2581
2581
|
3: "12pt",
|
|
@@ -2584,17 +2584,17 @@ function ht(u, t) {
|
|
|
2584
2584
|
6: "24pt",
|
|
2585
2585
|
7: "36pt"
|
|
2586
2586
|
};
|
|
2587
|
-
|
|
2587
|
+
u[a] && (o.style.fontSize = u[a]);
|
|
2588
2588
|
}
|
|
2589
2589
|
for (; i.firstChild; ) o.appendChild(i.firstChild);
|
|
2590
|
-
i.replaceWith(o),
|
|
2590
|
+
i.replaceWith(o), dt(o, t);
|
|
2591
2591
|
return;
|
|
2592
2592
|
}
|
|
2593
|
-
for (
|
|
2593
|
+
for (dt(i, t); i.firstChild; ) i.parentNode.insertBefore(i.firstChild, i);
|
|
2594
2594
|
i.remove();
|
|
2595
2595
|
return;
|
|
2596
2596
|
}
|
|
2597
|
-
const n = /* @__PURE__ */ new Set([...
|
|
2597
|
+
const n = /* @__PURE__ */ new Set([...le["*"] || [], ...le[s] || []]);
|
|
2598
2598
|
if (Array.from(i.attributes).forEach((o) => {
|
|
2599
2599
|
const a = o.name.toLowerCase();
|
|
2600
2600
|
a !== "style" && !n.has(a) && i.removeAttribute(o.name);
|
|
@@ -2610,228 +2610,259 @@ function ht(u, t) {
|
|
|
2610
2610
|
return;
|
|
2611
2611
|
}
|
|
2612
2612
|
}
|
|
2613
|
-
const
|
|
2614
|
-
for (const [o, a] of Object.entries(
|
|
2615
|
-
|
|
2616
|
-
if (
|
|
2613
|
+
const l = pt(i), r = [];
|
|
2614
|
+
for (const [o, a] of Object.entries(l))
|
|
2615
|
+
ui.has(o) && (/expression|javascript|url\s*\(\s*['"]?\s*file:/i.test(a) || o === "font-weight" && /^(400|normal)$/i.test(a) || o === "font-style" && /^normal$/i.test(a) || o === "text-decoration" && /^none$/i.test(a) || r.push(o + ":" + a));
|
|
2616
|
+
if (r.length ? i.setAttribute("style", r.join(";")) : i.removeAttribute("style"), i.removeAttribute("class"), dt(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 bi(d) {
|
|
2623
2623
|
const t = [], e = /<style[^>]*>([\s\S]*?)<\/style>/gi;
|
|
2624
2624
|
let i;
|
|
2625
|
-
for (; i = e.exec(
|
|
2625
|
+
for (; i = e.exec(d); ) {
|
|
2626
2626
|
let s = i[1].replace(/<!--|-->/g, "").replace(/\/\*[\s\S]*?\*\//g, "");
|
|
2627
2627
|
s = s.replace(/@media[^{]*\{(?:[^{}]*\{[^{}]*\})*[^{}]*\}/gi, ""), s = s.replace(/@[\w-]+[^{]*\{[^{}]*\}/g, "");
|
|
2628
2628
|
let n;
|
|
2629
|
-
const
|
|
2630
|
-
for (; n =
|
|
2631
|
-
const
|
|
2629
|
+
const l = /([^{}]+)\{([^}]*)\}/g;
|
|
2630
|
+
for (; n = l.exec(s); ) {
|
|
2631
|
+
const r = n[2].split(";").map((o) => {
|
|
2632
2632
|
const a = o.indexOf(":");
|
|
2633
2633
|
return a < 1 ? null : [o.slice(0, a).trim().toLowerCase(), o.slice(a + 1).trim()];
|
|
2634
2634
|
}).filter((o) => !!o && !!o[1]);
|
|
2635
|
-
|
|
2635
|
+
r.length && n[1].split(",").map((o) => o.trim()).filter((o) => o && !o.startsWith("@")).forEach((o) => t.push({ sel: o, decls: r }));
|
|
2636
2636
|
}
|
|
2637
2637
|
}
|
|
2638
2638
|
return t;
|
|
2639
2639
|
}
|
|
2640
|
-
function
|
|
2640
|
+
function yi(d, t) {
|
|
2641
2641
|
if (!t.length) return;
|
|
2642
2642
|
const e = /* @__PURE__ */ new Map();
|
|
2643
2643
|
t.forEach(({ sel: i, decls: s }) => {
|
|
2644
2644
|
let n;
|
|
2645
2645
|
try {
|
|
2646
|
-
n =
|
|
2646
|
+
n = d.querySelectorAll(i);
|
|
2647
2647
|
} catch {
|
|
2648
2648
|
return;
|
|
2649
2649
|
}
|
|
2650
|
-
n.forEach((
|
|
2651
|
-
let
|
|
2652
|
-
|
|
2653
|
-
|
|
2650
|
+
n.forEach((l) => {
|
|
2651
|
+
let r = e.get(l);
|
|
2652
|
+
r || (r = {}, e.set(l, r)), s.forEach(([o, a]) => {
|
|
2653
|
+
r[o] = a;
|
|
2654
2654
|
});
|
|
2655
2655
|
});
|
|
2656
2656
|
}), e.forEach((i, s) => {
|
|
2657
|
-
const n =
|
|
2657
|
+
const n = pt(s), l = s.hasAttribute("dir"), r = s.hasAttribute("align"), o = Object.entries(i).filter(([p]) => !(p in n || (p === "direction" || p === "unicode-bidi") && l || p === "text-align" && (r || l) || (p === "background" || p === "background-color") && s.hasAttribute("bgcolor")));
|
|
2658
2658
|
if (!o.length) return;
|
|
2659
|
-
const a = o.map(([p, m]) => p + ":" + m).join(";"),
|
|
2660
|
-
s.setAttribute("style",
|
|
2659
|
+
const a = o.map(([p, m]) => p + ":" + m).join(";"), u = s.getAttribute("style");
|
|
2660
|
+
s.setAttribute("style", u ? a + ";" + u : a);
|
|
2661
2661
|
});
|
|
2662
2662
|
}
|
|
2663
|
-
function
|
|
2664
|
-
return
|
|
2663
|
+
function fe(d) {
|
|
2664
|
+
return d.replace(/[ﭐ-﷿ﹰ-ﻼ]+/g, (t) => t.normalize("NFKC"));
|
|
2665
2665
|
}
|
|
2666
|
-
function
|
|
2667
|
-
const t =
|
|
2666
|
+
function xi(d) {
|
|
2667
|
+
const t = d.createTreeWalker(d.body, NodeFilter.SHOW_TEXT, null);
|
|
2668
2668
|
let e;
|
|
2669
2669
|
for (; e = t.nextNode(); )
|
|
2670
|
-
/[ﭐ-﷿ﹰ-ﻼ]/.test(e.nodeValue || "") && (e.nodeValue =
|
|
2670
|
+
/[ﭐ-﷿ﹰ-ﻼ]/.test(e.nodeValue || "") && (e.nodeValue = fe(e.nodeValue || ""));
|
|
2671
2671
|
}
|
|
2672
|
-
function
|
|
2673
|
-
const e =
|
|
2674
|
-
|
|
2672
|
+
function Ci(d, t = "ltr") {
|
|
2673
|
+
const e = bi(d), i = new DOMParser().parseFromString(pi(d), "text/html");
|
|
2674
|
+
yi(i, e), /class="?Mso|mso-|urn:schemas-microsoft-com/i.test(i.body.innerHTML) && fi(i), gi(i), vi(i), dt(i.body, i), xi(i);
|
|
2675
2675
|
const s = (n) => {
|
|
2676
|
-
var
|
|
2677
|
-
return n && n.tagName === "P" && !((
|
|
2676
|
+
var l;
|
|
2677
|
+
return n && n.tagName === "P" && !((l = n.textContent) != null && l.trim()) && !n.querySelector("img,table");
|
|
2678
2678
|
};
|
|
2679
2679
|
for (; s(i.body.firstElementChild); ) i.body.firstElementChild.remove();
|
|
2680
2680
|
for (; s(i.body.lastElementChild); ) i.body.lastElementChild.remove();
|
|
2681
2681
|
return i.body.innerHTML.trim();
|
|
2682
2682
|
}
|
|
2683
|
-
function
|
|
2684
|
-
const t =
|
|
2683
|
+
function wi(d) {
|
|
2684
|
+
const t = fe(d).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
|
-
const
|
|
2688
|
-
function
|
|
2687
|
+
const Ti = 10 * 1024 * 1024, ge = /^(https?:|data:image\/|blob:)/i;
|
|
2688
|
+
function oe(d, t) {
|
|
2689
2689
|
const e = [], i = "{\\" + t;
|
|
2690
2690
|
let s = 0;
|
|
2691
|
-
for (; (s =
|
|
2692
|
-
const n =
|
|
2691
|
+
for (; (s = d.indexOf(i, s)) !== -1; ) {
|
|
2692
|
+
const n = d[s + i.length];
|
|
2693
2693
|
if (n && /[a-z0-9]/i.test(n)) {
|
|
2694
2694
|
s += i.length;
|
|
2695
2695
|
continue;
|
|
2696
2696
|
}
|
|
2697
|
-
let
|
|
2698
|
-
for (;
|
|
2699
|
-
const o =
|
|
2697
|
+
let l = 0, r = s;
|
|
2698
|
+
for (; r < d.length; r++) {
|
|
2699
|
+
const o = d[r];
|
|
2700
2700
|
if (o === "\\") {
|
|
2701
|
-
|
|
2701
|
+
r++;
|
|
2702
2702
|
continue;
|
|
2703
2703
|
}
|
|
2704
|
-
if (o === "{")
|
|
2705
|
-
else if (o === "}" && (
|
|
2704
|
+
if (o === "{") l++;
|
|
2705
|
+
else if (o === "}" && (l--, !l))
|
|
2706
2706
|
break;
|
|
2707
2707
|
}
|
|
2708
|
-
e.push({ start: s, end:
|
|
2708
|
+
e.push({ start: s, end: r + 1, body: d.slice(s + i.length, r) }), s = r + 1;
|
|
2709
2709
|
}
|
|
2710
2710
|
return e;
|
|
2711
2711
|
}
|
|
2712
|
-
function
|
|
2713
|
-
const t = new Uint8Array(
|
|
2714
|
-
for (let e = 0; e < t.length; e++) t[e] = parseInt(
|
|
2712
|
+
function Ei(d) {
|
|
2713
|
+
const t = new Uint8Array(d.length / 2);
|
|
2714
|
+
for (let e = 0; e < t.length; e++) t[e] = parseInt(d.substr(e * 2, 2), 16);
|
|
2715
2715
|
return t;
|
|
2716
2716
|
}
|
|
2717
|
-
function
|
|
2717
|
+
function Tt(d) {
|
|
2718
2718
|
let t = "";
|
|
2719
|
-
for (let e = 0; e <
|
|
2719
|
+
for (let e = 0; e < d.length; e++) t += String.fromCharCode(d[e]);
|
|
2720
2720
|
return btoa(t);
|
|
2721
2721
|
}
|
|
2722
|
-
function
|
|
2723
|
-
t: for (let e = 0; e + t.length <=
|
|
2724
|
-
for (let i = 0; i < t.length; i++) if (
|
|
2722
|
+
function ae(d, t) {
|
|
2723
|
+
t: for (let e = 0; e + t.length <= d.length; e++) {
|
|
2724
|
+
for (let i = 0; i < t.length; i++) if (d[e + i] !== t[i]) continue t;
|
|
2725
2725
|
return e;
|
|
2726
2726
|
}
|
|
2727
2727
|
return -1;
|
|
2728
2728
|
}
|
|
2729
|
-
const
|
|
2730
|
-
function
|
|
2729
|
+
const Si = [137, 80, 78, 71], Mi = [255, 216, 255];
|
|
2730
|
+
function Li(d) {
|
|
2731
2731
|
let t = null;
|
|
2732
|
-
if (/\\pngblip/.test(
|
|
2733
|
-
let e =
|
|
2732
|
+
if (/\\pngblip/.test(d) ? t = "image/png" : /\\jpegblip/.test(d) ? t = "image/jpeg" : (/\\wmetafile\d*/.test(d) || /\\emfblip/.test(d)) && (t = "metafile"), !t) return null;
|
|
2733
|
+
let e = d.replace(/\{[^{}]*\}/g, " ").replace(/\\[a-z]+-?\d*\s?/gi, " ").replace(/[^0-9a-fA-F]/g, "");
|
|
2734
2734
|
if (e.length % 2 && (e = e.slice(0, -1)), !e) return null;
|
|
2735
|
-
const i =
|
|
2735
|
+
const i = Ei(e);
|
|
2736
2736
|
if (t === "metafile") {
|
|
2737
|
-
const s =
|
|
2738
|
-
if (s >= 0) return "data:image/png;base64," +
|
|
2739
|
-
const n =
|
|
2740
|
-
return n >= 0 ? "data:image/jpeg;base64," +
|
|
2737
|
+
const s = ae(i, Si);
|
|
2738
|
+
if (s >= 0) return "data:image/png;base64," + Tt(i.slice(s));
|
|
2739
|
+
const n = ae(i, Mi);
|
|
2740
|
+
return n >= 0 ? "data:image/jpeg;base64," + Tt(i.slice(n)) : null;
|
|
2741
2741
|
}
|
|
2742
|
-
return "data:" + t + ";base64," +
|
|
2742
|
+
return "data:" + t + ";base64," + Tt(i);
|
|
2743
2743
|
}
|
|
2744
|
-
function
|
|
2745
|
-
if (!
|
|
2746
|
-
let t =
|
|
2747
|
-
|
|
2744
|
+
function ki(d) {
|
|
2745
|
+
if (!d || d.indexOf("\\pict") === -1) return [];
|
|
2746
|
+
let t = d;
|
|
2747
|
+
oe(d, "nonshppict").reverse().forEach((i) => {
|
|
2748
2748
|
t = t.slice(0, i.start) + t.slice(i.end);
|
|
2749
2749
|
});
|
|
2750
|
-
let e =
|
|
2751
|
-
return
|
|
2750
|
+
let e = Ti;
|
|
2751
|
+
return oe(t, "pict").map((i) => {
|
|
2752
2752
|
if (e <= 0) return null;
|
|
2753
|
-
const s =
|
|
2753
|
+
const s = Li(i.body);
|
|
2754
2754
|
return s && (e -= s.length * 0.75), s;
|
|
2755
2755
|
});
|
|
2756
2756
|
}
|
|
2757
|
-
function
|
|
2758
|
-
|
|
2757
|
+
function ce(d) {
|
|
2758
|
+
const t = d.match(/^\s*(-?[\d.]+)\s*(pt|px|in|cm|mm)?\s*$/i);
|
|
2759
|
+
if (!t) return null;
|
|
2760
|
+
const e = parseFloat(t[1]);
|
|
2761
|
+
if (!isFinite(e) || e <= 0) return null;
|
|
2762
|
+
const i = (t[2] || "px").toLowerCase(), s = i === "pt" ? e * 4 / 3 : i === "in" ? e * 96 : i === "cm" ? e * 96 / 2.54 : i === "mm" ? e * 96 / 25.4 : e;
|
|
2763
|
+
return Math.round(s);
|
|
2764
|
+
}
|
|
2765
|
+
function Ai(d, t) {
|
|
2766
|
+
const e = d.match(new RegExp("\\s" + t + `\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s>]+))`, "i"));
|
|
2767
|
+
return e ? e[1] ?? e[2] ?? e[3] ?? "" : "";
|
|
2768
|
+
}
|
|
2769
|
+
function Hi(d) {
|
|
2770
|
+
if (!/<v:imagedata\b/i.test(d)) return d;
|
|
2771
|
+
const t = (i, s) => {
|
|
2772
|
+
const n = Ai(i, "src");
|
|
2773
|
+
if (!n) return null;
|
|
2774
|
+
const l = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2775
|
+
if (new RegExp(`<img\\b[^>]*\\bsrc\\s*=\\s*["']?` + l, "i").test(d)) return null;
|
|
2776
|
+
const r = (s.match(/<v:shape\b[^>]*\sstyle\s*=\s*(?:"([^"]*)"|'([^']*)')/i) || []).slice(1).find(Boolean) || "", o = ce((r.match(/(?:^|;)\s*width\s*:\s*([^;]+)/i) || [])[1] || ""), a = ce((r.match(/(?:^|;)\s*height\s*:\s*([^;]+)/i) || [])[1] || "");
|
|
2777
|
+
return '<img src="' + n.replace(/"/g, """) + '"' + (o ? ' width="' + o + '"' : "") + (a ? ' height="' + a + '"' : "") + ">";
|
|
2778
|
+
};
|
|
2779
|
+
let e = d.replace(/<!--\[if [^\]]*\]>([\s\S]*?)<!\[endif\]-->/gi, (i, s) => {
|
|
2780
|
+
const n = s.match(/<v:imagedata\b[^>]*>/i);
|
|
2781
|
+
return n && t(n[0], s) || i;
|
|
2782
|
+
});
|
|
2783
|
+
return e = e.replace(/<v:shape\b[^>]*>[\s\S]*?<\/v:shape\s*>/gi, (i) => {
|
|
2784
|
+
const s = i.match(/<v:imagedata\b[^>]*>/i);
|
|
2785
|
+
return s && t(s[0], i) || i;
|
|
2786
|
+
}), e.replace(/<v:imagedata\b[^>]*>/gi, (i) => t(i, "") || i);
|
|
2787
|
+
}
|
|
2788
|
+
function ve(d, t) {
|
|
2789
|
+
if (!d || !t.length) return { html: d, injected: [] };
|
|
2759
2790
|
const e = [];
|
|
2760
2791
|
let i = 0;
|
|
2761
|
-
return { html:
|
|
2762
|
-
const
|
|
2763
|
-
if (
|
|
2764
|
-
const
|
|
2765
|
-
return
|
|
2792
|
+
return { html: Hi(d).replace(/<img\b[^>]*>/gi, (n) => {
|
|
2793
|
+
const l = (n.match(/\ssrc\s*=\s*["']?([^"'\s>]+)/i) || [])[1] || "";
|
|
2794
|
+
if (ge.test(l)) return n;
|
|
2795
|
+
const r = t[i++];
|
|
2796
|
+
return r ? (e.push(r), /\ssrc\s*=\s*["']/i.test(n) ? n.replace(/(\ssrc\s*=\s*)(["'])[^"']*\2/i, '$1"' + r + '"') : n.replace(/(\ssrc\s*=\s*)[^\s>]+/i, '$1"' + r + '"')) : n;
|
|
2766
2797
|
}), injected: e };
|
|
2767
2798
|
}
|
|
2768
|
-
function
|
|
2769
|
-
return !
|
|
2799
|
+
function Ii(d, t) {
|
|
2800
|
+
return !d || !t ? { html: d, injected: [] } : ve(d, ki(t));
|
|
2770
2801
|
}
|
|
2771
|
-
function
|
|
2772
|
-
const t =
|
|
2802
|
+
function qi(d) {
|
|
2803
|
+
const t = d.match(/<img\b[^>]*>/gi);
|
|
2773
2804
|
return t ? t.filter((e) => {
|
|
2774
2805
|
const i = (e.match(/\ssrc\s*=\s*["']?([^"'\s>]+)/i) || [])[1] || "";
|
|
2775
|
-
return !
|
|
2806
|
+
return !ge.test(i);
|
|
2776
2807
|
}).length : 0;
|
|
2777
2808
|
}
|
|
2778
|
-
function
|
|
2779
|
-
const e =
|
|
2809
|
+
function Ri(d, t) {
|
|
2810
|
+
const e = d.match(/^data:([^;,]+);base64,(.*)$/);
|
|
2780
2811
|
if (!e) return null;
|
|
2781
2812
|
const i = (e[1].split("/")[1] || "png").replace(/[^a-z0-9]/gi, "") || "png";
|
|
2782
2813
|
try {
|
|
2783
2814
|
const s = atob(e[2]), n = new Uint8Array(s.length);
|
|
2784
|
-
for (let
|
|
2815
|
+
for (let l = 0; l < s.length; l++) n[l] = s.charCodeAt(l);
|
|
2785
2816
|
return new File([n], t + "." + (i === "jpeg" ? "jpg" : i), { type: e[1] });
|
|
2786
2817
|
} catch {
|
|
2787
2818
|
return null;
|
|
2788
2819
|
}
|
|
2789
2820
|
}
|
|
2790
|
-
function
|
|
2791
|
-
const t = new DataView(
|
|
2821
|
+
function Pi(d) {
|
|
2822
|
+
const t = new DataView(d), e = /* @__PURE__ */ new Map();
|
|
2792
2823
|
let i = -1;
|
|
2793
|
-
for (let
|
|
2794
|
-
if (t.getUint32(
|
|
2795
|
-
i =
|
|
2824
|
+
for (let r = d.byteLength - 22; r >= Math.max(0, d.byteLength - 22 - 65535); r--)
|
|
2825
|
+
if (t.getUint32(r, !0) === 101010256) {
|
|
2826
|
+
i = r;
|
|
2796
2827
|
break;
|
|
2797
2828
|
}
|
|
2798
2829
|
if (i < 0) throw new Error("EOCD not found");
|
|
2799
2830
|
const s = t.getUint16(i + 10, !0);
|
|
2800
2831
|
let n = t.getUint32(i + 16, !0);
|
|
2801
|
-
const
|
|
2802
|
-
for (let
|
|
2803
|
-
const o = t.getUint16(n + 10, !0), a = t.getUint32(n + 20, !0),
|
|
2804
|
-
e.set(
|
|
2832
|
+
const l = new TextDecoder();
|
|
2833
|
+
for (let r = 0; r < s && t.getUint32(n, !0) === 33639248; r++) {
|
|
2834
|
+
const o = t.getUint16(n + 10, !0), a = t.getUint32(n + 20, !0), u = t.getUint16(n + 28, !0), p = t.getUint16(n + 30, !0), m = t.getUint16(n + 32, !0), v = t.getUint32(n + 42, !0), b = l.decode(new Uint8Array(d, n + 46, u));
|
|
2835
|
+
e.set(b, { name: b, method: o, compSize: a, localOffset: v }), n += 46 + u + p + m;
|
|
2805
2836
|
}
|
|
2806
2837
|
return e;
|
|
2807
2838
|
}
|
|
2808
|
-
async function
|
|
2809
|
-
const e = new DataView(
|
|
2839
|
+
async function he(d, t) {
|
|
2840
|
+
const e = new DataView(d, t.localOffset);
|
|
2810
2841
|
if (e.getUint32(0, !0) !== 67324752) throw new Error("Bad local header");
|
|
2811
|
-
const i = e.getUint16(26, !0), s = e.getUint16(28, !0), n = t.localOffset + 30 + i + s,
|
|
2812
|
-
if (t.method === 0) return
|
|
2842
|
+
const i = e.getUint16(26, !0), s = e.getUint16(28, !0), n = t.localOffset + 30 + i + s, l = new Uint8Array(d.slice(n, n + t.compSize));
|
|
2843
|
+
if (t.method === 0) return l;
|
|
2813
2844
|
if (t.method !== 8) throw new Error("Unsupported compression method " + t.method);
|
|
2814
|
-
const
|
|
2815
|
-
return new Uint8Array(await new Response(
|
|
2845
|
+
const r = new Blob([l]).stream().pipeThrough(new DecompressionStream("deflate-raw"));
|
|
2846
|
+
return new Uint8Array(await new Response(r).arrayBuffer());
|
|
2816
2847
|
}
|
|
2817
|
-
const
|
|
2818
|
-
let e =
|
|
2848
|
+
const de = (d) => d.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """), ut = (d, t) => Array.from(d.children).filter((e) => e.localName === t), B = (d, ...t) => {
|
|
2849
|
+
let e = d;
|
|
2819
2850
|
for (const i of t) {
|
|
2820
2851
|
if (!e) return null;
|
|
2821
2852
|
e = Array.from(e.children).find((s) => s.localName === i) || null;
|
|
2822
2853
|
}
|
|
2823
2854
|
return e;
|
|
2824
|
-
}, q = (
|
|
2825
|
-
if (!
|
|
2826
|
-
for (const e of Array.from(
|
|
2855
|
+
}, q = (d, t = "val") => {
|
|
2856
|
+
if (!d) return "";
|
|
2857
|
+
for (const e of Array.from(d.attributes))
|
|
2827
2858
|
if (e.localName === t) return e.value;
|
|
2828
2859
|
return "";
|
|
2829
|
-
}, at = (
|
|
2830
|
-
const e =
|
|
2860
|
+
}, at = (d, t) => {
|
|
2861
|
+
const e = d ? B(d, t) : null;
|
|
2831
2862
|
if (!e) return !1;
|
|
2832
2863
|
const i = q(e);
|
|
2833
2864
|
return i !== "false" && i !== "0";
|
|
2834
|
-
},
|
|
2865
|
+
}, ue = {
|
|
2835
2866
|
yellow: "#FFFF00",
|
|
2836
2867
|
green: "#00FF00",
|
|
2837
2868
|
cyan: "#00FFFF",
|
|
@@ -2848,7 +2879,7 @@ const ce = (u) => u.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, "
|
|
|
2848
2879
|
lightGray: "#D3D3D3",
|
|
2849
2880
|
black: "#000000",
|
|
2850
2881
|
white: "#FFFFFF"
|
|
2851
|
-
},
|
|
2882
|
+
}, Bi = {
|
|
2852
2883
|
png: "image/png",
|
|
2853
2884
|
jpg: "image/jpeg",
|
|
2854
2885
|
jpeg: "image/jpeg",
|
|
@@ -2856,13 +2887,13 @@ const ce = (u) => u.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, "
|
|
|
2856
2887
|
bmp: "image/bmp",
|
|
2857
2888
|
webp: "image/webp"
|
|
2858
2889
|
};
|
|
2859
|
-
function
|
|
2890
|
+
function Di(d) {
|
|
2860
2891
|
let t = "";
|
|
2861
|
-
for (let e = 0; e <
|
|
2862
|
-
t += String.fromCharCode(...
|
|
2892
|
+
for (let e = 0; e < d.length; e += 32768)
|
|
2893
|
+
t += String.fromCharCode(...d.subarray(e, e + 32768));
|
|
2863
2894
|
return btoa(t);
|
|
2864
2895
|
}
|
|
2865
|
-
class
|
|
2896
|
+
class Ni {
|
|
2866
2897
|
constructor(t, e, i) {
|
|
2867
2898
|
this.rels = t, this.images = e, this.numFmt = i;
|
|
2868
2899
|
}
|
|
@@ -2873,12 +2904,12 @@ class qi {
|
|
|
2873
2904
|
};
|
|
2874
2905
|
for (const n of Array.from(t.children))
|
|
2875
2906
|
if (n.localName === "p") {
|
|
2876
|
-
const
|
|
2877
|
-
if (
|
|
2878
|
-
const
|
|
2879
|
-
for (; i.length >
|
|
2880
|
-
for (i.length ===
|
|
2881
|
-
e += `<${
|
|
2907
|
+
const l = this.paraList(n);
|
|
2908
|
+
if (l) {
|
|
2909
|
+
const r = l.ilvl + 1;
|
|
2910
|
+
for (; i.length > r; ) e += `</${i.pop()}>`;
|
|
2911
|
+
for (i.length === r && i[r - 1] !== l.type && (e += `</${i.pop()}>`); i.length < r; )
|
|
2912
|
+
e += `<${l.type}>`, i.push(l.type);
|
|
2882
2913
|
e += `<li>${this.runsOf(n) || "<br>"}</li>`;
|
|
2883
2914
|
continue;
|
|
2884
2915
|
}
|
|
@@ -2899,9 +2930,9 @@ class qi {
|
|
|
2899
2930
|
let s = "p";
|
|
2900
2931
|
const n = /^Heading([1-6])$/i.exec(i);
|
|
2901
2932
|
n ? s = "h" + n[1] : /^Title$/i.test(i) && (s = "h1");
|
|
2902
|
-
const
|
|
2903
|
-
|
|
2904
|
-
const o = this.runsOf(t), a =
|
|
2933
|
+
const l = [], r = q(B(t, "pPr", "jc"));
|
|
2934
|
+
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");
|
|
2935
|
+
const o = this.runsOf(t), a = l.length ? ` style="${l.join(";")}"` : "";
|
|
2905
2936
|
return `<${s}${a}>${o || "<br>"}</${s}>`;
|
|
2906
2937
|
}
|
|
2907
2938
|
runsOf(t) {
|
|
@@ -2912,8 +2943,8 @@ class qi {
|
|
|
2912
2943
|
let s = this.rels.get(q(i, "id")) || "";
|
|
2913
2944
|
const n = q(i, "anchor");
|
|
2914
2945
|
!s && n && (s = "#" + n);
|
|
2915
|
-
const
|
|
2916
|
-
e += s ? `<a href="${
|
|
2946
|
+
const l = this.runsOf(i);
|
|
2947
|
+
e += s ? `<a href="${de(s)}">${l}</a>` : l;
|
|
2917
2948
|
} else (i.localName === "smartTag" || i.localName === "ins") && (e += this.runsOf(i));
|
|
2918
2949
|
return e;
|
|
2919
2950
|
}
|
|
@@ -2921,163 +2952,237 @@ class qi {
|
|
|
2921
2952
|
const e = B(t, "rPr");
|
|
2922
2953
|
let i = "";
|
|
2923
2954
|
for (const p of Array.from(t.children))
|
|
2924
|
-
p.localName === "t" ? i +=
|
|
2955
|
+
p.localName === "t" ? i += de(p.textContent || "") : p.localName === "br" || p.localName === "cr" ? i += "<br>" : p.localName === "tab" ? i += " " : (p.localName === "drawing" || p.localName === "pict" || p.localName === "object") && (i += this.convertImage(p));
|
|
2925
2956
|
if (!i) return "";
|
|
2926
2957
|
const s = [], n = q(e ? B(e, "color") : null);
|
|
2927
2958
|
n && n !== "auto" && s.push("color:#" + n);
|
|
2928
|
-
const
|
|
2929
|
-
|
|
2930
|
-
const
|
|
2931
|
-
|
|
2959
|
+
const l = q(e ? B(e, "highlight") : null);
|
|
2960
|
+
l && ue[l] && s.push("background-color:" + ue[l]);
|
|
2961
|
+
const r = parseFloat(q(e ? B(e, "sz") : null));
|
|
2962
|
+
r && s.push("font-size:" + Math.round(r / 2 * (4 / 3)) + "px");
|
|
2932
2963
|
const o = e ? B(e, "rFonts") : null, a = q(o, "ascii") || q(o, "cs");
|
|
2933
2964
|
a && s.push(`font-family:'${a}'`), 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>`);
|
|
2934
|
-
const
|
|
2935
|
-
return
|
|
2965
|
+
const u = q(e ? B(e, "vertAlign") : null);
|
|
2966
|
+
return u === "superscript" ? i = `<sup>${i}</sup>` : u === "subscript" && (i = `<sub>${i}</sub>`), i;
|
|
2936
2967
|
}
|
|
2937
2968
|
convertImage(t) {
|
|
2938
2969
|
let e = "", i = 0;
|
|
2939
|
-
const s = (
|
|
2940
|
-
if (
|
|
2941
|
-
const o = parseFloat(
|
|
2970
|
+
const s = (r) => {
|
|
2971
|
+
if (r.localName === "blip" && (e = e || q(r, "embed") || q(r, "link")), r.localName === "imagedata" && (e = e || q(r, "id")), r.localName === "extent") {
|
|
2972
|
+
const o = parseFloat(r.getAttribute("cx") || "0");
|
|
2942
2973
|
o && (i = Math.round(o / 9525));
|
|
2943
2974
|
}
|
|
2944
|
-
for (const o of Array.from(
|
|
2975
|
+
for (const o of Array.from(r.children)) s(o);
|
|
2945
2976
|
};
|
|
2946
2977
|
if (s(t), !e) return "";
|
|
2947
2978
|
const n = this.images.get(e);
|
|
2948
2979
|
if (!n) return "";
|
|
2949
|
-
const
|
|
2950
|
-
return `<img src="${n}" alt=""${
|
|
2980
|
+
const l = i ? ` width="${i}"` : "";
|
|
2981
|
+
return `<img src="${n}" alt=""${l}>`;
|
|
2951
2982
|
}
|
|
2952
2983
|
convertTable(t) {
|
|
2953
2984
|
let e = '<table style="border-collapse:collapse;width:100%"><tbody>';
|
|
2954
|
-
for (const i of
|
|
2985
|
+
for (const i of ut(t, "tr")) {
|
|
2955
2986
|
e += "<tr>";
|
|
2956
|
-
for (const s of
|
|
2957
|
-
const n = parseInt(q(B(s, "tcPr", "gridSpan")) || "1", 10) || 1,
|
|
2958
|
-
let
|
|
2987
|
+
for (const s of ut(i, "tc")) {
|
|
2988
|
+
const n = parseInt(q(B(s, "tcPr", "gridSpan")) || "1", 10) || 1, l = n > 1 ? ` colspan="${n}"` : "";
|
|
2989
|
+
let r = "";
|
|
2959
2990
|
for (const o of Array.from(s.children))
|
|
2960
|
-
o.localName === "p" ?
|
|
2961
|
-
e += `<td style="border:1px solid #b9c2cc"${
|
|
2991
|
+
o.localName === "p" ? r += this.convertPara(o) : o.localName === "tbl" && (r += this.convertTable(o));
|
|
2992
|
+
e += `<td style="border:1px solid #b9c2cc"${l}>${r || "<br>"}</td>`;
|
|
2962
2993
|
}
|
|
2963
2994
|
e += "</tr>";
|
|
2964
2995
|
}
|
|
2965
2996
|
return e + "</tbody></table>";
|
|
2966
2997
|
}
|
|
2967
2998
|
}
|
|
2968
|
-
async function
|
|
2969
|
-
const t =
|
|
2970
|
-
const
|
|
2971
|
-
return
|
|
2972
|
-
}, n = await s("word/document.xml"),
|
|
2973
|
-
let
|
|
2974
|
-
if (
|
|
2975
|
-
for (const
|
|
2976
|
-
if (
|
|
2977
|
-
|
|
2999
|
+
async function Oi(d) {
|
|
3000
|
+
const t = d instanceof ArrayBuffer ? d : await d.arrayBuffer(), e = Pi(t), i = new TextDecoder(), s = async (b) => {
|
|
3001
|
+
const f = e.get(b);
|
|
3002
|
+
return f ? new DOMParser().parseFromString(i.decode(await he(t, f)), "application/xml") : null;
|
|
3003
|
+
}, n = await s("word/document.xml"), l = n == null ? void 0 : n.getElementsByTagName("*");
|
|
3004
|
+
let r = null;
|
|
3005
|
+
if (l) {
|
|
3006
|
+
for (const b of Array.from(l))
|
|
3007
|
+
if (b.localName === "body") {
|
|
3008
|
+
r = b;
|
|
2978
3009
|
break;
|
|
2979
3010
|
}
|
|
2980
3011
|
}
|
|
2981
|
-
if (!
|
|
2982
|
-
const o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(),
|
|
2983
|
-
if (
|
|
2984
|
-
for (const
|
|
2985
|
-
if (
|
|
2986
|
-
const
|
|
2987
|
-
/hyperlink/i.test(
|
|
3012
|
+
if (!r) throw new Error("word/document.xml missing or invalid");
|
|
3013
|
+
const o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), u = await s("word/_rels/document.xml.rels");
|
|
3014
|
+
if (u)
|
|
3015
|
+
for (const b of Array.from(u.getElementsByTagName("*"))) {
|
|
3016
|
+
if (b.localName !== "Relationship") continue;
|
|
3017
|
+
const f = b.getAttribute("Id") || "", y = b.getAttribute("Target") || "", C = b.getAttribute("Type") || "";
|
|
3018
|
+
/hyperlink/i.test(C) ? o.set(f, y) : /image/i.test(C) && a.set(f, y);
|
|
2988
3019
|
}
|
|
2989
3020
|
const p = /* @__PURE__ */ new Map();
|
|
2990
|
-
for (const [
|
|
2991
|
-
const
|
|
2992
|
-
if (!
|
|
2993
|
-
const E = (
|
|
3021
|
+
for (const [b, f] of a) {
|
|
3022
|
+
const y = f.startsWith("/") ? f.slice(1) : "word/" + f.replace(/^\.\//, ""), C = e.get(y);
|
|
3023
|
+
if (!C) continue;
|
|
3024
|
+
const E = (y.split(".").pop() || "").toLowerCase(), I = Bi[E];
|
|
2994
3025
|
if (I)
|
|
2995
3026
|
try {
|
|
2996
|
-
p.set(
|
|
3027
|
+
p.set(b, `data:${I};base64,${Di(await he(t, C))}`);
|
|
2997
3028
|
} catch {
|
|
2998
3029
|
}
|
|
2999
3030
|
}
|
|
3000
|
-
const m = /* @__PURE__ */ new Map(),
|
|
3001
|
-
if (
|
|
3002
|
-
const
|
|
3003
|
-
for (const
|
|
3004
|
-
if (
|
|
3005
|
-
const
|
|
3006
|
-
|
|
3031
|
+
const m = /* @__PURE__ */ new Map(), v = await s("word/numbering.xml");
|
|
3032
|
+
if (v) {
|
|
3033
|
+
const b = /* @__PURE__ */ new Map(), f = Array.from(v.getElementsByTagName("*"));
|
|
3034
|
+
for (const y of f) {
|
|
3035
|
+
if (y.localName !== "abstractNum") continue;
|
|
3036
|
+
const C = q(y, "abstractNumId"), E = ut(y, "lvl").find((A) => q(A, "ilvl") === "0") || ut(y, "lvl")[0], I = E ? q(B(E, "numFmt")) : "";
|
|
3037
|
+
b.set(C, I === "bullet" ? "ul" : "ol");
|
|
3007
3038
|
}
|
|
3008
|
-
for (const
|
|
3009
|
-
if (
|
|
3010
|
-
const
|
|
3011
|
-
m.set(
|
|
3039
|
+
for (const y of f) {
|
|
3040
|
+
if (y.localName !== "num") continue;
|
|
3041
|
+
const C = q(y, "numId"), E = q(B(y, "abstractNumId"));
|
|
3042
|
+
m.set(C, b.get(E) || "ul");
|
|
3012
3043
|
}
|
|
3013
3044
|
}
|
|
3014
|
-
return new
|
|
3045
|
+
return new Ni(o, p, m).convertBody(r);
|
|
3015
3046
|
}
|
|
3016
|
-
const
|
|
3047
|
+
const Fi = ["nw", "ne", "sw", "se"], Et = ["img-left", "img-right", "img-top", "img-center"], St = {
|
|
3017
3048
|
"img-left": "tplimgleft",
|
|
3018
3049
|
"img-right": "tplimgright",
|
|
3019
3050
|
"img-top": "tplimgtop",
|
|
3020
3051
|
"img-center": "tplimgcenter"
|
|
3021
|
-
},
|
|
3052
|
+
}, Zi = {
|
|
3022
3053
|
"img-left": h.tplleft,
|
|
3023
3054
|
"img-right": h.tplright,
|
|
3024
3055
|
"img-top": h.tpltop,
|
|
3025
3056
|
"img-center": h.tplcenter
|
|
3026
|
-
},
|
|
3027
|
-
let O = null, X = null,
|
|
3057
|
+
}, _i = ".tox,.pop,.tblctx,.imgctx,.selctx,.dlg";
|
|
3058
|
+
let O = null, X = null, Lt = 0, pe = !1;
|
|
3028
3059
|
function ct() {
|
|
3029
|
-
clearTimeout(
|
|
3060
|
+
clearTimeout(Lt), X = null, O && O.classList.remove("show");
|
|
3030
3061
|
}
|
|
3031
|
-
function
|
|
3032
|
-
const t =
|
|
3062
|
+
function $i(d) {
|
|
3063
|
+
const t = d.dataset.tip;
|
|
3033
3064
|
if (!t) return;
|
|
3034
|
-
X =
|
|
3065
|
+
X = d, clearTimeout(Lt);
|
|
3035
3066
|
const e = O && O.classList.contains("show") ? 60 : 350;
|
|
3036
|
-
|
|
3037
|
-
if (X !==
|
|
3067
|
+
Lt = window.setTimeout(() => {
|
|
3068
|
+
if (X !== d || !document.contains(d)) return;
|
|
3038
3069
|
O || (O = document.createElement("div"), O.className = "etip", document.body.appendChild(O)), O.textContent = t, O.classList.add("show");
|
|
3039
|
-
const i =
|
|
3040
|
-
let
|
|
3041
|
-
|
|
3042
|
-
let
|
|
3043
|
-
|
|
3070
|
+
const i = d.getBoundingClientRect(), s = O.offsetWidth, n = O.offsetHeight;
|
|
3071
|
+
let l = i.left + i.width / 2 - s / 2;
|
|
3072
|
+
l = Math.max(6, Math.min(l, innerWidth - s - 6));
|
|
3073
|
+
let r = i.bottom + 7;
|
|
3074
|
+
r + n > innerHeight - 6 && (r = i.top - n - 7), O.style.left = l + "px", O.style.top = r + "px";
|
|
3044
3075
|
}, e);
|
|
3045
3076
|
}
|
|
3046
|
-
function
|
|
3047
|
-
|
|
3048
|
-
const t =
|
|
3049
|
-
if (!e || !e.closest(
|
|
3077
|
+
function ji() {
|
|
3078
|
+
pe || (pe = !0, document.addEventListener("mouseover", (d) => {
|
|
3079
|
+
const t = d.target, e = t.closest ? t.closest("[title],[data-tip]") : null;
|
|
3080
|
+
if (!e || !e.closest(_i) || e.closest(".earea")) {
|
|
3050
3081
|
e !== X && ct();
|
|
3051
3082
|
return;
|
|
3052
3083
|
}
|
|
3053
3084
|
const i = e.getAttribute("title");
|
|
3054
|
-
i && (e.dataset.tip = i, e.removeAttribute("title"), e.getAttribute("aria-label") || e.setAttribute("aria-label", i)), e !== X &&
|
|
3055
|
-
}), document.addEventListener("mouseout", (
|
|
3056
|
-
X && !X.contains(
|
|
3085
|
+
i && (e.dataset.tip = i, e.removeAttribute("title"), e.getAttribute("aria-label") || e.setAttribute("aria-label", i)), e !== X && $i(e);
|
|
3086
|
+
}), document.addEventListener("mouseout", (d) => {
|
|
3087
|
+
X && !X.contains(d.relatedTarget) && ct();
|
|
3057
3088
|
}), document.addEventListener("mousedown", ct, !0), addEventListener("scroll", ct, !0));
|
|
3058
3089
|
}
|
|
3059
|
-
const
|
|
3060
|
-
function
|
|
3061
|
-
for (const t of
|
|
3062
|
-
if (
|
|
3063
|
-
if (
|
|
3090
|
+
const Wi = /[\u0590-\u05FF\u0600-\u06FF\u0750-\u077F\u0780-\u07BF\u08A0-\u08FF\uFB1D-\uFB4F\uFB50-\uFDFF\uFE70-\uFEFF]/, Ui = new RegExp("\\p{L}", "u"), Vi = "p,div,li,td,th,blockquote,h1,h2,h3,h4,h5,h6,pre,figcaption";
|
|
3091
|
+
function zi(d) {
|
|
3092
|
+
for (const t of d) {
|
|
3093
|
+
if (Wi.test(t)) return "rtl";
|
|
3094
|
+
if (Ui.test(t)) return "ltr";
|
|
3064
3095
|
}
|
|
3065
3096
|
return null;
|
|
3066
3097
|
}
|
|
3067
|
-
|
|
3098
|
+
const ht = ["top", "right", "bottom", "left"], Xi = /^(none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset)$/i, Yi = /^(thin|medium|thick|[+-]?(\d+\.?\d*|\.\d+)(px|pt|em|rem|ex|ch|cm|mm|in|pc|q)?)$/i, Gi = /^[+-]?0*(\.0*)?(px|pt|em|rem|ex|ch|cm|mm|in|pc|q)?$/i, Ki = /^border-(collapse|spacing|radius|image|block|inline|start|end)/i, Qi = /^border(?:-(top|right|bottom|left))?(?:-(width|style|color))?$/, Ji = /^(inherit|initial|unset|revert|revert-layer)$/i;
|
|
3099
|
+
function be(d) {
|
|
3100
|
+
const t = [];
|
|
3101
|
+
let e = 0, i = "";
|
|
3102
|
+
for (const s of d)
|
|
3103
|
+
s === "(" ? e++ : s === ")" && e--, e === 0 && /\s/.test(s) ? (i && t.push(i), i = "") : i += s;
|
|
3104
|
+
return i && t.push(i), t;
|
|
3105
|
+
}
|
|
3106
|
+
function ts(d) {
|
|
3107
|
+
const [t, e = t, i = t, s = e] = d;
|
|
3108
|
+
return [t, e, i, s];
|
|
3109
|
+
}
|
|
3110
|
+
function es(d) {
|
|
3111
|
+
const t = { width: "medium", style: "none", color: "" };
|
|
3112
|
+
return be(d).forEach((e) => {
|
|
3113
|
+
Xi.test(e) ? t.style = e.toLowerCase() : Yi.test(e) ? t.width = e : t.color = e;
|
|
3114
|
+
}), t;
|
|
3115
|
+
}
|
|
3116
|
+
function is(d) {
|
|
3117
|
+
return !d || /^currentcolor$/i.test(d) ? "" : /^windowtext$/i.test(d) ? "#000000" : d;
|
|
3118
|
+
}
|
|
3119
|
+
function ss(d) {
|
|
3120
|
+
if (d.width === null && d.style === null && d.color === null) return "";
|
|
3121
|
+
const t = d.style ?? "solid";
|
|
3122
|
+
return t === "none" || t === "hidden" || d.width && Gi.test(d.width) ? "none" : [d.width && d.width !== "medium" ? d.width : "", t, is(d.color || "")].filter(Boolean).join(" ");
|
|
3123
|
+
}
|
|
3124
|
+
function ns(d) {
|
|
3125
|
+
d.querySelectorAll("table,td,th").forEach((t) => {
|
|
3126
|
+
const e = t.getAttribute("style") || "";
|
|
3127
|
+
if (!/border/i.test(e)) return;
|
|
3128
|
+
const i = {
|
|
3129
|
+
top: { width: null, style: null, color: null },
|
|
3130
|
+
right: { width: null, style: null, color: null },
|
|
3131
|
+
bottom: { width: null, style: null, color: null },
|
|
3132
|
+
left: { width: null, style: null, color: null }
|
|
3133
|
+
}, s = [];
|
|
3134
|
+
let n = !1, l = !1;
|
|
3135
|
+
if (e.split(";").forEach((a) => {
|
|
3136
|
+
const u = a.indexOf(":");
|
|
3137
|
+
if (u < 1) {
|
|
3138
|
+
a.trim() && s.push(a.trim());
|
|
3139
|
+
return;
|
|
3140
|
+
}
|
|
3141
|
+
const p = a.slice(0, u).trim().toLowerCase(), m = a.slice(u + 1).trim(), v = Qi.exec(p);
|
|
3142
|
+
if (!v || Ki.test(p)) {
|
|
3143
|
+
s.push(p + ":" + m);
|
|
3144
|
+
return;
|
|
3145
|
+
}
|
|
3146
|
+
if (Ji.test(m)) {
|
|
3147
|
+
l = !0;
|
|
3148
|
+
return;
|
|
3149
|
+
}
|
|
3150
|
+
n = !0;
|
|
3151
|
+
const b = v[1], f = v[2];
|
|
3152
|
+
if (f)
|
|
3153
|
+
if (b)
|
|
3154
|
+
i[b][f] = m;
|
|
3155
|
+
else {
|
|
3156
|
+
const y = ts(be(m));
|
|
3157
|
+
ht.forEach((C, E) => {
|
|
3158
|
+
i[C][f] = y[E];
|
|
3159
|
+
});
|
|
3160
|
+
}
|
|
3161
|
+
else {
|
|
3162
|
+
const y = es(m);
|
|
3163
|
+
(b ? [b] : ht.slice()).forEach((C) => {
|
|
3164
|
+
i[C] = { ...y };
|
|
3165
|
+
});
|
|
3166
|
+
}
|
|
3167
|
+
}), l || !n) return;
|
|
3168
|
+
const r = ht.map((a) => ss(i[a])), o = s.slice();
|
|
3169
|
+
r.every((a) => a && a === r[0]) ? o.push("border:" + r[0]) : ht.forEach((a, u) => r[u] && o.push(`border-${a}:` + r[u])), t.setAttribute("style", o.join(";"));
|
|
3170
|
+
});
|
|
3171
|
+
}
|
|
3172
|
+
function ye(d) {
|
|
3068
3173
|
let t = "";
|
|
3069
|
-
return
|
|
3174
|
+
return d.childNodes.forEach((e) => {
|
|
3070
3175
|
if (e.nodeType === Node.TEXT_NODE)
|
|
3071
3176
|
t += e.nodeValue || "";
|
|
3072
3177
|
else if (e.nodeType === Node.ELEMENT_NODE) {
|
|
3073
3178
|
const i = e, s = (i.getAttribute("dir") || "").toLowerCase();
|
|
3074
3179
|
if (s === "rtl" || s === "ltr") return;
|
|
3075
|
-
t +=
|
|
3180
|
+
t += ye(i);
|
|
3076
3181
|
}
|
|
3077
3182
|
}), t;
|
|
3078
3183
|
}
|
|
3079
3184
|
var j;
|
|
3080
|
-
let
|
|
3185
|
+
let rs = (j = class {
|
|
3081
3186
|
constructor(t) {
|
|
3082
3187
|
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.subStack = [], 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 = {
|
|
3083
3188
|
target: t.target,
|
|
@@ -3093,20 +3198,20 @@ let ji = (j = class {
|
|
|
3093
3198
|
statusbar: t.statusbar ?? !0,
|
|
3094
3199
|
readonly: t.readonly ?? !1,
|
|
3095
3200
|
draftKey: t.draftKey ?? (typeof location < "u" ? location.pathname : "default"),
|
|
3096
|
-
fontFamilyFormats: t.fontFamilyFormats ??
|
|
3201
|
+
fontFamilyFormats: t.fontFamilyFormats ?? si,
|
|
3097
3202
|
imageFileTypes: t.imageFileTypes ?? ["image/jpeg", "image/jpg", "image/png", "image/gif", "image/bmp", "image/webp"],
|
|
3098
3203
|
videoFileTypes: t.videoFileTypes ?? ["video/mp4", "video/webm", "video/ogg"]
|
|
3099
3204
|
}, 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.stampExistingImages(), this.options.onReady(this);
|
|
3100
3205
|
}
|
|
3101
3206
|
t(t) {
|
|
3102
|
-
const e =
|
|
3207
|
+
const e = wt(this.lang)[t];
|
|
3103
3208
|
return typeof e == "string" ? e : e.join(",");
|
|
3104
3209
|
}
|
|
3105
3210
|
tArr(t) {
|
|
3106
|
-
return
|
|
3211
|
+
return wt(this.lang)[t];
|
|
3107
3212
|
}
|
|
3108
3213
|
dir() {
|
|
3109
|
-
return
|
|
3214
|
+
return wt(this.lang).dir;
|
|
3110
3215
|
}
|
|
3111
3216
|
/* ---------------------------------------------------------- DOM setup */
|
|
3112
3217
|
initDOM() {
|
|
@@ -3119,7 +3224,7 @@ let ji = (j = class {
|
|
|
3119
3224
|
</span>
|
|
3120
3225
|
`, this.sbHelp = this.statusbar.querySelector(".mid"), this.sbWords = this.statusbar.querySelector(".words");
|
|
3121
3226
|
const e = this.statusbar.querySelector(".grip");
|
|
3122
|
-
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),
|
|
3227
|
+
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), ji(), 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);
|
|
3123
3228
|
}
|
|
3124
3229
|
/** Theme options land as CSS variables on the document root rather than the editor
|
|
3125
3230
|
* shell, because dialogs, popups and floating context toolbars are appended to
|
|
@@ -3139,12 +3244,12 @@ let ji = (j = class {
|
|
|
3139
3244
|
let e = 0, i = 0;
|
|
3140
3245
|
const s = (n) => {
|
|
3141
3246
|
e = n.clientY, i = this.ed.offsetHeight, n.preventDefault();
|
|
3142
|
-
const
|
|
3247
|
+
const l = (o) => {
|
|
3143
3248
|
this.ed.style.height = Math.max(120, i + o.clientY - e) + "px";
|
|
3144
|
-
},
|
|
3145
|
-
window.removeEventListener("mousemove",
|
|
3249
|
+
}, r = () => {
|
|
3250
|
+
window.removeEventListener("mousemove", l), window.removeEventListener("mouseup", r);
|
|
3146
3251
|
};
|
|
3147
|
-
window.addEventListener("mousemove",
|
|
3252
|
+
window.addEventListener("mousemove", l), window.addEventListener("mouseup", r);
|
|
3148
3253
|
};
|
|
3149
3254
|
t.addEventListener("mousedown", s), this.listeners.push(() => t.removeEventListener("mousedown", s));
|
|
3150
3255
|
}
|
|
@@ -3162,34 +3267,34 @@ let ji = (j = class {
|
|
|
3162
3267
|
}), this.on(this.ed, "keydown", (t) => {
|
|
3163
3268
|
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);
|
|
3164
3269
|
}), this.on(this.ed, "paste", (t) => this.handlePaste(t)), this.on(this.ed, "drop", (t) => {
|
|
3165
|
-
var n,
|
|
3270
|
+
var n, l, r, o;
|
|
3166
3271
|
t.preventDefault();
|
|
3167
3272
|
const e = t.target, i = (n = e.closest) == null ? void 0 : n.call(e, ".img-ph:not(.vid-ph)");
|
|
3168
3273
|
if (i && this.ed.contains(i) && !this.options.readonly) {
|
|
3169
|
-
const a = Array.from(((
|
|
3274
|
+
const a = Array.from(((l = t.dataTransfer) == null ? void 0 : l.files) || []).find((u) => u.type.startsWith("image/"));
|
|
3170
3275
|
a && this.readImageFileInto(a, i);
|
|
3171
3276
|
return;
|
|
3172
3277
|
}
|
|
3173
|
-
const s = (
|
|
3278
|
+
const s = (r = e.closest) == null ? void 0 : r.call(e, ".vid-ph");
|
|
3174
3279
|
if (s && this.ed.contains(s) && !this.options.readonly) {
|
|
3175
|
-
const a = Array.from(((o = t.dataTransfer) == null ? void 0 : o.files) || []).find((
|
|
3280
|
+
const a = Array.from(((o = t.dataTransfer) == null ? void 0 : o.files) || []).find((u) => u.type.startsWith("video/"));
|
|
3176
3281
|
a && this.readVideoFileInto(a, s);
|
|
3177
3282
|
}
|
|
3178
3283
|
}), this.on(this.ed, "dragover", (t) => t.preventDefault()), this.on(this.ed, "mousedown", (t) => {
|
|
3179
|
-
var
|
|
3180
|
-
const e = t.target, i = (
|
|
3284
|
+
var u, p, m, v, b, f, y;
|
|
3285
|
+
const e = t.target, i = (u = e.closest) == null ? void 0 : u.call(e, "table");
|
|
3181
3286
|
i && this.ed.contains(i) ? this.selectTableForResize(i) : this.clearTableHandles();
|
|
3182
3287
|
const s = (p = e.closest) == null ? void 0 : p.call(e, ".img-ph:not(.vid-ph)");
|
|
3183
3288
|
s && this.ed.contains(s) && !this.options.readonly ? (t.preventDefault(), this.ed.focus(), this.selectImgPlaceholder(s)) : this.clearImgPlaceholderSel();
|
|
3184
3289
|
const n = (m = e.closest) == null ? void 0 : m.call(e, ".vid-ph");
|
|
3185
3290
|
n && this.ed.contains(n) && !this.options.readonly ? (t.preventDefault(), this.ed.focus(), this.selectVphPlaceholder(n)) : this.clearVphPlaceholderSel();
|
|
3186
|
-
const
|
|
3187
|
-
|
|
3188
|
-
const
|
|
3189
|
-
|
|
3190
|
-
const o = (
|
|
3291
|
+
const l = (v = e.closest) == null ? void 0 : v.call(e, ".tpl");
|
|
3292
|
+
l && this.ed.contains(l) && !this.options.readonly ? this.selectTemplate(l) : this.clearTplSel();
|
|
3293
|
+
const r = (b = e.closest) == null ? void 0 : b.call(e, "pre.code-block");
|
|
3294
|
+
r && this.ed.contains(r) && !this.options.readonly ? (t.preventDefault(), this.selectCodeEl(r)) : this.clearCodeSel();
|
|
3295
|
+
const o = (f = e.closest) == null ? void 0 : f.call(e, "img");
|
|
3191
3296
|
o && this.ed.contains(o) && !this.options.readonly ? (t.preventDefault(), this.selectImage(o)) : this.clearImageHandles();
|
|
3192
|
-
const a = (
|
|
3297
|
+
const a = (y = e.closest) == null ? void 0 : y.call(e, "video, .video-embed");
|
|
3193
3298
|
a && this.ed.contains(a) && !this.options.readonly ? (t.preventDefault(), this.selectVideo(a)) : this.clearVidHandles();
|
|
3194
3299
|
}), this.on(this.ed, "mouseover", (t) => {
|
|
3195
3300
|
var i, s;
|
|
@@ -3197,11 +3302,11 @@ let ji = (j = class {
|
|
|
3197
3302
|
const e = (s = (i = t.target).closest) == null ? void 0 : s.call(i, "img");
|
|
3198
3303
|
e && this.ed.contains(e) && (this.cancelImgHide(), this.selectImage(e));
|
|
3199
3304
|
}), this.on(this.ed, "mouseout", (t) => {
|
|
3200
|
-
var s, n,
|
|
3305
|
+
var s, n, l, r;
|
|
3201
3306
|
const e = (n = (s = t.target).closest) == null ? void 0 : n.call(s, "img");
|
|
3202
3307
|
if (!e) return;
|
|
3203
3308
|
const i = t.relatedTarget;
|
|
3204
|
-
i && ((
|
|
3309
|
+
i && ((l = this.imgCtx) != null && l.contains(i) || this.imgHandles.some((o) => o.contains(i)) || ((r = i.closest) == null ? void 0 : r.call(i, "img")) === e) || this.scheduleImgHide();
|
|
3205
3310
|
}), this.on(this.ed, "scroll", () => {
|
|
3206
3311
|
this.positionTableHandles(), this.positionImageHandles(), this.positionImgPhCtx(), this.positionTplCtx(), this.positionVphCtx(), this.positionVidCtx(), this.positionCodeCtx();
|
|
3207
3312
|
}), this.onWin(
|
|
@@ -3283,37 +3388,40 @@ let ji = (j = class {
|
|
|
3283
3388
|
* content with no strongly-directional character anywhere falls back to the
|
|
3284
3389
|
* editor's current direction. */
|
|
3285
3390
|
getContentForEmail() {
|
|
3286
|
-
const t = (
|
|
3287
|
-
const a = (
|
|
3288
|
-
|
|
3391
|
+
const t = (r, o) => {
|
|
3392
|
+
const a = (r.getAttribute("style") || "").trim();
|
|
3393
|
+
r.setAttribute("style", a ? a.replace(/;?$/, "; ") + o : o);
|
|
3289
3394
|
}, e = document.createElement("div");
|
|
3290
3395
|
e.innerHTML = this.ed.innerHTML;
|
|
3291
3396
|
let i = null;
|
|
3292
|
-
e.querySelectorAll("[dir]").forEach((
|
|
3293
|
-
const o = (
|
|
3397
|
+
e.querySelectorAll("[dir]").forEach((r) => {
|
|
3398
|
+
const o = (r.getAttribute("dir") || "").toLowerCase();
|
|
3294
3399
|
if (o !== "rtl" && o !== "ltr") return;
|
|
3295
3400
|
const a = o;
|
|
3296
|
-
i || (i = a), /text-align\s*:/i.test(
|
|
3297
|
-
}), e.querySelectorAll(
|
|
3298
|
-
const o = (
|
|
3401
|
+
i || (i = a), /text-align\s*:/i.test(r.getAttribute("style") || "") || t(r, `text-align:${a === "rtl" ? "right" : "left"}`);
|
|
3402
|
+
}), e.querySelectorAll(Vi).forEach((r) => {
|
|
3403
|
+
const o = (r.getAttribute("dir") || "").toLowerCase();
|
|
3299
3404
|
if (o === "rtl" || o === "ltr") return;
|
|
3300
|
-
const a =
|
|
3405
|
+
const a = zi(ye(r));
|
|
3301
3406
|
if (!a) return;
|
|
3302
|
-
i || (i = a),
|
|
3303
|
-
const
|
|
3304
|
-
t(
|
|
3407
|
+
i || (i = a), r.setAttribute("dir", a);
|
|
3408
|
+
const u = /text-align\s*:/i.test(r.getAttribute("style") || "");
|
|
3409
|
+
t(r, u ? `direction:${a}` : `direction:${a};text-align:${a === "rtl" ? "right" : "left"}`);
|
|
3305
3410
|
});
|
|
3306
3411
|
const s = this.ed.querySelectorAll("img");
|
|
3307
|
-
e.querySelectorAll("img").forEach((
|
|
3308
|
-
if (
|
|
3309
|
-
const a = s[o],
|
|
3310
|
-
|
|
3311
|
-
const p =
|
|
3312
|
-
|
|
3412
|
+
e.querySelectorAll("img").forEach((r, o) => {
|
|
3413
|
+
if (r.closest(".tpl-media")) return;
|
|
3414
|
+
const a = s[o], u = Math.round((a == null ? void 0 : a.getBoundingClientRect().width) || 0);
|
|
3415
|
+
u > 0 && !r.getAttribute("width") && r.setAttribute("width", String(u));
|
|
3416
|
+
const p = r.getAttribute("style") || "";
|
|
3417
|
+
u > 0 && !/(^|;)\s*width\s*:/i.test(p) && t(r, `width:${u}px`), /max-width\s*:/i.test(r.getAttribute("style") || "") || t(r, "max-width:100%"), /(^|;)\s*height\s*:/i.test(r.getAttribute("style") || "") || t(r, "height:auto");
|
|
3418
|
+
}), ns(e), e.querySelectorAll("table").forEach((r) => {
|
|
3419
|
+
const o = r.getAttribute("style") || "";
|
|
3420
|
+
/border-collapse\s*:/i.test(o) || t(r, "border-collapse:collapse"), !/border-spacing\s*:/i.test(o) && !r.hasAttribute("cellspacing") && r.setAttribute("cellspacing", "0");
|
|
3313
3421
|
});
|
|
3314
3422
|
const n = i || this.ed.getAttribute("dir") || this.dir();
|
|
3315
|
-
return e.querySelectorAll("table:not([dir])").forEach((
|
|
3316
|
-
|
|
3423
|
+
return e.querySelectorAll("table:not([dir])").forEach((r) => {
|
|
3424
|
+
r.setAttribute("dir", n), /direction\s*:/i.test(r.getAttribute("style") || "") || t(r, `direction:${n}`);
|
|
3317
3425
|
}), `<div dir="${n}" style="direction:${n};text-align:${n === "rtl" ? "right" : "left"}">${e.innerHTML}</div>`;
|
|
3318
3426
|
}
|
|
3319
3427
|
setContent(t) {
|
|
@@ -3329,7 +3437,7 @@ let ji = (j = class {
|
|
|
3329
3437
|
this.ed.focus();
|
|
3330
3438
|
}
|
|
3331
3439
|
async importWordFile(t) {
|
|
3332
|
-
const e = await
|
|
3440
|
+
const e = await Oi(t);
|
|
3333
3441
|
this.recordRevision(), this.setContent(e), this.recordRevision();
|
|
3334
3442
|
}
|
|
3335
3443
|
restoreDraft() {
|
|
@@ -3388,8 +3496,8 @@ let ji = (j = class {
|
|
|
3388
3496
|
t.preventDefault();
|
|
3389
3497
|
const n = document.createElement("p");
|
|
3390
3498
|
n.appendChild(document.createElement("br")), s.after(n), i.remove(), s.firstElementChild || s.remove();
|
|
3391
|
-
const
|
|
3392
|
-
|
|
3499
|
+
const l = document.createRange();
|
|
3500
|
+
l.setStart(n, 0), l.collapse(!0), e.removeAllRanges(), e.addRange(l), this.saveSel(), this.onChange();
|
|
3393
3501
|
}
|
|
3394
3502
|
selectedBlocks() {
|
|
3395
3503
|
const t = window.getSelection();
|
|
@@ -3439,30 +3547,30 @@ let ji = (j = class {
|
|
|
3439
3547
|
s.className = "revprev";
|
|
3440
3548
|
const n = document.createElement("button");
|
|
3441
3549
|
n.type = "button", n.className = "revrestore", n.textContent = this.t("restore");
|
|
3442
|
-
let
|
|
3443
|
-
const
|
|
3550
|
+
let l = this.revisions.length - 1;
|
|
3551
|
+
const r = new Intl.DateTimeFormat(this.lang === "ar" ? "ar-AE" : "en-GB", {
|
|
3444
3552
|
year: "numeric",
|
|
3445
3553
|
month: "short",
|
|
3446
3554
|
day: "numeric",
|
|
3447
3555
|
hour: "2-digit",
|
|
3448
3556
|
minute: "2-digit",
|
|
3449
3557
|
second: "2-digit"
|
|
3450
|
-
}), o = {}, a = (
|
|
3451
|
-
|
|
3452
|
-
var
|
|
3453
|
-
return (
|
|
3454
|
-
}), s.innerHTML = this.revisions[
|
|
3558
|
+
}), o = {}, a = (u) => {
|
|
3559
|
+
l = u, this.revisions.forEach((p, m) => {
|
|
3560
|
+
var v;
|
|
3561
|
+
return (v = o[m]) == null ? void 0 : v.classList.toggle("on", m === u);
|
|
3562
|
+
}), s.innerHTML = this.revisions[u].html, n.disabled = u === this.revisions.length - 1;
|
|
3455
3563
|
};
|
|
3456
|
-
for (let
|
|
3457
|
-
const p = this.revisions[
|
|
3564
|
+
for (let u = this.revisions.length - 1; u >= 0; u--) {
|
|
3565
|
+
const p = this.revisions[u], m = document.createElement("button");
|
|
3458
3566
|
m.type = "button";
|
|
3459
|
-
const
|
|
3460
|
-
m.innerHTML = `<span>${
|
|
3567
|
+
const v = (new DOMParser().parseFromString(p.html, "text/html").body.textContent || "").trim(), b = v ? v.split(/\s+/).length : 0, f = u === this.revisions.length - 1;
|
|
3568
|
+
m.innerHTML = `<span>${f ? this.t("currentver") : r.format(new Date(p.time))}</span><span class="wc">${b} ${this.t("words")}</span>`, m.addEventListener("click", () => a(u)), o[u] = m, i.appendChild(m);
|
|
3461
3569
|
}
|
|
3462
3570
|
i.append(n), n.addEventListener("click", () => {
|
|
3463
|
-
const
|
|
3464
|
-
|
|
3465
|
-
}), e.append(i, s), t.appendChild(e), a(
|
|
3571
|
+
const u = this.revisions[l];
|
|
3572
|
+
u && (this.recordRevision(), this.setContent(u.html), this.recordRevision(), this.closeDlg());
|
|
3573
|
+
}), e.append(i, s), t.appendChild(e), a(l);
|
|
3466
3574
|
});
|
|
3467
3575
|
}
|
|
3468
3576
|
/* ---------------------------------------------------------- popups / menus */
|
|
@@ -3499,10 +3607,10 @@ let ji = (j = class {
|
|
|
3499
3607
|
n.className = "pop sub", n.dir = this.dir(), t.subBuild ? t.subBuild(n) : t.sub && this.menuItems(n, t.sub), n.addEventListener("mousedown", (a) => {
|
|
3500
3608
|
a.target.tagName !== "INPUT" && a.preventDefault();
|
|
3501
3609
|
}), document.body.appendChild(n);
|
|
3502
|
-
let
|
|
3503
|
-
|
|
3610
|
+
let r = this.dir() === "rtl" ? i.left - n.offsetWidth + 2 : i.right - 2;
|
|
3611
|
+
r = Math.max(8, Math.min(r + scrollX, scrollX + innerWidth - n.offsetWidth - 8));
|
|
3504
3612
|
let o = i.top + scrollY - 6;
|
|
3505
|
-
o = Math.max(8 + scrollY, Math.min(o, scrollY + innerHeight - n.offsetHeight - 8)), n.style.left =
|
|
3613
|
+
o = Math.max(8 + scrollY, Math.min(o, scrollY + innerHeight - n.offsetHeight - 8)), n.style.left = r + "px", n.style.top = o + "px", this.subStack.push(n);
|
|
3506
3614
|
}
|
|
3507
3615
|
popup(t, e, i) {
|
|
3508
3616
|
if (this.openPop && this.popAnchor === t) {
|
|
@@ -3514,8 +3622,8 @@ let ji = (j = class {
|
|
|
3514
3622
|
s.className = "pop" + (i ? " " + i : ""), s.dir = this.dir(), e(s), document.body.appendChild(s);
|
|
3515
3623
|
const n = t.getBoundingClientRect();
|
|
3516
3624
|
s.style.minWidth = Math.max(160, Math.round(n.width)) + "px";
|
|
3517
|
-
let
|
|
3518
|
-
|
|
3625
|
+
let l = n.bottom + scrollY + 2;
|
|
3626
|
+
l = Math.max(8 + scrollY, Math.min(l, scrollY + innerHeight - s.offsetHeight - 8)), s.style.top = l + "px";
|
|
3519
3627
|
let o = this.dir() === "rtl" ? n.right - s.offsetWidth : n.left;
|
|
3520
3628
|
o = Math.max(8, Math.min(o + scrollX, scrollX + innerWidth - s.offsetWidth - 8)), s.style.left = o + "px", s.addEventListener("mousedown", (a) => {
|
|
3521
3629
|
a.target.tagName !== "INPUT" && a.preventDefault();
|
|
@@ -3531,18 +3639,18 @@ let ji = (j = class {
|
|
|
3531
3639
|
n.className = "mi" + (i.on ? " on" : ""), n.innerHTML = `<span class="ic">${i.icon || ""}</span><span class="prev" ${i.previewStyle ? `style="${i.previewStyle}"` : ""}>${i.label}</span>${i.shortcut ? `<span class="sc">${i.shortcut}</span>` : ""}${s ? `<span class="subarrow">${h.chev}</span>` : ""}`, n.addEventListener("click", () => {
|
|
3532
3640
|
i.action && (this.closePop(), i.action());
|
|
3533
3641
|
}), n.addEventListener("mouseenter", () => {
|
|
3534
|
-
var
|
|
3535
|
-
s ? this.openSubFor(i, n) : this.closeSubFrom(this.subLevelOf(t)), (
|
|
3642
|
+
var l;
|
|
3643
|
+
s ? this.openSubFor(i, n) : this.closeSubFrom(this.subLevelOf(t)), (l = i.hover) == null || l.call(i, !0);
|
|
3536
3644
|
}), n.addEventListener("mouseleave", () => {
|
|
3537
|
-
var
|
|
3538
|
-
return (
|
|
3645
|
+
var l;
|
|
3646
|
+
return (l = i.hover) == null ? void 0 : l.call(i, !1);
|
|
3539
3647
|
}), t.appendChild(n);
|
|
3540
3648
|
});
|
|
3541
3649
|
}
|
|
3542
3650
|
/* ---------------------------------------------------------- toolbar builders */
|
|
3543
3651
|
tbtn(t, e, i, s) {
|
|
3544
3652
|
const n = document.createElement("button");
|
|
3545
|
-
return n.className = "tbtn", n.type = "button", n.title = e, n.innerHTML = t, s && (n.dataset.id = s), n.addEventListener("mousedown", (
|
|
3653
|
+
return n.className = "tbtn", n.type = "button", n.title = e, n.innerHTML = t, s && (n.dataset.id = s), n.addEventListener("mousedown", (l) => l.preventDefault()), n.addEventListener("click", i), n;
|
|
3546
3654
|
}
|
|
3547
3655
|
/** Font-size increase / decrease step button. */
|
|
3548
3656
|
stepBtn(t) {
|
|
@@ -3558,10 +3666,10 @@ let ji = (j = class {
|
|
|
3558
3666
|
colorChips() {
|
|
3559
3667
|
const t = (s) => {
|
|
3560
3668
|
const n = document.createElement("button");
|
|
3561
|
-
return n.type = "button", n.className = "cchip", n.title = s, n.addEventListener("mousedown", (
|
|
3562
|
-
|
|
3669
|
+
return n.type = "button", n.className = "cchip", n.title = s, n.addEventListener("mousedown", (l) => {
|
|
3670
|
+
l.preventDefault(), this.saveSel();
|
|
3563
3671
|
}), n;
|
|
3564
|
-
}, e =
|
|
3672
|
+
}, e = oi.map((s) => {
|
|
3565
3673
|
const n = t(this.t("forecolor"));
|
|
3566
3674
|
return n.style.background = s, n.addEventListener("click", () => this.applyColor("fore", s)), n;
|
|
3567
3675
|
}), i = t(this.t("forecolor"));
|
|
@@ -3575,17 +3683,17 @@ let ji = (j = class {
|
|
|
3575
3683
|
}
|
|
3576
3684
|
tsel(t, e, i, s) {
|
|
3577
3685
|
const n = document.createElement("button");
|
|
3578
|
-
return n.className = "tsel " + t, n.type = "button", n.dataset.id = e, n.innerHTML = `<span class="lbl empty">${i || ""}</span>${h.chev}`, n.addEventListener("mousedown", (
|
|
3579
|
-
|
|
3686
|
+
return n.className = "tsel " + t, n.type = "button", n.dataset.id = e, n.innerHTML = `<span class="lbl empty">${i || ""}</span>${h.chev}`, n.addEventListener("mousedown", (l) => {
|
|
3687
|
+
l.preventDefault(), this.saveSel();
|
|
3580
3688
|
}), n.addEventListener("click", () => s(n)), n;
|
|
3581
3689
|
}
|
|
3582
3690
|
setListStyle(t, e) {
|
|
3583
|
-
var n,
|
|
3691
|
+
var n, l;
|
|
3584
3692
|
this.restoreSel();
|
|
3585
3693
|
const i = window.getSelection();
|
|
3586
3694
|
if (!i) return;
|
|
3587
3695
|
let s = (n = this.closestBlock(i.anchorNode)) == null ? void 0 : n.closest(t);
|
|
3588
|
-
s || (this.exec(t === "ol" ? "insertOrderedList" : "insertUnorderedList"), s = (
|
|
3696
|
+
s || (this.exec(t === "ol" ? "insertOrderedList" : "insertUnorderedList"), s = (l = this.closestBlock(i.anchorNode)) == null ? void 0 : l.closest(t)), s && (s.style.listStyleType = e), this.saveSel(), this.onChange();
|
|
3589
3697
|
}
|
|
3590
3698
|
listMenu(t, e) {
|
|
3591
3699
|
var a;
|
|
@@ -3597,23 +3705,23 @@ let ji = (j = class {
|
|
|
3597
3705
|
] : [
|
|
3598
3706
|
["circle", h.ul_circle],
|
|
3599
3707
|
["square", h.ul_square]
|
|
3600
|
-
], n = this.tArr(e === "ol" ? "liststyles_ol" : "liststyles_ul").slice(1),
|
|
3601
|
-
this.popup(t, (
|
|
3602
|
-
this.menuItems(
|
|
3708
|
+
], n = this.tArr(e === "ol" ? "liststyles_ol" : "liststyles_ul").slice(1), l = window.getSelection(), r = l ? (a = this.closestBlock(l.anchorNode)) == null ? void 0 : a.closest(e) : null, o = r ? r.style.listStyleType : "";
|
|
3709
|
+
this.popup(t, (u) => {
|
|
3710
|
+
this.menuItems(u, [
|
|
3603
3711
|
{
|
|
3604
3712
|
label: this.t(e === "ol" ? "numlist" : "bullist"),
|
|
3605
3713
|
icon: e === "ol" ? h.numlist : h.bullist,
|
|
3606
3714
|
on: document.queryCommandState(i),
|
|
3607
3715
|
action: () => this.exec(i)
|
|
3608
3716
|
}
|
|
3609
|
-
]),
|
|
3717
|
+
]), u.insertAdjacentHTML("beforeend", '<div class="sep"></div>');
|
|
3610
3718
|
const p = document.createElement("div");
|
|
3611
|
-
p.className = "mi-grid", s.forEach(([m,
|
|
3612
|
-
const
|
|
3613
|
-
|
|
3719
|
+
p.className = "mi-grid", s.forEach(([m, v], b) => {
|
|
3720
|
+
const f = document.createElement("button");
|
|
3721
|
+
f.className = "mi" + (o === m ? " on" : ""), f.innerHTML = `<span class="ic">${v}</span><span class="prev">${n[b]}</span>`, f.addEventListener("click", () => {
|
|
3614
3722
|
this.closePop(), this.setListStyle(e, m);
|
|
3615
|
-
}), p.appendChild(
|
|
3616
|
-
}),
|
|
3723
|
+
}), p.appendChild(f);
|
|
3724
|
+
}), u.appendChild(p);
|
|
3617
3725
|
});
|
|
3618
3726
|
}
|
|
3619
3727
|
/** Shared color-picker popup body — swatch grid plus the current-color /
|
|
@@ -3621,7 +3729,7 @@ let ji = (j = class {
|
|
|
3621
3729
|
* table cell-background menu all show the identical popup. */
|
|
3622
3730
|
buildPaletteInto(t, e, i) {
|
|
3623
3731
|
const s = document.createElement("div");
|
|
3624
|
-
s.className = "cpal",
|
|
3732
|
+
s.className = "cpal", ai.forEach((p) => {
|
|
3625
3733
|
const m = document.createElement("button");
|
|
3626
3734
|
m.type = "button", m.style.background = p, m.title = p, m.addEventListener("click", () => {
|
|
3627
3735
|
this.closePop(), i(p);
|
|
@@ -3629,18 +3737,18 @@ let ji = (j = class {
|
|
|
3629
3737
|
}), t.appendChild(s), t.insertAdjacentHTML("beforeend", '<div class="sep"></div>');
|
|
3630
3738
|
const n = document.createElement("div");
|
|
3631
3739
|
n.className = "cfoot";
|
|
3632
|
-
const
|
|
3633
|
-
|
|
3740
|
+
const l = /^#[0-9a-f]{6}$/i.test(e) ? e : "#000000", r = document.createElement("div");
|
|
3741
|
+
r.className = "cswatch cur", r.title = this.t("currentcolor"), r.style.background = l, r.innerHTML = h.check;
|
|
3634
3742
|
const o = document.createElement("button");
|
|
3635
3743
|
o.type = "button", o.className = "cswatch nocolor", o.title = this.t("removecolor"), o.addEventListener("click", () => {
|
|
3636
3744
|
this.closePop(), i(null);
|
|
3637
3745
|
});
|
|
3638
3746
|
const a = document.createElement("label");
|
|
3639
3747
|
a.className = "cswatch cwheel", a.title = this.t("customcolor"), a.innerHTML = h.palette;
|
|
3640
|
-
const
|
|
3641
|
-
|
|
3642
|
-
this.closePop(), i(
|
|
3643
|
-
}), a.appendChild(
|
|
3748
|
+
const u = document.createElement("input");
|
|
3749
|
+
u.type = "color", u.value = l, u.addEventListener("change", () => {
|
|
3750
|
+
this.closePop(), i(u.value);
|
|
3751
|
+
}), a.appendChild(u), n.append(r, o, a), t.appendChild(n);
|
|
3644
3752
|
}
|
|
3645
3753
|
colorMenu(t, e) {
|
|
3646
3754
|
this.popup(
|
|
@@ -3670,7 +3778,7 @@ let ji = (j = class {
|
|
|
3670
3778
|
this.popup(t, (e) => this.menuItems(e, this.fontItems()));
|
|
3671
3779
|
}
|
|
3672
3780
|
sizeItems() {
|
|
3673
|
-
return
|
|
3781
|
+
return ni.map((t) => ({
|
|
3674
3782
|
label: t,
|
|
3675
3783
|
on: this.currentSize() === t,
|
|
3676
3784
|
action: () => this.applyFontSize(t)
|
|
@@ -3686,19 +3794,19 @@ let ji = (j = class {
|
|
|
3686
3794
|
const t = window.getSelection();
|
|
3687
3795
|
if (!t) return;
|
|
3688
3796
|
if (!t.rangeCount) {
|
|
3689
|
-
const
|
|
3690
|
-
|
|
3797
|
+
const l = document.createRange();
|
|
3798
|
+
l.selectNodeContents(this.ed), l.collapse(!0), t.addRange(l);
|
|
3691
3799
|
}
|
|
3692
3800
|
if (!t.isCollapsed) return;
|
|
3693
3801
|
const e = t.getRangeAt(0), i = e.startContainer;
|
|
3694
3802
|
if (i.nodeType === 3) {
|
|
3695
|
-
const
|
|
3696
|
-
let
|
|
3697
|
-
for (;
|
|
3698
|
-
for (; o <
|
|
3699
|
-
if (o >
|
|
3803
|
+
const l = i.data;
|
|
3804
|
+
let r = e.startOffset, o = e.startOffset;
|
|
3805
|
+
for (; r > 0 && /\S/.test(l[r - 1]); ) r--;
|
|
3806
|
+
for (; o < l.length && /\S/.test(l[o]); ) o++;
|
|
3807
|
+
if (o > r) {
|
|
3700
3808
|
const a = document.createRange();
|
|
3701
|
-
a.setStart(i,
|
|
3809
|
+
a.setStart(i, r), a.setEnd(i, o), t.removeAllRanges(), t.addRange(a), this.savedRange = a.cloneRange();
|
|
3702
3810
|
return;
|
|
3703
3811
|
}
|
|
3704
3812
|
}
|
|
@@ -3723,7 +3831,7 @@ let ji = (j = class {
|
|
|
3723
3831
|
this.saveSel(), this.refreshState(), this.onChange();
|
|
3724
3832
|
}
|
|
3725
3833
|
stepFontSize(t) {
|
|
3726
|
-
const e = parseInt(this.currentSize(), 10) || 14, i = Math.min(
|
|
3834
|
+
const e = parseInt(this.currentSize(), 10) || 14, i = Math.min(li, Math.max(ri, e + t));
|
|
3727
3835
|
i !== e && this.applyFontSize(i + "px");
|
|
3728
3836
|
}
|
|
3729
3837
|
/* ------------------------------------------------ case / spacing / link */
|
|
@@ -3732,14 +3840,14 @@ let ji = (j = class {
|
|
|
3732
3840
|
const e = window.getSelection();
|
|
3733
3841
|
if (!e || !e.rangeCount || e.isCollapsed) return;
|
|
3734
3842
|
const i = e.getRangeAt(0), s = document.createTreeWalker(this.ed, NodeFilter.SHOW_TEXT), n = [];
|
|
3735
|
-
let
|
|
3736
|
-
for (;
|
|
3737
|
-
n.forEach((
|
|
3738
|
-
const o =
|
|
3843
|
+
let l;
|
|
3844
|
+
for (; l = s.nextNode(); ) i.intersectsNode(l) && n.push(l);
|
|
3845
|
+
n.forEach((r) => {
|
|
3846
|
+
const o = r === i.startContainer ? i.startOffset : 0, a = r === i.endContainer ? i.endOffset : r.data.length;
|
|
3739
3847
|
if (a <= o) return;
|
|
3740
|
-
const
|
|
3741
|
-
let p =
|
|
3742
|
-
t === "lower" ? p =
|
|
3848
|
+
const u = r.data.slice(o, a);
|
|
3849
|
+
let p = u;
|
|
3850
|
+
t === "lower" ? p = u.toLowerCase() : t === "upper" ? p = u.toUpperCase() : p = u.replace(/(^|\s)(\S)/g, (m, v, b) => v + b.toUpperCase()), r.replaceData(o, a - o, p);
|
|
3743
3851
|
}), this.saveSel(), this.refreshState(), this.onChange();
|
|
3744
3852
|
}
|
|
3745
3853
|
caseItems() {
|
|
@@ -3775,13 +3883,13 @@ let ji = (j = class {
|
|
|
3775
3883
|
];
|
|
3776
3884
|
}
|
|
3777
3885
|
lineHeightMenu(t) {
|
|
3778
|
-
this.popup(t, (e) => this.menuItems(e, this.blockStyleItems("lineHeight",
|
|
3886
|
+
this.popup(t, (e) => this.menuItems(e, this.blockStyleItems("lineHeight", ee)));
|
|
3779
3887
|
}
|
|
3780
3888
|
wordSpacingMenu(t) {
|
|
3781
|
-
this.popup(t, (e) => this.menuItems(e, this.blockStyleItems("wordSpacing",
|
|
3889
|
+
this.popup(t, (e) => this.menuItems(e, this.blockStyleItems("wordSpacing", ie)));
|
|
3782
3890
|
}
|
|
3783
3891
|
letterSpacingMenu(t) {
|
|
3784
|
-
this.popup(t, (e) => this.menuItems(e, this.blockStyleItems("letterSpacing",
|
|
3892
|
+
this.popup(t, (e) => this.menuItems(e, this.blockStyleItems("letterSpacing", se)));
|
|
3785
3893
|
}
|
|
3786
3894
|
closestAnchor() {
|
|
3787
3895
|
const t = window.getSelection();
|
|
@@ -3827,14 +3935,14 @@ let ji = (j = class {
|
|
|
3827
3935
|
(s) => {
|
|
3828
3936
|
const n = document.createElement("div");
|
|
3829
3937
|
n.style.cssText = "display:flex;align-items:center;gap:10px;margin:10px 0;min-width:360px";
|
|
3830
|
-
const
|
|
3831
|
-
|
|
3938
|
+
const l = document.createElement("span");
|
|
3939
|
+
l.style.cssText = "width:60px;color:#556;flex:none", l.textContent = this.t("linkurl"), e = document.createElement("input"), e.type = "url", e.placeholder = "https://", e.style.cssText = "flex:1;border:1px solid #cfd6df;border-radius:6px;padding:7px 9px;font:14px inherit", e.value = (t == null ? void 0 : t.getAttribute("href")) || "", n.append(l, e), s.appendChild(n), setTimeout(() => e.focus(), 0);
|
|
3832
3940
|
},
|
|
3833
3941
|
i
|
|
3834
3942
|
);
|
|
3835
3943
|
}
|
|
3836
3944
|
blockItems() {
|
|
3837
|
-
return
|
|
3945
|
+
return re.map(([t]) => ({
|
|
3838
3946
|
label: this.blockLabel(t),
|
|
3839
3947
|
previewStyle: t.startsWith("h") ? `font-weight:700;font-size:${22 - 2 * +t[1]}px` : t === "pre" ? "font-family:monospace" : "",
|
|
3840
3948
|
on: this.currentBlock() === t,
|
|
@@ -3871,15 +3979,15 @@ let ji = (j = class {
|
|
|
3871
3979
|
s.className = "tgrid";
|
|
3872
3980
|
const n = document.createElement("div");
|
|
3873
3981
|
n.className = "tgridlbl", n.textContent = "1 × 1";
|
|
3874
|
-
const
|
|
3875
|
-
for (let
|
|
3982
|
+
const l = [];
|
|
3983
|
+
for (let r = 0; r < 8; r++)
|
|
3876
3984
|
for (let o = 0; o < 10; o++) {
|
|
3877
3985
|
const a = document.createElement("span");
|
|
3878
|
-
a.dataset.r = String(
|
|
3879
|
-
|
|
3986
|
+
a.dataset.r = String(r), a.dataset.c = String(o), a.addEventListener("mouseenter", () => {
|
|
3987
|
+
l.forEach((u) => u.classList.toggle("hot", +u.dataset.r <= r && +u.dataset.c <= o)), n.textContent = o + 1 + " × " + (r + 1);
|
|
3880
3988
|
}), a.addEventListener("click", () => {
|
|
3881
|
-
this.closePop(), this.insertTable(
|
|
3882
|
-
}),
|
|
3989
|
+
this.closePop(), this.insertTable(r + 1, o + 1), e == null || e();
|
|
3990
|
+
}), l.push(a), s.appendChild(a);
|
|
3883
3991
|
}
|
|
3884
3992
|
i.append(s, n), t.appendChild(i);
|
|
3885
3993
|
}
|
|
@@ -3964,17 +4072,17 @@ let ji = (j = class {
|
|
|
3964
4072
|
}
|
|
3965
4073
|
buildToolbar() {
|
|
3966
4074
|
this.toolbar.innerHTML = "";
|
|
3967
|
-
const t = this.options.toolbar === !0 ?
|
|
4075
|
+
const t = this.options.toolbar === !0 ? ei : this.options.toolbar, e = this.buildToolbarRegistry();
|
|
3968
4076
|
this.parseToolbarString(t).forEach((i) => {
|
|
3969
4077
|
const s = [];
|
|
3970
4078
|
i.forEach((n) => {
|
|
3971
|
-
const
|
|
3972
|
-
if (!
|
|
4079
|
+
const l = e[n];
|
|
4080
|
+
if (!l) {
|
|
3973
4081
|
console.warn(`FableEditor: unknown toolbar item "${n}"`);
|
|
3974
4082
|
return;
|
|
3975
4083
|
}
|
|
3976
|
-
const
|
|
3977
|
-
Array.isArray(
|
|
4084
|
+
const r = l();
|
|
4085
|
+
Array.isArray(r) ? s.push(...r) : s.push(r);
|
|
3978
4086
|
}), s.length && this.toolbar.appendChild(this.group(...s));
|
|
3979
4087
|
}), this.tbrMore = this.tbtn(h.more, this.t("more"), () => {
|
|
3980
4088
|
this.tbrExpanded = !this.tbrExpanded, this.updateToolbarOverflow();
|
|
@@ -4074,9 +4182,9 @@ let ji = (j = class {
|
|
|
4074
4182
|
{ label: this.t("fontsize"), subBuild: (s) => this.menuItems(s, this.sizeItems()) },
|
|
4075
4183
|
{ label: this.t("blocks"), subBuild: (s) => this.menuItems(s, this.blockItems()) },
|
|
4076
4184
|
{ label: this.t("align"), subBuild: (s) => this.menuItems(s, this.alignItems()) },
|
|
4077
|
-
{ label: this.t("lineheight"), icon: h.lineheight, subBuild: (s) => this.menuItems(s, this.blockStyleItems("lineHeight",
|
|
4078
|
-
{ label: this.t("wordspacing"), icon: h.wordspacing, subBuild: (s) => this.menuItems(s, this.blockStyleItems("wordSpacing",
|
|
4079
|
-
{ label: this.t("letterspacing"), icon: h.letterspacing, subBuild: (s) => this.menuItems(s, this.blockStyleItems("letterSpacing",
|
|
4185
|
+
{ label: this.t("lineheight"), icon: h.lineheight, subBuild: (s) => this.menuItems(s, this.blockStyleItems("lineHeight", ee)) },
|
|
4186
|
+
{ label: this.t("wordspacing"), icon: h.wordspacing, subBuild: (s) => this.menuItems(s, this.blockStyleItems("wordSpacing", ie)) },
|
|
4187
|
+
{ label: this.t("letterspacing"), icon: h.letterspacing, subBuild: (s) => this.menuItems(s, this.blockStyleItems("letterSpacing", se)) },
|
|
4080
4188
|
"|",
|
|
4081
4189
|
{ label: this.t("forecolor"), icon: h.palette, subBuild: (s) => this.buildPaletteInto(s, this.foreColor, (n) => this.applyColor("fore", n)) },
|
|
4082
4190
|
{ label: this.t("backcolor"), icon: h.backcolor, subBuild: (s) => this.buildPaletteInto(s, this.backColor, (n) => this.applyColor("back", n)) },
|
|
@@ -4146,7 +4254,7 @@ let ji = (j = class {
|
|
|
4146
4254
|
{ label: this.t("deltable"), icon: h.trash, action: () => this.tableOp("deltable") }
|
|
4147
4255
|
],
|
|
4148
4256
|
help: [this.mItem("helpttl", h.helpic, () => this.helpDlg(), "Alt+0")]
|
|
4149
|
-
}, e = this.options.menubar === !0 ?
|
|
4257
|
+
}, e = this.options.menubar === !0 ? ii : this.options.menubar, i = /* @__PURE__ */ new Set();
|
|
4150
4258
|
e.split(/\s+/).filter(Boolean).forEach((s) => {
|
|
4151
4259
|
if (i.has(s)) return;
|
|
4152
4260
|
if (i.add(s), !t[s]) {
|
|
@@ -4154,36 +4262,36 @@ let ji = (j = class {
|
|
|
4154
4262
|
return;
|
|
4155
4263
|
}
|
|
4156
4264
|
const n = document.createElement("button");
|
|
4157
|
-
n.type = "button", n.textContent = this.t(s), n.dataset.menuKey = s, n.addEventListener("mousedown", (
|
|
4158
|
-
|
|
4159
|
-
}), n.addEventListener("click", () => this.popup(n, (
|
|
4265
|
+
n.type = "button", n.textContent = this.t(s), n.dataset.menuKey = s, n.addEventListener("mousedown", (l) => {
|
|
4266
|
+
l.preventDefault(), this.saveSel();
|
|
4267
|
+
}), n.addEventListener("click", () => this.popup(n, (l) => this.menuItems(l, t[s]))), this.menubar.appendChild(n);
|
|
4160
4268
|
});
|
|
4161
4269
|
}
|
|
4162
4270
|
/* ---------------------------------------------------------- table ops */
|
|
4163
4271
|
tableOp(t) {
|
|
4164
|
-
var o, a,
|
|
4272
|
+
var o, a, u;
|
|
4165
4273
|
this.restoreSel();
|
|
4166
4274
|
const e = window.getSelection();
|
|
4167
4275
|
if (!e) return;
|
|
4168
|
-
const i = ((o = this.closestBlock(e.anchorNode)) == null ? void 0 : o.closest("td,th")) || (e.anchorNode && e.anchorNode.nodeType === 1 ? (
|
|
4276
|
+
const i = ((o = this.closestBlock(e.anchorNode)) == null ? void 0 : o.closest("td,th")) || (e.anchorNode && e.anchorNode.nodeType === 1 ? (u = (a = e.anchorNode).closest) == null ? void 0 : u.call(a, "td,th") : null);
|
|
4169
4277
|
if (!i) return;
|
|
4170
|
-
const s = i.parentElement, n = i.closest("table"),
|
|
4278
|
+
const s = i.parentElement, n = i.closest("table"), l = Array.from(s.children).indexOf(i), r = () => {
|
|
4171
4279
|
const p = s.cloneNode(!1);
|
|
4172
4280
|
return Array.from(s.children).forEach((m) => {
|
|
4173
|
-
const
|
|
4174
|
-
|
|
4281
|
+
const v = document.createElement("td"), b = m.getAttribute("style");
|
|
4282
|
+
b && v.setAttribute("style", b), v.style.removeProperty("background-color"), v.innerHTML = "<br>", p.appendChild(v);
|
|
4175
4283
|
}), p;
|
|
4176
4284
|
};
|
|
4177
|
-
if (t === "rowabove" && s.before(
|
|
4285
|
+
if (t === "rowabove" && s.before(r()), t === "rowbelow" && s.after(r()), t === "delrow") {
|
|
4178
4286
|
const p = s.parentElement;
|
|
4179
4287
|
s.remove(), p.querySelector("tr") || n.remove();
|
|
4180
4288
|
}
|
|
4181
4289
|
(t === "colbefore" || t === "colafter") && n.querySelectorAll("tr").forEach((p) => {
|
|
4182
|
-
const m = p.children[Math.min(
|
|
4183
|
-
|
|
4290
|
+
const m = p.children[Math.min(l, p.children.length - 1)], v = document.createElement("td"), b = m.getAttribute("style");
|
|
4291
|
+
b && v.setAttribute("style", b), v.style.removeProperty("width"), v.style.removeProperty("background-color"), v.innerHTML = "<br>", t === "colbefore" ? m.before(v) : m.after(v);
|
|
4184
4292
|
}), t === "delcol" && (n.querySelectorAll("tr").forEach((p) => {
|
|
4185
4293
|
var m;
|
|
4186
|
-
return (m = p.children[
|
|
4294
|
+
return (m = p.children[l]) == null ? void 0 : m.remove();
|
|
4187
4295
|
}), n.querySelector("td,th") || n.remove()), t === "deltable" && n.remove(), this.onChange(), this.positionTableHandles();
|
|
4188
4296
|
}
|
|
4189
4297
|
/** Reorders the current row/column: 'rowup'/'rowdown' swap the caret's row with
|
|
@@ -4203,16 +4311,16 @@ let ji = (j = class {
|
|
|
4203
4311
|
o && o.after(i);
|
|
4204
4312
|
}
|
|
4205
4313
|
t === "colleft" && n > 0 && s.querySelectorAll("tr").forEach((o) => {
|
|
4206
|
-
const a = o.children[n],
|
|
4207
|
-
a &&
|
|
4314
|
+
const a = o.children[n], u = o.children[n - 1];
|
|
4315
|
+
a && u && u.before(a);
|
|
4208
4316
|
}), t === "colright" && s.querySelectorAll("tr").forEach((o) => {
|
|
4209
|
-
const a = o.children[n],
|
|
4210
|
-
a &&
|
|
4317
|
+
const a = o.children[n], u = o.children[n + 1];
|
|
4318
|
+
a && u && u.after(a);
|
|
4211
4319
|
});
|
|
4212
|
-
const
|
|
4213
|
-
|
|
4214
|
-
const
|
|
4215
|
-
|
|
4320
|
+
const l = document.createRange();
|
|
4321
|
+
l.selectNodeContents(e), l.collapse(!0);
|
|
4322
|
+
const r = window.getSelection();
|
|
4323
|
+
r && (r.removeAllRanges(), r.addRange(l)), this.saveSel(), this.onChange(), this.positionTableHandles(), this.positionCellMarker();
|
|
4216
4324
|
}
|
|
4217
4325
|
/** Align the whole table via auto margins — same semantics as the align
|
|
4218
4326
|
* field in the table-properties dialog. */
|
|
@@ -4249,26 +4357,26 @@ let ji = (j = class {
|
|
|
4249
4357
|
tablePropsDlg() {
|
|
4250
4358
|
const t = this.tblActive;
|
|
4251
4359
|
if (!t) return;
|
|
4252
|
-
let e, i, s, n,
|
|
4253
|
-
const
|
|
4360
|
+
let e, i, s, n, l;
|
|
4361
|
+
const r = "display:flex;align-items:center;gap:10px;margin:10px 0", o = "width:120px;color:#556;flex:none", a = "flex:1;border:1px solid #cfd6df;border-radius:6px;padding:7px 9px;font:14px inherit", u = t.querySelector("td,th"), p = t.style.width || "", m = u && u.style.padding ? parseFloat(u.style.padding) : "", v = t.style.borderSpacing ? parseFloat(t.style.borderSpacing) : "", b = t.style.borderWidth ? parseFloat(t.style.borderWidth) : "", f = t.style.marginLeft, y = t.style.marginRight, C = f === "auto" && y === "auto" ? "center" : f === "auto" ? "right" : y === "auto" && f === "0" ? "left" : "";
|
|
4254
4362
|
this.dialog(
|
|
4255
4363
|
this.t("tablepropsttl"),
|
|
4256
4364
|
(E) => {
|
|
4257
4365
|
const I = (A, $) => {
|
|
4258
|
-
const
|
|
4259
|
-
|
|
4260
|
-
const
|
|
4261
|
-
|
|
4366
|
+
const F = document.createElement("div");
|
|
4367
|
+
F.style.cssText = r;
|
|
4368
|
+
const Z = document.createElement("span");
|
|
4369
|
+
Z.style.cssText = o, Z.textContent = this.t(A), F.append(Z, $), E.appendChild(F);
|
|
4262
4370
|
};
|
|
4263
|
-
e = document.createElement("input"), e.type = "text", e.style.cssText = a, e.placeholder = "e.g. 600px or 100%", e.value = p, I("tblwidth", e), i = document.createElement("input"), i.type = "number", i.min = "0", i.style.cssText = a, i.value = String(m), I("tblcellpadding", i), s = document.createElement("input"), s.type = "number", s.min = "0", s.style.cssText = a, s.value = String(
|
|
4371
|
+
e = document.createElement("input"), e.type = "text", e.style.cssText = a, e.placeholder = "e.g. 600px or 100%", e.value = p, I("tblwidth", e), i = document.createElement("input"), i.type = "number", i.min = "0", i.style.cssText = a, i.value = String(m), I("tblcellpadding", i), s = document.createElement("input"), s.type = "number", s.min = "0", s.style.cssText = a, s.value = String(v), I("tblcellspacing", s), n = document.createElement("input"), n.type = "number", n.min = "0", n.style.cssText = a, n.value = String(b), I("tblborder", n), l = document.createElement("select"), l.style.cssText = a, [
|
|
4264
4372
|
["", "alignnone"],
|
|
4265
4373
|
["left", "alignleft"],
|
|
4266
4374
|
["center", "aligncenter"],
|
|
4267
4375
|
["right", "alignright"]
|
|
4268
4376
|
].forEach(([A, $]) => {
|
|
4269
|
-
const
|
|
4270
|
-
|
|
4271
|
-
}), I("tblalign",
|
|
4377
|
+
const F = document.createElement("option");
|
|
4378
|
+
F.value = A, F.textContent = this.t($), A === C && (F.selected = !0), l.appendChild(F);
|
|
4379
|
+
}), I("tblalign", l);
|
|
4272
4380
|
},
|
|
4273
4381
|
[
|
|
4274
4382
|
{ label: this.t("cancel"), action: () => this.closeDlg() },
|
|
@@ -4281,7 +4389,7 @@ let ji = (j = class {
|
|
|
4281
4389
|
cellpadding: i.value.trim(),
|
|
4282
4390
|
cellspacing: s.value.trim(),
|
|
4283
4391
|
border: n.value.trim(),
|
|
4284
|
-
align:
|
|
4392
|
+
align: l.value
|
|
4285
4393
|
}), this.closeDlg(), this.onChange(), this.positionTableHandles();
|
|
4286
4394
|
}
|
|
4287
4395
|
}
|
|
@@ -4320,8 +4428,8 @@ let ji = (j = class {
|
|
|
4320
4428
|
formSelect(t, e) {
|
|
4321
4429
|
const i = document.createElement("select");
|
|
4322
4430
|
return i.style.cssText = "flex:1;border:1px solid #cfd6df;border-radius:6px;padding:7px 9px;font:14px inherit;background:#fff", t.forEach(([s, n]) => {
|
|
4323
|
-
const
|
|
4324
|
-
|
|
4431
|
+
const l = document.createElement("option");
|
|
4432
|
+
l.value = s, l.textContent = n, s === e && (l.selected = !0), i.appendChild(l);
|
|
4325
4433
|
}), i;
|
|
4326
4434
|
}
|
|
4327
4435
|
formBg(t) {
|
|
@@ -4331,8 +4439,8 @@ let ji = (j = class {
|
|
|
4331
4439
|
s.type = "color", s.value = i || "#ffffff", s.style.cssText = "width:36px;height:29px;border:1px solid #cfd6df;border-radius:4px;padding:1px;background:none;cursor:pointer";
|
|
4332
4440
|
const n = document.createElement("label");
|
|
4333
4441
|
n.style.cssText = "display:flex;align-items:center;gap:6px;cursor:pointer;color:#556";
|
|
4334
|
-
const
|
|
4335
|
-
return
|
|
4442
|
+
const l = document.createElement("input");
|
|
4443
|
+
return l.type = "checkbox", l.checked = !!i, n.append(l, document.createTextNode(this.t("fill"))), s.addEventListener("input", () => l.checked = !0), e.append(s, n), { wrap: e, color: s, fill: l };
|
|
4336
4444
|
}
|
|
4337
4445
|
setOrClear(t, e, i) {
|
|
4338
4446
|
i ? t.style.setProperty(e, /^(width|height)$/.test(e) && /^\d+$/.test(i) ? i + "px" : i) : t.style.removeProperty(e);
|
|
@@ -4343,11 +4451,11 @@ let ji = (j = class {
|
|
|
4343
4451
|
alert(this.t("nocell"));
|
|
4344
4452
|
return;
|
|
4345
4453
|
}
|
|
4346
|
-
let e, i, s, n,
|
|
4454
|
+
let e, i, s, n, l;
|
|
4347
4455
|
this.dialog(
|
|
4348
4456
|
this.t("cellprops").replace("…", ""),
|
|
4349
|
-
(
|
|
4350
|
-
e = this.formInput(t.style.width, "e.g. 120px / 25%"), this.formRow(
|
|
4457
|
+
(r) => {
|
|
4458
|
+
e = this.formInput(t.style.width, "e.g. 120px / 25%"), this.formRow(r, this.t("tblwidth"), e), i = this.formInput(t.style.height, "e.g. 40px"), this.formRow(r, this.t("tblheight"), i), s = this.formSelect(
|
|
4351
4459
|
[
|
|
4352
4460
|
["", this.t("alignnone")],
|
|
4353
4461
|
["left", this.t("alignleft")],
|
|
@@ -4355,7 +4463,7 @@ let ji = (j = class {
|
|
|
4355
4463
|
["right", this.t("alignright")]
|
|
4356
4464
|
],
|
|
4357
4465
|
t.style.textAlign || ""
|
|
4358
|
-
), this.formRow(
|
|
4466
|
+
), this.formRow(r, this.t("tblalign"), s), n = this.formSelect(
|
|
4359
4467
|
[
|
|
4360
4468
|
["", this.t("alignnone")],
|
|
4361
4469
|
["top", this.t("valigntop")],
|
|
@@ -4363,7 +4471,7 @@ let ji = (j = class {
|
|
|
4363
4471
|
["bottom", this.t("valignbottom")]
|
|
4364
4472
|
],
|
|
4365
4473
|
t.style.verticalAlign || ""
|
|
4366
|
-
), this.formRow(
|
|
4474
|
+
), this.formRow(r, this.t("valign"), n), l = this.formBg(t.style.backgroundColor || ""), this.formRow(r, this.t("backcolor"), l.wrap);
|
|
4367
4475
|
},
|
|
4368
4476
|
[
|
|
4369
4477
|
{ label: this.t("cancel"), action: () => this.closeDlg() },
|
|
@@ -4371,7 +4479,7 @@ let ji = (j = class {
|
|
|
4371
4479
|
label: this.t("save"),
|
|
4372
4480
|
primary: !0,
|
|
4373
4481
|
action: () => {
|
|
4374
|
-
this.setOrClear(t, "width", e.value.trim()), this.setOrClear(t, "height", i.value.trim()), this.setOrClear(t, "text-align", s.value), this.setOrClear(t, "vertical-align", n.value), this.setOrClear(t, "background-color",
|
|
4482
|
+
this.setOrClear(t, "width", e.value.trim()), this.setOrClear(t, "height", i.value.trim()), this.setOrClear(t, "text-align", s.value), this.setOrClear(t, "vertical-align", n.value), this.setOrClear(t, "background-color", l.fill.checked ? l.color.value : ""), this.closeDlg(), this.onChange(), this.positionTableHandles();
|
|
4375
4483
|
}
|
|
4376
4484
|
}
|
|
4377
4485
|
]
|
|
@@ -4409,11 +4517,11 @@ let ji = (j = class {
|
|
|
4409
4517
|
return;
|
|
4410
4518
|
}
|
|
4411
4519
|
const e = t.parentElement, i = t.closest("table"), s = Array.from(e.children).indexOf(t), n = Array.from(i.rows).map((o) => o.cells[s]).filter(Boolean);
|
|
4412
|
-
let
|
|
4520
|
+
let l, r;
|
|
4413
4521
|
this.dialog(
|
|
4414
4522
|
this.t("colprops").replace("…", ""),
|
|
4415
4523
|
(o) => {
|
|
4416
|
-
|
|
4524
|
+
l = this.formInput(t.style.width, "e.g. 120px / 25%"), this.formRow(o, this.t("tblwidth"), l), r = this.formBg(t.style.backgroundColor || ""), this.formRow(o, this.t("backcolor"), r.wrap);
|
|
4417
4525
|
},
|
|
4418
4526
|
[
|
|
4419
4527
|
{ label: this.t("cancel"), action: () => this.closeDlg() },
|
|
@@ -4422,7 +4530,7 @@ let ji = (j = class {
|
|
|
4422
4530
|
primary: !0,
|
|
4423
4531
|
action: () => {
|
|
4424
4532
|
n.forEach((o) => {
|
|
4425
|
-
this.setOrClear(o, "width",
|
|
4533
|
+
this.setOrClear(o, "width", l.value.trim()), this.setOrClear(o, "background-color", r.fill.checked ? r.color.value : "");
|
|
4426
4534
|
}), this.closeDlg(), this.onChange(), this.positionTableHandles();
|
|
4427
4535
|
}
|
|
4428
4536
|
}
|
|
@@ -4438,8 +4546,8 @@ let ji = (j = class {
|
|
|
4438
4546
|
const s = document.createElement("div");
|
|
4439
4547
|
s.className = "dlg", s.dir = this.dir(), s.innerHTML = `<header><span>${t}</span><button type="button">×</button></header>
|
|
4440
4548
|
<div class="body"></div><footer></footer>`, s.querySelector("header button").onclick = () => this.closeDlg(), e(s.querySelector(".body")), (i || [{ label: this.t("close"), primary: !0, action: () => this.closeDlg() }]).forEach((n) => {
|
|
4441
|
-
const
|
|
4442
|
-
|
|
4549
|
+
const l = document.createElement("button");
|
|
4550
|
+
l.type = "button", l.textContent = n.label, n.primary && (l.className = "pri"), l.onclick = n.action, s.querySelector("footer").appendChild(l);
|
|
4443
4551
|
}), this.dlgOvl.appendChild(s), this.dlgOvl.addEventListener("mousedown", (n) => {
|
|
4444
4552
|
n.target === this.dlgOvl && this.closeDlg();
|
|
4445
4553
|
}), document.body.appendChild(this.dlgOvl);
|
|
@@ -4503,31 +4611,31 @@ let ji = (j = class {
|
|
|
4503
4611
|
this.saveSel(), this.dialog(t, (s) => {
|
|
4504
4612
|
const n = document.createElement("div");
|
|
4505
4613
|
n.className = "chmap";
|
|
4506
|
-
const r = document.createElement("div");
|
|
4507
|
-
r.className = "chtabs";
|
|
4508
4614
|
const l = document.createElement("div");
|
|
4509
|
-
l.className = "
|
|
4615
|
+
l.className = "chtabs";
|
|
4616
|
+
const r = document.createElement("div");
|
|
4617
|
+
r.className = "chpanel";
|
|
4510
4618
|
const o = document.createElement("div");
|
|
4511
|
-
o.className = "chgrid" + (i ? " emgrid" : ""),
|
|
4512
|
-
const a = (
|
|
4513
|
-
|
|
4619
|
+
o.className = "chgrid" + (i ? " emgrid" : ""), r.appendChild(o);
|
|
4620
|
+
const a = (u) => {
|
|
4621
|
+
l.querySelectorAll("button").forEach((p, m) => p.classList.toggle("on", m === u)), o.innerHTML = "", e[u].chars.forEach((p) => {
|
|
4514
4622
|
const m = document.createElement("button");
|
|
4515
4623
|
m.type = "button", m.textContent = p, m.onclick = () => {
|
|
4516
4624
|
this.closeDlg(), this.exec("insertText", p);
|
|
4517
4625
|
}, o.appendChild(m);
|
|
4518
|
-
}),
|
|
4626
|
+
}), r.scrollTop = 0;
|
|
4519
4627
|
};
|
|
4520
|
-
e.forEach((
|
|
4628
|
+
e.forEach((u, p) => {
|
|
4521
4629
|
const m = document.createElement("button");
|
|
4522
|
-
m.type = "button", m.textContent = this.t(
|
|
4523
|
-
}), n.append(
|
|
4630
|
+
m.type = "button", m.textContent = this.t(u.key), m.addEventListener("click", () => a(p)), l.appendChild(m);
|
|
4631
|
+
}), n.append(l, r), s.appendChild(n), a(0);
|
|
4524
4632
|
});
|
|
4525
4633
|
}
|
|
4526
4634
|
charMap() {
|
|
4527
|
-
this.glyphPickerDlg(this.t("charmap").replace("…", ""),
|
|
4635
|
+
this.glyphPickerDlg(this.t("charmap").replace("…", ""), ci, !1);
|
|
4528
4636
|
}
|
|
4529
4637
|
emojiMap() {
|
|
4530
|
-
this.glyphPickerDlg(this.t("emoji").replace("…", ""),
|
|
4638
|
+
this.glyphPickerDlg(this.t("emoji").replace("…", ""), hi, !0);
|
|
4531
4639
|
}
|
|
4532
4640
|
printDoc() {
|
|
4533
4641
|
const t = window.open("", "_blank");
|
|
@@ -4589,17 +4697,17 @@ let ji = (j = class {
|
|
|
4589
4697
|
const i = document.createElement("button");
|
|
4590
4698
|
i.type = "button", i.className = "txtbtn", i.textContent = this.t("insertimg");
|
|
4591
4699
|
const s = () => {
|
|
4592
|
-
const n = e.value.trim(),
|
|
4593
|
-
if (!
|
|
4700
|
+
const n = e.value.trim(), l = this.phActive;
|
|
4701
|
+
if (!l) return;
|
|
4594
4702
|
if (!/^(https?:|data:image\/|blob:)/i.test(n)) {
|
|
4595
4703
|
e.classList.add("err"), e.focus();
|
|
4596
4704
|
return;
|
|
4597
4705
|
}
|
|
4598
4706
|
i.disabled = !0, e.disabled = !0;
|
|
4599
|
-
const
|
|
4600
|
-
|
|
4707
|
+
const r = new Image();
|
|
4708
|
+
r.onload = () => this.replacePlaceholderWithImage(l, n, ""), r.onerror = () => {
|
|
4601
4709
|
i.disabled = !1, e.disabled = !1, e.classList.add("err"), e.focus();
|
|
4602
|
-
},
|
|
4710
|
+
}, r.src = n;
|
|
4603
4711
|
};
|
|
4604
4712
|
i.addEventListener("click", s), e.addEventListener("input", () => e.classList.remove("err")), e.addEventListener("keydown", (n) => {
|
|
4605
4713
|
n.key === "Enter" ? (n.preventDefault(), s()) : n.key === "Escape" && (n.stopPropagation(), this.renderPhCtxButtons());
|
|
@@ -4625,8 +4733,8 @@ let ji = (j = class {
|
|
|
4625
4733
|
s && (s.textContent = this.t("uploading")), this.imageUploadHandler(t).then((n) => {
|
|
4626
4734
|
this.ed.contains(e) && this.replacePlaceholderWithImage(e, n, i);
|
|
4627
4735
|
}).catch((n) => {
|
|
4628
|
-
var
|
|
4629
|
-
this.ed.contains(e) && (e.classList.remove("uploading"), e.classList.add("upload-error"), s && (s.textContent = this.t("uploadfailed")), (
|
|
4736
|
+
var l;
|
|
4737
|
+
this.ed.contains(e) && (e.classList.remove("uploading"), e.classList.add("upload-error"), s && (s.textContent = this.t("uploadfailed")), (l = this.onImageUploadError) == null || l.call(this, n, t));
|
|
4630
4738
|
});
|
|
4631
4739
|
}
|
|
4632
4740
|
replacePlaceholderWithImage(t, e, i) {
|
|
@@ -4664,8 +4772,8 @@ let ji = (j = class {
|
|
|
4664
4772
|
if (!this.ed.contains(t) || t.closest(".tpl-media") || t.getAttribute("width") || t.getAttribute("height") || t.style.width || t.style.height) return i(!1);
|
|
4665
4773
|
const n = t.naturalWidth;
|
|
4666
4774
|
if (!n) return i(!1);
|
|
4667
|
-
const
|
|
4668
|
-
t.setAttribute("width", String(
|
|
4775
|
+
const l = this.contentWidth(), r = Math.round(l > 0 ? Math.min(n, l) : n);
|
|
4776
|
+
t.setAttribute("width", String(r)), t.style.width = r + "px", t.style.height = "auto", i(!0);
|
|
4669
4777
|
};
|
|
4670
4778
|
t.complete && t.naturalWidth ? s() : (t.addEventListener("load", s, { once: !0 }), t.addEventListener("error", () => i(!1), { once: !0 }));
|
|
4671
4779
|
}
|
|
@@ -4740,20 +4848,20 @@ let ji = (j = class {
|
|
|
4740
4848
|
const i = document.createElement("button");
|
|
4741
4849
|
i.type = "button", i.className = "txtbtn", i.textContent = this.t("insertvideo");
|
|
4742
4850
|
const s = () => {
|
|
4743
|
-
const n = e.value.trim(),
|
|
4744
|
-
if (!
|
|
4851
|
+
const n = e.value.trim(), l = this.vphActive;
|
|
4852
|
+
if (!l) return;
|
|
4745
4853
|
if (!/^(https?:|data:video\/|blob:)/i.test(n)) {
|
|
4746
4854
|
e.classList.add("err"), e.focus();
|
|
4747
4855
|
return;
|
|
4748
4856
|
}
|
|
4749
|
-
const
|
|
4750
|
-
if (
|
|
4751
|
-
this.replacePlaceholderWithEmbed(
|
|
4857
|
+
const r = this.videoEmbedUrl(n);
|
|
4858
|
+
if (r) {
|
|
4859
|
+
this.replacePlaceholderWithEmbed(l, r);
|
|
4752
4860
|
return;
|
|
4753
4861
|
}
|
|
4754
4862
|
i.disabled = !0, e.disabled = !0;
|
|
4755
4863
|
const o = document.createElement("video");
|
|
4756
|
-
o.preload = "metadata", o.onloadedmetadata = () => this.replacePlaceholderWithVideo(
|
|
4864
|
+
o.preload = "metadata", o.onloadedmetadata = () => this.replacePlaceholderWithVideo(l, n, ""), o.onerror = () => {
|
|
4757
4865
|
i.disabled = !1, e.disabled = !1, e.classList.add("err"), e.focus();
|
|
4758
4866
|
}, o.src = n;
|
|
4759
4867
|
};
|
|
@@ -4781,8 +4889,8 @@ let ji = (j = class {
|
|
|
4781
4889
|
s && (s.textContent = this.t("uploading")), this.videoUploadHandler(t).then((n) => {
|
|
4782
4890
|
this.ed.contains(e) && this.replacePlaceholderWithVideo(e, n, i);
|
|
4783
4891
|
}).catch((n) => {
|
|
4784
|
-
var
|
|
4785
|
-
this.ed.contains(e) && (e.classList.remove("uploading"), e.classList.add("upload-error"), s && (s.textContent = this.t("uploadfailed")), (
|
|
4892
|
+
var l;
|
|
4893
|
+
this.ed.contains(e) && (e.classList.remove("uploading"), e.classList.add("upload-error"), s && (s.textContent = this.t("uploadfailed")), (l = this.onVideoUploadError) == null || l.call(this, n, t));
|
|
4786
4894
|
});
|
|
4787
4895
|
}
|
|
4788
4896
|
replacePlaceholderWithVideo(t, e, i) {
|
|
@@ -4821,19 +4929,19 @@ let ji = (j = class {
|
|
|
4821
4929
|
const e = document.createElement("div");
|
|
4822
4930
|
e.className = "imgctx", e.dir = this.dir();
|
|
4823
4931
|
const i = () => {
|
|
4824
|
-
var
|
|
4932
|
+
var u;
|
|
4825
4933
|
const a = this.buildVideoCtxToolbar(t);
|
|
4826
|
-
(
|
|
4934
|
+
(u = this.vidCtx) == null || u.replaceWith(a), this.vidCtx = a, this.positionVidCtx();
|
|
4827
4935
|
}, s = (a) => {
|
|
4828
4936
|
this.setVideoAlign(t, a), i();
|
|
4829
|
-
}, n = t.style.float === "left",
|
|
4830
|
-
const
|
|
4831
|
-
return
|
|
4937
|
+
}, n = t.style.float === "left", l = t.style.float === "right", r = !n && !l && t.style.marginLeft === "auto" && t.style.marginRight === "auto", o = (a, u, p, m) => {
|
|
4938
|
+
const v = this.ctxBtn(a, u, m);
|
|
4939
|
+
return v.classList.toggle("on", p), v;
|
|
4832
4940
|
};
|
|
4833
4941
|
return e.append(
|
|
4834
4942
|
o(h.alignleft, this.t("alignleft"), n, () => s("left")),
|
|
4835
|
-
o(h.aligncenter, this.t("aligncenter"),
|
|
4836
|
-
o(h.alignright, this.t("alignright"),
|
|
4943
|
+
o(h.aligncenter, this.t("aligncenter"), r, () => s("center")),
|
|
4944
|
+
o(h.alignright, this.t("alignright"), l, () => s("right")),
|
|
4837
4945
|
this.ctxSep(),
|
|
4838
4946
|
o(h.trash, this.t("deletevideo"), !1, () => {
|
|
4839
4947
|
t.remove(), this.clearVidHandles(), this.onChange();
|
|
@@ -4875,12 +4983,12 @@ let ji = (j = class {
|
|
|
4875
4983
|
* (videoUploadHandler when configured, else inline base64). */
|
|
4876
4984
|
videoDlg() {
|
|
4877
4985
|
this.saveSel();
|
|
4878
|
-
let t, e, i, s, n,
|
|
4879
|
-
const
|
|
4986
|
+
let t, e, i, s, n, l;
|
|
4987
|
+
const r = (a, u) => {
|
|
4880
4988
|
const p = document.createElement("div");
|
|
4881
4989
|
p.className = "dfield";
|
|
4882
4990
|
const m = document.createElement("label");
|
|
4883
|
-
return m.textContent = this.t(a), p.append(m,
|
|
4991
|
+
return m.textContent = this.t(a), p.append(m, u), p;
|
|
4884
4992
|
}, o = () => {
|
|
4885
4993
|
const a = document.createElement("input");
|
|
4886
4994
|
return a.type = "url", a;
|
|
@@ -4888,55 +4996,55 @@ let ji = (j = class {
|
|
|
4888
4996
|
this.dialog(
|
|
4889
4997
|
this.t("videodlgttl"),
|
|
4890
4998
|
(a) => {
|
|
4891
|
-
const
|
|
4892
|
-
|
|
4893
|
-
const p = [], m = (
|
|
4894
|
-
const
|
|
4895
|
-
|
|
4999
|
+
const u = document.createElement("div");
|
|
5000
|
+
u.className = "dtabs";
|
|
5001
|
+
const p = [], m = (f, y) => {
|
|
5002
|
+
const C = document.createElement("button");
|
|
5003
|
+
C.type = "button", C.textContent = this.t(f);
|
|
4896
5004
|
const E = document.createElement("div");
|
|
4897
|
-
E.className = "dtabpanel",
|
|
5005
|
+
E.className = "dtabpanel", y(E);
|
|
4898
5006
|
const I = p.length;
|
|
4899
|
-
p.push(E),
|
|
4900
|
-
},
|
|
4901
|
-
|
|
5007
|
+
p.push(E), C.addEventListener("click", () => v(I)), u.appendChild(C);
|
|
5008
|
+
}, v = (f) => {
|
|
5009
|
+
u.querySelectorAll("button").forEach((y, C) => y.classList.toggle("on", C === f)), p.forEach((y, C) => y.style.display = C === f ? "" : "none");
|
|
4902
5010
|
};
|
|
4903
|
-
m("vidgeneral", (
|
|
5011
|
+
m("vidgeneral", (f) => {
|
|
4904
5012
|
t = o(), t.placeholder = this.t("videourlph");
|
|
4905
|
-
const
|
|
4906
|
-
|
|
4907
|
-
const
|
|
4908
|
-
|
|
5013
|
+
const y = document.createElement("div");
|
|
5014
|
+
y.className = "drow";
|
|
5015
|
+
const C = document.createElement("button");
|
|
5016
|
+
C.type = "button", C.className = "txtbtn", C.textContent = this.t("uploadvideo");
|
|
4909
5017
|
const E = document.createElement("input");
|
|
4910
|
-
E.type = "file", E.accept = this.options.videoFileTypes.join(","), E.style.display = "none",
|
|
5018
|
+
E.type = "file", E.accept = this.options.videoFileTypes.join(","), E.style.display = "none", C.addEventListener("click", () => {
|
|
4911
5019
|
E.value = "", E.click();
|
|
4912
5020
|
}), E.addEventListener("change", () => {
|
|
4913
|
-
var
|
|
4914
|
-
const A = (
|
|
5021
|
+
var F;
|
|
5022
|
+
const A = (F = E.files) == null ? void 0 : F[0];
|
|
4915
5023
|
if (!A) return;
|
|
4916
|
-
|
|
4917
|
-
const $ = (
|
|
4918
|
-
t.value =
|
|
5024
|
+
C.disabled = !0, C.textContent = this.t("uploading");
|
|
5025
|
+
const $ = (Z) => {
|
|
5026
|
+
t.value = Z, C.disabled = !1, C.textContent = this.t("uploadvideo");
|
|
4919
5027
|
};
|
|
4920
5028
|
if (this.videoUploadHandler)
|
|
4921
|
-
this.videoUploadHandler(A).then($).catch((
|
|
5029
|
+
this.videoUploadHandler(A).then($).catch((Z) => {
|
|
4922
5030
|
var et;
|
|
4923
|
-
|
|
5031
|
+
C.disabled = !1, C.textContent = this.t("uploadfailed"), (et = this.onVideoUploadError) == null || et.call(this, Z, A);
|
|
4924
5032
|
});
|
|
4925
5033
|
else {
|
|
4926
|
-
const
|
|
4927
|
-
|
|
5034
|
+
const Z = new FileReader();
|
|
5035
|
+
Z.onload = () => $(Z.result), Z.readAsDataURL(A);
|
|
4928
5036
|
}
|
|
4929
|
-
}),
|
|
5037
|
+
}), y.append(t, C, E), t.style.flex = "1", f.appendChild(r("vidsource", y));
|
|
4930
5038
|
const I = document.createElement("div");
|
|
4931
|
-
I.className = "drow", e = document.createElement("input"), e.type = "number", e.value = "560", i = document.createElement("input"), i.type = "number", i.value = "314", I.append(
|
|
4932
|
-
}), m("vidembed", (
|
|
4933
|
-
const
|
|
4934
|
-
|
|
4935
|
-
}), m("vidadvanced", (
|
|
4936
|
-
n = o(),
|
|
5039
|
+
I.className = "drow", e = document.createElement("input"), e.type = "number", e.value = "560", i = document.createElement("input"), i.type = "number", i.value = "314", I.append(r("tblwidth", e), r("tblheight", i)), f.appendChild(I);
|
|
5040
|
+
}), m("vidembed", (f) => {
|
|
5041
|
+
const y = document.createElement("p");
|
|
5042
|
+
y.textContent = this.t("vidembedhint"), y.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", f.append(y, s);
|
|
5043
|
+
}), m("vidadvanced", (f) => {
|
|
5044
|
+
n = o(), l = o(), f.append(r("vidaltsource", n), r("vidposter", l));
|
|
4937
5045
|
});
|
|
4938
|
-
const
|
|
4939
|
-
|
|
5046
|
+
const b = document.createElement("div");
|
|
5047
|
+
b.className = "dtabbody", p.forEach((f) => b.appendChild(f)), a.append(u, b), v(0), setTimeout(() => t.focus(), 0);
|
|
4940
5048
|
},
|
|
4941
5049
|
[
|
|
4942
5050
|
{ label: this.t("cancel"), action: () => this.closeDlg() },
|
|
@@ -4944,21 +5052,21 @@ let ji = (j = class {
|
|
|
4944
5052
|
label: this.t("save"),
|
|
4945
5053
|
primary: !0,
|
|
4946
5054
|
action: () => {
|
|
4947
|
-
const a = s.value.trim(),
|
|
4948
|
-
if (this.closeDlg(), !a && !
|
|
5055
|
+
const a = s.value.trim(), u = t.value.trim(), p = parseInt(e.value, 10) || 560, m = parseInt(i.value, 10) || 314;
|
|
5056
|
+
if (this.closeDlg(), !a && !u) return;
|
|
4949
5057
|
if (this.restoreSel(), a) {
|
|
4950
5058
|
document.execCommand("insertHTML", !1, `<span class="video-embed" contenteditable="false">${a}</span>`), this.onChange();
|
|
4951
5059
|
return;
|
|
4952
5060
|
}
|
|
4953
|
-
const
|
|
4954
|
-
if (
|
|
4955
|
-
document.execCommand("insertHTML", !1, this.videoEmbedHTML(
|
|
5061
|
+
const v = this.videoEmbedUrl(u);
|
|
5062
|
+
if (v)
|
|
5063
|
+
document.execCommand("insertHTML", !1, this.videoEmbedHTML(v, p, m));
|
|
4956
5064
|
else {
|
|
4957
|
-
const
|
|
5065
|
+
const b = n.value.trim(), f = l.value.trim();
|
|
4958
5066
|
document.execCommand(
|
|
4959
5067
|
"insertHTML",
|
|
4960
5068
|
!1,
|
|
4961
|
-
`<video controls width="${p}" height="${m}"${
|
|
5069
|
+
`<video controls width="${p}" height="${m}"${f ? ` poster="${this.escapeAttr(f)}"` : ""}><source src="${this.escapeAttr(u)}">${b ? `<source src="${this.escapeAttr(b)}">` : ""}</video>`
|
|
4962
5070
|
);
|
|
4963
5071
|
}
|
|
4964
5072
|
this.onChange();
|
|
@@ -5009,20 +5117,20 @@ let ji = (j = class {
|
|
|
5009
5117
|
/** Typing `snippet` converts to an inline <code> run the moment the closing
|
|
5010
5118
|
* backtick is typed, so code can be marked up without reaching for the toolbar. */
|
|
5011
5119
|
tryCodeTyping(t) {
|
|
5012
|
-
var
|
|
5120
|
+
var u;
|
|
5013
5121
|
const e = window.getSelection();
|
|
5014
5122
|
if (!e || !e.isCollapsed || !e.anchorNode) return;
|
|
5015
5123
|
const i = e.anchorNode;
|
|
5016
|
-
if (i.nodeType !== Node.TEXT_NODE || !this.ed.contains(i) || (
|
|
5124
|
+
if (i.nodeType !== Node.TEXT_NODE || !this.ed.contains(i) || (u = i.parentElement) != null && u.closest("code, pre")) return;
|
|
5017
5125
|
const n = (i.textContent || "").slice(0, e.anchorOffset).match(/(?:^|[^`])`([^`]+)$/);
|
|
5018
5126
|
if (!n) return;
|
|
5019
|
-
const
|
|
5020
|
-
if (/^\s|\s$/.test(
|
|
5127
|
+
const l = n[1];
|
|
5128
|
+
if (/^\s|\s$/.test(l)) return;
|
|
5021
5129
|
t.preventDefault();
|
|
5022
|
-
const
|
|
5023
|
-
|
|
5130
|
+
const r = document.createRange();
|
|
5131
|
+
r.setStart(i, e.anchorOffset - l.length - 1), r.setEnd(i, e.anchorOffset), r.deleteContents();
|
|
5024
5132
|
const o = document.createElement("code");
|
|
5025
|
-
o.textContent =
|
|
5133
|
+
o.textContent = l, r.insertNode(o);
|
|
5026
5134
|
const a = document.createRange();
|
|
5027
5135
|
a.setStartAfter(o), a.collapse(!0), e.removeAllRanges(), e.addRange(a), this.saveSel(), this.onChange();
|
|
5028
5136
|
}
|
|
@@ -5036,22 +5144,22 @@ let ji = (j = class {
|
|
|
5036
5144
|
s.className = "dsel";
|
|
5037
5145
|
const n = document.createElement("button");
|
|
5038
5146
|
n.type = "button", n.className = "dsel-btn";
|
|
5039
|
-
const
|
|
5040
|
-
|
|
5041
|
-
const
|
|
5042
|
-
return
|
|
5147
|
+
const l = document.createElement("span");
|
|
5148
|
+
l.className = "lbl", l.textContent = ((o = t.find(([a]) => a === e)) == null ? void 0 : o[1]) || "", n.append(l), n.insertAdjacentHTML("beforeend", h.chev);
|
|
5149
|
+
const r = document.createElement("div");
|
|
5150
|
+
return r.className = "dsel-list", t.forEach(([a, u]) => {
|
|
5043
5151
|
const p = document.createElement("button");
|
|
5044
|
-
p.type = "button", p.textContent =
|
|
5045
|
-
i = a,
|
|
5046
|
-
}),
|
|
5152
|
+
p.type = "button", p.textContent = u, p.classList.toggle("on", a === i), p.addEventListener("click", () => {
|
|
5153
|
+
i = a, l.textContent = u, r.querySelectorAll("button").forEach((m) => m.classList.toggle("on", m === p)), s.classList.remove("open"), n.focus();
|
|
5154
|
+
}), r.appendChild(p);
|
|
5047
5155
|
}), n.addEventListener("click", () => {
|
|
5048
5156
|
var a;
|
|
5049
|
-
s.classList.toggle("open"), s.classList.contains("open") && ((a =
|
|
5157
|
+
s.classList.toggle("open"), s.classList.contains("open") && ((a = r.querySelector(".on")) == null || a.scrollIntoView({ block: "nearest" }));
|
|
5050
5158
|
}), s.addEventListener("focusout", (a) => {
|
|
5051
5159
|
s.contains(a.relatedTarget) || s.classList.remove("open");
|
|
5052
5160
|
}), s.addEventListener("keydown", (a) => {
|
|
5053
5161
|
a.key === "Escape" && s.classList.contains("open") && (a.stopPropagation(), s.classList.remove("open"), n.focus());
|
|
5054
|
-
}), s.append(n,
|
|
5162
|
+
}), s.append(n, r), { el: s, value: () => i };
|
|
5055
5163
|
}
|
|
5056
5164
|
/** Insert/edit-code-sample dialog: language dropdown + monospace textarea to
|
|
5057
5165
|
* paste or type code into. Inserts a non-editable <pre class="code-block">
|
|
@@ -5062,11 +5170,11 @@ let ji = (j = class {
|
|
|
5062
5170
|
this.dialog(
|
|
5063
5171
|
this.t("codedlgttl"),
|
|
5064
5172
|
(s) => {
|
|
5065
|
-
var
|
|
5173
|
+
var r;
|
|
5066
5174
|
const n = document.createElement("div");
|
|
5067
5175
|
n.className = "dfield";
|
|
5068
|
-
const
|
|
5069
|
-
|
|
5176
|
+
const l = document.createElement("label");
|
|
5177
|
+
l.textContent = this.t("codelang"), e = this.dlgSelect(ne, (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);
|
|
5070
5178
|
},
|
|
5071
5179
|
[
|
|
5072
5180
|
{ label: this.t("cancel"), action: () => this.closeDlg() },
|
|
@@ -5074,11 +5182,11 @@ let ji = (j = class {
|
|
|
5074
5182
|
label: this.t("save"),
|
|
5075
5183
|
primary: !0,
|
|
5076
5184
|
action: () => {
|
|
5077
|
-
var
|
|
5078
|
-
const s = i.value.replace(/\s+$/, ""), n = e.value(),
|
|
5185
|
+
var r;
|
|
5186
|
+
const s = i.value.replace(/\s+$/, ""), n = e.value(), l = ((r = ne.find(([o]) => o === n)) == null ? void 0 : r[1]) || n;
|
|
5079
5187
|
if (this.closeDlg(), !!s.trim()) {
|
|
5080
5188
|
if (t) {
|
|
5081
|
-
t.dataset.lang = n, t.setAttribute("data-lang-label",
|
|
5189
|
+
t.dataset.lang = n, t.setAttribute("data-lang-label", l);
|
|
5082
5190
|
const o = t.querySelector("code") || t;
|
|
5083
5191
|
o.textContent = s, this.clearCodeSel(), this.onChange();
|
|
5084
5192
|
return;
|
|
@@ -5086,7 +5194,7 @@ let ji = (j = class {
|
|
|
5086
5194
|
this.restoreSel(), document.execCommand(
|
|
5087
5195
|
"insertHTML",
|
|
5088
5196
|
!1,
|
|
5089
|
-
`<pre class="code-block" contenteditable="false" data-lang="${n}" data-lang-label="${this.escapeAttr(
|
|
5197
|
+
`<pre class="code-block" contenteditable="false" data-lang="${n}" data-lang-label="${this.escapeAttr(l)}"><code>${this.escHtml(s)}</code></pre><p><br></p>`
|
|
5090
5198
|
), this.onChange();
|
|
5091
5199
|
}
|
|
5092
5200
|
}
|
|
@@ -5143,14 +5251,14 @@ let ji = (j = class {
|
|
|
5143
5251
|
/** Miniature div-based mockup of a layout, mirroring what the block looks
|
|
5144
5252
|
like in the editor: grey box = image slot, bars = heading/paragraph. */
|
|
5145
5253
|
tplPreviewHTML(t) {
|
|
5146
|
-
const e = '<span class="pv-img"></span>', i = '<span class="pv-h"></span>', s = (o) => `<span class="pv-l" style="width:${o}%"></span>`, n = (o) => `<span class="pv-col">${o}</span>`,
|
|
5147
|
-
return t === "img-left" ? `<span class="pv">${
|
|
5254
|
+
const e = '<span class="pv-img"></span>', i = '<span class="pv-h"></span>', s = (o) => `<span class="pv-l" style="width:${o}%"></span>`, n = (o) => `<span class="pv-col">${o}</span>`, l = (o) => `<span class="pv-row">${o}</span>`, r = n(i + s(100) + s(88));
|
|
5255
|
+
return t === "img-left" ? `<span class="pv">${l(e + r)}${s(100)}${s(72)}</span>` : t === "img-right" ? `<span class="pv">${l(r + e)}${s(100)}${s(72)}</span>` : t === "img-top" ? `<span class="pv pv-c">${e}${i}${s(100)}${s(72)}</span>` : `<span class="pv pv-c">${i}${s(100)}${s(72)}${e}</span>`;
|
|
5148
5256
|
}
|
|
5149
5257
|
buildTemplatePickInto(t, e) {
|
|
5150
5258
|
const i = document.createElement("div");
|
|
5151
|
-
i.className = "tplpick",
|
|
5259
|
+
i.className = "tplpick", Et.forEach((s) => {
|
|
5152
5260
|
const n = document.createElement("button");
|
|
5153
|
-
n.type = "button", n.className = "tpltile", n.title = this.t(
|
|
5261
|
+
n.type = "button", n.className = "tpltile", n.title = this.t(St[s]), n.innerHTML = this.tplPreviewHTML(s) + `<span class="tpllbl">${this.t(St[s])}</span>`, n.addEventListener("click", () => {
|
|
5154
5262
|
this.closePop(), this.insertTemplate(s), e == null || e();
|
|
5155
5263
|
}), i.appendChild(n);
|
|
5156
5264
|
}), t.appendChild(i);
|
|
@@ -5169,15 +5277,15 @@ let ji = (j = class {
|
|
|
5169
5277
|
}
|
|
5170
5278
|
renderTplCtxButtons() {
|
|
5171
5279
|
const t = this.tplCtx, e = this.tplActive;
|
|
5172
|
-
!t || !e || (t.innerHTML = "",
|
|
5173
|
-
const s = this.ctxBtn(
|
|
5280
|
+
!t || !e || (t.innerHTML = "", Et.forEach((i) => {
|
|
5281
|
+
const s = this.ctxBtn(Zi[i], this.t(St[i]), () => this.setTplLayout(i));
|
|
5174
5282
|
s.classList.toggle("on", e.classList.contains("tpl-" + i)), t.appendChild(s);
|
|
5175
5283
|
}), t.append(this.ctxSep(), this.ctxBtn(h.trash, this.t("deltemplate"), () => this.removeTemplate())), this.positionTplCtx());
|
|
5176
5284
|
}
|
|
5177
5285
|
setTplLayout(t) {
|
|
5178
5286
|
const e = this.tplActive;
|
|
5179
5287
|
if (!e) return;
|
|
5180
|
-
|
|
5288
|
+
Et.forEach((n) => e.classList.remove("tpl-" + n)), e.classList.add("tpl-" + t);
|
|
5181
5289
|
const i = e.querySelector(":scope > .tpl-media"), s = e.querySelector(":scope > .tpl-text");
|
|
5182
5290
|
i && s && (t === "img-center" ? e.appendChild(i) : e.insertBefore(i, s)), this.renderTplCtxButtons(), this.positionImgPhCtx(), this.positionImageHandles(), this.onChange();
|
|
5183
5291
|
}
|
|
@@ -5209,7 +5317,7 @@ let ji = (j = class {
|
|
|
5209
5317
|
/* ---------------------------------------------------------- table resize */
|
|
5210
5318
|
clearTableHandles() {
|
|
5211
5319
|
var t, e, i, s, n;
|
|
5212
|
-
(t = this.tblCorner) == null || t.remove(), this.tblCorner = null, this.tblColBars.forEach((
|
|
5320
|
+
(t = this.tblCorner) == null || t.remove(), this.tblCorner = null, this.tblColBars.forEach((l) => l.remove()), this.tblColBars = [], (e = this.tblCtx) == null || e.remove(), this.tblCtx = null, (i = this.tblCellMark) == null || i.remove(), this.tblCellMark = null, (s = this.tblOpMark) == null || s.remove(), this.tblOpMark = null, this.tblOpMarkKind = null, (n = this.tblActive) == null || n.classList.remove("tbl-selected"), this.tblActive = null;
|
|
5213
5321
|
}
|
|
5214
5322
|
/** Blue outline around the cell that holds the caret, so it is clear
|
|
5215
5323
|
which cell / row / column the table operations will target. */
|
|
@@ -5229,15 +5337,15 @@ let ji = (j = class {
|
|
|
5229
5337
|
this.tblOpMarkKind = t, this.positionOpMark();
|
|
5230
5338
|
}
|
|
5231
5339
|
positionOpMark() {
|
|
5232
|
-
var
|
|
5340
|
+
var u;
|
|
5233
5341
|
const t = this.tblOpMarkKind, e = t ? this.currentCell() : null;
|
|
5234
5342
|
if (!t || !e || !this.tblActive || e.closest("table") !== this.tblActive) {
|
|
5235
|
-
(
|
|
5343
|
+
(u = this.tblOpMark) == null || u.remove(), this.tblOpMark = null;
|
|
5236
5344
|
return;
|
|
5237
5345
|
}
|
|
5238
5346
|
this.tblOpMark || (this.tblOpMark = document.createElement("div"), this.tblOpMark.className = "tbl-opmark", document.body.appendChild(this.tblOpMark));
|
|
5239
|
-
const i = this.tblActive.getBoundingClientRect(), s = e.getBoundingClientRect(), n = e.parentElement.getBoundingClientRect(),
|
|
5240
|
-
this.tblOpMark.style.left =
|
|
5347
|
+
const i = this.tblActive.getBoundingClientRect(), s = e.getBoundingClientRect(), n = e.parentElement.getBoundingClientRect(), l = t === "row" ? n.left : s.left, r = t === "row" ? n.top : i.top, o = t === "row" ? n.width : s.width, a = t === "row" ? n.height : i.height;
|
|
5348
|
+
this.tblOpMark.style.left = l + scrollX + "px", this.tblOpMark.style.top = r + scrollY + "px", this.tblOpMark.style.width = o + "px", this.tblOpMark.style.height = a + "px";
|
|
5241
5349
|
}
|
|
5242
5350
|
/** Lowest allowed top for floating context toolbars — keeps them from
|
|
5243
5351
|
covering the editor menubar/toolbar when the target sits on the first line. */
|
|
@@ -5246,7 +5354,7 @@ let ji = (j = class {
|
|
|
5246
5354
|
}
|
|
5247
5355
|
ctxBtn(t, e, i, s) {
|
|
5248
5356
|
const n = document.createElement("button");
|
|
5249
|
-
return n.type = "button", n.title = e, n.innerHTML = t, s && (n.dataset.id = s), n.addEventListener("mousedown", (
|
|
5357
|
+
return n.type = "button", n.title = e, n.innerHTML = t, s && (n.dataset.id = s), n.addEventListener("mousedown", (l) => l.preventDefault()), n.addEventListener("click", i), n;
|
|
5250
5358
|
}
|
|
5251
5359
|
ctxSep() {
|
|
5252
5360
|
const t = document.createElement("div");
|
|
@@ -5283,20 +5391,20 @@ let ji = (j = class {
|
|
|
5283
5391
|
this.clearTableHandles();
|
|
5284
5392
|
return;
|
|
5285
5393
|
}
|
|
5286
|
-
const t = this.ed.getAttribute("dir") === "rtl", e = this.tblActive.getBoundingClientRect(), i = e.top + scrollY, s = e.left + scrollX, n = e.right + scrollX,
|
|
5287
|
-
if (this.tblCorner && (this.tblCorner.style.top =
|
|
5394
|
+
const t = this.ed.getAttribute("dir") === "rtl", e = this.tblActive.getBoundingClientRect(), i = e.top + scrollY, s = e.left + scrollX, n = e.right + scrollX, l = e.bottom + scrollY;
|
|
5395
|
+
if (this.tblCorner && (this.tblCorner.style.top = l - 5 + "px", this.tblCorner.style.left = (t ? s - 5 : n - 5) + "px", this.tblCorner.style.cursor = t ? "nesw-resize" : "nwse-resize"), this.tblCtx) {
|
|
5288
5396
|
const o = this.tblCtx.offsetWidth, a = this.tblCtx.offsetHeight;
|
|
5289
|
-
let
|
|
5290
|
-
|
|
5397
|
+
let u = s + (n - s) / 2 - o / 2;
|
|
5398
|
+
u = Math.max(8 + scrollX, Math.min(u, scrollX + innerWidth - o - 8));
|
|
5291
5399
|
let p = i - a - 8;
|
|
5292
|
-
p < this.ctxMinTop() && (p =
|
|
5400
|
+
p < this.ctxMinTop() && (p = l + 8), this.tblCtx.style.left = u + "px", this.tblCtx.style.top = p + "px";
|
|
5293
5401
|
}
|
|
5294
5402
|
this.tblColBars.forEach((o) => o.remove()), this.tblColBars = [];
|
|
5295
|
-
const
|
|
5296
|
-
if (
|
|
5297
|
-
for (let o = 0; o <
|
|
5298
|
-
const a =
|
|
5299
|
-
p.className = "tbl-colbar", p.style.top = i + "px", p.style.left =
|
|
5403
|
+
const r = this.tblActive.rows[0];
|
|
5404
|
+
if (r)
|
|
5405
|
+
for (let o = 0; o < r.cells.length - 1; o++) {
|
|
5406
|
+
const a = r.cells[o].getBoundingClientRect(), u = (t ? a.left : a.right) + scrollX, p = document.createElement("div");
|
|
5407
|
+
p.className = "tbl-colbar", p.style.top = i + "px", p.style.left = u + "px", p.style.height = l - i + "px", document.body.appendChild(p), p.addEventListener("mousedown", (m) => this.startColBarDrag(m, o)), this.tblColBars.push(p);
|
|
5300
5408
|
}
|
|
5301
5409
|
this.positionCellMarker(), this.positionOpMark();
|
|
5302
5410
|
}
|
|
@@ -5314,31 +5422,31 @@ let ji = (j = class {
|
|
|
5314
5422
|
const e = this.tblActive;
|
|
5315
5423
|
if (!e) return;
|
|
5316
5424
|
const i = this.ed.getAttribute("dir") === "rtl", s = t.clientX, n = e.getBoundingClientRect().width;
|
|
5317
|
-
e.style.tableLayout = e.style.tableLayout || "fixed", this.withNoTextSelect((
|
|
5318
|
-
const
|
|
5319
|
-
const
|
|
5320
|
-
e.style.width = Math.max(60, Math.round(n +
|
|
5425
|
+
e.style.tableLayout = e.style.tableLayout || "fixed", this.withNoTextSelect((l) => {
|
|
5426
|
+
const r = (a) => {
|
|
5427
|
+
const u = i ? -(a.clientX - s) : a.clientX - s;
|
|
5428
|
+
e.style.width = Math.max(60, Math.round(n + u)) + "px", this.positionTableHandles();
|
|
5321
5429
|
}, o = () => {
|
|
5322
|
-
window.removeEventListener("mousemove",
|
|
5430
|
+
window.removeEventListener("mousemove", r), window.removeEventListener("mouseup", o), l(), this.onChange();
|
|
5323
5431
|
};
|
|
5324
|
-
window.addEventListener("mousemove",
|
|
5432
|
+
window.addEventListener("mousemove", r), window.addEventListener("mouseup", o);
|
|
5325
5433
|
});
|
|
5326
5434
|
}
|
|
5327
5435
|
startColBarDrag(t, e) {
|
|
5328
5436
|
t.preventDefault(), t.stopPropagation();
|
|
5329
5437
|
const i = this.tblActive;
|
|
5330
5438
|
if (!i) return;
|
|
5331
|
-
const s = this.ed.getAttribute("dir") === "rtl", n = Array.from(i.rows),
|
|
5332
|
-
if (!
|
|
5333
|
-
const o = t.clientX, a =
|
|
5439
|
+
const s = this.ed.getAttribute("dir") === "rtl", n = Array.from(i.rows), l = n.map((p) => p.cells[e]).filter(Boolean), r = n.map((p) => p.cells[e + 1]).filter(Boolean);
|
|
5440
|
+
if (!l.length || !r.length) return;
|
|
5441
|
+
const o = t.clientX, a = l[0].getBoundingClientRect().width, u = r[0].getBoundingClientRect().width;
|
|
5334
5442
|
i.style.tableLayout = "fixed", this.withNoTextSelect((p) => {
|
|
5335
|
-
const m = (
|
|
5336
|
-
const
|
|
5337
|
-
|
|
5338
|
-
},
|
|
5339
|
-
window.removeEventListener("mousemove", m), window.removeEventListener("mouseup",
|
|
5443
|
+
const m = (b) => {
|
|
5444
|
+
const f = (s ? -1 : 1) * (b.clientX - o);
|
|
5445
|
+
l.forEach((y) => y.style.width = Math.max(24, Math.round(a + f)) + "px"), r.forEach((y) => y.style.width = Math.max(24, Math.round(u - f)) + "px"), this.positionTableHandles();
|
|
5446
|
+
}, v = () => {
|
|
5447
|
+
window.removeEventListener("mousemove", m), window.removeEventListener("mouseup", v), p(), this.onChange();
|
|
5340
5448
|
};
|
|
5341
|
-
window.addEventListener("mousemove", m), window.addEventListener("mouseup",
|
|
5449
|
+
window.addEventListener("mousemove", m), window.addEventListener("mouseup", v);
|
|
5342
5450
|
});
|
|
5343
5451
|
}
|
|
5344
5452
|
/* ---------------------------------------------------------- image toolbar / resize */
|
|
@@ -5353,7 +5461,7 @@ let ji = (j = class {
|
|
|
5353
5461
|
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;
|
|
5354
5462
|
}
|
|
5355
5463
|
selectImage(t) {
|
|
5356
|
-
this.imgActive !== t && (this.clearImageHandles(), this.imgActive = t, t.classList.add("img-selected"), this.imgHandles =
|
|
5464
|
+
this.imgActive !== t && (this.clearImageHandles(), this.imgActive = t, t.classList.add("img-selected"), this.imgHandles = Fi.map((e) => {
|
|
5357
5465
|
const i = document.createElement("div");
|
|
5358
5466
|
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;
|
|
5359
5467
|
}), this.imgCtx = this.buildImageCtxToolbar(t), this.positionImageHandles());
|
|
@@ -5362,19 +5470,19 @@ let ji = (j = class {
|
|
|
5362
5470
|
const e = document.createElement("div");
|
|
5363
5471
|
e.className = "imgctx", e.dir = this.dir();
|
|
5364
5472
|
const i = () => {
|
|
5365
|
-
var
|
|
5473
|
+
var u;
|
|
5366
5474
|
const a = this.buildImageCtxToolbar(t);
|
|
5367
|
-
(
|
|
5475
|
+
(u = this.imgCtx) == null || u.replaceWith(a), this.imgCtx = a, this.positionImageHandles();
|
|
5368
5476
|
}, s = (a) => {
|
|
5369
5477
|
this.setImageAlign(t, a), i();
|
|
5370
|
-
}, n = t.style.float === "left",
|
|
5371
|
-
const
|
|
5372
|
-
return
|
|
5478
|
+
}, n = t.style.float === "left", l = t.style.float === "right", r = !n && !l && t.style.marginLeft === "auto" && t.style.marginRight === "auto", o = (a, u, p, m) => {
|
|
5479
|
+
const v = this.ctxBtn(a, u, m);
|
|
5480
|
+
return v.classList.toggle("on", p), v;
|
|
5373
5481
|
};
|
|
5374
5482
|
return e.append(
|
|
5375
5483
|
o(h.alignleft, this.t("alignleft"), n, () => s("left")),
|
|
5376
|
-
o(h.aligncenter, this.t("aligncenter"),
|
|
5377
|
-
o(h.alignright, this.t("alignright"),
|
|
5484
|
+
o(h.aligncenter, this.t("aligncenter"), r, () => s("center")),
|
|
5485
|
+
o(h.alignright, this.t("alignright"), l, () => s("right")),
|
|
5378
5486
|
this.ctxSep(),
|
|
5379
5487
|
o(h.rotateleft, this.t("rotateleft"), !1, () => {
|
|
5380
5488
|
this.rotateImage(t, -90), i();
|
|
@@ -5416,21 +5524,21 @@ let ji = (j = class {
|
|
|
5416
5524
|
this.clearImageHandles();
|
|
5417
5525
|
return;
|
|
5418
5526
|
}
|
|
5419
|
-
const t = this.imgActive.getBoundingClientRect(), e = t.top + scrollY, i = t.left + scrollX, s = t.right + scrollX, n = t.bottom + scrollY,
|
|
5527
|
+
const t = this.imgActive.getBoundingClientRect(), e = t.top + scrollY, i = t.left + scrollX, s = t.right + scrollX, n = t.bottom + scrollY, l = {
|
|
5420
5528
|
nw: [i, e],
|
|
5421
5529
|
ne: [s, e],
|
|
5422
5530
|
sw: [i, n],
|
|
5423
5531
|
se: [s, n]
|
|
5424
5532
|
};
|
|
5425
|
-
if (this.imgHandles.forEach((
|
|
5426
|
-
const [o, a] = r
|
|
5427
|
-
|
|
5533
|
+
if (this.imgHandles.forEach((r) => {
|
|
5534
|
+
const [o, a] = l[r.dataset.corner];
|
|
5535
|
+
r.style.left = o - 5 + "px", r.style.top = a - 5 + "px";
|
|
5428
5536
|
}), this.imgCtx) {
|
|
5429
|
-
const
|
|
5430
|
-
let a = i + (s - i) / 2 -
|
|
5431
|
-
a = Math.max(8 + scrollX, Math.min(a, scrollX + innerWidth -
|
|
5432
|
-
let
|
|
5433
|
-
|
|
5537
|
+
const r = this.imgCtx.offsetWidth, o = this.imgCtx.offsetHeight;
|
|
5538
|
+
let a = i + (s - i) / 2 - r / 2;
|
|
5539
|
+
a = Math.max(8 + scrollX, Math.min(a, scrollX + innerWidth - r - 8));
|
|
5540
|
+
let u = e - o - 8;
|
|
5541
|
+
u < this.ctxMinTop() && (u = n + 8), this.imgCtx.style.left = a + "px", this.imgCtx.style.top = u + "px";
|
|
5434
5542
|
}
|
|
5435
5543
|
}
|
|
5436
5544
|
startImageResizeDrag(t, e) {
|
|
@@ -5438,14 +5546,14 @@ let ji = (j = class {
|
|
|
5438
5546
|
const i = this.imgActive;
|
|
5439
5547
|
if (!i) return;
|
|
5440
5548
|
this.cancelImgHide();
|
|
5441
|
-
const s = t.clientX, n = i.getBoundingClientRect().width,
|
|
5442
|
-
this.withNoTextSelect((
|
|
5443
|
-
const o = (
|
|
5444
|
-
i.style.width = Math.max(24, Math.round(n +
|
|
5549
|
+
const s = t.clientX, n = i.getBoundingClientRect().width, l = e === "nw" || e === "sw" ? -1 : 1;
|
|
5550
|
+
this.withNoTextSelect((r) => {
|
|
5551
|
+
const o = (u) => {
|
|
5552
|
+
i.style.width = Math.max(24, Math.round(n + l * (u.clientX - s))) + "px", i.style.height = "auto", this.positionImageHandles();
|
|
5445
5553
|
}, a = () => {
|
|
5446
|
-
window.removeEventListener("mousemove", o), window.removeEventListener("mouseup", a),
|
|
5447
|
-
const
|
|
5448
|
-
|
|
5554
|
+
window.removeEventListener("mousemove", o), window.removeEventListener("mouseup", a), r();
|
|
5555
|
+
const u = parseInt(i.style.width, 10);
|
|
5556
|
+
u > 0 && !i.closest(".tpl-media") && (i.setAttribute("width", String(u)), i.removeAttribute("height")), this.onChange();
|
|
5449
5557
|
};
|
|
5450
5558
|
window.addEventListener("mousemove", o), window.addEventListener("mouseup", a);
|
|
5451
5559
|
});
|
|
@@ -5486,7 +5594,7 @@ let ji = (j = class {
|
|
|
5486
5594
|
this.selCtx || (this.selCtx = this.buildSelToolbar()), this.positionSelToolbar(e);
|
|
5487
5595
|
}
|
|
5488
5596
|
buildSelToolbar() {
|
|
5489
|
-
var
|
|
5597
|
+
var r;
|
|
5490
5598
|
const t = document.createElement("div");
|
|
5491
5599
|
t.className = "selctx", t.dir = this.dir();
|
|
5492
5600
|
const e = this.ctxBtn(
|
|
@@ -5494,8 +5602,8 @@ let ji = (j = class {
|
|
|
5494
5602
|
this.t("forecolor"),
|
|
5495
5603
|
() => this.colorMenu(e, "fore")
|
|
5496
5604
|
), i = this.ctxBtn(h.backcolor, this.t("backcolor"), () => this.colorMenu(i, "back"));
|
|
5497
|
-
(
|
|
5498
|
-
const s = this.ctxBtn(h.caseic, this.t("changecase"), () => this.caseMenu(s)), n = this.ctxBtn(h.lineheight, this.t("lineheight"), () => this.lineHeightMenu(n)),
|
|
5605
|
+
(r = i.querySelector("svg")) == null || r.insertAdjacentHTML("afterend", '<span class="colorbar" data-cb="back"></span>');
|
|
5606
|
+
const s = this.ctxBtn(h.caseic, this.t("changecase"), () => this.caseMenu(s)), n = this.ctxBtn(h.lineheight, this.t("lineheight"), () => this.lineHeightMenu(n)), l = this.ctxBtn(h.wordspacing, this.t("wordspacing"), () => this.wordSpacingMenu(l));
|
|
5499
5607
|
return t.append(
|
|
5500
5608
|
this.ctxBtn(h.bold, this.t("bold"), () => this.exec("bold"), "bold"),
|
|
5501
5609
|
this.ctxBtn(h.italic, this.t("italic"), () => this.exec("italic"), "italic"),
|
|
@@ -5510,16 +5618,16 @@ let ji = (j = class {
|
|
|
5510
5618
|
this.ctxBtn(h.link, this.t("linkttl"), () => this.linkDlg()),
|
|
5511
5619
|
s,
|
|
5512
5620
|
n,
|
|
5513
|
-
|
|
5621
|
+
l
|
|
5514
5622
|
), t.addEventListener("mousedown", (o) => o.preventDefault()), document.body.appendChild(t), this.syncColorSwatches(t), t;
|
|
5515
5623
|
}
|
|
5516
5624
|
positionSelToolbar(t) {
|
|
5517
5625
|
if (!this.selCtx) return;
|
|
5518
|
-
const e = t.getBoundingClientRect(), i = e.top + scrollY, s = e.left + scrollX, n = e.right + scrollX,
|
|
5519
|
-
let a = s + (n - s) / 2 -
|
|
5520
|
-
a = Math.max(8 + scrollX, Math.min(a, scrollX + innerWidth -
|
|
5521
|
-
let
|
|
5522
|
-
|
|
5626
|
+
const e = t.getBoundingClientRect(), i = e.top + scrollY, s = e.left + scrollX, n = e.right + scrollX, l = e.bottom + scrollY, r = this.selCtx.offsetWidth, o = this.selCtx.offsetHeight;
|
|
5627
|
+
let a = s + (n - s) / 2 - r / 2;
|
|
5628
|
+
a = Math.max(8 + scrollX, Math.min(a, scrollX + innerWidth - r - 8));
|
|
5629
|
+
let u = i - o - 8;
|
|
5630
|
+
u < this.ctxMinTop() && (u = l + 8), this.selCtx.style.left = a + "px", this.selCtx.style.top = u + "px";
|
|
5523
5631
|
}
|
|
5524
5632
|
repositionSelToolbar() {
|
|
5525
5633
|
if (!this.selCtx) return;
|
|
@@ -5552,7 +5660,7 @@ let ji = (j = class {
|
|
|
5552
5660
|
return t > 0 ? t + "px" : "";
|
|
5553
5661
|
}
|
|
5554
5662
|
refreshState() {
|
|
5555
|
-
var o, a,
|
|
5663
|
+
var o, a, u;
|
|
5556
5664
|
const t = window.getSelection(), e = t ? this.ed.contains(t.anchorNode) : !1, i = this.currentBlock();
|
|
5557
5665
|
[this.toolbar, this.selCtx].filter(Boolean).forEach((p) => {
|
|
5558
5666
|
[
|
|
@@ -5566,23 +5674,23 @@ let ji = (j = class {
|
|
|
5566
5674
|
"justifyFull",
|
|
5567
5675
|
"insertOrderedList",
|
|
5568
5676
|
"insertUnorderedList"
|
|
5569
|
-
].forEach((
|
|
5570
|
-
const
|
|
5571
|
-
|
|
5572
|
-
}), ["h2", "h3", "blockquote"].forEach((
|
|
5573
|
-
const
|
|
5574
|
-
|
|
5677
|
+
].forEach((v) => {
|
|
5678
|
+
const b = p.querySelector(`[data-id=${v}]`);
|
|
5679
|
+
b && b.classList.toggle("on", e && document.queryCommandState(v));
|
|
5680
|
+
}), ["h2", "h3", "blockquote"].forEach((v) => {
|
|
5681
|
+
const b = p.querySelector(`[data-id=${v}]`);
|
|
5682
|
+
b && b.classList.toggle("on", e && i === v);
|
|
5575
5683
|
});
|
|
5576
5684
|
const m = p.querySelector("[data-id=code]");
|
|
5577
5685
|
m && m.classList.toggle("on", e && !!this.closestInlineCode());
|
|
5578
5686
|
});
|
|
5579
|
-
const n = t ? this.closestBlock(t.anchorNode) : null,
|
|
5580
|
-
(a = this.toolbar.querySelector("[data-id=ltr]")) == null || a.classList.toggle("on", e &&
|
|
5581
|
-
const
|
|
5582
|
-
const
|
|
5583
|
-
|
|
5687
|
+
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();
|
|
5688
|
+
(a = this.toolbar.querySelector("[data-id=ltr]")) == null || a.classList.toggle("on", e && l === "ltr"), (u = this.toolbar.querySelector("[data-id=rtl]")) == null || u.classList.toggle("on", e && l === "rtl");
|
|
5689
|
+
const r = (p, m, v) => {
|
|
5690
|
+
const b = this.toolbar.querySelector(`[data-id=${p}] .lbl`);
|
|
5691
|
+
b && (b.textContent = m || v || "", b.classList.toggle("empty", !m));
|
|
5584
5692
|
};
|
|
5585
|
-
|
|
5693
|
+
r("fontsel", this.currentFont()), r("sizesel", this.currentSize().replace("px", "")), e && r("blocksel", re.some((p) => p[0] === i) ? this.blockLabel(i) : this.t("para")), this.sbWords.textContent = this.countWords() + " " + this.t("words");
|
|
5586
5694
|
}
|
|
5587
5695
|
countWords() {
|
|
5588
5696
|
const t = (this.ed.textContent || "").trim();
|
|
@@ -5602,13 +5710,13 @@ let ji = (j = class {
|
|
|
5602
5710
|
return;
|
|
5603
5711
|
}
|
|
5604
5712
|
if (!i) {
|
|
5605
|
-
const n = e.getData("text/plain"),
|
|
5606
|
-
if (
|
|
5607
|
-
document.execCommand("insertHTML", !1, this.videoEmbedHTML(
|
|
5713
|
+
const n = e.getData("text/plain"), l = /^\S+$/.test(n.trim()) ? this.videoEmbedUrl(n.trim()) : null;
|
|
5714
|
+
if (l) {
|
|
5715
|
+
document.execCommand("insertHTML", !1, this.videoEmbedHTML(l)), this.onChange();
|
|
5608
5716
|
return;
|
|
5609
5717
|
}
|
|
5610
5718
|
}
|
|
5611
|
-
i ? this.pasteRichHTML(i, e, s) : (document.execCommand("insertHTML", !1,
|
|
5719
|
+
i ? this.pasteRichHTML(i, e, s) : (document.execCommand("insertHTML", !1, wi(e.getData("text/plain"))), this.onChange());
|
|
5612
5720
|
}
|
|
5613
5721
|
/** Rich-HTML paste. Before the (untouched) paste engine runs, pictures Word left
|
|
5614
5722
|
* behind as unreadable file:// refs are pulled out of the clipboard's RTF flavor
|
|
@@ -5620,19 +5728,19 @@ let ji = (j = class {
|
|
|
5620
5728
|
let s = [];
|
|
5621
5729
|
const n = e.getData("text/rtf");
|
|
5622
5730
|
if (n) {
|
|
5623
|
-
const
|
|
5624
|
-
t =
|
|
5731
|
+
const l = Ii(t, n);
|
|
5732
|
+
t = l.html, s = l.injected;
|
|
5625
5733
|
}
|
|
5626
|
-
if (i &&
|
|
5627
|
-
const
|
|
5628
|
-
if (
|
|
5629
|
-
const
|
|
5734
|
+
if (i && qi(t) === 1) {
|
|
5735
|
+
const l = i.getAsFile();
|
|
5736
|
+
if (l) {
|
|
5737
|
+
const r = t;
|
|
5630
5738
|
this.saveSel();
|
|
5631
5739
|
const o = new FileReader();
|
|
5632
5740
|
o.onload = () => {
|
|
5633
|
-
const a =
|
|
5741
|
+
const a = ve(r, [o.result]);
|
|
5634
5742
|
this.finishRichPaste(a.html, s.concat(a.injected), !0);
|
|
5635
|
-
}, o.onerror = () => this.finishRichPaste(
|
|
5743
|
+
}, o.onerror = () => this.finishRichPaste(r, s, !0), o.readAsDataURL(l);
|
|
5636
5744
|
return;
|
|
5637
5745
|
}
|
|
5638
5746
|
}
|
|
@@ -5646,126 +5754,126 @@ let ji = (j = class {
|
|
|
5646
5754
|
this.insertPastedHTML(t, i);
|
|
5647
5755
|
return;
|
|
5648
5756
|
}
|
|
5649
|
-
const s = this.imageUploadHandler, n = e.filter((
|
|
5757
|
+
const s = this.imageUploadHandler, n = e.filter((l, r) => e.indexOf(l) === r);
|
|
5650
5758
|
i || this.saveSel(), Promise.all(
|
|
5651
|
-
n.map((
|
|
5652
|
-
const o =
|
|
5759
|
+
n.map((l, r) => {
|
|
5760
|
+
const o = Ri(l, "pasted-image-" + (r + 1));
|
|
5653
5761
|
return o ? s(o).catch((a) => {
|
|
5654
|
-
var
|
|
5655
|
-
return (
|
|
5656
|
-
}) : Promise.resolve(
|
|
5762
|
+
var u;
|
|
5763
|
+
return (u = this.onImageUploadError) == null || u.call(this, a, o), l;
|
|
5764
|
+
}) : Promise.resolve(l);
|
|
5657
5765
|
})
|
|
5658
|
-
).then((
|
|
5659
|
-
let
|
|
5766
|
+
).then((l) => {
|
|
5767
|
+
let r = t;
|
|
5660
5768
|
n.forEach((o, a) => {
|
|
5661
|
-
|
|
5662
|
-
}), this.insertPastedHTML(
|
|
5769
|
+
l[a] !== o && (r = r.split(o).join(l[a]));
|
|
5770
|
+
}), this.insertPastedHTML(r, !0);
|
|
5663
5771
|
});
|
|
5664
5772
|
}
|
|
5665
5773
|
/** `deferred` means the insert is happening after an async hop, so the caret the
|
|
5666
5774
|
* paste started from has to be put back first. */
|
|
5667
5775
|
insertPastedHTML(t, e = !1) {
|
|
5668
|
-
e && this.restoreSel(), document.execCommand("insertHTML", !1,
|
|
5776
|
+
e && this.restoreSel(), document.execCommand("insertHTML", !1, Ci(t, this.dir())), e && this.saveSel(), this.onChange();
|
|
5669
5777
|
}
|
|
5670
5778
|
/* ---------------------------------------------------------- init */
|
|
5671
5779
|
initUI() {
|
|
5672
5780
|
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();
|
|
5673
5781
|
}
|
|
5674
5782
|
}, j.instanceCounter = 0, j.TBR_COLLAPSE_MAX = 992, j);
|
|
5675
|
-
const
|
|
5676
|
-
({ value:
|
|
5677
|
-
const o = z(null), a = z(null),
|
|
5678
|
-
return
|
|
5783
|
+
const ls = Ye(
|
|
5784
|
+
({ value: d, defaultValue: t, onChange: e, onReady: i, className: s, style: n, ...l }, r) => {
|
|
5785
|
+
const o = z(null), a = z(null), u = z(!1), p = z(d ?? t), m = z(null), v = z(e), b = z(i);
|
|
5786
|
+
return v.current = e, b.current = i, Ge(r, () => ({
|
|
5679
5787
|
getContent: () => {
|
|
5680
|
-
var
|
|
5681
|
-
return ((
|
|
5788
|
+
var f;
|
|
5789
|
+
return ((f = a.current) == null ? void 0 : f.getContent()) ?? "";
|
|
5682
5790
|
},
|
|
5683
5791
|
getContentForEmail: () => {
|
|
5684
|
-
var
|
|
5685
|
-
return ((
|
|
5792
|
+
var f;
|
|
5793
|
+
return ((f = a.current) == null ? void 0 : f.getContentForEmail()) ?? "";
|
|
5686
5794
|
},
|
|
5687
|
-
setContent: (
|
|
5688
|
-
var
|
|
5689
|
-
return (
|
|
5795
|
+
setContent: (f) => {
|
|
5796
|
+
var y;
|
|
5797
|
+
return (y = a.current) == null ? void 0 : y.setContent(f);
|
|
5690
5798
|
},
|
|
5691
|
-
insertContent: (
|
|
5692
|
-
var
|
|
5693
|
-
return (
|
|
5799
|
+
insertContent: (f) => {
|
|
5800
|
+
var y;
|
|
5801
|
+
return (y = a.current) == null ? void 0 : y.insertContent(f);
|
|
5694
5802
|
},
|
|
5695
|
-
setLanguage: (
|
|
5696
|
-
var
|
|
5697
|
-
return (
|
|
5803
|
+
setLanguage: (f) => {
|
|
5804
|
+
var y;
|
|
5805
|
+
return (y = a.current) == null ? void 0 : y.setLanguage(f);
|
|
5698
5806
|
},
|
|
5699
5807
|
focus: () => {
|
|
5700
|
-
var
|
|
5701
|
-
return (
|
|
5808
|
+
var f;
|
|
5809
|
+
return (f = a.current) == null ? void 0 : f.focus();
|
|
5702
5810
|
},
|
|
5703
5811
|
destroy: () => {
|
|
5704
|
-
var
|
|
5705
|
-
return (
|
|
5812
|
+
var f;
|
|
5813
|
+
return (f = a.current) == null ? void 0 : f.destroy();
|
|
5706
5814
|
},
|
|
5707
|
-
importWordFile: (
|
|
5708
|
-
var
|
|
5709
|
-
return ((
|
|
5815
|
+
importWordFile: (f) => {
|
|
5816
|
+
var y;
|
|
5817
|
+
return ((y = a.current) == null ? void 0 : y.importWordFile(f)) ?? Promise.resolve();
|
|
5710
5818
|
},
|
|
5711
5819
|
restoreDraft: () => {
|
|
5712
|
-
var
|
|
5713
|
-
return ((
|
|
5820
|
+
var f;
|
|
5821
|
+
return ((f = a.current) == null ? void 0 : f.restoreDraft()) ?? !1;
|
|
5714
5822
|
},
|
|
5715
5823
|
getRevisions: () => {
|
|
5716
|
-
var
|
|
5717
|
-
return ((
|
|
5824
|
+
var f;
|
|
5825
|
+
return ((f = a.current) == null ? void 0 : f.getRevisions()) ?? [];
|
|
5718
5826
|
}
|
|
5719
5827
|
})), lt(() => {
|
|
5720
5828
|
if (!o.current) return;
|
|
5721
|
-
const
|
|
5829
|
+
const f = new rs({
|
|
5722
5830
|
target: o.current,
|
|
5723
5831
|
initialContent: p.current,
|
|
5724
|
-
onChange: (
|
|
5725
|
-
var
|
|
5726
|
-
|
|
5832
|
+
onChange: (y) => {
|
|
5833
|
+
var C;
|
|
5834
|
+
u.current = !0, p.current = y, (C = v.current) == null || C.call(v, y);
|
|
5727
5835
|
},
|
|
5728
|
-
onReady: (
|
|
5729
|
-
var
|
|
5730
|
-
return (
|
|
5836
|
+
onReady: (y) => {
|
|
5837
|
+
var C;
|
|
5838
|
+
return (C = b.current) == null ? void 0 : C.call(b, y);
|
|
5731
5839
|
},
|
|
5732
|
-
...
|
|
5840
|
+
...l
|
|
5733
5841
|
});
|
|
5734
|
-
return a.current =
|
|
5735
|
-
|
|
5842
|
+
return a.current = f, () => {
|
|
5843
|
+
f.destroy(), a.current = null;
|
|
5736
5844
|
};
|
|
5737
5845
|
}, []), lt(() => {
|
|
5738
|
-
var
|
|
5739
|
-
if (
|
|
5740
|
-
if (
|
|
5741
|
-
|
|
5846
|
+
var f, y;
|
|
5847
|
+
if (d !== void 0 && d !== p.current) {
|
|
5848
|
+
if (u.current) {
|
|
5849
|
+
u.current = !1;
|
|
5742
5850
|
return;
|
|
5743
5851
|
}
|
|
5744
|
-
if ((
|
|
5745
|
-
m.current =
|
|
5852
|
+
if ((f = o.current) != null && f.contains(document.activeElement)) {
|
|
5853
|
+
m.current = d;
|
|
5746
5854
|
return;
|
|
5747
5855
|
}
|
|
5748
|
-
p.current =
|
|
5856
|
+
p.current = d, (y = a.current) == null || y.setContent(d);
|
|
5749
5857
|
}
|
|
5750
|
-
}, [
|
|
5751
|
-
const
|
|
5752
|
-
if (!
|
|
5753
|
-
const
|
|
5858
|
+
}, [d]), lt(() => {
|
|
5859
|
+
const f = o.current;
|
|
5860
|
+
if (!f) return;
|
|
5861
|
+
const y = (C) => {
|
|
5754
5862
|
var A;
|
|
5755
5863
|
if (m.current === null) return;
|
|
5756
|
-
const E =
|
|
5757
|
-
if (E &&
|
|
5864
|
+
const E = C.relatedTarget;
|
|
5865
|
+
if (E && f.contains(E)) return;
|
|
5758
5866
|
const I = m.current;
|
|
5759
5867
|
m.current = null, p.current = I, (A = a.current) == null || A.setContent(I);
|
|
5760
5868
|
};
|
|
5761
|
-
return
|
|
5869
|
+
return f.addEventListener("focusout", y), () => f.removeEventListener("focusout", y);
|
|
5762
5870
|
}, []), lt(() => {
|
|
5763
|
-
var
|
|
5764
|
-
|
|
5765
|
-
}, [
|
|
5871
|
+
var f;
|
|
5872
|
+
l.language && ((f = a.current) == null || f.setLanguage(l.language));
|
|
5873
|
+
}, [l.language]), /* @__PURE__ */ Je.jsx("div", { ref: o, className: s, style: n });
|
|
5766
5874
|
}
|
|
5767
5875
|
);
|
|
5768
|
-
|
|
5876
|
+
ls.displayName = "FableEditor";
|
|
5769
5877
|
export {
|
|
5770
|
-
|
|
5878
|
+
ls as FableEditor
|
|
5771
5879
|
};
|