@epigraph/solutions 0.19.0-canary.11 → 0.19.0-canary.12
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.
|
@@ -6796,7 +6796,7 @@ Arguments: [`+B+"]"}},s.fz.prototype={k(n){return"Unsupported operation: "+this.
|
|
|
6796
6796
|
.hotspot-indicator.occluded {
|
|
6797
6797
|
opacity: 0.3;
|
|
6798
6798
|
}
|
|
6799
|
-
`}get config(){return this.__config}get position(){return this.entity.getWorldPosition(this.__worldPosition),this.__worldPosition}__updateHotspotNormals(){const e=new se;this.appWcRef.sceneManager.currentSceneBounds.getCenter(e),this.normals.subVectors(this.position,e)}updateHotspotConfig(e){this.header=e.header,this.carousel=e.carousel,this.details=e.details,this.__localPosition.set(e.position.x,e.position.y,e.position.z),this.__updateHotspotNormals(),this.camera.position.set(e.camera.position.x,e.camera.position.y,e.camera.position.z),this.camera.target.set(e.camera.target.x,e.camera.target.y,e.camera.target.z),this.camera.focalLength=e.camera.focalLength,this.animation=e.animation,e.desktopPlacement&&(this.desktopPlacement=e.desktopPlacement)}_onHotspotClick(){this.hotspotsManager.activeHotspot||(this.visited=!0,this.appWcRef.eventsManager.hotspotClickedEvent.fire({hotspot:this}))}__isFacingCamera(){return this.appWcRef.cameraManager.getCameras().main.getWorldDirection(this.__cameraDirection),this.normals.angleTo(this.__cameraDirection)>Math.PI/2.2}renderAnnotationTemplate(e){const t=e!==void 0&&e===this.hotspotId;if(this.hotspotsManager.activeHotspot&&!t)return $e;this.screenPosition=this.appWcRef.getScreenPositionFromWorld(this.position);const i=e!==void 0&&e!==this.hotspotId;let a="top-left";return this.screenPosition.y>this.appWcRef.canvasSize.height*.12?a="top":a="bottom",this.screenPosition.x>this.appWcRef.canvasSize.width*.5?a+="-right":a+="-left",Ee`
|
|
6799
|
+
`}get config(){return this.__config}get position(){return this.entity.getWorldPosition(this.__worldPosition),this.__worldPosition}__updateHotspotNormals(){const e=new se;this.appWcRef.sceneManager.currentSceneBounds.getCenter(e),this.normals.subVectors(this.position,e)}updateHotspotConfig(e){this.header=e.header,this.carousel=e.carousel,this.details=e.details,this.__localPosition.set(e.position.x,e.position.y,e.position.z),this.entity.position.set(e.position.x,e.position.y,e.position.z),this.__updateHotspotNormals(),this.camera.position.set(e.camera.position.x,e.camera.position.y,e.camera.position.z),this.camera.target.set(e.camera.target.x,e.camera.target.y,e.camera.target.z),this.camera.focalLength=e.camera.focalLength,this.animation=e.animation,e.desktopPlacement&&(this.desktopPlacement=e.desktopPlacement)}_onHotspotClick(){this.hotspotsManager.activeHotspot||(this.visited=!0,this.appWcRef.eventsManager.hotspotClickedEvent.fire({hotspot:this}))}__isFacingCamera(){return this.appWcRef.cameraManager.getCameras().main.getWorldDirection(this.__cameraDirection),this.normals.angleTo(this.__cameraDirection)>Math.PI/2.2}renderAnnotationTemplate(e){const t=e!==void 0&&e===this.hotspotId;if(this.hotspotsManager.activeHotspot&&!t)return $e;this.screenPosition=this.appWcRef.getScreenPositionFromWorld(this.position);const i=e!==void 0&&e!==this.hotspotId;let a="top-left";return this.screenPosition.y>this.appWcRef.canvasSize.height*.12?a="top":a="bottom",this.screenPosition.x>this.appWcRef.canvasSize.width*.5?a+="-right":a+="-left",Ee`
|
|
6800
6800
|
<epg-tool-hotspot
|
|
6801
6801
|
class="hotspot-indicator ${i?"inactive":""} ${this.__isFacingCamera()?"":"occluded"}"
|
|
6802
6802
|
style="left: ${this.screenPosition.x}px; top: ${this.screenPosition.y}px"
|
|
@@ -7028,7 +7028,7 @@ Arguments: [`+B+"]"}},s.fz.prototype={k(n){return"Unsupported operation: "+this.
|
|
|
7028
7028
|
}
|
|
7029
7029
|
}
|
|
7030
7030
|
}
|
|
7031
|
-
`]}updateActiveHotspotIndex(){this.activeHotspot&&(this.activeHotspotIndex=this.hotspotsOrder.indexOf(this.activeHotspot?.hotspotId))}static setupWebComponent(){window.customElements.get(kd.webComponentName)||window.customElements.define(kd.webComponentName,kd)}firstUpdated(e){super.firstUpdated(e),this.__setupEventListeners()}updated(e){if(e.has("__cardsState")){const i=this.__currentCardsPerView,a=this.__cardsState===ji.collapsed?1.2:1.03;if(wt.animateValue(i,a,500,l=>{this.__currentCardsPerView=l}),this?.cardsCarouselSwiperContainer?.swiper!==void 0){this.cardsCarouselSwiperContainer.swiper.allowTouchMove=this.__cardsState===ji.collapsed;const l=this.cardsCarouselSwiperContainer.querySelectorAll("epg-card");for(const u of l)u.showPreviousButton=this.__cardsState===ji.expanded&&!u.hasAttribute("is-first-hotspot"),u.showNextButton=this.__cardsState===ji.expanded&&!u.hasAttribute("is-last-hotspot")}}e.get("activeHotspotIndex")>=0&&this.cardsCarouselSwiperContainer.swiper.slideTo(this.activeHotspotIndex,400)}addHotspot(e,t=!0){const i=new Sw({config:e,appWcRef:this.appWcRef,hotspotManagerRef:this});this.hotspots.set(i.hotspotId,i);const a=this.appWcRef.sceneManager.sceneStructure.getEntityForAssetId(e.assetId);a&&a.addHotspot(i),t&&this.updateHotspotsOrder(Array.from(this.hotspots.keys()))}updateHotspot(e,t){const i=this.hotspots.get(e);i
|
|
7031
|
+
`]}updateActiveHotspotIndex(){this.activeHotspot&&(this.activeHotspotIndex=this.hotspotsOrder.indexOf(this.activeHotspot?.hotspotId))}static setupWebComponent(){window.customElements.get(kd.webComponentName)||window.customElements.define(kd.webComponentName,kd)}firstUpdated(e){super.firstUpdated(e),this.__setupEventListeners()}updated(e){if(e.has("__cardsState")){const i=this.__currentCardsPerView,a=this.__cardsState===ji.collapsed?1.2:1.03;if(wt.animateValue(i,a,500,l=>{this.__currentCardsPerView=l}),this?.cardsCarouselSwiperContainer?.swiper!==void 0){this.cardsCarouselSwiperContainer.swiper.allowTouchMove=this.__cardsState===ji.collapsed;const l=this.cardsCarouselSwiperContainer.querySelectorAll("epg-card");for(const u of l)u.showPreviousButton=this.__cardsState===ji.expanded&&!u.hasAttribute("is-first-hotspot"),u.showNextButton=this.__cardsState===ji.expanded&&!u.hasAttribute("is-last-hotspot")}}e.get("activeHotspotIndex")>=0&&this.cardsCarouselSwiperContainer.swiper.slideTo(this.activeHotspotIndex,400)}addHotspot(e,t=!0){const i=new Sw({config:e,appWcRef:this.appWcRef,hotspotManagerRef:this});this.hotspots.set(i.hotspotId,i);const a=this.appWcRef.sceneManager.sceneStructure.getEntityForAssetId(e.assetId);a&&a.addHotspot(i),t&&this.updateHotspotsOrder(Array.from(this.hotspots.keys()))}updateHotspot(e,t){const i=this.hotspots.get(e);if(!i){window.epigraph.logger.error({title:`Invalid hotspot ID: ${e}`});return}i.updateHotspotConfig(t),this.__resolveHotspotCardContents()}removeHotspot(e,t=!0){this.hotspots.delete(e),t&&this.updateHotspotsOrder(Array.from(this.hotspots.keys()))}stepHotspots(e){const t=this.activeHotspotIndex;if(t===null)return;const i=this.hotspotsOrder.length;let a=t;e==="next"?(a=t+1,a>=i&&(a=0)):e==="prev"&&(a=t-1,a<0&&(a=i-1));const l=this.hotspotsOrder[a];this.setActiveHotspot({hotspotId:l})}nextHotspot(){return this.stepHotspots("next"),this.appWcRef.eventsManager.hotspotNextEvent.fire({hotspot:this.activeHotspot}),this.activeHotspot}previousHotspot(){return this.stepHotspots("prev"),this.appWcRef.eventsManager.hotspotPreviousEvent.fire({hotspot:this.activeHotspot}),this.activeHotspot}openHotspot({hotspotId:e,state:t,skipHotspotOpenEvent:i=!1}){this.appWcRef.playInteractionPrompt=!1,this.setActiveHotspot({hotspotId:e,state:t}),i||this.appWcRef.eventsManager.hotspotOpenEvent.fire({hotspot:this.activeHotspot});const a=new tr(!0,tr.PANEL_TYPE.HOTSPOT_PANEL,tr.TRIGGER_SOURCE.HOTSPOT,[]);this.appWcRef.epigraphAnalytics.sendEvent(a)}closeActiveHotspot(){const e=this.activeHotspot?.hotspotId;this.setActiveHotspot({hotspotId:null}),this.appWcRef.eventsManager.hotspotClosedEvent.fire({hotspotId:e});const t=new ir(!0,ir.PANEL_TYPE.HOTSPOT_PANEL,ir.TRIGGER_SOURCE.BUTTON,[]);this.appWcRef.epigraphAnalytics.sendEvent(t)}updateHotspotsOrder(e){this.hotspotsOrder=e}removeAllHotspots(){for(const e of this.hotspots.keys())this.removeHotspot(e)}setActiveHotspotByIndex(e){const t=this.hotspotsOrder[e];this.setActiveHotspot({hotspotId:t,state:this.__cardsState})}setActiveHotspot({hotspotId:e,state:t=this.__cardsState}){if(this.activeHotspot?.hotspotId===e)return;if(e===null){const a=!!this.activeHotspot;this.activeHotspot=void 0,this.updateActiveHotspotIndex(),a&&this.appWcRef.cameraManager.resetCurrentCameraTransformsToLastSavedState();return}this.enabled===!1&&(this.enabled=!0);const i=!this.activeHotspot;if(this.activeHotspot=this.hotspots.get(e),this.updateActiveHotspotIndex(),this.setActiveHotspotState(t),this.__resolveHotspotCardContents(),this.appWcRef.eventsManager.cameraMoveToTransform.fire({cameraTransforms:this.activeHotspot?.camera,saveFirst:i}),this.appWcRef.isPortraitOrientation){const a=this.appWcRef.cameraManager.mainCameraControls,l=new se;a.getTarget(l,!0);const u=new se;a.getPosition(u,!0),a.setLookAt(u.x-l.x,u.y,u.z-l.z,0,l.y,0,!0),a.setFocalOffset(0,.1,0,!0)}}expandCards(){this.__cardsState=ji.expanded}collapseCards(){this.__cardsState=ji.collapsed}setActiveHotspotState(e=ji.collapsed){if(this.activeHotspot)switch(this.appWcRef.clientHeight<420&&(e=ji.expanded),e){case ji.collapsed:this.collapseCards();break;case ji.expanded:this.expandCards();break}}__resolveHotspotCardContents(){this.__allCards=[];let e=0;const t=this.hotspots.size-1,i=this.hotspots.size>1;for(const a of this.hotspots.values()){const l=e===0,u=e===t,d=Ee`
|
|
7032
7032
|
<swiper-slide part="swiper-slide">
|
|
7033
7033
|
<style>
|
|
7034
7034
|
.expand-button {
|