You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-flickity-component

Package Overview
Dependencies
Maintainers
2
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-flickity-component - npm Package Compare versions

Comparing version

to
4.0.0-beta.2

dist/index-66403d2f.mjs

910

dist/react-flickity-component.es.js

@@ -1,909 +0,7 @@

import ue, { Component as Pe } from "react";
import { createPortal as Ce } from "react-dom";
var xe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Se = { exports: {} }, ee = { exports: {} }, le;
function we() {
return le || (le = 1, function(s) {
(function(p, f) {
s.exports ? s.exports = f() : p.EvEmitter = f();
})(typeof window < "u" ? window : xe, function() {
function p() {
}
var f = p.prototype;
return f.on = function(a, u) {
if (!(!a || !u)) {
var o = this._events = this._events || {}, y = o[a] = o[a] || [];
return y.indexOf(u) == -1 && y.push(u), this;
}
}, f.once = function(a, u) {
if (!(!a || !u)) {
this.on(a, u);
var o = this._onceEvents = this._onceEvents || {}, y = o[a] = o[a] || {};
return y[u] = !0, this;
}
}, f.off = function(a, u) {
var o = this._events && this._events[a];
if (!(!o || !o.length)) {
var y = o.indexOf(u);
return y != -1 && o.splice(y, 1), this;
}
}, f.emitEvent = function(a, u) {
var o = this._events && this._events[a];
if (!(!o || !o.length)) {
o = o.slice(0), u = u || [];
for (var y = this._onceEvents && this._onceEvents[a], h = 0; h < o.length; h++) {
var S = o[h], l = y && y[S];
l && (this.off(a, S), delete y[S]), S.apply(this, u);
}
return this;
}
}, f.allOff = function() {
delete this._events, delete this._onceEvents;
}, p;
});
}(ee)), ee.exports;
}
(function(s) {
(function(p, f) {
s.exports ? s.exports = f(
p,
we()
) : p.imagesLoaded = f(
p,
p.EvEmitter
);
})(
typeof window < "u" ? window : xe,
function(f, a) {
var u = f.jQuery, o = f.console;
function y(t, c) {
for (var d in c)
t[d] = c[d];
return t;
}
var h = Array.prototype.slice;
function S(t) {
if (Array.isArray(t))
return t;
var c = typeof t == "object" && typeof t.length == "number";
return c ? h.call(t) : [t];
}
function l(t, c, d) {
if (!(this instanceof l))
return new l(t, c, d);
var g = t;
if (typeof t == "string" && (g = document.querySelectorAll(t)), !g) {
o.error("Bad element for imagesLoaded " + (g || t));
return;
}
this.elements = S(g), this.options = y({}, this.options), typeof c == "function" ? d = c : y(this.options, c), d && this.on("always", d), this.getImages(), u && (this.jqDeferred = new u.Deferred()), setTimeout(this.check.bind(this));
}
l.prototype = Object.create(a.prototype), l.prototype.options = {}, l.prototype.getImages = function() {
this.images = [], this.elements.forEach(this.addElementImages, this);
}, l.prototype.addElementImages = function(t) {
t.nodeName == "IMG" && this.addImage(t), this.options.background === !0 && this.addElementBackgroundImages(t);
var c = t.nodeType;
if (!(!c || !R[c])) {
for (var d = t.querySelectorAll("img"), g = 0; g < d.length; g++) {
var A = d[g];
this.addImage(A);
}
if (typeof this.options.background == "string") {
var Y = t.querySelectorAll(this.options.background);
for (g = 0; g < Y.length; g++) {
var j = Y[g];
this.addElementBackgroundImages(j);
}
}
}
};
var R = {
1: !0,
9: !0,
11: !0
};
l.prototype.addElementBackgroundImages = function(t) {
var c = getComputedStyle(t);
if (!!c)
for (var d = /url\((['"])?(.*?)\1\)/gi, g = d.exec(c.backgroundImage); g !== null; ) {
var A = g && g[2];
A && this.addBackground(A, t), g = d.exec(c.backgroundImage);
}
}, l.prototype.addImage = function(t) {
var c = new m(t);
this.images.push(c);
}, l.prototype.addBackground = function(t, c) {
var d = new k(t, c);
this.images.push(d);
}, l.prototype.check = function() {
var t = this;
if (this.progressedCount = 0, this.hasAnyBroken = !1, !this.images.length) {
this.complete();
return;
}
function c(d, g, A) {
setTimeout(function() {
t.progress(d, g, A);
});
}
this.images.forEach(function(d) {
d.once("progress", c), d.check();
});
}, l.prototype.progress = function(t, c, d) {
this.progressedCount++, this.hasAnyBroken = this.hasAnyBroken || !t.isLoaded, this.emitEvent("progress", [this, t, c]), this.jqDeferred && this.jqDeferred.notify && this.jqDeferred.notify(this, t), this.progressedCount == this.images.length && this.complete(), this.options.debug && o && o.log("progress: " + d, t, c);
}, l.prototype.complete = function() {
var t = this.hasAnyBroken ? "fail" : "done";
if (this.isComplete = !0, this.emitEvent(t, [this]), this.emitEvent("always", [this]), this.jqDeferred) {
var c = this.hasAnyBroken ? "reject" : "resolve";
this.jqDeferred[c](this);
}
};
function m(t) {
this.img = t;
}
m.prototype = Object.create(a.prototype), m.prototype.check = function() {
var t = this.getIsImageComplete();
if (t) {
this.confirm(this.img.naturalWidth !== 0, "naturalWidth");
return;
}
this.proxyImage = new Image(), this.proxyImage.addEventListener("load", this), this.proxyImage.addEventListener("error", this), this.img.addEventListener("load", this), this.img.addEventListener("error", this), this.proxyImage.src = this.img.src;
}, m.prototype.getIsImageComplete = function() {
return this.img.complete && this.img.naturalWidth;
}, m.prototype.confirm = function(t, c) {
this.isLoaded = t, this.emitEvent("progress", [this, this.img, c]);
}, m.prototype.handleEvent = function(t) {
var c = "on" + t.type;
this[c] && this[c](t);
}, m.prototype.onload = function() {
this.confirm(!0, "onload"), this.unbindEvents();
}, m.prototype.onerror = function() {
this.confirm(!1, "onerror"), this.unbindEvents();
}, m.prototype.unbindEvents = function() {
this.proxyImage.removeEventListener("load", this), this.proxyImage.removeEventListener("error", this), this.img.removeEventListener("load", this), this.img.removeEventListener("error", this);
};
function k(t, c) {
this.url = t, this.element = c, this.img = new Image();
}
return k.prototype = Object.create(m.prototype), k.prototype.check = function() {
this.img.addEventListener("load", this), this.img.addEventListener("error", this), this.img.src = this.url;
var t = this.getIsImageComplete();
t && (this.confirm(this.img.naturalWidth !== 0, "naturalWidth"), this.unbindEvents());
}, k.prototype.unbindEvents = function() {
this.img.removeEventListener("load", this), this.img.removeEventListener("error", this);
}, k.prototype.confirm = function(t, c) {
this.isLoaded = t, this.emitEvent("progress", [this, this.element, c]);
}, l.makeJQueryPlugin = function(t) {
t = t || f.jQuery, t && (u = t, u.fn.imagesLoaded = function(c, d) {
var g = new l(this, c, d);
return g.jqDeferred.promise(u(this));
});
}, l.makeJQueryPlugin(), l;
}
);
})(Se);
const de = Se.exports;
var D = { exports: {} }, te = { exports: {} }, C = {};
var pe;
function Ie() {
if (pe)
return C;
pe = 1;
var s = typeof Symbol == "function" && Symbol.for, p = s ? Symbol.for("react.element") : 60103, f = s ? Symbol.for("react.portal") : 60106, a = s ? Symbol.for("react.fragment") : 60107, u = s ? Symbol.for("react.strict_mode") : 60108, o = s ? Symbol.for("react.profiler") : 60114, y = s ? Symbol.for("react.provider") : 60109, h = s ? Symbol.for("react.context") : 60110, S = s ? Symbol.for("react.async_mode") : 60111, l = s ? Symbol.for("react.concurrent_mode") : 60111, R = s ? Symbol.for("react.forward_ref") : 60112, m = s ? Symbol.for("react.suspense") : 60113, k = s ? Symbol.for("react.suspense_list") : 60120, t = s ? Symbol.for("react.memo") : 60115, c = s ? Symbol.for("react.lazy") : 60116, d = s ? Symbol.for("react.block") : 60121, g = s ? Symbol.for("react.fundamental") : 60117, A = s ? Symbol.for("react.responder") : 60118, Y = s ? Symbol.for("react.scope") : 60119;
function j(n) {
if (typeof n == "object" && n !== null) {
var W = n.$$typeof;
switch (W) {
case p:
switch (n = n.type, n) {
case S:
case l:
case a:
case o:
case u:
case m:
return n;
default:
switch (n = n && n.$$typeof, n) {
case h:
case R:
case c:
case t:
case y:
return n;
default:
return W;
}
}
case f:
return W;
}
}
}
function L(n) {
return j(n) === l;
}
return C.AsyncMode = S, C.ConcurrentMode = l, C.ContextConsumer = h, C.ContextProvider = y, C.Element = p, C.ForwardRef = R, C.Fragment = a, C.Lazy = c, C.Memo = t, C.Portal = f, C.Profiler = o, C.StrictMode = u, C.Suspense = m, C.isAsyncMode = function(n) {
return L(n) || j(n) === S;
}, C.isConcurrentMode = L, C.isContextConsumer = function(n) {
return j(n) === h;
}, C.isContextProvider = function(n) {
return j(n) === y;
}, C.isElement = function(n) {
return typeof n == "object" && n !== null && n.$$typeof === p;
}, C.isForwardRef = function(n) {
return j(n) === R;
}, C.isFragment = function(n) {
return j(n) === a;
}, C.isLazy = function(n) {
return j(n) === c;
}, C.isMemo = function(n) {
return j(n) === t;
}, C.isPortal = function(n) {
return j(n) === f;
}, C.isProfiler = function(n) {
return j(n) === o;
}, C.isStrictMode = function(n) {
return j(n) === u;
}, C.isSuspense = function(n) {
return j(n) === m;
}, C.isValidElementType = function(n) {
return typeof n == "string" || typeof n == "function" || n === a || n === l || n === o || n === u || n === m || n === k || typeof n == "object" && n !== null && (n.$$typeof === c || n.$$typeof === t || n.$$typeof === y || n.$$typeof === h || n.$$typeof === R || n.$$typeof === g || n.$$typeof === A || n.$$typeof === Y || n.$$typeof === d);
}, C.typeOf = j, C;
}
var w = {};
var ye;
function ke() {
return ye || (ye = 1, process.env.NODE_ENV !== "production" && function() {
var s = typeof Symbol == "function" && Symbol.for, p = s ? Symbol.for("react.element") : 60103, f = s ? Symbol.for("react.portal") : 60106, a = s ? Symbol.for("react.fragment") : 60107, u = s ? Symbol.for("react.strict_mode") : 60108, o = s ? Symbol.for("react.profiler") : 60114, y = s ? Symbol.for("react.provider") : 60109, h = s ? Symbol.for("react.context") : 60110, S = s ? Symbol.for("react.async_mode") : 60111, l = s ? Symbol.for("react.concurrent_mode") : 60111, R = s ? Symbol.for("react.forward_ref") : 60112, m = s ? Symbol.for("react.suspense") : 60113, k = s ? Symbol.for("react.suspense_list") : 60120, t = s ? Symbol.for("react.memo") : 60115, c = s ? Symbol.for("react.lazy") : 60116, d = s ? Symbol.for("react.block") : 60121, g = s ? Symbol.for("react.fundamental") : 60117, A = s ? Symbol.for("react.responder") : 60118, Y = s ? Symbol.for("react.scope") : 60119;
function j(r) {
return typeof r == "string" || typeof r == "function" || r === a || r === l || r === o || r === u || r === m || r === k || typeof r == "object" && r !== null && (r.$$typeof === c || r.$$typeof === t || r.$$typeof === y || r.$$typeof === h || r.$$typeof === R || r.$$typeof === g || r.$$typeof === A || r.$$typeof === Y || r.$$typeof === d);
}
function L(r) {
if (typeof r == "object" && r !== null) {
var q = r.$$typeof;
switch (q) {
case p:
var J = r.type;
switch (J) {
case S:
case l:
case a:
case o:
case u:
case m:
return J;
default:
var fe = J && J.$$typeof;
switch (fe) {
case h:
case R:
case c:
case t:
case y:
return fe;
default:
return q;
}
}
case f:
return q;
}
}
}
var n = S, W = l, N = h, V = y, G = p, H = R, F = a, X = c, K = t, B = f, Q = o, M = u, U = m, z = !1;
function Z(r) {
return z || (z = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), e(r) || L(r) === S;
}
function e(r) {
return L(r) === l;
}
function i(r) {
return L(r) === h;
}
function x(r) {
return L(r) === y;
}
function b(r) {
return typeof r == "object" && r !== null && r.$$typeof === p;
}
function v(r) {
return L(r) === R;
}
function _(r) {
return L(r) === a;
}
function E(r) {
return L(r) === c;
}
function T(r) {
return L(r) === t;
}
function O(r) {
return L(r) === f;
}
function I(r) {
return L(r) === o;
}
function P(r) {
return L(r) === u;
}
function $(r) {
return L(r) === m;
}
w.AsyncMode = n, w.ConcurrentMode = W, w.ContextConsumer = N, w.ContextProvider = V, w.Element = G, w.ForwardRef = H, w.Fragment = F, w.Lazy = X, w.Memo = K, w.Portal = B, w.Profiler = Q, w.StrictMode = M, w.Suspense = U, w.isAsyncMode = Z, w.isConcurrentMode = e, w.isContextConsumer = i, w.isContextProvider = x, w.isElement = b, w.isForwardRef = v, w.isFragment = _, w.isLazy = E, w.isMemo = T, w.isPortal = O, w.isProfiler = I, w.isStrictMode = P, w.isSuspense = $, w.isValidElementType = j, w.typeOf = L;
}()), w;
}
var he;
function Re() {
return he || (he = 1, function(s) {
process.env.NODE_ENV === "production" ? s.exports = Ie() : s.exports = ke();
}(te)), te.exports;
}
var re, ve;
function Ae() {
if (ve)
return re;
ve = 1;
var s = Object.getOwnPropertySymbols, p = Object.prototype.hasOwnProperty, f = Object.prototype.propertyIsEnumerable;
function a(o) {
if (o == null)
throw new TypeError("Object.assign cannot be called with null or undefined");
return Object(o);
}
function u() {
try {
if (!Object.assign)
return !1;
var o = new String("abc");
if (o[5] = "de", Object.getOwnPropertyNames(o)[0] === "5")
return !1;
for (var y = {}, h = 0; h < 10; h++)
y["_" + String.fromCharCode(h)] = h;
var S = Object.getOwnPropertyNames(y).map(function(R) {
return y[R];
});
if (S.join("") !== "0123456789")
return !1;
var l = {};
return "abcdefghijklmnopqrst".split("").forEach(function(R) {
l[R] = R;
}), Object.keys(Object.assign({}, l)).join("") === "abcdefghijklmnopqrst";
} catch {
return !1;
}
}
return re = u() ? Object.assign : function(o, y) {
for (var h, S = a(o), l, R = 1; R < arguments.length; R++) {
h = Object(arguments[R]);
for (var m in h)
p.call(h, m) && (S[m] = h[m]);
if (s) {
l = s(h);
for (var k = 0; k < l.length; k++)
f.call(h, l[k]) && (S[l[k]] = h[l[k]]);
}
}
return S;
}, re;
}
var ne, me;
function ce() {
if (me)
return ne;
me = 1;
var s = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
return ne = s, ne;
}
var ie, ge;
function _e() {
return ge || (ge = 1, ie = Function.call.bind(Object.prototype.hasOwnProperty)), ie;
}
var oe, Ee;
function je() {
if (Ee)
return oe;
Ee = 1;
var s = function() {
};
if (process.env.NODE_ENV !== "production") {
var p = ce(), f = {}, a = _e();
s = function(o) {
var y = "Warning: " + o;
typeof console < "u" && console.error(y);
try {
throw new Error(y);
} catch {
}
};
}
function u(o, y, h, S, l) {
if (process.env.NODE_ENV !== "production") {
for (var R in o)
if (a(o, R)) {
var m;
try {
if (typeof o[R] != "function") {
var k = Error(
(S || "React class") + ": " + h + " type `" + R + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof o[R] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
);
throw k.name = "Invariant Violation", k;
}
m = o[R](y, R, S, h, null, p);
} catch (c) {
m = c;
}
if (m && !(m instanceof Error) && s(
(S || "React class") + ": type specification of " + h + " `" + R + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof m + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
), m instanceof Error && !(m.message in f)) {
f[m.message] = !0;
var t = l ? l() : "";
s(
"Failed " + h + " type: " + m.message + (t ?? "")
);
}
}
}
}
return u.resetWarningCache = function() {
process.env.NODE_ENV !== "production" && (f = {});
}, oe = u, oe;
}
var se, be;
function Le() {
if (be)
return se;
be = 1;
var s = Re(), p = Ae(), f = ce(), a = _e(), u = je(), o = function() {
};
process.env.NODE_ENV !== "production" && (o = function(h) {
var S = "Warning: " + h;
typeof console < "u" && console.error(S);
try {
throw new Error(S);
} catch {
}
});
function y() {
return null;
}
return se = function(h, S) {
var l = typeof Symbol == "function" && Symbol.iterator, R = "@@iterator";
function m(e) {
var i = e && (l && e[l] || e[R]);
if (typeof i == "function")
return i;
}
var k = "<<anonymous>>", t = {
array: A("array"),
bigint: A("bigint"),
bool: A("boolean"),
func: A("function"),
number: A("number"),
object: A("object"),
string: A("string"),
symbol: A("symbol"),
any: Y(),
arrayOf: j,
element: L(),
elementType: n(),
instanceOf: W,
node: H(),
objectOf: V,
oneOf: N,
oneOfType: G,
shape: X,
exact: K
};
function c(e, i) {
return e === i ? e !== 0 || 1 / e === 1 / i : e !== e && i !== i;
}
function d(e, i) {
this.message = e, this.data = i && typeof i == "object" ? i : {}, this.stack = "";
}
d.prototype = Error.prototype;
function g(e) {
if (process.env.NODE_ENV !== "production")
var i = {}, x = 0;
function b(_, E, T, O, I, P, $) {
if (O = O || k, P = P || T, $ !== f) {
if (S) {
var r = new Error(
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
);
throw r.name = "Invariant Violation", r;
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
var q = O + ":" + T;
!i[q] && x < 3 && (o(
"You are manually calling a React.PropTypes validation function for the `" + P + "` prop on `" + O + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
), i[q] = !0, x++);
}
}
return E[T] == null ? _ ? E[T] === null ? new d("The " + I + " `" + P + "` is marked as required " + ("in `" + O + "`, but its value is `null`.")) : new d("The " + I + " `" + P + "` is marked as required in " + ("`" + O + "`, but its value is `undefined`.")) : null : e(E, T, O, I, P);
}
var v = b.bind(null, !1);
return v.isRequired = b.bind(null, !0), v;
}
function A(e) {
function i(x, b, v, _, E, T) {
var O = x[b], I = M(O);
if (I !== e) {
var P = U(O);
return new d(
"Invalid " + _ + " `" + E + "` of type " + ("`" + P + "` supplied to `" + v + "`, expected ") + ("`" + e + "`."),
{ expectedType: e }
);
}
return null;
}
return g(i);
}
function Y() {
return g(y);
}
function j(e) {
function i(x, b, v, _, E) {
if (typeof e != "function")
return new d("Property `" + E + "` of component `" + v + "` has invalid PropType notation inside arrayOf.");
var T = x[b];
if (!Array.isArray(T)) {
var O = M(T);
return new d("Invalid " + _ + " `" + E + "` of type " + ("`" + O + "` supplied to `" + v + "`, expected an array."));
}
for (var I = 0; I < T.length; I++) {
var P = e(T, I, v, _, E + "[" + I + "]", f);
if (P instanceof Error)
return P;
}
return null;
}
return g(i);
}
function L() {
function e(i, x, b, v, _) {
var E = i[x];
if (!h(E)) {
var T = M(E);
return new d("Invalid " + v + " `" + _ + "` of type " + ("`" + T + "` supplied to `" + b + "`, expected a single ReactElement."));
}
return null;
}
return g(e);
}
function n() {
function e(i, x, b, v, _) {
var E = i[x];
if (!s.isValidElementType(E)) {
var T = M(E);
return new d("Invalid " + v + " `" + _ + "` of type " + ("`" + T + "` supplied to `" + b + "`, expected a single ReactElement type."));
}
return null;
}
return g(e);
}
function W(e) {
function i(x, b, v, _, E) {
if (!(x[b] instanceof e)) {
var T = e.name || k, O = Z(x[b]);
return new d("Invalid " + _ + " `" + E + "` of type " + ("`" + O + "` supplied to `" + v + "`, expected ") + ("instance of `" + T + "`."));
}
return null;
}
return g(i);
}
function N(e) {
if (!Array.isArray(e))
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? o(
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
) : o("Invalid argument supplied to oneOf, expected an array.")), y;
function i(x, b, v, _, E) {
for (var T = x[b], O = 0; O < e.length; O++)
if (c(T, e[O]))
return null;
var I = JSON.stringify(e, function($, r) {
var q = U(r);
return q === "symbol" ? String(r) : r;
});
return new d("Invalid " + _ + " `" + E + "` of value `" + String(T) + "` " + ("supplied to `" + v + "`, expected one of " + I + "."));
}
return g(i);
}
function V(e) {
function i(x, b, v, _, E) {
if (typeof e != "function")
return new d("Property `" + E + "` of component `" + v + "` has invalid PropType notation inside objectOf.");
var T = x[b], O = M(T);
if (O !== "object")
return new d("Invalid " + _ + " `" + E + "` of type " + ("`" + O + "` supplied to `" + v + "`, expected an object."));
for (var I in T)
if (a(T, I)) {
var P = e(T, I, v, _, E + "." + I, f);
if (P instanceof Error)
return P;
}
return null;
}
return g(i);
}
function G(e) {
if (!Array.isArray(e))
return process.env.NODE_ENV !== "production" && o("Invalid argument supplied to oneOfType, expected an instance of array."), y;
for (var i = 0; i < e.length; i++) {
var x = e[i];
if (typeof x != "function")
return o(
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + z(x) + " at index " + i + "."
), y;
}
function b(v, _, E, T, O) {
for (var I = [], P = 0; P < e.length; P++) {
var $ = e[P], r = $(v, _, E, T, O, f);
if (r == null)
return null;
r.data && a(r.data, "expectedType") && I.push(r.data.expectedType);
}
var q = I.length > 0 ? ", expected one of type [" + I.join(", ") + "]" : "";
return new d("Invalid " + T + " `" + O + "` supplied to " + ("`" + E + "`" + q + "."));
}
return g(b);
}
function H() {
function e(i, x, b, v, _) {
return B(i[x]) ? null : new d("Invalid " + v + " `" + _ + "` supplied to " + ("`" + b + "`, expected a ReactNode."));
}
return g(e);
}
function F(e, i, x, b, v) {
return new d(
(e || "React class") + ": " + i + " type `" + x + "." + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + v + "`."
);
}
function X(e) {
function i(x, b, v, _, E) {
var T = x[b], O = M(T);
if (O !== "object")
return new d("Invalid " + _ + " `" + E + "` of type `" + O + "` " + ("supplied to `" + v + "`, expected `object`."));
for (var I in e) {
var P = e[I];
if (typeof P != "function")
return F(v, _, E, I, U(P));
var $ = P(T, I, v, _, E + "." + I, f);
if ($)
return $;
}
return null;
}
return g(i);
}
function K(e) {
function i(x, b, v, _, E) {
var T = x[b], O = M(T);
if (O !== "object")
return new d("Invalid " + _ + " `" + E + "` of type `" + O + "` " + ("supplied to `" + v + "`, expected `object`."));
var I = p({}, x[b], e);
for (var P in I) {
var $ = e[P];
if (a(e, P) && typeof $ != "function")
return F(v, _, E, P, U($));
if (!$)
return new d(
"Invalid " + _ + " `" + E + "` key `" + P + "` supplied to `" + v + "`.\nBad object: " + JSON.stringify(x[b], null, " ") + `
Valid keys: ` + JSON.stringify(Object.keys(e), null, " ")
);
var r = $(T, P, v, _, E + "." + P, f);
if (r)
return r;
}
return null;
}
return g(i);
}
function B(e) {
switch (typeof e) {
case "number":
case "string":
case "undefined":
return !0;
case "boolean":
return !e;
case "object":
if (Array.isArray(e))
return e.every(B);
if (e === null || h(e))
return !0;
var i = m(e);
if (i) {
var x = i.call(e), b;
if (i !== e.entries) {
for (; !(b = x.next()).done; )
if (!B(b.value))
return !1;
} else
for (; !(b = x.next()).done; ) {
var v = b.value;
if (v && !B(v[1]))
return !1;
}
} else
return !1;
return !0;
default:
return !1;
}
}
function Q(e, i) {
return e === "symbol" ? !0 : i ? i["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && i instanceof Symbol : !1;
}
function M(e) {
var i = typeof e;
return Array.isArray(e) ? "array" : e instanceof RegExp ? "object" : Q(i, e) ? "symbol" : i;
}
function U(e) {
if (typeof e > "u" || e === null)
return "" + e;
var i = M(e);
if (i === "object") {
if (e instanceof Date)
return "date";
if (e instanceof RegExp)
return "regexp";
}
return i;
}
function z(e) {
var i = U(e);
switch (i) {
case "array":
case "object":
return "an " + i;
case "boolean":
case "date":
case "regexp":
return "a " + i;
default:
return i;
}
}
function Z(e) {
return !e.constructor || !e.constructor.name ? k : e.constructor.name;
}
return t.checkPropTypes = u, t.resetWarningCache = u.resetWarningCache, t.PropTypes = t, t;
}, se;
}
var ae, Te;
function $e() {
if (Te)
return ae;
Te = 1;
var s = ce();
function p() {
}
function f() {
}
return f.resetWarningCache = p, ae = function() {
function a(y, h, S, l, R, m) {
if (m !== s) {
var k = new Error(
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
);
throw k.name = "Invariant Violation", k;
}
}
a.isRequired = a;
function u() {
return a;
}
var o = {
array: a,
bigint: a,
bool: a,
func: a,
number: a,
object: a,
string: a,
symbol: a,
any: a,
arrayOf: u,
element: a,
elementType: a,
instanceOf: u,
node: a,
objectOf: u,
oneOf: u,
oneOfType: u,
shape: u,
exact: u,
checkPropTypes: f,
resetWarningCache: p
};
return o.PropTypes = o, o;
}, ae;
}
if (process.env.NODE_ENV !== "production") {
var Me = Re(), qe = !0;
D.exports = Le()(Me.isElement, qe);
} else
D.exports = $e()();
const De = !!(typeof window < "u" && window.document && window.document.createElement);
class Oe extends Pe {
constructor(p) {
super(p), this.state = {
flickityReady: !1,
flickityCreated: !1,
cellCount: 0
}, this.carousel = null, this.flkty = null;
}
static getDerivedStateFromProps(p, f) {
const a = ue.Children.count(p.children);
return a !== f.cellCount ? { flickityReady: !1, cellCount: a } : null;
}
componentDidUpdate(p, f) {
const {
children: a,
options: { draggable: u, initialIndex: o },
reloadOnUpdate: y,
disableImagesLoaded: h
} = this.props, { flickityReady: S } = this.state;
if (y || !f.flickityReady && S) {
const l = this.flkty.isActive;
this.flkty.deactivate(), this.flkty.selectedIndex = o || 0, this.flkty.options.draggable = u === void 0 ? a ? a.length > 1 : !1 : u, l && this.flkty.activate(), !h && this.carousel && de(this.carousel, () => {
this.flkty.reloadCells();
});
} else
this.flkty.reloadCells();
}
componentDidMount() {
if (!De)
return null;
const p = require("flickity"), { flickityRef: f, options: a } = this.props;
this.flkty = new p(this.carousel, a), f && f(this.flkty), this.props.static ? this.setReady() : this.setState({ flickityCreated: !0 });
}
setReady() {
if (this.state.flickityReady)
return;
const p = () => this.setState({ flickityReady: !0 });
this.props.disableImagesLoaded ? p() : de(this.carousel, p);
}
renderPortal() {
if (!this.carousel)
return null;
const p = this.carousel.querySelector(".flickity-slider");
if (p) {
const f = Ce(this.props.children, p);
return setTimeout(() => this.setReady(), 0), f;
}
}
render() {
return ue.createElement(
this.props.elementType,
{
className: this.props.className,
ref: (p) => {
this.carousel = p;
}
},
this.props.static ? this.props.children : this.renderPortal()
);
}
}
Oe.propTypes = {
children: D.exports.array,
className: D.exports.string,
disableImagesLoaded: D.exports.bool,
elementType: D.exports.string,
flickityRef: D.exports.func,
options: D.exports.object,
reloadOnUpdate: D.exports.bool,
static: D.exports.bool
};
Oe.defaultProps = {
className: "",
disableImagesLoaded: !1,
elementType: "div",
options: {},
reloadOnUpdate: !1,
static: !1
};
import "react";
import "react-dom";
import { F as p } from "./index-66403d2f.mjs";
export {
Oe as default
p as default
};
//# sourceMappingURL=react-flickity-component.es.js.map
{
"name": "react-flickity-component",
"version": "4.0.0-beta.1",
"version": "4.0.0-beta.2",
"description": "react flickity component",
"type": "module",
"files": [

@@ -21,5 +20,5 @@ "dist"

"dev": "vite",
"build": "node build.js",
"build:docs": "node build-docs.js",
"prepublishOnly": "node build.js"
"build": "node build.mjs",
"build:docs": "node build-docs.mjs",
"prepublishOnly": "node build.mjs"
},

@@ -26,0 +25,0 @@ "author": "theolampert",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet