react-spring-carousel 3.0.0-beta090.35 → 3.0.0-beta090.36
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/index.cjs.js +7 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +228 -244
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import lr, { useRef as O, useEffect as he, createContext as fr, useCallback as De, Fragment as Er, useContext as dr, useState as Tr } from "react";
|
|
2
|
-
import { useSpring as vr, config as We, useIsomorphicLayoutEffect as Rr, useTransition as
|
|
2
|
+
import { useSpring as vr, config as We, useIsomorphicLayoutEffect as Rr, useTransition as wr, a as _r } from "@react-spring/web";
|
|
3
3
|
import { useDrag as hr } from "@use-gesture/react";
|
|
4
4
|
import Cr from "resize-observer-polyfill";
|
|
5
5
|
import Ee from "screenfull";
|
|
6
|
-
var
|
|
6
|
+
var H = {}, Ir = {
|
|
7
7
|
get exports() {
|
|
8
|
-
return
|
|
8
|
+
return H;
|
|
9
9
|
},
|
|
10
10
|
set exports(i) {
|
|
11
|
-
|
|
11
|
+
H = i;
|
|
12
12
|
}
|
|
13
13
|
}, Ae = {};
|
|
14
14
|
/**
|
|
@@ -27,14 +27,14 @@ function Pr() {
|
|
|
27
27
|
cr = 1;
|
|
28
28
|
var i = lr, p = Symbol.for("react.element"), y = Symbol.for("react.fragment"), $ = Object.prototype.hasOwnProperty, Y = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
29
29
|
function w(l, f, d) {
|
|
30
|
-
var M,
|
|
31
|
-
d !== void 0 && (
|
|
30
|
+
var M, L = {}, C = null, u = null;
|
|
31
|
+
d !== void 0 && (C = "" + d), f.key !== void 0 && (C = "" + f.key), f.ref !== void 0 && (u = f.ref);
|
|
32
32
|
for (M in f)
|
|
33
|
-
$.call(f, M) && !v.hasOwnProperty(M) && (
|
|
33
|
+
$.call(f, M) && !v.hasOwnProperty(M) && (L[M] = f[M]);
|
|
34
34
|
if (l && l.defaultProps)
|
|
35
35
|
for (M in f = l.defaultProps, f)
|
|
36
|
-
|
|
37
|
-
return { $$typeof: p, type: l, key:
|
|
36
|
+
L[M] === void 0 && (L[M] = f[M]);
|
|
37
|
+
return { $$typeof: p, type: l, key: C, ref: u, props: L, _owner: Y.current };
|
|
38
38
|
}
|
|
39
39
|
return Ae.Fragment = y, Ae.jsx = w, Ae.jsxs = w, Ae;
|
|
40
40
|
}
|
|
@@ -51,15 +51,15 @@ var Je = {};
|
|
|
51
51
|
var sr;
|
|
52
52
|
function kr() {
|
|
53
53
|
return sr || (sr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
54
|
-
var i = lr, p = Symbol.for("react.element"), y = Symbol.for("react.portal"), $ = Symbol.for("react.fragment"), Y = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), w = Symbol.for("react.provider"), l = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), M = Symbol.for("react.suspense_list"),
|
|
54
|
+
var i = lr, p = Symbol.for("react.element"), y = Symbol.for("react.portal"), $ = Symbol.for("react.fragment"), Y = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), w = Symbol.for("react.provider"), l = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), M = Symbol.for("react.suspense_list"), L = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), u = Symbol.for("react.offscreen"), U = Symbol.iterator, T = "@@iterator";
|
|
55
55
|
function ae(e) {
|
|
56
56
|
if (e === null || typeof e != "object")
|
|
57
57
|
return null;
|
|
58
58
|
var t = U && e[U] || e[T];
|
|
59
59
|
return typeof t == "function" ? t : null;
|
|
60
60
|
}
|
|
61
|
-
var
|
|
62
|
-
function
|
|
61
|
+
var F = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
62
|
+
function j(e) {
|
|
63
63
|
{
|
|
64
64
|
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), c = 1; c < t; c++)
|
|
65
65
|
n[c - 1] = arguments[c];
|
|
@@ -68,18 +68,18 @@ function kr() {
|
|
|
68
68
|
}
|
|
69
69
|
function G(e, t, n) {
|
|
70
70
|
{
|
|
71
|
-
var c =
|
|
71
|
+
var c = F.ReactDebugCurrentFrame, E = c.getStackAddendum();
|
|
72
72
|
E !== "" && (t += "%s", n = n.concat([E]));
|
|
73
|
-
var
|
|
73
|
+
var _ = n.map(function(m) {
|
|
74
74
|
return String(m);
|
|
75
75
|
});
|
|
76
|
-
|
|
76
|
+
_.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, _);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
var Ne = !1, ee = !1, q = !1, re = !1, oe = !1, J;
|
|
80
80
|
J = Symbol.for("react.module.reference");
|
|
81
81
|
function Te(e) {
|
|
82
|
-
return !!(typeof e == "string" || typeof e == "function" || e === $ || e === v || oe || e === Y || e === d || e === M || re || e === u || Ne || ee || q || typeof e == "object" && e !== null && (e.$$typeof ===
|
|
82
|
+
return !!(typeof e == "string" || typeof e == "function" || e === $ || e === v || oe || e === Y || e === d || e === M || re || e === u || Ne || ee || q || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === L || e.$$typeof === w || e.$$typeof === l || e.$$typeof === f || // This needs to include all possible module reference object
|
|
83
83
|
// types supported by any Flight configuration anywhere since
|
|
84
84
|
// we don't know which Flight build this will end up being used
|
|
85
85
|
// with.
|
|
@@ -98,7 +98,7 @@ function kr() {
|
|
|
98
98
|
function b(e) {
|
|
99
99
|
if (e == null)
|
|
100
100
|
return null;
|
|
101
|
-
if (typeof e.tag == "number" &&
|
|
101
|
+
if (typeof e.tag == "number" && j("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
102
102
|
return e.displayName || e.name || null;
|
|
103
103
|
if (typeof e == "string")
|
|
104
104
|
return e;
|
|
@@ -126,13 +126,13 @@ function kr() {
|
|
|
126
126
|
return W(n._context) + ".Provider";
|
|
127
127
|
case f:
|
|
128
128
|
return me(e, e.render, "ForwardRef");
|
|
129
|
-
case
|
|
129
|
+
case L:
|
|
130
130
|
var c = e.displayName || null;
|
|
131
131
|
return c !== null ? c : b(e.type) || "Memo";
|
|
132
|
-
case
|
|
133
|
-
var E = e,
|
|
132
|
+
case C: {
|
|
133
|
+
var E = e, _ = E._payload, m = E._init;
|
|
134
134
|
try {
|
|
135
|
-
return b(m(
|
|
135
|
+
return b(m(_));
|
|
136
136
|
} catch {
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
@@ -140,14 +140,14 @@ function kr() {
|
|
|
140
140
|
}
|
|
141
141
|
return null;
|
|
142
142
|
}
|
|
143
|
-
var x = Object.assign, R = 0,
|
|
143
|
+
var x = Object.assign, R = 0, V, pe, g, s, k, te, ne;
|
|
144
144
|
function K() {
|
|
145
145
|
}
|
|
146
146
|
K.__reactDisabledLog = !0;
|
|
147
147
|
function or() {
|
|
148
148
|
{
|
|
149
149
|
if (R === 0) {
|
|
150
|
-
|
|
150
|
+
V = console.log, pe = console.info, g = console.warn, s = console.error, k = console.group, te = console.groupCollapsed, ne = console.groupEnd;
|
|
151
151
|
var e = {
|
|
152
152
|
configurable: !0,
|
|
153
153
|
enumerable: !0,
|
|
@@ -177,7 +177,7 @@ function kr() {
|
|
|
177
177
|
};
|
|
178
178
|
Object.defineProperties(console, {
|
|
179
179
|
log: x({}, e, {
|
|
180
|
-
value:
|
|
180
|
+
value: V
|
|
181
181
|
}),
|
|
182
182
|
info: x({}, e, {
|
|
183
183
|
value: pe
|
|
@@ -199,10 +199,10 @@ function kr() {
|
|
|
199
199
|
})
|
|
200
200
|
});
|
|
201
201
|
}
|
|
202
|
-
R < 0 &&
|
|
202
|
+
R < 0 && j("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
var Z =
|
|
205
|
+
var Z = F.ReactCurrentDispatcher, B;
|
|
206
206
|
function ue(e, t, n) {
|
|
207
207
|
{
|
|
208
208
|
if (B === void 0)
|
|
@@ -221,7 +221,7 @@ function kr() {
|
|
|
221
221
|
var Qe = typeof WeakMap == "function" ? WeakMap : Map;
|
|
222
222
|
Pe = new Qe();
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function Ve(e, t) {
|
|
225
225
|
if (!e || ge)
|
|
226
226
|
return "";
|
|
227
227
|
{
|
|
@@ -233,8 +233,8 @@ function kr() {
|
|
|
233
233
|
ge = !0;
|
|
234
234
|
var E = Error.prepareStackTrace;
|
|
235
235
|
Error.prepareStackTrace = void 0;
|
|
236
|
-
var
|
|
237
|
-
|
|
236
|
+
var _;
|
|
237
|
+
_ = Z.current, Z.current = null, or();
|
|
238
238
|
try {
|
|
239
239
|
if (t) {
|
|
240
240
|
var m = function() {
|
|
@@ -271,29 +271,29 @@ function kr() {
|
|
|
271
271
|
if (ve && c && typeof ve.stack == "string") {
|
|
272
272
|
for (var h = ve.stack.split(`
|
|
273
273
|
`), A = c.stack.split(`
|
|
274
|
-
`), N = h.length - 1,
|
|
275
|
-
|
|
276
|
-
for (; N >= 1 &&
|
|
277
|
-
if (h[N] !== A[
|
|
278
|
-
if (N !== 1 ||
|
|
274
|
+
`), N = h.length - 1, S = A.length - 1; N >= 1 && S >= 0 && h[N] !== A[S]; )
|
|
275
|
+
S--;
|
|
276
|
+
for (; N >= 1 && S >= 0; N--, S--)
|
|
277
|
+
if (h[N] !== A[S]) {
|
|
278
|
+
if (N !== 1 || S !== 1)
|
|
279
279
|
do
|
|
280
|
-
if (N--,
|
|
280
|
+
if (N--, S--, S < 0 || h[N] !== A[S]) {
|
|
281
281
|
var X = `
|
|
282
282
|
` + h[N].replace(" at new ", " at ");
|
|
283
283
|
return e.displayName && X.includes("<anonymous>") && (X = X.replace("<anonymous>", e.displayName)), typeof e == "function" && Pe.set(e, X), X;
|
|
284
284
|
}
|
|
285
|
-
while (N >= 1 &&
|
|
285
|
+
while (N >= 1 && S >= 0);
|
|
286
286
|
break;
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
289
|
} finally {
|
|
290
|
-
ge = !1, Z.current =
|
|
290
|
+
ge = !1, Z.current = _, Ie(), Error.prepareStackTrace = E;
|
|
291
291
|
}
|
|
292
292
|
var $e = e ? e.displayName || e.name : "", ur = $e ? ue($e) : "";
|
|
293
293
|
return typeof e == "function" && Pe.set(e, ur), ur;
|
|
294
294
|
}
|
|
295
295
|
function ze(e, t, n) {
|
|
296
|
-
return
|
|
296
|
+
return Ve(e, !1);
|
|
297
297
|
}
|
|
298
298
|
function Xe(e) {
|
|
299
299
|
var t = e.prototype;
|
|
@@ -303,7 +303,7 @@ function kr() {
|
|
|
303
303
|
if (e == null)
|
|
304
304
|
return "";
|
|
305
305
|
if (typeof e == "function")
|
|
306
|
-
return
|
|
306
|
+
return Ve(e, Xe(e));
|
|
307
307
|
if (typeof e == "string")
|
|
308
308
|
return ue(e);
|
|
309
309
|
switch (e) {
|
|
@@ -316,20 +316,20 @@ function kr() {
|
|
|
316
316
|
switch (e.$$typeof) {
|
|
317
317
|
case f:
|
|
318
318
|
return ze(e.render);
|
|
319
|
-
case
|
|
319
|
+
case L:
|
|
320
320
|
return ke(e.type, t, n);
|
|
321
|
-
case
|
|
322
|
-
var c = e, E = c._payload,
|
|
321
|
+
case C: {
|
|
322
|
+
var c = e, E = c._payload, _ = c._init;
|
|
323
323
|
try {
|
|
324
|
-
return ke(
|
|
324
|
+
return ke(_(E), t, n);
|
|
325
325
|
} catch {
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
return "";
|
|
330
330
|
}
|
|
331
|
-
var
|
|
332
|
-
function
|
|
331
|
+
var I = Object.prototype.hasOwnProperty, ce = {}, D = F.ReactDebugCurrentFrame;
|
|
332
|
+
function Fe(e) {
|
|
333
333
|
if (e) {
|
|
334
334
|
var t = e._owner, n = ke(e.type, e._source, t ? t.type : null);
|
|
335
335
|
D.setExtraStackFrame(n);
|
|
@@ -338,9 +338,9 @@ function kr() {
|
|
|
338
338
|
}
|
|
339
339
|
function Re(e, t, n, c, E) {
|
|
340
340
|
{
|
|
341
|
-
var
|
|
341
|
+
var _ = Function.call.bind(I);
|
|
342
342
|
for (var m in e)
|
|
343
|
-
if (
|
|
343
|
+
if (_(e, m)) {
|
|
344
344
|
var h = void 0;
|
|
345
345
|
try {
|
|
346
346
|
if (typeof e[m] != "function") {
|
|
@@ -351,13 +351,13 @@ function kr() {
|
|
|
351
351
|
} catch (N) {
|
|
352
352
|
h = N;
|
|
353
353
|
}
|
|
354
|
-
h && !(h instanceof Error) && (
|
|
354
|
+
h && !(h instanceof Error) && (Fe(E), j("%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).", c || "React class", n, m, typeof h), Fe(null)), h instanceof Error && !(h.message in ce) && (ce[h.message] = !0, Fe(E), j("Failed %s type: %s", n, h.message), Fe(null));
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
var
|
|
358
|
+
var we = Array.isArray;
|
|
359
359
|
function ye(e) {
|
|
360
|
-
return
|
|
360
|
+
return we(e);
|
|
361
361
|
}
|
|
362
362
|
function Q(e) {
|
|
363
363
|
{
|
|
@@ -365,7 +365,7 @@ function kr() {
|
|
|
365
365
|
return n;
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function _e(e) {
|
|
369
369
|
try {
|
|
370
370
|
return se(e), !1;
|
|
371
371
|
} catch {
|
|
@@ -376,18 +376,18 @@ function kr() {
|
|
|
376
376
|
return "" + e;
|
|
377
377
|
}
|
|
378
378
|
function le(e) {
|
|
379
|
-
if (
|
|
380
|
-
return
|
|
379
|
+
if (_e(e))
|
|
380
|
+
return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Q(e)), se(e);
|
|
381
381
|
}
|
|
382
|
-
var Ce =
|
|
382
|
+
var Ce = F.ReactCurrentOwner, Ke = {
|
|
383
383
|
key: !0,
|
|
384
384
|
ref: !0,
|
|
385
385
|
__self: !0,
|
|
386
386
|
__source: !0
|
|
387
|
-
}, Ge, Ze,
|
|
388
|
-
|
|
389
|
-
function
|
|
390
|
-
if (
|
|
387
|
+
}, Ge, Ze, Se;
|
|
388
|
+
Se = {};
|
|
389
|
+
function je(e) {
|
|
390
|
+
if (I.call(e, "ref")) {
|
|
391
391
|
var t = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
392
392
|
if (t && t.isReactWarning)
|
|
393
393
|
return !1;
|
|
@@ -395,7 +395,7 @@ function kr() {
|
|
|
395
395
|
return e.ref !== void 0;
|
|
396
396
|
}
|
|
397
397
|
function er(e) {
|
|
398
|
-
if (
|
|
398
|
+
if (I.call(e, "key")) {
|
|
399
399
|
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
400
400
|
if (t && t.isReactWarning)
|
|
401
401
|
return !1;
|
|
@@ -405,13 +405,13 @@ function kr() {
|
|
|
405
405
|
function be(e, t) {
|
|
406
406
|
if (typeof e.ref == "string" && Ce.current && t && Ce.current.stateNode !== t) {
|
|
407
407
|
var n = b(Ce.current.type);
|
|
408
|
-
|
|
408
|
+
Se[n] || (j('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', b(Ce.current.type), e.ref), Se[n] = !0);
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
411
|
function Ye(e, t) {
|
|
412
412
|
{
|
|
413
413
|
var n = function() {
|
|
414
|
-
Ge || (Ge = !0,
|
|
414
|
+
Ge || (Ge = !0, j("%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)", t));
|
|
415
415
|
};
|
|
416
416
|
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
417
417
|
get: n,
|
|
@@ -422,7 +422,7 @@ function kr() {
|
|
|
422
422
|
function Ue(e, t) {
|
|
423
423
|
{
|
|
424
424
|
var n = function() {
|
|
425
|
-
Ze || (Ze = !0,
|
|
425
|
+
Ze || (Ze = !0, j("%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)", t));
|
|
426
426
|
};
|
|
427
427
|
n.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
428
428
|
get: n,
|
|
@@ -430,7 +430,7 @@ function kr() {
|
|
|
430
430
|
});
|
|
431
431
|
}
|
|
432
432
|
}
|
|
433
|
-
var Be = function(e, t, n, c, E,
|
|
433
|
+
var Be = function(e, t, n, c, E, _, m) {
|
|
434
434
|
var h = {
|
|
435
435
|
// This tag allows us to uniquely identify this as a React Element
|
|
436
436
|
$$typeof: p,
|
|
@@ -440,7 +440,7 @@ function kr() {
|
|
|
440
440
|
ref: n,
|
|
441
441
|
props: m,
|
|
442
442
|
// Record the component responsible for creating this element.
|
|
443
|
-
_owner:
|
|
443
|
+
_owner: _
|
|
444
444
|
};
|
|
445
445
|
return h._store = {}, Object.defineProperty(h._store, "validated", {
|
|
446
446
|
configurable: !1,
|
|
@@ -461,23 +461,23 @@ function kr() {
|
|
|
461
461
|
};
|
|
462
462
|
function qe(e, t, n, c, E) {
|
|
463
463
|
{
|
|
464
|
-
var
|
|
465
|
-
n !== void 0 && (le(n), h = "" + n), er(t) && (le(t.key), h = "" + t.key),
|
|
466
|
-
for (
|
|
467
|
-
|
|
464
|
+
var _, m = {}, h = null, A = null;
|
|
465
|
+
n !== void 0 && (le(n), h = "" + n), er(t) && (le(t.key), h = "" + t.key), je(t) && (A = t.ref, be(t, E));
|
|
466
|
+
for (_ in t)
|
|
467
|
+
I.call(t, _) && !Ke.hasOwnProperty(_) && (m[_] = t[_]);
|
|
468
468
|
if (e && e.defaultProps) {
|
|
469
469
|
var N = e.defaultProps;
|
|
470
|
-
for (
|
|
471
|
-
m[
|
|
470
|
+
for (_ in N)
|
|
471
|
+
m[_] === void 0 && (m[_] = N[_]);
|
|
472
472
|
}
|
|
473
473
|
if (h || A) {
|
|
474
|
-
var
|
|
475
|
-
h && Ye(m,
|
|
474
|
+
var S = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
475
|
+
h && Ye(m, S), A && Ue(m, S);
|
|
476
476
|
}
|
|
477
477
|
return Be(e, h, A, E, c, Ce.current, m);
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
var Le =
|
|
480
|
+
var Le = F.ReactCurrentOwner, Oe = F.ReactDebugCurrentFrame;
|
|
481
481
|
function xe(e) {
|
|
482
482
|
if (e) {
|
|
483
483
|
var t = e._owner, n = ke(e.type, e._source, t ? t.type : null);
|
|
@@ -513,7 +513,7 @@ Check your code at ` + t + ":" + n + ".";
|
|
|
513
513
|
return "";
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
|
-
var
|
|
516
|
+
var P = {};
|
|
517
517
|
function z(e) {
|
|
518
518
|
{
|
|
519
519
|
var t = o();
|
|
@@ -532,11 +532,11 @@ Check the top-level render call using <` + n + ">.");
|
|
|
532
532
|
return;
|
|
533
533
|
e._store.validated = !0;
|
|
534
534
|
var n = z(t);
|
|
535
|
-
if (
|
|
535
|
+
if (P[n])
|
|
536
536
|
return;
|
|
537
|
-
|
|
537
|
+
P[n] = !0;
|
|
538
538
|
var c = "";
|
|
539
|
-
e && e._owner && e._owner !== Le.current && (c = " It was passed a child from " + b(e._owner.type) + "."), xe(e),
|
|
539
|
+
e && e._owner && e._owner !== Le.current && (c = " It was passed a child from " + b(e._owner.type) + "."), xe(e), j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, c), xe(null);
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
542
|
function de(e, t) {
|
|
@@ -553,7 +553,7 @@ Check the top-level render call using <` + n + ">.");
|
|
|
553
553
|
else if (e) {
|
|
554
554
|
var E = ae(e);
|
|
555
555
|
if (typeof E == "function" && E !== e.entries)
|
|
556
|
-
for (var
|
|
556
|
+
for (var _ = E.call(e), m; !(m = _.next()).done; )
|
|
557
557
|
r(m.value) && fe(m.value, t);
|
|
558
558
|
}
|
|
559
559
|
}
|
|
@@ -568,7 +568,7 @@ Check the top-level render call using <` + n + ">.");
|
|
|
568
568
|
n = t.propTypes;
|
|
569
569
|
else if (typeof t == "object" && (t.$$typeof === f || // Note: Memo only checks outer props here.
|
|
570
570
|
// Inner props are checked in the reconciler.
|
|
571
|
-
t.$$typeof ===
|
|
571
|
+
t.$$typeof === L))
|
|
572
572
|
n = t.propTypes;
|
|
573
573
|
else
|
|
574
574
|
return;
|
|
@@ -578,9 +578,9 @@ Check the top-level render call using <` + n + ">.");
|
|
|
578
578
|
} else if (t.PropTypes !== void 0 && !He) {
|
|
579
579
|
He = !0;
|
|
580
580
|
var E = b(t);
|
|
581
|
-
|
|
581
|
+
j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", E || "Unknown");
|
|
582
582
|
}
|
|
583
|
-
typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved &&
|
|
583
|
+
typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
586
|
function ie(e) {
|
|
@@ -588,14 +588,14 @@ Check the top-level render call using <` + n + ">.");
|
|
|
588
588
|
for (var t = Object.keys(e.props), n = 0; n < t.length; n++) {
|
|
589
589
|
var c = t[n];
|
|
590
590
|
if (c !== "children" && c !== "key") {
|
|
591
|
-
xe(e),
|
|
591
|
+
xe(e), j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", c), xe(null);
|
|
592
592
|
break;
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
|
-
e.ref !== null && (xe(e),
|
|
595
|
+
e.ref !== null && (xe(e), j("Invalid attribute `ref` supplied to `React.Fragment`."), xe(null));
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
|
-
function tr(e, t, n, c, E,
|
|
598
|
+
function tr(e, t, n, c, E, _) {
|
|
599
599
|
{
|
|
600
600
|
var m = Te(e);
|
|
601
601
|
if (!m) {
|
|
@@ -604,11 +604,11 @@ Check the top-level render call using <` + n + ">.");
|
|
|
604
604
|
var A = a(E);
|
|
605
605
|
A ? h += A : h += o();
|
|
606
606
|
var N;
|
|
607
|
-
e === null ? N = "null" : ye(e) ? N = "array" : e !== void 0 && e.$$typeof === p ? (N = "<" + (b(e.type) || "Unknown") + " />", h = " Did you accidentally export a JSX literal instead of a component?") : N = typeof e,
|
|
607
|
+
e === null ? N = "null" : ye(e) ? N = "array" : e !== void 0 && e.$$typeof === p ? (N = "<" + (b(e.type) || "Unknown") + " />", h = " Did you accidentally export a JSX literal instead of a component?") : N = typeof e, j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", N, h);
|
|
608
608
|
}
|
|
609
|
-
var
|
|
610
|
-
if (
|
|
611
|
-
return
|
|
609
|
+
var S = qe(e, t, n, E, _);
|
|
610
|
+
if (S == null)
|
|
611
|
+
return S;
|
|
612
612
|
if (m) {
|
|
613
613
|
var X = t.children;
|
|
614
614
|
if (X !== void 0)
|
|
@@ -618,11 +618,11 @@ Check the top-level render call using <` + n + ">.");
|
|
|
618
618
|
de(X[$e], e);
|
|
619
619
|
Object.freeze && Object.freeze(X);
|
|
620
620
|
} else
|
|
621
|
-
|
|
621
|
+
j("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
622
622
|
else
|
|
623
623
|
de(X, e);
|
|
624
624
|
}
|
|
625
|
-
return e === $ ? ie(
|
|
625
|
+
return e === $ ? ie(S) : rr(S), S;
|
|
626
626
|
}
|
|
627
627
|
}
|
|
628
628
|
function gr(e, t, n) {
|
|
@@ -667,7 +667,7 @@ function mr() {
|
|
|
667
667
|
emitEvent: y
|
|
668
668
|
};
|
|
669
669
|
}
|
|
670
|
-
function
|
|
670
|
+
function Fr({
|
|
671
671
|
mainCarouselWrapperRef: i,
|
|
672
672
|
onFullScreenChange: p,
|
|
673
673
|
handleResize: y
|
|
@@ -700,7 +700,7 @@ function jr({
|
|
|
700
700
|
getIsFullscreen: v
|
|
701
701
|
};
|
|
702
702
|
}
|
|
703
|
-
function
|
|
703
|
+
function jr(i) {
|
|
704
704
|
const p = i.getBoundingClientRect();
|
|
705
705
|
return p.top >= 0 && p.left >= 0 && p.bottom <= (window.innerHeight || document.documentElement.clientHeight) && p.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
706
706
|
}
|
|
@@ -715,47 +715,47 @@ function pr({
|
|
|
715
715
|
val: 0
|
|
716
716
|
}));
|
|
717
717
|
function f() {
|
|
718
|
-
var
|
|
718
|
+
var C;
|
|
719
719
|
return v.current ? Math.round(
|
|
720
|
-
Number((
|
|
720
|
+
Number((C = v.current) == null ? void 0 : C[i === "x" ? "scrollWidth" : "scrollHeight"]) - v.current.getBoundingClientRect()[i === "x" ? "width" : "height"]
|
|
721
721
|
) : 0;
|
|
722
722
|
}
|
|
723
|
-
function d(
|
|
723
|
+
function d(C) {
|
|
724
724
|
var T;
|
|
725
725
|
function u() {
|
|
726
726
|
return v.current ? v.current.querySelector(
|
|
727
|
-
`#thumb-item-${$[
|
|
727
|
+
`#thumb-item-${$[C].id}`
|
|
728
728
|
) : null;
|
|
729
729
|
}
|
|
730
730
|
const U = u();
|
|
731
|
-
if (U && v.current && !
|
|
732
|
-
const ae = U.offsetLeft,
|
|
731
|
+
if (U && v.current && !jr(U)) {
|
|
732
|
+
const ae = U.offsetLeft, F = ae > f() ? f() : ae;
|
|
733
733
|
l.start({
|
|
734
734
|
from: {
|
|
735
735
|
val: ((T = v.current) == null ? void 0 : T[i === "x" ? "scrollLeft" : "scrollTop"]) ?? 0
|
|
736
736
|
},
|
|
737
737
|
to: {
|
|
738
|
-
val:
|
|
738
|
+
val: F
|
|
739
739
|
},
|
|
740
|
-
onChange: ({ value:
|
|
740
|
+
onChange: ({ value: j }) => {
|
|
741
741
|
v.current && (v.current[i === "x" ? "scrollLeft" : "scrollTop"] = Math.abs(
|
|
742
|
-
|
|
742
|
+
j.val
|
|
743
743
|
));
|
|
744
744
|
}
|
|
745
745
|
});
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
748
|
function M() {
|
|
749
|
-
function
|
|
749
|
+
function C(u) {
|
|
750
750
|
return u.map((U) => ({
|
|
751
751
|
id: U.id,
|
|
752
752
|
renderThumb: U.renderThumb
|
|
753
753
|
}));
|
|
754
754
|
}
|
|
755
|
-
return y ? y(
|
|
755
|
+
return y ? y(C($)) : C($);
|
|
756
756
|
}
|
|
757
757
|
return {
|
|
758
|
-
thumbsFragment: p ? /* @__PURE__ */
|
|
758
|
+
thumbsFragment: p ? /* @__PURE__ */ H.jsx(
|
|
759
759
|
"div",
|
|
760
760
|
{
|
|
761
761
|
className: "use-spring-carousel-thumbs-wrapper",
|
|
@@ -773,9 +773,9 @@ function pr({
|
|
|
773
773
|
maxHeight: "100%"
|
|
774
774
|
}
|
|
775
775
|
},
|
|
776
|
-
children: M().map(({ id:
|
|
777
|
-
const U = `thumb-item-${
|
|
778
|
-
return /* @__PURE__ */
|
|
776
|
+
children: M().map(({ id: C, renderThumb: u }) => {
|
|
777
|
+
const U = `thumb-item-${C}`;
|
|
778
|
+
return /* @__PURE__ */ H.jsx("div", { id: U, className: "thumb-item", children: typeof u == "function" ? u(Y) : u }, U);
|
|
779
779
|
})
|
|
780
780
|
}
|
|
781
781
|
) : null,
|
|
@@ -794,19 +794,19 @@ function Nr({
|
|
|
794
794
|
startEndGutter: f = 0,
|
|
795
795
|
carouselSlideAxis: d = "x",
|
|
796
796
|
disableGestures: M = !1,
|
|
797
|
-
draggingSlideTreshold:
|
|
798
|
-
slideWhenThresholdIsReached:
|
|
797
|
+
draggingSlideTreshold: L,
|
|
798
|
+
slideWhenThresholdIsReached: C = !1,
|
|
799
799
|
freeScroll: u,
|
|
800
800
|
enableFreeScrollDrag: U,
|
|
801
801
|
initialStartingPosition: T,
|
|
802
802
|
prepareThumbsData: ae,
|
|
803
|
-
initialActiveItem:
|
|
804
|
-
animateWhenActiveItemChange:
|
|
803
|
+
initialActiveItem: F = 0,
|
|
804
|
+
animateWhenActiveItemChange: j = !0,
|
|
805
805
|
slideGroupOfItems: G = !1,
|
|
806
806
|
__unstable_stretch_tems__: Ne = !0,
|
|
807
807
|
slideAmount: ee
|
|
808
808
|
}) {
|
|
809
|
-
const q = Y, re = O(!1), oe = O(
|
|
809
|
+
const q = Y, re = O(!1), oe = O(L ?? 0), J = O("initial"), Te = O("initial"), me = O("initial"), W = O(F), b = O(F === 0), x = O(v === "fixed" && F === i.length - 1), R = O(null), V = O(null), pe = O(0), g = O(0), s = O(0), k = O(l), te = O(v), ne = O(u), K = O(!1), Ie = De(() => l ? [
|
|
810
810
|
...i.map((r) => ({
|
|
811
811
|
...r,
|
|
812
812
|
id: `prev-repeated-item-${r.id}`
|
|
@@ -821,7 +821,7 @@ function Nr({
|
|
|
821
821
|
val: 0,
|
|
822
822
|
pause: !p,
|
|
823
823
|
onChange: ({ value: r }) => {
|
|
824
|
-
u && R.current ? (d === "x" ? R.current.scrollLeft = Math.abs(r.val) : R.current.scrollTop = Math.abs(r.val),
|
|
824
|
+
u && R.current ? (d === "x" ? R.current.scrollLeft = Math.abs(r.val) : R.current.scrollTop = Math.abs(r.val), je()) : V.current && (d === "x" ? V.current.style.transform = `translate3d(${r.val}px, 0px,0px)` : V.current.style.transform = `translate3d(0px,${r.val}px,0px)`);
|
|
825
825
|
}
|
|
826
826
|
}),
|
|
827
827
|
[u]
|
|
@@ -836,7 +836,7 @@ function Nr({
|
|
|
836
836
|
useListenToCustomEvent: ge,
|
|
837
837
|
getIsNextItem: Ue
|
|
838
838
|
}
|
|
839
|
-
}), { enterFullscreen:
|
|
839
|
+
}), { enterFullscreen: Ve, exitFullscreen: ze, getIsFullscreen: Xe } = Fr({
|
|
840
840
|
mainCarouselWrapperRef: R,
|
|
841
841
|
handleResize: () => ye(),
|
|
842
842
|
onFullScreenChange: (r) => {
|
|
@@ -854,7 +854,7 @@ function Nr({
|
|
|
854
854
|
marginRight: `${r ? 0 : w}px`
|
|
855
855
|
};
|
|
856
856
|
}
|
|
857
|
-
const
|
|
857
|
+
const I = De(() => {
|
|
858
858
|
var a;
|
|
859
859
|
if (typeof ee == "number" && ee > 0 && (v === "fluid" || u))
|
|
860
860
|
return ee;
|
|
@@ -872,7 +872,7 @@ function Nr({
|
|
|
872
872
|
v,
|
|
873
873
|
f
|
|
874
874
|
]);
|
|
875
|
-
function ce({ from: r, to: o, nextActiveItem: a, immediate:
|
|
875
|
+
function ce({ from: r, to: o, nextActiveItem: a, immediate: P = !1, slideMode: z }) {
|
|
876
876
|
Te.current = z, typeof a == "number" && (u || (W.current = a), ue({
|
|
877
877
|
eventName: "onSlideStartChange",
|
|
878
878
|
slideActionType: J.current,
|
|
@@ -884,7 +884,7 @@ function Nr({
|
|
|
884
884
|
id: u ? "" : i[W.current].id
|
|
885
885
|
}
|
|
886
886
|
})), s.current = o, B.start({
|
|
887
|
-
immediate:
|
|
887
|
+
immediate: P,
|
|
888
888
|
from: {
|
|
889
889
|
val: r
|
|
890
890
|
},
|
|
@@ -896,7 +896,7 @@ function Nr({
|
|
|
896
896
|
velocity: Z.val.velocity
|
|
897
897
|
},
|
|
898
898
|
onRest(fe) {
|
|
899
|
-
!
|
|
899
|
+
!P && fe.finished && ue({
|
|
900
900
|
eventName: "onSlideChange",
|
|
901
901
|
slideActionType: J.current,
|
|
902
902
|
slideMode: Te.current,
|
|
@@ -908,17 +908,17 @@ function Nr({
|
|
|
908
908
|
}
|
|
909
909
|
});
|
|
910
910
|
}
|
|
911
|
-
}), y && !
|
|
911
|
+
}), y && !P && Qe(W.current);
|
|
912
912
|
}
|
|
913
913
|
const D = De(() => {
|
|
914
914
|
var r;
|
|
915
|
-
return
|
|
915
|
+
return V.current ? l ? I() * i.length : Math.round(
|
|
916
916
|
Number(
|
|
917
|
-
(r =
|
|
918
|
-
) -
|
|
917
|
+
(r = V.current) == null ? void 0 : r[d === "x" ? "scrollWidth" : "scrollHeight"]
|
|
918
|
+
) - V.current.getBoundingClientRect()[d === "x" ? "width" : "height"] - f * 2
|
|
919
919
|
) : 0;
|
|
920
|
-
}, [d,
|
|
921
|
-
function
|
|
920
|
+
}, [d, I, i.length, f, l]);
|
|
921
|
+
function Fe() {
|
|
922
922
|
const r = `calc(100% - ${f * 2}px)`;
|
|
923
923
|
return {
|
|
924
924
|
width: d === "x" ? r : "100%",
|
|
@@ -927,22 +927,22 @@ function Nr({
|
|
|
927
927
|
}
|
|
928
928
|
const Re = De(() => {
|
|
929
929
|
var o;
|
|
930
|
-
const r = (o =
|
|
930
|
+
const r = (o = V.current) == null ? void 0 : o.querySelector(".use-spring-carousel-item");
|
|
931
931
|
if (!r)
|
|
932
932
|
throw Error("No carousel items available!");
|
|
933
933
|
return r.getBoundingClientRect()[d === "x" ? "width" : "height"] + w;
|
|
934
|
-
}, [d, w]),
|
|
934
|
+
}, [d, w]), we = De(
|
|
935
935
|
(r) => {
|
|
936
|
-
const o = d === "x" ? "left" : "top", a =
|
|
936
|
+
const o = d === "x" ? "left" : "top", a = V.current;
|
|
937
937
|
a && (l ? (a.style.top = "0px", a.style.left = "0px", a.style[o] = `-${r - f}px`, b.current = !1, x.current = !1) : (a.style.left = "0px", a.style.top = "0px"));
|
|
938
938
|
},
|
|
939
939
|
[d, f, l]
|
|
940
940
|
), ye = De(
|
|
941
941
|
(r = !1) => {
|
|
942
|
-
if (
|
|
943
|
-
T === "center" ? Re() * i.length -
|
|
942
|
+
if (V.current && r && (V.current.style.transform = "translate3d(0px, 0px,0px)", V.current.style.left = "0", V.current.style.top = "0"), v === "fixed" && we(
|
|
943
|
+
T === "center" ? Re() * i.length - I() * Math.round((q - 1) / 2) : T === "end" ? Re() * i.length - I() * Math.round(q - 1) : Re() * i.length
|
|
944
944
|
), v === "fluid") {
|
|
945
|
-
if (
|
|
945
|
+
if (we(Re() * i.length), x.current && D() !== Math.abs(s.current) && !l) {
|
|
946
946
|
const o = -D();
|
|
947
947
|
s.current = o, B.start({
|
|
948
948
|
immediate: !0,
|
|
@@ -962,7 +962,7 @@ function Nr({
|
|
|
962
962
|
return;
|
|
963
963
|
}
|
|
964
964
|
if (!u && v === "fixed") {
|
|
965
|
-
const o = -(
|
|
965
|
+
const o = -(I() * W.current);
|
|
966
966
|
if (Math.abs(o) > D() && !l) {
|
|
967
967
|
const a = -D();
|
|
968
968
|
x.current = !0, s.current = a, B.start({
|
|
@@ -982,12 +982,12 @@ function Nr({
|
|
|
982
982
|
[
|
|
983
983
|
u,
|
|
984
984
|
Re,
|
|
985
|
-
|
|
985
|
+
I,
|
|
986
986
|
D,
|
|
987
987
|
T,
|
|
988
988
|
i.length,
|
|
989
989
|
q,
|
|
990
|
-
|
|
990
|
+
we,
|
|
991
991
|
B,
|
|
992
992
|
v,
|
|
993
993
|
l
|
|
@@ -996,24 +996,24 @@ function Nr({
|
|
|
996
996
|
function Q() {
|
|
997
997
|
return u && R.current ? R.current[d === "x" ? "scrollLeft" : "scrollTop"] : Z.val.get();
|
|
998
998
|
}
|
|
999
|
-
function
|
|
999
|
+
function _e(r, o) {
|
|
1000
1000
|
if (u && r === "next") {
|
|
1001
|
-
const a = s.current +
|
|
1001
|
+
const a = s.current + I();
|
|
1002
1002
|
return a > D() ? D() : a;
|
|
1003
1003
|
}
|
|
1004
1004
|
if (u && r === "prev") {
|
|
1005
|
-
const a = s.current -
|
|
1005
|
+
const a = s.current - I();
|
|
1006
1006
|
return a < 0 ? 0 : a;
|
|
1007
1007
|
}
|
|
1008
|
-
return r === "next" ? typeof o == "number" ? -(o *
|
|
1008
|
+
return r === "next" ? typeof o == "number" ? -(o * I()) : s.current - I() : typeof o == "number" ? -(o * I()) : s.current + I();
|
|
1009
1009
|
}
|
|
1010
1010
|
function se({ type: r, index: o, immediate: a }) {
|
|
1011
1011
|
if (!p || K.current || b.current && !l)
|
|
1012
1012
|
return;
|
|
1013
1013
|
x.current && (me.current = "backward"), J.current = "prev", x.current = !1;
|
|
1014
|
-
const
|
|
1015
|
-
if (u &&
|
|
1016
|
-
const z = u ?
|
|
1014
|
+
const P = typeof o == "number" ? o : W.current - 1;
|
|
1015
|
+
if (u && je(), !l) {
|
|
1016
|
+
const z = u ? _e("prev", o) - I() / 3 < 0 : _e("prev", o) + I() / 3 > 0;
|
|
1017
1017
|
if (b.current)
|
|
1018
1018
|
return;
|
|
1019
1019
|
if (z) {
|
|
@@ -1027,21 +1027,21 @@ function Nr({
|
|
|
1027
1027
|
return;
|
|
1028
1028
|
}
|
|
1029
1029
|
}
|
|
1030
|
-
if (l && (b.current ||
|
|
1030
|
+
if (l && (b.current || P < 0)) {
|
|
1031
1031
|
b.current = !1, x.current = !0, ce({
|
|
1032
1032
|
slideMode: r,
|
|
1033
|
-
from: Q() -
|
|
1034
|
-
to: -(
|
|
1033
|
+
from: Q() - I() * i.length,
|
|
1034
|
+
to: -(I() * i.length) + I(),
|
|
1035
1035
|
nextActiveItem: i.length - 1,
|
|
1036
1036
|
immediate: a
|
|
1037
1037
|
});
|
|
1038
1038
|
return;
|
|
1039
1039
|
}
|
|
1040
|
-
|
|
1040
|
+
P === 0 && (b.current = !0), (P === i.length - 1 || P === -1) && (x.current = !0), ce({
|
|
1041
1041
|
slideMode: r,
|
|
1042
1042
|
from: Q(),
|
|
1043
|
-
to:
|
|
1044
|
-
nextActiveItem:
|
|
1043
|
+
to: _e("prev", o),
|
|
1044
|
+
nextActiveItem: P,
|
|
1045
1045
|
immediate: a
|
|
1046
1046
|
});
|
|
1047
1047
|
}
|
|
@@ -1049,9 +1049,9 @@ function Nr({
|
|
|
1049
1049
|
if (!p || K.current || x.current && !l)
|
|
1050
1050
|
return;
|
|
1051
1051
|
b.current && (me.current = "forward"), J.current = "next", b.current = !1;
|
|
1052
|
-
const
|
|
1053
|
-
if (u &&
|
|
1054
|
-
const z = Math.abs(
|
|
1052
|
+
const P = o || W.current + 1;
|
|
1053
|
+
if (u && je(), !l) {
|
|
1054
|
+
const z = Math.abs(_e("next", o)) > D() - I() / 3;
|
|
1055
1055
|
if (x.current)
|
|
1056
1056
|
return;
|
|
1057
1057
|
if (z) {
|
|
@@ -1059,39 +1059,39 @@ function Nr({
|
|
|
1059
1059
|
slideMode: r,
|
|
1060
1060
|
from: Q(),
|
|
1061
1061
|
to: u ? D() : -D(),
|
|
1062
|
-
nextActiveItem:
|
|
1062
|
+
nextActiveItem: P,
|
|
1063
1063
|
immediate: a
|
|
1064
1064
|
});
|
|
1065
1065
|
return;
|
|
1066
1066
|
}
|
|
1067
1067
|
}
|
|
1068
|
-
if (l && (x.current ||
|
|
1068
|
+
if (l && (x.current || P > i.length - 1)) {
|
|
1069
1069
|
x.current = !1, b.current = !0, ce({
|
|
1070
1070
|
slideMode: r,
|
|
1071
|
-
from: Q() +
|
|
1071
|
+
from: Q() + I() * i.length,
|
|
1072
1072
|
to: 0,
|
|
1073
1073
|
nextActiveItem: 0,
|
|
1074
1074
|
immediate: a
|
|
1075
1075
|
});
|
|
1076
1076
|
return;
|
|
1077
1077
|
}
|
|
1078
|
-
|
|
1078
|
+
P === 0 && (b.current = !0), P === i.length - 1 && (x.current = !0), ce({
|
|
1079
1079
|
slideMode: r,
|
|
1080
1080
|
from: Q(),
|
|
1081
|
-
to:
|
|
1082
|
-
nextActiveItem:
|
|
1081
|
+
to: _e("next", o),
|
|
1082
|
+
nextActiveItem: P,
|
|
1083
1083
|
immediate: a
|
|
1084
1084
|
});
|
|
1085
1085
|
}
|
|
1086
1086
|
function Ce() {
|
|
1087
|
-
|
|
1087
|
+
L ? oe.current = L : oe.current = Math.floor(I() / 2 / 2);
|
|
1088
1088
|
}
|
|
1089
1089
|
function Ke() {
|
|
1090
|
-
|
|
1090
|
+
V.current && (pe.current = D(), k.current = l, te.current = v, ne.current = u, g.current = window.innerWidth, s.current = 0, Ye({ id: 0, immediate: !0, shouldReset: !0 }), Ce(), ye());
|
|
1091
1091
|
}
|
|
1092
1092
|
const Ze = hr(
|
|
1093
1093
|
(r) => {
|
|
1094
|
-
const o = r.dragging, a = r.offset[d === "x" ? 0 : 1],
|
|
1094
|
+
const o = r.dragging, a = r.offset[d === "x" ? 0 : 1], P = r.movement[d === "x" ? 0 : 1], z = r.direction[d === "x" ? 0 : 1], fe = P > oe.current, de = P < -oe.current, rr = D(), ie = r.velocity;
|
|
1095
1095
|
if (o) {
|
|
1096
1096
|
if (z > 0 ? J.current = "prev" : J.current = "next", ue({
|
|
1097
1097
|
...r,
|
|
@@ -1136,7 +1136,7 @@ function Nr({
|
|
|
1136
1136
|
friction: 50,
|
|
1137
1137
|
tension: 1e3
|
|
1138
1138
|
}
|
|
1139
|
-
}),
|
|
1139
|
+
}), C && de ? (le({ type: "drag" }), r.cancel()) : C && fe && (se({ type: "drag" }), r.cancel()), rr - Math.abs(a) < -(I() * 2) && r.cancel();
|
|
1140
1140
|
return;
|
|
1141
1141
|
}
|
|
1142
1142
|
if (r.last && u && a > 0) {
|
|
@@ -1190,33 +1190,33 @@ function Nr({
|
|
|
1190
1190
|
] : d === "x" ? [Z.val.get(), Z.val.get()] : [Z.val.get(), Z.val.get()]
|
|
1191
1191
|
}
|
|
1192
1192
|
);
|
|
1193
|
-
function
|
|
1193
|
+
function Se() {
|
|
1194
1194
|
return u ? d === "x" ? {
|
|
1195
1195
|
overflowX: "auto"
|
|
1196
1196
|
} : {
|
|
1197
1197
|
overflowY: "auto"
|
|
1198
1198
|
} : {};
|
|
1199
1199
|
}
|
|
1200
|
-
function
|
|
1200
|
+
function je() {
|
|
1201
1201
|
R.current && (s.current = R.current[d === "x" ? "scrollLeft" : "scrollTop"], R.current[d === "x" ? "scrollLeft" : "scrollTop"] === 0 && (b.current = !0, x.current = !1), R.current[d === "x" ? "scrollLeft" : "scrollTop"] > 0 && R.current[d === "x" ? "scrollLeft" : "scrollTop"] < D() && (b.current = !1, x.current = !1), R.current[d === "x" ? "scrollLeft" : "scrollTop"] === D() && (b.current = !1, x.current = !0));
|
|
1202
1202
|
}
|
|
1203
1203
|
function er() {
|
|
1204
1204
|
return u ? {
|
|
1205
1205
|
onWheel() {
|
|
1206
|
-
Z.val.stop(),
|
|
1206
|
+
Z.val.stop(), je();
|
|
1207
1207
|
}
|
|
1208
1208
|
} : {};
|
|
1209
1209
|
}
|
|
1210
1210
|
function be(r, o) {
|
|
1211
1211
|
let a = 0;
|
|
1212
|
-
if (typeof r == "string" ? a = i.findIndex((
|
|
1212
|
+
if (typeof r == "string" ? a = i.findIndex((P) => P.id === r) : a = r, a < 0 || a >= i.length) {
|
|
1213
1213
|
if (o)
|
|
1214
1214
|
throw new Error(o);
|
|
1215
1215
|
console.error(`The item doesn't exist; check that the id provided - ${r} - is correct.`), a = -1;
|
|
1216
1216
|
}
|
|
1217
1217
|
return a;
|
|
1218
1218
|
}
|
|
1219
|
-
function Ye({ id: r, immediate: o, shouldReset: a, type:
|
|
1219
|
+
function Ye({ id: r, immediate: o, shouldReset: a, type: P }) {
|
|
1220
1220
|
if (!p || K.current)
|
|
1221
1221
|
return;
|
|
1222
1222
|
b.current = !1, x.current = !1;
|
|
@@ -1228,11 +1228,11 @@ function Nr({
|
|
|
1228
1228
|
return;
|
|
1229
1229
|
const fe = be(i[W.current].id), de = be(i[z].id);
|
|
1230
1230
|
de > fe ? le({
|
|
1231
|
-
type:
|
|
1231
|
+
type: P || a ? "initial" : "click",
|
|
1232
1232
|
index: de,
|
|
1233
1233
|
immediate: o
|
|
1234
1234
|
}) : se({
|
|
1235
|
-
type:
|
|
1235
|
+
type: P || a ? "initial" : "click",
|
|
1236
1236
|
index: de,
|
|
1237
1237
|
immediate: o
|
|
1238
1238
|
});
|
|
@@ -1253,7 +1253,7 @@ function Nr({
|
|
|
1253
1253
|
}
|
|
1254
1254
|
const Oe = u ? {
|
|
1255
1255
|
useListenToCustomEvent: ge,
|
|
1256
|
-
enterFullscreen:
|
|
1256
|
+
enterFullscreen: Ve,
|
|
1257
1257
|
exitFullscreen: ze,
|
|
1258
1258
|
getIsFullscreen: Xe,
|
|
1259
1259
|
slideToPrevItem: (r = !0) => {
|
|
@@ -1270,7 +1270,7 @@ function Nr({
|
|
|
1270
1270
|
}
|
|
1271
1271
|
} : {
|
|
1272
1272
|
useListenToCustomEvent: ge,
|
|
1273
|
-
enterFullscreen:
|
|
1273
|
+
enterFullscreen: Ve,
|
|
1274
1274
|
exitFullscreen: ze,
|
|
1275
1275
|
getIsFullscreen: Xe,
|
|
1276
1276
|
slideToPrevItem: (r = !0) => {
|
|
@@ -1293,23 +1293,23 @@ function Nr({
|
|
|
1293
1293
|
getIsActiveItem: qe
|
|
1294
1294
|
};
|
|
1295
1295
|
Rr(() => {
|
|
1296
|
-
|
|
1296
|
+
V.current && p && (re.current = !0, Ke());
|
|
1297
1297
|
}, [p]), he(() => {
|
|
1298
|
-
W.current !==
|
|
1299
|
-
id:
|
|
1300
|
-
immediate: !
|
|
1298
|
+
W.current !== F && (re.current = !0, Ye({
|
|
1299
|
+
id: F,
|
|
1300
|
+
immediate: !j
|
|
1301
1301
|
}));
|
|
1302
|
-
}, [
|
|
1302
|
+
}, [F]), he(() => {
|
|
1303
1303
|
if (p) {
|
|
1304
|
-
if (
|
|
1304
|
+
if (F > i.length - 1)
|
|
1305
1305
|
throw new Error(
|
|
1306
|
-
`initialActiveItem (${
|
|
1306
|
+
`initialActiveItem (${F}) is greater than the total quantity available items (${i.length}).`
|
|
1307
1307
|
);
|
|
1308
1308
|
q > i.length && console.warn(
|
|
1309
1309
|
`itemsPerSlide (${q}) is greater than the total quantity available items (${i.length}). Fallback to ${i.length})`
|
|
1310
1310
|
);
|
|
1311
1311
|
}
|
|
1312
|
-
}, [
|
|
1312
|
+
}, [F, i.length, q, p]), he(() => {
|
|
1313
1313
|
g.current = window.innerWidth;
|
|
1314
1314
|
}, []), he(() => {
|
|
1315
1315
|
if (p) {
|
|
@@ -1364,7 +1364,7 @@ function Nr({
|
|
|
1364
1364
|
};
|
|
1365
1365
|
}
|
|
1366
1366
|
}, [ye, D]);
|
|
1367
|
-
const xe = /* @__PURE__ */
|
|
1367
|
+
const xe = /* @__PURE__ */ H.jsx(ir.Provider, { value: Oe, children: Pe }), He = /* @__PURE__ */ H.jsx(ir.Provider, { value: Oe, children: /* @__PURE__ */ H.jsx(
|
|
1368
1368
|
"div",
|
|
1369
1369
|
{
|
|
1370
1370
|
className: "use-spring-carousel-main-wrapper",
|
|
@@ -1375,23 +1375,23 @@ function Nr({
|
|
|
1375
1375
|
position: "relative",
|
|
1376
1376
|
width: "100%",
|
|
1377
1377
|
height: "100%",
|
|
1378
|
-
...
|
|
1378
|
+
...Se()
|
|
1379
1379
|
},
|
|
1380
|
-
children: /* @__PURE__ */
|
|
1380
|
+
children: /* @__PURE__ */ H.jsxs(
|
|
1381
1381
|
"div",
|
|
1382
1382
|
{
|
|
1383
1383
|
className: "use-spring-carousel-track-wrapper",
|
|
1384
|
-
ref:
|
|
1384
|
+
ref: V,
|
|
1385
1385
|
...Ze(),
|
|
1386
1386
|
style: {
|
|
1387
1387
|
position: "relative",
|
|
1388
1388
|
display: "flex",
|
|
1389
1389
|
flexDirection: d === "x" ? "row" : "column",
|
|
1390
1390
|
touchAction: Le(),
|
|
1391
|
-
...
|
|
1391
|
+
...Fe()
|
|
1392
1392
|
},
|
|
1393
1393
|
children: [
|
|
1394
|
-
(u || !l) && f ? /* @__PURE__ */
|
|
1394
|
+
(u || !l) && f ? /* @__PURE__ */ H.jsx(
|
|
1395
1395
|
"div",
|
|
1396
1396
|
{
|
|
1397
1397
|
style: {
|
|
@@ -1400,46 +1400,30 @@ function Nr({
|
|
|
1400
1400
|
}
|
|
1401
1401
|
}
|
|
1402
1402
|
) : null,
|
|
1403
|
-
Ie.map((r, o) => {
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1403
|
+
Ie.map((r, o) => /* @__PURE__ */ H.jsx(Er, { children: /* @__PURE__ */ H.jsx(
|
|
1404
|
+
"div",
|
|
1405
|
+
{
|
|
1406
|
+
className: "use-spring-carousel-item",
|
|
1407
|
+
"data-testid": "use-spring-carousel-item-wrapper",
|
|
1408
|
+
style: {
|
|
1409
|
+
display: "flex",
|
|
1410
|
+
position: "relative",
|
|
1411
|
+
...v === "fixed" ? { flex: "1" } : {},
|
|
1412
|
+
...ke(
|
|
1413
|
+
o === Ie.findIndex(
|
|
1414
|
+
(a) => a.id === Ie[Ie.length - 1].id
|
|
1415
|
+
)
|
|
1411
1416
|
)
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
}
|
|
1423
|
-
`.trim()
|
|
1424
|
-
}
|
|
1425
|
-
}
|
|
1426
|
-
),
|
|
1427
|
-
/* @__PURE__ */ L.jsx(
|
|
1428
|
-
"div",
|
|
1429
|
-
{
|
|
1430
|
-
className: "use-spring-carousel-item",
|
|
1431
|
-
"data-testid": "use-spring-carousel-item-wrapper",
|
|
1432
|
-
children: typeof r.renderItem == "function" ? r.renderItem({
|
|
1433
|
-
getIsActiveItem: qe,
|
|
1434
|
-
getIsNextItem: Ue,
|
|
1435
|
-
getIsPrevItem: Be,
|
|
1436
|
-
useListenToCustomEvent: ge
|
|
1437
|
-
}) : r.renderItem
|
|
1438
|
-
}
|
|
1439
|
-
)
|
|
1440
|
-
] }, `${r.id}-${o}`);
|
|
1441
|
-
}),
|
|
1442
|
-
(u || !l) && f ? /* @__PURE__ */ L.jsx(
|
|
1417
|
+
},
|
|
1418
|
+
children: typeof r.renderItem == "function" ? r.renderItem({
|
|
1419
|
+
getIsActiveItem: qe,
|
|
1420
|
+
getIsNextItem: Ue,
|
|
1421
|
+
getIsPrevItem: Be,
|
|
1422
|
+
useListenToCustomEvent: ge
|
|
1423
|
+
}) : r.renderItem
|
|
1424
|
+
}
|
|
1425
|
+
) }, `${r.id}-${o}`)),
|
|
1426
|
+
(u || !l) && f ? /* @__PURE__ */ H.jsx(
|
|
1443
1427
|
"div",
|
|
1444
1428
|
{
|
|
1445
1429
|
style: {
|
|
@@ -1456,7 +1440,7 @@ function Nr({
|
|
|
1456
1440
|
return { ...Oe, carouselFragment: He, thumbsFragment: xe };
|
|
1457
1441
|
}
|
|
1458
1442
|
const ir = fr(void 0);
|
|
1459
|
-
function
|
|
1443
|
+
function Vr() {
|
|
1460
1444
|
const i = dr(ir);
|
|
1461
1445
|
if (!i)
|
|
1462
1446
|
throw new Error("useSpringCarouselContext must be used within the carousel.");
|
|
@@ -1480,7 +1464,7 @@ const Me = {
|
|
|
1480
1464
|
position: "absolute"
|
|
1481
1465
|
}
|
|
1482
1466
|
};
|
|
1483
|
-
function
|
|
1467
|
+
function Sr({
|
|
1484
1468
|
init: i = !0,
|
|
1485
1469
|
disableGestures: p = !1,
|
|
1486
1470
|
items: y,
|
|
@@ -1492,15 +1476,15 @@ function Vr({
|
|
|
1492
1476
|
toPrevItemSpringProps: f = Me,
|
|
1493
1477
|
toNextItemSpringProps: d = Me,
|
|
1494
1478
|
draggingSlideTreshold: M = 50,
|
|
1495
|
-
thumbsSlideAxis:
|
|
1479
|
+
thumbsSlideAxis: L = "x"
|
|
1496
1480
|
}) {
|
|
1497
|
-
const
|
|
1498
|
-
thumbsSlideAxis:
|
|
1481
|
+
const C = O("next"), u = O("initial"), U = O(null), [T, ae] = Tr(l ?? 0), { emitEvent: F, useListenToCustomEvent: j } = mr(), { handleScroll: G, thumbsFragment: Ne } = pr({
|
|
1482
|
+
thumbsSlideAxis: L,
|
|
1499
1483
|
items: y,
|
|
1500
1484
|
renderThumbFnProps: {
|
|
1501
1485
|
getIsNextItem: W,
|
|
1502
1486
|
getIsPrevItem: b,
|
|
1503
|
-
useListenToCustomEvent:
|
|
1487
|
+
useListenToCustomEvent: j,
|
|
1504
1488
|
activeItem: {
|
|
1505
1489
|
index: T,
|
|
1506
1490
|
id: y[T].id
|
|
@@ -1508,7 +1492,7 @@ function Vr({
|
|
|
1508
1492
|
}
|
|
1509
1493
|
});
|
|
1510
1494
|
function ee() {
|
|
1511
|
-
return
|
|
1495
|
+
return C.current === "prev" ? {
|
|
1512
1496
|
initial: {
|
|
1513
1497
|
...f.initial
|
|
1514
1498
|
},
|
|
@@ -1521,7 +1505,7 @@ function Vr({
|
|
|
1521
1505
|
leave: {
|
|
1522
1506
|
...f.leave
|
|
1523
1507
|
}
|
|
1524
|
-
} :
|
|
1508
|
+
} : C.current === "next" ? {
|
|
1525
1509
|
initial: {
|
|
1526
1510
|
...d.initial
|
|
1527
1511
|
},
|
|
@@ -1553,9 +1537,9 @@ function Vr({
|
|
|
1553
1537
|
typeof l == "number" && l !== T && ae(l);
|
|
1554
1538
|
}, [l]);
|
|
1555
1539
|
function q({ to: g, slideType: s, slideMode: k }) {
|
|
1556
|
-
|
|
1540
|
+
C.current = s, u.current = k, F({
|
|
1557
1541
|
eventName: "onSlideStartChange",
|
|
1558
|
-
slideActionType:
|
|
1542
|
+
slideActionType: C.current,
|
|
1559
1543
|
slideMode: u.current,
|
|
1560
1544
|
nextItem: {
|
|
1561
1545
|
index: g,
|
|
@@ -1593,16 +1577,16 @@ function Vr({
|
|
|
1593
1577
|
slideMode: g
|
|
1594
1578
|
});
|
|
1595
1579
|
}
|
|
1596
|
-
const J =
|
|
1580
|
+
const J = wr(T, {
|
|
1597
1581
|
config: $,
|
|
1598
1582
|
key: null,
|
|
1599
1583
|
trail: v,
|
|
1600
1584
|
exitBeforeEnter: Y,
|
|
1601
1585
|
...ee(),
|
|
1602
1586
|
onRest(g, s, k) {
|
|
1603
|
-
g.finished && k === T &&
|
|
1587
|
+
g.finished && k === T && F({
|
|
1604
1588
|
eventName: "onSlideChange",
|
|
1605
|
-
slideActionType:
|
|
1589
|
+
slideActionType: C.current,
|
|
1606
1590
|
slideMode: u.current,
|
|
1607
1591
|
currentItem: {
|
|
1608
1592
|
index: T,
|
|
@@ -1619,13 +1603,13 @@ function Vr({
|
|
|
1619
1603
|
if (te) {
|
|
1620
1604
|
if (!w && K)
|
|
1621
1605
|
return;
|
|
1622
|
-
|
|
1606
|
+
F({
|
|
1623
1607
|
eventName: "onLeftSwipe"
|
|
1624
1608
|
}), oe("swipe");
|
|
1625
1609
|
} else if (k) {
|
|
1626
1610
|
if (!w && ne)
|
|
1627
1611
|
return;
|
|
1628
|
-
|
|
1612
|
+
F({
|
|
1629
1613
|
eventName: "onRightSwipe"
|
|
1630
1614
|
}), re("swipe");
|
|
1631
1615
|
}
|
|
@@ -1654,8 +1638,8 @@ function Vr({
|
|
|
1654
1638
|
}
|
|
1655
1639
|
const x = J((g, s, k, te) => {
|
|
1656
1640
|
const ne = y[s].renderItem;
|
|
1657
|
-
return /* @__PURE__ */
|
|
1658
|
-
|
|
1641
|
+
return /* @__PURE__ */ H.jsx(
|
|
1642
|
+
_r.div,
|
|
1659
1643
|
{
|
|
1660
1644
|
id: `use-transition-carousel-item-${te}`,
|
|
1661
1645
|
className: "use-transition-carousel-item",
|
|
@@ -1666,7 +1650,7 @@ function Vr({
|
|
|
1666
1650
|
height: "100%"
|
|
1667
1651
|
},
|
|
1668
1652
|
children: typeof ne == "function" ? ne({
|
|
1669
|
-
useListenToCustomEvent:
|
|
1653
|
+
useListenToCustomEvent: j,
|
|
1670
1654
|
getIsNextItem: W,
|
|
1671
1655
|
getIsPrevItem: b,
|
|
1672
1656
|
activeItem: {
|
|
@@ -1677,10 +1661,10 @@ function Vr({
|
|
|
1677
1661
|
}
|
|
1678
1662
|
);
|
|
1679
1663
|
}), R = {
|
|
1680
|
-
useListenToCustomEvent:
|
|
1664
|
+
useListenToCustomEvent: j,
|
|
1681
1665
|
slideToPrevItem: () => re("click"),
|
|
1682
1666
|
slideToNextItem: () => oe("click")
|
|
1683
|
-
},
|
|
1667
|
+
}, V = /* @__PURE__ */ H.jsx(ar.Provider, { value: R, children: Ne }), pe = /* @__PURE__ */ H.jsx(ar.Provider, { value: R, children: /* @__PURE__ */ H.jsx(
|
|
1684
1668
|
"div",
|
|
1685
1669
|
{
|
|
1686
1670
|
ref: U,
|
|
@@ -1698,7 +1682,7 @@ function Vr({
|
|
|
1698
1682
|
return {
|
|
1699
1683
|
...R,
|
|
1700
1684
|
carouselFragment: pe,
|
|
1701
|
-
thumbsFragment:
|
|
1685
|
+
thumbsFragment: V
|
|
1702
1686
|
};
|
|
1703
1687
|
}
|
|
1704
1688
|
const ar = fr(void 0);
|
|
@@ -1710,8 +1694,8 @@ function Yr() {
|
|
|
1710
1694
|
}
|
|
1711
1695
|
export {
|
|
1712
1696
|
Nr as useSpringCarousel,
|
|
1713
|
-
|
|
1714
|
-
|
|
1697
|
+
Vr as useSpringCarouselContext,
|
|
1698
|
+
Sr as useTransitionCarousel,
|
|
1715
1699
|
Yr as useTransitionCarouselContext
|
|
1716
1700
|
};
|
|
1717
1701
|
//# sourceMappingURL=index.es.js.map
|