@expofp/floorplan 3.31.5 → 3.33.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 (86) hide show
  1. package/dist/browser/{Button-mKKtMaKw.js → Button-B0MFYLVc.js} +5 -5
  2. package/dist/browser/{CookieConsent-CaeEjvef.js → CookieConsent-Bqn0q_87.js} +7 -7
  3. package/dist/browser/{Debug-ByQ2D2dH.js → Debug-CKc3n1sg.js} +7 -7
  4. package/dist/browser/{DebugTools-CrQ601uz.js → DebugTools-BU3wjPGB.js} +20 -14
  5. package/dist/browser/{Demo-BEG9WGtY.js → Demo-D-TB4mNu.js} +9 -9
  6. package/dist/browser/{Free-DDNBwdb4.js → Free-TLOhTU_Z.js} +9 -9
  7. package/dist/browser/{GalleryContainer-DC4MIoUB.js → GalleryContainer-G381lvbx.js} +10 -10
  8. package/dist/browser/{GpsLoader-Cb3Jn0SF.js → GpsLoader-DL-xnnfg.js} +10 -10
  9. package/dist/browser/{KioskStore-DwefEZJv.js → KioskStore-DluWuejk.js} +5 -5
  10. package/dist/browser/{MaplibreAdapter-CifXETn9.js → MaplibreAdapter-CKpyQZkH.js} +756 -756
  11. package/dist/browser/{ModalContainer-CQz6jqA-.js → ModalContainer-BJuhy7tC.js} +10 -10
  12. package/dist/browser/{PermissionNotice-CqTjqOc1.js → PermissionNotice-DzavRwDB.js} +6 -6
  13. package/dist/browser/{SetKioskMode-Be7XLJXO.js → SetKioskMode-DQMJq09_.js} +9 -9
  14. package/dist/browser/{ShowKiosk-DL_Q07Gd.js → ShowKiosk-txc4lzXg.js} +10 -10
  15. package/dist/browser/{ViewerMenuPanel-Cb_oSrj6.js → ViewerMenuPanel-BDDILMLj.js} +9 -9
  16. package/dist/browser/{add-debug-secret-listener-D68x0JzQ.js → add-debug-secret-listener-jHopjZKv.js} +1 -1
  17. package/dist/browser/{adopt-global-settings-DkKNipAa.js → adopt-global-settings-33HggKBq.js} +9 -9
  18. package/dist/browser/{boolean-editor-D1VLmY-G.js → boolean-editor-CtUCInIZ.js} +9 -9
  19. package/dist/browser/{bootIntercom-CTFEKSae.js → bootIntercom-BeXT05Ea.js} +2 -2
  20. package/dist/browser/bundle.json +69 -69
  21. package/dist/browser/{camera-events-DDYWmzBD.js → camera-events-KroE96c4.js} +1 -1
  22. package/dist/browser/{classnames-BqzsgTpz.js → classnames-BJTcQIVl.js} +2 -2
  23. package/dist/browser/{client-DJ-iLXjM.js → client-Cj1mLS94.js} +5 -5
  24. package/dist/browser/{components-97YziTS4.js → components-6-iibf5i.js} +586 -582
  25. package/dist/browser/{debug-context-DBNteiNS.js → debug-context-_45jR8C-.js} +5 -5
  26. package/dist/browser/{debug-overlay-DaZTMQya.js → debug-overlay-C78aQduk.js} +10 -10
  27. package/dist/browser/{debug-ui-CXT3AMeX.js → debug-ui-Bzg8w5FY.js} +6 -6
  28. package/dist/browser/{dimming-u8Zv6QXM.js → dimming-B0nptLJO.js} +284 -255
  29. package/dist/browser/{dist-B27MlguZ.js → dist-BfBy25r6.js} +3 -3
  30. package/dist/browser/{dist-Bi5cUWZd.js → dist-DX9URKQh.js} +6 -6
  31. package/dist/browser/{dist-DVLRx6WZ.js → dist-LJcBFXUG.js} +5 -5
  32. package/dist/browser/{efp-debug-init-17YNGSXY.js → efp-debug-init-tAoJiV3q.js} +3 -3
  33. package/dist/browser/{enum-editor-CgJqhQQj.js → enum-editor-12NAdvKo.js} +4 -4
  34. package/dist/browser/{es5-yWlyHX_p.js → es5-D-Bj8Lf1.js} +2 -2
  35. package/dist/browser/{event-not-found-Cf24gWHM.js → event-not-found-CsAHzhl6.js} +1 -1
  36. package/dist/browser/{exports-6WlUkCNV.js → exports-BfhFANKi.js} +1 -1
  37. package/dist/browser/{favicon-CHtB7K8N.js → favicon-D4TW1swv.js} +1 -1
  38. package/dist/browser/{fetch-retry.umd--zg_elhT.js → fetch-retry.umd-DyLfSwjv.js} +2 -2
  39. package/dist/browser/{flex-Dz7NeN25.js → flex-C3cSMVt_.js} +5 -5
  40. package/dist/browser/{floorplan.loader-DIAEgvEt.js → floorplan.loader-DxRhDqfH.js} +10 -10
  41. package/dist/browser/{floorplan.ready-BIf6c0FW.js → floorplan.ready-RkqlzsJt.js} +14 -14
  42. package/dist/browser/{fuse-DfART0OL.js → fuse-CSGWbbNq.js} +2 -2
  43. package/dist/browser/{i18n-bHRUw1mA.js → i18n-EK2oa1QJ.js} +5 -5
  44. package/dist/browser/index.js +14 -14
  45. package/dist/browser/{index.module-DmjVCZHn.js → index.module-BwOjEcud.js} +4 -4
  46. package/dist/browser/{integrateKiosk-D67hYrGI.js → integrateKiosk-DT0yChCb.js} +4 -4
  47. package/dist/browser/{is-webview-Csx5pb0V.js → is-webview-CW_tK_lH.js} +1 -1
  48. package/dist/browser/{jsx-runtime-Dn7hdmu5.js → jsx-runtime-DAYaJ8Wj.js} +2 -2
  49. package/dist/browser/{kiosk-record-vzQJMgF0.js → kiosk-record-DSOWQWwy.js} +1 -1
  50. package/dist/browser/{lib-BcsJM1rc.js → lib-DS8gxXh1.js} +3 -3
  51. package/dist/browser/{loadImage-CRy9JSd7.js → loadImage-Chqtrnpo.js} +4 -4
  52. package/dist/browser/{logDeviceInfo-B3BrYfIV.js → logDeviceInfo-C3nIx8MI.js} +9 -9
  53. package/dist/browser/{mobx-2XzX6bdM.js → mobx-BYaAarcI.js} +4 -4
  54. package/dist/browser/{optional-boolean-editor-BG5rNmWY.js → optional-boolean-editor-f0AsQ88K.js} +3 -3
  55. package/dist/browser/{optional-enum-editor-wdmWUlfz.js → optional-enum-editor-DTfOMkVp.js} +4 -4
  56. package/dist/browser/{optional-string-editor-CIliTeZ9.js → optional-string-editor-Dweo1EiQ.js} +4 -4
  57. package/dist/browser/{particles.min-D1nx3Op2.js → particles.min-DcgQ3bEa.js} +2 -2
  58. package/dist/browser/{react-BmK8B4fr.js → react-CSfcl6m_.js} +2 -2
  59. package/dist/browser/{react-dom-CPlbYs7G.js → react-dom-BtTajUTr.js} +3 -3
  60. package/dist/browser/{rolldown-runtime-Dzc5AnjB.js → rolldown-runtime-LBfc_8zH.js} +1 -1
  61. package/dist/browser/{scheduler-DMnChypu.js → scheduler-CO29sRve.js} +2 -2
  62. package/dist/browser/{select-C_IqLMZX.js → select-ZMZ_S_qj.js} +10 -10
  63. package/dist/browser/{settings-fuQTfBgk.js → settings-Cot3Zp4u.js} +2 -2
  64. package/dist/browser/{settings-item-d3ZY7kxc.js → settings-item-D5PjVyNk.js} +6 -6
  65. package/dist/browser/{store-CNHtWyas.js → store-BUXXD8-o.js} +212 -209
  66. package/dist/browser/{string-editor-BXQ0wGmI.js → string-editor-Bdjy-hXr.js} +4 -4
  67. package/dist/browser/{text-field-BrcwmJFh.js → text-field-Db4wvBQb.js} +5 -5
  68. package/dist/browser/{theme-CUL1Ad6_.js → theme-DOvsIfDN.js} +8 -8
  69. package/dist/browser/{ui-DLRQM62S.js → ui-exQmHhHz.js} +8 -8
  70. package/dist/browser/{useRenderTarget-najmvuxU.js → useRenderTarget-COoBm3gN.js} +4 -4
  71. package/dist/browser/{viewport-DNUkKIGk.js → viewport-D14jB-aG.js} +2 -2
  72. package/dist/esm/components/Map/Map.js +1 -1
  73. package/dist/esm/components/Map/MapCursorCoords.d.ts +13 -0
  74. package/dist/esm/components/Map/MapCursorCoords.js +1 -0
  75. package/dist/esm/components/Map/drawing/config/config-booth-badge.js +1 -1
  76. package/dist/esm/components/Map/drawing/config/config-booth-bookmark.d.ts +2 -2
  77. package/dist/esm/components/Map/drawing/config/config-booth-bookmark.js +1 -1
  78. package/dist/esm/components/Map/drawing/config/config-booth-labels-special.js +2 -2
  79. package/dist/esm/components/Map/drawing/config/config-booth-labels.js +1 -1
  80. package/dist/esm/components/Maplibre/MaplibreAdapter.js +1 -1
  81. package/dist/esm/engine/update-def.d.ts +19 -28
  82. package/dist/esm/engine/update-def.js +1 -1
  83. package/dist/esm/engine/utils/rotation.d.ts +9 -2
  84. package/dist/esm/engine/utils/rotation.js +1 -1
  85. package/dist/esm/wayfinding/createWayfinding.js +1 -1
  86. 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.31.5" };
4
+ e.SENTRY_RELEASE = { id: "3.33.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-Dn7hdmu5.js";
10
- import { t } from "./settings-item-d3ZY7kxc.js";
11
- import { t as n } from "./text-field-BrcwmJFh.js";
9
+ import { t as e } from "./jsx-runtime-DAYaJ8Wj.js";
10
+ import { t } from "./settings-item-D5PjVyNk.js";
11
+ import { t as n } from "./text-field-Db4wvBQb.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.5" };
4
+ e.SENTRY_RELEASE = { id: "3.33.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-Dzc5AnjB.js";
10
- import { t } from "./react-BmK8B4fr.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-Dz7NeN25.js";
12
- import { t as l } from "./classnames-BqzsgTpz.js";
9
+ import { r as e } from "./rolldown-runtime-LBfc_8zH.js";
10
+ import { t } from "./react-CSfcl6m_.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-C3cSMVt_.js";
12
+ import { t as l } from "./classnames-BJTcQIVl.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.5" };
4
+ e.SENTRY_RELEASE = { id: "3.33.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-Dzc5AnjB.js";
10
- import { t } from "./react-BmK8B4fr.js";
11
- import { t as n } from "./jsx-runtime-Dn7hdmu5.js";
12
- import { t as r } from "./react-dom-CPlbYs7G.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-Dz7NeN25.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-Bi5cUWZd.js";
15
- import { t as y } from "./classnames-BqzsgTpz.js";
9
+ import { r as e } from "./rolldown-runtime-LBfc_8zH.js";
10
+ import { t } from "./react-CSfcl6m_.js";
11
+ import { t as n } from "./jsx-runtime-DAYaJ8Wj.js";
12
+ import { t as r } from "./react-dom-BtTajUTr.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-C3cSMVt_.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-DX9URKQh.js";
15
+ import { t as y } from "./classnames-BJTcQIVl.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.5" };
4
+ e.SENTRY_RELEASE = { id: "3.33.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-Dzc5AnjB.js";
10
- import { a as t, i as n, s as r } from "./efp-debug-init-17YNGSXY.js";
11
- import { a as i, i as a } from "./adopt-global-settings-DkKNipAa.js";
12
- import { t as o } from "./jsx-runtime-Dn7hdmu5.js";
13
- import "./settings-fuQTfBgk.js";
14
- import { t as s } from "./add-debug-secret-listener-D68x0JzQ.js";
9
+ import { r as e } from "./rolldown-runtime-LBfc_8zH.js";
10
+ import { a as t, i as n, s as r } from "./efp-debug-init-tAoJiV3q.js";
11
+ import { a as i, i as a } from "./adopt-global-settings-33HggKBq.js";
12
+ import { t as o } from "./jsx-runtime-DAYaJ8Wj.js";
13
+ import "./settings-Cot3Zp4u.js";
14
+ import { t as s } from "./add-debug-secret-listener-jHopjZKv.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-CXT3AMeX.js"), { createRoot: i } = await import("./client-DJ-iLXjM.js").then((t) => /* @__PURE__ */ e(t.t(), 1)), a = document.createElement("div");
29
+ let { DebugUi: n } = await import("./debug-ui-Bzg8w5FY.js"), { createRoot: i } = await import("./client-Cj1mLS94.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.5" };
4
+ e.SENTRY_RELEASE = { id: "3.33.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-Dzc5AnjB.js";
10
- import { t } from "./react-BmK8B4fr.js";
11
- import { l as n } from "./store-CNHtWyas.js";
9
+ import { r as e } from "./rolldown-runtime-LBfc_8zH.js";
10
+ import { t } from "./react-CSfcl6m_.js";
11
+ import { l as n } from "./store-BUXXD8-o.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.5" };
4
+ e.SENTRY_RELEASE = { id: "3.33.0" };
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-CNHtWyas.js";
9
+ import { c as e, vt as t } from "./store-BUXXD8-o.js";
10
10
  //#region src/components/Map/viewport.ts
11
11
  function n(e) {
12
12
  return {
@@ -1 +1 @@
1
- import{jsx as S,jsxs as P}from"react/jsx-runtime";import{Renderer as _,update as h}from"@expofp/renderer";import F from"classnames";import{observable as D}from"mobx";import{useObserver as b}from"mobx-react-lite";import{useEffect as g,useMemo as N,useRef as y,useState as O}from"react";import z from"../../data";import{svgArea as k}from"../../data/svg";import{createSceneDef as j}from"../../engine/defs";import i,{layersStore as d,uiState as m}from"../../store";import f from"../../tools/settings";import{applyVenueDim as I,createDimmingAnimator as V}from"../../utils/dimming";import Z from"../../utils/is-debug";import{isPathwayLayer as x}from"../../utils/is-pathway-layer";import{useReaction as v}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{MapViewport as H}from"./MapViewport";import{clearSelection as G}from"./pointer";import{setMapScene as E}from"./scene";import{useBuildRoute as J}from"./traffic/useBuildRoute";import{useManageTraffic as q}from"./traffic/useManageTraffic";import{centerCoordinates as K}from"./viewport";const Q="#ebebeb",C="routes-api.expofp.com",Y=1e4;function ee(t){return Number.isFinite(f.maxZoom)?f.maxZoom:t.viewbox.size.width>Y?100:35}function re(){if(!i.fp.enableRotation)return!1;const t=m.mapSettings.roll;return t===void 0||Number(t)===1}function oe(){return f.EXPO==="imexamerica25-3d"?!0:void 0}function te(){const t=m.mapSettings.zoomtime;if(!(!t||t===m.defaultMapSettings.zoomtime))return{zoomTime:t/1e3}}export default function ne(){const t=y(null),l=N(()=>D({moving:!1,prevLevel:i.layerStore.layers.find(r=>!r.frozen&&r.visible)}),[]),[o,T]=O(void 0),c=y(null),p=y(null);function R(){d.layers.forEach(r=>{r.configured=!1,r.children=[],r.loaded=!1})}g(()=>{let r=!1;return R(),d.layersLoaded=!1,U().then(({layers:s,cleanup:a})=>{if(r){a();return}p.current=a;const n=f.backgroundColor==="none"?Q:f.backgroundColor,e=j(s,k,n);T(e),E(e),c.current=V(u=>{I(e,u)&&h(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),R()}},[]),v(()=>m.dimmed,r=>{c.current?.setTarget(r)}),g(()=>{i.fp.getCenterCoordinates=()=>K(t.current)},[]),g(()=>{if(!o)return;const r=$({scene:o,store:i,canvas:t}),s=W({scene:o});return()=>{r(),s()}},[o]),v(()=>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&&h(...n)},void 0,[o]),v(()=>i.layerStore.visible,r=>{if(!o)return;const s=r.filter(e=>x(e.name)),a=o.rootLayer.children,n=[];for(const e of a){if(!x(e.name))continue;const u=!s.find(A=>A.name===e.name);e.hidden!==u&&(e.hidden=u,n.push(e))}n.length&&h(...n)},void 0,[o]);const L=b(()=>d.layersLoaded),M=b(()=>!!m.buildRoute);J({enabled:L&&M,scene:o});const w=z.busRoutes??!1;return q({permission:L&&w,scene:o,dataJsonUrl:`https://${C}/v1/routes?expo=${f.EXPO}`,websocketUrl:`wss://${C}/locations?expo=${f.EXPO}`}),b(()=>o?P(_,{debug:Z,style:{width:"100%",height:"100%"},ref:t,className:F({map:!0}),scene:o,maxZoom:ee(o),bounds:d.bounds,controls:{roll:re(),pitch:oe()},smoothTime:te(),visibleRect:m.canvasVisibleRectPx,onPointerMissed:G,children:[S(B,{}),S(H,{})]}):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 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)}
@@ -0,0 +1,13 @@
1
+ import { type RefObject } from 'react';
2
+ /**
3
+ * Publishes the plan coordinates under the pointer to the debug panel. Debug builds only.
4
+ *
5
+ * Rendered inside `<Renderer>`: `useViewport` and the panel resolve nowhere else, and each view
6
+ * passes its own canvas.
7
+ * @param props - The canvas the plan draws on.
8
+ * @returns Nothing; this renders no scene node.
9
+ */
10
+ export declare function MapCursorCoords(props: {
11
+ canvas: RefObject<HTMLCanvasElement | null>;
12
+ }): null;
13
+ //# sourceMappingURL=MapCursorCoords.d.ts.map
@@ -0,0 +1 @@
1
+ import{useDebugPanel as m,useViewport as v}from"@expofp/renderer";import{useCallback as l,useEffect as p,useEffectEvent as E}from"react";import L from"../../store";import{LayerMode as u}from"../../store/LayerStore";const a=2;export function MapCursorCoords(r){const{canvas:e}=r,o=v(),s=m(),i=l(()=>s("cursor",void 0),[s]),f=E(n=>{if(!n.isPrimary)return;const t=o.canvasToPlan({x:n.offsetX,y:n.offsetY});s("cursor",t?x(t,b()):void 0)});return p(()=>{const n=e.current;if(!n)return;const t=d=>f(d),c=()=>i();return n.addEventListener("pointermove",t),n.addEventListener("pointerleave",c),()=>{n.removeEventListener("pointermove",t),n.removeEventListener("pointerleave",c)}},[e,i]),null}function b(){return L.layerStore.layers.find(e=>e.visible&&(e.mode===u.TurnedOn||e.mode===u.TurnedOff))?.name||null}function x(r,e){const o=`[${r.x.toFixed(a)}, ${r.y.toFixed(a)}]`;return e?`${o} \xB7 layer ${e}`:o}
@@ -1 +1 @@
1
- import{Box as J,pointRotate as R,Polygon as K,Rect as v}from"@expofp/geometry";import{update as L}from"@expofp/renderer";import Q from"color";import{reaction as P}from"mobx";import{SEPARATOR as G}from"../../../../constants";import U from"../../../../data";import{getTrianglesFromFpPaths as Y}from"../../../../data/svg";import{createShapeDef as tt,createTextDef as et,createTextDefLines as nt}from"../../../../engine/defs";import{loadCustomFontsUrls as ot}from"../../../../engine/fonts";import{getRollValue as rt,getRotation as st}from"../../../../engine/update-def";import{boothStore as it,uiState as N}from"../../../../store";import{RegularBooth as ct}from"../../../../store/BoothStore";import k from"../../../../tools/settings";import{getContrastTextColor as at}from"../../../../utils/getContrastTextColor";import{getFont as lt}from"./canvases";import{isBoothBadgeEligible as dt}from"./config-booth-badge-eligibility";import{getBadgeFontWeight as ht,getFontUrlByWeight as ut}from"./config-booth-labels";const ft=.5,gt=.3,z=15,mt=24,X=30,xt=12,pt=12,Z=.8,V=document.createElement("canvas").getContext("2d");function yt(t){return t.length<=z?t:t.slice(0,z-1)+"\u2026"}function j(t){if(!t.paths?.length)return[];const n=t.layer?.name||"",e=[];for(const o of t.paths)for(const r of Y(o.index,n))e.push(r);return e}function Bt(t){const n=j(t);return n.length?J.fromPoints(n.flat().map(([e,o])=>({x:e,y:o}))):null}function St(t){const n=[],e=[];for(const o of t){const r=n.length;n.push({x:o[0][0],y:o[0][1]}),n.push({x:o[1][0],y:o[1][1]}),n.push({x:o[2][0],y:o[2][1]}),e.push([r,r+1,r+2])}return new K(n,e)}function H(t,n,e){return e.containsPoint({x:t,y:n})}function At(t,n,e,o,r,d,i,c){if(!t.length||!H(e,o,n))return i;const h={x:e,y:o};let a=0,f=i;const A=10;for(let y=0;y<A;y++){const m=(a+f)/2,I=r*m,g=d*m;[R({x:e+I,y:o},c,h),R({x:e,y:o+g},c,h),R({x:e+I,y:o+g},c,h)].every(l=>H(l.x,l.y,n))?a=m:f=m}return a}function Et(t){return Bt(t)??t.rect}function Tt(t,n,e,o,r,d){if(n.length){const a=Et(t),f={x:r>0?a.min.x:a.max.x,y:d>0?a.min.y:a.max.y},A=new Set;let y=null,m=1/0;for(const I of n)for(const g of I){const _=`${g[0]},${g[1]}`;if(A.has(_))continue;A.add(_);const u=g[0]+o*r,l=g[1]+o*d;if(H(u,l,e)){const B=Math.abs(u-f.x)+Math.abs(l-f.y);B<m&&(m=B,y={x:u,y:l})}}if(y)return y}const i=r>0?t.rect.min.x+o:t.rect.max.x-o,c=d>0?t.rect.min.y+o:t.rect.max.y-o,h=t.rotate??0;return h?R({x:i,y:c},h,t.rect.center):{x:i,y:c}}function W(t){return t&&t!=="none"?t:void 0}function It(t){const n=W(t.borderColor)||W(k.boothBorderColor)||k.colors.booths.default;return t.paths?.length>1&&W(t.paths[t.paths.length-1].color)||n}export function createBoothBadge(t){const n=yt(t.title||t.name),e=It(t),o=at(Q(e).hex()),r=ht(),d=lt(X,r);V.font=d;const i=V.measureText(n).width,c=Math.ceil(i+xt*2),h=X+pt*2,a=(t.borderWidth||it.borderWidth)/2,f=c*Z,A=h*Z,y=t.rect.size.width,m=t.rect.size.height,I=s=>{const E=s?m:y,p=s?y:m;return Math.min(E>0?E*ft/f:1/0,p>0?p*gt/A:1/0)},g=j(t),_=St(g);let u=t.rotate??0,l=0,B=0,D=0,O=0;const w=()=>{const p=Tt(t,g,_,a,l===0||l===3?1:-1,l===0||l===1?1:-1);B=p.x,D=p.y;const T=I(l===1||l===3);O=At(g,_,B,D,f,A,T,u)};w();const F=(s,E)=>{const p=s/2,T=E/2,q=R({x:B+p,y:D+T},u,{x:B,y:D});return new v(q,{x:s,y:E},u,t.elevation)},$=ut(r,ot()),x=tt(F(1,1),e);x.hidden=!0,x.dim=t.skipDim?0:void 0;const S=et(nt([[n],[]],o,0,[$,$]),F(1,1),[0,0],{horizontal:"center",vertical:"center"});S.hidden=!0,S.dim=t.skipDim?0:void 0;const C={booth:t,anchor:{x:B,y:D},source:{x:f,y:A},rotation:u,maxScale:O,bg:x,text:S},M=new BoothBadgeDrawer(C);x.onScale=({pixelSize:s})=>M.layOutBg(s),S.onScale=({pixelSize:s})=>M.layOutText(s);const b=[];return b.push(P(()=>t.skipDim,s=>{x.dim=s?0:void 0,S.dim=s?0:void 0,L(x,S)})),b.push(P(()=>t.layer?.visible??!0,s=>{x.hidden=!s,S.hidden=!s,L(x,S)})),b.push(P(()=>N.mapSettings,({roll:s})=>{rt(s??0)&&(x.onRoll=({roll:E,pixelSize:p})=>{const T=st(E,u);if(T!==void 0)return u+=T,l=(l+(T>0?1:3))%4,w(),C.anchor.x=B,C.anchor.y=D,C.rotation=u,C.maxScale=O,[...M.layOutBg(p),...M.layOutText(p)]})},{fireImmediately:!0})),{bg:x,text:S,dispose:()=>{b.forEach(s=>s()),b.length=0}}}export class BoothBadgeDrawer{constructor(n){this.placement=n}layOutBg(n){const{bg:e}=this.placement;return e.shape=this.rectScaled(n),e.hidden=this.isHidden(),e.hidden?[]:[e]}layOutText(n){const{text:e,maxScale:o}=this.placement;return e.lines[0].fontSize=mt*Math.min(n,o),e.bounds=this.rectScaled(n),e.hidden=this.isHidden(),e.hidden?[]:[e]}rectScaled(n){const{anchor:e,booth:o,source:r,rotation:d,maxScale:i}=this.placement,c=Math.min(n,i),h=r.x*c,a=r.y*c,f=R({x:e.x+h/2,y:e.y+a/2},d,e);return new v(f,{x:h,y:a},d,o.elevation)}isHidden(){const{booth:n}=this.placement;return!!(n.layer&&!n.layer.visible)}}export function configBoothsBadges(t,n){const e=[],o=[],r=[];for(const i of n)if(i instanceof ct&&dt({hideExhibitorBoothNumber:U.hideExhibitorBoothNumber,hideBoothBadges:U.hideBoothBadges,hideLogoInBooth:N.hideLogoInBooth,noLabels:i.noLabels,hasExhibitors:i.exhibitors.length>0,hasLogoInBooth:i.exhibitors.some(c=>c.logoInBooth&&c.logo)})){const{bg:c,text:h,dispose:a}=createBoothBadge(i);e.push(c),o.push(h),r.push(a)}const d=()=>{r.forEach(i=>i()),r.length=0};return e.length?{layer:{name:`${t}${G}badges`,children:[{name:`${t}${G}badgeBgs`,children:e},{name:`${t}${G}badgeTexts`,children:o}]},cleanup:d}:{layer:null,cleanup:d}}
1
+ import{Box as q,pointRotate as R,Polygon as J,Rect as v}from"@expofp/geometry";import{update as L}from"@expofp/renderer";import K from"color";import{reaction as P}from"mobx";import{SEPARATOR as G}from"../../../../constants";import U from"../../../../data";import{getTrianglesFromFpPaths as Y}from"../../../../data/svg";import{createShapeDef as tt,createTextDef as et,createTextDefLines as nt}from"../../../../engine/defs";import{loadCustomFontsUrls as ot}from"../../../../engine/fonts";import{getQuarterTurns as rt,getRollValue as st}from"../../../../engine/update-def";import{boothStore as it,uiState as N}from"../../../../store";import{RegularBooth as ct}from"../../../../store/BoothStore";import k from"../../../../tools/settings";import{getContrastTextColor as at}from"../../../../utils/getContrastTextColor";import{getFont as lt}from"./canvases";import{isBoothBadgeEligible as ht}from"./config-booth-badge-eligibility";import{getBadgeFontWeight as dt,getFontUrlByWeight as ut}from"./config-booth-labels";const ft=.5,gt=.3,z=15,mt=24,X=30,xt=12,pt=12,Z=.8,Q=document.createElement("canvas").getContext("2d");function yt(t){return t.length<=z?t:t.slice(0,z-1)+"\u2026"}function V(t){if(!t.paths?.length)return[];const n=t.layer?.name||"",e=[];for(const o of t.paths)for(const r of Y(o.index,n))e.push(r);return e}function Bt(t){const n=V(t);return n.length?q.fromPoints(n.flat().map(([e,o])=>({x:e,y:o}))):null}function St(t){const n=[],e=[];for(const o of t){const r=n.length;n.push({x:o[0][0],y:o[0][1]}),n.push({x:o[1][0],y:o[1][1]}),n.push({x:o[2][0],y:o[2][1]}),e.push([r,r+1,r+2])}return new J(n,e)}function H(t,n,e){return e.containsPoint({x:t,y:n})}function At(t,n,e,o,r,h,i,c){if(!t.length||!H(e,o,n))return i;const d={x:e,y:o};let a=0,f=i;const A=10;for(let y=0;y<A;y++){const m=(a+f)/2,I=r*m,g=h*m;[R({x:e+I,y:o},c,d),R({x:e,y:o+g},c,d),R({x:e+I,y:o+g},c,d)].every(l=>H(l.x,l.y,n))?a=m:f=m}return a}function Et(t){return Bt(t)??t.rect}function Tt(t,n,e,o,r,h){if(n.length){const a=Et(t),f={x:r>0?a.min.x:a.max.x,y:h>0?a.min.y:a.max.y},A=new Set;let y=null,m=1/0;for(const I of n)for(const g of I){const _=`${g[0]},${g[1]}`;if(A.has(_))continue;A.add(_);const u=g[0]+o*r,l=g[1]+o*h;if(H(u,l,e)){const B=Math.abs(u-f.x)+Math.abs(l-f.y);B<m&&(m=B,y={x:u,y:l})}}if(y)return y}const i=r>0?t.rect.min.x+o:t.rect.max.x-o,c=h>0?t.rect.min.y+o:t.rect.max.y-o,d=t.rotate??0;return d?R({x:i,y:c},d,t.rect.center):{x:i,y:c}}function W(t){return t&&t!=="none"?t:void 0}function It(t){const n=W(t.borderColor)||W(k.boothBorderColor)||k.colors.booths.default;return t.paths?.length>1&&W(t.paths[t.paths.length-1].color)||n}export function createBoothBadge(t){const n=yt(t.title||t.name),e=It(t),o=at(K(e).hex()),r=dt(),h=lt(X,r);Q.font=h;const i=Q.measureText(n).width,c=Math.ceil(i+xt*2),d=X+pt*2,a=(t.borderWidth||it.borderWidth)/2,f=c*Z,A=d*Z,y=t.rect.size.width,m=t.rect.size.height,I=s=>{const E=s?m:y,p=s?y:m;return Math.min(E>0?E*ft/f:1/0,p>0?p*gt/A:1/0)},g=V(t),_=St(g);let u=t.rotate??0,l=0,B=0,D=0,O=0;const w=()=>{const p=Tt(t,g,_,a,l===0||l===3?1:-1,l===0||l===1?1:-1);B=p.x,D=p.y;const T=I(l===1||l===3);O=At(g,_,B,D,f,A,T,u)};w();const F=(s,E)=>{const p=s/2,T=E/2,j=R({x:B+p,y:D+T},u,{x:B,y:D});return new v(j,{x:s,y:E},u,t.elevation)},$=ut(r,ot()),x=tt(F(1,1),e);x.hidden=!0,x.dim=t.skipDim?0:void 0;const S=et(nt([[n],[]],o,0,[$,$]),F(1,1),[0,0],{horizontal:"center",vertical:"center"});S.hidden=!0,S.dim=t.skipDim?0:void 0;const C={booth:t,anchor:{x:B,y:D},source:{x:f,y:A},rotation:u,maxScale:O,bg:x,text:S},b=new BoothBadgeDrawer(C);x.onScale=({pixelSize:s})=>b.layOutBg(s),S.onScale=({pixelSize:s})=>b.layOutText(s);const M=[];return M.push(P(()=>t.skipDim,s=>{x.dim=s?0:void 0,S.dim=s?0:void 0,L(x,S)})),M.push(P(()=>t.layer?.visible??!0,s=>{x.hidden=!s,S.hidden=!s,L(x,S)})),M.push(P(()=>N.mapSettings,({roll:s})=>{st(s??0)&&(x.onRoll=({roll:E,pixelSize:p})=>{const T=rt(E,u);if(T!==0)return u+=T*Math.PI/2,l=((l+T)%4+4)%4,w(),C.anchor.x=B,C.anchor.y=D,C.rotation=u,C.maxScale=O,[...b.layOutBg(p),...b.layOutText(p)]})},{fireImmediately:!0})),{bg:x,text:S,dispose:()=>{M.forEach(s=>s()),M.length=0}}}export class BoothBadgeDrawer{constructor(n){this.placement=n}layOutBg(n){const{bg:e}=this.placement;return e.shape=this.rectScaled(n),e.hidden=this.isHidden(),e.hidden?[]:[e]}layOutText(n){const{text:e,maxScale:o}=this.placement;return e.lines[0].fontSize=mt*Math.min(n,o),e.bounds=this.rectScaled(n),e.hidden=this.isHidden(),e.hidden?[]:[e]}rectScaled(n){const{anchor:e,booth:o,source:r,rotation:h,maxScale:i}=this.placement,c=Math.min(n,i),d=r.x*c,a=r.y*c,f=R({x:e.x+d/2,y:e.y+a/2},h,e);return new v(f,{x:d,y:a},h,o.elevation)}isHidden(){const{booth:n}=this.placement;return!!(n.layer&&!n.layer.visible)}}export function configBoothsBadges(t,n){const e=[],o=[],r=[];for(const i of n)if(i instanceof ct&&ht({hideExhibitorBoothNumber:U.hideExhibitorBoothNumber,hideBoothBadges:U.hideBoothBadges,hideLogoInBooth:N.hideLogoInBooth,noLabels:i.noLabels,hasExhibitors:i.exhibitors.length>0,hasLogoInBooth:i.exhibitors.some(c=>c.logoInBooth&&c.logo)})){const{bg:c,text:d,dispose:a}=createBoothBadge(i);e.push(c),o.push(d),r.push(a)}const h=()=>{r.forEach(i=>i()),r.length=0};return e.length?{layer:{name:`${t}${G}badges`,children:[{name:`${t}${G}badgeBgs`,children:e},{name:`${t}${G}badgeTexts`,children:o}]},cleanup:h}:{layer:null,cleanup:h}}
@@ -1,6 +1,6 @@
1
1
  import { Rect } from '@expofp/geometry';
2
- import { ImageDef } from '@expofp/renderer';
3
- import { Booth } from '../../../../store/BoothStore';
2
+ import { type ImageDef } from '@expofp/renderer';
3
+ import type { Booth } from '../../../../store/BoothStore';
4
4
  import { BoothDrawerBaseWithoutPainter } from './BoothDrawerBase';
5
5
  export default function configBoothBookmarkImage(booth: Booth): BoothBookmarkDrawer | undefined;
6
6
  export declare class BoothBookmarkDrawer extends BoothDrawerBaseWithoutPainter {
@@ -1 +1 @@
1
- import{Rect as r}from"@expofp/geometry";import{update as m}from"@expofp/renderer";import{reaction as s}from"mobx";import{createBookmarkCanvas as p}from"../../../../engine/canvases";import{createImageDef as c}from"../../../../engine/defs";import{getClampedBoundsCanvas as k,getRollValue as u,getRotation as l}from"../../../../engine/update-def";import{layersStore as a,uiState as h}from"../../../../store";import{BoothDrawerBaseWithoutPainter as f}from"./BoothDrawerBase";export default function b(i){if(!h.kiosk)return new BoothBookmarkDrawer(i)}export class BoothBookmarkDrawer extends f{constructor(t){super(t),this.getShape=()=>this.shape,this.padding=this.booth.borderWidth/2,this.rect=new r(this.booth.rect.center,this.booth.rect.size,this.booth.rotate,this.booth.elevation),this.canvas=p(11,devicePixelRatio),this.bookmarkId=`bookmark-${this.booth.id}`,this.shape=c(this.canvas,this.rect,{hidden:!t.bookmarked}),this.shape.onScale=({pixelSize:e})=>this.layOutBookmark(e),s(()=>[t.bookmarked,a.layersLoaded,this.booth.skipDim],()=>this.update(t.bookmarked),{fireImmediately:t.bookmarked}),s(()=>h.mapSettings,({roll:e})=>{u(e)&&(this.shape.onRoll=({roll:n,pixelSize:d})=>{const o=l(n,this.rect.rotation);if(o!==void 0)return this.rect=new r(this.rect.center,{x:this.rect.size.y,y:this.rect.size.x},this.rect.rotation+o,this.rect.elevation),this.layOutBookmark(d),[this.shape]})},{fireImmediately:!0})}update(t){a.layersLoaded&&(this.shape.hidden=!t,this.shape.dim=this.booth.skipDim?0:void 0,m(this.shape))}layOutBookmark(t){return this.shape.bounds=k(this.rect,this.canvas,this.padding,t),this.shape.hidden?[]:[this.shape]}}
1
+ import{Rect as m}from"@expofp/geometry";import{update as d}from"@expofp/renderer";import{reaction as i}from"mobx";import{createBookmarkCanvas as p}from"../../../../engine/canvases";import{createImageDef as u}from"../../../../engine/defs";import{getClampedBoundsCanvas as k,getQuarterTurns as c,getRollValue as l,rotateRectByQuarters as f}from"../../../../engine/update-def";import{layersStore as a,uiState as s}from"../../../../store";import{BoothDrawerBaseWithoutPainter as b}from"./BoothDrawerBase";export default function B(r){if(!s.kiosk)return new BoothBookmarkDrawer(r)}export class BoothBookmarkDrawer extends b{constructor(t){super(t),this.getShape=()=>this.shape,this.padding=this.booth.borderWidth/2,this.rect=new m(this.booth.rect.center,this.booth.rect.size,this.booth.rotate,this.booth.elevation),this.canvas=p(11,devicePixelRatio),this.bookmarkId=`bookmark-${this.booth.id}`,this.shape=u(this.canvas,this.rect,{hidden:!t.bookmarked}),this.shape.onScale=({pixelSize:e})=>this.layOutBookmark(e),i(()=>[t.bookmarked,a.layersLoaded,this.booth.skipDim],()=>this.update(t.bookmarked),{fireImmediately:t.bookmarked}),i(()=>s.mapSettings,({roll:e})=>{l(e??0)&&(this.shape.onRoll=({roll:h,pixelSize:n})=>{const o=c(h,this.rect.rotation);if(o!==0)return this.rect=f(this.rect,o),this.layOutBookmark(n),[this.shape]})},{fireImmediately:!0})}update(t){a.layersLoaded&&(this.shape.hidden=!t,this.shape.dim=this.booth.skipDim?0:void 0,d(this.shape))}layOutBookmark(t){return this.shape.bounds=k(this.rect,this.canvas,this.padding,t),this.shape.hidden?[]:[this.shape]}}
@@ -1,2 +1,2 @@
1
- import{Rect as m}from"@expofp/geometry";import{update as L}from"@expofp/renderer";import{reaction as f}from"mobx";import{FONT_WEIGHT_PRIMARY_BOOTH as g,FONT_WEIGHT_PRIMARY_SPECIAL as D}from"../../../../constants";import{createTextDef as y}from"../../../../engine/defs";import{loadCustomFontsUrls as F}from"../../../../engine/fonts";import{getRollValue as R,getRotation as x,shouldFlip as S,updateRectRotation as T,updateTextDefRotation as v}from"../../../../engine/update-def";import{heatmapStore as I,layersStore as w,uiState as l}from"../../../../store";import{SpecialBooth as z}from"../../../../store/BoothStore";import M from"../../../../tools/settings";import{getFont as O}from"./canvases";import{BoothLabelDrawer as k,getFontUrlByWeight as B,getMinZoomFactorForDot as C,isDirectionsMode as P}from"./config-booth-labels";import{LABEL_MARGIN_FRACTION as b}from"./label-inset.js";import _ from"./TextFitter";const c=new Map;function A(i){let t=c.get(i);if(!t){const s=[18,16,14,12,10,7].map(a=>a*i),e=14*i;t=new _(O,s,e),c.set(i,t),setTimeout(()=>c.delete(i),5e3)}return t}export default function N(i){if(!(!(i instanceof z)||i.noLabels))return new V(i)}class V extends k{constructor(t){super(t),this.steps=[],this.text="";const s=this.booth.rect,e=Number(getComputedStyle(document.body).getPropertyValue(D))||Number(getComputedStyle(document.body).getPropertyValue(g))||500,a=B(e,F()),h=s.expand({x:-(s.size.width*b+this.padding),y:-(s.size.height*b+this.padding)});this.setText(),this.canvasRect=new m(h.center,h.size,t.rotate,t.elevation),this.setFactors(this.text),this.labelIsVertical=Math.abs(Math.abs(t.rotate)-Math.PI/2)<.01,this.fontSizes=[this.steps,[]],this.minZoomDotVisible=C(this.steps.map(o=>o.scaleFactor)),this.shapeLabel=y([{text:this.text,color:t.labelColor||M.boothLabelColor,fontUrl:a,fontSize:0}],new m(h.center,h.size,t.rotate,t.elevation),[this.padding,this.padding],{horizontal:"center",text:"center",vertical:"center"}),this.shapeLabel.onScale=({pixelSize:o})=>this.layOutLabel(o),this.getShapeDot(),f(()=>[this.booth.skipDim,l.selectedRoute,w.layersLoaded],()=>{const o=P();this.shapeLabel.dim=o||this.booth.skipDim?!1:void 0,this.shapeDot.dim=o||this.booth.skipDim?!1:void 0,L(this.shapeLabel,this.shapeDot)}),f(()=>l.mapSettings,({roll:o})=>{R(o??0)&&(this.shapeLabel.onRoll=({roll:p,pixelSize:d})=>{const n=this.shapeLabel.bounds.rotation;if(this.labelIsVertical)return S(p,n)?(this.shapeLabel.bounds.rotate(-2*n,this.shapeLabel.bounds),[this.shapeLabel,this.shapeDot]):void 0;const r=x(p,n);if(r===void 0)return;const{size:u}=this.canvasRect;return this.shapeLabel=v(this.shapeLabel,r),u.x!==u.y&&!this.shapeLabel.hidden&&(this.canvasRect=T(this.canvasRect,r),this.setFactors(this.text),this.layOutLabel(d),this.layOutDot(d)),[this.shapeLabel,this.shapeDot]})},{fireImmediately:!0})}getShape(){return[this.shapeLabel,this.shapeDot]}layOutLabel(t){const s=this.steps.find(e=>e.scaleFactor<1/t);return s?(this.shapeLabel.lines[0].fontSize=s.value*t,this.shapeLabel.lines[0].text=s.lines.join(`
2
- `),this.shapeLabel.padding=[this.paddingScaled[0]*t+this.padding,this.paddingScaled[1]*t+this.padding],[this.shapeLabel]):(this.shapeLabel.lines[0].fontSize=0,[this.shapeLabel])}layOutDot(t){const s=this.steps.find(a=>a.scaleFactor<1/t),e=this.shapeDot.bounds;return e.scale({x:this.shapeDot.source.width*t/e.size.x,y:this.shapeDot.source.height*t/e.size.y},e.center,e),this.shapeDot.hidden=!!s,[this.shapeDot]}setFactors(t){this.steps=A(devicePixelRatio).getStepsForRect(t,this.canvasRect.size.x,this.canvasRect.size.y)}setText(){const t=this.booth.title||this.booth.name,e=`Clicks: ${I.getTotalClicksByBooth(this.booth)}`;this.text=l.heatmap?`${t} - ${e}`:t}}
1
+ import{Rect as m}from"@expofp/geometry";import{update as L}from"@expofp/renderer";import{reaction as b}from"mobx";import{FONT_WEIGHT_PRIMARY_BOOTH as g,FONT_WEIGHT_PRIMARY_SPECIAL as D}from"../../../../constants";import{createTextDef as y}from"../../../../engine/defs";import{loadCustomFontsUrls as F}from"../../../../engine/fonts";import{getQuarterTurns as x,getRollValue as R,rotateRectByQuarters as S,rotateTextDefByQuarters as T,shouldFlip as v}from"../../../../engine/update-def";import{heatmapStore as B,layersStore as I,uiState as l}from"../../../../store";import{SpecialBooth as w}from"../../../../store/BoothStore";import z from"../../../../tools/settings";import{getFont as M}from"./canvases";import{BoothLabelDrawer as O,getFontUrlByWeight as k,getMinZoomFactorForDot as C,isDirectionsMode as P}from"./config-booth-labels";import{LABEL_MARGIN_FRACTION as f}from"./label-inset.js";import _ from"./TextFitter";const c=new Map;function A(i){let t=c.get(i);if(!t){const s=[18,16,14,12,10,7].map(o=>o*i),e=14*i;t=new _(M,s,e),c.set(i,t),setTimeout(()=>c.delete(i),5e3)}return t}export default function N(i){if(!(!(i instanceof w)||i.noLabels))return new V(i)}class V extends O{constructor(t){super(t),this.steps=[],this.text="";const s=this.booth.rect,e=Number(getComputedStyle(document.body).getPropertyValue(D))||Number(getComputedStyle(document.body).getPropertyValue(g))||500,o=k(e,F()),h=s.expand({x:-(s.size.width*f+this.padding),y:-(s.size.height*f+this.padding)});this.setText(),this.canvasRect=new m(h.center,h.size,t.rotate,t.elevation),this.setFactors(this.text),this.labelIsVertical=Math.abs(Math.abs(t.rotate)-Math.PI/2)<.01,this.fontSizes=[this.steps,[]],this.minZoomDotVisible=C(this.steps.map(a=>a.scaleFactor)),this.shapeLabel=y([{text:this.text,color:t.labelColor||z.boothLabelColor,fontUrl:o,fontSize:0}],new m(h.center,h.size,t.rotate,t.elevation),[this.padding,this.padding],{horizontal:"center",text:"center",vertical:"center"}),this.shapeLabel.onScale=({pixelSize:a})=>this.layOutLabel(a),this.getShapeDot(),b(()=>[this.booth.skipDim,l.selectedRoute,I.layersLoaded],()=>{const a=P();this.shapeLabel.dim=a||this.booth.skipDim?0:void 0,this.shapeDot.dim=a||this.booth.skipDim?0:void 0,L(this.shapeLabel,this.shapeDot)}),b(()=>l.mapSettings,({roll:a})=>{R(a??0)&&(this.shapeLabel.onRoll=({roll:p,pixelSize:d})=>{const r=this.shapeLabel.bounds.rotation;if(this.labelIsVertical)return v(p,r)?(this.shapeLabel.bounds.rotate(-2*r,this.shapeLabel.bounds),[this.shapeLabel,this.shapeDot]):void 0;const n=x(p,r);if(n===0)return;const{size:u}=this.canvasRect;return this.shapeLabel=T(this.shapeLabel,n),u.x!==u.y&&!this.shapeLabel.hidden&&(this.canvasRect=S(this.canvasRect,n),this.setFactors(this.text),this.layOutLabel(d),this.layOutDot(d)),[this.shapeLabel,this.shapeDot]})},{fireImmediately:!0})}getShape(){return[this.shapeLabel,this.shapeDot]}layOutLabel(t){const s=this.steps.find(e=>e.scaleFactor<1/t);return s?(this.shapeLabel.lines[0].fontSize=s.value*t,this.shapeLabel.lines[0].text=s.lines.join(`
2
+ `),this.shapeLabel.padding=[this.paddingScaled[0]*t+this.padding,this.paddingScaled[1]*t+this.padding],[this.shapeLabel]):(this.shapeLabel.lines[0].fontSize=0,[this.shapeLabel])}layOutDot(t){const s=this.steps.find(o=>o.scaleFactor<1/t),e=this.shapeDot.bounds;return e.scale({x:this.shapeDot.source.width*t/e.size.x,y:this.shapeDot.source.height*t/e.size.y},e.center,e),this.shapeDot.hidden=!!s,[this.shapeDot]}setFactors(t){this.steps=A(devicePixelRatio).getStepsForRect(t,this.canvasRect.size.x,this.canvasRect.size.y)}setText(){const t=this.booth.title||this.booth.name,e=`Clicks: ${B.getTotalClicksByBooth(this.booth)}`;this.text=l.heatmap?`${t} - ${e}`:t}}
@@ -1 +1 @@
1
- import{Rect as M}from"@expofp/geometry";import{update as U}from"@expofp/renderer";import{reaction as W}from"mobx";import{FONT_WEIGHT_PRIMARY_BOOTH as V,FONT_WEIGHT_PRIMARY_EXHIBITOR as Z,FONT_WEIGHT_SECONDARY_BOOTH as X,FONT_WEIGHT_SECONDARY_EXHIBITOR as G}from"../../../../constants";import c from"../../../../data";import{createShapeDot as k,createTextDef as Y,createTextDefLines as $}from"../../../../engine/defs";import{DEFAULT_FONT_LIGHT_URL as q,DEFAULT_FONT_URL as B,loadCustomFontsUrls as j}from"../../../../engine/fonts";import{getRollValue as J,getRotation as K,updateLinesScale as Q,updateRectRotation as tt,updateTextDefRotation as et}from"../../../../engine/update-def";import{boothStore as it,layersStore as _,uiState as m}from"../../../../store";import{RegularBooth as st,SpecialBooth as ot}from"../../../../store/BoothStore";import v from"../../../../tools/settings";import{t as S}from"../../../../utils/i18n";import nt from"../../../../utils/is-mobile";import at from"../../../../utils/is-webview";import{isArabicText as ht}from"../../../../utils/rtl";import{BoothDrawerBaseWithoutPainter as rt}from"./BoothDrawerBase";import{getFont as I}from"./canvases";import{getLabelBorderInset as lt}from"./label-inset.js";let z=v.boothLabelColor;v.EXPO==="tqs2021"&&(z="#000");const x=nt||at,F=n=>n.replace(" ","").substring(0,4).replace(/[0-9]/g,"3").replace(/[A-Z]/gi,"A"),P=document.createElement("canvas").getContext("2d");export default function ct(n){if(!(!(n instanceof st)||n.noLabels))return new BoothLabelDrawer(n)}export function getMinZoomFactorForDot(n){return Array.isArray(n)&&n.length>0?Math.max(...n.map(t=>t)):typeof n=="number"?n:-0}export const isDirectionsMode=()=>!!(m.selectedRoute?.from&&m.selectedRoute?.to);export function getFontUrlByWeight(n,t=[],e="normal"){return[...t,{weight:500,url:B,style:"normal"},{weight:300,url:q,style:"normal"}].find(s=>+s.weight===n&&s.style===e)?.url||B}function b(n,t){return Number(getComputedStyle(document.body).getPropertyValue(n))||t}export function getBoothLabelWeights(){return{main:b(V,500),details:b(X,300)}}export function getExhibitorLabelWeights(){return{main:b(Z,500),details:b(G,300)}}export function getBadgeFontWeight(){return getExhibitorLabelWeights().details}const R="Details";export class BoothLabelDrawer extends rt{constructor(t){super(t),this.minZoomDotVisible=0,this.maxZoomDotVisible=0,this.exh=[],this.shapeLabel=void 0,this.shapeDot=void 0,this.fontSizes=[[],[]],this.lines=[[],[]],this.fontUrls=["",""],this.canvasRect=new M(t.rect.center,t.rect.size,t.rotate,t.elevation),this.paddingScaled=[4,4],this.padding=lt(t.borderWidth||it.borderWidth,t.rect.size),this.topLeftAlignment={horizontal:m.rtl?"right":"left",vertical:"top"},this.centerAlignment={horizontal:"center",vertical:"center"},this.prefixes=x?[{fontSize:7,name:"XS",short:!0},{fontSize:10,name:"S",short:!0},{fontSize:16,name:R,short:!1}]:[{fontSize:7,name:"XS",short:!0},{fontSize:10,name:"S",short:!0},{fontSize:12,name:"M",short:!0},{fontSize:14,name:"L",short:!0},{fontSize:18,name:R,short:!1}],!(t instanceof ot)&&(this.exh=c.hideExhibitors?[]:c.onlyFeaturedExhibitors?t.exhibitors.filter(e=>e.featured):t.exhibitors,x&&this.optimizationLevel()>=3&&(this.prefixes=this.prefixes.filter(e=>e.name!=="S")),this.createLines(),this.calculateFontSizeFactors(),this.shapeLabel=Y($(this.lines,this.booth.labelColor||z,0,this.fontUrls),new M(this.booth.rect.center,this.booth.rect.size,this.booth.rotate,this.booth.elevation),[...this.paddingScaled],{horizontal:"left",vertical:"top"}),this.shapeLabel.onScale=({pixelSize:e})=>this.layOutLabel(e),this.getShapeDot(),W(()=>[this.booth.skipDim,m.selectedRoute,_.layersLoaded],()=>{if(!_.layersLoaded)return;const e=isDirectionsMode();this.shapeLabel.dim=e||this.booth.skipDim?0:void 0,this.shapeDot.dim=e||this.booth.skipDim?0:void 0,U(this.shapeLabel,this.shapeDot)}),W(()=>m.mapSettings,({roll:e})=>{J(e??0)&&(this.shapeLabel.onRoll=({roll:i,pixelSize:h})=>{const s=K(i,this.shapeLabel.bounds.rotation);if(s===void 0)return;const{size:a}=this.canvasRect;return this.shapeLabel=et(this.shapeLabel,s),!this.shapeLabel.hidden&&!this.exh.length&&a.x!==a.y&&(this.canvasRect=tt(this.canvasRect,s),this.calculateFontSizeFactors(),this.layOutLabel(h),this.layOutDot(h)),[this.shapeLabel,this.shapeDot]})},{fireImmediately:!0}))}getShape(){return[this.shapeLabel,this.shapeDot]}layOutLabel(t){const e=this.lines[1]??[],i=this.fontSizes[1]??[];if(v.EXPO!=="wineparis2026"){const s=this.exh.length?this.topLeftAlignment:e.length?t<i[i.length-1].scaleFactor?this.topLeftAlignment:this.centerAlignment:this.topLeftAlignment;this.shapeLabel.alignment=s}return Q(this.shapeLabel.lines,t,this.fontSizes)?(this.shapeLabel.padding[0]=this.paddingScaled[0]*t+this.padding,this.shapeLabel.padding[1]=this.paddingScaled[1]*t+this.padding,[this.shapeLabel]):[]}layOutDot(t){const e=t>=this.minZoomDotVisible&&t<=this.maxZoomDotVisible;if(!e&&this.shapeDot.hidden)return[];const i=this.shapeDot.bounds;return i.scale({x:this.shapeDot.source.width*t/i.size.x,y:this.shapeDot.source.height*t/i.size.y},i.center,i),this.shapeDot.hidden=!e,[this.shapeDot]}getShapeDot(){this.shapeDot=k(this.canvasRect,this.booth.labelColor||z),this.shapeDot.hidden=!0,this.shapeDot.onScale=({pixelSize:t})=>this.layOutDot(t),this.maxZoomDotVisible=Math.min(this.canvasRect.size.x/this.shapeDot.source.width,this.canvasRect.size.y/this.shapeDot.source.height)}createLines(){const t=this.booth,e=[],i=[],h=x&&this.optimizationLevel()>=3?1:3;if(this.exh.length){const s=t.exhibitors.filter(o=>o.order===0),a=t.exhibitors.filter(o=>o.order);if(s.length>0)e.push(...s.map(o=>o.name));else if(c.onlyFeaturedExhibitors)e.push(...t.exhibitors.filter(o=>o.featured).map(o=>o.name));else if(a.length>0){e.push(...a.map(p=>p.name));const o=t.exhibitors.filter(p=>p.order===void 0);o.length>0&&e.push(S("and {{moreCount}} more",{moreCount:o.length}))}else t.exhibitors.length>h?e.push(`${t.exhibitors.length} ${c.exhibitorTermPlural}`):e.push(...t.exhibitors.map(o=>o.name));i.push(t.title||t.name)}else{const s=!!t.exhibitors.length;e.push(t.title||t.name),t.onHold?i.push(S("On Hold")):t.reserved?i.push(S("Reserved")):s||i.push(...t.exhibitors.map(a=>a.name).sort((a,o)=>a>o?1:-1)),t.size&&i.push(t.size.indexOf("/")>-1?t.size.substring(0,t.size.indexOf("/")).trim():t.size),t.price&&t.price!=="0"&&!m.previewMode&&i.push(t.price)}m.rtl&&e.forEach((s,a)=>{(s.endsWith(".")||s.endsWith("!")||s.endsWith("?"))&&(e[a]=e[a]+"\u200F"),ht(s)&&(e[a]=e[a]+" ")}),this.lines=[e,i]}calculateFontSizeFactors(){const t=this.lines[0];let e;const i=this.canvasRect,h=[],s=[],a=this.prefixes.slice(0,this.exh.length?this.prefixes.length:this.prefixes.length-1),{main:o,details:p}=this.exh.length?getExhibitorLabelWeights():getBoothLabelWeights();for(const{fontSize:l,short:u}of a){const d=l*devicePixelRatio,L=.9*l*devicePixelRatio,f=I(d,o),T=I(L,p),O=c.hideExhibitorBoothNumber||u;let w,A,D,g;if(this.exh.length)e=u?[]:this.lines[1],D=Math.max(...t.map(r=>this.measureText(r,f).width),...e.map(r=>this.measureText(r,T).width)),w=Math.max(...t.map(r=>this.exh.length?this.measureText(F(r),f).width:this.measureText(F(r),f).width+3+3),...e.map(r=>this.measureText(F(r),T).width)),g=d*t.length+L*e.length+devicePixelRatio*(t.length+e.length)+3,A=O?g/t.length:null;else{const r=t[0].replace(/[0-9]/g,"3").replace(/[A-Z]/g,"A"),H=4;D=this.measureText(r,f).width+3+3,g=d+H}const C=i.size.x/(w||D),N=i.size.y/(A||g),E=Math.min(C,N);h.push({scaleFactor:E,value:d,lines:[]}),O||s.push({scaleFactor:E,value:L,lines:[]})}if(!this.exh.length){const l=h[h.length-1],u=this.prefixes.find(d=>d.name===R);u&&(h.push({scaleFactor:l.scaleFactor/1.8,value:u.fontSize*devicePixelRatio,lines:[]}),s.push({scaleFactor:l.scaleFactor/1.8,value:u.fontSize*(x?1:.9)*devicePixelRatio,lines:[]}))}const y=j();this.fontUrls=[getFontUrlByWeight(o,y),getFontUrlByWeight(p,y)],this.minZoomDotVisible=getMinZoomFactorForDot(h.map(l=>l.scaleFactor)),this.fontSizes=[h,s]}calcArea(t,e){return Math.floor(Math.max(0,t)*Math.max(0,e)/1e3)}optimizationLevel(){return Math.min(c.viewOptimizationLevel?c.viewOptimizationLevel:Math.floor(this.calcArea(this.canvasRect.size.x,this.canvasRect.size.y)/5e3),3)}measureText(t,e){return P.font=e,P.measureText(t)}}
1
+ import{Rect as B}from"@expofp/geometry";import{update as U}from"@expofp/renderer";import{reaction as M}from"mobx";import{FONT_WEIGHT_PRIMARY_BOOTH as V,FONT_WEIGHT_PRIMARY_EXHIBITOR as Z,FONT_WEIGHT_SECONDARY_BOOTH as X,FONT_WEIGHT_SECONDARY_EXHIBITOR as G}from"../../../../constants";import c from"../../../../data";import{createShapeDot as k,createTextDef as Y,createTextDefLines as Q}from"../../../../engine/defs";import{DEFAULT_FONT_LIGHT_URL as $,DEFAULT_FONT_URL as W,loadCustomFontsUrls as q}from"../../../../engine/fonts";import{getQuarterTurns as j,getRollValue as J,rotateRectByQuarters as K,rotateTextDefByQuarters as tt,updateLinesScale as et}from"../../../../engine/update-def";import{boothStore as it,layersStore as _,uiState as m}from"../../../../store";import{RegularBooth as st,SpecialBooth as ot}from"../../../../store/BoothStore";import v from"../../../../tools/settings";import{t as S}from"../../../../utils/i18n";import nt from"../../../../utils/is-mobile";import at from"../../../../utils/is-webview";import{isArabicText as ht}from"../../../../utils/rtl";import{BoothDrawerBaseWithoutPainter as rt}from"./BoothDrawerBase";import{getFont as I}from"./canvases";import{getLabelBorderInset as lt}from"./label-inset.js";let z=v.boothLabelColor;v.EXPO==="tqs2021"&&(z="#000");const x=nt||at,F=n=>n.replace(" ","").substring(0,4).replace(/[0-9]/g,"3").replace(/[A-Z]/gi,"A"),P=document.createElement("canvas").getContext("2d");export default function ct(n){if(!(!(n instanceof st)||n.noLabels))return new BoothLabelDrawer(n)}export function getMinZoomFactorForDot(n){return Array.isArray(n)&&n.length>0?Math.max(...n.map(t=>t)):typeof n=="number"?n:-0}export const isDirectionsMode=()=>!!(m.selectedRoute?.from&&m.selectedRoute?.to);export function getFontUrlByWeight(n,t=[],e="normal"){return[...t,{weight:500,url:W,style:"normal"},{weight:300,url:$,style:"normal"}].find(s=>+s.weight===n&&s.style===e)?.url||W}function b(n,t){return Number(getComputedStyle(document.body).getPropertyValue(n))||t}export function getBoothLabelWeights(){return{main:b(V,500),details:b(X,300)}}export function getExhibitorLabelWeights(){return{main:b(Z,500),details:b(G,300)}}export function getBadgeFontWeight(){return getExhibitorLabelWeights().details}const y="Details";export class BoothLabelDrawer extends rt{constructor(t){super(t),this.minZoomDotVisible=0,this.maxZoomDotVisible=0,this.exh=[],this.shapeLabel=void 0,this.shapeDot=void 0,this.fontSizes=[[],[]],this.lines=[[],[]],this.fontUrls=["",""],this.canvasRect=new B(t.rect.center,t.rect.size,t.rotate,t.elevation),this.paddingScaled=[4,4],this.padding=lt(t.borderWidth||it.borderWidth,t.rect.size),this.topLeftAlignment={horizontal:m.rtl?"right":"left",vertical:"top"},this.centerAlignment={horizontal:"center",vertical:"center"},this.prefixes=x?[{fontSize:7,name:"XS",short:!0},{fontSize:10,name:"S",short:!0},{fontSize:16,name:y,short:!1}]:[{fontSize:7,name:"XS",short:!0},{fontSize:10,name:"S",short:!0},{fontSize:12,name:"M",short:!0},{fontSize:14,name:"L",short:!0},{fontSize:18,name:y,short:!1}],!(t instanceof ot)&&(this.exh=c.hideExhibitors?[]:c.onlyFeaturedExhibitors?t.exhibitors.filter(e=>e.featured):t.exhibitors,x&&this.optimizationLevel()>=3&&(this.prefixes=this.prefixes.filter(e=>e.name!=="S")),this.createLines(),this.calculateFontSizeFactors(),this.shapeLabel=Y(Q(this.lines,this.booth.labelColor||z,0,this.fontUrls),new B(this.booth.rect.center,this.booth.rect.size,this.booth.rotate,this.booth.elevation),[...this.paddingScaled],{horizontal:"left",vertical:"top"}),this.shapeLabel.onScale=({pixelSize:e})=>this.layOutLabel(e),this.getShapeDot(),M(()=>[this.booth.skipDim,m.selectedRoute,_.layersLoaded],()=>{if(!_.layersLoaded)return;const e=isDirectionsMode();this.shapeLabel.dim=e||this.booth.skipDim?0:void 0,this.shapeDot.dim=e||this.booth.skipDim?0:void 0,U(this.shapeLabel,this.shapeDot)}),M(()=>m.mapSettings,({roll:e})=>{J(e??0)&&(this.shapeLabel.onRoll=({roll:i,pixelSize:h})=>{const s=j(i,this.shapeLabel.bounds.rotation);if(s===0)return;const{size:a}=this.canvasRect;return this.shapeLabel=tt(this.shapeLabel,s),!this.shapeLabel.hidden&&!this.exh.length&&a.x!==a.y&&(this.canvasRect=K(this.canvasRect,s),this.calculateFontSizeFactors(),this.layOutLabel(h),this.layOutDot(h)),[this.shapeLabel,this.shapeDot]})},{fireImmediately:!0}))}getShape(){return[this.shapeLabel,this.shapeDot]}layOutLabel(t){const e=this.lines[1]??[],i=this.fontSizes[1]??[];if(v.EXPO!=="wineparis2026"){const s=this.exh.length?this.topLeftAlignment:e.length?t<i[i.length-1].scaleFactor?this.topLeftAlignment:this.centerAlignment:this.topLeftAlignment;this.shapeLabel.alignment=s}return et(this.shapeLabel.lines,t,this.fontSizes)?(this.shapeLabel.padding[0]=this.paddingScaled[0]*t+this.padding,this.shapeLabel.padding[1]=this.paddingScaled[1]*t+this.padding,[this.shapeLabel]):[]}layOutDot(t){const e=t>=this.minZoomDotVisible&&t<=this.maxZoomDotVisible;if(!e&&this.shapeDot.hidden)return[];const i=this.shapeDot.bounds;return i.scale({x:this.shapeDot.source.width*t/i.size.x,y:this.shapeDot.source.height*t/i.size.y},i.center,i),this.shapeDot.hidden=!e,[this.shapeDot]}getShapeDot(){this.shapeDot=k(this.canvasRect,this.booth.labelColor||z),this.shapeDot.hidden=!0,this.shapeDot.onScale=({pixelSize:t})=>this.layOutDot(t),this.maxZoomDotVisible=Math.min(this.canvasRect.size.x/this.shapeDot.source.width,this.canvasRect.size.y/this.shapeDot.source.height)}createLines(){const t=this.booth,e=[],i=[],h=x&&this.optimizationLevel()>=3?1:3;if(this.exh.length){const s=t.exhibitors.filter(o=>o.order===0),a=t.exhibitors.filter(o=>o.order);if(s.length>0)e.push(...s.map(o=>o.name));else if(c.onlyFeaturedExhibitors)e.push(...t.exhibitors.filter(o=>o.featured).map(o=>o.name));else if(a.length>0){e.push(...a.map(u=>u.name));const o=t.exhibitors.filter(u=>u.order===void 0);o.length>0&&e.push(S("and {{moreCount}} more",{moreCount:o.length}))}else t.exhibitors.length>h?e.push(`${t.exhibitors.length} ${c.exhibitorTermPlural}`):e.push(...t.exhibitors.map(o=>o.name));i.push(t.title||t.name)}else{const s=!!t.exhibitors.length;e.push(t.title||t.name),t.onHold?i.push(S("On Hold")):t.reserved?i.push(S("Reserved")):s||i.push(...t.exhibitors.map(a=>a.name).sort((a,o)=>a>o?1:-1)),t.size&&i.push(t.size.indexOf("/")>-1?t.size.substring(0,t.size.indexOf("/")).trim():t.size),t.price&&t.price!=="0"&&!m.previewMode&&i.push(t.price)}m.rtl&&e.forEach((s,a)=>{(s.endsWith(".")||s.endsWith("!")||s.endsWith("?"))&&(e[a]=e[a]+"\u200F"),ht(s)&&(e[a]=e[a]+" ")}),this.lines=[e,i]}calculateFontSizeFactors(){const t=this.lines[0];let e;const i=this.canvasRect,h=[],s=[],a=this.prefixes.slice(0,this.exh.length?this.prefixes.length:this.prefixes.length-1),{main:o,details:u}=this.exh.length?getExhibitorLabelWeights():getBoothLabelWeights();for(const{fontSize:l,short:p}of a){const d=l*devicePixelRatio,L=.9*l*devicePixelRatio,f=I(d,o),T=I(L,u),O=c.hideExhibitorBoothNumber||p;let w,A,D,g;if(this.exh.length)e=p?[]:this.lines[1],D=Math.max(...t.map(r=>this.measureText(r,f).width),...e.map(r=>this.measureText(r,T).width)),w=Math.max(...t.map(r=>this.exh.length?this.measureText(F(r),f).width:this.measureText(F(r),f).width+3+3),...e.map(r=>this.measureText(F(r),T).width)),g=d*t.length+L*e.length+devicePixelRatio*(t.length+e.length)+3,A=O?g/t.length:null;else{const r=t[0].replace(/[0-9]/g,"3").replace(/[A-Z]/g,"A"),H=4;D=this.measureText(r,f).width+3+3,g=d+H}const C=i.size.x/(w||D),N=i.size.y/(A||g),E=Math.min(C,N);h.push({scaleFactor:E,value:d,lines:[]}),O||s.push({scaleFactor:E,value:L,lines:[]})}if(!this.exh.length){const l=h[h.length-1],p=this.prefixes.find(d=>d.name===y);p&&(h.push({scaleFactor:l.scaleFactor/1.8,value:p.fontSize*devicePixelRatio,lines:[]}),s.push({scaleFactor:l.scaleFactor/1.8,value:p.fontSize*(x?1:.9)*devicePixelRatio,lines:[]}))}const R=q();this.fontUrls=[getFontUrlByWeight(o,R),getFontUrlByWeight(u,R)],this.minZoomDotVisible=getMinZoomFactorForDot(h.map(l=>l.scaleFactor)),this.fontSizes=[h,s]}calcArea(t,e){return Math.floor(Math.max(0,t)*Math.max(0,e)/1e3)}optimizationLevel(){return Math.min(c.viewOptimizationLevel?c.viewOptimizationLevel:Math.floor(this.calcArea(this.canvasRect.size.x,this.canvasRect.size.y)/5e3),3)}measureText(t,e){return P.font=e,P.measureText(t)}}
@@ -1 +1 @@
1
- import{jsx as x}from"react/jsx-runtime";import{isLayerDefs as Z}from"@expofp/renderer";import H from"color";import{runInAction as Q}from"mobx";import{observer as Y}from"mobx-react-lite";import{useCallback as F,useEffect as h,useMemo as m,useRef as f,useState as k}from"react";import q from"../../data";import{getLayerSvg as ee,svgArea as C,svgAreaExplicit as re}from"../../data/svg";import{createSceneDef as te}from"../../engine/defs";import t,{uiState as c}from"../../store";import M from"../../tools/settings";import oe from"../../utils/is-debug";import{fitRectIsFraming as ne,getVenueFitMarginPercent as ie,resolveVenueFitRect as ae}from"../../utils/scene-bounds";import ce from"../Map/drawing/config/config-all";import{loadLayersImages as se}from"../Map/drawing/config/loadBoothsImages";import{MapViewport as le}from"../Map/MapViewport";import{clearSelection as ue}from"../Map/pointer";import{setMapScene as $}from"../Map/scene";import{useBuildRoute as me}from"../Map/traffic/useBuildRoute";import{useManageTraffic as fe}from"../Map/traffic/useManageTraffic";import{centerCoordinates as pe}from"../Map/viewport";import de from"./MaplibreWrapper";import{useCameraReactions as ge}from"./useCameraReactions";import{useDimming as be}from"./useDimming";import{useKioskIdleEvents as Se}from"./useKioskIdleEvents";import{useLayerVisibilitySync as ye}from"./useLayerVisibilitySync";import{usePoiMarkers as Re}from"./usePoiMarkers";import{useWayfindingAndMarkers as he}from"./useWayfindingAndMarkers";import{cameraForLocalRect as Ce,deriveGeoConfig as Me,getLocalRectGeoBounds as Ae,getVisibleRectFitPadding as Le,INITIAL_FIT_ZOOM_ADJUSTMENT as Pe}from"./utils/geo-config";import{applyMapOptions as V,DEFAULT_MAP_OPTIONS as De,getTileSource as ze,MAP_2D_OPTIONS as Te}from"./utils/map-helpers";import{calculateTransformMatrix as ve}from"./utils/solver";const j="routes-api.expofp.com",Oe=800;function Ee(i,g,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??g,pitch:o.pitch??s(),duration:Oe,essential:!0})},resetPitch:()=>{const o=s();i.getPitch()!==o&&i.jumpTo({pitch:o})}}}function N(){t.poiMarkerStore.clear(),Q(()=>{t.layerStore.layers.forEach(i=>{i.configured=!1,i.children=[],i.loaded=!1}),t.layerStore.layersLoaded=!1})}const Ie=Y(function({viewMode:g}){const[s,o]=k(null),[z,T]=k(!1),u=f(null),b=f(null),A=f(null),v=f(null),S=f(null),r=m(()=>Me(),[]),L=m(()=>ae({layerViewbox:t.layerStore.viewboxRectangle,explicitArea:re?C:null,layerRectangle:t.layerStore.rectangle,sceneDef:s,svgArea:C}),[s]),y=L.rect,p=m(()=>{if(!r)return null;const e=ne(L.source)?0:ie(y,C),n=Le(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?Ce(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:Ae(y,r.gpsConfig),fitPadding:n,zoomAdjustment:Pe}},[r,L,y]),R=m(()=>r?ve(r.gpsConfig,ee()?.getAttribute("units")):null,[r]),d=m(()=>({...g==="map2d"?Te:De}),[g]),P=f(d),U=m(()=>ze(),[]),a=m(()=>{if(!s||!R)return null;const e=s.rootLayer.children,n=Z(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:I,applyDimmingTarget:_,handleMapDimLayerReady:B}=be(u,O);h(()=>{if(!r)return;let e=!1;N(),ce().then(({layers:D,cleanup:w})=>{if(e){w();return}A.current=w;const X=H(M.backgroundColor==="none"?"#ebebeb":M.backgroundColor).string();o(te(D,C,X))}).catch(D=>{e||console.warn("Maplibre scene configuration failed.",D)});const n=E.current,l=I.current;return()=>{e=!0,N(),A.current?.(),A.current=null,S.current&&(t.maplibreStore.clearCameraPortIfCurrent(S.current),S.current=null),u.current=null,b.current=null,v.current=null,T(!1),n?.stop(),l?.stop(),c.sceneDefReady=!1}},[r,E,I]);const G=F((e,n)=>{u.current=e,b.current=e.getCanvas(),v.current=n,T(!0),V(e,P.current);const l=Ee(e,r?.bearing??e.getBearing(),()=>P.current.pitch??0);S.current=l,t.maplibreStore.setCameraPort(l),t.fp.getCenterCoordinates=()=>pe(b.current),_({immediate:!0}),se(),t.layerStore.layersLoaded=!0,t.fp.onFpConfigured&&t.fp.onFpConfigured(),c.sceneDefReady=!0,n()},[_,r]);h(()=>{P.current=d,V(u.current,d,!0)},[d]),Se(z,u),he(a,b),Re(z,u,r),ye(a,u,r),ge(u,r,a),me({enabled:t.layerStore.layersLoaded&&c.buildRoute,scene:a??void 0});const J=q.busRoutes??!1;fe({permission:t.layerStore.layersLoaded&&J,scene:a??void 0,dataJsonUrl:`https://${j}/v1/routes?expo=${M.EXPO}`,websocketUrl:`wss://${j}/locations?expo=${M.EXPO}`});const K=F(e=>{console.warn("Maplibre map failed to load; falling back to floorplan mode.",e),t.maplibreStore.deactivateMaplibre()},[]);if(!r||!p||!R||!a)return null;const W=`${p.center.join(",")}:${p.bearing}:${p.zoom}`;return x(de,{sceneDef:a,geoConfig:p,tileSource:U,mapOptions:d,debug:oe,onMapReady:G,onMapDimLayerReady:B,onMapLoadError:K,onPointerMissed:ue,children:x(le,{})},W)});export default Ie;
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;
@@ -3,44 +3,35 @@ import { type TextDef, type TextLineDef } from '@expofp/renderer';
3
3
  import { type FontSizeFactor } from './defs';
4
4
  export declare function updateLinesScale(lines: TextLineDef[], scale: number, fontSizes: [FontSizeFactor[], FontSizeFactor[]]): boolean;
5
5
  /**
6
- * Turns a text def's own bounds: the axis-aligned 90° footprint swap (width ↔ height) plus the
7
- * rotation delta.
6
+ * Turns a text def's bounds by whole quarter turns, in one write.
8
7
  *
9
- * **In place**, where {@link updateRectRotation} returns a new rect, and the difference is
10
- * ownership rather than taste. These bounds belong to a def the renderer already holds, and the
11
- * drawers capture them into locals to write through (`layOutDot` resizes `shapeDot.bounds` that
12
- * way) — so replacing the object would strand every reference to it. `Rect.set` is geometry's
13
- * escape hatch for exactly this. A drawer's own `canvasRect` has no such holders, which is why the
14
- * other one is free to hand back a fresh value.
15
- * @param textDef - The def to turn; its bounds are written through.
16
- * @param rotation - The rotation delta, in radians.
17
- * @returns The same def, for callers that read as if it were a value.
8
+ * Each quarter turn swaps width and height, and two swaps cancel out. So turning by `turns`
9
+ * quarters one at a time lands on the same rect as adding `turns · π/2` once and swapping only
10
+ * when `turns` is odd — no loop needed.
11
+ *
12
+ * The bounds are written in place, not replaced: the drawers keep references to them.
13
+ * @param textDef - The def to turn.
14
+ * @param turns - Signed number of quarter turns, as {@link getQuarterTurns} returns.
15
+ * @returns The same def.
18
16
  */
19
- export declare function updateTextDefRotation(textDef: TextDef, rotation: number): TextDef;
17
+ export declare function rotateTextDefByQuarters(textDef: TextDef, turns: number): TextDef;
20
18
  /**
21
- * Turns a plain rect: the same transform {@link updateTextDefRotation} applies, on a rect no def
22
- * holds — a drawer's `canvasRect`, which every caller reassigns — so this one is free to return a
23
- * new value instead of writing through.
24
- *
25
- * Rebuilt from scalars, so the elevation is carried across explicitly; a rect that dropped it would
26
- * take whatever is rebuilt from it down to the floor on the first roll.
19
+ * Turns a plain rect by whole quarter turns: the transform {@link rotateTextDefByQuarters} applies,
20
+ * where the swap-on-odd rule is explained. Returns a new rect, since nothing else holds this one.
27
21
  * @param rect - The rect to turn.
28
- * @param angle - The rotation delta, in radians.
22
+ * @param turns - Signed number of quarter turns, as {@link getQuarterTurns} returns.
29
23
  * @returns The turned rect.
30
24
  */
31
- export declare function updateRectRotation(rect: Rect, angle: number): Rect;
32
- export declare function getRotation(newAngle: number, currentRotation: number): number | undefined;
33
- export declare function shouldFlip(newAngle: number, currentRotation: number): boolean;
25
+ export declare function rotateRectByQuarters(rect: Rect, turns: number): Rect;
34
26
  /**
35
- * The signed shortest angle from `currentRotation` to `newAngle`, wrapped into `(-π, π]`.
36
- *
37
- * Always a number: the `| undefined` this used to be declared with described no path through the
38
- * body, and its two callers already read the result as a plain angle.
27
+ * How many 90° steps a def is behind the camera, signed: the whole distance, so a camera that
28
+ * jumped is caught up with in one write.
39
29
  * @param newAngle - The angle turned to, in radians.
40
30
  * @param currentRotation - The angle turned from, in radians.
41
- * @returns The difference in radians.
31
+ * @returns The signed number of quarters; `0` within 45° and for a non-finite angle.
42
32
  */
43
- export declare function getAngleDiff(newAngle: number, currentRotation: number): number;
33
+ export declare function getQuarterTurns(newAngle: number, currentRotation: number): number;
34
+ export declare function shouldFlip(newAngle: number, currentRotation: number): boolean;
44
35
  export declare function flipAngle(angle: number): number;
45
36
  export declare function getClampedBoundsCanvas(rect: Rect, canvas: HTMLCanvasElement, padding: number, scale: number): Rect;
46
37
  /**
@@ -1 +1 @@
1
- import{Rect as X}from"@expofp/geometry";import{getBounds as Y}from"./canvases";export function updateLinesScale(o,n,t){let e=!1;return o.forEach((i,c)=>{let s=0;t[c].forEach(({value:a,scaleFactor:r})=>{n<r&&(s=a)}),i.fontSize!==s*n&&(e=!0),i.fontSize=s*n}),e}export function updateTextDefRotation(o,n){const t=o.bounds;return t.set(t.center.x,t.center.y,t.size.y,t.size.x,t.rotation+n,t.elevation),o}export function updateRectRotation(o,n){const{size:t,center:e,rotation:i,elevation:c}=o;return new X(e,{x:t.y,y:t.x},i+n,c)}export function getRotation(o,n){const t=getAngleDiff(o,n);if(Math.abs(t)>Math.PI/4)return Math.sign(t)*Math.PI/2}export function shouldFlip(o,n){const t=getAngleDiff(o,n),e=Math.PI/2;return Math.abs(t)>e+.1}export function getAngleDiff(o,n){const t=Math.PI,e=2*t;return((c,s)=>((c-s+t)%e+e)%e-t)(o,n)}export function flipAngle(o){return(o+Math.PI+Math.PI)%(2*Math.PI)-Math.PI}export function getClampedBoundsCanvas(o,n,t,e){const i=n.width,c=n.height,s=o.size,a=o.center,r=o.rotation,d=s.x/i,m=s.x-t*2,g=(s.y-t*2)*.8,M=0,b=m/i,I=g/c,y=Math.min(b,I,d);e=Math.min(Math.max(e,M),y);const P=i*e,R=c*e,h=Math.sin(r),f=Math.cos(r),u=s.x/2-t,x=-s.y/2+t,S=a.x+u*f-x*h,z=a.y+u*h+x*f,p=P/2,l=-R/2,B=p*f-l*h,W=p*h+l*f,w=S-B,H=z-W;return Y(w,H,i,c,e,r)}export function getRollValue(o){if(!o)return!1;if(!Number.isInteger(+o)||+o!=1&&+o!=0)throw new Error("Map roll: setting value is incorrect");return!!+o}
1
+ import{angleDiff as l,Rect as k}from"@expofp/geometry";import{getBounds as w}from"./canvases";export function updateLinesScale(t,o,n){let e=!1;return t.forEach((r,i)=>{let s=0;n[i].forEach(({value:a,scaleFactor:c})=>{o<c&&(s=a)}),r.fontSize!==s*o&&(e=!0),r.fontSize=s*o}),e}export function rotateTextDefByQuarters(t,o){const{center:n,size:e,rotation:r,elevation:i}=t.bounds,s=o%2!==0;return t.bounds.set(n.x,n.y,s?e.y:e.x,s?e.x:e.y,r+o*Math.PI/2,i),t}export function rotateRectByQuarters(t,o){const{size:n,center:e,rotation:r,elevation:i}=t,s=o%2!==0?{x:n.y,y:n.x}:n;return new k(e,s,r+o*Math.PI/2,i)}export function getQuarterTurns(t,o){if(!Number.isFinite(t)||!Number.isFinite(o))return 0;const n=l(t,o);return Math.abs(n)<=Math.PI/4?0:Math.round(n/(Math.PI/2))}export function shouldFlip(t,o){const n=l(t,o),e=Math.PI/2;return Math.abs(n)>e+.1}export function flipAngle(t){return(t+Math.PI+Math.PI)%(2*Math.PI)-Math.PI}export function getClampedBoundsCanvas(t,o,n,e){const r=o.width,i=o.height,s=t.size,a=t.center,c=t.rotation,d=s.x/r,M=s.x-n*2,b=(s.y-n*2)*.8,y=0,g=M/r,I=b/i,S=Math.min(g,I,d);e=Math.min(Math.max(e,y),S);const P=r*e,z=i*e,h=Math.sin(c),f=Math.cos(c),u=s.x/2-n,x=-s.y/2+n,B=a.x+u*f-x*h,R=a.y+u*h+x*f,m=P/2,p=-z/2,W=m*f-p*h,H=m*h+p*f,X=B-W,Y=R-H;return w(X,Y,r,i,e,c)}export function getRollValue(t){if(!t)return!1;if(!Number.isInteger(+t)||+t!=1&&+t!=0)throw new Error("Map roll: setting value is incorrect");return!!+t}
@@ -1,6 +1,13 @@
1
- import { Rect, RectLike } from '@expofp/geometry';
2
- import { ImageDef } from '@expofp/renderer';
1
+ import type { Rect, RectLike } from '@expofp/geometry';
2
+ import type { ImageDef } from '@expofp/renderer';
3
3
  export declare function isInnerInsideOuter(inner: Rect, outer?: RectLike): boolean;
4
4
  export declare function flipImageDef(imageDef: ImageDef, angle: number): boolean;
5
+ /**
6
+ * Declares the camera-roll rule on a def that has to stay readable: it follows the plan in quarter
7
+ * turns, the same way the plan's own labels do.
8
+ * @param imageDef - The def to keep upright.
9
+ * @returns The same def.
10
+ */
11
+ export declare function attachCardinalSnap(imageDef: ImageDef): ImageDef;
5
12
  export declare function rotateImageDef(imageDef: ImageDef, angle: number): boolean;
6
13
  //# sourceMappingURL=rotation.d.ts.map
@@ -1 +1 @@
1
- import{flipAngle as h,getRotation as y,shouldFlip as u}from"../update-def";export function isInnerInsideOuter(o,n){if(!n)return!1;const t=Math.cos(n.rotation??0),e=Math.sin(n.rotation??0),c=n.size.x/2,a=n.size.y/2;return d(o,o.rotation+Math.PI/2).every(r=>{const i=r.x-n.center.x,f=r.y-n.center.y,s=i*t+f*e,x=f*t-i*e;return Math.abs(s)<=c&&Math.abs(x)<=a})}function d(o,n=o.rotation){const t=o.size.x/2,e=o.size.y/2,c=Math.sin(n),a=Math.cos(n),r=o.center.x,i=o.center.y;return[{x:-t,y:-e},{x:t,y:-e},{x:t,y:e},{x:-t,y:e}].map(s=>({x:r+s.x*a-s.y*c,y:i+s.x*c+s.y*a}))}export function flipImageDef(o,n){const t=o.bounds;return u(n,t.rotation)?(t.rotate(h(t.rotation)-t.rotation,t),!0):!1}export function rotateImageDef(o,n){const t=o.bounds,e=y(n,t.rotation);return e===void 0?!1:(t.rotate(e,t),!0)}
1
+ import{flipAngle as h,getQuarterTurns as f,shouldFlip as y}from"../update-def";export function isInnerInsideOuter(t,o){if(!o)return!1;const n=Math.cos(o.rotation??0),s=Math.sin(o.rotation??0),r=o.size.x/2,c=o.size.y/2;return l(t,t.rotation+Math.PI/2).every(a=>{const i=a.x-o.center.x,u=a.y-o.center.y,e=i*n+u*s,x=u*n-i*s;return Math.abs(e)<=r&&Math.abs(x)<=c})}function l(t,o=t.rotation){const n=t.size.x/2,s=t.size.y/2,r=Math.sin(o),c=Math.cos(o),a=t.center.x,i=t.center.y;return[{x:-n,y:-s},{x:n,y:-s},{x:n,y:s},{x:-n,y:s}].map(e=>({x:a+e.x*c-e.y*r,y:i+e.x*r+e.y*c}))}export function flipImageDef(t,o){const n=t.bounds;return y(o,n.rotation)?(n.rotate(h(n.rotation)-n.rotation,n),!0):!1}export function attachCardinalSnap(t){return t.onRoll=({roll:o})=>rotateImageDef(t,o)?[t]:void 0,t}export function rotateImageDef(t,o){const n=t.bounds,s=f(o,n.rotation);return s===0?!1:(n.rotate(s*Math.PI/2,n),!0)}
@@ -1 +1 @@
1
- import{update as l}from"@expofp/renderer";import{createWayfinding as S}from"@expofp/wayfinding";import{fpGeo as g}from"../data/fpGeo";import{createImageDef as A,createLineDef as E}from"../engine/defs";import{getRotation as _}from"../engine/update-def";import{createCanvasIconProvider as L,createFloorContext as h,createGraphDataSource as v}from"./adapters";import{bindMobxReactions as W}from"./bindMobxReactions";import{createKioskHandler as I}from"./handlers/kioskHandler";import{createYahHandler as M}from"./handlers/yahHandler";import{WF_CURRENT_POSITION_LAYER_NAME as P,WF_LINES_ANIMATED_LAYER_NAME as x,WF_LINES_LAYER_NAME as N,WF_POINTS_LAYER_NAME as y,WF_TRAIL_LAYER_NAME as k}from"./layers";let u=null;export function isWayfindingReady(){return u!==null}function C(){if(!u)throw new Error("Wayfinding is not initialized \u2014 call createWayfinding() first.");return u}export function buildRoute(e,n,o){return C().wayfinding.buildRoute(e,n,o)}export function createWayfinding(e){const{scene:n,store:o,canvas:t}=e,c=n.rootLayer.children,{wayfinding:s,dispose:r}=w(o,{createImageDef:A,createLineDef:E,getRotation:_,layers:c,update:l}),i=T(c,y);return i.onClick=f=>D(s,f),i.onPointerMove=f=>m(s,t,f),i.onPointerOut=()=>m(s,t),l(i),()=>{i.onClick=void 0,i.onPointerMove=void 0,i.onPointerOut=void 0,t.current&&(t.current.style.cursor=""),l(i),r()}}function w(e,n){const o=v(),t=L({iconMap:e.fp.icons,pixelRatio:devicePixelRatio}),c=h(e.layerStore,e.routeStore),s={points:y,trail:k,lines:N,linesAnimated:x,currentPosition:P},r=S({dataSource:o,renderer:n,iconProvider:t,floorContext:c,layers:s,gpsConfig:g?.properties?.config,onTransitionClick:a=>{a.role==="exit"&&e.layerStore.updateVisibility(a.targetLayer,!0)},onRouteUpdate:(a,p)=>{e.routeStore.updateRoute([...a]),p.isEmpty()||(e.uiState.moveToRect=p)},onRouteDistance:a=>e.routeStore.updateRouteDistance(a)}),i=I({wayfinding:r,kioskIconMap:e.fp.icons,layer:s.points}),f=M({wayfinding:r,iconMap:e.fp.icons,pixelRatio:devicePixelRatio,floorContext:c,layer:s.points}),R=W({wayfinding:r,kioskHandler:i,yahHandler:f,stores:{routeStore:e.routeStore,uiState:e.uiState,layerStore:e.layerStore}});e.routeStore.showAccessible=o.getLines().some(a=>a.unaccessible);const d={wayfinding:r};return u=d,r.flush(),{wayfinding:r,dispose(){b(d)&&(u=null,e.routeStore.showAccessible=!1),R(),r.destroy()}}}function b(e){return u===e}function T(e,n){const o=e.find(t=>t.name===n);if(!o)throw new Error(`renderer: layer "${n}" not found in scene`);return o}function D(e,n){e.handleClick([n.def])&&n.stopPropagation()}function m(e,n,o){const t=n.current;if(!t)return;const c=o?e.handleHover([o.def]):!1;t.style.cursor=c?"pointer":""}
1
+ import{update as y}from"@expofp/renderer";import{createWayfinding as g}from"@expofp/wayfinding";import{fpGeo as A}from"../data/fpGeo";import{createImageDef as E,createLineDef as _}from"../engine/defs";import{attachCardinalSnap as h}from"../engine/utils/rotation";import{createCanvasIconProvider as L,createFloorContext as v,createGraphDataSource as I}from"./adapters";import{bindMobxReactions as W}from"./bindMobxReactions";import{createKioskHandler as M}from"./handlers/kioskHandler";import{createYahHandler as P}from"./handlers/yahHandler";import{WF_CURRENT_POSITION_LAYER_NAME as x,WF_LINES_ANIMATED_LAYER_NAME as C,WF_LINES_LAYER_NAME as N,WF_POINTS_LAYER_NAME as R,WF_TRAIL_LAYER_NAME as k}from"./layers";let f=null;export function isWayfindingReady(){return f!==null}function w(){if(!f)throw new Error("Wayfinding is not initialized \u2014 call createWayfinding() first.");return f}export function buildRoute(e,n,t){return w().wayfinding.buildRoute(e,n,t)}export function createWayfinding(e){const{scene:n,store:t,canvas:o}=e,c=n.rootLayer.children,{wayfinding:s,dispose:a}=b(t,{createImageDef:(u,p,l)=>{const{cardinalSnap:i,...d}=l??{},m=E(u,p,d);return i?h(m):m},createLineDef:_,layers:c,update:y}),r=T(c,R);return r.onClick=u=>F(s,u),r.onPointerMove=u=>S(s,o,u),r.onPointerOut=()=>S(s,o),y(r),()=>{r.onClick=void 0,r.onPointerMove=void 0,r.onPointerOut=void 0,o.current&&(o.current.style.cursor=""),y(r),a()}}function b(e,n){const t=I(),o=L({iconMap:e.fp.icons,pixelRatio:devicePixelRatio}),c=v(e.layerStore,e.routeStore),s={points:R,trail:k,lines:N,linesAnimated:C,currentPosition:x},a=g({dataSource:t,renderer:n,iconProvider:o,floorContext:c,layers:s,gpsConfig:A?.properties?.config,onTransitionClick:i=>{i.role==="exit"&&e.layerStore.updateVisibility(i.targetLayer,!0)},onRouteUpdate:(i,d)=>{e.routeStore.updateRoute([...i]),d.isEmpty()||(e.uiState.moveToRect=d)},onRouteDistance:i=>e.routeStore.updateRouteDistance(i)}),r=M({wayfinding:a,kioskIconMap:e.fp.icons,layer:s.points}),u=P({wayfinding:a,iconMap:e.fp.icons,pixelRatio:devicePixelRatio,floorContext:c,layer:s.points}),p=W({wayfinding:a,kioskHandler:r,yahHandler:u,stores:{routeStore:e.routeStore,uiState:e.uiState,layerStore:e.layerStore}});e.routeStore.showAccessible=t.getLines().some(i=>i.unaccessible);const l={wayfinding:a};return f=l,a.flush(),{wayfinding:a,dispose(){D(l)&&(f=null,e.routeStore.showAccessible=!1),p(),a.destroy()}}}function D(e){return f===e}function T(e,n){const t=e.find(o=>o.name===n);if(!t)throw new Error(`renderer: layer "${n}" not found in scene`);return t}function F(e,n){e.handleClick([n.def])&&n.stopPropagation()}function S(e,n,t){const o=n.current;if(!o)return;const c=t?e.handleHover([t.def]):!1;o.style.cursor=c?"pointer":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expofp/floorplan",
3
- "version": "3.31.5",
3
+ "version": "3.33.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/expofp/efp-app.git",
@@ -69,15 +69,15 @@
69
69
  "tslib": "^2.3.0",
70
70
  "uuid": "^9.0.1",
71
71
  "zod": "4.4.3",
72
- "@expofp/config": "3.31.5",
73
- "@expofp/debug": "3.31.5",
74
- "@expofp/geometry": "3.31.5",
75
- "@expofp/renderer": "3.31.5",
76
- "@expofp/resolve": "3.31.5",
77
- "@expofp/schema": "3.31.5",
78
- "@expofp/ui": "3.31.5",
79
- "@expofp/utils": "3.31.5",
80
- "@expofp/wayfinding": "3.31.5"
72
+ "@expofp/config": "3.33.0",
73
+ "@expofp/debug": "3.33.0",
74
+ "@expofp/geometry": "3.33.0",
75
+ "@expofp/renderer": "3.33.0",
76
+ "@expofp/resolve": "3.33.0",
77
+ "@expofp/schema": "3.33.0",
78
+ "@expofp/ui": "3.33.0",
79
+ "@expofp/wayfinding": "3.33.0",
80
+ "@expofp/utils": "3.33.0"
81
81
  },
82
82
  "devDependencies": {
83
83
  "@babel/plugin-proposal-decorators": "^8.0.2",