fable-editor 1.0.0 → 1.0.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/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/angular/LICENSE +1 -1
- package/dist/angular/README.md +1 -1
- package/dist/angular/core/editor.d.ts +16 -0
- package/dist/angular/core/i18n.d.ts +6 -0
- package/dist/angular/esm2022/core/config.mjs +2 -2
- package/dist/angular/esm2022/core/editor.mjs +194 -6
- package/dist/angular/esm2022/core/i18n.mjs +15 -3
- package/dist/angular/esm2022/core/icons.mjs +6 -1
- package/dist/angular/fesm2022/fable-editor.mjs +213 -8
- package/dist/angular/fesm2022/fable-editor.mjs.map +1 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/editor.css +142 -0
- package/dist/core/editor.d.ts +16 -0
- package/dist/core/editor.d.ts.map +1 -1
- package/dist/core/i18n.d.ts +6 -0
- package/dist/core/i18n.d.ts.map +1 -1
- package/dist/core/icons.d.ts.map +1 -1
- package/dist/core/index.cjs +3 -3
- package/dist/core/index.mjs +282 -174
- package/dist/react/index.cjs +12 -12
- package/dist/react/index.mjs +411 -306
- package/package.json +10 -2
- package/style.css +142 -0
package/dist/react/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
1
|
+
import Jt, { forwardRef as Ae, useRef as X, useImperativeHandle as Ie, useEffect as gt } from "react";
|
|
2
|
+
var wt = { exports: {} }, G = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -9,11 +9,11 @@ var bt = { exports: {} }, G = {};
|
|
|
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 m =
|
|
12
|
+
var Ut;
|
|
13
|
+
function Re() {
|
|
14
|
+
if (Ut) return G;
|
|
15
|
+
Ut = 1;
|
|
16
|
+
var m = Jt, t = Symbol.for("react.element"), e = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, s = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, r = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
17
|
function l(o, a, c) {
|
|
18
18
|
var d, u = {}, v = null, b = null;
|
|
19
19
|
c !== void 0 && (v = "" + c), a.key !== void 0 && (v = "" + a.key), a.ref !== void 0 && (b = a.ref);
|
|
@@ -33,10 +33,10 @@ var K = {};
|
|
|
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 m =
|
|
36
|
+
var Xt;
|
|
37
|
+
function Ze() {
|
|
38
|
+
return Xt || (Xt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
39
|
+
var m = Jt, t = Symbol.for("react.element"), e = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), r = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), o = Symbol.for("react.context"), a = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), u = Symbol.for("react.memo"), v = Symbol.for("react.lazy"), b = Symbol.for("react.offscreen"), f = Symbol.iterator, w = "@@iterator";
|
|
40
40
|
function E(n) {
|
|
41
41
|
if (n === null || typeof n != "object")
|
|
42
42
|
return null;
|
|
@@ -46,14 +46,14 @@ function Ae() {
|
|
|
46
46
|
var q = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
47
47
|
function M(n) {
|
|
48
48
|
{
|
|
49
|
-
for (var p = arguments.length, g = new Array(p > 1 ? p - 1 : 0),
|
|
50
|
-
g[
|
|
51
|
-
|
|
49
|
+
for (var p = arguments.length, g = new Array(p > 1 ? p - 1 : 0), x = 1; x < p; x++)
|
|
50
|
+
g[x - 1] = arguments[x];
|
|
51
|
+
P("error", n, g);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function P(n, p, g) {
|
|
55
55
|
{
|
|
56
|
-
var
|
|
56
|
+
var x = q.ReactDebugCurrentFrame, S = x.getStackAddendum();
|
|
57
57
|
S !== "" && (p += "%s", g = g.concat([S]));
|
|
58
58
|
var k = g.map(function(T) {
|
|
59
59
|
return String(T);
|
|
@@ -61,26 +61,26 @@ function Ae() {
|
|
|
61
61
|
k.unshift("Warning: " + p), Function.prototype.apply.call(console[n], console, k);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
var I = !1, F = !1, B = !1, Y = !1,
|
|
65
|
-
|
|
66
|
-
function
|
|
67
|
-
return !!(typeof n == "string" || typeof n == "function" || n === i || n === r ||
|
|
64
|
+
var I = !1, F = !1, B = !1, Y = !1, ee = !1, xt;
|
|
65
|
+
xt = Symbol.for("react.module.reference");
|
|
66
|
+
function ie(n) {
|
|
67
|
+
return !!(typeof n == "string" || typeof n == "function" || n === i || n === r || ee || n === s || n === c || n === d || Y || n === b || I || F || B || typeof n == "object" && n !== null && (n.$$typeof === v || n.$$typeof === u || n.$$typeof === l || n.$$typeof === o || n.$$typeof === a || // 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
|
-
n.$$typeof ===
|
|
71
|
+
n.$$typeof === xt || n.getModuleId !== void 0));
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
var
|
|
75
|
-
if (
|
|
76
|
-
return
|
|
73
|
+
function se(n, p, g) {
|
|
74
|
+
var x = n.displayName;
|
|
75
|
+
if (x)
|
|
76
|
+
return x;
|
|
77
77
|
var S = p.displayName || p.name || "";
|
|
78
78
|
return S !== "" ? g + "(" + S + ")" : g;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function Ct(n) {
|
|
81
81
|
return n.displayName || "Context";
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function $(n) {
|
|
84
84
|
if (n == null)
|
|
85
85
|
return null;
|
|
86
86
|
if (typeof n.tag == "number" && M("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof n == "function")
|
|
@@ -105,19 +105,19 @@ function Ae() {
|
|
|
105
105
|
switch (n.$$typeof) {
|
|
106
106
|
case o:
|
|
107
107
|
var p = n;
|
|
108
|
-
return
|
|
108
|
+
return Ct(p) + ".Consumer";
|
|
109
109
|
case l:
|
|
110
110
|
var g = n;
|
|
111
|
-
return
|
|
111
|
+
return Ct(g._context) + ".Provider";
|
|
112
112
|
case a:
|
|
113
|
-
return
|
|
113
|
+
return se(n, n.render, "ForwardRef");
|
|
114
114
|
case u:
|
|
115
|
-
var
|
|
116
|
-
return
|
|
115
|
+
var x = n.displayName || null;
|
|
116
|
+
return x !== null ? x : $(n.type) || "Memo";
|
|
117
117
|
case v: {
|
|
118
118
|
var S = n, k = S._payload, T = S._init;
|
|
119
119
|
try {
|
|
120
|
-
return
|
|
120
|
+
return $(T(k));
|
|
121
121
|
} catch {
|
|
122
122
|
return null;
|
|
123
123
|
}
|
|
@@ -125,18 +125,18 @@ function Ae() {
|
|
|
125
125
|
}
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
|
-
var
|
|
129
|
-
function
|
|
128
|
+
var _ = Object.assign, Q = 0, Tt, Et, St, Mt, kt, Ht, Lt;
|
|
129
|
+
function qt() {
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
function
|
|
131
|
+
qt.__reactDisabledLog = !0;
|
|
132
|
+
function re() {
|
|
133
133
|
{
|
|
134
134
|
if (Q === 0) {
|
|
135
|
-
|
|
135
|
+
Tt = console.log, Et = console.info, St = console.warn, Mt = console.error, kt = console.group, Ht = console.groupCollapsed, Lt = console.groupEnd;
|
|
136
136
|
var n = {
|
|
137
137
|
configurable: !0,
|
|
138
138
|
enumerable: !0,
|
|
139
|
-
value:
|
|
139
|
+
value: qt,
|
|
140
140
|
writable: !0
|
|
141
141
|
};
|
|
142
142
|
Object.defineProperties(console, {
|
|
@@ -152,7 +152,7 @@ function Ae() {
|
|
|
152
152
|
Q++;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function ne() {
|
|
156
156
|
{
|
|
157
157
|
if (Q--, Q === 0) {
|
|
158
158
|
var n = {
|
|
@@ -161,26 +161,26 @@ function Ae() {
|
|
|
161
161
|
writable: !0
|
|
162
162
|
};
|
|
163
163
|
Object.defineProperties(console, {
|
|
164
|
-
log:
|
|
165
|
-
value: Ct
|
|
166
|
-
}),
|
|
167
|
-
info: $({}, n, {
|
|
168
|
-
value: xt
|
|
169
|
-
}),
|
|
170
|
-
warn: $({}, n, {
|
|
164
|
+
log: _({}, n, {
|
|
171
165
|
value: Tt
|
|
172
166
|
}),
|
|
173
|
-
|
|
167
|
+
info: _({}, n, {
|
|
174
168
|
value: Et
|
|
175
169
|
}),
|
|
176
|
-
|
|
170
|
+
warn: _({}, n, {
|
|
177
171
|
value: St
|
|
178
172
|
}),
|
|
179
|
-
|
|
173
|
+
error: _({}, n, {
|
|
180
174
|
value: Mt
|
|
181
175
|
}),
|
|
182
|
-
|
|
176
|
+
group: _({}, n, {
|
|
183
177
|
value: kt
|
|
178
|
+
}),
|
|
179
|
+
groupCollapsed: _({}, n, {
|
|
180
|
+
value: Ht
|
|
181
|
+
}),
|
|
182
|
+
groupEnd: _({}, n, {
|
|
183
|
+
value: Lt
|
|
184
184
|
})
|
|
185
185
|
});
|
|
186
186
|
}
|
|
@@ -194,8 +194,8 @@ function Ae() {
|
|
|
194
194
|
try {
|
|
195
195
|
throw Error();
|
|
196
196
|
} catch (S) {
|
|
197
|
-
var
|
|
198
|
-
ct =
|
|
197
|
+
var x = S.stack.trim().match(/\n( *(at )?)/);
|
|
198
|
+
ct = x && x[1] || "";
|
|
199
199
|
}
|
|
200
200
|
return `
|
|
201
201
|
` + ct + n;
|
|
@@ -203,10 +203,10 @@ function Ae() {
|
|
|
203
203
|
}
|
|
204
204
|
var ht = !1, tt;
|
|
205
205
|
{
|
|
206
|
-
var
|
|
207
|
-
tt = new
|
|
206
|
+
var le = typeof WeakMap == "function" ? WeakMap : Map;
|
|
207
|
+
tt = new le();
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function At(n, p) {
|
|
210
210
|
if (!n || ht)
|
|
211
211
|
return "";
|
|
212
212
|
{
|
|
@@ -214,12 +214,12 @@ function Ae() {
|
|
|
214
214
|
if (g !== void 0)
|
|
215
215
|
return g;
|
|
216
216
|
}
|
|
217
|
-
var
|
|
217
|
+
var x;
|
|
218
218
|
ht = !0;
|
|
219
219
|
var S = Error.prepareStackTrace;
|
|
220
220
|
Error.prepareStackTrace = void 0;
|
|
221
221
|
var k;
|
|
222
|
-
k = at.current, at.current = null,
|
|
222
|
+
k = at.current, at.current = null, re();
|
|
223
223
|
try {
|
|
224
224
|
if (p) {
|
|
225
225
|
var T = function() {
|
|
@@ -233,14 +233,14 @@ function Ae() {
|
|
|
233
233
|
try {
|
|
234
234
|
Reflect.construct(T, []);
|
|
235
235
|
} catch (N) {
|
|
236
|
-
|
|
236
|
+
x = N;
|
|
237
237
|
}
|
|
238
238
|
Reflect.construct(n, [], T);
|
|
239
239
|
} else {
|
|
240
240
|
try {
|
|
241
241
|
T.call();
|
|
242
242
|
} catch (N) {
|
|
243
|
-
|
|
243
|
+
x = N;
|
|
244
244
|
}
|
|
245
245
|
n.call(T.prototype);
|
|
246
246
|
}
|
|
@@ -248,39 +248,39 @@ function Ae() {
|
|
|
248
248
|
try {
|
|
249
249
|
throw Error();
|
|
250
250
|
} catch (N) {
|
|
251
|
-
|
|
251
|
+
x = N;
|
|
252
252
|
}
|
|
253
253
|
n();
|
|
254
254
|
}
|
|
255
255
|
} catch (N) {
|
|
256
|
-
if (N &&
|
|
257
|
-
for (var
|
|
258
|
-
`),
|
|
259
|
-
`),
|
|
260
|
-
|
|
261
|
-
for (;
|
|
262
|
-
if (
|
|
263
|
-
if (
|
|
256
|
+
if (N && x && typeof N.stack == "string") {
|
|
257
|
+
for (var C = N.stack.split(`
|
|
258
|
+
`), D = x.stack.split(`
|
|
259
|
+
`), A = C.length - 1, R = D.length - 1; A >= 1 && R >= 0 && C[A] !== D[R]; )
|
|
260
|
+
R--;
|
|
261
|
+
for (; A >= 1 && R >= 0; A--, R--)
|
|
262
|
+
if (C[A] !== D[R]) {
|
|
263
|
+
if (A !== 1 || R !== 1)
|
|
264
264
|
do
|
|
265
|
-
if (
|
|
265
|
+
if (A--, R--, R < 0 || C[A] !== D[R]) {
|
|
266
266
|
var O = `
|
|
267
|
-
` +
|
|
267
|
+
` + C[A].replace(" at new ", " at ");
|
|
268
268
|
return n.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", n.displayName)), typeof n == "function" && tt.set(n, O), O;
|
|
269
269
|
}
|
|
270
|
-
while (
|
|
270
|
+
while (A >= 1 && R >= 0);
|
|
271
271
|
break;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
} finally {
|
|
275
|
-
ht = !1, at.current = k,
|
|
275
|
+
ht = !1, at.current = k, ne(), Error.prepareStackTrace = S;
|
|
276
276
|
}
|
|
277
277
|
var U = n ? n.displayName || n.name : "", j = U ? J(U) : "";
|
|
278
278
|
return typeof n == "function" && tt.set(n, j), j;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
return
|
|
280
|
+
function oe(n, p, g) {
|
|
281
|
+
return At(n, !1);
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function ae(n) {
|
|
284
284
|
var p = n.prototype;
|
|
285
285
|
return !!(p && p.isReactComponent);
|
|
286
286
|
}
|
|
@@ -288,7 +288,7 @@ function Ae() {
|
|
|
288
288
|
if (n == null)
|
|
289
289
|
return "";
|
|
290
290
|
if (typeof n == "function")
|
|
291
|
-
return
|
|
291
|
+
return At(n, ae(n));
|
|
292
292
|
if (typeof n == "string")
|
|
293
293
|
return J(n);
|
|
294
294
|
switch (n) {
|
|
@@ -300,11 +300,11 @@ function Ae() {
|
|
|
300
300
|
if (typeof n == "object")
|
|
301
301
|
switch (n.$$typeof) {
|
|
302
302
|
case a:
|
|
303
|
-
return
|
|
303
|
+
return oe(n.render);
|
|
304
304
|
case u:
|
|
305
305
|
return et(n.type, p, g);
|
|
306
306
|
case v: {
|
|
307
|
-
var
|
|
307
|
+
var x = n, S = x._payload, k = x._init;
|
|
308
308
|
try {
|
|
309
309
|
return et(k(S), p, g);
|
|
310
310
|
} catch {
|
|
@@ -313,64 +313,64 @@ function Ae() {
|
|
|
313
313
|
}
|
|
314
314
|
return "";
|
|
315
315
|
}
|
|
316
|
-
var V = Object.prototype.hasOwnProperty,
|
|
316
|
+
var V = Object.prototype.hasOwnProperty, It = {}, Rt = q.ReactDebugCurrentFrame;
|
|
317
317
|
function it(n) {
|
|
318
318
|
if (n) {
|
|
319
319
|
var p = n._owner, g = et(n.type, n._source, p ? p.type : null);
|
|
320
|
-
|
|
320
|
+
Rt.setExtraStackFrame(g);
|
|
321
321
|
} else
|
|
322
|
-
|
|
322
|
+
Rt.setExtraStackFrame(null);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function ce(n, p, g, x, S) {
|
|
325
325
|
{
|
|
326
326
|
var k = Function.call.bind(V);
|
|
327
327
|
for (var T in n)
|
|
328
328
|
if (k(n, T)) {
|
|
329
|
-
var
|
|
329
|
+
var C = void 0;
|
|
330
330
|
try {
|
|
331
331
|
if (typeof n[T] != "function") {
|
|
332
|
-
var
|
|
333
|
-
throw
|
|
332
|
+
var D = Error((x || "React class") + ": " + g + " type `" + T + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof n[T] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
333
|
+
throw D.name = "Invariant Violation", D;
|
|
334
334
|
}
|
|
335
|
-
|
|
336
|
-
} catch (
|
|
337
|
-
|
|
335
|
+
C = n[T](p, T, x, g, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
336
|
+
} catch (A) {
|
|
337
|
+
C = A;
|
|
338
338
|
}
|
|
339
|
-
|
|
339
|
+
C && !(C instanceof Error) && (it(S), M("%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).", x || "React class", g, T, typeof C), it(null)), C instanceof Error && !(C.message in It) && (It[C.message] = !0, it(S), M("Failed %s type: %s", g, C.message), it(null));
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
var
|
|
343
|
+
var he = Array.isArray;
|
|
344
344
|
function dt(n) {
|
|
345
|
-
return
|
|
345
|
+
return he(n);
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function de(n) {
|
|
348
348
|
{
|
|
349
349
|
var p = typeof Symbol == "function" && Symbol.toStringTag, g = p && n[Symbol.toStringTag] || n.constructor.name || "Object";
|
|
350
350
|
return g;
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function ue(n) {
|
|
354
354
|
try {
|
|
355
|
-
return
|
|
355
|
+
return Zt(n), !1;
|
|
356
356
|
} catch {
|
|
357
357
|
return !0;
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function Zt(n) {
|
|
361
361
|
return "" + n;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
364
|
-
if (
|
|
365
|
-
return M("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
363
|
+
function Pt(n) {
|
|
364
|
+
if (ue(n))
|
|
365
|
+
return M("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", de(n)), Zt(n);
|
|
366
366
|
}
|
|
367
|
-
var
|
|
367
|
+
var Dt = q.ReactCurrentOwner, pe = {
|
|
368
368
|
key: !0,
|
|
369
369
|
ref: !0,
|
|
370
370
|
__self: !0,
|
|
371
371
|
__source: !0
|
|
372
|
-
},
|
|
373
|
-
function
|
|
372
|
+
}, Nt, Ot;
|
|
373
|
+
function me(n) {
|
|
374
374
|
if (V.call(n, "ref")) {
|
|
375
375
|
var p = Object.getOwnPropertyDescriptor(n, "ref").get;
|
|
376
376
|
if (p && p.isReactWarning)
|
|
@@ -378,7 +378,7 @@ function Ae() {
|
|
|
378
378
|
}
|
|
379
379
|
return n.ref !== void 0;
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function fe(n) {
|
|
382
382
|
if (V.call(n, "key")) {
|
|
383
383
|
var p = Object.getOwnPropertyDescriptor(n, "key").get;
|
|
384
384
|
if (p && p.isReactWarning)
|
|
@@ -386,13 +386,13 @@ function Ae() {
|
|
|
386
386
|
}
|
|
387
387
|
return n.key !== void 0;
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
typeof n.ref == "string" &&
|
|
389
|
+
function ge(n, p) {
|
|
390
|
+
typeof n.ref == "string" && Dt.current;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function ve(n, p) {
|
|
393
393
|
{
|
|
394
394
|
var g = function() {
|
|
395
|
-
|
|
395
|
+
Nt || (Nt = !0, M("%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)", p));
|
|
396
396
|
};
|
|
397
397
|
g.isReactWarning = !0, Object.defineProperty(n, "key", {
|
|
398
398
|
get: g,
|
|
@@ -400,10 +400,10 @@ function Ae() {
|
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function be(n, p) {
|
|
404
404
|
{
|
|
405
405
|
var g = function() {
|
|
406
|
-
|
|
406
|
+
Ot || (Ot = !0, M("%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)", p));
|
|
407
407
|
};
|
|
408
408
|
g.isReactWarning = !0, Object.defineProperty(n, "ref", {
|
|
409
409
|
get: g,
|
|
@@ -411,8 +411,8 @@ function Ae() {
|
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
-
var
|
|
415
|
-
var
|
|
414
|
+
var ye = function(n, p, g, x, S, k, T) {
|
|
415
|
+
var C = {
|
|
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
|
|
@@ -423,58 +423,58 @@ function Ae() {
|
|
|
423
423
|
// Record the component responsible for creating this element.
|
|
424
424
|
_owner: k
|
|
425
425
|
};
|
|
426
|
-
return
|
|
426
|
+
return C._store = {}, Object.defineProperty(C._store, "validated", {
|
|
427
427
|
configurable: !1,
|
|
428
428
|
enumerable: !1,
|
|
429
429
|
writable: !0,
|
|
430
430
|
value: !1
|
|
431
|
-
}), Object.defineProperty(
|
|
431
|
+
}), Object.defineProperty(C, "_self", {
|
|
432
432
|
configurable: !1,
|
|
433
433
|
enumerable: !1,
|
|
434
434
|
writable: !1,
|
|
435
|
-
value:
|
|
436
|
-
}), Object.defineProperty(
|
|
435
|
+
value: x
|
|
436
|
+
}), Object.defineProperty(C, "_source", {
|
|
437
437
|
configurable: !1,
|
|
438
438
|
enumerable: !1,
|
|
439
439
|
writable: !1,
|
|
440
440
|
value: S
|
|
441
|
-
}), Object.freeze && (Object.freeze(
|
|
441
|
+
}), Object.freeze && (Object.freeze(C.props), Object.freeze(C)), C;
|
|
442
442
|
};
|
|
443
|
-
function
|
|
443
|
+
function we(n, p, g, x, S) {
|
|
444
444
|
{
|
|
445
|
-
var k, T = {},
|
|
446
|
-
g !== void 0 && (
|
|
445
|
+
var k, T = {}, C = null, D = null;
|
|
446
|
+
g !== void 0 && (Pt(g), C = "" + g), fe(p) && (Pt(p.key), C = "" + p.key), me(p) && (D = p.ref, ge(p, S));
|
|
447
447
|
for (k in p)
|
|
448
|
-
V.call(p, k) && !
|
|
448
|
+
V.call(p, k) && !pe.hasOwnProperty(k) && (T[k] = p[k]);
|
|
449
449
|
if (n && n.defaultProps) {
|
|
450
|
-
var
|
|
451
|
-
for (k in
|
|
452
|
-
T[k] === void 0 && (T[k] =
|
|
450
|
+
var A = n.defaultProps;
|
|
451
|
+
for (k in A)
|
|
452
|
+
T[k] === void 0 && (T[k] = A[k]);
|
|
453
453
|
}
|
|
454
|
-
if (
|
|
455
|
-
var
|
|
456
|
-
|
|
454
|
+
if (C || D) {
|
|
455
|
+
var R = typeof n == "function" ? n.displayName || n.name || "Unknown" : n;
|
|
456
|
+
C && ve(T, R), D && be(T, R);
|
|
457
457
|
}
|
|
458
|
-
return
|
|
458
|
+
return ye(n, C, D, S, x, Dt.current, T);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
var ut = q.ReactCurrentOwner,
|
|
462
|
-
function
|
|
461
|
+
var ut = q.ReactCurrentOwner, Bt = q.ReactDebugCurrentFrame;
|
|
462
|
+
function z(n) {
|
|
463
463
|
if (n) {
|
|
464
464
|
var p = n._owner, g = et(n.type, n._source, p ? p.type : null);
|
|
465
|
-
|
|
465
|
+
Bt.setExtraStackFrame(g);
|
|
466
466
|
} else
|
|
467
|
-
|
|
467
|
+
Bt.setExtraStackFrame(null);
|
|
468
468
|
}
|
|
469
469
|
var pt;
|
|
470
470
|
pt = !1;
|
|
471
471
|
function mt(n) {
|
|
472
472
|
return typeof n == "object" && n !== null && n.$$typeof === t;
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function Ft() {
|
|
475
475
|
{
|
|
476
476
|
if (ut.current) {
|
|
477
|
-
var n =
|
|
477
|
+
var n = $(ut.current.type);
|
|
478
478
|
if (n)
|
|
479
479
|
return `
|
|
480
480
|
|
|
@@ -483,13 +483,13 @@ Check the render method of \`` + n + "`.";
|
|
|
483
483
|
return "";
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
|
-
function
|
|
486
|
+
function xe(n) {
|
|
487
487
|
return "";
|
|
488
488
|
}
|
|
489
|
-
var
|
|
490
|
-
function
|
|
489
|
+
var $t = {};
|
|
490
|
+
function Ce(n) {
|
|
491
491
|
{
|
|
492
|
-
var p =
|
|
492
|
+
var p = Ft();
|
|
493
493
|
if (!p) {
|
|
494
494
|
var g = typeof n == "string" ? n : n.displayName || n.name;
|
|
495
495
|
g && (p = `
|
|
@@ -499,27 +499,27 @@ Check the top-level render call using <` + g + ">.");
|
|
|
499
499
|
return p;
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function _t(n, p) {
|
|
503
503
|
{
|
|
504
504
|
if (!n._store || n._store.validated || n.key != null)
|
|
505
505
|
return;
|
|
506
506
|
n._store.validated = !0;
|
|
507
|
-
var g =
|
|
508
|
-
if (
|
|
507
|
+
var g = Ce(p);
|
|
508
|
+
if ($t[g])
|
|
509
509
|
return;
|
|
510
|
-
|
|
511
|
-
var
|
|
512
|
-
n && n._owner && n._owner !== ut.current && (
|
|
510
|
+
$t[g] = !0;
|
|
511
|
+
var x = "";
|
|
512
|
+
n && n._owner && n._owner !== ut.current && (x = " It was passed a child from " + $(n._owner.type) + "."), z(n), M('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', g, x), z(null);
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function jt(n, p) {
|
|
516
516
|
{
|
|
517
517
|
if (typeof n != "object")
|
|
518
518
|
return;
|
|
519
519
|
if (dt(n))
|
|
520
520
|
for (var g = 0; g < n.length; g++) {
|
|
521
|
-
var
|
|
522
|
-
mt(
|
|
521
|
+
var x = n[g];
|
|
522
|
+
mt(x) && _t(x, p);
|
|
523
523
|
}
|
|
524
524
|
else if (mt(n))
|
|
525
525
|
n._store && (n._store.validated = !0);
|
|
@@ -527,11 +527,11 @@ Check the top-level render call using <` + g + ">.");
|
|
|
527
527
|
var S = E(n);
|
|
528
528
|
if (typeof S == "function" && S !== n.entries)
|
|
529
529
|
for (var k = S.call(n), T; !(T = k.next()).done; )
|
|
530
|
-
mt(T.value) &&
|
|
530
|
+
mt(T.value) && _t(T.value, p);
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function Te(n) {
|
|
535
535
|
{
|
|
536
536
|
var p = n.type;
|
|
537
537
|
if (p == null || typeof p == "string")
|
|
@@ -546,86 +546,86 @@ Check the top-level render call using <` + g + ">.");
|
|
|
546
546
|
else
|
|
547
547
|
return;
|
|
548
548
|
if (g) {
|
|
549
|
-
var
|
|
550
|
-
|
|
549
|
+
var x = $(p);
|
|
550
|
+
ce(g, n.props, "prop", x, n);
|
|
551
551
|
} else if (p.PropTypes !== void 0 && !pt) {
|
|
552
552
|
pt = !0;
|
|
553
|
-
var S =
|
|
553
|
+
var S = $(p);
|
|
554
554
|
M("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", S || "Unknown");
|
|
555
555
|
}
|
|
556
556
|
typeof p.getDefaultProps == "function" && !p.getDefaultProps.isReactClassApproved && M("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function Ee(n) {
|
|
560
560
|
{
|
|
561
561
|
for (var p = Object.keys(n.props), g = 0; g < p.length; g++) {
|
|
562
|
-
var
|
|
563
|
-
if (
|
|
564
|
-
|
|
562
|
+
var x = p[g];
|
|
563
|
+
if (x !== "children" && x !== "key") {
|
|
564
|
+
z(n), M("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", x), z(null);
|
|
565
565
|
break;
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
|
-
n.ref !== null && (
|
|
568
|
+
n.ref !== null && (z(n), M("Invalid attribute `ref` supplied to `React.Fragment`."), z(null));
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
|
-
var
|
|
572
|
-
function
|
|
571
|
+
var Wt = {};
|
|
572
|
+
function zt(n, p, g, x, S, k) {
|
|
573
573
|
{
|
|
574
|
-
var T =
|
|
574
|
+
var T = ie(n);
|
|
575
575
|
if (!T) {
|
|
576
|
-
var
|
|
577
|
-
(n === void 0 || typeof n == "object" && n !== null && Object.keys(n).length === 0) && (
|
|
578
|
-
var
|
|
579
|
-
|
|
580
|
-
var
|
|
581
|
-
n === null ?
|
|
576
|
+
var C = "";
|
|
577
|
+
(n === void 0 || typeof n == "object" && n !== null && Object.keys(n).length === 0) && (C += " 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 D = xe();
|
|
579
|
+
D ? C += D : C += Ft();
|
|
580
|
+
var A;
|
|
581
|
+
n === null ? A = "null" : dt(n) ? A = "array" : n !== void 0 && n.$$typeof === t ? (A = "<" + ($(n.type) || "Unknown") + " />", C = " Did you accidentally export a JSX literal instead of a component?") : A = typeof n, M("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", A, C);
|
|
582
582
|
}
|
|
583
|
-
var
|
|
584
|
-
if (
|
|
585
|
-
return
|
|
583
|
+
var R = we(n, p, g, S, k);
|
|
584
|
+
if (R == null)
|
|
585
|
+
return R;
|
|
586
586
|
if (T) {
|
|
587
587
|
var O = p.children;
|
|
588
588
|
if (O !== void 0)
|
|
589
|
-
if (
|
|
589
|
+
if (x)
|
|
590
590
|
if (dt(O)) {
|
|
591
591
|
for (var U = 0; U < O.length; U++)
|
|
592
|
-
|
|
592
|
+
jt(O[U], n);
|
|
593
593
|
Object.freeze && Object.freeze(O);
|
|
594
594
|
} else
|
|
595
595
|
M("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
|
+
jt(O, n);
|
|
598
598
|
}
|
|
599
599
|
if (V.call(p, "key")) {
|
|
600
|
-
var j =
|
|
601
|
-
return
|
|
600
|
+
var j = $(n), N = Object.keys(p).filter(function(qe) {
|
|
601
|
+
return qe !== "key";
|
|
602
602
|
}), ft = N.length > 0 ? "{key: someKey, " + N.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
603
|
-
if (
|
|
604
|
-
var
|
|
603
|
+
if (!Wt[j + ft]) {
|
|
604
|
+
var Le = N.length > 0 ? "{" + N.join(": ..., ") + ": ...}" : "{}";
|
|
605
605
|
M(`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} />`, ft, j,
|
|
610
|
+
<%s key={someKey} {...props} />`, ft, j, Le, j), Wt[j + ft] = !0;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
return n === i ?
|
|
613
|
+
return n === i ? Ee(R) : Te(R), R;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
function
|
|
617
|
-
return
|
|
616
|
+
function Se(n, p, g) {
|
|
617
|
+
return zt(n, p, g, !0);
|
|
618
618
|
}
|
|
619
|
-
function
|
|
620
|
-
return
|
|
619
|
+
function Me(n, p, g) {
|
|
620
|
+
return zt(n, p, g, !1);
|
|
621
621
|
}
|
|
622
|
-
var
|
|
623
|
-
K.Fragment = i, K.jsx =
|
|
622
|
+
var ke = Me, He = Se;
|
|
623
|
+
K.Fragment = i, K.jsx = ke, K.jsxs = He;
|
|
624
624
|
}()), K;
|
|
625
625
|
}
|
|
626
|
-
process.env.NODE_ENV === "production" ?
|
|
627
|
-
var
|
|
628
|
-
const
|
|
626
|
+
process.env.NODE_ENV === "production" ? wt.exports = Re() : wt.exports = Ze();
|
|
627
|
+
var Pe = wt.exports;
|
|
628
|
+
const De = {
|
|
629
629
|
en: {
|
|
630
630
|
dir: "ltr",
|
|
631
631
|
file: "File",
|
|
@@ -760,7 +760,13 @@ const Ze = {
|
|
|
760
760
|
insertimg: "Insert",
|
|
761
761
|
dropimage: "Drop image here",
|
|
762
762
|
uploading: "Uploading…",
|
|
763
|
-
uploadfailed: "Upload failed — click to retry"
|
|
763
|
+
uploadfailed: "Upload failed — click to retry",
|
|
764
|
+
template: "Templates",
|
|
765
|
+
tplimgleft: "Image left, text right",
|
|
766
|
+
tplimgright: "Image right, text left",
|
|
767
|
+
tplimgtop: "Image top, text below",
|
|
768
|
+
tplimgcenter: "Text top, image center",
|
|
769
|
+
deltemplate: "Delete template"
|
|
764
770
|
},
|
|
765
771
|
ar: {
|
|
766
772
|
dir: "rtl",
|
|
@@ -896,13 +902,19 @@ const Ze = {
|
|
|
896
902
|
insertimg: "إدراج",
|
|
897
903
|
dropimage: "أسقط الصورة هنا",
|
|
898
904
|
uploading: "جارٍ الرفع…",
|
|
899
|
-
uploadfailed: "فشل الرفع — انقر لإعادة المحاولة"
|
|
905
|
+
uploadfailed: "فشل الرفع — انقر لإعادة المحاولة",
|
|
906
|
+
template: "قوالب",
|
|
907
|
+
tplimgleft: "صورة يسار، نص يمين",
|
|
908
|
+
tplimgright: "صورة يمين، نص يسار",
|
|
909
|
+
tplimgtop: "صورة أعلى، نص أسفل",
|
|
910
|
+
tplimgcenter: "نص أعلى، صورة وسط",
|
|
911
|
+
deltemplate: "حذف القالب"
|
|
900
912
|
}
|
|
901
913
|
};
|
|
902
914
|
function vt(m) {
|
|
903
|
-
return
|
|
915
|
+
return De[m];
|
|
904
916
|
}
|
|
905
|
-
const
|
|
917
|
+
const Ne = "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 changecase lineheight wordspacing | removeformat | blocks | ltr rtl | quickimage quicktable template charmap | fullscreen sourcecode", Oe = "file edit view insert format tools table help", Be = [
|
|
906
918
|
["Andale Mono", "andale mono,times"],
|
|
907
919
|
["Arial", "arial,helvetica,sans-serif"],
|
|
908
920
|
["Arial Black", "arial black,avant garde"],
|
|
@@ -922,7 +934,7 @@ const De = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
922
934
|
["Verdana", "verdana,geneva"],
|
|
923
935
|
["Webdings", "webdings"],
|
|
924
936
|
["Wingdings", "wingdings,zapf dingbats"]
|
|
925
|
-
],
|
|
937
|
+
], Fe = ["8px", "9px", "10px", "11px", "12px", "14px", "16px", "18px", "20px", "24px", "28px", "32px", "36px", "48px", "72px", "96px"], $e = 1, _e = 100, je = ["1", "1.15", "1.4", "1.5", "1.75", "2", "2.5", "3"], We = ["1px", "2px", "4px", "6px", "8px", "12px"], Yt = [
|
|
926
938
|
["p", "para"],
|
|
927
939
|
["h1", "heading1"],
|
|
928
940
|
["h2", "heading2"],
|
|
@@ -931,7 +943,7 @@ const De = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
931
943
|
["h5", "heading5"],
|
|
932
944
|
["h6", "heading6"],
|
|
933
945
|
["pre", "pre"]
|
|
934
|
-
],
|
|
946
|
+
], ze = ["#F76707", "#4263EB", "#CC5DE8"], Ue = [
|
|
935
947
|
"#BFEDD2",
|
|
936
948
|
"#FBEEB8",
|
|
937
949
|
"#F8CAC6",
|
|
@@ -954,7 +966,7 @@ const De = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
954
966
|
"#34495E",
|
|
955
967
|
"#000000",
|
|
956
968
|
"#FFFFFF"
|
|
957
|
-
],
|
|
969
|
+
], Xe = [
|
|
958
970
|
"©",
|
|
959
971
|
"®",
|
|
960
972
|
"™",
|
|
@@ -1003,7 +1015,7 @@ const De = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1003
1015
|
"ـ",
|
|
1004
1016
|
"٠",
|
|
1005
1017
|
"١"
|
|
1006
|
-
],
|
|
1018
|
+
], L = (m, t) => `<svg viewBox="${t || "0 0 24 24"}">${m}</svg>`, y = (m) => L(`<path class="f" d="${m}"/>`, "0 -960 960 960"), st = (m, t = 7.5) => L(
|
|
1007
1019
|
'<path d="M10 6h10M10 12h10M10 18h10"/>' + m.map(
|
|
1008
1020
|
(e, i) => `<text x="2.5" y="${8.4 + i * 6}" font-size="${t}" stroke="none" fill="#222f3e" font-family="Arial">${e}</text>`
|
|
1009
1021
|
).join("")
|
|
@@ -1050,7 +1062,7 @@ const De = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1050
1062
|
bullist: y(
|
|
1051
1063
|
"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"
|
|
1052
1064
|
),
|
|
1053
|
-
chev:
|
|
1065
|
+
chev: L('<path d="M2 3.5 6 7.5 10 3.5"/>', "0 0 12 11"),
|
|
1054
1066
|
backcolor: y(
|
|
1055
1067
|
"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"
|
|
1056
1068
|
),
|
|
@@ -1069,17 +1081,17 @@ const De = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1069
1081
|
tableic: y(
|
|
1070
1082
|
"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"
|
|
1071
1083
|
),
|
|
1072
|
-
hric:
|
|
1084
|
+
hric: L('<path d="M4 12h16"/>'),
|
|
1073
1085
|
charic: y(
|
|
1074
1086
|
"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"
|
|
1075
1087
|
),
|
|
1076
|
-
dateic:
|
|
1088
|
+
dateic: L(
|
|
1077
1089
|
'<rect x="4" y="6" width="16" height="14" rx="1.5"/><path d="M4 10h16M8 4v4M16 4v4"/>'
|
|
1078
1090
|
),
|
|
1079
1091
|
pbic: y(
|
|
1080
1092
|
"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"
|
|
1081
1093
|
),
|
|
1082
|
-
nbspic:
|
|
1094
|
+
nbspic: L('<path d="M6 12v4h12v-4"/>'),
|
|
1083
1095
|
srcic: y(
|
|
1084
1096
|
"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"
|
|
1085
1097
|
),
|
|
@@ -1107,11 +1119,11 @@ const De = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1107
1119
|
subscriptic: y(
|
|
1108
1120
|
"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"
|
|
1109
1121
|
),
|
|
1110
|
-
newic:
|
|
1111
|
-
helpic:
|
|
1122
|
+
newic: L('<path d="M6 3h8l5 5v13H6z"/><path d="M14 3v5h5"/>'),
|
|
1123
|
+
helpic: L(
|
|
1112
1124
|
'<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"/>'
|
|
1113
1125
|
),
|
|
1114
|
-
wcic:
|
|
1126
|
+
wcic: L('<path d="M4 6h16M4 10h16M4 14h9"/><path d="M15 17.5l2 2 3.6-4"/>'),
|
|
1115
1127
|
rowbefore: y(
|
|
1116
1128
|
"M200-160h560v-240H200v240Zm640 80H120v-720h160v80h-80v240h560v-240h-80v-80h160v720ZM480-480Zm0 80v-80 80Zm0 0Zm-40-240v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80Z"
|
|
1117
1129
|
),
|
|
@@ -1130,9 +1142,6 @@ const De = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1130
1142
|
coldelete: y(
|
|
1131
1143
|
"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"
|
|
1132
1144
|
),
|
|
1133
|
-
tabledelete: R(
|
|
1134
|
-
'<rect x="4" y="5" width="16" height="14" rx="1.5"/><path d="M4 10h16M4 14.5h16M9.5 5v14M14.5 5v14"/><path d="M6.5 6.5l11 11M17.5 6.5l-11 11" stroke-width="2.1"/>'
|
|
1135
|
-
),
|
|
1136
1145
|
quote: y(
|
|
1137
1146
|
"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"
|
|
1138
1147
|
),
|
|
@@ -1166,29 +1175,44 @@ const De = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1166
1175
|
historyic: y(
|
|
1167
1176
|
"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"
|
|
1168
1177
|
),
|
|
1169
|
-
wordic:
|
|
1178
|
+
wordic: L(
|
|
1170
1179
|
'<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>'
|
|
1171
1180
|
),
|
|
1172
1181
|
draftic: y(
|
|
1173
1182
|
"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"
|
|
1174
1183
|
),
|
|
1175
|
-
trash:
|
|
1184
|
+
trash: L(
|
|
1176
1185
|
'<path d="M5 7h14M10 7V5h4v2M7.5 7l1 13h7l1-13"/>'
|
|
1177
1186
|
),
|
|
1178
|
-
|
|
1187
|
+
templateic: L(
|
|
1188
|
+
'<rect x="4" y="4" width="16" height="16" rx="1.5"/><rect x="6.5" y="6.5" width="5" height="5" rx=".5"/><path d="M14 7.5h3.5M14 10h3.5M6.5 14h11M6.5 17h11"/>'
|
|
1189
|
+
),
|
|
1190
|
+
tplleft: L(
|
|
1191
|
+
'<rect x="3" y="5" width="8" height="8" rx=".8"/><path d="M13.5 6.5H21M13.5 9.5H21M13.5 12.5H21M3 15.5h18M3 18.5h18"/>'
|
|
1192
|
+
),
|
|
1193
|
+
tplright: L(
|
|
1194
|
+
'<rect x="13" y="5" width="8" height="8" rx=".8"/><path d="M3 6.5h7.5M3 9.5h7.5M3 12.5h7.5M3 15.5h18M3 18.5h18"/>'
|
|
1195
|
+
),
|
|
1196
|
+
tpltop: L(
|
|
1197
|
+
'<rect x="5" y="3" width="14" height="9" rx=".8"/><path d="M3 15h18M3 18h18M3 21h12"/>'
|
|
1198
|
+
),
|
|
1199
|
+
tplcenter: L(
|
|
1200
|
+
'<path d="M3 4h18M3 7h18M3 10h12"/><rect x="5" y="12.5" width="14" height="9" rx=".8"/>'
|
|
1201
|
+
),
|
|
1202
|
+
rotateleft: L(
|
|
1179
1203
|
'<polyline points="1 4 1 10 7 10"/><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"/>'
|
|
1180
1204
|
),
|
|
1181
|
-
rotateright:
|
|
1205
|
+
rotateright: L(
|
|
1182
1206
|
'<polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/>'
|
|
1183
1207
|
),
|
|
1184
|
-
fliphorizontal:
|
|
1208
|
+
fliphorizontal: L(
|
|
1185
1209
|
'<path d="M12 3v18"/><path d="M7 8l-4 4 4 4"/><path d="M17 8l4 4-4 4"/>'
|
|
1186
1210
|
),
|
|
1187
|
-
flipvertical:
|
|
1211
|
+
flipvertical: L(
|
|
1188
1212
|
'<path d="M3 12h18"/><path d="M8 7l4-4 4 4"/><path d="M8 17l4 4 4-4"/>'
|
|
1189
1213
|
),
|
|
1190
|
-
check:
|
|
1191
|
-
palette:
|
|
1214
|
+
check: L('<path d="M5 12.5 9.5 17 19 7"/>'),
|
|
1215
|
+
palette: L(
|
|
1192
1216
|
'<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"/>'
|
|
1193
1217
|
),
|
|
1194
1218
|
ul_circle: y(
|
|
@@ -1201,7 +1225,7 @@ const De = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1201
1225
|
ol_roman: st(["i", "ii", "iii"], 6.5),
|
|
1202
1226
|
ol_alphau: st(["A", "B", "C"]),
|
|
1203
1227
|
ol_romanu: st(["I", "II", "III"], 6.5)
|
|
1204
|
-
},
|
|
1228
|
+
}, Ye = /* @__PURE__ */ new Set([
|
|
1205
1229
|
"p",
|
|
1206
1230
|
"div",
|
|
1207
1231
|
"span",
|
|
@@ -1243,7 +1267,7 @@ const De = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1243
1267
|
"figure",
|
|
1244
1268
|
"figcaption",
|
|
1245
1269
|
"mark"
|
|
1246
|
-
]),
|
|
1270
|
+
]), Qe = /* @__PURE__ */ new Set([
|
|
1247
1271
|
"text-align",
|
|
1248
1272
|
"direction",
|
|
1249
1273
|
"unicode-bidi",
|
|
@@ -1299,7 +1323,7 @@ const De = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1299
1323
|
"box-sizing",
|
|
1300
1324
|
"list-style-type",
|
|
1301
1325
|
"white-space"
|
|
1302
|
-
]),
|
|
1326
|
+
]), Qt = {
|
|
1303
1327
|
"*": ["dir", "lang", "colspan", "rowspan"],
|
|
1304
1328
|
a: ["href", "target", "rel", "title"],
|
|
1305
1329
|
img: ["src", "alt", "width", "height", "title"],
|
|
@@ -1315,13 +1339,13 @@ function ot(m) {
|
|
|
1315
1339
|
s < 1 || (t[i.slice(0, s).trim().toLowerCase()] = i.slice(s + 1).trim());
|
|
1316
1340
|
}), t;
|
|
1317
1341
|
}
|
|
1318
|
-
function
|
|
1342
|
+
function Ve(m) {
|
|
1319
1343
|
return m.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, "");
|
|
1320
1344
|
}
|
|
1321
|
-
function
|
|
1345
|
+
function Ge(m) {
|
|
1322
1346
|
return /^[0-9]+[\.\)،]/.test(m) ? { ordered: !0 } : /^[٠-٩۰-۹]+/.test(m) ? { ordered: !0, style: "arabic-indic" } : /^[ivxlc]{2,}[\.\)]/.test(m) ? { ordered: !0, style: "lower-roman" } : /^[IVXLC]{2,}[\.\)]/.test(m) ? { ordered: !0, style: "upper-roman" } : /^[a-z][\.\)]/.test(m) ? { ordered: !0, style: "lower-alpha" } : /^[A-Z][\.\)]/.test(m) ? { ordered: !0, style: "upper-alpha" } : /^[ء-ي][\.\)،-]/.test(m) ? { ordered: !0, style: "arabic-indic" } : { ordered: !1 };
|
|
1323
1347
|
}
|
|
1324
|
-
function
|
|
1348
|
+
function Ke(m) {
|
|
1325
1349
|
const t = (s) => {
|
|
1326
1350
|
const r = (s.getAttribute("style") || "") + " " + (s.className || "");
|
|
1327
1351
|
return /mso-list\s*:(?!\s*ignore)/i.test(r) || /MsoListParagraph/i.test(r);
|
|
@@ -1337,10 +1361,10 @@ function Ve(m) {
|
|
|
1337
1361
|
}), e.forEach((s) => {
|
|
1338
1362
|
const r = [], l = s[0];
|
|
1339
1363
|
s.forEach((o) => {
|
|
1340
|
-
var q, M,
|
|
1364
|
+
var q, M, P;
|
|
1341
1365
|
const c = +(((q = (o.getAttribute("style") || "").match(/level(\d+)/i)) == null ? void 0 : q[1]) || 1), d = Array.from(o.querySelectorAll("span")).find(
|
|
1342
1366
|
(I) => /mso-list\s*:\s*ignore/i.test(I.getAttribute("style") || "")
|
|
1343
|
-
), u = d ? ((M = d.textContent) == null ? void 0 : M.trim()) || "" : (((
|
|
1367
|
+
), u = d ? ((M = d.textContent) == null ? void 0 : M.trim()) || "" : (((P = o.textContent) == null ? void 0 : P.trim().match(/^\S{1,4}/)) || [""])[0], { ordered: v, style: b } = Ge(u);
|
|
1344
1368
|
for (d && d.remove(); r.length && r[r.length - 1].level > c; ) r.pop();
|
|
1345
1369
|
if (!r.length || r[r.length - 1].level < c) {
|
|
1346
1370
|
const I = m.createElement(v ? "ol" : "ul");
|
|
@@ -1357,13 +1381,13 @@ function Ve(m) {
|
|
|
1357
1381
|
});
|
|
1358
1382
|
});
|
|
1359
1383
|
}
|
|
1360
|
-
function
|
|
1384
|
+
function Je(m) {
|
|
1361
1385
|
m.querySelectorAll('b[id^="docs-internal-guid"]').forEach((t) => {
|
|
1362
1386
|
for (; t.firstChild; ) t.parentNode.insertBefore(t.firstChild, t);
|
|
1363
1387
|
t.remove();
|
|
1364
1388
|
});
|
|
1365
1389
|
}
|
|
1366
|
-
function
|
|
1390
|
+
function ti(m) {
|
|
1367
1391
|
m.querySelectorAll("table").forEach((t) => {
|
|
1368
1392
|
const e = t;
|
|
1369
1393
|
ot(e)["border-collapse"] || (e.style.borderCollapse = "collapse");
|
|
@@ -1390,7 +1414,7 @@ function nt(m, t) {
|
|
|
1390
1414
|
}
|
|
1391
1415
|
if (e.nodeType !== Node.ELEMENT_NODE) return;
|
|
1392
1416
|
const i = e, s = i.tagName.toLowerCase();
|
|
1393
|
-
if (!
|
|
1417
|
+
if (!Ye.has(s)) {
|
|
1394
1418
|
if (s === "font") {
|
|
1395
1419
|
const a = t.createElement("span");
|
|
1396
1420
|
i.getAttribute("style") && a.setAttribute("style", i.getAttribute("style")), i.getAttribute("color") && (a.style.color = i.getAttribute("color")), i.getAttribute("face") && (a.style.fontFamily = i.getAttribute("face"));
|
|
@@ -1415,7 +1439,7 @@ function nt(m, t) {
|
|
|
1415
1439
|
i.remove();
|
|
1416
1440
|
return;
|
|
1417
1441
|
}
|
|
1418
|
-
const r = /* @__PURE__ */ new Set([...
|
|
1442
|
+
const r = /* @__PURE__ */ new Set([...Qt["*"] || [], ...Qt[s] || []]);
|
|
1419
1443
|
if (Array.from(i.attributes).forEach((a) => {
|
|
1420
1444
|
const c = a.name.toLowerCase();
|
|
1421
1445
|
c !== "style" && !r.has(c) && i.removeAttribute(a.name);
|
|
@@ -1433,14 +1457,14 @@ function nt(m, t) {
|
|
|
1433
1457
|
}
|
|
1434
1458
|
const l = ot(i), o = [];
|
|
1435
1459
|
for (const [a, c] of Object.entries(l))
|
|
1436
|
-
|
|
1460
|
+
Qe.has(a) && (/expression|javascript|url\s*\(\s*['"]?\s*file:/i.test(c) || a === "font-weight" && /^(400|normal)$/i.test(c) || a === "font-style" && /^normal$/i.test(c) || a === "text-decoration" && /^none$/i.test(c) || o.push(a + ":" + c));
|
|
1437
1461
|
if (o.length ? i.setAttribute("style", o.join(";")) : i.removeAttribute("style"), i.removeAttribute("class"), nt(i, t), s === "span" && !i.attributes.length) {
|
|
1438
1462
|
for (; i.firstChild; ) i.parentNode.insertBefore(i.firstChild, i);
|
|
1439
1463
|
i.remove();
|
|
1440
1464
|
}
|
|
1441
1465
|
});
|
|
1442
1466
|
}
|
|
1443
|
-
function
|
|
1467
|
+
function ei(m) {
|
|
1444
1468
|
const t = [], e = /<style[^>]*>([\s\S]*?)<\/style>/gi;
|
|
1445
1469
|
let i;
|
|
1446
1470
|
for (; i = e.exec(m); ) {
|
|
@@ -1458,7 +1482,7 @@ function Je(m) {
|
|
|
1458
1482
|
}
|
|
1459
1483
|
return t;
|
|
1460
1484
|
}
|
|
1461
|
-
function
|
|
1485
|
+
function ii(m, t) {
|
|
1462
1486
|
if (!t.length) return;
|
|
1463
1487
|
const e = /* @__PURE__ */ new Map();
|
|
1464
1488
|
t.forEach(({ sel: i, decls: s }) => {
|
|
@@ -1481,18 +1505,18 @@ function ti(m, t) {
|
|
|
1481
1505
|
s.setAttribute("style", d ? c + ";" + d : c);
|
|
1482
1506
|
});
|
|
1483
1507
|
}
|
|
1484
|
-
function
|
|
1508
|
+
function te(m) {
|
|
1485
1509
|
return m.replace(/[ﭐ-﷿ﹰ-ﻼ]+/g, (t) => t.normalize("NFKC"));
|
|
1486
1510
|
}
|
|
1487
|
-
function
|
|
1511
|
+
function si(m) {
|
|
1488
1512
|
const t = m.createTreeWalker(m.body, NodeFilter.SHOW_TEXT, null);
|
|
1489
1513
|
let e;
|
|
1490
1514
|
for (; e = t.nextNode(); )
|
|
1491
|
-
/[ﭐ-﷿ﹰ-ﻼ]/.test(e.nodeValue || "") && (e.nodeValue =
|
|
1515
|
+
/[ﭐ-﷿ﹰ-ﻼ]/.test(e.nodeValue || "") && (e.nodeValue = te(e.nodeValue || ""));
|
|
1492
1516
|
}
|
|
1493
|
-
function
|
|
1494
|
-
const e =
|
|
1495
|
-
|
|
1517
|
+
function ri(m, t = "ltr") {
|
|
1518
|
+
const e = ei(m), i = new DOMParser().parseFromString(Ve(m), "text/html");
|
|
1519
|
+
ii(i, e), /class="?Mso|mso-|urn:schemas-microsoft-com/i.test(i.body.innerHTML) && Ke(i), Je(i), ti(i), nt(i.body, i), si(i);
|
|
1496
1520
|
const s = (r) => {
|
|
1497
1521
|
var l;
|
|
1498
1522
|
return r && r.tagName === "P" && !((l = r.textContent) != null && l.trim()) && !r.querySelector("img,table");
|
|
@@ -1501,11 +1525,11 @@ function ii(m, t = "ltr") {
|
|
|
1501
1525
|
for (; s(i.body.lastElementChild); ) i.body.lastElementChild.remove();
|
|
1502
1526
|
return i.body.innerHTML.trim();
|
|
1503
1527
|
}
|
|
1504
|
-
function
|
|
1505
|
-
const t =
|
|
1528
|
+
function ni(m) {
|
|
1529
|
+
const t = te(m).replace(/\r/g, ""), e = (i) => i.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
1506
1530
|
return /\n/.test(t) ? t.split(/\n{2,}/).map((i) => `<p dir="auto">${e(i).replace(/\n/g, "<br>") || "<br>"}</p>`).join("") : e(t);
|
|
1507
1531
|
}
|
|
1508
|
-
function
|
|
1532
|
+
function li(m) {
|
|
1509
1533
|
const t = new DataView(m), e = /* @__PURE__ */ new Map();
|
|
1510
1534
|
let i = -1;
|
|
1511
1535
|
for (let o = m.byteLength - 22; o >= Math.max(0, m.byteLength - 22 - 65535); o--)
|
|
@@ -1523,7 +1547,7 @@ function ri(m) {
|
|
|
1523
1547
|
}
|
|
1524
1548
|
return e;
|
|
1525
1549
|
}
|
|
1526
|
-
async function
|
|
1550
|
+
async function Vt(m, t) {
|
|
1527
1551
|
const e = new DataView(m, t.localOffset);
|
|
1528
1552
|
if (e.getUint32(0, !0) !== 67324752) throw new Error("Bad local header");
|
|
1529
1553
|
const i = e.getUint16(26, !0), s = e.getUint16(28, !0), r = t.localOffset + 30 + i + s, l = new Uint8Array(m.slice(r, r + t.compSize));
|
|
@@ -1532,7 +1556,7 @@ async function Yt(m, t) {
|
|
|
1532
1556
|
const o = new Blob([l]).stream().pipeThrough(new DecompressionStream("deflate-raw"));
|
|
1533
1557
|
return new Uint8Array(await new Response(o).arrayBuffer());
|
|
1534
1558
|
}
|
|
1535
|
-
const
|
|
1559
|
+
const Gt = (m) => m.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """), lt = (m, t) => Array.from(m.children).filter((e) => e.localName === t), Z = (m, ...t) => {
|
|
1536
1560
|
let e = m;
|
|
1537
1561
|
for (const i of t) {
|
|
1538
1562
|
if (!e) return null;
|
|
@@ -1549,7 +1573,7 @@ const Qt = (m) => m.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, "
|
|
|
1549
1573
|
if (!e) return !1;
|
|
1550
1574
|
const i = H(e);
|
|
1551
1575
|
return i !== "false" && i !== "0";
|
|
1552
|
-
},
|
|
1576
|
+
}, Kt = {
|
|
1553
1577
|
yellow: "#FFFF00",
|
|
1554
1578
|
green: "#00FF00",
|
|
1555
1579
|
cyan: "#00FFFF",
|
|
@@ -1566,7 +1590,7 @@ const Qt = (m) => m.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, "
|
|
|
1566
1590
|
lightGray: "#D3D3D3",
|
|
1567
1591
|
black: "#000000",
|
|
1568
1592
|
white: "#FFFFFF"
|
|
1569
|
-
},
|
|
1593
|
+
}, oi = {
|
|
1570
1594
|
png: "image/png",
|
|
1571
1595
|
jpg: "image/jpeg",
|
|
1572
1596
|
jpeg: "image/jpeg",
|
|
@@ -1574,13 +1598,13 @@ const Qt = (m) => m.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, "
|
|
|
1574
1598
|
bmp: "image/bmp",
|
|
1575
1599
|
webp: "image/webp"
|
|
1576
1600
|
};
|
|
1577
|
-
function
|
|
1601
|
+
function ai(m) {
|
|
1578
1602
|
let t = "";
|
|
1579
1603
|
for (let e = 0; e < m.length; e += 32768)
|
|
1580
1604
|
t += String.fromCharCode(...m.subarray(e, e + 32768));
|
|
1581
1605
|
return btoa(t);
|
|
1582
1606
|
}
|
|
1583
|
-
class
|
|
1607
|
+
class ci {
|
|
1584
1608
|
constructor(t, e, i) {
|
|
1585
1609
|
this.rels = t, this.images = e, this.numFmt = i;
|
|
1586
1610
|
}
|
|
@@ -1631,7 +1655,7 @@ class oi {
|
|
|
1631
1655
|
const r = H(i, "anchor");
|
|
1632
1656
|
!s && r && (s = "#" + r);
|
|
1633
1657
|
const l = this.runsOf(i);
|
|
1634
|
-
e += s ? `<a href="${
|
|
1658
|
+
e += s ? `<a href="${Gt(s)}">${l}</a>` : l;
|
|
1635
1659
|
} else (i.localName === "smartTag" || i.localName === "ins") && (e += this.runsOf(i));
|
|
1636
1660
|
return e;
|
|
1637
1661
|
}
|
|
@@ -1639,12 +1663,12 @@ class oi {
|
|
|
1639
1663
|
const e = Z(t, "rPr");
|
|
1640
1664
|
let i = "";
|
|
1641
1665
|
for (const u of Array.from(t.children))
|
|
1642
|
-
u.localName === "t" ? i +=
|
|
1666
|
+
u.localName === "t" ? i += Gt(u.textContent || "") : u.localName === "br" || u.localName === "cr" ? i += "<br>" : u.localName === "tab" ? i += " " : (u.localName === "drawing" || u.localName === "pict" || u.localName === "object") && (i += this.convertImage(u));
|
|
1643
1667
|
if (!i) return "";
|
|
1644
1668
|
const s = [], r = H(e ? Z(e, "color") : null);
|
|
1645
1669
|
r && r !== "auto" && s.push("color:#" + r);
|
|
1646
1670
|
const l = H(e ? Z(e, "highlight") : null);
|
|
1647
|
-
l &&
|
|
1671
|
+
l && Kt[l] && s.push("background-color:" + Kt[l]);
|
|
1648
1672
|
const o = parseFloat(H(e ? Z(e, "sz") : null));
|
|
1649
1673
|
o && s.push("font-size:" + Math.round(o / 2 * (4 / 3)) + "px");
|
|
1650
1674
|
const a = e ? Z(e, "rFonts") : null, c = H(a, "ascii") || H(a, "cs");
|
|
@@ -1683,10 +1707,10 @@ class oi {
|
|
|
1683
1707
|
return e + "</tbody></table>";
|
|
1684
1708
|
}
|
|
1685
1709
|
}
|
|
1686
|
-
async function
|
|
1687
|
-
const t = m instanceof ArrayBuffer ? m : await m.arrayBuffer(), e =
|
|
1710
|
+
async function hi(m) {
|
|
1711
|
+
const t = m instanceof ArrayBuffer ? m : await m.arrayBuffer(), e = li(t), i = new TextDecoder(), s = async (f) => {
|
|
1688
1712
|
const w = e.get(f);
|
|
1689
|
-
return w ? new DOMParser().parseFromString(i.decode(await
|
|
1713
|
+
return w ? new DOMParser().parseFromString(i.decode(await Vt(t, w)), "application/xml") : null;
|
|
1690
1714
|
}, r = await s("word/document.xml"), l = r == null ? void 0 : r.getElementsByTagName("*");
|
|
1691
1715
|
let o = null;
|
|
1692
1716
|
if (l) {
|
|
@@ -1708,10 +1732,10 @@ async function ai(m) {
|
|
|
1708
1732
|
for (const [f, w] of c) {
|
|
1709
1733
|
const E = w.startsWith("/") ? w.slice(1) : "word/" + w.replace(/^\.\//, ""), q = e.get(E);
|
|
1710
1734
|
if (!q) continue;
|
|
1711
|
-
const M = (E.split(".").pop() || "").toLowerCase(),
|
|
1712
|
-
if (
|
|
1735
|
+
const M = (E.split(".").pop() || "").toLowerCase(), P = oi[M];
|
|
1736
|
+
if (P)
|
|
1713
1737
|
try {
|
|
1714
|
-
u.set(f, `data:${
|
|
1738
|
+
u.set(f, `data:${P};base64,${ai(await Vt(t, q))}`);
|
|
1715
1739
|
} catch {
|
|
1716
1740
|
}
|
|
1717
1741
|
}
|
|
@@ -1720,8 +1744,8 @@ async function ai(m) {
|
|
|
1720
1744
|
const f = /* @__PURE__ */ new Map(), w = Array.from(b.getElementsByTagName("*"));
|
|
1721
1745
|
for (const E of w) {
|
|
1722
1746
|
if (E.localName !== "abstractNum") continue;
|
|
1723
|
-
const q = H(E, "abstractNumId"), M = lt(E, "lvl").find((I) => H(I, "ilvl") === "0") || lt(E, "lvl")[0],
|
|
1724
|
-
f.set(q,
|
|
1747
|
+
const q = H(E, "abstractNumId"), M = lt(E, "lvl").find((I) => H(I, "ilvl") === "0") || lt(E, "lvl")[0], P = M ? H(Z(M, "numFmt")) : "";
|
|
1748
|
+
f.set(q, P === "bullet" ? "ul" : "ol");
|
|
1725
1749
|
}
|
|
1726
1750
|
for (const E of w) {
|
|
1727
1751
|
if (E.localName !== "num") continue;
|
|
@@ -1729,13 +1753,23 @@ async function ai(m) {
|
|
|
1729
1753
|
v.set(q, f.get(M) || "ul");
|
|
1730
1754
|
}
|
|
1731
1755
|
}
|
|
1732
|
-
return new
|
|
1756
|
+
return new ci(a, u, v).convertBody(o);
|
|
1733
1757
|
}
|
|
1734
|
-
const
|
|
1735
|
-
|
|
1736
|
-
|
|
1758
|
+
const di = ["nw", "ne", "sw", "se"], bt = ["img-left", "img-right", "img-top", "img-center"], yt = {
|
|
1759
|
+
"img-left": "tplimgleft",
|
|
1760
|
+
"img-right": "tplimgright",
|
|
1761
|
+
"img-top": "tplimgtop",
|
|
1762
|
+
"img-center": "tplimgcenter"
|
|
1763
|
+
}, ui = {
|
|
1764
|
+
"img-left": h.tplleft,
|
|
1765
|
+
"img-right": h.tplright,
|
|
1766
|
+
"img-top": h.tpltop,
|
|
1767
|
+
"img-center": h.tplcenter
|
|
1768
|
+
};
|
|
1769
|
+
var W;
|
|
1770
|
+
let pi = (W = class {
|
|
1737
1771
|
constructor(t) {
|
|
1738
|
-
this.lang = "en", this.contentClass = "fable-content-" +
|
|
1772
|
+
this.lang = "en", this.contentClass = "fable-content-" + W.instanceCounter++, this.contentStyleEl = null, this.savedRange = null, this.foreColor = "#000000", this.backColor = "#FACC15", this.openPop = null, this.openSubEl = null, this.popAnchor = null, this.dlgOvl = null, this.tblActive = null, this.tblCorner = null, this.tblColBars = [], this.tblCtx = null, this.tblCellMark = null, this.tblOpMark = null, this.tblOpMarkKind = null, this.imgActive = null, this.imgHandles = [], this.imgCtx = null, this.imgHideTimer = null, this.phActive = null, this.phCtx = null, this.phUploadTarget = null, this.selCtx = null, this.tplActive = null, this.tplCtx = null, this.revisions = [], this.revTimer = null, this.draftTimer = null, this.draftStorageKey = "", this.listeners = [], this.isDestroyed = !1, this.options = {
|
|
1739
1773
|
target: t.target,
|
|
1740
1774
|
language: t.language || "en",
|
|
1741
1775
|
height: t.height ?? 302,
|
|
@@ -1749,7 +1783,7 @@ let hi = (z = class {
|
|
|
1749
1783
|
statusbar: t.statusbar ?? !0,
|
|
1750
1784
|
readonly: t.readonly ?? !1,
|
|
1751
1785
|
draftKey: t.draftKey ?? (typeof location < "u" ? location.pathname : "default"),
|
|
1752
|
-
fontFamilyFormats: t.fontFamilyFormats ??
|
|
1786
|
+
fontFamilyFormats: t.fontFamilyFormats ?? Be,
|
|
1753
1787
|
imageFileTypes: t.imageFileTypes ?? ["image/jpeg", "image/jpg", "image/png", "image/gif", "image/bmp", "image/webp"]
|
|
1754
1788
|
}, this.imageUploadHandler = t.imageUploadHandler, this.onImageUploadError = t.onImageUploadError, this.contentStyle = t.contentStyle, this.lang = this.options.language, this.draftStorageKey = "tmclone-draft:" + this.options.draftKey, this.initDOM(), this.bindEvents(), this.initUI(), this.recordRevision(), this.options.onReady(this);
|
|
1755
1789
|
}
|
|
@@ -1806,9 +1840,9 @@ let hi = (z = class {
|
|
|
1806
1840
|
const t = window.getSelection();
|
|
1807
1841
|
t && this.ed.contains(t.anchorNode) ? (this.saveSel(), this.refreshState(), this.updateSelToolbar(t), this.positionCellMarker()) : this.clearSelToolbar();
|
|
1808
1842
|
}), this.on(this.ed, "input", () => {
|
|
1809
|
-
this.refreshState(), this.onChange(), this.positionTableHandles(), this.positionImageHandles(), this.positionImgPhCtx();
|
|
1843
|
+
this.refreshState(), this.onChange(), this.positionTableHandles(), this.positionImageHandles(), this.positionImgPhCtx(), this.positionTplCtx();
|
|
1810
1844
|
}), this.on(this.ed, "keydown", (t) => {
|
|
1811
|
-
t.altKey && t.key === "0" && (t.preventDefault(), this.helpDlg());
|
|
1845
|
+
t.altKey && t.key === "0" && (t.preventDefault(), this.helpDlg()), (t.key === "Delete" || t.key === "Backspace") && this.phActive && (t.preventDefault(), this.removeImgPlaceholder());
|
|
1812
1846
|
}), this.on(this.ed, "paste", (t) => this.handlePaste(t)), this.on(this.ed, "drop", (t) => {
|
|
1813
1847
|
var s, r, l;
|
|
1814
1848
|
t.preventDefault();
|
|
@@ -1817,13 +1851,15 @@ let hi = (z = class {
|
|
|
1817
1851
|
const i = Array.from(((l = t.dataTransfer) == null ? void 0 : l.files) || []).find((o) => o.type.startsWith("image/"));
|
|
1818
1852
|
i && this.readImageFileInto(i, e);
|
|
1819
1853
|
}), this.on(this.ed, "dragover", (t) => t.preventDefault()), this.on(this.ed, "mousedown", (t) => {
|
|
1820
|
-
var
|
|
1821
|
-
const e = t.target, i = (
|
|
1854
|
+
var o, a, c, d;
|
|
1855
|
+
const e = t.target, i = (o = e.closest) == null ? void 0 : o.call(e, "table");
|
|
1822
1856
|
i && this.ed.contains(i) ? this.selectTableForResize(i) : this.clearTableHandles();
|
|
1823
|
-
const s = (
|
|
1824
|
-
s && this.ed.contains(s) && !this.options.readonly ? (t.preventDefault(), this.selectImgPlaceholder(s)) : this.clearImgPlaceholderSel();
|
|
1825
|
-
const r = (
|
|
1826
|
-
r && this.ed.contains(r) && !this.options.readonly ?
|
|
1857
|
+
const s = (a = e.closest) == null ? void 0 : a.call(e, ".img-ph");
|
|
1858
|
+
s && this.ed.contains(s) && !this.options.readonly ? (t.preventDefault(), this.ed.focus(), this.selectImgPlaceholder(s)) : this.clearImgPlaceholderSel();
|
|
1859
|
+
const r = (c = e.closest) == null ? void 0 : c.call(e, ".tpl");
|
|
1860
|
+
r && this.ed.contains(r) && !this.options.readonly ? this.selectTemplate(r) : this.clearTplSel();
|
|
1861
|
+
const l = (d = e.closest) == null ? void 0 : d.call(e, "img");
|
|
1862
|
+
l && this.ed.contains(l) && !this.options.readonly ? (t.preventDefault(), this.selectImage(l)) : this.clearImageHandles();
|
|
1827
1863
|
}), this.on(this.ed, "mouseover", (t) => {
|
|
1828
1864
|
var i, s;
|
|
1829
1865
|
if (this.options.readonly) return;
|
|
@@ -1836,15 +1872,15 @@ let hi = (z = class {
|
|
|
1836
1872
|
const i = t.relatedTarget;
|
|
1837
1873
|
i && ((l = this.imgCtx) != null && l.contains(i) || this.imgHandles.some((a) => a.contains(i)) || ((o = i.closest) == null ? void 0 : o.call(i, "img")) === e) || this.scheduleImgHide();
|
|
1838
1874
|
}), this.on(this.ed, "scroll", () => {
|
|
1839
|
-
this.positionTableHandles(), this.positionImageHandles(), this.positionImgPhCtx();
|
|
1875
|
+
this.positionTableHandles(), this.positionImageHandles(), this.positionImgPhCtx(), this.positionTplCtx();
|
|
1840
1876
|
}), this.onWin(
|
|
1841
1877
|
"scroll",
|
|
1842
1878
|
() => {
|
|
1843
|
-
this.positionTableHandles(), this.positionImageHandles(), this.positionImgPhCtx(), this.repositionSelToolbar();
|
|
1879
|
+
this.positionTableHandles(), this.positionImageHandles(), this.positionImgPhCtx(), this.positionTplCtx(), this.repositionSelToolbar();
|
|
1844
1880
|
},
|
|
1845
1881
|
!0
|
|
1846
1882
|
), this.onWin("resize", () => {
|
|
1847
|
-
this.positionTableHandles(), this.positionImageHandles(), this.positionImgPhCtx(), this.repositionSelToolbar();
|
|
1883
|
+
this.positionTableHandles(), this.positionImageHandles(), this.positionImgPhCtx(), this.positionTplCtx(), this.repositionSelToolbar();
|
|
1848
1884
|
}), this.on(this.imgInput, "change", () => {
|
|
1849
1885
|
var s;
|
|
1850
1886
|
const t = (s = this.imgInput.files) == null ? void 0 : s[0];
|
|
@@ -1867,7 +1903,7 @@ let hi = (z = class {
|
|
|
1867
1903
|
const t = (e = this.docInput.files) == null ? void 0 : e[0];
|
|
1868
1904
|
t && this.importWordFile(t).catch(() => alert(this.t("importfail")));
|
|
1869
1905
|
}), this.onDoc("mousedown", (t) => {
|
|
1870
|
-
this.ed.contains(t.target) || t.target === this.tblCorner || this.tblColBars.includes(t.target) || this.tblCtx && this.tblCtx.contains(t.target) || this.imgHandles.includes(t.target) || this.imgCtx && this.imgCtx.contains(t.target) || this.phCtx && this.phCtx.contains(t.target) || this.selCtx && this.selCtx.contains(t.target) || this.openPop && this.openPop.contains(t.target) || this.openSubEl && this.openSubEl.contains(t.target) || (this.clearTableHandles(), this.clearImageHandles(), this.clearImgPlaceholderSel(), this.clearSelToolbar());
|
|
1906
|
+
this.ed.contains(t.target) || t.target === this.tblCorner || this.tblColBars.includes(t.target) || this.tblCtx && this.tblCtx.contains(t.target) || this.imgHandles.includes(t.target) || this.imgCtx && this.imgCtx.contains(t.target) || this.phCtx && this.phCtx.contains(t.target) || this.tplCtx && this.tplCtx.contains(t.target) || this.selCtx && this.selCtx.contains(t.target) || this.openPop && this.openPop.contains(t.target) || this.openSubEl && this.openSubEl.contains(t.target) || (this.clearTableHandles(), this.clearImageHandles(), this.clearImgPlaceholderSel(), this.clearTplSel(), this.clearSelToolbar());
|
|
1871
1907
|
});
|
|
1872
1908
|
}
|
|
1873
1909
|
on(t, e, i) {
|
|
@@ -1884,7 +1920,7 @@ let hi = (z = class {
|
|
|
1884
1920
|
return this.ed.innerHTML;
|
|
1885
1921
|
}
|
|
1886
1922
|
setContent(t) {
|
|
1887
|
-
this.ed.innerHTML = t || "<p><br></p>", this.refreshState(), this.clearTableHandles(), this.clearImageHandles(), this.clearImgPlaceholderSel(), this.clearSelToolbar(), this.onChange();
|
|
1923
|
+
this.ed.innerHTML = t || "<p><br></p>", this.refreshState(), this.clearTableHandles(), this.clearImageHandles(), this.clearImgPlaceholderSel(), this.clearTplSel(), this.clearSelToolbar(), this.onChange();
|
|
1888
1924
|
}
|
|
1889
1925
|
insertContent(t) {
|
|
1890
1926
|
this.restoreSel(), document.execCommand("insertHTML", !1, t), this.saveSel(), this.refreshState(), this.onChange();
|
|
@@ -1896,7 +1932,7 @@ let hi = (z = class {
|
|
|
1896
1932
|
this.ed.focus();
|
|
1897
1933
|
}
|
|
1898
1934
|
async importWordFile(t) {
|
|
1899
|
-
const e = await
|
|
1935
|
+
const e = await hi(t);
|
|
1900
1936
|
this.recordRevision(), this.setContent(e), this.recordRevision();
|
|
1901
1937
|
}
|
|
1902
1938
|
restoreDraft() {
|
|
@@ -1917,7 +1953,7 @@ let hi = (z = class {
|
|
|
1917
1953
|
return this.revisions.slice();
|
|
1918
1954
|
}
|
|
1919
1955
|
destroy() {
|
|
1920
|
-
this.isDestroyed || (this.isDestroyed = !0, this.revTimer != null && window.clearTimeout(this.revTimer), this.draftTimer != null && window.clearTimeout(this.draftTimer), this.closePop(), this.closeDlg(), this.clearTableHandles(), this.clearImageHandles(), this.clearImgPlaceholderSel(), this.clearSelToolbar(), this.listeners.forEach((t) => t()), this.listeners = [], this.shell && this.shell.parentNode && this.shell.parentNode.removeChild(this.shell), this.imgInput && this.imgInput.parentNode && this.imgInput.parentNode.removeChild(this.imgInput), this.docInput && this.docInput.parentNode && this.docInput.parentNode.removeChild(this.docInput), this.contentStyleEl = null);
|
|
1956
|
+
this.isDestroyed || (this.isDestroyed = !0, this.revTimer != null && window.clearTimeout(this.revTimer), this.draftTimer != null && window.clearTimeout(this.draftTimer), this.closePop(), this.closeDlg(), this.clearTableHandles(), this.clearImageHandles(), this.clearImgPlaceholderSel(), this.clearTplSel(), this.clearSelToolbar(), this.listeners.forEach((t) => t()), this.listeners = [], this.shell && this.shell.parentNode && this.shell.parentNode.removeChild(this.shell), this.imgInput && this.imgInput.parentNode && this.imgInput.parentNode.removeChild(this.imgInput), this.docInput && this.docInput.parentNode && this.docInput.parentNode.removeChild(this.docInput), this.contentStyleEl = null);
|
|
1921
1957
|
}
|
|
1922
1958
|
/* ---------------------------------------------------------- selection */
|
|
1923
1959
|
saveSel() {
|
|
@@ -2094,7 +2130,7 @@ let hi = (z = class {
|
|
|
2094
2130
|
return r.type = "button", r.className = "cchip", r.title = s, r.addEventListener("mousedown", (l) => {
|
|
2095
2131
|
l.preventDefault(), this.saveSel();
|
|
2096
2132
|
}), r;
|
|
2097
|
-
}, e =
|
|
2133
|
+
}, e = ze.map((s) => {
|
|
2098
2134
|
const r = t(this.t("forecolor"));
|
|
2099
2135
|
return r.style.background = s, r.addEventListener("click", () => this.applyColor("fore", s)), r;
|
|
2100
2136
|
}), i = t(this.t("forecolor"));
|
|
@@ -2152,7 +2188,7 @@ let hi = (z = class {
|
|
|
2152
2188
|
colorMenu(t, e) {
|
|
2153
2189
|
this.popup(t, (i) => {
|
|
2154
2190
|
const s = document.createElement("div");
|
|
2155
|
-
s.className = "cpal",
|
|
2191
|
+
s.className = "cpal", Ue.forEach((u) => {
|
|
2156
2192
|
const v = document.createElement("button");
|
|
2157
2193
|
v.style.background = u, v.title = u, v.addEventListener("click", () => {
|
|
2158
2194
|
this.closePop(), this.applyColor(e, u);
|
|
@@ -2199,7 +2235,7 @@ let hi = (z = class {
|
|
|
2199
2235
|
this.popup(t, (e) => {
|
|
2200
2236
|
this.menuItems(
|
|
2201
2237
|
e,
|
|
2202
|
-
|
|
2238
|
+
Fe.map((i) => ({
|
|
2203
2239
|
label: i,
|
|
2204
2240
|
on: this.currentSize() === i,
|
|
2205
2241
|
action: () => this.applyFontSize(i)
|
|
@@ -2251,7 +2287,7 @@ let hi = (z = class {
|
|
|
2251
2287
|
this.saveSel(), this.refreshState(), this.onChange();
|
|
2252
2288
|
}
|
|
2253
2289
|
stepFontSize(t) {
|
|
2254
|
-
const e = parseInt(this.currentSize(), 10) || 14, i = Math.min(
|
|
2290
|
+
const e = parseInt(this.currentSize(), 10) || 14, i = Math.min(_e, Math.max($e, e + t));
|
|
2255
2291
|
i !== e && this.applyFontSize(i + "px");
|
|
2256
2292
|
}
|
|
2257
2293
|
/* ------------------------------------------------ case / spacing / link */
|
|
@@ -2293,7 +2329,7 @@ let hi = (z = class {
|
|
|
2293
2329
|
this.popup(t, (i) => {
|
|
2294
2330
|
this.menuItems(i, [
|
|
2295
2331
|
{ label: this.t("normal"), on: !e, action: () => this.applyBlockStyle("lineHeight", "") },
|
|
2296
|
-
...
|
|
2332
|
+
...je.map((s) => ({
|
|
2297
2333
|
label: s,
|
|
2298
2334
|
on: e === s,
|
|
2299
2335
|
action: () => this.applyBlockStyle("lineHeight", s)
|
|
@@ -2306,7 +2342,7 @@ let hi = (z = class {
|
|
|
2306
2342
|
this.popup(t, (i) => {
|
|
2307
2343
|
this.menuItems(i, [
|
|
2308
2344
|
{ label: this.t("normal"), on: !e, action: () => this.applyBlockStyle("wordSpacing", "") },
|
|
2309
|
-
|
|
2345
|
+
...We.map((s) => ({
|
|
2310
2346
|
label: s,
|
|
2311
2347
|
on: e === s,
|
|
2312
2348
|
action: () => this.applyBlockStyle("wordSpacing", s)
|
|
@@ -2368,7 +2404,7 @@ let hi = (z = class {
|
|
|
2368
2404
|
this.popup(t, (e) => {
|
|
2369
2405
|
this.menuItems(
|
|
2370
2406
|
e,
|
|
2371
|
-
|
|
2407
|
+
Yt.map(([i, s]) => ({
|
|
2372
2408
|
label: this.blockLabel(i),
|
|
2373
2409
|
previewStyle: i.startsWith("h") ? `font-weight:700;font-size:${22 - 2 * +i[1]}px` : i === "pre" ? "font-family:monospace" : "",
|
|
2374
2410
|
on: this.currentBlock() === i,
|
|
@@ -2471,6 +2507,7 @@ let hi = (z = class {
|
|
|
2471
2507
|
rtl: () => this.tbtn(h.rtl, this.t("rtl"), () => this.setDir("rtl"), "rtl"),
|
|
2472
2508
|
quickimage: () => this.tbtn(h.image, this.t("quickimage"), () => this.insertImagePlaceholder()),
|
|
2473
2509
|
quicktable: () => t,
|
|
2510
|
+
template: () => this.menuTbtn(h.templateic, this.t("template"), (e) => this.templateMenu(e)),
|
|
2474
2511
|
charmap: () => this.tbtn(h.charic, this.t("charmap"), () => this.charMap()),
|
|
2475
2512
|
fullscreen: () => this.tbtn(h.fullscreen, this.t("fullscreen"), () => this.toggleFullscreen(), "fullscreen"),
|
|
2476
2513
|
sourcecode: () => this.tbtn(h.srcic, this.t("sourcecode"), () => this.sourceDlg())
|
|
@@ -2478,7 +2515,7 @@ let hi = (z = class {
|
|
|
2478
2515
|
}
|
|
2479
2516
|
buildToolbar() {
|
|
2480
2517
|
this.toolbar.innerHTML = "";
|
|
2481
|
-
const t = this.options.toolbar === !0 ?
|
|
2518
|
+
const t = this.options.toolbar === !0 ? Ne : this.options.toolbar, e = this.buildToolbarRegistry();
|
|
2482
2519
|
this.parseToolbarString(t).forEach((i) => {
|
|
2483
2520
|
const s = [];
|
|
2484
2521
|
i.forEach((r) => {
|
|
@@ -2532,6 +2569,7 @@ let hi = (z = class {
|
|
|
2532
2569
|
this.mItem("link", h.link, () => this.linkDlg()),
|
|
2533
2570
|
this.mItem("image", h.image, () => this.insertImagePlaceholder()),
|
|
2534
2571
|
{ label: this.t("inserttable"), icon: h.tableic, action: () => this.tableGrid(this.menubar.querySelector('[data-menu-key="table"]') || this.menubar) },
|
|
2572
|
+
{ label: this.t("template"), icon: h.templateic, subBuild: (s) => this.buildTemplatePickInto(s) },
|
|
2535
2573
|
this.mItem("hr", h.hric, () => this.exec("insertHorizontalRule")),
|
|
2536
2574
|
"|",
|
|
2537
2575
|
this.mItem("charmap", h.charic, () => this.charMap()),
|
|
@@ -2605,10 +2643,10 @@ let hi = (z = class {
|
|
|
2605
2643
|
this.tblActive = s.closest("table"), this.tablePropsDlg();
|
|
2606
2644
|
}
|
|
2607
2645
|
},
|
|
2608
|
-
{ label: this.t("deltable"), icon: h.
|
|
2646
|
+
{ label: this.t("deltable"), icon: h.trash, action: () => this.tableOp("deltable") }
|
|
2609
2647
|
],
|
|
2610
2648
|
help: [this.mItem("helpttl", h.helpic, () => this.helpDlg(), "Alt+0")]
|
|
2611
|
-
}, e = this.options.menubar === !0 ?
|
|
2649
|
+
}, e = this.options.menubar === !0 ? Oe : this.options.menubar, i = /* @__PURE__ */ new Set();
|
|
2612
2650
|
e.split(/\s+/).filter(Boolean).forEach((s) => {
|
|
2613
2651
|
if (i.has(s)) return;
|
|
2614
2652
|
if (i.add(s), !t[s]) {
|
|
@@ -2661,13 +2699,13 @@ let hi = (z = class {
|
|
|
2661
2699
|
this.dialog(
|
|
2662
2700
|
this.t("tablepropsttl"),
|
|
2663
2701
|
(M) => {
|
|
2664
|
-
const
|
|
2702
|
+
const P = (I, F) => {
|
|
2665
2703
|
const B = document.createElement("div");
|
|
2666
2704
|
B.style.cssText = o;
|
|
2667
2705
|
const Y = document.createElement("span");
|
|
2668
2706
|
Y.style.cssText = a, Y.textContent = this.t(I), B.append(Y, F), M.appendChild(B);
|
|
2669
2707
|
};
|
|
2670
|
-
e = document.createElement("input"), e.type = "text", e.style.cssText = c, e.placeholder = "e.g. 600px or 100%", e.value = u,
|
|
2708
|
+
e = document.createElement("input"), e.type = "text", e.style.cssText = c, e.placeholder = "e.g. 600px or 100%", e.value = u, P("tblwidth", e), i = document.createElement("input"), i.type = "number", i.min = "0", i.style.cssText = c, i.value = String(v), P("tblcellpadding", i), s = document.createElement("input"), s.type = "number", s.min = "0", s.style.cssText = c, s.value = String(b), P("tblcellspacing", s), r = document.createElement("input"), r.type = "number", r.min = "0", r.style.cssText = c, r.value = String(f), P("tblborder", r), l = document.createElement("select"), l.style.cssText = c, [
|
|
2671
2709
|
["", "alignnone"],
|
|
2672
2710
|
["left", "alignleft"],
|
|
2673
2711
|
["center", "aligncenter"],
|
|
@@ -2675,7 +2713,7 @@ let hi = (z = class {
|
|
|
2675
2713
|
].forEach(([I, F]) => {
|
|
2676
2714
|
const B = document.createElement("option");
|
|
2677
2715
|
B.value = I, B.textContent = this.t(F), I === q && (B.selected = !0), l.appendChild(B);
|
|
2678
|
-
}),
|
|
2716
|
+
}), P("tblalign", l);
|
|
2679
2717
|
},
|
|
2680
2718
|
[
|
|
2681
2719
|
{ label: this.t("cancel"), action: () => this.closeDlg() },
|
|
@@ -2905,7 +2943,7 @@ let hi = (z = class {
|
|
|
2905
2943
|
this.t("charmap").replace("…", ""),
|
|
2906
2944
|
(t) => {
|
|
2907
2945
|
const e = document.createElement("div");
|
|
2908
|
-
e.className = "chgrid",
|
|
2946
|
+
e.className = "chgrid", Xe.forEach((i) => {
|
|
2909
2947
|
const s = document.createElement("button");
|
|
2910
2948
|
s.textContent = i, s.onclick = () => {
|
|
2911
2949
|
this.closeDlg(), this.exec("insertText", i);
|
|
@@ -2924,14 +2962,13 @@ let hi = (z = class {
|
|
|
2924
2962
|
this.imgInput.value = "", this.imgInput.click();
|
|
2925
2963
|
}
|
|
2926
2964
|
/* ---------------------------------------------- image upload placeholder */
|
|
2965
|
+
imgPhHTML(t) {
|
|
2966
|
+
return `<div class="img-ph"${t ? ` id="${t}"` : ""} contenteditable="false">${h.image}<span>${this.t("dropimage")}</span></div>`;
|
|
2967
|
+
}
|
|
2927
2968
|
insertImagePlaceholder() {
|
|
2928
2969
|
this.restoreSel();
|
|
2929
2970
|
const t = "img-ph-" + Date.now().toString(36) + Math.random().toString(36).slice(2, 6);
|
|
2930
|
-
document.execCommand(
|
|
2931
|
-
"insertHTML",
|
|
2932
|
-
!1,
|
|
2933
|
-
`<div class="img-ph" id="${t}" contenteditable="false">${h.image}<span>${this.t("dropimage")}</span></div>`
|
|
2934
|
-
);
|
|
2971
|
+
document.execCommand("insertHTML", !1, this.imgPhHTML(t));
|
|
2935
2972
|
const e = this.ed.querySelector("#" + t);
|
|
2936
2973
|
e && (e.removeAttribute("id"), this.selectImgPlaceholder(e)), this.onChange();
|
|
2937
2974
|
}
|
|
@@ -2939,6 +2976,10 @@ let hi = (z = class {
|
|
|
2939
2976
|
var t, e;
|
|
2940
2977
|
(t = this.phCtx) == null || t.remove(), this.phCtx = null, (e = this.phActive) == null || e.classList.remove("active"), this.phActive = null;
|
|
2941
2978
|
}
|
|
2979
|
+
removeImgPlaceholder() {
|
|
2980
|
+
const t = this.phActive;
|
|
2981
|
+
t && (this.clearImgPlaceholderSel(), (t.closest(".tpl-media") || t).remove(), this.refreshState(), this.onChange());
|
|
2982
|
+
}
|
|
2942
2983
|
selectImgPlaceholder(t) {
|
|
2943
2984
|
this.phActive !== t && (this.clearImgPlaceholderSel(), this.phActive = t, t.classList.add("active"), this.phCtx = document.createElement("div"), this.phCtx.className = "imgctx img-ph-ctx", this.phCtx.dir = this.dir(), document.body.appendChild(this.phCtx), this.renderPhCtxButtons());
|
|
2944
2985
|
}
|
|
@@ -2948,7 +2989,9 @@ let hi = (z = class {
|
|
|
2948
2989
|
this.ctxBtn(h.uploadic, this.t("uploadimg"), () => {
|
|
2949
2990
|
this.phUploadTarget = this.phActive, this.pickImage();
|
|
2950
2991
|
}),
|
|
2951
|
-
this.ctxBtn(h.link, this.t("imagelink"), () => this.renderPhCtxUrlInput())
|
|
2992
|
+
this.ctxBtn(h.link, this.t("imagelink"), () => this.renderPhCtxUrlInput()),
|
|
2993
|
+
this.ctxSep(),
|
|
2994
|
+
this.ctxBtn(h.trash, this.t("deleteimg"), () => this.removeImgPlaceholder())
|
|
2952
2995
|
), this.positionImgPhCtx());
|
|
2953
2996
|
}
|
|
2954
2997
|
renderPhCtxUrlInput() {
|
|
@@ -3016,6 +3059,67 @@ let hi = (z = class {
|
|
|
3016
3059
|
let r = t.bottom + scrollY + 8;
|
|
3017
3060
|
t.bottom + 8 + i > innerHeight - 4 && (r = Math.max(this.ctxMinTop(), t.top + scrollY - i - 8)), this.phCtx.style.left = s + "px", this.phCtx.style.top = r + "px";
|
|
3018
3061
|
}
|
|
3062
|
+
/* ---------------------------------------------------------- templates */
|
|
3063
|
+
templateMenu(t) {
|
|
3064
|
+
this.popup(t, (e) => this.buildTemplatePickInto(e));
|
|
3065
|
+
}
|
|
3066
|
+
/** Miniature div-based mockup of a layout, mirroring what the block looks
|
|
3067
|
+
like in the editor: grey box = image slot, bars = heading/paragraph. */
|
|
3068
|
+
tplPreviewHTML(t) {
|
|
3069
|
+
const e = '<span class="pv-img"></span>', i = '<span class="pv-h"></span>', s = (a) => `<span class="pv-l" style="width:${a}%"></span>`, r = (a) => `<span class="pv-col">${a}</span>`, l = (a) => `<span class="pv-row">${a}</span>`, o = r(i + s(100) + s(88));
|
|
3070
|
+
return t === "img-left" ? `<span class="pv">${l(e + o)}${s(100)}${s(72)}</span>` : t === "img-right" ? `<span class="pv">${l(o + 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>`;
|
|
3071
|
+
}
|
|
3072
|
+
buildTemplatePickInto(t, e) {
|
|
3073
|
+
const i = document.createElement("div");
|
|
3074
|
+
i.className = "tplpick", bt.forEach((s) => {
|
|
3075
|
+
const r = document.createElement("button");
|
|
3076
|
+
r.type = "button", r.className = "tpltile", r.title = this.t(yt[s]), r.innerHTML = this.tplPreviewHTML(s) + `<span class="tpllbl">${this.t(yt[s])}</span>`, r.addEventListener("click", () => {
|
|
3077
|
+
this.closePop(), this.insertTemplate(s), e == null || e();
|
|
3078
|
+
}), i.appendChild(r);
|
|
3079
|
+
}), t.appendChild(i);
|
|
3080
|
+
}
|
|
3081
|
+
insertTemplate(t) {
|
|
3082
|
+
this.restoreSel();
|
|
3083
|
+
const e = `<div class="tpl-media" contenteditable="false">${this.imgPhHTML()}</div>`, i = `<div class="tpl-text"><h2>${this.t("heading")}</h2><p>${this.t("para")}</p></div>`, s = t === "img-center" ? i + e : e + i;
|
|
3084
|
+
document.execCommand("insertHTML", !1, `<div class="tpl tpl-${t}">${s}</div><p><br></p>`), this.saveSel(), this.onChange();
|
|
3085
|
+
}
|
|
3086
|
+
clearTplSel() {
|
|
3087
|
+
var t, e;
|
|
3088
|
+
(t = this.tplCtx) == null || t.remove(), this.tplCtx = null, (e = this.tplActive) == null || e.classList.remove("tpl-selected"), this.tplActive = null;
|
|
3089
|
+
}
|
|
3090
|
+
selectTemplate(t) {
|
|
3091
|
+
this.tplActive !== t && (this.clearTplSel(), this.tplActive = t, t.classList.add("tpl-selected"), this.tplCtx = document.createElement("div"), this.tplCtx.className = "imgctx tplctx", this.tplCtx.dir = this.dir(), document.body.appendChild(this.tplCtx), this.renderTplCtxButtons());
|
|
3092
|
+
}
|
|
3093
|
+
renderTplCtxButtons() {
|
|
3094
|
+
const t = this.tplCtx, e = this.tplActive;
|
|
3095
|
+
!t || !e || (t.innerHTML = "", bt.forEach((i) => {
|
|
3096
|
+
const s = this.ctxBtn(ui[i], this.t(yt[i]), () => this.setTplLayout(i));
|
|
3097
|
+
s.classList.toggle("on", e.classList.contains("tpl-" + i)), t.appendChild(s);
|
|
3098
|
+
}), t.append(this.ctxSep(), this.ctxBtn(h.trash, this.t("deltemplate"), () => this.removeTemplate())), this.positionTplCtx());
|
|
3099
|
+
}
|
|
3100
|
+
setTplLayout(t) {
|
|
3101
|
+
const e = this.tplActive;
|
|
3102
|
+
if (!e) return;
|
|
3103
|
+
bt.forEach((r) => e.classList.remove("tpl-" + r)), e.classList.add("tpl-" + t);
|
|
3104
|
+
const i = e.querySelector(":scope > .tpl-media"), s = e.querySelector(":scope > .tpl-text");
|
|
3105
|
+
i && s && (t === "img-center" ? e.appendChild(i) : e.insertBefore(i, s)), this.renderTplCtxButtons(), this.positionImgPhCtx(), this.positionImageHandles(), this.onChange();
|
|
3106
|
+
}
|
|
3107
|
+
removeTemplate() {
|
|
3108
|
+
const t = this.tplActive;
|
|
3109
|
+
t && (this.clearTplSel(), this.phActive && t.contains(this.phActive) && this.clearImgPlaceholderSel(), this.imgActive && t.contains(this.imgActive) && this.clearImageHandles(), t.remove(), this.refreshState(), this.onChange());
|
|
3110
|
+
}
|
|
3111
|
+
positionTplCtx() {
|
|
3112
|
+
if (this.tplActive && !document.body.contains(this.tplActive)) {
|
|
3113
|
+
this.clearTplSel();
|
|
3114
|
+
return;
|
|
3115
|
+
}
|
|
3116
|
+
if (!this.tplActive || !this.tplCtx) return;
|
|
3117
|
+
const t = this.tplActive.getBoundingClientRect(), e = this.tplCtx.offsetWidth, i = this.tplCtx.offsetHeight;
|
|
3118
|
+
let s = t.left + scrollX + (t.width - e) / 2;
|
|
3119
|
+
s = Math.max(8 + scrollX, Math.min(s, scrollX + innerWidth - e - 8));
|
|
3120
|
+
let r = t.top + scrollY - i - 8;
|
|
3121
|
+
r < this.ctxMinTop() && (r = t.bottom + scrollY + 8), this.tplCtx.style.left = s + "px", this.tplCtx.style.top = r + "px";
|
|
3122
|
+
}
|
|
3019
3123
|
pickWordDoc() {
|
|
3020
3124
|
this.docInput.value = "", this.docInput.click();
|
|
3021
3125
|
}
|
|
@@ -3084,7 +3188,7 @@ let hi = (z = class {
|
|
|
3084
3188
|
e(this.ctxBtn(h.colafter, this.t("colafter"), () => this.tableOp("colafter")), "col"),
|
|
3085
3189
|
e(this.ctxBtn(h.coldelete, this.t("delcol"), () => this.tableOp("delcol")), "col"),
|
|
3086
3190
|
this.ctxSep(),
|
|
3087
|
-
this.ctxBtn(h.
|
|
3191
|
+
this.ctxBtn(h.trash, this.t("deltable"), () => this.tableOp("deltable")),
|
|
3088
3192
|
this.ctxBtn(h.tableic, this.t("tablepropsttl"), () => this.tablePropsDlg())
|
|
3089
3193
|
), document.body.appendChild(t), t;
|
|
3090
3194
|
}
|
|
@@ -3163,7 +3267,7 @@ let hi = (z = class {
|
|
|
3163
3267
|
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;
|
|
3164
3268
|
}
|
|
3165
3269
|
selectImage(t) {
|
|
3166
|
-
this.imgActive !== t && (this.clearImageHandles(), this.imgActive = t, t.classList.add("img-selected"), this.imgHandles =
|
|
3270
|
+
this.imgActive !== t && (this.clearImageHandles(), this.imgActive = t, t.classList.add("img-selected"), this.imgHandles = di.map((e) => {
|
|
3167
3271
|
const i = document.createElement("div");
|
|
3168
3272
|
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;
|
|
3169
3273
|
}), this.imgCtx = this.buildImageCtxToolbar(t), this.positionImageHandles());
|
|
@@ -3201,7 +3305,8 @@ let hi = (z = class {
|
|
|
3201
3305
|
}),
|
|
3202
3306
|
this.ctxSep(),
|
|
3203
3307
|
a(h.trash, this.t("deleteimg"), !1, () => {
|
|
3204
|
-
t.
|
|
3308
|
+
const c = t.closest(".tpl-media");
|
|
3309
|
+
c && this.ed.contains(c) ? t.outerHTML = this.imgPhHTML() : t.remove(), this.clearImageHandles(), this.onChange();
|
|
3205
3310
|
})
|
|
3206
3311
|
), e.addEventListener("mousedown", (c) => c.preventDefault()), e.addEventListener("mouseenter", () => this.cancelImgHide()), e.addEventListener("mouseleave", () => this.scheduleImgHide()), document.body.appendChild(e), e;
|
|
3207
3312
|
}
|
|
@@ -3366,7 +3471,7 @@ let hi = (z = class {
|
|
|
3366
3471
|
const f = this.toolbar.querySelector(`[data-id=${u}] .lbl`);
|
|
3367
3472
|
f && (f.textContent = v || b || "", f.classList.toggle("empty", !v));
|
|
3368
3473
|
};
|
|
3369
|
-
o("fontsel", this.currentFont()), o("sizesel", this.currentSize().replace("px", "")), e && o("blocksel",
|
|
3474
|
+
o("fontsel", this.currentFont()), o("sizesel", this.currentSize().replace("px", "")), e && o("blocksel", Yt.some((u) => u[0] === i) ? this.blockLabel(i) : this.t("para")), this.sbWords.textContent = this.countWords() + " " + this.t("words");
|
|
3370
3475
|
}
|
|
3371
3476
|
countWords() {
|
|
3372
3477
|
const t = (this.ed.textContent || "").trim();
|
|
@@ -3385,17 +3490,17 @@ let hi = (z = class {
|
|
|
3385
3490
|
}, r.readAsDataURL(s.getAsFile());
|
|
3386
3491
|
return;
|
|
3387
3492
|
}
|
|
3388
|
-
i ? document.execCommand("insertHTML", !1,
|
|
3493
|
+
i ? document.execCommand("insertHTML", !1, ri(i, this.dir())) : document.execCommand("insertHTML", !1, ni(e.getData("text/plain"))), this.onChange();
|
|
3389
3494
|
}
|
|
3390
3495
|
/* ---------------------------------------------------------- init */
|
|
3391
3496
|
initUI() {
|
|
3392
3497
|
this.closePop(), this.closeDlg(), this.clearTableHandles(), this.clearImgPlaceholderSel(), 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();
|
|
3393
3498
|
}
|
|
3394
|
-
},
|
|
3395
|
-
const
|
|
3499
|
+
}, W.instanceCounter = 0, W);
|
|
3500
|
+
const mi = Ae(
|
|
3396
3501
|
({ value: m, defaultValue: t, onChange: e, onReady: i, className: s, style: r, ...l }, o) => {
|
|
3397
3502
|
const a = X(null), c = X(null), d = X(!1), u = X(m ?? t), v = X(e), b = X(i);
|
|
3398
|
-
return v.current = e, b.current = i,
|
|
3503
|
+
return v.current = e, b.current = i, Ie(o, () => ({
|
|
3399
3504
|
getContent: () => {
|
|
3400
3505
|
var f;
|
|
3401
3506
|
return ((f = c.current) == null ? void 0 : f.getContent()) ?? "";
|
|
@@ -3434,7 +3539,7 @@ const di = qe(
|
|
|
3434
3539
|
}
|
|
3435
3540
|
})), gt(() => {
|
|
3436
3541
|
if (!a.current) return;
|
|
3437
|
-
const f = new
|
|
3542
|
+
const f = new pi({
|
|
3438
3543
|
target: a.current,
|
|
3439
3544
|
initialContent: u.current,
|
|
3440
3545
|
onChange: (w) => {
|
|
@@ -3462,10 +3567,10 @@ const di = qe(
|
|
|
3462
3567
|
}, [m]), gt(() => {
|
|
3463
3568
|
var f;
|
|
3464
3569
|
l.language && ((f = c.current) == null || f.setLanguage(l.language));
|
|
3465
|
-
}, [l.language]), /* @__PURE__ */
|
|
3570
|
+
}, [l.language]), /* @__PURE__ */ Pe.jsx("div", { ref: a, className: s, style: r });
|
|
3466
3571
|
}
|
|
3467
3572
|
);
|
|
3468
|
-
|
|
3573
|
+
mi.displayName = "FableEditor";
|
|
3469
3574
|
export {
|
|
3470
|
-
|
|
3575
|
+
mi as FableEditor
|
|
3471
3576
|
};
|