bdsa-react-components 0.1.1 → 0.1.3

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.
@@ -1,6 +1,6 @@
1
1
  # bdsa-react-components - CURSOR Integration Guide
2
2
 
3
- **Version:** 0.1.1 | **Generated:** 2025-11-01T18:02:49.017Z
3
+ **Version:** 0.1.3 | **Generated:** 2025-11-01T22:49:22.223Z
4
4
 
5
5
  > This document provides everything Cursor needs to integrate and use the bdsa-react-components library.
6
6
  > Copy this entire document into your project's .cursorrules or docs folder.
@@ -217,7 +217,33 @@ const fetchWithAuth = async (url: string, options?: RequestInit) => {
217
217
  />
218
218
  ```
219
219
 
220
- ### 2. SlideViewer with API-Fetched Annotations
220
+ ### 2. SlideViewer with API-Fetched Annotations (RECOMMENDED)
221
+
222
+ **Recommended approach:** Use `onLoadedAnnotationIdsChange` to sync annotation state:
223
+
224
+ ```tsx
225
+ const [annotationIds, setAnnotationIds] = useState<string[]>([])
226
+ const imageId = '6903df8dd26a6d93de19a9b2'
227
+
228
+ <>
229
+ <AnnotationManager
230
+ imageId={imageId}
231
+ apiBaseUrl="http://bdsa.pathology.emory.edu:8080/api/v1"
232
+ onLoadedAnnotationIdsChange={(ids) => {
233
+ // Automatically syncs when user loads/unloads annotations
234
+ setAnnotationIds(ids)
235
+ }}
236
+ />
237
+ <SlideViewer
238
+ imageInfo={{ dziUrl: `.../item/${imageId}/tiles/dzi.dzi` }}
239
+ annotationIds={annotationIds}
240
+ apiBaseUrl="http://bdsa.pathology.emory.edu:8080/api/v1"
241
+ height="800px"
242
+ />
243
+ </>
244
+ ```
245
+
246
+ **Alternative (legacy):** Using `onAnnotationsLoaded` - requires manual ID extraction:
221
247
 
222
248
  ```tsx
223
249
  const [annotationIds, setAnnotationIds] = useState<string[]>([])
@@ -238,6 +264,12 @@ const imageId = '6903df8dd26a6d93de19a9b2'
238
264
  </>
239
265
  ```
240
266
 
267
+ **Additional callbacks available:**
268
+
269
+ - `onAnnotationLoad(id, data?)` - Fires when an annotation is loaded
270
+ - `onAnnotationHide(id)` - Fires when an annotation is hidden/unloaded
271
+ - `onAnnotationOpacityChange(id, opacity)` - Fires when opacity changes
272
+
241
273
  ### 3. FolderBrowser
242
274
 
243
275
  ```tsx
@@ -279,6 +311,67 @@ const imageId = '6903df8dd26a6d93de19a9b2'
279
311
  - Ensure `dist/index.d.ts` exists in the library
280
312
  - Restart TypeScript server in your editor (VS Code: Cmd+Shift+P → "TypeScript: Restart TS Server")
281
313
 
314
+ ## Annotation Caching
315
+
316
+ The library includes automatic IndexedDB-based caching for annotation documents to speed up loading and reduce server requests.
317
+
318
+ ### Auto-Enabled Caching
319
+
320
+ Both `AnnotationManager` and `SlideViewer` automatically create and use an `IndexedDBAnnotationCache` instance by default. This provides:
321
+
322
+ - **Persistent caching** across page refreshes (uses IndexedDB, 50MB+ capacity)
323
+ - **Automatic cache validation** using version hashes from annotation headers
324
+ - **Per-annotation cache indicators** (database icon) when cached
325
+ - **Per-annotation cache bypass** (refresh icon) to clear and reload specific annotations
326
+
327
+ ### Disabling Cache
328
+
329
+ To disable caching globally for debugging:
330
+
331
+ ```tsx
332
+ <AnnotationManager
333
+ imageId="..."
334
+ apiBaseUrl="..."
335
+ disableCache={true} // Disables all caching
336
+ />
337
+ <SlideViewer
338
+ annotationIds={[...]}
339
+ disableCache={true} // Disables all caching
340
+ />
341
+ ```
342
+
343
+ ### Cache Implementation
344
+
345
+ ```tsx
346
+ import { IndexedDBAnnotationCache, MemoryAnnotationCache } from 'bdsa-react-components'
347
+
348
+ // Use a specific cache implementation (optional)
349
+ const cache = new IndexedDBAnnotationCache()
350
+ <AnnotationManager annotationCache={cache} ... />
351
+ <SlideViewer annotationCache={cache} ... />
352
+ ```
353
+
354
+ ### Cache Utilities
355
+
356
+ ```tsx
357
+ import { checkIndexedDBQuota, requestPersistentStorage, logQuotaInfo } from 'bdsa-react-components'
358
+
359
+ // Check cache quota and usage
360
+ const quotaInfo = await checkIndexedDBQuota()
361
+ if (quotaInfo) {
362
+ console.log(`Usage: ${quotaInfo.usagePercent.toFixed(1)}%`)
363
+ console.log(`Available: ${quotaInfo.available} bytes`)
364
+ }
365
+
366
+ // Request persistent storage (prevents browser cleanup)
367
+ await requestPersistentStorage()
368
+
369
+ // Log quota info in readable format
370
+ await logQuotaInfo()
371
+ ```
372
+
373
+ **Note:** IndexedDB storage limits are automatically managed by the browser. When quota is exceeded, the browser will prompt the user for permission to expand storage.
374
+
282
375
  ## Dependencies
283
376
 
284
377
  **Peer:** react ^18.0.0, react-dom ^18.0.0
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Cache interface for annotation documents
3
+ *
4
+ * Different implementations can be provided:
5
+ * - MemoryAnnotationCache: JavaScript-only in-memory cache
6
+ * - RedisAnnotationCache: Redis-backed cache (future)
7
+ * - PostgresAnnotationCache: PostgreSQL-backed cache (future)
8
+ */
9
+ export interface AnnotationCache {
10
+ /**
11
+ * Get an annotation document from cache
12
+ * @param annotationId The annotation document ID
13
+ * @param versionHash Optional version hash to verify cache validity. If provided and doesn't match cached version, returns null.
14
+ * @returns The cached annotation document, or null if not found or version mismatch
15
+ */
16
+ get(annotationId: string | number, versionHash?: string): Promise<unknown | null>;
17
+ /**
18
+ * Store an annotation document in cache
19
+ * @param annotationId The annotation document ID
20
+ * @param data The annotation document data to cache
21
+ * @param options Optional options including TTL and version hash
22
+ */
23
+ set(annotationId: string | number, data: unknown, options?: {
24
+ ttl?: number;
25
+ versionHash?: string;
26
+ }): Promise<void>;
27
+ /**
28
+ * Check if an annotation document exists in cache
29
+ * @param annotationId The annotation document ID
30
+ * @param versionHash Optional version hash to verify cache validity
31
+ * @returns true if the annotation is cached with matching version, false otherwise
32
+ */
33
+ has(annotationId: string | number, versionHash?: string): Promise<boolean>;
34
+ /**
35
+ * Remove an annotation document from cache
36
+ * @param annotationId The annotation document ID
37
+ */
38
+ delete(annotationId: string | number): Promise<void>;
39
+ /**
40
+ * Clear all cached annotation documents
41
+ */
42
+ clear(): Promise<void>;
43
+ /**
44
+ * Get cache statistics (optional, for monitoring)
45
+ */
46
+ getStats?(): Promise<{
47
+ size: number;
48
+ hits?: number;
49
+ misses?: number;
50
+ hitRate?: number;
51
+ }>;
52
+ }
53
+ //# sourceMappingURL=AnnotationCache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnnotationCache.d.ts","sourceRoot":"","sources":["../../src/cache/AnnotationCache.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC5B;;;;;OAKG;IACH,GAAG,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAA;IAEjF;;;;;OAKG;IACH,GAAG,CACC,YAAY,EAAE,MAAM,GAAG,MAAM,EAC7B,IAAI,EAAE,OAAO,EACb,OAAO,CAAC,EAAE;QACN,GAAG,CAAC,EAAE,MAAM,CAAA;QACZ,WAAW,CAAC,EAAE,MAAM,CAAA;KACvB,GACF,OAAO,CAAC,IAAI,CAAC,CAAA;IAEhB;;;;;OAKG;IACH,GAAG,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAE1E;;;OAGG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEpD;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAEtB;;OAEG;IACH,QAAQ,CAAC,IAAI,OAAO,CAAC;QACjB,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,OAAO,CAAC,EAAE,MAAM,CAAA;KACnB,CAAC,CAAA;CACL"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * React component to test annotation cache sizes.
3
+ * Use this in Storybook or a test page to measure your annotation documents.
4
+ */
5
+ export declare function CacheSizeTester({ apiBaseUrl, imageId, }: {
6
+ apiBaseUrl: string;
7
+ imageId: string | number;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ //# sourceMappingURL=CacheSizeTester.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CacheSizeTester.d.ts","sourceRoot":"","sources":["../../src/cache/CacheSizeTester.tsx"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC5B,UAAU,EACV,OAAO,GACV,EAAE;IACC,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,GAAG,MAAM,CAAA;CAC3B,2CAsIA"}
@@ -0,0 +1,21 @@
1
+ import { AnnotationCache } from './AnnotationCache';
2
+
3
+ export declare class IndexedDBAnnotationCache implements AnnotationCache {
4
+ private db;
5
+ private initPromise;
6
+ private init;
7
+ private getStore;
8
+ get(annotationId: string | number, versionHash?: string): Promise<unknown | undefined>;
9
+ set(annotationId: string | number, data: unknown, options?: {
10
+ ttl?: number;
11
+ versionHash?: string;
12
+ }): Promise<void>;
13
+ has(annotationId: string | number, versionHash?: string): Promise<boolean>;
14
+ delete(annotationId: string | number): Promise<void>;
15
+ clear(): Promise<void>;
16
+ getStats(): Promise<{
17
+ size: number;
18
+ count: number;
19
+ }>;
20
+ }
21
+ //# sourceMappingURL=IndexedDBAnnotationCache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IndexedDBAnnotationCache.d.ts","sourceRoot":"","sources":["../../src/cache/IndexedDBAnnotationCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAmBxD,qBAAa,wBAAyB,YAAW,eAAe;IAC5D,OAAO,CAAC,EAAE,CAA2B;IACrC,OAAO,CAAC,WAAW,CAA6B;YAElC,IAAI;YAoCJ,QAAQ;IAShB,GAAG,CACL,YAAY,EAAE,MAAM,GAAG,MAAM,EAC7B,WAAW,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;IAyCzB,GAAG,CACL,YAAY,EAAE,MAAM,GAAG,MAAM,EAC7B,IAAI,EAAE,OAAO,EACb,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,GACjD,OAAO,CAAC,IAAI,CAAC;IA0BV,GAAG,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAsC1E,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBpD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBtB,QAAQ,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAmB7D"}
@@ -0,0 +1,53 @@
1
+ import { AnnotationCache } from './AnnotationCache';
2
+
3
+ /**
4
+ * In-memory JavaScript-only cache for annotation documents
5
+ *
6
+ * This cache stores annotation documents in a Map and provides
7
+ * optional TTL (time-to-live) support and basic statistics.
8
+ *
9
+ * Note: This cache is cleared when the page is refreshed or the app restarts.
10
+ * For persistence across refreshes, use IndexedDBAnnotationCache instead.
11
+ */
12
+ export declare class MemoryAnnotationCache implements AnnotationCache {
13
+ private cache;
14
+ private hits;
15
+ private misses;
16
+ private maxSize?;
17
+ /**
18
+ * @param options Configuration options
19
+ * @param options.maxSize Maximum number of items to cache (default: unlimited)
20
+ * @param options.defaultTTL Default time-to-live in milliseconds (optional)
21
+ */
22
+ constructor(options?: {
23
+ maxSize?: number;
24
+ defaultTTL?: number;
25
+ });
26
+ /**
27
+ * Normalize annotation ID to string for consistent key matching
28
+ */
29
+ private normalizeId;
30
+ /**
31
+ * Check if a cached item has expired
32
+ */
33
+ private isExpired;
34
+ /**
35
+ * Evict oldest items if cache exceeds maxSize (LRU-like, but simple FIFO)
36
+ */
37
+ private evictIfNeeded;
38
+ get(annotationId: string | number, versionHash?: string): Promise<unknown | null>;
39
+ set(annotationId: string | number, data: unknown, options?: {
40
+ ttl?: number;
41
+ versionHash?: string;
42
+ }): Promise<void>;
43
+ has(annotationId: string | number, versionHash?: string): Promise<boolean>;
44
+ delete(annotationId: string | number): Promise<void>;
45
+ clear(): Promise<void>;
46
+ getStats(): Promise<{
47
+ size: number;
48
+ hits: number;
49
+ misses: number;
50
+ hitRate: number;
51
+ }>;
52
+ }
53
+ //# sourceMappingURL=MemoryAnnotationCache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MemoryAnnotationCache.d.ts","sourceRoot":"","sources":["../../src/cache/MemoryAnnotationCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD;;;;;;;;GAQG;AACH,qBAAa,qBAAsB,YAAW,eAAe;IACzD,OAAO,CAAC,KAAK,CAA0E;IACvF,OAAO,CAAC,IAAI,CAAY;IACxB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,OAAO,CAAC,CAAQ;IAExB;;;;OAIG;gBACS,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE;IAK/D;;OAEG;IACH,OAAO,CAAC,WAAW;IAInB;;OAEG;IACH,OAAO,CAAC,SAAS;IAWjB;;OAEG;IACH,OAAO,CAAC,aAAa;IAUf,GAAG,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IA0BjF,GAAG,CACL,YAAY,EAAE,MAAM,GAAG,MAAM,EAC7B,IAAI,EAAE,OAAO,EACb,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,GACjD,OAAO,CAAC,IAAI,CAAC;IAYV,GAAG,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAoB1E,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKpD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAMtB,QAAQ,IAAI,OAAO,CAAC;QACtB,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,MAAM,CAAA;QACd,OAAO,EAAE,MAAM,CAAA;KAClB,CAAC;CAWL"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Utility functions for computing hashes of annotation metadata
3
+ * Used for cache invalidation when annotation documents change on the server
4
+ */
5
+ /**
6
+ * Compute a simple hash of an object/string for version comparison
7
+ * Uses a lightweight hash function (djb2-like) suitable for cache keys
8
+ *
9
+ * @param data The data to hash (object, string, or any JSON-serializable value)
10
+ * @returns A hex string hash of the data
11
+ */
12
+ export declare function computeHash(data: unknown): string;
13
+ /**
14
+ * Extract version-relevant fields from an annotation header document
15
+ * These fields typically change when the annotation is modified
16
+ *
17
+ * @param header The annotation header/metadata object from /annotation?itemId=...
18
+ * @returns An object with fields that indicate version changes
19
+ */
20
+ export declare function extractVersionFields(header: {
21
+ _id?: string | number;
22
+ _modelType?: string;
23
+ _version?: number | string;
24
+ updated?: string | number;
25
+ modified?: string | number;
26
+ annotation?: {
27
+ name?: string;
28
+ description?: string;
29
+ [key: string]: unknown;
30
+ };
31
+ [key: string]: unknown;
32
+ }): Record<string, unknown>;
33
+ /**
34
+ * Compute version hash from an annotation header
35
+ * This hash can be used to detect when an annotation document has changed
36
+ *
37
+ * @param header The annotation header/metadata object
38
+ * @returns A hex string hash representing the version
39
+ */
40
+ export declare function computeVersionHash(header: {
41
+ _id?: string | number;
42
+ _version?: number | string;
43
+ updated?: string | number;
44
+ modified?: string | number;
45
+ [key: string]: unknown;
46
+ }): string;
47
+ //# sourceMappingURL=hashUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hashUtils.d.ts","sourceRoot":"","sources":["../../src/cache/hashUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAajD;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE;IACzC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,UAAU,CAAC,EAAE;QACT,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KACzB,CAAA;IACD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACzB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAuB1B;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IACvC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACzB,GAAG,MAAM,CAGT"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Cache implementations for annotation documents
3
+ *
4
+ * Provides different caching strategies:
5
+ * - MemoryAnnotationCache: Fast in-memory cache (cleared on refresh)
6
+ * - IndexedDBAnnotationCache: Persistent cache using IndexedDB (handles large documents, 50MB+)
7
+ * Best for production use. Browser automatically handles quota expansion when needed.
8
+ *
9
+ * Future implementations:
10
+ * - RedisAnnotationCache: Server-side Redis cache
11
+ * - PostgresAnnotationCache: Server-side PostgreSQL cache with pgvector
12
+ */
13
+ export type { AnnotationCache } from './AnnotationCache';
14
+ export { MemoryAnnotationCache } from './MemoryAnnotationCache';
15
+ export { IndexedDBAnnotationCache } from './IndexedDBAnnotationCache';
16
+ export { computeHash, computeVersionHash, extractVersionFields } from './hashUtils';
17
+ export { measureAnnotationSizes, printSizeSummary } from './measureAnnotationSize';
18
+ export { CacheSizeTester } from './CacheSizeTester';
19
+ export { checkIndexedDBQuota, requestPersistentStorage, logQuotaInfo, formatBytes } from './indexedDBQuota';
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AACnF,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * IndexedDB quota management utilities.
3
+ *
4
+ * IndexedDB storage limits are automatically managed by the browser:
5
+ * - Initial quota: Typically 50MB+ (varies by browser and available disk space)
6
+ * - Automatic expansion: Browser prompts user when quota is exceeded
7
+ * - Persistent storage: Can request persistent storage (survives browser cleanup)
8
+ *
9
+ * These utilities help check quota status and request persistent storage when needed.
10
+ */
11
+ export interface QuotaInfo {
12
+ /** Estimated storage quota in bytes */
13
+ quota: number;
14
+ /** Estimated storage usage in bytes */
15
+ usage: number;
16
+ /** Estimated available storage in bytes */
17
+ available: number;
18
+ /** Storage usage as percentage (0-100) */
19
+ usagePercent: number;
20
+ /** Whether persistent storage is granted */
21
+ persistent: boolean;
22
+ }
23
+ /**
24
+ * Check IndexedDB quota and usage for the current origin.
25
+ * @returns Promise resolving to quota information, or null if quota API is not available
26
+ */
27
+ export declare function checkIndexedDBQuota(): Promise<QuotaInfo | null>;
28
+ /**
29
+ * Request persistent storage permission from the user.
30
+ * This prevents the browser from automatically clearing stored data during cleanup.
31
+ *
32
+ * Note: The browser may show a permission prompt to the user.
33
+ *
34
+ * @returns Promise resolving to true if persistent storage is granted, false otherwise
35
+ */
36
+ export declare function requestPersistentStorage(): Promise<boolean>;
37
+ /**
38
+ * Format bytes to human-readable string.
39
+ */
40
+ export declare function formatBytes(bytes: number): string;
41
+ /**
42
+ * Log quota information to the console in a readable format.
43
+ */
44
+ export declare function logQuotaInfo(): Promise<void>;
45
+ //# sourceMappingURL=indexedDBQuota.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexedDBQuota.d.ts","sourceRoot":"","sources":["../../src/cache/indexedDBQuota.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,WAAW,SAAS;IACtB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAA;IACb,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAA;IACb,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAA;IACjB,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAA;IACpB,4CAA4C;IAC5C,UAAU,EAAE,OAAO,CAAA;CACtB;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CA8BrE;AAED;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,OAAO,CAAC,CAkBjE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQjD;AAED;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAgBlD"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Utility to measure annotation document sizes for cache planning.
3
+ * This helps determine if IndexedDB storage limits will be sufficient.
4
+ */
5
+ export interface SizeMeasurement {
6
+ annotationId: string | number;
7
+ jsonStringSize: number;
8
+ jsonStringSizeMB: number;
9
+ estimatedIndexedDBSize: number;
10
+ estimatedIndexedDBSizeMB: number;
11
+ compressedSize?: number;
12
+ compressedSizeMB?: number;
13
+ compressionRatio?: number;
14
+ }
15
+ /**
16
+ * Measure the size of annotation documents.
17
+ * @param apiBaseUrl - Base URL for the DSA API
18
+ * @param imageId - Image ID to fetch annotations for
19
+ * @returns Array of size measurements for each annotation document
20
+ */
21
+ export declare function measureAnnotationSizes(apiBaseUrl: string, imageId: string | number): Promise<SizeMeasurement[]>;
22
+ /**
23
+ * Print a summary of annotation sizes.
24
+ */
25
+ export declare function printSizeSummary(measurements: SizeMeasurement[]): void;
26
+ //# sourceMappingURL=measureAnnotationSize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"measureAnnotationSize.d.ts","sourceRoot":"","sources":["../../src/cache/measureAnnotationSize.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,eAAe;IAC5B,YAAY,EAAE,MAAM,GAAG,MAAM,CAAA;IAC7B,cAAc,EAAE,MAAM,CAAA;IACtB,gBAAgB,EAAE,MAAM,CAAA;IACxB,sBAAsB,EAAE,MAAM,CAAA;IAC9B,wBAAwB,EAAE,MAAM,CAAA;IAChC,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CACxC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GAAG,MAAM,GACzB,OAAO,CAAC,eAAe,EAAE,CAAC,CAuF5B;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,eAAe,EAAE,GAAG,IAAI,CAmCtE"}
@@ -39,8 +39,68 @@ export interface AnnotationManagerProps {
39
39
  onError?: (error: Error) => void;
40
40
  /** Show debug panel with raw API response (default: false, hidden in production) */
41
41
  showDebugPanel?: boolean;
42
+ /** Callback when annotation is loaded/unloaded */
43
+ onAnnotationLoadChange?: (annotationId: string, loaded: boolean) => void;
44
+ /** Callback when annotation visibility is toggled */
45
+ onAnnotationVisibilityChange?: (annotationId: string, visible: boolean) => void;
46
+ /** Callback when annotation opacity changes */
47
+ onAnnotationOpacityChange?: (annotationId: string, opacity: number) => void;
48
+ /** Callback when annotation has finished loading and is ready (called by SlideViewer after rendering) */
49
+ onAnnotationReady?: (annotationId: string) => void;
50
+ /**
51
+ * Callback fired whenever the list of loaded annotation IDs changes.
52
+ * This is called when:
53
+ * - User clicks "Load" on an annotation
54
+ * - User clicks "Hide" on an annotation
55
+ * - Annotations are unloaded
56
+ *
57
+ * @param annotationIds - Array of currently loaded annotation IDs
58
+ */
59
+ onLoadedAnnotationIdsChange?: (annotationIds: string[]) => void;
60
+ /**
61
+ * Callback fired when an individual annotation is loaded.
62
+ * Useful for tracking which specific annotation was just loaded.
63
+ *
64
+ * @param annotationId - The ID of the annotation that was loaded
65
+ * @param annotationData - The full annotation document (optional, for performance)
66
+ */
67
+ onAnnotationLoad?: (annotationId: string, annotationData?: unknown) => void;
68
+ /**
69
+ * Callback fired when an individual annotation is hidden/unloaded.
70
+ *
71
+ * @param annotationId - The ID of the annotation that was hidden
72
+ */
73
+ onAnnotationHide?: (annotationId: string) => void;
74
+ /** Map of annotation IDs to their loaded state */
75
+ loadedAnnotations?: Set<string>;
76
+ /** Map of annotation IDs to their visibility state */
77
+ visibleAnnotations?: Map<string, boolean>;
78
+ /** Map of annotation IDs to their opacity (0-1) */
79
+ annotationOpacities?: Map<string, number>;
80
+ /** Optional cache instance to check if annotations are cached locally. If not provided, automatically creates an IndexedDBAnnotationCache.
81
+ * Set to `null` to disable caching. If provided, will show a cache indicator icon when annotations are cached. */
82
+ annotationCache?: {
83
+ has(annotationId: string | number, versionHash?: string): Promise<boolean>;
84
+ delete?(annotationId: string | number): Promise<void>;
85
+ } | null;
86
+ /** If true, disables caching entirely (equivalent to annotationCache={null}). Useful for debugging or forcing fresh fetches. */
87
+ disableCache?: boolean;
88
+ /** Show default vertical UI (default: true). Set to false to use custom render prop. */
89
+ showDefaultUI?: boolean;
42
90
  className?: string;
43
- children?: React.ReactNode;
91
+ children?: React.ReactNode | ((context: {
92
+ annotations: AnnotationSearchResult[];
93
+ loading: boolean;
94
+ error: Error | null;
95
+ annotationIds: string[];
96
+ loadedAnnotations: Set<string>;
97
+ visibleAnnotations: Map<string, boolean>;
98
+ annotationOpacities: Map<string, number>;
99
+ toggleLoad: (annotationId: string) => void;
100
+ toggleVisibility: (annotationId: string) => void;
101
+ setOpacity: (annotationId: string, opacity: number) => void;
102
+ onAnnotationReady: (annotationId: string | number) => void;
103
+ }) => React.ReactNode);
44
104
  }
45
105
  /**
46
106
  * AnnotationManager component for managing annotation loading, visibility, and state.
@@ -1 +1 @@
1
- {"version":3,"file":"AnnotationManager.d.ts","sourceRoot":"","sources":["../../../src/components/AnnotationManager/AnnotationManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAA;AAC3D,OAAO,yBAAyB,CAAA;AAE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AE,KAAK,IAAI,CAAA;IACrE,6CAA6C;IAC7C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;IAChC,oFAAoF;IACpF,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC7B;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,+FA4I7B,CAAA"}
1
+ {"version":3,"file":"AnnotationManager.d.ts","sourceRoot":"","sources":["../../../src/components/AnnotationManager/AnnotationManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAA;AAEhF,OAAO,yBAAyB,CAAA;AAEhC,MAAM,WAAW,sBAAsB;IACnC,GAAG,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAA;IAC1B,UAAU,CAAC,EAAE;QACT,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QACpC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KACpC,CAAA;IACD,CAAC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E,MAAM,KAAK,IAAI,CAAA;QAChD,UAAU,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;QAC3D,iBAAiB,EAAE,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAA;KAC7D,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;CACzB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,+FAkmB7B,CAAA"}
@@ -123,6 +123,41 @@ export interface SlideViewerProps {
123
123
  showAnnotationControls?: boolean;
124
124
  /** Default opacity for all annotations (0-1, default: 1) */
125
125
  defaultAnnotationOpacity?: number;
126
+ /** Map of annotation IDs to their individual opacity values (0-1). Overrides defaultAnnotationOpacity for specific annotations. */
127
+ annotationOpacities?: Map<string | number, number> | Record<string, number>;
128
+ /** Map of annotation IDs to their visibility state. If provided, only visible annotations will be rendered/updated. */
129
+ visibleAnnotations?: Map<string | number, boolean> | Record<string, boolean>;
130
+ /** Callback when annotation has finished loading and rendering. Called with the annotation ID. */
131
+ onAnnotationReady?: (annotationId: string | number) => void;
132
+ /** Optional pull-through cache for annotation documents. Acts as a cache-aside proxy:
133
+ * 1. Checks cache first on fetch requests
134
+ * 2. On cache miss, fetches from API and stores in cache
135
+ * 3. On cache hit, returns cached data immediately (no API call)
136
+ * If not provided, automatically creates an IndexedDBAnnotationCache. Set to `null` to disable caching. */
137
+ annotationCache?: {
138
+ get(annotationId: string | number, versionHash?: string): Promise<unknown | null>;
139
+ set(annotationId: string | number, data: unknown, options?: {
140
+ ttl?: number;
141
+ versionHash?: string;
142
+ }): Promise<void>;
143
+ has(annotationId: string | number, versionHash?: string): Promise<boolean>;
144
+ delete(annotationId: string | number): Promise<void>;
145
+ clear(): Promise<void>;
146
+ getStats?(): Promise<{
147
+ size: number;
148
+ hits?: number;
149
+ misses?: number;
150
+ hitRate?: number;
151
+ }>;
152
+ } | null;
153
+ /** If true, disables caching entirely (equivalent to annotationCache={null}). Useful for debugging or forcing fresh fetches. */
154
+ disableCache?: boolean;
155
+ /** Optional map of annotation headers (from /annotation?itemId=... endpoint) keyed by annotation ID.
156
+ * If provided, used to compute version hashes for cache invalidation when annotations change on the server.
157
+ * Should contain the metadata objects returned from AnnotationManager's annotation search endpoint.
158
+ * Typically obtained from AnnotationManager: `annotations.map(ann => [ann._id, ann])` or similar.
159
+ * If not provided, cache will work but version-based invalidation will be disabled. */
160
+ annotationHeaders?: Map<string | number, unknown> | Record<string, unknown>;
126
161
  }
127
162
  /**
128
163
  * A slide viewer component that integrates OpenSeadragon with Paper.js annotations
@@ -1 +1 @@
1
- {"version":3,"file":"SlideViewer.d.ts","sourceRoot":"","sources":["../../../src/components/SlideViewer/SlideViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAA;AAGhF,OAAO,KAAK,EAAE,iBAAiB,EAAW,MAAM,SAAS,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,IAAI,mBAAmB,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,eAAe,CAAA;AACnG,OAAO,mBAAmB,CAAA;AAE1B,MAAM,WAAW,cAAc;IAC3B,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;oFACgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,iBAAiB;IAC9B,2CAA2C;IAC3C,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAA;IAC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