fable-editor 1.2.8 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular/core/editor.d.ts +34 -0
- package/dist/angular/core/word-image-paste.d.ts +27 -0
- package/dist/angular/esm2022/core/editor.mjs +360 -5
- package/dist/angular/esm2022/core/word-image-paste.mjs +189 -0
- package/dist/angular/fesm2022/fable-editor.mjs +547 -4
- package/dist/angular/fesm2022/fable-editor.mjs.map +1 -1
- package/dist/core/editor.css +14 -0
- package/dist/core/editor.d.ts +34 -0
- package/dist/core/editor.d.ts.map +1 -1
- package/dist/core/index.cjs +4 -4
- package/dist/core/index.mjs +1225 -927
- package/dist/core/word-image-paste.d.ts +28 -0
- package/dist/core/word-image-paste.d.ts.map +1 -0
- package/dist/react/index.cjs +12 -12
- package/dist/react/index.mjs +1193 -895
- package/package.json +1 -1
- package/style.css +14 -0
package/dist/react/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
1
|
+
import pe, { forwardRef as Xe, useRef as z, useImperativeHandle as Ye, 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,17 +9,17 @@ var Et = { exports: {} }, J = {};
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
function l(r, o,
|
|
18
|
-
var d,
|
|
19
|
-
|
|
20
|
-
for (d in o) i.call(o, d) && !n.hasOwnProperty(d) && (
|
|
21
|
-
if (r && r.defaultProps) for (d in o = r.defaultProps, o)
|
|
22
|
-
return { $$typeof: t, type: r, key: m, ref:
|
|
12
|
+
var Jt;
|
|
13
|
+
function Ge() {
|
|
14
|
+
if (Jt) return J;
|
|
15
|
+
Jt = 1;
|
|
16
|
+
var u = pe, t = Symbol.for("react.element"), e = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, s = u.__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 d, 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 (d in o) i.call(o, d) && !n.hasOwnProperty(d) && (p[d] = o[d]);
|
|
21
|
+
if (r && r.defaultProps) for (d in o = r.defaultProps, o) p[d] === void 0 && (p[d] = o[d]);
|
|
22
|
+
return { $$typeof: t, type: r, key: m, ref: v, props: p, _owner: s.current };
|
|
23
23
|
}
|
|
24
24
|
return J.Fragment = e, J.jsx = l, J.jsxs = l, J;
|
|
25
25
|
}
|
|
@@ -33,61 +33,61 @@ 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
|
|
41
|
-
if (
|
|
36
|
+
var te;
|
|
37
|
+
function Ke() {
|
|
38
|
+
return te || (te = 1, process.env.NODE_ENV !== "production" && function() {
|
|
39
|
+
var u = pe, 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"), d = 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
|
+
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
|
|
47
|
-
function E(
|
|
46
|
+
var C = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
47
|
+
function E(c) {
|
|
48
48
|
{
|
|
49
|
-
for (var
|
|
50
|
-
|
|
51
|
-
I("error",
|
|
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(
|
|
54
|
+
function I(c, g, x) {
|
|
55
55
|
{
|
|
56
|
-
var T =
|
|
57
|
-
|
|
58
|
-
var
|
|
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
|
-
|
|
61
|
+
H.unshift("Warning: " + g), Function.prototype.apply.call(console[c], console, H);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
function
|
|
67
|
-
return !!(typeof
|
|
64
|
+
var A = !1, $ = !1, Z = !1, F = !1, et = !1, kt;
|
|
65
|
+
kt = Symbol.for("react.module.reference");
|
|
66
|
+
function ye(c) {
|
|
67
|
+
return !!(typeof c == "string" || typeof c == "function" || c === i || c === n || et || c === s || c === a || c === d || F || c === v || A || $ || Z || 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
|
-
|
|
71
|
+
c.$$typeof === kt || c.getModuleId !== void 0));
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
var T =
|
|
73
|
+
function xe(c, g, x) {
|
|
74
|
+
var T = c.displayName;
|
|
75
75
|
if (T)
|
|
76
76
|
return T;
|
|
77
|
-
var
|
|
78
|
-
return
|
|
77
|
+
var k = g.displayName || g.name || "";
|
|
78
|
+
return k !== "" ? x + "(" + k + ")" : x;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
return
|
|
80
|
+
function At(c) {
|
|
81
|
+
return c.displayName || "Context";
|
|
82
82
|
}
|
|
83
|
-
function W(
|
|
84
|
-
if (
|
|
83
|
+
function W(c) {
|
|
84
|
+
if (c == null)
|
|
85
85
|
return null;
|
|
86
|
-
if (typeof
|
|
87
|
-
return
|
|
88
|
-
if (typeof
|
|
89
|
-
return
|
|
90
|
-
switch (
|
|
86
|
+
if (typeof c.tag == "number" && E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof c == "function")
|
|
87
|
+
return c.displayName || c.name || null;
|
|
88
|
+
if (typeof c == "string")
|
|
89
|
+
return c;
|
|
90
|
+
switch (c) {
|
|
91
91
|
case i:
|
|
92
92
|
return "Fragment";
|
|
93
93
|
case e:
|
|
@@ -96,28 +96,28 @@ function We() {
|
|
|
96
96
|
return "Profiler";
|
|
97
97
|
case s:
|
|
98
98
|
return "StrictMode";
|
|
99
|
-
case
|
|
99
|
+
case a:
|
|
100
100
|
return "Suspense";
|
|
101
101
|
case d:
|
|
102
102
|
return "SuspenseList";
|
|
103
103
|
}
|
|
104
|
-
if (typeof
|
|
105
|
-
switch (
|
|
104
|
+
if (typeof c == "object")
|
|
105
|
+
switch (c.$$typeof) {
|
|
106
106
|
case r:
|
|
107
|
-
var
|
|
108
|
-
return
|
|
107
|
+
var g = c;
|
|
108
|
+
return At(g) + ".Consumer";
|
|
109
109
|
case l:
|
|
110
|
-
var
|
|
111
|
-
return
|
|
110
|
+
var x = c;
|
|
111
|
+
return At(x._context) + ".Provider";
|
|
112
112
|
case o:
|
|
113
|
-
return
|
|
114
|
-
case
|
|
115
|
-
var T =
|
|
116
|
-
return T !== null ? T : W(
|
|
113
|
+
return xe(c, c.render, "ForwardRef");
|
|
114
|
+
case p:
|
|
115
|
+
var T = c.displayName || null;
|
|
116
|
+
return T !== null ? T : W(c.type) || "Memo";
|
|
117
117
|
case m: {
|
|
118
|
-
var
|
|
118
|
+
var k = c, H = k._payload, M = k._init;
|
|
119
119
|
try {
|
|
120
|
-
return W(M(
|
|
120
|
+
return W(M(H));
|
|
121
121
|
} catch {
|
|
122
122
|
return null;
|
|
123
123
|
}
|
|
@@ -125,103 +125,103 @@ function We() {
|
|
|
125
125
|
}
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
|
-
var
|
|
129
|
-
function
|
|
128
|
+
var U = Object.assign, K = 0, Ht, It, qt, Rt, Pt, Bt, Dt;
|
|
129
|
+
function Nt() {
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
function
|
|
131
|
+
Nt.__reactDisabledLog = !0;
|
|
132
|
+
function Ce() {
|
|
133
133
|
{
|
|
134
|
-
if (
|
|
135
|
-
|
|
136
|
-
var
|
|
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
|
+
var c = {
|
|
137
137
|
configurable: !0,
|
|
138
138
|
enumerable: !0,
|
|
139
|
-
value:
|
|
139
|
+
value: Nt,
|
|
140
140
|
writable: !0
|
|
141
141
|
};
|
|
142
142
|
Object.defineProperties(console, {
|
|
143
|
-
info:
|
|
144
|
-
log:
|
|
145
|
-
warn:
|
|
146
|
-
error:
|
|
147
|
-
group:
|
|
148
|
-
groupCollapsed:
|
|
149
|
-
groupEnd:
|
|
143
|
+
info: c,
|
|
144
|
+
log: c,
|
|
145
|
+
warn: c,
|
|
146
|
+
error: c,
|
|
147
|
+
group: c,
|
|
148
|
+
groupCollapsed: c,
|
|
149
|
+
groupEnd: c
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
|
|
152
|
+
K++;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function we() {
|
|
156
156
|
{
|
|
157
|
-
if (
|
|
158
|
-
var
|
|
157
|
+
if (K--, K === 0) {
|
|
158
|
+
var c = {
|
|
159
159
|
configurable: !0,
|
|
160
160
|
enumerable: !0,
|
|
161
161
|
writable: !0
|
|
162
162
|
};
|
|
163
163
|
Object.defineProperties(console, {
|
|
164
|
-
log:
|
|
165
|
-
value: Lt
|
|
166
|
-
}),
|
|
167
|
-
info: V({}, a, {
|
|
164
|
+
log: U({}, c, {
|
|
168
165
|
value: Ht
|
|
169
166
|
}),
|
|
170
|
-
|
|
171
|
-
value: At
|
|
172
|
-
}),
|
|
173
|
-
error: V({}, a, {
|
|
167
|
+
info: U({}, c, {
|
|
174
168
|
value: It
|
|
175
169
|
}),
|
|
176
|
-
|
|
170
|
+
warn: U({}, c, {
|
|
177
171
|
value: qt
|
|
178
172
|
}),
|
|
179
|
-
|
|
173
|
+
error: U({}, c, {
|
|
180
174
|
value: Rt
|
|
181
175
|
}),
|
|
182
|
-
|
|
176
|
+
group: U({}, c, {
|
|
183
177
|
value: Pt
|
|
178
|
+
}),
|
|
179
|
+
groupCollapsed: U({}, c, {
|
|
180
|
+
value: Bt
|
|
181
|
+
}),
|
|
182
|
+
groupEnd: U({}, c, {
|
|
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(
|
|
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
|
-
} catch (
|
|
197
|
-
var T =
|
|
198
|
-
|
|
196
|
+
} catch (k) {
|
|
197
|
+
var T = k.stack.trim().match(/\n( *(at )?)/);
|
|
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 Te = typeof WeakMap == "function" ? WeakMap : Map;
|
|
207
|
+
st = new Te();
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
if (!
|
|
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
|
-
|
|
219
|
-
var
|
|
218
|
+
gt = !0;
|
|
219
|
+
var k = Error.prepareStackTrace;
|
|
220
220
|
Error.prepareStackTrace = void 0;
|
|
221
|
-
var
|
|
222
|
-
|
|
221
|
+
var H;
|
|
222
|
+
H = mt.current, mt.current = null, Ce();
|
|
223
223
|
try {
|
|
224
|
-
if (
|
|
224
|
+
if (g) {
|
|
225
225
|
var M = function() {
|
|
226
226
|
throw Error();
|
|
227
227
|
};
|
|
@@ -232,196 +232,196 @@ function We() {
|
|
|
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
|
-
Reflect.construct(
|
|
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
|
-
return
|
|
268
|
+
return c.displayName && _.includes("<anonymous>") && (_ = _.replace("<anonymous>", c.displayName)), typeof c == "function" && st.set(c, _), _;
|
|
269
269
|
}
|
|
270
270
|
while (R >= 1 && P >= 0);
|
|
271
271
|
break;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
} finally {
|
|
275
|
-
|
|
275
|
+
gt = !1, mt.current = H, we(), Error.prepareStackTrace = k;
|
|
276
276
|
}
|
|
277
|
-
var
|
|
278
|
-
return typeof
|
|
277
|
+
var G = c ? c.displayName || c.name : "", V = G ? it(G) : "";
|
|
278
|
+
return typeof c == "function" && st.set(c, V), V;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
return
|
|
280
|
+
function Ee(c, g, x) {
|
|
281
|
+
return Ot(c, !1);
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
var
|
|
285
|
-
return !!(
|
|
283
|
+
function Se(c) {
|
|
284
|
+
var g = c.prototype;
|
|
285
|
+
return !!(g && g.isReactComponent);
|
|
286
286
|
}
|
|
287
|
-
function nt(
|
|
288
|
-
if (
|
|
287
|
+
function nt(c, g, x) {
|
|
288
|
+
if (c == null)
|
|
289
289
|
return "";
|
|
290
|
-
if (typeof
|
|
291
|
-
return
|
|
292
|
-
if (typeof
|
|
293
|
-
return it(
|
|
294
|
-
switch (
|
|
295
|
-
case
|
|
290
|
+
if (typeof c == "function")
|
|
291
|
+
return Ot(c, Se(c));
|
|
292
|
+
if (typeof c == "string")
|
|
293
|
+
return it(c);
|
|
294
|
+
switch (c) {
|
|
295
|
+
case a:
|
|
296
296
|
return it("Suspense");
|
|
297
297
|
case d:
|
|
298
298
|
return it("SuspenseList");
|
|
299
299
|
}
|
|
300
|
-
if (typeof
|
|
301
|
-
switch (
|
|
300
|
+
if (typeof c == "object")
|
|
301
|
+
switch (c.$$typeof) {
|
|
302
302
|
case o:
|
|
303
|
-
return
|
|
304
|
-
case
|
|
305
|
-
return nt(
|
|
303
|
+
return Ee(c.render);
|
|
304
|
+
case p:
|
|
305
|
+
return nt(c.type, g, x);
|
|
306
306
|
case m: {
|
|
307
|
-
var T =
|
|
307
|
+
var T = c, k = T._payload, H = T._init;
|
|
308
308
|
try {
|
|
309
|
-
return nt(
|
|
309
|
+
return nt(H(k), g, x);
|
|
310
310
|
} catch {
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
return "";
|
|
315
315
|
}
|
|
316
|
-
var
|
|
317
|
-
function
|
|
318
|
-
if (
|
|
319
|
-
var
|
|
320
|
-
|
|
316
|
+
var Q = Object.prototype.hasOwnProperty, Zt = {}, Ft = C.ReactDebugCurrentFrame;
|
|
317
|
+
function rt(c) {
|
|
318
|
+
if (c) {
|
|
319
|
+
var g = c._owner, x = nt(c.type, c._source, g ? g.type : null);
|
|
320
|
+
Ft.setExtraStackFrame(x);
|
|
321
321
|
} else
|
|
322
|
-
|
|
322
|
+
Ft.setExtraStackFrame(null);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function Me(c, g, x, T, k) {
|
|
325
325
|
{
|
|
326
|
-
var
|
|
327
|
-
for (var M in
|
|
328
|
-
if (
|
|
326
|
+
var H = Function.call.bind(Q);
|
|
327
|
+
for (var M in c)
|
|
328
|
+
if (H(c, M)) {
|
|
329
329
|
var S = void 0;
|
|
330
330
|
try {
|
|
331
|
-
if (typeof
|
|
332
|
-
var
|
|
333
|
-
throw
|
|
331
|
+
if (typeof c[M] != "function") {
|
|
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 =
|
|
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) && (
|
|
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 Zt) && (Zt[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 Le = Array.isArray;
|
|
344
|
+
function vt(c) {
|
|
345
|
+
return Le(c);
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function ke(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 Ae(c) {
|
|
354
354
|
try {
|
|
355
|
-
return
|
|
355
|
+
return _t(c), !1;
|
|
356
356
|
} catch {
|
|
357
357
|
return !0;
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
function
|
|
361
|
-
return "" +
|
|
360
|
+
function _t(c) {
|
|
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 (Ae(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.", ke(c)), _t(c);
|
|
366
366
|
}
|
|
367
|
-
var
|
|
367
|
+
var jt = C.ReactCurrentOwner, He = {
|
|
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 Ie(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
|
-
return
|
|
379
|
+
return c.ref !== void 0;
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
if (
|
|
383
|
-
var
|
|
384
|
-
if (
|
|
381
|
+
function qe(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
|
-
return
|
|
387
|
+
return c.key !== void 0;
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
typeof
|
|
389
|
+
function Re(c, g) {
|
|
390
|
+
typeof c.ref == "string" && jt.current;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function Pe(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 Be(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 De = 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
|
-
type:
|
|
420
|
-
key:
|
|
421
|
-
ref:
|
|
419
|
+
type: c,
|
|
420
|
+
key: g,
|
|
421
|
+
ref: x,
|
|
422
422
|
props: M,
|
|
423
423
|
// Record the component responsible for creating this element.
|
|
424
|
-
_owner:
|
|
424
|
+
_owner: H
|
|
425
425
|
};
|
|
426
426
|
return S._store = {}, Object.defineProperty(S._store, "validated", {
|
|
427
427
|
configurable: !1,
|
|
@@ -437,195 +437,195 @@ function We() {
|
|
|
437
437
|
configurable: !1,
|
|
438
438
|
enumerable: !1,
|
|
439
439
|
writable: !1,
|
|
440
|
-
value:
|
|
440
|
+
value: k
|
|
441
441
|
}), Object.freeze && (Object.freeze(S.props), Object.freeze(S)), S;
|
|
442
442
|
};
|
|
443
|
-
function
|
|
443
|
+
function Ne(c, g, x, T, k) {
|
|
444
444
|
{
|
|
445
|
-
var
|
|
446
|
-
|
|
447
|
-
for (
|
|
448
|
-
|
|
449
|
-
if (
|
|
450
|
-
var R =
|
|
451
|
-
for (
|
|
452
|
-
M[
|
|
445
|
+
var H, M = {}, S = null, D = null;
|
|
446
|
+
x !== void 0 && ($t(x), S = "" + x), qe(g) && ($t(g.key), S = "" + g.key), Ie(g) && (D = g.ref, Re(g, k));
|
|
447
|
+
for (H in g)
|
|
448
|
+
Q.call(g, H) && !He.hasOwnProperty(H) && (M[H] = g[H]);
|
|
449
|
+
if (c && c.defaultProps) {
|
|
450
|
+
var R = c.defaultProps;
|
|
451
|
+
for (H in R)
|
|
452
|
+
M[H] === void 0 && (M[H] = R[H]);
|
|
453
453
|
}
|
|
454
|
-
if (S ||
|
|
455
|
-
var P = typeof
|
|
456
|
-
S &&
|
|
454
|
+
if (S || D) {
|
|
455
|
+
var P = typeof c == "function" ? c.displayName || c.name || "Unknown" : c;
|
|
456
|
+
S && Pe(M, P), D && Be(M, P);
|
|
457
457
|
}
|
|
458
|
-
return
|
|
458
|
+
return De(c, S, D, k, T, jt.current, M);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
var
|
|
462
|
-
function Y(
|
|
463
|
-
if (
|
|
464
|
-
var
|
|
465
|
-
|
|
461
|
+
var bt = C.ReactCurrentOwner, Vt = C.ReactDebugCurrentFrame;
|
|
462
|
+
function Y(c) {
|
|
463
|
+
if (c) {
|
|
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
|
|
472
|
-
return typeof
|
|
469
|
+
var yt;
|
|
470
|
+
yt = !1;
|
|
471
|
+
function xt(c) {
|
|
472
|
+
return typeof c == "object" && c !== null && c.$$typeof === t;
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function zt() {
|
|
475
475
|
{
|
|
476
|
-
if (
|
|
477
|
-
var
|
|
478
|
-
if (
|
|
476
|
+
if (bt.current) {
|
|
477
|
+
var c = W(bt.current.type);
|
|
478
|
+
if (c)
|
|
479
479
|
return `
|
|
480
480
|
|
|
481
|
-
Check the render method of \`` +
|
|
481
|
+
Check the render method of \`` + c + "`.";
|
|
482
482
|
}
|
|
483
483
|
return "";
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
|
-
function
|
|
486
|
+
function Oe(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
|
-
if (!
|
|
504
|
+
if (!c._store || c._store.validated || c.key != null)
|
|
505
505
|
return;
|
|
506
|
-
|
|
507
|
-
var
|
|
508
|
-
if (
|
|
506
|
+
c._store.validated = !0;
|
|
507
|
+
var x = Ze(g);
|
|
508
|
+
if (Xt[x])
|
|
509
509
|
return;
|
|
510
|
-
|
|
510
|
+
Xt[x] = !0;
|
|
511
511
|
var T = "";
|
|
512
|
-
|
|
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
|
-
if (typeof
|
|
517
|
+
if (typeof c != "object")
|
|
518
518
|
return;
|
|
519
|
-
if (
|
|
520
|
-
for (var
|
|
521
|
-
var T =
|
|
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 (
|
|
525
|
-
|
|
526
|
-
else if (
|
|
527
|
-
var
|
|
528
|
-
if (typeof
|
|
529
|
-
for (var
|
|
530
|
-
|
|
524
|
+
else if (xt(c))
|
|
525
|
+
c._store && (c._store.validated = !0);
|
|
526
|
+
else if (c) {
|
|
527
|
+
var k = y(c);
|
|
528
|
+
if (typeof k == "function" && k !== c.entries)
|
|
529
|
+
for (var H = k.call(c), M; !(M = H.next()).done; )
|
|
530
|
+
xt(M.value) && Yt(M.value, g);
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function Fe(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
|
|
554
|
-
E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",
|
|
548
|
+
if (x) {
|
|
549
|
+
var T = W(g);
|
|
550
|
+
Me(x, c.props, "prop", T, c);
|
|
551
|
+
} else if (g.PropTypes !== void 0 && !yt) {
|
|
552
|
+
yt = !0;
|
|
553
|
+
var k = W(g);
|
|
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
|
-
Y(
|
|
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;
|
|
566
566
|
}
|
|
567
567
|
}
|
|
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(
|
|
571
|
+
var Kt = {};
|
|
572
|
+
function Qt(c, g, x, T, k, H) {
|
|
573
573
|
{
|
|
574
|
-
var M =
|
|
574
|
+
var M = ye(c);
|
|
575
575
|
if (!M) {
|
|
576
576
|
var S = "";
|
|
577
|
-
(
|
|
578
|
-
var
|
|
579
|
-
|
|
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 D = Oe();
|
|
579
|
+
D ? S += D : S += zt();
|
|
580
580
|
var R;
|
|
581
|
-
|
|
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 = Ne(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 (
|
|
591
|
-
for (var
|
|
592
|
-
|
|
590
|
+
if (vt(_)) {
|
|
591
|
+
for (var G = 0; G < _.length; G++)
|
|
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
|
|
601
|
-
return
|
|
602
|
-
}),
|
|
603
|
-
if (!
|
|
604
|
-
var
|
|
599
|
+
if (Q.call(g, "key")) {
|
|
600
|
+
var V = W(c), N = Object.keys(g).filter(function(ze) {
|
|
601
|
+
return ze !== "key";
|
|
602
|
+
}), Ct = N.length > 0 ? "{key: someKey, " + N.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
603
|
+
if (!Kt[V + Ct]) {
|
|
604
|
+
var Ve = 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, Ve, V), Kt[V + Ct] = !0;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
return
|
|
613
|
+
return c === i ? _e(P) : Fe(P), P;
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
|
-
function
|
|
617
|
-
return Qt(
|
|
616
|
+
function $e(c, g, x) {
|
|
617
|
+
return Qt(c, g, x, !0);
|
|
618
618
|
}
|
|
619
|
-
function
|
|
620
|
-
return Qt(
|
|
619
|
+
function je(c, g, x) {
|
|
620
|
+
return Qt(c, g, x, !1);
|
|
621
621
|
}
|
|
622
|
-
var
|
|
623
|
-
tt.Fragment = i, tt.jsx =
|
|
622
|
+
var We = je, Ue = $e;
|
|
623
|
+
tt.Fragment = i, tt.jsx = We, tt.jsxs = Ue;
|
|
624
624
|
}()), tt;
|
|
625
625
|
}
|
|
626
|
-
process.env.NODE_ENV === "production" ?
|
|
627
|
-
var
|
|
628
|
-
const
|
|
626
|
+
process.env.NODE_ENV === "production" ? Mt.exports = Ge() : Mt.exports = Ke();
|
|
627
|
+
var Qe = Mt.exports;
|
|
628
|
+
const Je = {
|
|
629
629
|
en: {
|
|
630
630
|
dir: "ltr",
|
|
631
631
|
file: "File",
|
|
@@ -1011,10 +1011,10 @@ const Ue = {
|
|
|
1011
1011
|
emcat_flags: "أعلام"
|
|
1012
1012
|
}
|
|
1013
1013
|
};
|
|
1014
|
-
function
|
|
1015
|
-
return
|
|
1014
|
+
function wt(u) {
|
|
1015
|
+
return Je[u];
|
|
1016
1016
|
}
|
|
1017
|
-
const
|
|
1017
|
+
const ti = "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", ei = "file edit view insert format tools table help", ii = [
|
|
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 ze = "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
|
+
], si = ["8px", "9px", "10px", "11px", "12px", "14px", "16px", "18px", "20px", "24px", "28px", "32px", "36px", "48px", "72px", "96px"], ni = 1, ri = 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 ze = "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 ze = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1060
1060
|
["h5", "heading5"],
|
|
1061
1061
|
["h6", "heading6"],
|
|
1062
1062
|
["pre", "pre"]
|
|
1063
|
-
],
|
|
1063
|
+
], li = ["#F76707", "#4263EB", "#CC5DE8"], oi = [
|
|
1064
1064
|
"#FFFFFF",
|
|
1065
1065
|
"#F4F4F4",
|
|
1066
1066
|
"#E8EAED",
|
|
@@ -1086,7 +1086,7 @@ const ze = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1086
1086
|
"#8E24AA",
|
|
1087
1087
|
"#C2185B",
|
|
1088
1088
|
"#6D4C41"
|
|
1089
|
-
],
|
|
1089
|
+
], ai = [
|
|
1090
1090
|
{
|
|
1091
1091
|
key: "chcat_currency",
|
|
1092
1092
|
chars: [
|
|
@@ -1426,7 +1426,7 @@ const ze = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
1426
1426
|
"ة"
|
|
1427
1427
|
]
|
|
1428
1428
|
}
|
|
1429
|
-
],
|
|
1429
|
+
], ci = [
|
|
1430
1430
|
{
|
|
1431
1431
|
key: "emcat_smileys",
|
|
1432
1432
|
chars: [
|
|
@@ -2151,236 +2151,236 @@ const ze = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
2151
2151
|
"🇲🇦"
|
|
2152
2152
|
]
|
|
2153
2153
|
}
|
|
2154
|
-
],
|
|
2155
|
-
'<path d="M10 6h10M10 12h10M10 18h10"/>' +
|
|
2154
|
+
], L = (u, t) => `<svg viewBox="${t || "0 0 24 24"}">${u}</svg>`, w = (u) => L(`<path class="f" d="${u}"/>`, "0 -960 960 960"), ot = (u, t = 7.5) => L(
|
|
2155
|
+
'<path d="M10 6h10M10 12h10M10 18h10"/>' + u.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
|
-
chev:
|
|
2202
|
-
backcolor:
|
|
2201
|
+
chev: L('<path d="M2 3.5 6 7.5 10 3.5"/>', "0 0 12 11"),
|
|
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
|
-
more:
|
|
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
|
-
hric:
|
|
2224
|
-
charic:
|
|
2223
|
+
hric: L('<path d="M4 12h16"/>'),
|
|
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
|
-
dateic:
|
|
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
|
-
nbspic:
|
|
2234
|
-
srcic:
|
|
2233
|
+
nbspic: L('<path d="M6 12v4h12v-4"/>'),
|
|
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
|
-
newic:
|
|
2262
|
-
helpic:
|
|
2261
|
+
newic: L('<path d="M6 3h8l5 5v13H6z"/><path d="M14 3v5h5"/>'),
|
|
2262
|
+
helpic: L(
|
|
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
|
-
wcic:
|
|
2266
|
-
rowbefore:
|
|
2265
|
+
wcic: L('<path d="M4 6h16M4 10h16M4 14h9"/><path d="M15 17.5l2 2 3.6-4"/>'),
|
|
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
|
-
wordic:
|
|
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
|
-
trash:
|
|
2323
|
+
trash: L(
|
|
2324
2324
|
'<path d="M5 7h14M10 7V5h4v2M7.5 7l1 13h7l1-13"/>'
|
|
2325
2325
|
),
|
|
2326
|
-
templateic:
|
|
2326
|
+
templateic: L(
|
|
2327
2327
|
'<rect x="4" y="4" width="16" height="16" rx="1.5"/><rect x="6.5" y="6.5" width="5" height="5" rx=".5"/><path d="M14 7.5h3.5M14 10h3.5M6.5 14h11M6.5 17h11"/>'
|
|
2328
2328
|
),
|
|
2329
|
-
tplleft:
|
|
2329
|
+
tplleft: L(
|
|
2330
2330
|
'<rect x="3" y="5" width="8" height="8" rx=".8"/><path d="M13.5 6.5H21M13.5 9.5H21M13.5 12.5H21M3 15.5h18M3 18.5h18"/>'
|
|
2331
2331
|
),
|
|
2332
|
-
tplright:
|
|
2332
|
+
tplright: L(
|
|
2333
2333
|
'<rect x="13" y="5" width="8" height="8" rx=".8"/><path d="M3 6.5h7.5M3 9.5h7.5M3 12.5h7.5M3 15.5h18M3 18.5h18"/>'
|
|
2334
2334
|
),
|
|
2335
|
-
tpltop:
|
|
2335
|
+
tpltop: L(
|
|
2336
2336
|
'<rect x="5" y="3" width="14" height="9" rx=".8"/><path d="M3 15h18M3 18h18M3 21h12"/>'
|
|
2337
2337
|
),
|
|
2338
|
-
tplcenter:
|
|
2338
|
+
tplcenter: L(
|
|
2339
2339
|
'<path d="M3 4h18M3 7h18M3 10h12"/><rect x="5" y="12.5" width="14" height="9" rx=".8"/>'
|
|
2340
2340
|
),
|
|
2341
|
-
rotateleft:
|
|
2341
|
+
rotateleft: L(
|
|
2342
2342
|
'<polyline points="1 4 1 10 7 10"/><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"/>'
|
|
2343
2343
|
),
|
|
2344
|
-
rotateright:
|
|
2344
|
+
rotateright: L(
|
|
2345
2345
|
'<polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/>'
|
|
2346
2346
|
),
|
|
2347
|
-
fliphorizontal:
|
|
2347
|
+
fliphorizontal: L(
|
|
2348
2348
|
'<path d="M12 3v18"/><path d="M7 8l-4 4 4 4"/><path d="M17 8l4 4-4 4"/>'
|
|
2349
2349
|
),
|
|
2350
|
-
flipvertical:
|
|
2350
|
+
flipvertical: L(
|
|
2351
2351
|
'<path d="M3 12h18"/><path d="M8 7l4-4 4 4"/><path d="M8 17l4 4 4-4"/>'
|
|
2352
2352
|
),
|
|
2353
|
-
check:
|
|
2354
|
-
palette:
|
|
2353
|
+
check: L('<path d="M5 12.5 9.5 17 19 7"/>'),
|
|
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
|
-
ol_alpha:
|
|
2364
|
-
ol_roman:
|
|
2365
|
-
ol_alphau:
|
|
2366
|
-
ol_romanu:
|
|
2367
|
-
video:
|
|
2368
|
-
editic:
|
|
2369
|
-
letterspacing:
|
|
2363
|
+
ol_alpha: ot(["a", "b", "c"]),
|
|
2364
|
+
ol_roman: ot(["i", "ii", "iii"], 6.5),
|
|
2365
|
+
ol_alphau: ot(["A", "B", "C"]),
|
|
2366
|
+
ol_romanu: ot(["I", "II", "III"], 6.5),
|
|
2367
|
+
video: L('<rect x="3" y="6" width="13" height="12" rx="1.5"/><path d="M16 10l5-3v10l-5-3z"/>'),
|
|
2368
|
+
editic: L('<path d="M4 20l1-4.5L15.5 5 19 8.5 8.5 19 4 20z"/><path d="M13.5 6.5l4 4"/>'),
|
|
2369
|
+
letterspacing: L(
|
|
2370
2370
|
'<text x="2.5" y="13" font-size="12" stroke="none" fill="#222f3e" font-family="Arial" font-weight="bold">A</text><text x="13" y="13" font-size="12" stroke="none" fill="#222f3e" font-family="Arial" font-weight="bold">B</text><path d="M7 18.5h10"/><path class="f" d="M7.5 18.5 4.5 16.6v3.8z"/><path class="f" d="M16.5 18.5l3-1.9v3.8z"/>'
|
|
2371
2371
|
),
|
|
2372
|
-
emojiic:
|
|
2372
|
+
emojiic: L(
|
|
2373
2373
|
'<circle cx="12" cy="12" r="8.5"/><path d="M8.6 14.3a4.6 4.6 0 0 0 6.8 0"/><path d="M9.2 9.6v.7M14.8 9.6v.7"/>'
|
|
2374
2374
|
),
|
|
2375
|
-
inlinecodeic:
|
|
2376
|
-
moverowup:
|
|
2377
|
-
moverowdown:
|
|
2378
|
-
movecolleft:
|
|
2379
|
-
movecolright:
|
|
2380
|
-
codesampleic:
|
|
2375
|
+
inlinecodeic: L('<path d="M8.5 8 4.5 12l4 4M15.5 8l4 4-4 4"/><path d="M13 6l-2 12"/>'),
|
|
2376
|
+
moverowup: L('<rect x="4" y="15.5" width="16" height="5" rx="1"/><path d="M12 12.5V4M8.5 7.5 12 4l3.5 3.5"/>'),
|
|
2377
|
+
moverowdown: L('<rect x="4" y="3.5" width="16" height="5" rx="1"/><path d="M12 11.5V20M8.5 16.5 12 20l3.5-3.5"/>'),
|
|
2378
|
+
movecolleft: L('<rect x="15.5" y="4" width="5" height="16" rx="1"/><path d="M12.5 12H4M7.5 8.5 4 12l3.5 3.5"/>'),
|
|
2379
|
+
movecolright: L('<rect x="3.5" y="4" width="5" height="16" rx="1"/><path d="M11.5 12H20M16.5 8.5 20 12l-3.5 3.5"/>'),
|
|
2380
|
+
codesampleic: 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
|
+
}, hi = /* @__PURE__ */ new Set([
|
|
2384
2384
|
"p",
|
|
2385
2385
|
"div",
|
|
2386
2386
|
"span",
|
|
@@ -2422,7 +2422,7 @@ const ze = "undo redo | preview print | importword revhistory | fontfamily fonts
|
|
|
2422
2422
|
"figure",
|
|
2423
2423
|
"figcaption",
|
|
2424
2424
|
"mark"
|
|
2425
|
-
]),
|
|
2425
|
+
]), di = /* @__PURE__ */ new Set([
|
|
2426
2426
|
"text-align",
|
|
2427
2427
|
"direction",
|
|
2428
2428
|
"unicode-bidi",
|
|
@@ -2478,7 +2478,7 @@ const ze = "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 ze = "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(u) {
|
|
2491
|
+
const t = {}, e = u.getAttribute && u.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 ui(u) {
|
|
2498
|
+
return u.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 pi(u) {
|
|
2501
|
+
return /^[0-9]+[\.\)،]/.test(u) ? { ordered: !0 } : /^[٠-٩۰-۹]+/.test(u) ? { ordered: !0, style: "arabic-indic" } : /^[ivxlc]{2,}[\.\)]/.test(u) ? { ordered: !0, style: "lower-roman" } : /^[IVXLC]{2,}[\.\)]/.test(u) ? { ordered: !0, style: "upper-roman" } : /^[a-z][\.\)]/.test(u) ? { ordered: !0, style: "lower-alpha" } : /^[A-Z][\.\)]/.test(u) ? { ordered: !0, style: "upper-alpha" } : /^[ء-ي][\.\)،-]/.test(u) ? { ordered: !0, style: "arabic-indic" } : { ordered: !1 };
|
|
2502
2502
|
}
|
|
2503
|
-
function
|
|
2503
|
+
function mi(u) {
|
|
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(u.body.querySelectorAll("p")).forEach((s) => {
|
|
2510
2510
|
if (!t(s)) {
|
|
2511
2511
|
i = null;
|
|
2512
2512
|
return;
|
|
@@ -2516,65 +2516,65 @@ function ri(p) {
|
|
|
2516
2516
|
}), e.forEach((s) => {
|
|
2517
2517
|
const n = [], l = s[0];
|
|
2518
2518
|
s.forEach((r) => {
|
|
2519
|
-
var
|
|
2520
|
-
const
|
|
2521
|
-
(
|
|
2522
|
-
),
|
|
2523
|
-
for (d && d.remove(); n.length && n[n.length - 1].level >
|
|
2524
|
-
if (!n.length || n[n.length - 1].level <
|
|
2525
|
-
const
|
|
2526
|
-
if (m &&
|
|
2519
|
+
var C, E, I;
|
|
2520
|
+
const a = +(((C = (r.getAttribute("style") || "").match(/level(\d+)/i)) == null ? void 0 : C[1]) || 1), d = Array.from(r.querySelectorAll("span")).find(
|
|
2521
|
+
(A) => /mso-list\s*:\s*ignore/i.test(A.getAttribute("style") || "")
|
|
2522
|
+
), p = d ? ((E = d.textContent) == null ? void 0 : E.trim()) || "" : (((I = r.textContent) == null ? void 0 : I.trim().match(/^\S{1,4}/)) || [""])[0], { ordered: m, style: v } = pi(p);
|
|
2523
|
+
for (d && d.remove(); n.length && n[n.length - 1].level > a; ) n.pop();
|
|
2524
|
+
if (!n.length || n[n.length - 1].level < a) {
|
|
2525
|
+
const A = u.createElement(m ? "ol" : "ul");
|
|
2526
|
+
if (m && v && (A.style.listStyleType = v), n.length) {
|
|
2527
2527
|
const $ = n[n.length - 1].list;
|
|
2528
|
-
($.lastElementChild || $).appendChild(
|
|
2528
|
+
($.lastElementChild || $).appendChild(A);
|
|
2529
2529
|
} else
|
|
2530
|
-
l.parentNode.insertBefore(
|
|
2531
|
-
n.push({ list:
|
|
2530
|
+
l.parentNode.insertBefore(A, l);
|
|
2531
|
+
n.push({ list: A, level: a });
|
|
2532
2532
|
}
|
|
2533
|
-
const
|
|
2534
|
-
for (
|
|
2535
|
-
n[n.length - 1].list.appendChild(
|
|
2533
|
+
const b = u.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 fi(u) {
|
|
2540
|
+
u.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 gi(u) {
|
|
2546
|
+
u.querySelectorAll("table").forEach((t) => {
|
|
2547
2547
|
const e = t;
|
|
2548
|
-
|
|
2549
|
-
}),
|
|
2548
|
+
pt(e)["border-collapse"] || (e.style.borderCollapse = "collapse");
|
|
2549
|
+
}), u.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
|
+
}), u.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
|
+
}), u.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(u, t) {
|
|
2565
|
+
Array.from(u.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 (!hi.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
|
-
const
|
|
2577
|
-
if (
|
|
2576
|
+
const a = i.getAttribute("size");
|
|
2577
|
+
if (a && !o.style.fontSize) {
|
|
2578
2578
|
const d = {
|
|
2579
2579
|
1: "8pt",
|
|
2580
2580
|
2: "10pt",
|
|
@@ -2584,20 +2584,20 @@ function ht(p, t) {
|
|
|
2584
2584
|
6: "24pt",
|
|
2585
2585
|
7: "36pt"
|
|
2586
2586
|
};
|
|
2587
|
-
d[
|
|
2587
|
+
d[a] && (o.style.fontSize = d[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
|
-
const
|
|
2600
|
-
|
|
2599
|
+
const a = o.name.toLowerCase();
|
|
2600
|
+
a !== "style" && !n.has(a) && i.removeAttribute(o.name);
|
|
2601
2601
|
}), s === "a") {
|
|
2602
2602
|
const o = i.getAttribute("href") || "";
|
|
2603
2603
|
/^(https?:|mailto:|tel:|#)/i.test(o) || i.removeAttribute("href");
|
|
@@ -2605,73 +2605,73 @@ function ht(p, t) {
|
|
|
2605
2605
|
if (s === "img") {
|
|
2606
2606
|
const o = i.getAttribute("src") || "";
|
|
2607
2607
|
if (!/^(https?:|data:image\/|blob:)/i.test(o)) {
|
|
2608
|
-
const
|
|
2609
|
-
|
|
2608
|
+
const a = t.createElement("span");
|
|
2609
|
+
a.textContent = "[local image — paste it separately]", a.setAttribute("style", "color:#a33;font-style:italic;font-size:12px"), i.replaceWith(a);
|
|
2610
2610
|
return;
|
|
2611
2611
|
}
|
|
2612
2612
|
}
|
|
2613
|
-
const l =
|
|
2614
|
-
for (const [o,
|
|
2615
|
-
|
|
2616
|
-
if (r.length ? i.setAttribute("style", r.join(";")) : i.removeAttribute("style"), i.removeAttribute("class"),
|
|
2613
|
+
const l = pt(i), r = [];
|
|
2614
|
+
for (const [o, a] of Object.entries(l))
|
|
2615
|
+
di.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 vi(u) {
|
|
2623
2623
|
const t = [], e = /<style[^>]*>([\s\S]*?)<\/style>/gi;
|
|
2624
2624
|
let i;
|
|
2625
|
-
for (; i = e.exec(
|
|
2625
|
+
for (; i = e.exec(u); ) {
|
|
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
2629
|
const l = /([^{}]+)\{([^}]*)\}/g;
|
|
2630
2630
|
for (; n = l.exec(s); ) {
|
|
2631
2631
|
const r = n[2].split(";").map((o) => {
|
|
2632
|
-
const
|
|
2633
|
-
return
|
|
2632
|
+
const a = o.indexOf(":");
|
|
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 bi(u, 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 = u.querySelectorAll(i);
|
|
2647
2647
|
} catch {
|
|
2648
2648
|
return;
|
|
2649
2649
|
}
|
|
2650
2650
|
n.forEach((l) => {
|
|
2651
2651
|
let r = e.get(l);
|
|
2652
|
-
r || (r = {}, e.set(l, r)), s.forEach(([o,
|
|
2653
|
-
r[o] =
|
|
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
|
|
2660
|
-
s.setAttribute("style", d ?
|
|
2659
|
+
const a = o.map(([p, m]) => p + ":" + m).join(";"), d = s.getAttribute("style");
|
|
2660
|
+
s.setAttribute("style", d ? a + ";" + d : a);
|
|
2661
2661
|
});
|
|
2662
2662
|
}
|
|
2663
|
-
function
|
|
2664
|
-
return
|
|
2663
|
+
function me(u) {
|
|
2664
|
+
return u.replace(/[ﭐ-﷿ﹰ-ﻼ]+/g, (t) => t.normalize("NFKC"));
|
|
2665
2665
|
}
|
|
2666
|
-
function
|
|
2667
|
-
const t =
|
|
2666
|
+
function yi(u) {
|
|
2667
|
+
const t = u.createTreeWalker(u.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 = me(e.nodeValue || ""));
|
|
2671
2671
|
}
|
|
2672
|
-
function
|
|
2673
|
-
const e =
|
|
2674
|
-
|
|
2672
|
+
function xi(u, t = "ltr") {
|
|
2673
|
+
const e = vi(u), i = new DOMParser().parseFromString(ui(u), "text/html");
|
|
2674
|
+
bi(i, e), /class="?Mso|mso-|urn:schemas-microsoft-com/i.test(i.body.innerHTML) && mi(i), fi(i), gi(i), dt(i.body, i), yi(i);
|
|
2675
2675
|
const s = (n) => {
|
|
2676
2676
|
var l;
|
|
2677
2677
|
return n && n.tagName === "P" && !((l = n.textContent) != null && l.trim()) && !n.querySelector("img,table");
|
|
@@ -2680,14 +2680,117 @@ function pi(p, t = "ltr") {
|
|
|
2680
2680
|
for (; s(i.body.lastElementChild); ) i.body.lastElementChild.remove();
|
|
2681
2681
|
return i.body.innerHTML.trim();
|
|
2682
2682
|
}
|
|
2683
|
-
function
|
|
2684
|
-
const t =
|
|
2683
|
+
function Ci(u) {
|
|
2684
|
+
const t = me(u).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
|
-
|
|
2688
|
-
|
|
2687
|
+
const wi = 10 * 1024 * 1024, fe = /^(https?:|data:image\/|blob:)/i;
|
|
2688
|
+
function oe(u, t) {
|
|
2689
|
+
const e = [], i = "{\\" + t;
|
|
2690
|
+
let s = 0;
|
|
2691
|
+
for (; (s = u.indexOf(i, s)) !== -1; ) {
|
|
2692
|
+
const n = u[s + i.length];
|
|
2693
|
+
if (n && /[a-z0-9]/i.test(n)) {
|
|
2694
|
+
s += i.length;
|
|
2695
|
+
continue;
|
|
2696
|
+
}
|
|
2697
|
+
let l = 0, r = s;
|
|
2698
|
+
for (; r < u.length; r++) {
|
|
2699
|
+
const o = u[r];
|
|
2700
|
+
if (o === "\\") {
|
|
2701
|
+
r++;
|
|
2702
|
+
continue;
|
|
2703
|
+
}
|
|
2704
|
+
if (o === "{") l++;
|
|
2705
|
+
else if (o === "}" && (l--, !l))
|
|
2706
|
+
break;
|
|
2707
|
+
}
|
|
2708
|
+
e.push({ start: s, end: r + 1, body: u.slice(s + i.length, r) }), s = r + 1;
|
|
2709
|
+
}
|
|
2710
|
+
return e;
|
|
2711
|
+
}
|
|
2712
|
+
function Ti(u) {
|
|
2713
|
+
const t = new Uint8Array(u.length / 2);
|
|
2714
|
+
for (let e = 0; e < t.length; e++) t[e] = parseInt(u.substr(e * 2, 2), 16);
|
|
2715
|
+
return t;
|
|
2716
|
+
}
|
|
2717
|
+
function Tt(u) {
|
|
2718
|
+
let t = "";
|
|
2719
|
+
for (let e = 0; e < u.length; e++) t += String.fromCharCode(u[e]);
|
|
2720
|
+
return btoa(t);
|
|
2721
|
+
}
|
|
2722
|
+
function ae(u, t) {
|
|
2723
|
+
t: for (let e = 0; e + t.length <= u.length; e++) {
|
|
2724
|
+
for (let i = 0; i < t.length; i++) if (u[e + i] !== t[i]) continue t;
|
|
2725
|
+
return e;
|
|
2726
|
+
}
|
|
2727
|
+
return -1;
|
|
2728
|
+
}
|
|
2729
|
+
const Ei = [137, 80, 78, 71], Si = [255, 216, 255];
|
|
2730
|
+
function Mi(u) {
|
|
2731
|
+
let t = null;
|
|
2732
|
+
if (/\\pngblip/.test(u) ? t = "image/png" : /\\jpegblip/.test(u) ? t = "image/jpeg" : (/\\wmetafile\d*/.test(u) || /\\emfblip/.test(u)) && (t = "metafile"), !t) return null;
|
|
2733
|
+
let e = u.replace(/\{[^{}]*\}/g, "").replace(/\\[a-z]+-?\d*\s?/gi, "").replace(/[^0-9a-fA-F]/g, "");
|
|
2734
|
+
if (e.length % 2 && (e = e.slice(0, -1)), !e) return null;
|
|
2735
|
+
const i = Ti(e);
|
|
2736
|
+
if (t === "metafile") {
|
|
2737
|
+
const s = ae(i, Ei);
|
|
2738
|
+
if (s >= 0) return "data:image/png;base64," + Tt(i.slice(s));
|
|
2739
|
+
const n = ae(i, Si);
|
|
2740
|
+
return n >= 0 ? "data:image/jpeg;base64," + Tt(i.slice(n)) : null;
|
|
2741
|
+
}
|
|
2742
|
+
return "data:" + t + ";base64," + Tt(i);
|
|
2743
|
+
}
|
|
2744
|
+
function Li(u) {
|
|
2745
|
+
if (!u || u.indexOf("\\pict") === -1) return [];
|
|
2746
|
+
let t = u;
|
|
2747
|
+
oe(u, "nonshppict").reverse().forEach((i) => {
|
|
2748
|
+
t = t.slice(0, i.start) + t.slice(i.end);
|
|
2749
|
+
});
|
|
2750
|
+
let e = wi;
|
|
2751
|
+
return oe(t, "pict").map((i) => {
|
|
2752
|
+
if (e <= 0) return null;
|
|
2753
|
+
const s = Mi(i.body);
|
|
2754
|
+
return s && (e -= s.length * 0.75), s;
|
|
2755
|
+
});
|
|
2756
|
+
}
|
|
2757
|
+
function ge(u, t) {
|
|
2758
|
+
if (!u || !t.length) return { html: u, injected: [] };
|
|
2759
|
+
const e = [];
|
|
2760
|
+
let i = 0;
|
|
2761
|
+
return { html: u.replace(/<img\b[^>]*>/gi, (n) => {
|
|
2762
|
+
const l = (n.match(/\ssrc\s*=\s*["']?([^"'\s>]+)/i) || [])[1] || "";
|
|
2763
|
+
if (fe.test(l)) return n;
|
|
2764
|
+
const r = t[i++];
|
|
2765
|
+
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
|
+
}), injected: e };
|
|
2767
|
+
}
|
|
2768
|
+
function ki(u, t) {
|
|
2769
|
+
return !u || !t ? { html: u, injected: [] } : ge(u, Li(t));
|
|
2770
|
+
}
|
|
2771
|
+
function Ai(u) {
|
|
2772
|
+
const t = u.match(/<img\b[^>]*>/gi);
|
|
2773
|
+
return t ? t.filter((e) => {
|
|
2774
|
+
const i = (e.match(/\ssrc\s*=\s*["']?([^"'\s>]+)/i) || [])[1] || "";
|
|
2775
|
+
return !fe.test(i);
|
|
2776
|
+
}).length : 0;
|
|
2777
|
+
}
|
|
2778
|
+
function Hi(u, t) {
|
|
2779
|
+
const e = u.match(/^data:([^;,]+);base64,(.*)$/);
|
|
2780
|
+
if (!e) return null;
|
|
2781
|
+
const i = (e[1].split("/")[1] || "png").replace(/[^a-z0-9]/gi, "") || "png";
|
|
2782
|
+
try {
|
|
2783
|
+
const s = atob(e[2]), n = new Uint8Array(s.length);
|
|
2784
|
+
for (let l = 0; l < s.length; l++) n[l] = s.charCodeAt(l);
|
|
2785
|
+
return new File([n], t + "." + (i === "jpeg" ? "jpg" : i), { type: e[1] });
|
|
2786
|
+
} catch {
|
|
2787
|
+
return null;
|
|
2788
|
+
}
|
|
2789
|
+
}
|
|
2790
|
+
function Ii(u) {
|
|
2791
|
+
const t = new DataView(u), e = /* @__PURE__ */ new Map();
|
|
2689
2792
|
let i = -1;
|
|
2690
|
-
for (let r =
|
|
2793
|
+
for (let r = u.byteLength - 22; r >= Math.max(0, u.byteLength - 22 - 65535); r--)
|
|
2691
2794
|
if (t.getUint32(r, !0) === 101010256) {
|
|
2692
2795
|
i = r;
|
|
2693
2796
|
break;
|
|
@@ -2697,38 +2800,38 @@ function fi(p) {
|
|
|
2697
2800
|
let n = t.getUint32(i + 16, !0);
|
|
2698
2801
|
const l = new TextDecoder();
|
|
2699
2802
|
for (let r = 0; r < s && t.getUint32(n, !0) === 33639248; r++) {
|
|
2700
|
-
const o = t.getUint16(n + 10, !0),
|
|
2701
|
-
e.set(
|
|
2803
|
+
const o = t.getUint16(n + 10, !0), a = t.getUint32(n + 20, !0), d = 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(u, n + 46, d));
|
|
2804
|
+
e.set(b, { name: b, method: o, compSize: a, localOffset: v }), n += 46 + d + p + m;
|
|
2702
2805
|
}
|
|
2703
2806
|
return e;
|
|
2704
2807
|
}
|
|
2705
|
-
async function
|
|
2706
|
-
const e = new DataView(
|
|
2808
|
+
async function ce(u, t) {
|
|
2809
|
+
const e = new DataView(u, t.localOffset);
|
|
2707
2810
|
if (e.getUint32(0, !0) !== 67324752) throw new Error("Bad local header");
|
|
2708
|
-
const i = e.getUint16(26, !0), s = e.getUint16(28, !0), n = t.localOffset + 30 + i + s, l = new Uint8Array(
|
|
2811
|
+
const i = e.getUint16(26, !0), s = e.getUint16(28, !0), n = t.localOffset + 30 + i + s, l = new Uint8Array(u.slice(n, n + t.compSize));
|
|
2709
2812
|
if (t.method === 0) return l;
|
|
2710
2813
|
if (t.method !== 8) throw new Error("Unsupported compression method " + t.method);
|
|
2711
2814
|
const r = new Blob([l]).stream().pipeThrough(new DecompressionStream("deflate-raw"));
|
|
2712
2815
|
return new Uint8Array(await new Response(r).arrayBuffer());
|
|
2713
2816
|
}
|
|
2714
|
-
const
|
|
2715
|
-
let e =
|
|
2817
|
+
const he = (u) => u.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """), ut = (u, t) => Array.from(u.children).filter((e) => e.localName === t), B = (u, ...t) => {
|
|
2818
|
+
let e = u;
|
|
2716
2819
|
for (const i of t) {
|
|
2717
2820
|
if (!e) return null;
|
|
2718
2821
|
e = Array.from(e.children).find((s) => s.localName === i) || null;
|
|
2719
2822
|
}
|
|
2720
2823
|
return e;
|
|
2721
|
-
}, q = (
|
|
2722
|
-
if (!
|
|
2723
|
-
for (const e of Array.from(
|
|
2824
|
+
}, q = (u, t = "val") => {
|
|
2825
|
+
if (!u) return "";
|
|
2826
|
+
for (const e of Array.from(u.attributes))
|
|
2724
2827
|
if (e.localName === t) return e.value;
|
|
2725
2828
|
return "";
|
|
2726
|
-
}, at = (
|
|
2727
|
-
const e =
|
|
2829
|
+
}, at = (u, t) => {
|
|
2830
|
+
const e = u ? B(u, t) : null;
|
|
2728
2831
|
if (!e) return !1;
|
|
2729
2832
|
const i = q(e);
|
|
2730
2833
|
return i !== "false" && i !== "0";
|
|
2731
|
-
},
|
|
2834
|
+
}, de = {
|
|
2732
2835
|
yellow: "#FFFF00",
|
|
2733
2836
|
green: "#00FF00",
|
|
2734
2837
|
cyan: "#00FFFF",
|
|
@@ -2745,7 +2848,7 @@ const oe = (p) => p.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, "
|
|
|
2745
2848
|
lightGray: "#D3D3D3",
|
|
2746
2849
|
black: "#000000",
|
|
2747
2850
|
white: "#FFFFFF"
|
|
2748
|
-
},
|
|
2851
|
+
}, qi = {
|
|
2749
2852
|
png: "image/png",
|
|
2750
2853
|
jpg: "image/jpeg",
|
|
2751
2854
|
jpeg: "image/jpeg",
|
|
@@ -2753,13 +2856,13 @@ const oe = (p) => p.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, "
|
|
|
2753
2856
|
bmp: "image/bmp",
|
|
2754
2857
|
webp: "image/webp"
|
|
2755
2858
|
};
|
|
2756
|
-
function
|
|
2859
|
+
function Ri(u) {
|
|
2757
2860
|
let t = "";
|
|
2758
|
-
for (let e = 0; e <
|
|
2759
|
-
t += String.fromCharCode(...
|
|
2861
|
+
for (let e = 0; e < u.length; e += 32768)
|
|
2862
|
+
t += String.fromCharCode(...u.subarray(e, e + 32768));
|
|
2760
2863
|
return btoa(t);
|
|
2761
2864
|
}
|
|
2762
|
-
class
|
|
2865
|
+
class Pi {
|
|
2763
2866
|
constructor(t, e, i) {
|
|
2764
2867
|
this.rels = t, this.images = e, this.numFmt = i;
|
|
2765
2868
|
}
|
|
@@ -2798,8 +2901,8 @@ class bi {
|
|
|
2798
2901
|
n ? s = "h" + n[1] : /^Title$/i.test(i) && (s = "h1");
|
|
2799
2902
|
const l = [], r = q(B(t, "pPr", "jc"));
|
|
2800
2903
|
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");
|
|
2801
|
-
const o = this.runsOf(t),
|
|
2802
|
-
return `<${s}${
|
|
2904
|
+
const o = this.runsOf(t), a = l.length ? ` style="${l.join(";")}"` : "";
|
|
2905
|
+
return `<${s}${a}>${o || "<br>"}</${s}>`;
|
|
2803
2906
|
}
|
|
2804
2907
|
runsOf(t) {
|
|
2805
2908
|
let e = "";
|
|
@@ -2810,24 +2913,24 @@ class bi {
|
|
|
2810
2913
|
const n = q(i, "anchor");
|
|
2811
2914
|
!s && n && (s = "#" + n);
|
|
2812
2915
|
const l = this.runsOf(i);
|
|
2813
|
-
e += s ? `<a href="${
|
|
2916
|
+
e += s ? `<a href="${he(s)}">${l}</a>` : l;
|
|
2814
2917
|
} else (i.localName === "smartTag" || i.localName === "ins") && (e += this.runsOf(i));
|
|
2815
2918
|
return e;
|
|
2816
2919
|
}
|
|
2817
2920
|
convertRun(t) {
|
|
2818
2921
|
const e = B(t, "rPr");
|
|
2819
2922
|
let i = "";
|
|
2820
|
-
for (const
|
|
2821
|
-
|
|
2923
|
+
for (const p of Array.from(t.children))
|
|
2924
|
+
p.localName === "t" ? i += he(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));
|
|
2822
2925
|
if (!i) return "";
|
|
2823
2926
|
const s = [], n = q(e ? B(e, "color") : null);
|
|
2824
2927
|
n && n !== "auto" && s.push("color:#" + n);
|
|
2825
2928
|
const l = q(e ? B(e, "highlight") : null);
|
|
2826
|
-
l &&
|
|
2929
|
+
l && de[l] && s.push("background-color:" + de[l]);
|
|
2827
2930
|
const r = parseFloat(q(e ? B(e, "sz") : null));
|
|
2828
2931
|
r && s.push("font-size:" + Math.round(r / 2 * (4 / 3)) + "px");
|
|
2829
|
-
const o = e ? B(e, "rFonts") : null,
|
|
2830
|
-
|
|
2932
|
+
const o = e ? B(e, "rFonts") : null, a = q(o, "ascii") || q(o, "cs");
|
|
2933
|
+
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>`);
|
|
2831
2934
|
const d = q(e ? B(e, "vertAlign") : null);
|
|
2832
2935
|
return d === "superscript" ? i = `<sup>${i}</sup>` : d === "subscript" && (i = `<sub>${i}</sub>`), i;
|
|
2833
2936
|
}
|
|
@@ -2848,9 +2951,9 @@ class bi {
|
|
|
2848
2951
|
}
|
|
2849
2952
|
convertTable(t) {
|
|
2850
2953
|
let e = '<table style="border-collapse:collapse;width:100%"><tbody>';
|
|
2851
|
-
for (const i of
|
|
2954
|
+
for (const i of ut(t, "tr")) {
|
|
2852
2955
|
e += "<tr>";
|
|
2853
|
-
for (const s of
|
|
2956
|
+
for (const s of ut(i, "tc")) {
|
|
2854
2957
|
const n = parseInt(q(B(s, "tcPr", "gridSpan")) || "1", 10) || 1, l = n > 1 ? ` colspan="${n}"` : "";
|
|
2855
2958
|
let r = "";
|
|
2856
2959
|
for (const o of Array.from(s.children))
|
|
@@ -2862,119 +2965,193 @@ class bi {
|
|
|
2862
2965
|
return e + "</tbody></table>";
|
|
2863
2966
|
}
|
|
2864
2967
|
}
|
|
2865
|
-
async function
|
|
2866
|
-
const t =
|
|
2867
|
-
const
|
|
2868
|
-
return
|
|
2968
|
+
async function Bi(u) {
|
|
2969
|
+
const t = u instanceof ArrayBuffer ? u : await u.arrayBuffer(), e = Ii(t), i = new TextDecoder(), s = async (b) => {
|
|
2970
|
+
const f = e.get(b);
|
|
2971
|
+
return f ? new DOMParser().parseFromString(i.decode(await ce(t, f)), "application/xml") : null;
|
|
2869
2972
|
}, n = await s("word/document.xml"), l = n == null ? void 0 : n.getElementsByTagName("*");
|
|
2870
2973
|
let r = null;
|
|
2871
2974
|
if (l) {
|
|
2872
|
-
for (const
|
|
2873
|
-
if (
|
|
2874
|
-
r =
|
|
2975
|
+
for (const b of Array.from(l))
|
|
2976
|
+
if (b.localName === "body") {
|
|
2977
|
+
r = b;
|
|
2875
2978
|
break;
|
|
2876
2979
|
}
|
|
2877
2980
|
}
|
|
2878
2981
|
if (!r) throw new Error("word/document.xml missing or invalid");
|
|
2879
|
-
const o = /* @__PURE__ */ new Map(),
|
|
2982
|
+
const o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), d = await s("word/_rels/document.xml.rels");
|
|
2880
2983
|
if (d)
|
|
2881
|
-
for (const
|
|
2882
|
-
if (
|
|
2883
|
-
const
|
|
2884
|
-
/hyperlink/i.test(
|
|
2984
|
+
for (const b of Array.from(d.getElementsByTagName("*"))) {
|
|
2985
|
+
if (b.localName !== "Relationship") continue;
|
|
2986
|
+
const f = b.getAttribute("Id") || "", y = b.getAttribute("Target") || "", C = b.getAttribute("Type") || "";
|
|
2987
|
+
/hyperlink/i.test(C) ? o.set(f, y) : /image/i.test(C) && a.set(f, y);
|
|
2885
2988
|
}
|
|
2886
|
-
const
|
|
2887
|
-
for (const [
|
|
2888
|
-
const
|
|
2889
|
-
if (!
|
|
2890
|
-
const E = (
|
|
2989
|
+
const p = /* @__PURE__ */ new Map();
|
|
2990
|
+
for (const [b, f] of a) {
|
|
2991
|
+
const y = f.startsWith("/") ? f.slice(1) : "word/" + f.replace(/^\.\//, ""), C = e.get(y);
|
|
2992
|
+
if (!C) continue;
|
|
2993
|
+
const E = (y.split(".").pop() || "").toLowerCase(), I = qi[E];
|
|
2891
2994
|
if (I)
|
|
2892
2995
|
try {
|
|
2893
|
-
|
|
2996
|
+
p.set(b, `data:${I};base64,${Ri(await ce(t, C))}`);
|
|
2894
2997
|
} catch {
|
|
2895
2998
|
}
|
|
2896
2999
|
}
|
|
2897
|
-
const m = /* @__PURE__ */ new Map(),
|
|
2898
|
-
if (
|
|
2899
|
-
const
|
|
2900
|
-
for (const
|
|
2901
|
-
if (
|
|
2902
|
-
const
|
|
2903
|
-
|
|
3000
|
+
const m = /* @__PURE__ */ new Map(), v = await s("word/numbering.xml");
|
|
3001
|
+
if (v) {
|
|
3002
|
+
const b = /* @__PURE__ */ new Map(), f = Array.from(v.getElementsByTagName("*"));
|
|
3003
|
+
for (const y of f) {
|
|
3004
|
+
if (y.localName !== "abstractNum") continue;
|
|
3005
|
+
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")) : "";
|
|
3006
|
+
b.set(C, I === "bullet" ? "ul" : "ol");
|
|
2904
3007
|
}
|
|
2905
|
-
for (const
|
|
2906
|
-
if (
|
|
2907
|
-
const
|
|
2908
|
-
m.set(
|
|
3008
|
+
for (const y of f) {
|
|
3009
|
+
if (y.localName !== "num") continue;
|
|
3010
|
+
const C = q(y, "numId"), E = q(B(y, "abstractNumId"));
|
|
3011
|
+
m.set(C, b.get(E) || "ul");
|
|
2909
3012
|
}
|
|
2910
3013
|
}
|
|
2911
|
-
return new
|
|
3014
|
+
return new Pi(o, p, m).convertBody(r);
|
|
2912
3015
|
}
|
|
2913
|
-
const
|
|
3016
|
+
const Di = ["nw", "ne", "sw", "se"], Et = ["img-left", "img-right", "img-top", "img-center"], St = {
|
|
2914
3017
|
"img-left": "tplimgleft",
|
|
2915
3018
|
"img-right": "tplimgright",
|
|
2916
3019
|
"img-top": "tplimgtop",
|
|
2917
3020
|
"img-center": "tplimgcenter"
|
|
2918
|
-
},
|
|
3021
|
+
}, Ni = {
|
|
2919
3022
|
"img-left": h.tplleft,
|
|
2920
3023
|
"img-right": h.tplright,
|
|
2921
3024
|
"img-top": h.tpltop,
|
|
2922
3025
|
"img-center": h.tplcenter
|
|
2923
|
-
},
|
|
2924
|
-
let O = null, X = null,
|
|
3026
|
+
}, Oi = ".tox,.pop,.tblctx,.imgctx,.selctx,.dlg";
|
|
3027
|
+
let O = null, X = null, Lt = 0, ue = !1;
|
|
2925
3028
|
function ct() {
|
|
2926
|
-
clearTimeout(
|
|
3029
|
+
clearTimeout(Lt), X = null, O && O.classList.remove("show");
|
|
2927
3030
|
}
|
|
2928
|
-
function
|
|
2929
|
-
const t =
|
|
3031
|
+
function Zi(u) {
|
|
3032
|
+
const t = u.dataset.tip;
|
|
2930
3033
|
if (!t) return;
|
|
2931
|
-
X =
|
|
3034
|
+
X = u, clearTimeout(Lt);
|
|
2932
3035
|
const e = O && O.classList.contains("show") ? 60 : 350;
|
|
2933
|
-
|
|
2934
|
-
if (X !==
|
|
3036
|
+
Lt = window.setTimeout(() => {
|
|
3037
|
+
if (X !== u || !document.contains(u)) return;
|
|
2935
3038
|
O || (O = document.createElement("div"), O.className = "etip", document.body.appendChild(O)), O.textContent = t, O.classList.add("show");
|
|
2936
|
-
const i =
|
|
3039
|
+
const i = u.getBoundingClientRect(), s = O.offsetWidth, n = O.offsetHeight;
|
|
2937
3040
|
let l = i.left + i.width / 2 - s / 2;
|
|
2938
3041
|
l = Math.max(6, Math.min(l, innerWidth - s - 6));
|
|
2939
3042
|
let r = i.bottom + 7;
|
|
2940
3043
|
r + n > innerHeight - 6 && (r = i.top - n - 7), O.style.left = l + "px", O.style.top = r + "px";
|
|
2941
3044
|
}, e);
|
|
2942
3045
|
}
|
|
2943
|
-
function
|
|
2944
|
-
|
|
2945
|
-
const t =
|
|
2946
|
-
if (!e || !e.closest(
|
|
3046
|
+
function Fi() {
|
|
3047
|
+
ue || (ue = !0, document.addEventListener("mouseover", (u) => {
|
|
3048
|
+
const t = u.target, e = t.closest ? t.closest("[title],[data-tip]") : null;
|
|
3049
|
+
if (!e || !e.closest(Oi) || e.closest(".earea")) {
|
|
2947
3050
|
e !== X && ct();
|
|
2948
3051
|
return;
|
|
2949
3052
|
}
|
|
2950
3053
|
const i = e.getAttribute("title");
|
|
2951
|
-
i && (e.dataset.tip = i, e.removeAttribute("title"), e.getAttribute("aria-label") || e.setAttribute("aria-label", i)), e !== X &&
|
|
2952
|
-
}), document.addEventListener("mouseout", (
|
|
2953
|
-
X && !X.contains(
|
|
3054
|
+
i && (e.dataset.tip = i, e.removeAttribute("title"), e.getAttribute("aria-label") || e.setAttribute("aria-label", i)), e !== X && Zi(e);
|
|
3055
|
+
}), document.addEventListener("mouseout", (u) => {
|
|
3056
|
+
X && !X.contains(u.relatedTarget) && ct();
|
|
2954
3057
|
}), document.addEventListener("mousedown", ct, !0), addEventListener("scroll", ct, !0));
|
|
2955
3058
|
}
|
|
2956
|
-
const
|
|
2957
|
-
function
|
|
2958
|
-
for (const t of
|
|
2959
|
-
if (
|
|
2960
|
-
if (
|
|
3059
|
+
const _i = /[\u0590-\u05FF\u0600-\u06FF\u0750-\u077F\u0780-\u07BF\u08A0-\u08FF\uFB1D-\uFB4F\uFB50-\uFDFF\uFE70-\uFEFF]/, $i = new RegExp("\\p{L}", "u"), ji = "p,div,li,td,th,blockquote,h1,h2,h3,h4,h5,h6,pre,figcaption";
|
|
3060
|
+
function Wi(u) {
|
|
3061
|
+
for (const t of u) {
|
|
3062
|
+
if (_i.test(t)) return "rtl";
|
|
3063
|
+
if ($i.test(t)) return "ltr";
|
|
2961
3064
|
}
|
|
2962
3065
|
return null;
|
|
2963
3066
|
}
|
|
2964
|
-
|
|
3067
|
+
const ht = ["top", "right", "bottom", "left"], Ui = /^(none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset)$/i, Vi = /^(thin|medium|thick|[+-]?(\d+\.?\d*|\.\d+)(px|pt|em|rem|ex|ch|cm|mm|in|pc|q)?)$/i, zi = /^[+-]?0*(\.0*)?(px|pt|em|rem|ex|ch|cm|mm|in|pc|q)?$/i, Xi = /^border-(collapse|spacing|radius|image|block|inline|start|end)/i, Yi = /^border(?:-(top|right|bottom|left))?(?:-(width|style|color))?$/, Gi = /^(inherit|initial|unset|revert|revert-layer)$/i;
|
|
3068
|
+
function ve(u) {
|
|
3069
|
+
const t = [];
|
|
3070
|
+
let e = 0, i = "";
|
|
3071
|
+
for (const s of u)
|
|
3072
|
+
s === "(" ? e++ : s === ")" && e--, e === 0 && /\s/.test(s) ? (i && t.push(i), i = "") : i += s;
|
|
3073
|
+
return i && t.push(i), t;
|
|
3074
|
+
}
|
|
3075
|
+
function Ki(u) {
|
|
3076
|
+
const [t, e = t, i = t, s = e] = u;
|
|
3077
|
+
return [t, e, i, s];
|
|
3078
|
+
}
|
|
3079
|
+
function Qi(u) {
|
|
3080
|
+
const t = { width: "medium", style: "none", color: "" };
|
|
3081
|
+
return ve(u).forEach((e) => {
|
|
3082
|
+
Ui.test(e) ? t.style = e.toLowerCase() : Vi.test(e) ? t.width = e : t.color = e;
|
|
3083
|
+
}), t;
|
|
3084
|
+
}
|
|
3085
|
+
function Ji(u) {
|
|
3086
|
+
return !u || /^currentcolor$/i.test(u) ? "" : /^windowtext$/i.test(u) ? "#000000" : u;
|
|
3087
|
+
}
|
|
3088
|
+
function ts(u) {
|
|
3089
|
+
if (u.width === null && u.style === null && u.color === null) return "";
|
|
3090
|
+
const t = u.style ?? "solid";
|
|
3091
|
+
return t === "none" || t === "hidden" || u.width && zi.test(u.width) ? "none" : [u.width && u.width !== "medium" ? u.width : "", t, Ji(u.color || "")].filter(Boolean).join(" ");
|
|
3092
|
+
}
|
|
3093
|
+
function es(u) {
|
|
3094
|
+
u.querySelectorAll("table,td,th").forEach((t) => {
|
|
3095
|
+
const e = t.getAttribute("style") || "";
|
|
3096
|
+
if (!/border/i.test(e)) return;
|
|
3097
|
+
const i = {
|
|
3098
|
+
top: { width: null, style: null, color: null },
|
|
3099
|
+
right: { width: null, style: null, color: null },
|
|
3100
|
+
bottom: { width: null, style: null, color: null },
|
|
3101
|
+
left: { width: null, style: null, color: null }
|
|
3102
|
+
}, s = [];
|
|
3103
|
+
let n = !1, l = !1;
|
|
3104
|
+
if (e.split(";").forEach((a) => {
|
|
3105
|
+
const d = a.indexOf(":");
|
|
3106
|
+
if (d < 1) {
|
|
3107
|
+
a.trim() && s.push(a.trim());
|
|
3108
|
+
return;
|
|
3109
|
+
}
|
|
3110
|
+
const p = a.slice(0, d).trim().toLowerCase(), m = a.slice(d + 1).trim(), v = Yi.exec(p);
|
|
3111
|
+
if (!v || Xi.test(p)) {
|
|
3112
|
+
s.push(p + ":" + m);
|
|
3113
|
+
return;
|
|
3114
|
+
}
|
|
3115
|
+
if (Gi.test(m)) {
|
|
3116
|
+
l = !0;
|
|
3117
|
+
return;
|
|
3118
|
+
}
|
|
3119
|
+
n = !0;
|
|
3120
|
+
const b = v[1], f = v[2];
|
|
3121
|
+
if (f)
|
|
3122
|
+
if (b)
|
|
3123
|
+
i[b][f] = m;
|
|
3124
|
+
else {
|
|
3125
|
+
const y = Ki(ve(m));
|
|
3126
|
+
ht.forEach((C, E) => {
|
|
3127
|
+
i[C][f] = y[E];
|
|
3128
|
+
});
|
|
3129
|
+
}
|
|
3130
|
+
else {
|
|
3131
|
+
const y = Qi(m);
|
|
3132
|
+
(b ? [b] : ht.slice()).forEach((C) => {
|
|
3133
|
+
i[C] = { ...y };
|
|
3134
|
+
});
|
|
3135
|
+
}
|
|
3136
|
+
}), l || !n) return;
|
|
3137
|
+
const r = ht.map((a) => ts(i[a])), o = s.slice();
|
|
3138
|
+
r.every((a) => a && a === r[0]) ? o.push("border:" + r[0]) : ht.forEach((a, d) => r[d] && o.push(`border-${a}:` + r[d])), t.setAttribute("style", o.join(";"));
|
|
3139
|
+
});
|
|
3140
|
+
}
|
|
3141
|
+
function be(u) {
|
|
2965
3142
|
let t = "";
|
|
2966
|
-
return
|
|
3143
|
+
return u.childNodes.forEach((e) => {
|
|
2967
3144
|
if (e.nodeType === Node.TEXT_NODE)
|
|
2968
3145
|
t += e.nodeValue || "";
|
|
2969
3146
|
else if (e.nodeType === Node.ELEMENT_NODE) {
|
|
2970
3147
|
const i = e, s = (i.getAttribute("dir") || "").toLowerCase();
|
|
2971
3148
|
if (s === "rtl" || s === "ltr") return;
|
|
2972
|
-
t +=
|
|
3149
|
+
t += be(i);
|
|
2973
3150
|
}
|
|
2974
3151
|
}), t;
|
|
2975
3152
|
}
|
|
2976
3153
|
var j;
|
|
2977
|
-
let
|
|
3154
|
+
let is = (j = class {
|
|
2978
3155
|
constructor(t) {
|
|
2979
3156
|
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 = {
|
|
2980
3157
|
target: t.target,
|
|
@@ -2990,20 +3167,20 @@ let Hi = (j = class {
|
|
|
2990
3167
|
statusbar: t.statusbar ?? !0,
|
|
2991
3168
|
readonly: t.readonly ?? !1,
|
|
2992
3169
|
draftKey: t.draftKey ?? (typeof location < "u" ? location.pathname : "default"),
|
|
2993
|
-
fontFamilyFormats: t.fontFamilyFormats ??
|
|
3170
|
+
fontFamilyFormats: t.fontFamilyFormats ?? ii,
|
|
2994
3171
|
imageFileTypes: t.imageFileTypes ?? ["image/jpeg", "image/jpg", "image/png", "image/gif", "image/bmp", "image/webp"],
|
|
2995
3172
|
videoFileTypes: t.videoFileTypes ?? ["video/mp4", "video/webm", "video/ogg"]
|
|
2996
|
-
}, this.imageUploadHandler = t.imageUploadHandler, this.onImageUploadError = t.onImageUploadError, this.videoUploadHandler = t.videoUploadHandler, this.onVideoUploadError = t.onVideoUploadError, this.contentStyle = t.contentStyle, this.applyTheme(t), this.lang = this.options.language, this.draftStorageKey = "tmclone-draft:" + this.options.draftKey, this.initDOM(), this.bindEvents(), this.initUI(), this.recordRevision(), this.options.onReady(this);
|
|
3173
|
+
}, 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);
|
|
2997
3174
|
}
|
|
2998
3175
|
t(t) {
|
|
2999
|
-
const e =
|
|
3176
|
+
const e = wt(this.lang)[t];
|
|
3000
3177
|
return typeof e == "string" ? e : e.join(",");
|
|
3001
3178
|
}
|
|
3002
3179
|
tArr(t) {
|
|
3003
|
-
return
|
|
3180
|
+
return wt(this.lang)[t];
|
|
3004
3181
|
}
|
|
3005
3182
|
dir() {
|
|
3006
|
-
return
|
|
3183
|
+
return wt(this.lang).dir;
|
|
3007
3184
|
}
|
|
3008
3185
|
/* ---------------------------------------------------------- DOM setup */
|
|
3009
3186
|
initDOM() {
|
|
@@ -3016,7 +3193,7 @@ let Hi = (j = class {
|
|
|
3016
3193
|
</span>
|
|
3017
3194
|
`, this.sbHelp = this.statusbar.querySelector(".mid"), this.sbWords = this.statusbar.querySelector(".words");
|
|
3018
3195
|
const e = this.statusbar.querySelector(".grip");
|
|
3019
|
-
this.bindGrip(e), this.shell.appendChild(this.menubar), this.shell.appendChild(this.toolbar), this.shell.appendChild(this.ed), this.shell.appendChild(this.statusbar), this.contentStyle && (this.contentStyleEl = document.createElement("style"), this.contentStyleEl.textContent = this.scopeContentStyle(this.contentStyle), this.shell.appendChild(this.contentStyleEl)), t.appendChild(this.shell),
|
|
3196
|
+
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), Fi(), 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);
|
|
3020
3197
|
}
|
|
3021
3198
|
/** Theme options land as CSS variables on the document root rather than the editor
|
|
3022
3199
|
* shell, because dialogs, popups and floating context toolbars are appended to
|
|
@@ -3063,31 +3240,31 @@ let Hi = (j = class {
|
|
|
3063
3240
|
t.preventDefault();
|
|
3064
3241
|
const e = t.target, i = (n = e.closest) == null ? void 0 : n.call(e, ".img-ph:not(.vid-ph)");
|
|
3065
3242
|
if (i && this.ed.contains(i) && !this.options.readonly) {
|
|
3066
|
-
const
|
|
3067
|
-
|
|
3243
|
+
const a = Array.from(((l = t.dataTransfer) == null ? void 0 : l.files) || []).find((d) => d.type.startsWith("image/"));
|
|
3244
|
+
a && this.readImageFileInto(a, i);
|
|
3068
3245
|
return;
|
|
3069
3246
|
}
|
|
3070
3247
|
const s = (r = e.closest) == null ? void 0 : r.call(e, ".vid-ph");
|
|
3071
3248
|
if (s && this.ed.contains(s) && !this.options.readonly) {
|
|
3072
|
-
const
|
|
3073
|
-
|
|
3249
|
+
const a = Array.from(((o = t.dataTransfer) == null ? void 0 : o.files) || []).find((d) => d.type.startsWith("video/"));
|
|
3250
|
+
a && this.readVideoFileInto(a, s);
|
|
3074
3251
|
}
|
|
3075
3252
|
}), this.on(this.ed, "dragover", (t) => t.preventDefault()), this.on(this.ed, "mousedown", (t) => {
|
|
3076
|
-
var d,
|
|
3253
|
+
var d, p, m, v, b, f, y;
|
|
3077
3254
|
const e = t.target, i = (d = e.closest) == null ? void 0 : d.call(e, "table");
|
|
3078
3255
|
i && this.ed.contains(i) ? this.selectTableForResize(i) : this.clearTableHandles();
|
|
3079
|
-
const s = (
|
|
3256
|
+
const s = (p = e.closest) == null ? void 0 : p.call(e, ".img-ph:not(.vid-ph)");
|
|
3080
3257
|
s && this.ed.contains(s) && !this.options.readonly ? (t.preventDefault(), this.ed.focus(), this.selectImgPlaceholder(s)) : this.clearImgPlaceholderSel();
|
|
3081
3258
|
const n = (m = e.closest) == null ? void 0 : m.call(e, ".vid-ph");
|
|
3082
3259
|
n && this.ed.contains(n) && !this.options.readonly ? (t.preventDefault(), this.ed.focus(), this.selectVphPlaceholder(n)) : this.clearVphPlaceholderSel();
|
|
3083
|
-
const l = (
|
|
3260
|
+
const l = (v = e.closest) == null ? void 0 : v.call(e, ".tpl");
|
|
3084
3261
|
l && this.ed.contains(l) && !this.options.readonly ? this.selectTemplate(l) : this.clearTplSel();
|
|
3085
|
-
const r = (
|
|
3262
|
+
const r = (b = e.closest) == null ? void 0 : b.call(e, "pre.code-block");
|
|
3086
3263
|
r && this.ed.contains(r) && !this.options.readonly ? (t.preventDefault(), this.selectCodeEl(r)) : this.clearCodeSel();
|
|
3087
|
-
const o = (
|
|
3264
|
+
const o = (f = e.closest) == null ? void 0 : f.call(e, "img");
|
|
3088
3265
|
o && this.ed.contains(o) && !this.options.readonly ? (t.preventDefault(), this.selectImage(o)) : this.clearImageHandles();
|
|
3089
|
-
const
|
|
3090
|
-
|
|
3266
|
+
const a = (y = e.closest) == null ? void 0 : y.call(e, "video, .video-embed");
|
|
3267
|
+
a && this.ed.contains(a) && !this.options.readonly ? (t.preventDefault(), this.selectVideo(a)) : this.clearVidHandles();
|
|
3091
3268
|
}), this.on(this.ed, "mouseover", (t) => {
|
|
3092
3269
|
var i, s;
|
|
3093
3270
|
if (this.options.readonly) return;
|
|
@@ -3126,11 +3303,7 @@ let Hi = (j = class {
|
|
|
3126
3303
|
}
|
|
3127
3304
|
const i = new FileReader();
|
|
3128
3305
|
i.onload = () => {
|
|
3129
|
-
this.restoreSel(),
|
|
3130
|
-
"insertHTML",
|
|
3131
|
-
!1,
|
|
3132
|
-
`<img src="${i.result}" title="${t.name.replace(/"/g, "")}" alt="">`
|
|
3133
|
-
), this.onChange();
|
|
3306
|
+
this.restoreSel(), this.insertImageHTML(i.result, t.name.replace(/"/g, "")), this.onChange();
|
|
3134
3307
|
}, i.readAsDataURL(t);
|
|
3135
3308
|
}), this.on(this.vidInput, "change", () => {
|
|
3136
3309
|
var s;
|
|
@@ -3184,33 +3357,44 @@ let Hi = (j = class {
|
|
|
3184
3357
|
* content with no strongly-directional character anywhere falls back to the
|
|
3185
3358
|
* editor's current direction. */
|
|
3186
3359
|
getContentForEmail() {
|
|
3187
|
-
const t = (
|
|
3188
|
-
const
|
|
3189
|
-
|
|
3360
|
+
const t = (r, o) => {
|
|
3361
|
+
const a = (r.getAttribute("style") || "").trim();
|
|
3362
|
+
r.setAttribute("style", a ? a.replace(/;?$/, "; ") + o : o);
|
|
3190
3363
|
}, e = document.createElement("div");
|
|
3191
3364
|
e.innerHTML = this.ed.innerHTML;
|
|
3192
3365
|
let i = null;
|
|
3193
|
-
e.querySelectorAll("[dir]").forEach((
|
|
3194
|
-
const
|
|
3195
|
-
if (
|
|
3196
|
-
const
|
|
3197
|
-
i || (i =
|
|
3198
|
-
}), e.querySelectorAll(
|
|
3199
|
-
const
|
|
3200
|
-
if (
|
|
3201
|
-
const
|
|
3202
|
-
if (!
|
|
3203
|
-
i || (i =
|
|
3204
|
-
const
|
|
3205
|
-
t(
|
|
3366
|
+
e.querySelectorAll("[dir]").forEach((r) => {
|
|
3367
|
+
const o = (r.getAttribute("dir") || "").toLowerCase();
|
|
3368
|
+
if (o !== "rtl" && o !== "ltr") return;
|
|
3369
|
+
const a = o;
|
|
3370
|
+
i || (i = a), /text-align\s*:/i.test(r.getAttribute("style") || "") || t(r, `text-align:${a === "rtl" ? "right" : "left"}`);
|
|
3371
|
+
}), e.querySelectorAll(ji).forEach((r) => {
|
|
3372
|
+
const o = (r.getAttribute("dir") || "").toLowerCase();
|
|
3373
|
+
if (o === "rtl" || o === "ltr") return;
|
|
3374
|
+
const a = Wi(be(r));
|
|
3375
|
+
if (!a) return;
|
|
3376
|
+
i || (i = a), r.setAttribute("dir", a);
|
|
3377
|
+
const d = /text-align\s*:/i.test(r.getAttribute("style") || "");
|
|
3378
|
+
t(r, d ? `direction:${a}` : `direction:${a};text-align:${a === "rtl" ? "right" : "left"}`);
|
|
3206
3379
|
});
|
|
3207
|
-
const s =
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3380
|
+
const s = this.ed.querySelectorAll("img");
|
|
3381
|
+
e.querySelectorAll("img").forEach((r, o) => {
|
|
3382
|
+
if (r.closest(".tpl-media")) return;
|
|
3383
|
+
const a = s[o], d = Math.round((a == null ? void 0 : a.getBoundingClientRect().width) || 0);
|
|
3384
|
+
d > 0 && !r.getAttribute("width") && r.setAttribute("width", String(d));
|
|
3385
|
+
const p = r.getAttribute("style") || "";
|
|
3386
|
+
d > 0 && !/(^|;)\s*width\s*:/i.test(p) && t(r, `width:${d}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");
|
|
3387
|
+
}), es(e), e.querySelectorAll("table").forEach((r) => {
|
|
3388
|
+
const o = r.getAttribute("style") || "";
|
|
3389
|
+
/border-collapse\s*:/i.test(o) || t(r, "border-collapse:collapse"), !/border-spacing\s*:/i.test(o) && !r.hasAttribute("cellspacing") && r.setAttribute("cellspacing", "0");
|
|
3390
|
+
});
|
|
3391
|
+
const n = i || this.ed.getAttribute("dir") || this.dir();
|
|
3392
|
+
return e.querySelectorAll("table:not([dir])").forEach((r) => {
|
|
3393
|
+
r.setAttribute("dir", n), /direction\s*:/i.test(r.getAttribute("style") || "") || t(r, `direction:${n}`);
|
|
3394
|
+
}), `<div dir="${n}" style="direction:${n};text-align:${n === "rtl" ? "right" : "left"}">${e.innerHTML}</div>`;
|
|
3211
3395
|
}
|
|
3212
3396
|
setContent(t) {
|
|
3213
|
-
this.ed.innerHTML = t || "<p><br></p>", this.refreshState(), this.clearTableHandles(), this.clearImageHandles(), this.clearImgPlaceholderSel(), this.clearTplSel(), this.clearVphPlaceholderSel(), this.clearVidHandles(), this.clearCodeSel(), this.clearSelToolbar(), this.onChange();
|
|
3397
|
+
this.ed.innerHTML = t || "<p><br></p>", this.refreshState(), this.clearTableHandles(), this.clearImageHandles(), this.clearImgPlaceholderSel(), this.clearTplSel(), this.clearVphPlaceholderSel(), this.clearVidHandles(), this.clearCodeSel(), this.clearSelToolbar(), this.onChange(), this.stampExistingImages();
|
|
3214
3398
|
}
|
|
3215
3399
|
insertContent(t) {
|
|
3216
3400
|
this.restoreSel(), document.execCommand("insertHTML", !1, t), this.saveSel(), this.refreshState(), this.onChange();
|
|
@@ -3222,7 +3406,7 @@ let Hi = (j = class {
|
|
|
3222
3406
|
this.ed.focus();
|
|
3223
3407
|
}
|
|
3224
3408
|
async importWordFile(t) {
|
|
3225
|
-
const e = await
|
|
3409
|
+
const e = await Bi(t);
|
|
3226
3410
|
this.recordRevision(), this.setContent(e), this.recordRevision();
|
|
3227
3411
|
}
|
|
3228
3412
|
restoreDraft() {
|
|
@@ -3340,22 +3524,22 @@ let Hi = (j = class {
|
|
|
3340
3524
|
hour: "2-digit",
|
|
3341
3525
|
minute: "2-digit",
|
|
3342
3526
|
second: "2-digit"
|
|
3343
|
-
}), o = {},
|
|
3344
|
-
l = d, this.revisions.forEach((
|
|
3345
|
-
var
|
|
3346
|
-
return (
|
|
3527
|
+
}), o = {}, a = (d) => {
|
|
3528
|
+
l = d, this.revisions.forEach((p, m) => {
|
|
3529
|
+
var v;
|
|
3530
|
+
return (v = o[m]) == null ? void 0 : v.classList.toggle("on", m === d);
|
|
3347
3531
|
}), s.innerHTML = this.revisions[d].html, n.disabled = d === this.revisions.length - 1;
|
|
3348
3532
|
};
|
|
3349
3533
|
for (let d = this.revisions.length - 1; d >= 0; d--) {
|
|
3350
|
-
const
|
|
3534
|
+
const p = this.revisions[d], m = document.createElement("button");
|
|
3351
3535
|
m.type = "button";
|
|
3352
|
-
const
|
|
3353
|
-
m.innerHTML = `<span>${
|
|
3536
|
+
const v = (new DOMParser().parseFromString(p.html, "text/html").body.textContent || "").trim(), b = v ? v.split(/\s+/).length : 0, f = d === this.revisions.length - 1;
|
|
3537
|
+
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(d)), o[d] = m, i.appendChild(m);
|
|
3354
3538
|
}
|
|
3355
3539
|
i.append(n), n.addEventListener("click", () => {
|
|
3356
3540
|
const d = this.revisions[l];
|
|
3357
3541
|
d && (this.recordRevision(), this.setContent(d.html), this.recordRevision(), this.closeDlg());
|
|
3358
|
-
}), e.append(i, s), t.appendChild(e),
|
|
3542
|
+
}), e.append(i, s), t.appendChild(e), a(l);
|
|
3359
3543
|
});
|
|
3360
3544
|
}
|
|
3361
3545
|
/* ---------------------------------------------------------- popups / menus */
|
|
@@ -3389,8 +3573,8 @@ let Hi = (j = class {
|
|
|
3389
3573
|
const i = e.getBoundingClientRect(), s = e.closest(".pop");
|
|
3390
3574
|
this.closeSubFrom(s ? this.subLevelOf(s) : 0);
|
|
3391
3575
|
const n = document.createElement("div");
|
|
3392
|
-
n.className = "pop sub", n.dir = this.dir(), t.subBuild ? t.subBuild(n) : t.sub && this.menuItems(n, t.sub), n.addEventListener("mousedown", (
|
|
3393
|
-
|
|
3576
|
+
n.className = "pop sub", n.dir = this.dir(), t.subBuild ? t.subBuild(n) : t.sub && this.menuItems(n, t.sub), n.addEventListener("mousedown", (a) => {
|
|
3577
|
+
a.target.tagName !== "INPUT" && a.preventDefault();
|
|
3394
3578
|
}), document.body.appendChild(n);
|
|
3395
3579
|
let r = this.dir() === "rtl" ? i.left - n.offsetWidth + 2 : i.right - 2;
|
|
3396
3580
|
r = Math.max(8, Math.min(r + scrollX, scrollX + innerWidth - n.offsetWidth - 8));
|
|
@@ -3410,8 +3594,8 @@ let Hi = (j = class {
|
|
|
3410
3594
|
let l = n.bottom + scrollY + 2;
|
|
3411
3595
|
l = Math.max(8 + scrollY, Math.min(l, scrollY + innerHeight - s.offsetHeight - 8)), s.style.top = l + "px";
|
|
3412
3596
|
let o = this.dir() === "rtl" ? n.right - s.offsetWidth : n.left;
|
|
3413
|
-
o = Math.max(8, Math.min(o + scrollX, scrollX + innerWidth - s.offsetWidth - 8)), s.style.left = o + "px", s.addEventListener("mousedown", (
|
|
3414
|
-
|
|
3597
|
+
o = Math.max(8, Math.min(o + scrollX, scrollX + innerWidth - s.offsetWidth - 8)), s.style.left = o + "px", s.addEventListener("mousedown", (a) => {
|
|
3598
|
+
a.target.tagName !== "INPUT" && a.preventDefault();
|
|
3415
3599
|
}), this.openPop = s, this.popAnchor = t, t.classList.add("open");
|
|
3416
3600
|
}
|
|
3417
3601
|
menuItems(t, e) {
|
|
@@ -3454,7 +3638,7 @@ let Hi = (j = class {
|
|
|
3454
3638
|
return n.type = "button", n.className = "cchip", n.title = s, n.addEventListener("mousedown", (l) => {
|
|
3455
3639
|
l.preventDefault(), this.saveSel();
|
|
3456
3640
|
}), n;
|
|
3457
|
-
}, e =
|
|
3641
|
+
}, e = li.map((s) => {
|
|
3458
3642
|
const n = t(this.t("forecolor"));
|
|
3459
3643
|
return n.style.background = s, n.addEventListener("click", () => this.applyColor("fore", s)), n;
|
|
3460
3644
|
}), i = t(this.t("forecolor"));
|
|
@@ -3481,7 +3665,7 @@ let Hi = (j = class {
|
|
|
3481
3665
|
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();
|
|
3482
3666
|
}
|
|
3483
3667
|
listMenu(t, e) {
|
|
3484
|
-
var
|
|
3668
|
+
var a;
|
|
3485
3669
|
const i = e === "ol" ? "insertOrderedList" : "insertUnorderedList", s = e === "ol" ? [
|
|
3486
3670
|
["lower-alpha", h.ol_alpha],
|
|
3487
3671
|
["lower-roman", h.ol_roman],
|
|
@@ -3490,7 +3674,7 @@ let Hi = (j = class {
|
|
|
3490
3674
|
] : [
|
|
3491
3675
|
["circle", h.ul_circle],
|
|
3492
3676
|
["square", h.ul_square]
|
|
3493
|
-
], n = this.tArr(e === "ol" ? "liststyles_ol" : "liststyles_ul").slice(1), l = window.getSelection(), r = l ? (
|
|
3677
|
+
], 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 : "";
|
|
3494
3678
|
this.popup(t, (d) => {
|
|
3495
3679
|
this.menuItems(d, [
|
|
3496
3680
|
{
|
|
@@ -3500,13 +3684,13 @@ let Hi = (j = class {
|
|
|
3500
3684
|
action: () => this.exec(i)
|
|
3501
3685
|
}
|
|
3502
3686
|
]), d.insertAdjacentHTML("beforeend", '<div class="sep"></div>');
|
|
3503
|
-
const
|
|
3504
|
-
|
|
3505
|
-
const
|
|
3506
|
-
|
|
3687
|
+
const p = document.createElement("div");
|
|
3688
|
+
p.className = "mi-grid", s.forEach(([m, v], b) => {
|
|
3689
|
+
const f = document.createElement("button");
|
|
3690
|
+
f.className = "mi" + (o === m ? " on" : ""), f.innerHTML = `<span class="ic">${v}</span><span class="prev">${n[b]}</span>`, f.addEventListener("click", () => {
|
|
3507
3691
|
this.closePop(), this.setListStyle(e, m);
|
|
3508
|
-
}),
|
|
3509
|
-
}), d.appendChild(
|
|
3692
|
+
}), p.appendChild(f);
|
|
3693
|
+
}), d.appendChild(p);
|
|
3510
3694
|
});
|
|
3511
3695
|
}
|
|
3512
3696
|
/** Shared color-picker popup body — swatch grid plus the current-color /
|
|
@@ -3514,10 +3698,10 @@ let Hi = (j = class {
|
|
|
3514
3698
|
* table cell-background menu all show the identical popup. */
|
|
3515
3699
|
buildPaletteInto(t, e, i) {
|
|
3516
3700
|
const s = document.createElement("div");
|
|
3517
|
-
s.className = "cpal",
|
|
3701
|
+
s.className = "cpal", oi.forEach((p) => {
|
|
3518
3702
|
const m = document.createElement("button");
|
|
3519
|
-
m.type = "button", m.style.background =
|
|
3520
|
-
this.closePop(), i(
|
|
3703
|
+
m.type = "button", m.style.background = p, m.title = p, m.addEventListener("click", () => {
|
|
3704
|
+
this.closePop(), i(p);
|
|
3521
3705
|
}), s.appendChild(m);
|
|
3522
3706
|
}), t.appendChild(s), t.insertAdjacentHTML("beforeend", '<div class="sep"></div>');
|
|
3523
3707
|
const n = document.createElement("div");
|
|
@@ -3528,12 +3712,12 @@ let Hi = (j = class {
|
|
|
3528
3712
|
o.type = "button", o.className = "cswatch nocolor", o.title = this.t("removecolor"), o.addEventListener("click", () => {
|
|
3529
3713
|
this.closePop(), i(null);
|
|
3530
3714
|
});
|
|
3531
|
-
const
|
|
3532
|
-
|
|
3715
|
+
const a = document.createElement("label");
|
|
3716
|
+
a.className = "cswatch cwheel", a.title = this.t("customcolor"), a.innerHTML = h.palette;
|
|
3533
3717
|
const d = document.createElement("input");
|
|
3534
3718
|
d.type = "color", d.value = l, d.addEventListener("change", () => {
|
|
3535
3719
|
this.closePop(), i(d.value);
|
|
3536
|
-
}),
|
|
3720
|
+
}), a.appendChild(d), n.append(r, o, a), t.appendChild(n);
|
|
3537
3721
|
}
|
|
3538
3722
|
colorMenu(t, e) {
|
|
3539
3723
|
this.popup(
|
|
@@ -3563,7 +3747,7 @@ let Hi = (j = class {
|
|
|
3563
3747
|
this.popup(t, (e) => this.menuItems(e, this.fontItems()));
|
|
3564
3748
|
}
|
|
3565
3749
|
sizeItems() {
|
|
3566
|
-
return
|
|
3750
|
+
return si.map((t) => ({
|
|
3567
3751
|
label: t,
|
|
3568
3752
|
on: this.currentSize() === t,
|
|
3569
3753
|
action: () => this.applyFontSize(t)
|
|
@@ -3590,8 +3774,8 @@ let Hi = (j = class {
|
|
|
3590
3774
|
for (; r > 0 && /\S/.test(l[r - 1]); ) r--;
|
|
3591
3775
|
for (; o < l.length && /\S/.test(l[o]); ) o++;
|
|
3592
3776
|
if (o > r) {
|
|
3593
|
-
const
|
|
3594
|
-
|
|
3777
|
+
const a = document.createRange();
|
|
3778
|
+
a.setStart(i, r), a.setEnd(i, o), t.removeAllRanges(), t.addRange(a), this.savedRange = a.cloneRange();
|
|
3595
3779
|
return;
|
|
3596
3780
|
}
|
|
3597
3781
|
}
|
|
@@ -3616,7 +3800,7 @@ let Hi = (j = class {
|
|
|
3616
3800
|
this.saveSel(), this.refreshState(), this.onChange();
|
|
3617
3801
|
}
|
|
3618
3802
|
stepFontSize(t) {
|
|
3619
|
-
const e = parseInt(this.currentSize(), 10) || 14, i = Math.min(
|
|
3803
|
+
const e = parseInt(this.currentSize(), 10) || 14, i = Math.min(ri, Math.max(ni, e + t));
|
|
3620
3804
|
i !== e && this.applyFontSize(i + "px");
|
|
3621
3805
|
}
|
|
3622
3806
|
/* ------------------------------------------------ case / spacing / link */
|
|
@@ -3628,11 +3812,11 @@ let Hi = (j = class {
|
|
|
3628
3812
|
let l;
|
|
3629
3813
|
for (; l = s.nextNode(); ) i.intersectsNode(l) && n.push(l);
|
|
3630
3814
|
n.forEach((r) => {
|
|
3631
|
-
const o = r === i.startContainer ? i.startOffset : 0,
|
|
3632
|
-
if (
|
|
3633
|
-
const d = r.data.slice(o,
|
|
3634
|
-
let
|
|
3635
|
-
t === "lower" ?
|
|
3815
|
+
const o = r === i.startContainer ? i.startOffset : 0, a = r === i.endContainer ? i.endOffset : r.data.length;
|
|
3816
|
+
if (a <= o) return;
|
|
3817
|
+
const d = r.data.slice(o, a);
|
|
3818
|
+
let p = d;
|
|
3819
|
+
t === "lower" ? p = d.toLowerCase() : t === "upper" ? p = d.toUpperCase() : p = d.replace(/(^|\s)(\S)/g, (m, v, b) => v + b.toUpperCase()), r.replaceData(o, a - o, p);
|
|
3636
3820
|
}), this.saveSel(), this.refreshState(), this.onChange();
|
|
3637
3821
|
}
|
|
3638
3822
|
caseItems() {
|
|
@@ -3668,13 +3852,13 @@ let Hi = (j = class {
|
|
|
3668
3852
|
];
|
|
3669
3853
|
}
|
|
3670
3854
|
lineHeightMenu(t) {
|
|
3671
|
-
this.popup(t, (e) => this.menuItems(e, this.blockStyleItems("lineHeight",
|
|
3855
|
+
this.popup(t, (e) => this.menuItems(e, this.blockStyleItems("lineHeight", ee)));
|
|
3672
3856
|
}
|
|
3673
3857
|
wordSpacingMenu(t) {
|
|
3674
|
-
this.popup(t, (e) => this.menuItems(e, this.blockStyleItems("wordSpacing",
|
|
3858
|
+
this.popup(t, (e) => this.menuItems(e, this.blockStyleItems("wordSpacing", ie)));
|
|
3675
3859
|
}
|
|
3676
3860
|
letterSpacingMenu(t) {
|
|
3677
|
-
this.popup(t, (e) => this.menuItems(e, this.blockStyleItems("letterSpacing",
|
|
3861
|
+
this.popup(t, (e) => this.menuItems(e, this.blockStyleItems("letterSpacing", se)));
|
|
3678
3862
|
}
|
|
3679
3863
|
closestAnchor() {
|
|
3680
3864
|
const t = window.getSelection();
|
|
@@ -3727,7 +3911,7 @@ let Hi = (j = class {
|
|
|
3727
3911
|
);
|
|
3728
3912
|
}
|
|
3729
3913
|
blockItems() {
|
|
3730
|
-
return
|
|
3914
|
+
return re.map(([t]) => ({
|
|
3731
3915
|
label: this.blockLabel(t),
|
|
3732
3916
|
previewStyle: t.startsWith("h") ? `font-weight:700;font-size:${22 - 2 * +t[1]}px` : t === "pre" ? "font-family:monospace" : "",
|
|
3733
3917
|
on: this.currentBlock() === t,
|
|
@@ -3767,12 +3951,12 @@ let Hi = (j = class {
|
|
|
3767
3951
|
const l = [];
|
|
3768
3952
|
for (let r = 0; r < 8; r++)
|
|
3769
3953
|
for (let o = 0; o < 10; o++) {
|
|
3770
|
-
const
|
|
3771
|
-
|
|
3954
|
+
const a = document.createElement("span");
|
|
3955
|
+
a.dataset.r = String(r), a.dataset.c = String(o), a.addEventListener("mouseenter", () => {
|
|
3772
3956
|
l.forEach((d) => d.classList.toggle("hot", +d.dataset.r <= r && +d.dataset.c <= o)), n.textContent = o + 1 + " × " + (r + 1);
|
|
3773
|
-
}),
|
|
3957
|
+
}), a.addEventListener("click", () => {
|
|
3774
3958
|
this.closePop(), this.insertTable(r + 1, o + 1), e == null || e();
|
|
3775
|
-
}), l.push(
|
|
3959
|
+
}), l.push(a), s.appendChild(a);
|
|
3776
3960
|
}
|
|
3777
3961
|
i.append(s, n), t.appendChild(i);
|
|
3778
3962
|
}
|
|
@@ -3857,7 +4041,7 @@ let Hi = (j = class {
|
|
|
3857
4041
|
}
|
|
3858
4042
|
buildToolbar() {
|
|
3859
4043
|
this.toolbar.innerHTML = "";
|
|
3860
|
-
const t = this.options.toolbar === !0 ?
|
|
4044
|
+
const t = this.options.toolbar === !0 ? ti : this.options.toolbar, e = this.buildToolbarRegistry();
|
|
3861
4045
|
this.parseToolbarString(t).forEach((i) => {
|
|
3862
4046
|
const s = [];
|
|
3863
4047
|
i.forEach((n) => {
|
|
@@ -3967,9 +4151,9 @@ let Hi = (j = class {
|
|
|
3967
4151
|
{ label: this.t("fontsize"), subBuild: (s) => this.menuItems(s, this.sizeItems()) },
|
|
3968
4152
|
{ label: this.t("blocks"), subBuild: (s) => this.menuItems(s, this.blockItems()) },
|
|
3969
4153
|
{ label: this.t("align"), subBuild: (s) => this.menuItems(s, this.alignItems()) },
|
|
3970
|
-
{ label: this.t("lineheight"), icon: h.lineheight, subBuild: (s) => this.menuItems(s, this.blockStyleItems("lineHeight",
|
|
3971
|
-
{ label: this.t("wordspacing"), icon: h.wordspacing, subBuild: (s) => this.menuItems(s, this.blockStyleItems("wordSpacing",
|
|
3972
|
-
{ label: this.t("letterspacing"), icon: h.letterspacing, subBuild: (s) => this.menuItems(s, this.blockStyleItems("letterSpacing",
|
|
4154
|
+
{ label: this.t("lineheight"), icon: h.lineheight, subBuild: (s) => this.menuItems(s, this.blockStyleItems("lineHeight", ee)) },
|
|
4155
|
+
{ label: this.t("wordspacing"), icon: h.wordspacing, subBuild: (s) => this.menuItems(s, this.blockStyleItems("wordSpacing", ie)) },
|
|
4156
|
+
{ label: this.t("letterspacing"), icon: h.letterspacing, subBuild: (s) => this.menuItems(s, this.blockStyleItems("letterSpacing", se)) },
|
|
3973
4157
|
"|",
|
|
3974
4158
|
{ label: this.t("forecolor"), icon: h.palette, subBuild: (s) => this.buildPaletteInto(s, this.foreColor, (n) => this.applyColor("fore", n)) },
|
|
3975
4159
|
{ label: this.t("backcolor"), icon: h.backcolor, subBuild: (s) => this.buildPaletteInto(s, this.backColor, (n) => this.applyColor("back", n)) },
|
|
@@ -4039,7 +4223,7 @@ let Hi = (j = class {
|
|
|
4039
4223
|
{ label: this.t("deltable"), icon: h.trash, action: () => this.tableOp("deltable") }
|
|
4040
4224
|
],
|
|
4041
4225
|
help: [this.mItem("helpttl", h.helpic, () => this.helpDlg(), "Alt+0")]
|
|
4042
|
-
}, e = this.options.menubar === !0 ?
|
|
4226
|
+
}, e = this.options.menubar === !0 ? ei : this.options.menubar, i = /* @__PURE__ */ new Set();
|
|
4043
4227
|
e.split(/\s+/).filter(Boolean).forEach((s) => {
|
|
4044
4228
|
if (i.has(s)) return;
|
|
4045
4229
|
if (i.add(s), !t[s]) {
|
|
@@ -4054,29 +4238,29 @@ let Hi = (j = class {
|
|
|
4054
4238
|
}
|
|
4055
4239
|
/* ---------------------------------------------------------- table ops */
|
|
4056
4240
|
tableOp(t) {
|
|
4057
|
-
var o,
|
|
4241
|
+
var o, a, d;
|
|
4058
4242
|
this.restoreSel();
|
|
4059
4243
|
const e = window.getSelection();
|
|
4060
4244
|
if (!e) return;
|
|
4061
|
-
const i = ((o = this.closestBlock(e.anchorNode)) == null ? void 0 : o.closest("td,th")) || (e.anchorNode && e.anchorNode.nodeType === 1 ? (d = (
|
|
4245
|
+
const i = ((o = this.closestBlock(e.anchorNode)) == null ? void 0 : o.closest("td,th")) || (e.anchorNode && e.anchorNode.nodeType === 1 ? (d = (a = e.anchorNode).closest) == null ? void 0 : d.call(a, "td,th") : null);
|
|
4062
4246
|
if (!i) return;
|
|
4063
4247
|
const s = i.parentElement, n = i.closest("table"), l = Array.from(s.children).indexOf(i), r = () => {
|
|
4064
|
-
const
|
|
4248
|
+
const p = s.cloneNode(!1);
|
|
4065
4249
|
return Array.from(s.children).forEach((m) => {
|
|
4066
|
-
const
|
|
4067
|
-
|
|
4068
|
-
}),
|
|
4250
|
+
const v = document.createElement("td"), b = m.getAttribute("style");
|
|
4251
|
+
b && v.setAttribute("style", b), v.style.removeProperty("background-color"), v.innerHTML = "<br>", p.appendChild(v);
|
|
4252
|
+
}), p;
|
|
4069
4253
|
};
|
|
4070
4254
|
if (t === "rowabove" && s.before(r()), t === "rowbelow" && s.after(r()), t === "delrow") {
|
|
4071
|
-
const
|
|
4072
|
-
s.remove(),
|
|
4255
|
+
const p = s.parentElement;
|
|
4256
|
+
s.remove(), p.querySelector("tr") || n.remove();
|
|
4073
4257
|
}
|
|
4074
|
-
(t === "colbefore" || t === "colafter") && n.querySelectorAll("tr").forEach((
|
|
4075
|
-
const m =
|
|
4076
|
-
|
|
4077
|
-
}), t === "delcol" && (n.querySelectorAll("tr").forEach((
|
|
4258
|
+
(t === "colbefore" || t === "colafter") && n.querySelectorAll("tr").forEach((p) => {
|
|
4259
|
+
const m = p.children[Math.min(l, p.children.length - 1)], v = document.createElement("td"), b = m.getAttribute("style");
|
|
4260
|
+
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);
|
|
4261
|
+
}), t === "delcol" && (n.querySelectorAll("tr").forEach((p) => {
|
|
4078
4262
|
var m;
|
|
4079
|
-
return (m =
|
|
4263
|
+
return (m = p.children[l]) == null ? void 0 : m.remove();
|
|
4080
4264
|
}), n.querySelector("td,th") || n.remove()), t === "deltable" && n.remove(), this.onChange(), this.positionTableHandles();
|
|
4081
4265
|
}
|
|
4082
4266
|
/** Reorders the current row/column: 'rowup'/'rowdown' swap the caret's row with
|
|
@@ -4096,11 +4280,11 @@ let Hi = (j = class {
|
|
|
4096
4280
|
o && o.after(i);
|
|
4097
4281
|
}
|
|
4098
4282
|
t === "colleft" && n > 0 && s.querySelectorAll("tr").forEach((o) => {
|
|
4099
|
-
const
|
|
4100
|
-
|
|
4283
|
+
const a = o.children[n], d = o.children[n - 1];
|
|
4284
|
+
a && d && d.before(a);
|
|
4101
4285
|
}), t === "colright" && s.querySelectorAll("tr").forEach((o) => {
|
|
4102
|
-
const
|
|
4103
|
-
|
|
4286
|
+
const a = o.children[n], d = o.children[n + 1];
|
|
4287
|
+
a && d && d.after(a);
|
|
4104
4288
|
});
|
|
4105
4289
|
const l = document.createRange();
|
|
4106
4290
|
l.selectNodeContents(e), l.collapse(!0);
|
|
@@ -4143,24 +4327,24 @@ let Hi = (j = class {
|
|
|
4143
4327
|
const t = this.tblActive;
|
|
4144
4328
|
if (!t) return;
|
|
4145
4329
|
let e, i, s, n, l;
|
|
4146
|
-
const r = "display:flex;align-items:center;gap:10px;margin:10px 0", o = "width:120px;color:#556;flex:none",
|
|
4330
|
+
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", d = t.querySelector("td,th"), p = t.style.width || "", m = d && d.style.padding ? parseFloat(d.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" : "";
|
|
4147
4331
|
this.dialog(
|
|
4148
4332
|
this.t("tablepropsttl"),
|
|
4149
4333
|
(E) => {
|
|
4150
|
-
const I = (
|
|
4334
|
+
const I = (A, $) => {
|
|
4151
4335
|
const Z = document.createElement("div");
|
|
4152
4336
|
Z.style.cssText = r;
|
|
4153
4337
|
const F = document.createElement("span");
|
|
4154
|
-
F.style.cssText = o, F.textContent = this.t(
|
|
4338
|
+
F.style.cssText = o, F.textContent = this.t(A), Z.append(F, $), E.appendChild(Z);
|
|
4155
4339
|
};
|
|
4156
|
-
e = document.createElement("input"), e.type = "text", e.style.cssText =
|
|
4340
|
+
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, [
|
|
4157
4341
|
["", "alignnone"],
|
|
4158
4342
|
["left", "alignleft"],
|
|
4159
4343
|
["center", "aligncenter"],
|
|
4160
4344
|
["right", "alignright"]
|
|
4161
|
-
].forEach(([
|
|
4345
|
+
].forEach(([A, $]) => {
|
|
4162
4346
|
const Z = document.createElement("option");
|
|
4163
|
-
Z.value =
|
|
4347
|
+
Z.value = A, Z.textContent = this.t($), A === C && (Z.selected = !0), l.appendChild(Z);
|
|
4164
4348
|
}), I("tblalign", l);
|
|
4165
4349
|
},
|
|
4166
4350
|
[
|
|
@@ -4382,8 +4566,12 @@ let Hi = (j = class {
|
|
|
4382
4566
|
}
|
|
4383
4567
|
previewDlg() {
|
|
4384
4568
|
this.dialog(this.t("previewttl"), (t) => {
|
|
4569
|
+
var s;
|
|
4570
|
+
(s = t.closest(".dlg")) == null || s.classList.add("dlg-preview");
|
|
4385
4571
|
const e = document.createElement("div");
|
|
4386
|
-
e.
|
|
4572
|
+
e.className = "pv-box";
|
|
4573
|
+
const i = this.contentWidth();
|
|
4574
|
+
e.style.cssText = `width:${i > 0 ? Math.round(i) : 640}px;max-width:100%;max-height:52vh;overflow:auto;border:1px solid #e3e3e3;border-radius:6px;padding:14px;font-family:Helvetica,Arial,sans-serif;font-size:14px`, e.innerHTML = this.ed.innerHTML, t.appendChild(e);
|
|
4387
4575
|
});
|
|
4388
4576
|
}
|
|
4389
4577
|
/** Two-pane picker shared by the special-character map and the emoji map:
|
|
@@ -4398,25 +4586,25 @@ let Hi = (j = class {
|
|
|
4398
4586
|
r.className = "chpanel";
|
|
4399
4587
|
const o = document.createElement("div");
|
|
4400
4588
|
o.className = "chgrid" + (i ? " emgrid" : ""), r.appendChild(o);
|
|
4401
|
-
const
|
|
4402
|
-
l.querySelectorAll("button").forEach((
|
|
4589
|
+
const a = (d) => {
|
|
4590
|
+
l.querySelectorAll("button").forEach((p, m) => p.classList.toggle("on", m === d)), o.innerHTML = "", e[d].chars.forEach((p) => {
|
|
4403
4591
|
const m = document.createElement("button");
|
|
4404
|
-
m.type = "button", m.textContent =
|
|
4405
|
-
this.closeDlg(), this.exec("insertText",
|
|
4592
|
+
m.type = "button", m.textContent = p, m.onclick = () => {
|
|
4593
|
+
this.closeDlg(), this.exec("insertText", p);
|
|
4406
4594
|
}, o.appendChild(m);
|
|
4407
4595
|
}), r.scrollTop = 0;
|
|
4408
4596
|
};
|
|
4409
|
-
e.forEach((d,
|
|
4597
|
+
e.forEach((d, p) => {
|
|
4410
4598
|
const m = document.createElement("button");
|
|
4411
|
-
m.type = "button", m.textContent = this.t(d.key), m.addEventListener("click", () =>
|
|
4412
|
-
}), n.append(l, r), s.appendChild(n),
|
|
4599
|
+
m.type = "button", m.textContent = this.t(d.key), m.addEventListener("click", () => a(p)), l.appendChild(m);
|
|
4600
|
+
}), n.append(l, r), s.appendChild(n), a(0);
|
|
4413
4601
|
});
|
|
4414
4602
|
}
|
|
4415
4603
|
charMap() {
|
|
4416
|
-
this.glyphPickerDlg(this.t("charmap").replace("…", ""),
|
|
4604
|
+
this.glyphPickerDlg(this.t("charmap").replace("…", ""), ai, !1);
|
|
4417
4605
|
}
|
|
4418
4606
|
emojiMap() {
|
|
4419
|
-
this.glyphPickerDlg(this.t("emoji").replace("…", ""),
|
|
4607
|
+
this.glyphPickerDlg(this.t("emoji").replace("…", ""), ci, !0);
|
|
4420
4608
|
}
|
|
4421
4609
|
printDoc() {
|
|
4422
4610
|
const t = window.open("", "_blank");
|
|
@@ -4520,7 +4708,58 @@ let Hi = (j = class {
|
|
|
4520
4708
|
}
|
|
4521
4709
|
replacePlaceholderWithImage(t, e, i) {
|
|
4522
4710
|
const s = document.createElement("img");
|
|
4523
|
-
s.src = e, s.alt = "", i && (s.title = i), t.replaceWith(s), this.phActive === t && this.clearImgPlaceholderSel(), this.refreshState(), this.onChange();
|
|
4711
|
+
s.src = e, s.alt = "", i && (s.title = i), t.replaceWith(s), this.stampImageSize(s), this.phActive === t && this.clearImgPlaceholderSel(), this.refreshState(), this.onChange();
|
|
4712
|
+
}
|
|
4713
|
+
/** Width of the editor's text column — the width `.earea img { max-width:100% }`
|
|
4714
|
+
* clamps an oversized image to. */
|
|
4715
|
+
contentWidth() {
|
|
4716
|
+
const t = getComputedStyle(this.ed), e = (parseFloat(t.paddingLeft) || 0) + (parseFloat(t.paddingRight) || 0);
|
|
4717
|
+
return Math.max(0, this.ed.clientWidth - e);
|
|
4718
|
+
}
|
|
4719
|
+
/** Inserts an <img> through execCommand and stamps its size once it has decoded.
|
|
4720
|
+
* A throwaway id is the only way to get a handle on what insertHTML created. */
|
|
4721
|
+
insertImageHTML(t, e) {
|
|
4722
|
+
const i = "fable-img-" + Date.now().toString(36) + Math.random().toString(36).slice(2, 6);
|
|
4723
|
+
document.execCommand(
|
|
4724
|
+
"insertHTML",
|
|
4725
|
+
!1,
|
|
4726
|
+
`<img id="${i}" src="${t}"${e ? ` title="${e}"` : ""} alt="">`
|
|
4727
|
+
);
|
|
4728
|
+
const s = this.ed.querySelector("#" + i);
|
|
4729
|
+
s && (s.removeAttribute("id"), this.stampImageSize(s));
|
|
4730
|
+
}
|
|
4731
|
+
/** Gives a newly inserted image an explicit size so it renders the same in the
|
|
4732
|
+
* editor, in Preview and in a sent email. Without it the image only looks right
|
|
4733
|
+
* inside `.earea`, whose `max-width:100%` rule exists nowhere else — which is why
|
|
4734
|
+
* the same picture came out at a different size once the mail was sent.
|
|
4735
|
+
* Leaves alone: images inside a template media slot (deliberately fluid) and any
|
|
4736
|
+
* image that already carries a size from its source. */
|
|
4737
|
+
stampImageSize(t, e) {
|
|
4738
|
+
const i = (n) => {
|
|
4739
|
+
e ? e(n) : n && this.onChange();
|
|
4740
|
+
}, s = () => {
|
|
4741
|
+
if (!this.ed.contains(t) || t.closest(".tpl-media") || t.getAttribute("width") || t.getAttribute("height") || t.style.width || t.style.height) return i(!1);
|
|
4742
|
+
const n = t.naturalWidth;
|
|
4743
|
+
if (!n) return i(!1);
|
|
4744
|
+
const l = this.contentWidth(), r = Math.round(l > 0 ? Math.min(n, l) : n);
|
|
4745
|
+
t.setAttribute("width", String(r)), t.style.width = r + "px", t.style.height = "auto", i(!0);
|
|
4746
|
+
};
|
|
4747
|
+
t.complete && t.naturalWidth ? s() : (t.addEventListener("load", s, { once: !0 }), t.addEventListener("error", () => i(!1), { once: !0 }));
|
|
4748
|
+
}
|
|
4749
|
+
/** Sizes images in content that arrived from outside the editor — a document saved
|
|
4750
|
+
* before the editor started recording image sizes. Without this such a document
|
|
4751
|
+
* keeps rendering at one size here and another in a sent mail. Images that already
|
|
4752
|
+
* carry a size, and template slots, are left alone, so content written by a
|
|
4753
|
+
* current version passes through untouched. Emits one change after the images have
|
|
4754
|
+
* settled rather than one per image, and none at all if nothing needed stamping. */
|
|
4755
|
+
stampExistingImages() {
|
|
4756
|
+
const t = Array.from(this.ed.querySelectorAll("img"));
|
|
4757
|
+
if (!t.length) return;
|
|
4758
|
+
let e = t.length, i = !1;
|
|
4759
|
+
const s = (n) => {
|
|
4760
|
+
n && (i = !0), --e === 0 && i && this.onChange();
|
|
4761
|
+
};
|
|
4762
|
+
t.forEach((n) => this.stampImageSize(n, s));
|
|
4524
4763
|
}
|
|
4525
4764
|
positionImgPhCtx() {
|
|
4526
4765
|
if (this.phActive && !document.body.contains(this.phActive)) {
|
|
@@ -4660,13 +4899,13 @@ let Hi = (j = class {
|
|
|
4660
4899
|
e.className = "imgctx", e.dir = this.dir();
|
|
4661
4900
|
const i = () => {
|
|
4662
4901
|
var d;
|
|
4663
|
-
const
|
|
4664
|
-
(d = this.vidCtx) == null || d.replaceWith(
|
|
4665
|
-
}, s = (
|
|
4666
|
-
this.setVideoAlign(t,
|
|
4667
|
-
}, n = t.style.float === "left", l = t.style.float === "right", r = !n && !l && t.style.marginLeft === "auto" && t.style.marginRight === "auto", o = (
|
|
4668
|
-
const
|
|
4669
|
-
return
|
|
4902
|
+
const a = this.buildVideoCtxToolbar(t);
|
|
4903
|
+
(d = this.vidCtx) == null || d.replaceWith(a), this.vidCtx = a, this.positionVidCtx();
|
|
4904
|
+
}, s = (a) => {
|
|
4905
|
+
this.setVideoAlign(t, a), i();
|
|
4906
|
+
}, n = t.style.float === "left", l = t.style.float === "right", r = !n && !l && t.style.marginLeft === "auto" && t.style.marginRight === "auto", o = (a, d, p, m) => {
|
|
4907
|
+
const v = this.ctxBtn(a, d, m);
|
|
4908
|
+
return v.classList.toggle("on", p), v;
|
|
4670
4909
|
};
|
|
4671
4910
|
return e.append(
|
|
4672
4911
|
o(h.alignleft, this.t("alignleft"), n, () => s("left")),
|
|
@@ -4676,7 +4915,7 @@ let Hi = (j = class {
|
|
|
4676
4915
|
o(h.trash, this.t("deletevideo"), !1, () => {
|
|
4677
4916
|
t.remove(), this.clearVidHandles(), this.onChange();
|
|
4678
4917
|
})
|
|
4679
|
-
), e.addEventListener("mousedown", (
|
|
4918
|
+
), e.addEventListener("mousedown", (a) => a.preventDefault()), e.addEventListener("mouseenter", () => this.cancelVidHide()), e.addEventListener("mouseleave", () => {
|
|
4680
4919
|
this.cancelVidHide(), this.vidHideTimer = window.setTimeout(() => this.clearVidHandles(), 250);
|
|
4681
4920
|
}), document.body.appendChild(e), e;
|
|
4682
4921
|
}
|
|
@@ -4714,67 +4953,67 @@ let Hi = (j = class {
|
|
|
4714
4953
|
videoDlg() {
|
|
4715
4954
|
this.saveSel();
|
|
4716
4955
|
let t, e, i, s, n, l;
|
|
4717
|
-
const r = (
|
|
4718
|
-
const
|
|
4719
|
-
|
|
4956
|
+
const r = (a, d) => {
|
|
4957
|
+
const p = document.createElement("div");
|
|
4958
|
+
p.className = "dfield";
|
|
4720
4959
|
const m = document.createElement("label");
|
|
4721
|
-
return m.textContent = this.t(
|
|
4960
|
+
return m.textContent = this.t(a), p.append(m, d), p;
|
|
4722
4961
|
}, o = () => {
|
|
4723
|
-
const
|
|
4724
|
-
return
|
|
4962
|
+
const a = document.createElement("input");
|
|
4963
|
+
return a.type = "url", a;
|
|
4725
4964
|
};
|
|
4726
4965
|
this.dialog(
|
|
4727
4966
|
this.t("videodlgttl"),
|
|
4728
|
-
(
|
|
4967
|
+
(a) => {
|
|
4729
4968
|
const d = document.createElement("div");
|
|
4730
4969
|
d.className = "dtabs";
|
|
4731
|
-
const
|
|
4732
|
-
const
|
|
4733
|
-
|
|
4970
|
+
const p = [], m = (f, y) => {
|
|
4971
|
+
const C = document.createElement("button");
|
|
4972
|
+
C.type = "button", C.textContent = this.t(f);
|
|
4734
4973
|
const E = document.createElement("div");
|
|
4735
|
-
E.className = "dtabpanel",
|
|
4736
|
-
const I =
|
|
4737
|
-
|
|
4738
|
-
},
|
|
4739
|
-
d.querySelectorAll("button").forEach((
|
|
4974
|
+
E.className = "dtabpanel", y(E);
|
|
4975
|
+
const I = p.length;
|
|
4976
|
+
p.push(E), C.addEventListener("click", () => v(I)), d.appendChild(C);
|
|
4977
|
+
}, v = (f) => {
|
|
4978
|
+
d.querySelectorAll("button").forEach((y, C) => y.classList.toggle("on", C === f)), p.forEach((y, C) => y.style.display = C === f ? "" : "none");
|
|
4740
4979
|
};
|
|
4741
|
-
m("vidgeneral", (
|
|
4980
|
+
m("vidgeneral", (f) => {
|
|
4742
4981
|
t = o(), t.placeholder = this.t("videourlph");
|
|
4743
|
-
const
|
|
4744
|
-
|
|
4745
|
-
const
|
|
4746
|
-
|
|
4982
|
+
const y = document.createElement("div");
|
|
4983
|
+
y.className = "drow";
|
|
4984
|
+
const C = document.createElement("button");
|
|
4985
|
+
C.type = "button", C.className = "txtbtn", C.textContent = this.t("uploadvideo");
|
|
4747
4986
|
const E = document.createElement("input");
|
|
4748
|
-
E.type = "file", E.accept = this.options.videoFileTypes.join(","), E.style.display = "none",
|
|
4987
|
+
E.type = "file", E.accept = this.options.videoFileTypes.join(","), E.style.display = "none", C.addEventListener("click", () => {
|
|
4749
4988
|
E.value = "", E.click();
|
|
4750
4989
|
}), E.addEventListener("change", () => {
|
|
4751
4990
|
var Z;
|
|
4752
|
-
const
|
|
4753
|
-
if (!
|
|
4754
|
-
|
|
4991
|
+
const A = (Z = E.files) == null ? void 0 : Z[0];
|
|
4992
|
+
if (!A) return;
|
|
4993
|
+
C.disabled = !0, C.textContent = this.t("uploading");
|
|
4755
4994
|
const $ = (F) => {
|
|
4756
|
-
t.value = F,
|
|
4995
|
+
t.value = F, C.disabled = !1, C.textContent = this.t("uploadvideo");
|
|
4757
4996
|
};
|
|
4758
4997
|
if (this.videoUploadHandler)
|
|
4759
|
-
this.videoUploadHandler(
|
|
4998
|
+
this.videoUploadHandler(A).then($).catch((F) => {
|
|
4760
4999
|
var et;
|
|
4761
|
-
|
|
5000
|
+
C.disabled = !1, C.textContent = this.t("uploadfailed"), (et = this.onVideoUploadError) == null || et.call(this, F, A);
|
|
4762
5001
|
});
|
|
4763
5002
|
else {
|
|
4764
5003
|
const F = new FileReader();
|
|
4765
|
-
F.onload = () => $(F.result), F.readAsDataURL(
|
|
5004
|
+
F.onload = () => $(F.result), F.readAsDataURL(A);
|
|
4766
5005
|
}
|
|
4767
|
-
}),
|
|
5006
|
+
}), y.append(t, C, E), t.style.flex = "1", f.appendChild(r("vidsource", y));
|
|
4768
5007
|
const I = document.createElement("div");
|
|
4769
|
-
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)),
|
|
4770
|
-
}), m("vidembed", (
|
|
4771
|
-
const
|
|
4772
|
-
|
|
4773
|
-
}), m("vidadvanced", (
|
|
4774
|
-
n = o(), l = o(),
|
|
5008
|
+
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);
|
|
5009
|
+
}), m("vidembed", (f) => {
|
|
5010
|
+
const y = document.createElement("p");
|
|
5011
|
+
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);
|
|
5012
|
+
}), m("vidadvanced", (f) => {
|
|
5013
|
+
n = o(), l = o(), f.append(r("vidaltsource", n), r("vidposter", l));
|
|
4775
5014
|
});
|
|
4776
|
-
const
|
|
4777
|
-
|
|
5015
|
+
const b = document.createElement("div");
|
|
5016
|
+
b.className = "dtabbody", p.forEach((f) => b.appendChild(f)), a.append(d, b), v(0), setTimeout(() => t.focus(), 0);
|
|
4778
5017
|
},
|
|
4779
5018
|
[
|
|
4780
5019
|
{ label: this.t("cancel"), action: () => this.closeDlg() },
|
|
@@ -4782,21 +5021,21 @@ let Hi = (j = class {
|
|
|
4782
5021
|
label: this.t("save"),
|
|
4783
5022
|
primary: !0,
|
|
4784
5023
|
action: () => {
|
|
4785
|
-
const
|
|
4786
|
-
if (this.closeDlg(), !
|
|
4787
|
-
if (this.restoreSel(),
|
|
4788
|
-
document.execCommand("insertHTML", !1, `<span class="video-embed" contenteditable="false">${
|
|
5024
|
+
const a = s.value.trim(), d = t.value.trim(), p = parseInt(e.value, 10) || 560, m = parseInt(i.value, 10) || 314;
|
|
5025
|
+
if (this.closeDlg(), !a && !d) return;
|
|
5026
|
+
if (this.restoreSel(), a) {
|
|
5027
|
+
document.execCommand("insertHTML", !1, `<span class="video-embed" contenteditable="false">${a}</span>`), this.onChange();
|
|
4789
5028
|
return;
|
|
4790
5029
|
}
|
|
4791
|
-
const
|
|
4792
|
-
if (
|
|
4793
|
-
document.execCommand("insertHTML", !1, this.videoEmbedHTML(
|
|
5030
|
+
const v = this.videoEmbedUrl(d);
|
|
5031
|
+
if (v)
|
|
5032
|
+
document.execCommand("insertHTML", !1, this.videoEmbedHTML(v, p, m));
|
|
4794
5033
|
else {
|
|
4795
|
-
const
|
|
5034
|
+
const b = n.value.trim(), f = l.value.trim();
|
|
4796
5035
|
document.execCommand(
|
|
4797
5036
|
"insertHTML",
|
|
4798
5037
|
!1,
|
|
4799
|
-
`<video controls width="${
|
|
5038
|
+
`<video controls width="${p}" height="${m}"${f ? ` poster="${this.escapeAttr(f)}"` : ""}><source src="${this.escapeAttr(d)}">${b ? `<source src="${this.escapeAttr(b)}">` : ""}</video>`
|
|
4800
5039
|
);
|
|
4801
5040
|
}
|
|
4802
5041
|
this.onChange();
|
|
@@ -4861,8 +5100,8 @@ let Hi = (j = class {
|
|
|
4861
5100
|
r.setStart(i, e.anchorOffset - l.length - 1), r.setEnd(i, e.anchorOffset), r.deleteContents();
|
|
4862
5101
|
const o = document.createElement("code");
|
|
4863
5102
|
o.textContent = l, r.insertNode(o);
|
|
4864
|
-
const
|
|
4865
|
-
|
|
5103
|
+
const a = document.createRange();
|
|
5104
|
+
a.setStartAfter(o), a.collapse(!0), e.removeAllRanges(), e.addRange(a), this.saveSel(), this.onChange();
|
|
4866
5105
|
}
|
|
4867
5106
|
/** Custom dropdown for dialog fields (a native <select> popup can't be styled):
|
|
4868
5107
|
* a field-styled button showing the current choice that opens a floating,
|
|
@@ -4875,20 +5114,20 @@ let Hi = (j = class {
|
|
|
4875
5114
|
const n = document.createElement("button");
|
|
4876
5115
|
n.type = "button", n.className = "dsel-btn";
|
|
4877
5116
|
const l = document.createElement("span");
|
|
4878
|
-
l.className = "lbl", l.textContent = ((o = t.find(([
|
|
5117
|
+
l.className = "lbl", l.textContent = ((o = t.find(([a]) => a === e)) == null ? void 0 : o[1]) || "", n.append(l), n.insertAdjacentHTML("beforeend", h.chev);
|
|
4879
5118
|
const r = document.createElement("div");
|
|
4880
|
-
return r.className = "dsel-list", t.forEach(([
|
|
4881
|
-
const
|
|
4882
|
-
|
|
4883
|
-
i =
|
|
4884
|
-
}), r.appendChild(
|
|
5119
|
+
return r.className = "dsel-list", t.forEach(([a, d]) => {
|
|
5120
|
+
const p = document.createElement("button");
|
|
5121
|
+
p.type = "button", p.textContent = d, p.classList.toggle("on", a === i), p.addEventListener("click", () => {
|
|
5122
|
+
i = a, l.textContent = d, r.querySelectorAll("button").forEach((m) => m.classList.toggle("on", m === p)), s.classList.remove("open"), n.focus();
|
|
5123
|
+
}), r.appendChild(p);
|
|
4885
5124
|
}), n.addEventListener("click", () => {
|
|
4886
|
-
var
|
|
4887
|
-
s.classList.toggle("open"), s.classList.contains("open") && ((
|
|
4888
|
-
}), s.addEventListener("focusout", (
|
|
4889
|
-
s.contains(
|
|
4890
|
-
}), s.addEventListener("keydown", (
|
|
4891
|
-
|
|
5125
|
+
var a;
|
|
5126
|
+
s.classList.toggle("open"), s.classList.contains("open") && ((a = r.querySelector(".on")) == null || a.scrollIntoView({ block: "nearest" }));
|
|
5127
|
+
}), s.addEventListener("focusout", (a) => {
|
|
5128
|
+
s.contains(a.relatedTarget) || s.classList.remove("open");
|
|
5129
|
+
}), s.addEventListener("keydown", (a) => {
|
|
5130
|
+
a.key === "Escape" && s.classList.contains("open") && (a.stopPropagation(), s.classList.remove("open"), n.focus());
|
|
4892
5131
|
}), s.append(n, r), { el: s, value: () => i };
|
|
4893
5132
|
}
|
|
4894
5133
|
/** Insert/edit-code-sample dialog: language dropdown + monospace textarea to
|
|
@@ -4904,7 +5143,7 @@ let Hi = (j = class {
|
|
|
4904
5143
|
const n = document.createElement("div");
|
|
4905
5144
|
n.className = "dfield";
|
|
4906
5145
|
const l = document.createElement("label");
|
|
4907
|
-
l.textContent = this.t("codelang"), e = this.dlgSelect(
|
|
5146
|
+
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);
|
|
4908
5147
|
},
|
|
4909
5148
|
[
|
|
4910
5149
|
{ label: this.t("cancel"), action: () => this.closeDlg() },
|
|
@@ -4913,7 +5152,7 @@ let Hi = (j = class {
|
|
|
4913
5152
|
primary: !0,
|
|
4914
5153
|
action: () => {
|
|
4915
5154
|
var r;
|
|
4916
|
-
const s = i.value.replace(/\s+$/, ""), n = e.value(), l = ((r =
|
|
5155
|
+
const s = i.value.replace(/\s+$/, ""), n = e.value(), l = ((r = ne.find(([o]) => o === n)) == null ? void 0 : r[1]) || n;
|
|
4917
5156
|
if (this.closeDlg(), !!s.trim()) {
|
|
4918
5157
|
if (t) {
|
|
4919
5158
|
t.dataset.lang = n, t.setAttribute("data-lang-label", l);
|
|
@@ -4986,9 +5225,9 @@ let Hi = (j = class {
|
|
|
4986
5225
|
}
|
|
4987
5226
|
buildTemplatePickInto(t, e) {
|
|
4988
5227
|
const i = document.createElement("div");
|
|
4989
|
-
i.className = "tplpick",
|
|
5228
|
+
i.className = "tplpick", Et.forEach((s) => {
|
|
4990
5229
|
const n = document.createElement("button");
|
|
4991
|
-
n.type = "button", n.className = "tpltile", n.title = this.t(
|
|
5230
|
+
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", () => {
|
|
4992
5231
|
this.closePop(), this.insertTemplate(s), e == null || e();
|
|
4993
5232
|
}), i.appendChild(n);
|
|
4994
5233
|
}), t.appendChild(i);
|
|
@@ -5007,15 +5246,15 @@ let Hi = (j = class {
|
|
|
5007
5246
|
}
|
|
5008
5247
|
renderTplCtxButtons() {
|
|
5009
5248
|
const t = this.tplCtx, e = this.tplActive;
|
|
5010
|
-
!t || !e || (t.innerHTML = "",
|
|
5011
|
-
const s = this.ctxBtn(
|
|
5249
|
+
!t || !e || (t.innerHTML = "", Et.forEach((i) => {
|
|
5250
|
+
const s = this.ctxBtn(Ni[i], this.t(St[i]), () => this.setTplLayout(i));
|
|
5012
5251
|
s.classList.toggle("on", e.classList.contains("tpl-" + i)), t.appendChild(s);
|
|
5013
5252
|
}), t.append(this.ctxSep(), this.ctxBtn(h.trash, this.t("deltemplate"), () => this.removeTemplate())), this.positionTplCtx());
|
|
5014
5253
|
}
|
|
5015
5254
|
setTplLayout(t) {
|
|
5016
5255
|
const e = this.tplActive;
|
|
5017
5256
|
if (!e) return;
|
|
5018
|
-
|
|
5257
|
+
Et.forEach((n) => e.classList.remove("tpl-" + n)), e.classList.add("tpl-" + t);
|
|
5019
5258
|
const i = e.querySelector(":scope > .tpl-media"), s = e.querySelector(":scope > .tpl-text");
|
|
5020
5259
|
i && s && (t === "img-center" ? e.appendChild(i) : e.insertBefore(i, s)), this.renderTplCtxButtons(), this.positionImgPhCtx(), this.positionImageHandles(), this.onChange();
|
|
5021
5260
|
}
|
|
@@ -5074,8 +5313,8 @@ let Hi = (j = class {
|
|
|
5074
5313
|
return;
|
|
5075
5314
|
}
|
|
5076
5315
|
this.tblOpMark || (this.tblOpMark = document.createElement("div"), this.tblOpMark.className = "tbl-opmark", document.body.appendChild(this.tblOpMark));
|
|
5077
|
-
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,
|
|
5078
|
-
this.tblOpMark.style.left = l + scrollX + "px", this.tblOpMark.style.top = r + scrollY + "px", this.tblOpMark.style.width = o + "px", this.tblOpMark.style.height =
|
|
5316
|
+
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;
|
|
5317
|
+
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";
|
|
5079
5318
|
}
|
|
5080
5319
|
/** Lowest allowed top for floating context toolbars — keeps them from
|
|
5081
5320
|
covering the editor menubar/toolbar when the target sits on the first line. */
|
|
@@ -5123,18 +5362,18 @@ let Hi = (j = class {
|
|
|
5123
5362
|
}
|
|
5124
5363
|
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;
|
|
5125
5364
|
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) {
|
|
5126
|
-
const o = this.tblCtx.offsetWidth,
|
|
5365
|
+
const o = this.tblCtx.offsetWidth, a = this.tblCtx.offsetHeight;
|
|
5127
5366
|
let d = s + (n - s) / 2 - o / 2;
|
|
5128
5367
|
d = Math.max(8 + scrollX, Math.min(d, scrollX + innerWidth - o - 8));
|
|
5129
|
-
let
|
|
5130
|
-
|
|
5368
|
+
let p = i - a - 8;
|
|
5369
|
+
p < this.ctxMinTop() && (p = l + 8), this.tblCtx.style.left = d + "px", this.tblCtx.style.top = p + "px";
|
|
5131
5370
|
}
|
|
5132
5371
|
this.tblColBars.forEach((o) => o.remove()), this.tblColBars = [];
|
|
5133
5372
|
const r = this.tblActive.rows[0];
|
|
5134
5373
|
if (r)
|
|
5135
5374
|
for (let o = 0; o < r.cells.length - 1; o++) {
|
|
5136
|
-
const
|
|
5137
|
-
|
|
5375
|
+
const a = r.cells[o].getBoundingClientRect(), d = (t ? a.left : a.right) + scrollX, p = document.createElement("div");
|
|
5376
|
+
p.className = "tbl-colbar", p.style.top = i + "px", p.style.left = d + "px", p.style.height = l - i + "px", document.body.appendChild(p), p.addEventListener("mousedown", (m) => this.startColBarDrag(m, o)), this.tblColBars.push(p);
|
|
5138
5377
|
}
|
|
5139
5378
|
this.positionCellMarker(), this.positionOpMark();
|
|
5140
5379
|
}
|
|
@@ -5153,8 +5392,8 @@ let Hi = (j = class {
|
|
|
5153
5392
|
if (!e) return;
|
|
5154
5393
|
const i = this.ed.getAttribute("dir") === "rtl", s = t.clientX, n = e.getBoundingClientRect().width;
|
|
5155
5394
|
e.style.tableLayout = e.style.tableLayout || "fixed", this.withNoTextSelect((l) => {
|
|
5156
|
-
const r = (
|
|
5157
|
-
const d = i ? -(
|
|
5395
|
+
const r = (a) => {
|
|
5396
|
+
const d = i ? -(a.clientX - s) : a.clientX - s;
|
|
5158
5397
|
e.style.width = Math.max(60, Math.round(n + d)) + "px", this.positionTableHandles();
|
|
5159
5398
|
}, o = () => {
|
|
5160
5399
|
window.removeEventListener("mousemove", r), window.removeEventListener("mouseup", o), l(), this.onChange();
|
|
@@ -5166,17 +5405,17 @@ let Hi = (j = class {
|
|
|
5166
5405
|
t.preventDefault(), t.stopPropagation();
|
|
5167
5406
|
const i = this.tblActive;
|
|
5168
5407
|
if (!i) return;
|
|
5169
|
-
const s = this.ed.getAttribute("dir") === "rtl", n = Array.from(i.rows), l = n.map((
|
|
5408
|
+
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);
|
|
5170
5409
|
if (!l.length || !r.length) return;
|
|
5171
|
-
const o = t.clientX,
|
|
5172
|
-
i.style.tableLayout = "fixed", this.withNoTextSelect((
|
|
5173
|
-
const m = (
|
|
5174
|
-
const
|
|
5175
|
-
l.forEach((
|
|
5176
|
-
},
|
|
5177
|
-
window.removeEventListener("mousemove", m), window.removeEventListener("mouseup",
|
|
5410
|
+
const o = t.clientX, a = l[0].getBoundingClientRect().width, d = r[0].getBoundingClientRect().width;
|
|
5411
|
+
i.style.tableLayout = "fixed", this.withNoTextSelect((p) => {
|
|
5412
|
+
const m = (b) => {
|
|
5413
|
+
const f = (s ? -1 : 1) * (b.clientX - o);
|
|
5414
|
+
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(d - f)) + "px"), this.positionTableHandles();
|
|
5415
|
+
}, v = () => {
|
|
5416
|
+
window.removeEventListener("mousemove", m), window.removeEventListener("mouseup", v), p(), this.onChange();
|
|
5178
5417
|
};
|
|
5179
|
-
window.addEventListener("mousemove", m), window.addEventListener("mouseup",
|
|
5418
|
+
window.addEventListener("mousemove", m), window.addEventListener("mouseup", v);
|
|
5180
5419
|
});
|
|
5181
5420
|
}
|
|
5182
5421
|
/* ---------------------------------------------------------- image toolbar / resize */
|
|
@@ -5191,7 +5430,7 @@ let Hi = (j = class {
|
|
|
5191
5430
|
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;
|
|
5192
5431
|
}
|
|
5193
5432
|
selectImage(t) {
|
|
5194
|
-
this.imgActive !== t && (this.clearImageHandles(), this.imgActive = t, t.classList.add("img-selected"), this.imgHandles =
|
|
5433
|
+
this.imgActive !== t && (this.clearImageHandles(), this.imgActive = t, t.classList.add("img-selected"), this.imgHandles = Di.map((e) => {
|
|
5195
5434
|
const i = document.createElement("div");
|
|
5196
5435
|
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;
|
|
5197
5436
|
}), this.imgCtx = this.buildImageCtxToolbar(t), this.positionImageHandles());
|
|
@@ -5201,13 +5440,13 @@ let Hi = (j = class {
|
|
|
5201
5440
|
e.className = "imgctx", e.dir = this.dir();
|
|
5202
5441
|
const i = () => {
|
|
5203
5442
|
var d;
|
|
5204
|
-
const
|
|
5205
|
-
(d = this.imgCtx) == null || d.replaceWith(
|
|
5206
|
-
}, s = (
|
|
5207
|
-
this.setImageAlign(t,
|
|
5208
|
-
}, n = t.style.float === "left", l = t.style.float === "right", r = !n && !l && t.style.marginLeft === "auto" && t.style.marginRight === "auto", o = (
|
|
5209
|
-
const
|
|
5210
|
-
return
|
|
5443
|
+
const a = this.buildImageCtxToolbar(t);
|
|
5444
|
+
(d = this.imgCtx) == null || d.replaceWith(a), this.imgCtx = a, this.positionImageHandles();
|
|
5445
|
+
}, s = (a) => {
|
|
5446
|
+
this.setImageAlign(t, a), i();
|
|
5447
|
+
}, n = t.style.float === "left", l = t.style.float === "right", r = !n && !l && t.style.marginLeft === "auto" && t.style.marginRight === "auto", o = (a, d, p, m) => {
|
|
5448
|
+
const v = this.ctxBtn(a, d, m);
|
|
5449
|
+
return v.classList.toggle("on", p), v;
|
|
5211
5450
|
};
|
|
5212
5451
|
return e.append(
|
|
5213
5452
|
o(h.alignleft, this.t("alignleft"), n, () => s("left")),
|
|
@@ -5229,10 +5468,10 @@ let Hi = (j = class {
|
|
|
5229
5468
|
}),
|
|
5230
5469
|
this.ctxSep(),
|
|
5231
5470
|
o(h.trash, this.t("deleteimg"), !1, () => {
|
|
5232
|
-
const
|
|
5233
|
-
|
|
5471
|
+
const a = t.closest(".tpl-media");
|
|
5472
|
+
a && this.ed.contains(a) ? t.outerHTML = this.imgPhHTML() : t.remove(), this.clearImageHandles(), this.onChange();
|
|
5234
5473
|
})
|
|
5235
|
-
), e.addEventListener("mousedown", (
|
|
5474
|
+
), e.addEventListener("mousedown", (a) => a.preventDefault()), e.addEventListener("mouseenter", () => this.cancelImgHide()), e.addEventListener("mouseleave", () => this.scheduleImgHide()), document.body.appendChild(e), e;
|
|
5236
5475
|
}
|
|
5237
5476
|
setImageAlign(t, e) {
|
|
5238
5477
|
t.style.float = "", t.style.display = "", t.style.marginLeft = "", t.style.marginRight = "", t.style.marginBottom = "", e === "left" ? (t.style.float = "left", t.style.marginInlineEnd = "1em", t.style.marginBottom = "0.5em") : e === "right" ? (t.style.float = "right", t.style.marginInlineStart = "1em", t.style.marginBottom = "0.5em") : (t.style.display = "block", t.style.marginLeft = "auto", t.style.marginRight = "auto"), this.onChange();
|
|
@@ -5261,14 +5500,14 @@ let Hi = (j = class {
|
|
|
5261
5500
|
se: [s, n]
|
|
5262
5501
|
};
|
|
5263
5502
|
if (this.imgHandles.forEach((r) => {
|
|
5264
|
-
const [o,
|
|
5265
|
-
r.style.left = o - 5 + "px", r.style.top =
|
|
5503
|
+
const [o, a] = l[r.dataset.corner];
|
|
5504
|
+
r.style.left = o - 5 + "px", r.style.top = a - 5 + "px";
|
|
5266
5505
|
}), this.imgCtx) {
|
|
5267
5506
|
const r = this.imgCtx.offsetWidth, o = this.imgCtx.offsetHeight;
|
|
5268
|
-
let
|
|
5269
|
-
|
|
5507
|
+
let a = i + (s - i) / 2 - r / 2;
|
|
5508
|
+
a = Math.max(8 + scrollX, Math.min(a, scrollX + innerWidth - r - 8));
|
|
5270
5509
|
let d = e - o - 8;
|
|
5271
|
-
d < this.ctxMinTop() && (d = n + 8), this.imgCtx.style.left =
|
|
5510
|
+
d < this.ctxMinTop() && (d = n + 8), this.imgCtx.style.left = a + "px", this.imgCtx.style.top = d + "px";
|
|
5272
5511
|
}
|
|
5273
5512
|
}
|
|
5274
5513
|
startImageResizeDrag(t, e) {
|
|
@@ -5280,10 +5519,12 @@ let Hi = (j = class {
|
|
|
5280
5519
|
this.withNoTextSelect((r) => {
|
|
5281
5520
|
const o = (d) => {
|
|
5282
5521
|
i.style.width = Math.max(24, Math.round(n + l * (d.clientX - s))) + "px", i.style.height = "auto", this.positionImageHandles();
|
|
5283
|
-
},
|
|
5284
|
-
window.removeEventListener("mousemove", o), window.removeEventListener("mouseup",
|
|
5522
|
+
}, a = () => {
|
|
5523
|
+
window.removeEventListener("mousemove", o), window.removeEventListener("mouseup", a), r();
|
|
5524
|
+
const d = parseInt(i.style.width, 10);
|
|
5525
|
+
d > 0 && !i.closest(".tpl-media") && (i.setAttribute("width", String(d)), i.removeAttribute("height")), this.onChange();
|
|
5285
5526
|
};
|
|
5286
|
-
window.addEventListener("mousemove", o), window.addEventListener("mouseup",
|
|
5527
|
+
window.addEventListener("mousemove", o), window.addEventListener("mouseup", a);
|
|
5287
5528
|
});
|
|
5288
5529
|
}
|
|
5289
5530
|
/* ---------------------------------------------------------- selection bubble toolbar */
|
|
@@ -5352,10 +5593,10 @@ let Hi = (j = class {
|
|
|
5352
5593
|
positionSelToolbar(t) {
|
|
5353
5594
|
if (!this.selCtx) return;
|
|
5354
5595
|
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;
|
|
5355
|
-
let
|
|
5356
|
-
|
|
5596
|
+
let a = s + (n - s) / 2 - r / 2;
|
|
5597
|
+
a = Math.max(8 + scrollX, Math.min(a, scrollX + innerWidth - r - 8));
|
|
5357
5598
|
let d = i - o - 8;
|
|
5358
|
-
d < this.ctxMinTop() && (d = l + 8), this.selCtx.style.left =
|
|
5599
|
+
d < this.ctxMinTop() && (d = l + 8), this.selCtx.style.left = a + "px", this.selCtx.style.top = d + "px";
|
|
5359
5600
|
}
|
|
5360
5601
|
repositionSelToolbar() {
|
|
5361
5602
|
if (!this.selCtx) return;
|
|
@@ -5388,9 +5629,9 @@ let Hi = (j = class {
|
|
|
5388
5629
|
return t > 0 ? t + "px" : "";
|
|
5389
5630
|
}
|
|
5390
5631
|
refreshState() {
|
|
5391
|
-
var o,
|
|
5632
|
+
var o, a, d;
|
|
5392
5633
|
const t = window.getSelection(), e = t ? this.ed.contains(t.anchorNode) : !1, i = this.currentBlock();
|
|
5393
|
-
[this.toolbar, this.selCtx].filter(Boolean).forEach((
|
|
5634
|
+
[this.toolbar, this.selCtx].filter(Boolean).forEach((p) => {
|
|
5394
5635
|
[
|
|
5395
5636
|
"bold",
|
|
5396
5637
|
"italic",
|
|
@@ -5402,23 +5643,23 @@ let Hi = (j = class {
|
|
|
5402
5643
|
"justifyFull",
|
|
5403
5644
|
"insertOrderedList",
|
|
5404
5645
|
"insertUnorderedList"
|
|
5405
|
-
].forEach((
|
|
5406
|
-
const
|
|
5407
|
-
|
|
5408
|
-
}), ["h2", "h3", "blockquote"].forEach((
|
|
5409
|
-
const
|
|
5410
|
-
|
|
5646
|
+
].forEach((v) => {
|
|
5647
|
+
const b = p.querySelector(`[data-id=${v}]`);
|
|
5648
|
+
b && b.classList.toggle("on", e && document.queryCommandState(v));
|
|
5649
|
+
}), ["h2", "h3", "blockquote"].forEach((v) => {
|
|
5650
|
+
const b = p.querySelector(`[data-id=${v}]`);
|
|
5651
|
+
b && b.classList.toggle("on", e && i === v);
|
|
5411
5652
|
});
|
|
5412
|
-
const m =
|
|
5653
|
+
const m = p.querySelector("[data-id=code]");
|
|
5413
5654
|
m && m.classList.toggle("on", e && !!this.closestInlineCode());
|
|
5414
5655
|
});
|
|
5415
5656
|
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();
|
|
5416
|
-
(
|
|
5417
|
-
const r = (
|
|
5418
|
-
const
|
|
5419
|
-
|
|
5657
|
+
(a = this.toolbar.querySelector("[data-id=ltr]")) == null || a.classList.toggle("on", e && l === "ltr"), (d = this.toolbar.querySelector("[data-id=rtl]")) == null || d.classList.toggle("on", e && l === "rtl");
|
|
5658
|
+
const r = (p, m, v) => {
|
|
5659
|
+
const b = this.toolbar.querySelector(`[data-id=${p}] .lbl`);
|
|
5660
|
+
b && (b.textContent = m || v || "", b.classList.toggle("empty", !m));
|
|
5420
5661
|
};
|
|
5421
|
-
r("fontsel", this.currentFont()), r("sizesel", this.currentSize().replace("px", "")), e && r("blocksel",
|
|
5662
|
+
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");
|
|
5422
5663
|
}
|
|
5423
5664
|
countWords() {
|
|
5424
5665
|
const t = (this.ed.textContent || "").trim();
|
|
@@ -5433,7 +5674,7 @@ let Hi = (j = class {
|
|
|
5433
5674
|
if (s && !i) {
|
|
5434
5675
|
const n = new FileReader();
|
|
5435
5676
|
n.onload = () => {
|
|
5436
|
-
|
|
5677
|
+
this.insertImageHTML(n.result), this.onChange();
|
|
5437
5678
|
}, n.readAsDataURL(s.getAsFile());
|
|
5438
5679
|
return;
|
|
5439
5680
|
}
|
|
@@ -5444,107 +5685,164 @@ let Hi = (j = class {
|
|
|
5444
5685
|
return;
|
|
5445
5686
|
}
|
|
5446
5687
|
}
|
|
5447
|
-
i ?
|
|
5688
|
+
i ? this.pasteRichHTML(i, e, s) : (document.execCommand("insertHTML", !1, Ci(e.getData("text/plain"))), this.onChange());
|
|
5689
|
+
}
|
|
5690
|
+
/** Rich-HTML paste. Before the (untouched) paste engine runs, pictures Word left
|
|
5691
|
+
* behind as unreadable file:// refs are pulled out of the clipboard's RTF flavor
|
|
5692
|
+
* and inlined — the same pairing TinyMCE PowerPaste does for
|
|
5693
|
+
* powerpaste_allow_local_images. Everything the engine already handled is
|
|
5694
|
+
* unaffected: with no RTF, or no recoverable picture, the HTML reaches it
|
|
5695
|
+
* byte-identical to before. */
|
|
5696
|
+
pasteRichHTML(t, e, i) {
|
|
5697
|
+
let s = [];
|
|
5698
|
+
const n = e.getData("text/rtf");
|
|
5699
|
+
if (n) {
|
|
5700
|
+
const l = ki(t, n);
|
|
5701
|
+
t = l.html, s = l.injected;
|
|
5702
|
+
}
|
|
5703
|
+
if (i && Ai(t) === 1) {
|
|
5704
|
+
const l = i.getAsFile();
|
|
5705
|
+
if (l) {
|
|
5706
|
+
const r = t;
|
|
5707
|
+
this.saveSel();
|
|
5708
|
+
const o = new FileReader();
|
|
5709
|
+
o.onload = () => {
|
|
5710
|
+
const a = ge(r, [o.result]);
|
|
5711
|
+
this.finishRichPaste(a.html, s.concat(a.injected), !0);
|
|
5712
|
+
}, o.onerror = () => this.finishRichPaste(r, s, !0), o.readAsDataURL(l);
|
|
5713
|
+
return;
|
|
5714
|
+
}
|
|
5715
|
+
}
|
|
5716
|
+
this.finishRichPaste(t, s);
|
|
5717
|
+
}
|
|
5718
|
+
/** Hands recovered pictures to the host's imageUploadHandler when one is
|
|
5719
|
+
* configured (PowerPaste's automatic_uploads equivalent), then inserts. Without a
|
|
5720
|
+
* handler they stay inline base64, which is what PowerPaste does by default. */
|
|
5721
|
+
finishRichPaste(t, e, i = !1) {
|
|
5722
|
+
if (!this.imageUploadHandler || !e.length) {
|
|
5723
|
+
this.insertPastedHTML(t, i);
|
|
5724
|
+
return;
|
|
5725
|
+
}
|
|
5726
|
+
const s = this.imageUploadHandler, n = e.filter((l, r) => e.indexOf(l) === r);
|
|
5727
|
+
i || this.saveSel(), Promise.all(
|
|
5728
|
+
n.map((l, r) => {
|
|
5729
|
+
const o = Hi(l, "pasted-image-" + (r + 1));
|
|
5730
|
+
return o ? s(o).catch((a) => {
|
|
5731
|
+
var d;
|
|
5732
|
+
return (d = this.onImageUploadError) == null || d.call(this, a, o), l;
|
|
5733
|
+
}) : Promise.resolve(l);
|
|
5734
|
+
})
|
|
5735
|
+
).then((l) => {
|
|
5736
|
+
let r = t;
|
|
5737
|
+
n.forEach((o, a) => {
|
|
5738
|
+
l[a] !== o && (r = r.split(o).join(l[a]));
|
|
5739
|
+
}), this.insertPastedHTML(r, !0);
|
|
5740
|
+
});
|
|
5741
|
+
}
|
|
5742
|
+
/** `deferred` means the insert is happening after an async hop, so the caret the
|
|
5743
|
+
* paste started from has to be put back first. */
|
|
5744
|
+
insertPastedHTML(t, e = !1) {
|
|
5745
|
+
e && this.restoreSel(), document.execCommand("insertHTML", !1, xi(t, this.dir())), e && this.saveSel(), this.onChange();
|
|
5448
5746
|
}
|
|
5449
5747
|
/* ---------------------------------------------------------- init */
|
|
5450
5748
|
initUI() {
|
|
5451
5749
|
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();
|
|
5452
5750
|
}
|
|
5453
5751
|
}, j.instanceCounter = 0, j.TBR_COLLAPSE_MAX = 992, j);
|
|
5454
|
-
const
|
|
5455
|
-
({ value:
|
|
5456
|
-
const o = z(null),
|
|
5457
|
-
return
|
|
5752
|
+
const ss = Xe(
|
|
5753
|
+
({ value: u, defaultValue: t, onChange: e, onReady: i, className: s, style: n, ...l }, r) => {
|
|
5754
|
+
const o = z(null), a = z(null), d = z(!1), p = z(u ?? t), m = z(null), v = z(e), b = z(i);
|
|
5755
|
+
return v.current = e, b.current = i, Ye(r, () => ({
|
|
5458
5756
|
getContent: () => {
|
|
5459
|
-
var
|
|
5460
|
-
return ((
|
|
5757
|
+
var f;
|
|
5758
|
+
return ((f = a.current) == null ? void 0 : f.getContent()) ?? "";
|
|
5461
5759
|
},
|
|
5462
5760
|
getContentForEmail: () => {
|
|
5463
|
-
var
|
|
5464
|
-
return ((
|
|
5761
|
+
var f;
|
|
5762
|
+
return ((f = a.current) == null ? void 0 : f.getContentForEmail()) ?? "";
|
|
5465
5763
|
},
|
|
5466
|
-
setContent: (
|
|
5467
|
-
var
|
|
5468
|
-
return (
|
|
5764
|
+
setContent: (f) => {
|
|
5765
|
+
var y;
|
|
5766
|
+
return (y = a.current) == null ? void 0 : y.setContent(f);
|
|
5469
5767
|
},
|
|
5470
|
-
insertContent: (
|
|
5471
|
-
var
|
|
5472
|
-
return (
|
|
5768
|
+
insertContent: (f) => {
|
|
5769
|
+
var y;
|
|
5770
|
+
return (y = a.current) == null ? void 0 : y.insertContent(f);
|
|
5473
5771
|
},
|
|
5474
|
-
setLanguage: (
|
|
5475
|
-
var
|
|
5476
|
-
return (
|
|
5772
|
+
setLanguage: (f) => {
|
|
5773
|
+
var y;
|
|
5774
|
+
return (y = a.current) == null ? void 0 : y.setLanguage(f);
|
|
5477
5775
|
},
|
|
5478
5776
|
focus: () => {
|
|
5479
|
-
var
|
|
5480
|
-
return (
|
|
5777
|
+
var f;
|
|
5778
|
+
return (f = a.current) == null ? void 0 : f.focus();
|
|
5481
5779
|
},
|
|
5482
5780
|
destroy: () => {
|
|
5483
|
-
var
|
|
5484
|
-
return (
|
|
5781
|
+
var f;
|
|
5782
|
+
return (f = a.current) == null ? void 0 : f.destroy();
|
|
5485
5783
|
},
|
|
5486
|
-
importWordFile: (
|
|
5487
|
-
var
|
|
5488
|
-
return ((
|
|
5784
|
+
importWordFile: (f) => {
|
|
5785
|
+
var y;
|
|
5786
|
+
return ((y = a.current) == null ? void 0 : y.importWordFile(f)) ?? Promise.resolve();
|
|
5489
5787
|
},
|
|
5490
5788
|
restoreDraft: () => {
|
|
5491
|
-
var
|
|
5492
|
-
return ((
|
|
5789
|
+
var f;
|
|
5790
|
+
return ((f = a.current) == null ? void 0 : f.restoreDraft()) ?? !1;
|
|
5493
5791
|
},
|
|
5494
5792
|
getRevisions: () => {
|
|
5495
|
-
var
|
|
5496
|
-
return ((
|
|
5793
|
+
var f;
|
|
5794
|
+
return ((f = a.current) == null ? void 0 : f.getRevisions()) ?? [];
|
|
5497
5795
|
}
|
|
5498
|
-
})),
|
|
5796
|
+
})), lt(() => {
|
|
5499
5797
|
if (!o.current) return;
|
|
5500
|
-
const
|
|
5798
|
+
const f = new is({
|
|
5501
5799
|
target: o.current,
|
|
5502
|
-
initialContent:
|
|
5503
|
-
onChange: (
|
|
5504
|
-
var
|
|
5505
|
-
d.current = !0,
|
|
5800
|
+
initialContent: p.current,
|
|
5801
|
+
onChange: (y) => {
|
|
5802
|
+
var C;
|
|
5803
|
+
d.current = !0, p.current = y, (C = v.current) == null || C.call(v, y);
|
|
5506
5804
|
},
|
|
5507
|
-
onReady: (
|
|
5508
|
-
var
|
|
5509
|
-
return (
|
|
5805
|
+
onReady: (y) => {
|
|
5806
|
+
var C;
|
|
5807
|
+
return (C = b.current) == null ? void 0 : C.call(b, y);
|
|
5510
5808
|
},
|
|
5511
5809
|
...l
|
|
5512
5810
|
});
|
|
5513
|
-
return
|
|
5514
|
-
|
|
5811
|
+
return a.current = f, () => {
|
|
5812
|
+
f.destroy(), a.current = null;
|
|
5515
5813
|
};
|
|
5516
|
-
}, []),
|
|
5517
|
-
var
|
|
5518
|
-
if (
|
|
5814
|
+
}, []), lt(() => {
|
|
5815
|
+
var f, y;
|
|
5816
|
+
if (u !== void 0 && u !== p.current) {
|
|
5519
5817
|
if (d.current) {
|
|
5520
5818
|
d.current = !1;
|
|
5521
5819
|
return;
|
|
5522
5820
|
}
|
|
5523
|
-
if ((
|
|
5524
|
-
m.current =
|
|
5821
|
+
if ((f = o.current) != null && f.contains(document.activeElement)) {
|
|
5822
|
+
m.current = u;
|
|
5525
5823
|
return;
|
|
5526
5824
|
}
|
|
5527
|
-
|
|
5825
|
+
p.current = u, (y = a.current) == null || y.setContent(u);
|
|
5528
5826
|
}
|
|
5529
|
-
}, [
|
|
5530
|
-
const
|
|
5531
|
-
if (!
|
|
5532
|
-
const
|
|
5533
|
-
var
|
|
5827
|
+
}, [u]), lt(() => {
|
|
5828
|
+
const f = o.current;
|
|
5829
|
+
if (!f) return;
|
|
5830
|
+
const y = (C) => {
|
|
5831
|
+
var A;
|
|
5534
5832
|
if (m.current === null) return;
|
|
5535
|
-
const E =
|
|
5536
|
-
if (E &&
|
|
5833
|
+
const E = C.relatedTarget;
|
|
5834
|
+
if (E && f.contains(E)) return;
|
|
5537
5835
|
const I = m.current;
|
|
5538
|
-
m.current = null,
|
|
5836
|
+
m.current = null, p.current = I, (A = a.current) == null || A.setContent(I);
|
|
5539
5837
|
};
|
|
5540
|
-
return
|
|
5541
|
-
}, []),
|
|
5542
|
-
var
|
|
5543
|
-
l.language && ((
|
|
5544
|
-
}, [l.language]), /* @__PURE__ */
|
|
5838
|
+
return f.addEventListener("focusout", y), () => f.removeEventListener("focusout", y);
|
|
5839
|
+
}, []), lt(() => {
|
|
5840
|
+
var f;
|
|
5841
|
+
l.language && ((f = a.current) == null || f.setLanguage(l.language));
|
|
5842
|
+
}, [l.language]), /* @__PURE__ */ Qe.jsx("div", { ref: o, className: s, style: n });
|
|
5545
5843
|
}
|
|
5546
5844
|
);
|
|
5547
|
-
|
|
5845
|
+
ss.displayName = "FableEditor";
|
|
5548
5846
|
export {
|
|
5549
|
-
|
|
5847
|
+
ss as FableEditor
|
|
5550
5848
|
};
|