@mappedin/react-native-sdk 5.2.0 → 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.
Files changed (3) hide show
  1. package/dist/index.d.ts +169 -130
  2. package/dist/index.js +203 -203
  3. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -1203,6 +1203,13 @@ declare module '@mappedin/react-native-sdk/core/packages/get-venue' {
1203
1203
  export { MappedinRankings } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinRankings';
1204
1204
  export { MappedinDestinationSet } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinDestinationSet';
1205
1205
  export { MappedinNavigatable } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinNavigatable';
1206
+ /**
1207
+ * @internal
1208
+ * @hidden
1209
+ *
1210
+ * Export this only so our internal pre-built products can use it. We don't want to document it for external developers.
1211
+ */
1212
+ export { default as CustomerAnalytics } from '@mappedin/react-native-sdk/core/packages/get-venue/Mappedin.CustomerAnalytics';
1206
1213
  export type { TTHINGS } from '@mappedin/react-native-sdk/core/packages/get-venue/Mappedin';
1207
1214
  export type { TMappedinDirective } from '@mappedin/react-native-sdk/core/packages/get-venue/MappedinDirections';
1208
1215
  export type { IDirectionsResult } from '@mappedin/react-native-sdk/core/packages/navigator';
@@ -1305,6 +1312,13 @@ declare module '@mappedin/react-native-sdk/core/packages/get-venue' {
1305
1312
  * and may be determental to smaller ones, hence it is off by default
1306
1313
  */
1307
1314
  useWorker?: boolean): Promise<unknown>;
1315
+ /**
1316
+ * Returns a {@link Mappedin} object hydrated with JSON data.
1317
+ * @param {string|Object} mappedinSerializableData A JSON string or object representing a venue.
1318
+ * @param {boolean} shouldPopulateBundledImagesAsBlobs
1319
+ * @returns {Mappedin} A new Mappedin object with data from the mappedinSerializableData parameter.
1320
+ */
1321
+ export function hydrateVenue(mappedinSerializableData: any, shouldPopulateBundledImagesAsBlobs?: boolean): Promise<Mappedin>;
1308
1322
  }
1309
1323
 
1310
1324
  declare module '@mappedin/react-native-sdk/core/common/random-id' {
@@ -2352,6 +2366,10 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/Core.interface
2352
2366
  * @internal
2353
2367
  */
2354
2368
  currentScale: number;
2369
+ /**
2370
+ * @internal
2371
+ */
2372
+ USE_SCENE_MANAGER: boolean;
2355
2373
  referenceMap: MappedinMap;
2356
2374
  taskScheduler: TaskScheduler;
2357
2375
  sceneManager: SceneManager;
@@ -3478,7 +3496,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
3478
3496
  };
3479
3497
  export type TLatLonProps = [number, number];
3480
3498
  const BlueDot: {
3481
- ({ data, mapView, core }: TBlueDotProps): IBlueDotCore;
3499
+ ({ data, mapView, core, manager }: TBlueDotProps): IBlueDotCore;
3482
3500
  FakeGeolocation: typeof FakeGeolocation;
3483
3501
  };
3484
3502
  export default BlueDot;
@@ -3936,6 +3954,9 @@ declare module '@mappedin/react-native-sdk/core/packages/get-venue/Mappedin' {
3936
3954
  imageBinaries?: Map<string, Uint8Array>;
3937
3955
  scenes: any;
3938
3956
  fetch(): Promise<void>;
3957
+ /**
3958
+ * @deprecated Use {@link hydrateVenue} instead
3959
+ */
3939
3960
  constructor(options: TGetVenueOptionsInternal & TGetVenueOptions);
3940
3961
  analytics: IAnalytics;
3941
3962
  /**
@@ -4780,6 +4801,121 @@ declare module '@mappedin/react-native-sdk/core/packages/get-venue/MappedinNavig
4780
4801
  }
4781
4802
  }
4782
4803
 
4804
+ declare module '@mappedin/react-native-sdk/core/packages/get-venue/Mappedin.CustomerAnalytics' {
4805
+ import { MappedinCategory, MappedinLocation } from '@mappedin/react-native-sdk/core/packages/get-venue';
4806
+ type AnalyticsOptions = {
4807
+ clientId?: string;
4808
+ clientSecret?: string;
4809
+ accessToken?: string;
4810
+ noAuth?: boolean;
4811
+ venue: string;
4812
+ testMode?: boolean | string;
4813
+ context?: string;
4814
+ platformString?: string;
4815
+ };
4816
+ interface IAnalytics {
4817
+ locationSelected(location: MappedinLocation): void;
4818
+ categorySelected(category: MappedinCategory): void;
4819
+ getDirections(start: MappedinLocation, end: MappedinLocation): void;
4820
+ }
4821
+ interface IInternalAnalytics extends IAnalytics {
4822
+ track(target: string, query: any): void;
4823
+ mapViewLoaded(type: '2d' | '3d', forced: boolean, benchmark: number, reason: string): void;
4824
+ getSessionID(): string;
4825
+ getDeviceID(): string;
4826
+ setGeolocationMode(mode: boolean): void;
4827
+ trackBlueDotEvent(blueDotEvent: Record<string, unknown>): void;
4828
+ trackSearch(searchAnalyticsObject: Record<string, unknown>): void;
4829
+ trackSearchSuggest(searchAnalyticsObject: Record<string, unknown>): void;
4830
+ }
4831
+ /**
4832
+ * A class to access the Mappedin Analytics platform. Correct usage will improve Smart Search results, and lead to more accurate insights.
4833
+ * 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`.
4834
+ *
4835
+ * @type {any}
4836
+ *
4837
+ * @class Analytics
4838
+ * @param options {Object} A list of configuration options for the Analytics API.
4839
+ * @param [options.clientId] {String} The same key you are using for getVenue. Handled automatically in Mapview.initialize()
4840
+ * @param [options.clientSecret] {String} The same secret you are using for getVenue. Handled automatically in Mapview.initialize()
4841
+ * @param [options.venue] {String} The same venue slug you are using for getVenue. Handled automatically in MapView.initialize()
4842
+ * @param [options.context] {String} The context to pass with the analytics request. Defaults to "websdk".
4843
+ * @param [options.noAuth] {Boolean} Whether authentication should not be sent with analytics requests.
4844
+ * @param [options.testMode] {Boolean} Whether analytics events should be dropped because this is running in a test environment.
4845
+ */
4846
+ class Analytics implements IInternalAnalytics {
4847
+ #private;
4848
+ constructor(options: AnalyticsOptions);
4849
+ track(target: any, query: any): void;
4850
+ /**
4851
+ * Whenever a location is selected, you should fire this event. What "selected" means can vary by venue,
4852
+ * but a good rule of thumb is that you fire the event whenever you would show the location's details.
4853
+ * Typically this is when the user taps it's polygon on the map, picks it from search results or a category list.
4854
+ * or deep links directly into the map.
4855
+ * @method locationSelected
4856
+ * @param location {MappedinLocation} The location the user selected.
4857
+ */
4858
+ locationSelected(location: any): void;
4859
+ /**
4860
+ * Whenever a category is selected, you should fire this event.
4861
+ * @method categorySelected
4862
+ * @param category {MappedinCategory} The category the user selected.
4863
+ */
4864
+ categorySelected(category: any): void;
4865
+ mapViewLoaded(type: any, forced: any, benchmark: any, reason: any): void;
4866
+ /**
4867
+ * Whenever a user requests directions, you should fire this event.
4868
+ * @method getDirections
4869
+ * @param start {MappedinLocation} The start location for wayfinding.
4870
+ * @param end {MappedinLocation} The end location for wayfinding.
4871
+ */
4872
+ getDirections(start: any, end: any): void;
4873
+ getSessionID(): string;
4874
+ getDeviceID(): string;
4875
+ /**
4876
+ * @param mode {Boolean} Indicates whether the user's geolocation is enabled.
4877
+ */
4878
+ setGeolocationMode(mode: any): void;
4879
+ /**
4880
+ * Track an event.
4881
+ * @method trackBlueDotEvent
4882
+ * @param event {String}
4883
+ * event param should be a property of the {{#crossLink "Analytics/BLUEDOT_EVENT:property"}}{{/crossLink}} property.
4884
+ */
4885
+ trackBlueDotEvent(blueDotEvent: any): void;
4886
+ trackSearch(searchAnalyticsObject: any): void;
4887
+ trackSearchSuggest(searchAnalyticsObject: any): void;
4888
+ /**
4889
+ * Sets the current global context of the Analytics class.
4890
+ * @method setContext
4891
+ * @param context {String} The Analytics context to be set.
4892
+ * @hidden
4893
+ */
4894
+ static setContext(context: any): void;
4895
+ /**
4896
+ * Sets the current global context of the Analytics class to undefined.
4897
+ * @method clearContext
4898
+ * @hidden
4899
+ */
4900
+ static clearContext(): void;
4901
+ /**
4902
+ * Enum of valid bluedot events.
4903
+ * Pass a property of this into the {{#crossLink "Analytics/trackBlueDotEvent:method"}}{{/crossLink}} method.
4904
+ * Valid properties are: ATTEMPT_BLUEDOT, FOUND_POSITION, FOUND_FLOOR.
4905
+ * @property BLUEDOT_EVENT {Object}
4906
+ * @example
4907
+ * Analytics.trackBlueDotEvent(Analytics.BLUEDOT_EVENT.ATTEMPT_BLUEDOT)
4908
+ */
4909
+ static BLUEDOT_EVENT: {
4910
+ ATTEMPT_BLUEDOT: string;
4911
+ FOUND_POSITION: string;
4912
+ FOUND_FLOOR: string;
4913
+ };
4914
+ }
4915
+ export type { IAnalytics };
4916
+ export default Analytics;
4917
+ }
4918
+
4783
4919
  declare module '@mappedin/react-native-sdk/core/packages/get-venue/Mappedin.OfflineSearch' {
4784
4920
  import { Mappedin } from '@mappedin/react-native-sdk/core/packages/get-venue/Mappedin';
4785
4921
  import type { SearchOptions } from 'minisearch';
@@ -5507,6 +5643,10 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer' {
5507
5643
  export type { TGetVenueOptions, TShowVenueOptions, TMappedinOfflineSearchOptions, TMappedinOfflineSearchResult, TMappedinOfflineSearchSuggestions, TMappedinOfflineAllSearchMatch, TMappedinOfflineSearchAllOptions } from '@mappedin/react-native-sdk/core/packages/get-venue';
5508
5644
  export { Mappedin, MappedinDirections, MappedinLocation, MappedinPolygon, MappedinNode, MappedinCategory, MappedinMap, MappedinEvent, MappedinMapGroup, MappedinVenue, MappedinVortex, MappedinNavigatable, MappedinCoordinate, OfflineSearch, MAP_RENDER_MODE, setFetchFn, MappedinCollectionType } from '@mappedin/react-native-sdk/core/packages/get-venue';
5509
5645
  export { BundleAssetManager } from '@mappedin/react-native-sdk/core/packages/renderer/bundle-asset-manager';
5646
+ /**
5647
+ * @internal
5648
+ */
5649
+ export function __useSceneManager(value: boolean): void;
5510
5650
  }
5511
5651
 
5512
5652
  declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappedin.RenderTasks' {
@@ -5696,17 +5836,28 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/MapView' {
5696
5836
  */
5697
5837
  removeAllTooltips(): void;
5698
5838
  /**
5839
+ * Create a tooltip with default styling that the MapView will attempt to position in 3D space. The tooltip will be anchored
5840
+ * to a specified node or coordinate in one of eight anchor orientations.
5699
5841
  *
5700
- * This creates a tooltip that allows you to pass dynamic content which will attempt
5701
- * to position around an anchor in 3D space. The tooltip will be positioned based on one of four
5702
- * AnchorTypes (top, bottom, left, right).
5842
+ * The possible anchor types are `top`, `bottom`, `left`, `right`, `topLeft`, `topRight`, `bottomLeft`, and `bottomRight`. This
5843
+ * describes the position of the tooltip relative to the node or coordinate to which it is attached.
5703
5844
  *
5704
- *`options.defaultAnchorType` and `options.enabledAnchorTypes` should be one of the constants from Mappedin.Tooltip.ANCHOR
5845
+ * The tooltip is rendered into the DOM with the following structure.
5705
5846
  *
5706
- * `options.defaultAnchorType` will override `options.enabledAnchorTypes` if that anchor was disabled it will be automatically re-enabled
5847
+ * ```jsx
5848
+ * <div class="mappedin-tooltip tooltip--anchor-bottom-left">
5849
+ * <div class="mappedin-tooltip__content">
5850
+ * {contentHtml}
5851
+ * </ div>
5852
+ * </ div>
5853
+ * ```
5707
5854
  *
5855
+ * The `.mappedin-tooltip` element controls the position and has a class in the form of `.tooltip--anchor-{type}` that indicates
5856
+ * the current anchor type.
5708
5857
  *
5709
- * @return The Tooltip you created, which has already been added to the scene.
5858
+ * @param nodeOrCoordinate A {@link MappedinNode} or {@link MappedinCoordinate} the tooltip is attached to.
5859
+ * @param contentHtml Stringified HTML content to render within the tooltip.
5860
+ * @param options {@link TCreateTooltipOptions} for rendering the tooltip
5710
5861
  */
5711
5862
  createTooltip(
5712
5863
  /**
@@ -5714,17 +5865,20 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/MapView' {
5714
5865
  */
5715
5866
  nodeOrCoordinate: MappedinNode | MappedinCoordinate, contentHtml: string, options?: TCreateTooltipOptions): SmartTooltip;
5716
5867
  /**
5868
+ * Create a tooltip with no default styling that the MapView will attempt to position in 3D space. The tooltip will be anchored
5869
+ * to a specified node or coordinate in one of eight anchor orientations.
5717
5870
  *
5718
- * This creates a tooltip that allows you to pass dynamic content which will attempt
5719
- * to position around an anchor in 3D space. The tooltip will be positioned based on one of four
5720
- * AnchorTypes (top, bottom, left, right).
5721
- *
5722
- *`options.defaultAnchorType` and `options.enabledAnchorTypes` should be one of the constants from Mappedin.Tooltip.ANCHOR
5723
- *
5724
- * `options.defaultAnchorType` will override `options.enabledAnchorTypes` if that anchor was disabled it will be automatically re-enabled
5871
+ * The possible anchor types are `top`, `bottom`, `left`, `right`, `topLeft`, `topRight`, `bottomLeft`, and `bottomRight`. This
5872
+ * describes the position of the tooltip relative to the node or coordinate to which it is attached.
5725
5873
  *
5874
+ * Unlike {@link createTooltip}, a custom tooltip is rendered without any additional wrappers, leaving styling entirely up to the
5875
+ * external developer. The top-most element will be injected with a class in the form of `.tooltip--anchor-{type}` that indicates
5876
+ * the current anchor type.
5726
5877
  *
5727
- * @return The Tooltip you created, which has already been added to the scene.
5878
+ * @param nodeOrCoordinate A {@link MappedinNode} or {@link MappedinCoordinate} the tooltip is attached to.
5879
+ * @param contentHtml Stringified HTML content to render within the tooltip. The contents must be `position: absolute` in order to interact with the collision engine.
5880
+ * @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.
5881
+ * @param options {@link TCreateTooltipCommonOptions} for rendering the tooltip
5728
5882
  */
5729
5883
  createCustomTooltip(
5730
5884
  /**
@@ -7111,121 +7265,6 @@ declare module '@mappedin/react-native-sdk/core/packages/get-venue/MappedinTheme
7111
7265
  }
7112
7266
  }
7113
7267
 
7114
- declare module '@mappedin/react-native-sdk/core/packages/get-venue/Mappedin.CustomerAnalytics' {
7115
- import { MappedinCategory, MappedinLocation } from '@mappedin/react-native-sdk/core/packages/get-venue';
7116
- type AnalyticsOptions = {
7117
- clientId?: string;
7118
- clientSecret?: string;
7119
- accessToken?: string;
7120
- noAuth?: boolean;
7121
- venue: string;
7122
- testMode?: boolean | string;
7123
- context?: string;
7124
- platformString?: string;
7125
- };
7126
- interface IAnalytics {
7127
- locationSelected(location: MappedinLocation): void;
7128
- categorySelected(category: MappedinCategory): void;
7129
- getDirections(start: MappedinLocation, end: MappedinLocation): void;
7130
- }
7131
- interface IInternalAnalytics extends IAnalytics {
7132
- track(target: string, query: any): void;
7133
- mapViewLoaded(type: '2d' | '3d', forced: boolean, benchmark: number, reason: string): void;
7134
- getSessionID(): string;
7135
- getDeviceID(): string;
7136
- setGeolocationMode(mode: boolean): void;
7137
- trackBlueDotEvent(blueDotEvent: Record<string, unknown>): void;
7138
- trackSearch(searchAnalyticsObject: Record<string, unknown>): void;
7139
- trackSearchSuggest(searchAnalyticsObject: Record<string, unknown>): void;
7140
- }
7141
- /**
7142
- * A class to access the Mappedin Analytics platform. Correct usage will improve Smart Search results, and lead to more accurate insights.
7143
- * 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`.
7144
- *
7145
- * @type {any}
7146
- *
7147
- * @class Analytics
7148
- * @param options {Object} A list of configuration options for the Analytics API.
7149
- * @param [options.clientId] {String} The same key you are using for getVenue. Handled automatically in Mapview.initialize()
7150
- * @param [options.clientSecret] {String} The same secret you are using for getVenue. Handled automatically in Mapview.initialize()
7151
- * @param [options.venue] {String} The same venue slug you are using for getVenue. Handled automatically in MapView.initialize()
7152
- * @param [options.context] {String} The context to pass with the analytics request. Defaults to "websdk".
7153
- * @param [options.noAuth] {Boolean} Whether authentication should not be sent with analytics requests.
7154
- * @param [options.testMode] {Boolean} Whether analytics events should be dropped because this is running in a test environment.
7155
- */
7156
- class Analytics implements IInternalAnalytics {
7157
- #private;
7158
- constructor(options: AnalyticsOptions);
7159
- track(target: any, query: any): void;
7160
- /**
7161
- * Whenever a location is selected, you should fire this event. What "selected" means can vary by venue,
7162
- * but a good rule of thumb is that you fire the event whenever you would show the location's details.
7163
- * Typically this is when the user taps it's polygon on the map, picks it from search results or a category list.
7164
- * or deep links directly into the map.
7165
- * @method locationSelected
7166
- * @param location {MappedinLocation} The location the user selected.
7167
- */
7168
- locationSelected(location: any): void;
7169
- /**
7170
- * Whenever a category is selected, you should fire this event.
7171
- * @method categorySelected
7172
- * @param category {MappedinCategory} The category the user selected.
7173
- */
7174
- categorySelected(category: any): void;
7175
- mapViewLoaded(type: any, forced: any, benchmark: any, reason: any): void;
7176
- /**
7177
- * Whenever a user requests directions, you should fire this event.
7178
- * @method getDirections
7179
- * @param start {MappedinLocation} The start location for wayfinding.
7180
- * @param end {MappedinLocation} The end location for wayfinding.
7181
- */
7182
- getDirections(start: any, end: any): void;
7183
- getSessionID(): string;
7184
- getDeviceID(): string;
7185
- /**
7186
- * @param mode {Boolean} Indicates whether the user's geolocation is enabled.
7187
- */
7188
- setGeolocationMode(mode: any): void;
7189
- /**
7190
- * Track an event.
7191
- * @method trackBlueDotEvent
7192
- * @param event {String}
7193
- * event param should be a property of the {{#crossLink "Analytics/BLUEDOT_EVENT:property"}}{{/crossLink}} property.
7194
- */
7195
- trackBlueDotEvent(blueDotEvent: any): void;
7196
- trackSearch(searchAnalyticsObject: any): void;
7197
- trackSearchSuggest(searchAnalyticsObject: any): void;
7198
- /**
7199
- * Sets the current global context of the Analytics class.
7200
- * @method setContext
7201
- * @param context {String} The Analytics context to be set.
7202
- * @hidden
7203
- */
7204
- static setContext(context: any): void;
7205
- /**
7206
- * Sets the current global context of the Analytics class to undefined.
7207
- * @method clearContext
7208
- * @hidden
7209
- */
7210
- static clearContext(): void;
7211
- /**
7212
- * Enum of valid bluedot events.
7213
- * Pass a property of this into the {{#crossLink "Analytics/trackBlueDotEvent:method"}}{{/crossLink}} method.
7214
- * Valid properties are: ATTEMPT_BLUEDOT, FOUND_POSITION, FOUND_FLOOR.
7215
- * @property BLUEDOT_EVENT {Object}
7216
- * @example
7217
- * Analytics.trackBlueDotEvent(Analytics.BLUEDOT_EVENT.ATTEMPT_BLUEDOT)
7218
- */
7219
- static BLUEDOT_EVENT: {
7220
- ATTEMPT_BLUEDOT: string;
7221
- FOUND_POSITION: string;
7222
- FOUND_FLOOR: string;
7223
- };
7224
- }
7225
- export type { IAnalytics };
7226
- export default Analytics;
7227
- }
7228
-
7229
7268
  declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappedin.LabelAtlas' {
7230
7269
  export namespace DEFAULT_LABEL_SIZING {
7231
7270
  const MARGIN: number;