vlite3 1.1.6 → 1.1.8

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 (37) hide show
  1. package/README.md +1 -0
  2. package/components/Chart/GaugeChart.vue.d.ts +120 -0
  3. package/components/Chart/PieChart.vue.d.ts +1 -1
  4. package/components/Chart/index.d.ts +2 -1
  5. package/components/Chart/types.d.ts +60 -1
  6. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  7. package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
  8. package/components/DataTable/DataTable.vue.d.ts +1 -0
  9. package/components/DataTable/DataTable.vue.js +142 -132
  10. package/components/DataTable/DataTableHeader.vue.d.ts +1 -0
  11. package/components/DataTable/DataTableHeader.vue.js +17 -16
  12. package/components/DataTable/DataTableRow.vue.d.ts +1 -0
  13. package/components/DataTable/DataTableRow.vue.js +29 -25
  14. package/components/DataTable/types.d.ts +1 -0
  15. package/components/Dropdown/Dropdown.vue.d.ts +2 -1
  16. package/components/Dropdown/Dropdown.vue.js +37 -34
  17. package/components/Dropdown/DropdownMenu.vue.d.ts +3 -0
  18. package/components/Dropdown/DropdownMenu.vue.js +1 -1
  19. package/components/Dropdown/DropdownMenu.vue2.js +83 -72
  20. package/components/Dropdown/DropdownTrigger.vue.js +8 -4
  21. package/components/MultiSelect/MultiSelect.vue.d.ts +26 -1
  22. package/components/MultiSelect/MultiSelect.vue.js +135 -100
  23. package/components/NavbarCommandPalette.vue.js +1 -1
  24. package/components/Skeleton/Skeleton.vue.d.ts +30 -0
  25. package/components/Skeleton/Skeleton.vue.js +215 -0
  26. package/components/Skeleton/Skeleton.vue2.js +4 -0
  27. package/components/Skeleton/extract.d.ts +5 -0
  28. package/components/Skeleton/extract.js +83 -0
  29. package/components/Skeleton/index.d.ts +4 -0
  30. package/components/Skeleton/shared.d.ts +14 -0
  31. package/components/Skeleton/shared.js +29 -0
  32. package/components/Skeleton/types.d.ts +59 -0
  33. package/components/Skeleton/types.js +6 -0
  34. package/index.d.ts +1 -0
  35. package/index.js +217 -207
  36. package/package.json +1 -1
  37. package/style.css +1 -1
@@ -0,0 +1,83 @@
1
+ const B = /* @__PURE__ */ new Set(["p", "h1", "h2", "h3", "h4", "h5", "h6", "li", "td", "th"]);
2
+ function Y(m, L = "component", h) {
3
+ const n = m.getBoundingClientRect(), p = [], T = h?.leafTags ? /* @__PURE__ */ new Set([...B, ...h.leafTags]) : B, v = h?.captureRoundedBorders ?? !0, A = h?.excludeTags ? new Set(h.excludeTags) : null, N = h?.excludeSelectors ?? null;
4
+ function F(i, d) {
5
+ const r = parseFloat(i.borderTopLeftRadius) || 0, l = parseFloat(i.borderTopRightRadius) || 0, e = parseFloat(i.borderBottomRightRadius) || 0, a = parseFloat(i.borderBottomLeftRadius) || 0;
6
+ if (r === 0 && l === 0 && e === 0 && a === 0) return;
7
+ const f = d ? d.width > 0 && d.height > 0 && Math.abs(d.width - d.height) < 4 : !1;
8
+ return i.borderRadius === "50%" ? "50%" : Math.max(r, l, e, a) > 9998 ? f ? "50%" : 9999 : r === l && l === e && e === a ? r !== 8 ? r : void 0 : `${r}px ${l}px ${e}px ${a}px`;
9
+ }
10
+ function R(i, d) {
11
+ const r = d || window.getComputedStyle(i);
12
+ if ((r.display === "none" || r.visibility === "hidden" || r.opacity === "0") && !i.hasAttribute("data-boneyard-fixture")) return;
13
+ const e = i.tagName.toLowerCase();
14
+ if (A?.has(e) || N?.some((o) => i.matches(o))) return;
15
+ const a = Array.from(i.children), f = [];
16
+ let b = 0;
17
+ for (let o = 0; o < a.length; o++) {
18
+ const s = window.getComputedStyle(a[o]);
19
+ f.push(s), s.display !== "none" && s.visibility !== "hidden" && s.opacity !== "0" && b++;
20
+ }
21
+ const w = e === "img" || e === "svg" || e === "video" || e === "canvas", y = e === "input" || e === "button" || e === "textarea" || e === "select", H = b === 0 || w || y || T.has(e), C = r.backgroundColor, W = C !== "rgba(0, 0, 0, 0)" && C !== "transparent", $ = r.backgroundImage !== "none", k = parseFloat(r.borderTopWidth) || 0, E = v && k > 0 && r.borderTopColor !== "rgba(0, 0, 0, 0)" && r.borderTopColor !== "transparent", q = (parseFloat(r.borderTopLeftRadius) || 0) > 0, M = W || $ || E && q, x = e === "tr" || e === "td" || e === "th" || e === "thead" || e === "tbody" || e === "table";
22
+ let t = null;
23
+ if (H) {
24
+ if (t = i.getBoundingClientRect(), t.width < 1 || t.height < 1) return;
25
+ const o = n.width;
26
+ if (!x && !w && !y && !M && (T.has(e) || (i.textContent?.trim().length || 0) > 0)) {
27
+ const _ = parseFloat(r.fontSize) || 16;
28
+ let u = parseFloat(r.lineHeight);
29
+ isNaN(u) && (u = _ * 1.5);
30
+ let c = Math.round(t.height / u);
31
+ c < 1 && (c = 1);
32
+ for (let g = 0; g < c; g++) {
33
+ const D = g === c - 1;
34
+ let S = t.width;
35
+ c > 1 && D && (S = t.width * 0.7);
36
+ const G = u * 0.7, U = t.top - n.top + g * u + u * 0.15;
37
+ p.push({
38
+ x: o > 0 ? +((t.left - n.left) / o * 100).toFixed(4) : 0,
39
+ y: Math.round(U),
40
+ w: o > 0 ? +(S / o * 100).toFixed(4) : 0,
41
+ h: Math.round(G),
42
+ r: 4
43
+ });
44
+ }
45
+ return;
46
+ }
47
+ const z = w && t.width > 0 && t.height > 0 && Math.abs(t.width - t.height) < 4, I = x ? 0 : z ? "50%" : F(r, t) ?? 8;
48
+ p.push({
49
+ x: o > 0 ? +((t.left - n.left) / o * 100).toFixed(4) : 0,
50
+ y: Math.round(t.top - n.top),
51
+ w: o > 0 ? +(t.width / o * 100).toFixed(4) : 0,
52
+ h: Math.round(t.height),
53
+ r: I
54
+ });
55
+ return;
56
+ }
57
+ if (M && !i.hasAttribute("data-boneyard-fixture") && (t = i.getBoundingClientRect(), t.width >= 1 && t.height >= 1)) {
58
+ const o = x ? 0 : F(r, t) ?? 8, s = n.width;
59
+ p.push({
60
+ x: s > 0 ? +((t.left - n.left) / s * 100).toFixed(4) : 0,
61
+ y: Math.round(t.top - n.top),
62
+ w: s > 0 ? +(t.width / s * 100).toFixed(4) : 0,
63
+ h: Math.round(t.height),
64
+ r: o,
65
+ c: !0
66
+ });
67
+ }
68
+ for (let o = 0; o < a.length; o++)
69
+ R(a[o], f[o]);
70
+ }
71
+ for (const i of Array.from(m.children))
72
+ R(i);
73
+ return {
74
+ name: L,
75
+ viewportWidth: Math.round(n.width),
76
+ width: Math.round(n.width),
77
+ height: Math.round(n.height),
78
+ bones: p
79
+ };
80
+ }
81
+ export {
82
+ Y as snapshotBones
83
+ };
@@ -0,0 +1,4 @@
1
+ export { default as Skeleton } from './Skeleton.vue';
2
+ export * from './types';
3
+ export * from './extract';
4
+ export { registerBones, configureSkeleton, getGlobalConfig } from './shared';
@@ -0,0 +1,14 @@
1
+ import { ResponsiveBones, SkeletonResult, AnimationStyle } from './types';
2
+ export type RegisteredBones = SkeletonResult | ResponsiveBones;
3
+ export interface BoneyardConfig {
4
+ color?: string;
5
+ darkColor?: string;
6
+ animate?: AnimationStyle;
7
+ stagger?: number | boolean;
8
+ transition?: number | boolean;
9
+ }
10
+ export declare function configureSkeleton(config: BoneyardConfig): void;
11
+ export declare function getGlobalConfig(): BoneyardConfig;
12
+ export declare function registerBones(map: Record<string, RegisteredBones>): void;
13
+ export declare function getRegisteredBones(name: string): RegisteredBones | undefined;
14
+ export declare function resolveResponsive(bones: RegisteredBones, width: number): SkeletonResult | null;
@@ -0,0 +1,29 @@
1
+ const i = /* @__PURE__ */ new Map();
2
+ let o = {};
3
+ function c(e) {
4
+ o = { ...o, ...e };
5
+ }
6
+ function f() {
7
+ return o;
8
+ }
9
+ function l(e) {
10
+ for (const [t, n] of Object.entries(e))
11
+ i.set(t, n);
12
+ }
13
+ function g(e) {
14
+ return i.get(e);
15
+ }
16
+ function a(e, t) {
17
+ if (!("breakpoints" in e)) return e;
18
+ const n = Object.keys(e.breakpoints).map(Number).sort((r, u) => r - u);
19
+ if (n.length === 0) return null;
20
+ const s = [...n].reverse().find((r) => t >= r) ?? n[0];
21
+ return e.breakpoints[s] ?? null;
22
+ }
23
+ export {
24
+ c as configureSkeleton,
25
+ f as getGlobalConfig,
26
+ g as getRegisteredBones,
27
+ l as registerBones,
28
+ a as resolveResponsive
29
+ };
@@ -0,0 +1,59 @@
1
+ export interface SnapshotConfig {
2
+ /**
3
+ * HTML tags always captured as a single atomic bone, regardless of children.
4
+ * Default: ['p','h1','h2','h3','h4','h5','h6','li','tr']
5
+ */
6
+ leafTags?: string[];
7
+ /**
8
+ * When true, containers with a visible border AND border-radius are captured
9
+ * as container bones — even with a white or transparent background.
10
+ * Default: true
11
+ */
12
+ captureRoundedBorders?: boolean;
13
+ /**
14
+ * HTML tags to skip entirely — no bone emitted, children not walked.
15
+ */
16
+ excludeTags?: string[];
17
+ /**
18
+ * CSS selectors to skip entirely.
19
+ */
20
+ excludeSelectors?: string[];
21
+ }
22
+ /** A single skeleton bone */
23
+ export interface Bone {
24
+ x: number;
25
+ y: number;
26
+ w: number;
27
+ h: number;
28
+ r: number | string;
29
+ /** True if this bone is a background container */
30
+ c?: boolean;
31
+ }
32
+ /** Compact bone format */
33
+ export type CompactBone = [number, number, number, number, number | string] | [number, number, number, number, number | string, boolean];
34
+ export type AnyBone = Bone | CompactBone;
35
+ export declare function normalizeBone(b: AnyBone): Bone;
36
+ export interface SkeletonResult {
37
+ name: string;
38
+ viewportWidth: number;
39
+ width: number;
40
+ height: number;
41
+ bones: Bone[];
42
+ }
43
+ export interface ResponsiveBones {
44
+ breakpoints: Record<number, SkeletonResult>;
45
+ }
46
+ export type AnimationStyle = 'pulse' | 'shimmer' | 'solid' | boolean;
47
+ export interface SkeletonProps {
48
+ loading: boolean;
49
+ name?: string;
50
+ initialBones?: SkeletonResult | ResponsiveBones;
51
+ auto?: boolean;
52
+ color?: string;
53
+ darkColor?: string;
54
+ animate?: AnimationStyle;
55
+ stagger?: number | boolean;
56
+ transition?: number | boolean;
57
+ class?: string;
58
+ snapshotConfig?: SnapshotConfig;
59
+ }
@@ -0,0 +1,6 @@
1
+ function n(r) {
2
+ return Array.isArray(r) ? { x: r[0], y: r[1], w: r[2], h: r[3], r: r[4], c: r[5] || void 0 } : r;
3
+ }
4
+ export {
5
+ n as normalizeBone
6
+ };
package/index.d.ts CHANGED
@@ -51,6 +51,7 @@ export * from './components/CategoryManager';
51
51
  export * from './components/ThumbnailSelector';
52
52
  export * from './components/TagInput';
53
53
  export * from './components/Calendar';
54
+ export * from './components/Skeleton';
54
55
  export { default as Icon } from './components/Icon.vue';
55
56
  export { default as Logo } from './components/Logo.vue';
56
57
  export { default as Alert } from './components/Alert.vue';