@mappedin/viewer 0.21.0 → 0.21.1-00a05e8.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.
@@ -2,3 +2,4 @@ export type TLevelSelectorLevel = {
2
2
  id: string;
3
3
  name: string;
4
4
  };
5
+ export declare const LEVEL_SELECTOR_ID = "level-selector";
@@ -10,7 +10,7 @@ type TMainUIProps = {
10
10
  resultsLoading: boolean;
11
11
  isMakerPreview?: boolean;
12
12
  categories: TCategory[];
13
- onResultSelected?: (ids: string[]) => void;
13
+ onResultSelected?: (ids: string[], context: 'category' | 'search-result') => void;
14
14
  onSearchBarFocus?: ComponentProps<typeof SearchBar>['onFocus'];
15
15
  onSearchBarBlur?: ComponentProps<typeof SearchBar>['onBlur'];
16
16
  maxHeight?: number;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  type TCarouselProps = {
3
3
  imageURLs: string[];
4
+ onFullScreenGalleryOpen?: () => void;
4
5
  };
5
6
  export declare const Carousel: React.FC<TCarouselProps>;
6
7
  export {};
@@ -7,6 +7,7 @@ type TDetailsSectionProps = {
7
7
  url: string;
8
8
  }[];
9
9
  collapsible?: boolean;
10
+ onLinkClick?: (url: string) => void;
10
11
  };
11
12
  declare const DetailsSection: React.FC<TDetailsSectionProps>;
12
13
  export default DetailsSection;
@@ -10,6 +10,8 @@ export type TMetadataCardProps = {
10
10
  imageURLs?: string[];
11
11
  onRequestClose?: () => void;
12
12
  onDirectionsClick?: () => void;
13
+ onFullScreenGalleryOpen?: () => void;
14
+ onLinkClick?: ComponentProps<typeof DetailsSection>['onLinkClick'];
13
15
  disableDirectionsButton?: boolean;
14
16
  isMakerPreview?: boolean;
15
17
  };
@@ -2,6 +2,7 @@
2
2
  type TLinkItemProps = {
3
3
  url: string;
4
4
  name: string;
5
+ onClick?: () => void;
5
6
  };
6
7
  declare const LinkItem: React.FC<TLinkItemProps>;
7
8
  export default LinkItem;
@@ -3,6 +3,7 @@ import Button from '../button';
3
3
  import Input from '../input';
4
4
  export declare const SEARCH_BAR_HEIGHT = 43;
5
5
  type TSearchBarProps = {
6
+ id?: string;
6
7
  placeholder: string;
7
8
  value: string;
8
9
  onValueChange: (value: string) => void;
@@ -0,0 +1,2 @@
1
+ export declare const SEARCH_BAR_ID = "search-bar";
2
+ export declare const DIRECTIONS_SEARCH_BAR_ID = "directions-search-bar";
@@ -13,3 +13,11 @@ export declare const getPosthog: () => PostHog;
13
13
  * Check if the current posthog instance is the default instance.
14
14
  */
15
15
  export declare const isDefaultPosthogInstance: () => boolean;
16
+ /**
17
+ * Control whether or not events are captured.
18
+ */
19
+ export declare const enableCapture: (enabled: boolean) => void;
20
+ /**
21
+ * Check if events are currently being captured.
22
+ */
23
+ export declare const isCaptureEnabled: () => boolean;
@@ -0,0 +1,49 @@
1
+ import { E_DEPARTURE_MODE } from '../../lib/types/directions';
2
+ import type RootStore from '../root-store';
3
+ type TAnalyticsEventPayload = {
4
+ 'select-from-map': {
5
+ placeIds: string[];
6
+ };
7
+ 'select-from-category': {
8
+ placeIds: string[];
9
+ };
10
+ 'select-from-search-result': {
11
+ placeIds: string[];
12
+ };
13
+ 'get-directions': {
14
+ mode: E_DEPARTURE_MODE;
15
+ fromIds: string[];
16
+ toIds: string[];
17
+ };
18
+ 'get-search-results': {
19
+ query: string;
20
+ };
21
+ 'get-departure-search-results': {
22
+ query: string;
23
+ };
24
+ 'change-floor': {
25
+ floorId: string;
26
+ };
27
+ 'change-departure-mode': {
28
+ mode: E_DEPARTURE_MODE;
29
+ };
30
+ 'toggle-accessibility': {
31
+ enabled: boolean;
32
+ };
33
+ 'share-button-clicked': never;
34
+ 'open-fullscreen-gallery': {
35
+ placeId: string;
36
+ };
37
+ 'open-link': {
38
+ url: string;
39
+ placeId: string;
40
+ };
41
+ };
42
+ export type TAnalyticsEvent = keyof TAnalyticsEventPayload;
43
+ type TCaptureParams<E extends TAnalyticsEvent> = TAnalyticsEventPayload[E] extends never ? [E] : [E, TAnalyticsEventPayload[E]];
44
+ declare class AnalyticsStore {
45
+ private rootStore;
46
+ constructor(rootStore: RootStore);
47
+ capture<E extends TAnalyticsEvent>(...args: TCaptureParams<E>): void;
48
+ }
49
+ export default AnalyticsStore;
@@ -27,6 +27,7 @@ declare class MapStore {
27
27
  private handleFloorChange;
28
28
  private handleFloorClick;
29
29
  private updateCurrentFloor;
30
+ private getWatermarkOptions;
30
31
  get interactionMode(): E_MAP_INTERACTION_MODE;
31
32
  init(container: HTMLElement): Promise<void>;
32
33
  cleanup(): void;
@@ -9,6 +9,7 @@ import FeatureFlagStore from '../feature-flag-store';
9
9
  import { MapData, Place, Floor, Coordinate, Geometry } from '../../lib/sdk';
10
10
  import SearchStore from '../search-store';
11
11
  import { ParsedMVF } from '@mappedin/mvf';
12
+ import AnalyticsStore from '../analytics-store';
12
13
  export declare const RootStoreContext: import("react").Context<RootStore>;
13
14
  declare class RootStore {
14
15
  private reactionDisposers;
@@ -27,11 +28,13 @@ declare class RootStore {
27
28
  */
28
29
  private mvf;
29
30
  readonly data: MapData;
31
+ readonly mapId: string | undefined;
30
32
  readonly startupOptions: TStartViewerOptions | TStartViewerWithLocalDataOptions;
31
33
  featureFlagStore: FeatureFlagStore;
32
34
  uiStore: UIStore;
33
35
  mapStore: MapStore;
34
36
  searchStore: SearchStore;
37
+ analyticsStore: AnalyticsStore;
35
38
  departureMode: E_DEPARTURE_MODE;
36
39
  isAppMobile: any;
37
40
  readonly places: Exclude<Place, Coordinate>[];
@@ -41,11 +44,12 @@ declare class RootStore {
41
44
  readonly placeNamesByCategory: Record<string, string[]>;
42
45
  readonly geometries: Geometry[];
43
46
  readonly geometriesById: Record<string, Geometry>;
44
- constructor({ router, data, startupOptions, mvf, isMobile, }: {
47
+ constructor({ router, data, startupOptions, mvf, mapId, isMobile, }: {
45
48
  router: RouterStore;
46
49
  data: MapData;
47
50
  startupOptions: TStartViewerOptions | TStartViewerWithLocalDataOptions;
48
51
  mvf?: ParsedMVF;
52
+ mapId?: string;
49
53
  isMobile: boolean;
50
54
  });
51
55
  private getInitialDepartureMode;
@@ -9,6 +9,7 @@ declare class UIStore {
9
9
  private makerPopUpDismissed;
10
10
  private lightTheme;
11
11
  private darkTheme;
12
+ private searchBarFocusTimeout?;
12
13
  searchQuery: string;
13
14
  departureSearchQuery: string;
14
15
  overrideShareButtonHandler?: () => void;
@@ -37,6 +38,7 @@ declare class UIStore {
37
38
  get zoomControlsVisible(): boolean;
38
39
  get shareButtonVisible(): any;
39
40
  get mainUIVisible(): boolean;
41
+ get mainUIMaxHeight(): number;
40
42
  get appPadding(): 20 | 0 | 15;
41
43
  get makerPopUpVisible(): boolean;
42
44
  get metadataCardVisible(): boolean;
@@ -50,7 +52,7 @@ declare class UIStore {
50
52
  setSearchQuery(query: string): void;
51
53
  setDepartureSearchQuery(query: string): void;
52
54
  handleMainUIBlur(): void;
53
- handleSearchResultSelected(ids: string[]): void;
55
+ handleSearchResultSelected(ids: string[], context: 'category' | 'search-result'): void;
54
56
  handleDepartureSearchResultSelected(ids: string[]): void;
55
57
  handleLevelSelected(level: TLevelSelectorLevel): void;
56
58
  handleDirectionsButtonClick(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mappedin/viewer",
3
- "version": "0.21.0",
3
+ "version": "0.21.1-00a05e8.0",
4
4
  "type": "module",
5
5
  "browser": "./dist/index.js",
6
6
  "license": "UNLICENSED",