@epigraph/solutions 1.0.0-alpha-3 → 1.0.0-alpha-4

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.
@@ -6372,7 +6372,7 @@ void main() {
6372
6372
  ar-modes="webxr scene-viewer quick-look"
6373
6373
  ar-scale="fixed"
6374
6374
  ></model-viewer>
6375
- `:Ee`${this.__renderQrModal()}`}};ta([Gt("#modelViewer")],hr.prototype,"modelViewerElem");ta([Gt("#arModal")],hr.prototype,"arModalElem");ta([Gt("#qrModal")],hr.prototype,"qrModalElem");ta([he({attribute:!1})],hr.prototype,"appWcRef");ta([he({type:String,attribute:"glb-src"})],hr.prototype,"glbSrc");ta([he({type:String,attribute:"variant-name"})],hr.prototype,"variantName");ta([he({type:String,attribute:"usdz-src"})],hr.prototype,"usdzSrc");ta([he({type:Boolean,attribute:"debug"})],hr.prototype,"debug");let U$=hr;var F$=Object.defineProperty,xt=(o,e,t,i)=>{for(var a=void 0,l=o.length-1,u;l>=0;l--)(u=o[l])&&(a=u(e,t,a)||a);return a&&F$(e,t,a),a};const wt=class ru extends PI{constructor(){super(window.__APP_VERSION__,cu.DEVELOPMENT),this.sku=Ai.sku.defaultValue.toString(),this.shopify_variant_id=Ai.shopifyVariantId.defaultValue.toString(),this.upc=Ai.upc.defaultValue.toString(),this.asin=Ai.asin.defaultValue.toString(),this.experience_id=Ai.experienceId.defaultValue.toString(),this.gaMeasurementId="",this.isLoading=!0,this.apiMode="production",this.debug=!1,this.dimensionsUnit=Ai.dimensionsUnit.defaultValue.toString(),this.dimensionsUnitSymbol=Ai.dimensionsUnitSymbol.defaultValue.toString(),this.areDimensionsActive=!1,this.areHotspotsActive=!1,this.isHelpVisible=!1,this.baseUrlOverride=Ai.baseUrlOverride.defaultValue.toString(),this.isPortraitOrientation=!1,this.didARAutoLaunch=!1,this.transparentBackground=!1,this.playInteractionPrompt=!1,this.featuresToEnable={viewer:!0,hotspots:!0,dimensions:!0,viewInYourSpace:!0,help:!0,sceneManager:!0},this.epigraphWebsiteRedirectUrls={icon:"https://www.epigraph.us",modal:"https://www.epigraph.us"},this._loadTimeBegin=performance.now(),this._loggerContext="EPIGRAPH THREED CODE",this._epigraphAnalytics=new $I(null,null),this._identifier="",this._identifierType="",this._isDevEnv=!1,this._boundingSphereCenter=new se,this._activeAnimations=new Map,this._animationFadeDurationInMiliseconds=1e3,this._isSceneInteractedWith=!1,this._isActiveHotspot=!1,this._isToolsetLargerThanTheLeftBottomQuadrant=!1,this._loadingProgress=0,this.__glbBlobUrl="",this.__usdzBlobUrl="",this.__hasSceneChanged=!1,this.__canvasSize={width:0,height:0}}static{this.webComponentName="epigraph-threed-core"}static{this.styles=[ut`
6375
+ `:Ee`${this.__renderQrModal()}`}};ta([Gt("#modelViewer")],hr.prototype,"modelViewerElem");ta([Gt("#arModal")],hr.prototype,"arModalElem");ta([Gt("#qrModal")],hr.prototype,"qrModalElem");ta([he({attribute:!1})],hr.prototype,"appWcRef");ta([he({type:String,attribute:"glb-src"})],hr.prototype,"glbSrc");ta([he({type:String,attribute:"variant-name"})],hr.prototype,"variantName");ta([he({type:String,attribute:"usdz-src"})],hr.prototype,"usdzSrc");ta([he({type:Boolean,attribute:"debug"})],hr.prototype,"debug");let U$=hr;var F$=Object.defineProperty,xt=(o,e,t,i)=>{for(var a=void 0,l=o.length-1,u;l>=0;l--)(u=o[l])&&(a=u(e,t,a)||a);return a&&F$(e,t,a),a};const wt=class ru extends PI{constructor(){super(window.__APP_VERSION__,cu.DEVELOPMENT),this.sku=Ai.sku.defaultValue.toString(),this.shopify_variant_id=Ai.shopifyVariantId.defaultValue.toString(),this.upc=Ai.upc.defaultValue.toString(),this.asin=Ai.asin.defaultValue.toString(),this.experience_id=Ai.experienceId.defaultValue.toString(),this.gaMeasurementId="",this.isLoading=!0,this.apiMode="production",this.debug=!1,this.dimensionsUnit=Ai.dimensionsUnit.defaultValue.toString(),this.dimensionsUnitSymbol=Ai.dimensionsUnitSymbol.defaultValue.toString(),this.areDimensionsActive=!1,this.areHotspotsActive=!1,this.isHelpVisible=!1,this.baseUrlOverride=Ai.baseUrlOverride.defaultValue.toString(),this.isPortraitOrientation=!1,this.didARAutoLaunch=!1,this.transparentBackground=!1,this.playInteractionPrompt=!1,this.featuresToEnable={viewer:!0,hotspots:!0,dimensions:!0,viewInYourSpace:!0,help:!0,sceneManager:!0},this.epigraphWebsiteRedirectUrls={icon:"https://www.epigraph.us",modal:"https://www.epigraph.us"},this.pickerState=!1,this._loadTimeBegin=performance.now(),this._loggerContext="EPIGRAPH THREED CODE",this._epigraphAnalytics=new $I(null,null),this._identifier="",this._identifierType="",this._isDevEnv=!1,this._boundingSphereCenter=new se,this._activeAnimations=new Map,this._animationFadeDurationInMiliseconds=1e3,this._isSceneInteractedWith=!1,this._isActiveHotspot=!1,this._isToolsetLargerThanTheLeftBottomQuadrant=!1,this._loadingProgress=0,this.__glbBlobUrl="",this.__usdzBlobUrl="",this.__hasSceneChanged=!1,this.__canvasSize={width:0,height:0}}static{this.webComponentName="epigraph-threed-core"}static{this.styles=[ut`
6376
6376
  :host {
6377
6377
  all: initial;
6378
6378
  display: flex;
@@ -6503,7 +6503,7 @@ void main() {
6503
6503
  opacity: 0;
6504
6504
  pointer-events: none;
6505
6505
  }
6506
- `]}static setupWebComponent(){window.customElements.get(ru.webComponentName)||window.customElements.define(ru.webComponentName,ru)}get timeElapsedSinceLoadBegin(){return parseFloat((performance.now()-this._loadTimeBegin).toFixed(2))}get epigraphAnalytics(){return this._epigraphAnalytics}get identifier(){return this._identifier}get identifierType(){return this._identifierType}get appEvents(){return this._appEvents}get canvasSize(){return this.__canvasSize}get assetLoaders(){return this._assetLoaders}get assetManager(){return this._assetManager}get sceneManager(){return this._sceneManager}get cameraManager(){return this._cameraManager}get hasSceneChanged(){return this.__hasSceneChanged}set hasSceneChanged(e){this.__hasSceneChanged=e}get renderEngine(){return this._renderEngine}get isDevEnv(){return this._isDevEnv}renderScreenshotCanvasFrame(){this.renderEngine.screenshotRenderer.render(this.renderEngine.scene,this.cameraManager.cameras.screenshot)}onLoadFailed(e){this._appEvents.appFailedEvent.fire(e);const t=this.timeElapsedSinceLoadBegin,i=new FI(!0,t,e?.toString()??"");this._epigraphAnalytics.sendEvent(i),this.showSplashScreen()}getPositionOnMeshFromPoint(e,t){const i=new nb,a=new $e;a.x=e/this.canvasSize.width*2-1,a.y=-(t/this.canvasSize.height)*2+1,i.setFromCamera(a,this.cameraManager.cameras.main);const l=i.intersectObjects(this.renderEngine.sceneHierarchy.sceneStructure.children,!0);return l.length>0?l[0].point:null}getSceneSphericalBoundsForCameraFocus(){const e=this.dimensionsManager.getCurrentSceneBounds();return e.getCenter(this._boundingSphereCenter),e.getBoundingSphere(new vn(this._boundingSphereCenter))}async getUsdzUrlForAr(){return this.hasSceneChanged?this.__usdzBlobUrl=await this.renderEngine.getSceneAsUsdzUrl():window.epigraph.logger.info({title:"Reusing cached USDZ for AR."}),this.appEvents.arModelReadyEvent.fire(this.__usdzBlobUrl),this.__usdzBlobUrl}async getGlbUrlForAr(){return this.hasSceneChanged?this.__glbBlobUrl=await this.renderEngine.getSceneAsGlbUrl():window.epigraph.logger.info({title:"Reusing cached GLB for AR."}),this.appEvents.arModelReadyEvent.fire(this.__glbBlobUrl),{glbSrc:this.__glbBlobUrl,variantName:null}}async launchAR(){if(!this.isLoading)return await this.viewInYourSpaceManager.launchAR()}async spawnProductInScene(e){const t=new EC(e);return this.renderEngine.sceneHierarchy.sceneStructure.add(t),await this._onSceneHierarchyUpdate(),Promise.resolve(t)}showDimensions(){this.dimensionsManager.enabled=!0,this.areDimensionsActive=!0,this.renderEngine.setDimensionsVisibility(this.dimensionsManager.enabled);const e=this.getSceneSphericalBoundsForCameraFocus();e.radius=e.radius*1.4,this.cameraManager.fitCameraToObject({objectToFocus:e})}hideDimensions(e=!1){if(this.dimensionsManager.enabled=!1,this.areDimensionsActive=!1,this.renderEngine.setDimensionsVisibility(this.dimensionsManager.enabled),!e){const t=this.getSceneSphericalBoundsForCameraFocus();this.cameraManager.fitCameraToObject({objectToFocus:t})}}getDimensions(){const e=this.dimensionsManager.getCurrentDimensionsState(),t=this.dimensionsManager.dimensionsUnit;return{length:e.length.distance,width:e.width.distance,height:e.height.distance,unit:t}}printSceneHierarchy(){this.renderEngine.printSceneHierarchy()}showCameraAim(){this.cameraAimElemRef.classList.remove("hide")}hideCameraAim(){this.cameraAimElemRef.classList.add("hide")}showHelp(){this.isHelpVisible=!0}hideHelp(){this.isHelpVisible=!1}toggleHelp(){this.isHelpVisible=!this.isHelpVisible}showHotspots(){window.epigraph.logger.info({title:"Showing Hotspots"}),this.areHotspotsActive=!0,this.appEvents.hotspotsVisibilityChanged.fire({visible:!0})}hideHotspots(){window.epigraph.logger.info({title:"Hiding Hotspots"}),this.areHotspotsActive=!1,this.appEvents.hotspotsVisibilityChanged.fire({visible:!1})}toggleHotspots(){this.hotspotsManager.enabled?this.hideHotspots():this.showHotspots()}updateHotspotsOrder(e){this.hotspotsManager.updateHotspotsOrder(e)}openHotspot({hotspotId:e,state:t}){this.hotspotsManager.openHotspot({hotspotId:e,state:t})}closeActiveHotspot(){this.hotspotsManager.closeActiveHotspot()}setActiveHotspotState(e){this.hotspotsManager.setActiveHotspotState(e)}nextHotspot(){return this.hotspotsManager.nextHotspot()}previousHotspot(){return this.hotspotsManager.previousHotspot()}getActiveHotspot(){return this.hotspotsManager.activeHotspot}areHotspotsVisible(){return this.hotspotsManager.enabled}getAllHotspots(){return Array.from(this.hotspotsManager.hotspots.values())}getAllHotspotIds(){return Array.from(this.hotspotsManager.hotspots.keys())}getHotspotById(e){return this.hotspotsManager.hotspots.get(e)}createHotspots(e){this.hotspotsManager.createHotspots(e)}updateHotspots(e){this.hotspotsManager.updateHotspots(e)}removeHotspots(e){this.hotspotsManager.removeHotspots(e)}async triggerCameraInteractionPrompt(e=2){this.renderEngine.showCameraInteractionPromptIndicator();for(let t=0;t<e;t++)await this.cameraManager.wiggleCamera(),await Ft.wait(500);setTimeout(()=>{this.playInteractionPrompt=!this._isSceneInteractedWith},3e3)}getAllAnimations(){return[]}getAllAnimationNames(){return[]}playAnimationByName({animationName:e,loop:t=!1,repetitions:i=1/0}){if(!e)return;const a=this.getAllAnimationNames();if(!a.includes(e)){window.epigraph.logger.warn({title:`Invalid animation name: ${e}. Expand for a list of valid names`,details:a});return}const l=a.indexOf(e),u=this.getAllAnimations()[l];u.fadeIn(this._animationFadeDurationInMiliseconds*.001),u.setLoop(t?Ua:Cl,i),u.play(),this._activeAnimations.set(e,u)}stopAnimationByName(e){if(!e)return;const t=this.getAllAnimationNames();if(!t.includes(e)){window.epigraph.logger.warn({title:`Invalid animation name: ${e}. Expand for a list of valid names`,details:t});return}const i=t.indexOf(e),a=this.getAllAnimations()[i];a.fadeOut(this._animationFadeDurationInMiliseconds*.001),setTimeout(()=>{a.stop()},this._animationFadeDurationInMiliseconds),this._activeAnimations.delete(e)}pauseActiveAnimations(e){for(const t of this._activeAnimations.values())t.paused=!0,e!==void 0&&(t.weight=e)}resumeActiveAnimations(){for(const e of this._activeAnimations.values())e.paused=!1,e.weight=1}stopAllAnimations(){for(const[e,t]of this._activeAnimations.entries())t.fadeOut(this._animationFadeDurationInMiliseconds*.001),setTimeout(()=>{t.stop(),this._activeAnimations.delete(e)},this._animationFadeDurationInMiliseconds)}postRenderFrameUpdateInEngine(e){try{this.cameraManager.mainCameraControls.update(e),this.renderEngine.mainRenderer.render(this.renderEngine.scene,this.cameraManager.cameras.main)}catch(t){return t}}getScreenPositionFromWorld(e){const t=new $e,i=this.cameraManager.cameras.main,a=this.renderEngine.canvas.clientWidth*.5,l=this.renderEngine.canvas.clientHeight*.5,d=e.clone().project(i);return t.x=(d.x+1)*a,t.y=-(d.y-1)*l,t}_renderAppCanvasContainer(){return this.featuresToEnable.viewer?Ee`
6506
+ `]}static setupWebComponent(){window.customElements.get(ru.webComponentName)||window.customElements.define(ru.webComponentName,ru)}get timeElapsedSinceLoadBegin(){return parseFloat((performance.now()-this._loadTimeBegin).toFixed(2))}get epigraphAnalytics(){return this._epigraphAnalytics}get identifier(){return this._identifier}get identifierType(){return this._identifierType}get appEvents(){return this._appEvents}get canvasSize(){return this.__canvasSize}get assetLoaders(){return this._assetLoaders}get assetManager(){return this._assetManager}get sceneManager(){return this._sceneManager}get cameraManager(){return this._cameraManager}get hasSceneChanged(){return this.__hasSceneChanged}set hasSceneChanged(e){this.__hasSceneChanged=e}get renderEngine(){return this._renderEngine}get isDevEnv(){return this._isDevEnv}enterPickerState(){this.pickerState=!0}exitPickerState(){this.pickerState=!1}renderScreenshotCanvasFrame(){this.renderEngine.screenshotRenderer.render(this.renderEngine.scene,this.cameraManager.cameras.screenshot)}onLoadFailed(e){this._appEvents.appFailedEvent.fire(e);const t=this.timeElapsedSinceLoadBegin,i=new FI(!0,t,e?.toString()??"");this._epigraphAnalytics.sendEvent(i),this.showSplashScreen()}getPositionOnMeshFromPoint(e,t){const i=new nb,a=new $e;a.x=e/this.canvasSize.width*2-1,a.y=-(t/this.canvasSize.height)*2+1,i.setFromCamera(a,this.cameraManager.cameras.main);const l=i.intersectObjects(this.renderEngine.sceneHierarchy.sceneStructure.children,!0);return l.length>0?l[0].point:null}getSceneSphericalBoundsForCameraFocus(){const e=this.dimensionsManager.getCurrentSceneBounds();return e.getCenter(this._boundingSphereCenter),e.getBoundingSphere(new vn(this._boundingSphereCenter))}async getUsdzUrlForAr(){return this.hasSceneChanged?this.__usdzBlobUrl=await this.renderEngine.getSceneAsUsdzUrl():window.epigraph.logger.info({title:"Reusing cached USDZ for AR."}),this.appEvents.arModelReadyEvent.fire(this.__usdzBlobUrl),this.__usdzBlobUrl}async getGlbUrlForAr(){return this.hasSceneChanged?this.__glbBlobUrl=await this.renderEngine.getSceneAsGlbUrl():window.epigraph.logger.info({title:"Reusing cached GLB for AR."}),this.appEvents.arModelReadyEvent.fire(this.__glbBlobUrl),{glbSrc:this.__glbBlobUrl,variantName:null}}async launchAR(){if(!this.isLoading)return await this.viewInYourSpaceManager.launchAR()}async spawnProductInScene(e){const t=new EC(e);return this.renderEngine.sceneHierarchy.sceneStructure.add(t),await this._onSceneHierarchyUpdate(),Promise.resolve(t)}showDimensions(){this.dimensionsManager.enabled=!0,this.areDimensionsActive=!0,this.renderEngine.setDimensionsVisibility(this.dimensionsManager.enabled);const e=this.getSceneSphericalBoundsForCameraFocus();e.radius=e.radius*1.4,this.cameraManager.fitCameraToObject({objectToFocus:e})}hideDimensions(e=!1){if(this.dimensionsManager.enabled=!1,this.areDimensionsActive=!1,this.renderEngine.setDimensionsVisibility(this.dimensionsManager.enabled),!e){const t=this.getSceneSphericalBoundsForCameraFocus();this.cameraManager.fitCameraToObject({objectToFocus:t})}}getDimensions(){const e=this.dimensionsManager.getCurrentDimensionsState(),t=this.dimensionsManager.dimensionsUnit;return{length:e.length.distance,width:e.width.distance,height:e.height.distance,unit:t}}printSceneHierarchy(){this.renderEngine.printSceneHierarchy()}showCameraAim(){this.cameraAimElemRef.classList.remove("hide")}hideCameraAim(){this.cameraAimElemRef.classList.add("hide")}showHelp(){this.isHelpVisible=!0}hideHelp(){this.isHelpVisible=!1}toggleHelp(){this.isHelpVisible=!this.isHelpVisible}showHotspots(){window.epigraph.logger.info({title:"Showing Hotspots"}),this.areHotspotsActive=!0,this.appEvents.hotspotsVisibilityChanged.fire({visible:!0})}hideHotspots(){window.epigraph.logger.info({title:"Hiding Hotspots"}),this.areHotspotsActive=!1,this.appEvents.hotspotsVisibilityChanged.fire({visible:!1})}toggleHotspots(){this.hotspotsManager.enabled?this.hideHotspots():this.showHotspots()}updateHotspotsOrder(e){this.hotspotsManager.updateHotspotsOrder(e)}openHotspot({hotspotId:e,state:t}){this.hotspotsManager.openHotspot({hotspotId:e,state:t})}closeActiveHotspot(){this.hotspotsManager.closeActiveHotspot()}setActiveHotspotState(e){this.hotspotsManager.setActiveHotspotState(e)}nextHotspot(){return this.hotspotsManager.nextHotspot()}previousHotspot(){return this.hotspotsManager.previousHotspot()}getActiveHotspot(){return this.hotspotsManager.activeHotspot}areHotspotsVisible(){return this.hotspotsManager.enabled}getAllHotspots(){return Array.from(this.hotspotsManager.hotspots.values())}getAllHotspotIds(){return Array.from(this.hotspotsManager.hotspots.keys())}getHotspotById(e){return this.hotspotsManager.hotspots.get(e)}createHotspots(e){this.hotspotsManager.createHotspots(e)}updateHotspots(e){this.hotspotsManager.updateHotspots(e)}removeHotspots(e){this.hotspotsManager.removeHotspots(e)}async triggerCameraInteractionPrompt(e=2){this.renderEngine.showCameraInteractionPromptIndicator();for(let t=0;t<e;t++)await this.cameraManager.wiggleCamera(),await Ft.wait(500);setTimeout(()=>{this.playInteractionPrompt=!this._isSceneInteractedWith},3e3)}getAllAnimations(){return[]}getAllAnimationNames(){return[]}playAnimationByName({animationName:e,loop:t=!1,repetitions:i=1/0}){if(!e)return;const a=this.getAllAnimationNames();if(!a.includes(e)){window.epigraph.logger.warn({title:`Invalid animation name: ${e}. Expand for a list of valid names`,details:a});return}const l=a.indexOf(e),u=this.getAllAnimations()[l];u.fadeIn(this._animationFadeDurationInMiliseconds*.001),u.setLoop(t?Ua:Cl,i),u.play(),this._activeAnimations.set(e,u)}stopAnimationByName(e){if(!e)return;const t=this.getAllAnimationNames();if(!t.includes(e)){window.epigraph.logger.warn({title:`Invalid animation name: ${e}. Expand for a list of valid names`,details:t});return}const i=t.indexOf(e),a=this.getAllAnimations()[i];a.fadeOut(this._animationFadeDurationInMiliseconds*.001),setTimeout(()=>{a.stop()},this._animationFadeDurationInMiliseconds),this._activeAnimations.delete(e)}pauseActiveAnimations(e){for(const t of this._activeAnimations.values())t.paused=!0,e!==void 0&&(t.weight=e)}resumeActiveAnimations(){for(const e of this._activeAnimations.values())e.paused=!1,e.weight=1}stopAllAnimations(){for(const[e,t]of this._activeAnimations.entries())t.fadeOut(this._animationFadeDurationInMiliseconds*.001),setTimeout(()=>{t.stop(),this._activeAnimations.delete(e)},this._animationFadeDurationInMiliseconds)}postRenderFrameUpdateInEngine(e){try{this.cameraManager.mainCameraControls.update(e),this.renderEngine.mainRenderer.render(this.renderEngine.scene,this.cameraManager.cameras.main)}catch(t){return t}}getScreenPositionFromWorld(e){const t=new $e,i=this.cameraManager.cameras.main,a=this.renderEngine.canvas.clientWidth*.5,l=this.renderEngine.canvas.clientHeight*.5,d=e.clone().project(i);return t.x=(d.x+1)*a,t.y=-(d.y-1)*l,t}_renderAppCanvasContainer(){return this.featuresToEnable.viewer?Ee`
6507
6507
  <div id="appCanvasContainer" class="app-canvas-container">
6508
6508
  <span id="cameraAimIndicator" class="camera-aim-indicator hide"></span>
6509
6509
  </div>
@@ -6623,7 +6623,7 @@ void main() {
6623
6623
  class="splash-screen"
6624
6624
  current-progress=${this._loadingProgress}
6625
6625
  ></epg-loader-scene>
6626
- `}async _resetSession(){await this.renderEngine.emptyScene(),this.assetManager.assets.clear(),this._autoGeneratedProxyMesh.scale.set(1,1,1),this._autoGeneratedProxyMesh.position.set(0,0,0),this._autoGeneratedProxyMesh.updateMatrixWorld()}_setupEventListeners(){window.epigraph.logger.info({title:"Setting up event listeners for this app."}),this.addEventListener(this.appEvents.dimensionsPositionChanged.name,this.__onDimensionsPositionChanged),this.addEventListener(this.appEvents.cameraControlsStart.name,e=>{switch(e.detail.type){case"rotate":this.style.cursor="grabbing";break;case"pan":this.style.cursor="move",this.showCameraAim();break}this.hotspotsManager&&this.hotspotsManager.activeHotspot&&this.hotspotsManager.closeActiveHotspot()}),this.addEventListener(this.appEvents.inputEnd.name,()=>{this.style.cursor="grab",this.hideCameraAim()}),this.addEventListener(this.appEvents.hotspotOpenEvent.name,()=>{this.hideDimensions(!0)}),this.addEventListener(this.appEvents.assetLoadProgress.name,e=>{this._loadingProgress=e.detail.progress}),this.addEventListener(this.appEvents.hotspotOpenEvent.name,e=>{this._isActiveHotspot=!0,this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)}),this.addEventListener(this.appEvents.hotspotNextEvent.name,e=>{this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)}),this.addEventListener(this.appEvents.hotspotPreviousEvent.name,e=>{this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)}),this.addEventListener(this.appEvents.hotspotClosedEvent.name,e=>{this._isActiveHotspot=!1;const i=this.hotspotsManager.hotspots.get(e.detail.hotspotId)?.animation;if(i)for(const a of i){const l=a.loop,u=a.exit;l&&this.stopAnimationByName(l),u&&this.playAnimationByName({animationName:u})}}),this.appCanvasContainerElemRef.onpointerdown=e=>{this.playInteractionPrompt=!1,this._isSceneInteractedWith=!0,this.hideHelp(),this.appEvents.inputStart.fire({event:e})},this.appCanvasContainerElemRef.onpointermove=e=>{this.appEvents.inputMove.fire({event:e})},this.appCanvasContainerElemRef.onpointerup=e=>{this.appEvents.inputEnd.fire({event:e})},this.appCanvasContainerElemRef.onpointerout=e=>{this.appEvents.inputEnd.fire({event:e})},this.cameraManager.mainCameraControls.addEventListener("update",this._onCameraPositionUpdate.bind(this))}_onCameraPositionUpdate(){this.dimensionsManager?.enabled&&this._repopulateDimensions(),this.hotspotsManager?.enabled&&this.hotspotsManager.recalculateHotspotPositions()}_setupAutoGeneratedProxyContainers(){const e=new Kn,t=new Li({color:65280,opacity:.5,transparent:!0});this._autoGeneratedProxyMesh=new lt(e,t)}async _setup(){window.epigraph.logger.table({title:"Setting up..."}),this._appEvents=new Xx(this),this._assetManager=new RU(this),this._cameraManager=new DU({appWcRef:this}),this._sceneManager=new a3(this),await this.setupRenderEngine(),await this._cameraManager.setup({mainRenderer:this.renderEngine.mainRenderer,screenshotRenderer:this.renderEngine.screenshotRenderer,cameraSettings:this.renderEngine.renderEngineSettings.camera}),this._setupAutoGeneratedProxyContainers(),this._setupEventListeners()}_resolveAnimationsOnHotspotEntry(e){this.stopAllAnimations();for(const t of e)this._activeAnimations.get(t.entry)||this.playAnimationByName({animationName:t.entry}),setTimeout(()=>{this._activeAnimations.delete(t.entry),this._activeAnimations.get(t.loop)?.loop||this.playAnimationByName({animationName:t.loop,loop:!0})},this._animationFadeDurationInMiliseconds)}_renderDimensionsManager(){let e=Ve;return this.featuresToEnable.dimensions&&(VU.setupWebComponent(),e=Ee`
6626
+ `}async _resetSession(){await this.renderEngine.emptyScene(),this.assetManager.assets.clear(),this._autoGeneratedProxyMesh.scale.set(1,1,1),this._autoGeneratedProxyMesh.position.set(0,0,0),this._autoGeneratedProxyMesh.updateMatrixWorld()}_setupEventListeners(){window.epigraph.logger.info({title:"Setting up event listeners for this app."}),this.addEventListener(this.appEvents.dimensionsPositionChanged.name,this.__onDimensionsPositionChanged),this.addEventListener(this.appEvents.cameraControlsStart.name,e=>{switch(e.detail.type){case"rotate":this.style.cursor="grabbing";break;case"pan":this.style.cursor="move",this.showCameraAim();break}this.hotspotsManager&&this.hotspotsManager.activeHotspot&&this.pickerState===!1&&this.hotspotsManager.closeActiveHotspot()}),this.addEventListener(this.appEvents.inputEnd.name,()=>{this.style.cursor="grab",this.hideCameraAim()}),this.addEventListener(this.appEvents.hotspotOpenEvent.name,()=>{this.hideDimensions(!0)}),this.addEventListener(this.appEvents.assetLoadProgress.name,e=>{this._loadingProgress=e.detail.progress}),this.addEventListener(this.appEvents.hotspotOpenEvent.name,e=>{this._isActiveHotspot=!0,this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)}),this.addEventListener(this.appEvents.hotspotNextEvent.name,e=>{this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)}),this.addEventListener(this.appEvents.hotspotPreviousEvent.name,e=>{this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)}),this.addEventListener(this.appEvents.hotspotClosedEvent.name,e=>{this._isActiveHotspot=!1;const i=this.hotspotsManager.hotspots.get(e.detail.hotspotId)?.animation;if(i)for(const a of i){const l=a.loop,u=a.exit;l&&this.stopAnimationByName(l),u&&this.playAnimationByName({animationName:u})}}),this.appCanvasContainerElemRef.onpointerdown=e=>{this.playInteractionPrompt=!1,this._isSceneInteractedWith=!0,this.hideHelp(),this.appEvents.inputStart.fire({event:e})},this.appCanvasContainerElemRef.onpointermove=e=>{this.appEvents.inputMove.fire({event:e})},this.appCanvasContainerElemRef.onpointerup=e=>{this.appEvents.inputEnd.fire({event:e})},this.appCanvasContainerElemRef.onpointerout=e=>{this.appEvents.inputEnd.fire({event:e})},this.cameraManager.mainCameraControls.addEventListener("update",this._onCameraPositionUpdate.bind(this))}_onCameraPositionUpdate(){this.dimensionsManager?.enabled&&this._repopulateDimensions(),this.hotspotsManager?.enabled&&this.hotspotsManager.recalculateHotspotPositions()}_setupAutoGeneratedProxyContainers(){const e=new Kn,t=new Li({color:65280,opacity:.5,transparent:!0});this._autoGeneratedProxyMesh=new lt(e,t)}async _setup(){window.epigraph.logger.table({title:"Setting up..."}),this._appEvents=new Xx(this),this._assetManager=new RU(this),this._cameraManager=new DU({appWcRef:this}),this._sceneManager=new a3(this),await this.setupRenderEngine(),await this._cameraManager.setup({mainRenderer:this.renderEngine.mainRenderer,screenshotRenderer:this.renderEngine.screenshotRenderer,cameraSettings:this.renderEngine.renderEngineSettings.camera}),this._setupAutoGeneratedProxyContainers(),this._setupEventListeners()}_resolveAnimationsOnHotspotEntry(e){this.stopAllAnimations();for(const t of e)this._activeAnimations.get(t.entry)||this.playAnimationByName({animationName:t.entry}),setTimeout(()=>{this._activeAnimations.delete(t.entry),this._activeAnimations.get(t.loop)?.loop||this.playAnimationByName({animationName:t.loop,loop:!0})},this._animationFadeDurationInMiliseconds)}_renderDimensionsManager(){let e=Ve;return this.featuresToEnable.dimensions&&(VU.setupWebComponent(),e=Ee`
6627
6627
  <dimensions-manager
6628
6628
  id="dimensionsManager"
6629
6629
  .appWcRef=${this}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epigraph/solutions",
3
- "version": "1.0.0-alpha-3",
3
+ "version": "1.0.0-alpha-4",
4
4
  "type": "module",
5
5
  "main": "./dist/epigraph-solutions.js",
6
6
  "files": [