@minmaps-dev/mm-web-sdk 1.0.0-rc.30 → 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.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +137 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.ts +59 -1
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/package.json +2 -2
- package/src/themes/alt3-hybrid-style.json +135 -48
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
|
|
@@ -161,6 +165,23 @@ interface POISearchResult {
|
|
|
161
165
|
matchedFields: string[];
|
|
162
166
|
}
|
|
163
167
|
|
|
168
|
+
/**
|
|
169
|
+
* A Zone is a CMS-authored department category — a named, colored grouping
|
|
170
|
+
* (e.g. "Cardiology", "Surgical", "Admin"). Zones are venue-wide (not
|
|
171
|
+
* floor-scoped) in the JACS `/all` payload and carry no geometry of their own;
|
|
172
|
+
* their spatial footprint is derived from the waypoints that reference them
|
|
173
|
+
* (`waypoint.zoneId`), which lets the SDK color-code the room/unit polygons a
|
|
174
|
+
* zone covers. See `map/zones.ts` for the derivation.
|
|
175
|
+
*/
|
|
176
|
+
interface Zone {
|
|
177
|
+
id: number;
|
|
178
|
+
name: string;
|
|
179
|
+
/** Authored hex color (e.g. "#d32f2f"); may be empty when the author
|
|
180
|
+
* hasn't picked one — such zones are skipped for color-coding. */
|
|
181
|
+
color: string;
|
|
182
|
+
description?: string;
|
|
183
|
+
}
|
|
184
|
+
|
|
164
185
|
/** Captured camera state (center, zoom, pitch, bearing) */
|
|
165
186
|
type CameraState = {
|
|
166
187
|
center: [number, number];
|
|
@@ -260,6 +281,10 @@ type ArriveStep = StepBase & {
|
|
|
260
281
|
interface MapEvent {
|
|
261
282
|
floor?: Floor;
|
|
262
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[];
|
|
263
288
|
coordinates?: [number, number];
|
|
264
289
|
error?: any;
|
|
265
290
|
venue?: any;
|
|
@@ -354,6 +379,12 @@ interface SDKOptions {
|
|
|
354
379
|
enableInteractions?: boolean;
|
|
355
380
|
customSprite?: string;
|
|
356
381
|
minIndoorZoom?: number;
|
|
382
|
+
/**
|
|
383
|
+
* Interior unit-wall thickness in feet (default 1). Each wall is built by
|
|
384
|
+
* insetting a ring into each unit by `wallThickness / 2`, so adjacent units
|
|
385
|
+
* share a wall (their rings abut at the common edge). Floored at 0.5 — a
|
|
386
|
+
* thinner value collapses the negative buffer and drops the wall.
|
|
387
|
+
*/
|
|
357
388
|
wallThickness?: number;
|
|
358
389
|
boundsPadding?: BoundsPadding;
|
|
359
390
|
/**
|
|
@@ -526,7 +557,42 @@ declare class MinuteMaps {
|
|
|
526
557
|
private amenityManager;
|
|
527
558
|
private wayfinding;
|
|
528
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;
|
|
529
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;
|
|
530
596
|
/** Categorical POI layers in the bundled theme that `setPOIFilter`
|
|
531
597
|
* toggles. Layers absent from this list — `poi-you-are-here-*`, the
|
|
532
598
|
* `poi-accessibility-icons` badge, and the `poi-highlight-*` layers —
|
|
@@ -618,6 +684,31 @@ declare class MinuteMaps {
|
|
|
618
684
|
getCurrentFloor(): Floor | null;
|
|
619
685
|
getDefaultFloor(): Floor | null;
|
|
620
686
|
getDestinations(floor?: Floor): Destination[];
|
|
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;
|
|
621
712
|
getPolygonLayers(): any[];
|
|
622
713
|
getFloorMapTemplate3d(floorId: string | number): any[];
|
|
623
714
|
getAllPOIs(floor?: Floor): POI[];
|
|
@@ -753,8 +844,52 @@ declare class MinuteMaps {
|
|
|
753
844
|
* it lives on another one. Pass a POI / amenity / destination id.
|
|
754
845
|
*/
|
|
755
846
|
highlightPOI(id: string | number): Promise<void>;
|
|
756
|
-
/** 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. */
|
|
757
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;
|
|
758
893
|
/**
|
|
759
894
|
* Show only the named POI categories on the map. Pass `['amenity']` to
|
|
760
895
|
* emphasize amenities (e.g. while an Amenities drawer is open) — destination
|
|
@@ -901,4 +1036,4 @@ declare function groupStepsIntoFloorSections(steps: WayfindStep[]): RouteFloorSe
|
|
|
901
1036
|
declare function activeSectionIndex(sections: RouteFloorSection[], activeStepIndex: number): number;
|
|
902
1037
|
|
|
903
1038
|
export { MinuteMaps, activeSectionIndex, createMinuteMapsSDK, groupStepsIntoFloorSections };
|
|
904
|
-
export type { Amenity, AmenityBadgeStyle, AmenityWithFloor, Bounds, BoundsPadding, CameraState, Destination, DestinationChipStyle, EventCallback, Floor, FloorMetadata, JMapAuth, JMapConfig, JacsAuth, JacsConfig, MapEvent, POI, POISearchResult, RouteFloorSection, RoutePoint, RoutingOptions, SDKConfig, SDKOptions, ThemeName, TransitionStep, ViewOptions, WayfindCenterMode, WayfindStep, Waypoint };
|
|
1039
|
+
export type { Amenity, AmenityBadgeStyle, AmenityWithFloor, Bounds, BoundsPadding, CameraState, Destination, DestinationChipStyle, EventCallback, Floor, FloorMetadata, JMapAuth, JMapConfig, JacsAuth, JacsConfig, MapEvent, POI, POISearchResult, RouteFloorSection, RoutePoint, RoutingOptions, SDKConfig, SDKOptions, ThemeName, TransitionStep, ViewOptions, WayfindCenterMode, WayfindStep, Waypoint, Zone };
|