@mappedin/mappedin-js 5.2.1 → 5.2.2

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.
@@ -64,6 +64,10 @@ declare module '@mappedin/mappedin-js' {
64
64
  export type { TGetVenueOptions, TShowVenueOptions, TMappedinOfflineSearchOptions, TMappedinOfflineSearchResult, TMappedinOfflineSearchSuggestions, TMappedinOfflineAllSearchMatch, TMappedinOfflineSearchAllOptions } from '@mappedin/mappedin-js/get-venue';
65
65
  export { Mappedin, MappedinDirections, MappedinLocation, MappedinPolygon, MappedinNode, MappedinCategory, MappedinMap, MappedinEvent, MappedinMapGroup, MappedinVenue, MappedinVortex, MappedinNavigatable, MappedinCoordinate, OfflineSearch, MAP_RENDER_MODE, setFetchFn, MappedinCollectionType } from '@mappedin/mappedin-js/get-venue';
66
66
  export { BundleAssetManager } from '@mappedin/mappedin-js/renderer/bundle-asset-manager';
67
+ /**
68
+ * @internal
69
+ */
70
+ export function __useSceneManager(value: boolean): void;
67
71
  }
68
72
 
69
73
  declare module '@mappedin/mappedin-js/renderer/MapView' {
@@ -243,17 +247,28 @@ declare module '@mappedin/mappedin-js/renderer/MapView' {
243
247
  */
244
248
  removeAllTooltips(): void;
245
249
  /**
250
+ * Create a tooltip with default styling that the MapView will attempt to position in 3D space. The tooltip will be anchored
251
+ * to a specified node or coordinate in one of eight anchor orientations.
246
252
  *
247
- * This creates a tooltip that allows you to pass dynamic content which will attempt
248
- * to position around an anchor in 3D space. The tooltip will be positioned based on one of four
249
- * AnchorTypes (top, bottom, left, right).
253
+ * The possible anchor types are `top`, `bottom`, `left`, `right`, `topLeft`, `topRight`, `bottomLeft`, and `bottomRight`. This
254
+ * describes the position of the tooltip relative to the node or coordinate to which it is attached.
250
255
  *
251
- *`options.defaultAnchorType` and `options.enabledAnchorTypes` should be one of the constants from Mappedin.Tooltip.ANCHOR
256
+ * The tooltip is rendered into the DOM with the following structure.
252
257
  *
253
- * `options.defaultAnchorType` will override `options.enabledAnchorTypes` if that anchor was disabled it will be automatically re-enabled
258
+ * ```jsx
259
+ * <div class="mappedin-tooltip tooltip--anchor-bottom-left">
260
+ * <div class="mappedin-tooltip__content">
261
+ * {contentHtml}
262
+ * </ div>
263
+ * </ div>
264
+ * ```
254
265
  *
266
+ * The `.mappedin-tooltip` element controls the position and has a class in the form of `.tooltip--anchor-{type}` that indicates
267
+ * the current anchor type.
255
268
  *
256
- * @return The Tooltip you created, which has already been added to the scene.
269
+ * @param nodeOrCoordinate A {@link MappedinNode} or {@link MappedinCoordinate} the tooltip is attached to.
270
+ * @param contentHtml Stringified HTML content to render within the tooltip.
271
+ * @param options {@link TCreateTooltipOptions} for rendering the tooltip
257
272
  */
258
273
  createTooltip(
259
274
  /**
@@ -261,17 +276,20 @@ declare module '@mappedin/mappedin-js/renderer/MapView' {
261
276
  */
262
277
  nodeOrCoordinate: MappedinNode | MappedinCoordinate, contentHtml: string, options?: TCreateTooltipOptions): SmartTooltip;
263
278
  /**
279
+ * Create a tooltip with no default styling that the MapView will attempt to position in 3D space. The tooltip will be anchored
280
+ * to a specified node or coordinate in one of eight anchor orientations.
264
281
  *
265
- * This creates a tooltip that allows you to pass dynamic content which will attempt
266
- * to position around an anchor in 3D space. The tooltip will be positioned based on one of four
267
- * AnchorTypes (top, bottom, left, right).
282
+ * The possible anchor types are `top`, `bottom`, `left`, `right`, `topLeft`, `topRight`, `bottomLeft`, and `bottomRight`. This
283
+ * describes the position of the tooltip relative to the node or coordinate to which it is attached.
268
284
  *
269
- *`options.defaultAnchorType` and `options.enabledAnchorTypes` should be one of the constants from Mappedin.Tooltip.ANCHOR
285
+ * Unlike {@link createTooltip}, a custom tooltip is rendered without any additional wrappers, leaving styling entirely up to the
286
+ * external developer. The top-most element will be injected with a class in the form of `.tooltip--anchor-{type}` that indicates
287
+ * the current anchor type.
270
288
  *
271
- * `options.defaultAnchorType` will override `options.enabledAnchorTypes` if that anchor was disabled it will be automatically re-enabled
272
- *
273
- *
274
- * @return The Tooltip you created, which has already been added to the scene.
289
+ * @param nodeOrCoordinate A {@link MappedinNode} or {@link MappedinCoordinate} the tooltip is attached to.
290
+ * @param contentHtml Stringified HTML content to render within the tooltip. The contents must be `position: absolute` in order to interact with the collision engine.
291
+ * @param selector A CSS selector string that allows the SDK to target the tooltip. This is required because we do not inject any default styling.
292
+ * @param options {@link TCreateTooltipCommonOptions} for rendering the tooltip
275
293
  */
276
294
  createCustomTooltip(
277
295
  /**
@@ -406,6 +424,13 @@ declare module '@mappedin/mappedin-js/get-venue' {
406
424
  export { MappedinRankings } from '@mappedin/mappedin-js/get-venue/MappedinRankings';
407
425
  export { MappedinDestinationSet } from '@mappedin/mappedin-js/get-venue/MappedinDestinationSet';
408
426
  export { MappedinNavigatable } from '@mappedin/mappedin-js/get-venue/MappedinNavigatable';
427
+ /**
428
+ * @internal
429
+ * @hidden
430
+ *
431
+ * Export this only so our internal pre-built products can use it. We don't want to document it for external developers.
432
+ */
433
+ export { default as CustomerAnalytics } from '@mappedin/mappedin-js/get-venue/Mappedin.CustomerAnalytics';
409
434
  export type { TTHINGS } from '@mappedin/mappedin-js/get-venue/Mappedin';
410
435
  export type { TMappedinDirective } from '@mappedin/mappedin-js/get-venue/MappedinDirections';
411
436
  export type { IDirectionsResult } from '@mappedin/mappedin-js/navigator';
@@ -508,6 +533,13 @@ declare module '@mappedin/mappedin-js/get-venue' {
508
533
  * and may be determental to smaller ones, hence it is off by default
509
534
  */
510
535
  useWorker?: boolean): Promise<unknown>;
536
+ /**
537
+ * Returns a {@link Mappedin} object hydrated with JSON data.
538
+ * @param {string|Object} mappedinSerializableData A JSON string or object representing a venue.
539
+ * @param {boolean} shouldPopulateBundledImagesAsBlobs
540
+ * @returns {Mappedin} A new Mappedin object with data from the mappedinSerializableData parameter.
541
+ */
542
+ export function hydrateVenue(mappedinSerializableData: any, shouldPopulateBundledImagesAsBlobs?: boolean): Promise<Mappedin>;
511
543
  }
512
544
 
513
545
  declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.BlueDot/Mappedin.BlueDot.core' {
@@ -670,7 +702,7 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.BlueDot/Mappedi
670
702
  };
671
703
  export type TLatLonProps = [number, number];
672
704
  const BlueDot: {
673
- ({ data, mapView, core }: TBlueDotProps): IBlueDotCore;
705
+ ({ data, mapView, core, manager }: TBlueDotProps): IBlueDotCore;
674
706
  FakeGeolocation: typeof FakeGeolocation;
675
707
  };
676
708
  export default BlueDot;
@@ -2099,6 +2131,10 @@ declare module '@mappedin/mappedin-js/renderer' {
2099
2131
  export type { TGetVenueOptions, TShowVenueOptions, TMappedinOfflineSearchOptions, TMappedinOfflineSearchResult, TMappedinOfflineSearchSuggestions, TMappedinOfflineAllSearchMatch, TMappedinOfflineSearchAllOptions } from '@mappedin/mappedin-js/get-venue';
2100
2132
  export { Mappedin, MappedinDirections, MappedinLocation, MappedinPolygon, MappedinNode, MappedinCategory, MappedinMap, MappedinEvent, MappedinMapGroup, MappedinVenue, MappedinVortex, MappedinNavigatable, MappedinCoordinate, OfflineSearch, MAP_RENDER_MODE, setFetchFn, MappedinCollectionType } from '@mappedin/mappedin-js/get-venue';
2101
2133
  export { BundleAssetManager } from '@mappedin/mappedin-js/renderer/bundle-asset-manager';
2134
+ /**
2135
+ * @internal
2136
+ */
2137
+ export function __useSceneManager(value: boolean): void;
2102
2138
  }
2103
2139
 
2104
2140
  declare module '@mappedin/mappedin-js/get-venue/Mappedin.types' {
@@ -2407,6 +2443,9 @@ declare module '@mappedin/mappedin-js/get-venue/Mappedin' {
2407
2443
  imageBinaries?: Map<string, Uint8Array>;
2408
2444
  scenes: any;
2409
2445
  fetch(): Promise<void>;
2446
+ /**
2447
+ * @deprecated Use {@link hydrateVenue} instead
2448
+ */
2410
2449
  constructor(options: TGetVenueOptionsInternal & TGetVenueOptions);
2411
2450
  analytics: IAnalytics;
2412
2451
  /**
@@ -3193,6 +3232,121 @@ declare module '@mappedin/mappedin-js/get-venue/MappedinNavigatable' {
3193
3232
  }
3194
3233
  }
3195
3234
 
3235
+ declare module '@mappedin/mappedin-js/get-venue/Mappedin.CustomerAnalytics' {
3236
+ import { MappedinCategory, MappedinLocation } from '@mappedin/mappedin-js/get-venue';
3237
+ type AnalyticsOptions = {
3238
+ clientId?: string;
3239
+ clientSecret?: string;
3240
+ accessToken?: string;
3241
+ noAuth?: boolean;
3242
+ venue: string;
3243
+ testMode?: boolean | string;
3244
+ context?: string;
3245
+ platformString?: string;
3246
+ };
3247
+ interface IAnalytics {
3248
+ locationSelected(location: MappedinLocation): void;
3249
+ categorySelected(category: MappedinCategory): void;
3250
+ getDirections(start: MappedinLocation, end: MappedinLocation): void;
3251
+ }
3252
+ interface IInternalAnalytics extends IAnalytics {
3253
+ track(target: string, query: any): void;
3254
+ mapViewLoaded(type: '2d' | '3d', forced: boolean, benchmark: number, reason: string): void;
3255
+ getSessionID(): string;
3256
+ getDeviceID(): string;
3257
+ setGeolocationMode(mode: boolean): void;
3258
+ trackBlueDotEvent(blueDotEvent: Record<string, unknown>): void;
3259
+ trackSearch(searchAnalyticsObject: Record<string, unknown>): void;
3260
+ trackSearchSuggest(searchAnalyticsObject: Record<string, unknown>): void;
3261
+ }
3262
+ /**
3263
+ * A class to access the Mappedin Analytics platform. Correct usage will improve Smart Search results, and lead to more accurate insights.
3264
+ * This will be created for you as part of Mappedin.{{#crossLink "Mappedin/initialize:method"}}{{/crossLink}}, but you can also create one manually. You are mostly going to use `locationSelected`.
3265
+ *
3266
+ * @type {any}
3267
+ *
3268
+ * @class Analytics
3269
+ * @param options {Object} A list of configuration options for the Analytics API.
3270
+ * @param [options.clientId] {String} The same key you are using for getVenue. Handled automatically in Mapview.initialize()
3271
+ * @param [options.clientSecret] {String} The same secret you are using for getVenue. Handled automatically in Mapview.initialize()
3272
+ * @param [options.venue] {String} The same venue slug you are using for getVenue. Handled automatically in MapView.initialize()
3273
+ * @param [options.context] {String} The context to pass with the analytics request. Defaults to "websdk".
3274
+ * @param [options.noAuth] {Boolean} Whether authentication should not be sent with analytics requests.
3275
+ * @param [options.testMode] {Boolean} Whether analytics events should be dropped because this is running in a test environment.
3276
+ */
3277
+ class Analytics implements IInternalAnalytics {
3278
+ #private;
3279
+ constructor(options: AnalyticsOptions);
3280
+ track(target: any, query: any): void;
3281
+ /**
3282
+ * Whenever a location is selected, you should fire this event. What "selected" means can vary by venue,
3283
+ * but a good rule of thumb is that you fire the event whenever you would show the location's details.
3284
+ * Typically this is when the user taps it's polygon on the map, picks it from search results or a category list.
3285
+ * or deep links directly into the map.
3286
+ * @method locationSelected
3287
+ * @param location {MappedinLocation} The location the user selected.
3288
+ */
3289
+ locationSelected(location: any): void;
3290
+ /**
3291
+ * Whenever a category is selected, you should fire this event.
3292
+ * @method categorySelected
3293
+ * @param category {MappedinCategory} The category the user selected.
3294
+ */
3295
+ categorySelected(category: any): void;
3296
+ mapViewLoaded(type: any, forced: any, benchmark: any, reason: any): void;
3297
+ /**
3298
+ * Whenever a user requests directions, you should fire this event.
3299
+ * @method getDirections
3300
+ * @param start {MappedinLocation} The start location for wayfinding.
3301
+ * @param end {MappedinLocation} The end location for wayfinding.
3302
+ */
3303
+ getDirections(start: any, end: any): void;
3304
+ getSessionID(): string;
3305
+ getDeviceID(): string;
3306
+ /**
3307
+ * @param mode {Boolean} Indicates whether the user's geolocation is enabled.
3308
+ */
3309
+ setGeolocationMode(mode: any): void;
3310
+ /**
3311
+ * Track an event.
3312
+ * @method trackBlueDotEvent
3313
+ * @param event {String}
3314
+ * event param should be a property of the {{#crossLink "Analytics/BLUEDOT_EVENT:property"}}{{/crossLink}} property.
3315
+ */
3316
+ trackBlueDotEvent(blueDotEvent: any): void;
3317
+ trackSearch(searchAnalyticsObject: any): void;
3318
+ trackSearchSuggest(searchAnalyticsObject: any): void;
3319
+ /**
3320
+ * Sets the current global context of the Analytics class.
3321
+ * @method setContext
3322
+ * @param context {String} The Analytics context to be set.
3323
+ * @hidden
3324
+ */
3325
+ static setContext(context: any): void;
3326
+ /**
3327
+ * Sets the current global context of the Analytics class to undefined.
3328
+ * @method clearContext
3329
+ * @hidden
3330
+ */
3331
+ static clearContext(): void;
3332
+ /**
3333
+ * Enum of valid bluedot events.
3334
+ * Pass a property of this into the {{#crossLink "Analytics/trackBlueDotEvent:method"}}{{/crossLink}} method.
3335
+ * Valid properties are: ATTEMPT_BLUEDOT, FOUND_POSITION, FOUND_FLOOR.
3336
+ * @property BLUEDOT_EVENT {Object}
3337
+ * @example
3338
+ * Analytics.trackBlueDotEvent(Analytics.BLUEDOT_EVENT.ATTEMPT_BLUEDOT)
3339
+ */
3340
+ static BLUEDOT_EVENT: {
3341
+ ATTEMPT_BLUEDOT: string;
3342
+ FOUND_POSITION: string;
3343
+ FOUND_FLOOR: string;
3344
+ };
3345
+ }
3346
+ export type { IAnalytics };
3347
+ export default Analytics;
3348
+ }
3349
+
3196
3350
  declare module '@mappedin/mappedin-js/get-venue/Mappedin.OfflineSearch' {
3197
3351
  import { Mappedin } from '@mappedin/mappedin-js/get-venue/Mappedin';
3198
3352
  import type { SearchOptions } from 'minisearch';
@@ -3769,6 +3923,10 @@ declare module '@mappedin/mappedin-js/renderer/Core.interface' {
3769
3923
  * @internal
3770
3924
  */
3771
3925
  currentScale: number;
3926
+ /**
3927
+ * @internal
3928
+ */
3929
+ USE_SCENE_MANAGER: boolean;
3772
3930
  referenceMap: MappedinMap;
3773
3931
  taskScheduler: TaskScheduler;
3774
3932
  sceneManager: SceneManager;
@@ -4968,121 +5126,6 @@ declare module '@mappedin/mappedin-js/get-venue/MappedinTheme' {
4968
5126
  }
4969
5127
  }
4970
5128
 
4971
- declare module '@mappedin/mappedin-js/get-venue/Mappedin.CustomerAnalytics' {
4972
- import { MappedinCategory, MappedinLocation } from '@mappedin/mappedin-js/get-venue';
4973
- type AnalyticsOptions = {
4974
- clientId?: string;
4975
- clientSecret?: string;
4976
- accessToken?: string;
4977
- noAuth?: boolean;
4978
- venue: string;
4979
- testMode?: boolean | string;
4980
- context?: string;
4981
- platformString?: string;
4982
- };
4983
- interface IAnalytics {
4984
- locationSelected(location: MappedinLocation): void;
4985
- categorySelected(category: MappedinCategory): void;
4986
- getDirections(start: MappedinLocation, end: MappedinLocation): void;
4987
- }
4988
- interface IInternalAnalytics extends IAnalytics {
4989
- track(target: string, query: any): void;
4990
- mapViewLoaded(type: '2d' | '3d', forced: boolean, benchmark: number, reason: string): void;
4991
- getSessionID(): string;
4992
- getDeviceID(): string;
4993
- setGeolocationMode(mode: boolean): void;
4994
- trackBlueDotEvent(blueDotEvent: Record<string, unknown>): void;
4995
- trackSearch(searchAnalyticsObject: Record<string, unknown>): void;
4996
- trackSearchSuggest(searchAnalyticsObject: Record<string, unknown>): void;
4997
- }
4998
- /**
4999
- * A class to access the Mappedin Analytics platform. Correct usage will improve Smart Search results, and lead to more accurate insights.
5000
- * This will be created for you as part of Mappedin.{{#crossLink "Mappedin/initialize:method"}}{{/crossLink}}, but you can also create one manually. You are mostly going to use `locationSelected`.
5001
- *
5002
- * @type {any}
5003
- *
5004
- * @class Analytics
5005
- * @param options {Object} A list of configuration options for the Analytics API.
5006
- * @param [options.clientId] {String} The same key you are using for getVenue. Handled automatically in Mapview.initialize()
5007
- * @param [options.clientSecret] {String} The same secret you are using for getVenue. Handled automatically in Mapview.initialize()
5008
- * @param [options.venue] {String} The same venue slug you are using for getVenue. Handled automatically in MapView.initialize()
5009
- * @param [options.context] {String} The context to pass with the analytics request. Defaults to "websdk".
5010
- * @param [options.noAuth] {Boolean} Whether authentication should not be sent with analytics requests.
5011
- * @param [options.testMode] {Boolean} Whether analytics events should be dropped because this is running in a test environment.
5012
- */
5013
- class Analytics implements IInternalAnalytics {
5014
- #private;
5015
- constructor(options: AnalyticsOptions);
5016
- track(target: any, query: any): void;
5017
- /**
5018
- * Whenever a location is selected, you should fire this event. What "selected" means can vary by venue,
5019
- * but a good rule of thumb is that you fire the event whenever you would show the location's details.
5020
- * Typically this is when the user taps it's polygon on the map, picks it from search results or a category list.
5021
- * or deep links directly into the map.
5022
- * @method locationSelected
5023
- * @param location {MappedinLocation} The location the user selected.
5024
- */
5025
- locationSelected(location: any): void;
5026
- /**
5027
- * Whenever a category is selected, you should fire this event.
5028
- * @method categorySelected
5029
- * @param category {MappedinCategory} The category the user selected.
5030
- */
5031
- categorySelected(category: any): void;
5032
- mapViewLoaded(type: any, forced: any, benchmark: any, reason: any): void;
5033
- /**
5034
- * Whenever a user requests directions, you should fire this event.
5035
- * @method getDirections
5036
- * @param start {MappedinLocation} The start location for wayfinding.
5037
- * @param end {MappedinLocation} The end location for wayfinding.
5038
- */
5039
- getDirections(start: any, end: any): void;
5040
- getSessionID(): string;
5041
- getDeviceID(): string;
5042
- /**
5043
- * @param mode {Boolean} Indicates whether the user's geolocation is enabled.
5044
- */
5045
- setGeolocationMode(mode: any): void;
5046
- /**
5047
- * Track an event.
5048
- * @method trackBlueDotEvent
5049
- * @param event {String}
5050
- * event param should be a property of the {{#crossLink "Analytics/BLUEDOT_EVENT:property"}}{{/crossLink}} property.
5051
- */
5052
- trackBlueDotEvent(blueDotEvent: any): void;
5053
- trackSearch(searchAnalyticsObject: any): void;
5054
- trackSearchSuggest(searchAnalyticsObject: any): void;
5055
- /**
5056
- * Sets the current global context of the Analytics class.
5057
- * @method setContext
5058
- * @param context {String} The Analytics context to be set.
5059
- * @hidden
5060
- */
5061
- static setContext(context: any): void;
5062
- /**
5063
- * Sets the current global context of the Analytics class to undefined.
5064
- * @method clearContext
5065
- * @hidden
5066
- */
5067
- static clearContext(): void;
5068
- /**
5069
- * Enum of valid bluedot events.
5070
- * Pass a property of this into the {{#crossLink "Analytics/trackBlueDotEvent:method"}}{{/crossLink}} method.
5071
- * Valid properties are: ATTEMPT_BLUEDOT, FOUND_POSITION, FOUND_FLOOR.
5072
- * @property BLUEDOT_EVENT {Object}
5073
- * @example
5074
- * Analytics.trackBlueDotEvent(Analytics.BLUEDOT_EVENT.ATTEMPT_BLUEDOT)
5075
- */
5076
- static BLUEDOT_EVENT: {
5077
- ATTEMPT_BLUEDOT: string;
5078
- FOUND_POSITION: string;
5079
- FOUND_FLOOR: string;
5080
- };
5081
- }
5082
- export type { IAnalytics };
5083
- export default Analytics;
5084
- }
5085
-
5086
5129
  declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.RenderTasks' {
5087
5130
  export default RENDER;
5088
5131
  namespace RENDER {