@infinityfx/lively 2.2.0 → 3.0.0-beta.0
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/README.md +2 -2
- package/dist/animations.js +2 -0
- package/dist/animations.js.map +1 -0
- package/dist/hooks.js +2 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/pop-0fdae9af.js +2 -0
- package/dist/pop-0fdae9af.js.map +1 -0
- package/dist/tslib.es6-96c5f7c9.js +2 -0
- package/dist/tslib.es6-96c5f7c9.js.map +1 -0
- package/dist/types/animatable.d.ts +40 -0
- package/dist/types/animate.d.ts +9 -0
- package/dist/types/animations/fade.d.ts +3 -0
- package/dist/types/animations/move.d.ts +3 -0
- package/dist/types/animations/pop.d.ts +3 -0
- package/dist/types/animations/scale.d.ts +3 -0
- package/dist/types/animations/wipe.d.ts +3 -0
- package/dist/types/animations.d.ts +6 -0
- package/dist/types/core/cache.d.ts +29 -0
- package/dist/types/core/clip.d.ts +51 -0
- package/dist/types/core/timeline.d.ts +32 -0
- package/dist/types/core/utils.d.ts +8 -0
- package/dist/types/hooks/use-link.d.ts +6 -0
- package/dist/types/hooks/use-mount.d.ts +3 -0
- package/dist/types/hooks/use-reduced-motion.d.ts +1 -0
- package/dist/types/hooks/use-scroll.d.ts +1 -0
- package/dist/types/hooks.d.ts +5 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/utils-5bcfdcec.js +2 -0
- package/dist/utils-5bcfdcec.js.map +1 -0
- package/package.json +23 -26
- package/tsconfig.json +23 -0
- package/dist/cjs/animatable-5f419fc7.js +0 -1
- package/dist/cjs/animation-2cdeea17.js +0 -1
- package/dist/cjs/animations.js +0 -1
- package/dist/cjs/auto.js +0 -1
- package/dist/cjs/events-3eb4d8ea.js +0 -1
- package/dist/cjs/hooks.js +0 -1
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/link-6ddefb82.js +0 -1
- package/dist/cjs/pop-00f8331d.js +0 -1
- package/dist/cjs/scroll-c6918c92.js +0 -1
- package/dist/esm/animatable-fda830d7.js +0 -1
- package/dist/esm/animation-2c86de42.js +0 -1
- package/dist/esm/animations.js +0 -1
- package/dist/esm/auto.js +0 -1
- package/dist/esm/events-66e26954.js +0 -1
- package/dist/esm/hooks.js +0 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/link-292004ea.js +0 -1
- package/dist/esm/pop-c392f121.js +0 -1
- package/dist/esm/scroll-3c98ff79.js +0 -1
- package/types/animatable.d.ts +0 -164
- package/types/animate.d.ts +0 -45
- package/types/animations/animation.d.ts +0 -15
- package/types/animations/fade.d.ts +0 -9
- package/types/animations/move.d.ts +0 -19
- package/types/animations/pop.d.ts +0 -9
- package/types/animations/scale.d.ts +0 -19
- package/types/animations/wipe.d.ts +0 -19
- package/types/animations.d.ts +0 -8
- package/types/auto/layout-group.d.ts +0 -16
- package/types/auto/morph.d.ts +0 -26
- package/types/auto/parallax.d.ts +0 -11
- package/types/auto.d.ts +0 -5
- package/types/core/link.d.ts +0 -12
- package/types/globals.d.ts +0 -90
- package/types/hooks/link.d.ts +0 -8
- package/types/hooks/path.d.ts +0 -9
- package/types/hooks/reduced-motions.d.ts +0 -4
- package/types/hooks/scroll.d.ts +0 -6
- package/types/hooks/unmount.d.ts +0 -10
- package/types/hooks.d.ts +0 -7
- package/types/index.d.ts +0 -4
package/dist/cjs/auto.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),t=require("@babel/runtime/helpers/classCallCheck"),r=require("@babel/runtime/helpers/createClass"),n=require("@babel/runtime/helpers/get"),i=require("@babel/runtime/helpers/inherits"),a=require("@babel/runtime/helpers/possibleConstructorReturn"),o=require("@babel/runtime/helpers/getPrototypeOf"),u=require("@babel/runtime/helpers/defineProperty"),l=require("./animatable-5f419fc7.js"),s=require("react"),c=require("./link-6ddefb82.js"),p=require("./animation-2cdeea17.js"),f=require("@babel/runtime/helpers/toConsumableArray"),d=require("./scroll-c6918c92.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("./events-3eb4d8ea.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/objectWithoutProperties");var y=h(e),m=h(t),v=h(r),b=h(n),g=h(i),O=h(a),P=h(o),j=h(u),w=h(s),E=h(f);function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){j.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function x(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return R(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return R(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=P.default(e);if(t){var i=P.default(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return O.default(this,r)}}var S={},C=function(e){g.default(r,e);var t=k(r);function r(e){var n;return m.default(this,r),(n=t.call(this,e)).animations={default:new p.Clip({},{opacity:+e.active,pointerEvents:e.active?"":"none"}),unmorph:new p.Clip({},{opacity:0,pointerEvents:"none"})},n.properties=c.subArray(n.props.include,n.props.exclude),n.uuid=(e.id||0).toString()+(e.index||0)+e.group,n}return v.default(r,[{key:"shouldComponentUpdate",value:function(e){if(this.props.active!==e.active){var t=[this,this.elements[0]];this.uuid in S?S[this.uuid].push(t):S[this.uuid]=[t]}return this.props.active!==e.active}},{key:"getSnapshotBeforeUpdate",value:function(e){if(this.props.active!==e.active&&this.props.active){var t,r=x(S[this.uuid]);try{for(r.s();!(t=r.n()).done;){var n=y.default(t.value,2),i=n[0],a=n[1];if(i!==this)return c.getSnapshot(a,this.props.group)}}catch(e){r.e(e)}finally{r.f()}}return null}},{key:"componentDidUpdate",value:function(e,t,n){if(b.default(P.default(r.prototype),"componentDidUpdate",this).call(this),S[this.uuid]=[],!n)return this.manager.clear(),void this.manager.initialize(this.animations.unmorph,!0);var i=c.getSnapshot(this.elements[0],this.props.group);i.opacity=1,i.pointerEvents="",this.manager.play(p.computeMorph(i,n,this.properties,this.props.duration),{composite:!0})}},{key:"render",value:function(){var e=this.props.children;if(c.isArr(e)){if(e.length>1)return e;e=e[0]}return s.isValidElement(e)?b.default(P.default(r.prototype),"render",this).call(this):e}}]),r}(l.Animatable);function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=P.default(e);if(t){var i=P.default(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return O.default(this,r)}}j.default(C,"cascadingProps",["id","duration"]),j.default(C,"defaultProps",q(q({},l.Animatable.defaultProps),{},{cascade:0,active:!1,include:c.MORPH_PROPERTIES,exclude:[]}));var M=function(e){g.default(r,e);var t=I(r);function r(e){var n;return m.default(this,r),(n=t.call(this,e)).children=[],n.properties=c.subArray(n.props.include,n.props.exclude),n}return v.default(r,[{key:"shouldComponentUpdate",value:function(){return this.snapshots=this.children.map((function(e){var t=null==e?void 0:e.elements[0];return t?{snapshot:c.getSnapshot(t),key:e.props.layoutKey}:{}})),!0}},{key:"componentDidUpdate",value:function(){for(var e=0,t=0;e<this.snapshots.length;e++,t++){var r=this.children[t];null!=r&&r.elements[0]&&(r.props.layoutKey===this.snapshots[e].key?r.manager.play(p.computeMorph(c.getSnapshot(r.elements[0]),this.snapshots[e].snapshot,this.properties,this.props.duration),{composite:!0}):t--)}}},{key:"render",value:function(){var e=this;return this.childIndex=0,s.Children.map(this.props.children,(function(t){if(!s.isValidElement(t)||!l.Animatable.isInstance(t))return t;var r=e.childIndex++;return s.cloneElement(t,{ref:function(t){return e.children[r]=t},layoutKey:t.key})}))}}]),r}(s.Component);function D(e){var t=e.children,r=e.className,n=e.style,i=e.duration;if(!c.isStr(t))return t;var a=t.split("");return w.default.createElement("div",{className:r,style:n},w.default.createElement(l.Animatable,{whileViewport:!0,animate:{opacity:1,translate:{y:0},rotate:0,duration:.8},initial:{opacity:0,translate:{y:"100%"},rotate:10},stagger:(i-.8)/(a.length-1)},a.map((function(e,t){return w.default.createElement("span",{style:{display:"inline-block"},key:t},/\s/.test(e)?" ":e)}))))}function U(e){var t,r=e.children,n=e.color,i=e.duration,a=(null===(t=r.props)||void 0===t?void 0:t.children)||[];Array.isArray(a)||(a=[a]);var o=[w.default.createElement(l.Animatable,{key:0,initial:{clip:{right:0}},animate:{clip:{left:1},duration:i/2}},w.default.createElement("div",{style:{position:"absolute",inset:0,backgroundColor:n}}))].concat(E.default(a));return w.default.createElement(l.Animatable,{whileViewport:!0,animate:{clip:{right:0},duration:i/2},initial:{clip:{right:1}}},s.cloneElement(r,{},o))}function B(e){var t,r=e.children,n=e.amount,i=d.useScroll(),a=s.useRef();return w.default.createElement(l.Animatable,{ref:a,animate:{translate:i((function(e){if(void 0===t){var r,i=null===(r=a.current)||void 0===r?void 0:r.elements[0];i&&(t=Math.max(i.getBoundingClientRect().y+window.scrollY-window.innerHeight/2,0))}return{x:0,y:(e-(t||0))*n}}))}},r)}j.default(M,"defaultProps",{include:c.MORPH_PROPERTIES,exclude:[]}),D.defaultProps={style:{},className:"",duration:1.6},U.defaultProps={color:"grey",duration:1.6},B.defaultProps={amount:.5},exports.ColorWipe=U,exports.LayoutGroup=M,exports.Morph=C,exports.Parallax=B,exports.WriteOn=D;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var n=require("./link-6ddefb82.js");function e(n,e){var t="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=function(n,e){if(!n)return;if("string"==typeof n)return r(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);"Object"===t&&n.constructor&&(t=n.constructor.name);if("Map"===t||"Set"===t)return Array.from(n);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return r(n,e)}(n))||e&&n&&"number"==typeof n.length){t&&(n=t);var o=0,i=function(){};return{s:i,n:function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}},e:function(n){throw n},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,f=!1;return{s:function(){t=t.call(n)},n:function(){var n=t.next();return u=n.done,n},e:function(n){f=!0,a=n},f:function(){try{u||null==t.return||t.return()}finally{if(f)throw a}}}}function r(n,e){(null==e||e>n.length)&&(e=n.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=n[r];return t}var t={};exports.addEventListener=function(e,r){e in t||(t[e]={unique:0},window.addEventListener(e,(function(r){for(var o=0,i=Object.values(t[e]);o<i.length;o++){var a=i[o];n.isFunc(a)&&a(r)}})));var o=t[e];r.LivelyID=o.unique,o[o.unique++]=r},exports.offAny=function(n,r,t){var o,i=e(n);try{for(i.s();!(o=i.n()).done;){var a,u=o.value,f=e(r);try{for(f.s();!(a=f.n()).done;){a.value.removeEventListener(u,t)}}catch(n){f.e(n)}finally{f.f()}}}catch(n){i.e(n)}finally{i.f()}},exports.onAny=function(n,r,t){var o,i=e(n);try{for(i.s();!(o=i.n()).done;){var a,u=o.value,f=e(r);try{for(f.s();!(a=f.n()).done;){a.value.addEventListener(u,t)}}catch(n){f.e(n)}finally{f.f()}}}catch(n){i.e(n)}finally{i.f()}},exports.removeEventListener=function(e,r){e in t&&!n.isNul(r)&&"LivelyID"in r&&delete t[e][r.LivelyID]};
|
package/dist/cjs/hooks.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),r=require("react"),t=require("./scroll-c6918c92.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("./events-3eb4d8ea.js"),require("./link-6ddefb82.js"),require("@babel/runtime/helpers/typeof"),require("@babel/runtime/helpers/defineProperty");var u=n(e);exports.useLink=t.useLink,exports.useScroll=t.useScroll,exports.usePath=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=r.useRef(),u=r.useCallback((function(r,u){if(!n.current)return{x:0,y:0};var i=n.current.getTotalLength()*r/u,o=n.current.getPointAtLength(i),s=o.x,c=o.y;return{x:e[0]+s*t,y:e[1]+c*t}}),[n]);return[u,n]},exports.useReducedMotion=function(){var e=r.useState(!1),t=u.default(e,2),n=t[0],i=t[1],o=function(e){return i(e.matches)};return r.useEffect((function(){var e=matchMedia("(prefers-reduced-motion: reduce)");return e.addEventListener("change",o),i(e.matches),function(){return e.removeEventListener("change",o)}}),[]),n},exports.useUnmount=function(e){var t=r.useState(e),n=u.default(t,2),i=n[0],o=n[1],s=r.useRef();return[i,function(){var e;if(!i)return o(!0);null===(e=s.current)||void 0===e||e.play(s.current.props.onUnmount,{reverse:!0,immediate:!0,callback:function(){return o(!1)}})},s]};
|
package/dist/cjs/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./animatable-5f419fc7.js"),r=require("@babel/runtime/helpers/extends"),t=require("@babel/runtime/helpers/objectWithoutProperties"),n=require("@babel/runtime/helpers/classCallCheck"),a=require("@babel/runtime/helpers/createClass"),i=require("@babel/runtime/helpers/inherits"),l=require("@babel/runtime/helpers/possibleConstructorReturn"),u=require("@babel/runtime/helpers/getPrototypeOf"),s=require("@babel/runtime/helpers/defineProperty"),o=require("react"),c=require("./pop-00f8331d.js"),f=require("./link-6ddefb82.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("./animation-2cdeea17.js"),require("@babel/runtime/helpers/slicedToArray"),require("./events-3eb4d8ea.js"),require("@babel/runtime/helpers/typeof");var b=p(r),m=p(t),h=p(n),d=p(a),v=p(i),y=p(l),q=p(u),A=p(s),j=p(o),k=["levels","animations"];function C(e){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=q.default(e);if(r){var a=q.default(this).constructor;t=Reflect.construct(n,arguments,a)}else t=n.apply(this,arguments);return y.default(this,t)}}var P=function(r){v.default(n,r);var t=C(n);function n(e){var r;return h.default(this,n),(r=t.call(this,e)).levels=r.props.levels,r.animations=f.padArray(r.props.animations,r.levels),r}return d.default(n,[{key:"makeAnimatable",value:function(r){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(n<1||o.Children.count(r)<1)return r;var a=this.props;a.levels,a.animations;var i=m.default(a,k),l=this.animations[this.levels-n];return n===this.levels&&(i.ref=function(e){return t.animatable=e}),j.default.createElement(e.Animatable,b.default({},i,{animate:l}),o.Children.map(r,(function(e){return o.isValidElement(e)?o.cloneElement(e,{},t.makeAnimatable(e.props.children,n-1)):e})))}},{key:"play",value:function(){var e;null===(e=this.animatable)||void 0===e||e.play.apply(e,arguments)}},{key:"render",value:function(){return this.makeAnimatable(this.props.children,this.levels)}}]),n}(o.Component);A.default(P,"defaultProps",{levels:1,animations:[c.Move,c.Pop]}),exports.Animatable=e.Animatable,exports.Animate=P;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var t=require("@babel/runtime/helpers/typeof"),n=require("@babel/runtime/helpers/slicedToArray"),r=require("@babel/runtime/helpers/defineProperty");function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=e(t),i=e(n),u=e(r),a=["%","px","em","rem","vw","vh","vmin","vmax","deg","rad"],f={rotate:"deg",skew:"deg",scale:"%",clip:"%",origin:"%",opacity:null,zIndex:null,lineHeight:null,fontWeight:null,length:null,default:"px"},c=[["x","y"],["r","g","b","a"],["left","top","right","bottom"]],l={translate:{x:[0,"px"],y:[0,"px"]},scale:{x:[1,"%"],y:[1,"%"]},clip:{left:[0,"%"],top:[0,"%"],right:[0,"%"],bottom:[0,"%"]},origin:{x:[.5,"%"],y:[.5,"%"]},r:[127,null],g:[127,null],b:[127,null],a:[255,null]},s=["translate","scale","rotate","opacity","borderRadius","backgroundColor","color","zIndex","pointerEvents"],p={translate:function(t,n){return t+n},rotate:function(t,n){return t+n},scale:function(t,n){return t*n},default:function(t,n){return(t+n)/2}},d=function(t){return t.parentElement.clientHeight},y={get:function(t,n){return parseFloat((y[n]||y.default)(t))},default:function(t){return t.parentElement.clientWidth},x:function(t){return t.clientWidth},y:function(t){return t.clientHeight},fontSize:function(t){return getComputeStyle(t.parentElement).fontSize},height:d,top:d,bottom:d},h={"%_px":function(t,n,r){return t*y.get(n,r)},em_px:function(t,n){return t*parseFloat(getComputedStyle(n).fontSize)},rem_px:function(t){return h.emtopx(t,document.body)},vw_px:function(t){return t*window.innerWidth},vh_px:function(t){return t*window.innerHeight},vmin_px:function(t){return t*Math.min(window.innerWidth,window.innerHeight)},vmax_px:function(t){return t*Math.max(window.innerWidth,window.innerHeight)},rad_deg:function(t){return 180*t/Math.PI}};function g(t,n){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,n){if(!t)return;if("string"==typeof t)return m(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(t,n)}(t))||n&&t&&"number"==typeof t.length){r&&(t=r);var e=0,o=function(){};return{s:o,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){a=!0,i=t},f:function(){try{u||null==r.return||r.return()}finally{if(a)throw i}}}}function m(t,n){(null==n||n>t.length)&&(n=t.length);for(var r=0,e=new Array(n);r<n;r++)e[r]=t[r];return e}var v=function(t,n){return Object.keys(t).some((function(t){return n.includes(t)}))},b=function(t){return null==t},x=function(t){return Array.isArray(t)},w=function(t){return!b(t)&&"object"===o.default(t)&&!x(t)},O=function(t){return t instanceof Function},S=function(t){return"string"==typeof t},j=function(t){return"number"==typeof t},A=function(t){return t.match(/^rgba?\(.*\)$/i)},P=function(t){return t.match(/^#[0-9a-f]{3,8}$/i)},I=function(t){var n=new DOMMatrix(t),r=Math.sqrt(n.a*n.a+n.b*n.b)*Math.sign(n.a),e=Math.sqrt(n.c*n.c+n.d*n.d)*Math.sign(n.d),o=180*Math.atan2(n.d,n.c)/Math.PI-90;return{translate:{x:n.e,y:n.f},scale:{x:r,y:e},rotate:o,skew:{x:0,y:0}}},E=function t(n,r,e){return w(n)?M(n,(function(n,o){return t(n,r[o],e)})):j(n[0])&&j(r[0])?[e(n[0],r[0]),n[1]]:r},M=function(t,n){var r={};for(var e in t)r[e]=n(t[e],e);return r};function k(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);n&&(e=e.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),r.push.apply(r,e)}return r}function C(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?k(Object(r),!0).forEach((function(n){u.default(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))}))}return t}function D(t,n){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,n){if(!t)return;if("string"==typeof t)return _(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _(t,n)}(t))||n&&t&&"number"==typeof t.length){r&&(t=r);var e=0,o=function(){};return{s:o,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){a=!0,i=t},f:function(){try{u||null==r.return||r.return()}finally{if(a)throw i}}}}function _(t,n){(null==n||n>t.length)&&(n=t.length);for(var r=0,e=new Array(n);r<n;r++)e[r]=t[r];return e}var H=function t(n,r){var e,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(b(n))return null;if("scale"!==r||o||w(n)||(n={x:n,y:n}),w(n)){var u,a=Object.keys(n),f=D(c);try{for(f.s();!(u=f.n()).done;){var s=u.value;if(v(n,s)){a=s;break}}}catch(t){f.e(t)}finally{f.f()}n=C({},n);var p,d=D(a);try{for(d.s();!(p=d.n()).done;){var y=p.value,h=r in l?l[r][y]:l[y];n[y]=y in n?t(n[y],r,!0):h}}catch(t){d.e(t)}finally{d.f()}return n}if(S(n)){if(P(n))return T(n);if(A(n))return F(n);var g=W(n),m=i.default(g,2);n=m[0],"%"==(e=m[1])&&(n/=100)}return[n,e=j(n)?q.normalize(e,r):null]},T=function(t){var n=t.match(/^#([\da-f]{1,2})([\da-f]{1,2})([\da-f]{1,2})([\da-f]{2})?/i),r=i.default(n,5);r[0];var e=r[1],o=r[2],u=r[3],a=r[4],f=function(t){return[b(t)?255:parseInt(t.padStart(2,t),16),null]};return{r:f(e),g:f(o),b:f(u),a:f(a)}},F=function(t){var n=t.match(/^rgba?\((\d+)\D+(\d+)\D+(\d+)\D*(\d+)?\)/i),r=i.default(n,5);r[0];var e=r[1],o=r[2],u=r[3],a=r[4],f=function(t){return[b(t)?255:parseInt(t),null]};return{r:f(e),g:f(o),b:f(u),a:f(a)}},R=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object.keys(t);return r.map((function(n){return z(t[n])})).join(n)},W=function(t){var n=t.toString().match(/^(-?[\d.]+)([^\d.]*)$/i);return n?[parseFloat(n[1]),n[2]||null]:[t,null]},z=function(t){return("%"==t[1]?100*t[0]:t[0])+(b(t[1])?"":t[1])},B=function(t,n){return"".concat(n,"(").concat(w(t)?R(t,", ",["x","y"]):z(t),")")},q={fromProperty:function(t){return t in f?f[t]:f.default},toBase:function(t,n,r,e){if(w(t))return M(t,(function(t,e){return q.toBase(t,n,r,e)}));if(!j(t[0]))return t;var o=q.fromProperty(n);if(b(t[1])&&!b(o))return[t[0],o];var i=h["".concat(t[1],"_").concat(o)];return i?[i(t[0],r,e||n),o]:t},normalize:function(t,n){return a.includes(t)?t:q.fromProperty(n)}},N={origin:"transformOrigin",length:"strokeDashoffset",clip:"clipPath",default:function(t){return z(t)},transformOrigin:function(t){return R(t," ",["x","y"])},strokeDashoffset:function(t){return 1-t[0]},clipPath:function(t){return"inset(".concat(R(t," ",["top","right","bottom","left"]),")")}},U={bind:function(t,n){t.origin=t.origin||t;var r=function(){for(var r,e=arguments.length,o=new Array(e),i=0;i<e;i++)o[i]=arguments[i];return(r=t.origin).call.apply(r,[n].concat(o))};return r.origin=t.origin,r},create:function(t){var n=U.bind((function(t){if(O(t)){var r=U.bind(n,{transform:t});return r.set=n.set,r.internal=n.internal,r}return this.transform(n.internal.value)}),{transform:function(t){return t}});return n.set=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;n.internal.value=t,n.internal.duration=r,n.internal.t=null},n.internal={value:t,duration:0},n},isInstance:function(t){return O(t)&&O(t.set)}},$=U;exports.Aliases=N,exports.DEFAULT_OBJECTS=l,exports.Link=$,exports.MERGE_FUNCTIONS=p,exports.MORPH_PROPERTIES=s,exports.POSITIONS=["set","start","end"],exports.Units=q,exports.calculateTransform=function(t,n,r){var e=I(getComputedStyle(t).transform);return r.reduce((function(t,r,o){var i=e[r];return i=0==i||"scale"!=r&&0==i.x&&0==i.y||"scale"==r&&1==i.x&&1==i.y?0:H(i,r),(i=n[o]||i)?t+B(i,r)+" ":t}),"")},exports.convert=H,exports.getProperty=function(t,n){var r=getComputedStyle(t),e=I(r.transform);if(n in e)return H(e[n],n);if("length"===n)return[1-parseFloat(r.strokeDashoffset),null];if("origin"===n){var o=r.transformOrigin.split(" ");return{x:W(o[0]),y:W(o[1])}}var i=r[n];return A(i)?F(i):W(i)},exports.getSnapshot=function(t){var n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=getComputedStyle(t),o=t.getBoundingClientRect(),i=o.x,u=o.y,a=o.width,f=o.height,c=(r?t.parentElement:document.body).getBoundingClientRect(),l={layout:{x:i=(i-c.x+a/2)/c.width,y:u=(u-c.y+f/2)/c.height,width:a,height:f,parentWidth:c.width,parentHeight:c.height}},p=g(s);try{for(p.s();!(n=p.n()).done;){var d=n.value;l[d]=e[d]}}catch(t){p.e(t)}finally{p.f()}return Object.assign(l,I(e.transform)),l},exports.hasSomeKey=v,exports.inViewport=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=t.y,e=t.bottom,o=e-r;return{left:r>window.innerHeight+o*n,entered:r+o*n<window.innerHeight}},exports.isArr=x,exports.isColor=function(t){return w(t)&&"r"in t},exports.isEmpty=function(t){return function(t,n){return Object.keys(t).length===n}(t,0)},exports.isFunc=O,exports.isNul=b,exports.isNum=j,exports.isObj=w,exports.isStr=S,exports.isVisible=function(t){var n=t.getBoundingClientRect(),r=n.x,e=n.y,o=n.right,i=n.bottom;return!(o-r<1||i-e<1)&&(e<window.innerHeight&&i>0&&r<window.innerWidth&&o>0)},exports.merge=E,exports.mergeObjects=function(t,n){var r,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object.keys(n),o=g(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;b(n[i])||(t[i]=n[i])}}catch(t){o.e(t)}finally{o.f()}return t},exports.mergeProperties=function(t,n){for(var r in n){var e=p[r]||p.default;t[r]=r in t?E(t[r],n[r],e):n[r]}},exports.padArray=function(t,n){return new Array(n).fill(0).map((function(n,r){return r<t.length?t[r]:t[t.length-1]}))},exports.subArray=function(t,n){return t.filter((function(t){return!n.includes(t)}))},exports.throttle=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250;return function(){var r=Date.now();r-t.LivelyTimestamp<n||(t.LivelyTimestamp=r,t())}},exports.xor=function(t,n){return t&&!n||!t&&n};
|
package/dist/cjs/pop-00f8331d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/objectWithoutProperties"),r=require("./animation-2cdeea17.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(e),c=n(t),i=["direction"];function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){o.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u=r.Animation.create((function(e){var t=e.direction,r=void 0===t?"up":t,n=c.default(e,i),o="0px",a="20px";switch(r){case"down":a="-20px";break;case"left":o="20px",a="0px";break;case"right":o="-20px",a="0px"}return[p({translate:{x:0,y:0},opacity:1,duration:.5},n),{translate:{x:o,y:a},opacity:0}]}));function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f=r.Animation.create((function(e){return[b({opacity:1,scale:1,duration:.25},e),{opacity:0,scale:.85}]}));exports.Move=u,exports.Pop=f;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@babel/runtime/helpers/slicedToArray"),r=require("react"),t=require("./events-3eb4d8ea.js"),n=require("./link-6ddefb82.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=u(e);function s(e){var t=r.useRef(n.Link.create(e));return[t.current,t.current.set]}exports.useLink=s,exports.useScroll=function(){var e=s(0),n=i.default(e,2),u=n[0],c=n[1];return r.useEffect((function(){var e=function(){return c(window.scrollY)};return e(),t.addEventListener("scroll",e),function(){return t.removeEventListener("scroll",e)}}),[]),u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/classCallCheck";import r from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/inherits";import i from"@babel/runtime/helpers/possibleConstructorReturn";import o from"@babel/runtime/helpers/getPrototypeOf";import a from"@babel/runtime/helpers/defineProperty";import s from"@babel/runtime/regenerator";import{Children as c,isValidElement as l,cloneElement as u,Component as h}from"react";import{A as p,C as f}from"./animation-2c86de42.js";import{g as y,D as m,m as v,i as d,a as g,A as b,b as w,c as k,M as O,d as j,e as A,t as x,f as P,h as S,j as D,k as E}from"./link-292004ea.js";import{a as M,o as I,r as L,b as R}from"./events-66e26954.js";function V(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return C(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return C(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var B=function(){function e(){t(this,e),this.t=Date.now(),this.managers=[],this.step()}return r(e,[{key:"step",value:function(){var e,t=Date.now(),r=V(this.managers);try{for(r.s();!(e=r.n()).done;){e.value.step((t-this.t)/1e3)}}catch(e){r.e(e)}finally{r.f()}this.t=t,requestAnimationFrame(this.step.bind(this))}},{key:"add",value:function(e){var t=Math.max(this.managers.findIndex((function(t){return t.priority>=e.priority})),0);this.managers.splice(t,0,e)}},{key:"remove",value:function(e){this.managers.splice(this.managers.indexOf(e),1)}}],[{key:"get",value:function(){return window.Lively||(window.Lively=new e),window.Lively}}]),e}();function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function q(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return z(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return z(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var T=function(){function e(r,n,i){t(this,e),this.element=r,this.tracks=[],this.queue=[],this.playing=!0,this.culling=n,this.layout=i,this.transforms=["translate","rotate","scale","skew"]}return r(e,[{key:"purge",value:function(){if(!("cache"in this.element)){this.element.cache={strokeDasharray:1,borderRadius:y(this.element,"borderRadius"),webkitBackfaceVisibility:"hidden"};for(var e=0;e<this.element.style.length;e++){var t=this.element.style[e];this.element.cache[t]=this.element.style[t]}}for(var r in this.element.style={},this.element.cache)this.element.style[r]=this.element.cache[r];this.channel=null}},{key:"clear",value:function(){this.tracks=[],this.queue=[]}},{key:"add",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.immediate,n=void 0!==r&&r,i=t.composite,o=void 0===i||i;n&&this.clear(),o||!this.tracks.length?this.tracks.push(e):this.queue.push(e)}},{key:"remove",value:function(e){this.tracks.splice(this.tracks.indexOf(e),1),!this.tracks.length&&this.queue.length&&this.tracks.push(this.queue.shift())}},{key:"step",value:function(e){if(this.playing){for(var t=this.element.correction?{scale:m.scale}:{},r=this.tracks.length+ +!this.channel.isEmpty,n=0;n<r;n++){var i=this.tracks[n]||this.channel;v(t,i.get(this.element,this.culling)),i.step(e)&&this.remove(i)}this.apply(this.element,t)}}},{key:"apply",value:function(e,t){if(!d(t)){var r=[];for(var n in t){var i=t[n];if("scale"==n){if(this.layout){var o,a={x:[1/i.x[0],"%"],y:[1/i.y[0],"%"]},s=q(e.children);try{for(s.s();!(o=s.n()).done;){o.value.correction=a}}catch(e){s.e(e)}finally{s.f()}var c=t.borderRadius||e.cache.borderRadius;delete t.borderRadius,e.style.borderRadius="".concat(c[0]/i.x[0]).concat(c[1]," / ").concat(c[0]/i.y[0]).concat(c[1])}e.correction&&(i=g(i,e.correction,O.scale))}var l=this.transforms.indexOf(n);l>=0?r[l]=i:(n=b[n]||n,w(i)?e.style[n]="rgba(".concat(i.r[0],", ").concat(i.g[0],", ").concat(i.b[0],", ").concat(i.a[0],")"):e.style[n]=(b[n]||b.default)(i))}(r=k(e,r,this.transforms)).length&&(e.style.transform=r)}}},{key:"initialize",value:function(e,t){this.channel&&!t||(this.apply(this.element,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?U(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e.initials)),this.channel=e.channel)}}]),e}();function $(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function H(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return N(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return N(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var X=function(){function e(r){var n=r.priority,i=void 0===n?0:n,o=r.stagger,a=void 0===o?.1:o,s=r.culling,c=void 0===s||s,l=r.noDeform,u=void 0!==l&&l,h=r.paused,p=void 0!==h&&h;t(this,e),this.targets=[],this.priority=i,this.stagger=a,this.culling=c,this.noDeform=u,this.paused=p}return r(e,[{key:"register",value:function(){B.get().add(this)}},{key:"destroy",value:function(){this.targets=[],B.get().remove(this)}},{key:"purge",value:function(){var e,t=H(this.targets);try{for(t.s();!(e=t.n()).done;){e.value.purge()}}catch(e){t.e(e)}finally{t.f()}}},{key:"clear",value:function(){var e,t=H(this.targets);try{for(t.s();!(e=t.n()).done;){e.value.clear()}}catch(e){t.e(e)}finally{t.f()}}},{key:"set",value:function(e){for(var t=0;t<e.length;t++)this.targets[t]?this.targets[t].element=e[t]:this.targets[t]=new T(e[t],this.culling,this.noDeform);this.targets.length=e.length}},{key:"play",value:function(e,t){if(!e.isEmpty)for(var r=0;r<this.targets.length;r++){var n=F(F({},t),{},{delay:(t.delay||0)+r*this.stagger});r<this.targets.length-1&&(n.callback=null),this.targets[r].add(e.play(n),t)}}},{key:"initialize",value:function(e,t){var r,n=H(this.targets);try{for(n.s();!(r=n.n()).done;){r.value.initialize(e,t)}}catch(e){n.e(e)}finally{n.f()}}},{key:"step",value:function(e){if(!this.paused){var t,r=H(this.targets);try{for(r.s();!(t=r.n()).done;){t.value.step(e)}}catch(e){r.e(e)}finally{r.f()}}}}]),e}();function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function G(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function W(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return J(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return J(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function K(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=o(e);if(t){var a=o(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return i(this,r)}}var Q=function(i){n(y,h);var o,a=K(y);function y(e){var r;for(var n in t(this,y),(r=a.call(this,e)).animations={default:r.parse(r.props.animate||{})},r.props.animations||{})r.animations[n]=r.parse(r.props.animations[n]);return r.mounted=new Promise((function(e){return r.mount=e})),r.children=[],r.elements=[],r.stagger=j(r.props.stagger)?.1:r.props.stagger,r.cascade=j(r.props.cascade)?1:r.props.cascade,r.manager=new X({priority:r.props.group,stagger:r.stagger,culling:r.props.lazy,noDeform:r.props.noDeform,paused:r.props.paused}),r}return r(y,[{key:"parse",value:function(e){return p.isInstance(e)?e.use():A(e)?new f(e,this.props.initial):null}},{key:"update",value:(o=e(s.mark((function e(){var t,r,n,i,o=arguments;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=!(o.length>0&&void 0!==o[0])||o[0],this.manager.set(this.elements),t&&(this.manager.clear(),this.manager.purge()),this.manager.initialize(this.animations.default),t){e.next=25;break}r=W(this.children),e.prev=6,r.s();case 8:if((n=r.n()).done){e.next=17;break}if((i=n.value).rendered){e.next=15;break}return e.next=13,i.mounted;case 13:i.play(i.props.onMount,void 0,!0),i.onScroll();case 15:e.next=8;break;case 17:e.next=22;break;case 19:e.prev=19,e.t0=e.catch(6),r.e(e.t0);case 22:return e.prev=22,r.f(),e.finish(22);case 25:case"end":return e.stop()}}),e,this,[[6,19,22,25]])}))),function(){return o.apply(this,arguments)})},{key:"componentDidMount",value:function(){var e=this;this.scrollEventListener=x(this.onScroll.bind(this)),M("scroll",this.scrollEventListener),this.eventListener=this.onEvent.bind(this),I(y.events,this.elements,this.eventListener),this.update(),this.manager.register(),this.rendered=0,document.fonts.ready.then((function(){e.update(),e.inViewport=!1,e.mount(),e.props.group||(e.play(e.props.onMount),e.onScroll())}))}},{key:"componentWillUnmount",value:function(){L("scroll",this.scrollEventListener),R(y.events,this.elements,this.eventListener),this.manager.destroy()}},{key:"componentDidUpdate",value:function(){this.manager.paused=this.props.paused,this.update(!1)}},{key:"dispatch",value:function(e){P(this.props[e])&&this.props[e]()}},{key:"onEvent",value:function(e){switch(e.type){case"click":this.play(this.props.onClick);break;case"mouseenter":this.hover||(this.hover=!0,this.play(this.props.whileHover));break;case"mouseleave":this.hover&&(this.hover=!1,this.play(this.props.whileHover,{reverse:!0}));break;case"focus":this.focus||(this.focus=!0,this.play(this.props.whileFocus));break;case"blur":this.focus&&(this.focus=!1,this.play(this.props.whileFocus,{reverse:!0}))}}},{key:"getBoundingBox",value:function(){var e,t={x:Number.MAX_VALUE,y:Number.MAX_VALUE,right:0,bottom:0},r=W(this.elements.length?this.elements:this.children);try{for(r.s();!(e=r.n()).done;){var n=e.value,i=this.elements.length?n.getBoundingClientRect():n.getBoundingBox();t.y=Math.min(i.y,t.y),t.x=Math.min(i.x,t.x),t.right=Math.max(i.right,t.right),t.bottom=Math.max(i.bottom,t.bottom)}}catch(e){r.e(e)}finally{r.f()}return t}},{key:"onScroll",value:function(){if(this.props.whileViewport){var e=S(this.getBoundingBox(),this.props.viewportMargin),t=e.entered,r=e.left;t&&!this.inViewport&&(this.inViewport=!0,this.play(this.props.whileViewport),this.dispatch("onEnterViewport")),r&&this.inViewport&&(this.inViewport=!1,this.play(this.props.whileViewport,{reverse:!0,immediate:!0}),this.dispatch("onLeaveViewport"))}}},{key:"play",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.reverse,i=void 0!==n&&n,o=r.composite,a=void 0!==o&&o,s=r.immediate,c=void 0!==s&&s,l=r.delay,u=void 0===l?0:l,h=r.callback,p=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e||this.props.disabled||this.props.group>0&&!p)return 0;D(e)||(e="default"),this.dispatch("onAnimationStart");var f=this.animations[e],y=f.length()*this.cascade,m=h;p||(h=function(){t.dispatch("onAnimationEnd"),P(m)&&m()});for(var v=0,d=0;d<this.children.length;d++)v=Math.max(v,this.children[d].play(e,{reverse:i,immediate:c,delay:u+y+this.stagger*d,callback:h},!0));return i&&!this.props.group||!i&&!this.children.length||(h=null),this.manager.play(f,{reverse:i,composite:a,immediate:c,delay:i?v:u,callback:h}),y+(i?v:u)}},{key:"stop",value:function(){this.manager.clear()}},{key:"prerender",value:function(e){var t=this,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return c.map(e,(function(e){if(!l(e))return e;var i={pathLength:1},o=y.isInstance(e)&&n&&!e.props.stopPropagation;if(o)i.index=t.children.length++,i.group=t.props.group+1,i.ref=function(e){e&&(t.children[i.index]=e)},i.paused=t.props.paused,t.props.group||(i.active=t.props.active),E(i,G(G({},t.props),e.props),t.constructor.cascadingProps);else if(r){var a=t.elements.length++;i.ref=function(e){e&&(t.elements[a]=e)}}return u(e,i,t.prerender(e.props.children,!1,!o))}))}},{key:"render",value:function(){return this.rendered++,this.elements.length=this.children.length=0,this.prerender(this.props.children)}}],[{key:"isInstance",value:function(e){return e.type===y||e.type.prototype instanceof y}}]),y}();a(Q,"events",["click","mouseenter","mouseleave","focus","blur"]),a(Q,"cascadingProps",["animate","initial","animations","stagger","cascade"]),a(Q,"defaultProps",{group:0,viewportMargin:.75,lazy:!0,paused:!1});export{Q as A};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/objectWithoutProperties";import n from"@babel/runtime/helpers/classCallCheck";import i from"@babel/runtime/helpers/createClass";import a from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import s from"@babel/runtime/helpers/getPrototypeOf";import{e as u,l,d as c,g as f,U as h,f as p,n as v,o as y,x as d,q as m,k as b,i as g,L as w,r as O,P as j}from"./link-292004ea.js";function k(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return P(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return P(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var A=function t(e,r,n,i){if(u(e)){var a={};for(var o in e)a[o]=t(e[o],r[o],n,i);return a}return[i(e[0],r[0],n),e[1]]},I=function(t,e,r){return l(t)&&l(e)?t*(1-r)+e*r:r>.5?e:t},x={constant:function(t){return t},linear:I,ease:function(t,e,r){return I(t,e,(1-Math.cos(r*Math.PI))/2)},spring:function(t,e,r){return r=1-1*Math.exp(-3.6*r)*Math.cos(2.5*Math.pow(r,2)*Math.PI),I(t,e,r)}},S=function(t,e,r){var n,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a={duration:i},o={},s=k(r);try{for(s.s();!(n=s.n()).done;){var u=n.value;"scale"==u?(a.scale={x:1,y:1},o.scale={x:1+(e.layout.width-t.layout.width)/t.layout.width,y:1+(e.layout.height-t.layout.height)/t.layout.height}):"translate"==u?(a.translate={x:0,y:0},o.translate={x:(e.layout.x-t.layout.x)*t.layout.parentWidth,y:(e.layout.y-t.layout.y)*t.layout.parentHeight}):(a[u]=t[u],o[u]=e[u])}}catch(t){s.e(t)}finally{s.f()}return new D(a,o)},z=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.reverse,a=void 0!==i&&i,o=r.repeat,s=void 0===o?1:o,u=r.delay,l=void 0===u?0:u,c=r.alternate,f=void 0!==c&&c,h=r.callback;n(this,t),this.indices={},this.clip=e,this.t=0,this.T=e.duration*s+l,this.reverse=a,this.delay=l,this.alternate=f,this.callback=h}return i(t,[{key:"normalize",value:function(t,e,r){return c(t)&&(t=f(r,e)),h.toBase(t,e,r)}},{key:"getInterpolatedValue",value:function(t,e,r,n,i){if(p(e))return h.toBase(v(e(r,this.clip.duration),t),t,n);var a,o=this.reverse?-1:1,s=this.indices[t],u=e[s+o],l=c(s);if((l||(this.reverse?e[s].time<r:e[s].time>r))&&(this.indices[t]=s=this.reverse?e.length-1:0,a=l?this.reverse?e[s].end:e[s].start:this.reverse?u.start:u.end),u=e[s+o],(this.reverse?u.time>r:u.time<r)&&(a=this.reverse?u.end||e[s].start:u.start||e[s].end,this.indices[t]=s+=o,u=e[s+o]),i&&(a=this.reverse?u.start:u.end),a)return this.normalize(a,t,n);var f=this.normalize(e[s].set,t,n),y=this.normalize(u.set,t,n),d=x[u.interpolate||this.clip.interpolate]||x.ease;return A(f,y,(r-e[s].time)/(u.time-e[s].time),d)}},{key:"get",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r={},n=this.t>=this.T,i=this.t-this.delay,a=this.clip.duration;if(i<0||e&&!n&&!y(t))return r;var o=this.alternate&&Math.floor(i/a)%2==+!n;for(var s in i=n?a:i%a,i=d(this.reverse,o)?a-i:i,this.clip.properties)r[s]=this.getInterpolatedValue(s,this.clip.properties[s],i,t,n);return r}},{key:"step",value:function(t){var e=this.t>=this.T;return this.t+=t,e&&p(this.callback)&&this.callback(),e}}]),t}();function M(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=s(t);if(e){var i=s(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var E=function(t){a(r,z);var e=M(r);function r(t){var i;return n(this,r),(i=e.call(this,{duration:1/0,properties:{},interpolate:t})).isEmpty=!0,i.cache={},i}return i(r,[{key:"add",value:function(t,e){this.clip.properties[t]=e,this.isEmpty=!1}},{key:"getInterpolatedValue",value:function(t,e,r,n){c(e.internal.t)&&(e.internal.t=r),e.internal.t===r&&(this.cache[t]={});var i=e.internal.duration?Math.min((r-e.internal.t)/e.internal.duration,1):1,a=this.cache[t]||{};if(a.t===i)return a.value;var o=h.toBase(v(e(),t),t,n),s=a.from;if(1!=i){s||(s=h.toBase(f(n,t),t,n));var u=x[this.clip.interpolate]||x.linear;o=A(s,o,i,u)}return this.cache[t]={value:o,from:1!=i?s:null,t:i},o}}]),r}(),C=["duration","delay","repeat","alternate","interpolate"];function B(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return R(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return R(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function R(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function T(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function q(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?T(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var D=function(){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=i.duration,o=void 0===a?1:a,s=i.delay,u=i.repeat,l=i.alternate,c=i.interpolate,f=r(i,C),h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(this,e),this.duration=o,this.channel=new E(c);var p=this.parse(f,h),v=t(p,2);this.properties=v[0],this.initials=v[1],this.isEmpty=g(this.properties),this.interpolate=c,this.defaults={delay:s,repeat:u,alternate:l}}return i(e,[{key:"length",value:function(){return this.isEmpty?0:this.duration*(this.defaults.repeat||1)+(this.defaults.delay||0)}},{key:"parse",value:function(t,e){var r=this,n=function(n){var i=t[n];if(w.isInstance(i))return r.channel.add(n,i),delete t[n],"continue";if(p(i))return"continue";(i=O(i)?i:[i]).length<2?i.unshift(n in e?e[n]:null):c(i[0])||(e[n]=i[0]);for(var a=i.map((function(t){return r.sanitize(t,n)})),o=0;o<a.length;o++)r.quantize(a,o);t[n]=a};for(var i in t)n(i);for(var a in e=q({},e)){var o=this.sanitize(e[a],a);e[a]=o.start||o.set}return[t,e]}},{key:"sanitize",value:function(t,e){t=u(t)?q({},t):{set:t},m(t,j)||(t={set:t}),"set"in t||(t.set=t.start||t.end),"time"in t&&t.time>this.duration&&delete t.time;var r,n=B(j);try{for(n.s();!(r=n.n()).done;){var i=r.value;i in t&&(t[i]=v(t[i],e))}}catch(t){n.e(t)}finally{n.f()}return t}},{key:"quantize",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e-1;if("time"in t[e])return t[e].time;if(0==e||e==t.length-1)return t[e].time=0==e?0:this.duration;var n=this.quantize(t,r,r);return t[e].time=n+(this.quantize(t,e+1,r)-n)*((e-r)/(e-r+1))}},{key:"play",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new z(this,b(t,this.defaults))}}]),e}(),U={create:function(e){var r=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.use=t.use.bind(t,e),t};return r.use=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e(r),i=t(n,2),a=i[0],o=i[1];return new D(a,o)},r},isInstance:function(t){return p(t)&&p(t.use)}};export{U as A,D as C,S as c};
|
package/dist/esm/animations.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e}from"./animation-2c86de42.js";export{A as Animation}from"./animation-2c86de42.js";import r from"@babel/runtime/helpers/defineProperty";export{M as Move,P as Pop}from"./pop-c392f121.js";import t from"@babel/runtime/helpers/objectWithoutProperties";import"@babel/runtime/helpers/slicedToArray";import"@babel/runtime/helpers/classCallCheck";import"@babel/runtime/helpers/createClass";import"@babel/runtime/helpers/inherits";import"@babel/runtime/helpers/possibleConstructorReturn";import"@babel/runtime/helpers/getPrototypeOf";import"./link-292004ea.js";import"@babel/runtime/helpers/typeof";function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var i=e.create((function(e){return[n({opacity:1,duration:.65},e),{opacity:0}]})),c=["direction"];function p(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function a(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?p(Object(o),!0).forEach((function(t){r(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):p(Object(o)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))}))}return e}var s=e.create((function(e){var r=e.direction,o=void 0===r?"right":r,n=t(e,c),i=0,p=1,s={x:0,y:.5};switch(o){case"left":s.x=1;break;case"up":i=1,p=0,s={x:0,y:1};break;case"down":i=1,p=0,s={x:0,y:0}}return[a({scale:{x:1},duration:.6},n),{scale:{x:i,y:p},origin:s}]})),b=["direction"];function l(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function u(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?l(Object(o),!0).forEach((function(t){r(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):l(Object(o)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))}))}return e}var O=e.create((function(e){var o=e.direction,n=void 0===o?"right":o,i=t(e,b);return["left","right","top","bottom"].includes(n)||(n="right"),[u({clip:r({},n,0)},i),{clip:r({},n,1)}]}));export{i as Fade,s as Scale,O as Wipe};
|
package/dist/esm/auto.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/helpers/classCallCheck";import r from"@babel/runtime/helpers/createClass";import n from"@babel/runtime/helpers/get";import i from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import a from"@babel/runtime/helpers/getPrototypeOf";import s from"@babel/runtime/helpers/defineProperty";import{A as u}from"./animatable-fda830d7.js";import l,{isValidElement as c,Children as p,cloneElement as f,Component as h,useRef as m}from"react";import{s as d,u as y,r as v,v as b,j as g}from"./link-292004ea.js";import{C as O,c as j}from"./animation-2c86de42.js";import w from"@babel/runtime/helpers/toConsumableArray";import{a as P}from"./scroll-3c98ff79.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"./events-66e26954.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/objectWithoutProperties";function k(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function x(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?k(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function E(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return R(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return R(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function R(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function A(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=a(t);if(e){var i=a(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var C={},S=function(o){i(l,u);var s=A(l);function l(t){var r;return e(this,l),(r=s.call(this,t)).animations={default:new O({},{opacity:+t.active,pointerEvents:t.active?"":"none"}),unmorph:new O({},{opacity:0,pointerEvents:"none"})},r.properties=d(r.props.include,r.props.exclude),r.uuid=(t.id||0).toString()+(t.index||0)+t.group,r}return r(l,[{key:"shouldComponentUpdate",value:function(t){if(this.props.active!==t.active){var e=[this,this.elements[0]];this.uuid in C?C[this.uuid].push(e):C[this.uuid]=[e]}return this.props.active!==t.active}},{key:"getSnapshotBeforeUpdate",value:function(e){if(this.props.active!==e.active&&this.props.active){var r,n=E(C[this.uuid]);try{for(n.s();!(r=n.n()).done;){var i=t(r.value,2),o=i[0],a=i[1];if(o!==this)return y(a,this.props.group)}}catch(t){n.e(t)}finally{n.f()}}return null}},{key:"componentDidUpdate",value:function(t,e,r){if(n(a(l.prototype),"componentDidUpdate",this).call(this),C[this.uuid]=[],!r)return this.manager.clear(),void this.manager.initialize(this.animations.unmorph,!0);var i=y(this.elements[0],this.props.group);i.opacity=1,i.pointerEvents="",this.manager.play(j(i,r,this.properties,this.props.duration),{composite:!0})}},{key:"render",value:function(){var t=this.props.children;if(v(t)){if(t.length>1)return t;t=t[0]}return c(t)?n(a(l.prototype),"render",this).call(this):t}}]),l}();function D(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=a(t);if(e){var i=a(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}s(S,"cascadingProps",["id","duration"]),s(S,"defaultProps",x(x({},u.defaultProps),{},{cascade:0,active:!1,include:b,exclude:[]}));var U=function(t){i(o,h);var n=D(o);function o(t){var r;return e(this,o),(r=n.call(this,t)).children=[],r.properties=d(r.props.include,r.props.exclude),r}return r(o,[{key:"shouldComponentUpdate",value:function(){return this.snapshots=this.children.map((function(t){var e=null==t?void 0:t.elements[0];return e?{snapshot:y(e),key:t.props.layoutKey}:{}})),!0}},{key:"componentDidUpdate",value:function(){for(var t=0,e=0;t<this.snapshots.length;t++,e++){var r=this.children[e];null!=r&&r.elements[0]&&(r.props.layoutKey===this.snapshots[t].key?r.manager.play(j(y(r.elements[0]),this.snapshots[t].snapshot,this.properties,this.props.duration),{composite:!0}):e--)}}},{key:"render",value:function(){var t=this;return this.childIndex=0,p.map(this.props.children,(function(e){if(!c(e)||!u.isInstance(e))return e;var r=t.childIndex++;return f(e,{ref:function(e){return t.children[r]=e},layoutKey:e.key})}))}}]),o}();function B(t){var e=t.children,r=t.className,n=t.style,i=t.duration;if(!g(e))return e;var o=e.split("");return l.createElement("div",{className:r,style:n},l.createElement(u,{whileViewport:!0,animate:{opacity:1,translate:{y:0},rotate:0,duration:.8},initial:{opacity:0,translate:{y:"100%"},rotate:10},stagger:(i-.8)/(o.length-1)},o.map((function(t,e){return l.createElement("span",{style:{display:"inline-block"},key:e},/\s/.test(t)?" ":t)}))))}function I(t){var e,r=t.children,n=t.color,i=t.duration,o=(null===(e=r.props)||void 0===e?void 0:e.children)||[];Array.isArray(o)||(o=[o]);var a=[l.createElement(u,{key:0,initial:{clip:{right:0}},animate:{clip:{left:1},duration:i/2}},l.createElement("div",{style:{position:"absolute",inset:0,backgroundColor:n}}))].concat(w(o));return l.createElement(u,{whileViewport:!0,animate:{clip:{right:0},duration:i/2},initial:{clip:{right:1}}},f(r,{},a))}function K(t){var e,r=t.children,n=t.amount,i=P(),o=m();return l.createElement(u,{ref:o,animate:{translate:i((function(t){if(void 0===e){var r,i=null===(r=o.current)||void 0===r?void 0:r.elements[0];i&&(e=Math.max(i.getBoundingClientRect().y+window.scrollY-window.innerHeight/2,0))}return{x:0,y:(t-(e||0))*n}}))}},r)}s(U,"defaultProps",{include:b,exclude:[]}),B.defaultProps={style:{},className:"",duration:1.6},I.defaultProps={color:"grey",duration:1.6},K.defaultProps={amount:.5};export{I as ColorWipe,U as LayoutGroup,S as Morph,K as Parallax,B as WriteOn};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as n,d as r}from"./link-292004ea.js";function e(n,r){var e="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=function(n,r){if(!n)return;if("string"==typeof n)return t(n,r);var e=Object.prototype.toString.call(n).slice(8,-1);"Object"===e&&n.constructor&&(e=n.constructor.name);if("Map"===e||"Set"===e)return Array.from(n);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return t(n,r)}(n))||r&&n&&"number"==typeof n.length){e&&(n=e);var a=0,o=function(){};return{s:o,n:function(){return a>=n.length?{done:!0}:{done:!1,value:n[a++]}},e:function(n){throw n},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,f=!0,u=!1;return{s:function(){e=e.call(n)},n:function(){var n=e.next();return f=n.done,n},e:function(n){u=!0,i=n},f:function(){try{f||null==e.return||e.return()}finally{if(u)throw i}}}}function t(n,r){(null==r||r>n.length)&&(r=n.length);for(var e=0,t=new Array(r);e<r;e++)t[e]=n[e];return t}var a={},o=function(r,e){r in a||(a[r]={unique:0},window.addEventListener(r,(function(e){for(var t=0,o=Object.values(a[r]);t<o.length;t++){var i=o[t];n(i)&&i(e)}})));var t=a[r];e.LivelyID=t.unique,t[t.unique++]=e},i=function(n,e){n in a&&!r(e)&&"LivelyID"in e&&delete a[n][e.LivelyID]},f=function(n,r,t){var a,o=e(n);try{for(o.s();!(a=o.n()).done;){var i,f=a.value,u=e(r);try{for(u.s();!(i=u.n()).done;){i.value.addEventListener(f,t)}}catch(n){u.e(n)}finally{u.f()}}}catch(n){o.e(n)}finally{o.f()}},u=function(n,r,t){var a,o=e(n);try{for(o.s();!(a=o.n()).done;){var i,f=a.value,u=e(r);try{for(u.s();!(i=u.n()).done;){i.value.removeEventListener(f,t)}}catch(n){u.e(n)}finally{u.f()}}}catch(n){o.e(n)}finally{o.f()}};export{o as a,u as b,f as o,i as r};
|
package/dist/esm/hooks.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/slicedToArray";import{useState as r,useRef as t,useCallback as n,useEffect as o}from"react";export{u as useLink,a as useScroll}from"./scroll-3c98ff79.js";import"./events-66e26954.js";import"./link-292004ea.js";import"@babel/runtime/helpers/typeof";import"@babel/runtime/helpers/defineProperty";function i(n){var o=r(n),i=e(o,2),u=i[0],c=i[1],a=t();return[u,function(){var e;if(!u)return c(!0);null===(e=a.current)||void 0===e||e.play(a.current.props.onUnmount,{reverse:!0,immediate:!0,callback:function(){return c(!1)}})},a]}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=t(),i=n((function(t,n){if(!o.current)return{x:0,y:0};var i=o.current.getTotalLength()*t/n,u=o.current.getPointAtLength(i),c=u.x,a=u.y;return{x:e[0]+c*r,y:e[1]+a*r}}),[o]);return[i,o]}function l(){var t=r(!1),n=e(t,2),i=n[0],u=n[1],c=function(e){return u(e.matches)};return o((function(){var e=matchMedia("(prefers-reduced-motion: reduce)");return e.addEventListener("change",c),u(e.matches),function(){return e.removeEventListener("change",c)}}),[]),i}export{c as usePath,l as useReducedMotion,i as useUnmount};
|
package/dist/esm/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e}from"./animatable-fda830d7.js";export{A as Animatable}from"./animatable-fda830d7.js";import r from"@babel/runtime/helpers/extends";import t from"@babel/runtime/helpers/objectWithoutProperties";import n from"@babel/runtime/helpers/classCallCheck";import i from"@babel/runtime/helpers/createClass";import a from"@babel/runtime/helpers/inherits";import o from"@babel/runtime/helpers/possibleConstructorReturn";import l from"@babel/runtime/helpers/getPrototypeOf";import s from"@babel/runtime/helpers/defineProperty";import m,{Children as p,isValidElement as u,cloneElement as f,Component as c}from"react";import{M as b,P as h}from"./pop-c392f121.js";import{p as v}from"./link-292004ea.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"./animation-2c86de42.js";import"@babel/runtime/helpers/slicedToArray";import"./events-66e26954.js";import"@babel/runtime/helpers/typeof";var y=["levels","animations"];function d(e){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=l(e);if(r){var i=l(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return o(this,t)}}var k=function(o){a(s,c);var l=d(s);function s(e){var r;return n(this,s),(r=l.call(this,e)).levels=r.props.levels,r.animations=v(r.props.animations,r.levels),r}return i(s,[{key:"makeAnimatable",value:function(n){var i=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(a<1||p.count(n)<1)return n;var o=this.props;o.levels,o.animations;var l=t(o,y),s=this.animations[this.levels-a];return a===this.levels&&(l.ref=function(e){return i.animatable=e}),m.createElement(e,r({},l,{animate:s}),p.map(n,(function(e){return u(e)?f(e,{},i.makeAnimatable(e.props.children,a-1)):e})))}},{key:"play",value:function(){var e;null===(e=this.animatable)||void 0===e||e.play.apply(e,arguments)}},{key:"render",value:function(){return this.makeAnimatable(this.props.children,this.levels)}}]),s}();s(k,"defaultProps",{levels:1,animations:[b,h]});export{k as Animate};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import n from"@babel/runtime/helpers/typeof";import t from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/helpers/defineProperty";var e=["set","start","end"],i=["%","px","em","rem","vw","vh","vmin","vmax","deg","rad"],o={rotate:"deg",skew:"deg",scale:"%",clip:"%",origin:"%",opacity:null,zIndex:null,lineHeight:null,fontWeight:null,length:null,default:"px"},a=[["x","y"],["r","g","b","a"],["left","top","right","bottom"]],u={translate:{x:[0,"px"],y:[0,"px"]},scale:{x:[1,"%"],y:[1,"%"]},clip:{left:[0,"%"],top:[0,"%"],right:[0,"%"],bottom:[0,"%"]},origin:{x:[.5,"%"],y:[.5,"%"]},r:[127,null],g:[127,null],b:[127,null],a:[255,null]},f=["translate","scale","rotate","opacity","borderRadius","backgroundColor","color","zIndex","pointerEvents"],c={translate:function(n,t){return n+t},rotate:function(n,t){return n+t},scale:function(n,t){return n*t},default:function(n,t){return(n+t)/2}},l=function(n){return n.parentElement.clientHeight},s={get:function(n,t){return parseFloat((s[t]||s.default)(n))},default:function(n){return n.parentElement.clientWidth},x:function(n){return n.clientWidth},y:function(n){return n.clientHeight},fontSize:function(n){return getComputeStyle(n.parentElement).fontSize},height:l,top:l,bottom:l},d={"%_px":function(n,t,r){return n*s.get(t,r)},em_px:function(n,t){return n*parseFloat(getComputedStyle(t).fontSize)},rem_px:function(n){return d.emtopx(n,document.body)},vw_px:function(n){return n*window.innerWidth},vh_px:function(n){return n*window.innerHeight},vmin_px:function(n){return n*Math.min(window.innerWidth,window.innerHeight)},vmax_px:function(n){return n*Math.max(window.innerWidth,window.innerHeight)},rad_deg:function(n){return 180*n/Math.PI}};function h(n,t){var r="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!r){if(Array.isArray(n)||(r=function(n,t){if(!n)return;if("string"==typeof n)return y(n,t);var r=Object.prototype.toString.call(n).slice(8,-1);"Object"===r&&n.constructor&&(r=n.constructor.name);if("Map"===r||"Set"===r)return Array.from(n);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return y(n,t)}(n))||t&&n&&"number"==typeof n.length){r&&(n=r);var e=0,i=function(){};return{s:i,n:function(){return e>=n.length?{done:!0}:{done:!1,value:n[e++]}},e:function(n){throw n},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){r=r.call(n)},n:function(){var n=r.next();return a=n.done,n},e:function(n){u=!0,o=n},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw o}}}}function y(n,t){(null==t||t>n.length)&&(t=n.length);for(var r=0,e=new Array(t);r<t;r++)e[r]=n[r];return e}var g=function(n,t){return n&&!t||!n&&t},p=function(n,t){return new Array(t).fill(0).map((function(t,r){return r<n.length?n[r]:n[n.length-1]}))},m=function(n,t){return n.filter((function(n){return!t.includes(n)}))},v=function(n,t){return Object.keys(n).some((function(n){return t.includes(n)}))},b=function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=n.y,e=n.bottom,i=e-r;return{left:r>window.innerHeight+i*t,entered:r+i*t<window.innerHeight}},w=function(n){var t=n.getBoundingClientRect(),r=t.x,e=t.y,i=t.right,o=t.bottom;return!(i-r<1||o-e<1)&&(e<window.innerHeight&&o>0&&r<window.innerWidth&&i>0)},x=function(n){return null==n},O=function(n){return Array.isArray(n)},j=function(t){return!x(t)&&"object"===n(t)&&!O(t)},S=function(n){return n instanceof Function},A=function(n){return"string"==typeof n},P=function(n){return"number"==typeof n},k=function(n){return function(n,t){return Object.keys(n).length===t}(n,0)},M=function(n){return n.match(/^rgba?\(.*\)$/i)},D=function(n){return n.match(/^#[0-9a-f]{3,8}$/i)},I=function(n){return j(n)&&"r"in n},C=function(n){var t=new DOMMatrix(n),r=Math.sqrt(t.a*t.a+t.b*t.b)*Math.sign(t.a),e=Math.sqrt(t.c*t.c+t.d*t.d)*Math.sign(t.d),i=180*Math.atan2(t.d,t.c)/Math.PI-90;return{translate:{x:t.e,y:t.f},scale:{x:r,y:e},rotate:i,skew:{x:0,y:0}}},H=function(n,t,r){var e=C(getComputedStyle(n).transform);return r.reduce((function(n,r,i){var o=e[r];return o=0==o||"scale"!=r&&0==o.x&&0==o.y||"scale"==r&&1==o.x&&1==o.y?0:U(o,r),(o=t[i]||o)?n+V(o,r)+" ":n}),"")},E=function(n,t){var r=getComputedStyle(n),e=C(r.transform);if(t in e)return U(e[t],t);if("length"===t)return[1-parseFloat(r.strokeDashoffset),null];if("origin"===t){var i=r.transformOrigin.split(" ");return{x:N(i[0]),y:N(i[1])}}var o=r[t];return M(o)?J(o):N(o)},_=function(n){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=getComputedStyle(n),i=n.getBoundingClientRect(),o=i.x,a=i.y,u=i.width,c=i.height,l=(r?n.parentElement:document.body).getBoundingClientRect(),s={layout:{x:o=(o-l.x+u/2)/l.width,y:a=(a-l.y+c/2)/l.height,width:u,height:c,parentWidth:l.width,parentHeight:l.height}},d=h(f);try{for(d.s();!(t=d.n()).done;){var y=t.value;s[y]=e[y]}}catch(n){d.e(n)}finally{d.f()}return Object.assign(s,C(e.transform)),s},W=function(n,t){var r,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object.keys(t),i=h(e);try{for(i.s();!(r=i.n()).done;){var o=r.value;x(t[o])||(n[o]=t[o])}}catch(n){i.e(n)}finally{i.f()}return n},z=function n(t,r,e){return j(t)?F(t,(function(t,i){return n(t,r[i],e)})):P(t[0])&&P(r[0])?[e(t[0],r[0]),t[1]]:r},B=function(n,t){for(var r in t){var e=c[r]||c.default;n[r]=r in n?z(n[r],t[r],e):t[r]}},F=function(n,t){var r={};for(var e in n)r[e]=t(n[e],e);return r},T=function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250;return function(){var r=Date.now();r-n.LivelyTimestamp<t||(n.LivelyTimestamp=r,n())}};function $(n,t){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);t&&(e=e.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.push.apply(r,e)}return r}function R(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?$(Object(e),!0).forEach((function(t){r(n,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):$(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}function q(n,t){var r="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!r){if(Array.isArray(n)||(r=function(n,t){if(!n)return;if("string"==typeof n)return L(n,t);var r=Object.prototype.toString.call(n).slice(8,-1);"Object"===r&&n.constructor&&(r=n.constructor.name);if("Map"===r||"Set"===r)return Array.from(n);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return L(n,t)}(n))||t&&n&&"number"==typeof n.length){r&&(n=r);var e=0,i=function(){};return{s:i,n:function(){return e>=n.length?{done:!0}:{done:!1,value:n[e++]}},e:function(n){throw n},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){r=r.call(n)},n:function(){var n=r.next();return a=n.done,n},e:function(n){u=!0,o=n},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw o}}}}function L(n,t){(null==t||t>n.length)&&(t=n.length);for(var r=0,e=new Array(t);r<t;r++)e[r]=n[r];return e}var U=function n(r,e){var i,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(x(r))return null;if("scale"!==e||o||j(r)||(r={x:r,y:r}),j(r)){var f,c=Object.keys(r),l=q(a);try{for(l.s();!(f=l.n()).done;){var s=f.value;if(v(r,s)){c=s;break}}}catch(n){l.e(n)}finally{l.f()}r=R({},r);var d,h=q(c);try{for(h.s();!(d=h.n()).done;){var y=d.value,g=e in u?u[e][y]:u[y];r[y]=y in r?n(r[y],e,!0):g}}catch(n){h.e(n)}finally{h.f()}return r}if(A(r)){if(D(r))return G(r);if(M(r))return J(r);var p=N(r),m=t(p,2);r=m[0],"%"==(i=m[1])&&(r/=100)}return[r,i=P(r)?X.normalize(i,e):null]},G=function(n){var r=n.match(/^#([\da-f]{1,2})([\da-f]{1,2})([\da-f]{1,2})([\da-f]{2})?/i),e=t(r,5);e[0];var i=e[1],o=e[2],a=e[3],u=e[4],f=function(n){return[x(n)?255:parseInt(n.padStart(2,n),16),null]};return{r:f(i),g:f(o),b:f(a),a:f(u)}},J=function(n){var r=n.match(/^rgba?\((\d+)\D+(\d+)\D+(\d+)\D*(\d+)?\)/i),e=t(r,5);e[0];var i=e[1],o=e[2],a=e[3],u=e[4],f=function(n){return[x(n)?255:parseInt(n),null]};return{r:f(i),g:f(o),b:f(a),a:f(u)}},K=function(n,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object.keys(n);return r.map((function(t){return Q(n[t])})).join(t)},N=function(n){var t=n.toString().match(/^(-?[\d.]+)([^\d.]*)$/i);return t?[parseFloat(t[1]),t[2]||null]:[n,null]},Q=function(n){return("%"==n[1]?100*n[0]:n[0])+(x(n[1])?"":n[1])},V=function(n,t){return"".concat(t,"(").concat(j(n)?K(n,", ",["x","y"]):Q(n),")")},X={fromProperty:function(n){return n in o?o[n]:o.default},toBase:function(n,t,r,e){if(j(n))return F(n,(function(n,e){return X.toBase(n,t,r,e)}));if(!P(n[0]))return n;var i=X.fromProperty(t);if(x(n[1])&&!x(i))return[n[0],i];var o=d["".concat(n[1],"_").concat(i)];return o?[o(n[0],r,e||t),i]:n},normalize:function(n,t){return i.includes(n)?n:X.fromProperty(t)}},Y={origin:"transformOrigin",length:"strokeDashoffset",clip:"clipPath",default:function(n){return Q(n)},transformOrigin:function(n){return K(n," ",["x","y"])},strokeDashoffset:function(n){return 1-n[0]},clipPath:function(n){return"inset(".concat(K(n," ",["top","right","bottom","left"]),")")}},Z={bind:function(n,t){n.origin=n.origin||n;var r=function(){for(var r,e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];return(r=n.origin).call.apply(r,[t].concat(i))};return r.origin=n.origin,r},create:function(n){var t=Z.bind((function(n){if(S(n)){var r=Z.bind(t,{transform:n});return r.set=t.set,r.internal=t.internal,r}return this.transform(t.internal.value)}),{transform:function(n){return n}});return t.set=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t.internal.value=n,t.internal.duration=r,t.internal.t=null},t.internal={value:n,duration:0},t},isInstance:function(n){return S(n)&&S(n.set)}},nn=Z;export{Y as A,u as D,nn as L,c as M,e as P,X as U,z as a,I as b,H as c,x as d,j as e,S as f,E as g,b as h,k as i,A as j,W as k,P as l,B as m,U as n,w as o,p,v as q,O as r,m as s,T as t,_ as u,f as v,g as x};
|
package/dist/esm/pop-c392f121.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/objectWithoutProperties";import{A as t}from"./animation-2c86de42.js";var o=["direction"];function n(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function c(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?n(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var i=t.create((function(e){var t=e.direction,n=void 0===t?"up":t,i=r(e,o),p="0px",a="20px";switch(n){case"down":a="-20px";break;case"left":p="20px",a="0px";break;case"right":p="-20px",a="0px"}return[c({translate:{x:0,y:0},opacity:1,duration:.5},i),{translate:{x:p,y:a},opacity:0}]}));function p(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function a(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?p(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):p(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var s=t.create((function(e){return[a({opacity:1,scale:1,duration:.25},e),{opacity:0,scale:.85}]}));export{i as M,s as P};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import r from"@babel/runtime/helpers/slicedToArray";import{useRef as t,useEffect as e}from"react";import{a as n,r as o}from"./events-66e26954.js";import{L as a}from"./link-292004ea.js";function s(r){var e=t(a.create(r));return[e.current,e.current.set]}function u(){var t=s(0),a=r(t,2),u=a[0],c=a[1];return e((function(){var r=function(){return c(window.scrollY)};return r(),n("scroll",r),function(){return o("scroll",r)}}),[]),u}export{u as a,s as u};
|
package/types/animatable.d.ts
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AnimationInitials, AnimationProperties } from './globals';
|
|
3
|
-
|
|
4
|
-
interface AnimatableProps {
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* How much to delay each subsequent `element` or `<Animatable>` component of the parent `<Animatable>` component, when animating it, in seconds.
|
|
8
|
-
*
|
|
9
|
-
* @default 0.1
|
|
10
|
-
*/
|
|
11
|
-
stagger?: number;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* What percentage of previous animation duration to wait for in a cascading animation.
|
|
15
|
-
*
|
|
16
|
-
* @default 1
|
|
17
|
-
*/
|
|
18
|
-
cascade?: number;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Percentage of `element` that needs to enter or leave the viewport (`window`) to trigger viewport based animations.
|
|
22
|
-
*
|
|
23
|
-
* @default 0.75
|
|
24
|
-
*/
|
|
25
|
-
viewportMargin?: number;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Controls the order in which the component animates when part of a cascading animation.
|
|
29
|
-
*/
|
|
30
|
-
group?: number;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Whether to pause an animation when the animated `element` is not visible on screen.
|
|
34
|
-
*
|
|
35
|
-
* @default true
|
|
36
|
-
*/
|
|
37
|
-
lazy?: boolean;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Whether all playing animations should be paused or not.
|
|
41
|
-
*
|
|
42
|
-
* @default false
|
|
43
|
-
*/
|
|
44
|
-
paused?: boolean;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Whether to correct an `element`'s children and certain of it's properties for deformations caused by scaling the `element`.
|
|
48
|
-
*
|
|
49
|
-
* @default false
|
|
50
|
-
*/
|
|
51
|
-
noDeform?: boolean;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Define a default animation.
|
|
55
|
-
*/
|
|
56
|
-
animate?: AnimationProperties;
|
|
57
|
-
|
|
58
|
-
initial?: AnimationInitials;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Define animations as key-value pairs, where the key is the animation name.
|
|
62
|
-
*/
|
|
63
|
-
animations?: {
|
|
64
|
-
[key: string]: AnimationProperties;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Whether to prevent cascading of an animation to child `<Animatable>` components.
|
|
69
|
-
*
|
|
70
|
-
* @default false
|
|
71
|
-
*/
|
|
72
|
-
stopPropagation?: boolean;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Play either the default or the defined animation when the component mounts.
|
|
76
|
-
*
|
|
77
|
-
* @default false
|
|
78
|
-
*/
|
|
79
|
-
onMount?: string | boolean;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Play either the default or the defined animation reversed when the component unmounts.
|
|
83
|
-
*
|
|
84
|
-
* Note: this only works in combination with the `useUnmount`.
|
|
85
|
-
*
|
|
86
|
-
* @default false
|
|
87
|
-
*/
|
|
88
|
-
onUnmount?: string | boolean;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Play either the default or the defined animation when any child `element` is clicked.
|
|
92
|
-
*
|
|
93
|
-
* @default false
|
|
94
|
-
*/
|
|
95
|
-
onClick?: string | boolean;
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Play either the default or the defined animation (reversed when leaving) when any child `element` enters or leaves the viewport.
|
|
99
|
-
*
|
|
100
|
-
* @default false
|
|
101
|
-
*/
|
|
102
|
-
whileViewport?: string | boolean;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Play either the default or the defined animation (reversed when leaving) when the mouse enters or leaves any child `element`.
|
|
106
|
-
*
|
|
107
|
-
* @default false
|
|
108
|
-
*/
|
|
109
|
-
whileHover?: string | boolean;
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Play either the default or the defined animation (reversed when losing) when any child `element` gains or looses focus.
|
|
113
|
-
*
|
|
114
|
-
* @default false
|
|
115
|
-
*/
|
|
116
|
-
whileFocus?: string | boolean;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export class Animatable extends React.Component<AnimatableProps> {
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Checks whether something is an instance of `Animatable` or a class that extends it.
|
|
123
|
-
*/
|
|
124
|
-
static isInstance(val: any): boolean;
|
|
125
|
-
|
|
126
|
-
private parse;
|
|
127
|
-
|
|
128
|
-
private update;
|
|
129
|
-
|
|
130
|
-
private dispatch;
|
|
131
|
-
|
|
132
|
-
private onEvent;
|
|
133
|
-
|
|
134
|
-
private onScroll;
|
|
135
|
-
|
|
136
|
-
private getBoundingBox;
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Play an animation referenced in `this.animations`.
|
|
140
|
-
*
|
|
141
|
-
* @param {string} animation
|
|
142
|
-
* @param {object} [options]
|
|
143
|
-
* @param {Function} [options.callback] - A callback function that gets called when the animation finishes playing.
|
|
144
|
-
* @param {boolean} [options.reverse] - Play the animation in reverse.
|
|
145
|
-
* @param {boolean} [options.composite] - Whether to play the animation simultaneously with other animations.
|
|
146
|
-
* @param {boolean} [options.immediate] - Whether to immediately play the animation, will override other playing animations when `composite` is `false`.
|
|
147
|
-
* @param {number} [options.delay] - Delay the animation by some amount in seconds.
|
|
148
|
-
*/
|
|
149
|
-
play(animation: string, { callback, reverse, composite, immediate, delay }?: {
|
|
150
|
-
callback?: Function;
|
|
151
|
-
reverse?: boolean;
|
|
152
|
-
composite?: boolean;
|
|
153
|
-
immediate?: boolean;
|
|
154
|
-
delay?: number;
|
|
155
|
-
}, delegate?: boolean): number;
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Stop playing all currently playing animations.
|
|
159
|
-
*/
|
|
160
|
-
stop(): void;
|
|
161
|
-
|
|
162
|
-
private prerender;
|
|
163
|
-
|
|
164
|
-
}
|
package/types/animate.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AnimatableProps } from '../animatable';
|
|
3
|
-
import { Animation } from '../animations/animation';
|
|
4
|
-
|
|
5
|
-
interface AnimateProps extends AnimatableProps {
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* An array of `Animation` objects that defines what animation to apply to element depending on it's level.
|
|
9
|
-
*
|
|
10
|
-
* @default [Move, Pop]
|
|
11
|
-
*/
|
|
12
|
-
animations?: Animation[];
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* How many levels of `elements` to animate.
|
|
16
|
-
*
|
|
17
|
-
* @default 1
|
|
18
|
-
*/
|
|
19
|
-
levels?: number;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export class Animate extends React.Component<AnimateProps> {
|
|
23
|
-
|
|
24
|
-
private makeAnimatable;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Play an animation referenced in `this.animations`.
|
|
28
|
-
*
|
|
29
|
-
* @param {string} animation
|
|
30
|
-
* @param {object} [options]
|
|
31
|
-
* @param {Function} [options.callback] - A callback function that gets called when the animation finishes playing.
|
|
32
|
-
* @param {boolean} [options.reverse] - Play the animation in reverse.
|
|
33
|
-
* @param {boolean} [options.composite] - Whether to play the animation simultaneously with other animations.
|
|
34
|
-
* @param {boolean} [options.immediate] - Whether to immediately play the animation, will override other playing animations when `composite` is `false`.
|
|
35
|
-
* @param {number} [options.delay] - Delay the animation by some amount in seconds.
|
|
36
|
-
*/
|
|
37
|
-
play(animation: string, { callback, reverse, composite, immediate, delay }?: {
|
|
38
|
-
callback?: Function;
|
|
39
|
-
reverse?: boolean;
|
|
40
|
-
composite?: boolean;
|
|
41
|
-
immediate?: boolean;
|
|
42
|
-
delay?: number;
|
|
43
|
-
}, delegate?: boolean): number;
|
|
44
|
-
|
|
45
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { AnimationInitials, AnimationProperties } from '../globals';
|
|
2
|
-
|
|
3
|
-
export type Animation = {
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Creates a new `Animation` based on a `Function` that returns a tuple of animation properties and initials.
|
|
7
|
-
*/
|
|
8
|
-
create(getProperties?: () => [AnimationProperties, AnimationInitials]): Animation;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Check whether something is an instance of `Animation`.
|
|
12
|
-
*/
|
|
13
|
-
isAnimation(animation: any): boolean;
|
|
14
|
-
|
|
15
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AnimationProperties } from '../globals';
|
|
2
|
-
import { Animation } from './animation';
|
|
3
|
-
|
|
4
|
-
interface MoveOptions extends AnimationProperties {
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* The direction to move the `element` to.
|
|
8
|
-
*
|
|
9
|
-
* @default "up"
|
|
10
|
-
*/
|
|
11
|
-
direction: 'up' | 'left' | 'down' | 'right';
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Move and simultaneously fade the `element` along an axis over a duration of 0.5 seconds.
|
|
16
|
-
*
|
|
17
|
-
* @type {Animation}
|
|
18
|
-
*/
|
|
19
|
-
export function Move(options: MoveOptions): this
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AnimationProperties } from '../globals';
|
|
2
|
-
import { Animation } from './animation';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Slightly scale and fade the `element` over a duration of 0.25 seconds.
|
|
6
|
-
*
|
|
7
|
-
* @type {Animation}
|
|
8
|
-
*/
|
|
9
|
-
export function Pop(options: AnimationProperties): this;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AnimationProperties } from '../globals';
|
|
2
|
-
import { Animation } from './animation';
|
|
3
|
-
|
|
4
|
-
interface ScaleOptions extends AnimationProperties {
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* The direction to scale the `element` up to.
|
|
8
|
-
*
|
|
9
|
-
* @default "right"
|
|
10
|
-
*/
|
|
11
|
-
direction: 'up' | 'left' | 'down' | 'right';
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Scale the `element` along an axis over a duration of 0.6 seconds.
|
|
16
|
-
*
|
|
17
|
-
* @type {Animation}
|
|
18
|
-
*/
|
|
19
|
-
export function Scale(options: ScaleOptions): this;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Animation } from './animation';
|
|
2
|
-
import { AnimationProperties } from '../globals';
|
|
3
|
-
|
|
4
|
-
interface WipeOptions extends AnimationProperties {
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* The direction to wipe the `element` to.
|
|
8
|
-
*
|
|
9
|
-
* @default "right"
|
|
10
|
-
*/
|
|
11
|
-
direction: 'up' | 'left' | 'down' | 'right';
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Wipe the `element` along an axis over a duration of 1 seconds.
|
|
16
|
-
*
|
|
17
|
-
* @type {Animation}
|
|
18
|
-
*/
|
|
19
|
-
export function Wipe(options: WipeOptions): this;
|
package/types/animations.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export as namespace Animations;
|
|
2
|
-
|
|
3
|
-
export { Fade } from './animations/fade';
|
|
4
|
-
export { Move } from './animations/move';
|
|
5
|
-
export { Pop } from './animations/pop';
|
|
6
|
-
export { Scale } from './animations/scale';
|
|
7
|
-
export { Wipe } from './animations/wipe';
|
|
8
|
-
export { Animation } from './animations/animation';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
interface LayoutGroupProps {
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @default ['translate', 'scale', 'rotate', 'opacity', 'borderRadius', 'backgroundColor', 'color', 'zIndex', 'pointerEvents']
|
|
7
|
-
*/
|
|
8
|
-
include?: string[];
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @default []
|
|
12
|
-
*/
|
|
13
|
-
exclude?: string[];
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export class LayoutGroup extends React.Component<LayoutGroupProps> {}
|
package/types/auto/morph.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AnimatableProps } from '../animatable';
|
|
3
|
-
|
|
4
|
-
interface MorphProps extends AnimatableProps {
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @default false
|
|
8
|
-
*/
|
|
9
|
-
active?: boolean;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @default ['translate', 'scale', 'rotate', 'opacity', 'borderRadius', 'backgroundColor', 'color', 'zIndex', 'pointerEvents']
|
|
13
|
-
*/
|
|
14
|
-
include?: string[];
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @default []
|
|
18
|
-
*/
|
|
19
|
-
exclude?: string[];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export class Morph extends React.Component<MorphProps> {
|
|
23
|
-
|
|
24
|
-
private static cascadingProps;
|
|
25
|
-
|
|
26
|
-
}
|