react-spring-carousel 3.0.0-beta085 → 3.0.0-beta086

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.es.js CHANGED
@@ -76,10 +76,10 @@ function Pr() {
76
76
  R.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, R);
77
77
  }
78
78
  }
79
- var X = !1, fe = !1, ee = !1, z = !1, de = !1, ve;
79
+ var X = !1, oe = !1, ee = !1, z = !1, de = !1, ve;
80
80
  ve = Symbol.for("react.module.reference");
81
81
  function U(e) {
82
- return !!(typeof e == "string" || typeof e == "function" || e === N || e === g || de || e === Y || e === f || e === M || z || e === u || X || fe || ee || typeof e == "object" && e !== null && (e.$$typeof === I || e.$$typeof === A || e.$$typeof === w || e.$$typeof === l || e.$$typeof === s || // This needs to include all possible module reference object
82
+ return !!(typeof e == "string" || typeof e == "function" || e === N || e === g || de || e === Y || e === f || e === M || z || e === u || X || oe || ee || typeof e == "object" && e !== null && (e.$$typeof === I || e.$$typeof === A || e.$$typeof === w || e.$$typeof === l || e.$$typeof === s || // 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.
@@ -140,18 +140,18 @@ function Pr() {
140
140
  }
141
141
  return null;
142
142
  }
143
- var P = Object.assign, K = 0, me, k, y, E, O, q, oe;
144
- function ae() {
145
- }
146
- ae.__reactDisabledLog = !0;
143
+ var P = Object.assign, K = 0, me, k, y, E, O, q, ae;
147
144
  function ue() {
145
+ }
146
+ ue.__reactDisabledLog = !0;
147
+ function ce() {
148
148
  {
149
149
  if (K === 0) {
150
- me = console.log, k = console.info, y = console.warn, E = console.error, O = console.group, q = console.groupCollapsed, oe = console.groupEnd;
150
+ me = console.log, k = console.info, y = console.warn, E = console.error, O = console.group, q = console.groupCollapsed, ae = console.groupEnd;
151
151
  var e = {
152
152
  configurable: !0,
153
153
  enumerable: !0,
154
- value: ae,
154
+ value: ue,
155
155
  writable: !0
156
156
  };
157
157
  Object.defineProperties(console, {
@@ -195,7 +195,7 @@ function Pr() {
195
195
  value: q
196
196
  }),
197
197
  groupEnd: P({}, e, {
198
- value: oe
198
+ value: ae
199
199
  })
200
200
  });
201
201
  }
@@ -234,7 +234,7 @@ function Pr() {
234
234
  var x = Error.prepareStackTrace;
235
235
  Error.prepareStackTrace = void 0;
236
236
  var R;
237
- R = he.current, he.current = null, ue();
237
+ R = he.current, he.current = null, ce();
238
238
  try {
239
239
  if (t) {
240
240
  var v = function() {
@@ -247,29 +247,29 @@ function Pr() {
247
247
  }), typeof Reflect == "object" && Reflect.construct) {
248
248
  try {
249
249
  Reflect.construct(v, []);
250
- } catch (se) {
251
- c = se;
250
+ } catch (fe) {
251
+ c = fe;
252
252
  }
253
253
  Reflect.construct(e, [], v);
254
254
  } else {
255
255
  try {
256
256
  v.call();
257
- } catch (se) {
258
- c = se;
257
+ } catch (fe) {
258
+ c = fe;
259
259
  }
260
260
  e.call(v.prototype);
261
261
  }
262
262
  } else {
263
263
  try {
264
264
  throw Error();
265
- } catch (se) {
266
- c = se;
265
+ } catch (fe) {
266
+ c = fe;
267
267
  }
268
268
  e();
269
269
  }
270
- } catch (se) {
271
- if (se && c && typeof se.stack == "string") {
272
- for (var d = se.stack.split(`
270
+ } catch (fe) {
271
+ if (fe && c && typeof fe.stack == "string") {
272
+ for (var d = fe.stack.split(`
273
273
  `), H = c.stack.split(`
274
274
  `), S = d.length - 1, V = H.length - 1; S >= 1 && V >= 0 && d[S] !== H[V]; )
275
275
  V--;
@@ -356,7 +356,7 @@ function Pr() {
356
356
  }
357
357
  }
358
358
  var te = Array.isArray;
359
- function ce(e) {
359
+ function le(e) {
360
360
  return te(e);
361
361
  }
362
362
  function ye(e) {
@@ -513,7 +513,7 @@ Check your code at ` + t + ":" + n + ".";
513
513
  return "";
514
514
  }
515
515
  }
516
- var le = {};
516
+ var se = {};
517
517
  function Te(e) {
518
518
  {
519
519
  var t = _();
@@ -532,9 +532,9 @@ Check the top-level render call using <` + n + ">.");
532
532
  return;
533
533
  e._store.validated = !0;
534
534
  var n = Te(t);
535
- if (le[n])
535
+ if (se[n])
536
536
  return;
537
- le[n] = !0;
537
+ se[n] = !0;
538
538
  var c = "";
539
539
  e && e._owner && e._owner !== Ue.current && (c = " It was passed a child from " + p(e._owner.type) + "."), r(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), r(null);
540
540
  }
@@ -543,7 +543,7 @@ Check the top-level render call using <` + n + ">.");
543
543
  {
544
544
  if (typeof e != "object")
545
545
  return;
546
- if (ce(e))
546
+ if (le(e))
547
547
  for (var n = 0; n < e.length; n++) {
548
548
  var c = e[n];
549
549
  o(c) && Xe(c, t);
@@ -604,7 +604,7 @@ Check the top-level render call using <` + n + ">.");
604
604
  var H = Q(x);
605
605
  H ? d += H : d += _();
606
606
  var S;
607
- e === null ? S = "null" : ce(e) ? S = "array" : e !== void 0 && e.$$typeof === m ? (S = "<" + (p(e.type) || "Unknown") + " />", d = " Did you accidentally export a JSX literal instead of a component?") : S = 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", S, d);
607
+ e === null ? S = "null" : le(e) ? S = "array" : e !== void 0 && e.$$typeof === m ? (S = "<" + (p(e.type) || "Unknown") + " />", d = " Did you accidentally export a JSX literal instead of a component?") : S = 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", S, d);
608
608
  }
609
609
  var V = Z(e, t, n, x, R);
610
610
  if (V == null)
@@ -613,7 +613,7 @@ Check the top-level render call using <` + n + ">.");
613
613
  var G = t.children;
614
614
  if (G !== void 0)
615
615
  if (c)
616
- if (ce(G)) {
616
+ if (le(G)) {
617
617
  for (var Oe = 0; Oe < G.length; Oe++)
618
618
  Ge(G[Oe], e);
619
619
  Object.freeze && Object.freeze(G);
@@ -804,7 +804,7 @@ function Mr({
804
804
  animateWhenActiveItemChange: j = !0,
805
805
  getControllerRef: Re
806
806
  }) {
807
- const X = Y > i.length ? i.length : Y, fe = D(!1), ee = D(A ?? 0), z = D("initial"), de = D("initial"), ve = D("initial"), U = D(F), C = D(F === 0), T = D(g === "fixed" && F === i.length - 1), p = D(null), P = D(null), K = D(0), me = D(0), k = D(0), y = D(l), E = D(g), O = D(u), q = D(!1), ae = br(() => l ? [
807
+ const X = Y > i.length ? i.length : Y, oe = D(!1), ee = D(A ?? 0), z = D("initial"), de = D("initial"), ve = D("initial"), U = D(F), C = D(F === 0), T = D(g === "fixed" && F === i.length - 1), p = D(null), P = D(null), K = D(0), me = D(0), k = D(0), y = D(l), E = D(g), O = D(u), q = D(!1), ue = br(() => l ? [
808
808
  ...i.map((r) => ({
809
809
  ...r,
810
810
  id: `prev-repeated-item-${r.id}`
@@ -814,7 +814,7 @@ function Mr({
814
814
  ...r,
815
815
  id: `next-repeated-item-${r.id}`
816
816
  }))
817
- ] : [...i], [i, l])(), [ue, L] = sr(
817
+ ] : [...i], [i, l])(), [ce, L] = sr(
818
818
  () => ({
819
819
  val: 0,
820
820
  pause: !m,
@@ -880,10 +880,10 @@ function Mr({
880
880
  },
881
881
  config: {
882
882
  ...je.default,
883
- velocity: ue.val.velocity
883
+ velocity: ce.val.velocity
884
884
  },
885
- onRest(le) {
886
- !_ && le.finished && he({
885
+ onRest(se) {
886
+ !_ && se.finished && he({
887
887
  eventName: "onSlideChange",
888
888
  slideActionType: z.current,
889
889
  slideMode: de.current,
@@ -960,14 +960,14 @@ function Mr({
960
960
  val: a
961
961
  });
962
962
  setTimeout(() => {
963
- fe.current = !1;
963
+ oe.current = !1;
964
964
  }, 0);
965
965
  }
966
966
  }
967
967
  function te() {
968
- return u && p.current ? p.current[f === "x" ? "scrollLeft" : "scrollTop"] : ue.val.get();
968
+ return u && p.current ? p.current[f === "x" ? "scrollLeft" : "scrollTop"] : ce.val.get();
969
969
  }
970
- function ce(r, a) {
970
+ function le(r, a) {
971
971
  if (u && r === "next") {
972
972
  const o = k.current + W();
973
973
  return o > $() ? $() : o;
@@ -984,7 +984,7 @@ function Mr({
984
984
  T.current && (ve.current = "backward"), z.current = "prev", T.current = !1;
985
985
  const _ = typeof a == "number" ? a : U.current - 1;
986
986
  if (u && _e(), !l) {
987
- const Q = u ? ce("prev", a) - W() / 3 < 0 : ce("prev", a) + W() / 3 > 0;
987
+ const Q = u ? le("prev", a) - W() / 3 < 0 : le("prev", a) + W() / 3 > 0;
988
988
  if (C.current)
989
989
  return;
990
990
  if (Q) {
@@ -1011,7 +1011,7 @@ function Mr({
1011
1011
  _ === 0 && (C.current = !0), (_ === i.length - 1 || _ === -1) && (T.current = !0), re({
1012
1012
  slideMode: r,
1013
1013
  from: te(),
1014
- to: ce("prev", a),
1014
+ to: le("prev", a),
1015
1015
  nextActiveItem: _,
1016
1016
  immediate: o
1017
1017
  });
@@ -1022,7 +1022,7 @@ function Mr({
1022
1022
  C.current && (ve.current = "forward"), z.current = "next", C.current = !1;
1023
1023
  const _ = a || U.current + 1;
1024
1024
  if (u && _e(), !l) {
1025
- const Q = Math.abs(ce("next", a)) > $() - W() / 3;
1025
+ const Q = Math.abs(le("next", a)) > $() - W() / 3;
1026
1026
  if (T.current)
1027
1027
  return;
1028
1028
  if (Q) {
@@ -1049,7 +1049,7 @@ function Mr({
1049
1049
  _ === 0 && (C.current = !0), _ === i.length - 1 && (T.current = !0), re({
1050
1050
  slideMode: r,
1051
1051
  from: te(),
1052
- to: ce("next", a),
1052
+ to: le("next", a),
1053
1053
  nextActiveItem: _,
1054
1054
  immediate: o
1055
1055
  });
@@ -1062,7 +1062,7 @@ function Mr({
1062
1062
  }
1063
1063
  const Ze = fr(
1064
1064
  (r) => {
1065
- const a = r.dragging, o = r.offset[f === "x" ? 0 : 1], _ = r.movement[f === "x" ? 0 : 1], Q = r.direction[f === "x" ? 0 : 1], le = _ > ee.current, Te = _ < -ee.current, Xe = $();
1065
+ const a = r.dragging, o = r.offset[f === "x" ? 0 : 1], _ = r.movement[f === "x" ? 0 : 1], Q = r.direction[f === "x" ? 0 : 1], se = _ > ee.current, Te = _ < -ee.current, Xe = $();
1066
1066
  if (a) {
1067
1067
  if (Q > 0 ? z.current = "prev" : z.current = "next", he({
1068
1068
  ...r,
@@ -1107,7 +1107,7 @@ function Mr({
1107
1107
  friction: 50,
1108
1108
  tension: 1e3
1109
1109
  }
1110
- }), I && Te ? (xe({ type: "drag" }), r.cancel()) : I && le && (ye({ type: "drag" }), r.cancel()), Xe - Math.abs(o) < -(W() * 2) && r.cancel();
1110
+ }), I && Te ? (xe({ type: "drag" }), r.cancel()) : I && se && (ye({ type: "drag" }), r.cancel()), Xe - Math.abs(o) < -(W() * 2) && r.cancel();
1111
1111
  return;
1112
1112
  }
1113
1113
  if (r.last && u && o > 0) {
@@ -1132,7 +1132,7 @@ function Mr({
1132
1132
  ...je.default,
1133
1133
  velocity: r.velocity
1134
1134
  }
1135
- }) : xe({ type: "drag" }) : le ? !l && C.current ? L.start({
1135
+ }) : xe({ type: "drag" }) : se ? !l && C.current ? L.start({
1136
1136
  val: 0,
1137
1137
  config: {
1138
1138
  ...je.default,
@@ -1158,7 +1158,7 @@ function Mr({
1158
1158
  from: () => u && p.current ? [
1159
1159
  -p.current.scrollLeft,
1160
1160
  -p.current.scrollTop
1161
- ] : f === "x" ? [ue.val.get(), ue.val.get()] : [ue.val.get(), ue.val.get()]
1161
+ ] : f === "x" ? [ce.val.get(), ce.val.get()] : [ce.val.get(), ce.val.get()]
1162
1162
  }
1163
1163
  );
1164
1164
  function Je() {
@@ -1174,7 +1174,7 @@ function Mr({
1174
1174
  function Me() {
1175
1175
  return u ? {
1176
1176
  onWheel() {
1177
- ue.val.stop(), _e();
1177
+ ce.val.stop(), _e();
1178
1178
  }
1179
1179
  } : {};
1180
1180
  }
@@ -1197,8 +1197,8 @@ function Mr({
1197
1197
  );
1198
1198
  if (Q === U.current && !o)
1199
1199
  return;
1200
- const le = be(i[U.current].id), Te = be(i[Q].id);
1201
- Te > le ? xe({
1200
+ const se = be(i[U.current].id), Te = be(i[Q].id);
1201
+ Te > se ? xe({
1202
1202
  type: _ || o ? "initial" : "click",
1203
1203
  index: Te,
1204
1204
  immediate: a
@@ -1264,12 +1264,12 @@ function Mr({
1264
1264
  getIsActiveItem: Ye
1265
1265
  };
1266
1266
  Er(() => {
1267
- P.current && m && (fe.current = !0, Ne());
1267
+ P.current && m && (oe.current = !0, Ne());
1268
1268
  }, [m]), ne(() => {
1269
- U.current !== F && We({
1269
+ U.current !== F && (oe.current = !0, We({
1270
1270
  id: F,
1271
1271
  immediate: !j
1272
- });
1272
+ }));
1273
1273
  }, [F]), ne(() => {
1274
1274
  if (m) {
1275
1275
  if (F > i.length - 1)
@@ -1283,7 +1283,7 @@ function Mr({
1283
1283
  }, [F, i.length, X, m]), ne(() => {
1284
1284
  me.current = window.innerWidth;
1285
1285
  }, []), ne(() => {
1286
- m && (fe.current = !0, Ne());
1286
+ m && (oe.current = !0, Ne());
1287
1287
  }, [b, X, s, w, m, l]), ne(() => {
1288
1288
  if (!m)
1289
1289
  return;
@@ -1297,7 +1297,7 @@ function Mr({
1297
1297
  if (p.current) {
1298
1298
  let r;
1299
1299
  const a = new _r(() => {
1300
- if (!q.current && !fe.current) {
1300
+ if (!q.current && !oe.current) {
1301
1301
  me.current = window.innerWidth;
1302
1302
  const o = Pe();
1303
1303
  window.clearTimeout(r), r = setTimeout(() => {
@@ -1352,7 +1352,7 @@ function Mr({
1352
1352
  }
1353
1353
  }
1354
1354
  ) : null,
1355
- ae.map((r, a) => /* @__PURE__ */ J.jsx(
1355
+ ue.map((r, a) => /* @__PURE__ */ J.jsx(
1356
1356
  "div",
1357
1357
  {
1358
1358
  className: "use-spring-carousel-item",
@@ -1362,8 +1362,8 @@ function Mr({
1362
1362
  position: "relative",
1363
1363
  flex: "1",
1364
1364
  ...Ke(
1365
- a === ae.findIndex(
1366
- (o) => o.id === ae[ae.length - 1].id
1365
+ a === ue.findIndex(
1366
+ (o) => o.id === ue[ue.length - 1].id
1367
1367
  )
1368
1368
  )
1369
1369
  },
@@ -1444,7 +1444,7 @@ function Sr({
1444
1444
  }
1445
1445
  }
1446
1446
  });
1447
- function fe() {
1447
+ function oe() {
1448
1448
  return I.current === "prev" ? {
1449
1449
  initial: {
1450
1450
  ...s.initial
@@ -1535,7 +1535,7 @@ function Sr({
1535
1535
  key: null,
1536
1536
  trail: g,
1537
1537
  exitBeforeEnter: Y,
1538
- ...fe(),
1538
+ ...oe(),
1539
1539
  onRest(y, E, O) {
1540
1540
  y.finished && O === b && F({
1541
1541
  eventName: "onSlideChange",
@@ -1552,15 +1552,15 @@ function Sr({
1552
1552
  }), U = fr(
1553
1553
  ({ last: y, movement: [E] }) => {
1554
1554
  if (y) {
1555
- const O = E > M, q = E < -M, oe = b === 0, ae = b === h.length - 1;
1555
+ const O = E > M, q = E < -M, ae = b === 0, ue = b === h.length - 1;
1556
1556
  if (q) {
1557
- if (!w && ae)
1557
+ if (!w && ue)
1558
1558
  return;
1559
1559
  F({
1560
1560
  eventName: "onLeftSwipe"
1561
1561
  }), de("swipe");
1562
1562
  } else if (O) {
1563
- if (!w && oe)
1563
+ if (!w && ae)
1564
1564
  return;
1565
1565
  F({
1566
1566
  eventName: "onRightSwipe"
@@ -1590,7 +1590,7 @@ function Sr({
1590
1590
  return w && O === 0 ? E === h.length - 1 : E === O - 1;
1591
1591
  }
1592
1592
  const P = ve((y, E, O, q) => {
1593
- const oe = h[E].renderItem;
1593
+ const ae = h[E].renderItem;
1594
1594
  return /* @__PURE__ */ J.jsx(
1595
1595
  Ir.div,
1596
1596
  {
@@ -1602,7 +1602,7 @@ function Sr({
1602
1602
  width: "100%",
1603
1603
  height: "100%"
1604
1604
  },
1605
- children: typeof oe == "function" ? oe({
1605
+ children: typeof ae == "function" ? ae({
1606
1606
  useListenToCustomEvent: j,
1607
1607
  getIsNextItem: T,
1608
1608
  getIsPrevItem: p,
@@ -1610,7 +1610,7 @@ function Sr({
1610
1610
  index: b,
1611
1611
  id: h[b].id
1612
1612
  }
1613
- }) : oe
1613
+ }) : ae
1614
1614
  }
1615
1615
  );
1616
1616
  }), K = {