skeleton-ghost-loader 2.6.1 → 2.6.3
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/dist/skeleton-loader.es.js +68 -670
- package/dist/skeleton-loader.umd.js +97 -31
- package/package.json +1 -1
|
@@ -1,684 +1,82 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @license React
|
|
6
|
-
* react-jsx-runtime.production.min.js
|
|
7
|
-
*
|
|
8
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the MIT license found in the
|
|
11
|
-
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/
|
|
13
|
-
var Oe;
|
|
14
|
-
function vr() {
|
|
15
|
-
if (Oe) return I;
|
|
16
|
-
Oe = 1;
|
|
17
|
-
var p = Pe, R = Symbol.for("react.element"), _ = Symbol.for("react.fragment"), l = Object.prototype.hasOwnProperty, f = p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
-
function T(h, v, S) {
|
|
19
|
-
var g, w = {}, O = null, W = null;
|
|
20
|
-
S !== void 0 && (O = "" + S), v.key !== void 0 && (O = "" + v.key), v.ref !== void 0 && (W = v.ref);
|
|
21
|
-
for (g in v) l.call(v, g) && !s.hasOwnProperty(g) && (w[g] = v[g]);
|
|
22
|
-
if (h && h.defaultProps) for (g in v = h.defaultProps, v) w[g] === void 0 && (w[g] = v[g]);
|
|
23
|
-
return { $$typeof: R, type: h, key: O, ref: W, props: w, _owner: f.current };
|
|
24
|
-
}
|
|
25
|
-
return I.Fragment = _, I.jsx = T, I.jsxs = T, I;
|
|
26
|
-
}
|
|
27
|
-
var $ = {};
|
|
28
|
-
/**
|
|
29
|
-
* @license React
|
|
30
|
-
* react-jsx-runtime.development.js
|
|
31
|
-
*
|
|
32
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the MIT license found in the
|
|
35
|
-
* LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/
|
|
37
|
-
var xe;
|
|
38
|
-
function pr() {
|
|
39
|
-
return xe || (xe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
40
|
-
var p = Pe, R = Symbol.for("react.element"), _ = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), f = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), T = Symbol.for("react.provider"), h = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), S = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), W = Symbol.for("react.offscreen"), re = Symbol.iterator, ke = "@@iterator";
|
|
41
|
-
function je(e) {
|
|
42
|
-
if (e === null || typeof e != "object")
|
|
43
|
-
return null;
|
|
44
|
-
var r = re && e[re] || e[ke];
|
|
45
|
-
return typeof r == "function" ? r : null;
|
|
46
|
-
}
|
|
47
|
-
var k = p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
48
|
-
function y(e) {
|
|
49
|
-
{
|
|
50
|
-
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
51
|
-
t[n - 1] = arguments[n];
|
|
52
|
-
Fe("error", e, t);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function Fe(e, r, t) {
|
|
56
|
-
{
|
|
57
|
-
var n = k.ReactDebugCurrentFrame, o = n.getStackAddendum();
|
|
58
|
-
o !== "" && (r += "%s", t = t.concat([o]));
|
|
59
|
-
var u = t.map(function(i) {
|
|
60
|
-
return String(i);
|
|
61
|
-
});
|
|
62
|
-
u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
var De = !1, Ae = !1, Ie = !1, $e = !1, We = !1, te;
|
|
66
|
-
te = Symbol.for("react.module.reference");
|
|
67
|
-
function Ye(e) {
|
|
68
|
-
return !!(typeof e == "string" || typeof e == "function" || e === l || e === s || We || e === f || e === S || e === g || $e || e === W || De || Ae || Ie || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === w || e.$$typeof === T || e.$$typeof === h || e.$$typeof === v || // This needs to include all possible module reference object
|
|
69
|
-
// types supported by any Flight configuration anywhere since
|
|
70
|
-
// we don't know which Flight build this will end up being used
|
|
71
|
-
// with.
|
|
72
|
-
e.$$typeof === te || e.getModuleId !== void 0));
|
|
73
|
-
}
|
|
74
|
-
function Ne(e, r, t) {
|
|
75
|
-
var n = e.displayName;
|
|
76
|
-
if (n)
|
|
77
|
-
return n;
|
|
78
|
-
var o = r.displayName || r.name || "";
|
|
79
|
-
return o !== "" ? t + "(" + o + ")" : t;
|
|
80
|
-
}
|
|
81
|
-
function ne(e) {
|
|
82
|
-
return e.displayName || "Context";
|
|
83
|
-
}
|
|
84
|
-
function C(e) {
|
|
85
|
-
if (e == null)
|
|
86
|
-
return null;
|
|
87
|
-
if (typeof e.tag == "number" && y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
88
|
-
return e.displayName || e.name || null;
|
|
89
|
-
if (typeof e == "string")
|
|
90
|
-
return e;
|
|
91
|
-
switch (e) {
|
|
92
|
-
case l:
|
|
93
|
-
return "Fragment";
|
|
94
|
-
case _:
|
|
95
|
-
return "Portal";
|
|
96
|
-
case s:
|
|
97
|
-
return "Profiler";
|
|
98
|
-
case f:
|
|
99
|
-
return "StrictMode";
|
|
100
|
-
case S:
|
|
101
|
-
return "Suspense";
|
|
102
|
-
case g:
|
|
103
|
-
return "SuspenseList";
|
|
104
|
-
}
|
|
105
|
-
if (typeof e == "object")
|
|
106
|
-
switch (e.$$typeof) {
|
|
107
|
-
case h:
|
|
108
|
-
var r = e;
|
|
109
|
-
return ne(r) + ".Consumer";
|
|
110
|
-
case T:
|
|
111
|
-
var t = e;
|
|
112
|
-
return ne(t._context) + ".Provider";
|
|
113
|
-
case v:
|
|
114
|
-
return Ne(e, e.render, "ForwardRef");
|
|
115
|
-
case w:
|
|
116
|
-
var n = e.displayName || null;
|
|
117
|
-
return n !== null ? n : C(e.type) || "Memo";
|
|
118
|
-
case O: {
|
|
119
|
-
var o = e, u = o._payload, i = o._init;
|
|
120
|
-
try {
|
|
121
|
-
return C(i(u));
|
|
122
|
-
} catch {
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
var x = Object.assign, D = 0, ae, ie, oe, se, ue, le, fe;
|
|
130
|
-
function ce() {
|
|
131
|
-
}
|
|
132
|
-
ce.__reactDisabledLog = !0;
|
|
133
|
-
function Ve() {
|
|
134
|
-
{
|
|
135
|
-
if (D === 0) {
|
|
136
|
-
ae = console.log, ie = console.info, oe = console.warn, se = console.error, ue = console.group, le = console.groupCollapsed, fe = console.groupEnd;
|
|
137
|
-
var e = {
|
|
138
|
-
configurable: !0,
|
|
139
|
-
enumerable: !0,
|
|
140
|
-
value: ce,
|
|
141
|
-
writable: !0
|
|
142
|
-
};
|
|
143
|
-
Object.defineProperties(console, {
|
|
144
|
-
info: e,
|
|
145
|
-
log: e,
|
|
146
|
-
warn: e,
|
|
147
|
-
error: e,
|
|
148
|
-
group: e,
|
|
149
|
-
groupCollapsed: e,
|
|
150
|
-
groupEnd: e
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
D++;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
function Le() {
|
|
157
|
-
{
|
|
158
|
-
if (D--, D === 0) {
|
|
159
|
-
var e = {
|
|
160
|
-
configurable: !0,
|
|
161
|
-
enumerable: !0,
|
|
162
|
-
writable: !0
|
|
163
|
-
};
|
|
164
|
-
Object.defineProperties(console, {
|
|
165
|
-
log: x({}, e, {
|
|
166
|
-
value: ae
|
|
167
|
-
}),
|
|
168
|
-
info: x({}, e, {
|
|
169
|
-
value: ie
|
|
170
|
-
}),
|
|
171
|
-
warn: x({}, e, {
|
|
172
|
-
value: oe
|
|
173
|
-
}),
|
|
174
|
-
error: x({}, e, {
|
|
175
|
-
value: se
|
|
176
|
-
}),
|
|
177
|
-
group: x({}, e, {
|
|
178
|
-
value: ue
|
|
179
|
-
}),
|
|
180
|
-
groupCollapsed: x({}, e, {
|
|
181
|
-
value: le
|
|
182
|
-
}),
|
|
183
|
-
groupEnd: x({}, e, {
|
|
184
|
-
value: fe
|
|
185
|
-
})
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
D < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
var z = k.ReactCurrentDispatcher, B;
|
|
192
|
-
function Y(e, r, t) {
|
|
193
|
-
{
|
|
194
|
-
if (B === void 0)
|
|
195
|
-
try {
|
|
196
|
-
throw Error();
|
|
197
|
-
} catch (o) {
|
|
198
|
-
var n = o.stack.trim().match(/\n( *(at )?)/);
|
|
199
|
-
B = n && n[1] || "";
|
|
200
|
-
}
|
|
201
|
-
return `
|
|
202
|
-
` + B + e;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
var q = !1, N;
|
|
206
|
-
{
|
|
207
|
-
var Me = typeof WeakMap == "function" ? WeakMap : Map;
|
|
208
|
-
N = new Me();
|
|
209
|
-
}
|
|
210
|
-
function de(e, r) {
|
|
211
|
-
if (!e || q)
|
|
212
|
-
return "";
|
|
213
|
-
{
|
|
214
|
-
var t = N.get(e);
|
|
215
|
-
if (t !== void 0)
|
|
216
|
-
return t;
|
|
217
|
-
}
|
|
218
|
-
var n;
|
|
219
|
-
q = !0;
|
|
220
|
-
var o = Error.prepareStackTrace;
|
|
221
|
-
Error.prepareStackTrace = void 0;
|
|
222
|
-
var u;
|
|
223
|
-
u = z.current, z.current = null, Ve();
|
|
224
|
-
try {
|
|
225
|
-
if (r) {
|
|
226
|
-
var i = function() {
|
|
227
|
-
throw Error();
|
|
228
|
-
};
|
|
229
|
-
if (Object.defineProperty(i.prototype, "props", {
|
|
230
|
-
set: function() {
|
|
231
|
-
throw Error();
|
|
232
|
-
}
|
|
233
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
|
234
|
-
try {
|
|
235
|
-
Reflect.construct(i, []);
|
|
236
|
-
} catch (b) {
|
|
237
|
-
n = b;
|
|
238
|
-
}
|
|
239
|
-
Reflect.construct(e, [], i);
|
|
240
|
-
} else {
|
|
241
|
-
try {
|
|
242
|
-
i.call();
|
|
243
|
-
} catch (b) {
|
|
244
|
-
n = b;
|
|
245
|
-
}
|
|
246
|
-
e.call(i.prototype);
|
|
247
|
-
}
|
|
248
|
-
} else {
|
|
249
|
-
try {
|
|
250
|
-
throw Error();
|
|
251
|
-
} catch (b) {
|
|
252
|
-
n = b;
|
|
253
|
-
}
|
|
254
|
-
e();
|
|
255
|
-
}
|
|
256
|
-
} catch (b) {
|
|
257
|
-
if (b && n && typeof b.stack == "string") {
|
|
258
|
-
for (var a = b.stack.split(`
|
|
259
|
-
`), m = n.stack.split(`
|
|
260
|
-
`), c = a.length - 1, d = m.length - 1; c >= 1 && d >= 0 && a[c] !== m[d]; )
|
|
261
|
-
d--;
|
|
262
|
-
for (; c >= 1 && d >= 0; c--, d--)
|
|
263
|
-
if (a[c] !== m[d]) {
|
|
264
|
-
if (c !== 1 || d !== 1)
|
|
265
|
-
do
|
|
266
|
-
if (c--, d--, d < 0 || a[c] !== m[d]) {
|
|
267
|
-
var E = `
|
|
268
|
-
` + a[c].replace(" at new ", " at ");
|
|
269
|
-
return e.displayName && E.includes("<anonymous>") && (E = E.replace("<anonymous>", e.displayName)), typeof e == "function" && N.set(e, E), E;
|
|
270
|
-
}
|
|
271
|
-
while (c >= 1 && d >= 0);
|
|
272
|
-
break;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
} finally {
|
|
276
|
-
q = !1, z.current = u, Le(), Error.prepareStackTrace = o;
|
|
277
|
-
}
|
|
278
|
-
var F = e ? e.displayName || e.name : "", P = F ? Y(F) : "";
|
|
279
|
-
return typeof e == "function" && N.set(e, P), P;
|
|
280
|
-
}
|
|
281
|
-
function Ue(e, r, t) {
|
|
282
|
-
return de(e, !1);
|
|
283
|
-
}
|
|
284
|
-
function ze(e) {
|
|
285
|
-
var r = e.prototype;
|
|
286
|
-
return !!(r && r.isReactComponent);
|
|
287
|
-
}
|
|
288
|
-
function V(e, r, t) {
|
|
289
|
-
if (e == null)
|
|
290
|
-
return "";
|
|
291
|
-
if (typeof e == "function")
|
|
292
|
-
return de(e, ze(e));
|
|
293
|
-
if (typeof e == "string")
|
|
294
|
-
return Y(e);
|
|
295
|
-
switch (e) {
|
|
296
|
-
case S:
|
|
297
|
-
return Y("Suspense");
|
|
298
|
-
case g:
|
|
299
|
-
return Y("SuspenseList");
|
|
300
|
-
}
|
|
301
|
-
if (typeof e == "object")
|
|
302
|
-
switch (e.$$typeof) {
|
|
303
|
-
case v:
|
|
304
|
-
return Ue(e.render);
|
|
305
|
-
case w:
|
|
306
|
-
return V(e.type, r, t);
|
|
307
|
-
case O: {
|
|
308
|
-
var n = e, o = n._payload, u = n._init;
|
|
309
|
-
try {
|
|
310
|
-
return V(u(o), r, t);
|
|
311
|
-
} catch {
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
return "";
|
|
316
|
-
}
|
|
317
|
-
var A = Object.prototype.hasOwnProperty, ve = {}, pe = k.ReactDebugCurrentFrame;
|
|
318
|
-
function L(e) {
|
|
319
|
-
if (e) {
|
|
320
|
-
var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
|
|
321
|
-
pe.setExtraStackFrame(t);
|
|
322
|
-
} else
|
|
323
|
-
pe.setExtraStackFrame(null);
|
|
324
|
-
}
|
|
325
|
-
function Be(e, r, t, n, o) {
|
|
326
|
-
{
|
|
327
|
-
var u = Function.call.bind(A);
|
|
328
|
-
for (var i in e)
|
|
329
|
-
if (u(e, i)) {
|
|
330
|
-
var a = void 0;
|
|
331
|
-
try {
|
|
332
|
-
if (typeof e[i] != "function") {
|
|
333
|
-
var m = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
334
|
-
throw m.name = "Invariant Violation", m;
|
|
335
|
-
}
|
|
336
|
-
a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
337
|
-
} catch (c) {
|
|
338
|
-
a = c;
|
|
339
|
-
}
|
|
340
|
-
a && !(a instanceof Error) && (L(o), y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), L(null)), a instanceof Error && !(a.message in ve) && (ve[a.message] = !0, L(o), y("Failed %s type: %s", t, a.message), L(null));
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
var qe = Array.isArray;
|
|
345
|
-
function J(e) {
|
|
346
|
-
return qe(e);
|
|
347
|
-
}
|
|
348
|
-
function Je(e) {
|
|
349
|
-
{
|
|
350
|
-
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
351
|
-
return t;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
function Ke(e) {
|
|
355
|
-
try {
|
|
356
|
-
return he(e), !1;
|
|
357
|
-
} catch {
|
|
358
|
-
return !0;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
function he(e) {
|
|
362
|
-
return "" + e;
|
|
363
|
-
}
|
|
364
|
-
function ge(e) {
|
|
365
|
-
if (Ke(e))
|
|
366
|
-
return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), he(e);
|
|
367
|
-
}
|
|
368
|
-
var ye = k.ReactCurrentOwner, Ge = {
|
|
369
|
-
key: !0,
|
|
370
|
-
ref: !0,
|
|
371
|
-
__self: !0,
|
|
372
|
-
__source: !0
|
|
373
|
-
}, me, be;
|
|
374
|
-
function Xe(e) {
|
|
375
|
-
if (A.call(e, "ref")) {
|
|
376
|
-
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
377
|
-
if (r && r.isReactWarning)
|
|
378
|
-
return !1;
|
|
379
|
-
}
|
|
380
|
-
return e.ref !== void 0;
|
|
381
|
-
}
|
|
382
|
-
function He(e) {
|
|
383
|
-
if (A.call(e, "key")) {
|
|
384
|
-
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
385
|
-
if (r && r.isReactWarning)
|
|
386
|
-
return !1;
|
|
387
|
-
}
|
|
388
|
-
return e.key !== void 0;
|
|
389
|
-
}
|
|
390
|
-
function Ze(e, r) {
|
|
391
|
-
typeof e.ref == "string" && ye.current;
|
|
392
|
-
}
|
|
393
|
-
function Qe(e, r) {
|
|
394
|
-
{
|
|
395
|
-
var t = function() {
|
|
396
|
-
me || (me = !0, y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
397
|
-
};
|
|
398
|
-
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
399
|
-
get: t,
|
|
400
|
-
configurable: !0
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
function er(e, r) {
|
|
405
|
-
{
|
|
406
|
-
var t = function() {
|
|
407
|
-
be || (be = !0, y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
408
|
-
};
|
|
409
|
-
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
410
|
-
get: t,
|
|
411
|
-
configurable: !0
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
var rr = function(e, r, t, n, o, u, i) {
|
|
416
|
-
var a = {
|
|
417
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
418
|
-
$$typeof: R,
|
|
419
|
-
// Built-in properties that belong on the element
|
|
420
|
-
type: e,
|
|
421
|
-
key: r,
|
|
422
|
-
ref: t,
|
|
423
|
-
props: i,
|
|
424
|
-
// Record the component responsible for creating this element.
|
|
425
|
-
_owner: u
|
|
426
|
-
};
|
|
427
|
-
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
428
|
-
configurable: !1,
|
|
429
|
-
enumerable: !1,
|
|
430
|
-
writable: !0,
|
|
431
|
-
value: !1
|
|
432
|
-
}), Object.defineProperty(a, "_self", {
|
|
433
|
-
configurable: !1,
|
|
434
|
-
enumerable: !1,
|
|
435
|
-
writable: !1,
|
|
436
|
-
value: n
|
|
437
|
-
}), Object.defineProperty(a, "_source", {
|
|
438
|
-
configurable: !1,
|
|
439
|
-
enumerable: !1,
|
|
440
|
-
writable: !1,
|
|
441
|
-
value: o
|
|
442
|
-
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
443
|
-
};
|
|
444
|
-
function tr(e, r, t, n, o) {
|
|
445
|
-
{
|
|
446
|
-
var u, i = {}, a = null, m = null;
|
|
447
|
-
t !== void 0 && (ge(t), a = "" + t), He(r) && (ge(r.key), a = "" + r.key), Xe(r) && (m = r.ref, Ze(r, o));
|
|
448
|
-
for (u in r)
|
|
449
|
-
A.call(r, u) && !Ge.hasOwnProperty(u) && (i[u] = r[u]);
|
|
450
|
-
if (e && e.defaultProps) {
|
|
451
|
-
var c = e.defaultProps;
|
|
452
|
-
for (u in c)
|
|
453
|
-
i[u] === void 0 && (i[u] = c[u]);
|
|
454
|
-
}
|
|
455
|
-
if (a || m) {
|
|
456
|
-
var d = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
457
|
-
a && Qe(i, d), m && er(i, d);
|
|
458
|
-
}
|
|
459
|
-
return rr(e, a, m, o, n, ye.current, i);
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
var K = k.ReactCurrentOwner, Ee = k.ReactDebugCurrentFrame;
|
|
463
|
-
function j(e) {
|
|
464
|
-
if (e) {
|
|
465
|
-
var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
|
|
466
|
-
Ee.setExtraStackFrame(t);
|
|
467
|
-
} else
|
|
468
|
-
Ee.setExtraStackFrame(null);
|
|
469
|
-
}
|
|
470
|
-
var G;
|
|
471
|
-
G = !1;
|
|
472
|
-
function X(e) {
|
|
473
|
-
return typeof e == "object" && e !== null && e.$$typeof === R;
|
|
474
|
-
}
|
|
475
|
-
function Re() {
|
|
476
|
-
{
|
|
477
|
-
if (K.current) {
|
|
478
|
-
var e = C(K.current.type);
|
|
479
|
-
if (e)
|
|
480
|
-
return `
|
|
481
|
-
|
|
482
|
-
Check the render method of \`` + e + "`.";
|
|
483
|
-
}
|
|
484
|
-
return "";
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
function nr(e) {
|
|
488
|
-
return "";
|
|
489
|
-
}
|
|
490
|
-
var _e = {};
|
|
491
|
-
function ar(e) {
|
|
492
|
-
{
|
|
493
|
-
var r = Re();
|
|
494
|
-
if (!r) {
|
|
495
|
-
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
496
|
-
t && (r = `
|
|
497
|
-
|
|
498
|
-
Check the top-level render call using <` + t + ">.");
|
|
499
|
-
}
|
|
500
|
-
return r;
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
function Te(e, r) {
|
|
504
|
-
{
|
|
505
|
-
if (!e._store || e._store.validated || e.key != null)
|
|
506
|
-
return;
|
|
507
|
-
e._store.validated = !0;
|
|
508
|
-
var t = ar(r);
|
|
509
|
-
if (_e[t])
|
|
510
|
-
return;
|
|
511
|
-
_e[t] = !0;
|
|
512
|
-
var n = "";
|
|
513
|
-
e && e._owner && e._owner !== K.current && (n = " It was passed a child from " + C(e._owner.type) + "."), j(e), y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), j(null);
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
function Se(e, r) {
|
|
517
|
-
{
|
|
518
|
-
if (typeof e != "object")
|
|
519
|
-
return;
|
|
520
|
-
if (J(e))
|
|
521
|
-
for (var t = 0; t < e.length; t++) {
|
|
522
|
-
var n = e[t];
|
|
523
|
-
X(n) && Te(n, r);
|
|
524
|
-
}
|
|
525
|
-
else if (X(e))
|
|
526
|
-
e._store && (e._store.validated = !0);
|
|
527
|
-
else if (e) {
|
|
528
|
-
var o = je(e);
|
|
529
|
-
if (typeof o == "function" && o !== e.entries)
|
|
530
|
-
for (var u = o.call(e), i; !(i = u.next()).done; )
|
|
531
|
-
X(i.value) && Te(i.value, r);
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
function ir(e) {
|
|
536
|
-
{
|
|
537
|
-
var r = e.type;
|
|
538
|
-
if (r == null || typeof r == "string")
|
|
539
|
-
return;
|
|
540
|
-
var t;
|
|
541
|
-
if (typeof r == "function")
|
|
542
|
-
t = r.propTypes;
|
|
543
|
-
else if (typeof r == "object" && (r.$$typeof === v || // Note: Memo only checks outer props here.
|
|
544
|
-
// Inner props are checked in the reconciler.
|
|
545
|
-
r.$$typeof === w))
|
|
546
|
-
t = r.propTypes;
|
|
547
|
-
else
|
|
548
|
-
return;
|
|
549
|
-
if (t) {
|
|
550
|
-
var n = C(r);
|
|
551
|
-
Be(t, e.props, "prop", n, e);
|
|
552
|
-
} else if (r.PropTypes !== void 0 && !G) {
|
|
553
|
-
G = !0;
|
|
554
|
-
var o = C(r);
|
|
555
|
-
y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
|
|
556
|
-
}
|
|
557
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
function or(e) {
|
|
561
|
-
{
|
|
562
|
-
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
563
|
-
var n = r[t];
|
|
564
|
-
if (n !== "children" && n !== "key") {
|
|
565
|
-
j(e), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), j(null);
|
|
566
|
-
break;
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
e.ref !== null && (j(e), y("Invalid attribute `ref` supplied to `React.Fragment`."), j(null));
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
var we = {};
|
|
573
|
-
function Ce(e, r, t, n, o, u) {
|
|
574
|
-
{
|
|
575
|
-
var i = Ye(e);
|
|
576
|
-
if (!i) {
|
|
577
|
-
var a = "";
|
|
578
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
579
|
-
var m = nr();
|
|
580
|
-
m ? a += m : a += Re();
|
|
581
|
-
var c;
|
|
582
|
-
e === null ? c = "null" : J(e) ? c = "array" : e !== void 0 && e.$$typeof === R ? (c = "<" + (C(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : c = typeof e, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", c, a);
|
|
583
|
-
}
|
|
584
|
-
var d = tr(e, r, t, o, u);
|
|
585
|
-
if (d == null)
|
|
586
|
-
return d;
|
|
587
|
-
if (i) {
|
|
588
|
-
var E = r.children;
|
|
589
|
-
if (E !== void 0)
|
|
590
|
-
if (n)
|
|
591
|
-
if (J(E)) {
|
|
592
|
-
for (var F = 0; F < E.length; F++)
|
|
593
|
-
Se(E[F], e);
|
|
594
|
-
Object.freeze && Object.freeze(E);
|
|
595
|
-
} else
|
|
596
|
-
y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
597
|
-
else
|
|
598
|
-
Se(E, e);
|
|
599
|
-
}
|
|
600
|
-
if (A.call(r, "key")) {
|
|
601
|
-
var P = C(e), b = Object.keys(r).filter(function(dr) {
|
|
602
|
-
return dr !== "key";
|
|
603
|
-
}), H = b.length > 0 ? "{key: someKey, " + b.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
604
|
-
if (!we[P + H]) {
|
|
605
|
-
var cr = b.length > 0 ? "{" + b.join(": ..., ") + ": ...}" : "{}";
|
|
606
|
-
y(`A props object containing a "key" prop is being spread into JSX:
|
|
607
|
-
let props = %s;
|
|
608
|
-
<%s {...props} />
|
|
609
|
-
React keys must be passed directly to JSX without using spread:
|
|
610
|
-
let props = %s;
|
|
611
|
-
<%s key={someKey} {...props} />`, H, P, cr, P), we[P + H] = !0;
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
return e === l ? or(d) : ir(d), d;
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
function sr(e, r, t) {
|
|
618
|
-
return Ce(e, r, t, !0);
|
|
619
|
-
}
|
|
620
|
-
function ur(e, r, t) {
|
|
621
|
-
return Ce(e, r, t, !1);
|
|
622
|
-
}
|
|
623
|
-
var lr = ur, fr = sr;
|
|
624
|
-
$.Fragment = l, $.jsx = lr, $.jsxs = fr;
|
|
625
|
-
}()), $;
|
|
626
|
-
}
|
|
627
|
-
process.env.NODE_ENV === "production" ? ee.exports = vr() : ee.exports = pr();
|
|
628
|
-
var Z = ee.exports;
|
|
629
|
-
const U = {
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
const skeletonBgColors = {
|
|
630
4
|
text: "#ccc",
|
|
631
5
|
box: "#e0e0e0"
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
const
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
6
|
+
};
|
|
7
|
+
const styleCache = {};
|
|
8
|
+
function getComputedStyleFromNode(node) {
|
|
9
|
+
if (typeof document === "undefined") return {};
|
|
10
|
+
const type = typeof node.type === "string" ? node.type : "div";
|
|
11
|
+
const key = `${type}-${node.props.id || ""}-${node.props.className || ""}`;
|
|
12
|
+
if (styleCache[key]) return styleCache[key];
|
|
13
|
+
const el = document.createElement(type);
|
|
14
|
+
if (node.props.id) el.id = node.props.id;
|
|
15
|
+
if (node.props.className) el.className = node.props.className;
|
|
16
|
+
if (node.props.style) {
|
|
17
|
+
Object.entries(node.props.style).forEach(([k, v]) => {
|
|
18
|
+
el.style[k] = v;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
el.style.display = "none";
|
|
22
|
+
document.body.appendChild(el);
|
|
23
|
+
const cs = window.getComputedStyle(el);
|
|
24
|
+
const computed = {
|
|
25
|
+
height: cs.height || void 0,
|
|
26
|
+
width: cs.width || "100%",
|
|
27
|
+
fontSize: cs.fontSize || void 0,
|
|
28
|
+
margin: cs.margin || "0",
|
|
29
|
+
padding: cs.padding || "0",
|
|
30
|
+
borderRadius: cs.borderRadius || "4px"
|
|
648
31
|
};
|
|
649
|
-
|
|
32
|
+
document.body.removeChild(el);
|
|
33
|
+
styleCache[key] = computed;
|
|
34
|
+
return computed;
|
|
650
35
|
}
|
|
651
|
-
const
|
|
652
|
-
function
|
|
653
|
-
if (!
|
|
654
|
-
if (typeof
|
|
655
|
-
const
|
|
656
|
-
let
|
|
657
|
-
if (
|
|
658
|
-
const
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
36
|
+
const SkeletonBlock = ({ children }) => {
|
|
37
|
+
function traverse(node) {
|
|
38
|
+
if (!React.isValidElement(node)) return node;
|
|
39
|
+
if (typeof node.type === "string") {
|
|
40
|
+
const newProps = { ...node.props };
|
|
41
|
+
let style = { ...newProps.style };
|
|
42
|
+
if (newProps.skeletonrequired === "y") {
|
|
43
|
+
const defaults = getComputedStyleFromNode(node);
|
|
44
|
+
style.height = style.height || newProps.height || defaults.height || "20px";
|
|
45
|
+
style.width = style.width || newProps.width || defaults.width || "100%";
|
|
46
|
+
style.fontSize = style.fontSize || newProps.fontSize || defaults.fontSize || "16px";
|
|
47
|
+
style.margin = style.margin || newProps.margin || defaults.margin || "0";
|
|
48
|
+
style.padding = style.padding || newProps.padding || defaults.padding || "0";
|
|
49
|
+
style.borderRadius = style.borderRadius || defaults.borderRadius || "4px";
|
|
50
|
+
const type = node.type;
|
|
51
|
+
const isText = ["p", "span", "h1", "h2", "h3", "h4", "h5", "h6"].includes(type);
|
|
52
|
+
style.backgroundColor = isText ? skeletonBgColors.text : skeletonBgColors.box;
|
|
53
|
+
style.color = "transparent";
|
|
54
|
+
style.position = "relative";
|
|
55
|
+
style.overflow = "hidden";
|
|
56
|
+
const shimmerBase = isText ? skeletonBgColors.text : skeletonBgColors.box;
|
|
57
|
+
style.backgroundImage = `linear-gradient(90deg, ${shimmerBase} 0%, #f5f5f5 50%, ${shimmerBase} 100%)`;
|
|
58
|
+
style.backgroundSize = "200% 100%";
|
|
59
|
+
style.animation = "shimmer 1.5s infinite";
|
|
60
|
+
delete newProps.skeletonrequired;
|
|
61
|
+
newProps.style = style;
|
|
62
|
+
}
|
|
63
|
+
const childrenNodes = React.Children.map(node.props.children, traverse);
|
|
64
|
+
return React.cloneElement(node, newProps, childrenNodes);
|
|
65
|
+
}
|
|
66
|
+
return node;
|
|
669
67
|
}
|
|
670
|
-
const
|
|
671
|
-
return /* @__PURE__ */
|
|
672
|
-
/* @__PURE__ */
|
|
68
|
+
const result = React.Children.map(children, traverse);
|
|
69
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
70
|
+
/* @__PURE__ */ jsx("style", { children: `
|
|
673
71
|
@keyframes shimmer {
|
|
674
72
|
0% { background-position: -200% 0; }
|
|
675
73
|
100% { background-position: 200% 0; }
|
|
676
74
|
}
|
|
677
75
|
` }),
|
|
678
|
-
|
|
76
|
+
result
|
|
679
77
|
] });
|
|
680
78
|
};
|
|
681
79
|
export {
|
|
682
|
-
|
|
683
|
-
|
|
80
|
+
SkeletonBlock,
|
|
81
|
+
SkeletonBlock as default
|
|
684
82
|
};
|
|
@@ -1,35 +1,101 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
(function(global, factory) {
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("react")) : typeof define === "function" && define.amd ? define(["exports", "react/jsx-runtime", "react"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.SkeletonGhostLoader = {}, global.jsxRuntime, global.React));
|
|
3
|
+
})(this, function(exports2, jsxRuntime, React) {
|
|
4
|
+
"use strict";
|
|
5
|
+
function _interopNamespaceDefault(e) {
|
|
6
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
7
|
+
if (e) {
|
|
8
|
+
for (const k in e) {
|
|
9
|
+
if (k !== "default") {
|
|
10
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
11
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: () => e[k]
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
n.default = e;
|
|
19
|
+
return Object.freeze(n);
|
|
20
|
+
}
|
|
21
|
+
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
22
|
+
const skeletonBgColors = {
|
|
23
|
+
text: "#ccc",
|
|
24
|
+
box: "#e0e0e0"
|
|
25
|
+
};
|
|
26
|
+
const styleCache = {};
|
|
27
|
+
function getComputedStyleFromNode(node) {
|
|
28
|
+
if (typeof document === "undefined") return {};
|
|
29
|
+
const type = typeof node.type === "string" ? node.type : "div";
|
|
30
|
+
const key = `${type}-${node.props.id || ""}-${node.props.className || ""}`;
|
|
31
|
+
if (styleCache[key]) return styleCache[key];
|
|
32
|
+
const el = document.createElement(type);
|
|
33
|
+
if (node.props.id) el.id = node.props.id;
|
|
34
|
+
if (node.props.className) el.className = node.props.className;
|
|
35
|
+
if (node.props.style) {
|
|
36
|
+
Object.entries(node.props.style).forEach(([k, v]) => {
|
|
37
|
+
el.style[k] = v;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
el.style.display = "none";
|
|
41
|
+
document.body.appendChild(el);
|
|
42
|
+
const cs = window.getComputedStyle(el);
|
|
43
|
+
const computed = {
|
|
44
|
+
height: cs.height || void 0,
|
|
45
|
+
width: cs.width || "100%",
|
|
46
|
+
fontSize: cs.fontSize || void 0,
|
|
47
|
+
margin: cs.margin || "0",
|
|
48
|
+
padding: cs.padding || "0",
|
|
49
|
+
borderRadius: cs.borderRadius || "4px"
|
|
50
|
+
};
|
|
51
|
+
document.body.removeChild(el);
|
|
52
|
+
styleCache[key] = computed;
|
|
53
|
+
return computed;
|
|
54
|
+
}
|
|
55
|
+
const SkeletonBlock = ({ children }) => {
|
|
56
|
+
function traverse(node) {
|
|
57
|
+
if (!React__namespace.isValidElement(node)) return node;
|
|
58
|
+
if (typeof node.type === "string") {
|
|
59
|
+
const newProps = { ...node.props };
|
|
60
|
+
let style = { ...newProps.style };
|
|
61
|
+
if (newProps.skeletonrequired === "y") {
|
|
62
|
+
const defaults = getComputedStyleFromNode(node);
|
|
63
|
+
style.height = style.height || newProps.height || defaults.height || "20px";
|
|
64
|
+
style.width = style.width || newProps.width || defaults.width || "100%";
|
|
65
|
+
style.fontSize = style.fontSize || newProps.fontSize || defaults.fontSize || "16px";
|
|
66
|
+
style.margin = style.margin || newProps.margin || defaults.margin || "0";
|
|
67
|
+
style.padding = style.padding || newProps.padding || defaults.padding || "0";
|
|
68
|
+
style.borderRadius = style.borderRadius || defaults.borderRadius || "4px";
|
|
69
|
+
const type = node.type;
|
|
70
|
+
const isText = ["p", "span", "h1", "h2", "h3", "h4", "h5", "h6"].includes(type);
|
|
71
|
+
style.backgroundColor = isText ? skeletonBgColors.text : skeletonBgColors.box;
|
|
72
|
+
style.color = "transparent";
|
|
73
|
+
style.position = "relative";
|
|
74
|
+
style.overflow = "hidden";
|
|
75
|
+
const shimmerBase = isText ? skeletonBgColors.text : skeletonBgColors.box;
|
|
76
|
+
style.backgroundImage = `linear-gradient(90deg, ${shimmerBase} 0%, #f5f5f5 50%, ${shimmerBase} 100%)`;
|
|
77
|
+
style.backgroundSize = "200% 100%";
|
|
78
|
+
style.animation = "shimmer 1.5s infinite";
|
|
79
|
+
delete newProps.skeletonrequired;
|
|
80
|
+
newProps.style = style;
|
|
81
|
+
}
|
|
82
|
+
const childrenNodes = React__namespace.Children.map(node.props.children, traverse);
|
|
83
|
+
return React__namespace.cloneElement(node, newProps, childrenNodes);
|
|
84
|
+
}
|
|
85
|
+
return node;
|
|
86
|
+
}
|
|
87
|
+
const result = React__namespace.Children.map(children, traverse);
|
|
88
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
89
|
+
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
31
90
|
@keyframes shimmer {
|
|
32
91
|
0% { background-position: -200% 0; }
|
|
33
92
|
100% { background-position: 200% 0; }
|
|
34
93
|
}
|
|
35
|
-
`}),
|
|
94
|
+
` }),
|
|
95
|
+
result
|
|
96
|
+
] });
|
|
97
|
+
};
|
|
98
|
+
exports2.SkeletonBlock = SkeletonBlock;
|
|
99
|
+
exports2.default = SkeletonBlock;
|
|
100
|
+
Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
101
|
+
});
|