@mappedin/mappedin-js 5.46.0 → 5.47.0

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.
@@ -108,7 +108,7 @@ declare module '@mappedin/mappedin-js' {
108
108
  export { TILE_RENDER_MODES } from '@mappedin/mappedin-js/renderer/internal/outdoor-context/Mappedin.TileManager';
109
109
  export { AzureOutdoorContextProvider, OpenStreetMapOutdoorContext, } from '@mappedin/mappedin-js/renderer/internal/outdoor-context/Outdoor-Context.provider';
110
110
  export type { IOutdoorContextProvider } from '@mappedin/mappedin-js/renderer/internal/outdoor-context/Outdoor-Context.provider';
111
- export { setMaplibreWorkerURL } from '@mappedin/mappedin-js/renderer/internal';
111
+ export { setMaplibreWorkerURL, findPreferredLanguage } from '@mappedin/mappedin-js/renderer/internal';
112
112
  }
113
113
 
114
114
  declare module '@mappedin/mappedin-js/renderer/public/MapView' {
@@ -794,7 +794,7 @@ declare module '@mappedin/mappedin-js/get-venue' {
794
794
  */
795
795
  export function setFetchFn(fetchFn: any): void;
796
796
  /** Classes */
797
- export { MappedinCollectionType, MappedinNavigatable, MappedinNode, MappedinLocation, MappedinPolygon, MappedinCategory, MappedinDirections, MappedinDestinationSet, MappedinVortex, MappedinVenue, MappedinRankings, MappedinEvent, MappedinLocationState, MappedinMap, MappedinCoordinate, MappedinMapGroup, Mappedin, } from '@mappedin/mappedin-js/get-venue/internal';
797
+ export { MappedinCollectionType, MappedinNavigatable, MappedinNode, MappedinLocation, MappedinPolygon, MappedinCategory, MappedinDirections, MappedinDestinationSet, MappedinVortex, MappedinVenue, MappedinRankings, MappedinEvent, MappedinLocationState, MappedinMap, MappedinCoordinate, MappedinMapGroup, findPreferredLanguage, Mappedin, } from '@mappedin/mappedin-js/get-venue/internal';
798
798
  /**
799
799
  * @internal
800
800
  * @hidden
@@ -3910,7 +3910,7 @@ declare module '@mappedin/mappedin-js/renderer/internal' {
3910
3910
  import { TMapClickEvent } from '@mappedin/mappedin-js/renderer/MapView.types';
3911
3911
  import { MappedinMap } from '@mappedin/mappedin-js/get-venue';
3912
3912
  import { Vector3 } from '@mappedin/mvf';
3913
- export { MappedinMap, Mappedin, MappedinCoordinate, MappedinPolygon, MappedinNode, MappedinLocation, MappedinVenue, } from '@mappedin/mappedin-js/get-venue';
3913
+ export { MappedinMap, Mappedin, MappedinCoordinate, MappedinPolygon, MappedinNode, MappedinLocation, MappedinVenue, findPreferredLanguage, } from '@mappedin/mappedin-js/get-venue';
3914
3914
  export type { TEnableBlueDotOptions, TFloatingLabelAppearance, TGeolocationObject, TPathOptions, TConnectionProps, TConnectionTemplateFn, TMarkerTemplateProps, TMarkerTemplateFn, TJourneyOptions, TPadding, TCreateMarkerOptions, TAnimationOptions, TCreateTooltipInternalOptions, TCreateTooltipCommonOptions, TCreateTooltipOptions, TCreateTextTooltipOptions, TCreateCustomInnerHTMLTooltipOptions, TCreateCustomTooltipOptions, TCreateThreeDMarkerOptions, TGetPolygonsAtCoordinateOptions, TMapViewOptions, TMapViewOptionsLegacy, TFlatLabelOptions, TFlatLabelAppearance, TFloatingLabelPolygonOptions, TAddFlatLabelOptions, TAddFloatingLabelOptions, TLabelAllLocationCommonOptions, TLabelAllLocationFloatingLabelOptions, TLabelAllLocationFlatLabelOptions, TFloatingLabelAllLocationsOptions, TFlatLabelAllLocationsOptions, changeListenerFn, TMapClickEvent, E_SDK_EVENT_PAYLOAD, E_BLUEDOT_EVENT_PAYLOAD, CAMERA_EVENT_PAYLOAD, } from '@mappedin/mappedin-js/renderer/MapView.types';
3915
3915
  export { labelThemes } from '@mappedin/mappedin-js/renderer/MapView.types';
3916
3916
  export { GEOLOCATION_STATUS, COLLISION_RANKING_TIERS, E_BLUEDOT_STATE_REASON, E_BLUEDOT_STATE, E_BLUEDOT_MARKER_STATE, STATE, MARKER_ANCHOR, E_SDK_EVENT, E_BLUEDOT_EVENT, E_CAMERA_EVENT, E_CAMERA_DIRECTION, SAFE_AREA_INSET_TYPE, CAMERA_EASING_MODE, ANIMATION_TWEENS, STACKED_MAPS_STATE, } from '@mappedin/mappedin-js/renderer/MapView.enums';
@@ -4952,6 +4952,11 @@ declare module '@mappedin/mappedin-js/get-venue/Mappedin.types' {
4952
4952
  noAuth?: boolean;
4953
4953
  perspective?: string;
4954
4954
  language?: string;
4955
+ /**
4956
+ * Fallback to navigator language if the language is not available
4957
+ * @default true
4958
+ */
4959
+ fallbackToNavigatorLanguages?: boolean;
4955
4960
  headers?: {
4956
4961
  [key in string]: string;
4957
4962
  };
@@ -5018,18 +5023,18 @@ declare module '@mappedin/mappedin-js/get-venue/Mappedin.types' {
5018
5023
  declare module '@mappedin/mappedin-js/get-venue/Mappedin' {
5019
5024
  import { Navigator } from '@mappedin/mappedin-js/navigator';
5020
5025
  import type { TAllGetVenueOptions, TGetVenueOptions, TGetVenueOptionsInternal } from '@mappedin/mappedin-js/get-venue/Mappedin.types';
5021
- import type { MappedinNode, MappedinPolygon, MappedinLocation, MappedinCategory, MappedinVortex, MappedinVenue, MappedinTheme, MappedinRankings, MappedinLocationRankings, MappedinEvent, MappedinLocationState, MappedinMap, MappedinMapGroup, GET_VENUE_PAYLOAD } from '@mappedin/mappedin-js/get-venue/internal';
5022
- import { TAccessors, GET_VENUE_EVENT } from '@mappedin/mappedin-js/get-venue/internal';
5023
- import { IAnalytics } from '@mappedin/mappedin-js/get-venue/Mappedin.CustomerAnalytics';
5024
- import { ParsedMVF } from '@mappedin/mvf';
5025
- import { ParsedMVFv1 } from '@mappedin/mappedin-js/get-venue/Mappedin.MVF.types';
5026
+ import type { MappedinNode, MappedinPolygon, MappedinLocation, MappedinCategory, MappedinVortex, MappedinVenue, MappedinTheme, MappedinRankings, MappedinLocationRankings, MappedinEvent, MappedinLocationState, MappedinMap, MappedinMapGroup, GET_VENUE_PAYLOAD, TAccessors } from '@mappedin/mappedin-js/get-venue/internal';
5027
+ import { GET_VENUE_EVENT } from '@mappedin/mappedin-js/get-venue/internal';
5028
+ import type { IAnalytics } from '@mappedin/mappedin-js/get-venue/Mappedin.CustomerAnalytics';
5029
+ import type { ParsedMVF } from '@mappedin/mvf';
5030
+ import type { ParsedMVFv1 } from '@mappedin/mappedin-js/get-venue/Mappedin.MVF.types';
5026
5031
  import { PubSub } from '@mappedin/mappedin-js/get-venue/pub-sub.typed';
5027
5032
  export const defaultOptions: TGetVenueOptionsInternal<TGetVenueOptions>;
5028
5033
  export class Mappedin extends PubSub<GET_VENUE_PAYLOAD, GET_VENUE_EVENT> {
5029
5034
  #private;
5030
5035
  perspective: any;
5031
5036
  things: any;
5032
- options: any;
5037
+ options: TGetVenueOptionsInternal<TAllGetVenueOptions> & Pick<TGetVenueOptions, 'language' | 'fallbackToNavigatorLanguages'>;
5033
5038
  updatedAt?: string;
5034
5039
  categories: MappedinCategory[];
5035
5040
  locations: MappedinLocation[];
@@ -5271,6 +5276,25 @@ declare module '@mappedin/mappedin-js/get-venue/Mappedin' {
5271
5276
  */
5272
5277
  toString: (includeOptions?: boolean) => string;
5273
5278
  }
5279
+ /**
5280
+ * Finds the ideal language for the venue based on the following priority:
5281
+ * 1. User specified language (if it exists in venue languages)
5282
+ * 2. Browser navigator languages (if fallback is enabled)
5283
+ * 3. Venue's default language
5284
+ *
5285
+ * @param venue - The MappedinVenue object containing available languages
5286
+ * @param options - Configuration options
5287
+ * @param options.language - Preferred language code to use
5288
+ * @param options.fallbackToNavigatorLanguages - Whether to use browser's language settings as fallback (defaults to true)
5289
+ * @returns An object containing the selected language code and name, or undefined if no language is found
5290
+ */
5291
+ export function findPreferredLanguage(venue: MappedinVenue, options: {
5292
+ language?: string;
5293
+ fallbackToNavigatorLanguages?: boolean;
5294
+ }): {
5295
+ code: string;
5296
+ name: string;
5297
+ } | undefined;
5274
5298
  }
5275
5299
 
5276
5300
  declare module '@mappedin/mappedin-js/get-venue/default-things' {
@@ -5355,7 +5379,7 @@ declare module '@mappedin/mappedin-js/get-venue/internal' {
5355
5379
  code: string;
5356
5380
  };
5357
5381
  };
5358
- export { Mappedin } from '@mappedin/mappedin-js/get-venue/Mappedin';
5382
+ export { Mappedin, findPreferredLanguage } from '@mappedin/mappedin-js/get-venue/Mappedin';
5359
5383
  }
5360
5384
 
5361
5385
  declare module '@mappedin/mappedin-js/get-venue/Mappedin.CustomerAnalytics' {
@@ -5955,11 +5979,7 @@ declare module '@mappedin/mappedin-js/get-venue/Mappedin.OfflineSearch' {
5955
5979
  /**
5956
5980
  * Search for a term
5957
5981
  */
5958
- search(
5959
- /**
5960
- * Search term
5961
- */
5962
- term: string): Promise<TMappedinOfflineSearchResult[]>;
5982
+ search(term: string): Promise<TMappedinOfflineSearchResult[]>;
5963
5983
  /**
5964
5984
  * Export search index to JSON for storage/caching - this would avoid having to re-index
5965
5985
  * on page reload
@@ -10680,9 +10700,9 @@ declare module '@mappedin/mappedin-js/get-venue/MappedinNavigatable' {
10680
10700
  }
10681
10701
 
10682
10702
  declare module '@mappedin/mappedin-js/get-venue/MappedinNode' {
10683
- import type { MappedinPolygon, MappedinLocation, Mappedin } from '@mappedin/mappedin-js/get-venue/internal';
10703
+ import type { MappedinPolygon, MappedinLocation, Mappedin, MappedinDirections, MappedinMap, TDirectionToOptions } from '@mappedin/mappedin-js/get-venue/internal';
10684
10704
  import type { TOpeningHours } from '@mappedin/mappedin-js/get-venue/Mappedin.API.types';
10685
- import { MappedinNavigatable, MappedinDirections, MappedinDestinationSet, MappedinMap, TDirectionToOptions } from '@mappedin/mappedin-js/get-venue/internal';
10705
+ import { MappedinNavigatable, MappedinDestinationSet } from '@mappedin/mappedin-js/get-venue/internal';
10686
10706
  /**
10687
10707
  * A {@link MappedinNode} represents a position, anchored to a specific {@link MappedinMap}.
10688
10708
  *