@mappedin/viewer 0.2.0 → 0.3.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/CHANGELOG.md +7 -0
- package/README.md +54 -18
- package/dist/{browser-35S22BS6-60f2b2c3.js → browser-35S22BS6-756afc48.js} +1 -1
- package/dist/{index-7278efbe.js → index-7cb8f3c5.js} +44098 -40950
- package/dist/index.js +1 -1
- package/dist/{outdoor-context-XG4VPE4D-26915a8c.js → outdoor-context-XG4VPE4D-ab82b7cf.js} +1 -1
- package/dist/types/src/components/connection-marker/index.d.ts +1 -2
- package/dist/types/src/components/map-controls/index.d.ts +1 -0
- package/dist/types/src/components/open-app-button/index.d.ts +6 -0
- package/dist/types/src/components/open-app-button/open-app-button.stories.d.ts +2 -0
- package/dist/types/src/components/positioner/index.d.ts +1 -1
- package/dist/types/src/components/tilt-controls/utils.d.ts +1 -1
- package/dist/types/src/components/title/index.d.ts +1 -0
- package/dist/types/src/lib/types/options.d.ts +1 -0
- package/dist/types/src/lib/types/theme.d.ts +6 -0
- package/dist/types/src/stores/analytics-store/analytics-store.test.d.ts +1 -0
- package/dist/types/src/stores/analytics-store/index.d.ts +9 -0
- package/dist/types/src/stores/root-store/index.d.ts +7 -1
- package/dist/types/src/stores/router-store/index.d.ts +5 -1
- package/dist/types/src/stores/ui-store/index.d.ts +7 -0
- package/dist/types/src/theme.d.ts +1 -0
- package/package.json +5 -3
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
type TConnectionMarkerProps = {
|
|
3
3
|
type?: string;
|
|
4
|
-
|
|
4
|
+
state?: 'default' | 'selection' | 'navigation';
|
|
5
5
|
direction?: 'up' | 'down';
|
|
6
|
-
size?: number;
|
|
7
6
|
onClick?: () => void;
|
|
8
7
|
};
|
|
9
8
|
declare const ConnectionMarker: React.FC<TConnectionMarkerProps>;
|
|
@@ -2,6 +2,7 @@ import { ComponentProps } from 'react';
|
|
|
2
2
|
import TiltControls from '../tilt-controls';
|
|
3
3
|
import ZoomControls from '../zoom-controls';
|
|
4
4
|
type TMapControlsProps = {
|
|
5
|
+
tiltControlsVisible?: boolean;
|
|
5
6
|
onTiltChange?: ComponentProps<typeof TiltControls>['onChange'];
|
|
6
7
|
onZoomInClick?: ComponentProps<typeof ZoomControls>['onZoomInClick'];
|
|
7
8
|
onZoomOutClick?: ComponentProps<typeof ZoomControls>['onZoomOutClick'];
|
|
@@ -64,7 +64,7 @@ declare const Positioner: import("styled-components").IStyledComponent<"web", {
|
|
|
64
64
|
'aria-colindextext'?: string | undefined;
|
|
65
65
|
'aria-colspan'?: number | undefined;
|
|
66
66
|
'aria-controls'?: string | undefined;
|
|
67
|
-
'aria-current'?: boolean | "time" | "location" | "
|
|
67
|
+
'aria-current'?: boolean | "time" | "location" | "true" | "step" | "false" | "page" | "date" | undefined;
|
|
68
68
|
'aria-describedby'?: string | undefined;
|
|
69
69
|
'aria-description'?: string | undefined;
|
|
70
70
|
'aria-details'?: string | undefined;
|
|
@@ -4,6 +4,7 @@ export type TTheme = {
|
|
|
4
4
|
primary: string;
|
|
5
5
|
neutral: string;
|
|
6
6
|
navigation: string;
|
|
7
|
+
success: string;
|
|
7
8
|
};
|
|
8
9
|
background: string;
|
|
9
10
|
text: {
|
|
@@ -20,6 +21,11 @@ export type TTheme = {
|
|
|
20
21
|
};
|
|
21
22
|
};
|
|
22
23
|
font: string;
|
|
24
|
+
fontSize: {
|
|
25
|
+
small: number;
|
|
26
|
+
normal: number;
|
|
27
|
+
large: number;
|
|
28
|
+
};
|
|
23
29
|
map: {
|
|
24
30
|
minZoom: number;
|
|
25
31
|
pathSize: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,6 +6,8 @@ import { E_DEPARTURE_MODE } from '../../lib/types/directions';
|
|
|
6
6
|
import { E_APP_STATE } from '../../lib/types/state';
|
|
7
7
|
import RouterStore from '../router-store';
|
|
8
8
|
import { ParsedMVF } from '@mappedin/mvf';
|
|
9
|
+
import AnalyticsStore from '../analytics-store';
|
|
10
|
+
import { TStartViewerOptions, TStartViewerWithLocalDataOptions } from '../../lib/types/options';
|
|
9
11
|
export declare const RootStoreContext: import("react").Context<RootStore>;
|
|
10
12
|
declare class RootStore {
|
|
11
13
|
private reactionDisposers;
|
|
@@ -16,16 +18,19 @@ declare class RootStore {
|
|
|
16
18
|
*/
|
|
17
19
|
private routerStore;
|
|
18
20
|
readonly data: Mappedin;
|
|
21
|
+
private startupOptions;
|
|
19
22
|
/**
|
|
20
23
|
* This is only populated if the viewer is hydrated with local data (i.e. in Maker's preview).
|
|
21
24
|
*/
|
|
22
25
|
__mvfData: ParsedMVF | undefined;
|
|
23
26
|
uiStore: UIStore;
|
|
24
27
|
mapStore: MapStore;
|
|
28
|
+
analyticsStore: AnalyticsStore;
|
|
25
29
|
departureMode: E_DEPARTURE_MODE;
|
|
26
|
-
constructor({ router, data }: {
|
|
30
|
+
constructor({ router, data, startupOptions, }: {
|
|
27
31
|
router: RouterStore;
|
|
28
32
|
data: Mappedin;
|
|
33
|
+
startupOptions: TStartViewerOptions | TStartViewerWithLocalDataOptions;
|
|
29
34
|
});
|
|
30
35
|
private getInitialDepartureMode;
|
|
31
36
|
private serializeCoordinate;
|
|
@@ -40,6 +45,7 @@ declare class RootStore {
|
|
|
40
45
|
get currentMap(): MappedinMap | undefined;
|
|
41
46
|
get interactivePolygons(): MappedinPolygon[];
|
|
42
47
|
private syncDeparture;
|
|
48
|
+
get isAppEmbedded(): boolean;
|
|
43
49
|
get state(): E_APP_STATE;
|
|
44
50
|
setState(state: E_APP_STATE): void;
|
|
45
51
|
isLocationOnMap(location: MappedinLocation, map: MappedinMap): boolean;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { History } from 'history';
|
|
2
|
+
export declare const EMBED_ROUTER_PARAM = "embedded";
|
|
3
|
+
type TRouterGoOptions = {
|
|
4
|
+
clearExistingParams?: boolean;
|
|
5
|
+
};
|
|
2
6
|
declare class RouterStore {
|
|
3
7
|
private base;
|
|
4
8
|
private path;
|
|
@@ -16,7 +20,7 @@ declare class RouterStore {
|
|
|
16
20
|
path: string;
|
|
17
21
|
params: Record<string, string>;
|
|
18
22
|
};
|
|
19
|
-
go(state: string,
|
|
23
|
+
go(state: string, newParams: Record<string, string | undefined>, options?: TRouterGoOptions): void;
|
|
20
24
|
back(): void;
|
|
21
25
|
cleanup(): void;
|
|
22
26
|
}
|
|
@@ -27,6 +27,13 @@ declare class UIStore {
|
|
|
27
27
|
get directionsButtonDisabled(): boolean;
|
|
28
28
|
get directionsUIVisible(): boolean;
|
|
29
29
|
get directionsWarningVisible(): boolean;
|
|
30
|
+
get openAppLink(): string;
|
|
31
|
+
get openAppButtonVisible(): boolean;
|
|
32
|
+
get tiltControlsVisible(): boolean;
|
|
33
|
+
get shareButtonVisible(): boolean;
|
|
34
|
+
get mainUIVisible(): boolean;
|
|
35
|
+
get logoPosition(): "top-left" | "bottom-center";
|
|
36
|
+
get appPadding(): 12 | 20;
|
|
30
37
|
setTheme(theme: TTheme): void;
|
|
31
38
|
setOverrideShareButtonHandler(handler?: () => void): void;
|
|
32
39
|
setSearchQuery(query: string): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mappedin/viewer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"browser": "./dist/index.js",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -16,10 +16,12 @@
|
|
|
16
16
|
"volta": {
|
|
17
17
|
"extends": "../../package.json"
|
|
18
18
|
},
|
|
19
|
-
"dependencies": {
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"posthog-js": "^1.78.1"
|
|
21
|
+
},
|
|
20
22
|
"devDependencies": {
|
|
21
23
|
"@ladle/react": "^2.17.2",
|
|
22
|
-
"@mappedin/mappedin-js": "5.17.1-
|
|
24
|
+
"@mappedin/mappedin-js": "5.17.1-cef0746.0",
|
|
23
25
|
"@mappedin/mvf": "2.0.1-1bfe7ea.0",
|
|
24
26
|
"@testing-library/react-hooks": "^8.0.1",
|
|
25
27
|
"@types/react": "^18.2.15",
|