@expofp/floorplan 3.24.0 → 3.24.2
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.
- package/dist/browser/{Button-Bw0hqT6o.js → Button-CT9Bti9C.js} +5 -5
- package/dist/browser/{CookieConsent-DAoC1-xI.js → CookieConsent-BUaaCjVv.js} +7 -7
- package/dist/browser/{Debug-3VToRuwQ.js → Debug-CuT7wVcD.js} +7 -7
- package/dist/browser/{Demo-BYUTTvOd.js → Demo-CypZUOYb.js} +9 -9
- package/dist/browser/{Free-CtdSA5bo.js → Free-Cpbw3FP6.js} +9 -9
- package/dist/browser/{GalleryContainer-D7tIVZPr.js → GalleryContainer-DX9JoE1-.js} +10 -10
- package/dist/browser/{GpsLoader-q-Mc4g77.js → GpsLoader-BMBhGhOH.js} +10 -10
- package/dist/browser/{KioskStore-CAS07rsa.js → KioskStore-BKn-AB-4.js} +4 -4
- package/dist/browser/{MaplibreAdapter-CEgsHtMU.js → MaplibreAdapter-C7PhujTO.js} +236 -214
- package/dist/browser/{ModalContainer-gqVQe0mT.js → ModalContainer-Bwo9p8q9.js} +10 -10
- package/dist/browser/{PermissionNotice-CNmf5lZ2.js → PermissionNotice-Dyrq3hyS.js} +6 -6
- package/dist/browser/{SetKioskMode-C2jN1b9b.js → SetKioskMode-CcoLQ3g5.js} +8 -8
- package/dist/browser/{ShowKiosk-8zZRT4DP.js → ShowKiosk-1PcWb3Yn.js} +10 -10
- package/dist/browser/{ViewerMenuPanel-CLYKOSWi.js → ViewerMenuPanel-CF8_jUkV.js} +9 -9
- package/dist/browser/{add-debug-secret-listener-Dumma9XW.js → add-debug-secret-listener-DtSLeszR.js} +1 -1
- package/dist/browser/{adopt-global-settings-B2I-44tK.js → adopt-global-settings-jN08Mvz2.js} +9 -9
- package/dist/browser/{boolean-editor-BL-iAvZv.js → boolean-editor-BbQkdkV8.js} +9 -9
- package/dist/browser/{bootIntercom-DNhRU_h3.js → bootIntercom-tmWxI34Q.js} +2 -2
- package/dist/browser/{booth-by-xy-BPzI_I_r.js → booth-by-xy-Bn7vAiW7.js} +6 -6
- package/dist/browser/bundle.json +65 -65
- package/dist/browser/{classnames-BwuQCVfY.js → classnames-z85nK_ce.js} +2 -2
- package/dist/browser/{client-CkkTg10f.js → client-BzyumV4c.js} +4 -4
- package/dist/browser/{components-xW0xn4HR.js → components-tvzV2Bmo.js} +36 -36
- package/dist/browser/{debug-overlay-BY_f3k5v.js → debug-overlay-C3yeye6L.js} +10 -10
- package/dist/browser/{debug-ui-COPw_jJ2.js → debug-ui-CVhF-KaS.js} +6 -6
- package/dist/browser/{dist-CZOs6dlD.js → dist-4gxnxibz.js} +3 -3
- package/dist/browser/{dist-D6TtmmNR.js → dist-BvldLH3X.js} +5 -5
- package/dist/browser/{dist-CmtO-q5U.js → dist-DhmiIFdt.js} +6 -6
- package/dist/browser/{efp-debug-init-DbuQ2yZ4.js → efp-debug-init-XDZpnwBR.js} +3 -3
- package/dist/browser/{enum-editor-ChCH_AbI.js → enum-editor-CO0TOOg_.js} +4 -4
- package/dist/browser/{es5-CHdGSiQh.js → es5-BONrcV9Q.js} +2 -2
- package/dist/browser/{event-not-found-BehJpGAv.js → event-not-found-BNlgAobh.js} +1 -1
- package/dist/browser/{exports-D6Lf24yv.js → exports-CahN8vwa.js} +1 -1
- package/dist/browser/{favicon-C6VPDk5V.js → favicon-BEwJyQw4.js} +1 -1
- package/dist/browser/{fetch-retry.umd-CAHs6cmO.js → fetch-retry.umd-BvmmPMO4.js} +2 -2
- package/dist/browser/{flex-Dd2gfX5v.js → flex-Bhy5-dRM.js} +5 -5
- package/dist/browser/{floorplan.loader-DNDB13gB.js → floorplan.loader-Bm0C_zg8.js} +10 -10
- package/dist/browser/{floorplan.ready-DdXVp9Bo.js → floorplan.ready-DHOYde8O.js} +14 -14
- package/dist/browser/{fuse-DjbxK1_r.js → fuse-BjPDB9cu.js} +2 -2
- package/dist/browser/{i18n-DNHCTIl_.js → i18n-Bsa4AB8X.js} +5 -5
- package/dist/browser/index.js +14 -14
- package/dist/browser/{index.module-BgjhhzkD.js → index.module-DkCBvLVi.js} +4 -4
- package/dist/browser/{integrateKiosk-DJW2dIlz.js → integrateKiosk-BCZ-cnik.js} +4 -4
- package/dist/browser/{is-webview-ymBXdDWY.js → is-webview-BAAplPh1.js} +1 -1
- package/dist/browser/{jsx-runtime-9dbUZslp.js → jsx-runtime-DkDpaV-S.js} +2 -2
- package/dist/browser/{kiosk-record-C-ZbQR1P.js → kiosk-record-x3W__3xS.js} +1 -1
- package/dist/browser/{lib-CivfxMxt.js → lib-BpicJGKy.js} +3 -3
- package/dist/browser/{loadImage-DOmtMmNj.js → loadImage-4_-hyOhx.js} +4 -4
- package/dist/browser/{logDeviceInfo-ZMWKzrjm.js → logDeviceInfo-ChUkf64r.js} +9 -9
- package/dist/browser/{main-BQPKEs3u.js → main-CD7xHGU2.js} +1 -1
- package/dist/browser/{mobx-CmQWlos3.js → mobx-BKpyIsVh.js} +4 -4
- package/dist/browser/{optional-boolean-editor-DxUi2Auz.js → optional-boolean-editor-B4R2CbJ8.js} +3 -3
- package/dist/browser/{optional-enum-editor-DH_Sbb5_.js → optional-enum-editor-ChNfPhsB.js} +4 -4
- package/dist/browser/{optional-string-editor-DjvpIPIy.js → optional-string-editor-D8tXuwta.js} +4 -4
- package/dist/browser/{particles.min-BPPTx23M.js → particles.min-FpEw6-hB.js} +2 -2
- package/dist/browser/{react-DC0_Dc5U.js → react-Q3vwxMD4.js} +2 -2
- package/dist/browser/{react-dom-BvbU6dCN.js → react-dom-CwvsoFuP.js} +3 -3
- package/dist/browser/{rolldown-runtime-DhRBYm2e.js → rolldown-runtime-D85GpSbU.js} +1 -1
- package/dist/browser/{select-D0UxO-rY.js → select-IG7dubaJ.js} +10 -10
- package/dist/browser/{settings-DLUbCP3F.js → settings-DmxMI46b.js} +2 -2
- package/dist/browser/{settings-item-YF8fKRZY.js → settings-item-yCIWkzxL.js} +6 -6
- package/dist/browser/{store-Bn4GUIsw.js → store-lvPK1tXK.js} +12 -16
- package/dist/browser/{string-editor-BTNVGDDd.js → string-editor-HCbCYvjk.js} +4 -4
- package/dist/browser/{text-field-Dtzv6Odi.js → text-field-ZCkMcWLU.js} +5 -5
- package/dist/browser/{theme-BRK-tpxv.js → theme-BwOMq2a4.js} +8 -8
- package/dist/browser/{ui-qNmuus3-.js → ui-CxwXSxPR.js} +8 -8
- package/dist/browser/{useRenderTarget-FWd5uFIq.js → useRenderTarget-D3FPy6Mq.js} +4 -4
- package/dist/esm/components/Maplibre/MaplibreWrapper.js +1 -1
- package/dist/esm/components/Maplibre/utils/update-pump.d.ts +18 -0
- package/dist/esm/components/Maplibre/utils/update-pump.js +1 -0
- package/dist/esm/store/RouteStore.js +1 -1
- package/package.json +9 -9
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
(function() {
|
|
2
2
|
try {
|
|
3
3
|
var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
|
4
|
-
e.SENTRY_RELEASE = { id: "3.24.
|
|
4
|
+
e.SENTRY_RELEASE = { id: "3.24.2" };
|
|
5
5
|
var t = new e.Error().stack;
|
|
6
6
|
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "7407e64e-4c4e-4bfb-b2ef-80063ad22998", e._sentryDebugIdIdentifier = "sentry-dbid-7407e64e-4c4e-4bfb-b2ef-80063ad22998");
|
|
7
7
|
} catch {}
|
|
8
8
|
})();
|
|
9
|
-
import { r as e } from "./rolldown-runtime-
|
|
10
|
-
import { t } from "./react-
|
|
11
|
-
import { l as n } from "./store-
|
|
9
|
+
import { r as e } from "./rolldown-runtime-D85GpSbU.js";
|
|
10
|
+
import { t } from "./react-Q3vwxMD4.js";
|
|
11
|
+
import { l as n } from "./store-lvPK1tXK.js";
|
|
12
12
|
//#region ../ui/src/shared/activeElement.ts
|
|
13
13
|
var r = (e) => !!e && "activeElement" in e;
|
|
14
14
|
function i(e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as B}from"react/jsx-runtime";import"maplibre-gl/dist/maplibre-gl.css";import{Renderer as N}from"@expofp/renderer";import{addProtocol as
|
|
1
|
+
import{jsx as B}from"react/jsx-runtime";import"maplibre-gl/dist/maplibre-gl.css";import{Renderer as N}from"@expofp/renderer";import{addProtocol as G,Map as Y}from"maplibre-gl";import{Protocol as k}from"pmtiles";import{useEffect as E,useRef as l}from"react";import{createStyleTransform as q}from"./utils/resolve-map-style";import{createUpdatePump as H}from"./utils/update-pump";export const MAP_DIM_LAYER_ID="expofp-map-dim";const y="expofp-map-dim-source",J="3d-expofp";let g=null;const Q=["coalesce",["get","name:en"],["get","name_en"],["get","name:latin"],["get","name"]],V={type:"Feature",geometry:{type:"Polygon",coordinates:[[[-180,-85],[180,-85],[180,85],[-180,85],[-180,-85]]]},properties:{}};function I(e){if(!e||typeof e!="object")return!1;const r=e.length;if(typeof r!="number"||r<16)return!1;const o=e[0];return typeof o=="number"&&Number.isFinite(o)}function W(e){if(I(e))return Array.from(e);const o=e?.defaultProjectionData?.mainMatrix;return I(o)?Array.from(o):(console.warn("Maplibre custom layer received an unsupported projection matrix payload.",e),null)}function b(e){return typeof e=="string"?e.includes("name"):Array.isArray(e)?e.some(r=>b(r)):!e||typeof e!="object"?!1:Object.values(e).some(r=>b(r))}function X(e){return e.type!=="symbol"||!e.id||!e.layout?!1:b(e.layout["text-field"])}function K(e){const r=e.getStyle();for(const o of r.layers??[])X(o)&&e.setLayoutProperty(o.id,"text-field",Q)}function $(){if(!g){g=new k;try{G("pmtiles",g.tile)}catch(e){console.warn("Maplibre PMTiles protocol registration failed.",e)}}}export default function v({sceneDef:e,geoConfig:r,staticTransform:o,tileSource:w,mapOptions:O,onRendererReady:h,onMapDimLayerReady:x,onMapLoadError:M}){const d=l(null),P=l(null),a=l(null),L=l(h),S=l(x),_=l(M),C=l({sceneDef:e,geoConfig:r,staticTransform:o,tileSource:w,mapOptions:O});return E(()=>{L.current=h,S.current=x,_.current=M}),E(()=>{if(!d.current)return;const{sceneDef:m,geoConfig:n,staticTransform:F,tileSource:A,mapOptions:f}=C.current;let p=!1;const u={...m};u.rootLayer={...m.rootLayer};const T=m.rootLayer.children;u.rootLayer.children=T.filter(i=>i?.name?.toString().toLowerCase()!=="areamap"),u.background=void 0,u.staticTransform=F,$();const z=n.bounds?{bounds:n.bounds,fitBoundsOptions:{padding:n.fitPadding,bearing:n.bearing}}:{center:n.center,zoom:n.zoom},j=q(A.style),t=new Y({container:d.current,...z,bearing:n.bearing,pitch:f?.pitch??30,maxPitch:f?.maxPitch??70,minZoom:f?.minZoom,maxZoom:f?.maxZoom,maxBounds:f?.maxBounds,bearingSnap:0,canvasContextAttributes:{antialias:!0}});n.zoomAdjustment&&t.jumpTo({zoom:t.getZoom()+n.zoomAdjustment}),P.current=t,t.once("error",i=>{t.isStyleLoaded()||_.current?.(i?.error??i)});const R=i=>{const s=i?.id;!s||t.hasImage(s)||t.addImage(s,{width:1,height:1,data:new Uint8Array(4)})};t.on("styleimagemissing",R);const U=H({requestFrame:()=>t.triggerRepaint()}),Z={id:J,type:"custom",renderingMode:"3d",onAdd(i,s){if(p)return;const c=new N({canvas:t.getCanvas(),gl:s});if(p){c.dispose();return}c.init(u),a.current=c,L.current?.(c,t,u,()=>t.triggerRepaint())},render(i,s){if(!a.current||a.current.isDisposed)return;const c=W(s??i);c&&(a.current.render(c),U(a.current))}},D=()=>{K(t),t.getSource(y)||t.addSource(y,{type:"geojson",data:V}),t.getLayer(MAP_DIM_LAYER_ID)||t.addLayer({id:MAP_DIM_LAYER_ID,type:"fill",source:y,paint:{"fill-color":"#000000","fill-opacity":0,"fill-opacity-transition":{duration:0,delay:0}}}),S.current?.(t),t.addLayer(Z)};return t.on("style.load",D),t.setStyle(A.style,j?{transformStyle:j}:void 0),()=>{p=!0,t.off("style.load",D),t.off("styleimagemissing",R),a.current?.dispose(),a.current=null,t.remove(),P.current=null}},[]),B("div",{ref:d,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"}})}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Renderer } from '@expofp/renderer';
|
|
2
|
+
/** Defs still waiting for a frame, or `null` when the engine does not expose the queue. */
|
|
3
|
+
export declare function queuedUpdateCount(renderer: Renderer): number | null;
|
|
4
|
+
export interface UpdatePumpOptions {
|
|
5
|
+
/** Asks the host for another frame — `map.triggerRepaint()`. */
|
|
6
|
+
readonly requestFrame: () => void;
|
|
7
|
+
/**
|
|
8
|
+
* Safety valve: stop asking after this many frames without the queue getting any shorter than
|
|
9
|
+
* the shortest it has been. A queue that cannot drain must not hold the map at full frame
|
|
10
|
+
* rate — and "cannot drain" includes a queue that churns without shrinking, which is why
|
|
11
|
+
* progress is measured against the low-water mark rather than against the previous frame.
|
|
12
|
+
* Pumping resumes as soon as the queue drops below that mark again.
|
|
13
|
+
*/
|
|
14
|
+
readonly maxFramesWithoutProgress?: number;
|
|
15
|
+
}
|
|
16
|
+
/** Call the returned function after every rendered frame, with the renderer that drew it. */
|
|
17
|
+
export declare function createUpdatePump({ requestFrame, maxFramesWithoutProgress, }: UpdatePumpOptions): (renderer: Renderer) => void;
|
|
18
|
+
//# sourceMappingURL=update-pump.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function queuedUpdateCount(r){const n=r.updatesSystem;if(!n)return null;const t=n.pendingDefs?.size,e=n.culledDefs?.size;return typeof t!="number"||typeof e!="number"?null:t+e}export function createUpdatePump({requestFrame:r,maxFramesWithoutProgress:n=240}){let t=1/0,e=0;return i=>{const u=queuedUpdateCount(i);if(u!==null){if(u===0){t=1/0,e=0;return}u<t?(t=u,e=0):e+=1,!(e>=n)&&r()}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as n}from"tslib";import{Box as k,boxContainsPoint as F,pointDistance as L}from"@expofp/geometry";import{action as f,computed as b,observable as u}from"mobx";import{getName as G}from"../components/Kiosk/SetKiosk";import{DEFAULT_UNITS as T,ORIENTATION_GRANTED_KEY as B}from"../constants";import E from"../data";import{fpGeo as P}from"../data/fpGeo";import{getLayerSvg as U,svgArea as h}from"../data/svg";import{GaEventActions as $,sendEventToGa as V}from"../tools/gtag";import w from"../tools/logger";import{areLayersEnabled as K}from"../utils/areLayersEnabled";import{calcSpeed as D}from"../utils/calcSpeed";import{calcTravelTime as A}from"../utils/calcTravelTime";import{calculateRelativeBearing as W,convertGpsToLocal as I,isValidPointCoords as g}from"../utils/gps";import{boothToEndpoint as C,buildRoute as Z,CURRENT_LOCATION_NAME as q,CURRENT_POSITION_POINT_ID as j,isWayfindingReady as X,KIOSK_ANCHOR_POINT_ID as Y,toArbitraryPoint as M}from"../wayfinding";import c,{layersStore as R,uiState as p}from".";import{BoothBase as y}from"./BoothStore";import{LayersMode as H}from"./LayerStore";import{revealLayer as N}from"./reveal-layer.js";function m(o){return typeof o=="string"?Number(o.replace(",",".")):o}export default class i{constructor(e){this.routeLines=[],this.routeDistance=null,this.currentPosition=null,this.requestCompass=!1,this.iconType=0,this.tempToBooth=null,this.focusEnabled=!0,this.prevZ=null,this.markersData={icons:[],markers:[]},this.prevMarkers=[],this.pendingReveal=null,this.showAccessible=!1,this.onlyAccessible=!1,this.currentRouteLayer=null,this.currentRouteExhibitor=null,this.routeUnits=T,this.isGpsTrackingEnabled=!0,this.rootStore=e,this.focusEnabled=!window.location.search}get canFindLocation(){return!!p.kioskData||!!this.currentPosition}selectRoute(e,t=!0,r=!1){if(t&&(p.list={type:"search",text:"",focused:!1}),e&&!e.from&&e.to){const s=this.resolveFallbackFrom();s&&(e=new Route(s,e.to,e.waypoints))}e?.from&&e?.to&&e.from===e.to&&(e=null);const l=[];e?.from&&e?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),e?.from instanceof y&&e.from.visible&&l.push(e.from),e?.to instanceof y&&e.to.visible&&(this.tempToBooth=null,l.push(e.to)),!e&&c.fp.onDirection&&c.fp.onDirection(null);const a=()=>{if(this.rootStore.moveToList(l),p.details=e,e&&(!e.from||!e.to)&&c.showOverlay(),e?.to&&e?.from){const s=J(e.from);s&&this.rootStore.layerStore.updateVisibility(s,!0)}if(!this.currentRouteLayer){const s=O(this.rootStore.layerStore,e?.from),d=O(this.rootStore.layerStore,e?.to);s?this.currentRouteLayer=s:d&&(this.currentRouteLayer=d)}t&&e?.from&&e?.to&&V($.ClickDirections,`${e?.from?"From "+e.from.name:""} ${e?.to?"To "+e.to.name:""}`)};r?a():setTimeout(a,200)}rebuildRouteFromPosition(e){const t=p.selectedRoute;t?.to&&this.selectRoute(new Route(e,t.to,t.waypoints),!1,!0)}resolveFallbackFrom(){if(this.currentPosition)return M(this.currentPosition,q,j);const e=p.kioskData;return e?M({x:e.x,y:e.y,z:e.z??void 0},G(),Y):null}setStartPoint(e){const t=p.selectedRoute;if(t?.to&&!t?.from&&e){const r=new Route(e,t.to,t.waypoints);this.selectRoute(r)}}get pathLayers(){return c.routeStore.routeLines?.map(e=>e.p0.layer)?.filter((e,t,r)=>r.indexOf(e)===t).map((e,t)=>({id:t+1,layer:c.layerStore.findLayer(e)}))}getNearestBooth(e){if(!e)return null;const t=this.rootStore.layerStore.findLayer(e.z),r=P?.properties.config,l=!!(e.lat&&e.lng),a=r&&l?I(e,r):e;return!a||!g(a.x)||!g(a.y)?null:this.rootStore.boothStore.booths.filter(s=>R.mode===H.Default||!t?s.visible&&s.rect:s.rect&&(typeof e.z!="number"&&!e.z&&s.visible||t.name===s.layer?.name)).sort((s,d)=>L(a,s.rect.center)-L(a,d.rect.center))[0]||null}setMarkers(e){this.markersData.markers=(e?.markers??[]).map(Q),this.markersData.icons=e?.icons??[]}selectMarker(e,t){const r=this.markersData.markers.find(a=>a.id===e);this.markersData.markers.forEach(a=>a.active=!1),r&&(r.active=!0);const l=c.layerStore.findLayer(r?.z);if(t&&r){const a=c.rendererService.renderer;return l&&!l?.visible&&R.updateVisibility(l,!0),a?a.controls.panTo(r.x,r.y):(w.warn("Renderer is not initialized. Cannot pan to marker."),Promise.resolve())}return Promise.resolve()}get selectedMarkers(){return this.markersData.markers.filter(e=>e.active)}get layers(){const e=[];return c.routeStore.routeLines?.map(t=>t.p0.layer).forEach(t=>{e.indexOf(t)===-1&&e.push(t)}),e.map(t=>c.layerStore.layers.find(r=>r.name===t)).filter(t=>!!t)}clickRoute(e,t){window.__resett&&window.__resett(),this.rootStore.uiState.menu=!1,p.list.type==="route-planner"&&(p.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(e,t))}selectCurrentPosition(e,t=!0,r){clearTimeout(this.cpTimeout),e&&(e.x=m(e.x),e.y=m(e.y),e.lat!==void 0&&(e.lat=m(e.lat)),e.lng!==void 0&&(e.lng=m(e.lng)),K()||(e.z=void 0));const l=t&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route),a=t&&!l&&(this.focusEnabled||this.prevZ!=e?.z);this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=e?.z?.toString()??null,this.iconType=r?1:0;const s=e?ee(e):null;if(!e||!s){this.currentPosition=null;return}const d=c.layerStore.findLayer(e.z),x=new CurrentPosition(s.x,s.y,d?.name||this.currentRouteLayer?.name,W(s),e.lat,e.lng);let S=!this.routeLines?.length;d&&this.routeLines?.length&&(S=!!this.routeLines.find(v=>v.p0.layer===d.name||v.p1.layer===d.name));const _=a&&S;this.currentPosition=x,_&&this.focusOnPosition(x,d),this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(!this.canFindLocation)return;const e=this.currentPosition??p.kioskData;e&&(this.currentPosition&&localStorage.getItem(B)==="false"&&(c.routeStore.requestCompass=!0),this.pendingReveal?.(),this.pendingReveal=N({layer:c.layerStore.findLayer(e.z),show:t=>R.updateVisibility(t,!0),then:()=>{if(c.maplibreStore.showMaplibre){p.moveToLocation=!0;return}p.moveToRect=this.findLocationRect(e)}}))}findLocationRect(e){const t=k.fromCenter(e,{x:100,y:100});if(t.intersects(h))return t;const r=Math.max(h.min.x,Math.min(e.x,h.max.x)),l=Math.max(h.min.y,Math.min(e.y,h.max.y)),a=Math.min(h.size.width,h.size.height)*.3,s=k.fromCenter({x:r,y:l},{x:a,y:a}).intersection(h);return s?k.fromUnion(t,s):t}focusOnPosition(e,t){this.pendingReveal?.(),this.pendingReveal=N({layer:t,show:r=>R.updateVisibility(r,!0),then:()=>{if(c.maplibreStore.showMaplibre){p.moveToLocation=!0;return}const r=c.rendererService.renderer;if(!r){w.warn("Renderer is not initialized. Cannot pan to current position.");return}r.controls.panTo(e.x,e.y)}})}get routeInfo(){const e=this.routeDistance,t=this.routeUnits;return e?{distance:`${e}${t}`,units:t,time:A(e,D(t))}:null}updateRoute(e,t){!e?.length&&!this.routeLines.length||(this.routeLines=e,this.updateRoutePoints())}updateRouteDistance(e){if(e==null)return;const t=U(),r=(t.getAttribute("units")||T).toLowerCase?.().trim(),l=t.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(e/(l?1:10)),this.routeUnits=r,this.updateRoutePoints()}updateRoutePoints(){const e=p.selectedRoute,t=this.routeDistance,r=this.routeUnits;c.fp.onDirection&&setTimeout(()=>{c.fp.onDirection({from:z(e?.from??null),to:z(e?.to??null),lines:this.routeLines,distance:t==null?"":`${t}${r}`,units:r,time:A(t??0,D(r))})},200)}checkRoutes(){if(!X()){console.warn("checkRoutes: wayfinding is not initialized \u2014 call createWayfinding() first. Skipping route check.");return}const e=c.boothStore.booths;console.info(`Route check started ${e.length}.... `);for(let t=0;t<e.length;t++){const r=e[t];for(let l=t+1;l<e.length;l++){const a=e[l];Z(C(r),C(a)).lines.length||console.warn(`No route found from ${r.name} to ${a.name}`)}}console.info("Route check done....")}setGpsTrackingEnabled(e){this.isGpsTrackingEnabled=e}get gpsEnabled(){return E.autoTrackingGps&&this.isGpsTrackingEnabled&&!E.enableIPS}setOnlyAccessible(e){this.onlyAccessible=e}}n([u],i.prototype,"routeLines",void 0),n([u],i.prototype,"routeDistance",void 0),n([u],i.prototype,"currentPosition",void 0),n([u],i.prototype,"requestCompass",void 0),n([u],i.prototype,"iconType",void 0),n([u],i.prototype,"tempToBooth",void 0),n([u],i.prototype,"focusEnabled",void 0),n([u],i.prototype,"prevZ",void 0),n([u],i.prototype,"markersData",void 0),n([u],i.prototype,"prevMarkers",void 0),n([u],i.prototype,"showAccessible",void 0),n([u],i.prototype,"onlyAccessible",void 0),n([u],i.prototype,"currentRouteLayer",void 0),n([u],i.prototype,"currentRouteExhibitor",void 0),n([b],i.prototype,"canFindLocation",null),n([f],i.prototype,"selectRoute",null),n([f],i.prototype,"rebuildRouteFromPosition",null),n([f],i.prototype,"setStartPoint",null),n([b({keepAlive:!0})],i.prototype,"pathLayers",null),n([f],i.prototype,"setMarkers",null),n([f],i.prototype,"selectMarker",null),n([b({keepAlive:!0})],i.prototype,"selectedMarkers",null),n([b({keepAlive:!0})],i.prototype,"layers",null),n([f],i.prototype,"clickRoute",null),n([f],i.prototype,"selectCurrentPosition",null),n([f],i.prototype,"findLocation",null),n([u],i.prototype,"routeUnits",void 0),n([b],i.prototype,"routeInfo",null),n([f],i.prototype,"updateRoute",null),n([f],i.prototype,"updateRouteDistance",null),n([f],i.prototype,"updateRoutePoints",null),n([f],i.prototype,"checkRoutes",null),n([u],i.prototype,"isGpsTrackingEnabled",void 0),n([f],i.prototype,"setGpsTrackingEnabled",null),n([b({keepAlive:!0})],i.prototype,"gpsEnabled",null),n([f],i.prototype,"setOnlyAccessible",null);function J(o){if(o)return o instanceof y?o.layer?.name:o.layer}function O(o,e){return e?e instanceof y?e.layer??null:o.findLayer(e.layer):null}function Q(o){return{...o,x:m(o.x),y:m(o.y),lat:o.lat===void 0?void 0:m(o.lat),lng:o.lng===void 0?void 0:m(o.lng)}}function ee(o){const e=P?.properties.config??null;let t=null;return e&&F({min:e.p0,max:e.p2},o)?t={...o}:e&&g(o.lat)&&g(o.lng)?t=I(o,e):e||(t=o),t||null}export function findBooth(o){return c.boothStore.findBooth(o)||c.exhibitorStore.findExhibitor(o)?.booths[0]}export function findEntityByExternalId(o){const e=c.boothStore.boothByExternalId.get(o);if(e)return{type:"booth",entity:e};const t=c.exhibitorStore.exhibitorByExternalId.get(o);if(t)return{type:"exhibitor",entity:t}}export function separateExternalIds(o){const e=[],t=[];for(const r of o){const l=findEntityByExternalId(r);l&&(l.type==="booth"?e.push(r):t.push(r))}return{boothExternalIds:e,exhibitorExternalIds:t}}export function extractRoute(o,e,t){return new Route(findBooth(o)??null,findBooth(e)??null,t?.map(r=>findBooth(r)).filter(r=>!!r))}export class Route{constructor(e,t,r){this.from=e,this.to=t,this.waypoints=r;const l=e instanceof y?e.id:void 0,a=t instanceof y?t.id:void 0;this.waypoints=r?.filter(s=>s&&s.id!==l&&s.id!==a)}}function z(o){return o?o instanceof y?{id:o.id,name:o.name,externalId:o.externalId,layer:{name:o.layer?.name,description:o.layer?.description}}:{id:Number.MAX_SAFE_INTEGER,name:o.name,externalId:void 0,layer:{name:o.layer,description:void 0}}:null}export class CurrentPosition{constructor(e,t,r,l,a,s){this.x=e,this.y=t,this.z=r,this.angle=l,this.lat=a,this.lng=s}}
|
|
1
|
+
import{__decorate as n}from"tslib";import{Box as k,boxContainsPoint as F,pointDistance as L}from"@expofp/geometry";import{action as f,computed as g,observable as u}from"mobx";import{getName as G}from"../components/Kiosk/SetKiosk";import{DEFAULT_UNITS as T,ORIENTATION_GRANTED_KEY as B}from"../constants";import E from"../data";import{fpGeo as P}from"../data/fpGeo";import{getLayerSvg as U,svgArea as h}from"../data/svg";import{GaEventActions as $,sendEventToGa as V}from"../tools/gtag";import w from"../tools/logger";import{areLayersEnabled as K}from"../utils/areLayersEnabled";import{calcSpeed as D}from"../utils/calcSpeed";import{calcTravelTime as A}from"../utils/calcTravelTime";import{calculateRelativeBearing as W,convertGpsToLocal as I,isValidPointCoords as b}from"../utils/gps";import{boothToEndpoint as C,buildRoute as Z,CURRENT_LOCATION_NAME as q,CURRENT_POSITION_POINT_ID as j,isWayfindingReady as X,KIOSK_ANCHOR_POINT_ID as Y,toArbitraryPoint as M}from"../wayfinding";import c,{layersStore as R,uiState as p}from".";import{BoothBase as y}from"./BoothStore";import{LayersMode as H}from"./LayerStore";import{revealLayer as N}from"./reveal-layer.js";function m(o){return typeof o=="string"?Number(o.replace(",",".")):o}export default class i{constructor(e){this.routeLines=[],this.routeDistance=null,this.currentPosition=null,this.requestCompass=!1,this.iconType=0,this.tempToBooth=null,this.focusEnabled=!0,this.prevZ=null,this.markersData={icons:[],markers:[]},this.prevMarkers=[],this.pendingReveal=null,this.showAccessible=!1,this.onlyAccessible=!1,this.currentRouteLayer=null,this.currentRouteExhibitor=null,this.routeUnits=T,this.isGpsTrackingEnabled=!0,this.rootStore=e,this.focusEnabled=!window.location.search}get canFindLocation(){return!!p.kioskData||!!this.currentPosition}selectRoute(e,t=!0,r=!1){if(t&&(p.list={type:"search",text:"",focused:!1}),e&&!e.from&&e.to){const s=this.resolveFallbackFrom();s&&(e=new Route(s,e.to,e.waypoints))}e?.from&&e?.to&&e.from===e.to&&(e=null);const l=[];e?.from&&e?.to&&window.setTimeout(()=>{this.rootStore.showMap()},navigator.userAgent.toLowerCase().indexOf("android")>-1?400:50),e?.from instanceof y&&e.from.visible&&l.push(e.from),e?.to instanceof y&&e.to.visible&&(this.tempToBooth=null,l.push(e.to)),!e&&c.fp.onDirection&&c.fp.onDirection(null);const a=()=>{if(this.rootStore.moveToList(l),p.details=e,e&&(!e.from||!e.to)&&c.showOverlay(),e?.to&&e?.from){const s=J(e.from);s&&this.rootStore.layerStore.updateVisibility(s,!0)}if(!this.currentRouteLayer){const s=O(this.rootStore.layerStore,e?.from),d=O(this.rootStore.layerStore,e?.to);s?this.currentRouteLayer=s:d&&(this.currentRouteLayer=d)}t&&e?.from&&e?.to&&V($.ClickDirections,`${e?.from?"From "+e.from.name:""} ${e?.to?"To "+e.to.name:""}`)};r?a():setTimeout(a,200)}rebuildRouteFromPosition(e){const t=p.selectedRoute;t?.to&&this.selectRoute(new Route(e,t.to,t.waypoints),!1,!0)}resolveFallbackFrom(){if(this.currentPosition)return M(this.currentPosition,q,j);const e=p.kioskData;return e?M({x:e.x,y:e.y,z:e.z??void 0},G(),Y):null}setStartPoint(e){const t=p.selectedRoute;if(t?.to&&!t?.from&&e){const r=new Route(e,t.to,t.waypoints);this.selectRoute(r)}}get pathLayers(){return c.routeStore.routeLines?.map(e=>e.p0.layer)?.filter((e,t,r)=>r.indexOf(e)===t).map((e,t)=>({id:t+1,layer:c.layerStore.findLayer(e)}))}getNearestBooth(e){if(!e)return null;const t=this.rootStore.layerStore.findLayer(e.z),r=P?.properties.config,l=!!(e.lat&&e.lng),a=r&&l?I(e,r):e;return!a||!b(a.x)||!b(a.y)?null:this.rootStore.boothStore.booths.filter(s=>R.mode===H.Default||!t?s.visible&&s.rect:s.rect&&(typeof e.z!="number"&&!e.z&&s.visible||t.name===s.layer?.name)).sort((s,d)=>L(a,s.rect.center)-L(a,d.rect.center))[0]||null}setMarkers(e){this.markersData.markers=(e?.markers??[]).map(Q),this.markersData.icons=e?.icons??[]}selectMarker(e,t){const r=this.markersData.markers.find(a=>a.id===e);this.markersData.markers.forEach(a=>a.active=!1),r&&(r.active=!0);const l=c.layerStore.findLayer(r?.z);if(t&&r){const a=c.rendererService.renderer;return l&&!l?.visible&&R.updateVisibility(l,!0),a?a.controls.panTo(r.x,r.y):(w.warn("Renderer is not initialized. Cannot pan to marker."),Promise.resolve())}return Promise.resolve()}get selectedMarkers(){return this.markersData.markers.filter(e=>e.active)}get layers(){const e=[];return c.routeStore.routeLines?.map(t=>t.p0.layer).forEach(t=>{e.indexOf(t)===-1&&e.push(t)}),e.map(t=>c.layerStore.layers.find(r=>r.name===t)).filter(t=>!!t)}clickRoute(e,t){window.__resett&&window.__resett(),this.rootStore.uiState.menu=!1,p.list.type==="route-planner"&&(p.list={type:"search",text:"",focused:!1}),this.selectRoute(new Route(e,t))}selectCurrentPosition(e,t=!0,r){clearTimeout(this.cpTimeout),e&&(e.x=m(e.x),e.y=m(e.y),e.lat!==void 0&&(e.lat=m(e.lat)),e.lng!==void 0&&(e.lng=m(e.lng)),K()||(e.z=void 0));const l=t&&this.rootStore.uiState.details&&!(this.rootStore.uiState.details instanceof Route),a=t&&!l&&(this.focusEnabled||this.prevZ!=e?.z);this.focusEnabled&&(this.focusEnabled=!1),this.prevZ=e?.z?.toString()??null,this.iconType=r?1:0;const s=e?ee(e):null;if(!e||!s){this.currentPosition=null;return}const d=c.layerStore.findLayer(e.z),x=new CurrentPosition(s.x,s.y,d?.name||this.currentRouteLayer?.name,W(s),e.lat,e.lng);let S=!this.routeLines?.length;d&&this.routeLines?.length&&(S=!!this.routeLines.find(v=>v.p0.layer===d.name||v.p1.layer===d.name));const _=a&&S;this.currentPosition=x,_&&this.focusOnPosition(x,d),this.gpsEnabled||(this.cpTimeout=setTimeout(()=>{this.currentPosition&&this.selectCurrentPosition(null,!1)},30*1e3))}findLocation(){if(!this.canFindLocation)return;const e=this.currentPosition??p.kioskData;e&&(this.currentPosition&&localStorage.getItem(B)==="false"&&(c.routeStore.requestCompass=!0),this.pendingReveal?.(),this.pendingReveal=N({layer:c.layerStore.findLayer(e.z),show:t=>R.updateVisibility(t,!0),then:()=>{p.moveToRect=this.findLocationRect(e)}}))}findLocationRect(e){const t=k.fromCenter(e,{x:100,y:100});if(t.intersects(h))return t;const r=Math.max(h.min.x,Math.min(e.x,h.max.x)),l=Math.max(h.min.y,Math.min(e.y,h.max.y)),a=Math.min(h.size.width,h.size.height)*.3,s=k.fromCenter({x:r,y:l},{x:a,y:a}).intersection(h);return s?k.fromUnion(t,s):t}focusOnPosition(e,t){this.pendingReveal?.(),this.pendingReveal=N({layer:t,show:r=>R.updateVisibility(r,!0),then:()=>{if(c.maplibreStore.showMaplibre){p.moveToLocation=!0;return}const r=c.rendererService.renderer;if(!r){w.warn("Renderer is not initialized. Cannot pan to current position.");return}r.controls.panTo(e.x,e.y)}})}get routeInfo(){const e=this.routeDistance,t=this.routeUnits;return e?{distance:`${e}${t}`,units:t,time:A(e,D(t))}:null}updateRoute(e,t){!e?.length&&!this.routeLines.length||(this.routeLines=e,this.updateRoutePoints())}updateRouteDistance(e){if(e==null)return;const t=U(),r=(t.getAttribute("units")||T).toLowerCase?.().trim(),l=t.getAttribute("fp-ver")?.startsWith("5")??!1;this.routeDistance=Math.round(e/(l?1:10)),this.routeUnits=r,this.updateRoutePoints()}updateRoutePoints(){const e=p.selectedRoute,t=this.routeDistance,r=this.routeUnits;c.fp.onDirection&&setTimeout(()=>{c.fp.onDirection({from:z(e?.from??null),to:z(e?.to??null),lines:this.routeLines,distance:t==null?"":`${t}${r}`,units:r,time:A(t??0,D(r))})},200)}checkRoutes(){if(!X()){console.warn("checkRoutes: wayfinding is not initialized \u2014 call createWayfinding() first. Skipping route check.");return}const e=c.boothStore.booths;console.info(`Route check started ${e.length}.... `);for(let t=0;t<e.length;t++){const r=e[t];for(let l=t+1;l<e.length;l++){const a=e[l];Z(C(r),C(a)).lines.length||console.warn(`No route found from ${r.name} to ${a.name}`)}}console.info("Route check done....")}setGpsTrackingEnabled(e){this.isGpsTrackingEnabled=e}get gpsEnabled(){return E.autoTrackingGps&&this.isGpsTrackingEnabled&&!E.enableIPS}setOnlyAccessible(e){this.onlyAccessible=e}}n([u],i.prototype,"routeLines",void 0),n([u],i.prototype,"routeDistance",void 0),n([u],i.prototype,"currentPosition",void 0),n([u],i.prototype,"requestCompass",void 0),n([u],i.prototype,"iconType",void 0),n([u],i.prototype,"tempToBooth",void 0),n([u],i.prototype,"focusEnabled",void 0),n([u],i.prototype,"prevZ",void 0),n([u],i.prototype,"markersData",void 0),n([u],i.prototype,"prevMarkers",void 0),n([u],i.prototype,"showAccessible",void 0),n([u],i.prototype,"onlyAccessible",void 0),n([u],i.prototype,"currentRouteLayer",void 0),n([u],i.prototype,"currentRouteExhibitor",void 0),n([g],i.prototype,"canFindLocation",null),n([f],i.prototype,"selectRoute",null),n([f],i.prototype,"rebuildRouteFromPosition",null),n([f],i.prototype,"setStartPoint",null),n([g({keepAlive:!0})],i.prototype,"pathLayers",null),n([f],i.prototype,"setMarkers",null),n([f],i.prototype,"selectMarker",null),n([g({keepAlive:!0})],i.prototype,"selectedMarkers",null),n([g({keepAlive:!0})],i.prototype,"layers",null),n([f],i.prototype,"clickRoute",null),n([f],i.prototype,"selectCurrentPosition",null),n([f],i.prototype,"findLocation",null),n([u],i.prototype,"routeUnits",void 0),n([g],i.prototype,"routeInfo",null),n([f],i.prototype,"updateRoute",null),n([f],i.prototype,"updateRouteDistance",null),n([f],i.prototype,"updateRoutePoints",null),n([f],i.prototype,"checkRoutes",null),n([u],i.prototype,"isGpsTrackingEnabled",void 0),n([f],i.prototype,"setGpsTrackingEnabled",null),n([g({keepAlive:!0})],i.prototype,"gpsEnabled",null),n([f],i.prototype,"setOnlyAccessible",null);function J(o){if(o)return o instanceof y?o.layer?.name:o.layer}function O(o,e){return e?e instanceof y?e.layer??null:o.findLayer(e.layer):null}function Q(o){return{...o,x:m(o.x),y:m(o.y),lat:o.lat===void 0?void 0:m(o.lat),lng:o.lng===void 0?void 0:m(o.lng)}}function ee(o){const e=P?.properties.config??null;let t=null;return e&&F({min:e.p0,max:e.p2},o)?t={...o}:e&&b(o.lat)&&b(o.lng)?t=I(o,e):e||(t=o),t||null}export function findBooth(o){return c.boothStore.findBooth(o)||c.exhibitorStore.findExhibitor(o)?.booths[0]}export function findEntityByExternalId(o){const e=c.boothStore.boothByExternalId.get(o);if(e)return{type:"booth",entity:e};const t=c.exhibitorStore.exhibitorByExternalId.get(o);if(t)return{type:"exhibitor",entity:t}}export function separateExternalIds(o){const e=[],t=[];for(const r of o){const l=findEntityByExternalId(r);l&&(l.type==="booth"?e.push(r):t.push(r))}return{boothExternalIds:e,exhibitorExternalIds:t}}export function extractRoute(o,e,t){return new Route(findBooth(o)??null,findBooth(e)??null,t?.map(r=>findBooth(r)).filter(r=>!!r))}export class Route{constructor(e,t,r){this.from=e,this.to=t,this.waypoints=r;const l=e instanceof y?e.id:void 0,a=t instanceof y?t.id:void 0;this.waypoints=r?.filter(s=>s&&s.id!==l&&s.id!==a)}}function z(o){return o?o instanceof y?{id:o.id,name:o.name,externalId:o.externalId,layer:{name:o.layer?.name,description:o.layer?.description}}:{id:Number.MAX_SAFE_INTEGER,name:o.name,externalId:void 0,layer:{name:o.layer,description:void 0}}:null}export class CurrentPosition{constructor(e,t,r,l,a,s){this.x=e,this.y=t,this.z=r,this.angle=l,this.lat=a,this.lng=s}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expofp/floorplan",
|
|
3
|
-
"version": "3.24.
|
|
3
|
+
"version": "3.24.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/expofp/efp-app.git",
|
|
@@ -70,14 +70,14 @@
|
|
|
70
70
|
"tslib": "^2.3.0",
|
|
71
71
|
"uuid": "^9.0.1",
|
|
72
72
|
"zod": "4.4.3",
|
|
73
|
-
"@expofp/
|
|
74
|
-
"@expofp/
|
|
75
|
-
"@expofp/
|
|
76
|
-
"@expofp/
|
|
77
|
-
"@expofp/
|
|
78
|
-
"@expofp/
|
|
79
|
-
"@expofp/
|
|
80
|
-
"@expofp/
|
|
73
|
+
"@expofp/config": "3.24.2",
|
|
74
|
+
"@expofp/resolve": "3.24.2",
|
|
75
|
+
"@expofp/schema": "3.24.2",
|
|
76
|
+
"@expofp/geometry": "3.24.2",
|
|
77
|
+
"@expofp/ui": "3.24.2",
|
|
78
|
+
"@expofp/utils": "3.24.2",
|
|
79
|
+
"@expofp/wayfinding": "3.24.2",
|
|
80
|
+
"@expofp/debug": "3.24.2"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@babel/plugin-proposal-decorators": "^8.0.2",
|