@mappedin/viewer 0.24.11-e020d79.0 → 0.25.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.
@@ -9,6 +9,10 @@ type TAnimatedMetadataCardProps = {
9
9
  disableDirectionsButton: ComponentProps<typeof MetadataCard>['disableDirectionsButton'];
10
10
  onFullScreenGalleryOpen: ComponentProps<typeof MetadataCard>['onFullScreenGalleryOpen'];
11
11
  onLinkClick: ComponentProps<typeof MetadataCard>['onLinkClick'];
12
+ overrideName?: ComponentProps<typeof MetadataCard>['name'];
13
+ overrideDescription?: ComponentProps<typeof MetadataCard>['description'];
14
+ overrideLinks?: ComponentProps<typeof MetadataCard>['links'];
15
+ overrideImageURLs?: ComponentProps<typeof MetadataCard>['imageURLs'];
12
16
  };
13
17
  declare const AnimatedMetadataCard: React.FC<TAnimatedMetadataCardProps>;
14
18
  export default AnimatedMetadataCard;
@@ -1,6 +1,15 @@
1
- import { Feature, Geometry, Point } from '@mappedin/mvf';
1
+ import { Details, Feature, Geometry, Point, SpaceProperties } from '@mappedin/mvf';
2
2
  /**
3
- * Type guard to check if a feature is a point geometry. Mostly used to type
4
- * narrow when array filtering.
3
+ * Type guard to check if a feature is a point geometry.
5
4
  */
6
5
  export declare const isPointGeometry: <Properties extends object>(feature: Feature<Geometry, Properties>) => feature is Feature<Point, Properties>;
6
+ /**
7
+ * Type guard to check if a feature is a point space representing a connection.
8
+ */
9
+ export declare const isConnectionSpace: (feature: Feature<Geometry, object>) => feature is Feature<Point, SpaceProperties>;
10
+ /**
11
+ * Type guard to check if a feature has {@link Details} in its properties.
12
+ */
13
+ export declare const isDetailedFeature: (feature: Feature<Geometry, unknown>) => feature is Feature<Geometry, {
14
+ details: Details;
15
+ }>;
@@ -1,6 +1,17 @@
1
1
  import { ParsedMVF } from '@mappedin/mvf';
2
2
  declare const createEmptyProcessedMVF: () => {
3
3
  spacesById: Record<string, import("@mappedin/mvf").Feature<import("@mappedin/mvf").Polygon | import("@mappedin/mvf").LineString | import("@mappedin/mvf").Point, import("@mappedin/mvf").SpaceProperties>>;
4
+ obstructionsById: Record<string, import("@mappedin/mvf").Feature<import("@mappedin/mvf").Polygon | import("@mappedin/mvf").LineString, import("@mappedin/mvf").ObstructionProperties>>;
5
+ annotationsById: Record<string, {
6
+ type: "Feature";
7
+ geometry: import("@mappedin/mvf").Point;
8
+ properties: import("@mappedin/mvf").AnnotationProperties;
9
+ }>;
10
+ entrancesById: Record<string, import("@mappedin/mvf").Feature<import("@mappedin/mvf").LineString, import("@mappedin/mvf").EntranceProperties>>;
11
+ floorIdByFeatureId: Record<string, string>;
12
+ /**
13
+ * Special indexes for handling connections.
14
+ */
4
15
  connectionSpaceIdsByLatLonFloor: Record<string, Set<string>>;
5
16
  connectionSpaceIdsByLatLon: Record<string, Set<string>>;
6
17
  connectionSpaceIdsByRelatedConnectionId: Record<string, Set<string>>;
@@ -8,6 +8,7 @@ type TMarker = {
8
8
  elementFn: () => ReactNode | Promise<ReactNode>;
9
9
  onPointerDown?: () => void;
10
10
  onClick?: () => void;
11
+ onWheel?: (e: WheelEvent) => void;
11
12
  coordinate: Coordinate;
12
13
  options?: TAddMarkerOptions;
13
14
  animationDuration?: number;
@@ -8,7 +8,7 @@ import { TStartViewerOptions, TStartViewerWithLocalDataOptions } from '../../lib
8
8
  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
- import { Feature, ParsedMVF, Point, SpaceProperties } from '@mappedin/mvf';
11
+ import { Feature, ParsedMVF, Point, SpaceProperties, Geometry as MVFGeometry } from '@mappedin/mvf';
12
12
  import AnalyticsStore from '../analytics-store';
13
13
  import { TTheme } from '../../lib/types/theme';
14
14
  export declare const RootStoreContext: import("react").Context<RootStore>;
@@ -40,10 +40,21 @@ declare class RootStore {
40
40
  analyticsStore: AnalyticsStore;
41
41
  departureMode: E_DEPARTURE_MODE;
42
42
  isAppMobile: any;
43
+ /**
44
+ * MVF dictionaries. These should not be exposed outside the root store. The rest of the app should
45
+ * know as little about MVF as possible.
46
+ */
43
47
  private readonly spacesById;
48
+ private readonly obstructionsById;
49
+ private readonly annotationsById;
50
+ private readonly entrancesById;
51
+ private readonly floorIdByFeatureId;
44
52
  private readonly connectionSpaceIdsByLatLonFloor;
45
53
  private readonly connectionSpaceIdsByLatLon;
46
54
  private readonly connectionSpaceIdsByRelatedConnectionId;
55
+ /**
56
+ * SDK data dictionaries.
57
+ */
47
58
  readonly places: Exclude<Place, Coordinate>[];
48
59
  readonly placesById: Record<string, Exclude<Place, Coordinate>>;
49
60
  readonly placesByName: Record<string, Exclude<Place, Coordinate>[]>;
@@ -78,6 +89,7 @@ declare class RootStore {
78
89
  * Try and find an array of {@link Place} objects by ID, name, or serialized coordinate.
79
90
  */
80
91
  private resolvePlaces;
92
+ private getMVFFeatureById;
81
93
  get title(): string;
82
94
  get isMakerPreview(): boolean;
83
95
  get directionsUnavailable(): boolean;
@@ -124,6 +136,9 @@ declare class RootStore {
124
136
  get floorsSortedByElevation(): Floor[];
125
137
  get floorClosestToGroundLevel(): Floor;
126
138
  get selectedPlaces(): Place[] | undefined;
139
+ get selectedMVFFeatures(): Feature<MVFGeometry, {
140
+ id: string;
141
+ }>[] | undefined;
127
142
  get departures(): Place[] | undefined;
128
143
  get placeIdsWithImageLabels(): Set<string>;
129
144
  get me(): Coordinate | undefined;
@@ -152,6 +167,9 @@ declare class RootStore {
152
167
  setDepartureMode(mode: E_DEPARTURE_MODE): void;
153
168
  setIsAppMobile(isMobile: boolean): void;
154
169
  setIsAccessible(isAccessible: boolean): void;
170
+ isMVFFeatureOnFloor(feature: Feature<MVFGeometry, {
171
+ id: string;
172
+ }>, floor: Floor): boolean;
155
173
  getMVFConnectionByCoordinate(coordinate: Coordinate): Feature<Point, SpaceProperties> | undefined;
156
174
  cleanup(): void;
157
175
  }
@@ -45,6 +45,16 @@ declare class UIStore {
45
45
  get metadataCardVisible(): boolean;
46
46
  get availableDepartureModes(): E_DEPARTURE_MODE[];
47
47
  get accessibilityToggleVisible(): boolean;
48
+ /**
49
+ * The SDK has some issues handling connection metadata, so if a connection is selected, we must process its metadata
50
+ * directly from the MVF.
51
+ */
52
+ get overrideDetails(): {
53
+ name: string;
54
+ description: string;
55
+ images: string[];
56
+ links: import("@mappedin/mvf").Hyperlink[];
57
+ } | undefined;
48
58
  setTheme(theme: TTheme): void;
49
59
  dismissMakerPopUp(): void;
50
60
  setOverrideShareButtonHandler(handler?: () => void): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mappedin/viewer",
3
- "version": "0.24.11-e020d79.0",
3
+ "version": "0.25.0",
4
4
  "type": "module",
5
5
  "browser": "./dist/index.js",
6
6
  "license": "UNLICENSED",