react-spring-carousel 3.0.0-beta078 → 3.0.0-beta080
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 +1 -239
- package/dist/index.cjs2.js +1 -0
- package/dist/index.cjs3.js +5 -0
- package/dist/index.cjs4.js +1 -0
- package/dist/index.es.js +12 -0
- package/dist/index.es2.js +6 -0
- package/dist/index.es3.js +1087 -0
- package/dist/index.es4.js +254 -0
- package/dist/use-gesture-react.esm-662f7bb4.cjs +1 -0
- package/dist/use-gesture-react.esm-9eb8841a.js +1004 -0
- package/dist/useThumbsModule-08e90459.js +723 -0
- package/dist/useThumbsModule-f2f898fc.cjs +27 -0
- package/package.json +4 -4
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.esm.js +0 -25598
- package/dist/index.esm.js.map +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";const Q=require("react"),or=require("@react-spring/web");exports.jsxRuntimeExports={};var ir={get exports(){return exports.jsxRuntimeExports},set exports(c){exports.jsxRuntimeExports=c}},W={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var we;function ur(){if(we)return W;we=1;var c=Q,m=Symbol.for("react.element"),j=Symbol.for("react.fragment"),y=Object.prototype.hasOwnProperty,k=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,g={key:!0,ref:!0,__self:!0,__source:!0};function P(T,f,C){var p,_={},d=null,b=null;C!==void 0&&(d=""+C),f.key!==void 0&&(d=""+f.key),f.ref!==void 0&&(b=f.ref);for(p in f)y.call(f,p)&&!g.hasOwnProperty(p)&&(_[p]=f[p]);if(T&&T.defaultProps)for(p in f=T.defaultProps,f)_[p]===void 0&&(_[p]=f[p]);return{$$typeof:m,type:T,key:d,ref:b,props:_,_owner:k.current}}return W.Fragment=j,W.jsx=P,W.jsxs=P,W}var $={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var xe;function sr(){return xe||(xe=1,process.env.NODE_ENV!=="production"&&function(){var c=Q,m=Symbol.for("react.element"),j=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),P=Symbol.for("react.provider"),T=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),E=Symbol.iterator,Y="@@iterator";function N(e){if(e===null||typeof e!="object")return null;var r=E&&e[E]||e[Y];return typeof r=="function"?r:null}var O=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Ce("error",e,t)}}function Ce(e,r,t){{var n=O.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var u=t.map(function(o){return String(o)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var Oe=!1,Pe=!1,Se=!1,je=!1,ke=!1,ee;ee=Symbol.for("react.module.reference");function De(e){return!!(typeof e=="string"||typeof e=="function"||e===y||e===g||ke||e===k||e===C||e===p||je||e===b||Oe||Pe||Se||typeof e=="object"&&e!==null&&(e.$$typeof===d||e.$$typeof===_||e.$$typeof===P||e.$$typeof===T||e.$$typeof===f||e.$$typeof===ee||e.getModuleId!==void 0))}function Fe(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function re(e){return e.displayName||"Context"}function w(e){if(e==null)return null;if(typeof e.tag=="number"&&v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case y:return"Fragment";case j:return"Portal";case g:return"Profiler";case k:return"StrictMode";case C:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case T:var r=e;return re(r)+".Consumer";case P:var t=e;return re(t._context)+".Provider";case f:return Fe(e,e.render,"ForwardRef");case _:var n=e.displayName||null;return n!==null?n:w(e.type)||"Memo";case d:{var i=e,u=i._payload,o=i._init;try{return w(o(u))}catch{return null}}}return null}var S=Object.assign,I=0,te,ne,ae,oe,ie,ue,se;function le(){}le.__reactDisabledLog=!0;function Ie(){{if(I===0){te=console.log,ne=console.info,ae=console.warn,oe=console.error,ie=console.group,ue=console.groupCollapsed,se=console.groupEnd;var e={configurable:!0,enumerable:!0,value:le,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}I++}}function Ae(){{if(I--,I===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:S({},e,{value:te}),info:S({},e,{value:ne}),warn:S({},e,{value:ae}),error:S({},e,{value:oe}),group:S({},e,{value:ie}),groupCollapsed:S({},e,{value:ue}),groupEnd:S({},e,{value:se})})}I<0&&v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var q=O.ReactCurrentDispatcher,H;function L(e,r,t){{if(H===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);H=n&&n[1]||""}return`
|
|
18
|
+
`+H+e}}var J=!1,M;{var We=typeof WeakMap=="function"?WeakMap:Map;M=new We}function fe(e,r){if(!e||J)return"";{var t=M.get(e);if(t!==void 0)return t}var n;J=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=q.current,q.current=null,Ie();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(x){n=x}Reflect.construct(e,[],o)}else{try{o.call()}catch(x){n=x}e.call(o.prototype)}}else{try{throw Error()}catch(x){n=x}e()}}catch(x){if(x&&n&&typeof x.stack=="string"){for(var a=x.stack.split(`
|
|
19
|
+
`),h=n.stack.split(`
|
|
20
|
+
`),s=a.length-1,l=h.length-1;s>=1&&l>=0&&a[s]!==h[l];)l--;for(;s>=1&&l>=0;s--,l--)if(a[s]!==h[l]){if(s!==1||l!==1)do if(s--,l--,l<0||a[s]!==h[l]){var R=`
|
|
21
|
+
`+a[s].replace(" at new "," at ");return e.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",e.displayName)),typeof e=="function"&&M.set(e,R),R}while(s>=1&&l>=0);break}}}finally{J=!1,q.current=u,Ae(),Error.prepareStackTrace=i}var F=e?e.displayName||e.name:"",Te=F?L(F):"";return typeof e=="function"&&M.set(e,Te),Te}function $e(e,r,t){return fe(e,!1)}function Ye(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function V(e,r,t){if(e==null)return"";if(typeof e=="function")return fe(e,Ye(e));if(typeof e=="string")return L(e);switch(e){case C:return L("Suspense");case p:return L("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return $e(e.render);case _:return V(e.type,r,t);case d:{var n=e,i=n._payload,u=n._init;try{return V(u(i),r,t)}catch{}}}return""}var U=Object.prototype.hasOwnProperty,ce={},de=O.ReactDebugCurrentFrame;function B(e){if(e){var r=e._owner,t=V(e.type,e._source,r?r.type:null);de.setExtraStackFrame(t)}else de.setExtraStackFrame(null)}function Ne(e,r,t,n,i){{var u=Function.call.bind(U);for(var o in e)if(u(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var h=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(s){a=s}a&&!(a instanceof Error)&&(B(i),v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),B(null)),a instanceof Error&&!(a.message in ce)&&(ce[a.message]=!0,B(i),v("Failed %s type: %s",t,a.message),B(null))}}}var Le=Array.isArray;function G(e){return Le(e)}function Me(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Ve(e){try{return ve(e),!1}catch{return!0}}function ve(e){return""+e}function pe(e){if(Ve(e))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Me(e)),ve(e)}var A=O.ReactCurrentOwner,Ue={key:!0,ref:!0,__self:!0,__source:!0},he,ge,z;z={};function Be(e){if(U.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function qe(e){if(U.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function He(e,r){if(typeof e.ref=="string"&&A.current&&r&&A.current.stateNode!==r){var t=w(A.current.type);z[t]||(v('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',w(A.current.type),e.ref),z[t]=!0)}}function Je(e,r){{var t=function(){he||(he=!0,v("%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)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function Ge(e,r){{var t=function(){ge||(ge=!0,v("%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)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var ze=function(e,r,t,n,i,u,o){var a={$$typeof:m,type:e,key:r,ref:t,props:o,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function Ke(e,r,t,n,i){{var u,o={},a=null,h=null;t!==void 0&&(pe(t),a=""+t),qe(r)&&(pe(r.key),a=""+r.key),Be(r)&&(h=r.ref,He(r,i));for(u in r)U.call(r,u)&&!Ue.hasOwnProperty(u)&&(o[u]=r[u]);if(e&&e.defaultProps){var s=e.defaultProps;for(u in s)o[u]===void 0&&(o[u]=s[u])}if(a||h){var l=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&Je(o,l),h&&Ge(o,l)}return ze(e,a,h,i,n,A.current,o)}}var K=O.ReactCurrentOwner,me=O.ReactDebugCurrentFrame;function D(e){if(e){var r=e._owner,t=V(e.type,e._source,r?r.type:null);me.setExtraStackFrame(t)}else me.setExtraStackFrame(null)}var X;X=!1;function Z(e){return typeof e=="object"&&e!==null&&e.$$typeof===m}function be(){{if(K.current){var e=w(K.current.type);if(e)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function Xe(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
24
|
+
|
|
25
|
+
Check your code at `+r+":"+t+"."}return""}}var Ee={};function Ze(e){{var r=be();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
26
|
+
|
|
27
|
+
Check the top-level render call using <`+t+">.")}return r}}function Re(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Ze(r);if(Ee[t])return;Ee[t]=!0;var n="";e&&e._owner&&e._owner!==K.current&&(n=" It was passed a child from "+w(e._owner.type)+"."),D(e),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),D(null)}}function ye(e,r){{if(typeof e!="object")return;if(G(e))for(var t=0;t<e.length;t++){var n=e[t];Z(n)&&Re(n,r)}else if(Z(e))e._store&&(e._store.validated=!0);else if(e){var i=N(e);if(typeof i=="function"&&i!==e.entries)for(var u=i.call(e),o;!(o=u.next()).done;)Z(o.value)&&Re(o.value,r)}}}function Qe(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===f||r.$$typeof===_))t=r.propTypes;else return;if(t){var n=w(r);Ne(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!X){X=!0;var i=w(r);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function er(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){D(e),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),D(null);break}}e.ref!==null&&(D(e),v("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}}function _e(e,r,t,n,i,u){{var o=De(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" 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=Xe(i);h?a+=h:a+=be();var s;e===null?s="null":G(e)?s="array":e!==void 0&&e.$$typeof===m?(s="<"+(w(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,a)}var l=Ke(e,r,t,i,u);if(l==null)return l;if(o){var R=r.children;if(R!==void 0)if(n)if(G(R)){for(var F=0;F<R.length;F++)ye(R[F],e);Object.freeze&&Object.freeze(R)}else v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ye(R,e)}return e===y?er(l):Qe(l),l}}function rr(e,r,t){return _e(e,r,t,!0)}function tr(e,r,t){return _e(e,r,t,!1)}var nr=tr,ar=rr;$.Fragment=y,$.jsx=nr,$.jsxs=ar}()),$}(function(c){process.env.NODE_ENV==="production"?c.exports=ur():c.exports=sr()})(ir);function lr(c){const m=c.getBoundingClientRect();return m.top>=0&&m.left>=0&&m.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&m.right<=(window.innerWidth||document.documentElement.clientWidth)}function fr({thumbsSlideAxis:c="x",withThumbs:m=!1,prepareThumbsData:j,items:y,renderThumbFnProps:k}){const g=Q.useRef(null),[P,T]=or.useSpring(()=>({val:0}));function f(){var d;return Math.round(Number((d=g.current)==null?void 0:d[c==="x"?"scrollWidth":"scrollHeight"])-g.current.getBoundingClientRect()[c==="x"?"width":"height"])}function C(d){var Y;function b(){return g.current?g.current.querySelector(`#thumb-item-${y[d].id}`):null}const E=b();if(E&&g.current&&!lr(E)){const N=E.offsetLeft,O=N>f()?f():N;T.start({from:{val:((Y=g.current)==null?void 0:Y[c==="x"?"scrollLeft":"scrollTop"])??0},to:{val:O},onChange:({value:v})=>{g.current&&(g.current[c==="x"?"scrollLeft":"scrollTop"]=Math.abs(v.val))}})}}function p(){function d(b){return b.map(E=>({id:E.id,renderThumb:E.renderThumb}))}return j?j(d(y)):d(y)}return{thumbsFragment:m?exports.jsxRuntimeExports.jsx("div",{className:"use-spring-carousel-thumbs-wrapper",ref:g,onWheel:()=>P.val.stop(),style:{display:"flex",flex:"1",position:"relative",width:"100%",height:"100%",flexDirection:c==="x"?"row":"column",...c==="x"?{overflowX:"auto"}:{overflowY:"auto",maxHeight:"100%"}},children:p().map(({id:d,renderThumb:b})=>{const E=`thumb-item-${d}`;return exports.jsxRuntimeExports.jsx("div",{id:E,className:"thumb-item",children:typeof b=="function"?b(k):b},E)})}):null,handleScroll:C}}exports.useThumbsModule=fr;
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-spring-carousel",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-beta080",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A new <Carousel /> experience for the web",
|
|
6
6
|
"homepage": "https://react-spring-carousel.emilianobucci.com",
|
|
7
7
|
"repository": "https://github.com/Emiliano-Bucci/react-spring-carousel",
|
|
8
8
|
"author": "Emiliano Bucci",
|
|
9
9
|
"license": "MIT",
|
|
10
|
-
"main": "
|
|
11
|
-
"module": "
|
|
12
|
-
"types": "
|
|
10
|
+
"main": "dist/index.cjs.js",
|
|
11
|
+
"module": "dist/index.es.js",
|
|
12
|
+
"types": "dist/index.d.ts",
|
|
13
13
|
"files": [
|
|
14
14
|
"dist"
|
|
15
15
|
],
|