@ryzeup/richtexteditor 1.0.29 → 1.0.31
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 +1098 -889
- package/dist/index.js +5 -5
- package/dist/index.umd.js +4 -4
- package/dist/richtexteditor.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,182 +1,182 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var u in
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var u of
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
import * as
|
|
14
|
-
import
|
|
15
|
-
import { createPortal as
|
|
16
|
-
window.React =
|
|
17
|
-
var
|
|
1
|
+
var Lt = Object.defineProperty, xt = Object.defineProperties;
|
|
2
|
+
var St = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var Pe = Object.getOwnPropertySymbols;
|
|
4
|
+
var Rt = Object.prototype.hasOwnProperty, Nt = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var _e = (a, d, u) => d in a ? Lt(a, d, { enumerable: !0, configurable: !0, writable: !0, value: u }) : a[d] = u, re = (a, d) => {
|
|
6
|
+
for (var u in d || (d = {}))
|
|
7
|
+
Rt.call(d, u) && _e(a, u, d[u]);
|
|
8
|
+
if (Pe)
|
|
9
|
+
for (var u of Pe(d))
|
|
10
|
+
Nt.call(d, u) && _e(a, u, d[u]);
|
|
11
|
+
return a;
|
|
12
|
+
}, ae = (a, d) => xt(a, St(d));
|
|
13
|
+
import * as Mt from "react";
|
|
14
|
+
import r, { useRef as Z, useState as H, useEffect as U } from "react";
|
|
15
|
+
import { createPortal as At } from "react-dom";
|
|
16
|
+
window.React = Mt;
|
|
17
|
+
var Ue = {
|
|
18
18
|
color: void 0,
|
|
19
19
|
size: void 0,
|
|
20
20
|
className: void 0,
|
|
21
21
|
style: void 0,
|
|
22
22
|
attr: void 0
|
|
23
|
-
},
|
|
24
|
-
function
|
|
25
|
-
if (
|
|
26
|
-
var u =
|
|
23
|
+
}, je = r.createContext && /* @__PURE__ */ r.createContext(Ue), Tt = ["attr", "size", "title"];
|
|
24
|
+
function kt(a, d) {
|
|
25
|
+
if (a == null) return {};
|
|
26
|
+
var u = zt(a, d), h, v;
|
|
27
27
|
if (Object.getOwnPropertySymbols) {
|
|
28
|
-
var
|
|
29
|
-
for (
|
|
30
|
-
|
|
28
|
+
var L = Object.getOwnPropertySymbols(a);
|
|
29
|
+
for (v = 0; v < L.length; v++)
|
|
30
|
+
h = L[v], !(d.indexOf(h) >= 0) && Object.prototype.propertyIsEnumerable.call(a, h) && (u[h] = a[h]);
|
|
31
31
|
}
|
|
32
32
|
return u;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
if (
|
|
34
|
+
function zt(a, d) {
|
|
35
|
+
if (a == null) return {};
|
|
36
36
|
var u = {};
|
|
37
|
-
for (var
|
|
38
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
39
|
-
if (
|
|
40
|
-
u[
|
|
37
|
+
for (var h in a)
|
|
38
|
+
if (Object.prototype.hasOwnProperty.call(a, h)) {
|
|
39
|
+
if (d.indexOf(h) >= 0) continue;
|
|
40
|
+
u[h] = a[h];
|
|
41
41
|
}
|
|
42
42
|
return u;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
return
|
|
46
|
-
for (var
|
|
47
|
-
var u = arguments[
|
|
48
|
-
for (var
|
|
49
|
-
Object.prototype.hasOwnProperty.call(u,
|
|
44
|
+
function ce() {
|
|
45
|
+
return ce = Object.assign ? Object.assign.bind() : function(a) {
|
|
46
|
+
for (var d = 1; d < arguments.length; d++) {
|
|
47
|
+
var u = arguments[d];
|
|
48
|
+
for (var h in u)
|
|
49
|
+
Object.prototype.hasOwnProperty.call(u, h) && (a[h] = u[h]);
|
|
50
50
|
}
|
|
51
|
-
return
|
|
52
|
-
},
|
|
51
|
+
return a;
|
|
52
|
+
}, ce.apply(this, arguments);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
var u = Object.keys(
|
|
54
|
+
function Fe(a, d) {
|
|
55
|
+
var u = Object.keys(a);
|
|
56
56
|
if (Object.getOwnPropertySymbols) {
|
|
57
|
-
var
|
|
58
|
-
|
|
59
|
-
return Object.getOwnPropertyDescriptor(
|
|
60
|
-
})), u.push.apply(u,
|
|
57
|
+
var h = Object.getOwnPropertySymbols(a);
|
|
58
|
+
d && (h = h.filter(function(v) {
|
|
59
|
+
return Object.getOwnPropertyDescriptor(a, v).enumerable;
|
|
60
|
+
})), u.push.apply(u, h);
|
|
61
61
|
}
|
|
62
62
|
return u;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
for (var
|
|
66
|
-
var u = arguments[
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
70
|
-
Object.defineProperty(
|
|
64
|
+
function se(a) {
|
|
65
|
+
for (var d = 1; d < arguments.length; d++) {
|
|
66
|
+
var u = arguments[d] != null ? arguments[d] : {};
|
|
67
|
+
d % 2 ? Fe(Object(u), !0).forEach(function(h) {
|
|
68
|
+
Dt(a, h, u[h]);
|
|
69
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(u)) : Fe(Object(u)).forEach(function(h) {
|
|
70
|
+
Object.defineProperty(a, h, Object.getOwnPropertyDescriptor(u, h));
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
return
|
|
73
|
+
return a;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
return
|
|
75
|
+
function Dt(a, d, u) {
|
|
76
|
+
return d = Ht(d), d in a ? Object.defineProperty(a, d, { value: u, enumerable: !0, configurable: !0, writable: !0 }) : a[d] = u, a;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
var
|
|
80
|
-
return typeof
|
|
78
|
+
function Ht(a) {
|
|
79
|
+
var d = Ot(a, "string");
|
|
80
|
+
return typeof d == "symbol" ? d : d + "";
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
if (typeof
|
|
84
|
-
var u =
|
|
82
|
+
function Ot(a, d) {
|
|
83
|
+
if (typeof a != "object" || !a) return a;
|
|
84
|
+
var u = a[Symbol.toPrimitive];
|
|
85
85
|
if (u !== void 0) {
|
|
86
|
-
var
|
|
87
|
-
if (typeof
|
|
86
|
+
var h = u.call(a, d);
|
|
87
|
+
if (typeof h != "object") return h;
|
|
88
88
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
89
89
|
}
|
|
90
|
-
return (
|
|
90
|
+
return (d === "string" ? String : Number)(a);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
return
|
|
92
|
+
function $e(a) {
|
|
93
|
+
return a && a.map((d, u) => /* @__PURE__ */ r.createElement(d.tag, se({
|
|
94
94
|
key: u
|
|
95
|
-
},
|
|
95
|
+
}, d.attr), $e(d.child)));
|
|
96
96
|
}
|
|
97
|
-
function k(
|
|
98
|
-
return (
|
|
99
|
-
attr:
|
|
100
|
-
},
|
|
97
|
+
function k(a) {
|
|
98
|
+
return (d) => /* @__PURE__ */ r.createElement(Pt, ce({
|
|
99
|
+
attr: se({}, a.attr)
|
|
100
|
+
}, d), $e(a.child));
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
var
|
|
102
|
+
function Pt(a) {
|
|
103
|
+
var d = (u) => {
|
|
104
104
|
var {
|
|
105
|
-
attr:
|
|
106
|
-
size:
|
|
107
|
-
title:
|
|
108
|
-
} =
|
|
109
|
-
return u.className && (
|
|
105
|
+
attr: h,
|
|
106
|
+
size: v,
|
|
107
|
+
title: L
|
|
108
|
+
} = a, P = kt(a, Tt), z = v || u.size || "1em", w;
|
|
109
|
+
return u.className && (w = u.className), a.className && (w = (w ? w + " " : "") + a.className), /* @__PURE__ */ r.createElement("svg", ce({
|
|
110
110
|
stroke: "currentColor",
|
|
111
111
|
fill: "currentColor",
|
|
112
112
|
strokeWidth: "0"
|
|
113
|
-
}, u.attr,
|
|
114
|
-
className:
|
|
115
|
-
style:
|
|
116
|
-
color:
|
|
117
|
-
}, u.style),
|
|
118
|
-
height:
|
|
119
|
-
width:
|
|
113
|
+
}, u.attr, h, P, {
|
|
114
|
+
className: w,
|
|
115
|
+
style: se(se({
|
|
116
|
+
color: a.color || u.color
|
|
117
|
+
}, u.style), a.style),
|
|
118
|
+
height: z,
|
|
119
|
+
width: z,
|
|
120
120
|
xmlns: "http://www.w3.org/2000/svg"
|
|
121
|
-
}),
|
|
121
|
+
}), L && /* @__PURE__ */ r.createElement("title", null, L), a.children);
|
|
122
122
|
};
|
|
123
|
-
return
|
|
123
|
+
return je !== void 0 ? /* @__PURE__ */ r.createElement(je.Consumer, null, (u) => d(u)) : d(Ue);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
return k({ 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: [] }] })(
|
|
125
|
+
function _t(a) {
|
|
126
|
+
return k({ 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: [] }] })(a);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
return k({ 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: [] }] })(
|
|
128
|
+
function jt(a) {
|
|
129
|
+
return k({ 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: [] }] })(a);
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
return k({ 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: [] }] })(
|
|
131
|
+
function Ft(a) {
|
|
132
|
+
return k({ 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: [] }] })(a);
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
return k({ 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: [] }] })(
|
|
134
|
+
function It(a) {
|
|
135
|
+
return k({ 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: [] }] })(a);
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
return k({ 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: [] }] })(
|
|
137
|
+
function qt(a) {
|
|
138
|
+
return k({ 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: [] }] })(a);
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
return k({ 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: [] }] })(
|
|
140
|
+
function Bt(a) {
|
|
141
|
+
return k({ 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: [] }] })(a);
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
return k({ 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: [] }] })(
|
|
143
|
+
function Vt(a) {
|
|
144
|
+
return k({ 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: [] }] })(a);
|
|
145
145
|
}
|
|
146
|
-
function
|
|
147
|
-
return k({ 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: [] }] })(
|
|
146
|
+
function Ut(a) {
|
|
147
|
+
return k({ 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: [] }] })(a);
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
return k({ 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: [] }] })(
|
|
149
|
+
function $t(a) {
|
|
150
|
+
return k({ 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: [] }] })(a);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
return k({ 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: [] }] })(
|
|
152
|
+
function Wt(a) {
|
|
153
|
+
return k({ 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: [] }] })(a);
|
|
154
154
|
}
|
|
155
|
-
function
|
|
156
|
-
return k({ 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: [] }] })(
|
|
155
|
+
function Xt(a) {
|
|
156
|
+
return k({ 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: [] }] })(a);
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
return k({ 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: [] }] })(
|
|
158
|
+
function Zt(a) {
|
|
159
|
+
return k({ 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: [] }] })(a);
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
return k({ attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM56.84,75.58a8,8,0,0,1,3.58-10.74l16-8A8,8,0,0,1,88,64v48a8,8,0,0,1-16,0V76.94l-4.42,2.22A8,8,0,0,1,56.84,75.58ZM92,180a8,8,0,0,1,0,16H68a8,8,0,0,1-6.4-12.8l21.67-28.89A3.92,3.92,0,0,0,84,152a4,4,0,0,0-7.77-1.33,8,8,0,0,1-15.09-5.34,20,20,0,1,1,35,18.53L84,180Zm100,4H120a8,8,0,0,1,0-16h72a8,8,0,0,1,0,16Zm0-48H120a8,8,0,0,1,0-16h72a8,8,0,0,1,0,16Zm0-48H120a8,8,0,0,1,0-16h72a8,8,0,0,1,0,16Z" }, child: [] }] })(
|
|
161
|
+
function Kt(a) {
|
|
162
|
+
return k({ attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM56.84,75.58a8,8,0,0,1,3.58-10.74l16-8A8,8,0,0,1,88,64v48a8,8,0,0,1-16,0V76.94l-4.42,2.22A8,8,0,0,1,56.84,75.58ZM92,180a8,8,0,0,1,0,16H68a8,8,0,0,1-6.4-12.8l21.67-28.89A3.92,3.92,0,0,0,84,152a4,4,0,0,0-7.77-1.33,8,8,0,0,1-15.09-5.34,20,20,0,1,1,35,18.53L84,180Zm100,4H120a8,8,0,0,1,0-16h72a8,8,0,0,1,0,16Zm0-48H120a8,8,0,0,1,0-16h72a8,8,0,0,1,0,16Zm0-48H120a8,8,0,0,1,0-16h72a8,8,0,0,1,0,16Z" }, child: [] }] })(a);
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
return k({ attr: { viewBox: "0 0 24 24", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M2 18H9V20H2V18ZM2 11H11V13H2V11ZM2 4H22V6H2V4ZM20.674 13.0251L21.8301 12.634L22.8301 14.366L21.914 15.1711C21.9704 15.4386 22 15.7158 22 16C22 16.2842 21.9704 16.5614 21.914 16.8289L22.8301 17.634L21.8301 19.366L20.674 18.9749C20.2635 19.3441 19.7763 19.6295 19.2391 19.8044L19 21H17L16.7609 19.8044C16.2237 19.6295 15.7365 19.3441 15.326 18.9749L14.1699 19.366L13.1699 17.634L14.086 16.8289C14.0296 16.5614 14 16.2842 14 16C14 15.7158 14.0296 15.4386 14.086 15.1711L13.1699 14.366L14.1699 12.634L15.326 13.0251C15.7365 12.6559 16.2237 12.3705 16.7609 12.1956L17 11H19L19.2391 12.1956C19.7763 12.3705 20.2635 12.6559 20.674 13.0251ZM18 17C18.5523 17 19 16.5523 19 16C19 15.4477 18.5523 15 18 15C17.4477 15 17 15.4477 17 16C17 16.5523 17.4477 17 18 17Z" }, child: [] }] })(
|
|
164
|
+
function Yt(a) {
|
|
165
|
+
return k({ attr: { viewBox: "0 0 24 24", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M2 18H9V20H2V18ZM2 11H11V13H2V11ZM2 4H22V6H2V4ZM20.674 13.0251L21.8301 12.634L22.8301 14.366L21.914 15.1711C21.9704 15.4386 22 15.7158 22 16C22 16.2842 21.9704 16.5614 21.914 16.8289L22.8301 17.634L21.8301 19.366L20.674 18.9749C20.2635 19.3441 19.7763 19.6295 19.2391 19.8044L19 21H17L16.7609 19.8044C16.2237 19.6295 15.7365 19.3441 15.326 18.9749L14.1699 19.366L13.1699 17.634L14.086 16.8289C14.0296 16.5614 14 16.2842 14 16C14 15.7158 14.0296 15.4386 14.086 15.1711L13.1699 14.366L14.1699 12.634L15.326 13.0251C15.7365 12.6559 16.2237 12.3705 16.7609 12.1956L17 11H19L19.2391 12.1956C19.7763 12.3705 20.2635 12.6559 20.674 13.0251ZM18 17C18.5523 17 19 16.5523 19 16C19 15.4477 18.5523 15 18 15C17.4477 15 17 15.4477 17 16C17 16.5523 17.4477 17 18 17Z" }, child: [] }] })(a);
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
return k({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M12 21h-7a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v7" }, child: [] }, { tag: "path", attr: { d: "M3 10h18" }, child: [] }, { tag: "path", attr: { d: "M10 3v18" }, child: [] }, { tag: "path", attr: { d: "M19.001 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M19.001 15.5v1.5" }, child: [] }, { tag: "path", attr: { d: "M19.001 21v1.5" }, child: [] }, { tag: "path", attr: { d: "M22.032 17.25l-1.299 .75" }, child: [] }, { tag: "path", attr: { d: "M17.27 20l-1.3 .75" }, child: [] }, { tag: "path", attr: { d: "M15.97 17.25l1.3 .75" }, child: [] }, { tag: "path", attr: { d: "M20.733 20l1.3 .75" }, child: [] }] })(
|
|
167
|
+
function Qt(a) {
|
|
168
|
+
return k({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M12 21h-7a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v7" }, child: [] }, { tag: "path", attr: { d: "M3 10h18" }, child: [] }, { tag: "path", attr: { d: "M10 3v18" }, child: [] }, { tag: "path", attr: { d: "M19.001 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M19.001 15.5v1.5" }, child: [] }, { tag: "path", attr: { d: "M19.001 21v1.5" }, child: [] }, { tag: "path", attr: { d: "M22.032 17.25l-1.299 .75" }, child: [] }, { tag: "path", attr: { d: "M17.27 20l-1.3 .75" }, child: [] }, { tag: "path", attr: { d: "M15.97 17.25l1.3 .75" }, child: [] }, { tag: "path", attr: { d: "M20.733 20l1.3 .75" }, child: [] }] })(a);
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
return k({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z" }, child: [] }, { tag: "path", attr: { d: "M3 10h18" }, child: [] }, { tag: "path", attr: { d: "M10 3v18" }, child: [] }] })(
|
|
170
|
+
function Gt(a) {
|
|
171
|
+
return k({ attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { d: "M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z" }, child: [] }, { tag: "path", attr: { d: "M3 10h18" }, child: [] }, { tag: "path", attr: { d: "M10 3v18" }, child: [] }] })(a);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
return k({ 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: [] }] })(
|
|
173
|
+
function Jt(a) {
|
|
174
|
+
return k({ 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: [] }] })(a);
|
|
175
175
|
}
|
|
176
|
-
function
|
|
177
|
-
return k({ 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: [] }] })(
|
|
176
|
+
function en(a) {
|
|
177
|
+
return k({ 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: [] }] })(a);
|
|
178
178
|
}
|
|
179
|
-
const
|
|
179
|
+
const tn = [
|
|
180
180
|
"😀",
|
|
181
181
|
"😁",
|
|
182
182
|
"😂",
|
|
@@ -288,37 +288,37 @@ const Kt = [
|
|
|
288
288
|
"👏",
|
|
289
289
|
"🫶",
|
|
290
290
|
"👐"
|
|
291
|
-
],
|
|
292
|
-
exec:
|
|
293
|
-
saveSelection:
|
|
291
|
+
], nn = ({
|
|
292
|
+
exec: a,
|
|
293
|
+
saveSelection: d,
|
|
294
294
|
handleFileChange: u,
|
|
295
|
-
handleFontSizeChange:
|
|
296
|
-
handleFontFamilyChange:
|
|
295
|
+
handleFontSizeChange: h,
|
|
296
|
+
handleFontFamilyChange: v,
|
|
297
297
|
// insertListBlock,
|
|
298
|
-
insertEmoji:
|
|
299
|
-
handleLink:
|
|
300
|
-
removeFormatting:
|
|
301
|
-
visibleActions:
|
|
298
|
+
insertEmoji: L,
|
|
299
|
+
handleLink: P,
|
|
300
|
+
removeFormatting: z,
|
|
301
|
+
visibleActions: w,
|
|
302
302
|
className: S,
|
|
303
|
-
style:
|
|
303
|
+
style: R
|
|
304
304
|
}) => {
|
|
305
|
-
var
|
|
306
|
-
const
|
|
305
|
+
var B, Y;
|
|
306
|
+
const N = Z(null), $ = Z(null), b = Z(null), [A, _] = H(!1), [F, O] = H({
|
|
307
307
|
x: 0,
|
|
308
308
|
y: 0
|
|
309
309
|
});
|
|
310
310
|
U(() => {
|
|
311
|
-
const
|
|
312
|
-
!
|
|
311
|
+
const g = (y) => {
|
|
312
|
+
!y.target.closest(".rte-emoji-popup") && !y.target.closest("button[title='Emoji']") && _(!1);
|
|
313
313
|
};
|
|
314
|
-
return document.addEventListener("mousedown",
|
|
314
|
+
return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
|
|
315
315
|
}, []);
|
|
316
|
-
const
|
|
317
|
-
var
|
|
318
|
-
|
|
319
|
-
const
|
|
320
|
-
if (
|
|
321
|
-
switch (
|
|
316
|
+
const I = (g) => {
|
|
317
|
+
var X;
|
|
318
|
+
g.preventDefault();
|
|
319
|
+
const y = g.currentTarget.dataset.command;
|
|
320
|
+
if (y)
|
|
321
|
+
switch (y) {
|
|
322
322
|
case "bold":
|
|
323
323
|
case "italic":
|
|
324
324
|
case "underline":
|
|
@@ -327,20 +327,20 @@ const Kt = [
|
|
|
327
327
|
case "insertOrderedList":
|
|
328
328
|
case "insertStaticOrderedList":
|
|
329
329
|
case "removeFormat":
|
|
330
|
-
|
|
330
|
+
a(y);
|
|
331
331
|
break;
|
|
332
332
|
case "insertImage": {
|
|
333
|
-
(
|
|
333
|
+
(X = N.current) == null || X.click();
|
|
334
334
|
break;
|
|
335
335
|
}
|
|
336
336
|
default:
|
|
337
|
-
console.warn("Unknown command:",
|
|
337
|
+
console.warn("Unknown command:", y);
|
|
338
338
|
}
|
|
339
|
-
},
|
|
340
|
-
|
|
341
|
-
},
|
|
342
|
-
|
|
343
|
-
}, [
|
|
339
|
+
}, K = (g) => {
|
|
340
|
+
a("foreColor", g.target.value);
|
|
341
|
+
}, W = (g) => {
|
|
342
|
+
a("backColor", g.target.value);
|
|
343
|
+
}, [x, D] = H({
|
|
344
344
|
bold: !1,
|
|
345
345
|
italic: !1,
|
|
346
346
|
underline: !1,
|
|
@@ -356,10 +356,24 @@ const Kt = [
|
|
|
356
356
|
table: !1,
|
|
357
357
|
color: !1,
|
|
358
358
|
highlight: !1
|
|
359
|
-
});
|
|
359
|
+
}), q = Z(null), j = Z(null);
|
|
360
360
|
return U(() => {
|
|
361
|
-
const
|
|
362
|
-
|
|
361
|
+
const g = () => {
|
|
362
|
+
const y = window.getSelection();
|
|
363
|
+
if (!y || !y.anchorNode) return;
|
|
364
|
+
let X = y.anchorNode.nodeType === Node.ELEMENT_NODE ? y.anchorNode : y.anchorNode.parentElement;
|
|
365
|
+
if (!X) return;
|
|
366
|
+
const J = window.getComputedStyle(X), le = J.fontFamily.replace(/['"]/g, "").split(",")[0], de = parseInt(J.fontSize, 10);
|
|
367
|
+
if (q.current) {
|
|
368
|
+
const ee = Array.from(q.current.options).some((oe) => oe.value === le);
|
|
369
|
+
q.current.value = ee ? le : "";
|
|
370
|
+
}
|
|
371
|
+
j.current && (j.current.value = String(de));
|
|
372
|
+
};
|
|
373
|
+
return document.addEventListener("selectionchange", g), () => document.removeEventListener("selectionchange", g);
|
|
374
|
+
}, []), U(() => {
|
|
375
|
+
const g = () => {
|
|
376
|
+
D({
|
|
363
377
|
bold: document.queryCommandState("bold"),
|
|
364
378
|
italic: document.queryCommandState("italic"),
|
|
365
379
|
underline: document.queryCommandState("underline"),
|
|
@@ -377,130 +391,130 @@ const Kt = [
|
|
|
377
391
|
highlight: document.queryCommandState("backColor")
|
|
378
392
|
});
|
|
379
393
|
};
|
|
380
|
-
return document.addEventListener("selectionchange",
|
|
381
|
-
}, []), /* @__PURE__ */
|
|
394
|
+
return document.addEventListener("selectionchange", g), () => document.removeEventListener("selectionchange", g);
|
|
395
|
+
}, []), /* @__PURE__ */ r.createElement("div", {
|
|
382
396
|
className: `rte-toolbar ${S || ""}`,
|
|
383
|
-
style:
|
|
384
|
-
},
|
|
397
|
+
style: R
|
|
398
|
+
}, w.bold && /* @__PURE__ */ r.createElement("button", {
|
|
385
399
|
"data-command": "bold",
|
|
386
400
|
title: "Bold",
|
|
387
|
-
onMouseDown:
|
|
388
|
-
className:
|
|
389
|
-
}, /* @__PURE__ */
|
|
401
|
+
onMouseDown: I,
|
|
402
|
+
className: x.bold ? "rte-active" : ""
|
|
403
|
+
}, /* @__PURE__ */ r.createElement(Bt, null)), w.italic && /* @__PURE__ */ r.createElement("button", {
|
|
390
404
|
"data-command": "italic",
|
|
391
405
|
title: "Italic",
|
|
392
|
-
onMouseDown:
|
|
393
|
-
className:
|
|
394
|
-
}, /* @__PURE__ */
|
|
406
|
+
onMouseDown: I,
|
|
407
|
+
className: x.italic ? "rte-active" : ""
|
|
408
|
+
}, /* @__PURE__ */ r.createElement(Ut, null)), w.underline && /* @__PURE__ */ r.createElement("button", {
|
|
395
409
|
"data-command": "underline",
|
|
396
410
|
title: "Underline",
|
|
397
|
-
onMouseDown:
|
|
398
|
-
className:
|
|
399
|
-
}, /* @__PURE__ */
|
|
411
|
+
onMouseDown: I,
|
|
412
|
+
className: x.underline ? "rte-active" : ""
|
|
413
|
+
}, /* @__PURE__ */ r.createElement(Zt, null)), w.unorderedList && /* @__PURE__ */ r.createElement("button", {
|
|
400
414
|
"data-command": "insertUnorderedList",
|
|
401
|
-
onMouseDown:
|
|
415
|
+
onMouseDown: I,
|
|
402
416
|
title: "UnorderedList",
|
|
403
|
-
className:
|
|
404
|
-
}, /* @__PURE__ */
|
|
417
|
+
className: x.unorderedList ? "rte-active" : ""
|
|
418
|
+
}, /* @__PURE__ */ r.createElement(Yt, null)), w.staticUnorderedList && /* @__PURE__ */ r.createElement("button", {
|
|
405
419
|
"data-command": "insertStaticUnorderedList",
|
|
406
|
-
onMouseDown:
|
|
420
|
+
onMouseDown: I,
|
|
407
421
|
title: "StaticUnorderedList",
|
|
408
|
-
className:
|
|
409
|
-
}, /* @__PURE__ */
|
|
422
|
+
className: x.unorderedList ? "rte-active" : ""
|
|
423
|
+
}, /* @__PURE__ */ r.createElement(Wt, null)), w.orderedList && /* @__PURE__ */ r.createElement("button", {
|
|
410
424
|
"data-command": "insertOrderedList",
|
|
411
425
|
title: "OrderedList",
|
|
412
|
-
onMouseDown:
|
|
413
|
-
className:
|
|
426
|
+
onMouseDown: I,
|
|
427
|
+
className: x.orderedList ? "rte-active" : "",
|
|
414
428
|
style: {
|
|
415
429
|
fontSize: "medium"
|
|
416
430
|
}
|
|
417
|
-
}, /* @__PURE__ */
|
|
431
|
+
}, /* @__PURE__ */ r.createElement(Kt, null)), w.staticOrderedList && /* @__PURE__ */ r.createElement("button", {
|
|
418
432
|
"data-command": "insertStaticOrderedList",
|
|
419
433
|
title: "StaticOrderedList",
|
|
420
|
-
onMouseDown:
|
|
421
|
-
className:
|
|
422
|
-
}, /* @__PURE__ */
|
|
434
|
+
onMouseDown: I,
|
|
435
|
+
className: x.orderedList ? "rte-active" : ""
|
|
436
|
+
}, /* @__PURE__ */ r.createElement(It, null)), w.link && /* @__PURE__ */ r.createElement("button", {
|
|
423
437
|
"data-command": "createLink",
|
|
424
438
|
title: "Link",
|
|
425
|
-
onClick:
|
|
426
|
-
className:
|
|
427
|
-
}, /* @__PURE__ */
|
|
439
|
+
onClick: P,
|
|
440
|
+
className: x.link ? "rte-active" : ""
|
|
441
|
+
}, /* @__PURE__ */ r.createElement($t, null)), w.removeFormat && /* @__PURE__ */ r.createElement("button", {
|
|
428
442
|
"data-command": "Remove format",
|
|
429
443
|
title: "removeFormat",
|
|
430
|
-
onMouseDown: (
|
|
431
|
-
|
|
444
|
+
onMouseDown: (g) => {
|
|
445
|
+
g.preventDefault(), d(), z();
|
|
432
446
|
},
|
|
433
|
-
className:
|
|
434
|
-
}, /* @__PURE__ */
|
|
447
|
+
className: x.removeFormat ? "rte-active" : ""
|
|
448
|
+
}, /* @__PURE__ */ r.createElement(en, null)), w.image && /* @__PURE__ */ r.createElement("button", {
|
|
435
449
|
"data-command": "insertImage",
|
|
436
450
|
title: "Image",
|
|
437
|
-
onMouseDown:
|
|
438
|
-
className:
|
|
439
|
-
}, /* @__PURE__ */
|
|
451
|
+
onMouseDown: I,
|
|
452
|
+
className: x.image ? "rte-active" : ""
|
|
453
|
+
}, /* @__PURE__ */ r.createElement(Ft, null)), /* @__PURE__ */ r.createElement("input", {
|
|
440
454
|
type: "file",
|
|
441
455
|
accept: "image/*",
|
|
442
|
-
ref:
|
|
456
|
+
ref: N,
|
|
443
457
|
style: {
|
|
444
458
|
display: "none"
|
|
445
459
|
},
|
|
446
460
|
onChange: u
|
|
447
|
-
}),
|
|
461
|
+
}), w.emoji && /* @__PURE__ */ r.createElement("div", {
|
|
448
462
|
style: {
|
|
449
463
|
position: "relative"
|
|
450
464
|
}
|
|
451
|
-
}, /* @__PURE__ */
|
|
465
|
+
}, /* @__PURE__ */ r.createElement("button", {
|
|
452
466
|
title: "Emoji",
|
|
453
|
-
onMouseDown: (
|
|
454
|
-
|
|
455
|
-
const
|
|
456
|
-
|
|
457
|
-
x:
|
|
458
|
-
y:
|
|
467
|
+
onMouseDown: (g) => {
|
|
468
|
+
g.preventDefault(), d();
|
|
469
|
+
const y = g.currentTarget.getBoundingClientRect();
|
|
470
|
+
O({
|
|
471
|
+
x: y.left,
|
|
472
|
+
y: y.bottom + 8
|
|
459
473
|
// small spacing
|
|
460
|
-
}),
|
|
474
|
+
}), _((X) => !X);
|
|
461
475
|
},
|
|
462
|
-
className:
|
|
463
|
-
}, /* @__PURE__ */
|
|
476
|
+
className: x.emoji ? "rte-active" : ""
|
|
477
|
+
}, /* @__PURE__ */ r.createElement(Xt, null)), A && /* @__PURE__ */ At(/* @__PURE__ */ r.createElement("div", {
|
|
464
478
|
className: "rte-emoji-popup",
|
|
465
479
|
style: {
|
|
466
|
-
top:
|
|
467
|
-
left:
|
|
480
|
+
top: F.y,
|
|
481
|
+
left: F.x
|
|
468
482
|
}
|
|
469
|
-
},
|
|
470
|
-
key:
|
|
483
|
+
}, tn.map((g, y) => /* @__PURE__ */ r.createElement("span", {
|
|
484
|
+
key: y,
|
|
471
485
|
style: {
|
|
472
486
|
fontSize: "20px",
|
|
473
487
|
cursor: "pointer",
|
|
474
488
|
textAlign: "center"
|
|
475
489
|
},
|
|
476
|
-
onMouseDown: (
|
|
477
|
-
|
|
490
|
+
onMouseDown: (X) => {
|
|
491
|
+
X.preventDefault(), L(g), _(!1);
|
|
478
492
|
}
|
|
479
|
-
},
|
|
493
|
+
}, g))), document.body)), w.color && /* @__PURE__ */ r.createElement("div", {
|
|
480
494
|
style: {
|
|
481
495
|
position: "relative"
|
|
482
496
|
}
|
|
483
|
-
}, /* @__PURE__ */
|
|
497
|
+
}, /* @__PURE__ */ r.createElement("button", {
|
|
484
498
|
title: "Text Color",
|
|
485
|
-
onMouseDown: (
|
|
486
|
-
var
|
|
487
|
-
|
|
499
|
+
onMouseDown: (g) => {
|
|
500
|
+
var y;
|
|
501
|
+
g.preventDefault(), d(), (y = $.current) == null || y.click();
|
|
488
502
|
},
|
|
489
503
|
style: {
|
|
490
504
|
display: "flex",
|
|
491
505
|
alignItems: "center",
|
|
492
506
|
justifyContent: "center",
|
|
493
|
-
color: ((
|
|
507
|
+
color: ((B = $.current) == null ? void 0 : B.value) || "#000",
|
|
494
508
|
fontSize: "18px"
|
|
495
509
|
},
|
|
496
|
-
className:
|
|
497
|
-
}, /* @__PURE__ */
|
|
498
|
-
ref:
|
|
510
|
+
className: x.color ? "rte-active" : ""
|
|
511
|
+
}, /* @__PURE__ */ r.createElement(Jt, null)), /* @__PURE__ */ r.createElement("input", {
|
|
512
|
+
ref: $,
|
|
499
513
|
type: "color",
|
|
500
514
|
defaultValue: "#000000",
|
|
501
|
-
onChange: (
|
|
502
|
-
var
|
|
503
|
-
|
|
515
|
+
onChange: (g) => {
|
|
516
|
+
var y;
|
|
517
|
+
K(g), ((y = g.target.parentElement) == null ? void 0 : y.querySelector("button")).style.color = g.target.value;
|
|
504
518
|
},
|
|
505
519
|
style: {
|
|
506
520
|
position: "absolute",
|
|
@@ -509,30 +523,30 @@ const Kt = [
|
|
|
509
523
|
height: 0,
|
|
510
524
|
pointerEvents: "none"
|
|
511
525
|
}
|
|
512
|
-
})),
|
|
526
|
+
})), w.highlight && /* @__PURE__ */ r.createElement("div", {
|
|
513
527
|
style: {
|
|
514
528
|
position: "relative"
|
|
515
529
|
}
|
|
516
|
-
}, /* @__PURE__ */
|
|
530
|
+
}, /* @__PURE__ */ r.createElement("button", {
|
|
517
531
|
title: "Highlight",
|
|
518
|
-
onMouseDown: (
|
|
519
|
-
var
|
|
520
|
-
|
|
532
|
+
onMouseDown: (g) => {
|
|
533
|
+
var y;
|
|
534
|
+
g.preventDefault(), d(), (y = b.current) == null || y.click();
|
|
521
535
|
},
|
|
522
536
|
style: {
|
|
523
537
|
display: "flex",
|
|
524
538
|
alignItems: "center",
|
|
525
539
|
justifyContent: "center",
|
|
526
|
-
color: ((
|
|
540
|
+
color: ((Y = b.current) == null ? void 0 : Y.value) || "#000",
|
|
527
541
|
fontSize: "18px"
|
|
528
542
|
},
|
|
529
|
-
className:
|
|
530
|
-
}, /* @__PURE__ */
|
|
531
|
-
ref:
|
|
543
|
+
className: x.highlight ? "rte-active" : ""
|
|
544
|
+
}, /* @__PURE__ */ r.createElement(Vt, null)), /* @__PURE__ */ r.createElement("input", {
|
|
545
|
+
ref: b,
|
|
532
546
|
type: "color",
|
|
533
|
-
onChange: (
|
|
534
|
-
var
|
|
535
|
-
|
|
547
|
+
onChange: (g) => {
|
|
548
|
+
var y;
|
|
549
|
+
W(g), ((y = g.target.parentElement) == null ? void 0 : y.querySelector("button")).style.color = g.target.value;
|
|
536
550
|
},
|
|
537
551
|
defaultValue: "#000000",
|
|
538
552
|
style: {
|
|
@@ -542,320 +556,497 @@ const Kt = [
|
|
|
542
556
|
height: 0,
|
|
543
557
|
pointerEvents: "none"
|
|
544
558
|
}
|
|
545
|
-
})),
|
|
559
|
+
})), w.align && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("button", {
|
|
546
560
|
title: "Align Left",
|
|
547
|
-
onMouseDown: (
|
|
548
|
-
onClick: () =>
|
|
549
|
-
className:
|
|
550
|
-
}, /* @__PURE__ */
|
|
561
|
+
onMouseDown: (g) => g.preventDefault(),
|
|
562
|
+
onClick: () => a("justifyLeft"),
|
|
563
|
+
className: x.alignLeft ? "rte-active" : ""
|
|
564
|
+
}, /* @__PURE__ */ r.createElement(qt, null)), /* @__PURE__ */ r.createElement("button", {
|
|
551
565
|
title: "Align Center",
|
|
552
|
-
onMouseDown: (
|
|
553
|
-
onClick: () =>
|
|
554
|
-
className:
|
|
555
|
-
}, /* @__PURE__ */
|
|
566
|
+
onMouseDown: (g) => g.preventDefault(),
|
|
567
|
+
onClick: () => a("justifyCenter"),
|
|
568
|
+
className: x.alignCenter ? "rte-active" : ""
|
|
569
|
+
}, /* @__PURE__ */ r.createElement(_t, null)), /* @__PURE__ */ r.createElement("button", {
|
|
556
570
|
title: "Align Right",
|
|
557
|
-
onMouseDown: (
|
|
558
|
-
onClick: () =>
|
|
559
|
-
className:
|
|
560
|
-
}, /* @__PURE__ */
|
|
571
|
+
onMouseDown: (g) => g.preventDefault(),
|
|
572
|
+
onClick: () => a("justifyRight"),
|
|
573
|
+
className: x.alignRight ? "rte-active" : ""
|
|
574
|
+
}, /* @__PURE__ */ r.createElement(jt, null))), w.table && /* @__PURE__ */ r.createElement("button", {
|
|
561
575
|
title: "Insert Dynamic Table",
|
|
562
|
-
onMouseDown: (
|
|
563
|
-
onClick: () =>
|
|
564
|
-
className:
|
|
576
|
+
onMouseDown: (g) => g.preventDefault(),
|
|
577
|
+
onClick: () => a("insertTable"),
|
|
578
|
+
className: x.table ? "rte-active" : "",
|
|
565
579
|
style: {
|
|
566
580
|
fontSize: "medium"
|
|
567
581
|
}
|
|
568
|
-
}, /* @__PURE__ */
|
|
582
|
+
}, /* @__PURE__ */ r.createElement(Qt, null)), w.table && /* @__PURE__ */ r.createElement("button", {
|
|
569
583
|
title: "Insert Static Table",
|
|
570
|
-
onMouseDown: (
|
|
571
|
-
onClick: () =>
|
|
572
|
-
className:
|
|
584
|
+
onMouseDown: (g) => g.preventDefault(),
|
|
585
|
+
onClick: () => a("insertStaticTable"),
|
|
586
|
+
className: x.table ? "rte-active" : "",
|
|
573
587
|
style: {
|
|
574
588
|
fontSize: "medium"
|
|
575
589
|
}
|
|
576
|
-
}, /* @__PURE__ */
|
|
590
|
+
}, /* @__PURE__ */ r.createElement(Gt, null)), w.fontFamily && /* @__PURE__ */ r.createElement("select", {
|
|
591
|
+
ref: q,
|
|
577
592
|
className: "rte-dropdown",
|
|
578
593
|
defaultValue: "",
|
|
579
|
-
onMouseDown: () =>
|
|
580
|
-
onChange:
|
|
581
|
-
}, /* @__PURE__ */
|
|
594
|
+
onMouseDown: () => d(),
|
|
595
|
+
onChange: v
|
|
596
|
+
}, /* @__PURE__ */ r.createElement("option", {
|
|
582
597
|
value: "",
|
|
583
598
|
disabled: !0
|
|
584
|
-
}, "Font Family"), /* @__PURE__ */
|
|
599
|
+
}, "Font Family"), /* @__PURE__ */ r.createElement("option", {
|
|
585
600
|
value: "Arial"
|
|
586
|
-
}, "Arial"), /* @__PURE__ */
|
|
601
|
+
}, "Arial"), /* @__PURE__ */ r.createElement("option", {
|
|
587
602
|
value: "Georgia"
|
|
588
|
-
}, "Georgia"), /* @__PURE__ */
|
|
603
|
+
}, "Georgia"), /* @__PURE__ */ r.createElement("option", {
|
|
589
604
|
value: "Times New Roman"
|
|
590
|
-
}, "Times New Roman"), /* @__PURE__ */
|
|
605
|
+
}, "Times New Roman"), /* @__PURE__ */ r.createElement("option", {
|
|
591
606
|
value: "Courier New"
|
|
592
|
-
}, "Courier New"), /* @__PURE__ */
|
|
607
|
+
}, "Courier New"), /* @__PURE__ */ r.createElement("option", {
|
|
593
608
|
value: "Verdana"
|
|
594
|
-
}, "Verdana")),
|
|
609
|
+
}, "Verdana")), w.fontSize && /* @__PURE__ */ r.createElement("select", {
|
|
610
|
+
ref: j,
|
|
595
611
|
className: "rte-dropdown rte-fontsize-dropdown",
|
|
596
612
|
defaultValue: "",
|
|
597
|
-
onMouseDown: () =>
|
|
598
|
-
onChange:
|
|
599
|
-
}, /* @__PURE__ */
|
|
613
|
+
onMouseDown: () => d(),
|
|
614
|
+
onChange: h
|
|
615
|
+
}, /* @__PURE__ */ r.createElement("option", {
|
|
600
616
|
value: "",
|
|
601
617
|
disabled: !0
|
|
602
618
|
}, "Font Size"), Array.from({
|
|
603
619
|
length: 16
|
|
604
|
-
}, (
|
|
605
|
-
key:
|
|
606
|
-
value:
|
|
607
|
-
},
|
|
608
|
-
},
|
|
609
|
-
show:
|
|
610
|
-
position:
|
|
620
|
+
}, (g, y) => 10 + y).map((g) => /* @__PURE__ */ r.createElement("option", {
|
|
621
|
+
key: g,
|
|
622
|
+
value: g
|
|
623
|
+
}, g, "px"))));
|
|
624
|
+
}, rn = ({
|
|
625
|
+
show: a,
|
|
626
|
+
position: d,
|
|
611
627
|
filtered: u,
|
|
612
|
-
insertMention:
|
|
613
|
-
onClose:
|
|
614
|
-
query:
|
|
628
|
+
insertMention: h,
|
|
629
|
+
onClose: v,
|
|
630
|
+
query: L
|
|
615
631
|
}) => {
|
|
616
|
-
const
|
|
632
|
+
const P = Z(null), [z, w] = H(0);
|
|
617
633
|
return U(() => {
|
|
618
|
-
|
|
619
|
-
}, [
|
|
620
|
-
const S = (
|
|
621
|
-
|
|
634
|
+
a && w(0);
|
|
635
|
+
}, [a]), U(() => {
|
|
636
|
+
const S = (R) => {
|
|
637
|
+
P.current && !P.current.contains(R.target) && v();
|
|
622
638
|
};
|
|
623
|
-
return
|
|
639
|
+
return a && document.addEventListener("mousedown", S), () => {
|
|
624
640
|
document.removeEventListener("mousedown", S);
|
|
625
641
|
};
|
|
626
|
-
}, [
|
|
627
|
-
if (!
|
|
628
|
-
const S = (
|
|
629
|
-
if (!(!
|
|
630
|
-
|
|
631
|
-
const
|
|
632
|
-
|
|
642
|
+
}, [a, v]), U(() => {
|
|
643
|
+
if (!a) return;
|
|
644
|
+
const S = (R) => {
|
|
645
|
+
if (!(!a || u.length === 0) && (R.key === "ArrowDown" && (R.preventDefault(), w((N) => Math.min(N + 1, u.length - 1))), R.key === "ArrowUp" && (R.preventDefault(), w((N) => Math.max(N - 1, 0))), R.key === "Enter")) {
|
|
646
|
+
R.preventDefault();
|
|
647
|
+
const N = u[z];
|
|
648
|
+
N && h(N);
|
|
633
649
|
}
|
|
634
650
|
};
|
|
635
651
|
return window.addEventListener("keydown", S), () => window.removeEventListener("keydown", S);
|
|
636
|
-
}, [
|
|
637
|
-
if (!
|
|
638
|
-
const
|
|
639
|
-
|
|
652
|
+
}, [a, u, z]), U(() => {
|
|
653
|
+
if (!P.current) return;
|
|
654
|
+
const R = P.current.querySelectorAll("li")[z];
|
|
655
|
+
R && R.scrollIntoView({
|
|
640
656
|
block: "nearest",
|
|
641
657
|
behavior: "smooth"
|
|
642
658
|
});
|
|
643
|
-
}, [
|
|
644
|
-
ref:
|
|
659
|
+
}, [z]), a ? /* @__PURE__ */ r.createElement("ul", {
|
|
660
|
+
ref: P,
|
|
645
661
|
className: "rte-popup",
|
|
646
662
|
style: {
|
|
647
|
-
top:
|
|
648
|
-
left:
|
|
663
|
+
top: d.y,
|
|
664
|
+
left: d.x
|
|
649
665
|
}
|
|
650
666
|
}, u.length > 0 ? u.map(({
|
|
651
667
|
name: S,
|
|
652
|
-
value:
|
|
653
|
-
},
|
|
654
|
-
const
|
|
655
|
-
let
|
|
656
|
-
if (
|
|
657
|
-
const
|
|
658
|
-
|
|
668
|
+
value: R
|
|
669
|
+
}, N) => {
|
|
670
|
+
const $ = S.toLowerCase(), b = L.toLowerCase(), A = $.indexOf(b);
|
|
671
|
+
let _ = S;
|
|
672
|
+
if (A !== -1 && L.length > 0) {
|
|
673
|
+
const F = A + L.length;
|
|
674
|
+
_ = S.substring(0, A) + `<span class="rte-highlight">${S.substring(A, F)}</span>` + S.substring(F);
|
|
659
675
|
}
|
|
660
|
-
return /* @__PURE__ */
|
|
661
|
-
key:
|
|
662
|
-
onMouseDown: (
|
|
663
|
-
|
|
676
|
+
return /* @__PURE__ */ r.createElement("li", {
|
|
677
|
+
key: R,
|
|
678
|
+
onMouseDown: (F) => {
|
|
679
|
+
F.preventDefault(), h({
|
|
664
680
|
name: S,
|
|
665
|
-
value:
|
|
681
|
+
value: R
|
|
666
682
|
});
|
|
667
683
|
},
|
|
668
684
|
style: {
|
|
669
685
|
padding: "6px 12px",
|
|
670
686
|
cursor: "pointer",
|
|
671
687
|
fontSize: "14px",
|
|
672
|
-
background:
|
|
688
|
+
background: N === z ? "#dce8ff" : "white"
|
|
673
689
|
},
|
|
674
690
|
dangerouslySetInnerHTML: {
|
|
675
|
-
__html:
|
|
691
|
+
__html: _
|
|
676
692
|
},
|
|
677
|
-
onMouseEnter: () =>
|
|
693
|
+
onMouseEnter: () => w(N)
|
|
678
694
|
});
|
|
679
|
-
}) : /* @__PURE__ */
|
|
695
|
+
}) : /* @__PURE__ */ r.createElement("li", {
|
|
680
696
|
style: {
|
|
681
697
|
padding: "6px 12px",
|
|
682
698
|
color: "#999"
|
|
683
699
|
}
|
|
684
700
|
}, "No matches")) : null;
|
|
685
701
|
};
|
|
686
|
-
function
|
|
687
|
-
return k({ 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: [] }] }] }] })(
|
|
702
|
+
function Ie(a) {
|
|
703
|
+
return k({ 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: [] }] }] }] })(a);
|
|
688
704
|
}
|
|
689
|
-
function
|
|
690
|
-
return k({ 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: [] }] }] }] })(
|
|
705
|
+
function ie(a) {
|
|
706
|
+
return k({ 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: [] }] }] }] })(a);
|
|
691
707
|
}
|
|
692
|
-
const
|
|
693
|
-
visible:
|
|
694
|
-
x:
|
|
708
|
+
const an = ({
|
|
709
|
+
visible: a,
|
|
710
|
+
x: d,
|
|
695
711
|
y: u,
|
|
696
|
-
onAction:
|
|
697
|
-
onClose:
|
|
712
|
+
onAction: h,
|
|
713
|
+
onClose: v
|
|
698
714
|
}) => {
|
|
699
|
-
if (!
|
|
700
|
-
const
|
|
715
|
+
if (!a) return null;
|
|
716
|
+
const L = {
|
|
701
717
|
top: u,
|
|
702
|
-
left:
|
|
718
|
+
left: d
|
|
703
719
|
};
|
|
704
|
-
return /* @__PURE__ */
|
|
705
|
-
style:
|
|
720
|
+
return /* @__PURE__ */ r.createElement("div", {
|
|
721
|
+
style: L,
|
|
706
722
|
className: "rte-table-menu",
|
|
707
|
-
onMouseLeave:
|
|
708
|
-
}, /* @__PURE__ */
|
|
709
|
-
onClick: () =>
|
|
710
|
-
}, /* @__PURE__ */
|
|
711
|
-
onClick: () =>
|
|
712
|
-
}, /* @__PURE__ */
|
|
713
|
-
onClick: () =>
|
|
714
|
-
}, /* @__PURE__ */
|
|
715
|
-
onClick: () =>
|
|
716
|
-
}, /* @__PURE__ */
|
|
717
|
-
onClick: () =>
|
|
718
|
-
}, /* @__PURE__ */
|
|
719
|
-
onClick: () =>
|
|
720
|
-
}, /* @__PURE__ */
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
723
|
+
onMouseLeave: v
|
|
724
|
+
}, /* @__PURE__ */ r.createElement("button", {
|
|
725
|
+
onClick: () => h("insertRowAbove")
|
|
726
|
+
}, /* @__PURE__ */ r.createElement(ie, null), " Insert row above"), /* @__PURE__ */ r.createElement("button", {
|
|
727
|
+
onClick: () => h("insertRowBelow")
|
|
728
|
+
}, /* @__PURE__ */ r.createElement(ie, null), " Insert row below"), /* @__PURE__ */ r.createElement("button", {
|
|
729
|
+
onClick: () => h("insertColLeft")
|
|
730
|
+
}, /* @__PURE__ */ r.createElement(ie, null), " Insert col left"), /* @__PURE__ */ r.createElement("button", {
|
|
731
|
+
onClick: () => h("insertColRight")
|
|
732
|
+
}, /* @__PURE__ */ r.createElement(ie, null), " Insert col right"), /* @__PURE__ */ r.createElement("button", {
|
|
733
|
+
onClick: () => h("deleteRow")
|
|
734
|
+
}, /* @__PURE__ */ r.createElement(Ie, null), " Delete row"), /* @__PURE__ */ r.createElement("button", {
|
|
735
|
+
onClick: () => h("deleteCol")
|
|
736
|
+
}, /* @__PURE__ */ r.createElement(Ie, null), " Delete column"));
|
|
737
|
+
};
|
|
738
|
+
function qe(a) {
|
|
739
|
+
return k({ attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M885.9 490.3c3.6-12 5.4-24.4 5.4-37 0-28.3-9.3-55.5-26.1-77.7 3.6-12 5.4-24.4 5.4-37 0-28.3-9.3-55.5-26.1-77.7 3.6-12 5.4-24.4 5.4-37 0-51.6-30.7-98.1-78.3-118.4a66.1 66.1 0 0 0-26.5-5.4H144c-17.7 0-32 14.3-32 32v364c0 17.7 14.3 32 32 32h129.3l85.8 310.8C372.9 889 418.9 924 470.9 924c29.7 0 57.4-11.8 77.9-33.4 20.5-21.5 31-49.7 29.5-79.4l-6-122.9h239.9c12.1 0 23.9-3.2 34.3-9.3 40.4-23.5 65.5-66.1 65.5-111 0-28.3-9.3-55.5-26.1-77.7zM184 456V172h81v284h-81zm627.2 160.4H496.8l9.6 198.4c.6 11.9-4.7 23.1-14.6 30.5-6.1 4.5-13.6 6.8-21.1 6.7a44.28 44.28 0 0 1-42.2-32.3L329 459.2V172h415.4a56.85 56.85 0 0 1 33.6 51.8c0 9.7-2.3 18.9-6.9 27.3l-13.9 25.4 21.9 19a56.76 56.76 0 0 1 19.6 43c0 9.7-2.3 18.9-6.9 27.3l-13.9 25.4 21.9 19a56.76 56.76 0 0 1 19.6 43c0 9.7-2.3 18.9-6.9 27.3l-14 25.5 21.9 19a56.76 56.76 0 0 1 19.6 43c0 19.1-11 37.5-28.8 48.4z" }, child: [] }] })(a);
|
|
740
|
+
}
|
|
741
|
+
function Be(a) {
|
|
742
|
+
return k({ attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M885.9 533.7c16.8-22.2 26.1-49.4 26.1-77.7 0-44.9-25.1-87.4-65.5-111.1a67.67 67.67 0 0 0-34.3-9.3H572.4l6-122.9c1.4-29.7-9.1-57.9-29.5-79.4A106.62 106.62 0 0 0 471 99.9c-52 0-98 35-111.8 85.1l-85.9 311H144c-17.7 0-32 14.3-32 32v364c0 17.7 14.3 32 32 32h601.3c9.2 0 18.2-1.8 26.5-5.4 47.6-20.3 78.3-66.8 78.3-118.4 0-12.6-1.8-25-5.4-37 16.8-22.2 26.1-49.4 26.1-77.7 0-12.6-1.8-25-5.4-37 16.8-22.2 26.1-49.4 26.1-77.7-.2-12.6-2-25.1-5.6-37.1zM184 852V568h81v284h-81zm636.4-353l-21.9 19 13.9 25.4a56.2 56.2 0 0 1 6.9 27.3c0 16.5-7.2 32.2-19.6 43l-21.9 19 13.9 25.4a56.2 56.2 0 0 1 6.9 27.3c0 16.5-7.2 32.2-19.6 43l-21.9 19 13.9 25.4a56.2 56.2 0 0 1 6.9 27.3c0 22.4-13.2 42.6-33.6 51.8H329V564.8l99.5-360.5a44.1 44.1 0 0 1 42.2-32.3c7.6 0 15.1 2.2 21.1 6.7 9.9 7.4 15.2 18.6 14.6 30.5l-9.6 198.4h314.4C829 418.5 840 436.9 840 456c0 16.5-7.2 32.1-19.6 43z" }, child: [] }] })(a);
|
|
743
|
+
}
|
|
744
|
+
const ln = ({
|
|
745
|
+
html: a,
|
|
746
|
+
className: d,
|
|
747
|
+
style: u,
|
|
748
|
+
attributes: h,
|
|
749
|
+
setAttributes: v
|
|
725
750
|
}) => {
|
|
726
|
-
const
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
751
|
+
const [L, P] = H("web"), z = {
|
|
752
|
+
web: {
|
|
753
|
+
label: "Web",
|
|
754
|
+
width: "100%",
|
|
755
|
+
height: "100%"
|
|
756
|
+
},
|
|
757
|
+
galaxyS23: {
|
|
758
|
+
label: "Galaxy S23",
|
|
759
|
+
width: 360,
|
|
760
|
+
height: 780
|
|
761
|
+
},
|
|
762
|
+
iphoneSE: {
|
|
763
|
+
label: "iPhone SE (3rd Gen)",
|
|
764
|
+
width: 375,
|
|
765
|
+
height: 667
|
|
766
|
+
},
|
|
767
|
+
iphoneX: {
|
|
768
|
+
label: "iPhone X / XS",
|
|
769
|
+
width: 375,
|
|
770
|
+
height: 812
|
|
771
|
+
},
|
|
772
|
+
pixel7a: {
|
|
773
|
+
label: "Pixel 7a",
|
|
774
|
+
width: 390,
|
|
775
|
+
height: 844
|
|
776
|
+
},
|
|
777
|
+
iphone12: {
|
|
778
|
+
label: "iPhone 12 / 13 / 14",
|
|
779
|
+
width: 390,
|
|
780
|
+
height: 844
|
|
781
|
+
},
|
|
782
|
+
iphone14: {
|
|
783
|
+
label: "iPhone 14 Pro",
|
|
784
|
+
width: 393,
|
|
785
|
+
height: 852
|
|
786
|
+
},
|
|
787
|
+
pixel7: {
|
|
788
|
+
label: "Pixel 7",
|
|
789
|
+
width: 412,
|
|
790
|
+
height: 915
|
|
791
|
+
},
|
|
792
|
+
iphone11: {
|
|
793
|
+
label: "iPhone 11",
|
|
794
|
+
width: 414,
|
|
795
|
+
height: 896
|
|
796
|
+
},
|
|
797
|
+
iphone14ProMax: {
|
|
798
|
+
label: "iPhone 14 Pro Max",
|
|
799
|
+
width: 430,
|
|
800
|
+
height: 932
|
|
801
|
+
},
|
|
802
|
+
pixel8Pro: {
|
|
803
|
+
label: "Pixel 8 Pro",
|
|
804
|
+
width: 448,
|
|
805
|
+
height: 998
|
|
806
|
+
},
|
|
807
|
+
galaxyS24Ultra: {
|
|
808
|
+
label: "Galaxy S24 Ultra",
|
|
809
|
+
width: 480,
|
|
810
|
+
height: 1040
|
|
811
|
+
}
|
|
812
|
+
}, w = (b) => {
|
|
813
|
+
const A = b.target;
|
|
814
|
+
if (A.tagName === "A") {
|
|
815
|
+
b.preventDefault();
|
|
816
|
+
const _ = A.href;
|
|
817
|
+
_ && window.open(_, "_blank", "noopener,noreferrer");
|
|
732
818
|
}
|
|
733
|
-
},
|
|
734
|
-
const
|
|
735
|
-
|
|
736
|
-
const
|
|
737
|
-
for (;
|
|
738
|
-
const
|
|
739
|
-
|
|
819
|
+
}, S = (b) => b === "rgb(0, 0, 0)" || b === "rgba(0, 0, 0, 1)" || b === "#000" || b === "#000000" || b === "black", R = (b) => {
|
|
820
|
+
const A = document.createElement("div");
|
|
821
|
+
A.innerHTML = b;
|
|
822
|
+
const _ = document.createTreeWalker(A, NodeFilter.SHOW_TEXT, null), F = [];
|
|
823
|
+
for (; _.nextNode(); ) {
|
|
824
|
+
const O = _.currentNode;
|
|
825
|
+
O.nodeValue && /{{\s*[\s\S]*?\s*}}/.test(O.nodeValue) && F.push(O);
|
|
740
826
|
}
|
|
741
|
-
return
|
|
742
|
-
var
|
|
743
|
-
const
|
|
744
|
-
if (!
|
|
745
|
-
let
|
|
746
|
-
for (;
|
|
747
|
-
if (
|
|
748
|
-
|
|
827
|
+
return F.forEach((O) => {
|
|
828
|
+
var j;
|
|
829
|
+
const I = O.nodeValue || "", K = O.parentElement;
|
|
830
|
+
if (!K) return;
|
|
831
|
+
let W = K, x = !1;
|
|
832
|
+
for (; W; ) {
|
|
833
|
+
if (W.tagName === "FONT" && W.getAttribute("color")) {
|
|
834
|
+
x = !0;
|
|
749
835
|
break;
|
|
750
836
|
}
|
|
751
|
-
const
|
|
752
|
-
if (
|
|
753
|
-
|
|
837
|
+
const B = (j = W.style) == null ? void 0 : j.color;
|
|
838
|
+
if (B && !S(B)) {
|
|
839
|
+
x = !0;
|
|
754
840
|
break;
|
|
755
841
|
}
|
|
756
|
-
const
|
|
757
|
-
if (
|
|
758
|
-
|
|
842
|
+
const Y = window.getComputedStyle(W);
|
|
843
|
+
if (Y.color && !S(Y.color)) {
|
|
844
|
+
x = !0;
|
|
759
845
|
break;
|
|
760
846
|
}
|
|
761
|
-
|
|
847
|
+
W = W.parentElement;
|
|
762
848
|
}
|
|
763
|
-
const
|
|
764
|
-
let
|
|
765
|
-
|
|
766
|
-
if (
|
|
767
|
-
|
|
849
|
+
const D = document.createDocumentFragment();
|
|
850
|
+
let q = 0;
|
|
851
|
+
I.replace(/{{\s*([\s\S]*?)\s*}}/g, (B, Y, g) => {
|
|
852
|
+
if (g > q && D.appendChild(document.createTextNode(I.slice(q, g))), x)
|
|
853
|
+
D.appendChild(document.createTextNode(B));
|
|
768
854
|
else {
|
|
769
|
-
const
|
|
770
|
-
|
|
855
|
+
const y = document.createElement("span");
|
|
856
|
+
y.style.color = "blue", y.textContent = B, D.appendChild(y);
|
|
771
857
|
}
|
|
772
|
-
return
|
|
773
|
-
}),
|
|
774
|
-
}),
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
858
|
+
return q = g + B.length, B;
|
|
859
|
+
}), q < I.length && D.appendChild(document.createTextNode(I.slice(q))), K.replaceChild(D, O);
|
|
860
|
+
}), A.innerHTML = A.innerHTML.replace(/{{#arrayData}}/g, "").replace(/{{\/arrayData}}/g, ""), A.innerHTML;
|
|
861
|
+
}, N = () => (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
|
|
862
|
+
month: "short",
|
|
863
|
+
day: "2-digit",
|
|
864
|
+
year: "numeric"
|
|
865
|
+
}), $ = () => (/* @__PURE__ */ new Date()).toLocaleString("en-US", {
|
|
866
|
+
month: "short",
|
|
867
|
+
day: "2-digit",
|
|
868
|
+
year: "numeric",
|
|
869
|
+
hour: "2-digit",
|
|
870
|
+
minute: "2-digit",
|
|
871
|
+
hour12: !0
|
|
872
|
+
});
|
|
873
|
+
return /* @__PURE__ */ r.createElement("div", {
|
|
874
|
+
className: `rte-preview ${d || ""}`,
|
|
875
|
+
style: ae(re({}, u), {
|
|
876
|
+
position: "relative"
|
|
877
|
+
}),
|
|
878
|
+
onClick: w
|
|
879
|
+
}, /* @__PURE__ */ r.createElement("div", {
|
|
880
|
+
className: "rte-preview-device-picker"
|
|
881
|
+
}, /* @__PURE__ */ r.createElement("select", {
|
|
882
|
+
value: L,
|
|
883
|
+
onChange: (b) => P(b.target.value)
|
|
884
|
+
}, Object.entries(z).map(([b, A]) => /* @__PURE__ */ r.createElement("option", {
|
|
885
|
+
key: b,
|
|
886
|
+
value: b
|
|
887
|
+
}, A.label)))), L === "web" && /* @__PURE__ */ r.createElement("div", {
|
|
888
|
+
className: "rte-preview-web-wrapper"
|
|
889
|
+
}, /* @__PURE__ */ r.createElement("div", {
|
|
890
|
+
className: "rte-preview-card"
|
|
891
|
+
}, /* @__PURE__ */ r.createElement("div", {
|
|
892
|
+
className: "rte-preview-content",
|
|
780
893
|
dangerouslySetInnerHTML: {
|
|
781
|
-
__html:
|
|
894
|
+
__html: R(a)
|
|
782
895
|
}
|
|
783
|
-
})
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
896
|
+
}), /* @__PURE__ */ r.createElement("div", {
|
|
897
|
+
className: "rte-preview-meta"
|
|
898
|
+
}, "Data updated as on Dec 14, 2025"), /* @__PURE__ */ r.createElement("div", {
|
|
899
|
+
className: "rte-preview-footer"
|
|
900
|
+
}, /* @__PURE__ */ r.createElement("div", {
|
|
901
|
+
className: "rte-preview-actions"
|
|
902
|
+
}, /* @__PURE__ */ r.createElement(Be, {
|
|
903
|
+
className: "rte-preview-like"
|
|
904
|
+
}), /* @__PURE__ */ r.createElement(qe, {
|
|
905
|
+
className: "rte-preview-like"
|
|
906
|
+
})), /* @__PURE__ */ r.createElement("div", {
|
|
907
|
+
className: "rte-preview-time"
|
|
908
|
+
}, "Dec 26, 2025 5:57 PM")))), L !== "web" && /* @__PURE__ */ r.createElement("div", {
|
|
909
|
+
className: "rte-preview-mobile-overlay"
|
|
910
|
+
}, /* @__PURE__ */ r.createElement("div", {
|
|
911
|
+
className: "rte-preview-mobile-frame",
|
|
912
|
+
style: {
|
|
913
|
+
width: z[L].width,
|
|
914
|
+
height: z[L].height
|
|
915
|
+
}
|
|
916
|
+
}, /* @__PURE__ */ r.createElement("div", {
|
|
917
|
+
className: "rte-preview-mobile-header"
|
|
918
|
+
}, /* @__PURE__ */ r.createElement("div", {
|
|
919
|
+
className: "rte-preview-logo"
|
|
920
|
+
}, "A"), /* @__PURE__ */ r.createElement("div", {
|
|
921
|
+
className: "rte-preview-bell"
|
|
922
|
+
}, "🔔", /* @__PURE__ */ r.createElement("span", {
|
|
923
|
+
className: "rte-preview-badge"
|
|
924
|
+
}, "99+"))), /* @__PURE__ */ r.createElement("div", {
|
|
925
|
+
className: "rte-preview-tabs-wrapper"
|
|
926
|
+
}, /* @__PURE__ */ r.createElement("div", {
|
|
927
|
+
className: "rte-preview-tabs"
|
|
928
|
+
}, /* @__PURE__ */ r.createElement("div", {
|
|
929
|
+
className: "rte-preview-tab rte-preview-tab-active"
|
|
930
|
+
}, "My Alerts"), /* @__PURE__ */ r.createElement("div", {
|
|
931
|
+
className: "rte-preview-tab"
|
|
932
|
+
}, "Reportees Alerts"))), /* @__PURE__ */ r.createElement("div", {
|
|
933
|
+
className: "rte-preview-mobile-body"
|
|
934
|
+
}, /* @__PURE__ */ r.createElement("div", {
|
|
935
|
+
className: "rte-preview-card"
|
|
936
|
+
}, /* @__PURE__ */ r.createElement("div", {
|
|
937
|
+
className: "rte-preview-content",
|
|
938
|
+
dangerouslySetInnerHTML: {
|
|
939
|
+
__html: R(a)
|
|
940
|
+
}
|
|
941
|
+
}), /* @__PURE__ */ r.createElement("div", {
|
|
942
|
+
className: "rte-preview-meta"
|
|
943
|
+
}, "Data updated as on ", N()), /* @__PURE__ */ r.createElement("div", {
|
|
944
|
+
className: "rte-preview-footer"
|
|
945
|
+
}, /* @__PURE__ */ r.createElement("div", {
|
|
946
|
+
className: "rte-preview-actions"
|
|
947
|
+
}, /* @__PURE__ */ r.createElement(Be, {
|
|
948
|
+
className: "rte-preview-like"
|
|
949
|
+
}), /* @__PURE__ */ r.createElement(qe, {
|
|
950
|
+
className: "rte-preview-like"
|
|
951
|
+
})), /* @__PURE__ */ r.createElement("div", {
|
|
952
|
+
className: "rte-preview-time"
|
|
953
|
+
}, $())))))), /* @__PURE__ */ r.createElement("div", null, /* @__PURE__ */ r.createElement("h3", {
|
|
954
|
+
style: {
|
|
955
|
+
marginBottom: 10
|
|
956
|
+
}
|
|
957
|
+
}, "Enter Attribute Values"), /* @__PURE__ */ r.createElement("div", {
|
|
958
|
+
className: "rte-attr-list"
|
|
959
|
+
}, Object.keys(h).map((b) => /* @__PURE__ */ r.createElement("div", {
|
|
960
|
+
key: b,
|
|
961
|
+
className: "rte-attr-row"
|
|
962
|
+
}, /* @__PURE__ */ r.createElement("div", {
|
|
963
|
+
className: "rte-attr-name"
|
|
964
|
+
}, `{{${b}}}`), /* @__PURE__ */ r.createElement("span", null, " : "), /* @__PURE__ */ r.createElement("input", {
|
|
965
|
+
className: "rte-attr-input",
|
|
966
|
+
value: h[b] || "",
|
|
967
|
+
onChange: (A) => {
|
|
968
|
+
const _ = A.target.value;
|
|
969
|
+
v((F) => ae(re({}, F), {
|
|
970
|
+
[b]: _
|
|
971
|
+
}));
|
|
972
|
+
},
|
|
973
|
+
placeholder: "Enter value"
|
|
974
|
+
}))))));
|
|
975
|
+
}, on = ({
|
|
976
|
+
visible: a,
|
|
977
|
+
linkData: d,
|
|
787
978
|
onClose: u,
|
|
788
|
-
onInsert:
|
|
979
|
+
onInsert: h
|
|
789
980
|
}) => {
|
|
790
|
-
const [
|
|
981
|
+
const [v, L] = H(""), [P, z] = H(""), [w, S] = H(""), [R, N] = H("_self");
|
|
791
982
|
if (U(() => {
|
|
792
|
-
|
|
793
|
-
}, [
|
|
794
|
-
const
|
|
795
|
-
|
|
796
|
-
url:
|
|
797
|
-
text:
|
|
798
|
-
title:
|
|
799
|
-
target:
|
|
983
|
+
a ? (L(d.url || ""), z(d.text || ""), S(d.title || ""), N(d.target || "_self")) : (L(""), z(""), S(""), N("_self"));
|
|
984
|
+
}, [a, d]), !a) return null;
|
|
985
|
+
const $ = () => {
|
|
986
|
+
h({
|
|
987
|
+
url: v,
|
|
988
|
+
text: P,
|
|
989
|
+
title: w,
|
|
990
|
+
target: R
|
|
800
991
|
});
|
|
801
992
|
};
|
|
802
|
-
return /* @__PURE__ */
|
|
993
|
+
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("div", {
|
|
803
994
|
className: "rte-link-modal-overlay",
|
|
804
995
|
onClick: u
|
|
805
|
-
}), /* @__PURE__ */
|
|
996
|
+
}), /* @__PURE__ */ r.createElement("div", {
|
|
806
997
|
className: "rte-link-modal"
|
|
807
|
-
}, /* @__PURE__ */
|
|
998
|
+
}, /* @__PURE__ */ r.createElement("h4", {
|
|
808
999
|
className: "rte-link-modal__title"
|
|
809
|
-
},
|
|
1000
|
+
}, v ? "Edit Link" : "Insert Link"), /* @__PURE__ */ r.createElement("input", {
|
|
810
1001
|
type: "text",
|
|
811
1002
|
className: "rte-link-modal__input",
|
|
812
1003
|
placeholder: "URL",
|
|
813
|
-
value:
|
|
814
|
-
onChange: (
|
|
815
|
-
}), /* @__PURE__ */
|
|
1004
|
+
value: v,
|
|
1005
|
+
onChange: (b) => L(b.target.value)
|
|
1006
|
+
}), /* @__PURE__ */ r.createElement("input", {
|
|
816
1007
|
type: "text",
|
|
817
1008
|
className: "rte-link-modal__input",
|
|
818
1009
|
placeholder: "Text to Display",
|
|
819
|
-
value:
|
|
820
|
-
onChange: (
|
|
821
|
-
}), /* @__PURE__ */
|
|
1010
|
+
value: P,
|
|
1011
|
+
onChange: (b) => z(b.target.value)
|
|
1012
|
+
}), /* @__PURE__ */ r.createElement("input", {
|
|
822
1013
|
type: "text",
|
|
823
1014
|
className: "rte-link-modal__input",
|
|
824
1015
|
placeholder: "Title",
|
|
825
|
-
value:
|
|
826
|
-
onChange: (
|
|
827
|
-
}), /* @__PURE__ */
|
|
1016
|
+
value: w,
|
|
1017
|
+
onChange: (b) => S(b.target.value)
|
|
1018
|
+
}), /* @__PURE__ */ r.createElement("select", {
|
|
828
1019
|
className: "rte-link-modal__select",
|
|
829
|
-
value:
|
|
830
|
-
onChange: (
|
|
831
|
-
}, /* @__PURE__ */
|
|
1020
|
+
value: R,
|
|
1021
|
+
onChange: (b) => N(b.target.value)
|
|
1022
|
+
}, /* @__PURE__ */ r.createElement("option", {
|
|
832
1023
|
value: "_self"
|
|
833
|
-
}, "Same tab"), /* @__PURE__ */
|
|
1024
|
+
}, "Same tab"), /* @__PURE__ */ r.createElement("option", {
|
|
834
1025
|
value: "_blank"
|
|
835
|
-
}, "New tab")), /* @__PURE__ */
|
|
1026
|
+
}, "New tab")), /* @__PURE__ */ r.createElement("div", {
|
|
836
1027
|
className: "rte-link-modal__actions"
|
|
837
|
-
}, /* @__PURE__ */
|
|
1028
|
+
}, /* @__PURE__ */ r.createElement("button", {
|
|
838
1029
|
className: "rte-link-modal__btn",
|
|
839
1030
|
onClick: u
|
|
840
|
-
}, "Cancel"), /* @__PURE__ */
|
|
1031
|
+
}, "Cancel"), /* @__PURE__ */ r.createElement("button", {
|
|
841
1032
|
className: "rte-link-modal__btn rte-link-modal__btn--ok",
|
|
842
|
-
onClick:
|
|
1033
|
+
onClick: $
|
|
843
1034
|
}, "OK"))));
|
|
844
1035
|
};
|
|
845
|
-
function
|
|
846
|
-
const
|
|
847
|
-
return
|
|
848
|
-
|
|
849
|
-
}), Array.from(
|
|
1036
|
+
function Ve(a) {
|
|
1037
|
+
const d = /* @__PURE__ */ new Map();
|
|
1038
|
+
return a.forEach((u) => {
|
|
1039
|
+
d.set(u.name, u.value);
|
|
1040
|
+
}), Array.from(d.entries()).map(([u, h]) => ({
|
|
850
1041
|
name: u,
|
|
851
|
-
value:
|
|
1042
|
+
value: h
|
|
852
1043
|
}));
|
|
853
1044
|
}
|
|
854
|
-
const
|
|
855
|
-
atSuggestions:
|
|
856
|
-
showOutput:
|
|
1045
|
+
const un = ({
|
|
1046
|
+
atSuggestions: a = [],
|
|
1047
|
+
showOutput: d = !1,
|
|
857
1048
|
showPreview: u = !1,
|
|
858
|
-
toolbarConfig:
|
|
1049
|
+
toolbarConfig: h = {
|
|
859
1050
|
link: !1,
|
|
860
1051
|
image: !1,
|
|
861
1052
|
emoji: !1,
|
|
@@ -869,269 +1060,269 @@ const an = ({
|
|
|
869
1060
|
staticUnorderedList: !1,
|
|
870
1061
|
staticOrderedList: !1
|
|
871
1062
|
},
|
|
872
|
-
classNames:
|
|
873
|
-
styles:
|
|
874
|
-
handleGetHtml:
|
|
1063
|
+
classNames: v = {},
|
|
1064
|
+
styles: L = {},
|
|
1065
|
+
handleGetHtml: P = () => {
|
|
875
1066
|
},
|
|
876
|
-
onChange:
|
|
1067
|
+
onChange: z = () => {
|
|
877
1068
|
},
|
|
878
|
-
value:
|
|
1069
|
+
value: w,
|
|
879
1070
|
onMentionSelect: S = () => {
|
|
880
1071
|
},
|
|
881
|
-
handleAddAttributes:
|
|
1072
|
+
handleAddAttributes: R = () => {
|
|
882
1073
|
}
|
|
883
1074
|
}) => {
|
|
884
|
-
var
|
|
885
|
-
const
|
|
1075
|
+
var xe, Se, Re, Ne, Me, Ae, Te, ke, ze, De, He, Oe;
|
|
1076
|
+
const N = Z(null), [$, b] = H(w != null && w.length ? w : " "), [A, _] = H(""), [F, O] = H(!1), [I, K] = H({
|
|
886
1077
|
x: 0,
|
|
887
1078
|
y: 0
|
|
888
|
-
}), [
|
|
1079
|
+
}), [W, x] = H([]), D = Z(null), q = Z(null), [j, B] = H({
|
|
889
1080
|
visible: !1,
|
|
890
1081
|
x: 0,
|
|
891
1082
|
y: 0
|
|
892
|
-
}), [
|
|
1083
|
+
}), [Y, g] = H(!1), y = Z(null), [X, J] = H({
|
|
893
1084
|
url: "",
|
|
894
1085
|
text: "",
|
|
895
1086
|
title: "",
|
|
896
1087
|
target: "_self"
|
|
897
|
-
}),
|
|
1088
|
+
}), le = {
|
|
898
1089
|
bold: !0,
|
|
899
1090
|
italic: !0,
|
|
900
1091
|
underline: !0,
|
|
901
1092
|
removeFormat: !0,
|
|
902
|
-
unorderedList: (
|
|
903
|
-
orderedList: (
|
|
904
|
-
staticUnorderedList: (
|
|
905
|
-
staticOrderedList: (
|
|
1093
|
+
unorderedList: (xe = h.unorderedList) != null ? xe : !0,
|
|
1094
|
+
orderedList: (Se = h.orderedList) != null ? Se : !0,
|
|
1095
|
+
staticUnorderedList: (Re = h.staticUnorderedList) != null ? Re : !0,
|
|
1096
|
+
staticOrderedList: (Ne = h.staticOrderedList) != null ? Ne : !0,
|
|
906
1097
|
align: !0,
|
|
907
|
-
link: (
|
|
908
|
-
image: (
|
|
909
|
-
emoji: (
|
|
910
|
-
table: (
|
|
911
|
-
color: (
|
|
912
|
-
fontFamily: (
|
|
913
|
-
fontSize: (
|
|
914
|
-
highlight: (
|
|
915
|
-
}, [
|
|
916
|
-
const e =
|
|
1098
|
+
link: (Me = h.link) != null ? Me : !1,
|
|
1099
|
+
image: (Ae = h.image) != null ? Ae : !1,
|
|
1100
|
+
emoji: (Te = h.emoji) != null ? Te : !1,
|
|
1101
|
+
table: (ke = h.table) != null ? ke : !1,
|
|
1102
|
+
color: (ze = h.color) != null ? ze : !1,
|
|
1103
|
+
fontFamily: (De = h.fontFamily) != null ? De : !1,
|
|
1104
|
+
fontSize: (He = h.fontSize) != null ? He : !1,
|
|
1105
|
+
highlight: (Oe = h.fontSize) != null ? Oe : !1
|
|
1106
|
+
}, [de, ee] = H(""), [oe, ue] = H([]), [fe, pe] = H({}), V = () => N.current, M = () => {
|
|
1107
|
+
const e = We(), t = /^<div[^>]*style=["'][^"']*font-size\s*:\s*\d+px[^"']*["'][^>]*>/.test(e.trim());
|
|
917
1108
|
let n = e;
|
|
918
|
-
t || (n = `<div style="font-size:12px">${e}</div>`), n = n.replace(/<(ul|ol)([^>]*)>[\s\S]*?<\/\1>/g, (
|
|
919
|
-
if (/list-type=["']static["']/.test(E) ||
|
|
920
|
-
const m = `<${
|
|
921
|
-
return `${m}${
|
|
922
|
-
}),
|
|
923
|
-
const
|
|
924
|
-
|
|
925
|
-
const
|
|
926
|
-
JSON.stringify(
|
|
927
|
-
},
|
|
928
|
-
const e =
|
|
929
|
-
if (!e) return
|
|
1109
|
+
t || (n = `<div style="font-size: 12px; color: #4f5055;">${e}</div>`), n = n.replace(/<(ul|ol)([^>]*)>[\s\S]*?<\/\1>/g, (i, p, E) => {
|
|
1110
|
+
if (/list-type=["']static["']/.test(E) || i.includes("data-hidden-array-start") || i.includes("data-hidden-array-end")) return i;
|
|
1111
|
+
const m = `<${p}${E}>`, s = '<span data-hidden-array-start="true" style="display:none">{{#arrayData}}</span>', f = '<span data-hidden-array-end="true" style="display:none">{{/arrayData}}</span>', C = `</${p}>`, T = i.replace(new RegExp(`^${m}`), "").replace(new RegExp(`${C}$`), "");
|
|
1112
|
+
return `${m}${s}${T}${f}${C}`;
|
|
1113
|
+
}), _(n), P == null || P(n);
|
|
1114
|
+
const l = mt(e);
|
|
1115
|
+
z(l);
|
|
1116
|
+
const c = et(), o = Ve(c);
|
|
1117
|
+
JSON.stringify(o) !== JSON.stringify(oe) && (ue(o), S(o), bt(o));
|
|
1118
|
+
}, We = () => {
|
|
1119
|
+
const e = V();
|
|
1120
|
+
if (!e) return $;
|
|
930
1121
|
const t = e.cloneNode(!0);
|
|
931
|
-
t.querySelectorAll("table div").forEach((
|
|
932
|
-
|
|
933
|
-
}), t.querySelectorAll(".rte-cell-highlight").forEach((
|
|
1122
|
+
t.querySelectorAll("table div").forEach((l) => l.remove()), t.querySelectorAll("table").forEach((l) => {
|
|
1123
|
+
l.removeAttribute("data-has-resize-handle");
|
|
1124
|
+
}), t.querySelectorAll(".rte-cell-highlight").forEach((l) => l.classList.remove("rte-cell-highlight"));
|
|
934
1125
|
let n = t.innerHTML;
|
|
935
|
-
return n =
|
|
936
|
-
},
|
|
1126
|
+
return n = Xe(n), n;
|
|
1127
|
+
}, Xe = (e) => {
|
|
937
1128
|
const t = document.createElement("div");
|
|
938
1129
|
return t.innerHTML = e, t.querySelectorAll("tbody").forEach((n) => {
|
|
939
1130
|
n.getAttribute("table-type") === "static" || (n.innerHTML = `{{#arrayData}}${n.innerHTML}{{/arrayData}}`);
|
|
940
1131
|
}), t.innerHTML;
|
|
941
|
-
},
|
|
1132
|
+
}, Q = () => {
|
|
942
1133
|
const e = window.getSelection();
|
|
943
1134
|
if (!e || e.rangeCount === 0) return;
|
|
944
1135
|
const t = document.getElementById("rte-editor-body");
|
|
945
1136
|
if (!t) return;
|
|
946
1137
|
const n = e.getRangeAt(0);
|
|
947
|
-
t.contains(n.startContainer) && (
|
|
948
|
-
},
|
|
1138
|
+
t.contains(n.startContainer) && (D.current = n.cloneRange());
|
|
1139
|
+
}, G = () => {
|
|
949
1140
|
const e = window.getSelection();
|
|
950
|
-
!e || !
|
|
951
|
-
},
|
|
1141
|
+
!e || !D.current || (e.removeAllRanges(), e.addRange(D.current));
|
|
1142
|
+
}, ve = (e, t) => {
|
|
952
1143
|
const n = window.getSelection();
|
|
953
|
-
n && n.rangeCount > 0 && (
|
|
1144
|
+
n && n.rangeCount > 0 && (D.current = n.getRangeAt(0)), G(), document.execCommand(e, !1, t), M();
|
|
954
1145
|
};
|
|
955
1146
|
U(() => {
|
|
956
|
-
const e =
|
|
957
|
-
if (!e || !
|
|
958
|
-
const t =
|
|
959
|
-
e.innerHTML = t,
|
|
1147
|
+
const e = V();
|
|
1148
|
+
if (!e || !w) return;
|
|
1149
|
+
const t = Ze(w);
|
|
1150
|
+
e.innerHTML = t, M();
|
|
960
1151
|
}, []);
|
|
961
|
-
const
|
|
1152
|
+
const Ze = (e) => e.replace(/(<table[\s\S]*?>[\s\S]*?<\/table>)/g, (t) => t.replace(/{{#arrayData}}/g, "").replace(/{{\/arrayData}}/g, ""));
|
|
962
1153
|
U(() => () => {
|
|
963
1154
|
document.removeEventListener("mousemove", null), document.removeEventListener("mouseup", null);
|
|
964
1155
|
}, []), U(() => {
|
|
965
|
-
|
|
966
|
-
|
|
1156
|
+
R && R((e) => {
|
|
1157
|
+
Je(e);
|
|
967
1158
|
});
|
|
968
1159
|
}, []), U(() => {
|
|
969
|
-
const e =
|
|
1160
|
+
const e = V();
|
|
970
1161
|
if (!e) return;
|
|
971
1162
|
e.querySelectorAll("table").forEach((n) => {
|
|
972
|
-
n.hasAttribute("data-has-resize-handle") || (
|
|
1163
|
+
n.hasAttribute("data-has-resize-handle") || (ge(n), n.querySelectorAll("th, td").forEach((c) => te(c)));
|
|
973
1164
|
});
|
|
974
1165
|
}, []);
|
|
975
|
-
const
|
|
1166
|
+
const Ee = (e) => {
|
|
976
1167
|
for (; e && e.nodeName !== "LI"; )
|
|
977
1168
|
e = e.parentNode;
|
|
978
1169
|
return e;
|
|
979
|
-
},
|
|
1170
|
+
}, we = (e, t) => {
|
|
980
1171
|
var m;
|
|
981
1172
|
const n = window.getSelection();
|
|
982
1173
|
if (!(n != null && n.rangeCount)) return;
|
|
983
|
-
const
|
|
984
|
-
let
|
|
985
|
-
const
|
|
986
|
-
if (
|
|
987
|
-
let
|
|
988
|
-
|
|
1174
|
+
const l = n.getRangeAt(0), c = Ee(l.startContainer);
|
|
1175
|
+
let o, i;
|
|
1176
|
+
const p = t === "insertStaticUnorderedList" || t === "insertStaticOrderedList";
|
|
1177
|
+
if (c) {
|
|
1178
|
+
let s = c.querySelector(e);
|
|
1179
|
+
s || (s = document.createElement(e), s.style.margin = "0", s.style.paddingLeft = "20px", c.appendChild(s)), i = s, o = document.createElement("li"), o.textContent = "", i.appendChild(o);
|
|
989
1180
|
} else {
|
|
990
1181
|
document.execCommand(e === "ul" ? "insertUnorderedList" : "insertOrderedList");
|
|
991
|
-
const
|
|
992
|
-
if (
|
|
993
|
-
|
|
1182
|
+
const s = V();
|
|
1183
|
+
if (i = s == null ? void 0 : s.querySelector(`${e}:last-child`), !i) return;
|
|
1184
|
+
p && i.setAttribute("list-type", "static"), o = i.querySelector("li:last-child");
|
|
994
1185
|
}
|
|
995
1186
|
const E = document.createRange();
|
|
996
|
-
E.setStart(
|
|
997
|
-
},
|
|
998
|
-
e === "insertOrderedList" || e === "insertStaticOrderedList" ?
|
|
999
|
-
},
|
|
1187
|
+
E.setStart(o, 0), E.collapse(!0), n.removeAllRanges(), n.addRange(E), (m = V()) == null || m.focus(), M();
|
|
1188
|
+
}, me = (e, t) => {
|
|
1189
|
+
e === "insertOrderedList" || e === "insertStaticOrderedList" ? we("ol", e) : e === "insertUnorderedList" || e === "insertStaticUnorderedList" ? we("ul", e) : e.startsWith("justify") ? gt(e) : ve(e, t), e === "insertTable" && be(), e === "insertStaticTable" && be("insertStaticTable");
|
|
1190
|
+
}, Ke = (e) => {
|
|
1000
1191
|
const t = document.createElement("span");
|
|
1001
1192
|
t.textContent = "", e.insertNode(t), e.setStartAfter(t), e.collapse(!0);
|
|
1002
1193
|
const n = t.getBoundingClientRect();
|
|
1003
|
-
t.remove(),
|
|
1194
|
+
t.remove(), K({
|
|
1004
1195
|
x: n.left,
|
|
1005
1196
|
y: n.bottom + window.scrollY
|
|
1006
|
-
}),
|
|
1007
|
-
},
|
|
1197
|
+
}), x(a || []), O(!0), q.current = e.cloneRange();
|
|
1198
|
+
}, Ye = () => {
|
|
1008
1199
|
const e = window.getSelection();
|
|
1009
1200
|
if (!e || e.rangeCount === 0) return null;
|
|
1010
1201
|
const t = e.anchorNode;
|
|
1011
1202
|
let n = e.anchorOffset;
|
|
1012
1203
|
if (!t) return null;
|
|
1013
|
-
let
|
|
1014
|
-
for (
|
|
1015
|
-
if (
|
|
1016
|
-
const
|
|
1017
|
-
if (
|
|
1018
|
-
const
|
|
1019
|
-
return
|
|
1204
|
+
let l = t;
|
|
1205
|
+
for (l.nodeType !== Node.TEXT_NODE && (l.childNodes && l.childNodes[n] ? l = l.childNodes[n] : l = t.previousSibling); l; ) {
|
|
1206
|
+
if (l.nodeType === Node.TEXT_NODE) {
|
|
1207
|
+
const c = l.textContent || "", o = l === t ? n : c.length, i = c.lastIndexOf("@", o - 1);
|
|
1208
|
+
if (i !== -1) {
|
|
1209
|
+
const p = document.createRange();
|
|
1210
|
+
return p.setStart(l, i), p.setEnd(l, o), p;
|
|
1020
1211
|
}
|
|
1021
1212
|
}
|
|
1022
|
-
|
|
1213
|
+
l = l.previousSibling;
|
|
1023
1214
|
}
|
|
1024
1215
|
return null;
|
|
1025
|
-
},
|
|
1026
|
-
var
|
|
1216
|
+
}, Qe = (e) => {
|
|
1217
|
+
var o;
|
|
1027
1218
|
const t = window.getSelection();
|
|
1028
1219
|
if (!t) return;
|
|
1029
|
-
const n =
|
|
1030
|
-
n ? (t.removeAllRanges(), t.addRange(n)) :
|
|
1031
|
-
const
|
|
1032
|
-
|
|
1220
|
+
const n = Ye();
|
|
1221
|
+
n ? (t.removeAllRanges(), t.addRange(n)) : q.current && (t.removeAllRanges(), t.addRange(q.current));
|
|
1222
|
+
const l = document.createElement("span");
|
|
1223
|
+
l.textContent = `{{${e.name}}}`, l.style.display = "inline", l.setAttribute("data-mention", e.value || e.name || ""), l.title = `{{${e.name}}}`;
|
|
1033
1224
|
try {
|
|
1034
|
-
const
|
|
1035
|
-
if (
|
|
1036
|
-
|
|
1225
|
+
const i = t.rangeCount ? t.getRangeAt(0) : null;
|
|
1226
|
+
if (i)
|
|
1227
|
+
i.deleteContents(), i.insertNode(l);
|
|
1037
1228
|
else {
|
|
1038
|
-
const m = document.createRange(),
|
|
1039
|
-
m.selectNodeContents(
|
|
1229
|
+
const m = document.createRange(), s = V();
|
|
1230
|
+
m.selectNodeContents(s), m.collapse(!1), m.insertNode(l);
|
|
1040
1231
|
}
|
|
1041
|
-
const
|
|
1042
|
-
|
|
1232
|
+
const p = document.createTextNode("");
|
|
1233
|
+
l.after(p);
|
|
1043
1234
|
const E = document.createRange();
|
|
1044
|
-
E.setStartAfter(
|
|
1045
|
-
} catch (
|
|
1046
|
-
console.error("insertMention error:",
|
|
1235
|
+
E.setStartAfter(p), E.collapse(!0), t.removeAllRanges(), t.addRange(E);
|
|
1236
|
+
} catch (i) {
|
|
1237
|
+
console.error("insertMention error:", i);
|
|
1047
1238
|
}
|
|
1048
|
-
let
|
|
1049
|
-
|
|
1050
|
-
},
|
|
1051
|
-
const t =
|
|
1239
|
+
let c = Ve([...oe, e]);
|
|
1240
|
+
ue(c), S(c), O(!1), (o = V()) == null || o.focus(), M();
|
|
1241
|
+
}, Ge = (e) => {
|
|
1242
|
+
const t = V();
|
|
1052
1243
|
if (!t) return;
|
|
1053
1244
|
let n = null;
|
|
1054
|
-
|
|
1055
|
-
const
|
|
1056
|
-
if (!
|
|
1057
|
-
|
|
1058
|
-
const
|
|
1059
|
-
|
|
1060
|
-
const
|
|
1061
|
-
|
|
1062
|
-
const
|
|
1063
|
-
|
|
1064
|
-
},
|
|
1065
|
-
e.forEach((t) =>
|
|
1066
|
-
const n = [...t, ...e],
|
|
1067
|
-
return S(
|
|
1068
|
-
}),
|
|
1069
|
-
},
|
|
1070
|
-
const e =
|
|
1245
|
+
D.current && t.contains(D.current.startContainer) ? n = D.current.cloneRange() : (n = document.createRange(), n.selectNodeContents(t), n.collapse(!1));
|
|
1246
|
+
const l = window.getSelection();
|
|
1247
|
+
if (!l) return;
|
|
1248
|
+
l.removeAllRanges(), l.addRange(n);
|
|
1249
|
+
const c = document.createElement("span");
|
|
1250
|
+
c.textContent = `{{${e.name}}}`, c.style.display = "inline", c.setAttribute("data-mention", e.value || e.name), c.title = `{{${e.name}}}`, n.insertNode(c);
|
|
1251
|
+
const o = document.createTextNode(" ");
|
|
1252
|
+
c.after(o);
|
|
1253
|
+
const i = document.createRange();
|
|
1254
|
+
i.setStartAfter(o), i.collapse(!0), l.removeAllRanges(), l.addRange(i), D.current = i.cloneRange(), t.focus();
|
|
1255
|
+
}, Je = (e) => {
|
|
1256
|
+
e.forEach((t) => Ge(t)), ue((t) => {
|
|
1257
|
+
const n = [...t, ...e], l = Array.from(new Map(n.map((c) => [c.name, c])).values());
|
|
1258
|
+
return S(l), l;
|
|
1259
|
+
}), M();
|
|
1260
|
+
}, et = () => {
|
|
1261
|
+
const e = V();
|
|
1071
1262
|
if (!e) return [];
|
|
1072
1263
|
const t = e.querySelectorAll("span[data-mention]"), n = [];
|
|
1073
|
-
return t.forEach((
|
|
1074
|
-
const
|
|
1075
|
-
|
|
1076
|
-
name:
|
|
1077
|
-
value:
|
|
1264
|
+
return t.forEach((l) => {
|
|
1265
|
+
const c = l.getAttribute("data-mention") || "", i = (l.textContent || "").match(/{{(.+?)}}/);
|
|
1266
|
+
i && n.push({
|
|
1267
|
+
name: i[1],
|
|
1268
|
+
value: c
|
|
1078
1269
|
});
|
|
1079
1270
|
}), n;
|
|
1080
|
-
},
|
|
1081
|
-
var n,
|
|
1271
|
+
}, tt = (e) => {
|
|
1272
|
+
var n, l, c;
|
|
1082
1273
|
const t = e.key.toLowerCase();
|
|
1083
|
-
if ((e.ctrlKey || e.metaKey) && ["b", "i", "u"].includes(t) && (e.preventDefault(),
|
|
1084
|
-
const
|
|
1085
|
-
if (!
|
|
1086
|
-
if (((n =
|
|
1274
|
+
if ((e.ctrlKey || e.metaKey) && ["b", "i", "u"].includes(t) && (e.preventDefault(), me(t === "b" ? "bold" : t === "i" ? "italic" : t === "u" ? "underline" : "")), e.shiftKey && e.key === "2" && e.preventDefault(), e.key === "Enter") {
|
|
1275
|
+
const o = window.getSelection(), i = o != null && o.anchorNode ? Ee(o.anchorNode) : null;
|
|
1276
|
+
if (!i) return;
|
|
1277
|
+
if (((n = i.textContent) == null ? void 0 : n.replace(/\u200B/g, "").trim()) === "") {
|
|
1087
1278
|
e.preventDefault();
|
|
1088
|
-
const E =
|
|
1279
|
+
const E = i.parentElement, m = E == null ? void 0 : E.closest("li");
|
|
1089
1280
|
if (m) {
|
|
1090
|
-
E == null || E.removeChild(
|
|
1091
|
-
const
|
|
1092
|
-
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1281
|
+
E == null || E.removeChild(i);
|
|
1282
|
+
const s = document.createElement("p");
|
|
1283
|
+
s.innerHTML = "<br />", (l = m.parentElement) == null || l.insertBefore(s, m.nextSibling);
|
|
1284
|
+
const f = document.createRange();
|
|
1285
|
+
f.setStart(s, 0), f.collapse(!0), o == null || o.removeAllRanges(), o == null || o.addRange(f);
|
|
1095
1286
|
} else {
|
|
1096
|
-
const
|
|
1097
|
-
if (
|
|
1098
|
-
const
|
|
1099
|
-
|
|
1100
|
-
const
|
|
1101
|
-
|
|
1287
|
+
const s = i.closest("ul, ol");
|
|
1288
|
+
if (s) {
|
|
1289
|
+
const f = document.createElement("p");
|
|
1290
|
+
f.innerHTML = "<br />", (c = s.parentElement) == null || c.insertBefore(f, s.nextSibling), s.removeChild(i);
|
|
1291
|
+
const C = document.createRange();
|
|
1292
|
+
C.setStart(f, 0), C.collapse(!0), o == null || o.removeAllRanges(), o == null || o.addRange(C);
|
|
1102
1293
|
}
|
|
1103
1294
|
}
|
|
1104
|
-
|
|
1295
|
+
M();
|
|
1105
1296
|
}
|
|
1106
1297
|
}
|
|
1107
1298
|
if (t === "backspace" || t === "delete") {
|
|
1108
|
-
const
|
|
1109
|
-
if (!
|
|
1110
|
-
const
|
|
1111
|
-
if (
|
|
1299
|
+
const o = window.getSelection();
|
|
1300
|
+
if (!o || o.rangeCount === 0) return;
|
|
1301
|
+
const i = o.getRangeAt(0);
|
|
1302
|
+
if (i.cloneContents().querySelector("table"))
|
|
1112
1303
|
return;
|
|
1113
|
-
if (
|
|
1304
|
+
if (i.cloneContents().querySelectorAll(".rte-resize-handle").length > 0) {
|
|
1114
1305
|
e.preventDefault(), e.stopPropagation();
|
|
1115
1306
|
return;
|
|
1116
1307
|
}
|
|
1117
1308
|
}
|
|
1118
|
-
},
|
|
1309
|
+
}, nt = (e) => {
|
|
1119
1310
|
if (e.data === "@") {
|
|
1120
1311
|
const n = window.getSelection();
|
|
1121
1312
|
if (!(n != null && n.rangeCount)) return;
|
|
1122
|
-
const
|
|
1123
|
-
if (
|
|
1313
|
+
const l = n.anchorNode;
|
|
1314
|
+
if (he(l))
|
|
1124
1315
|
return;
|
|
1125
1316
|
setTimeout(() => {
|
|
1126
|
-
|
|
1317
|
+
Ke(n.getRangeAt(0)), ee(""), x(a), O(!0);
|
|
1127
1318
|
}, 0);
|
|
1128
1319
|
return;
|
|
1129
1320
|
}
|
|
1130
|
-
if (
|
|
1131
|
-
setTimeout(() =>
|
|
1321
|
+
if (F) {
|
|
1322
|
+
setTimeout(() => ye(), 0);
|
|
1132
1323
|
return;
|
|
1133
1324
|
}
|
|
1134
|
-
},
|
|
1325
|
+
}, he = (e) => {
|
|
1135
1326
|
if (!e) return !1;
|
|
1136
1327
|
let t = e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement;
|
|
1137
1328
|
for (; t; ) {
|
|
@@ -1139,89 +1330,89 @@ const an = ({
|
|
|
1139
1330
|
t = t.parentElement;
|
|
1140
1331
|
}
|
|
1141
1332
|
return !1;
|
|
1142
|
-
},
|
|
1143
|
-
|
|
1333
|
+
}, ye = () => {
|
|
1334
|
+
M();
|
|
1144
1335
|
const e = window.getSelection();
|
|
1145
1336
|
if (!e || !e.anchorNode) return;
|
|
1146
|
-
if (
|
|
1147
|
-
|
|
1337
|
+
if (he(e.anchorNode)) {
|
|
1338
|
+
O(!1);
|
|
1148
1339
|
return;
|
|
1149
1340
|
}
|
|
1150
1341
|
let t = e.anchorNode.textContent || "";
|
|
1151
1342
|
t = t.replace(/\u00A0/g, " ");
|
|
1152
1343
|
const n = t.match(/@([^\n]*)$/);
|
|
1153
1344
|
if (!n) {
|
|
1154
|
-
|
|
1345
|
+
O(!1);
|
|
1155
1346
|
return;
|
|
1156
1347
|
}
|
|
1157
|
-
const
|
|
1158
|
-
|
|
1159
|
-
const
|
|
1160
|
-
|
|
1161
|
-
},
|
|
1162
|
-
var
|
|
1163
|
-
const t = (
|
|
1348
|
+
const l = n[1].trim().toLowerCase();
|
|
1349
|
+
ee(l);
|
|
1350
|
+
const c = a.filter((o) => o.name.toLowerCase().includes(l));
|
|
1351
|
+
c.length > 0 ? (x(c), O(!0)) : O(!1);
|
|
1352
|
+
}, rt = (e) => {
|
|
1353
|
+
var l;
|
|
1354
|
+
const t = (l = e.target.files) == null ? void 0 : l[0];
|
|
1164
1355
|
if (!t) return;
|
|
1165
1356
|
const n = new FileReader();
|
|
1166
|
-
n.onload = (
|
|
1167
|
-
var
|
|
1168
|
-
const
|
|
1169
|
-
|
|
1170
|
-
const
|
|
1171
|
-
let
|
|
1357
|
+
n.onload = (c) => {
|
|
1358
|
+
var C;
|
|
1359
|
+
const o = (C = c.target) == null ? void 0 : C.result;
|
|
1360
|
+
G();
|
|
1361
|
+
const i = window.getSelection();
|
|
1362
|
+
let p = i && i.rangeCount ? i.getRangeAt(0) : null;
|
|
1172
1363
|
const E = document.createElement("img");
|
|
1173
|
-
E.src =
|
|
1174
|
-
const m =
|
|
1175
|
-
if (!
|
|
1364
|
+
E.src = o, E.alt = t.name || "image", E.className = "rte-inserted-image", E.contentEditable = "true";
|
|
1365
|
+
const m = V();
|
|
1366
|
+
if (!p || !m) {
|
|
1176
1367
|
m == null || m.appendChild(E);
|
|
1177
|
-
const
|
|
1178
|
-
m == null || m.appendChild(
|
|
1179
|
-
const
|
|
1180
|
-
|
|
1368
|
+
const T = document.createTextNode(" ");
|
|
1369
|
+
m == null || m.appendChild(T);
|
|
1370
|
+
const ne = document.createRange();
|
|
1371
|
+
ne.setStartAfter(T), ne.collapse(!0), i == null || i.removeAllRanges(), i == null || i.addRange(ne), m == null || m.focus(), M(), e.target.value = "";
|
|
1181
1372
|
return;
|
|
1182
1373
|
}
|
|
1183
|
-
|
|
1184
|
-
const
|
|
1185
|
-
E.after(
|
|
1186
|
-
const
|
|
1187
|
-
|
|
1374
|
+
p.deleteContents(), p.insertNode(E);
|
|
1375
|
+
const s = document.createTextNode(" ");
|
|
1376
|
+
E.after(s);
|
|
1377
|
+
const f = document.createRange();
|
|
1378
|
+
f.setStartAfter(s), f.collapse(!0), i.removeAllRanges(), i.addRange(f), m.focus(), M(), e.target.value = "";
|
|
1188
1379
|
}, n.readAsDataURL(t);
|
|
1189
|
-
},
|
|
1190
|
-
var
|
|
1191
|
-
|
|
1380
|
+
}, at = (e) => {
|
|
1381
|
+
var c;
|
|
1382
|
+
G();
|
|
1192
1383
|
const t = window.getSelection();
|
|
1193
1384
|
if (!(t != null && t.rangeCount)) return;
|
|
1194
|
-
const n = t.getRangeAt(0),
|
|
1195
|
-
n.insertNode(
|
|
1196
|
-
},
|
|
1197
|
-
var
|
|
1198
|
-
|
|
1385
|
+
const n = t.getRangeAt(0), l = document.createTextNode(e);
|
|
1386
|
+
n.insertNode(l), n.setStartAfter(l), n.collapse(!0), t.removeAllRanges(), t.addRange(n), (c = V()) == null || c.focus(), M();
|
|
1387
|
+
}, be = (e) => {
|
|
1388
|
+
var s;
|
|
1389
|
+
wt(), G();
|
|
1199
1390
|
const t = document.createElement("table");
|
|
1200
|
-
t.style.borderCollapse = "collapse", t.style.width = "
|
|
1391
|
+
t.style.borderCollapse = "collapse", t.style.width = "310px", t.style.border = "1px solid #ccc", t.style.margin = "8px 0", t.style.position = "relative", t.style.textAlign = "center", v.table && t.classList.add(v.table);
|
|
1201
1392
|
const n = document.createElement("thead");
|
|
1202
|
-
|
|
1203
|
-
const
|
|
1204
|
-
|
|
1205
|
-
const
|
|
1206
|
-
|
|
1207
|
-
const
|
|
1208
|
-
|
|
1209
|
-
for (let
|
|
1210
|
-
const
|
|
1211
|
-
|
|
1212
|
-
const
|
|
1213
|
-
|
|
1393
|
+
v.thead && n.classList.add(v.thead);
|
|
1394
|
+
const l = document.createElement("tbody");
|
|
1395
|
+
v.tbody && l.classList.add(v.tbody), e === "insertStaticTable" && l.setAttribute("table-type", "static");
|
|
1396
|
+
const c = document.createElement("tr");
|
|
1397
|
+
v.tr && c.classList.add(v.tr);
|
|
1398
|
+
const o = document.createElement("tr");
|
|
1399
|
+
v.tr && o.classList.add(v.tr);
|
|
1400
|
+
for (let f = 0; f < 2; f++) {
|
|
1401
|
+
const C = document.createElement("th");
|
|
1402
|
+
C.textContent = "", C.style.border = "1px solid #999", C.style.padding = "4px", C.style.position = "relative", C.style.backgroundColor = "lightgray", C.style.height = "20px", v.th && C.classList.add(v.th);
|
|
1403
|
+
const T = document.createElement("td");
|
|
1404
|
+
T.textContent = "", T.style.border = "1px solid #999", T.style.padding = "4px", T.style.position = "relative", T.style.backgroundColor = "#fff", T.style.minHeight = "20px", T.style.height = "20px", T.style.whiteSpace = "normal", T.style.wordBreak = "break-word", T.style.overflowWrap = "anywhere", T.style.lineHeight = "20px", T.style.minWidth = "20px", v.td && T.classList.add(v.td), te(C), te(T), c.appendChild(C), o.appendChild(T);
|
|
1214
1405
|
}
|
|
1215
|
-
n.appendChild(
|
|
1216
|
-
const
|
|
1217
|
-
if (!(
|
|
1218
|
-
const
|
|
1219
|
-
|
|
1406
|
+
n.appendChild(c), l.appendChild(o), t.appendChild(n), t.appendChild(l), ge(t);
|
|
1407
|
+
const i = window.getSelection();
|
|
1408
|
+
if (!(i != null && i.rangeCount)) return;
|
|
1409
|
+
const p = i.getRangeAt(0);
|
|
1410
|
+
p.collapse(!1), p.insertNode(t);
|
|
1220
1411
|
const E = document.createElement("p");
|
|
1221
1412
|
E.innerHTML = "<br/>", t.after(E);
|
|
1222
1413
|
const m = document.createRange();
|
|
1223
|
-
m.setStart(E, 0), m.collapse(!0),
|
|
1224
|
-
},
|
|
1414
|
+
m.setStart(E, 0), m.collapse(!0), i.removeAllRanges(), i.addRange(m), (s = V()) == null || s.focus(), M();
|
|
1415
|
+
}, ge = (e) => {
|
|
1225
1416
|
if (e.dataset.hasResizeHandle === "true") return;
|
|
1226
1417
|
const t = document.createElement("div");
|
|
1227
1418
|
Object.assign(t.style, {
|
|
@@ -1235,20 +1426,20 @@ const an = ({
|
|
|
1235
1426
|
zIndex: "20",
|
|
1236
1427
|
borderRadius: "2px"
|
|
1237
1428
|
}), t.contentEditable = "false", t.dataset.hasResizeHandle = "true", t.classList.add("rte-resize-handle");
|
|
1238
|
-
let n = 0,
|
|
1239
|
-
t.addEventListener("mousedown", (
|
|
1240
|
-
|
|
1241
|
-
const
|
|
1242
|
-
|
|
1243
|
-
const E = (
|
|
1244
|
-
const
|
|
1245
|
-
e.style.width = `${
|
|
1429
|
+
let n = 0, l = 0, c = 0, o = 0;
|
|
1430
|
+
t.addEventListener("mousedown", (i) => {
|
|
1431
|
+
i.preventDefault(), n = i.clientX, l = i.clientY;
|
|
1432
|
+
const p = e.getBoundingClientRect();
|
|
1433
|
+
c = p.width, o = p.height;
|
|
1434
|
+
const E = (s) => {
|
|
1435
|
+
const f = Math.max(100, c + (s.clientX - n)), C = Math.max(20, o + (s.clientY - l));
|
|
1436
|
+
e.style.width = `${f}px`, e.style.height = `${C}px`, M();
|
|
1246
1437
|
}, m = () => {
|
|
1247
|
-
document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", m),
|
|
1438
|
+
document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", m), M();
|
|
1248
1439
|
};
|
|
1249
1440
|
document.addEventListener("mousemove", E), document.addEventListener("mouseup", m);
|
|
1250
1441
|
}), e.appendChild(t);
|
|
1251
|
-
},
|
|
1442
|
+
}, te = (e) => {
|
|
1252
1443
|
const t = document.createElement("div"), n = document.createElement("div");
|
|
1253
1444
|
Object.assign(t.style, {
|
|
1254
1445
|
position: "absolute",
|
|
@@ -1274,102 +1465,102 @@ const an = ({
|
|
|
1274
1465
|
MozUserSelect: "none",
|
|
1275
1466
|
msUserSelect: "none",
|
|
1276
1467
|
pointerEvents: "auto"
|
|
1277
|
-
}), n.contentEditable = "false", n.classList.add("rte-resize-handle"),
|
|
1278
|
-
},
|
|
1279
|
-
let
|
|
1280
|
-
t.addEventListener("mousedown", (
|
|
1281
|
-
|
|
1282
|
-
}), n.addEventListener("mousedown", (
|
|
1283
|
-
|
|
1468
|
+
}), n.contentEditable = "false", n.classList.add("rte-resize-handle"), lt(e, t, n), e.appendChild(t), e.appendChild(n);
|
|
1469
|
+
}, lt = (e, t, n) => {
|
|
1470
|
+
let l = 0, c = 0, o = 0, i = 0;
|
|
1471
|
+
t.addEventListener("mousedown", (s) => {
|
|
1472
|
+
s.preventDefault(), l = s.clientX, o = e.offsetWidth, document.addEventListener("mousemove", p), document.addEventListener("mouseup", m);
|
|
1473
|
+
}), n.addEventListener("mousedown", (s) => {
|
|
1474
|
+
s.preventDefault(), c = s.clientY, i = e.offsetHeight, document.addEventListener("mousemove", E), document.addEventListener("mouseup", m);
|
|
1284
1475
|
});
|
|
1285
|
-
const
|
|
1286
|
-
const
|
|
1287
|
-
e.style.width = `${Math.max(30,
|
|
1288
|
-
}, E = (
|
|
1289
|
-
const
|
|
1290
|
-
e.style.height = `${Math.max(20,
|
|
1476
|
+
const p = (s) => {
|
|
1477
|
+
const f = o + (s.clientX - l);
|
|
1478
|
+
e.style.width = `${Math.max(30, f)}px`, M();
|
|
1479
|
+
}, E = (s) => {
|
|
1480
|
+
const f = i + (s.clientY - c);
|
|
1481
|
+
e.style.height = `${Math.max(20, f)}px`, M();
|
|
1291
1482
|
}, m = () => {
|
|
1292
|
-
document.removeEventListener("mousemove",
|
|
1483
|
+
document.removeEventListener("mousemove", p), document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", m), M();
|
|
1293
1484
|
};
|
|
1294
|
-
},
|
|
1485
|
+
}, ot = (e) => {
|
|
1295
1486
|
const n = e.target.closest("td, th");
|
|
1296
|
-
n && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((
|
|
1487
|
+
n && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((l) => l.classList.remove("rte-cell-highlight")), n.classList.add("rte-cell-highlight"), B({
|
|
1297
1488
|
visible: !0,
|
|
1298
1489
|
x: e.clientX,
|
|
1299
1490
|
y: e.clientY,
|
|
1300
1491
|
cell: n
|
|
1301
1492
|
}));
|
|
1302
|
-
},
|
|
1493
|
+
}, Ce = () => {
|
|
1303
1494
|
document.querySelectorAll(".rte-cell-highlight").forEach((e) => e.classList.remove("rte-cell-highlight"));
|
|
1304
|
-
},
|
|
1305
|
-
if (!
|
|
1306
|
-
const t =
|
|
1307
|
-
const
|
|
1308
|
-
return
|
|
1495
|
+
}, it = (e) => {
|
|
1496
|
+
if (!j.cell) return;
|
|
1497
|
+
const t = j.cell.closest("table"), n = j.cell.cellIndex, l = j.cell.parentElement.rowIndex, c = (o) => {
|
|
1498
|
+
const i = o.tagName.toLowerCase(), p = document.createElement(i);
|
|
1499
|
+
return p.textContent = "", p.style.cssText = o.style.cssText, te(p), p;
|
|
1309
1500
|
};
|
|
1310
1501
|
switch (e) {
|
|
1311
1502
|
case "insertRowAbove": {
|
|
1312
|
-
const
|
|
1313
|
-
Array.from(
|
|
1314
|
-
|
|
1503
|
+
const o = t.rows[l], i = t.insertRow(l);
|
|
1504
|
+
Array.from(o.cells).forEach((p) => {
|
|
1505
|
+
i.appendChild(c(p));
|
|
1315
1506
|
});
|
|
1316
1507
|
break;
|
|
1317
1508
|
}
|
|
1318
1509
|
case "insertRowBelow": {
|
|
1319
|
-
const
|
|
1320
|
-
Array.from(
|
|
1321
|
-
|
|
1510
|
+
const o = t.rows[l], i = t.insertRow(l + 1);
|
|
1511
|
+
Array.from(o.cells).forEach((p) => {
|
|
1512
|
+
i.appendChild(c(p));
|
|
1322
1513
|
});
|
|
1323
1514
|
break;
|
|
1324
1515
|
}
|
|
1325
1516
|
case "insertColLeft": {
|
|
1326
|
-
Array.from(t.rows).forEach((
|
|
1327
|
-
const
|
|
1328
|
-
|
|
1517
|
+
Array.from(t.rows).forEach((o) => {
|
|
1518
|
+
const i = o.cells[n];
|
|
1519
|
+
o.insertBefore(c(i), i);
|
|
1329
1520
|
});
|
|
1330
1521
|
break;
|
|
1331
1522
|
}
|
|
1332
1523
|
case "insertColRight": {
|
|
1333
|
-
Array.from(t.rows).forEach((
|
|
1334
|
-
const
|
|
1335
|
-
|
|
1524
|
+
Array.from(t.rows).forEach((o) => {
|
|
1525
|
+
const i = o.cells[n];
|
|
1526
|
+
o.insertBefore(c(i), i.nextSibling);
|
|
1336
1527
|
});
|
|
1337
1528
|
break;
|
|
1338
1529
|
}
|
|
1339
1530
|
case "deleteRow":
|
|
1340
|
-
t.rows.length > 1 && t.deleteRow(
|
|
1531
|
+
t.rows.length > 1 && t.deleteRow(l);
|
|
1341
1532
|
break;
|
|
1342
1533
|
case "deleteCol":
|
|
1343
|
-
Array.from(t.rows).forEach((
|
|
1344
|
-
|
|
1534
|
+
Array.from(t.rows).forEach((o) => {
|
|
1535
|
+
o.cells[n] && o.deleteCell(n);
|
|
1345
1536
|
});
|
|
1346
1537
|
break;
|
|
1347
1538
|
}
|
|
1348
|
-
|
|
1539
|
+
M(), B(ae(re({}, j), {
|
|
1349
1540
|
visible: !1
|
|
1350
|
-
})),
|
|
1351
|
-
},
|
|
1352
|
-
|
|
1541
|
+
})), Ce();
|
|
1542
|
+
}, ct = () => {
|
|
1543
|
+
Q(), y.current = D.current, J({
|
|
1353
1544
|
url: "",
|
|
1354
1545
|
text: "",
|
|
1355
1546
|
title: "",
|
|
1356
1547
|
target: "_self"
|
|
1357
|
-
}),
|
|
1358
|
-
},
|
|
1548
|
+
}), g(!0);
|
|
1549
|
+
}, st = (e) => {
|
|
1359
1550
|
const t = window.getSelection();
|
|
1360
|
-
if (!t || !
|
|
1361
|
-
t.removeAllRanges(), t.addRange(
|
|
1551
|
+
if (!t || !y.current) return;
|
|
1552
|
+
t.removeAllRanges(), t.addRange(y.current);
|
|
1362
1553
|
let n = e.url.trim();
|
|
1363
1554
|
/^https?:\/\//i.test(n) || (n = "https://" + n);
|
|
1364
|
-
const
|
|
1365
|
-
|
|
1366
|
-
const
|
|
1367
|
-
|
|
1368
|
-
const
|
|
1369
|
-
|
|
1370
|
-
const
|
|
1371
|
-
|
|
1372
|
-
},
|
|
1555
|
+
const l = document.createElement("a");
|
|
1556
|
+
l.href = n, l.style.cursor = "pointer", l.style.outline = "none", l.textContent = e.text || n, l.title = e.title, l.target = e.target, l.contentEditable = "true";
|
|
1557
|
+
const c = t.getRangeAt(0);
|
|
1558
|
+
c.deleteContents(), c.insertNode(l);
|
|
1559
|
+
const o = document.createTextNode(" ");
|
|
1560
|
+
l.after(o);
|
|
1561
|
+
const i = document.createRange();
|
|
1562
|
+
i.setStartAfter(o), i.collapse(!0), t.removeAllRanges(), t.addRange(i), g(!1), M();
|
|
1563
|
+
}, dt = (e) => {
|
|
1373
1564
|
const t = e.target;
|
|
1374
1565
|
if (t.tagName === "A") {
|
|
1375
1566
|
const n = t;
|
|
@@ -1378,91 +1569,91 @@ const an = ({
|
|
|
1378
1569
|
return;
|
|
1379
1570
|
}
|
|
1380
1571
|
e.preventDefault();
|
|
1381
|
-
const
|
|
1382
|
-
|
|
1572
|
+
const l = document.createRange();
|
|
1573
|
+
l.selectNode(n), y.current = l, J({
|
|
1383
1574
|
url: n.href,
|
|
1384
1575
|
text: n.textContent || n.href,
|
|
1385
1576
|
title: n.title,
|
|
1386
1577
|
target: n.target
|
|
1387
|
-
}),
|
|
1578
|
+
}), g(!0);
|
|
1388
1579
|
}
|
|
1389
|
-
},
|
|
1390
|
-
const e =
|
|
1580
|
+
}, ut = () => {
|
|
1581
|
+
const e = V();
|
|
1391
1582
|
if (!e) return;
|
|
1392
1583
|
const t = window.getSelection();
|
|
1393
|
-
if ((!t || t.rangeCount === 0) &&
|
|
1394
|
-
const
|
|
1395
|
-
|
|
1584
|
+
if ((!t || t.rangeCount === 0) && D.current) {
|
|
1585
|
+
const s = window.getSelection();
|
|
1586
|
+
s == null || s.removeAllRanges(), s == null || s.addRange(D.current);
|
|
1396
1587
|
}
|
|
1397
1588
|
const n = window.getSelection();
|
|
1398
1589
|
if (!n || n.rangeCount === 0) return;
|
|
1399
|
-
const
|
|
1400
|
-
|
|
1401
|
-
const
|
|
1402
|
-
|
|
1403
|
-
const
|
|
1404
|
-
for (;
|
|
1405
|
-
const
|
|
1406
|
-
|
|
1590
|
+
const l = n.getRangeAt(0);
|
|
1591
|
+
G(), document.execCommand("removeFormat", !1);
|
|
1592
|
+
const c = l.cloneContents(), o = document.createElement("div");
|
|
1593
|
+
o.appendChild(c);
|
|
1594
|
+
const i = document.createTreeWalker(o, NodeFilter.SHOW_ELEMENT, null), p = [];
|
|
1595
|
+
for (; i.nextNode(); ) {
|
|
1596
|
+
const s = i.currentNode, f = s.tagName.toUpperCase(), C = s.getAttribute && s.getAttribute("data-mention") !== null;
|
|
1597
|
+
f !== "A" && !C && p.push(s);
|
|
1407
1598
|
}
|
|
1408
|
-
for (let
|
|
1409
|
-
const
|
|
1410
|
-
if (
|
|
1411
|
-
for (;
|
|
1412
|
-
|
|
1599
|
+
for (let s = p.length - 1; s >= 0; s--) {
|
|
1600
|
+
const f = p[s], C = f.parentNode;
|
|
1601
|
+
if (C) {
|
|
1602
|
+
for (; f.firstChild; ) C.insertBefore(f.firstChild, f);
|
|
1603
|
+
C.removeChild(f);
|
|
1413
1604
|
}
|
|
1414
1605
|
}
|
|
1415
|
-
|
|
1606
|
+
o.querySelectorAll("[style]").forEach((s) => s.removeAttribute("style")), l.deleteContents();
|
|
1416
1607
|
const E = document.createDocumentFragment();
|
|
1417
|
-
for (;
|
|
1418
|
-
|
|
1608
|
+
for (; o.firstChild; ) E.appendChild(o.firstChild);
|
|
1609
|
+
l.insertNode(E);
|
|
1419
1610
|
const m = document.createRange();
|
|
1420
|
-
m.setStartAfter(
|
|
1421
|
-
},
|
|
1422
|
-
var
|
|
1611
|
+
m.setStartAfter(l.endContainer.nodeType === Node.TEXT_NODE ? l.endContainer : l.startContainer), m.collapse(!0), n.removeAllRanges(), n.addRange(m), e.normalize(), M();
|
|
1612
|
+
}, mt = (e) => {
|
|
1613
|
+
var l;
|
|
1423
1614
|
let t = e;
|
|
1424
1615
|
t = t.replace(/{{#arrayData\d*}}/g, ""), t = t.replace(/{{\/arrayData\d*}}/g, "");
|
|
1425
1616
|
const n = document.createElement("div");
|
|
1426
|
-
return n.innerHTML = t, n.querySelectorAll("br").forEach((
|
|
1427
|
-
|
|
1617
|
+
return n.innerHTML = t, n.querySelectorAll("br").forEach((c) => {
|
|
1618
|
+
c.replaceWith(`
|
|
1428
1619
|
`);
|
|
1429
|
-
}), n.querySelectorAll("p, div, tr").forEach((
|
|
1430
|
-
|
|
1620
|
+
}), n.querySelectorAll("p, div, tr").forEach((c) => {
|
|
1621
|
+
c.insertAdjacentText("afterend", `
|
|
1431
1622
|
`);
|
|
1432
|
-
}), n.querySelectorAll("table").forEach((
|
|
1433
|
-
|
|
1623
|
+
}), n.querySelectorAll("table").forEach((c) => {
|
|
1624
|
+
c.insertAdjacentText("afterend", `
|
|
1434
1625
|
`);
|
|
1435
|
-
}), ((
|
|
1626
|
+
}), ((l = n.textContent) == null ? void 0 : l.replace(/\n{3,}/g, `
|
|
1436
1627
|
|
|
1437
1628
|
`).trim()) || "";
|
|
1438
1629
|
};
|
|
1439
|
-
function
|
|
1630
|
+
function ht() {
|
|
1440
1631
|
const e = window.getSelection();
|
|
1441
1632
|
if (!e || e.rangeCount === 0) return [];
|
|
1442
1633
|
const t = e.getRangeAt(0);
|
|
1443
1634
|
if (t.collapsed) {
|
|
1444
|
-
let
|
|
1445
|
-
const
|
|
1446
|
-
return
|
|
1635
|
+
let o = t.startContainer, i = o.nodeType === Node.ELEMENT_NODE ? o : o.parentElement;
|
|
1636
|
+
const p = i == null ? void 0 : i.closest("td, th");
|
|
1637
|
+
return p ? [p] : [];
|
|
1447
1638
|
}
|
|
1448
|
-
const n = t.commonAncestorContainer,
|
|
1449
|
-
return Array.from(
|
|
1450
|
-
const
|
|
1451
|
-
return
|
|
1639
|
+
const n = t.commonAncestorContainer, l = n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement;
|
|
1640
|
+
return Array.from(l.querySelectorAll("td, th")).filter((o) => {
|
|
1641
|
+
const i = document.createRange();
|
|
1642
|
+
return i.selectNodeContents(o), t.compareBoundaryPoints(Range.END_TO_START, i) < 0 && t.compareBoundaryPoints(Range.START_TO_END, i) > 0;
|
|
1452
1643
|
});
|
|
1453
1644
|
}
|
|
1454
|
-
function
|
|
1455
|
-
const t =
|
|
1645
|
+
function gt(e) {
|
|
1646
|
+
const t = ht();
|
|
1456
1647
|
if (t.length === 0) {
|
|
1457
|
-
|
|
1648
|
+
ve(e);
|
|
1458
1649
|
return;
|
|
1459
1650
|
}
|
|
1460
1651
|
let n = "left";
|
|
1461
|
-
e === "justifyCenter" && (n = "center"), e === "justifyRight" && (n = "right"), t.forEach((
|
|
1462
|
-
|
|
1463
|
-
}),
|
|
1652
|
+
e === "justifyCenter" && (n = "center"), e === "justifyRight" && (n = "right"), t.forEach((l) => {
|
|
1653
|
+
l.style.textAlign = n;
|
|
1654
|
+
}), M();
|
|
1464
1655
|
}
|
|
1465
|
-
const
|
|
1656
|
+
const ft = () => {
|
|
1466
1657
|
const e = window.getSelection();
|
|
1467
1658
|
if (!e || !e.anchorNode) return !1;
|
|
1468
1659
|
let t = e.anchorNode.nodeType === Node.ELEMENT_NODE ? e.anchorNode : e.anchorNode.parentElement;
|
|
@@ -1471,19 +1662,19 @@ const an = ({
|
|
|
1471
1662
|
t = t.parentElement;
|
|
1472
1663
|
}
|
|
1473
1664
|
return !1;
|
|
1474
|
-
},
|
|
1475
|
-
if (
|
|
1665
|
+
}, pt = (e) => {
|
|
1666
|
+
if (ft()) {
|
|
1476
1667
|
e.preventDefault();
|
|
1477
1668
|
const m = e.clipboardData.getData("text/plain");
|
|
1478
1669
|
if (!m) return;
|
|
1479
|
-
const
|
|
1480
|
-
if (!
|
|
1481
|
-
const
|
|
1482
|
-
|
|
1483
|
-
const
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
}),
|
|
1670
|
+
const s = window.getSelection();
|
|
1671
|
+
if (!s || !s.rangeCount) return;
|
|
1672
|
+
const f = s.getRangeAt(0);
|
|
1673
|
+
f.deleteContents();
|
|
1674
|
+
const C = m.split(/\r?\n/);
|
|
1675
|
+
C.forEach((T, ne) => {
|
|
1676
|
+
f.insertNode(document.createTextNode(T)), ne < C.length - 1 && f.insertNode(document.createElement("br"));
|
|
1677
|
+
}), f.collapse(!1), s.removeAllRanges(), s.addRange(f), M();
|
|
1487
1678
|
return;
|
|
1488
1679
|
}
|
|
1489
1680
|
const t = e.clipboardData.getData("text/html") || "";
|
|
@@ -1494,166 +1685,184 @@ const an = ({
|
|
|
1494
1685
|
return;
|
|
1495
1686
|
}
|
|
1496
1687
|
e.preventDefault();
|
|
1497
|
-
const
|
|
1498
|
-
|
|
1499
|
-
const
|
|
1500
|
-
m.hasAttribute("data-has-resize-handle") || (m.style.borderCollapse = "collapse", m.style.width = "100%", m.style.border = "1px solid #ccc", m.style.margin = "8px 0", m.style.position = "relative", m.style.textAlign = "center", m.querySelectorAll("th").forEach((
|
|
1501
|
-
const
|
|
1502
|
-
|
|
1503
|
-
}), m.querySelectorAll("td").forEach((
|
|
1504
|
-
const
|
|
1505
|
-
|
|
1688
|
+
const l = document.createElement("div");
|
|
1689
|
+
l.innerHTML = t;
|
|
1690
|
+
const c = (m) => {
|
|
1691
|
+
m.hasAttribute("data-has-resize-handle") || (m.style.borderCollapse = "collapse", m.style.width = "100%", m.style.border = "1px solid #ccc", m.style.margin = "8px 0", m.style.position = "relative", m.style.textAlign = "center", m.querySelectorAll("th").forEach((s) => {
|
|
1692
|
+
const f = s;
|
|
1693
|
+
f.style.border = "1px solid #999", f.style.padding = "4px", f.style.position = "relative", f.style.backgroundColor = "lightgray", f.style.height = "20px";
|
|
1694
|
+
}), m.querySelectorAll("td").forEach((s) => {
|
|
1695
|
+
const f = s;
|
|
1696
|
+
f.style.border = "1px solid #999", f.style.padding = "4px", f.style.position = "relative", f.style.backgroundColor = "#fff", f.style.height = "20px";
|
|
1506
1697
|
}));
|
|
1507
1698
|
};
|
|
1508
|
-
|
|
1509
|
-
const
|
|
1510
|
-
if (!
|
|
1511
|
-
const
|
|
1512
|
-
|
|
1513
|
-
const
|
|
1514
|
-
for (;
|
|
1515
|
-
|
|
1516
|
-
const E =
|
|
1699
|
+
l.querySelectorAll("table").forEach((m) => c(m));
|
|
1700
|
+
const o = window.getSelection();
|
|
1701
|
+
if (!o || !o.rangeCount) return;
|
|
1702
|
+
const i = o.getRangeAt(0);
|
|
1703
|
+
i.deleteContents();
|
|
1704
|
+
const p = document.createDocumentFragment();
|
|
1705
|
+
for (; l.firstChild; ) p.appendChild(l.firstChild);
|
|
1706
|
+
i.insertNode(p), i.collapse(!1), o.removeAllRanges(), o.addRange(i);
|
|
1707
|
+
const E = N.current;
|
|
1517
1708
|
E && (E.querySelectorAll("table").forEach((m) => {
|
|
1518
|
-
const
|
|
1519
|
-
|
|
1520
|
-
const
|
|
1521
|
-
|
|
1709
|
+
const s = m;
|
|
1710
|
+
s.hasAttribute("data-has-resize-handle") || (ge(s), s.querySelectorAll("th, td").forEach((f) => {
|
|
1711
|
+
const C = f;
|
|
1712
|
+
C.dataset.hasResizeHandles || te(C);
|
|
1522
1713
|
}));
|
|
1523
|
-
}),
|
|
1524
|
-
},
|
|
1525
|
-
|
|
1714
|
+
}), M());
|
|
1715
|
+
}, vt = (e) => {
|
|
1716
|
+
G();
|
|
1526
1717
|
const t = window.getSelection();
|
|
1527
1718
|
if (!t || !t.rangeCount) return;
|
|
1528
|
-
const n = t.getRangeAt(0),
|
|
1529
|
-
|
|
1530
|
-
const
|
|
1531
|
-
|
|
1532
|
-
},
|
|
1719
|
+
const n = t.getRangeAt(0), l = document.createElement("span");
|
|
1720
|
+
l.style.fontSize = `${e}px`, l.appendChild(n.extractContents()), n.insertNode(l);
|
|
1721
|
+
const c = document.createRange();
|
|
1722
|
+
c.setStartAfter(l), c.collapse(!0), t.removeAllRanges(), t.addRange(c), M();
|
|
1723
|
+
}, Et = () => {
|
|
1533
1724
|
const e = window.getSelection();
|
|
1534
1725
|
if (!e || !e.anchorNode) return null;
|
|
1535
1726
|
const t = e.anchorNode;
|
|
1536
|
-
if (
|
|
1537
|
-
const n = t.textContent || "",
|
|
1538
|
-
if (
|
|
1539
|
-
const
|
|
1540
|
-
if (
|
|
1541
|
-
const
|
|
1542
|
-
return
|
|
1543
|
-
range:
|
|
1544
|
-
query:
|
|
1727
|
+
if (he(t) || t.nodeType !== Node.TEXT_NODE) return null;
|
|
1728
|
+
const n = t.textContent || "", l = e.anchorOffset, c = n.lastIndexOf("@", l - 1);
|
|
1729
|
+
if (c === -1) return null;
|
|
1730
|
+
const o = n.substring(c + 1, l);
|
|
1731
|
+
if (o.includes(" ") || o.includes(" ")) return null;
|
|
1732
|
+
const i = document.createRange();
|
|
1733
|
+
return i.setStart(t, c), i.setEnd(t, l), {
|
|
1734
|
+
range: i,
|
|
1735
|
+
query: o
|
|
1545
1736
|
};
|
|
1546
|
-
},
|
|
1547
|
-
const e =
|
|
1737
|
+
}, Le = () => {
|
|
1738
|
+
const e = Et();
|
|
1548
1739
|
if (!e) return;
|
|
1549
1740
|
const {
|
|
1550
1741
|
range: t,
|
|
1551
1742
|
query: n
|
|
1552
|
-
} = e,
|
|
1553
|
-
|
|
1554
|
-
const
|
|
1555
|
-
|
|
1556
|
-
x:
|
|
1557
|
-
y:
|
|
1558
|
-
}),
|
|
1559
|
-
const
|
|
1560
|
-
|
|
1743
|
+
} = e, l = document.createElement("span");
|
|
1744
|
+
l.textContent = "", t.insertNode(l);
|
|
1745
|
+
const c = l.getBoundingClientRect();
|
|
1746
|
+
l.remove(), K({
|
|
1747
|
+
x: c.left,
|
|
1748
|
+
y: c.bottom + window.scrollY
|
|
1749
|
+
}), ee(n.toLowerCase());
|
|
1750
|
+
const o = a.filter((i) => i.name.toLowerCase().includes(n.toLowerCase()));
|
|
1751
|
+
x(o), O(!0), q.current = t.cloneRange();
|
|
1561
1752
|
};
|
|
1562
|
-
function
|
|
1563
|
-
const e =
|
|
1753
|
+
function wt() {
|
|
1754
|
+
const e = N.current;
|
|
1564
1755
|
if (!e) return;
|
|
1565
1756
|
const t = window.getSelection();
|
|
1566
1757
|
if (!t || t.rangeCount > 0 && e.contains(t.anchorNode))
|
|
1567
1758
|
return;
|
|
1568
1759
|
const n = document.createRange();
|
|
1569
|
-
n.selectNodeContents(e), n.collapse(!1), t.removeAllRanges(), t.addRange(n),
|
|
1760
|
+
n.selectNodeContents(e), n.collapse(!1), t.removeAllRanges(), t.addRange(n), D.current = n.cloneRange();
|
|
1570
1761
|
}
|
|
1571
|
-
const
|
|
1762
|
+
const yt = (e) => {
|
|
1572
1763
|
const t = e.target;
|
|
1573
|
-
if (!t || !(t.textContent || "").match(/{{([\s\S]+?)}}/) || !
|
|
1574
|
-
let
|
|
1575
|
-
if ((!
|
|
1576
|
-
const
|
|
1577
|
-
if (
|
|
1764
|
+
if (!t || !(t.textContent || "").match(/{{([\s\S]+?)}}/) || !N.current) return;
|
|
1765
|
+
let o = t.firstChild;
|
|
1766
|
+
if ((!o || o.nodeType !== Node.TEXT_NODE) && (o = t.childNodes[0]), !o || o.nodeType !== Node.TEXT_NODE) return;
|
|
1767
|
+
const i = o.textContent || "", p = i.indexOf("{{"), E = i.indexOf("}}");
|
|
1768
|
+
if (p === -1 || E === -1) return;
|
|
1578
1769
|
const m = window.getSelection();
|
|
1579
1770
|
if (!m) return;
|
|
1580
|
-
const
|
|
1581
|
-
|
|
1771
|
+
const s = document.createRange();
|
|
1772
|
+
s.setStart(o, p), s.setEnd(o, E + 2), m.removeAllRanges(), m.addRange(s);
|
|
1773
|
+
}, bt = (e) => {
|
|
1774
|
+
pe((t) => {
|
|
1775
|
+
const n = {};
|
|
1776
|
+
return e.forEach((l) => {
|
|
1777
|
+
var c;
|
|
1778
|
+
n[l.name] = (c = t[l.name]) != null ? c : "";
|
|
1779
|
+
}), n;
|
|
1780
|
+
});
|
|
1781
|
+
}, Ct = () => {
|
|
1782
|
+
let e = A;
|
|
1783
|
+
return Object.entries(fe).forEach(([t, n]) => {
|
|
1784
|
+
if (n.trim()) {
|
|
1785
|
+
const l = new RegExp(`{{\\s*${t}\\s*}}`, "g");
|
|
1786
|
+
e = e.replace(l, n);
|
|
1787
|
+
}
|
|
1788
|
+
}), e;
|
|
1582
1789
|
};
|
|
1583
|
-
return /* @__PURE__ */
|
|
1584
|
-
className: `rte-wrapper ${(
|
|
1585
|
-
style:
|
|
1586
|
-
}, /* @__PURE__ */
|
|
1790
|
+
return /* @__PURE__ */ r.createElement("div", {
|
|
1791
|
+
className: `rte-wrapper ${(v == null ? void 0 : v.wrapper) || ""}`,
|
|
1792
|
+
style: L.wrapper
|
|
1793
|
+
}, /* @__PURE__ */ r.createElement("div", {
|
|
1587
1794
|
style: {
|
|
1588
1795
|
flex: 1
|
|
1589
1796
|
}
|
|
1590
|
-
}, /* @__PURE__ */
|
|
1591
|
-
exec:
|
|
1592
|
-
saveSelection:
|
|
1593
|
-
handleFileChange:
|
|
1594
|
-
handleFontSizeChange: (e) =>
|
|
1595
|
-
handleFontFamilyChange: (e) =>
|
|
1596
|
-
insertEmoji:
|
|
1597
|
-
handleLink:
|
|
1598
|
-
removeFormatting:
|
|
1599
|
-
visibleActions:
|
|
1600
|
-
className:
|
|
1601
|
-
style:
|
|
1602
|
-
}), /* @__PURE__ */
|
|
1603
|
-
ref:
|
|
1797
|
+
}, /* @__PURE__ */ r.createElement(nn, {
|
|
1798
|
+
exec: me,
|
|
1799
|
+
saveSelection: Q,
|
|
1800
|
+
handleFileChange: rt,
|
|
1801
|
+
handleFontSizeChange: (e) => vt(e.target.value),
|
|
1802
|
+
handleFontFamilyChange: (e) => me("fontName", e.target.value),
|
|
1803
|
+
insertEmoji: at,
|
|
1804
|
+
handleLink: ct,
|
|
1805
|
+
removeFormatting: ut,
|
|
1806
|
+
visibleActions: le,
|
|
1807
|
+
className: v.toolbar,
|
|
1808
|
+
style: L.toolbar
|
|
1809
|
+
}), /* @__PURE__ */ r.createElement("div", {
|
|
1810
|
+
ref: N,
|
|
1604
1811
|
id: "rte-editor-body",
|
|
1605
|
-
className: `rte-editor ${(
|
|
1606
|
-
style:
|
|
1812
|
+
className: `rte-editor ${(v == null ? void 0 : v.editor) || ""}`,
|
|
1813
|
+
style: L.editor,
|
|
1607
1814
|
contentEditable: !0,
|
|
1608
1815
|
suppressContentEditableWarning: !0,
|
|
1609
|
-
onPaste:
|
|
1816
|
+
onPaste: pt,
|
|
1610
1817
|
onKeyUp: () => {
|
|
1611
|
-
|
|
1818
|
+
Q(), Le();
|
|
1612
1819
|
},
|
|
1613
|
-
onMouseUp:
|
|
1820
|
+
onMouseUp: Q,
|
|
1614
1821
|
onInput: () => {
|
|
1615
|
-
|
|
1822
|
+
ye(), Q();
|
|
1616
1823
|
},
|
|
1617
|
-
onKeyDown:
|
|
1618
|
-
onBeforeInput:
|
|
1619
|
-
onContextMenu:
|
|
1824
|
+
onKeyDown: tt,
|
|
1825
|
+
onBeforeInput: nt,
|
|
1826
|
+
onContextMenu: ot,
|
|
1620
1827
|
onClick: (e) => {
|
|
1621
|
-
|
|
1828
|
+
dt(e), Q(), Le();
|
|
1622
1829
|
},
|
|
1623
|
-
onDoubleClick:
|
|
1624
|
-
}), /* @__PURE__ */
|
|
1625
|
-
show:
|
|
1626
|
-
position:
|
|
1627
|
-
filtered:
|
|
1628
|
-
insertMention:
|
|
1629
|
-
onClose: () =>
|
|
1630
|
-
query:
|
|
1631
|
-
}),
|
|
1632
|
-
className: `rte-output ${(
|
|
1633
|
-
style:
|
|
1634
|
-
}, /* @__PURE__ */
|
|
1635
|
-
visible:
|
|
1636
|
-
x:
|
|
1637
|
-
y:
|
|
1638
|
-
onAction:
|
|
1830
|
+
onDoubleClick: yt
|
|
1831
|
+
}), /* @__PURE__ */ r.createElement(rn, {
|
|
1832
|
+
show: F,
|
|
1833
|
+
position: I,
|
|
1834
|
+
filtered: W,
|
|
1835
|
+
insertMention: Qe,
|
|
1836
|
+
onClose: () => O(!1),
|
|
1837
|
+
query: de
|
|
1838
|
+
}), d && /* @__PURE__ */ r.createElement("div", {
|
|
1839
|
+
className: `rte-output ${(v == null ? void 0 : v.output) || ""}`,
|
|
1840
|
+
style: L.output
|
|
1841
|
+
}, /* @__PURE__ */ r.createElement("h4", null, "Output HTML:"), /* @__PURE__ */ r.createElement("p", null, A)), /* @__PURE__ */ r.createElement(an, {
|
|
1842
|
+
visible: j.visible,
|
|
1843
|
+
x: j.x,
|
|
1844
|
+
y: j.y,
|
|
1845
|
+
onAction: it,
|
|
1639
1846
|
onClose: () => {
|
|
1640
|
-
|
|
1847
|
+
B(ae(re({}, j), {
|
|
1641
1848
|
visible: !1
|
|
1642
|
-
})),
|
|
1849
|
+
})), Ce();
|
|
1643
1850
|
}
|
|
1644
|
-
}), /* @__PURE__ */
|
|
1645
|
-
visible:
|
|
1646
|
-
linkData:
|
|
1647
|
-
onClose: () =>
|
|
1648
|
-
onInsert:
|
|
1649
|
-
})), u ? /* @__PURE__ */
|
|
1650
|
-
className:
|
|
1651
|
-
style:
|
|
1652
|
-
html:
|
|
1851
|
+
}), /* @__PURE__ */ r.createElement(on, {
|
|
1852
|
+
visible: Y,
|
|
1853
|
+
linkData: X,
|
|
1854
|
+
onClose: () => g(!1),
|
|
1855
|
+
onInsert: st
|
|
1856
|
+
})), u ? /* @__PURE__ */ r.createElement(ln, {
|
|
1857
|
+
className: v.preview,
|
|
1858
|
+
style: L.preview,
|
|
1859
|
+
html: Ct(),
|
|
1860
|
+
attributes: fe,
|
|
1861
|
+
setAttributes: pe
|
|
1653
1862
|
}) : null);
|
|
1654
1863
|
};
|
|
1655
1864
|
export {
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1865
|
+
un as RichTextEditor,
|
|
1866
|
+
ln as RtePreview,
|
|
1867
|
+
nn as RteToolbar
|
|
1659
1868
|
};
|