@expofp/floorplan 3.16.2 → 3.18.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.
Files changed (83) hide show
  1. package/dist/browser/{Button-DwsZR67A.js → Button-CR9X3hHB.js} +5 -5
  2. package/dist/browser/{CookieConsent-D_H_9z7A.js → CookieConsent-BWKzA_Db.js} +7 -7
  3. package/dist/browser/{Debug-iGytuV9s.js → Debug-CElPDJlB.js} +7 -7
  4. package/dist/browser/{Demo-D7DxBUzp.js → Demo-DpzdTNuZ.js} +9 -9
  5. package/dist/browser/{Free-ClXF-ylp.js → Free-Dzj0kezR.js} +9 -9
  6. package/dist/browser/{Gallery-C4QUbfC1.js → Gallery-BFh_yQY4.js} +9 -9
  7. package/dist/browser/{GpsLoader-UBlDzhKL.js → GpsLoader-PkypWxTl.js} +10 -10
  8. package/dist/browser/KioskStore-Cwuze3X_.js +288 -0
  9. package/dist/browser/{MaplibreAdapter-BVJ885aJ.js → MaplibreAdapter-CXm_wkcT.js} +2066 -2013
  10. package/dist/browser/{ModalContainer-DY2zOxMP.js → ModalContainer-qMMdrK2w.js} +10 -10
  11. package/dist/browser/{PermissionNotice-B0h3WhJ7.js → PermissionNotice-zHHL-Tb1.js} +6 -6
  12. package/dist/browser/{SetKioskMode-iWHPaTah.js → SetKioskMode-NJzx1LsZ.js} +8 -8
  13. package/dist/browser/{ShowKiosk-DknShSpP.js → ShowKiosk-JTxQ22h-.js} +12 -12
  14. package/dist/browser/{TouchHand-RKfeJsWo.js → TouchHand-B1_sEZ0y.js} +4 -4
  15. package/dist/browser/{ViewerMenuPanel-D8GlwCzS.js → ViewerMenuPanel-CStYkINl.js} +10 -10
  16. package/dist/browser/{add-debug-secret-listener-BXAxEbFi.js → add-debug-secret-listener-CLwgmFlw.js} +1 -1
  17. package/dist/browser/{adopt-global-settings-Br-3dQt9.js → adopt-global-settings-DNtTKtHp.js} +9 -9
  18. package/dist/browser/{boolean-editor-WHpxVGD2.js → boolean-editor-DU3YVPQz.js} +9 -9
  19. package/dist/browser/{bootIntercom-Dc84Um93.js → bootIntercom-C3p3aQE4.js} +2 -2
  20. package/dist/browser/{booth-by-xy-pwZD-Q9s.js → booth-by-xy-DSMmkHYp.js} +6 -6
  21. package/dist/browser/bundle.json +68 -65
  22. package/dist/browser/{classnames-ADmvTvsM.js → classnames-DsyabRET.js} +2 -2
  23. package/dist/browser/{client-DAKS0U8K.js → client-BtftV096.js} +4 -4
  24. package/dist/browser/{components-DH3gByAx.js → components-BWMM8EM8.js} +39 -39
  25. package/dist/browser/{debug-overlay-Be890ZO7.js → debug-overlay-D3Y5V71i.js} +10 -10
  26. package/dist/browser/{debug-ui-XYberMvC.js → debug-ui-DLVYgylj.js} +6 -6
  27. package/dist/browser/{dist-BSw8w9i7.js → dist-BXb1cx9e.js} +5 -5
  28. package/dist/browser/{dist-o6qsiE4U.js → dist-CfgFWfr7.js} +3 -3
  29. package/dist/browser/{dist-Bk3kAaWz.js → dist-DDo1tPsx.js} +6 -6
  30. package/dist/browser/{efp-debug-init-3TBJNj3N.js → efp-debug-init-C07vji2o.js} +3 -3
  31. package/dist/browser/{enum-editor-BsBjegIJ.js → enum-editor-CQB7Ql3U.js} +4 -4
  32. package/dist/browser/{es5-BD1Rwujz.js → es5-ijKSUeQ7.js} +2 -2
  33. package/dist/browser/{event-not-found-DAOwyi7_.js → event-not-found-BwyzoaLT.js} +1 -1
  34. package/dist/browser/{exports-DGRPWR71.js → exports-Ci3Y-h6M.js} +1 -1
  35. package/dist/browser/{favicon-CI2oWQiP.js → favicon-BGu3h_Jd.js} +1 -1
  36. package/dist/browser/{fetch-retry.umd-BqOpMJNK.js → fetch-retry.umd-DPsRRR-2.js} +2 -2
  37. package/dist/browser/{flex-B9MWsK8X.js → flex-pSz169Ur.js} +5 -5
  38. package/dist/browser/{floorplan.loader-D_9WY3Kh.js → floorplan.loader-C6QTWa65.js} +10 -10
  39. package/dist/browser/{floorplan.ready-PiYl6IWL.js → floorplan.ready-CAzapBXm.js} +15 -15
  40. package/dist/browser/{fuse-BPkdlShc.js → fuse-DtxL2N-V.js} +2 -2
  41. package/dist/browser/{i18n-FEmGn2JV.js → i18n-DVyODyCY.js} +13 -8
  42. package/dist/browser/index.js +14 -14
  43. package/dist/browser/{index.module-BguE-_Wj.js → index.module-Cvt_te8N.js} +4 -4
  44. package/dist/browser/integrateKiosk-d8rib-aX.js +33 -0
  45. package/dist/browser/{is-webview-9M2Yj5ei.js → is-webview-DdTBb7TJ.js} +1 -1
  46. package/dist/browser/{jsx-runtime-DYsjQsrw.js → jsx-runtime-DaJp0rHj.js} +2 -2
  47. package/dist/browser/kiosk-record-CKAUCVLy.js +18 -0
  48. package/dist/browser/{lib-ptH9cMvV.js → lib-DJccgJUD.js} +3 -3
  49. package/dist/browser/{loadImage-D1lj2pub.js → loadImage-x0VcWQVd.js} +4 -4
  50. package/dist/browser/{logDeviceInfo-1Jnenmv9.js → logDeviceInfo-D0W2-Idq.js} +9 -9
  51. package/dist/browser/{main-Ct8T2R4I.js → main-BPkzidEN.js} +1 -1
  52. package/dist/browser/{mobx-BrPGZtR2.js → mobx-BhywMatw.js} +4 -4
  53. package/dist/browser/{optional-boolean-editor-C0yStP2c.js → optional-boolean-editor-Mcny_JoC.js} +3 -3
  54. package/dist/browser/{optional-enum-editor-DCkotMQM.js → optional-enum-editor-DNJb-HlW.js} +4 -4
  55. package/dist/browser/{optional-string-editor-BXC0PQUH.js → optional-string-editor-mXHbu-td.js} +4 -4
  56. package/dist/browser/{particles.min-BIHTPiu9.js → particles.min-h8plthOJ.js} +2 -2
  57. package/dist/browser/{react-C753AZV-.js → react-BtNYeFCj.js} +2 -2
  58. package/dist/browser/{react-dom-89G1BmuL.js → react-dom-Cpzv99hV.js} +3 -3
  59. package/dist/browser/{rolldown-runtime-Bkcab2xj.js → rolldown-runtime-DISrh_Iz.js} +1 -1
  60. package/dist/browser/{select-CpxGNna0.js → select-CUP0HHGg.js} +10 -10
  61. package/dist/browser/{settings-item-B-Es_kkd.js → settings-item-EIedbjEy.js} +6 -6
  62. package/dist/browser/{settings-B0AiS7Uf.js → settings-vwUDDFWG.js} +2 -2
  63. package/dist/browser/{store-CZirnYJR.js → store-CuOAVnMk.js} +24 -15
  64. package/dist/browser/{string-editor-BKu088c1.js → string-editor-B5j-wOvD.js} +4 -4
  65. package/dist/browser/{text-field-BIlKf6rZ.js → text-field-C7hImOEM.js} +5 -5
  66. package/dist/browser/{theme-CPAlpTnK.js → theme--eOt90dH.js} +8 -8
  67. package/dist/browser/{ui-CiRWDlLP.js → ui-BbAFe1Un.js} +8 -8
  68. package/dist/browser/{useRenderTarget-D28tWpyh.js → useRenderTarget-tyvk_Tnj.js} +4 -4
  69. package/dist/esm/components/Kiosk/KioskStore.d.ts +9 -0
  70. package/dist/esm/components/Kiosk/KioskStore.js +1 -1
  71. package/dist/esm/components/Kiosk/SetKiosk/types.d.ts +18 -14
  72. package/dist/esm/components/Kiosk/integrateKiosk.d.ts +1 -1
  73. package/dist/esm/components/Kiosk/integrateKiosk.js +1 -1
  74. package/dist/esm/components/Kiosk/kiosk-record.d.ts +19 -0
  75. package/dist/esm/components/Kiosk/kiosk-record.js +1 -0
  76. package/dist/esm/components/Maplibre/MaplibreAdapter.js +1 -1
  77. package/dist/esm/components/Maplibre/useKioskIdleEvents.d.ts +18 -0
  78. package/dist/esm/components/Maplibre/useKioskIdleEvents.js +1 -0
  79. package/dist/esm/store/MaplibreStore.d.ts +47 -0
  80. package/dist/esm/store/MaplibreStore.js +1 -1
  81. package/package.json +8 -8
  82. package/dist/browser/KioskStore-CYbUyTYw.js +0 -241
  83. package/dist/browser/integrateKiosk-39QjxjrN.js +0 -28
@@ -1,18 +1,18 @@
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.16.2" };
4
+ e.SENTRY_RELEASE = { id: "3.18.0" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "f658045a-5be7-4ea4-a4b2-ddea9ab9caf3", e._sentryDebugIdIdentifier = "sentry-dbid-f658045a-5be7-4ea4-a4b2-ddea9ab9caf3");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-Bkcab2xj.js";
10
- import { t } from "./react-C753AZV-.js";
11
- import { t as n } from "./jsx-runtime-DYsjQsrw.js";
12
- import { t as r } from "./react-dom-89G1BmuL.js";
13
- import { C as i, E as a, O as o, T as s, _ as c, o as l, v as u, w as d } from "./flex-B9MWsK8X.js";
14
- import { c as f, i as p, n as m, o as h, r as g, s as _, t as v } from "./dist-Bk3kAaWz.js";
15
- import { t as y } from "./classnames-ADmvTvsM.js";
9
+ import { r as e } from "./rolldown-runtime-DISrh_Iz.js";
10
+ import { t } from "./react-BtNYeFCj.js";
11
+ import { t as n } from "./jsx-runtime-DaJp0rHj.js";
12
+ import { t as r } from "./react-dom-Cpzv99hV.js";
13
+ import { C as i, E as a, O as o, T as s, _ as c, o as l, v as u, w as d } from "./flex-pSz169Ur.js";
14
+ import { c as f, i as p, n as m, o as h, r as g, s as _, t as v } from "./dist-DDo1tPsx.js";
15
+ import { t as y } from "./classnames-DsyabRET.js";
16
16
  //#region ../../node_modules/.pnpm/@radix-ui+react-visually-hidden@1.2.3_@types+react-dom@19.2.3_@types+react@19.2.17__@ty_cffccd7838985066e8e1d993b5cb6017/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
17
17
  var b = /* @__PURE__ */ e(r(), 1), x = /* @__PURE__ */ e(t(), 1), S = n(), C = Object.freeze({
18
18
  position: "absolute",
@@ -1,17 +1,17 @@
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.16.2" };
4
+ e.SENTRY_RELEASE = { id: "3.18.0" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "3c34ab8b-5d65-4c06-8595-6ed371acabc5", e._sentryDebugIdIdentifier = "sentry-dbid-3c34ab8b-5d65-4c06-8595-6ed371acabc5");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-Bkcab2xj.js";
10
- import { a as t, i as n, s as r } from "./efp-debug-init-3TBJNj3N.js";
11
- import { a as i, i as a } from "./adopt-global-settings-Br-3dQt9.js";
12
- import { t as o } from "./jsx-runtime-DYsjQsrw.js";
13
- import "./settings-B0AiS7Uf.js";
14
- import { t as s } from "./add-debug-secret-listener-BXAxEbFi.js";
9
+ import { r as e } from "./rolldown-runtime-DISrh_Iz.js";
10
+ import { a as t, i as n, s as r } from "./efp-debug-init-C07vji2o.js";
11
+ import { a as i, i as a } from "./adopt-global-settings-DNtTKtHp.js";
12
+ import { t as o } from "./jsx-runtime-DaJp0rHj.js";
13
+ import "./settings-vwUDDFWG.js";
14
+ import { t as s } from "./add-debug-secret-listener-CLwgmFlw.js";
15
15
  //#region ../debug/src/lib/ui/render-debug-ui.tsx
16
16
  var c = /* @__PURE__ */ e(r(), 1), l = o(), u = !1;
17
17
  function d() {
@@ -26,7 +26,7 @@ function d() {
26
26
  }
27
27
  });
28
28
  let o = async (t) => {
29
- let { DebugUi: n } = await import("./debug-ui-XYberMvC.js"), { createRoot: i } = await import("./client-DAKS0U8K.js").then((t) => /* @__PURE__ */ e(t.default, 1)), a = document.createElement("div");
29
+ let { DebugUi: n } = await import("./debug-ui-DLVYgylj.js"), { createRoot: i } = await import("./client-BtftV096.js").then((t) => /* @__PURE__ */ e(t.default, 1)), a = document.createElement("div");
30
30
  document.body.appendChild(a), i(a).render(/* @__PURE__ */ (0, l.jsx)(n, {
31
31
  useDebugButtonState: r.useState,
32
32
  open: t
@@ -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.16.2" };
4
+ e.SENTRY_RELEASE = { id: "3.18.0" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "a7e05aea-745e-4a4b-ba82-432527d9c312", e._sentryDebugIdIdentifier = "sentry-dbid-a7e05aea-745e-4a4b-ba82-432527d9c312");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-Bkcab2xj.js";
10
- import { t } from "./react-C753AZV-.js";
11
- import { c as n } from "./store-CZirnYJR.js";
9
+ import { r as e } from "./rolldown-runtime-DISrh_Iz.js";
10
+ import { t } from "./react-BtNYeFCj.js";
11
+ import { c as n } from "./store-CuOAVnMk.js";
12
12
  //#region src/utils/getRenderTargetFromRoot.ts
13
13
  var r = /* @__PURE__ */ e(t(), 1);
14
14
  function i(e) {
@@ -15,6 +15,15 @@ declare class KioskStore {
15
15
  startCleanupMessages(): void;
16
16
  private isResettingCamera;
17
17
  resetCamera(): Promise<void>;
18
+ /**
19
+ * Restores the home framing in map mode. The kiosk is integrated at page load,
20
+ * well before the map has finished loading, so wait for the camera port rather
21
+ * than giving up on the first miss. Returns false when there was no map camera
22
+ * to restore through.
23
+ */
24
+ private resetMaplibreCamera;
25
+ private waitForMaplibreCameraPort;
26
+ private resetRendererCamera;
18
27
  restoreData(): void;
19
28
  handleSetupReady(): void;
20
29
  handleClose(): void;
@@ -1 +1 @@
1
- import{__decorate as i}from"tslib";import{action as r,computed as h,observable as m,toJS as u}from"mobx";import s from"../../store";import{areLayersEnabled as S}from"../../utils/areLayersEnabled";import{t as p}from"../../utils/i18n";import{isPointVisible as d}from"../Map/visibleArea";import{updateKiosk as g}from"./kioskApi";import{getSavedKiosk as f,removeKiosk as y,saveKiosk as C}from"./SetKiosk";class a{constructor(){this.savedKiosk=null,this.statusMessages=[],this.statusMessageTimer=0,this.isResettingCamera=!1}get kiosk(){return s.uiState.kioskData}setKiosk(e){s.uiState.setKioskData(e)}get renderer(){return s.rendererService.renderer}getCameraState(){const e=s.rendererService.getCameraState();return e?{mapInitialPtScale:this.initialPtScale,mapPtScale:e.ptScale,mapCenterX:e.center.x,mapCenterY:e.center.y,mapRollDegrees:e.roll,mapPitch:e.pitch}:{}}get hasUnsavedChanges(){const e=this.savedKiosk,t=u(this.kiosk);if(!t||!e)return!!t!=!!e;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!0;for(const l of n)if(!(l in t)||e[l]!==t[l])return!0;return!1}addStatusMessage(e){this.statusMessages=[{...e,id:Date.now()}],this.startCleanupMessages()}clearStatusMessages(){this.statusMessages=[]}startCleanupMessages(){clearTimeout(this.statusMessageTimer),this.statusMessageTimer=window.setTimeout(()=>this.clearStatusMessages(),1e3)}async resetCamera(){const e=this.renderer;if(!(!e||this.isResettingCamera)){this.isResettingCamera=!0;try{const{z:t,mapRollDegrees:n,mapInitialPtScale:o,mapPtScale:l,mapCenterX:c,mapCenterY:k}=this.kiosk||{};await e.controls.resetCamera({pan:!0,zoom:!0,roll:!0,pitch:!0},!0),t&&s.fp.activateFloor({name:t}),Number.isFinite(o)&&Number.isFinite(l)&&l>0&&await e.controls.zoomBy(o/l,!0),Number.isFinite(c)&&Number.isFinite(k)&&await e.controls.panTo(c,k,!0),Number.isFinite(n)&&await e.controls.rollTo(n,!0)}finally{this.isResettingCamera=!1}}}restoreData(){const e=f();e&&(this.setKiosk(e),this.savedKiosk=e,s.uiState.kiosk=!0)}handleSetupReady(){this.restoreData(),s.uiState.kiosk=!0,s.uiState.hideFreeOrDemo=!0,s.uiState.setForceDim(!0),s.searchStore.setSearchText(""),s.searchStore.setFocused(!1),this.resetCamera()}handleClose(){this.setKiosk(null),s.uiState.setForceDim(!1),s.uiState.enableSetKioskMode(!1),s.searchStore.closeSearch()}handleDelete(){y(),this.setKiosk(null),s.uiState.resetMapSettings(),s.uiState.resetUIScale(),this.addStatusMessage({variant:"success",title:p("Deleted")})}handleSave(){const e=this.renderer;if(!e)return;const t=u(this.kiosk),n=this.getCameraState(),o={...t,...n};if(!d(e,o)){this.addStatusMessage({variant:"error",title:p("Kiosk not visible")});return}this.setKiosk(o),C(o),g(o,"https://app.expofp.com/"),s.uiState.setUIScale(o.uiScale,!0),this.addStatusMessage({variant:"success",title:p("Saved")}),this.savedKiosk=o}delayChange(e){requestAnimationFrame(()=>e?.())}handleChange(e){const t=u(this.kiosk);t&&(Number.isFinite(e.angle)&&this.setKiosk({...t,heading:e.angle}),Number.isFinite(e.scale)&&(this.setKiosk({...t,uiScale:e.scale}),this.delayChange(()=>s.uiState.setUIScale(e.scale,!1))),Number.isFinite(e.percent)&&this.setKiosk({...t,iconSizePercent:e.percent}))}setInitialPtScale(e){if(this.initialPtScale)return;this.initialPtScale=e;const t=u(this.kiosk);t&&this.setKiosk({...t,mapInitialPtScale:e})}handleClick(e){const t=u(this.kiosk),n=s.fp.getFloors(),o=S()?n.find(c=>c.active)?.name??null:null,l=s.uiState.uiScale;this.setKiosk({...t,x:e.x,y:e.y,z:o,uiScale:t?.uiScale||l,heading:t?.heading||0,iconSizePercent:t?.iconSizePercent||100,...this.getCameraState()})}handleNavigationChange(){const e=u(this.kiosk);e&&this.setKiosk({...e,...this.getCameraState()})}}i([h({keepAlive:!0})],a.prototype,"kiosk",null),i([r],a.prototype,"setKiosk",null),i([h({keepAlive:!0})],a.prototype,"renderer",null),i([m],a.prototype,"savedKiosk",void 0),i([h({keepAlive:!0})],a.prototype,"hasUnsavedChanges",null),i([m],a.prototype,"statusMessages",void 0),i([r],a.prototype,"addStatusMessage",null),i([r],a.prototype,"clearStatusMessages",null),i([r],a.prototype,"startCleanupMessages",null),i([r],a.prototype,"resetCamera",null),i([r],a.prototype,"restoreData",null),i([r],a.prototype,"handleSetupReady",null),i([r],a.prototype,"handleClose",null),i([r],a.prototype,"handleDelete",null),i([r],a.prototype,"handleSave",null),i([r],a.prototype,"handleChange",null),i([r],a.prototype,"setInitialPtScale",null),i([r],a.prototype,"handleClick",null),i([r],a.prototype,"handleNavigationChange",null);export default new a;
1
+ import{__decorate as r}from"tslib";import{action as o,computed as m,observable as d,toJS as c,when as k}from"mobx";import a from"../../store";import{areLayersEnabled as S}from"../../utils/areLayersEnabled";import{t as h}from"../../utils/i18n";import{isPointVisible as g}from"../Map/visibleArea";import{getPtScaleZoomRatio as f,toFiniteNumber as u}from"./kiosk-record";import{updateKiosk as C}from"./kioskApi";import{getSavedKiosk as y,removeKiosk as M,saveKiosk as K}from"./SetKiosk";const v=2e4;class s{constructor(){this.savedKiosk=null,this.statusMessages=[],this.statusMessageTimer=0,this.isResettingCamera=!1}get kiosk(){return a.uiState.kioskData}setKiosk(e){a.uiState.setKioskData(e)}get renderer(){return a.rendererService.renderer}getCameraState(){if(a.maplibreStore.showMaplibre){const t=a.maplibreStore.cameraPort?.getCameraState();return t?{mapCenterLng:t.lng,mapCenterLat:t.lat,mapZoom:t.zoom,mapBearingDegrees:t.bearing,mapPitchDegrees:t.pitch}:{}}const e=a.rendererService.getCameraState();return e?{mapInitialPtScale:this.initialPtScale,mapPtScale:e.ptScale,mapCenterX:e.center.x,mapCenterY:e.center.y,mapRollDegrees:e.roll,mapPitch:e.pitch}:{}}get hasUnsavedChanges(){const e=this.savedKiosk,t=c(this.kiosk);if(!t||!e)return!!t!=!!e;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!0;for(const l of n)if(!(l in t)||e[l]!==t[l])return!0;return!1}addStatusMessage(e){this.statusMessages=[{...e,id:Date.now()}],this.startCleanupMessages()}clearStatusMessages(){this.statusMessages=[]}startCleanupMessages(){clearTimeout(this.statusMessageTimer),this.statusMessageTimer=window.setTimeout(()=>this.clearStatusMessages(),1e3)}async resetCamera(){if(!this.isResettingCamera){this.isResettingCamera=!0;try{if(a.maplibreStore.showMaplibre&&await this.resetMaplibreCamera())return;await this.resetRendererCamera()}finally{this.isResettingCamera=!1}}}async resetMaplibreCamera(){const e=await this.waitForMaplibreCameraPort();if(!e)return!1;const t=this.kiosk;t?.z!=null&&a.fp.activateFloor({name:String(t.z)});const n=u(t?.mapCenterLng),i=u(t?.mapCenterLat),l=u(t?.mapZoom);return n===void 0||i===void 0||l===void 0?(e.resetPitch(),a.uiState.fitBounds(),!0):(e.applyCameraState({lng:n,lat:i,zoom:l,bearing:u(t?.mapBearingDegrees),pitch:u(t?.mapPitchDegrees)}),!0)}async waitForMaplibreCameraPort(){const{maplibreStore:e}=a;if(e.cameraPort)return e.cameraPort;try{await k(()=>!!e.cameraPort||!e.showMaplibre,{timeout:v})}catch{return null}return e.cameraPort}async resetRendererCamera(){const e=this.renderer;if(!e)return;const t=this.kiosk;await e.controls.resetCamera({pan:!0,zoom:!0,roll:!0,pitch:!0},!0),t?.z!=null&&a.fp.activateFloor({name:String(t.z)});const n=f(t);n!==void 0&&await e.controls.zoomBy(n,!0);const i=u(t?.mapCenterX),l=u(t?.mapCenterY);i!==void 0&&l!==void 0&&await e.controls.panTo(i,l,!0);const p=u(t?.mapRollDegrees);p!==void 0&&await e.controls.rollTo(p,!0)}restoreData(){const e=y();e&&(this.setKiosk(e),this.savedKiosk=e,a.uiState.kiosk=!0)}handleSetupReady(){this.restoreData(),a.uiState.kiosk=!0,a.uiState.hideFreeOrDemo=!0,a.uiState.setForceDim(!0),a.searchStore.setSearchText(""),a.searchStore.setFocused(!1),this.resetCamera()}handleClose(){this.setKiosk(null),a.uiState.setForceDim(!1),a.uiState.enableSetKioskMode(!1),a.searchStore.closeSearch()}handleDelete(){M(),this.setKiosk(null),a.uiState.resetMapSettings(),a.uiState.resetUIScale(),this.addStatusMessage({variant:"success",title:h("Deleted")})}handleSave(){const e=this.renderer;if(!e)return;const t=c(this.kiosk),n=this.getCameraState(),i={...t,...n};if(!g(e,i)){this.addStatusMessage({variant:"error",title:h("Kiosk not visible")});return}this.setKiosk(i),K(i),C(i,"https://app.expofp.com/"),a.uiState.setUIScale(i.uiScale,!0),this.addStatusMessage({variant:"success",title:h("Saved")}),this.savedKiosk=i}delayChange(e){requestAnimationFrame(()=>e?.())}handleChange(e){const t=c(this.kiosk);t&&(Number.isFinite(e.angle)&&this.setKiosk({...t,heading:e.angle}),Number.isFinite(e.scale)&&(this.setKiosk({...t,uiScale:e.scale}),this.delayChange(()=>a.uiState.setUIScale(e.scale,!1))),Number.isFinite(e.percent)&&this.setKiosk({...t,iconSizePercent:e.percent}))}setInitialPtScale(e){if(this.initialPtScale)return;this.initialPtScale=e;const t=c(this.kiosk);t&&this.setKiosk({...t,mapInitialPtScale:e})}handleClick(e){const t=c(this.kiosk),n=a.fp.getFloors(),i=S()?n.find(p=>p.active)?.name??null:null,l=a.uiState.uiScale;this.setKiosk({...t,x:e.x,y:e.y,z:i,uiScale:t?.uiScale||l,heading:t?.heading||0,iconSizePercent:t?.iconSizePercent||100,...this.getCameraState()})}handleNavigationChange(){const e=c(this.kiosk);e&&this.setKiosk({...e,...this.getCameraState()})}}r([m({keepAlive:!0})],s.prototype,"kiosk",null),r([o],s.prototype,"setKiosk",null),r([m({keepAlive:!0})],s.prototype,"renderer",null),r([d],s.prototype,"savedKiosk",void 0),r([m({keepAlive:!0})],s.prototype,"hasUnsavedChanges",null),r([d],s.prototype,"statusMessages",void 0),r([o],s.prototype,"addStatusMessage",null),r([o],s.prototype,"clearStatusMessages",null),r([o],s.prototype,"startCleanupMessages",null),r([o],s.prototype,"resetCamera",null),r([o],s.prototype,"restoreData",null),r([o],s.prototype,"handleSetupReady",null),r([o],s.prototype,"handleClose",null),r([o],s.prototype,"handleDelete",null),r([o],s.prototype,"handleSave",null),r([o],s.prototype,"handleChange",null),r([o],s.prototype,"setInitialPtScale",null),r([o],s.prototype,"handleClick",null),r([o],s.prototype,"handleNavigationChange",null);export default new s;
@@ -1,21 +1,25 @@
1
- import { ReactNode } from 'react';
2
- import { AlertProps } from '../../../ui/Alert';
3
- import { ButtonVariant } from '../../../ui/Button';
4
- export interface KioskMapState {
5
- mapRollDegrees: number;
6
- mapInitialPtScale: number;
7
- mapPtScale: number;
8
- mapCenterX: number;
9
- mapCenterY: number;
10
- mapPitch: number;
11
- }
12
- export interface Kiosk extends KioskMapState {
1
+ import { type Kiosk as KioskData } from '@expofp/schema';
2
+ import { type ReactNode } from 'react';
3
+ import { type AlertProps } from '../../../ui/Alert';
4
+ import { type ButtonVariant } from '../../../ui/Button';
5
+ /**
6
+ * The saved camera framing — the camera subset of the kiosk record. The field
7
+ * shapes are not declared here: `KioskSchema` (@expofp/schema) is the single
8
+ * definition of kiosk input data, and a kiosk reaches us from localStorage,
9
+ * from `config.kiosk` or from the legacy `kiosk_*` params through that same
10
+ * shape. Every field is optional there because every one of those sources can
11
+ * omit it — guard with `Number.isFinite` rather than assuming.
12
+ */
13
+ export type KioskMapState = Pick<KioskData, 'mapRollDegrees' | 'mapInitialPtScale' | 'mapPtScale' | 'mapCenterX' | 'mapCenterY' | 'mapPitch' | 'mapCenterLng' | 'mapCenterLat' | 'mapZoom' | 'mapBearingDegrees' | 'mapPitchDegrees'>;
14
+ /**
15
+ * A kiosk as the on-device SetKiosk flow writes it: same shape as `KioskData`,
16
+ * narrowed to the anchor fields that flow always fills in.
17
+ */
18
+ export interface Kiosk extends KioskData {
13
19
  x: number;
14
20
  y: number;
15
21
  z: string | null;
16
22
  heading: number;
17
- lat?: number;
18
- lng?: number;
19
23
  iconSizePercent: number;
20
24
  uiScale: number;
21
25
  }
@@ -1,4 +1,4 @@
1
- import { Kiosk } from './SetKiosk';
1
+ import { type Kiosk } from './SetKiosk';
2
2
  export declare function integrateKioskIntoMap(kiosk: Kiosk, enableKioskMode: boolean): void;
3
3
  export declare function integrateKioskIntoWf(kiosk: Kiosk): void;
4
4
  //# sourceMappingURL=integrateKiosk.d.ts.map
@@ -1 +1 @@
1
- import{runInAction as r,when as n}from"mobx";import e from"../../store";export function integrateKioskIntoMap(t,a){t&&r(()=>{e.uiState.setKioskData(t),e.uiState.kiosk=a,e.uiState.setMapSettings({centerxy:`${t.mapCenterX},${t.mapCenterY}`,z:t.z,bearing:t.mapRollDegrees}),t.mapPtScale&&e.uiState.changeZoom(t.mapInitialPtScale/t.mapPtScale)})}export function integrateKioskIntoWf(t){t&&(t.z!=null&&e.fp.activateFloor({name:t.z.toString()}),n(()=>!!e.uiState.selectedRoute,()=>{const a=e.uiState.selectedRoute;a.to&&!a.from&&e.routeStore.selectRoute(a,!1,!0)}))}
1
+ import{runInAction as n,when as a}from"mobx";import e from"../../store";import{getPtScaleZoomRatio as i}from"./kiosk-record";export function integrateKioskIntoMap(t,o){t&&n(()=>{if(e.uiState.setKioskData(t),e.uiState.kiosk=o,e.maplibreStore.showMaplibre)return;e.uiState.setMapSettings({centerxy:`${t.mapCenterX},${t.mapCenterY}`,z:t.z??void 0,bearing:t.mapRollDegrees});const r=i(t);r!==void 0&&e.uiState.changeZoom(r)})}export function integrateKioskIntoWf(t){t&&(t.z!=null&&e.fp.activateFloor({name:t.z.toString()}),a(()=>!!e.uiState.selectedRoute,()=>{const o=e.uiState.selectedRoute;o?.to&&!o.from&&e.routeStore.selectRoute(o,!1,!0)}))}
@@ -0,0 +1,19 @@
1
+ import { type Kiosk } from './SetKiosk';
2
+ /**
3
+ * Narrows a saved kiosk field to a usable number.
4
+ *
5
+ * Every field of a kiosk record is optional (`KioskSchema`) and the record can
6
+ * arrive from localStorage, from `config.kiosk` or from the legacy `kiosk_*`
7
+ * params — so a field can be absent, or present and `NaN` from a bad parse.
8
+ * Both must read as "not set": feeding `NaN` into a camera move silently parks
9
+ * the kiosk nowhere.
10
+ */
11
+ export declare function toFiniteNumber(value: number | null | undefined): number | undefined;
12
+ /**
13
+ * The zoom factor that takes the plan renderer from the pt-scale it booted at
14
+ * to the one the kiosk was saved at, or undefined when the record does not
15
+ * carry both. Restoring the home framing and integrating the kiosk at load both
16
+ * need it, and both need the same guard.
17
+ */
18
+ export declare function getPtScaleZoomRatio(kiosk: Kiosk | null | undefined): number | undefined;
19
+ //# sourceMappingURL=kiosk-record.d.ts.map
@@ -0,0 +1 @@
1
+ export function toFiniteNumber(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}export function getPtScaleZoomRatio(e){const t=toFiniteNumber(e?.mapInitialPtScale),n=toFiniteNumber(e?.mapPtScale);if(!(t===void 0||n===void 0||n<=0))return t/n}
@@ -1 +1 @@
1
- import{jsx as J}from"react/jsx-runtime";import{degToRad as _}from"@expofp/geometry";import W from"color";import{runInAction as H}from"mobx";import{observer as K}from"mobx-react-lite";import{useCallback as k,useEffect as I,useMemo as u,useRef as y,useState as F}from"react";import Z from"../../data";import{getLayerSvg as Q,svgArea as L,svgAreaExplicit as Y}from"../../data/svg";import{createSceneDef as q}from"../../renderer";import a,{uiState as R}from"../../store";import D from"../../tools/settings";import{resolveVenueFitRect as ee}from"../../utils/scene-bounds";import re from"../Map/drawing/config/config-all";import{loadLayersImages as oe}from"../Map/drawing/config/loadBoothsImages";import{useBuildRoute as te}from"../Map/traffic/useBuildRoute";import{useManageTraffic as ne}from"../Map/traffic/useManageTraffic";import ae from"./MaplibreWrapper";import{useCameraReactions as ie}from"./useCameraReactions";import{useDimming as se}from"./useDimming";import{useLayerVisibilitySync as le}from"./useLayerVisibilitySync";import{useRendererEvents as ce}from"./useRendererEvents";import{useWayfindingAndMarkers as ue}from"./useWayfindingAndMarkers";import{deriveGeoConfig as fe,getLocalRectGeoBounds as me,getVisibleRectFitPadding as pe,INITIAL_FIT_ZOOM_ADJUSTMENT as de}from"./utils/geo-config";import{applyMapOptions as $,DEFAULT_MAP_OPTIONS as ge,getTileSource as ye,MAP_2D_OPTIONS as Re}from"./utils/map-helpers";import{calculateTransformMatrix as be}from"./utils/solver";const w="routes-api.expofp.com";function j(){H(()=>{a.layerStore.layers.forEach(t=>{t.configured=!1,t.children=[],t.loaded=!1}),a.layerStore.layersLoaded=!1})}function z(t,l){const o=[];for(const f of t.rollRegistry.invoke(l))Array.isArray(f)?o.push(...f):o.push(f);o.length&&t.update(...o)}function Se(t){const l=Math.abs(t[0]??0),o=Math.hypot(t[0]??0,t[1]??0);return l<=0||o<=0?1:l/o}const Ae=K(function({viewMode:l}){const[o,f]=F(null),[T,O]=F(null),e=a.rendererService,h=y(null),c=y(null),b=y(null),x=y(null),r=u(()=>fe(),[]),E=u(()=>{const{rect:n}=ee({layerViewbox:a.layerStore.viewboxRectangle,explicitArea:Y?L:null,layerRectangle:a.layerStore.rectangle,sceneDef:o,svgArea:L});return n},[o]),m=u(()=>r?{center:r.center,bearing:r.bearing,zoom:r.zoom,bounds:me(E,r.gpsConfig),fitPadding:pe(0),zoomAdjustment:de}:null,[r,E]),p=u(()=>r?be(r.gpsConfig,Q()?.getAttribute("units")):null,[r]),d=u(()=>({...l==="map2d"?Re:ge}),[l]),P=y(d),B=u(()=>ye(),[]),{mapDimAnimatorRef:S,venueDimAnimatorRef:A,handleMapDimLayerReady:N}=se(c,e);I(()=>{if(!r)return;let n=!1;j();const i=re(e).then(s=>{if(n)return;const M=W(D.backgroundColor==="none"?"#ebebeb":D.backgroundColor).string(),C=q(s,L,M);f(C)}).catch(s=>{n||console.warn("Maplibre scene configuration failed.",s)}),v=S.current,g=A.current;return()=>{n=!0,j();const s=h.current;i.finally(()=>e.disposeIfCurrent(s)),b.current?.(),b.current=null,h.current=null,c.current=null,x.current=null,O(null),v?.stop(),g?.stop(),R.sceneDefReady=!1}},[r,S,e,A]);const U=k((n,i,v,g)=>{h.current=n,c.current=i,x.current=g,O(n),e.attach(n,v,g,p?Se(p):1),$(i,P.current),S.current?.setTarget(R.dimmed,{immediate:!0}),A.current?.setTarget(R.dimmed,{immediate:!0}),b.current?.();const s=()=>{const C=i.getBearing()-(r?.bearing??0);z(e,_(C))};i.on("rotate",s),i.on("rotateend",s),b.current=()=>{i.off("rotate",s),i.off("rotateend",s)},oe(e);const M=e.ptScaleRegistry.invoke(e.scale||1);M.length&&e.update(...M),z(e,_(i.getBearing()-(r?.bearing??0))),a.layerStore.layersLoaded=!0,a.fp.onFpConfigured&&a.fp.onFpConfigured(),R.sceneDefReady=!0,g()},[e,S,p,A]);I(()=>{P.current=d,$(c.current,d,!0)},[d]),ce(T,e),ue(T,e),le(e,c,r),ie(c,r,o),te({enabled:a.layerStore.layersLoaded&&R.buildRoute,rendererService:e});const V=Z.busRoutes??!1;ne({permission:a.layerStore.layersLoaded&&V,rendererService:e,dataJsonUrl:`https://${w}/v1/routes?expo=${D.EXPO}`,websocketUrl:`wss://${w}/locations?expo=${D.EXPO}`});const G=k(n=>{console.warn("Maplibre map failed to load; falling back to floorplan mode.",n),a.maplibreStore.deactivateMaplibre()},[]);if(!r||!m||!p||!o)return null;const X=`${m.center.join(",")}:${m.bearing}:${m.zoom}`;return J(ae,{sceneDef:o,geoConfig:m,staticTransform:p,tileSource:B,mapOptions:d,onRendererReady:U,onMapDimLayerReady:N,onMapLoadError:G},X)});export default Ae;
1
+ import{jsx as W}from"react/jsx-runtime";import{degToRad as I}from"@expofp/geometry";import Z from"color";import{runInAction as H}from"mobx";import{observer as Q}from"mobx-react-lite";import{useCallback as k,useEffect as z,useMemo as m,useRef as p,useState as F}from"react";import Y from"../../data";import{getLayerSvg as q,svgArea as L,svgAreaExplicit as ee}from"../../data/svg";import{createSceneDef as re}from"../../renderer";import a,{uiState as y}from"../../store";import D from"../../tools/settings";import{resolveVenueFitRect as te}from"../../utils/scene-bounds";import oe from"../Map/drawing/config/config-all";import{loadLayersImages as ne}from"../Map/drawing/config/loadBoothsImages";import{useBuildRoute as ae}from"../Map/traffic/useBuildRoute";import{useManageTraffic as ie}from"../Map/traffic/useManageTraffic";import se from"./MaplibreWrapper";import{useCameraReactions as ce}from"./useCameraReactions";import{useDimming as le}from"./useDimming";import{useKioskIdleEvents as ue}from"./useKioskIdleEvents";import{useLayerVisibilitySync as fe}from"./useLayerVisibilitySync";import{useRendererEvents as me}from"./useRendererEvents";import{useWayfindingAndMarkers as pe}from"./useWayfindingAndMarkers";import{deriveGeoConfig as de,getLocalRectGeoBounds as ge,getVisibleRectFitPadding as be,INITIAL_FIT_ZOOM_ADJUSTMENT as Re}from"./utils/geo-config";import{applyMapOptions as $,DEFAULT_MAP_OPTIONS as ye,getTileSource as Se,MAP_2D_OPTIONS as Ae}from"./utils/map-helpers";import{calculateTransformMatrix as Ce}from"./utils/solver";const B="routes-api.expofp.com",he=800;function Me(e,c,n){return{getCameraState:()=>{const t=e.getCenter();return{lng:t.lng,lat:t.lat,zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch()}},applyCameraState:t=>{e.easeTo({center:[t.lng,t.lat],zoom:t.zoom,bearing:t.bearing??c,pitch:t.pitch??n(),duration:he,essential:!0})},resetPitch:()=>{const t=n();e.getPitch()!==t&&e.jumpTo({pitch:t})}}}function j(){H(()=>{a.layerStore.layers.forEach(e=>{e.configured=!1,e.children=[],e.loaded=!1}),a.layerStore.layersLoaded=!1})}function w(e,c){const n=[];for(const t of e.rollRegistry.invoke(c))Array.isArray(t)?n.push(...t):n.push(t);n.length&&e.update(...n)}function De(e){const c=Math.abs(e[0]??0),n=Math.hypot(e[0]??0,e[1]??0);return c<=0||n<=0?1:c/n}const ve=Q(function({viewMode:c}){const[n,t]=F(null),[v,O]=F(null),o=a.rendererService,T=p(null),u=p(null),S=p(null),x=p(null),A=p(null),r=m(()=>de(),[]),_=m(()=>{const{rect:s}=te({layerViewbox:a.layerStore.viewboxRectangle,explicitArea:ee?L:null,layerRectangle:a.layerStore.rectangle,sceneDef:n,svgArea:L});return s},[n]),d=m(()=>r?{center:r.center,bearing:r.bearing,zoom:r.zoom,bounds:ge(_,r.gpsConfig),fitPadding:be(0),zoomAdjustment:Re}:null,[r,_]),g=m(()=>r?Ce(r.gpsConfig,q()?.getAttribute("units")):null,[r]),b=m(()=>({...c==="map2d"?Ae:ye}),[c]),P=p(b),N=m(()=>Se(),[]),{mapDimAnimatorRef:C,venueDimAnimatorRef:h,handleMapDimLayerReady:U}=le(u,o);z(()=>{if(!r)return;let s=!1;j();const i=oe(o).then(l=>{if(s)return;const f=Z(D.backgroundColor==="none"?"#ebebeb":D.backgroundColor).string(),M=re(l,L,f);t(M)}).catch(l=>{s||console.warn("Maplibre scene configuration failed.",l)}),E=C.current,R=h.current;return()=>{s=!0,j();const l=T.current;i.finally(()=>o.disposeIfCurrent(l)),S.current?.(),S.current=null,A.current&&(a.maplibreStore.clearCameraPortIfCurrent(A.current),A.current=null),T.current=null,u.current=null,x.current=null,O(null),E?.stop(),R?.stop(),y.sceneDefReady=!1}},[r,C,o,h]);const V=k((s,i,E,R)=>{T.current=s,u.current=i,x.current=R,O(s),o.attach(s,E,R,g?De(g):1),$(i,P.current);const l=Me(i,r?.bearing??i.getBearing(),()=>P.current.pitch??0);A.current=l,a.maplibreStore.setCameraPort(l),C.current?.setTarget(y.dimmed,{immediate:!0}),h.current?.setTarget(y.dimmed,{immediate:!0}),S.current?.();const f=()=>{const K=i.getBearing()-(r?.bearing??0);w(o,I(K))};i.on("rotate",f),i.on("rotateend",f),S.current=()=>{i.off("rotate",f),i.off("rotateend",f)},ne(o);const M=o.ptScaleRegistry.invoke(o.scale||1);M.length&&o.update(...M),w(o,I(i.getBearing()-(r?.bearing??0))),a.layerStore.layersLoaded=!0,a.fp.onFpConfigured&&a.fp.onFpConfigured(),y.sceneDefReady=!0,R()},[o,C,g,h,r]);z(()=>{P.current=b,$(u.current,b,!0)},[b]),me(v,o),ue(v,u),pe(v,o),fe(o,u,r),ce(u,r,n),ae({enabled:a.layerStore.layersLoaded&&y.buildRoute,rendererService:o});const G=Y.busRoutes??!1;ie({permission:a.layerStore.layersLoaded&&G,rendererService:o,dataJsonUrl:`https://${B}/v1/routes?expo=${D.EXPO}`,websocketUrl:`wss://${B}/locations?expo=${D.EXPO}`});const X=k(s=>{console.warn("Maplibre map failed to load; falling back to floorplan mode.",s),a.maplibreStore.deactivateMaplibre()},[]);if(!r||!d||!g||!n)return null;const J=`${d.center.join(",")}:${d.bearing}:${d.zoom}`;return W(se,{sceneDef:n,geoConfig:d,staticTransform:g,tileSource:N,mapOptions:b,onRendererReady:V,onMapDimLayerReady:U,onMapLoadError:X},J)});export default ve;
@@ -0,0 +1,18 @@
1
+ import { type Renderer } from '@expofp/renderer';
2
+ import { type Map as MaplibreMap } from 'maplibre-gl';
3
+ import { type RefObject } from 'react';
4
+ /**
5
+ * Keeps the kiosk idle timer alive while a visitor pans or zooms the map.
6
+ *
7
+ * The timer's usual source is the renderer's `navigation:change`, which only
8
+ * fires for the renderer's own camera — and map mode doesn't drive it. Without
9
+ * these listeners the timer runs out mid-gesture for a visitor who only moves
10
+ * the map.
11
+ *
12
+ * `renderer` is not read; it is the mount signal. `mapRef.current` is assigned
13
+ * in the same `handleRendererReady` call that sets `renderer`, so keying the
14
+ * effect on `renderer` is what guarantees there is a map to subscribe to — the
15
+ * early return below is the assertion of that contract, not a tolerated miss.
16
+ */
17
+ export declare function useKioskIdleEvents(renderer: Renderer | null, mapRef: RefObject<MaplibreMap | null>): void;
18
+ //# sourceMappingURL=useKioskIdleEvents.d.ts.map
@@ -0,0 +1 @@
1
+ import{useEffect as i}from"react";export function useKioskIdleEvents(n,o){i(()=>{const e=o.current;if(!n||!e)return;let t=!1;const r=f=>{f.originalEvent&&(t=!0,window.__resett?.())},s=()=>{t&&(t=!1,window.__resett?.())};return e.on("movestart",r),e.on("moveend",s),()=>{e.off("movestart",r),e.off("moveend",s)}},[n,o])}
@@ -1,15 +1,62 @@
1
1
  import type RootStore from './RootStore';
2
2
  export type MaplibreViewMode = 'floorplan' | 'map2d' | 'map3d';
3
+ /** The MapLibre camera framing, in the map's own terms. */
4
+ export interface MaplibreCameraState {
5
+ lng: number;
6
+ lat: number;
7
+ zoom: number;
8
+ /** Degrees. */
9
+ bearing: number;
10
+ /** Degrees. */
11
+ pitch: number;
12
+ }
13
+ /**
14
+ * A framing to move the camera to. `bearing` and `pitch` are optional because a
15
+ * kiosk saved before those fields existed carries neither.
16
+ */
17
+ export interface MaplibreCameraTarget {
18
+ lng: number;
19
+ lat: number;
20
+ zoom: number;
21
+ /** Degrees; omitted falls back to the venue bearing. */
22
+ bearing?: number;
23
+ /** Degrees; omitted falls back to the view mode's default pitch. */
24
+ pitch?: number;
25
+ }
26
+ /**
27
+ * Read/write access to the live MapLibre camera, registered by MaplibreAdapter
28
+ * once the map is up. In map mode the renderer runs in the renderer's external
29
+ * mode, where `renderer.controls` is a no-op stub that reports a zeroed camera —
30
+ * so anything that has to capture or restore the camera (the kiosk home framing)
31
+ * must go through the map itself.
32
+ */
33
+ export interface MaplibreCameraPort {
34
+ getCameraState(): MaplibreCameraState;
35
+ applyCameraState(target: MaplibreCameraTarget): void;
36
+ /**
37
+ * Snaps pitch back to the view mode's default, leaving center/zoom/bearing
38
+ * alone — for the "fit the venue" fallback, which restores a framing through
39
+ * `moveToRect` (bearing only) and would otherwise leave a map3d kiosk tilted.
40
+ * Call it before starting that fit, not after: MapLibre runs one move at a
41
+ * time.
42
+ */
43
+ resetPitch(): void;
44
+ }
3
45
  export default class MaplibreStore {
4
46
  rootStore: RootStore;
5
47
  mapViewMode: MaplibreViewMode;
6
48
  maplibreSelected: boolean;
7
49
  isOnline: boolean;
50
+ private readonly cameraPortBox;
8
51
  private readonly handleOnline;
9
52
  private readonly handleOffline;
10
53
  constructor(rootStore: RootStore);
11
54
  dispose(): void;
12
55
  setOnline(isOnline: boolean): void;
56
+ get cameraPort(): MaplibreCameraPort | null;
57
+ setCameraPort(port: MaplibreCameraPort): void;
58
+ /** Clears only if `port` is still the registered one — a remount may already have replaced it. */
59
+ clearCameraPortIfCurrent(port: MaplibreCameraPort): void;
13
60
  activateMaplibre(): void;
14
61
  deactivateMaplibre(): void;
15
62
  get hideModeSwitchButton(): boolean;
@@ -1 +1 @@
1
- import{__decorate as i}from"tslib";import{action as n,computed as o,observable as a}from"mobx";import l from"../data";import{fpGeo as p}from"../data/fpGeo";const d=import.meta.env?.VITE_EXPOFP_DISABLE_3D_TOGGLE!=="false";function s(){return typeof window>"u"||window.navigator.onLine}export default class e{constructor(t){this.mapViewMode="floorplan",this.maplibreSelected=!1,this.isOnline=s(),this.handleOnline=()=>this.setOnline(!0),this.handleOffline=()=>this.setOnline(!1),this.rootStore=t,this.mapViewMode=this.getInitialViewMode(),this.maplibreSelected=this.mapViewMode!=="floorplan",typeof window<"u"&&(window.addEventListener("online",this.handleOnline),window.addEventListener("offline",this.handleOffline))}dispose(){typeof window>"u"||(window.removeEventListener("online",this.handleOnline),window.removeEventListener("offline",this.handleOffline))}setOnline(t){this.isOnline=t}activateMaplibre(){this.maplibreEnabled&&(this.mapViewMode=l.allow3dView&&this.mapViewMode!=="map3d"?"map3d":"map2d",this.maplibreSelected=!0)}deactivateMaplibre(){this.mapViewMode="floorplan",this.maplibreSelected=!1}get hideModeSwitchButton(){return!this.maplibreEnabled||!l.allow3dView||d||l.hideModeSwitchButton}get maplibreEnabled(){const t=this.rootStore.fp?.maplibre??window.__efpMaplibre,r=!!t?.offline&&(!!t.style||!!t.styleUrl);return this.useMaplibreMap&&!!p?.properties?.config&&!this.rootStore.uiState.kiosk&&(this.isOnline||r)}get useMaplibreMap(){return l.enableExperimentalMaplibre??p?.properties?.config?.type==="maplibre"}get showMaplibre(){return this.maplibreEnabled&&(this.mapViewMode==="map2d"||this.mapViewMode==="map3d")}get isMap3d(){return this.maplibreEnabled&&this.mapViewMode==="map3d"}getInitialViewMode(){return this.maplibreEnabled?l.allow3dView&&!l.hide3dMapDefault?"map3d":"map2d":"floorplan"}}i([a],e.prototype,"mapViewMode",void 0),i([a],e.prototype,"maplibreSelected",void 0),i([a],e.prototype,"isOnline",void 0),i([n],e.prototype,"setOnline",null),i([n],e.prototype,"activateMaplibre",null),i([n],e.prototype,"deactivateMaplibre",null),i([o({keepAlive:!0})],e.prototype,"hideModeSwitchButton",null),i([o({keepAlive:!0})],e.prototype,"maplibreEnabled",null),i([o({keepAlive:!0})],e.prototype,"useMaplibreMap",null),i([o({keepAlive:!0})],e.prototype,"showMaplibre",null),i([o({keepAlive:!0})],e.prototype,"isMap3d",null);
1
+ import{__decorate as t}from"tslib";import{action as o,computed as l,observable as a}from"mobx";import r from"../data";import{fpGeo as n}from"../data/fpGeo";const d=import.meta.env?.VITE_EXPOFP_DISABLE_3D_TOGGLE!=="false";function s(){return typeof window>"u"||window.navigator.onLine}export default class e{constructor(i){this.mapViewMode="floorplan",this.maplibreSelected=!1,this.isOnline=s(),this.cameraPortBox=a.box(null,{deep:!1}),this.handleOnline=()=>this.setOnline(!0),this.handleOffline=()=>this.setOnline(!1),this.rootStore=i,this.mapViewMode=this.getInitialViewMode(),this.maplibreSelected=this.mapViewMode!=="floorplan",typeof window<"u"&&(window.addEventListener("online",this.handleOnline),window.addEventListener("offline",this.handleOffline))}dispose(){typeof window>"u"||(window.removeEventListener("online",this.handleOnline),window.removeEventListener("offline",this.handleOffline))}setOnline(i){this.isOnline=i}get cameraPort(){return this.cameraPortBox.get()}setCameraPort(i){this.cameraPortBox.set(i)}clearCameraPortIfCurrent(i){this.cameraPortBox.get()===i&&this.cameraPortBox.set(null)}activateMaplibre(){this.maplibreEnabled&&(this.mapViewMode=r.allow3dView&&this.mapViewMode!=="map3d"?"map3d":"map2d",this.maplibreSelected=!0)}deactivateMaplibre(){this.mapViewMode="floorplan",this.maplibreSelected=!1}get hideModeSwitchButton(){return!this.maplibreEnabled||!r.allow3dView||d||r.hideModeSwitchButton}get maplibreEnabled(){const i=this.rootStore.fp?.maplibre??window.__efpMaplibre,p=!!i?.offline&&(!!i.style||!!i.styleUrl);return this.useMaplibreMap&&!!n?.properties?.config&&(this.isOnline||p)}get useMaplibreMap(){return r.enableExperimentalMaplibre??n?.properties?.config?.type==="maplibre"}get showMaplibre(){return this.maplibreEnabled&&(this.mapViewMode==="map2d"||this.mapViewMode==="map3d")}get isMap3d(){return this.maplibreEnabled&&this.mapViewMode==="map3d"}getInitialViewMode(){return this.maplibreEnabled?r.allow3dView&&!r.hide3dMapDefault?"map3d":"map2d":"floorplan"}}t([a],e.prototype,"mapViewMode",void 0),t([a],e.prototype,"maplibreSelected",void 0),t([a],e.prototype,"isOnline",void 0),t([o],e.prototype,"setOnline",null),t([o],e.prototype,"setCameraPort",null),t([o],e.prototype,"clearCameraPortIfCurrent",null),t([o],e.prototype,"activateMaplibre",null),t([o],e.prototype,"deactivateMaplibre",null),t([l({keepAlive:!0})],e.prototype,"hideModeSwitchButton",null),t([l({keepAlive:!0})],e.prototype,"maplibreEnabled",null),t([l({keepAlive:!0})],e.prototype,"useMaplibreMap",null),t([l({keepAlive:!0})],e.prototype,"showMaplibre",null),t([l({keepAlive:!0})],e.prototype,"isMap3d",null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expofp/floorplan",
3
- "version": "3.16.2",
3
+ "version": "3.18.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/expofp/efp-app.git",
@@ -72,13 +72,13 @@
72
72
  "tslib": "^2.3.0",
73
73
  "uuid": "^9.0.1",
74
74
  "zod": "4.4.3",
75
- "@expofp/config": "3.16.2",
76
- "@expofp/debug": "3.16.2",
77
- "@expofp/geometry": "3.16.2",
78
- "@expofp/resolve": "3.16.2",
79
- "@expofp/schema": "3.16.2",
80
- "@expofp/wayfinding": "3.16.2",
81
- "@expofp/utils": "3.16.2"
75
+ "@expofp/config": "3.18.0",
76
+ "@expofp/geometry": "3.18.0",
77
+ "@expofp/resolve": "3.18.0",
78
+ "@expofp/utils": "3.18.0",
79
+ "@expofp/schema": "3.18.0",
80
+ "@expofp/debug": "3.18.0",
81
+ "@expofp/wayfinding": "3.18.0"
82
82
  },
83
83
  "devDependencies": {
84
84
  "@babel/plugin-proposal-decorators": "^8.0.2",
@@ -1,241 +0,0 @@
1
- (function() {
2
- try {
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.16.2" };
5
- var t = new e.Error().stack;
6
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "903557b3-0f34-4752-a7b6-97830c2c5f58", e._sentryDebugIdIdentifier = "sentry-dbid-903557b3-0f34-4752-a7b6-97830c2c5f58");
7
- } catch {}
8
- })();
9
- import { _ as e, d as t, m as n, s as r, x as i } from "./i18n-FEmGn2JV.js";
10
- import { $ as a, Mt as o, Q as s, Xt as c, Z as l, rt as u, s as d } from "./store-CZirnYJR.js";
11
- //#region src/components/Map/pointInConvexQuad.ts
12
- function f(e, t) {
13
- let n = 0;
14
- for (let r = 0; r < 4; r++) {
15
- let i = t[r], a = t[(r + 1) % 4], o = (a.x - i.x) * (e.y - i.y) - (a.y - i.y) * (e.x - i.x);
16
- if (!Number.isFinite(o)) return !1;
17
- if (o === 0) continue;
18
- let s = o > 0 ? 1 : -1;
19
- if (n === 0) n = s;
20
- else if (n !== s) return !1;
21
- }
22
- return n !== 0;
23
- }
24
- //#endregion
25
- //#region src/components/Map/visibleArea.ts
26
- function p(e) {
27
- let t = o(e.viewport.canvasToSvg({
28
- x: 0,
29
- y: 0
30
- })), n = o(e.viewport.canvasToSvg({
31
- x: e.canvas.clientWidth,
32
- y: 0
33
- })), r = o(e.viewport.canvasToSvg({
34
- x: 0,
35
- y: e.canvas.clientHeight
36
- })), i = o(e.viewport.canvasToSvg({
37
- x: e.canvas.clientWidth,
38
- y: e.canvas.clientHeight
39
- })), a = Math.min(t.x, n.x, r.x, i.x), s = Math.max(t.x, n.x, r.x, i.x), c = Math.min(t.y, n.y, r.y, i.y), l = Math.max(t.y, n.y, r.y, i.y);
40
- return {
41
- x: a,
42
- y: c,
43
- width: s - a,
44
- height: l - c,
45
- left: a,
46
- right: s,
47
- top: l,
48
- bottom: c,
49
- center: {
50
- x: (a + s) / 2,
51
- y: (c + l) / 2
52
- },
53
- corners: [
54
- t,
55
- n,
56
- i,
57
- r
58
- ]
59
- };
60
- }
61
- function m(e, t) {
62
- return f(t, p(e).corners);
63
- }
64
- //#endregion
65
- //#region src/components/Kiosk/KioskStore.ts
66
- var h, g, _, v, y, b;
67
- function x(e, t, n, r) {
68
- n && Object.defineProperty(e, t, {
69
- enumerable: n.enumerable,
70
- configurable: n.configurable,
71
- writable: n.writable,
72
- value: n.initializer ? n.initializer.call(r) : void 0
73
- });
74
- }
75
- function S(e, t, n, r, i) {
76
- var a = {};
77
- return Object.keys(r).forEach(function(e) {
78
- a[e] = r[e];
79
- }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = n.slice().reverse().reduce(function(n, r) {
80
- return r(e, t, n) || n;
81
- }, a), i && a.initializer !== void 0 && (a.value = a.initializer ? a.initializer.call(i) : void 0, a.initializer = void 0), a.initializer === void 0 ? (Object.defineProperty(e, t, a), null) : a;
82
- }
83
- var C = new (h = n({ keepAlive: !0 }), g = n({ keepAlive: !0 }), _ = n({ keepAlive: !0 }), v = class {
84
- constructor() {
85
- x(this, "savedKiosk", y, this), x(this, "statusMessages", b, this), this.statusMessageTimer = 0, this.isResettingCamera = !1, this.initialPtScale = void 0;
86
- }
87
- get kiosk() {
88
- return d.uiState.kioskData;
89
- }
90
- setKiosk(e) {
91
- d.uiState.setKioskData(e);
92
- }
93
- get renderer() {
94
- return d.rendererService.renderer;
95
- }
96
- getCameraState() {
97
- let e = d.rendererService.getCameraState();
98
- return e ? {
99
- mapInitialPtScale: this.initialPtScale,
100
- mapPtScale: e.ptScale,
101
- mapCenterX: e.center.x,
102
- mapCenterY: e.center.y,
103
- mapRollDegrees: e.roll,
104
- mapPitch: e.pitch
105
- } : {};
106
- }
107
- get hasUnsavedChanges() {
108
- let e = this.savedKiosk, t = i(this.kiosk);
109
- if (!t || !e) return !!t != !!e;
110
- let n = Object.keys(e), r = Object.keys(t);
111
- if (n.length !== r.length) return !0;
112
- for (let r of n) if (!(r in t) || e[r] !== t[r]) return !0;
113
- return !1;
114
- }
115
- addStatusMessage(e) {
116
- this.statusMessages = [{
117
- ...e,
118
- id: Date.now()
119
- }], this.startCleanupMessages();
120
- }
121
- clearStatusMessages() {
122
- this.statusMessages = [];
123
- }
124
- startCleanupMessages() {
125
- clearTimeout(this.statusMessageTimer), this.statusMessageTimer = window.setTimeout(() => this.clearStatusMessages(), 1e3);
126
- }
127
- async resetCamera() {
128
- let e = this.renderer;
129
- if (!(!e || this.isResettingCamera)) {
130
- this.isResettingCamera = !0;
131
- try {
132
- let { z: t, mapRollDegrees: n, mapInitialPtScale: r, mapPtScale: i, mapCenterX: a, mapCenterY: o } = this.kiosk || {};
133
- await e.controls.resetCamera({
134
- pan: !0,
135
- zoom: !0,
136
- roll: !0,
137
- pitch: !0
138
- }, !0), t && d.fp.activateFloor({ name: t }), Number.isFinite(r) && Number.isFinite(i) && i > 0 && await e.controls.zoomBy(r / i, !0), Number.isFinite(a) && Number.isFinite(o) && await e.controls.panTo(a, o, !0), Number.isFinite(n) && await e.controls.rollTo(n, !0);
139
- } finally {
140
- this.isResettingCamera = !1;
141
- }
142
- }
143
- }
144
- restoreData() {
145
- let e = l();
146
- e && (this.setKiosk(e), this.savedKiosk = e, d.uiState.kiosk = !0);
147
- }
148
- handleSetupReady() {
149
- this.restoreData(), d.uiState.kiosk = !0, d.uiState.hideFreeOrDemo = !0, d.uiState.setForceDim(!0), d.searchStore.setSearchText(""), d.searchStore.setFocused(!1), this.resetCamera();
150
- }
151
- handleClose() {
152
- this.setKiosk(null), d.uiState.setForceDim(!1), d.uiState.enableSetKioskMode(!1), d.searchStore.closeSearch();
153
- }
154
- handleDelete() {
155
- s(), this.setKiosk(null), d.uiState.resetMapSettings(), d.uiState.resetUIScale(), this.addStatusMessage({
156
- variant: "success",
157
- title: r("Deleted")
158
- });
159
- }
160
- handleSave() {
161
- let e = this.renderer;
162
- if (!e) return;
163
- let t = i(this.kiosk), n = this.getCameraState(), o = {
164
- ...t,
165
- ...n
166
- };
167
- if (!m(e, o)) {
168
- this.addStatusMessage({
169
- variant: "error",
170
- title: r("Kiosk not visible")
171
- });
172
- return;
173
- }
174
- this.setKiosk(o), a(o), u(o, "https://app.expofp.com/"), d.uiState.setUIScale(o.uiScale, !0), this.addStatusMessage({
175
- variant: "success",
176
- title: r("Saved")
177
- }), this.savedKiosk = o;
178
- }
179
- delayChange(e) {
180
- requestAnimationFrame(() => e == null ? void 0 : e());
181
- }
182
- handleChange(e) {
183
- let t = i(this.kiosk);
184
- t && (Number.isFinite(e.angle) && this.setKiosk({
185
- ...t,
186
- heading: e.angle
187
- }), Number.isFinite(e.scale) && (this.setKiosk({
188
- ...t,
189
- uiScale: e.scale
190
- }), this.delayChange(() => d.uiState.setUIScale(e.scale, !1))), Number.isFinite(e.percent) && this.setKiosk({
191
- ...t,
192
- iconSizePercent: e.percent
193
- }));
194
- }
195
- setInitialPtScale(e) {
196
- if (this.initialPtScale) return;
197
- this.initialPtScale = e;
198
- let t = i(this.kiosk);
199
- t && this.setKiosk({
200
- ...t,
201
- mapInitialPtScale: e
202
- });
203
- }
204
- handleClick(e) {
205
- var t, n;
206
- let r = i(this.kiosk), a = d.fp.getFloors(), o = c() ? (t = (n = a.find((e) => e.active)) == null ? void 0 : n.name) == null ? null : t : null, s = d.uiState.uiScale;
207
- this.setKiosk({
208
- ...r,
209
- x: e.x,
210
- y: e.y,
211
- z: o,
212
- uiScale: (r == null ? void 0 : r.uiScale) || s,
213
- heading: (r == null ? void 0 : r.heading) || 0,
214
- iconSizePercent: (r == null ? void 0 : r.iconSizePercent) || 100,
215
- ...this.getCameraState()
216
- });
217
- }
218
- handleNavigationChange() {
219
- let e = i(this.kiosk);
220
- e && this.setKiosk({
221
- ...e,
222
- ...this.getCameraState()
223
- });
224
- }
225
- }, S(v.prototype, "kiosk", [h], Object.getOwnPropertyDescriptor(v.prototype, "kiosk"), v.prototype), S(v.prototype, "setKiosk", [t], Object.getOwnPropertyDescriptor(v.prototype, "setKiosk"), v.prototype), S(v.prototype, "renderer", [g], Object.getOwnPropertyDescriptor(v.prototype, "renderer"), v.prototype), y = S(v.prototype, "savedKiosk", [e], {
226
- configurable: !0,
227
- enumerable: !0,
228
- writable: !0,
229
- initializer: function() {
230
- return null;
231
- }
232
- }), S(v.prototype, "hasUnsavedChanges", [_], Object.getOwnPropertyDescriptor(v.prototype, "hasUnsavedChanges"), v.prototype), b = S(v.prototype, "statusMessages", [e], {
233
- configurable: !0,
234
- enumerable: !0,
235
- writable: !0,
236
- initializer: function() {
237
- return [];
238
- }
239
- }), S(v.prototype, "addStatusMessage", [t], Object.getOwnPropertyDescriptor(v.prototype, "addStatusMessage"), v.prototype), S(v.prototype, "clearStatusMessages", [t], Object.getOwnPropertyDescriptor(v.prototype, "clearStatusMessages"), v.prototype), S(v.prototype, "startCleanupMessages", [t], Object.getOwnPropertyDescriptor(v.prototype, "startCleanupMessages"), v.prototype), S(v.prototype, "resetCamera", [t], Object.getOwnPropertyDescriptor(v.prototype, "resetCamera"), v.prototype), S(v.prototype, "restoreData", [t], Object.getOwnPropertyDescriptor(v.prototype, "restoreData"), v.prototype), S(v.prototype, "handleSetupReady", [t], Object.getOwnPropertyDescriptor(v.prototype, "handleSetupReady"), v.prototype), S(v.prototype, "handleClose", [t], Object.getOwnPropertyDescriptor(v.prototype, "handleClose"), v.prototype), S(v.prototype, "handleDelete", [t], Object.getOwnPropertyDescriptor(v.prototype, "handleDelete"), v.prototype), S(v.prototype, "handleSave", [t], Object.getOwnPropertyDescriptor(v.prototype, "handleSave"), v.prototype), S(v.prototype, "handleChange", [t], Object.getOwnPropertyDescriptor(v.prototype, "handleChange"), v.prototype), S(v.prototype, "setInitialPtScale", [t], Object.getOwnPropertyDescriptor(v.prototype, "setInitialPtScale"), v.prototype), S(v.prototype, "handleClick", [t], Object.getOwnPropertyDescriptor(v.prototype, "handleClick"), v.prototype), S(v.prototype, "handleNavigationChange", [t], Object.getOwnPropertyDescriptor(v.prototype, "handleNavigationChange"), v.prototype), v)();
240
- //#endregion
241
- export { C as t };