@ryzeup/richtexteditor 1.0.7 → 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 +774 -698
- 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
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
import * as
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
for (var s in c || (c = {}))
|
|
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
|
|
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 w = Object.getOwnPropertySymbols(
|
|
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
|
-
return
|
|
32
|
+
return s;
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
-
if (
|
|
35
|
-
var
|
|
36
|
-
for (var
|
|
37
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
38
|
-
if (c.indexOf(
|
|
39
|
-
|
|
34
|
+
function mt(n, c) {
|
|
35
|
+
if (n == null) return {};
|
|
36
|
+
var 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
|
-
return
|
|
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
|
-
var
|
|
47
|
-
for (var
|
|
48
|
-
Object.prototype.hasOwnProperty.call(
|
|
47
|
+
var s = arguments[c];
|
|
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
|
|
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
|
-
})),
|
|
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
|
-
return
|
|
62
|
+
return s;
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
+
function Q(n) {
|
|
64
65
|
for (var c = 1; c < arguments.length; c++) {
|
|
65
|
-
var
|
|
66
|
-
c % 2 ?
|
|
67
|
-
|
|
68
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
69
|
-
Object.defineProperty(
|
|
66
|
+
var s = arguments[c] != null ? arguments[c] : {};
|
|
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
|
|
84
|
-
if (
|
|
85
|
-
var
|
|
86
|
-
if (typeof
|
|
82
|
+
function ht(n, c) {
|
|
83
|
+
if (typeof n != "object" || !n) return n;
|
|
84
|
+
var s = n[Symbol.toPrimitive];
|
|
85
|
+
if (s !== void 0) {
|
|
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
|
|
93
|
-
key:
|
|
94
|
-
}, c.attr),
|
|
92
|
+
function ke(n) {
|
|
93
|
+
return n && n.map((c, s) => /* @__PURE__ */ o.createElement(c.tag, Q({
|
|
94
|
+
key: s
|
|
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
|
-
var c = (
|
|
102
|
+
function pt(n) {
|
|
103
|
+
var c = (s) => {
|
|
103
104
|
var {
|
|
104
|
-
attr:
|
|
105
|
-
size:
|
|
105
|
+
attr: u,
|
|
106
|
+
size: m,
|
|
106
107
|
title: w
|
|
107
|
-
} =
|
|
108
|
-
return
|
|
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
|
-
},
|
|
113
|
+
}, s.attr, u, R, {
|
|
113
114
|
className: E,
|
|
114
|
-
style:
|
|
115
|
-
color:
|
|
116
|
-
},
|
|
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
|
-
}), w && /* @__PURE__ */
|
|
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 Ct = [
|
|
|
278
279
|
"👏",
|
|
279
280
|
"🫶",
|
|
280
281
|
"👐"
|
|
281
|
-
],
|
|
282
|
-
exec:
|
|
282
|
+
], Dt = ({
|
|
283
|
+
exec: n,
|
|
283
284
|
saveSelection: c,
|
|
284
|
-
handleFileChange:
|
|
285
|
-
handleFontSizeChange:
|
|
286
|
-
handleFontFamilyChange:
|
|
285
|
+
handleFileChange: s,
|
|
286
|
+
handleFontSizeChange: u,
|
|
287
|
+
handleFontFamilyChange: m,
|
|
287
288
|
// insertListBlock,
|
|
288
289
|
insertEmoji: w,
|
|
289
290
|
handleLink: R,
|
|
290
|
-
removeFormatting:
|
|
291
|
+
removeFormatting: x,
|
|
291
292
|
visibleActions: E,
|
|
292
293
|
className: T,
|
|
293
|
-
style:
|
|
294
|
+
style: H
|
|
294
295
|
}) => {
|
|
295
|
-
var
|
|
296
|
-
const
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
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
|
+
});
|
|
301
|
+
B(() => {
|
|
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,
|
|
@@ -342,9 +346,9 @@ const Ct = [
|
|
|
342
346
|
color: !1,
|
|
343
347
|
highlight: !1
|
|
344
348
|
});
|
|
345
|
-
return
|
|
346
|
-
const
|
|
347
|
-
|
|
349
|
+
return B(() => {
|
|
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 Ct = [
|
|
|
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
|
-
style:
|
|
369
|
-
}, E.bold && /* @__PURE__ */
|
|
372
|
+
style: H
|
|
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
|
-
onChange:
|
|
419
|
-
}), E.emoji && /* @__PURE__ */
|
|
422
|
+
onChange: s
|
|
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__ */
|
|
472
|
+
className: L.color ? "rte-active" : ""
|
|
473
|
+
}, /* @__PURE__ */ o.createElement(At, null)), /* @__PURE__ */ o.createElement("input", {
|
|
460
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 Ct = [
|
|
|
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__ */
|
|
493
|
-
ref:
|
|
505
|
+
className: L.highlight ? "rte-active" : ""
|
|
506
|
+
}, /* @__PURE__ */ o.createElement(xt, null)), /* @__PURE__ */ o.createElement("input", {
|
|
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,99 +518,99 @@ const Ct = [
|
|
|
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
|
-
filtered:
|
|
566
|
-
insertMention:
|
|
567
|
-
onClose:
|
|
579
|
+
filtered: s,
|
|
580
|
+
insertMention: u,
|
|
581
|
+
onClose: m,
|
|
568
582
|
query: w
|
|
569
583
|
}) => {
|
|
570
|
-
const R =
|
|
571
|
-
return
|
|
572
|
-
const
|
|
573
|
-
R.current && !R.current.contains(E.target) &&
|
|
584
|
+
const R = I(null);
|
|
585
|
+
return B(() => {
|
|
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: {
|
|
582
596
|
top: c.y,
|
|
583
597
|
left: c.x
|
|
584
598
|
}
|
|
585
|
-
},
|
|
586
|
-
|
|
599
|
+
}, s.length > 0 ? s.map(({
|
|
600
|
+
name: x,
|
|
587
601
|
value: E
|
|
588
602
|
}) => {
|
|
589
|
-
const T =
|
|
590
|
-
let N =
|
|
591
|
-
if (
|
|
592
|
-
const
|
|
593
|
-
N =
|
|
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
|
-
onMouseDown: (
|
|
598
|
-
|
|
599
|
-
|
|
611
|
+
onMouseDown: (b) => {
|
|
612
|
+
b.preventDefault(), u({
|
|
613
|
+
name: x,
|
|
600
614
|
value: E
|
|
601
615
|
});
|
|
602
616
|
},
|
|
@@ -608,137 +622,141 @@ const Ct = [
|
|
|
608
622
|
dangerouslySetInnerHTML: {
|
|
609
623
|
__html: N
|
|
610
624
|
},
|
|
611
|
-
onMouseEnter: (
|
|
612
|
-
onMouseLeave: (
|
|
625
|
+
onMouseEnter: (b) => b.currentTarget.style.background = "#f0f0f0",
|
|
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
|
-
y:
|
|
631
|
-
onAction:
|
|
632
|
-
onClose:
|
|
644
|
+
y: s,
|
|
645
|
+
onAction: u,
|
|
646
|
+
onClose: m
|
|
633
647
|
}) => {
|
|
634
|
-
if (!
|
|
648
|
+
if (!n) return null;
|
|
635
649
|
const w = {
|
|
636
|
-
top:
|
|
650
|
+
top: s,
|
|
637
651
|
left: c
|
|
638
652
|
};
|
|
639
|
-
return /* @__PURE__ */
|
|
653
|
+
return /* @__PURE__ */ o.createElement("div", {
|
|
640
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
|
-
style:
|
|
673
|
+
style: s
|
|
660
674
|
}) => {
|
|
661
|
-
const
|
|
662
|
-
const w =
|
|
675
|
+
const u = (m) => {
|
|
676
|
+
const w = m.target;
|
|
663
677
|
if (w.tagName === "A") {
|
|
664
|
-
|
|
678
|
+
m.preventDefault();
|
|
665
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
|
-
style:
|
|
672
|
-
onClick:
|
|
685
|
+
style: s,
|
|
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
|
-
onClose:
|
|
681
|
-
onInsert:
|
|
694
|
+
onClose: s,
|
|
695
|
+
onInsert: u
|
|
682
696
|
}) => {
|
|
683
|
-
const [
|
|
684
|
-
if (
|
|
685
|
-
|
|
686
|
-
}, [
|
|
697
|
+
const [m, w] = z(""), [R, x] = z(""), [E, T] = z(""), [H, k] = z("_self");
|
|
698
|
+
if (B(() => {
|
|
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;
|
|
687
701
|
const N = () => {
|
|
688
|
-
|
|
689
|
-
url:
|
|
702
|
+
u({
|
|
703
|
+
url: m,
|
|
690
704
|
text: R,
|
|
691
705
|
title: E,
|
|
692
|
-
target:
|
|
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
|
-
onClick:
|
|
698
|
-
}), /* @__PURE__ */
|
|
711
|
+
onClick: s
|
|
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: (
|
|
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: (
|
|
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
|
-
onChange: (
|
|
720
|
-
}), /* @__PURE__ */
|
|
733
|
+
onChange: (b) => T(b.target.value)
|
|
734
|
+
}), /* @__PURE__ */ o.createElement("select", {
|
|
721
735
|
className: "rte-link-modal__select",
|
|
722
|
-
value:
|
|
723
|
-
onChange: (
|
|
724
|
-
}, /* @__PURE__ */
|
|
736
|
+
value: H,
|
|
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
|
-
onClick:
|
|
733
|
-
}, "Cancel"), /* @__PURE__ */
|
|
746
|
+
onClick: s
|
|
747
|
+
}, "Cancel"), /* @__PURE__ */ o.createElement("button", {
|
|
734
748
|
className: "rte-link-modal__btn rte-link-modal__btn--ok",
|
|
735
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
|
-
showPreview:
|
|
741
|
-
toolbarConfig:
|
|
758
|
+
showPreview: s = !1,
|
|
759
|
+
toolbarConfig: u = {
|
|
742
760
|
link: !1,
|
|
743
761
|
image: !1,
|
|
744
762
|
emoji: !1,
|
|
@@ -748,27 +766,32 @@ const Lt = ({
|
|
|
748
766
|
fontSize: !1,
|
|
749
767
|
highlight: !1
|
|
750
768
|
},
|
|
751
|
-
classNames:
|
|
769
|
+
classNames: m = {},
|
|
752
770
|
styles: w = {},
|
|
753
771
|
handleGetHtml: R = () => {
|
|
754
772
|
},
|
|
755
|
-
onChange:
|
|
773
|
+
onChange: x = () => {
|
|
774
|
+
},
|
|
775
|
+
value: E,
|
|
776
|
+
onMentionSelect: T = () => {
|
|
777
|
+
},
|
|
778
|
+
handleAddAttributes: H = () => {
|
|
756
779
|
}
|
|
757
780
|
}) => {
|
|
758
|
-
var
|
|
759
|
-
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({
|
|
760
783
|
x: 0,
|
|
761
784
|
y: 0
|
|
762
|
-
}), [
|
|
785
|
+
}), [F, U] = z([]), _ = I(null), L = I(null), [D, q] = z({
|
|
763
786
|
visible: !1,
|
|
764
787
|
x: 0,
|
|
765
788
|
y: 0
|
|
766
|
-
}), [
|
|
789
|
+
}), [K, f] = z(!1), y = I(null), [P, oe] = z({
|
|
767
790
|
url: "",
|
|
768
791
|
text: "",
|
|
769
792
|
title: "",
|
|
770
793
|
target: "_self"
|
|
771
|
-
}),
|
|
794
|
+
}), Ae = {
|
|
772
795
|
bold: !0,
|
|
773
796
|
italic: !0,
|
|
774
797
|
underline: !0,
|
|
@@ -776,227 +799,278 @@ const Lt = ({
|
|
|
776
799
|
unorderedList: !0,
|
|
777
800
|
orderedList: !0,
|
|
778
801
|
align: !0,
|
|
779
|
-
link: (
|
|
780
|
-
image: (
|
|
781
|
-
emoji: (
|
|
782
|
-
table: (
|
|
783
|
-
color: (
|
|
784
|
-
fontFamily: (
|
|
785
|
-
fontSize: (
|
|
786
|
-
highlight: (
|
|
787
|
-
}, [
|
|
788
|
-
const e =
|
|
789
|
-
|
|
790
|
-
const
|
|
791
|
-
|
|
792
|
-
|
|
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 = () => {
|
|
793
818
|
const e = window.getSelection();
|
|
794
|
-
e != null && e.rangeCount && (
|
|
795
|
-
},
|
|
819
|
+
e != null && e.rangeCount && (_.current = e.getRangeAt(0));
|
|
820
|
+
}, V = () => {
|
|
796
821
|
const e = window.getSelection();
|
|
797
|
-
e &&
|
|
798
|
-
},
|
|
799
|
-
const
|
|
800
|
-
|
|
822
|
+
e && _.current && (e.removeAllRanges(), e.addRange(_.current));
|
|
823
|
+
}, Te = (e, t) => {
|
|
824
|
+
const r = window.getSelection();
|
|
825
|
+
r && r.rangeCount > 0 && (_.current = r.getRangeAt(0)), V(), document.execCommand(e, !1, t), M();
|
|
801
826
|
};
|
|
802
|
-
|
|
803
|
-
const e =
|
|
804
|
-
e && !e.innerHTML && (e.innerHTML =
|
|
805
|
-
}, []),
|
|
827
|
+
B(() => {
|
|
828
|
+
const e = O();
|
|
829
|
+
e && !e.innerHTML && (e.innerHTML = N), M();
|
|
830
|
+
}, []), B(() => () => {
|
|
806
831
|
document.removeEventListener("mousemove", null), document.removeEventListener("mouseup", null);
|
|
832
|
+
}, []), B(() => {
|
|
833
|
+
H && H((e) => {
|
|
834
|
+
Pe(e);
|
|
835
|
+
});
|
|
807
836
|
}, []);
|
|
808
|
-
const
|
|
837
|
+
const ie = (e) => {
|
|
809
838
|
for (; e && e.nodeName !== "LI"; )
|
|
810
839
|
e = e.parentNode;
|
|
811
840
|
return e;
|
|
812
|
-
},
|
|
813
|
-
let
|
|
814
|
-
for (;
|
|
815
|
-
(
|
|
816
|
-
return
|
|
817
|
-
},
|
|
818
|
-
const
|
|
841
|
+
}, De = (e) => {
|
|
842
|
+
let t = 0, r = e.parentElement;
|
|
843
|
+
for (; r; )
|
|
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;
|
|
819
848
|
if (e.querySelector("[data-hidden-array-start]")) return;
|
|
820
|
-
const
|
|
821
|
-
l.textContent =
|
|
822
|
-
const
|
|
823
|
-
|
|
824
|
-
},
|
|
825
|
-
var
|
|
826
|
-
const
|
|
827
|
-
if (!(
|
|
828
|
-
const
|
|
829
|
-
let
|
|
830
|
-
if (
|
|
831
|
-
let
|
|
832
|
-
|
|
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);
|
|
851
|
+
const i = document.createElement("span");
|
|
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);
|
|
833
862
|
} else {
|
|
834
863
|
document.execCommand(e === "ul" ? "insertUnorderedList" : "insertOrderedList");
|
|
835
|
-
const
|
|
836
|
-
if (l =
|
|
837
|
-
|
|
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");
|
|
838
867
|
}
|
|
839
|
-
|
|
840
|
-
const
|
|
841
|
-
|
|
842
|
-
},
|
|
843
|
-
e === "insertOrderedList" ?
|
|
844
|
-
},
|
|
845
|
-
const
|
|
846
|
-
|
|
847
|
-
const
|
|
848
|
-
|
|
849
|
-
x:
|
|
850
|
-
y:
|
|
851
|
-
}),
|
|
852
|
-
},
|
|
868
|
+
Oe(l);
|
|
869
|
+
const i = document.createRange();
|
|
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({
|
|
878
|
+
x: r.left,
|
|
879
|
+
y: r.bottom + window.scrollY
|
|
880
|
+
}), U(n || []), j(!0), L.current = e.cloneRange();
|
|
881
|
+
}, je = () => {
|
|
853
882
|
const e = window.getSelection();
|
|
854
883
|
if (!e || e.rangeCount === 0) return null;
|
|
855
|
-
const
|
|
856
|
-
let
|
|
857
|
-
if (!
|
|
858
|
-
let
|
|
859
|
-
for (
|
|
860
|
-
if (
|
|
861
|
-
const
|
|
862
|
-
if (
|
|
863
|
-
const
|
|
864
|
-
return
|
|
884
|
+
const t = e.anchorNode;
|
|
885
|
+
let r = e.anchorOffset;
|
|
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);
|
|
891
|
+
if (i !== -1) {
|
|
892
|
+
const v = document.createRange();
|
|
893
|
+
return v.setStart(a, i), v.setEnd(a, l), v;
|
|
865
894
|
}
|
|
866
895
|
}
|
|
867
|
-
|
|
896
|
+
a = a.previousSibling;
|
|
868
897
|
}
|
|
869
898
|
return null;
|
|
870
|
-
},
|
|
871
|
-
var
|
|
872
|
-
const
|
|
873
|
-
if (!
|
|
874
|
-
const
|
|
875
|
-
|
|
876
|
-
const
|
|
877
|
-
|
|
899
|
+
}, _e = (e) => {
|
|
900
|
+
var l;
|
|
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 || "");
|
|
878
907
|
try {
|
|
879
|
-
const
|
|
880
|
-
if (
|
|
881
|
-
|
|
908
|
+
const i = t.rangeCount ? t.getRangeAt(0) : null;
|
|
909
|
+
if (i)
|
|
910
|
+
i.deleteContents(), i.insertNode(a);
|
|
882
911
|
else {
|
|
883
|
-
const
|
|
884
|
-
|
|
912
|
+
const p = document.createRange(), h = O();
|
|
913
|
+
p.selectNodeContents(h), p.collapse(!1), p.insertNode(a);
|
|
885
914
|
}
|
|
886
|
-
const
|
|
887
|
-
|
|
888
|
-
const
|
|
889
|
-
|
|
890
|
-
} catch (
|
|
891
|
-
console.error("insertMention error:",
|
|
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);
|
|
919
|
+
} catch (i) {
|
|
920
|
+
console.error("insertMention error:", i);
|
|
892
921
|
}
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
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 = () => {
|
|
940
|
+
const e = O();
|
|
941
|
+
if (!e) return [];
|
|
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(/{{(.+?)}}/);
|
|
945
|
+
i && r.push({
|
|
946
|
+
name: i[1],
|
|
947
|
+
value: d
|
|
948
|
+
});
|
|
949
|
+
}), r;
|
|
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;
|
|
955
|
+
if (!i) return;
|
|
956
|
+
if (((r = i.textContent) == null ? void 0 : r.replace(/\u200B/g, "").trim()) === "") {
|
|
901
957
|
e.preventDefault();
|
|
902
|
-
const
|
|
958
|
+
const g = i.parentElement, p = g == null ? void 0 : g.closest("li");
|
|
903
959
|
if (p) {
|
|
904
|
-
|
|
960
|
+
g == null || g.removeChild(i);
|
|
905
961
|
const h = document.createElement("p");
|
|
906
|
-
h.innerHTML = "<br />", (
|
|
907
|
-
const
|
|
908
|
-
|
|
962
|
+
h.innerHTML = "<br />", (a = p.parentElement) == null || a.insertBefore(h, p.nextSibling);
|
|
963
|
+
const C = document.createRange();
|
|
964
|
+
C.setStart(h, 0), C.collapse(!0), l == null || l.removeAllRanges(), l == null || l.addRange(C);
|
|
909
965
|
} else {
|
|
910
|
-
const h =
|
|
966
|
+
const h = i.closest("ul, ol");
|
|
911
967
|
if (h) {
|
|
912
|
-
const
|
|
913
|
-
|
|
914
|
-
const
|
|
915
|
-
|
|
968
|
+
const C = document.createElement("p");
|
|
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);
|
|
916
972
|
}
|
|
917
973
|
}
|
|
918
|
-
|
|
974
|
+
M();
|
|
919
975
|
}
|
|
920
976
|
}
|
|
921
|
-
},
|
|
977
|
+
}, qe = (e) => {
|
|
922
978
|
if (e.data === "@") {
|
|
923
|
-
const
|
|
924
|
-
if (!(
|
|
979
|
+
const r = window.getSelection();
|
|
980
|
+
if (!(r != null && r.rangeCount)) return;
|
|
981
|
+
const a = r.anchorNode;
|
|
982
|
+
if (Ve(a))
|
|
983
|
+
return;
|
|
925
984
|
setTimeout(() => {
|
|
926
|
-
|
|
985
|
+
He(r.getRangeAt(0)), le(""), U(n), j(!0);
|
|
927
986
|
}, 0);
|
|
928
987
|
return;
|
|
929
988
|
}
|
|
930
|
-
if (
|
|
931
|
-
setTimeout(() =>
|
|
989
|
+
if ($) {
|
|
990
|
+
setTimeout(() => de(), 0);
|
|
932
991
|
return;
|
|
933
992
|
}
|
|
934
|
-
},
|
|
935
|
-
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;
|
|
936
1003
|
const e = window.getSelection();
|
|
937
1004
|
if (!e || !e.anchorNode) return;
|
|
938
|
-
const
|
|
939
|
-
if (!
|
|
940
|
-
|
|
1005
|
+
const r = (e.anchorNode.textContent || "").match(/@([a-zA-Z0-9_]*)$/);
|
|
1006
|
+
if (!r) {
|
|
1007
|
+
j(!1);
|
|
941
1008
|
return;
|
|
942
1009
|
}
|
|
943
|
-
const
|
|
944
|
-
|
|
945
|
-
const
|
|
946
|
-
|
|
947
|
-
},
|
|
948
|
-
var
|
|
949
|
-
const
|
|
950
|
-
if (!
|
|
951
|
-
const
|
|
952
|
-
|
|
953
|
-
var
|
|
954
|
-
const l = (
|
|
955
|
-
|
|
956
|
-
const
|
|
957
|
-
let
|
|
958
|
-
const
|
|
959
|
-
|
|
960
|
-
const p =
|
|
961
|
-
if (!
|
|
962
|
-
p == null || p.appendChild(
|
|
963
|
-
const
|
|
964
|
-
p == null || p.appendChild(
|
|
965
|
-
const
|
|
966
|
-
|
|
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;
|
|
1018
|
+
const r = new FileReader();
|
|
1019
|
+
r.onload = (d) => {
|
|
1020
|
+
var A;
|
|
1021
|
+
const l = (A = d.target) == null ? void 0 : A.result;
|
|
1022
|
+
V();
|
|
1023
|
+
const i = window.getSelection();
|
|
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";
|
|
1027
|
+
const p = O();
|
|
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 = "";
|
|
967
1034
|
return;
|
|
968
1035
|
}
|
|
969
|
-
|
|
1036
|
+
v.deleteContents(), v.insertNode(g);
|
|
970
1037
|
const h = document.createTextNode(" ");
|
|
971
|
-
|
|
972
|
-
const
|
|
973
|
-
|
|
974
|
-
},
|
|
975
|
-
},
|
|
976
|
-
var
|
|
977
|
-
|
|
978
|
-
const
|
|
979
|
-
if (!(
|
|
980
|
-
const
|
|
981
|
-
|
|
982
|
-
},
|
|
983
|
-
|
|
1038
|
+
g.after(h);
|
|
1039
|
+
const C = document.createRange();
|
|
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();
|
|
984
1051
|
const e = document.createElement("table");
|
|
985
|
-
e.style.borderCollapse = "collapse", e.style.width = "100%", e.style.border = "1px solid #ccc", e.style.margin = "8px 0", e.style.position = "relative";
|
|
986
|
-
const
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
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);
|
|
990
1064
|
const p = document.createElement("td");
|
|
991
|
-
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);
|
|
992
1066
|
}
|
|
993
|
-
|
|
1067
|
+
t.appendChild(a), r.appendChild(d), e.appendChild(t), e.appendChild(r), Qe(e), Ke(e);
|
|
994
1068
|
const l = window.getSelection();
|
|
995
1069
|
if (!(l != null && l.rangeCount)) return;
|
|
996
|
-
l.getRangeAt(0).insertNode(e),
|
|
997
|
-
},
|
|
998
|
-
const
|
|
999
|
-
Object.assign(
|
|
1070
|
+
l.getRangeAt(0).insertNode(e), M();
|
|
1071
|
+
}, Ke = (e) => {
|
|
1072
|
+
const t = document.createElement("div");
|
|
1073
|
+
Object.assign(t.style, {
|
|
1000
1074
|
position: "absolute",
|
|
1001
1075
|
width: "14px",
|
|
1002
1076
|
height: "14px",
|
|
@@ -1007,22 +1081,22 @@ const Lt = ({
|
|
|
1007
1081
|
zIndex: "20",
|
|
1008
1082
|
borderRadius: "2px"
|
|
1009
1083
|
});
|
|
1010
|
-
let
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
const
|
|
1014
|
-
|
|
1015
|
-
const
|
|
1016
|
-
const
|
|
1017
|
-
e.style.width = `${
|
|
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();
|
|
1018
1092
|
}, p = () => {
|
|
1019
|
-
document.removeEventListener("mousemove",
|
|
1093
|
+
document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", p), M();
|
|
1020
1094
|
};
|
|
1021
|
-
document.addEventListener("mousemove",
|
|
1022
|
-
}), e.appendChild(
|
|
1023
|
-
},
|
|
1024
|
-
const
|
|
1025
|
-
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, {
|
|
1026
1100
|
position: "absolute",
|
|
1027
1101
|
right: "0",
|
|
1028
1102
|
top: "0",
|
|
@@ -1031,7 +1105,7 @@ const Lt = ({
|
|
|
1031
1105
|
cursor: "col-resize",
|
|
1032
1106
|
background: "rgba(0,0,0,0.15)",
|
|
1033
1107
|
zIndex: "10"
|
|
1034
|
-
}), Object.assign(
|
|
1108
|
+
}), Object.assign(r.style, {
|
|
1035
1109
|
position: "absolute",
|
|
1036
1110
|
bottom: "0",
|
|
1037
1111
|
left: "0",
|
|
@@ -1040,243 +1114,245 @@ const Lt = ({
|
|
|
1040
1114
|
cursor: "row-resize",
|
|
1041
1115
|
background: "rgba(0,0,0,0.15)",
|
|
1042
1116
|
zIndex: "10"
|
|
1043
|
-
}),
|
|
1044
|
-
},
|
|
1045
|
-
let
|
|
1046
|
-
|
|
1047
|
-
h.preventDefault(),
|
|
1048
|
-
}),
|
|
1049
|
-
h.preventDefault(),
|
|
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);
|
|
1050
1124
|
});
|
|
1051
|
-
const
|
|
1052
|
-
const
|
|
1053
|
-
e.style.width = `${Math.max(30,
|
|
1054
|
-
},
|
|
1055
|
-
const
|
|
1056
|
-
e.style.height = `${Math.max(20,
|
|
1125
|
+
const v = (h) => {
|
|
1126
|
+
const C = l + (h.clientX - a);
|
|
1127
|
+
e.style.width = `${Math.max(30, C)}px`;
|
|
1128
|
+
}, g = (h) => {
|
|
1129
|
+
const C = i + (h.clientY - d);
|
|
1130
|
+
e.style.height = `${Math.max(20, C)}px`;
|
|
1057
1131
|
}, p = () => {
|
|
1058
|
-
document.removeEventListener("mousemove",
|
|
1132
|
+
document.removeEventListener("mousemove", v), document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", p);
|
|
1059
1133
|
};
|
|
1060
|
-
},
|
|
1061
|
-
const
|
|
1062
|
-
|
|
1134
|
+
}, Ye = (e) => {
|
|
1135
|
+
const r = e.target.closest("td, th");
|
|
1136
|
+
r && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((a) => a.classList.remove("rte-cell-highlight")), r.classList.add("rte-cell-highlight"), q({
|
|
1063
1137
|
visible: !0,
|
|
1064
1138
|
x: e.clientX,
|
|
1065
1139
|
y: e.clientY,
|
|
1066
|
-
cell:
|
|
1140
|
+
cell: r
|
|
1067
1141
|
}));
|
|
1068
|
-
},
|
|
1142
|
+
}, ue = () => {
|
|
1069
1143
|
document.querySelectorAll(".rte-cell-highlight").forEach((e) => e.classList.remove("rte-cell-highlight"));
|
|
1070
|
-
},
|
|
1071
|
-
if (!
|
|
1072
|
-
const
|
|
1073
|
-
const
|
|
1074
|
-
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;
|
|
1075
1149
|
};
|
|
1076
1150
|
switch (e) {
|
|
1077
1151
|
case "insertRowAbove": {
|
|
1078
|
-
const l =
|
|
1079
|
-
Array.from(l.cells).forEach((
|
|
1080
|
-
|
|
1152
|
+
const l = t.rows[a], i = t.insertRow(a);
|
|
1153
|
+
Array.from(l.cells).forEach((v) => {
|
|
1154
|
+
i.appendChild(d(v));
|
|
1081
1155
|
});
|
|
1082
1156
|
break;
|
|
1083
1157
|
}
|
|
1084
1158
|
case "insertRowBelow": {
|
|
1085
|
-
const l =
|
|
1086
|
-
Array.from(l.cells).forEach((
|
|
1087
|
-
|
|
1159
|
+
const l = t.rows[a], i = t.insertRow(a + 1);
|
|
1160
|
+
Array.from(l.cells).forEach((v) => {
|
|
1161
|
+
i.appendChild(d(v));
|
|
1088
1162
|
});
|
|
1089
1163
|
break;
|
|
1090
1164
|
}
|
|
1091
1165
|
case "insertColLeft": {
|
|
1092
|
-
Array.from(
|
|
1093
|
-
const
|
|
1094
|
-
l.insertBefore(
|
|
1166
|
+
Array.from(t.rows).forEach((l) => {
|
|
1167
|
+
const i = l.cells[r];
|
|
1168
|
+
l.insertBefore(d(i), i);
|
|
1095
1169
|
});
|
|
1096
1170
|
break;
|
|
1097
1171
|
}
|
|
1098
1172
|
case "insertColRight": {
|
|
1099
|
-
Array.from(
|
|
1100
|
-
const
|
|
1101
|
-
l.insertBefore(
|
|
1173
|
+
Array.from(t.rows).forEach((l) => {
|
|
1174
|
+
const i = l.cells[r];
|
|
1175
|
+
l.insertBefore(d(i), i.nextSibling);
|
|
1102
1176
|
});
|
|
1103
1177
|
break;
|
|
1104
1178
|
}
|
|
1105
1179
|
case "deleteRow":
|
|
1106
|
-
|
|
1180
|
+
t.rows.length > 1 && t.deleteRow(a);
|
|
1107
1181
|
break;
|
|
1108
1182
|
case "deleteCol":
|
|
1109
|
-
Array.from(
|
|
1110
|
-
l.cells[
|
|
1183
|
+
Array.from(t.rows).forEach((l) => {
|
|
1184
|
+
l.cells[r] && l.deleteCell(r);
|
|
1111
1185
|
});
|
|
1112
1186
|
break;
|
|
1113
1187
|
}
|
|
1114
|
-
|
|
1188
|
+
M(), q(ae(re({}, D), {
|
|
1115
1189
|
visible: !1
|
|
1116
|
-
})),
|
|
1117
|
-
},
|
|
1118
|
-
const
|
|
1119
|
-
if (!
|
|
1190
|
+
})), ue();
|
|
1191
|
+
}, Qe = (e) => {
|
|
1192
|
+
const t = e.querySelector("tbody");
|
|
1193
|
+
if (!t || t.querySelector("[data-hidden-table-start]")) return;
|
|
1194
|
+
const r = document.createElement("span");
|
|
1195
|
+
r.textContent = "{{#arrayData}}", r.style.display = "none", r.setAttribute("data-hidden-table-start", "true"), t.insertBefore(r, t.firstChild);
|
|
1120
1196
|
const a = document.createElement("span");
|
|
1121
|
-
a.textContent = "{{
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
const
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
return
|
|
1129
|
-
},
|
|
1130
|
-
|
|
1197
|
+
a.textContent = "{{/arrayData}}", a.style.display = "none", a.setAttribute("data-hidden-table-end", "true"), t.appendChild(a);
|
|
1198
|
+
}, me = () => {
|
|
1199
|
+
const e = O();
|
|
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({
|
|
1131
1207
|
url: "",
|
|
1132
1208
|
text: "",
|
|
1133
1209
|
title: "",
|
|
1134
1210
|
target: "_self"
|
|
1135
|
-
}),
|
|
1136
|
-
},
|
|
1137
|
-
const
|
|
1138
|
-
if (!
|
|
1139
|
-
|
|
1140
|
-
let
|
|
1141
|
-
/^https?:\/\//i.test(
|
|
1142
|
-
const
|
|
1143
|
-
|
|
1144
|
-
const
|
|
1145
|
-
|
|
1211
|
+
}), f(!0);
|
|
1212
|
+
}, Ge = (e) => {
|
|
1213
|
+
const t = window.getSelection();
|
|
1214
|
+
if (!t || !y.current) return;
|
|
1215
|
+
t.removeAllRanges(), t.addRange(y.current);
|
|
1216
|
+
let r = e.url.trim();
|
|
1217
|
+
/^https?:\/\//i.test(r) || (r = "https://" + r);
|
|
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);
|
|
1146
1222
|
const l = document.createTextNode(" ");
|
|
1147
|
-
|
|
1148
|
-
const
|
|
1149
|
-
|
|
1150
|
-
},
|
|
1151
|
-
const
|
|
1152
|
-
if (
|
|
1153
|
-
const
|
|
1223
|
+
a.after(l);
|
|
1224
|
+
const i = document.createRange();
|
|
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;
|
|
1154
1230
|
if (e.ctrlKey || e.metaKey) {
|
|
1155
|
-
window.open(
|
|
1231
|
+
window.open(r.href, "_blank", "noopener,noreferrer");
|
|
1156
1232
|
return;
|
|
1157
1233
|
}
|
|
1158
1234
|
e.preventDefault();
|
|
1159
|
-
const
|
|
1160
|
-
|
|
1161
|
-
url:
|
|
1162
|
-
text:
|
|
1163
|
-
title:
|
|
1164
|
-
target:
|
|
1165
|
-
}),
|
|
1235
|
+
const a = document.createRange();
|
|
1236
|
+
a.selectNode(r), y.current = a, oe({
|
|
1237
|
+
url: r.href,
|
|
1238
|
+
text: r.textContent || r.href,
|
|
1239
|
+
title: r.title,
|
|
1240
|
+
target: r.target
|
|
1241
|
+
}), f(!0);
|
|
1166
1242
|
}
|
|
1167
|
-
},
|
|
1168
|
-
const e =
|
|
1243
|
+
}, tt = () => {
|
|
1244
|
+
const e = O();
|
|
1169
1245
|
if (!e) return;
|
|
1170
|
-
const
|
|
1171
|
-
if ((!
|
|
1246
|
+
const t = window.getSelection();
|
|
1247
|
+
if ((!t || t.rangeCount === 0) && _.current) {
|
|
1172
1248
|
const h = window.getSelection();
|
|
1173
|
-
h == null || h.removeAllRanges(), h == null || h.addRange(
|
|
1249
|
+
h == null || h.removeAllRanges(), h == null || h.addRange(_.current);
|
|
1174
1250
|
}
|
|
1175
|
-
const
|
|
1176
|
-
if (!
|
|
1177
|
-
const
|
|
1178
|
-
|
|
1179
|
-
const
|
|
1180
|
-
l.appendChild(
|
|
1181
|
-
const
|
|
1182
|
-
for (;
|
|
1183
|
-
const h =
|
|
1184
|
-
|
|
1251
|
+
const r = window.getSelection();
|
|
1252
|
+
if (!r || r.rangeCount === 0) return;
|
|
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 = [];
|
|
1258
|
+
for (; i.nextNode(); ) {
|
|
1259
|
+
const h = i.currentNode, C = h.tagName.toUpperCase(), A = h.getAttribute && h.getAttribute("data-mention") !== null;
|
|
1260
|
+
C !== "A" && !A && v.push(h);
|
|
1185
1261
|
}
|
|
1186
|
-
for (let h =
|
|
1187
|
-
const
|
|
1188
|
-
if (
|
|
1189
|
-
for (;
|
|
1190
|
-
|
|
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);
|
|
1191
1267
|
}
|
|
1192
1268
|
}
|
|
1193
|
-
l.querySelectorAll("[style]").forEach((h) => h.removeAttribute("style")),
|
|
1194
|
-
const
|
|
1195
|
-
for (; l.firstChild; )
|
|
1196
|
-
|
|
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);
|
|
1197
1273
|
const p = document.createRange();
|
|
1198
|
-
p.setStartAfter(
|
|
1199
|
-
},
|
|
1200
|
-
var
|
|
1201
|
-
let
|
|
1202
|
-
|
|
1203
|
-
const
|
|
1204
|
-
return
|
|
1205
|
-
|
|
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, "");
|
|
1279
|
+
const r = document.createElement("div");
|
|
1280
|
+
return r.innerHTML = t, r.querySelectorAll("br").forEach((d) => {
|
|
1281
|
+
d.replaceWith(`
|
|
1206
1282
|
`);
|
|
1207
|
-
}),
|
|
1208
|
-
|
|
1283
|
+
}), r.querySelectorAll("p, div, tr").forEach((d) => {
|
|
1284
|
+
d.insertAdjacentText("afterend", `
|
|
1209
1285
|
`);
|
|
1210
|
-
}),
|
|
1211
|
-
|
|
1286
|
+
}), r.querySelectorAll("table").forEach((d) => {
|
|
1287
|
+
d.insertAdjacentText("afterend", `
|
|
1212
1288
|
`);
|
|
1213
|
-
}), ((
|
|
1289
|
+
}), ((a = r.textContent) == null ? void 0 : a.replace(/\n{3,}/g, `
|
|
1214
1290
|
|
|
1215
1291
|
`).trim()) || "";
|
|
1216
1292
|
};
|
|
1217
|
-
return /* @__PURE__ */
|
|
1218
|
-
className: `rte-wrapper ${(
|
|
1293
|
+
return /* @__PURE__ */ o.createElement("div", {
|
|
1294
|
+
className: `rte-wrapper ${(m == null ? void 0 : m.wrapper) || ""}`,
|
|
1219
1295
|
style: w.wrapper
|
|
1220
|
-
}, /* @__PURE__ */
|
|
1296
|
+
}, /* @__PURE__ */ o.createElement("div", {
|
|
1221
1297
|
style: {
|
|
1222
1298
|
flex: 1
|
|
1223
1299
|
}
|
|
1224
|
-
}, /* @__PURE__ */
|
|
1225
|
-
exec:
|
|
1226
|
-
saveSelection:
|
|
1227
|
-
handleFileChange:
|
|
1228
|
-
handleFontSizeChange: (e) =>
|
|
1229
|
-
handleFontFamilyChange: (e) =>
|
|
1230
|
-
insertEmoji:
|
|
1231
|
-
handleLink:
|
|
1232
|
-
removeFormatting:
|
|
1233
|
-
visibleActions:
|
|
1234
|
-
className:
|
|
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,
|
|
1235
1311
|
style: w.toolbar
|
|
1236
|
-
}), /* @__PURE__ */
|
|
1237
|
-
ref:
|
|
1238
|
-
className: `rte-editor ${(
|
|
1312
|
+
}), /* @__PURE__ */ o.createElement("div", {
|
|
1313
|
+
ref: k,
|
|
1314
|
+
className: `rte-editor ${(m == null ? void 0 : m.editor) || ""}`,
|
|
1239
1315
|
style: w.editor,
|
|
1240
1316
|
contentEditable: !0,
|
|
1241
1317
|
suppressContentEditableWarning: !0,
|
|
1242
|
-
onInput:
|
|
1243
|
-
onKeyDown:
|
|
1244
|
-
onBeforeInput:
|
|
1245
|
-
onContextMenu:
|
|
1246
|
-
onClick:
|
|
1247
|
-
}), /* @__PURE__ */
|
|
1248
|
-
show:
|
|
1249
|
-
position:
|
|
1250
|
-
filtered:
|
|
1251
|
-
insertMention:
|
|
1252
|
-
onClose: () =>
|
|
1253
|
-
query:
|
|
1254
|
-
}), c && /* @__PURE__ */
|
|
1255
|
-
className: `rte-output ${(
|
|
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),
|
|
1329
|
+
query: Ne
|
|
1330
|
+
}), c && /* @__PURE__ */ o.createElement("div", {
|
|
1331
|
+
className: `rte-output ${(m == null ? void 0 : m.output) || ""}`,
|
|
1256
1332
|
style: w.output
|
|
1257
|
-
}, /* @__PURE__ */
|
|
1258
|
-
visible:
|
|
1259
|
-
x:
|
|
1260
|
-
y:
|
|
1261
|
-
onAction:
|
|
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,
|
|
1262
1338
|
onClose: () => {
|
|
1263
|
-
q(
|
|
1339
|
+
q(ae(re({}, D), {
|
|
1264
1340
|
visible: !1
|
|
1265
|
-
})),
|
|
1341
|
+
})), ue();
|
|
1266
1342
|
}
|
|
1267
|
-
}), /* @__PURE__ */
|
|
1268
|
-
visible:
|
|
1269
|
-
linkData:
|
|
1270
|
-
onClose: () =>
|
|
1271
|
-
onInsert:
|
|
1272
|
-
})),
|
|
1273
|
-
className:
|
|
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,
|
|
1274
1350
|
style: w.preview,
|
|
1275
|
-
html:
|
|
1351
|
+
html: me()
|
|
1276
1352
|
}) : null);
|
|
1277
1353
|
};
|
|
1278
1354
|
export {
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1355
|
+
Bt as RichTextEditor,
|
|
1356
|
+
jt as RtePreview,
|
|
1357
|
+
Dt as RteToolbar
|
|
1282
1358
|
};
|