@expofp/floorplan 3.25.2 → 3.27.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.
- package/dist/browser/{Button-DZ5RJVoX.js → Button-e8P-AcfW.js} +6 -6
- package/dist/browser/{CookieConsent-CNE-7zNI.js → CookieConsent-DT6PZdD-.js} +8 -8
- package/dist/browser/{Debug-TDQ_xzea.js → Debug-Btnxv9GC.js} +8 -8
- package/dist/browser/DebugTools-CH_HoQal.js +1922 -0
- package/dist/browser/{Demo-A0X5mRqG.js → Demo-DZoFFss-.js} +10 -10
- package/dist/browser/{Free-BjYK0xDM.js → Free-DiFQkGSU.js} +10 -10
- package/dist/browser/{GalleryContainer-BsQuHOrj.js → GalleryContainer-aJ6EZ5I3.js} +11 -11
- package/dist/browser/{GpsLoader-DoutzmU_.js → GpsLoader-Bu9mBOam.js} +34 -34
- package/dist/browser/KioskStore-DUC4jNn0.js +241 -0
- package/dist/browser/{MaplibreAdapter-W1ZdQQ00.js → MaplibreAdapter-DIlDXt73.js} +2067 -2152
- package/dist/browser/{ModalContainer-BfZm0B_L.js → ModalContainer-CVRxdpt2.js} +11 -11
- package/dist/browser/{PermissionNotice-Cm6qrOC_.js → PermissionNotice-B5X5RQja.js} +7 -7
- package/dist/browser/SetKioskMode-BbDnU98F.js +48 -0
- package/dist/browser/{ShowKiosk-B0cj0p6h.js → ShowKiosk-B7HfONvN.js} +11 -11
- package/dist/browser/{ViewerMenuPanel-FFmV-n9m.js → ViewerMenuPanel-CT6kvVUw.js} +17 -17
- package/dist/browser/{add-debug-secret-listener-BOW3NQe7.js → add-debug-secret-listener-Dvv-Pg0-.js} +1 -1
- package/dist/browser/{adopt-global-settings-DNTNdr3z.js → adopt-global-settings-CXzCKJtp.js} +10 -10
- package/dist/browser/{boolean-editor-Bx4HLLyu.js → boolean-editor-CHMR9ZwP.js} +10 -10
- package/dist/browser/{bootIntercom-C_8HLvxg.js → bootIntercom-DQcGuly8.js} +3 -3
- package/dist/browser/bundle.json +77 -65
- package/dist/browser/camera-events-BkrzcISl.js +18 -0
- package/dist/browser/{classnames-DovQg6we.js → classnames-BYuGpzao.js} +2 -2
- package/dist/browser/{client-CadlVOps.js → client-hxMr1frV.js} +793 -992
- package/dist/browser/{components-BK-czcTL.js → components-DiB2l4Q7.js} +1934 -1986
- package/dist/browser/debug-context-CfyAAxAt.js +24315 -0
- package/dist/browser/{debug-overlay-vFTynZrP.js → debug-overlay-PYUvPcx-.js} +11 -11
- package/dist/browser/{debug-ui-BgSppEQg.js → debug-ui-BXRAYxv6.js} +7 -7
- package/dist/browser/dimming-Dj-1kBgQ.js +1108 -0
- package/dist/browser/{dist-C1WQpGAq.js → dist-30RVEJTr.js} +7 -7
- package/dist/browser/{dist-CkAU9dsV.js → dist-DgGMS59X.js} +6 -6
- package/dist/browser/{dist-gIYlJ33F.js → dist-opCvrhNh.js} +3 -3
- package/dist/browser/{efp-debug-init-CGEJSmuk.js → efp-debug-init-CYfrcz9M.js} +4 -4
- package/dist/browser/{enum-editor-BZXgS3I-.js → enum-editor-BYO96W3-.js} +5 -5
- package/dist/browser/{es5-DoqUhz95.js → es5-Bpzk_wCi.js} +2 -2
- package/dist/browser/{event-not-found-Dl66nXH1.js → event-not-found-DEepFxEc.js} +1 -1
- package/dist/browser/{exports-CK5UTqgq.js → exports-Bo5VUoiX.js} +1 -1
- package/dist/browser/{favicon-BnTLQysW.js → favicon-Bf88cI9_.js} +1 -1
- package/dist/browser/{fetch-retry.umd-D_tGjwEb.js → fetch-retry.umd-D2BnNN8g.js} +2 -2
- package/dist/browser/{flex-BCrAgMxK.js → flex-B5cqWC1b.js} +6 -6
- package/dist/browser/{floorplan.loader-DXJR9eeS.js → floorplan.loader-D3lRYRJS.js} +10 -10
- package/dist/browser/{floorplan.ready-C0sdmceF.js → floorplan.ready-CsdDpbEv.js} +343 -307
- package/dist/browser/{fuse-C7evxCwi.js → fuse-CzalO4Mu.js} +2 -2
- package/dist/browser/{i18n-Cp32ZzDq.js → i18n-D1sb3MoT.js} +5 -5
- package/dist/browser/index.js +14 -14
- package/dist/browser/{index.module-CeDH7KeK.js → index.module-JxYvexTC.js} +4 -4
- package/dist/browser/{integrateKiosk-JZG1AZBF.js → integrateKiosk-e4HqZu2W.js} +5 -5
- package/dist/browser/{is-webview-Be9due3O.js → is-webview-ChPDTaTY.js} +1 -1
- package/dist/browser/{jsx-runtime-DwNSQYOA.js → jsx-runtime-Ca1Wj_4-.js} +2 -2
- package/dist/browser/{kiosk-record-BMwfA16j.js → kiosk-record-C2cafcoW.js} +1 -1
- package/dist/browser/{lib-DeQ47J_S.js → lib-DXqE6M9Z.js} +3 -3
- package/dist/browser/{loadImage-DVBOry5-.js → loadImage-8qYzT9NG.js} +4 -4
- package/dist/browser/{logDeviceInfo-uPn7yfGH.js → logDeviceInfo-CF95RwQH.js} +9 -9
- package/dist/browser/{mobx-DFFcUY2e.js → mobx-B8aGIDdz.js} +7 -7
- package/dist/browser/{optional-boolean-editor-DfcaW7-l.js → optional-boolean-editor-D02Q8KUS.js} +4 -4
- package/dist/browser/{optional-enum-editor-SEARu4hs.js → optional-enum-editor-RV_EKfNQ.js} +5 -5
- package/dist/browser/{optional-string-editor-COLkp8EA.js → optional-string-editor-D_t_aZG2.js} +5 -5
- package/dist/browser/{particles.min-DHvuM5ou.js → particles.min-CDyH_67D.js} +2 -2
- package/dist/browser/{react-BNCBBLDK.js → react-CDmIhEY6.js} +2 -2
- package/dist/browser/{react-dom-ql8ZgjdB.js → react-dom-PGvJwDoR.js} +3 -3
- package/dist/browser/{rolldown-runtime-D0mAPq9J.js → rolldown-runtime-CwqkRsWu.js} +1 -1
- package/dist/browser/scheduler-MBFOnOYr.js +212 -0
- package/dist/browser/{select-CwB0Zi7C.js → select-2x53pvd0.js} +11 -11
- package/dist/browser/{settings-MzAuoQZ6.js → settings-BCkl8gdb.js} +2 -2
- package/dist/browser/{settings-item-Ca6s5CDf.js → settings-item-DT6Vnw06.js} +7 -7
- package/dist/browser/store-Dej5FGrq.js +31205 -0
- package/dist/browser/{string-editor-BjOeNcgJ.js → string-editor-w9YDgRoR.js} +5 -5
- package/dist/browser/{text-field-6Ccfbuuo.js → text-field-ricOc0h0.js} +6 -6
- package/dist/browser/{theme-XlV0fBPc.js → theme-Ce7vpk9b.js} +9 -9
- package/dist/browser/{ui-BopruaHZ.js → ui-PDV2rEkU.js} +9 -9
- package/dist/browser/{useRenderTarget-CdH-VI6E.js → useRenderTarget-DroCs5kL.js} +5 -5
- package/dist/browser/viewport-Jwms2MJD.js +41 -0
- package/dist/esm/components/Booth/Booth.js +1 -1
- package/dist/esm/components/Event.js +1 -1
- package/dist/esm/components/Exhibitor.js +1 -1
- package/dist/esm/components/Kiosk/KioskStore.d.ts +5 -2
- package/dist/esm/components/Kiosk/KioskStore.js +1 -1
- package/dist/esm/components/Kiosk/SetKioskMode.d.ts +1 -2
- package/dist/esm/components/Kiosk/SetKioskMode.js +1 -1
- package/dist/esm/components/Layout.js +1 -1
- package/dist/esm/components/Map/Map.d.ts +1 -1
- package/dist/esm/components/Map/Map.js +1 -1
- package/dist/esm/components/Map/MapCamera.d.ts +17 -0
- package/dist/esm/components/Map/MapCamera.js +1 -0
- package/dist/esm/components/Map/MapViewport.d.ts +12 -0
- package/dist/esm/components/Map/MapViewport.js +1 -0
- package/dist/esm/components/Map/booth-by-xy.d.ts +13 -0
- package/dist/esm/components/Map/booth-by-xy.js +1 -1
- package/dist/esm/components/Map/camera-events.d.ts +16 -0
- package/dist/esm/components/Map/camera-events.js +1 -0
- package/dist/esm/components/Map/camera.d.ts +48 -0
- package/dist/esm/components/Map/camera.js +1 -0
- package/dist/esm/components/Map/drawing/config/TextFitter.d.ts +1 -1
- package/dist/esm/components/Map/drawing/config/config-all.d.ts +1 -2
- package/dist/esm/components/Map/drawing/config/config-all.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-bg.d.ts +1 -2
- package/dist/esm/components/Map/drawing/config/config-bg.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-badge.d.ts +70 -3
- package/dist/esm/components/Map/drawing/config/config-booth-badge.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-bg.d.ts +3 -6
- package/dist/esm/components/Map/drawing/config/config-booth-bg.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-bookmark.d.ts +11 -7
- package/dist/esm/components/Map/drawing/config/config-booth-bookmark.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-border.d.ts +2 -3
- package/dist/esm/components/Map/drawing/config/config-booth-border.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booth-labels-special.d.ts +16 -3
- package/dist/esm/components/Map/drawing/config/config-booth-labels-special.js +2 -2
- package/dist/esm/components/Map/drawing/config/config-booth-labels.d.ts +18 -4
- package/dist/esm/components/Map/drawing/config/config-booth-labels.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-booths.d.ts +1 -2
- package/dist/esm/components/Map/drawing/config/config-booths.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-load-layer.d.ts +1 -2
- package/dist/esm/components/Map/drawing/config/config-load-layer.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-markers.d.ts +23 -2
- package/dist/esm/components/Map/drawing/config/config-markers.js +1 -1
- package/dist/esm/components/Map/drawing/config/layer-images.d.ts +35 -0
- package/dist/esm/components/Map/drawing/config/layer-images.js +1 -0
- package/dist/esm/components/Map/drawing/config/loadBoothsImages.d.ts +38 -3
- package/dist/esm/components/Map/drawing/config/loadBoothsImages.js +1 -1
- package/dist/esm/components/Map/pointer.d.ts +73 -0
- package/dist/esm/components/Map/pointer.js +1 -0
- package/dist/esm/components/Map/scene.d.ts +20 -0
- package/dist/esm/components/Map/scene.js +1 -0
- package/dist/esm/components/Map/traffic/trafficLayers.d.ts +2 -7
- package/dist/esm/components/Map/traffic/trafficLayers.js +1 -1
- package/dist/esm/components/Map/traffic/useBuildRoute.d.ts +4 -3
- package/dist/esm/components/Map/traffic/useBuildRoute.js +6 -6
- package/dist/esm/components/Map/traffic/useManageTraffic.d.ts +4 -3
- package/dist/esm/components/Map/traffic/useManageTraffic.js +1 -1
- package/dist/esm/components/Map/viewport.d.ts +63 -0
- package/dist/esm/components/Map/viewport.js +1 -0
- package/dist/esm/components/Maplibre/MaplibreAdapter.d.ts +6 -2
- package/dist/esm/components/Maplibre/MaplibreAdapter.js +1 -1
- package/dist/esm/components/Maplibre/MaplibreWrapper.d.ts +30 -8
- package/dist/esm/components/Maplibre/MaplibreWrapper.js +1 -1
- package/dist/esm/components/Maplibre/useDimming.d.ts +2 -2
- package/dist/esm/components/Maplibre/useDimming.js +1 -1
- package/dist/esm/components/Maplibre/useKioskIdleEvents.d.ts +5 -6
- package/dist/esm/components/Maplibre/useLayerVisibilitySync.d.ts +2 -2
- package/dist/esm/components/Maplibre/useLayerVisibilitySync.js +1 -1
- package/dist/esm/components/Maplibre/usePoiMarkers.d.ts +1 -2
- package/dist/esm/components/Maplibre/useWayfindingAndMarkers.d.ts +8 -5
- package/dist/esm/components/Maplibre/useWayfindingAndMarkers.js +1 -1
- package/dist/esm/components/Maplibre/utils/layer-defs.d.ts +8 -3
- package/dist/esm/components/Maplibre/utils/layer-defs.js +1 -1
- package/dist/esm/components/Maplibre/utils/poi-marker-hit-test.d.ts +3 -3
- package/dist/esm/components/Speaker.js +1 -1
- package/dist/esm/components/Ws.js +1 -1
- package/dist/esm/engine/defs.d.ts +30 -0
- package/dist/esm/engine/defs.js +3 -0
- package/dist/esm/engine/fonts.js +1 -0
- package/dist/esm/engine/update-def.d.ts +52 -0
- package/dist/esm/engine/update-def.js +1 -0
- package/dist/esm/engine/utils/rotation.d.ts +6 -0
- package/dist/esm/engine/utils/rotation.js +1 -0
- package/dist/esm/floorplan.ready.d.ts +2 -0
- package/dist/esm/floorplan.ready.js +1 -1
- package/dist/esm/services/url-sync.js +1 -1
- package/dist/esm/store/BoothStore.d.ts +11 -0
- package/dist/esm/store/HeatmapStore.d.ts +9 -0
- package/dist/esm/store/LayerStore.d.ts +2 -0
- package/dist/esm/store/LayerStore.js +1 -1
- package/dist/esm/store/RootStore.d.ts +0 -2
- package/dist/esm/store/RootStore.js +1 -1
- package/dist/esm/store/RouteStore.js +1 -1
- package/dist/esm/store/ShortcutRegistry.d.ts +14 -0
- package/dist/esm/store/ShortcutRegistry.js +1 -1
- package/dist/esm/store/UIState.js +1 -1
- package/dist/esm/store/details-events.d.ts +11 -0
- package/dist/esm/store/details-events.js +1 -0
- package/dist/esm/store/init/init-booths.js +1 -1
- package/dist/esm/store/providers/SessionsSubButtonProvider.d.ts +18 -0
- package/dist/esm/store/providers/SessionsSubButtonProvider.js +1 -1
- package/dist/esm/store/search-buttons/SearchButtonsActions.d.ts +15 -2
- package/dist/esm/store/search-buttons/SearchButtonsActions.js +1 -1
- package/dist/esm/store/search-buttons/SearchButtonsFactory.js +1 -1
- package/dist/esm/store/search-buttons/SearchButtonsStore.d.ts +3 -3
- package/dist/esm/store/search-buttons/SearchButtonsStore.js +1 -1
- package/dist/esm/tools/gtag.d.ts +1 -0
- package/dist/esm/tools/gtag.js +1 -1
- package/dist/esm/tools/telemetry.d.ts +2 -0
- package/dist/esm/tools/telemetry.js +1 -1
- package/dist/esm/tools/track-event.d.ts +26 -2
- package/dist/esm/tools/track-event.js +1 -1
- package/dist/esm/utils/dimming.d.ts +13 -2
- package/dist/esm/utils/dimming.js +1 -1
- package/dist/esm/utils/mobx.d.ts +2 -2
- package/dist/esm/utils/mobx.js +1 -1
- package/dist/esm/utils/scene-bounds.d.ts +1 -1
- package/dist/esm/utils/scene-bounds.js +1 -1
- package/dist/esm/wayfinding/adapters/canvasIconProvider.js +1 -1
- package/dist/esm/wayfinding/createWayfinding.d.ts +19 -2
- package/dist/esm/wayfinding/createWayfinding.js +1 -1
- package/package.json +11 -10
- package/dist/browser/KioskStore-CRN9B487.js +0 -290
- package/dist/browser/SetKioskMode-BlmUmBkH.js +0 -57
- package/dist/browser/booth-by-xy-DgXTlV8u.js +0 -1130
- package/dist/browser/main-WTEdqNkt.js +0 -289
- package/dist/browser/store-B_c3r86U.js +0 -41370
- package/dist/esm/components/Map/pointInConvexQuad.d.ts +0 -3
- package/dist/esm/components/Map/pointInConvexQuad.js +0 -1
- package/dist/esm/components/Map/visibleArea.d.ts +0 -16
- package/dist/esm/components/Map/visibleArea.js +0 -1
- package/dist/esm/components/Maplibre/useRendererEvents.d.ts +0 -9
- package/dist/esm/components/Maplibre/useRendererEvents.js +0 -1
- package/dist/esm/components/Maplibre/utils/update-pump.d.ts +0 -18
- package/dist/esm/components/Maplibre/utils/update-pump.js +0 -1
- package/dist/esm/renderer/HandlerRegistry.d.ts +0 -18
- package/dist/esm/renderer/HandlerRegistry.js +0 -1
- package/dist/esm/renderer/RendererService.d.ts +0 -44
- package/dist/esm/renderer/RendererService.js +0 -1
- package/dist/esm/renderer/engine-core/defs.d.ts +0 -40
- package/dist/esm/renderer/engine-core/defs.js +0 -3
- package/dist/esm/renderer/engine-core/fonts.js +0 -1
- package/dist/esm/renderer/engine-core/settings.d.ts +0 -4
- package/dist/esm/renderer/engine-core/settings.js +0 -1
- package/dist/esm/renderer/engine-core/types.d.ts +0 -50
- package/dist/esm/renderer/engine-core/types.js +0 -1
- package/dist/esm/renderer/engine-core/update-def.d.ts +0 -12
- package/dist/esm/renderer/engine-core/update-def.js +0 -1
- package/dist/esm/renderer/engine-core/utils/rotation.d.ts +0 -17
- package/dist/esm/renderer/engine-core/utils/rotation.js +0 -1
- package/dist/esm/renderer/index.d.ts +0 -19
- package/dist/esm/renderer/index.js +0 -1
- /package/dist/esm/{renderer/engine-core → engine}/canvases.d.ts +0 -0
- /package/dist/esm/{renderer/engine-core → engine}/canvases.js +0 -0
- /package/dist/esm/{renderer/engine-core → engine}/fonts.d.ts +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A camera-movement signal for the parts of the SDK that are not components.
|
|
3
|
+
*
|
|
4
|
+
* `MapCamera` notifies from the controls' own update event — the same signal the imperative
|
|
5
|
+
* renderer published as `navigation:change` — and the kiosk setup screen listens to know the
|
|
6
|
+
* operator has framed a new home view. Deliberately minimal: no payload, because every consumer
|
|
7
|
+
* reads what it needs (`mapCamera().state()`) at the moment it cares.
|
|
8
|
+
* @param listener - Called after every camera movement while subscribed.
|
|
9
|
+
* @returns An unsubscribe function.
|
|
10
|
+
*/
|
|
11
|
+
export declare function onCameraMoved(listener: () => void): () => void;
|
|
12
|
+
/**
|
|
13
|
+
* Reports that the camera moved. Called by the mounted map; nothing else should.
|
|
14
|
+
*/
|
|
15
|
+
export declare function notifyCameraMoved(): void;
|
|
16
|
+
//# sourceMappingURL=camera-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function onCameraMoved(e){return o.add(e),()=>o.delete(e)}export function notifyCameraMoved(){for(const e of o)e()}const o=new Set;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type CameraAPI, type CameraState } from '@expofp/renderer';
|
|
2
|
+
/** The plan's camera, as the parts of the SDK that live outside React reach it. */
|
|
3
|
+
export interface MapCameraHandle {
|
|
4
|
+
/** Moving the camera. */
|
|
5
|
+
readonly api: CameraAPI;
|
|
6
|
+
/** Reading where it is, at the moment of asking. */
|
|
7
|
+
state(): CameraState;
|
|
8
|
+
}
|
|
9
|
+
/** What the mounted map holds, and hands the handle below a live view of. */
|
|
10
|
+
export interface MountedCamera {
|
|
11
|
+
/** The camera commands, as the renderer last handed them over. */
|
|
12
|
+
api: CameraAPI;
|
|
13
|
+
/** The camera reader, likewise. */
|
|
14
|
+
state: () => CameraState;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Wraps the map's live camera in a handle whose identity never changes.
|
|
18
|
+
*
|
|
19
|
+
* The renderer's hooks return a fresh object on every render, deliberately — it memoizes nothing, so
|
|
20
|
+
* that the cost of a settled identity is paid by whoever knows how often they render. That is this
|
|
21
|
+
* map: it reads them through a ref, and hands out this one object for the life of the mount, so
|
|
22
|
+
* nothing outside React ever holds a stale command.
|
|
23
|
+
* @param camera - A live view of what the mounted map holds.
|
|
24
|
+
* @returns The handle to publish.
|
|
25
|
+
*/
|
|
26
|
+
export declare function createMapCamera(camera: {
|
|
27
|
+
readonly current: MountedCamera;
|
|
28
|
+
}): MapCameraHandle;
|
|
29
|
+
/**
|
|
30
|
+
* Publishes the plan's camera, for as long as the map is on screen.
|
|
31
|
+
*
|
|
32
|
+
* The same inversion {@link setMarkerResolver} performs, and for the same reason: the renderer's
|
|
33
|
+
* camera is reached through hooks, which only resolve inside a component mounted under
|
|
34
|
+
* `<Renderer>` — and that is deliberate, since it is what stops anything touching the camera
|
|
35
|
+
* before the canvas exists. The SDK's own methods, the kiosk store and the route store are not
|
|
36
|
+
* components and cannot hold a hook, so `MapCamera` hands the camera out here once it is safe.
|
|
37
|
+
* @param camera - The camera; omitted to unpublish it as the map unmounts.
|
|
38
|
+
*/
|
|
39
|
+
export declare function setMapCamera(camera?: MapCameraHandle): void;
|
|
40
|
+
/**
|
|
41
|
+
* The plan's camera, if the map is on screen.
|
|
42
|
+
*
|
|
43
|
+
* Absent before the canvas has mounted, and in MapLibre mode, where the map is unmounted entirely
|
|
44
|
+
* and the imperative renderer drives the embed instead.
|
|
45
|
+
* @returns The camera, or `undefined`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function mapCamera(): MapCameraHandle | undefined;
|
|
48
|
+
//# sourceMappingURL=camera.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function createMapCamera(t){return{get api(){return t.current.api},state:()=>t.current.state()}}export function setMapCamera(t){e=t}export function mapCamera(){return e}let e;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type LayerDef } from '@expofp/renderer';
|
|
2
|
-
|
|
3
|
-
export default function configAll(rendererService: RendererService): Promise<{
|
|
2
|
+
export default function configAll(): Promise<{
|
|
4
3
|
layers: LayerDef[];
|
|
5
4
|
cleanup: () => void;
|
|
6
5
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createLayerDef as
|
|
1
|
+
import{createLayerDef as e}from"../../../../engine/defs";import n from"../../../../store";import{isPathwayLayer as E}from"../../../../utils/is-pathway-layer";import{WF_CURRENT_POSITION_LAYER_NAME as d,WF_LINES_ANIMATED_LAYER_NAME as N,WF_LINES_LAYER_NAME as u,WF_POINTS_LAYER_NAME as R,WF_TRAIL_LAYER_NAME as h}from"../../../../wayfinding/layers";import{createTrafficLayers as M}from"../../traffic/trafficLayers";import{configBoothsBadges as w}from"./config-booth-badge";import I from"./config-load-layer";import{MARKER_LAYER_NAME as P}from"./config-markers";export default function S(){const{defaultLayer:a}=n.layerStore;let{layers:o}=n.layerStore;if(a){const r=[...o],s=o.indexOf(a);r.splice(s,1),o=[a,...r]}const L=o.filter(r=>!r.rootParent).map(r=>I(r));return Promise.all(L).then(r=>{const s=e(R,[],{dim:0}),l=e(u,[],{dim:0}),c=e(P,[]),y=e(h,[],{dim:0}),p=e(N,[],{dim:0}),_=e(d,[],{dim:0}),i=[],f=[];for(const t of r.flat())E(t.name)?(t.dim=0,f.push(t)):i.push(t);const{layer:m,cleanup:A}=w("root",n.boothStore.booths);return{layers:[...i,...m?[m]:[],...f,...M(),c,y,l,p,s,_],cleanup:A}})}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { LayerDef } from '@expofp/renderer';
|
|
2
|
-
import { PathInfo } from '../../../../renderer/engine-core/types';
|
|
3
2
|
import { Layer } from '../../../../store/LayerStore';
|
|
4
|
-
import { ShapeBgDef } from '../../../../types/drawing.types';
|
|
3
|
+
import { PathInfo, ShapeBgDef } from '../../../../types/drawing.types';
|
|
5
4
|
export declare const BG_LAYER_NAME = "bg";
|
|
6
5
|
export declare const FG_LAYER_NAME = "fg";
|
|
7
6
|
export default function configBg(layer: Layer): Promise<LayerDef>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{select as
|
|
1
|
+
import{select as m}from"d3-selection";import{getLayerSvg as p,gtePathByIndex as g}from"../../../../data/svg";import{meshToShapeDef as h,rectToShapeDef as c}from"../../../../engine/defs";import u from"../../../../store";import{LayersMode as x}from"../../../../store/LayerStore";export const BG_LAYER_NAME="bg",FG_LAYER_NAME="fg";export default async function b(e){let r=[],l=[];const n=[],a=m(p(e)).select(`[data-layer="${e.name}"]`),f=a.selectAll(":scope > *:not([data-tagname='efp-booth']):not(g[data-is-editable='false']) path, :scope > path").nodes(),d=a.selectAll(":scope g[data-layer] > g[data-is-editable='false'] path, :scope > g[data-is-editable='false'] path, :scope > path[data-tagname='ptext']").nodes(),i=u.layerStore.mode!==x.Default?e.rootParent?.name||e.name:"";for(const t of f){const s=+t.getAttribute("data-index");let o;t.tagName==="path"&&s!==-1?o=buildPathDef({color:t.style.fill,index:s},i):t.tagName==="rect"&&(o=c(t)),o&&r.push(o)}for(const t of d){const s=+t.getAttribute("data-index");let o;t.tagName==="path"&&s!==-1?o=buildPathDef({color:t.style.fill,index:s},i):t.tagName==="rect"&&(o=c(t)),o&&l.push(o)}return n.push({name:BG_LAYER_NAME,children:r}),n.push({name:FG_LAYER_NAME,children:l}),Promise.resolve({name:e.name,children:n.filter(t=>t.children.length)})}export function buildPathDef(e,r){if(e.index===-1||Number.isNaN(e.index))return;(!e.color||e.color==="none")&&(e.color="transparent");const l=parseInt(e.index.toString()),n=g(l,r),a=h(n,e.color);return a.unblinking=e.unblinking,a}
|
|
@@ -1,12 +1,79 @@
|
|
|
1
1
|
import { type LayerDef, type ShapeDef, type TextDef } from '@expofp/renderer';
|
|
2
|
-
import { type RendererService } from '../../../../renderer';
|
|
3
2
|
import { type Booth, RegularBooth } from '../../../../store/BoothStore';
|
|
4
|
-
export declare function createBoothBadge(
|
|
3
|
+
export declare function createBoothBadge(booth: RegularBooth): {
|
|
5
4
|
bg: ShapeDef;
|
|
6
5
|
text: TextDef;
|
|
7
6
|
dispose: () => void;
|
|
8
7
|
};
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Lays a booth's badge out as the plan zooms: the background rect, and the booth number inside it.
|
|
10
|
+
*
|
|
11
|
+
* One instance per badge, holding the geometry the layout reads — where the badge is anchored inside
|
|
12
|
+
* the booth's footprint, its size at scale 1, and the scale beyond which it would spill out of the
|
|
13
|
+
* polygon. The defs' `onScale` closures delegate to the two methods here.
|
|
14
|
+
*/
|
|
15
|
+
export declare class BoothBadgeDrawer {
|
|
16
|
+
private readonly placement;
|
|
17
|
+
/**
|
|
18
|
+
* @param placement - Everything the layout reads: the booth, where the badge is anchored, its size
|
|
19
|
+
* at scale 1, the booth's rotation, the scale it may not exceed, the pixel ratio its font is
|
|
20
|
+
* authored against, and the two defs it writes.
|
|
21
|
+
*/
|
|
22
|
+
constructor(placement: BadgePlacement);
|
|
23
|
+
/**
|
|
24
|
+
* Lays the background rect out for a new pixel size.
|
|
25
|
+
* @param pixelSize - Plan units per device pixel.
|
|
26
|
+
* @returns The background unless its floor is switched off — the rect is kept current either
|
|
27
|
+
* way, so showing it draws the right size straight away.
|
|
28
|
+
*/
|
|
29
|
+
layOutBg(pixelSize: number): ShapeDef[];
|
|
30
|
+
/**
|
|
31
|
+
* Lays the booth number out for a new pixel size. The font stops growing at the scale the badge
|
|
32
|
+
* itself stops growing, so the text never outgrows the rect around it.
|
|
33
|
+
* @param pixelSize - Plan units per device pixel.
|
|
34
|
+
* @returns The text unless its floor is switched off, as for the background.
|
|
35
|
+
*/
|
|
36
|
+
layOutText(pixelSize: number): TextDef[];
|
|
37
|
+
/**
|
|
38
|
+
* The badge's rect at a pixel size, clamped to what fits inside the booth.
|
|
39
|
+
*
|
|
40
|
+
* The anchor is in world space and names the badge's top-left corner, so the center is
|
|
41
|
+
* `anchor + R(rotation) · (w/2, h/2)`; the renderer then rotates the badge about that center, which
|
|
42
|
+
* lands it where the anchor says.
|
|
43
|
+
* @param pixelSize - Plan units per device pixel.
|
|
44
|
+
* @returns The rect.
|
|
45
|
+
*/
|
|
46
|
+
private rectScaled;
|
|
47
|
+
/**
|
|
48
|
+
* Whether the badge's floor is switched off, which hides it wherever it sits.
|
|
49
|
+
* @returns Whether to hide it.
|
|
50
|
+
*/
|
|
51
|
+
private isHidden;
|
|
52
|
+
}
|
|
53
|
+
/** Everything {@link BoothBadgeDrawer} needs to place a badge, gathered once when it is built. */
|
|
54
|
+
export interface BadgePlacement {
|
|
55
|
+
/** The booth the badge belongs to; its layer's visibility decides whether the badge is drawn. */
|
|
56
|
+
booth: RegularBooth;
|
|
57
|
+
/** Where the badge's top-left corner sits on the plan, before rotation. */
|
|
58
|
+
anchor: {
|
|
59
|
+
x: number;
|
|
60
|
+
y: number;
|
|
61
|
+
};
|
|
62
|
+
/** The badge's width and height at scale 1. */
|
|
63
|
+
source: {
|
|
64
|
+
x: number;
|
|
65
|
+
y: number;
|
|
66
|
+
};
|
|
67
|
+
/** The booth's rotation, in radians. */
|
|
68
|
+
rotation: number;
|
|
69
|
+
/** The largest scale that still fits inside the booth's footprint. */
|
|
70
|
+
maxScale: number;
|
|
71
|
+
/** The badge's background rect. */
|
|
72
|
+
bg: ShapeDef;
|
|
73
|
+
/** The booth number drawn inside it. */
|
|
74
|
+
text: TextDef;
|
|
75
|
+
}
|
|
76
|
+
export declare function configBoothsBadges(layerName: string, booths: Booth[]): {
|
|
10
77
|
layer: LayerDef | null;
|
|
11
78
|
cleanup: () => void;
|
|
12
79
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Box as
|
|
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,15 +1,12 @@
|
|
|
1
1
|
import { ColorInput, ShapeDef } from '@expofp/renderer';
|
|
2
2
|
import Color from 'color';
|
|
3
|
-
import { RendererService } from '../../../../renderer';
|
|
4
|
-
import { PathInfo } from '../../../../renderer/engine-core/types';
|
|
5
3
|
import { Booth } from '../../../../store/BoothStore';
|
|
6
|
-
import { ShapeBgDef } from '../../../../types/drawing.types';
|
|
4
|
+
import { PathInfo, ShapeBgDef } from '../../../../types/drawing.types';
|
|
7
5
|
import { BoothDrawerBaseWithoutPainter } from './BoothDrawerBase';
|
|
8
|
-
export default function configBoothBg(
|
|
6
|
+
export default function configBoothBg(booth: Booth): BoothBgDrawer;
|
|
9
7
|
export declare function pathToShapeDef(paths: PathInfo[], layer: string): ShapeDef[];
|
|
10
8
|
declare class BoothBgDrawer extends BoothDrawerBaseWithoutPainter {
|
|
11
|
-
|
|
12
|
-
constructor(rendererService: RendererService, booth: Booth);
|
|
9
|
+
constructor(booth: Booth);
|
|
13
10
|
getShape(): ShapeBgDef[];
|
|
14
11
|
update(): void;
|
|
15
12
|
getBoothPathColor(defaultColor: ColorInput): Color<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as d}from"tslib";import{Rect as
|
|
1
|
+
import{__decorate as d}from"tslib";import{Rect as S}from"@expofp/geometry";import{update as y}from"@expofp/renderer";import l from"color";import k from"color-interpolate";import{computed as u,reaction as m}from"mobx";import h from"../../../../data";import{getFpSvgJs as v}from"../../../../data/fp-payloads";import{createShapeDef as D}from"../../../../engine/defs";import g,{boothStore as x,layersStore as b,uiState as n}from"../../../../store";import{RegularBooth as L,SpecialBooth as P}from"../../../../store/BoothStore";import{RebookingState as I}from"../../../../store/ExhibitorStore";import{LayersMode as w}from"../../../../store/LayerStore";import{rebookingStateConfig as C}from"../../../../tools/rebooking-config";import s from"../../../../tools/settings";import{BoothDrawerBaseWithoutPainter as A}from"./BoothDrawerBase";import{buildPathDef as F}from"./config-bg";export default function R(i){return new c(i)}function H(i){if(i.length===0)return null;const o=i[0];return i.every(t=>t===o)?o:null}export function pathToShapeDef(i,o){const e=[];for(const t of i){const r=F({index:t.index,color:t.color,unblinking:t.unblinking},o);r&&e.push(r)}return e}class c extends A{constructor(o){if(super(o),o.paths){const e=pathToShapeDef(o.paths,g.layerStore.mode!==w.Default?o.layer.name:"");o.shapes=e.map(t=>{const r=n.monochrome?l(t.color).grayscale().rgb().string():this.getBoothColor().string();return t.color==="transparent"?t.color=r:t.defaultColor=t.color,t})}else{const e=o.borderColor==="none"?0:isNaN(o.borderWidth)?x.borderWidth:o.borderWidth,t=this.booth.rect.expand(-e/2),r=this.getBoothColor().string();o.shapes=[D(new S(t.center,t.size,this.booth.rotate,this.booth.elevation),r)]}m(()=>this.booth.hover,()=>!this.booth.selected&&this.update()),m(()=>[b.layersLoaded,this.booth.skipDim,this.booth.selected,this.boothShape.selectBgAnimationPart],()=>this.update())}getShape(){return this.booth.shapes}update(){if(b.layersLoaded)for(const o of this.booth.shapes){if(o.dim=this.booth.skipDim?!1:void 0,o.color&&!o.unblinking){const e=o.defaultColor?this.getBoothPathColor(o.defaultColor):this.getBoothColor();o.color=e.string()}y(o)}}getBoothPathColor(o){if(n.heatmap)return this.getHeatmapColor();const e=this.booth;let t=l(o).hsl();if(e.selected){const r=s.colors.booths.selected;if(v().__fpSettings?.fpVer){const f=this.selectedColorInterpolateFunc(this.boothShape.selectBgAnimationPart),p=l(f==="none"?r:f);return n.monochrome?p.grayscale():p}const a=l(r).hsl(),B=a.lightness()*this.boothShape.selectBgAnimationPart;t=t.hue(a.hue()).lightness(B)}else e.hover&&(t=t.darken(.1));return n.monochrome&&(t=t.grayscale()),t}getHeatmapColor(){const o=this.booth,e=g.heatmapStore.getHeatmapColorForBooth(o);if(o.selected){const t=this.selectedColorInterpolateFunc(this.boothShape.selectBgAnimationPart);return l(t==="none"?"#f33":t)}return o.hover?e.darken(.2).alpha(e.alpha()*1.5):e}get defaultColor(){const o=this.booth;let e=s.colors.booths.default;if(o instanceof P)e=o.color||s.colors.booths.empty;else if(o instanceof L){if(h.isRebooking){if(!o.exhibitors?.length)return C[I.Unasked].color.primary;const r=H((o.exhibitors??[]).map(a=>a.rebookingState));return r!==null?C[r].color.primary:"#000000"}const t=s.colors.booths;o.onHold?e=o.holdColor||t.defaultHold:o.exhibitors.length||o.reserved?e=o.soldColor||t.defaultSold:e=o.availColor||t.empty}try{e==="none"&&(e=s.colors.booths.default),l(e)}catch(t){e=s.colors.booths.default,console.error("Booth: defaultColor",t)}return e}get selectedColorInterpolateFunc(){const o=s.colors.booths.seectedLight||(l(this.booth.labelColor||s.boothLabelColor).isLight()?"#000":"#fff"),e=n.selectedRoute?s?.colors?.booths?.wayfinding?.selected:s?.colors?.booths?.selected;return k([o,e])}getBoothColor(){const o=this.booth;if(n.heatmap)return this.getHeatmapColor();let e;o.error?e="#f33":h.isRebooking?e=this.defaultColor:o.selected?e=this.selectedColorInterpolateFunc(this.boothShape.selectBgAnimationPart):e=this.defaultColor;let t;try{t=l(e==="none"?"#f33":e)}catch{t=l(this.defaultColor)}return(o.hover&&!o.selected||o.selected&&h.isRebooking)&&(t=t.darken(.2).alpha(t.alpha()*1.5)),(n.monochrome||n.heatmapYah)&&(t=t.grayscale()),t}}d([u({keepAlive:!0})],c.prototype,"defaultColor",null),d([u({keepAlive:!0})],c.prototype,"selectedColorInterpolateFunc",null);
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { Rect } from '@expofp/geometry';
|
|
2
2
|
import { ImageDef } from '@expofp/renderer';
|
|
3
|
-
import { RendererService } from '../../../../renderer';
|
|
4
3
|
import { Booth } from '../../../../store/BoothStore';
|
|
5
4
|
import { BoothDrawerBaseWithoutPainter } from './BoothDrawerBase';
|
|
6
|
-
export default function configBoothBookmarkImage(
|
|
7
|
-
declare class BoothBookmarkDrawer extends BoothDrawerBaseWithoutPainter {
|
|
8
|
-
protected rendererService: RendererService;
|
|
5
|
+
export default function configBoothBookmarkImage(booth: Booth): BoothBookmarkDrawer | undefined;
|
|
6
|
+
export declare class BoothBookmarkDrawer extends BoothDrawerBaseWithoutPainter {
|
|
9
7
|
protected shape: ImageDef;
|
|
10
8
|
protected bookmarkId: string;
|
|
11
9
|
protected readonly canvas: HTMLCanvasElement;
|
|
12
10
|
protected rect: Rect;
|
|
13
11
|
protected padding: number;
|
|
14
|
-
constructor(
|
|
12
|
+
constructor(booth: Booth);
|
|
15
13
|
getShape: () => ImageDef;
|
|
16
14
|
update(bookmarked: boolean): void;
|
|
17
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Lays this bookmark out for a new pixel size: the ribbon holds its on-screen size, clamped to what
|
|
17
|
+
* fits in the top-right corner of the booth.
|
|
18
|
+
* @param pixelSize - Plan units per device pixel.
|
|
19
|
+
* @returns The bookmark unless hidden — nothing draws a hidden one, and `update()` syncs it on
|
|
20
|
+
* the way back into view.
|
|
21
|
+
*/
|
|
22
|
+
layOutBookmark(pixelSize: number): ImageDef[];
|
|
18
23
|
}
|
|
19
|
-
export {};
|
|
20
24
|
//# sourceMappingURL=config-booth-bookmark.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Rect as
|
|
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,11 +1,10 @@
|
|
|
1
1
|
import { ShapeDef } from '@expofp/renderer';
|
|
2
|
-
import { RendererService } from '../../../../renderer';
|
|
3
2
|
import { Booth } from '../../../../store/BoothStore';
|
|
4
3
|
import { BoothDrawerBaseWithoutPainter } from './BoothDrawerBase';
|
|
5
|
-
export default function configBoothBorder(
|
|
4
|
+
export default function configBoothBorder(booth: Booth): BoothBorderDrawer | undefined;
|
|
6
5
|
declare class BoothBorderDrawer extends BoothDrawerBaseWithoutPainter {
|
|
7
6
|
protected readonly shape: ShapeDef;
|
|
8
|
-
constructor(
|
|
7
|
+
constructor(booth: Booth);
|
|
9
8
|
private getBorderColor;
|
|
10
9
|
getShape(): ShapeDef;
|
|
11
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Polygon as
|
|
1
|
+
import{Polygon as w,Rect as S}from"@expofp/geometry";import{update as W}from"@expofp/renderer";import l from"color";import{reaction as k}from"mobx";import{createShapeDef as D}from"../../../../engine/defs";import{boothStore as p,heatmapStore as P,layersStore as m,uiState as f}from"../../../../store";import a from"../../../../tools/settings";import{BoothDrawerBaseWithoutPainter as v}from"./BoothDrawerBase";export default function L(s){if(a.EXPO!=="confex20"&&!(s.poiType||s.borderColor==="none"||s.borderWidth===0&&!p.borderWidth||s.paths&&!s.pathsWithRect))return new R(s)}class R extends v{constructor(o){super(o);const i=this.booth.rect,{x:e,y:r}=i.center,{width:n,height:h}=i.size,t=o.borderWidth||p.borderWidth,c=[],d=(y,B,b,C)=>{const x=new S({x:y,y:B},{x:b,y:C},0,o.elevation).toPolygon();c.push(x.rotate(o.rotate??0,{x:e,y:r}))};d(e,r-h/2,n+t,t),d(e,r+h/2,n+t,t),d(e-n/2,r,t,h+t),d(e+n/2,r,t,h+t);const u=w.merge(...c),g=this.getBorderColor();this.shape=D(u,g.string()),k(()=>[this.booth.skipDim,m.layersLoaded,this.booth.hover,this.booth.selected,f.heatmap],()=>{m.layersLoaded&&(this.shape.dim=this.booth.skipDim?!1:void 0,this.shape.color=this.getBorderColor().string(),W(this.shape))})}getBorderColor(){const o=this.booth;if(f.heatmap){const e=P.getHeatmapColorForBooth(o);if(o.selected){const r=a.colors.booths.selectedBorder;return r?l(r):e.darken(.4)}return o.hover?e.darken(.3):e.darken(.2)}const i=o.selected?a.colors.booths.selectedBorder:o.borderColor;return l(i||a.colors.booths.default)}getShape(){return this.shape}}
|
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
import { type ImageDef, type TextDef } from '@expofp/renderer';
|
|
2
|
-
import { type FontSizeFactor
|
|
2
|
+
import { type FontSizeFactor } from '../../../../engine/defs';
|
|
3
3
|
import { type Booth, SpecialBooth } from '../../../../store/BoothStore';
|
|
4
4
|
import { BoothLabelDrawer } from './config-booth-labels';
|
|
5
|
-
export default function configBoothLabelsSpecial(
|
|
5
|
+
export default function configBoothLabelsSpecial(booth: Booth): BoothLabelSpecialDrawer | undefined;
|
|
6
6
|
declare class BoothLabelSpecialDrawer extends BoothLabelDrawer {
|
|
7
7
|
protected steps: FontSizeFactor[];
|
|
8
8
|
protected labelIsVertical: boolean;
|
|
9
9
|
protected text: string;
|
|
10
|
-
constructor(
|
|
10
|
+
constructor(booth: SpecialBooth);
|
|
11
11
|
getShape(): (ImageDef | TextDef)[];
|
|
12
|
+
/**
|
|
13
|
+
* Lays a special booth's label out: the text fitter's steps are indexed by the inverse pixel size,
|
|
14
|
+
* and a plan too far out for the smallest step drops the label to nothing.
|
|
15
|
+
* @param pixelSize - Plan units per device pixel.
|
|
16
|
+
* @returns Always the label; every step writes the line, and the fitter's text may change with it.
|
|
17
|
+
*/
|
|
18
|
+
layOutLabel(pixelSize: number): TextDef[];
|
|
19
|
+
/**
|
|
20
|
+
* Lays a special booth's dot out: it stands in for the label exactly when no step fits.
|
|
21
|
+
* @param pixelSize - Plan units per device pixel.
|
|
22
|
+
* @returns Always the dot; the bounds are rewritten on every step.
|
|
23
|
+
*/
|
|
24
|
+
layOutDot(pixelSize: number): ImageDef[];
|
|
12
25
|
setFactors(text: string): void;
|
|
13
26
|
setText(): void;
|
|
14
27
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`),this.shapeLabel.padding=[this.paddingScaled[0]*
|
|
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,6 +1,7 @@
|
|
|
1
1
|
import { Rect } from '@expofp/geometry';
|
|
2
2
|
import { type ImageDef, type TextAlignment, type TextDef } from '@expofp/renderer';
|
|
3
|
-
import { type
|
|
3
|
+
import { type FontSizeFactor } from '../../../../engine/defs';
|
|
4
|
+
import { type CustomFonts } from '../../../../engine/fonts';
|
|
4
5
|
import { type Booth } from '../../../../store/BoothStore';
|
|
5
6
|
import { type Exhibitor } from '../../../../store/ExhibitorStore';
|
|
6
7
|
import { BoothDrawerBaseWithoutPainter } from './BoothDrawerBase';
|
|
@@ -9,7 +10,7 @@ interface Prefix {
|
|
|
9
10
|
name: string;
|
|
10
11
|
short?: boolean;
|
|
11
12
|
}
|
|
12
|
-
export default function configBoothLabels(
|
|
13
|
+
export default function configBoothLabels(booth: Booth): BoothLabelDrawer | undefined;
|
|
13
14
|
export declare function getMinZoomFactorForDot(scaleFactors: number[]): number;
|
|
14
15
|
export declare const isDirectionsMode: () => boolean;
|
|
15
16
|
export declare function getFontUrlByWeight(weight: number, customFonts?: CustomFonts[], style?: string): string;
|
|
@@ -21,7 +22,6 @@ export declare function getBoothLabelWeights(): LabelFontWeights;
|
|
|
21
22
|
export declare function getExhibitorLabelWeights(): LabelFontWeights;
|
|
22
23
|
export declare function getBadgeFontWeight(): number;
|
|
23
24
|
export declare class BoothLabelDrawer extends BoothDrawerBaseWithoutPainter {
|
|
24
|
-
protected readonly rendererService: RendererService;
|
|
25
25
|
protected canvasRect: Rect;
|
|
26
26
|
protected paddingScaled: [number, number];
|
|
27
27
|
protected padding: number;
|
|
@@ -36,8 +36,22 @@ export declare class BoothLabelDrawer extends BoothDrawerBaseWithoutPainter {
|
|
|
36
36
|
protected centerAlignment: TextAlignment;
|
|
37
37
|
protected prefixes: Prefix[];
|
|
38
38
|
protected fontUrls: [string, string];
|
|
39
|
-
constructor(
|
|
39
|
+
constructor(booth: Booth);
|
|
40
40
|
getShape(): (ImageDef | TextDef)[];
|
|
41
|
+
/**
|
|
42
|
+
* Lays this booth's label out for a new pixel size: the font-size step, the alignment that follows
|
|
43
|
+
* it, and the padding that scales with it.
|
|
44
|
+
* @param pixelSize - Plan units per device pixel.
|
|
45
|
+
* @returns The label when it moved, empty when nothing changed so the renderer skips the write.
|
|
46
|
+
*/
|
|
47
|
+
layOutLabel(pixelSize: number): TextDef[];
|
|
48
|
+
/**
|
|
49
|
+
* Lays this booth's dot out for a new pixel size: it is drawn only in the band between the zoom
|
|
50
|
+
* where the label stops fitting and the zoom where the dot itself would overflow the booth.
|
|
51
|
+
* @param pixelSize - Plan units per device pixel.
|
|
52
|
+
* @returns The dot when it moved, empty when nothing changed so the renderer skips the write.
|
|
53
|
+
*/
|
|
54
|
+
layOutDot(pixelSize: number): ImageDef[];
|
|
41
55
|
getShapeDot(): void;
|
|
42
56
|
private createLines;
|
|
43
57
|
private calculateFontSizeFactors;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Rect as
|
|
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,6 +1,5 @@
|
|
|
1
1
|
import { LayerDef } from '@expofp/renderer';
|
|
2
|
-
import { RendererService } from '../../../../renderer';
|
|
3
2
|
import { Booth } from '../../../../store/BoothStore';
|
|
4
3
|
export declare const BOOTHS_CHUNK_SIZE = 350;
|
|
5
|
-
export default function configBooths(
|
|
4
|
+
export default function configBooths(layerID: string, booths: Booth[]): LayerDef;
|
|
6
5
|
//# sourceMappingURL=config-booths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Rect as
|
|
1
|
+
import{Rect as v}from"@expofp/geometry";import{SEPARATOR as u}from"../../../../constants";import{createImageDef as H}from"../../../../engine/defs";import N,{boothStore as P,uiState as W}from"../../../../store";import w from"../../../../tools/settings";import{loadImagesInBatchesById as A}from"../../../../utils/loadImagesInBatches";import{clearHoveredBooth as C,hoverBooth as E,rememberBoothShapes as T,selectBooth as U}from"../../pointer";import _ from"./config-booth-bg";import z from"./config-booth-bookmark";import K from"./config-booth-border";import M from"./config-booth-labels";import Z from"./config-booth-labels-special";import{registerLayerImages as j}from"./layer-images";import{createBoothImg as q,getImageLayerName as F,mapBoothsLogos as G}from"./loadBoothsImages";export const BOOTHS_CHUNK_SIZE=350;export default function J(L,S){return(i=>{const s=L,m=[],c=[],h=[],l=[],p=[],f=F(s),d={name:f,children:[]};for(const o of i){const t=_(o)?.getShape();t&&(m.push(...t),T(o,t));const r=M(o)?.getShape();r&&c.push(...r);const n=Z(o)?.getShape();if(n&&h.push(...n),!w.borderless){const e=K(o)?.getShape();e&&l.push(e)}const a=z(o)?.getShape();a&&p.push(a)}const I=c.filter(o=>o.lines),k=h.filter(o=>o.lines),y=c.filter(o=>o.source),$=h.filter(o=>o.source);if(!W.hideLogoInBooth){const o=G(i);j(f,async()=>{const t=await A(o,BOOTHS_CHUNK_SIZE),r=[];for(const[n,a]of t){const e=N.boothStore.boothById.get(n);if(!e)continue;const{bounds:x,htmlImage:D}=q(e,a),b=H(D,x),O=e.borderWidth||P.borderWidth,B=e.rect.expand(-O),R=new v(B.center,B.size,e.rotate);e.shapes.push(b),r.push({shape:b,parentRect:R})}return{layer:d,children:r}})}let g=[];if(i.length){const o=s+u;g=[{name:`${o}boothBackground`,children:m,onPointerMove:E,onPointerOut:C,onClick:U},{name:`${o}labels`,children:I},{name:`${o}specialLabels`,children:k},{name:`${o}dots`,children:y},{name:`${o}specialDots`,children:$},d,{name:`${o}boothsBookmark`,children:p},{name:`${s}${u}boothBorder`,children:l}]}return{name:s,children:g}})(S)}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LayerDef } from '@expofp/renderer';
|
|
2
|
-
import { RendererService } from '../../../../renderer';
|
|
3
2
|
import { Layer } from '../../../../store/LayerStore';
|
|
4
|
-
export default function loadLayer(layer: Layer
|
|
3
|
+
export default function loadLayer(layer: Layer): Promise<LayerDef>;
|
|
5
4
|
//# sourceMappingURL=config-load-layer.d.ts.map
|