troika-core
Advanced tools
Comparing version 0.47.0 to 0.47.2
@@ -47,3 +47,3 @@ import Facade from '../../src/facade/Facade.js' | ||
inst.updateChildren = jest.fn() | ||
const children = inst.children = [] | ||
inst.children = [] | ||
inst.afterUpdate() | ||
@@ -208,3 +208,2 @@ expect(inst.updateChildren).not.toHaveBeenCalled() | ||
test('When a child with a given `key` goes away, its facade is destroyed', () => { | ||
let lastChildInstance | ||
const destructorSpy = jest.fn() | ||
@@ -214,3 +213,2 @@ class Sub extends Facade { | ||
super(parent) | ||
lastChildInstance = this | ||
} | ||
@@ -329,3 +327,3 @@ destructor() { | ||
test('Returns the facade instance for the given key', () => { | ||
let childInstance | ||
let childInstance = null | ||
class Sub extends Facade {constructor(parent) { | ||
@@ -338,9 +336,8 @@ super(parent) | ||
inst.afterUpdate() | ||
expect(inst.getChildByKey('foo')).toEqual(expect.any(Sub)) | ||
expect(childInstance).not.toBeNull() | ||
expect(inst.getChildByKey('foo')).toBe(childInstance) | ||
}) | ||
test('Returns null if none found', () => { | ||
let childInstance | ||
class Sub extends Facade {constructor(parent) { | ||
super(parent) | ||
childInstance = this | ||
}} | ||
@@ -347,0 +344,0 @@ const inst = new ParentFacade() |
@@ -6,2 +6,10 @@ # Change Log | ||
## [0.47.2](https://github.com/protectwise/troika/compare/v0.47.1...v0.47.2) (2023-05-15) | ||
**Note:** Version bump only for package troika-core | ||
# [0.47.0](https://github.com/protectwise/troika/compare/v0.46.3...v0.47.0) (2022-12-15) | ||
@@ -8,0 +16,0 @@ |
@@ -34,3 +34,3 @@ '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]; | ||
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= | ||
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(){}_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", | ||
@@ -37,0 +37,0 @@ 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- |
{ | ||
"name": "troika-core", | ||
"version": "0.47.0", | ||
"version": "0.47.2", | ||
"description": "Troika Core", | ||
@@ -18,3 +18,3 @@ "author": "Jason Johnston <jason.johnston@protectwise.com>", | ||
"prop-types": "^15.6.2", | ||
"troika-animation": "^0.47.0" | ||
"troika-animation": "^0.47.2" | ||
}, | ||
@@ -33,3 +33,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "f20187dfa6a07de046b4e6a3948e75483b8e2ee5" | ||
"gitHead": "27cb013dd98d1b3e47d42dcc2787313949525572" | ||
} |
@@ -169,3 +169,3 @@ import { assignIf, createClassExtender } from '../utils.js' | ||
direction = animDesc[key]; break | ||
default: | ||
default: { | ||
let percent = key === 'from' ? 0 : key === 'to' ? 100 : parseFloat(key) | ||
@@ -187,2 +187,3 @@ if (!isNaN(percent) && percent >= 0 && percent <= 100) { | ||
} | ||
} | ||
} | ||
@@ -189,0 +190,0 @@ } |
@@ -188,3 +188,3 @@ import ParentFacade from './ParentFacade.js' | ||
*/ | ||
getFacadeUserSpaceXYZ(facade) { | ||
getFacadeUserSpaceXYZ(/*facade*/) { | ||
} | ||
@@ -191,0 +191,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
323606
Updatedtroika-animation@^0.47.2