react-spring-carousel 3.0.0-beta067 → 3.0.0-beta070
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 +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +18 -0
- package/dist/index2.cjs +1 -0
- package/dist/index2.js +10 -0
- package/dist/{types/modules → modules}/index.d.ts +3 -3
- package/dist/{types/modules → modules}/useEventsModule.d.ts +51 -51
- package/dist/{types/modules → modules}/useFullscreenModule.d.ts +12 -12
- package/dist/{types/modules → modules}/useThumbsModule.d.ts +14 -14
- package/dist/types/{types/common.d.ts → common.d.ts} +34 -34
- package/dist/types/index.d.ts +4 -3
- package/dist/types/{types/useSpringCarousel.types.d.ts → useSpringCarousel.types.d.ts} +102 -102
- package/dist/types/{types/useTransitionCarousel.types.d.ts → useTransitionCarousel.types.d.ts} +33 -33
- package/dist/useFullscreenModule-55ea7b9d.js +38 -0
- package/dist/useFullscreenModule-be189d5b.cjs +1 -0
- package/dist/useSpringCarousel.cjs +1 -0
- package/dist/{types/useSpringCarousel.d.ts → useSpringCarousel.d.ts} +18 -18
- package/dist/useSpringCarousel.js +658 -0
- package/dist/useThumbsModule-0c05dcf5.cjs +27 -0
- package/dist/useThumbsModule-db93025f.js +753 -0
- package/dist/useTransitionCarousel.cjs +1 -0
- package/dist/{types/useTransitionCarousel.d.ts → useTransitionCarousel.d.ts} +5 -5
- package/dist/useTransitionCarousel.js +257 -0
- package/package.json +37 -48
- package/README.md +0 -54
- package/dist/cjs/index.js +0 -2
- package/dist/cjs/index.js.map +0 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index2.js +0 -2
- package/dist/esm/index2.js.map +0 -1
- package/dist/esm/useFullscreenModule-519d337d.js +0 -2
- package/dist/esm/useFullscreenModule-519d337d.js.map +0 -1
- package/dist/esm/useSpringCarousel.js +0 -2
- package/dist/esm/useSpringCarousel.js.map +0 -1
- package/dist/esm/useThumbsModule-faa196f9.js +0 -2
- package/dist/esm/useThumbsModule-faa196f9.js.map +0 -1
- package/dist/esm/useTransitionCarousel.js +0 -2
- package/dist/esm/useTransitionCarousel.js.map +0 -1
- package/dist/types/mockedItems.d.ts +0 -2
- package/dist/types/types/index.d.ts +0 -4
- package/dist/umd/index.js +0 -2
- package/dist/umd/index.js.map +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";const L=require("react"),ir=require("@react-spring/web");exports.jsxRuntimeExports={};var ur={get exports(){return exports.jsxRuntimeExports},set exports(s){exports.jsxRuntimeExports=s}},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 xe;function sr(){if(xe)return W;xe=1;var s=L,E=Symbol.for("react.element"),O=Symbol.for("react.fragment"),h=Object.prototype.hasOwnProperty,_=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function j(w,d,P){var m,T={},v=null,b=null;P!==void 0&&(v=""+P),d.key!==void 0&&(v=""+d.key),d.ref!==void 0&&(b=d.ref);for(m in d)h.call(d,m)&&!f.hasOwnProperty(m)&&(T[m]=d[m]);if(w&&w.defaultProps)for(m in d=w.defaultProps,d)T[m]===void 0&&(T[m]=d[m]);return{$$typeof:E,type:w,key:v,ref:b,props:T,_owner:_.current}}return W.Fragment=O,W.jsx=j,W.jsxs=j,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 Ce;function lr(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){var s=L,E=Symbol.for("react.element"),O=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),w=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),R=Symbol.iterator,Y="@@iterator";function N(e){if(e===null||typeof e!="object")return null;var r=R&&e[R]||e[Y];return typeof r=="function"?r:null}var S=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Oe("error",e,t)}}function Oe(e,r,t){{var n=S.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 Pe=!1,Se=!1,je=!1,ke=!1,De=!1,re;re=Symbol.for("react.module.reference");function Fe(e){return!!(typeof e=="string"||typeof e=="function"||e===h||e===f||De||e===_||e===P||e===m||ke||e===b||Pe||Se||je||typeof e=="object"&&e!==null&&(e.$$typeof===v||e.$$typeof===T||e.$$typeof===j||e.$$typeof===w||e.$$typeof===d||e.$$typeof===re||e.getModuleId!==void 0))}function Ie(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function te(e){return e.displayName||"Context"}function x(e){if(e==null)return null;if(typeof e.tag=="number"&&p("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 h:return"Fragment";case O:return"Portal";case f:return"Profiler";case _:return"StrictMode";case P:return"Suspense";case m:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case w:var r=e;return te(r)+".Consumer";case j:var t=e;return te(t._context)+".Provider";case d:return Ie(e,e.render,"ForwardRef");case T:var n=e.displayName||null;return n!==null?n:x(e.type)||"Memo";case v:{var i=e,u=i._payload,o=i._init;try{return x(o(u))}catch{return null}}}return null}var k=Object.assign,I=0,ne,ae,oe,ie,ue,se,le;function ce(){}ce.__reactDisabledLog=!0;function Ae(){{if(I===0){ne=console.log,ae=console.info,oe=console.warn,ie=console.error,ue=console.group,se=console.groupCollapsed,le=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ce,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}I++}}function We(){{if(I--,I===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},e,{value:ne}),info:k({},e,{value:ae}),warn:k({},e,{value:oe}),error:k({},e,{value:ie}),group:k({},e,{value:ue}),groupCollapsed:k({},e,{value:se}),groupEnd:k({},e,{value:le})})}I<0&&p("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var J=S.ReactCurrentDispatcher,G;function M(e,r,t){{if(G===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);G=n&&n[1]||""}return`
|
|
18
|
+
`+G+e}}var H=!1,V;{var $e=typeof WeakMap=="function"?WeakMap:Map;V=new $e}function fe(e,r){if(!e||H)return"";{var t=V.get(e);if(t!==void 0)return t}var n;H=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=J.current,J.current=null,Ae();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(C){n=C}Reflect.construct(e,[],o)}else{try{o.call()}catch(C){n=C}e.call(o.prototype)}}else{try{throw Error()}catch(C){n=C}e()}}catch(C){if(C&&n&&typeof C.stack=="string"){for(var a=C.stack.split(`
|
|
19
|
+
`),g=n.stack.split(`
|
|
20
|
+
`),l=a.length-1,c=g.length-1;l>=1&&c>=0&&a[l]!==g[c];)c--;for(;l>=1&&c>=0;l--,c--)if(a[l]!==g[c]){if(l!==1||c!==1)do if(l--,c--,c<0||a[l]!==g[c]){var y=`
|
|
21
|
+
`+a[l].replace(" at new "," at ");return e.displayName&&y.includes("<anonymous>")&&(y=y.replace("<anonymous>",e.displayName)),typeof e=="function"&&V.set(e,y),y}while(l>=1&&c>=0);break}}}finally{H=!1,J.current=u,We(),Error.prepareStackTrace=i}var F=e?e.displayName||e.name:"",we=F?M(F):"";return typeof e=="function"&&V.set(e,we),we}function Le(e,r,t){return fe(e,!1)}function Ye(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function U(e,r,t){if(e==null)return"";if(typeof e=="function")return fe(e,Ye(e));if(typeof e=="string")return M(e);switch(e){case P:return M("Suspense");case m:return M("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return Le(e.render);case T:return U(e.type,r,t);case v:{var n=e,i=n._payload,u=n._init;try{return U(u(i),r,t)}catch{}}}return""}var q=Object.prototype.hasOwnProperty,de={},ve=S.ReactDebugCurrentFrame;function B(e){if(e){var r=e._owner,t=U(e.type,e._source,r?r.type:null);ve.setExtraStackFrame(t)}else ve.setExtraStackFrame(null)}function Ne(e,r,t,n,i){{var u=Function.call.bind(q);for(var o in e)if(u(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var g=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 g.name="Invariant Violation",g}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){a=l}a&&!(a instanceof Error)&&(B(i),p("%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 de)&&(de[a.message]=!0,B(i),p("Failed %s type: %s",t,a.message),B(null))}}}var Me=Array.isArray;function z(e){return Me(e)}function Ve(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Ue(e){try{return pe(e),!1}catch{return!0}}function pe(e){return""+e}function he(e){if(Ue(e))return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ve(e)),pe(e)}var A=S.ReactCurrentOwner,qe={key:!0,ref:!0,__self:!0,__source:!0},me,ge,K;K={};function Be(e){if(q.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Je(e){if(q.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Ge(e,r){if(typeof e.ref=="string"&&A.current&&r&&A.current.stateNode!==r){var t=x(A.current.type);K[t]||(p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',x(A.current.type),e.ref),K[t]=!0)}}function He(e,r){{var t=function(){me||(me=!0,p("%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 ze(e,r){{var t=function(){ge||(ge=!0,p("%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 Ke=function(e,r,t,n,i,u,o){var a={$$typeof:E,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 Xe(e,r,t,n,i){{var u,o={},a=null,g=null;t!==void 0&&(he(t),a=""+t),Je(r)&&(he(r.key),a=""+r.key),Be(r)&&(g=r.ref,Ge(r,i));for(u in r)q.call(r,u)&&!qe.hasOwnProperty(u)&&(o[u]=r[u]);if(e&&e.defaultProps){var l=e.defaultProps;for(u in l)o[u]===void 0&&(o[u]=l[u])}if(a||g){var c=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&He(o,c),g&&ze(o,c)}return Ke(e,a,g,i,n,A.current,o)}}var X=S.ReactCurrentOwner,Ee=S.ReactDebugCurrentFrame;function D(e){if(e){var r=e._owner,t=U(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}var Z;Z=!1;function Q(e){return typeof e=="object"&&e!==null&&e.$$typeof===E}function be(){{if(X.current){var e=x(X.current.type);if(e)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function Ze(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
24
|
+
|
|
25
|
+
Check your code at `+r+":"+t+"."}return""}}var Re={};function Qe(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 ye(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=Qe(r);if(Re[t])return;Re[t]=!0;var n="";e&&e._owner&&e._owner!==X.current&&(n=" It was passed a child from "+x(e._owner.type)+"."),D(e),p('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 _e(e,r){{if(typeof e!="object")return;if(z(e))for(var t=0;t<e.length;t++){var n=e[t];Q(n)&&ye(n,r)}else if(Q(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;)Q(o.value)&&ye(o.value,r)}}}function er(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===d||r.$$typeof===T))t=r.propTypes;else return;if(t){var n=x(r);Ne(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!Z){Z=!0;var i=x(r);p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function rr(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),p("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),p("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}}function Te(e,r,t,n,i,u){{var o=Fe(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 g=Ze(i);g?a+=g:a+=be();var l;e===null?l="null":z(e)?l="array":e!==void 0&&e.$$typeof===E?(l="<"+(x(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,a)}var c=Xe(e,r,t,i,u);if(c==null)return c;if(o){var y=r.children;if(y!==void 0)if(n)if(z(y)){for(var F=0;F<y.length;F++)_e(y[F],e);Object.freeze&&Object.freeze(y)}else p("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 _e(y,e)}return e===h?rr(c):er(c),c}}function tr(e,r,t){return Te(e,r,t,!0)}function nr(e,r,t){return Te(e,r,t,!1)}var ar=nr,or=tr;$.Fragment=h,$.jsx=ar,$.jsxs=or}()),$}(function(s){process.env.NODE_ENV==="production"?s.exports=sr():s.exports=lr()})(ur);const ee="RSC::Event";function cr(){const s=L.useRef(null);function E(h){L.useEffect(()=>{s.current||(s.current=document.createElement("div"));function _(f){h(f.detail)}if(s.current)return s.current.addEventListener(ee,_,!1),()=>{var f;(f=s.current)==null||f.removeEventListener(ee,_,!1)}},[h])}function O(h){if(s.current){const _=new CustomEvent(ee,{detail:h});s.current.dispatchEvent(_)}}return{useListenToCustomEvent:E,emitEvent:O}}function fr(s){const E=s.getBoundingClientRect();return E.top>=0&&E.left>=0&&E.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&E.right<=(window.innerWidth||document.documentElement.clientWidth)}function dr({thumbsSlideAxis:s="x",withThumbs:E=!1,prepareThumbsData:O,items:h,renderThumbFnProps:_}){const f=L.useRef(null),[j,w]=ir.useSpring(()=>({val:0}));function d(){var v;return Math.round(Number((v=f.current)==null?void 0:v[s==="x"?"scrollWidth":"scrollHeight"])-f.current.getBoundingClientRect()[s==="x"?"width":"height"])}function P(v){var Y;function b(){return f.current?f.current.querySelector(`#thumb-item-${h[v].id}`):null}const R=b();if(R&&f.current&&!fr(R)){const N=R.offsetLeft,S=N>d()?d():N;w.start({from:{val:((Y=f.current)==null?void 0:Y[s==="x"?"scrollLeft":"scrollTop"])??0},to:{val:S},onChange:({value:p})=>{f.current&&(f.current[s==="x"?"scrollLeft":"scrollTop"]=Math.abs(p.val))}})}}function m(){function v(b){return b.map(R=>({id:R.id,renderThumb:R.renderThumb}))}return O?O(v(h)):v(h)}return{thumbsFragment:E?exports.jsxRuntimeExports.jsx("div",{className:"use-spring-carousel-thumbs-wrapper",ref:f,onWheel:()=>j.val.stop(),style:{display:"flex",flex:"1",position:"relative",width:"100%",height:"100%",flexDirection:s==="x"?"row":"column",...s==="x"?{overflowX:"auto"}:{overflowY:"auto",maxHeight:"100%"}},children:m().map(({id:v,renderThumb:b})=>{const R=`thumb-item-${v}`;return exports.jsxRuntimeExports.jsx("div",{id:R,className:"thumb-item",children:typeof b=="function"?b(_):b},R)})}):null,handleScroll:P}}exports.useEventsModule=cr;exports.useThumbsModule=dr;
|