@ryzeup/richtexteditor 1.0.15 → 1.0.16
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 +290 -270
- package/dist/index.js +5 -5
- package/dist/index.umd.js +2 -2
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var ct = Object.defineProperty, it = Object.defineProperties;
|
|
2
|
+
var st = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var Le = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var dt = Object.prototype.hasOwnProperty, ut = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Se = (r, c, d) => c in r ? ct(r, c, { enumerable: !0, configurable: !0, writable: !0, value: d }) : r[c] = d, ae = (r, c) => {
|
|
6
6
|
for (var d in c || (c = {}))
|
|
7
|
-
|
|
7
|
+
dt.call(c, d) && Se(r, d, c[d]);
|
|
8
8
|
if (Le)
|
|
9
9
|
for (var d of Le(c))
|
|
10
|
-
|
|
10
|
+
ut.call(c, d) && Se(r, d, c[d]);
|
|
11
11
|
return r;
|
|
12
|
-
}, oe = (r, c) =>
|
|
13
|
-
import * as
|
|
14
|
-
import o, { useRef as P, useState as
|
|
15
|
-
import { createPortal as
|
|
16
|
-
window.React =
|
|
17
|
-
var
|
|
12
|
+
}, oe = (r, c) => it(r, st(c));
|
|
13
|
+
import * as mt from "react";
|
|
14
|
+
import o, { useRef as P, useState as M, useEffect as B } from "react";
|
|
15
|
+
import { createPortal as gt } from "react-dom";
|
|
16
|
+
window.React = mt;
|
|
17
|
+
var ke = {
|
|
18
18
|
color: void 0,
|
|
19
19
|
size: void 0,
|
|
20
20
|
className: void 0,
|
|
21
21
|
style: void 0,
|
|
22
22
|
attr: void 0
|
|
23
|
-
},
|
|
24
|
-
function
|
|
23
|
+
}, Me = o.createContext && /* @__PURE__ */ o.createContext(ke), ft = ["attr", "size", "title"];
|
|
24
|
+
function ht(r, c) {
|
|
25
25
|
if (r == null) return {};
|
|
26
|
-
var d =
|
|
26
|
+
var d = pt(r, c), u, m;
|
|
27
27
|
if (Object.getOwnPropertySymbols) {
|
|
28
28
|
var y = Object.getOwnPropertySymbols(r);
|
|
29
29
|
for (m = 0; m < y.length; m++)
|
|
@@ -31,7 +31,7 @@ function ft(r, c) {
|
|
|
31
31
|
}
|
|
32
32
|
return d;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function pt(r, c) {
|
|
35
35
|
if (r == null) return {};
|
|
36
36
|
var d = {};
|
|
37
37
|
for (var u in r)
|
|
@@ -51,7 +51,7 @@ function Q() {
|
|
|
51
51
|
return r;
|
|
52
52
|
}, Q.apply(this, arguments);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function Ae(r, c) {
|
|
55
55
|
var d = Object.keys(r);
|
|
56
56
|
if (Object.getOwnPropertySymbols) {
|
|
57
57
|
var u = Object.getOwnPropertySymbols(r);
|
|
@@ -64,22 +64,22 @@ function Me(r, c) {
|
|
|
64
64
|
function J(r) {
|
|
65
65
|
for (var c = 1; c < arguments.length; c++) {
|
|
66
66
|
var d = arguments[c] != null ? arguments[c] : {};
|
|
67
|
-
c % 2 ?
|
|
68
|
-
|
|
69
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(d)) :
|
|
67
|
+
c % 2 ? Ae(Object(d), !0).forEach(function(u) {
|
|
68
|
+
vt(r, u, d[u]);
|
|
69
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(d)) : Ae(Object(d)).forEach(function(u) {
|
|
70
70
|
Object.defineProperty(r, u, Object.getOwnPropertyDescriptor(d, u));
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
return r;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
return c =
|
|
75
|
+
function vt(r, c, d) {
|
|
76
|
+
return c = Et(c), c in r ? Object.defineProperty(r, c, { value: d, enumerable: !0, configurable: !0, writable: !0 }) : r[c] = d, r;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
var c =
|
|
78
|
+
function Et(r) {
|
|
79
|
+
var c = yt(r, "string");
|
|
80
80
|
return typeof c == "symbol" ? c : c + "";
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function yt(r, c) {
|
|
83
83
|
if (typeof r != "object" || !r) return r;
|
|
84
84
|
var d = r[Symbol.toPrimitive];
|
|
85
85
|
if (d !== void 0) {
|
|
@@ -89,28 +89,28 @@ function vt(r, c) {
|
|
|
89
89
|
}
|
|
90
90
|
return (c === "string" ? String : Number)(r);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function Te(r) {
|
|
93
93
|
return r && r.map((c, d) => /* @__PURE__ */ o.createElement(c.tag, J({
|
|
94
94
|
key: d
|
|
95
|
-
}, c.attr),
|
|
95
|
+
}, c.attr), Te(c.child)));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
return (c) => /* @__PURE__ */ o.createElement(
|
|
97
|
+
function A(r) {
|
|
98
|
+
return (c) => /* @__PURE__ */ o.createElement(wt, Q({
|
|
99
99
|
attr: J({}, r.attr)
|
|
100
|
-
}, c),
|
|
100
|
+
}, c), Te(r.child));
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function wt(r) {
|
|
103
103
|
var c = (d) => {
|
|
104
104
|
var {
|
|
105
105
|
attr: u,
|
|
106
106
|
size: m,
|
|
107
107
|
title: y
|
|
108
|
-
} = r,
|
|
108
|
+
} = r, S = ht(r, ft), b = m || d.size || "1em", E;
|
|
109
109
|
return d.className && (E = d.className), r.className && (E = (E ? E + " " : "") + r.className), /* @__PURE__ */ o.createElement("svg", Q({
|
|
110
110
|
stroke: "currentColor",
|
|
111
111
|
fill: "currentColor",
|
|
112
112
|
strokeWidth: "0"
|
|
113
|
-
}, d.attr, u,
|
|
113
|
+
}, d.attr, u, S, {
|
|
114
114
|
className: E,
|
|
115
115
|
style: J(J({
|
|
116
116
|
color: r.color || d.color
|
|
@@ -120,54 +120,54 @@ function Et(r) {
|
|
|
120
120
|
xmlns: "http://www.w3.org/2000/svg"
|
|
121
121
|
}), y && /* @__PURE__ */ o.createElement("title", null, y), r.children);
|
|
122
122
|
};
|
|
123
|
-
return
|
|
124
|
-
}
|
|
125
|
-
function yt(r) {
|
|
126
|
-
return M({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M352 64c0-17.7-14.3-32-32-32L128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32z" }, child: [] }] })(r);
|
|
127
|
-
}
|
|
128
|
-
function wt(r) {
|
|
129
|
-
return M({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M448 64c0 17.7-14.3 32-32 32L192 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z" }, child: [] }] })(r);
|
|
123
|
+
return Me !== void 0 ? /* @__PURE__ */ o.createElement(Me.Consumer, null, (d) => c(d)) : c(ke);
|
|
130
124
|
}
|
|
131
125
|
function Ct(r) {
|
|
132
|
-
return
|
|
126
|
+
return A({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M352 64c0-17.7-14.3-32-32-32L128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32z" }, child: [] }] })(r);
|
|
133
127
|
}
|
|
134
128
|
function bt(r) {
|
|
135
|
-
return
|
|
129
|
+
return A({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M448 64c0 17.7-14.3 32-32 32L192 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z" }, child: [] }] })(r);
|
|
130
|
+
}
|
|
131
|
+
function Rt(r) {
|
|
132
|
+
return A({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z" }, child: [] }] })(r);
|
|
136
133
|
}
|
|
137
134
|
function xt(r) {
|
|
138
|
-
return
|
|
135
|
+
return A({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M24 56c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24l0 120 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-96-8 0C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432l33.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-88 0c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z" }, child: [] }] })(r);
|
|
139
136
|
}
|
|
140
137
|
function Lt(r) {
|
|
141
|
-
return
|
|
142
|
-
}
|
|
143
|
-
function Rt(r) {
|
|
144
|
-
return M({ attr: { viewBox: "0 0 544 512" }, child: [{ tag: "path", attr: { d: "M0 479.98L99.92 512l35.45-35.45-67.04-67.04L0 479.98zm124.61-240.01a36.592 36.592 0 0 0-10.79 38.1l13.05 42.83-50.93 50.94 96.23 96.23 50.86-50.86 42.74 13.08c13.73 4.2 28.65-.01 38.15-10.78l35.55-41.64-173.34-173.34-41.52 35.44zm403.31-160.7l-63.2-63.2c-20.49-20.49-53.38-21.52-75.12-2.35L190.55 183.68l169.77 169.78L530.27 154.4c19.18-21.74 18.15-54.63-2.35-75.13z" }, child: [] }] })(r);
|
|
138
|
+
return A({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M12.83 352h262.34A12.82 12.82 0 0 0 288 339.17v-38.34A12.82 12.82 0 0 0 275.17 288H12.83A12.82 12.82 0 0 0 0 300.83v38.34A12.82 12.82 0 0 0 12.83 352zm0-256h262.34A12.82 12.82 0 0 0 288 83.17V44.83A12.82 12.82 0 0 0 275.17 32H12.83A12.82 12.82 0 0 0 0 44.83v38.34A12.82 12.82 0 0 0 12.83 96zM432 160H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0 256H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(r);
|
|
145
139
|
}
|
|
146
140
|
function St(r) {
|
|
147
|
-
return
|
|
141
|
+
return A({ attr: { viewBox: "0 0 384 512" }, child: [{ tag: "path", attr: { d: "M333.49 238a122 122 0 0 0 27-65.21C367.87 96.49 308 32 233.42 32H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h31.87v288H34a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h209.32c70.8 0 134.14-51.75 141-122.4 4.74-48.45-16.39-92.06-50.83-119.6zM145.66 112h87.76a48 48 0 0 1 0 96h-87.76zm87.76 288h-87.76V288h87.76a56 56 0 0 1 0 112z" }, child: [] }] })(r);
|
|
148
142
|
}
|
|
149
143
|
function Mt(r) {
|
|
150
|
-
return
|
|
151
|
-
}
|
|
152
|
-
function zt(r) {
|
|
153
|
-
return M({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(r);
|
|
154
|
-
}
|
|
155
|
-
function kt(r) {
|
|
156
|
-
return M({ attr: { viewBox: "0 0 496 512" }, child: [{ tag: "path", attr: { d: "M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm194.8 170.2C334.3 380.4 292.5 400 248 400s-86.3-19.6-114.8-53.8c-13.6-16.3 11-36.7 24.6-20.5 22.4 26.9 55.2 42.2 90.2 42.2s67.8-15.4 90.2-42.2c13.4-16.2 38.1 4.2 24.6 20.5z" }, child: [] }] })(r);
|
|
144
|
+
return A({ attr: { viewBox: "0 0 544 512" }, child: [{ tag: "path", attr: { d: "M0 479.98L99.92 512l35.45-35.45-67.04-67.04L0 479.98zm124.61-240.01a36.592 36.592 0 0 0-10.79 38.1l13.05 42.83-50.93 50.94 96.23 96.23 50.86-50.86 42.74 13.08c13.73 4.2 28.65-.01 38.15-10.78l35.55-41.64-173.34-173.34-41.52 35.44zm403.31-160.7l-63.2-63.2c-20.49-20.49-53.38-21.52-75.12-2.35L190.55 183.68l169.77 169.78L530.27 154.4c19.18-21.74 18.15-54.63-2.35-75.13z" }, child: [] }] })(r);
|
|
157
145
|
}
|
|
158
146
|
function At(r) {
|
|
159
|
-
return
|
|
147
|
+
return A({ attr: { viewBox: "0 0 320 512" }, child: [{ tag: "path", attr: { d: "M320 48v32a16 16 0 0 1-16 16h-62.76l-80 320H208a16 16 0 0 1 16 16v32a16 16 0 0 1-16 16H16a16 16 0 0 1-16-16v-32a16 16 0 0 1 16-16h62.76l80-320H112a16 16 0 0 1-16-16V48a16 16 0 0 1 16-16h192a16 16 0 0 1 16 16z" }, child: [] }] })(r);
|
|
148
|
+
}
|
|
149
|
+
function zt(r) {
|
|
150
|
+
return A({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z" }, child: [] }] })(r);
|
|
160
151
|
}
|
|
161
152
|
function Nt(r) {
|
|
162
|
-
return
|
|
153
|
+
return A({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(r);
|
|
154
|
+
}
|
|
155
|
+
function kt(r) {
|
|
156
|
+
return A({ attr: { viewBox: "0 0 496 512" }, child: [{ tag: "path", attr: { d: "M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm194.8 170.2C334.3 380.4 292.5 400 248 400s-86.3-19.6-114.8-53.8c-13.6-16.3 11-36.7 24.6-20.5 22.4 26.9 55.2 42.2 90.2 42.2s67.8-15.4 90.2-42.2c13.4-16.2 38.1 4.2 24.6 20.5z" }, child: [] }] })(r);
|
|
163
157
|
}
|
|
164
158
|
function Tt(r) {
|
|
165
|
-
return
|
|
159
|
+
return A({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M464 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48zM224 416H64v-96h160v96zm0-160H64v-96h160v96zm224 160H288v-96h160v96zm0-160H288v-96h160v96z" }, child: [] }] })(r);
|
|
166
160
|
}
|
|
167
161
|
function Dt(r) {
|
|
168
|
-
return
|
|
162
|
+
return A({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M32 64h32v160c0 88.22 71.78 160 160 160s160-71.78 160-160V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H272a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h32v160a80 80 0 0 1-160 0V64h32a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16H32a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zm400 384H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" }, child: [] }] })(r);
|
|
169
163
|
}
|
|
170
|
-
|
|
164
|
+
function Ot(r) {
|
|
165
|
+
return A({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M2 20h20v4H2v-4zm3.49-3h2.42l1.27-3.58h5.65L16.09 17h2.42L13.25 3h-2.5L5.49 17zm4.42-5.61 2.03-5.79h.12l2.03 5.79H9.91z" }, child: [] }] })(r);
|
|
166
|
+
}
|
|
167
|
+
function Ht(r) {
|
|
168
|
+
return A({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0V0z" }, child: [] }, { tag: "path", attr: { d: "M20 8V5H6.39l3 3h1.83l-.55 1.28 2.09 2.1L14.21 8zM3.41 4.86 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21l1.41-1.41z" }, child: [] }] })(r);
|
|
169
|
+
}
|
|
170
|
+
const jt = [
|
|
171
171
|
"😀",
|
|
172
172
|
"😁",
|
|
173
173
|
"😂",
|
|
@@ -279,7 +279,7 @@ const Ot = [
|
|
|
279
279
|
"👏",
|
|
280
280
|
"🫶",
|
|
281
281
|
"👐"
|
|
282
|
-
],
|
|
282
|
+
], _t = ({
|
|
283
283
|
exec: r,
|
|
284
284
|
saveSelection: c,
|
|
285
285
|
handleFileChange: d,
|
|
@@ -287,27 +287,27 @@ const Ot = [
|
|
|
287
287
|
handleFontFamilyChange: m,
|
|
288
288
|
// insertListBlock,
|
|
289
289
|
insertEmoji: y,
|
|
290
|
-
handleLink:
|
|
290
|
+
handleLink: S,
|
|
291
291
|
removeFormatting: b,
|
|
292
292
|
visibleActions: E,
|
|
293
293
|
className: O,
|
|
294
294
|
style: _
|
|
295
295
|
}) => {
|
|
296
296
|
var V, T;
|
|
297
|
-
const
|
|
297
|
+
const z = P(null), H = P(null), R = P(null), [G, $] = M(!1), [q, I] = M({
|
|
298
298
|
x: 0,
|
|
299
299
|
y: 0
|
|
300
300
|
});
|
|
301
|
-
|
|
302
|
-
const
|
|
301
|
+
B(() => {
|
|
302
|
+
const f = (w) => {
|
|
303
303
|
!w.target.closest(".rte-emoji-popup") && !w.target.closest("button[title='Emoji']") && $(!1);
|
|
304
304
|
};
|
|
305
|
-
return document.addEventListener("mousedown",
|
|
305
|
+
return document.addEventListener("mousedown", f), () => document.removeEventListener("mousedown", f);
|
|
306
306
|
}, []);
|
|
307
|
-
const F = (
|
|
307
|
+
const F = (f) => {
|
|
308
308
|
var j;
|
|
309
|
-
|
|
310
|
-
const w =
|
|
309
|
+
f.preventDefault();
|
|
310
|
+
const w = f.currentTarget.dataset.command;
|
|
311
311
|
if (w)
|
|
312
312
|
switch (w) {
|
|
313
313
|
case "bold":
|
|
@@ -319,17 +319,17 @@ const Ot = [
|
|
|
319
319
|
r(w);
|
|
320
320
|
break;
|
|
321
321
|
case "insertImage": {
|
|
322
|
-
(j =
|
|
322
|
+
(j = z.current) == null || j.click();
|
|
323
323
|
break;
|
|
324
324
|
}
|
|
325
325
|
default:
|
|
326
326
|
console.warn("Unknown command:", w);
|
|
327
327
|
}
|
|
328
|
-
}, ee = (
|
|
329
|
-
r("foreColor",
|
|
330
|
-
}, te = (
|
|
331
|
-
r("backColor",
|
|
332
|
-
}, [L,
|
|
328
|
+
}, ee = (f) => {
|
|
329
|
+
r("foreColor", f.target.value);
|
|
330
|
+
}, te = (f) => {
|
|
331
|
+
r("backColor", f.target.value);
|
|
332
|
+
}, [L, k] = M({
|
|
333
333
|
bold: !1,
|
|
334
334
|
italic: !1,
|
|
335
335
|
underline: !1,
|
|
@@ -346,9 +346,9 @@ const Ot = [
|
|
|
346
346
|
color: !1,
|
|
347
347
|
highlight: !1
|
|
348
348
|
});
|
|
349
|
-
return
|
|
350
|
-
const
|
|
351
|
-
|
|
349
|
+
return B(() => {
|
|
350
|
+
const f = () => {
|
|
351
|
+
k({
|
|
352
352
|
bold: document.queryCommandState("bold"),
|
|
353
353
|
italic: document.queryCommandState("italic"),
|
|
354
354
|
underline: document.queryCommandState("underline"),
|
|
@@ -366,7 +366,7 @@ const Ot = [
|
|
|
366
366
|
highlight: document.queryCommandState("backColor")
|
|
367
367
|
});
|
|
368
368
|
};
|
|
369
|
-
return document.addEventListener("selectionchange",
|
|
369
|
+
return document.addEventListener("selectionchange", f), () => document.removeEventListener("selectionchange", f);
|
|
370
370
|
}, []), /* @__PURE__ */ o.createElement("div", {
|
|
371
371
|
className: `rte-toolbar ${O || ""}`,
|
|
372
372
|
style: _
|
|
@@ -375,47 +375,47 @@ const Ot = [
|
|
|
375
375
|
title: "Bold",
|
|
376
376
|
onMouseDown: F,
|
|
377
377
|
className: L.bold ? "rte-active" : ""
|
|
378
|
-
}, /* @__PURE__ */ o.createElement(
|
|
378
|
+
}, /* @__PURE__ */ o.createElement(St, null)), E.italic && /* @__PURE__ */ o.createElement("button", {
|
|
379
379
|
"data-command": "italic",
|
|
380
380
|
title: "Italic",
|
|
381
381
|
onMouseDown: F,
|
|
382
382
|
className: L.italic ? "rte-active" : ""
|
|
383
|
-
}, /* @__PURE__ */ o.createElement(
|
|
383
|
+
}, /* @__PURE__ */ o.createElement(At, null)), E.underline && /* @__PURE__ */ o.createElement("button", {
|
|
384
384
|
"data-command": "underline",
|
|
385
385
|
title: "Underline",
|
|
386
386
|
onMouseDown: F,
|
|
387
387
|
className: L.underline ? "rte-active" : ""
|
|
388
|
-
}, /* @__PURE__ */ o.createElement(
|
|
388
|
+
}, /* @__PURE__ */ o.createElement(Dt, null)), E.unorderedList && /* @__PURE__ */ o.createElement("button", {
|
|
389
389
|
"data-command": "insertUnorderedList",
|
|
390
390
|
onMouseDown: F,
|
|
391
391
|
title: "UnorderedList",
|
|
392
392
|
className: L.unorderedList ? "rte-active" : ""
|
|
393
|
-
}, /* @__PURE__ */ o.createElement(
|
|
393
|
+
}, /* @__PURE__ */ o.createElement(Nt, null)), E.orderedList && /* @__PURE__ */ o.createElement("button", {
|
|
394
394
|
"data-command": "insertOrderedList",
|
|
395
395
|
title: "OrderedList",
|
|
396
396
|
onMouseDown: F,
|
|
397
397
|
className: L.orderedList ? "rte-active" : ""
|
|
398
|
-
}, /* @__PURE__ */ o.createElement(
|
|
398
|
+
}, /* @__PURE__ */ o.createElement(xt, null)), E.link && /* @__PURE__ */ o.createElement("button", {
|
|
399
399
|
"data-command": "createLink",
|
|
400
400
|
title: "Link",
|
|
401
|
-
onClick:
|
|
401
|
+
onClick: S,
|
|
402
402
|
className: L.link ? "rte-active" : ""
|
|
403
|
-
}, /* @__PURE__ */ o.createElement(
|
|
403
|
+
}, /* @__PURE__ */ o.createElement(zt, null)), E.removeFormat && /* @__PURE__ */ o.createElement("button", {
|
|
404
404
|
"data-command": "Remove format",
|
|
405
405
|
title: "removeFormat",
|
|
406
|
-
onMouseDown: (
|
|
407
|
-
|
|
406
|
+
onMouseDown: (f) => {
|
|
407
|
+
f.preventDefault(), c(), b();
|
|
408
408
|
},
|
|
409
409
|
className: L.removeFormat ? "rte-active" : ""
|
|
410
|
-
}, /* @__PURE__ */ o.createElement(
|
|
410
|
+
}, /* @__PURE__ */ o.createElement(Ht, null)), E.image && /* @__PURE__ */ o.createElement("button", {
|
|
411
411
|
"data-command": "insertImage",
|
|
412
412
|
title: "Image",
|
|
413
413
|
onMouseDown: F,
|
|
414
414
|
className: L.image ? "rte-active" : ""
|
|
415
|
-
}, /* @__PURE__ */ o.createElement(
|
|
415
|
+
}, /* @__PURE__ */ o.createElement(Rt, null)), /* @__PURE__ */ o.createElement("input", {
|
|
416
416
|
type: "file",
|
|
417
417
|
accept: "image/*",
|
|
418
|
-
ref:
|
|
418
|
+
ref: z,
|
|
419
419
|
style: {
|
|
420
420
|
display: "none"
|
|
421
421
|
},
|
|
@@ -426,23 +426,23 @@ const Ot = [
|
|
|
426
426
|
}
|
|
427
427
|
}, /* @__PURE__ */ o.createElement("button", {
|
|
428
428
|
title: "Emoji",
|
|
429
|
-
onMouseDown: (
|
|
430
|
-
|
|
431
|
-
const w =
|
|
432
|
-
|
|
429
|
+
onMouseDown: (f) => {
|
|
430
|
+
f.preventDefault(), c();
|
|
431
|
+
const w = f.currentTarget.getBoundingClientRect();
|
|
432
|
+
I({
|
|
433
433
|
x: w.left,
|
|
434
434
|
y: w.bottom + 8
|
|
435
435
|
// small spacing
|
|
436
436
|
}), $((j) => !j);
|
|
437
437
|
},
|
|
438
438
|
className: L.emoji ? "rte-active" : ""
|
|
439
|
-
}, /* @__PURE__ */ o.createElement(kt, null)), G && /* @__PURE__ */
|
|
439
|
+
}, /* @__PURE__ */ o.createElement(kt, null)), G && /* @__PURE__ */ gt(/* @__PURE__ */ o.createElement("div", {
|
|
440
440
|
className: "rte-emoji-popup",
|
|
441
441
|
style: {
|
|
442
442
|
top: q.y,
|
|
443
443
|
left: q.x
|
|
444
444
|
}
|
|
445
|
-
},
|
|
445
|
+
}, jt.map((f, w) => /* @__PURE__ */ o.createElement("span", {
|
|
446
446
|
key: w,
|
|
447
447
|
style: {
|
|
448
448
|
fontSize: "20px",
|
|
@@ -450,17 +450,17 @@ const Ot = [
|
|
|
450
450
|
textAlign: "center"
|
|
451
451
|
},
|
|
452
452
|
onMouseDown: (j) => {
|
|
453
|
-
j.preventDefault(), y(
|
|
453
|
+
j.preventDefault(), y(f), $(!1);
|
|
454
454
|
}
|
|
455
|
-
},
|
|
455
|
+
}, f))), document.body)), E.color && /* @__PURE__ */ o.createElement("div", {
|
|
456
456
|
style: {
|
|
457
457
|
position: "relative"
|
|
458
458
|
}
|
|
459
459
|
}, /* @__PURE__ */ o.createElement("button", {
|
|
460
460
|
title: "Text Color",
|
|
461
|
-
onMouseDown: (
|
|
461
|
+
onMouseDown: (f) => {
|
|
462
462
|
var w;
|
|
463
|
-
|
|
463
|
+
f.preventDefault(), c(), (w = H.current) == null || w.click();
|
|
464
464
|
},
|
|
465
465
|
style: {
|
|
466
466
|
display: "flex",
|
|
@@ -470,13 +470,13 @@ const Ot = [
|
|
|
470
470
|
fontSize: "18px"
|
|
471
471
|
},
|
|
472
472
|
className: L.color ? "rte-active" : ""
|
|
473
|
-
}, /* @__PURE__ */ o.createElement(
|
|
473
|
+
}, /* @__PURE__ */ o.createElement(Ot, null)), /* @__PURE__ */ o.createElement("input", {
|
|
474
474
|
ref: H,
|
|
475
475
|
type: "color",
|
|
476
476
|
defaultValue: "#000000",
|
|
477
|
-
onChange: (
|
|
477
|
+
onChange: (f) => {
|
|
478
478
|
var w;
|
|
479
|
-
ee(
|
|
479
|
+
ee(f), ((w = f.target.parentElement) == null ? void 0 : w.querySelector("button")).style.color = f.target.value;
|
|
480
480
|
},
|
|
481
481
|
style: {
|
|
482
482
|
position: "absolute",
|
|
@@ -491,24 +491,24 @@ const Ot = [
|
|
|
491
491
|
}
|
|
492
492
|
}, /* @__PURE__ */ o.createElement("button", {
|
|
493
493
|
title: "Highlight",
|
|
494
|
-
onMouseDown: (
|
|
494
|
+
onMouseDown: (f) => {
|
|
495
495
|
var w;
|
|
496
|
-
|
|
496
|
+
f.preventDefault(), c(), (w = R.current) == null || w.click();
|
|
497
497
|
},
|
|
498
498
|
style: {
|
|
499
499
|
display: "flex",
|
|
500
500
|
alignItems: "center",
|
|
501
501
|
justifyContent: "center",
|
|
502
|
-
color: ((T =
|
|
502
|
+
color: ((T = R.current) == null ? void 0 : T.value) || "#000",
|
|
503
503
|
fontSize: "18px"
|
|
504
504
|
},
|
|
505
505
|
className: L.highlight ? "rte-active" : ""
|
|
506
|
-
}, /* @__PURE__ */ o.createElement(
|
|
507
|
-
ref:
|
|
506
|
+
}, /* @__PURE__ */ o.createElement(Mt, null)), /* @__PURE__ */ o.createElement("input", {
|
|
507
|
+
ref: R,
|
|
508
508
|
type: "color",
|
|
509
|
-
onChange: (
|
|
509
|
+
onChange: (f) => {
|
|
510
510
|
var w;
|
|
511
|
-
te(
|
|
511
|
+
te(f), ((w = f.target.parentElement) == null ? void 0 : w.querySelector("button")).style.color = f.target.value;
|
|
512
512
|
},
|
|
513
513
|
defaultValue: "#000000",
|
|
514
514
|
style: {
|
|
@@ -520,25 +520,25 @@ const Ot = [
|
|
|
520
520
|
}
|
|
521
521
|
})), E.align && /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("button", {
|
|
522
522
|
title: "Align Left",
|
|
523
|
-
onMouseDown: (
|
|
523
|
+
onMouseDown: (f) => f.preventDefault(),
|
|
524
524
|
onClick: () => r("justifyLeft"),
|
|
525
525
|
className: L.alignLeft ? "rte-active" : ""
|
|
526
|
-
}, /* @__PURE__ */ o.createElement(
|
|
526
|
+
}, /* @__PURE__ */ o.createElement(Lt, null)), /* @__PURE__ */ o.createElement("button", {
|
|
527
527
|
title: "Align Center",
|
|
528
|
-
onMouseDown: (
|
|
528
|
+
onMouseDown: (f) => f.preventDefault(),
|
|
529
529
|
onClick: () => r("justifyCenter"),
|
|
530
530
|
className: L.alignCenter ? "rte-active" : ""
|
|
531
|
-
}, /* @__PURE__ */ o.createElement(
|
|
531
|
+
}, /* @__PURE__ */ o.createElement(Ct, null)), /* @__PURE__ */ o.createElement("button", {
|
|
532
532
|
title: "Align Right",
|
|
533
|
-
onMouseDown: (
|
|
533
|
+
onMouseDown: (f) => f.preventDefault(),
|
|
534
534
|
onClick: () => r("justifyRight"),
|
|
535
535
|
className: L.alignRight ? "rte-active" : ""
|
|
536
|
-
}, /* @__PURE__ */ o.createElement(
|
|
536
|
+
}, /* @__PURE__ */ o.createElement(bt, null))), E.table && /* @__PURE__ */ o.createElement("button", {
|
|
537
537
|
title: "Insert Table",
|
|
538
|
-
onMouseDown: (
|
|
538
|
+
onMouseDown: (f) => f.preventDefault(),
|
|
539
539
|
onClick: () => r("insertTable"),
|
|
540
540
|
className: L.table ? "rte-active" : ""
|
|
541
|
-
}, /* @__PURE__ */ o.createElement(
|
|
541
|
+
}, /* @__PURE__ */ o.createElement(Tt, null)), E.fontFamily && /* @__PURE__ */ o.createElement("select", {
|
|
542
542
|
className: "rte-dropdown",
|
|
543
543
|
defaultValue: "",
|
|
544
544
|
onMouseDown: () => c(),
|
|
@@ -573,7 +573,7 @@ const Ot = [
|
|
|
573
573
|
}, "Medium"), /* @__PURE__ */ o.createElement("option", {
|
|
574
574
|
value: "5"
|
|
575
575
|
}, "Large")));
|
|
576
|
-
},
|
|
576
|
+
}, Ft = ({
|
|
577
577
|
show: r,
|
|
578
578
|
position: c,
|
|
579
579
|
filtered: d,
|
|
@@ -581,16 +581,16 @@ const Ot = [
|
|
|
581
581
|
onClose: m,
|
|
582
582
|
query: y
|
|
583
583
|
}) => {
|
|
584
|
-
const
|
|
585
|
-
return
|
|
584
|
+
const S = P(null);
|
|
585
|
+
return B(() => {
|
|
586
586
|
const b = (E) => {
|
|
587
|
-
|
|
587
|
+
S.current && !S.current.contains(E.target) && m();
|
|
588
588
|
};
|
|
589
589
|
return r && document.addEventListener("mousedown", b), () => {
|
|
590
590
|
document.removeEventListener("mousedown", b);
|
|
591
591
|
};
|
|
592
592
|
}, [r, m]), r ? /* @__PURE__ */ o.createElement("ul", {
|
|
593
|
-
ref:
|
|
593
|
+
ref: S,
|
|
594
594
|
className: "rte-popup",
|
|
595
595
|
style: {
|
|
596
596
|
top: c.y,
|
|
@@ -600,16 +600,16 @@ const Ot = [
|
|
|
600
600
|
name: b,
|
|
601
601
|
value: E
|
|
602
602
|
}) => {
|
|
603
|
-
const O = b.toLowerCase(), _ = y.toLowerCase(),
|
|
603
|
+
const O = b.toLowerCase(), _ = y.toLowerCase(), z = O.indexOf(_);
|
|
604
604
|
let H = b;
|
|
605
|
-
if (
|
|
606
|
-
const
|
|
607
|
-
H = b.substring(0,
|
|
605
|
+
if (z !== -1 && y.length > 0) {
|
|
606
|
+
const R = z + y.length;
|
|
607
|
+
H = b.substring(0, z) + `<span class="rte-highlight">${b.substring(z, R)}</span>` + b.substring(R);
|
|
608
608
|
}
|
|
609
609
|
return /* @__PURE__ */ o.createElement("li", {
|
|
610
610
|
key: E,
|
|
611
|
-
onMouseDown: (
|
|
612
|
-
|
|
611
|
+
onMouseDown: (R) => {
|
|
612
|
+
R.preventDefault(), u({
|
|
613
613
|
name: b,
|
|
614
614
|
value: E
|
|
615
615
|
});
|
|
@@ -622,8 +622,8 @@ const Ot = [
|
|
|
622
622
|
dangerouslySetInnerHTML: {
|
|
623
623
|
__html: H
|
|
624
624
|
},
|
|
625
|
-
onMouseEnter: (
|
|
626
|
-
onMouseLeave: (
|
|
625
|
+
onMouseEnter: (R) => R.currentTarget.style.background = "#f0f0f0",
|
|
626
|
+
onMouseLeave: (R) => R.currentTarget.style.background = "#fff"
|
|
627
627
|
});
|
|
628
628
|
}) : /* @__PURE__ */ o.createElement("li", {
|
|
629
629
|
style: {
|
|
@@ -633,12 +633,12 @@ const Ot = [
|
|
|
633
633
|
}, "No matches")) : null;
|
|
634
634
|
};
|
|
635
635
|
function ze(r) {
|
|
636
|
-
return
|
|
636
|
+
return A({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: { id: "Circle_Minus" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { d: "M15,11.5h0a.5.5,0,0,1,0,1H9a.5.5,0,0,1,0-1Z" }, child: [] }, { tag: "path", attr: { d: "M12,21.934A9.933,9.933,0,1,1,21.932,12,9.945,9.945,0,0,1,12,21.934ZM12,3.068A8.933,8.933,0,1,0,20.932,12,8.944,8.944,0,0,0,12,3.068Z" }, child: [] }] }] }] })(r);
|
|
637
637
|
}
|
|
638
638
|
function Z(r) {
|
|
639
|
-
return
|
|
639
|
+
return A({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "g", attr: { id: "Circle_Plus" }, child: [{ tag: "g", attr: {}, child: [{ tag: "path", attr: { d: "M15,12.5H12.5V15a.5.5,0,0,1-1,0V12.5H9a.5.5,0,0,1,0-1h2.5V9a.5.5,0,0,1,1,0v2.5H15A.5.5,0,0,1,15,12.5Z" }, child: [] }, { tag: "path", attr: { d: "M12,21.932A9.934,9.934,0,1,1,21.932,12,9.944,9.944,0,0,1,12,21.932ZM12,3.065A8.934,8.934,0,1,0,20.932,12,8.944,8.944,0,0,0,12,3.065Z" }, child: [] }] }] }] })(r);
|
|
640
640
|
}
|
|
641
|
-
const
|
|
641
|
+
const Pt = ({
|
|
642
642
|
visible: r,
|
|
643
643
|
x: c,
|
|
644
644
|
y: d,
|
|
@@ -667,16 +667,16 @@ const _t = ({
|
|
|
667
667
|
}, /* @__PURE__ */ o.createElement(ze, null), " Delete row"), /* @__PURE__ */ o.createElement("button", {
|
|
668
668
|
onClick: () => u("deleteCol")
|
|
669
669
|
}, /* @__PURE__ */ o.createElement(ze, null), " Delete column"));
|
|
670
|
-
},
|
|
670
|
+
}, Bt = ({
|
|
671
671
|
html: r,
|
|
672
672
|
className: c,
|
|
673
673
|
style: d
|
|
674
674
|
}) => {
|
|
675
675
|
const u = (y) => {
|
|
676
|
-
const
|
|
677
|
-
if (
|
|
676
|
+
const S = y.target;
|
|
677
|
+
if (S.tagName === "A") {
|
|
678
678
|
y.preventDefault();
|
|
679
|
-
const b =
|
|
679
|
+
const b = S.href;
|
|
680
680
|
b && window.open(b, "_blank", "noopener,noreferrer");
|
|
681
681
|
}
|
|
682
682
|
}, m = (y) => y.replace(/{{\s*(.*?)\s*}}/g, "$1");
|
|
@@ -688,20 +688,20 @@ const _t = ({
|
|
|
688
688
|
__html: m(r)
|
|
689
689
|
}
|
|
690
690
|
});
|
|
691
|
-
},
|
|
691
|
+
}, It = ({
|
|
692
692
|
visible: r,
|
|
693
693
|
linkData: c,
|
|
694
694
|
onClose: d,
|
|
695
695
|
onInsert: u
|
|
696
696
|
}) => {
|
|
697
|
-
const [m, y] =
|
|
698
|
-
if (
|
|
699
|
-
r ? (y(c.url || ""), b(c.text || ""), O(c.title || ""),
|
|
697
|
+
const [m, y] = M(""), [S, b] = M(""), [E, O] = M(""), [_, z] = M("_self");
|
|
698
|
+
if (B(() => {
|
|
699
|
+
r ? (y(c.url || ""), b(c.text || ""), O(c.title || ""), z(c.target || "_self")) : (y(""), b(""), O(""), z("_self"));
|
|
700
700
|
}, [r, c]), !r) return null;
|
|
701
701
|
const H = () => {
|
|
702
702
|
u({
|
|
703
703
|
url: m,
|
|
704
|
-
text:
|
|
704
|
+
text: S,
|
|
705
705
|
title: E,
|
|
706
706
|
target: _
|
|
707
707
|
});
|
|
@@ -718,23 +718,23 @@ const _t = ({
|
|
|
718
718
|
className: "rte-link-modal__input",
|
|
719
719
|
placeholder: "URL",
|
|
720
720
|
value: m,
|
|
721
|
-
onChange: (
|
|
721
|
+
onChange: (R) => y(R.target.value)
|
|
722
722
|
}), /* @__PURE__ */ o.createElement("input", {
|
|
723
723
|
type: "text",
|
|
724
724
|
className: "rte-link-modal__input",
|
|
725
725
|
placeholder: "Text to Display",
|
|
726
|
-
value:
|
|
727
|
-
onChange: (
|
|
726
|
+
value: S,
|
|
727
|
+
onChange: (R) => b(R.target.value)
|
|
728
728
|
}), /* @__PURE__ */ o.createElement("input", {
|
|
729
729
|
type: "text",
|
|
730
730
|
className: "rte-link-modal__input",
|
|
731
731
|
placeholder: "Title",
|
|
732
732
|
value: E,
|
|
733
|
-
onChange: (
|
|
733
|
+
onChange: (R) => O(R.target.value)
|
|
734
734
|
}), /* @__PURE__ */ o.createElement("select", {
|
|
735
735
|
className: "rte-link-modal__select",
|
|
736
736
|
value: _,
|
|
737
|
-
onChange: (
|
|
737
|
+
onChange: (R) => z(R.target.value)
|
|
738
738
|
}, /* @__PURE__ */ o.createElement("option", {
|
|
739
739
|
value: "_self"
|
|
740
740
|
}, "Same tab"), /* @__PURE__ */ o.createElement("option", {
|
|
@@ -749,10 +749,10 @@ const _t = ({
|
|
|
749
749
|
onClick: H
|
|
750
750
|
}, "OK"))));
|
|
751
751
|
};
|
|
752
|
-
function
|
|
752
|
+
function Ne(r) {
|
|
753
753
|
return Array.from(new Map(r.map((c) => [c.value, c])).values());
|
|
754
754
|
}
|
|
755
|
-
const
|
|
755
|
+
const $t = ({
|
|
756
756
|
atSuggestions: r = [],
|
|
757
757
|
showOutput: c = !1,
|
|
758
758
|
showPreview: d = !1,
|
|
@@ -768,7 +768,7 @@ const Vt = ({
|
|
|
768
768
|
},
|
|
769
769
|
classNames: m = {},
|
|
770
770
|
styles: y = {},
|
|
771
|
-
handleGetHtml:
|
|
771
|
+
handleGetHtml: S = () => {
|
|
772
772
|
},
|
|
773
773
|
onChange: b = () => {
|
|
774
774
|
},
|
|
@@ -778,20 +778,20 @@ const Vt = ({
|
|
|
778
778
|
handleAddAttributes: _ = () => {
|
|
779
779
|
}
|
|
780
780
|
}) => {
|
|
781
|
-
var
|
|
782
|
-
const
|
|
781
|
+
var pe, ve, Ee, ye, we, Ce, be, Re;
|
|
782
|
+
const z = P(null), [H, R] = M(E != null && E.length ? E : " "), [G, $] = M(""), [q, I] = M(!1), [F, ee] = M({
|
|
783
783
|
x: 0,
|
|
784
784
|
y: 0
|
|
785
|
-
}), [te, L] =
|
|
785
|
+
}), [te, L] = M([]), k = P(null), V = P(null), [T, f] = M({
|
|
786
786
|
visible: !1,
|
|
787
787
|
x: 0,
|
|
788
788
|
y: 0
|
|
789
|
-
}), [w, j] =
|
|
789
|
+
}), [w, j] = M(!1), K = P(null), [De, le] = M({
|
|
790
790
|
url: "",
|
|
791
791
|
text: "",
|
|
792
792
|
title: "",
|
|
793
793
|
target: "_self"
|
|
794
|
-
}),
|
|
794
|
+
}), Oe = {
|
|
795
795
|
bold: !0,
|
|
796
796
|
italic: !0,
|
|
797
797
|
underline: !0,
|
|
@@ -799,20 +799,20 @@ const Vt = ({
|
|
|
799
799
|
unorderedList: !0,
|
|
800
800
|
orderedList: !0,
|
|
801
801
|
align: !0,
|
|
802
|
-
link: (
|
|
803
|
-
image: (
|
|
804
|
-
emoji: (
|
|
805
|
-
table: (
|
|
806
|
-
color: (
|
|
807
|
-
fontFamily: (
|
|
808
|
-
fontSize: (
|
|
809
|
-
highlight: (
|
|
810
|
-
}, [
|
|
811
|
-
const e =
|
|
812
|
-
$(e),
|
|
802
|
+
link: (pe = u.link) != null ? pe : !1,
|
|
803
|
+
image: (ve = u.image) != null ? ve : !1,
|
|
804
|
+
emoji: (Ee = u.emoji) != null ? Ee : !1,
|
|
805
|
+
table: (ye = u.table) != null ? ye : !1,
|
|
806
|
+
color: (we = u.color) != null ? we : !1,
|
|
807
|
+
fontFamily: (Ce = u.fontFamily) != null ? Ce : !1,
|
|
808
|
+
fontSize: (be = u.fontSize) != null ? be : !1,
|
|
809
|
+
highlight: (Re = u.fontSize) != null ? Re : !1
|
|
810
|
+
}, [He, ce] = M(""), [ie, ne] = M([]), D = () => z.current, x = () => {
|
|
811
|
+
const e = he();
|
|
812
|
+
$(e), S == null || S(e);
|
|
813
813
|
const t = at(e);
|
|
814
814
|
b(t);
|
|
815
|
-
const n = Ve(), a =
|
|
815
|
+
const n = Ve(), a = Ne(n);
|
|
816
816
|
JSON.stringify(a) !== JSON.stringify(ie) && (ne(a), O(a));
|
|
817
817
|
}, U = () => {
|
|
818
818
|
const e = window.getSelection();
|
|
@@ -820,31 +820,31 @@ const Vt = ({
|
|
|
820
820
|
const t = document.getElementById("rte-editor-body");
|
|
821
821
|
if (!t) return;
|
|
822
822
|
const n = e.getRangeAt(0);
|
|
823
|
-
t.contains(n.startContainer) && (
|
|
823
|
+
t.contains(n.startContainer) && (k.current = n.cloneRange());
|
|
824
824
|
}, W = () => {
|
|
825
825
|
const e = window.getSelection();
|
|
826
|
-
!e || !
|
|
827
|
-
},
|
|
826
|
+
!e || !k.current || (e.removeAllRanges(), e.addRange(k.current));
|
|
827
|
+
}, se = (e, t) => {
|
|
828
828
|
const n = window.getSelection();
|
|
829
|
-
n && n.rangeCount > 0 && (
|
|
829
|
+
n && n.rangeCount > 0 && (k.current = n.getRangeAt(0)), W(), document.execCommand(e, !1, t), x();
|
|
830
830
|
};
|
|
831
|
-
|
|
831
|
+
B(() => {
|
|
832
832
|
const e = D();
|
|
833
|
-
e && !e.innerHTML && (e.innerHTML = H),
|
|
834
|
-
}, []),
|
|
833
|
+
e && !e.innerHTML && (e.innerHTML = H), x();
|
|
834
|
+
}, []), B(() => () => {
|
|
835
835
|
document.removeEventListener("mousemove", null), document.removeEventListener("mouseup", null);
|
|
836
|
-
}, []),
|
|
836
|
+
}, []), B(() => {
|
|
837
837
|
_ && _((e) => {
|
|
838
838
|
qe(e);
|
|
839
839
|
});
|
|
840
|
-
}, []),
|
|
840
|
+
}, []), B(() => {
|
|
841
841
|
const e = D();
|
|
842
842
|
if (!e) return;
|
|
843
843
|
e.querySelectorAll("table").forEach((n) => {
|
|
844
|
-
|
|
844
|
+
ge(n), n.querySelectorAll("th, td").forEach((s) => Y(s));
|
|
845
845
|
});
|
|
846
846
|
}, []);
|
|
847
|
-
const
|
|
847
|
+
const de = (e) => {
|
|
848
848
|
for (; e && e.nodeName !== "LI"; )
|
|
849
849
|
e = e.parentNode;
|
|
850
850
|
return e;
|
|
@@ -860,26 +860,26 @@ const Vt = ({
|
|
|
860
860
|
l.textContent = a, l.style.display = "none", l.setAttribute("data-hidden-array-start", "true"), e.insertBefore(l, e.firstChild);
|
|
861
861
|
const i = document.createElement("span");
|
|
862
862
|
i.textContent = s, i.style.display = "none", i.setAttribute("data-hidden-array-end", "true"), e.appendChild(i);
|
|
863
|
-
},
|
|
863
|
+
}, ue = (e) => {
|
|
864
864
|
var v;
|
|
865
865
|
const t = window.getSelection();
|
|
866
866
|
if (!(t != null && t.rangeCount)) return;
|
|
867
|
-
const n = t.getRangeAt(0), a =
|
|
867
|
+
const n = t.getRangeAt(0), a = de(n.startContainer);
|
|
868
868
|
let s, l;
|
|
869
869
|
if (a) {
|
|
870
|
-
let
|
|
871
|
-
|
|
870
|
+
let g = a.querySelector(e);
|
|
871
|
+
g || (g = document.createElement(e), g.style.margin = "0", g.style.paddingLeft = "20px", a.appendChild(g)), l = g, s = document.createElement("li"), s.textContent = "", l.appendChild(s);
|
|
872
872
|
} else {
|
|
873
873
|
document.execCommand(e === "ul" ? "insertUnorderedList" : "insertOrderedList");
|
|
874
|
-
const
|
|
875
|
-
if (l =
|
|
874
|
+
const g = D();
|
|
875
|
+
if (l = g == null ? void 0 : g.querySelector(`${e}:last-child`), !l) return;
|
|
876
876
|
s = l.querySelector("li:last-child");
|
|
877
877
|
}
|
|
878
878
|
_e(l);
|
|
879
879
|
const i = document.createRange();
|
|
880
|
-
i.setStart(s, 0), i.collapse(!0), t.removeAllRanges(), t.addRange(i), (v = D()) == null || v.focus(),
|
|
880
|
+
i.setStart(s, 0), i.collapse(!0), t.removeAllRanges(), t.addRange(i), (v = D()) == null || v.focus(), x();
|
|
881
881
|
}, X = (e, t) => {
|
|
882
|
-
e === "insertOrderedList" ?
|
|
882
|
+
e === "insertOrderedList" ? ue("ol") : e === "insertUnorderedList" ? ue("ul") : e.startsWith("justify") ? lt(e) : se(e, t), e === "insertTable" && Ye();
|
|
883
883
|
}, Fe = (e) => {
|
|
884
884
|
const t = document.createElement("span");
|
|
885
885
|
t.textContent = "", e.insertNode(t), e.setStartAfter(t), e.collapse(!0);
|
|
@@ -887,7 +887,7 @@ const Vt = ({
|
|
|
887
887
|
t.remove(), ee({
|
|
888
888
|
x: n.left,
|
|
889
889
|
y: n.bottom + window.scrollY
|
|
890
|
-
}), L(r || []),
|
|
890
|
+
}), L(r || []), I(!0), V.current = e.cloneRange();
|
|
891
891
|
}, Pe = () => {
|
|
892
892
|
const e = window.getSelection();
|
|
893
893
|
if (!e || e.rangeCount === 0) return null;
|
|
@@ -906,7 +906,7 @@ const Vt = ({
|
|
|
906
906
|
a = a.previousSibling;
|
|
907
907
|
}
|
|
908
908
|
return null;
|
|
909
|
-
},
|
|
909
|
+
}, Be = (e) => {
|
|
910
910
|
var l;
|
|
911
911
|
const t = window.getSelection();
|
|
912
912
|
if (!t) return;
|
|
@@ -924,18 +924,18 @@ const Vt = ({
|
|
|
924
924
|
}
|
|
925
925
|
const v = document.createTextNode(" ");
|
|
926
926
|
a.after(v);
|
|
927
|
-
const
|
|
928
|
-
|
|
927
|
+
const g = document.createRange();
|
|
928
|
+
g.setStartAfter(v), g.collapse(!0), t.removeAllRanges(), t.addRange(g);
|
|
929
929
|
} catch (i) {
|
|
930
930
|
console.error("insertMention error:", i);
|
|
931
931
|
}
|
|
932
|
-
let s =
|
|
933
|
-
ne(s), O(s),
|
|
934
|
-
},
|
|
932
|
+
let s = Ne([...ie, e]);
|
|
933
|
+
ne(s), O(s), I(!1), (l = D()) == null || l.focus(), x();
|
|
934
|
+
}, Ie = (e) => {
|
|
935
935
|
const t = D();
|
|
936
936
|
if (!t) return;
|
|
937
937
|
let n = null;
|
|
938
|
-
|
|
938
|
+
k.current && t.contains(k.current.startContainer) ? n = k.current.cloneRange() : (n = document.createRange(), n.selectNodeContents(t), n.collapse(!1));
|
|
939
939
|
const a = window.getSelection();
|
|
940
940
|
if (!a) return;
|
|
941
941
|
a.removeAllRanges(), a.addRange(n);
|
|
@@ -944,12 +944,12 @@ const Vt = ({
|
|
|
944
944
|
const l = document.createTextNode(" ");
|
|
945
945
|
s.after(l);
|
|
946
946
|
const i = document.createRange();
|
|
947
|
-
i.setStartAfter(l), i.collapse(!0), a.removeAllRanges(), a.addRange(i),
|
|
947
|
+
i.setStartAfter(l), i.collapse(!0), a.removeAllRanges(), a.addRange(i), k.current = i.cloneRange(), t.focus();
|
|
948
948
|
}, qe = (e) => {
|
|
949
|
-
e.forEach((t) =>
|
|
949
|
+
e.forEach((t) => Ie(t)), ne((t) => {
|
|
950
950
|
const n = [...t, ...e], a = Array.from(new Map(n.map((s) => [s.name, s])).values());
|
|
951
951
|
return O(a), a;
|
|
952
|
-
}),
|
|
952
|
+
}), x();
|
|
953
953
|
}, Ve = () => {
|
|
954
954
|
const e = D();
|
|
955
955
|
if (!e) return [];
|
|
@@ -965,13 +965,13 @@ const Vt = ({
|
|
|
965
965
|
var n, a, s;
|
|
966
966
|
const t = e.key.toLowerCase();
|
|
967
967
|
if ((e.ctrlKey || e.metaKey) && ["b", "i", "u"].includes(t) && (e.preventDefault(), X(t === "b" ? "bold" : t === "i" ? "italic" : t === "u" ? "underline" : "")), e.shiftKey && e.key === "2" && e.preventDefault(), e.key === "Enter") {
|
|
968
|
-
const l = window.getSelection(), i = l != null && l.anchorNode ?
|
|
968
|
+
const l = window.getSelection(), i = l != null && l.anchorNode ? de(l.anchorNode) : null;
|
|
969
969
|
if (!i) return;
|
|
970
970
|
if (((n = i.textContent) == null ? void 0 : n.replace(/\u200B/g, "").trim()) === "") {
|
|
971
971
|
e.preventDefault();
|
|
972
|
-
const
|
|
972
|
+
const g = i.parentElement, p = g == null ? void 0 : g.closest("li");
|
|
973
973
|
if (p) {
|
|
974
|
-
|
|
974
|
+
g == null || g.removeChild(i);
|
|
975
975
|
const h = document.createElement("p");
|
|
976
976
|
h.innerHTML = "<br />", (a = p.parentElement) == null || a.insertBefore(h, p.nextSibling);
|
|
977
977
|
const C = document.createRange();
|
|
@@ -981,11 +981,11 @@ const Vt = ({
|
|
|
981
981
|
if (h) {
|
|
982
982
|
const C = document.createElement("p");
|
|
983
983
|
C.innerHTML = "<br />", (s = h.parentElement) == null || s.insertBefore(C, h.nextSibling), h.removeChild(i);
|
|
984
|
-
const
|
|
985
|
-
|
|
984
|
+
const N = document.createRange();
|
|
985
|
+
N.setStart(C, 0), N.collapse(!0), l == null || l.removeAllRanges(), l == null || l.addRange(N);
|
|
986
986
|
}
|
|
987
987
|
}
|
|
988
|
-
|
|
988
|
+
x();
|
|
989
989
|
}
|
|
990
990
|
}
|
|
991
991
|
}, $e = (e) => {
|
|
@@ -996,12 +996,12 @@ const Vt = ({
|
|
|
996
996
|
if (We(a))
|
|
997
997
|
return;
|
|
998
998
|
setTimeout(() => {
|
|
999
|
-
Fe(n.getRangeAt(0)), ce(""), L(r),
|
|
999
|
+
Fe(n.getRangeAt(0)), ce(""), L(r), I(!0);
|
|
1000
1000
|
}, 0);
|
|
1001
1001
|
return;
|
|
1002
1002
|
}
|
|
1003
1003
|
if (q) {
|
|
1004
|
-
setTimeout(() =>
|
|
1004
|
+
setTimeout(() => me(), 0);
|
|
1005
1005
|
return;
|
|
1006
1006
|
}
|
|
1007
1007
|
}, We = (e) => {
|
|
@@ -1012,13 +1012,13 @@ const Vt = ({
|
|
|
1012
1012
|
t = t.parentElement;
|
|
1013
1013
|
}
|
|
1014
1014
|
return !1;
|
|
1015
|
-
},
|
|
1016
|
-
if (
|
|
1015
|
+
}, me = () => {
|
|
1016
|
+
if (x(), !q) return;
|
|
1017
1017
|
const e = window.getSelection();
|
|
1018
1018
|
if (!e || !e.anchorNode) return;
|
|
1019
1019
|
const n = (e.anchorNode.textContent || "").match(/@([a-zA-Z0-9_]*)$/);
|
|
1020
1020
|
if (!n) {
|
|
1021
|
-
|
|
1021
|
+
I(!1);
|
|
1022
1022
|
return;
|
|
1023
1023
|
}
|
|
1024
1024
|
const a = n[1].toLowerCase();
|
|
@@ -1031,27 +1031,27 @@ const Vt = ({
|
|
|
1031
1031
|
if (!t) return;
|
|
1032
1032
|
const n = new FileReader();
|
|
1033
1033
|
n.onload = (s) => {
|
|
1034
|
-
var
|
|
1035
|
-
const l = (
|
|
1034
|
+
var N;
|
|
1035
|
+
const l = (N = s.target) == null ? void 0 : N.result;
|
|
1036
1036
|
W();
|
|
1037
1037
|
const i = window.getSelection();
|
|
1038
1038
|
let v = i && i.rangeCount ? i.getRangeAt(0) : null;
|
|
1039
|
-
const
|
|
1040
|
-
|
|
1039
|
+
const g = document.createElement("img");
|
|
1040
|
+
g.src = l, g.alt = t.name || "image", g.className = "rte-inserted-image", g.contentEditable = "true";
|
|
1041
1041
|
const p = D();
|
|
1042
1042
|
if (!v || !p) {
|
|
1043
|
-
p == null || p.appendChild(
|
|
1043
|
+
p == null || p.appendChild(g);
|
|
1044
1044
|
const xe = document.createTextNode(" ");
|
|
1045
1045
|
p == null || p.appendChild(xe);
|
|
1046
1046
|
const re = document.createRange();
|
|
1047
|
-
re.setStartAfter(xe), re.collapse(!0), i == null || i.removeAllRanges(), i == null || i.addRange(re), p == null || p.focus(),
|
|
1047
|
+
re.setStartAfter(xe), re.collapse(!0), i == null || i.removeAllRanges(), i == null || i.addRange(re), p == null || p.focus(), x(), e.target.value = "";
|
|
1048
1048
|
return;
|
|
1049
1049
|
}
|
|
1050
|
-
v.deleteContents(), v.insertNode(
|
|
1050
|
+
v.deleteContents(), v.insertNode(g);
|
|
1051
1051
|
const h = document.createTextNode(" ");
|
|
1052
|
-
|
|
1052
|
+
g.after(h);
|
|
1053
1053
|
const C = document.createRange();
|
|
1054
|
-
C.setStartAfter(h), C.collapse(!0), i.removeAllRanges(), i.addRange(C), p.focus(),
|
|
1054
|
+
C.setStartAfter(h), C.collapse(!0), i.removeAllRanges(), i.addRange(C), p.focus(), x(), e.target.value = "";
|
|
1055
1055
|
}, n.readAsDataURL(t);
|
|
1056
1056
|
}, Xe = (e) => {
|
|
1057
1057
|
var s;
|
|
@@ -1059,7 +1059,7 @@ const Vt = ({
|
|
|
1059
1059
|
const t = window.getSelection();
|
|
1060
1060
|
if (!(t != null && t.rangeCount)) return;
|
|
1061
1061
|
const n = t.getRangeAt(0), a = document.createTextNode(e);
|
|
1062
|
-
n.insertNode(a), n.setStartAfter(a), n.collapse(!0), t.removeAllRanges(), t.addRange(n), (s = D()) == null || s.focus(),
|
|
1062
|
+
n.insertNode(a), n.setStartAfter(a), n.collapse(!0), t.removeAllRanges(), t.addRange(n), (s = D()) == null || s.focus(), x();
|
|
1063
1063
|
}, Ye = () => {
|
|
1064
1064
|
W();
|
|
1065
1065
|
const e = document.createElement("table");
|
|
@@ -1073,16 +1073,16 @@ const Vt = ({
|
|
|
1073
1073
|
const s = document.createElement("tr");
|
|
1074
1074
|
m.tr && s.classList.add(m.tr);
|
|
1075
1075
|
for (let v = 0; v < 2; v++) {
|
|
1076
|
-
const
|
|
1077
|
-
|
|
1076
|
+
const g = document.createElement("th");
|
|
1077
|
+
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);
|
|
1078
1078
|
const p = document.createElement("td");
|
|
1079
|
-
p.textContent = `Row 1 Col ${v + 1}`, p.style.border = "1px solid #999", p.style.padding = "8px", p.style.position = "relative", p.style.backgroundColor = "#fff", m.td && p.classList.add(m.td), Y(
|
|
1079
|
+
p.textContent = `Row 1 Col ${v + 1}`, p.style.border = "1px solid #999", p.style.padding = "8px", p.style.position = "relative", p.style.backgroundColor = "#fff", m.td && p.classList.add(m.td), Y(g), Y(p), a.appendChild(g), s.appendChild(p);
|
|
1080
1080
|
}
|
|
1081
|
-
t.appendChild(a), n.appendChild(s), e.appendChild(t), e.appendChild(n), Ge(e),
|
|
1081
|
+
t.appendChild(a), n.appendChild(s), e.appendChild(t), e.appendChild(n), Ge(e), ge(e);
|
|
1082
1082
|
const l = window.getSelection();
|
|
1083
1083
|
if (!(l != null && l.rangeCount)) return;
|
|
1084
|
-
l.getRangeAt(0).insertNode(e),
|
|
1085
|
-
},
|
|
1084
|
+
l.getRangeAt(0).insertNode(e), x();
|
|
1085
|
+
}, ge = (e) => {
|
|
1086
1086
|
const t = document.createElement("div");
|
|
1087
1087
|
Object.assign(t.style, {
|
|
1088
1088
|
position: "absolute",
|
|
@@ -1100,13 +1100,13 @@ const Vt = ({
|
|
|
1100
1100
|
i.preventDefault(), n = i.clientX, a = i.clientY;
|
|
1101
1101
|
const v = e.getBoundingClientRect();
|
|
1102
1102
|
s = v.width, l = v.height;
|
|
1103
|
-
const
|
|
1104
|
-
const C = Math.max(100, s + (h.clientX - n)),
|
|
1105
|
-
e.style.width = `${C}px`, e.style.height = `${
|
|
1103
|
+
const g = (h) => {
|
|
1104
|
+
const C = Math.max(100, s + (h.clientX - n)), N = Math.max(60, l + (h.clientY - a));
|
|
1105
|
+
e.style.width = `${C}px`, e.style.height = `${N}px`, x();
|
|
1106
1106
|
}, p = () => {
|
|
1107
|
-
document.removeEventListener("mousemove",
|
|
1107
|
+
document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", p), x();
|
|
1108
1108
|
};
|
|
1109
|
-
document.addEventListener("mousemove",
|
|
1109
|
+
document.addEventListener("mousemove", g), document.addEventListener("mouseup", p);
|
|
1110
1110
|
}), e.appendChild(t);
|
|
1111
1111
|
}, Y = (e) => {
|
|
1112
1112
|
const t = document.createElement("div"), n = document.createElement("div");
|
|
@@ -1134,20 +1134,20 @@ const Vt = ({
|
|
|
1134
1134
|
t.addEventListener("mousedown", (h) => {
|
|
1135
1135
|
h.preventDefault(), a = h.clientX, l = e.offsetWidth, document.addEventListener("mousemove", v), document.addEventListener("mouseup", p);
|
|
1136
1136
|
}), n.addEventListener("mousedown", (h) => {
|
|
1137
|
-
h.preventDefault(), s = h.clientY, i = e.offsetHeight, document.addEventListener("mousemove",
|
|
1137
|
+
h.preventDefault(), s = h.clientY, i = e.offsetHeight, document.addEventListener("mousemove", g), document.addEventListener("mouseup", p);
|
|
1138
1138
|
});
|
|
1139
1139
|
const v = (h) => {
|
|
1140
1140
|
const C = l + (h.clientX - a);
|
|
1141
|
-
e.style.width = `${Math.max(30, C)}px
|
|
1142
|
-
},
|
|
1141
|
+
e.style.width = `${Math.max(30, C)}px`, x();
|
|
1142
|
+
}, g = (h) => {
|
|
1143
1143
|
const C = i + (h.clientY - s);
|
|
1144
|
-
e.style.height = `${Math.max(20, C)}px
|
|
1144
|
+
e.style.height = `${Math.max(20, C)}px`, x();
|
|
1145
1145
|
}, p = () => {
|
|
1146
|
-
document.removeEventListener("mousemove", v), document.removeEventListener("mousemove",
|
|
1146
|
+
document.removeEventListener("mousemove", v), document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", p), x();
|
|
1147
1147
|
};
|
|
1148
1148
|
}, Qe = (e) => {
|
|
1149
1149
|
const n = e.target.closest("td, th");
|
|
1150
|
-
n && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((a) => a.classList.remove("rte-cell-highlight")), n.classList.add("rte-cell-highlight"),
|
|
1150
|
+
n && (e.preventDefault(), document.querySelectorAll(".rte-cell-highlight").forEach((a) => a.classList.remove("rte-cell-highlight")), n.classList.add("rte-cell-highlight"), f({
|
|
1151
1151
|
visible: !0,
|
|
1152
1152
|
x: e.clientX,
|
|
1153
1153
|
y: e.clientY,
|
|
@@ -1199,7 +1199,7 @@ const Vt = ({
|
|
|
1199
1199
|
});
|
|
1200
1200
|
break;
|
|
1201
1201
|
}
|
|
1202
|
-
|
|
1202
|
+
x(), f(oe(ae({}, T), {
|
|
1203
1203
|
visible: !1
|
|
1204
1204
|
})), fe();
|
|
1205
1205
|
}, Ge = (e) => {
|
|
@@ -1209,13 +1209,13 @@ const Vt = ({
|
|
|
1209
1209
|
n.textContent = "{{#arrayData}}", n.style.display = "none", n.setAttribute("data-hidden-table-start", "true"), t.insertBefore(n, t.firstChild);
|
|
1210
1210
|
const a = document.createElement("span");
|
|
1211
1211
|
a.textContent = "{{/arrayData}}", a.style.display = "none", a.setAttribute("data-hidden-table-end", "true"), t.appendChild(a);
|
|
1212
|
-
},
|
|
1212
|
+
}, he = () => {
|
|
1213
1213
|
const e = D();
|
|
1214
1214
|
if (!e) return H;
|
|
1215
1215
|
const t = e.cloneNode(!0);
|
|
1216
1216
|
return t.querySelectorAll("table div").forEach((n) => n.remove()), t.querySelectorAll(".rte-cell-highlight").forEach((n) => n.classList.remove("rte-cell-highlight")), t.innerHTML;
|
|
1217
1217
|
}, et = () => {
|
|
1218
|
-
U(), K.current =
|
|
1218
|
+
U(), K.current = k.current, le({
|
|
1219
1219
|
url: "",
|
|
1220
1220
|
text: "",
|
|
1221
1221
|
title: "",
|
|
@@ -1234,7 +1234,7 @@ const Vt = ({
|
|
|
1234
1234
|
const l = document.createTextNode(" ");
|
|
1235
1235
|
a.after(l);
|
|
1236
1236
|
const i = document.createRange();
|
|
1237
|
-
i.setStartAfter(l), i.collapse(!0), t.removeAllRanges(), t.addRange(i), j(!1),
|
|
1237
|
+
i.setStartAfter(l), i.collapse(!0), t.removeAllRanges(), t.addRange(i), j(!1), x();
|
|
1238
1238
|
}, nt = (e) => {
|
|
1239
1239
|
const t = e.target;
|
|
1240
1240
|
if (t.tagName === "A") {
|
|
@@ -1256,9 +1256,9 @@ const Vt = ({
|
|
|
1256
1256
|
const e = D();
|
|
1257
1257
|
if (!e) return;
|
|
1258
1258
|
const t = window.getSelection();
|
|
1259
|
-
if ((!t || t.rangeCount === 0) &&
|
|
1259
|
+
if ((!t || t.rangeCount === 0) && k.current) {
|
|
1260
1260
|
const h = window.getSelection();
|
|
1261
|
-
h == null || h.removeAllRanges(), h == null || h.addRange(
|
|
1261
|
+
h == null || h.removeAllRanges(), h == null || h.addRange(k.current);
|
|
1262
1262
|
}
|
|
1263
1263
|
const n = window.getSelection();
|
|
1264
1264
|
if (!n || n.rangeCount === 0) return;
|
|
@@ -1268,22 +1268,22 @@ const Vt = ({
|
|
|
1268
1268
|
l.appendChild(s);
|
|
1269
1269
|
const i = document.createTreeWalker(l, NodeFilter.SHOW_ELEMENT, null), v = [];
|
|
1270
1270
|
for (; i.nextNode(); ) {
|
|
1271
|
-
const h = i.currentNode, C = h.tagName.toUpperCase(),
|
|
1272
|
-
C !== "A" && !
|
|
1271
|
+
const h = i.currentNode, C = h.tagName.toUpperCase(), N = h.getAttribute && h.getAttribute("data-mention") !== null;
|
|
1272
|
+
C !== "A" && !N && v.push(h);
|
|
1273
1273
|
}
|
|
1274
1274
|
for (let h = v.length - 1; h >= 0; h--) {
|
|
1275
|
-
const C = v[h],
|
|
1276
|
-
if (
|
|
1277
|
-
for (; C.firstChild; )
|
|
1278
|
-
|
|
1275
|
+
const C = v[h], N = C.parentNode;
|
|
1276
|
+
if (N) {
|
|
1277
|
+
for (; C.firstChild; ) N.insertBefore(C.firstChild, C);
|
|
1278
|
+
N.removeChild(C);
|
|
1279
1279
|
}
|
|
1280
1280
|
}
|
|
1281
1281
|
l.querySelectorAll("[style]").forEach((h) => h.removeAttribute("style")), a.deleteContents();
|
|
1282
|
-
const
|
|
1283
|
-
for (; l.firstChild; )
|
|
1284
|
-
a.insertNode(
|
|
1282
|
+
const g = document.createDocumentFragment();
|
|
1283
|
+
for (; l.firstChild; ) g.appendChild(l.firstChild);
|
|
1284
|
+
a.insertNode(g);
|
|
1285
1285
|
const p = document.createRange();
|
|
1286
|
-
p.setStartAfter(a.endContainer.nodeType === Node.TEXT_NODE ? a.endContainer : a.startContainer), p.collapse(!0), n.removeAllRanges(), n.addRange(p), e.normalize(),
|
|
1286
|
+
p.setStartAfter(a.endContainer.nodeType === Node.TEXT_NODE ? a.endContainer : a.startContainer), p.collapse(!0), n.removeAllRanges(), n.addRange(p), e.normalize(), x();
|
|
1287
1287
|
}, at = (e) => {
|
|
1288
1288
|
var a;
|
|
1289
1289
|
let t = e;
|
|
@@ -1302,6 +1302,26 @@ const Vt = ({
|
|
|
1302
1302
|
|
|
1303
1303
|
`).trim()) || "";
|
|
1304
1304
|
};
|
|
1305
|
+
function ot() {
|
|
1306
|
+
const e = window.getSelection();
|
|
1307
|
+
if (!e || e.rangeCount === 0) return [];
|
|
1308
|
+
const t = e.getRangeAt(0), n = t.commonAncestorContainer, a = n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement;
|
|
1309
|
+
return Array.from(a.querySelectorAll("td, th")).filter((l) => {
|
|
1310
|
+
const i = document.createRange();
|
|
1311
|
+
return i.selectNodeContents(l), t.compareBoundaryPoints(Range.END_TO_START, i) < 0 && t.compareBoundaryPoints(Range.START_TO_END, i) > 0;
|
|
1312
|
+
});
|
|
1313
|
+
}
|
|
1314
|
+
function lt(e) {
|
|
1315
|
+
const t = ot();
|
|
1316
|
+
if (t.length === 0) {
|
|
1317
|
+
se(e);
|
|
1318
|
+
return;
|
|
1319
|
+
}
|
|
1320
|
+
let n = "left";
|
|
1321
|
+
e === "justifyCenter" && (n = "center"), e === "justifyRight" && (n = "right"), t.forEach((a) => {
|
|
1322
|
+
a.style.textAlign = n;
|
|
1323
|
+
}), x();
|
|
1324
|
+
}
|
|
1305
1325
|
return /* @__PURE__ */ o.createElement("div", {
|
|
1306
1326
|
className: `rte-wrapper ${(m == null ? void 0 : m.wrapper) || ""}`,
|
|
1307
1327
|
style: y.wrapper
|
|
@@ -1309,7 +1329,7 @@ const Vt = ({
|
|
|
1309
1329
|
style: {
|
|
1310
1330
|
flex: 1
|
|
1311
1331
|
}
|
|
1312
|
-
}, /* @__PURE__ */ o.createElement(
|
|
1332
|
+
}, /* @__PURE__ */ o.createElement(_t, {
|
|
1313
1333
|
exec: X,
|
|
1314
1334
|
saveSelection: U,
|
|
1315
1335
|
handleFileChange: Ke,
|
|
@@ -1318,11 +1338,11 @@ const Vt = ({
|
|
|
1318
1338
|
insertEmoji: Xe,
|
|
1319
1339
|
handleLink: et,
|
|
1320
1340
|
removeFormatting: rt,
|
|
1321
|
-
visibleActions:
|
|
1341
|
+
visibleActions: Oe,
|
|
1322
1342
|
className: m.toolbar,
|
|
1323
1343
|
style: y.toolbar
|
|
1324
1344
|
}), /* @__PURE__ */ o.createElement("div", {
|
|
1325
|
-
ref:
|
|
1345
|
+
ref: z,
|
|
1326
1346
|
id: "rte-editor-body",
|
|
1327
1347
|
className: `rte-editor ${(m == null ? void 0 : m.editor) || ""}`,
|
|
1328
1348
|
style: y.editor,
|
|
@@ -1331,7 +1351,7 @@ const Vt = ({
|
|
|
1331
1351
|
onKeyUp: U,
|
|
1332
1352
|
onMouseUp: U,
|
|
1333
1353
|
onInput: () => {
|
|
1334
|
-
|
|
1354
|
+
me(), U();
|
|
1335
1355
|
},
|
|
1336
1356
|
onKeyDown: Ue,
|
|
1337
1357
|
onBeforeInput: $e,
|
|
@@ -1339,39 +1359,39 @@ const Vt = ({
|
|
|
1339
1359
|
onClick: (e) => {
|
|
1340
1360
|
nt(e), U();
|
|
1341
1361
|
}
|
|
1342
|
-
}), /* @__PURE__ */ o.createElement(
|
|
1362
|
+
}), /* @__PURE__ */ o.createElement(Ft, {
|
|
1343
1363
|
show: q,
|
|
1344
1364
|
position: F,
|
|
1345
1365
|
filtered: te,
|
|
1346
|
-
insertMention:
|
|
1347
|
-
onClose: () =>
|
|
1348
|
-
query:
|
|
1366
|
+
insertMention: Be,
|
|
1367
|
+
onClose: () => I(!1),
|
|
1368
|
+
query: He
|
|
1349
1369
|
}), c && /* @__PURE__ */ o.createElement("div", {
|
|
1350
1370
|
className: `rte-output ${(m == null ? void 0 : m.output) || ""}`,
|
|
1351
1371
|
style: y.output
|
|
1352
|
-
}, /* @__PURE__ */ o.createElement("h4", null, "Output HTML:"), /* @__PURE__ */ o.createElement("p", null, G)), /* @__PURE__ */ o.createElement(
|
|
1372
|
+
}, /* @__PURE__ */ o.createElement("h4", null, "Output HTML:"), /* @__PURE__ */ o.createElement("p", null, G)), /* @__PURE__ */ o.createElement(Pt, {
|
|
1353
1373
|
visible: T.visible,
|
|
1354
1374
|
x: T.x,
|
|
1355
1375
|
y: T.y,
|
|
1356
1376
|
onAction: Je,
|
|
1357
1377
|
onClose: () => {
|
|
1358
|
-
|
|
1378
|
+
f(oe(ae({}, T), {
|
|
1359
1379
|
visible: !1
|
|
1360
1380
|
})), fe();
|
|
1361
1381
|
}
|
|
1362
|
-
}), /* @__PURE__ */ o.createElement(
|
|
1382
|
+
}), /* @__PURE__ */ o.createElement(It, {
|
|
1363
1383
|
visible: w,
|
|
1364
|
-
linkData:
|
|
1384
|
+
linkData: De,
|
|
1365
1385
|
onClose: () => j(!1),
|
|
1366
1386
|
onInsert: tt
|
|
1367
|
-
})), d ? /* @__PURE__ */ o.createElement(
|
|
1387
|
+
})), d ? /* @__PURE__ */ o.createElement(Bt, {
|
|
1368
1388
|
className: m.preview,
|
|
1369
1389
|
style: y.preview,
|
|
1370
|
-
html:
|
|
1390
|
+
html: he()
|
|
1371
1391
|
}) : null);
|
|
1372
1392
|
};
|
|
1373
1393
|
export {
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1394
|
+
$t as RichTextEditor,
|
|
1395
|
+
Bt as RtePreview,
|
|
1396
|
+
_t as RteToolbar
|
|
1377
1397
|
};
|