@ryzeup/richtexteditor 1.0.18 → 1.0.19

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