@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.
- package/dist/index.js +14369 -14216
- package/dist/types/components/level-selector/utils.d.ts +1 -0
- package/dist/types/components/main/index.d.ts +1 -1
- package/dist/types/components/metadata-card/carousel.d.ts +1 -0
- package/dist/types/components/metadata-card/details-section.d.ts +1 -0
- package/dist/types/components/metadata-card/index.d.ts +2 -0
- package/dist/types/components/metadata-card/link-item.d.ts +1 -0
- package/dist/types/components/search-bar/index.d.ts +1 -0
- package/dist/types/components/search-bar/utils.d.ts +2 -0
- package/dist/types/lib/utils/posthog-utils.d.ts +8 -0
- package/dist/types/stores/analytics-store/index.d.ts +49 -0
- package/dist/types/stores/map-store/index.d.ts +1 -0
- package/dist/types/stores/root-store/index.d.ts +5 -1
- package/dist/types/stores/ui-store/index.d.ts +3 -1
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -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
|
};
|
|
@@ -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;
|