@minmaps-dev/mm-web-sdk 1.0.0-rc.31 → 1.0.0-rc.32

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/index.d.ts CHANGED
@@ -142,6 +142,10 @@ interface Waypoint {
142
142
  floorId?: string | number;
143
143
  /** Whether this is the primary/default waypoint */
144
144
  isPrimary?: boolean;
145
+ /** CMS zone (department) this waypoint belongs to, if any. The only backend
146
+ * link between a location and its department — read at runtime across the
147
+ * data provider (see the package CLAUDE.md zone landmine). */
148
+ zoneId?: string | number;
145
149
  }
146
150
  /**
147
151
  * Amenity enriched with the floor it belongs to
@@ -277,6 +281,10 @@ type ArriveStep = StepBase & {
277
281
  interface MapEvent {
278
282
  floor?: Floor;
279
283
  poi?: POI;
284
+ /** All POIs co-located at a clicked point (overlapping pins / a shared
285
+ * suite). Emitted by `poiSelected`; length ≥ 1, and `poi` mirrors
286
+ * `pois[0]` for single-POI consumers. */
287
+ pois?: POI[];
280
288
  coordinates?: [number, number];
281
289
  error?: any;
282
290
  venue?: any;
@@ -549,7 +557,42 @@ declare class MinuteMaps {
549
557
  private amenityManager;
550
558
  private wayfinding;
551
559
  private highlightManager;
560
+ private selectionManager;
561
+ /** Captured unit paint values to restore when the selection clears, or
562
+ * `null` when no room is currently focused. See `UNIT_DIM_TARGETS`. */
563
+ private unitDimRestore;
564
+ /** Captured destination-layer filters to restore when the selection clears,
565
+ * or `null` when no destination focus is active. See `setDestinationFocus`. */
566
+ private destFocusRestore;
552
567
  private youAreHerePulse;
568
+ /** Theme layers whose features represent a tappable destination/amenity.
569
+ * A click hit-tests these (see `SelectionManager`) → `poiSelected`. The
570
+ * "You are here" anchor and the transient highlight layers are excluded;
571
+ * a POI drawn across the circle/label/icon layers is de-duped downstream
572
+ * in `resolveClickedPOIs`. */
573
+ private static readonly CLICKABLE_POI_LAYERS;
574
+ /** Room-body layers that are also tappable: a click on a `Units` polygon
575
+ * resolves to the destination pin inside it (see `resolvePOIsFromFeatures`).
576
+ * Queried alongside the pin layers so tapping the room or its dot behaves
577
+ * identically. Kept separate from the pin list because these carry no POI
578
+ * identity of their own — they resolve spatially. */
579
+ private static readonly CLICKABLE_UNIT_LAYERS;
580
+ /** While a room is selected, the other units are recolored to a flat, muted
581
+ * gray so the raised, full-strength highlight block reads as the focus. We
582
+ * recolor rather than lower opacity on purpose: translucent extrusions blend
583
+ * through their neighbours and look murky. The blocks stay fully opaque (and
584
+ * keep their vertical-gradient shading, so they still read as rooms) — just
585
+ * colorless. The selected room's own base grays too, but its highlight cap
586
+ * sits opaque and taller on top, so it still stands out. The original paint
587
+ * value (the data-driven color expression) is captured at mute time and put
588
+ * back on `clearHighlight`, so department tinting returns intact. */
589
+ private static readonly UNIT_DIM_TARGETS;
590
+ /** Destination marker layers hidden down to just the selected destination
591
+ * while a room is focused, so the map declutters to the one place in view.
592
+ * Amenity/connector layers (`poiType: 'amenity'`), the "you are here" anchor,
593
+ * and room name labels (`map-labels`) are deliberately absent — they stay
594
+ * visible as wayfinding reference. Restored on `clearHighlight`. */
595
+ private static readonly DESTINATION_FOCUS_LAYERS;
553
596
  /** Categorical POI layers in the bundled theme that `setPOIFilter`
554
597
  * toggles. Layers absent from this list — `poi-you-are-here-*`, the
555
598
  * `poi-accessibility-icons` badge, and the `poi-highlight-*` layers —
@@ -642,6 +685,30 @@ declare class MinuteMaps {
642
685
  getDefaultFloor(): Floor | null;
643
686
  getDestinations(floor?: Floor): Destination[];
644
687
  getZones(): Zone[];
688
+ /** The department (zone) a POI belongs to, resolved via its waypoint's
689
+ * `zoneId` — the only backend link between a location and a department
690
+ * (see the zone landmine in the package CLAUDE.md). `null` when the POI
691
+ * has no waypoint, no zone, or the zone id is unknown. */
692
+ getZoneForPOI(poi: POI): Zone | null;
693
+ /** Human-readable detail fields for a POI info popover. Only surfaces
694
+ * fields that exist on the current data — `category`, `floorName`,
695
+ * `zoneName`, `keywords`, and `description` are each omitted when absent.
696
+ * Keeps the display-field derivation (incl. the zone lookup) in the SDK
697
+ * so consumers stay thin. */
698
+ getPOIDetails(poi: POI): {
699
+ name: string;
700
+ type: 'amenity' | 'destination' | 'kiosk';
701
+ category?: string;
702
+ floorName?: string;
703
+ zoneName?: string;
704
+ zoneDescription?: string;
705
+ keywords?: string[];
706
+ description?: string;
707
+ };
708
+ /** Resolve the source Destination/Amenity record backing a rendered POI,
709
+ * for detail fields (category, localized description) that don't live on
710
+ * the built POI object. */
711
+ private getSourceEntity;
645
712
  getPolygonLayers(): any[];
646
713
  getFloorMapTemplate3d(floorId: string | number): any[];
647
714
  getAllPOIs(floor?: Floor): POI[];
@@ -777,8 +844,52 @@ declare class MinuteMaps {
777
844
  * it lives on another one. Pass a POI / amenity / destination id.
778
845
  */
779
846
  highlightPOI(id: string | number): Promise<void>;
780
- /** Remove the POI highlight set by `highlightPOI`. */
847
+ /** Remove the POI highlight set by `highlightPOI`, un-dim the other units,
848
+ * and bring back the destination markers hidden by a room selection. */
781
849
  clearHighlight(): void;
850
+ /** Map a click's raw feature hits to the full, de-duplicated POIs at that
851
+ * point (see `resolvePOIsFromFeatures`). Injected into `SelectionManager`.
852
+ * `getAllPOIs()` is the current floor's rendered POIs — the only clickable
853
+ * ones — and carries each POI's `waypoint`, needed for directions. */
854
+ private resolveClickedPOIs;
855
+ /** Emit `poiSelected` for the co-located POIs at a clicked point. Focuses the
856
+ * selection in place (no recenter — the user already sees where they
857
+ * tapped): rings the tapped dot and, when the tap landed in a room, raises
858
+ * that room as a highlighted block so the eye goes to the selected unit.
859
+ * `clearHighlight` removes both. `poi` mirrors `pois[0]` for single-POI
860
+ * consumers. */
861
+ private emitPoiSelected;
862
+ /**
863
+ * Build the room-highlight payload for a selection. The colour comes from the
864
+ * *clicked* feature (the rendered truth), but the geometry comes from the
865
+ * floor's full source polygon — the clicked feature is from
866
+ * `queryRenderedFeatures`, whose geometry is clipped to on-screen tiles, so
867
+ * highlighting it directly would leave any off-screen part of the room grey
868
+ * (its base extrusion is muted). Falls back to the clipped geometry if the
869
+ * full polygon can't be found. Returns `null` for a pin with no room.
870
+ */
871
+ private unitHighlightFor;
872
+ /** The full, unclipped `Units` polygon on the current floor that contains
873
+ * `coord`, straight from the floor source (not the tile-clipped render). */
874
+ private fullUnitPolygonAt;
875
+ /**
876
+ * Hide every destination marker except the given ids (pass `null` to
877
+ * restore all). Narrows each destination layer's own filter with an id
878
+ * allow-list; amenity/connector/"you are here" layers are untouched, so they
879
+ * stay on the map as reference. Captures the original filters once and puts
880
+ * them back verbatim, so the layers' base rules (poiType, showLabel, iconId)
881
+ * survive.
882
+ */
883
+ private setDestinationFocus;
884
+ /** Gentle pan so the selection sits in the centre of the map area MapLibre
885
+ * frames within `boundsPadding` (which the consumer sets to reserve for its
886
+ * bottom-docked chrome / info card). A straight `easeTo`, current zoom kept,
887
+ * so it reads as a nudge, not a recenter. */
888
+ private easeToSelection;
889
+ /** Dim every unit's paint (or restore it) so a selected room reads as the
890
+ * focus. Idempotent: capturing only happens on the first activate, and the
891
+ * captured originals are put back verbatim on deactivate. */
892
+ private setUnitFocusDim;
782
893
  /**
783
894
  * Show only the named POI categories on the map. Pass `['amenity']` to
784
895
  * emphasize amenities (e.g. while an Amenities drawer is open) — destination