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