@expofp/floorplan 3.24.2 → 3.24.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/browser/{Button-CT9Bti9C.js → Button-p01mffmV.js} +5 -5
  2. package/dist/browser/{CookieConsent-BUaaCjVv.js → CookieConsent-BF8pB73I.js} +7 -7
  3. package/dist/browser/{Debug-CuT7wVcD.js → Debug-B5hyechZ.js} +7 -7
  4. package/dist/browser/{Demo-CypZUOYb.js → Demo-knBpWccU.js} +9 -9
  5. package/dist/browser/{Free-Cpbw3FP6.js → Free-CMDOPW7B.js} +9 -9
  6. package/dist/browser/{GalleryContainer-DX9JoE1-.js → GalleryContainer-Ba7QRGqJ.js} +10 -10
  7. package/dist/browser/{GpsLoader-BMBhGhOH.js → GpsLoader-DOOP_ASm.js} +10 -10
  8. package/dist/browser/{KioskStore-BKn-AB-4.js → KioskStore-IZgF3XDx.js} +4 -4
  9. package/dist/browser/{MaplibreAdapter-C7PhujTO.js → MaplibreAdapter-BfUqF5P9.js} +292 -245
  10. package/dist/browser/{ModalContainer-Bwo9p8q9.js → ModalContainer-MRMe33uV.js} +10 -10
  11. package/dist/browser/{PermissionNotice-Dyrq3hyS.js → PermissionNotice-DB5Ift9m.js} +6 -6
  12. package/dist/browser/{SetKioskMode-CcoLQ3g5.js → SetKioskMode-Bg4_U0Ov.js} +8 -8
  13. package/dist/browser/{ShowKiosk-1PcWb3Yn.js → ShowKiosk-_EK6VmAV.js} +10 -10
  14. package/dist/browser/{ViewerMenuPanel-CF8_jUkV.js → ViewerMenuPanel-BostqgVg.js} +9 -9
  15. package/dist/browser/{add-debug-secret-listener-DtSLeszR.js → add-debug-secret-listener-ivErN3mk.js} +1 -1
  16. package/dist/browser/{adopt-global-settings-jN08Mvz2.js → adopt-global-settings-B6w6CagP.js} +9 -9
  17. package/dist/browser/{boolean-editor-BbQkdkV8.js → boolean-editor-CUGJZwH-.js} +9 -9
  18. package/dist/browser/{bootIntercom-tmWxI34Q.js → bootIntercom-D-rZAhCK.js} +2 -2
  19. package/dist/browser/{booth-by-xy-Bn7vAiW7.js → booth-by-xy-DzhIUI-Q.js} +6 -6
  20. package/dist/browser/bundle.json +65 -65
  21. package/dist/browser/{classnames-z85nK_ce.js → classnames-9nzeif8D.js} +2 -2
  22. package/dist/browser/{client-BzyumV4c.js → client-BsLcgFfO.js} +4 -4
  23. package/dist/browser/{components-tvzV2Bmo.js → components-By6WCr5d.js} +36 -36
  24. package/dist/browser/{debug-overlay-C3yeye6L.js → debug-overlay-D6b9zd48.js} +10 -10
  25. package/dist/browser/{debug-ui-CVhF-KaS.js → debug-ui-Da7wcC3i.js} +6 -6
  26. package/dist/browser/{dist-4gxnxibz.js → dist-BvZjZCdR.js} +3 -3
  27. package/dist/browser/{dist-DhmiIFdt.js → dist-DhzSPs9e.js} +6 -6
  28. package/dist/browser/{dist-BvldLH3X.js → dist-E6y2lqRa.js} +5 -5
  29. package/dist/browser/{efp-debug-init-XDZpnwBR.js → efp-debug-init-4LtPCUPY.js} +3 -3
  30. package/dist/browser/{enum-editor-CO0TOOg_.js → enum-editor-BghDWgeO.js} +4 -4
  31. package/dist/browser/{es5-BONrcV9Q.js → es5-B1foSeGv.js} +2 -2
  32. package/dist/browser/{event-not-found-BNlgAobh.js → event-not-found-CEyhr6Cq.js} +1 -1
  33. package/dist/browser/{exports-CahN8vwa.js → exports-BeSO266J.js} +1 -1
  34. package/dist/browser/{favicon-BEwJyQw4.js → favicon-CWf1ojn0.js} +1 -1
  35. package/dist/browser/{fetch-retry.umd-BvmmPMO4.js → fetch-retry.umd-CWgAWfkB.js} +2 -2
  36. package/dist/browser/{flex-Bhy5-dRM.js → flex-C64hUG-Y.js} +5 -5
  37. package/dist/browser/{floorplan.loader-Bm0C_zg8.js → floorplan.loader-BF29NpFQ.js} +10 -10
  38. package/dist/browser/{floorplan.ready-DHOYde8O.js → floorplan.ready-ByvBX6zB.js} +14 -14
  39. package/dist/browser/{fuse-BjPDB9cu.js → fuse-B9jyODVz.js} +2 -2
  40. package/dist/browser/{i18n-Bsa4AB8X.js → i18n-CyXUWmbq.js} +5 -5
  41. package/dist/browser/index.js +14 -14
  42. package/dist/browser/{index.module-DkCBvLVi.js → index.module-DlRMnP0h.js} +4 -4
  43. package/dist/browser/{integrateKiosk-BCZ-cnik.js → integrateKiosk-CqDd_6zK.js} +4 -4
  44. package/dist/browser/{is-webview-BAAplPh1.js → is-webview-nZTrftS3.js} +1 -1
  45. package/dist/browser/{jsx-runtime-DkDpaV-S.js → jsx-runtime-BvehpqN1.js} +2 -2
  46. package/dist/browser/{kiosk-record-x3W__3xS.js → kiosk-record-3zDMdFbA.js} +1 -1
  47. package/dist/browser/{lib-BpicJGKy.js → lib-BWguER4h.js} +3 -3
  48. package/dist/browser/{loadImage-4_-hyOhx.js → loadImage-DlTxF7hO.js} +4 -4
  49. package/dist/browser/{logDeviceInfo-ChUkf64r.js → logDeviceInfo-DkyoRXga.js} +9 -9
  50. package/dist/browser/{main-CD7xHGU2.js → main-CQISrN-R.js} +1 -1
  51. package/dist/browser/{mobx-BKpyIsVh.js → mobx-CclSjvoG.js} +4 -4
  52. package/dist/browser/{optional-boolean-editor-B4R2CbJ8.js → optional-boolean-editor-DQzKDlOi.js} +3 -3
  53. package/dist/browser/{optional-enum-editor-ChNfPhsB.js → optional-enum-editor-BoXlfU-Z.js} +4 -4
  54. package/dist/browser/{optional-string-editor-D8tXuwta.js → optional-string-editor-D5dIax4i.js} +4 -4
  55. package/dist/browser/{particles.min-FpEw6-hB.js → particles.min-D9wmJdXA.js} +2 -2
  56. package/dist/browser/{react-Q3vwxMD4.js → react-6tMZPkhI.js} +2 -2
  57. package/dist/browser/{react-dom-CwvsoFuP.js → react-dom-CutFn8wf.js} +3 -3
  58. package/dist/browser/{rolldown-runtime-D85GpSbU.js → rolldown-runtime-dRo6A-vE.js} +1 -1
  59. package/dist/browser/{select-IG7dubaJ.js → select-WMTRp4v8.js} +10 -10
  60. package/dist/browser/{settings-DmxMI46b.js → settings-DUe5ncnN.js} +2 -2
  61. package/dist/browser/{settings-item-yCIWkzxL.js → settings-item-COWlJF9-.js} +6 -6
  62. package/dist/browser/{store-lvPK1tXK.js → store-B0pIa2x7.js} +11 -11
  63. package/dist/browser/{string-editor-HCbCYvjk.js → string-editor-oB_Qkp2m.js} +4 -4
  64. package/dist/browser/{text-field-ZCkMcWLU.js → text-field-eEQqOs7Q.js} +5 -5
  65. package/dist/browser/{theme-BwOMq2a4.js → theme-BLk06fsq.js} +8 -8
  66. package/dist/browser/{ui-CxwXSxPR.js → ui-DCurqY1Z.js} +8 -8
  67. package/dist/browser/{useRenderTarget-D3FPy6Mq.js → useRenderTarget-BuFH1LJK.js} +4 -4
  68. package/dist/esm/components/Maplibre/MaplibreWrapper.d.ts +6 -0
  69. package/dist/esm/components/Maplibre/MaplibreWrapper.js +1 -1
  70. package/dist/esm/components/Maplibre/utils/map-helpers.js +1 -1
  71. package/dist/esm/components/Maplibre/utils/pmtiles-range-fallback.d.ts +53 -0
  72. package/dist/esm/components/Maplibre/utils/pmtiles-range-fallback.js +1 -0
  73. package/dist/esm/components/Maplibre/utils/resolve-map-style.d.ts +1 -1
  74. package/dist/esm/components/Maplibre/utils/resolve-map-style.js +1 -1
  75. package/package.json +9 -9
@@ -10,6 +10,12 @@ export declare const MAP_DIM_LAYER_ID = "expofp-map-dim";
10
10
  export interface TileSourceConfig {
11
11
  /** Maplibre style URL or inline style JSON object */
12
12
  style: string | StyleSpecification;
13
+ /**
14
+ * The style and everything it references ship inside the plan archive. Local
15
+ * hosts serve those files themselves, so PMTiles archives get a source that
16
+ * tolerates a host without Range support.
17
+ */
18
+ offline?: boolean;
13
19
  }
14
20
  export interface CameraPaddingOptions {
15
21
  top: number;
@@ -1 +1 @@
1
- import{jsx as B}from"react/jsx-runtime";import"maplibre-gl/dist/maplibre-gl.css";import{Renderer as N}from"@expofp/renderer";import{addProtocol as G,Map as Y}from"maplibre-gl";import{Protocol as k}from"pmtiles";import{useEffect as E,useRef as l}from"react";import{createStyleTransform as q}from"./utils/resolve-map-style";import{createUpdatePump as H}from"./utils/update-pump";export const MAP_DIM_LAYER_ID="expofp-map-dim";const y="expofp-map-dim-source",J="3d-expofp";let g=null;const Q=["coalesce",["get","name:en"],["get","name_en"],["get","name:latin"],["get","name"]],V={type:"Feature",geometry:{type:"Polygon",coordinates:[[[-180,-85],[180,-85],[180,85],[-180,85],[-180,-85]]]},properties:{}};function I(e){if(!e||typeof e!="object")return!1;const r=e.length;if(typeof r!="number"||r<16)return!1;const o=e[0];return typeof o=="number"&&Number.isFinite(o)}function W(e){if(I(e))return Array.from(e);const o=e?.defaultProjectionData?.mainMatrix;return I(o)?Array.from(o):(console.warn("Maplibre custom layer received an unsupported projection matrix payload.",e),null)}function b(e){return typeof e=="string"?e.includes("name"):Array.isArray(e)?e.some(r=>b(r)):!e||typeof e!="object"?!1:Object.values(e).some(r=>b(r))}function X(e){return e.type!=="symbol"||!e.id||!e.layout?!1:b(e.layout["text-field"])}function K(e){const r=e.getStyle();for(const o of r.layers??[])X(o)&&e.setLayoutProperty(o.id,"text-field",Q)}function $(){if(!g){g=new k;try{G("pmtiles",g.tile)}catch(e){console.warn("Maplibre PMTiles protocol registration failed.",e)}}}export default function v({sceneDef:e,geoConfig:r,staticTransform:o,tileSource:w,mapOptions:O,onRendererReady:h,onMapDimLayerReady:x,onMapLoadError:M}){const d=l(null),P=l(null),a=l(null),L=l(h),S=l(x),_=l(M),C=l({sceneDef:e,geoConfig:r,staticTransform:o,tileSource:w,mapOptions:O});return E(()=>{L.current=h,S.current=x,_.current=M}),E(()=>{if(!d.current)return;const{sceneDef:m,geoConfig:n,staticTransform:F,tileSource:A,mapOptions:f}=C.current;let p=!1;const u={...m};u.rootLayer={...m.rootLayer};const T=m.rootLayer.children;u.rootLayer.children=T.filter(i=>i?.name?.toString().toLowerCase()!=="areamap"),u.background=void 0,u.staticTransform=F,$();const z=n.bounds?{bounds:n.bounds,fitBoundsOptions:{padding:n.fitPadding,bearing:n.bearing}}:{center:n.center,zoom:n.zoom},j=q(A.style),t=new Y({container:d.current,...z,bearing:n.bearing,pitch:f?.pitch??30,maxPitch:f?.maxPitch??70,minZoom:f?.minZoom,maxZoom:f?.maxZoom,maxBounds:f?.maxBounds,bearingSnap:0,canvasContextAttributes:{antialias:!0}});n.zoomAdjustment&&t.jumpTo({zoom:t.getZoom()+n.zoomAdjustment}),P.current=t,t.once("error",i=>{t.isStyleLoaded()||_.current?.(i?.error??i)});const R=i=>{const s=i?.id;!s||t.hasImage(s)||t.addImage(s,{width:1,height:1,data:new Uint8Array(4)})};t.on("styleimagemissing",R);const U=H({requestFrame:()=>t.triggerRepaint()}),Z={id:J,type:"custom",renderingMode:"3d",onAdd(i,s){if(p)return;const c=new N({canvas:t.getCanvas(),gl:s});if(p){c.dispose();return}c.init(u),a.current=c,L.current?.(c,t,u,()=>t.triggerRepaint())},render(i,s){if(!a.current||a.current.isDisposed)return;const c=W(s??i);c&&(a.current.render(c),U(a.current))}},D=()=>{K(t),t.getSource(y)||t.addSource(y,{type:"geojson",data:V}),t.getLayer(MAP_DIM_LAYER_ID)||t.addLayer({id:MAP_DIM_LAYER_ID,type:"fill",source:y,paint:{"fill-color":"#000000","fill-opacity":0,"fill-opacity-transition":{duration:0,delay:0}}}),S.current?.(t),t.addLayer(Z)};return t.on("style.load",D),t.setStyle(A.style,j?{transformStyle:j}:void 0),()=>{p=!0,t.off("style.load",D),t.off("styleimagemissing",R),a.current?.dispose(),a.current=null,t.remove(),P.current=null}},[]),B("div",{ref:d,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"}})}
1
+ import{jsx as N}from"react/jsx-runtime";import"maplibre-gl/dist/maplibre-gl.css";import{Renderer as G}from"@expofp/renderer";import{addProtocol as Y,Map as k}from"maplibre-gl";import{Protocol as q}from"pmtiles";import{useEffect as E,useRef as l}from"react";import{registerPmtilesArchive as H}from"./utils/pmtiles-range-fallback";import{createStyleTransform as J}from"./utils/resolve-map-style";import{createUpdatePump as Q}from"./utils/update-pump";export const MAP_DIM_LAYER_ID="expofp-map-dim";const g="expofp-map-dim-source",V="3d-expofp";let b=null;const W=["coalesce",["get","name:en"],["get","name_en"],["get","name:latin"],["get","name"]],X={type:"Feature",geometry:{type:"Polygon",coordinates:[[[-180,-85],[180,-85],[180,85],[-180,85],[-180,-85]]]},properties:{}};function I(e){if(!e||typeof e!="object")return!1;const r=e.length;if(typeof r!="number"||r<16)return!1;const n=e[0];return typeof n=="number"&&Number.isFinite(n)}function K(e){if(I(e))return Array.from(e);const n=e?.defaultProjectionData?.mainMatrix;return I(n)?Array.from(n):(console.warn("Maplibre custom layer received an unsupported projection matrix payload.",e),null)}function h(e){return typeof e=="string"?e.includes("name"):Array.isArray(e)?e.some(r=>h(r)):!e||typeof e!="object"?!1:Object.values(e).some(r=>h(r))}function $(e){return e.type!=="symbol"||!e.id||!e.layout?!1:h(e.layout["text-field"])}function v(e){const r=e.getStyle();for(const n of r.layers??[])$(n)&&e.setLayoutProperty(n.id,"text-field",W)}function ee(){if(b)return b;const e=new q;b=e;try{Y("pmtiles",e.tile)}catch(r){console.warn("Maplibre PMTiles protocol registration failed.",r)}return e}export default function te({sceneDef:e,geoConfig:r,staticTransform:n,tileSource:w,mapOptions:O,onRendererReady:x,onMapDimLayerReady:P,onMapLoadError:M}){const m=l(null),L=l(null),a=l(null),S=l(x),A=l(P),_=l(M),C=l({sceneDef:e,geoConfig:r,staticTransform:n,tileSource:w,mapOptions:O});return E(()=>{S.current=x,A.current=P,_.current=M}),E(()=>{if(!m.current)return;const{sceneDef:d,geoConfig:i,staticTransform:F,tileSource:p,mapOptions:f}=C.current;let y=!1;const u={...d};u.rootLayer={...d.rootLayer};const T=d.rootLayer.children;u.rootLayer.children=T.filter(o=>o?.name?.toString().toLowerCase()!=="areamap"),u.background=void 0,u.staticTransform=F;const z=ee(),U=i.bounds?{bounds:i.bounds,fitBoundsOptions:{padding:i.fitPadding,bearing:i.bearing}}:{center:i.center,zoom:i.zoom},j=J(p.style,p.offline?o=>H(z,o):void 0),t=new k({container:m.current,...U,bearing:i.bearing,pitch:f?.pitch??30,maxPitch:f?.maxPitch??70,minZoom:f?.minZoom,maxZoom:f?.maxZoom,maxBounds:f?.maxBounds,bearingSnap:0,canvasContextAttributes:{antialias:!0}});i.zoomAdjustment&&t.jumpTo({zoom:t.getZoom()+i.zoomAdjustment}),L.current=t,t.once("error",o=>{t.isStyleLoaded()||_.current?.(o?.error??o)});const R=o=>{const s=o?.id;!s||t.hasImage(s)||t.addImage(s,{width:1,height:1,data:new Uint8Array(4)})};t.on("styleimagemissing",R);const Z=Q({requestFrame:()=>t.triggerRepaint()}),B={id:V,type:"custom",renderingMode:"3d",onAdd(o,s){if(y)return;const c=new G({canvas:t.getCanvas(),gl:s});if(y){c.dispose();return}c.init(u),a.current=c,S.current?.(c,t,u,()=>t.triggerRepaint())},render(o,s){if(!a.current||a.current.isDisposed)return;const c=K(s??o);c&&(a.current.render(c),Z(a.current))}},D=()=>{v(t),t.getSource(g)||t.addSource(g,{type:"geojson",data:X}),t.getLayer(MAP_DIM_LAYER_ID)||t.addLayer({id:MAP_DIM_LAYER_ID,type:"fill",source:g,paint:{"fill-color":"#000000","fill-opacity":0,"fill-opacity-transition":{duration:0,delay:0}}}),A.current?.(t),t.addLayer(B)};return t.on("style.load",D),t.setStyle(p.style,j?{transformStyle:j}:void 0),()=>{y=!0,t.off("style.load",D),t.off("styleimagemissing",R),a.current?.dispose(),a.current=null,t.remove(),L.current=null}},[]),N("div",{ref:m,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"}})}
@@ -1 +1 @@
1
- import{fpGeo as u}from"../../../data/fpGeo.js";import a from"../../../store/index.js";import m from"../../../tools/settings.js";import{MAP_DIM_LAYER_ID as s}from"../MaplibreWrapper.js";import{resolveMapTheme as f}from"./map-theme.js";export const LIGHT_TILE_SOURCE={style:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json"},DARK_TILE_SOURCE={style:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"};const c=12;export const DEFAULT_MAP_OPTIONS={pitch:30,maxPitch:70,minZoom:c},MAP_2D_OPTIONS={pitch:0,maxPitch:0,minZoom:c};export function applyMapDimValue(t,e){t?.getLayer(s)&&(t.setPaintProperty(s,"fill-opacity",p(e)),t.triggerRepaint())}function p(t){return Math.min(Math.max(t,0),1)}export function applyMapOptions(t,e,n=!1){if(!t)return;t.setMinZoom(e.minZoom??null),t.setMaxZoom(e.maxZoom??null),t.setMaxBounds(e.maxBounds??null);const o=e.pitch,r=e.maxPitch,l=t.getPitch(),i=!!(n&&o!=null&&r!=null&&r<l);r!=null&&!i&&t.setMaxPitch(e.maxPitch),!(o==null||l===o)&&(n?(t.easeTo({pitch:o,duration:300}),i&&t.once("moveend",()=>t.setMaxPitch(r))):t.jumpTo({pitch:o}))}export function getTileSource(){const t=a.fp?.maplibre??window.__efpMaplibre;return t?.style?{style:t.style}:t?.styleUrl?{style:t.styleUrl}:f(u?.properties?.config?.style,m.backgroundColor)==="dark"?DARK_TILE_SOURCE:LIGHT_TILE_SOURCE}
1
+ import{fpGeo as f}from"../../../data/fpGeo.js";import u from"../../../store/index.js";import a from"../../../tools/settings.js";import{MAP_DIM_LAYER_ID as s}from"../MaplibreWrapper.js";import{resolveMapTheme as m}from"./map-theme.js";export const LIGHT_TILE_SOURCE={style:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json"},DARK_TILE_SOURCE={style:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"};const c=12;export const DEFAULT_MAP_OPTIONS={pitch:30,maxPitch:70,minZoom:c},MAP_2D_OPTIONS={pitch:0,maxPitch:0,minZoom:c};export function applyMapDimValue(t,e){t?.getLayer(s)&&(t.setPaintProperty(s,"fill-opacity",p(e)),t.triggerRepaint())}function p(t){return Math.min(Math.max(t,0),1)}export function applyMapOptions(t,e,n=!1){if(!t)return;t.setMinZoom(e.minZoom??null),t.setMaxZoom(e.maxZoom??null),t.setMaxBounds(e.maxBounds??null);const o=e.pitch,r=e.maxPitch,l=t.getPitch(),i=!!(n&&o!=null&&r!=null&&r<l);r!=null&&!i&&t.setMaxPitch(e.maxPitch),!(o==null||l===o)&&(n?(t.easeTo({pitch:o,duration:300}),i&&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}:m(f?.properties?.config?.style,a.backgroundColor)==="dark"?DARK_TILE_SOURCE:LIGHT_TILE_SOURCE}
@@ -0,0 +1,53 @@
1
+ import { type Protocol, type RangeResponse, type Source } from 'pmtiles';
2
+ /**
3
+ * A PMTiles source that also works against hosts which accept a `Range` header
4
+ * and then answer `200` with something other than the requested slice.
5
+ *
6
+ * The Android SDK serves offline archives through `WebViewAssetLoader`, whose
7
+ * path handlers never see request headers: Chromium applies the range's start
8
+ * offset to the file stream and then streams to EOF, answering `200` with a
9
+ * `Content-Length` that merely echoes the request. PMTiles' own guard compares
10
+ * that header against the requested length and so lets it through — every tile
11
+ * read then silently receives the rest of the archive instead of one tile,
12
+ * which decodes into a mostly blank basemap and no error anywhere.
13
+ *
14
+ * So probe once, at offset 0, and decide from the status:
15
+ *
16
+ * - `206` — a well-behaved host. Everything is delegated to {@link FetchSource},
17
+ * which keeps its 416 retry and ETag-mismatch handling intact.
18
+ * - `200` — the host ignored the range, which means the body it just returned
19
+ * *is* the archive from byte 0. Keep it and slice locally.
20
+ *
21
+ * The body is held as a `Blob` rather than an `ArrayBuffer` so the browser can
22
+ * back it with a temp file instead of the JS heap — an offline basemap runs to
23
+ * tens of megabytes and the SDK still has to survive older Android WebViews.
24
+ */
25
+ export declare class RangeTolerantSource implements Source {
26
+ private readonly url;
27
+ private readonly ranged;
28
+ /** Memoised probe: the whole archive, or `null` when ranges are honoured. */
29
+ private archive;
30
+ constructor(url: string);
31
+ getKey(): string;
32
+ getBytes(offset: number, length: number, signal?: AbortSignal, etag?: string): Promise<RangeResponse>;
33
+ /**
34
+ * Read the head of the archive and work out which kind of host this is.
35
+ *
36
+ * The probe deliberately ignores the caller's `AbortSignal`. It is memoised
37
+ * for the source's lifetime, so a first tile that gets cancelled mid-flight
38
+ * must not leave every later read awaiting a rejected promise.
39
+ */
40
+ private probe;
41
+ }
42
+ /**
43
+ * Point the protocol at {@link RangeTolerantSource} for one archive URL.
44
+ *
45
+ * Registering ahead of the first tile request is what makes this take effect:
46
+ * `Protocol` creates a plain {@link FetchSource} for any `pmtiles://` URL it
47
+ * has not already been given an instance for.
48
+ *
49
+ * Only string-URL styles are covered. An inline style object carries absolute
50
+ * URLs the SDK never resolves, so its PMTiles sources keep the stock source.
51
+ */
52
+ export declare function registerPmtilesArchive(protocol: Protocol, url: string): void;
53
+ //# sourceMappingURL=pmtiles-range-fallback.d.ts.map
@@ -0,0 +1 @@
1
+ import{FetchSource as s,PMTiles as u}from"pmtiles";const i=16384;export class RangeTolerantSource{constructor(r){this.url=r,this.ranged=new s(r)}getKey(){return this.url}async getBytes(r,n,t,o){this.archive||(this.archive=this.probe());const a=await this.archive;return a?(c(t),{data:await h(a.slice(r,r+n))}):this.ranged.getBytes(r,n,t,o)}async probe(){let r;try{r=await fetch(this.url,{headers:{Range:`bytes=0-${i-1}`}})}catch{return null}if(r.status!==200)return null;const n=await r.blob();return n.size===i?null:n}}export function registerPmtilesArchive(e,r){e.get(r)||e.add(new u(new RangeTolerantSource(r)))}function c(e){if(e?.aborted)throw e.reason??new DOMException("The operation was aborted.","AbortError")}async function h(e){return typeof e.arrayBuffer=="function"?e.arrayBuffer():new Promise((r,n)=>{const t=new FileReader;t.onload=()=>r(t.result),t.onerror=()=>n(t.error),t.readAsArrayBuffer(e)})}
@@ -11,5 +11,5 @@ import { type StyleSpecification, type TransformStyleFunction } from 'maplibre-g
11
11
  * Inline style objects have no style URL to resolve against; callers must pass
12
12
  * already-absolute internals for those.
13
13
  */
14
- export declare function createStyleTransform(style: string | StyleSpecification): TransformStyleFunction | undefined;
14
+ export declare function createStyleTransform(style: string | StyleSpecification, onPmtilesArchive?: (url: string) => void): TransformStyleFunction | undefined;
15
15
  //# sourceMappingURL=resolve-map-style.d.ts.map
@@ -1 +1 @@
1
- export function createStyleTransform(c){if(typeof c!="string")return;const p=new URL(c,window.location.href).href,o=i=>new URL(i,p).href.replace(/%7B/g,"{").replace(/%7D/g,"}"),l=i=>i.startsWith("pmtiles://")?`pmtiles://${o(i.slice(10))}`:o(i);return(i,u)=>{const e={...u};typeof e.sprite=="string"?e.sprite=o(e.sprite):Array.isArray(e.sprite)&&(e.sprite=e.sprite.map(t=>{if(!t||typeof t!="object")return t;const r=t;return typeof r.url!="string"?t:{...r,url:o(r.url)}})),typeof e.glyphs=="string"&&(e.glyphs=o(e.glyphs));const n=e.sources;if(n){e.sources={...n};for(const[t,r]of Object.entries(n)){if(!r||typeof r!="object")continue;const s={...r};typeof s.url=="string"&&(s.url=l(s.url)),Array.isArray(s.tiles)&&(s.tiles=s.tiles.map(f=>typeof f=="string"?l(f):f)),e.sources[t]=s}}return e}}
1
+ export function createStyleTransform(l,p){if(typeof l!="string")return;const y=new URL(l,window.location.href).href,o=i=>new URL(i,y).href.replace(/%7B/g,"{").replace(/%7D/g,"}"),u=i=>{if(!i.startsWith("pmtiles://"))return o(i);const n=o(i.slice(10));return p?.(n),`pmtiles://${n}`};return(i,n)=>{const e={...n};typeof e.sprite=="string"?e.sprite=o(e.sprite):Array.isArray(e.sprite)&&(e.sprite=e.sprite.map(r=>{if(!r||typeof r!="object")return r;const t=r;return typeof t.url!="string"?r:{...t,url:o(t.url)}})),typeof e.glyphs=="string"&&(e.glyphs=o(e.glyphs));const c=e.sources;if(c){e.sources={...c};for(const[r,t]of Object.entries(c)){if(!t||typeof t!="object")continue;const s={...t};typeof s.url=="string"&&(s.url=u(s.url)),Array.isArray(s.tiles)&&(s.tiles=s.tiles.map(f=>typeof f=="string"?u(f):f)),e.sources[r]=s}}return e}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expofp/floorplan",
3
- "version": "3.24.2",
3
+ "version": "3.24.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/expofp/efp-app.git",
@@ -70,14 +70,14 @@
70
70
  "tslib": "^2.3.0",
71
71
  "uuid": "^9.0.1",
72
72
  "zod": "4.4.3",
73
- "@expofp/config": "3.24.2",
74
- "@expofp/resolve": "3.24.2",
75
- "@expofp/schema": "3.24.2",
76
- "@expofp/geometry": "3.24.2",
77
- "@expofp/ui": "3.24.2",
78
- "@expofp/utils": "3.24.2",
79
- "@expofp/wayfinding": "3.24.2",
80
- "@expofp/debug": "3.24.2"
73
+ "@expofp/config": "3.24.3",
74
+ "@expofp/debug": "3.24.3",
75
+ "@expofp/geometry": "3.24.3",
76
+ "@expofp/resolve": "3.24.3",
77
+ "@expofp/schema": "3.24.3",
78
+ "@expofp/ui": "3.24.3",
79
+ "@expofp/utils": "3.24.3",
80
+ "@expofp/wayfinding": "3.24.3"
81
81
  },
82
82
  "devDependencies": {
83
83
  "@babel/plugin-proposal-decorators": "^8.0.2",