react-spring-carousel 3.0.0-beta090.51 → 3.0.0-beta090.52
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 +6 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +106 -106
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import lr, { useRef as O, useEffect as he, createContext as fr, useCallback as
|
|
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
2
|
import { useSpring as vr, config as Ie, 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";
|
|
@@ -10,7 +10,7 @@ var L = {}, Ir = {
|
|
|
10
10
|
set exports(n) {
|
|
11
11
|
L = n;
|
|
12
12
|
}
|
|
13
|
-
},
|
|
13
|
+
}, Le = {};
|
|
14
14
|
/**
|
|
15
15
|
* @license React
|
|
16
16
|
* react-jsx-runtime.production.min.js
|
|
@@ -23,7 +23,7 @@ var L = {}, Ir = {
|
|
|
23
23
|
var cr;
|
|
24
24
|
function kr() {
|
|
25
25
|
if (cr)
|
|
26
|
-
return
|
|
26
|
+
return Le;
|
|
27
27
|
cr = 1;
|
|
28
28
|
var n = lr, m = Symbol.for("react.element"), p = Symbol.for("react.fragment"), $ = Object.prototype.hasOwnProperty, B = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
29
29
|
function R(l, f, d) {
|
|
@@ -36,9 +36,9 @@ function kr() {
|
|
|
36
36
|
A[N] === void 0 && (A[N] = f[N]);
|
|
37
37
|
return { $$typeof: m, type: l, key: C, ref: u, props: A, _owner: B.current };
|
|
38
38
|
}
|
|
39
|
-
return
|
|
39
|
+
return Le.Fragment = p, Le.jsx = R, Le.jsxs = R, Le;
|
|
40
40
|
}
|
|
41
|
-
var
|
|
41
|
+
var He = {};
|
|
42
42
|
/**
|
|
43
43
|
* @license React
|
|
44
44
|
* react-jsx-runtime.development.js
|
|
@@ -76,10 +76,10 @@ function Pr() {
|
|
|
76
76
|
_.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, _);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
var
|
|
79
|
+
var We = !1, ne = !1, Y = !1, ie = !1, oe = !1, z;
|
|
80
80
|
z = Symbol.for("react.module.reference");
|
|
81
81
|
function Te(e) {
|
|
82
|
-
return !!(typeof e == "string" || typeof e == "function" || e === $ || e === v || oe || e === B || e === d || e === N || ie || e === u ||
|
|
82
|
+
return !!(typeof e == "string" || typeof e == "function" || e === $ || e === v || oe || e === B || e === d || e === N || ie || e === u || We || ne || Y || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === A || e.$$typeof === R || 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.
|
|
@@ -144,7 +144,7 @@ function Pr() {
|
|
|
144
144
|
function H() {
|
|
145
145
|
}
|
|
146
146
|
H.__reactDisabledLog = !0;
|
|
147
|
-
function
|
|
147
|
+
function Je() {
|
|
148
148
|
{
|
|
149
149
|
if (w === 0) {
|
|
150
150
|
M = console.log, me = console.info, pe = console.warn, c = console.error, T = console.group, I = console.groupCollapsed, X = console.groupEnd;
|
|
@@ -221,7 +221,7 @@ function Pr() {
|
|
|
221
221
|
var Ge = typeof WeakMap == "function" ? WeakMap : Map;
|
|
222
222
|
Pe = new Ge();
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function Ne(e, t) {
|
|
225
225
|
if (!e || ge)
|
|
226
226
|
return "";
|
|
227
227
|
{
|
|
@@ -234,7 +234,7 @@ function Pr() {
|
|
|
234
234
|
var E = Error.prepareStackTrace;
|
|
235
235
|
Error.prepareStackTrace = void 0;
|
|
236
236
|
var _;
|
|
237
|
-
_ = G.current, G.current = null,
|
|
237
|
+
_ = G.current, G.current = null, Je();
|
|
238
238
|
try {
|
|
239
239
|
if (t) {
|
|
240
240
|
var g = function() {
|
|
@@ -289,13 +289,13 @@ function Pr() {
|
|
|
289
289
|
} finally {
|
|
290
290
|
ge = !1, G.current = _, ke(), Error.prepareStackTrace = E;
|
|
291
291
|
}
|
|
292
|
-
var
|
|
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
|
-
function
|
|
296
|
-
return
|
|
295
|
+
function ze(e, t, i) {
|
|
296
|
+
return Ne(e, !1);
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function Xe(e) {
|
|
299
299
|
var t = e.prototype;
|
|
300
300
|
return !!(t && t.isReactComponent);
|
|
301
301
|
}
|
|
@@ -303,7 +303,7 @@ function Pr() {
|
|
|
303
303
|
if (e == null)
|
|
304
304
|
return "";
|
|
305
305
|
if (typeof e == "function")
|
|
306
|
-
return
|
|
306
|
+
return Ne(e, Xe(e));
|
|
307
307
|
if (typeof e == "string")
|
|
308
308
|
return ue(e);
|
|
309
309
|
switch (e) {
|
|
@@ -315,7 +315,7 @@ function Pr() {
|
|
|
315
315
|
if (typeof e == "object")
|
|
316
316
|
switch (e.$$typeof) {
|
|
317
317
|
case f:
|
|
318
|
-
return
|
|
318
|
+
return ze(e.render);
|
|
319
319
|
case A:
|
|
320
320
|
return Fe(e.type, t, i);
|
|
321
321
|
case C: {
|
|
@@ -379,14 +379,14 @@ function Pr() {
|
|
|
379
379
|
if (_e(e))
|
|
380
380
|
return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ee(e)), se(e);
|
|
381
381
|
}
|
|
382
|
-
var Ce = F.ReactCurrentOwner,
|
|
382
|
+
var Ce = F.ReactCurrentOwner, Ke = {
|
|
383
383
|
key: !0,
|
|
384
384
|
ref: !0,
|
|
385
385
|
__self: !0,
|
|
386
386
|
__source: !0
|
|
387
|
-
}, er,
|
|
388
|
-
|
|
389
|
-
function
|
|
387
|
+
}, er, Ze, Ve;
|
|
388
|
+
Ve = {};
|
|
389
|
+
function Qe(e) {
|
|
390
390
|
if (k.call(e, "ref")) {
|
|
391
391
|
var t = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
392
392
|
if (t && t.isReactWarning)
|
|
@@ -405,10 +405,10 @@ function Pr() {
|
|
|
405
405
|
function xe(e, t) {
|
|
406
406
|
if (typeof e.ref == "string" && Ce.current && t && Ce.current.stateNode !== t) {
|
|
407
407
|
var i = x(Ce.current.type);
|
|
408
|
-
|
|
408
|
+
Ve[i] || (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', x(Ce.current.type), e.ref), Ve[i] = !0);
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function Se(e, t) {
|
|
412
412
|
{
|
|
413
413
|
var i = function() {
|
|
414
414
|
er || (er = !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));
|
|
@@ -419,10 +419,10 @@ function Pr() {
|
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function Ye(e, t) {
|
|
423
423
|
{
|
|
424
424
|
var i = function() {
|
|
425
|
-
|
|
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
|
i.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
428
428
|
get: i,
|
|
@@ -430,7 +430,7 @@ function Pr() {
|
|
|
430
430
|
});
|
|
431
431
|
}
|
|
432
432
|
}
|
|
433
|
-
var
|
|
433
|
+
var Ue = function(e, t, i, s, E, _, g) {
|
|
434
434
|
var h = {
|
|
435
435
|
// This tag allows us to uniquely identify this as a React Element
|
|
436
436
|
$$typeof: m,
|
|
@@ -459,12 +459,12 @@ function Pr() {
|
|
|
459
459
|
value: E
|
|
460
460
|
}), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
|
|
461
461
|
};
|
|
462
|
-
function
|
|
462
|
+
function Be(e, t, i, s, E) {
|
|
463
463
|
{
|
|
464
464
|
var _, g = {}, h = null, J = null;
|
|
465
|
-
i !== void 0 && (le(i), h = "" + i), rr(t) && (le(t.key), h = "" + t.key),
|
|
465
|
+
i !== void 0 && (le(i), h = "" + i), rr(t) && (le(t.key), h = "" + t.key), Qe(t) && (J = t.ref, xe(t, E));
|
|
466
466
|
for (_ in t)
|
|
467
|
-
k.call(t, _) && !
|
|
467
|
+
k.call(t, _) && !Ke.hasOwnProperty(_) && (g[_] = t[_]);
|
|
468
468
|
if (e && e.defaultProps) {
|
|
469
469
|
var V = e.defaultProps;
|
|
470
470
|
for (_ in V)
|
|
@@ -472,28 +472,28 @@ function Pr() {
|
|
|
472
472
|
}
|
|
473
473
|
if (h || J) {
|
|
474
474
|
var S = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
475
|
-
h &&
|
|
475
|
+
h && Se(g, S), J && Ye(g, S);
|
|
476
476
|
}
|
|
477
|
-
return
|
|
477
|
+
return Ue(e, h, J, E, s, Ce.current, g);
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
var
|
|
480
|
+
var qe = F.ReactCurrentOwner, Oe = F.ReactDebugCurrentFrame;
|
|
481
481
|
function be(e) {
|
|
482
482
|
if (e) {
|
|
483
483
|
var t = e._owner, i = Fe(e.type, e._source, t ? t.type : null);
|
|
484
|
-
|
|
484
|
+
Oe.setExtraStackFrame(i);
|
|
485
485
|
} else
|
|
486
|
-
|
|
486
|
+
Oe.setExtraStackFrame(null);
|
|
487
487
|
}
|
|
488
|
-
var
|
|
489
|
-
|
|
488
|
+
var Ae;
|
|
489
|
+
Ae = !1;
|
|
490
490
|
function r(e) {
|
|
491
491
|
return typeof e == "object" && e !== null && e.$$typeof === m;
|
|
492
492
|
}
|
|
493
493
|
function o() {
|
|
494
494
|
{
|
|
495
|
-
if (
|
|
496
|
-
var e = x(
|
|
495
|
+
if (qe.current) {
|
|
496
|
+
var e = x(qe.current.type);
|
|
497
497
|
if (e)
|
|
498
498
|
return `
|
|
499
499
|
|
|
@@ -536,7 +536,7 @@ Check the top-level render call using <` + i + ">.");
|
|
|
536
536
|
return;
|
|
537
537
|
P[i] = !0;
|
|
538
538
|
var s = "";
|
|
539
|
-
e && e._owner && e._owner !==
|
|
539
|
+
e && e._owner && e._owner !== qe.current && (s = " It was passed a child from " + x(e._owner.type) + "."), be(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.', i, s), be(null);
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
542
|
function de(e, t) {
|
|
@@ -575,8 +575,8 @@ Check the top-level render call using <` + i + ">.");
|
|
|
575
575
|
if (i) {
|
|
576
576
|
var s = x(t);
|
|
577
577
|
Re(i, e.props, "prop", s, e);
|
|
578
|
-
} else if (t.PropTypes !== void 0 && !
|
|
579
|
-
|
|
578
|
+
} else if (t.PropTypes !== void 0 && !Ae) {
|
|
579
|
+
Ae = !0;
|
|
580
580
|
var E = x(t);
|
|
581
581
|
j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", E || "Unknown");
|
|
582
582
|
}
|
|
@@ -606,7 +606,7 @@ Check the top-level render call using <` + i + ">.");
|
|
|
606
606
|
var V;
|
|
607
607
|
e === null ? V = "null" : ye(e) ? V = "array" : e !== void 0 && e.$$typeof === m ? (V = "<" + (x(e.type) || "Unknown") + " />", h = " Did you accidentally export a JSX literal instead of a component?") : V = 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", V, h);
|
|
608
608
|
}
|
|
609
|
-
var S =
|
|
609
|
+
var S = Be(e, t, i, E, _);
|
|
610
610
|
if (S == null)
|
|
611
611
|
return S;
|
|
612
612
|
if (g) {
|
|
@@ -614,8 +614,8 @@ Check the top-level render call using <` + i + ">.");
|
|
|
614
614
|
if (Z !== void 0)
|
|
615
615
|
if (s)
|
|
616
616
|
if (ye(Z)) {
|
|
617
|
-
for (var
|
|
618
|
-
de(Z[
|
|
617
|
+
for (var $e = 0; $e < Z.length; $e++)
|
|
618
|
+
de(Z[$e], e);
|
|
619
619
|
Object.freeze && Object.freeze(Z);
|
|
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.");
|
|
@@ -632,8 +632,8 @@ Check the top-level render call using <` + i + ">.");
|
|
|
632
632
|
return nr(e, t, i, !1);
|
|
633
633
|
}
|
|
634
634
|
var xr = yr, br = gr;
|
|
635
|
-
|
|
636
|
-
}()),
|
|
635
|
+
He.Fragment = $, He.jsx = xr, He.jsxs = br;
|
|
636
|
+
}()), He;
|
|
637
637
|
}
|
|
638
638
|
(function(n) {
|
|
639
639
|
process.env.NODE_ENV === "production" ? n.exports = kr() : n.exports = Pr();
|
|
@@ -803,10 +803,10 @@ function Nr({
|
|
|
803
803
|
initialActiveItem: F = 0,
|
|
804
804
|
animateWhenActiveItemChange: j = !0,
|
|
805
805
|
slideGroupOfItems: te = !1,
|
|
806
|
-
__unstable_stretch_tems__:
|
|
806
|
+
__unstable_stretch_tems__: We = !0,
|
|
807
807
|
slideAmount: ne
|
|
808
808
|
}) {
|
|
809
|
-
const Y = B, ie = O(!1), oe = O(A ?? 0), z = O("initial"), Te = O("initial"), Q = O("initial"), D = O(F), x = O(F === 0), b = O(v === "fixed" && F === n.length - 1), w = O(null), M = O(null), me = O(0), pe = O(0), c = O(0), T = O(l), I = O(v), X = O(u), H = O(!1), ke =
|
|
809
|
+
const Y = B, ie = O(!1), oe = O(A ?? 0), z = O("initial"), Te = O("initial"), Q = O("initial"), D = O(F), x = O(F === 0), b = O(v === "fixed" && F === n.length - 1), w = O(null), M = O(null), me = O(0), pe = O(0), c = O(0), T = O(l), I = O(v), X = O(u), H = O(!1), ke = De(() => l ? [
|
|
810
810
|
...n.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: !m,
|
|
823
823
|
onChange: ({ value: r }) => {
|
|
824
|
-
u && w.current ? (d === "x" ? w.current.scrollLeft = Math.abs(r.val) : w.current.scrollTop = Math.abs(r.val),
|
|
824
|
+
u && w.current ? (d === "x" ? w.current.scrollLeft = Math.abs(r.val) : w.current.scrollTop = Math.abs(r.val), Qe()) : M.current && (d === "x" ? M.current.style.transform = `translate3d(${r.val}px, 0px,0px)` : M.current.style.transform = `translate3d(0px,${r.val}px,0px)`);
|
|
825
825
|
}
|
|
826
826
|
}),
|
|
827
827
|
[u]
|
|
@@ -831,12 +831,12 @@ function Nr({
|
|
|
831
831
|
prepareThumbsData: ae,
|
|
832
832
|
items: n,
|
|
833
833
|
renderThumbFnProps: {
|
|
834
|
-
getIsActiveItem:
|
|
835
|
-
getIsPrevItem:
|
|
834
|
+
getIsActiveItem: Be,
|
|
835
|
+
getIsPrevItem: Ue,
|
|
836
836
|
useListenToCustomEvent: ge,
|
|
837
|
-
getIsNextItem:
|
|
837
|
+
getIsNextItem: Ye
|
|
838
838
|
}
|
|
839
|
-
}), { enterFullscreen:
|
|
839
|
+
}), { enterFullscreen: Ne, exitFullscreen: ze, getIsFullscreen: Xe } = Fr({
|
|
840
840
|
mainCarouselWrapperRef: w,
|
|
841
841
|
handleResize: () => ye(),
|
|
842
842
|
onFullScreenChange: (r) => {
|
|
@@ -849,12 +849,12 @@ function Nr({
|
|
|
849
849
|
function Fe(r) {
|
|
850
850
|
return v === "fixed" && !u ? {
|
|
851
851
|
marginRight: `${r ? 0 : R}px`,
|
|
852
|
-
flex: `${
|
|
852
|
+
flex: `${We ? "1" : "0"} 0 calc(100% / ${Y} - ${R * (Y - 1) / Y}px)`
|
|
853
853
|
} : {
|
|
854
854
|
marginRight: `${r ? 0 : R}px`
|
|
855
855
|
};
|
|
856
856
|
}
|
|
857
|
-
const k =
|
|
857
|
+
const k = De(() => {
|
|
858
858
|
var a;
|
|
859
859
|
if (typeof ne == "number" && ne > 0 && (v === "fluid" || u))
|
|
860
860
|
return ne;
|
|
@@ -910,7 +910,7 @@ function Nr({
|
|
|
910
910
|
}
|
|
911
911
|
}), p && !P && Ge(D.current);
|
|
912
912
|
}
|
|
913
|
-
const W =
|
|
913
|
+
const W = De(() => {
|
|
914
914
|
var r;
|
|
915
915
|
return M.current ? l ? k() * n.length : Math.round(
|
|
916
916
|
Number(
|
|
@@ -925,19 +925,19 @@ function Nr({
|
|
|
925
925
|
height: d === "y" ? r : "100%"
|
|
926
926
|
};
|
|
927
927
|
}
|
|
928
|
-
const Re =
|
|
928
|
+
const Re = De(() => {
|
|
929
929
|
var o;
|
|
930
930
|
const r = (o = M.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"] + R;
|
|
934
|
-
}, [d, R]), we =
|
|
934
|
+
}, [d, R]), we = De(
|
|
935
935
|
(r) => {
|
|
936
936
|
const o = d === "x" ? "left" : "top", a = M.current;
|
|
937
937
|
a && (l ? (a.style.top = "0px", a.style.left = "0px", a.style[o] = `-${r - f}px`, x.current = !1, b.current = !1) : (a.style.left = "0px", a.style.top = "0px"));
|
|
938
938
|
},
|
|
939
939
|
[d, f, l]
|
|
940
|
-
), ye =
|
|
940
|
+
), ye = De(
|
|
941
941
|
(r = !1) => {
|
|
942
942
|
if (M.current && r && (M.current.style.transform = "translate3d(0px, 0px,0px)", M.current.style.left = "0", M.current.style.top = "0"), v === "fixed" && we(
|
|
943
943
|
y === "center" ? Re() * n.length - k() * Math.round((Y - 1) / 2) : y === "end" ? Re() * n.length - k() * Math.round(Y - 1) : Re() * n.length
|
|
@@ -1012,7 +1012,7 @@ function Nr({
|
|
|
1012
1012
|
return;
|
|
1013
1013
|
b.current && (Q.current = "backward"), z.current = "prev", b.current = !1;
|
|
1014
1014
|
const P = typeof o == "number" ? o : D.current - 1;
|
|
1015
|
-
if (
|
|
1015
|
+
if (!l) {
|
|
1016
1016
|
const K = u ? _e("prev", o) - k() / 3 < 0 : _e("prev", o) + k() / 3 > 0;
|
|
1017
1017
|
if (x.current)
|
|
1018
1018
|
return;
|
|
@@ -1037,7 +1037,7 @@ function Nr({
|
|
|
1037
1037
|
});
|
|
1038
1038
|
return;
|
|
1039
1039
|
}
|
|
1040
|
-
P === 0 && (x.current = !0), (P === n.length - 1 || P === -1) && (b.current = !0), ce({
|
|
1040
|
+
P === 0 && !u && (x.current = !0), (P === n.length - 1 || P === -1) && !u && (b.current = !0), ce({
|
|
1041
1041
|
slideMode: r,
|
|
1042
1042
|
from: ee(),
|
|
1043
1043
|
to: _e("prev", o),
|
|
@@ -1050,7 +1050,7 @@ function Nr({
|
|
|
1050
1050
|
return;
|
|
1051
1051
|
x.current && (Q.current = "forward"), z.current = "next", x.current = !1;
|
|
1052
1052
|
const P = o || D.current + 1;
|
|
1053
|
-
if (
|
|
1053
|
+
if (!l) {
|
|
1054
1054
|
const K = Math.abs(_e("next", o)) > W() - k() / 3;
|
|
1055
1055
|
if (b.current)
|
|
1056
1056
|
return;
|
|
@@ -1075,7 +1075,7 @@ function Nr({
|
|
|
1075
1075
|
});
|
|
1076
1076
|
return;
|
|
1077
1077
|
}
|
|
1078
|
-
P === 0 && (x.current = !0), P === n.length - 1 && (b.current = !0), ce({
|
|
1078
|
+
P === 0 && !u && (x.current = !0), P === n.length - 1 && !u && (b.current = !0), ce({
|
|
1079
1079
|
slideMode: r,
|
|
1080
1080
|
from: ee(),
|
|
1081
1081
|
to: _e("next", o),
|
|
@@ -1086,10 +1086,10 @@ function Nr({
|
|
|
1086
1086
|
function Ce() {
|
|
1087
1087
|
A ? oe.current = A : oe.current = Math.floor(k() / 2 / 2);
|
|
1088
1088
|
}
|
|
1089
|
-
function
|
|
1090
|
-
M.current && (me.current = W(), T.current = l, I.current = v, X.current = u, pe.current = window.innerWidth, c.current = 0,
|
|
1089
|
+
function Ke() {
|
|
1090
|
+
M.current && (me.current = W(), T.current = l, I.current = v, X.current = u, pe.current = window.innerWidth, c.current = 0, Se({ id: D.current, immediate: !0, shouldReset: !0 }), Ce(), ye());
|
|
1091
1091
|
}
|
|
1092
|
-
const
|
|
1092
|
+
const Ze = hr(
|
|
1093
1093
|
(r) => {
|
|
1094
1094
|
const o = r.dragging, a = r.offset[d === "x" ? 0 : 1], P = r.movement[d === "x" ? 0 : 1], K = r.direction[d === "x" ? 0 : 1], fe = P > oe.current, de = P < -oe.current, tr = W(), re = r.velocity;
|
|
1095
1095
|
if (o) {
|
|
@@ -1196,20 +1196,20 @@ function Nr({
|
|
|
1196
1196
|
] : d === "x" ? [G.val.get(), G.val.get()] : [G.val.get(), G.val.get()]
|
|
1197
1197
|
}
|
|
1198
1198
|
);
|
|
1199
|
-
function
|
|
1199
|
+
function Ve() {
|
|
1200
1200
|
return u ? d === "x" ? {
|
|
1201
1201
|
overflowX: "auto"
|
|
1202
1202
|
} : {
|
|
1203
1203
|
overflowY: "auto"
|
|
1204
1204
|
} : {};
|
|
1205
1205
|
}
|
|
1206
|
-
function
|
|
1206
|
+
function Qe() {
|
|
1207
1207
|
w.current && (c.current = w.current[d === "x" ? "scrollLeft" : "scrollTop"], w.current[d === "x" ? "scrollLeft" : "scrollTop"] === 0 && (x.current = !0, b.current = !1), w.current[d === "x" ? "scrollLeft" : "scrollTop"] > 0 && w.current[d === "x" ? "scrollLeft" : "scrollTop"] < W() && (x.current = !1, b.current = !1), w.current[d === "x" ? "scrollLeft" : "scrollTop"] === W() && (x.current = !1, b.current = !0));
|
|
1208
1208
|
}
|
|
1209
1209
|
function rr() {
|
|
1210
1210
|
return u ? {
|
|
1211
1211
|
onWheel() {
|
|
1212
|
-
G.val.stop(),
|
|
1212
|
+
G.val.stop(), Qe();
|
|
1213
1213
|
}
|
|
1214
1214
|
} : {};
|
|
1215
1215
|
}
|
|
@@ -1222,7 +1222,7 @@ function Nr({
|
|
|
1222
1222
|
}
|
|
1223
1223
|
return a;
|
|
1224
1224
|
}
|
|
1225
|
-
function
|
|
1225
|
+
function Se({ id: r, immediate: o, shouldReset: a, type: P }) {
|
|
1226
1226
|
if (!m || H.current)
|
|
1227
1227
|
return;
|
|
1228
1228
|
x.current = !1, b.current = !1;
|
|
@@ -1243,25 +1243,25 @@ function Nr({
|
|
|
1243
1243
|
immediate: o
|
|
1244
1244
|
});
|
|
1245
1245
|
}
|
|
1246
|
-
function
|
|
1246
|
+
function Ye(r) {
|
|
1247
1247
|
const o = xe(r, "The item doesn't exist; check the provided id."), a = D.current;
|
|
1248
1248
|
return l && a === n.length - 1 ? o === 0 : o === a + 1;
|
|
1249
1249
|
}
|
|
1250
|
-
function
|
|
1250
|
+
function Ue(r) {
|
|
1251
1251
|
const o = xe(r, "The item doesn't exist; check the provided id."), a = D.current;
|
|
1252
1252
|
return l && a === 0 ? o === n.length - 1 : o === a - 1;
|
|
1253
1253
|
}
|
|
1254
|
-
function
|
|
1254
|
+
function Be(r) {
|
|
1255
1255
|
return xe(r, "The item you want to check doesn't exist; check the provided id.") === D.current;
|
|
1256
1256
|
}
|
|
1257
|
-
function
|
|
1257
|
+
function qe() {
|
|
1258
1258
|
return N ? "unset" : d === "x" ? "pan-y" : "pan-x";
|
|
1259
1259
|
}
|
|
1260
|
-
const
|
|
1260
|
+
const Oe = u ? {
|
|
1261
1261
|
useListenToCustomEvent: ge,
|
|
1262
|
-
enterFullscreen:
|
|
1263
|
-
exitFullscreen:
|
|
1264
|
-
getIsFullscreen:
|
|
1262
|
+
enterFullscreen: Ne,
|
|
1263
|
+
exitFullscreen: ze,
|
|
1264
|
+
getIsFullscreen: Xe,
|
|
1265
1265
|
slideToPrevItem: (r = !0) => {
|
|
1266
1266
|
se({
|
|
1267
1267
|
type: "click",
|
|
@@ -1276,9 +1276,9 @@ function Nr({
|
|
|
1276
1276
|
}
|
|
1277
1277
|
} : {
|
|
1278
1278
|
useListenToCustomEvent: ge,
|
|
1279
|
-
enterFullscreen:
|
|
1280
|
-
exitFullscreen:
|
|
1281
|
-
getIsFullscreen:
|
|
1279
|
+
enterFullscreen: Ne,
|
|
1280
|
+
exitFullscreen: ze,
|
|
1281
|
+
getIsFullscreen: Xe,
|
|
1282
1282
|
slideToPrevItem: (r = !0) => {
|
|
1283
1283
|
se({
|
|
1284
1284
|
type: "click",
|
|
@@ -1292,16 +1292,16 @@ function Nr({
|
|
|
1292
1292
|
});
|
|
1293
1293
|
},
|
|
1294
1294
|
slideToItem: (r, o = !0) => {
|
|
1295
|
-
|
|
1295
|
+
Se({ id: r, immediate: !o });
|
|
1296
1296
|
},
|
|
1297
|
-
getIsNextItem:
|
|
1298
|
-
getIsPrevItem:
|
|
1299
|
-
getIsActiveItem:
|
|
1297
|
+
getIsNextItem: Ye,
|
|
1298
|
+
getIsPrevItem: Ue,
|
|
1299
|
+
getIsActiveItem: Be
|
|
1300
1300
|
};
|
|
1301
1301
|
Rr(() => {
|
|
1302
|
-
M.current && m && (ie.current = !0,
|
|
1302
|
+
M.current && m && (ie.current = !0, Ke());
|
|
1303
1303
|
}, [m]), he(() => {
|
|
1304
|
-
D.current !== F && (ie.current = !0,
|
|
1304
|
+
D.current !== F && (ie.current = !0, Se({
|
|
1305
1305
|
id: F,
|
|
1306
1306
|
immediate: !j
|
|
1307
1307
|
}));
|
|
@@ -1331,7 +1331,7 @@ function Nr({
|
|
|
1331
1331
|
throw new Error("`slideGroupOfItems` and `freeScroll` can't be used together.");
|
|
1332
1332
|
if (typeof ne == "number" && ne > 0 && v === "fixed")
|
|
1333
1333
|
throw new Error("`slideAmount` must be used with `slideType: fluid`");
|
|
1334
|
-
ie.current = !0,
|
|
1334
|
+
ie.current = !0, Ke();
|
|
1335
1335
|
}
|
|
1336
1336
|
}, [
|
|
1337
1337
|
y,
|
|
@@ -1370,7 +1370,7 @@ function Nr({
|
|
|
1370
1370
|
};
|
|
1371
1371
|
}
|
|
1372
1372
|
}, [ye, W]);
|
|
1373
|
-
const be = /* @__PURE__ */ L.jsx(ar.Provider, { value:
|
|
1373
|
+
const be = /* @__PURE__ */ L.jsx(ar.Provider, { value: Oe, children: Pe }), Ae = /* @__PURE__ */ L.jsx(ar.Provider, { value: Oe, children: /* @__PURE__ */ L.jsx(
|
|
1374
1374
|
"div",
|
|
1375
1375
|
{
|
|
1376
1376
|
className: "use-spring-carousel-main-wrapper",
|
|
@@ -1381,19 +1381,19 @@ function Nr({
|
|
|
1381
1381
|
position: "relative",
|
|
1382
1382
|
width: "100%",
|
|
1383
1383
|
height: "100%",
|
|
1384
|
-
...
|
|
1384
|
+
...Ve()
|
|
1385
1385
|
},
|
|
1386
1386
|
children: /* @__PURE__ */ L.jsxs(
|
|
1387
1387
|
"div",
|
|
1388
1388
|
{
|
|
1389
1389
|
className: "use-spring-carousel-track-wrapper",
|
|
1390
1390
|
ref: M,
|
|
1391
|
-
...
|
|
1391
|
+
...Ze(),
|
|
1392
1392
|
style: {
|
|
1393
1393
|
position: "relative",
|
|
1394
1394
|
display: "flex",
|
|
1395
1395
|
flexDirection: d === "x" ? "row" : "column",
|
|
1396
|
-
touchAction:
|
|
1396
|
+
touchAction: qe(),
|
|
1397
1397
|
...je()
|
|
1398
1398
|
},
|
|
1399
1399
|
children: [
|
|
@@ -1422,9 +1422,9 @@ function Nr({
|
|
|
1422
1422
|
)
|
|
1423
1423
|
},
|
|
1424
1424
|
children: typeof r.renderItem == "function" ? r.renderItem({
|
|
1425
|
-
getIsActiveItem:
|
|
1426
|
-
getIsNextItem:
|
|
1427
|
-
getIsPrevItem:
|
|
1425
|
+
getIsActiveItem: Be,
|
|
1426
|
+
getIsNextItem: Ye,
|
|
1427
|
+
getIsPrevItem: Ue,
|
|
1428
1428
|
useListenToCustomEvent: ge
|
|
1429
1429
|
}) : r.renderItem
|
|
1430
1430
|
}
|
|
@@ -1443,7 +1443,7 @@ function Nr({
|
|
|
1443
1443
|
)
|
|
1444
1444
|
}
|
|
1445
1445
|
) });
|
|
1446
|
-
return {
|
|
1446
|
+
return { ...Oe, carouselFragment: Ae, thumbsFragment: be };
|
|
1447
1447
|
}
|
|
1448
1448
|
const ar = fr(void 0);
|
|
1449
1449
|
function Vr() {
|
|
@@ -1452,7 +1452,7 @@ function Vr() {
|
|
|
1452
1452
|
throw new Error("useSpringCarouselContext must be used within the carousel.");
|
|
1453
1453
|
return n;
|
|
1454
1454
|
}
|
|
1455
|
-
const
|
|
1455
|
+
const Me = {
|
|
1456
1456
|
initial: {
|
|
1457
1457
|
opacity: 1,
|
|
1458
1458
|
position: "relative"
|
|
@@ -1479,12 +1479,12 @@ function Sr({
|
|
|
1479
1479
|
trail: v,
|
|
1480
1480
|
withLoop: R = !1,
|
|
1481
1481
|
activeItem: l,
|
|
1482
|
-
toPrevItemSpringProps: f =
|
|
1483
|
-
toNextItemSpringProps: d =
|
|
1482
|
+
toPrevItemSpringProps: f = Me,
|
|
1483
|
+
toNextItemSpringProps: d = Me,
|
|
1484
1484
|
draggingSlideTreshold: N = 50,
|
|
1485
1485
|
thumbsSlideAxis: A = "x"
|
|
1486
1486
|
}) {
|
|
1487
|
-
const C = O("next"), u = O("initial"), q = O(null), [y, ae] = Tr(l ?? 0), { emitEvent: F, useListenToCustomEvent: j } = mr(), { handleScroll: te, thumbsFragment:
|
|
1487
|
+
const C = O("next"), u = O("initial"), q = O(null), [y, ae] = Tr(l ?? 0), { emitEvent: F, useListenToCustomEvent: j } = mr(), { handleScroll: te, thumbsFragment: We } = pr({
|
|
1488
1488
|
thumbsSlideAxis: A,
|
|
1489
1489
|
items: p,
|
|
1490
1490
|
renderThumbFnProps: {
|
|
@@ -1526,16 +1526,16 @@ function Sr({
|
|
|
1526
1526
|
}
|
|
1527
1527
|
} : {
|
|
1528
1528
|
initial: {
|
|
1529
|
-
...
|
|
1529
|
+
...Me.initial
|
|
1530
1530
|
},
|
|
1531
1531
|
from: {
|
|
1532
|
-
...
|
|
1532
|
+
...Me.from
|
|
1533
1533
|
},
|
|
1534
1534
|
enter: {
|
|
1535
|
-
...
|
|
1535
|
+
...Me.enter
|
|
1536
1536
|
},
|
|
1537
1537
|
leave: {
|
|
1538
|
-
...
|
|
1538
|
+
...Me.leave
|
|
1539
1539
|
}
|
|
1540
1540
|
};
|
|
1541
1541
|
}
|
|
@@ -1605,9 +1605,9 @@ function Sr({
|
|
|
1605
1605
|
}), Te = hr(
|
|
1606
1606
|
({ last: c, movement: [T] }) => {
|
|
1607
1607
|
if (c) {
|
|
1608
|
-
const I = T > N, X = T < -N, H = y === 0,
|
|
1608
|
+
const I = T > N, X = T < -N, H = y === 0, Je = y === p.length - 1;
|
|
1609
1609
|
if (X) {
|
|
1610
|
-
if (!R &&
|
|
1610
|
+
if (!R && Je)
|
|
1611
1611
|
return;
|
|
1612
1612
|
F({
|
|
1613
1613
|
eventName: "onLeftSwipe"
|
|
@@ -1689,7 +1689,7 @@ function Sr({
|
|
|
1689
1689
|
slideMode: "click"
|
|
1690
1690
|
});
|
|
1691
1691
|
}
|
|
1692
|
-
}, me = /* @__PURE__ */ L.jsx(or.Provider, { value: M, children:
|
|
1692
|
+
}, me = /* @__PURE__ */ L.jsx(or.Provider, { value: M, children: We }), pe = /* @__PURE__ */ L.jsx(or.Provider, { value: M, children: /* @__PURE__ */ L.jsx(
|
|
1693
1693
|
"div",
|
|
1694
1694
|
{
|
|
1695
1695
|
className: "use-transition-carousel-wrapper",
|