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