skeleton-load 0.0.0-stage → 0.1.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.
- package/LICENSE +21 -0
- package/README.md +455 -2
- package/dist/cli.js +255 -0
- package/dist/index.cjs +1347 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +1338 -0
- package/dist/index.js.map +1 -0
- package/dist/next/index.cjs +425 -0
- package/dist/next/index.cjs.map +1 -0
- package/dist/next/index.d.cts +19 -0
- package/dist/next/index.d.ts +19 -0
- package/dist/next/index.js +420 -0
- package/dist/next/index.js.map +1 -0
- package/dist/plugins/vite.cjs +413 -0
- package/dist/plugins/vite.cjs.map +1 -0
- package/dist/plugins/vite.d.cts +40 -0
- package/dist/plugins/vite.d.ts +40 -0
- package/dist/plugins/vite.js +408 -0
- package/dist/plugins/vite.js.map +1 -0
- package/dist/plugins/webpack.cjs +411 -0
- package/dist/plugins/webpack.cjs.map +1 -0
- package/dist/plugins/webpack.d.cts +43 -0
- package/dist/plugins/webpack.d.ts +43 -0
- package/dist/plugins/webpack.js +406 -0
- package/dist/plugins/webpack.js.map +1 -0
- package/dist/react/index.cjs +1387 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.cts +48 -0
- package/dist/react/index.d.ts +48 -0
- package/dist/react/index.js +1382 -0
- package/dist/react/index.js.map +1 -0
- package/dist/singleton-D0608W4u.d.cts +74 -0
- package/dist/singleton-D4bvf9fp.d.ts +74 -0
- package/dist/skeleton-load.auto.js +328 -0
- package/dist/skeleton-load.css +326 -0
- package/dist/skeleton-load.record.js +21 -0
- package/dist/types-DNYMIyOJ.d.cts +73 -0
- package/dist/types-DNYMIyOJ.d.ts +73 -0
- package/dist/vanilla.cjs +1356 -0
- package/dist/vanilla.cjs.map +1 -0
- package/dist/vanilla.d.cts +23 -0
- package/dist/vanilla.d.ts +23 -0
- package/dist/vanilla.js +1353 -0
- package/dist/vanilla.js.map +1 -0
- package/dist/vue/index.cjs +1379 -0
- package/dist/vue/index.cjs.map +1 -0
- package/dist/vue/index.d.cts +145 -0
- package/dist/vue/index.d.ts +145 -0
- package/dist/vue/index.js +1373 -0
- package/dist/vue/index.js.map +1 -0
- package/package.json +104 -4
package/dist/index.js
ADDED
|
@@ -0,0 +1,1338 @@
|
|
|
1
|
+
// src/core/config.ts
|
|
2
|
+
var PRESETS = ["shimmer", "pulse", "static"];
|
|
3
|
+
var SHAPES = [
|
|
4
|
+
"auto",
|
|
5
|
+
"card",
|
|
6
|
+
"grid",
|
|
7
|
+
"list",
|
|
8
|
+
"text",
|
|
9
|
+
"table",
|
|
10
|
+
"media",
|
|
11
|
+
"avatar",
|
|
12
|
+
"chart",
|
|
13
|
+
"profile",
|
|
14
|
+
"off"
|
|
15
|
+
];
|
|
16
|
+
var DEFAULTS = {
|
|
17
|
+
preset: "shimmer",
|
|
18
|
+
theme: "auto",
|
|
19
|
+
delay: 120,
|
|
20
|
+
minVisible: 300,
|
|
21
|
+
maxWait: 5e3,
|
|
22
|
+
autoMedia: true,
|
|
23
|
+
observe: true,
|
|
24
|
+
css: true,
|
|
25
|
+
nonce: "",
|
|
26
|
+
root: null,
|
|
27
|
+
debug: false,
|
|
28
|
+
respectReducedMotion: true
|
|
29
|
+
};
|
|
30
|
+
function toNumber(value, fallback) {
|
|
31
|
+
if (value === null || value === "") return fallback;
|
|
32
|
+
const n = Number(value);
|
|
33
|
+
return Number.isFinite(n) ? n : fallback;
|
|
34
|
+
}
|
|
35
|
+
function resolveOptions(options = {}) {
|
|
36
|
+
const merged = { ...DEFAULTS };
|
|
37
|
+
for (const key of Object.keys(options)) {
|
|
38
|
+
const value = options[key];
|
|
39
|
+
if (value !== void 0) {
|
|
40
|
+
merged[key] = value;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (!PRESETS.includes(merged.preset)) merged.preset = DEFAULTS.preset;
|
|
44
|
+
merged.delay = Math.max(0, merged.delay);
|
|
45
|
+
merged.minVisible = Math.max(0, merged.minVisible);
|
|
46
|
+
merged.maxWait = Math.max(0, merged.maxWait);
|
|
47
|
+
return merged;
|
|
48
|
+
}
|
|
49
|
+
function normalizePreset(value) {
|
|
50
|
+
if (!value) return null;
|
|
51
|
+
return PRESETS.includes(value) ? value : null;
|
|
52
|
+
}
|
|
53
|
+
function normalizeTheme(value) {
|
|
54
|
+
if (value === "light" || value === "dark" || value === "auto") return value;
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
function normalizeShape(value) {
|
|
58
|
+
if (!value) return null;
|
|
59
|
+
const v = value.trim().toLowerCase();
|
|
60
|
+
if (v === "" || v === "true" || v === "1") return "auto";
|
|
61
|
+
return SHAPES.includes(v) ? v : null;
|
|
62
|
+
}
|
|
63
|
+
function readSpec(element) {
|
|
64
|
+
const el = element;
|
|
65
|
+
const ds = el.dataset;
|
|
66
|
+
const rawShape = normalizeShape(el.getAttribute("data-skeleton"));
|
|
67
|
+
return {
|
|
68
|
+
shape: rawShape ?? "auto",
|
|
69
|
+
state: ds.skeletonState === "loading" || ds.skeletonState === "done" ? ds.skeletonState : null,
|
|
70
|
+
preset: normalizePreset(el.getAttribute("data-skeleton-preset")),
|
|
71
|
+
lines: Math.max(1, Math.min(12, toNumber(el.getAttribute("data-skeleton-lines"), 3))),
|
|
72
|
+
ratio: el.getAttribute("data-skeleton-ratio"),
|
|
73
|
+
count: Math.max(1, Math.min(24, toNumber(el.getAttribute("data-skeleton-count"), 4))),
|
|
74
|
+
cols: Math.max(1, Math.min(6, toNumber(el.getAttribute("data-skeleton-cols"), 3))),
|
|
75
|
+
height: el.hasAttribute("data-skeleton-h") ? toNumber(el.getAttribute("data-skeleton-h"), 0) || null : null,
|
|
76
|
+
radius: el.hasAttribute("data-skeleton-radius") ? toNumber(el.getAttribute("data-skeleton-radius"), 0) || null : null
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function inheritedPreset(element) {
|
|
80
|
+
let node = element;
|
|
81
|
+
while (node && node !== document.documentElement) {
|
|
82
|
+
const preset = normalizePreset(node.getAttribute("data-skeleton-preset"));
|
|
83
|
+
if (preset) return preset;
|
|
84
|
+
node = node.parentElement;
|
|
85
|
+
}
|
|
86
|
+
return normalizePreset(document.documentElement.getAttribute("data-skeleton-preset"));
|
|
87
|
+
}
|
|
88
|
+
function inheritedTheme(element) {
|
|
89
|
+
let node = element;
|
|
90
|
+
while (node) {
|
|
91
|
+
const theme = normalizeTheme(node.getAttribute("data-skeleton-theme"));
|
|
92
|
+
if (theme) return theme;
|
|
93
|
+
node = node.parentElement;
|
|
94
|
+
}
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
function isOptedOut(element) {
|
|
98
|
+
let node = element;
|
|
99
|
+
let depth = 0;
|
|
100
|
+
while (node && depth < 64) {
|
|
101
|
+
if (node.hasAttribute("data-skeleton-skip")) return true;
|
|
102
|
+
if (node.getAttribute("data-skeleton") === "off") return true;
|
|
103
|
+
node = node.parentElement;
|
|
104
|
+
depth++;
|
|
105
|
+
}
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
function isMedia(element) {
|
|
109
|
+
const tag = element.tagName;
|
|
110
|
+
return tag === "IMG" || tag === "VIDEO" || tag === "IFRAME";
|
|
111
|
+
}
|
|
112
|
+
function isLoadedMedia(element) {
|
|
113
|
+
const tag = element.tagName;
|
|
114
|
+
if (tag === "IMG") {
|
|
115
|
+
const img = element;
|
|
116
|
+
return img.complete && img.naturalWidth > 0;
|
|
117
|
+
}
|
|
118
|
+
if (tag === "VIDEO") {
|
|
119
|
+
const video = element;
|
|
120
|
+
return video.readyState >= 2;
|
|
121
|
+
}
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
function hasRealContent(element) {
|
|
125
|
+
for (const child of Array.from(element.children)) {
|
|
126
|
+
if (!child.classList.contains("skl-overlay")) return true;
|
|
127
|
+
}
|
|
128
|
+
return (element.textContent ?? "").trim().length > 0;
|
|
129
|
+
}
|
|
130
|
+
function isLazy(element) {
|
|
131
|
+
const loading = element.getAttribute("loading");
|
|
132
|
+
return loading === "lazy" || element.getAttribute("data-skeleton-lazy") === "true";
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// src/core/utils.ts
|
|
136
|
+
var raf = typeof requestAnimationFrame === "function" ? (cb) => requestAnimationFrame(cb) : (cb) => setTimeout(() => cb(Date.now()), 16);
|
|
137
|
+
function now() {
|
|
138
|
+
return typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
139
|
+
}
|
|
140
|
+
function clamp(value, min, max) {
|
|
141
|
+
return Math.min(max, Math.max(min, value));
|
|
142
|
+
}
|
|
143
|
+
function parseRadius(style) {
|
|
144
|
+
const raw = style.borderTopLeftRadius || style.borderRadius;
|
|
145
|
+
if (!raw) return null;
|
|
146
|
+
const first = raw.split(/\s+/)[0] ?? "";
|
|
147
|
+
if (first.endsWith("%")) return null;
|
|
148
|
+
const n = Number.parseFloat(first);
|
|
149
|
+
return Number.isFinite(n) ? n : null;
|
|
150
|
+
}
|
|
151
|
+
function computedPadding(style) {
|
|
152
|
+
return {
|
|
153
|
+
"padding-top": style.paddingTop,
|
|
154
|
+
"padding-right": style.paddingRight,
|
|
155
|
+
"padding-bottom": style.paddingBottom,
|
|
156
|
+
"padding-left": style.paddingLeft
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// src/core/shapes.ts
|
|
161
|
+
function make(tag, className, style = {}) {
|
|
162
|
+
const node = document.createElement(tag);
|
|
163
|
+
if (className) node.className = className;
|
|
164
|
+
for (const key of Object.keys(style)) {
|
|
165
|
+
const value = style[key];
|
|
166
|
+
if (value !== void 0) node.style.setProperty(key, value);
|
|
167
|
+
}
|
|
168
|
+
return node;
|
|
169
|
+
}
|
|
170
|
+
function block(style = {}, extra = "") {
|
|
171
|
+
return make("div", `skl-block ${extra}`.trim(), style);
|
|
172
|
+
}
|
|
173
|
+
function relativeLuminance(color) {
|
|
174
|
+
const match = color.match(/rgba?\(([^)]+)\)/i);
|
|
175
|
+
if (!match || !match[1]) return null;
|
|
176
|
+
const parts = match[1].split(",").map((value) => Number.parseFloat(value.trim()));
|
|
177
|
+
const [r, g, b, a] = parts;
|
|
178
|
+
if (r === void 0 || g === void 0 || b === void 0) return null;
|
|
179
|
+
if (a !== void 0 && a < 0.5) return null;
|
|
180
|
+
const channel = (value) => {
|
|
181
|
+
const v = value / 255;
|
|
182
|
+
return v <= 0.03928 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4;
|
|
183
|
+
};
|
|
184
|
+
return 0.2126 * channel(r) + 0.7152 * channel(g) + 0.0722 * channel(b);
|
|
185
|
+
}
|
|
186
|
+
function surfaceOf(element) {
|
|
187
|
+
let node = element;
|
|
188
|
+
let depth = 0;
|
|
189
|
+
while (node && depth < 24) {
|
|
190
|
+
let background = "";
|
|
191
|
+
try {
|
|
192
|
+
background = getComputedStyle(node).backgroundColor;
|
|
193
|
+
} catch {
|
|
194
|
+
background = "";
|
|
195
|
+
}
|
|
196
|
+
const luminance = relativeLuminance(background);
|
|
197
|
+
if (luminance !== null) {
|
|
198
|
+
return { tone: luminance < 0.42 ? "dark" : "light", color: background };
|
|
199
|
+
}
|
|
200
|
+
node = node.parentElement;
|
|
201
|
+
depth++;
|
|
202
|
+
}
|
|
203
|
+
const dark = typeof matchMedia === "function" && matchMedia("(prefers-color-scheme: dark)").matches;
|
|
204
|
+
return { tone: dark ? "dark" : "light", color: dark ? "#0b0d12" : "#ffffff" };
|
|
205
|
+
}
|
|
206
|
+
function line(width, height) {
|
|
207
|
+
return block({ width, ...height ? { height } : {} }, "skl-line");
|
|
208
|
+
}
|
|
209
|
+
function textLines(count) {
|
|
210
|
+
const wrap = make("div", "skl-lines");
|
|
211
|
+
const widths = ["100%", "92%", "97%", "88%", "94%", "84%"];
|
|
212
|
+
for (let i = 0; i < count; i++) {
|
|
213
|
+
const isLast = i === count - 1 && count > 1;
|
|
214
|
+
wrap.appendChild(line(isLast ? "58%" : widths[i % widths.length] ?? "100%"));
|
|
215
|
+
}
|
|
216
|
+
return wrap;
|
|
217
|
+
}
|
|
218
|
+
function cardBlock(spec) {
|
|
219
|
+
const card = make("div", "skl-card");
|
|
220
|
+
const ratio = spec.ratio ?? "16/10";
|
|
221
|
+
card.appendChild(block({ width: "100%", "aspect-ratio": ratio }));
|
|
222
|
+
card.appendChild(line("68%", "0.8em"));
|
|
223
|
+
const lines = make("div", "skl-lines");
|
|
224
|
+
lines.appendChild(line("100%"));
|
|
225
|
+
lines.appendChild(line("82%"));
|
|
226
|
+
card.appendChild(lines);
|
|
227
|
+
card.appendChild(block({ width: "34%", height: "1.15em", "border-radius": "999px" }));
|
|
228
|
+
return card;
|
|
229
|
+
}
|
|
230
|
+
function gridCell(spec) {
|
|
231
|
+
const cell = make("div", "skl-cell");
|
|
232
|
+
cell.appendChild(
|
|
233
|
+
block({ width: "100%", "aspect-ratio": spec.ratio ?? "16/10", "border-radius": "0" })
|
|
234
|
+
);
|
|
235
|
+
const body = make("div", "skl-cell-body");
|
|
236
|
+
body.appendChild(line("58%", "0.82em"));
|
|
237
|
+
body.appendChild(line("36%"));
|
|
238
|
+
body.appendChild(line("92%"));
|
|
239
|
+
const footer = make("div", "skl-row", { "justify-content": "space-between", "margin-top": "6px" });
|
|
240
|
+
footer.appendChild(block({ width: "28%", height: "1.15em", "border-radius": "999px" }));
|
|
241
|
+
footer.appendChild(block({ width: "24%", height: "1.5em", "border-radius": "999px" }));
|
|
242
|
+
body.appendChild(footer);
|
|
243
|
+
cell.appendChild(body);
|
|
244
|
+
return cell;
|
|
245
|
+
}
|
|
246
|
+
function rowBlock(withAvatar) {
|
|
247
|
+
const row = make("div", "skl-row");
|
|
248
|
+
{
|
|
249
|
+
row.appendChild(block({ width: "40px", height: "40px" }, "skl-circle"));
|
|
250
|
+
}
|
|
251
|
+
const lines = make("div", "skl-lines");
|
|
252
|
+
lines.appendChild(line("62%"));
|
|
253
|
+
lines.appendChild(line("40%"));
|
|
254
|
+
row.appendChild(lines);
|
|
255
|
+
return row;
|
|
256
|
+
}
|
|
257
|
+
function tableBlock(spec) {
|
|
258
|
+
const wrap = make("div", "skl-table");
|
|
259
|
+
const header = make("div", "skl-trow skl-thead");
|
|
260
|
+
for (const width of ["54%", "66%", "58%", "50%"]) header.appendChild(line(width, "10px"));
|
|
261
|
+
wrap.appendChild(header);
|
|
262
|
+
const rows = clamp(spec.count, 1, 12);
|
|
263
|
+
for (let i = 0; i < rows; i++) {
|
|
264
|
+
const row = make("div", "skl-trow");
|
|
265
|
+
const who = make("div", "skl-who");
|
|
266
|
+
who.appendChild(block({ width: "30px", height: "30px", "min-height": "0" }, "skl-circle"));
|
|
267
|
+
const lines = make("div", "skl-lines", { gap: "7px" });
|
|
268
|
+
lines.appendChild(line("86%", "10px"));
|
|
269
|
+
lines.appendChild(line("52%", "10px"));
|
|
270
|
+
who.appendChild(lines);
|
|
271
|
+
row.appendChild(who);
|
|
272
|
+
row.appendChild(line("62%", "12px"));
|
|
273
|
+
row.appendChild(line("54%", "12px"));
|
|
274
|
+
row.appendChild(line("58%", "12px"));
|
|
275
|
+
wrap.appendChild(row);
|
|
276
|
+
}
|
|
277
|
+
return wrap;
|
|
278
|
+
}
|
|
279
|
+
function chartBlock() {
|
|
280
|
+
const chart = make("div", "skl-chart");
|
|
281
|
+
const heights = ["38%", "64%", "48%", "86%", "58%", "74%", "44%"];
|
|
282
|
+
for (const h of heights) {
|
|
283
|
+
chart.appendChild(block({ height: h, width: "100%", "border-radius": "6px" }));
|
|
284
|
+
}
|
|
285
|
+
return chart;
|
|
286
|
+
}
|
|
287
|
+
function mediaBlock(spec) {
|
|
288
|
+
const wrap = make("div", "skl-lines", { width: "100%", height: "100%" });
|
|
289
|
+
const ratio = spec.ratio ?? "16/9";
|
|
290
|
+
wrap.appendChild(
|
|
291
|
+
block({ width: "100%", height: "100%", "min-height": "48px", "aspect-ratio": ratio, "border-radius": "inherit" })
|
|
292
|
+
);
|
|
293
|
+
return wrap;
|
|
294
|
+
}
|
|
295
|
+
function avatarBlock(spec) {
|
|
296
|
+
const size = spec.height ? `${spec.height}px` : "clamp(32px, 42%, 64px)";
|
|
297
|
+
const wrap = make("div", "skl-lines", { width: "100%", height: "100%", "align-items": "center", "justify-content": "center" });
|
|
298
|
+
wrap.appendChild(block({ width: size, height: size, "min-height": "0" }, "skl-circle"));
|
|
299
|
+
return wrap;
|
|
300
|
+
}
|
|
301
|
+
function profileBlock(spec) {
|
|
302
|
+
const wrap = make("div", "skl-lines", { "align-items": "center", "justify-content": "center", height: "100%", gap: "12px" });
|
|
303
|
+
const size = spec.height ? `${spec.height}px` : "72px";
|
|
304
|
+
wrap.appendChild(block({ width: size, height: size, "min-height": "0" }, "skl-circle"));
|
|
305
|
+
wrap.appendChild(line("46%"));
|
|
306
|
+
wrap.appendChild(line("30%"));
|
|
307
|
+
return wrap;
|
|
308
|
+
}
|
|
309
|
+
function autoFallback(spec) {
|
|
310
|
+
const count = clamp(spec.count, 1, 8);
|
|
311
|
+
const wrap = make("div", "skl-lines", { width: "100%", gap: "12px" });
|
|
312
|
+
wrap.appendChild(line("34%", "0.85em"));
|
|
313
|
+
for (let i = 0; i < count; i++) {
|
|
314
|
+
const cell = make("div", "skl-cell skl-cell-pad");
|
|
315
|
+
cell.appendChild(rowBlock());
|
|
316
|
+
wrap.appendChild(cell);
|
|
317
|
+
}
|
|
318
|
+
return wrap;
|
|
319
|
+
}
|
|
320
|
+
function mirror(host, overlay, spec, depth) {
|
|
321
|
+
const hostEl = host;
|
|
322
|
+
const rect = hostEl.getBoundingClientRect();
|
|
323
|
+
const originLeft = rect.left + hostEl.clientLeft;
|
|
324
|
+
const originTop = rect.top + hostEl.clientTop;
|
|
325
|
+
const width = hostEl.clientWidth || rect.width;
|
|
326
|
+
const height = hostEl.clientHeight || rect.height;
|
|
327
|
+
if (width < 8 || height < 8) return 0;
|
|
328
|
+
const targets = [];
|
|
329
|
+
const walk = (parent, level) => {
|
|
330
|
+
for (const child of Array.from(parent.children)) {
|
|
331
|
+
if (child.classList.contains("skl-overlay")) continue;
|
|
332
|
+
const style = getComputedStyle(child);
|
|
333
|
+
if (style.display === "none" || style.visibility === "hidden") continue;
|
|
334
|
+
targets.push(child);
|
|
335
|
+
if (level < depth) walk(child, level + 1);
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
walk(host, 1);
|
|
339
|
+
let count = 0;
|
|
340
|
+
for (const child of targets) {
|
|
341
|
+
if (count >= 64) break;
|
|
342
|
+
const r = child.getBoundingClientRect();
|
|
343
|
+
if (r.width < 4 || r.height < 4) continue;
|
|
344
|
+
let left = r.left - originLeft;
|
|
345
|
+
let top = r.top - originTop;
|
|
346
|
+
if (left > width - 2 || top > height - 2) continue;
|
|
347
|
+
left = clamp(left, 0, Math.max(0, width - 4));
|
|
348
|
+
top = clamp(top, 0, Math.max(0, height - 4));
|
|
349
|
+
const w = Math.min(r.width, width - left);
|
|
350
|
+
const h = Math.min(r.height, height - top);
|
|
351
|
+
if (w < 4 || h < 4) continue;
|
|
352
|
+
const style = getComputedStyle(child);
|
|
353
|
+
const radius = spec.radius ?? (child.tagName === "IMG" ? 8 : clamp(parseRadius(style) ?? 8, 0, 24));
|
|
354
|
+
const textLike = child.childElementCount === 0 && (child.textContent ?? "").trim().length > 0;
|
|
355
|
+
const node = block({
|
|
356
|
+
left: `${Math.round(left)}px`,
|
|
357
|
+
top: `${Math.round(top)}px`,
|
|
358
|
+
width: `${Math.round(w)}px`,
|
|
359
|
+
height: `${Math.round(h)}px`,
|
|
360
|
+
"border-radius": `${radius}px`,
|
|
361
|
+
...textLike ? { "border-radius": "999px", height: `${Math.min(Math.round(h), 16)}px` } : {}
|
|
362
|
+
});
|
|
363
|
+
overlay.appendChild(node);
|
|
364
|
+
count++;
|
|
365
|
+
}
|
|
366
|
+
return count;
|
|
367
|
+
}
|
|
368
|
+
function buildOverlay(ctx) {
|
|
369
|
+
const { host, spec, media, preset } = ctx;
|
|
370
|
+
const overlay = make("div", "skl-overlay");
|
|
371
|
+
overlay.dataset.sklPreset = preset;
|
|
372
|
+
overlay.dataset.sklKind = media ? "media" : "container";
|
|
373
|
+
overlay.setAttribute("aria-hidden", "true");
|
|
374
|
+
const style = getComputedStyle(host);
|
|
375
|
+
const surface = surfaceOf(media ? host.parentElement ?? host : host);
|
|
376
|
+
const forced = ctx.theme === "light" || ctx.theme === "dark" ? ctx.theme : null;
|
|
377
|
+
overlay.dataset.sklTone = forced ?? surface.tone;
|
|
378
|
+
overlay.style.setProperty("--skl-solid", surface.color);
|
|
379
|
+
if (media) {
|
|
380
|
+
overlay.dataset.sklLayout = "fill";
|
|
381
|
+
const hostRadius = style.borderRadius;
|
|
382
|
+
if (hostRadius && hostRadius !== "0px") overlay.style.borderRadius = hostRadius;
|
|
383
|
+
overlay.appendChild(block({ width: "100%", height: "100%", "border-radius": "inherit" }));
|
|
384
|
+
return overlay;
|
|
385
|
+
}
|
|
386
|
+
const pad = computedPadding(style);
|
|
387
|
+
for (const key of Object.keys(pad)) {
|
|
388
|
+
const value = pad[key];
|
|
389
|
+
if (value && value !== "0px") overlay.style.setProperty(key, value);
|
|
390
|
+
}
|
|
391
|
+
if (spec.radius) overlay.style.setProperty("--skl-radius", `${spec.radius}px`);
|
|
392
|
+
switch (spec.shape) {
|
|
393
|
+
case "text":
|
|
394
|
+
overlay.dataset.sklLayout = "stack";
|
|
395
|
+
overlay.appendChild(textLines(spec.lines));
|
|
396
|
+
break;
|
|
397
|
+
case "card":
|
|
398
|
+
overlay.dataset.sklLayout = "stack";
|
|
399
|
+
overlay.appendChild(cardBlock(spec));
|
|
400
|
+
break;
|
|
401
|
+
case "grid": {
|
|
402
|
+
overlay.dataset.sklLayout = "grid";
|
|
403
|
+
overlay.style.setProperty("--skl-cols", String(spec.cols));
|
|
404
|
+
for (let i = 0; i < spec.count; i++) overlay.appendChild(gridCell(spec));
|
|
405
|
+
break;
|
|
406
|
+
}
|
|
407
|
+
case "list": {
|
|
408
|
+
overlay.dataset.sklLayout = "stack";
|
|
409
|
+
for (let i = 0; i < spec.count; i++) overlay.appendChild(rowBlock());
|
|
410
|
+
break;
|
|
411
|
+
}
|
|
412
|
+
case "table":
|
|
413
|
+
overlay.dataset.sklLayout = "stack";
|
|
414
|
+
overlay.appendChild(tableBlock(spec));
|
|
415
|
+
break;
|
|
416
|
+
case "media":
|
|
417
|
+
overlay.dataset.sklLayout = "stack";
|
|
418
|
+
overlay.appendChild(mediaBlock(spec));
|
|
419
|
+
break;
|
|
420
|
+
case "avatar":
|
|
421
|
+
overlay.dataset.sklLayout = "stack";
|
|
422
|
+
overlay.appendChild(avatarBlock(spec));
|
|
423
|
+
break;
|
|
424
|
+
case "chart":
|
|
425
|
+
overlay.dataset.sklLayout = "stack";
|
|
426
|
+
overlay.appendChild(chartBlock());
|
|
427
|
+
break;
|
|
428
|
+
case "profile":
|
|
429
|
+
overlay.dataset.sklLayout = "stack";
|
|
430
|
+
overlay.appendChild(profileBlock(spec));
|
|
431
|
+
break;
|
|
432
|
+
default: {
|
|
433
|
+
overlay.dataset.sklLayout = "mirror";
|
|
434
|
+
const depth = host.getAttribute("data-skeleton-depth") === "2" ? 2 : 1;
|
|
435
|
+
const painted = mirror(host, overlay, spec, depth);
|
|
436
|
+
if (!painted) {
|
|
437
|
+
overlay.dataset.sklLayout = "stack";
|
|
438
|
+
overlay.appendChild(autoFallback(spec));
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
if (!overlay.style.getPropertyValue("--skl-radius") && spec.radius === null) {
|
|
443
|
+
const hostRadius = parseRadius(style);
|
|
444
|
+
if (hostRadius !== null && hostRadius <= 32) {
|
|
445
|
+
overlay.style.setProperty("--skl-radius", `${hostRadius}px`);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
return overlay;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
// src/core/css.generated.ts
|
|
452
|
+
var css_generated_default = `/*!
|
|
453
|
+
* skeleton-load v0.1.0 \u2014 MIT
|
|
454
|
+
* https://github.com/skeleton-load
|
|
455
|
+
*/
|
|
456
|
+
|
|
457
|
+
.skl-host,
|
|
458
|
+
[data-skl-state] {
|
|
459
|
+
position: relative;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/* Content is kept in the layout (no CLS) but hidden while the skeleton plays. */
|
|
463
|
+
[data-skl-state="loading"] > *:not(.skl-overlay) {
|
|
464
|
+
visibility: hidden !important;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.skl-overlay {
|
|
468
|
+
position: absolute;
|
|
469
|
+
inset: 0;
|
|
470
|
+
z-index: 4;
|
|
471
|
+
overflow: hidden;
|
|
472
|
+
pointer-events: none;
|
|
473
|
+
border-radius: inherit;
|
|
474
|
+
opacity: 0;
|
|
475
|
+
transition: opacity 180ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
476
|
+
contain: layout paint style;
|
|
477
|
+
|
|
478
|
+
--skl-base: rgba(17, 20, 28, 0.1);
|
|
479
|
+
--skl-highlight: rgba(255, 255, 255, 0.72);
|
|
480
|
+
--skl-radius: 8px;
|
|
481
|
+
--skl-gap: 10px;
|
|
482
|
+
--skl-surface: #ffffff;
|
|
483
|
+
--skl-border: rgba(17, 20, 28, 0.08);
|
|
484
|
+
--skl-line: rgba(17, 20, 28, 0.08);
|
|
485
|
+
--skl-solid: #f1f1f6;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/* A dark surface needs brighter placeholders to be readable at all. */
|
|
489
|
+
.skl-overlay[data-skl-tone="dark"] {
|
|
490
|
+
--skl-base: rgba(255, 255, 255, 0.115);
|
|
491
|
+
--skl-highlight: rgba(255, 255, 255, 0.22);
|
|
492
|
+
--skl-surface: rgba(255, 255, 255, 0.035);
|
|
493
|
+
--skl-border: rgba(255, 255, 255, 0.07);
|
|
494
|
+
--skl-line: rgba(255, 255, 255, 0.07);
|
|
495
|
+
--skl-solid: #14161c;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
.skl-overlay[data-skl-show="1"] {
|
|
499
|
+
opacity: 1;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/* Temporary state used to measure the skeleton's natural height. */
|
|
503
|
+
.skl-overlay[data-skl-measure] {
|
|
504
|
+
inset: auto;
|
|
505
|
+
top: 0;
|
|
506
|
+
left: 0;
|
|
507
|
+
opacity: 0;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.skl-overlay[data-skl-kind="media"] {
|
|
511
|
+
background: var(--skl-solid);
|
|
512
|
+
border-radius: var(--skl-radius);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/* ---------- blocks ---------- */
|
|
516
|
+
|
|
517
|
+
.skl-block {
|
|
518
|
+
position: relative;
|
|
519
|
+
min-height: 8px;
|
|
520
|
+
overflow: hidden;
|
|
521
|
+
border-radius: var(--skl-radius);
|
|
522
|
+
background: var(--skl-base);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
.skl-block::after {
|
|
526
|
+
content: "";
|
|
527
|
+
position: absolute;
|
|
528
|
+
inset: 0;
|
|
529
|
+
background: linear-gradient(
|
|
530
|
+
90deg,
|
|
531
|
+
transparent 0%,
|
|
532
|
+
var(--skl-highlight) 50%,
|
|
533
|
+
transparent 100%
|
|
534
|
+
);
|
|
535
|
+
transform: translateX(-100%);
|
|
536
|
+
animation: skl-shimmer var(--skl-speed, 1.6s) cubic-bezier(0.45, 0, 0.25, 1) infinite;
|
|
537
|
+
will-change: transform;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
.skl-overlay[data-skl-preset="pulse"] .skl-block::after,
|
|
541
|
+
.skl-overlay[data-skl-preset="static"] .skl-block::after {
|
|
542
|
+
display: none;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
.skl-overlay[data-skl-preset="pulse"] .skl-block {
|
|
546
|
+
animation: skl-pulse 1.8s ease-in-out infinite;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
.skl-overlay[data-skl-preset="static"] .skl-block {
|
|
550
|
+
opacity: 0.92;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/* Pause everything while the tab is in the background. */
|
|
554
|
+
html[data-skl-idle] .skl-block::after,
|
|
555
|
+
html[data-skl-idle] .skl-block {
|
|
556
|
+
animation-play-state: paused;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
/* ---------- layouts ---------- */
|
|
560
|
+
|
|
561
|
+
.skl-overlay[data-skl-layout="stack"] {
|
|
562
|
+
display: flex;
|
|
563
|
+
flex-direction: column;
|
|
564
|
+
gap: var(--skl-gap);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
.skl-overlay[data-skl-layout="row"] {
|
|
568
|
+
display: flex;
|
|
569
|
+
flex-direction: row;
|
|
570
|
+
align-items: center;
|
|
571
|
+
gap: var(--skl-gap);
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.skl-overlay[data-skl-layout="grid"] {
|
|
575
|
+
display: grid;
|
|
576
|
+
gap: var(--skl-gap);
|
|
577
|
+
grid-template-columns: repeat(var(--skl-cols, 3), minmax(0, 1fr));
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
.skl-overlay[data-skl-layout="center"] {
|
|
581
|
+
display: flex;
|
|
582
|
+
flex-direction: column;
|
|
583
|
+
align-items: center;
|
|
584
|
+
justify-content: center;
|
|
585
|
+
gap: var(--skl-gap);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
.skl-overlay[data-skl-layout="mirror"] {
|
|
589
|
+
padding: 0;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
.skl-overlay[data-skl-layout="mirror"] > .skl-block {
|
|
593
|
+
position: absolute;
|
|
594
|
+
min-height: 0;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
.skl-card {
|
|
598
|
+
display: flex;
|
|
599
|
+
flex-direction: column;
|
|
600
|
+
gap: var(--skl-gap);
|
|
601
|
+
min-width: 0;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
.skl-cell {
|
|
605
|
+
display: flex;
|
|
606
|
+
flex-direction: column;
|
|
607
|
+
gap: 0;
|
|
608
|
+
min-width: 0;
|
|
609
|
+
overflow: hidden;
|
|
610
|
+
border-radius: calc(var(--skl-radius) + 8px);
|
|
611
|
+
background: var(--skl-surface);
|
|
612
|
+
border: 1px solid var(--skl-border);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
.skl-cell-body {
|
|
616
|
+
display: flex;
|
|
617
|
+
flex-direction: column;
|
|
618
|
+
gap: 8px;
|
|
619
|
+
padding: 16px;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
.skl-cell-pad {
|
|
623
|
+
padding: 20px 18px;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
.skl-row {
|
|
627
|
+
display: flex;
|
|
628
|
+
align-items: center;
|
|
629
|
+
gap: var(--skl-gap);
|
|
630
|
+
min-width: 0;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
.skl-lines {
|
|
634
|
+
display: flex;
|
|
635
|
+
flex: 1 1 auto;
|
|
636
|
+
flex-direction: column;
|
|
637
|
+
gap: 8px;
|
|
638
|
+
min-width: 0;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
.skl-line {
|
|
642
|
+
height: var(--skl-line-h, 0.72em);
|
|
643
|
+
min-height: 7px;
|
|
644
|
+
border-radius: 999px;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
.skl-circle {
|
|
648
|
+
border-radius: 50%;
|
|
649
|
+
flex: 0 0 auto;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
.skl-chart {
|
|
653
|
+
display: flex;
|
|
654
|
+
align-items: flex-end;
|
|
655
|
+
gap: var(--skl-gap);
|
|
656
|
+
height: 100%;
|
|
657
|
+
min-height: 90px;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
.skl-chart > .skl-block {
|
|
661
|
+
flex: 1 1 0;
|
|
662
|
+
min-width: 0;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
/* ---------- table ---------- */
|
|
666
|
+
|
|
667
|
+
.skl-table {
|
|
668
|
+
display: flex;
|
|
669
|
+
flex-direction: column;
|
|
670
|
+
width: 100%;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
.skl-trow {
|
|
674
|
+
display: grid;
|
|
675
|
+
grid-template-columns: 2.2fr 1fr 1fr 0.9fr;
|
|
676
|
+
gap: 14px;
|
|
677
|
+
align-items: center;
|
|
678
|
+
padding: 19px 8px;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
.skl-trow + .skl-trow {
|
|
682
|
+
border-top: 1px solid var(--skl-line);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
.skl-thead {
|
|
686
|
+
padding-top: 2px;
|
|
687
|
+
padding-bottom: 12px;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
.skl-thead .skl-line {
|
|
691
|
+
min-height: 8px;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
.skl-who {
|
|
695
|
+
display: flex;
|
|
696
|
+
align-items: center;
|
|
697
|
+
gap: 10px;
|
|
698
|
+
min-width: 0;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
/* ---------- reveal ---------- */
|
|
702
|
+
|
|
703
|
+
[data-skl-state="done"] > *:not(.skl-overlay) {
|
|
704
|
+
animation: skl-content-in 200ms ease both;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
/* ---------- debug ---------- */
|
|
708
|
+
|
|
709
|
+
[data-skl-debug] .skl-block {
|
|
710
|
+
outline: 1px dashed rgba(255, 64, 129, 0.7);
|
|
711
|
+
outline-offset: -1px;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
[data-skl-debug] .skl-overlay {
|
|
715
|
+
outline: 2px solid rgba(255, 64, 129, 0.9);
|
|
716
|
+
outline-offset: -2px;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
/* ---------- keyframes ---------- */
|
|
720
|
+
|
|
721
|
+
@keyframes skl-shimmer {
|
|
722
|
+
from {
|
|
723
|
+
transform: translateX(-100%);
|
|
724
|
+
}
|
|
725
|
+
to {
|
|
726
|
+
transform: translateX(100%);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
@keyframes skl-pulse {
|
|
731
|
+
0%,
|
|
732
|
+
100% {
|
|
733
|
+
opacity: 0.55;
|
|
734
|
+
}
|
|
735
|
+
50% {
|
|
736
|
+
opacity: 1;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
@keyframes skl-content-in {
|
|
741
|
+
from {
|
|
742
|
+
opacity: 0;
|
|
743
|
+
}
|
|
744
|
+
to {
|
|
745
|
+
opacity: 1;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
/* ---------- preferences ---------- */
|
|
750
|
+
|
|
751
|
+
@media (prefers-reduced-motion: reduce) {
|
|
752
|
+
.skl-overlay {
|
|
753
|
+
transition: none;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
.skl-block::after {
|
|
757
|
+
display: none;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
.skl-overlay[data-skl-preset="pulse"] .skl-block,
|
|
761
|
+
[data-skl-state="done"] > * {
|
|
762
|
+
animation: none;
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
@media (prefers-reduced-data: reduce) {
|
|
767
|
+
.skl-block::after {
|
|
768
|
+
display: none;
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
@media (forced-colors: active) {
|
|
773
|
+
.skl-block {
|
|
774
|
+
background: CanvasText;
|
|
775
|
+
opacity: 0.25;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
`;
|
|
779
|
+
|
|
780
|
+
// src/core/style.ts
|
|
781
|
+
var STYLE_ID = "skeleton-load-styles";
|
|
782
|
+
function injectStyles(nonce) {
|
|
783
|
+
if (typeof document === "undefined") return null;
|
|
784
|
+
const existing = document.getElementById(STYLE_ID);
|
|
785
|
+
if (existing) return existing;
|
|
786
|
+
const style = document.createElement("style");
|
|
787
|
+
style.id = STYLE_ID;
|
|
788
|
+
style.setAttribute("data-skeleton-load", "");
|
|
789
|
+
if (nonce) style.setAttribute("nonce", nonce);
|
|
790
|
+
style.textContent = css_generated_default;
|
|
791
|
+
const head = document.head ?? document.documentElement;
|
|
792
|
+
head.prepend(style);
|
|
793
|
+
return style;
|
|
794
|
+
}
|
|
795
|
+
function removeStyles() {
|
|
796
|
+
document.getElementById(STYLE_ID)?.remove();
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
// src/core/engine.ts
|
|
800
|
+
function isDisplayNone(element) {
|
|
801
|
+
const el = element;
|
|
802
|
+
if (el.hidden) return true;
|
|
803
|
+
try {
|
|
804
|
+
return getComputedStyle(element).display === "none";
|
|
805
|
+
} catch {
|
|
806
|
+
return false;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
var SkeletonEngine = class {
|
|
810
|
+
constructor(options = {}) {
|
|
811
|
+
this.entries = /* @__PURE__ */ new Map();
|
|
812
|
+
this.waiting = /* @__PURE__ */ new Map();
|
|
813
|
+
this.mo = null;
|
|
814
|
+
this.io = null;
|
|
815
|
+
this.pending = /* @__PURE__ */ new Set();
|
|
816
|
+
this.rafId = 0;
|
|
817
|
+
this.styleEl = null;
|
|
818
|
+
this.started = false;
|
|
819
|
+
this.destroyed = false;
|
|
820
|
+
this.visibilityHandler = null;
|
|
821
|
+
this.stats = { shown: 0, hidden: 0, total: 0 };
|
|
822
|
+
this.raw = { ...options };
|
|
823
|
+
this.resolved = resolveOptions(this.raw);
|
|
824
|
+
}
|
|
825
|
+
get options() {
|
|
826
|
+
return this.resolved;
|
|
827
|
+
}
|
|
828
|
+
start() {
|
|
829
|
+
if (typeof document === "undefined") return this;
|
|
830
|
+
this.destroyed = false;
|
|
831
|
+
if (this.started) return this;
|
|
832
|
+
this.started = true;
|
|
833
|
+
if (this.resolved.css && !this.styleEl) {
|
|
834
|
+
this.styleEl = injectStyles(this.resolved.nonce);
|
|
835
|
+
}
|
|
836
|
+
if (this.resolved.debug) {
|
|
837
|
+
document.documentElement.setAttribute("data-skl-debug", "");
|
|
838
|
+
}
|
|
839
|
+
this.observe();
|
|
840
|
+
this.bindVisibility();
|
|
841
|
+
this.refresh();
|
|
842
|
+
return this;
|
|
843
|
+
}
|
|
844
|
+
stop() {
|
|
845
|
+
this.started = false;
|
|
846
|
+
this.mo?.disconnect();
|
|
847
|
+
this.mo = null;
|
|
848
|
+
this.io?.disconnect();
|
|
849
|
+
this.io = null;
|
|
850
|
+
this.waiting.clear();
|
|
851
|
+
if (this.rafId) {
|
|
852
|
+
cancelAnimationFrame(this.rafId);
|
|
853
|
+
this.rafId = 0;
|
|
854
|
+
}
|
|
855
|
+
for (const entry of Array.from(this.entries.values())) {
|
|
856
|
+
entry.state = "done";
|
|
857
|
+
this.teardown(entry, true);
|
|
858
|
+
}
|
|
859
|
+
this.entries.clear();
|
|
860
|
+
document.documentElement.removeAttribute("data-skl-debug");
|
|
861
|
+
return this;
|
|
862
|
+
}
|
|
863
|
+
destroy() {
|
|
864
|
+
this.stop();
|
|
865
|
+
this.destroyed = true;
|
|
866
|
+
if (this.styleEl) {
|
|
867
|
+
removeStyles();
|
|
868
|
+
this.styleEl = null;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
update(options) {
|
|
872
|
+
this.raw = { ...this.raw, ...options };
|
|
873
|
+
this.resolved = resolveOptions(this.raw);
|
|
874
|
+
if (this.started) {
|
|
875
|
+
for (const entry of this.entries.values()) {
|
|
876
|
+
const next = entry.spec.preset ?? inheritedPreset(entry.host) ?? this.resolved.preset;
|
|
877
|
+
if (entry.preset !== next) {
|
|
878
|
+
entry.preset = next;
|
|
879
|
+
if (entry.overlay) entry.overlay.dataset.sklPreset = next;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
this.refresh();
|
|
883
|
+
}
|
|
884
|
+
return this;
|
|
885
|
+
}
|
|
886
|
+
setPreset(preset) {
|
|
887
|
+
return this.update({ preset });
|
|
888
|
+
}
|
|
889
|
+
refresh(root) {
|
|
890
|
+
if (!this.started) this.start();
|
|
891
|
+
this.scan(root ?? this.resolved.root ?? document);
|
|
892
|
+
return this;
|
|
893
|
+
}
|
|
894
|
+
show(element) {
|
|
895
|
+
if (!this.started) this.start();
|
|
896
|
+
this.consider(element, true);
|
|
897
|
+
return this;
|
|
898
|
+
}
|
|
899
|
+
hide(element) {
|
|
900
|
+
const entry = this.entries.get(element);
|
|
901
|
+
if (entry) this.finish(entry);
|
|
902
|
+
return this;
|
|
903
|
+
}
|
|
904
|
+
/** Elements currently displaying a skeleton. */
|
|
905
|
+
get active() {
|
|
906
|
+
return Array.from(this.entries.values()).filter((e) => e.state === "shown").map((e) => e.host);
|
|
907
|
+
}
|
|
908
|
+
get report() {
|
|
909
|
+
return { ...this.stats };
|
|
910
|
+
}
|
|
911
|
+
// ----------------------------- internals -----------------------------
|
|
912
|
+
observe() {
|
|
913
|
+
if (typeof MutationObserver === "undefined") return;
|
|
914
|
+
if (!this.mo) {
|
|
915
|
+
this.mo = new MutationObserver((records) => this.onMutations(records));
|
|
916
|
+
}
|
|
917
|
+
this.mo.observe(document.documentElement, {
|
|
918
|
+
childList: true,
|
|
919
|
+
subtree: true,
|
|
920
|
+
characterData: true,
|
|
921
|
+
attributes: true,
|
|
922
|
+
attributeFilter: [
|
|
923
|
+
"data-skeleton",
|
|
924
|
+
"data-skeleton-state",
|
|
925
|
+
"data-skeleton-preset",
|
|
926
|
+
"data-skeleton-lines",
|
|
927
|
+
"src",
|
|
928
|
+
"loading"
|
|
929
|
+
]
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
bindVisibility() {
|
|
933
|
+
if (this.visibilityHandler) return;
|
|
934
|
+
this.visibilityHandler = () => {
|
|
935
|
+
const root = document.documentElement;
|
|
936
|
+
if (document.hidden) root.setAttribute("data-skl-idle", "");
|
|
937
|
+
else root.removeAttribute("data-skl-idle");
|
|
938
|
+
};
|
|
939
|
+
document.addEventListener("visibilitychange", this.visibilityHandler);
|
|
940
|
+
}
|
|
941
|
+
onMutations(records) {
|
|
942
|
+
const roots = [];
|
|
943
|
+
for (const record of records) {
|
|
944
|
+
const target = record.target;
|
|
945
|
+
if (record.type === "attributes") {
|
|
946
|
+
const name = record.attributeName;
|
|
947
|
+
if (name === "data-skeleton-state") {
|
|
948
|
+
this.syncState(target);
|
|
949
|
+
continue;
|
|
950
|
+
}
|
|
951
|
+
if (name === "data-skeleton" || name === "data-skeleton-preset" || name === "data-skeleton-lines") {
|
|
952
|
+
if (this.entries.has(target)) this.restart(target);
|
|
953
|
+
else if (this.resolved.observe) roots.push(target);
|
|
954
|
+
continue;
|
|
955
|
+
}
|
|
956
|
+
if (name === "src" && isMedia(target)) {
|
|
957
|
+
if (this.entries.has(target)) this.restart(target);
|
|
958
|
+
else if (this.resolved.observe) roots.push(target);
|
|
959
|
+
}
|
|
960
|
+
continue;
|
|
961
|
+
}
|
|
962
|
+
const entry = this.entries.get(target);
|
|
963
|
+
if (entry && !entry.media) {
|
|
964
|
+
if (hasRealContent(target)) this.finish(entry);
|
|
965
|
+
}
|
|
966
|
+
if (record.type === "characterData") {
|
|
967
|
+
const host = target.parentElement;
|
|
968
|
+
const hostEntry = host ? this.entries.get(host) : void 0;
|
|
969
|
+
if (hostEntry && !hostEntry.media && hasRealContent(host)) this.finish(hostEntry);
|
|
970
|
+
continue;
|
|
971
|
+
}
|
|
972
|
+
if (!this.resolved.observe) continue;
|
|
973
|
+
record.addedNodes.forEach((node) => {
|
|
974
|
+
if (node.nodeType === 1) roots.push(node);
|
|
975
|
+
});
|
|
976
|
+
}
|
|
977
|
+
if (roots.length) this.queueScan(roots);
|
|
978
|
+
}
|
|
979
|
+
queueScan(roots) {
|
|
980
|
+
for (const root of roots) this.pending.add(root);
|
|
981
|
+
if (this.rafId) return;
|
|
982
|
+
this.rafId = raf(() => {
|
|
983
|
+
this.rafId = 0;
|
|
984
|
+
const nodes = Array.from(this.pending);
|
|
985
|
+
this.pending.clear();
|
|
986
|
+
for (const node of nodes) {
|
|
987
|
+
if (node.isConnected) this.scan(node);
|
|
988
|
+
}
|
|
989
|
+
});
|
|
990
|
+
}
|
|
991
|
+
syncState(element) {
|
|
992
|
+
const state = element.getAttribute("data-skeleton-state");
|
|
993
|
+
const entry = this.entries.get(element);
|
|
994
|
+
if (state === "loading") {
|
|
995
|
+
if (!entry) this.consider(element, true);
|
|
996
|
+
else if (entry.state === "done") this.restart(element);
|
|
997
|
+
else entry.forced = true;
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
if (state === "done" && entry) this.finish(entry);
|
|
1001
|
+
}
|
|
1002
|
+
restart(element) {
|
|
1003
|
+
const entry = this.entries.get(element);
|
|
1004
|
+
if (entry) this.teardown(entry, true);
|
|
1005
|
+
raf(() => this.consider(element, false));
|
|
1006
|
+
}
|
|
1007
|
+
scan(root) {
|
|
1008
|
+
if (!root) return;
|
|
1009
|
+
const candidates = [];
|
|
1010
|
+
if (root instanceof Element) candidates.push(root);
|
|
1011
|
+
const query = root.querySelectorAll;
|
|
1012
|
+
if (typeof query === "function") {
|
|
1013
|
+
query.call(root, "img,video,iframe,[data-skeleton]").forEach((el) => candidates.push(el));
|
|
1014
|
+
}
|
|
1015
|
+
for (const element of candidates) this.consider(element, false);
|
|
1016
|
+
}
|
|
1017
|
+
consider(element, force) {
|
|
1018
|
+
if (!element.isConnected && force) return;
|
|
1019
|
+
if (this.entries.has(element)) return;
|
|
1020
|
+
if (!force && isOptedOut(element)) return;
|
|
1021
|
+
const media = isMedia(element);
|
|
1022
|
+
const spec = readSpec(element);
|
|
1023
|
+
if (!media && spec.shape === "off") return;
|
|
1024
|
+
if (!force && element.closest('[data-skl-state="loading"]')) return;
|
|
1025
|
+
if (media) {
|
|
1026
|
+
const explicit = element.hasAttribute("data-skeleton");
|
|
1027
|
+
if (!this.resolved.autoMedia && !explicit && !force) return;
|
|
1028
|
+
if (!force && spec.state === "done") return;
|
|
1029
|
+
if (!force && isLoadedMedia(element) && spec.state !== "loading") return;
|
|
1030
|
+
if (!force && this.resolved.observe && isLazy(element)) {
|
|
1031
|
+
this.watchLazy(element);
|
|
1032
|
+
return;
|
|
1033
|
+
}
|
|
1034
|
+
this.addEntry(element, true, spec, force || spec.state === "loading");
|
|
1035
|
+
return;
|
|
1036
|
+
}
|
|
1037
|
+
if (!force && spec.state === "done") return;
|
|
1038
|
+
const forced = force || spec.state === "loading";
|
|
1039
|
+
if (!forced && hasRealContent(element)) return;
|
|
1040
|
+
if (!forced && isDisplayNone(element)) return;
|
|
1041
|
+
this.addEntry(element, false, spec, forced);
|
|
1042
|
+
}
|
|
1043
|
+
watchLazy(element) {
|
|
1044
|
+
if (typeof IntersectionObserver === "undefined") {
|
|
1045
|
+
this.consider(element, true);
|
|
1046
|
+
return;
|
|
1047
|
+
}
|
|
1048
|
+
if (this.waiting.has(element)) return;
|
|
1049
|
+
if (!this.io) {
|
|
1050
|
+
this.io = new IntersectionObserver(
|
|
1051
|
+
(records) => {
|
|
1052
|
+
for (const record of records) {
|
|
1053
|
+
if (!record.isIntersecting) continue;
|
|
1054
|
+
const callback = this.waiting.get(record.target);
|
|
1055
|
+
if (!callback) continue;
|
|
1056
|
+
this.waiting.delete(record.target);
|
|
1057
|
+
this.io?.unobserve(record.target);
|
|
1058
|
+
callback();
|
|
1059
|
+
}
|
|
1060
|
+
},
|
|
1061
|
+
{ rootMargin: "320px 0px" }
|
|
1062
|
+
);
|
|
1063
|
+
}
|
|
1064
|
+
this.waiting.set(element, () => this.consider(element, false));
|
|
1065
|
+
this.io.observe(element);
|
|
1066
|
+
}
|
|
1067
|
+
addEntry(host, media, spec, forced) {
|
|
1068
|
+
if (this.entries.has(host)) return;
|
|
1069
|
+
const preset = spec.preset ?? inheritedPreset(host) ?? this.resolved.preset;
|
|
1070
|
+
const entry = {
|
|
1071
|
+
host,
|
|
1072
|
+
media,
|
|
1073
|
+
spec,
|
|
1074
|
+
preset,
|
|
1075
|
+
forced,
|
|
1076
|
+
state: "pending",
|
|
1077
|
+
overlay: null,
|
|
1078
|
+
container: null,
|
|
1079
|
+
timer: null,
|
|
1080
|
+
guard: null,
|
|
1081
|
+
hideTimer: null,
|
|
1082
|
+
fadeTimer: null,
|
|
1083
|
+
shownAt: 0,
|
|
1084
|
+
cleanup: []
|
|
1085
|
+
};
|
|
1086
|
+
this.entries.set(host, entry);
|
|
1087
|
+
this.stats.total++;
|
|
1088
|
+
const delay = this.resolved.delay;
|
|
1089
|
+
if (delay <= 0) this.paint(entry);
|
|
1090
|
+
else entry.timer = setTimeout(() => this.paint(entry), delay);
|
|
1091
|
+
if (this.resolved.maxWait > 0) {
|
|
1092
|
+
entry.guard = setTimeout(() => this.finish(entry), this.resolved.maxWait + delay);
|
|
1093
|
+
}
|
|
1094
|
+
if (media) {
|
|
1095
|
+
const done = () => this.finish(entry);
|
|
1096
|
+
host.addEventListener("load", done, { once: true });
|
|
1097
|
+
host.addEventListener("error", done, { once: true });
|
|
1098
|
+
entry.cleanup.push(() => {
|
|
1099
|
+
host.removeEventListener("load", done);
|
|
1100
|
+
host.removeEventListener("error", done);
|
|
1101
|
+
});
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
paint(entry) {
|
|
1105
|
+
if (entry.state !== "pending") return;
|
|
1106
|
+
const host = entry.host;
|
|
1107
|
+
if (entry.media) {
|
|
1108
|
+
if (isLoadedMedia(host) && !entry.forced) {
|
|
1109
|
+
this.finish(entry);
|
|
1110
|
+
return;
|
|
1111
|
+
}
|
|
1112
|
+
} else if (!entry.forced && hasRealContent(host)) {
|
|
1113
|
+
this.finish(entry);
|
|
1114
|
+
return;
|
|
1115
|
+
}
|
|
1116
|
+
const overlay = buildOverlay({
|
|
1117
|
+
host,
|
|
1118
|
+
spec: entry.spec,
|
|
1119
|
+
media: entry.media,
|
|
1120
|
+
preset: entry.preset,
|
|
1121
|
+
theme: this.themeOf(host)
|
|
1122
|
+
});
|
|
1123
|
+
if (entry.media) this.mountMedia(entry, overlay);
|
|
1124
|
+
else this.mountContainer(entry, overlay);
|
|
1125
|
+
entry.overlay = overlay;
|
|
1126
|
+
entry.state = "shown";
|
|
1127
|
+
entry.shownAt = now();
|
|
1128
|
+
this.stats.shown++;
|
|
1129
|
+
if (this.resolved.debug) overlay.setAttribute("data-skl-debug", "");
|
|
1130
|
+
void overlay.offsetWidth;
|
|
1131
|
+
overlay.dataset.sklShow = "1";
|
|
1132
|
+
this.resolved.onShow?.(host);
|
|
1133
|
+
}
|
|
1134
|
+
mountContainer(entry, overlay) {
|
|
1135
|
+
const host = entry.host;
|
|
1136
|
+
host.classList.add("skl-host");
|
|
1137
|
+
host.dataset.sklShape = entry.spec.shape;
|
|
1138
|
+
host.dataset.sklState = "loading";
|
|
1139
|
+
host.appendChild(overlay);
|
|
1140
|
+
if (entry.spec.height) {
|
|
1141
|
+
entry.prevMinHeight = host.style.minHeight;
|
|
1142
|
+
host.style.minHeight = `${entry.spec.height}px`;
|
|
1143
|
+
} else if (overlay.dataset.sklLayout !== "mirror") {
|
|
1144
|
+
const reserved = this.measure(overlay);
|
|
1145
|
+
if (reserved > 8) {
|
|
1146
|
+
const current = host.getBoundingClientRect().height;
|
|
1147
|
+
if (reserved > current + 2) {
|
|
1148
|
+
entry.prevMinHeight = host.style.minHeight;
|
|
1149
|
+
host.style.minHeight = `${Math.ceil(reserved)}px`;
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
if (entry.spec.shape === "auto" && typeof ResizeObserver !== "undefined") {
|
|
1154
|
+
const ro = new ResizeObserver(() => this.repaint(entry));
|
|
1155
|
+
ro.observe(host);
|
|
1156
|
+
entry.cleanup.push(() => ro.disconnect());
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
measure(overlay) {
|
|
1160
|
+
const host = overlay.parentElement;
|
|
1161
|
+
overlay.dataset.sklMeasure = "";
|
|
1162
|
+
if (host && host.clientWidth > 0) overlay.style.width = `${host.clientWidth}px`;
|
|
1163
|
+
const height = overlay.getBoundingClientRect().height;
|
|
1164
|
+
overlay.style.removeProperty("width");
|
|
1165
|
+
delete overlay.dataset.sklMeasure;
|
|
1166
|
+
return height;
|
|
1167
|
+
}
|
|
1168
|
+
mountMedia(entry, overlay) {
|
|
1169
|
+
const host = entry.host;
|
|
1170
|
+
const parent = host.parentElement;
|
|
1171
|
+
if (!parent) return;
|
|
1172
|
+
let position = "";
|
|
1173
|
+
try {
|
|
1174
|
+
position = getComputedStyle(parent).position;
|
|
1175
|
+
} catch {
|
|
1176
|
+
position = "static";
|
|
1177
|
+
}
|
|
1178
|
+
if (position === "static") {
|
|
1179
|
+
entry.prevParentPosition = parent.style.position;
|
|
1180
|
+
parent.style.position = "relative";
|
|
1181
|
+
overlay.dataset.sklPatched = "1";
|
|
1182
|
+
}
|
|
1183
|
+
parent.appendChild(overlay);
|
|
1184
|
+
entry.container = parent;
|
|
1185
|
+
entry.prevVisibility = host.style.visibility;
|
|
1186
|
+
host.style.visibility = "hidden";
|
|
1187
|
+
const sync = () => {
|
|
1188
|
+
if (!overlay.isConnected) return;
|
|
1189
|
+
const parentRect = parent.getBoundingClientRect();
|
|
1190
|
+
const rect = host.getBoundingClientRect();
|
|
1191
|
+
overlay.style.left = `${rect.left - parentRect.left - parent.clientLeft}px`;
|
|
1192
|
+
overlay.style.top = `${rect.top - parentRect.top - parent.clientTop}px`;
|
|
1193
|
+
overlay.style.width = `${rect.width}px`;
|
|
1194
|
+
overlay.style.height = `${rect.height}px`;
|
|
1195
|
+
};
|
|
1196
|
+
sync();
|
|
1197
|
+
if (typeof ResizeObserver !== "undefined") {
|
|
1198
|
+
const ro = new ResizeObserver(sync);
|
|
1199
|
+
ro.observe(host);
|
|
1200
|
+
ro.observe(parent);
|
|
1201
|
+
entry.cleanup.push(() => ro.disconnect());
|
|
1202
|
+
}
|
|
1203
|
+
if (typeof window !== "undefined") {
|
|
1204
|
+
window.addEventListener("resize", sync);
|
|
1205
|
+
entry.cleanup.push(() => window.removeEventListener("resize", sync));
|
|
1206
|
+
}
|
|
1207
|
+
entry.cleanup.push(() => {
|
|
1208
|
+
if (overlay.dataset.sklPatched) parent.style.position = entry.prevParentPosition ?? "";
|
|
1209
|
+
if (entry.prevVisibility !== void 0) host.style.visibility = entry.prevVisibility;
|
|
1210
|
+
});
|
|
1211
|
+
}
|
|
1212
|
+
repaint(entry) {
|
|
1213
|
+
if (entry.state !== "shown" || !entry.overlay || !entry.overlay.isConnected) return;
|
|
1214
|
+
const overlay = buildOverlay({
|
|
1215
|
+
host: entry.host,
|
|
1216
|
+
spec: entry.spec,
|
|
1217
|
+
media: entry.media,
|
|
1218
|
+
preset: entry.preset,
|
|
1219
|
+
theme: this.themeOf(entry.host)
|
|
1220
|
+
});
|
|
1221
|
+
overlay.dataset.sklShow = "1";
|
|
1222
|
+
if (this.resolved.debug) overlay.setAttribute("data-skl-debug", "");
|
|
1223
|
+
entry.overlay.replaceWith(overlay);
|
|
1224
|
+
entry.overlay = overlay;
|
|
1225
|
+
}
|
|
1226
|
+
finish(entry) {
|
|
1227
|
+
if (entry.state === "done") return;
|
|
1228
|
+
const wasShown = entry.state === "shown";
|
|
1229
|
+
entry.state = "done";
|
|
1230
|
+
this.clearTimers(entry);
|
|
1231
|
+
const wait = wasShown ? Math.max(0, this.resolved.minVisible - (now() - entry.shownAt)) : 0;
|
|
1232
|
+
if (!entry.overlay) {
|
|
1233
|
+
this.teardown(entry, false);
|
|
1234
|
+
return;
|
|
1235
|
+
}
|
|
1236
|
+
entry.hideTimer = setTimeout(() => this.teardown(entry, false), wait);
|
|
1237
|
+
}
|
|
1238
|
+
teardown(entry, immediate) {
|
|
1239
|
+
this.entries.delete(entry.host);
|
|
1240
|
+
this.clearTimers(entry);
|
|
1241
|
+
for (const fn of entry.cleanup) {
|
|
1242
|
+
try {
|
|
1243
|
+
fn();
|
|
1244
|
+
} catch {
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
entry.cleanup = [];
|
|
1248
|
+
const host = entry.host;
|
|
1249
|
+
if (entry.prevMinHeight !== void 0) host.style.minHeight = entry.prevMinHeight;
|
|
1250
|
+
host.classList.remove("skl-host");
|
|
1251
|
+
if (!entry.overlay) {
|
|
1252
|
+
if (host.dataset.sklState === "loading") delete host.dataset.sklState;
|
|
1253
|
+
delete host.dataset.sklShape;
|
|
1254
|
+
return;
|
|
1255
|
+
}
|
|
1256
|
+
const overlay = entry.overlay;
|
|
1257
|
+
host.dataset.sklState = "done";
|
|
1258
|
+
const cleanup = () => {
|
|
1259
|
+
overlay.remove();
|
|
1260
|
+
if (host.dataset.sklState === "done") delete host.dataset.sklState;
|
|
1261
|
+
delete host.dataset.sklShape;
|
|
1262
|
+
overlay.remove();
|
|
1263
|
+
};
|
|
1264
|
+
if (immediate || this.prefersReducedMotion()) {
|
|
1265
|
+
cleanup();
|
|
1266
|
+
} else {
|
|
1267
|
+
overlay.dataset.sklShow = "0";
|
|
1268
|
+
entry.fadeTimer = setTimeout(cleanup, 220);
|
|
1269
|
+
}
|
|
1270
|
+
this.stats.hidden++;
|
|
1271
|
+
this.resolved.onHide?.(host);
|
|
1272
|
+
if (this.started) setTimeout(() => this.scan(host), 0);
|
|
1273
|
+
}
|
|
1274
|
+
themeOf(host) {
|
|
1275
|
+
return inheritedTheme(host) ?? this.resolved.theme;
|
|
1276
|
+
}
|
|
1277
|
+
prefersReducedMotion() {
|
|
1278
|
+
if (!this.resolved.respectReducedMotion || typeof matchMedia !== "function") return false;
|
|
1279
|
+
try {
|
|
1280
|
+
return matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
1281
|
+
} catch {
|
|
1282
|
+
return false;
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
clearTimers(entry) {
|
|
1286
|
+
if (entry.timer) clearTimeout(entry.timer);
|
|
1287
|
+
if (entry.guard) clearTimeout(entry.guard);
|
|
1288
|
+
if (entry.hideTimer) clearTimeout(entry.hideTimer);
|
|
1289
|
+
entry.timer = null;
|
|
1290
|
+
entry.guard = null;
|
|
1291
|
+
entry.hideTimer = null;
|
|
1292
|
+
}
|
|
1293
|
+
};
|
|
1294
|
+
|
|
1295
|
+
// src/core/singleton.ts
|
|
1296
|
+
var KEY = /* @__PURE__ */ Symbol.for("skeleton-load:default");
|
|
1297
|
+
function bag() {
|
|
1298
|
+
const root = globalThis;
|
|
1299
|
+
if (!root[KEY]) root[KEY] = {};
|
|
1300
|
+
return root[KEY];
|
|
1301
|
+
}
|
|
1302
|
+
function getEngine(options) {
|
|
1303
|
+
const holder = bag();
|
|
1304
|
+
if (!holder.engine) holder.engine = new SkeletonEngine(options);
|
|
1305
|
+
else if (options) holder.engine.update(options);
|
|
1306
|
+
return holder.engine;
|
|
1307
|
+
}
|
|
1308
|
+
function ensureStarted(options) {
|
|
1309
|
+
const engine = getEngine(options);
|
|
1310
|
+
return engine.start();
|
|
1311
|
+
}
|
|
1312
|
+
function createSkeletonLoad(options) {
|
|
1313
|
+
return new SkeletonEngine(options);
|
|
1314
|
+
}
|
|
1315
|
+
var skeletonLoad = {
|
|
1316
|
+
start(options) {
|
|
1317
|
+
return ensureStarted(options);
|
|
1318
|
+
},
|
|
1319
|
+
stop() {
|
|
1320
|
+
return getEngine().stop();
|
|
1321
|
+
},
|
|
1322
|
+
refresh(root) {
|
|
1323
|
+
return getEngine().refresh(root);
|
|
1324
|
+
},
|
|
1325
|
+
update(options) {
|
|
1326
|
+
return getEngine().update(options);
|
|
1327
|
+
},
|
|
1328
|
+
setPreset(preset) {
|
|
1329
|
+
return getEngine().setPreset(preset);
|
|
1330
|
+
},
|
|
1331
|
+
get engine() {
|
|
1332
|
+
return getEngine();
|
|
1333
|
+
}
|
|
1334
|
+
};
|
|
1335
|
+
|
|
1336
|
+
export { createSkeletonLoad, css_generated_default as cssText, ensureStarted, getEngine, normalizePreset, normalizeShape, readSpec, skeletonLoad };
|
|
1337
|
+
//# sourceMappingURL=index.js.map
|
|
1338
|
+
//# sourceMappingURL=index.js.map
|