@ryzeup/richtexteditor 1.0.20 → 1.0.22
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 +751 -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 k, 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 ze(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 ? ze(Object(d), !0).forEach(function(m) {
|
|
68
|
+
Ct(r, m, d[m]);
|
|
69
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(d)) : ze(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);
|
|
133
|
+
}
|
|
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);
|
|
139
136
|
}
|
|
140
137
|
function zt(r) {
|
|
141
|
-
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);
|
|
142
139
|
}
|
|
143
140
|
function kt(r) {
|
|
144
|
-
return
|
|
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] = k(!1), [F, _] = k({
|
|
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
|
+
}, [z, D] = k({
|
|
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: z.bold ? "rte-active" : ""
|
|
378
|
+
}, /* @__PURE__ */ a.createElement(kt, 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: z.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: z.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: z.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: z.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: z.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: z.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: z.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: z.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: z.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: z.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,270 @@ 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: z.alignLeft ? "rte-active" : ""
|
|
526
|
+
}, /* @__PURE__ */ a.createElement(zt, 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: z.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: z.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: z.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] = k(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 ke(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(ke, null), " Delete row"), /* @__PURE__ */ a.createElement("button", {
|
|
684
|
+
onClick: () => m("deleteCol")
|
|
685
|
+
}, /* @__PURE__ */ a.createElement(ke, 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] = k(""), [R, M] = k(""), [E, x] = k(""), [L, A] = k("_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
|
-
|
|
771
|
+
function Ne(r) {
|
|
772
|
+
const s = /* @__PURE__ */ new Map();
|
|
773
|
+
return r.forEach((d) => {
|
|
774
|
+
s.set(d.name, d.value);
|
|
775
|
+
}), Array.from(s.entries()).map(([d, m]) => ({
|
|
776
|
+
name: d,
|
|
777
|
+
value: m
|
|
778
|
+
}));
|
|
754
779
|
}
|
|
755
|
-
const
|
|
780
|
+
const Yt = ({
|
|
756
781
|
atSuggestions: r = [],
|
|
757
|
-
showOutput:
|
|
782
|
+
showOutput: s = !1,
|
|
758
783
|
showPreview: d = !1,
|
|
759
|
-
toolbarConfig:
|
|
784
|
+
toolbarConfig: m = {
|
|
760
785
|
link: !1,
|
|
761
786
|
image: !1,
|
|
762
787
|
emoji: !1,
|
|
@@ -766,32 +791,32 @@ const Xt = ({
|
|
|
766
791
|
fontSize: !1,
|
|
767
792
|
highlight: !1
|
|
768
793
|
},
|
|
769
|
-
classNames:
|
|
794
|
+
classNames: p = {},
|
|
770
795
|
styles: w = {},
|
|
771
796
|
handleGetHtml: R = () => {
|
|
772
797
|
},
|
|
773
|
-
onChange:
|
|
798
|
+
onChange: M = () => {
|
|
774
799
|
},
|
|
775
|
-
value:
|
|
776
|
-
onMentionSelect:
|
|
800
|
+
value: E,
|
|
801
|
+
onMentionSelect: x = () => {
|
|
777
802
|
},
|
|
778
|
-
handleAddAttributes:
|
|
803
|
+
handleAddAttributes: L = () => {
|
|
779
804
|
}
|
|
780
805
|
}) => {
|
|
781
|
-
var
|
|
782
|
-
const
|
|
806
|
+
var ve, ye, Ee, we, Ce, be, Re, xe;
|
|
807
|
+
const A = V(null), [P, T] = k(E != null && E.length ? E : " "), [q, B] = k(""), [F, _] = k(!1), [U, Y] = k({
|
|
783
808
|
x: 0,
|
|
784
809
|
y: 0
|
|
785
|
-
}), [ee,
|
|
810
|
+
}), [ee, z] = k([]), D = V(null), $ = V(null), [O, h] = k({
|
|
786
811
|
visible: !1,
|
|
787
812
|
x: 0,
|
|
788
813
|
y: 0
|
|
789
|
-
}), [C,
|
|
814
|
+
}), [C, j] = k(!1), Z = V(null), [He, se] = k({
|
|
790
815
|
url: "",
|
|
791
816
|
text: "",
|
|
792
817
|
title: "",
|
|
793
818
|
target: "_self"
|
|
794
|
-
}),
|
|
819
|
+
}), Oe = {
|
|
795
820
|
bold: !0,
|
|
796
821
|
italic: !0,
|
|
797
822
|
underline: !0,
|
|
@@ -799,202 +824,190 @@ const Xt = ({
|
|
|
799
824
|
unorderedList: !0,
|
|
800
825
|
orderedList: !0,
|
|
801
826
|
align: !0,
|
|
802
|
-
link: (
|
|
803
|
-
image: (
|
|
804
|
-
emoji: (
|
|
805
|
-
table: (
|
|
806
|
-
color: (
|
|
807
|
-
fontFamily: (
|
|
808
|
-
fontSize: (
|
|
809
|
-
highlight: (
|
|
810
|
-
}, [
|
|
811
|
-
const e =
|
|
827
|
+
link: (ve = m.link) != null ? ve : !1,
|
|
828
|
+
image: (ye = m.image) != null ? ye : !1,
|
|
829
|
+
emoji: (Ee = m.emoji) != null ? Ee : !1,
|
|
830
|
+
table: (we = m.table) != null ? we : !1,
|
|
831
|
+
color: (Ce = m.color) != null ? Ce : !1,
|
|
832
|
+
fontFamily: (be = m.fontFamily) != null ? be : !1,
|
|
833
|
+
fontSize: (Re = m.fontSize) != null ? Re : !1,
|
|
834
|
+
highlight: (xe = m.fontSize) != null ? xe : !1
|
|
835
|
+
}, [_e, te] = k(""), [de, ne] = k([]), H = () => A.current, S = () => {
|
|
836
|
+
const e = je(), t = /^<div[^>]*style=["'][^"']*font-size\s*:\s*\d+px[^"']*["'][^>]*>/.test(e.trim());
|
|
812
837
|
let n = e;
|
|
813
|
-
t || (n = `<div style="font-size:12px">${e}</div>`),
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
838
|
+
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}>
|
|
839
|
+
<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);
|
|
840
|
+
const o = ot(e);
|
|
841
|
+
M(o);
|
|
842
|
+
const i = $e(), l = Ne(i);
|
|
843
|
+
JSON.stringify(l) !== JSON.stringify(de) && (ne(l), x(l));
|
|
844
|
+
}, je = () => {
|
|
845
|
+
const e = H();
|
|
846
|
+
if (!e) return P;
|
|
821
847
|
const t = e.cloneNode(!0);
|
|
822
|
-
t.querySelectorAll("table div").forEach((
|
|
848
|
+
t.querySelectorAll("table div").forEach((o) => o.remove()), t.querySelectorAll(".rte-cell-highlight").forEach((o) => o.classList.remove("rte-cell-highlight"));
|
|
823
849
|
let n = t.innerHTML;
|
|
824
|
-
return n =
|
|
825
|
-
},
|
|
850
|
+
return n = Ie(n), n;
|
|
851
|
+
}, Ie = (e) => e.replace(/<tbody[^>]*>/g, "<tbody>{{#arrayData}}").replace(/<\/tbody>/g, "{{/arrayData}}</tbody>"), W = () => {
|
|
826
852
|
const e = window.getSelection();
|
|
827
853
|
if (!e || e.rangeCount === 0) return;
|
|
828
854
|
const t = document.getElementById("rte-editor-body");
|
|
829
855
|
if (!t) return;
|
|
830
856
|
const n = e.getRangeAt(0);
|
|
831
|
-
t.contains(n.startContainer) && (
|
|
832
|
-
},
|
|
857
|
+
t.contains(n.startContainer) && (D.current = n.cloneRange());
|
|
858
|
+
}, K = () => {
|
|
833
859
|
const e = window.getSelection();
|
|
834
|
-
!e || !
|
|
835
|
-
},
|
|
860
|
+
!e || !D.current || (e.removeAllRanges(), e.addRange(D.current));
|
|
861
|
+
}, ue = (e, t) => {
|
|
836
862
|
const n = window.getSelection();
|
|
837
|
-
n && n.rangeCount > 0 && (
|
|
863
|
+
n && n.rangeCount > 0 && (D.current = n.getRangeAt(0)), K(), document.execCommand(e, !1, t), S();
|
|
838
864
|
};
|
|
839
865
|
I(() => {
|
|
840
|
-
const e =
|
|
841
|
-
if (!e || !
|
|
842
|
-
const t =
|
|
866
|
+
const e = H();
|
|
867
|
+
if (!e || !E) return;
|
|
868
|
+
const t = Fe(E);
|
|
843
869
|
e.innerHTML = t, S();
|
|
844
870
|
}, []);
|
|
845
|
-
const
|
|
871
|
+
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
872
|
I(() => () => {
|
|
847
873
|
document.removeEventListener("mousemove", null), document.removeEventListener("mouseup", null);
|
|
848
874
|
}, []), I(() => {
|
|
849
|
-
|
|
875
|
+
L && L((e) => {
|
|
850
876
|
Ve(e);
|
|
851
877
|
});
|
|
852
878
|
}, []), I(() => {
|
|
853
|
-
const e =
|
|
879
|
+
const e = H();
|
|
854
880
|
if (!e) return;
|
|
855
881
|
e.querySelectorAll("table").forEach((n) => {
|
|
856
|
-
|
|
882
|
+
n.dataset.hasResizeHandle !== "true" && (ae(n), n.querySelectorAll("th, td").forEach((i) => X(i)));
|
|
857
883
|
});
|
|
858
884
|
}, []);
|
|
859
|
-
const
|
|
885
|
+
const me = (e) => {
|
|
860
886
|
for (; e && e.nodeName !== "LI"; )
|
|
861
887
|
e = e.parentNode;
|
|
862
888
|
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) => {
|
|
889
|
+
}, ge = (e) => {
|
|
876
890
|
var v;
|
|
877
891
|
const t = window.getSelection();
|
|
878
892
|
if (!(t != null && t.rangeCount)) return;
|
|
879
|
-
const n = t.getRangeAt(0),
|
|
880
|
-
let
|
|
881
|
-
if (
|
|
882
|
-
let
|
|
883
|
-
|
|
893
|
+
const n = t.getRangeAt(0), o = me(n.startContainer);
|
|
894
|
+
let i, l;
|
|
895
|
+
if (o) {
|
|
896
|
+
let y = o.querySelector(e);
|
|
897
|
+
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
898
|
} else {
|
|
885
899
|
document.execCommand(e === "ul" ? "insertUnorderedList" : "insertOrderedList");
|
|
886
|
-
const
|
|
887
|
-
if (l =
|
|
888
|
-
|
|
900
|
+
const y = H();
|
|
901
|
+
if (l = y == null ? void 0 : y.querySelector(`${e}:last-child`), !l) return;
|
|
902
|
+
i = l.querySelector("li:last-child");
|
|
889
903
|
}
|
|
890
|
-
Pe(l);
|
|
891
904
|
const c = document.createRange();
|
|
892
|
-
c.setStart(
|
|
893
|
-
},
|
|
894
|
-
e === "insertOrderedList" ?
|
|
895
|
-
},
|
|
905
|
+
c.setStart(i, 0), c.collapse(!0), t.removeAllRanges(), t.addRange(c), (v = H()) == null || v.focus(), S();
|
|
906
|
+
}, re = (e, t) => {
|
|
907
|
+
e === "insertOrderedList" ? ge("ol") : e === "insertUnorderedList" ? ge("ul") : e.startsWith("justify") ? lt(e) : ue(e, t), e === "insertTable" && Ze();
|
|
908
|
+
}, Pe = (e) => {
|
|
896
909
|
const t = document.createElement("span");
|
|
897
910
|
t.textContent = "", e.insertNode(t), e.setStartAfter(t), e.collapse(!0);
|
|
898
911
|
const n = t.getBoundingClientRect();
|
|
899
|
-
t.remove(),
|
|
912
|
+
t.remove(), Y({
|
|
900
913
|
x: n.left,
|
|
901
914
|
y: n.bottom + window.scrollY
|
|
902
|
-
}),
|
|
903
|
-
},
|
|
915
|
+
}), z(r || []), _(!0), $.current = e.cloneRange();
|
|
916
|
+
}, qe = () => {
|
|
904
917
|
const e = window.getSelection();
|
|
905
918
|
if (!e || e.rangeCount === 0) return null;
|
|
906
919
|
const t = e.anchorNode;
|
|
907
920
|
let n = e.anchorOffset;
|
|
908
921
|
if (!t) return null;
|
|
909
|
-
let
|
|
910
|
-
for (
|
|
911
|
-
if (
|
|
912
|
-
const
|
|
922
|
+
let o = t;
|
|
923
|
+
for (o.nodeType !== Node.TEXT_NODE && (o.childNodes && o.childNodes[n] ? o = o.childNodes[n] : o = t.previousSibling); o; ) {
|
|
924
|
+
if (o.nodeType === Node.TEXT_NODE) {
|
|
925
|
+
const i = o.textContent || "", l = o === t ? n : i.length, c = i.lastIndexOf("@", l - 1);
|
|
913
926
|
if (c !== -1) {
|
|
914
927
|
const v = document.createRange();
|
|
915
|
-
return v.setStart(
|
|
928
|
+
return v.setStart(o, c), v.setEnd(o, l), v;
|
|
916
929
|
}
|
|
917
930
|
}
|
|
918
|
-
|
|
931
|
+
o = o.previousSibling;
|
|
919
932
|
}
|
|
920
933
|
return null;
|
|
921
|
-
},
|
|
934
|
+
}, Be = (e) => {
|
|
922
935
|
var l;
|
|
923
936
|
const t = window.getSelection();
|
|
924
937
|
if (!t) return;
|
|
925
|
-
const n =
|
|
926
|
-
n ? (t.removeAllRanges(), t.addRange(n)) :
|
|
927
|
-
const
|
|
928
|
-
|
|
938
|
+
const n = qe();
|
|
939
|
+
n ? (t.removeAllRanges(), t.addRange(n)) : $.current && (t.removeAllRanges(), t.addRange($.current));
|
|
940
|
+
const o = document.createElement("span");
|
|
941
|
+
o.textContent = `{{${e.name}}}`, o.style.display = "inline", o.setAttribute("data-mention", e.value || e.name || "");
|
|
929
942
|
try {
|
|
930
943
|
const c = t.rangeCount ? t.getRangeAt(0) : null;
|
|
931
944
|
if (c)
|
|
932
|
-
c.deleteContents(), c.insertNode(
|
|
945
|
+
c.deleteContents(), c.insertNode(o);
|
|
933
946
|
else {
|
|
934
|
-
const
|
|
935
|
-
|
|
947
|
+
const f = document.createRange(), u = H();
|
|
948
|
+
f.selectNodeContents(u), f.collapse(!1), f.insertNode(o);
|
|
936
949
|
}
|
|
937
950
|
const v = document.createTextNode(" ");
|
|
938
|
-
|
|
939
|
-
const
|
|
940
|
-
|
|
951
|
+
o.after(v);
|
|
952
|
+
const y = document.createRange();
|
|
953
|
+
y.setStartAfter(v), y.collapse(!0), t.removeAllRanges(), t.addRange(y);
|
|
941
954
|
} catch (c) {
|
|
942
955
|
console.error("insertMention error:", c);
|
|
943
956
|
}
|
|
944
|
-
let
|
|
945
|
-
|
|
957
|
+
let i = Ne([...de, e]);
|
|
958
|
+
ne(i), x(i), _(!1), (l = H()) == null || l.focus(), S();
|
|
946
959
|
}, Ue = (e) => {
|
|
947
|
-
const t =
|
|
960
|
+
const t = H();
|
|
948
961
|
if (!t) return;
|
|
949
962
|
let n = null;
|
|
950
|
-
|
|
951
|
-
const
|
|
952
|
-
if (!
|
|
953
|
-
|
|
954
|
-
const
|
|
955
|
-
|
|
963
|
+
D.current && t.contains(D.current.startContainer) ? n = D.current.cloneRange() : (n = document.createRange(), n.selectNodeContents(t), n.collapse(!1));
|
|
964
|
+
const o = window.getSelection();
|
|
965
|
+
if (!o) return;
|
|
966
|
+
o.removeAllRanges(), o.addRange(n);
|
|
967
|
+
const i = document.createElement("span");
|
|
968
|
+
i.textContent = `{{${e.name}}}`, i.style.display = "inline", i.setAttribute("data-mention", e.value || e.name), n.insertNode(i);
|
|
956
969
|
const l = document.createTextNode(" ");
|
|
957
|
-
|
|
970
|
+
i.after(l);
|
|
958
971
|
const c = document.createRange();
|
|
959
|
-
c.setStartAfter(l), c.collapse(!0),
|
|
972
|
+
c.setStartAfter(l), c.collapse(!0), o.removeAllRanges(), o.addRange(c), D.current = c.cloneRange(), t.focus();
|
|
960
973
|
}, Ve = (e) => {
|
|
961
|
-
e.forEach((t) => Ue(t)),
|
|
962
|
-
const n = [...t, ...e],
|
|
963
|
-
return
|
|
974
|
+
e.forEach((t) => Ue(t)), ne((t) => {
|
|
975
|
+
const n = [...t, ...e], o = Array.from(new Map(n.map((i) => [i.name, i])).values());
|
|
976
|
+
return x(o), o;
|
|
964
977
|
}), S();
|
|
965
978
|
}, $e = () => {
|
|
966
|
-
const e =
|
|
979
|
+
const e = H();
|
|
967
980
|
if (!e) return [];
|
|
968
981
|
const t = e.querySelectorAll("span[data-mention]"), n = [];
|
|
969
|
-
return t.forEach((
|
|
970
|
-
const
|
|
982
|
+
return t.forEach((o) => {
|
|
983
|
+
const i = o.getAttribute("data-mention") || "", c = (o.textContent || "").match(/{{(.+?)}}/);
|
|
971
984
|
c && n.push({
|
|
972
985
|
name: c[1],
|
|
973
|
-
value:
|
|
986
|
+
value: i
|
|
974
987
|
});
|
|
975
988
|
}), n;
|
|
976
989
|
}, We = (e) => {
|
|
977
|
-
var n,
|
|
990
|
+
var n, o, i;
|
|
978
991
|
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 ?
|
|
992
|
+
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") {
|
|
993
|
+
const l = window.getSelection(), c = l != null && l.anchorNode ? me(l.anchorNode) : null;
|
|
981
994
|
if (!c) return;
|
|
982
995
|
if (((n = c.textContent) == null ? void 0 : n.replace(/\u200B/g, "").trim()) === "") {
|
|
983
996
|
e.preventDefault();
|
|
984
|
-
const
|
|
985
|
-
if (
|
|
986
|
-
|
|
987
|
-
const
|
|
988
|
-
|
|
989
|
-
const
|
|
990
|
-
|
|
997
|
+
const y = c.parentElement, f = y == null ? void 0 : y.closest("li");
|
|
998
|
+
if (f) {
|
|
999
|
+
y == null || y.removeChild(c);
|
|
1000
|
+
const u = document.createElement("p");
|
|
1001
|
+
u.innerHTML = "<br />", (o = f.parentElement) == null || o.insertBefore(u, f.nextSibling);
|
|
1002
|
+
const g = document.createRange();
|
|
1003
|
+
g.setStart(u, 0), g.collapse(!0), l == null || l.removeAllRanges(), l == null || l.addRange(g);
|
|
991
1004
|
} else {
|
|
992
|
-
const
|
|
993
|
-
if (
|
|
994
|
-
const
|
|
995
|
-
|
|
996
|
-
const
|
|
997
|
-
|
|
1005
|
+
const u = c.closest("ul, ol");
|
|
1006
|
+
if (u) {
|
|
1007
|
+
const g = document.createElement("p");
|
|
1008
|
+
g.innerHTML = "<br />", (i = u.parentElement) == null || i.insertBefore(g, u.nextSibling), u.removeChild(c);
|
|
1009
|
+
const b = document.createRange();
|
|
1010
|
+
b.setStart(g, 0), b.collapse(!0), l == null || l.removeAllRanges(), l == null || l.addRange(b);
|
|
998
1011
|
}
|
|
999
1012
|
}
|
|
1000
1013
|
S();
|
|
@@ -1004,19 +1017,19 @@ const Xt = ({
|
|
|
1004
1017
|
if (e.data === "@") {
|
|
1005
1018
|
const n = window.getSelection();
|
|
1006
1019
|
if (!(n != null && n.rangeCount)) return;
|
|
1007
|
-
const
|
|
1008
|
-
if (
|
|
1020
|
+
const o = n.anchorNode;
|
|
1021
|
+
if (oe(o))
|
|
1009
1022
|
return;
|
|
1010
1023
|
setTimeout(() => {
|
|
1011
|
-
|
|
1024
|
+
Pe(n.getRangeAt(0)), te(""), z(r), _(!0);
|
|
1012
1025
|
}, 0);
|
|
1013
1026
|
return;
|
|
1014
1027
|
}
|
|
1015
|
-
if (
|
|
1016
|
-
setTimeout(() =>
|
|
1028
|
+
if (F) {
|
|
1029
|
+
setTimeout(() => fe(), 0);
|
|
1017
1030
|
return;
|
|
1018
1031
|
}
|
|
1019
|
-
},
|
|
1032
|
+
}, oe = (e) => {
|
|
1020
1033
|
if (!e) return !1;
|
|
1021
1034
|
let t = e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement;
|
|
1022
1035
|
for (; t; ) {
|
|
@@ -1024,83 +1037,90 @@ const Xt = ({
|
|
|
1024
1037
|
t = t.parentElement;
|
|
1025
1038
|
}
|
|
1026
1039
|
return !1;
|
|
1027
|
-
},
|
|
1028
|
-
|
|
1040
|
+
}, fe = () => {
|
|
1041
|
+
S();
|
|
1029
1042
|
const e = window.getSelection();
|
|
1030
1043
|
if (!e || !e.anchorNode) return;
|
|
1031
|
-
|
|
1044
|
+
if (oe(e.anchorNode)) {
|
|
1045
|
+
_(!1);
|
|
1046
|
+
return;
|
|
1047
|
+
}
|
|
1048
|
+
let t = e.anchorNode.textContent || "";
|
|
1049
|
+
t = t.replace(/\u00A0/g, " ");
|
|
1050
|
+
const n = t.match(/@([^\n]*)$/);
|
|
1032
1051
|
if (!n) {
|
|
1033
|
-
|
|
1052
|
+
_(!1);
|
|
1034
1053
|
return;
|
|
1035
1054
|
}
|
|
1036
|
-
const
|
|
1037
|
-
|
|
1038
|
-
const
|
|
1039
|
-
|
|
1040
|
-
},
|
|
1041
|
-
var
|
|
1042
|
-
const t = (
|
|
1055
|
+
const o = n[1].trim().toLowerCase();
|
|
1056
|
+
te(o);
|
|
1057
|
+
const i = r.filter((l) => l.name.toLowerCase().includes(o));
|
|
1058
|
+
i.length > 0 ? (z(i), _(!0)) : _(!1);
|
|
1059
|
+
}, Xe = (e) => {
|
|
1060
|
+
var o;
|
|
1061
|
+
const t = (o = e.target.files) == null ? void 0 : o[0];
|
|
1043
1062
|
if (!t) return;
|
|
1044
1063
|
const n = new FileReader();
|
|
1045
|
-
n.onload = (
|
|
1046
|
-
var
|
|
1047
|
-
const l = (
|
|
1048
|
-
|
|
1064
|
+
n.onload = (i) => {
|
|
1065
|
+
var b;
|
|
1066
|
+
const l = (b = i.target) == null ? void 0 : b.result;
|
|
1067
|
+
K();
|
|
1049
1068
|
const c = window.getSelection();
|
|
1050
1069
|
let v = c && c.rangeCount ? c.getRangeAt(0) : null;
|
|
1051
|
-
const
|
|
1052
|
-
|
|
1053
|
-
const
|
|
1054
|
-
if (!v || !
|
|
1055
|
-
|
|
1056
|
-
const
|
|
1057
|
-
|
|
1058
|
-
const
|
|
1059
|
-
|
|
1070
|
+
const y = document.createElement("img");
|
|
1071
|
+
y.src = l, y.alt = t.name || "image", y.className = "rte-inserted-image", y.contentEditable = "true";
|
|
1072
|
+
const f = H();
|
|
1073
|
+
if (!v || !f) {
|
|
1074
|
+
f == null || f.appendChild(y);
|
|
1075
|
+
const Le = document.createTextNode(" ");
|
|
1076
|
+
f == null || f.appendChild(Le);
|
|
1077
|
+
const le = document.createRange();
|
|
1078
|
+
le.setStartAfter(Le), le.collapse(!0), c == null || c.removeAllRanges(), c == null || c.addRange(le), f == null || f.focus(), S(), e.target.value = "";
|
|
1060
1079
|
return;
|
|
1061
1080
|
}
|
|
1062
|
-
v.deleteContents(), v.insertNode(
|
|
1063
|
-
const
|
|
1064
|
-
|
|
1065
|
-
const
|
|
1066
|
-
|
|
1081
|
+
v.deleteContents(), v.insertNode(y);
|
|
1082
|
+
const u = document.createTextNode(" ");
|
|
1083
|
+
y.after(u);
|
|
1084
|
+
const g = document.createRange();
|
|
1085
|
+
g.setStartAfter(u), g.collapse(!0), c.removeAllRanges(), c.addRange(g), f.focus(), S(), e.target.value = "";
|
|
1067
1086
|
}, n.readAsDataURL(t);
|
|
1068
|
-
},
|
|
1069
|
-
var
|
|
1070
|
-
|
|
1087
|
+
}, Ye = (e) => {
|
|
1088
|
+
var i;
|
|
1089
|
+
K();
|
|
1071
1090
|
const t = window.getSelection();
|
|
1072
1091
|
if (!(t != null && t.rangeCount)) return;
|
|
1073
|
-
const n = t.getRangeAt(0),
|
|
1074
|
-
n.insertNode(
|
|
1075
|
-
},
|
|
1076
|
-
var
|
|
1077
|
-
|
|
1092
|
+
const n = t.getRangeAt(0), o = document.createTextNode(e);
|
|
1093
|
+
n.insertNode(o), n.setStartAfter(o), n.collapse(!0), t.removeAllRanges(), t.addRange(n), (i = H()) == null || i.focus(), S();
|
|
1094
|
+
}, Ze = () => {
|
|
1095
|
+
var f;
|
|
1096
|
+
dt(), K();
|
|
1078
1097
|
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",
|
|
1098
|
+
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
1099
|
const t = document.createElement("thead");
|
|
1081
|
-
|
|
1100
|
+
p.thead && t.classList.add(p.thead);
|
|
1082
1101
|
const n = document.createElement("tbody");
|
|
1083
|
-
|
|
1084
|
-
const
|
|
1085
|
-
|
|
1086
|
-
const
|
|
1087
|
-
|
|
1088
|
-
for (let
|
|
1089
|
-
const
|
|
1090
|
-
|
|
1091
|
-
const
|
|
1092
|
-
|
|
1102
|
+
p.tbody && n.classList.add(p.tbody);
|
|
1103
|
+
const o = document.createElement("tr");
|
|
1104
|
+
p.tr && o.classList.add(p.tr);
|
|
1105
|
+
const i = document.createElement("tr");
|
|
1106
|
+
p.tr && i.classList.add(p.tr);
|
|
1107
|
+
for (let u = 0; u < 2; u++) {
|
|
1108
|
+
const g = document.createElement("th");
|
|
1109
|
+
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);
|
|
1110
|
+
const b = document.createElement("td");
|
|
1111
|
+
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
1112
|
}
|
|
1094
|
-
t.appendChild(
|
|
1113
|
+
t.appendChild(o), n.appendChild(i), e.appendChild(t), e.appendChild(n), ae(e);
|
|
1095
1114
|
const l = window.getSelection();
|
|
1096
1115
|
if (!(l != null && l.rangeCount)) return;
|
|
1097
1116
|
const c = l.getRangeAt(0);
|
|
1098
1117
|
c.collapse(!1), c.insertNode(e);
|
|
1099
1118
|
const v = document.createElement("p");
|
|
1100
1119
|
v.innerHTML = "<br/>", e.after(v);
|
|
1101
|
-
const
|
|
1102
|
-
|
|
1103
|
-
},
|
|
1120
|
+
const y = document.createRange();
|
|
1121
|
+
y.setStart(v, 0), y.collapse(!0), l.removeAllRanges(), l.addRange(y), (f = H()) == null || f.focus(), S();
|
|
1122
|
+
}, ae = (e) => {
|
|
1123
|
+
if (e.dataset.hasResizeHandle === "true") return;
|
|
1104
1124
|
const t = document.createElement("div");
|
|
1105
1125
|
Object.assign(t.style, {
|
|
1106
1126
|
position: "absolute",
|
|
@@ -1112,27 +1132,27 @@ const Xt = ({
|
|
|
1112
1132
|
cursor: "nwse-resize",
|
|
1113
1133
|
zIndex: "20",
|
|
1114
1134
|
borderRadius: "2px"
|
|
1115
|
-
}), t.style.userSelect = "none", t.contentEditable = "false";
|
|
1116
|
-
let n = 0,
|
|
1135
|
+
}), t.style.userSelect = "none", t.contentEditable = "false", t.dataset.hasResizeHandle = "true";
|
|
1136
|
+
let n = 0, o = 0, i = 0, l = 0;
|
|
1117
1137
|
t.addEventListener("mousedown", (c) => {
|
|
1118
|
-
c.preventDefault(), n = c.clientX,
|
|
1138
|
+
c.preventDefault(), n = c.clientX, o = c.clientY;
|
|
1119
1139
|
const v = e.getBoundingClientRect();
|
|
1120
|
-
|
|
1121
|
-
const
|
|
1122
|
-
const
|
|
1123
|
-
e.style.width = `${
|
|
1124
|
-
},
|
|
1125
|
-
document.removeEventListener("mousemove",
|
|
1140
|
+
i = v.width, l = v.height;
|
|
1141
|
+
const y = (u) => {
|
|
1142
|
+
const g = Math.max(100, i + (u.clientX - n)), b = Math.max(20, l + (u.clientY - o));
|
|
1143
|
+
e.style.width = `${g}px`, e.style.height = `${b}px`, S();
|
|
1144
|
+
}, f = () => {
|
|
1145
|
+
document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", f), S();
|
|
1126
1146
|
};
|
|
1127
|
-
document.addEventListener("mousemove",
|
|
1147
|
+
document.addEventListener("mousemove", y), document.addEventListener("mouseup", f);
|
|
1128
1148
|
}), e.appendChild(t);
|
|
1129
|
-
},
|
|
1149
|
+
}, X = (e) => {
|
|
1130
1150
|
const t = document.createElement("div"), n = document.createElement("div");
|
|
1131
1151
|
Object.assign(t.style, {
|
|
1132
1152
|
position: "absolute",
|
|
1133
1153
|
right: "0",
|
|
1134
1154
|
top: "0",
|
|
1135
|
-
width: "
|
|
1155
|
+
width: "4px",
|
|
1136
1156
|
height: "100%",
|
|
1137
1157
|
cursor: "col-resize",
|
|
1138
1158
|
background: "rgba(0,0,0,0.15)",
|
|
@@ -1147,7 +1167,7 @@ const Xt = ({
|
|
|
1147
1167
|
bottom: "0",
|
|
1148
1168
|
left: "0",
|
|
1149
1169
|
width: "100%",
|
|
1150
|
-
height: "
|
|
1170
|
+
height: "4px",
|
|
1151
1171
|
cursor: "row-resize",
|
|
1152
1172
|
background: "rgba(0,0,0,0.15)",
|
|
1153
1173
|
zIndex: "10",
|
|
@@ -1156,70 +1176,70 @@ const Xt = ({
|
|
|
1156
1176
|
MozUserSelect: "none",
|
|
1157
1177
|
msUserSelect: "none",
|
|
1158
1178
|
pointerEvents: "auto"
|
|
1159
|
-
}), n.contentEditable = "false",
|
|
1160
|
-
},
|
|
1161
|
-
let
|
|
1162
|
-
t.addEventListener("mousedown", (
|
|
1163
|
-
|
|
1164
|
-
}), n.addEventListener("mousedown", (
|
|
1165
|
-
|
|
1179
|
+
}), n.contentEditable = "false", Qe(e, t, n), e.appendChild(t), e.appendChild(n);
|
|
1180
|
+
}, Qe = (e, t, n) => {
|
|
1181
|
+
let o = 0, i = 0, l = 0, c = 0;
|
|
1182
|
+
t.addEventListener("mousedown", (u) => {
|
|
1183
|
+
u.preventDefault(), o = u.clientX, l = e.offsetWidth, document.addEventListener("mousemove", v), document.addEventListener("mouseup", f);
|
|
1184
|
+
}), n.addEventListener("mousedown", (u) => {
|
|
1185
|
+
u.preventDefault(), i = u.clientY, c = e.offsetHeight, document.addEventListener("mousemove", y), document.addEventListener("mouseup", f);
|
|
1166
1186
|
});
|
|
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",
|
|
1187
|
+
const v = (u) => {
|
|
1188
|
+
const g = l + (u.clientX - o);
|
|
1189
|
+
e.style.width = `${Math.max(30, g)}px`, S();
|
|
1190
|
+
}, y = (u) => {
|
|
1191
|
+
const g = c + (u.clientY - i);
|
|
1192
|
+
e.style.height = `${Math.max(20, g)}px`, S();
|
|
1193
|
+
}, f = () => {
|
|
1194
|
+
document.removeEventListener("mousemove", v), document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", f), S();
|
|
1175
1195
|
};
|
|
1176
|
-
},
|
|
1196
|
+
}, Je = (e) => {
|
|
1177
1197
|
const n = e.target.closest("td, th");
|
|
1178
|
-
n && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((
|
|
1198
|
+
n && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((o) => o.classList.remove("rte-cell-highlight")), n.classList.add("rte-cell-highlight"), h({
|
|
1179
1199
|
visible: !0,
|
|
1180
1200
|
x: e.clientX,
|
|
1181
1201
|
y: e.clientY,
|
|
1182
1202
|
cell: n
|
|
1183
1203
|
}));
|
|
1184
|
-
},
|
|
1204
|
+
}, he = () => {
|
|
1185
1205
|
document.querySelectorAll(".rte-cell-highlight").forEach((e) => e.classList.remove("rte-cell-highlight"));
|
|
1186
|
-
},
|
|
1187
|
-
if (!
|
|
1188
|
-
const t =
|
|
1206
|
+
}, Ge = (e) => {
|
|
1207
|
+
if (!O.cell) return;
|
|
1208
|
+
const t = O.cell.closest("table"), n = O.cell.cellIndex, o = O.cell.parentElement.rowIndex, i = (l) => {
|
|
1189
1209
|
const c = l.tagName.toLowerCase(), v = document.createElement(c);
|
|
1190
|
-
return v.textContent =
|
|
1210
|
+
return v.textContent = "", v.style.cssText = l.style.cssText, X(v), v;
|
|
1191
1211
|
};
|
|
1192
1212
|
switch (e) {
|
|
1193
1213
|
case "insertRowAbove": {
|
|
1194
|
-
const l = t.rows[
|
|
1214
|
+
const l = t.rows[o], c = t.insertRow(o);
|
|
1195
1215
|
Array.from(l.cells).forEach((v) => {
|
|
1196
|
-
c.appendChild(
|
|
1216
|
+
c.appendChild(i(v));
|
|
1197
1217
|
});
|
|
1198
1218
|
break;
|
|
1199
1219
|
}
|
|
1200
1220
|
case "insertRowBelow": {
|
|
1201
|
-
const l = t.rows[
|
|
1221
|
+
const l = t.rows[o], c = t.insertRow(o + 1);
|
|
1202
1222
|
Array.from(l.cells).forEach((v) => {
|
|
1203
|
-
c.appendChild(
|
|
1223
|
+
c.appendChild(i(v));
|
|
1204
1224
|
});
|
|
1205
1225
|
break;
|
|
1206
1226
|
}
|
|
1207
1227
|
case "insertColLeft": {
|
|
1208
1228
|
Array.from(t.rows).forEach((l) => {
|
|
1209
1229
|
const c = l.cells[n];
|
|
1210
|
-
l.insertBefore(
|
|
1230
|
+
l.insertBefore(i(c), c);
|
|
1211
1231
|
});
|
|
1212
1232
|
break;
|
|
1213
1233
|
}
|
|
1214
1234
|
case "insertColRight": {
|
|
1215
1235
|
Array.from(t.rows).forEach((l) => {
|
|
1216
1236
|
const c = l.cells[n];
|
|
1217
|
-
l.insertBefore(
|
|
1237
|
+
l.insertBefore(i(c), c.nextSibling);
|
|
1218
1238
|
});
|
|
1219
1239
|
break;
|
|
1220
1240
|
}
|
|
1221
1241
|
case "deleteRow":
|
|
1222
|
-
t.rows.length > 1 && t.deleteRow(
|
|
1242
|
+
t.rows.length > 1 && t.deleteRow(o);
|
|
1223
1243
|
break;
|
|
1224
1244
|
case "deleteCol":
|
|
1225
1245
|
Array.from(t.rows).forEach((l) => {
|
|
@@ -1227,31 +1247,31 @@ const Xt = ({
|
|
|
1227
1247
|
});
|
|
1228
1248
|
break;
|
|
1229
1249
|
}
|
|
1230
|
-
S(),
|
|
1250
|
+
S(), h(ie(ce({}, O), {
|
|
1231
1251
|
visible: !1
|
|
1232
|
-
})),
|
|
1233
|
-
},
|
|
1234
|
-
|
|
1252
|
+
})), he();
|
|
1253
|
+
}, et = () => {
|
|
1254
|
+
W(), Z.current = D.current, se({
|
|
1235
1255
|
url: "",
|
|
1236
1256
|
text: "",
|
|
1237
1257
|
title: "",
|
|
1238
1258
|
target: "_self"
|
|
1239
|
-
}),
|
|
1240
|
-
},
|
|
1259
|
+
}), j(!0);
|
|
1260
|
+
}, tt = (e) => {
|
|
1241
1261
|
const t = window.getSelection();
|
|
1242
|
-
if (!t || !
|
|
1243
|
-
t.removeAllRanges(), t.addRange(
|
|
1262
|
+
if (!t || !Z.current) return;
|
|
1263
|
+
t.removeAllRanges(), t.addRange(Z.current);
|
|
1244
1264
|
let n = e.url.trim();
|
|
1245
1265
|
/^https?:\/\//i.test(n) || (n = "https://" + n);
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1248
|
-
const
|
|
1249
|
-
|
|
1266
|
+
const o = document.createElement("a");
|
|
1267
|
+
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";
|
|
1268
|
+
const i = t.getRangeAt(0);
|
|
1269
|
+
i.deleteContents(), i.insertNode(o);
|
|
1250
1270
|
const l = document.createTextNode(" ");
|
|
1251
|
-
|
|
1271
|
+
o.after(l);
|
|
1252
1272
|
const c = document.createRange();
|
|
1253
|
-
c.setStartAfter(l), c.collapse(!0), t.removeAllRanges(), t.addRange(c),
|
|
1254
|
-
},
|
|
1273
|
+
c.setStartAfter(l), c.collapse(!0), t.removeAllRanges(), t.addRange(c), j(!1), S();
|
|
1274
|
+
}, nt = (e) => {
|
|
1255
1275
|
const t = e.target;
|
|
1256
1276
|
if (t.tagName === "A") {
|
|
1257
1277
|
const n = t;
|
|
@@ -1260,176 +1280,250 @@ const Xt = ({
|
|
|
1260
1280
|
return;
|
|
1261
1281
|
}
|
|
1262
1282
|
e.preventDefault();
|
|
1263
|
-
const
|
|
1264
|
-
|
|
1283
|
+
const o = document.createRange();
|
|
1284
|
+
o.selectNode(n), Z.current = o, se({
|
|
1265
1285
|
url: n.href,
|
|
1266
1286
|
text: n.textContent || n.href,
|
|
1267
1287
|
title: n.title,
|
|
1268
1288
|
target: n.target
|
|
1269
|
-
}),
|
|
1289
|
+
}), j(!0);
|
|
1270
1290
|
}
|
|
1271
|
-
},
|
|
1272
|
-
const e =
|
|
1291
|
+
}, rt = () => {
|
|
1292
|
+
const e = H();
|
|
1273
1293
|
if (!e) return;
|
|
1274
1294
|
const t = window.getSelection();
|
|
1275
|
-
if ((!t || t.rangeCount === 0) &&
|
|
1276
|
-
const
|
|
1277
|
-
|
|
1295
|
+
if ((!t || t.rangeCount === 0) && D.current) {
|
|
1296
|
+
const u = window.getSelection();
|
|
1297
|
+
u == null || u.removeAllRanges(), u == null || u.addRange(D.current);
|
|
1278
1298
|
}
|
|
1279
1299
|
const n = window.getSelection();
|
|
1280
1300
|
if (!n || n.rangeCount === 0) return;
|
|
1281
|
-
const
|
|
1282
|
-
|
|
1283
|
-
const
|
|
1284
|
-
l.appendChild(
|
|
1301
|
+
const o = n.getRangeAt(0);
|
|
1302
|
+
K(), document.execCommand("removeFormat", !1);
|
|
1303
|
+
const i = o.cloneContents(), l = document.createElement("div");
|
|
1304
|
+
l.appendChild(i);
|
|
1285
1305
|
const c = document.createTreeWalker(l, NodeFilter.SHOW_ELEMENT, null), v = [];
|
|
1286
1306
|
for (; c.nextNode(); ) {
|
|
1287
|
-
const
|
|
1288
|
-
|
|
1307
|
+
const u = c.currentNode, g = u.tagName.toUpperCase(), b = u.getAttribute && u.getAttribute("data-mention") !== null;
|
|
1308
|
+
g !== "A" && !b && v.push(u);
|
|
1289
1309
|
}
|
|
1290
|
-
for (let
|
|
1291
|
-
const
|
|
1292
|
-
if (
|
|
1293
|
-
for (;
|
|
1294
|
-
|
|
1310
|
+
for (let u = v.length - 1; u >= 0; u--) {
|
|
1311
|
+
const g = v[u], b = g.parentNode;
|
|
1312
|
+
if (b) {
|
|
1313
|
+
for (; g.firstChild; ) b.insertBefore(g.firstChild, g);
|
|
1314
|
+
b.removeChild(g);
|
|
1295
1315
|
}
|
|
1296
1316
|
}
|
|
1297
|
-
l.querySelectorAll("[style]").forEach((
|
|
1298
|
-
const
|
|
1299
|
-
for (; l.firstChild; )
|
|
1300
|
-
|
|
1301
|
-
const
|
|
1302
|
-
|
|
1317
|
+
l.querySelectorAll("[style]").forEach((u) => u.removeAttribute("style")), o.deleteContents();
|
|
1318
|
+
const y = document.createDocumentFragment();
|
|
1319
|
+
for (; l.firstChild; ) y.appendChild(l.firstChild);
|
|
1320
|
+
o.insertNode(y);
|
|
1321
|
+
const f = document.createRange();
|
|
1322
|
+
f.setStartAfter(o.endContainer.nodeType === Node.TEXT_NODE ? o.endContainer : o.startContainer), f.collapse(!0), n.removeAllRanges(), n.addRange(f), e.normalize(), S();
|
|
1303
1323
|
}, ot = (e) => {
|
|
1304
|
-
var
|
|
1324
|
+
var o;
|
|
1305
1325
|
let t = e;
|
|
1306
1326
|
t = t.replace(/{{#arrayData\d*}}/g, ""), t = t.replace(/{{\/arrayData\d*}}/g, "");
|
|
1307
1327
|
const n = document.createElement("div");
|
|
1308
|
-
return n.innerHTML = t, n.querySelectorAll("br").forEach((
|
|
1309
|
-
|
|
1328
|
+
return n.innerHTML = t, n.querySelectorAll("br").forEach((i) => {
|
|
1329
|
+
i.replaceWith(`
|
|
1310
1330
|
`);
|
|
1311
|
-
}), n.querySelectorAll("p, div, tr").forEach((
|
|
1312
|
-
|
|
1331
|
+
}), n.querySelectorAll("p, div, tr").forEach((i) => {
|
|
1332
|
+
i.insertAdjacentText("afterend", `
|
|
1313
1333
|
`);
|
|
1314
|
-
}), n.querySelectorAll("table").forEach((
|
|
1315
|
-
|
|
1334
|
+
}), n.querySelectorAll("table").forEach((i) => {
|
|
1335
|
+
i.insertAdjacentText("afterend", `
|
|
1316
1336
|
`);
|
|
1317
|
-
}), ((
|
|
1337
|
+
}), ((o = n.textContent) == null ? void 0 : o.replace(/\n{3,}/g, `
|
|
1318
1338
|
|
|
1319
1339
|
`).trim()) || "";
|
|
1320
1340
|
};
|
|
1321
|
-
function
|
|
1341
|
+
function at() {
|
|
1322
1342
|
const e = window.getSelection();
|
|
1323
1343
|
if (!e || e.rangeCount === 0) return [];
|
|
1324
|
-
const t = e.getRangeAt(0)
|
|
1325
|
-
|
|
1344
|
+
const t = e.getRangeAt(0);
|
|
1345
|
+
if (t.collapsed) {
|
|
1346
|
+
let l = t.startContainer, c = l.nodeType === Node.ELEMENT_NODE ? l : l.parentElement;
|
|
1347
|
+
const v = c == null ? void 0 : c.closest("td, th");
|
|
1348
|
+
return v ? [v] : [];
|
|
1349
|
+
}
|
|
1350
|
+
const n = t.commonAncestorContainer, o = n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement;
|
|
1351
|
+
return Array.from(o.querySelectorAll("td, th")).filter((l) => {
|
|
1326
1352
|
const c = document.createRange();
|
|
1327
1353
|
return c.selectNodeContents(l), t.compareBoundaryPoints(Range.END_TO_START, c) < 0 && t.compareBoundaryPoints(Range.START_TO_END, c) > 0;
|
|
1328
1354
|
});
|
|
1329
1355
|
}
|
|
1330
|
-
function
|
|
1331
|
-
const t =
|
|
1356
|
+
function lt(e) {
|
|
1357
|
+
const t = at();
|
|
1332
1358
|
if (t.length === 0) {
|
|
1333
|
-
|
|
1359
|
+
ue(e);
|
|
1334
1360
|
return;
|
|
1335
1361
|
}
|
|
1336
1362
|
let n = "left";
|
|
1337
|
-
e === "justifyCenter" && (n = "center"), e === "justifyRight" && (n = "right"), t.forEach((
|
|
1338
|
-
|
|
1363
|
+
e === "justifyCenter" && (n = "center"), e === "justifyRight" && (n = "right"), t.forEach((o) => {
|
|
1364
|
+
o.style.textAlign = n;
|
|
1339
1365
|
}), S();
|
|
1340
1366
|
}
|
|
1341
|
-
const
|
|
1367
|
+
const ct = (e) => {
|
|
1368
|
+
e.preventDefault();
|
|
1342
1369
|
const t = e.clipboardData.items;
|
|
1343
|
-
for (let
|
|
1344
|
-
const
|
|
1345
|
-
if (
|
|
1346
|
-
e.preventDefault();
|
|
1370
|
+
for (let f = 0; f < t.length; f++) {
|
|
1371
|
+
const u = t[f];
|
|
1372
|
+
if (u.kind === "file" && u.type.startsWith("image/"))
|
|
1347
1373
|
return;
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
/<img\s/i.test(s) && e.preventDefault();
|
|
1374
|
+
u.kind === "string" && u.getAsString((g) => {
|
|
1375
|
+
/<img\s/i.test(g);
|
|
1351
1376
|
});
|
|
1352
1377
|
}
|
|
1353
|
-
|
|
1354
|
-
|
|
1378
|
+
const n = e.clipboardData.getData("text/html") || "";
|
|
1379
|
+
if (!n) return;
|
|
1380
|
+
const o = document.createElement("div");
|
|
1381
|
+
o.innerHTML = n;
|
|
1382
|
+
const i = (f) => {
|
|
1383
|
+
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) => {
|
|
1384
|
+
const g = u;
|
|
1385
|
+
g.style.border = "1px solid #999", g.style.padding = "4px", g.style.position = "relative", g.style.backgroundColor = "lightgray", g.style.height = "20px";
|
|
1386
|
+
}), f.querySelectorAll("td").forEach((u) => {
|
|
1387
|
+
const g = u;
|
|
1388
|
+
g.style.border = "1px solid #999", g.style.padding = "4px", g.style.position = "relative", g.style.backgroundColor = "#fff", g.style.height = "20px";
|
|
1389
|
+
});
|
|
1390
|
+
};
|
|
1391
|
+
o.querySelectorAll("table").forEach((f) => i(f));
|
|
1392
|
+
const l = window.getSelection();
|
|
1393
|
+
if (!l || !l.rangeCount) return;
|
|
1394
|
+
const c = l.getRangeAt(0);
|
|
1395
|
+
c.deleteContents();
|
|
1396
|
+
const v = document.createDocumentFragment();
|
|
1397
|
+
for (; o.firstChild; ) v.appendChild(o.firstChild);
|
|
1398
|
+
c.insertNode(v), c.collapse(!1), l.removeAllRanges(), l.addRange(c);
|
|
1399
|
+
const y = A.current;
|
|
1400
|
+
y && (y.querySelectorAll("table").forEach((f) => {
|
|
1401
|
+
const u = f;
|
|
1402
|
+
u.dataset.hasResizeHandle !== "true" && (ae(u), u.dataset.hasResizeHandle = "true", u.querySelectorAll("th, td").forEach((g) => {
|
|
1403
|
+
const b = g;
|
|
1404
|
+
b.dataset.hasResizeHandles || X(b);
|
|
1405
|
+
}));
|
|
1406
|
+
}), S());
|
|
1407
|
+
}, it = (e) => {
|
|
1408
|
+
K();
|
|
1355
1409
|
const t = window.getSelection();
|
|
1356
1410
|
if (!t || !t.rangeCount) return;
|
|
1357
|
-
const n = t.getRangeAt(0),
|
|
1358
|
-
|
|
1359
|
-
const
|
|
1360
|
-
|
|
1411
|
+
const n = t.getRangeAt(0), o = document.createElement("span");
|
|
1412
|
+
o.style.fontSize = `${e}px`, o.appendChild(n.extractContents()), n.insertNode(o);
|
|
1413
|
+
const i = document.createRange();
|
|
1414
|
+
i.setStartAfter(o), i.collapse(!0), t.removeAllRanges(), t.addRange(i), S();
|
|
1415
|
+
}, st = () => {
|
|
1416
|
+
const e = window.getSelection();
|
|
1417
|
+
if (!e || !e.anchorNode) return null;
|
|
1418
|
+
const t = e.anchorNode;
|
|
1419
|
+
if (oe(t) || t.nodeType !== Node.TEXT_NODE) return null;
|
|
1420
|
+
const n = t.textContent || "", o = e.anchorOffset, i = n.lastIndexOf("@", o - 1);
|
|
1421
|
+
if (i === -1) return null;
|
|
1422
|
+
const l = n.substring(i + 1, o);
|
|
1423
|
+
if (l.includes(" ") || l.includes(" ")) return null;
|
|
1424
|
+
const c = document.createRange();
|
|
1425
|
+
return c.setStart(t, i), c.setEnd(t, o), {
|
|
1426
|
+
range: c,
|
|
1427
|
+
query: l
|
|
1428
|
+
};
|
|
1429
|
+
}, pe = () => {
|
|
1430
|
+
const e = st();
|
|
1431
|
+
if (!e) return;
|
|
1432
|
+
const {
|
|
1433
|
+
range: t,
|
|
1434
|
+
query: n
|
|
1435
|
+
} = e, o = document.createElement("span");
|
|
1436
|
+
o.textContent = "", t.insertNode(o);
|
|
1437
|
+
const i = o.getBoundingClientRect();
|
|
1438
|
+
o.remove(), Y({
|
|
1439
|
+
x: i.left,
|
|
1440
|
+
y: i.bottom + window.scrollY
|
|
1441
|
+
}), te(n.toLowerCase());
|
|
1442
|
+
const l = r.filter((c) => c.name.toLowerCase().includes(n.toLowerCase()));
|
|
1443
|
+
z(l), _(!0), $.current = t.cloneRange();
|
|
1361
1444
|
};
|
|
1362
|
-
|
|
1363
|
-
|
|
1445
|
+
function dt() {
|
|
1446
|
+
const e = A.current;
|
|
1447
|
+
if (!e) return;
|
|
1448
|
+
const t = window.getSelection();
|
|
1449
|
+
if (!t || t.rangeCount > 0 && e.contains(t.anchorNode))
|
|
1450
|
+
return;
|
|
1451
|
+
const n = document.createRange();
|
|
1452
|
+
n.selectNodeContents(e), n.collapse(!1), t.removeAllRanges(), t.addRange(n), D.current = n.cloneRange();
|
|
1453
|
+
}
|
|
1454
|
+
return /* @__PURE__ */ a.createElement("div", {
|
|
1455
|
+
className: `rte-wrapper ${(p == null ? void 0 : p.wrapper) || ""}`,
|
|
1364
1456
|
style: w.wrapper
|
|
1365
|
-
}, /* @__PURE__ */
|
|
1457
|
+
}, /* @__PURE__ */ a.createElement("div", {
|
|
1366
1458
|
style: {
|
|
1367
1459
|
flex: 1
|
|
1368
1460
|
}
|
|
1369
|
-
}, /* @__PURE__ */
|
|
1370
|
-
exec:
|
|
1371
|
-
saveSelection:
|
|
1372
|
-
handleFileChange:
|
|
1373
|
-
handleFontSizeChange: (e) =>
|
|
1374
|
-
handleFontFamilyChange: (e) =>
|
|
1375
|
-
insertEmoji:
|
|
1376
|
-
handleLink:
|
|
1377
|
-
removeFormatting:
|
|
1378
|
-
visibleActions:
|
|
1379
|
-
className:
|
|
1461
|
+
}, /* @__PURE__ */ a.createElement(qt, {
|
|
1462
|
+
exec: re,
|
|
1463
|
+
saveSelection: W,
|
|
1464
|
+
handleFileChange: Xe,
|
|
1465
|
+
handleFontSizeChange: (e) => it(e.target.value),
|
|
1466
|
+
handleFontFamilyChange: (e) => re("fontName", e.target.value),
|
|
1467
|
+
insertEmoji: Ye,
|
|
1468
|
+
handleLink: et,
|
|
1469
|
+
removeFormatting: rt,
|
|
1470
|
+
visibleActions: Oe,
|
|
1471
|
+
className: p.toolbar,
|
|
1380
1472
|
style: w.toolbar
|
|
1381
|
-
}), /* @__PURE__ */
|
|
1382
|
-
ref:
|
|
1473
|
+
}), /* @__PURE__ */ a.createElement("div", {
|
|
1474
|
+
ref: A,
|
|
1383
1475
|
id: "rte-editor-body",
|
|
1384
|
-
className: `rte-editor ${(
|
|
1476
|
+
className: `rte-editor ${(p == null ? void 0 : p.editor) || ""}`,
|
|
1385
1477
|
style: w.editor,
|
|
1386
1478
|
contentEditable: !0,
|
|
1387
1479
|
suppressContentEditableWarning: !0,
|
|
1388
|
-
onPaste:
|
|
1389
|
-
onKeyUp:
|
|
1390
|
-
|
|
1480
|
+
onPaste: ct,
|
|
1481
|
+
onKeyUp: () => {
|
|
1482
|
+
W(), pe();
|
|
1483
|
+
},
|
|
1484
|
+
onMouseUp: W,
|
|
1391
1485
|
onInput: () => {
|
|
1392
|
-
|
|
1486
|
+
fe(), W();
|
|
1393
1487
|
},
|
|
1394
1488
|
onKeyDown: We,
|
|
1395
1489
|
onBeforeInput: Ke,
|
|
1396
|
-
onContextMenu:
|
|
1490
|
+
onContextMenu: Je,
|
|
1397
1491
|
onClick: (e) => {
|
|
1398
|
-
|
|
1492
|
+
nt(e), W(), pe();
|
|
1399
1493
|
}
|
|
1400
|
-
}), /* @__PURE__ */
|
|
1401
|
-
show:
|
|
1402
|
-
position:
|
|
1494
|
+
}), /* @__PURE__ */ a.createElement(Bt, {
|
|
1495
|
+
show: F,
|
|
1496
|
+
position: U,
|
|
1403
1497
|
filtered: ee,
|
|
1404
|
-
insertMention:
|
|
1405
|
-
onClose: () =>
|
|
1406
|
-
query:
|
|
1407
|
-
}),
|
|
1408
|
-
className: `rte-output ${(
|
|
1498
|
+
insertMention: Be,
|
|
1499
|
+
onClose: () => _(!1),
|
|
1500
|
+
query: _e
|
|
1501
|
+
}), s && /* @__PURE__ */ a.createElement("div", {
|
|
1502
|
+
className: `rte-output ${(p == null ? void 0 : p.output) || ""}`,
|
|
1409
1503
|
style: w.output
|
|
1410
|
-
}, /* @__PURE__ */
|
|
1411
|
-
visible:
|
|
1412
|
-
x:
|
|
1413
|
-
y:
|
|
1414
|
-
onAction:
|
|
1504
|
+
}, /* @__PURE__ */ a.createElement("h4", null, "Output HTML:"), /* @__PURE__ */ a.createElement("p", null, q)), /* @__PURE__ */ a.createElement(Ut, {
|
|
1505
|
+
visible: O.visible,
|
|
1506
|
+
x: O.x,
|
|
1507
|
+
y: O.y,
|
|
1508
|
+
onAction: Ge,
|
|
1415
1509
|
onClose: () => {
|
|
1416
|
-
|
|
1510
|
+
h(ie(ce({}, O), {
|
|
1417
1511
|
visible: !1
|
|
1418
|
-
})),
|
|
1512
|
+
})), he();
|
|
1419
1513
|
}
|
|
1420
|
-
}), /* @__PURE__ */
|
|
1514
|
+
}), /* @__PURE__ */ a.createElement($t, {
|
|
1421
1515
|
visible: C,
|
|
1422
|
-
linkData:
|
|
1423
|
-
onClose: () =>
|
|
1424
|
-
onInsert:
|
|
1425
|
-
})), d ? /* @__PURE__ */
|
|
1426
|
-
className:
|
|
1516
|
+
linkData: He,
|
|
1517
|
+
onClose: () => j(!1),
|
|
1518
|
+
onInsert: tt
|
|
1519
|
+
})), d ? /* @__PURE__ */ a.createElement(Vt, {
|
|
1520
|
+
className: p.preview,
|
|
1427
1521
|
style: w.preview,
|
|
1428
|
-
html:
|
|
1522
|
+
html: q
|
|
1429
1523
|
}) : null);
|
|
1430
1524
|
};
|
|
1431
1525
|
export {
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1526
|
+
Yt as RichTextEditor,
|
|
1527
|
+
Vt as RtePreview,
|
|
1528
|
+
qt as RteToolbar
|
|
1435
1529
|
};
|