bdsa-react-components 0.1.21 → 0.1.25
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 +31 -0
- package/CURSOR_INTEGRATION.md +25 -3
- package/INTEGRATION.md +0 -0
- package/README.md +0 -0
- package/dist/auth/DsaAuthProvider.d.ts +92 -0
- package/dist/auth/DsaAuthProvider.d.ts.map +1 -0
- package/dist/auth/DsaAuthStore.d.ts +5 -0
- package/dist/auth/DsaAuthStore.d.ts.map +1 -1
- package/dist/auth/index.d.ts +3 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/types.d.ts +43 -0
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/bdsa-schema.json +896 -0
- package/dist/components/DsaAuthManager/DsaAuthManager.d.ts +49 -4
- package/dist/components/DsaAuthManager/DsaAuthManager.d.ts.map +1 -1
- package/dist/components/DsaErrorBoundary/DsaErrorBoundary.d.ts +73 -0
- package/dist/components/DsaErrorBoundary/DsaErrorBoundary.d.ts.map +1 -0
- package/dist/components/DsaErrorBoundary/index.d.ts +3 -0
- package/dist/components/DsaErrorBoundary/index.d.ts.map +1 -0
- package/dist/components/FolderBrowser/FolderBrowser.d.ts.map +1 -1
- package/dist/components/FolderBrowser/FolderBrowser.types.d.ts +139 -2
- package/dist/components/FolderBrowser/FolderBrowser.types.d.ts.map +1 -1
- package/dist/components/FolderBrowser/useFolderBrowserDataFetching.d.ts +2 -0
- package/dist/components/FolderBrowser/useFolderBrowserDataFetching.d.ts.map +1 -1
- package/dist/components/FolderThumbnailBrowser/FolderThumbnailBrowser.d.ts +30 -0
- package/dist/components/FolderThumbnailBrowser/FolderThumbnailBrowser.d.ts.map +1 -1
- package/dist/components/ProtocolManager/ProtocolCard.d.ts +8 -0
- package/dist/components/ProtocolManager/ProtocolCard.d.ts.map +1 -0
- package/dist/components/ProtocolManager/ProtocolContext.d.ts +46 -0
- package/dist/components/ProtocolManager/ProtocolContext.d.ts.map +1 -0
- package/dist/components/ProtocolManager/ProtocolList.d.ts +8 -0
- package/dist/components/ProtocolManager/ProtocolList.d.ts.map +1 -0
- package/dist/components/ProtocolManager/ProtocolManager.d.ts +38 -0
- package/dist/components/ProtocolManager/ProtocolManager.d.ts.map +1 -0
- package/dist/components/ProtocolManager/ProtocolManager.types.d.ts +139 -0
- package/dist/components/ProtocolManager/ProtocolManager.types.d.ts.map +1 -0
- package/dist/components/ProtocolManager/ProtocolModal.d.ts +10 -0
- package/dist/components/ProtocolManager/ProtocolModal.d.ts.map +1 -0
- package/dist/components/ProtocolManager/ProtocolsTab.d.ts +10 -0
- package/dist/components/ProtocolManager/ProtocolsTab.d.ts.map +1 -0
- package/dist/components/ProtocolManager/adapters/DsaSyncAdapter.d.ts +76 -0
- package/dist/components/ProtocolManager/adapters/DsaSyncAdapter.d.ts.map +1 -0
- package/dist/components/ProtocolManager/storage/protocolStorage.d.ts +39 -0
- package/dist/components/ProtocolManager/storage/protocolStorage.d.ts.map +1 -0
- package/dist/components/ProtocolManager/testData.d.ts +23 -0
- package/dist/components/ProtocolManager/testData.d.ts.map +1 -0
- package/dist/components/ProtocolManager/utils/schemaValidator.d.ts +99 -0
- package/dist/components/ProtocolManager/utils/schemaValidator.d.ts.map +1 -0
- package/dist/components/SlideViewer/SlideViewer.d.ts +1 -1
- package/dist/components/SlideViewer/SlideViewer.d.ts.map +1 -1
- package/dist/components/SlideViewer/SlideViewer.types.d.ts +254 -21
- package/dist/components/SlideViewer/SlideViewer.types.d.ts.map +1 -1
- package/dist/components/SlideViewer/hooks/index.d.ts +2 -0
- package/dist/components/SlideViewer/hooks/index.d.ts.map +1 -1
- package/dist/components/SlideViewer/hooks/useAnnotationFetching.d.ts +2 -1
- package/dist/components/SlideViewer/hooks/useAnnotationFetching.d.ts.map +1 -1
- package/dist/components/SlideViewer/hooks/useOverlayTileSources.d.ts +9 -0
- package/dist/components/SlideViewer/hooks/useOverlayTileSources.d.ts.map +1 -0
- package/dist/components/SlideViewer/hooks/useViewportChange.d.ts +14 -0
- package/dist/components/SlideViewer/hooks/useViewportChange.d.ts.map +1 -0
- package/dist/components/ThumbnailGrid/ThumbnailGrid.d.ts +30 -0
- package/dist/components/ThumbnailGrid/ThumbnailGrid.d.ts.map +1 -1
- package/dist/index.cjs +55 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19916 -17906
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/utils/apiErrorHandling.d.ts +44 -0
- package/dist/utils/apiErrorHandling.d.ts.map +1 -0
- package/dist/utils/patchOsdPaperjs.d.ts.map +1 -1
- package/package.json +3 -3
- package/patches/osd-paperjs-annotation+0.4.14.patch +0 -0
|
@@ -1,52 +1,112 @@
|
|
|
1
1
|
import { FeatureCollection } from 'geojson';
|
|
2
2
|
import { Viewer as OpenSeadragonViewer, Options as OpenSeadragonOptions } from 'openseadragon';
|
|
3
3
|
import { default as React } from 'react';
|
|
4
|
+
import { ApiErrorHandler } from '../../utils/apiErrorHandling';
|
|
4
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Configuration for a slide image to display in the SlideViewer.
|
|
8
|
+
*
|
|
9
|
+
* You can provide either:
|
|
10
|
+
* - A `dziUrl` (recommended): OpenSeadragon will automatically fetch all metadata
|
|
11
|
+
* - Manual configuration: Provide `imageId`, `width`, `height`, `tileWidth`, `levels`, and `baseUrl`
|
|
12
|
+
*
|
|
13
|
+
* @example Using DZI URL (recommended)
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const imageInfo = {
|
|
16
|
+
* dziUrl: 'http://bdsa.pathology.emory.edu:8080/api/v1/item/123/tiles/dzi.dzi'
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example Manual configuration
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const imageInfo = {
|
|
23
|
+
* imageId: '123',
|
|
24
|
+
* width: 40000,
|
|
25
|
+
* height: 30000,
|
|
26
|
+
* tileWidth: 256,
|
|
27
|
+
* levels: 8,
|
|
28
|
+
* baseUrl: 'http://bdsa.pathology.emory.edu:8080'
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
5
32
|
export interface SlideImageInfo {
|
|
6
|
-
/** Image ID from DSA (
|
|
33
|
+
/** Image ID from DSA (required if dziUrl is not provided) */
|
|
7
34
|
imageId?: string | number;
|
|
8
|
-
/** Image width in pixels (
|
|
35
|
+
/** Image width in pixels (required if dziUrl is not provided) */
|
|
9
36
|
width?: number;
|
|
10
|
-
/** Image height in pixels (
|
|
37
|
+
/** Image height in pixels (required if dziUrl is not provided) */
|
|
11
38
|
height?: number;
|
|
12
|
-
/** Tile width (
|
|
39
|
+
/** Tile width in pixels (required if dziUrl is not provided) */
|
|
13
40
|
tileWidth?: number;
|
|
14
|
-
/** Number of zoom levels (
|
|
41
|
+
/** Number of zoom levels (required if dziUrl is not provided) */
|
|
15
42
|
levels?: number;
|
|
16
|
-
/** Base URL for DSA tile server (
|
|
43
|
+
/** Base URL for DSA tile server (required if dziUrl is not provided) */
|
|
17
44
|
baseUrl?: string;
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
45
|
+
/**
|
|
46
|
+
* DZI descriptor URL. If provided, this will be used instead of manually constructing tile URLs.
|
|
47
|
+
* OpenSeadragon will automatically fetch all metadata (width, height, levels, etc.) from the DZI file.
|
|
48
|
+
*
|
|
49
|
+
* @example 'http://bdsa.pathology.emory.edu:8080/api/v1/item/{itemId}/tiles/dzi.dzi'
|
|
50
|
+
*/
|
|
20
51
|
dziUrl?: string;
|
|
21
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Represents an annotation feature to be rendered on a slide image.
|
|
55
|
+
* Supports both rectangle annotations and polyline annotations.
|
|
56
|
+
*
|
|
57
|
+
* @example Rectangle annotation
|
|
58
|
+
* ```tsx
|
|
59
|
+
* const annotation: AnnotationFeature = {
|
|
60
|
+
* id: 'ann-1',
|
|
61
|
+
* left: 1000,
|
|
62
|
+
* top: 2000,
|
|
63
|
+
* width: 500,
|
|
64
|
+
* height: 300,
|
|
65
|
+
* color: '#ff0000',
|
|
66
|
+
* label: 'Region of Interest'
|
|
67
|
+
* }
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @example Polyline annotation
|
|
71
|
+
* ```tsx
|
|
72
|
+
* const polyline: AnnotationFeature = {
|
|
73
|
+
* id: 'poly-1',
|
|
74
|
+
* annotationType: 'polyline',
|
|
75
|
+
* points: [[100, 200], [300, 400], [500, 200]],
|
|
76
|
+
* closed: true,
|
|
77
|
+
* color: '#00ff00',
|
|
78
|
+
* fillColor: 'rgba(0, 255, 0, 0.2)'
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
22
82
|
export interface AnnotationFeature {
|
|
23
83
|
/** Unique identifier for the annotation */
|
|
24
84
|
id?: string | number;
|
|
25
|
-
/** Left coordinate in pixels */
|
|
85
|
+
/** Left coordinate in pixels (for rectangle annotations) */
|
|
26
86
|
left: number;
|
|
27
|
-
/** Top coordinate in pixels */
|
|
87
|
+
/** Top coordinate in pixels (for rectangle annotations) */
|
|
28
88
|
top: number;
|
|
29
|
-
/** Width in pixels */
|
|
89
|
+
/** Width in pixels (for rectangle annotations) */
|
|
30
90
|
width: number;
|
|
31
|
-
/** Height in pixels */
|
|
91
|
+
/** Height in pixels (for rectangle annotations) */
|
|
32
92
|
height: number;
|
|
33
|
-
/** Optional color for the annotation stroke */
|
|
93
|
+
/** Optional color for the annotation stroke (CSS color string) */
|
|
34
94
|
color?: string;
|
|
35
|
-
/** Optional group identifier */
|
|
95
|
+
/** Optional group identifier for organizing related annotations */
|
|
36
96
|
group?: string | number;
|
|
37
|
-
/** Optional label */
|
|
97
|
+
/** Optional label to display with the annotation */
|
|
38
98
|
label?: string;
|
|
39
|
-
/** Type of annotation
|
|
99
|
+
/** Type of annotation - 'rectangle' for bounding boxes, 'polyline' for paths */
|
|
40
100
|
annotationType?: 'rectangle' | 'polyline';
|
|
41
|
-
/**
|
|
101
|
+
/** Array of [x, y] coordinate pairs for polyline annotations */
|
|
42
102
|
points?: Array<[number, number]>;
|
|
43
|
-
/** Whether polyline
|
|
103
|
+
/** Whether the polyline should be closed (connect last point to first) */
|
|
44
104
|
closed?: boolean;
|
|
45
|
-
/** Fill color for polyline */
|
|
105
|
+
/** Fill color for polyline annotations (CSS color string) */
|
|
46
106
|
fillColor?: string;
|
|
47
|
-
/** Store full element for rendering */
|
|
107
|
+
/** Internal: Store full element for rendering (used internally) */
|
|
48
108
|
element?: unknown;
|
|
49
|
-
/** Optional additional properties */
|
|
109
|
+
/** Optional additional properties (e.g., documentId, properties from DSA API) */
|
|
50
110
|
[key: string]: unknown;
|
|
51
111
|
}
|
|
52
112
|
export interface AnnotationInfoProperty {
|
|
@@ -78,15 +138,40 @@ export interface AnnotationInfoConfig {
|
|
|
78
138
|
/** Custom header text */
|
|
79
139
|
headerText?: string;
|
|
80
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Interface for annotation caching implementations.
|
|
143
|
+
*
|
|
144
|
+
* Provides a cache-aside pattern for annotation documents to reduce API calls
|
|
145
|
+
* and improve performance. Implementations can use IndexedDB, memory, or other storage.
|
|
146
|
+
*
|
|
147
|
+
* @example Using IndexedDBAnnotationCache
|
|
148
|
+
* ```tsx
|
|
149
|
+
* import { IndexedDBAnnotationCache } from 'bdsa-react-components'
|
|
150
|
+
*
|
|
151
|
+
* const cache = new IndexedDBAnnotationCache()
|
|
152
|
+
*
|
|
153
|
+
* <SlideViewer
|
|
154
|
+
* imageInfo={imageInfo}
|
|
155
|
+
* annotationIds={['123', '456']}
|
|
156
|
+
* annotationCache={cache}
|
|
157
|
+
* />
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
81
160
|
export interface AnnotationCache {
|
|
161
|
+
/** Get an annotation from cache by ID and optional version hash */
|
|
82
162
|
get(annotationId: string | number, versionHash?: string): Promise<unknown | null>;
|
|
163
|
+
/** Store an annotation in cache with optional TTL and version hash */
|
|
83
164
|
set(annotationId: string | number, data: unknown, options?: {
|
|
84
165
|
ttl?: number;
|
|
85
166
|
versionHash?: string;
|
|
86
167
|
}): Promise<void>;
|
|
168
|
+
/** Check if an annotation exists in cache */
|
|
87
169
|
has(annotationId: string | number, versionHash?: string): Promise<boolean>;
|
|
170
|
+
/** Delete an annotation from cache */
|
|
88
171
|
delete(annotationId: string | number): Promise<void>;
|
|
172
|
+
/** Clear all annotations from cache */
|
|
89
173
|
clear(): Promise<void>;
|
|
174
|
+
/** Get cache statistics (optional - may not be implemented by all caches) */
|
|
90
175
|
getStats?(): Promise<{
|
|
91
176
|
size: number;
|
|
92
177
|
hits?: number;
|
|
@@ -94,6 +179,78 @@ export interface AnnotationCache {
|
|
|
94
179
|
hitRate?: number;
|
|
95
180
|
}>;
|
|
96
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* Viewport bounds in normalized coordinates (0-1) relative to the full image.
|
|
184
|
+
* These coordinates are consistent across different image sizes.
|
|
185
|
+
*/
|
|
186
|
+
export interface ViewportBounds {
|
|
187
|
+
/** Left edge of viewport (0-1, normalized) */
|
|
188
|
+
x: number;
|
|
189
|
+
/** Top edge of viewport (0-1, normalized) */
|
|
190
|
+
y: number;
|
|
191
|
+
/** Width of viewport (0-1, normalized) */
|
|
192
|
+
width: number;
|
|
193
|
+
/** Height of viewport (0-1, normalized) */
|
|
194
|
+
height: number;
|
|
195
|
+
/** Current zoom level (e.g., 1.0 = 100%, 2.0 = 200%) */
|
|
196
|
+
zoom: number;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Configuration for an overlay tile source that can be dynamically added to the viewer.
|
|
200
|
+
* Overlay tile sources are rendered on top of the base image and can be positioned, scaled, and have their opacity controlled.
|
|
201
|
+
*
|
|
202
|
+
* @example Base64 image overlay
|
|
203
|
+
* ```tsx
|
|
204
|
+
* const overlay: OverlayTileSource = {
|
|
205
|
+
* id: 'overlay-1',
|
|
206
|
+
* tileSource: 'data:image/png;base64,iVBORw0KGgoAAAANS...',
|
|
207
|
+
* x: 0.2, // Position at 20% from left
|
|
208
|
+
* y: 0.3, // Position at 30% from top
|
|
209
|
+
* width: 0.5, // 50% of base image width
|
|
210
|
+
* height: 0.5, // 50% of base image height
|
|
211
|
+
* opacity: 0.7,
|
|
212
|
+
* }
|
|
213
|
+
* ```
|
|
214
|
+
*
|
|
215
|
+
* @example DZI URL overlay
|
|
216
|
+
* ```tsx
|
|
217
|
+
* const overlay: OverlayTileSource = {
|
|
218
|
+
* id: 'overlay-2',
|
|
219
|
+
* tileSource: 'http://bdsa.pathology.emory.edu:8080/api/v1/item/123/tiles/dzi.dzi',
|
|
220
|
+
* x: 0,
|
|
221
|
+
* y: 0,
|
|
222
|
+
* opacity: 0.5,
|
|
223
|
+
* }
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
226
|
+
export interface OverlayTileSource {
|
|
227
|
+
/** Unique identifier for this overlay tile source */
|
|
228
|
+
id: string | number;
|
|
229
|
+
/**
|
|
230
|
+
* Tile source for the overlay. Can be:
|
|
231
|
+
* - Base64 data URL: `'data:image/png;base64,...'`
|
|
232
|
+
* - DZI URL: `'http://.../dzi.dzi'`
|
|
233
|
+
* - Simple image URL: `'http://.../image.jpg'`
|
|
234
|
+
* - OpenSeadragon tile source object
|
|
235
|
+
*/
|
|
236
|
+
tileSource: string | unknown;
|
|
237
|
+
/** X position in image coordinates (0 = left edge, 1 = right edge). Default: 0 */
|
|
238
|
+
x?: number;
|
|
239
|
+
/** Y position in image coordinates (0 = top edge, 1 = bottom edge). Default: 0 */
|
|
240
|
+
y?: number;
|
|
241
|
+
/** Width in image coordinates (0-1, normalized). If not provided, uses tile source's natural width. */
|
|
242
|
+
width?: number;
|
|
243
|
+
/** Height in image coordinates (0-1, normalized). If not provided, uses tile source's natural height. */
|
|
244
|
+
height?: number;
|
|
245
|
+
/** Opacity (0-1). Default: 1 */
|
|
246
|
+
opacity?: number;
|
|
247
|
+
/** Rotation in degrees. Default: 0 */
|
|
248
|
+
rotation?: number;
|
|
249
|
+
/** Composite operation (e.g., 'multiply', 'screen', 'overlay'). Default: 'source-over' */
|
|
250
|
+
compositeOperation?: string;
|
|
251
|
+
/** Whether the overlay is visible. Default: true */
|
|
252
|
+
visible?: boolean;
|
|
253
|
+
}
|
|
97
254
|
export interface SlideViewerProps {
|
|
98
255
|
/** Image information for the slide to display */
|
|
99
256
|
imageInfo: SlideImageInfo;
|
|
@@ -169,6 +326,82 @@ export interface SlideViewerProps {
|
|
|
169
326
|
* Typically obtained from AnnotationManager: `annotations.map(ann => [ann._id, ann])` or similar.
|
|
170
327
|
* If not provided, cache will work but version-based invalidation will be disabled. */
|
|
171
328
|
annotationHeaders?: Map<string | number, unknown> | Record<string, unknown>;
|
|
329
|
+
/** Callback that fires whenever the viewport changes (pan, zoom, resize).
|
|
330
|
+
* Provides normalized coordinates (0-1) relative to the full image for consistency across image sizes.
|
|
331
|
+
*
|
|
332
|
+
* @example
|
|
333
|
+
* ```tsx
|
|
334
|
+
* <SlideViewer
|
|
335
|
+
* imageInfo={{ dziUrl: '...' }}
|
|
336
|
+
* onViewportChange={(bounds) => {
|
|
337
|
+
* console.log('Viewport:', bounds)
|
|
338
|
+
* // bounds: { x: 0.25, y: 0.3, width: 0.5, height: 0.4, zoom: 2.0 }
|
|
339
|
+
* setViewportState(bounds)
|
|
340
|
+
* }}
|
|
341
|
+
* />
|
|
342
|
+
* ```
|
|
343
|
+
*
|
|
344
|
+
* Use cases:
|
|
345
|
+
* - Display current viewport coordinates in UI
|
|
346
|
+
* - Capture a region of the image based on current viewport
|
|
347
|
+
* - Save/restore viewport state
|
|
348
|
+
* - Sync viewport across multiple viewers
|
|
349
|
+
* - Generate viewport-based annotations
|
|
350
|
+
*/
|
|
351
|
+
onViewportChange?: (bounds: ViewportBounds) => void;
|
|
352
|
+
/**
|
|
353
|
+
* Callback when an API error occurs.
|
|
354
|
+
* Provides error details and a retry function for transient failures.
|
|
355
|
+
*
|
|
356
|
+
* @param error - The error that occurred
|
|
357
|
+
* @param retry - Function to retry the failed operation
|
|
358
|
+
* @param context - Additional context about the error (endpoint, operation type, etc.)
|
|
359
|
+
*
|
|
360
|
+
* @example
|
|
361
|
+
* ```tsx
|
|
362
|
+
* <SlideViewer
|
|
363
|
+
* imageInfo={imageInfo}
|
|
364
|
+
* annotationIds={['ann-1', 'ann-2']}
|
|
365
|
+
* apiBaseUrl="http://bdsa.pathology.emory.edu:8080/api/v1"
|
|
366
|
+
* onApiError={(error, retry, context) => {
|
|
367
|
+
* if (error.status === 401) {
|
|
368
|
+
* // Token expired, refresh and retry
|
|
369
|
+
* refreshToken().then(() => retry())
|
|
370
|
+
* } else if (error.isRetryable) {
|
|
371
|
+
* // Retry with delay
|
|
372
|
+
* setTimeout(() => retry(), 2000)
|
|
373
|
+
* } else {
|
|
374
|
+
* // Show error to user
|
|
375
|
+
* showErrorNotification(error.message)
|
|
376
|
+
* }
|
|
377
|
+
* }}
|
|
378
|
+
* />
|
|
379
|
+
* ```
|
|
380
|
+
*/
|
|
381
|
+
onApiError?: ApiErrorHandler;
|
|
382
|
+
/**
|
|
383
|
+
* Array of overlay tile sources to display on top of the base image.
|
|
384
|
+
* Overlays can be dynamically added, removed, or updated by changing this array.
|
|
385
|
+
*
|
|
386
|
+
* @example
|
|
387
|
+
* ```tsx
|
|
388
|
+
* <SlideViewer
|
|
389
|
+
* imageInfo={imageInfo}
|
|
390
|
+
* overlayTileSources={[
|
|
391
|
+
* {
|
|
392
|
+
* id: 'overlay-1',
|
|
393
|
+
* tileSource: 'data:image/png;base64,iVBORw0KGgo...',
|
|
394
|
+
* x: 0.2,
|
|
395
|
+
* y: 0.3,
|
|
396
|
+
* width: 0.5,
|
|
397
|
+
* height: 0.5,
|
|
398
|
+
* opacity: 0.7,
|
|
399
|
+
* }
|
|
400
|
+
* ]}
|
|
401
|
+
* />
|
|
402
|
+
* ```
|
|
403
|
+
*/
|
|
404
|
+
overlayTileSources?: OverlayTileSource[];
|
|
172
405
|
/** If true, enables debug logging to console. Default: false */
|
|
173
406
|
debug?: boolean;
|
|
174
407
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlideViewer.types.d.ts","sourceRoot":"","sources":["../../../src/components/SlideViewer/SlideViewer.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,KAAK,EAAE,MAAM,IAAI,mBAAmB,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,eAAe,CAAA;AACnG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"SlideViewer.types.d.ts","sourceRoot":"","sources":["../../../src/components/SlideViewer/SlideViewer.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,KAAK,EAAE,MAAM,IAAI,mBAAmB,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,eAAe,CAAA;AACnG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,cAAc;IAC3B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;;;;;;;;;;;;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CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC3E,uHAAuH;IACvH,kBAAkB,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5E,kGAAkG;IAClG,iBAAiB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAA;IAC3D;;;;gHAI4G;IAC5G,eAAe,CAAC,EAAE,eAAe,GAAG,IAAI,CAAA;IACxC,gIAAgI;IAChI,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;gGAE4F;IAC5F,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC;;;;4FAIwF;IACxF,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC3E;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAA;IACnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAA;IACxC,gEAAgE;IAChE,KAAK,CAAC,EAAE,OAAO,CAAA;CAClB"}
|
|
@@ -2,4 +2,6 @@ export { useAnnotationFetching, type UseAnnotationFetchingResult } from './useAn
|
|
|
2
2
|
export { useAnnotationRendering } from './useAnnotationRendering';
|
|
3
3
|
export { useAnnotationOpacity } from './useAnnotationOpacity';
|
|
4
4
|
export { useSlideViewerInitialization } from './useSlideViewerInitialization';
|
|
5
|
+
export { useViewportChange } from './useViewportChange';
|
|
6
|
+
export { useOverlayTileSources } from './useOverlayTileSources';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/SlideViewer/hooks/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,KAAK,2BAA2B,EAAE,MAAM,yBAAyB,CAAA;AACjG,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/SlideViewer/hooks/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,KAAK,2BAA2B,EAAE,MAAM,yBAAyB,CAAA;AACjG,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { AnnotationFeature } from '../SlideViewer.types';
|
|
3
|
+
import { ApiErrorHandler } from '../../../utils/apiErrorHandling';
|
|
3
4
|
|
|
4
5
|
export interface UseAnnotationFetchingResult {
|
|
5
6
|
fetchedAnnotations: AnnotationFeature[];
|
|
@@ -19,5 +20,5 @@ export declare function useAnnotationFetching(annotationIds: (string | number)[]
|
|
|
19
20
|
versionHash?: string;
|
|
20
21
|
}): Promise<void>;
|
|
21
22
|
delete(annotationId: string | number): Promise<void>;
|
|
22
|
-
} | null, annotationHeaders: Map<string | number, unknown> | Record<string, unknown> | undefined, apiHeaders: HeadersInit | undefined, isMountedRef: React.MutableRefObject<boolean>, debug: boolean): UseAnnotationFetchingResult;
|
|
23
|
+
} | null, annotationHeaders: Map<string | number, unknown> | Record<string, unknown> | undefined, apiHeaders: HeadersInit | undefined, isMountedRef: React.MutableRefObject<boolean>, debug: boolean, onApiError?: ApiErrorHandler): UseAnnotationFetchingResult;
|
|
23
24
|
//# sourceMappingURL=useAnnotationFetching.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAnnotationFetching.d.ts","sourceRoot":"","sources":["../../../../src/components/SlideViewer/hooks/useAnnotationFetching.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"useAnnotationFetching.d.ts","sourceRoot":"","sources":["../../../../src/components/SlideViewer/hooks/useAnnotationFetching.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAG7D,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAEtF,MAAM,WAAW,2BAA2B;IACxC,kBAAkB,EAAE,iBAAiB,EAAE,CAAA;IACvC,mBAAmB,EAAE,KAAK,CAAC;QACvB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;QACnB,YAAY,EAAE,MAAM,CAAA;QACpB,WAAW,EAAE,MAAM,CAAA;QACnB,KAAK,EAAE,MAAM,EAAE,CAAA;QACf,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,cAAc,CAAC,EAAE,MAAM,CAAA;KAC1B,CAAC,CAAA;CACL;AAED,wBAAgB,qBAAqB,CACjC,aAAa,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,SAAS,EAC9C,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,sBAAsB,EAAE,MAAM,EAC9B,sBAAsB,EAAE,MAAM,EAC9B,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,EACvE,KAAK,EAAE;IACH,GAAG,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAA;IACjF,GAAG,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAClH,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACvD,GAAG,IAAI,EACR,iBAAiB,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACtF,UAAU,EAAE,WAAW,GAAG,SAAS,EACnC,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAC7C,KAAK,EAAE,OAAO,EACd,UAAU,CAAC,EAAE,eAAe,GAC7B,2BAA2B,CA+N7B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Viewer as OpenSeadragonViewer } from 'openseadragon';
|
|
2
|
+
import { OverlayTileSource } from '../SlideViewer.types';
|
|
3
|
+
import { DebugLogger } from '../../../utils/debugLog';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Hook to manage overlay tile sources (dynamically add/remove/update tile sources on top of base image)
|
|
7
|
+
*/
|
|
8
|
+
export declare function useOverlayTileSources(viewer: OpenSeadragonViewer | null, overlayTileSources: OverlayTileSource[], baseImageWidth: number | null, baseImageHeight: number | null, debugLog: DebugLogger): void;
|
|
9
|
+
//# sourceMappingURL=useOverlayTileSources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOverlayTileSources.d.ts","sourceRoot":"","sources":["../../../../src/components/SlideViewer/hooks/useOverlayTileSources.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,IAAI,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAElE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAE1D;;GAEG;AACH,wBAAgB,qBAAqB,CACjC,MAAM,EAAE,mBAAmB,GAAG,IAAI,EAClC,kBAAkB,EAAE,iBAAiB,EAAE,EACvC,cAAc,EAAE,MAAM,GAAG,IAAI,EAC7B,eAAe,EAAE,MAAM,GAAG,IAAI,EAC9B,QAAQ,EAAE,WAAW,QAuYxB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Viewer as OpenSeadragonViewer } from 'openseadragon';
|
|
2
|
+
import { ViewportBounds } from '../SlideViewer.types';
|
|
3
|
+
import { DebugLogger } from '../../../utils/debugLog';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Hook to handle viewport change callbacks from OpenSeadragon viewer.
|
|
7
|
+
* Fires callback whenever viewport changes (pan, zoom, resize) with normalized coordinates.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useViewportChange(viewer: OpenSeadragonViewer | null, onViewportChange: ((bounds: ViewportBounds) => void) | undefined, imageInfo: {
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
dziUrl?: string;
|
|
13
|
+
}, debugLog: DebugLogger): void;
|
|
14
|
+
//# sourceMappingURL=useViewportChange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useViewportChange.d.ts","sourceRoot":"","sources":["../../../../src/components/SlideViewer/hooks/useViewportChange.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,IAAI,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAE1D;;;GAGG;AACH,wBAAgB,iBAAiB,CAC7B,MAAM,EAAE,mBAAmB,GAAG,IAAI,EAClC,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC,GAAG,SAAS,EAChE,SAAS,EAAE;IACP,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;CAClB,EACD,QAAQ,EAAE,WAAW,QA+QxB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { Item } from '../../utils/itemUtils';
|
|
3
|
+
import { ApiErrorHandler } from '../../utils/apiErrorHandling';
|
|
3
4
|
|
|
4
5
|
export interface ThumbnailGridProps {
|
|
5
6
|
/** DSA folder ID to fetch items from */
|
|
@@ -42,6 +43,35 @@ export interface ThumbnailGridProps {
|
|
|
42
43
|
getDatasetType?: (itemId: string) => 'train' | 'val' | 'test' | null;
|
|
43
44
|
/** Callback when thumbnail is clicked */
|
|
44
45
|
onThumbnailClick?: (item: Item) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Callback when an API error occurs.
|
|
48
|
+
* Provides error details and a retry function for transient failures.
|
|
49
|
+
*
|
|
50
|
+
* @param error - The error that occurred
|
|
51
|
+
* @param retry - Function to retry the failed operation
|
|
52
|
+
* @param context - Additional context about the error (endpoint, operation type, etc.)
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* <ThumbnailGrid
|
|
57
|
+
* apiBaseUrl="http://bdsa.pathology.emory.edu:8080/api/v1"
|
|
58
|
+
* folderId="folder-123"
|
|
59
|
+
* onApiError={(error, retry, context) => {
|
|
60
|
+
* if (error.status === 401) {
|
|
61
|
+
* // Token expired, refresh and retry
|
|
62
|
+
* refreshToken().then(() => retry())
|
|
63
|
+
* } else if (error.isRetryable) {
|
|
64
|
+
* // Retry with delay
|
|
65
|
+
* setTimeout(() => retry(), 2000)
|
|
66
|
+
* } else {
|
|
67
|
+
* // Show error to user
|
|
68
|
+
* showErrorNotification(error.message)
|
|
69
|
+
* }
|
|
70
|
+
* }}
|
|
71
|
+
* />
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
onApiError?: ApiErrorHandler;
|
|
45
75
|
/** Debug mode for logging */
|
|
46
76
|
debug?: boolean;
|
|
47
77
|
/** Custom CSS class */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThumbnailGrid.d.ts","sourceRoot":"","sources":["../../../src/components/ThumbnailGrid/ThumbnailGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAA;AAChF,OAAO,EAAgC,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAE/E,OAAO,qBAAqB,CAAA;AAE5B,MAAM,WAAW,kBAAkB;IAE/B,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,gDAAgD;IAChD,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;IAGd,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAA;IAClB,mGAAmG;IACnG,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,4CAA4C;IAC5C,UAAU,CAAC,EAAE,WAAW,CAAA;IACxB,gHAAgH;IAChH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;yBAEqB;IACrB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,6CAA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