@alikhalilll/a-smart-skeleton 0.0.0-stage → 2.0.0

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 (74) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +356 -2
  3. package/dist/_chunks/core.js +2314 -0
  4. package/dist/_chunks/core.js.map +1 -0
  5. package/dist/_chunks/index.d.ts +431 -0
  6. package/dist/core/index.cjs +67 -0
  7. package/dist/core/index.d.cts +2 -0
  8. package/dist/core/index.d.ts +2 -0
  9. package/dist/core/index.js +2 -0
  10. package/dist/element/index.cjs +47 -0
  11. package/dist/element/index.cjs.map +1 -0
  12. package/dist/element/index.d.cts +24 -0
  13. package/dist/element/index.d.ts +24 -0
  14. package/dist/element/index.js +46 -0
  15. package/dist/element/index.js.map +1 -0
  16. package/dist/index.cjs +512 -0
  17. package/dist/index.cjs.map +1 -0
  18. package/dist/index.d.cts +204 -0
  19. package/dist/index.d.ts +204 -0
  20. package/dist/index.js +441 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/nuxt/index.cjs +36 -0
  23. package/dist/nuxt/index.cjs.map +1 -0
  24. package/dist/nuxt/index.d.cts +30 -0
  25. package/dist/nuxt/index.d.ts +30 -0
  26. package/dist/nuxt/index.js +36 -0
  27. package/dist/nuxt/index.js.map +1 -0
  28. package/dist/resolver/index.cjs +26 -0
  29. package/dist/resolver/index.cjs.map +1 -0
  30. package/dist/resolver/index.d.cts +19 -0
  31. package/dist/resolver/index.d.ts +19 -0
  32. package/dist/resolver/index.js +26 -0
  33. package/dist/resolver/index.js.map +1 -0
  34. package/dist/styles.css +136 -0
  35. package/package.json +144 -3
  36. package/src/components/ASmartSkeleton.vue +228 -0
  37. package/src/components/ASmartSkeletonBox.vue +23 -0
  38. package/src/components/ASmartSkeletonProvider.vue +34 -0
  39. package/src/components/ASmartSkeletonSuspense.vue +142 -0
  40. package/src/composables/useSmartSkeleton.ts +20 -0
  41. package/src/composables/useStyles.ts +8 -0
  42. package/src/core/boot.ts +63 -0
  43. package/src/core/canvas.ts +7 -0
  44. package/src/core/constants.ts +76 -0
  45. package/src/core/debug.ts +154 -0
  46. package/src/core/dev.ts +53 -0
  47. package/src/core/fade.ts +490 -0
  48. package/src/core/ghost.ts +236 -0
  49. package/src/core/images.ts +28 -0
  50. package/src/core/index.ts +71 -0
  51. package/src/core/inline.generated.ts +9 -0
  52. package/src/core/measure.ts +571 -0
  53. package/src/core/memory.ts +146 -0
  54. package/src/core/motion.ts +12 -0
  55. package/src/core/plan.ts +368 -0
  56. package/src/core/reveal.ts +89 -0
  57. package/src/core/reveals.ts +39 -0
  58. package/src/core/shapes.ts +84 -0
  59. package/src/core/shimmer.ts +229 -0
  60. package/src/core/skeleton.ts +43 -0
  61. package/src/core/snapshot.ts +159 -0
  62. package/src/core/styles.ts +187 -0
  63. package/src/core/sweep.ts +203 -0
  64. package/src/core/theme.ts +162 -0
  65. package/src/element/index.ts +59 -0
  66. package/src/index.ts +27 -0
  67. package/src/nuxt/index.ts +59 -0
  68. package/src/resolver/index.ts +35 -0
  69. package/src/types.ts +100 -0
  70. package/src/vue/Skeleton.ts +275 -0
  71. package/src/vue/Suspense.ts +157 -0
  72. package/src/vue/config.ts +78 -0
  73. package/src/vue/index.ts +7 -0
  74. package/web-types.json +256 -0
@@ -0,0 +1,204 @@
1
+ import { $ as skeletonCSS, A as createSkeletonBox, At as FADE_DURATION, B as shimmer, C as quickly, Ct as ATTR_RECT, D as prefersReducedMotion, Dt as ATTR_XRAY, E as together, Et as ATTR_STATUS, F as Ghost, G as DEFAULT_THEME, H as debugging, I as GhostOptions, J as SkeletonMode, K as SkeletonAnimation, L as drawSkeleton, M as forgetShapes, Mt as RESIZE_DURATION, N as Memory, O as DEFAULT_SKELETON_BOX_OPTIONS, Ot as CASCADE_SPREAD, P as MemoryOptions, Q as applyTheme, R as motionOf, S as planReveal, St as ATTR_PANE, T as smart, Tt as ATTR_SNAPSHOT, U as setDebug, V as checkNonce, W as DEFAULT_COLORS, X as SkeletonText, Y as SkeletonSpeed, Z as SkeletonTheme, _ as WipePane, _t as ATTR_GHOST, a as exitDuration, at as TextBottom, b as byRow, bt as ATTR_LOADING, c as boxOf, ct as INLINE_SCRIPT, d as Piece, dt as SMART_SKELETON_CSS, et as themeStyleTag, f as RevealContext, ft as addStyles, g as Wipe, gt as ATTR_DEBUG, h as SKELETON_DELAY, ht as ATTR_BLOCK, i as pendingImages, it as SkeletonRect, j as skeletonBoxStyle, jt as IMAGE_TIMEOUT, k as SkeletonBoxOptions, kt as DURATIONS, l as fadeIn, lt as INLINE_STUB, m as RevealSpec, mt as ATTR_BAR, n as RevealOptions, nt as DEFAULT_TEXT, o as sweep, ot as TextTop, p as RevealMode, pt as removeStyles, q as SkeletonColors, r as imageReady, rt as SkeletonChrome, s as PaneBox, st as measureSkeleton, t as Reveal, tt as themeVariables, u as fadeOut, ut as inlineScriptTag, v as byContent, vt as ATTR_IGNORE, w as sequence, wt as ATTR_REVEAL, x as instant, xt as ATTR_OWN, y as byPosition, yt as ATTR_LAYER, z as rectsOf } from "./_chunks/index.js";
2
+ import { PropType, VNodeChild } from "vue";
3
+
4
+ //#region src/components/ASmartSkeleton.vue.d.ts
5
+ /**
6
+ * Shows a skeleton measured from the content it wraps, then reveals the content.
7
+ *
8
+ * ```vue
9
+ * <ASmartSkeleton :data="user" :sample="SAMPLE_USER">
10
+ * <template #default="{ data }">
11
+ * <UserCard :user="data" />
12
+ * </template>
13
+ * </ASmartSkeleton>
14
+ * ```
15
+ */
16
+ declare const _default: typeof __VLS_export$3;
17
+ declare const __VLS_export$3: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
18
+ /** Shows the skeleton, even over `data`. With `data`, it also shows while there is none. */loading: {
19
+ type: BooleanConstructor;
20
+ default: undefined;
21
+ }; /** Loading while `null` or `undefined`; handed to the default slot as `{ data }`. */
22
+ data: {
23
+ type: PropType<unknown>;
24
+ required: false;
25
+ }; /** Stands in for `data` to draw the skeleton before any has loaded. */
26
+ sample: {
27
+ type: PropType<unknown>;
28
+ required: false;
29
+ }; /** Remembers the shape under this key across visits. */
30
+ id: StringConstructor; /** Read to screen readers while loading, in place of the skeleton — "Loading profile". */
31
+ label: StringConstructor;
32
+ empty: BooleanConstructor;
33
+ error: {
34
+ type: PropType<unknown>;
35
+ required: false;
36
+ }; /** Overrides the provider's reveal for this skeleton alone. */
37
+ reveal: PropType<RevealMode>;
38
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
39
+ [key: string]: any;
40
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "reveal"[], "reveal", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
41
+ /** Shows the skeleton, even over `data`. With `data`, it also shows while there is none. */loading: {
42
+ type: BooleanConstructor;
43
+ default: undefined;
44
+ }; /** Loading while `null` or `undefined`; handed to the default slot as `{ data }`. */
45
+ data: {
46
+ type: PropType<unknown>;
47
+ required: false;
48
+ }; /** Stands in for `data` to draw the skeleton before any has loaded. */
49
+ sample: {
50
+ type: PropType<unknown>;
51
+ required: false;
52
+ }; /** Remembers the shape under this key across visits. */
53
+ id: StringConstructor; /** Read to screen readers while loading, in place of the skeleton — "Loading profile". */
54
+ label: StringConstructor;
55
+ empty: BooleanConstructor;
56
+ error: {
57
+ type: PropType<unknown>;
58
+ required: false;
59
+ }; /** Overrides the provider's reveal for this skeleton alone. */
60
+ reveal: PropType<RevealMode>;
61
+ }>> & Readonly<{
62
+ onReveal?: ((...args: any[]) => any) | undefined;
63
+ }>, {
64
+ empty: boolean;
65
+ loading: boolean;
66
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
67
+ //#endregion
68
+ //#region src/types.d.ts
69
+ interface ASmartSkeletonBoxProps extends SkeletonBoxOptions {
70
+ class?: string;
71
+ style?: Record<string, string | number>;
72
+ }
73
+ /**
74
+ * Slots: `default` (with `{ data }` when `data` is bound), `skeleton`, `empty`,
75
+ * `error` (with `{ error }`).
76
+ */
77
+ interface ASmartSkeletonProps<T = unknown> {
78
+ /** Shows the skeleton, even over `data`. With `data`, it also shows while there is none. */
79
+ loading?: boolean;
80
+ /** Loading while `null` or `undefined`; handed to the default slot as `{ data }`. */
81
+ data?: T | null;
82
+ /** Stands in for `data` to draw the skeleton before any has loaded. */
83
+ sample?: T;
84
+ /** Remembers the shape under this key across visits. */
85
+ id?: string;
86
+ /** Read to screen readers while loading, in place of the skeleton — "Loading profile". */
87
+ label?: string;
88
+ /** Renders the `empty` slot instead of the content. */
89
+ empty?: boolean;
90
+ /** When set, renders the `error` slot with `{ error }` instead of the content. */
91
+ error?: unknown;
92
+ /** Overrides the provider's reveal for this skeleton alone. */
93
+ reveal?: RevealMode;
94
+ /** Called once content has come in over a skeleton; `@reveal` in a template. */
95
+ onReveal?: () => void;
96
+ class?: string;
97
+ style?: Record<string, string | number>;
98
+ }
99
+ interface ASmartSkeletonSlots<T = unknown> {
100
+ /** The content. Receives `{ data }` when `data` is bound. */
101
+ default?: (props: {
102
+ data: T;
103
+ }) => VNodeChild;
104
+ /** Shown while loading instead of the measured skeleton. */
105
+ skeleton?: () => VNodeChild;
106
+ /** Shown when `empty` is set. Falls back to the content. */
107
+ empty?: () => VNodeChild;
108
+ /** Shown when `error` is set. Receives `{ error }`. */
109
+ error?: (props: {
110
+ error: unknown;
111
+ }) => VNodeChild;
112
+ }
113
+ interface ASmartSkeletonEmits {
114
+ /** Content has come in over a skeleton. */
115
+ reveal: () => void;
116
+ }
117
+ /** Slots: `default`, the content that suspends; `skeleton`, the content rendered from sample data. */
118
+ interface ASmartSkeletonSuspenseProps {
119
+ /** Remembers the shape under this key across visits. */
120
+ id?: string;
121
+ /** Read to screen readers while suspended, in place of the skeleton. */
122
+ label?: string;
123
+ /** Overrides the provider's reveal for this boundary alone. */
124
+ reveal?: RevealMode;
125
+ /** Called once content has come in over the skeleton; `@reveal` in a template. */
126
+ onReveal?: () => void;
127
+ }
128
+ interface ASmartSkeletonSuspenseSlots {
129
+ default?: () => VNodeChild;
130
+ skeleton?: () => VNodeChild;
131
+ }
132
+ interface ASmartSkeletonSuspenseEmits {
133
+ /** Content has come in over the skeleton. */
134
+ reveal: () => void;
135
+ }
136
+ /** Settings for every skeleton inside. Per request on the server, as a nonce must be. */
137
+ interface ASmartSkeletonProviderProps {
138
+ /** Set on the inline script and stylesheets rendered, for a Content Security Policy. */
139
+ nonce?: string;
140
+ /** Colours for light and dark; `mode` picks between them. */
141
+ theme?: SkeletonTheme;
142
+ /** `system` follows `prefers-color-scheme`; the others pin one set of colours. */
143
+ mode?: SkeletonMode;
144
+ /** Where text bars run: from `top` (ascender, cap-height, x-height) down to `bottom` (baseline, descender). */
145
+ text?: SkeletonText;
146
+ /** How content replaces its skeleton: `smart` (the default), `together`, `sequence`, `sweep`, or a `RevealSpec` of your own. */
147
+ reveal?: RevealMode;
148
+ /** Outlines every reveal with where its skeleton came from and whether anything moved. */
149
+ debug?: boolean;
150
+ }
151
+ interface ASmartSkeletonProviderSlots {
152
+ default?: () => VNodeChild;
153
+ }
154
+ type SmartSkeletonConfig = ASmartSkeletonProviderProps;
155
+ //#endregion
156
+ //#region src/components/ASmartSkeletonBox.vue.d.ts
157
+ declare const __VLS_export$2: import("vue").DefineComponent<ASmartSkeletonBoxProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ASmartSkeletonBoxProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
158
+ declare const _default$1: typeof __VLS_export$2;
159
+ //#endregion
160
+ //#region src/components/ASmartSkeletonSuspense.vue.d.ts
161
+ /**
162
+ * A Suspense boundary whose fallback is a measured skeleton, crossfading into the content.
163
+ *
164
+ * ```vue
165
+ * <ASmartSkeletonSuspense>
166
+ * <LoadedQuote />
167
+ * <template #skeleton><Quote :quote="SAMPLE_QUOTE" /></template>
168
+ * </ASmartSkeletonSuspense>
169
+ * ```
170
+ */
171
+ declare const _default$3: typeof __VLS_export$1;
172
+ declare const __VLS_export$1: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
173
+ /** Remembers the shape under this key across visits. */id: StringConstructor; /** Read to screen readers while suspended, in place of the skeleton. */
174
+ label: StringConstructor; /** Overrides the provider's reveal for this boundary alone. */
175
+ reveal: PropType<RevealMode>;
176
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
177
+ [key: string]: any;
178
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "reveal"[], "reveal", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
179
+ /** Remembers the shape under this key across visits. */id: StringConstructor; /** Read to screen readers while suspended, in place of the skeleton. */
180
+ label: StringConstructor; /** Overrides the provider's reveal for this boundary alone. */
181
+ reveal: PropType<RevealMode>;
182
+ }>> & Readonly<{
183
+ onReveal?: ((...args: any[]) => any) | undefined;
184
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
185
+ //#endregion
186
+ //#region src/components/ASmartSkeletonProvider.vue.d.ts
187
+ declare var __VLS_6: {};
188
+ type __VLS_Slots = {} & {
189
+ default?: (props: typeof __VLS_6) => any;
190
+ };
191
+ declare const __VLS_base: import("vue").DefineComponent<ASmartSkeletonProviderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ASmartSkeletonProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
192
+ declare const __VLS_export: typeof __VLS_base;
193
+ declare const _default$2: typeof __VLS_export;
194
+ //#endregion
195
+ //#region src/composables/useSmartSkeleton.d.ts
196
+ /** The provider settings in scope for this component. Empty outside a provider. */
197
+ declare const useSmartSkeleton: () => SmartSkeletonConfig;
198
+ //#endregion
199
+ //#region src/composables/useStyles.d.ts
200
+ /** Adds the stylesheet on mount and removes it on unmount — reference counted, so siblings share one copy. */
201
+ declare function useStyles(): void;
202
+ //#endregion
203
+ export { _default as ASmartSkeleton, _default$1 as ASmartSkeletonBox, type ASmartSkeletonBoxProps, type ASmartSkeletonEmits, type ASmartSkeletonProps, _default$2 as ASmartSkeletonProvider, type ASmartSkeletonProviderProps, type ASmartSkeletonProviderSlots, type ASmartSkeletonSlots, _default$3 as ASmartSkeletonSuspense, type ASmartSkeletonSuspenseEmits, type ASmartSkeletonSuspenseProps, type ASmartSkeletonSuspenseSlots, ATTR_BAR, ATTR_BLOCK, ATTR_DEBUG, ATTR_GHOST, ATTR_IGNORE, ATTR_LAYER, ATTR_LOADING, ATTR_OWN, ATTR_PANE, ATTR_RECT, ATTR_REVEAL, ATTR_SNAPSHOT, ATTR_STATUS, ATTR_XRAY, CASCADE_SPREAD, DEFAULT_COLORS, DEFAULT_SKELETON_BOX_OPTIONS, DEFAULT_TEXT, DEFAULT_THEME, DURATIONS, FADE_DURATION, Ghost, type GhostOptions, IMAGE_TIMEOUT, INLINE_SCRIPT, INLINE_STUB, Memory, type MemoryOptions, type PaneBox, type Piece, RESIZE_DURATION, Reveal, type RevealContext, type RevealMode, type RevealOptions, type RevealSpec, SKELETON_DELAY, SMART_SKELETON_CSS, type SkeletonAnimation, type SkeletonBoxOptions, type SkeletonChrome, type SkeletonColors, type SkeletonMode, type SkeletonRect, type SkeletonSpeed, type SkeletonText, type SkeletonTheme, type SmartSkeletonConfig, type TextBottom, type TextTop, type Wipe, type WipePane, addStyles, applyTheme, boxOf, byContent, byPosition, byRow, checkNonce, createSkeletonBox, debugging, drawSkeleton, exitDuration, fadeIn, fadeOut, forgetShapes, imageReady, inlineScriptTag, instant, measureSkeleton, motionOf, pendingImages, planReveal, prefersReducedMotion, quickly, rectsOf, removeStyles, sequence, setDebug, shimmer, skeletonBoxStyle, skeletonCSS, smart, sweep, themeStyleTag, themeVariables, together, useSmartSkeleton, useStyles };
204
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1,204 @@
1
+ import { $ as skeletonCSS, A as createSkeletonBox, At as FADE_DURATION, B as shimmer, C as quickly, Ct as ATTR_RECT, D as prefersReducedMotion, Dt as ATTR_XRAY, E as together, Et as ATTR_STATUS, F as Ghost, G as DEFAULT_THEME, H as debugging, I as GhostOptions, J as SkeletonMode, K as SkeletonAnimation, L as drawSkeleton, M as forgetShapes, Mt as RESIZE_DURATION, N as Memory, O as DEFAULT_SKELETON_BOX_OPTIONS, Ot as CASCADE_SPREAD, P as MemoryOptions, Q as applyTheme, R as motionOf, S as planReveal, St as ATTR_PANE, T as smart, Tt as ATTR_SNAPSHOT, U as setDebug, V as checkNonce, W as DEFAULT_COLORS, X as SkeletonText, Y as SkeletonSpeed, Z as SkeletonTheme, _ as WipePane, _t as ATTR_GHOST, a as exitDuration, at as TextBottom, b as byRow, bt as ATTR_LOADING, c as boxOf, ct as INLINE_SCRIPT, d as Piece, dt as SMART_SKELETON_CSS, et as themeStyleTag, f as RevealContext, ft as addStyles, g as Wipe, gt as ATTR_DEBUG, h as SKELETON_DELAY, ht as ATTR_BLOCK, i as pendingImages, it as SkeletonRect, j as skeletonBoxStyle, jt as IMAGE_TIMEOUT, k as SkeletonBoxOptions, kt as DURATIONS, l as fadeIn, lt as INLINE_STUB, m as RevealSpec, mt as ATTR_BAR, n as RevealOptions, nt as DEFAULT_TEXT, o as sweep, ot as TextTop, p as RevealMode, pt as removeStyles, q as SkeletonColors, r as imageReady, rt as SkeletonChrome, s as PaneBox, st as measureSkeleton, t as Reveal, tt as themeVariables, u as fadeOut, ut as inlineScriptTag, v as byContent, vt as ATTR_IGNORE, w as sequence, wt as ATTR_REVEAL, x as instant, xt as ATTR_OWN, y as byPosition, yt as ATTR_LAYER, z as rectsOf } from "./_chunks/index.js";
2
+ import { PropType, VNodeChild } from "vue";
3
+
4
+ //#region src/components/ASmartSkeleton.vue.d.ts
5
+ /**
6
+ * Shows a skeleton measured from the content it wraps, then reveals the content.
7
+ *
8
+ * ```vue
9
+ * <ASmartSkeleton :data="user" :sample="SAMPLE_USER">
10
+ * <template #default="{ data }">
11
+ * <UserCard :user="data" />
12
+ * </template>
13
+ * </ASmartSkeleton>
14
+ * ```
15
+ */
16
+ declare const _default: typeof __VLS_export$3;
17
+ declare const __VLS_export$3: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
18
+ /** Shows the skeleton, even over `data`. With `data`, it also shows while there is none. */loading: {
19
+ type: BooleanConstructor;
20
+ default: undefined;
21
+ }; /** Loading while `null` or `undefined`; handed to the default slot as `{ data }`. */
22
+ data: {
23
+ type: PropType<unknown>;
24
+ required: false;
25
+ }; /** Stands in for `data` to draw the skeleton before any has loaded. */
26
+ sample: {
27
+ type: PropType<unknown>;
28
+ required: false;
29
+ }; /** Remembers the shape under this key across visits. */
30
+ id: StringConstructor; /** Read to screen readers while loading, in place of the skeleton — "Loading profile". */
31
+ label: StringConstructor;
32
+ empty: BooleanConstructor;
33
+ error: {
34
+ type: PropType<unknown>;
35
+ required: false;
36
+ }; /** Overrides the provider's reveal for this skeleton alone. */
37
+ reveal: PropType<RevealMode>;
38
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
39
+ [key: string]: any;
40
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "reveal"[], "reveal", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
41
+ /** Shows the skeleton, even over `data`. With `data`, it also shows while there is none. */loading: {
42
+ type: BooleanConstructor;
43
+ default: undefined;
44
+ }; /** Loading while `null` or `undefined`; handed to the default slot as `{ data }`. */
45
+ data: {
46
+ type: PropType<unknown>;
47
+ required: false;
48
+ }; /** Stands in for `data` to draw the skeleton before any has loaded. */
49
+ sample: {
50
+ type: PropType<unknown>;
51
+ required: false;
52
+ }; /** Remembers the shape under this key across visits. */
53
+ id: StringConstructor; /** Read to screen readers while loading, in place of the skeleton — "Loading profile". */
54
+ label: StringConstructor;
55
+ empty: BooleanConstructor;
56
+ error: {
57
+ type: PropType<unknown>;
58
+ required: false;
59
+ }; /** Overrides the provider's reveal for this skeleton alone. */
60
+ reveal: PropType<RevealMode>;
61
+ }>> & Readonly<{
62
+ onReveal?: ((...args: any[]) => any) | undefined;
63
+ }>, {
64
+ empty: boolean;
65
+ loading: boolean;
66
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
67
+ //#endregion
68
+ //#region src/types.d.ts
69
+ interface ASmartSkeletonBoxProps extends SkeletonBoxOptions {
70
+ class?: string;
71
+ style?: Record<string, string | number>;
72
+ }
73
+ /**
74
+ * Slots: `default` (with `{ data }` when `data` is bound), `skeleton`, `empty`,
75
+ * `error` (with `{ error }`).
76
+ */
77
+ interface ASmartSkeletonProps<T = unknown> {
78
+ /** Shows the skeleton, even over `data`. With `data`, it also shows while there is none. */
79
+ loading?: boolean;
80
+ /** Loading while `null` or `undefined`; handed to the default slot as `{ data }`. */
81
+ data?: T | null;
82
+ /** Stands in for `data` to draw the skeleton before any has loaded. */
83
+ sample?: T;
84
+ /** Remembers the shape under this key across visits. */
85
+ id?: string;
86
+ /** Read to screen readers while loading, in place of the skeleton — "Loading profile". */
87
+ label?: string;
88
+ /** Renders the `empty` slot instead of the content. */
89
+ empty?: boolean;
90
+ /** When set, renders the `error` slot with `{ error }` instead of the content. */
91
+ error?: unknown;
92
+ /** Overrides the provider's reveal for this skeleton alone. */
93
+ reveal?: RevealMode;
94
+ /** Called once content has come in over a skeleton; `@reveal` in a template. */
95
+ onReveal?: () => void;
96
+ class?: string;
97
+ style?: Record<string, string | number>;
98
+ }
99
+ interface ASmartSkeletonSlots<T = unknown> {
100
+ /** The content. Receives `{ data }` when `data` is bound. */
101
+ default?: (props: {
102
+ data: T;
103
+ }) => VNodeChild;
104
+ /** Shown while loading instead of the measured skeleton. */
105
+ skeleton?: () => VNodeChild;
106
+ /** Shown when `empty` is set. Falls back to the content. */
107
+ empty?: () => VNodeChild;
108
+ /** Shown when `error` is set. Receives `{ error }`. */
109
+ error?: (props: {
110
+ error: unknown;
111
+ }) => VNodeChild;
112
+ }
113
+ interface ASmartSkeletonEmits {
114
+ /** Content has come in over a skeleton. */
115
+ reveal: () => void;
116
+ }
117
+ /** Slots: `default`, the content that suspends; `skeleton`, the content rendered from sample data. */
118
+ interface ASmartSkeletonSuspenseProps {
119
+ /** Remembers the shape under this key across visits. */
120
+ id?: string;
121
+ /** Read to screen readers while suspended, in place of the skeleton. */
122
+ label?: string;
123
+ /** Overrides the provider's reveal for this boundary alone. */
124
+ reveal?: RevealMode;
125
+ /** Called once content has come in over the skeleton; `@reveal` in a template. */
126
+ onReveal?: () => void;
127
+ }
128
+ interface ASmartSkeletonSuspenseSlots {
129
+ default?: () => VNodeChild;
130
+ skeleton?: () => VNodeChild;
131
+ }
132
+ interface ASmartSkeletonSuspenseEmits {
133
+ /** Content has come in over the skeleton. */
134
+ reveal: () => void;
135
+ }
136
+ /** Settings for every skeleton inside. Per request on the server, as a nonce must be. */
137
+ interface ASmartSkeletonProviderProps {
138
+ /** Set on the inline script and stylesheets rendered, for a Content Security Policy. */
139
+ nonce?: string;
140
+ /** Colours for light and dark; `mode` picks between them. */
141
+ theme?: SkeletonTheme;
142
+ /** `system` follows `prefers-color-scheme`; the others pin one set of colours. */
143
+ mode?: SkeletonMode;
144
+ /** Where text bars run: from `top` (ascender, cap-height, x-height) down to `bottom` (baseline, descender). */
145
+ text?: SkeletonText;
146
+ /** How content replaces its skeleton: `smart` (the default), `together`, `sequence`, `sweep`, or a `RevealSpec` of your own. */
147
+ reveal?: RevealMode;
148
+ /** Outlines every reveal with where its skeleton came from and whether anything moved. */
149
+ debug?: boolean;
150
+ }
151
+ interface ASmartSkeletonProviderSlots {
152
+ default?: () => VNodeChild;
153
+ }
154
+ type SmartSkeletonConfig = ASmartSkeletonProviderProps;
155
+ //#endregion
156
+ //#region src/components/ASmartSkeletonBox.vue.d.ts
157
+ declare const __VLS_export$2: import("vue").DefineComponent<ASmartSkeletonBoxProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ASmartSkeletonBoxProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
158
+ declare const _default$1: typeof __VLS_export$2;
159
+ //#endregion
160
+ //#region src/components/ASmartSkeletonSuspense.vue.d.ts
161
+ /**
162
+ * A Suspense boundary whose fallback is a measured skeleton, crossfading into the content.
163
+ *
164
+ * ```vue
165
+ * <ASmartSkeletonSuspense>
166
+ * <LoadedQuote />
167
+ * <template #skeleton><Quote :quote="SAMPLE_QUOTE" /></template>
168
+ * </ASmartSkeletonSuspense>
169
+ * ```
170
+ */
171
+ declare const _default$3: typeof __VLS_export$1;
172
+ declare const __VLS_export$1: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
173
+ /** Remembers the shape under this key across visits. */id: StringConstructor; /** Read to screen readers while suspended, in place of the skeleton. */
174
+ label: StringConstructor; /** Overrides the provider's reveal for this boundary alone. */
175
+ reveal: PropType<RevealMode>;
176
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
177
+ [key: string]: any;
178
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "reveal"[], "reveal", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
179
+ /** Remembers the shape under this key across visits. */id: StringConstructor; /** Read to screen readers while suspended, in place of the skeleton. */
180
+ label: StringConstructor; /** Overrides the provider's reveal for this boundary alone. */
181
+ reveal: PropType<RevealMode>;
182
+ }>> & Readonly<{
183
+ onReveal?: ((...args: any[]) => any) | undefined;
184
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
185
+ //#endregion
186
+ //#region src/components/ASmartSkeletonProvider.vue.d.ts
187
+ declare var __VLS_6: {};
188
+ type __VLS_Slots = {} & {
189
+ default?: (props: typeof __VLS_6) => any;
190
+ };
191
+ declare const __VLS_base: import("vue").DefineComponent<ASmartSkeletonProviderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ASmartSkeletonProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
192
+ declare const __VLS_export: typeof __VLS_base;
193
+ declare const _default$2: typeof __VLS_export;
194
+ //#endregion
195
+ //#region src/composables/useSmartSkeleton.d.ts
196
+ /** The provider settings in scope for this component. Empty outside a provider. */
197
+ declare const useSmartSkeleton: () => SmartSkeletonConfig;
198
+ //#endregion
199
+ //#region src/composables/useStyles.d.ts
200
+ /** Adds the stylesheet on mount and removes it on unmount — reference counted, so siblings share one copy. */
201
+ declare function useStyles(): void;
202
+ //#endregion
203
+ export { _default as ASmartSkeleton, _default$1 as ASmartSkeletonBox, type ASmartSkeletonBoxProps, type ASmartSkeletonEmits, type ASmartSkeletonProps, _default$2 as ASmartSkeletonProvider, type ASmartSkeletonProviderProps, type ASmartSkeletonProviderSlots, type ASmartSkeletonSlots, _default$3 as ASmartSkeletonSuspense, type ASmartSkeletonSuspenseEmits, type ASmartSkeletonSuspenseProps, type ASmartSkeletonSuspenseSlots, ATTR_BAR, ATTR_BLOCK, ATTR_DEBUG, ATTR_GHOST, ATTR_IGNORE, ATTR_LAYER, ATTR_LOADING, ATTR_OWN, ATTR_PANE, ATTR_RECT, ATTR_REVEAL, ATTR_SNAPSHOT, ATTR_STATUS, ATTR_XRAY, CASCADE_SPREAD, DEFAULT_COLORS, DEFAULT_SKELETON_BOX_OPTIONS, DEFAULT_TEXT, DEFAULT_THEME, DURATIONS, FADE_DURATION, Ghost, type GhostOptions, IMAGE_TIMEOUT, INLINE_SCRIPT, INLINE_STUB, Memory, type MemoryOptions, type PaneBox, type Piece, RESIZE_DURATION, Reveal, type RevealContext, type RevealMode, type RevealOptions, type RevealSpec, SKELETON_DELAY, SMART_SKELETON_CSS, type SkeletonAnimation, type SkeletonBoxOptions, type SkeletonChrome, type SkeletonColors, type SkeletonMode, type SkeletonRect, type SkeletonSpeed, type SkeletonText, type SkeletonTheme, type SmartSkeletonConfig, type TextBottom, type TextTop, type Wipe, type WipePane, addStyles, applyTheme, boxOf, byContent, byPosition, byRow, checkNonce, createSkeletonBox, debugging, drawSkeleton, exitDuration, fadeIn, fadeOut, forgetShapes, imageReady, inlineScriptTag, instant, measureSkeleton, motionOf, pendingImages, planReveal, prefersReducedMotion, quickly, rectsOf, removeStyles, sequence, setDebug, shimmer, skeletonBoxStyle, skeletonCSS, smart, sweep, themeStyleTag, themeVariables, together, useSmartSkeleton, useStyles };
204
+ //# sourceMappingURL=index.d.ts.map