@ryzeup/richtexteditor 1.0.4 → 1.0.5
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/index.es.js +831 -1193
- package/dist/index.js +1 -22
- package/dist/index.umd.js +1 -22
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,447 +1,170 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
1
|
+
var qe = Object.defineProperty, We = Object.defineProperties;
|
|
2
|
+
var Ke = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var fe = Object.getOwnPropertySymbols;
|
|
4
|
+
var Xe = Object.prototype.hasOwnProperty, Ye = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var ve = (t, c, i) => c in t ? qe(t, c, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[c] = i, Q = (t, c) => {
|
|
6
|
+
for (var i in c || (c = {}))
|
|
7
|
+
Xe.call(c, i) && ve(t, i, c[i]);
|
|
8
|
+
if (fe)
|
|
9
|
+
for (var i of fe(c))
|
|
10
|
+
Ye.call(c, i) && ve(t, i, c[i]);
|
|
11
11
|
return t;
|
|
12
|
-
},
|
|
13
|
-
import
|
|
14
|
-
var
|
|
15
|
-
/**
|
|
16
|
-
* @license React
|
|
17
|
-
* react-jsx-runtime.production.js
|
|
18
|
-
*
|
|
19
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
20
|
-
*
|
|
21
|
-
* This source code is licensed under the MIT license found in the
|
|
22
|
-
* LICENSE file in the root directory of this source tree.
|
|
23
|
-
*/
|
|
24
|
-
var Oe;
|
|
25
|
-
function rt() {
|
|
26
|
-
if (Oe) return re;
|
|
27
|
-
Oe = 1;
|
|
28
|
-
var t = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
|
|
29
|
-
function c(d, f, w) {
|
|
30
|
-
var k = null;
|
|
31
|
-
if (w !== void 0 && (k = "" + w), f.key !== void 0 && (k = "" + f.key), "key" in f) {
|
|
32
|
-
w = {};
|
|
33
|
-
for (var R in f)
|
|
34
|
-
R !== "key" && (w[R] = f[R]);
|
|
35
|
-
} else w = f;
|
|
36
|
-
return f = w.ref, {
|
|
37
|
-
$$typeof: t,
|
|
38
|
-
type: d,
|
|
39
|
-
key: k,
|
|
40
|
-
ref: f !== void 0 ? f : null,
|
|
41
|
-
props: w
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
return re.Fragment = s, re.jsx = c, re.jsxs = c, re;
|
|
45
|
-
}
|
|
46
|
-
var oe = {};
|
|
47
|
-
/**
|
|
48
|
-
* @license React
|
|
49
|
-
* react-jsx-runtime.development.js
|
|
50
|
-
*
|
|
51
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
52
|
-
*
|
|
53
|
-
* This source code is licensed under the MIT license found in the
|
|
54
|
-
* LICENSE file in the root directory of this source tree.
|
|
55
|
-
*/
|
|
56
|
-
var Pe;
|
|
57
|
-
function ot() {
|
|
58
|
-
return Pe || (Pe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
59
|
-
function t(n) {
|
|
60
|
-
if (n == null) return null;
|
|
61
|
-
if (typeof n == "function")
|
|
62
|
-
return n.$$typeof === se ? null : n.displayName || n.name || null;
|
|
63
|
-
if (typeof n == "string") return n;
|
|
64
|
-
switch (n) {
|
|
65
|
-
case A:
|
|
66
|
-
return "Fragment";
|
|
67
|
-
case H:
|
|
68
|
-
return "Profiler";
|
|
69
|
-
case q:
|
|
70
|
-
return "StrictMode";
|
|
71
|
-
case C:
|
|
72
|
-
return "Suspense";
|
|
73
|
-
case J:
|
|
74
|
-
return "SuspenseList";
|
|
75
|
-
case ge:
|
|
76
|
-
return "Activity";
|
|
77
|
-
}
|
|
78
|
-
if (typeof n == "object")
|
|
79
|
-
switch (typeof n.tag == "number" && console.error(
|
|
80
|
-
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
81
|
-
), n.$$typeof) {
|
|
82
|
-
case B:
|
|
83
|
-
return "Portal";
|
|
84
|
-
case Z:
|
|
85
|
-
return n.displayName || "Context";
|
|
86
|
-
case V:
|
|
87
|
-
return (n._context.displayName || "Context") + ".Consumer";
|
|
88
|
-
case h:
|
|
89
|
-
var v = n.render;
|
|
90
|
-
return n = n.displayName, n || (n = v.displayName || v.name || "", n = n !== "" ? "ForwardRef(" + n + ")" : "ForwardRef"), n;
|
|
91
|
-
case le:
|
|
92
|
-
return v = n.displayName || null, v !== null ? v : t(n.type) || "Memo";
|
|
93
|
-
case G:
|
|
94
|
-
v = n._payload, n = n._init;
|
|
95
|
-
try {
|
|
96
|
-
return t(n(v));
|
|
97
|
-
} catch (_) {
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
|
-
function s(n) {
|
|
103
|
-
return "" + n;
|
|
104
|
-
}
|
|
105
|
-
function c(n) {
|
|
106
|
-
try {
|
|
107
|
-
s(n);
|
|
108
|
-
var v = !1;
|
|
109
|
-
} catch (K) {
|
|
110
|
-
v = !0;
|
|
111
|
-
}
|
|
112
|
-
if (v) {
|
|
113
|
-
v = console;
|
|
114
|
-
var _ = v.error, S = typeof Symbol == "function" && Symbol.toStringTag && n[Symbol.toStringTag] || n.constructor.name || "Object";
|
|
115
|
-
return _.call(
|
|
116
|
-
v,
|
|
117
|
-
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
118
|
-
S
|
|
119
|
-
), s(n);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
function d(n) {
|
|
123
|
-
if (n === A) return "<>";
|
|
124
|
-
if (typeof n == "object" && n !== null && n.$$typeof === G)
|
|
125
|
-
return "<...>";
|
|
126
|
-
try {
|
|
127
|
-
var v = t(n);
|
|
128
|
-
return v ? "<" + v + ">" : "<...>";
|
|
129
|
-
} catch (_) {
|
|
130
|
-
return "<...>";
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
function f() {
|
|
134
|
-
var n = N.A;
|
|
135
|
-
return n === null ? null : n.getOwner();
|
|
136
|
-
}
|
|
137
|
-
function w() {
|
|
138
|
-
return Error("react-stack-top-frame");
|
|
139
|
-
}
|
|
140
|
-
function k(n) {
|
|
141
|
-
if (M.call(n, "key")) {
|
|
142
|
-
var v = Object.getOwnPropertyDescriptor(n, "key").get;
|
|
143
|
-
if (v && v.isReactWarning) return !1;
|
|
144
|
-
}
|
|
145
|
-
return n.key !== void 0;
|
|
146
|
-
}
|
|
147
|
-
function R(n, v) {
|
|
148
|
-
function _() {
|
|
149
|
-
ce || (ce = !0, console.error(
|
|
150
|
-
"%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://react.dev/link/special-props)",
|
|
151
|
-
v
|
|
152
|
-
));
|
|
153
|
-
}
|
|
154
|
-
_.isReactWarning = !0, Object.defineProperty(n, "key", {
|
|
155
|
-
get: _,
|
|
156
|
-
configurable: !0
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
function b() {
|
|
160
|
-
var n = t(this.type);
|
|
161
|
-
return Q[n] || (Q[n] = !0, console.error(
|
|
162
|
-
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
163
|
-
)), n = this.props.ref, n !== void 0 ? n : null;
|
|
164
|
-
}
|
|
165
|
-
function I(n, v, _, S, K, te) {
|
|
166
|
-
var L = _.ref;
|
|
167
|
-
return n = {
|
|
168
|
-
$$typeof: X,
|
|
169
|
-
type: n,
|
|
170
|
-
key: v,
|
|
171
|
-
props: _,
|
|
172
|
-
_owner: S
|
|
173
|
-
}, (L !== void 0 ? L : null) !== null ? Object.defineProperty(n, "ref", {
|
|
174
|
-
enumerable: !1,
|
|
175
|
-
get: b
|
|
176
|
-
}) : Object.defineProperty(n, "ref", { enumerable: !1, value: null }), n._store = {}, Object.defineProperty(n._store, "validated", {
|
|
177
|
-
configurable: !1,
|
|
178
|
-
enumerable: !1,
|
|
179
|
-
writable: !0,
|
|
180
|
-
value: 0
|
|
181
|
-
}), Object.defineProperty(n, "_debugInfo", {
|
|
182
|
-
configurable: !1,
|
|
183
|
-
enumerable: !1,
|
|
184
|
-
writable: !0,
|
|
185
|
-
value: null
|
|
186
|
-
}), Object.defineProperty(n, "_debugStack", {
|
|
187
|
-
configurable: !1,
|
|
188
|
-
enumerable: !1,
|
|
189
|
-
writable: !0,
|
|
190
|
-
value: K
|
|
191
|
-
}), Object.defineProperty(n, "_debugTask", {
|
|
192
|
-
configurable: !1,
|
|
193
|
-
enumerable: !1,
|
|
194
|
-
writable: !0,
|
|
195
|
-
value: te
|
|
196
|
-
}), Object.freeze && (Object.freeze(n.props), Object.freeze(n)), n;
|
|
197
|
-
}
|
|
198
|
-
function P(n, v, _, S, K, te) {
|
|
199
|
-
var L = v.children;
|
|
200
|
-
if (L !== void 0)
|
|
201
|
-
if (S)
|
|
202
|
-
if (ie(L)) {
|
|
203
|
-
for (S = 0; S < L.length; S++)
|
|
204
|
-
T(L[S]);
|
|
205
|
-
Object.freeze && Object.freeze(L);
|
|
206
|
-
} else
|
|
207
|
-
console.error(
|
|
208
|
-
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
209
|
-
);
|
|
210
|
-
else T(L);
|
|
211
|
-
if (M.call(v, "key")) {
|
|
212
|
-
L = t(n);
|
|
213
|
-
var Y = Object.keys(v).filter(function(ve) {
|
|
214
|
-
return ve !== "key";
|
|
215
|
-
});
|
|
216
|
-
S = 0 < Y.length ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}", ee[L + S] || (Y = 0 < Y.length ? "{" + Y.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
217
|
-
`A props object containing a "key" prop is being spread into JSX:
|
|
218
|
-
let props = %s;
|
|
219
|
-
<%s {...props} />
|
|
220
|
-
React keys must be passed directly to JSX without using spread:
|
|
221
|
-
let props = %s;
|
|
222
|
-
<%s key={someKey} {...props} />`,
|
|
223
|
-
S,
|
|
224
|
-
L,
|
|
225
|
-
Y,
|
|
226
|
-
L
|
|
227
|
-
), ee[L + S] = !0);
|
|
228
|
-
}
|
|
229
|
-
if (L = null, _ !== void 0 && (c(_), L = "" + _), k(v) && (c(v.key), L = "" + v.key), "key" in v) {
|
|
230
|
-
_ = {};
|
|
231
|
-
for (var ne in v)
|
|
232
|
-
ne !== "key" && (_[ne] = v[ne]);
|
|
233
|
-
} else _ = v;
|
|
234
|
-
return L && R(
|
|
235
|
-
_,
|
|
236
|
-
typeof n == "function" ? n.displayName || n.name || "Unknown" : n
|
|
237
|
-
), I(
|
|
238
|
-
n,
|
|
239
|
-
L,
|
|
240
|
-
_,
|
|
241
|
-
f(),
|
|
242
|
-
K,
|
|
243
|
-
te
|
|
244
|
-
);
|
|
245
|
-
}
|
|
246
|
-
function T(n) {
|
|
247
|
-
D(n) ? n._store && (n._store.validated = 1) : typeof n == "object" && n !== null && n.$$typeof === G && (n._payload.status === "fulfilled" ? D(n._payload.value) && n._payload.value._store && (n._payload.value._store.validated = 1) : n._store && (n._store.validated = 1));
|
|
248
|
-
}
|
|
249
|
-
function D(n) {
|
|
250
|
-
return typeof n == "object" && n !== null && n.$$typeof === X;
|
|
251
|
-
}
|
|
252
|
-
var E = W, X = Symbol.for("react.transitional.element"), B = Symbol.for("react.portal"), A = Symbol.for("react.fragment"), q = Symbol.for("react.strict_mode"), H = Symbol.for("react.profiler"), V = Symbol.for("react.consumer"), Z = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), J = Symbol.for("react.suspense_list"), le = Symbol.for("react.memo"), G = Symbol.for("react.lazy"), ge = Symbol.for("react.activity"), se = Symbol.for("react.client.reference"), N = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, M = Object.prototype.hasOwnProperty, ie = Array.isArray, $ = console.createTask ? console.createTask : function() {
|
|
253
|
-
return null;
|
|
254
|
-
};
|
|
255
|
-
E = {
|
|
256
|
-
react_stack_bottom_frame: function(n) {
|
|
257
|
-
return n();
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
var ce, Q = {}, ue = E.react_stack_bottom_frame.bind(
|
|
261
|
-
E,
|
|
262
|
-
w
|
|
263
|
-
)(), de = $(d(w)), ee = {};
|
|
264
|
-
oe.Fragment = A, oe.jsx = function(n, v, _) {
|
|
265
|
-
var S = 1e4 > N.recentlyCreatedOwnerStacks++;
|
|
266
|
-
return P(
|
|
267
|
-
n,
|
|
268
|
-
v,
|
|
269
|
-
_,
|
|
270
|
-
!1,
|
|
271
|
-
S ? Error("react-stack-top-frame") : ue,
|
|
272
|
-
S ? $(d(n)) : de
|
|
273
|
-
);
|
|
274
|
-
}, oe.jsxs = function(n, v, _) {
|
|
275
|
-
var S = 1e4 > N.recentlyCreatedOwnerStacks++;
|
|
276
|
-
return P(
|
|
277
|
-
n,
|
|
278
|
-
v,
|
|
279
|
-
_,
|
|
280
|
-
!0,
|
|
281
|
-
S ? Error("react-stack-top-frame") : ue,
|
|
282
|
-
S ? $(d(n)) : de
|
|
283
|
-
);
|
|
284
|
-
};
|
|
285
|
-
})()), oe;
|
|
286
|
-
}
|
|
287
|
-
var De;
|
|
288
|
-
function at() {
|
|
289
|
-
return De || (De = 1, process.env.NODE_ENV === "production" ? fe.exports = rt() : fe.exports = ot()), fe.exports;
|
|
290
|
-
}
|
|
291
|
-
var a = at(), Be = {
|
|
12
|
+
}, J = (t, c) => We(t, Ke(c));
|
|
13
|
+
import r, { useRef as _, useState as N, useEffect as B } from "react";
|
|
14
|
+
var Ce = {
|
|
292
15
|
color: void 0,
|
|
293
16
|
size: void 0,
|
|
294
17
|
className: void 0,
|
|
295
18
|
style: void 0,
|
|
296
19
|
attr: void 0
|
|
297
|
-
},
|
|
298
|
-
function
|
|
20
|
+
}, we = r.createContext && /* @__PURE__ */ r.createContext(Ce), Ze = ["attr", "size", "title"];
|
|
21
|
+
function Qe(t, c) {
|
|
299
22
|
if (t == null) return {};
|
|
300
|
-
var
|
|
23
|
+
var i = Je(t, c), d, v;
|
|
301
24
|
if (Object.getOwnPropertySymbols) {
|
|
302
|
-
var
|
|
303
|
-
for (
|
|
304
|
-
d =
|
|
25
|
+
var y = Object.getOwnPropertySymbols(t);
|
|
26
|
+
for (v = 0; v < y.length; v++)
|
|
27
|
+
d = y[v], !(c.indexOf(d) >= 0) && Object.prototype.propertyIsEnumerable.call(t, d) && (i[d] = t[d]);
|
|
305
28
|
}
|
|
306
|
-
return
|
|
29
|
+
return i;
|
|
307
30
|
}
|
|
308
|
-
function
|
|
31
|
+
function Je(t, c) {
|
|
309
32
|
if (t == null) return {};
|
|
310
|
-
var
|
|
33
|
+
var i = {};
|
|
311
34
|
for (var d in t)
|
|
312
35
|
if (Object.prototype.hasOwnProperty.call(t, d)) {
|
|
313
|
-
if (
|
|
314
|
-
|
|
36
|
+
if (c.indexOf(d) >= 0) continue;
|
|
37
|
+
i[d] = t[d];
|
|
315
38
|
}
|
|
316
|
-
return
|
|
39
|
+
return i;
|
|
317
40
|
}
|
|
318
|
-
function
|
|
319
|
-
return
|
|
320
|
-
for (var
|
|
321
|
-
var
|
|
322
|
-
for (var d in
|
|
323
|
-
Object.prototype.hasOwnProperty.call(
|
|
41
|
+
function W() {
|
|
42
|
+
return W = Object.assign ? Object.assign.bind() : function(t) {
|
|
43
|
+
for (var c = 1; c < arguments.length; c++) {
|
|
44
|
+
var i = arguments[c];
|
|
45
|
+
for (var d in i)
|
|
46
|
+
Object.prototype.hasOwnProperty.call(i, d) && (t[d] = i[d]);
|
|
324
47
|
}
|
|
325
48
|
return t;
|
|
326
|
-
},
|
|
49
|
+
}, W.apply(this, arguments);
|
|
327
50
|
}
|
|
328
|
-
function
|
|
329
|
-
var
|
|
51
|
+
function Ee(t, c) {
|
|
52
|
+
var i = Object.keys(t);
|
|
330
53
|
if (Object.getOwnPropertySymbols) {
|
|
331
54
|
var d = Object.getOwnPropertySymbols(t);
|
|
332
|
-
|
|
333
|
-
return Object.getOwnPropertyDescriptor(t,
|
|
334
|
-
})),
|
|
55
|
+
c && (d = d.filter(function(v) {
|
|
56
|
+
return Object.getOwnPropertyDescriptor(t, v).enumerable;
|
|
57
|
+
})), i.push.apply(i, d);
|
|
335
58
|
}
|
|
336
|
-
return
|
|
59
|
+
return i;
|
|
337
60
|
}
|
|
338
|
-
function
|
|
339
|
-
for (var
|
|
340
|
-
var
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(
|
|
344
|
-
Object.defineProperty(t, d, Object.getOwnPropertyDescriptor(
|
|
61
|
+
function K(t) {
|
|
62
|
+
for (var c = 1; c < arguments.length; c++) {
|
|
63
|
+
var i = arguments[c] != null ? arguments[c] : {};
|
|
64
|
+
c % 2 ? Ee(Object(i), !0).forEach(function(d) {
|
|
65
|
+
Ge(t, d, i[d]);
|
|
66
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(i)) : Ee(Object(i)).forEach(function(d) {
|
|
67
|
+
Object.defineProperty(t, d, Object.getOwnPropertyDescriptor(i, d));
|
|
345
68
|
});
|
|
346
69
|
}
|
|
347
70
|
return t;
|
|
348
71
|
}
|
|
349
|
-
function
|
|
350
|
-
return
|
|
72
|
+
function Ge(t, c, i) {
|
|
73
|
+
return c = et(c), c in t ? Object.defineProperty(t, c, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[c] = i, t;
|
|
351
74
|
}
|
|
352
|
-
function
|
|
353
|
-
var
|
|
354
|
-
return typeof
|
|
75
|
+
function et(t) {
|
|
76
|
+
var c = tt(t, "string");
|
|
77
|
+
return typeof c == "symbol" ? c : c + "";
|
|
355
78
|
}
|
|
356
|
-
function
|
|
79
|
+
function tt(t, c) {
|
|
357
80
|
if (typeof t != "object" || !t) return t;
|
|
358
|
-
var
|
|
359
|
-
if (
|
|
360
|
-
var d =
|
|
81
|
+
var i = t[Symbol.toPrimitive];
|
|
82
|
+
if (i !== void 0) {
|
|
83
|
+
var d = i.call(t, c);
|
|
361
84
|
if (typeof d != "object") return d;
|
|
362
85
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
363
86
|
}
|
|
364
|
-
return (
|
|
87
|
+
return (c === "string" ? String : Number)(t);
|
|
365
88
|
}
|
|
366
|
-
function
|
|
367
|
-
return t && t.map((
|
|
368
|
-
key:
|
|
369
|
-
},
|
|
89
|
+
function be(t) {
|
|
90
|
+
return t && t.map((c, i) => /* @__PURE__ */ r.createElement(c.tag, K({
|
|
91
|
+
key: i
|
|
92
|
+
}, c.attr), be(c.child)));
|
|
370
93
|
}
|
|
371
|
-
function
|
|
372
|
-
return (
|
|
373
|
-
attr:
|
|
374
|
-
},
|
|
94
|
+
function M(t) {
|
|
95
|
+
return (c) => /* @__PURE__ */ r.createElement(nt, W({
|
|
96
|
+
attr: K({}, t.attr)
|
|
97
|
+
}, c), be(t.child));
|
|
375
98
|
}
|
|
376
|
-
function
|
|
377
|
-
var
|
|
99
|
+
function nt(t) {
|
|
100
|
+
var c = (i) => {
|
|
378
101
|
var {
|
|
379
102
|
attr: d,
|
|
380
|
-
size:
|
|
381
|
-
title:
|
|
382
|
-
} = t,
|
|
383
|
-
return
|
|
103
|
+
size: v,
|
|
104
|
+
title: y
|
|
105
|
+
} = t, R = Qe(t, Ze), x = v || i.size || "1em", w;
|
|
106
|
+
return i.className && (w = i.className), t.className && (w = (w ? w + " " : "") + t.className), /* @__PURE__ */ r.createElement("svg", W({
|
|
384
107
|
stroke: "currentColor",
|
|
385
108
|
fill: "currentColor",
|
|
386
109
|
strokeWidth: "0"
|
|
387
|
-
},
|
|
388
|
-
className:
|
|
389
|
-
style:
|
|
390
|
-
color: t.color ||
|
|
391
|
-
},
|
|
392
|
-
height:
|
|
393
|
-
width:
|
|
110
|
+
}, i.attr, d, R, {
|
|
111
|
+
className: w,
|
|
112
|
+
style: K(K({
|
|
113
|
+
color: t.color || i.color
|
|
114
|
+
}, i.style), t.style),
|
|
115
|
+
height: x,
|
|
116
|
+
width: x,
|
|
394
117
|
xmlns: "http://www.w3.org/2000/svg"
|
|
395
|
-
}),
|
|
118
|
+
}), y && /* @__PURE__ */ r.createElement("title", null, y), t.children);
|
|
396
119
|
};
|
|
397
|
-
return
|
|
120
|
+
return we !== void 0 ? /* @__PURE__ */ r.createElement(we.Consumer, null, (i) => c(i)) : c(Ce);
|
|
398
121
|
}
|
|
399
|
-
function
|
|
400
|
-
return
|
|
122
|
+
function rt(t) {
|
|
123
|
+
return M({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M352 64c0-17.7-14.3-32-32-32L128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32z" }, child: [] }] })(t);
|
|
401
124
|
}
|
|
402
|
-
function
|
|
403
|
-
return
|
|
125
|
+
function ot(t) {
|
|
126
|
+
return M({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M448 64c0 17.7-14.3 32-32 32L192 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z" }, child: [] }] })(t);
|
|
404
127
|
}
|
|
405
|
-
function
|
|
406
|
-
return
|
|
128
|
+
function lt(t) {
|
|
129
|
+
return M({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z" }, child: [] }] })(t);
|
|
407
130
|
}
|
|
408
|
-
function
|
|
409
|
-
return
|
|
131
|
+
function at(t) {
|
|
132
|
+
return M({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M24 56c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24l0 120 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-96-8 0C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432l33.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-88 0c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z" }, child: [] }] })(t);
|
|
410
133
|
}
|
|
411
|
-
function
|
|
412
|
-
return
|
|
134
|
+
function ct(t) {
|
|
135
|
+
return M({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M12.83 352h262.34A12.82 12.82 0 0 0 288 339.17v-38.34A12.82 12.82 0 0 0 275.17 288H12.83A12.82 12.82 0 0 0 0 300.83v38.34A12.82 12.82 0 0 0 12.83 352zm0-256h262.34A12.82 12.82 0 0 0 288 83.17V44.83A12.82 12.82 0 0 0 275.17 32H12.83A12.82 12.82 0 0 0 0 44.83v38.34A12.82 12.82 0 0 0 12.83 96zM432 160H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0 256H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(t);
|
|
413
136
|
}
|
|
414
|
-
function
|
|
415
|
-
return
|
|
137
|
+
function it(t) {
|
|
138
|
+
return M({ attr: { viewBox: "0 0 384 512" }, child: [{ tag: "path", attr: { d: "M333.49 238a122 122 0 0 0 27-65.21C367.87 96.49 308 32 233.42 32H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h31.87v288H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h209.32c70.8 0 134.14-51.75 141-122.4 4.74-48.45-16.39-92.06-50.83-119.6zM145.66 112h87.76a48 48 0 0 1 0 96h-87.76zm87.76 288h-87.76V288h87.76a56 56 0 0 1 0 112z" }, child: [] }] })(t);
|
|
416
139
|
}
|
|
417
|
-
function
|
|
418
|
-
return
|
|
140
|
+
function st(t) {
|
|
141
|
+
return M({ attr: { viewBox: "0 0 544 512" }, child: [{ tag: "path", attr: { d: "M0 479.98L99.92 512l35.45-35.45-67.04-67.04L0 479.98zm124.61-240.01a36.592 36.592 0 0 0-10.79 38.1l13.05 42.83-50.93 50.94 96.23 96.23 50.86-50.86 42.74 13.08c13.73 4.2 28.65-.01 38.15-10.78l35.55-41.64-173.34-173.34-41.52 35.44zm403.31-160.7l-63.2-63.2c-20.49-20.49-53.38-21.52-75.12-2.35L190.55 183.68l169.77 169.78L530.27 154.4c19.18-21.74 18.15-54.63-2.35-75.13z" }, child: [] }] })(t);
|
|
419
142
|
}
|
|
420
|
-
function
|
|
421
|
-
return
|
|
143
|
+
function dt(t) {
|
|
144
|
+
return M({ attr: { viewBox: "0 0 320 512" }, child: [{ tag: "path", attr: { d: "M320 48v32a16 16 0 0 1-16 16h-62.76l-80 320H208a16 16 0 0 1 16 16v32a16 16 0 0 1-16 16H16a16 16 0 0 1-16-16v-32a16 16 0 0 1 16-16h62.76l80-320H112a16 16 0 0 1-16-16V48a16 16 0 0 1 16-16h192a16 16 0 0 1 16 16z" }, child: [] }] })(t);
|
|
422
145
|
}
|
|
423
|
-
function
|
|
424
|
-
return
|
|
146
|
+
function ut(t) {
|
|
147
|
+
return M({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z" }, child: [] }] })(t);
|
|
425
148
|
}
|
|
426
|
-
function
|
|
427
|
-
return
|
|
149
|
+
function mt(t) {
|
|
150
|
+
return M({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(t);
|
|
428
151
|
}
|
|
429
|
-
function
|
|
430
|
-
return
|
|
152
|
+
function ht(t) {
|
|
153
|
+
return M({ attr: { viewBox: "0 0 496 512" }, child: [{ tag: "path", attr: { d: "M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm194.8 170.2C334.3 380.4 292.5 400 248 400s-86.3-19.6-114.8-53.8c-13.6-16.3 11-36.7 24.6-20.5 22.4 26.9 55.2 42.2 90.2 42.2s67.8-15.4 90.2-42.2c13.4-16.2 38.1 4.2 24.6 20.5z" }, child: [] }] })(t);
|
|
431
154
|
}
|
|
432
|
-
function
|
|
433
|
-
return
|
|
155
|
+
function gt(t) {
|
|
156
|
+
return M({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M464 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM224 416H64v-96h160v96zm0-160H64v-96h160v96zm224 160H288v-96h160v96zm0-160H288v-96h160v96z" }, child: [] }] })(t);
|
|
434
157
|
}
|
|
435
|
-
function
|
|
436
|
-
return
|
|
158
|
+
function pt(t) {
|
|
159
|
+
return M({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M32 64h32v160c0 88.22 71.78 160 160 160s160-71.78 160-160V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H272a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h32v160a80 80 0 0 1-160 0V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H32a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm400 384H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(t);
|
|
437
160
|
}
|
|
438
|
-
function
|
|
439
|
-
return
|
|
161
|
+
function ft(t) {
|
|
162
|
+
return M({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M2 20h20v4H2v-4zm3.49-3h2.42l1.27-3.58h5.65L16.09 17h2.42L13.25 3h-2.5L5.49 17zm4.42-5.61 2.03-5.79h.12l2.03 5.79H9.91z" }, child: [] }] })(t);
|
|
440
163
|
}
|
|
441
|
-
function
|
|
442
|
-
return
|
|
164
|
+
function vt(t) {
|
|
165
|
+
return M({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0V0z" }, child: [] }, { tag: "path", attr: { d: "M20 8V5H6.39l3 3h1.83l-.55 1.28 2.09 2.1L14.21 8zM3.41 4.86 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21l1.41-1.41z" }, child: [] }] })(t);
|
|
443
166
|
}
|
|
444
|
-
const
|
|
167
|
+
const wt = [
|
|
445
168
|
"😀",
|
|
446
169
|
"😁",
|
|
447
170
|
"😂",
|
|
@@ -553,506 +276,432 @@ const Lt = [
|
|
|
553
276
|
"👏",
|
|
554
277
|
"🫶",
|
|
555
278
|
"👐"
|
|
556
|
-
],
|
|
279
|
+
], Et = ({
|
|
557
280
|
exec: t,
|
|
558
|
-
saveSelection:
|
|
559
|
-
handleFileChange:
|
|
281
|
+
saveSelection: c,
|
|
282
|
+
handleFileChange: i,
|
|
560
283
|
handleFontSizeChange: d,
|
|
561
|
-
handleFontFamilyChange:
|
|
284
|
+
handleFontFamilyChange: v,
|
|
562
285
|
// insertListBlock,
|
|
563
|
-
insertEmoji:
|
|
564
|
-
handleLink:
|
|
565
|
-
removeFormatting:
|
|
566
|
-
visibleActions:
|
|
567
|
-
className:
|
|
568
|
-
style:
|
|
286
|
+
insertEmoji: y,
|
|
287
|
+
handleLink: R,
|
|
288
|
+
removeFormatting: x,
|
|
289
|
+
visibleActions: w,
|
|
290
|
+
className: H,
|
|
291
|
+
style: T
|
|
569
292
|
}) => {
|
|
570
|
-
var
|
|
571
|
-
const
|
|
572
|
-
|
|
573
|
-
const
|
|
574
|
-
!
|
|
293
|
+
var F, V;
|
|
294
|
+
const L = _(null), D = _(null), b = _(null), [X, j] = N(!1);
|
|
295
|
+
B(() => {
|
|
296
|
+
const m = (E) => {
|
|
297
|
+
!E.target.closest(".rte-emoji-popup") && !E.target.closest("button[title='Emoji']") && j(!1);
|
|
575
298
|
};
|
|
576
|
-
return document.addEventListener("mousedown",
|
|
299
|
+
return document.addEventListener("mousedown", m), () => document.removeEventListener("mousedown", m);
|
|
577
300
|
}, []);
|
|
578
|
-
const
|
|
579
|
-
var
|
|
580
|
-
|
|
581
|
-
const
|
|
582
|
-
if (
|
|
583
|
-
switch (
|
|
301
|
+
const S = (m) => {
|
|
302
|
+
var $;
|
|
303
|
+
m.preventDefault();
|
|
304
|
+
const E = m.currentTarget.dataset.command;
|
|
305
|
+
if (E)
|
|
306
|
+
switch (E) {
|
|
584
307
|
case "bold":
|
|
585
308
|
case "italic":
|
|
586
309
|
case "underline":
|
|
587
310
|
case "insertUnorderedList":
|
|
588
311
|
case "insertOrderedList":
|
|
589
312
|
case "removeFormat":
|
|
590
|
-
t(
|
|
313
|
+
t(E);
|
|
591
314
|
break;
|
|
592
315
|
case "insertImage": {
|
|
593
|
-
(
|
|
316
|
+
($ = L.current) == null || $.click();
|
|
594
317
|
break;
|
|
595
318
|
}
|
|
596
319
|
default:
|
|
597
|
-
console.warn("Unknown command:",
|
|
320
|
+
console.warn("Unknown command:", E);
|
|
598
321
|
}
|
|
599
|
-
},
|
|
600
|
-
t("foreColor",
|
|
601
|
-
},
|
|
602
|
-
t("backColor",
|
|
322
|
+
}, P = (m) => {
|
|
323
|
+
t("foreColor", m.target.value);
|
|
324
|
+
}, A = (m) => {
|
|
325
|
+
t("backColor", m.target.value);
|
|
603
326
|
};
|
|
604
|
-
return /* @__PURE__ */
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
"
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
"
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
"
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
327
|
+
return /* @__PURE__ */ r.createElement("div", { className: `rte-toolbar ${H || ""}`, style: T }, w.bold && /* @__PURE__ */ r.createElement(
|
|
328
|
+
"button",
|
|
329
|
+
{
|
|
330
|
+
"data-command": "bold",
|
|
331
|
+
title: "Bold",
|
|
332
|
+
onMouseDown: S
|
|
333
|
+
},
|
|
334
|
+
/* @__PURE__ */ r.createElement(it, null)
|
|
335
|
+
), w.italic && /* @__PURE__ */ r.createElement(
|
|
336
|
+
"button",
|
|
337
|
+
{
|
|
338
|
+
"data-command": "italic",
|
|
339
|
+
title: "Italic",
|
|
340
|
+
onMouseDown: S
|
|
341
|
+
},
|
|
342
|
+
/* @__PURE__ */ r.createElement(dt, null)
|
|
343
|
+
), w.underline && /* @__PURE__ */ r.createElement(
|
|
344
|
+
"button",
|
|
345
|
+
{
|
|
346
|
+
"data-command": "underline",
|
|
347
|
+
title: "Underline",
|
|
348
|
+
onMouseDown: S
|
|
349
|
+
},
|
|
350
|
+
/* @__PURE__ */ r.createElement(pt, null)
|
|
351
|
+
), w.unorderedList && /* @__PURE__ */ r.createElement(
|
|
352
|
+
"button",
|
|
353
|
+
{
|
|
354
|
+
"data-command": "insertUnorderedList",
|
|
355
|
+
onMouseDown: S,
|
|
356
|
+
title: "UnorderedList"
|
|
357
|
+
},
|
|
358
|
+
/* @__PURE__ */ r.createElement(mt, null)
|
|
359
|
+
), w.orderedList && /* @__PURE__ */ r.createElement(
|
|
360
|
+
"button",
|
|
361
|
+
{
|
|
362
|
+
"data-command": "insertOrderedList",
|
|
363
|
+
title: "OrderedList",
|
|
364
|
+
onMouseDown: S
|
|
365
|
+
},
|
|
366
|
+
/* @__PURE__ */ r.createElement(at, null)
|
|
367
|
+
), w.link && /* @__PURE__ */ r.createElement("button", { "data-command": "createLink", title: "Link", onClick: R }, /* @__PURE__ */ r.createElement(ut, null)), w.removeFormat && /* @__PURE__ */ r.createElement(
|
|
368
|
+
"button",
|
|
369
|
+
{
|
|
370
|
+
"data-command": "Remove format",
|
|
371
|
+
title: "removeFormat",
|
|
372
|
+
onMouseDown: (m) => {
|
|
373
|
+
m.preventDefault(), c(), x();
|
|
648
374
|
}
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
375
|
+
},
|
|
376
|
+
/* @__PURE__ */ r.createElement(vt, null)
|
|
377
|
+
), w.image && /* @__PURE__ */ r.createElement(
|
|
378
|
+
"button",
|
|
379
|
+
{
|
|
380
|
+
"data-command": "insertImage",
|
|
381
|
+
title: "Image",
|
|
382
|
+
onMouseDown: S
|
|
383
|
+
},
|
|
384
|
+
/* @__PURE__ */ r.createElement(lt, null)
|
|
385
|
+
), /* @__PURE__ */ r.createElement(
|
|
386
|
+
"input",
|
|
387
|
+
{
|
|
388
|
+
type: "file",
|
|
389
|
+
accept: "image/*",
|
|
390
|
+
ref: L,
|
|
391
|
+
style: { display: "none" },
|
|
392
|
+
onChange: i
|
|
393
|
+
}
|
|
394
|
+
), w.emoji && /* @__PURE__ */ r.createElement("div", { style: { position: "relative" } }, /* @__PURE__ */ r.createElement(
|
|
395
|
+
"button",
|
|
396
|
+
{
|
|
397
|
+
title: "Emoji",
|
|
398
|
+
onMouseDown: (m) => {
|
|
399
|
+
m.preventDefault(), c(), j((E) => !E);
|
|
660
400
|
}
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
401
|
+
},
|
|
402
|
+
/* @__PURE__ */ r.createElement(ht, null)
|
|
403
|
+
), X && /* @__PURE__ */ r.createElement("div", { className: "rte-emoji-popup" }, wt.map((m) => /* @__PURE__ */ r.createElement(
|
|
404
|
+
"span",
|
|
405
|
+
{
|
|
406
|
+
key: m,
|
|
407
|
+
style: {
|
|
408
|
+
fontSize: "20px",
|
|
409
|
+
cursor: "pointer",
|
|
410
|
+
textAlign: "center"
|
|
411
|
+
},
|
|
412
|
+
onMouseDown: (E) => {
|
|
413
|
+
E.preventDefault(), y(m), j(!1);
|
|
669
414
|
}
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
415
|
+
},
|
|
416
|
+
m
|
|
417
|
+
)))), w.color && /* @__PURE__ */ r.createElement("div", { style: { position: "relative" } }, /* @__PURE__ */ r.createElement(
|
|
418
|
+
"button",
|
|
419
|
+
{
|
|
420
|
+
title: "Text Color",
|
|
421
|
+
onMouseDown: (m) => {
|
|
422
|
+
var E;
|
|
423
|
+
m.preventDefault(), c(), (E = D.current) == null || E.click();
|
|
424
|
+
},
|
|
425
|
+
style: {
|
|
426
|
+
display: "flex",
|
|
427
|
+
alignItems: "center",
|
|
428
|
+
justifyContent: "center",
|
|
429
|
+
color: ((F = D.current) == null ? void 0 : F.value) || "#000",
|
|
430
|
+
fontSize: "18px"
|
|
679
431
|
}
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
onMouseDown: (C) => {
|
|
701
|
-
C.preventDefault(), w(h), B(!1);
|
|
702
|
-
},
|
|
703
|
-
children: h
|
|
704
|
-
},
|
|
705
|
-
h
|
|
706
|
-
)) })
|
|
707
|
-
] }),
|
|
708
|
-
b.color && /* @__PURE__ */ a.jsxs("div", { style: { position: "relative" }, children: [
|
|
709
|
-
/* @__PURE__ */ a.jsx(
|
|
710
|
-
"button",
|
|
711
|
-
{
|
|
712
|
-
title: "Text Color",
|
|
713
|
-
onMouseDown: (h) => {
|
|
714
|
-
var C;
|
|
715
|
-
h.preventDefault(), s(), (C = D.current) == null || C.click();
|
|
716
|
-
},
|
|
717
|
-
style: {
|
|
718
|
-
display: "flex",
|
|
719
|
-
alignItems: "center",
|
|
720
|
-
justifyContent: "center",
|
|
721
|
-
color: ((V = D.current) == null ? void 0 : V.value) || "#000",
|
|
722
|
-
fontSize: "18px"
|
|
723
|
-
},
|
|
724
|
-
children: /* @__PURE__ */ a.jsx(_t, {})
|
|
725
|
-
}
|
|
726
|
-
),
|
|
727
|
-
/* @__PURE__ */ a.jsx(
|
|
728
|
-
"input",
|
|
729
|
-
{
|
|
730
|
-
ref: D,
|
|
731
|
-
type: "color",
|
|
732
|
-
defaultValue: "#000000",
|
|
733
|
-
onChange: (h) => {
|
|
734
|
-
var C;
|
|
735
|
-
q(h), ((C = h.target.parentElement) == null ? void 0 : C.querySelector(
|
|
736
|
-
"button"
|
|
737
|
-
)).style.color = h.target.value;
|
|
738
|
-
},
|
|
739
|
-
style: {
|
|
740
|
-
position: "absolute",
|
|
741
|
-
opacity: 0,
|
|
742
|
-
width: 0,
|
|
743
|
-
height: 0,
|
|
744
|
-
pointerEvents: "none"
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
)
|
|
748
|
-
] }),
|
|
749
|
-
b.highlight && /* @__PURE__ */ a.jsxs("div", { style: { position: "relative" }, children: [
|
|
750
|
-
/* @__PURE__ */ a.jsx(
|
|
751
|
-
"button",
|
|
752
|
-
{
|
|
753
|
-
title: "Highlight",
|
|
754
|
-
onMouseDown: (h) => {
|
|
755
|
-
var C;
|
|
756
|
-
h.preventDefault(), s(), (C = E.current) == null || C.click();
|
|
757
|
-
},
|
|
758
|
-
style: {
|
|
759
|
-
display: "flex",
|
|
760
|
-
alignItems: "center",
|
|
761
|
-
justifyContent: "center",
|
|
762
|
-
color: ((Z = E.current) == null ? void 0 : Z.value) || "#000",
|
|
763
|
-
fontSize: "18px"
|
|
764
|
-
},
|
|
765
|
-
children: /* @__PURE__ */ a.jsx(wt, {})
|
|
766
|
-
}
|
|
767
|
-
),
|
|
768
|
-
/* @__PURE__ */ a.jsx(
|
|
769
|
-
"input",
|
|
770
|
-
{
|
|
771
|
-
ref: E,
|
|
772
|
-
type: "color",
|
|
773
|
-
onChange: (h) => {
|
|
774
|
-
var C;
|
|
775
|
-
H(h), ((C = h.target.parentElement) == null ? void 0 : C.querySelector(
|
|
776
|
-
"button"
|
|
777
|
-
)).style.color = h.target.value;
|
|
778
|
-
},
|
|
779
|
-
defaultValue: "#000000",
|
|
780
|
-
style: {
|
|
781
|
-
position: "absolute",
|
|
782
|
-
opacity: 0,
|
|
783
|
-
width: 0,
|
|
784
|
-
height: 0,
|
|
785
|
-
pointerEvents: "none"
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
)
|
|
789
|
-
] }),
|
|
790
|
-
b.align && /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
791
|
-
/* @__PURE__ */ a.jsx(
|
|
792
|
-
"button",
|
|
793
|
-
{
|
|
794
|
-
title: "Align Left",
|
|
795
|
-
onMouseDown: (h) => h.preventDefault(),
|
|
796
|
-
onClick: () => t("justifyLeft"),
|
|
797
|
-
children: /* @__PURE__ */ a.jsx(vt, {})
|
|
798
|
-
}
|
|
799
|
-
),
|
|
800
|
-
/* @__PURE__ */ a.jsx(
|
|
801
|
-
"button",
|
|
802
|
-
{
|
|
803
|
-
title: "Align Center",
|
|
804
|
-
onMouseDown: (h) => h.preventDefault(),
|
|
805
|
-
onClick: () => t("justifyCenter"),
|
|
806
|
-
children: /* @__PURE__ */ a.jsx(mt, {})
|
|
807
|
-
}
|
|
808
|
-
),
|
|
809
|
-
/* @__PURE__ */ a.jsx(
|
|
810
|
-
"button",
|
|
811
|
-
{
|
|
812
|
-
title: "Align Right",
|
|
813
|
-
onMouseDown: (h) => h.preventDefault(),
|
|
814
|
-
onClick: () => t("justifyRight"),
|
|
815
|
-
children: /* @__PURE__ */ a.jsx(ht, {})
|
|
816
|
-
}
|
|
817
|
-
)
|
|
818
|
-
] }),
|
|
819
|
-
b.table && /* @__PURE__ */ a.jsx(
|
|
820
|
-
"button",
|
|
821
|
-
{
|
|
822
|
-
title: "Insert Table",
|
|
823
|
-
onMouseDown: (h) => h.preventDefault(),
|
|
824
|
-
onClick: () => t("insertTable"),
|
|
825
|
-
children: /* @__PURE__ */ a.jsx(Et, {})
|
|
432
|
+
},
|
|
433
|
+
/* @__PURE__ */ r.createElement(ft, null)
|
|
434
|
+
), /* @__PURE__ */ r.createElement(
|
|
435
|
+
"input",
|
|
436
|
+
{
|
|
437
|
+
ref: D,
|
|
438
|
+
type: "color",
|
|
439
|
+
defaultValue: "#000000",
|
|
440
|
+
onChange: (m) => {
|
|
441
|
+
var E;
|
|
442
|
+
P(m), ((E = m.target.parentElement) == null ? void 0 : E.querySelector(
|
|
443
|
+
"button"
|
|
444
|
+
)).style.color = m.target.value;
|
|
445
|
+
},
|
|
446
|
+
style: {
|
|
447
|
+
position: "absolute",
|
|
448
|
+
opacity: 0,
|
|
449
|
+
width: 0,
|
|
450
|
+
height: 0,
|
|
451
|
+
pointerEvents: "none"
|
|
826
452
|
}
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
]
|
|
453
|
+
}
|
|
454
|
+
)), w.highlight && /* @__PURE__ */ r.createElement("div", { style: { position: "relative" } }, /* @__PURE__ */ r.createElement(
|
|
455
|
+
"button",
|
|
456
|
+
{
|
|
457
|
+
title: "Highlight",
|
|
458
|
+
onMouseDown: (m) => {
|
|
459
|
+
var E;
|
|
460
|
+
m.preventDefault(), c(), (E = b.current) == null || E.click();
|
|
461
|
+
},
|
|
462
|
+
style: {
|
|
463
|
+
display: "flex",
|
|
464
|
+
alignItems: "center",
|
|
465
|
+
justifyContent: "center",
|
|
466
|
+
color: ((V = b.current) == null ? void 0 : V.value) || "#000",
|
|
467
|
+
fontSize: "18px"
|
|
843
468
|
}
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
469
|
+
},
|
|
470
|
+
/* @__PURE__ */ r.createElement(st, null)
|
|
471
|
+
), /* @__PURE__ */ r.createElement(
|
|
472
|
+
"input",
|
|
473
|
+
{
|
|
474
|
+
ref: b,
|
|
475
|
+
type: "color",
|
|
476
|
+
onChange: (m) => {
|
|
477
|
+
var E;
|
|
478
|
+
A(m), ((E = m.target.parentElement) == null ? void 0 : E.querySelector(
|
|
479
|
+
"button"
|
|
480
|
+
)).style.color = m.target.value;
|
|
481
|
+
},
|
|
482
|
+
defaultValue: "#000000",
|
|
483
|
+
style: {
|
|
484
|
+
position: "absolute",
|
|
485
|
+
opacity: 0,
|
|
486
|
+
width: 0,
|
|
487
|
+
height: 0,
|
|
488
|
+
pointerEvents: "none"
|
|
859
489
|
}
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
490
|
+
}
|
|
491
|
+
)), w.align && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
492
|
+
"button",
|
|
493
|
+
{
|
|
494
|
+
title: "Align Left",
|
|
495
|
+
onMouseDown: (m) => m.preventDefault(),
|
|
496
|
+
onClick: () => t("justifyLeft")
|
|
497
|
+
},
|
|
498
|
+
/* @__PURE__ */ r.createElement(ct, null)
|
|
499
|
+
), /* @__PURE__ */ r.createElement(
|
|
500
|
+
"button",
|
|
501
|
+
{
|
|
502
|
+
title: "Align Center",
|
|
503
|
+
onMouseDown: (m) => m.preventDefault(),
|
|
504
|
+
onClick: () => t("justifyCenter")
|
|
505
|
+
},
|
|
506
|
+
/* @__PURE__ */ r.createElement(rt, null)
|
|
507
|
+
), /* @__PURE__ */ r.createElement(
|
|
508
|
+
"button",
|
|
509
|
+
{
|
|
510
|
+
title: "Align Right",
|
|
511
|
+
onMouseDown: (m) => m.preventDefault(),
|
|
512
|
+
onClick: () => t("justifyRight")
|
|
513
|
+
},
|
|
514
|
+
/* @__PURE__ */ r.createElement(ot, null)
|
|
515
|
+
)), w.table && /* @__PURE__ */ r.createElement(
|
|
516
|
+
"button",
|
|
517
|
+
{
|
|
518
|
+
title: "Insert Table",
|
|
519
|
+
onMouseDown: (m) => m.preventDefault(),
|
|
520
|
+
onClick: () => t("insertTable")
|
|
521
|
+
},
|
|
522
|
+
/* @__PURE__ */ r.createElement(gt, null)
|
|
523
|
+
), w.fontFamily && /* @__PURE__ */ r.createElement(
|
|
524
|
+
"select",
|
|
525
|
+
{
|
|
526
|
+
className: "rte-dropdown",
|
|
527
|
+
defaultValue: "",
|
|
528
|
+
onMouseDown: () => c(),
|
|
529
|
+
onChange: v
|
|
530
|
+
},
|
|
531
|
+
/* @__PURE__ */ r.createElement("option", { value: "", disabled: !0 }, "Font Family"),
|
|
532
|
+
/* @__PURE__ */ r.createElement("option", { value: "Arial" }, "Arial"),
|
|
533
|
+
/* @__PURE__ */ r.createElement("option", { value: "Georgia" }, "Georgia"),
|
|
534
|
+
/* @__PURE__ */ r.createElement("option", { value: "Times New Roman" }, "Times New Roman"),
|
|
535
|
+
/* @__PURE__ */ r.createElement("option", { value: "Courier New" }, "Courier New"),
|
|
536
|
+
/* @__PURE__ */ r.createElement("option", { value: "Verdana" }, "Verdana")
|
|
537
|
+
), w.fontSize && /* @__PURE__ */ r.createElement(
|
|
538
|
+
"select",
|
|
539
|
+
{
|
|
540
|
+
className: "rte-dropdown",
|
|
541
|
+
defaultValue: "",
|
|
542
|
+
onMouseDown: () => c(),
|
|
543
|
+
onChange: d
|
|
544
|
+
},
|
|
545
|
+
/* @__PURE__ */ r.createElement("option", { value: "", disabled: !0 }, "Font Size"),
|
|
546
|
+
/* @__PURE__ */ r.createElement("option", { value: "2" }, "Small "),
|
|
547
|
+
/* @__PURE__ */ r.createElement("option", { value: "3" }, "Normal"),
|
|
548
|
+
/* @__PURE__ */ r.createElement("option", { value: "4" }, "Medium"),
|
|
549
|
+
/* @__PURE__ */ r.createElement("option", { value: "5" }, "Large")
|
|
550
|
+
));
|
|
551
|
+
}, yt = ({
|
|
863
552
|
show: t,
|
|
864
|
-
position:
|
|
865
|
-
filtered:
|
|
553
|
+
position: c,
|
|
554
|
+
filtered: i,
|
|
866
555
|
insertMention: d,
|
|
867
|
-
onClose:
|
|
868
|
-
query:
|
|
556
|
+
onClose: v,
|
|
557
|
+
query: y
|
|
869
558
|
}) => {
|
|
870
|
-
const
|
|
871
|
-
return
|
|
872
|
-
const
|
|
873
|
-
|
|
559
|
+
const R = _(null);
|
|
560
|
+
return B(() => {
|
|
561
|
+
const x = (w) => {
|
|
562
|
+
R.current && !R.current.contains(w.target) && v();
|
|
874
563
|
};
|
|
875
|
-
return t && document.addEventListener("mousedown",
|
|
876
|
-
document.removeEventListener("mousedown",
|
|
564
|
+
return t && document.addEventListener("mousedown", x), () => {
|
|
565
|
+
document.removeEventListener("mousedown", x);
|
|
877
566
|
};
|
|
878
|
-
}, [t,
|
|
567
|
+
}, [t, v]), t ? /* @__PURE__ */ r.createElement(
|
|
879
568
|
"ul",
|
|
880
569
|
{
|
|
881
|
-
ref:
|
|
570
|
+
ref: R,
|
|
882
571
|
className: "rte-popup",
|
|
883
572
|
style: {
|
|
884
|
-
top:
|
|
885
|
-
left:
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
)}</span>` + R.substring(E);
|
|
896
|
-
}
|
|
897
|
-
return /* @__PURE__ */ a.jsx(
|
|
898
|
-
"li",
|
|
899
|
-
{
|
|
900
|
-
onMouseDown: (E) => {
|
|
901
|
-
E.preventDefault(), d({ key: R, value: b });
|
|
902
|
-
},
|
|
903
|
-
style: {
|
|
904
|
-
padding: "6px 12px",
|
|
905
|
-
cursor: "pointer",
|
|
906
|
-
fontSize: "14px"
|
|
907
|
-
},
|
|
908
|
-
dangerouslySetInnerHTML: { __html: D },
|
|
909
|
-
onMouseEnter: (E) => E.currentTarget.style.background = "#f0f0f0",
|
|
910
|
-
onMouseLeave: (E) => E.currentTarget.style.background = "#fff"
|
|
911
|
-
},
|
|
573
|
+
top: c.y,
|
|
574
|
+
left: c.x
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
i.length > 0 ? i.map(({ key: x, value: w }) => {
|
|
578
|
+
const H = x.toLowerCase(), T = y.toLowerCase(), L = H.indexOf(T);
|
|
579
|
+
let D = x;
|
|
580
|
+
if (L !== -1 && y.length > 0) {
|
|
581
|
+
const b = L + y.length;
|
|
582
|
+
D = x.substring(0, L) + `<span class="rte-highlight">${x.substring(
|
|
583
|
+
L,
|
|
912
584
|
b
|
|
913
|
-
);
|
|
914
|
-
}
|
|
915
|
-
|
|
585
|
+
)}</span>` + x.substring(b);
|
|
586
|
+
}
|
|
587
|
+
return /* @__PURE__ */ r.createElement(
|
|
588
|
+
"li",
|
|
589
|
+
{
|
|
590
|
+
key: w,
|
|
591
|
+
onMouseDown: (b) => {
|
|
592
|
+
b.preventDefault(), d({ key: x, value: w });
|
|
593
|
+
},
|
|
594
|
+
style: {
|
|
595
|
+
padding: "6px 12px",
|
|
596
|
+
cursor: "pointer",
|
|
597
|
+
fontSize: "14px"
|
|
598
|
+
},
|
|
599
|
+
dangerouslySetInnerHTML: { __html: D },
|
|
600
|
+
onMouseEnter: (b) => b.currentTarget.style.background = "#f0f0f0",
|
|
601
|
+
onMouseLeave: (b) => b.currentTarget.style.background = "#fff"
|
|
602
|
+
}
|
|
603
|
+
);
|
|
604
|
+
}) : /* @__PURE__ */ r.createElement("li", { style: { padding: "6px 12px", color: "#999" } }, "No matches")
|
|
916
605
|
) : null;
|
|
917
606
|
};
|
|
918
|
-
function
|
|
919
|
-
return
|
|
607
|
+
function ye(t) {
|
|
608
|
+
return M({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: { id: "Circle_Minus" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { d: "M15,11.5h0a.5.5,0,0,1,0,1H9a.5.5,0,0,1,0-1Z" }, child: [] }, { tag: "path", attr: { d: "M12,21.934A9.933,9.933,0,1,1,21.932,12,9.945,9.945,0,0,1,12,21.934ZM12,3.068A8.933,8.933,0,1,0,20.932,12,8.944,8.944,0,0,0,12,3.068Z" }, child: [] }] }] }] })(t);
|
|
920
609
|
}
|
|
921
|
-
function
|
|
922
|
-
return
|
|
610
|
+
function q(t) {
|
|
611
|
+
return M({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: { id: "Circle_Plus" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { d: "M15,12.5H12.5V15a.5.5,0,0,1-1,0V12.5H9a.5.5,0,0,1,0-1h2.5V9a.5.5,0,0,1,1,0v2.5H15A.5.5,0,0,1,15,12.5Z" }, child: [] }, { tag: "path", attr: { d: "M12,21.932A9.934,9.934,0,1,1,21.932,12,9.944,9.944,0,0,1,12,21.932ZM12,3.065A8.934,8.934,0,1,0,20.932,12,8.944,8.944,0,0,0,12,3.065Z" }, child: [] }] }] }] })(t);
|
|
923
612
|
}
|
|
924
|
-
const
|
|
613
|
+
const Ct = ({
|
|
925
614
|
visible: t,
|
|
926
|
-
x:
|
|
927
|
-
y:
|
|
615
|
+
x: c,
|
|
616
|
+
y: i,
|
|
928
617
|
onAction: d,
|
|
929
|
-
onClose:
|
|
618
|
+
onClose: v
|
|
930
619
|
}) => {
|
|
931
620
|
if (!t) return null;
|
|
932
|
-
const
|
|
933
|
-
top:
|
|
934
|
-
left:
|
|
621
|
+
const y = {
|
|
622
|
+
top: i,
|
|
623
|
+
left: c
|
|
935
624
|
};
|
|
936
|
-
return /* @__PURE__ */
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
] }),
|
|
945
|
-
/* @__PURE__ */ a.jsxs("button", { onClick: () => d("insertColLeft"), children: [
|
|
946
|
-
/* @__PURE__ */ a.jsx(me, {}),
|
|
947
|
-
" Insert col left"
|
|
948
|
-
] }),
|
|
949
|
-
/* @__PURE__ */ a.jsxs("button", { onClick: () => d("insertColRight"), children: [
|
|
950
|
-
/* @__PURE__ */ a.jsx(me, {}),
|
|
951
|
-
" Insert col right"
|
|
952
|
-
] }),
|
|
953
|
-
/* @__PURE__ */ a.jsxs("button", { onClick: () => d("deleteRow"), children: [
|
|
954
|
-
/* @__PURE__ */ a.jsx(Ie, {}),
|
|
955
|
-
" Delete row"
|
|
956
|
-
] }),
|
|
957
|
-
/* @__PURE__ */ a.jsxs("button", { onClick: () => d("deleteCol"), children: [
|
|
958
|
-
/* @__PURE__ */ a.jsx(Ie, {}),
|
|
959
|
-
" Delete column"
|
|
960
|
-
] })
|
|
961
|
-
] });
|
|
962
|
-
}, Mt = ({ html: t, className: s, style: c }) => {
|
|
963
|
-
const d = (f) => {
|
|
964
|
-
const w = f.target;
|
|
965
|
-
if (w.tagName === "A") {
|
|
966
|
-
f.preventDefault();
|
|
967
|
-
const k = w.href;
|
|
968
|
-
k && window.open(k, "_blank", "noopener,noreferrer");
|
|
625
|
+
return /* @__PURE__ */ r.createElement("div", { style: y, className: "rte-table-menu", onMouseLeave: v }, /* @__PURE__ */ r.createElement("button", { onClick: () => d("insertRowAbove") }, /* @__PURE__ */ r.createElement(q, null), " Insert row above"), /* @__PURE__ */ r.createElement("button", { onClick: () => d("insertRowBelow") }, /* @__PURE__ */ r.createElement(q, null), " Insert row below"), /* @__PURE__ */ r.createElement("button", { onClick: () => d("insertColLeft") }, /* @__PURE__ */ r.createElement(q, null), " Insert col left"), /* @__PURE__ */ r.createElement("button", { onClick: () => d("insertColRight") }, /* @__PURE__ */ r.createElement(q, null), " Insert col right"), /* @__PURE__ */ r.createElement("button", { onClick: () => d("deleteRow") }, /* @__PURE__ */ r.createElement(ye, null), " Delete row"), /* @__PURE__ */ r.createElement("button", { onClick: () => d("deleteCol") }, /* @__PURE__ */ r.createElement(ye, null), " Delete column"));
|
|
626
|
+
}, bt = ({ html: t, className: c, style: i }) => {
|
|
627
|
+
const d = (v) => {
|
|
628
|
+
const y = v.target;
|
|
629
|
+
if (y.tagName === "A") {
|
|
630
|
+
v.preventDefault();
|
|
631
|
+
const R = y.href;
|
|
632
|
+
R && window.open(R, "_blank", "noopener,noreferrer");
|
|
969
633
|
}
|
|
970
634
|
};
|
|
971
|
-
return /* @__PURE__ */
|
|
635
|
+
return /* @__PURE__ */ React.createElement(
|
|
972
636
|
"div",
|
|
973
637
|
{
|
|
974
|
-
className: `rte-preview ${
|
|
975
|
-
style:
|
|
638
|
+
className: `rte-preview ${c || ""}`,
|
|
639
|
+
style: i,
|
|
976
640
|
onClick: d,
|
|
977
641
|
dangerouslySetInnerHTML: { __html: t }
|
|
978
642
|
}
|
|
979
643
|
);
|
|
980
|
-
},
|
|
644
|
+
}, xt = ({
|
|
981
645
|
visible: t,
|
|
982
|
-
linkData:
|
|
983
|
-
onClose:
|
|
646
|
+
linkData: c,
|
|
647
|
+
onClose: i,
|
|
984
648
|
onInsert: d
|
|
985
649
|
}) => {
|
|
986
|
-
const [
|
|
987
|
-
if (
|
|
988
|
-
t ? (
|
|
989
|
-
}, [t,
|
|
650
|
+
const [v, y] = N(""), [R, x] = N(""), [w, H] = N(""), [T, L] = N("_self");
|
|
651
|
+
if (B(() => {
|
|
652
|
+
t ? (y(c.url || ""), x(c.text || ""), H(c.title || ""), L(c.target || "_self")) : (y(""), x(""), H(""), L("_self"));
|
|
653
|
+
}, [t, c]), !t) return null;
|
|
990
654
|
const D = () => {
|
|
991
|
-
d({ url:
|
|
655
|
+
d({ url: v, text: R, title: w, target: T });
|
|
992
656
|
};
|
|
993
|
-
return /* @__PURE__ */
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
),
|
|
1039
|
-
/* @__PURE__ */ a.jsxs("div", { className: "rte-link-modal__actions", children: [
|
|
1040
|
-
/* @__PURE__ */ a.jsx("button", { className: "rte-link-modal__btn", onClick: c, children: "Cancel" }),
|
|
1041
|
-
/* @__PURE__ */ a.jsx(
|
|
1042
|
-
"button",
|
|
1043
|
-
{
|
|
1044
|
-
className: "rte-link-modal__btn rte-link-modal__btn--ok",
|
|
1045
|
-
onClick: D,
|
|
1046
|
-
children: "OK"
|
|
1047
|
-
}
|
|
1048
|
-
)
|
|
1049
|
-
] })
|
|
1050
|
-
] })
|
|
1051
|
-
] });
|
|
1052
|
-
}, Pt = ({
|
|
657
|
+
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("div", { className: "rte-link-modal-overlay", onClick: i }), /* @__PURE__ */ r.createElement("div", { className: "rte-link-modal" }, /* @__PURE__ */ r.createElement("h4", { className: "rte-link-modal__title" }, v ? "Edit Link" : "Insert Link"), /* @__PURE__ */ r.createElement(
|
|
658
|
+
"input",
|
|
659
|
+
{
|
|
660
|
+
type: "text",
|
|
661
|
+
className: "rte-link-modal__input",
|
|
662
|
+
placeholder: "URL",
|
|
663
|
+
value: v,
|
|
664
|
+
onChange: (b) => y(b.target.value)
|
|
665
|
+
}
|
|
666
|
+
), /* @__PURE__ */ r.createElement(
|
|
667
|
+
"input",
|
|
668
|
+
{
|
|
669
|
+
type: "text",
|
|
670
|
+
className: "rte-link-modal__input",
|
|
671
|
+
placeholder: "Text to Display",
|
|
672
|
+
value: R,
|
|
673
|
+
onChange: (b) => x(b.target.value)
|
|
674
|
+
}
|
|
675
|
+
), /* @__PURE__ */ r.createElement(
|
|
676
|
+
"input",
|
|
677
|
+
{
|
|
678
|
+
type: "text",
|
|
679
|
+
className: "rte-link-modal__input",
|
|
680
|
+
placeholder: "Title",
|
|
681
|
+
value: w,
|
|
682
|
+
onChange: (b) => H(b.target.value)
|
|
683
|
+
}
|
|
684
|
+
), /* @__PURE__ */ r.createElement(
|
|
685
|
+
"select",
|
|
686
|
+
{
|
|
687
|
+
className: "rte-link-modal__select",
|
|
688
|
+
value: T,
|
|
689
|
+
onChange: (b) => L(b.target.value)
|
|
690
|
+
},
|
|
691
|
+
/* @__PURE__ */ r.createElement("option", { value: "_self" }, "Same tab"),
|
|
692
|
+
/* @__PURE__ */ r.createElement("option", { value: "_blank" }, "New tab")
|
|
693
|
+
), /* @__PURE__ */ r.createElement("div", { className: "rte-link-modal__actions" }, /* @__PURE__ */ r.createElement("button", { className: "rte-link-modal__btn", onClick: i }, "Cancel"), /* @__PURE__ */ r.createElement(
|
|
694
|
+
"button",
|
|
695
|
+
{
|
|
696
|
+
className: "rte-link-modal__btn rte-link-modal__btn--ok",
|
|
697
|
+
onClick: D
|
|
698
|
+
},
|
|
699
|
+
"OK"
|
|
700
|
+
))));
|
|
701
|
+
}, Mt = ({
|
|
1053
702
|
atSuggestions: t = [],
|
|
1054
|
-
showOutput:
|
|
1055
|
-
showPreview:
|
|
703
|
+
showOutput: c = !1,
|
|
704
|
+
showPreview: i = !1,
|
|
1056
705
|
toolbarConfig: d = {
|
|
1057
706
|
link: !1,
|
|
1058
707
|
image: !1,
|
|
@@ -1063,20 +712,20 @@ const At = ({
|
|
|
1063
712
|
fontSize: !1,
|
|
1064
713
|
highlight: !1
|
|
1065
714
|
},
|
|
1066
|
-
classNames:
|
|
1067
|
-
styles:
|
|
1068
|
-
handleGetHtml:
|
|
715
|
+
classNames: v = {},
|
|
716
|
+
styles: y = {},
|
|
717
|
+
handleGetHtml: R = () => {
|
|
1069
718
|
}
|
|
1070
719
|
}) => {
|
|
1071
|
-
var
|
|
1072
|
-
const
|
|
720
|
+
var ce, ie, se, de, ue, me, he, ge;
|
|
721
|
+
const x = _(null), [w, H] = N("<p>Always bet on Prime!</p>"), [T, L] = N(!1), [D, b] = N({ x: 0, y: 0 }), [X, j] = N(
|
|
1073
722
|
[]
|
|
1074
|
-
),
|
|
723
|
+
), S = _(null), P = _(null), [A, F] = N({ visible: !1, x: 0, y: 0 }), [V, m] = N(!1), E = _(null), [$, G] = N({
|
|
1075
724
|
url: "",
|
|
1076
725
|
text: "",
|
|
1077
726
|
title: "",
|
|
1078
727
|
target: "_self"
|
|
1079
|
-
}),
|
|
728
|
+
}), xe = {
|
|
1080
729
|
bold: !0,
|
|
1081
730
|
italic: !0,
|
|
1082
731
|
underline: !0,
|
|
@@ -1084,228 +733,228 @@ const At = ({
|
|
|
1084
733
|
unorderedList: !0,
|
|
1085
734
|
orderedList: !0,
|
|
1086
735
|
align: !0,
|
|
1087
|
-
link: (
|
|
1088
|
-
image: (
|
|
1089
|
-
emoji: (
|
|
1090
|
-
table: (
|
|
1091
|
-
color: (
|
|
1092
|
-
fontFamily: (
|
|
1093
|
-
fontSize: (
|
|
1094
|
-
highlight: (
|
|
1095
|
-
}, [
|
|
1096
|
-
var
|
|
1097
|
-
|
|
1098
|
-
const e =
|
|
1099
|
-
|
|
1100
|
-
},
|
|
736
|
+
link: (ce = d.link) != null ? ce : !1,
|
|
737
|
+
image: (ie = d.image) != null ? ie : !1,
|
|
738
|
+
emoji: (se = d.emoji) != null ? se : !1,
|
|
739
|
+
table: (de = d.table) != null ? de : !1,
|
|
740
|
+
color: (ue = d.color) != null ? ue : !1,
|
|
741
|
+
fontFamily: (me = d.fontFamily) != null ? me : !1,
|
|
742
|
+
fontSize: (he = d.fontSize) != null ? he : !1,
|
|
743
|
+
highlight: (ge = d.fontSize) != null ? ge : !1
|
|
744
|
+
}, [Re, ee] = N(""), O = () => x.current, z = () => {
|
|
745
|
+
var n, o;
|
|
746
|
+
H((o = (n = O()) == null ? void 0 : n.innerHTML) != null ? o : "");
|
|
747
|
+
const e = ae();
|
|
748
|
+
R == null || R(e);
|
|
749
|
+
}, te = () => {
|
|
1101
750
|
const e = window.getSelection();
|
|
1102
|
-
e != null && e.rangeCount && (
|
|
1103
|
-
},
|
|
751
|
+
e != null && e.rangeCount && (S.current = e.getRangeAt(0));
|
|
752
|
+
}, I = () => {
|
|
1104
753
|
const e = window.getSelection();
|
|
1105
|
-
e &&
|
|
1106
|
-
},
|
|
754
|
+
e && S.current && (e.removeAllRanges(), e.addRange(S.current));
|
|
755
|
+
}, Le = (e, n) => {
|
|
1107
756
|
const o = window.getSelection();
|
|
1108
|
-
o && o.rangeCount > 0 && (
|
|
757
|
+
o && o.rangeCount > 0 && (S.current = o.getRangeAt(0)), I(), document.execCommand(e, !1, n), z();
|
|
1109
758
|
};
|
|
1110
|
-
|
|
1111
|
-
const e =
|
|
1112
|
-
e && !e.innerHTML && (e.innerHTML =
|
|
1113
|
-
}, []),
|
|
759
|
+
B(() => {
|
|
760
|
+
const e = O();
|
|
761
|
+
e && !e.innerHTML && (e.innerHTML = w), z();
|
|
762
|
+
}, []), B(() => () => {
|
|
1114
763
|
document.removeEventListener("mousemove", null), document.removeEventListener("mouseup", null);
|
|
1115
764
|
}, []);
|
|
1116
|
-
const
|
|
765
|
+
const ne = (e) => {
|
|
1117
766
|
for (; e && e.nodeName !== "LI"; )
|
|
1118
767
|
e = e.parentNode;
|
|
1119
768
|
return e;
|
|
1120
|
-
},
|
|
1121
|
-
let
|
|
769
|
+
}, Me = (e) => {
|
|
770
|
+
let n = 0, o = e.parentElement;
|
|
1122
771
|
for (; o; )
|
|
1123
|
-
(o.tagName === "UL" || o.tagName === "OL") &&
|
|
1124
|
-
return
|
|
1125
|
-
},
|
|
1126
|
-
const
|
|
772
|
+
(o.tagName === "UL" || o.tagName === "OL") && n++, o = o.parentElement;
|
|
773
|
+
return n;
|
|
774
|
+
}, ze = (e) => {
|
|
775
|
+
const n = e.querySelector("li"), o = n ? Me(n) : 1;
|
|
1127
776
|
if (e.querySelector("[data-hidden-array-start]")) return;
|
|
1128
|
-
const l = `{{#arrayData${o > 1 ? o : ""}}}`,
|
|
1129
|
-
|
|
1130
|
-
const
|
|
1131
|
-
|
|
1132
|
-
},
|
|
1133
|
-
var
|
|
1134
|
-
const
|
|
1135
|
-
if (!(
|
|
1136
|
-
const o =
|
|
1137
|
-
let
|
|
777
|
+
const l = `{{#arrayData${o > 1 ? o : ""}}}`, h = `{{/arrayData${o > 1 ? o : ""}}}`, a = document.createElement("span");
|
|
778
|
+
a.textContent = l, a.style.display = "none", a.setAttribute("data-hidden-array-start", "true"), e.insertBefore(a, e.firstChild);
|
|
779
|
+
const s = document.createElement("span");
|
|
780
|
+
s.textContent = h, s.style.display = "none", s.setAttribute("data-hidden-array-end", "true"), e.appendChild(s);
|
|
781
|
+
}, re = (e) => {
|
|
782
|
+
var p;
|
|
783
|
+
const n = window.getSelection();
|
|
784
|
+
if (!(n != null && n.rangeCount)) return;
|
|
785
|
+
const o = n.getRangeAt(0), l = ne(o.startContainer);
|
|
786
|
+
let h, a;
|
|
1138
787
|
if (l) {
|
|
1139
|
-
let
|
|
1140
|
-
|
|
788
|
+
let u = l.querySelector(e);
|
|
789
|
+
u || (u = document.createElement(e), u.style.margin = "0", u.style.paddingLeft = "20px", l.appendChild(u)), a = u, h = document.createElement("li"), h.textContent = "", a.appendChild(h);
|
|
1141
790
|
} else {
|
|
1142
791
|
document.execCommand(
|
|
1143
792
|
e === "ul" ? "insertUnorderedList" : "insertOrderedList"
|
|
1144
793
|
);
|
|
1145
|
-
const
|
|
1146
|
-
if (
|
|
1147
|
-
|
|
794
|
+
const u = O();
|
|
795
|
+
if (a = u == null ? void 0 : u.querySelector(`${e}:last-child`), !a) return;
|
|
796
|
+
h = a.querySelector("li:last-child");
|
|
1148
797
|
}
|
|
1149
|
-
|
|
1150
|
-
const
|
|
1151
|
-
|
|
1152
|
-
},
|
|
1153
|
-
e === "insertOrderedList" ?
|
|
1154
|
-
},
|
|
1155
|
-
const
|
|
1156
|
-
|
|
1157
|
-
const o =
|
|
1158
|
-
|
|
1159
|
-
},
|
|
798
|
+
ze(a);
|
|
799
|
+
const s = document.createRange();
|
|
800
|
+
s.setStart(h, 0), s.collapse(!0), n.removeAllRanges(), n.addRange(s), (p = O()) == null || p.focus(), z();
|
|
801
|
+
}, U = (e, n) => {
|
|
802
|
+
e === "insertOrderedList" ? re("ol") : e === "insertUnorderedList" ? re("ul") : Le(e, n), e === "insertTable" && He();
|
|
803
|
+
}, Se = (e) => {
|
|
804
|
+
const n = document.createElement("span");
|
|
805
|
+
n.textContent = "", e.insertNode(n), e.setStartAfter(n), e.collapse(!0);
|
|
806
|
+
const o = n.getBoundingClientRect();
|
|
807
|
+
n.remove(), b({ x: o.left, y: o.bottom + window.scrollY }), j(t || []), L(!0), P.current = e.cloneRange();
|
|
808
|
+
}, ke = () => {
|
|
1160
809
|
const e = window.getSelection();
|
|
1161
810
|
if (!e || e.rangeCount === 0) return null;
|
|
1162
|
-
const
|
|
811
|
+
const n = e.anchorNode;
|
|
1163
812
|
let o = e.anchorOffset;
|
|
1164
|
-
if (!
|
|
1165
|
-
let l =
|
|
1166
|
-
for (l.nodeType !== Node.TEXT_NODE && (l.childNodes && l.childNodes[o] ? l = l.childNodes[o] : l =
|
|
813
|
+
if (!n) return null;
|
|
814
|
+
let l = n;
|
|
815
|
+
for (l.nodeType !== Node.TEXT_NODE && (l.childNodes && l.childNodes[o] ? l = l.childNodes[o] : l = n.previousSibling); l; ) {
|
|
1167
816
|
if (l.nodeType === Node.TEXT_NODE) {
|
|
1168
|
-
const
|
|
1169
|
-
if (
|
|
1170
|
-
const
|
|
1171
|
-
return
|
|
817
|
+
const h = l.textContent || "", a = l === n ? o : h.length, s = h.lastIndexOf("@", a - 1);
|
|
818
|
+
if (s !== -1) {
|
|
819
|
+
const p = document.createRange();
|
|
820
|
+
return p.setStart(l, s), p.setEnd(l, a), p;
|
|
1172
821
|
}
|
|
1173
822
|
}
|
|
1174
823
|
l = l.previousSibling;
|
|
1175
824
|
}
|
|
1176
825
|
return null;
|
|
1177
|
-
},
|
|
1178
|
-
var
|
|
1179
|
-
const
|
|
1180
|
-
if (!
|
|
1181
|
-
const o =
|
|
1182
|
-
o ? (
|
|
826
|
+
}, Ne = (e) => {
|
|
827
|
+
var h;
|
|
828
|
+
const n = window.getSelection();
|
|
829
|
+
if (!n) return;
|
|
830
|
+
const o = ke();
|
|
831
|
+
o ? (n.removeAllRanges(), n.addRange(o)) : P.current && (n.removeAllRanges(), n.addRange(P.current));
|
|
1183
832
|
const l = document.createElement("span");
|
|
1184
833
|
l.textContent = `{{${e.key}}}`, l.style.color = "#007bff", l.style.display = "inline", l.contentEditable = "false", l.setAttribute("data-mention", e.value || e.key || "");
|
|
1185
834
|
try {
|
|
1186
|
-
const
|
|
1187
|
-
if (
|
|
1188
|
-
|
|
835
|
+
const a = n.rangeCount ? n.getRangeAt(0) : null;
|
|
836
|
+
if (a)
|
|
837
|
+
a.deleteContents(), a.insertNode(l);
|
|
1189
838
|
else {
|
|
1190
|
-
const
|
|
1191
|
-
|
|
839
|
+
const u = document.createRange(), f = O();
|
|
840
|
+
u.selectNodeContents(f), u.collapse(!1), u.insertNode(l);
|
|
1192
841
|
}
|
|
1193
|
-
const
|
|
1194
|
-
l.after(
|
|
1195
|
-
const
|
|
1196
|
-
|
|
1197
|
-
} catch (
|
|
1198
|
-
console.error("insertMention error:",
|
|
842
|
+
const s = document.createTextNode(" ");
|
|
843
|
+
l.after(s);
|
|
844
|
+
const p = document.createRange();
|
|
845
|
+
p.setStartAfter(s), p.collapse(!0), n.removeAllRanges(), n.addRange(p);
|
|
846
|
+
} catch (a) {
|
|
847
|
+
console.error("insertMention error:", a);
|
|
1199
848
|
}
|
|
1200
|
-
|
|
1201
|
-
},
|
|
1202
|
-
var o, l,
|
|
1203
|
-
const
|
|
1204
|
-
if ((e.ctrlKey || e.metaKey) && ["b", "i", "u"].includes(
|
|
1205
|
-
|
|
849
|
+
L(!1), (h = O()) == null || h.focus(), z();
|
|
850
|
+
}, Ae = (e) => {
|
|
851
|
+
var o, l, h;
|
|
852
|
+
const n = e.key.toLowerCase();
|
|
853
|
+
if ((e.ctrlKey || e.metaKey) && ["b", "i", "u"].includes(n) && (e.preventDefault(), U(
|
|
854
|
+
n === "b" ? "bold" : n === "i" ? "italic" : n === "u" ? "underline" : ""
|
|
1206
855
|
)), e.shiftKey && e.key === "2" && e.preventDefault(), e.key === "Enter") {
|
|
1207
|
-
const
|
|
1208
|
-
if (!
|
|
1209
|
-
if (((o =
|
|
856
|
+
const a = window.getSelection(), s = a != null && a.anchorNode ? ne(a.anchorNode) : null;
|
|
857
|
+
if (!s) return;
|
|
858
|
+
if (((o = s.textContent) == null ? void 0 : o.replace(/\u200B/g, "").trim()) === "") {
|
|
1210
859
|
e.preventDefault();
|
|
1211
|
-
const
|
|
1212
|
-
if (
|
|
1213
|
-
|
|
860
|
+
const u = s.parentElement, f = u == null ? void 0 : u.closest("li");
|
|
861
|
+
if (f) {
|
|
862
|
+
u == null || u.removeChild(s);
|
|
1214
863
|
const g = document.createElement("p");
|
|
1215
|
-
g.innerHTML = "<br />", (l =
|
|
1216
|
-
const
|
|
1217
|
-
|
|
864
|
+
g.innerHTML = "<br />", (l = f.parentElement) == null || l.insertBefore(g, f.nextSibling);
|
|
865
|
+
const C = document.createRange();
|
|
866
|
+
C.setStart(g, 0), C.collapse(!0), a == null || a.removeAllRanges(), a == null || a.addRange(C);
|
|
1218
867
|
} else {
|
|
1219
|
-
const g =
|
|
868
|
+
const g = s.closest("ul, ol");
|
|
1220
869
|
if (g) {
|
|
1221
|
-
const
|
|
1222
|
-
|
|
1223
|
-
const
|
|
1224
|
-
|
|
870
|
+
const C = document.createElement("p");
|
|
871
|
+
C.innerHTML = "<br />", (h = g.parentElement) == null || h.insertBefore(C, g.nextSibling), g.removeChild(s);
|
|
872
|
+
const k = document.createRange();
|
|
873
|
+
k.setStart(C, 0), k.collapse(!0), a == null || a.removeAllRanges(), a == null || a.addRange(k);
|
|
1225
874
|
}
|
|
1226
875
|
}
|
|
1227
|
-
|
|
876
|
+
z();
|
|
1228
877
|
}
|
|
1229
878
|
}
|
|
1230
|
-
},
|
|
879
|
+
}, Te = (e) => {
|
|
1231
880
|
if (e.data === "@") {
|
|
1232
881
|
const o = window.getSelection();
|
|
1233
882
|
if (!(o != null && o.rangeCount)) return;
|
|
1234
883
|
setTimeout(() => {
|
|
1235
|
-
|
|
884
|
+
Se(o.getRangeAt(0)), ee(""), j(t), L(!0);
|
|
1236
885
|
}, 0);
|
|
1237
886
|
return;
|
|
1238
887
|
}
|
|
1239
|
-
if (
|
|
1240
|
-
setTimeout(() =>
|
|
888
|
+
if (T) {
|
|
889
|
+
setTimeout(() => oe(), 0);
|
|
1241
890
|
return;
|
|
1242
891
|
}
|
|
1243
|
-
},
|
|
1244
|
-
if (
|
|
892
|
+
}, oe = () => {
|
|
893
|
+
if (z(), !T) return;
|
|
1245
894
|
const e = window.getSelection();
|
|
1246
895
|
if (!e || !e.anchorNode) return;
|
|
1247
896
|
const o = (e.anchorNode.textContent || "").match(/@([a-zA-Z0-9_]*)$/);
|
|
1248
897
|
if (!o) {
|
|
1249
|
-
|
|
898
|
+
L(!1);
|
|
1250
899
|
return;
|
|
1251
900
|
}
|
|
1252
901
|
const l = o[1].toLowerCase();
|
|
1253
|
-
|
|
1254
|
-
const
|
|
1255
|
-
|
|
1256
|
-
},
|
|
902
|
+
ee(l);
|
|
903
|
+
const h = t.filter((a) => a.key.toLowerCase().includes(l));
|
|
904
|
+
j(h);
|
|
905
|
+
}, De = (e) => {
|
|
1257
906
|
var l;
|
|
1258
|
-
const
|
|
1259
|
-
if (!
|
|
907
|
+
const n = (l = e.target.files) == null ? void 0 : l[0];
|
|
908
|
+
if (!n) return;
|
|
1260
909
|
const o = new FileReader();
|
|
1261
|
-
o.onload = (
|
|
1262
|
-
var
|
|
1263
|
-
const
|
|
1264
|
-
|
|
1265
|
-
const
|
|
1266
|
-
let
|
|
1267
|
-
const
|
|
1268
|
-
|
|
1269
|
-
const
|
|
1270
|
-
if (!
|
|
1271
|
-
|
|
1272
|
-
const
|
|
1273
|
-
|
|
1274
|
-
const
|
|
1275
|
-
|
|
910
|
+
o.onload = (h) => {
|
|
911
|
+
var k;
|
|
912
|
+
const a = (k = h.target) == null ? void 0 : k.result;
|
|
913
|
+
I();
|
|
914
|
+
const s = window.getSelection();
|
|
915
|
+
let p = s && s.rangeCount ? s.getRangeAt(0) : null;
|
|
916
|
+
const u = document.createElement("img");
|
|
917
|
+
u.src = a, u.alt = n.name || "image", u.className = "rte-inserted-image", u.contentEditable = "true";
|
|
918
|
+
const f = O();
|
|
919
|
+
if (!p || !f) {
|
|
920
|
+
f == null || f.appendChild(u);
|
|
921
|
+
const pe = document.createTextNode(" ");
|
|
922
|
+
f == null || f.appendChild(pe);
|
|
923
|
+
const Z = document.createRange();
|
|
924
|
+
Z.setStartAfter(pe), Z.collapse(!0), s == null || s.removeAllRanges(), s == null || s.addRange(Z), f == null || f.focus(), z(), e.target.value = "";
|
|
1276
925
|
return;
|
|
1277
926
|
}
|
|
1278
|
-
|
|
927
|
+
p.deleteContents(), p.insertNode(u);
|
|
1279
928
|
const g = document.createTextNode(" ");
|
|
1280
|
-
|
|
1281
|
-
const
|
|
1282
|
-
|
|
1283
|
-
}, o.readAsDataURL(
|
|
1284
|
-
},
|
|
1285
|
-
var
|
|
1286
|
-
|
|
1287
|
-
const
|
|
1288
|
-
if (!(
|
|
1289
|
-
const o =
|
|
1290
|
-
o.insertNode(l), o.setStartAfter(l), o.collapse(!0),
|
|
1291
|
-
},
|
|
1292
|
-
|
|
929
|
+
u.after(g);
|
|
930
|
+
const C = document.createRange();
|
|
931
|
+
C.setStartAfter(g), C.collapse(!0), s.removeAllRanges(), s.addRange(C), f.focus(), z(), e.target.value = "";
|
|
932
|
+
}, o.readAsDataURL(n);
|
|
933
|
+
}, Oe = (e) => {
|
|
934
|
+
var h;
|
|
935
|
+
I();
|
|
936
|
+
const n = window.getSelection();
|
|
937
|
+
if (!(n != null && n.rangeCount)) return;
|
|
938
|
+
const o = n.getRangeAt(0), l = document.createTextNode(e);
|
|
939
|
+
o.insertNode(l), o.setStartAfter(l), o.collapse(!0), n.removeAllRanges(), n.addRange(o), (h = O()) == null || h.focus(), z();
|
|
940
|
+
}, He = () => {
|
|
941
|
+
I();
|
|
1293
942
|
const e = document.createElement("table");
|
|
1294
943
|
e.style.borderCollapse = "collapse", e.style.width = "100%", e.style.border = "1px solid #ccc", e.style.margin = "8px 0", e.style.position = "relative";
|
|
1295
|
-
const
|
|
1296
|
-
for (let
|
|
1297
|
-
const
|
|
1298
|
-
|
|
1299
|
-
const
|
|
1300
|
-
|
|
944
|
+
const n = document.createElement("thead"), o = document.createElement("tbody"), l = document.createElement("tr"), h = document.createElement("tr");
|
|
945
|
+
for (let p = 0; p < 2; p++) {
|
|
946
|
+
const u = document.createElement("th");
|
|
947
|
+
u.textContent = `Header ${p + 1}`, u.style.border = "1px solid #999", u.style.padding = "8px", u.style.position = "relative";
|
|
948
|
+
const f = document.createElement("td");
|
|
949
|
+
f.textContent = `Row 1 Col ${p + 1}`, f.style.border = "1px solid #999", f.style.padding = "8px", f.style.position = "relative", Y(u), Y(f), l.appendChild(u), h.appendChild(f);
|
|
1301
950
|
}
|
|
1302
|
-
|
|
1303
|
-
const
|
|
1304
|
-
if (!(
|
|
1305
|
-
|
|
1306
|
-
},
|
|
1307
|
-
const
|
|
1308
|
-
Object.assign(
|
|
951
|
+
n.appendChild(l), o.appendChild(h), e.appendChild(n), e.appendChild(o), Ie(e), _e(e);
|
|
952
|
+
const a = window.getSelection();
|
|
953
|
+
if (!(a != null && a.rangeCount)) return;
|
|
954
|
+
a.getRangeAt(0).insertNode(e), z();
|
|
955
|
+
}, _e = (e) => {
|
|
956
|
+
const n = document.createElement("div");
|
|
957
|
+
Object.assign(n.style, {
|
|
1309
958
|
position: "absolute",
|
|
1310
959
|
width: "14px",
|
|
1311
960
|
height: "14px",
|
|
@@ -1316,22 +965,22 @@ const At = ({
|
|
|
1316
965
|
zIndex: "20",
|
|
1317
966
|
borderRadius: "2px"
|
|
1318
967
|
});
|
|
1319
|
-
let o = 0, l = 0,
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
const
|
|
1323
|
-
|
|
1324
|
-
const
|
|
1325
|
-
const
|
|
1326
|
-
e.style.width = `${
|
|
1327
|
-
},
|
|
1328
|
-
document.removeEventListener("mousemove",
|
|
968
|
+
let o = 0, l = 0, h = 0, a = 0;
|
|
969
|
+
n.addEventListener("mousedown", (s) => {
|
|
970
|
+
s.preventDefault(), o = s.clientX, l = s.clientY;
|
|
971
|
+
const p = e.getBoundingClientRect();
|
|
972
|
+
h = p.width, a = p.height;
|
|
973
|
+
const u = (g) => {
|
|
974
|
+
const C = Math.max(100, h + (g.clientX - o)), k = Math.max(60, a + (g.clientY - l));
|
|
975
|
+
e.style.width = `${C}px`, e.style.height = `${k}px`, z();
|
|
976
|
+
}, f = () => {
|
|
977
|
+
document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", f), z();
|
|
1329
978
|
};
|
|
1330
|
-
document.addEventListener("mousemove",
|
|
1331
|
-
}), e.appendChild(
|
|
1332
|
-
},
|
|
1333
|
-
const
|
|
1334
|
-
Object.assign(
|
|
979
|
+
document.addEventListener("mousemove", u), document.addEventListener("mouseup", f);
|
|
980
|
+
}), e.appendChild(n);
|
|
981
|
+
}, Y = (e) => {
|
|
982
|
+
const n = document.createElement("div"), o = document.createElement("div");
|
|
983
|
+
Object.assign(n.style, {
|
|
1335
984
|
position: "absolute",
|
|
1336
985
|
right: "0",
|
|
1337
986
|
top: "0",
|
|
@@ -1349,257 +998,246 @@ const At = ({
|
|
|
1349
998
|
cursor: "row-resize",
|
|
1350
999
|
background: "rgba(0,0,0,0.15)",
|
|
1351
1000
|
zIndex: "10"
|
|
1352
|
-
}),
|
|
1353
|
-
},
|
|
1354
|
-
let l = 0,
|
|
1355
|
-
|
|
1356
|
-
g.preventDefault(), l = g.clientX,
|
|
1001
|
+
}), je(e, n, o), e.appendChild(n), e.appendChild(o);
|
|
1002
|
+
}, je = (e, n, o) => {
|
|
1003
|
+
let l = 0, h = 0, a = 0, s = 0;
|
|
1004
|
+
n.addEventListener("mousedown", (g) => {
|
|
1005
|
+
g.preventDefault(), l = g.clientX, a = e.offsetWidth, document.addEventListener("mousemove", p), document.addEventListener("mouseup", f);
|
|
1357
1006
|
}), o.addEventListener("mousedown", (g) => {
|
|
1358
|
-
g.preventDefault(),
|
|
1007
|
+
g.preventDefault(), h = g.clientY, s = e.offsetHeight, document.addEventListener("mousemove", u), document.addEventListener("mouseup", f);
|
|
1359
1008
|
});
|
|
1360
|
-
const
|
|
1361
|
-
const
|
|
1362
|
-
e.style.width = `${Math.max(30,
|
|
1363
|
-
},
|
|
1364
|
-
const
|
|
1365
|
-
e.style.height = `${Math.max(20,
|
|
1366
|
-
},
|
|
1367
|
-
document.removeEventListener("mousemove",
|
|
1009
|
+
const p = (g) => {
|
|
1010
|
+
const C = a + (g.clientX - l);
|
|
1011
|
+
e.style.width = `${Math.max(30, C)}px`;
|
|
1012
|
+
}, u = (g) => {
|
|
1013
|
+
const C = s + (g.clientY - h);
|
|
1014
|
+
e.style.height = `${Math.max(20, C)}px`;
|
|
1015
|
+
}, f = () => {
|
|
1016
|
+
document.removeEventListener("mousemove", p), document.removeEventListener("mousemove", u), document.removeEventListener("mouseup", f);
|
|
1368
1017
|
};
|
|
1369
|
-
},
|
|
1018
|
+
}, Fe = (e) => {
|
|
1370
1019
|
const o = e.target.closest("td, th");
|
|
1371
|
-
o && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((l) => l.classList.remove("rte-cell-highlight")), o.classList.add("rte-cell-highlight"),
|
|
1372
|
-
},
|
|
1020
|
+
o && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((l) => l.classList.remove("rte-cell-highlight")), o.classList.add("rte-cell-highlight"), F({ visible: !0, x: e.clientX, y: e.clientY, cell: o }));
|
|
1021
|
+
}, le = () => {
|
|
1373
1022
|
document.querySelectorAll(".rte-cell-highlight").forEach((e) => e.classList.remove("rte-cell-highlight"));
|
|
1374
|
-
},
|
|
1375
|
-
if (!
|
|
1376
|
-
const
|
|
1377
|
-
const
|
|
1378
|
-
return
|
|
1023
|
+
}, Pe = (e) => {
|
|
1024
|
+
if (!A.cell) return;
|
|
1025
|
+
const n = A.cell.closest("table"), o = A.cell.cellIndex, l = A.cell.parentElement.rowIndex, h = (a) => {
|
|
1026
|
+
const s = a.tagName.toLowerCase(), p = document.createElement(s);
|
|
1027
|
+
return p.textContent = a.textContent || "", p.style.cssText = a.style.cssText, Y(p), p;
|
|
1379
1028
|
};
|
|
1380
1029
|
switch (e) {
|
|
1381
1030
|
case "insertRowAbove": {
|
|
1382
|
-
const
|
|
1383
|
-
Array.from(
|
|
1384
|
-
|
|
1031
|
+
const a = n.rows[l], s = n.insertRow(l);
|
|
1032
|
+
Array.from(a.cells).forEach((p) => {
|
|
1033
|
+
s.appendChild(h(p));
|
|
1385
1034
|
});
|
|
1386
1035
|
break;
|
|
1387
1036
|
}
|
|
1388
1037
|
case "insertRowBelow": {
|
|
1389
|
-
const
|
|
1390
|
-
Array.from(
|
|
1391
|
-
|
|
1038
|
+
const a = n.rows[l], s = n.insertRow(l + 1);
|
|
1039
|
+
Array.from(a.cells).forEach((p) => {
|
|
1040
|
+
s.appendChild(h(p));
|
|
1392
1041
|
});
|
|
1393
1042
|
break;
|
|
1394
1043
|
}
|
|
1395
1044
|
case "insertColLeft": {
|
|
1396
|
-
Array.from(
|
|
1397
|
-
const
|
|
1398
|
-
|
|
1045
|
+
Array.from(n.rows).forEach((a) => {
|
|
1046
|
+
const s = a.cells[o];
|
|
1047
|
+
a.insertBefore(h(s), s);
|
|
1399
1048
|
});
|
|
1400
1049
|
break;
|
|
1401
1050
|
}
|
|
1402
1051
|
case "insertColRight": {
|
|
1403
|
-
Array.from(
|
|
1404
|
-
const
|
|
1405
|
-
|
|
1052
|
+
Array.from(n.rows).forEach((a) => {
|
|
1053
|
+
const s = a.cells[o];
|
|
1054
|
+
a.insertBefore(h(s), s.nextSibling);
|
|
1406
1055
|
});
|
|
1407
1056
|
break;
|
|
1408
1057
|
}
|
|
1409
1058
|
case "deleteRow":
|
|
1410
|
-
|
|
1059
|
+
n.rows.length > 1 && n.deleteRow(l);
|
|
1411
1060
|
break;
|
|
1412
1061
|
case "deleteCol":
|
|
1413
|
-
Array.from(
|
|
1414
|
-
|
|
1062
|
+
Array.from(n.rows).forEach((a) => {
|
|
1063
|
+
a.cells[o] && a.deleteCell(o);
|
|
1415
1064
|
});
|
|
1416
1065
|
break;
|
|
1417
1066
|
}
|
|
1418
|
-
|
|
1419
|
-
},
|
|
1420
|
-
const
|
|
1421
|
-
if (!
|
|
1067
|
+
z(), F(J(Q({}, A), { visible: !1 })), le();
|
|
1068
|
+
}, Ie = (e) => {
|
|
1069
|
+
const n = e.querySelector("tbody");
|
|
1070
|
+
if (!n || n.querySelector("[data-hidden-table-start]")) return;
|
|
1422
1071
|
const o = document.createElement("span");
|
|
1423
|
-
o.textContent = "{{#tableData}}", o.style.display = "none", o.setAttribute("data-hidden-table-start", "true"),
|
|
1072
|
+
o.textContent = "{{#tableData}}", o.style.display = "none", o.setAttribute("data-hidden-table-start", "true"), n.insertBefore(o, n.firstChild);
|
|
1424
1073
|
const l = document.createElement("span");
|
|
1425
|
-
l.textContent = "{{/tableData}}", l.style.display = "none", l.setAttribute("data-hidden-table-end", "true"),
|
|
1426
|
-
},
|
|
1427
|
-
const e =
|
|
1428
|
-
if (!e) return
|
|
1429
|
-
const
|
|
1430
|
-
return
|
|
1074
|
+
l.textContent = "{{/tableData}}", l.style.display = "none", l.setAttribute("data-hidden-table-end", "true"), n.appendChild(l);
|
|
1075
|
+
}, ae = () => {
|
|
1076
|
+
const e = O();
|
|
1077
|
+
if (!e) return w;
|
|
1078
|
+
const n = e.cloneNode(!0);
|
|
1079
|
+
return n.querySelectorAll(".rte-cell-highlight").forEach((o) => {
|
|
1431
1080
|
o.classList.remove("rte-cell-highlight");
|
|
1432
|
-
}),
|
|
1081
|
+
}), n.querySelectorAll("div").forEach((o) => {
|
|
1433
1082
|
(o.style.cursor === "col-resize" || o.style.cursor === "row-resize" || o.style.cursor === "nwse-resize") && o.remove();
|
|
1434
|
-
}),
|
|
1435
|
-
},
|
|
1436
|
-
|
|
1437
|
-
},
|
|
1438
|
-
const
|
|
1439
|
-
if (!
|
|
1440
|
-
|
|
1083
|
+
}), n.innerHTML;
|
|
1084
|
+
}, Be = () => {
|
|
1085
|
+
te(), E.current = S.current, G({ url: "", text: "", title: "", target: "_self" }), m(!0);
|
|
1086
|
+
}, Ve = (e) => {
|
|
1087
|
+
const n = window.getSelection();
|
|
1088
|
+
if (!n || !E.current) return;
|
|
1089
|
+
n.removeAllRanges(), n.addRange(E.current);
|
|
1441
1090
|
let o = e.url.trim();
|
|
1442
1091
|
/^https?:\/\//i.test(o) || (o = "https://" + o);
|
|
1443
1092
|
const l = document.createElement("a");
|
|
1444
1093
|
l.href = o, l.style.cursor = "pointer", l.style.outline = "none", l.textContent = e.text || o, l.title = e.title, l.target = e.target, l.contentEditable = "true";
|
|
1445
|
-
const
|
|
1446
|
-
|
|
1447
|
-
const
|
|
1448
|
-
l.after(
|
|
1449
|
-
const
|
|
1450
|
-
|
|
1451
|
-
},
|
|
1452
|
-
const
|
|
1453
|
-
if (
|
|
1454
|
-
const o =
|
|
1094
|
+
const h = n.getRangeAt(0);
|
|
1095
|
+
h.deleteContents(), h.insertNode(l);
|
|
1096
|
+
const a = document.createTextNode(" ");
|
|
1097
|
+
l.after(a);
|
|
1098
|
+
const s = document.createRange();
|
|
1099
|
+
s.setStartAfter(a), s.collapse(!0), n.removeAllRanges(), n.addRange(s), m(!1), z();
|
|
1100
|
+
}, $e = (e) => {
|
|
1101
|
+
const n = e.target;
|
|
1102
|
+
if (n.tagName === "A") {
|
|
1103
|
+
const o = n;
|
|
1455
1104
|
if (e.ctrlKey || e.metaKey) {
|
|
1456
1105
|
window.open(o.href, "_blank", "noopener,noreferrer");
|
|
1457
1106
|
return;
|
|
1458
1107
|
}
|
|
1459
1108
|
e.preventDefault();
|
|
1460
1109
|
const l = document.createRange();
|
|
1461
|
-
l.selectNode(o),
|
|
1110
|
+
l.selectNode(o), E.current = l, G({
|
|
1462
1111
|
url: o.href,
|
|
1463
1112
|
text: o.textContent || o.href,
|
|
1464
1113
|
title: o.title,
|
|
1465
1114
|
target: o.target
|
|
1466
|
-
}),
|
|
1115
|
+
}), m(!0);
|
|
1467
1116
|
}
|
|
1468
|
-
},
|
|
1469
|
-
const e =
|
|
1117
|
+
}, Ue = () => {
|
|
1118
|
+
const e = O();
|
|
1470
1119
|
if (!e) return;
|
|
1471
|
-
const
|
|
1472
|
-
if ((!
|
|
1120
|
+
const n = window.getSelection();
|
|
1121
|
+
if ((!n || n.rangeCount === 0) && S.current) {
|
|
1473
1122
|
const g = window.getSelection();
|
|
1474
|
-
g == null || g.removeAllRanges(), g == null || g.addRange(
|
|
1123
|
+
g == null || g.removeAllRanges(), g == null || g.addRange(S.current);
|
|
1475
1124
|
}
|
|
1476
1125
|
const o = window.getSelection();
|
|
1477
1126
|
if (!o || o.rangeCount === 0) return;
|
|
1478
1127
|
const l = o.getRangeAt(0);
|
|
1479
|
-
|
|
1480
|
-
const
|
|
1481
|
-
|
|
1482
|
-
const
|
|
1483
|
-
|
|
1128
|
+
I(), document.execCommand("removeFormat", !1);
|
|
1129
|
+
const h = l.cloneContents(), a = document.createElement("div");
|
|
1130
|
+
a.appendChild(h);
|
|
1131
|
+
const s = document.createTreeWalker(
|
|
1132
|
+
a,
|
|
1484
1133
|
NodeFilter.SHOW_ELEMENT,
|
|
1485
1134
|
null
|
|
1486
|
-
),
|
|
1487
|
-
for (;
|
|
1488
|
-
const g =
|
|
1489
|
-
|
|
1135
|
+
), p = [];
|
|
1136
|
+
for (; s.nextNode(); ) {
|
|
1137
|
+
const g = s.currentNode, C = g.tagName.toUpperCase(), k = g.getAttribute && g.getAttribute("data-mention") !== null;
|
|
1138
|
+
C !== "A" && !k && p.push(g);
|
|
1490
1139
|
}
|
|
1491
|
-
for (let g =
|
|
1492
|
-
const
|
|
1493
|
-
if (
|
|
1494
|
-
for (;
|
|
1495
|
-
|
|
1140
|
+
for (let g = p.length - 1; g >= 0; g--) {
|
|
1141
|
+
const C = p[g], k = C.parentNode;
|
|
1142
|
+
if (k) {
|
|
1143
|
+
for (; C.firstChild; ) k.insertBefore(C.firstChild, C);
|
|
1144
|
+
k.removeChild(C);
|
|
1496
1145
|
}
|
|
1497
1146
|
}
|
|
1498
|
-
|
|
1499
|
-
const
|
|
1500
|
-
for (;
|
|
1501
|
-
l.insertNode(
|
|
1502
|
-
const
|
|
1503
|
-
|
|
1147
|
+
a.querySelectorAll("[style]").forEach((g) => g.removeAttribute("style")), l.deleteContents();
|
|
1148
|
+
const u = document.createDocumentFragment();
|
|
1149
|
+
for (; a.firstChild; ) u.appendChild(a.firstChild);
|
|
1150
|
+
l.insertNode(u);
|
|
1151
|
+
const f = document.createRange();
|
|
1152
|
+
f.setStartAfter(
|
|
1504
1153
|
l.endContainer.nodeType === Node.TEXT_NODE ? l.endContainer : l.startContainer
|
|
1505
|
-
),
|
|
1154
|
+
), f.collapse(!0), o.removeAllRanges(), o.addRange(f), e.normalize(), z();
|
|
1506
1155
|
};
|
|
1507
|
-
return /* @__PURE__ */
|
|
1156
|
+
return /* @__PURE__ */ r.createElement(
|
|
1508
1157
|
"div",
|
|
1509
1158
|
{
|
|
1510
|
-
className: `rte-wrapper ${(
|
|
1511
|
-
style:
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
] }),
|
|
1589
|
-
c ? /* @__PURE__ */ a.jsx(
|
|
1590
|
-
Mt,
|
|
1591
|
-
{
|
|
1592
|
-
className: f.preview,
|
|
1593
|
-
style: w.preview,
|
|
1594
|
-
html: Re()
|
|
1595
|
-
}
|
|
1596
|
-
) : null
|
|
1597
|
-
]
|
|
1598
|
-
}
|
|
1159
|
+
className: `rte-wrapper ${(v == null ? void 0 : v.wrapper) || ""}`,
|
|
1160
|
+
style: y.wrapper
|
|
1161
|
+
},
|
|
1162
|
+
/* @__PURE__ */ r.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ r.createElement(
|
|
1163
|
+
Et,
|
|
1164
|
+
{
|
|
1165
|
+
exec: U,
|
|
1166
|
+
saveSelection: te,
|
|
1167
|
+
handleFileChange: De,
|
|
1168
|
+
handleFontSizeChange: (e) => U("fontSize", e.target.value),
|
|
1169
|
+
handleFontFamilyChange: (e) => U("fontName", e.target.value),
|
|
1170
|
+
insertEmoji: Oe,
|
|
1171
|
+
handleLink: Be,
|
|
1172
|
+
removeFormatting: Ue,
|
|
1173
|
+
visibleActions: xe,
|
|
1174
|
+
className: v.toolbar,
|
|
1175
|
+
style: y.toolbar
|
|
1176
|
+
}
|
|
1177
|
+
), /* @__PURE__ */ r.createElement(
|
|
1178
|
+
"div",
|
|
1179
|
+
{
|
|
1180
|
+
ref: x,
|
|
1181
|
+
className: `rte-editor ${(v == null ? void 0 : v.editor) || ""}`,
|
|
1182
|
+
style: y.editor,
|
|
1183
|
+
contentEditable: !0,
|
|
1184
|
+
suppressContentEditableWarning: !0,
|
|
1185
|
+
onInput: oe,
|
|
1186
|
+
onKeyDown: Ae,
|
|
1187
|
+
onBeforeInput: Te,
|
|
1188
|
+
onContextMenu: Fe,
|
|
1189
|
+
onClick: $e
|
|
1190
|
+
}
|
|
1191
|
+
), /* @__PURE__ */ r.createElement(
|
|
1192
|
+
yt,
|
|
1193
|
+
{
|
|
1194
|
+
show: T,
|
|
1195
|
+
position: D,
|
|
1196
|
+
filtered: X,
|
|
1197
|
+
insertMention: Ne,
|
|
1198
|
+
onClose: () => L(!1),
|
|
1199
|
+
query: Re
|
|
1200
|
+
}
|
|
1201
|
+
), c && /* @__PURE__ */ r.createElement(
|
|
1202
|
+
"div",
|
|
1203
|
+
{
|
|
1204
|
+
className: `rte-output ${(v == null ? void 0 : v.output) || ""}`,
|
|
1205
|
+
style: y.output
|
|
1206
|
+
},
|
|
1207
|
+
/* @__PURE__ */ r.createElement("h4", null, "Output HTML:"),
|
|
1208
|
+
/* @__PURE__ */ r.createElement("p", null, w)
|
|
1209
|
+
), /* @__PURE__ */ r.createElement(
|
|
1210
|
+
Ct,
|
|
1211
|
+
{
|
|
1212
|
+
visible: A.visible,
|
|
1213
|
+
x: A.x,
|
|
1214
|
+
y: A.y,
|
|
1215
|
+
onAction: Pe,
|
|
1216
|
+
onClose: () => {
|
|
1217
|
+
F(J(Q({}, A), { visible: !1 })), le();
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
), /* @__PURE__ */ r.createElement(
|
|
1221
|
+
xt,
|
|
1222
|
+
{
|
|
1223
|
+
visible: V,
|
|
1224
|
+
linkData: $,
|
|
1225
|
+
onClose: () => m(!1),
|
|
1226
|
+
onInsert: Ve
|
|
1227
|
+
}
|
|
1228
|
+
)),
|
|
1229
|
+
i ? /* @__PURE__ */ r.createElement(
|
|
1230
|
+
bt,
|
|
1231
|
+
{
|
|
1232
|
+
className: v.preview,
|
|
1233
|
+
style: y.preview,
|
|
1234
|
+
html: ae()
|
|
1235
|
+
}
|
|
1236
|
+
) : null
|
|
1599
1237
|
);
|
|
1600
1238
|
};
|
|
1601
1239
|
export {
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1240
|
+
Mt as RichTextEditor,
|
|
1241
|
+
bt as RtePreview,
|
|
1242
|
+
Et as RteToolbar
|
|
1605
1243
|
};
|