@mappedin/viewer 0.36.1-c3a0ce0.0 → 0.36.1-e3d997b.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.
Files changed (35) hide show
  1. package/dist/index.js +44549 -39168
  2. package/dist/types/src/components/card-item/index.d.ts +1 -0
  3. package/dist/types/src/components/carousel/index.d.ts +1 -0
  4. package/dist/types/src/components/categories-view/categories-view.stories.d.ts +19 -0
  5. package/dist/types/src/components/categories-view/categories.d.ts +3 -0
  6. package/dist/types/src/components/categories-view/utils.d.ts +1 -0
  7. package/dist/types/src/components/category-icon/category-icon.stories.d.ts +1 -0
  8. package/dist/types/src/components/collapsible/index.d.ts +7 -2
  9. package/dist/types/src/components/legacy-metadata-card/utils.d.ts +2 -0
  10. package/dist/types/src/components/link-item/index.d.ts +5 -0
  11. package/dist/types/src/components/main/index.d.ts +1 -32
  12. package/dist/types/src/components/main/utils.d.ts +38 -0
  13. package/dist/types/src/components/metadata-card/utils.d.ts +14 -0
  14. package/dist/types/src/index.d.ts +1 -0
  15. package/dist/types/src/lib/hooks/use-cached-value.d.ts +5 -0
  16. package/dist/types/src/lib/hooks/use-cached-value.test.d.ts +1 -0
  17. package/dist/types/src/lib/hooks/use-focus.d.ts +1 -0
  18. package/dist/types/src/lib/sdk/types.d.ts +3 -3
  19. package/dist/types/src/lib/time/utils.d.ts +7 -0
  20. package/dist/types/src/lib/utils/data-utils.d.ts +27 -4
  21. package/dist/types/src/lib/utils/icon-utils.d.ts +3 -3
  22. package/dist/types/src/lib/utils/object-utils.d.ts +8 -0
  23. package/dist/types/src/lib/utils/process-places.d.ts +3 -1
  24. package/dist/types/src/lib/utils/search-utils.d.ts +5 -2
  25. package/dist/types/src/states/location-card.d.ts +4 -0
  26. package/dist/types/src/states/main-ui.d.ts +4 -0
  27. package/dist/types/src/stores/analytics-store/index.d.ts +3 -0
  28. package/dist/types/src/stores/root-store/index.d.ts +581 -1
  29. package/dist/types/src/stores/ui-store/index.d.ts +5 -10
  30. package/dist/types/src/stores/ui-store/location-card-store.d.ts +37 -0
  31. package/dist/types/src/stores/ui-store/location-card-store.test.d.ts +1 -0
  32. package/package.json +4 -3
  33. /package/dist/types/src/components/{categories → legacy-categories}/category.d.ts +0 -0
  34. /package/dist/types/src/components/{categories → legacy-categories}/index.d.ts +0 -0
  35. /package/dist/types/src/components/{categories/categories.stories.d.ts → legacy-categories/legacy-categories.stories.d.ts} +0 -0
@@ -5,6 +5,7 @@ type TCardItemProps = {
5
5
  tabIndex?: number;
6
6
  role?: string;
7
7
  onClickOrPress?: () => void;
8
+ clickableStyling?: number;
8
9
  };
9
10
  declare const CardItem: React.FC<PropsWithChildren<TCardItemProps>>;
10
11
  export default CardItem;
@@ -6,6 +6,7 @@ type TCarouselProps = {
6
6
  width?: number | string;
7
7
  height?: number | string;
8
8
  navChevronOffsetY?: number;
9
+ hideNavChevrons?: boolean;
9
10
  };
10
11
  declare const Carousel: React.FC<PropsWithChildren<TCarouselProps>>;
11
12
  export default Carousel;
@@ -1,4 +1,23 @@
1
1
  import { Story } from '@ladle/react';
2
+ export declare const EXAMPLE_CATEGORIES: ({
3
+ id: string;
4
+ name: string;
5
+ icon: string;
6
+ results: {
7
+ label: string;
8
+ ids: string[];
9
+ }[];
10
+ parent?: undefined;
11
+ } | {
12
+ id: string;
13
+ name: string;
14
+ icon: string;
15
+ parent: string;
16
+ results: {
17
+ label: string;
18
+ ids: string[];
19
+ }[];
20
+ })[];
2
21
  export declare const Item: Story;
3
22
  export declare const Content: Story;
4
23
  export declare const Default: Story;
@@ -5,6 +5,9 @@ type TCategoriesProps = {
5
5
  onCategoryClick?: (categoryId: string) => void;
6
6
  onResultClick?: (ids: string[]) => void;
7
7
  onBackClick?: () => void;
8
+ onStateChangeEnd?: () => void;
9
+ visible?: boolean;
10
+ maxHeight?: number;
8
11
  };
9
12
  declare const Categories: import("react").ForwardRefExoticComponent<TCategoriesProps & import("react").RefAttributes<HTMLDivElement>>;
10
13
  export default Categories;
@@ -3,6 +3,7 @@ export declare const CATEGORY_CARD_TOP_BOTTOM_PADDING = 8;
3
3
  export declare const CATEGORY_ITEM_HEIGHT = 40;
4
4
  export declare const MAX_CATEGORIES_DESKTOP: 6.5;
5
5
  export declare const MAX_CATEGORIES_MOBILE: 4.5;
6
+ export declare const ALL_CATEGORIES_WIDTH_DESKTOP_PX: 400;
6
7
  export declare const useActiveCategory: (categories: TCategory[], activeCategoryId: string | undefined) => {
7
8
  activeCategory: TCategory | undefined;
8
9
  rootCategories: TCategory[];
@@ -1,2 +1,3 @@
1
1
  import { Story } from '@ladle/react';
2
2
  export declare const Default: Story;
3
+ export declare const FromUrl: Story;
@@ -1,4 +1,3 @@
1
- import { PropsWithChildren } from 'react';
2
1
  type TCollapsibleProps = {
3
2
  /**
4
3
  * Whether the content should be collapsible. If false, the full content will always be shown.
@@ -14,7 +13,13 @@ type TCollapsibleProps = {
14
13
  * expand to its natural height.
15
14
  */
16
15
  maxHeight?: number | string;
16
+ /**
17
+ * The content to render. If a function is provided, it will be called with the collapsed state.
18
+ */
19
+ children: React.ReactNode | ((props: {
20
+ collapsed: boolean;
21
+ }) => React.ReactNode);
17
22
  style?: React.CSSProperties;
18
23
  };
19
- declare const Collapsible: React.FC<PropsWithChildren<TCollapsibleProps>>;
24
+ declare const Collapsible: React.FC<TCollapsibleProps>;
20
25
  export default Collapsible;
@@ -1,6 +1,8 @@
1
1
  import ReactDOM from 'react-dom/client';
2
2
  import { TMetadataCardProps } from './card';
3
3
  /**
4
+ * @deprecated Use {@link showViewerCard} instead.
5
+ *
4
6
  * Imperative API to render the metadata card into a provided container element.
5
7
  */
6
8
  export declare const showMetadataCard: (container: Element, props: TMetadataCardProps) => ReactDOM.Root;
@@ -10,6 +10,11 @@ type TLinkItemProps = (TLinkItemWithURLProps | TLinkItemWithPhoneNumberProps) &
10
10
  * Optionally override the icon. Defaults to `link-2-16x16`.
11
11
  */
12
12
  icon?: string;
13
+ /**
14
+ * Callback function that is called when the link is clicked. The component should already handle
15
+ * opening the link. This can be used for side effects like analytics.
16
+ */
17
+ onClick?: () => void;
13
18
  };
14
19
  declare const LinkItem: React.FC<TLinkItemProps>;
15
20
  export default LinkItem;
@@ -1,34 +1,3 @@
1
- import { ComponentProps } from 'react';
2
- import { TCategory, TSearchResult } from '../../lib/types/search';
3
- import Directions from '../directions';
4
- import SearchBar from '../search-bar';
5
- import { TOnClickOrPressPayload } from '../button';
6
- type TMainUIProps = {
7
- onBlur?: () => void;
8
- query?: string;
9
- onQueryChange?: (query: string) => void;
10
- searchResults: TSearchResult[];
11
- resultsLoading: boolean;
12
- isMakerPreview?: boolean;
13
- categories: TCategory[];
14
- onResultSelected?: (ids: string[], context: 'category' | 'search-result') => void;
15
- onSearchBarFocus?: ComponentProps<typeof SearchBar>['onFocus'];
16
- onSearchBarBlur?: ComponentProps<typeof SearchBar>['onBlur'];
17
- maxHeight?: number;
18
- departureMode?: ComponentProps<typeof Directions>['departureMode'];
19
- departureModes?: ComponentProps<typeof Directions>['departureModes'];
20
- onDepartureModeChange?: ComponentProps<typeof Directions>['onDepartureModeChange'];
21
- departureQuery?: ComponentProps<typeof Directions>['departureQuery'];
22
- onDepartureQueryChange?: ComponentProps<typeof Directions>['onDepartureQueryChange'];
23
- onDepartureResultSelected?: ComponentProps<typeof Directions>['onDepartureResultSelected'];
24
- onDepartureModeResetClick?: ComponentProps<typeof Directions>['onDepartureModeResetClick'];
25
- departureSearchResults?: ComponentProps<typeof Directions>['departureSearchResults'];
26
- directionsVisible?: boolean;
27
- directionsWarningTranslationKey?: string;
28
- directionsButtonVisible?: boolean;
29
- directionsButtonDisabled?: boolean;
30
- onDirectionsButtonClick?: (e: TOnClickOrPressPayload) => void;
31
- onSwapDirectionsClick?: () => void;
32
- };
1
+ import { TMainUIProps } from './utils';
33
2
  declare const MainUI: React.FC<TMainUIProps>;
34
3
  export default MainUI;
@@ -1 +1,39 @@
1
+ import { ComponentProps } from 'react';
2
+ import { TSearchResult, TCategory } from '../../lib/types/search';
3
+ import { TOnClickOrPressPayload } from '../button';
4
+ import SearchBar from '../search-bar';
5
+ import Directions from '../directions';
6
+ type TOnResultSelected = (ids: string[], context: 'category' | 'search-result') => void;
7
+ type TSearchUIProps = {
8
+ query?: string;
9
+ onQueryChange?: (query: string) => void;
10
+ searchResults: TSearchResult[];
11
+ resultsLoading: boolean;
12
+ onResultSelected?: TOnResultSelected;
13
+ onSearchBarFocus?: ComponentProps<typeof SearchBar>['onFocus'];
14
+ onSearchBarBlur?: ComponentProps<typeof SearchBar>['onBlur'];
15
+ };
16
+ type TDirectionsUIProps = Partial<Pick<ComponentProps<typeof Directions>, 'departureMode' | 'departureModes' | 'onDepartureModeChange' | 'departureQuery' | 'departureSearchResults' | 'onDepartureQueryChange' | 'onDepartureResultSelected' | 'onDepartureModeResetClick'>> & {
17
+ onSwapDirectionsClick?: () => void;
18
+ directionsWarningTranslationKey?: string;
19
+ };
20
+ type TCategoryUIProps = {
21
+ categories: TCategory[];
22
+ activeCategoryId?: string;
23
+ onCategorySelected?: (id: string) => void;
24
+ onResultSelected?: TOnResultSelected;
25
+ onBackClick?: () => void;
26
+ };
27
+ type TSelectedPlaceUIProps = {
28
+ directionsButtonVisible?: boolean;
29
+ directionsButtonDisabled?: boolean;
30
+ onDirectionsButtonClick?: (e: TOnClickOrPressPayload) => void;
31
+ };
32
+ export type TMainUIProps = TDirectionsUIProps & TSearchUIProps & TCategoryUIProps & TSelectedPlaceUIProps & {
33
+ onBlur?: () => void;
34
+ isMakerPreview?: boolean;
35
+ maxHeight?: number;
36
+ directionsVisible?: boolean;
37
+ };
1
38
  export declare const MAIN_UI_DEFAULT_WIDTH_DESKTOP = 320;
39
+ export {};
@@ -2,6 +2,7 @@ import { ComponentProps } from 'react';
2
2
  import { TOnClickOrPressPayload } from '../button';
3
3
  import SocialsItem from '../socials-item';
4
4
  import OpeningHours from '../../lib/time/opening-hours';
5
+ import ReactDOM from 'react-dom/client';
5
6
  export declare const METADATA_CARD_WIDTH = 320;
6
7
  export declare const METADATA_CARD_PADDING = 20;
7
8
  export declare const HERO_IMAGE_HEIGHT = 200;
@@ -83,6 +84,10 @@ export type TMetadataCardProps = {
83
84
  * Callback when the location link is clicked to copy a deep link to the location.
84
85
  */
85
86
  onCopyLocationLink?: () => void;
87
+ /**
88
+ * Callback when a category is clicked.
89
+ */
90
+ onCategoryClick?: (category: string) => void;
86
91
  /**
87
92
  * Optionally disable the directions button.
88
93
  */
@@ -102,3 +107,12 @@ export declare const useMetadataCard: (options: TMetadataCardProps) => {
102
107
  name: string;
103
108
  }[]) | null;
104
109
  };
110
+ /**
111
+ * Imperative API to render the viewer's metadata card into a provided container element.
112
+ */
113
+ export declare const showViewerCard: (container: Element, props: TMetadataCardProps) => ReactDOM.Root;
114
+ /**
115
+ * A React component that renders the viewer's metadata card with a theme provider so it can
116
+ * be used externally.
117
+ */
118
+ export declare const ViewerCard: React.FC<TMetadataCardProps>;
@@ -9,6 +9,7 @@ declare const start: (options: TStartViewerOptions) => void;
9
9
  declare const startWithLocalData: (options: TStartViewerWithLocalDataOptions) => void;
10
10
  export { default as MetadataCard } from './components/legacy-metadata-card/card';
11
11
  export { showMetadataCard } from './components/legacy-metadata-card/utils';
12
+ export { ViewerCard, showViewerCard } from './components/metadata-card/utils';
12
13
  export * from './lib/utils/image-utils';
13
14
  export { startWithLocalData };
14
15
  export default start;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Returns the latest defined value passed to the hook.
3
+ */
4
+ declare const useCachedValue: <T>(value: T) => T | undefined;
5
+ export default useCachedValue;
@@ -7,6 +7,7 @@ declare const useFocus: <T extends HTMLElement>(ref: React.RefObject<T>, options
7
7
  onFocus?: () => void;
8
8
  onKeyboardFocus?: () => void;
9
9
  onBlur?: () => void;
10
+ debug?: boolean;
10
11
  }>) => {
11
12
  isFocused: boolean;
12
13
  };
@@ -1,6 +1,6 @@
1
- import { Space, MapObject, PointOfInterest, Connection, Annotation, Coordinate, Door, CameraTransform as _CameraTransform, TEventPayload as _TEventPayload, TEvents, Area } from './mappedin-js';
2
- export declare const PLACE_TYPES: (typeof Space | typeof PointOfInterest | typeof Connection | typeof MapObject | typeof Door | typeof Coordinate | typeof Annotation | typeof Area)[];
3
- export declare const PLACE_TYPE_STRINGS: ("area" | "space" | "point-of-interest" | "connection" | "object" | "door" | "coordinate" | "annotation")[];
1
+ import { Space, MapObject, PointOfInterest, Connection, Annotation, Coordinate, Door, CameraTransform as _CameraTransform, TEventPayload as _TEventPayload, TEvents, Area, LocationProfile } from './mappedin-js';
2
+ export declare const PLACE_TYPES: (typeof Space | typeof PointOfInterest | typeof Connection | typeof MapObject | typeof Door | typeof Coordinate | typeof Annotation | typeof Area | typeof LocationProfile)[];
3
+ export declare const PLACE_TYPE_STRINGS: ("location-profile" | "space" | "point-of-interest" | "connection" | "object" | "door" | "coordinate" | "annotation" | "area")[];
4
4
  export type PlaceTypeString = (typeof PLACE_TYPE_STRINGS)[number];
5
5
  export type PlaceType = (typeof PLACE_TYPES)[number];
6
6
  export type Place = InstanceType<PlaceType>;
@@ -32,3 +32,10 @@ export declare function singleDayOpeningHoursTimes(hours: null): null;
32
32
  export declare function singleDayOpeningHoursTimes(hours: [TTimeRange]): [Time, Time];
33
33
  export declare function singleDayOpeningHoursTimes(hours: [TTimeRange, TTimeRange]): [Time, Time, Time, Time];
34
34
  export declare function singleDayOpeningHoursTimes(hours: TSingleDayOpeningHours): [Time, Time] | [Time, Time, Time, Time] | null;
35
+ /**
36
+ * Parse a time string in the format of 'HH:MM' into hours and minutes.
37
+ */
38
+ export declare const parseTimeString: (time: string) => {
39
+ hours: number;
40
+ minutes: number;
41
+ };
@@ -1,4 +1,5 @@
1
- import { Annotation, Connection, Place, Space, Coordinate, TNavigationTarget, Floor } from '../sdk';
1
+ import { Annotation, Connection, Place, Space, Coordinate, TNavigationTarget, Floor, LocationProfile } from '../sdk';
2
+ import OpeningHours from '../time/opening-hours';
2
3
  /**
3
4
  * Whether the location can be assumed to be a washroom
4
5
  */
@@ -15,6 +16,7 @@ export declare const hasName: (place: Place) => boolean;
15
16
  * Whether the location has any metadata other than name
16
17
  */
17
18
  export declare const hasMetaData: (place: Place) => boolean;
19
+ export declare const hasLocationProfiles: (place: Place) => boolean;
18
20
  /**
19
21
  * Whether the location has a name or any other metadata
20
22
  */
@@ -57,6 +59,7 @@ export declare const getCameraTargetsForPlaces: (places: Floor | Place | Place[]
57
59
  readonly floor: Floor;
58
60
  readonly coordinate: Coordinate;
59
61
  readonly externalId: string;
62
+ readonly locationProfiles: LocationProfile[];
60
63
  readonly geoJSON: {
61
64
  properties: null;
62
65
  type: import("@mappedin/mvf").FeatureType;
@@ -72,9 +75,11 @@ export declare const getCameraTargetsForPlaces: (places: Floor | Place | Place[]
72
75
  latitude: number;
73
76
  longitude: number;
74
77
  floor: string | undefined;
78
+ verticalOffset: number;
75
79
  };
76
80
  };
77
81
  destroy(): void;
82
+ "__#57@#private": any;
78
83
  readonly id: string;
79
84
  links: {
80
85
  "__#22@#private": any;
@@ -101,6 +106,7 @@ export declare const getCameraTargetsForPlaces: (places: Floor | Place | Place[]
101
106
  destroy(): void;
102
107
  readonly id: string;
103
108
  }[];
109
+ readonly geoJSONBoundingBox: {};
104
110
  } | Connection | import("@mappedin/mappedin-js/mappedin-js/src/map-data-objects/object").MapObject | {
105
111
  "__#15@#private": any;
106
112
  readonly __type: "door";
@@ -110,6 +116,7 @@ export declare const getCameraTargetsForPlaces: (places: Floor | Place | Place[]
110
116
  readonly floor: Floor;
111
117
  readonly center: Coordinate;
112
118
  readonly isExterior: boolean;
119
+ readonly locationProfiles: LocationProfile[];
113
120
  readonly geoJSON: {
114
121
  properties: null;
115
122
  type: import("@mappedin/mvf").FeatureType;
@@ -125,9 +132,11 @@ export declare const getCameraTargetsForPlaces: (places: Floor | Place | Place[]
125
132
  latitude: number;
126
133
  longitude: number;
127
134
  floor: string | undefined;
135
+ verticalOffset: number;
128
136
  };
129
137
  };
130
138
  destroy(): void;
139
+ "__#57@#private": any;
131
140
  readonly id: string;
132
141
  links: {
133
142
  "__#22@#private": any;
@@ -154,7 +163,8 @@ export declare const getCameraTargetsForPlaces: (places: Floor | Place | Place[]
154
163
  destroy(): void;
155
164
  readonly id: string;
156
165
  }[];
157
- } | Coordinate | Annotation | Floor | (Space | {
166
+ readonly geoJSONBoundingBox: {};
167
+ } | Coordinate | Annotation | LocationProfile | Floor | (Space | {
158
168
  "__#20@#private": any;
159
169
  readonly __type: "point-of-interest";
160
170
  readonly name: string;
@@ -162,6 +172,7 @@ export declare const getCameraTargetsForPlaces: (places: Floor | Place | Place[]
162
172
  readonly floor: Floor;
163
173
  readonly coordinate: Coordinate;
164
174
  readonly externalId: string;
175
+ readonly locationProfiles: LocationProfile[];
165
176
  readonly geoJSON: {
166
177
  properties: null;
167
178
  type: import("@mappedin/mvf").FeatureType;
@@ -177,9 +188,11 @@ export declare const getCameraTargetsForPlaces: (places: Floor | Place | Place[]
177
188
  latitude: number;
178
189
  longitude: number;
179
190
  floor: string | undefined;
191
+ verticalOffset: number;
180
192
  };
181
193
  };
182
194
  destroy(): void;
195
+ "__#57@#private": any;
183
196
  readonly id: string;
184
197
  links: {
185
198
  "__#22@#private": any;
@@ -206,6 +219,7 @@ export declare const getCameraTargetsForPlaces: (places: Floor | Place | Place[]
206
219
  destroy(): void;
207
220
  readonly id: string;
208
221
  }[];
222
+ readonly geoJSONBoundingBox: {};
209
223
  } | Connection | import("@mappedin/mappedin-js/mappedin-js/src/map-data-objects/object").MapObject | {
210
224
  "__#15@#private": any;
211
225
  readonly __type: "door";
@@ -215,6 +229,7 @@ export declare const getCameraTargetsForPlaces: (places: Floor | Place | Place[]
215
229
  readonly floor: Floor;
216
230
  readonly center: Coordinate;
217
231
  readonly isExterior: boolean;
232
+ readonly locationProfiles: LocationProfile[];
218
233
  readonly geoJSON: {
219
234
  properties: null;
220
235
  type: import("@mappedin/mvf").FeatureType;
@@ -230,9 +245,11 @@ export declare const getCameraTargetsForPlaces: (places: Floor | Place | Place[]
230
245
  latitude: number;
231
246
  longitude: number;
232
247
  floor: string | undefined;
248
+ verticalOffset: number;
233
249
  };
234
250
  };
235
251
  destroy(): void;
252
+ "__#57@#private": any;
236
253
  readonly id: string;
237
254
  links: {
238
255
  "__#22@#private": any;
@@ -259,10 +276,16 @@ export declare const getCameraTargetsForPlaces: (places: Floor | Place | Place[]
259
276
  destroy(): void;
260
277
  readonly id: string;
261
278
  }[];
262
- } | Coordinate | Annotation)[];
279
+ readonly geoJSONBoundingBox: {};
280
+ } | Coordinate | Annotation | LocationProfile)[];
263
281
  export declare const getSearchIdForPlace: (place: Place) => string | undefined;
264
- export declare const getCategoryIdForPlace: (place: Place) => string;
282
+ export declare const getFloors: (place: Exclude<Place, Coordinate>) => Floor[];
283
+ export declare const getPlacesForLocation: (location: LocationProfile) => Exclude<Place, LocationProfile | Coordinate>[];
265
284
  /**
266
285
  * Check if a place is on a floor.
267
286
  */
268
287
  export declare const isOnFloor: (place: Place, floor: Floor | string | undefined) => boolean;
288
+ /**
289
+ * Convert the opening hours format from the SDK to a format the viewer wants to render.
290
+ */
291
+ export declare const convertHours: (hours: LocationProfile["openingHours"], tz?: string) => OpeningHours;
@@ -16,6 +16,6 @@ export declare const loadSelfServeIcon: (type: keyof typeof SelfServeIcons, id:
16
16
  */
17
17
  export declare const getIconAsString: (icon: string, color?: string) => string;
18
18
  export declare const attemptIconNameForConnection: (type: string) => string;
19
- export declare const attemptIconNameForLocation: (place: Place) => string;
20
- export declare const attemptIconForLocation: (place: Place, color?: string) => string | undefined;
21
- export declare const attemptIconImageForLocation: (place: Place) => string | undefined;
19
+ export declare const attemptIconNameForPlace: (place: Place) => string;
20
+ export declare const attemptIconForPlace: (place: Place, color?: string) => string | undefined;
21
+ export declare const attemptIconImageForPlace: (place: Place) => string | undefined;
@@ -11,4 +11,12 @@ type SetValues<T> = Required<T>[SetKeys<T>] extends Set<infer U> ? U : never;
11
11
  * Add a value to a set property of an object, creating the set if it doesn't exist.
12
12
  */
13
13
  export declare const safeAdd: <T extends object>(object: T, key: SetKeys<T>, value: SetValues<T>) => void;
14
+ /**
15
+ * Whether the object has an array property with a length greater than 0.
16
+ */
17
+ export declare const hasArray: <T extends object>(object: T, key: string) => boolean;
18
+ /**
19
+ * Whether the object has a string property with a length greater than 0.
20
+ */
21
+ export declare const hasString: <T extends object>(object: T, key: string) => boolean;
14
22
  export {};
@@ -1,4 +1,4 @@
1
- import { Area, Coordinate, Floor, Geometry, MapData, Place, PlaceTypeString } from '../sdk';
1
+ import { Area, Coordinate, Floor, Geometry, LocationCategory, MapData, LocationProfile, Place, PlaceTypeString } from '../sdk';
2
2
  import rbush from '@turf/geojson-rbush';
3
3
  import { GeoJsonProperties, Point, Polygon, Geometry as GeoJSONGeometry } from 'geojson';
4
4
  type RBush<G extends GeoJSONGeometry, P extends GeoJsonProperties> = ReturnType<typeof rbush<G, P>>;
@@ -19,7 +19,9 @@ type TProcessedPlaces = {
19
19
  geometriesById: Record<string, Geometry>;
20
20
  sortedPlaceNames: string[];
21
21
  floorsByNameNormalized: Record<string, Floor>;
22
+ categoriesByNameNormalized: Record<string, LocationCategory>;
22
23
  rbushByFloorId: Record<string, RBush<Point | Polygon, TLookupProperties>>;
24
+ locationsByPlaceId: Record<string, LocationProfile[]>;
23
25
  };
24
26
  /**
25
27
  * Generate a bunch of useful immutable collections from the map data.
@@ -1,14 +1,17 @@
1
- import { Hyperlink } from '../sdk';
1
+ import { LocationLink } from '@mappedin/mvf';
2
+ import { Hyperlink, LocationCategory } from '../sdk';
2
3
  import { TMatch } from '../types/search';
3
4
  export declare const MIN_QUERY_LENGTH: 2;
4
5
  export declare const LINK_INDEXING_JOIN_CHAR = " ";
6
+ export declare const CATEGORY_INDEXING_JOIN_CHAR = ",";
5
7
  type TMatchDisplayData = {
6
8
  categoryMatchTerms: string[];
7
9
  labelMatchTerms: string[];
8
10
  detailsText: string;
9
11
  detailsMatchTerms: string[];
10
12
  };
11
- export declare const formatLinksForIndexing: (links: Hyperlink[]) => string;
13
+ export declare const formatLinksForIndexing: (links: Hyperlink[] | LocationLink[]) => string;
14
+ export declare const formatCategoriesForIndexing: (categories: LocationCategory[]) => string;
12
15
  export declare const getDetailsMatchText: (matches: TMatch[], maxLength: number, debug?: boolean) => string;
13
16
  export declare const getMatchData: (matches: TMatch[], maxDetailTextLength: number, debug?: boolean) => TMatchDisplayData;
14
17
  export {};
@@ -0,0 +1,4 @@
1
+ declare const LocationCard: (() => import("react").JSX.Element) & {
2
+ displayName: string;
3
+ };
4
+ export default LocationCard;
@@ -0,0 +1,4 @@
1
+ declare const MainUI: (() => import("react").JSX.Element | null) & {
2
+ displayName: string;
3
+ };
4
+ export default MainUI;
@@ -11,6 +11,9 @@ type TAnalyticsEventPayload = {
11
11
  'select-from-search-result': {
12
12
  placeIds: string[];
13
13
  };
14
+ 'select-category': {
15
+ categoryId: string;
16
+ };
14
17
  'get-directions': {
15
18
  mode: E_DEPARTURE_MODE;
16
19
  fromIds: string[];