@expofp/floorplan 3.31.0 → 3.31.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/browser/{Button-CQwO9tIg.js → Button-Qm5P6a8B.js} +5 -5
  2. package/dist/browser/{CookieConsent-C-b_gQuN.js → CookieConsent-BQgXOHAD.js} +7 -7
  3. package/dist/browser/{Debug-fQQyYJXu.js → Debug-_OyHOD_n.js} +7 -7
  4. package/dist/browser/{DebugTools-BCE8StGX.js → DebugTools-COsUbkqm.js} +6 -6
  5. package/dist/browser/{Demo-Cl9GA9tB.js → Demo-5w-XfzMg.js} +9 -9
  6. package/dist/browser/{Free-DI9bpsX5.js → Free-CzygQkMe.js} +9 -9
  7. package/dist/browser/{GalleryContainer-DKLp4FU4.js → GalleryContainer-DPr6Uoag.js} +10 -10
  8. package/dist/browser/{GpsLoader-CiDmup5t.js → GpsLoader-CKcgWjoc.js} +11 -11
  9. package/dist/browser/{KioskStore-BVpFrfzX.js → KioskStore-Bts_Q15s.js} +22 -22
  10. package/dist/browser/{MaplibreAdapter-BJxJxnzx.js → MaplibreAdapter-CJSQAzL9.js} +14 -14
  11. package/dist/browser/{ModalContainer-NXKmni8w.js → ModalContainer-BoCV5wDn.js} +10 -10
  12. package/dist/browser/{PermissionNotice-BkAvCmPD.js → PermissionNotice-BwJotFlI.js} +6 -6
  13. package/dist/browser/{SetKioskMode-CsV-ckXR.js → SetKioskMode-CZt7zsDM.js} +9 -9
  14. package/dist/browser/{ShowKiosk-CqhWjqxE.js → ShowKiosk-CEj4swM7.js} +11 -11
  15. package/dist/browser/{ViewerMenuPanel-CCca0xxk.js → ViewerMenuPanel-CNK1_k0v.js} +9 -9
  16. package/dist/browser/{add-debug-secret-listener-CxE72n53.js → add-debug-secret-listener-Bxqy2klS.js} +1 -1
  17. package/dist/browser/{adopt-global-settings-nxeDDXp1.js → adopt-global-settings-Ad-DbHmA.js} +9 -9
  18. package/dist/browser/{boolean-editor-DPMQ0YU3.js → boolean-editor-D-e8d_tV.js} +9 -9
  19. package/dist/browser/{bootIntercom-DBS2-Ra7.js → bootIntercom-CaU_rORK.js} +2 -2
  20. package/dist/browser/bundle.json +69 -69
  21. package/dist/browser/{camera-events-rGM_y-1M.js → camera-events-CO4VvNb6.js} +1 -1
  22. package/dist/browser/{classnames-CkjzoXiH.js → classnames-BC0VTHvp.js} +2 -2
  23. package/dist/browser/{client-DiPQk1ur.js → client-C1-foycu.js} +5 -5
  24. package/dist/browser/{components-CAI7tVu_.js → components-Bc57XDcm.js} +818 -818
  25. package/dist/browser/{debug-context-Cx6l3A8H.js → debug-context-DCG3rjfQ.js} +5 -5
  26. package/dist/browser/{debug-overlay-BlCwf63z.js → debug-overlay-izq4leLY.js} +10 -10
  27. package/dist/browser/{debug-ui-CL9NYiBY.js → debug-ui-9Swl8RVB.js} +6 -6
  28. package/dist/browser/{dimming-BrddBap-.js → dimming-CuIuLXfY.js} +236 -234
  29. package/dist/browser/{dist-DbtaUrV6.js → dist-B-HF27mM.js} +5 -5
  30. package/dist/browser/{dist-Bdec-Nxs.js → dist-CqLx2IB7.js} +6 -6
  31. package/dist/browser/{dist-JdkIiWfj.js → dist-LEZIV9LY.js} +3 -3
  32. package/dist/browser/{efp-debug-init-DDFZgkyx.js → efp-debug-init-BbQM0wWf.js} +3 -3
  33. package/dist/browser/{enum-editor-BBt11YmB.js → enum-editor-B_c3dXaZ.js} +4 -4
  34. package/dist/browser/{es5-DVB0QLwS.js → es5-BOJ4b1wR.js} +2 -2
  35. package/dist/browser/{event-not-found-hzkyr5mJ.js → event-not-found-BblGd3M4.js} +1 -1
  36. package/dist/browser/{exports-DRumaK8s.js → exports-4LmWfHsz.js} +1 -1
  37. package/dist/browser/{favicon-ByjB1rX0.js → favicon-N0zSgMmJ.js} +1 -1
  38. package/dist/browser/{fetch-retry.umd-CEIMoenq.js → fetch-retry.umd-BWMxV19k.js} +2 -2
  39. package/dist/browser/{flex-CrHBC47v.js → flex-8G6bcMjN.js} +5 -5
  40. package/dist/browser/{floorplan.loader-UtQ5sLSE.js → floorplan.loader-DYkL0M7t.js} +39 -39
  41. package/dist/browser/{floorplan.ready-BBRE91D6.js → floorplan.ready-BOrGaN2O.js} +331 -331
  42. package/dist/browser/{fuse-D9Fc86Mp.js → fuse-BGs9iODw.js} +2 -2
  43. package/dist/browser/{i18n-C3pmOHfm.js → i18n-mT-LTlNt.js} +7 -7
  44. package/dist/browser/index.js +26 -26
  45. package/dist/browser/{index.module-ScroRsV4.js → index.module-BuG-E0rL.js} +4 -4
  46. package/dist/browser/{integrateKiosk-Bp4Usv7I.js → integrateKiosk-VQpGPjET.js} +5 -5
  47. package/dist/browser/{is-webview-B0VkhBwH.js → is-webview-CUtLVmk5.js} +1 -1
  48. package/dist/browser/{jsx-runtime-BV6RRH6M.js → jsx-runtime-B-AyhF86.js} +2 -2
  49. package/dist/browser/{kiosk-record-NHohuRZk.js → kiosk-record-DDbM9sTc.js} +1 -1
  50. package/dist/browser/{lib-D4o7UxhZ.js → lib-C_aiA-wC.js} +3 -3
  51. package/dist/browser/{loadImage-CmTxbx4i.js → loadImage-C-vruA2F.js} +5 -5
  52. package/dist/browser/{logDeviceInfo-BJEg8M4e.js → logDeviceInfo-CnvdcMVO.js} +9 -9
  53. package/dist/browser/mobx-Cd_tthXm.js +43 -0
  54. package/dist/browser/{optional-boolean-editor-DuCfWYyQ.js → optional-boolean-editor-Z2FcQDhV.js} +3 -3
  55. package/dist/browser/{optional-enum-editor-Q-snbPWN.js → optional-enum-editor-BAOKOvG4.js} +4 -4
  56. package/dist/browser/{optional-string-editor-Bd-V93ee.js → optional-string-editor-Dn0b3_8O.js} +4 -4
  57. package/dist/browser/{particles.min-BXxEUmtZ.js → particles.min-BrsBfq49.js} +2 -2
  58. package/dist/browser/{react-yYxHcXya.js → react-C3f8vk_l.js} +2 -2
  59. package/dist/browser/{react-dom-BpJ-AdUf.js → react-dom-CDGcztfz.js} +3 -3
  60. package/dist/browser/{rolldown-runtime-DB1nSOXr.js → rolldown-runtime-CMBxMkJ4.js} +1 -1
  61. package/dist/browser/{scheduler-DgvhfFMA.js → scheduler-BhTLs4jB.js} +2 -2
  62. package/dist/browser/{select-DC3zsJbM.js → select-BTXH5pP8.js} +10 -10
  63. package/dist/browser/{settings-CmbIseSw.js → settings-Djyr8mIQ.js} +2 -2
  64. package/dist/browser/{settings-item-Dp6uSDI5.js → settings-item-CWoIdxX5.js} +6 -6
  65. package/dist/browser/{store-BQJFbecZ.js → store-Bmqv7C8v.js} +2811 -2811
  66. package/dist/browser/{string-editor-DKRik8qD.js → string-editor-BemPBm-5.js} +4 -4
  67. package/dist/browser/{text-field-D3Rb6XM1.js → text-field-D-3HDOH7.js} +5 -5
  68. package/dist/browser/{theme-B-lC93LF.js → theme-CBuB2Qm7.js} +8 -8
  69. package/dist/browser/{ui-D9c3dK9d.js → ui-BnQTapnd.js} +8 -8
  70. package/dist/browser/{useRenderTarget-Cn4JNaNq.js → useRenderTarget-D-TZ6FHU.js} +4 -4
  71. package/dist/browser/{viewport-B7y5otP7.js → viewport-DokNaqbx.js} +2 -2
  72. package/dist/esm/components/Map/MapCamera.js +1 -1
  73. package/dist/esm/components/Map/traffic/useManageTraffic.d.ts +1 -1
  74. package/dist/esm/components/Map/traffic/useManageTraffic.js +1 -1
  75. package/dist/esm/utils/mobx.d.ts +29 -0
  76. package/dist/esm/utils/mobx.js +1 -1
  77. package/package.json +10 -10
  78. package/dist/browser/mobx-LsEeQkKC.js +0 -24
@@ -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.31.0" };
4
+ e.SENTRY_RELEASE = { id: "3.31.2" };
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-BV6RRH6M.js";
10
- import { t } from "./settings-item-Dp6uSDI5.js";
11
- import { t as n } from "./text-field-D3Rb6XM1.js";
9
+ import { t as e } from "./jsx-runtime-B-AyhF86.js";
10
+ import { t } from "./settings-item-CWoIdxX5.js";
11
+ import { t as n } from "./text-field-D-3HDOH7.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.31.0" };
4
+ e.SENTRY_RELEASE = { id: "3.31.2" };
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-DB1nSOXr.js";
10
- import { t } from "./react-yYxHcXya.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-CrHBC47v.js";
12
- import { t as l } from "./classnames-CkjzoXiH.js";
9
+ import { r as e } from "./rolldown-runtime-CMBxMkJ4.js";
10
+ import { t } from "./react-C3f8vk_l.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-8G6bcMjN.js";
12
+ import { t as l } from "./classnames-BC0VTHvp.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.31.0" };
4
+ e.SENTRY_RELEASE = { id: "3.31.2" };
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-DB1nSOXr.js";
10
- import { t } from "./react-yYxHcXya.js";
11
- import { t as n } from "./jsx-runtime-BV6RRH6M.js";
12
- import { t as r } from "./react-dom-BpJ-AdUf.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-CrHBC47v.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-Bdec-Nxs.js";
15
- import { t as y } from "./classnames-CkjzoXiH.js";
9
+ import { r as e } from "./rolldown-runtime-CMBxMkJ4.js";
10
+ import { t } from "./react-C3f8vk_l.js";
11
+ import { t as n } from "./jsx-runtime-B-AyhF86.js";
12
+ import { t as r } from "./react-dom-CDGcztfz.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-8G6bcMjN.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-CqLx2IB7.js";
15
+ import { t as y } from "./classnames-BC0VTHvp.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.31.0" };
4
+ e.SENTRY_RELEASE = { id: "3.31.2" };
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-DB1nSOXr.js";
10
- import { a as t, i as n, s as r } from "./efp-debug-init-DDFZgkyx.js";
11
- import { a as i, i as a } from "./adopt-global-settings-nxeDDXp1.js";
12
- import { t as o } from "./jsx-runtime-BV6RRH6M.js";
13
- import "./settings-CmbIseSw.js";
14
- import { t as s } from "./add-debug-secret-listener-CxE72n53.js";
9
+ import { r as e } from "./rolldown-runtime-CMBxMkJ4.js";
10
+ import { a as t, i as n, s as r } from "./efp-debug-init-BbQM0wWf.js";
11
+ import { a as i, i as a } from "./adopt-global-settings-Ad-DbHmA.js";
12
+ import { t as o } from "./jsx-runtime-B-AyhF86.js";
13
+ import "./settings-Djyr8mIQ.js";
14
+ import { t as s } from "./add-debug-secret-listener-Bxqy2klS.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-CL9NYiBY.js"), { createRoot: i } = await import("./client-DiPQk1ur.js").then((t) => /* @__PURE__ */ e(t.t(), 1)), a = document.createElement("div");
29
+ let { DebugUi: n } = await import("./debug-ui-9Swl8RVB.js"), { createRoot: i } = await import("./client-C1-foycu.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.31.0" };
4
+ e.SENTRY_RELEASE = { id: "3.31.2" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "7407e64e-4c4e-4bfb-b2ef-80063ad22998", e._sentryDebugIdIdentifier = "sentry-dbid-7407e64e-4c4e-4bfb-b2ef-80063ad22998");
7
7
  } catch {}
8
8
  })();
9
- import { r as e } from "./rolldown-runtime-DB1nSOXr.js";
10
- import { t } from "./react-yYxHcXya.js";
11
- import { l as n } from "./store-BQJFbecZ.js";
9
+ import { r as e } from "./rolldown-runtime-CMBxMkJ4.js";
10
+ import { t } from "./react-C3f8vk_l.js";
11
+ import { l as n } from "./store-Bmqv7C8v.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.31.0" };
4
+ e.SENTRY_RELEASE = { id: "3.31.2" };
5
5
  var t = new e.Error().stack;
6
6
  t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "30d5a1aa-2d79-4710-91d1-937109f43b1a", e._sentryDebugIdIdentifier = "sentry-dbid-30d5a1aa-2d79-4710-91d1-937109f43b1a");
7
7
  } catch {}
8
8
  })();
9
- import { c as e, vt as t } from "./store-BQJFbecZ.js";
9
+ import { c as e, vt as t } from "./store-Bmqv7C8v.js";
10
10
  //#region src/components/Map/viewport.ts
11
11
  function n(e) {
12
12
  return {
@@ -1 +1 @@
1
- import{Box as s}from"@expofp/geometry";import{useCameraAPI as h,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 P}from"../../data/fpGeo";import{svgArea as S}from"../../data/svg";import p,{uiState as r}from"../../store";import{BoothBase as C}from"../../store/BoothStore";import d from"../../tools/logger";import F from"../../tools/settings";import{areLayersEnabled as w}from"../../utils/areLayersEnabled";import{parseNumberPair as l}from"../../utils/camera-map-settings";import{convertGpsToLocal as z}from"../../utils/gps";import{useReaction as f}from"../../utils/mobx";import{createMapCamera as E,setMapCamera as v}from"./camera";import{notifyCameraMoved as N}from"./camera-events";import{resetExternalOverlay as b}from"./pointer";export function MapCamera(){const o=h(),n=x(),t=B({api:o,state:n}),[a]=M(()=>E(t));return T(()=>{t.current={api:o,state:n}}),R(()=>(v(a),()=>v(void 0)),[a]),y(()=>{b(),N()}),f(()=>r.zoomBy,e=>{e&&(t.current.api.zoomBy(e),r.zoomBy=null)},void 0,[]),f(()=>r.rollReset,e=>{e&&(t.current.api.reset({roll:!0}),r.rollReset=!1)},void 0,[]),f(()=>r.centerMap,e=>{e&&(t.current.api.reset({zoom:!!(r.list.type==="search"&&r.list.text)}),r.centerMap=!1)},void 0,[]),f(()=>r.moveToRect,e=>{if(!e)return;const{width:m,height:i}=e.size;m>0&&i>0&&Number.isFinite(m)&&Number.isFinite(i)&&g(t.current.api,e,r.moveToRectPaddingPercent??void 0),r.moveToRect=null,r.moveToRectPaddingPercent=null},void 0,[]),f(()=>r.moveToBooths,e=>{if(!e)return;d.log("watched moveToBooths",e);const m=e.filter(i=>i.rect).map(i=>i.rect);m.length&&g(t.current.api,s.fromUnion(...m)),r.moveToBooths=null},void 0,[]),f(()=>r.mapSettings,({center:e,centerxy:m,bearing:i,z:c})=>{try{c&&p.fp.activateFloor({name:c});const u=A(e,m);u&&t.current.api.panTo(u),Number.isFinite(i)&&t.current.api.rollTo(i)}catch(u){d.error("Error in mapSettings reaction",u)}},void 0,[]),null}function g(o,n,t){o.zoomTo(L(n),{padding:t??G(n,S),maxZoom:Number.isFinite(F.maxZoom)?void 0:10,within:k()})}function k(){const o=r.canvasVisibleRectPx;return r.shouldShiftMapRect?s.fromMinMax({x:o.min.x+r.overlayWidthPx,y:o.min.y},o.max):o}function L(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)?s.fromUnion(o,new s(n.x,n.y,1,1)):o}function G(o,n){return!o||!n?0:(o.area/n.area>.1?15:25)/100}function A(o,n){if(o){const a=l(o);if(!a)return;const e=P?.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=l(n);if(t)return{x:t[0],y:t[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,4 +1,4 @@
1
- import { SceneDef } from '@expofp/renderer';
1
+ import { type SceneDef } from '@expofp/renderer';
2
2
  export interface ManageTrafficParams {
3
3
  permission: boolean;
4
4
  /** The scene whose traffic layers this fills; `config-all` pre-creates them in it. */
@@ -1 +1 @@
1
- import{degToRad as xe,lineAngle as ie,pointDistance as ae}from"@expofp/geometry";import{update as O}from"@expofp/renderer";import{useEffect as Ee,useRef as R}from"react";import{getBounds as k}from"../../../engine/canvases";import Me from"../../../tools/base-runtime-url";import{loadImage as ve}from"../../../utils/loadImage";import{mapCamera as ue}from"../camera";import{createImageCanvas as Le}from"../drawing/config/canvases";import{getRouteLayerRegex as Re,getRouteStopLayerRegex as Se,TRAFFIC_VEHICLES as le}from"./trafficLayers";import{UpdateQueue as be}from"./UpdateQueue";const ee=2,Ae=ee*3.5,G=ee*12,de=G*.7,Fe=8,Te="transport_locations",Pe=150,te="#a4aab6",he=1e3,Ce=2e4,fe=500;export function useManageTraffic({permission:t,scene:r,dataJsonUrl:o,websocketUrl:a}){const e=R(window.devicePixelRatio),c=R(new Map),n=R(new Map),s=R(),w=R(),f=R(performance.now()),M=R(1),p=R(new be),S=R(new Map),I=R(he),g=R(new Map),y=R();Ee(()=>{async function d(){if(!(!t||!r))try{let u;try{const i=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json"}});if(!i.ok||i.status===204)return;u=await i.json()}catch(i){console.warn("useManageTraffic failed to get JSON",i)}if(!u||u?.disabled||u?.error)return;e.current=ge(ue()?.state().pixelSize??window.devicePixelRatio);const x=new Map(u.routes.map(({id:i,color:m})=>[i,m])),H=r.rootLayer.children,V=new Map;x.forEach(i=>{V.set(i,Ne({radius:Ae,color:i,scale:window.devicePixelRatio}))});const j=Re(),Y=H.filter(i=>j.test(i.name)),q=Se(),B=H.filter(i=>q.test(i.name));u.routes.slice(0,Y.length).forEach(({id:i,color:m,path:h,stops:U,hiddenPoints:E},v)=>{S.current.set(i,h);const W=Y[v];if(W){const C=new Map(E?.map(l=>[oe(l),l])??[]);for(let l=1;l<h.length;l++){const N=h[l-1],D=h[l];C.has(oe(N))||C.has(oe(D))||W.children.push({points:{p0:N,p1:D},color:m,width:ee})}W.children.length&&p.current.add(()=>O(W))}const P=B[v];if(P&&U?.length){const C=V.get(m);U.forEach(l=>{P.children.push({source:C,bounds:k(l.x,l.y,C.width,C.height,e.current)})}),P.children.length&&p.current.add(()=>O(P))}});const _=H.find(i=>i.name===le),X=new Map;_.onScale=({pixelSize:i})=>{e.current=ge(i);const m=[];for(const h of B){const U=h.children;for(const E of U)E.bounds=k(E.bounds.center.x,E.bounds.center.y,E.source.width,E.source.height,e.current,E.bounds.rotation),m.push(E)}for(const h of c.current.values())h.bounds=k(h.bounds.center.x,h.bounds.center.y,h.source.width,h.source.height,e.current,h.bounds.rotation),m.push(h);return m},p.current.add(()=>O(_)),x.forEach((i,m)=>{X.set(m,me({id:m,width:G,height:G,color:i,scale:window.devicePixelRatio}))}),X.set(te,me({id:"orphan",width:G,height:G,color:te,scale:window.devicePixelRatio}));let z=null;try{const i=await ve(`${Me}icons/bus-white.svg`);z=Le(i,de,de,window.devicePixelRatio)}catch(i){console.error(i)}w.current=i=>{try{const m=JSON.parse(i.data);if(m.type!==Te)return;const h=i.timeStamp||performance.now();M.current=Math.round(h-f.current),f.current=h;const U=Math.max(M.current??fe,fe),E=n.current,v=c.current,W=_.children,P=p.current;let C=!1;m.data.forEach(({id:l,x:N,y:D,route_id:re,hidden:ye})=>{if(E.has(l)&&(E.get(l)?.(),E.delete(l)),ye&&v.has(l)&&v.has(Q(l))){const A=v.get(l);A.hidden=!0;const L=v.get(Q(l));L.hidden=!0,P.add(()=>O(A,L));return}if(g.current.set(l,performance.now()),!v.has(l)){const A=X.get(re)||X.get(te),L={id:l,source:A,bounds:k(N,D,A.width,A.height,e.current,0)};if(v.set(l,L),z){const $=Q(l),se={id:$,source:z,bounds:k(N,D,z.width,z.height,e.current,0)};z.setAttribute("id",$),v.set($,se),W.push(L,se)}else W.push(L);C=!0;return}const Z=v.get(l),ce=v.get(Q(l)),Ie=Z.bounds.center,K=Oe(Ie,{x:N,y:D},S.current.get(re));if(K.reduce((A,L,$)=>$===0?A:A+ne(K[$-1],L),0)>=Pe||document.hidden)we({updateQueue:P,vehicle:Z,vehicleFinery:ce,x:N,y:D,scale:e.current,angle:_e(Z.bounds.center,{x:N,y:D})});else{const A=He(K,U,L=>{we({updateQueue:P,vehicle:Z,vehicleFinery:ce,x:L.x,y:L.y,scale:e.current,angle:L.angle})});E.set(l,A)}}),C&&P.add(()=>O(_))}catch(m){console.error("handleSocketMessage",m)}},F(),b(u.config?(Number(u.config.vehicle_inactive_interval)||20)*1e3:Ce)}catch(u){console.warn(u)}}d();function F(){s.current?.readyState===WebSocket.OPEN||s.current?.readyState===WebSocket.CONNECTING||(s.current=new WebSocket(a),s.current.onmessage=w.current,s.current.onopen=()=>{I.current=he},s.current.onclose=()=>{if(!navigator.onLine)return;setTimeout(F,I.current);const u=3e4;I.current=Math.min(I.current*2,u)})}function T(){F()}window.addEventListener("online",T);function b(u){clearInterval(y.current),y.current=window.setInterval(()=>{const x=performance.now(),H=[],V=[];g.current.forEach((j,Y)=>{if(x-j<u)return;const q=c.current.get(Y);q&&(q.hidden=!0,V.push(q),H.push(Y));const B=Q(Y),_=c.current.get(B);_&&(_.hidden=!0,V.push(_),H.push(B))}),V.length&&p.current.add(()=>O(...V)),H.forEach(j=>g.current.delete(j))},u)}return()=>{const u=r?.rootLayer.children?.find(x=>x.name===le);u&&(u.onScale=void 0),n.current.forEach(x=>x?.()),n.current.clear(),c.current.clear(),p.current.destroy(),window.removeEventListener("online",T),clearInterval(y.current)}},[t,r,o,a])}function ge(t){return Math.min(t||window.devicePixelRatio,Fe)}function _e(t,r){return ie(t,r)}function Ne({radius:t,scale:r,color:o}){const a=document.createElement("canvas"),e=a.getContext("2d");e.imageSmoothingEnabled=!1;const c=Math.ceil(t*2*r),n=c/2,s=t*.78,w=t*.33;return a.width=c,a.height=c,e.translate(n,n),e.scale(r,r),e.beginPath(),e.arc(0,0,t,0,2*Math.PI),e.fillStyle="#FFFFFF",e.fill(),e.beginPath(),e.arc(0,0,s,0,2*Math.PI),e.fillStyle=o,e.fill(),e.beginPath(),e.arc(0,0,w,0,2*Math.PI),e.fillStyle="#FFFFFF",e.fill(),a}function me({id:t,width:r,height:o,color:a,scale:e}){const c=2*e,n=r/2*e,s=o*e,w=.6,f=.01,M=s*w,p=s,S=8*e,I=p+c+M/2+S*2,g=n*2+M+c+S*2,y=document.createElement("canvas");y.setAttribute("id",t),y.width=I,y.height=g;const d=y.getContext("2d"),F=I/2,T=g/2;d.save(),d.translate(F,T),d.rotate(-Math.PI/2),d.translate(-F,-T);const b=F,u=T-p/2+n,x=u+M;return d.shadowColor="rgba(16, 24, 40, 0.2)",d.shadowBlur=S/2,d.beginPath(),d.arc(b,u,n,Math.PI,0,!1),d.bezierCurveTo(b+n,u+s*.3,b+f*n,x,b,x),d.bezierCurveTo(b-f*n,x,b-n,u+s*.3,b-n,u),d.closePath(),d.fillStyle=a,d.fill(),d.strokeStyle="#FFFFFF",d.lineWidth=c,d.stroke(),d.restore(),y}function ne(t,r){return ae(t,r)}function Q(t){return`${t}_finery`}function we({updateQueue:t,vehicle:r,vehicleFinery:o,x:a,y:e,scale:c,angle:n}){if(r.bounds=k(a,e,r.source.width,r.source.height,c,n),r.hidden=!1,o){const s=ue()?.state().roll??0;o.bounds=k(a,e,o.source.width,o.source.height,c,xe(s)),o.hidden=!1,t.add(()=>O(o,r))}else t.add(()=>O(r))}function J(t,r,o){return{x:t.x+(r.x-t.x)*o,y:t.y+(r.y-t.y)*o}}function pe(t,r){let o=1/0,a={index:0,t:0};for(let e=0;e<r.length-1;e++){const c=r[e],n=r[e+1],s=n.x-c.x,w=n.y-c.y,f=s*s+w*w,M=f?((t.x-c.x)*s+(t.y-c.y)*w)/f:0,p=Math.max(0,Math.min(1,M)),S=J(c,n,p),I=ne(t,S);I<o&&(o=I,a={index:e,t:p})}return a}function De(t,r,o){const a=ne(t,r),e=Math.max(2,Math.ceil(a/o)+1),c=[];for(let n=0;n<e;n++){const s=n/(e-1),w=J(t,r,s);c.push(w)}return c}function Oe(t,r,o){if(!o||!o.length)return De(t,r,10);const a=pe(t,o),e=pe(r,o),c=[],n=s=>c.push(s);a.index+1<o.length?n(J(o[a.index],o[a.index+1],a.t)):n(o[a.index]);for(let s=a.index+1;s<=e.index&&s<o.length;s++)n(o[s]);return e.index+1<o.length?n(J(o[e.index],o[e.index+1],e.t)):n(o[e.index]),c}function He(t,r,o,a){if(t.length<2)return()=>{};let e=null,c;const n=[];let s=0;for(let f=0;f<t.length-1;f++){const M=ae(t[f],t[f+1]);n.push(M),s+=M}const w=f=>{e||(e=f);const M=f-e,p=Math.min(M/r,1),S=p*s;let I=0,g=0;for(;g<n.length&&I+n[g]<S;)I+=n[g],g++;g>=n.length&&(g=n.length-1);const y=t[g],d=t[Math.min(g+1,t.length-1)],F=n[g]||0,T=F===0?0:(S-I)/F,b=y.x+(d.x-y.x)*T,u=y.y+(d.y-y.y)*T,x=ie(y,d);o({x:b,y:u,angle:x}),p<1?c=requestAnimationFrame(w):a&&a()};return c=requestAnimationFrame(w),()=>{c&&cancelAnimationFrame(c)}}function oe(t){return`${t.x},${t.y}`}
1
+ import{degToRad as Me,lineAngle as ae,pointDistance as le}from"@expofp/geometry";import{update as W}from"@expofp/renderer";import{useEffect as Le,useRef as R}from"react";import{getBounds as k}from"../../../engine/canvases";import Re from"../../../tools/base-runtime-url";import{loadImage as Se}from"../../../utils/loadImage";import{mapCamera as ue}from"../camera";import{createImageCanvas as be}from"../drawing/config/canvases";import{getRouteLayerRegex as ve,getRouteStopLayerRegex as Te,TRAFFIC_VEHICLES as te}from"./trafficLayers";import{UpdateQueue as Ae}from"./UpdateQueue";const ne=2,Fe=ne*3.5,Z=ne*12,de=Z*.7,Pe=8,Ce="transport_locations",_e=150,Ne="#a4aab6",he=1e3,De=2e4,fe=500;export function useManageTraffic({permission:t,scene:r,dataJsonUrl:n,websocketUrl:a}){const e=R(window.devicePixelRatio),s=R(new Map),o=R(new Map),c=R(null),w=R(null),d=R(0),M=R(1),T=R(new Ae),S=R(new Map),x=R(he),f=R(new Map),p=R(void 0);Le(()=>{if(!t||!r)return;let l=!1,P;const b=r.rootLayer.children,g=o.current,y=s.current,I=T.current;async function ye(){try{let u;try{const i=await fetch(n,{method:"GET",headers:{"Content-Type":"application/json"}});if(!i.ok||i.status===204)return;u=await i.json()}catch(i){console.warn("useManageTraffic failed to get JSON",i)}if(!u||u.disabled||u.error)return;e.current=ge(ue()?.state().pixelSize??window.devicePixelRatio);const N=new Map(u.routes.map(({id:i,color:m})=>[i,m])),Y=new Map;N.forEach(i=>{Y.set(i,Ve({radius:Fe,color:i,scale:window.devicePixelRatio}))});const $=ve(),z=b.filter(i=>$.test(i.name)),G=Te(),U=b.filter(i=>G.test(i.name));u.routes.slice(0,z.length).forEach(({id:i,color:m,path:h,stops:B,hiddenPoints:L},Q)=>{S.current.set(i,h);const E=z[Q];if(E){const O=new Map(L?.map(C=>[ce(C),C])??[]);for(let C=1;C<h.length;C++){const v=h[C-1],V=h[C];O.has(ce(v))||O.has(ce(V))||E.children.push({points:{p0:v,p1:V},color:m,width:ne})}E.children.length&&I.add(()=>W(E))}const A=U[Q],F=Y.get(m);A&&F&&B?.length&&(B.forEach(O=>{A.children.push({source:F,bounds:k(O.x,O.y,F.width,F.height,e.current)})}),A.children.length&&I.add(()=>W(A)))});const D=b.find(i=>i.name===te);if(!D){console.warn(`useManageTraffic: the scene has no "${te}" layer`);return}const j=new Map;D.onScale=({pixelSize:i})=>{e.current=ge(i);const m=[];for(const h of U){const B=h.children;for(const L of B)L.bounds=k(L.bounds.center.x,L.bounds.center.y,L.source.width,L.source.height,e.current,L.bounds.rotation),m.push(L)}for(const h of s.current.values())h.bounds=k(h.bounds.center.x,h.bounds.center.y,h.source.width,h.source.height,e.current,h.bounds.rotation),m.push(h);return m},I.add(()=>W(D)),N.forEach((i,m)=>{j.set(m,me({id:m,width:Z,height:Z,color:i,scale:window.devicePixelRatio}))});const xe=me({id:"orphan",width:Z,height:Z,color:Ne,scale:window.devicePixelRatio});let q=null;try{const i=await Se(`${Re}icons/bus-white.svg`);q=be(i,de,de,window.devicePixelRatio)}catch(i){console.error(i)}w.current=i=>{try{const m=JSON.parse(i.data);if(m.type!==Ce)return;const h=i.timeStamp||performance.now();M.current=Math.round(h-d.current),d.current=h;const B=Math.max(M.current??fe,fe),L=D.children;let Q=!1;m.data.forEach(({id:E,x:A,y:F,route_id:O,hidden:C})=>{g.has(E)&&(g.get(E)?.(),g.delete(E));const v=y.get(E),V=y.get(re(E))??null;if(C&&v&&V){v.hidden=!0,V.hidden=!0,I.add(()=>W(v,V));return}if(f.current.set(E,performance.now()),!v){const H=j.get(O)??xe,_={source:H,bounds:k(A,F,H.width,H.height,e.current,0)};if(y.set(E,_),q){const X=re(E),ie={source:q,bounds:k(A,F,q.width,q.height,e.current,0)};q.setAttribute("id",X),y.set(X,ie),L.push(_,ie)}else L.push(_);Q=!0;return}const Ee=v.bounds.center,ee=We(Ee,{x:A,y:F},S.current.get(O));if(ee.reduce((H,_,X)=>X===0?H:H+oe(ee[X-1],_),0)>=_e||document.hidden)we({updateQueue:I,vehicle:v,vehicleFinery:V,x:A,y:F,scale:e.current,angle:Oe(v.bounds.center,{x:A,y:F})});else{const H=ke(ee,B,_=>{we({updateQueue:I,vehicle:v,vehicleFinery:V,x:_.x,y:_.y,scale:e.current,angle:_.angle})});g.set(E,H)}}),Q&&I.add(()=>W(D))}catch(m){console.error("handleSocketMessage",m)}},d.current=performance.now(),K(),window.addEventListener("online",se),Ie(u.config?(Number(u.config.vehicle_inactive_interval)||20)*1e3:De)}catch(u){console.warn(u)}}ye();function K(){l||c.current?.readyState===WebSocket.OPEN||c.current?.readyState===WebSocket.CONNECTING||(c.current=new WebSocket(a),c.current.onmessage=w.current,c.current.onopen=()=>{x.current=he},c.current.onclose=()=>{if(l||!navigator.onLine)return;P=window.setTimeout(K,x.current);const u=3e4;x.current=Math.min(x.current*2,u)})}function se(){K()}function Ie(u){clearInterval(p.current),p.current=window.setInterval(()=>{const N=performance.now(),Y=[],$=[];f.current.forEach((z,G)=>{if(N-z<u)return;const U=y.get(G);U&&(U.hidden=!0,$.push(U),Y.push(G));const D=re(G),j=y.get(D);j&&(j.hidden=!0,$.push(j),Y.push(D))}),$.length&&I.add(()=>W(...$)),Y.forEach(z=>f.current.delete(z))},u)}return()=>{l=!0,clearTimeout(P),c.current?.close(),c.current=null;const u=b.find(N=>N.name===te);u&&(u.onScale=void 0),g.forEach(N=>N?.()),g.clear(),y.clear(),I.destroy(),window.removeEventListener("online",se),clearInterval(p.current)}},[t,r,n,a])}function ge(t){return Math.min(t||window.devicePixelRatio,Pe)}function Oe(t,r){return ae(t,r)}function Ve({radius:t,scale:r,color:n}){const a=document.createElement("canvas"),e=a.getContext("2d");e.imageSmoothingEnabled=!1;const s=Math.ceil(t*2*r),o=s/2,c=t*.78,w=t*.33;return a.width=s,a.height=s,e.translate(o,o),e.scale(r,r),e.beginPath(),e.arc(0,0,t,0,2*Math.PI),e.fillStyle="#FFFFFF",e.fill(),e.beginPath(),e.arc(0,0,c,0,2*Math.PI),e.fillStyle=n,e.fill(),e.beginPath(),e.arc(0,0,w,0,2*Math.PI),e.fillStyle="#FFFFFF",e.fill(),a}function me({id:t,width:r,height:n,color:a,scale:e}){const s=2*e,o=r/2*e,c=n*e,w=.6,d=.01,M=c*w,T=c,S=8*e,x=T+s+M/2+S*2,f=o*2+M+s+S*2,p=document.createElement("canvas");p.setAttribute("id",t),p.width=x,p.height=f;const l=p.getContext("2d"),P=x/2,b=f/2;l.save(),l.translate(P,b),l.rotate(-Math.PI/2),l.translate(-P,-b);const g=P,y=b-T/2+o,I=y+M;return l.shadowColor="rgba(16, 24, 40, 0.2)",l.shadowBlur=S/2,l.beginPath(),l.arc(g,y,o,Math.PI,0,!1),l.bezierCurveTo(g+o,y+c*.3,g+d*o,I,g,I),l.bezierCurveTo(g-d*o,I,g-o,y+c*.3,g-o,y),l.closePath(),l.fillStyle=a,l.fill(),l.strokeStyle="#FFFFFF",l.lineWidth=s,l.stroke(),l.restore(),p}function oe(t,r){return le(t,r)}function re(t){return`${t}_finery`}function we({updateQueue:t,vehicle:r,vehicleFinery:n,x:a,y:e,scale:s,angle:o}){if(r.bounds=k(a,e,r.source.width,r.source.height,s,o),r.hidden=!1,n){const c=ue()?.state().roll??0;n.bounds=k(a,e,n.source.width,n.source.height,s,Me(c)),n.hidden=!1,t.add(()=>W(n,r))}else t.add(()=>W(r))}function J(t,r,n){return{x:t.x+(r.x-t.x)*n,y:t.y+(r.y-t.y)*n}}function pe(t,r){let n=1/0,a={index:0,t:0};for(let e=0;e<r.length-1;e++){const s=r[e],o=r[e+1],c=o.x-s.x,w=o.y-s.y,d=c*c+w*w,M=d?((t.x-s.x)*c+(t.y-s.y)*w)/d:0,T=Math.max(0,Math.min(1,M)),S=J(s,o,T),x=oe(t,S);x<n&&(n=x,a={index:e,t:T})}return a}function He(t,r,n){const a=oe(t,r),e=Math.max(2,Math.ceil(a/n)+1),s=[];for(let o=0;o<e;o++){const c=o/(e-1),w=J(t,r,c);s.push(w)}return s}function We(t,r,n){if(!n||!n.length)return He(t,r,10);const a=pe(t,n),e=pe(r,n),s=[],o=c=>s.push(c);a.index+1<n.length?o(J(n[a.index],n[a.index+1],a.t)):o(n[a.index]);for(let c=a.index+1;c<=e.index&&c<n.length;c++)o(n[c]);return e.index+1<n.length?o(J(n[e.index],n[e.index+1],e.t)):o(n[e.index]),s}function ke(t,r,n,a){if(t.length<2)return()=>{};let e=null,s;const o=[];let c=0;for(let d=0;d<t.length-1;d++){const M=le(t[d],t[d+1]);o.push(M),c+=M}const w=d=>{e||(e=d);const M=d-e,T=Math.min(M/r,1),S=T*c;let x=0,f=0;for(;f<o.length&&x+o[f]<S;)x+=o[f],f++;f>=o.length&&(f=o.length-1);const p=t[f],l=t[Math.min(f+1,t.length-1)],P=o[f]||0,b=P===0?0:(S-x)/P,g=p.x+(l.x-p.x)*b,y=p.y+(l.y-p.y)*b,I=ae(p,l);n({x:g,y,angle:I}),T<1?s=requestAnimationFrame(w):a&&a()};return s=requestAnimationFrame(w),()=>{s&&cancelAnimationFrame(s)}}function ce(t){return`${t.x},${t.y}`}
@@ -2,5 +2,34 @@ import { IAutorunOptions, IReactionOptions, IReactionPublic } from 'mobx';
2
2
  import { DependencyList, EffectCallback } from 'react';
3
3
  export declare function useAutorun(view: (r: IReactionPublic) => any, opts?: IAutorunOptions): void;
4
4
  export declare function useReaction<T>(expression: (r: IReactionPublic) => T, effect: (arg: T, r: IReactionPublic) => void, opts?: IReactionOptions, deps?: DependencyList): void;
5
+ /**
6
+ * Watches a **one-shot store command** — a flag the store sets and the consumer clears — from the
7
+ * first moment the consumer can actually act on one.
8
+ *
9
+ * Both halves of that matter, and a plain `reaction` gets both wrong for these flags:
10
+ *
11
+ * - It cannot see a command set *before* it subscribed. A reaction adopts whatever the expression
12
+ * reads at subscribe time as its baseline, so such a command is never delivered and, since
13
+ * nothing re-sets it, sits unhandled forever.
14
+ * - It would act on one set *too early*. The scene fits its space to the canvas in an effect of its
15
+ * own, and React runs a parent's effects after its children's, so a consumer mounted under the
16
+ * scene has no usable camera until the next frame. A command spent there is consumed and lost.
17
+ *
18
+ * Both windows are real, and the plan opens them itself: it reports `ready` from the same
19
+ * synchronous block that hands React the scene, so `<MapCamera>` mounts a commit after a host can
20
+ * first call in, and its camera is only fitted the frame after that. A host that selects a booth on
21
+ * `ready` lands in one window or the other depending on how loaded the machine is — the booth
22
+ * highlighted, and the camera never moved.
23
+ *
24
+ * So the whole subscription waits for the end of the mounting commit, and drains whatever has piled
25
+ * up by then.
26
+ * @param read - Reads the command flag.
27
+ * @param handle - Acts on it and clears it. Also called with the flag's cleared value, which every
28
+ * handler already guards against — that is what makes each command land exactly once.
29
+ * @returns Disposes the watch.
30
+ */
31
+ export declare function watchOneShot<T>(read: () => T, handle: (value: T) => void): () => void;
32
+ /** {@link watchOneShot}, held for as long as the component is mounted. */
33
+ export declare function useOneShotReaction<T>(read: () => T, handle: (value: T) => void, deps?: DependencyList): void;
5
34
  export declare function useInit(effect: EffectCallback): void;
6
35
  //# sourceMappingURL=mobx.d.ts.map
@@ -1 +1 @@
1
- import{autorun as e,reaction as i}from"mobx";import{useEffect as n}from"react";export function useAutorun(t,r){return n(()=>e(t,r),[])}export function useReaction(t,r,o,u=[]){return n(()=>i(t,r,o),u)}export function useInit(t){return n(t,[])}
1
+ import{autorun as c,reaction as u,untracked as a}from"mobx";import{useEffect as o}from"react";export function useAutorun(t,e){return o(()=>c(t,e),[])}export function useReaction(t,e,n,r=[]){return o(()=>u(t,e,n),r)}function m(t){if(typeof requestAnimationFrame=="function"){const n=requestAnimationFrame(t);return()=>cancelAnimationFrame(n)}const e=setTimeout(t,0);return()=>clearTimeout(e)}export function watchOneShot(t,e){let n;const r=m(()=>{n=u(t,i=>e(i)),e(a(t))});return()=>{r(),n?.()}}export function useOneShotReaction(t,e,n=[]){return o(()=>watchOneShot(t,e),n)}export function useInit(t){return o(t,[])}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expofp/floorplan",
3
- "version": "3.31.0",
3
+ "version": "3.31.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/expofp/efp-app.git",
@@ -69,15 +69,15 @@
69
69
  "tslib": "^2.3.0",
70
70
  "uuid": "^9.0.1",
71
71
  "zod": "4.4.3",
72
- "@expofp/config": "3.31.0",
73
- "@expofp/debug": "3.31.0",
74
- "@expofp/geometry": "3.31.0",
75
- "@expofp/renderer": "3.31.0",
76
- "@expofp/resolve": "3.31.0",
77
- "@expofp/schema": "3.31.0",
78
- "@expofp/ui": "3.31.0",
79
- "@expofp/utils": "3.31.0",
80
- "@expofp/wayfinding": "3.31.0"
72
+ "@expofp/config": "3.31.2",
73
+ "@expofp/debug": "3.31.2",
74
+ "@expofp/geometry": "3.31.2",
75
+ "@expofp/renderer": "3.31.2",
76
+ "@expofp/resolve": "3.31.2",
77
+ "@expofp/schema": "3.31.2",
78
+ "@expofp/ui": "3.31.2",
79
+ "@expofp/utils": "3.31.2",
80
+ "@expofp/wayfinding": "3.31.2"
81
81
  },
82
82
  "devDependencies": {
83
83
  "@babel/plugin-proposal-decorators": "^8.0.2",
@@ -1,24 +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.31.0" };
5
- var t = new e.Error().stack;
6
- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "0b582490-601d-4ef4-92bb-5f520fa5717f", e._sentryDebugIdIdentifier = "sentry-dbid-0b582490-601d-4ef4-92bb-5f520fa5717f");
7
- } catch {}
8
- })();
9
- import { r as e } from "./rolldown-runtime-DB1nSOXr.js";
10
- import { f as t, v as n } from "./i18n-C3pmOHfm.js";
11
- import { t as r } from "./react-yYxHcXya.js";
12
- //#region src/utils/mobx.ts
13
- var i = /* @__PURE__ */ e(r(), 1);
14
- function a(e, n) {
15
- return (0, i.useEffect)(() => t(e, n), []);
16
- }
17
- function o(e, t, r, a = []) {
18
- return (0, i.useEffect)(() => n(e, t, r), a);
19
- }
20
- function s(e) {
21
- return (0, i.useEffect)(e, []);
22
- }
23
- //#endregion
24
- export { s as n, o as r, a as t };