troika-core
Advanced tools
Comparing version 0.42.0 to 0.43.0
@@ -0,0 +0,0 @@ import Facade from '../../src/facade/Facade.js' |
@@ -0,0 +0,0 @@ import Facade from '../../src/facade/Facade.js' |
@@ -0,0 +0,0 @@ import {_assign, assign, assignIf, forOwn, getIdForObject, createClassExtender, isReactElement} from '../src/utils.js' |
@@ -6,2 +6,11 @@ # Change Log | ||
# [0.43.0](https://github.com/protectwise/troika/compare/v0.42.0...v0.43.0) (2021-09-20) | ||
**Note:** Version bump only for package troika-core | ||
# [0.42.0](https://github.com/protectwise/troika/compare/v0.41.2...v0.42.0) (2021-05-17) | ||
@@ -8,0 +17,0 @@ |
@@ -1,59 +0,52 @@ | ||
'use strict';(function(p,A){"object"===typeof exports&&"undefined"!==typeof module?A(exports,require("troika-animation"),require("react"),require("prop-types")):"function"===typeof define&&define.amd?define(["exports","troika-animation","react","prop-types"],A):(p="undefined"!==typeof globalThis?globalThis:p||self,A(p.troika_core={},p.troika_animation,p.React,p.PropTypes))})(this,function(p,A,v,C){function P(a){return a&&"object"===typeof a&&"default"in a?a:{"default":a}}function Q(){for(var a=arguments, | ||
c=arguments[0],d=1,b=arguments.length;d<b;d++){var e=a[d];if(e)for(var h in e)e.hasOwnProperty(h)&&(c[h]=e[h])}return c}function R(){for(var a=arguments,c=arguments[0],d=1,b=arguments.length;d<b;d++){var e=a[d];if(e)for(var h in e)e.hasOwnProperty(h)&&!c.hasOwnProperty(h)&&(c[h]=e[h])}return c}function S(a,c){if(c)for(var d in c)c.hasOwnProperty(d)&&(a[d]&&"object"===typeof a[d]&&"object"===typeof c[d]?S(a[d],c[d]):a[d]=c[d])}function G(a,c){var d=new WeakMap;return function(b){var e=d.get(b);e|| | ||
(e=c(b),d.set(b,e));return e}}function T(a){return(a=a.$$typeof)&&a.toString&&"Symbol(react.element)"===a.toString()||!1}function da(a,c){return"paused"===a?void 0:Infinity===c?"Infinity":c}function ea(a,c){return a.time-c.time}function H(a){return"onDoubleClick"===a?"dblclick":a.replace(/^on/,"").toLowerCase()}function fa(){function a(b,e,d,a){try{b.call(e,d,a)}catch(f){console.error(f)}}var c=this,d=Object.create(null);this.addListenerForFacade=function(b,e,a){e=d[e]||(d[e]={count:0,byFacadeId:Object.create(null)}); | ||
b=b.$facadeId;var c=e.byFacadeId[b];c?Array.isArray(c)?-1===c.indexOf(a)&&(e.count++,c.push(a)):c!==a&&(e.count++,e.byFacadeId[b]=[c,a]):(e.count++,e.byFacadeId[b]=a)};this.removeListenerForFacade=function(b,e,a){e=d[e];b=b.$facadeId;var c=e&&e.byFacadeId[b];c===a?(e.count--,delete e.byFacadeId[b]):Array.isArray(c)&&(a=c.indexOf(a),-1<a&&(e.count--,1===c.length?delete e.byFacadeId[b]:c.splice(a,1)))};this.removeAllListenersForFacade=function(b){b=b.$facadeId;for(var e in d){var a=d[e].byFacadeId[b]; | ||
a&&(d[e].count-=Array.isArray(a)?a.length:1,delete d[e].byFacadeId[b])}};this.hasFacadeListenersOfType=function(b,e){return d[e]?!!d[e].byFacadeId[b.$facadeId]:!1};this.hasAnyListenersOfType=function(b){return d[b]?0<d[b].count:!1};this.findBubblingEventTarget=function(b,e){for(;b;){if(c.hasFacadeListenersOfType(b,e))return b;b=b.parent}return null};this.forEachFacadeListenerOfType=function(b,e,c,g){e=d[e];b=b.$facadeId;if(e=e&&e.byFacadeId[b])if(Array.isArray(e))for(var h=0;h<e.length;h++)a(c,g, | ||
e[h],b);else a(c,g,e,b)};this.forEachListenerOfType=function(b,e,c){if((b=d[b])&&0<b.count)for(var g in b.byFacadeId){var h=b.byFacadeId[g];if(Array.isArray(h))for(var k=0;k<h.length;k++)a(e,c,h[k],g);else a(e,c,h,g)}};this.dispatchEventOnFacade=function(b,e){function a(b){b.call(d,e)}var d=b;for(e.target=b;d&&!e.propagationStopped;)if(e.currentTarget=d,c.forEachFacadeListenerOfType(d,e.type,a,null),e.bubbles)d=d.parent;else break}}function I(a){return"touchend"===a.type||"touchcancel"===a.type}function ha(a){a.stopPropagation(); | ||
a.preventDefault()}var r=P(v);v=P(C);var D=Object.assign||Q;C=function(){var a=new WeakMap,c=0;return function(d){var b=a.get(d);b||a.set(d,b="$id"+ ++c);return b}}();C=Object.freeze({__proto__:null,assign:D,_assign:Q,assignIf:R,assignDeep:S,forOwn:function(a,c,d){for(var b in a)a.hasOwnProperty(b)&&c.call(d,a[b],b,a)},getIdForObject:C,memoize:function(a){var c,d,b;return function(){var e=arguments,h=!c||this!==d||arguments.length!==c.length;if(!h)for(var g=0,f=arguments.length;g<f;g++)if(e[g]!== | ||
c[g]){h=!0;break}h&&(c=Array.prototype.slice.call(arguments),d=this,b=a.apply(this,arguments));return b}},createClassExtender:G,isReactElement:T});var l=function(a){this.$facadeId="facade"+ia++;this.parent=a};l.prototype.update=function(a){if(a&&"object"===typeof a){this.transition=a.transition;this.animation=a.animation;for(var c in a)a.hasOwnProperty(c)&&!l.isSpecialDescriptorProperty(c)&&(this[c]=a[c])}this.afterUpdate();this.requestRender()};l.prototype.afterUpdate=function(){var a=this.ref;a!== | ||
this._lastRef&&("function"===typeof this._lastRef&&this._lastRef.call(null,null),"function"===typeof a?(a.call(null,this),this._lastRef=a):this._lastRef=null)};l.prototype.notifyWorld=function(a,c){if(this.parent)this.parent.onNotifyWorld(this,a,c)};l.prototype.onNotifyWorld=function(a,c,d){var b=this._notifiableParent;if(b)b.onNotifyWorld.call(b,a,c,d);else{b=this.parent;for(var e=l.prototype.onNotifyWorld;b;){if(b.onNotifyWorld!==e){this._notifiableParent=b;b.onNotifyWorld(a,c,d);break}b=b.parent}}}; | ||
l.prototype.requestRender=function(){this.notifyWorld("needsRender")};l.prototype.traverse=function(a){a(this)};l.prototype.forEachChild=function(a){};l.prototype.addEventListener=function(a,c){this.notifyWorld("addEventListener",{type:a,handler:c})};l.prototype.removeEventListener=function(a,c){this.notifyWorld("removeEventListener",{type:a,handler:c})};l.prototype.dispatchEvent=function(a){this.notifyWorld("dispatchEvent",a)};l.prototype.destructor=function(){this.parent&&this.notifyWorld("removeAllEventListeners"); | ||
"function"===typeof this.ref&&this.ref.call(null,null);this.parent=this._notifiableParent=null};D(l.prototype,{ref:null,_lastRef:null,_notifiableParent:null});var ia=0,ja={key:1,facade:1,transition:1,animation:1};l.isSpecialDescriptorProperty=function(a){return ja.hasOwnProperty(a)};l.defineEventProperty=function(a,c,d){var b=c+"\u27a4handler";Object.defineProperty(a.prototype,c,{get:function(){return this[b]},set:function(e){var a=this[b];(e||null)!==(a||null)&&("function"===typeof a&&this.removeEventListener(d, | ||
a),"function"===typeof e&&this.addEventListener(d,e),this[b]=e)}})};var U=[null],V=G("animatable",function(a){function c(b,e){if(!d.prototype.hasOwnProperty(b)){for(var c=b+"\u27a4anim:actualValue",g=b+"\u27a4anim:actuallySet",f=b+"\u27a4anim:hasBeenSet",k=b+"\u27a4anim:tween",m,u,L=a.prototype;L;){var J=Object.getOwnPropertyDescriptor(L,b);if(J){u=J.set;m=J.get;if(u&&!m||m&&!u)throw Error("Animatable: property "+b+" has a custom "+(u?"setter":"getter")+" but no "+(u?"getter":"setter")+". Animatable properties must have both."); | ||
break}L=Object.getPrototypeOf(L)}var n=u?function(b){u.call(this,b);this[f]||(this[f]=!0)}:function(b){this[c]=b;this[f]||(this[f]=!0)};Object.defineProperty(d.prototype,g,{value:n});Object.defineProperty(d.prototype,b,{get:function(){return m?m.call(this):this[f]?this[c]:a.prototype[b]},set:function(a){var e=this;if(!this.animation$animatingProps||!this.animation$animatingProps[b]){var c=this.animation$runner,d=this.transition;if(d&&d[b]&&this[f]&&d.hasOwnProperty(b)){d=d[b];var g="spring"===d?"default": | ||
d.spring,h=this[k],u=!1;h?a!==h.toValue&&(g&&h.isSpring?h.toValue=a:(c.stop(h),u=!0)):a!==this[b]&&(u=!0);u&&(h=this[k]=g?new A.SpringTween(n.bind(this),this[b],a,g,0,d.delay||0):new A.Tween(n.bind(this),this[b],a,d.duration||750,d.delay||0,d.easing||"easeOutCubic",1,"forward",d.interpolate||"number"),h.onDone=function(){h=e[k]=null},c.start(h))}else n.call(this,a),(a=this[k])&&c.stop(a),this[k]=null}}})}e.hasOwnProperty(b)&&(e[b+"\u27a4anim:actualValue"]=e[b],e[b+"\u27a4anim:hasBeenSet"]=!0,delete e[b])} | ||
var d=function(b){function a(){for(var a=this,d=[],c=arguments.length;c--;)d[c]=arguments[c];b.apply(this,d);this.animation$runner=new A.Runner;this.animation$runner.onTick=function(){a.afterUpdate();a.requestRender()}}b&&(a.__proto__=b);a.prototype=Object.create(b&&b.prototype);a.prototype.constructor=a;var d={transition:{configurable:!0},animation:{configurable:!0}};d.transition.set=function(b){if(b)for(var a in b)b.hasOwnProperty(a)&&c(a,this);this.transition$descriptor=b};d.transition.get=function(){return this.transition$descriptor}; | ||
d.animation.set=function(b){if(this.animation$descriptor!==b){this.animation$descriptor=b;var a=this.animation$tweens||null,d=this.animation$tweens=b?Object.create(null):null,e=this.animation$runner,h=!1;b&&!Array.isArray(b)&&(U[0]=b,b=U);if(b)for(var g=0,J=b.length;g<J;g++){var n=b[g];if(n){var t=JSON.stringify(n,da);if(a&&t in a){var q=a[t];n.paused?e.pause(q):e.start(q);d[t]=q}else{h=0;var l=750,p="linear",r=1;q=[];var v="forward",w;for(w in n)if(n.hasOwnProperty(w))switch(w){case "duration":l= | ||
n[w];break;case "delay":h=n[w];break;case "easing":p=n[w];break;case "iterations":r=n[w];break;case "direction":v=n[w];break;default:var z="from"===w?0:"to"===w?100:parseFloat(w);if(!isNaN(z)&&0<=z&&100>=z){q.push({time:z/100,props:n[w]});for(var x in n[w])n[w].hasOwnProperty(x)&&(c(x,this),z=x+"\u27a4anim:tween",this[z]&&(e.stop(this[z]),this[z]=null))}}if(q.length){q.sort(ea);0<q[0].time&&q.unshift(R({time:0},q[0]));z=[];for(var y=1,D=q.length;y<D;y++){var C=q[y],B=C.props,E;for(E in B)if(B.hasOwnProperty(E)){for(var F= | ||
null,G=y;G--;)if(E in q[G].props){F=q[G];break}F&&(F=new A.Tween(this[E+"\u27a4anim:actuallySet"].bind(this),F.props[E],B[E],(C.time-F.time)*l,F.time*l,"linear",1,"forward",n.interpolate&&n.interpolate[E]||"number"),F.$$property=E,z.push(F))}}t=d[t]=new A.MultiTween(z,l,h,p,r,v);n.paused||e.start(t);if(0===h){n=q[0].props;for(var H in n)if(n.hasOwnProperty(H))this[H+"\u27a4anim:actuallySet"](n[H])}}h=!0}}}if(a)for(var K in a)d&&d[K]||(b=a[K],b.gotoEnd(),e.stop(b),h=!0);if(h)if(d){a=this.animation$animatingProps= | ||
Object.create(null);for(var I in d)for(e=d[I].tweens,K=e.length;K--;)a[e[K].$$property]=!0}else this.animation$animatingProps=null}};d.animation.get=function(){return this.animation$descriptor};a.prototype.destructor=function(){var a=this,d=this.animation$runner;if(this.exitAnimation&&!this.parent.isDestroying){d.stopAll();this.animation=this.exitAnimation;this.exitAnimation=this.transition=null;var c=d.onTick;d.onTick=function(){a.parent&&!a.parent.isDestroying?c():(d.onDone=null,a.destructor())}; | ||
d.onDone=function(){a.requestRender();a.destructor()}}else d.destructor(),b.prototype.destructor.call(this)};Object.defineProperties(a.prototype,d);return a}(a);return d}),W=G("pointerStates",function(a){function c(b,d){var c=b+"\u27a4pntr:hasBeenSet";d[c]||(d[b+"\u27a4pntr:baseValue"]=d[b],delete d[b],d[c]=!0);if(!m.prototype.hasOwnProperty(b)){k[b]=1;var e=b+"\u27a4pntr:baseValue",h=b+"\u27a4pntr:appliedValue";Object.defineProperty(m.prototype,b,{get:function(){a:{var d=a.prototype;if(b in d)for(;d;){var c= | ||
Object.getOwnPropertyDescriptor(d,b);if(c&&c.get){d=c.get;break a}d=Object.getPrototypeOf(d)}d=null}return d?d.call(this):h in this?this[h]:this[e]},set:function(b){this[e]=b}})}}function d(b,d,c){a:{var e=a.prototype;if(d in e)for(;e;){var h=Object.getOwnPropertyDescriptor(e,d);if(h&&h.set){e=h.set;break a}e=Object.getPrototypeOf(e)}e=null}e?e.call(b,c):b[d+"\u27a4pntr:appliedValue"]=c}function b(b){b.currentTarget["\u27a4pntr:isHovering"]=!0;f(b)}function e(b){b.currentTarget["\u27a4pntr:isHovering"]= | ||
b.currentTarget["\u27a4pntr:isActive"]=!1;f(b)}function h(b){b.currentTarget["\u27a4pntr:isActive"]=!0;f(b)}function g(b){b.currentTarget["\u27a4pntr:isActive"]=!1;f(b)}function f(b){b=b.currentTarget;for(var d=b.parent;d&&d.shouldUpdateChildren();)d.isPointerStateAware&&(b=d),d=d.parent;b.afterUpdate();b.requestRender()}var k=Object.create(null),m=function(a){function f(d){a.call(this,d);this.addEventListener("mouseover",b);this.addEventListener("mouseout",e);this.addEventListener("mousedown",h); | ||
this.addEventListener("mouseup",g)}a&&(f.__proto__=a);f.prototype=Object.create(a&&a.prototype);f.prototype.constructor=f;f.prototype.afterUpdate=function(){this._applyPointerStates();a.prototype.afterUpdate.call(this)};f.prototype._applyPointerStates=function(){var b=this.pointerStates,a=b&&this["\u27a4pntr:isHovering"]&&b.hover||null,e=b&&this["\u27a4pntr:isActive"]&&b.active||null;b=this["\u27a4pntr:lastAppliedValues"]||k;if(a=this["\u27a4pntr:lastAppliedValues"]=a||e?D(Object.create(null),a,e): | ||
null)for(var h in a)c(h,this),d(this,h,a[h]);if(b)for(var g in b)a&&g in a||d(this,g,this[g+"\u27a4pntr:baseValue"])};return f}(a);Object.defineProperty(m.prototype,"isPointerStateAware",{value:!0});return m}),ka=function(a){function c(d){a.call(this,d);this._orderedItemKeys=[]}a&&(c.__proto__=a);c.prototype=Object.create(a&&a.prototype);c.prototype.constructor=c;c.prototype.afterUpdate=function(){var d=this.data,b=this.template,e=d&&d.length&&Array.isArray(d);if("production"!==process.env.NODE_ENV){if(d&& | ||
!Array.isArray(d))throw Error('ListFacade "data" must be an array.');if(!b||"object"!==typeof b)throw Error('ListFacade "template" must be an object.');if(!b||"function"!==typeof b.key)throw Error('ListFacade template must define a "key" function.');if(!b||"function"!==typeof b.facade)throw Error('ListFacade template must define a "facade".');}if(this.shouldUpdateChildren()){var c=this._itemsDict||null,g=this._itemsDict=e?Object.create(null):null,f=this._orderedItemKeys;if(e){f.length=d.length;e= | ||
0;for(var k=d.length;e<k;e++){var m=d[e],u=b.key(m,e,d),l=b.facade;if("production"!==process.env.NODE_ENV){if(null==u)throw Error('ListFacade template "key" function must return a key.');g[u]&&console.warn("Duplicate key in list: "+u)}for(;g[u];)u+="|dupe";var p="function"===typeof b.transition?b.transition(m,e,d):b.transition,n="function"===typeof b.animation?b.animation(m,e,d):b.animation,t="function"===typeof b.exitAnimation?b.exitAnimation(m,e,d):b.exitAnimation;if(p||n||t)l=V(l);t=b.pointerStates; | ||
if("function"===t?t(m,e,d):t)l=W(l);(t=c&&c[u])&&t.constructor===l?l=t:(t&&t.destructor(),l=new l(this));l.transition=p;l.animation=n;for(var q in b)b.hasOwnProperty(q)&&!a.isSpecialDescriptorProperty(q)&&(l[q]="function"===typeof b[q]?b[q](m,e,d):b[q]);l.afterUpdate();g[u]=l;f[e]=u}}if(c)for(var r in c)g&&g[r]||c[r].destructor()}a.prototype.afterUpdate.call(this)};c.prototype.shouldUpdateChildren=function(){return!0};c.prototype.traverse=function(a,b){a.call(b,this);for(var d=this._orderedItemKeys, | ||
c=this._itemsDict,g=0,f=d.length;g<f;g++)c[d[g]].traverse(a,b)};c.prototype.forEachChild=function(a,b){for(var d=this._orderedItemKeys,c=this._itemsDict,g=0,f=d.length;g<f;g++)a.call(b,c[d[g]],d[g])};c.prototype.destructor=function(){this.isDestroying=!0;var d=this._itemsDict;if(d)for(var b in d)d[b].destructor();a.prototype.destructor.call(this)};return c}(l),X=[null],M=function(a){function c(d){a.call(this,d);this.children=null;this._orderedChildKeys=[]}a&&(c.__proto__=a);c.prototype=Object.create(a&& | ||
a.prototype);c.prototype.constructor=c;c.prototype.afterUpdate=function(){this.shouldUpdateChildren()&&this.updateChildren(this.describeChildren());a.prototype.afterUpdate.call(this)};c.prototype.describeChildren=function(){return this.children};c.prototype.shouldUpdateChildren=function(){return!0};c.prototype.updateChildren=function(d){var b=this._childrenDict||null,c=this._childrenDict=null,h=this._orderedChildKeys;h.length=0;if(d){Array.isArray(d)||(X[0]=d,d=X);for(var g=0,f=d.length;g<f;g++){var k= | ||
d[g];if(k){c||(c=this._childrenDict=Object.create(null));var m=T(k),l=m?k.props:k;m=m?k.type:k.facade;k=k.key;if(!k){var p=0;do k="auto:"+m.name+":"+p++;while(c[k])}if("production"!==process.env.NODE_ENV&&"function"!==typeof m)throw Error('All scene objects must have a "facade" property pointing to a class/constructor');if(c[k])for(console.warn("Duplicate key in children: "+k);c[k];)k+="|dupe";p=l.transition;var r=l.animation;if(p||r||l.exitAnimation)m=V(m);l.pointerStates&&(m=W(m));var n=b&&b[k]; | ||
n&&n.constructor===m?m=n:(n&&n.destructor(),m=new m(this));m.transition=p;m.animation=r;for(var t in l)l.hasOwnProperty(t)&&!a.isSpecialDescriptorProperty(t)&&(m[t]=l[t]);c[k]=m;h.push(k);m.afterUpdate()}}}if(b)for(var q in b)c&&c[q]||b[q].destructor()};c.prototype.getChildByKey=function(a){var b=this._childrenDict;return b&&b[a]||null};c.prototype.traverse=function(a,b){a.call(b,this);for(var d=this._orderedChildKeys,c=this._childrenDict,g=0,f=d.length;g<f;g++)c[d[g]].traverse(a,b)};c.prototype.forEachChild= | ||
function(a,b){for(var d=this._orderedChildKeys,c=this._childrenDict,g=0,f=d.length;g<f;g++)a.call(b,c[d[g]],d[g])};c.prototype.destructor=function(){this.isDestroying=!0;var d=this._childrenDict;if(d)for(var b in d)d[b].destructor();a.prototype.destructor.call(this)};return c}(l),x="onMouseOver onMouseOut onMouseMove onDragStart onDrag onDragEnter onDragOver onDragLeave".split(" "),B="onMouseDown onMouseUp onClick onDoubleClick onDrop onDragEnd onWheel".split(" "),Y=B.map(H),Z=x.map(H);x=x.concat(B); | ||
var aa=Z.concat(Y),N=function(a){function c(){a.apply(this,arguments)}a&&(c.__proto__=a);c.prototype=Object.create(a&&a.prototype);c.prototype.constructor=c;c.prototype.interceptsPointerEvents=function(a){if(!1===this.pointerEvents)return!1;if(this.pointerEvents)return!0;for(var b=0,d=aa.length;b<d;b++)if(a.hasFacadeListenersOfType(this,aa[b]))return!0};return c}(M);Object.defineProperty(N.prototype,"isPointerEventTarget",{value:!0});x.forEach(function(a){l.defineEventProperty(N,a,H(a))});var la= | ||
{},ma=["mousemove","mouseout","touchmove"],na="mousedown mouseup click dblclick wheel touchstart touchend touchcancel".split(" "),ba=["mouseup","touchend","touchcancel"],oa={touchstart:"mousedown",touchend:"mouseup",touchcancel:"mouseup"},pa="clientX clientY screenX screenY pageX pageY".split(" "),y=function(a,c,d,b,e){var h=this,g;for(g in a)"function"!==typeof a[g]&&(this[g]=a[g]);this.target=d;this.relatedTarget=b;this.type=c;this.nativeEvent=a;D(this,e);if(a.touches){var f=I(a)?a.changedTouches: | ||
a.touches;1===f.length&&pa.forEach(function(b){h[b]=f[0][b]})}};y.prototype.preventDefault=function(){this.defaultPrevented=!0;this.nativeEvent.preventDefault()};y.prototype.stopPropagation=function(){this.propagationStopped=!0;this.nativeEvent.stopPropagation()};x=function(a){function c(b){a.call(this,null);this.width=this.height=1;this._element=b;this._htmlOverlays=Object.create(null);this.eventRegistry=new fa;this._onPointerMotionEvent=this._onPointerMotionEvent.bind(this);this._onPointerActionEvent= | ||
this._onPointerActionEvent.bind(this);this._onDropEvent=this._onDropEvent.bind(this);this._togglePointerListeners(!0)}a&&(c.__proto__=a);c.prototype=Object.create(a&&a.prototype);c.prototype.constructor=c;var d={renderingScheduler:{configurable:!0}};c.prototype.afterUpdate=function(){this._queueRender();a.prototype.afterUpdate.call(this)};c.prototype.onNotifyWorld=function(b,a,d){(a=this._notifyWorldHandlers[a])&&a.call(this,b,d)};c.prototype._isContinuousRender=function(){return this.continuousRender}; | ||
d.renderingScheduler.set=function(b){b=b||window;if(b!==this.renderingScheduler){var a=this._nextFrameTimer;a&&(this.renderingScheduler.cancelAnimationFrame(a),this._nextFrameTimer=null);this._renderingScheduler=b}};d.renderingScheduler.get=function(){return this._renderingScheduler||window};c.prototype._queueRender=function(){var b=this;if(!this._nextFrameTimer){var a=this._nextFrameHandler||(this._nextFrameHandler=function(){for(var a=[],d=arguments.length;d--;)a[d]=arguments[d];d=b.onStatsUpdate; | ||
var c=b.onBeforeRender,e=b.onAfterRender,l=d&&Date.now();c&&c(b);b.doRender.apply(b,a);d&&(a=Date.now(),d({"Render CPU Time (ms)":a-l,"Time Between Frames (ms)":b._lastFrameTime?a-b._lastFrameTime:"?",FPS:b._lastFrameTime?Math.round(1E3/(a-b._lastFrameTime)):"?"}),b._lastFrameTime=a);b._doRenderHtmlItems();e&&e(b);b._nextFrameTimer=null;b._isContinuousRender()&&b._queueRender()});this._nextFrameTimer=this.renderingScheduler.requestAnimationFrame(a)}};c.prototype.doRender=function(){};c.prototype.getFacadeUserSpaceXYZ= | ||
function(b){};c.prototype._doRenderHtmlItems=function(){if(this.renderHtmlItems){var b=[],a=this._htmlOverlays,d;for(d in a){var c=a[d],f=this.getFacadeUserSpaceXYZ(c);0<=f.z&&(f.key=c.$facadeId,f.html=c.html,f.exact=c.exact,b.push(f))}this.renderHtmlItems(b)}};c.prototype._normalizePointerEvent=function(b){};c.prototype._onPointerMotionEvent=function(b){this._normalizePointerEvent(b);var a=this._getPointerEventState(b);if(Z.some(this.eventRegistry.hasAnyListenersOfType)){var d="mouseout"===b.type|| | ||
I(b)?null:this._findHoverTarget(b),c=a.hoveredFacade,f=a.hoveredFacade=d&&d.facade,k=a.dragInfo;k&&(k.dragStartFired||(this._firePointerEvent("dragstart",k.dragStartEvent,k.draggedFacade,null,d),k.dragStartFired=!0),this._firePointerEvent("drag",b,k.draggedFacade,null,d));f!==c&&(c&&(this._firePointerEvent("mouseout",b,c,f,d),k&&this._firePointerEvent("dragleave",b,c,f,d)),f&&(this._firePointerEvent("mouseover",b,f,c,d),k&&this._firePointerEvent("dragenter",b,f,c,d)));f&&(this._firePointerEvent("mousemove", | ||
b,f,null,d),k&&this._firePointerEvent("dragover",b,f,null,d))}(d=a.tapInfo)&&"touchmove"===b.type&&(b=b.changedTouches[0])&&10<Math.sqrt(Math.pow(b.clientX-d.x,2)+Math.pow(b.clientY-d.y,2))&&(a.tapInfo=null)};c.prototype._onPointerActionEvent=function(b){this._normalizePointerEvent(b);-1<ba.indexOf(b.type)&&this._onDropEvent(b);"touchstart"===b.type&&(1===b.touches.length&&this._onPointerMotionEvent(b),this._enableContextMenu(!1));var a=this.eventRegistry;if(a.hasAnyListenersOfType("dragstart")|| | ||
Y.some(a.hasAnyListenersOfType)){var d=this._findHoverTarget(b),c=d&&d.facade;if(c){var f=this._getPointerEventState(b);this._firePointerEvent(oa[b.type]||b.type,b,c,null,d);if(a.findBubblingEventTarget(c,"click")||a.findBubblingEventTarget(c,"dblclick")){var k=f.tapInfo;"touchstart"===b.type&&1===b.touches.length?f.tapInfo={facade:c,x:b.touches[0].clientX,y:b.touches[0].clientY,startTime:Date.now(),isDblClick:k&&300>Date.now()-k.startTime}:k&&k.facade===c&&"touchend"===b.type&&0===b.touches.length&& | ||
1===b.changedTouches.length&&300>Date.now()-k.startTime&&(this._firePointerEvent("click",b,c,null,d),k.isDblClick&&this._firePointerEvent("dblclick",b,c,null,d))}if("mousedown"===b.type||"touchstart"===b.type)if(a=a.findBubblingEventTarget(c,"dragstart"))d=new y(b,"dragstart",a,null,{intersection:d}),f.dragInfo={draggedFacade:a,dragStartFired:!1,dragStartEvent:d},this._toggleDropListeners(!0)}b.preventDefault()}I(b)&&(1===b.changedTouches.length&&this._onPointerMotionEvent(b),this._enableContextMenu(!0))}; | ||
c.prototype._onDropEvent=function(b){var a=this._getPointerEventState(b),d=a.dragInfo;if(d){this._normalizePointerEvent(b);var c=this._findHoverTarget(b),f=c&&c.facade;f&&this._firePointerEvent("drop",b,f,null,c);this._firePointerEvent("dragend",b,d.draggedFacade,null,c);this._toggleDropListeners(!1);a.dragInfo=null}};c.prototype._firePointerEvent=function(b,a,d,c,f){b=a instanceof y?a:new y(a,b,d,c,{bubbles:!0,intersection:f});this.eventRegistry.dispatchEventOnFacade(d,b)};c.prototype._getPointerEventState= | ||
function(b){var a=this._pointerEventStates||(this._pointerEventStates=new WeakMap);b=b.eventSource||la;var d=a.get(b);d||a.set(b,d={});return d};c.prototype._toggleDropListeners=function(b){var a=this;ba.forEach(function(d){document[(b?"add":"remove")+"EventListener"](d,a._onDropEvent,!0)})};c.prototype._togglePointerListeners=function(b){var a=this,d=this._element;if(d&&b!==this._pointerListenersAttached){var c=(b?"add":"remove")+"EventListener";ma.forEach(function(b){d[c](b,a._onPointerMotionEvent, | ||
!1)});na.forEach(function(b){d[c](b,a._onPointerActionEvent,!1)});this._pointerListenersAttached=b}};c.prototype._enableContextMenu=function(b){var a=this._element;if(a)a[(b?"remove":"add")+"EventListener"]("contextmenu",ha,!0)};c.prototype.getFacadesAtEvent=function(b,a){throw Error("getFacadesAtEvent: no impl");};c.prototype._findHoverTarget=function(b){var a=this;if(b.touches&&1<b.touches.length)return null;if(b=this.getFacadesAtEvent(b,function(b){return b.isPointerEventTarget&&b.interceptsPointerEvents(a.eventRegistry)})){for(var d= | ||
b[0],c=1;c<b.length;c++)if(b[c].distance<d.distance||b[c].distance===d.distance&&(b[c].distanceBias||0)<(d.distanceBias||0))d=b[c];return d}return null};c.prototype.destructor=function(){this._nextFrameTimer&&this.renderingScheduler.cancelAnimationFrame(this._nextFrameTimer);this._togglePointerListeners(!1);this._toggleDropListeners(!1);a.prototype.destructor.call(this)};Object.defineProperties(c.prototype,d);return c}(M);Object.defineProperty(x.prototype,"isWorld",{value:!0});x.prototype._notifyWorldHandlers= | ||
{needsRender:function(){this._queueRender()},addEventListener:function(a,c){this.eventRegistry.addListenerForFacade(a,c.type,c.handler)},removeEventListener:function(a,c){this.eventRegistry.removeListenerForFacade(a,c.type,c.handler)},removeAllEventListeners:function(a){this.eventRegistry.removeAllListenersForFacade(a)},dispatchEvent:function(a,c){c instanceof y||(c=new y(c,c.type,c.target,c.relatedTarget));this.eventRegistry.dispatchEventOnFacade(a,c)},addHtmlOverlay:function(a){this._htmlOverlays[a.$facadeId]= | ||
a},removeHtmlOverlay:function(a){delete this._htmlOverlays[a.$facadeId]},statsUpdate:function(a,c){(a=this.onStatsUpdate)&&a(c)}};var qa={position:"absolute",top:0,right:0,bottom:0,left:0,pointerEvents:"none",transformStyle:"preserve-3d"},O=function(a){function c(){a.apply(this,arguments)}a&&(c.__proto__=a);c.prototype=Object.create(a&&a.prototype);c.prototype.constructor=c;c.prototype.shouldComponentUpdate=function(a){return a.html!==this.props.html||!0===(a.html.props&&a.html.props.shouldUpdateOnMove)}; | ||
c.prototype.render=function(){var a=this.props.html;return"string"===typeof a?r["default"].createElement("span",null,a):r["default"].cloneElement(a)};return c}(r["default"].Component);O.displayName="Canvas3D.HtmlOverlayContent";O.propTypes={html:v["default"].node};var ca=function(a){function c(d){a.call(this,d);this.setItems=this.setItems.bind(this);this.state={items:null}}a&&(c.__proto__=a);c.prototype=Object.create(a&&a.prototype);c.prototype.constructor=c;c.prototype.shouldComponentUpdate=function(a, | ||
b){a=this.state;return b.items&&b.items.length||a.items&&a.items.length};c.prototype.setItems=function(a){var b=this.state.items;(a&&a.length||b&&b.length)&&this.setState({items:a||null})};c.prototype.render=function(){var a=this.state.items,b=Math.round;return a&&a.length?r["default"].createElement("div",{className:"troika_html_overlay",style:qa},a.map(function(a){var d=a.key,c=a.html,e=a.x,k=a.y,l=a.z;a.exact||(e=b(e),k=b(k));return r["default"].createElement("div",{key:d,style:{position:"absolute", | ||
transform:"translate3d("+e+"px, "+k+"px, "+-l+"px)"}},r["default"].createElement(O,{html:c}))})):null};return c}(r["default"].Component);ca.displayName="Canvas3D.HtmlOverlay";var ra={position:"absolute",top:0,right:0,background:"rgba(0,0,0,.5)",font:"11px sans-serif",padding:10},sa=function(a){function c(d){a.call(this,d);this.state={stats:{}}}a&&(c.__proto__=a);c.prototype=Object.create(a&&a.prototype);c.prototype.constructor=c;c.prototype.setStats=function(a){this.setState({stats:a})};c.prototype.render= | ||
function(){var a=this.state.stats;return r["default"].createElement("div",{style:ra},Object.keys(a).sort().map(function(b){return r["default"].createElement("div",{key:b},b+": "+a[b])}))};return c}(r["default"].Component),ta={width:"100%",height:"100%"};B=function(a){function c(d){a.call(this,d);this._stats={};this.updateStats=this.updateStats.bind(this);this.renderHtmlItems=this.renderHtmlItems.bind(this);this._bindHtmlOverlayRef=this._bindHtmlOverlayRef.bind(this);this._bindCanvasRef=this._bindCanvasRef.bind(this); | ||
this._bindStatsRef=this._bindStatsRef.bind(this)}a&&(c.__proto__=a);c.prototype=Object.create(a&&a.prototype);c.prototype.constructor=c;c.prototype.componentDidUpdate=function(){this.updateWorld()};c.prototype.initWorld=function(a){a=new this.props.worldFacade(a);a.renderHtmlItems=this.renderHtmlItems;return a};c.prototype.updateWorld=function(){var a=this._world;if(a){var b=this.props,c=b.stats,h=c&&Date.now();a.width=b.width;a.height=b.height;a.pixelRatio=b.pixelRatio;a.continuousRender=b.continuousRender; | ||
a.onStatsUpdate=c?this.updateStats:null;D(a,b.worldProps);a.afterUpdate();c&&this.updateStats({"Last World Update (ms)":Date.now()-h})}};c.prototype.destroyWorld=function(){this._world&&(this._world.destructor(),delete this._world);clearTimeout(this._statsDelay)};c.prototype.renderHtmlItems=function(a){this._htmlOverlayRef&&this._htmlOverlayRef.setItems(a)};c.prototype.updateStats=function(a){var b=this;this._stats=D({},this._stats,a);this._statsDelay||(this._statsDelay=setTimeout(function(){b._statsDelay= | ||
null;var a=b._statsRef;a&&a.setStats(b._stats)},250))};c.prototype._bindHtmlOverlayRef=function(a){this._htmlOverlayRef=a};c.prototype._bindCanvasRef=function(a){if(a)try{this._world=this.initWorld(a),this.updateWorld()}catch(e){console.warn("Troika."+this.constructor.displayName+": world init failed, using fallback content.",e),this._failedWorldInit=!0,this._world=null,this.forceUpdate()}else this.destroyWorld();var b=this.props.onCanvasRef;b&&b(a)};c.prototype._bindStatsRef=function(a){this._statsRef= | ||
a};c.prototype.render=function(){var a=this.props;return r["default"].createElement("div",{className:"troika "+(a.className||""),style:{position:"relative",overflow:"hidden",width:a.width,height:a.height,cursor:a.cursor,userSelect:"none"}},this._failedWorldInit?this.props.children:r["default"].createElement("canvas",{className:"troika_canvas",ref:this._bindCanvasRef,style:a.canvasStyle||ta}),r["default"].createElement(ca,{ref:this._bindHtmlOverlayRef}),a.stats?r["default"].createElement(sa,{ref:this._bindStatsRef}): | ||
null)};return c}(r["default"].Component);B.commonPropTypes={width:v["default"].number.isRequired,height:v["default"].number.isRequired,pixelRatio:v["default"].number,worldFacade:v["default"].func,worldProps:v["default"].object,canvasStyle:v["default"].object,className:v["default"].string,continuousRender:v["default"].bool,onCanvasRef:v["default"].func,stats:v["default"].bool,cursor:v["default"].string};p.Facade=l;p.ListFacade=ka;p.ParentFacade=M;p.PointerEventTarget=N;p.ReactCanvasBase=B;p.WorldBaseFacade= | ||
x;p.utils=C;Object.defineProperty(p,"__esModule",{value:!0})}) | ||
'use strict';(function(q,v){"object"===typeof exports&&"undefined"!==typeof module?v(exports,require("troika-animation"),require("react"),require("prop-types")):"function"===typeof define&&define.amd?define(["exports","troika-animation","react","prop-types"],v):(q="undefined"!==typeof globalThis?globalThis:q||self,v(q.troika_core={},q.troika_animation,q.React,q.PropTypes))})(this,function(q,v,t,x){function I(a){return a&&"object"===typeof a&&"default"in a?a:{"default":a}}function J(){let a=arguments[0]; | ||
for(let b=1,c=arguments.length;b<c;b++){let d=arguments[b];if(d)for(let b in d)d.hasOwnProperty(b)&&(a[b]=d[b])}return a}function K(){let a=arguments[0];for(let b=1,c=arguments.length;b<c;b++){let d=arguments[b];if(d)for(let b in d)d.hasOwnProperty(b)&&!a.hasOwnProperty(b)&&(a[b]=d[b])}return a}function L(a,b){if(b)for(let c in b)b.hasOwnProperty(c)&&(a[c]&&"object"===typeof a[c]&&"object"===typeof b[c]?L(a[c],b[c]):a[c]=b[c])}function B(a,b){let c=new WeakMap;return function(a){let d=c.get(a);d|| | ||
(d=b(a),c.set(a,d));return d}}function M(a){return(a=a.$$typeof)&&a.toString&&"Symbol(react.element)"===a.toString()||!1}function Y(a,b){return"paused"===a?void 0:Infinity===b?"Infinity":b}function Z(a,b){return a.time-b.time}function C(a){return"onDoubleClick"===a?"dblclick":a.replace(/^on/,"").toLowerCase()}function aa(){function a(a,b,e,f){try{a.call(b,e,f)}catch(l){console.error(l)}}let b=Object.create(null);this.addListenerForFacade=(a,d,e)=>{d=b[d]||(b[d]={count:0,byFacadeId:Object.create(null)}); | ||
a=a.$facadeId;let c=d.byFacadeId[a];c?Array.isArray(c)?-1===c.indexOf(e)&&(d.count++,c.push(e)):c!==e&&(d.count++,d.byFacadeId[a]=[c,e]):(d.count++,d.byFacadeId[a]=e)};this.removeListenerForFacade=(a,d,e)=>{d=b[d];a=a.$facadeId;let c=d&&d.byFacadeId[a];c===e?(d.count--,delete d.byFacadeId[a]):Array.isArray(c)&&(e=c.indexOf(e),-1<e&&(d.count--,1===c.length?delete d.byFacadeId[a]:c.splice(e,1)))};this.removeAllListenersForFacade=a=>{a=a.$facadeId;for(let d in b){let c=b[d].byFacadeId[a];c&&(b[d].count-= | ||
Array.isArray(c)?c.length:1,delete b[d].byFacadeId[a])}};this.hasFacadeListenersOfType=(a,d)=>b[d]?!!b[d].byFacadeId[a.$facadeId]:!1;this.hasAnyListenersOfType=a=>b[a]?0<b[a].count:!1;this.findBubblingEventTarget=(a,b)=>{for(;a;){if(this.hasFacadeListenersOfType(a,b))return a;a=a.parent}return null};this.forEachFacadeListenerOfType=(c,d,e,f)=>{d=b[d];c=c.$facadeId;if(d=d&&d.byFacadeId[c])if(Array.isArray(d))for(let b=0;b<d.length;b++)a(e,f,d[b],c);else a(e,f,d,c)};this.forEachListenerOfType=(c,d, | ||
e)=>{if((c=b[c])&&0<c.count)for(let b in c.byFacadeId){let f=c.byFacadeId[b];if(Array.isArray(f))for(let c=0;c<f.length;c++)a(d,e,f[c],b);else a(d,e,f,b)}};this.dispatchEventOnFacade=(a,b)=>{function d(a){a.call(c,b)}let c=a;for(b.target=a;c&&!b.propagationStopped;)if(b.currentTarget=c,this.forEachFacadeListenerOfType(c,b.type,d,null),b.bubbles)c=c.parent;else break}}function D(a){return"touchend"===a.type||"touchcancel"===a.type}function ba(a){a.stopPropagation();a.preventDefault()}var r=I(t);t= | ||
I(x);let w=Object.assign||J;x=(()=>{let a=new WeakMap,b=0;return function(c){let d=a.get(c);d||a.set(c,d=`$id${++b}`);return d}})();x=Object.freeze({__proto__:null,assign:w,_assign:J,assignIf:K,assignDeep:L,forOwn:function(a,b,c){for(let d in a)a.hasOwnProperty(d)&&b.call(c,a[d],d,a)},getIdForObject:x,memoize:function(a){let b,c,d;return function(){let e=!b||this!==c||arguments.length!==b.length;if(!e)for(let a=0,d=arguments.length;a<d;a++)if(arguments[a]!==b[a]){e=!0;break}e&&(b=Array.prototype.slice.call(arguments), | ||
c=this,d=a.apply(this,arguments));return d}},createClassExtender:B,isReactElement:M});class u{constructor(a){this.$facadeId=`facade${ca++}`;this.parent=a}update(a){if(a&&"object"===typeof a){this.transition=a.transition;this.animation=a.animation;for(let b in a)a.hasOwnProperty(b)&&!u.isSpecialDescriptorProperty(b)&&(this[b]=a[b])}this.afterUpdate();this.requestRender()}afterUpdate(){let a=this.ref;a!==this._lastRef&&("function"===typeof this._lastRef&&this._lastRef.call(null,null),"function"===typeof a? | ||
(a.call(null,this),this._lastRef=a):this._lastRef=null)}notifyWorld(a,b){if(this.parent)this.parent.onNotifyWorld(this,a,b)}onNotifyWorld(a,b,c){let d=this._notifiableParent;if(d)d.onNotifyWorld.call(d,a,b,c);else{d=this.parent;let e=u.prototype.onNotifyWorld;for(;d;){if(d.onNotifyWorld!==e){this._notifiableParent=d;d.onNotifyWorld(a,b,c);break}d=d.parent}}}requestRender(){this.notifyWorld("needsRender")}traverse(a){a(this)}forEachChild(a){}addEventListener(a,b){this.notifyWorld("addEventListener", | ||
{type:a,handler:b})}removeEventListener(a,b){this.notifyWorld("removeEventListener",{type:a,handler:b})}dispatchEvent(a){this.notifyWorld("dispatchEvent",a)}destructor(){this.parent&&this.notifyWorld("removeAllEventListeners");"function"===typeof this.ref&&this.ref.call(null,null);this.parent=this._notifiableParent=null}}w(u.prototype,{ref:null,_lastRef:null,_notifiableParent:null});let ca=0,da={key:1,facade:1,transition:1,animation:1};u.isSpecialDescriptorProperty=function(a){return da.hasOwnProperty(a)}; | ||
u.defineEventProperty=function(a,b,c){let d=`${b}\u27a4handler`;Object.defineProperty(a.prototype,b,{get(){return this[d]},set(a){let b=this[d];(a||null)!==(b||null)&&("function"===typeof b&&this.removeEventListener(c,b),"function"===typeof a&&this.addEventListener(c,a),this[d]=a)}})};let N=[null],O=B("animatable",function(a){function b(b,e){if(!c.prototype.hasOwnProperty(b)){let d=`${b}\u27a4anim:actualValue`,e=`${b}\u27a4anim:actuallySet`,k=`${b}\u27a4anim:hasBeenSet`,g=`${b}\u27a4anim:tween`,m, | ||
h,n=a.prototype;for(;n;){let a=Object.getOwnPropertyDescriptor(n,b);if(a){h=a.set;m=a.get;if(h&&!m||m&&!h)throw Error(`Animatable: property ${b} has a custom ${h?"setter":"getter"} but no ${h?"getter":"setter"}. Animatable properties must have both.`);break}n=Object.getPrototypeOf(n)}let p=h?function(a){h.call(this,a);this[k]||(this[k]=!0)}:function(a){this[d]=a;this[k]||(this[k]=!0)};Object.defineProperty(c.prototype,e,{value:p});Object.defineProperty(c.prototype,b,{get(){return m?m.call(this):this[k]? | ||
this[d]:a.prototype[b]},set(a){if(!this.animation$animatingProps||!this.animation$animatingProps[b]){var d=this.animation$runner,c=this.transition;if(c&&c[b]&&this[k]&&c.hasOwnProperty(b)){c=c[b];let e="spring"===c?"default":c.spring,f=this[g],h=!1;f?a!==f.toValue&&(e&&f.isSpring?f.toValue=a:(d.stop(f),h=!0)):a!==this[b]&&(h=!0);h&&(f=this[g]=e?new v.SpringTween(p.bind(this),this[b],a,e,0,c.delay||0):new v.Tween(p.bind(this),this[b],a,c.duration||750,c.delay||0,c.easing||"easeOutCubic",1,"forward", | ||
c.interpolate||"number"),f.onDone=()=>{f=this[g]=null},d.start(f))}else p.call(this,a),(a=this[g])&&d.stop(a),this[g]=null}}})}e.hasOwnProperty(b)&&(e[`${b}\u27a4anim:actualValue`]=e[b],e[`${b}\u27a4anim:hasBeenSet`]=!0,delete e[b])}class c extends a{constructor(...a){super(...a);this.animation$runner=new v.Runner;this.animation$runner.onTick=()=>{this.afterUpdate();this.requestRender()}}set transition(a){if(a)for(let c in a)a.hasOwnProperty(c)&&b(c,this);this.transition$descriptor=a}get transition(){return this.transition$descriptor}set animation(a){if(this.animation$descriptor!== | ||
a){this.animation$descriptor=a;var c=this.animation$tweens||null,d=this.animation$tweens=a?Object.create(null):null,l=this.animation$runner,k=!1;a&&!Array.isArray(a)&&(N[0]=a,a=N);if(a)for(let e=0,f=a.length;e<f;e++){var g=a[e];if(g){var m=JSON.stringify(g,Y);if(c&&m in c){var h=c[m];g.paused?l.pause(h):l.start(h);d[m]=h}else{k=0;let a=750,c="linear",e=1;h=[];let f="forward";for(let d in g)if(g.hasOwnProperty(d))switch(d){case "duration":a=g[d];break;case "delay":k=g[d];break;case "easing":c=g[d]; | ||
break;case "iterations":e=g[d];break;case "direction":f=g[d];break;default:var n="from"===d?0:"to"===d?100:parseFloat(d);if(!isNaN(n)&&0<=n&&100>=n){h.push({time:n/100,props:g[d]});for(let a in g[d])g[d].hasOwnProperty(a)&&(b(a,this),n=a+"\u27a4anim:tween",this[n]&&(l.stop(this[n]),this[n]=null))}}if(h.length){h.sort(Z);0<h[0].time&&h.unshift(K({time:0},h[0]));n=[];for(let b=1,c=h.length;b<c;b++){let c=h[b],d=c.props;for(let e in d)if(d.hasOwnProperty(e)){var p=null;for(let a=b;a--;)if(e in h[a].props){p= | ||
h[a];break}p&&(p=new v.Tween(this[e+"\u27a4anim:actuallySet"].bind(this),p.props[e],d[e],(c.time-p.time)*a,p.time*a,"linear",1,"forward",g.interpolate&&g.interpolate[e]||"number"),p.$$property=e,n.push(p))}}m=d[m]=new v.MultiTween(n,a,k,c,e,f);g.paused||l.start(m);if(0===k){g=h[0].props;for(let a in g)if(g.hasOwnProperty(a))this[a+"\u27a4anim:actuallySet"](g[a])}}k=!0}}}if(c)for(var y in c)d&&d[y]||(a=c[y],a.gotoEnd(),l.stop(a),k=!0);if(k)if(d){c=this.animation$animatingProps=Object.create(null); | ||
for(let a in d)for(l=d[a].tweens,y=l.length;y--;)c[l[y].$$property]=!0}else this.animation$animatingProps=null}}get animation(){return this.animation$descriptor}destructor(){const a=this.animation$runner;if(this.exitAnimation&&!this.parent.isDestroying){a.stopAll();this.animation=this.exitAnimation;this.exitAnimation=this.transition=null;const b=a.onTick;a.onTick=()=>{this.parent&&!this.parent.isDestroying?b():(a.onDone=null,this.destructor())};a.onDone=()=>{this.requestRender();this.destructor()}}else a.destructor(), | ||
super.destructor()}}return c}),P=B("pointerStates",function(a){function b(b,c){const d=`${b}\u27a4pntr:hasBeenSet`;c[d]||(c[`${b}\u27a4pntr:baseValue`]=c[b],delete c[b],c[d]=!0);if(!m.prototype.hasOwnProperty(b)){g[b]=1;const c=`${b}\u27a4pntr:baseValue`,d=`${b}\u27a4pntr:appliedValue`;Object.defineProperty(m.prototype,b,{get(){a:{var e=a.prototype;if(b in e)for(;e;){let a=Object.getOwnPropertyDescriptor(e,b);if(a&&a.get){e=a.get;break a}e=Object.getPrototypeOf(e)}e=null}return e?e.call(this):d in | ||
this?this[d]:this[c]},set(a){this[c]=a}})}}function c(b,c,d){a:{var e=a.prototype;if(c in e)for(;e;){let a=Object.getOwnPropertyDescriptor(e,c);if(a&&a.set){e=a.set;break a}e=Object.getPrototypeOf(e)}e=null}e?e.call(b,d):b[`${c}\u27a4pntr:appliedValue`]=d}function d(a){a.currentTarget["\u27a4pntr:isHovering"]=!0;k(a)}function e(a){a.currentTarget["\u27a4pntr:isHovering"]=a.currentTarget["\u27a4pntr:isActive"]=!1;k(a)}function f(a){a.currentTarget["\u27a4pntr:isActive"]=!0;k(a)}function l(a){a.currentTarget["\u27a4pntr:isActive"]= | ||
!1;k(a)}function k(a){a=a.currentTarget;let b=a.parent;for(;b&&b.shouldUpdateChildren();)b.isPointerStateAware&&(a=b),b=b.parent;a.afterUpdate();a.requestRender()}const g=Object.create(null);class m extends a{constructor(a){super(a);this.addEventListener("mouseover",d);this.addEventListener("mouseout",e);this.addEventListener("mousedown",f);this.addEventListener("mouseup",l)}afterUpdate(){this._applyPointerStates();super.afterUpdate()}_applyPointerStates(){var a=this.pointerStates,d=a&&this["\u27a4pntr:isHovering"]&& | ||
a.hover||null;const e=a&&this["\u27a4pntr:isActive"]&&a.active||null;a=this["\u27a4pntr:lastAppliedValues"]||g;if(d=this["\u27a4pntr:lastAppliedValues"]=d||e?w(Object.create(null),d,e):null)for(let a in d)b(a,this),c(this,a,d[a]);if(a)for(let b in a)d&&b in d||c(this,b,this[`${b}\u27a4pntr:baseValue`])}}Object.defineProperty(m.prototype,"isPointerStateAware",{value:!0});return m});class ea extends u{constructor(a){super(a);this._orderedItemKeys=[]}afterUpdate(){let {data:a,template:b}=this;var c= | ||
a&&a.length&&Array.isArray(a);if("production"!==process.env.NODE_ENV){if(a&&!Array.isArray(a))throw Error('ListFacade "data" must be an array.');if(!b||"object"!==typeof b)throw Error('ListFacade "template" must be an object.');if(!b||"function"!==typeof b.key)throw Error('ListFacade template must define a "key" function.');if(!b||"function"!==typeof b.facade)throw Error('ListFacade template must define a "facade".');}if(this.shouldUpdateChildren()){let f=this._itemsDict||null,l=this._itemsDict=c? | ||
Object.create(null):null,k=this._orderedItemKeys;if(c){k.length=a.length;for(let g=0,m=a.length;g<m;g++){c=a[g];let h=b.key(c,g,a);var d=b.facade;if("production"!==process.env.NODE_ENV){if(null==h)throw Error('ListFacade template "key" function must return a key.');l[h]&&console.warn(`Duplicate key in list: ${h}`)}for(;l[h];)h+="|dupe";let m="function"===typeof b.transition?b.transition(c,g,a):b.transition,p="function"===typeof b.animation?b.animation(c,g,a):b.animation;var e="function"===typeof b.exitAnimation? | ||
b.exitAnimation(c,g,a):b.exitAnimation;if(m||p||e)d=O(d);e=b.pointerStates;if("function"===e?e(c,g,a):e)d=P(d);(e=f&&f[h])&&e.constructor===d?d=e:(e&&e.destructor(),d=new d(this));d.transition=m;d.animation=p;for(let e in b)b.hasOwnProperty(e)&&!u.isSpecialDescriptorProperty(e)&&(d[e]="function"===typeof b[e]?b[e](c,g,a):b[e]);d.afterUpdate();l[h]=d;k[g]=h}}if(f)for(let a in f)l&&l[a]||f[a].destructor()}super.afterUpdate()}shouldUpdateChildren(){return!0}traverse(a,b){a.call(b,this);let c=this._orderedItemKeys, | ||
d=this._itemsDict;for(let e=0,f=c.length;e<f;e++)d[c[e]].traverse(a,b)}forEachChild(a,b){let c=this._orderedItemKeys,d=this._itemsDict;for(let e=0,f=c.length;e<f;e++)a.call(b,d[c[e]],c[e])}destructor(){this.isDestroying=!0;let a=this._itemsDict;if(a)for(let b in a)a[b].destructor();super.destructor()}}let Q=[null];class E extends u{constructor(a){super(a);this.children=null;this._orderedChildKeys=[]}afterUpdate(){this.shouldUpdateChildren()&&this.updateChildren(this.describeChildren());super.afterUpdate()}describeChildren(){return this.children}shouldUpdateChildren(){return!0}updateChildren(a){let b= | ||
this._childrenDict||null,c=this._childrenDict=null,d=this._orderedChildKeys;d.length=0;if(a){Array.isArray(a)||(Q[0]=a,a=Q);for(let k=0,g=a.length;k<g;k++){var e=a[k];if(!e)continue;c||(c=this._childrenDict=Object.create(null));var f=M(e);let g=f?e.props:e;f=f?e.type:e.facade;e=e.key;if(!e){var l=0;do e=`auto:${f.name}:${l++}`;while(c[e])}if("production"!==process.env.NODE_ENV&&"function"!==typeof f)throw Error('All scene objects must have a "facade" property pointing to a class/constructor');if(c[e])for(console.warn(`Duplicate key in children: ${e}`);c[e];)e+= | ||
"|dupe";l=g.transition;let h=g.animation;if(l||h||g.exitAnimation)f=O(f);g.pointerStates&&(f=P(f));let n=b&&b[e];n&&n.constructor===f?f=n:(n&&n.destructor(),f=new f(this));f.transition=l;f.animation=h;for(let a in g)g.hasOwnProperty(a)&&!u.isSpecialDescriptorProperty(a)&&(f[a]=g[a]);c[e]=f;d.push(e);f.afterUpdate()}}if(b)for(let a in b)c&&c[a]||b[a].destructor()}getChildByKey(a){let b=this._childrenDict;return b&&b[a]||null}traverse(a,b){a.call(b,this);let c=this._orderedChildKeys,d=this._childrenDict; | ||
for(let e=0,f=c.length;e<f;e++)d[c[e]].traverse(a,b)}forEachChild(a,b){let c=this._orderedChildKeys,d=this._childrenDict;for(let e=0,f=c.length;e<f;e++)a.call(b,d[c[e]],c[e])}destructor(){this.isDestroying=!0;let a=this._childrenDict;if(a)for(let b in a)a[b].destructor();super.destructor()}}var A="onMouseOver onMouseOut onMouseMove onDragStart onDrag onDragEnter onDragOver onDragLeave".split(" ");let R="onMouseDown onMouseUp onClick onDoubleClick onDrop onDragEnd onWheel".split(" "),S=R.map(C),T= | ||
A.map(C);A=A.concat(R);let U=T.concat(S);class F extends E{interceptsPointerEvents(a){if(!1===this.pointerEvents)return!1;if(this.pointerEvents)return!0;for(let b=0,c=U.length;b<c;b++)if(a.hasFacadeListenersOfType(this,U[b]))return!0}}Object.defineProperty(F.prototype,"isPointerEventTarget",{value:!0});A.forEach(a=>{u.defineEventProperty(F,a,C(a))});let fa={},ha=["mousemove","mouseout","touchmove"],ia="mousedown mouseup click dblclick wheel touchstart touchend touchcancel".split(" "),V=["mouseup", | ||
"touchend","touchcancel"],ja={touchstart:"mousedown",touchend:"mouseup",touchcancel:"mouseup"},ka="clientX clientY screenX screenY pageX pageY".split(" ");class z{constructor(a,b,c,d,e){for(let b in a)"function"!==typeof a[b]&&(this[b]=a[b]);this.target=c;this.relatedTarget=d;this.type=b;this.nativeEvent=a;w(this,e);if(a.touches){let b=D(a)?a.changedTouches:a.touches;1===b.length&&ka.forEach(a=>{this[a]=b[0][a]})}}preventDefault(){this.defaultPrevented=!0;this.nativeEvent.preventDefault()}stopPropagation(){this.propagationStopped= | ||
!0;this.nativeEvent.stopPropagation()}}class G extends E{constructor(a){super(null);this.width=this.height=1;this._element=a;this._htmlOverlays=Object.create(null);this.eventRegistry=new aa;this._onPointerMotionEvent=this._onPointerMotionEvent.bind(this);this._onPointerActionEvent=this._onPointerActionEvent.bind(this);this._onDropEvent=this._onDropEvent.bind(this);this._togglePointerListeners(!0)}afterUpdate(){this._queueRender();super.afterUpdate()}onNotifyWorld(a,b,c){(b=this._notifyWorldHandlers[b])&& | ||
b.call(this,a,c)}_isContinuousRender(){return this.continuousRender}set renderingScheduler(a){a=a||window;if(a!==this.renderingScheduler){let b=this._nextFrameTimer;b&&(this.renderingScheduler.cancelAnimationFrame(b),this._nextFrameTimer=null);this._renderingScheduler=a}}get renderingScheduler(){return this._renderingScheduler||window}_queueRender(){if(!this._nextFrameTimer){let a=this._nextFrameHandler||(this._nextFrameHandler=(...a)=>{let {onStatsUpdate:b,onBeforeRender:d,onAfterRender:e}=this, | ||
f=b&&Date.now();d&&d(this);this.doRender(...a);b&&(a=Date.now(),b({"Render CPU Time (ms)":a-f,"Time Between Frames (ms)":this._lastFrameTime?a-this._lastFrameTime:"?",FPS:this._lastFrameTime?Math.round(1E3/(a-this._lastFrameTime)):"?"}),this._lastFrameTime=a);this._doRenderHtmlItems();e&&e(this);this._nextFrameTimer=null;this._isContinuousRender()&&this._queueRender()});this._nextFrameTimer=this.renderingScheduler.requestAnimationFrame(a)}}doRender(){}getFacadeUserSpaceXYZ(a){}_doRenderHtmlItems(){if(this.renderHtmlItems){let a= | ||
[],b=this._htmlOverlays;for(let c in b){let d=b[c],e=this.getFacadeUserSpaceXYZ(d);0<=e.z&&(e.key=d.$facadeId,e.html=d.html,e.exact=d.exact,a.push(e))}this.renderHtmlItems(a)}}_normalizePointerEvent(a){}_onPointerMotionEvent(a){this._normalizePointerEvent(a);let b=this._getPointerEventState(a);if(T.some(this.eventRegistry.hasAnyListenersOfType)){var c="mouseout"===a.type||D(a)?null:this._findHoverTarget(a);let d=b.hoveredFacade,e=b.hoveredFacade=c&&c.facade,f=b.dragInfo;f&&(f.dragStartFired||(this._firePointerEvent("dragstart", | ||
f.dragStartEvent,f.draggedFacade,null,c),f.dragStartFired=!0),this._firePointerEvent("drag",a,f.draggedFacade,null,c));e!==d&&(d&&(this._firePointerEvent("mouseout",a,d,e,c),f&&this._firePointerEvent("dragleave",a,d,e,c)),e&&(this._firePointerEvent("mouseover",a,e,d,c),f&&this._firePointerEvent("dragenter",a,e,d,c)));e&&(this._firePointerEvent("mousemove",a,e,null,c),f&&this._firePointerEvent("dragover",a,e,null,c))}(c=b.tapInfo)&&"touchmove"===a.type&&(a=a.changedTouches[0])&&10<Math.sqrt(Math.pow(a.clientX- | ||
c.x,2)+Math.pow(a.clientY-c.y,2))&&(b.tapInfo=null)}_onPointerActionEvent(a){this._normalizePointerEvent(a);-1<V.indexOf(a.type)&&this._onDropEvent(a);"touchstart"===a.type&&(1===a.touches.length&&this._onPointerMotionEvent(a),this._enableContextMenu(!1));var b=this.eventRegistry;if(b.hasAnyListenersOfType("dragstart")||S.some(b.hasAnyListenersOfType)){var c=this._findHoverTarget(a);let d=c&&c.facade;if(d){let e=this._getPointerEventState(a);this._firePointerEvent(ja[a.type]||a.type,a,d,null,c);if(b.findBubblingEventTarget(d, | ||
"click")||b.findBubblingEventTarget(d,"dblclick")){let b=e.tapInfo;"touchstart"===a.type&&1===a.touches.length?e.tapInfo={facade:d,x:a.touches[0].clientX,y:a.touches[0].clientY,startTime:Date.now(),isDblClick:b&&300>Date.now()-b.startTime}:b&&b.facade===d&&"touchend"===a.type&&0===a.touches.length&&1===a.changedTouches.length&&300>Date.now()-b.startTime&&(this._firePointerEvent("click",a,d,null,c),b.isDblClick&&this._firePointerEvent("dblclick",a,d,null,c))}if("mousedown"===a.type||"touchstart"=== | ||
a.type)if(b=b.findBubblingEventTarget(d,"dragstart"))c=new z(a,"dragstart",b,null,{intersection:c}),e.dragInfo={draggedFacade:b,dragStartFired:!1,dragStartEvent:c},this._toggleDropListeners(!0)}a.preventDefault()}D(a)&&(1===a.changedTouches.length&&this._onPointerMotionEvent(a),this._enableContextMenu(!0))}_onDropEvent(a){let b=this._getPointerEventState(a),c=b.dragInfo;if(c){this._normalizePointerEvent(a);let d=this._findHoverTarget(a),e=d&&d.facade;e&&this._firePointerEvent("drop",a,e,null,d);this._firePointerEvent("dragend", | ||
a,c.draggedFacade,null,d);this._toggleDropListeners(!1);b.dragInfo=null}}_firePointerEvent(a,b,c,d,e){a=b instanceof z?b:new z(b,a,c,d,{bubbles:!0,intersection:e});this.eventRegistry.dispatchEventOnFacade(c,a)}_getPointerEventState(a){let b=this._pointerEventStates||(this._pointerEventStates=new WeakMap);a=a.eventSource||fa;let c=b.get(a);c||b.set(a,c={});return c}_toggleDropListeners(a){V.forEach(b=>{document[(a?"add":"remove")+"EventListener"](b,this._onDropEvent,!0)})}_togglePointerListeners(a){let b= | ||
this._element;if(b&&a!==this._pointerListenersAttached){let c=(a?"add":"remove")+"EventListener";ha.forEach(a=>{b[c](a,this._onPointerMotionEvent,!1)});ia.forEach(a=>{b[c](a,this._onPointerActionEvent,!1)});this._pointerListenersAttached=a}}_enableContextMenu(a){let b=this._element;if(b)b[(a?"remove":"add")+"EventListener"]("contextmenu",ba,!0)}getFacadesAtEvent(a,b){throw Error("getFacadesAtEvent: no impl");}_findHoverTarget(a){if(a.touches&&1<a.touches.length)return null;if(a=this.getFacadesAtEvent(a, | ||
a=>a.isPointerEventTarget&&a.interceptsPointerEvents(this.eventRegistry))){let b=a[0];for(let c=1;c<a.length;c++)if(a[c].distance<b.distance||a[c].distance===b.distance&&(a[c].distanceBias||0)<(b.distanceBias||0))b=a[c];return b}return null}destructor(){this._nextFrameTimer&&this.renderingScheduler.cancelAnimationFrame(this._nextFrameTimer);this._togglePointerListeners(!1);this._toggleDropListeners(!1);super.destructor()}}Object.defineProperty(G.prototype,"isWorld",{value:!0});G.prototype._notifyWorldHandlers= | ||
{needsRender(){this._queueRender()},addEventListener(a,b){this.eventRegistry.addListenerForFacade(a,b.type,b.handler)},removeEventListener(a,b){this.eventRegistry.removeListenerForFacade(a,b.type,b.handler)},removeAllEventListeners(a){this.eventRegistry.removeAllListenersForFacade(a)},dispatchEvent(a,b){b instanceof z||(b=new z(b,b.type,b.target,b.relatedTarget));this.eventRegistry.dispatchEventOnFacade(a,b)},addHtmlOverlay(a){this._htmlOverlays[a.$facadeId]=a},removeHtmlOverlay(a){delete this._htmlOverlays[a.$facadeId]}, | ||
statsUpdate(a,b){(a=this.onStatsUpdate)&&a(b)}};let la={position:"absolute",top:0,right:0,bottom:0,left:0,pointerEvents:"none",transformStyle:"preserve-3d"};class H extends r["default"].Component{shouldComponentUpdate(a){return a.html!==this.props.html||!0===(a.html.props&&a.html.props.shouldUpdateOnMove)}render(){let a=this.props.html;return"string"===typeof a?r["default"].createElement("span",null,a):r["default"].cloneElement(a)}}H.displayName="Canvas3D.HtmlOverlayContent";H.propTypes={html:t["default"].node}; | ||
class W extends r["default"].Component{constructor(a){super(a);this.setItems=this.setItems.bind(this);this.state={items:null}}shouldComponentUpdate(a,b){a=this.state;return b.items&&b.items.length||a.items&&a.items.length}setItems(a){let b=this.state.items;(a&&a.length||b&&b.length)&&this.setState({items:a||null})}render(){let a=this.state.items,b=Math.round;return a&&a.length?r["default"].createElement("div",{className:"troika_html_overlay",style:la},a.map(({key:a,html:d,x:e,y:f,z:l,exact:k})=>{k|| | ||
(e=b(e),f=b(f));return r["default"].createElement("div",{key:a,style:{position:"absolute",transform:`translate3d(${e}px, ${f}px, ${-l}px)`}},r["default"].createElement(H,{html:d}))})):null}}W.displayName="Canvas3D.HtmlOverlay";let ma={position:"absolute",top:0,right:0,background:"rgba(0,0,0,.5)",font:"11px sans-serif",padding:10};class na extends r["default"].Component{constructor(a){super(a);this.state={stats:{}}}setStats(a){this.setState({stats:a})}render(){let a=this.state.stats;return r["default"].createElement("div", | ||
{style:ma},Object.keys(a).sort().map(b=>r["default"].createElement("div",{key:b},`${b}: ${a[b]}`)))}}let oa={width:"100%",height:"100%"};class X extends r["default"].Component{constructor(a){super(a);this._stats={};this.updateStats=this.updateStats.bind(this);this.renderHtmlItems=this.renderHtmlItems.bind(this);this._bindHtmlOverlayRef=this._bindHtmlOverlayRef.bind(this);this._bindCanvasRef=this._bindCanvasRef.bind(this);this._bindStatsRef=this._bindStatsRef.bind(this)}componentDidUpdate(){this.updateWorld()}initWorld(a){a= | ||
new this.props.worldFacade(a);a.renderHtmlItems=this.renderHtmlItems;return a}updateWorld(){let a=this._world;if(a){let {props:b}=this,c=b.stats,d=c&&Date.now();a.width=b.width;a.height=b.height;a.pixelRatio=b.pixelRatio;a.continuousRender=b.continuousRender;a.onStatsUpdate=c?this.updateStats:null;w(a,b.worldProps);a.afterUpdate();c&&this.updateStats({"Last World Update (ms)":Date.now()-d})}}destroyWorld(){this._world&&(this._world.destructor(),delete this._world);clearTimeout(this._statsDelay)}renderHtmlItems(a){this._htmlOverlayRef&& | ||
this._htmlOverlayRef.setItems(a)}updateStats(a){this._stats=w({},this._stats,a);this._statsDelay||(this._statsDelay=setTimeout(()=>{this._statsDelay=null;let a=this._statsRef;a&&a.setStats(this._stats)},250))}_bindHtmlOverlayRef(a){this._htmlOverlayRef=a}_bindCanvasRef(a){if(a)try{this._world=this.initWorld(a),this.updateWorld()}catch(c){console.warn(`Troika.${this.constructor.displayName}: world init failed, using fallback content.`,c),this._failedWorldInit=!0,this._world=null,this.forceUpdate()}else this.destroyWorld(); | ||
let b=this.props.onCanvasRef;b&&b(a)}_bindStatsRef(a){this._statsRef=a}render(){let {props:a}=this;return r["default"].createElement("div",{className:`troika ${a.className||""}`,style:{position:"relative",overflow:"hidden",width:a.width,height:a.height,cursor:a.cursor,userSelect:"none"}},this._failedWorldInit?this.props.children:r["default"].createElement("canvas",{className:"troika_canvas",ref:this._bindCanvasRef,style:a.canvasStyle||oa}),r["default"].createElement(W,{ref:this._bindHtmlOverlayRef}), | ||
a.stats?r["default"].createElement(na,{ref:this._bindStatsRef}):null)}}X.commonPropTypes={width:t["default"].number.isRequired,height:t["default"].number.isRequired,pixelRatio:t["default"].number,worldFacade:t["default"].func,worldProps:t["default"].object,canvasStyle:t["default"].object,className:t["default"].string,continuousRender:t["default"].bool,onCanvasRef:t["default"].func,stats:t["default"].bool,cursor:t["default"].string};q.Facade=u;q.ListFacade=ea;q.ParentFacade=E;q.PointerEventTarget= | ||
F;q.ReactCanvasBase=X;q.WorldBaseFacade=G;q.utils=x;Object.defineProperty(q,"__esModule",{value:!0})}) |
{ | ||
"name": "troika-core", | ||
"version": "0.42.0", | ||
"version": "0.43.0", | ||
"description": "Troika Core", | ||
@@ -18,3 +18,3 @@ "author": "Jason Johnston <jason.johnston@protectwise.com>", | ||
"prop-types": "^15.6.2", | ||
"troika-animation": "^0.42.0" | ||
"troika-animation": "^0.43.0" | ||
}, | ||
@@ -33,3 +33,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "0f7129cd43fc58f5c6a5f6f20f2d0941f9f36510" | ||
"gitHead": "497fa534d015bc8f746c7d00ec7bfde1df92f491" | ||
} |
@@ -0,0 +0,0 @@ # Troika Framework Core |
@@ -0,0 +0,0 @@ import { assignIf, createClassExtender } from '../utils.js' |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import {assign} from '../utils.js' |
@@ -0,0 +0,0 @@ import Facade from './Facade.js' |
@@ -0,0 +0,0 @@ import Facade from './Facade.js' |
@@ -0,0 +0,0 @@ import ParentFacade from './ParentFacade.js' |
@@ -0,0 +0,0 @@ import { assign, createClassExtender } from '../utils.js' |
@@ -0,0 +0,0 @@ import ParentFacade from './ParentFacade.js' |
@@ -0,0 +0,0 @@ // Troika core exports |
@@ -0,0 +0,0 @@ import React from 'react' |
@@ -0,0 +0,0 @@ import React from 'react' |
@@ -0,0 +0,0 @@ import React from 'react' |
@@ -0,0 +0,0 @@ ///// Miscellaneous Utility Functions ///// |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
331309
7645
+ Addedtroika-animation@0.43.0(transitive)
- Removedtroika-animation@0.42.0(transitive)
Updatedtroika-animation@^0.43.0