@mappedin/viewer 0.24.11-8cc83e5.0 → 0.24.11-e020d79.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.
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export declare const DIRECTIONS_LABEL_WIDTH = 53;
3
+ type TDirectionsLabelsProps = {
4
+ visible: boolean;
5
+ };
6
+ declare const DirectionsLabels: React.FC<TDirectionsLabelsProps>;
7
+ export default DirectionsLabels;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export declare const SWAP_BUTTON_WIDTH = 32;
3
+ type TSwapButtonProps = {
4
+ onClick?: () => void;
5
+ visible: boolean;
6
+ };
7
+ declare const SwapButton: React.FC<TSwapButtonProps>;
8
+ export default SwapButton;
@@ -27,6 +27,7 @@ type TMainUIProps = {
27
27
  directionsButtonVisible?: boolean;
28
28
  directionsButtonDisabled?: boolean;
29
29
  onDirectionsButtonClick?: () => void;
30
+ onSwapDirectionsClick?: () => void;
30
31
  };
31
32
  declare const MainUI: React.FC<TMainUIProps>;
32
33
  export default MainUI;
@@ -4,3 +4,4 @@ export type DeepPartial<T> = T extends object ? {
4
4
  export type KeysOf<T, U> = Exclude<{
5
5
  [K in keyof T]: Required<T>[K] extends U ? K : never;
6
6
  }[keyof T], undefined>;
7
+ export type Promisify<T> = T extends (...args: infer Args) => infer ReturnType ? ReturnType extends Promise<unknown> ? (...args: Args) => ReturnType : (...args: Args) => Promise<ReturnType> : never;
@@ -0,0 +1,5 @@
1
+ import { Promisify } from '../types/utils';
2
+ /**
3
+ * Debounce a function to only execute after a certain delay has passed since the last call.
4
+ */
5
+ export declare const debounce: <T extends (...args: any[]) => any>(fn: T, delay: number) => Promisify<T>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,9 +1,10 @@
1
1
  import type RootStore from '../../root-store';
2
2
  import type MapStore from '..';
3
- import { MapView, Place, TCameraAnimationOptions, TEvents } from '../../../lib/sdk';
3
+ import { Place, TCameraAnimationOptions, TEvents, TFocusOnOptions } from '../../../lib/sdk';
4
4
  export declare const ZOOM_FACTOR = 1.025;
5
5
  export declare const TILT_FACTOR = 1.05;
6
6
  export declare const CAMERA_ANIMATION_OPTIONS: TCameraAnimationOptions;
7
+ export declare const FOCUS_ON_DEBOUNCE_MS = 250;
7
8
  type TPadding = {
8
9
  top: number;
9
10
  right: number;
@@ -38,7 +39,7 @@ declare class CameraController {
38
39
  handleCameraChange(payload?: TEvents['camera-change']): void;
39
40
  handleUserInteractionStart(): void;
40
41
  handleUserInteractionEnd(): void;
41
- focusOn(targets: Place | Place[], options?: Parameters<MapView['Camera']['focusOn']>[1]): Promise<void>;
42
+ focusOn: (targets: Place | Place[], options?: TFocusOnOptions | undefined) => Promise<void>;
42
43
  zoomIn(): Promise<void>;
43
44
  zoomOut(): Promise<void>;
44
45
  resetZoom(): Promise<void>;
@@ -65,7 +65,12 @@ declare class RootStore {
65
65
  isMobile: boolean;
66
66
  theme: TTheme;
67
67
  });
68
- private getInitialDepartureMode;
68
+ /**
69
+ * Compute what the new departure mode should be based on the current URL parameters. This can be
70
+ * used to determine a departure mode before the `syncDeparture` reaction runs, which will clear
71
+ * out departure places that do not match the current departure mode.
72
+ */
73
+ private inferDepartureMode;
69
74
  private syncState;
70
75
  private syncCurrentFloor;
71
76
  private syncDeparture;
@@ -135,7 +140,14 @@ declare class RootStore {
135
140
  * Only use this from within the editor preview.
136
141
  */
137
142
  setSelectedPlacesByMVFIds(ids: string[]): void;
138
- setDepartures(departures: Place[] | undefined): void;
143
+ /**
144
+ * Update the current departure places. By default, this will clear out departures that do not match
145
+ * the current departure mode. Alternatively, you can pass in `updateDepartureMode: true` to force the
146
+ * departure mode to be updated based on the new departures.
147
+ */
148
+ setDepartures(departures: Place[] | undefined, options?: Partial<{
149
+ updateDepartureMode: boolean;
150
+ }>): void;
139
151
  setCurrentFloor(floor: Floor | undefined): void;
140
152
  setDepartureMode(mode: E_DEPARTURE_MODE): void;
141
153
  setIsAppMobile(isMobile: boolean): void;
@@ -5,7 +5,6 @@ declare class SearchStore {
5
5
  private rootStore;
6
6
  private reactionDisposers;
7
7
  private index?;
8
- private debounceSearch;
9
8
  private internalResults;
10
9
  private queryString;
11
10
  initialized: boolean;
@@ -17,7 +16,6 @@ declare class SearchStore {
17
16
  private extractField;
18
17
  private fallbackSearch;
19
18
  private search;
20
- private updateResultsImmediately;
21
19
  private updateResultsDebounced;
22
20
  private getResultId;
23
21
  private getSearchResult;
@@ -57,6 +57,7 @@ declare class UIStore {
57
57
  handleDirectionsButtonClick(): void;
58
58
  handleDepartureModeSelected(mode: E_DEPARTURE_MODE): void;
59
59
  handleResetDepartureClick(): void;
60
+ handleSwapDirectionsClick(): void;
60
61
  handleMetadataCardClose(): void;
61
62
  hideDroppedPinNotification(): void;
62
63
  /**
@@ -20,6 +20,7 @@ type TTestWithMapResult<MV = TMapViewWithTestUtilities> = {
20
20
  mvf: ParsedMVF;
21
21
  waitForSearchResults: () => Promise<void>;
22
22
  waitForSearchIndexing: () => Promise<void>;
23
+ waitForCameraSettled: () => Promise<void>;
23
24
  };
24
25
  export declare const testWithMap: <MV = TMapViewWithTestUtilities>(venueFileName?: string, options?: TTestWithMapOptions) => Promise<TTestWithMapResult<MV>>;
25
26
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mappedin/viewer",
3
- "version": "0.24.11-8cc83e5.0",
3
+ "version": "0.24.11-e020d79.0",
4
4
  "type": "module",
5
5
  "browser": "./dist/index.js",
6
6
  "license": "UNLICENSED",