vlite3 1.5.50 → 1.5.52

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.
Files changed (31) hide show
  1. package/components/CategoryManager/CategoryManager2.vue.js +2 -2
  2. package/components/CommandPalette/CommandPaletteContent2.vue.js +1 -1
  3. package/components/CommandPalette/{CommandPaletteItem2.vue.js → CommandPaletteItem.vue.js} +1 -1
  4. package/components/Form/Form.vue.d.ts +3 -0
  5. package/components/Form/Form.vue.js +1 -1
  6. package/components/Form/Form2.vue.js +292 -276
  7. package/components/Form/composables/useCustomFieldRows.d.ts +3 -0
  8. package/components/Form/composables/useCustomFieldRows.js +109 -58
  9. package/components/Form/composables/useForm.d.ts +4 -1
  10. package/components/Form/composables/useForm.js +249 -187
  11. package/components/Form/index.vue.d.ts +2 -0
  12. package/components/Form/index.vue.js +2 -2
  13. package/components/Form/index2.vue.js +12 -8
  14. package/components/Form/types.d.ts +2 -0
  15. package/components/NavbarCommandPalette.vue.js +1 -1
  16. package/components/RichTextEditor/RichTextEditor.vue.d.ts +58 -0
  17. package/components/RichTextEditor/RichTextEditor.vue.js +309 -180
  18. package/components/RichTextEditor/RichTextLinkPopover.vue.d.ts +3 -8
  19. package/components/RichTextEditor/RichTextLinkPopover3.vue.js +2 -2
  20. package/components/RichTextEditor/RichTextToolbar3.vue.js +2 -2
  21. package/components/RichTextEditor/index.d.ts +1 -1
  22. package/components/RichTextEditor/types.d.ts +22 -0
  23. package/components/Screen/ScreenFilter.vue.js +2 -2
  24. package/components/Screen/components/ScreenToolbar.vue.d.ts +2 -2
  25. package/directives/ScrollReveal/ScrollRevealPager.js +76 -76
  26. package/docs/components/rich-text-editor.md +33 -2
  27. package/docs-manifest.json +3 -3
  28. package/package.json +1 -1
  29. package/style.css +1 -1
  30. /package/components/RichTextEditor/{RichTextLinkPopover2.vue.js → RichTextLinkPopover.vue.js} +0 -0
  31. /package/components/RichTextEditor/{RichTextToolbar2.vue.js → RichTextToolbar.vue.js} +0 -0
@@ -1,15 +1,17 @@
1
- import { defineComponent as te, ref as v, shallowRef as ne, watch as oe, computed as h, onMounted as le, onUnmounted as ae, openBlock as C, createElementBlock as L, normalizeClass as re, toDisplayString as I, createCommentVNode as U, createElementVNode as w, createVNode as q, unref as a, normalizeStyle as ie } from "vue";
1
+ import { defineComponent as Ie, shallowRef as U, ref as _, computed as D, watch as ee, onMounted as Ne, onUnmounted as Oe, openBlock as F, createElementBlock as V, normalizeClass as Pe, toDisplayString as te, createCommentVNode as ne, createElementVNode as $, createVNode as ve, unref as u, normalizeStyle as Be } from "vue";
2
2
  /* empty css */
3
- import se from "./RichTextToolbar2.vue.js";
4
- /* empty css */
5
- import de from "./RichTextLinkPopover2.vue.js";
6
- /* empty css */
7
- import { useRichTextImageUpload as ue } from "./composables/useRichTextImageUpload.js";
8
- import { useRichTextLinks as ce } from "./composables/useRichTextLinks.js";
9
- const fe = ["aria-labelledby", "aria-describedby"], me = ["id", "for"], ve = { class: "rte-wrapper" }, ye = { class: "rte-body-wrap" }, ge = ["id", "contenteditable", "aria-label", "aria-readonly", "aria-disabled", "aria-invalid"], be = ["id"], Se = /* @__PURE__ */ te({
3
+ import Ue from "./RichTextToolbar.vue.js";
4
+ /* empty css */
5
+ import De from "./RichTextLinkPopover.vue.js";
6
+ /* empty css */
7
+ import { useRichTextImageUpload as Fe } from "./composables/useRichTextImageUpload.js";
8
+ import { useRichTextLinks as Ve } from "./composables/useRichTextLinks.js";
9
+ import { resolveRichTextTools as $e } from "./types.js";
10
+ const je = ["aria-labelledby", "aria-describedby"], qe = ["id", "for"], Ke = { class: "rte-wrapper" }, We = { class: "rte-body-wrap" }, ze = ["id", "contenteditable", "aria-label", "aria-readonly", "aria-disabled", "aria-invalid"], Xe = ["id"], ot = /* @__PURE__ */ Ie({
10
11
  __name: "RichTextEditor",
11
12
  props: {
12
13
  modelValue: { default: "" },
14
+ documentKey: {},
13
15
  placeholder: { default: "Start typing…" },
14
16
  disabled: { type: Boolean, default: !1 },
15
17
  minHeight: { default: "180px" },
@@ -21,8 +23,8 @@ const fe = ["aria-labelledby", "aria-describedby"], me = ["id", "for"], ve = { c
21
23
  tools: {}
22
24
  },
23
25
  emits: ["update:modelValue", "focus", "blur", "image-removed"],
24
- setup(o, { emit: N }) {
25
- const i = o, b = N, r = v(null), A = v(null), x = v(null), R = v(!1), T = v(!0), B = ne({
26
+ setup(o, { emit: ge }) {
27
+ const i = o, I = ge, s = U(null), oe = U(null), j = U(null), q = _(!1), N = _(!0), K = U({
26
28
  bold: !1,
27
29
  italic: !1,
28
30
  underline: !1,
@@ -32,107 +34,235 @@ const fe = ["aria-labelledby", "aria-describedby"], me = ["id", "for"], ve = { c
32
34
  justifyLeft: !1,
33
35
  justifyCenter: !1,
34
36
  justifyRight: !1
35
- }), S = v("");
36
- let u = null, c = null, p = !1;
37
- function y() {
38
- if (p) return;
37
+ }), W = _("");
38
+ let m = null, M = null, k = !1, g = "", C = !1, L, z = !1;
39
+ const re = D(() => new Set($e(i.tools)));
40
+ function O(e) {
41
+ const t = s.value;
42
+ return !!t && t.contains(e.startContainer) && t.contains(e.endContainer);
43
+ }
44
+ function T() {
45
+ if (k) return;
39
46
  const e = window.getSelection();
40
47
  if (e && e.rangeCount > 0)
41
48
  try {
42
- u = e.getRangeAt(0).cloneRange();
49
+ const t = e.getRangeAt(0);
50
+ if (!O(t) || m && m.startContainer === t.startContainer && m.startOffset === t.startOffset && m.endContainer === t.endContainer && m.endOffset === t.endOffset) return;
51
+ m = t.cloneRange();
43
52
  } catch {
44
- u = null;
53
+ m = null;
45
54
  }
46
55
  }
47
- function g() {
48
- if (!(!u || p))
56
+ function x() {
57
+ if (k) return;
58
+ const e = window.getSelection();
59
+ if (!(e?.rangeCount && O(e.getRangeAt(0))) && !(!m || !O(m)))
49
60
  try {
50
- const e = window.getSelection();
51
- e?.removeAllRanges(), e?.addRange(u);
61
+ const t = window.getSelection();
62
+ t?.removeAllRanges(), t?.addRange(m);
52
63
  } catch {
53
- u = null;
64
+ m = null;
54
65
  }
55
66
  }
56
- oe(
57
- () => i.modelValue,
58
- (e) => {
59
- const t = r.value;
60
- if (!t) return;
61
- const n = e ?? "";
62
- t.innerHTML !== n && (t.innerHTML = n, E(), P());
67
+ function le(e, t = !1) {
68
+ const n = s.value;
69
+ if (!n) return;
70
+ if (C) {
71
+ if (!t && !L && e !== g) {
72
+ const f = document.createElement("template");
73
+ if (f.innerHTML = e, f.innerHTML === g) return;
74
+ }
75
+ (t || e !== g || L) && (L = { html: e, replace: t || !!L?.replace });
76
+ return;
77
+ }
78
+ if (!t && e === g) return;
79
+ const r = n.innerHTML;
80
+ if (!t && r === e) {
81
+ g = r;
82
+ return;
83
+ }
84
+ const l = document.createElement("template");
85
+ if (l.innerHTML = e, !t && l.innerHTML === r) {
86
+ g = r;
87
+ return;
88
+ }
89
+ if (!t && he(n, r, l)) {
90
+ g = n.innerHTML;
91
+ return;
92
+ }
93
+ const d = window.getSelection(), c = document.activeElement === n && d?.rangeCount && O(d.getRangeAt(0)), h = !t && c && d ? ye(n, d) : null;
94
+ m = null, a.closeLinkPopover(), n.innerHTML = e, g = n.innerHTML, H = !0, X(!t), G(), c && d && document.activeElement === n && (h ? pe(n, d, h) : d.setBaseAndExtent(n, 0, n, 0), T(), y());
95
+ }
96
+ function he(e, t, n) {
97
+ if (!/<img\b/i.test(t) || !/<img\b/i.test(n.innerHTML)) return !1;
98
+ const r = document.createElement("template");
99
+ r.innerHTML = t;
100
+ const l = ["alt", "loading", "data-builto-file-id"], d = r.content.querySelectorAll("img"), c = n.content.querySelectorAll("img");
101
+ if (d.length !== c.length) return !1;
102
+ const h = Array.from(c, (f) => l.map((v) => f.getAttribute(v)));
103
+ for (const f of [...Array.from(d), ...Array.from(c)])
104
+ for (const v of l) f.removeAttribute(v);
105
+ return r.innerHTML !== n.innerHTML ? !1 : (e.querySelectorAll("img").forEach((f, v) => {
106
+ l.forEach((E, Z) => {
107
+ const b = h[v][Z];
108
+ b === null ? f.removeAttribute(E) : f.getAttribute(E) !== b && f.setAttribute(E, b);
109
+ });
110
+ }), !0);
111
+ }
112
+ function ye(e, t) {
113
+ if (!t.anchorNode || !t.focusNode) return null;
114
+ const n = (r, l) => {
115
+ const d = [];
116
+ let c = r;
117
+ for (; c !== e && c.parentNode; )
118
+ d.unshift(Array.prototype.indexOf.call(c.parentNode.childNodes, c)), c = c.parentNode;
119
+ const h = document.createRange();
120
+ return h.selectNodeContents(e), h.setEnd(r, l), { path: d, type: r.nodeType, offset: l, textOffset: h.toString().length };
121
+ };
122
+ return { anchor: n(t.anchorNode, t.anchorOffset), focus: n(t.focusNode, t.focusOffset) };
123
+ }
124
+ function pe(e, t, n) {
125
+ const r = (f) => {
126
+ let v = e;
127
+ for (const A of f.path) v = v?.childNodes[A];
128
+ if (v?.nodeType === f.type) {
129
+ const A = v.nodeType === Node.TEXT_NODE ? v.textContent?.length ?? 0 : v.childNodes.length;
130
+ return [v, Math.min(f.offset, A)];
131
+ }
132
+ let E = f.textOffset;
133
+ const Z = document.createTreeWalker(e, NodeFilter.SHOW_TEXT);
134
+ let b, B = null;
135
+ for (; b = Z.nextNode(); ) {
136
+ const A = b.textContent?.length ?? 0;
137
+ if (E <= A) return [b, E];
138
+ E -= A, B = b;
139
+ }
140
+ return B ? [B, B.textContent?.length ?? 0] : [e, e.childNodes.length];
141
+ }, [l, d] = r(n.anchor), [c, h] = r(n.focus);
142
+ t.setBaseAndExtent(l, d, c, h);
143
+ }
144
+ ee(
145
+ [() => i.modelValue, () => i.documentKey],
146
+ ([e, t], [, n]) => {
147
+ le(e ?? "", t !== n);
63
148
  }
64
149
  );
65
- let H = /* @__PURE__ */ new Set();
66
- function P() {
67
- const e = r.value;
68
- if (!e) return;
69
- const t = new Set(
70
- Array.from(e.querySelectorAll("img")).map((n) => n.getAttribute("src") || "").filter((n) => n && !n.startsWith("blob:"))
150
+ let ie = /* @__PURE__ */ new Set(), ae = !1, H = !0, S;
151
+ function se(e) {
152
+ if (H) return;
153
+ const t = (n) => n instanceof Element && (n.tagName === "IMG" || !!n.querySelector("img"));
154
+ for (const n of e)
155
+ if (n.type === "attributes" && n.target.tagName === "IMG" || n.type === "childList" && (Array.from(n.addedNodes).some(t) || Array.from(n.removedNodes).some(t))) {
156
+ H = !0;
157
+ return;
158
+ }
159
+ }
160
+ function X(e = !0) {
161
+ const t = s.value;
162
+ if (!t || (S && se(S.takeRecords()), !H && S)) return;
163
+ H = !1;
164
+ const n = t.querySelectorAll("img");
165
+ ae = n.length > 0;
166
+ const r = new Set(
167
+ Array.from(n).map((l) => l.getAttribute("src") || "").filter((l) => l && !l.startsWith("blob:"))
71
168
  );
72
- for (const n of H)
73
- t.has(n) || b("image-removed", n);
74
- H = t;
169
+ if (e) for (const l of ie)
170
+ r.has(l) || I("image-removed", l);
171
+ ie = r;
75
172
  }
76
- const $ = {
77
- saveSelection: y,
78
- restoreSelection: g,
79
- onInput: f
80
- };
81
- h(() => r.value);
82
- const { imageInputRef: z, isUploadingImage: W, triggerImageUpload: Y, onImageFileChange: D, onPaste: j, onDrop: V } = ue(r, $), l = ce({
83
- editorRef: r,
84
- rootRef: A,
85
- linkPopoverElRef: x,
86
- callbacks: $
173
+ const ue = {
174
+ saveSelection: T,
175
+ restoreSelection: x,
176
+ onInput: w
177
+ }, { imageInputRef: be, isUploadingImage: ke, triggerImageUpload: Ce, onImageFileChange: de, onPaste: ce, onDrop: fe } = Fe(s, ue), a = Ve({
178
+ editorRef: s,
179
+ rootRef: oe,
180
+ linkPopoverElRef: j,
181
+ callbacks: ue
87
182
  });
88
- le(() => {
89
- const e = r.value;
90
- e && i.modelValue && (e.innerHTML = i.modelValue), E(), P(), document.addEventListener("selectionchange", F), document.addEventListener("mousedown", M, !0), document.addEventListener("keydown", K, !0);
91
- }), ae(() => {
92
- p = !0, u = null, c !== null && cancelAnimationFrame(c), document.removeEventListener("selectionchange", F), document.removeEventListener("mousedown", M, !0), document.removeEventListener("keydown", K, !0);
183
+ Ne(() => {
184
+ const e = s.value;
185
+ e && (i.modelValue && (e.innerHTML = i.modelValue), g = e.innerHTML, typeof MutationObserver < "u" && (S = new MutationObserver(se), S.observe(e, { subtree: !0, childList: !0, attributes: !0, attributeFilter: ["src"] }))), X(!1), G();
186
+ }), ee(() => a.linkPopover.value.visible, (e) => {
187
+ e ? (document.addEventListener("mousedown", J, !0), document.addEventListener("keydown", Q, !0)) : (document.removeEventListener("mousedown", J, !0), document.removeEventListener("keydown", Q, !0));
188
+ }), Oe(() => {
189
+ k = !0, S?.disconnect(), m = null, M !== null && cancelAnimationFrame(M), document.removeEventListener("selectionchange", Y), document.removeEventListener("mousedown", J, !0), document.removeEventListener("keydown", Q, !0);
93
190
  });
94
- function E() {
95
- const e = r.value;
191
+ function G() {
192
+ const e = s.value;
96
193
  if (!e) return;
97
- const t = (e.textContent ?? "").trim();
98
- T.value = t === "" && !e.querySelector("img");
194
+ if (ae) {
195
+ N.value = !1;
196
+ return;
197
+ }
198
+ const t = document.createTreeWalker(e, NodeFilter.SHOW_TEXT);
199
+ let n;
200
+ for (; n = t.nextNode(); )
201
+ if (n.textContent?.trim()) {
202
+ N.value = !1;
203
+ return;
204
+ }
205
+ N.value = !0;
206
+ }
207
+ function w() {
208
+ const e = s.value;
209
+ if (!e || k || C || z) return;
210
+ const t = e.innerHTML;
211
+ t !== g && (g = t, I("update:modelValue", t), X(), G()), y();
212
+ }
213
+ function Le() {
214
+ C = !0, L = void 0;
215
+ }
216
+ function me() {
217
+ C = !1;
218
+ const e = L;
219
+ if (L = void 0, !e) {
220
+ w();
221
+ return;
222
+ }
223
+ z = !0, queueMicrotask(() => {
224
+ z = !1, k || le(i.modelValue ?? "", e.replace || (i.modelValue ?? "") === g);
225
+ });
99
226
  }
100
- function f() {
101
- E(), b("update:modelValue", r.value?.innerHTML ?? ""), P(), d();
227
+ function we(e) {
228
+ q.value = !0, document.addEventListener("selectionchange", Y), T(), y(), I("focus", e);
102
229
  }
103
- function k(e, t) {
230
+ function Ee(e) {
231
+ q.value = !1, document.removeEventListener("selectionchange", Y), C && me(), I("blur", e);
232
+ }
233
+ function P(e, t) {
104
234
  if (!(i.disabled || i.readonly)) {
105
- g(), r.value?.focus();
235
+ x(), s.value?.focus();
106
236
  try {
107
237
  document.execCommand(e, !1, t ?? void 0);
108
238
  } catch {
109
239
  }
110
- d(), f();
240
+ y(), w();
111
241
  }
112
242
  }
113
- function G(e) {
243
+ function Te(e) {
114
244
  if (!(i.disabled || i.readonly)) {
115
- g(), r.value?.focus();
245
+ x(), s.value?.focus();
116
246
  try {
117
247
  document.execCommand("formatBlock", !1, e);
118
248
  } catch {
119
249
  }
120
- d(), f();
250
+ y(), w();
121
251
  }
122
252
  }
123
- function J() {
253
+ function Se() {
124
254
  if (!(i.disabled || i.readonly)) {
125
- g(), r.value?.focus();
255
+ x(), s.value?.focus();
126
256
  try {
127
257
  document.execCommand("removeFormat", !1, void 0), document.execCommand("formatBlock", !1, "div");
128
258
  } catch {
129
259
  }
130
- d(), f();
260
+ y(), w();
131
261
  }
132
262
  }
133
- function Q() {
263
+ function Re() {
134
264
  if (i.disabled || i.readonly) return;
135
- g(), r.value?.focus();
265
+ x(), s.value?.focus();
136
266
  const e = window.getSelection();
137
267
  if (!e || e.rangeCount === 0 || e.isCollapsed) return;
138
268
  const t = e.getRangeAt(0);
@@ -140,123 +270,124 @@ const fe = ["aria-labelledby", "aria-describedby"], me = ["id", "for"], ve = { c
140
270
  const n = document.createElement("code");
141
271
  t.surroundContents(n), e.removeAllRanges();
142
272
  } catch {
143
- const n = t.extractContents(), O = document.createElement("code");
144
- O.appendChild(n), t.insertNode(O), e.removeAllRanges();
273
+ const n = t.extractContents(), r = document.createElement("code");
274
+ r.appendChild(n), t.insertNode(r), e.removeAllRanges();
145
275
  }
146
- d(), f();
276
+ y(), w();
147
277
  }
148
- function d() {
149
- c !== null && cancelAnimationFrame(c), c = requestAnimationFrame(() => {
150
- c = null, X();
151
- });
278
+ function y() {
279
+ M !== null || k || (M = requestAnimationFrame(() => {
280
+ M = null, Ae();
281
+ }));
152
282
  }
153
- function s(e) {
283
+ function p(e) {
154
284
  try {
155
285
  return document.queryCommandState(e);
156
286
  } catch {
157
287
  return !1;
158
288
  }
159
289
  }
160
- function X() {
161
- if (!p) {
162
- B.value = {
163
- bold: s("bold"),
164
- italic: s("italic"),
165
- underline: s("underline"),
166
- strikeThrough: s("strikeThrough"),
167
- insertOrderedList: s("insertOrderedList"),
168
- insertUnorderedList: s("insertUnorderedList"),
169
- justifyLeft: s("justifyLeft"),
170
- justifyCenter: s("justifyCenter"),
171
- justifyRight: s("justifyRight")
172
- };
173
- try {
174
- S.value = document.queryCommandValue("formatBlock").toLowerCase();
175
- } catch {
176
- S.value = "";
177
- }
178
- l.checkLinkAtCursor();
290
+ function Ae() {
291
+ if (k || C || document.activeElement !== s.value) return;
292
+ const e = re.value, t = {
293
+ bold: e.has("bold") && p("bold"),
294
+ italic: e.has("italic") && p("italic"),
295
+ underline: e.has("underline") && p("underline"),
296
+ strikeThrough: e.has("strikethrough") && p("strikeThrough"),
297
+ insertOrderedList: e.has("orderedList") && p("insertOrderedList"),
298
+ insertUnorderedList: e.has("bulletList") && p("insertUnorderedList"),
299
+ justifyLeft: e.has("alignLeft") && p("justifyLeft"),
300
+ justifyCenter: e.has("alignCenter") && p("justifyCenter"),
301
+ justifyRight: e.has("alignRight") && p("justifyRight")
302
+ };
303
+ Object.keys(t).some((n) => t[n] !== K.value[n]) && (K.value = t);
304
+ try {
305
+ W.value = ["h1", "h2", "p", "blockquote"].some((n) => e.has(n)) ? document.queryCommandValue("formatBlock").toLowerCase() : "";
306
+ } catch {
307
+ W.value = "";
179
308
  }
309
+ a.checkLinkAtCursor();
180
310
  }
181
- function F() {
182
- const e = r.value;
311
+ ee(re, y);
312
+ function Y() {
313
+ const e = s.value;
183
314
  if (!e) return;
184
315
  const t = document.activeElement;
185
- t !== e && !e.contains(t) || (y(), d());
316
+ t !== e && !e.contains(t) || (T(), y());
186
317
  }
187
- function Z(e) {
188
- if (e.ctrlKey || e.metaKey)
318
+ function Me(e) {
319
+ if (!(e.isComposing || C || !(e.ctrlKey || e.metaKey)))
189
320
  switch (e.key.toLowerCase()) {
190
321
  case "b":
191
- e.preventDefault(), k("bold");
322
+ e.preventDefault(), P("bold");
192
323
  break;
193
324
  case "i":
194
- e.preventDefault(), k("italic");
325
+ e.preventDefault(), P("italic");
195
326
  break;
196
327
  case "u":
197
- e.preventDefault(), k("underline");
328
+ e.preventDefault(), P("underline");
198
329
  break;
199
330
  case "k":
200
- e.preventDefault(), l.openLinkPopover();
331
+ e.preventDefault(), a.openLinkPopover();
201
332
  break;
202
333
  }
203
334
  }
204
- function M(e) {
205
- if (!l.linkPopover.value.visible) return;
206
- const t = x.value?.$el;
207
- t && t.contains(e.target) || r.value?.contains(e.target) || l.closeLinkPopover();
335
+ function J(e) {
336
+ if (!a.linkPopover.value.visible) return;
337
+ const t = j.value?.$el;
338
+ t && t.contains(e.target) || s.value?.contains(e.target) || a.closeLinkPopover();
208
339
  }
209
- function K(e) {
210
- e.key === "Escape" && l.linkPopover.value.visible && l.closeLinkPopover();
340
+ function Q(e) {
341
+ e.key === "Escape" && a.linkPopover.value.visible && a.closeLinkPopover();
211
342
  }
212
- const _ = h(() => ({
343
+ const xe = D(() => ({
213
344
  minHeight: i.minHeight,
214
345
  ...i.maxHeight ? { maxHeight: i.maxHeight, overflowY: "auto" } : {}
215
- })), ee = h(() => ({
216
- transform: `translate(${l.linkPopover.value.x}px, ${l.linkPopover.value.y}px)`
217
- })), m = h(() => i.id ?? `rte-${Math.random().toString(36).slice(2, 7)}`);
218
- return (e, t) => (C(), L("div", {
346
+ })), He = D(() => ({
347
+ transform: `translate(${a.linkPopover.value.x}px, ${a.linkPopover.value.y}px)`
348
+ })), R = D(() => i.id ?? `rte-${Math.random().toString(36).slice(2, 7)}`);
349
+ return (e, t) => (F(), V("div", {
219
350
  ref_key: "rootRef",
220
- ref: A,
221
- class: re(["rte-root", [
351
+ ref: oe,
352
+ class: Pe(["rte-root", [
222
353
  o.error && "rte-error",
223
354
  o.disabled && "rte-disabled",
224
355
  o.readonly && "rte-readonly",
225
- R.value && "rte-focused"
356
+ q.value && "rte-focused"
226
357
  ]]),
227
358
  role: "group",
228
- "aria-labelledby": o.label ? `${m.value}-label` : void 0,
229
- "aria-describedby": o.error ? `${m.value}-error` : void 0
359
+ "aria-labelledby": o.label ? `${R.value}-label` : void 0,
360
+ "aria-describedby": o.error ? `${R.value}-error` : void 0
230
361
  }, [
231
- o.label ? (C(), L("label", {
362
+ o.label ? (F(), V("label", {
232
363
  key: 0,
233
- id: `${m.value}-label`,
234
- for: m.value,
364
+ id: `${R.value}-label`,
365
+ for: R.value,
235
366
  class: "rte-label"
236
- }, I(o.label), 9, me)) : U("", !0),
237
- w("div", ve, [
238
- q(se, {
239
- toolbarState: B.value,
240
- activeBlock: S.value,
367
+ }, te(o.label), 9, qe)) : ne("", !0),
368
+ $("div", Ke, [
369
+ ve(Ue, {
370
+ toolbarState: K.value,
371
+ activeBlock: W.value,
241
372
  disabled: o.disabled,
242
373
  readonly: o.readonly,
243
- isUploadingImage: a(W),
374
+ isUploadingImage: u(ke),
244
375
  label: o.label,
245
376
  tools: o.tools,
246
- onCommand: k,
247
- onSetBlock: G,
248
- onInsertCode: Q,
249
- onTriggerImageUpload: t[0] || (t[0] = (n) => a(Y)(!(!o.disabled && !o.readonly))),
250
- onOpenLinkPopover: a(l).openLinkPopover,
251
- onClearFormat: J
377
+ onCommand: P,
378
+ onSetBlock: Te,
379
+ onInsertCode: Re,
380
+ onTriggerImageUpload: t[0] || (t[0] = (n) => u(Ce)(!(!o.disabled && !o.readonly))),
381
+ onOpenLinkPopover: u(a).openLinkPopover,
382
+ onClearFormat: Se
252
383
  }, null, 8, ["toolbarState", "activeBlock", "disabled", "readonly", "isUploadingImage", "label", "tools", "onOpenLinkPopover"]),
253
- w("div", ye, [
254
- w("div", {
255
- id: m.value,
384
+ $("div", We, [
385
+ $("div", {
386
+ id: R.value,
256
387
  ref_key: "editorRef",
257
- ref: r,
388
+ ref: s,
258
389
  class: "rte-editor scrollbar-thin always-scroll",
259
- style: ie(_.value),
390
+ style: Be(xe.value),
260
391
  contenteditable: !o.disabled && !o.readonly ? "true" : "false",
261
392
  role: "textbox",
262
393
  "aria-multiline": "true",
@@ -265,63 +396,61 @@ const fe = ["aria-labelledby", "aria-describedby"], me = ["id", "for"], ve = { c
265
396
  "aria-disabled": o.disabled || void 0,
266
397
  "aria-invalid": !!o.error || void 0,
267
398
  spellcheck: "true",
268
- onInputPassive: f,
269
- onFocus: t[1] || (t[1] = (n) => {
270
- R.value = !0, y(), d(), b("focus", n);
271
- }),
272
- onBlur: t[2] || (t[2] = (n) => {
273
- R.value = !1, b("blur", n);
274
- }),
275
- onKeydown: Z,
276
- onKeyupPassive: y,
277
- onMouseupPassive: y,
278
- onPaste: t[3] || (t[3] = //@ts-ignore
279
- (...n) => a(j) && a(j)(...n)),
280
- onDrop: t[4] || (t[4] = //@ts-ignore
281
- (...n) => a(V) && a(V)(...n))
282
- }, null, 44, ge),
283
- w("input", {
399
+ onInputPassive: w,
400
+ onCompositionstart: Le,
401
+ onCompositionend: me,
402
+ onFocus: we,
403
+ onBlur: Ee,
404
+ onKeydown: Me,
405
+ onKeyupPassive: T,
406
+ onMouseupPassive: T,
407
+ onPaste: t[1] || (t[1] = //@ts-ignore
408
+ (...n) => u(ce) && u(ce)(...n)),
409
+ onDrop: t[2] || (t[2] = //@ts-ignore
410
+ (...n) => u(fe) && u(fe)(...n))
411
+ }, null, 44, ze),
412
+ $("input", {
284
413
  ref_key: "imageInputRef",
285
- ref: z,
414
+ ref: be,
286
415
  type: "file",
287
416
  accept: "image/jpeg,image/png,image/webp,image/gif,image/svg+xml",
288
417
  class: "rte-hidden-input",
289
418
  style: { display: "none" },
290
419
  "aria-hidden": "true",
291
420
  tabindex: "-1",
292
- onChange: t[5] || (t[5] = //@ts-ignore
293
- (...n) => a(D) && a(D)(...n))
421
+ onChange: t[3] || (t[3] = //@ts-ignore
422
+ (...n) => u(de) && u(de)(...n))
294
423
  }, null, 544),
295
- T.value && !o.disabled ? (C(), L("div", {
424
+ N.value && !o.disabled ? (F(), V("div", {
296
425
  key: 0,
297
426
  class: "rte-placeholder",
298
427
  "aria-hidden": "true",
299
- onClick: t[6] || (t[6] = (n) => r.value?.focus())
300
- }, I(o.placeholder), 1)) : U("", !0),
301
- q(de, {
428
+ onClick: t[4] || (t[4] = (n) => s.value?.focus())
429
+ }, te(o.placeholder), 1)) : ne("", !0),
430
+ ve(De, {
302
431
  ref_key: "linkPopoverCompRef",
303
- ref: x,
304
- visible: a(l).linkPopover.value.visible,
305
- isEditing: a(l).linkPopover.value.isEditing,
306
- url: a(l).linkPopover.value.url,
307
- popoverStyle: ee.value,
308
- "onUpdate:url": a(l).updateUrl,
309
- onApply: a(l).applyLink,
310
- onUnlink: a(l).unlinkCurrent,
311
- onOpenTab: a(l).openLinkInTab,
312
- onClose: a(l).closeLinkPopover
432
+ ref: j,
433
+ visible: u(a).linkPopover.value.visible,
434
+ isEditing: u(a).linkPopover.value.isEditing,
435
+ url: u(a).linkPopover.value.url,
436
+ popoverStyle: He.value,
437
+ "onUpdate:url": u(a).updateUrl,
438
+ onApply: u(a).applyLink,
439
+ onUnlink: u(a).unlinkCurrent,
440
+ onOpenTab: u(a).openLinkInTab,
441
+ onClose: u(a).closeLinkPopover
313
442
  }, null, 8, ["visible", "isEditing", "url", "popoverStyle", "onUpdate:url", "onApply", "onUnlink", "onOpenTab", "onClose"])
314
443
  ])
315
444
  ]),
316
- o.error ? (C(), L("p", {
445
+ o.error ? (F(), V("p", {
317
446
  key: 1,
318
- id: `${m.value}-error`,
447
+ id: `${R.value}-error`,
319
448
  class: "rte-error-msg",
320
449
  "aria-live": "polite"
321
- }, I(o.error), 9, be)) : U("", !0)
322
- ], 10, fe));
450
+ }, te(o.error), 9, Xe)) : ne("", !0)
451
+ ], 10, je));
323
452
  }
324
453
  });
325
454
  export {
326
- Se as default
455
+ ot as default
327
456
  };
@@ -1,11 +1,6 @@
1
- interface Props {
2
- visible: boolean;
3
- isEditing: boolean;
4
- url: string;
5
- popoverStyle?: Record<string, string | number>;
6
- }
1
+ import { RichTextLinkPopoverProps } from './types';
7
2
  declare function focusInput(): void;
8
- declare const _default: import('vue').DefineComponent<Props, {
3
+ declare const _default: import('vue').DefineComponent<RichTextLinkPopoverProps, {
9
4
  focusInput: typeof focusInput;
10
5
  el: import('vue').Ref<HTMLInputElement, HTMLInputElement>;
11
6
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
@@ -14,7 +9,7 @@ declare const _default: import('vue').DefineComponent<Props, {
14
9
  "update:url": (val: string) => any;
15
10
  unlink: () => any;
16
11
  openTab: () => any;
17
- }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
12
+ }, string, import('vue').PublicProps, Readonly<RichTextLinkPopoverProps> & Readonly<{
18
13
  onApply?: () => any;
19
14
  onClose?: () => any;
20
15
  "onUpdate:url"?: (val: string) => any;