@ryzeup/richtexteditor 1.0.12 → 1.0.15
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 +448 -444
- package/dist/index.js +5 -5
- package/dist/index.umd.js +2 -2
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var ot = Object.defineProperty, lt = Object.defineProperties;
|
|
2
|
+
var ct = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var Le = Object.getOwnPropertySymbols;
|
|
4
|
+
var it = Object.prototype.hasOwnProperty, st = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Re = (r, c, d) => c in r ? ot(r, c, { enumerable: !0, configurable: !0, writable: !0, value: d }) : r[c] = d, ae = (r, c) => {
|
|
6
6
|
for (var d in c || (c = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var d of
|
|
10
|
-
|
|
7
|
+
it.call(c, d) && Re(r, d, c[d]);
|
|
8
|
+
if (Le)
|
|
9
|
+
for (var d of Le(c))
|
|
10
|
+
st.call(c, d) && Re(r, d, c[d]);
|
|
11
11
|
return r;
|
|
12
|
-
}, oe = (r, c) =>
|
|
13
|
-
import * as
|
|
14
|
-
import
|
|
15
|
-
import { createPortal as
|
|
16
|
-
window.React =
|
|
17
|
-
var
|
|
12
|
+
}, oe = (r, c) => lt(r, ct(c));
|
|
13
|
+
import * as dt from "react";
|
|
14
|
+
import o, { useRef as P, useState as S, useEffect as I } from "react";
|
|
15
|
+
import { createPortal as ut } from "react-dom";
|
|
16
|
+
window.React = dt;
|
|
17
|
+
var Ae = {
|
|
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
|
-
},
|
|
23
|
+
}, Se = o.createContext && /* @__PURE__ */ o.createContext(Ae), mt = ["attr", "size", "title"];
|
|
24
24
|
function ft(r, c) {
|
|
25
25
|
if (r == null) return {};
|
|
26
|
-
var d =
|
|
26
|
+
var d = gt(r, c), u, m;
|
|
27
27
|
if (Object.getOwnPropertySymbols) {
|
|
28
28
|
var y = Object.getOwnPropertySymbols(r);
|
|
29
29
|
for (m = 0; m < y.length; m++)
|
|
@@ -31,7 +31,7 @@ function ft(r, c) {
|
|
|
31
31
|
}
|
|
32
32
|
return d;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function gt(r, c) {
|
|
35
35
|
if (r == null) return {};
|
|
36
36
|
var d = {};
|
|
37
37
|
for (var u in r)
|
|
@@ -41,17 +41,17 @@ function ht(r, c) {
|
|
|
41
41
|
}
|
|
42
42
|
return d;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
return
|
|
44
|
+
function Q() {
|
|
45
|
+
return Q = Object.assign ? Object.assign.bind() : function(r) {
|
|
46
46
|
for (var c = 1; c < arguments.length; c++) {
|
|
47
47
|
var d = arguments[c];
|
|
48
48
|
for (var u in d)
|
|
49
49
|
Object.prototype.hasOwnProperty.call(d, u) && (r[u] = d[u]);
|
|
50
50
|
}
|
|
51
51
|
return r;
|
|
52
|
-
},
|
|
52
|
+
}, Q.apply(this, arguments);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function Me(r, c) {
|
|
55
55
|
var d = Object.keys(r);
|
|
56
56
|
if (Object.getOwnPropertySymbols) {
|
|
57
57
|
var u = Object.getOwnPropertySymbols(r);
|
|
@@ -61,25 +61,25 @@ function ze(r, c) {
|
|
|
61
61
|
}
|
|
62
62
|
return d;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function J(r) {
|
|
65
65
|
for (var c = 1; c < arguments.length; c++) {
|
|
66
66
|
var d = arguments[c] != null ? arguments[c] : {};
|
|
67
|
-
c % 2 ?
|
|
68
|
-
|
|
69
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(d)) :
|
|
67
|
+
c % 2 ? Me(Object(d), !0).forEach(function(u) {
|
|
68
|
+
ht(r, u, d[u]);
|
|
69
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(d)) : Me(Object(d)).forEach(function(u) {
|
|
70
70
|
Object.defineProperty(r, u, Object.getOwnPropertyDescriptor(d, u));
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
return r;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
return c =
|
|
75
|
+
function ht(r, c, d) {
|
|
76
|
+
return c = pt(c), c in r ? Object.defineProperty(r, c, { value: d, enumerable: !0, configurable: !0, writable: !0 }) : r[c] = d, r;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
var c =
|
|
78
|
+
function pt(r) {
|
|
79
|
+
var c = vt(r, "string");
|
|
80
80
|
return typeof c == "symbol" ? c : c + "";
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function vt(r, c) {
|
|
83
83
|
if (typeof r != "object" || !r) return r;
|
|
84
84
|
var d = r[Symbol.toPrimitive];
|
|
85
85
|
if (d !== void 0) {
|
|
@@ -89,85 +89,85 @@ function Et(r, c) {
|
|
|
89
89
|
}
|
|
90
90
|
return (c === "string" ? String : Number)(r);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
return r && r.map((c, d) => /* @__PURE__ */
|
|
92
|
+
function Ne(r) {
|
|
93
|
+
return r && r.map((c, d) => /* @__PURE__ */ o.createElement(c.tag, J({
|
|
94
94
|
key: d
|
|
95
|
-
}, c.attr),
|
|
95
|
+
}, c.attr), Ne(c.child)));
|
|
96
96
|
}
|
|
97
97
|
function M(r) {
|
|
98
|
-
return (c) => /* @__PURE__ */
|
|
99
|
-
attr:
|
|
100
|
-
}, c),
|
|
98
|
+
return (c) => /* @__PURE__ */ o.createElement(Et, Q({
|
|
99
|
+
attr: J({}, r.attr)
|
|
100
|
+
}, c), Ne(r.child));
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function Et(r) {
|
|
103
103
|
var c = (d) => {
|
|
104
104
|
var {
|
|
105
105
|
attr: u,
|
|
106
106
|
size: m,
|
|
107
107
|
title: y
|
|
108
|
-
} = r, R = ft(r,
|
|
109
|
-
return d.className && (E = d.className), r.className && (E = (E ? E + " " : "") + r.className), /* @__PURE__ */
|
|
108
|
+
} = r, R = ft(r, mt), b = m || d.size || "1em", E;
|
|
109
|
+
return d.className && (E = d.className), r.className && (E = (E ? E + " " : "") + r.className), /* @__PURE__ */ o.createElement("svg", Q({
|
|
110
110
|
stroke: "currentColor",
|
|
111
111
|
fill: "currentColor",
|
|
112
112
|
strokeWidth: "0"
|
|
113
113
|
}, d.attr, u, R, {
|
|
114
114
|
className: E,
|
|
115
|
-
style:
|
|
115
|
+
style: J(J({
|
|
116
116
|
color: r.color || d.color
|
|
117
117
|
}, d.style), r.style),
|
|
118
118
|
height: b,
|
|
119
119
|
width: b,
|
|
120
120
|
xmlns: "http://www.w3.org/2000/svg"
|
|
121
|
-
}), y && /* @__PURE__ */
|
|
121
|
+
}), y && /* @__PURE__ */ o.createElement("title", null, y), r.children);
|
|
122
122
|
};
|
|
123
|
-
return
|
|
123
|
+
return Se !== void 0 ? /* @__PURE__ */ o.createElement(Se.Consumer, null, (d) => c(d)) : c(Ae);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function yt(r) {
|
|
126
126
|
return M({ 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);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function wt(r) {
|
|
129
129
|
return M({ 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);
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function Ct(r) {
|
|
132
132
|
return M({ 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
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function bt(r) {
|
|
135
135
|
return M({ 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);
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function xt(r) {
|
|
138
138
|
return M({ 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
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function Lt(r) {
|
|
141
141
|
return M({ 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);
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function Rt(r) {
|
|
144
144
|
return M({ 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);
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function St(r) {
|
|
147
147
|
return M({ 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);
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function Mt(r) {
|
|
150
150
|
return M({ 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);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function zt(r) {
|
|
153
153
|
return M({ 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
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function kt(r) {
|
|
156
156
|
return M({ 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);
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function At(r) {
|
|
159
159
|
return M({ 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);
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function Nt(r) {
|
|
162
162
|
return M({ 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
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function Tt(r) {
|
|
165
165
|
return M({ 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
|
-
function
|
|
167
|
+
function Dt(r) {
|
|
168
168
|
return M({ 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
|
-
const
|
|
170
|
+
const Ot = [
|
|
171
171
|
"😀",
|
|
172
172
|
"😁",
|
|
173
173
|
"😂",
|
|
@@ -279,7 +279,7 @@ const Ht = [
|
|
|
279
279
|
"👏",
|
|
280
280
|
"🫶",
|
|
281
281
|
"👐"
|
|
282
|
-
],
|
|
282
|
+
], Ht = ({
|
|
283
283
|
exec: r,
|
|
284
284
|
saveSelection: c,
|
|
285
285
|
handleFileChange: d,
|
|
@@ -290,24 +290,24 @@ const Ht = [
|
|
|
290
290
|
handleLink: R,
|
|
291
291
|
removeFormatting: b,
|
|
292
292
|
visibleActions: E,
|
|
293
|
-
className:
|
|
293
|
+
className: O,
|
|
294
294
|
style: _
|
|
295
295
|
}) => {
|
|
296
|
-
var V,
|
|
297
|
-
const k =
|
|
296
|
+
var V, T;
|
|
297
|
+
const k = P(null), H = P(null), x = P(null), [G, $] = S(!1), [q, B] = S({
|
|
298
298
|
x: 0,
|
|
299
299
|
y: 0
|
|
300
300
|
});
|
|
301
|
-
|
|
302
|
-
const
|
|
303
|
-
!w.target.closest(".rte-emoji-popup") && !w.target.closest("button[title='Emoji']") &&
|
|
301
|
+
I(() => {
|
|
302
|
+
const g = (w) => {
|
|
303
|
+
!w.target.closest(".rte-emoji-popup") && !w.target.closest("button[title='Emoji']") && $(!1);
|
|
304
304
|
};
|
|
305
|
-
return document.addEventListener("mousedown",
|
|
305
|
+
return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
|
|
306
306
|
}, []);
|
|
307
|
-
const F = (
|
|
308
|
-
var
|
|
309
|
-
|
|
310
|
-
const w =
|
|
307
|
+
const F = (g) => {
|
|
308
|
+
var j;
|
|
309
|
+
g.preventDefault();
|
|
310
|
+
const w = g.currentTarget.dataset.command;
|
|
311
311
|
if (w)
|
|
312
312
|
switch (w) {
|
|
313
313
|
case "bold":
|
|
@@ -319,17 +319,17 @@ const Ht = [
|
|
|
319
319
|
r(w);
|
|
320
320
|
break;
|
|
321
321
|
case "insertImage": {
|
|
322
|
-
(
|
|
322
|
+
(j = k.current) == null || j.click();
|
|
323
323
|
break;
|
|
324
324
|
}
|
|
325
325
|
default:
|
|
326
326
|
console.warn("Unknown command:", w);
|
|
327
327
|
}
|
|
328
|
-
},
|
|
329
|
-
r("foreColor",
|
|
330
|
-
},
|
|
331
|
-
r("backColor",
|
|
332
|
-
}, [L,
|
|
328
|
+
}, ee = (g) => {
|
|
329
|
+
r("foreColor", g.target.value);
|
|
330
|
+
}, te = (g) => {
|
|
331
|
+
r("backColor", g.target.value);
|
|
332
|
+
}, [L, N] = S({
|
|
333
333
|
bold: !1,
|
|
334
334
|
italic: !1,
|
|
335
335
|
underline: !1,
|
|
@@ -346,9 +346,9 @@ const Ht = [
|
|
|
346
346
|
color: !1,
|
|
347
347
|
highlight: !1
|
|
348
348
|
});
|
|
349
|
-
return
|
|
350
|
-
const
|
|
351
|
-
|
|
349
|
+
return I(() => {
|
|
350
|
+
const g = () => {
|
|
351
|
+
N({
|
|
352
352
|
bold: document.queryCommandState("bold"),
|
|
353
353
|
italic: document.queryCommandState("italic"),
|
|
354
354
|
underline: document.queryCommandState("underline"),
|
|
@@ -366,53 +366,53 @@ const Ht = [
|
|
|
366
366
|
highlight: document.queryCommandState("backColor")
|
|
367
367
|
});
|
|
368
368
|
};
|
|
369
|
-
return document.addEventListener("selectionchange",
|
|
370
|
-
}, []), /* @__PURE__ */
|
|
371
|
-
className: `rte-toolbar ${
|
|
369
|
+
return document.addEventListener("selectionchange", g), () => document.removeEventListener("selectionchange", g);
|
|
370
|
+
}, []), /* @__PURE__ */ o.createElement("div", {
|
|
371
|
+
className: `rte-toolbar ${O || ""}`,
|
|
372
372
|
style: _
|
|
373
|
-
}, E.bold && /* @__PURE__ */
|
|
373
|
+
}, E.bold && /* @__PURE__ */ o.createElement("button", {
|
|
374
374
|
"data-command": "bold",
|
|
375
375
|
title: "Bold",
|
|
376
376
|
onMouseDown: F,
|
|
377
377
|
className: L.bold ? "rte-active" : ""
|
|
378
|
-
}, /* @__PURE__ */
|
|
378
|
+
}, /* @__PURE__ */ o.createElement(Lt, null)), E.italic && /* @__PURE__ */ o.createElement("button", {
|
|
379
379
|
"data-command": "italic",
|
|
380
380
|
title: "Italic",
|
|
381
381
|
onMouseDown: F,
|
|
382
382
|
className: L.italic ? "rte-active" : ""
|
|
383
|
-
}, /* @__PURE__ */
|
|
383
|
+
}, /* @__PURE__ */ o.createElement(St, null)), E.underline && /* @__PURE__ */ o.createElement("button", {
|
|
384
384
|
"data-command": "underline",
|
|
385
385
|
title: "Underline",
|
|
386
386
|
onMouseDown: F,
|
|
387
387
|
className: L.underline ? "rte-active" : ""
|
|
388
|
-
}, /* @__PURE__ */
|
|
388
|
+
}, /* @__PURE__ */ o.createElement(Nt, null)), E.unorderedList && /* @__PURE__ */ o.createElement("button", {
|
|
389
389
|
"data-command": "insertUnorderedList",
|
|
390
390
|
onMouseDown: F,
|
|
391
391
|
title: "UnorderedList",
|
|
392
392
|
className: L.unorderedList ? "rte-active" : ""
|
|
393
|
-
}, /* @__PURE__ */
|
|
393
|
+
}, /* @__PURE__ */ o.createElement(zt, null)), E.orderedList && /* @__PURE__ */ o.createElement("button", {
|
|
394
394
|
"data-command": "insertOrderedList",
|
|
395
395
|
title: "OrderedList",
|
|
396
396
|
onMouseDown: F,
|
|
397
397
|
className: L.orderedList ? "rte-active" : ""
|
|
398
|
-
}, /* @__PURE__ */
|
|
398
|
+
}, /* @__PURE__ */ o.createElement(bt, null)), E.link && /* @__PURE__ */ o.createElement("button", {
|
|
399
399
|
"data-command": "createLink",
|
|
400
400
|
title: "Link",
|
|
401
401
|
onClick: R,
|
|
402
402
|
className: L.link ? "rte-active" : ""
|
|
403
|
-
}, /* @__PURE__ */
|
|
403
|
+
}, /* @__PURE__ */ o.createElement(Mt, null)), E.removeFormat && /* @__PURE__ */ o.createElement("button", {
|
|
404
404
|
"data-command": "Remove format",
|
|
405
405
|
title: "removeFormat",
|
|
406
|
-
onMouseDown: (
|
|
407
|
-
|
|
406
|
+
onMouseDown: (g) => {
|
|
407
|
+
g.preventDefault(), c(), b();
|
|
408
408
|
},
|
|
409
409
|
className: L.removeFormat ? "rte-active" : ""
|
|
410
|
-
}, /* @__PURE__ */
|
|
410
|
+
}, /* @__PURE__ */ o.createElement(Dt, null)), E.image && /* @__PURE__ */ o.createElement("button", {
|
|
411
411
|
"data-command": "insertImage",
|
|
412
412
|
title: "Image",
|
|
413
413
|
onMouseDown: F,
|
|
414
414
|
className: L.image ? "rte-active" : ""
|
|
415
|
-
}, /* @__PURE__ */
|
|
415
|
+
}, /* @__PURE__ */ o.createElement(Ct, null)), /* @__PURE__ */ o.createElement("input", {
|
|
416
416
|
type: "file",
|
|
417
417
|
accept: "image/*",
|
|
418
418
|
ref: k,
|
|
@@ -420,63 +420,63 @@ const Ht = [
|
|
|
420
420
|
display: "none"
|
|
421
421
|
},
|
|
422
422
|
onChange: d
|
|
423
|
-
}), E.emoji && /* @__PURE__ */
|
|
423
|
+
}), E.emoji && /* @__PURE__ */ o.createElement("div", {
|
|
424
424
|
style: {
|
|
425
425
|
position: "relative"
|
|
426
426
|
}
|
|
427
|
-
}, /* @__PURE__ */
|
|
427
|
+
}, /* @__PURE__ */ o.createElement("button", {
|
|
428
428
|
title: "Emoji",
|
|
429
|
-
onMouseDown: (
|
|
430
|
-
|
|
431
|
-
const w =
|
|
429
|
+
onMouseDown: (g) => {
|
|
430
|
+
g.preventDefault(), c();
|
|
431
|
+
const w = g.currentTarget.getBoundingClientRect();
|
|
432
432
|
B({
|
|
433
433
|
x: w.left,
|
|
434
434
|
y: w.bottom + 8
|
|
435
435
|
// small spacing
|
|
436
|
-
}),
|
|
436
|
+
}), $((j) => !j);
|
|
437
437
|
},
|
|
438
438
|
className: L.emoji ? "rte-active" : ""
|
|
439
|
-
}, /* @__PURE__ */
|
|
439
|
+
}, /* @__PURE__ */ o.createElement(kt, null)), G && /* @__PURE__ */ ut(/* @__PURE__ */ o.createElement("div", {
|
|
440
440
|
className: "rte-emoji-popup",
|
|
441
441
|
style: {
|
|
442
442
|
top: q.y,
|
|
443
443
|
left: q.x
|
|
444
444
|
}
|
|
445
|
-
},
|
|
445
|
+
}, Ot.map((g, w) => /* @__PURE__ */ o.createElement("span", {
|
|
446
446
|
key: w,
|
|
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(), y(g), $(!1);
|
|
454
454
|
}
|
|
455
|
-
},
|
|
455
|
+
}, g))), document.body)), E.color && /* @__PURE__ */ o.createElement("div", {
|
|
456
456
|
style: {
|
|
457
457
|
position: "relative"
|
|
458
458
|
}
|
|
459
|
-
}, /* @__PURE__ */
|
|
459
|
+
}, /* @__PURE__ */ o.createElement("button", {
|
|
460
460
|
title: "Text Color",
|
|
461
|
-
onMouseDown: (
|
|
461
|
+
onMouseDown: (g) => {
|
|
462
462
|
var w;
|
|
463
|
-
|
|
463
|
+
g.preventDefault(), c(), (w = H.current) == null || w.click();
|
|
464
464
|
},
|
|
465
465
|
style: {
|
|
466
466
|
display: "flex",
|
|
467
467
|
alignItems: "center",
|
|
468
468
|
justifyContent: "center",
|
|
469
|
-
color: ((V =
|
|
469
|
+
color: ((V = H.current) == null ? void 0 : V.value) || "#000",
|
|
470
470
|
fontSize: "18px"
|
|
471
471
|
},
|
|
472
472
|
className: L.color ? "rte-active" : ""
|
|
473
|
-
}, /* @__PURE__ */
|
|
474
|
-
ref:
|
|
473
|
+
}, /* @__PURE__ */ o.createElement(Tt, null)), /* @__PURE__ */ o.createElement("input", {
|
|
474
|
+
ref: H,
|
|
475
475
|
type: "color",
|
|
476
476
|
defaultValue: "#000000",
|
|
477
|
-
onChange: (
|
|
477
|
+
onChange: (g) => {
|
|
478
478
|
var w;
|
|
479
|
-
|
|
479
|
+
ee(g), ((w = g.target.parentElement) == null ? void 0 : w.querySelector("button")).style.color = g.target.value;
|
|
480
480
|
},
|
|
481
481
|
style: {
|
|
482
482
|
position: "absolute",
|
|
@@ -485,30 +485,30 @@ const Ht = [
|
|
|
485
485
|
height: 0,
|
|
486
486
|
pointerEvents: "none"
|
|
487
487
|
}
|
|
488
|
-
})), E.highlight && /* @__PURE__ */
|
|
488
|
+
})), E.highlight && /* @__PURE__ */ o.createElement("div", {
|
|
489
489
|
style: {
|
|
490
490
|
position: "relative"
|
|
491
491
|
}
|
|
492
|
-
}, /* @__PURE__ */
|
|
492
|
+
}, /* @__PURE__ */ o.createElement("button", {
|
|
493
493
|
title: "Highlight",
|
|
494
|
-
onMouseDown: (
|
|
494
|
+
onMouseDown: (g) => {
|
|
495
495
|
var w;
|
|
496
|
-
|
|
496
|
+
g.preventDefault(), c(), (w = x.current) == null || w.click();
|
|
497
497
|
},
|
|
498
498
|
style: {
|
|
499
499
|
display: "flex",
|
|
500
500
|
alignItems: "center",
|
|
501
501
|
justifyContent: "center",
|
|
502
|
-
color: ((
|
|
502
|
+
color: ((T = x.current) == null ? void 0 : T.value) || "#000",
|
|
503
503
|
fontSize: "18px"
|
|
504
504
|
},
|
|
505
505
|
className: L.highlight ? "rte-active" : ""
|
|
506
|
-
}, /* @__PURE__ */
|
|
506
|
+
}, /* @__PURE__ */ o.createElement(Rt, null)), /* @__PURE__ */ o.createElement("input", {
|
|
507
507
|
ref: x,
|
|
508
508
|
type: "color",
|
|
509
|
-
onChange: (
|
|
509
|
+
onChange: (g) => {
|
|
510
510
|
var w;
|
|
511
|
-
|
|
511
|
+
te(g), ((w = g.target.parentElement) == null ? void 0 : w.querySelector("button")).style.color = g.target.value;
|
|
512
512
|
},
|
|
513
513
|
defaultValue: "#000000",
|
|
514
514
|
style: {
|
|
@@ -518,62 +518,62 @@ const Ht = [
|
|
|
518
518
|
height: 0,
|
|
519
519
|
pointerEvents: "none"
|
|
520
520
|
}
|
|
521
|
-
})), E.align && /* @__PURE__ */
|
|
521
|
+
})), E.align && /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("button", {
|
|
522
522
|
title: "Align Left",
|
|
523
|
-
onMouseDown: (
|
|
523
|
+
onMouseDown: (g) => g.preventDefault(),
|
|
524
524
|
onClick: () => r("justifyLeft"),
|
|
525
525
|
className: L.alignLeft ? "rte-active" : ""
|
|
526
|
-
}, /* @__PURE__ */
|
|
526
|
+
}, /* @__PURE__ */ o.createElement(xt, null)), /* @__PURE__ */ o.createElement("button", {
|
|
527
527
|
title: "Align Center",
|
|
528
|
-
onMouseDown: (
|
|
528
|
+
onMouseDown: (g) => g.preventDefault(),
|
|
529
529
|
onClick: () => r("justifyCenter"),
|
|
530
530
|
className: L.alignCenter ? "rte-active" : ""
|
|
531
|
-
}, /* @__PURE__ */
|
|
531
|
+
}, /* @__PURE__ */ o.createElement(yt, null)), /* @__PURE__ */ o.createElement("button", {
|
|
532
532
|
title: "Align Right",
|
|
533
|
-
onMouseDown: (
|
|
533
|
+
onMouseDown: (g) => g.preventDefault(),
|
|
534
534
|
onClick: () => r("justifyRight"),
|
|
535
535
|
className: L.alignRight ? "rte-active" : ""
|
|
536
|
-
}, /* @__PURE__ */
|
|
536
|
+
}, /* @__PURE__ */ o.createElement(wt, null))), E.table && /* @__PURE__ */ o.createElement("button", {
|
|
537
537
|
title: "Insert Table",
|
|
538
|
-
onMouseDown: (
|
|
538
|
+
onMouseDown: (g) => g.preventDefault(),
|
|
539
539
|
onClick: () => r("insertTable"),
|
|
540
540
|
className: L.table ? "rte-active" : ""
|
|
541
|
-
}, /* @__PURE__ */
|
|
541
|
+
}, /* @__PURE__ */ o.createElement(At, null)), E.fontFamily && /* @__PURE__ */ o.createElement("select", {
|
|
542
542
|
className: "rte-dropdown",
|
|
543
543
|
defaultValue: "",
|
|
544
544
|
onMouseDown: () => c(),
|
|
545
545
|
onChange: m
|
|
546
|
-
}, /* @__PURE__ */
|
|
546
|
+
}, /* @__PURE__ */ o.createElement("option", {
|
|
547
547
|
value: "",
|
|
548
548
|
disabled: !0
|
|
549
|
-
}, "Font Family"), /* @__PURE__ */
|
|
549
|
+
}, "Font Family"), /* @__PURE__ */ o.createElement("option", {
|
|
550
550
|
value: "Arial"
|
|
551
|
-
}, "Arial"), /* @__PURE__ */
|
|
551
|
+
}, "Arial"), /* @__PURE__ */ o.createElement("option", {
|
|
552
552
|
value: "Georgia"
|
|
553
|
-
}, "Georgia"), /* @__PURE__ */
|
|
553
|
+
}, "Georgia"), /* @__PURE__ */ o.createElement("option", {
|
|
554
554
|
value: "Times New Roman"
|
|
555
|
-
}, "Times New Roman"), /* @__PURE__ */
|
|
555
|
+
}, "Times New Roman"), /* @__PURE__ */ o.createElement("option", {
|
|
556
556
|
value: "Courier New"
|
|
557
|
-
}, "Courier New"), /* @__PURE__ */
|
|
557
|
+
}, "Courier New"), /* @__PURE__ */ o.createElement("option", {
|
|
558
558
|
value: "Verdana"
|
|
559
|
-
}, "Verdana")), E.fontSize && /* @__PURE__ */
|
|
559
|
+
}, "Verdana")), E.fontSize && /* @__PURE__ */ o.createElement("select", {
|
|
560
560
|
className: "rte-dropdown",
|
|
561
561
|
defaultValue: "",
|
|
562
562
|
onMouseDown: () => c(),
|
|
563
563
|
onChange: u
|
|
564
|
-
}, /* @__PURE__ */
|
|
564
|
+
}, /* @__PURE__ */ o.createElement("option", {
|
|
565
565
|
value: "",
|
|
566
566
|
disabled: !0
|
|
567
|
-
}, "Font Size"), /* @__PURE__ */
|
|
567
|
+
}, "Font Size"), /* @__PURE__ */ o.createElement("option", {
|
|
568
568
|
value: "2"
|
|
569
|
-
}, "Small "), /* @__PURE__ */
|
|
569
|
+
}, "Small "), /* @__PURE__ */ o.createElement("option", {
|
|
570
570
|
value: "3"
|
|
571
|
-
}, "Normal"), /* @__PURE__ */
|
|
571
|
+
}, "Normal"), /* @__PURE__ */ o.createElement("option", {
|
|
572
572
|
value: "4"
|
|
573
|
-
}, "Medium"), /* @__PURE__ */
|
|
573
|
+
}, "Medium"), /* @__PURE__ */ o.createElement("option", {
|
|
574
574
|
value: "5"
|
|
575
575
|
}, "Large")));
|
|
576
|
-
},
|
|
576
|
+
}, jt = ({
|
|
577
577
|
show: r,
|
|
578
578
|
position: c,
|
|
579
579
|
filtered: d,
|
|
@@ -581,15 +581,15 @@ const Ht = [
|
|
|
581
581
|
onClose: m,
|
|
582
582
|
query: y
|
|
583
583
|
}) => {
|
|
584
|
-
const R =
|
|
585
|
-
return
|
|
584
|
+
const R = P(null);
|
|
585
|
+
return I(() => {
|
|
586
586
|
const b = (E) => {
|
|
587
587
|
R.current && !R.current.contains(E.target) && m();
|
|
588
588
|
};
|
|
589
589
|
return r && document.addEventListener("mousedown", b), () => {
|
|
590
590
|
document.removeEventListener("mousedown", b);
|
|
591
591
|
};
|
|
592
|
-
}, [r, m]), r ? /* @__PURE__ */
|
|
592
|
+
}, [r, m]), r ? /* @__PURE__ */ o.createElement("ul", {
|
|
593
593
|
ref: R,
|
|
594
594
|
className: "rte-popup",
|
|
595
595
|
style: {
|
|
@@ -600,13 +600,13 @@ const Ht = [
|
|
|
600
600
|
name: b,
|
|
601
601
|
value: E
|
|
602
602
|
}) => {
|
|
603
|
-
const
|
|
604
|
-
let
|
|
603
|
+
const O = b.toLowerCase(), _ = y.toLowerCase(), k = O.indexOf(_);
|
|
604
|
+
let H = b;
|
|
605
605
|
if (k !== -1 && y.length > 0) {
|
|
606
606
|
const x = k + y.length;
|
|
607
|
-
|
|
607
|
+
H = b.substring(0, k) + `<span class="rte-highlight">${b.substring(k, x)}</span>` + b.substring(x);
|
|
608
608
|
}
|
|
609
|
-
return /* @__PURE__ */
|
|
609
|
+
return /* @__PURE__ */ o.createElement("li", {
|
|
610
610
|
key: E,
|
|
611
611
|
onMouseDown: (x) => {
|
|
612
612
|
x.preventDefault(), u({
|
|
@@ -620,25 +620,25 @@ const Ht = [
|
|
|
620
620
|
fontSize: "14px"
|
|
621
621
|
},
|
|
622
622
|
dangerouslySetInnerHTML: {
|
|
623
|
-
__html:
|
|
623
|
+
__html: H
|
|
624
624
|
},
|
|
625
625
|
onMouseEnter: (x) => x.currentTarget.style.background = "#f0f0f0",
|
|
626
626
|
onMouseLeave: (x) => x.currentTarget.style.background = "#fff"
|
|
627
627
|
});
|
|
628
|
-
}) : /* @__PURE__ */
|
|
628
|
+
}) : /* @__PURE__ */ o.createElement("li", {
|
|
629
629
|
style: {
|
|
630
630
|
padding: "6px 12px",
|
|
631
631
|
color: "#999"
|
|
632
632
|
}
|
|
633
633
|
}, "No matches")) : null;
|
|
634
634
|
};
|
|
635
|
-
function
|
|
635
|
+
function ze(r) {
|
|
636
636
|
return M({ 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);
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function Z(r) {
|
|
639
639
|
return M({ 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);
|
|
640
640
|
}
|
|
641
|
-
const
|
|
641
|
+
const _t = ({
|
|
642
642
|
visible: r,
|
|
643
643
|
x: c,
|
|
644
644
|
y: d,
|
|
@@ -650,24 +650,24 @@ const Ft = ({
|
|
|
650
650
|
top: d,
|
|
651
651
|
left: c
|
|
652
652
|
};
|
|
653
|
-
return /* @__PURE__ */
|
|
653
|
+
return /* @__PURE__ */ o.createElement("div", {
|
|
654
654
|
style: y,
|
|
655
655
|
className: "rte-table-menu",
|
|
656
656
|
onMouseLeave: m
|
|
657
|
-
}, /* @__PURE__ */
|
|
657
|
+
}, /* @__PURE__ */ o.createElement("button", {
|
|
658
658
|
onClick: () => u("insertRowAbove")
|
|
659
|
-
}, /* @__PURE__ */
|
|
659
|
+
}, /* @__PURE__ */ o.createElement(Z, null), " Insert row above"), /* @__PURE__ */ o.createElement("button", {
|
|
660
660
|
onClick: () => u("insertRowBelow")
|
|
661
|
-
}, /* @__PURE__ */
|
|
661
|
+
}, /* @__PURE__ */ o.createElement(Z, null), " Insert row below"), /* @__PURE__ */ o.createElement("button", {
|
|
662
662
|
onClick: () => u("insertColLeft")
|
|
663
|
-
}, /* @__PURE__ */
|
|
663
|
+
}, /* @__PURE__ */ o.createElement(Z, null), " Insert col left"), /* @__PURE__ */ o.createElement("button", {
|
|
664
664
|
onClick: () => u("insertColRight")
|
|
665
|
-
}, /* @__PURE__ */
|
|
665
|
+
}, /* @__PURE__ */ o.createElement(Z, null), " Insert col right"), /* @__PURE__ */ o.createElement("button", {
|
|
666
666
|
onClick: () => u("deleteRow")
|
|
667
|
-
}, /* @__PURE__ */
|
|
667
|
+
}, /* @__PURE__ */ o.createElement(ze, null), " Delete row"), /* @__PURE__ */ o.createElement("button", {
|
|
668
668
|
onClick: () => u("deleteCol")
|
|
669
|
-
}, /* @__PURE__ */
|
|
670
|
-
},
|
|
669
|
+
}, /* @__PURE__ */ o.createElement(ze, null), " Delete column"));
|
|
670
|
+
}, Ft = ({
|
|
671
671
|
html: r,
|
|
672
672
|
className: c,
|
|
673
673
|
style: d
|
|
@@ -680,7 +680,7 @@ const Ft = ({
|
|
|
680
680
|
b && window.open(b, "_blank", "noopener,noreferrer");
|
|
681
681
|
}
|
|
682
682
|
}, m = (y) => y.replace(/{{\s*(.*?)\s*}}/g, "$1");
|
|
683
|
-
return /* @__PURE__ */
|
|
683
|
+
return /* @__PURE__ */ o.createElement("div", {
|
|
684
684
|
className: `rte-preview ${c || ""}`,
|
|
685
685
|
style: d,
|
|
686
686
|
onClick: u,
|
|
@@ -694,11 +694,11 @@ const Ft = ({
|
|
|
694
694
|
onClose: d,
|
|
695
695
|
onInsert: u
|
|
696
696
|
}) => {
|
|
697
|
-
const [m, y] = S(""), [R, b] = S(""), [E,
|
|
698
|
-
if (
|
|
699
|
-
r ? (y(c.url || ""), b(c.text || ""),
|
|
697
|
+
const [m, y] = S(""), [R, b] = S(""), [E, O] = S(""), [_, k] = S("_self");
|
|
698
|
+
if (I(() => {
|
|
699
|
+
r ? (y(c.url || ""), b(c.text || ""), O(c.title || ""), k(c.target || "_self")) : (y(""), b(""), O(""), k("_self"));
|
|
700
700
|
}, [r, c]), !r) return null;
|
|
701
|
-
const
|
|
701
|
+
const H = () => {
|
|
702
702
|
u({
|
|
703
703
|
url: m,
|
|
704
704
|
text: R,
|
|
@@ -706,53 +706,53 @@ const Ft = ({
|
|
|
706
706
|
target: _
|
|
707
707
|
});
|
|
708
708
|
};
|
|
709
|
-
return /* @__PURE__ */
|
|
709
|
+
return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("div", {
|
|
710
710
|
className: "rte-link-modal-overlay",
|
|
711
711
|
onClick: d
|
|
712
|
-
}), /* @__PURE__ */
|
|
712
|
+
}), /* @__PURE__ */ o.createElement("div", {
|
|
713
713
|
className: "rte-link-modal"
|
|
714
|
-
}, /* @__PURE__ */
|
|
714
|
+
}, /* @__PURE__ */ o.createElement("h4", {
|
|
715
715
|
className: "rte-link-modal__title"
|
|
716
|
-
}, m ? "Edit Link" : "Insert Link"), /* @__PURE__ */
|
|
716
|
+
}, m ? "Edit Link" : "Insert Link"), /* @__PURE__ */ o.createElement("input", {
|
|
717
717
|
type: "text",
|
|
718
718
|
className: "rte-link-modal__input",
|
|
719
719
|
placeholder: "URL",
|
|
720
720
|
value: m,
|
|
721
721
|
onChange: (x) => y(x.target.value)
|
|
722
|
-
}), /* @__PURE__ */
|
|
722
|
+
}), /* @__PURE__ */ o.createElement("input", {
|
|
723
723
|
type: "text",
|
|
724
724
|
className: "rte-link-modal__input",
|
|
725
725
|
placeholder: "Text to Display",
|
|
726
726
|
value: R,
|
|
727
727
|
onChange: (x) => b(x.target.value)
|
|
728
|
-
}), /* @__PURE__ */
|
|
728
|
+
}), /* @__PURE__ */ o.createElement("input", {
|
|
729
729
|
type: "text",
|
|
730
730
|
className: "rte-link-modal__input",
|
|
731
731
|
placeholder: "Title",
|
|
732
732
|
value: E,
|
|
733
|
-
onChange: (x) =>
|
|
734
|
-
}), /* @__PURE__ */
|
|
733
|
+
onChange: (x) => O(x.target.value)
|
|
734
|
+
}), /* @__PURE__ */ o.createElement("select", {
|
|
735
735
|
className: "rte-link-modal__select",
|
|
736
736
|
value: _,
|
|
737
737
|
onChange: (x) => k(x.target.value)
|
|
738
|
-
}, /* @__PURE__ */
|
|
738
|
+
}, /* @__PURE__ */ o.createElement("option", {
|
|
739
739
|
value: "_self"
|
|
740
|
-
}, "Same tab"), /* @__PURE__ */
|
|
740
|
+
}, "Same tab"), /* @__PURE__ */ o.createElement("option", {
|
|
741
741
|
value: "_blank"
|
|
742
|
-
}, "New tab")), /* @__PURE__ */
|
|
742
|
+
}, "New tab")), /* @__PURE__ */ o.createElement("div", {
|
|
743
743
|
className: "rte-link-modal__actions"
|
|
744
|
-
}, /* @__PURE__ */
|
|
744
|
+
}, /* @__PURE__ */ o.createElement("button", {
|
|
745
745
|
className: "rte-link-modal__btn",
|
|
746
746
|
onClick: d
|
|
747
|
-
}, "Cancel"), /* @__PURE__ */
|
|
747
|
+
}, "Cancel"), /* @__PURE__ */ o.createElement("button", {
|
|
748
748
|
className: "rte-link-modal__btn rte-link-modal__btn--ok",
|
|
749
|
-
onClick:
|
|
749
|
+
onClick: H
|
|
750
750
|
}, "OK"))));
|
|
751
751
|
};
|
|
752
|
-
function
|
|
752
|
+
function ke(r) {
|
|
753
753
|
return Array.from(new Map(r.map((c) => [c.value, c])).values());
|
|
754
754
|
}
|
|
755
|
-
const
|
|
755
|
+
const Vt = ({
|
|
756
756
|
atSuggestions: r = [],
|
|
757
757
|
showOutput: c = !1,
|
|
758
758
|
showPreview: d = !1,
|
|
@@ -773,25 +773,25 @@ const $t = ({
|
|
|
773
773
|
onChange: b = () => {
|
|
774
774
|
},
|
|
775
775
|
value: E,
|
|
776
|
-
onMentionSelect:
|
|
776
|
+
onMentionSelect: O = () => {
|
|
777
777
|
},
|
|
778
778
|
handleAddAttributes: _ = () => {
|
|
779
779
|
}
|
|
780
780
|
}) => {
|
|
781
|
-
var pe, ve, Ee, ye, we, Ce, be
|
|
782
|
-
const k =
|
|
781
|
+
var he, pe, ve, Ee, ye, we, Ce, be;
|
|
782
|
+
const k = P(null), [H, x] = S(E != null && E.length ? E : " "), [G, $] = S(""), [q, B] = S(!1), [F, ee] = S({
|
|
783
783
|
x: 0,
|
|
784
784
|
y: 0
|
|
785
|
-
}), [
|
|
785
|
+
}), [te, L] = S([]), N = P(null), V = P(null), [T, g] = S({
|
|
786
786
|
visible: !1,
|
|
787
787
|
x: 0,
|
|
788
788
|
y: 0
|
|
789
|
-
}), [w,
|
|
789
|
+
}), [w, j] = S(!1), K = P(null), [Te, le] = S({
|
|
790
790
|
url: "",
|
|
791
791
|
text: "",
|
|
792
792
|
title: "",
|
|
793
793
|
target: "_self"
|
|
794
|
-
}),
|
|
794
|
+
}), De = {
|
|
795
795
|
bold: !0,
|
|
796
796
|
italic: !0,
|
|
797
797
|
underline: !0,
|
|
@@ -799,88 +799,92 @@ const $t = ({
|
|
|
799
799
|
unorderedList: !0,
|
|
800
800
|
orderedList: !0,
|
|
801
801
|
align: !0,
|
|
802
|
-
link: (
|
|
803
|
-
image: (
|
|
804
|
-
emoji: (
|
|
805
|
-
table: (
|
|
806
|
-
color: (
|
|
807
|
-
fontFamily: (
|
|
808
|
-
fontSize: (
|
|
809
|
-
highlight: (
|
|
810
|
-
}, [
|
|
811
|
-
const e =
|
|
812
|
-
|
|
813
|
-
const t =
|
|
802
|
+
link: (he = u.link) != null ? he : !1,
|
|
803
|
+
image: (pe = u.image) != null ? pe : !1,
|
|
804
|
+
emoji: (ve = u.emoji) != null ? ve : !1,
|
|
805
|
+
table: (Ee = u.table) != null ? Ee : !1,
|
|
806
|
+
color: (ye = u.color) != null ? ye : !1,
|
|
807
|
+
fontFamily: (we = u.fontFamily) != null ? we : !1,
|
|
808
|
+
fontSize: (Ce = u.fontSize) != null ? Ce : !1,
|
|
809
|
+
highlight: (be = u.fontSize) != null ? be : !1
|
|
810
|
+
}, [Oe, ce] = S(""), [ie, ne] = S([]), D = () => k.current, z = () => {
|
|
811
|
+
const e = ge();
|
|
812
|
+
$(e), R == null || R(e);
|
|
813
|
+
const t = at(e);
|
|
814
814
|
b(t);
|
|
815
|
-
const n =
|
|
816
|
-
JSON.stringify(
|
|
817
|
-
},
|
|
815
|
+
const n = Ve(), a = ke(n);
|
|
816
|
+
JSON.stringify(a) !== JSON.stringify(ie) && (ne(a), O(a));
|
|
817
|
+
}, U = () => {
|
|
818
818
|
const e = window.getSelection();
|
|
819
|
-
!e || e.rangeCount === 0
|
|
820
|
-
|
|
819
|
+
if (!e || e.rangeCount === 0) return;
|
|
820
|
+
const t = document.getElementById("rte-editor-body");
|
|
821
|
+
if (!t) return;
|
|
822
|
+
const n = e.getRangeAt(0);
|
|
823
|
+
t.contains(n.startContainer) && (N.current = n.cloneRange());
|
|
824
|
+
}, W = () => {
|
|
821
825
|
const e = window.getSelection();
|
|
822
|
-
e
|
|
823
|
-
},
|
|
826
|
+
!e || !N.current || (e.removeAllRanges(), e.addRange(N.current));
|
|
827
|
+
}, He = (e, t) => {
|
|
824
828
|
const n = window.getSelection();
|
|
825
|
-
n && n.rangeCount > 0 && (
|
|
829
|
+
n && n.rangeCount > 0 && (N.current = n.getRangeAt(0)), W(), document.execCommand(e, !1, t), z();
|
|
826
830
|
};
|
|
827
|
-
|
|
828
|
-
const e =
|
|
829
|
-
e && !e.innerHTML && (e.innerHTML =
|
|
830
|
-
}, []),
|
|
831
|
+
I(() => {
|
|
832
|
+
const e = D();
|
|
833
|
+
e && !e.innerHTML && (e.innerHTML = H), z();
|
|
834
|
+
}, []), I(() => () => {
|
|
831
835
|
document.removeEventListener("mousemove", null), document.removeEventListener("mouseup", null);
|
|
832
|
-
}, []),
|
|
836
|
+
}, []), I(() => {
|
|
833
837
|
_ && _((e) => {
|
|
834
|
-
|
|
838
|
+
qe(e);
|
|
835
839
|
});
|
|
836
|
-
}, []),
|
|
837
|
-
const e =
|
|
840
|
+
}, []), I(() => {
|
|
841
|
+
const e = D();
|
|
838
842
|
if (!e) return;
|
|
839
843
|
e.querySelectorAll("table").forEach((n) => {
|
|
840
|
-
|
|
844
|
+
me(n), n.querySelectorAll("th, td").forEach((s) => Y(s));
|
|
841
845
|
});
|
|
842
846
|
}, []);
|
|
843
|
-
const
|
|
847
|
+
const se = (e) => {
|
|
844
848
|
for (; e && e.nodeName !== "LI"; )
|
|
845
849
|
e = e.parentNode;
|
|
846
850
|
return e;
|
|
847
|
-
},
|
|
851
|
+
}, je = (e) => {
|
|
848
852
|
let t = 0, n = e.parentElement;
|
|
849
853
|
for (; n; )
|
|
850
854
|
(n.tagName === "UL" || n.tagName === "OL") && t++, n = n.parentElement;
|
|
851
855
|
return t;
|
|
852
|
-
},
|
|
853
|
-
const t = e.querySelector("li"), n = t ?
|
|
856
|
+
}, _e = (e) => {
|
|
857
|
+
const t = e.querySelector("li"), n = t ? je(t) : 1;
|
|
854
858
|
if (e.querySelector("[data-hidden-array-start]")) return;
|
|
855
|
-
const
|
|
856
|
-
l.textContent =
|
|
859
|
+
const a = `{{#arrayData${n > 1 ? n : ""}}}`, s = `{{/arrayData${n > 1 ? n : ""}}}`, l = document.createElement("span");
|
|
860
|
+
l.textContent = a, l.style.display = "none", l.setAttribute("data-hidden-array-start", "true"), e.insertBefore(l, e.firstChild);
|
|
857
861
|
const i = document.createElement("span");
|
|
858
862
|
i.textContent = s, i.style.display = "none", i.setAttribute("data-hidden-array-end", "true"), e.appendChild(i);
|
|
859
|
-
},
|
|
860
|
-
var
|
|
863
|
+
}, de = (e) => {
|
|
864
|
+
var v;
|
|
861
865
|
const t = window.getSelection();
|
|
862
866
|
if (!(t != null && t.rangeCount)) return;
|
|
863
|
-
const n = t.getRangeAt(0),
|
|
867
|
+
const n = t.getRangeAt(0), a = se(n.startContainer);
|
|
864
868
|
let s, l;
|
|
865
|
-
if (
|
|
866
|
-
let
|
|
867
|
-
|
|
869
|
+
if (a) {
|
|
870
|
+
let f = a.querySelector(e);
|
|
871
|
+
f || (f = document.createElement(e), f.style.margin = "0", f.style.paddingLeft = "20px", a.appendChild(f)), l = f, s = document.createElement("li"), s.textContent = "", l.appendChild(s);
|
|
868
872
|
} else {
|
|
869
873
|
document.execCommand(e === "ul" ? "insertUnorderedList" : "insertOrderedList");
|
|
870
|
-
const
|
|
871
|
-
if (l =
|
|
874
|
+
const f = D();
|
|
875
|
+
if (l = f == null ? void 0 : f.querySelector(`${e}:last-child`), !l) return;
|
|
872
876
|
s = l.querySelector("li:last-child");
|
|
873
877
|
}
|
|
874
|
-
|
|
878
|
+
_e(l);
|
|
875
879
|
const i = document.createRange();
|
|
876
|
-
i.setStart(s, 0), i.collapse(!0), t.removeAllRanges(), t.addRange(i), (
|
|
877
|
-
},
|
|
878
|
-
e === "insertOrderedList" ?
|
|
879
|
-
},
|
|
880
|
+
i.setStart(s, 0), i.collapse(!0), t.removeAllRanges(), t.addRange(i), (v = D()) == null || v.focus(), z();
|
|
881
|
+
}, X = (e, t) => {
|
|
882
|
+
e === "insertOrderedList" ? de("ol") : e === "insertUnorderedList" ? de("ul") : He(e, t), e === "insertTable" && Ye();
|
|
883
|
+
}, Fe = (e) => {
|
|
880
884
|
const t = document.createElement("span");
|
|
881
885
|
t.textContent = "", e.insertNode(t), e.setStartAfter(t), e.collapse(!0);
|
|
882
886
|
const n = t.getBoundingClientRect();
|
|
883
|
-
t.remove(),
|
|
887
|
+
t.remove(), ee({
|
|
884
888
|
x: n.left,
|
|
885
889
|
y: n.bottom + window.scrollY
|
|
886
890
|
}), L(r || []), B(!0), V.current = e.cloneRange();
|
|
@@ -890,87 +894,86 @@ const $t = ({
|
|
|
890
894
|
const t = e.anchorNode;
|
|
891
895
|
let n = e.anchorOffset;
|
|
892
896
|
if (!t) return null;
|
|
893
|
-
let
|
|
894
|
-
for (
|
|
895
|
-
if (
|
|
896
|
-
const s =
|
|
897
|
+
let a = t;
|
|
898
|
+
for (a.nodeType !== Node.TEXT_NODE && (a.childNodes && a.childNodes[n] ? a = a.childNodes[n] : a = t.previousSibling); a; ) {
|
|
899
|
+
if (a.nodeType === Node.TEXT_NODE) {
|
|
900
|
+
const s = a.textContent || "", l = a === t ? n : s.length, i = s.lastIndexOf("@", l - 1);
|
|
897
901
|
if (i !== -1) {
|
|
898
|
-
const
|
|
899
|
-
return
|
|
902
|
+
const v = document.createRange();
|
|
903
|
+
return v.setStart(a, i), v.setEnd(a, l), v;
|
|
900
904
|
}
|
|
901
905
|
}
|
|
902
|
-
|
|
906
|
+
a = a.previousSibling;
|
|
903
907
|
}
|
|
904
908
|
return null;
|
|
905
|
-
},
|
|
909
|
+
}, Ie = (e) => {
|
|
906
910
|
var l;
|
|
907
911
|
const t = window.getSelection();
|
|
908
912
|
if (!t) return;
|
|
909
913
|
const n = Pe();
|
|
910
914
|
n ? (t.removeAllRanges(), t.addRange(n)) : V.current && (t.removeAllRanges(), t.addRange(V.current));
|
|
911
|
-
const
|
|
912
|
-
|
|
915
|
+
const a = document.createElement("span");
|
|
916
|
+
a.textContent = `{{${e.name}}}`, a.style.color = "#007bff", a.style.display = "inline", a.contentEditable = "false", a.setAttribute("data-mention", e.value || e.name || "");
|
|
913
917
|
try {
|
|
914
918
|
const i = t.rangeCount ? t.getRangeAt(0) : null;
|
|
915
919
|
if (i)
|
|
916
|
-
i.deleteContents(), i.insertNode(
|
|
920
|
+
i.deleteContents(), i.insertNode(a);
|
|
917
921
|
else {
|
|
918
|
-
const
|
|
919
|
-
|
|
922
|
+
const p = document.createRange(), h = D();
|
|
923
|
+
p.selectNodeContents(h), p.collapse(!1), p.insertNode(a);
|
|
920
924
|
}
|
|
921
|
-
const
|
|
922
|
-
|
|
923
|
-
const
|
|
924
|
-
|
|
925
|
+
const v = document.createTextNode(" ");
|
|
926
|
+
a.after(v);
|
|
927
|
+
const f = document.createRange();
|
|
928
|
+
f.setStartAfter(v), f.collapse(!0), t.removeAllRanges(), t.addRange(f);
|
|
925
929
|
} catch (i) {
|
|
926
930
|
console.error("insertMention error:", i);
|
|
927
931
|
}
|
|
928
|
-
let s =
|
|
929
|
-
|
|
930
|
-
},
|
|
931
|
-
const t =
|
|
932
|
+
let s = ke([...ie, e]);
|
|
933
|
+
ne(s), O(s), B(!1), (l = D()) == null || l.focus(), z();
|
|
934
|
+
}, Be = (e) => {
|
|
935
|
+
const t = D();
|
|
932
936
|
if (!t) return;
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
s.textContent = `{{${e.name}}}`, s.style.color = "#007bff", s.contentEditable = "false", s.setAttribute("data-mention", e.value || e.name), o.insertNode(s);
|
|
937
|
+
let n = null;
|
|
938
|
+
N.current && t.contains(N.current.startContainer) ? n = N.current.cloneRange() : (n = document.createRange(), n.selectNodeContents(t), n.collapse(!1));
|
|
939
|
+
const a = window.getSelection();
|
|
940
|
+
if (!a) return;
|
|
941
|
+
a.removeAllRanges(), a.addRange(n);
|
|
942
|
+
const s = document.createElement("span");
|
|
943
|
+
s.textContent = `{{${e.name}}}`, s.style.color = "#007bff", s.style.display = "inline", s.contentEditable = "false", s.setAttribute("data-mention", e.value || e.name), n.insertNode(s);
|
|
941
944
|
const l = document.createTextNode(" ");
|
|
942
945
|
s.after(l);
|
|
943
946
|
const i = document.createRange();
|
|
944
|
-
i.setStartAfter(l), i.collapse(!0),
|
|
945
|
-
},
|
|
946
|
-
e.forEach((t) =>
|
|
947
|
-
const n = [...t, ...e],
|
|
948
|
-
return
|
|
947
|
+
i.setStartAfter(l), i.collapse(!0), a.removeAllRanges(), a.addRange(i), N.current = i.cloneRange(), t.focus();
|
|
948
|
+
}, qe = (e) => {
|
|
949
|
+
e.forEach((t) => Be(t)), ne((t) => {
|
|
950
|
+
const n = [...t, ...e], a = Array.from(new Map(n.map((s) => [s.name, s])).values());
|
|
951
|
+
return O(a), a;
|
|
949
952
|
}), z();
|
|
950
|
-
},
|
|
951
|
-
const e =
|
|
953
|
+
}, Ve = () => {
|
|
954
|
+
const e = D();
|
|
952
955
|
if (!e) return [];
|
|
953
956
|
const t = e.querySelectorAll("span[data-mention]"), n = [];
|
|
954
|
-
return t.forEach((
|
|
955
|
-
const s =
|
|
957
|
+
return t.forEach((a) => {
|
|
958
|
+
const s = a.getAttribute("data-mention") || "", i = (a.textContent || "").match(/{{(.+?)}}/);
|
|
956
959
|
i && n.push({
|
|
957
960
|
name: i[1],
|
|
958
961
|
value: s
|
|
959
962
|
});
|
|
960
963
|
}), n;
|
|
961
964
|
}, Ue = (e) => {
|
|
962
|
-
var n,
|
|
965
|
+
var n, a, s;
|
|
963
966
|
const t = e.key.toLowerCase();
|
|
964
|
-
if ((e.ctrlKey || e.metaKey) && ["b", "i", "u"].includes(t) && (e.preventDefault(),
|
|
965
|
-
const l = window.getSelection(), i = l != null && l.anchorNode ?
|
|
967
|
+
if ((e.ctrlKey || e.metaKey) && ["b", "i", "u"].includes(t) && (e.preventDefault(), X(t === "b" ? "bold" : t === "i" ? "italic" : t === "u" ? "underline" : "")), e.shiftKey && e.key === "2" && e.preventDefault(), e.key === "Enter") {
|
|
968
|
+
const l = window.getSelection(), i = l != null && l.anchorNode ? se(l.anchorNode) : null;
|
|
966
969
|
if (!i) return;
|
|
967
970
|
if (((n = i.textContent) == null ? void 0 : n.replace(/\u200B/g, "").trim()) === "") {
|
|
968
971
|
e.preventDefault();
|
|
969
|
-
const
|
|
970
|
-
if (
|
|
971
|
-
|
|
972
|
+
const f = i.parentElement, p = f == null ? void 0 : f.closest("li");
|
|
973
|
+
if (p) {
|
|
974
|
+
f == null || f.removeChild(i);
|
|
972
975
|
const h = document.createElement("p");
|
|
973
|
-
h.innerHTML = "<br />", (
|
|
976
|
+
h.innerHTML = "<br />", (a = p.parentElement) == null || a.insertBefore(h, p.nextSibling);
|
|
974
977
|
const C = document.createRange();
|
|
975
978
|
C.setStart(h, 0), C.collapse(!0), l == null || l.removeAllRanges(), l == null || l.addRange(C);
|
|
976
979
|
} else {
|
|
@@ -985,23 +988,23 @@ const $t = ({
|
|
|
985
988
|
z();
|
|
986
989
|
}
|
|
987
990
|
}
|
|
988
|
-
},
|
|
991
|
+
}, $e = (e) => {
|
|
989
992
|
if (e.data === "@") {
|
|
990
993
|
const n = window.getSelection();
|
|
991
994
|
if (!(n != null && n.rangeCount)) return;
|
|
992
|
-
const
|
|
993
|
-
if (
|
|
995
|
+
const a = n.anchorNode;
|
|
996
|
+
if (We(a))
|
|
994
997
|
return;
|
|
995
998
|
setTimeout(() => {
|
|
996
|
-
|
|
999
|
+
Fe(n.getRangeAt(0)), ce(""), L(r), B(!0);
|
|
997
1000
|
}, 0);
|
|
998
1001
|
return;
|
|
999
1002
|
}
|
|
1000
1003
|
if (q) {
|
|
1001
|
-
setTimeout(() =>
|
|
1004
|
+
setTimeout(() => ue(), 0);
|
|
1002
1005
|
return;
|
|
1003
1006
|
}
|
|
1004
|
-
},
|
|
1007
|
+
}, We = (e) => {
|
|
1005
1008
|
if (!e) return !1;
|
|
1006
1009
|
let t = e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement;
|
|
1007
1010
|
for (; t; ) {
|
|
@@ -1009,7 +1012,7 @@ const $t = ({
|
|
|
1009
1012
|
t = t.parentElement;
|
|
1010
1013
|
}
|
|
1011
1014
|
return !1;
|
|
1012
|
-
},
|
|
1015
|
+
}, ue = () => {
|
|
1013
1016
|
if (z(), !q) return;
|
|
1014
1017
|
const e = window.getSelection();
|
|
1015
1018
|
if (!e || !e.anchorNode) return;
|
|
@@ -1018,68 +1021,68 @@ const $t = ({
|
|
|
1018
1021
|
B(!1);
|
|
1019
1022
|
return;
|
|
1020
1023
|
}
|
|
1021
|
-
const
|
|
1022
|
-
ce(
|
|
1023
|
-
const s = r.filter((l) => l.name.toLowerCase().includes(
|
|
1024
|
+
const a = n[1].toLowerCase();
|
|
1025
|
+
ce(a);
|
|
1026
|
+
const s = r.filter((l) => l.name.toLowerCase().includes(a));
|
|
1024
1027
|
L(s);
|
|
1025
|
-
},
|
|
1026
|
-
var
|
|
1027
|
-
const t = (
|
|
1028
|
+
}, Ke = (e) => {
|
|
1029
|
+
var a;
|
|
1030
|
+
const t = (a = e.target.files) == null ? void 0 : a[0];
|
|
1028
1031
|
if (!t) return;
|
|
1029
1032
|
const n = new FileReader();
|
|
1030
1033
|
n.onload = (s) => {
|
|
1031
1034
|
var A;
|
|
1032
1035
|
const l = (A = s.target) == null ? void 0 : A.result;
|
|
1033
|
-
|
|
1036
|
+
W();
|
|
1034
1037
|
const i = window.getSelection();
|
|
1035
|
-
let
|
|
1036
|
-
const
|
|
1037
|
-
|
|
1038
|
-
const
|
|
1039
|
-
if (!
|
|
1040
|
-
|
|
1041
|
-
const
|
|
1042
|
-
|
|
1038
|
+
let v = i && i.rangeCount ? i.getRangeAt(0) : null;
|
|
1039
|
+
const f = document.createElement("img");
|
|
1040
|
+
f.src = l, f.alt = t.name || "image", f.className = "rte-inserted-image", f.contentEditable = "true";
|
|
1041
|
+
const p = D();
|
|
1042
|
+
if (!v || !p) {
|
|
1043
|
+
p == null || p.appendChild(f);
|
|
1044
|
+
const xe = document.createTextNode(" ");
|
|
1045
|
+
p == null || p.appendChild(xe);
|
|
1043
1046
|
const re = document.createRange();
|
|
1044
|
-
re.setStartAfter(
|
|
1047
|
+
re.setStartAfter(xe), re.collapse(!0), i == null || i.removeAllRanges(), i == null || i.addRange(re), p == null || p.focus(), z(), e.target.value = "";
|
|
1045
1048
|
return;
|
|
1046
1049
|
}
|
|
1047
|
-
|
|
1050
|
+
v.deleteContents(), v.insertNode(f);
|
|
1048
1051
|
const h = document.createTextNode(" ");
|
|
1049
|
-
|
|
1052
|
+
f.after(h);
|
|
1050
1053
|
const C = document.createRange();
|
|
1051
|
-
C.setStartAfter(h), C.collapse(!0), i.removeAllRanges(), i.addRange(C),
|
|
1054
|
+
C.setStartAfter(h), C.collapse(!0), i.removeAllRanges(), i.addRange(C), p.focus(), z(), e.target.value = "";
|
|
1052
1055
|
}, n.readAsDataURL(t);
|
|
1053
|
-
},
|
|
1056
|
+
}, Xe = (e) => {
|
|
1054
1057
|
var s;
|
|
1055
|
-
|
|
1058
|
+
W();
|
|
1056
1059
|
const t = window.getSelection();
|
|
1057
1060
|
if (!(t != null && t.rangeCount)) return;
|
|
1058
|
-
const n = t.getRangeAt(0),
|
|
1059
|
-
n.insertNode(
|
|
1060
|
-
},
|
|
1061
|
-
|
|
1061
|
+
const n = t.getRangeAt(0), a = document.createTextNode(e);
|
|
1062
|
+
n.insertNode(a), n.setStartAfter(a), n.collapse(!0), t.removeAllRanges(), t.addRange(n), (s = D()) == null || s.focus(), z();
|
|
1063
|
+
}, Ye = () => {
|
|
1064
|
+
W();
|
|
1062
1065
|
const e = document.createElement("table");
|
|
1063
1066
|
e.style.borderCollapse = "collapse", e.style.width = "100%", e.style.border = "1px solid #ccc", e.style.margin = "8px 0", e.style.position = "relative", m.table && e.classList.add(m.table);
|
|
1064
1067
|
const t = document.createElement("thead");
|
|
1065
1068
|
m.thead && t.classList.add(m.thead);
|
|
1066
1069
|
const n = document.createElement("tbody");
|
|
1067
1070
|
m.tbody && n.classList.add(m.tbody);
|
|
1068
|
-
const
|
|
1069
|
-
m.tr &&
|
|
1071
|
+
const a = document.createElement("tr");
|
|
1072
|
+
m.tr && a.classList.add(m.tr);
|
|
1070
1073
|
const s = document.createElement("tr");
|
|
1071
1074
|
m.tr && s.classList.add(m.tr);
|
|
1072
|
-
for (let
|
|
1073
|
-
const
|
|
1074
|
-
|
|
1075
|
-
const
|
|
1076
|
-
|
|
1075
|
+
for (let v = 0; v < 2; v++) {
|
|
1076
|
+
const f = document.createElement("th");
|
|
1077
|
+
f.textContent = `Header ${v + 1}`, f.style.border = "1px solid #999", f.style.padding = "8px", f.style.position = "relative", f.style.backgroundColor = "lightgray", m.th && f.classList.add(m.th);
|
|
1078
|
+
const p = document.createElement("td");
|
|
1079
|
+
p.textContent = `Row 1 Col ${v + 1}`, p.style.border = "1px solid #999", p.style.padding = "8px", p.style.position = "relative", p.style.backgroundColor = "#fff", m.td && p.classList.add(m.td), Y(f), Y(p), a.appendChild(f), s.appendChild(p);
|
|
1077
1080
|
}
|
|
1078
|
-
t.appendChild(
|
|
1081
|
+
t.appendChild(a), n.appendChild(s), e.appendChild(t), e.appendChild(n), Ge(e), me(e);
|
|
1079
1082
|
const l = window.getSelection();
|
|
1080
1083
|
if (!(l != null && l.rangeCount)) return;
|
|
1081
1084
|
l.getRangeAt(0).insertNode(e), z();
|
|
1082
|
-
},
|
|
1085
|
+
}, me = (e) => {
|
|
1083
1086
|
const t = document.createElement("div");
|
|
1084
1087
|
Object.assign(t.style, {
|
|
1085
1088
|
position: "absolute",
|
|
@@ -1092,20 +1095,20 @@ const $t = ({
|
|
|
1092
1095
|
zIndex: "20",
|
|
1093
1096
|
borderRadius: "2px"
|
|
1094
1097
|
});
|
|
1095
|
-
let n = 0,
|
|
1098
|
+
let n = 0, a = 0, s = 0, l = 0;
|
|
1096
1099
|
t.addEventListener("mousedown", (i) => {
|
|
1097
|
-
i.preventDefault(), n = i.clientX,
|
|
1098
|
-
const
|
|
1099
|
-
s =
|
|
1100
|
-
const
|
|
1101
|
-
const C = Math.max(100, s + (h.clientX - n)), A = Math.max(60, l + (h.clientY -
|
|
1100
|
+
i.preventDefault(), n = i.clientX, a = i.clientY;
|
|
1101
|
+
const v = e.getBoundingClientRect();
|
|
1102
|
+
s = v.width, l = v.height;
|
|
1103
|
+
const f = (h) => {
|
|
1104
|
+
const C = Math.max(100, s + (h.clientX - n)), A = Math.max(60, l + (h.clientY - a));
|
|
1102
1105
|
e.style.width = `${C}px`, e.style.height = `${A}px`, z();
|
|
1103
|
-
},
|
|
1104
|
-
document.removeEventListener("mousemove",
|
|
1106
|
+
}, p = () => {
|
|
1107
|
+
document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", p), z();
|
|
1105
1108
|
};
|
|
1106
|
-
document.addEventListener("mousemove",
|
|
1109
|
+
document.addEventListener("mousemove", f), document.addEventListener("mouseup", p);
|
|
1107
1110
|
}), e.appendChild(t);
|
|
1108
|
-
},
|
|
1111
|
+
}, Y = (e) => {
|
|
1109
1112
|
const t = document.createElement("div"), n = document.createElement("div");
|
|
1110
1113
|
Object.assign(t.style, {
|
|
1111
1114
|
position: "absolute",
|
|
@@ -1125,26 +1128,26 @@ const $t = ({
|
|
|
1125
1128
|
cursor: "row-resize",
|
|
1126
1129
|
background: "rgba(0,0,0,0.15)",
|
|
1127
1130
|
zIndex: "10"
|
|
1128
|
-
}),
|
|
1129
|
-
},
|
|
1130
|
-
let
|
|
1131
|
+
}), Ze(e, t, n), e.appendChild(t), e.appendChild(n);
|
|
1132
|
+
}, Ze = (e, t, n) => {
|
|
1133
|
+
let a = 0, s = 0, l = 0, i = 0;
|
|
1131
1134
|
t.addEventListener("mousedown", (h) => {
|
|
1132
|
-
h.preventDefault(),
|
|
1135
|
+
h.preventDefault(), a = h.clientX, l = e.offsetWidth, document.addEventListener("mousemove", v), document.addEventListener("mouseup", p);
|
|
1133
1136
|
}), n.addEventListener("mousedown", (h) => {
|
|
1134
|
-
h.preventDefault(), s = h.clientY, i = e.offsetHeight, document.addEventListener("mousemove",
|
|
1137
|
+
h.preventDefault(), s = h.clientY, i = e.offsetHeight, document.addEventListener("mousemove", f), document.addEventListener("mouseup", p);
|
|
1135
1138
|
});
|
|
1136
|
-
const
|
|
1137
|
-
const C = l + (h.clientX -
|
|
1139
|
+
const v = (h) => {
|
|
1140
|
+
const C = l + (h.clientX - a);
|
|
1138
1141
|
e.style.width = `${Math.max(30, C)}px`;
|
|
1139
|
-
},
|
|
1142
|
+
}, f = (h) => {
|
|
1140
1143
|
const C = i + (h.clientY - s);
|
|
1141
1144
|
e.style.height = `${Math.max(20, C)}px`;
|
|
1142
|
-
},
|
|
1143
|
-
document.removeEventListener("mousemove",
|
|
1145
|
+
}, p = () => {
|
|
1146
|
+
document.removeEventListener("mousemove", v), document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", p);
|
|
1144
1147
|
};
|
|
1145
|
-
},
|
|
1148
|
+
}, Qe = (e) => {
|
|
1146
1149
|
const n = e.target.closest("td, th");
|
|
1147
|
-
n && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((
|
|
1150
|
+
n && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((a) => a.classList.remove("rte-cell-highlight")), n.classList.add("rte-cell-highlight"), g({
|
|
1148
1151
|
visible: !0,
|
|
1149
1152
|
x: e.clientX,
|
|
1150
1153
|
y: e.clientY,
|
|
@@ -1152,24 +1155,24 @@ const $t = ({
|
|
|
1152
1155
|
}));
|
|
1153
1156
|
}, fe = () => {
|
|
1154
1157
|
document.querySelectorAll(".rte-cell-highlight").forEach((e) => e.classList.remove("rte-cell-highlight"));
|
|
1155
|
-
},
|
|
1156
|
-
if (!
|
|
1157
|
-
const t =
|
|
1158
|
-
const i = l.tagName.toLowerCase(),
|
|
1159
|
-
return
|
|
1158
|
+
}, Je = (e) => {
|
|
1159
|
+
if (!T.cell) return;
|
|
1160
|
+
const t = T.cell.closest("table"), n = T.cell.cellIndex, a = T.cell.parentElement.rowIndex, s = (l) => {
|
|
1161
|
+
const i = l.tagName.toLowerCase(), v = document.createElement(i);
|
|
1162
|
+
return v.textContent = l.textContent || "", v.style.cssText = l.style.cssText, Y(v), v;
|
|
1160
1163
|
};
|
|
1161
1164
|
switch (e) {
|
|
1162
1165
|
case "insertRowAbove": {
|
|
1163
|
-
const l = t.rows[
|
|
1164
|
-
Array.from(l.cells).forEach((
|
|
1165
|
-
i.appendChild(s(
|
|
1166
|
+
const l = t.rows[a], i = t.insertRow(a);
|
|
1167
|
+
Array.from(l.cells).forEach((v) => {
|
|
1168
|
+
i.appendChild(s(v));
|
|
1166
1169
|
});
|
|
1167
1170
|
break;
|
|
1168
1171
|
}
|
|
1169
1172
|
case "insertRowBelow": {
|
|
1170
|
-
const l = t.rows[
|
|
1171
|
-
Array.from(l.cells).forEach((
|
|
1172
|
-
i.appendChild(s(
|
|
1173
|
+
const l = t.rows[a], i = t.insertRow(a + 1);
|
|
1174
|
+
Array.from(l.cells).forEach((v) => {
|
|
1175
|
+
i.appendChild(s(v));
|
|
1173
1176
|
});
|
|
1174
1177
|
break;
|
|
1175
1178
|
}
|
|
@@ -1188,7 +1191,7 @@ const $t = ({
|
|
|
1188
1191
|
break;
|
|
1189
1192
|
}
|
|
1190
1193
|
case "deleteRow":
|
|
1191
|
-
t.rows.length > 1 && t.deleteRow(
|
|
1194
|
+
t.rows.length > 1 && t.deleteRow(a);
|
|
1192
1195
|
break;
|
|
1193
1196
|
case "deleteCol":
|
|
1194
1197
|
Array.from(t.rows).forEach((l) => {
|
|
@@ -1196,43 +1199,43 @@ const $t = ({
|
|
|
1196
1199
|
});
|
|
1197
1200
|
break;
|
|
1198
1201
|
}
|
|
1199
|
-
z(),
|
|
1202
|
+
z(), g(oe(ae({}, T), {
|
|
1200
1203
|
visible: !1
|
|
1201
1204
|
})), fe();
|
|
1202
|
-
},
|
|
1205
|
+
}, Ge = (e) => {
|
|
1203
1206
|
const t = e.querySelector("tbody");
|
|
1204
1207
|
if (!t || t.querySelector("[data-hidden-table-start]")) return;
|
|
1205
1208
|
const n = document.createElement("span");
|
|
1206
1209
|
n.textContent = "{{#arrayData}}", n.style.display = "none", n.setAttribute("data-hidden-table-start", "true"), t.insertBefore(n, t.firstChild);
|
|
1207
|
-
const
|
|
1208
|
-
|
|
1209
|
-
},
|
|
1210
|
-
const e =
|
|
1211
|
-
if (!e) return
|
|
1210
|
+
const a = document.createElement("span");
|
|
1211
|
+
a.textContent = "{{/arrayData}}", a.style.display = "none", a.setAttribute("data-hidden-table-end", "true"), t.appendChild(a);
|
|
1212
|
+
}, ge = () => {
|
|
1213
|
+
const e = D();
|
|
1214
|
+
if (!e) return H;
|
|
1212
1215
|
const t = e.cloneNode(!0);
|
|
1213
1216
|
return t.querySelectorAll("table div").forEach((n) => n.remove()), t.querySelectorAll(".rte-cell-highlight").forEach((n) => n.classList.remove("rte-cell-highlight")), t.innerHTML;
|
|
1214
|
-
},
|
|
1215
|
-
|
|
1217
|
+
}, et = () => {
|
|
1218
|
+
U(), K.current = N.current, le({
|
|
1216
1219
|
url: "",
|
|
1217
1220
|
text: "",
|
|
1218
1221
|
title: "",
|
|
1219
1222
|
target: "_self"
|
|
1220
|
-
}),
|
|
1221
|
-
},
|
|
1223
|
+
}), j(!0);
|
|
1224
|
+
}, tt = (e) => {
|
|
1222
1225
|
const t = window.getSelection();
|
|
1223
|
-
if (!t || !
|
|
1224
|
-
t.removeAllRanges(), t.addRange(
|
|
1226
|
+
if (!t || !K.current) return;
|
|
1227
|
+
t.removeAllRanges(), t.addRange(K.current);
|
|
1225
1228
|
let n = e.url.trim();
|
|
1226
1229
|
/^https?:\/\//i.test(n) || (n = "https://" + n);
|
|
1227
|
-
const
|
|
1228
|
-
|
|
1230
|
+
const a = document.createElement("a");
|
|
1231
|
+
a.href = n, a.style.cursor = "pointer", a.style.outline = "none", a.textContent = e.text || n, a.title = e.title, a.target = e.target, a.contentEditable = "true";
|
|
1229
1232
|
const s = t.getRangeAt(0);
|
|
1230
|
-
s.deleteContents(), s.insertNode(
|
|
1233
|
+
s.deleteContents(), s.insertNode(a);
|
|
1231
1234
|
const l = document.createTextNode(" ");
|
|
1232
|
-
|
|
1235
|
+
a.after(l);
|
|
1233
1236
|
const i = document.createRange();
|
|
1234
|
-
i.setStartAfter(l), i.collapse(!0), t.removeAllRanges(), t.addRange(i),
|
|
1235
|
-
},
|
|
1237
|
+
i.setStartAfter(l), i.collapse(!0), t.removeAllRanges(), t.addRange(i), j(!1), z();
|
|
1238
|
+
}, nt = (e) => {
|
|
1236
1239
|
const t = e.target;
|
|
1237
1240
|
if (t.tagName === "A") {
|
|
1238
1241
|
const n = t;
|
|
@@ -1241,48 +1244,48 @@ const $t = ({
|
|
|
1241
1244
|
return;
|
|
1242
1245
|
}
|
|
1243
1246
|
e.preventDefault();
|
|
1244
|
-
const
|
|
1245
|
-
|
|
1247
|
+
const a = document.createRange();
|
|
1248
|
+
a.selectNode(n), K.current = a, le({
|
|
1246
1249
|
url: n.href,
|
|
1247
1250
|
text: n.textContent || n.href,
|
|
1248
1251
|
title: n.title,
|
|
1249
1252
|
target: n.target
|
|
1250
|
-
}),
|
|
1253
|
+
}), j(!0);
|
|
1251
1254
|
}
|
|
1252
|
-
},
|
|
1253
|
-
const e =
|
|
1255
|
+
}, rt = () => {
|
|
1256
|
+
const e = D();
|
|
1254
1257
|
if (!e) return;
|
|
1255
1258
|
const t = window.getSelection();
|
|
1256
|
-
if ((!t || t.rangeCount === 0) &&
|
|
1259
|
+
if ((!t || t.rangeCount === 0) && N.current) {
|
|
1257
1260
|
const h = window.getSelection();
|
|
1258
|
-
h == null || h.removeAllRanges(), h == null || h.addRange(
|
|
1261
|
+
h == null || h.removeAllRanges(), h == null || h.addRange(N.current);
|
|
1259
1262
|
}
|
|
1260
1263
|
const n = window.getSelection();
|
|
1261
1264
|
if (!n || n.rangeCount === 0) return;
|
|
1262
|
-
const
|
|
1263
|
-
|
|
1264
|
-
const s =
|
|
1265
|
+
const a = n.getRangeAt(0);
|
|
1266
|
+
W(), document.execCommand("removeFormat", !1);
|
|
1267
|
+
const s = a.cloneContents(), l = document.createElement("div");
|
|
1265
1268
|
l.appendChild(s);
|
|
1266
|
-
const i = document.createTreeWalker(l, NodeFilter.SHOW_ELEMENT, null),
|
|
1269
|
+
const i = document.createTreeWalker(l, NodeFilter.SHOW_ELEMENT, null), v = [];
|
|
1267
1270
|
for (; i.nextNode(); ) {
|
|
1268
1271
|
const h = i.currentNode, C = h.tagName.toUpperCase(), A = h.getAttribute && h.getAttribute("data-mention") !== null;
|
|
1269
|
-
C !== "A" && !A &&
|
|
1272
|
+
C !== "A" && !A && v.push(h);
|
|
1270
1273
|
}
|
|
1271
|
-
for (let h =
|
|
1272
|
-
const C =
|
|
1274
|
+
for (let h = v.length - 1; h >= 0; h--) {
|
|
1275
|
+
const C = v[h], A = C.parentNode;
|
|
1273
1276
|
if (A) {
|
|
1274
1277
|
for (; C.firstChild; ) A.insertBefore(C.firstChild, C);
|
|
1275
1278
|
A.removeChild(C);
|
|
1276
1279
|
}
|
|
1277
1280
|
}
|
|
1278
|
-
l.querySelectorAll("[style]").forEach((h) => h.removeAttribute("style")),
|
|
1279
|
-
const
|
|
1280
|
-
for (; l.firstChild; )
|
|
1281
|
-
|
|
1282
|
-
const
|
|
1283
|
-
|
|
1284
|
-
},
|
|
1285
|
-
var
|
|
1281
|
+
l.querySelectorAll("[style]").forEach((h) => h.removeAttribute("style")), a.deleteContents();
|
|
1282
|
+
const f = document.createDocumentFragment();
|
|
1283
|
+
for (; l.firstChild; ) f.appendChild(l.firstChild);
|
|
1284
|
+
a.insertNode(f);
|
|
1285
|
+
const p = document.createRange();
|
|
1286
|
+
p.setStartAfter(a.endContainer.nodeType === Node.TEXT_NODE ? a.endContainer : a.startContainer), p.collapse(!0), n.removeAllRanges(), n.addRange(p), e.normalize(), z();
|
|
1287
|
+
}, at = (e) => {
|
|
1288
|
+
var a;
|
|
1286
1289
|
let t = e;
|
|
1287
1290
|
t = t.replace(/{{#arrayData\d*}}/g, ""), t = t.replace(/{{\/arrayData\d*}}/g, "");
|
|
1288
1291
|
const n = document.createElement("div");
|
|
@@ -1295,79 +1298,80 @@ const $t = ({
|
|
|
1295
1298
|
}), n.querySelectorAll("table").forEach((s) => {
|
|
1296
1299
|
s.insertAdjacentText("afterend", `
|
|
1297
1300
|
`);
|
|
1298
|
-
}), ((
|
|
1301
|
+
}), ((a = n.textContent) == null ? void 0 : a.replace(/\n{3,}/g, `
|
|
1299
1302
|
|
|
1300
1303
|
`).trim()) || "";
|
|
1301
|
-
}, ne = () => {
|
|
1302
|
-
const e = window.getSelection();
|
|
1303
|
-
if (!e || e.rangeCount === 0) return !1;
|
|
1304
|
-
const t = e.getRangeAt(0), n = document.getElementById("rte-editor-body");
|
|
1305
|
-
return (n == null ? void 0 : n.contains(t.startContainer)) || !1;
|
|
1306
1304
|
};
|
|
1307
|
-
return /* @__PURE__ */
|
|
1305
|
+
return /* @__PURE__ */ o.createElement("div", {
|
|
1308
1306
|
className: `rte-wrapper ${(m == null ? void 0 : m.wrapper) || ""}`,
|
|
1309
1307
|
style: y.wrapper
|
|
1310
|
-
}, /* @__PURE__ */
|
|
1308
|
+
}, /* @__PURE__ */ o.createElement("div", {
|
|
1311
1309
|
style: {
|
|
1312
1310
|
flex: 1
|
|
1313
1311
|
}
|
|
1314
|
-
}, /* @__PURE__ */
|
|
1315
|
-
exec:
|
|
1316
|
-
saveSelection:
|
|
1317
|
-
handleFileChange:
|
|
1318
|
-
handleFontSizeChange: (e) =>
|
|
1319
|
-
handleFontFamilyChange: (e) =>
|
|
1320
|
-
insertEmoji:
|
|
1321
|
-
handleLink:
|
|
1322
|
-
removeFormatting:
|
|
1323
|
-
visibleActions:
|
|
1312
|
+
}, /* @__PURE__ */ o.createElement(Ht, {
|
|
1313
|
+
exec: X,
|
|
1314
|
+
saveSelection: U,
|
|
1315
|
+
handleFileChange: Ke,
|
|
1316
|
+
handleFontSizeChange: (e) => X("fontSize", e.target.value),
|
|
1317
|
+
handleFontFamilyChange: (e) => X("fontName", e.target.value),
|
|
1318
|
+
insertEmoji: Xe,
|
|
1319
|
+
handleLink: et,
|
|
1320
|
+
removeFormatting: rt,
|
|
1321
|
+
visibleActions: De,
|
|
1324
1322
|
className: m.toolbar,
|
|
1325
1323
|
style: y.toolbar
|
|
1326
|
-
}), /* @__PURE__ */
|
|
1324
|
+
}), /* @__PURE__ */ o.createElement("div", {
|
|
1327
1325
|
ref: k,
|
|
1328
1326
|
id: "rte-editor-body",
|
|
1329
1327
|
className: `rte-editor ${(m == null ? void 0 : m.editor) || ""}`,
|
|
1330
1328
|
style: y.editor,
|
|
1331
1329
|
contentEditable: !0,
|
|
1332
1330
|
suppressContentEditableWarning: !0,
|
|
1333
|
-
|
|
1331
|
+
onKeyUp: U,
|
|
1332
|
+
onMouseUp: U,
|
|
1333
|
+
onInput: () => {
|
|
1334
|
+
ue(), U();
|
|
1335
|
+
},
|
|
1334
1336
|
onKeyDown: Ue,
|
|
1335
|
-
onBeforeInput:
|
|
1336
|
-
onContextMenu:
|
|
1337
|
-
onClick:
|
|
1338
|
-
|
|
1337
|
+
onBeforeInput: $e,
|
|
1338
|
+
onContextMenu: Qe,
|
|
1339
|
+
onClick: (e) => {
|
|
1340
|
+
nt(e), U();
|
|
1341
|
+
}
|
|
1342
|
+
}), /* @__PURE__ */ o.createElement(jt, {
|
|
1339
1343
|
show: q,
|
|
1340
1344
|
position: F,
|
|
1341
|
-
filtered:
|
|
1342
|
-
insertMention:
|
|
1345
|
+
filtered: te,
|
|
1346
|
+
insertMention: Ie,
|
|
1343
1347
|
onClose: () => B(!1),
|
|
1344
|
-
query:
|
|
1345
|
-
}), c && /* @__PURE__ */
|
|
1348
|
+
query: Oe
|
|
1349
|
+
}), c && /* @__PURE__ */ o.createElement("div", {
|
|
1346
1350
|
className: `rte-output ${(m == null ? void 0 : m.output) || ""}`,
|
|
1347
1351
|
style: y.output
|
|
1348
|
-
}, /* @__PURE__ */
|
|
1349
|
-
visible:
|
|
1350
|
-
x:
|
|
1351
|
-
y:
|
|
1352
|
-
onAction:
|
|
1352
|
+
}, /* @__PURE__ */ o.createElement("h4", null, "Output HTML:"), /* @__PURE__ */ o.createElement("p", null, G)), /* @__PURE__ */ o.createElement(_t, {
|
|
1353
|
+
visible: T.visible,
|
|
1354
|
+
x: T.x,
|
|
1355
|
+
y: T.y,
|
|
1356
|
+
onAction: Je,
|
|
1353
1357
|
onClose: () => {
|
|
1354
|
-
|
|
1358
|
+
g(oe(ae({}, T), {
|
|
1355
1359
|
visible: !1
|
|
1356
1360
|
})), fe();
|
|
1357
1361
|
}
|
|
1358
|
-
}), /* @__PURE__ */
|
|
1362
|
+
}), /* @__PURE__ */ o.createElement(Pt, {
|
|
1359
1363
|
visible: w,
|
|
1360
|
-
linkData:
|
|
1361
|
-
onClose: () =>
|
|
1362
|
-
onInsert:
|
|
1363
|
-
})), d ? /* @__PURE__ */
|
|
1364
|
+
linkData: Te,
|
|
1365
|
+
onClose: () => j(!1),
|
|
1366
|
+
onInsert: tt
|
|
1367
|
+
})), d ? /* @__PURE__ */ o.createElement(Ft, {
|
|
1364
1368
|
className: m.preview,
|
|
1365
1369
|
style: y.preview,
|
|
1366
|
-
html:
|
|
1370
|
+
html: ge()
|
|
1367
1371
|
}) : null);
|
|
1368
1372
|
};
|
|
1369
1373
|
export {
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1374
|
+
Vt as RichTextEditor,
|
|
1375
|
+
Ft as RtePreview,
|
|
1376
|
+
Ht as RteToolbar
|
|
1373
1377
|
};
|