Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wethegit/react-gallery

Package Overview
Dependencies
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wethegit/react-gallery - npm Package Compare versions

Comparing version 1.0.3 to 2.0.0

576

dist/react-gallery.js

@@ -1,3 +0,3 @@

import cr, { createContext as $r, useState as Ce, useRef as Dr, useCallback as ye, useContext as kr } from "react";
function Mr(r) {
import cr, { createContext as Ir, useState as Ce, useRef as $r, useCallback as ye, useContext as Dr } from "react";
function kr(r) {
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;

@@ -67,3 +67,3 @@ }

var Qe;
function Yr() {
function Mr() {
if (Qe)

@@ -100,3 +100,3 @@ return pe;

var er;
function qr() {
function Yr() {
return er || (er = 1, function(r) {

@@ -106,6 +106,6 @@ process.env.NODE_ENV !== "production" && function() {

r.Fragment = 60107;
var v = 60108, p = 60114, c = 60109, u = 60110, l = 60112, d = 60113, g = 60120, T = 60115, M = 60116, k = 60121, O = 60122, N = 60117, F = 60129, Q = 60131;
var v = 60108, p = 60114, c = 60109, u = 60110, l = 60112, d = 60113, g = 60120, T = 60115, M = 60116, k = 60121, C = 60122, U = 60117, F = 60129, Z = 60131;
if (typeof Symbol == "function" && Symbol.for) {
var R = Symbol.for;
s = R("react.element"), b = R("react.portal"), r.Fragment = R("react.fragment"), v = R("react.strict_mode"), p = R("react.profiler"), c = R("react.provider"), u = R("react.context"), l = R("react.forward_ref"), d = R("react.suspense"), g = R("react.suspense_list"), T = R("react.memo"), M = R("react.lazy"), k = R("react.block"), O = R("react.server.block"), N = R("react.fundamental"), R("react.scope"), R("react.opaque.id"), F = R("react.debug_trace_mode"), R("react.offscreen"), Q = R("react.legacy_hidden");
s = R("react.element"), b = R("react.portal"), r.Fragment = R("react.fragment"), v = R("react.strict_mode"), p = R("react.profiler"), c = R("react.provider"), u = R("react.context"), l = R("react.forward_ref"), d = R("react.suspense"), g = R("react.suspense_list"), T = R("react.memo"), M = R("react.lazy"), k = R("react.block"), C = R("react.server.block"), U = R("react.fundamental"), R("react.scope"), R("react.opaque.id"), F = R("react.debug_trace_mode"), R("react.offscreen"), Z = R("react.legacy_hidden");
}

@@ -119,3 +119,3 @@ var A = typeof Symbol == "function" && Symbol.iterator, a = "@@iterator";

}
var ee = _.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
var Q = _.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function B(e) {

@@ -130,3 +130,3 @@ {

{
var h = ee.ReactDebugCurrentFrame, W = h.getStackAddendum();
var h = Q.ReactDebugCurrentFrame, W = h.getStackAddendum();
W !== "" && (t += "%s", o = o.concat([W]));

@@ -141,3 +141,3 @@ var L = o.map(function(D) {

function ue(e) {
return !!(typeof e == "string" || typeof e == "function" || e === r.Fragment || e === p || e === F || e === v || e === d || e === g || e === Q || be || typeof e == "object" && e !== null && (e.$$typeof === M || e.$$typeof === T || e.$$typeof === c || e.$$typeof === u || e.$$typeof === l || e.$$typeof === N || e.$$typeof === k || e[0] === O));
return !!(typeof e == "string" || typeof e == "function" || e === r.Fragment || e === p || e === F || e === v || e === d || e === g || e === Z || be || typeof e == "object" && e !== null && (e.$$typeof === M || e.$$typeof === T || e.$$typeof === c || e.$$typeof === u || e.$$typeof === l || e.$$typeof === U || e.$$typeof === k || e[0] === C));
}

@@ -197,14 +197,14 @@ function _e(e, t, o) {

}
var ne = 0, K, re, oe, fe, n, f, S;
function x() {
var ne = 0, K, ee, oe, fe, n, f, x;
function O() {
}
x.__reactDisabledLog = !0;
O.__reactDisabledLog = !0;
function E() {
{
if (ne === 0) {
K = console.log, re = console.info, oe = console.warn, fe = console.error, n = console.group, f = console.groupCollapsed, S = console.groupEnd;
K = console.log, ee = console.info, oe = console.warn, fe = console.error, n = console.group, f = console.groupCollapsed, x = console.groupEnd;
var e = {
configurable: !0,
enumerable: !0,
value: x,
value: O,
writable: !0

@@ -238,3 +238,3 @@ };

info: y({}, e, {
value: re
value: ee
}),

@@ -254,3 +254,3 @@ warn: y({}, e, {

groupEnd: y({}, e, {
value: S
value: x
})

@@ -262,4 +262,4 @@ });

}
var m = ee.ReactCurrentDispatcher, P;
function w(e, t, o) {
var m = Q.ReactCurrentDispatcher, P;
function S(e, t, o) {
{

@@ -277,6 +277,6 @@ if (P === void 0)

}
var $ = !1, C;
var $ = !1, w;
{
var J = typeof WeakMap == "function" ? WeakMap : Map;
C = new J();
w = new J();
}

@@ -287,3 +287,3 @@ function i(e, t) {

{
var o = C.get(e);
var o = w.get(e);
if (o !== void 0)

@@ -343,3 +343,3 @@ return o;

` + j[V].replace(" at new ", " at ");
return typeof e == "function" && C.set(e, ae), ae;
return typeof e == "function" && w.set(e, ae), ae;
}

@@ -353,4 +353,4 @@ while (V >= 1 && G >= 0);

}
var ve = e ? e.displayName || e.name : "", Xe = ve ? w(ve) : "";
return typeof e == "function" && C.set(e, Xe), Xe;
var ve = e ? e.displayName || e.name : "", Xe = ve ? S(ve) : "";
return typeof e == "function" && w.set(e, Xe), Xe;
}

@@ -370,8 +370,8 @@ function X(e, t, o) {

if (typeof e == "string")
return w(e);
return S(e);
switch (e) {
case d:
return w("Suspense");
return S("Suspense");
case g:
return w("SuspenseList");
return S("SuspenseList");
}

@@ -396,3 +396,3 @@ if (typeof e == "object")

}
var Ne = {}, Ue = ee.ReactDebugCurrentFrame;
var Ne = {}, Ue = Q.ReactDebugCurrentFrame;
function Te(e) {

@@ -405,3 +405,3 @@ if (e) {

}
function gr(e, t, o, h, W) {
function yr(e, t, o, h, W) {
{

@@ -425,3 +425,3 @@ var L = Function.call.bind(Object.prototype.hasOwnProperty);

}
var Ee = ee.ReactCurrentOwner, Pe = Object.prototype.hasOwnProperty, hr = {
var Ee = Q.ReactCurrentOwner, Pe = Object.prototype.hasOwnProperty, gr = {
key: !0,

@@ -431,5 +431,5 @@ ref: !0,

__source: !0
}, Fe, Ve, xe;
xe = {};
function br(e) {
}, Fe, Ve, Oe;
Oe = {};
function hr(e) {
if (Pe.call(e, "ref")) {

@@ -442,3 +442,3 @@ var t = Object.getOwnPropertyDescriptor(e, "ref").get;

}
function _r(e) {
function br(e) {
if (Pe.call(e, "key")) {

@@ -451,9 +451,9 @@ var t = Object.getOwnPropertyDescriptor(e, "key").get;

}
function Er(e, t) {
function _r(e, t) {
if (typeof e.ref == "string" && Ee.current && t && Ee.current.stateNode !== t) {
var o = z(Ee.current.type);
xe[o] || (B('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', z(Ee.current.type), e.ref), xe[o] = !0);
Oe[o] || (B('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', z(Ee.current.type), e.ref), Oe[o] = !0);
}
}
function mr(e, t) {
function Er(e, t) {
{

@@ -469,3 +469,3 @@ var o = function() {

}
function Tr(e, t) {
function mr(e, t) {
{

@@ -481,3 +481,3 @@ var o = function() {

}
var Rr = function(e, t, o, h, W, L, D) {
var Tr = function(e, t, o, h, W, L, D) {
var j = {

@@ -511,8 +511,8 @@ // This tag allows us to uniquely identify this as a React Element

};
function Pr(e, t, o, h, W) {
function Rr(e, t, o, h, W) {
{
var L, D = {}, j = null, H = null;
o !== void 0 && (j = "" + o), _r(t) && (j = "" + t.key), br(t) && (H = t.ref, Er(t, W));
o !== void 0 && (j = "" + o), br(t) && (j = "" + t.key), hr(t) && (H = t.ref, _r(t, W));
for (L in t)
Pe.call(t, L) && !hr.hasOwnProperty(L) && (D[L] = t[L]);
Pe.call(t, L) && !gr.hasOwnProperty(L) && (D[L] = t[L]);
if (e && e.defaultProps) {

@@ -525,8 +525,8 @@ var V = e.defaultProps;

var G = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
j && mr(D, G), H && Tr(D, G);
j && Er(D, G), H && mr(D, G);
}
return Rr(e, j, H, W, h, Ee.current, D);
return Tr(e, j, H, W, h, Ee.current, D);
}
}
var Oe = ee.ReactCurrentOwner, Ge = ee.ReactDebugCurrentFrame;
var xe = Q.ReactCurrentOwner, Ge = Q.ReactDebugCurrentFrame;
function de(e) {

@@ -546,4 +546,4 @@ if (e) {

{
if (Oe.current) {
var e = z(Oe.current.type);
if (xe.current) {
var e = z(xe.current.type);
if (e)

@@ -557,3 +557,3 @@ return `

}
function xr(e) {
function Pr(e) {
{

@@ -592,3 +592,3 @@ if (e !== void 0) {

var h = "";
e && e._owner && e._owner !== Oe.current && (h = " It was passed a child from " + z(e._owner.type) + "."), de(e), B('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', o, h), de(null);
e && e._owner && e._owner !== xe.current && (h = " It was passed a child from " + z(e._owner.type) + "."), de(e), B('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', o, h), de(null);
}

@@ -615,3 +615,3 @@ }

}
function Sr(e) {
function xr(e) {
{

@@ -632,3 +632,3 @@ var t = e.type;

var h = z(t);
gr(o, e.props, "prop", h, e);
yr(o, e.props, "prop", h, e);
} else if (t.PropTypes !== void 0 && !Se) {

@@ -642,3 +642,3 @@ Se = !0;

}
function wr(e) {
function Sr(e) {
{

@@ -661,3 +661,3 @@ for (var t = Object.keys(e.props), o = 0; o < t.length; o++) {

(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (j += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
var H = xr(W);
var H = Pr(W);
H ? j += H : j += Be();

@@ -667,3 +667,3 @@ var V;

}
var G = Pr(e, t, o, W, L);
var G = Rr(e, t, o, W, L);
if (G == null)

@@ -684,18 +684,18 @@ return G;

}
return e === r.Fragment ? wr(G) : Sr(G), G;
return e === r.Fragment ? Sr(G) : xr(G), G;
}
}
function Cr(e, t, o) {
function wr(e, t, o) {
return Ke(e, t, o, !0);
}
function Ar(e, t, o) {
function Cr(e, t, o) {
return Ke(e, t, o, !1);
}
var jr = Ar, Ir = Cr;
r.jsx = jr, r.jsxs = Ir;
var Ar = Cr, jr = wr;
r.jsx = Ar, r.jsxs = jr;
}();
}(je)), je;
}
process.env.NODE_ENV === "production" ? Ye.exports = Yr() : Ye.exports = qr();
var Z = Ye.exports, qe = { exports: {} }, Re = { exports: {} }, Y = {};
process.env.NODE_ENV === "production" ? Ye.exports = Mr() : Ye.exports = Yr();
var re = Ye.exports, qe = { exports: {} }, Re = { exports: {} }, Y = {};
/** @license React v16.13.1

@@ -710,7 +710,7 @@ * react-is.production.min.js

var rr;
function Wr() {
function qr() {
if (rr)
return Y;
rr = 1;
var r = typeof Symbol == "function" && Symbol.for, _ = r ? Symbol.for("react.element") : 60103, y = r ? Symbol.for("react.portal") : 60106, s = r ? Symbol.for("react.fragment") : 60107, b = r ? Symbol.for("react.strict_mode") : 60108, v = r ? Symbol.for("react.profiler") : 60114, p = r ? Symbol.for("react.provider") : 60109, c = r ? Symbol.for("react.context") : 60110, u = r ? Symbol.for("react.async_mode") : 60111, l = r ? Symbol.for("react.concurrent_mode") : 60111, d = r ? Symbol.for("react.forward_ref") : 60112, g = r ? Symbol.for("react.suspense") : 60113, T = r ? Symbol.for("react.suspense_list") : 60120, M = r ? Symbol.for("react.memo") : 60115, k = r ? Symbol.for("react.lazy") : 60116, O = r ? Symbol.for("react.block") : 60121, N = r ? Symbol.for("react.fundamental") : 60117, F = r ? Symbol.for("react.responder") : 60118, Q = r ? Symbol.for("react.scope") : 60119;
var r = typeof Symbol == "function" && Symbol.for, _ = r ? Symbol.for("react.element") : 60103, y = r ? Symbol.for("react.portal") : 60106, s = r ? Symbol.for("react.fragment") : 60107, b = r ? Symbol.for("react.strict_mode") : 60108, v = r ? Symbol.for("react.profiler") : 60114, p = r ? Symbol.for("react.provider") : 60109, c = r ? Symbol.for("react.context") : 60110, u = r ? Symbol.for("react.async_mode") : 60111, l = r ? Symbol.for("react.concurrent_mode") : 60111, d = r ? Symbol.for("react.forward_ref") : 60112, g = r ? Symbol.for("react.suspense") : 60113, T = r ? Symbol.for("react.suspense_list") : 60120, M = r ? Symbol.for("react.memo") : 60115, k = r ? Symbol.for("react.lazy") : 60116, C = r ? Symbol.for("react.block") : 60121, U = r ? Symbol.for("react.fundamental") : 60117, F = r ? Symbol.for("react.responder") : 60118, Z = r ? Symbol.for("react.scope") : 60119;
function R(a) {

@@ -774,3 +774,3 @@ if (typeof a == "object" && a !== null) {

}, Y.isValidElementType = function(a) {
return typeof a == "string" || typeof a == "function" || a === s || a === l || a === v || a === b || a === g || a === T || typeof a == "object" && a !== null && (a.$$typeof === k || a.$$typeof === M || a.$$typeof === p || a.$$typeof === c || a.$$typeof === d || a.$$typeof === N || a.$$typeof === F || a.$$typeof === Q || a.$$typeof === O);
return typeof a == "string" || typeof a == "function" || a === s || a === l || a === v || a === b || a === g || a === T || typeof a == "object" && a !== null && (a.$$typeof === k || a.$$typeof === M || a.$$typeof === p || a.$$typeof === c || a.$$typeof === d || a.$$typeof === U || a.$$typeof === F || a.$$typeof === Z || a.$$typeof === C);
}, Y.typeOf = R, Y;

@@ -788,8 +788,8 @@ }

var tr;
function Lr() {
function Wr() {
return tr || (tr = 1, process.env.NODE_ENV !== "production" && function() {
var r = typeof Symbol == "function" && Symbol.for, _ = r ? Symbol.for("react.element") : 60103, y = r ? Symbol.for("react.portal") : 60106, s = r ? Symbol.for("react.fragment") : 60107, b = r ? Symbol.for("react.strict_mode") : 60108, v = r ? Symbol.for("react.profiler") : 60114, p = r ? Symbol.for("react.provider") : 60109, c = r ? Symbol.for("react.context") : 60110, u = r ? Symbol.for("react.async_mode") : 60111, l = r ? Symbol.for("react.concurrent_mode") : 60111, d = r ? Symbol.for("react.forward_ref") : 60112, g = r ? Symbol.for("react.suspense") : 60113, T = r ? Symbol.for("react.suspense_list") : 60120, M = r ? Symbol.for("react.memo") : 60115, k = r ? Symbol.for("react.lazy") : 60116, O = r ? Symbol.for("react.block") : 60121, N = r ? Symbol.for("react.fundamental") : 60117, F = r ? Symbol.for("react.responder") : 60118, Q = r ? Symbol.for("react.scope") : 60119;
var r = typeof Symbol == "function" && Symbol.for, _ = r ? Symbol.for("react.element") : 60103, y = r ? Symbol.for("react.portal") : 60106, s = r ? Symbol.for("react.fragment") : 60107, b = r ? Symbol.for("react.strict_mode") : 60108, v = r ? Symbol.for("react.profiler") : 60114, p = r ? Symbol.for("react.provider") : 60109, c = r ? Symbol.for("react.context") : 60110, u = r ? Symbol.for("react.async_mode") : 60111, l = r ? Symbol.for("react.concurrent_mode") : 60111, d = r ? Symbol.for("react.forward_ref") : 60112, g = r ? Symbol.for("react.suspense") : 60113, T = r ? Symbol.for("react.suspense_list") : 60120, M = r ? Symbol.for("react.memo") : 60115, k = r ? Symbol.for("react.lazy") : 60116, C = r ? Symbol.for("react.block") : 60121, U = r ? Symbol.for("react.fundamental") : 60117, F = r ? Symbol.for("react.responder") : 60118, Z = r ? Symbol.for("react.scope") : 60119;
function R(i) {
return typeof i == "string" || typeof i == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
i === s || i === l || i === v || i === b || i === g || i === T || typeof i == "object" && i !== null && (i.$$typeof === k || i.$$typeof === M || i.$$typeof === p || i.$$typeof === c || i.$$typeof === d || i.$$typeof === N || i.$$typeof === F || i.$$typeof === Q || i.$$typeof === O);
i === s || i === l || i === v || i === b || i === g || i === T || typeof i == "object" && i !== null && (i.$$typeof === k || i.$$typeof === M || i.$$typeof === p || i.$$typeof === c || i.$$typeof === d || i.$$typeof === U || i.$$typeof === F || i.$$typeof === Z || i.$$typeof === C);
}

@@ -828,3 +828,3 @@ function A(i) {

}
var a = u, te = l, ee = c, B = p, he = _, be = d, ue = s, _e = k, ce = M, z = y, ne = v, K = b, re = g, oe = !1;
var a = u, te = l, Q = c, B = p, he = _, be = d, ue = s, _e = k, ce = M, z = y, ne = v, K = b, ee = g, oe = !1;
function fe(i) {

@@ -839,6 +839,6 @@ return oe || (oe = !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.")), n(i) || A(i) === u;

}
function S(i) {
function x(i) {
return A(i) === p;
}
function x(i) {
function O(i) {
return typeof i == "object" && i !== null && i.$$typeof === _;

@@ -858,3 +858,3 @@ }

}
function w(i) {
function S(i) {
return A(i) === y;

@@ -865,3 +865,3 @@ }

}
function C(i) {
function w(i) {
return A(i) === b;

@@ -872,3 +872,3 @@ }

}
q.AsyncMode = a, q.ConcurrentMode = te, q.ContextConsumer = ee, q.ContextProvider = B, q.Element = he, q.ForwardRef = be, q.Fragment = ue, q.Lazy = _e, q.Memo = ce, q.Portal = z, q.Profiler = ne, q.StrictMode = K, q.Suspense = re, q.isAsyncMode = fe, q.isConcurrentMode = n, q.isContextConsumer = f, q.isContextProvider = S, q.isElement = x, q.isForwardRef = E, q.isFragment = I, q.isLazy = m, q.isMemo = P, q.isPortal = w, q.isProfiler = $, q.isStrictMode = C, q.isSuspense = J, q.isValidElementType = R, q.typeOf = A;
q.AsyncMode = a, q.ConcurrentMode = te, q.ContextConsumer = Q, q.ContextProvider = B, q.Element = he, q.ForwardRef = be, q.Fragment = ue, q.Lazy = _e, q.Memo = ce, q.Portal = z, q.Profiler = ne, q.StrictMode = K, q.Suspense = ee, q.isAsyncMode = fe, q.isConcurrentMode = n, q.isContextConsumer = f, q.isContextProvider = x, q.isElement = O, q.isForwardRef = E, q.isFragment = I, q.isLazy = m, q.isMemo = P, q.isPortal = S, q.isProfiler = $, q.isStrictMode = w, q.isSuspense = J, q.isValidElementType = R, q.typeOf = A;
}()), q;

@@ -878,3 +878,3 @@ }

function fr() {
return nr || (nr = 1, process.env.NODE_ENV === "production" ? Re.exports = Wr() : Re.exports = Lr()), Re.exports;
return nr || (nr = 1, process.env.NODE_ENV === "production" ? Re.exports = qr() : Re.exports = Wr()), Re.exports;
}

@@ -894,3 +894,3 @@ var Ie, ar;

var De, or;
function Nr() {
function Lr() {
if (or)

@@ -945,7 +945,7 @@ return De;

var ke, sr;
function Ur() {
function Nr() {
if (sr)
return ke;
sr = 1;
var r = fr(), _ = We(), y = Le(), s = lr(), b = Nr(), v = function() {
var r = fr(), _ = We(), y = Le(), s = lr(), b = Lr(), v = function() {
};

@@ -979,3 +979,3 @@ process.env.NODE_ENV !== "production" && (v = function(c) {

symbol: F("symbol"),
any: Q(),
any: Z(),
arrayOf: R,

@@ -987,3 +987,3 @@ element: A(),

objectOf: B,
oneOf: ee,
oneOf: Q,
oneOfType: he,

@@ -996,11 +996,11 @@ shape: _e,

}
function O(n, f) {
function C(n, f) {
this.message = n, this.data = f && typeof f == "object" ? f : {}, this.stack = "";
}
O.prototype = Error.prototype;
function N(n) {
C.prototype = Error.prototype;
function U(n) {
if (process.env.NODE_ENV !== "production")
var f = {}, S = 0;
function x(I, m, P, w, $, C, J) {
if (w = w || T, C = C || P, J !== y) {
var f = {}, x = 0;
function O(I, m, P, S, $, w, J) {
if (S = S || T, w = w || P, J !== y) {
if (u) {

@@ -1012,21 +1012,21 @@ var i = new Error(

} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
var X = w + ":" + P;
var X = S + ":" + P;
!f[X] && // Avoid spamming the console because they are often not actionable except for lib authors
S < 3 && (v(
"You are manually calling a React.PropTypes validation function for the `" + C + "` prop on `" + w + "`. 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."
), f[X] = !0, S++);
x < 3 && (v(
"You are manually calling a React.PropTypes validation function for the `" + w + "` prop on `" + S + "`. 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."
), f[X] = !0, x++);
}
}
return m[P] == null ? I ? m[P] === null ? new O("The " + $ + " `" + C + "` is marked as required " + ("in `" + w + "`, but its value is `null`.")) : new O("The " + $ + " `" + C + "` is marked as required in " + ("`" + w + "`, but its value is `undefined`.")) : null : n(m, P, w, $, C);
return m[P] == null ? I ? m[P] === null ? new C("The " + $ + " `" + w + "` is marked as required " + ("in `" + S + "`, but its value is `null`.")) : new C("The " + $ + " `" + w + "` is marked as required in " + ("`" + S + "`, but its value is `undefined`.")) : null : n(m, P, S, $, w);
}
var E = x.bind(null, !1);
return E.isRequired = x.bind(null, !0), E;
var E = O.bind(null, !1);
return E.isRequired = O.bind(null, !0), E;
}
function F(n) {
function f(S, x, E, I, m, P) {
var w = S[x], $ = K(w);
function f(x, O, E, I, m, P) {
var S = x[O], $ = K(S);
if ($ !== n) {
var C = re(w);
return new O(
"Invalid " + I + " `" + m + "` of type " + ("`" + C + "` supplied to `" + E + "`, expected ") + ("`" + n + "`."),
var w = ee(S);
return new C(
"Invalid " + I + " `" + m + "` of type " + ("`" + w + "` supplied to `" + E + "`, expected ") + ("`" + n + "`."),
{ expectedType: n }

@@ -1037,58 +1037,58 @@ );

}
return N(f);
return U(f);
}
function Q() {
return N(p);
function Z() {
return U(p);
}
function R(n) {
function f(S, x, E, I, m) {
function f(x, O, E, I, m) {
if (typeof n != "function")
return new O("Property `" + m + "` of component `" + E + "` has invalid PropType notation inside arrayOf.");
var P = S[x];
return new C("Property `" + m + "` of component `" + E + "` has invalid PropType notation inside arrayOf.");
var P = x[O];
if (!Array.isArray(P)) {
var w = K(P);
return new O("Invalid " + I + " `" + m + "` of type " + ("`" + w + "` supplied to `" + E + "`, expected an array."));
var S = K(P);
return new C("Invalid " + I + " `" + m + "` of type " + ("`" + S + "` supplied to `" + E + "`, expected an array."));
}
for (var $ = 0; $ < P.length; $++) {
var C = n(P, $, E, I, m + "[" + $ + "]", y);
if (C instanceof Error)
return C;
var w = n(P, $, E, I, m + "[" + $ + "]", y);
if (w instanceof Error)
return w;
}
return null;
}
return N(f);
return U(f);
}
function A() {
function n(f, S, x, E, I) {
var m = f[S];
function n(f, x, O, E, I) {
var m = f[x];
if (!c(m)) {
var P = K(m);
return new O("Invalid " + E + " `" + I + "` of type " + ("`" + P + "` supplied to `" + x + "`, expected a single ReactElement."));
return new C("Invalid " + E + " `" + I + "` of type " + ("`" + P + "` supplied to `" + O + "`, expected a single ReactElement."));
}
return null;
}
return N(n);
return U(n);
}
function a() {
function n(f, S, x, E, I) {
var m = f[S];
function n(f, x, O, E, I) {
var m = f[x];
if (!r.isValidElementType(m)) {
var P = K(m);
return new O("Invalid " + E + " `" + I + "` of type " + ("`" + P + "` supplied to `" + x + "`, expected a single ReactElement type."));
return new C("Invalid " + E + " `" + I + "` of type " + ("`" + P + "` supplied to `" + O + "`, expected a single ReactElement type."));
}
return null;
}
return N(n);
return U(n);
}
function te(n) {
function f(S, x, E, I, m) {
if (!(S[x] instanceof n)) {
var P = n.name || T, w = fe(S[x]);
return new O("Invalid " + I + " `" + m + "` of type " + ("`" + w + "` supplied to `" + E + "`, expected ") + ("instance of `" + P + "`."));
function f(x, O, E, I, m) {
if (!(x[O] instanceof n)) {
var P = n.name || T, S = fe(x[O]);
return new C("Invalid " + I + " `" + m + "` of type " + ("`" + S + "` supplied to `" + E + "`, expected ") + ("instance of `" + P + "`."));
}
return null;
}
return N(f);
return U(f);
}
function ee(n) {
function Q(n) {
if (!Array.isArray(n))

@@ -1098,30 +1098,30 @@ return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? v(

) : v("Invalid argument supplied to oneOf, expected an array.")), p;
function f(S, x, E, I, m) {
for (var P = S[x], w = 0; w < n.length; w++)
if (k(P, n[w]))
function f(x, O, E, I, m) {
for (var P = x[O], S = 0; S < n.length; S++)
if (k(P, n[S]))
return null;
var $ = JSON.stringify(n, function(J, i) {
var X = re(i);
var X = ee(i);
return X === "symbol" ? String(i) : i;
});
return new O("Invalid " + I + " `" + m + "` of value `" + String(P) + "` " + ("supplied to `" + E + "`, expected one of " + $ + "."));
return new C("Invalid " + I + " `" + m + "` of value `" + String(P) + "` " + ("supplied to `" + E + "`, expected one of " + $ + "."));
}
return N(f);
return U(f);
}
function B(n) {
function f(S, x, E, I, m) {
function f(x, O, E, I, m) {
if (typeof n != "function")
return new O("Property `" + m + "` of component `" + E + "` has invalid PropType notation inside objectOf.");
var P = S[x], w = K(P);
if (w !== "object")
return new O("Invalid " + I + " `" + m + "` of type " + ("`" + w + "` supplied to `" + E + "`, expected an object."));
return new C("Property `" + m + "` of component `" + E + "` has invalid PropType notation inside objectOf.");
var P = x[O], S = K(P);
if (S !== "object")
return new C("Invalid " + I + " `" + m + "` of type " + ("`" + S + "` supplied to `" + E + "`, expected an object."));
for (var $ in P)
if (s(P, $)) {
var C = n(P, $, E, I, m + "." + $, y);
if (C instanceof Error)
return C;
var w = n(P, $, E, I, m + "." + $, y);
if (w instanceof Error)
return w;
}
return null;
}
return N(f);
return U(f);
}

@@ -1132,11 +1132,11 @@ function he(n) {

for (var f = 0; f < n.length; f++) {
var S = n[f];
if (typeof S != "function")
var x = n[f];
if (typeof x != "function")
return v(
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + oe(S) + " at index " + f + "."
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + oe(x) + " at index " + f + "."
), p;
}
function x(E, I, m, P, w) {
for (var $ = [], C = 0; C < n.length; C++) {
var J = n[C], i = J(E, I, m, P, w, y);
function O(E, I, m, P, S) {
for (var $ = [], w = 0; w < n.length; w++) {
var J = n[w], i = J(E, I, m, P, S, y);
if (i == null)

@@ -1147,27 +1147,27 @@ return null;

var X = $.length > 0 ? ", expected one of type [" + $.join(", ") + "]" : "";
return new O("Invalid " + P + " `" + w + "` supplied to " + ("`" + m + "`" + X + "."));
return new C("Invalid " + P + " `" + S + "` supplied to " + ("`" + m + "`" + X + "."));
}
return N(x);
return U(O);
}
function be() {
function n(f, S, x, E, I) {
return z(f[S]) ? null : new O("Invalid " + E + " `" + I + "` supplied to " + ("`" + x + "`, expected a ReactNode."));
function n(f, x, O, E, I) {
return z(f[x]) ? null : new C("Invalid " + E + " `" + I + "` supplied to " + ("`" + O + "`, expected a ReactNode."));
}
return N(n);
return U(n);
}
function ue(n, f, S, x, E) {
return new O(
(n || "React class") + ": " + f + " type `" + S + "." + x + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + E + "`."
function ue(n, f, x, O, E) {
return new C(
(n || "React class") + ": " + f + " type `" + x + "." + O + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + E + "`."
);
}
function _e(n) {
function f(S, x, E, I, m) {
var P = S[x], w = K(P);
if (w !== "object")
return new O("Invalid " + I + " `" + m + "` of type `" + w + "` " + ("supplied to `" + E + "`, expected `object`."));
function f(x, O, E, I, m) {
var P = x[O], S = K(P);
if (S !== "object")
return new C("Invalid " + I + " `" + m + "` of type `" + S + "` " + ("supplied to `" + E + "`, expected `object`."));
for (var $ in n) {
var C = n[$];
if (typeof C != "function")
return ue(E, I, m, $, re(C));
var J = C(P, $, E, I, m + "." + $, y);
var w = n[$];
if (typeof w != "function")
return ue(E, I, m, $, ee(w));
var J = w(P, $, E, I, m + "." + $, y);
if (J)

@@ -1178,20 +1178,20 @@ return J;

}
return N(f);
return U(f);
}
function ce(n) {
function f(S, x, E, I, m) {
var P = S[x], w = K(P);
if (w !== "object")
return new O("Invalid " + I + " `" + m + "` of type `" + w + "` " + ("supplied to `" + E + "`, expected `object`."));
var $ = _({}, S[x], n);
for (var C in $) {
var J = n[C];
if (s(n, C) && typeof J != "function")
return ue(E, I, m, C, re(J));
function f(x, O, E, I, m) {
var P = x[O], S = K(P);
if (S !== "object")
return new C("Invalid " + I + " `" + m + "` of type `" + S + "` " + ("supplied to `" + E + "`, expected `object`."));
var $ = _({}, x[O], n);
for (var w in $) {
var J = n[w];
if (s(n, w) && typeof J != "function")
return ue(E, I, m, w, ee(J));
if (!J)
return new O(
"Invalid " + I + " `" + m + "` key `" + C + "` supplied to `" + E + "`.\nBad object: " + JSON.stringify(S[x], null, " ") + `
return new C(
"Invalid " + I + " `" + m + "` key `" + w + "` supplied to `" + E + "`.\nBad object: " + JSON.stringify(x[O], null, " ") + `
Valid keys: ` + JSON.stringify(Object.keys(n), null, " ")
);
var i = J(P, C, E, I, m + "." + C, y);
var i = J(P, w, E, I, m + "." + w, y);
if (i)

@@ -1202,3 +1202,3 @@ return i;

}
return N(f);
return U(f);
}

@@ -1220,10 +1220,10 @@ function z(n) {

if (f) {
var S = f.call(n), x;
var x = f.call(n), O;
if (f !== n.entries) {
for (; !(x = S.next()).done; )
if (!z(x.value))
for (; !(O = x.next()).done; )
if (!z(O.value))
return !1;
} else
for (; !(x = S.next()).done; ) {
var E = x.value;
for (; !(O = x.next()).done; ) {
var E = O.value;
if (E && !z(E[1]))

@@ -1246,3 +1246,3 @@ return !1;

}
function re(n) {
function ee(n) {
if (typeof n > "u" || n === null)

@@ -1260,3 +1260,3 @@ return "" + n;

function oe(n) {
var f = re(n);
var f = ee(n);
switch (f) {

@@ -1281,3 +1281,3 @@ case "array":

var Me, ur;
function Fr() {
function Ur() {
if (ur)

@@ -1331,8 +1331,8 @@ return Me;

if (process.env.NODE_ENV !== "production") {
var Vr = fr(), Gr = !0;
qe.exports = Ur()(Vr.isElement, Gr);
var Fr = fr(), Vr = !0;
qe.exports = Nr()(Fr.isElement, Vr);
} else
qe.exports = Fr()();
var Br = qe.exports;
const U = /* @__PURE__ */ Mr(Br), ge = (r = []) => {
qe.exports = Ur()();
var Gr = qe.exports;
const N = /* @__PURE__ */ kr(Gr), ge = (r = []) => {
if (!r || !Array.isArray(r) || !r.length)

@@ -1345,3 +1345,3 @@ return null;

};
const dr = $r(), zr = {
const dr = Ir(), Br = {
isDragging: !1,

@@ -1352,3 +1352,3 @@ start: 0,

scrolling: !0
}, Jr = 50, vr = ({
}, zr = 50, vr = ({
items: r,

@@ -1366,6 +1366,6 @@ loop: _,

() => b || 0
), [M, k] = Ce(() => zr), O = Dr([]);
), [M, k] = Ce(() => Br), C = $r([]);
if (!Array.isArray(r))
throw new Error("<Gallery> items prop must be an Array.");
const N = ye(() => {
const U = ye(() => {
T(l), d((A) => {

@@ -1380,3 +1380,3 @@ let a = A + 1;

});
}, [l, r.length, _, s]), Q = ye(
}, [l, r.length, _, s]), Z = ye(
(A) => {

@@ -1390,3 +1390,3 @@ T(l), d(A);

galleryItems: r,
itemNodes: O,
itemNodes: C,
startIndex: b,

@@ -1397,4 +1397,4 @@ activeIndex: l,

setPreviouslyActiveIndex: T,
goToIndex: Q,
next: N,
goToIndex: Z,
next: U,
previous: F,

@@ -1405,7 +1405,7 @@ loop: _,

setTouchState: k,
swipeThreshold: Jr,
swipeThreshold: zr,
onChange: s,
visibleRange: v
};
return /* @__PURE__ */ Z.jsx(dr.Provider, { value: R, children: /* @__PURE__ */ Z.jsxs(
return /* @__PURE__ */ re.jsx(dr.Provider, { value: R, children: /* @__PURE__ */ re.jsxs(
"div",

@@ -1417,3 +1417,3 @@ {

u,
p && /* @__PURE__ */ Z.jsx("p", { "aria-live": "polite", className: "gallery-util-visually-hidden", children: p.replace("$i", l + 1).replace("$t", r.length) })
p && /* @__PURE__ */ re.jsx("p", { "aria-live": "polite", className: "gallery-util-visually-hidden", children: p.replace("$i", l + 1).replace("$t", r.length) })
]

@@ -1424,11 +1424,11 @@ }

vr.propTypes = {
items: U.array.isRequired,
loop: U.bool,
draggable: U.bool,
onChange: U.func,
startIndex: U.number,
visibleRange: U.number,
ariaLiveText: U.string,
className: U.string,
children: U.node
items: N.array.isRequired,
loop: N.bool,
draggable: N.bool,
onChange: N.func,
startIndex: N.number,
visibleRange: N.number,
ariaLiveText: N.string,
className: N.string,
children: N.node
};

@@ -1443,54 +1443,8 @@ vr.defaultProps = {

const me = () => {
const r = kr(dr);
const r = Dr(dr);
if (!r)
throw new Error("useGallery must be called from within a <Gallery>.");
return r;
}, pr = ({ index: r, active: _, className: y, children: s, ...b }) => {
}, Jr = ({ renderGalleryItem: r, className: _, ...y }) => {
const {
itemNodes: v,
activeIndex: p,
previouslyActiveIndex: c,
draggable: u,
touchState: l,
visibleRange: d
} = me(), g = {
"aria-hidden": _ ? null : "true",
tabIndex: _ ? 0 : -1
};
return /* @__PURE__ */ Z.jsx(
"li",
{
ref: (T) => v.current[r] = T,
...g,
...b,
className: ge([
"gallery__item",
u && "gallery__item--draggable",
u && l.offsetting && "gallery__item--dragging",
_ && "gallery__item--active",
r === c && "gallery__item--was-active",
r < p && "gallery__item--left",
r > p && "gallery__item--right",
(d === -1 || Math.abs(r - p) <= d) && "gallery__item--visible",
y
]),
style: {
"--i": r,
"--center-offset": Math.abs(r - p),
"--index-offset": r - p,
"--side": r < p ? -1 : r > p ? 1 : 0,
"--active": _ ? 1 : 0
},
children: s
}
);
};
pr.propTypes = {
index: U.number.isRequired,
active: U.bool.isRequired,
className: U.string,
children: U.node
};
const Hr = ({ renderGalleryItem: r, className: _, ...y }) => {
const {
activeIndex: s,

@@ -1510,9 +1464,9 @@ galleryItems: b,

if (!u.start)
l((O) => ({
...O,
l((C) => ({
...C,
start: { x: k.clientX, y: k.clientY }
}));
else {
const O = k.clientX - u.start.x, N = k.clientY - u.start.y;
u.offsetting ? l((F) => ({ ...F, xOffset: O })) : (Math.abs(N) > 20 && l((F) => ({ ...F, scrolling: !0 })), Math.abs(O) > 10 && l((F) => ({ ...F, offsetting: !0, xOffset: O })));
const C = k.clientX - u.start.x, U = k.clientY - u.start.y;
u.offsetting ? l((F) => ({ ...F, xOffset: C })) : (Math.abs(U) > 20 && l((F) => ({ ...F, scrolling: !0 })), Math.abs(C) > 10 && l((F) => ({ ...F, offsetting: !0, xOffset: C })));
}

@@ -1546,3 +1500,3 @@ },

]);
return /* @__PURE__ */ Z.jsx(
return /* @__PURE__ */ re.jsx(
"ul",

@@ -1556,14 +1510,11 @@ {

...y,
children: b.map((k, O) => {
const N = s === O;
return /* @__PURE__ */ Z.jsx(pr, { index: O, active: N, children: r({ item: k, i: O, activeIndex: s, active: N }) }, O);
})
children: b.map((k, C) => r({ item: k, i: C, activeIndex: s, active: s === C }))
}
);
};
Hr.propTypes = {
renderGalleryItem: U.func.isRequired,
className: U.string
Jr.propTypes = {
renderGalleryItem: N.func.isRequired,
className: N.string
};
const yr = ({
const pr = ({
index: r,

@@ -1578,22 +1529,22 @@ active: _,

};
return /* @__PURE__ */ Z.jsx("li", { className: ge(["gallery__pagination-item", y]), ...b, children: /* @__PURE__ */ Z.jsx("button", { onClick: () => c(r), "aria-current": _ ? "true" : null, children: s }) });
return /* @__PURE__ */ re.jsx("li", { className: ge(["gallery__pagination-item", y]), ...b, children: /* @__PURE__ */ re.jsx("button", { onClick: () => c(r), "aria-current": _ ? "true" : null, children: s }) });
};
yr.propTypes = {
index: U.number.isRequired,
active: U.bool.isRequired,
className: U.string,
children: U.node
pr.propTypes = {
index: N.number.isRequired,
active: N.bool.isRequired,
className: N.string,
children: N.node
};
const Kr = ({ renderPaginationItem: r, className: _, ...y }) => {
const Hr = ({ renderPaginationItem: r, className: _, ...y }) => {
const { activeIndex: s, galleryItems: b } = me();
return /* @__PURE__ */ Z.jsx("ul", { className: ge(["gallery__pagination", _]), ...y, children: b.map((v, p) => {
return /* @__PURE__ */ re.jsx("ul", { className: ge(["gallery__pagination", _]), ...y, children: b.map((v, p) => {
const c = s === p;
return /* @__PURE__ */ Z.jsx(yr, { index: p, active: c, children: r({ item: v, i: p, activeIndex: s, active: c }) }, p);
return /* @__PURE__ */ re.jsx(pr, { index: p, active: c, children: r({ item: v, i: p, activeIndex: s, active: c }) }, p);
}) });
};
Kr.propTypes = {
renderPaginationItem: U.func.isRequired,
className: U.string
Hr.propTypes = {
renderPaginationItem: N.func.isRequired,
className: N.string
};
const Xr = ({
const Kr = ({
direction: r,

@@ -1611,3 +1562,3 @@ renderNavItem: _,

};
return !s && !_ ? null : /* @__PURE__ */ Z.jsx(
return !s && !_ ? null : /* @__PURE__ */ re.jsx(
"button",

@@ -1627,14 +1578,61 @@ {

};
Kr.propTypes = {
direction: N.oneOf([0, 1]).isRequired,
renderNavItem: N.func,
className: N.string,
children: N.node
};
const Xr = ({ index: r, active: _, className: y, children: s, ...b }) => {
const {
itemNodes: v,
activeIndex: p,
previouslyActiveIndex: c,
draggable: u,
touchState: l,
visibleRange: d
} = me(), g = {
"aria-hidden": _ ? null : "true",
tabIndex: _ ? 0 : -1
};
return /* @__PURE__ */ re.jsx(
"li",
{
ref: (T) => v.current[r] = T,
...g,
...b,
className: ge([
"gallery__item",
u && "gallery__item--draggable",
u && l.offsetting && "gallery__item--dragging",
_ && "gallery__item--active",
r === c && "gallery__item--was-active",
r < p && "gallery__item--left",
r > p && "gallery__item--right",
(d === -1 || Math.abs(r - p) <= d) && "gallery__item--visible",
y
]),
style: {
"--i": r,
"--center-offset": Math.abs(r - p),
"--index-offset": r - p,
"--side": r < p ? -1 : r > p ? 1 : 0,
"--active": _ ? 1 : 0
},
children: s
}
);
};
Xr.propTypes = {
direction: U.oneOf([0, 1]).isRequired,
renderNavItem: U.func,
className: U.string,
children: U.node
index: N.number.isRequired,
active: N.bool.isRequired,
className: N.string,
children: N.node
};
export {
vr as Gallery,
Hr as GalleryMain,
Xr as GalleryNav,
Kr as GalleryPagination,
Xr as GalleryItem,
Jr as GalleryMain,
Kr as GalleryNav,
Hr as GalleryPagination,
me as useGallery
};
{
"name": "@wethegit/react-gallery",
"version": "1.0.3",
"version": "2.0.0",
"description": "A customizable, accessible gallery component for React projects.",

@@ -5,0 +5,0 @@ "files": [

@@ -11,2 +11,3 @@ # @wethegit/react-gallery

- [GalleryMain](#gallerymain)
- [GalleryItem](#galleryitem)
- [GalleryNav](#gallerynav)

@@ -54,3 +55,3 @@ - [GalleryPagination](#gallerypagination)

import "@wethegit/react-gallery/dist/main.css"
import "@wethegit/react-gallery/style.css"
```

@@ -81,3 +82,3 @@

import { GALLERY_ITEMS } from "./some-data"
import { Gallery, GalleryMain, GalleryNav, GalleryPagination } from "@wethegit/react-gallery"
import { Gallery, GalleryMain, GalleryNav, GalleryPagination, GalleryItem } from "@wethegit/react-gallery"

@@ -89,4 +90,6 @@ const YourGallery = () => {

<GalleryMain
renderGalleryItem={({ item }) => (
<img src={item.image} alt={item.alt} />
renderGalleryItem={({ item, i, active }) => (
<GalleryItem key={i} index={i} active={active}>
<img src={item.image} alt={item.alt} />
</GalleryItem>
)}

@@ -113,3 +116,3 @@ />

`<GalleryMain>` is the primary gallery view where your item data is rendered. It receives a render prop, `renderGalleryItem`, which exposes a few arguments you can use in the JSX you return: `item`, `i`, `activeIndex`, and `active`. For a detailed breakdown of this component, jump ahead to the [GalleryMain](#gallerymain) section.
`<GalleryMain>` is the primary gallery view where your item data is rendered. It receives a render prop, `renderGalleryItem`, which exposes a few arguments you can use in the JSX you return: `item`, `i`, `activeIndex`, and `active` and expects a `<GalleryItem>` to be returned. For a detailed breakdown of this component, jump ahead to the [GalleryMain](#gallerymain) section.

@@ -186,3 +189,3 @@ We're using the `<GalleryNav>` component to define our "next" and "previous" buttons. These components receive a `direction` prop, which expects either a `1` or a `0`, and corresponds to the direction the gallery should move in when the button in question is clicked (where `0` maps to "previous", and `1` maps to "next"). For a detailed breakdown of this component, see the [GalleryNav](#gallerynav) section.

This render prop wraps its return value in a list item (`<li>`), and receives a handful of arguments:
This render prop expects a `<GalleryItem>` to be returned, and receives a handful of arguments:

@@ -196,2 +199,13 @@ | Argument | Type | Description |

### &lt;GalleryItem&gt;
Required component that wraps each child inside the `renderGalleryitem` prop. Renders a list item (`<li>`) and can accept the following props:
| Prop | Type | Description |
| ----------------- | -------- | --------------------------------------------------------------------------------------------------------------- |
| children | JSX | |
| className | String | |
| active | Boolean | Whether the current item being iterated over is the active item. |
| index | Number | The index of the currently active gallery item. |
### &lt;GalleryNav&gt;

@@ -198,0 +212,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc