vlite3 1.1.8 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/components/Chart/BarChart.vue.js +369 -0
  2. package/components/Chart/BarChart.vue2.js +4 -0
  3. package/components/Chart/CircleChart.vue.js +137 -0
  4. package/components/Chart/CircleChart.vue2.js +4 -0
  5. package/components/Chart/GaugeChart.vue.js +443 -0
  6. package/components/Chart/GaugeChart.vue2.js +4 -0
  7. package/components/Chart/LineChart.vue.js +7 -0
  8. package/components/Chart/LineChart.vue2.js +313 -0
  9. package/components/Chart/PieChart.vue.js +203 -0
  10. package/components/Chart/PieChart.vue2.js +4 -0
  11. package/components/Chart/utils.js +90 -0
  12. package/components/Footer/Footer.vue.js +35 -0
  13. package/components/Footer/Footer.vue2.js +4 -0
  14. package/components/Footer/Variant1.vue.js +178 -0
  15. package/components/Footer/Variant1.vue2.js +4 -0
  16. package/components/Footer/Variant2.vue.js +177 -0
  17. package/components/Footer/Variant2.vue2.js +4 -0
  18. package/components/Footer/Variant3.vue.js +82 -0
  19. package/components/Footer/Variant3.vue2.js +4 -0
  20. package/components/RichTextEditor/RichTextEditor.vue.js +332 -0
  21. package/components/RichTextEditor/RichTextEditor.vue3.js +5 -0
  22. package/components/RichTextEditor/RichTextLinkPopover.vue.js +107 -0
  23. package/components/RichTextEditor/RichTextLinkPopover.vue3.js +5 -0
  24. package/components/RichTextEditor/RichTextReader.vue.js +7 -0
  25. package/components/RichTextEditor/RichTextReader.vue2.js +19 -0
  26. package/components/RichTextEditor/RichTextToolbar.vue.js +330 -0
  27. package/components/RichTextEditor/RichTextToolbar.vue3.js +5 -0
  28. package/components/RichTextEditor/composables/useRichTextImageUpload.js +77 -0
  29. package/components/RichTextEditor/composables/useRichTextLinks.js +120 -0
  30. package/core/config.d.ts +2 -2
  31. package/index.d.ts +3 -0
  32. package/index.js +332 -315
  33. package/package.json +1 -1
  34. package/style.css +1 -1
@@ -0,0 +1,332 @@
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";
2
+ /* empty css */
3
+ import de from "./RichTextToolbar.vue.js";
4
+ /* empty css */
5
+ import se from "./RichTextLinkPopover.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" }, ge = { class: "rte-body-wrap" }, ye = ["id", "contenteditable", "aria-label", "aria-readonly", "aria-disabled", "aria-invalid"], be = ["id"], Se = /* @__PURE__ */ te({
10
+ __name: "RichTextEditor",
11
+ props: {
12
+ modelValue: { default: "" },
13
+ placeholder: { default: "Start typing…" },
14
+ disabled: { type: Boolean, default: !1 },
15
+ minHeight: { default: "180px" },
16
+ maxHeight: { default: "" },
17
+ label: {},
18
+ error: {},
19
+ id: {},
20
+ readonly: { type: Boolean, default: !1 }
21
+ },
22
+ emits: ["update:modelValue", "focus", "blur", "image-removed"],
23
+ setup(o, { emit: N }) {
24
+ const i = o, b = N, r = v(null), A = v(null), x = v(null), R = v(!1), T = v(!0), B = ne({
25
+ bold: !1,
26
+ italic: !1,
27
+ underline: !1,
28
+ strikeThrough: !1,
29
+ insertOrderedList: !1,
30
+ insertUnorderedList: !1,
31
+ justifyLeft: !1,
32
+ justifyCenter: !1,
33
+ justifyRight: !1
34
+ }), S = v("");
35
+ let u = null, c = null, p = !1;
36
+ function g() {
37
+ if (p) return;
38
+ const e = window.getSelection();
39
+ if (e && e.rangeCount > 0)
40
+ try {
41
+ u = e.getRangeAt(0).cloneRange();
42
+ } catch {
43
+ u = null;
44
+ }
45
+ }
46
+ function y() {
47
+ if (!(!u || p))
48
+ try {
49
+ const e = window.getSelection();
50
+ e?.removeAllRanges(), e?.addRange(u);
51
+ } catch {
52
+ u = null;
53
+ }
54
+ }
55
+ oe(
56
+ () => i.modelValue,
57
+ (e) => {
58
+ const t = r.value;
59
+ if (!t) return;
60
+ const n = e ?? "";
61
+ t.innerHTML !== n && (t.innerHTML = n, E(), P());
62
+ }
63
+ );
64
+ let H = /* @__PURE__ */ new Set();
65
+ function P() {
66
+ const e = r.value;
67
+ if (!e) return;
68
+ const t = new Set(
69
+ Array.from(e.querySelectorAll("img")).map((n) => n.getAttribute("src") || "").filter((n) => n && !n.startsWith("blob:"))
70
+ );
71
+ for (const n of H)
72
+ t.has(n) || b("image-removed", n);
73
+ H = t;
74
+ }
75
+ const $ = {
76
+ saveSelection: g,
77
+ restoreSelection: y,
78
+ onInput: f
79
+ };
80
+ h(() => r.value);
81
+ const {
82
+ imageInputRef: z,
83
+ isUploadingImage: W,
84
+ triggerImageUpload: Y,
85
+ onImageFileChange: D,
86
+ onPaste: j,
87
+ onDrop: V
88
+ } = ue(r, $), l = ce({
89
+ editorRef: r,
90
+ rootRef: A,
91
+ linkPopoverElRef: x,
92
+ callbacks: $
93
+ });
94
+ le(() => {
95
+ const e = r.value;
96
+ e && i.modelValue && (e.innerHTML = i.modelValue), E(), P(), document.addEventListener("selectionchange", F), document.addEventListener("mousedown", M, !0), document.addEventListener("keydown", K, !0);
97
+ }), ae(() => {
98
+ p = !0, u = null, c !== null && cancelAnimationFrame(c), document.removeEventListener("selectionchange", F), document.removeEventListener("mousedown", M, !0), document.removeEventListener("keydown", K, !0);
99
+ });
100
+ function E() {
101
+ const e = r.value;
102
+ if (!e) return;
103
+ const t = (e.textContent ?? "").trim();
104
+ T.value = t === "" && !e.querySelector("img");
105
+ }
106
+ function f() {
107
+ E(), b("update:modelValue", r.value?.innerHTML ?? ""), P(), s();
108
+ }
109
+ function k(e, t) {
110
+ if (!(i.disabled || i.readonly)) {
111
+ y(), r.value?.focus();
112
+ try {
113
+ document.execCommand(e, !1, t ?? void 0);
114
+ } catch {
115
+ }
116
+ s(), f();
117
+ }
118
+ }
119
+ function G(e) {
120
+ if (!(i.disabled || i.readonly)) {
121
+ y(), r.value?.focus();
122
+ try {
123
+ document.execCommand("formatBlock", !1, e);
124
+ } catch {
125
+ }
126
+ s(), f();
127
+ }
128
+ }
129
+ function J() {
130
+ if (!(i.disabled || i.readonly)) {
131
+ y(), r.value?.focus();
132
+ try {
133
+ document.execCommand("removeFormat", !1, void 0), document.execCommand("formatBlock", !1, "div");
134
+ } catch {
135
+ }
136
+ s(), f();
137
+ }
138
+ }
139
+ function Q() {
140
+ if (i.disabled || i.readonly) return;
141
+ y(), r.value?.focus();
142
+ const e = window.getSelection();
143
+ if (!e || e.rangeCount === 0 || e.isCollapsed) return;
144
+ const t = e.getRangeAt(0);
145
+ try {
146
+ const n = document.createElement("code");
147
+ t.surroundContents(n), e.removeAllRanges();
148
+ } catch {
149
+ const n = t.extractContents(), O = document.createElement("code");
150
+ O.appendChild(n), t.insertNode(O), e.removeAllRanges();
151
+ }
152
+ s(), f();
153
+ }
154
+ function s() {
155
+ c !== null && cancelAnimationFrame(c), c = requestAnimationFrame(() => {
156
+ c = null, X();
157
+ });
158
+ }
159
+ function d(e) {
160
+ try {
161
+ return document.queryCommandState(e);
162
+ } catch {
163
+ return !1;
164
+ }
165
+ }
166
+ function X() {
167
+ if (!p) {
168
+ B.value = {
169
+ bold: d("bold"),
170
+ italic: d("italic"),
171
+ underline: d("underline"),
172
+ strikeThrough: d("strikeThrough"),
173
+ insertOrderedList: d("insertOrderedList"),
174
+ insertUnorderedList: d("insertUnorderedList"),
175
+ justifyLeft: d("justifyLeft"),
176
+ justifyCenter: d("justifyCenter"),
177
+ justifyRight: d("justifyRight")
178
+ };
179
+ try {
180
+ S.value = document.queryCommandValue("formatBlock").toLowerCase();
181
+ } catch {
182
+ S.value = "";
183
+ }
184
+ l.checkLinkAtCursor();
185
+ }
186
+ }
187
+ function F() {
188
+ const e = r.value;
189
+ if (!e) return;
190
+ const t = document.activeElement;
191
+ t !== e && !e.contains(t) || (g(), s());
192
+ }
193
+ function Z(e) {
194
+ if (e.ctrlKey || e.metaKey)
195
+ switch (e.key.toLowerCase()) {
196
+ case "b":
197
+ e.preventDefault(), k("bold");
198
+ break;
199
+ case "i":
200
+ e.preventDefault(), k("italic");
201
+ break;
202
+ case "u":
203
+ e.preventDefault(), k("underline");
204
+ break;
205
+ case "k":
206
+ e.preventDefault(), l.openLinkPopover();
207
+ break;
208
+ }
209
+ }
210
+ function M(e) {
211
+ if (!l.linkPopover.value.visible) return;
212
+ const t = x.value?.$el;
213
+ t && t.contains(e.target) || r.value?.contains(e.target) || l.closeLinkPopover();
214
+ }
215
+ function K(e) {
216
+ e.key === "Escape" && l.linkPopover.value.visible && l.closeLinkPopover();
217
+ }
218
+ const _ = h(() => ({
219
+ minHeight: i.minHeight,
220
+ ...i.maxHeight ? { maxHeight: i.maxHeight, overflowY: "auto" } : {}
221
+ })), ee = h(() => ({
222
+ transform: `translate(${l.linkPopover.value.x}px, ${l.linkPopover.value.y}px)`
223
+ })), m = h(() => i.id ?? `rte-${Math.random().toString(36).slice(2, 7)}`);
224
+ return (e, t) => (C(), L("div", {
225
+ ref_key: "rootRef",
226
+ ref: A,
227
+ class: re(["rte-root", [
228
+ o.error && "rte-error",
229
+ o.disabled && "rte-disabled",
230
+ o.readonly && "rte-readonly",
231
+ R.value && "rte-focused"
232
+ ]]),
233
+ role: "group",
234
+ "aria-labelledby": o.label ? `${m.value}-label` : void 0,
235
+ "aria-describedby": o.error ? `${m.value}-error` : void 0
236
+ }, [
237
+ o.label ? (C(), L("label", {
238
+ key: 0,
239
+ id: `${m.value}-label`,
240
+ for: m.value,
241
+ class: "rte-label"
242
+ }, I(o.label), 9, me)) : U("", !0),
243
+ w("div", ve, [
244
+ q(de, {
245
+ toolbarState: B.value,
246
+ activeBlock: S.value,
247
+ disabled: o.disabled,
248
+ readonly: o.readonly,
249
+ isUploadingImage: a(W),
250
+ label: o.label,
251
+ onCommand: k,
252
+ onSetBlock: G,
253
+ onInsertCode: Q,
254
+ onTriggerImageUpload: t[0] || (t[0] = (n) => a(Y)(!(!o.disabled && !o.readonly))),
255
+ onOpenLinkPopover: a(l).openLinkPopover,
256
+ onClearFormat: J
257
+ }, null, 8, ["toolbarState", "activeBlock", "disabled", "readonly", "isUploadingImage", "label", "onOpenLinkPopover"]),
258
+ w("div", ge, [
259
+ w("div", {
260
+ id: m.value,
261
+ ref_key: "editorRef",
262
+ ref: r,
263
+ class: "rte-editor",
264
+ style: ie(_.value),
265
+ contenteditable: !o.disabled && !o.readonly ? "true" : "false",
266
+ role: "textbox",
267
+ "aria-multiline": "true",
268
+ "aria-label": o.label ?? o.placeholder,
269
+ "aria-readonly": o.readonly || void 0,
270
+ "aria-disabled": o.disabled || void 0,
271
+ "aria-invalid": !!o.error || void 0,
272
+ spellcheck: "true",
273
+ onInputPassive: f,
274
+ onFocus: t[1] || (t[1] = (n) => {
275
+ R.value = !0, g(), s(), b("focus", n);
276
+ }),
277
+ onBlur: t[2] || (t[2] = (n) => {
278
+ R.value = !1, b("blur", n);
279
+ }),
280
+ onKeydown: Z,
281
+ onKeyupPassive: g,
282
+ onMouseupPassive: g,
283
+ onPaste: t[3] || (t[3] = //@ts-ignore
284
+ (...n) => a(j) && a(j)(...n)),
285
+ onDrop: t[4] || (t[4] = //@ts-ignore
286
+ (...n) => a(V) && a(V)(...n))
287
+ }, null, 44, ye),
288
+ w("input", {
289
+ ref_key: "imageInputRef",
290
+ ref: z,
291
+ type: "file",
292
+ accept: "image/jpeg,image/png,image/webp,image/gif,image/svg+xml",
293
+ class: "rte-hidden-input",
294
+ style: { display: "none" },
295
+ "aria-hidden": "true",
296
+ tabindex: "-1",
297
+ onChange: t[5] || (t[5] = //@ts-ignore
298
+ (...n) => a(D) && a(D)(...n))
299
+ }, null, 544),
300
+ T.value && !o.disabled ? (C(), L("div", {
301
+ key: 0,
302
+ class: "rte-placeholder",
303
+ "aria-hidden": "true",
304
+ onClick: t[6] || (t[6] = (n) => r.value?.focus())
305
+ }, I(o.placeholder), 1)) : U("", !0),
306
+ q(se, {
307
+ ref_key: "linkPopoverCompRef",
308
+ ref: x,
309
+ visible: a(l).linkPopover.value.visible,
310
+ isEditing: a(l).linkPopover.value.isEditing,
311
+ url: a(l).linkPopover.value.url,
312
+ popoverStyle: ee.value,
313
+ "onUpdate:url": a(l).updateUrl,
314
+ onApply: a(l).applyLink,
315
+ onUnlink: a(l).unlinkCurrent,
316
+ onOpenTab: a(l).openLinkInTab,
317
+ onClose: a(l).closeLinkPopover
318
+ }, null, 8, ["visible", "isEditing", "url", "popoverStyle", "onUpdate:url", "onApply", "onUnlink", "onOpenTab", "onClose"])
319
+ ])
320
+ ]),
321
+ o.error ? (C(), L("p", {
322
+ key: 1,
323
+ id: `${m.value}-error`,
324
+ class: "rte-error-msg",
325
+ "aria-live": "polite"
326
+ }, I(o.error), 9, be)) : U("", !0)
327
+ ], 10, fe));
328
+ }
329
+ });
330
+ export {
331
+ Se as default
332
+ };
@@ -0,0 +1,5 @@
1
+ import o from "./RichTextEditor.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -0,0 +1,107 @@
1
+ import { defineComponent as b, ref as x, openBlock as o, createBlock as w, Transition as E, withCtx as g, createElementBlock as d, withModifiers as r, normalizeStyle as T, createElementVNode as a, createVNode as s, createTextVNode as k, createCommentVNode as c, nextTick as B } from "vue";
2
+ import u from "../Icon.vue.js";
3
+ const M = { class: "rte-link-input-row" }, I = ["value"], N = ["disabled"], R = { class: "rte-link-actions-row" }, C = /* @__PURE__ */ b({
4
+ __name: "RichTextLinkPopover",
5
+ props: {
6
+ visible: { type: Boolean },
7
+ isEditing: { type: Boolean },
8
+ url: {},
9
+ popoverStyle: {}
10
+ },
11
+ emits: ["update:url", "apply", "unlink", "openTab", "close"],
12
+ setup(t, { expose: f, emit: y }) {
13
+ const n = y, p = x(null);
14
+ function m() {
15
+ B(() => {
16
+ p.value?.focus();
17
+ });
18
+ }
19
+ f({
20
+ focusInput: m,
21
+ el: p
22
+ // fallback if needed
23
+ });
24
+ function v(i) {
25
+ i.key === "Enter" && (i.preventDefault(), n("apply")), i.key === "Escape" && (i.preventDefault(), n("close"));
26
+ }
27
+ return (i, e) => (o(), w(E, { name: "rte-pop" }, {
28
+ default: g(() => [
29
+ t.visible ? (o(), d("div", {
30
+ key: 0,
31
+ class: "rte-link-popover",
32
+ style: T(t.popoverStyle),
33
+ role: "dialog",
34
+ "aria-label": "Link editor",
35
+ "aria-modal": "false",
36
+ onMousedown: e[4] || (e[4] = r(() => {
37
+ }, ["stop"]))
38
+ }, [
39
+ a("div", M, [
40
+ s(u, {
41
+ icon: "lucide:link-2",
42
+ class: "rte-link-icon-prefix",
43
+ "aria-hidden": "true"
44
+ }),
45
+ a("input", {
46
+ ref_key: "linkInputRef",
47
+ ref: p,
48
+ value: t.url,
49
+ onInput: e[0] || (e[0] = (l) => n("update:url", l.target.value)),
50
+ type: "url",
51
+ placeholder: "https://example.com",
52
+ class: "rte-link-input",
53
+ "aria-label": "URL to link to",
54
+ onKeydown: v
55
+ }, null, 40, I),
56
+ a("button", {
57
+ type: "button",
58
+ class: "rte-btn rte-link-apply-btn",
59
+ title: "Apply link",
60
+ "aria-label": "Apply link",
61
+ disabled: !t.url.trim(),
62
+ onMousedown: e[1] || (e[1] = r((l) => n("apply"), ["prevent"]))
63
+ }, [
64
+ s(u, {
65
+ icon: "lucide:check",
66
+ class: "rte-icon",
67
+ "aria-hidden": "true"
68
+ })
69
+ ], 40, N)
70
+ ]),
71
+ a("div", R, [
72
+ t.isEditing ? (o(), d("button", {
73
+ key: 0,
74
+ type: "button",
75
+ class: "rte-link-action-btn rte-link-action-btn--danger",
76
+ onMousedown: e[2] || (e[2] = r((l) => n("unlink"), ["prevent"]))
77
+ }, [
78
+ s(u, {
79
+ icon: "lucide:unlink",
80
+ class: "rte-icon",
81
+ "aria-hidden": "true"
82
+ }),
83
+ e[5] || (e[5] = k(" Unlink ", -1))
84
+ ], 32)) : c("", !0),
85
+ t.isEditing && t.url ? (o(), d("button", {
86
+ key: 1,
87
+ type: "button",
88
+ class: "rte-link-action-btn",
89
+ onMousedown: e[3] || (e[3] = r((l) => n("openTab"), ["prevent"]))
90
+ }, [
91
+ s(u, {
92
+ icon: "lucide:external-link",
93
+ class: "rte-icon",
94
+ "aria-hidden": "true"
95
+ }),
96
+ e[6] || (e[6] = k(" Open ", -1))
97
+ ], 32)) : c("", !0)
98
+ ])
99
+ ], 36)) : c("", !0)
100
+ ]),
101
+ _: 1
102
+ }));
103
+ }
104
+ });
105
+ export {
106
+ C as default
107
+ };
@@ -0,0 +1,5 @@
1
+ import o from "./RichTextLinkPopover.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./RichTextReader.vue2.js";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-55b9fd8b"]]);
5
+ export {
6
+ f as default
7
+ };
@@ -0,0 +1,19 @@
1
+ import { defineComponent as t, openBlock as n, createElementBlock as o, createElementVNode as r } from "vue";
2
+ /* empty css */
3
+ const c = { class: "rte-reader" }, s = ["innerHTML"], _ = /* @__PURE__ */ t({
4
+ __name: "RichTextReader",
5
+ props: {
6
+ content: { default: "" }
7
+ },
8
+ setup(e) {
9
+ return (a, i) => (n(), o("div", c, [
10
+ r("div", {
11
+ class: "rte-content",
12
+ innerHTML: e.content
13
+ }, null, 8, s)
14
+ ]));
15
+ }
16
+ });
17
+ export {
18
+ _ as default
19
+ };