@expofp/floorplan 3.44.3 → 3.44.5
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-CNVBhsa-.js → Button-KOcUyCV4.js} +5 -5
- package/dist/browser/{CookieConsent-Dxv1Wsat.js → CookieConsent-Dxa0id06.js} +7 -7
- package/dist/browser/{Debug-CFKoef7p.js → Debug-QyhDw-Qr.js} +7 -7
- package/dist/browser/{DebugTools-B8V3wXuK.js → DebugTools-D2W2n6Jn.js} +6 -6
- package/dist/browser/{Demo-DM0A_1km.js → Demo-B13KXifC.js} +9 -9
- package/dist/browser/{Free-CzO-mFfd.js → Free-CX_vMtxZ.js} +10 -10
- package/dist/browser/{GalleryContainer-CbEnMCVB.js → GalleryContainer-CM3-49P7.js} +11 -11
- package/dist/browser/{GpsLoader-CVbPQRMb.js → GpsLoader-4PVGhL1U.js} +14 -14
- package/dist/browser/{KioskStore-CwqXi5BX.js → KioskStore-DTQoQI0q.js} +30 -30
- package/dist/browser/{LayerStore-Zb7qIu0z.js → LayerStore-CazBur3e.js} +3164 -3107
- package/dist/browser/{MaplibreAdapter-CpqKTkaf.js → MaplibreAdapter-Zingiqz4.js} +2578 -2436
- package/dist/browser/{ModalContainer-DXJrM1Bp.js → ModalContainer-CdFZHz2f.js} +10 -10
- package/dist/browser/{PermissionNotice-DDKii54V.js → PermissionNotice-t6cUGYwh.js} +6 -6
- package/dist/browser/{RouteStore-hvwT2i2u.js → RouteStore-j54ZGAfi.js} +143 -143
- package/dist/browser/{SetKioskMode-BwmKtUXS.js → SetKioskMode-B6wYtN7b.js} +12 -12
- package/dist/browser/{ShowKiosk-BRG5YHbS.js → ShowKiosk-B5wMyYJL.js} +29 -30
- package/dist/browser/{UIState-CE6LgRm0.js → UIState-DDYKhzgf.js} +233 -222
- package/dist/browser/{ViewerMenuPanel-mc608c2h.js → ViewerMenuPanel-BCVS4-Y6.js} +11 -11
- package/dist/browser/{add-debug-secret-listener-BK7p-z9L.js → add-debug-secret-listener-Dhq4xAyx.js} +1 -1
- package/dist/browser/{adopt-global-settings-CRMYLGuM.js → adopt-global-settings-DIBm6FQS.js} +9 -9
- package/dist/browser/{boolean-editor-C-3p4K-F.js → boolean-editor-Y-xsiI--.js} +9 -9
- package/dist/browser/{bootIntercom-Db2ZY2IP.js → bootIntercom-Cioan8sb.js} +2 -2
- package/dist/browser/bundle.json +85 -85
- package/dist/browser/{camera-events-R9lBN0gH.js → camera-events-BOdD_NLx.js} +1 -1
- package/dist/browser/{classnames-BbFWiHL5.js → classnames-CK71vh8q.js} +2 -2
- package/dist/browser/{client-BEMnZXAF.js → client-CJPzVCkl.js} +5 -5
- package/dist/browser/{components-DliPPf5t.js → components-F21BHxXy.js} +152 -152
- package/dist/browser/{create-live-plan-DAzphLxx.js → create-live-plan-nrSyFkZI.js} +77 -77
- package/dist/browser/{debug-context-CvwXOlAn.js → debug-context-DwpqAozh.js} +5 -5
- package/dist/browser/{debug-overlay-C4EOfo6K.js → debug-overlay-B6KaSOEU.js} +10 -10
- package/dist/browser/{debug-ui-C4ij0VwK.js → debug-ui-Bf8fXQOS.js} +6 -6
- package/dist/browser/{dimming-DDbaTusx.js → dimming-BHvWqTG-.js} +287 -287
- package/dist/browser/{dist-Bec_HPvI.js → dist-39qZTE_8.js} +5 -5
- package/dist/browser/{dist-YzxDC-l3.js → dist-C4gjCWf-.js} +6 -6
- package/dist/browser/{dist-7WIWetl1.js → dist-e4oHl02a.js} +3 -3
- package/dist/browser/{efp-debug-init-DcPbyNJ4.js → efp-debug-init-CgA5CA8v.js} +3 -3
- package/dist/browser/{enum-editor-D7bIWtJ_.js → enum-editor-Clbji3s0.js} +4 -4
- package/dist/browser/{es5-BrgEa0Fa.js → es5-DS8lovDx.js} +2 -2
- package/dist/browser/{event-head-z1FHiOEx.js → event-head-CvwSi2rY.js} +1 -1
- package/dist/browser/{event-not-found-CmEMYoWH.js → event-not-found-CCc_S9hI.js} +3 -3
- package/dist/browser/{event-scoped-cache-BYrRCtdG.js → event-scoped-cache-kTMeUrly.js} +2 -2
- package/dist/browser/{expofpUrl-CEUejCEN.js → expofpUrl-CHp0e8cE.js} +1 -1
- package/dist/browser/{exports-DKQt5QYX.js → exports-J1MI3kf7.js} +1 -1
- package/dist/browser/{favicon-hXbIh_yH.js → favicon-CcNmTUw4.js} +1 -1
- package/dist/browser/{fetch-retry.umd-CLXaW0xF.js → fetch-retry.umd-BgUlFCap.js} +2 -2
- package/dist/browser/{flex-KPw9gVGD.js → flex-vWrExjXE.js} +5 -5
- package/dist/browser/{floorplan.loader-D93gRJBq.js → floorplan.loader-CUEvFUdv.js} +12 -12
- package/dist/browser/{floorplan.ready-BNLEOdiv.js → floorplan.ready-ko8a3n9B.js} +43 -43
- package/dist/browser/{freeBanner-oymjDdPI.js → freeBanner-DpKvZQN1.js} +2 -2
- package/dist/browser/{fuse-BFSl1xAm.js → fuse-Bfm1APV7.js} +2 -2
- package/dist/browser/{i18n-rk8cQWa3.js → i18n-DDJS5YMr.js} +6 -6
- package/dist/browser/index.js +17 -17
- package/dist/browser/{index.module-CSdtATMD.js → index.module-DsUsijj6.js} +4 -4
- package/dist/browser/{init-ui-lJmr6-g1.js → init-ui-Bm0UPhlY.js} +16 -16
- package/dist/browser/{integrateKiosk-CRw9kkw3.js → integrateKiosk-B3aJf8F4.js} +11 -11
- package/dist/browser/{is-debug-BmKkiaOm.js → is-debug-De3PeMDZ.js} +4 -4
- package/dist/browser/{is-own-domain-WyB1g8Cb.js → is-own-domain-B9xN9-Lx.js} +1 -1
- package/dist/browser/{is-webview-zrRx507t.js → is-webview-yWWEgPgd.js} +1 -1
- package/dist/browser/{jsx-runtime-D9gYD2sV.js → jsx-runtime-DjD5sUU-.js} +2 -2
- package/dist/browser/kiosk-mode-CDwaDIbF.js +28 -0
- package/dist/browser/{kiosk-record-B3e1fovJ.js → kiosk-record-DMkGRlUE.js} +1 -1
- package/dist/browser/{kioskApi-D_uzTtqk.js → kioskApi-CQSBvl3I.js} +7 -7
- package/dist/browser/{lib-B3FA8Hoq.js → lib-CJ3OJE3_.js} +3 -3
- package/dist/browser/{loadImage-BBg66Nnb.js → loadImage-D8uFT5Sk.js} +1 -1
- package/dist/browser/{logDeviceInfo-WQQRX_vW.js → logDeviceInfo-CmWBec7t.js} +9 -9
- package/dist/browser/{mobx-BvloKnDW.js → mobx-BdBndn_p.js} +4 -4
- package/dist/browser/{mobx.module-CjTRKVWn.js → mobx.module-C3w0PP29.js} +1 -1
- package/dist/browser/{optional-boolean-editor-CBiiGQUP.js → optional-boolean-editor-Blvo9Yix.js} +3 -3
- package/dist/browser/{optional-enum-editor-BItRyjei.js → optional-enum-editor-DU7T8uz0.js} +4 -4
- package/dist/browser/{optional-string-editor-B7jzDfQN.js → optional-string-editor-xZMbxEZE.js} +4 -4
- package/dist/browser/{particles.min-A7cunk1O.js → particles.min-D_8wZYXL.js} +2 -2
- package/dist/browser/{react-DJbZe8VG.js → react-CV8wM7_O.js} +2 -2
- package/dist/browser/{react-dom-CF-AXfUm.js → react-dom-CecEt-x3.js} +3 -3
- package/dist/browser/{rolldown-runtime-BiG6A0mX.js → rolldown-runtime-BGNEtxPt.js} +1 -1
- package/dist/browser/{scene-CXn1c6mI.js → scene-1Y2hzeYv.js} +12 -12
- package/dist/browser/{scheduler-Dafdeh3M.js → scheduler-Di2biGM1.js} +2 -2
- package/dist/browser/{select-BxjiQiLf.js → select-CJlj5fYs.js} +10 -10
- package/dist/browser/{settings-BOBQS9z-.js → settings-1yX1j826.js} +2 -2
- package/dist/browser/{settings-item-DUoTvDE-.js → settings-item-B8pw2_WH.js} +6 -6
- package/dist/browser/{store-D-LRnUif.js → store-DknI2Sdy.js} +2 -2
- package/dist/browser/{string-editor-DiDkcybB.js → string-editor-S6hL0jAM.js} +4 -4
- package/dist/browser/{text-field-CIc92NZ5.js → text-field-CgCCjJwX.js} +5 -5
- package/dist/browser/{theme-0Xo52fpM.js → theme-2daWarWB.js} +8 -8
- package/dist/browser/{ui-D9VGB23k.js → ui-CPg_zcyB.js} +8 -8
- package/dist/browser/{useRenderTarget-DZ5XMBlN.js → useRenderTarget-CTvYMgqG.js} +4 -4
- package/dist/browser/{viewport-DBg-6DYR.js → viewport-B_GD-x9K.js} +3 -3
- package/dist/browser/{wayfinding-B87Zv5e1.js → wayfinding-B4_JvPpk.js} +411 -411
- package/dist/esm/components/Kiosk/KioskStore.js +1 -1
- package/dist/esm/components/Kiosk/ShowKiosk.js +1 -1
- package/dist/esm/components/Kiosk/integrateKiosk.js +1 -1
- package/dist/esm/components/Kiosk/kiosk-mode.d.ts +4 -28
- package/dist/esm/components/Kiosk/kiosk-mode.js +1 -1
- package/dist/esm/components/Map/drawing/config/canvases.d.ts +0 -9
- package/dist/esm/components/Map/drawing/config/canvases.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-outdoor-poi.js +1 -1
- package/dist/esm/components/Map/drawing/config/poi-pin-shape.d.ts +100 -0
- package/dist/esm/components/Map/drawing/config/poi-pin-shape.js +1 -0
- package/dist/esm/components/Map/drawing/config/poi-pin.d.ts +10 -0
- package/dist/esm/components/Map/drawing/config/poi-pin.js +1 -0
- package/dist/esm/components/Maplibre/MaplibreWrapper.d.ts +5 -0
- package/dist/esm/components/Maplibre/MaplibreWrapper.js +1 -1
- package/dist/esm/components/Maplibre/usePoiMarkers.js +1 -1
- package/dist/esm/components/Maplibre/utils/basemap-palette.d.ts +19 -0
- package/dist/esm/components/Maplibre/utils/basemap-palette.js +1 -0
- package/dist/esm/components/Maplibre/utils/map-helpers.js +1 -1
- package/dist/esm/components/Maplibre/utils/resolve-map-style.d.ts +5 -1
- package/dist/esm/components/Maplibre/utils/resolve-map-style.js +1 -1
- package/dist/esm/constants.d.ts +2 -2
- package/dist/esm/constants.js +1 -1
- package/dist/esm/store/UIState.d.ts +21 -10
- package/dist/esm/store/UIState.js +1 -1
- package/dist/esm/store/init/init-ui.js +1 -1
- package/dist/esm/utils/is-phone.d.ts +9 -0
- package/dist/esm/utils/is-phone.js +1 -0
- package/package.json +10 -10
- package/dist/browser/kiosk-mode-BpbUrRKq.js +0 -33
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as i}from"tslib";import{getConfig as C}from"@expofp/config";import{action as n,computed as
|
|
1
|
+
import{__decorate as i}from"tslib";import{getConfig as C}from"@expofp/config";import{action as n,computed as k,observable as d,toJS as m,when as y}from"mobx";import{KIOSK_ENABLE_KEY as p}from"../../constants";import a from"../../store";import{areLayersEnabled as K}from"../../utils/areLayersEnabled";import{t as h}from"../../utils/i18n";import{isLocalStorageAvailable as S}from"../../utils/localStorage";import{mapCamera as f}from"../Map/camera";import{mapViewport as M}from"../Map/viewport";import{storedKioskMode as v}from"./kiosk-mode";import{getPtScaleZoomRatio as P,toFiniteNumber as u}from"./kiosk-record";import{updateKiosk as b}from"./kioskApi";import{getSavedKiosk as w,removeKiosk as F,saveKiosk as R}from"./SetKiosk";import{KIOSK_STORAGE_KEY as D}from"./SetKiosk/constants";const I=2e4;class s{constructor(){this.savedKiosk=null,this.statusMessages=[],this.statusMessageTimer=0,this.isResettingCamera=!1,this.isRestoringFraming=!1}get kiosk(){return a.uiState.kioskData}setKiosk(e){a.uiState.setKioskData(e)}getCameraState(){if(a.maplibreStore.showMaplibre){const t=a.maplibreStore.cameraPort?.getCameraState();return t?{mapCenterLng:t.lng,mapCenterLat:t.lat,mapZoom:t.zoom,mapBearingDegrees:t.bearing,mapPitchDegrees:t.pitch}:{}}const e=f()?.state();return e?{mapInitialPtScale:this.initialPtScale,mapPtScale:e.pixelSize,mapCenterX:e.center.x,mapCenterY:e.center.y,mapRollDegrees:e.roll,mapPitch:e.pitch}:{}}get hasUnsavedChanges(){const e=this.savedKiosk,t=m(this.kiosk);if(!t||!e)return!!t!=!!e;const o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return!0;for(const l of o)if(!(l in t)||e[l]!==t[l])return!0;return!1}addStatusMessage(e){this.statusMessages=[{...e,id:Date.now()}],this.startCleanupMessages()}clearStatusMessages(){this.statusMessages=[]}startCleanupMessages(){clearTimeout(this.statusMessageTimer),this.statusMessageTimer=window.setTimeout(()=>this.clearStatusMessages(),1e3)}async resetCamera(){if(!this.isResettingCamera){this.isResettingCamera=!0;try{if(a.maplibreStore.showMaplibre&&await this.resetMaplibreCamera()){this.isRestoringFraming=!0;return}this.isRestoringFraming=await this.resetPlanCamera()}finally{this.isResettingCamera=!1}}}async resetMaplibreCamera(){const e=await this.waitForMaplibreCameraPort();if(!e)return!1;const t=this.kiosk;t?.z!=null&&a.fp.activateFloor({name:String(t.z)});const o=u(t?.mapCenterLng),r=u(t?.mapCenterLat),l=u(t?.mapZoom);return o===void 0||r===void 0||l===void 0?(e.resetPitch(),a.uiState.fitBounds(),!0):(e.applyCameraState({lng:o,lat:r,zoom:l,bearing:u(t?.mapBearingDegrees),pitch:u(t?.mapPitchDegrees)}),!0)}async waitForMaplibreCameraPort(){const{maplibreStore:e}=a;if(e.cameraPort)return e.cameraPort;try{await y(()=>!!e.cameraPort||!e.showMaplibre,{timeout:I})}catch{return null}return e.cameraPort}async resetPlanCamera(){const e=f();if(!e)return!1;const t=this.kiosk;await e.api.reset({pan:!0,zoom:!0,roll:!0,pitch:!0},{immediate:!0}),t?.z!=null&&a.fp.activateFloor({name:String(t.z)});const o=P(t);o!==void 0&&await e.api.zoomBy(o,{immediate:!0});const r=u(t?.mapCenterX),l=u(t?.mapCenterY);r!==void 0&&l!==void 0&&await e.api.panTo({x:r,y:l},{immediate:!0});const c=u(t?.mapRollDegrees);c!==void 0&&await e.api.rollTo(c,{immediate:!0});const g=u(t?.mapPitch);return g!==void 0&&await e.api.pitchTo(g,{immediate:!0}),!0}restoreData(){const e=w();this.savedKiosk=e??null,e&&(this.setKiosk(e),a.uiState.kiosk=!0)}handleSetupReady(){this.restoreData(),a.uiState.kiosk=!0,a.uiState.hideFreeOrDemo=!0,a.uiState.setForceDim(!0),a.searchStore.setSearchText(""),a.searchStore.setFocused(!1),this.resetCamera()}handleClose(){v(C())||(a.uiState.kiosk=!1),a.uiState.restoreUIScale(),this.setKiosk(null),a.uiState.setForceDim(!1),a.uiState.enableSetKioskMode(!1),a.searchStore.closeSearch()}handleDelete(){S&&localStorage.getItem(D)!==null&&localStorage.getItem(p)==="1"&&localStorage.removeItem(p),F(),this.savedKiosk=null,this.setKiosk(null),a.uiState.resetMapSettings(),a.uiState.resetUIScale(),this.addStatusMessage({variant:"success",title:h("Deleted")})}handleSave(){const e=M();if(!e)return;const t=m(this.kiosk);if(!t)return;const o=this.getCameraState(),r={...t,...o};if(!e.isVisible({x:r.x,y:r.y})){this.addStatusMessage({variant:"error",title:h("Kiosk not visible")});return}this.setKiosk(r),R(r),S&&localStorage.setItem(p,"1"),b(r,"https://app.expofp.com/"),a.uiState.setKioskUIScale(r.uiScale,!0),this.addStatusMessage({variant:"success",title:h("Saved")}),this.savedKiosk=r}delayChange(e){requestAnimationFrame(()=>e?.())}handleChange(e){const t=m(this.kiosk);t&&(Number.isFinite(e.angle)&&this.setKiosk({...t,heading:e.angle}),Number.isFinite(e.scale)&&(this.setKiosk({...t,uiScale:e.scale}),this.delayChange(()=>a.uiState.setKioskUIScale(e.scale,!1))),Number.isFinite(e.percent)&&this.setKiosk({...t,iconSizePercent:e.percent}))}setInitialPtScale(e){if(this.initialPtScale)return;this.initialPtScale=e;const t=m(this.kiosk);t&&this.setKiosk({...t,mapInitialPtScale:e})}handleClick(e){const t=m(this.kiosk),o=a.fp.getFloors(),r=K()?o.find(c=>c.active)?.name??null:null,l=a.uiState.uiScale;this.setKiosk({...t,x:e.x,y:e.y,z:r,uiScale:t?.uiScale||l,heading:t?.heading||0,iconSizePercent:t?.iconSizePercent||100,...this.getCameraState()})}handleNavigationChange(){const e=this.isRestoringFraming;this.isRestoringFraming=!1;const t=m(this.kiosk);if(!t)return;const o=this.getCameraState();this.setKiosk({...t,...o}),e&&this.savedKiosk&&(this.savedKiosk={...this.savedKiosk,...o})}}i([k({keepAlive:!0})],s.prototype,"kiosk",null),i([n],s.prototype,"setKiosk",null),i([d],s.prototype,"savedKiosk",void 0),i([k({keepAlive:!0})],s.prototype,"hasUnsavedChanges",null),i([d],s.prototype,"statusMessages",void 0),i([n],s.prototype,"addStatusMessage",null),i([n],s.prototype,"clearStatusMessages",null),i([n],s.prototype,"startCleanupMessages",null),i([n],s.prototype,"resetCamera",null),i([n],s.prototype,"restoreData",null),i([n],s.prototype,"handleSetupReady",null),i([n],s.prototype,"handleClose",null),i([n],s.prototype,"handleDelete",null),i([n],s.prototype,"handleSave",null),i([n],s.prototype,"handleChange",null),i([n],s.prototype,"setInitialPtScale",null),i([n],s.prototype,"handleClick",null),i([n],s.prototype,"handleNavigationChange",null);export default new s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{getConfig as s}from"@expofp/config";import{TouchHand as a}from"@expofp/ui";import{observer as m}from"mobx-react-lite";import{KIOSK_ENABLE_KEY as n}from"../../constants";import t from"../../store";import{useInit as f}from"../../utils/mobx";import{integrateKioskIntoMap as k,integrateKioskIntoWf as u}from"./integrateKiosk";import i from"./KioskStore";const l=m(()=>(f(()=>{if(localStorage.getItem(n)==="0")return;i.restoreData();let e=i.savedKiosk;if(!e){const o=s().kiosk;Object.keys(o).length&&(e=o,Number.isFinite(o.uiScale)&&t.uiState.setKioskUIScale(o.uiScale,!1))}if(e&&(k(e,!0),u(e),t.uiState.kiosk&&(i.resetCamera(),t.setResetCameraFn(()=>i.resetCamera()))),!!i.kiosk)return()=>{t.uiState.setKioskData(null),t.uiState.resetMapSettings()}}),t.uiState.kiosk&&t.uiState.inIdle?r(a,{}):null));export default l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{runInAction as a}from"mobx";import
|
|
1
|
+
import{runInAction as a}from"mobx";import t from"../../store";import{planWhen as u}from"../../utils/plan-reactions.js";import{getPtScaleZoomRatio as m}from"./kiosk-record";export function integrateKioskIntoMap(e,n){e&&a(()=>{if(t.uiState.setKioskData(e),t.uiState.kiosk=n,t.maplibreStore.showMaplibre)return;const o=t.uiState.kiosk?e:{},i=o.mapCenterX!=null&&o.mapCenterY!=null;t.uiState.setMapSettings({centerxy:i?`${o.mapCenterX},${o.mapCenterY}`:"",z:e.z??void 0,bearing:o.mapRollDegrees});const r=m(o);r!==void 0&&t.uiState.changeZoom(r)})}export function integrateKioskIntoWf(e){e&&(e.z!=null&&t.fp.activateFloor({name:e.z.toString()}),u(()=>!!t.uiState.selectedRoute,()=>{const n=t.uiState.selectedRoute;n?.to&&!n.from&&t.routeStore.selectRoute(n,!1,!0)}))}
|
|
@@ -1,42 +1,16 @@
|
|
|
1
1
|
import { type Config } from '@expofp/config';
|
|
2
2
|
import type UIState from '../../store/UIState';
|
|
3
|
-
/**
|
|
4
|
-
* Whether this plan has room for the kiosk layout.
|
|
5
|
-
*
|
|
6
|
-
* Kiosk mode forces the left overlay, which is 450px wide — so it may only run
|
|
7
|
-
* where that layout would have been chosen anyway. `UIState.overlayPosition`
|
|
8
|
-
* asks this same question and calls this, which is what keeps the two answers
|
|
9
|
-
* from drifting apart.
|
|
10
|
-
*
|
|
11
|
-
* The guard exists because kiosk mode reaches devices that never asked for it.
|
|
12
|
-
* A route QR hands its `kiosk_x/y/z` anchor to every scanning phone, and
|
|
13
|
-
* `uiState.kioskData` doubles as "this device IS a kiosk" (see `kioskUrlParam`),
|
|
14
|
-
* so the phone adopts the whole kiosk boot: a left overlay wider than its screen,
|
|
15
|
-
* which collapses the map's framing region to a sliver and leaves any route it
|
|
16
|
-
* was opened for zoomed out to nothing.
|
|
17
|
-
*
|
|
18
|
-
* Measured off the width of the container the plan was handed, not the window —
|
|
19
|
-
* that is what `screenSize` holds (`bindRootElement`), and the overlay lives in
|
|
20
|
-
* the container. Width alone, as `overlayPosition` reads it: a phone held in
|
|
21
|
-
* landscape passes, being as wide as a small desktop window and getting the same
|
|
22
|
-
* layout, and every real kiosk panel passes in either orientation.
|
|
23
|
-
*/
|
|
24
|
-
export declare function screenFitsKiosk(uiState: UIState): boolean;
|
|
25
3
|
/**
|
|
26
4
|
* Toggle kiosk mode — the single meaning of `kiosk=1` / `kiosk=0` from either
|
|
27
5
|
* channel (the `?kiosk=` URL param, the typed search-box command) — and store
|
|
28
6
|
* that choice. Exit also resets the per-device UI scale.
|
|
29
|
-
*
|
|
30
|
-
* Turning it ON is refused where the kiosk layout does not fit
|
|
31
|
-
* ({@link screenFitsKiosk}); turning it OFF always works, so the `kiosk=0`
|
|
32
|
-
* opt-out can never be locked out by the size of the screen it is typed on.
|
|
33
7
|
*/
|
|
34
8
|
export declare function applyKioskMode(uiState: UIState, enabled: boolean): void;
|
|
35
9
|
/**
|
|
36
10
|
* Store-free kiosk check — the mode a load starts in: the `?kiosk=` param wins, then whatever the
|
|
37
11
|
* device itself says. Used by the Intercom boot, which runs before the MobX stores exist, so the
|
|
38
|
-
*
|
|
39
|
-
* with the kiosk config node (retirement plan §4.7).
|
|
12
|
+
* phone rule (`UIState.kiosk`) is not applied here. The direct `?kiosk` read is kiosk-semantic and
|
|
13
|
+
* migrates with the kiosk config node (retirement plan §4.7).
|
|
40
14
|
*/
|
|
41
15
|
export declare function isKioskMode(data: Config): boolean;
|
|
42
16
|
/**
|
|
@@ -47,4 +21,6 @@ export declare function isKioskMode(data: Config): boolean;
|
|
|
47
21
|
* param.
|
|
48
22
|
*/
|
|
49
23
|
export declare function storedKioskMode(data: Config): boolean;
|
|
24
|
+
/** Whether this device holds a kiosk saved by the setkiosk panel. */
|
|
25
|
+
export declare function hasSavedKiosk(): boolean;
|
|
50
26
|
//# sourceMappingURL=kiosk-mode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{KIOSK_ENABLE_KEY as e}from"../../constants";import{isLocalStorageAvailable as r}from"../../utils/localStorage";import{getSavedKiosk as i}from"./SetKiosk/storage";export function applyKioskMode(t,o){t.kiosk=o,o||t.resetUIScale(),r&&window.localStorage.setItem(e,o?"1":"0")}export function isKioskMode(t){const o=new URLSearchParams(window.location.search).get(e);return o==="1"||o==="0"?o==="1":storedKioskMode(t)}export function storedKioskMode(t){const o=r?window.localStorage.getItem(e):null;return o==="1"||o==="0"?o==="1":hasSavedKiosk()||Object.keys(t.kiosk??{}).length>0}export function hasSavedKiosk(){return r&&i()!=null}
|
|
@@ -4,14 +4,5 @@ export declare function createTargetCanvas(pixelRatio: number, color?: string, s
|
|
|
4
4
|
export declare function createArrowCurrentCanvas(pixelRatio: number, color?: string, scale?: number): HTMLCanvasElement;
|
|
5
5
|
export declare function createYahCanvas(pixelRatio: number, color?: string, scale?: number): HTMLCanvasElement;
|
|
6
6
|
export declare function createLabelCanvas(text: string, fontSize: number, pixelRatio: number, color: string | undefined, fontWeight: number, strokeStyle?: string, strokeWidth?: number): HTMLCanvasElement;
|
|
7
|
-
/**
|
|
8
|
-
* The category pin for one outdoor PoI: the poiType glyph knocked out in white
|
|
9
|
-
* inside a pin filled with the booth's authored color. Returns `ImageData`
|
|
10
|
-
* rather than a canvas — the only consumer is `map.addImage`, and a canvas per
|
|
11
|
-
* PoI would stay resident for the session.
|
|
12
|
-
*/
|
|
13
|
-
export declare function createPoiPinImage(image: HTMLImageElement | null, widthPx: number, pixelRatio: number, color: string): ImageData;
|
|
14
|
-
/** The shared selection pinhead — one image serves every marker. */
|
|
15
|
-
export declare function createPoiPinheadImage(size: number, pixelRatio: number, color: string): ImageData;
|
|
16
7
|
export declare function getFont(px: number, weight?: number, style?: string): string;
|
|
17
8
|
//# sourceMappingURL=canvases.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FONT_FACE as z,FONT_WEIGHT_PRIMARY_BOOTH as
|
|
1
|
+
import{FONT_FACE as z,FONT_WEIGHT_PRIMARY_BOOTH as f}from"../../../../constants";export function createImageCanvas(n,l,o,i,c=1,r){const e=n?n.width/n.height:1;let a=l*i*c,t=o*i*c;l/o>e?a=t*e:t=a/e;const v=document.createElement("canvas"),u=v.getContext("2d");return v.width=a,v.height=t,v.id=n.id,r==="horizontal"?(u.scale(-1,1),u.translate(-a,0)):r==="vertical"&&(u.scale(1,-1),u.translate(0,-t)),u.drawImage(n,0,0,a,t),v}export function createCurrentCanvas(n,l="#c8248b",o=n*.4,i,c,r,e="#000"){i=i||95,c=c||95;const a=document.createElement("canvas"),t=a.getContext("2d");a.width=i*o,a.height=c*o,t.scale(o,o);const v=i/2,u=c/2;if(t.translate(v-35,r?0:u-35),t.beginPath(),t.fillStyle="#FFFFFF",t.moveTo(0,35),t.bezierCurveTo(0,54.329966,15.670034,70,35,70),t.bezierCurveTo(54.329966,70,70,54.329966,70,35),t.bezierCurveTo(70,15.670034,54.329966,0,35,0),t.bezierCurveTo(15.670034,0,0,15.670034,0,35),t.fill(),t.beginPath(),t.fillStyle=l,t.moveTo(10,35),t.bezierCurveTo(10,48.807119,21.192881,60,35,60),t.bezierCurveTo(48.807119,60,60,48.807119,60,35),t.bezierCurveTo(60,21.192881,48.807119,10,35,10),t.bezierCurveTo(21.192881,10,10,21.192881,10,35),t.fill(),r){t.textAlign="center",t.textBaseline="alphabetic",t.lineJoin="round",t.strokeStyle="#fff",t.fillStyle=e;const T=38;t.font=getFont(T),t.lineWidth=6;const b=70+T;t.strokeText(r,35,b,i),t.fillText(r,35,b,i)}return a}export function createTargetCanvas(n,l="#c8248b",o=n*.5){const i=70*o,c=100*o,r=document.createElement("canvas"),e=r.getContext("2d");return r.width=i,r.height=c,e.scale(o,o),e.beginPath(),e.fillStyle="rgb(255, 255, 255)",e.moveTo(32.6,97.8),e.bezierCurveTo(24.4,81.5,0,57,0,32.6),e.bezierCurveTo(0,14.6,14.6,0,32.6,0),e.bezierCurveTo(50.5,0,65.2,14.6,65.2,32.6),e.bezierCurveTo(65.2,57,40.7,81.5,32.6,97.8),e.fill(),e.beginPath(),e.fillStyle=l,e.moveTo(32.6,91.1),e.bezierCurveTo(25.2,76.3,3.1,54.2,3.1,32.1),e.bezierCurveTo(3.1,15.9,16.3,2.6,32.6,2.6),e.bezierCurveTo(48.8,2.6,62,15.9,62,32.1),e.bezierCurveTo(62,54.2,39.9,76.3,32.6,91.1),e.fill(),e.beginPath(),e.fillStyle="rgb(255, 255, 255)",e.moveTo(16.2,32.6),e.bezierCurveTo(16.2,41.6,23.5,48.9,32.5,48.9),e.bezierCurveTo(41.5,48.9,48.8,41.6,48.8,32.6),e.bezierCurveTo(48.8,23.6,41.5,16.3,32.5,16.3),e.bezierCurveTo(23.5,16.3,16.2,23.6,16.2,32.6),e.fill(),r}export function createArrowCurrentCanvas(n,l="#c8248b",o=n*.4){const i=95*o,c=95*o,r=document.createElement("canvas"),e=r.getContext("2d");return r.width=i,r.height=c,e.scale(o,o),e.beginPath(),e.arc(47,47,25,0,2*Math.PI),e.fillStyle=l,e.fill(),e.beginPath(),e.fillStyle=l,e.moveTo(75,27),e.lineTo(95,47),e.lineTo(75,67),e.lineTo(80,47),e.closePath(),e.fill(),r}export function createYahCanvas(n,l="#ff4343",o=n*.5){const i=77*o,c=116*o,r=document.createElement("canvas"),e=r.getContext("2d");return r.width=i,r.height=c,e.scale(o,o),e.scale(o,o),e.beginPath(),e.fillStyle="#FFFFFF",e.moveTo(68.303,57.335),e.bezierCurveTo(77.894,39.304,70.649,15.785,50.95,8.04),e.bezierCurveTo(30.727,0,8.375,11.837,3.207,32.831),e.bezierCurveTo(0,46.185,6.644,57.323,13.131,68.211),e.fill(),e.beginPath(),e.fillStyle=l,e.moveTo(51.565,35.459),e.bezierCurveTo(51.565,43.256,45.201,49.575,37.354,49.575),e.bezierCurveTo(29.516,49.575,23.159,43.256,23.159,35.459),e.bezierCurveTo(23.159,27.668,29.516,21.345,37.354,21.345),e.bezierCurveTo(45.201,21.345,51.565,27.668,51.565,35.459),e.closePath(),e.fill(),e.beginPath(),e.moveTo(68.303,57.335),e.bezierCurveTo(77.894,39.304,70.649,15.785,50.95,8.04),e.bezierCurveTo(30.727,0,8.375,11.837,3.207,32.831),e.bezierCurveTo(0,46.185,6.644,57.323,13.131,68.211),e.lineTo(13.131,68.211),e.lineTo(13.131,68.211),e.bezierCurveTo(13.921,69.533,14.698,70.829,15.454,72.137),e.bezierCurveTo(19.465,79.158,23.533,86.12,27.571,93.086),e.lineTo(27.571,93.086),e.bezierCurveTo(30.098,97.421,32.611,101.756,35.116,106.077),e.bezierCurveTo(36.128,107.868,38.934,107.868,39.945,106.077),e.bezierCurveTo(49.387,90.003,58.708,74.029,68.031,57.951),e.bezierCurveTo(68.15,57.743,68.24,57.543,68.303,57.335),e.closePath(),e.moveTo(60.103,60.395),e.lineTo(63.201,55.041),e.lineTo(63.201,55.041),e.bezierCurveTo(73.31,36.735,61.285,11.614,39.04,11.17),e.bezierCurveTo(19.388,10.714,2.759,29.479,9.386,49.013),e.bezierCurveTo(10.726,52.998,12.657,56.9,14.84,60.721),e.bezierCurveTo(15.041,58.454,15.938,56.258,17.589,54.586),e.bezierCurveTo(19.708,52.425,22.216,50.638,24.996,49.283),e.bezierCurveTo(28.252,52.249,32.595,54.051,37.354,54.051),e.bezierCurveTo(42.123,54.051,46.47,52.249,49.73,49.283),e.bezierCurveTo(52.505,50.638,55.017,52.425,57.135,54.586),e.bezierCurveTo(58.701,56.188,59.701,58.245,60.103,60.395),e.closePath(),e.fill("evenodd"),e.beginPath(),e.moveTo(29.024,104.982),e.bezierCurveTo(29.024,103.626,27.923,102.527,26.57,102.527),e.bezierCurveTo(25.214,102.527,24.114,103.626,24.114,104.982),e.bezierCurveTo(24.114,111.395,30.347,116.838,37.444,116.838),e.bezierCurveTo(44.54,116.838,50.771,111.395,50.771,104.982),e.bezierCurveTo(50.771,103.626,49.666,102.527,48.317,102.527),e.bezierCurveTo(46.961,102.527,45.855,103.626,45.855,104.982),e.bezierCurveTo(45.855,108.193,42.352,111.956,37.444,111.956),e.bezierCurveTo(32.528,111.956,29.024,108.193,29.024,104.982),e.closePath(),e.fill(),r}const h=document.createElement("canvas"),C=h.getContext("2d");function d(n,l){return C.font=n,C.measureText(l).width}export function createLabelCanvas(n,l,o,i="#fff",c,r,e){n=n.replace(/^_/,""),l*=o;const a=document.createElement("canvas"),t=a.getContext("2d"),v=Number(getComputedStyle(document.body).getPropertyValue(f)),u=getFont(l,v||c),T=d(u,n.replace(/[0-9]/g,"3").replace(/[A-Z]/g,"A"))+3+3,b=4,s=l+b;return a.width=T*o,a.height=s*o,t.font=u,t.textAlign="center",t.textBaseline="alphabetic",t.fillStyle=i,e&&r&&(t.lineWidth=e,t.strokeStyle=r,t.strokeText(n,T/2,s-b/2*o),t.lineJoin="round"),t.fillText(n,T/2,s-b/2*o),a}export function getFont(n,l=500,o="normal"){const i=getComputedStyle(document.body).getPropertyValue(z),c='Oswald, -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',r=i?`${i}, ${c}`:c;return`${o} ${l} ${n}px ${r}`}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import m from"color";import{OUTDOOR_LAYER_PREFIX as u,POI_MARKER_PIN_WIDTH_PX as P,POI_PIN_DEFAULT_COLOR as y}from"../../../../constants";import I from"../../../../data";import s,{uiState as g}from"../../../../store";import{loadImage as M}from"../../../../utils/loadImage";import{createPoiPinImage as w}from"./
|
|
1
|
+
import m from"color";import{OUTDOOR_LAYER_PREFIX as u,POI_MARKER_PIN_WIDTH_PX as P,POI_PIN_DEFAULT_COLOR as y}from"../../../../constants";import I from"../../../../data";import s,{uiState as g}from"../../../../store";import{loadImage as M}from"../../../../utils/loadImage";import{createPoiPinImage as w}from"./poi-pin.js";const d=r=>!!r&&r!=="transparent"&&r!=="none";function O(r){const i=(r.paths??[]).map(a=>a.color).find(d),t=(r.shapes??[]).map(a=>a.color).find(d),n=i??t??null;if(!n)return null;try{return g.monochrome?m(n).grayscale().rgb().string():n}catch{return n}}export function isOutdoorMarkersEnabled(){return I.enableExperimentalOutdoorMarkers===!0}export function isOutdoorPoiLayer(r){return r.name.toLowerCase().startsWith(u.toLowerCase())}async function T(r){const i=s.poiMarkerStore.generation,t=window.devicePixelRatio||1,n=[],a=new Map((s.poiTypeStore?.poiTypes??[]).map(e=>[e.id,e])),c=new Map,f=e=>{let o=c.get(e);return o||(o=M(e),c.set(e,o)),o};await Promise.all(r.map(async e=>{const o=e.poiTypeId==null?void 0:a.get(e.poiTypeId)?.iconUrl,p=o?await f(o):null;o&&!p&&console.warn("PoI icon failed to load",e.name,o);const l=e.rect.center;n.push({boothId:e.id,center:{x:l.x,y:l.y},icon:w(p,P,t,O(e)??y)})})),s.poiMarkerStore.generation===i&&s.poiMarkerStore.addMany(n)}export function configOutdoorPoiLayer(r,i){return!isOutdoorMarkersEnabled()||!isOutdoorPoiLayer(r)?!1:(s.maplibreStore.showMaplibre&&T(i.filter(t=>t.poiTypeId&&t.rect)),!0)}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A vector outdoor-PoI pin, traced from the outdoor-only app's marker artwork. Coordinates
|
|
3
|
+
* are in that artwork's pixel frame (which includes a drop-shadow margin), so
|
|
4
|
+
* the numbers can be checked against the source PNGs directly.
|
|
5
|
+
*/
|
|
6
|
+
export interface PoiPinShape {
|
|
7
|
+
/** The artwork frame: the pin plus room for its drop shadow. */
|
|
8
|
+
readonly frame: {
|
|
9
|
+
readonly width: number;
|
|
10
|
+
readonly height: number;
|
|
11
|
+
};
|
|
12
|
+
/** Width of the visible pin (stroke included) — what the size constants set. */
|
|
13
|
+
readonly bodyWidth: number;
|
|
14
|
+
/**
|
|
15
|
+
* Teardrop outline as SVG path data, starting at the tip apex. For a stroked
|
|
16
|
+
* pin this is the stroke's centerline.
|
|
17
|
+
*/
|
|
18
|
+
readonly outline: string;
|
|
19
|
+
readonly strokeWidth: number;
|
|
20
|
+
/** Lowest point of {@link outline}, at the horizontal center of the frame. */
|
|
21
|
+
readonly tipApexY: number;
|
|
22
|
+
/**
|
|
23
|
+
* The round head: its center, and the radius of the disc drawn on it (the
|
|
24
|
+
* glyph's colored disc, or the selection dot).
|
|
25
|
+
*/
|
|
26
|
+
readonly head: {
|
|
27
|
+
readonly x: number;
|
|
28
|
+
readonly y: number;
|
|
29
|
+
readonly innerRadius: number;
|
|
30
|
+
};
|
|
31
|
+
readonly shadow: {
|
|
32
|
+
readonly offsetY: number;
|
|
33
|
+
readonly blur: number;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The category pin (82x96 artwork): a white teardrop around a colored disc
|
|
38
|
+
* that carries the poiType glyph.
|
|
39
|
+
*/
|
|
40
|
+
export declare const POI_MARKER_PIN_SHAPE: {
|
|
41
|
+
readonly frame: {
|
|
42
|
+
readonly width: 82;
|
|
43
|
+
readonly height: 96;
|
|
44
|
+
};
|
|
45
|
+
readonly bodyWidth: 70;
|
|
46
|
+
readonly outline: 'M41 86.13C41.68 85.63 76 61.93 76 36.1A35 35 0 0 0 6 36.1C6 61.93 40.32 85.63 41 86.13Z';
|
|
47
|
+
readonly strokeWidth: 0;
|
|
48
|
+
readonly tipApexY: 86.13;
|
|
49
|
+
readonly head: {
|
|
50
|
+
readonly x: 41;
|
|
51
|
+
readonly y: 36.1;
|
|
52
|
+
readonly innerRadius: 29.3;
|
|
53
|
+
};
|
|
54
|
+
readonly shadow: {
|
|
55
|
+
readonly offsetY: 2;
|
|
56
|
+
readonly blur: 4;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* The selection pin (102x137 artwork): a teardrop filled with the selection
|
|
61
|
+
* color, outlined and dotted in a darker shade of it.
|
|
62
|
+
*/
|
|
63
|
+
export declare const POI_SELECTED_PIN_SHAPE: {
|
|
64
|
+
readonly frame: {
|
|
65
|
+
readonly width: 102;
|
|
66
|
+
readonly height: 137;
|
|
67
|
+
};
|
|
68
|
+
readonly bodyWidth: 90;
|
|
69
|
+
readonly outline: 'M51 125.88C56.54 123.07 94.5 77 94.5 47A43.5 43.5 0 0 0 7.5 47C7.5 77 45.46 123.07 51 125.88Z';
|
|
70
|
+
readonly strokeWidth: 3;
|
|
71
|
+
readonly tipApexY: 125.88;
|
|
72
|
+
readonly head: {
|
|
73
|
+
readonly x: 51;
|
|
74
|
+
readonly y: 47;
|
|
75
|
+
readonly innerRadius: 19;
|
|
76
|
+
};
|
|
77
|
+
readonly shadow: {
|
|
78
|
+
readonly offsetY: 2.5;
|
|
79
|
+
readonly blur: 5;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
export interface PoiPinLayout {
|
|
83
|
+
/** Artwork frame units → device pixels. */
|
|
84
|
+
readonly scale: number;
|
|
85
|
+
readonly canvasWidth: number;
|
|
86
|
+
readonly canvasHeight: number;
|
|
87
|
+
/**
|
|
88
|
+
* CSS px to shift the bottom-anchored image down by (MapLibre `icon-offset`),
|
|
89
|
+
* so the pin tip — not the shadow below it — sits on the point.
|
|
90
|
+
*/
|
|
91
|
+
readonly tipOffset: number;
|
|
92
|
+
}
|
|
93
|
+
/** Sizes a pin whose visible body is `bodyWidthPx` CSS px wide. */
|
|
94
|
+
export declare function getPoiPinLayout(shape: PoiPinShape, bodyWidthPx: number, pixelRatio: number): PoiPinLayout;
|
|
95
|
+
/**
|
|
96
|
+
* The darker shade the selection pin draws its outline and dot in — the
|
|
97
|
+
* artwork's #ff4747 → #9a2626 pairing, applied to any selection color.
|
|
98
|
+
*/
|
|
99
|
+
export declare function getPoiPinShadeColor(color: string): string;
|
|
100
|
+
//# sourceMappingURL=poi-pin-shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import d from"color";export const POI_MARKER_PIN_SHAPE={frame:{width:82,height:96},bodyWidth:70,outline:"M41 86.13C41.68 85.63 76 61.93 76 36.1A35 35 0 0 0 6 36.1C6 61.93 40.32 85.63 41 86.13Z",strokeWidth:0,tipApexY:86.13,head:{x:41,y:36.1,innerRadius:29.3},shadow:{offsetY:2,blur:4}},POI_SELECTED_PIN_SHAPE={frame:{width:102,height:137},bodyWidth:90,outline:"M51 125.88C56.54 123.07 94.5 77 94.5 47A43.5 43.5 0 0 0 7.5 47C7.5 77 45.46 123.07 51 125.88Z",strokeWidth:3,tipApexY:125.88,head:{x:51,y:47,innerRadius:19},shadow:{offsetY:2.5,blur:5}};export function getPoiPinLayout(t,r,i){const e=r/t.bodyWidth*i,o=Math.ceil(t.frame.height*e),n=(t.tipApexY+t.strokeWidth/2)*e;return{scale:e,canvasWidth:Math.ceil(t.frame.width*e),canvasHeight:o,tipOffset:(o-n)/i}}export function getPoiPinShadeColor(t){try{return d(t).darken(.41).desaturate(.4).hex()}catch{return t}}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The category pin for one outdoor PoI: the poiType glyph knocked out in white
|
|
3
|
+
* on a disc in the booth's authored color, inside a white teardrop. Returns
|
|
4
|
+
* `ImageData` rather than a canvas — the only consumer is `map.addImage`, and
|
|
5
|
+
* a canvas per PoI would stay resident for the session.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createPoiPinImage(image: HTMLImageElement | null, bodyWidthPx: number, pixelRatio: number, color: string): ImageData;
|
|
8
|
+
/** The shared selection pin — one image serves every marker. */
|
|
9
|
+
export declare function createPoiPinheadImage(bodyWidthPx: number, pixelRatio: number, color: string): ImageData;
|
|
10
|
+
//# sourceMappingURL=poi-pin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{POI_PIN_DEFAULT_COLOR as _}from"../../../../constants.js";import{createImageCanvas as y}from"./canvases.js";import{getPoiPinLayout as I,getPoiPinShadeColor as O,POI_MARKER_PIN_SHAPE as R,POI_SELECTED_PIN_SHAPE as E}from"./poi-pin-shape.js";const x=.6,p="#ffffff",A="rgba(0, 0, 0, 0.35)";function w(t,i){const n=document.createElement("canvas");n.width=i.canvasWidth,n.height=i.canvasHeight;const o=n.getContext("2d");return o.scale(i.scale,i.scale),{canvas:n,ctx:o,path:new Path2D(t.outline)}}function m(t,i,n){t.shadowColor=A,t.shadowOffsetY=i.shadow.offsetY*n,t.shadowBlur=i.shadow.blur*n}function C(t){t.shadowColor="transparent",t.shadowOffsetY=0,t.shadowBlur=0}function S(t){return t.getContext("2d").getImageData(0,0,t.width,t.height)}export function createPoiPinImage(t,i,n,o){const s=R,l=I(s,i,n),{canvas:e,ctx:a,path:c}=w(s,l),{x:d,y:f}=s.head;if(m(a,s,l.scale),a.fillStyle=p,a.fill(c),C(a),a.beginPath(),a.arc(d,f,s.head.innerRadius,0,2*Math.PI),a.fillStyle=_,a.fillStyle=o,a.fill(),t){const P=2*s.head.innerRadius*x*l.scale,h=y(t,P,P,1),r=h.getContext("2d");r.globalCompositeOperation="source-in",r.fillStyle=p,r.fillRect(0,0,h.width,h.height);const g=h.width/l.scale,u=h.height/l.scale;a.drawImage(h,d-g/2,f-u/2,g,u)}return S(e)}export function createPoiPinheadImage(t,i,n){const o=E,s=I(o,t,i),{canvas:l,ctx:e,path:a}=w(o,s),c=O(n);return m(e,o,s.scale),e.fillStyle=n,e.fill(a),C(e),e.strokeStyle=c,e.lineWidth=o.strokeWidth,e.lineJoin="round",e.stroke(a),e.beginPath(),e.arc(o.head.x,o.head.y,o.head.innerRadius,0,2*Math.PI),e.fillStyle=c,e.fill(),S(l)}
|
|
@@ -17,6 +17,11 @@ export interface TileSourceConfig {
|
|
|
17
17
|
* tolerates a host without Range support.
|
|
18
18
|
*/
|
|
19
19
|
offline?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Edits the loaded style before MapLibre applies it — a palette over a
|
|
22
|
+
* hosted style, for instance.
|
|
23
|
+
*/
|
|
24
|
+
restyle?: (style: StyleSpecification) => StyleSpecification;
|
|
20
25
|
}
|
|
21
26
|
export interface CameraPaddingOptions {
|
|
22
27
|
top: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as F}from"react/jsx-runtime";import"maplibre-gl/dist/maplibre-gl.css";import{prepareDebug as q,Renderer as H}from"@expofp/renderer";import{addProtocol as J,Map as V}from"maplibre-gl";import{Protocol as X}from"pmtiles";import{useEffect as T,useRef as l,useState as K}from"react";import{uiState as B}from"../../store";import{CollapsedAttributionControl as Q}from"./CollapsedAttributionControl.js";import{ExpofpLogoControl as $}from"./ExpofpLogoControl.js";import{registerPmtilesArchive as v}from"./utils/pmtiles-range-fallback";import{createStyleTransform as ee}from"./utils/resolve-map-style";const te='<a href="https://maplibre.org/" target="_blank">MapLibre</a>';export const MAP_DIM_LAYER_ID="expofp-map-dim";const p="expofp-map-dim-source",oe="3d-expofp";let y=null;const re=["coalesce",["get","name:en"],["get","name_en"],["get","name:latin"],["get","name"]],ne={type:"Feature",geometry:{type:"Polygon",coordinates:[[[-180,-85],[180,-85],[180,85],[-180,85],[-180,-85]]]},properties:{}};function z(e){if(!e||typeof e!="object")return!1;const o=e.length;if(typeof o!="number"||o<16)return!1;const r=e[0];return typeof r=="number"&&Number.isFinite(r)}function ie(e){if(z(e))return Array.from(e);const r=e?.defaultProjectionData?.mainMatrix;return z(r)?Array.from(r):(console.warn("Maplibre custom layer received an unsupported projection matrix payload.",e),null)}function g(e){return typeof e=="string"?e.includes("name"):Array.isArray(e)?e.some(o=>g(o)):!e||typeof e!="object"?!1:Object.values(e).some(o=>g(o))}function ae(e){return e.type!=="symbol"||!e.id||!e.layout?!1:g(e.layout["text-field"])}function se(e){const o=e.getStyle();for(const r of o.layers??[])ae(r)&&e.setLayoutProperty(r.id,"text-field",re)}function le(){if(y)return y;const e=new X;y=e;try{J("pmtiles",e.tile)}catch(o){console.warn("Maplibre PMTiles protocol registration failed.",o)}return e}export default function ce({sceneDef:e,geoConfig:o,tileSource:r,mapOptions:N,debug:b,onMapReady:h,onMapDimLayerReady:x,onMapLoadError:M,onPointerMissed:Z,children:U}){const P=l(null),[A,L]=K(),_=l(h),S=l(x),E=l(M),G=l({geoConfig:o,tileSource:r,mapOptions:N,debug:b});return T(()=>{_.current=h,S.current=x,E.current=M}),T(()=>{const j=P.current;if(!j)return;const{geoConfig:n,tileSource:
|
|
1
|
+
import{jsx as F}from"react/jsx-runtime";import"maplibre-gl/dist/maplibre-gl.css";import{prepareDebug as q,Renderer as H}from"@expofp/renderer";import{addProtocol as J,Map as V}from"maplibre-gl";import{Protocol as X}from"pmtiles";import{useEffect as T,useRef as l,useState as K}from"react";import{uiState as B}from"../../store";import{CollapsedAttributionControl as Q}from"./CollapsedAttributionControl.js";import{ExpofpLogoControl as $}from"./ExpofpLogoControl.js";import{registerPmtilesArchive as v}from"./utils/pmtiles-range-fallback";import{createStyleTransform as ee}from"./utils/resolve-map-style";const te='<a href="https://maplibre.org/" target="_blank">MapLibre</a>';export const MAP_DIM_LAYER_ID="expofp-map-dim";const p="expofp-map-dim-source",oe="3d-expofp";let y=null;const re=["coalesce",["get","name:en"],["get","name_en"],["get","name:latin"],["get","name"]],ne={type:"Feature",geometry:{type:"Polygon",coordinates:[[[-180,-85],[180,-85],[180,85],[-180,85],[-180,-85]]]},properties:{}};function z(e){if(!e||typeof e!="object")return!1;const o=e.length;if(typeof o!="number"||o<16)return!1;const r=e[0];return typeof r=="number"&&Number.isFinite(r)}function ie(e){if(z(e))return Array.from(e);const r=e?.defaultProjectionData?.mainMatrix;return z(r)?Array.from(r):(console.warn("Maplibre custom layer received an unsupported projection matrix payload.",e),null)}function g(e){return typeof e=="string"?e.includes("name"):Array.isArray(e)?e.some(o=>g(o)):!e||typeof e!="object"?!1:Object.values(e).some(o=>g(o))}function ae(e){return e.type!=="symbol"||!e.id||!e.layout?!1:g(e.layout["text-field"])}function se(e){const o=e.getStyle();for(const r of o.layers??[])ae(r)&&e.setLayoutProperty(r.id,"text-field",re)}function le(){if(y)return y;const e=new X;y=e;try{J("pmtiles",e.tile)}catch(o){console.warn("Maplibre PMTiles protocol registration failed.",o)}return e}export default function ce({sceneDef:e,geoConfig:o,tileSource:r,mapOptions:N,debug:b,onMapReady:h,onMapDimLayerReady:x,onMapLoadError:M,onPointerMissed:Z,children:U}){const P=l(null),[A,L]=K(),_=l(h),S=l(x),E=l(M),G=l({geoConfig:o,tileSource:r,mapOptions:N,debug:b});return T(()=>{_.current=h,S.current=x,E.current=M}),T(()=>{const j=P.current;if(!j)return;const{geoConfig:n,tileSource:c,mapOptions:f,debug:I}=G.current;let u=!1,R;const C=()=>{const W=le(),Y=n.bounds?{bounds:n.bounds,fitBoundsOptions:{padding:n.fitPadding,bearing:n.bearing}}:{center:n.center,zoom:n.zoom},w=ee(c.style,c.offline?i=>v(W,i):void 0,c.restyle),t=new V({container:j,...Y,bearing:n.bearing,maxPitch:f?.maxPitch,minZoom:f?.minZoom,maxZoom:f?.maxZoom,maxBounds:f?.maxBounds,attributionControl:!1,bearingSnap:0,aroundCenter:!1,pitchWithRotate:B.pitchEnabled,touchPitch:B.pitchEnabled,canvasContextAttributes:{antialias:!0}});t.addControl(new $),t.addControl(new Q(te)),n.zoomAdjustment&&t.jumpTo({zoom:t.getZoom()+n.zoomAdjustment}),t.once("error",i=>{t.isStyleLoaded()||E.current?.(i?.error??i)});const O=i=>{const a=i?.id;!a||t.hasImage(a)||t.addImage(a,{width:1,height:1,data:new Uint8Array(4)})};t.on("styleimagemissing",O);let d;const m=()=>t.triggerRepaint(),k={id:oe,type:"custom",renderingMode:"3d",onAdd(i,a){u||(L({gl:a,requestFrame:m,onFrame:s=>(d=s,m(),()=>{d===s&&(d=void 0)})}),_.current?.(t,m))},render(i,a){const s=ie(a??i);s&&d?.(s),I&&m()}},D=()=>{se(t),t.getSource(p)||t.addSource(p,{type:"geojson",data:ne}),t.getLayer(MAP_DIM_LAYER_ID)||t.addLayer({id:MAP_DIM_LAYER_ID,type:"fill",source:p,paint:{"fill-color":"#000000","fill-opacity":0,"fill-opacity-transition":{duration:0,delay:0}}}),S.current?.(t),t.addLayer(k)};t.on("style.load",D),t.setStyle(c.style,w?{transformStyle:w}:void 0),R=()=>{t.off("style.load",D),t.off("styleimagemissing",O),t.remove()}};return I?q().then(()=>{u||C()}):C(),()=>{u=!0,R?.(),L(void 0)}},[]),F("div",{ref:P,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},children:A&&F(H,{...A,scene:e,debug:b,onPointerMissed:Z,children:U})})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Box as
|
|
1
|
+
import{Box as $}from"@expofp/geometry";import{reaction as h}from"mobx";import{useEffect as J}from"react";import{POI_CLUSTER_COLOR as Q,POI_CLUSTER_MIN_POINTS as ee,POI_CLUSTER_RADIUS_PX as te,POI_CLUSTER_SIZE_PX as oe,POI_CLUSTER_STROKE_COLOR as re,POI_CLUSTER_STROKE_WIDTH_PX as ie,POI_CLUSTER_TEXT_SIZE_PX as ne,POI_MARKER_PIN_WIDTH_PX as ce,POI_SELECTED_PIN_WIDTH_PX as C}from"../../constants";import c from"../../store";import se from"../../tools/settings";import{DIM_INTENSITY as ae}from"../../utils/dimming";import{convertLocalToGps as v}from"../../utils/gps";import{isOutdoorMarkersEnabled as le}from"../Map/drawing/config/config-outdoor-poi";import{createPoiPinheadImage as pe}from"../Map/drawing/config/poi-pin.js";import{getPoiPinLayout as A,POI_MARKER_PIN_SHAPE as fe,POI_SELECTED_PIN_SHAPE as ue}from"../Map/drawing/config/poi-pin-shape.js";import{getMapDimTarget as U}from"./useDimming";import{getLocalRectGeoBounds as de,getVisibleRectFitPadding as me,isLngLatInVisibleViewport as Ie}from"./utils/geo-config";import{poiMarkerHitTest as N}from"./utils/poi-marker-hit-test";const s="expofp-poi",a="expofp-poi-clusters",S="expofp-poi-cluster-count",I="expofp-poi-unclustered",y="expofp-poi-selected",E="expofp-poi-pinhead-image",w=[a,S,I,y],ye=w.filter(p=>p!==S),b=p=>`expofp-poi-icon-${p}`;export function usePoiMarkers(p,k,u){J(()=>{if(!le())return;const e=k.current;if(!p||!e||!u)return;const{gpsConfig:L}=u,l=new Set,_=window.devicePixelRatio||1,F=se.colors?.booths?.selected||"#3b6ef5",H=pe(C,_,F),B=A(fe,ce,_).tipOffset,X=A(ue,C,_).tipOffset,O=t=>v(t.center.x,t.center.y,L),T=(t,o)=>{e.hasImage(t)&&e.removeImage(t),e.addImage(t,o,{pixelRatio:_}),l.add(t)},Y=t=>{const o=c.poiMarkerStore.markers,i=new Set(o.map(r=>b(r.boothId)));i.add(E);for(const r of[...l])i.has(r)||(e.hasImage(r)&&e.removeImage(r),l.delete(r));for(const r of o){const n=b(r.boothId);(t||!l.has(n))&&T(n,r.icon)}l.has(E)||T(E,H)},z=()=>{const t=c.poiMarkerStore.selectedMarkerId,o=c.poiMarkerStore.outdoorFilter,i=!o.active;let r=c.poiMarkerStore.markers;return t!==null?r=r.filter(n=>n.boothId===t):o.active&&(r=o.matchingMarkers),{cluster:i,data:{type:"FeatureCollection",features:r.map(n=>({type:"Feature",geometry:{type:"Point",coordinates:O(n)},properties:{boothId:n.boothId,icon:b(n.boothId),pinhead:n.boothId===t}}))}}},V=()=>{let t=null;for(const o of e.getStyle()?.layers??[]){if(o.type!=="symbol")continue;const i=o.layout?.["text-font"];if(!(!Array.isArray(i)||!i.every(r=>typeof r=="string"))){if(!i.some(r=>/italic/i.test(r)))return i;t??=i}}return t??["Noto Sans Regular"]};let g=null;const R=()=>{for(const t of w)e.getLayer(t)&&e.removeLayer(t);e.getSource(s)&&e.removeSource(s),g=null},Z=(t,o)=>{if(g!==null&&g!==o&&R(),e.getSource(s)||(e.addSource(s,{type:"geojson",data:t,cluster:o,clusterRadius:te,clusterMinPoints:ee}),g=o),e.getLayer(a))return;const i=["!",["has","point_count"]],r=["==",["coalesce",["get","pinhead"],!1],!0];e.addLayer({id:a,type:"circle",source:s,filter:["has","point_count"],paint:{"circle-radius":oe/2,"circle-color":Q,"circle-stroke-color":re,"circle-stroke-width":ie,"circle-pitch-alignment":"viewport"}}),e.addLayer({id:S,type:"symbol",source:s,filter:["has","point_count"],layout:{"text-field":["get","point_count_abbreviated"],"text-font":V(),"text-size":ne,"text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#ffffff"}}),e.addLayer({id:I,type:"symbol",source:s,filter:["all",i,["!",r]],layout:{"icon-image":["get","icon"],"icon-anchor":"bottom","icon-offset":[0,B],"icon-allow-overlap":!0,"icon-ignore-placement":!0}}),e.addLayer({id:y,type:"symbol",source:s,filter:["all",i,r],layout:{"icon-image":E,"icon-anchor":"bottom","icon-offset":[0,X],"icon-allow-overlap":!0,"icon-ignore-placement":!0}})},M=()=>{if(!e.getLayer(a))return;const t=U()?1-ae:1;e.setPaintProperty(a,"circle-opacity",t),e.setPaintProperty(a,"circle-stroke-opacity",t),e.setPaintProperty(S,"text-opacity",t),e.setPaintProperty(I,"icon-opacity",t),e.setPaintProperty(y,"icon-opacity",t)},d=(t=!1)=>{Y(t);const{cluster:o,data:i}=z();Z(i,o),e.getSource(s)?.setData(i),M()},K=t=>{if(!t.length)return;const o=me(50);if(t.every(m=>Ie(e,O(m),o)))return;const r=$.fromPoints(t.map(m=>m.center)),n=de(r,L),f=e.cameraForBounds(n,{padding:o,bearing:u.bearing});!f?.center||typeof f.zoom!="number"||e.easeTo({center:f.center,zoom:Math.min(e.getZoom(),f.zoom),bearing:u.bearing,duration:500,essential:!0})},P=t=>{const o=t.features?.[0]?.properties?.boothId;if(typeof o!="number")return;const i=c.boothStore.boothById.get(o);i&&c.clickBooth(i)},D=t=>{const o=t.features?.[0],i=o?.properties?.cluster_id,r=e.getSource(s);if(typeof i!="number"||!r||o?.geometry?.type!=="Point")return;const[n=0,f=0]=o.geometry.coordinates;r.getClusterExpansionZoom(i).then(m=>{e.easeTo({center:[n,f],zoom:Math.min(m,e.getMaxZoom()),duration:500})})};e.on("click",I,P),e.on("click",y,P),e.on("click",a,D),N.set((t,o)=>{const i=ye.filter(n=>!!e.getLayer(n));if(!i.length)return!1;const r=e.project(v(t,o,L));return e.queryRenderedFeatures([r.x,r.y],{layers:i}).length>0});const x=()=>{l.clear(),d(!0)};e.on("style.load",x);const G=h(()=>c.poiMarkerStore.markers,()=>d(!0)),W=h(()=>c.poiMarkerStore.selectedMarkerId,()=>d()),j=h(()=>c.poiMarkerStore.outdoorFilter.key,()=>{d(),K(c.poiMarkerStore.outdoorFilter.matchingMarkers)}),q=h(()=>U(),()=>M());return d(!0),()=>{G(),W(),j(),q(),N.set(null),e.off("style.load",x),e.off("click",I,P),e.off("click",y,P),e.off("click",a,D);try{R();for(const t of l)e.hasImage(t)&&e.removeImage(t)}catch{}}},[p,k,u])}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type StyleSpecification } from 'maplibre-gl';
|
|
2
|
+
/**
|
|
3
|
+
* Paint properties to set, keyed by the id of the style layer they apply to.
|
|
4
|
+
* A property named here replaces the layer's own value; the rest of its paint
|
|
5
|
+
* stays as the style wrote it.
|
|
6
|
+
*/
|
|
7
|
+
export type PaintOverrides = Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
8
|
+
/**
|
|
9
|
+
* Return a copy of `style` whose named layers carry the override paint.
|
|
10
|
+
*
|
|
11
|
+
* Overrides for layers the style does not have are skipped, so an upstream
|
|
12
|
+
* rename falls back to the upstream color rather than breaking the map.
|
|
13
|
+
*/
|
|
14
|
+
export declare function recolorStyle(style: StyleSpecification, overrides: PaintOverrides): StyleSpecification;
|
|
15
|
+
/** CARTO Positron colors for the OpenFreeMap `positron` style. */
|
|
16
|
+
export declare const POSITRON_PAINT: PaintOverrides;
|
|
17
|
+
/** CARTO Dark Matter colors for the OpenFreeMap `dark` style. */
|
|
18
|
+
export declare const DARK_MATTER_PAINT: PaintOverrides;
|
|
19
|
+
//# sourceMappingURL=basemap-palette.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function recolorStyle(_,s){return{..._,layers:_.layers.map(l=>{const n=s[l.id];return n?{...l,paint:{...l.paint,...n}}:l})}}const o={"text-color":"#697b89","text-halo-color":"rgba(255,255,255,0.5)"},e={"text-color":"#8a99a4","text-halo-color":"#fafaf8"},r={"text-color":"#838383","text-halo-color":"#fff"},t={"text-color":"#7a96a0","text-halo-color":"#f5f5f3"},i={"fill-color":"rgba(234, 241, 233, 0.5)"},a={"line-color":"#dddddd"};export const POSITRON_PAINT={background:{"background-color":"#fafaf8"},park:i,landcover_wood:i,landuse_residential:{"fill-color":"rgba(237, 237, 237, 0.5)"},water:{"fill-color":"#d4dadc"},waterway:{"line-color":"#d1dbdf"},building:{"fill-color":"#ededed","fill-outline-color":"#dfdfdf"},highway_minor:{"line-color":["match",["get","class"],"service","#efefef","#e6e6e6"]},tunnel_motorway_casing:a,highway_major_casing:a,highway_motorway_casing:a,highway_motorway_bridge_casing:a,highway_path:{"line-color":"#d5d5d5"},boundary_2:{"line-color":"#ebd6d8"},boundary_3:{"line-color":"#e1c5c7"},boundary_disputed:{"line-color":"#ebd6d8"},"highway-name-path":r,"highway-name-minor":r,"highway-name-major":r,waterway_line_label:t,water_name_point_label:t,water_name_line_label:t,label_other:o,label_village:o,label_town:o,label_city:o,label_city_capital:o,label_state:{"text-color":"#97a4ae","text-halo-color":"#fafaf8"},label_country_1:e,label_country_2:e,label_country_3:e};const h={"line-color":"#232323"},g={"line-color":"rgb(96, 96, 96)"},d={"text-color":"#666","text-halo-color":"#222"},b={"text-color":"rgb(211, 228, 236)","text-halo-color":"#222"},c={"text-color":"rgb(158, 182, 189)","text-halo-color":"#111"},y={"fill-opacity":0};export const DARK_MATTER_PAINT={background:{"background-color":"#0e0e0e"},landcover_wood:y,landuse_park:y,water:{"fill-color":"#2c353c"},waterway:{"line-color":"rgb(63, 90, 109)"},building:{"fill-color":"#393939","fill-outline-color":"#0e0e0e"},highway_path:{"line-color":"#262626"},highway_minor:{"line-color":["match",["get","class"],"minor","rgb(65, 71, 88)","service","#1c1c1c","#262626"]},highway_major_casing:h,highway_major_inner:{"line-color":"rgb(83, 86, 102)"},highway_motorway_casing:h,highway_motorway_inner:{"line-color":"rgb(73, 73, 73)"},highway_name_other:{"text-color":"rgb(181, 180, 180)","text-halo-color":"#111"},water_name:{"text-color":"rgb(155, 155, 155)","text-halo-color":"#181818"},boundary_state:{"line-color":"rgb(103, 103, 114)"},"boundary_country_z0-4":g,"boundary_country_z5-":g,place_other:d,place_suburb:d,place_village:{"text-color":"rgb(154, 153, 153)","text-halo-color":"#222"},place_town:{"text-color":"rgb(204, 208, 228)","text-halo-color":"#222"},place_city:b,place_city_large:b,place_state:{"text-color":"rgb(203, 230, 230)","text-halo-color":"#111"},place_country_other:c,place_country_minor:c,place_country_major:c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getFpGeo as
|
|
1
|
+
import{getFpGeo as p}from"../../../data/fpGeo.js";import u,{uiState as s}from"../../../store/index.js";import a from"../../../tools/settings.js";import{MAP_DIM_LAYER_ID as f}from"../MaplibreWrapper.js";import{DARK_MATTER_PAINT as m,POSITRON_PAINT as y,recolorStyle as c}from"./basemap-palette.js";import{resolveMapTheme as h}from"./map-theme.js";export const LIGHT_TILE_SOURCE={style:"https://tiles.openfreemap.org/styles/positron",restyle:t=>c(t,y)},DARK_TILE_SOURCE={style:"https://tiles.openfreemap.org/styles/dark",restyle:t=>c(t,m)},MAP_MIN_ZOOM=12;export function applyMapDimValue(t,e){t?.getLayer(f)&&(t.setPaintProperty(f,"fill-opacity",M(e)),t.triggerRepaint())}function M(t){return Math.min(Math.max(t,0),1)}export function applyMapOptions(t,e){if(!t)return;t.setMinZoom(e.minZoom??null),t.setMaxZoom(e.maxZoom??null),t.setMaxBounds(e.maxBounds??null);const{pitch:o,maxPitch:r}=e,i=s.animatePitch,n=t.getPitch(),l=!!(i&&o!=null&&r!=null&&r<n);l||t.setMaxPitch(r??null),!(o==null||n===o)&&(i?(t.easeTo({pitch:o,duration:s.mapSettings.pitchtime}),l&&t.once("moveend",()=>t.setMaxPitch(r))):t.jumpTo({pitch:o}))}export function getTileSource(){const t=u.fp?.maplibre??window.__efpMaplibre;return t?.style?{style:t.style,offline:t.offline}:t?.styleUrl?{style:t.styleUrl,offline:t.offline}:h(p()?.properties?.config?.style,a.backgroundColor)==="dark"?DARK_TILE_SOURCE:LIGHT_TILE_SOURCE}
|
|
@@ -10,6 +10,10 @@ import { type StyleSpecification, type TransformStyleFunction } from 'maplibre-g
|
|
|
10
10
|
*
|
|
11
11
|
* Inline style objects have no style URL to resolve against; callers must pass
|
|
12
12
|
* already-absolute internals for those.
|
|
13
|
+
*
|
|
14
|
+
* `restyle`, when given, edits the style last — after URL resolution — for
|
|
15
|
+
* changes the style document cannot carry itself, such as a palette applied to
|
|
16
|
+
* a hosted style.
|
|
13
17
|
*/
|
|
14
|
-
export declare function createStyleTransform(style: string | StyleSpecification, onPmtilesArchive?: (url: string) => void): TransformStyleFunction | undefined;
|
|
18
|
+
export declare function createStyleTransform(style: string | StyleSpecification, onPmtilesArchive?: (url: string) => void, restyle?: (style: StyleSpecification) => StyleSpecification): TransformStyleFunction | undefined;
|
|
15
19
|
//# sourceMappingURL=resolve-map-style.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function createStyleTransform(
|
|
1
|
+
export function createStyleTransform(p,a,c){if(typeof p!="string")return c?(e,o)=>c(o):void 0;const y=new URL(p,window.location.href).href,n=e=>new URL(e,y).href.replace(/%7B/g,"{").replace(/%7D/g,"}"),l=e=>{if(!e.startsWith("pmtiles://"))return n(e);const o=n(e.slice(10));return a?.(o),`pmtiles://${o}`};return(e,o)=>{const r={...o};typeof r.sprite=="string"?r.sprite=n(r.sprite):Array.isArray(r.sprite)&&(r.sprite=r.sprite.map(t=>{if(!t||typeof t!="object")return t;const s=t;return typeof s.url!="string"?t:{...s,url:n(s.url)}})),typeof r.glyphs=="string"&&(r.glyphs=n(r.glyphs));const f=r.sources;if(f){r.sources={...f};for(const[t,s]of Object.entries(f)){if(!s||typeof s!="object")continue;const i={...s};typeof i.url=="string"&&(i.url=l(i.url)),Array.isArray(i.tiles)&&(i.tiles=i.tiles.map(u=>typeof u=="string"?l(u):u)),r.sources[t]=i}}return c?c(r):r}}
|
package/dist/esm/constants.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export declare const SEPARATOR = ":";
|
|
|
5
5
|
export declare const OUTDOOR_LAYER_PREFIX = "Outdoor";
|
|
6
6
|
export declare const POI_CLUSTER_RADIUS_PX = 50;
|
|
7
7
|
export declare const POI_CLUSTER_MIN_POINTS = 3;
|
|
8
|
-
export declare const POI_MARKER_PIN_WIDTH_PX =
|
|
9
|
-
export declare const POI_SELECTED_PIN_WIDTH_PX =
|
|
8
|
+
export declare const POI_MARKER_PIN_WIDTH_PX = 40;
|
|
9
|
+
export declare const POI_SELECTED_PIN_WIDTH_PX = 40;
|
|
10
10
|
export declare const POI_PIN_DEFAULT_COLOR = "#ea4236";
|
|
11
11
|
export declare const POI_CLUSTER_SIZE_PX = 36;
|
|
12
12
|
export declare const POI_CLUSTER_COLOR = "rgba(234, 66, 54, 0.85)";
|
package/dist/esm/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VISIBILITY_STORAGE_KEY="___visibility",PREVIEW_MODE_ATTRIBUTE="data-preview-mode",BOOTHS_PAINTER_MARKER="booths",SEPARATOR=":",OUTDOOR_LAYER_PREFIX="Outdoor",POI_CLUSTER_RADIUS_PX=50,POI_CLUSTER_MIN_POINTS=3,POI_MARKER_PIN_WIDTH_PX=
|
|
1
|
+
export const VISIBILITY_STORAGE_KEY="___visibility",PREVIEW_MODE_ATTRIBUTE="data-preview-mode",BOOTHS_PAINTER_MARKER="booths",SEPARATOR=":",OUTDOOR_LAYER_PREFIX="Outdoor",POI_CLUSTER_RADIUS_PX=50,POI_CLUSTER_MIN_POINTS=3,POI_MARKER_PIN_WIDTH_PX=40,POI_SELECTED_PIN_WIDTH_PX=40,POI_PIN_DEFAULT_COLOR="#ea4236",POI_CLUSTER_SIZE_PX=36,POI_CLUSTER_COLOR="rgba(234, 66, 54, 0.85)",POI_CLUSTER_STROKE_COLOR="#ffffff",POI_CLUSTER_STROKE_WIDTH_PX=2,POI_CLUSTER_TEXT_SIZE_PX=14,LAYER_LOGOS_MARKER="logos",LAYER_ICONS_MARKER="icons",STRING_META_DELIMITER="$$",KIOSK_ENABLE_KEY="kiosk",SET_KIOSK_KEY="setkiosk",BOOKMARK_PAINTER_MARKER="booth-bookmark",DEBUG_KEY="debug",DEBUG_STORAGE_KEY="efp-debugMode",DEFAULT_UNITS="ft",PATHWAY_KEY="pathway",CACHE_DURATION=1e3,MOBILE_BREAKPOINT=768,LANGUAGE_TYPE="language",MAX_ROUTE_WAYPOINTS=8,VIEWER_MODE_STORAGE_KEY="efp-viewerMode",LEGACY_VIEWER_MODE_STORAGE_KEY="___viewer_mode",PREVIEW_MODE_STORAGE_KEY="efp-previewMode",LEGACY_PREVIEW_MODE_STORAGE_KEY="___preview_mode",UI_SCALE_STORAGE_KEY="efp-uiScale",LEGACY_UI_SCALE_STORAGE_KEY="___ui-scale",FONT_FACE="--expofp-font-face",FONT_WEIGHT_PRIMARY_BOOTH="--expofp-booth-main-weight",FONT_WEIGHT_SECONDARY_BOOTH="--expofp-booth-details-weight",FONT_WEIGHT_PRIMARY_EXHIBITOR="--expofp-exhibitor-main-weight",FONT_WEIGHT_SECONDARY_EXHIBITOR="--expofp-exhibitor-details-weight",FONT_WEIGHT_PRIMARY_SPECIAL="--expofp-booth-special-weight",ORIENTATION_GRANTED_KEY="efp-compass-permission-granted";
|
|
@@ -64,7 +64,6 @@ export default class UIState {
|
|
|
64
64
|
previewExhibitor: Exhibitor | null;
|
|
65
65
|
wsStarted: boolean;
|
|
66
66
|
canvasStarted: boolean;
|
|
67
|
-
kiosk: boolean;
|
|
68
67
|
inIdle: boolean;
|
|
69
68
|
modalActive: {
|
|
70
69
|
share: boolean;
|
|
@@ -138,15 +137,15 @@ export default class UIState {
|
|
|
138
137
|
get noOverlay(): boolean;
|
|
139
138
|
get overlayOnDemand(): boolean;
|
|
140
139
|
get overlayHiddenNow(): boolean;
|
|
141
|
-
get onBoothClick(): (e: import("
|
|
142
|
-
get onMarkerClick(): (e: import("
|
|
143
|
-
get onBookmarkClick(): (e: import("
|
|
144
|
-
get onVisitedClick(): (e: import("
|
|
145
|
-
get onCategoryClick(): (e: import("
|
|
146
|
-
get onDirection(): (e: import("
|
|
147
|
-
get onDetails(): (e: import("
|
|
148
|
-
get onExhibitorCustomButtonClick(): (e: import("
|
|
149
|
-
get onGetCoordsClick(): (e: import("
|
|
140
|
+
get onBoothClick(): (e: import("../types.js").FloorPlanBoothClickEvent) => void;
|
|
141
|
+
get onMarkerClick(): (e: import("../types.js").FloorPlanMarkerEvent) => void;
|
|
142
|
+
get onBookmarkClick(): (e: import("../types.js").FloorPlanBookmarkClickEvent) => void;
|
|
143
|
+
get onVisitedClick(): (e: import("../types.js").FloorPlanVisitedClickEvent) => void;
|
|
144
|
+
get onCategoryClick(): (e: import("../types.js").FloorPlanCategory) => void;
|
|
145
|
+
get onDirection(): (e: import("../types.js").FloorPlanDirectionEvent | null) => void;
|
|
146
|
+
get onDetails(): (e: import("../types.js").FloorPlanDetailsEvent) => void;
|
|
147
|
+
get onExhibitorCustomButtonClick(): (e: import("../types.js").FloorPlanCustomButtonEvent) => void;
|
|
148
|
+
get onGetCoordsClick(): (e: import("../types.js").FloorPlanGetCoordsEvent) => void;
|
|
150
149
|
get selectedExhibitor(): Exhibitor | null;
|
|
151
150
|
get selectedBooth(): Booth | null;
|
|
152
151
|
get selectedCategory(): Category | null;
|
|
@@ -306,9 +305,21 @@ export default class UIState {
|
|
|
306
305
|
minUIScale: number;
|
|
307
306
|
maxUIScale: number;
|
|
308
307
|
setUIScale(scale: number | undefined, saveToStorage?: boolean): void;
|
|
308
|
+
/**
|
|
309
|
+
* Applies the UI scale a kiosk carries. Not on a phone: kiosk mode stays off there (see `kiosk`),
|
|
310
|
+
* and its scale with it.
|
|
311
|
+
*/
|
|
312
|
+
setKioskUIScale(scale: number | undefined, saveToStorage: boolean): void;
|
|
309
313
|
resetUIScale(): void;
|
|
310
314
|
/** Drops a scale applied without saving, back to the stored one (or the default). */
|
|
311
315
|
restoreUIScale(): void;
|
|
316
|
+
private kioskEnabled;
|
|
317
|
+
/**
|
|
318
|
+
* Kiosk mode. Never on for a phone ({@link isPhone}), whichever writer asks for it. A phone still
|
|
319
|
+
* shows the kiosk's marker, which follows `kioskData`.
|
|
320
|
+
*/
|
|
321
|
+
get kiosk(): boolean;
|
|
322
|
+
set kiosk(enabled: boolean);
|
|
312
323
|
setKioskModeEnabled: boolean;
|
|
313
324
|
enableSetKioskMode(enable: boolean): void;
|
|
314
325
|
kioskData: Kiosk | null;
|