@osm-editor-kit/street-imagery-react 0.1.0-alpha.7 → 0.1.0-alpha.9

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,19 @@
1
+ import { type Bbox, type MapFeatureImages, type ProviderId, type TargetImage } from '@osm-editor-kit/street-imagery';
2
+ export type SelectedMapFeatureLayerProps = {
3
+ /** From `useSelectedMapillaryFeature`. Nothing is drawn without it. */
4
+ data: MapFeatureImages | null;
5
+ /** The shown photo of the feature: a dotted line runs from its camera to the feature. */
6
+ shownImage?: TargetImage | null;
7
+ /** The providers whose map features are drawn, to ring the dot that is on the map. */
8
+ providers: ProviderId[];
9
+ bbox: Bbox | null;
10
+ zoom: number;
11
+ /** Color of the dot and disk. Default: the map features' purple. */
12
+ color?: string;
13
+ };
14
+ /**
15
+ * The selected sign or object on the map: its dot on a light disk, and a dotted line to it from
16
+ * the camera position of the shown photo (Mapillary's computed position, which the feature was
17
+ * located from). Draw it after `StreetLevelImagerySourcesAndLayers`.
18
+ */
19
+ export declare const SelectedMapFeatureLayer: ({ data, shownImage, providers, bbox, zoom, color, }: SelectedMapFeatureLayerProps) => import("react").JSX.Element;
@@ -34,3 +34,21 @@ export declare const useMapillaryImageDetections: (imageId: string | null | unde
34
34
  filter?: (value: string) => boolean;
35
35
  filterKey?: string;
36
36
  }) => import("@tanstack/react-query").UseQueryResult<NoInfer<import("@osm-editor-kit/street-imagery").MapillaryDetection[]>, Error>;
37
+ /**
38
+ * A selected Mapillary map feature (sign, object) for a host's feature + photo selection: all its
39
+ * photos by day, the photo that is shown (`shownPhotoId`), and the one to open first — the best of
40
+ * the newest day, from within `minCapturedAt` (ms) when set. Feed `data` and `shownImage` to
41
+ * `MapillaryFeatureBar` and `SelectedMapFeatureLayer`, and `shownImage.outline` to `lookAt`.
42
+ */
43
+ export declare const useSelectedMapillaryFeature: ({ featureId, shownPhotoId, minCapturedAt, shape, }: {
44
+ featureId: string | null | undefined;
45
+ shownPhotoId?: string | null;
46
+ minCapturedAt?: number | null;
47
+ shape?: TargetShape;
48
+ }) => {
49
+ data: NonNullable<NoInfer<import("@osm-editor-kit/street-imagery").MapFeatureImages | null>> | null;
50
+ isLoading: boolean;
51
+ isError: boolean;
52
+ shownImage: import("@osm-editor-kit/street-imagery").TargetImage | null;
53
+ firstImage: import("@osm-editor-kit/street-imagery").TargetImage | null;
54
+ };
@@ -9,8 +9,9 @@ type PanoramaxPanelProps = {
9
9
  /** The shown picture with creator, licence, local capture time and camera. */
10
10
  onViewerPhoto?: (photo: NormalizedPhoto) => void;
11
11
  /**
12
- * Hide the viewer's own legend (a bottom drawer in narrow containers). The host must then show
13
- * creator and licence itself, from `onViewerPhoto`.
12
+ * Leave out the viewer's own widgets: the legend (a bottom drawer in narrow containers), the
13
+ * player and the zoom buttons. The host must then show creator and licence itself, from
14
+ * `onViewerPhoto`. Stepping through a sequence still works with the arrows in the photo.
14
15
  */
15
16
  hideLegend?: boolean;
16
17
  };
@@ -1,4 +1,4 @@
1
- import { useStreetImageryI18n } from './chunk-EE7V3OIZ.js';
1
+ import { useStreetImageryI18n } from './chunk-6EMFFIL2.js';
2
2
  import { providerById, formatLocalDateTime, formatDate, formatRelativeDate } from '@osm-editor-kit/street-imagery';
3
3
  import { useRef, useEffect } from 'react';
4
4
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -7,6 +7,10 @@ export type StreetImageryClickFeature = {
7
7
  featureId?: string;
8
8
  sequenceId?: string;
9
9
  };
10
+ /**
11
+ * Layers to pass as `interactiveLayerIds`. A click returns the features of all layers it hits, the
12
+ * top one first: the photo dot itself, then view shapes, then the larger invisible targets.
13
+ */
10
14
  export declare const streetImageryInteractiveLayerIds: (providers: ProviderId[]) => string[];
11
15
  export declare const queryStreetImageryFeatures: (event: {
12
16
  features?: MapGeoJSONFeature[] | null;
@@ -0,0 +1,3 @@
1
+ export { MapillaryPanel } from '../panels/MapillaryPanel';
2
+ export { PanoramaxPanel } from '../panels/PanoramaxPanel';
3
+ export { mapillaryViewFor, setMapillaryViewerOutlines, turnMapillaryViewerTo, } from '../panels/mapillaryLookAt';
@@ -0,0 +1,3 @@
1
+ export { MapillaryPanel, mapillaryViewFor, setMapillaryViewerOutlines, turnMapillaryViewerTo } from './chunk-SGIB7AVC.js';
2
+ export { PanoramaxPanel } from './chunk-KZTMKQT5.js';
3
+ import './chunk-25UGGXIE.js';
@@ -19,10 +19,14 @@ export type FloatingPhotoViewerProps = {
19
19
  onSelectSuggestion: (suggestion: ViewSuggestion, candidate: PhotoCandidate) => void;
20
20
  /** The photo in the viewer, so the active view can show which of its photos that is. */
21
21
  shownPhotoId?: string | null;
22
- canGoBack: boolean;
23
- canGoForward: boolean;
24
- onBack: () => void;
25
- onForward: () => void;
22
+ /**
23
+ * History of shown photos: the back and forward buttons and the keys [ and ]. Leave out
24
+ * `onBack` and `onForward` for a host without a history; the buttons are then not shown.
25
+ */
26
+ canGoBack?: boolean;
27
+ canGoForward?: boolean;
28
+ onBack?: () => void;
29
+ onForward?: () => void;
26
30
  onClose: () => void;
27
31
  /**
28
32
  * Step to the neighbouring photo, e.g. along the clicked street: the `<` `>` buttons at the
@@ -51,10 +55,19 @@ export type FloatingPhotoViewerProps = {
51
55
  };
52
56
  /** localStorage key for position, width and minimized state. */
53
57
  storageKey?: string;
58
+ /**
59
+ * Where the box is until the user moves it: the bottom right corner (default), or the top left
60
+ * one with `left` and `top` in px from the container's edges, e.g. next to a side panel.
61
+ */
62
+ defaultPosition?: {
63
+ corner: 'top-left';
64
+ left?: number;
65
+ top?: number;
66
+ };
54
67
  };
55
68
  /**
56
69
  * Photo viewer box floating over the map. Render inside a positioned (relative) map container.
57
70
  * Drag the header to move, drag the left edge to resize. Keys: Esc closes, [ and ] step history,
58
71
  * Alt + arrow left/right step along (`step`).
59
72
  */
60
- export declare const FloatingPhotoViewer: ({ title, titleActions, suggestions, activeDirectionKey, onSelectSuggestion, shownPhotoId, canGoBack, canGoForward, onBack, onForward, onClose, step, toolbar, status, children, footer, drawer, storageKey, }: FloatingPhotoViewerProps) => import("react").JSX.Element;
73
+ export declare const FloatingPhotoViewer: ({ title, titleActions, suggestions, activeDirectionKey, onSelectSuggestion, shownPhotoId, canGoBack, canGoForward, onBack, onForward, onClose, step, toolbar, status, children, footer, drawer, storageKey, defaultPosition, }: FloatingPhotoViewerProps) => import("react").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osm-editor-kit/street-imagery-react",
3
- "version": "0.1.0-alpha.7",
3
+ "version": "0.1.0-alpha.9",
4
4
  "description": "React MapLibre layers and photo viewers for street-level imagery providers.",
5
5
  "homepage": "https://github.com/osmberlin/street-space-editor/tree/main/packages/street-imagery-react",
6
6
  "license": "MIT",
@@ -24,6 +24,10 @@
24
24
  "types": "./dist/photo-details/index.d.ts",
25
25
  "import": "./dist/photo-details.js"
26
26
  },
27
+ "./viewer-panels": {
28
+ "types": "./dist/viewer-panels/index.d.ts",
29
+ "import": "./dist/viewer-panels.js"
30
+ },
27
31
  "./package.json": "./package.json"
28
32
  },
29
33
  "publishConfig": {
@@ -56,7 +60,7 @@
56
60
  "zustand": "^5.0.7"
57
61
  },
58
62
  "peerDependencies": {
59
- "@osm-editor-kit/street-imagery": "^0.1.0-alpha.6",
63
+ "@osm-editor-kit/street-imagery": "^0.1.0-alpha.8",
60
64
  "@panoramax/web-viewer": "^5",
61
65
  "@tanstack/react-query": "^5",
62
66
  "mapillary-js": "^4",
@@ -75,6 +79,10 @@
75
79
  "types": "./dist/photo-details/index.d.ts",
76
80
  "import": "./dist/photo-details.js"
77
81
  },
82
+ "./viewer-panels": {
83
+ "types": "./dist/viewer-panels/index.d.ts",
84
+ "import": "./dist/viewer-panels.js"
85
+ },
78
86
  "./package.json": "./package.json"
79
87
  }
80
88
  }
@@ -1,2 +0,0 @@
1
- export { MapillaryPanel } from './chunk-53RA4OSJ.js';
2
- import './chunk-25UGGXIE.js';
@@ -1,2 +0,0 @@
1
- export { PanoramaxPanel } from './chunk-EQ2JKLGT.js';
2
- import './chunk-25UGGXIE.js';