@infinityfx/lively 2.0.0-beta.3 → 2.0.0-beta.5

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.
Files changed (47) hide show
  1. package/README.md +96 -44
  2. package/dist/cjs/animatable-82c8bdab.js +1 -0
  3. package/dist/cjs/animation-093c54b4.js +1 -0
  4. package/dist/cjs/animations.js +1 -1
  5. package/dist/cjs/auto.js +1 -1
  6. package/dist/cjs/{events-b078b24b.js → events-0578e3ad.js} +1 -1
  7. package/dist/cjs/hooks.js +1 -1
  8. package/dist/cjs/index.js +1 -1
  9. package/dist/cjs/link-127cb540.js +1 -0
  10. package/dist/cjs/{pop-aa2b4873.js → pop-bbcca87f.js} +1 -1
  11. package/dist/cjs/{scroll-36921609.js → scroll-fad125b6.js} +1 -1
  12. package/dist/esm/animatable-da6d3d81.js +1 -0
  13. package/dist/esm/animation-6e420a47.js +1 -0
  14. package/dist/esm/animations.js +1 -1
  15. package/dist/esm/auto.js +1 -1
  16. package/dist/esm/events-880f67a0.js +1 -0
  17. package/dist/esm/hooks.js +1 -1
  18. package/dist/esm/index.js +1 -1
  19. package/dist/esm/link-5b9b9bd9.js +1 -0
  20. package/dist/esm/{pop-3729cc37.js → pop-b892d6b6.js} +1 -1
  21. package/dist/esm/{scroll-85e4c20b.js → scroll-f6402370.js} +1 -1
  22. package/package.json +3 -5
  23. package/types/animatable.d.ts +55 -29
  24. package/types/animate.d.ts +44 -2
  25. package/types/animations/animation.d.ts +6 -0
  26. package/types/auto/layout-group.d.ts +16 -0
  27. package/types/auto/morph.d.ts +26 -0
  28. package/types/auto.d.ts +4 -0
  29. package/types/core/link.d.ts +12 -0
  30. package/types/globals.d.ts +8 -27
  31. package/types/hooks/link.d.ts +8 -0
  32. package/types/hooks/path.d.ts +9 -0
  33. package/types/hooks/reduced-motions.d.ts +4 -0
  34. package/types/hooks/scroll.d.ts +6 -1
  35. package/types/hooks/unmount.d.ts +2 -2
  36. package/types/hooks.d.ts +3 -1
  37. package/types/index.d.ts +1 -1
  38. package/dist/cjs/animatable-a2bb37f4.js +0 -1
  39. package/dist/cjs/animation-d386bd87.js +0 -1
  40. package/dist/cjs/link-3d1b05ee.js +0 -1
  41. package/dist/esm/animatable-3cd57273.js +0 -1
  42. package/dist/esm/animation-6ebdc764.js +0 -1
  43. package/dist/esm/events-262f3d14.js +0 -1
  44. package/dist/esm/link-0e7c5f95.js +0 -1
  45. package/types/animate/animate.d.ts +0 -36
  46. package/types/hooks/animation.d.ts +0 -1
  47. package/types/morph.d.ts +0 -35
@@ -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),a=e(r),u=["%","px","em","rem","vw","vh","vmin","vmax","deg","rad"],l={rotate:"deg",skew:"deg",scale:"%",clip:"%",opacity:null,zIndex:null,lineHeight:null,fontWeight:null,length:null,default:"px"},c=[["x","y"],["r","g","b","a"],["left","top","right","bottom"]],f={translate:{x:[0,"px"],y:[0,"px"]},scale:{x:[1,"%"],y:[1,"%"]},clip:{left:[0,"%"],top:[0,"%"],right:[0,"%"],bottom:[0,"%"]},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}};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 h(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 h(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,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function h(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 y=function(t,n){return Object.keys(t).some((function(t){return n.includes(t)}))},b={null:function(t){return null==t},array:function(t){return Array.isArray(t)},object:function(t){return!b.null(t)&&"object"===o.default(t)&&!b.array(t)},function:function(t){return t instanceof Function},string:function(t){return"string"==typeof t},bool:function(t){return"boolean"==typeof t},number:function(t){return"number"==typeof t},empty:function(t){return function(t,n){return Object.keys(t).length===n}(t,0)},rgb:function(t){return t.match(/^rgba?\(.*\)$/i)},hex:function(t){return t.match(/^#[0-9a-f]{3,8}$/i)},color:function(t){return b.object(t)&&"r"in t}},g=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,i=180*Math.atan2(n.b,n.a)/Math.PI;return{translate:{x:n.e,y:n.f},scale:{x:r,y:e},rotate:i,skew:{x:o,y:0}}},v=function t(n,r,e){if(b.object(n)){var o={};for(var i in n)o[i]=t(n[i],r[i],e);return o}return b.number(n[0])&&b.number(r[0])?[e(n[0],r[0]),n[1]]:r};function m(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 x(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?m(Object(r),!0).forEach((function(n){a.default(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))}))}return t}function w(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 O(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 O(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,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function O(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 j=function t(n,r){var e,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(b.null(n))return null;if("scale"!==r||o||b.object(n)||(n={x:n,y:n}),b.object(n)){var a,u=Object.keys(n),l=w(c);try{for(l.s();!(a=l.n()).done;){var s=a.value;if(y(n,s)){u=s;break}}}catch(t){l.e(t)}finally{l.f()}n=x({},n);var p,d=w(u);try{for(d.s();!(p=d.n()).done;){var h=p.value,g=r in f?f[r][h]:f[h];n[h]=h in n?t(n[h],r,!0):g}}catch(t){d.e(t)}finally{d.f()}return n}if(b.string(n)){if(b.hex(n))return S(n);if(b.rgb(n))return P(n);var v=k(n),m=i.default(v,2);n=m[0],"%"==(e=m[1])&&(n/=100)}return[n,e=b.number(n)?M.normalize(e,r):null]},S=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],a=r[3],u=r[4],l=function(t){return[b.null(t)?255:parseInt(t.padStart(2,t),16),null]};return{r:l(e),g:l(o),b:l(a),a:l(u)}},P=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],a=r[3],u=r[4],l=function(t){return[b.null(t)?255:parseInt(t),null]};return{r:l(e),g:l(o),b:l(a),a:l(u)}},A=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object.keys(t);return r.map((function(n){return I(t[n])})).join(n)},k=function(t){var n=t.toString().match(/^([\d.]+)([^\d.]*)$/i);return n?[parseFloat(n[1]),n[2]||null]:[t,null]},I=function(t){return("%"==t[1]?100*t[0]:t[0])+(b.null(t[1])?"":t[1])},M={emtopx:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.body;return t*parseFloat(getComputedStyle(n).fontSize)},remtopx:function(t){return M.emtopx(t)},vwtopx:function(t){return t*window.innerWidth},vhtopx:function(t){return t*window.innerHeight},vmintopx:function(t){return t*Math.min(window.innerWidth,window.innerHeight)},vmaxtopx:function(t){return t*Math.max(window.innerWidth,window.innerHeight)},radtodeg:function(t){return 180*t/Math.PI},fromProperty:function(t){return t in l?l[t]:l.default},toBase:function(t,n,r){if(b.object(t)){var e={};for(var o in t)e[o]=M.toBase(t[o],n);return e}if(!b.number(t[0]))return t;var i=M.fromProperty(n);if(b.null(t[1])&&!b.null(i))return[t[0],i];var a=M["".concat(t[1],"to").concat(i)];return a?[a(t[0],r),i]:t},normalize:function(t,n){return u.includes(t)||b.null(t)&&n in l?t:M.fromProperty(n)}},T=function(t){return"inset(".concat(A(t," ",["top","right","bottom","left"]),")")},C={origin:["transformOrigin"],length:["strokeDashoffset"],clip:["clipPath","webkitClipPath"],transformOrigin:function(t){return"".concat(100*t.x,"% ").concat(100*t.y,"%")},strokeDashoffset:function(t){return 1-t[0]},clipPath:T,webkitClipPath:T},D={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=D.bind((function(t){if(b.function(t)){var r=D.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 b.function(t)&&b.function(t.set)}},E=D;exports.Alias=C,exports.DEFAULT_OBJECTS=f,exports.Link=E,exports.MERGE_FUNCTIONS=p,exports.MORPH_PROPERTIES=s,exports.POSITIONS=["set","start","end"],exports.TRANSFORMS=["translate","scale","skew","rotate"],exports.Units=M,exports.arrToStyle=I,exports.convert=j,exports.getProperty=function(t,n){var r=getComputedStyle(t),e=g(r.transform);if(n in e)return j(e[n],n);var o=r[n];return b.rgb(o)?P(o):k(o)},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,a=o.y,u=o.width,l=o.height,c=(r?t.parentElement:document.body).getBoundingClientRect(),f={layout:{x:i=(i-c.x+u/2)/c.width,y:a=(a-c.y+l/2)/c.height,width:u,height:l,parentWidth:c.width,parentHeight:c.height}},p=d(s);try{for(p.s();!(n=p.n()).done;){var h=n.value;f[h]=e[h]}}catch(t){p.e(t)}finally{p.f()}return Object.assign(f,g(e.transform)),f},exports.hasSomeKey=y,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.is=b,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=v,exports.mergeObjects=function(t,n){var r,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object.keys(n),o=d(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;b.null(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?v(t[r],n[r],e):n[r]}},exports.objToStr=A,exports.originToStr=function(t){var n=b.object(t)?t:{},r=n.x,e=void 0===r?.5:r,o=n.y,i=void 0===o?.5:o;if(b.string(t))switch(t){case"left":e=0;break;case"right":e=1;break;case"top":i=0;break;case"bottom":i=1}return{x:e,y:i}},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();t.LivelyTimestamp-r<n||(t.LivelyTimestamp=r,t())}},exports.xor=function(t,n){return t&&!n||!t&&n};
@@ -1 +0,0 @@
1
- import e from"@babel/runtime/helpers/classCallCheck";import t from"@babel/runtime/helpers/createClass";import r from"@babel/runtime/helpers/inherits";import n from"@babel/runtime/helpers/possibleConstructorReturn";import i from"@babel/runtime/helpers/getPrototypeOf";import o from"@babel/runtime/helpers/defineProperty";import{Children as a,isValidElement as s,cloneElement as l,Component as c}from"react";import{A as u,C as h}from"./animation-6ebdc764.js";import{g as f,D as p,m as y,i as m,a as v,o as d,b as g,A as b,M as w,T as k,t as O,c as j,d as A}from"./link-0e7c5f95.js";import{a as x,o as S,r as P,b as I}from"./events-262f3d14.js";function D(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 E(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 E(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 E(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 M=function(){function r(){e(this,r),this.t=Date.now(),this.managers=[],this.step()}return t(r,[{key:"step",value:function(){var e,t=Date.now(),r=D(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=this.managers.findIndex((function(t){return t.priority>=e.priority}));this.managers.splice(t<0?0: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 r),window.Lively}}]),r}();function L(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 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 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}var C=function(){function r(t,n,i){e(this,r),this.element=t,this.tracks=[],this.queue=[],this.playing=!0,this.culling=n,this.layout=i}return t(r,[{key:"purge",value:function(){if(!("cache"in this.element)){this.element.cache={strokeDasharray:1,borderRadius:f(this.element,"borderRadius")};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]}},{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:p.scale}:{},r=this.tracks.length+ +!this.channel.isEmpty,n=0;n<r;n++){var i=this.tracks[n]||this.channel;y(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(!m.empty(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],i.x[1]],y:[1/i.y[0],i.y[1]]},s=L(e.children);try{for(s.s();!(o=s.n()).done;){o.value.correction=a}}catch(e){s.e(e)}finally{s.f()}var l=t.borderRadius||e.cache.borderRadius;delete t.borderRadius,e.style.borderRadius="".concat(l[0]/i.x[0]).concat(l[1]," / ").concat(l[0]/i.y[0]).concat(l[1])}e.correction&&(i=v(i,e.correction,w.scale))}var c=k.indexOf(n);if(c>=0)r[c]="".concat(n,"(").concat(m.object(i)?d(i,", ",["x","y"]):g(i),")");else{var u,h=L(b[n]||[n]);try{for(h.s();!(u=h.n()).done;){var f=u.value;m.color(i)?e.style[f]="rgba(".concat(i.r[0],", ").concat(i.g[0],", ").concat(i.b[0],", ").concat(i.a[0],")"):e.style[f]=f in b?b[f](i):g(i)}}catch(e){h.e(e)}finally{h.f()}}}(r=r.filter((function(e){return!!e}))).length&&(e.style.transform=r.join(" "))}}},{key:"initialize",value:function(e){this.apply(this.element,e.initials),this.channel=e.channel}}]),r}();function V(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?V(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function T(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 U(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 U(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 U(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 q=function(){function r(t){var n=t.priority,i=void 0===n?0:n,o=t.stagger,a=void 0===o?.1:o,s=t.culling,l=void 0===s||s,c=t.noDeform,u=void 0!==c&&c,h=t.paused,f=void 0!==h&&h;e(this,r),this.targets=[],this.priority=i,this.stagger=a,this.culling=l,this.noDeform=u,this.paused=f}return t(r,[{key:"register",value:function(){M.get().add(this)}},{key:"destroy",value:function(){this.targets=[],M.get().remove(this)}},{key:"purge",value:function(){var e,t=T(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=T(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){var t=this;this.targets=e.map((function(e){return new C(e,t.culling,t.noDeform)}))}},{key:"play",value:function(e,t){if(!e.isEmpty)for(var r=0;r<this.targets.length;r++){var n=B(B({},t),{},{delay:(t.delay||0)+r*this.stagger});this.targets[r].add(e.play(n),n)}}},{key:"initialize",value:function(e){var t,r=T(this.targets);try{for(r.s();!(t=r.n()).done;){t.value.initialize(e)}}catch(e){r.e(e)}finally{r.f()}}},{key:"step",value:function(e){if(!this.paused){var t,r=T(this.targets);try{for(r.s();!(t=r.n()).done;){t.value.step(e)}}catch(e){r.e(e)}finally{r.f()}}}}]),r}();function z(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 $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function F(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 H(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 H(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 H(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 N(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,o=i(e);if(t){var a=i(this).constructor;r=Reflect.construct(o,arguments,a)}else r=o.apply(this,arguments);return n(this,r)}}var X=function(n){r(o,c);var i=N(o);function o(t){var r;for(var n in e(this,o),(r=i.call(this,t)).animations={default:r.parse(r.props.animate||{})},r.props.animations||{})r.animations[n]=r.parse(r.props.animations[n]);return r.children=[],r.elements=[],r.stagger=r.props.stagger||.1,r.manager=new q({priority:r.props.group,stagger:r.stagger,culling:r.props.lazy,noDeform:r.props.noDeform,paused:r.props.paused}),r}return t(o,[{key:"parse",value:function(e){return u.isInstance(e)?e.use():m.object(e)?new h(e,this.props.initial):null}},{key:"update",value:function(){this.manager.clear(),this.manager.purge(),this.manager.initialize(this.animations.default)}},{key:"componentDidMount",value:function(){var e=this;this.scrollEventListener=O(this.onScroll.bind(this)),x("scroll",this.scrollEventListener),this.eventListener=this.onEvent.bind(this),S(o.events,this.elements,this.eventListener),this.manager.set(this.elements),this.manager.register(),this.update(),document.fonts.ready.then((function(){e.update(),clearTimeout(e.timeout),e.inViewport=!1,e.props.group||(e.play(e.props.onMount),e.onScroll())}))}},{key:"componentWillUnmount",value:function(){P("scroll",this.scrollEventListener),I(o.events,this.elements,this.eventListener),this.manager.destroy()}},{key:"componentDidUpdate",value:function(){this.manager.paused=this.props.paused;var e,t=F(this.children);try{for(t.s();!(e=t.n()).done;){e.value.manager.paused=this.props.paused}}catch(e){t.e(e)}finally{t.f()}}},{key:"dispatch",value:function(e){m.function(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=F(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=j(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,l=void 0!==s&&s,c=r.delay,u=void 0===c?0:c,h=r.callback,f=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!(!e||this.props.disabled||this.props.group>0&&!f)){m.string(e)||(e="default"),this.dispatch("onAnimationStart");var p,y=this.animations[e],v=y.length(),d=0,g=F(this.children);try{for(g.s();!(p=g.n()).done;){var b=p.value;d=Math.max(d,b.play(e,{reverse:i,immediate:l,delay:u+v},!0))}}catch(e){g.e(e)}finally{g.f()}return this.manager.play(y,{reverse:i,composite:a,immediate:l,delay:i?d:u}),l&&clearTimeout(this.timeout),this.props.group||(this.timeout=setTimeout((function(){t.dispatch("onAnimationEnd"),m.function(h)&&h()}),1e3*(d+v))),v+(i?d: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 a.map(e,(function(e){if(!s(e))return e;var i={pathLength:1},a=t.elementIndex++;if(r&&(i.ref=function(e){return t.elements[a]=e}),o.isInstance(e)&&n&&!e.props.noCascade){var c=t.childIndex++;n=!1,i.group=t.props.group+1,i.ref=function(e){return t.children[c]=e},t.props.group||(i.active=t.props.active),A(i,$($({},t.props),e.props),t.constructor.cascadingProps)}return l(e,i,t.prerender(e.props.children,!1,n))}))}},{key:"render",value:function(){return this.elementIndex=this.childIndex=0,this.prerender(this.props.children)}}],[{key:"isInstance",value:function(e){return e.type===o||e.type.prototype instanceof o}}]),o}();o(X,"events",["click","mouseenter","mouseleave","focus","blur"]),o(X,"cascadingProps",["animate","initial","animations","stagger"]),o(X,"defaultProps",{group:0,viewportMargin:.75,lazy:!0,paused:!1});export{X 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 u from"@babel/runtime/helpers/getPrototypeOf";import{i as s,e as l,U as c,g as f,f as h,x as p,h as y,d as v,j as d,L as m,P as b}from"./link-0e7c5f95.js";function g(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 w(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 w(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,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function w(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 O=function t(e,r,n,i){if(s.object(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]]},j=function(t,e,r){return s.number(t)&&s.number(e)?t*(1-r)+e*r:r>.5?e:t},P=function(t,e,r){return j(t,e,(1-Math.cos(r*Math.PI))/2)},x=function(t,e,r){var n,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a={duration:i},o={},u=g(r);try{for(u.s();!(n=u.n()).done;){var s=n.value;"scale"==s?(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"==s?(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[s]=t[s],o[s]=e[s])}}catch(t){u.e(t)}finally{u.f()}return new R(a,o)},A=Object.freeze({__proto__:null,interpolate:O,constant:function(t){return t},linear:j,ease:P,spring:function(t,e,r){return r=1-1*Math.exp(-3.6*r)*Math.cos(2.5*Math.pow(r,2)*Math.PI),j(t,e,r)},computeMorph:x}),k=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,u=void 0===o?1:o,s=r.delay,l=void 0===s?0:s,c=r.alternate,f=void 0!==c&&c;n(this,t),this.indices={},this.clip=e,this.t=0,this.T=e.duration*u+l,this.reverse=a,this.delay=l,this.alternate=f}return i(t,[{key:"getInterpolatedValue",value:function(t,e,r,n){if(s.function(e))e=l(e(r,this.clip.duration),t),e=c.toBase(e,t,n);else{t in this.indices||(this.indices[t]=this.reverse?e.length-1:0);var i,a=this.reverse?-1:1,o=this.indices[t],u=e[o],h=e[o+a],p=u.set;if(this.reverse?h.time>r:h.time<r){this.indices[t]=o+=a;var y=["start","end"],v=y[+!this.reverse],d=y[+this.reverse];v in u||d in h?(p=v in u?u[v]:h[d],i=!0):(u=e[o],h=e[o+a])}if(s.null(p)&&(p=f(n,t)),p=c.toBase(p,t,n),i)e=p;else{var m=s.null(h.set)?f(n,t):h.set;m=c.toBase(m,t,n);var b=A[h.interpolate||this.clip.interpolate]||P;e=O(p,m,(r-u.time)/(h.time-u.time),b)}}return e}},{key:"get",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r={},n=this.t>=this.T;if(this.t<this.delay||e&&!n&&!h(t))return r;var i=this.t-this.delay,a=this.clip.duration,o=this.alternate&&Math.floor(i/a)%2==+!n;for(var u in i=n?a:i%a,i=p(this.reverse,o)?a-i:i,r.origin=this.clip.origin,this.clip.properties)r[u]=this.getInterpolatedValue(u,this.clip.properties[u],i,t);return r}},{key:"step",value:function(t){var e=this.t>=this.T;return this.t+=t,e}}]),t}();function I(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=u(t);if(e){var i=u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}var S=function(t){a(r,k);var e=I(r);function r(){var t;return n(this,r),(t=e.call(this,{duration:1/0,properties:{},origin:{x:.5,y:.5}})).isEmpty=!0,t.cache={},t}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){s.null(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=c.toBase(l(e(r,this.clip.duration),t),t,n),u=f(n,t);u=c.toBase(u,t,n);var h=O(u,o,i,j);return this.cache[t]={value:h,t:i},h}}]),r}(),M=["duration","delay","repeat","alternate","interpolate","origin"];function z(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 B(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 B(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,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){u=!0,a=t},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function B(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 C(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 E(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?C(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var R=function(){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=i.duration,o=void 0===a?1:a,u=i.delay,l=i.repeat,c=i.alternate,f=i.interpolate,h=i.origin,p=void 0===h?{x:.5,y:.5}:h,y=r(i,M),v=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(this,e),this.duration=o,this.origin=d(p),this.channel=new S;var m=this.parse(y,v),b=t(m,2);this.properties=b[0],this.initials=b[1],this.isEmpty=s.empty(this.properties),this.interpolate=f,this.defaults={delay:u,repeat:l,alternate:c}}return i(e,[{key:"length",value:function(){return 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(m.isInstance(i))return r.channel.add(n,i),delete t[n],"continue";if(s.function(i))return"continue";(i=s.array(i)?i:[i]).length<2?i.unshift(n in e?e[n]:null):s.null(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=E({},e))e[a]=l(e[a],a);return[t,e]}},{key:"sanitize",value:function(t,e){s.object(t)||(t={set:t}),y(t,b)||(t={set:t}),"set"in t||(t.set="start"in t?t.start:t.end),"time"in t&&t.time>this.duration&&delete t.time,t=E({},t);var r,n=z(b);try{for(n.s();!(r=n.n()).done;){var i=r.value;i in t&&(t[i]=l(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 k(this,v(t,this.defaults))}}]),e}(),T={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 R(a,o)},r},isInstance:function(t){return s.function(t)&&s.function(t.use)}};export{T as A,R as C,x as c};
@@ -1 +0,0 @@
1
- import{i as n}from"./link-0e7c5f95.js";function r(n,r){var t="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=function(n,r){if(!n)return;if("string"==typeof n)return e(n,r);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 e(n,r)}(n))||r&&n&&"number"==typeof n.length){t&&(n=t);var o=0,a=function(){};return{s:a,n:function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}},e:function(n){throw n},f:a}}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,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,i=n},f:function(){try{u||null==t.return||t.return()}finally{if(f)throw i}}}}function e(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 t={},o=function(r,e){r in t||(t[r]={unique:0},window.addEventListener(r,(function(e){for(var o=0,a=Object.values(t[r]);o<a.length;o++){var i=a[o];n.function(i)&&i(e)}})));var o=t[r];e.LivelyID=o.unique,o[o.unique++]=e},a=function(r,e){!n.null(window)&&r in t&&!n.null(e)&&"LivelyID"in e&&delete t[r][e.LivelyID]},i=function(n,e,t){var o,a=r(n);try{for(a.s();!(o=a.n()).done;){var i,u=o.value,f=r(e);try{for(f.s();!(i=f.n()).done;){i.value.addEventListener(u,t)}}catch(n){f.e(n)}finally{f.f()}}}catch(n){a.e(n)}finally{a.f()}},u=function(n,e,t){var o,a=r(n);try{for(a.s();!(o=a.n()).done;){var i,u=o.value,f=r(e);try{for(f.s();!(i=f.n()).done;){i.value.removeEventListener(u,t)}}catch(n){f.e(n)}finally{f.f()}}}catch(n){a.e(n)}finally{a.f()}};export{o as a,u as b,i as o,a as r};
@@ -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"],o=["%","px","em","rem","vw","vh","vmin","vmax","deg","rad"],i={rotate:"deg",skew:"deg",scale:"%",clip:"%",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,"%"]},r:[127,null],g:[127,null],b:[127,null],a:[255,null]},c=["translate","scale","skew","rotate"],l=["translate","scale","rotate","opacity","borderRadius","backgroundColor","color","zIndex","pointerEvents"],f={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}};function s(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 d(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 d(n,t)}(n))||t&&n&&"number"==typeof n.length){r&&(n=r);var e=0,o=function(){};return{s:o,n:function(){return e>=n.length?{done:!0}:{done:!1,value:n[e++]}},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,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,i=n},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function d(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 h=function(n,t){return n&&!t||!n&&t},y=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,o=e-r;return{left:r>window.innerHeight+o*t,entered:r+o*t<window.innerHeight}},g=function(n){var t=n.getBoundingClientRect(),r=t.x,e=t.y,o=t.right,i=t.bottom;return!(o-r<1||i-e<1)&&(e<window.innerHeight&&i>0&&r<window.innerWidth&&o>0)},p={null:function(n){return null==n},array:function(n){return Array.isArray(n)},object:function(t){return!p.null(t)&&"object"===n(t)&&!p.array(t)},function:function(n){return n instanceof Function},string:function(n){return"string"==typeof n},bool:function(n){return"boolean"==typeof n},number:function(n){return"number"==typeof n},empty:function(n){return function(n,t){return Object.keys(n).length===t}(n,0)},rgb:function(n){return n.match(/^rgba?\(.*\)$/i)},hex:function(n){return n.match(/^#[0-9a-f]{3,8}$/i)},color:function(n){return p.object(n)&&"r"in n}},v=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),o=180*Math.atan2(t.d,t.c)/Math.PI-90,i=180*Math.atan2(t.b,t.a)/Math.PI;return{translate:{x:t.e,y:t.f},scale:{x:r,y:e},rotate:i,skew:{x:o,y:0}}},m=function(n,t){var r=getComputedStyle(n),e=v(r.transform);if(t in e)return C(e[t],t);var o=r[t];return p.rgb(o)?E(o):z(o)},w=function(n){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=getComputedStyle(n),o=n.getBoundingClientRect(),i=o.x,a=o.y,u=o.width,c=o.height,f=(r?n.parentElement:document.body).getBoundingClientRect(),d={layout:{x:i=(i-f.x+u/2)/f.width,y:a=(a-f.y+c/2)/f.height,width:u,height:c,parentWidth:f.width,parentHeight:f.height}},h=s(l);try{for(h.s();!(t=h.n()).done;){var y=t.value;d[y]=e[y]}}catch(n){h.e(n)}finally{h.f()}return Object.assign(d,v(e.transform)),d},x=function(n,t){return new Array(t).fill(0).map((function(t,r){return r<n.length?n[r]:n[n.length-1]}))},j=function(n,t){return n.filter((function(n){return!t.includes(n)}))},O=function(n,t){var r,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object.keys(t),o=s(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;p.null(t[i])||(n[i]=t[i])}}catch(n){o.e(n)}finally{o.f()}return n},P=function n(t,r,e){if(p.object(t)){var o={};for(var i in t)o[i]=n(t[i],r[i],e);return o}return p.number(t[0])&&p.number(r[0])?[e(t[0],r[0]),t[1]]:r},k=function(n,t){for(var r in t){var e=f[r]||f.default;n[r]=r in n?P(n[r],t[r],e):t[r]}},A=function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250;return function(){var r=Date.now();n.LivelyTimestamp-r<t||(n.LivelyTimestamp=r,n())}};function S(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 M(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?S(Object(e),!0).forEach((function(t){r(n,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):S(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}function I(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 D(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 D(n,t)}(n))||t&&n&&"number"==typeof n.length){r&&(n=r);var e=0,o=function(){};return{s:o,n:function(){return e>=n.length?{done:!0}:{done:!1,value:n[e++]}},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,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,i=n},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function D(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 C=function n(r,e){var o,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(p.null(r))return null;if("scale"!==e||i||p.object(r)||(r={x:r,y:r}),p.object(r)){var c,l=Object.keys(r),f=I(a);try{for(f.s();!(c=f.n()).done;){var s=c.value;if(y(r,s)){l=s;break}}}catch(n){f.e(n)}finally{f.f()}r=M({},r);var d,h=I(l);try{for(h.s();!(d=h.n()).done;){var b=d.value,g=e in u?u[e][b]:u[b];r[b]=b in r?n(r[b],e,!0):g}}catch(n){h.e(n)}finally{h.f()}return r}if(p.string(r)){if(p.hex(r))return H(r);if(p.rgb(r))return E(r);var v=z(r),m=t(v,2);r=m[0],"%"==(o=m[1])&&(r/=100)}return[r,o=p.number(r)?$.normalize(o,e):null]},H=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 o=e[1],i=e[2],a=e[3],u=e[4],c=function(n){return[p.null(n)?255:parseInt(n.padStart(2,n),16),null]};return{r:c(o),g:c(i),b:c(a),a:c(u)}},E=function(n){var r=n.match(/^rgba?\((\d+)\D+(\d+)\D+(\d+)\D*(\d+)?\)/i),e=t(r,5);e[0];var o=e[1],i=e[2],a=e[3],u=e[4],c=function(n){return[p.null(n)?255:parseInt(n),null]};return{r:c(o),g:c(i),b:c(a),a:c(u)}},T=function(n,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object.keys(n);return r.map((function(t){return B(n[t])})).join(t)},W=function(n){var t=p.object(n)?n:{},r=t.x,e=void 0===r?.5:r,o=t.y,i=void 0===o?.5:o;if(p.string(n))switch(n){case"left":e=0;break;case"right":e=1;break;case"top":i=0;break;case"bottom":i=1}return{x:e,y:i}},z=function(n){var t=n.toString().match(/^([\d.]+)([^\d.]*)$/i);return t?[parseFloat(t[1]),t[2]||null]:[n,null]},B=function(n){return("%"==n[1]?100*n[0]:n[0])+(p.null(n[1])?"":n[1])},$={emtopx:function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.body;return n*parseFloat(getComputedStyle(t).fontSize)},remtopx:function(n){return $.emtopx(n)},vwtopx:function(n){return n*window.innerWidth},vhtopx:function(n){return n*window.innerHeight},vmintopx:function(n){return n*Math.min(window.innerWidth,window.innerHeight)},vmaxtopx:function(n){return n*Math.max(window.innerWidth,window.innerHeight)},radtodeg:function(n){return 180*n/Math.PI},fromProperty:function(n){return n in i?i[n]:i.default},toBase:function(n,t,r){if(p.object(n)){var e={};for(var o in n)e[o]=$.toBase(n[o],t);return e}if(!p.number(n[0]))return n;var i=$.fromProperty(t);if(p.null(n[1])&&!p.null(i))return[n[0],i];var a=$["".concat(n[1],"to").concat(i)];return a?[a(n[0],r),i]:n},normalize:function(n,t){return o.includes(n)||p.null(n)&&t in i?n:$.fromProperty(t)}},R=function(n){return"inset(".concat(T(n," ",["top","right","bottom","left"]),")")},F={origin:["transformOrigin"],length:["strokeDashoffset"],clip:["clipPath","webkitClipPath"],transformOrigin:function(n){return"".concat(100*n.x,"% ").concat(100*n.y,"%")},strokeDashoffset:function(n){return 1-n[0]},clipPath:R,webkitClipPath:R},L={bind:function(n,t){n.origin=n.origin||n;var r=function(){for(var r,e=arguments.length,o=new Array(e),i=0;i<e;i++)o[i]=arguments[i];return(r=n.origin).call.apply(r,[t].concat(o))};return r.origin=n.origin,r},create:function(n){var t=L.bind((function(n){if(p.function(n)){var r=L.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 p.function(n)&&p.function(n.set)}},U=L;export{F as A,u as D,U as L,f as M,e as P,c as T,$ as U,P as a,B as b,b as c,O as d,C as e,g as f,m as g,y as h,p as i,W as j,w as k,l,k as m,T as o,x as p,j as s,A as t,h as x};
@@ -1,36 +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
- play(animationName: string, { callback, reverse, immediate, cascade, groupAdjust, cascadeDelay, staggerDelay }?: {
27
- callback?: Function;
28
- reverse?: boolean;
29
- immediate?: boolean;
30
- cascade?: boolean;
31
- groupAdjust?: number;
32
- cascadeDelay?: number;
33
- staggerDelay?: number;
34
- }): Promise<void>;
35
-
36
- }
@@ -1 +0,0 @@
1
- export function useAnimation(initial: any): [object, Function];
package/types/morph.d.ts DELETED
@@ -1,35 +0,0 @@
1
- import React from 'react';
2
-
3
- interface MorphProps {
4
- active?: boolean;
5
- group?: number;
6
- useLayout?: boolean;
7
- interpolate?: string;
8
- duration?: number;
9
- ignore?: string[];
10
- }
11
-
12
- export class Morph extends React.Component<MorphProps> {
13
-
14
- private static properties;
15
- private static layoutProperties;
16
-
17
- private layoutUpdate;
18
-
19
- private update;
20
-
21
- private setUniqueId;
22
-
23
- private morph;
24
-
25
- private createAnimations;
26
-
27
- private createAnimation;
28
-
29
- private createMorphAnimation;
30
-
31
- private createUnmorphAnimation;
32
-
33
- private getChildren;
34
-
35
- }