@expofp/floorplan 3.45.4 → 3.45.6
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-CftScIdx.js → Button-DT-Jfwrb.js} +5 -5
- package/dist/browser/{CookieConsent-ByS7cPh9.js → CookieConsent-D6nxm_ph.js} +7 -7
- package/dist/browser/{Debug-CDb2j0OF.js → Debug-DC9ghW5V.js} +7 -7
- package/dist/browser/{DebugTools-jdOEpl8C.js → DebugTools-Y0aycjKM.js} +6 -6
- package/dist/browser/{Demo-CTLfudbP.js → Demo-CgC4OvVd.js} +9 -9
- package/dist/browser/{Free-C5QMNYRI.js → Free-BdhGlQwB.js} +10 -10
- package/dist/browser/{GalleryContainer-BUhs_oBk.js → GalleryContainer-Do8X13Mq.js} +11 -11
- package/dist/browser/{GpsLoader-BSWIXvfs.js → GpsLoader-CBEyj1G4.js} +13 -13
- package/dist/browser/{KioskStore-BC-gl1wE.js → KioskStore-DhtR-5Hr.js} +9 -9
- package/dist/browser/{LayerStore-CONC-3Gj.js → LayerStore-CWxa5hfz.js} +761 -744
- package/dist/browser/{MaplibreAdapter-BXKE5rxG.js → MaplibreAdapter-C5lXCMGf.js} +17 -17
- package/dist/browser/{ModalContainer-BpM9aPfz.js → ModalContainer-DiM4OG67.js} +10 -10
- package/dist/browser/{PermissionNotice-BM5kQYe7.js → PermissionNotice-DaqnuHln.js} +6 -6
- package/dist/browser/{RouteStore-C7okfu9_.js → RouteStore-DHDpmHzr.js} +9 -9
- package/dist/browser/{SetKioskMode-DabqQvMH.js → SetKioskMode-D_5Us9Gn.js} +11 -11
- package/dist/browser/{ShowKiosk-DvOBEV0v.js → ShowKiosk-Ca6BaYA4.js} +10 -10
- package/dist/browser/{UIState-Ce9F8YFe.js → UIState-ClHYIJ2L.js} +12 -12
- package/dist/browser/{ViewerMenuPanel-FsMuHE9m.js → ViewerMenuPanel-BWrEOvZt.js} +10 -10
- package/dist/browser/{add-debug-secret-listener-DEPSZS-A.js → add-debug-secret-listener-BECnIMzo.js} +1 -1
- package/dist/browser/{adopt-global-settings-ptJCSHgd.js → adopt-global-settings-U-KbyxMd.js} +9 -9
- package/dist/browser/{boolean-editor-C_RdXFiI.js → boolean-editor-CYMx87em.js} +9 -9
- package/dist/browser/{bootIntercom-CnpSeS09.js → bootIntercom-O5O0bdiC.js} +2 -2
- package/dist/browser/bundle.json +85 -85
- package/dist/browser/{camera-events-BYUTGOGy.js → camera-events-DSCuSH25.js} +1 -1
- package/dist/browser/{classnames-I5odALD0.js → classnames-YcGXWNfg.js} +2 -2
- package/dist/browser/{client-TnBerOtS.js → client-BcPpS_Gj.js} +5 -5
- package/dist/browser/{components-CEGOfvRn.js → components-DyXkVj-h.js} +48 -48
- package/dist/browser/{create-live-plan-msjLUPAb.js → create-live-plan-DEVM8pOp.js} +13 -13
- package/dist/browser/{debug-context-8s7JYsHP.js → debug-context-CNBgUWR8.js} +5 -5
- package/dist/browser/{debug-overlay-BEEAevvE.js → debug-overlay-B__pFwQg.js} +10 -10
- package/dist/browser/{debug-ui-BWDU1_DK.js → debug-ui-BaE8MZQX.js} +6 -6
- package/dist/browser/{dist-B7taugxI.js → dist-C1NaWqk4.js} +5 -5
- package/dist/browser/{dist-BL9v1eQu.js → dist-Cx8u0gjK.js} +3 -3
- package/dist/browser/{dist-Dg8H-fF9.js → dist-wOC6gYFh.js} +6 -6
- package/dist/browser/{efp-debug-init-3uYSkVQl.js → efp-debug-init-CozbueIl.js} +3 -3
- package/dist/browser/{enum-editor-DiE-Q-gC.js → enum-editor-CkiQPgZv.js} +4 -4
- package/dist/browser/{es5-D2KUWXXM.js → es5-B__Ovz45.js} +2 -2
- package/dist/browser/{event-head-DXLhGPVQ.js → event-head-C_inMpbD.js} +1 -1
- package/dist/browser/{event-not-found-ClTL2wLx.js → event-not-found-Z2mJBZE3.js} +3 -3
- package/dist/browser/{event-scoped-cache-CcA_qeS6.js → event-scoped-cache-aJgjSj-3.js} +2 -2
- package/dist/browser/{expofpUrl-BTeumhPB.js → expofpUrl-jBUlvkwz.js} +1 -1
- package/dist/browser/{exports-BezdpCeZ.js → exports-CvUYw1h6.js} +1 -1
- package/dist/browser/{favicon-eEoLTD6j.js → favicon-BkDrYTmU.js} +1 -1
- package/dist/browser/{fetch-retry.umd-o-6hecKO.js → fetch-retry.umd-2B2pCUIS.js} +2 -2
- package/dist/browser/{flex-DC-YFhOp.js → flex-3lSivw8z.js} +5 -5
- package/dist/browser/{floorplan.loader-BMR6104c.js → floorplan.loader-CDl2dZZx.js} +12 -12
- package/dist/browser/{floorplan.ready-DxP00yOP.js → floorplan.ready-C_1nb6xR.js} +23 -23
- package/dist/browser/{framing-rect-B28m3lJd.js → framing-rect-3gPjaM3T.js} +235 -227
- package/dist/browser/{freeBanner-CxeeG1v1.js → freeBanner-CnrBc9Tl.js} +2 -2
- package/dist/browser/{fuse-CM3BvYBC.js → fuse-B7V1lkoA.js} +2 -2
- package/dist/browser/{i18n-CyzfIlqQ.js → i18n-2_QFqpgv.js} +6 -6
- package/dist/browser/index.js +17 -17
- package/dist/browser/{index.module-D9cgjYhA.js → index.module-L0xt0u3p.js} +4 -4
- package/dist/browser/{init-ui-7k8cHFZw.js → init-ui-DbSF-9yC.js} +9 -9
- package/dist/browser/{integrateKiosk-DUFIUi05.js → integrateKiosk-D0FDyLHF.js} +5 -5
- package/dist/browser/{is-debug-BAIQHfxq.js → is-debug-DDKN4CIF.js} +4 -4
- package/dist/browser/{is-own-domain-C_JX2ZHR.js → is-own-domain-DNvxb9Ph.js} +1 -1
- package/dist/browser/{is-webview-BU0Pek8w.js → is-webview-cTH4yz8f.js} +1 -1
- package/dist/browser/{jsx-runtime-CtimPtPq.js → jsx-runtime-DQgnuS-I.js} +2 -2
- package/dist/browser/{kiosk-mode-CV-M1Zz8.js → kiosk-mode-Bdb_6yEJ.js} +3 -3
- package/dist/browser/{kiosk-record-Du4IFKBR.js → kiosk-record-JAEq8SV6.js} +1 -1
- package/dist/browser/{kioskApi-BVRzmuDX.js → kioskApi-1dS8REP7.js} +7 -7
- package/dist/browser/{lib-n3_ONTp3.js → lib--J2yQXt6.js} +3 -3
- package/dist/browser/{loadImage-DqAC23xl.js → loadImage-BJzAyAlv.js} +1 -1
- package/dist/browser/{logDeviceInfo-B47wOFn-.js → logDeviceInfo-BaJPElii.js} +9 -9
- package/dist/browser/{mobx-BxS2198S.js → mobx-vWymcZuV.js} +4 -4
- package/dist/browser/{mobx.module-DBXspHzN.js → mobx.module-BOCLFB5I.js} +1 -1
- package/dist/browser/{optional-boolean-editor-DusM7rb0.js → optional-boolean-editor-ZncW2HBw.js} +3 -3
- package/dist/browser/{optional-enum-editor-BKyAfZ8e.js → optional-enum-editor-Dkzs9jDN.js} +4 -4
- package/dist/browser/{optional-string-editor-sA0aHiGB.js → optional-string-editor-DC9PMUWB.js} +4 -4
- package/dist/browser/{particles.min-B7kv19nN.js → particles.min-eC5xdOrB.js} +2 -2
- package/dist/browser/{react-Cohf8rUU.js → react-DqPP-mkq.js} +2 -2
- package/dist/browser/{react-dom-tyj4-_-C.js → react-dom-BkVzoZWO.js} +3 -3
- package/dist/browser/{rolldown-runtime-Bcr_gA0_.js → rolldown-runtime-DUb2xvRc.js} +1 -1
- package/dist/browser/{scene-BBPTWEUE.js → scene-BaiC3jfV.js} +3 -3
- package/dist/browser/{scheduler-CrY9mG_c.js → scheduler-NBuuaWIe.js} +2 -2
- package/dist/browser/{select-D19r5W1a.js → select-Cxf-YiNA.js} +10 -10
- package/dist/browser/{settings-D4-jxTxB.js → settings-D74eG9h8.js} +2 -2
- package/dist/browser/{settings-item-CIt7SQG4.js → settings-item-DUUbKec_.js} +6 -6
- package/dist/browser/{store-CjCKsoXy.js → store-nyclu8mO.js} +2 -2
- package/dist/browser/{string-editor-D8F1eTpQ.js → string-editor-CINOmY_C.js} +4 -4
- package/dist/browser/{text-field-BYYweuSY.js → text-field-DORaOVht.js} +5 -5
- package/dist/browser/{theme-q6cCoTLz.js → theme-DyFm9MGz.js} +8 -8
- package/dist/browser/{ui-CYUl2cf1.js → ui-DsCU3FV6.js} +8 -8
- package/dist/browser/{useRenderTarget-Bqdt8QZX.js → useRenderTarget-D8DmceME.js} +4 -4
- package/dist/browser/{viewport-D4MnXYrN.js → viewport-DbRvshkB.js} +3 -3
- package/dist/browser/{wayfinding-CulSEPiv.js → wayfinding-DBvGTAdW.js} +414 -395
- package/dist/esm/components/Map/drawing/config/config-load-layer.js +1 -1
- package/dist/esm/components/Map/traffic/useManageTraffic.js +1 -1
- package/dist/esm/utils/loadLayerImages.d.ts +6 -11
- package/dist/esm/utils/loadLayerImages.js +1 -1
- package/dist/esm/wayfinding/bindMobxReactions.js +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getConfig as
|
|
1
|
+
import{getConfig as R}from"@expofp/config";import{resolve as N}from"@expofp/resolve";import{BOOTHS_PAINTER_MARKER as _,SEPARATOR as s}from"../../../../constants";import{getFpPaths as M}from"../../../../data/fp-payloads";import{createImageDef as w,createLayerDef as h}from"../../../../engine/defs";import m,{boothStore as O,uiState as C}from"../../../../store";import v from"../../../../store/init/init-booths";import{getChildLayers as D}from"../../../../store/init/init-layers";import{LayersMode as T}from"../../../../store/LayerStore";import{chunkArray as F}from"../../../../utils";import{loadLayerImages as G}from"../../../../utils/loadLayerImages";import H,{BG_LAYER_NAME as y,FG_LAYER_NAME as b}from"./config-bg";import k,{BOOTHS_CHUNK_SIZE as x}from"./config-booths";import{configOutdoorPoiLayer as K}from"./config-outdoor-poi";import{registerLayerImages as Y}from"./layer-images";import{createModelDefFromElement as J}from"./layer-models";import{getImageLayerName as U,getLayerGraphics as Z,getModelLayerName as j}from"./loadBoothsImages";function q(e){return e.childLayers.length?e.childLayers:D(e,e.basePriority,15).layers}async function $(e,i){const r=[],n=v(m,e);if(K(e,n))return e.loaded=!0,e.configured=!0,e.children=[],h(e.name,[],{hidden:!0});const a=await H(e),c=[],E=F(n,x),d=O.booths.filter(o=>o.rect&&(!o.layer||o.layer===e||o.layer.childLayers.includes(e))&&o.exhibitors.find(t=>!!t.logoInBooth&&!!t.logo?.url)&&!C.hideLogoInBooth),S=new Map(d.map(o=>[o,o.noLabels]));d.forEach(o=>o.noLabels=!0),n.length&&E.forEach((o,t)=>{c.push(k(`${e.name}${s}${_}${s}${t}`,o))});for(const[o,t]of S)o.noLabels=t;e.loaded=!0;const l=a.children.find(o=>o.name===y),u=a.children.find(o=>o.name===b),g=U(e.name),{icons:f,models:A}=Z(e),p={name:g,children:[]},L={name:j(e.name),children:A.map(J)};f.length&&Y(g,async()=>{const o=await G(f),t=[];for(const{bounds:I,source:P}of o)t.push(w(P,I));return{layer:p,children:t}}),l&&r.push({...l,name:`${a.name}${s}${y}`}),c.length&&r.push(...c),u&&r.push({...u,name:`${a.name}${s}${b}`}),f.length&&r.push(p),L.children.length&&r.push(L);const B=await Promise.all(e.childLayers.sort((o,t)=>o.basePriority-t.basePriority).map(o=>$(o,!0)));return r.push(...B),e.children=r,e.configured=!0,h(e.name,r,{hidden:!i})}export default async function z(e){if(e.configured)return h(e.name,e.children,{hidden:!e.visible});if(m.layerStore.mode!==T.Default&&!M(e.name)&&!e.rootParent)try{const n=R().fpSvgLayerJsRefs[e.name];n&&await N(n)}catch(n){console.warn(`Layer data not loaded: ${e.name}`,n)}const i=q(e);i.length&&(e.childLayers=i);const{layers:r}=m.layerStore;return m.layerStore.layers=[...r,...i.filter(n=>!r.some(a=>a.name===n.name))],$(e,e.visible)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{lineAngle as fe,pointDistance as he,Rect as be}from"@expofp/geometry";import{update as z}from"@expofp/renderer";import{useEffect as Ce,useRef as S}from"react";import _e from"../../../tools/base-runtime-url";import{loadImage as ve}from"../../../utils/loadImage";import{mapCamera as Pe}from"../camera";import{createCanvas as ge,createImageCanvas as Fe,getBounds as B,imageCanvasCssSize as Ne}from"../drawing/config/canvases";import{getRouteLayerRegex as De,getRouteStopLayerRegex as Oe,TRAFFIC_VEHICLES as ce}from"./trafficLayers";import{UpdateQueue as He}from"./UpdateQueue";const se=2,Ve=se*3.5,J=se*12,K=J*.7,ze=8,ie=2,me=.6,pe=8,We="transport_locations",ke=150,Ge="#a4aab6",we=1e3,Ue=2e4,Ie=500;export function useManageTraffic({permission:e,scene:t,dataJsonUrl:n,websocketUrl:a}){const o=S(1),r=S(new Map),c=S(new Map),s=S(null),f=S(null),d=S(0),w=S(1),b=S(new He),R=S(new Map),E=S(we),m=S(new Map),x=S(void 0);Ce(()=>{if(!e||!t)return;let u=!1,v;const T=t.rootLayer.children,p=c.current,I=r.current,y=b.current;async function Re(){try{let l;try{const i=await fetch(n,{method:"GET",headers:{"Content-Type":"application/json"}});if(!i.ok||i.status===204)return;l=await i.json()}catch(i){console.warn("useManageTraffic failed to get JSON",i)}if(u||!l||l.disabled||l.error)return;o.current=Ee(Pe()?.state().pixelSize??1);const W=new Map(l.routes.map(({id:i,color:h})=>[i,h])),C=new Map;W.forEach(i=>{C.set(i,je({radius:Ve,color:i,scale:window.devicePixelRatio}))});const U=De(),Y=T.filter(i=>U.test(i.name)),X=Oe(),$=T.filter(i=>X.test(i.name));l.routes.slice(0,Y.length).forEach(({id:i,color:h,path:g,stops:O,hiddenPoints:L},k)=>{R.current.set(i,g);const M=Y[k];if(M){const H=new Map(L?.map(F=>[le(F),F])??[]);for(let F=1;F<g.length;F++){const A=g[F-1],V=g[F];H.has(le(A))||H.has(le(V))||M.children.push({points:{p0:A,p1:V},color:h,width:se})}M.children.length&&y.add(()=>z(M))}const _=$[k],P=C.get(h);_&&P&&O?.length&&(O.forEach(H=>{_.children.push({source:P,bounds:B(H.x,H.y,...Q(P),o.current)})}),_.children.length&&y.add(()=>z(_)))});const D=T.find(i=>i.name===ce);if(!D){console.warn(`useManageTraffic: the scene has no "${ce}" layer`);return}const j=new Map;D.onScale=({pixelSize:i})=>{o.current=Ee(i);const h=[];for(const g of $){const O=g.children;for(const L of O){const k=L.source;L.bounds=B(L.bounds.center.x,L.bounds.center.y,...Q(k),o.current,L.bounds.rotation),h.push(L)}}for(const g of r.current.values()){const O=g.source;g.bounds=B(g.bounds.center.x,g.bounds.center.y,...Q(O),o.current,g.bounds.rotation),h.push(g)}return h},y.add(()=>z(D)),W.forEach((i,h)=>{j.set(h,xe({id:h,width:J,height:J,color:i,scale:window.devicePixelRatio}))});const Le=xe({id:"orphan",width:J,height:J,color:Ge,scale:window.devicePixelRatio});let q=null;try{const i=await ve(`${_e}icons/bus-white.svg`);if(u)return;q=Fe(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!==We)return;const g=i.timeStamp||performance.now();w.current=Math.round(g-d.current),d.current=g;const O=Math.max(w.current??Ie,Ie),L=D.children;let k=!1;h.data.forEach(({id:M,x:_,y:P,route_id:H,hidden:F})=>{p.has(M)&&(p.get(M)?.(),p.delete(M));const A=I.get(M),V=I.get(ue(M))??null;if(F&&A&&V){A.hidden=!0,V.hidden=!0,y.add(()=>z(A,V));return}if(m.current.set(M,performance.now()),!A){const G=j.get(H)??Le,N={source:G,bounds:B(_,P,...Q(G),o.current,0)};if(I.set(M,N),q){const Z=ue(M),re={source:q,bounds:B(_,P,...Q(q),o.current,0)};qe(re),q.setAttribute("id",Z),I.set(Z,re),L.push(N,re)}else L.push(N);k=!0;return}const Ae=A.bounds.center,oe=Qe(Ae,{x:_,y:P},R.current.get(H));if(oe.reduce((G,N,Z)=>Z===0?G:G+ae(oe[Z-1],N),0)>=ke||document.hidden)Me({updateQueue:y,vehicle:A,vehicleFinery:V,x:_,y:P,scale:o.current,angle:$e(A.bounds.center,{x:_,y:P})});else{const G=Xe(oe,O,N=>{Me({updateQueue:y,vehicle:A,vehicleFinery:V,x:N.x,y:N.y,scale:o.current,angle:N.angle})});p.set(M,G)}}),k&&y.add(()=>z(D))}catch(h){console.error("handleSocketMessage",h)}},d.current=performance.now(),te(),window.addEventListener("online",de),Te(l.config?(Number(l.config.vehicle_inactive_interval)||20)*1e3:Ue)}catch(l){console.warn(l)}}Re();function te(){u||s.current?.readyState===WebSocket.OPEN||s.current?.readyState===WebSocket.CONNECTING||(s.current=new WebSocket(a),s.current.onmessage=f.current,s.current.onopen=()=>{E.current=we},s.current.onclose=()=>{if(u||!navigator.onLine)return;v=window.setTimeout(te,E.current);const l=3e4;E.current=Math.min(E.current*2,l)})}function de(){te()}function Te(l){clearInterval(x.current),!u&&(x.current=window.setInterval(()=>{const W=performance.now(),C=[],U=[];m.current.forEach((Y,X)=>{if(W-Y<l)return;const $=I.get(X);$&&($.hidden=!0,U.push($),C.push(X));const D=ue(X),j=I.get(D);j&&(j.hidden=!0,U.push(j),C.push(D))}),U.length&&y.add(()=>z(...U)),C.forEach(Y=>m.current.delete(Y))},l))}return()=>{u=!0,clearTimeout(v);const l=s.current;l&&(l.onopen=null,l.onmessage=null,l.onclose=null,l.close(),s.current=null),f.current=null;const W=T.find(C=>C.name===ce);W&&(W.onScale=void 0),p.forEach(C=>C?.()),p.clear(),I.clear(),y.destroy(),window.removeEventListener("online",de),clearInterval(x.current)}},[e,t,n,a])}function Q(e){const t=ne.get(e);if(!t)throw new Error("useManageTraffic: an icon was drawn without a recorded CSS size");return t}function ye(e){return e*2}function Ye(e,t){const n=t*me,a=pe*2;return[t+ie+n/2+a,e+n+ie+a]}function Ee(e){return Math.min(e||1,ze)}function $e(e,t){return fe(e,t)}function je({radius:e,scale:t,color:n}){const a=Math.ceil(e*2*t),o=ge(a,a,t);ne.set(o,[ye(e),ye(e)]);const r=o.getContext("2d");r.imageSmoothingEnabled=!1;const c=a/2,s=e*.78,f=e*.33;return r.translate(c,c),r.scale(t,t),r.beginPath(),r.arc(0,0,e,0,2*Math.PI),r.fillStyle="#FFFFFF",r.fill(),r.beginPath(),r.arc(0,0,s,0,2*Math.PI),r.fillStyle=n,r.fill(),r.beginPath(),r.arc(0,0,f,0,2*Math.PI),r.fillStyle="#FFFFFF",r.fill(),o}function xe({id:e,width:t,height:n,color:a,scale:o}){const r=ie*o,c=t/2*o,s=n*o,f=me,d=.01,w=s*f,b=s,R=pe*o,E=b+r+w/2+R*2,m=c*2+w+r+R*2,x=ge(E,m,o);ne.set(x,Ye(t,n)),x.setAttribute("id",e);const u=x.getContext("2d"),v=E/2,T=m/2;u.save(),u.translate(v,T),u.rotate(-Math.PI/2),u.translate(-v,-T);const p=v,I=T-b/2+c,y=I+w;return u.shadowColor="rgba(16, 24, 40, 0.2)",u.shadowBlur=R/2,u.beginPath(),u.arc(p,I,c,Math.PI,0,!1),u.bezierCurveTo(p+c,I+s*.3,p+d*c,y,p,y),u.bezierCurveTo(p-d*c,y,p-c,I+s*.3,p-c,I),u.closePath(),u.fillStyle=a,u.fill(),u.strokeStyle="#FFFFFF",u.lineWidth=r,u.stroke(),u.restore(),x}function ae(e,t){return he(e,t)}function ue(e){return`${e}_finery`}function qe(e){e.onRoll=({roll:t})=>{const{bounds:n}=e;if(t!==n.rotation)return n.rotate(t-n.rotation,n),[e]}}function Me({updateQueue:e,vehicle:t,vehicleFinery:n,x:a,y:o,scale:r,angle:c}){const s=t.source;if(t.bounds=B(a,o,...Q(s),r,c),t.hidden=!1,n){const{size:f,rotation:d,elevation:w}=n.bounds;n.bounds=new be({x:a,y:o},f,d,w),n.hidden=!1,e.add(()=>z(n,t))}else e.add(()=>z(t))}function ee(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Se(e,t){let n=1/0,a={index:0,t:0};for(let o=0;o<t.length-1;o++){const r=t[o],c=t[o+1],s=c.x-r.x,f=c.y-r.y,d=s*s+f*f,w=d?((e.x-r.x)*s+(e.y-r.y)*f)/d:0,b=Math.max(0,Math.min(1,w)),R=ee(r,c,b),E=ae(e,R);E<n&&(n=E,a={index:o,t:b})}return a}function Be(e,t,n){const a=ae(e,t),o=Math.max(2,Math.ceil(a/n)+1),r=[];for(let c=0;c<o;c++){const s=c/(o-1),f=ee(e,t,s);r.push(f)}return r}function Qe(e,t,n){if(!n||!n.length)return Be(e,t,10);const a=Se(e,n),o=Se(t,n),r=[],c=s=>r.push(s);a.index+1<n.length?c(ee(n[a.index],n[a.index+1],a.t)):c(n[a.index]);for(let s=a.index+1;s<=o.index&&s<n.length;s++)c(n[s]);return o.index+1<n.length?c(ee(n[o.index],n[o.index+1],o.t)):c(n[o.index]),r}function Xe(e,t,n,a){if(e.length<2)return()=>{};let o=null,r;const c=[];let s=0;for(let d=0;d<e.length-1;d++){const w=he(e[d],e[d+1]);c.push(w),s+=w}const f=d=>{o||(o=d);const w=d-o,b=Math.min(w/t,1),R=b*s;let E=0,m=0;for(;m<c.length&&E+c[m]<R;)E+=c[m],m++;m>=c.length&&(m=c.length-1);const x=e[m],u=e[Math.min(m+1,e.length-1)],v=c[m]||0,T=v===0?0:(R-E)/v,p=x.x+(u.x-x.x)*T,I=x.y+(u.y-x.y)*T,y=fe(x,u);n({x:p,y:I,angle:y}),b<1?r=requestAnimationFrame(f):a&&a()};return r=requestAnimationFrame(f),()=>{r&&cancelAnimationFrame(r)}}function le(e){return`${e.x},${e.y}`}const ne=new WeakMap;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Rect } from '@expofp/geometry';
|
|
1
2
|
import { type Booth } from '../store/BoothStore';
|
|
2
3
|
/** One `<image>` from a layer's drawing: where it sits, and the pixels to draw there. */
|
|
3
4
|
export interface LayerImage {
|
|
@@ -14,21 +15,15 @@ export interface LayerImage {
|
|
|
14
15
|
* onto the main thread.
|
|
15
16
|
*/
|
|
16
17
|
source: Blob;
|
|
17
|
-
/** Placement
|
|
18
|
-
bounds:
|
|
19
|
-
x: number;
|
|
20
|
-
y: number;
|
|
21
|
-
width: number;
|
|
22
|
-
height: number;
|
|
23
|
-
angle: number;
|
|
24
|
-
};
|
|
18
|
+
/** Placement on the plan: the image fitted into the element's box, rotated as the element is. */
|
|
19
|
+
bounds: Rect;
|
|
25
20
|
}
|
|
26
21
|
/**
|
|
27
22
|
* Loads a layer's drawing images as bytes.
|
|
28
23
|
*
|
|
29
|
-
* The
|
|
30
|
-
*
|
|
31
|
-
* the
|
|
24
|
+
* The image is fitted into its element's box like SVG `xMidYMid meet`. The designer writes the
|
|
25
|
+
* file's pixel size into the href query as `w` and `h`. An href without a valid size is measured
|
|
26
|
+
* by decoding the image, and if that fails too, the image fills the box.
|
|
32
27
|
*
|
|
33
28
|
* Most of these hrefs are inline `data:image/webp;base64` URLs, not file references. The
|
|
34
29
|
* converter embeds designer graphics directly in the drawing payload. In a real plan, the first
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{loadBlob as
|
|
1
|
+
import{Box as u,degToRad as h,Rect as m}from"@expofp/geometry";import{blobImageSize as f}from"./blob-image-size.js";import{loadBlob as d}from"./loadBlob";import{isSvgBlob as g,svgToPngBlob as w}from"./rasterize-svg";export async function loadLayerImages(n){const t=new Map,e=r=>{let o=t.get(r);return o||(o=b(r),t.set(r,o)),o};return(await Promise.all(n.map(async r=>{const o=r.getAttribute("xlink:href")??r.getAttribute("href"),a=o?await e(o):null;if(!a)return null;const l=y(u.fromSvg(r),a.size),c=r.transform?.animVal[0]?.angle??0;return{bounds:m.fromMinMax(l.min,l.max,h(c)),source:a.source,booth:null}}))).filter(r=>r!==null)}async function b(n){const t=await d(n);if(!t)return null;const e=g(t)?await w(t):t;return e?{source:e,size:p(n)??await f(e)}:null}function p(n){let t;try{({searchParams:t}=new URL(n))}catch{return null}const e=Number(t.get("w")),i=Number(t.get("h"));return s(e)&&s(i)?{width:e,height:i}:null}function s(n){return Number.isFinite(n)&&n>0}function y(n,t){if(!t?.width||!t.height||!n.size.width||!n.size.height)return n;const e=Math.min(n.size.width/t.width,n.size.height/t.height);return u.fromCenter(n.center,{x:t.width*e,y:t.height*e})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{comparer as
|
|
1
|
+
import{comparer as x,reaction as c}from"mobx";import{boothToEndpoint as T,CURRENT_LOCATION_NAME as h,CURRENT_POSITION_POINT_ID as m,positionInput as b,toArbitraryPoint as A}from"./adapters";const C=s=>"rect"in s?T(s):s;export function bindMobxReactions({wayfinding:s,kioskHandler:F,yahHandler:R,stores:{routeStore:n,uiState:i,layerStore:l}}){const f=[];function a(){const o=i.selectedRoute,t=o?.from?C(o.from):null,e=o?.to?C(o.to):null;if(!t||!e){s.clearRoute();return}s.setRoute({from:t,to:e,waypoints:o?.waypoints?.map(T),accessible:n.onlyAccessible})===!1&&console.error(new Error(`Route not found: (${t.x},${t.y}) \u2192 (${e.x},${e.y})`))}function u(){const o=n.currentPosition,t=n.iconType!==0,e=i.selectedRoute,p=!!(e?.from&&e?.to),y=t&&!p;if(!o){s.setPosition(null),R(null);return}const d=b(o);y?(s.setPosition(null),R({x:d.x,y:d.y,layer:d.layer})):(R(null),s.setPosition(d))}function I(){const o=n.currentPosition,t=i.selectedRoute;if(!o||!t?.to)return;const e=!t.from,y=t.from?.id===m&&s.shouldReroute(b(o));!e&&!y||n.rebuildRouteFromPosition(A(o,h,m))}function P(){const o=l.floors.find(t=>t.active)?.name;F(i.kioskData??null,o,l.mode)}function N(){const o=i.selectedRoute,t=n.currentPosition;if(!o?.to||!t||o.from?.id!==m||n.routeLines.length>0)return;const e=t.z!=null?String(t.z):"";o.from.x===t.x&&o.from.y===t.y&&o.from.layer===e||n.rebuildRouteFromPosition(A(t,h,m))}f.push(c(()=>l.layersLoaded,()=>{a(),u()}),c(()=>[i.selectedRoute,n.onlyAccessible],()=>{a(),u()}),c(()=>{const o=n.currentPosition;return o?{x:o.x,y:o.y,z:o.z,angle:o.angle,iconType:n.iconType}:null},()=>{u()},{equals:x.structural}),c(()=>{const o=n.currentPosition;return o?{x:o.x,y:o.y,z:o.z}:null},()=>{I(),N()},{equals:x.structural}),c(()=>[i.kioskData,l.floors.find(o=>o.active)],()=>P()));let r=null;const z=c(()=>[n.currentRouteLayer,i.getRouteNextFloor],()=>{l.layersLoaded&&(r!==null&&clearTimeout(r),r=setTimeout(()=>{s.notifyFloorChanged(),u(),r=null},0))});return f.push(()=>{r!==null&&clearTimeout(r),z()}),a(),u(),P(),()=>{for(const o of f)o();f.length=0}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expofp/floorplan",
|
|
3
|
-
"version": "3.45.
|
|
3
|
+
"version": "3.45.6",
|
|
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.45.
|
|
73
|
-
"@expofp/debug": "3.45.
|
|
74
|
-
"@expofp/geometry": "3.45.
|
|
75
|
-
"@expofp/renderer": "3.45.
|
|
76
|
-
"@expofp/resolve": "3.45.
|
|
77
|
-
"@expofp/schema": "3.45.
|
|
78
|
-
"@expofp/ui": "3.45.
|
|
79
|
-
"@expofp/utils": "3.45.
|
|
80
|
-
"@expofp/wayfinding": "3.45.
|
|
72
|
+
"@expofp/config": "3.45.6",
|
|
73
|
+
"@expofp/debug": "3.45.6",
|
|
74
|
+
"@expofp/geometry": "3.45.6",
|
|
75
|
+
"@expofp/renderer": "3.45.6",
|
|
76
|
+
"@expofp/resolve": "3.45.6",
|
|
77
|
+
"@expofp/schema": "3.45.6",
|
|
78
|
+
"@expofp/ui": "3.45.6",
|
|
79
|
+
"@expofp/utils": "3.45.6",
|
|
80
|
+
"@expofp/wayfinding": "3.45.6"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@babel/plugin-proposal-decorators": "^8.0.2",
|