@ryzeup/richtexteditor 1.0.30 → 1.0.32
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 +864 -801
- package/dist/index.js +2 -2
- 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
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
}, ae = (
|
|
13
|
-
import * as
|
|
14
|
-
import r, { useRef as
|
|
15
|
-
import { createPortal as
|
|
16
|
-
window.React =
|
|
17
|
-
var
|
|
1
|
+
var Rt = Object.defineProperty, Nt = Object.defineProperties;
|
|
2
|
+
var Mt = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var je = Object.getOwnPropertySymbols;
|
|
4
|
+
var At = Object.prototype.hasOwnProperty, Tt = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Ie = (l, d, m) => d in l ? Rt(l, d, { enumerable: !0, configurable: !0, writable: !0, value: m }) : l[d] = m, re = (l, d) => {
|
|
6
|
+
for (var m in d || (d = {}))
|
|
7
|
+
At.call(d, m) && Ie(l, m, d[m]);
|
|
8
|
+
if (je)
|
|
9
|
+
for (var m of je(d))
|
|
10
|
+
Tt.call(d, m) && Ie(l, m, d[m]);
|
|
11
|
+
return l;
|
|
12
|
+
}, ae = (l, d) => Nt(l, Mt(d));
|
|
13
|
+
import * as kt from "react";
|
|
14
|
+
import r, { useRef as X, useState as H, useEffect as V } from "react";
|
|
15
|
+
import { createPortal as zt } from "react-dom";
|
|
16
|
+
window.React = kt;
|
|
17
|
+
var We = {
|
|
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
|
|
23
|
+
}, qe = r.createContext && /* @__PURE__ */ r.createContext(We), Dt = ["attr", "size", "title"];
|
|
24
|
+
function Ht(l, d) {
|
|
25
|
+
if (l == null) return {};
|
|
26
|
+
var m = Ot(l, d), g, v;
|
|
27
27
|
if (Object.getOwnPropertySymbols) {
|
|
28
|
-
var L = Object.getOwnPropertySymbols(
|
|
28
|
+
var L = Object.getOwnPropertySymbols(l);
|
|
29
29
|
for (v = 0; v < L.length; v++)
|
|
30
|
-
|
|
30
|
+
g = L[v], !(d.indexOf(g) >= 0) && Object.prototype.propertyIsEnumerable.call(l, g) && (m[g] = l[g]);
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return m;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
if (
|
|
36
|
-
var
|
|
37
|
-
for (var
|
|
38
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
39
|
-
if (d.indexOf(
|
|
40
|
-
|
|
34
|
+
function Ot(l, d) {
|
|
35
|
+
if (l == null) return {};
|
|
36
|
+
var m = {};
|
|
37
|
+
for (var g in l)
|
|
38
|
+
if (Object.prototype.hasOwnProperty.call(l, g)) {
|
|
39
|
+
if (d.indexOf(g) >= 0) continue;
|
|
40
|
+
m[g] = l[g];
|
|
41
41
|
}
|
|
42
|
-
return
|
|
42
|
+
return m;
|
|
43
43
|
}
|
|
44
44
|
function ce() {
|
|
45
|
-
return ce = Object.assign ? Object.assign.bind() : function(
|
|
45
|
+
return ce = Object.assign ? Object.assign.bind() : function(l) {
|
|
46
46
|
for (var d = 1; d < arguments.length; d++) {
|
|
47
|
-
var
|
|
48
|
-
for (var
|
|
49
|
-
Object.prototype.hasOwnProperty.call(
|
|
47
|
+
var m = arguments[d];
|
|
48
|
+
for (var g in m)
|
|
49
|
+
Object.prototype.hasOwnProperty.call(m, g) && (l[g] = m[g]);
|
|
50
50
|
}
|
|
51
|
-
return
|
|
51
|
+
return l;
|
|
52
52
|
}, ce.apply(this, arguments);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
var
|
|
54
|
+
function Be(l, d) {
|
|
55
|
+
var m = Object.keys(l);
|
|
56
56
|
if (Object.getOwnPropertySymbols) {
|
|
57
|
-
var
|
|
58
|
-
d && (
|
|
59
|
-
return Object.getOwnPropertyDescriptor(
|
|
60
|
-
})),
|
|
57
|
+
var g = Object.getOwnPropertySymbols(l);
|
|
58
|
+
d && (g = g.filter(function(v) {
|
|
59
|
+
return Object.getOwnPropertyDescriptor(l, v).enumerable;
|
|
60
|
+
})), m.push.apply(m, g);
|
|
61
61
|
}
|
|
62
|
-
return
|
|
62
|
+
return m;
|
|
63
63
|
}
|
|
64
|
-
function se(
|
|
64
|
+
function se(l) {
|
|
65
65
|
for (var d = 1; d < arguments.length; d++) {
|
|
66
|
-
var
|
|
67
|
-
d % 2 ?
|
|
68
|
-
|
|
69
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
70
|
-
Object.defineProperty(
|
|
66
|
+
var m = arguments[d] != null ? arguments[d] : {};
|
|
67
|
+
d % 2 ? Be(Object(m), !0).forEach(function(g) {
|
|
68
|
+
_t(l, g, m[g]);
|
|
69
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(l, Object.getOwnPropertyDescriptors(m)) : Be(Object(m)).forEach(function(g) {
|
|
70
|
+
Object.defineProperty(l, g, Object.getOwnPropertyDescriptor(m, g));
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
return
|
|
73
|
+
return l;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
return d =
|
|
75
|
+
function _t(l, d, m) {
|
|
76
|
+
return d = Pt(d), d in l ? Object.defineProperty(l, d, { value: m, enumerable: !0, configurable: !0, writable: !0 }) : l[d] = m, l;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
var d =
|
|
78
|
+
function Pt(l) {
|
|
79
|
+
var d = Ft(l, "string");
|
|
80
80
|
return typeof d == "symbol" ? d : d + "";
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
if (typeof
|
|
84
|
-
var
|
|
85
|
-
if (
|
|
86
|
-
var
|
|
87
|
-
if (typeof
|
|
82
|
+
function Ft(l, d) {
|
|
83
|
+
if (typeof l != "object" || !l) return l;
|
|
84
|
+
var m = l[Symbol.toPrimitive];
|
|
85
|
+
if (m !== void 0) {
|
|
86
|
+
var g = m.call(l, d);
|
|
87
|
+
if (typeof g != "object") return g;
|
|
88
88
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
89
89
|
}
|
|
90
|
-
return (d === "string" ? String : Number)(
|
|
90
|
+
return (d === "string" ? String : Number)(l);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
return
|
|
94
|
-
key:
|
|
95
|
-
}, d.attr),
|
|
92
|
+
function Ze(l) {
|
|
93
|
+
return l && l.map((d, m) => /* @__PURE__ */ r.createElement(d.tag, se({
|
|
94
|
+
key: m
|
|
95
|
+
}, d.attr), Ze(d.child)));
|
|
96
96
|
}
|
|
97
|
-
function k(
|
|
98
|
-
return (d) => /* @__PURE__ */ r.createElement(
|
|
99
|
-
attr: se({},
|
|
100
|
-
}, d),
|
|
97
|
+
function k(l) {
|
|
98
|
+
return (d) => /* @__PURE__ */ r.createElement(jt, ce({
|
|
99
|
+
attr: se({}, l.attr)
|
|
100
|
+
}, d), Ze(l.child));
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
var d = (
|
|
102
|
+
function jt(l) {
|
|
103
|
+
var d = (m) => {
|
|
104
104
|
var {
|
|
105
|
-
attr:
|
|
105
|
+
attr: g,
|
|
106
106
|
size: v,
|
|
107
107
|
title: L
|
|
108
|
-
} =
|
|
109
|
-
return
|
|
108
|
+
} = l, _ = Ht(l, Dt), z = v || m.size || "1em", E;
|
|
109
|
+
return m.className && (E = m.className), l.className && (E = (E ? E + " " : "") + l.className), /* @__PURE__ */ r.createElement("svg", ce({
|
|
110
110
|
stroke: "currentColor",
|
|
111
111
|
fill: "currentColor",
|
|
112
112
|
strokeWidth: "0"
|
|
113
|
-
},
|
|
114
|
-
className:
|
|
113
|
+
}, m.attr, g, _, {
|
|
114
|
+
className: E,
|
|
115
115
|
style: se(se({
|
|
116
|
-
color:
|
|
117
|
-
},
|
|
116
|
+
color: l.color || m.color
|
|
117
|
+
}, m.style), l.style),
|
|
118
118
|
height: z,
|
|
119
119
|
width: z,
|
|
120
120
|
xmlns: "http://www.w3.org/2000/svg"
|
|
121
|
-
}), L && /* @__PURE__ */ r.createElement("title", null, L),
|
|
121
|
+
}), L && /* @__PURE__ */ r.createElement("title", null, L), l.children);
|
|
122
122
|
};
|
|
123
|
-
return
|
|
123
|
+
return qe !== void 0 ? /* @__PURE__ */ r.createElement(qe.Consumer, null, (m) => d(m)) : d(We);
|
|
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 It(l) {
|
|
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: [] }] })(l);
|
|
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 qt(l) {
|
|
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: [] }] })(l);
|
|
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 Bt(l) {
|
|
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: [] }] })(l);
|
|
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 Vt(l) {
|
|
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: [] }] })(l);
|
|
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 Ut(l) {
|
|
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: [] }] })(l);
|
|
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 $t(l) {
|
|
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: [] }] })(l);
|
|
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 Wt(l) {
|
|
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: [] }] })(l);
|
|
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 Zt(l) {
|
|
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: [] }] })(l);
|
|
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 Xt(l) {
|
|
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: [] }] })(l);
|
|
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 Kt(l) {
|
|
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: [] }] })(l);
|
|
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 Yt(l) {
|
|
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: [] }] })(l);
|
|
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 Qt(l) {
|
|
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: [] }] })(l);
|
|
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 Gt(l) {
|
|
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: [] }] })(l);
|
|
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 Jt(l) {
|
|
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: [] }] })(l);
|
|
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 en(l) {
|
|
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: [] }] })(l);
|
|
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 tn(l) {
|
|
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: [] }] })(l);
|
|
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 nn(l) {
|
|
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: [] }] })(l);
|
|
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 rn(l) {
|
|
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: [] }] })(l);
|
|
178
178
|
}
|
|
179
|
-
const
|
|
179
|
+
const an = [
|
|
180
180
|
"😀",
|
|
181
181
|
"😁",
|
|
182
182
|
"😂",
|
|
@@ -288,37 +288,37 @@ const tn = [
|
|
|
288
288
|
"👏",
|
|
289
289
|
"🫶",
|
|
290
290
|
"👐"
|
|
291
|
-
],
|
|
292
|
-
exec:
|
|
291
|
+
], ln = ({
|
|
292
|
+
exec: l,
|
|
293
293
|
saveSelection: d,
|
|
294
|
-
handleFileChange:
|
|
295
|
-
handleFontSizeChange:
|
|
294
|
+
handleFileChange: m,
|
|
295
|
+
handleFontSizeChange: g,
|
|
296
296
|
handleFontFamilyChange: v,
|
|
297
297
|
// insertListBlock,
|
|
298
298
|
insertEmoji: L,
|
|
299
|
-
handleLink:
|
|
299
|
+
handleLink: _,
|
|
300
300
|
removeFormatting: z,
|
|
301
|
-
visibleActions:
|
|
302
|
-
className:
|
|
303
|
-
style:
|
|
301
|
+
visibleActions: E,
|
|
302
|
+
className: R,
|
|
303
|
+
style: N
|
|
304
304
|
}) => {
|
|
305
|
-
var
|
|
306
|
-
const
|
|
305
|
+
var B, Y;
|
|
306
|
+
const S = X(null), $ = X(null), b = X(null), [A, F] = H(!1), [j, O] = H({
|
|
307
307
|
x: 0,
|
|
308
308
|
y: 0
|
|
309
309
|
});
|
|
310
|
-
|
|
311
|
-
const
|
|
312
|
-
!
|
|
310
|
+
V(() => {
|
|
311
|
+
const f = (w) => {
|
|
312
|
+
!w.target.closest(".rte-emoji-popup") && !w.target.closest("button[title='Emoji']") && F(!1);
|
|
313
313
|
};
|
|
314
|
-
return document.addEventListener("mousedown",
|
|
314
|
+
return document.addEventListener("mousedown", f), () => document.removeEventListener("mousedown", f);
|
|
315
315
|
}, []);
|
|
316
|
-
const
|
|
317
|
-
var
|
|
318
|
-
|
|
319
|
-
const
|
|
320
|
-
if (
|
|
321
|
-
switch (
|
|
316
|
+
const I = (f) => {
|
|
317
|
+
var Z;
|
|
318
|
+
f.preventDefault();
|
|
319
|
+
const w = f.currentTarget.dataset.command;
|
|
320
|
+
if (w)
|
|
321
|
+
switch (w) {
|
|
322
322
|
case "bold":
|
|
323
323
|
case "italic":
|
|
324
324
|
case "underline":
|
|
@@ -327,19 +327,19 @@ const tn = [
|
|
|
327
327
|
case "insertOrderedList":
|
|
328
328
|
case "insertStaticOrderedList":
|
|
329
329
|
case "removeFormat":
|
|
330
|
-
|
|
330
|
+
l(w);
|
|
331
331
|
break;
|
|
332
332
|
case "insertImage": {
|
|
333
|
-
(
|
|
333
|
+
(Z = S.current) == null || Z.click();
|
|
334
334
|
break;
|
|
335
335
|
}
|
|
336
336
|
default:
|
|
337
|
-
console.warn("Unknown command:",
|
|
337
|
+
console.warn("Unknown command:", w);
|
|
338
338
|
}
|
|
339
|
-
}, K = (
|
|
340
|
-
|
|
341
|
-
}, W = (
|
|
342
|
-
|
|
339
|
+
}, K = (f) => {
|
|
340
|
+
l("foreColor", f.target.value);
|
|
341
|
+
}, W = (f) => {
|
|
342
|
+
l("backColor", f.target.value);
|
|
343
343
|
}, [x, D] = H({
|
|
344
344
|
bold: !1,
|
|
345
345
|
italic: !1,
|
|
@@ -356,23 +356,23 @@ const tn = [
|
|
|
356
356
|
table: !1,
|
|
357
357
|
color: !1,
|
|
358
358
|
highlight: !1
|
|
359
|
-
}),
|
|
360
|
-
return
|
|
361
|
-
const
|
|
362
|
-
const
|
|
363
|
-
if (!
|
|
364
|
-
let
|
|
365
|
-
if (!
|
|
366
|
-
const J = window.getComputedStyle(
|
|
367
|
-
if (
|
|
368
|
-
const ee = Array.from(
|
|
369
|
-
|
|
359
|
+
}), q = X(null), P = X(null);
|
|
360
|
+
return V(() => {
|
|
361
|
+
const f = () => {
|
|
362
|
+
const w = window.getSelection();
|
|
363
|
+
if (!w || !w.anchorNode) return;
|
|
364
|
+
let Z = w.anchorNode.nodeType === Node.ELEMENT_NODE ? w.anchorNode : w.anchorNode.parentElement;
|
|
365
|
+
if (!Z) return;
|
|
366
|
+
const J = window.getComputedStyle(Z), 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
370
|
}
|
|
371
|
-
|
|
371
|
+
P.current && (P.current.value = String(de));
|
|
372
372
|
};
|
|
373
|
-
return document.addEventListener("selectionchange",
|
|
374
|
-
}, []),
|
|
375
|
-
const
|
|
373
|
+
return document.addEventListener("selectionchange", f), () => document.removeEventListener("selectionchange", f);
|
|
374
|
+
}, []), V(() => {
|
|
375
|
+
const f = () => {
|
|
376
376
|
D({
|
|
377
377
|
bold: document.queryCommandState("bold"),
|
|
378
378
|
italic: document.queryCommandState("italic"),
|
|
@@ -391,130 +391,130 @@ const tn = [
|
|
|
391
391
|
highlight: document.queryCommandState("backColor")
|
|
392
392
|
});
|
|
393
393
|
};
|
|
394
|
-
return document.addEventListener("selectionchange",
|
|
394
|
+
return document.addEventListener("selectionchange", f), () => document.removeEventListener("selectionchange", f);
|
|
395
395
|
}, []), /* @__PURE__ */ r.createElement("div", {
|
|
396
|
-
className: `rte-toolbar ${
|
|
397
|
-
style:
|
|
398
|
-
},
|
|
396
|
+
className: `rte-toolbar ${R || ""}`,
|
|
397
|
+
style: N
|
|
398
|
+
}, E.bold && /* @__PURE__ */ r.createElement("button", {
|
|
399
399
|
"data-command": "bold",
|
|
400
400
|
title: "Bold",
|
|
401
|
-
onMouseDown:
|
|
401
|
+
onMouseDown: I,
|
|
402
402
|
className: x.bold ? "rte-active" : ""
|
|
403
|
-
}, /* @__PURE__ */ r.createElement(
|
|
403
|
+
}, /* @__PURE__ */ r.createElement($t, null)), E.italic && /* @__PURE__ */ r.createElement("button", {
|
|
404
404
|
"data-command": "italic",
|
|
405
405
|
title: "Italic",
|
|
406
|
-
onMouseDown:
|
|
406
|
+
onMouseDown: I,
|
|
407
407
|
className: x.italic ? "rte-active" : ""
|
|
408
|
-
}, /* @__PURE__ */ r.createElement(
|
|
408
|
+
}, /* @__PURE__ */ r.createElement(Zt, null)), E.underline && /* @__PURE__ */ r.createElement("button", {
|
|
409
409
|
"data-command": "underline",
|
|
410
410
|
title: "Underline",
|
|
411
|
-
onMouseDown:
|
|
411
|
+
onMouseDown: I,
|
|
412
412
|
className: x.underline ? "rte-active" : ""
|
|
413
|
-
}, /* @__PURE__ */ r.createElement(
|
|
413
|
+
}, /* @__PURE__ */ r.createElement(Qt, null)), E.unorderedList && /* @__PURE__ */ r.createElement("button", {
|
|
414
414
|
"data-command": "insertUnorderedList",
|
|
415
|
-
onMouseDown:
|
|
415
|
+
onMouseDown: I,
|
|
416
416
|
title: "UnorderedList",
|
|
417
417
|
className: x.unorderedList ? "rte-active" : ""
|
|
418
|
-
}, /* @__PURE__ */ r.createElement(
|
|
418
|
+
}, /* @__PURE__ */ r.createElement(Jt, null)), E.staticUnorderedList && /* @__PURE__ */ r.createElement("button", {
|
|
419
419
|
"data-command": "insertStaticUnorderedList",
|
|
420
|
-
onMouseDown:
|
|
420
|
+
onMouseDown: I,
|
|
421
421
|
title: "StaticUnorderedList",
|
|
422
422
|
className: x.unorderedList ? "rte-active" : ""
|
|
423
|
-
}, /* @__PURE__ */ r.createElement(
|
|
423
|
+
}, /* @__PURE__ */ r.createElement(Kt, null)), E.orderedList && /* @__PURE__ */ r.createElement("button", {
|
|
424
424
|
"data-command": "insertOrderedList",
|
|
425
425
|
title: "OrderedList",
|
|
426
|
-
onMouseDown:
|
|
426
|
+
onMouseDown: I,
|
|
427
427
|
className: x.orderedList ? "rte-active" : "",
|
|
428
428
|
style: {
|
|
429
429
|
fontSize: "medium"
|
|
430
430
|
}
|
|
431
|
-
}, /* @__PURE__ */ r.createElement(
|
|
431
|
+
}, /* @__PURE__ */ r.createElement(Gt, null)), E.staticOrderedList && /* @__PURE__ */ r.createElement("button", {
|
|
432
432
|
"data-command": "insertStaticOrderedList",
|
|
433
433
|
title: "StaticOrderedList",
|
|
434
|
-
onMouseDown:
|
|
434
|
+
onMouseDown: I,
|
|
435
435
|
className: x.orderedList ? "rte-active" : ""
|
|
436
|
-
}, /* @__PURE__ */ r.createElement(
|
|
436
|
+
}, /* @__PURE__ */ r.createElement(Vt, null)), E.link && /* @__PURE__ */ r.createElement("button", {
|
|
437
437
|
"data-command": "createLink",
|
|
438
438
|
title: "Link",
|
|
439
|
-
onClick:
|
|
439
|
+
onClick: _,
|
|
440
440
|
className: x.link ? "rte-active" : ""
|
|
441
|
-
}, /* @__PURE__ */ r.createElement(
|
|
441
|
+
}, /* @__PURE__ */ r.createElement(Xt, null)), E.removeFormat && /* @__PURE__ */ r.createElement("button", {
|
|
442
442
|
"data-command": "Remove format",
|
|
443
443
|
title: "removeFormat",
|
|
444
|
-
onMouseDown: (
|
|
445
|
-
|
|
444
|
+
onMouseDown: (f) => {
|
|
445
|
+
f.preventDefault(), d(), z();
|
|
446
446
|
},
|
|
447
447
|
className: x.removeFormat ? "rte-active" : ""
|
|
448
|
-
}, /* @__PURE__ */ r.createElement(
|
|
448
|
+
}, /* @__PURE__ */ r.createElement(rn, null)), E.image && /* @__PURE__ */ r.createElement("button", {
|
|
449
449
|
"data-command": "insertImage",
|
|
450
450
|
title: "Image",
|
|
451
|
-
onMouseDown:
|
|
451
|
+
onMouseDown: I,
|
|
452
452
|
className: x.image ? "rte-active" : ""
|
|
453
|
-
}, /* @__PURE__ */ r.createElement(
|
|
453
|
+
}, /* @__PURE__ */ r.createElement(Bt, null)), /* @__PURE__ */ r.createElement("input", {
|
|
454
454
|
type: "file",
|
|
455
455
|
accept: "image/*",
|
|
456
|
-
ref:
|
|
456
|
+
ref: S,
|
|
457
457
|
style: {
|
|
458
458
|
display: "none"
|
|
459
459
|
},
|
|
460
|
-
onChange:
|
|
461
|
-
}),
|
|
460
|
+
onChange: m
|
|
461
|
+
}), E.emoji && /* @__PURE__ */ r.createElement("div", {
|
|
462
462
|
style: {
|
|
463
463
|
position: "relative"
|
|
464
464
|
}
|
|
465
465
|
}, /* @__PURE__ */ r.createElement("button", {
|
|
466
466
|
title: "Emoji",
|
|
467
|
-
onMouseDown: (
|
|
468
|
-
|
|
469
|
-
const
|
|
467
|
+
onMouseDown: (f) => {
|
|
468
|
+
f.preventDefault(), d();
|
|
469
|
+
const w = f.currentTarget.getBoundingClientRect();
|
|
470
470
|
O({
|
|
471
|
-
x:
|
|
472
|
-
y:
|
|
471
|
+
x: w.left,
|
|
472
|
+
y: w.bottom + 8
|
|
473
473
|
// small spacing
|
|
474
|
-
}),
|
|
474
|
+
}), F((Z) => !Z);
|
|
475
475
|
},
|
|
476
476
|
className: x.emoji ? "rte-active" : ""
|
|
477
|
-
}, /* @__PURE__ */ r.createElement(
|
|
477
|
+
}, /* @__PURE__ */ r.createElement(Yt, null)), A && /* @__PURE__ */ zt(/* @__PURE__ */ r.createElement("div", {
|
|
478
478
|
className: "rte-emoji-popup",
|
|
479
479
|
style: {
|
|
480
|
-
top:
|
|
481
|
-
left:
|
|
480
|
+
top: j.y,
|
|
481
|
+
left: j.x
|
|
482
482
|
}
|
|
483
|
-
},
|
|
484
|
-
key:
|
|
483
|
+
}, an.map((f, w) => /* @__PURE__ */ r.createElement("span", {
|
|
484
|
+
key: w,
|
|
485
485
|
style: {
|
|
486
486
|
fontSize: "20px",
|
|
487
487
|
cursor: "pointer",
|
|
488
488
|
textAlign: "center"
|
|
489
489
|
},
|
|
490
|
-
onMouseDown: (
|
|
491
|
-
|
|
490
|
+
onMouseDown: (Z) => {
|
|
491
|
+
Z.preventDefault(), L(f), F(!1);
|
|
492
492
|
}
|
|
493
|
-
},
|
|
493
|
+
}, f))), document.body)), E.color && /* @__PURE__ */ r.createElement("div", {
|
|
494
494
|
style: {
|
|
495
495
|
position: "relative"
|
|
496
496
|
}
|
|
497
497
|
}, /* @__PURE__ */ r.createElement("button", {
|
|
498
498
|
title: "Text Color",
|
|
499
|
-
onMouseDown: (
|
|
500
|
-
var
|
|
501
|
-
|
|
499
|
+
onMouseDown: (f) => {
|
|
500
|
+
var w;
|
|
501
|
+
f.preventDefault(), d(), (w = $.current) == null || w.click();
|
|
502
502
|
},
|
|
503
503
|
style: {
|
|
504
504
|
display: "flex",
|
|
505
505
|
alignItems: "center",
|
|
506
506
|
justifyContent: "center",
|
|
507
|
-
color: ((
|
|
507
|
+
color: ((B = $.current) == null ? void 0 : B.value) || "#000",
|
|
508
508
|
fontSize: "18px"
|
|
509
509
|
},
|
|
510
510
|
className: x.color ? "rte-active" : ""
|
|
511
|
-
}, /* @__PURE__ */ r.createElement(
|
|
511
|
+
}, /* @__PURE__ */ r.createElement(nn, null)), /* @__PURE__ */ r.createElement("input", {
|
|
512
512
|
ref: $,
|
|
513
513
|
type: "color",
|
|
514
514
|
defaultValue: "#000000",
|
|
515
|
-
onChange: (
|
|
516
|
-
var
|
|
517
|
-
K(
|
|
515
|
+
onChange: (f) => {
|
|
516
|
+
var w;
|
|
517
|
+
K(f), ((w = f.target.parentElement) == null ? void 0 : w.querySelector("button")).style.color = f.target.value;
|
|
518
518
|
},
|
|
519
519
|
style: {
|
|
520
520
|
position: "absolute",
|
|
@@ -523,15 +523,15 @@ const tn = [
|
|
|
523
523
|
height: 0,
|
|
524
524
|
pointerEvents: "none"
|
|
525
525
|
}
|
|
526
|
-
})),
|
|
526
|
+
})), E.highlight && /* @__PURE__ */ r.createElement("div", {
|
|
527
527
|
style: {
|
|
528
528
|
position: "relative"
|
|
529
529
|
}
|
|
530
530
|
}, /* @__PURE__ */ r.createElement("button", {
|
|
531
531
|
title: "Highlight",
|
|
532
|
-
onMouseDown: (
|
|
533
|
-
var
|
|
534
|
-
|
|
532
|
+
onMouseDown: (f) => {
|
|
533
|
+
var w;
|
|
534
|
+
f.preventDefault(), d(), (w = b.current) == null || w.click();
|
|
535
535
|
},
|
|
536
536
|
style: {
|
|
537
537
|
display: "flex",
|
|
@@ -541,12 +541,12 @@ const tn = [
|
|
|
541
541
|
fontSize: "18px"
|
|
542
542
|
},
|
|
543
543
|
className: x.highlight ? "rte-active" : ""
|
|
544
|
-
}, /* @__PURE__ */ r.createElement(
|
|
544
|
+
}, /* @__PURE__ */ r.createElement(Wt, null)), /* @__PURE__ */ r.createElement("input", {
|
|
545
545
|
ref: b,
|
|
546
546
|
type: "color",
|
|
547
|
-
onChange: (
|
|
548
|
-
var
|
|
549
|
-
W(
|
|
547
|
+
onChange: (f) => {
|
|
548
|
+
var w;
|
|
549
|
+
W(f), ((w = f.target.parentElement) == null ? void 0 : w.querySelector("button")).style.color = f.target.value;
|
|
550
550
|
},
|
|
551
551
|
defaultValue: "#000000",
|
|
552
552
|
style: {
|
|
@@ -556,39 +556,39 @@ const tn = [
|
|
|
556
556
|
height: 0,
|
|
557
557
|
pointerEvents: "none"
|
|
558
558
|
}
|
|
559
|
-
})),
|
|
559
|
+
})), E.align && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("button", {
|
|
560
560
|
title: "Align Left",
|
|
561
|
-
onMouseDown: (
|
|
562
|
-
onClick: () =>
|
|
561
|
+
onMouseDown: (f) => f.preventDefault(),
|
|
562
|
+
onClick: () => l("justifyLeft"),
|
|
563
563
|
className: x.alignLeft ? "rte-active" : ""
|
|
564
|
-
}, /* @__PURE__ */ r.createElement(
|
|
564
|
+
}, /* @__PURE__ */ r.createElement(Ut, null)), /* @__PURE__ */ r.createElement("button", {
|
|
565
565
|
title: "Align Center",
|
|
566
|
-
onMouseDown: (
|
|
567
|
-
onClick: () =>
|
|
566
|
+
onMouseDown: (f) => f.preventDefault(),
|
|
567
|
+
onClick: () => l("justifyCenter"),
|
|
568
568
|
className: x.alignCenter ? "rte-active" : ""
|
|
569
|
-
}, /* @__PURE__ */ r.createElement(
|
|
569
|
+
}, /* @__PURE__ */ r.createElement(It, null)), /* @__PURE__ */ r.createElement("button", {
|
|
570
570
|
title: "Align Right",
|
|
571
|
-
onMouseDown: (
|
|
572
|
-
onClick: () =>
|
|
571
|
+
onMouseDown: (f) => f.preventDefault(),
|
|
572
|
+
onClick: () => l("justifyRight"),
|
|
573
573
|
className: x.alignRight ? "rte-active" : ""
|
|
574
|
-
}, /* @__PURE__ */ r.createElement(
|
|
574
|
+
}, /* @__PURE__ */ r.createElement(qt, null))), E.table && /* @__PURE__ */ r.createElement("button", {
|
|
575
575
|
title: "Insert Dynamic Table",
|
|
576
|
-
onMouseDown: (
|
|
577
|
-
onClick: () =>
|
|
576
|
+
onMouseDown: (f) => f.preventDefault(),
|
|
577
|
+
onClick: () => l("insertTable"),
|
|
578
578
|
className: x.table ? "rte-active" : "",
|
|
579
579
|
style: {
|
|
580
580
|
fontSize: "medium"
|
|
581
581
|
}
|
|
582
|
-
}, /* @__PURE__ */ r.createElement(
|
|
582
|
+
}, /* @__PURE__ */ r.createElement(en, null)), E.table && /* @__PURE__ */ r.createElement("button", {
|
|
583
583
|
title: "Insert Static Table",
|
|
584
|
-
onMouseDown: (
|
|
585
|
-
onClick: () =>
|
|
584
|
+
onMouseDown: (f) => f.preventDefault(),
|
|
585
|
+
onClick: () => l("insertStaticTable"),
|
|
586
586
|
className: x.table ? "rte-active" : "",
|
|
587
587
|
style: {
|
|
588
588
|
fontSize: "medium"
|
|
589
589
|
}
|
|
590
|
-
}, /* @__PURE__ */ r.createElement(
|
|
591
|
-
ref:
|
|
590
|
+
}, /* @__PURE__ */ r.createElement(tn, null)), E.fontFamily && /* @__PURE__ */ r.createElement("select", {
|
|
591
|
+
ref: q,
|
|
592
592
|
className: "rte-dropdown",
|
|
593
593
|
defaultValue: "",
|
|
594
594
|
onMouseDown: () => d(),
|
|
@@ -606,91 +606,91 @@ const tn = [
|
|
|
606
606
|
value: "Courier New"
|
|
607
607
|
}, "Courier New"), /* @__PURE__ */ r.createElement("option", {
|
|
608
608
|
value: "Verdana"
|
|
609
|
-
}, "Verdana")),
|
|
610
|
-
ref:
|
|
609
|
+
}, "Verdana")), E.fontSize && /* @__PURE__ */ r.createElement("select", {
|
|
610
|
+
ref: P,
|
|
611
611
|
className: "rte-dropdown rte-fontsize-dropdown",
|
|
612
612
|
defaultValue: "",
|
|
613
613
|
onMouseDown: () => d(),
|
|
614
|
-
onChange:
|
|
614
|
+
onChange: g
|
|
615
615
|
}, /* @__PURE__ */ r.createElement("option", {
|
|
616
616
|
value: "",
|
|
617
617
|
disabled: !0
|
|
618
618
|
}, "Font Size"), Array.from({
|
|
619
619
|
length: 16
|
|
620
|
-
}, (
|
|
621
|
-
key:
|
|
622
|
-
value:
|
|
623
|
-
},
|
|
624
|
-
},
|
|
625
|
-
show:
|
|
620
|
+
}, (f, w) => 10 + w).map((f) => /* @__PURE__ */ r.createElement("option", {
|
|
621
|
+
key: f,
|
|
622
|
+
value: f
|
|
623
|
+
}, f, "px"))));
|
|
624
|
+
}, on = ({
|
|
625
|
+
show: l,
|
|
626
626
|
position: d,
|
|
627
|
-
filtered:
|
|
628
|
-
insertMention:
|
|
627
|
+
filtered: m,
|
|
628
|
+
insertMention: g,
|
|
629
629
|
onClose: v,
|
|
630
630
|
query: L
|
|
631
631
|
}) => {
|
|
632
|
-
const
|
|
633
|
-
return
|
|
634
|
-
|
|
635
|
-
}, [
|
|
636
|
-
const
|
|
637
|
-
|
|
632
|
+
const _ = X(null), [z, E] = H(0);
|
|
633
|
+
return V(() => {
|
|
634
|
+
l && E(0);
|
|
635
|
+
}, [l]), V(() => {
|
|
636
|
+
const R = (N) => {
|
|
637
|
+
_.current && !_.current.contains(N.target) && v();
|
|
638
638
|
};
|
|
639
|
-
return
|
|
640
|
-
document.removeEventListener("mousedown",
|
|
639
|
+
return l && document.addEventListener("mousedown", R), () => {
|
|
640
|
+
document.removeEventListener("mousedown", R);
|
|
641
641
|
};
|
|
642
|
-
}, [
|
|
643
|
-
if (!
|
|
644
|
-
const
|
|
645
|
-
if (!(!
|
|
646
|
-
|
|
647
|
-
const
|
|
648
|
-
|
|
642
|
+
}, [l, v]), V(() => {
|
|
643
|
+
if (!l) return;
|
|
644
|
+
const R = (N) => {
|
|
645
|
+
if (!(!l || m.length === 0) && (N.key === "ArrowDown" && (N.preventDefault(), E((S) => Math.min(S + 1, m.length - 1))), N.key === "ArrowUp" && (N.preventDefault(), E((S) => Math.max(S - 1, 0))), N.key === "Enter")) {
|
|
646
|
+
N.preventDefault();
|
|
647
|
+
const S = m[z];
|
|
648
|
+
S && g(S);
|
|
649
649
|
}
|
|
650
650
|
};
|
|
651
|
-
return window.addEventListener("keydown",
|
|
652
|
-
}, [
|
|
653
|
-
if (!
|
|
654
|
-
const
|
|
655
|
-
|
|
651
|
+
return window.addEventListener("keydown", R), () => window.removeEventListener("keydown", R);
|
|
652
|
+
}, [l, m, z]), V(() => {
|
|
653
|
+
if (!_.current) return;
|
|
654
|
+
const N = _.current.querySelectorAll("li")[z];
|
|
655
|
+
N && N.scrollIntoView({
|
|
656
656
|
block: "nearest",
|
|
657
657
|
behavior: "smooth"
|
|
658
658
|
});
|
|
659
|
-
}, [z]),
|
|
660
|
-
ref:
|
|
659
|
+
}, [z]), l ? /* @__PURE__ */ r.createElement("ul", {
|
|
660
|
+
ref: _,
|
|
661
661
|
className: "rte-popup",
|
|
662
662
|
style: {
|
|
663
663
|
top: d.y,
|
|
664
664
|
left: d.x
|
|
665
665
|
}
|
|
666
|
-
},
|
|
667
|
-
name:
|
|
668
|
-
value:
|
|
669
|
-
},
|
|
670
|
-
const $ =
|
|
671
|
-
let
|
|
666
|
+
}, m.length > 0 ? m.map(({
|
|
667
|
+
name: R,
|
|
668
|
+
value: N
|
|
669
|
+
}, S) => {
|
|
670
|
+
const $ = R.toLowerCase(), b = L.toLowerCase(), A = $.indexOf(b);
|
|
671
|
+
let F = R;
|
|
672
672
|
if (A !== -1 && L.length > 0) {
|
|
673
|
-
const
|
|
674
|
-
|
|
673
|
+
const j = A + L.length;
|
|
674
|
+
F = R.substring(0, A) + `<span class="rte-highlight">${R.substring(A, j)}</span>` + R.substring(j);
|
|
675
675
|
}
|
|
676
676
|
return /* @__PURE__ */ r.createElement("li", {
|
|
677
|
-
key:
|
|
678
|
-
onMouseDown: (
|
|
679
|
-
|
|
680
|
-
name:
|
|
681
|
-
value:
|
|
677
|
+
key: N,
|
|
678
|
+
onMouseDown: (j) => {
|
|
679
|
+
j.preventDefault(), g({
|
|
680
|
+
name: R,
|
|
681
|
+
value: N
|
|
682
682
|
});
|
|
683
683
|
},
|
|
684
684
|
style: {
|
|
685
685
|
padding: "6px 12px",
|
|
686
686
|
cursor: "pointer",
|
|
687
687
|
fontSize: "14px",
|
|
688
|
-
background:
|
|
688
|
+
background: S === z ? "#dce8ff" : "white"
|
|
689
689
|
},
|
|
690
690
|
dangerouslySetInnerHTML: {
|
|
691
|
-
__html:
|
|
691
|
+
__html: F
|
|
692
692
|
},
|
|
693
|
-
onMouseEnter: () =>
|
|
693
|
+
onMouseEnter: () => E(S)
|
|
694
694
|
});
|
|
695
695
|
}) : /* @__PURE__ */ r.createElement("li", {
|
|
696
696
|
style: {
|
|
@@ -699,22 +699,22 @@ const tn = [
|
|
|
699
699
|
}
|
|
700
700
|
}, "No matches")) : null;
|
|
701
701
|
};
|
|
702
|
-
function
|
|
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: [] }] }] }] })(
|
|
702
|
+
function fe(l) {
|
|
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: [] }] }] }] })(l);
|
|
704
704
|
}
|
|
705
|
-
function ie(
|
|
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: [] }] }] }] })(
|
|
705
|
+
function ie(l) {
|
|
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: [] }] }] }] })(l);
|
|
707
707
|
}
|
|
708
|
-
const
|
|
709
|
-
visible:
|
|
708
|
+
const cn = ({
|
|
709
|
+
visible: l,
|
|
710
710
|
x: d,
|
|
711
|
-
y:
|
|
712
|
-
onAction:
|
|
711
|
+
y: m,
|
|
712
|
+
onAction: g,
|
|
713
713
|
onClose: v
|
|
714
714
|
}) => {
|
|
715
|
-
if (!
|
|
715
|
+
if (!l) return null;
|
|
716
716
|
const L = {
|
|
717
|
-
top:
|
|
717
|
+
top: m,
|
|
718
718
|
left: d
|
|
719
719
|
};
|
|
720
720
|
return /* @__PURE__ */ r.createElement("div", {
|
|
@@ -722,33 +722,35 @@ const an = ({
|
|
|
722
722
|
className: "rte-table-menu",
|
|
723
723
|
onMouseLeave: v
|
|
724
724
|
}, /* @__PURE__ */ r.createElement("button", {
|
|
725
|
-
onClick: () =>
|
|
725
|
+
onClick: () => g("insertRowAbove")
|
|
726
726
|
}, /* @__PURE__ */ r.createElement(ie, null), " Insert row above"), /* @__PURE__ */ r.createElement("button", {
|
|
727
|
-
onClick: () =>
|
|
727
|
+
onClick: () => g("insertRowBelow")
|
|
728
728
|
}, /* @__PURE__ */ r.createElement(ie, null), " Insert row below"), /* @__PURE__ */ r.createElement("button", {
|
|
729
|
-
onClick: () =>
|
|
729
|
+
onClick: () => g("insertColLeft")
|
|
730
730
|
}, /* @__PURE__ */ r.createElement(ie, null), " Insert col left"), /* @__PURE__ */ r.createElement("button", {
|
|
731
|
-
onClick: () =>
|
|
731
|
+
onClick: () => g("insertColRight")
|
|
732
732
|
}, /* @__PURE__ */ r.createElement(ie, null), " Insert col right"), /* @__PURE__ */ r.createElement("button", {
|
|
733
|
-
onClick: () =>
|
|
734
|
-
}, /* @__PURE__ */ r.createElement(
|
|
735
|
-
onClick: () =>
|
|
736
|
-
}, /* @__PURE__ */ r.createElement(
|
|
733
|
+
onClick: () => g("deleteRow")
|
|
734
|
+
}, /* @__PURE__ */ r.createElement(fe, null), " Delete row"), /* @__PURE__ */ r.createElement("button", {
|
|
735
|
+
onClick: () => g("deleteCol")
|
|
736
|
+
}, /* @__PURE__ */ r.createElement(fe, null), " Delete column"), /* @__PURE__ */ r.createElement("button", {
|
|
737
|
+
onClick: () => g("deleteTable")
|
|
738
|
+
}, /* @__PURE__ */ r.createElement(fe, null), " Delete table"));
|
|
737
739
|
};
|
|
738
|
-
function
|
|
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: [] }] })(
|
|
740
|
+
function Ve(l) {
|
|
741
|
+
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: [] }] })(l);
|
|
740
742
|
}
|
|
741
|
-
function
|
|
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: [] }] })(
|
|
743
|
+
function Ue(l) {
|
|
744
|
+
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: [] }] })(l);
|
|
743
745
|
}
|
|
744
|
-
const
|
|
745
|
-
html:
|
|
746
|
+
const sn = ({
|
|
747
|
+
html: l,
|
|
746
748
|
className: d,
|
|
747
|
-
style:
|
|
748
|
-
attributes:
|
|
749
|
+
style: m,
|
|
750
|
+
attributes: g,
|
|
749
751
|
setAttributes: v
|
|
750
752
|
}) => {
|
|
751
|
-
const [L,
|
|
753
|
+
const [L, _] = H("web"), z = {
|
|
752
754
|
web: {
|
|
753
755
|
label: "Web",
|
|
754
756
|
width: "100%",
|
|
@@ -809,24 +811,24 @@ const ln = ({
|
|
|
809
811
|
width: 480,
|
|
810
812
|
height: 1040
|
|
811
813
|
}
|
|
812
|
-
},
|
|
814
|
+
}, E = (b) => {
|
|
813
815
|
const A = b.target;
|
|
814
816
|
if (A.tagName === "A") {
|
|
815
817
|
b.preventDefault();
|
|
816
|
-
const
|
|
817
|
-
|
|
818
|
+
const F = A.href;
|
|
819
|
+
F && window.open(F, "_blank", "noopener,noreferrer");
|
|
818
820
|
}
|
|
819
|
-
},
|
|
821
|
+
}, R = (b) => b === "rgb(0, 0, 0)" || b === "rgba(0, 0, 0, 1)" || b === "#000" || b === "#000000" || b === "black", N = (b) => {
|
|
820
822
|
const A = document.createElement("div");
|
|
821
823
|
A.innerHTML = b;
|
|
822
|
-
const
|
|
823
|
-
for (;
|
|
824
|
-
const O =
|
|
825
|
-
O.nodeValue && /{{\s*[\s\S]*?\s*}}/.test(O.nodeValue) &&
|
|
824
|
+
const F = document.createTreeWalker(A, NodeFilter.SHOW_TEXT, null), j = [];
|
|
825
|
+
for (; F.nextNode(); ) {
|
|
826
|
+
const O = F.currentNode;
|
|
827
|
+
O.nodeValue && /{{\s*[\s\S]*?\s*}}/.test(O.nodeValue) && j.push(O);
|
|
826
828
|
}
|
|
827
|
-
return
|
|
828
|
-
var
|
|
829
|
-
const
|
|
829
|
+
return j.forEach((O) => {
|
|
830
|
+
var P;
|
|
831
|
+
const I = O.nodeValue || "", K = O.parentElement;
|
|
830
832
|
if (!K) return;
|
|
831
833
|
let W = K, x = !1;
|
|
832
834
|
for (; W; ) {
|
|
@@ -834,31 +836,31 @@ const ln = ({
|
|
|
834
836
|
x = !0;
|
|
835
837
|
break;
|
|
836
838
|
}
|
|
837
|
-
const
|
|
838
|
-
if (
|
|
839
|
+
const B = (P = W.style) == null ? void 0 : P.color;
|
|
840
|
+
if (B && !R(B)) {
|
|
839
841
|
x = !0;
|
|
840
842
|
break;
|
|
841
843
|
}
|
|
842
844
|
const Y = window.getComputedStyle(W);
|
|
843
|
-
if (Y.color && !
|
|
845
|
+
if (Y.color && !R(Y.color)) {
|
|
844
846
|
x = !0;
|
|
845
847
|
break;
|
|
846
848
|
}
|
|
847
849
|
W = W.parentElement;
|
|
848
850
|
}
|
|
849
851
|
const D = document.createDocumentFragment();
|
|
850
|
-
let
|
|
851
|
-
|
|
852
|
-
if (
|
|
853
|
-
D.appendChild(document.createTextNode(
|
|
852
|
+
let q = 0;
|
|
853
|
+
I.replace(/{{\s*([\s\S]*?)\s*}}/g, (B, Y, f) => {
|
|
854
|
+
if (f > q && D.appendChild(document.createTextNode(I.slice(q, f))), x)
|
|
855
|
+
D.appendChild(document.createTextNode(B));
|
|
854
856
|
else {
|
|
855
|
-
const
|
|
856
|
-
|
|
857
|
+
const w = document.createElement("span");
|
|
858
|
+
w.style.color = "blue", w.textContent = B, D.appendChild(w);
|
|
857
859
|
}
|
|
858
|
-
return
|
|
859
|
-
}),
|
|
860
|
+
return q = f + B.length, B;
|
|
861
|
+
}), q < I.length && D.appendChild(document.createTextNode(I.slice(q))), K.replaceChild(D, O);
|
|
860
862
|
}), A.innerHTML = A.innerHTML.replace(/{{#arrayData}}/g, "").replace(/{{\/arrayData}}/g, ""), A.innerHTML;
|
|
861
|
-
},
|
|
863
|
+
}, S = () => (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
|
|
862
864
|
month: "short",
|
|
863
865
|
day: "2-digit",
|
|
864
866
|
year: "numeric"
|
|
@@ -872,15 +874,15 @@ const ln = ({
|
|
|
872
874
|
});
|
|
873
875
|
return /* @__PURE__ */ r.createElement("div", {
|
|
874
876
|
className: `rte-preview ${d || ""}`,
|
|
875
|
-
style: ae(re({},
|
|
877
|
+
style: ae(re({}, m), {
|
|
876
878
|
position: "relative"
|
|
877
879
|
}),
|
|
878
|
-
onClick:
|
|
880
|
+
onClick: E
|
|
879
881
|
}, /* @__PURE__ */ r.createElement("div", {
|
|
880
882
|
className: "rte-preview-device-picker"
|
|
881
883
|
}, /* @__PURE__ */ r.createElement("select", {
|
|
882
884
|
value: L,
|
|
883
|
-
onChange: (b) =>
|
|
885
|
+
onChange: (b) => _(b.target.value)
|
|
884
886
|
}, Object.entries(z).map(([b, A]) => /* @__PURE__ */ r.createElement("option", {
|
|
885
887
|
key: b,
|
|
886
888
|
value: b
|
|
@@ -891,7 +893,7 @@ const ln = ({
|
|
|
891
893
|
}, /* @__PURE__ */ r.createElement("div", {
|
|
892
894
|
className: "rte-preview-content",
|
|
893
895
|
dangerouslySetInnerHTML: {
|
|
894
|
-
__html:
|
|
896
|
+
__html: N(l)
|
|
895
897
|
}
|
|
896
898
|
}), /* @__PURE__ */ r.createElement("div", {
|
|
897
899
|
className: "rte-preview-meta"
|
|
@@ -899,9 +901,9 @@ const ln = ({
|
|
|
899
901
|
className: "rte-preview-footer"
|
|
900
902
|
}, /* @__PURE__ */ r.createElement("div", {
|
|
901
903
|
className: "rte-preview-actions"
|
|
902
|
-
}, /* @__PURE__ */ r.createElement(
|
|
904
|
+
}, /* @__PURE__ */ r.createElement(Ue, {
|
|
903
905
|
className: "rte-preview-like"
|
|
904
|
-
}), /* @__PURE__ */ r.createElement(
|
|
906
|
+
}), /* @__PURE__ */ r.createElement(Ve, {
|
|
905
907
|
className: "rte-preview-like"
|
|
906
908
|
})), /* @__PURE__ */ r.createElement("div", {
|
|
907
909
|
className: "rte-preview-time"
|
|
@@ -936,17 +938,17 @@ const ln = ({
|
|
|
936
938
|
}, /* @__PURE__ */ r.createElement("div", {
|
|
937
939
|
className: "rte-preview-content",
|
|
938
940
|
dangerouslySetInnerHTML: {
|
|
939
|
-
__html:
|
|
941
|
+
__html: N(l)
|
|
940
942
|
}
|
|
941
943
|
}), /* @__PURE__ */ r.createElement("div", {
|
|
942
944
|
className: "rte-preview-meta"
|
|
943
|
-
}, "Data updated as on ",
|
|
945
|
+
}, "Data updated as on ", S()), /* @__PURE__ */ r.createElement("div", {
|
|
944
946
|
className: "rte-preview-footer"
|
|
945
947
|
}, /* @__PURE__ */ r.createElement("div", {
|
|
946
948
|
className: "rte-preview-actions"
|
|
947
|
-
}, /* @__PURE__ */ r.createElement(
|
|
949
|
+
}, /* @__PURE__ */ r.createElement(Ue, {
|
|
948
950
|
className: "rte-preview-like"
|
|
949
|
-
}), /* @__PURE__ */ r.createElement(
|
|
951
|
+
}), /* @__PURE__ */ r.createElement(Ve, {
|
|
950
952
|
className: "rte-preview-like"
|
|
951
953
|
})), /* @__PURE__ */ r.createElement("div", {
|
|
952
954
|
className: "rte-preview-time"
|
|
@@ -956,40 +958,43 @@ const ln = ({
|
|
|
956
958
|
}
|
|
957
959
|
}, "Enter Attribute Values"), /* @__PURE__ */ r.createElement("div", {
|
|
958
960
|
className: "rte-attr-list"
|
|
959
|
-
}, Object.keys(
|
|
961
|
+
}, Object.keys(g).map((b) => /* @__PURE__ */ r.createElement("div", {
|
|
960
962
|
key: b,
|
|
961
963
|
className: "rte-attr-row"
|
|
962
964
|
}, /* @__PURE__ */ r.createElement("div", {
|
|
963
965
|
className: "rte-attr-name"
|
|
964
966
|
}, `{{${b}}}`), /* @__PURE__ */ r.createElement("span", null, " : "), /* @__PURE__ */ r.createElement("input", {
|
|
965
967
|
className: "rte-attr-input",
|
|
966
|
-
value:
|
|
967
|
-
onChange: (A) =>
|
|
968
|
-
|
|
969
|
-
|
|
968
|
+
value: g[b] || "",
|
|
969
|
+
onChange: (A) => {
|
|
970
|
+
const F = A.target.value;
|
|
971
|
+
v((j) => ae(re({}, j), {
|
|
972
|
+
[b]: F
|
|
973
|
+
}));
|
|
974
|
+
},
|
|
970
975
|
placeholder: "Enter value"
|
|
971
976
|
}))))));
|
|
972
|
-
},
|
|
973
|
-
visible:
|
|
977
|
+
}, dn = ({
|
|
978
|
+
visible: l,
|
|
974
979
|
linkData: d,
|
|
975
|
-
onClose:
|
|
976
|
-
onInsert:
|
|
980
|
+
onClose: m,
|
|
981
|
+
onInsert: g
|
|
977
982
|
}) => {
|
|
978
|
-
const [v, L] = H(""), [
|
|
979
|
-
if (
|
|
980
|
-
|
|
981
|
-
}, [
|
|
983
|
+
const [v, L] = H(""), [_, z] = H(""), [E, R] = H(""), [N, S] = H("_self");
|
|
984
|
+
if (V(() => {
|
|
985
|
+
l ? (L(d.url || ""), z(d.text || ""), R(d.title || ""), S(d.target || "_self")) : (L(""), z(""), R(""), S("_self"));
|
|
986
|
+
}, [l, d]), !l) return null;
|
|
982
987
|
const $ = () => {
|
|
983
|
-
|
|
988
|
+
g({
|
|
984
989
|
url: v,
|
|
985
|
-
text:
|
|
986
|
-
title:
|
|
987
|
-
target:
|
|
990
|
+
text: _,
|
|
991
|
+
title: E,
|
|
992
|
+
target: N
|
|
988
993
|
});
|
|
989
994
|
};
|
|
990
995
|
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("div", {
|
|
991
996
|
className: "rte-link-modal-overlay",
|
|
992
|
-
onClick:
|
|
997
|
+
onClick: m
|
|
993
998
|
}), /* @__PURE__ */ r.createElement("div", {
|
|
994
999
|
className: "rte-link-modal"
|
|
995
1000
|
}, /* @__PURE__ */ r.createElement("h4", {
|
|
@@ -1004,18 +1009,18 @@ const ln = ({
|
|
|
1004
1009
|
type: "text",
|
|
1005
1010
|
className: "rte-link-modal__input",
|
|
1006
1011
|
placeholder: "Text to Display",
|
|
1007
|
-
value:
|
|
1012
|
+
value: _,
|
|
1008
1013
|
onChange: (b) => z(b.target.value)
|
|
1009
1014
|
}), /* @__PURE__ */ r.createElement("input", {
|
|
1010
1015
|
type: "text",
|
|
1011
1016
|
className: "rte-link-modal__input",
|
|
1012
1017
|
placeholder: "Title",
|
|
1013
|
-
value:
|
|
1014
|
-
onChange: (b) =>
|
|
1018
|
+
value: E,
|
|
1019
|
+
onChange: (b) => R(b.target.value)
|
|
1015
1020
|
}), /* @__PURE__ */ r.createElement("select", {
|
|
1016
1021
|
className: "rte-link-modal__select",
|
|
1017
|
-
value:
|
|
1018
|
-
onChange: (b) =>
|
|
1022
|
+
value: N,
|
|
1023
|
+
onChange: (b) => S(b.target.value)
|
|
1019
1024
|
}, /* @__PURE__ */ r.createElement("option", {
|
|
1020
1025
|
value: "_self"
|
|
1021
1026
|
}, "Same tab"), /* @__PURE__ */ r.createElement("option", {
|
|
@@ -1024,26 +1029,26 @@ const ln = ({
|
|
|
1024
1029
|
className: "rte-link-modal__actions"
|
|
1025
1030
|
}, /* @__PURE__ */ r.createElement("button", {
|
|
1026
1031
|
className: "rte-link-modal__btn",
|
|
1027
|
-
onClick:
|
|
1032
|
+
onClick: m
|
|
1028
1033
|
}, "Cancel"), /* @__PURE__ */ r.createElement("button", {
|
|
1029
1034
|
className: "rte-link-modal__btn rte-link-modal__btn--ok",
|
|
1030
1035
|
onClick: $
|
|
1031
1036
|
}, "OK"))));
|
|
1032
1037
|
};
|
|
1033
|
-
function
|
|
1038
|
+
function $e(l) {
|
|
1034
1039
|
const d = /* @__PURE__ */ new Map();
|
|
1035
|
-
return
|
|
1036
|
-
d.set(
|
|
1037
|
-
}), Array.from(d.entries()).map(([
|
|
1038
|
-
name:
|
|
1039
|
-
value:
|
|
1040
|
+
return l.forEach((m) => {
|
|
1041
|
+
d.set(m.name, m.value);
|
|
1042
|
+
}), Array.from(d.entries()).map(([m, g]) => ({
|
|
1043
|
+
name: m,
|
|
1044
|
+
value: g
|
|
1040
1045
|
}));
|
|
1041
1046
|
}
|
|
1042
|
-
const
|
|
1043
|
-
atSuggestions:
|
|
1047
|
+
const gn = ({
|
|
1048
|
+
atSuggestions: l = [],
|
|
1044
1049
|
showOutput: d = !1,
|
|
1045
|
-
showPreview:
|
|
1046
|
-
toolbarConfig:
|
|
1050
|
+
showPreview: m = !1,
|
|
1051
|
+
toolbarConfig: g = {
|
|
1047
1052
|
link: !1,
|
|
1048
1053
|
image: !1,
|
|
1049
1054
|
emoji: !1,
|
|
@@ -1059,25 +1064,25 @@ const un = ({
|
|
|
1059
1064
|
},
|
|
1060
1065
|
classNames: v = {},
|
|
1061
1066
|
styles: L = {},
|
|
1062
|
-
handleGetHtml:
|
|
1067
|
+
handleGetHtml: _ = () => {
|
|
1063
1068
|
},
|
|
1064
1069
|
onChange: z = () => {
|
|
1065
1070
|
},
|
|
1066
|
-
value:
|
|
1067
|
-
onMentionSelect:
|
|
1071
|
+
value: E,
|
|
1072
|
+
onMentionSelect: R = () => {
|
|
1068
1073
|
},
|
|
1069
|
-
handleAddAttributes:
|
|
1074
|
+
handleAddAttributes: N = () => {
|
|
1070
1075
|
}
|
|
1071
1076
|
}) => {
|
|
1072
|
-
var
|
|
1073
|
-
const
|
|
1077
|
+
var Ne, Me, Ae, Te, ke, ze, De, He, Oe, _e, Pe, Fe;
|
|
1078
|
+
const S = X(null), [$, b] = H(E != null && E.length ? E : " "), [A, F] = H(""), [j, O] = H(!1), [I, K] = H({
|
|
1074
1079
|
x: 0,
|
|
1075
1080
|
y: 0
|
|
1076
|
-
}), [W, x] = H([]), D =
|
|
1081
|
+
}), [W, x] = H([]), D = X(null), q = X(null), [P, B] = H({
|
|
1077
1082
|
visible: !1,
|
|
1078
1083
|
x: 0,
|
|
1079
1084
|
y: 0
|
|
1080
|
-
}), [Y,
|
|
1085
|
+
}), [Y, f] = H(!1), w = X(null), [Z, J] = H({
|
|
1081
1086
|
url: "",
|
|
1082
1087
|
text: "",
|
|
1083
1088
|
title: "",
|
|
@@ -1087,41 +1092,41 @@ const un = ({
|
|
|
1087
1092
|
italic: !0,
|
|
1088
1093
|
underline: !0,
|
|
1089
1094
|
removeFormat: !0,
|
|
1090
|
-
unorderedList: (
|
|
1091
|
-
orderedList: (
|
|
1092
|
-
staticUnorderedList: (
|
|
1093
|
-
staticOrderedList: (
|
|
1095
|
+
unorderedList: (Ne = g.unorderedList) != null ? Ne : !0,
|
|
1096
|
+
orderedList: (Me = g.orderedList) != null ? Me : !0,
|
|
1097
|
+
staticUnorderedList: (Ae = g.staticUnorderedList) != null ? Ae : !0,
|
|
1098
|
+
staticOrderedList: (Te = g.staticOrderedList) != null ? Te : !0,
|
|
1094
1099
|
align: !0,
|
|
1095
|
-
link: (
|
|
1096
|
-
image: (
|
|
1097
|
-
emoji: (
|
|
1098
|
-
table: (
|
|
1099
|
-
color: (
|
|
1100
|
-
fontFamily: (
|
|
1101
|
-
fontSize: (
|
|
1102
|
-
highlight: (
|
|
1103
|
-
}, [de, ee] = H(""), [oe, ue] = H([]), [
|
|
1104
|
-
const e =
|
|
1100
|
+
link: (ke = g.link) != null ? ke : !1,
|
|
1101
|
+
image: (ze = g.image) != null ? ze : !1,
|
|
1102
|
+
emoji: (De = g.emoji) != null ? De : !1,
|
|
1103
|
+
table: (He = g.table) != null ? He : !1,
|
|
1104
|
+
color: (Oe = g.color) != null ? Oe : !1,
|
|
1105
|
+
fontFamily: (_e = g.fontFamily) != null ? _e : !1,
|
|
1106
|
+
fontSize: (Pe = g.fontSize) != null ? Pe : !1,
|
|
1107
|
+
highlight: (Fe = g.fontSize) != null ? Fe : !1
|
|
1108
|
+
}, [de, ee] = H(""), [oe, ue] = H([]), [pe, ve] = H({}), U = () => S.current, M = () => {
|
|
1109
|
+
const e = Xe(), t = /^<div[^>]*style=["'][^"']*font-size\s*:\s*\d+px[^"']*["'][^>]*>/.test(e.trim());
|
|
1105
1110
|
let n = e;
|
|
1106
|
-
t || (n = `<div style="font-size:12px">${e}</div>`), n = n.replace(/<(ul|ol)([^>]*)>[\s\S]*?<\/\1>/g, (
|
|
1107
|
-
if (/list-type=["']static["']/.test(
|
|
1108
|
-
const
|
|
1109
|
-
return `${
|
|
1110
|
-
}),
|
|
1111
|
-
const
|
|
1112
|
-
z(
|
|
1113
|
-
const
|
|
1114
|
-
JSON.stringify(
|
|
1115
|
-
},
|
|
1116
|
-
const e =
|
|
1111
|
+
t || (n = `<div style="font-size: 12px;">${e}</div>`), n = n.replace(/<(ul|ol)([^>]*)>[\s\S]*?<\/\1>/g, (o, y, h) => {
|
|
1112
|
+
if (/list-type=["']static["']/.test(h) || o.includes("data-hidden-array-start") || o.includes("data-hidden-array-end")) return o;
|
|
1113
|
+
const u = `<${y}${h}>`, c = '<span data-hidden-array-start="true" style="display:none">{{#arrayData}}</span>', p = '<span data-hidden-array-end="true" style="display:none">{{/arrayData}}</span>', C = `</${y}>`, T = o.replace(new RegExp(`^${u}`), "").replace(new RegExp(`${C}$`), "");
|
|
1114
|
+
return `${u}${c}${T}${p}${C}`;
|
|
1115
|
+
}), F(n), _ == null || _(n);
|
|
1116
|
+
const a = gt(e);
|
|
1117
|
+
z(a);
|
|
1118
|
+
const s = nt(), i = $e(s);
|
|
1119
|
+
JSON.stringify(i) !== JSON.stringify(oe) && (ue(i), R(i), Ct(i));
|
|
1120
|
+
}, Xe = () => {
|
|
1121
|
+
const e = U();
|
|
1117
1122
|
if (!e) return $;
|
|
1118
1123
|
const t = e.cloneNode(!0);
|
|
1119
|
-
t.querySelectorAll("table div").forEach((
|
|
1120
|
-
|
|
1121
|
-
}), t.querySelectorAll(".rte-cell-highlight").forEach((
|
|
1124
|
+
t.querySelectorAll("table div").forEach((a) => a.remove()), t.querySelectorAll("table").forEach((a) => {
|
|
1125
|
+
a.removeAttribute("data-has-resize-handle");
|
|
1126
|
+
}), t.querySelectorAll(".rte-table-selected , .rte-cell-highlight").forEach((a) => a.classList.remove(".rte-table-selected , .rte-cell-highlight"));
|
|
1122
1127
|
let n = t.innerHTML;
|
|
1123
|
-
return n =
|
|
1124
|
-
},
|
|
1128
|
+
return n = Ke(n), n;
|
|
1129
|
+
}, Ke = (e) => {
|
|
1125
1130
|
const t = document.createElement("div");
|
|
1126
1131
|
return t.innerHTML = e, t.querySelectorAll("tbody").forEach((n) => {
|
|
1127
1132
|
n.getAttribute("table-type") === "static" || (n.innerHTML = `{{#arrayData}}${n.innerHTML}{{/arrayData}}`);
|
|
@@ -1136,187 +1141,211 @@ const un = ({
|
|
|
1136
1141
|
}, G = () => {
|
|
1137
1142
|
const e = window.getSelection();
|
|
1138
1143
|
!e || !D.current || (e.removeAllRanges(), e.addRange(D.current));
|
|
1139
|
-
},
|
|
1144
|
+
}, Ee = (e, t) => {
|
|
1140
1145
|
const n = window.getSelection();
|
|
1141
1146
|
n && n.rangeCount > 0 && (D.current = n.getRangeAt(0)), G(), document.execCommand(e, !1, t), M();
|
|
1142
1147
|
};
|
|
1143
|
-
|
|
1144
|
-
const e =
|
|
1145
|
-
if (!e || !
|
|
1146
|
-
const t =
|
|
1148
|
+
V(() => {
|
|
1149
|
+
const e = U();
|
|
1150
|
+
if (!e || !E) return;
|
|
1151
|
+
const t = Ye(E);
|
|
1147
1152
|
e.innerHTML = t, M();
|
|
1148
1153
|
}, []);
|
|
1149
|
-
const
|
|
1150
|
-
|
|
1154
|
+
const Ye = (e) => e.replace(/(<table[\s\S]*?>[\s\S]*?<\/table>)/g, (t) => t.replace(/{{#arrayData}}/g, "").replace(/{{\/arrayData}}/g, ""));
|
|
1155
|
+
V(() => () => {
|
|
1151
1156
|
document.removeEventListener("mousemove", null), document.removeEventListener("mouseup", null);
|
|
1152
|
-
}, []),
|
|
1153
|
-
|
|
1154
|
-
|
|
1157
|
+
}, []), V(() => {
|
|
1158
|
+
N && N((e) => {
|
|
1159
|
+
tt(e);
|
|
1155
1160
|
});
|
|
1156
|
-
}, []),
|
|
1157
|
-
const e =
|
|
1161
|
+
}, []), V(() => {
|
|
1162
|
+
const e = U();
|
|
1158
1163
|
if (!e) return;
|
|
1159
1164
|
e.querySelectorAll("table").forEach((n) => {
|
|
1160
|
-
n.hasAttribute("data-has-resize-handle") || (ge(n), n.querySelectorAll("th, td").forEach((
|
|
1165
|
+
n.hasAttribute("data-has-resize-handle") || (ge(n), n.querySelectorAll("th, td").forEach((s) => te(s)));
|
|
1161
1166
|
});
|
|
1167
|
+
}, []), V(() => {
|
|
1168
|
+
const e = () => {
|
|
1169
|
+
requestAnimationFrame(() => {
|
|
1170
|
+
St();
|
|
1171
|
+
});
|
|
1172
|
+
};
|
|
1173
|
+
return document.addEventListener("selectionchange", e), () => {
|
|
1174
|
+
document.removeEventListener("selectionchange", e);
|
|
1175
|
+
};
|
|
1176
|
+
}, []), V(() => {
|
|
1177
|
+
const e = S.current;
|
|
1178
|
+
if (!e) return;
|
|
1179
|
+
const t = () => {
|
|
1180
|
+
e.querySelectorAll("table.rte-table-selected").forEach((a) => {
|
|
1181
|
+
a.dataset.__rteSelected = "true", a.classList.remove("rte-table-selected");
|
|
1182
|
+
});
|
|
1183
|
+
}, n = () => {
|
|
1184
|
+
e.querySelectorAll("table[data-__rte-selected]").forEach((a) => {
|
|
1185
|
+
a.classList.add("rte-table-selected"), a.removeAttribute("data-__rte-selected");
|
|
1186
|
+
});
|
|
1187
|
+
};
|
|
1188
|
+
return e.addEventListener("copy", t), document.addEventListener("mouseup", n), () => {
|
|
1189
|
+
e.removeEventListener("copy", t), document.removeEventListener("mouseup", n);
|
|
1190
|
+
};
|
|
1162
1191
|
}, []);
|
|
1163
|
-
const
|
|
1192
|
+
const we = (e) => {
|
|
1164
1193
|
for (; e && e.nodeName !== "LI"; )
|
|
1165
1194
|
e = e.parentNode;
|
|
1166
1195
|
return e;
|
|
1167
|
-
},
|
|
1168
|
-
var
|
|
1196
|
+
}, ye = (e, t) => {
|
|
1197
|
+
var u;
|
|
1169
1198
|
const n = window.getSelection();
|
|
1170
1199
|
if (!(n != null && n.rangeCount)) return;
|
|
1171
|
-
const
|
|
1172
|
-
let
|
|
1173
|
-
const
|
|
1174
|
-
if (
|
|
1175
|
-
let
|
|
1176
|
-
|
|
1200
|
+
const a = n.getRangeAt(0), s = we(a.startContainer);
|
|
1201
|
+
let i, o;
|
|
1202
|
+
const y = t === "insertStaticUnorderedList" || t === "insertStaticOrderedList";
|
|
1203
|
+
if (s) {
|
|
1204
|
+
let c = s.querySelector(e);
|
|
1205
|
+
c || (c = document.createElement(e), c.style.margin = "0", c.style.paddingLeft = "20px", s.appendChild(c)), o = c, i = document.createElement("li"), i.textContent = "", o.appendChild(i);
|
|
1177
1206
|
} else {
|
|
1178
1207
|
document.execCommand(e === "ul" ? "insertUnorderedList" : "insertOrderedList");
|
|
1179
|
-
const
|
|
1180
|
-
if (
|
|
1181
|
-
|
|
1208
|
+
const c = U();
|
|
1209
|
+
if (o = c == null ? void 0 : c.querySelector(`${e}:last-child`), !o) return;
|
|
1210
|
+
y && o.setAttribute("list-type", "static"), i = o.querySelector("li:last-child");
|
|
1182
1211
|
}
|
|
1183
|
-
const
|
|
1184
|
-
|
|
1212
|
+
const h = document.createRange();
|
|
1213
|
+
h.setStart(i, 0), h.collapse(!0), n.removeAllRanges(), n.addRange(h), (u = U()) == null || u.focus(), M();
|
|
1185
1214
|
}, me = (e, t) => {
|
|
1186
|
-
e === "insertOrderedList" || e === "insertStaticOrderedList" ?
|
|
1187
|
-
},
|
|
1215
|
+
e === "insertOrderedList" || e === "insertStaticOrderedList" ? ye("ol", e) : e === "insertUnorderedList" || e === "insertStaticUnorderedList" ? ye("ul", e) : e.startsWith("justify") ? ft(e) : Ee(e, t), e === "insertTable" && Ce(), e === "insertStaticTable" && Ce("insertStaticTable");
|
|
1216
|
+
}, Qe = (e) => {
|
|
1188
1217
|
const t = document.createElement("span");
|
|
1189
1218
|
t.textContent = "", e.insertNode(t), e.setStartAfter(t), e.collapse(!0);
|
|
1190
1219
|
const n = t.getBoundingClientRect();
|
|
1191
1220
|
t.remove(), K({
|
|
1192
1221
|
x: n.left,
|
|
1193
1222
|
y: n.bottom + window.scrollY
|
|
1194
|
-
}), x(
|
|
1195
|
-
},
|
|
1223
|
+
}), x(l || []), O(!0), q.current = e.cloneRange();
|
|
1224
|
+
}, Ge = () => {
|
|
1196
1225
|
const e = window.getSelection();
|
|
1197
1226
|
if (!e || e.rangeCount === 0) return null;
|
|
1198
1227
|
const t = e.anchorNode;
|
|
1199
1228
|
let n = e.anchorOffset;
|
|
1200
1229
|
if (!t) return null;
|
|
1201
|
-
let
|
|
1202
|
-
for (
|
|
1203
|
-
if (
|
|
1204
|
-
const
|
|
1205
|
-
if (
|
|
1206
|
-
const
|
|
1207
|
-
return
|
|
1230
|
+
let a = t;
|
|
1231
|
+
for (a.nodeType !== Node.TEXT_NODE && (a.childNodes && a.childNodes[n] ? a = a.childNodes[n] : a = t.previousSibling); a; ) {
|
|
1232
|
+
if (a.nodeType === Node.TEXT_NODE) {
|
|
1233
|
+
const s = a.textContent || "", i = a === t ? n : s.length, o = s.lastIndexOf("@", i - 1);
|
|
1234
|
+
if (o !== -1) {
|
|
1235
|
+
const y = document.createRange();
|
|
1236
|
+
return y.setStart(a, o), y.setEnd(a, i), y;
|
|
1208
1237
|
}
|
|
1209
1238
|
}
|
|
1210
|
-
|
|
1239
|
+
a = a.previousSibling;
|
|
1211
1240
|
}
|
|
1212
1241
|
return null;
|
|
1213
|
-
},
|
|
1214
|
-
var
|
|
1242
|
+
}, Je = (e) => {
|
|
1243
|
+
var i;
|
|
1215
1244
|
const t = window.getSelection();
|
|
1216
1245
|
if (!t) return;
|
|
1217
|
-
const n =
|
|
1218
|
-
n ? (t.removeAllRanges(), t.addRange(n)) :
|
|
1219
|
-
const
|
|
1220
|
-
|
|
1246
|
+
const n = Ge();
|
|
1247
|
+
n ? (t.removeAllRanges(), t.addRange(n)) : q.current && (t.removeAllRanges(), t.addRange(q.current));
|
|
1248
|
+
const a = document.createElement("span");
|
|
1249
|
+
a.textContent = `{{${e.name}}}`, a.style.display = "inline", a.setAttribute("data-mention", e.value || e.name || ""), a.title = `{{${e.name}}}`;
|
|
1221
1250
|
try {
|
|
1222
|
-
const
|
|
1223
|
-
if (
|
|
1224
|
-
|
|
1251
|
+
const o = t.rangeCount ? t.getRangeAt(0) : null;
|
|
1252
|
+
if (o)
|
|
1253
|
+
o.deleteContents(), o.insertNode(a);
|
|
1225
1254
|
else {
|
|
1226
|
-
const
|
|
1227
|
-
|
|
1255
|
+
const u = document.createRange(), c = U();
|
|
1256
|
+
u.selectNodeContents(c), u.collapse(!1), u.insertNode(a);
|
|
1228
1257
|
}
|
|
1229
|
-
const
|
|
1230
|
-
|
|
1231
|
-
const
|
|
1232
|
-
|
|
1233
|
-
} catch (
|
|
1234
|
-
console.error("insertMention error:",
|
|
1258
|
+
const y = document.createTextNode("");
|
|
1259
|
+
a.after(y);
|
|
1260
|
+
const h = document.createRange();
|
|
1261
|
+
h.setStartAfter(y), h.collapse(!0), t.removeAllRanges(), t.addRange(h);
|
|
1262
|
+
} catch (o) {
|
|
1263
|
+
console.error("insertMention error:", o);
|
|
1235
1264
|
}
|
|
1236
|
-
let
|
|
1237
|
-
ue(
|
|
1238
|
-
},
|
|
1239
|
-
const t =
|
|
1265
|
+
let s = $e([...oe, e]);
|
|
1266
|
+
ue(s), R(s), O(!1), (i = U()) == null || i.focus(), M();
|
|
1267
|
+
}, et = (e) => {
|
|
1268
|
+
const t = U();
|
|
1240
1269
|
if (!t) return;
|
|
1241
1270
|
let n = null;
|
|
1242
1271
|
D.current && t.contains(D.current.startContainer) ? n = D.current.cloneRange() : (n = document.createRange(), n.selectNodeContents(t), n.collapse(!1));
|
|
1243
|
-
const
|
|
1244
|
-
if (!
|
|
1245
|
-
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1248
|
-
const
|
|
1249
|
-
|
|
1250
|
-
const
|
|
1251
|
-
|
|
1252
|
-
},
|
|
1253
|
-
e.forEach((t) =>
|
|
1254
|
-
const n = [...t, ...e],
|
|
1255
|
-
return
|
|
1272
|
+
const a = window.getSelection();
|
|
1273
|
+
if (!a) return;
|
|
1274
|
+
a.removeAllRanges(), a.addRange(n);
|
|
1275
|
+
const s = document.createElement("span");
|
|
1276
|
+
s.textContent = `{{${e.name}}}`, s.style.display = "inline", s.setAttribute("data-mention", e.value || e.name), s.title = `{{${e.name}}}`, n.insertNode(s);
|
|
1277
|
+
const i = document.createTextNode(" ");
|
|
1278
|
+
s.after(i);
|
|
1279
|
+
const o = document.createRange();
|
|
1280
|
+
o.setStartAfter(i), o.collapse(!0), a.removeAllRanges(), a.addRange(o), D.current = o.cloneRange(), t.focus();
|
|
1281
|
+
}, tt = (e) => {
|
|
1282
|
+
e.forEach((t) => et(t)), ue((t) => {
|
|
1283
|
+
const n = [...t, ...e], a = Array.from(new Map(n.map((s) => [s.name, s])).values());
|
|
1284
|
+
return R(a), a;
|
|
1256
1285
|
}), M();
|
|
1257
|
-
},
|
|
1258
|
-
const e =
|
|
1286
|
+
}, nt = () => {
|
|
1287
|
+
const e = U();
|
|
1259
1288
|
if (!e) return [];
|
|
1260
1289
|
const t = e.querySelectorAll("span[data-mention]"), n = [];
|
|
1261
|
-
return t.forEach((
|
|
1262
|
-
const
|
|
1263
|
-
|
|
1264
|
-
name:
|
|
1265
|
-
value:
|
|
1290
|
+
return t.forEach((a) => {
|
|
1291
|
+
const s = a.getAttribute("data-mention") || "", o = (a.textContent || "").match(/{{(.+?)}}/);
|
|
1292
|
+
o && n.push({
|
|
1293
|
+
name: o[1],
|
|
1294
|
+
value: s
|
|
1266
1295
|
});
|
|
1267
1296
|
}), n;
|
|
1268
|
-
},
|
|
1269
|
-
var n,
|
|
1297
|
+
}, rt = (e) => {
|
|
1298
|
+
var n, a, s;
|
|
1270
1299
|
const t = e.key.toLowerCase();
|
|
1271
1300
|
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") {
|
|
1272
|
-
const
|
|
1273
|
-
if (!
|
|
1274
|
-
if (((n =
|
|
1301
|
+
const i = window.getSelection(), o = i != null && i.anchorNode ? we(i.anchorNode) : null;
|
|
1302
|
+
if (!o) return;
|
|
1303
|
+
if (((n = o.textContent) == null ? void 0 : n.replace(/\u200B/g, "").trim()) === "") {
|
|
1275
1304
|
e.preventDefault();
|
|
1276
|
-
const
|
|
1277
|
-
if (
|
|
1278
|
-
|
|
1279
|
-
const
|
|
1280
|
-
|
|
1281
|
-
const
|
|
1282
|
-
|
|
1305
|
+
const h = o.parentElement, u = h == null ? void 0 : h.closest("li");
|
|
1306
|
+
if (u) {
|
|
1307
|
+
h == null || h.removeChild(o);
|
|
1308
|
+
const c = document.createElement("p");
|
|
1309
|
+
c.innerHTML = "<br />", (a = u.parentElement) == null || a.insertBefore(c, u.nextSibling);
|
|
1310
|
+
const p = document.createRange();
|
|
1311
|
+
p.setStart(c, 0), p.collapse(!0), i == null || i.removeAllRanges(), i == null || i.addRange(p);
|
|
1283
1312
|
} else {
|
|
1284
|
-
const
|
|
1285
|
-
if (
|
|
1286
|
-
const
|
|
1287
|
-
|
|
1313
|
+
const c = o.closest("ul, ol");
|
|
1314
|
+
if (c) {
|
|
1315
|
+
const p = document.createElement("p");
|
|
1316
|
+
p.innerHTML = "<br />", (s = c.parentElement) == null || s.insertBefore(p, c.nextSibling), c.removeChild(o);
|
|
1288
1317
|
const C = document.createRange();
|
|
1289
|
-
C.setStart(
|
|
1318
|
+
C.setStart(p, 0), C.collapse(!0), i == null || i.removeAllRanges(), i == null || i.addRange(C);
|
|
1290
1319
|
}
|
|
1291
1320
|
}
|
|
1292
1321
|
M();
|
|
1293
1322
|
}
|
|
1294
1323
|
}
|
|
1295
1324
|
if (t === "backspace" || t === "delete") {
|
|
1296
|
-
const
|
|
1297
|
-
if (!
|
|
1298
|
-
const
|
|
1299
|
-
if (
|
|
1325
|
+
const i = window.getSelection();
|
|
1326
|
+
if (!i || i.rangeCount === 0) return;
|
|
1327
|
+
const o = i.getRangeAt(0);
|
|
1328
|
+
if (o.cloneContents().querySelector("table"))
|
|
1300
1329
|
return;
|
|
1301
|
-
if (
|
|
1330
|
+
if (o.cloneContents().querySelectorAll(".rte-resize-handle").length > 0) {
|
|
1302
1331
|
e.preventDefault(), e.stopPropagation();
|
|
1303
1332
|
return;
|
|
1304
1333
|
}
|
|
1305
1334
|
}
|
|
1306
|
-
},
|
|
1335
|
+
}, at = (e) => {
|
|
1307
1336
|
if (e.data === "@") {
|
|
1308
1337
|
const n = window.getSelection();
|
|
1309
1338
|
if (!(n != null && n.rangeCount)) return;
|
|
1310
|
-
const
|
|
1311
|
-
if (he(
|
|
1339
|
+
const a = n.anchorNode;
|
|
1340
|
+
if (he(a))
|
|
1312
1341
|
return;
|
|
1313
1342
|
setTimeout(() => {
|
|
1314
|
-
|
|
1343
|
+
Qe(n.getRangeAt(0)), ee(""), x(l), O(!0);
|
|
1315
1344
|
}, 0);
|
|
1316
1345
|
return;
|
|
1317
1346
|
}
|
|
1318
|
-
if (
|
|
1319
|
-
setTimeout(() =>
|
|
1347
|
+
if (j) {
|
|
1348
|
+
setTimeout(() => be(), 0);
|
|
1320
1349
|
return;
|
|
1321
1350
|
}
|
|
1322
1351
|
}, he = (e) => {
|
|
@@ -1327,7 +1356,7 @@ const un = ({
|
|
|
1327
1356
|
t = t.parentElement;
|
|
1328
1357
|
}
|
|
1329
1358
|
return !1;
|
|
1330
|
-
},
|
|
1359
|
+
}, be = () => {
|
|
1331
1360
|
M();
|
|
1332
1361
|
const e = window.getSelection();
|
|
1333
1362
|
if (!e || !e.anchorNode) return;
|
|
@@ -1342,73 +1371,73 @@ const un = ({
|
|
|
1342
1371
|
O(!1);
|
|
1343
1372
|
return;
|
|
1344
1373
|
}
|
|
1345
|
-
const
|
|
1346
|
-
ee(
|
|
1347
|
-
const
|
|
1348
|
-
|
|
1349
|
-
},
|
|
1350
|
-
var
|
|
1351
|
-
const t = (
|
|
1374
|
+
const a = n[1].trim().toLowerCase();
|
|
1375
|
+
ee(a);
|
|
1376
|
+
const s = l.filter((i) => i.name.toLowerCase().includes(a));
|
|
1377
|
+
s.length > 0 ? (x(s), O(!0)) : O(!1);
|
|
1378
|
+
}, lt = (e) => {
|
|
1379
|
+
var a;
|
|
1380
|
+
const t = (a = e.target.files) == null ? void 0 : a[0];
|
|
1352
1381
|
if (!t) return;
|
|
1353
1382
|
const n = new FileReader();
|
|
1354
|
-
n.onload = (
|
|
1383
|
+
n.onload = (s) => {
|
|
1355
1384
|
var C;
|
|
1356
|
-
const
|
|
1385
|
+
const i = (C = s.target) == null ? void 0 : C.result;
|
|
1357
1386
|
G();
|
|
1358
|
-
const
|
|
1359
|
-
let
|
|
1360
|
-
const
|
|
1361
|
-
|
|
1362
|
-
const
|
|
1363
|
-
if (!
|
|
1364
|
-
|
|
1387
|
+
const o = window.getSelection();
|
|
1388
|
+
let y = o && o.rangeCount ? o.getRangeAt(0) : null;
|
|
1389
|
+
const h = document.createElement("img");
|
|
1390
|
+
h.src = i, h.alt = t.name || "image", h.className = "rte-inserted-image", h.contentEditable = "true";
|
|
1391
|
+
const u = U();
|
|
1392
|
+
if (!y || !u) {
|
|
1393
|
+
u == null || u.appendChild(h);
|
|
1365
1394
|
const T = document.createTextNode(" ");
|
|
1366
|
-
|
|
1395
|
+
u == null || u.appendChild(T);
|
|
1367
1396
|
const ne = document.createRange();
|
|
1368
|
-
ne.setStartAfter(T), ne.collapse(!0),
|
|
1397
|
+
ne.setStartAfter(T), ne.collapse(!0), o == null || o.removeAllRanges(), o == null || o.addRange(ne), u == null || u.focus(), M(), e.target.value = "";
|
|
1369
1398
|
return;
|
|
1370
1399
|
}
|
|
1371
|
-
|
|
1372
|
-
const
|
|
1373
|
-
|
|
1374
|
-
const
|
|
1375
|
-
|
|
1400
|
+
y.deleteContents(), y.insertNode(h);
|
|
1401
|
+
const c = document.createTextNode(" ");
|
|
1402
|
+
h.after(c);
|
|
1403
|
+
const p = document.createRange();
|
|
1404
|
+
p.setStartAfter(c), p.collapse(!0), o.removeAllRanges(), o.addRange(p), u.focus(), M(), e.target.value = "";
|
|
1376
1405
|
}, n.readAsDataURL(t);
|
|
1377
|
-
},
|
|
1378
|
-
var
|
|
1406
|
+
}, ot = (e) => {
|
|
1407
|
+
var s;
|
|
1379
1408
|
G();
|
|
1380
1409
|
const t = window.getSelection();
|
|
1381
1410
|
if (!(t != null && t.rangeCount)) return;
|
|
1382
|
-
const n = t.getRangeAt(0),
|
|
1383
|
-
n.insertNode(
|
|
1384
|
-
},
|
|
1385
|
-
var
|
|
1386
|
-
|
|
1411
|
+
const n = t.getRangeAt(0), a = document.createTextNode(e);
|
|
1412
|
+
n.insertNode(a), n.setStartAfter(a), n.collapse(!0), t.removeAllRanges(), t.addRange(n), (s = U()) == null || s.focus(), M();
|
|
1413
|
+
}, Ce = (e) => {
|
|
1414
|
+
var c;
|
|
1415
|
+
yt(), G();
|
|
1387
1416
|
const t = document.createElement("table");
|
|
1388
1417
|
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);
|
|
1389
1418
|
const n = document.createElement("thead");
|
|
1390
1419
|
v.thead && n.classList.add(v.thead);
|
|
1391
|
-
const
|
|
1392
|
-
v.tbody &&
|
|
1393
|
-
const
|
|
1394
|
-
v.tr &&
|
|
1395
|
-
const
|
|
1396
|
-
v.tr &&
|
|
1397
|
-
for (let
|
|
1420
|
+
const a = document.createElement("tbody");
|
|
1421
|
+
v.tbody && a.classList.add(v.tbody), e === "insertStaticTable" && a.setAttribute("table-type", "static");
|
|
1422
|
+
const s = document.createElement("tr");
|
|
1423
|
+
v.tr && s.classList.add(v.tr);
|
|
1424
|
+
const i = document.createElement("tr");
|
|
1425
|
+
v.tr && i.classList.add(v.tr);
|
|
1426
|
+
for (let p = 0; p < 2; p++) {
|
|
1398
1427
|
const C = document.createElement("th");
|
|
1399
1428
|
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);
|
|
1400
1429
|
const T = document.createElement("td");
|
|
1401
|
-
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),
|
|
1430
|
+
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), s.appendChild(C), i.appendChild(T);
|
|
1402
1431
|
}
|
|
1403
|
-
n.appendChild(
|
|
1404
|
-
const
|
|
1405
|
-
if (!(
|
|
1406
|
-
const
|
|
1407
|
-
|
|
1408
|
-
const
|
|
1409
|
-
|
|
1410
|
-
const
|
|
1411
|
-
|
|
1432
|
+
n.appendChild(s), a.appendChild(i), t.appendChild(n), t.appendChild(a), ge(t);
|
|
1433
|
+
const o = window.getSelection();
|
|
1434
|
+
if (!(o != null && o.rangeCount)) return;
|
|
1435
|
+
const y = o.getRangeAt(0);
|
|
1436
|
+
y.collapse(!1), y.insertNode(t);
|
|
1437
|
+
const h = document.createElement("p");
|
|
1438
|
+
h.innerHTML = "<br/>", t.after(h);
|
|
1439
|
+
const u = document.createRange();
|
|
1440
|
+
u.setStart(h, 0), u.collapse(!0), o.removeAllRanges(), o.addRange(u), (c = U()) == null || c.focus(), M();
|
|
1412
1441
|
}, ge = (e) => {
|
|
1413
1442
|
if (e.dataset.hasResizeHandle === "true") return;
|
|
1414
1443
|
const t = document.createElement("div");
|
|
@@ -1422,19 +1451,17 @@ const un = ({
|
|
|
1422
1451
|
cursor: "nwse-resize",
|
|
1423
1452
|
zIndex: "20",
|
|
1424
1453
|
borderRadius: "2px"
|
|
1425
|
-
}), t.contentEditable = "false", t.dataset.hasResizeHandle = "true", t.classList.add("rte-resize-handle")
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
const
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
}, m = () => {
|
|
1435
|
-
document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", m), M();
|
|
1454
|
+
}), t.contentEditable = "false", t.dataset.hasResizeHandle = "true", t.classList.add("rte-resize-handle"), t.addEventListener("mousedown", (n) => {
|
|
1455
|
+
n.preventDefault(), n.clientX, n.clientY;
|
|
1456
|
+
const a = e.getBoundingClientRect();
|
|
1457
|
+
a.width, a.height;
|
|
1458
|
+
const s = (o) => {
|
|
1459
|
+
const y = Math.max(100, o.clientX - a.left), h = Math.max(20, o.clientY - a.top);
|
|
1460
|
+
e.style.width = `${y}px`, e.style.height = `${h}px`, M();
|
|
1461
|
+
}, i = () => {
|
|
1462
|
+
document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", i), M();
|
|
1436
1463
|
};
|
|
1437
|
-
document.addEventListener("mousemove",
|
|
1464
|
+
document.addEventListener("mousemove", s), document.addEventListener("mouseup", i);
|
|
1438
1465
|
}), e.appendChild(t);
|
|
1439
1466
|
}, te = (e) => {
|
|
1440
1467
|
const t = document.createElement("div"), n = document.createElement("div");
|
|
@@ -1462,102 +1489,116 @@ const un = ({
|
|
|
1462
1489
|
MozUserSelect: "none",
|
|
1463
1490
|
msUserSelect: "none",
|
|
1464
1491
|
pointerEvents: "auto"
|
|
1465
|
-
}), n.contentEditable = "false", n.classList.add("rte-resize-handle"),
|
|
1466
|
-
},
|
|
1467
|
-
let
|
|
1468
|
-
t.addEventListener("mousedown", (
|
|
1469
|
-
|
|
1470
|
-
}), n.addEventListener("mousedown", (
|
|
1471
|
-
|
|
1492
|
+
}), n.contentEditable = "false", n.classList.add("rte-resize-handle"), it(e, t, n), e.appendChild(t), e.appendChild(n);
|
|
1493
|
+
}, it = (e, t, n) => {
|
|
1494
|
+
let a = 0, s = 0, i = 0, o = 0;
|
|
1495
|
+
t.addEventListener("mousedown", (c) => {
|
|
1496
|
+
c.preventDefault(), a = c.clientX, i = e.offsetWidth, document.addEventListener("mousemove", y), document.addEventListener("mouseup", u);
|
|
1497
|
+
}), n.addEventListener("mousedown", (c) => {
|
|
1498
|
+
c.preventDefault(), s = c.clientY, o = e.offsetHeight, document.addEventListener("mousemove", h), document.addEventListener("mouseup", u);
|
|
1472
1499
|
});
|
|
1473
|
-
const
|
|
1474
|
-
const
|
|
1475
|
-
e.style.width = `${Math.max(30,
|
|
1476
|
-
},
|
|
1477
|
-
const
|
|
1478
|
-
e.style.height = `${Math.max(20,
|
|
1479
|
-
},
|
|
1480
|
-
document.removeEventListener("mousemove",
|
|
1500
|
+
const y = (c) => {
|
|
1501
|
+
const p = i + (c.clientX - a);
|
|
1502
|
+
e.style.width = `${Math.max(30, p)}px`, M();
|
|
1503
|
+
}, h = (c) => {
|
|
1504
|
+
const p = o + (c.clientY - s);
|
|
1505
|
+
e.style.height = `${Math.max(20, p)}px`, M();
|
|
1506
|
+
}, u = () => {
|
|
1507
|
+
document.removeEventListener("mousemove", y), document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", u), M();
|
|
1481
1508
|
};
|
|
1482
|
-
},
|
|
1509
|
+
}, ct = (e) => {
|
|
1483
1510
|
const n = e.target.closest("td, th");
|
|
1484
|
-
n && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((
|
|
1511
|
+
n && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((a) => a.classList.remove("rte-cell-highlight")), n.classList.add("rte-cell-highlight"), B({
|
|
1485
1512
|
visible: !0,
|
|
1486
1513
|
x: e.clientX,
|
|
1487
1514
|
y: e.clientY,
|
|
1488
1515
|
cell: n
|
|
1489
1516
|
}));
|
|
1490
|
-
},
|
|
1517
|
+
}, Le = () => {
|
|
1491
1518
|
document.querySelectorAll(".rte-cell-highlight").forEach((e) => e.classList.remove("rte-cell-highlight"));
|
|
1492
|
-
}
|
|
1493
|
-
|
|
1494
|
-
const
|
|
1495
|
-
|
|
1496
|
-
|
|
1519
|
+
};
|
|
1520
|
+
function xe() {
|
|
1521
|
+
const e = S.current;
|
|
1522
|
+
e && e.querySelectorAll("table.rte-table-selected").forEach((t) => t.classList.remove("rte-table-selected"));
|
|
1523
|
+
}
|
|
1524
|
+
const st = (e) => {
|
|
1525
|
+
var i, o, y;
|
|
1526
|
+
if (!P.cell) return;
|
|
1527
|
+
const t = P.cell.closest("table"), n = P.cell.cellIndex, a = P.cell.parentElement.rowIndex, s = (h) => {
|
|
1528
|
+
const u = h.tagName.toLowerCase(), c = document.createElement(u);
|
|
1529
|
+
return c.textContent = "", c.style.cssText = h.style.cssText, te(c), c;
|
|
1497
1530
|
};
|
|
1498
1531
|
switch (e) {
|
|
1499
1532
|
case "insertRowAbove": {
|
|
1500
|
-
const
|
|
1501
|
-
Array.from(
|
|
1502
|
-
|
|
1533
|
+
const h = t.rows[a], u = t.insertRow(a);
|
|
1534
|
+
Array.from(h.cells).forEach((c) => {
|
|
1535
|
+
u.appendChild(s(c));
|
|
1503
1536
|
});
|
|
1504
1537
|
break;
|
|
1505
1538
|
}
|
|
1506
1539
|
case "insertRowBelow": {
|
|
1507
|
-
const
|
|
1508
|
-
Array.from(
|
|
1509
|
-
|
|
1540
|
+
const h = t.rows[a], u = t.insertRow(a + 1);
|
|
1541
|
+
Array.from(h.cells).forEach((c) => {
|
|
1542
|
+
u.appendChild(s(c));
|
|
1510
1543
|
});
|
|
1511
1544
|
break;
|
|
1512
1545
|
}
|
|
1513
1546
|
case "insertColLeft": {
|
|
1514
|
-
Array.from(t.rows).forEach((
|
|
1515
|
-
const
|
|
1516
|
-
|
|
1547
|
+
Array.from(t.rows).forEach((h) => {
|
|
1548
|
+
const u = h.cells[n];
|
|
1549
|
+
h.insertBefore(s(u), u);
|
|
1517
1550
|
});
|
|
1518
1551
|
break;
|
|
1519
1552
|
}
|
|
1520
1553
|
case "insertColRight": {
|
|
1521
|
-
Array.from(t.rows).forEach((
|
|
1522
|
-
const
|
|
1523
|
-
|
|
1554
|
+
Array.from(t.rows).forEach((h) => {
|
|
1555
|
+
const u = h.cells[n];
|
|
1556
|
+
h.insertBefore(s(u), u.nextSibling);
|
|
1524
1557
|
});
|
|
1525
1558
|
break;
|
|
1526
1559
|
}
|
|
1527
1560
|
case "deleteRow":
|
|
1528
|
-
t.rows.length > 1 && t.deleteRow(
|
|
1561
|
+
t.rows.length > 1 && t.deleteRow(a);
|
|
1529
1562
|
break;
|
|
1530
1563
|
case "deleteCol":
|
|
1531
|
-
Array.from(t.rows).forEach((
|
|
1532
|
-
|
|
1564
|
+
Array.from(t.rows).forEach((h) => {
|
|
1565
|
+
h.cells[n] && h.deleteCell(n);
|
|
1533
1566
|
});
|
|
1534
1567
|
break;
|
|
1568
|
+
case "deleteTable": {
|
|
1569
|
+
const h = (i = P.cell) == null ? void 0 : i.closest("table");
|
|
1570
|
+
if (!h) break;
|
|
1571
|
+
h.remove();
|
|
1572
|
+
const u = document.createElement("p");
|
|
1573
|
+
u.innerHTML = "<br />", (y = (o = P.cell) == null ? void 0 : o.parentElement) == null || y.after(u);
|
|
1574
|
+
break;
|
|
1575
|
+
}
|
|
1535
1576
|
}
|
|
1536
|
-
M(),
|
|
1577
|
+
requestAnimationFrame(() => M()), B(ae(re({}, P), {
|
|
1537
1578
|
visible: !1
|
|
1538
|
-
})),
|
|
1539
|
-
},
|
|
1540
|
-
Q(),
|
|
1579
|
+
})), Le(), xe();
|
|
1580
|
+
}, dt = () => {
|
|
1581
|
+
Q(), w.current = D.current, J({
|
|
1541
1582
|
url: "",
|
|
1542
1583
|
text: "",
|
|
1543
1584
|
title: "",
|
|
1544
1585
|
target: "_self"
|
|
1545
|
-
}),
|
|
1546
|
-
},
|
|
1586
|
+
}), f(!0);
|
|
1587
|
+
}, ut = (e) => {
|
|
1547
1588
|
const t = window.getSelection();
|
|
1548
|
-
if (!t || !
|
|
1549
|
-
t.removeAllRanges(), t.addRange(
|
|
1589
|
+
if (!t || !w.current) return;
|
|
1590
|
+
t.removeAllRanges(), t.addRange(w.current);
|
|
1550
1591
|
let n = e.url.trim();
|
|
1551
1592
|
/^https?:\/\//i.test(n) || (n = "https://" + n);
|
|
1552
|
-
const
|
|
1553
|
-
|
|
1554
|
-
const
|
|
1555
|
-
|
|
1556
|
-
const
|
|
1557
|
-
|
|
1558
|
-
const
|
|
1559
|
-
|
|
1560
|
-
},
|
|
1593
|
+
const a = document.createElement("a");
|
|
1594
|
+
a.href = n, a.style.cursor = "pointer", a.style.outline = "none", a.textContent = e.text || n, a.title = e.title, a.target = e.target, a.contentEditable = "true";
|
|
1595
|
+
const s = t.getRangeAt(0);
|
|
1596
|
+
s.deleteContents(), s.insertNode(a);
|
|
1597
|
+
const i = document.createTextNode(" ");
|
|
1598
|
+
a.after(i);
|
|
1599
|
+
const o = document.createRange();
|
|
1600
|
+
o.setStartAfter(i), o.collapse(!0), t.removeAllRanges(), t.addRange(o), f(!1), M();
|
|
1601
|
+
}, mt = (e) => {
|
|
1561
1602
|
const t = e.target;
|
|
1562
1603
|
if (t.tagName === "A") {
|
|
1563
1604
|
const n = t;
|
|
@@ -1566,91 +1607,91 @@ const un = ({
|
|
|
1566
1607
|
return;
|
|
1567
1608
|
}
|
|
1568
1609
|
e.preventDefault();
|
|
1569
|
-
const
|
|
1570
|
-
|
|
1610
|
+
const a = document.createRange();
|
|
1611
|
+
a.selectNode(n), w.current = a, J({
|
|
1571
1612
|
url: n.href,
|
|
1572
1613
|
text: n.textContent || n.href,
|
|
1573
1614
|
title: n.title,
|
|
1574
1615
|
target: n.target
|
|
1575
|
-
}),
|
|
1616
|
+
}), f(!0);
|
|
1576
1617
|
}
|
|
1577
|
-
},
|
|
1578
|
-
const e =
|
|
1618
|
+
}, ht = () => {
|
|
1619
|
+
const e = U();
|
|
1579
1620
|
if (!e) return;
|
|
1580
1621
|
const t = window.getSelection();
|
|
1581
1622
|
if ((!t || t.rangeCount === 0) && D.current) {
|
|
1582
|
-
const
|
|
1583
|
-
|
|
1623
|
+
const c = window.getSelection();
|
|
1624
|
+
c == null || c.removeAllRanges(), c == null || c.addRange(D.current);
|
|
1584
1625
|
}
|
|
1585
1626
|
const n = window.getSelection();
|
|
1586
1627
|
if (!n || n.rangeCount === 0) return;
|
|
1587
|
-
const
|
|
1628
|
+
const a = n.getRangeAt(0);
|
|
1588
1629
|
G(), document.execCommand("removeFormat", !1);
|
|
1589
|
-
const
|
|
1590
|
-
|
|
1591
|
-
const
|
|
1592
|
-
for (;
|
|
1593
|
-
const
|
|
1594
|
-
|
|
1630
|
+
const s = a.cloneContents(), i = document.createElement("div");
|
|
1631
|
+
i.appendChild(s);
|
|
1632
|
+
const o = document.createTreeWalker(i, NodeFilter.SHOW_ELEMENT, null), y = [];
|
|
1633
|
+
for (; o.nextNode(); ) {
|
|
1634
|
+
const c = o.currentNode, p = c.tagName.toUpperCase(), C = c.getAttribute && c.getAttribute("data-mention") !== null;
|
|
1635
|
+
p !== "A" && !C && y.push(c);
|
|
1595
1636
|
}
|
|
1596
|
-
for (let
|
|
1597
|
-
const
|
|
1637
|
+
for (let c = y.length - 1; c >= 0; c--) {
|
|
1638
|
+
const p = y[c], C = p.parentNode;
|
|
1598
1639
|
if (C) {
|
|
1599
|
-
for (;
|
|
1600
|
-
C.removeChild(
|
|
1640
|
+
for (; p.firstChild; ) C.insertBefore(p.firstChild, p);
|
|
1641
|
+
C.removeChild(p);
|
|
1601
1642
|
}
|
|
1602
1643
|
}
|
|
1603
|
-
|
|
1604
|
-
const
|
|
1605
|
-
for (;
|
|
1606
|
-
|
|
1607
|
-
const
|
|
1608
|
-
|
|
1609
|
-
},
|
|
1610
|
-
var
|
|
1644
|
+
i.querySelectorAll("[style]").forEach((c) => c.removeAttribute("style")), a.deleteContents();
|
|
1645
|
+
const h = document.createDocumentFragment();
|
|
1646
|
+
for (; i.firstChild; ) h.appendChild(i.firstChild);
|
|
1647
|
+
a.insertNode(h);
|
|
1648
|
+
const u = document.createRange();
|
|
1649
|
+
u.setStartAfter(a.endContainer.nodeType === Node.TEXT_NODE ? a.endContainer : a.startContainer), u.collapse(!0), n.removeAllRanges(), n.addRange(u), e.normalize(), M();
|
|
1650
|
+
}, gt = (e) => {
|
|
1651
|
+
var a;
|
|
1611
1652
|
let t = e;
|
|
1612
1653
|
t = t.replace(/{{#arrayData\d*}}/g, ""), t = t.replace(/{{\/arrayData\d*}}/g, "");
|
|
1613
1654
|
const n = document.createElement("div");
|
|
1614
|
-
return n.innerHTML = t, n.querySelectorAll("br").forEach((
|
|
1615
|
-
|
|
1655
|
+
return n.innerHTML = t, n.querySelectorAll("br").forEach((s) => {
|
|
1656
|
+
s.replaceWith(`
|
|
1616
1657
|
`);
|
|
1617
|
-
}), n.querySelectorAll("p, div, tr").forEach((
|
|
1618
|
-
|
|
1658
|
+
}), n.querySelectorAll("p, div, tr").forEach((s) => {
|
|
1659
|
+
s.insertAdjacentText("afterend", `
|
|
1619
1660
|
`);
|
|
1620
|
-
}), n.querySelectorAll("table").forEach((
|
|
1621
|
-
|
|
1661
|
+
}), n.querySelectorAll("table").forEach((s) => {
|
|
1662
|
+
s.insertAdjacentText("afterend", `
|
|
1622
1663
|
`);
|
|
1623
|
-
}), ((
|
|
1664
|
+
}), ((a = n.textContent) == null ? void 0 : a.replace(/\n{3,}/g, `
|
|
1624
1665
|
|
|
1625
1666
|
`).trim()) || "";
|
|
1626
1667
|
};
|
|
1627
|
-
function
|
|
1668
|
+
function Se() {
|
|
1628
1669
|
const e = window.getSelection();
|
|
1629
1670
|
if (!e || e.rangeCount === 0) return [];
|
|
1630
1671
|
const t = e.getRangeAt(0);
|
|
1631
1672
|
if (t.collapsed) {
|
|
1632
|
-
let
|
|
1633
|
-
const
|
|
1634
|
-
return
|
|
1673
|
+
let i = t.startContainer, o = i.nodeType === Node.ELEMENT_NODE ? i : i.parentElement;
|
|
1674
|
+
const y = o == null ? void 0 : o.closest("td, th");
|
|
1675
|
+
return y ? [y] : [];
|
|
1635
1676
|
}
|
|
1636
|
-
const n = t.commonAncestorContainer,
|
|
1637
|
-
return Array.from(
|
|
1638
|
-
const
|
|
1639
|
-
return
|
|
1677
|
+
const n = t.commonAncestorContainer, a = n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement;
|
|
1678
|
+
return Array.from(a.querySelectorAll("td, th")).filter((i) => {
|
|
1679
|
+
const o = document.createRange();
|
|
1680
|
+
return o.selectNodeContents(i), t.compareBoundaryPoints(Range.END_TO_START, o) < 0 && t.compareBoundaryPoints(Range.START_TO_END, o) > 0;
|
|
1640
1681
|
});
|
|
1641
1682
|
}
|
|
1642
|
-
function
|
|
1643
|
-
const t =
|
|
1683
|
+
function ft(e) {
|
|
1684
|
+
const t = Se();
|
|
1644
1685
|
if (t.length === 0) {
|
|
1645
|
-
|
|
1686
|
+
Ee(e);
|
|
1646
1687
|
return;
|
|
1647
1688
|
}
|
|
1648
1689
|
let n = "left";
|
|
1649
|
-
e === "justifyCenter" && (n = "center"), e === "justifyRight" && (n = "right"), t.forEach((
|
|
1650
|
-
|
|
1690
|
+
e === "justifyCenter" && (n = "center"), e === "justifyRight" && (n = "right"), t.forEach((a) => {
|
|
1691
|
+
a.style.textAlign = n;
|
|
1651
1692
|
}), M();
|
|
1652
1693
|
}
|
|
1653
|
-
const
|
|
1694
|
+
const pt = () => {
|
|
1654
1695
|
const e = window.getSelection();
|
|
1655
1696
|
if (!e || !e.anchorNode) return !1;
|
|
1656
1697
|
let t = e.anchorNode.nodeType === Node.ELEMENT_NODE ? e.anchorNode : e.anchorNode.parentElement;
|
|
@@ -1659,19 +1700,19 @@ const un = ({
|
|
|
1659
1700
|
t = t.parentElement;
|
|
1660
1701
|
}
|
|
1661
1702
|
return !1;
|
|
1662
|
-
},
|
|
1663
|
-
if (
|
|
1703
|
+
}, vt = (e) => {
|
|
1704
|
+
if (pt()) {
|
|
1664
1705
|
e.preventDefault();
|
|
1665
|
-
const
|
|
1666
|
-
if (!
|
|
1667
|
-
const
|
|
1668
|
-
if (!
|
|
1669
|
-
const
|
|
1670
|
-
|
|
1671
|
-
const C =
|
|
1706
|
+
const u = e.clipboardData.getData("text/plain");
|
|
1707
|
+
if (!u) return;
|
|
1708
|
+
const c = window.getSelection();
|
|
1709
|
+
if (!c || !c.rangeCount) return;
|
|
1710
|
+
const p = c.getRangeAt(0);
|
|
1711
|
+
p.deleteContents();
|
|
1712
|
+
const C = u.split(/\r?\n/);
|
|
1672
1713
|
C.forEach((T, ne) => {
|
|
1673
|
-
|
|
1674
|
-
}),
|
|
1714
|
+
p.insertNode(document.createTextNode(T)), ne < C.length - 1 && p.insertNode(document.createElement("br"));
|
|
1715
|
+
}), p.collapse(!1), c.removeAllRanges(), c.addRange(p), M();
|
|
1675
1716
|
return;
|
|
1676
1717
|
}
|
|
1677
1718
|
const t = e.clipboardData.getData("text/html") || "";
|
|
@@ -1682,73 +1723,82 @@ const un = ({
|
|
|
1682
1723
|
return;
|
|
1683
1724
|
}
|
|
1684
1725
|
e.preventDefault();
|
|
1685
|
-
const
|
|
1686
|
-
|
|
1687
|
-
const
|
|
1688
|
-
|
|
1689
|
-
const
|
|
1690
|
-
|
|
1691
|
-
}),
|
|
1692
|
-
const
|
|
1693
|
-
|
|
1726
|
+
const a = document.createElement("div");
|
|
1727
|
+
a.innerHTML = t;
|
|
1728
|
+
const s = (u) => {
|
|
1729
|
+
u.hasAttribute("data-has-resize-handle") || (u.style.borderCollapse = "collapse", u.style.width = "100%", u.style.border = "1px solid #ccc", u.style.margin = "8px 0", u.style.position = "relative", u.style.textAlign = "center", u.querySelectorAll("th").forEach((c) => {
|
|
1730
|
+
const p = c;
|
|
1731
|
+
p.style.border = "1px solid #999", p.style.padding = "4px", p.style.position = "relative", p.style.backgroundColor = "lightgray", p.style.height = "20px";
|
|
1732
|
+
}), u.querySelectorAll("td").forEach((c) => {
|
|
1733
|
+
const p = c;
|
|
1734
|
+
p.style.border = "1px solid #999", p.style.padding = "4px", p.style.position = "relative", p.style.backgroundColor = "#fff", p.style.height = "20px";
|
|
1694
1735
|
}));
|
|
1695
1736
|
};
|
|
1696
|
-
|
|
1697
|
-
const
|
|
1698
|
-
if (!
|
|
1699
|
-
const
|
|
1700
|
-
|
|
1701
|
-
const
|
|
1702
|
-
for (;
|
|
1703
|
-
|
|
1704
|
-
const
|
|
1705
|
-
|
|
1706
|
-
const
|
|
1707
|
-
|
|
1708
|
-
const C =
|
|
1737
|
+
a.querySelectorAll("table").forEach((u) => s(u));
|
|
1738
|
+
const i = window.getSelection();
|
|
1739
|
+
if (!i || !i.rangeCount) return;
|
|
1740
|
+
const o = i.getRangeAt(0);
|
|
1741
|
+
o.deleteContents();
|
|
1742
|
+
const y = document.createDocumentFragment();
|
|
1743
|
+
for (; a.firstChild; ) y.appendChild(a.firstChild);
|
|
1744
|
+
o.insertNode(y), o.collapse(!1), i.removeAllRanges(), i.addRange(o);
|
|
1745
|
+
const h = S.current;
|
|
1746
|
+
h && (h.querySelectorAll("table").forEach((u) => {
|
|
1747
|
+
const c = u;
|
|
1748
|
+
c.hasAttribute("data-has-resize-handle") || (ge(c), c.querySelectorAll("th, td").forEach((p) => {
|
|
1749
|
+
const C = p;
|
|
1709
1750
|
C.dataset.hasResizeHandles || te(C);
|
|
1710
1751
|
}));
|
|
1711
1752
|
}), M());
|
|
1712
|
-
},
|
|
1753
|
+
}, Et = (e) => {
|
|
1713
1754
|
G();
|
|
1714
1755
|
const t = window.getSelection();
|
|
1715
1756
|
if (!t || !t.rangeCount) return;
|
|
1716
|
-
const n =
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1757
|
+
const n = Se();
|
|
1758
|
+
if (n.length > 0) {
|
|
1759
|
+
n.forEach((o) => {
|
|
1760
|
+
o.style.fontSize = `${e}px`, o.style.lineHeight = "1.2";
|
|
1761
|
+
}), M();
|
|
1762
|
+
return;
|
|
1763
|
+
}
|
|
1764
|
+
const a = t.getRangeAt(0);
|
|
1765
|
+
if (a.collapsed) return;
|
|
1766
|
+
const s = document.createElement("span");
|
|
1767
|
+
s.style.fontSize = `${e}px`, s.appendChild(a.extractContents()), a.insertNode(s);
|
|
1768
|
+
const i = document.createRange();
|
|
1769
|
+
i.setStartAfter(s), i.collapse(!0), t.removeAllRanges(), t.addRange(i), M();
|
|
1770
|
+
}, wt = () => {
|
|
1721
1771
|
const e = window.getSelection();
|
|
1722
1772
|
if (!e || !e.anchorNode) return null;
|
|
1723
1773
|
const t = e.anchorNode;
|
|
1724
1774
|
if (he(t) || t.nodeType !== Node.TEXT_NODE) return null;
|
|
1725
|
-
const n = t.textContent || "",
|
|
1726
|
-
if (
|
|
1727
|
-
const
|
|
1728
|
-
if (
|
|
1729
|
-
const
|
|
1730
|
-
return
|
|
1731
|
-
range:
|
|
1732
|
-
query:
|
|
1775
|
+
const n = t.textContent || "", a = e.anchorOffset, s = n.lastIndexOf("@", a - 1);
|
|
1776
|
+
if (s === -1) return null;
|
|
1777
|
+
const i = n.substring(s + 1, a);
|
|
1778
|
+
if (i.includes(" ") || i.includes(" ")) return null;
|
|
1779
|
+
const o = document.createRange();
|
|
1780
|
+
return o.setStart(t, s), o.setEnd(t, a), {
|
|
1781
|
+
range: o,
|
|
1782
|
+
query: i
|
|
1733
1783
|
};
|
|
1734
|
-
},
|
|
1735
|
-
const e =
|
|
1784
|
+
}, Re = () => {
|
|
1785
|
+
const e = wt();
|
|
1736
1786
|
if (!e) return;
|
|
1737
1787
|
const {
|
|
1738
1788
|
range: t,
|
|
1739
1789
|
query: n
|
|
1740
|
-
} = e,
|
|
1741
|
-
|
|
1742
|
-
const
|
|
1743
|
-
|
|
1744
|
-
x:
|
|
1745
|
-
y:
|
|
1790
|
+
} = e, a = document.createElement("span");
|
|
1791
|
+
a.textContent = "", t.insertNode(a);
|
|
1792
|
+
const s = a.getBoundingClientRect();
|
|
1793
|
+
a.remove(), K({
|
|
1794
|
+
x: s.left,
|
|
1795
|
+
y: s.bottom + window.scrollY
|
|
1746
1796
|
}), ee(n.toLowerCase());
|
|
1747
|
-
const
|
|
1748
|
-
x(
|
|
1797
|
+
const i = l.filter((o) => o.name.toLowerCase().includes(n.toLowerCase()));
|
|
1798
|
+
x(i), O(!0), q.current = t.cloneRange();
|
|
1749
1799
|
};
|
|
1750
|
-
function
|
|
1751
|
-
const e =
|
|
1800
|
+
function yt() {
|
|
1801
|
+
const e = S.current;
|
|
1752
1802
|
if (!e) return;
|
|
1753
1803
|
const t = window.getSelection();
|
|
1754
1804
|
if (!t || t.rangeCount > 0 && e.contains(t.anchorNode))
|
|
@@ -1756,34 +1806,47 @@ const un = ({
|
|
|
1756
1806
|
const n = document.createRange();
|
|
1757
1807
|
n.selectNodeContents(e), n.collapse(!1), t.removeAllRanges(), t.addRange(n), D.current = n.cloneRange();
|
|
1758
1808
|
}
|
|
1759
|
-
const
|
|
1809
|
+
const bt = (e) => {
|
|
1760
1810
|
const t = e.target;
|
|
1761
|
-
if (!t || !(t.textContent || "").match(/{{([\s\S]+?)}}/) || !
|
|
1762
|
-
let
|
|
1763
|
-
if ((!
|
|
1764
|
-
const
|
|
1765
|
-
if (
|
|
1766
|
-
const
|
|
1767
|
-
if (!
|
|
1768
|
-
const
|
|
1769
|
-
|
|
1770
|
-
},
|
|
1771
|
-
|
|
1811
|
+
if (!t || !(t.textContent || "").match(/{{([\s\S]+?)}}/) || !S.current) return;
|
|
1812
|
+
let i = t.firstChild;
|
|
1813
|
+
if ((!i || i.nodeType !== Node.TEXT_NODE) && (i = t.childNodes[0]), !i || i.nodeType !== Node.TEXT_NODE) return;
|
|
1814
|
+
const o = i.textContent || "", y = o.indexOf("{{"), h = o.indexOf("}}");
|
|
1815
|
+
if (y === -1 || h === -1) return;
|
|
1816
|
+
const u = window.getSelection();
|
|
1817
|
+
if (!u) return;
|
|
1818
|
+
const c = document.createRange();
|
|
1819
|
+
c.setStart(i, y), c.setEnd(i, h + 2), u.removeAllRanges(), u.addRange(c);
|
|
1820
|
+
}, Ct = (e) => {
|
|
1821
|
+
ve((t) => {
|
|
1772
1822
|
const n = {};
|
|
1773
|
-
return e.forEach((
|
|
1774
|
-
var
|
|
1775
|
-
n[
|
|
1823
|
+
return e.forEach((a) => {
|
|
1824
|
+
var s;
|
|
1825
|
+
n[a.name] = (s = t[a.name]) != null ? s : "";
|
|
1776
1826
|
}), n;
|
|
1777
1827
|
});
|
|
1778
|
-
},
|
|
1828
|
+
}, Lt = () => {
|
|
1779
1829
|
let e = A;
|
|
1780
|
-
return Object.entries(
|
|
1830
|
+
return Object.entries(pe).forEach(([t, n]) => {
|
|
1781
1831
|
if (n.trim()) {
|
|
1782
|
-
const
|
|
1783
|
-
e = e.replace(
|
|
1832
|
+
const a = new RegExp(`{{\\s*${t}\\s*}}`, "g");
|
|
1833
|
+
e = e.replace(a, n);
|
|
1784
1834
|
}
|
|
1785
1835
|
}), e;
|
|
1786
1836
|
};
|
|
1837
|
+
function xt(e) {
|
|
1838
|
+
const t = window.getSelection();
|
|
1839
|
+
if (!t || t.rangeCount === 0) return !1;
|
|
1840
|
+
const n = t.getRangeAt(0), a = document.createRange();
|
|
1841
|
+
return a.selectNode(e), n.compareBoundaryPoints(Range.START_TO_START, a) <= 0 && n.compareBoundaryPoints(Range.END_TO_END, a) >= 0;
|
|
1842
|
+
}
|
|
1843
|
+
function St() {
|
|
1844
|
+
const e = S.current;
|
|
1845
|
+
if (!e) return;
|
|
1846
|
+
e.querySelectorAll("table").forEach((n) => {
|
|
1847
|
+
xt(n) ? n.classList.add("rte-table-selected") : n.classList.remove("rte-table-selected");
|
|
1848
|
+
});
|
|
1849
|
+
}
|
|
1787
1850
|
return /* @__PURE__ */ r.createElement("div", {
|
|
1788
1851
|
className: `rte-wrapper ${(v == null ? void 0 : v.wrapper) || ""}`,
|
|
1789
1852
|
style: L.wrapper
|
|
@@ -1791,75 +1854,75 @@ const un = ({
|
|
|
1791
1854
|
style: {
|
|
1792
1855
|
flex: 1
|
|
1793
1856
|
}
|
|
1794
|
-
}, /* @__PURE__ */ r.createElement(
|
|
1857
|
+
}, /* @__PURE__ */ r.createElement(ln, {
|
|
1795
1858
|
exec: me,
|
|
1796
1859
|
saveSelection: Q,
|
|
1797
|
-
handleFileChange:
|
|
1798
|
-
handleFontSizeChange: (e) =>
|
|
1860
|
+
handleFileChange: lt,
|
|
1861
|
+
handleFontSizeChange: (e) => Et(e.target.value),
|
|
1799
1862
|
handleFontFamilyChange: (e) => me("fontName", e.target.value),
|
|
1800
|
-
insertEmoji:
|
|
1801
|
-
handleLink:
|
|
1802
|
-
removeFormatting:
|
|
1863
|
+
insertEmoji: ot,
|
|
1864
|
+
handleLink: dt,
|
|
1865
|
+
removeFormatting: ht,
|
|
1803
1866
|
visibleActions: le,
|
|
1804
1867
|
className: v.toolbar,
|
|
1805
1868
|
style: L.toolbar
|
|
1806
1869
|
}), /* @__PURE__ */ r.createElement("div", {
|
|
1807
|
-
ref:
|
|
1870
|
+
ref: S,
|
|
1808
1871
|
id: "rte-editor-body",
|
|
1809
1872
|
className: `rte-editor ${(v == null ? void 0 : v.editor) || ""}`,
|
|
1810
1873
|
style: L.editor,
|
|
1811
1874
|
contentEditable: !0,
|
|
1812
1875
|
suppressContentEditableWarning: !0,
|
|
1813
|
-
onPaste:
|
|
1876
|
+
onPaste: vt,
|
|
1814
1877
|
onKeyUp: () => {
|
|
1815
|
-
Q(),
|
|
1878
|
+
Q(), Re();
|
|
1816
1879
|
},
|
|
1817
1880
|
onMouseUp: Q,
|
|
1818
1881
|
onInput: () => {
|
|
1819
|
-
|
|
1882
|
+
be(), Q();
|
|
1820
1883
|
},
|
|
1821
|
-
onKeyDown:
|
|
1822
|
-
onBeforeInput:
|
|
1823
|
-
onContextMenu:
|
|
1884
|
+
onKeyDown: rt,
|
|
1885
|
+
onBeforeInput: at,
|
|
1886
|
+
onContextMenu: ct,
|
|
1824
1887
|
onClick: (e) => {
|
|
1825
|
-
|
|
1888
|
+
mt(e), Q(), Re();
|
|
1826
1889
|
},
|
|
1827
|
-
onDoubleClick:
|
|
1828
|
-
}), /* @__PURE__ */ r.createElement(
|
|
1829
|
-
show:
|
|
1830
|
-
position:
|
|
1890
|
+
onDoubleClick: bt
|
|
1891
|
+
}), /* @__PURE__ */ r.createElement(on, {
|
|
1892
|
+
show: j,
|
|
1893
|
+
position: I,
|
|
1831
1894
|
filtered: W,
|
|
1832
|
-
insertMention:
|
|
1895
|
+
insertMention: Je,
|
|
1833
1896
|
onClose: () => O(!1),
|
|
1834
1897
|
query: de
|
|
1835
1898
|
}), d && /* @__PURE__ */ r.createElement("div", {
|
|
1836
1899
|
className: `rte-output ${(v == null ? void 0 : v.output) || ""}`,
|
|
1837
1900
|
style: L.output
|
|
1838
|
-
}, /* @__PURE__ */ r.createElement("h4", null, "Output HTML:"), /* @__PURE__ */ r.createElement("p", null, A)), /* @__PURE__ */ r.createElement(
|
|
1839
|
-
visible:
|
|
1840
|
-
x:
|
|
1841
|
-
y:
|
|
1842
|
-
onAction:
|
|
1901
|
+
}, /* @__PURE__ */ r.createElement("h4", null, "Output HTML:"), /* @__PURE__ */ r.createElement("p", null, A)), /* @__PURE__ */ r.createElement(cn, {
|
|
1902
|
+
visible: P.visible,
|
|
1903
|
+
x: P.x,
|
|
1904
|
+
y: P.y,
|
|
1905
|
+
onAction: st,
|
|
1843
1906
|
onClose: () => {
|
|
1844
|
-
|
|
1907
|
+
B(ae(re({}, P), {
|
|
1845
1908
|
visible: !1
|
|
1846
|
-
})),
|
|
1909
|
+
})), Le(), xe();
|
|
1847
1910
|
}
|
|
1848
|
-
}), /* @__PURE__ */ r.createElement(
|
|
1911
|
+
}), /* @__PURE__ */ r.createElement(dn, {
|
|
1849
1912
|
visible: Y,
|
|
1850
|
-
linkData:
|
|
1851
|
-
onClose: () =>
|
|
1852
|
-
onInsert:
|
|
1853
|
-
})),
|
|
1913
|
+
linkData: Z,
|
|
1914
|
+
onClose: () => f(!1),
|
|
1915
|
+
onInsert: ut
|
|
1916
|
+
})), m ? /* @__PURE__ */ r.createElement(sn, {
|
|
1854
1917
|
className: v.preview,
|
|
1855
1918
|
style: L.preview,
|
|
1856
|
-
html:
|
|
1857
|
-
attributes:
|
|
1858
|
-
setAttributes:
|
|
1919
|
+
html: Lt(),
|
|
1920
|
+
attributes: pe,
|
|
1921
|
+
setAttributes: ve
|
|
1859
1922
|
}) : null);
|
|
1860
1923
|
};
|
|
1861
1924
|
export {
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1925
|
+
gn as RichTextEditor,
|
|
1926
|
+
sn as RtePreview,
|
|
1927
|
+
ln as RteToolbar
|
|
1865
1928
|
};
|