@ryzeup/richtexteditor 1.0.0 → 1.0.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/README.md +6 -35
- package/dist/index.es.js +685 -619
- package/dist/index.umd.js +4 -4
- package/dist/richtexteditor.css +1 -1
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var de = { exports: {} },
|
|
1
|
+
import U, { useRef as Y, useState as H, useEffect as oe } from "react";
|
|
2
|
+
var de = { exports: {} }, ne = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.js
|
|
@@ -9,29 +9,29 @@ var de = { exports: {} }, oe = {};
|
|
|
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
|
-
|
|
12
|
+
var ye;
|
|
13
|
+
function He() {
|
|
14
|
+
if (ye) return ne;
|
|
15
|
+
ye = 1;
|
|
16
16
|
var t = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
|
|
17
|
-
function u(c, h,
|
|
18
|
-
var
|
|
19
|
-
if (
|
|
20
|
-
|
|
17
|
+
function u(c, h, v) {
|
|
18
|
+
var L = null;
|
|
19
|
+
if (v !== void 0 && (L = "" + v), h.key !== void 0 && (L = "" + h.key), "key" in h) {
|
|
20
|
+
v = {};
|
|
21
21
|
for (var y in h)
|
|
22
|
-
y !== "key" && (
|
|
23
|
-
} else
|
|
24
|
-
return h =
|
|
22
|
+
y !== "key" && (v[y] = h[y]);
|
|
23
|
+
} else v = h;
|
|
24
|
+
return h = v.ref, {
|
|
25
25
|
$$typeof: t,
|
|
26
26
|
type: c,
|
|
27
|
-
key:
|
|
27
|
+
key: L,
|
|
28
28
|
ref: h !== void 0 ? h : null,
|
|
29
|
-
props:
|
|
29
|
+
props: v
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return ne.Fragment = s, ne.jsx = u, ne.jsxs = u, ne;
|
|
33
33
|
}
|
|
34
|
-
var
|
|
34
|
+
var re = {};
|
|
35
35
|
/**
|
|
36
36
|
* @license React
|
|
37
37
|
* react-jsx-runtime.development.js
|
|
@@ -41,44 +41,44 @@ var ae = {};
|
|
|
41
41
|
* This source code is licensed under the MIT license found in the
|
|
42
42
|
* LICENSE file in the root directory of this source tree.
|
|
43
43
|
*/
|
|
44
|
-
var
|
|
45
|
-
function
|
|
46
|
-
return
|
|
44
|
+
var Ce;
|
|
45
|
+
function Fe() {
|
|
46
|
+
return Ce || (Ce = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
47
47
|
function t(n) {
|
|
48
48
|
if (n == null) return null;
|
|
49
49
|
if (typeof n == "function")
|
|
50
|
-
return n.$$typeof ===
|
|
50
|
+
return n.$$typeof === le ? null : n.displayName || n.name || null;
|
|
51
51
|
if (typeof n == "string") return n;
|
|
52
52
|
switch (n) {
|
|
53
|
-
case
|
|
53
|
+
case S:
|
|
54
54
|
return "Fragment";
|
|
55
|
-
case
|
|
55
|
+
case D:
|
|
56
56
|
return "Profiler";
|
|
57
|
-
case
|
|
57
|
+
case W:
|
|
58
58
|
return "StrictMode";
|
|
59
|
-
case
|
|
59
|
+
case G:
|
|
60
60
|
return "Suspense";
|
|
61
61
|
case pe:
|
|
62
62
|
return "SuspenseList";
|
|
63
|
-
case
|
|
63
|
+
case ge:
|
|
64
64
|
return "Activity";
|
|
65
65
|
}
|
|
66
66
|
if (typeof n == "object")
|
|
67
67
|
switch (typeof n.tag == "number" && console.error(
|
|
68
68
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
69
|
), n.$$typeof) {
|
|
70
|
-
case
|
|
70
|
+
case B:
|
|
71
71
|
return "Portal";
|
|
72
|
-
case
|
|
72
|
+
case M:
|
|
73
73
|
return n.displayName || "Context";
|
|
74
|
-
case
|
|
74
|
+
case f:
|
|
75
75
|
return (n._context.displayName || "Context") + ".Consumer";
|
|
76
|
-
case
|
|
76
|
+
case X:
|
|
77
77
|
var p = n.render;
|
|
78
78
|
return n = n.displayName, n || (n = p.displayName || p.name || "", n = n !== "" ? "ForwardRef(" + n + ")" : "ForwardRef"), n;
|
|
79
|
-
case
|
|
79
|
+
case ae:
|
|
80
80
|
return p = n.displayName || null, p !== null ? p : t(n.type) || "Memo";
|
|
81
|
-
case
|
|
81
|
+
case J:
|
|
82
82
|
p = n._payload, n = n._init;
|
|
83
83
|
try {
|
|
84
84
|
return t(n(p));
|
|
@@ -99,17 +99,17 @@ function Oe() {
|
|
|
99
99
|
}
|
|
100
100
|
if (p) {
|
|
101
101
|
p = console;
|
|
102
|
-
var R = p.error,
|
|
102
|
+
var R = p.error, _ = typeof Symbol == "function" && Symbol.toStringTag && n[Symbol.toStringTag] || n.constructor.name || "Object";
|
|
103
103
|
return R.call(
|
|
104
104
|
p,
|
|
105
105
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
-
|
|
106
|
+
_
|
|
107
107
|
), s(n);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
function c(n) {
|
|
111
|
-
if (n ===
|
|
112
|
-
if (typeof n == "object" && n !== null && n.$$typeof ===
|
|
111
|
+
if (n === S) return "<>";
|
|
112
|
+
if (typeof n == "object" && n !== null && n.$$typeof === J)
|
|
113
113
|
return "<...>";
|
|
114
114
|
try {
|
|
115
115
|
var p = t(n);
|
|
@@ -119,14 +119,14 @@ function Oe() {
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
function h() {
|
|
122
|
-
var n =
|
|
122
|
+
var n = z.A;
|
|
123
123
|
return n === null ? null : n.getOwner();
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function v() {
|
|
126
126
|
return Error("react-stack-top-frame");
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
if (
|
|
128
|
+
function L(n) {
|
|
129
|
+
if (T.call(n, "key")) {
|
|
130
130
|
var p = Object.getOwnPropertyDescriptor(n, "key").get;
|
|
131
131
|
if (p && p.isReactWarning) return !1;
|
|
132
132
|
}
|
|
@@ -146,19 +146,19 @@ function Oe() {
|
|
|
146
146
|
}
|
|
147
147
|
function x() {
|
|
148
148
|
var n = t(this.type);
|
|
149
|
-
return
|
|
149
|
+
return K[n] || (K[n] = !0, console.error(
|
|
150
150
|
"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."
|
|
151
151
|
)), n = this.props.ref, n !== void 0 ? n : null;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
var
|
|
153
|
+
function F(n, p, R, _, Z, ee) {
|
|
154
|
+
var j = R.ref;
|
|
155
155
|
return n = {
|
|
156
156
|
$$typeof: q,
|
|
157
157
|
type: n,
|
|
158
158
|
key: p,
|
|
159
159
|
props: R,
|
|
160
|
-
_owner:
|
|
161
|
-
}, (
|
|
160
|
+
_owner: _
|
|
161
|
+
}, (j !== void 0 ? j : null) !== null ? Object.defineProperty(n, "ref", {
|
|
162
162
|
enumerable: !1,
|
|
163
163
|
get: x
|
|
164
164
|
}) : Object.defineProperty(n, "ref", { enumerable: !1, value: null }), n._store = {}, Object.defineProperty(n._store, "validated", {
|
|
@@ -175,125 +175,125 @@ function Oe() {
|
|
|
175
175
|
configurable: !1,
|
|
176
176
|
enumerable: !1,
|
|
177
177
|
writable: !0,
|
|
178
|
-
value:
|
|
178
|
+
value: Z
|
|
179
179
|
}), Object.defineProperty(n, "_debugTask", {
|
|
180
180
|
configurable: !1,
|
|
181
181
|
enumerable: !1,
|
|
182
182
|
writable: !0,
|
|
183
|
-
value:
|
|
183
|
+
value: ee
|
|
184
184
|
}), Object.freeze && (Object.freeze(n.props), Object.freeze(n)), n;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
var
|
|
188
|
-
if (
|
|
189
|
-
if (
|
|
190
|
-
if (
|
|
191
|
-
for (
|
|
192
|
-
|
|
193
|
-
Object.freeze && Object.freeze(
|
|
186
|
+
function O(n, p, R, _, Z, ee) {
|
|
187
|
+
var j = p.children;
|
|
188
|
+
if (j !== void 0)
|
|
189
|
+
if (_)
|
|
190
|
+
if (se(j)) {
|
|
191
|
+
for (_ = 0; _ < j.length; _++)
|
|
192
|
+
k(j[_]);
|
|
193
|
+
Object.freeze && Object.freeze(j);
|
|
194
194
|
} else
|
|
195
195
|
console.error(
|
|
196
196
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
197
197
|
);
|
|
198
|
-
else
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
var
|
|
198
|
+
else k(j);
|
|
199
|
+
if (T.call(p, "key")) {
|
|
200
|
+
j = t(n);
|
|
201
|
+
var V = Object.keys(p).filter(function(ve) {
|
|
202
202
|
return ve !== "key";
|
|
203
203
|
});
|
|
204
|
-
|
|
204
|
+
_ = 0 < V.length ? "{key: someKey, " + V.join(": ..., ") + ": ...}" : "{key: someKey}", Q[j + _] || (V = 0 < V.length ? "{" + V.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
205
205
|
`A props object containing a "key" prop is being spread into JSX:
|
|
206
206
|
let props = %s;
|
|
207
207
|
<%s {...props} />
|
|
208
208
|
React keys must be passed directly to JSX without using spread:
|
|
209
209
|
let props = %s;
|
|
210
210
|
<%s key={someKey} {...props} />`,
|
|
211
|
+
_,
|
|
211
212
|
j,
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
), ue[k + j] = !0);
|
|
213
|
+
V,
|
|
214
|
+
j
|
|
215
|
+
), Q[j + _] = !0);
|
|
216
216
|
}
|
|
217
|
-
if (
|
|
217
|
+
if (j = null, R !== void 0 && (u(R), j = "" + R), L(p) && (u(p.key), j = "" + p.key), "key" in p) {
|
|
218
218
|
R = {};
|
|
219
|
-
for (var
|
|
220
|
-
|
|
219
|
+
for (var te in p)
|
|
220
|
+
te !== "key" && (R[te] = p[te]);
|
|
221
221
|
} else R = p;
|
|
222
|
-
return
|
|
222
|
+
return j && y(
|
|
223
223
|
R,
|
|
224
224
|
typeof n == "function" ? n.displayName || n.name || "Unknown" : n
|
|
225
|
-
),
|
|
225
|
+
), F(
|
|
226
226
|
n,
|
|
227
|
-
|
|
227
|
+
j,
|
|
228
228
|
R,
|
|
229
229
|
h(),
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
Z,
|
|
231
|
+
ee
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
|
|
234
|
+
function k(n) {
|
|
235
|
+
P(n) ? n._store && (n._store.validated = 1) : typeof n == "object" && n !== null && n.$$typeof === J && (n._payload.status === "fulfilled" ? P(n._payload.value) && n._payload.value._store && (n._payload.value._store.validated = 1) : n._store && (n._store.validated = 1));
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function P(n) {
|
|
238
238
|
return typeof n == "object" && n !== null && n.$$typeof === q;
|
|
239
239
|
}
|
|
240
|
-
var
|
|
240
|
+
var C = U, q = Symbol.for("react.transitional.element"), B = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), W = Symbol.for("react.strict_mode"), D = Symbol.for("react.profiler"), f = Symbol.for("react.consumer"), M = Symbol.for("react.context"), X = Symbol.for("react.forward_ref"), G = Symbol.for("react.suspense"), pe = Symbol.for("react.suspense_list"), ae = Symbol.for("react.memo"), J = Symbol.for("react.lazy"), ge = Symbol.for("react.activity"), le = Symbol.for("react.client.reference"), z = C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, T = Object.prototype.hasOwnProperty, se = Array.isArray, $ = console.createTask ? console.createTask : function() {
|
|
241
241
|
return null;
|
|
242
242
|
};
|
|
243
|
-
|
|
243
|
+
C = {
|
|
244
244
|
react_stack_bottom_frame: function(n) {
|
|
245
245
|
return n();
|
|
246
246
|
}
|
|
247
247
|
};
|
|
248
|
-
var ie,
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
)(),
|
|
252
|
-
|
|
253
|
-
var
|
|
254
|
-
return
|
|
248
|
+
var ie, K = {}, ce = C.react_stack_bottom_frame.bind(
|
|
249
|
+
C,
|
|
250
|
+
v
|
|
251
|
+
)(), ue = $(c(v)), Q = {};
|
|
252
|
+
re.Fragment = S, re.jsx = function(n, p, R) {
|
|
253
|
+
var _ = 1e4 > z.recentlyCreatedOwnerStacks++;
|
|
254
|
+
return O(
|
|
255
255
|
n,
|
|
256
256
|
p,
|
|
257
257
|
R,
|
|
258
258
|
!1,
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
_ ? Error("react-stack-top-frame") : ce,
|
|
260
|
+
_ ? $(c(n)) : ue
|
|
261
261
|
);
|
|
262
|
-
},
|
|
263
|
-
var
|
|
264
|
-
return
|
|
262
|
+
}, re.jsxs = function(n, p, R) {
|
|
263
|
+
var _ = 1e4 > z.recentlyCreatedOwnerStacks++;
|
|
264
|
+
return O(
|
|
265
265
|
n,
|
|
266
266
|
p,
|
|
267
267
|
R,
|
|
268
268
|
!0,
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
_ ? Error("react-stack-top-frame") : ce,
|
|
270
|
+
_ ? $(c(n)) : ue
|
|
271
271
|
);
|
|
272
272
|
};
|
|
273
|
-
})()),
|
|
273
|
+
})()), re;
|
|
274
274
|
}
|
|
275
|
-
var
|
|
276
|
-
function
|
|
277
|
-
return
|
|
275
|
+
var Re;
|
|
276
|
+
function Ie() {
|
|
277
|
+
return Re || (Re = 1, process.env.NODE_ENV === "production" ? de.exports = He() : de.exports = Fe()), de.exports;
|
|
278
278
|
}
|
|
279
|
-
var
|
|
279
|
+
var a = Ie(), _e = {
|
|
280
280
|
color: void 0,
|
|
281
281
|
size: void 0,
|
|
282
282
|
className: void 0,
|
|
283
283
|
style: void 0,
|
|
284
284
|
attr: void 0
|
|
285
|
-
},
|
|
286
|
-
function
|
|
285
|
+
}, Ee = U.createContext && /* @__PURE__ */ U.createContext(_e), Be = ["attr", "size", "title"];
|
|
286
|
+
function $e(t, s) {
|
|
287
287
|
if (t == null) return {};
|
|
288
|
-
var u =
|
|
288
|
+
var u = Ve(t, s), c, h;
|
|
289
289
|
if (Object.getOwnPropertySymbols) {
|
|
290
|
-
var
|
|
291
|
-
for (h = 0; h <
|
|
292
|
-
c =
|
|
290
|
+
var v = Object.getOwnPropertySymbols(t);
|
|
291
|
+
for (h = 0; h < v.length; h++)
|
|
292
|
+
c = v[h], !(s.indexOf(c) >= 0) && Object.prototype.propertyIsEnumerable.call(t, c) && (u[c] = t[c]);
|
|
293
293
|
}
|
|
294
294
|
return u;
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function Ve(t, s) {
|
|
297
297
|
if (t == null) return {};
|
|
298
298
|
var u = {};
|
|
299
299
|
for (var c in t)
|
|
@@ -313,7 +313,7 @@ function fe() {
|
|
|
313
313
|
return t;
|
|
314
314
|
}, fe.apply(this, arguments);
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function je(t, s) {
|
|
317
317
|
var u = Object.keys(t);
|
|
318
318
|
if (Object.getOwnPropertySymbols) {
|
|
319
319
|
var c = Object.getOwnPropertySymbols(t);
|
|
@@ -326,22 +326,22 @@ function Ce(t, s) {
|
|
|
326
326
|
function he(t) {
|
|
327
327
|
for (var s = 1; s < arguments.length; s++) {
|
|
328
328
|
var u = arguments[s] != null ? arguments[s] : {};
|
|
329
|
-
s % 2 ?
|
|
330
|
-
|
|
331
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(u)) :
|
|
329
|
+
s % 2 ? je(Object(u), !0).forEach(function(c) {
|
|
330
|
+
Ye(t, c, u[c]);
|
|
331
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(u)) : je(Object(u)).forEach(function(c) {
|
|
332
332
|
Object.defineProperty(t, c, Object.getOwnPropertyDescriptor(u, c));
|
|
333
333
|
});
|
|
334
334
|
}
|
|
335
335
|
return t;
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
return s =
|
|
337
|
+
function Ye(t, s, u) {
|
|
338
|
+
return s = Ue(s), s in t ? Object.defineProperty(t, s, { value: u, enumerable: !0, configurable: !0, writable: !0 }) : t[s] = u, t;
|
|
339
339
|
}
|
|
340
|
-
function
|
|
341
|
-
var s =
|
|
340
|
+
function Ue(t) {
|
|
341
|
+
var s = We(t, "string");
|
|
342
342
|
return typeof s == "symbol" ? s : s + "";
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function We(t, s) {
|
|
345
345
|
if (typeof t != "object" || !t) return t;
|
|
346
346
|
var u = t[Symbol.toPrimitive];
|
|
347
347
|
if (u !== void 0) {
|
|
@@ -351,28 +351,28 @@ function Ve(t, s) {
|
|
|
351
351
|
}
|
|
352
352
|
return (s === "string" ? String : Number)(t);
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
return t && t.map((s, u) => /* @__PURE__ */
|
|
354
|
+
function ke(t) {
|
|
355
|
+
return t && t.map((s, u) => /* @__PURE__ */ U.createElement(s.tag, he({
|
|
356
356
|
key: u
|
|
357
|
-
}, s.attr),
|
|
357
|
+
}, s.attr), ke(s.child)));
|
|
358
358
|
}
|
|
359
|
-
function
|
|
360
|
-
return (s) => /* @__PURE__ */
|
|
359
|
+
function N(t) {
|
|
360
|
+
return (s) => /* @__PURE__ */ U.createElement(qe, fe({
|
|
361
361
|
attr: he({}, t.attr)
|
|
362
|
-
}, s),
|
|
362
|
+
}, s), ke(t.child));
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function qe(t) {
|
|
365
365
|
var s = (u) => {
|
|
366
366
|
var {
|
|
367
367
|
attr: c,
|
|
368
368
|
size: h,
|
|
369
|
-
title:
|
|
370
|
-
} = t,
|
|
371
|
-
return u.className && (x = u.className), t.className && (x = (x ? x + " " : "") + t.className), /* @__PURE__ */
|
|
369
|
+
title: v
|
|
370
|
+
} = t, L = $e(t, Be), y = h || u.size || "1em", x;
|
|
371
|
+
return u.className && (x = u.className), t.className && (x = (x ? x + " " : "") + t.className), /* @__PURE__ */ U.createElement("svg", fe({
|
|
372
372
|
stroke: "currentColor",
|
|
373
373
|
fill: "currentColor",
|
|
374
374
|
strokeWidth: "0"
|
|
375
|
-
}, u.attr, c,
|
|
375
|
+
}, u.attr, c, L, {
|
|
376
376
|
className: x,
|
|
377
377
|
style: he(he({
|
|
378
378
|
color: t.color || u.color
|
|
@@ -380,56 +380,56 @@ function $e(t) {
|
|
|
380
380
|
height: y,
|
|
381
381
|
width: y,
|
|
382
382
|
xmlns: "http://www.w3.org/2000/svg"
|
|
383
|
-
}),
|
|
383
|
+
}), v && /* @__PURE__ */ U.createElement("title", null, v), t.children);
|
|
384
384
|
};
|
|
385
|
-
return
|
|
386
|
-
}
|
|
387
|
-
function Ye(t) {
|
|
388
|
-
return T({ 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);
|
|
389
|
-
}
|
|
390
|
-
function Ue(t) {
|
|
391
|
-
return T({ 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);
|
|
392
|
-
}
|
|
393
|
-
function We(t) {
|
|
394
|
-
return T({ 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);
|
|
395
|
-
}
|
|
396
|
-
function qe(t) {
|
|
397
|
-
return T({ 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);
|
|
385
|
+
return Ee !== void 0 ? /* @__PURE__ */ U.createElement(Ee.Consumer, null, (u) => s(u)) : s(_e);
|
|
398
386
|
}
|
|
399
387
|
function Xe(t) {
|
|
400
|
-
return
|
|
388
|
+
return N({ 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
389
|
}
|
|
402
390
|
function Ge(t) {
|
|
403
|
-
return
|
|
404
|
-
}
|
|
405
|
-
function Je(t) {
|
|
406
|
-
return T({ 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);
|
|
391
|
+
return N({ 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);
|
|
407
392
|
}
|
|
408
393
|
function Ze(t) {
|
|
409
|
-
return
|
|
394
|
+
return N({ 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);
|
|
395
|
+
}
|
|
396
|
+
function Je(t) {
|
|
397
|
+
return N({ 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
398
|
}
|
|
411
399
|
function Ke(t) {
|
|
412
|
-
return
|
|
400
|
+
return N({ 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
401
|
}
|
|
414
402
|
function Qe(t) {
|
|
415
|
-
return
|
|
403
|
+
return N({ 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
404
|
}
|
|
417
405
|
function et(t) {
|
|
418
|
-
return
|
|
406
|
+
return N({ 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
407
|
}
|
|
420
408
|
function tt(t) {
|
|
421
|
-
return
|
|
409
|
+
return N({ 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
410
|
}
|
|
423
411
|
function nt(t) {
|
|
424
|
-
return
|
|
412
|
+
return N({ 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
413
|
}
|
|
426
414
|
function rt(t) {
|
|
427
|
-
return
|
|
415
|
+
return N({ 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
416
|
}
|
|
429
417
|
function ot(t) {
|
|
430
|
-
return
|
|
418
|
+
return N({ 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);
|
|
419
|
+
}
|
|
420
|
+
function at(t) {
|
|
421
|
+
return N({ 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);
|
|
422
|
+
}
|
|
423
|
+
function lt(t) {
|
|
424
|
+
return N({ 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);
|
|
425
|
+
}
|
|
426
|
+
function st(t) {
|
|
427
|
+
return N({ 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);
|
|
431
428
|
}
|
|
432
|
-
|
|
429
|
+
function it(t) {
|
|
430
|
+
return N({ 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);
|
|
431
|
+
}
|
|
432
|
+
const ct = [
|
|
433
433
|
"😀",
|
|
434
434
|
"😁",
|
|
435
435
|
"😂",
|
|
@@ -541,141 +541,141 @@ const at = [
|
|
|
541
541
|
"👏",
|
|
542
542
|
"🫶",
|
|
543
543
|
"👐"
|
|
544
|
-
],
|
|
544
|
+
], ut = ({
|
|
545
545
|
exec: t,
|
|
546
546
|
saveSelection: s,
|
|
547
547
|
handleFileChange: u,
|
|
548
548
|
handleFontSizeChange: c,
|
|
549
549
|
handleFontFamilyChange: h,
|
|
550
550
|
// insertListBlock,
|
|
551
|
-
insertEmoji:
|
|
552
|
-
handleLink:
|
|
551
|
+
insertEmoji: v,
|
|
552
|
+
handleLink: L,
|
|
553
553
|
removeFormatting: y,
|
|
554
554
|
visibleActions: x,
|
|
555
|
-
className:
|
|
556
|
-
style:
|
|
555
|
+
className: F,
|
|
556
|
+
style: O
|
|
557
557
|
}) => {
|
|
558
|
-
const
|
|
559
|
-
|
|
560
|
-
const
|
|
561
|
-
!
|
|
558
|
+
const k = Y(null), P = Y(null), C = Y(null), [q, B] = H(!1);
|
|
559
|
+
oe(() => {
|
|
560
|
+
const f = (M) => {
|
|
561
|
+
!M.target.closest(".rte-emoji-popup") && !M.target.closest("button[title='Emoji']") && B(!1);
|
|
562
562
|
};
|
|
563
|
-
return document.addEventListener("mousedown",
|
|
563
|
+
return document.addEventListener("mousedown", f), () => document.removeEventListener("mousedown", f);
|
|
564
564
|
}, []);
|
|
565
|
-
const
|
|
566
|
-
|
|
567
|
-
const
|
|
568
|
-
if (
|
|
569
|
-
switch (
|
|
565
|
+
const S = (f) => {
|
|
566
|
+
f.preventDefault();
|
|
567
|
+
const M = f.currentTarget.dataset.command;
|
|
568
|
+
if (M)
|
|
569
|
+
switch (M) {
|
|
570
570
|
case "bold":
|
|
571
571
|
case "italic":
|
|
572
572
|
case "underline":
|
|
573
573
|
case "insertUnorderedList":
|
|
574
574
|
case "insertOrderedList":
|
|
575
575
|
case "removeFormat":
|
|
576
|
-
t(
|
|
576
|
+
t(M);
|
|
577
577
|
break;
|
|
578
578
|
case "insertImage": {
|
|
579
|
-
|
|
579
|
+
k.current?.click();
|
|
580
580
|
break;
|
|
581
581
|
}
|
|
582
582
|
default:
|
|
583
|
-
console.warn("Unknown command:",
|
|
583
|
+
console.warn("Unknown command:", M);
|
|
584
584
|
}
|
|
585
|
-
},
|
|
586
|
-
t("foreColor",
|
|
587
|
-
},
|
|
588
|
-
t("backColor",
|
|
585
|
+
}, W = (f) => {
|
|
586
|
+
t("foreColor", f.target.value);
|
|
587
|
+
}, D = (f) => {
|
|
588
|
+
t("backColor", f.target.value);
|
|
589
589
|
};
|
|
590
|
-
return /* @__PURE__ */
|
|
591
|
-
x.bold && /* @__PURE__ */
|
|
590
|
+
return /* @__PURE__ */ a.jsxs("div", { className: `rte-toolbar ${F || ""}`, style: O, children: [
|
|
591
|
+
x.bold && /* @__PURE__ */ a.jsx(
|
|
592
592
|
"button",
|
|
593
593
|
{
|
|
594
594
|
"data-command": "bold",
|
|
595
595
|
title: "Bold",
|
|
596
|
-
onMouseDown:
|
|
597
|
-
children: /* @__PURE__ */
|
|
596
|
+
onMouseDown: S,
|
|
597
|
+
children: /* @__PURE__ */ a.jsx(Qe, {})
|
|
598
598
|
}
|
|
599
599
|
),
|
|
600
|
-
x.italic && /* @__PURE__ */
|
|
600
|
+
x.italic && /* @__PURE__ */ a.jsx(
|
|
601
601
|
"button",
|
|
602
602
|
{
|
|
603
603
|
"data-command": "italic",
|
|
604
604
|
title: "Italic",
|
|
605
|
-
onMouseDown:
|
|
606
|
-
children: /* @__PURE__ */
|
|
605
|
+
onMouseDown: S,
|
|
606
|
+
children: /* @__PURE__ */ a.jsx(tt, {})
|
|
607
607
|
}
|
|
608
608
|
),
|
|
609
|
-
x.underline && /* @__PURE__ */
|
|
609
|
+
x.underline && /* @__PURE__ */ a.jsx(
|
|
610
610
|
"button",
|
|
611
611
|
{
|
|
612
612
|
"data-command": "underline",
|
|
613
613
|
title: "Underline",
|
|
614
|
-
onMouseDown:
|
|
615
|
-
children: /* @__PURE__ */
|
|
614
|
+
onMouseDown: S,
|
|
615
|
+
children: /* @__PURE__ */ a.jsx(lt, {})
|
|
616
616
|
}
|
|
617
617
|
),
|
|
618
|
-
x.unorderedList && /* @__PURE__ */
|
|
618
|
+
x.unorderedList && /* @__PURE__ */ a.jsx(
|
|
619
619
|
"button",
|
|
620
620
|
{
|
|
621
621
|
"data-command": "insertUnorderedList",
|
|
622
|
-
onMouseDown:
|
|
622
|
+
onMouseDown: S,
|
|
623
623
|
title: "UnorderedList",
|
|
624
|
-
children: /* @__PURE__ */
|
|
624
|
+
children: /* @__PURE__ */ a.jsx(rt, {})
|
|
625
625
|
}
|
|
626
626
|
),
|
|
627
|
-
x.orderedList && /* @__PURE__ */
|
|
627
|
+
x.orderedList && /* @__PURE__ */ a.jsx(
|
|
628
628
|
"button",
|
|
629
629
|
{
|
|
630
630
|
"data-command": "insertOrderedList",
|
|
631
631
|
title: "OrderedList",
|
|
632
|
-
onMouseDown:
|
|
633
|
-
children: /* @__PURE__ */
|
|
632
|
+
onMouseDown: S,
|
|
633
|
+
children: /* @__PURE__ */ a.jsx(Je, {})
|
|
634
634
|
}
|
|
635
635
|
),
|
|
636
|
-
x.link && /* @__PURE__ */
|
|
637
|
-
x.removeFormat && /* @__PURE__ */
|
|
636
|
+
x.link && /* @__PURE__ */ a.jsx("button", { "data-command": "createLink", title: "Link", onClick: L, children: /* @__PURE__ */ a.jsx(nt, {}) }),
|
|
637
|
+
x.removeFormat && /* @__PURE__ */ a.jsx(
|
|
638
638
|
"button",
|
|
639
639
|
{
|
|
640
640
|
"data-command": "Remove format",
|
|
641
641
|
title: "removeFormat",
|
|
642
|
-
onMouseDown: (
|
|
643
|
-
|
|
642
|
+
onMouseDown: (f) => {
|
|
643
|
+
f.preventDefault(), s(), y();
|
|
644
644
|
},
|
|
645
|
-
children: /* @__PURE__ */
|
|
645
|
+
children: /* @__PURE__ */ a.jsx(it, {})
|
|
646
646
|
}
|
|
647
647
|
),
|
|
648
|
-
x.image && /* @__PURE__ */
|
|
648
|
+
x.image && /* @__PURE__ */ a.jsx(
|
|
649
649
|
"button",
|
|
650
650
|
{
|
|
651
651
|
"data-command": "insertImage",
|
|
652
652
|
title: "Image",
|
|
653
|
-
onMouseDown:
|
|
654
|
-
children: /* @__PURE__ */
|
|
653
|
+
onMouseDown: S,
|
|
654
|
+
children: /* @__PURE__ */ a.jsx(Ze, {})
|
|
655
655
|
}
|
|
656
656
|
),
|
|
657
|
-
/* @__PURE__ */
|
|
657
|
+
/* @__PURE__ */ a.jsx(
|
|
658
658
|
"input",
|
|
659
659
|
{
|
|
660
660
|
type: "file",
|
|
661
661
|
accept: "image/*",
|
|
662
|
-
ref:
|
|
662
|
+
ref: k,
|
|
663
663
|
style: { display: "none" },
|
|
664
664
|
onChange: u
|
|
665
665
|
}
|
|
666
666
|
),
|
|
667
|
-
x.emoji && /* @__PURE__ */
|
|
668
|
-
/* @__PURE__ */
|
|
667
|
+
x.emoji && /* @__PURE__ */ a.jsxs("div", { style: { position: "relative" }, children: [
|
|
668
|
+
/* @__PURE__ */ a.jsx(
|
|
669
669
|
"button",
|
|
670
670
|
{
|
|
671
671
|
title: "Emoji",
|
|
672
|
-
onMouseDown: (
|
|
673
|
-
|
|
672
|
+
onMouseDown: (f) => {
|
|
673
|
+
f.preventDefault(), s(), B((M) => !M);
|
|
674
674
|
},
|
|
675
|
-
children: /* @__PURE__ */
|
|
675
|
+
children: /* @__PURE__ */ a.jsx(ot, {})
|
|
676
676
|
}
|
|
677
677
|
),
|
|
678
|
-
q && /* @__PURE__ */
|
|
678
|
+
q && /* @__PURE__ */ a.jsx("div", { className: "rte-emoji-popup", children: ct.map((f) => /* @__PURE__ */ a.jsx(
|
|
679
679
|
"span",
|
|
680
680
|
{
|
|
681
681
|
style: {
|
|
@@ -683,42 +683,42 @@ const at = [
|
|
|
683
683
|
cursor: "pointer",
|
|
684
684
|
textAlign: "center"
|
|
685
685
|
},
|
|
686
|
-
onMouseDown: (
|
|
687
|
-
|
|
686
|
+
onMouseDown: (M) => {
|
|
687
|
+
M.preventDefault(), v(f), B(!1);
|
|
688
688
|
},
|
|
689
|
-
children:
|
|
689
|
+
children: f
|
|
690
690
|
},
|
|
691
|
-
|
|
691
|
+
f
|
|
692
692
|
)) })
|
|
693
693
|
] }),
|
|
694
|
-
x.color && /* @__PURE__ */
|
|
695
|
-
/* @__PURE__ */
|
|
694
|
+
x.color && /* @__PURE__ */ a.jsxs("div", { style: { position: "relative" }, children: [
|
|
695
|
+
/* @__PURE__ */ a.jsx(
|
|
696
696
|
"button",
|
|
697
697
|
{
|
|
698
698
|
title: "Text Color",
|
|
699
|
-
onMouseDown: (
|
|
700
|
-
|
|
699
|
+
onMouseDown: (f) => {
|
|
700
|
+
f.preventDefault(), s(), P.current?.click();
|
|
701
701
|
},
|
|
702
702
|
style: {
|
|
703
703
|
display: "flex",
|
|
704
704
|
alignItems: "center",
|
|
705
705
|
justifyContent: "center",
|
|
706
|
-
color:
|
|
706
|
+
color: P.current?.value || "#000",
|
|
707
707
|
fontSize: "18px"
|
|
708
708
|
},
|
|
709
|
-
children: /* @__PURE__ */
|
|
709
|
+
children: /* @__PURE__ */ a.jsx(st, {})
|
|
710
710
|
}
|
|
711
711
|
),
|
|
712
|
-
/* @__PURE__ */
|
|
712
|
+
/* @__PURE__ */ a.jsx(
|
|
713
713
|
"input",
|
|
714
714
|
{
|
|
715
|
-
ref:
|
|
715
|
+
ref: P,
|
|
716
716
|
type: "color",
|
|
717
717
|
defaultValue: "#000000",
|
|
718
|
-
onChange: (
|
|
719
|
-
|
|
718
|
+
onChange: (f) => {
|
|
719
|
+
W(f), (f.target.parentElement?.querySelector(
|
|
720
720
|
"button"
|
|
721
|
-
)).style.color =
|
|
721
|
+
)).style.color = f.target.value;
|
|
722
722
|
},
|
|
723
723
|
style: {
|
|
724
724
|
position: "absolute",
|
|
@@ -730,33 +730,33 @@ const at = [
|
|
|
730
730
|
}
|
|
731
731
|
)
|
|
732
732
|
] }),
|
|
733
|
-
x.highlight && /* @__PURE__ */
|
|
734
|
-
/* @__PURE__ */
|
|
733
|
+
x.highlight && /* @__PURE__ */ a.jsxs("div", { style: { position: "relative" }, children: [
|
|
734
|
+
/* @__PURE__ */ a.jsx(
|
|
735
735
|
"button",
|
|
736
736
|
{
|
|
737
737
|
title: "Highlight",
|
|
738
|
-
onMouseDown: (
|
|
739
|
-
|
|
738
|
+
onMouseDown: (f) => {
|
|
739
|
+
f.preventDefault(), s(), C.current?.click();
|
|
740
740
|
},
|
|
741
741
|
style: {
|
|
742
742
|
display: "flex",
|
|
743
743
|
alignItems: "center",
|
|
744
744
|
justifyContent: "center",
|
|
745
|
-
color:
|
|
745
|
+
color: C.current?.value || "#000",
|
|
746
746
|
fontSize: "18px"
|
|
747
747
|
},
|
|
748
|
-
children: /* @__PURE__ */
|
|
748
|
+
children: /* @__PURE__ */ a.jsx(et, {})
|
|
749
749
|
}
|
|
750
750
|
),
|
|
751
|
-
/* @__PURE__ */
|
|
751
|
+
/* @__PURE__ */ a.jsx(
|
|
752
752
|
"input",
|
|
753
753
|
{
|
|
754
|
-
ref:
|
|
754
|
+
ref: C,
|
|
755
755
|
type: "color",
|
|
756
|
-
onChange: (
|
|
757
|
-
|
|
756
|
+
onChange: (f) => {
|
|
757
|
+
D(f), (f.target.parentElement?.querySelector(
|
|
758
758
|
"button"
|
|
759
|
-
)).style.color =
|
|
759
|
+
)).style.color = f.target.value;
|
|
760
760
|
},
|
|
761
761
|
defaultValue: "#000000",
|
|
762
762
|
style: {
|
|
@@ -769,45 +769,45 @@ const at = [
|
|
|
769
769
|
}
|
|
770
770
|
)
|
|
771
771
|
] }),
|
|
772
|
-
x.align && /* @__PURE__ */
|
|
773
|
-
/* @__PURE__ */
|
|
772
|
+
x.align && /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
773
|
+
/* @__PURE__ */ a.jsx(
|
|
774
774
|
"button",
|
|
775
775
|
{
|
|
776
776
|
title: "Align Left",
|
|
777
|
-
onMouseDown: (
|
|
777
|
+
onMouseDown: (f) => f.preventDefault(),
|
|
778
778
|
onClick: () => t("justifyLeft"),
|
|
779
|
-
children: /* @__PURE__ */
|
|
779
|
+
children: /* @__PURE__ */ a.jsx(Ke, {})
|
|
780
780
|
}
|
|
781
781
|
),
|
|
782
|
-
/* @__PURE__ */
|
|
782
|
+
/* @__PURE__ */ a.jsx(
|
|
783
783
|
"button",
|
|
784
784
|
{
|
|
785
785
|
title: "Align Center",
|
|
786
|
-
onMouseDown: (
|
|
786
|
+
onMouseDown: (f) => f.preventDefault(),
|
|
787
787
|
onClick: () => t("justifyCenter"),
|
|
788
|
-
children: /* @__PURE__ */
|
|
788
|
+
children: /* @__PURE__ */ a.jsx(Xe, {})
|
|
789
789
|
}
|
|
790
790
|
),
|
|
791
|
-
/* @__PURE__ */
|
|
791
|
+
/* @__PURE__ */ a.jsx(
|
|
792
792
|
"button",
|
|
793
793
|
{
|
|
794
794
|
title: "Align Right",
|
|
795
|
-
onMouseDown: (
|
|
795
|
+
onMouseDown: (f) => f.preventDefault(),
|
|
796
796
|
onClick: () => t("justifyRight"),
|
|
797
|
-
children: /* @__PURE__ */
|
|
797
|
+
children: /* @__PURE__ */ a.jsx(Ge, {})
|
|
798
798
|
}
|
|
799
799
|
)
|
|
800
800
|
] }),
|
|
801
|
-
x.table && /* @__PURE__ */
|
|
801
|
+
x.table && /* @__PURE__ */ a.jsx(
|
|
802
802
|
"button",
|
|
803
803
|
{
|
|
804
804
|
title: "Insert Table",
|
|
805
|
-
onMouseDown: (
|
|
805
|
+
onMouseDown: (f) => f.preventDefault(),
|
|
806
806
|
onClick: () => t("insertTable"),
|
|
807
|
-
children: /* @__PURE__ */
|
|
807
|
+
children: /* @__PURE__ */ a.jsx(at, {})
|
|
808
808
|
}
|
|
809
809
|
),
|
|
810
|
-
x.fontFamily && /* @__PURE__ */
|
|
810
|
+
x.fontFamily && /* @__PURE__ */ a.jsxs(
|
|
811
811
|
"select",
|
|
812
812
|
{
|
|
813
813
|
className: "rte-dropdown",
|
|
@@ -815,16 +815,16 @@ const at = [
|
|
|
815
815
|
onMouseDown: () => s(),
|
|
816
816
|
onChange: h,
|
|
817
817
|
children: [
|
|
818
|
-
/* @__PURE__ */
|
|
819
|
-
/* @__PURE__ */
|
|
820
|
-
/* @__PURE__ */
|
|
821
|
-
/* @__PURE__ */
|
|
822
|
-
/* @__PURE__ */
|
|
823
|
-
/* @__PURE__ */
|
|
818
|
+
/* @__PURE__ */ a.jsx("option", { value: "", disabled: !0, children: "Font Family" }),
|
|
819
|
+
/* @__PURE__ */ a.jsx("option", { value: "Arial", children: "Arial" }),
|
|
820
|
+
/* @__PURE__ */ a.jsx("option", { value: "Georgia", children: "Georgia" }),
|
|
821
|
+
/* @__PURE__ */ a.jsx("option", { value: "Times New Roman", children: "Times New Roman" }),
|
|
822
|
+
/* @__PURE__ */ a.jsx("option", { value: "Courier New", children: "Courier New" }),
|
|
823
|
+
/* @__PURE__ */ a.jsx("option", { value: "Verdana", children: "Verdana" })
|
|
824
824
|
]
|
|
825
825
|
}
|
|
826
826
|
),
|
|
827
|
-
x.fontSize && /* @__PURE__ */
|
|
827
|
+
x.fontSize && /* @__PURE__ */ a.jsxs(
|
|
828
828
|
"select",
|
|
829
829
|
{
|
|
830
830
|
className: "rte-dropdown",
|
|
@@ -832,66 +832,78 @@ const at = [
|
|
|
832
832
|
onMouseDown: () => s(),
|
|
833
833
|
onChange: c,
|
|
834
834
|
children: [
|
|
835
|
-
/* @__PURE__ */
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
/* @__PURE__ */
|
|
838
|
-
/* @__PURE__ */
|
|
839
|
-
/* @__PURE__ */
|
|
835
|
+
/* @__PURE__ */ a.jsx("option", { value: "", disabled: !0, children: "Font Size" }),
|
|
836
|
+
/* @__PURE__ */ a.jsx("option", { value: "2", children: "Small " }),
|
|
837
|
+
/* @__PURE__ */ a.jsx("option", { value: "3", children: "Normal" }),
|
|
838
|
+
/* @__PURE__ */ a.jsx("option", { value: "4", children: "Medium" }),
|
|
839
|
+
/* @__PURE__ */ a.jsx("option", { value: "5", children: "Large" })
|
|
840
840
|
]
|
|
841
841
|
}
|
|
842
842
|
)
|
|
843
843
|
] });
|
|
844
|
-
},
|
|
844
|
+
}, dt = ({
|
|
845
845
|
show: t,
|
|
846
846
|
position: s,
|
|
847
847
|
filtered: u,
|
|
848
848
|
insertMention: c,
|
|
849
|
-
onClose: h
|
|
849
|
+
onClose: h,
|
|
850
|
+
query: v
|
|
850
851
|
}) => {
|
|
851
|
-
const
|
|
852
|
-
return
|
|
853
|
-
const
|
|
854
|
-
|
|
852
|
+
const L = Y(null);
|
|
853
|
+
return oe(() => {
|
|
854
|
+
const y = (x) => {
|
|
855
|
+
L.current && !L.current.contains(x.target) && h();
|
|
855
856
|
};
|
|
856
|
-
return t && document.addEventListener("mousedown",
|
|
857
|
-
document.removeEventListener("mousedown",
|
|
857
|
+
return t && document.addEventListener("mousedown", y), () => {
|
|
858
|
+
document.removeEventListener("mousedown", y);
|
|
858
859
|
};
|
|
859
|
-
}, [t, h]), t ? /* @__PURE__ */
|
|
860
|
+
}, [t, h]), t ? /* @__PURE__ */ a.jsx(
|
|
860
861
|
"ul",
|
|
861
862
|
{
|
|
862
|
-
ref:
|
|
863
|
+
ref: L,
|
|
863
864
|
className: "rte-popup",
|
|
864
865
|
style: {
|
|
865
866
|
top: s.y,
|
|
866
867
|
left: s.x
|
|
867
868
|
},
|
|
868
|
-
children: u.length > 0 ? u.map((
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
869
|
+
children: u.length > 0 ? u.map(({ key: y, value: x }) => {
|
|
870
|
+
const F = y.toLowerCase(), O = v.toLowerCase(), k = F.indexOf(O);
|
|
871
|
+
let P = y;
|
|
872
|
+
if (k !== -1 && v.length > 0) {
|
|
873
|
+
const C = k + v.length;
|
|
874
|
+
P = y.substring(0, k) + `<span class="rte-highlight">${y.substring(
|
|
875
|
+
k,
|
|
876
|
+
C
|
|
877
|
+
)}</span>` + y.substring(C);
|
|
878
|
+
}
|
|
879
|
+
return /* @__PURE__ */ a.jsx(
|
|
880
|
+
"li",
|
|
881
|
+
{
|
|
882
|
+
onMouseDown: (C) => {
|
|
883
|
+
C.preventDefault(), c({ key: y, value: x });
|
|
884
|
+
},
|
|
885
|
+
style: {
|
|
886
|
+
padding: "6px 12px",
|
|
887
|
+
cursor: "pointer",
|
|
888
|
+
fontSize: "14px"
|
|
889
|
+
},
|
|
890
|
+
dangerouslySetInnerHTML: { __html: P },
|
|
891
|
+
onMouseEnter: (C) => C.currentTarget.style.background = "#f0f0f0",
|
|
892
|
+
onMouseLeave: (C) => C.currentTarget.style.background = "#fff"
|
|
878
893
|
},
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
},
|
|
883
|
-
E.value
|
|
884
|
-
)) : /* @__PURE__ */ r.jsx("li", { style: { padding: "6px 12px", color: "#999" }, children: "No matches" })
|
|
894
|
+
x
|
|
895
|
+
);
|
|
896
|
+
}) : /* @__PURE__ */ a.jsx("li", { style: { padding: "6px 12px", color: "#999" }, children: "No matches" })
|
|
885
897
|
}
|
|
886
898
|
) : null;
|
|
887
899
|
};
|
|
888
|
-
function
|
|
889
|
-
return
|
|
900
|
+
function Le(t) {
|
|
901
|
+
return N({ 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);
|
|
890
902
|
}
|
|
891
903
|
function me(t) {
|
|
892
|
-
return
|
|
904
|
+
return N({ 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);
|
|
893
905
|
}
|
|
894
|
-
const
|
|
906
|
+
const mt = ({
|
|
895
907
|
visible: t,
|
|
896
908
|
x: s,
|
|
897
909
|
y: u,
|
|
@@ -899,46 +911,46 @@ const it = ({
|
|
|
899
911
|
onClose: h
|
|
900
912
|
}) => {
|
|
901
913
|
if (!t) return null;
|
|
902
|
-
const
|
|
914
|
+
const v = {
|
|
903
915
|
top: u,
|
|
904
916
|
left: s
|
|
905
917
|
};
|
|
906
|
-
return /* @__PURE__ */
|
|
907
|
-
/* @__PURE__ */
|
|
908
|
-
/* @__PURE__ */
|
|
918
|
+
return /* @__PURE__ */ a.jsxs("div", { style: v, className: "rte-table-menu", onMouseLeave: h, children: [
|
|
919
|
+
/* @__PURE__ */ a.jsxs("button", { onClick: () => c("insertRowAbove"), children: [
|
|
920
|
+
/* @__PURE__ */ a.jsx(me, {}),
|
|
909
921
|
" Insert row above"
|
|
910
922
|
] }),
|
|
911
|
-
/* @__PURE__ */
|
|
912
|
-
/* @__PURE__ */
|
|
923
|
+
/* @__PURE__ */ a.jsxs("button", { onClick: () => c("insertRowBelow"), children: [
|
|
924
|
+
/* @__PURE__ */ a.jsx(me, {}),
|
|
913
925
|
" Insert row below"
|
|
914
926
|
] }),
|
|
915
|
-
/* @__PURE__ */
|
|
916
|
-
/* @__PURE__ */
|
|
927
|
+
/* @__PURE__ */ a.jsxs("button", { onClick: () => c("insertColLeft"), children: [
|
|
928
|
+
/* @__PURE__ */ a.jsx(me, {}),
|
|
917
929
|
" Insert col left"
|
|
918
930
|
] }),
|
|
919
|
-
/* @__PURE__ */
|
|
920
|
-
/* @__PURE__ */
|
|
931
|
+
/* @__PURE__ */ a.jsxs("button", { onClick: () => c("insertColRight"), children: [
|
|
932
|
+
/* @__PURE__ */ a.jsx(me, {}),
|
|
921
933
|
" Insert col right"
|
|
922
934
|
] }),
|
|
923
|
-
/* @__PURE__ */
|
|
924
|
-
/* @__PURE__ */
|
|
935
|
+
/* @__PURE__ */ a.jsxs("button", { onClick: () => c("deleteRow"), children: [
|
|
936
|
+
/* @__PURE__ */ a.jsx(Le, {}),
|
|
925
937
|
" Delete row"
|
|
926
938
|
] }),
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
/* @__PURE__ */
|
|
939
|
+
/* @__PURE__ */ a.jsxs("button", { onClick: () => c("deleteCol"), children: [
|
|
940
|
+
/* @__PURE__ */ a.jsx(Le, {}),
|
|
929
941
|
" Delete column"
|
|
930
942
|
] })
|
|
931
943
|
] });
|
|
932
|
-
},
|
|
944
|
+
}, ft = ({ html: t, className: s, style: u }) => {
|
|
933
945
|
const c = (h) => {
|
|
934
|
-
const
|
|
935
|
-
if (
|
|
946
|
+
const v = h.target;
|
|
947
|
+
if (v.tagName === "A") {
|
|
936
948
|
h.preventDefault();
|
|
937
|
-
const
|
|
938
|
-
|
|
949
|
+
const L = v.href;
|
|
950
|
+
L && window.open(L, "_blank", "noopener,noreferrer");
|
|
939
951
|
}
|
|
940
952
|
};
|
|
941
|
-
return /* @__PURE__ */
|
|
953
|
+
return /* @__PURE__ */ a.jsx(
|
|
942
954
|
"div",
|
|
943
955
|
{
|
|
944
956
|
className: `rte-preview ${s || ""}`,
|
|
@@ -947,79 +959,79 @@ const it = ({
|
|
|
947
959
|
dangerouslySetInnerHTML: { __html: t }
|
|
948
960
|
}
|
|
949
961
|
);
|
|
950
|
-
},
|
|
962
|
+
}, ht = ({
|
|
951
963
|
visible: t,
|
|
952
964
|
linkData: s,
|
|
953
965
|
onClose: u,
|
|
954
966
|
onInsert: c
|
|
955
967
|
}) => {
|
|
956
|
-
const [h,
|
|
957
|
-
if (
|
|
958
|
-
t ? (
|
|
968
|
+
const [h, v] = H(""), [L, y] = H(""), [x, F] = H(""), [O, k] = H("_self");
|
|
969
|
+
if (oe(() => {
|
|
970
|
+
t ? (v(s.url || ""), y(s.text || ""), F(s.title || ""), k(s.target || "_self")) : (v(""), y(""), F(""), k("_self"));
|
|
959
971
|
}, [t, s]), !t) return null;
|
|
960
|
-
const
|
|
961
|
-
c({ url: h, text:
|
|
972
|
+
const P = () => {
|
|
973
|
+
c({ url: h, text: L, title: x, target: O });
|
|
962
974
|
};
|
|
963
|
-
return /* @__PURE__ */
|
|
964
|
-
/* @__PURE__ */
|
|
965
|
-
/* @__PURE__ */
|
|
966
|
-
/* @__PURE__ */
|
|
967
|
-
/* @__PURE__ */
|
|
975
|
+
return /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
976
|
+
/* @__PURE__ */ a.jsx("div", { className: "rte-link-modal-overlay", onClick: u }),
|
|
977
|
+
/* @__PURE__ */ a.jsxs("div", { className: "rte-link-modal", children: [
|
|
978
|
+
/* @__PURE__ */ a.jsx("h4", { className: "rte-link-modal__title", children: h ? "Edit Link" : "Insert Link" }),
|
|
979
|
+
/* @__PURE__ */ a.jsx(
|
|
968
980
|
"input",
|
|
969
981
|
{
|
|
970
982
|
type: "text",
|
|
971
983
|
className: "rte-link-modal__input",
|
|
972
984
|
placeholder: "URL",
|
|
973
985
|
value: h,
|
|
974
|
-
onChange: (
|
|
986
|
+
onChange: (C) => v(C.target.value)
|
|
975
987
|
}
|
|
976
988
|
),
|
|
977
|
-
/* @__PURE__ */
|
|
989
|
+
/* @__PURE__ */ a.jsx(
|
|
978
990
|
"input",
|
|
979
991
|
{
|
|
980
992
|
type: "text",
|
|
981
993
|
className: "rte-link-modal__input",
|
|
982
994
|
placeholder: "Text to Display",
|
|
983
|
-
value:
|
|
984
|
-
onChange: (
|
|
995
|
+
value: L,
|
|
996
|
+
onChange: (C) => y(C.target.value)
|
|
985
997
|
}
|
|
986
998
|
),
|
|
987
|
-
/* @__PURE__ */
|
|
999
|
+
/* @__PURE__ */ a.jsx(
|
|
988
1000
|
"input",
|
|
989
1001
|
{
|
|
990
1002
|
type: "text",
|
|
991
1003
|
className: "rte-link-modal__input",
|
|
992
1004
|
placeholder: "Title",
|
|
993
1005
|
value: x,
|
|
994
|
-
onChange: (
|
|
1006
|
+
onChange: (C) => F(C.target.value)
|
|
995
1007
|
}
|
|
996
1008
|
),
|
|
997
|
-
/* @__PURE__ */
|
|
1009
|
+
/* @__PURE__ */ a.jsxs(
|
|
998
1010
|
"select",
|
|
999
1011
|
{
|
|
1000
1012
|
className: "rte-link-modal__select",
|
|
1001
|
-
value:
|
|
1002
|
-
onChange: (
|
|
1013
|
+
value: O,
|
|
1014
|
+
onChange: (C) => k(C.target.value),
|
|
1003
1015
|
children: [
|
|
1004
|
-
/* @__PURE__ */
|
|
1005
|
-
/* @__PURE__ */
|
|
1016
|
+
/* @__PURE__ */ a.jsx("option", { value: "_self", children: "Same tab" }),
|
|
1017
|
+
/* @__PURE__ */ a.jsx("option", { value: "_blank", children: "New tab" })
|
|
1006
1018
|
]
|
|
1007
1019
|
}
|
|
1008
1020
|
),
|
|
1009
|
-
/* @__PURE__ */
|
|
1010
|
-
/* @__PURE__ */
|
|
1011
|
-
/* @__PURE__ */
|
|
1021
|
+
/* @__PURE__ */ a.jsxs("div", { className: "rte-link-modal__actions", children: [
|
|
1022
|
+
/* @__PURE__ */ a.jsx("button", { className: "rte-link-modal__btn", onClick: u, children: "Cancel" }),
|
|
1023
|
+
/* @__PURE__ */ a.jsx(
|
|
1012
1024
|
"button",
|
|
1013
1025
|
{
|
|
1014
1026
|
className: "rte-link-modal__btn rte-link-modal__btn--ok",
|
|
1015
|
-
onClick:
|
|
1027
|
+
onClick: P,
|
|
1016
1028
|
children: "OK"
|
|
1017
1029
|
}
|
|
1018
1030
|
)
|
|
1019
1031
|
] })
|
|
1020
1032
|
] })
|
|
1021
1033
|
] });
|
|
1022
|
-
},
|
|
1034
|
+
}, gt = ({
|
|
1023
1035
|
atSuggestions: t = [],
|
|
1024
1036
|
showOutput: s = !1,
|
|
1025
1037
|
showPreview: u = !1,
|
|
@@ -1034,16 +1046,18 @@ const it = ({
|
|
|
1034
1046
|
highlight: !1
|
|
1035
1047
|
},
|
|
1036
1048
|
classNames: h = {},
|
|
1037
|
-
styles:
|
|
1038
|
-
handleGetHtml:
|
|
1049
|
+
styles: v = {},
|
|
1050
|
+
handleGetHtml: L = () => {
|
|
1039
1051
|
}
|
|
1040
1052
|
}) => {
|
|
1041
|
-
const y =
|
|
1053
|
+
const y = Y(null), [x, F] = H("<p>Always bet on Prime!</p>"), [O, k] = H(!1), [P, C] = H({ x: 0, y: 0 }), [q, B] = H(
|
|
1054
|
+
[]
|
|
1055
|
+
), S = Y(null), W = Y(null), [D, f] = H({ visible: !1, x: 0, y: 0 }), [M, X] = H(!1), G = Y(null), [pe, ae] = H({
|
|
1042
1056
|
url: "",
|
|
1043
1057
|
text: "",
|
|
1044
1058
|
title: "",
|
|
1045
1059
|
target: "_self"
|
|
1046
|
-
}),
|
|
1060
|
+
}), J = {
|
|
1047
1061
|
bold: !0,
|
|
1048
1062
|
italic: !0,
|
|
1049
1063
|
underline: !0,
|
|
@@ -1059,160 +1073,211 @@ const it = ({
|
|
|
1059
1073
|
fontFamily: c.fontFamily ?? !1,
|
|
1060
1074
|
fontSize: c.fontSize ?? !1,
|
|
1061
1075
|
highlight: c.fontSize ?? !1
|
|
1062
|
-
},
|
|
1063
|
-
|
|
1064
|
-
const e =
|
|
1065
|
-
|
|
1066
|
-
},
|
|
1076
|
+
}, [ge, le] = H(""), z = () => y.current, T = () => {
|
|
1077
|
+
F(z()?.innerHTML ?? "");
|
|
1078
|
+
const e = be();
|
|
1079
|
+
L?.(e);
|
|
1080
|
+
}, se = () => {
|
|
1067
1081
|
const e = window.getSelection();
|
|
1068
|
-
e?.rangeCount && (
|
|
1069
|
-
},
|
|
1082
|
+
e?.rangeCount && (S.current = e.getRangeAt(0));
|
|
1083
|
+
}, $ = () => {
|
|
1070
1084
|
const e = window.getSelection();
|
|
1071
|
-
e &&
|
|
1072
|
-
},
|
|
1073
|
-
const
|
|
1074
|
-
|
|
1085
|
+
e && S.current && (e.removeAllRanges(), e.addRange(S.current));
|
|
1086
|
+
}, ie = (e, o) => {
|
|
1087
|
+
const r = window.getSelection();
|
|
1088
|
+
r && r.rangeCount > 0 && (S.current = r.getRangeAt(0)), $(), document.execCommand(e, !1, o), T();
|
|
1075
1089
|
};
|
|
1076
|
-
|
|
1077
|
-
const e =
|
|
1078
|
-
e && !e.innerHTML && (e.innerHTML = x),
|
|
1079
|
-
}, []),
|
|
1090
|
+
oe(() => {
|
|
1091
|
+
const e = z();
|
|
1092
|
+
e && !e.innerHTML && (e.innerHTML = x), T();
|
|
1093
|
+
}, []), oe(() => () => {
|
|
1080
1094
|
document.removeEventListener("mousemove", null), document.removeEventListener("mouseup", null);
|
|
1081
1095
|
}, []);
|
|
1082
1096
|
const K = (e) => {
|
|
1083
1097
|
for (; e && e.nodeName !== "LI"; )
|
|
1084
1098
|
e = e.parentNode;
|
|
1085
1099
|
return e;
|
|
1086
|
-
}, ie = (e) => {
|
|
1087
|
-
let a = 0, o = e.parentElement;
|
|
1088
|
-
for (; o; )
|
|
1089
|
-
(o.tagName === "UL" || o.tagName === "OL") && a++, o = o.parentElement;
|
|
1090
|
-
return a;
|
|
1091
1100
|
}, ce = (e) => {
|
|
1092
|
-
|
|
1101
|
+
let o = 0, r = e.parentElement;
|
|
1102
|
+
for (; r; )
|
|
1103
|
+
(r.tagName === "UL" || r.tagName === "OL") && o++, r = r.parentElement;
|
|
1104
|
+
return o;
|
|
1105
|
+
}, ue = (e) => {
|
|
1106
|
+
const o = e.querySelector("li"), r = o ? ce(o) : 1;
|
|
1093
1107
|
if (e.querySelector("[data-hidden-array-start]")) return;
|
|
1094
|
-
const l = `{{#arrayData${
|
|
1108
|
+
const l = `{{#arrayData${r > 1 ? r : ""}}}`, g = `{{/arrayData${r > 1 ? r : ""}}}`, i = document.createElement("span");
|
|
1095
1109
|
i.textContent = l, i.style.display = "none", i.setAttribute("data-hidden-array-start", "true"), e.insertBefore(i, e.firstChild);
|
|
1096
|
-
const
|
|
1097
|
-
|
|
1098
|
-
},
|
|
1099
|
-
const
|
|
1100
|
-
if (!
|
|
1101
|
-
const
|
|
1102
|
-
let
|
|
1110
|
+
const m = document.createElement("span");
|
|
1111
|
+
m.textContent = g, m.style.display = "none", m.setAttribute("data-hidden-array-end", "true"), e.appendChild(m);
|
|
1112
|
+
}, Q = (e) => {
|
|
1113
|
+
const o = window.getSelection();
|
|
1114
|
+
if (!o?.rangeCount) return;
|
|
1115
|
+
const r = o.getRangeAt(0), l = K(r.startContainer);
|
|
1116
|
+
let g, i;
|
|
1103
1117
|
if (l) {
|
|
1104
1118
|
let d = l.querySelector(e);
|
|
1105
|
-
d || (d = document.createElement(e), d.style.margin = "0", d.style.paddingLeft = "20px", l.appendChild(d)), i = d,
|
|
1119
|
+
d || (d = document.createElement(e), d.style.margin = "0", d.style.paddingLeft = "20px", l.appendChild(d)), i = d, g = document.createElement("li"), g.textContent = "", i.appendChild(g);
|
|
1106
1120
|
} else {
|
|
1107
1121
|
if (document.execCommand(
|
|
1108
1122
|
e === "ul" ? "insertUnorderedList" : "insertOrderedList"
|
|
1109
|
-
), i =
|
|
1110
|
-
|
|
1123
|
+
), i = z()?.querySelector(`${e}:last-child`), !i) return;
|
|
1124
|
+
g = i.querySelector("li:last-child");
|
|
1111
1125
|
}
|
|
1112
|
-
|
|
1113
|
-
const
|
|
1114
|
-
|
|
1115
|
-
},
|
|
1116
|
-
e === "insertOrderedList" ?
|
|
1117
|
-
},
|
|
1118
|
-
const
|
|
1119
|
-
|
|
1120
|
-
const
|
|
1121
|
-
|
|
1122
|
-
},
|
|
1123
|
-
const
|
|
1124
|
-
if (!
|
|
1126
|
+
ue(i);
|
|
1127
|
+
const m = document.createRange();
|
|
1128
|
+
m.setStart(g, 0), m.collapse(!0), o.removeAllRanges(), o.addRange(m), z()?.focus(), T();
|
|
1129
|
+
}, n = (e, o) => {
|
|
1130
|
+
e === "insertOrderedList" ? Q("ol") : e === "insertUnorderedList" ? Q("ul") : ie(e, o), e === "insertTable" && ve();
|
|
1131
|
+
}, p = (e) => {
|
|
1132
|
+
const o = document.createElement("span");
|
|
1133
|
+
o.textContent = "", e.insertNode(o), e.setStartAfter(o), e.collapse(!0);
|
|
1134
|
+
const r = o.getBoundingClientRect();
|
|
1135
|
+
o.remove(), C({ x: r.left, y: r.bottom + window.scrollY }), B(t || []), k(!0), W.current = e.cloneRange();
|
|
1136
|
+
}, R = () => {
|
|
1137
|
+
const e = window.getSelection();
|
|
1138
|
+
if (!e || e.rangeCount === 0) return null;
|
|
1139
|
+
const o = e.anchorNode;
|
|
1140
|
+
let r = e.anchorOffset;
|
|
1141
|
+
if (!o) return null;
|
|
1142
|
+
let l = o;
|
|
1143
|
+
for (l.nodeType !== Node.TEXT_NODE && (l.childNodes && l.childNodes[r] ? l = l.childNodes[r] : l = o.previousSibling); l; ) {
|
|
1144
|
+
if (l.nodeType === Node.TEXT_NODE) {
|
|
1145
|
+
const g = l.textContent || "", i = l === o ? r : g.length, m = g.lastIndexOf("@", i - 1);
|
|
1146
|
+
if (m !== -1) {
|
|
1147
|
+
const d = document.createRange();
|
|
1148
|
+
return d.setStart(l, m), d.setEnd(l, i), d;
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
l = l.previousSibling;
|
|
1152
|
+
}
|
|
1153
|
+
return null;
|
|
1154
|
+
}, _ = (e) => {
|
|
1125
1155
|
const o = window.getSelection();
|
|
1126
|
-
o
|
|
1156
|
+
if (!o) return;
|
|
1157
|
+
const r = R();
|
|
1158
|
+
r ? (o.removeAllRanges(), o.addRange(r)) : W.current && (o.removeAllRanges(), o.addRange(W.current));
|
|
1127
1159
|
const l = document.createElement("span");
|
|
1128
|
-
l.textContent = `{{${e.key}}}`, l.style.color = "#007bff", l.style.display = "inline", l.contentEditable = "false",
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1160
|
+
l.textContent = `{{${e.key}}}`, l.style.color = "#007bff", l.style.display = "inline", l.contentEditable = "false", l.setAttribute("data-mention", e.value || e.key || "");
|
|
1161
|
+
try {
|
|
1162
|
+
const g = o.rangeCount ? o.getRangeAt(0) : null;
|
|
1163
|
+
if (g)
|
|
1164
|
+
g.deleteContents(), g.insertNode(l);
|
|
1165
|
+
else {
|
|
1166
|
+
const d = document.createRange(), w = z();
|
|
1167
|
+
d.selectNodeContents(w), d.collapse(!1), d.insertNode(l);
|
|
1168
|
+
}
|
|
1169
|
+
const i = document.createTextNode(" ");
|
|
1170
|
+
l.after(i);
|
|
1171
|
+
const m = document.createRange();
|
|
1172
|
+
m.setStartAfter(i), m.collapse(!0), o.removeAllRanges(), o.addRange(m);
|
|
1173
|
+
} catch (g) {
|
|
1174
|
+
console.error("insertMention error:", g);
|
|
1175
|
+
}
|
|
1176
|
+
k(!1), z()?.focus(), T();
|
|
1177
|
+
}, Z = (e) => {
|
|
1178
|
+
const o = e.key.toLowerCase();
|
|
1179
|
+
if ((e.ctrlKey || e.metaKey) && ["b", "i", "u"].includes(o) && (e.preventDefault(), n(
|
|
1180
|
+
o === "b" ? "bold" : o === "i" ? "italic" : o === "u" ? "underline" : ""
|
|
1137
1181
|
)), e.shiftKey && e.key === "2" && e.preventDefault(), e.key === "Enter") {
|
|
1138
|
-
const
|
|
1182
|
+
const r = window.getSelection(), l = r?.anchorNode ? K(r.anchorNode) : null;
|
|
1139
1183
|
if (!l) return;
|
|
1140
1184
|
if (l.textContent?.replace(/\u200B/g, "").trim() === "") {
|
|
1141
1185
|
e.preventDefault();
|
|
1142
|
-
const i = l.parentElement,
|
|
1143
|
-
if (
|
|
1186
|
+
const i = l.parentElement, m = i?.closest("li");
|
|
1187
|
+
if (m) {
|
|
1144
1188
|
i?.removeChild(l);
|
|
1145
1189
|
const d = document.createElement("p");
|
|
1146
|
-
d.innerHTML = "<br />",
|
|
1147
|
-
const
|
|
1148
|
-
|
|
1190
|
+
d.innerHTML = "<br />", m.parentElement?.insertBefore(d, m.nextSibling);
|
|
1191
|
+
const w = document.createRange();
|
|
1192
|
+
w.setStart(d, 0), w.collapse(!0), r?.removeAllRanges(), r?.addRange(w);
|
|
1149
1193
|
} else {
|
|
1150
1194
|
const d = l.closest("ul, ol");
|
|
1151
1195
|
if (d) {
|
|
1152
|
-
const
|
|
1153
|
-
|
|
1154
|
-
const
|
|
1155
|
-
|
|
1196
|
+
const w = document.createElement("p");
|
|
1197
|
+
w.innerHTML = "<br />", d.parentElement?.insertBefore(w, d.nextSibling), d.removeChild(l);
|
|
1198
|
+
const E = document.createRange();
|
|
1199
|
+
E.setStart(w, 0), E.collapse(!0), r?.removeAllRanges(), r?.addRange(E);
|
|
1156
1200
|
}
|
|
1157
1201
|
}
|
|
1158
|
-
|
|
1202
|
+
T();
|
|
1159
1203
|
}
|
|
1160
1204
|
}
|
|
1161
|
-
},
|
|
1162
|
-
if (e.data
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1205
|
+
}, ee = (e) => {
|
|
1206
|
+
if (e.data === "@") {
|
|
1207
|
+
const r = window.getSelection();
|
|
1208
|
+
if (!r?.rangeCount) return;
|
|
1209
|
+
setTimeout(() => {
|
|
1210
|
+
p(r.getRangeAt(0)), le(""), B(t), k(!0);
|
|
1211
|
+
}, 0);
|
|
1212
|
+
return;
|
|
1213
|
+
}
|
|
1214
|
+
if (O) {
|
|
1215
|
+
setTimeout(() => j(), 0);
|
|
1216
|
+
return;
|
|
1217
|
+
}
|
|
1218
|
+
}, j = () => {
|
|
1219
|
+
if (T(), !O) return;
|
|
1220
|
+
const e = window.getSelection();
|
|
1221
|
+
if (!e || !e.anchorNode) return;
|
|
1222
|
+
const r = (e.anchorNode.textContent || "").match(/@([a-zA-Z0-9_]*)$/);
|
|
1223
|
+
if (!r) {
|
|
1224
|
+
k(!1);
|
|
1225
|
+
return;
|
|
1226
|
+
}
|
|
1227
|
+
const l = r[1].toLowerCase();
|
|
1228
|
+
le(l);
|
|
1229
|
+
const g = t.filter((i) => i.key.toLowerCase().includes(l));
|
|
1230
|
+
B(g);
|
|
1231
|
+
}, V = (e) => {
|
|
1232
|
+
const o = e.target.files?.[0];
|
|
1233
|
+
if (!o) return;
|
|
1234
|
+
const r = new FileReader();
|
|
1235
|
+
r.onload = (l) => {
|
|
1236
|
+
const g = l.target?.result;
|
|
1237
|
+
$();
|
|
1173
1238
|
const i = window.getSelection();
|
|
1174
|
-
let
|
|
1239
|
+
let m = i && i.rangeCount ? i.getRangeAt(0) : null;
|
|
1175
1240
|
const d = document.createElement("img");
|
|
1176
|
-
d.src =
|
|
1177
|
-
const
|
|
1178
|
-
if (!
|
|
1179
|
-
|
|
1180
|
-
const
|
|
1181
|
-
|
|
1182
|
-
const
|
|
1183
|
-
|
|
1241
|
+
d.src = g, d.alt = o.name || "image", d.className = "rte-inserted-image", d.contentEditable = "true";
|
|
1242
|
+
const w = z();
|
|
1243
|
+
if (!m || !w) {
|
|
1244
|
+
w?.appendChild(d);
|
|
1245
|
+
const A = document.createTextNode(" ");
|
|
1246
|
+
w?.appendChild(A);
|
|
1247
|
+
const I = document.createRange();
|
|
1248
|
+
I.setStartAfter(A), I.collapse(!0), i?.removeAllRanges(), i?.addRange(I), w?.focus(), T(), e.target.value = "";
|
|
1184
1249
|
return;
|
|
1185
1250
|
}
|
|
1186
|
-
|
|
1187
|
-
const
|
|
1188
|
-
d.after(
|
|
1189
|
-
const
|
|
1190
|
-
|
|
1191
|
-
},
|
|
1192
|
-
},
|
|
1193
|
-
|
|
1194
|
-
const
|
|
1195
|
-
if (!
|
|
1196
|
-
const
|
|
1197
|
-
|
|
1198
|
-
},
|
|
1199
|
-
|
|
1251
|
+
m.deleteContents(), m.insertNode(d);
|
|
1252
|
+
const E = document.createTextNode(" ");
|
|
1253
|
+
d.after(E);
|
|
1254
|
+
const b = document.createRange();
|
|
1255
|
+
b.setStartAfter(E), b.collapse(!0), i.removeAllRanges(), i.addRange(b), w.focus(), T(), e.target.value = "";
|
|
1256
|
+
}, r.readAsDataURL(o);
|
|
1257
|
+
}, te = (e) => {
|
|
1258
|
+
$();
|
|
1259
|
+
const o = window.getSelection();
|
|
1260
|
+
if (!o?.rangeCount) return;
|
|
1261
|
+
const r = o.getRangeAt(0), l = document.createTextNode(e);
|
|
1262
|
+
r.insertNode(l), r.setStartAfter(l), r.collapse(!0), o.removeAllRanges(), o.addRange(r), z()?.focus(), T();
|
|
1263
|
+
}, ve = () => {
|
|
1264
|
+
$();
|
|
1200
1265
|
const e = document.createElement("table");
|
|
1201
1266
|
e.style.borderCollapse = "collapse", e.style.width = "100%", e.style.border = "1px solid #ccc", e.style.margin = "8px 0", e.style.position = "relative";
|
|
1202
|
-
const
|
|
1267
|
+
const o = document.createElement("thead"), r = document.createElement("tbody"), l = document.createElement("tr"), g = document.createElement("tr");
|
|
1203
1268
|
for (let d = 0; d < 2; d++) {
|
|
1204
|
-
const
|
|
1205
|
-
|
|
1206
|
-
const
|
|
1207
|
-
|
|
1269
|
+
const w = document.createElement("th");
|
|
1270
|
+
w.textContent = `Header ${d + 1}`, w.style.border = "1px solid #999", w.style.padding = "8px", w.style.position = "relative";
|
|
1271
|
+
const E = document.createElement("td");
|
|
1272
|
+
E.textContent = `Row 1 Col ${d + 1}`, E.style.border = "1px solid #999", E.style.padding = "8px", E.style.position = "relative", xe(w), xe(E), l.appendChild(w), g.appendChild(E);
|
|
1208
1273
|
}
|
|
1209
|
-
|
|
1274
|
+
o.appendChild(l), r.appendChild(g), e.appendChild(o), e.appendChild(r), Me(e), Se(e);
|
|
1210
1275
|
const i = window.getSelection();
|
|
1211
1276
|
if (!i?.rangeCount) return;
|
|
1212
|
-
i.getRangeAt(0).insertNode(e),
|
|
1213
|
-
},
|
|
1214
|
-
const
|
|
1215
|
-
Object.assign(
|
|
1277
|
+
i.getRangeAt(0).insertNode(e), T();
|
|
1278
|
+
}, Se = (e) => {
|
|
1279
|
+
const o = document.createElement("div");
|
|
1280
|
+
Object.assign(o.style, {
|
|
1216
1281
|
position: "absolute",
|
|
1217
1282
|
width: "14px",
|
|
1218
1283
|
height: "14px",
|
|
@@ -1223,22 +1288,22 @@ const it = ({
|
|
|
1223
1288
|
zIndex: "20",
|
|
1224
1289
|
borderRadius: "2px"
|
|
1225
1290
|
});
|
|
1226
|
-
let
|
|
1227
|
-
|
|
1228
|
-
|
|
1291
|
+
let r = 0, l = 0, g = 0, i = 0;
|
|
1292
|
+
o.addEventListener("mousedown", (m) => {
|
|
1293
|
+
m.preventDefault(), r = m.clientX, l = m.clientY;
|
|
1229
1294
|
const d = e.getBoundingClientRect();
|
|
1230
|
-
|
|
1231
|
-
const
|
|
1232
|
-
const
|
|
1233
|
-
e.style.width = `${
|
|
1234
|
-
},
|
|
1235
|
-
document.removeEventListener("mousemove",
|
|
1295
|
+
g = d.width, i = d.height;
|
|
1296
|
+
const w = (b) => {
|
|
1297
|
+
const A = Math.max(100, g + (b.clientX - r)), I = Math.max(60, i + (b.clientY - l));
|
|
1298
|
+
e.style.width = `${A}px`, e.style.height = `${I}px`, T();
|
|
1299
|
+
}, E = () => {
|
|
1300
|
+
document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", E), T();
|
|
1236
1301
|
};
|
|
1237
|
-
document.addEventListener("mousemove",
|
|
1238
|
-
}), e.appendChild(
|
|
1239
|
-
},
|
|
1240
|
-
const
|
|
1241
|
-
Object.assign(
|
|
1302
|
+
document.addEventListener("mousemove", w), document.addEventListener("mouseup", E);
|
|
1303
|
+
}), e.appendChild(o);
|
|
1304
|
+
}, xe = (e) => {
|
|
1305
|
+
const o = document.createElement("div"), r = document.createElement("div");
|
|
1306
|
+
Object.assign(o.style, {
|
|
1242
1307
|
position: "absolute",
|
|
1243
1308
|
right: "0",
|
|
1244
1309
|
top: "0",
|
|
@@ -1247,7 +1312,7 @@ const it = ({
|
|
|
1247
1312
|
cursor: "col-resize",
|
|
1248
1313
|
background: "rgba(0,0,0,0.15)",
|
|
1249
1314
|
zIndex: "10"
|
|
1250
|
-
}), Object.assign(
|
|
1315
|
+
}), Object.assign(r.style, {
|
|
1251
1316
|
position: "absolute",
|
|
1252
1317
|
bottom: "0",
|
|
1253
1318
|
left: "0",
|
|
@@ -1256,248 +1321,249 @@ const it = ({
|
|
|
1256
1321
|
cursor: "row-resize",
|
|
1257
1322
|
background: "rgba(0,0,0,0.15)",
|
|
1258
1323
|
zIndex: "10"
|
|
1259
|
-
}),
|
|
1260
|
-
},
|
|
1261
|
-
let l = 0,
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
}),
|
|
1265
|
-
|
|
1324
|
+
}), Te(e, o, r), e.appendChild(o), e.appendChild(r);
|
|
1325
|
+
}, Te = (e, o, r) => {
|
|
1326
|
+
let l = 0, g = 0, i = 0, m = 0;
|
|
1327
|
+
o.addEventListener("mousedown", (b) => {
|
|
1328
|
+
b.preventDefault(), l = b.clientX, i = e.offsetWidth, document.addEventListener("mousemove", d), document.addEventListener("mouseup", E);
|
|
1329
|
+
}), r.addEventListener("mousedown", (b) => {
|
|
1330
|
+
b.preventDefault(), g = b.clientY, m = e.offsetHeight, document.addEventListener("mousemove", w), document.addEventListener("mouseup", E);
|
|
1266
1331
|
});
|
|
1267
|
-
const d = (
|
|
1268
|
-
const
|
|
1269
|
-
e.style.width = `${Math.max(30,
|
|
1270
|
-
},
|
|
1271
|
-
const
|
|
1272
|
-
e.style.height = `${Math.max(20,
|
|
1273
|
-
},
|
|
1274
|
-
document.removeEventListener("mousemove", d), document.removeEventListener("mousemove",
|
|
1332
|
+
const d = (b) => {
|
|
1333
|
+
const A = i + (b.clientX - l);
|
|
1334
|
+
e.style.width = `${Math.max(30, A)}px`;
|
|
1335
|
+
}, w = (b) => {
|
|
1336
|
+
const A = m + (b.clientY - g);
|
|
1337
|
+
e.style.height = `${Math.max(20, A)}px`;
|
|
1338
|
+
}, E = () => {
|
|
1339
|
+
document.removeEventListener("mousemove", d), document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", E);
|
|
1275
1340
|
};
|
|
1276
|
-
},
|
|
1277
|
-
const
|
|
1278
|
-
|
|
1279
|
-
},
|
|
1341
|
+
}, Ne = (e) => {
|
|
1342
|
+
const r = e.target.closest("td, th");
|
|
1343
|
+
r && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((l) => l.classList.remove("rte-cell-highlight")), r.classList.add("rte-cell-highlight"), f({ visible: !0, x: e.clientX, y: e.clientY, cell: r }));
|
|
1344
|
+
}, we = () => {
|
|
1280
1345
|
document.querySelectorAll(".rte-cell-highlight").forEach((e) => e.classList.remove("rte-cell-highlight"));
|
|
1281
|
-
},
|
|
1282
|
-
if (!
|
|
1283
|
-
const
|
|
1284
|
-
const
|
|
1285
|
-
return d.textContent = i.textContent || "", d.style.cssText = i.style.cssText,
|
|
1346
|
+
}, Ae = (e) => {
|
|
1347
|
+
if (!D.cell) return;
|
|
1348
|
+
const o = D.cell.closest("table"), r = D.cell.cellIndex, l = D.cell.parentElement.rowIndex, g = (i) => {
|
|
1349
|
+
const m = i.tagName.toLowerCase(), d = document.createElement(m);
|
|
1350
|
+
return d.textContent = i.textContent || "", d.style.cssText = i.style.cssText, xe(d), d;
|
|
1286
1351
|
};
|
|
1287
1352
|
switch (e) {
|
|
1288
1353
|
case "insertRowAbove": {
|
|
1289
|
-
const i =
|
|
1354
|
+
const i = o.rows[l], m = o.insertRow(l);
|
|
1290
1355
|
Array.from(i.cells).forEach((d) => {
|
|
1291
|
-
|
|
1356
|
+
m.appendChild(g(d));
|
|
1292
1357
|
});
|
|
1293
1358
|
break;
|
|
1294
1359
|
}
|
|
1295
1360
|
case "insertRowBelow": {
|
|
1296
|
-
const i =
|
|
1361
|
+
const i = o.rows[l], m = o.insertRow(l + 1);
|
|
1297
1362
|
Array.from(i.cells).forEach((d) => {
|
|
1298
|
-
|
|
1363
|
+
m.appendChild(g(d));
|
|
1299
1364
|
});
|
|
1300
1365
|
break;
|
|
1301
1366
|
}
|
|
1302
1367
|
case "insertColLeft": {
|
|
1303
|
-
Array.from(
|
|
1304
|
-
const
|
|
1305
|
-
i.insertBefore(
|
|
1368
|
+
Array.from(o.rows).forEach((i) => {
|
|
1369
|
+
const m = i.cells[r];
|
|
1370
|
+
i.insertBefore(g(m), m);
|
|
1306
1371
|
});
|
|
1307
1372
|
break;
|
|
1308
1373
|
}
|
|
1309
1374
|
case "insertColRight": {
|
|
1310
|
-
Array.from(
|
|
1311
|
-
const
|
|
1312
|
-
i.insertBefore(
|
|
1375
|
+
Array.from(o.rows).forEach((i) => {
|
|
1376
|
+
const m = i.cells[r];
|
|
1377
|
+
i.insertBefore(g(m), m.nextSibling);
|
|
1313
1378
|
});
|
|
1314
1379
|
break;
|
|
1315
1380
|
}
|
|
1316
1381
|
case "deleteRow":
|
|
1317
|
-
|
|
1382
|
+
o.rows.length > 1 && o.deleteRow(l);
|
|
1318
1383
|
break;
|
|
1319
1384
|
case "deleteCol":
|
|
1320
|
-
Array.from(
|
|
1321
|
-
i.cells[
|
|
1385
|
+
Array.from(o.rows).forEach((i) => {
|
|
1386
|
+
i.cells[r] && i.deleteCell(r);
|
|
1322
1387
|
});
|
|
1323
1388
|
break;
|
|
1324
1389
|
}
|
|
1325
|
-
|
|
1326
|
-
},
|
|
1327
|
-
const
|
|
1328
|
-
if (!
|
|
1329
|
-
const
|
|
1330
|
-
|
|
1390
|
+
T(), f({ ...D, visible: !1 }), we();
|
|
1391
|
+
}, Me = (e) => {
|
|
1392
|
+
const o = e.querySelector("tbody");
|
|
1393
|
+
if (!o || o.querySelector("[data-hidden-table-start]")) return;
|
|
1394
|
+
const r = document.createElement("span");
|
|
1395
|
+
r.textContent = "{{#tableData}}", r.style.display = "none", r.setAttribute("data-hidden-table-start", "true"), o.insertBefore(r, o.firstChild);
|
|
1331
1396
|
const l = document.createElement("span");
|
|
1332
|
-
l.textContent = "{{/tableData}}", l.style.display = "none", l.setAttribute("data-hidden-table-end", "true"),
|
|
1333
|
-
},
|
|
1334
|
-
const e =
|
|
1397
|
+
l.textContent = "{{/tableData}}", l.style.display = "none", l.setAttribute("data-hidden-table-end", "true"), o.appendChild(l);
|
|
1398
|
+
}, be = () => {
|
|
1399
|
+
const e = z();
|
|
1335
1400
|
if (!e) return x;
|
|
1336
|
-
const
|
|
1337
|
-
return
|
|
1338
|
-
|
|
1339
|
-
}),
|
|
1340
|
-
(
|
|
1341
|
-
}),
|
|
1342
|
-
},
|
|
1343
|
-
|
|
1344
|
-
},
|
|
1345
|
-
const
|
|
1346
|
-
if (!
|
|
1347
|
-
|
|
1348
|
-
let
|
|
1349
|
-
/^https?:\/\//i.test(
|
|
1401
|
+
const o = e.cloneNode(!0);
|
|
1402
|
+
return o.querySelectorAll(".rte-cell-highlight").forEach((r) => {
|
|
1403
|
+
r.classList.remove("rte-cell-highlight");
|
|
1404
|
+
}), o.querySelectorAll("div").forEach((r) => {
|
|
1405
|
+
(r.style.cursor === "col-resize" || r.style.cursor === "row-resize" || r.style.cursor === "nwse-resize") && r.remove();
|
|
1406
|
+
}), o.innerHTML;
|
|
1407
|
+
}, ze = () => {
|
|
1408
|
+
se(), G.current = S.current, ae({ url: "", text: "", title: "", target: "_self" }), X(!0);
|
|
1409
|
+
}, Oe = (e) => {
|
|
1410
|
+
const o = window.getSelection();
|
|
1411
|
+
if (!o || !G.current) return;
|
|
1412
|
+
o.removeAllRanges(), o.addRange(G.current);
|
|
1413
|
+
let r = e.url.trim();
|
|
1414
|
+
/^https?:\/\//i.test(r) || (r = "https://" + r);
|
|
1350
1415
|
const l = document.createElement("a");
|
|
1351
|
-
l.href =
|
|
1352
|
-
const
|
|
1353
|
-
|
|
1416
|
+
l.href = r, l.style.cursor = "pointer", l.style.outline = "none", l.textContent = e.text || r, l.title = e.title, l.target = e.target, l.contentEditable = "true";
|
|
1417
|
+
const g = o.getRangeAt(0);
|
|
1418
|
+
g.deleteContents(), g.insertNode(l);
|
|
1354
1419
|
const i = document.createTextNode(" ");
|
|
1355
1420
|
l.after(i);
|
|
1356
|
-
const
|
|
1357
|
-
|
|
1358
|
-
},
|
|
1359
|
-
const
|
|
1360
|
-
if (
|
|
1361
|
-
const
|
|
1421
|
+
const m = document.createRange();
|
|
1422
|
+
m.setStartAfter(i), m.collapse(!0), o.removeAllRanges(), o.addRange(m), X(!1), T();
|
|
1423
|
+
}, Pe = (e) => {
|
|
1424
|
+
const o = e.target;
|
|
1425
|
+
if (o.tagName === "A") {
|
|
1426
|
+
const r = o;
|
|
1362
1427
|
if (e.ctrlKey || e.metaKey) {
|
|
1363
|
-
window.open(
|
|
1428
|
+
window.open(r.href, "_blank", "noopener,noreferrer");
|
|
1364
1429
|
return;
|
|
1365
1430
|
}
|
|
1366
1431
|
e.preventDefault();
|
|
1367
1432
|
const l = document.createRange();
|
|
1368
|
-
l.selectNode(
|
|
1369
|
-
url:
|
|
1370
|
-
text:
|
|
1371
|
-
title:
|
|
1372
|
-
target:
|
|
1373
|
-
}),
|
|
1433
|
+
l.selectNode(r), G.current = l, ae({
|
|
1434
|
+
url: r.href,
|
|
1435
|
+
text: r.textContent || r.href,
|
|
1436
|
+
title: r.title,
|
|
1437
|
+
target: r.target
|
|
1438
|
+
}), X(!0);
|
|
1374
1439
|
}
|
|
1375
|
-
},
|
|
1376
|
-
const e =
|
|
1440
|
+
}, De = () => {
|
|
1441
|
+
const e = z();
|
|
1377
1442
|
if (!e) return;
|
|
1378
|
-
const a = window.getSelection();
|
|
1379
|
-
if ((!a || a.rangeCount === 0) && _.current) {
|
|
1380
|
-
const w = window.getSelection();
|
|
1381
|
-
w?.removeAllRanges(), w?.addRange(_.current);
|
|
1382
|
-
}
|
|
1383
1443
|
const o = window.getSelection();
|
|
1384
|
-
if (!o || o.rangeCount === 0)
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1444
|
+
if ((!o || o.rangeCount === 0) && S.current) {
|
|
1445
|
+
const b = window.getSelection();
|
|
1446
|
+
b?.removeAllRanges(), b?.addRange(S.current);
|
|
1447
|
+
}
|
|
1448
|
+
const r = window.getSelection();
|
|
1449
|
+
if (!r || r.rangeCount === 0) return;
|
|
1450
|
+
const l = r.getRangeAt(0);
|
|
1451
|
+
$(), document.execCommand("removeFormat", !1);
|
|
1452
|
+
const g = l.cloneContents(), i = document.createElement("div");
|
|
1453
|
+
i.appendChild(g);
|
|
1454
|
+
const m = document.createTreeWalker(
|
|
1390
1455
|
i,
|
|
1391
1456
|
NodeFilter.SHOW_ELEMENT,
|
|
1392
1457
|
null
|
|
1393
1458
|
), d = [];
|
|
1394
|
-
for (;
|
|
1395
|
-
const
|
|
1396
|
-
|
|
1459
|
+
for (; m.nextNode(); ) {
|
|
1460
|
+
const b = m.currentNode, A = b.tagName.toUpperCase(), I = b.getAttribute && b.getAttribute("data-mention") !== null;
|
|
1461
|
+
A !== "A" && !I && d.push(b);
|
|
1397
1462
|
}
|
|
1398
|
-
for (let
|
|
1399
|
-
const
|
|
1400
|
-
if (
|
|
1401
|
-
for (;
|
|
1402
|
-
|
|
1463
|
+
for (let b = d.length - 1; b >= 0; b--) {
|
|
1464
|
+
const A = d[b], I = A.parentNode;
|
|
1465
|
+
if (I) {
|
|
1466
|
+
for (; A.firstChild; ) I.insertBefore(A.firstChild, A);
|
|
1467
|
+
I.removeChild(A);
|
|
1403
1468
|
}
|
|
1404
1469
|
}
|
|
1405
|
-
i.querySelectorAll("[style]").forEach((
|
|
1406
|
-
const
|
|
1407
|
-
for (; i.firstChild; )
|
|
1408
|
-
l.insertNode(
|
|
1409
|
-
const
|
|
1410
|
-
|
|
1470
|
+
i.querySelectorAll("[style]").forEach((b) => b.removeAttribute("style")), l.deleteContents();
|
|
1471
|
+
const w = document.createDocumentFragment();
|
|
1472
|
+
for (; i.firstChild; ) w.appendChild(i.firstChild);
|
|
1473
|
+
l.insertNode(w);
|
|
1474
|
+
const E = document.createRange();
|
|
1475
|
+
E.setStartAfter(
|
|
1411
1476
|
l.endContainer.nodeType === Node.TEXT_NODE ? l.endContainer : l.startContainer
|
|
1412
|
-
),
|
|
1477
|
+
), E.collapse(!0), r.removeAllRanges(), r.addRange(E), e.normalize(), T();
|
|
1413
1478
|
};
|
|
1414
|
-
return /* @__PURE__ */
|
|
1479
|
+
return /* @__PURE__ */ a.jsxs(
|
|
1415
1480
|
"div",
|
|
1416
1481
|
{
|
|
1417
1482
|
className: `rte-wrapper ${h?.wrapper || ""}`,
|
|
1418
|
-
style:
|
|
1483
|
+
style: v.wrapper,
|
|
1419
1484
|
children: [
|
|
1420
|
-
/* @__PURE__ */
|
|
1421
|
-
/* @__PURE__ */
|
|
1422
|
-
|
|
1485
|
+
/* @__PURE__ */ a.jsxs("div", { style: { flex: 1 }, children: [
|
|
1486
|
+
/* @__PURE__ */ a.jsx(
|
|
1487
|
+
ut,
|
|
1423
1488
|
{
|
|
1424
|
-
exec:
|
|
1425
|
-
saveSelection:
|
|
1426
|
-
handleFileChange:
|
|
1427
|
-
handleFontSizeChange: (e) =>
|
|
1428
|
-
handleFontFamilyChange: (e) =>
|
|
1429
|
-
insertEmoji:
|
|
1430
|
-
handleLink:
|
|
1431
|
-
removeFormatting:
|
|
1432
|
-
visibleActions:
|
|
1489
|
+
exec: n,
|
|
1490
|
+
saveSelection: se,
|
|
1491
|
+
handleFileChange: V,
|
|
1492
|
+
handleFontSizeChange: (e) => n("fontSize", e.target.value),
|
|
1493
|
+
handleFontFamilyChange: (e) => n("fontName", e.target.value),
|
|
1494
|
+
insertEmoji: te,
|
|
1495
|
+
handleLink: ze,
|
|
1496
|
+
removeFormatting: De,
|
|
1497
|
+
visibleActions: J,
|
|
1433
1498
|
className: h.toolbar,
|
|
1434
|
-
style:
|
|
1499
|
+
style: v.toolbar
|
|
1435
1500
|
}
|
|
1436
1501
|
),
|
|
1437
|
-
/* @__PURE__ */
|
|
1502
|
+
/* @__PURE__ */ a.jsx(
|
|
1438
1503
|
"div",
|
|
1439
1504
|
{
|
|
1440
1505
|
ref: y,
|
|
1441
1506
|
className: `rte-editor ${h?.editor || ""}`,
|
|
1442
|
-
style:
|
|
1507
|
+
style: v.editor,
|
|
1443
1508
|
contentEditable: !0,
|
|
1444
1509
|
suppressContentEditableWarning: !0,
|
|
1445
|
-
onInput:
|
|
1446
|
-
onKeyDown:
|
|
1447
|
-
onBeforeInput:
|
|
1448
|
-
onContextMenu:
|
|
1449
|
-
onClick:
|
|
1510
|
+
onInput: j,
|
|
1511
|
+
onKeyDown: Z,
|
|
1512
|
+
onBeforeInput: ee,
|
|
1513
|
+
onContextMenu: Ne,
|
|
1514
|
+
onClick: Pe
|
|
1450
1515
|
}
|
|
1451
1516
|
),
|
|
1452
|
-
/* @__PURE__ */
|
|
1453
|
-
|
|
1517
|
+
/* @__PURE__ */ a.jsx(
|
|
1518
|
+
dt,
|
|
1454
1519
|
{
|
|
1455
|
-
show:
|
|
1456
|
-
position:
|
|
1520
|
+
show: O,
|
|
1521
|
+
position: P,
|
|
1457
1522
|
filtered: q,
|
|
1458
|
-
insertMention:
|
|
1459
|
-
onClose: () =>
|
|
1523
|
+
insertMention: _,
|
|
1524
|
+
onClose: () => k(!1),
|
|
1525
|
+
query: ge
|
|
1460
1526
|
}
|
|
1461
1527
|
),
|
|
1462
|
-
s && /* @__PURE__ */
|
|
1528
|
+
s && /* @__PURE__ */ a.jsxs(
|
|
1463
1529
|
"div",
|
|
1464
1530
|
{
|
|
1465
1531
|
className: `rte-output ${h?.output || ""}`,
|
|
1466
|
-
style:
|
|
1532
|
+
style: v.output,
|
|
1467
1533
|
children: [
|
|
1468
|
-
/* @__PURE__ */
|
|
1469
|
-
/* @__PURE__ */
|
|
1534
|
+
/* @__PURE__ */ a.jsx("h4", { children: "Output HTML:" }),
|
|
1535
|
+
/* @__PURE__ */ a.jsx("p", { children: x })
|
|
1470
1536
|
]
|
|
1471
1537
|
}
|
|
1472
1538
|
),
|
|
1473
|
-
/* @__PURE__ */
|
|
1474
|
-
|
|
1539
|
+
/* @__PURE__ */ a.jsx(
|
|
1540
|
+
mt,
|
|
1475
1541
|
{
|
|
1476
|
-
visible:
|
|
1477
|
-
x:
|
|
1478
|
-
y:
|
|
1479
|
-
onAction:
|
|
1542
|
+
visible: D.visible,
|
|
1543
|
+
x: D.x,
|
|
1544
|
+
y: D.y,
|
|
1545
|
+
onAction: Ae,
|
|
1480
1546
|
onClose: () => {
|
|
1481
|
-
|
|
1547
|
+
f({ ...D, visible: !1 }), we();
|
|
1482
1548
|
}
|
|
1483
1549
|
}
|
|
1484
1550
|
),
|
|
1485
|
-
/* @__PURE__ */
|
|
1486
|
-
|
|
1551
|
+
/* @__PURE__ */ a.jsx(
|
|
1552
|
+
ht,
|
|
1487
1553
|
{
|
|
1488
|
-
visible:
|
|
1554
|
+
visible: M,
|
|
1489
1555
|
linkData: pe,
|
|
1490
|
-
onClose: () =>
|
|
1491
|
-
onInsert:
|
|
1556
|
+
onClose: () => X(!1),
|
|
1557
|
+
onInsert: Oe
|
|
1492
1558
|
}
|
|
1493
1559
|
)
|
|
1494
1560
|
] }),
|
|
1495
|
-
u ? /* @__PURE__ */
|
|
1496
|
-
|
|
1561
|
+
u ? /* @__PURE__ */ a.jsx(
|
|
1562
|
+
ft,
|
|
1497
1563
|
{
|
|
1498
1564
|
className: h.preview,
|
|
1499
|
-
style:
|
|
1500
|
-
html:
|
|
1565
|
+
style: v.preview,
|
|
1566
|
+
html: be()
|
|
1501
1567
|
}
|
|
1502
1568
|
) : null
|
|
1503
1569
|
]
|
|
@@ -1505,7 +1571,7 @@ const it = ({
|
|
|
1505
1571
|
);
|
|
1506
1572
|
};
|
|
1507
1573
|
export {
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1574
|
+
gt as RichTextEditor,
|
|
1575
|
+
ft as RtePreview,
|
|
1576
|
+
ut as RteToolbar
|
|
1511
1577
|
};
|