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