@expofp/floorplan 3.44.8 → 3.45.0
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-C1iQgU3z.js → Button-6lV64H09.js} +5 -5
- package/dist/browser/{CookieConsent-Dv1LCPG3.js → CookieConsent-k11VHxoM.js} +7 -7
- package/dist/browser/{Debug-DPy0A0cw.js → Debug-DbfbGWb0.js} +7 -7
- package/dist/browser/{DebugTools-Dp8d4gPZ.js → DebugTools-BjHOBi_k.js} +6 -6
- package/dist/browser/{Demo-CHH4a7sZ.js → Demo-CrFjKybB.js} +9 -9
- package/dist/browser/{Free-BidfuRjG.js → Free-4IN6GHrY.js} +10 -10
- package/dist/browser/{GalleryContainer-7IYWWKkK.js → GalleryContainer-BWd-8Nhp.js} +11 -11
- package/dist/browser/{GpsLoader-CrO61Fpj.js → GpsLoader-C43ADyfU.js} +13 -13
- package/dist/browser/{KioskStore-BE_V60tp.js → KioskStore-0xBjJ9AG.js} +14 -20
- package/dist/browser/{LayerStore-BM7GOQ3J.js → LayerStore-BifpIwHB.js} +3726 -3220
- package/dist/browser/{MaplibreAdapter-DmrCTw3Q.js → MaplibreAdapter-CxETR3-R.js} +2517 -2517
- package/dist/browser/{ModalContainer-DqsSRv60.js → ModalContainer-IvkrtwT_.js} +10 -10
- package/dist/browser/{PermissionNotice--Vn_MkaQ.js → PermissionNotice-C4Nu1dPO.js} +6 -6
- package/dist/browser/{RouteStore-D7G9YROM.js → RouteStore-ltbgXRLP.js} +28 -28
- package/dist/browser/{SetKioskMode-CMndo5d3.js → SetKioskMode-BWzFzO_Q.js} +12 -12
- package/dist/browser/{ShowKiosk-CUiprdS9.js → ShowKiosk-BYOTTOrX.js} +10 -10
- package/dist/browser/{UIState-D0GHKRf4.js → UIState-BG-A7rPb.js} +230 -230
- package/dist/browser/{ViewerMenuPanel-B7corw44.js → ViewerMenuPanel-DscD3jCY.js} +11 -11
- package/dist/browser/{add-debug-secret-listener-uMLIuPW5.js → add-debug-secret-listener-qgQOxLV_.js} +1 -1
- package/dist/browser/{adopt-global-settings-BVVdz-YX.js → adopt-global-settings-CB1YrOJs.js} +9 -9
- package/dist/browser/{boolean-editor-Dg3cfoLy.js → boolean-editor-DcFqYLg6.js} +9 -9
- package/dist/browser/{bootIntercom-7FTJ0piX.js → bootIntercom-DJEOZaFU.js} +2 -2
- package/dist/browser/bundle.json +87 -87
- package/dist/browser/{camera-events-DbYubA01.js → camera-events-BwP3bfY4.js} +1 -1
- package/dist/browser/{classnames-BryLpfgQ.js → classnames-C6CE8V3C.js} +2 -2
- package/dist/browser/{client-DnnJr0Ks.js → client-B42ooBdH.js} +5 -5
- package/dist/browser/{components-DHNMQbqJ.js → components-DelXq6ex.js} +461 -461
- package/dist/browser/{create-live-plan-BgCjK-Kh.js → create-live-plan-jO-YW94S.js} +263 -245
- package/dist/browser/{debug-context-BEABO7OL.js → debug-context-BFAUm0Rv.js} +5 -5
- package/dist/browser/{debug-overlay-Bv-C1rmT.js → debug-overlay-0pLu5_hz.js} +10 -10
- package/dist/browser/{debug-ui-FirQ0EQb.js → debug-ui-CPF3Fr0y.js} +6 -6
- package/dist/browser/{dist-sup8YcEL.js → dist-5MtJlmvC.js} +5 -5
- package/dist/browser/{dist-p14a9te8.js → dist-BImkgFoY.js} +6 -6
- package/dist/browser/{dist-DN5ATV5p.js → dist-D7lv86ly.js} +3 -3
- package/dist/browser/{efp-debug-init-DUPmVtYg.js → efp-debug-init-DBnQHIuj.js} +3 -3
- package/dist/browser/{enum-editor-g46R4Zq7.js → enum-editor-wagTer9Z.js} +4 -4
- package/dist/browser/{es5-D_WEVRPo.js → es5-ClZJZH3H.js} +2 -2
- package/dist/browser/{event-head-DBemDpob.js → event-head-Dvg64Dl9.js} +1 -1
- package/dist/browser/{event-not-found-m_QUX3nl.js → event-not-found-CmHnmais.js} +3 -3
- package/dist/browser/{event-scoped-cache-BpjbCC59.js → event-scoped-cache-blYstzYW.js} +2 -2
- package/dist/browser/{expofpUrl-CAOzqFzt.js → expofpUrl-D99TqyHD.js} +1 -1
- package/dist/browser/{exports-svWN4mLB.js → exports-BBJtyyI0.js} +1 -1
- package/dist/browser/{favicon-hR5BaEm4.js → favicon-Bac0ZnSB.js} +1 -1
- package/dist/browser/{fetch-retry.umd-DS-5XmpN.js → fetch-retry.umd-Dkr69k7z.js} +2 -2
- package/dist/browser/{flex-BAz1Zlx4.js → flex-2znF0sHW.js} +5 -5
- package/dist/browser/{floorplan.loader-DPHmWNvd.js → floorplan.loader-B2NptbPQ.js} +12 -12
- package/dist/browser/{floorplan.ready-clG372Lo.js → floorplan.ready-DTyG-lkM.js} +344 -335
- package/dist/browser/{freeBanner-D0nU1aT0.js → freeBanner-yyOqSdAy.js} +2 -2
- package/dist/browser/{fuse-DFf-hk6f.js → fuse-x_QTzSiL.js} +2 -2
- package/dist/browser/{i18n-CPJmxFQX.js → i18n-CLEztXjo.js} +6 -6
- package/dist/browser/index.js +17 -17
- package/dist/browser/{index.module-COSPv-bu.js → index.module-C9C4kJk7.js} +4 -4
- package/dist/browser/{init-ui-Cj38w8tb.js → init-ui-rxZzKF4X.js} +16 -16
- package/dist/browser/{integrateKiosk-Du5HThkw.js → integrateKiosk-DsU-d7uk.js} +5 -5
- package/dist/browser/{is-debug-CmeNjnvW.js → is-debug-Bnj4naYd.js} +4 -4
- package/dist/browser/{is-own-domain-z0V4JpKp.js → is-own-domain-DNjOZllq.js} +1 -1
- package/dist/browser/{is-webview-JHA9dtnx.js → is-webview-Drer0GOu.js} +1 -1
- package/dist/browser/{jsx-runtime-D-d_UIhH.js → jsx-runtime-DB8EwfzE.js} +2 -2
- package/dist/browser/{kiosk-mode-ZBMSIWbK.js → kiosk-mode-B89VL0oY.js} +3 -3
- package/dist/browser/{kiosk-record-Djd0ZbEF.js → kiosk-record-rnTon4Lp.js} +1 -1
- package/dist/browser/{kioskApi-CXqDoN71.js → kioskApi-opoHdUqq.js} +7 -7
- package/dist/browser/{lib-GyGKAKXf.js → lib-eiqwFHwk.js} +3 -3
- package/dist/browser/{loadImage-cnbZD9uN.js → loadImage-BS80HTUK.js} +1 -1
- package/dist/browser/{logDeviceInfo-BSf9sLzS.js → logDeviceInfo-BqSbYo5l.js} +9 -9
- package/dist/browser/{mobx-D3NQFhEq.js → mobx-9NGoPiek.js} +4 -4
- package/dist/browser/{mobx.module-CAKsDOYI.js → mobx.module-BP1vMHLz.js} +1 -1
- package/dist/browser/{optional-boolean-editor-IR9THgLK.js → optional-boolean-editor-D6hR19BE.js} +3 -3
- package/dist/browser/{optional-enum-editor-PRQn6yzK.js → optional-enum-editor-BQPM-fRt.js} +4 -4
- package/dist/browser/{optional-string-editor-bZCuZ1tn.js → optional-string-editor-DUXoDnXB.js} +4 -4
- package/dist/browser/{particles.min-CwWuVwyg.js → particles.min-CBeInmmW.js} +2 -2
- package/dist/browser/{react-DQVTc7xG.js → react-Dg88gKA7.js} +2 -2
- package/dist/browser/{react-dom-BsqqKfoG.js → react-dom-C3PpoQeD.js} +3 -3
- package/dist/browser/{rolldown-runtime-Cyn7iuGp.js → rolldown-runtime-C7pJ6q0h.js} +1 -1
- package/dist/browser/{scene-CqJCEbSr.js → scene-CV1XFwO9.js} +12 -12
- package/dist/browser/{scheduler-CVY86sNW.js → scheduler-D-EvNbvQ.js} +2 -2
- package/dist/browser/{select-Du3T8Mpj.js → select-CQPuihmE.js} +10 -10
- package/dist/browser/{settings-NB72PTux.js → settings-BBn9P5W0.js} +2 -2
- package/dist/browser/{settings-item-BIPeCHmD.js → settings-item-BOVedxqA.js} +6 -6
- package/dist/browser/{store-BvnDl4Sc.js → store-D73yMRu5.js} +2 -2
- package/dist/browser/{string-editor-o-TMbaK8.js → string-editor-Drmcb4Uw.js} +4 -4
- package/dist/browser/{text-field-BZ5346fV.js → text-field-CnzYOUfF.js} +5 -5
- package/dist/browser/{theme-CPcxdYz7.js → theme-B4d7ReQC.js} +8 -8
- package/dist/browser/{ui-CesJTtUW.js → ui-DQ22eDdk.js} +8 -8
- package/dist/browser/useManageTraffic-C-4Maw9l.js +1439 -0
- package/dist/browser/{useRenderTarget-DpLNpx1f.js → useRenderTarget-BaCkqntS.js} +4 -4
- package/dist/browser/{viewport-QrHclV_L.js → viewport-CcbGLmJI.js} +3 -3
- package/dist/browser/{wayfinding-v9-TVwHq.js → wayfinding-4TI6Xwmj.js} +416 -383
- package/dist/esm/components/Kiosk/KioskStore.d.ts +5 -0
- package/dist/esm/components/Kiosk/KioskStore.js +1 -1
- package/dist/esm/components/Map/drawing/config/TextFitter.d.ts +2 -2
- package/dist/esm/components/Map/drawing/config/TextFitter.js +1 -1
- package/dist/esm/components/Map/drawing/config/canvases.d.ts +90 -2
- package/dist/esm/components/Map/drawing/config/canvases.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-all.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-badge.d.ts +3 -3
- package/dist/esm/components/Map/drawing/config/config-booth-bookmark.d.ts +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-bookmark.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-labels-special.d.ts +3 -4
- package/dist/esm/components/Map/drawing/config/config-booth-labels-special.js +2 -2
- package/dist/esm/components/Map/drawing/config/config-booth-labels.d.ts +2 -2
- package/dist/esm/components/Map/drawing/config/config-booth-labels.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-markers.d.ts +17 -1
- package/dist/esm/components/Map/drawing/config/config-markers.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-pins.d.ts +40 -0
- package/dist/esm/components/Map/drawing/config/config-pins.js +1 -0
- package/dist/esm/components/Map/drawing/config/pin-geometry.d.ts +65 -0
- package/dist/esm/components/Map/drawing/config/pin-geometry.js +1 -0
- package/dist/esm/components/Map/traffic/useBuildRoute.d.ts +1 -1
- package/dist/esm/components/Map/traffic/useBuildRoute.js +4 -4
- package/dist/esm/components/Map/traffic/useManageTraffic.js +1 -1
- package/dist/esm/engine/defs.d.ts +5 -0
- package/dist/esm/engine/defs.js +3 -3
- package/dist/esm/engine/update-def.d.ts +13 -1
- package/dist/esm/engine/update-def.js +1 -1
- package/dist/esm/services/url-dispatch.js +1 -1
- package/dist/esm/store/init/init-heatmap.d.ts +1 -1
- package/dist/esm/store/init/init-heatmap.js +1 -1
- package/dist/esm/store/search-buttons/SearchButtonsActions.d.ts +9 -0
- package/dist/esm/store/search-buttons/SearchButtonsActions.js +1 -1
- package/dist/esm/store/search-buttons/SearchButtonsStore.d.ts +15 -0
- package/dist/esm/store/search-buttons/SearchButtonsStore.js +1 -1
- package/dist/esm/test/store-harness.d.ts +13 -0
- package/dist/esm/test/store-harness.js +1 -1
- package/dist/esm/utils/dimming.js +1 -1
- package/dist/esm/wayfinding/adapters/canvasIconProvider.js +1 -1
- package/dist/esm/wayfinding/handlers/kioskHandler.js +1 -1
- package/dist/esm/wayfinding/handlers/yahHandler.js +1 -1
- package/package.json +10 -10
- package/dist/browser/dimming-B7lpw_UN.js +0 -1214
- package/dist/esm/engine/canvases.d.ts +0 -5
- package/dist/esm/engine/canvases.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{lineIntersection as
|
|
1
|
+
import{lineIntersection as T}from"@expofp/geometry";import{update as v}from"@expofp/renderer";import{useCallback as x,useEffect as U,useMemo as S,useRef as I}from"react";import{mapCamera as $}from"../camera";import{circleCanvasCssSize as K,createCircleCanvas as w,getBounds as b}from"../drawing/config/canvases";import{setPlanClickListener as E}from"../pointer";import{BUILD_ROUTE_DOTS as H,BUILD_ROUTE_LINES as B}from"./trafficLayers";import{UpdateQueue as Y}from"./UpdateQueue";const O=49,R=`hsl(257, 76%, ${O}%)`,z=`hsl(339.903, 82%, ${O}%)`,J=`hsl(257, 76%, ${Math.round(O*1.82)}%)`,_=4,L=K(_),Q=_,D="U",N="R",A="S",M="P";class j{constructor(){this._state=[[]],this.index=0,this.pointHashSet=new Set,this.locked=!1,this.storageKey="expofp_build_route_state",this._selected=0}get points(){return this._state[this.index]}set points(e){this._state.push(e),this.setIndex(),this.save()}setIndex(){this.index=Math.max(this._state.length-1,0)}genPointHash(e){return`${e.x},${e.y}`}add(e){const l=this.genPointHash(e);this.pointHashSet.has(l)||(this.pointHashSet.add(l),this.points=[...this.points,e])}undo(){this.index&&(this._state.pop(),this.setIndex(),this.save(),this.select(this.points.length-1))}execute(e){try{if(this.locked)return;this.locked=!0,e()}finally{requestAnimationFrame(()=>{this.locked=!1})}}log(e,l=12){console.log(`%c${e}`,`color: black; font-size: ${l}px; background: LemonChiffon;`)}instruct(){this.log(`How to Build a Route:
|
|
2
2
|
Add Point: Click on the map.
|
|
3
|
-
Apply Smoothing: Press ${
|
|
4
|
-
Apply Simplification: Press ${
|
|
3
|
+
Apply Smoothing: Press ${N}.
|
|
4
|
+
Apply Simplification: Press ${A}.
|
|
5
5
|
Undo: Press ${D}.
|
|
6
6
|
Enable/Disable Preview: Press ${M}.
|
|
7
|
-
`,16)}applyChaikinSmoothing(e,l,p){let
|
|
7
|
+
`,16)}applyChaikinSmoothing(e,l,p){let c;if(p>=1&&e.length>=2){c=[e[0]];for(let h=1;h<e.length;h++){const t=e[h-1],u=e[h];for(let n=1;n<=p;n++){const r=n/(p+1);c.push({x:t.x+(u.x-t.x)*r,y:t.y+(u.y-t.y)*r})}c.push(u)}}else c=e.slice();for(let h=0;h<l&&!(c.length<2);h++){const t=[{...c[0]}];for(let u=1;u<c.length;u++){const n=c[u-1],r=c[u];t.push({x:.75*n.x+.25*r.x,y:.75*n.y+.25*r.y}),t.push({x:.25*n.x+.75*r.x,y:.25*n.y+.75*r.y})}t.push({...c[c.length-1]}),c=t}return c}applySmoothing(){this.points.length<3||(this.points=this.applyChaikinSmoothing(this.points,1,0),this.select(this.points.length-1))}save(){try{this.points.length?sessionStorage.setItem(this.storageKey,JSON.stringify(this.points)):sessionStorage.removeItem(this.storageKey)}catch(e){console.warn(e)}}restore(){try{const e=sessionStorage.getItem(this.storageKey);if(!e)return;const l=JSON.parse(e);if(!Array.isArray(l))return;l.forEach(p=>this.add(p)),this.select(this.points.length-1)}catch(e){console.warn(e)}}topologyPreservingSimplify(e,l){if(e.length<=2)return e.map(n=>({...n}));const p=(n,r,d)=>{const g=n.x,f=n.y,s=r.x,i=r.y,o=d.x,a=d.y,y=Math.abs((a-i)*g-(o-s)*f+o*i-a*s),m=Math.sqrt((a-i)**2+(o-s)**2);return y/(m||1e-10)},c=(n,r,d,g)=>{const f=T({p0:n,p1:r},{p0:d,p1:g});return f!==null&&f.onLine1&&f.onLine2},h=new Array(e.length).fill(!1);h[0]=h[h.length-1]=!0;const t=[],u=(n,r)=>{if(r<=n+1)return;const d=e[n],g=e[r];let f=0,s=0;for(let i=n+1;i<r;i++){const o=p(e[i],d,g);o>f&&(f=o,s=i)}if(f>l){const i=e[s];let o=!0;for(let a=0;a<t.length-1;a++)if(c(t[a],t[a+1],d,i)||c(t[a],t[a+1],i,g)){o=!1;break}o&&(h[s]=!0,u(n,s),u(s,r))}};return u(0,e.length-1),e.filter((n,r)=>h[r])}applySimplification(){this.points=this.topologyPreservingSimplify(this.points,.5),this.select(this.points.length-1)}get selected(){return this._selected}select(e){this._selected=Math.max(0,Math.min(e,this.points.length-1))}}export function useBuildRoute({enabled:k,scene:e}){const l=I(!1),p=I(1),c=S(()=>w(_,R),[]),h=S(()=>w(_,z),[]),t=S(()=>new j,[]),u=I(new Y),n=S(()=>{if(!e)return{};const s=e.rootLayer.children,i=s.find(a=>a.name===B),o=s.find(a=>a.name===H);return{linesLayer:i,pointsLayer:o}},[e]),r=x(()=>{if(!n||!c||!h)return;const{linesLayer:s,pointsLayer:i}=n;if(!s||!i)return;const o=t.points,a=l.current;a?i.children.length=0:i.children=o.map(({x:m,y:C},P)=>({source:P==t.selected?h:c,bounds:b(m,C,L,L,p.current)}));const y=[];for(let m=1;m<o.length;m++){const C=o[m-1],P=o[m];y.push({points:{p0:C,p1:P},color:a?R:J,width:Q})}y.length?s.children=y:s.children.length=0,u.current.add(()=>v(i,s)),t.instruct(),t.log(JSON.stringify(t.points))},[t,n,c,h]),d=x(s=>{const i=s.key.toUpperCase();t.execute(()=>{switch(i){case D:s.preventDefault(),t.undo(),l.current=!1,r();break;case N:s.preventDefault(),t.applySmoothing(),l.current=!1,r();break;case A:s.preventDefault(),t.applySimplification(),l.current=!1,r();break;case M:s.preventDefault(),l.current=!l.current,r();break}})},[t,r]),g=x(s=>{p.current=s;const{pointsLayer:i}=n;if(!i)return[];const o=[];return t.execute(()=>{const a=i.children;for(const y of a)y.bounds=b(y.bounds.center.x,y.bounds.center.y,L,L,p.current),o.push(y)}),o},[n,t]),f=x(s=>{t.execute(()=>{t.add({x:s.x,y:s.y}),t.select(t.points.length-1),r()})},[t,r]);U(()=>{if(!k||!n?.pointsLayer)return;const{pointsLayer:s}=n;p.current=$()?.state().pixelSize??1,t.execute(()=>{t.restore(),r()}),s.onScale=({pixelSize:o})=>g(o);const i=u.current;return i.add(()=>v(s)),E(f),window.addEventListener("keyup",d),()=>{window.removeEventListener("keyup",d),E(),s.onScale=void 0,i.destroy()}},[k,n,t,r,f,g,d])}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{degToRad as
|
|
1
|
+
import{degToRad as Ce,lineAngle as fe,pointDistance as he}from"@expofp/geometry";import{update as W}from"@expofp/renderer";import{useEffect as ve,useRef as S}from"react";import _e from"../../../tools/base-runtime-url";import{loadImage as Fe}from"../../../utils/loadImage";import{mapCamera as ge}from"../camera";import{createCanvas as me,createImageCanvas as Pe,getBounds as Y,imageCanvasCssSize as Ne}from"../drawing/config/canvases";import{getRouteLayerRegex as De,getRouteStopLayerRegex as Oe,TRAFFIC_VEHICLES as re}from"./trafficLayers";import{UpdateQueue as He}from"./UpdateQueue";const ce=2,Ve=ce*3.5,J=ce*12,K=J*.7,We=8,se=2,pe=.6,we=8,ze="transport_locations",ke=150,Ge="#a4aab6",Ie=1e3,Ye=2e4,ye=500;export function useManageTraffic({permission:e,scene:n,dataJsonUrl:r,websocketUrl:a}){const t=S(1),o=S(new Map),c=S(new Map),s=S(null),f=S(null),d=S(0),M=S(1),b=S(new He),T=S(new Map),y=S(Ie),m=S(new Map),E=S(void 0);ve(()=>{if(!e||!n)return;let l=!1,_;const R=n.rootLayer.children,p=c.current,w=o.current,I=b.current;async function Re(){try{let u;try{const i=await fetch(r,{method:"GET",headers:{"Content-Type":"application/json"}});if(!i.ok||i.status===204)return;u=await i.json()}catch(i){console.warn("useManageTraffic failed to get JSON",i)}if(l||!u||u.disabled||u.error)return;t.current=xe(ge()?.state().pixelSize??1);const z=new Map(u.routes.map(({id:i,color:h})=>[i,h])),C=new Map;z.forEach(i=>{C.set(i,je({radius:Ve,color:i,scale:window.devicePixelRatio}))});const U=De(),j=R.filter(i=>U.test(i.name)),X=Oe(),q=R.filter(i=>X.test(i.name));u.routes.slice(0,j.length).forEach(({id:i,color:h,path:g,stops:O,hiddenPoints:L},k)=>{T.current.set(i,g);const x=j[k];if(x){const H=new Map(L?.map(P=>[le(P),P])??[]);for(let P=1;P<g.length;P++){const A=g[P-1],V=g[P];H.has(le(A))||H.has(le(V))||x.children.push({points:{p0:A,p1:V},color:h,width:ce})}x.children.length&&I.add(()=>W(x))}const v=q[k],F=C.get(h);v&&F&&O?.length&&(O.forEach(H=>{v.children.push({source:F,bounds:Y(H.x,H.y,...$(F),t.current)})}),v.children.length&&I.add(()=>W(v)))});const D=R.find(i=>i.name===re);if(!D){console.warn(`useManageTraffic: the scene has no "${re}" layer`);return}const B=new Map;D.onScale=({pixelSize:i})=>{t.current=xe(i);const h=[];for(const g of q){const O=g.children;for(const L of O){const k=L.source;L.bounds=Y(L.bounds.center.x,L.bounds.center.y,...$(k),t.current,L.bounds.rotation),h.push(L)}}for(const g of o.current.values()){const O=g.source;g.bounds=Y(g.bounds.center.x,g.bounds.center.y,...$(O),t.current,g.bounds.rotation),h.push(g)}return h},I.add(()=>W(D)),z.forEach((i,h)=>{B.set(h,Me({id:h,width:J,height:J,color:i,scale:window.devicePixelRatio}))});const Ae=Me({id:"orphan",width:J,height:J,color:Ge,scale:window.devicePixelRatio});let Q=null;try{const i=await Fe(`${_e}icons/bus-white.svg`);if(l)return;Q=Pe(i,K,K,window.devicePixelRatio);const{width:h,height:g}=Ne(i,K,K);ne.set(Q,[h,g])}catch(i){console.error(i)}f.current=i=>{try{const h=JSON.parse(i.data);if(h.type!==ze)return;const g=i.timeStamp||performance.now();M.current=Math.round(g-d.current),d.current=g;const O=Math.max(M.current??ye,ye),L=D.children;let k=!1;h.data.forEach(({id:x,x:v,y:F,route_id:H,hidden:P})=>{p.has(x)&&(p.get(x)?.(),p.delete(x));const A=w.get(x),V=w.get(ae(x))??null;if(P&&A&&V){A.hidden=!0,V.hidden=!0,I.add(()=>W(A,V));return}if(m.current.set(x,performance.now()),!A){const G=B.get(H)??Ae,N={source:G,bounds:Y(v,F,...$(G),t.current,0)};if(w.set(x,N),Q){const Z=ae(x),de={source:Q,bounds:Y(v,F,...$(Q),t.current,0)};Q.setAttribute("id",Z),w.set(Z,de),L.push(N,de)}else L.push(N);k=!0;return}const be=A.bounds.center,oe=Be(be,{x:v,y:F},T.current.get(H));if(oe.reduce((G,N,Z)=>Z===0?G:G+ie(oe[Z-1],N),0)>=ke||document.hidden)Se({updateQueue:I,vehicle:A,vehicleFinery:V,x:v,y:F,scale:t.current,angle:Ue(A.bounds.center,{x:v,y:F})});else{const G=Qe(oe,O,N=>{Se({updateQueue:I,vehicle:A,vehicleFinery:V,x:N.x,y:N.y,scale:t.current,angle:N.angle})});p.set(x,G)}}),k&&I.add(()=>W(D))}catch(h){console.error("handleSocketMessage",h)}},d.current=performance.now(),te(),window.addEventListener("online",ue),Le(u.config?(Number(u.config.vehicle_inactive_interval)||20)*1e3:Ye)}catch(u){console.warn(u)}}Re();function te(){l||s.current?.readyState===WebSocket.OPEN||s.current?.readyState===WebSocket.CONNECTING||(s.current=new WebSocket(a),s.current.onmessage=f.current,s.current.onopen=()=>{y.current=Ie},s.current.onclose=()=>{if(l||!navigator.onLine)return;_=window.setTimeout(te,y.current);const u=3e4;y.current=Math.min(y.current*2,u)})}function ue(){te()}function Le(u){clearInterval(E.current),!l&&(E.current=window.setInterval(()=>{const z=performance.now(),C=[],U=[];m.current.forEach((j,X)=>{if(z-j<u)return;const q=w.get(X);q&&(q.hidden=!0,U.push(q),C.push(X));const D=ae(X),B=w.get(D);B&&(B.hidden=!0,U.push(B),C.push(D))}),U.length&&I.add(()=>W(...U)),C.forEach(j=>m.current.delete(j))},u))}return()=>{l=!0,clearTimeout(_);const u=s.current;u&&(u.onopen=null,u.onmessage=null,u.onclose=null,u.close(),s.current=null),f.current=null;const z=R.find(C=>C.name===re);z&&(z.onScale=void 0),p.forEach(C=>C?.()),p.clear(),w.clear(),I.destroy(),window.removeEventListener("online",ue),clearInterval(E.current)}},[e,n,r,a])}function $(e){const n=ne.get(e);if(!n)throw new Error("useManageTraffic: an icon was drawn without a recorded CSS size");return n}function Ee(e){return e*2}function $e(e,n){const r=n*pe,a=we*2;return[n+se+r/2+a,e+r+se+a]}function xe(e){return Math.min(e||1,We)}function Ue(e,n){return fe(e,n)}function je({radius:e,scale:n,color:r}){const a=Math.ceil(e*2*n),t=me(a,a,n);ne.set(t,[Ee(e),Ee(e)]);const o=t.getContext("2d");o.imageSmoothingEnabled=!1;const c=a/2,s=e*.78,f=e*.33;return o.translate(c,c),o.scale(n,n),o.beginPath(),o.arc(0,0,e,0,2*Math.PI),o.fillStyle="#FFFFFF",o.fill(),o.beginPath(),o.arc(0,0,s,0,2*Math.PI),o.fillStyle=r,o.fill(),o.beginPath(),o.arc(0,0,f,0,2*Math.PI),o.fillStyle="#FFFFFF",o.fill(),t}function Me({id:e,width:n,height:r,color:a,scale:t}){const o=se*t,c=n/2*t,s=r*t,f=pe,d=.01,M=s*f,b=s,T=we*t,y=b+o+M/2+T*2,m=c*2+M+o+T*2,E=me(y,m,t);ne.set(E,$e(n,r)),E.setAttribute("id",e);const l=E.getContext("2d"),_=y/2,R=m/2;l.save(),l.translate(_,R),l.rotate(-Math.PI/2),l.translate(-_,-R);const p=_,w=R-b/2+c,I=w+M;return l.shadowColor="rgba(16, 24, 40, 0.2)",l.shadowBlur=T/2,l.beginPath(),l.arc(p,w,c,Math.PI,0,!1),l.bezierCurveTo(p+c,w+s*.3,p+d*c,I,p,I),l.bezierCurveTo(p-d*c,I,p-c,w+s*.3,p-c,w),l.closePath(),l.fillStyle=a,l.fill(),l.strokeStyle="#FFFFFF",l.lineWidth=o,l.stroke(),l.restore(),E}function ie(e,n){return he(e,n)}function ae(e){return`${e}_finery`}function Se({updateQueue:e,vehicle:n,vehicleFinery:r,x:a,y:t,scale:o,angle:c}){const s=n.source;if(n.bounds=Y(a,t,...$(s),o,c),n.hidden=!1,r){const f=ge()?.state().roll??0,d=r.source;r.bounds=Y(a,t,...$(d),o,Ce(f)),r.hidden=!1,e.add(()=>W(r,n))}else e.add(()=>W(n))}function ee(e,n,r){return{x:e.x+(n.x-e.x)*r,y:e.y+(n.y-e.y)*r}}function Te(e,n){let r=1/0,a={index:0,t:0};for(let t=0;t<n.length-1;t++){const o=n[t],c=n[t+1],s=c.x-o.x,f=c.y-o.y,d=s*s+f*f,M=d?((e.x-o.x)*s+(e.y-o.y)*f)/d:0,b=Math.max(0,Math.min(1,M)),T=ee(o,c,b),y=ie(e,T);y<r&&(r=y,a={index:t,t:b})}return a}function qe(e,n,r){const a=ie(e,n),t=Math.max(2,Math.ceil(a/r)+1),o=[];for(let c=0;c<t;c++){const s=c/(t-1),f=ee(e,n,s);o.push(f)}return o}function Be(e,n,r){if(!r||!r.length)return qe(e,n,10);const a=Te(e,r),t=Te(n,r),o=[],c=s=>o.push(s);a.index+1<r.length?c(ee(r[a.index],r[a.index+1],a.t)):c(r[a.index]);for(let s=a.index+1;s<=t.index&&s<r.length;s++)c(r[s]);return t.index+1<r.length?c(ee(r[t.index],r[t.index+1],t.t)):c(r[t.index]),o}function Qe(e,n,r,a){if(e.length<2)return()=>{};let t=null,o;const c=[];let s=0;for(let d=0;d<e.length-1;d++){const M=he(e[d],e[d+1]);c.push(M),s+=M}const f=d=>{t||(t=d);const M=d-t,b=Math.min(M/n,1),T=b*s;let y=0,m=0;for(;m<c.length&&y+c[m]<T;)y+=c[m],m++;m>=c.length&&(m=c.length-1);const E=e[m],l=e[Math.min(m+1,e.length-1)],_=c[m]||0,R=_===0?0:(T-y)/_,p=E.x+(l.x-E.x)*R,w=E.y+(l.y-E.y)*R,I=fe(E,l);r({x:p,y:w,angle:I}),b<1?o=requestAnimationFrame(f):a&&a()};return o=requestAnimationFrame(f),()=>{o&&cancelAnimationFrame(o)}}function le(e){return`${e.x},${e.y}`}const ne=new WeakMap;
|
|
@@ -30,4 +30,9 @@ export declare function createSceneDef(layers: LayerDef[], viewboxRect: Box | SV
|
|
|
30
30
|
export declare function createShapeDot(rect: Rect, color?: string, radius?: number): ImageDef & {
|
|
31
31
|
source: HTMLCanvasElement;
|
|
32
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* The CSS size a booth's dot is drawn at. For the drawers that receive a dot rather than create
|
|
35
|
+
* one, and so cannot read the radius it was made from.
|
|
36
|
+
*/
|
|
37
|
+
export declare const SHAPE_DOT_CSS_PX: number;
|
|
33
38
|
//# sourceMappingURL=defs.d.ts.map
|
package/dist/esm/engine/defs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Box as
|
|
2
|
-
`),fontUrl:
|
|
3
|
-
`),fontUrl:
|
|
1
|
+
import{Box as s,isBox as u,isMesh as p,isPolygon as x,isRect as D,Mesh as S,Rect as d}from"@expofp/geometry";import{circleCanvasCssSize as f,createCircleCanvas as l}from"../components/Map/drawing/config/canvases";import{DEFAULT_FONT_LIGHT_URL as m,DEFAULT_FONT_URL as w}from"./fonts";export function rectToShapeDef(e,t){return createShapeDef(s.fromSvg(e),t)}export function meshToShapeDef(e,t){if(!e)throw new Error("Create ShapeDef: mesh is not provided");const n=e.positions.map(o=>({x:o[0],y:Math.abs(o[1]),z:o[2]??0})),r=e.cells;return createShapeDef(new S(n,r),t)}export function createShapeDef(e,t="#000"){if(!e||!(u(e)||D(e)||x(e)||p(e)))throw new Error("Invalid shape definition");return{shape:e,color:t}}export function createImageDef(e,t,n){if(!e)throw new Error("Image source is not provided");return{source:e,bounds:t,...n}}export function createTextDef(e,t,n,r,o){if(e.length===0)throw new Error("Invalid text lines");return{lines:e,bounds:t,padding:n,alignment:r,...o}}export function createTextDefLines(e,t,n,r=[void 0,void 0]){const[o,i]=e,c=[{text:o.join(`
|
|
2
|
+
`),fontUrl:r[0]||w,color:t,fontSize:n}];return i.length&&c.push({text:i.join(`
|
|
3
|
+
`),fontUrl:r[1]||m,color:t,fontSize:n}),c}export function createLayerDef(e,t,n){if(!e)throw new Error("Layer name is required");return t||(t=[]),{name:e,children:t,...n}}export function createSceneDef(e,t,n){const r=t instanceof s?t:s.fromSvg(t);return{rootLayer:createLayerDef("root",e),background:n,viewbox:r}}export function createShapeDot(e,t="#000",n=a){const r=l(n,t),o=f(n),i=new d(e.center,{x:o,y:o},e.rotation,e.elevation);return createImageDef(r,i)}const a=1.5;export const SHAPE_DOT_CSS_PX=f(a);
|
|
@@ -33,7 +33,19 @@ export declare function rotateRectByQuarters(rect: Rect, turns: number): Rect;
|
|
|
33
33
|
export declare function getQuarterTurns(newAngle: number, currentRotation: number): number;
|
|
34
34
|
export declare function shouldFlip(newAngle: number, currentRotation: number): boolean;
|
|
35
35
|
export declare function flipAngle(angle: number): number;
|
|
36
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Bounds for an image pinned to a booth's top-right corner, clamped to fit inside the booth.
|
|
38
|
+
* @param rect - The booth.
|
|
39
|
+
* @param size - The image's size at a scale of 1, in CSS pixels. Not a canvas's backing store: that
|
|
40
|
+
* is in the device pixels it was rasterized at, which says how crisp the image is, not how big.
|
|
41
|
+
* @param padding - The booth's inset, in plan units.
|
|
42
|
+
* @param scale - Plan units per CSS pixel.
|
|
43
|
+
* @returns The bounds.
|
|
44
|
+
*/
|
|
45
|
+
export declare function getClampedBoundsCanvas(rect: Rect, size: {
|
|
46
|
+
readonly width: number;
|
|
47
|
+
readonly height: number;
|
|
48
|
+
}, padding: number, scale: number): Rect;
|
|
37
49
|
/**
|
|
38
50
|
* Reads the `roll` map setting — `1`/`0`, from the URL or the venue — as a boolean, refusing
|
|
39
51
|
* anything else. The label configs consult it before declaring their `onRoll` rules: with roll
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{angleDiff as p,Rect as k}from"@expofp/geometry";import{getBounds as w}from"
|
|
1
|
+
import{angleDiff as p,Rect as k}from"@expofp/geometry";import{getBounds as w}from"../components/Map/drawing/config/canvases";export function updateLinesScale(t,o,n){let e=!1;return t.forEach((r,i)=>{let s=0;n[i].forEach(({value:a,scaleFactor:c})=>{o<c&&(s=a)}),r.fontSize!==s*o&&(e=!0),r.fontSize=s*o}),e}export function rotateTextDefByQuarters(t,o){const{center:n,size:e,rotation:r,elevation:i}=t.bounds,s=o%2!==0;return t.bounds.set(n.x,n.y,s?e.y:e.x,s?e.x:e.y,r+o*Math.PI/2,i),t}export function rotateRectByQuarters(t,o){const{size:n,center:e,rotation:r,elevation:i}=t,s=o%2!==0?{x:n.y,y:n.x}:n;return new k(e,s,r+o*Math.PI/2,i)}export function getQuarterTurns(t,o){if(!Number.isFinite(t)||!Number.isFinite(o))return 0;const n=p(t,o);return Math.abs(n)<=Math.PI/4?0:Math.round(n/(Math.PI/2))}export function shouldFlip(t,o){const n=p(t,o),e=Math.PI/2;return Math.abs(n)>e+.1}export function flipAngle(t){return(t+Math.PI+Math.PI)%(2*Math.PI)-Math.PI}export function getClampedBoundsCanvas(t,o,n,e){const r=o.width,i=o.height,s=t.size,a=t.center,c=t.rotation,d=s.x/r,M=s.x-n*2,b=(s.y-n*2)*.8,y=0,g=M/r,I=b/i,S=Math.min(g,I,d);e=Math.min(Math.max(e,y),S);const P=r*e,B=i*e,h=Math.sin(c),f=Math.cos(c),u=s.x/2-n,x=-s.y/2+n,z=a.x+u*f-x*h,R=a.y+u*h+x*f,l=P/2,m=-B/2,W=l*f-m*h,H=l*h+m*f,X=z-W,Y=R-H;return w(X,Y,r,i,e,c,t.elevation)}export function getRollValue(t){if(!t)return!1;if(!Number.isInteger(+t)||+t!=1&&+t!=0)throw new Error("Map roll: setting value is incorrect");return!!+t}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{applyIntents as
|
|
1
|
+
import{applyIntents as k,getConfig as y,parseDeprecatedUrlParams as W,parseFromUrlTolerant as z,parseIntentsFromUrl as I,parseLegacyQuery as w,serializeIntentToUrl as N,serializeSelection as Q}from"@expofp/config";import{Box as j}from"@expofp/geometry";import{UrlConfigSchema as H}from"@expofp/schema";import{safeDecode as p}from"@expofp/utils";import{runInAction as $}from"mobx";import{applyKioskMode as q}from"../components/Kiosk/kiosk-mode";import{recoverKioskFromUrlPrams as J}from"../components/Kiosk/recoverKioskFromUrlPrams";import{LEGACY_PREVIEW_MODE_STORAGE_KEY as X,LEGACY_VIEWER_MODE_STORAGE_KEY as Z,PREVIEW_MODE_STORAGE_KEY as x,VIEWER_MODE_STORAGE_KEY as E}from"../constants";import ee from"../data";import s,{uiState as i}from"../store";import{BoothBase as F}from"../store/BoothStore";import{CurrentPosition as te,extractRoute as oe}from"../store/RouteStore";import{eventScopedValue as re}from"../tools/event-scoped-cache.js";import{setConsentSettings as ie}from"../tools/gtag";import M from"../tools/logger";import{areLayersEnabled as se}from"../utils/areLayersEnabled";import{brand as O}from"../utils/brand";import{cameraToMapSettings as B}from"../utils/camera-map-settings";import{handleCustomCommand as ne}from"../utils/customCommands";import{formatEventTitle as ae,formatPlaceholderTitle as le}from"../utils/event-title";import{getMostFrequent as ce}from"../utils/getMostFrequent";import{heatmapEnabled as ue}from"../utils/heatmap-enabled";import fe from"../utils/is-own-domain";import{isLocalStorageAvailable as L}from"../utils/localStorage";import{planAutorun as P,planWhen as d}from"../utils/plan-reactions.js";import{stripTrackingParams as me}from"../utils/trackingParams";import{rewriteMultiSlugQuery as pe}from"./multi-slug";import{currentSearch as f,disableUrlWrites as de,initUrlSync as he,pushQuery as ye,replaceQuery as m}from"./url-sync";let b=!1,h=!1;export function applyDeclarativeConfig(){v(y()),d(()=>s.layerStore.layersLoaded,()=>{const e=y().camera;Object.keys(e).length&&K(B(e));const t=y().visibility;Object.keys(t).length&&i.setVisibility(t)})}export function initUrlRouting(e){he({offHistory:e,onNavigate:()=>S({backForward:!0})}),T(),g(),d(()=>s.layerStore.layersLoaded,()=>{s.urlFilterManager&&!s.urlFilterManager.isInitialized&&s.urlFilterManager.initialize(),h=!0;try{S()}finally{h=!1}P(G),P(A),i.viewerMode&&(i.menu=!0)})}export function applyParameters(e=""){m("?"+p(e.toString())),s.layerStore.layersLoaded?U(e):(g(),d(()=>s.layerStore.layersLoaded,()=>U(e)))}function U(e){const t="?"+p(e),o=ve(t),n=[...o.intents??[],...I(t).intents],{intents:l=[],...c}=W(t,{visibility:o.visibility,consent:o.consent,intents:n});v(o),v(c);const a=o.consent??c.consent;a&&ie(a),o.camera&&Object.keys(o.camera).length&&K(B(o.camera)),o.visibility&&Object.keys(o.visibility).length&&i.setVisibility(o.visibility),T(),S();const r=[...n,...l];r.length&&k(s.fp,r)}function g(){const e=f(),t=e.length>1?p(e.substring(1)):"";return ne(t)}function S(e={}){b=!0;try{const t=new URLSearchParams(p(window.location.search));J(t);const{primary:o}=w(f()),n=o.type==="select"&&(!o.slug||/^t=[^&]*$/.test(o.slug))&&(i.heatmap||i.heatmapYah);!g()&&!n&&(e.backForward?be(o):R(o))}finally{b=!1}if(e.backForward){const{exhibitor:t,booth:o,eventItem:n}=V(),l=_();l.exhibitor=t,l.booth=o,l.eventItem=n}A(),G()}function be(e){e.type==="list"&&e.list==="sessions"?s.fp.showSessions():R(e);const{intents:t}=I(f());k(s.fp,t.filter(o=>o.name==="showSessions"))}function R(e){const t=s.fp;switch(e.type){case"kiosk":e.enabled!==null&&q(i,e.enabled);return;case"list":t.showList(e.list);return;case"tour":t.selectTour(e.tourId);return;case"planner":h&&s.searchButtonsStore.keepFiltersOnNextNavigation(),t.openPlanner({items:e.items,from:e.from,fromBookmarks:e.fromBookmarks});return;case"route":{s.routeStore.setOnlyAccessible(e.accessible);const o=oe(e.from??"",e.to??"",e.waypoints);h&&!(o.from&&o.from===o.to)&&s.searchButtonsStore.keepFiltersOnNextNavigation(),s.routeStore.selectRoute(o),s.uiState.setIsMultiPointRoute(e.waypoints.length>0),e.title&&s.uiState.setRouteTitle(e.title);return}case"selectExhibitors":setTimeout(()=>t.selectExhibitor(e.values),250);return;case"ownedByFilters":M.log("Skipping filter parameters in dispatchFromUrl (owned by URLFilterManager)");return;case"ownedByConfig":return;case"select":t.select(e.slug);return}}export function applyPathway(e){const{pathwayId:t,boothIds:o,exhibitorIds:n}=e,l=s.boothStore.booths.filter(r=>o.includes(r.externalId)),c=s.exhibitorStore.exhibitors.filter(r=>n.includes(r.externalId)).flatMap(r=>r.booths),a=[...l,...c];if(se()){const r=ce(a.map(u=>u.layer.name));r&&s.fp.activateFloor({name:r})}(o.length>0||n.length>0)&&s.fp.highlightEntities([...o,...n]),s.layerStore.showPathWay(t),a.length>0&&$(()=>{s.uiState.moveToRect=j.fromUnion(...a.map(r=>r.rect).filter(Boolean)),s.uiState.rollReset=!0})}function T(){const{oneShots:e}=w(f());for(const o of e)ge(o);const t=me(f());t!==null&&m("?"+t),i.previewExhibitor&&m("?"+i.previewExhibitor.slug),Se()}function ge(e){switch(e.type){case"heatmap":C(e.yah);return;case"blueDot":{const t=new te(e.x,e.y,s.layerStore.findLayer(e.layer??"")?.name,void 0,e.lat,e.lng);d(()=>s.layerStore.layersLoaded,()=>s.routeStore.selectCurrentPosition(t,!0,1));return}case"viewerMode":L&&(e.enabled?localStorage.setItem(E,"true"):(localStorage.removeItem(E),localStorage.removeItem(Z)));return;case"previewMode":L&&(e.enabled?localStorage.setItem(x,"true"):(localStorage.removeItem(x),localStorage.removeItem(X)));return;case"uiScale":e.scale!==null?s.uiState.setUIScale(e.scale,!0):M.warn(`Invalid ui-scale parameter: ${e.raw}. Must be a number between 0.8 and 1.4.`);return;case"resetUiScale":s.uiState.resetUIScale();return}}function C(e){de(),e?(i.heatmapYah=!0,i.monochrome=!0,i.hideLogoInBooth=!0,i.hideHeaderLogo=!0,i.disableBookmarked=!0):i.heatmap=!0}function Se(){const e=pe(f(),t=>s.exhibitorStore.exhibitors.find(n=>n.slug===t||n.externalId===t)?.name);e!==null&&m(e)}function v(e){e.noOverlay!==void 0&&(i.hideOverlay=e.noOverlay),e.monochrome&&(i.monochrome=!0),e.hideHeaderLogo&&(i.hideHeaderLogo=!0),e.hideLogoInBooth&&(i.hideLogoInBooth=!0),e.disableFeatured&&s.exhibitorStore.exhibitors.forEach(t=>t.featured=!1),e.disableBookmarked&&(i.disableBookmarked=!0),e.disableGps&&s.routeStore.setGpsTrackingEnabled(!1),e.heatmap&&ue(e.heatmap)&&C(e.heatmap.variant==="yah")}function ve(e){return z(H,e).value}const _=re(()=>({exhibitor:null,booth:null,eventItem:null}));function A(){const{selection:e,exhibitor:t,booth:o,eventItem:n}=V(),l=s.urlFilterManager.filterSearch(),c=ke(e);if(b)return;const a=c||Q(e)||l;if(f()===a)return;const r=_();t!==r.exhibitor||o!==r.booth||n!==r.eventItem?ye(a):m(a),r.exhibitor=t,r.booth=o,r.eventItem=n}function ke(e){if(e.type!=="list"||e.list!=="sessions")return"";const{selectedTracks:t,selectedVenues:o,date:n,timeOfDay:l,showBookmarksOnly:c,showLiveOnly:a}=s.sessionsFilterStore.state.filters,r={};return t.value.length&&(r.tracks=D(t.value)),o.value.length&&(r.venues=D(o.value)),n.value!=="all"&&(r.date=n.value),n.value==="today"&&l.value!=="all"&&(r.time=l.value),c.value&&(r.bookmarked=!0),a.value&&(r.live=!0),Object.keys(r).length?"?"+N({name:"showSessions",args:[r]}):""}function D(e){return[...e].sort((t,o)=>t-o).map(String)}function V(){const e=i.selectedExhibitor,t=i.selectedBooth,o=i.selectedEventItem,n=i.selectedRoute,l=i.selectedSpeaker,c=i.setKioskModeEnabled,a=i.list;let r;if(a.type==="route-planner"&&!e&&!t&&!o){const u=s.routePlannerStore;r={type:"planner",fromBookmarks:u.source==="bookmarks",items:u.items.map(Y=>Y.entity.slug).filter(Boolean),from:u.startPoint?.slug||void 0}}else if(n&&!i.isMultiPointRoute)r={type:"route",to:n.to instanceof F?n.to.slug:void 0,from:n.from instanceof F?n.from.slug:void 0,accessible:s.routeStore.onlyAccessible,waypoints:n.waypoints?.map(u=>u.slug)};else if(e)r={type:"slug",slug:e.slug};else if(t)r={type:"slug",slug:t.slug};else if(o)r={type:"slug",slug:o.slug};else if(l)r={type:"slug",slug:l.slug};else if(c)r={type:"none"};else switch(a.type){case"bookmarks":case"visited":case"sessions":case"exhibitors":case"speakers":case"tours":case"language":r={type:"list",list:a.type};break;case"category":r={type:"slug",slug:i.selectedCategory?.slug??""};break;case"search":r={type:"slug",slug:a.text||""};break;case"filter":r={type:"filter",key:a.query.key,value:a.query.value};break;case"multi-point-tour":r={type:"tour",tourId:a.tourId};break;default:throw new Error("Unkown list.type")}return{selection:r,exhibitor:e,booth:t,eventItem:o}}function G(){if(!fe)return;const e=i.selectedExhibitor,t=i.selectedEventItem,o=i.selectedSpeaker;let n="";e?n=e.name:t?n=t.name:o?n=o.name:i.list.type==="search"&&i.list.text?n="`"+(i.list.text||"")+"`":i.list.type==="multi-point-tour"&&i.tourTitle&&(n=i.tourTitle),n.length&&(n+=" \u2013 "),n+=ae(ee,O)??le(window.location.hostname,O),document.title=n}function K(e){try{if(i.setMapSettings(e),e.z){const t=s.layerStore.layers.find(o=>o.name===e.z);t&&s.layerStore.updateVisibility(t,!0)}}catch(t){console.error("Failed to process map settings.",t)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createCurrentCanvas as c}from"../../components/Map/drawing/config/canvases";import{HeatmapYah as
|
|
1
|
+
import{createCurrentCanvas as c,cssSizeOf as m}from"../../components/Map/drawing/config/canvases";import{HeatmapYah as d}from"../HeatmapStore";export function initHeatmap(t){if(window.__heatmapData)t.heatmapStore.heatmapData=window.__heatmapData;else if(window.__heatmapDataYah){t.heatmapStore.heatmapData.yah=window.__heatmapDataYah.yah.map(a=>new d(a.id,a.name,a.viewCount,a.x,a.y,a.z));const o=t.heatmapStore.heatmapData.yah.map(a=>{const i=t.heatmapStore.getColorByClicks(a.viewCount),p=t.uiState.devicePixelRatio,e=c(p,i,void 0,95,120,a.viewCount.toString()),r=e.toDataURL();return{name:a.id.toString(),scale:1,...m(e),content:r}}),n=t.heatmapStore.heatmapData.yah.map(a=>({id:a.id.toString(),x:a.x,y:a.y,z:a.z,position:"lefttop",icon:a.id.toString(),selectedIcon:a.id.toString()}));t.routeStore.setMarkers({markers:n,icons:o}),t.selectSearch(" ")}}
|
|
@@ -25,6 +25,13 @@ export declare class SearchButtonsActions {
|
|
|
25
25
|
handleSessionsClick(caption?: string): void;
|
|
26
26
|
togglePoiType(poiTypeId: number): void;
|
|
27
27
|
clearAllFilters(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Turns the active search button off when navigation opens, so its pins do
|
|
30
|
+
* not crowd the route. Unlike `clearAllFilters` it leaves the panel, the
|
|
31
|
+
* list and the details alone (they now show the navigation) and keeps
|
|
32
|
+
* pathways, which belong to tours, not to search buttons.
|
|
33
|
+
*/
|
|
34
|
+
deactivateForNavigation(): void;
|
|
28
35
|
showSubButtons(parentButtonId: string): void;
|
|
29
36
|
hideSubButtons(): void;
|
|
30
37
|
handleSubButtonClick(subButtonId: string): void;
|
|
@@ -40,6 +47,8 @@ export declare class SearchButtonsActions {
|
|
|
40
47
|
private preserveSearchText;
|
|
41
48
|
private switchToSearch;
|
|
42
49
|
private resetAllFilters;
|
|
50
|
+
/** Turns off the active search button and every filter it applied, URL included. */
|
|
51
|
+
private clearActiveFilters;
|
|
43
52
|
private setPoiFilterFromString;
|
|
44
53
|
private get isMobile();
|
|
45
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as r}from"tslib";import{action as l}from"mobx";import{MOBILE_BREAKPOINT as n}from"../../constants";import c from"../../tools/track-event";import{PREFIXES as
|
|
1
|
+
import{__decorate as r}from"tslib";import{action as l}from"mobx";import{MOBILE_BREAKPOINT as n}from"../../constants";import c from"../../tools/track-event";import{PREFIXES as h,SearchButtonType as o}from"./constants";import{extractPoiTypeId as u,getButtonConfig as S}from"./utils";export class SearchButtonsActions{constructor(e,t,i){this.rootStore=e,this.state=t,this.filters=i}reportActivation(e){e&&c("sbtnview",e)}handleSearchButtonClick(e,t){const s={[o.BOOKMARKS]:()=>this.handleBookmarksClick(t),[o.VISITED]:()=>this.handleVisitedClick(t),[o.SESSIONS]:()=>this.handleSessionsClick(t),[o.TOURS]:()=>this.handleToursClick(t),[o.CATEGORIES]:()=>this.handleCategoriesClick(t),[o.EXHIBITORS]:()=>this.handleExhibitorsClick(t)}[e];if(s){s();return}e.startsWith(h.POI_TYPE)&&this.handlePoiTypeClick(e,t)}handleExtendedSearchButtonClick(e){const t=S(e);if(!t)return;const i=t.name;if(t.type==="link"){this.handleLinkClick(t,i);return}const s=t.children?.filter(a=>a.visible)||[];if(s.length===1&&s[0].type==="poi_types"&&s[0].name===t.name){this.handleSearchButtonClick(e,i);return}t.children&&s.length>0?this.handleParentButton(e,t,i):this.handleSearchButtonClick(e,i)}handleMainButtonClick(e){this.handleSearchButtonClick(e)}handleSessionsClick(e){const{uiState:t}=this.rootStore;t.list.type==="sessions"?this.switchToSearch():(this.reportActivation(e),this.resetAllFilters(),t.details=null,t.menu=!1,t.list={type:"sessions",text:"",focused:!1},this.state.setSubButton(null),t.selectedTrack=null,this.state.subButtonsEnabled&&this.showSubButtons("sessions"),this.isMobile&&(t.desiredOverlaySize="full"))}togglePoiType(e){this.handleSearchButtonClick(`${h.POI_TYPE}${e}`)}clearAllFilters(){this.switchToSearch()}deactivateForNavigation(){const{uiState:e}=this.rootStore;(this.state.activePoiFilterId!==null||this.state.searchShortcutState.activeParentId!==null||e.hasAppliedFilters)&&this.clearActiveFilters()}showSubButtons(e){this.state.subButtonsEnabled&&(this.state.setSubButtonParent(e),this.state.setSubButton(null),this.rootStore.uiState.subButtonsVisible=!0)}hideSubButtons(){this.state.setSubButtonParent(null),this.state.setSubButton(null),this.rootStore.uiState.subButtonsVisible=!1}handleSubButtonClick(e){this.state.activeSubButtonId!==e&&this.state.setSubButton(e)}toggleListView(e,t,i){this.rootStore.uiState.list.type===e?this.switchToSearch():(this.reportActivation(i),this.resetAllFilters(),t())}handleBookmarksClick(e){this.toggleListView("bookmarks",()=>{this.rootStore.clickBookmarks()},e)}handleVisitedClick(e){this.toggleListView("visited",()=>{this.rootStore.clickVisited()},e)}handleToursClick(e){const{uiState:t}=this.rootStore;t.list.type==="tours"?this.switchToSearch():(this.reportActivation(e),this.resetAllFilters(),t.details=null,t.menu=!1,t.list={type:"tours",text:"",focused:!1},this.isMobile&&(t.desiredOverlaySize="full"))}handleCategoriesClick(e){const{uiState:t}=this.rootStore;this.reportActivation(e),t.list.type!=="search"?this.switchToSearch():this.state.activePoiFilterId&&this.filters.clearPoiTypeFilters(),this.state.searchShortcutState.activeParentId&&(this.state.setActiveParentId(null),this.state.clearChildren(),this.state.showShortcuts(!1),this.filters.clearAllChildFilters()),this.rootStore.categoryFilterStore.openFilter()}handleExhibitorsClick(e){const{uiState:t}=this.rootStore;t.list.type==="exhibitors"?this.switchToSearch():(this.reportActivation(e),this.resetAllFilters(),t.details=null,t.menu=!1,t.list={type:"exhibitors",text:"",focused:!1},this.isMobile&&(t.desiredOverlaySize="full"))}handlePoiTypeClick(e,t){const{uiState:i}=this.rootStore,s=this.state.activePoiFilterId!==e;s&&this.reportActivation(t);const a=i.list.type==="search"&&i.list.text||"";i.list.type!=="search"?this.switchToSearch(!0):i.selectedCategoryFilters.length>0&&this.filters.clearCategoryFilters(),this.state.searchShortcutState.activeParentId&&(this.state.setActiveParentId(null),this.state.clearChildren(),this.state.showShortcuts(!1),this.filters.clearAllChildFilters()),s?this.setPoiFilterFromString(e):this.filters.clearPoiTypeFilters(),a&&i.list.type==="search"&&(i.list={type:"search",text:a,focused:!1}),this.rootStore.searchStore.selectSearchAndFocus(a)}handleLinkClick(e,t){const i=e.children?.find(s=>s.type==="link");i&&"linkUrl"in i&&(this.reportActivation(t),window.open(i.linkUrl,"_blank"))}handleParentButton(e,t,i){const{uiState:s}=this.rootStore;if(this.state.searchShortcutState.activeParentId===e){this.state.setActiveParentId(null),this.state.clearChildren(),this.state.showShortcuts(!1),this.filters.clearAllChildFilters(),this.rootStore.urlFilterManager.clearAllFilters(),s.centerMap=!0,s.overlaySize==="full"&&s.searchFocused&&this.rootStore.searchStore.setFocused(!1);return}this.reportActivation(i),s.list.type!=="search"&&this.switchToSearch(),this.state.activePoiFilterId&&this.state.setPoiFilter(null),this.state.setActiveParentId(e),this.state.showShortcuts(!0),this.state.clearChildren(),this.filters.applyAllChildrenFilters(t),this.rootStore.searchStore.selectSearchAndFocus()}preserveSearchText(e){const{uiState:t}=this.rootStore,i=t.list.type==="search"&&t.list.text||"";e(),t.list.type==="search"&&i&&(t.list={type:"search",text:i,focused:!1})}switchToSearch(e=!1){const t=()=>{this.resetAllFilters(),this.rootStore.uiState.details=null,this.rootStore.uiState.menu=!1,this.rootStore.uiState.list={type:"search",text:"",focused:!1}};e?this.preserveSearchText(t):t()}resetAllFilters(){this.clearActiveFilters(),this.rootStore.fp.hidePathways()}clearActiveFilters(){this.state.reset(),this.rootStore.uiState.selectedPoiTypeFilters=[],this.rootStore.uiState.selectedCategoryFilters=[],this.rootStore.uiState.categoryFilterOpen=!1,this.rootStore.categoryFilterStore.state.selectedItems=[],this.rootStore.categoryFilterStore.state.pendingItems=[],this.rootStore.urlFilterManager.clearAllFilters()}setPoiFilterFromString(e){this.state.setPoiFilter(e);const t=u(e);if(t!==null){const i=this.rootStore.poiTypeStore.poiTypes.find(s=>s.id===t);i&&(this.rootStore.uiState.selectedPoiTypeFilters=[i],this.rootStore.urlFilterManager.setPoiType(i.name))}}get isMobile(){return typeof window<"u"&&window.innerWidth<=n}}r([l],SearchButtonsActions.prototype,"handleSearchButtonClick",null),r([l],SearchButtonsActions.prototype,"handleExtendedSearchButtonClick",null),r([l],SearchButtonsActions.prototype,"handleMainButtonClick",null),r([l],SearchButtonsActions.prototype,"handleSessionsClick",null),r([l],SearchButtonsActions.prototype,"togglePoiType",null),r([l],SearchButtonsActions.prototype,"clearAllFilters",null),r([l],SearchButtonsActions.prototype,"deactivateForNavigation",null),r([l],SearchButtonsActions.prototype,"showSubButtons",null),r([l],SearchButtonsActions.prototype,"hideSubButtons",null),r([l],SearchButtonsActions.prototype,"handleSubButtonClick",null);
|
|
@@ -8,9 +8,24 @@ export default class SearchButtonsStore {
|
|
|
8
8
|
private readonly actions;
|
|
9
9
|
private readonly factory;
|
|
10
10
|
private poiTypeCountsCache;
|
|
11
|
+
/** Set by `keepFiltersOnNextNavigation`, spent by the next entry into navigation. */
|
|
12
|
+
private keepFiltersOnNextEntry;
|
|
11
13
|
private lastPoiTypeCountUpdate;
|
|
12
14
|
constructor(rootStore: RootStore);
|
|
13
15
|
private setupReactions;
|
|
16
|
+
/**
|
|
17
|
+
* Lets the next entry into navigation keep the active filter. For a deep
|
|
18
|
+
* link that opens with both a filter and a route or planner: that is not a
|
|
19
|
+
* switch into navigation, so its filter stays. Call it only right before
|
|
20
|
+
* opening navigation that is sure to land, or the hold outlives it and
|
|
21
|
+
* spares the user's own next entry.
|
|
22
|
+
*/
|
|
23
|
+
keepFiltersOnNextNavigation(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Navigation is the route planner or the directions panel. The planner opens
|
|
26
|
+
* before its route is drawn, so a planner session counts as one entry.
|
|
27
|
+
*/
|
|
28
|
+
private get isNavigationOpen();
|
|
14
29
|
private get subButtonRegistry();
|
|
15
30
|
private registerSubButtonProviders;
|
|
16
31
|
private invalidatePoiTypeCounts;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as i}from"tslib";import{action as s,computed as o}from"mobx";import{CACHE_DURATION as
|
|
1
|
+
import{__decorate as i}from"tslib";import{action as s,computed as o}from"mobx";import{CACHE_DURATION as u,LANGUAGE_TYPE as a,MOBILE_BREAKPOINT as h}from"../../constants";import c from"../../data";import{planReaction as l}from"../../utils/plan-reactions.js";import{SessionsSubButtonProvider as p}from"../providers/SessionsSubButtonProvider";import{SubButtonRegistry as d}from"../SubButtonRegistry";import{PREFIXES as S}from"./constants";import{SearchButtonsActions as y}from"./SearchButtonsActions";import{SearchButtonsFactory as B}from"./SearchButtonsFactory";import{SearchButtonsFilters as C}from"./SearchButtonsFilters";import{SearchButtonsState as g}from"./SearchButtonsState";import{countMapValues as b,extractPoiTypeId as v,isValidConfig as P}from"./utils";export default class e{constructor(t){this.poiTypeCountsCache=new Map,this.keepFiltersOnNextEntry=!1,this.lastPoiTypeCountUpdate=0,this.rootStore=t,this.state=new g,this.filters=new C(t,this.state),this.actions=new y(t,this.state,this.filters),this.factory=new B(t,this.state,this.actions),this.setupReactions()}setupReactions(){l(()=>this.rootStore.boothStore.booths.length,()=>this.invalidatePoiTypeCounts()),l(()=>this.isNavigationOpen,t=>{if(t){if(this.keepFiltersOnNextEntry){this.keepFiltersOnNextEntry=!1;return}this.actions.deactivateForNavigation()}})}keepFiltersOnNextNavigation(){this.keepFiltersOnNextEntry=!0}get isNavigationOpen(){const{uiState:t}=this.rootStore;return t.selectedRoute!==null||t.list.type==="route-planner"}get subButtonRegistry(){return this._subButtonRegistry||(this._subButtonRegistry=new d,this.registerSubButtonProviders()),this._subButtonRegistry}registerSubButtonProviders(){this.subButtonRegistry.register(new p(this.rootStore))}invalidatePoiTypeCounts(){this.poiTypeCountsCache.clear(),this.lastPoiTypeCountUpdate=0}get isVisible(){return this.state.isVisible}get shouldShow(){const{uiState:t}=this.rootStore;if(t.screenSize.width>=h)return this.state.isVisible;const r=!!(t.selectedExhibitor||t.selectedBooth||t.selectedEventItem||t.selectedRoute||t.menu||t.list.type===a);return this.state.isVisible&&!r}get activePoiFilterId(){return this.state.activePoiFilterId}get activeSubButtonsParentId(){return this.state.activeSubButtonsParentId}get activeSubButtonId(){return this.state.activeSubButtonId}get subButtonsEnabled(){return this.state.subButtonsEnabled}get searchShortcutState(){return this.state.searchShortcutState}get searchButtons(){const t=c.filterButtonsConfig;if(!P(t))return console.warn("[SearchButtonsStore] Invalid filterButtonsConfig detected"),[];const n=t.searchButtons;return this.factory.createButtons(n)}get hasAnySearchButtons(){return this.searchButtons.length>0}get hasActiveSearchButton(){return this.state.activePoiFilterId!==null||this.rootStore.uiState.selectedCategoryFilters.length>0}get activeSearchButtonLabel(){return this.state.activePoiFilterId?this.searchButtons.find(n=>n.id===this.state.activePoiFilterId)?.label||null:this.rootStore.uiState.selectedCategoryFilters.length>0?"Categories":null}get activeSubButtons(){return this.state.activeSubButtonsParentId?this.subButtonRegistry.getSubButtons(this.state.activeSubButtonsParentId):[]}get shouldShowSubButtons(){if(!this.state.subButtonsEnabled||!this.state.activeSubButtonsParentId)return!1;const t=this.searchButtons.find(n=>n.id===this.state.activeSubButtonsParentId);return!t||!t.active?!1:this.subButtonRegistry.shouldShowSubButtons(this.state.activeSubButtonsParentId)&&this.activeSubButtons.length>0}get hasActiveParentWithChildren(){return this.state.hasActiveParentWithChildren}get areAllSelected(){return this.filters.areAllSelected()}get activeChildrenCount(){return this.state.activeChildrenCount}get totalChildrenCount(){return this.filters.getChildrenCount()}get poiTypeCounts(){const t=Date.now();if(t-this.lastPoiTypeCountUpdate<u&&this.poiTypeCountsCache.size>0)return this.poiTypeCountsCache;const n=new Map;return this.rootStore.boothStore.booths.forEach(r=>{r.poiTypeId&&n.set(r.poiTypeId,(n.get(r.poiTypeId)||0)+1)}),this.poiTypeCountsCache=n,this.lastPoiTypeCountUpdate=t,n}get totalPoiTypeCount(){return b(this.poiTypeCounts)}get activePoiTypeId(){return this.state.activePoiFilterId?.startsWith(S.POI_TYPE)?v(this.state.activePoiFilterId):null}handleSearchButtonClick(t,n){this.actions.handleSearchButtonClick(t,n)}handleExtendedSearchButtonClick(t){this.actions.handleExtendedSearchButtonClick(t)}handleMainButtonClick(t){this.actions.handleMainButtonClick(t)}handleSessionsClick(t){this.actions.handleSessionsClick(t)}togglePoiType(t){this.actions.togglePoiType(t)}clearAllFilters(){this.actions.clearAllFilters()}showSubButtons(t){this.actions.showSubButtons(t)}hideSubButtons(){this.actions.hideSubButtons()}handleSubButtonClick(t){this.state.activeSubButtonId!==t&&(this.state.setSubButton(t),this.state.activeSubButtonsParentId&&this.subButtonRegistry.handleSubButtonClick(this.state.activeSubButtonsParentId,t))}toggleChildFilter(t){this.filters.toggleChildFilter(t)}clearPoiTypeFilters(){this.filters.clearPoiTypeFilters()}clearAllChildFilters(){this.filters.clearAllChildFilters()}setActiveParentId(t){this.state.setActiveParentId(t)}showShortcuts(t){this.state.showShortcuts(t)}clearChildren(){this.state.clearChildren()}setSubButtonId(t){this.state.setSubButton(t)}setPoiFilterId(t){this.state.setPoiFilter(t)}getPoiTypeTotalCount(t){return this.poiTypeCounts.get(t)||0}isChildActive(t){return this.state.isChildActive(t)}getActiveParent(){return this.filters.getActiveParent()}}i([s],e.prototype,"invalidatePoiTypeCounts",null),i([o],e.prototype,"isVisible",null),i([o],e.prototype,"shouldShow",null),i([o],e.prototype,"activePoiFilterId",null),i([o],e.prototype,"activeSubButtonsParentId",null),i([o],e.prototype,"activeSubButtonId",null),i([o],e.prototype,"subButtonsEnabled",null),i([o],e.prototype,"searchShortcutState",null),i([o],e.prototype,"searchButtons",null),i([o],e.prototype,"hasAnySearchButtons",null),i([o],e.prototype,"hasActiveSearchButton",null),i([o],e.prototype,"activeSearchButtonLabel",null),i([o],e.prototype,"activeSubButtons",null),i([o],e.prototype,"shouldShowSubButtons",null),i([o],e.prototype,"hasActiveParentWithChildren",null),i([o],e.prototype,"areAllSelected",null),i([o],e.prototype,"activeChildrenCount",null),i([o],e.prototype,"totalChildrenCount",null),i([o],e.prototype,"poiTypeCounts",null),i([o],e.prototype,"totalPoiTypeCount",null),i([o],e.prototype,"activePoiTypeId",null),i([s],e.prototype,"handleSearchButtonClick",null),i([s],e.prototype,"handleExtendedSearchButtonClick",null),i([s],e.prototype,"handleMainButtonClick",null),i([s],e.prototype,"handleSessionsClick",null),i([s],e.prototype,"togglePoiType",null),i([s],e.prototype,"clearAllFilters",null),i([s],e.prototype,"showSubButtons",null),i([s],e.prototype,"hideSubButtons",null),i([s],e.prototype,"handleSubButtonClick",null),i([s],e.prototype,"toggleChildFilter",null),i([s],e.prototype,"clearPoiTypeFilters",null),i([s],e.prototype,"clearAllChildFilters",null),i([s],e.prototype,"setActiveParentId",null),i([s],e.prototype,"showShortcuts",null),i([s],e.prototype,"clearChildren",null),i([s],e.prototype,"setSubButtonId",null),i([s],e.prototype,"setPoiFilterId",null);
|
|
@@ -15,5 +15,18 @@ export declare function createRouteStore(overrides?: Record<string, unknown>): P
|
|
|
15
15
|
rootStore: Record<string, unknown>;
|
|
16
16
|
Route: typeof import("../store/RouteStore.js").Route;
|
|
17
17
|
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Constructs a `SearchButtonsStore` beside a real `RouteStore`,
|
|
20
|
+
* `RoutePlannerStore` and `URLFilterManager`; the rest of the store graph is faked.
|
|
21
|
+
*/
|
|
22
|
+
export declare function createSearchButtonsStore(overrides?: Record<string, unknown>): Promise<{
|
|
23
|
+
searchButtonsStore: import("../store/SearchButtonsStore.js").default;
|
|
24
|
+
routePlannerStore: import("../store/RoutePlannerStore.js").default;
|
|
25
|
+
routeStore: import("../store/RouteStore.js").default;
|
|
26
|
+
urlFilterManager: import("../services/URLFilterManager.js").URLFilterManager;
|
|
27
|
+
uiState: import("../store/UIState.js").default;
|
|
28
|
+
rootStore: Record<string, unknown>;
|
|
29
|
+
Route: typeof import("../store/RouteStore.js").Route;
|
|
30
|
+
}>;
|
|
18
31
|
export {};
|
|
19
32
|
//# sourceMappingURL=store-harness.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setConfig as
|
|
1
|
+
import{setConfig as d}from"@expofp/config";import{vi as t}from"vitest";let c={};async function S(r={}){w();const{default:e}=await import("../store/UIState.js"),n={fp:{},...r};return n.uiState=c=new e(n),n}export async function createUIState(r={}){return(await S(r)).uiState}export async function createRouteStore(r={}){const e=await S({fp:{},moveToList:t.fn(),showMap:t.fn(),layerStore:{layers:[],updateVisibility:t.fn(),findLayer:t.fn(()=>null)},...r}),{default:n,Route:o}=await import("../store/RouteStore.js"),a=new n(e);return e.routeStore=a,{routeStore:a,uiState:e.uiState,rootStore:e,Route:o}}export async function createSearchButtonsStore(r={}){const{routeStore:e,uiState:n,rootStore:o,Route:a}=await createRouteStore({fp:{hidePathways:t.fn(),getOptimizedRoutes:()=>[]},boothStore:{booths:[]},poiTypeStore:{poiTypes:[]},categoryFilterStore:{state:{selectedItems:[],pendingItems:[]},openFilter:t.fn()},searchStore:{selectSearchAndFocus:t.fn(),setFocused:t.fn()},...r}),{default:f}=await import("../store/RoutePlannerStore.js"),{URLFilterManager:l}=await import("../services/URLFilterManager.js"),{default:p}=await import("../store/search-buttons/SearchButtonsStore.js"),s=new f(o);o.routePlannerStore=s;const i=new p(o);o.searchButtonsStore=i;const u=new l(o);return o.urlFilterManager=u,{searchButtonsStore:i,routePlannerStore:s,routeStore:e,urlFilterManager:u,uiState:n,rootStore:o,Route:a}}function w(){window.__efpEvent="demo",HTMLCanvasElement.prototype.getContext=(()=>new Proxy({},{get:()=>()=>{}})),t.doMock("../store/index.js",()=>({get uiState(){return c}})),t.doMock("../data/svg.js",()=>({svgArea:()=>null,svgAreaExplicit:()=>null})),t.doMock("../tools/gtag.js",()=>({hasUserConsent:()=>!1,sendEventToGa:t.fn(),GaEventActions:{}})),d({fpSvgJsRef:{},fpSvgLayerJsRefs:{}})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const DIM_INTENSITY=.5,VENUE_DIM_INTENSITY=1,DIM_TRANSITION_MS=300,DEFAULT_DIM_EASING="cubic";export function applyVenueDim(e,r){return!e||e.rootLayer.dim===r?!1:(e.rootLayer.dim=r,!0)}export function createDimmingAnimator(e,r=300,I=DEFAULT_DIM_EASING){let n=null,t=0,m=0,a=0,s=0;const l=Math.max(r,0);function c(){n===null||typeof cancelAnimationFrame!="function"||(cancelAnimationFrame(n),n=null)}function p(i){c(),t=i,e(t)}function f(i){const u=i-s,o=Math.min(u/l,1),T
|
|
1
|
+
export const DIM_INTENSITY=.5,VENUE_DIM_INTENSITY=1,DIM_TRANSITION_MS=300,DEFAULT_DIM_EASING="cubic";export function applyVenueDim(e,r){return!e||e.rootLayer.dim===r?!1:(e.rootLayer.dim=r,!0)}export function createDimmingAnimator(e,r=300,I=DEFAULT_DIM_EASING){let n=null,t=0,m=0,a=0,s=0;const l=Math.max(r,0);function c(){n===null||typeof cancelAnimationFrame!="function"||(cancelAnimationFrame(n),n=null)}function p(i){c(),t=i,e(t)}function f(i){const u=i-s,o=Math.min(Math.max(u/l,0),1),M=T(o,I);if(t=m+(a-m)*M,e(t),o<1){n=requestAnimationFrame(f);return}n=null,t=a,e(t)}return{getValue(){return t},setTarget(i,u={}){const o=i?1:0;if(!(!u.immediate&&o===a&&n===null)){if(a=o,u.immediate||l===0||typeof requestAnimationFrame!="function"){p(a);return}c(),m=t,s=typeof performance>"u"?Date.now():performance.now(),n=requestAnimationFrame(f)}},stop(){c()}}}function T(e,r){return r==="linear"?e:A(e)}function A(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createArrowCurrentCanvas as w,createCurrentCanvas as u,createImageCanvas as
|
|
1
|
+
import{circleCanvasCssSize as l,createArrowCurrentCanvas as v,createCircleCanvas as w,createCurrentCanvas as u,createImageCanvas as h,createTargetCanvas as A,cssSizeOf as T}from"../../components/Map/drawing/config/canvases";const R="#00A2FF",F="#FF9F06",r=34,d=4,p=56;function a(s,n,t,i,C,e){const c=s.get(n);return c?(c.id=n,h(c,t,i,C)):e()}function o(s,n=T(s)){return{canvas:s,width:n.width,height:n.height}}export function createCanvasIconProvider(s){const{iconMap:n,pixelRatio:t}=s,i=s.sourceColor??R,C=s.destinationColor??F,e=new Map;e.set("destination",o(a(n,"destination",r,r,t,()=>A(t,C)))),e.set("source",o(a(n,"departure",r,r,t,()=>u(t,i)))),e.set("source_inactive",o(a(n,"departure_inactive",r,r,t,()=>u(t,i))));const c=u(t,i);c.id="current-location",e.set("current",o(c));const _=a(n,"transition",r,r,t,()=>u(t,i));return e.set("transition",o(_)),e.set("transition_up",o(a(n,"transition_up",p,r,t,()=>_))),e.set("transition_down",o(a(n,"transition_down",p,r,t,()=>_))),e.set("transition_entry",o(a(n,"departure",r,r,t,()=>u(t,i)))),e.set("current_arrow",o(a(n,"direction",r,r,t,()=>v(t,i)))),e.set("trail",o(w(d,"#b5b7bc"),{width:l(d),height:l(d)})),{getIcon(I){const O=e.get(I);if(!O)throw new Error(`Unknown icon: ${I}`);return O}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{degToRad as
|
|
1
|
+
import{degToRad as f}from"@expofp/geometry";import{cssSizeOf as p}from"../../components/Map/drawing/config/canvases";import{createKioskCanvas as S}from"../adapters";const s="kiosk",m=0;export function createKioskHandler({wayfinding:t,kioskIconMap:u}){const n=new Map,l=e=>{const c=e??100,o=n.get(c);if(o)return o;const r=S(u,e);return n.set(c,r),r};return(e,c,o)=>{if(!e){t.setIcon(s,null),t.flush();return}if(o!==m&&e.z&&c&&e.z!==c){t.setIcon(s,null),t.flush();return}const a=l(e.iconSizePercent);t.setIcon(s,{canvas:a,...p(a),x:e.x,y:e.y,rotation:f(e.heading??0),screenSpace:!1}),t.flush()}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createImageCanvas as l,createYahCanvas as u}from"../../components/Map/drawing/config/canvases";import{decreaseByPercentage as o}from"../../utils/math";const
|
|
1
|
+
import{createImageCanvas as l,createYahCanvas as u,cssSizeOf as A}from"../../components/Map/drawing/config/canvases";import{decreaseByPercentage as o}from"../../utils/math";const c="yah",C="#ff4343",E=64,H=90,_=32;function Y(e,a){const r=e.get(c);return r?(r.id=c,l(r,o(E,_),o(H,_),a)):u(a,C)}export function createYahHandler({wayfinding:e,iconMap:a,pixelRatio:r,floorContext:I}){const n=Y(a,r);return n.id="current-location-2",t=>{if(!t){e.setIcon(c,null),e.flush();return}const s=I.isLayerVisible(t.layer);e.setIcon(c,{canvas:n,...A(n),x:t.x,y:t.y,hidden:!s,dimmed:!s,origin:[.5,1]}),e.flush()}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expofp/floorplan",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.45.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/expofp/efp-app.git",
|
|
@@ -69,15 +69,15 @@
|
|
|
69
69
|
"tslib": "^2.3.0",
|
|
70
70
|
"uuid": "^9.0.1",
|
|
71
71
|
"zod": "4.4.3",
|
|
72
|
-
"@expofp/config": "3.
|
|
73
|
-
"@expofp/debug": "3.
|
|
74
|
-
"@expofp/geometry": "3.
|
|
75
|
-
"@expofp/renderer": "3.
|
|
76
|
-
"@expofp/resolve": "3.
|
|
77
|
-
"@expofp/
|
|
78
|
-
"@expofp/
|
|
79
|
-
"@expofp/
|
|
80
|
-
"@expofp/
|
|
72
|
+
"@expofp/config": "3.45.0",
|
|
73
|
+
"@expofp/debug": "3.45.0",
|
|
74
|
+
"@expofp/geometry": "3.45.0",
|
|
75
|
+
"@expofp/renderer": "3.45.0",
|
|
76
|
+
"@expofp/resolve": "3.45.0",
|
|
77
|
+
"@expofp/ui": "3.45.0",
|
|
78
|
+
"@expofp/utils": "3.45.0",
|
|
79
|
+
"@expofp/wayfinding": "3.45.0",
|
|
80
|
+
"@expofp/schema": "3.45.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@babel/plugin-proposal-decorators": "^8.0.2",
|