@minmaps-dev/mm-web-sdk 1.0.0-rc.4 → 1.0.0-rc.41
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/README.md +23 -15
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1884 -10
- 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 +307 -3
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/package.json +35 -17
- package/src/themes/alt3-hybrid-style.json +2074 -812
- package/src/themes/high-contrast-style.json +0 -383
package/dist/react.d.ts
CHANGED
|
@@ -1,14 +1,308 @@
|
|
|
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';
|
|
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
|
-
|
|
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. Pass a
|
|
131
|
+
* `StyleSpecification` for fully custom styling.
|
|
132
|
+
*/
|
|
133
|
+
theme?: ThemeName | any;
|
|
134
|
+
/**
|
|
135
|
+
* When true, the SDK skips animations on imperative camera calls
|
|
136
|
+
* (wayfinding fits, `setView`, idle re-frames). Consumers should
|
|
137
|
+
* mirror their app's `prefers-reduced-motion` state into this.
|
|
138
|
+
*/
|
|
139
|
+
reducedMotion?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Whether a freshly computed route auto-highlights its first step's
|
|
142
|
+
* segment (the brighter `route-line-active` overlay). Defaults to
|
|
143
|
+
* `true`, preserving the turn-by-turn segment highlight that
|
|
144
|
+
* `setActiveStep` drives.
|
|
145
|
+
*
|
|
146
|
+
* Set `false` for kiosk-style "show the whole route at once" UIs:
|
|
147
|
+
* the entire route line is shown without singling out one segment,
|
|
148
|
+
* which reads more clearly at a glance and avoids implying the visitor
|
|
149
|
+
* must step through the route. `setActiveStep` still works when called
|
|
150
|
+
* explicitly (e.g. a paginated QR-handoff / mobile flow) — this only
|
|
151
|
+
* controls the automatic highlight on `routeReady`.
|
|
152
|
+
*/
|
|
153
|
+
routeStepHighlight?: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Whether restroom pins that are too close together to draw individually
|
|
156
|
+
* collapse into a single Material `wc` badge. Defaults to `true`.
|
|
157
|
+
*
|
|
158
|
+
* Venues author men's and women's restrooms as two amenities a few metres
|
|
159
|
+
* apart. Both are wayfinding-critical (rank 0) and both draw on a layer that
|
|
160
|
+
* doesn't allow icon overlap, so without this MapLibre resolves the collision
|
|
161
|
+
* by hiding one of them outright until the camera is very close in. Grouping
|
|
162
|
+
* shows one badge in their place and hands back *all* the members when it's
|
|
163
|
+
* tapped, so the consumer can offer directions to each.
|
|
164
|
+
*
|
|
165
|
+
* Set `false` to opt out and get the raw collision behaviour back.
|
|
166
|
+
*/
|
|
167
|
+
groupRestroomIcons?: boolean;
|
|
6
168
|
initialFloor?: string | number;
|
|
7
169
|
enableInteractions?: boolean;
|
|
8
170
|
customSprite?: string;
|
|
9
171
|
minIndoorZoom?: number;
|
|
172
|
+
/**
|
|
173
|
+
* How far, in **metres** (default `0.3`, ≈1 ft), extruded interior polygons
|
|
174
|
+
* (restrooms, back-of-house, obstacles, connectors) are inset so their edges
|
|
175
|
+
* don't z-fight the neighbouring room block. A polygon too thin to survive
|
|
176
|
+
* the inset (it would keep under half its area, e.g. a ~0.3 m back-of-house
|
|
177
|
+
* perimeter band) is left at its original size rather than erased. Metres to match the theme's
|
|
178
|
+
* `fill-extrusion-height` values, which MapLibre defines in metres — unlike
|
|
179
|
+
* the distances shown to visitors, which are in feet. Was feet before this
|
|
180
|
+
* option changed units; a value of `1` is now ~3.3× thicker.
|
|
181
|
+
*/
|
|
10
182
|
wallThickness?: number;
|
|
11
|
-
|
|
183
|
+
/**
|
|
184
|
+
* How much costlier a candidate on a **different floor** from the kiosk is
|
|
185
|
+
* treated when choosing the closest instance of an amenity (default `1.5`).
|
|
186
|
+
* Used by `findClosestByWalkTime`, and so by `navigateFromKioskToClosestAmenity`
|
|
187
|
+
* and `highlightAmenity`.
|
|
188
|
+
*
|
|
189
|
+
* A multiplier on the trip's effort — walk time plus the elevator wait — not
|
|
190
|
+
* a distance: `1.5` means another floor's instance has to be a third cheaper
|
|
191
|
+
* to beat one on the kiosk's floor. It is a *preference* for not making the
|
|
192
|
+
* visitor change floors, layered on top of the physical cost of doing so
|
|
193
|
+
* (which is already in the effort). `1` turns it off and ranks by effort
|
|
194
|
+
* alone; a value below `1` is treated as `1`. It only affects which instance
|
|
195
|
+
* is chosen — never a route.
|
|
196
|
+
*
|
|
197
|
+
* For scale: at the Las Vegas VA the nearest other-floor Lactation Pod costs
|
|
198
|
+
* ~400 ft-equivalent against ~530 for the one on the kiosk's floor, so it
|
|
199
|
+
* takes a value above ~1.32 to keep the visitor on their floor.
|
|
200
|
+
*/
|
|
201
|
+
otherFloorPenalty?: number;
|
|
202
|
+
boundsPadding?: BoundsPadding;
|
|
203
|
+
/**
|
|
204
|
+
* Caps how far a visitor can pan/zoom out. By default the SDK derives this
|
|
205
|
+
* from the venue's own bounds, scaled to 3x its width/height around the
|
|
206
|
+
* same center — enough room to pan around the building without drifting
|
|
207
|
+
* into an empty, un-tiled region. The default box is never smaller than
|
|
208
|
+
* ~3.7 km a side, so a small venue isn't forced to zoom in tighter than a
|
|
209
|
+
* large one. Pass a number to use a different
|
|
210
|
+
* multiplier (e.g. `1.5` for a tighter leash), explicit `[[west, south],
|
|
211
|
+
* [east, north]]` bounds to override entirely, or `false` to disable
|
|
212
|
+
* max-bounds clamping.
|
|
213
|
+
*/
|
|
214
|
+
maxBounds?: Bounds | number | false;
|
|
215
|
+
/**
|
|
216
|
+
* Pitch (deg) for the opening view, applied centred on the kiosk ("You
|
|
217
|
+
* are here"). Omit for top-down.
|
|
218
|
+
*/
|
|
219
|
+
initialPitch?: number;
|
|
220
|
+
/**
|
|
221
|
+
* Zoom for the opening view, centred on the kiosk. Set this above the
|
|
222
|
+
* theme's unit-walls breakpoint (~16.5 in the bundled hybrid theme) so the
|
|
223
|
+
* kiosk opens on the building's interior floor plan (its contents) rather
|
|
224
|
+
* than a zoomed-out 3D massing outline. Omit to keep the post-floor-fit
|
|
225
|
+
* zoom.
|
|
226
|
+
*/
|
|
227
|
+
initialZoom?: number;
|
|
228
|
+
/**
|
|
229
|
+
* Clamp zoom-out relative to the opening view. When set, the map's
|
|
230
|
+
* `minZoom` becomes `(initialZoom − this)`, so visitors can nudge out by
|
|
231
|
+
* this many zoom levels but never pull back below the interior into the
|
|
232
|
+
* massing/region. `0` locks zoom-out exactly to the opening view.
|
|
233
|
+
*/
|
|
234
|
+
minZoomBelowInitialFit?: number;
|
|
235
|
+
/**
|
|
236
|
+
* Zoom-out floor expressed as ground scale: the most metres one CSS pixel
|
|
237
|
+
* may span. The SDK converts it to a `minZoom` at the venue's latitude, so
|
|
238
|
+
* every venue shows the same amount of surrounding map when fully zoomed
|
|
239
|
+
* out — a plain zoom number doesn't, because Web Mercator shows less ground
|
|
240
|
+
* per zoom level the further a venue is from the equator. Takes precedence
|
|
241
|
+
* over `minZoomBelowInitialFit`. For scale, `1.207` is zoom 15.8 at Orlando
|
|
242
|
+
* (about 2.3 km x 1.3 km on a 1920x1080 screen).
|
|
243
|
+
*/
|
|
244
|
+
minZoomMetersPerPixel?: number;
|
|
245
|
+
/**
|
|
246
|
+
* Override the colour the SDK recolours every amenity SVG to before it
|
|
247
|
+
* composites the badge. `none` / `transparent` fills are preserved so
|
|
248
|
+
* cut-outs stay. When the badge is enabled (the default), this defaults
|
|
249
|
+
* to navy (`#162e51`) so icons read on gold. Set explicitly for a
|
|
250
|
+
* different look, or set `amenityBadge: false` to disable recolouring
|
|
251
|
+
* altogether and keep the CMS-uploaded colours.
|
|
252
|
+
*/
|
|
253
|
+
amenityIconColor?: string;
|
|
254
|
+
/**
|
|
255
|
+
* Badge composited behind each amenity icon. Pass `false` to render the
|
|
256
|
+
* icon alone (no badge — useful for high-contrast or 2D themes where the
|
|
257
|
+
* gold disc would compete with the floor). Pass an object to tune the
|
|
258
|
+
* disc / ring style. Defaults to a VA-gold disc with a 2px white ring.
|
|
259
|
+
*
|
|
260
|
+
* The badge is baked into the icon bitmap (canvas composite) rather than
|
|
261
|
+
* drawn as a separate circle layer, so badge + icon participate in symbol
|
|
262
|
+
* collision together — overlapping amenities hide as one unit instead of
|
|
263
|
+
* the icon hiding while the disc stays painted.
|
|
264
|
+
*/
|
|
265
|
+
amenityBadge?: AmenityBadgeStyle | false;
|
|
266
|
+
/**
|
|
267
|
+
* Badge for vertical-circulation connectors (elevator / stairs / escalator).
|
|
268
|
+
* These render as their own visual class — a navy disc with a white glyph —
|
|
269
|
+
* so circulation reads distinct from the gold service amenities. Pass `false`
|
|
270
|
+
* to fall them back into the regular gold badge, or an object to tune the
|
|
271
|
+
* disc / ring. When `amenityBadge` is `false`, connectors are badge-less too
|
|
272
|
+
* unless this is set explicitly.
|
|
273
|
+
*/
|
|
274
|
+
connectorBadge?: AmenityBadgeStyle | false;
|
|
275
|
+
/**
|
|
276
|
+
* Badge for information-desk amenities (curated `information`/`info`
|
|
277
|
+
* icon). These render as their own visual class — a green disc with a
|
|
278
|
+
* white glyph by default — so information reads distinct from the gold
|
|
279
|
+
* service amenities. Pass `false` to fall them back into the regular gold
|
|
280
|
+
* badge, or an object to tune the disc / ring. When `amenityBadge` is
|
|
281
|
+
* `false`, information icons are badge-less too unless this is set
|
|
282
|
+
* explicitly.
|
|
283
|
+
*/
|
|
284
|
+
informationBadge?: AmenityBadgeStyle | false;
|
|
285
|
+
/**
|
|
286
|
+
* Glyph colour for information icons on their badge. Default white
|
|
287
|
+
* (matches `informationBadge`'s default green disc).
|
|
288
|
+
*/
|
|
289
|
+
informationIconColor?: string;
|
|
290
|
+
/**
|
|
291
|
+
* Badge for the end-of-route flag (`poi-route-end-flag`) shown in place of a
|
|
292
|
+
* destination's dot while a route to it is displayed. Has its own defaults
|
|
293
|
+
* (green disc, white ring) that don't follow `amenityBadge`. Pass an object
|
|
294
|
+
* to tune the disc / ring, or `false` for the bare flag glyph with no badge.
|
|
295
|
+
* When `amenityBadge` is `false`, the flag is badge-less too unless this is
|
|
296
|
+
* set explicitly. Under the high-contrast theme the disc colour is forced to
|
|
297
|
+
* the high-contrast amenity yellow, like the amenity and connector badges.
|
|
298
|
+
*/
|
|
299
|
+
routeEndBadge?: AmenityBadgeStyle | false;
|
|
300
|
+
/**
|
|
301
|
+
* Flag glyph colour on the end-of-route badge. Default white (contrasts the
|
|
302
|
+
* default green disc); doesn't follow `amenityIconColor`. Ignored under the
|
|
303
|
+
* high-contrast theme, which forces its own glyph colour.
|
|
304
|
+
*/
|
|
305
|
+
routeEndIconColor?: string;
|
|
12
306
|
styleMode?: 'venueStyleUrl' | 'sdkTemplate';
|
|
13
307
|
templateOverrideMode?: 'colorsOnly' | 'colorsAndConstants' | 'all';
|
|
14
308
|
}
|
|
@@ -24,6 +318,13 @@ type SDKConfig = {
|
|
|
24
318
|
venueId: number;
|
|
25
319
|
locale?: string;
|
|
26
320
|
auth?: JMapAuth;
|
|
321
|
+
/**
|
|
322
|
+
* Identifies which physical kiosk this instance is, so the SDK can pin
|
|
323
|
+
* the "You are here" marker. Matched against either the numeric device
|
|
324
|
+
* `id` or the device `uuid` from the venue's `devices`. The device's
|
|
325
|
+
* attached waypoint (`waypoint.deviceIds`) is the kiosk's location.
|
|
326
|
+
*/
|
|
327
|
+
deviceId?: string | number;
|
|
27
328
|
};
|
|
28
329
|
jacs: {
|
|
29
330
|
mode: 'proxy' | 'direct';
|
|
@@ -38,9 +339,12 @@ type SDKConfig = {
|
|
|
38
339
|
options?: SDKOptions;
|
|
39
340
|
};
|
|
40
341
|
|
|
41
|
-
declare function MinuteMapsView({ config, className }: {
|
|
342
|
+
declare function MinuteMapsView({ config, className, onSelect, }: {
|
|
42
343
|
config: SDKConfig;
|
|
43
344
|
className?: string;
|
|
345
|
+
/** Fired when the user taps a destination/amenity pin. `pois` holds every
|
|
346
|
+
* POI co-located at that point (overlapping pins / a shared suite). */
|
|
347
|
+
onSelect?: (pois: POI[], coordinates: [number, number]) => void;
|
|
44
348
|
}): react_jsx_runtime.JSX.Element;
|
|
45
349
|
|
|
46
350
|
export { MinuteMapsView };
|