@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
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as
|
|
1
|
+
import{__decorate as r}from"tslib";import{action as l}from"mobx";import{MOBILE_BREAKPOINT as n}from"../../constants";import c from"../../tools/track-event";import{PREFIXES as a,SearchButtonType as o}from"./constants";import{extractPoiTypeId as u,getButtonConfig as S}from"./utils";export class SearchButtonsActions{constructor(e,t,i){this.rootStore=e,this.state=t,this.filters=i}reportActivation(e){e&&c("sbtnview",e)}handleSearchButtonClick(e,t){const s={[o.BOOKMARKS]:()=>this.handleBookmarksClick(t),[o.VISITED]:()=>this.handleVisitedClick(t),[o.SESSIONS]:()=>this.handleSessionsClick(t),[o.TOURS]:()=>this.handleToursClick(t),[o.CATEGORIES]:()=>this.handleCategoriesClick(t),[o.EXHIBITORS]:()=>this.handleExhibitorsClick(t)}[e];if(s){s();return}e.startsWith(a.POI_TYPE)&&this.handlePoiTypeClick(e,t)}handleExtendedSearchButtonClick(e){const t=S(e);if(!t)return;const i=t.name;if(t.type==="link"){this.handleLinkClick(t,i);return}const s=t.children?.filter(h=>h.visible)||[];if(s.length===1&&s[0].type==="poi_types"&&s[0].name===t.name){this.handleSearchButtonClick(e,i);return}t.children&&s.length>0?this.handleParentButton(e,t,i):this.handleSearchButtonClick(e,i)}handleMainButtonClick(e){this.handleSearchButtonClick(e)}handleSessionsClick(e){const{uiState:t}=this.rootStore;t.list.type==="sessions"?this.switchToSearch():(this.reportActivation(e),this.resetAllFilters(),t.details=null,t.menu=!1,t.list={type:"sessions",text:"",focused:!1},this.state.setSubButton(null),t.selectedTrack=null,this.state.subButtonsEnabled&&this.showSubButtons("sessions"),this.isMobile&&(t.desiredOverlaySize="full"))}togglePoiType(e){this.handleSearchButtonClick(`${a.POI_TYPE}${e}`)}clearAllFilters(){this.switchToSearch()}showSubButtons(e){this.state.subButtonsEnabled&&(this.state.setSubButtonParent(e),this.state.setSubButton(null),this.rootStore.uiState.subButtonsVisible=!0)}hideSubButtons(){this.state.setSubButtonParent(null),this.state.setSubButton(null),this.rootStore.uiState.subButtonsVisible=!1}handleSubButtonClick(e){this.state.activeSubButtonId!==e&&this.state.setSubButton(e)}toggleListView(e,t,i){this.rootStore.uiState.list.type===e?this.switchToSearch():(this.reportActivation(i),this.resetAllFilters(),t())}handleBookmarksClick(e){this.toggleListView("bookmarks",()=>{this.rootStore.clickBookmarks()},e)}handleVisitedClick(e){this.toggleListView("visited",()=>{this.rootStore.clickVisited()},e)}handleToursClick(e){const{uiState:t}=this.rootStore;t.list.type==="tours"?this.switchToSearch():(this.reportActivation(e),this.resetAllFilters(),t.details=null,t.menu=!1,t.list={type:"tours",text:"",focused:!1},this.isMobile&&(t.desiredOverlaySize="full"))}handleCategoriesClick(e){const{uiState:t}=this.rootStore;this.reportActivation(e),t.list.type!=="search"?this.switchToSearch():this.state.activePoiFilterId&&this.filters.clearPoiTypeFilters(),this.state.searchShortcutState.activeParentId&&(this.state.setActiveParentId(null),this.state.clearChildren(),this.state.showShortcuts(!1),this.filters.clearAllChildFilters()),this.rootStore.categoryFilterStore.openFilter()}handleExhibitorsClick(e){const{uiState:t}=this.rootStore;t.list.type==="exhibitors"?this.switchToSearch():(this.reportActivation(e),this.resetAllFilters(),t.details=null,t.menu=!1,t.list={type:"exhibitors",text:"",focused:!1},this.isMobile&&(t.desiredOverlaySize="full"))}handlePoiTypeClick(e,t){const{uiState:i}=this.rootStore,s=this.state.activePoiFilterId!==e;s&&this.reportActivation(t);const h=i.list.type==="search"&&i.list.text||"";i.list.type!=="search"?this.switchToSearch(!0):i.selectedCategoryFilters.length>0&&this.filters.clearCategoryFilters(),this.state.searchShortcutState.activeParentId&&(this.state.setActiveParentId(null),this.state.clearChildren(),this.state.showShortcuts(!1),this.filters.clearAllChildFilters()),s?this.setPoiFilterFromString(e):this.filters.clearPoiTypeFilters(),h&&i.list.type==="search"&&(i.list={type:"search",text:h,focused:!1}),this.rootStore.searchStore.selectSearchAndFocus(h)}handleLinkClick(e,t){const i=e.children?.find(s=>s.type==="link");i&&"linkUrl"in i&&(this.reportActivation(t),window.open(i.linkUrl,"_blank"))}handleParentButton(e,t,i){const{uiState:s}=this.rootStore;if(this.state.searchShortcutState.activeParentId===e){this.state.setActiveParentId(null),this.state.clearChildren(),this.state.showShortcuts(!1),this.filters.clearAllChildFilters(),this.rootStore.urlFilterManager.clearAllFilters(),s.centerMap=!0,s.overlaySize==="full"&&s.searchFocused&&this.rootStore.searchStore.setFocused(!1);return}this.reportActivation(i),s.list.type!=="search"&&this.switchToSearch(),this.state.activePoiFilterId&&this.state.setPoiFilter(null),this.state.setActiveParentId(e),this.state.showShortcuts(!0),this.state.clearChildren(),this.filters.applyAllChildrenFilters(t),this.rootStore.searchStore.selectSearchAndFocus()}preserveSearchText(e){const{uiState:t}=this.rootStore,i=t.list.type==="search"&&t.list.text||"";e(),t.list.type==="search"&&i&&(t.list={type:"search",text:i,focused:!1})}switchToSearch(e=!1){const t=()=>{this.resetAllFilters(),this.rootStore.uiState.details=null,this.rootStore.uiState.menu=!1,this.rootStore.uiState.list={type:"search",text:"",focused:!1}};e?this.preserveSearchText(t):t()}resetAllFilters(){this.state.reset(),this.rootStore.uiState.selectedPoiTypeFilters=[],this.rootStore.uiState.selectedCategoryFilters=[],this.rootStore.uiState.categoryFilterOpen=!1,this.rootStore.categoryFilterStore.state.selectedItems=[],this.rootStore.categoryFilterStore.state.pendingItems=[],this.rootStore.urlFilterManager.clearAllFilters(),this.rootStore.fp.hidePathways()}setPoiFilterFromString(e){this.state.setPoiFilter(e);const t=u(e);if(t!==null){const i=this.rootStore.poiTypeStore.poiTypes.find(s=>s.id===t);i&&(this.rootStore.uiState.selectedPoiTypeFilters=[i],this.rootStore.urlFilterManager.setPoiType(i.name))}}get isMobile(){return typeof window<"u"&&window.innerWidth<=n}}r([l],SearchButtonsActions.prototype,"handleSearchButtonClick",null),r([l],SearchButtonsActions.prototype,"handleExtendedSearchButtonClick",null),r([l],SearchButtonsActions.prototype,"handleMainButtonClick",null),r([l],SearchButtonsActions.prototype,"handleSessionsClick",null),r([l],SearchButtonsActions.prototype,"togglePoiType",null),r([l],SearchButtonsActions.prototype,"clearAllFilters",null),r([l],SearchButtonsActions.prototype,"showSubButtons",null),r([l],SearchButtonsActions.prototype,"hideSubButtons",null),r([l],SearchButtonsActions.prototype,"handleSubButtonClick",null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import c from"../../data";import{getContrastTextColor as l}from"../../utils/getContrastTextColor";import{tIfExists as d}from"../../utils/i18n";import{BUTTON_ICONS as u,PREFIXES as a,SearchButtonType as i}from"./constants";export class SearchButtonsFactory{constructor(t,e,o){this.rootStore=t,this.state=e,this.actions=o,this.buttonFactories={[i.BOOKMARKS]:r=>this.createBookmarksButton(r),[i.VISITED]:r=>this.createVisitedButton(r),[i.CATEGORIES]:r=>this.createCategoriesButton(r),[i.SESSIONS]:r=>this.createSessionsButton(r),[i.TOURS]:r=>this.createGuidedToursButton(r),[i.POI_TYPE]:r=>this.createPoiTypeButton(r),[i.POI_TYPES]:r=>this.createPoiTypesButton(r),[i.LINK]:r=>this.createLinkButton(r),[i.EXHIBITORS]:r=>this.createExhibitorsButton(r)}}createButtons(t){return this.dedupeButtons(t).filter(e=>e.visible).map(e=>({button:this.createButton(e),order:e.order??Number.MAX_SAFE_INTEGER})).filter(e=>e.button!==null).sort((e,o)=>e.order-o.order).map(e=>e.button)}createButton(t){const e=this.buttonFactories[t.type];return e?e(t):null}createBaseButton(t){const e=t.color&&t.color.toUpperCase()!=="#FFFFFF",o=d(t.name);return{id:t.id||`${t.type}_${t.name}`,label:o,text:o,enabled:!0,isDimmed:!1,isClickable:!0,backgroundColor:e?t.color:void 0,textColor:e&&t.color?l(t.color):void 0}}createButtonId(t,e){return e.id||`${t}${e.name}`}createBookmarksButton(t){const{uiState:e}=this.rootStore;return e.kiosk||e.disableBookmarked||c.hideBookmarks?null:{...this.createBaseButton(t),id:i.BOOKMARKS,icon:u.BOOKMARKS,active:e.list.type==="bookmarks",count:this.countBookmarks(),onClick:()=>this.actions.handleSearchButtonClick(i.BOOKMARKS,t.name)}}createVisitedButton(t){const{uiState:e}=this.rootStore;return e.kiosk?null:{...this.createBaseButton(t),id:i.VISITED,icon:u.VISITED,active:e.list.type==="visited",count:this.countVisited(),onClick:()=>this.actions.handleSearchButtonClick(i.VISITED,t.name)}}createCategoriesButton(t){if(!t.children?.length){const n=this.getCategoriesTotalCount();return n>0?this.createSimpleCategoriesButton(t,n):null}const e=(t.children||[]).filter(n=>n.visible);if(e.length===0)return null;const o=this.createButtonId(a.CATEGORIES,t),r=e.filter(n=>n.type==="categories"),s=this.countCategories(r);return{...this.createBaseButton(t),id:o,active:this.state.searchShortcutState.activeParentId===o,count:s,showZeroCount:!0,onClick:()=>this.actions.handleExtendedSearchButtonClick(o)}}createSimpleCategoriesButton(t,e){const{uiState:o}=this.rootStore,r=o.selectedCategoryFilters.length>0?o.selectedCategoryFilters.length:e;return{...this.createBaseButton(t),id:i.CATEGORIES,active:o.selectedCategoryFilters.length>0&&!this.state.searchShortcutState.activeParentId,count:r,showZeroCount:!0,onClick:()=>this.actions.handleSearchButtonClick(i.CATEGORIES,t.name)}}createSessionsButton(t){const{uiState:e}=this.rootStore,o=this.getSessionsTotalCount();return o===0?null:{...this.createBaseButton(t),id:i.SESSIONS,icon:u.SESSIONS,active:e.list.type==="sessions",count:o,showZeroCount:!0,hasSubButtons:!0,onClick:()=>this.actions.handleSessionsClick(t.name)}}createGuidedToursButton(t){const{uiState:e}=this.rootStore,o=this.getGuidedToursTotalCount();return o===0?null:{...this.createBaseButton(t),id:"guided_tours",active:e.list.type==="tours"||e.list.type==="multi-point-tour",count:o,showZeroCount:!0,onClick:()=>this.actions.handleSearchButtonClick("guided_tours",t.name)}}createPoiTypeButton(t){const e=this.rootStore.poiTypeStore.poiTypes.find(s=>s.name===t.name);if(!e)return null;const o=`${a.POI_TYPE}${e.id}`,r=this.getPoiTypeTotalCount(e.id);return r===0?null:{...this.createBaseButton(t),id:o,active:this.state.activePoiFilterId===o,count:r,showZeroCount:!0,onClick:()=>this.actions.handleSearchButtonClick(o,t.name)}}createPoiTypesButton(t){if(!t.children?.length)return this.createPoiTypeButton(t);const e=t.children.filter(n=>n.visible);if(e.length===0)return null;if(this.shouldFlattenToSinglePoiType(e,t))return this.createPoiTypeButton(t);const o=e.filter(n=>n.type!=="link"),r=this.countPoiTypes(o),s=this.createButtonId(a.POI_TYPES,t);return{...this.createBaseButton(t),id:s,active:this.state.searchShortcutState.activeParentId===s,count:r,showZeroCount:!0,onClick:()=>this.actions.handleExtendedSearchButtonClick(s)}}shouldFlattenToSinglePoiType(t,e){return t.length===1&&t[0].type==="poi_types"&&t[0].name===e.name}createLinkButton(t){const e=this.createButtonId(a.LINK,t);return{...this.createBaseButton(t),id:e,active:!1,onClick:()=>this.actions.handleExtendedSearchButtonClick(e)}}createExhibitorsButton(t){const{uiState:e}=this.rootStore,o=this.getExhibitorsTotalCount();return o===0?null:{...this.createBaseButton(t),id:i.EXHIBITORS,icon:u.EXHIBITORS,active:e.list.type==="exhibitors",count:o,showZeroCount:!0,onClick:()=>this.actions.handleSearchButtonClick(i.EXHIBITORS,t.name)}}countCategories(t){const{categoryById:e}=this.rootStore.categoryStore,o=new Set;return t.forEach(r=>{if(r.type!=="categories")return;const s=e.get(Number(r.id));s&&s.exhibitors.forEach(n=>o.add(n.id))}),o.size}countPoiTypes(t){return t.reduce((e,o)=>{if(o.type!=="poi_types")return e;if(o.count!==void 0)return e+o.count;const r=Number(o.id),s=this.rootStore.poiTypeStore.poiTypes.find(n=>n.id===r);if(s){const n=this.rootStore.boothStore.booths.filter(h=>h.poiTypeId===s.id).length;return e+n}return e},0)}dedupeButtons(t){const e=new Set;return t.filter(o=>{const r=`${o.type}_${o.name}`;return e.has(r)?!1:(e.add(r),!0)})}countBookmarks(){return this.rootStore.exhibitorStore.bookmarked.length+this.rootStore.eventStore.bookmarked.length+this.rootStore.speakerStore.bookmarked.length+this.rootStore.boothStore.booths.filter(t=>t.exhibitors.length===0&&t.bookmarkedDirectly).length}countVisited(){return this.rootStore.exhibitorStore.visited.length+this.rootStore.eventStore.visited.length}getSessionsTotalCount(){return this.rootStore.eventStore.eventItems.length}getGuidedToursTotalCount(){return this.rootStore.toursStore.hasTours?this.rootStore.toursStore.tourItems.length:0}getCategoriesTotalCount(){return this.rootStore.categoryStore.categories.filter(t=>t.exhibitors.length>0).length}getPoiTypeTotalCount(t){return this.rootStore.boothStore.booths.filter(e=>e.poiTypeId===t).length}getExhibitorsTotalCount(){return this.rootStore.exhibitorStore.exhibitors.length}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import RootStore from '../RootStore';
|
|
1
|
+
import type RootStore from '../RootStore';
|
|
2
2
|
import type { SearchButtonConfig, SearchButtonTypeConfig, SearchShortcutState, SearchSubButtonConfig } from '../types';
|
|
3
3
|
export default class SearchButtonsStore {
|
|
4
4
|
private readonly rootStore;
|
|
@@ -34,10 +34,10 @@ export default class SearchButtonsStore {
|
|
|
34
34
|
get poiTypeCounts(): Map<number, number>;
|
|
35
35
|
get totalPoiTypeCount(): number;
|
|
36
36
|
get activePoiTypeId(): number | null;
|
|
37
|
-
handleSearchButtonClick(searchButtonId: string): void;
|
|
37
|
+
handleSearchButtonClick(searchButtonId: string, caption?: string): void;
|
|
38
38
|
handleExtendedSearchButtonClick(buttonId: string): void;
|
|
39
39
|
handleMainButtonClick(buttonId: string): void;
|
|
40
|
-
handleSessionsClick(): void;
|
|
40
|
+
handleSessionsClick(caption?: string): void;
|
|
41
41
|
togglePoiType(poiTypeId: number): void;
|
|
42
42
|
clearAllFilters(): void;
|
|
43
43
|
showSubButtons(parentButtonId: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as i}from"tslib";import{action as s,computed as o,reaction as l}from"mobx";import{CACHE_DURATION as u,LANGUAGE_TYPE as a,MOBILE_BREAKPOINT as h}from"../../constants";import c from"../../data";import{SessionsSubButtonProvider as p}from"../providers/SessionsSubButtonProvider";import{SubButtonRegistry as d}from"../SubButtonRegistry";import{PREFIXES as S}from"./constants";import{SearchButtonsActions as y}from"./SearchButtonsActions";import{SearchButtonsFactory as B}from"./SearchButtonsFactory";import{SearchButtonsFilters as C}from"./SearchButtonsFilters";import{SearchButtonsState as g}from"./SearchButtonsState";import{countMapValues as b,extractPoiTypeId as P,isValidConfig as v}from"./utils";export default class e{constructor(t){this.poiTypeCountsCache=new Map,this.lastPoiTypeCountUpdate=0,this.rootStore=t,this.state=new g,this.filters=new C(t,this.state),this.actions=new y(t,this.state,this.filters),this.factory=new B(t,this.state,this.actions),this.setupReactions()}setupReactions(){l(()=>this.rootStore.boothStore.booths.length,()=>this.invalidatePoiTypeCounts())}get subButtonRegistry(){return this._subButtonRegistry||(this._subButtonRegistry=new d,this.registerSubButtonProviders()),this._subButtonRegistry}registerSubButtonProviders(){this.subButtonRegistry.register(new p(this.rootStore))}invalidatePoiTypeCounts(){this.poiTypeCountsCache.clear(),this.lastPoiTypeCountUpdate=0}get isVisible(){return this.state.isVisible}get shouldShow(){const{uiState:t}=this.rootStore;if(t.screenSize.width>=h)return this.state.isVisible;const r=!!(t.selectedExhibitor||t.selectedBooth||t.selectedEventItem||t.selectedRoute||t.menu||t.list.type===a);return this.state.isVisible&&!r}get activePoiFilterId(){return this.state.activePoiFilterId}get activeSubButtonsParentId(){return this.state.activeSubButtonsParentId}get activeSubButtonId(){return this.state.activeSubButtonId}get subButtonsEnabled(){return this.state.subButtonsEnabled}get searchShortcutState(){return this.state.searchShortcutState}get searchButtons(){const t=c.filterButtonsConfig;if(!v(t))return console.warn("[SearchButtonsStore] Invalid filterButtonsConfig detected"),[];const n=t.searchButtons;return this.factory.createButtons(n)}get hasAnySearchButtons(){return this.searchButtons.length>0}get hasActiveSearchButton(){return this.state.activePoiFilterId!==null||this.rootStore.uiState.selectedCategoryFilters.length>0}get activeSearchButtonLabel(){return this.state.activePoiFilterId?this.searchButtons.find(n=>n.id===this.state.activePoiFilterId)?.label||null:this.rootStore.uiState.selectedCategoryFilters.length>0?"Categories":null}get activeSubButtons(){return this.state.activeSubButtonsParentId?this.subButtonRegistry.getSubButtons(this.state.activeSubButtonsParentId):[]}get shouldShowSubButtons(){if(!this.state.subButtonsEnabled||!this.state.activeSubButtonsParentId)return!1;const t=this.searchButtons.find(n=>n.id===this.state.activeSubButtonsParentId);return!t||!t.active?!1:this.subButtonRegistry.shouldShowSubButtons(this.state.activeSubButtonsParentId)&&this.activeSubButtons.length>0}get hasActiveParentWithChildren(){return this.state.hasActiveParentWithChildren}get areAllSelected(){return this.filters.areAllSelected()}get activeChildrenCount(){return this.state.activeChildrenCount}get totalChildrenCount(){return this.filters.getChildrenCount()}get poiTypeCounts(){const t=Date.now();if(t-this.lastPoiTypeCountUpdate<u&&this.poiTypeCountsCache.size>0)return this.poiTypeCountsCache;const n=new Map;return this.rootStore.boothStore.booths.forEach(r=>{r.poiTypeId&&n.set(r.poiTypeId,(n.get(r.poiTypeId)||0)+1)}),this.poiTypeCountsCache=n,this.lastPoiTypeCountUpdate=t,n}get totalPoiTypeCount(){return b(this.poiTypeCounts)}get activePoiTypeId(){return this.state.activePoiFilterId?.startsWith(S.POI_TYPE)?P(this.state.activePoiFilterId):null}handleSearchButtonClick(t){this.actions.handleSearchButtonClick(t)}handleExtendedSearchButtonClick(t){this.actions.handleExtendedSearchButtonClick(t)}handleMainButtonClick(t){this.actions.handleMainButtonClick(t)}handleSessionsClick(){this.actions.handleSessionsClick()}togglePoiType(t){this.actions.togglePoiType(t)}clearAllFilters(){this.actions.clearAllFilters()}showSubButtons(t){this.actions.showSubButtons(t)}hideSubButtons(){this.actions.hideSubButtons()}handleSubButtonClick(t){this.state.activeSubButtonId!==t&&(this.state.setSubButton(t),this.state.activeSubButtonsParentId&&this.subButtonRegistry.handleSubButtonClick(this.state.activeSubButtonsParentId,t))}toggleChildFilter(t){this.filters.toggleChildFilter(t)}clearPoiTypeFilters(){this.filters.clearPoiTypeFilters()}clearAllChildFilters(){this.filters.clearAllChildFilters()}setActiveParentId(t){this.state.setActiveParentId(t)}showShortcuts(t){this.state.showShortcuts(t)}clearChildren(){this.state.clearChildren()}setSubButtonId(t){this.state.setSubButton(t)}setPoiFilterId(t){this.state.setPoiFilter(t)}getPoiTypeTotalCount(t){return this.poiTypeCounts.get(t)||0}isChildActive(t){return this.state.isChildActive(t)}getActiveParent(){return this.filters.getActiveParent()}}i([s],e.prototype,"invalidatePoiTypeCounts",null),i([o],e.prototype,"isVisible",null),i([o],e.prototype,"shouldShow",null),i([o],e.prototype,"activePoiFilterId",null),i([o],e.prototype,"activeSubButtonsParentId",null),i([o],e.prototype,"activeSubButtonId",null),i([o],e.prototype,"subButtonsEnabled",null),i([o],e.prototype,"searchShortcutState",null),i([o],e.prototype,"searchButtons",null),i([o],e.prototype,"hasAnySearchButtons",null),i([o],e.prototype,"hasActiveSearchButton",null),i([o],e.prototype,"activeSearchButtonLabel",null),i([o],e.prototype,"activeSubButtons",null),i([o],e.prototype,"shouldShowSubButtons",null),i([o],e.prototype,"hasActiveParentWithChildren",null),i([o],e.prototype,"areAllSelected",null),i([o],e.prototype,"activeChildrenCount",null),i([o],e.prototype,"totalChildrenCount",null),i([o],e.prototype,"poiTypeCounts",null),i([o],e.prototype,"totalPoiTypeCount",null),i([o],e.prototype,"activePoiTypeId",null),i([s],e.prototype,"handleSearchButtonClick",null),i([s],e.prototype,"handleExtendedSearchButtonClick",null),i([s],e.prototype,"handleMainButtonClick",null),i([s],e.prototype,"handleSessionsClick",null),i([s],e.prototype,"togglePoiType",null),i([s],e.prototype,"clearAllFilters",null),i([s],e.prototype,"showSubButtons",null),i([s],e.prototype,"hideSubButtons",null),i([s],e.prototype,"handleSubButtonClick",null),i([s],e.prototype,"toggleChildFilter",null),i([s],e.prototype,"clearPoiTypeFilters",null),i([s],e.prototype,"clearAllChildFilters",null),i([s],e.prototype,"setActiveParentId",null),i([s],e.prototype,"showShortcuts",null),i([s],e.prototype,"clearChildren",null),i([s],e.prototype,"setSubButtonId",null),i([s],e.prototype,"setPoiFilterId",null);
|
|
1
|
+
import{__decorate as i}from"tslib";import{action as s,computed as o,reaction as l}from"mobx";import{CACHE_DURATION as u,LANGUAGE_TYPE as a,MOBILE_BREAKPOINT as h}from"../../constants";import c from"../../data";import{SessionsSubButtonProvider as p}from"../providers/SessionsSubButtonProvider";import{SubButtonRegistry as d}from"../SubButtonRegistry";import{PREFIXES as S}from"./constants";import{SearchButtonsActions as y}from"./SearchButtonsActions";import{SearchButtonsFactory as B}from"./SearchButtonsFactory";import{SearchButtonsFilters as C}from"./SearchButtonsFilters";import{SearchButtonsState as g}from"./SearchButtonsState";import{countMapValues as b,extractPoiTypeId as P,isValidConfig as v}from"./utils";export default class e{constructor(t){this.poiTypeCountsCache=new Map,this.lastPoiTypeCountUpdate=0,this.rootStore=t,this.state=new g,this.filters=new C(t,this.state),this.actions=new y(t,this.state,this.filters),this.factory=new B(t,this.state,this.actions),this.setupReactions()}setupReactions(){l(()=>this.rootStore.boothStore.booths.length,()=>this.invalidatePoiTypeCounts())}get subButtonRegistry(){return this._subButtonRegistry||(this._subButtonRegistry=new d,this.registerSubButtonProviders()),this._subButtonRegistry}registerSubButtonProviders(){this.subButtonRegistry.register(new p(this.rootStore))}invalidatePoiTypeCounts(){this.poiTypeCountsCache.clear(),this.lastPoiTypeCountUpdate=0}get isVisible(){return this.state.isVisible}get shouldShow(){const{uiState:t}=this.rootStore;if(t.screenSize.width>=h)return this.state.isVisible;const r=!!(t.selectedExhibitor||t.selectedBooth||t.selectedEventItem||t.selectedRoute||t.menu||t.list.type===a);return this.state.isVisible&&!r}get activePoiFilterId(){return this.state.activePoiFilterId}get activeSubButtonsParentId(){return this.state.activeSubButtonsParentId}get activeSubButtonId(){return this.state.activeSubButtonId}get subButtonsEnabled(){return this.state.subButtonsEnabled}get searchShortcutState(){return this.state.searchShortcutState}get searchButtons(){const t=c.filterButtonsConfig;if(!v(t))return console.warn("[SearchButtonsStore] Invalid filterButtonsConfig detected"),[];const n=t.searchButtons;return this.factory.createButtons(n)}get hasAnySearchButtons(){return this.searchButtons.length>0}get hasActiveSearchButton(){return this.state.activePoiFilterId!==null||this.rootStore.uiState.selectedCategoryFilters.length>0}get activeSearchButtonLabel(){return this.state.activePoiFilterId?this.searchButtons.find(n=>n.id===this.state.activePoiFilterId)?.label||null:this.rootStore.uiState.selectedCategoryFilters.length>0?"Categories":null}get activeSubButtons(){return this.state.activeSubButtonsParentId?this.subButtonRegistry.getSubButtons(this.state.activeSubButtonsParentId):[]}get shouldShowSubButtons(){if(!this.state.subButtonsEnabled||!this.state.activeSubButtonsParentId)return!1;const t=this.searchButtons.find(n=>n.id===this.state.activeSubButtonsParentId);return!t||!t.active?!1:this.subButtonRegistry.shouldShowSubButtons(this.state.activeSubButtonsParentId)&&this.activeSubButtons.length>0}get hasActiveParentWithChildren(){return this.state.hasActiveParentWithChildren}get areAllSelected(){return this.filters.areAllSelected()}get activeChildrenCount(){return this.state.activeChildrenCount}get totalChildrenCount(){return this.filters.getChildrenCount()}get poiTypeCounts(){const t=Date.now();if(t-this.lastPoiTypeCountUpdate<u&&this.poiTypeCountsCache.size>0)return this.poiTypeCountsCache;const n=new Map;return this.rootStore.boothStore.booths.forEach(r=>{r.poiTypeId&&n.set(r.poiTypeId,(n.get(r.poiTypeId)||0)+1)}),this.poiTypeCountsCache=n,this.lastPoiTypeCountUpdate=t,n}get totalPoiTypeCount(){return b(this.poiTypeCounts)}get activePoiTypeId(){return this.state.activePoiFilterId?.startsWith(S.POI_TYPE)?P(this.state.activePoiFilterId):null}handleSearchButtonClick(t,n){this.actions.handleSearchButtonClick(t,n)}handleExtendedSearchButtonClick(t){this.actions.handleExtendedSearchButtonClick(t)}handleMainButtonClick(t){this.actions.handleMainButtonClick(t)}handleSessionsClick(t){this.actions.handleSessionsClick(t)}togglePoiType(t){this.actions.togglePoiType(t)}clearAllFilters(){this.actions.clearAllFilters()}showSubButtons(t){this.actions.showSubButtons(t)}hideSubButtons(){this.actions.hideSubButtons()}handleSubButtonClick(t){this.state.activeSubButtonId!==t&&(this.state.setSubButton(t),this.state.activeSubButtonsParentId&&this.subButtonRegistry.handleSubButtonClick(this.state.activeSubButtonsParentId,t))}toggleChildFilter(t){this.filters.toggleChildFilter(t)}clearPoiTypeFilters(){this.filters.clearPoiTypeFilters()}clearAllChildFilters(){this.filters.clearAllChildFilters()}setActiveParentId(t){this.state.setActiveParentId(t)}showShortcuts(t){this.state.showShortcuts(t)}clearChildren(){this.state.clearChildren()}setSubButtonId(t){this.state.setSubButton(t)}setPoiFilterId(t){this.state.setPoiFilter(t)}getPoiTypeTotalCount(t){return this.poiTypeCounts.get(t)||0}isChildActive(t){return this.state.isChildActive(t)}getActiveParent(){return this.filters.getActiveParent()}}i([s],e.prototype,"invalidatePoiTypeCounts",null),i([o],e.prototype,"isVisible",null),i([o],e.prototype,"shouldShow",null),i([o],e.prototype,"activePoiFilterId",null),i([o],e.prototype,"activeSubButtonsParentId",null),i([o],e.prototype,"activeSubButtonId",null),i([o],e.prototype,"subButtonsEnabled",null),i([o],e.prototype,"searchShortcutState",null),i([o],e.prototype,"searchButtons",null),i([o],e.prototype,"hasAnySearchButtons",null),i([o],e.prototype,"hasActiveSearchButton",null),i([o],e.prototype,"activeSearchButtonLabel",null),i([o],e.prototype,"activeSubButtons",null),i([o],e.prototype,"shouldShowSubButtons",null),i([o],e.prototype,"hasActiveParentWithChildren",null),i([o],e.prototype,"areAllSelected",null),i([o],e.prototype,"activeChildrenCount",null),i([o],e.prototype,"totalChildrenCount",null),i([o],e.prototype,"poiTypeCounts",null),i([o],e.prototype,"totalPoiTypeCount",null),i([o],e.prototype,"activePoiTypeId",null),i([s],e.prototype,"handleSearchButtonClick",null),i([s],e.prototype,"handleExtendedSearchButtonClick",null),i([s],e.prototype,"handleMainButtonClick",null),i([s],e.prototype,"handleSessionsClick",null),i([s],e.prototype,"togglePoiType",null),i([s],e.prototype,"clearAllFilters",null),i([s],e.prototype,"showSubButtons",null),i([s],e.prototype,"hideSubButtons",null),i([s],e.prototype,"handleSubButtonClick",null),i([s],e.prototype,"toggleChildFilter",null),i([s],e.prototype,"clearPoiTypeFilters",null),i([s],e.prototype,"clearAllChildFilters",null),i([s],e.prototype,"setActiveParentId",null),i([s],e.prototype,"showShortcuts",null),i([s],e.prototype,"clearChildren",null),i([s],e.prototype,"setSubButtonId",null),i([s],e.prototype,"setPoiFilterId",null);
|
package/dist/esm/tools/gtag.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export declare enum GaEventActions {
|
|
|
19
19
|
ClickGooglePlus = "Click Google Plus",
|
|
20
20
|
ClickXing = "Click Xing",
|
|
21
21
|
ClickYoutube = "Click Youtube",
|
|
22
|
+
ClickBookmark = "Click bookmark",
|
|
22
23
|
ClickDirections = "Click Directions",
|
|
23
24
|
Rendered = "Floor plan rendered",
|
|
24
25
|
WsExhibitorClick = "ws_exhibitor_click"
|
package/dist/esm/tools/gtag.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import r from"../data";import l from"../tools/settings";import s from"../tools/track-event";import u from"../utils/is-debug";const d="G-78CKLYWFJK";window.dataLayer=window.dataLayer||[];export default function
|
|
1
|
+
import r from"../data";import l from"../tools/settings";import s from"../tools/track-event";import u from"../utils/is-debug";const d="G-78CKLYWFJK";window.dataLayer=window.dataLayer||[];export default function o(...e){window.dataLayer.push(arguments)}export var GaEventActions;(function(e){e.Load="Load floor plan",e.ViewBooth="View booth",e.ViewExhibitor="View exhibitor",e.ViewCategory="View category",e.Search="Search",e.ClickCustomButton="Click custom button",e.ViewVideo="View video",e.ViewGallery="View gallery",e.ClickPhone="Click phone",e.ClickEmail="Click email",e.ClickWebsite="Click website",e.ClickFacebook="Click Facebook",e.ClickInstagaram="Click Instagram",e.ClickLinkedin="Click Linkedin",e.ClickTwitter="Click Twitter",e.ClickGooglePlus="Click Google Plus",e.ClickXing="Click Xing",e.ClickYoutube="Click Youtube",e.ClickBookmark="Click bookmark",e.ClickDirections="Click Directions",e.Rendered="Floor plan rendered",e.WsExhibitorClick="ws_exhibitor_click"})(GaEventActions||(GaEventActions={}));export async function checkUserIsGDPR(){try{const e=fetch("https://consent.expofp.com/api/verify-ip/is-in-gdpr"),t=new Promise(a=>{setTimeout(()=>{a(null)},5e3)}),i=await Promise.race([e,t]);return i instanceof Response&&i.ok?(await i.json()).result:null}catch(e){return console.error(e),null}}export function hasUserConsent(e){if(e==="granted"||e==="denied")return e;const t=document.cookie.split("; ").find(i=>i.startsWith("cookie_consent="));if(t)return t==="cookie_consent=true"?"granted":"denied"}export function setCookieConsent(e){const i=u?"localhost":".expofp.com";document.cookie=`cookie_consent=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${i}`,document.cookie="cookie_consent=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/",document.cookie=e?`cookie_consent=${e}; max-age=2592000; domain=${i}; path=/`:`cookie_consent=${e}; max-age=2592000; path=/`}function m(){const e=document.cookie.split(";"),t=u?"localhost":".expofp.com";for(let i=0;i<e.length;i++){const a=e[i],k=a.indexOf("="),g=k>-1?a.substr(0,k).trim():a.trim();g.startsWith("_ga")&&(document.cookie=`${g}=;expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${t}`)}}export function setConsentSettings(e){let t=hasUserConsent(e);t&&(t==="denied"?(m(),r.gtag&&(window[`ga-disable-${r.gtag}`]=!0),window[`ga-disable-${d}`]=!0):(r.gtag&&(window[`ga-disable-${r.gtag}`]=!1),window[`ga-disable-${d}`]=!1),o("consent","update",{analytics_storage:t,ad_personalization:t}))}export function sendEventToGa(e,t,i){switch(e){case GaEventActions.ViewBooth:{o("event","select_content",{content_type:e,content_id:t}),s("booview",t);break}case GaEventActions.ViewCategory:{o("event","select_content",{content_type:e,content_id:t}),s("catview",t);break}case GaEventActions.ViewExhibitor:case GaEventActions.ViewGallery:case GaEventActions.ViewVideo:o("event","select_content",{content_type:e,content_id:t});break;case GaEventActions.Search:o("event","search",{search_term:t}),s("search",t);break;case GaEventActions.ClickCustomButton:case GaEventActions.ClickPhone:case GaEventActions.ClickEmail:case GaEventActions.ClickWebsite:case GaEventActions.ClickFacebook:case GaEventActions.ClickInstagaram:case GaEventActions.ClickLinkedin:case GaEventActions.ClickTwitter:case GaEventActions.ClickGooglePlus:case GaEventActions.ClickXing:case GaEventActions.ClickYoutube:o("event","share",{content_type:e,content_id:t}),s("share",t);break;case GaEventActions.ClickBookmark:o("event","share",{content_type:GaEventActions.ClickCustomButton,content_id:t});break;case GaEventActions.ClickDirections:o("event","route",{content_type:e,content_id:t}),s("route",t);break;default:o("event",e,{content_type:i,content_id:t})}}export function sendPayloadToGa(e,t){o("event",e,{...t,fp_key:l.EXPO})}export function trackWsExhibitorClick(e){sendPayloadToGa(GaEventActions.WsExhibitorClick,{exhibitor_id:e.id,exhibitor_name:e.name,exhibitor_external_id:e.externalId,creative_slot:"ws_slider"}),s("ws_exhibitor_click",e.id)}let n,c;if(!n){n=document.createElement("script"),n.type="text/javascript",n.async=!0,n.src=`https://www.googletagmanager.com/gtag/js?id=${d}`;const e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(n,e),o("js",new Date)}if(r.gtag&&!c){c=document.createElement("script"),c.type="text/javascript",c.async=!0,c.src=`https://www.googletagmanager.com/gtag/js?id=${r.gtag}`;const e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(c,e),o("config",r.gtag,{fp_key:l.EXPO})}o("config",d,{fp_key:l.EXPO}),window.gtag=o,o("consent","default",{ad_storage:"denied",analytics_storage:"denied",region:["BE","BG","CZ","DK","DE","EE","IE","EL","ES","FR","HR","IT","CY","LV","LT","LU","HU","MT","NL","AT","PL","PT","RO","SI","SK","FI","SE","UK","IS","NO","LI","CH","MK","AL","RS","TR"],functionality_storage:"denied",personalization_storage:"denied",security_storage:"denied",ad_personalization:"denied"});export function destroyGtag(){n&&n.parentNode&&(n.parentNode.removeChild(n),n=null),c&&c.parentNode&&(c.parentNode.removeChild(c),c=null)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const m="efp-telemetry",I=3e5,O=1e3;function R(t){return t?`${m}:${t}`:m}function A(t=m){return{get(){try{const r=localStorage.getItem(t);return r?JSON.parse(r):null}catch{return null}},set(r){try{localStorage.setItem(t,JSON.stringify(r))}catch(s){console.error("Failed to persist telemetry data",s)}},clear(){try{localStorage.removeItem(t)}catch(r){console.error("Failed to clear telemetry data",r)}}}}function M(t,r){if(!r)return t;const s=t.indexOf("#"),o=s===-1?t:t.slice(0,s),i=s===-1?"":t.slice(s);let c="?";return o.includes("?")&&(c=o.endsWith("?")||o.endsWith("&")?"":"&"),`${o}${c}expo=${encodeURIComponent(r)}${i}`}function N(t){const r=t.headers.get("Retry-After");if(!r)return 0;let s=0;const o=Number(r);if(Number.isFinite(o))s=o*1e3;else{const i=Date.parse(r);isNaN(i)||(s=Math.max(0,i-Date.now()))}return Math.min(s,3e5)}export function createTelemetry(t){const{url:r,expo:s,expoId:o,storage:i=A(R(s))}=t,c=M(r,s);let l=t.kioskId??"";function u(){const e=i.get();return e?(e.expo=s,e.expoId=o,e.kioskId=l,e):{expo:s,expoId:o,kioskId:l,items:[]}}function S(e){l=e}let f=!1,d=!1,h=0;async function E(){if(f){d=!0;return}f=!0;do{if(d=!1,performance.now()<h)break;let e=null;try{if(e=u(),e.items.length===0)break;i.clear();const n=JSON.stringify(e),_=new TextEncoder().encode(n).byteLength,a=await fetch(c,{method:"POST",body:n,headers:{"Content-Type":"application/json"},credentials:"omit",keepalive:_<63e3});if(!a.ok){if(a.status===429||a.status===503){const p=N(a);p>0&&(h=performance.now()+p)}y(e),console.error(`Failed to send telemetry: HTTP ${a.status}`)}}catch(n){e&&y(e),console.error("Failed to send telemetry",n)}}while(d);f=!1}function y(e){const n=u();n.items=[...e.items,...n.items],n.items.length>1e3&&(n.items=n.items.slice(-1e3)),i.set(n)}function T(e){const n=u();n.items.push(e),n.items.length>1e3&&(n.items=n.items.slice(-1e3)),i.set(n)}async function g(e){T(e),await E()}return{enqueue:T,send:g,flush:E,setKioskId:S}}
|
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
type TrackEventType = 'load' | 'exview' | 'search' | 'route' | 'share' | 'booview' | 'catview' | 'ws_exhibitor_click';
|
|
2
|
-
|
|
1
|
+
type TrackEventType = 'load' | 'exview' | 'search' | 'route' | 'share' | 'booview' | 'catview' | 'ws_exhibitor_click' | 'sesview' | 'bookmark' | 'spkview' | 'sbtnview';
|
|
2
|
+
/** Which kind of entity a `bookmark` event refers to. */
|
|
3
|
+
export type TrackEventBookmarkSubtype = 'booth' | 'exhibitor' | 'session' | 'speaker';
|
|
4
|
+
/**
|
|
5
|
+
* Which button surface an `sbtnview` came from. The main row above the plan
|
|
6
|
+
* sends none, so its series is unchanged; the surfaces added later are
|
|
7
|
+
* distinguishable instead of being silently mixed into the same counter.
|
|
8
|
+
*/
|
|
9
|
+
export type TrackEventButtonSubtype = 'subbutton' | 'shortcut';
|
|
10
|
+
export type TrackEventSubtype = TrackEventBookmarkSubtype | TrackEventButtonSubtype;
|
|
11
|
+
export default function trackEvent(type: TrackEventType, value?: any, subtype?: TrackEventSubtype): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* Drops the module-scope telemetry state — the client (with its cached expo,
|
|
14
|
+
* expoId and kioskId) and the one-shot migration flag. `unstable_destroy()`
|
|
15
|
+
* tears down the DOM and the stores, but ES module state outlives it, so
|
|
16
|
+
* without this a host that destroys the plan and loads a different one keeps
|
|
17
|
+
* reporting under the first plan's event.
|
|
18
|
+
*
|
|
19
|
+
* Anything the client still had queued is drained first: it belongs to the
|
|
20
|
+
* plan being torn down. That drain is best-effort — `flush()` is async and
|
|
21
|
+
* can return early — so it is not what stops the batch being credited to the
|
|
22
|
+
* next plan; the per-expo storage key is. A batch restored after a failed
|
|
23
|
+
* POST keeps its own expo's key and waits for the next client for that expo,
|
|
24
|
+
* instead of being adopted and relabelled by a different one.
|
|
25
|
+
*/
|
|
26
|
+
export declare function resetTelemetry(): void;
|
|
3
27
|
export {};
|
|
4
28
|
//# sourceMappingURL=track-event.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createKiosk as
|
|
1
|
+
import{getConfig as g}from"@expofp/config";import{createKiosk as v}from"../components/Kiosk/kioskApi";import{getSavedKiosk as S}from"../components/Kiosk/SetKiosk";import{KIOSK_STATS_ID_STORAGE_KEY as s}from"../components/Kiosk/SetKiosk/constants";import{getLocationHistory as h}from"../services/url-sync";import{uiState as E}from"../store";import l from"./logger";import{createTelemetry as w}from"./telemetry";let i,u;function p(){try{return g()}catch{return}}function y(){const o=window.__efpEvent;if(i&&u===o)return i;i?.flush();let e;try{const t=new URL(p()?.trackerUrl??"").searchParams.get("expoId");e=t?Number(t):void 0}catch(t){l.error(t)}return i=w({url:"https://app.expofp.com/api/telemetry",expo:o,expoId:e}),u=o,i}function I(o,e,t){const n=h(),r=n[n.length-2];return{type:o,subtype:t,value:e==null?"":String(e),timestamp:new Date().toISOString(),url:window.location.href,referrer:r?window.location.origin+r:""}}function d(){return!!window.__efpEvent&&!!p()?.trackerUrl&&process.env.NODE_ENV==="production"&&!E.heatmap}export default async function _(o,e,t){if(l.log("trackEvent",o,e,t),!!d())try{const n=I(o,e,t),r=S();let f=null;if(r?f=await k(r):localStorage.removeItem(s),!d())return;const a=y();if(r&&!f){a.enqueue(n);return}a.setKioskId(f??""),T(a),await a.send(n)}catch(n){l.error("trackEvent",String(n))}}let c;async function k(o){if(!o)return null;const e=localStorage.getItem(s);if(e)return e;if(!c){const t=window.__efpEvent;c=v(o,"https://app.expofp.com/").then(n=>!n||window.__efpEvent!==t?null:(localStorage.setItem(s,n),n)).finally(()=>{c=void 0})}return c}let m=!1;export function resetTelemetry(){i?.flush(),i=void 0,u=void 0,m=!1}function T(o){if(m)return;m=!0;const e="efp-track-events";try{const t=localStorage.getItem(e);if(!t)return;const n=JSON.parse(t);if(!Array.isArray(n)){localStorage.removeItem(e);return}for(const r of n)!r||typeof r!="object"||!r.headers||o.enqueue({type:r.type,value:r.value==null?"":String(r.value),timestamp:r.timeStamp,url:r.headers["X-href"],referrer:r.headers["X-ref"]??""});localStorage.removeItem(e)}catch(t){localStorage.removeItem(e),l.error("Failed to migrate old events.",String(t))}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type SceneDef } from '@expofp/renderer';
|
|
2
2
|
export declare const DIM_INTENSITY = 0.5;
|
|
3
3
|
export declare const VENUE_DIM_INTENSITY = 1;
|
|
4
4
|
export declare const DIM_TRANSITION_MS = 300;
|
|
@@ -11,6 +11,17 @@ export interface DimmingAnimator {
|
|
|
11
11
|
}): void;
|
|
12
12
|
stop(): void;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Writes a venue-wide dim onto a scene's root layer, from which it descends to every layer and def
|
|
16
|
+
* that does not set a `dim` of its own.
|
|
17
|
+
*
|
|
18
|
+
* Only the write — the caller commits it through `update`, which is what lets an eased dim call
|
|
19
|
+
* this on every frame: the "unchanged means no update" guard is what keeps a settled transition
|
|
20
|
+
* free.
|
|
21
|
+
* @param scene - The scene to dim, or a falsy value before one exists.
|
|
22
|
+
* @param value - The dim intensity, `0` to `1`.
|
|
23
|
+
* @returns Whether the root layer changed and so needs an update.
|
|
24
|
+
*/
|
|
25
|
+
export declare function applyVenueDim(scene: SceneDef | null | undefined, value: number): boolean;
|
|
15
26
|
export declare function createDimmingAnimator(applyValue: (value: number) => void, durationMs?: number, easing?: DimmingEasing): DimmingAnimator;
|
|
16
27
|
//# sourceMappingURL=dimming.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const DIM_INTENSITY=.5,VENUE_DIM_INTENSITY=1,DIM_TRANSITION_MS=300,DEFAULT_DIM_EASING="cubic";export function
|
|
1
|
+
export const DIM_INTENSITY=.5,VENUE_DIM_INTENSITY=1,DIM_TRANSITION_MS=300,DEFAULT_DIM_EASING="cubic";export function applyVenueDim(e,r){return!e||e.rootLayer.dim===r?!1:(e.rootLayer.dim=r,!0)}export function createDimmingAnimator(e,r=300,I=DEFAULT_DIM_EASING){let n=null,t=0,m=0,a=0,s=0;const l=Math.max(r,0);function c(){n===null||typeof cancelAnimationFrame!="function"||(cancelAnimationFrame(n),n=null)}function p(i){c(),t=i,e(t)}function f(i){const u=i-s,o=Math.min(u/l,1),T=A(o,I);if(t=m+(a-m)*T,e(t),o<1){n=requestAnimationFrame(f);return}n=null,t=a,e(t)}return{getValue(){return t},setTarget(i,u={}){const o=i?1:0;if(!(!u.immediate&&o===a&&n===null)){if(a=o,u.immediate||l===0||typeof requestAnimationFrame!="function"){p(a);return}c(),m=t,s=typeof performance>"u"?Date.now():performance.now(),n=requestAnimationFrame(f)}},stop(){c()}}}function A(e,r){return r==="linear"?e:M(e)}function M(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}
|
package/dist/esm/utils/mobx.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IAutorunOptions, IReactionOptions, IReactionPublic } from 'mobx';
|
|
2
|
-
import { EffectCallback } from 'react';
|
|
2
|
+
import { DependencyList, EffectCallback } from 'react';
|
|
3
3
|
export declare function useAutorun(view: (r: IReactionPublic) => any, opts?: IAutorunOptions): void;
|
|
4
|
-
export declare function useReaction<T>(expression: (r: IReactionPublic) => T, effect: (arg: T, r: IReactionPublic) => void, opts?: IReactionOptions): void;
|
|
4
|
+
export declare function useReaction<T>(expression: (r: IReactionPublic) => T, effect: (arg: T, r: IReactionPublic) => void, opts?: IReactionOptions, deps?: DependencyList): void;
|
|
5
5
|
export declare function useInit(effect: EffectCallback): void;
|
|
6
6
|
//# sourceMappingURL=mobx.d.ts.map
|
package/dist/esm/utils/mobx.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{autorun as
|
|
1
|
+
import{autorun as e,reaction as i}from"mobx";import{useEffect as n}from"react";export function useAutorun(t,r){return n(()=>e(t,r),[])}export function useReaction(t,r,o,u=[]){return n(()=>i(t,r,o),u)}export function useInit(t){return n(t,[])}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Box } from '@expofp/geometry';
|
|
2
|
-
import type
|
|
2
|
+
import { type SceneDef } from '@expofp/renderer';
|
|
3
3
|
/**
|
|
4
4
|
* Bounding box (in local SVG units) of all drawn scene content, excluding the
|
|
5
5
|
* background "areamap" layer. This is the real venue extent and the rect that
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Box as x}from"@expofp/geometry";const
|
|
1
|
+
import{Box as f,isBox as x}from"@expofp/geometry";import{isLayerDef as p,isLineDef as m,isShapeDef as y}from"@expofp/renderer";const g="areamap";export function getSceneVenueRect(r){const n=r?.rootLayer?.children;if(!n?.length)return null;let i=1/0,o=1/0,a=-1/0,c=-1/0;const u=(e,t)=>{!Number.isFinite(e)||!Number.isFinite(t)||(e<i&&(i=e),t<o&&(o=t),e>a&&(a=e),t>c&&(c=t))},s=e=>{u(e.min.x,e.min.y),u(e.max.x,e.max.y)},l=e=>{if(p(e)){e.children.forEach(l);return}if(y(e)){s(x(e.shape)?e.shape:e.shape.bounds);return}if(m(e)){u(e.points.p0.x,e.points.p0.y),u(e.points.p1.x,e.points.p1.y);return}s(e.bounds.bounds)};for(const e of n){const t=e.name;typeof t=="string"&&t.toLowerCase()===g||l(e)}return i>a||o>c?null:f.fromMinMax({x:i,y:o},{x:a,y:c})}export function getVenueFitMarginPercent(r,n){return!r||!n||n.area<=0||r.area/n.area>.1?.15:.25}export function expandRectByPercent(r,n){return n?r.expand({x:r.size.width*n,y:r.size.height*n}):r}export function getVenueFitRect(r,n){const i=getSceneVenueRect(r);return i?expandRectByPercent(i,getVenueFitMarginPercent(i,n)):null}export function fitRectIsFraming(r){return r==="layer-viewbox"||r==="explicit-viewbox"||r==="scene-derived"}export function resolveVenueFitRect(r){if(r.layerViewbox)return{rect:r.layerViewbox,source:"layer-viewbox"};if(r.explicitArea)return{rect:r.explicitArea,source:"explicit-viewbox"};if(r.layerRectangle)return{rect:r.layerRectangle,source:"layer-rectangle"};const n=getVenueFitRect(r.sceneDef,r.svgArea);return n?{rect:n,source:"scene-derived"}:{rect:r.svgArea,source:"svg-area"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createArrowCurrentCanvas as w,createCurrentCanvas as u,createImageCanvas as I,createTargetCanvas as O}from"../../components/Map/drawing/config/canvases";import{createCircleCanvas as v}from"../../
|
|
1
|
+
import{createArrowCurrentCanvas as w,createCurrentCanvas as u,createImageCanvas as I,createTargetCanvas as O}from"../../components/Map/drawing/config/canvases";import{createCircleCanvas as v}from"../../engine/canvases";const A="#00A2FF",F="#FF9F06",n=34,l=56;function a(i,e,t,s,C,r){const c=i.get(e);return c?(c.id=e,I(c,t,s,C)):r()}function o(i){return{canvas:i,width:i.width,height:i.height}}export function createCanvasIconProvider(i){const{iconMap:e,pixelRatio:t}=i,s=i.sourceColor??A,C=i.destinationColor??F,r=new Map;r.set("destination",o(a(e,"destination",n,n,t,()=>O(t,C)))),r.set("source",o(a(e,"departure",n,n,t,()=>u(t,s)))),r.set("source_inactive",o(a(e,"departure_inactive",n,n,t,()=>u(t,s))));const c=u(t,s);c.id="current-location",r.set("current",o(c));const d=a(e,"transition",n,n,t,()=>u(t,s));return r.set("transition",o(d)),r.set("transition_up",o(a(e,"transition_up",l,n,t,()=>d))),r.set("transition_down",o(a(e,"transition_down",l,n,t,()=>d))),r.set("transition_entry",o(a(e,"departure",n,n,t,()=>u(t,s)))),r.set("current_arrow",o(a(e,"direction",n,n,t,()=>w(t,s)))),r.set("trail",o(v(4,"#b5b7bc"))),{getIcon(_){const p=r.get(_);if(!p)throw new Error(`Unknown icon: ${_}`);return p}}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { type SceneDef } from '@expofp/renderer';
|
|
1
2
|
import { type Route, type RouteEndpoint } from '@expofp/wayfinding';
|
|
2
|
-
import { type RendererService } from '../renderer';
|
|
3
3
|
import type RootStore from '../store/RootStore';
|
|
4
4
|
/** Whether `createWayfinding` has run and not yet been disposed. */
|
|
5
5
|
export declare function isWayfindingReady(): boolean;
|
|
@@ -13,5 +13,22 @@ export declare function isWayfindingReady(): boolean;
|
|
|
13
13
|
export declare function buildRoute(from: RouteEndpoint, to: RouteEndpoint, options?: {
|
|
14
14
|
accessible?: boolean;
|
|
15
15
|
}): Route;
|
|
16
|
-
|
|
16
|
+
/** What {@link createWayfinding} needs: a scene to draw into, and the stores to observe. */
|
|
17
|
+
export interface WayfindingOptions {
|
|
18
|
+
/** The scene wayfinding fills; its root layers hold the `wf-*` layers. */
|
|
19
|
+
readonly scene: SceneDef;
|
|
20
|
+
/** The app store. */
|
|
21
|
+
readonly store: RootStore;
|
|
22
|
+
/** A ref holding canvas that's rendering floorplan */
|
|
23
|
+
readonly canvas: {
|
|
24
|
+
readonly current: HTMLCanvasElement | null;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Starts wayfinding on a `@expofp/renderer` scene: builds the engine and runtime, binds them to
|
|
29
|
+
* the stores, and declares the layout and pointer rules the renderer dispatches.
|
|
30
|
+
* @param options - The scene and the store.
|
|
31
|
+
* @returns A disposer.
|
|
32
|
+
*/
|
|
33
|
+
export declare function createWayfinding(options: WayfindingOptions): () => void;
|
|
17
34
|
//# sourceMappingURL=createWayfinding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createWayfinding as
|
|
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":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expofp/floorplan",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.27.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/expofp/efp-app.git",
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"!dist/stats.json"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@expofp/renderer": "^3.2.4",
|
|
39
38
|
"@sentry/core": "^10.69.0",
|
|
40
39
|
"@sentry/react": "^10.69.0",
|
|
41
40
|
"bowser": "^2.14.1",
|
|
@@ -70,14 +69,15 @@
|
|
|
70
69
|
"tslib": "^2.3.0",
|
|
71
70
|
"uuid": "^9.0.1",
|
|
72
71
|
"zod": "4.4.3",
|
|
73
|
-
"@expofp/config": "3.
|
|
74
|
-
"@expofp/debug": "3.
|
|
75
|
-
"@expofp/geometry": "3.
|
|
76
|
-
"@expofp/
|
|
77
|
-
"@expofp/
|
|
78
|
-
"@expofp/
|
|
79
|
-
"@expofp/
|
|
80
|
-
"@expofp/
|
|
72
|
+
"@expofp/config": "3.27.0",
|
|
73
|
+
"@expofp/debug": "3.27.0",
|
|
74
|
+
"@expofp/geometry": "3.27.0",
|
|
75
|
+
"@expofp/renderer": "3.27.0",
|
|
76
|
+
"@expofp/resolve": "3.27.0",
|
|
77
|
+
"@expofp/schema": "3.27.0",
|
|
78
|
+
"@expofp/ui": "3.27.0",
|
|
79
|
+
"@expofp/utils": "3.27.0",
|
|
80
|
+
"@expofp/wayfinding": "3.27.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@babel/plugin-proposal-decorators": "^8.0.2",
|
|
@@ -91,6 +91,7 @@
|
|
|
91
91
|
"@types/react": "^19.2.17",
|
|
92
92
|
"@types/react-dom": "^19.2.3",
|
|
93
93
|
"@vitejs/plugin-react": "^6.0.4",
|
|
94
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
94
95
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
95
96
|
"react": "^19.2.8",
|
|
96
97
|
"react-dom": "^19.2.8",
|