@expofp/floorplan 3.34.2 → 3.35.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 (90) hide show
  1. package/dist/browser/{Button-CNMjOvi_.js → Button-DfC_vCEY.js} +5 -5
  2. package/dist/browser/{CookieConsent-D41GkvnH.js → CookieConsent-zsJlyuvm.js} +7 -7
  3. package/dist/browser/{Debug-CmW7YX8I.js → Debug-DlxKJH4h.js} +7 -7
  4. package/dist/browser/{DebugTools-BiVg-I_r.js → DebugTools-DlmzS_VG.js} +45 -42
  5. package/dist/browser/{Demo-B4Cvydeo.js → Demo-Dvn0OVoH.js} +9 -9
  6. package/dist/browser/{Free-CjQjLOqF.js → Free-BlSArgWI.js} +9 -9
  7. package/dist/browser/{GalleryContainer-mw16bKBB.js → GalleryContainer-hIf9VfU3.js} +10 -10
  8. package/dist/browser/{GpsLoader-pVmQS4Cm.js → GpsLoader-BCwThbCM.js} +33 -33
  9. package/dist/browser/{KioskStore-sSfegCgB.js → KioskStore-CsXOhSMP.js} +9 -9
  10. package/dist/browser/{MaplibreAdapter-CdpX44KB.js → MaplibreAdapter-DWcvE2Ec.js} +921 -917
  11. package/dist/browser/{ModalContainer--UWO5EJt.js → ModalContainer-DxeKREfc.js} +10 -10
  12. package/dist/browser/{PermissionNotice-Dw32M81v.js → PermissionNotice-BxEbDltF.js} +6 -6
  13. package/dist/browser/{SetKioskMode-EltbU-EF.js → SetKioskMode-D3UABJpZ.js} +10 -10
  14. package/dist/browser/{ShowKiosk-BvGaVpGa.js → ShowKiosk-6mFmNpFm.js} +29 -29
  15. package/dist/browser/{ViewerMenuPanel-BEcomGU5.js → ViewerMenuPanel-BO_-7Y_i.js} +18 -18
  16. package/dist/browser/{add-debug-secret-listener-DzuQqBnc.js → add-debug-secret-listener-veloxngO.js} +1 -1
  17. package/dist/browser/{adopt-global-settings-BZ0kVMK5.js → adopt-global-settings-d5uyY5A6.js} +9 -9
  18. package/dist/browser/{boolean-editor-CEIoLj51.js → boolean-editor-gFxeiKz4.js} +9 -9
  19. package/dist/browser/{bootIntercom-Db9lsRTD.js → bootIntercom-C3QDF5oB.js} +2 -2
  20. package/dist/browser/bundle.json +69 -69
  21. package/dist/browser/{camera-events-02zSeTQ-.js → camera-events-C6Dmf2wR.js} +1 -1
  22. package/dist/browser/{classnames-CpaGYtKG.js → classnames-BS1IM9A-.js} +2 -2
  23. package/dist/browser/{client-hdZ-mqt7.js → client-ezZAHjfj.js} +5 -5
  24. package/dist/browser/{components-DwpPpajK.js → components-PA3hCLCa.js} +1814 -1818
  25. package/dist/browser/{debug-context-DB0NIlH9.js → debug-context-DiTR6Py6.js} +7 -7
  26. package/dist/browser/{debug-overlay-B4MTiAeZ.js → debug-overlay-DD5gUmO6.js} +10 -10
  27. package/dist/browser/{debug-ui-D4mq0ugA.js → debug-ui-CWBuocQN.js} +6 -6
  28. package/dist/browser/{dimming-BvAGMHKX.js → dimming-Ds9fAjfB.js} +311 -311
  29. package/dist/browser/{dist-GGfaJ3R1.js → dist-CQxqEb-6.js} +6 -6
  30. package/dist/browser/{dist-BjN1ZtXO.js → dist-D-q_r1-V.js} +5 -5
  31. package/dist/browser/{dist-DA_O1Tq9.js → dist-DBuzYqpa.js} +3 -3
  32. package/dist/browser/{efp-debug-init-DCZ0v67W.js → efp-debug-init-Co9uXMuX.js} +3 -3
  33. package/dist/browser/{enum-editor-D1zVwP8a.js → enum-editor-LWVu-JIK.js} +4 -4
  34. package/dist/browser/{es5-483Ipz8U.js → es5-DGb5TwpZ.js} +2 -2
  35. package/dist/browser/{event-not-found-DIS2DLhg.js → event-not-found-zFibfbER.js} +1 -1
  36. package/dist/browser/{exports-CNZZj_Q8.js → exports-B-6KjI9h.js} +1 -1
  37. package/dist/browser/{favicon-Bg6LMWEn.js → favicon-CWCPCNM-.js} +1 -1
  38. package/dist/browser/{fetch-retry.umd-DEbZQzJ3.js → fetch-retry.umd-kGON8ji6.js} +2 -2
  39. package/dist/browser/{flex-B9PF9U8h.js → flex-DqcWgHRa.js} +5 -5
  40. package/dist/browser/{floorplan.loader-G3m0klqz.js → floorplan.loader-BRvRi40U.js} +10 -10
  41. package/dist/browser/{floorplan.ready-CcBm3z9I.js → floorplan.ready-B9-MIw8B.js} +181 -181
  42. package/dist/browser/{fuse-Be1ke9wH.js → fuse-BXW5RuhW.js} +2 -2
  43. package/dist/browser/{i18n-892OGllH.js → i18n-D80X6LMz.js} +9 -7
  44. package/dist/browser/index.js +14 -14
  45. package/dist/browser/{index.module-DBPl3snb.js → index.module-DNr0maw3.js} +4 -4
  46. package/dist/browser/{integrateKiosk-Dau_WEaC.js → integrateKiosk-BL84U1ZL.js} +4 -4
  47. package/dist/browser/{is-webview-ElzsMr4s.js → is-webview-CA6ivKK_.js} +1 -1
  48. package/dist/browser/{jsx-runtime-BsOtCifA.js → jsx-runtime-BT50TP7_.js} +2 -2
  49. package/dist/browser/{kiosk-record-BTQRhXdb.js → kiosk-record-QoK8Mq08.js} +1 -1
  50. package/dist/browser/{lib-CurNQ8fT.js → lib-Dn401ByH.js} +3 -3
  51. package/dist/browser/{loadImage-wPuY8HVi.js → loadImage-BaHKwI_N.js} +4 -4
  52. package/dist/browser/{logDeviceInfo-bDJ_gaMR.js → logDeviceInfo-Btc7mU_S.js} +9 -9
  53. package/dist/browser/{mobx-CoCB6VaY.js → mobx-c2h1ijB_.js} +4 -4
  54. package/dist/browser/{optional-boolean-editor-WRwLbFlO.js → optional-boolean-editor-DkXbwHPW.js} +3 -3
  55. package/dist/browser/{optional-enum-editor-C1ENUhhf.js → optional-enum-editor-D6J8s67w.js} +4 -4
  56. package/dist/browser/{optional-string-editor-CNEl6U5Q.js → optional-string-editor-DvlDx9cr.js} +4 -4
  57. package/dist/browser/{particles.min-BRguaqtu.js → particles.min-BlF_1zig.js} +2 -2
  58. package/dist/browser/{react-BQN6EStf.js → react-CTNuj5uG.js} +2 -2
  59. package/dist/browser/{react-dom-C7Pf2opy.js → react-dom-Dd-QC57h.js} +3 -3
  60. package/dist/browser/{rolldown-runtime-DBeIQt3E.js → rolldown-runtime-BkVgj4VA.js} +1 -1
  61. package/dist/browser/{scheduler-cQidETRd.js → scheduler-BGogpU6B.js} +2 -2
  62. package/dist/browser/{select-CIJMgtRk.js → select-CNUhWDWs.js} +10 -10
  63. package/dist/browser/{settings-tf2xCh7a.js → settings-DNaOj9LN.js} +2 -2
  64. package/dist/browser/{settings-item-Dhd_mZVD.js → settings-item-Bb1ifzkN.js} +6 -6
  65. package/dist/browser/{store-DX_d1X7a.js → store-CpViG4ds.js} +6347 -5720
  66. package/dist/browser/{string-editor-CwZhPArg.js → string-editor-BwfOcpmc.js} +4 -4
  67. package/dist/browser/{text-field-DbPC6Ytx.js → text-field-BS3w11vk.js} +5 -5
  68. package/dist/browser/{theme-EiHUjgfX.js → theme-jH8ml6K6.js} +8 -8
  69. package/dist/browser/{ui-BCJ-P-pD.js → ui-Bbl-WJZx.js} +8 -8
  70. package/dist/browser/{useRenderTarget-DkMzI2QA.js → useRenderTarget-BX8tGScr.js} +4 -4
  71. package/dist/browser/{viewport-BldgkO7x.js → viewport-COvScbd2.js} +3 -3
  72. package/dist/esm/components/Kiosk/ShowKiosk.d.ts +1 -2
  73. package/dist/esm/components/Kiosk/ShowKiosk.js +1 -1
  74. package/dist/esm/components/Kiosk/kiosk-mode.d.ts +26 -0
  75. package/dist/esm/components/Kiosk/kiosk-mode.js +1 -1
  76. package/dist/esm/components/Map/Map.js +1 -1
  77. package/dist/esm/components/Map/MapCamera.js +1 -1
  78. package/dist/esm/components/Maplibre/MaplibreAdapter.d.ts +2 -2
  79. package/dist/esm/components/Maplibre/MaplibreAdapter.js +1 -1
  80. package/dist/esm/components/Maplibre/MaplibreWrapper.d.ts +17 -7
  81. package/dist/esm/components/Maplibre/MaplibreWrapper.js +1 -1
  82. package/dist/esm/components/Maplibre/utils/map-helpers.d.ts +14 -3
  83. package/dist/esm/components/Maplibre/utils/map-helpers.js +1 -1
  84. package/dist/esm/store/MaplibreStore.js +1 -1
  85. package/dist/esm/store/UIState.d.ts +49 -3
  86. package/dist/esm/store/UIState.js +1 -1
  87. package/dist/esm/store/init/init-ui.js +1 -1
  88. package/dist/esm/store/types.d.ts +12 -0
  89. package/dist/esm/utils/camera-map-settings.js +1 -1
  90. package/package.json +10 -10
@@ -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.34.2" };
4
+ e.SENTRY_RELEASE = { id: "3.35.0" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "edf52ee9-f3a6-424f-a5ff-f0c8342333ab", e._sentryDebugIdIdentifier = "sentry-dbid-edf52ee9-f3a6-424f-a5ff-f0c8342333ab");
7
7
  } catch {}
8
8
  })();
9
- import { t as e } from "./jsx-runtime-BsOtCifA.js";
10
- import { t } from "./settings-item-Dhd_mZVD.js";
11
- import { t as n } from "./text-field-DbPC6Ytx.js";
9
+ import { t as e } from "./jsx-runtime-BT50TP7_.js";
10
+ import { t } from "./settings-item-Bb1ifzkN.js";
11
+ import { t as n } from "./text-field-BS3w11vk.js";
12
12
  //#region ../debug/src/lib/ui/string-editor.tsx
13
13
  var r = e(), i = (e) => {
14
14
  var i;
@@ -1,15 +1,15 @@
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.34.2" };
4
+ e.SENTRY_RELEASE = { id: "3.35.0" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "b57a1337-f6ba-488a-8e6f-60f9358b45a2", e._sentryDebugIdIdentifier = "sentry-dbid-b57a1337-f6ba-488a-8e6f-60f9358b45a2");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-DBeIQt3E.js";
10
- import { t } from "./react-BQN6EStf.js";
11
- import { D as n, i as r, l as i, n as a, s as o, u as s, y as c } from "./flex-B9PF9U8h.js";
12
- import { t as l } from "./classnames-CpaGYtKG.js";
9
+ import { r as e } from "./rolldown-runtime-BkVgj4VA.js";
10
+ import { t } from "./react-CTNuj5uG.js";
11
+ import { D as n, i as r, l as i, n as a, s as o, u as s, y as c } from "./flex-DqcWgHRa.js";
12
+ import { t as l } from "./classnames-BS1IM9A-.js";
13
13
  //#region ../../node_modules/.pnpm/@radix-ui+themes@3.3.0_@types+react-dom@19.2.3_@types+react@19.2.17__@types+react@19.2._5ea800d4e947acedb1fa1275f1697b17/node_modules/@radix-ui/themes/dist/esm/components/text-field.props.js
14
14
  var u = /* @__PURE__ */ e(t()), d = /* @__PURE__ */ e(l()), f = {
15
15
  size: {
@@ -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.34.2" };
4
+ e.SENTRY_RELEASE = { id: "3.35.0" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "f5429b84-6f5b-4b20-898f-e5345902ef44", e._sentryDebugIdIdentifier = "sentry-dbid-f5429b84-6f5b-4b20-898f-e5345902ef44");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-DBeIQt3E.js";
10
- import { t } from "./react-BQN6EStf.js";
11
- import { t as n } from "./jsx-runtime-BsOtCifA.js";
12
- import { t as r } from "./react-dom-C7Pf2opy.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-B9PF9U8h.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-GGfaJ3R1.js";
15
- import { t as y } from "./classnames-CpaGYtKG.js";
9
+ import { r as e } from "./rolldown-runtime-BkVgj4VA.js";
10
+ import { t } from "./react-CTNuj5uG.js";
11
+ import { t as n } from "./jsx-runtime-BT50TP7_.js";
12
+ import { t as r } from "./react-dom-Dd-QC57h.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-DqcWgHRa.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-CQxqEb-6.js";
15
+ import { t as y } from "./classnames-BS1IM9A-.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.34.2" };
4
+ e.SENTRY_RELEASE = { id: "3.35.0" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "cbb5c555-77ff-4375-8420-80c8ae476dcf", e._sentryDebugIdIdentifier = "sentry-dbid-cbb5c555-77ff-4375-8420-80c8ae476dcf");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-DBeIQt3E.js";
10
- import { a as t, i as n, s as r } from "./efp-debug-init-DCZ0v67W.js";
11
- import { a as i, i as a } from "./adopt-global-settings-BZ0kVMK5.js";
12
- import { t as o } from "./jsx-runtime-BsOtCifA.js";
13
- import "./settings-tf2xCh7a.js";
14
- import { t as s } from "./add-debug-secret-listener-DzuQqBnc.js";
9
+ import { r as e } from "./rolldown-runtime-BkVgj4VA.js";
10
+ import { a as t, i as n, s as r } from "./efp-debug-init-Co9uXMuX.js";
11
+ import { a as i, i as a } from "./adopt-global-settings-d5uyY5A6.js";
12
+ import { t as o } from "./jsx-runtime-BT50TP7_.js";
13
+ import "./settings-DNaOj9LN.js";
14
+ import { t as s } from "./add-debug-secret-listener-veloxngO.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-D4mq0ugA.js"), { createRoot: i } = await import("./client-hdZ-mqt7.js").then((t) => /* @__PURE__ */ e(t.t(), 1)), a = document.createElement("div");
29
+ let { DebugUi: n } = await import("./debug-ui-CWBuocQN.js"), { createRoot: i } = await import("./client-ezZAHjfj.js").then((t) => /* @__PURE__ */ e(t.t(), 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.34.2" };
4
+ e.SENTRY_RELEASE = { id: "3.35.0" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "7407e64e-4c4e-4bfb-b2ef-80063ad22998", e._sentryDebugIdIdentifier = "sentry-dbid-7407e64e-4c4e-4bfb-b2ef-80063ad22998");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-DBeIQt3E.js";
10
- import { t } from "./react-BQN6EStf.js";
11
- import { l as n } from "./store-DX_d1X7a.js";
9
+ import { r as e } from "./rolldown-runtime-BkVgj4VA.js";
10
+ import { t } from "./react-CTNuj5uG.js";
11
+ import { l as n } from "./store-CpViG4ds.js";
12
12
  //#region ../ui/src/shared/activeElement.ts
13
13
  var r = (e) => !!e && "activeElement" in e;
14
14
  function i(e) {
@@ -1,12 +1,12 @@
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.34.2" };
4
+ e.SENTRY_RELEASE = { id: "3.35.0" };
5
5
  var t = new e.Error().stack;
6
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "a86b34fc-4db5-43a7-965f-2af06c6fef45", e._sentryDebugIdIdentifier = "sentry-dbid-a86b34fc-4db5-43a7-965f-2af06c6fef45");
6
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "444f9271-dd41-4d29-81a9-c2a30e2274e9", e._sentryDebugIdIdentifier = "sentry-dbid-444f9271-dd41-4d29-81a9-c2a30e2274e9");
7
7
  } catch {}
8
8
  })();
9
- import { c as e, mt as t } from "./store-DX_d1X7a.js";
9
+ import { c as e, ht as t } from "./store-CpViG4ds.js";
10
10
  //#region src/components/Map/viewport.ts
11
11
  function n(e) {
12
12
  return {
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
- declare const ShowKiosk: React.FunctionComponent<object>;
1
+ declare const ShowKiosk: import("react").FunctionComponent<object>;
3
2
  export default ShowKiosk;
4
3
  //# sourceMappingURL=ShowKiosk.d.ts.map
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import{getConfig as s}from"@expofp/config";import{TouchHand as a}from"@expofp/ui";import{observer as m}from"mobx-react-lite";import{KIOSK_ENABLE_KEY as n}from"../../constants";import t from"../../store";import{useInit as k}from"../../utils/mobx";import{integrateKioskIntoMap as u,integrateKioskIntoWf as f}from"./integrateKiosk";import e from"./KioskStore";const l=m(()=>(k(()=>{if(localStorage.getItem(n)==="0")return;e.restoreData();let o=e.kiosk;if(!o){const i=s().kiosk;Object.keys(i).length&&(e.setKiosk(i),t.uiState.kiosk=!0,Number.isFinite(i.uiScale)&&t.uiState.setUIScale(i.uiScale,!1),o=e.kiosk)}if(o)return u(o,!0),f(o),e.resetCamera(),t.setResetCameraFn(()=>e.resetCamera()),()=>{t.uiState.setKioskData(null),t.uiState.resetMapSettings()}}),t.uiState.kiosk&&t.uiState.inIdle?r(a,{}):null));export default l;
1
+ import{jsx as o}from"react/jsx-runtime";import{getConfig as s}from"@expofp/config";import{TouchHand as a}from"@expofp/ui";import{observer as m}from"mobx-react-lite";import{KIOSK_ENABLE_KEY as n}from"../../constants";import t from"../../store";import{useInit as f}from"../../utils/mobx";import{integrateKioskIntoMap as u,integrateKioskIntoWf as k}from"./integrateKiosk";import{screenFitsKiosk as l}from"./kiosk-mode";import i from"./KioskStore";const S=m(()=>(f(()=>{if(localStorage.getItem(n)==="0"||!l(t.uiState))return;i.restoreData();let e=i.kiosk;if(!e){const r=s().kiosk;Object.keys(r).length&&(e=r,Number.isFinite(r.uiScale)&&t.uiState.setUIScale(r.uiScale,!1))}if(e)return u(e,!0),k(e),i.resetCamera(),t.setResetCameraFn(()=>i.resetCamera()),()=>{t.uiState.setKioskData(null),t.uiState.resetMapSettings()}}),t.uiState.kiosk&&t.uiState.inIdle?o(a,{}):null));export default S;
@@ -1,8 +1,34 @@
1
1
  import type UIState from '../../store/UIState';
2
+ /**
3
+ * Whether this plan has room for the kiosk layout.
4
+ *
5
+ * Kiosk mode forces the left overlay, which is 450px wide — so it may only run
6
+ * where that layout would have been chosen anyway. `UIState.overlayPosition`
7
+ * asks this same question and calls this, which is what keeps the two answers
8
+ * from drifting apart.
9
+ *
10
+ * The guard exists because kiosk mode reaches devices that never asked for it.
11
+ * A route QR hands its `kiosk_x/y/z` anchor to every scanning phone, and
12
+ * `uiState.kioskData` doubles as "this device IS a kiosk" (see `kioskUrlParam`),
13
+ * so the phone adopts the whole kiosk boot: a left overlay wider than its screen,
14
+ * which collapses the map's framing region to a sliver and leaves any route it
15
+ * was opened for zoomed out to nothing.
16
+ *
17
+ * Measured off the width of the container the plan was handed, not the window —
18
+ * that is what `screenSize` holds (`bindRootElement`), and the overlay lives in
19
+ * the container. Width alone, as `overlayPosition` reads it: a phone held in
20
+ * landscape passes, being as wide as a small desktop window and getting the same
21
+ * layout, and every real kiosk panel passes in either orientation.
22
+ */
23
+ export declare function screenFitsKiosk(uiState: UIState): boolean;
2
24
  /**
3
25
  * Toggle kiosk mode — the single meaning of `kiosk=1` / `kiosk=0` from either
4
26
  * channel (the `?kiosk=` URL param, the typed search-box command). Exit also
5
27
  * resets the per-device UI scale; init-ui's reaction persists the choice.
28
+ *
29
+ * Turning it ON is refused where the kiosk layout does not fit
30
+ * ({@link screenFitsKiosk}); turning it OFF always works, so the `kiosk=0`
31
+ * opt-out can never be locked out by the size of the screen it is typed on.
6
32
  */
7
33
  export declare function applyKioskMode(uiState: UIState, enabled: boolean): void;
8
34
  //# sourceMappingURL=kiosk-mode.d.ts.map
@@ -1 +1 @@
1
- export function applyKioskMode(o,i){o.kiosk=i,i||o.resetUIScale()}
1
+ import{untracked as i}from"mobx";import{MOBILE_BREAKPOINT as o}from"../../constants";import n from"../../tools/logger";export function screenFitsKiosk(r){return r.screenSize.width>o}export function applyKioskMode(r,e){e&&i(()=>t(r))||(r.kiosk=e,e||r.resetUIScale())}function t(r){return screenFitsKiosk(r)?!1:(n.warn(`Kiosk mode refused: the plan is ${r.screenSize.width}px wide, and the kiosk layout needs more than ${o}px.`),!0)}
@@ -1 +1 @@
1
- import{jsx as h,jsxs as _}from"react/jsx-runtime";import{Renderer as F,update as b}from"@expofp/renderer";import D from"classnames";import{observable as N}from"mobx";import{useObserver as g}from"mobx-react-lite";import{useEffect as y,useMemo as O,useRef as v,useState as z}from"react";import k from"../../data";import{svgArea as j}from"../../data/svg";import{createSceneDef as I}from"../../engine/defs";import i,{layersStore as d,uiState as m}from"../../store";import f from"../../tools/settings";import{applyVenueDim as V,createDimmingAnimator as Z}from"../../utils/dimming";import x from"../../utils/is-debug";import{isPathwayLayer as C}from"../../utils/is-pathway-layer";import{useReaction as R}from"../../utils/mobx";import{createWayfinding as $}from"../../wayfinding";import U from"./drawing/config/config-all";import{configMarkers as W}from"./drawing/config/config-markers";import{loadLayersImages as X}from"./drawing/config/loadBoothsImages";import{MapCamera as B}from"./MapCamera";import{MapCursorCoords as H}from"./MapCursorCoords";import{MapViewport as G}from"./MapViewport";import{clearSelection as J}from"./pointer";import{setMapScene as E}from"./scene";import{useBuildRoute as q}from"./traffic/useBuildRoute";import{useManageTraffic as K}from"./traffic/useManageTraffic";import{centerCoordinates as Q}from"./viewport";const Y="#ebebeb",M="routes-api.expofp.com",ee=1e4;function re(t){return Number.isFinite(f.maxZoom)?f.maxZoom:t.viewbox.size.width>ee?100:35}function oe(){if(!i.fp.enableRotation)return!1;const t=m.mapSettings.roll;return t===void 0||Number(t)===1}function te(){return f.EXPO==="imexamerica25-3d"?!0:void 0}function ne(){const t=m.mapSettings.zoomtime;if(!(!t||t===m.defaultMapSettings.zoomtime))return{zoomTime:t/1e3}}export default function ie(){const t=v(null),l=O(()=>N({moving:!1,prevLevel:i.layerStore.layers.find(r=>!r.frozen&&r.visible)}),[]),[o,T]=z(void 0),c=v(null),p=v(null);function L(){d.layers.forEach(r=>{r.configured=!1,r.children=[],r.loaded=!1})}y(()=>{let r=!1;return L(),d.layersLoaded=!1,U().then(({layers:s,cleanup:a})=>{if(r){a();return}p.current=a;const n=f.backgroundColor==="none"?Y:f.backgroundColor,e=I(s,j,n);T(e),E(e),c.current=Z(u=>{V(e,u)&&b(e.rootLayer)}),c.current.setTarget(m.dimmed,{immediate:!0}),d.layersLoaded=!0,i.fp.onFpConfigured&&i.fp.onFpConfigured(),X()}),()=>{r=!0,p.current?.(),p.current=null,c.current?.stop(),c.current=null,E(void 0),L()}},[]),R(()=>m.dimmed,r=>{c.current?.setTarget(r)}),y(()=>{i.fp.getCenterCoordinates=()=>Q(t.current)},[]),y(()=>{if(!o)return;const r=$({scene:o,store:i,canvas:t}),s=W({scene:o});return()=>{r(),s()}},[o]),R(()=>i.routeStore.currentRouteLayer,()=>{const r=i.routeStore.currentRouteLayer;if(!o||!r||l.prevLevel===r)return;const s=o.rootLayer.children.filter(e=>i.layerStore.floors.some(u=>e.name.includes(u.name))),a=r.name;if(!s.find(e=>e.name===a))return;const n=[];s.forEach(e=>{e.name===a&&e.hidden!==!1&&(e.hidden=!1,n.push(e)),e.name===l.prevLevel?.name&&e.hidden!==!0&&(e.hidden=!0,n.push(e))}),l.prevLevel=r,n.length&&b(...n)},void 0,[o]),R(()=>i.layerStore.visible,r=>{if(!o)return;const s=r.filter(e=>C(e.name)),a=o.rootLayer.children,n=[];for(const e of a){if(!C(e.name))continue;const u=!s.find(P=>P.name===e.name);e.hidden!==u&&(e.hidden=u,n.push(e))}n.length&&b(...n)},void 0,[o]);const S=g(()=>d.layersLoaded),w=g(()=>!!m.buildRoute);q({enabled:S&&w,scene:o});const A=k.busRoutes??!1;return K({permission:S&&A,scene:o,dataJsonUrl:`https://${M}/v1/routes?expo=${f.EXPO}`,websocketUrl:`wss://${M}/locations?expo=${f.EXPO}`}),g(()=>o?_(F,{debug:x,style:{width:"100%",height:"100%"},ref:t,className:D({map:!0}),scene:o,maxZoom:re(o),bounds:d.bounds,controls:{roll:oe(),pitch:te()},smoothTime:ne(),visibleRect:m.canvasVisibleRectPx,onPointerMissed:J,children:[h(B,{}),h(G,{}),x&&h(H,{canvas:t})]}):null)}
1
+ import{jsx as h,jsxs as _}from"react/jsx-runtime";import{Renderer as F,update as b}from"@expofp/renderer";import D from"classnames";import{observable as N}from"mobx";import{useObserver as g}from"mobx-react-lite";import{useEffect as y,useMemo as O,useRef as v,useState as k}from"react";import j from"../../data";import{svgArea as z}from"../../data/svg";import{createSceneDef as I}from"../../engine/defs";import i,{layersStore as l,uiState as a}from"../../store";import u from"../../tools/settings";import{applyVenueDim as V,createDimmingAnimator as Z}from"../../utils/dimming";import S from"../../utils/is-debug";import{isPathwayLayer as C}from"../../utils/is-pathway-layer";import{useReaction as L}from"../../utils/mobx";import{createWayfinding as $}from"../../wayfinding";import U from"./drawing/config/config-all";import{configMarkers as W}from"./drawing/config/config-markers";import{loadLayersImages as B}from"./drawing/config/loadBoothsImages";import{MapCamera as H}from"./MapCamera";import{MapCursorCoords as X}from"./MapCursorCoords";import{MapViewport as G}from"./MapViewport";import{clearSelection as J}from"./pointer";import{setMapScene as E}from"./scene";import{useBuildRoute as q}from"./traffic/useBuildRoute";import{useManageTraffic as K}from"./traffic/useManageTraffic";import{centerCoordinates as Q}from"./viewport";const Y="#ebebeb",T="routes-api.expofp.com",ee=1e4;function re(n){return Number.isFinite(u.maxZoom)?u.maxZoom:n.viewbox.size.width>ee?100:35}function oe(){const{zoomtime:n,pitchtime:f}=a.mapSettings;return{zoomTime:n===void 0?void 0:n/1e3,pitchTime:f===void 0?void 0:f/1e3}}export default function te(){const n=v(null),f=O(()=>N({moving:!1,prevLevel:i.layerStore.layers.find(r=>!r.frozen&&r.visible)}),[]),[o,M]=k(void 0),d=v(null),p=v(null);function R(){l.layers.forEach(r=>{r.configured=!1,r.children=[],r.loaded=!1})}y(()=>{let r=!1;return R(),l.layersLoaded=!1,U().then(({layers:s,cleanup:m})=>{if(r){m();return}p.current=m;const t=u.backgroundColor==="none"?Y:u.backgroundColor,e=I(s,z,t);M(e),E(e),d.current=Z(c=>{V(e,c)&&b(e.rootLayer)}),d.current.setTarget(a.dimmed,{immediate:!0}),l.layersLoaded=!0,i.fp.onFpConfigured&&i.fp.onFpConfigured(),B()}),()=>{r=!0,p.current?.(),p.current=null,d.current?.stop(),d.current=null,E(void 0),R()}},[]),L(()=>a.dimmed,r=>{d.current?.setTarget(r)}),y(()=>{i.fp.getCenterCoordinates=()=>Q(n.current)},[]),y(()=>{if(!o)return;const r=$({scene:o,store:i,canvas:n}),s=W({scene:o});return()=>{r(),s()}},[o]),L(()=>i.routeStore.currentRouteLayer,()=>{const r=i.routeStore.currentRouteLayer;if(!o||!r||f.prevLevel===r)return;const s=o.rootLayer.children.filter(e=>i.layerStore.floors.some(c=>e.name.includes(c.name))),m=r.name;if(!s.find(e=>e.name===m))return;const t=[];s.forEach(e=>{e.name===m&&e.hidden!==!1&&(e.hidden=!1,t.push(e)),e.name===f.prevLevel?.name&&e.hidden!==!0&&(e.hidden=!0,t.push(e))}),f.prevLevel=r,t.length&&b(...t)},void 0,[o]),L(()=>i.layerStore.visible,r=>{if(!o)return;const s=r.filter(e=>C(e.name)),m=o.rootLayer.children,t=[];for(const e of m){if(!C(e.name))continue;const c=!s.find(A=>A.name===e.name);e.hidden!==c&&(e.hidden=c,t.push(e))}t.length&&b(...t)},void 0,[o]);const x=g(()=>l.layersLoaded),P=g(()=>!!a.buildRoute);q({enabled:x&&P,scene:o});const w=j.busRoutes??!1;return K({permission:x&&w,scene:o,dataJsonUrl:`https://${T}/v1/routes?expo=${u.EXPO}`,websocketUrl:`wss://${T}/locations?expo=${u.EXPO}`}),g(()=>o?_(F,{debug:S,style:{width:"100%",height:"100%"},ref:n,className:D({map:!0}),scene:o,maxZoom:re(o),maxPitch:a.maxPitch,bounds:l.bounds,controls:{roll:a.rollEnabled,pitch:a.pitchEnabled},smoothTime:oe(),visibleRect:a.canvasVisibleRectPx,onPointerMissed:J,children:[h(H,{}),h(G,{}),S&&h(X,{canvas:n})]}):null)}
@@ -1 +1 @@
1
- import{Box as u}from"@expofp/geometry";import{useCameraAPI as g,useCameraMoveStart as y,useCameraState as x}from"@expofp/renderer";import{useEffect as R,useLayoutEffect as T,useRef as B,useState as M}from"react";import{fpGeo as S}from"../../data/fpGeo";import{svgArea as P}from"../../data/svg";import p,{uiState as r}from"../../store";import{BoothBase as C}from"../../store/BoothStore";import l from"../../tools/logger";import F from"../../tools/settings";import{areLayersEnabled as w}from"../../utils/areLayersEnabled";import{parseNumberPair as d}from"../../utils/camera-map-settings";import{convertGpsToLocal as z}from"../../utils/gps";import{useOneShotReaction as f,useReaction as E}from"../../utils/mobx";import{createMapCamera as N,setMapCamera as v}from"./camera";import{notifyCameraMoved as b}from"./camera-events";import{resetExternalOverlay as k}from"./pointer";export function MapCamera(){const o=g(),n=x(),t=B({api:o,state:n}),[a]=M(()=>N(t));return T(()=>{t.current={api:o,state:n}}),R(()=>(v(a),()=>v(void 0)),[a]),y(()=>{k(),b()}),f(()=>r.zoomBy,e=>{e&&(t.current.api.zoomBy(e),r.zoomBy=null)},[]),f(()=>r.rollReset,e=>{e&&(t.current.api.reset({roll:!0}),r.rollReset=!1)},[]),f(()=>r.centerMap,e=>{e&&(t.current.api.reset({zoom:!!(r.list.type==="search"&&r.list.text)}),r.centerMap=!1)},[]),f(()=>r.moveToRect,e=>{if(!e)return;const{width:m,height:i}=e.size;m>0&&i>0&&Number.isFinite(m)&&Number.isFinite(i)&&h(t.current.api,e,r.moveToRectPaddingPercent??void 0),r.moveToRect=null,r.moveToRectPaddingPercent=null},[]),f(()=>r.moveToBooths,e=>{if(!e)return;l.log("watched moveToBooths",e);const m=e.filter(i=>i.rect).map(i=>i.rect);m.length&&h(t.current.api,u.fromUnion(...m)),r.moveToBooths=null},[]),E(()=>r.mapSettings,({center:e,centerxy:m,bearing:i,z:c})=>{try{c&&p.fp.activateFloor({name:c});const s=O(e,m);s&&t.current.api.panTo(s),Number.isFinite(i)&&t.current.api.rollTo(i)}catch(s){l.error("Error in mapSettings reaction",s)}},void 0,[]),null}function h(o,n,t){o.zoomTo(G(n),{padding:t??A(n,P),maxZoom:Number.isFinite(F.maxZoom)?void 0:10,within:L()})}function L(){const o=r.canvasVisibleRectPx;return r.shouldShiftMapRect?u.fromMinMax({x:o.min.x+r.overlayWidthPx,y:o.min.y},o.max):o}function G(o){const n=r.kioskData;if(!n)return o;const t=r.selectedRoute?.from,a=t instanceof C?t.layer?.name:t?.layer;return(w()?a===p.routeStore.currentRouteLayer?.name:!0)?u.fromUnion(o,new u(n.x,n.y,1,1)):o}function A(o,n){return!o||!n?0:(o.area/n.area>.1?15:25)/100}function O(o,n){if(o){const a=d(o);if(!a)return;const e=S?.properties?.config;if(!e)throw new Error("Map center given in GPS, but the plan has no GPS config");return z({lat:a[0],lng:a[1]},e)??void 0}const t=d(n);if(t)return{x:t[0],y:t[1]}}
1
+ import{Box as s}from"@expofp/geometry";import{useCameraAPI as g,useCameraMoveStart as x,useCameraState as R}from"@expofp/renderer";import{useEffect as T,useLayoutEffect as B,useRef as M,useState as P}from"react";import{fpGeo as S}from"../../data/fpGeo";import{svgArea as F}from"../../data/svg";import l,{uiState as e}from"../../store";import{BoothBase as C}from"../../store/BoothStore";import d from"../../tools/logger";import w from"../../tools/settings";import{areLayersEnabled as N}from"../../utils/areLayersEnabled";import{parseNumberPair as v}from"../../utils/camera-map-settings";import{convertGpsToLocal as z}from"../../utils/gps";import{useOneShotReaction as f}from"../../utils/mobx";import{createMapCamera as E,setMapCamera as h}from"./camera";import{notifyCameraMoved as b}from"./camera-events";import{resetExternalOverlay as k}from"./pointer";export function MapCamera(){const t=g(),n=R(),r=M({api:t,state:n}),[a]=P(()=>E(r));return B(()=>{r.current={api:t,state:n}}),T(()=>(h(a),()=>h(void 0)),[a]),x(()=>{k(),b()}),f(()=>e.zoomBy,o=>{o&&(r.current.api.zoomBy(o),e.zoomBy=null)},[]),f(()=>e.rollReset,o=>{o&&(r.current.api.reset({roll:!0}),e.rollReset=!1)},[]),f(()=>e.centerMap,o=>{o&&(r.current.api.reset({zoom:!!(e.list.type==="search"&&e.list.text)}),e.centerMap=!1)},[]),f(()=>e.moveToRect,o=>{if(!o)return;const{width:m,height:i}=o.size;m>0&&i>0&&Number.isFinite(m)&&Number.isFinite(i)&&y(r.current.api,o,e.moveToRectPaddingPercent??void 0),e.moveToRect=null,e.moveToRectPaddingPercent=null},[]),f(()=>e.moveToBooths,o=>{if(!o)return;d.log("watched moveToBooths",o);const m=o.filter(i=>i.rect).map(i=>i.rect);m.length&&y(r.current.api,s.fromUnion(...m)),e.moveToBooths=null},[]),f(()=>e.mapSettings,({center:o,centerxy:m,bearing:i,pitchdegrees:c,z:p})=>{try{p&&l.fp.activateFloor({name:p});const u=O(o,m);u&&r.current.api.panTo(u),i!==void 0&&Number.isFinite(i)&&r.current.api.rollTo(i),c!=null&&Number.isFinite(c)&&r.current.api.pitchTo(c,{immediate:!e.animatePitch})}catch(u){d.error("Error in mapSettings reaction",u)}},[]),null}function y(t,n,r){t.zoomTo(G(n),{padding:r??A(n,F),maxZoom:Number.isFinite(w.maxZoom)?void 0:10,within:L()})}function L(){const t=e.canvasVisibleRectPx;return e.shouldShiftMapRect?s.fromMinMax({x:t.min.x+e.overlayWidthPx,y:t.min.y},t.max):t}function G(t){const n=e.kioskData;if(!n)return t;const r=e.selectedRoute?.from,a=r instanceof C?r.layer?.name:r?.layer;return(N()?a===l.routeStore.currentRouteLayer?.name:!0)?s.fromUnion(t,new s(n.x,n.y,1,1)):t}function A(t,n){return!t||!n?0:(t.area/n.area>.1?15:25)/100}function O(t,n){if(t){const a=v(t);if(!a)return;const o=S?.properties?.config;if(!o)throw new Error("Map center given in GPS, but the plan has no GPS config");return z({lat:a[0],lng:a[1]},o)??void 0}const r=v(n);if(r)return{x:r[0],y:r[1]}}
@@ -7,8 +7,8 @@ import { type MaplibreViewMode } from '../../store/MaplibreStore';
7
7
  * standalone map wires through defs works identically here: picking through the layers' own
8
8
  * handlers, label re-layout through `onScale`, counter-rotation through `onRoll` measured off the
9
9
  * map's matrix every frame — no rotate listeners, no scale registries, no roll sync. Reused
10
- * renderer config modules still read singleton stores internally; MaplibreWrapper itself remains
11
- * pure and decoupled from application state.
10
+ * renderer config modules still read singleton stores internally, and MaplibreWrapper reads
11
+ * `uiState.pitchEnabled` for the tilt gesture; everything else reaches it as props.
12
12
  */
13
13
  interface MaplibreAdapterProps {
14
14
  viewMode: MaplibreViewMode;
@@ -1 +1 @@
1
- import{jsx as w,jsxs as H}from"react/jsx-runtime";import{isLayerDefs as Q}from"@expofp/renderer";import Y from"color";import{runInAction as q}from"mobx";import{observer as ee}from"mobx-react-lite";import{useCallback as F,useEffect as h,useMemo as m,useRef as f,useState as k}from"react";import re from"../../data";import{getLayerSvg as te,svgArea as C,svgAreaExplicit as oe}from"../../data/svg";import{createSceneDef as ne}from"../../engine/defs";import t,{uiState as c}from"../../store";import M from"../../tools/settings";import j from"../../utils/is-debug";import{fitRectIsFraming as ie,getVenueFitMarginPercent as ae,resolveVenueFitRect as ce}from"../../utils/scene-bounds";import se from"../Map/drawing/config/config-all";import{loadLayersImages as le}from"../Map/drawing/config/loadBoothsImages";import{MapCursorCoords as ue}from"../Map/MapCursorCoords";import{MapViewport as me}from"../Map/MapViewport";import{clearSelection as fe}from"../Map/pointer";import{setMapScene as $}from"../Map/scene";import{useBuildRoute as pe}from"../Map/traffic/useBuildRoute";import{useManageTraffic as de}from"../Map/traffic/useManageTraffic";import{centerCoordinates as ge}from"../Map/viewport";import be from"./MaplibreWrapper";import{useCameraReactions as Se}from"./useCameraReactions";import{useDimming as ye}from"./useDimming";import{useKioskIdleEvents as Re}from"./useKioskIdleEvents";import{useLayerVisibilitySync as he}from"./useLayerVisibilitySync";import{usePoiMarkers as Ce}from"./usePoiMarkers";import{useWayfindingAndMarkers as Me}from"./useWayfindingAndMarkers";import{cameraForLocalRect as Ae,deriveGeoConfig as Le,getLocalRectGeoBounds as Pe,getVisibleRectFitPadding as De,INITIAL_FIT_ZOOM_ADJUSTMENT as ve}from"./utils/geo-config";import{applyMapOptions as V,DEFAULT_MAP_OPTIONS as ze,getTileSource as Te,MAP_2D_OPTIONS as Oe}from"./utils/map-helpers";import{calculateTransformMatrix as Ee}from"./utils/solver";const N="routes-api.expofp.com",xe=800;function Ie(i,b,s){return{getCameraState:()=>{const o=i.getCenter();return{lng:o.lng,lat:o.lat,zoom:i.getZoom(),bearing:i.getBearing(),pitch:i.getPitch()}},applyCameraState:o=>{i.easeTo({center:[o.lng,o.lat],zoom:o.zoom,bearing:o.bearing??b,pitch:o.pitch??s(),duration:xe,essential:!0})},resetPitch:()=>{const o=s();i.getPitch()!==o&&i.jumpTo({pitch:o})}}}function U(){t.poiMarkerStore.clear(),q(()=>{t.layerStore.layers.forEach(i=>{i.configured=!1,i.children=[],i.loaded=!1}),t.layerStore.layersLoaded=!1})}const _e=ee(function({viewMode:b}){const[s,o]=k(null),[v,z]=k(!1),u=f(null),p=f(null),A=f(null),T=f(null),S=f(null),r=m(()=>Le(),[]),L=m(()=>ce({layerViewbox:t.layerStore.viewboxRectangle,explicitArea:oe?C:null,layerRectangle:t.layerStore.rectangle,sceneDef:s,svgArea:C}),[s]),y=L.rect,d=m(()=>{if(!r)return null;const e=ie(L.source)?0:ae(y,C),n=De(0);e&&c.screenSize&&(n.left+=c.screenSize.width*e,n.right+=c.screenSize.width*e,n.top+=c.screenSize.height*e,n.bottom+=c.screenSize.height*e);const l=c.screenSize?Ae(y,r.gpsConfig,r.bearing,{width:c.screenSize.width,height:c.screenSize.height},n):null;return l?{center:l.center,bearing:r.bearing,zoom:l.zoom}:{center:r.center,bearing:r.bearing,zoom:r.zoom,bounds:Pe(y,r.gpsConfig),fitPadding:n,zoomAdjustment:ve}},[r,L,y]),R=m(()=>r?Ee(r.gpsConfig,te()?.getAttribute("units")):null,[r]),g=m(()=>({...b==="map2d"?Oe:ze}),[b]),P=f(g),B=m(()=>Te(),[]),a=m(()=>{if(!s||!R)return null;const e=s.rootLayer.children,n=Q(e)?e.filter(l=>l.name.toLowerCase()!=="areamap"):e;return{...s,rootLayer:{...s.rootLayer,children:n},background:void 0,staticTransform:R}},[s,R]),O=f(null);h(()=>{O.current=a},[a]),h(()=>{if(a)return $(a),()=>$(void 0)},[a]);const{mapDimAnimatorRef:E,venueDimAnimatorRef:x,applyDimmingTarget:I,handleMapDimLayerReady:G}=ye(u,O);h(()=>{if(!r)return;let e=!1;U(),se().then(({layers:D,cleanup:_})=>{if(e){_();return}A.current=_;const Z=Y(M.backgroundColor==="none"?"#ebebeb":M.backgroundColor).string();o(ne(D,C,Z))}).catch(D=>{e||console.warn("Maplibre scene configuration failed.",D)});const n=E.current,l=x.current;return()=>{e=!0,U(),A.current?.(),A.current=null,S.current&&(t.maplibreStore.clearCameraPortIfCurrent(S.current),S.current=null),u.current=null,p.current=null,T.current=null,z(!1),n?.stop(),l?.stop(),c.sceneDefReady=!1}},[r,E,x]);const J=F((e,n)=>{u.current=e,p.current=e.getCanvas(),T.current=n,z(!0),V(e,P.current);const l=Ie(e,r?.bearing??e.getBearing(),()=>P.current.pitch??0);S.current=l,t.maplibreStore.setCameraPort(l),t.fp.getCenterCoordinates=()=>ge(p.current),I({immediate:!0}),le(),t.layerStore.layersLoaded=!0,t.fp.onFpConfigured&&t.fp.onFpConfigured(),c.sceneDefReady=!0,n()},[I,r]);h(()=>{P.current=g,V(u.current,g,!0)},[g]),Re(v,u),Me(a,p),Ce(v,u,r),he(a,u,r),Se(u,r,a),pe({enabled:t.layerStore.layersLoaded&&c.buildRoute,scene:a??void 0});const K=re.busRoutes??!1;de({permission:t.layerStore.layersLoaded&&K,scene:a??void 0,dataJsonUrl:`https://${N}/v1/routes?expo=${M.EXPO}`,websocketUrl:`wss://${N}/locations?expo=${M.EXPO}`});const W=F(e=>{console.warn("Maplibre map failed to load; falling back to floorplan mode.",e),t.maplibreStore.deactivateMaplibre()},[]);if(!r||!d||!R||!a)return null;const X=`${d.center.join(",")}:${d.bearing}:${d.zoom}`;return H(be,{sceneDef:a,geoConfig:d,tileSource:B,mapOptions:g,debug:j,onMapReady:J,onMapDimLayerReady:G,onMapLoadError:W,onPointerMissed:fe,children:[w(me,{}),j&&w(ue,{canvas:p})]},X)});export default _e;
1
+ import{jsx as F,jsxs as Y}from"react/jsx-runtime";import{isLayerDefs as q}from"@expofp/renderer";import ee from"color";import{runInAction as re}from"mobx";import{observer as te}from"mobx-react-lite";import{useCallback as j,useEffect as R,useMemo as m,useRef as f,useState as $}from"react";import oe from"../../data";import{getLayerSvg as ne,svgArea as C,svgAreaExplicit as ie}from"../../data/svg";import{createSceneDef as ae}from"../../engine/defs";import t,{uiState as i}from"../../store";import M from"../../tools/settings";import V from"../../utils/is-debug";import{fitRectIsFraming as ce,getVenueFitMarginPercent as se,resolveVenueFitRect as le}from"../../utils/scene-bounds";import ue from"../Map/drawing/config/config-all";import{loadLayersImages as me}from"../Map/drawing/config/loadBoothsImages";import{MapCursorCoords as fe}from"../Map/MapCursorCoords";import{MapViewport as pe}from"../Map/MapViewport";import{clearSelection as de}from"../Map/pointer";import{setMapScene as B}from"../Map/scene";import{useBuildRoute as ge}from"../Map/traffic/useBuildRoute";import{useManageTraffic as be}from"../Map/traffic/useManageTraffic";import{centerCoordinates as Se}from"../Map/viewport";import he from"./MaplibreWrapper";import{useCameraReactions as ye}from"./useCameraReactions";import{useDimming as Re}from"./useDimming";import{useKioskIdleEvents as Ce}from"./useKioskIdleEvents";import{useLayerVisibilitySync as Me}from"./useLayerVisibilitySync";import{usePoiMarkers as Ae}from"./usePoiMarkers";import{useWayfindingAndMarkers as Le}from"./useWayfindingAndMarkers";import{cameraForLocalRect as Pe,deriveGeoConfig as ve,getLocalRectGeoBounds as ze,getVisibleRectFitPadding as De,INITIAL_FIT_ZOOM_ADJUSTMENT as xe}from"./utils/geo-config";import{applyMapOptions as N,getTileSource as Te,MAP_MIN_ZOOM as Ee}from"./utils/map-helpers";import{calculateTransformMatrix as Oe}from"./utils/solver";const U="routes-api.expofp.com",Ie=800;function we(a,b,s){return{getCameraState:()=>{const o=a.getCenter();return{lng:o.lng,lat:o.lat,zoom:a.getZoom(),bearing:a.getBearing(),pitch:a.getPitch()}},applyCameraState:o=>{a.easeTo({center:[o.lng,o.lat],zoom:o.zoom,bearing:o.bearing??b,pitch:o.pitch??s(),duration:Ie,essential:!0})},resetPitch:()=>{const o=s();a.getPitch()!==o&&a.jumpTo({pitch:o})}}}function Z(){t.poiMarkerStore.clear(),re(()=>{t.layerStore.layers.forEach(a=>{a.configured=!1,a.children=[],a.loaded=!1}),t.layerStore.layersLoaded=!1})}const _e=te(function({viewMode:b}){const[s,o]=$(null),[z,D]=$(!1),u=f(null),p=f(null),A=f(null),x=f(null),S=f(null),r=m(()=>ve(),[]),L=m(()=>le({layerViewbox:t.layerStore.viewboxRectangle,explicitArea:ie?C:null,layerRectangle:t.layerStore.rectangle,sceneDef:s,svgArea:C}),[s]),h=L.rect,d=m(()=>{if(!r)return null;const e=ce(L.source)?0:se(h,C),n=De(0);e&&i.screenSize&&(n.left+=i.screenSize.width*e,n.right+=i.screenSize.width*e,n.top+=i.screenSize.height*e,n.bottom+=i.screenSize.height*e);const l=i.screenSize?Pe(h,r.gpsConfig,r.bearing,{width:i.screenSize.width,height:i.screenSize.height},n):null;return l?{center:l.center,bearing:r.bearing,zoom:l.zoom}:{center:r.center,bearing:r.bearing,zoom:r.zoom,bounds:ze(h,r.gpsConfig),fitPadding:n,zoomAdjustment:xe}},[r,L,h]),y=m(()=>r?Oe(r.gpsConfig,ne()?.getAttribute("units")):null,[r]),T=i.mapSettings.pitchdegrees,E=i.maxPitch,g=m(()=>{const e=b==="map2d";return{pitch:e?0:T,maxPitch:e?0:E,minZoom:Ee}},[b,T,E]),P=f(g),G=m(()=>Te(),[]),c=m(()=>{if(!s||!y)return null;const e=s.rootLayer.children,n=q(e)?e.filter(l=>l.name.toLowerCase()!=="areamap"):e;return{...s,rootLayer:{...s.rootLayer,children:n},background:void 0,staticTransform:y}},[s,y]),O=f(null);R(()=>{O.current=c},[c]),R(()=>{if(c)return B(c),()=>B(void 0)},[c]);const{mapDimAnimatorRef:I,venueDimAnimatorRef:w,applyDimmingTarget:_,handleMapDimLayerReady:J}=Re(u,O);R(()=>{if(!r)return;let e=!1;Z(),ue().then(({layers:v,cleanup:k})=>{if(e){k();return}A.current=k;const Q=ee(M.backgroundColor==="none"?"#ebebeb":M.backgroundColor).string();o(ae(v,C,Q))}).catch(v=>{e||console.warn("Maplibre scene configuration failed.",v)});const n=I.current,l=w.current;return()=>{e=!0,Z(),A.current?.(),A.current=null,S.current&&(t.maplibreStore.clearCameraPortIfCurrent(S.current),S.current=null),u.current=null,p.current=null,x.current=null,D(!1),n?.stop(),l?.stop(),i.sceneDefReady=!1}},[r,I,w]);const K=j((e,n)=>{u.current=e,p.current=e.getCanvas(),x.current=n,D(!0),e.once("idle",()=>N(e,P.current));const l=we(e,r?.bearing??e.getBearing(),()=>P.current.pitch??0);S.current=l,t.maplibreStore.setCameraPort(l),t.fp.getCenterCoordinates=()=>Se(p.current),_({immediate:!0}),me(),t.layerStore.layersLoaded=!0,t.fp.onFpConfigured&&t.fp.onFpConfigured(),i.sceneDefReady=!0,n()},[_,r]);R(()=>{P.current=g,N(u.current,g)},[g]),Ce(z,u),Le(c,p),Ae(z,u,r),Me(c,u,r),ye(u,r,c),ge({enabled:t.layerStore.layersLoaded&&i.buildRoute,scene:c??void 0});const W=oe.busRoutes??!1;be({permission:t.layerStore.layersLoaded&&W,scene:c??void 0,dataJsonUrl:`https://${U}/v1/routes?expo=${M.EXPO}`,websocketUrl:`wss://${U}/locations?expo=${M.EXPO}`});const X=j(e=>{console.warn("Maplibre map failed to load; falling back to floorplan mode.",e),t.maplibreStore.deactivateMaplibre()},[]);if(!r||!d||!y||!c)return null;const H=`${d.center.join(",")}:${d.bearing}:${d.zoom}`;return Y(he,{sceneDef:c,geoConfig:d,tileSource:G,mapOptions:g,debug:V,onMapReady:K,onMapDimLayerReady:J,onMapLoadError:X,onPointerMissed:de,children:[F(pe,{}),V&&F(fe,{canvas:p})]},H)});export default _e;
@@ -39,12 +39,22 @@ export interface GeoConfig {
39
39
  /** Small correction after bounds-based initial fit. */
40
40
  zoomAdjustment?: number;
41
41
  }
42
+ /**
43
+ * The camera policy for a map: every field a caller decides.
44
+ *
45
+ * The props take a `Partial` of this, so a caller names only the fields it has decided. What it
46
+ * leaves out is left off the map's own options and MapLibre's default applies (`maxPitch` 60,
47
+ * `minZoom` 0, `maxZoom` 22, no bounds). This component defaults nothing itself.
48
+ */
42
49
  export interface MapOptions {
43
- pitch?: number;
44
- maxPitch?: number;
45
- minZoom?: number;
46
- maxZoom?: number;
47
- maxBounds?: LngLatBoundsLike;
50
+ /** Where the camera settles once the map is up, in degrees back from top down. */
51
+ pitch: number;
52
+ /** How far it may tilt back from top down, in degrees. */
53
+ maxPitch: number;
54
+ minZoom: number;
55
+ maxZoom: number;
56
+ /** Where the camera may pan. */
57
+ maxBounds: LngLatBoundsLike;
48
58
  }
49
59
  export interface MaplibreWrapperProps {
50
60
  /**
@@ -57,8 +67,8 @@ export interface MaplibreWrapperProps {
57
67
  geoConfig: GeoConfig;
58
68
  /** Tile source configuration (online style URL for now) */
59
69
  tileSource: TileSourceConfig;
60
- /** Map camera constraints and defaults */
61
- mapOptions?: MapOptions;
70
+ /** Map camera constraints and defaults; what is left out takes MapLibre's own default. */
71
+ mapOptions?: Partial<MapOptions>;
62
72
  /**
63
73
  * Mounts the renderer's debug overlay. Fixed for the wrapper's lifetime: when set, map creation
64
74
  * waits for `prepareDebug()`, so the map's context is created already instrumented and the
@@ -1 +1 @@
1
- import{jsx as w}from"react/jsx-runtime";import"maplibre-gl/dist/maplibre-gl.css";import{prepareDebug as Y,Renderer as q}from"@expofp/renderer";import{addProtocol as H,Map as J}from"maplibre-gl";import{Protocol as V}from"pmtiles";import{useEffect as T,useRef as l,useState as W}from"react";import{registerPmtilesArchive as K}from"./utils/pmtiles-range-fallback";import{createStyleTransform as Q}from"./utils/resolve-map-style";const $=['<a href="https://expofp.com" target="_blank">ExpoFP</a>','<a href="https://maplibre.org/" target="_blank">MapLibre</a>'];export const MAP_DIM_LAYER_ID="expofp-map-dim";const p="expofp-map-dim-source",v="3d-expofp";let y=null;const ee=["coalesce",["get","name:en"],["get","name_en"],["get","name:latin"],["get","name"]],te={type:"Feature",geometry:{type:"Polygon",coordinates:[[[-180,-85],[180,-85],[180,85],[-180,85],[-180,-85]]]},properties:{}};function z(e){if(!e||typeof e!="object")return!1;const o=e.length;if(typeof o!="number"||o<16)return!1;const r=e[0];return typeof r=="number"&&Number.isFinite(r)}function oe(e){if(z(e))return Array.from(e);const r=e?.defaultProjectionData?.mainMatrix;return z(r)?Array.from(r):(console.warn("Maplibre custom layer received an unsupported projection matrix payload.",e),null)}function g(e){return typeof e=="string"?e.includes("name"):Array.isArray(e)?e.some(o=>g(o)):!e||typeof e!="object"?!1:Object.values(e).some(o=>g(o))}function re(e){return e.type!=="symbol"||!e.id||!e.layout?!1:g(e.layout["text-field"])}function ne(e){const o=e.getStyle();for(const r of o.layers??[])re(r)&&e.setLayoutProperty(r.id,"text-field",ee)}function ie(){if(y)return y;const e=new V;y=e;try{H("pmtiles",e.tile)}catch(o){console.warn("Maplibre PMTiles protocol registration failed.",o)}return e}export default function ae({sceneDef:e,geoConfig:o,tileSource:r,mapOptions:B,debug:b,onMapReady:h,onMapDimLayerReady:x,onMapLoadError:P,onPointerMissed:C,children:N}){const M=l(null),[_,A]=W(),L=l(h),S=l(x),j=l(P),Z=l({geoConfig:o,tileSource:r,mapOptions:B,debug:b});return T(()=>{L.current=h,S.current=x,j.current=P}),T(()=>{const E=M.current;if(!E)return;const{geoConfig:n,tileSource:m,mapOptions:s,debug:U}=Z.current;let u=!1,I;const R=()=>{const k=ie(),G=n.bounds?{bounds:n.bounds,fitBoundsOptions:{padding:n.fitPadding,bearing:n.bearing}}:{center:n.center,zoom:n.zoom},O=Q(m.style,m.offline?i=>K(k,i):void 0),t=new J({container:E,...G,bearing:n.bearing,pitch:s?.pitch??30,maxPitch:s?.maxPitch??70,minZoom:s?.minZoom,maxZoom:s?.maxZoom,maxBounds:s?.maxBounds,attributionControl:{compact:!0,customAttribution:$},bearingSnap:0,canvasContextAttributes:{antialias:!0}});n.zoomAdjustment&&t.jumpTo({zoom:t.getZoom()+n.zoomAdjustment}),t.once("error",i=>{t.isStyleLoaded()||j.current?.(i?.error??i)});const F=i=>{const a=i?.id;!a||t.hasImage(a)||t.addImage(a,{width:1,height:1,data:new Uint8Array(4)})};t.on("styleimagemissing",F);let f;const d=()=>t.triggerRepaint(),X={id:v,type:"custom",renderingMode:"3d",onAdd(i,a){u||(A({gl:a,requestFrame:d,onFrame:c=>(f=c,d(),()=>{f===c&&(f=void 0)})}),L.current?.(t,d))},render(i,a){const c=oe(a??i);c&&f?.(c)}},D=()=>{ne(t),t.getSource(p)||t.addSource(p,{type:"geojson",data:te}),t.getLayer(MAP_DIM_LAYER_ID)||t.addLayer({id:MAP_DIM_LAYER_ID,type:"fill",source:p,paint:{"fill-color":"#000000","fill-opacity":0,"fill-opacity-transition":{duration:0,delay:0}}}),S.current?.(t),t.addLayer(X)};t.on("style.load",D),t.setStyle(m.style,O?{transformStyle:O}:void 0),I=()=>{t.off("style.load",D),t.off("styleimagemissing",F),t.remove()}};return U?Y().then(()=>{u||R()}):R(),()=>{u=!0,I?.(),A(void 0)}},[]),w("div",{ref:M,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},children:_&&w(q,{..._,scene:e,debug:b,onPointerMissed:C,children:N})})}
1
+ import{jsx as T}from"react/jsx-runtime";import"maplibre-gl/dist/maplibre-gl.css";import{prepareDebug as Y,Renderer as q}from"@expofp/renderer";import{addProtocol as H,Map as J}from"maplibre-gl";import{Protocol as V}from"pmtiles";import{useEffect as C,useRef as c,useState as K}from"react";import{uiState as z}from"../../store";import{registerPmtilesArchive as Q}from"./utils/pmtiles-range-fallback";import{createStyleTransform as $}from"./utils/resolve-map-style";const v=['<a href="https://expofp.com" target="_blank">ExpoFP</a>','<a href="https://maplibre.org/" target="_blank">MapLibre</a>'];export const MAP_DIM_LAYER_ID="expofp-map-dim";const p="expofp-map-dim-source",ee="3d-expofp";let y=null;const te=["coalesce",["get","name:en"],["get","name_en"],["get","name:latin"],["get","name"]],oe={type:"Feature",geometry:{type:"Polygon",coordinates:[[[-180,-85],[180,-85],[180,85],[-180,85],[-180,-85]]]},properties:{}};function B(e){if(!e||typeof e!="object")return!1;const o=e.length;if(typeof o!="number"||o<16)return!1;const r=e[0];return typeof r=="number"&&Number.isFinite(r)}function re(e){if(B(e))return Array.from(e);const r=e?.defaultProjectionData?.mainMatrix;return B(r)?Array.from(r):(console.warn("Maplibre custom layer received an unsupported projection matrix payload.",e),null)}function g(e){return typeof e=="string"?e.includes("name"):Array.isArray(e)?e.some(o=>g(o)):!e||typeof e!="object"?!1:Object.values(e).some(o=>g(o))}function ne(e){return e.type!=="symbol"||!e.id||!e.layout?!1:g(e.layout["text-field"])}function ie(e){const o=e.getStyle();for(const r of o.layers??[])ne(r)&&e.setLayoutProperty(r.id,"text-field",te)}function ae(){if(y)return y;const e=new V;y=e;try{H("pmtiles",e.tile)}catch(o){console.warn("Maplibre PMTiles protocol registration failed.",o)}return e}export default function se({sceneDef:e,geoConfig:o,tileSource:r,mapOptions:N,debug:b,onMapReady:h,onMapDimLayerReady:x,onMapLoadError:P,onPointerMissed:Z,children:U}){const M=c(null),[_,A]=K(),S=c(h),E=c(x),L=c(P),k=c({geoConfig:o,tileSource:r,mapOptions:N,debug:b});return C(()=>{S.current=h,E.current=x,L.current=P}),C(()=>{const j=M.current;if(!j)return;const{geoConfig:n,tileSource:u,mapOptions:l,debug:I}=k.current;let d=!1,R;const O=()=>{const G=ae(),W=n.bounds?{bounds:n.bounds,fitBoundsOptions:{padding:n.fitPadding,bearing:n.bearing}}:{center:n.center,zoom:n.zoom},F=$(u.style,u.offline?i=>Q(G,i):void 0),t=new J({container:j,...W,bearing:n.bearing,maxPitch:l?.maxPitch,minZoom:l?.minZoom,maxZoom:l?.maxZoom,maxBounds:l?.maxBounds,attributionControl:{compact:!0,customAttribution:v},bearingSnap:0,aroundCenter:!1,pitchWithRotate:z.pitchEnabled,touchPitch:z.pitchEnabled,canvasContextAttributes:{antialias:!0}});n.zoomAdjustment&&t.jumpTo({zoom:t.getZoom()+n.zoomAdjustment}),t.once("error",i=>{t.isStyleLoaded()||L.current?.(i?.error??i)});const D=i=>{const a=i?.id;!a||t.hasImage(a)||t.addImage(a,{width:1,height:1,data:new Uint8Array(4)})};t.on("styleimagemissing",D);let f;const m=()=>t.triggerRepaint(),X={id:ee,type:"custom",renderingMode:"3d",onAdd(i,a){d||(A({gl:a,requestFrame:m,onFrame:s=>(f=s,m(),()=>{f===s&&(f=void 0)})}),S.current?.(t,m))},render(i,a){const s=re(a??i);s&&f?.(s),I&&m()}},w=()=>{ie(t),t.getSource(p)||t.addSource(p,{type:"geojson",data:oe}),t.getLayer(MAP_DIM_LAYER_ID)||t.addLayer({id:MAP_DIM_LAYER_ID,type:"fill",source:p,paint:{"fill-color":"#000000","fill-opacity":0,"fill-opacity-transition":{duration:0,delay:0}}}),E.current?.(t),t.addLayer(X)};t.on("style.load",w),t.setStyle(u.style,F?{transformStyle:F}:void 0),R=()=>{t.off("style.load",w),t.off("styleimagemissing",D),t.remove()}};return I?Y().then(()=>{d||O()}):O(),()=>{d=!0,R?.(),A(void 0)}},[]),T("div",{ref:M,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},children:_&&T(q,{..._,scene:e,debug:b,onPointerMissed:Z,children:U})})}
@@ -2,9 +2,20 @@ import { type Map as MaplibreMap } from 'maplibre-gl';
2
2
  import { type MapOptions, type TileSourceConfig } from '../MaplibreWrapper.js';
3
3
  export declare const LIGHT_TILE_SOURCE: TileSourceConfig;
4
4
  export declare const DARK_TILE_SOURCE: TileSourceConfig;
5
- export declare const DEFAULT_MAP_OPTIONS: MapOptions;
6
- export declare const MAP_2D_OPTIONS: MapOptions;
5
+ export declare const MAP_MIN_ZOOM = 12;
7
6
  export declare function applyMapDimValue(map: MaplibreMap | null, value: number): void;
8
- export declare function applyMapOptions(map: MaplibreMap | null, mapOptions: MapOptions, animatePitch?: boolean): void;
7
+ /**
8
+ * Applies a camera policy to a live map.
9
+ *
10
+ * Only the pitch moves the camera. The zoom and pan limits are ceilings, not positions, so they are
11
+ * set outright; they touch the camera only when it already sits outside a new limit, and MapLibre
12
+ * then clamps it rather than easing it.
13
+ *
14
+ * A pitch change eases when `uiState.animatePitch` is set, over `uiState.mapSettings.pitchtime`,
15
+ * which is the same setting the floor plan view eases by.
16
+ * @param map - The map, or null before it exists.
17
+ * @param mapOptions - The policy; an omitted field restores MapLibre's own default.
18
+ */
19
+ export declare function applyMapOptions(map: MaplibreMap | null, mapOptions: Partial<MapOptions>): void;
9
20
  export declare function getTileSource(): TileSourceConfig;
10
21
  //# sourceMappingURL=map-helpers.d.ts.map
@@ -1 +1 @@
1
- import{fpGeo as f}from"../../../data/fpGeo.js";import u from"../../../store/index.js";import a from"../../../tools/settings.js";import{MAP_DIM_LAYER_ID as s}from"../MaplibreWrapper.js";import{resolveMapTheme as m}from"./map-theme.js";export const LIGHT_TILE_SOURCE={style:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json"},DARK_TILE_SOURCE={style:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"};const c=12;export const DEFAULT_MAP_OPTIONS={pitch:30,maxPitch:70,minZoom:c},MAP_2D_OPTIONS={pitch:0,maxPitch:0,minZoom:c};export function applyMapDimValue(t,e){t?.getLayer(s)&&(t.setPaintProperty(s,"fill-opacity",p(e)),t.triggerRepaint())}function p(t){return Math.min(Math.max(t,0),1)}export function applyMapOptions(t,e,n=!1){if(!t)return;t.setMinZoom(e.minZoom??null),t.setMaxZoom(e.maxZoom??null),t.setMaxBounds(e.maxBounds??null);const o=e.pitch,r=e.maxPitch,l=t.getPitch(),i=!!(n&&o!=null&&r!=null&&r<l);r!=null&&!i&&t.setMaxPitch(e.maxPitch),!(o==null||l===o)&&(n?(t.easeTo({pitch:o,duration:300}),i&&t.once("moveend",()=>t.setMaxPitch(r))):t.jumpTo({pitch:o}))}export function getTileSource(){const t=u.fp?.maplibre??window.__efpMaplibre;return t?.style?{style:t.style,offline:t.offline}:t?.styleUrl?{style:t.styleUrl,offline:t.offline}:m(f?.properties?.config?.style,a.backgroundColor)==="dark"?DARK_TILE_SOURCE:LIGHT_TILE_SOURCE}
1
+ import{fpGeo as a}from"../../../data/fpGeo.js";import f,{uiState as s}from"../../../store/index.js";import u from"../../../tools/settings.js";import{MAP_DIM_LAYER_ID as c}from"../MaplibreWrapper.js";import{resolveMapTheme as p}from"./map-theme.js";export const LIGHT_TILE_SOURCE={style:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json"},DARK_TILE_SOURCE={style:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},MAP_MIN_ZOOM=12;export function applyMapDimValue(t,e){t?.getLayer(c)&&(t.setPaintProperty(c,"fill-opacity",m(e)),t.triggerRepaint())}function m(t){return Math.min(Math.max(t,0),1)}export function applyMapOptions(t,e){if(!t)return;t.setMinZoom(e.minZoom??null),t.setMaxZoom(e.maxZoom??null),t.setMaxBounds(e.maxBounds??null);const{pitch:o,maxPitch:n}=e,r=s.animatePitch,i=t.getPitch(),l=!!(r&&o!=null&&n!=null&&n<i);l||t.setMaxPitch(n??null),!(o==null||i===o)&&(r?(t.easeTo({pitch:o,duration:s.mapSettings.pitchtime}),l&&t.once("moveend",()=>t.setMaxPitch(n))):t.jumpTo({pitch:o}))}export function getTileSource(){const t=f.fp?.maplibre??window.__efpMaplibre;return t?.style?{style:t.style,offline:t.offline}:t?.styleUrl?{style:t.styleUrl,offline:t.offline}:p(a?.properties?.config?.style,u.backgroundColor)==="dark"?DARK_TILE_SOURCE:LIGHT_TILE_SOURCE}
@@ -1 +1 @@
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);
1
+ import{__decorate as t}from"tslib";import{action as r,computed as o,observable as l}from"mobx";import a from"../data";import{fpGeo as n}from"../data/fpGeo";const s=import.meta.env?.VITE_EXPOFP_DISABLE_3D_TOGGLE!=="false";function d(){return typeof window>"u"||window.navigator.onLine}export default class e{constructor(i){this.mapViewMode="floorplan",this.maplibreSelected=!1,this.isOnline=d(),this.cameraPortBox=l.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=a.allow3dView&&this.mapViewMode!=="map3d"?"map3d":"map2d",this.maplibreSelected=!0)}deactivateMaplibre(){this.mapViewMode="floorplan",this.maplibreSelected=!1}get hideModeSwitchButton(){return!this.maplibreEnabled||!a.allow3dView||s||a.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 a.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?this.rootStore.uiState.is3DView?"map3d":"map2d":"floorplan"}}t([l],e.prototype,"mapViewMode",void 0),t([l],e.prototype,"maplibreSelected",void 0),t([l],e.prototype,"isOnline",void 0),t([r],e.prototype,"setOnline",null),t([r],e.prototype,"setCameraPort",null),t([r],e.prototype,"clearCameraPortIfCurrent",null),t([r],e.prototype,"activateMaplibre",null),t([r],e.prototype,"deactivateMaplibre",null),t([o({keepAlive:!0})],e.prototype,"hideModeSwitchButton",null),t([o({keepAlive:!0})],e.prototype,"maplibreEnabled",null),t([o({keepAlive:!0})],e.prototype,"useMaplibreMap",null),t([o({keepAlive:!0})],e.prototype,"showMaplibre",null),t([o({keepAlive:!0})],e.prototype,"isMap3d",null);
@@ -151,7 +151,7 @@ export default class UIState {
151
151
  get uiScale(): number;
152
152
  get isGuidedToursActive(): boolean;
153
153
  get getRouteNextFloor(): string | null;
154
- get headerHeightRem(): number;
154
+ readonly headerHeightRem = 0;
155
155
  get headerHeightPx(): number;
156
156
  get overlayPosition(): "bottom" | "left";
157
157
  get overlayCollapsed(): boolean;
@@ -159,7 +159,7 @@ export default class UIState {
159
159
  get overlayBottom(): boolean;
160
160
  get overlayLeft(): boolean;
161
161
  get overlayWidthPx(): number;
162
- get wsImageHeightPx(): number;
162
+ readonly wsImageHeightPx = 44;
163
163
  get wsPaddingPx(): number;
164
164
  get wsOccupiedHeightPx(): number;
165
165
  get wsShown(): boolean;
@@ -168,7 +168,7 @@ export default class UIState {
168
168
  get responsiveClass(): string;
169
169
  get mapVisibleTop(): number;
170
170
  get mapVisibleBottom(): number;
171
- get mapVisibleStart(): number;
171
+ readonly mapVisibleStart = 0;
172
172
  get searchActionsHeightPx(): number;
173
173
  get shouldShowSearchButtons(): boolean;
174
174
  get shouldShowMobileToggle(): boolean;
@@ -203,10 +203,56 @@ export default class UIState {
203
203
  get previewMode(): boolean;
204
204
  get viewerMode(): boolean;
205
205
  get selectedEventItem(): EventItem | null;
206
+ /**
207
+ * How the camera moves before a host says otherwise.
208
+ *
209
+ * Both views a plan is drawn in read these, so the plan opens at the same angle and takes the
210
+ * same time to get there whichever view is showing.
211
+ */
206
212
  get defaultMapSettings(): MapSettings;
207
213
  mapSettings: MapSettings;
208
214
  setMapSettings(settings: MapSettings): void;
209
215
  resetMapSettings(): void;
216
+ /**
217
+ * How far the camera may tilt back from top down, in degrees.
218
+ *
219
+ * MapLibre's own default, which both views are held to, so the plan tilts the same amount in
220
+ * either one. Not a map setting, because a host has no reason to raise or lower it.
221
+ */
222
+ readonly maxPitch = 60;
223
+ /** Whether a pitch change eases rather than cuts. Both views read it. */
224
+ animatePitch: boolean;
225
+ /**
226
+ * Whether the venue shows its plan in 3D, which is its `allow3dView` flag and nothing else.
227
+ *
228
+ * `MaplibreStore` picks the first view mode from it, and the tilt gesture below hangs off it, so
229
+ * a venue that never allows a tilted plan cannot be tilted by hand either.
230
+ *
231
+ * `hide3dMapDefault` is deliberately not read here. It asks for the flat view on load, which is a
232
+ * starting camera rather than a venue without 3D, and narrowing this by it takes the tilt gesture
233
+ * away from a venue that allows one.
234
+ *
235
+ * A plain getter, not a computed: the flag is frozen config with nothing to observe, and the map
236
+ * store reads this from its own constructor.
237
+ */
238
+ get is3DView(): boolean;
239
+ /**
240
+ * Whether the user may tilt the plan by hand.
241
+ *
242
+ * The gesture only, exactly as `rollEnabled` is: a camera command still tilts the plan whatever
243
+ * this says, in either view, so a host may open the plan at an angle with the gesture off. The
244
+ * venue decides first through `is3DView`, and the `pitch` map parameter a host may pass
245
+ * through the URL narrows it further.
246
+ *
247
+ * `keepAlive`, because `defaultMapSettings` reads it from the constructor, where there is no
248
+ * reaction to observe it and the store is configured with `computedRequiresReaction`.
249
+ */
250
+ get pitchEnabled(): boolean;
251
+ /**
252
+ * Whether the user may turn the plan: the venue's own setting, narrowed by the `roll` map
253
+ * parameter a host may pass through the URL.
254
+ */
255
+ get rollEnabled(): boolean;
210
256
  get baseQRCodeUrl(): string;
211
257
  get viewMapOnPhoneQRCodeUrl(): string;
212
258
  get routeQRCodeUrl(): string;