@minmaps-dev/mm-web-sdk 1.0.0-rc.5 → 1.0.0-rc.51

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/react.d.ts CHANGED
@@ -1,14 +1,350 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
 
3
+ interface POI {
4
+ /** Unique identifier */
5
+ id: string | number;
6
+ /** POI type */
7
+ type: 'amenity' | 'destination' | 'kiosk';
8
+ /** Display name */
9
+ name: string;
10
+ /** Geographic coordinates [longitude, latitude] */
11
+ coordinates: [number, number];
12
+ /** Icon identifier for rendering */
13
+ iconId?: string;
14
+ /** Whether this POI should render its label */
15
+ showLabel?: boolean;
16
+ /** Floor this POI belongs to */
17
+ floorId: string | number;
18
+ /** Category/type of amenity (e.g., 'restroom', 'elevator') */
19
+ amenityType?: string;
20
+ /** Locale-stable classification text (name + type + keywords, frozen at
21
+ * load before any locale patch can translate them). Copied from the
22
+ * source `Amenity.classifyText`; used by `amenityCategoryFor`/rank
23
+ * instead of the live, possibly-translated fields. See `Amenity.classifyText`. */
24
+ classifyText?: string;
25
+ /** Which amenity icon layer this POI renders in — `'connector'`,
26
+ * `'entrance'`, `'parking'`, `'bus'`, `'information'` or `'other'`.
27
+ * Derived from the amenity's connector flag, name, type and keywords;
28
+ * emitted as the `amenityCategory` feature property the theme filters on.
29
+ * Amenities only. See `amenityCategoryFor`. */
30
+ amenityCategory?: 'connector' | 'entrance' | 'parking' | 'bus' | 'information' | 'other';
31
+ /** Search keywords */
32
+ keywords?: string[];
33
+ /** Additional properties */
34
+ properties?: Record<string, unknown>;
35
+ /** JMap waypoint ID that this POI instance is bound to */
36
+ waypointId?: string | number;
37
+ /** Full waypoint object for this POI instance */
38
+ waypoint?: Waypoint;
39
+ /** Marks this POI as the "You are here" kiosk */
40
+ isYouAreHere?: boolean;
41
+ /** For kiosk POIs only: compass heading the device physically faces, in
42
+ * degrees clockwise from north. Sourced from JACS `Device.heading`. */
43
+ heading?: number | null;
44
+ /** Per-instance name for this specific placement of an amenity (e.g.
45
+ * "Parking Lot A" for a "Parking" amenity), resolved from the waypoint's
46
+ * `amenityAssociations`. Distinct from `name`, which is the amenity's
47
+ * type-level name shared by every instance — see `Amenity.name`. Amenities
48
+ * only, and only set when JACS actually returned an instance name. */
49
+ instanceName?: string;
50
+ }
51
+ /**
52
+ * Waypoint - a specific point location
53
+ */
54
+ interface Waypoint {
55
+ /** Geographic coordinates [longitude, latitude] */
56
+ coordinates: number[];
57
+ /** Associated map ID */
58
+ mapId: string | number;
59
+ /** Associated floor ID */
60
+ floorId?: string | number;
61
+ /** Whether this is the primary/default waypoint */
62
+ isPrimary?: boolean;
63
+ /** CMS zone (department) this waypoint belongs to, if any. The only backend
64
+ * link between a location and its department — read at runtime across the
65
+ * data provider (see the package CLAUDE.md zone landmine). */
66
+ zoneId?: string | number;
67
+ /** Per-instance names JACS attaches to this waypoint's amenities (e.g. a
68
+ * "Parking" amenity placed twice as "Parking Lot A" / "Parking Lot B").
69
+ * `id` matches an `Amenity.id`, not this waypoint — a waypoint can carry
70
+ * more than one amenity, so a consumer must find the entry for the
71
+ * specific amenity it's rendering rather than assuming index 0. */
72
+ amenityAssociations?: Array<{
73
+ id: string | number;
74
+ name: string;
75
+ }>;
76
+ }
77
+
78
+ /** SW/NE bounding box */
79
+ type Bounds = [[number, number], [number, number]];
80
+
81
+ /**
82
+ * Padding kept clear inside the viewport when the SDK frames bounds —
83
+ * the initial venue/floor fit and the wayfinding route fit. A plain
84
+ * number pads all sides equally; the object form lets a kiosk reserve
85
+ * space for fixed UI overlays (header, dock, side rails) so framed
86
+ * content is never hidden behind them.
87
+ */
88
+ type BoundsPadding = number | {
89
+ top: number;
90
+ bottom: number;
91
+ left: number;
92
+ right: number;
93
+ };
94
+ /**
95
+ * Built-in theme names accepted by `MinuteMaps.setTheme()` and the
96
+ * `options.theme` init option. Pass a `StyleSpecification` directly for
97
+ * custom themes.
98
+ */
99
+ type ThemeName = 'default' | 'high-contrast' | 'color-blind';
100
+ /**
101
+ * Style of the disc + ring rendered behind each amenity icon. The SDK
102
+ * composites this into the icon bitmap at registration time, so badge +
103
+ * icon participate in symbol collision as one unit.
104
+ */
105
+ type AmenityBadgeStyle = {
106
+ /** Fill colour of the badge disc. Default `'#fdb81e'`. */
107
+ color?: string;
108
+ /** Stroke colour of the ring around the disc. Default `'#FFFFFF'`. */
109
+ ringColor?: string;
110
+ /** Ring width in logical px. Default `2`. */
111
+ ringWidth?: number;
112
+ /** Extra inset between the icon and the badge's inner edge, in logical px
113
+ * (applied on all sides). Default `0` — the icon fills ~85% of the disc
114
+ * as before. Raise this if an icon's own artwork reaches close to its
115
+ * viewBox edges and ends up touching the ring. */
116
+ padding?: number;
117
+ };
3
118
  interface SDKOptions {
4
119
  debug?: boolean;
5
- theme?: 'light' | 'dark' | 'hybrid' | any;
120
+ /**
121
+ * `window` key the SDK instance is published under while `debug` is on, so
122
+ * a running kiosk can be driven from devtools (`mm.debug.hide('labels')`,
123
+ * `mm.getMap()`). Defaults to `'mm'`. Pass another name to avoid a clash,
124
+ * or `false` to publish nothing even in debug mode. Ignored entirely when
125
+ * `debug` is off.
126
+ */
127
+ debugGlobal?: string | false;
128
+ /**
129
+ * Initial theme. `'default'` uses the bundled hybrid 3D theme.
130
+ * `'high-contrast'` uses the WCAG-AA tuned theme. `'color-blind'` keeps the
131
+ * default look but swaps the colors that red-green and blue-yellow color
132
+ * blindness merge (the route, room categories and department zones,
133
+ * restrooms, parks). Pass a
134
+ * `StyleSpecification` for fully custom styling.
135
+ */
136
+ theme?: ThemeName | any;
137
+ /**
138
+ * When true, the SDK skips animations on imperative camera calls
139
+ * (wayfinding fits, `setView`, idle re-frames). Consumers should
140
+ * mirror their app's `prefers-reduced-motion` state into this.
141
+ */
142
+ reducedMotion?: boolean;
143
+ /**
144
+ * Whether a freshly computed route auto-highlights its first step's
145
+ * segment (the brighter `route-line-active` overlay). Defaults to
146
+ * `true`, preserving the turn-by-turn segment highlight that
147
+ * `setActiveStep` drives.
148
+ *
149
+ * Set `false` for kiosk-style "show the whole route at once" UIs:
150
+ * the entire route line is shown without singling out one segment,
151
+ * which reads more clearly at a glance and avoids implying the visitor
152
+ * must step through the route. `setActiveStep` still works when called
153
+ * explicitly (e.g. a paginated QR-handoff / mobile flow) — this only
154
+ * controls the automatic highlight on `routeReady`.
155
+ */
156
+ routeStepHighlight?: boolean;
157
+ /**
158
+ * Which way is up while a route is on screen. Defaults to `'kiosk'`.
159
+ *
160
+ * - `'kiosk'` — the kiosk's heading rotated 180°, so the map matches the
161
+ * direction a visitor walks away from the screen (180°, south-up, when
162
+ * the venue has no kiosk heading).
163
+ * - `'first-step'` — the direction of the route's first step: the tapped
164
+ * start's approach when there is one, otherwise the first stretch of
165
+ * the path. For UIs viewed away from any kiosk (a phone, a home
166
+ * computer), where the kiosk's facing means nothing. Taken once per
167
+ * route, so stepping through it or toggling the full route keeps that
168
+ * orientation.
169
+ */
170
+ routeBearing?: 'kiosk' | 'first-step';
171
+ /**
172
+ * Whether restroom pins that are too close together to draw individually
173
+ * collapse into a single Material `wc` badge. Defaults to `true`.
174
+ *
175
+ * Venues author men's and women's restrooms as two amenities a few metres
176
+ * apart. Both are wayfinding-critical (rank 0) and both draw on a layer that
177
+ * doesn't allow icon overlap, so without this MapLibre resolves the collision
178
+ * by hiding one of them outright until the camera is very close in. Grouping
179
+ * shows one badge in their place and hands back *all* the members when it's
180
+ * tapped, so the consumer can offer directions to each.
181
+ *
182
+ * Set `false` to opt out and get the raw collision behaviour back.
183
+ */
184
+ groupRestroomIcons?: boolean;
6
185
  initialFloor?: string | number;
7
186
  enableInteractions?: boolean;
8
187
  customSprite?: string;
9
188
  minIndoorZoom?: number;
189
+ /**
190
+ * How far, in **metres** (default `0.3`, ≈1 ft), extruded interior polygons
191
+ * (restrooms, back-of-house, obstacles, connectors) are inset so their edges
192
+ * don't z-fight the neighbouring room block. A polygon too thin to survive
193
+ * the inset (it would keep under half its area, e.g. a ~0.3 m back-of-house
194
+ * perimeter band) is left at its original size rather than erased. Metres to match the theme's
195
+ * `fill-extrusion-height` values, which MapLibre defines in metres — unlike
196
+ * the distances shown to visitors, which are in feet. Was feet before this
197
+ * option changed units; a value of `1` is now ~3.3× thicker.
198
+ */
10
199
  wallThickness?: number;
11
- boundsPadding?: number;
200
+ /**
201
+ * How much costlier a candidate on a **different floor** from the kiosk is
202
+ * treated when choosing the closest instance of an amenity (default `1.5`).
203
+ * Used by `findClosestByWalkTime`, and so by `navigateFromKioskToClosestAmenity`
204
+ * and `highlightAmenity`.
205
+ *
206
+ * A multiplier on the trip's effort — walk time plus the elevator wait — not
207
+ * a distance: `1.5` means another floor's instance has to be a third cheaper
208
+ * to beat one on the kiosk's floor. It is a *preference* for not making the
209
+ * visitor change floors, layered on top of the physical cost of doing so
210
+ * (which is already in the effort). `1` turns it off and ranks by effort
211
+ * alone; a value below `1` is treated as `1`. It only affects which instance
212
+ * is chosen — never a route.
213
+ *
214
+ * For scale: at the Las Vegas VA the nearest other-floor Lactation Pod costs
215
+ * ~400 ft-equivalent against ~530 for the one on the kiosk's floor, so it
216
+ * takes a value above ~1.32 to keep the visitor on their floor.
217
+ */
218
+ otherFloorPenalty?: number;
219
+ boundsPadding?: BoundsPadding;
220
+ /**
221
+ * Caps how far a visitor can pan/zoom out. By default the SDK derives this
222
+ * from the venue's own bounds, scaled to 3x its width/height around the
223
+ * same center — enough room to pan around the building without drifting
224
+ * into an empty, un-tiled region. The default box is never smaller than
225
+ * ~3.7 km a side, so a small venue isn't forced to zoom in tighter than a
226
+ * large one. Pass a number to use a different
227
+ * multiplier (e.g. `1.5` for a tighter leash), explicit `[[west, south],
228
+ * [east, north]]` bounds to override entirely, or `false` to disable
229
+ * max-bounds clamping.
230
+ */
231
+ maxBounds?: Bounds | number | false;
232
+ /**
233
+ * Hides basemap points of interest (civic and marine icons, park names) that
234
+ * fall within this many metres of the venue's bounds, so an OSM library or
235
+ * chapel on the campus isn't drawn underneath the venue's own map. Defaults
236
+ * to `50`. Street labels, road shields and water labels are never hidden.
237
+ * Pass `false` to show every basemap POI.
238
+ */
239
+ hideBasemapPoisNearVenue?: number | false;
240
+ /**
241
+ * Whether the venue's kiosk anchors a "You are here" marker, and the opening
242
+ * view / default route origin. Defaults to `true`. Set `false` for non-kiosk
243
+ * consumers (e.g. a browser map): no device is resolved, even via the
244
+ * "first placed device" fallback, so the marker is never drawn.
245
+ */
246
+ kiosk?: boolean;
247
+ /**
248
+ * Pitch (deg) for the opening view, applied centred on the kiosk ("You
249
+ * are here"). Omit for top-down.
250
+ */
251
+ initialPitch?: number;
252
+ /**
253
+ * Zoom for the opening view, centred on the kiosk. Set this above the
254
+ * theme's unit-walls breakpoint (~16.5 in the bundled hybrid theme) so the
255
+ * kiosk opens on the building's interior floor plan (its contents) rather
256
+ * than a zoomed-out 3D massing outline. Omit to keep the post-floor-fit
257
+ * zoom.
258
+ */
259
+ initialZoom?: number;
260
+ /**
261
+ * Zoom floor for selecting a place — a map tap or `selectPOI` (default
262
+ * `19.25`, one level into the Kiosk view). A selection made from further out
263
+ * zooms in to this; a closer zoom is kept. At the Kiosk view's edge (18.25)
264
+ * the selected dot and name are drawn but still lose collision to their
265
+ * neighbours, and in the Building view (a room tapped from 16.5 up) they
266
+ * aren't drawn at all — either way the visitor selects a place they can't
267
+ * see. `0` keeps the current zoom on every selection.
268
+ */
269
+ selectionZoom?: number;
270
+ /**
271
+ * Clamp zoom-out relative to the opening view. When set, the map's
272
+ * `minZoom` becomes `(initialZoom − this)`, so visitors can nudge out by
273
+ * this many zoom levels but never pull back below the interior into the
274
+ * massing/region. `0` locks zoom-out exactly to the opening view.
275
+ */
276
+ minZoomBelowInitialFit?: number;
277
+ /**
278
+ * Zoom-out floor expressed as ground scale: the most metres one CSS pixel
279
+ * may span. The SDK converts it to a `minZoom` at the venue's latitude, so
280
+ * every venue shows the same amount of surrounding map when fully zoomed
281
+ * out — a plain zoom number doesn't, because Web Mercator shows less ground
282
+ * per zoom level the further a venue is from the equator. Takes precedence
283
+ * over `minZoomBelowInitialFit`. For scale, `1.207` is zoom 15.8 at Orlando
284
+ * (about 2.3 km x 1.3 km on a 1920x1080 screen).
285
+ */
286
+ minZoomMetersPerPixel?: number;
287
+ /**
288
+ * Override the colour the SDK recolours every amenity SVG to before it
289
+ * composites the badge. `none` / `transparent` fills are preserved so
290
+ * cut-outs stay. When the badge is enabled (the default), this defaults
291
+ * to navy (`#162e51`) so icons read on gold. Set explicitly for a
292
+ * different look, or set `amenityBadge: false` to disable recolouring
293
+ * altogether and keep the CMS-uploaded colours.
294
+ */
295
+ amenityIconColor?: string;
296
+ /**
297
+ * Badge composited behind each amenity icon. Pass `false` to render the
298
+ * icon alone (no badge — useful for high-contrast or 2D themes where the
299
+ * gold disc would compete with the floor). Pass an object to tune the
300
+ * disc / ring style. Defaults to a VA-gold disc with a 2px white ring.
301
+ *
302
+ * The badge is baked into the icon bitmap (canvas composite) rather than
303
+ * drawn as a separate circle layer, so badge + icon participate in symbol
304
+ * collision together — overlapping amenities hide as one unit instead of
305
+ * the icon hiding while the disc stays painted.
306
+ */
307
+ amenityBadge?: AmenityBadgeStyle | false;
308
+ /**
309
+ * Badge for vertical-circulation connectors (elevator / stairs / escalator).
310
+ * These render as their own visual class — a navy disc with a white glyph —
311
+ * so circulation reads distinct from the gold service amenities. Pass `false`
312
+ * to fall them back into the regular gold badge, or an object to tune the
313
+ * disc / ring. When `amenityBadge` is `false`, connectors are badge-less too
314
+ * unless this is set explicitly.
315
+ */
316
+ connectorBadge?: AmenityBadgeStyle | false;
317
+ /**
318
+ * Badge for information-desk amenities (curated `information`/`info`
319
+ * icon). These render as their own visual class — a green disc with a
320
+ * white glyph by default — so information reads distinct from the gold
321
+ * service amenities. Pass `false` to fall them back into the regular gold
322
+ * badge, or an object to tune the disc / ring. When `amenityBadge` is
323
+ * `false`, information icons are badge-less too unless this is set
324
+ * explicitly.
325
+ */
326
+ informationBadge?: AmenityBadgeStyle | false;
327
+ /**
328
+ * Glyph colour for information icons on their badge. Default white
329
+ * (matches `informationBadge`'s default green disc).
330
+ */
331
+ informationIconColor?: string;
332
+ /**
333
+ * Badge for the end-of-route flag (`poi-route-end-flag`) shown in place of a
334
+ * destination's dot while a route to it is displayed. Has its own defaults
335
+ * (green disc, white ring) that don't follow `amenityBadge`. Pass an object
336
+ * to tune the disc / ring, or `false` for the bare flag glyph with no badge.
337
+ * When `amenityBadge` is `false`, the flag is badge-less too unless this is
338
+ * set explicitly. Under the high-contrast theme the disc colour is forced to
339
+ * the high-contrast amenity yellow, like the amenity and connector badges.
340
+ */
341
+ routeEndBadge?: AmenityBadgeStyle | false;
342
+ /**
343
+ * Flag glyph colour on the end-of-route badge. Default white (contrasts the
344
+ * default green disc); doesn't follow `amenityIconColor`. Ignored under the
345
+ * high-contrast theme, which forces its own glyph colour.
346
+ */
347
+ routeEndIconColor?: string;
12
348
  styleMode?: 'venueStyleUrl' | 'sdkTemplate';
13
349
  templateOverrideMode?: 'colorsOnly' | 'colorsAndConstants' | 'all';
14
350
  }
@@ -24,9 +360,19 @@ type SDKConfig = {
24
360
  venueId: number;
25
361
  locale?: string;
26
362
  auth?: JMapAuth;
363
+ /**
364
+ * Identifies which physical kiosk this instance is, so the SDK can pin
365
+ * the "You are here" marker. Matched against either the numeric device
366
+ * `id` or the device `uuid` from the venue's `devices`. The device's
367
+ * attached waypoint (`waypoint.deviceIds`) is the kiosk's location.
368
+ */
369
+ deviceId?: string | number;
27
370
  };
28
371
  jacs: {
29
- mode: 'proxy' | 'direct';
372
+ /** `snapshot` reads published venue snapshots from a CDN — what clients
373
+ * should use. `proxy`/`direct` read live JACS (the draft): local dev and
374
+ * CMS preview. */
375
+ mode: 'proxy' | 'direct' | 'snapshot';
30
376
  host?: string;
31
377
  auth?: {
32
378
  clientId: string;
@@ -34,13 +380,17 @@ type SDKConfig = {
34
380
  password: string;
35
381
  };
36
382
  proxyBaseUrl?: string;
383
+ baseUrl?: string;
37
384
  };
38
385
  options?: SDKOptions;
39
386
  };
40
387
 
41
- declare function MinuteMapsView({ config, className }: {
388
+ declare function MinuteMapsView({ config, className, onSelect, }: {
42
389
  config: SDKConfig;
43
390
  className?: string;
391
+ /** Fired when the user taps a destination/amenity pin. `pois` holds every
392
+ * POI co-located at that point (overlapping pins / a shared suite). */
393
+ onSelect?: (pois: POI[], coordinates: [number, number]) => void;
44
394
  }): react_jsx_runtime.JSX.Element;
45
395
 
46
396
  export { MinuteMapsView };