react-iiif-vault 2.0.6 → 2.0.8
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/dist/bundle.d.ts +76 -1
- package/dist/bundle.global.js +40 -44
- package/dist/canvas-panel.cjs +3 -3
- package/dist/canvas-panel.d.cts +1 -1
- package/dist/canvas-panel.d.ts +1 -1
- package/dist/canvas-panel.js +1 -1
- package/dist/{chunk-MUASBCAU.js → chunk-ICQYS35G.js} +3 -3
- package/dist/{index-kvJxjxZG.d.ts → index-BzqDQGvO.d.ts} +2 -0
- package/dist/{index-Bxw5USbW.d.cts → index-VNY_GL30.d.cts} +2 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +76 -3
- package/dist/index.d.ts +76 -3
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from '@iiif/helpers/annotation-targets';
|
|
2
|
-
import { S as SVGTheme, R as RenderContextProps, A as AudioComponentProps, V as VideoComponentProps, u as useSvgEditor, a as SimpleViewerContext, b as AtlasStore, c as AnnotationRequest, d as AnnotationResponse, e as AnnotationRequestOptions, f as SimpleViewerProps } from './index-
|
|
3
|
-
export { h as AtlasStoreEvents, n as AtlasStoreProvider, k as AtlasStoreReactContext, g as CanvasPanel, C as CanvasPanelProps, i as CreateAtlasStoreProps, o as RenderAnnotation, q as RenderAnnotationPage, x as SimpleViewerActions, y as SimpleViewerActionsType, w as SimpleViewerReducerState, j as createAtlasStore, v as defaultSvgTheme, m as getAtlasStoreByName, p as polygonToTarget, r as requestToAnnotationResponse, t as useAtlasContextMenu, l as useAtlasStore, s as useContextMenuStore } from './index-
|
|
2
|
+
import { S as SVGTheme, R as RenderContextProps, A as AudioComponentProps, V as VideoComponentProps, u as useSvgEditor, a as SimpleViewerContext, b as AtlasStore, c as AnnotationRequest, d as AnnotationResponse, e as AnnotationRequestOptions, f as SimpleViewerProps } from './index-VNY_GL30.cjs';
|
|
3
|
+
export { h as AtlasStoreEvents, n as AtlasStoreProvider, k as AtlasStoreReactContext, g as CanvasPanel, C as CanvasPanelProps, i as CreateAtlasStoreProps, o as RenderAnnotation, q as RenderAnnotationPage, x as SimpleViewerActions, y as SimpleViewerActionsType, w as SimpleViewerReducerState, j as createAtlasStore, v as defaultSvgTheme, m as getAtlasStoreByName, p as polygonToTarget, r as requestToAnnotationResponse, t as useAtlasContextMenu, l as useAtlasStore, s as useContextMenuStore } from './index-VNY_GL30.cjs';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import { BoxStyle, AtlasProps, Preset } from '@atlas-viewer/atlas';
|
|
6
6
|
import * as React$1 from 'react';
|
|
@@ -1255,6 +1255,79 @@ declare const useVaultEffect: (callback: (vault: Vault) => void, deps?: any[]) =
|
|
|
1255
1255
|
|
|
1256
1256
|
declare function useVaultSelector<T>(selector: (state: IIIFStore, vault: Vault) => T, deps?: any[]): T;
|
|
1257
1257
|
|
|
1258
|
+
type Rect = {
|
|
1259
|
+
x: number;
|
|
1260
|
+
y: number;
|
|
1261
|
+
width: number;
|
|
1262
|
+
height: number;
|
|
1263
|
+
};
|
|
1264
|
+
type Transition = {
|
|
1265
|
+
from: Rect;
|
|
1266
|
+
to: Rect;
|
|
1267
|
+
};
|
|
1268
|
+
declare const DEFAULT_BEZIER: [number, number, number, number];
|
|
1269
|
+
declare const DEFAULT_POLL_INTERVAL = 16;
|
|
1270
|
+
type EasingPreset = 'linear' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'ease-in-cubic' | 'ease-out-cubic';
|
|
1271
|
+
declare const EASING_PRESETS: Record<EasingPreset, [number, number, number, number]>;
|
|
1272
|
+
declare function interpolateRect(a: Rect, b: Rect, t: number): Rect;
|
|
1273
|
+
declare function buildTransitions(initial: Rect, regions: Rect[]): Transition[];
|
|
1274
|
+
/**
|
|
1275
|
+
* Create a cubic-bezier easing function given control points [x1,y1,x2,y2].
|
|
1276
|
+
* Uses a numeric solve to invert x(t) -> t for a given x input.
|
|
1277
|
+
*/
|
|
1278
|
+
declare function cubicBezierEasing([x1, y1, x2, y2]: [number, number, number, number]): (x: number) => number;
|
|
1279
|
+
/**
|
|
1280
|
+
* Map a progress value to a step index and local t in [0,1].
|
|
1281
|
+
* If progress < 0 returns index -1 and t 0. If progress >= transitions.length returns index = transitions.length and t 0.
|
|
1282
|
+
*/
|
|
1283
|
+
declare function getStepFromProgress(progress: number, transitions: Transition[]): {
|
|
1284
|
+
index: number;
|
|
1285
|
+
t: number;
|
|
1286
|
+
};
|
|
1287
|
+
|
|
1288
|
+
type EasingInput = ((t: number) => number) | EasingPreset | [number, number, number, number];
|
|
1289
|
+
type UseViewportTourOptions = {
|
|
1290
|
+
initial: Rect;
|
|
1291
|
+
regions: Rect[];
|
|
1292
|
+
/** Provide either a numeric progress or a function that returns progress */
|
|
1293
|
+
progress?: number;
|
|
1294
|
+
getProgress?: () => number;
|
|
1295
|
+
enabled?: boolean;
|
|
1296
|
+
easing?: EasingInput;
|
|
1297
|
+
/** if true, report progress every tick; otherwise only when step index changes */
|
|
1298
|
+
reportEveryFrame?: boolean;
|
|
1299
|
+
pollInterval?: number;
|
|
1300
|
+
loop?: boolean;
|
|
1301
|
+
onEnter?: (index: number) => void;
|
|
1302
|
+
onExit?: (index: number) => void;
|
|
1303
|
+
onProgress?: (index: number, t: number) => void;
|
|
1304
|
+
/** optional callback to receive jump-to function for programmatic navigation */
|
|
1305
|
+
jumpTo?: (fn: (index: number) => void) => void;
|
|
1306
|
+
};
|
|
1307
|
+
declare function useViewportTour(options: UseViewportTourOptions): {
|
|
1308
|
+
transitions: Transition[];
|
|
1309
|
+
currentIndex: number;
|
|
1310
|
+
currentTransition: Transition | undefined;
|
|
1311
|
+
t: number;
|
|
1312
|
+
rect: Rect | undefined;
|
|
1313
|
+
jumpTo: (indexToJump: number) => void;
|
|
1314
|
+
};
|
|
1315
|
+
|
|
1316
|
+
type UseViewportScrollOptions = {
|
|
1317
|
+
axis?: 'y' | 'x';
|
|
1318
|
+
offset?: number;
|
|
1319
|
+
steps?: number;
|
|
1320
|
+
enabled?: boolean;
|
|
1321
|
+
};
|
|
1322
|
+
/**
|
|
1323
|
+
* Returns a progress value derived from scroll position of provided element.
|
|
1324
|
+
* The returned value is in range [0, steps].
|
|
1325
|
+
* Uses passive scroll listener + requestAnimationFrame for efficient updates.
|
|
1326
|
+
*/
|
|
1327
|
+
declare function useViewportScroll(ref: {
|
|
1328
|
+
current: HTMLElement | null;
|
|
1329
|
+
} | null, options?: UseViewportScrollOptions): number;
|
|
1330
|
+
|
|
1258
1331
|
interface VaultActivatedAnnotation {
|
|
1259
1332
|
__vault?: Vault;
|
|
1260
1333
|
bindToVault(vault: Vault): void;
|
|
@@ -1417,4 +1490,4 @@ declare function getManifestSequence(vault: Vault, manifestOrRange: ManifestNorm
|
|
|
1417
1490
|
skipNonPaged?: boolean;
|
|
1418
1491
|
}): [Reference<'Canvas'>[], number[][]];
|
|
1419
1492
|
|
|
1420
|
-
export { AnnotationContext, AnnotationPageContext, AnnotationRequest, AnnotationRequestOptions, AnnotationResponse, type AnnotationStrategyProps, AnnotationStyleProvider, type AnnotationStyles, type AnnotationThemeDefinition, AtlasStore, Auth, type AuthAccessState, type AuthContextActions, type AuthContextCurrentActions, type AuthContextState, AuthProvider, AuthRContext, AuthReactContext, AuthReactContextActions, type AuthState, CanvasAnnotations, CanvasContext, CanvasStrategyProvider, CanvasWorldObject, CollectionContext, CombinedMetadata, ComplexTimelineProvider, ComplexTimelineStrategy, ContextBridge, type ControlsContext, ControlsReactContext, CreateCustomShape, type CreateCustomShapeProps, CustomContextBridge, CustomContextBridgeProvider, DefaultEditingTools, EmptyStrategy, EventEmitterProvider, EventsProvider, Image, type ImageProps, ImageService, ImageServiceLoaderContext, ImageServiceLoaderType, type ImageServiceRequestOptions, type ImageStrategyProps, ImageWithOptionalService, InnerViewerProvider, LanguageProvider, LanguageString, LocaleString, ManifestContext, ManifestMetadata, type MediaPlayerActions, MediaPlayerProvider, type MediaPlayerState, MediaStrategy, Metadata, type MetadataProps, PolygonSelector, type PolygonSelectorProps, type ProbeStore, RangeContext, ReactEmitterContext, ReactEventContext, ReactVaultContext, RegionHighlight, Render3DModelStrategy, RenderAccompanyingCanvas, RenderAnnotationEditing, RenderAnnotationStrategy, RenderAudioStrategy, RenderComplexTimelineStrategy, RenderContextProps, RenderEmptyStrategy, RenderImageStrategy, RenderSvgEditorControls, RenderTextualContentStrategy, RenderVideoStrategy, RenderYouTubeStrategy, RenderingStrategy, ResizeWorldItem, type ResourceContextType, ResourceProvider, ResourceReactContext, type ResourceRequestOptions, SVGTheme, SelectorControllerProvider, type SelectorHelperEventTypes, SequenceThumbnails, SimpleViewerContext, SimpleViewerProps, SimpleViewerProvider, SimpleViewerReactContext, SingleCanvasThumbnail, SingleImageStrategy, StrategyActions, type StrategyContext, StrategyReactContext, type SvgTheme, ThumbnailFallbackImage, TimelineKeyframe, TranslationProvider, TransliterationProvider, UnknownStrategy, type VaultActivatedAnnotation, VaultProvider, ViewerPresetContext, VirtualAnnotationProvider, VisibleCanvasReactContext, annotationResponseToSelector, authDetailsForResource, createAuthStateStore, createProbe, defaultEmitter, findAllCanvasesInRange, findFirstCanvasFromRange, findManifestSelectedRange, findSelectedRange, flattenAnnotationPageIds, formatTime, getComplexTimelineStrategy, getDefaultAnnotationStyles, getManifestSequence, getVideoStrategy, getVisibleCanvasesFromCanvasId, hasAuth, isBoxSelector, isRectangle, isSvgSelector, makeAccessServiceRequest, makeAccessTokenRequest, seraliseSupportedSelector, svgThemes, targetIntersects, useAnnotation, useAnnotationPage, useAnnotationPageManager, useAnnotationStyles, useAnnotationsAtTime, useAuthActions, useAuthService, useAuthStore, useAuthToken, useAuthTokens, useCanvas, useCanvasChoices, useCanvasClock, useCanvasSequence, useCanvasStartTime, useCanvasSubset, useClosestLanguage, useCollection, useComplexTimeline, useContextBridge, useCreateLocaleString, useCurrentAnnotationActions, useCurrentAnnotationMetadata, useCurrentAnnotationRequest, useCurrentAnnotationTransition, useCurrentAuth, useCustomContextBridge, useDispatch, useEmitter, useEvent, useEventEmitter, useEventListener, useExistingVault, useExternalCollection, useExternalManifest, useExternalResource, useIIIFLanguage, useImage, useImageService, useImageServiceLoader, useImageTile, useIsAuthEnabled, useLocaleString, useManifest, useMediaActions, useMediaElements, useMediaState, usePaintables, usePaintingAnnotations, usePolygonHelper, useRange, useRemoteStylesheet, useRenderControls, useRequestAnnotation, useResourceContext, useResourceEvents, useResources, useSearchService, useSelectorController, useSelectorEmitter, useSelectorEvents, useSelectorHelper, useSimpleMediaPlayer, useSimpleViewer, useStaticRenderingStrategy, useStrategy, useStyleHelper, useStyles, useStylesheetStore, useSvgEditor, useSvgEditorControls, useThumbnail, useTranslations, useTransliteration, useVault, useVaultEffect, useVaultSelector, useViewerPreset, useVirtualAnnotationPage, useVirtualAnnotationPageContext, useVisibleCanvases };
|
|
1493
|
+
export { AnnotationContext, AnnotationPageContext, AnnotationRequest, AnnotationRequestOptions, AnnotationResponse, type AnnotationStrategyProps, AnnotationStyleProvider, type AnnotationStyles, type AnnotationThemeDefinition, AtlasStore, Auth, type AuthAccessState, type AuthContextActions, type AuthContextCurrentActions, type AuthContextState, AuthProvider, AuthRContext, AuthReactContext, AuthReactContextActions, type AuthState, CanvasAnnotations, CanvasContext, CanvasStrategyProvider, CanvasWorldObject, CollectionContext, CombinedMetadata, ComplexTimelineProvider, ComplexTimelineStrategy, ContextBridge, type ControlsContext, ControlsReactContext, CreateCustomShape, type CreateCustomShapeProps, CustomContextBridge, CustomContextBridgeProvider, DEFAULT_BEZIER, DEFAULT_POLL_INTERVAL, DefaultEditingTools, EASING_PRESETS, type EasingInput, type EasingPreset, EmptyStrategy, EventEmitterProvider, EventsProvider, Image, type ImageProps, ImageService, ImageServiceLoaderContext, ImageServiceLoaderType, type ImageServiceRequestOptions, type ImageStrategyProps, ImageWithOptionalService, InnerViewerProvider, LanguageProvider, LanguageString, LocaleString, ManifestContext, ManifestMetadata, type MediaPlayerActions, MediaPlayerProvider, type MediaPlayerState, MediaStrategy, Metadata, type MetadataProps, PolygonSelector, type PolygonSelectorProps, type ProbeStore, RangeContext, ReactEmitterContext, ReactEventContext, ReactVaultContext, type Rect, RegionHighlight, Render3DModelStrategy, RenderAccompanyingCanvas, RenderAnnotationEditing, RenderAnnotationStrategy, RenderAudioStrategy, RenderComplexTimelineStrategy, RenderContextProps, RenderEmptyStrategy, RenderImageStrategy, RenderSvgEditorControls, RenderTextualContentStrategy, RenderVideoStrategy, RenderYouTubeStrategy, RenderingStrategy, ResizeWorldItem, type ResourceContextType, ResourceProvider, ResourceReactContext, type ResourceRequestOptions, SVGTheme, SelectorControllerProvider, type SelectorHelperEventTypes, SequenceThumbnails, SimpleViewerContext, SimpleViewerProps, SimpleViewerProvider, SimpleViewerReactContext, SingleCanvasThumbnail, SingleImageStrategy, StrategyActions, type StrategyContext, StrategyReactContext, type SvgTheme, ThumbnailFallbackImage, TimelineKeyframe, type Transition, TranslationProvider, TransliterationProvider, UnknownStrategy, type UseViewportScrollOptions, type UseViewportTourOptions, type VaultActivatedAnnotation, VaultProvider, ViewerPresetContext, VirtualAnnotationProvider, VisibleCanvasReactContext, annotationResponseToSelector, authDetailsForResource, buildTransitions, createAuthStateStore, createProbe, cubicBezierEasing, defaultEmitter, findAllCanvasesInRange, findFirstCanvasFromRange, findManifestSelectedRange, findSelectedRange, flattenAnnotationPageIds, formatTime, getComplexTimelineStrategy, getDefaultAnnotationStyles, getManifestSequence, getStepFromProgress, getVideoStrategy, getVisibleCanvasesFromCanvasId, hasAuth, interpolateRect, isBoxSelector, isRectangle, isSvgSelector, makeAccessServiceRequest, makeAccessTokenRequest, seraliseSupportedSelector, svgThemes, targetIntersects, useAnnotation, useAnnotationPage, useAnnotationPageManager, useAnnotationStyles, useAnnotationsAtTime, useAuthActions, useAuthService, useAuthStore, useAuthToken, useAuthTokens, useCanvas, useCanvasChoices, useCanvasClock, useCanvasSequence, useCanvasStartTime, useCanvasSubset, useClosestLanguage, useCollection, useComplexTimeline, useContextBridge, useCreateLocaleString, useCurrentAnnotationActions, useCurrentAnnotationMetadata, useCurrentAnnotationRequest, useCurrentAnnotationTransition, useCurrentAuth, useCustomContextBridge, useDispatch, useEmitter, useEvent, useEventEmitter, useEventListener, useExistingVault, useExternalCollection, useExternalManifest, useExternalResource, useIIIFLanguage, useImage, useImageService, useImageServiceLoader, useImageTile, useIsAuthEnabled, useLocaleString, useManifest, useMediaActions, useMediaElements, useMediaState, usePaintables, usePaintingAnnotations, usePolygonHelper, useRange, useRemoteStylesheet, useRenderControls, useRequestAnnotation, useResourceContext, useResourceEvents, useResources, useSearchService, useSelectorController, useSelectorEmitter, useSelectorEvents, useSelectorHelper, useSimpleMediaPlayer, useSimpleViewer, useStaticRenderingStrategy, useStrategy, useStyleHelper, useStyles, useStylesheetStore, useSvgEditor, useSvgEditorControls, useThumbnail, useTranslations, useTransliteration, useVault, useVaultEffect, useVaultSelector, useViewerPreset, useViewportScroll, useViewportTour, useVirtualAnnotationPage, useVirtualAnnotationPageContext, useVisibleCanvases };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from '@iiif/helpers/annotation-targets';
|
|
2
|
-
import { S as SVGTheme, R as RenderContextProps, A as AudioComponentProps, V as VideoComponentProps, u as useSvgEditor, a as SimpleViewerContext, b as AtlasStore, c as AnnotationRequest, d as AnnotationResponse, e as AnnotationRequestOptions, f as SimpleViewerProps } from './index-
|
|
3
|
-
export { h as AtlasStoreEvents, n as AtlasStoreProvider, k as AtlasStoreReactContext, g as CanvasPanel, C as CanvasPanelProps, i as CreateAtlasStoreProps, o as RenderAnnotation, q as RenderAnnotationPage, x as SimpleViewerActions, y as SimpleViewerActionsType, w as SimpleViewerReducerState, j as createAtlasStore, v as defaultSvgTheme, m as getAtlasStoreByName, p as polygonToTarget, r as requestToAnnotationResponse, t as useAtlasContextMenu, l as useAtlasStore, s as useContextMenuStore } from './index-
|
|
2
|
+
import { S as SVGTheme, R as RenderContextProps, A as AudioComponentProps, V as VideoComponentProps, u as useSvgEditor, a as SimpleViewerContext, b as AtlasStore, c as AnnotationRequest, d as AnnotationResponse, e as AnnotationRequestOptions, f as SimpleViewerProps } from './index-BzqDQGvO.js';
|
|
3
|
+
export { h as AtlasStoreEvents, n as AtlasStoreProvider, k as AtlasStoreReactContext, g as CanvasPanel, C as CanvasPanelProps, i as CreateAtlasStoreProps, o as RenderAnnotation, q as RenderAnnotationPage, x as SimpleViewerActions, y as SimpleViewerActionsType, w as SimpleViewerReducerState, j as createAtlasStore, v as defaultSvgTheme, m as getAtlasStoreByName, p as polygonToTarget, r as requestToAnnotationResponse, t as useAtlasContextMenu, l as useAtlasStore, s as useContextMenuStore } from './index-BzqDQGvO.js';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import { BoxStyle, AtlasProps, Preset } from '@atlas-viewer/atlas';
|
|
6
6
|
import * as React$1 from 'react';
|
|
@@ -1255,6 +1255,79 @@ declare const useVaultEffect: (callback: (vault: Vault) => void, deps?: any[]) =
|
|
|
1255
1255
|
|
|
1256
1256
|
declare function useVaultSelector<T>(selector: (state: IIIFStore, vault: Vault) => T, deps?: any[]): T;
|
|
1257
1257
|
|
|
1258
|
+
type Rect = {
|
|
1259
|
+
x: number;
|
|
1260
|
+
y: number;
|
|
1261
|
+
width: number;
|
|
1262
|
+
height: number;
|
|
1263
|
+
};
|
|
1264
|
+
type Transition = {
|
|
1265
|
+
from: Rect;
|
|
1266
|
+
to: Rect;
|
|
1267
|
+
};
|
|
1268
|
+
declare const DEFAULT_BEZIER: [number, number, number, number];
|
|
1269
|
+
declare const DEFAULT_POLL_INTERVAL = 16;
|
|
1270
|
+
type EasingPreset = 'linear' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'ease-in-cubic' | 'ease-out-cubic';
|
|
1271
|
+
declare const EASING_PRESETS: Record<EasingPreset, [number, number, number, number]>;
|
|
1272
|
+
declare function interpolateRect(a: Rect, b: Rect, t: number): Rect;
|
|
1273
|
+
declare function buildTransitions(initial: Rect, regions: Rect[]): Transition[];
|
|
1274
|
+
/**
|
|
1275
|
+
* Create a cubic-bezier easing function given control points [x1,y1,x2,y2].
|
|
1276
|
+
* Uses a numeric solve to invert x(t) -> t for a given x input.
|
|
1277
|
+
*/
|
|
1278
|
+
declare function cubicBezierEasing([x1, y1, x2, y2]: [number, number, number, number]): (x: number) => number;
|
|
1279
|
+
/**
|
|
1280
|
+
* Map a progress value to a step index and local t in [0,1].
|
|
1281
|
+
* If progress < 0 returns index -1 and t 0. If progress >= transitions.length returns index = transitions.length and t 0.
|
|
1282
|
+
*/
|
|
1283
|
+
declare function getStepFromProgress(progress: number, transitions: Transition[]): {
|
|
1284
|
+
index: number;
|
|
1285
|
+
t: number;
|
|
1286
|
+
};
|
|
1287
|
+
|
|
1288
|
+
type EasingInput = ((t: number) => number) | EasingPreset | [number, number, number, number];
|
|
1289
|
+
type UseViewportTourOptions = {
|
|
1290
|
+
initial: Rect;
|
|
1291
|
+
regions: Rect[];
|
|
1292
|
+
/** Provide either a numeric progress or a function that returns progress */
|
|
1293
|
+
progress?: number;
|
|
1294
|
+
getProgress?: () => number;
|
|
1295
|
+
enabled?: boolean;
|
|
1296
|
+
easing?: EasingInput;
|
|
1297
|
+
/** if true, report progress every tick; otherwise only when step index changes */
|
|
1298
|
+
reportEveryFrame?: boolean;
|
|
1299
|
+
pollInterval?: number;
|
|
1300
|
+
loop?: boolean;
|
|
1301
|
+
onEnter?: (index: number) => void;
|
|
1302
|
+
onExit?: (index: number) => void;
|
|
1303
|
+
onProgress?: (index: number, t: number) => void;
|
|
1304
|
+
/** optional callback to receive jump-to function for programmatic navigation */
|
|
1305
|
+
jumpTo?: (fn: (index: number) => void) => void;
|
|
1306
|
+
};
|
|
1307
|
+
declare function useViewportTour(options: UseViewportTourOptions): {
|
|
1308
|
+
transitions: Transition[];
|
|
1309
|
+
currentIndex: number;
|
|
1310
|
+
currentTransition: Transition | undefined;
|
|
1311
|
+
t: number;
|
|
1312
|
+
rect: Rect | undefined;
|
|
1313
|
+
jumpTo: (indexToJump: number) => void;
|
|
1314
|
+
};
|
|
1315
|
+
|
|
1316
|
+
type UseViewportScrollOptions = {
|
|
1317
|
+
axis?: 'y' | 'x';
|
|
1318
|
+
offset?: number;
|
|
1319
|
+
steps?: number;
|
|
1320
|
+
enabled?: boolean;
|
|
1321
|
+
};
|
|
1322
|
+
/**
|
|
1323
|
+
* Returns a progress value derived from scroll position of provided element.
|
|
1324
|
+
* The returned value is in range [0, steps].
|
|
1325
|
+
* Uses passive scroll listener + requestAnimationFrame for efficient updates.
|
|
1326
|
+
*/
|
|
1327
|
+
declare function useViewportScroll(ref: {
|
|
1328
|
+
current: HTMLElement | null;
|
|
1329
|
+
} | null, options?: UseViewportScrollOptions): number;
|
|
1330
|
+
|
|
1258
1331
|
interface VaultActivatedAnnotation {
|
|
1259
1332
|
__vault?: Vault;
|
|
1260
1333
|
bindToVault(vault: Vault): void;
|
|
@@ -1417,4 +1490,4 @@ declare function getManifestSequence(vault: Vault, manifestOrRange: ManifestNorm
|
|
|
1417
1490
|
skipNonPaged?: boolean;
|
|
1418
1491
|
}): [Reference<'Canvas'>[], number[][]];
|
|
1419
1492
|
|
|
1420
|
-
export { AnnotationContext, AnnotationPageContext, AnnotationRequest, AnnotationRequestOptions, AnnotationResponse, type AnnotationStrategyProps, AnnotationStyleProvider, type AnnotationStyles, type AnnotationThemeDefinition, AtlasStore, Auth, type AuthAccessState, type AuthContextActions, type AuthContextCurrentActions, type AuthContextState, AuthProvider, AuthRContext, AuthReactContext, AuthReactContextActions, type AuthState, CanvasAnnotations, CanvasContext, CanvasStrategyProvider, CanvasWorldObject, CollectionContext, CombinedMetadata, ComplexTimelineProvider, ComplexTimelineStrategy, ContextBridge, type ControlsContext, ControlsReactContext, CreateCustomShape, type CreateCustomShapeProps, CustomContextBridge, CustomContextBridgeProvider, DefaultEditingTools, EmptyStrategy, EventEmitterProvider, EventsProvider, Image, type ImageProps, ImageService, ImageServiceLoaderContext, ImageServiceLoaderType, type ImageServiceRequestOptions, type ImageStrategyProps, ImageWithOptionalService, InnerViewerProvider, LanguageProvider, LanguageString, LocaleString, ManifestContext, ManifestMetadata, type MediaPlayerActions, MediaPlayerProvider, type MediaPlayerState, MediaStrategy, Metadata, type MetadataProps, PolygonSelector, type PolygonSelectorProps, type ProbeStore, RangeContext, ReactEmitterContext, ReactEventContext, ReactVaultContext, RegionHighlight, Render3DModelStrategy, RenderAccompanyingCanvas, RenderAnnotationEditing, RenderAnnotationStrategy, RenderAudioStrategy, RenderComplexTimelineStrategy, RenderContextProps, RenderEmptyStrategy, RenderImageStrategy, RenderSvgEditorControls, RenderTextualContentStrategy, RenderVideoStrategy, RenderYouTubeStrategy, RenderingStrategy, ResizeWorldItem, type ResourceContextType, ResourceProvider, ResourceReactContext, type ResourceRequestOptions, SVGTheme, SelectorControllerProvider, type SelectorHelperEventTypes, SequenceThumbnails, SimpleViewerContext, SimpleViewerProps, SimpleViewerProvider, SimpleViewerReactContext, SingleCanvasThumbnail, SingleImageStrategy, StrategyActions, type StrategyContext, StrategyReactContext, type SvgTheme, ThumbnailFallbackImage, TimelineKeyframe, TranslationProvider, TransliterationProvider, UnknownStrategy, type VaultActivatedAnnotation, VaultProvider, ViewerPresetContext, VirtualAnnotationProvider, VisibleCanvasReactContext, annotationResponseToSelector, authDetailsForResource, createAuthStateStore, createProbe, defaultEmitter, findAllCanvasesInRange, findFirstCanvasFromRange, findManifestSelectedRange, findSelectedRange, flattenAnnotationPageIds, formatTime, getComplexTimelineStrategy, getDefaultAnnotationStyles, getManifestSequence, getVideoStrategy, getVisibleCanvasesFromCanvasId, hasAuth, isBoxSelector, isRectangle, isSvgSelector, makeAccessServiceRequest, makeAccessTokenRequest, seraliseSupportedSelector, svgThemes, targetIntersects, useAnnotation, useAnnotationPage, useAnnotationPageManager, useAnnotationStyles, useAnnotationsAtTime, useAuthActions, useAuthService, useAuthStore, useAuthToken, useAuthTokens, useCanvas, useCanvasChoices, useCanvasClock, useCanvasSequence, useCanvasStartTime, useCanvasSubset, useClosestLanguage, useCollection, useComplexTimeline, useContextBridge, useCreateLocaleString, useCurrentAnnotationActions, useCurrentAnnotationMetadata, useCurrentAnnotationRequest, useCurrentAnnotationTransition, useCurrentAuth, useCustomContextBridge, useDispatch, useEmitter, useEvent, useEventEmitter, useEventListener, useExistingVault, useExternalCollection, useExternalManifest, useExternalResource, useIIIFLanguage, useImage, useImageService, useImageServiceLoader, useImageTile, useIsAuthEnabled, useLocaleString, useManifest, useMediaActions, useMediaElements, useMediaState, usePaintables, usePaintingAnnotations, usePolygonHelper, useRange, useRemoteStylesheet, useRenderControls, useRequestAnnotation, useResourceContext, useResourceEvents, useResources, useSearchService, useSelectorController, useSelectorEmitter, useSelectorEvents, useSelectorHelper, useSimpleMediaPlayer, useSimpleViewer, useStaticRenderingStrategy, useStrategy, useStyleHelper, useStyles, useStylesheetStore, useSvgEditor, useSvgEditorControls, useThumbnail, useTranslations, useTransliteration, useVault, useVaultEffect, useVaultSelector, useViewerPreset, useVirtualAnnotationPage, useVirtualAnnotationPageContext, useVisibleCanvases };
|
|
1493
|
+
export { AnnotationContext, AnnotationPageContext, AnnotationRequest, AnnotationRequestOptions, AnnotationResponse, type AnnotationStrategyProps, AnnotationStyleProvider, type AnnotationStyles, type AnnotationThemeDefinition, AtlasStore, Auth, type AuthAccessState, type AuthContextActions, type AuthContextCurrentActions, type AuthContextState, AuthProvider, AuthRContext, AuthReactContext, AuthReactContextActions, type AuthState, CanvasAnnotations, CanvasContext, CanvasStrategyProvider, CanvasWorldObject, CollectionContext, CombinedMetadata, ComplexTimelineProvider, ComplexTimelineStrategy, ContextBridge, type ControlsContext, ControlsReactContext, CreateCustomShape, type CreateCustomShapeProps, CustomContextBridge, CustomContextBridgeProvider, DEFAULT_BEZIER, DEFAULT_POLL_INTERVAL, DefaultEditingTools, EASING_PRESETS, type EasingInput, type EasingPreset, EmptyStrategy, EventEmitterProvider, EventsProvider, Image, type ImageProps, ImageService, ImageServiceLoaderContext, ImageServiceLoaderType, type ImageServiceRequestOptions, type ImageStrategyProps, ImageWithOptionalService, InnerViewerProvider, LanguageProvider, LanguageString, LocaleString, ManifestContext, ManifestMetadata, type MediaPlayerActions, MediaPlayerProvider, type MediaPlayerState, MediaStrategy, Metadata, type MetadataProps, PolygonSelector, type PolygonSelectorProps, type ProbeStore, RangeContext, ReactEmitterContext, ReactEventContext, ReactVaultContext, type Rect, RegionHighlight, Render3DModelStrategy, RenderAccompanyingCanvas, RenderAnnotationEditing, RenderAnnotationStrategy, RenderAudioStrategy, RenderComplexTimelineStrategy, RenderContextProps, RenderEmptyStrategy, RenderImageStrategy, RenderSvgEditorControls, RenderTextualContentStrategy, RenderVideoStrategy, RenderYouTubeStrategy, RenderingStrategy, ResizeWorldItem, type ResourceContextType, ResourceProvider, ResourceReactContext, type ResourceRequestOptions, SVGTheme, SelectorControllerProvider, type SelectorHelperEventTypes, SequenceThumbnails, SimpleViewerContext, SimpleViewerProps, SimpleViewerProvider, SimpleViewerReactContext, SingleCanvasThumbnail, SingleImageStrategy, StrategyActions, type StrategyContext, StrategyReactContext, type SvgTheme, ThumbnailFallbackImage, TimelineKeyframe, type Transition, TranslationProvider, TransliterationProvider, UnknownStrategy, type UseViewportScrollOptions, type UseViewportTourOptions, type VaultActivatedAnnotation, VaultProvider, ViewerPresetContext, VirtualAnnotationProvider, VisibleCanvasReactContext, annotationResponseToSelector, authDetailsForResource, buildTransitions, createAuthStateStore, createProbe, cubicBezierEasing, defaultEmitter, findAllCanvasesInRange, findFirstCanvasFromRange, findManifestSelectedRange, findSelectedRange, flattenAnnotationPageIds, formatTime, getComplexTimelineStrategy, getDefaultAnnotationStyles, getManifestSequence, getStepFromProgress, getVideoStrategy, getVisibleCanvasesFromCanvasId, hasAuth, interpolateRect, isBoxSelector, isRectangle, isSvgSelector, makeAccessServiceRequest, makeAccessTokenRequest, seraliseSupportedSelector, svgThemes, targetIntersects, useAnnotation, useAnnotationPage, useAnnotationPageManager, useAnnotationStyles, useAnnotationsAtTime, useAuthActions, useAuthService, useAuthStore, useAuthToken, useAuthTokens, useCanvas, useCanvasChoices, useCanvasClock, useCanvasSequence, useCanvasStartTime, useCanvasSubset, useClosestLanguage, useCollection, useComplexTimeline, useContextBridge, useCreateLocaleString, useCurrentAnnotationActions, useCurrentAnnotationMetadata, useCurrentAnnotationRequest, useCurrentAnnotationTransition, useCurrentAuth, useCustomContextBridge, useDispatch, useEmitter, useEvent, useEventEmitter, useEventListener, useExistingVault, useExternalCollection, useExternalManifest, useExternalResource, useIIIFLanguage, useImage, useImageService, useImageServiceLoader, useImageTile, useIsAuthEnabled, useLocaleString, useManifest, useMediaActions, useMediaElements, useMediaState, usePaintables, usePaintingAnnotations, usePolygonHelper, useRange, useRemoteStylesheet, useRenderControls, useRequestAnnotation, useResourceContext, useResourceEvents, useResources, useSearchService, useSelectorController, useSelectorEmitter, useSelectorEvents, useSelectorHelper, useSimpleMediaPlayer, useSimpleViewer, useStaticRenderingStrategy, useStrategy, useStyleHelper, useStyles, useStylesheetStore, useSvgEditor, useSvgEditorControls, useThumbnail, useTranslations, useTransliteration, useVault, useVaultEffect, useVaultSelector, useViewerPreset, useViewportScroll, useViewportTour, useVirtualAnnotationPage, useVirtualAnnotationPageContext, useVisibleCanvases };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as ko,$a as Ir,A as lo,Aa as er,Ab as _r,B as co,Ba as tr,Bb as Qr,C as mo,Ca as or,Cb as Ur,D as uo,Da as rr,Db as Xr,E as fo,Ea as de,Eb as Yr,F as po,Fa as nr,Fb as Gr,G as go,Ga as ir,Gb as Jr,H as ho,Ha as ar,Hb as Zr,I as yo,Ia as sr,Ib as jr,J as vo,Ja as lr,Jb as sn,K as xo,Ka as cr,Kb as Se,L as So,La as mr,Lb as ln,M as bo,Ma as ur,Mb as be,N as Io,Na as fr,Nb as A,O as Co,Oa as dr,Ob as cn,P as Ro,Pa as pr,Pb as gn,Q as Po,Qa as gr,Qb as hn,R as wo,Ra as hr,Rb as yn,S as qo,Sa as pe,Sb as Ce,T as To,Ta as ge,Tb as Re,U as se,Ua as yr,Ub as Pe,V as No,Va as vr,W as Eo,Wa as xr,X as Ao,Xa as Sr,Y as W,Ya as he,Z as le,Za as ye,_ as ce,_a as br,a as _t,aa as Mo,ab as Cr,b as B,ba as Ho,bb as Rr,c as E,ca as me,cb as Pr,d as re,da as ue,db as wr,e as Qt,ea as zo,eb as qr,f as Ut,fa as Lo,fb as Tr,g as R,ga as P,gb as Nr,h as O,ha as Bo,hb as Er,i as Xt,ia as Oo,ib as N,j as ne,ja as Fo,jb as ve,k as Yt,ka as fe,kb as Ar,l as F,la as Wo,lb as kr,m as ie,ma as Do,mb as G,n as Gt,na as Vo,nb as Mr,o as Jt,oa as $o,ob as Hr,p as Zt,pa as w,pb as zr,q as jt,qa as Ko,qb as Lr,r as eo,ra as _o,rb as Br,s as to,sa as Qo,sb as Or,t as oo,ta as Uo,tb as Fr,u as ro,ua as Xo,ub as Wr,v as no,va as Yo,vb as Dr,w as ae,wa as Go,wb as Vr,x as io,xa as Jo,xb as xe,y as ao,ya as Zo,yb as $r,z as so,za as jo,zb as Kr}from"./chunk-MUASBCAU.js";import"./chunk-UNH7HXGJ.js";import{a as en,b as tn,c as on,d as rn,e as nn,f as an,g as mn,h as un,i as fn,j as dn,k as pn,l as Ie}from"./chunk-FBET7GLW.js";export*from"@iiif/helpers/annotation-targets";import{useEffect as Xe}from"react";import{useCallback as we,useEffect as Qe,useRef as Ue,useState as D}from"react";import{useStore as k}from"zustand";function qe(e){let[t,o]=D(0),r=P(),n=k(r,d=>d.tool.enabled),i=k(r,d=>d.tool.requestId),a=k(r,d=>d.getRequestId),s=k(r,d=>d.requestAnnotation),f=k(r,d=>d.completeRequest),m=k(r,d=>d.cancelRequest),l=Ue(e?.onSuccess);l.current=e?.onSuccess;let[h,S]=D(!1),[b,x]=D(null),[p,v]=D(null),u=n&&i!==p,g=n&&i===p,c=we(async(d,q)=>{if(p){let M=l.current;S(!0);let L=await s(d,{...q,requestId:p});if(L)return M?.(L),o(Y=>Y+1),S(!1),x(L),L;let X={id:p,cancelled:!0,...ue(d)};return M?.(X),x(X),o(Y=>Y+1),S(!1),X}return null},[s,p]),y=we(()=>{x(null),S(!1)},[]);return Qe(()=>{let d=a();return v(d.requestId),()=>{d.clear()}},[t]),{id:t,busy:u,isPending:h,isActive:g,requestId:p,requestAnnotation:c,cancelRequest:()=>p?m(p):void 0,completeRequest:()=>p?f(p):void 0,reset:y,data:b}}var Pn=[{name:"Default",outer:{borderWidth:4,borderColor:"rgba(255, 255, 255, .4)"},inner:{borderWidth:2,borderColor:"#000"}},{name:"High contrast",outer:{borderWidth:3,borderColor:"#fff"},inner:{borderWidth:1,borderColor:"#000"}},{name:"Lightsaber",outer:{borderWidth:"4",borderColor:"rgba(56,68,255,0.64)"},inner:{borderWidth:"2",borderColor:"#fff"}},{name:"Bright",outer:{borderWidth:"6",borderColor:"#25d527"},inner:{borderWidth:"3",borderColor:"#a916ff"}},{name:"pink",outer:{borderWidth:"4",borderColor:"#ff00ff"},inner:{borderWidth:"2",borderColor:"#ffffff"}},{name:"fine (dark)",outer:{borderWidth:"1",borderColor:"#000000"},inner:{}},{name:"fine (light)",outer:{borderWidth:"1",borderColor:"#FFF"},inner:{}}];function Te(e){let{id:t,data:o,requestAnnotation:r,cancelRequest:n,isPending:i}=qe({onSuccess:a=>{e.updateShape(a.polygon)}});return Xe(()=>(r({type:"polygon",open:e.shape?.open,points:e.shape?.points}),()=>{n()}),[]),null}import{createContext as Ye,useCallback as Ne,useContext as Ae,useEffect as Ee,useMemo as J,useState as Ge}from"react";import ke from"mitt";import{jsx as Je}from"react/jsx-runtime";var V=Ye(ke());V.displayName="SelectorHelper";function kn({children:e}){return Je(V.Provider,{value:J(()=>ke(),[]),children:e})}function Mn(){return Ae(V)}function Me(e){let t=He(),[o,r]=Ge(!1);Ee(()=>t.withSelector(e).on("highlight",()=>{r(!0)}),[t,e]),Ee(()=>t.withSelector(e).on("clear-highlight",()=>{r(!1)}),[t,e]);let n=Ne(a=>{t.emit("click",{selectorId:e,event:a})},[e,t]),i=Ne(a=>{t.emit("hover",{selectorId:e,event:a})},[e,t]);return{controller:t,onClick:n,onHover:i,isHighlighted:o}}function He(){let e=Ae(V);return J(()=>({withSelector(t){return{on(o,r){let n=i=>{i&&i.selectorId===t&&r(i)};return e.on(o,n),()=>{e.off(o,n)}},emit(o,r){e.emit(o,{...r,selectorId:t})}}},on(t,o){return e.on(t,o),()=>{e.off(t,o)}},emit(t,o){e.emit(t,o)}}),[e])}function Hn(){let e=He();return J(()=>({withSelector(t){return{highlight(){e.emit("highlight",{selectorId:t})},clearHighlight(){e.emit("clear-highlight",{selectorId:t})},zoomTo(){e.emit("zoom-to",{selectorId:t})},addEventListener(o,r){return e.emit("event-listener",{selectorId:t,name:o,callback:r}),()=>{e.emit("remove-event-listener",{selectorId:t,name:o,callback:r})}},getImagePreview(){return new Promise((o,r)=>{e.emit("image-preview-request",{selectorId:t,resolve:o,reject:r})})},on(o,r){return e.withSelector(t).on(o,r)}}},highlight(t){e.emit("highlight",{selectorId:t})},clearHighlight(t){e.emit("clear-highlight",{selectorId:t})},zoomTo(t){e.emit("zoom-to",{selectorId:t})},addEventListener(t,o,r){return e.emit("event-listener",{selectorId:t,name:o,callback:r}),()=>{e.emit("remove-event-listener",{selectorId:t,name:o,callback:r})}},getImagePreview(t){return new Promise((o,r)=>{e.emit("image-preview-request",{selectorId:t,resolve:o,reject:r})})},on(t,o){return e.on(t,o)}}),[e])}import{jsx as ze}from"react/jsx-runtime";function $n(e){let t=w(),o=e.annotationBucket,r=e.readOnly,n=e.id,{onClick:i,isHighlighted:a}=Me(e.id),s=fe(),f=a?s.highlighted:s[o||"hidden"]||s.hidden;if(!t)return null;if(r){let m="shape",l=e.polygon,h=l.open;return l?ze(m,{id:`shape-${n}`,points:l.points,open:h,onClick:i,relativeStyle:!0,target:{x:0,y:0,width:t.width,height:t.height},style:f}):null}return ze(Te,{image:t,shape:e.polygon||{id:e.id,open:!0,points:[]},updateShape:e.updatePolygon,theme:e.theme,controlsHtmlId:e.controlsHtmlId,renderControls:e.renderControls})}import{useCanvas as Ze}from"@atlas-viewer/atlas";import{forwardRef as je,useImperativeHandle as et}from"react";import{Fragment as tt,jsx as Le}from"react/jsx-runtime";var Jn=je(function({canvasId:t},o){let r=Ze(),n=Se(t||r?.id),i=R();return et(o,()=>n,[t,r]),!r||n.enabledPageIds.length===0?null:Le(tt,{children:n.enabledPageIds.map(a=>Le(Pe.RenderAnnotationPage,{page:i.get(a)},a))})});import{useMemo as nt}from"react";import{useMemo as ot}from"react";import{Fragment as rt,jsx as I,jsxs as $}from"react/jsx-runtime";function K({metadata:e=[],config:t,labelWidth:o=16,showEmptyMessage:r=!0,allowHtml:n,emptyFallback:i,classes:a={},emptyMessage:s="No metadata available",emptyValueFallback:f="No value",emptyLabelFallback:m="",separator:l,tableFooter:h,tableHeader:S,customLabelRender:b,customValueRender:x}){let p=ot(()=>{let u=(t||[]).reduce((c,y)=>[...c,...y.keys],[]),g={};for(let c of e){let y=c?.label?Object.values(c.label):[];for(let d of y)if(d?.length&&(u.indexOf(`metadata.${d[0]}`)!==-1||u.length===0)&&c){let q=`metadata.${d[0]}`;g[q]=g[q]?g[q]:[],g[q].push(c);break}}return g},[t,e]);return Object.keys(p).length===0&&r?I(rt,{children:i})||I("div",{className:a.empty,children:s}):t?.length?$("table",{className:a.container,children:[S,I("tbody",{children:t.map((u,g)=>{let c=[];for(let d of u.keys)for(let q of p[d]||[]){let M=I(N,{enableDangerouslySetInnerHTML:n,defaultText:f,separator:l,children:q.value},g+"__"+d);x?c.push(x(q,M)):c.push(M)}if(c.length===0)return null;let y=I(N,{enableDangerouslySetInnerHTML:n,separator:l,defaultText:m,children:u.label});return $("tr",{className:a.row,children:[I("td",{className:a.label,style:o?{minWidth:o}:{},children:b?b(u.label,y):y}),I("td",{className:a.value,children:c})]},g)})}),h]}):$("table",{className:a.container,children:[S,I("tbody",{children:e?.length?e.map((u,g)=>{if(!u)return null;let c=I(N,{enableDangerouslySetInnerHTML:n,defaultText:f,separator:l,children:u.label}),y=I(N,{enableDangerouslySetInnerHTML:n,defaultText:f,separator:l,children:u.value});return $("tr",{className:a.row,children:[I("td",{className:a.label,style:o?{minWidth:o}:{},children:b?b(u.label,c):c}),I("td",{className:a.value,children:x?x(u,y):y})]},g)}):null}),h]})}import{jsx as it}from"react/jsx-runtime";function mi(e){let t=F(),o=w(),r=ae(),n=nt(()=>{let i=t?.metadata||[],a=o?.metadata||[],s=r?.metadata||[];return[...i,...a,...s]},[t,o,r]);return it(K,{metadata:n,...e})}import{useEffect as ct,useState as mt}from"react";import{createImageServiceRequest as at,imageServiceRequestToString as st}from"@iiif/parser/image-3";import{useMemo as lt}from"react";function Z(e,t={},o=[]){return lt(()=>{if(!e)return null;let r=t.quality;e&&e.extraQualities&&t.quality&&(e.extraQualities.includes(t.quality)||(r="default"));let n=at(e);return st({identifier:n.identifier,server:n.server,scheme:n.scheme,type:"image",size:{max:!t.size?.width&&!t.size?.height,confined:!1,upscaled:!1,...t.size||{}},format:t.format||"jpg",region:t.region||{full:!0},rotation:t?.rotation?Number.isInteger(t.rotation)?{angle:t.rotation}:t.rotation:{angle:0},quality:r||"default",prefix:n.prefix,originalPath:n.originalPath})},[...o])}import{jsx as _}from"react/jsx-runtime";function ut(e){let t=typeof e.src=="string"?e.src:e.src.id,o=pe(),[r,n]=mt(!1),i;if(t){let s=o.loadServiceSync({id:t});s&&(i=s)}!i&&!r&&o.loadService({id:t}).then(()=>{n(!0)});let a=Z(i,{size:e.size,selector:e.region,rotation:e.rotation,format:e.format,region:e.region,quality:e.quality},[r,e.src,e.size,e.region,e.rotation,e.format,e.region,e.quality]);return ct(()=>()=>{n(!1)},[t]),a?_("img",{src:a,alt:e.alt,className:e.className,style:e.style}):_(ft,{...e,fetchImageService:!1})}function ft(e){if(e.fetchImageService)return _(ut,{...e});let t=typeof e.src=="string"?{id:e.src,profile:"level0"}:e.src,o=Z(t,{size:e.size,selector:e.region,rotation:e.rotation,format:e.format,region:e.region,quality:e.quality},[e.src,e.size,e.region,e.rotation,e.format,e.region,e.quality]);return o?_("img",{src:o,alt:e.alt,className:e.className,style:e.style}):null}import{useMemo as dt,useState as pt}from"react";import{ErrorBoundary as gt}from"react-error-boundary";import{jsx as H,jsxs as yt}from"react/jsx-runtime";function Ai({src:e,errorFallback:t,interactive:o,skipSizes:r,children:n,renderViewerControls:i,viewControlsDeps:a,fluid:s,x:f,y:m,...l}){let[h,S]=pt(),b=t||Ce,[x,p]=be(),v=dt(()=>{let g=p[e]?.status,c=x({id:e},{});return c?.height&&c.width&&g!=="loading"?{id:e,width:c.width,height:c.height,service:c,type:"Image",selector:{type:"BoxSelector",spatial:{x:0,y:0,width:c.width,height:c.height}},target:{type:"BoxSelector",spatial:{x:0,y:0,width:c.width,height:c.height}}}:null},[x,e,p]);if(!v||!v.height||!v.width)return null;let u=s?void 0:l.homePosition?l.homePosition.width/l.homePosition.height:v.width/v.height;return H(gt,{resetKeys:[],fallbackRender:g=>H(b,{...l,...g}),children:H(Re,{...l,aspectRatio:u,containerProps:{style:{position:"relative"},...l.containerProps||{}},onCreated:g=>{S(g),l.onCreated&&l.onCreated(g)},children:yt(G.Provider,{value:h,children:[H(ve,{image:v,id:v.id,isStatic:!o,x:f,y:m},v.id),H(ht,{viewerPreset:h,renderViewerControls:i,image:v,src:e,viewControlsDeps:a}),n]})})})}function ht({viewerPreset:e,renderViewerControls:t,image:o,src:r,viewControlsDeps:n}){return de(e&&t?"overlay":"none",`canvas-portal-controls-${r}`,G.Provider,t&&o?{value:e||null,children:t({image:o,images:[o],type:"images"})}:{},[r,e,...n||[]]),null}import{jsx as vt}from"react/jsx-runtime";function Bi(e){let t=F();return vt(K,{metadata:t?.metadata||[],...e})}import{useLayoutEffect as Ct,useRef as Rt}from"react";import*as j from"react-lazy-load-image-component";import{getValue as xt}from"@iiif/helpers/i18n";import{Fragment as Be,jsx as T,jsxs as It}from"react/jsx-runtime";var{LazyLoadComponent:St}=j||j.default;function Oe(e){let{size:t,visible:o,classes:r,canvasId:n,figure:i}=e,a=t?.width||128,s=t?.height||t?.width||128,f=T(bt,{...e}),m=T(St,{threshold:300,style:{height:s,width:a},visibleByDefault:o,children:n?T(re,{canvas:n,children:f}):f});return i?T("figure",{className:r?.figure,children:m}):m}function bt({fallback:e,size:t,classes:o,showLabel:r,alt:n,dereference:i=!1}){let a=w(),s=t?.width||128,f=t?.height||t?.width||128,m=n||xt(a?.label)||"",l=ge({width:s,height:f,allowUnsafe:!0},i);return!l||l.type!=="fixed"?T(Be,{children:e}):It(Be,{children:[T("div",{className:o?.imageWrapper,children:T("img",{className:o?.img,src:l.id,alt:m})}),r?T(N,{as:"figcaption",className:o?.label,children:a?.label}):null]})}import{jsx as z}from"react/jsx-runtime";function Gi({scrollBehaviour:e,dereference:t,flat:o,size:r,classes:n={},showLabel:i,figure:a,fallback:s}){let f=Rt(null),{items:m,sequence:l,currentSequenceIndex:h,setSequenceIndex:S}=se(),b={row:n.selected?.row||n.row,item:n.selected?.item||n.item,figure:n.selected?.figure||n.figure,img:n.selected?.img||n.img,label:n.selected?.label||n.label,imageWrapper:n.selected?.imageWrapper||n.imageWrapper};Ct(()=>{if(!f.current)return;let p=f.current.querySelector("[data-selected=true]");p&&p.scrollIntoView({behavior:e||"instant",block:"nearest",inline:"center"})},[h]);let x=[];for(let p of l){let v=[],u=l[h]===p;for(let g of p){let c=m[g];v.push(z("div",{className:u?b.item:n.item,children:z(Oe,{classes:u?b:n,canvasId:c.id,size:r,dereference:t,showLabel:i,figure:a,placeholder:z("div",{style:{height:128,width:128}}),fallback:s})},g))}if(o){x.push(v);continue}x.push(z("div",{onClick:g=>{S(l.indexOf(p))},"data-selected":u,className:u?b.row:n.row,children:v},p.join("-")))}return z("div",{ref:f,className:n.container,children:x})}import{useStore as Q}from"zustand";function Fe(){let e=P(),t=Q(e,i=>i.completeRequest),o=Q(e,i=>i.polygonState.currentTool),r=Q(e,i=>i.polygonState.selectedStamp),n=Q(e,i=>i.switchTool);return{completeRequest:t,currentTool:o,selectedStamp:r,switchTool:n}}import{Fragment as We,jsx as C,jsxs as De}from"react/jsx-runtime";var Pt={draw:!0,polygon:!0,line:!0,lineBox:!0,box:!0,triangle:!0,hexagon:!0,circle:!0,delete:!0,pen:!0};function ra({showShapes:e=!0,enabled:t=Pt,classNames:o={},icons:r={}}){let{currentTool:n,switchTool:i,selectedStamp:a}=Fe();return De(We,{children:[n,C("button",{className:o.button,onClick:i.pointer,"data-active":n==="pointer",children:r.PointerIcon||"Pointer"}),C("button",{className:o.button,onClick:i.hand,"data-active":n==="hand",children:r.HandIcon||"Hand"}),e?De(We,{children:[t.box&&C("button",{className:o.button,onClick:i.box,"data-active":n==="box",children:r.BoxIcon||"Box"}),t.pen&&C("button",{className:o.button,onClick:i.pen,"data-active":n==="pen",children:r.PenIcon||"Pen"}),t.draw&&C("button",{className:o.button,onClick:i.draw,"data-active":n==="pencil",children:r.DrawIcon||"Draw"}),t.line&&C("button",{className:o.button,onClick:i.line,"data-active":n==="line",children:r.LineIcon||"Line"}),t.lineBox&&C("button",{className:o.button,onClick:i.lineBox,"data-active":n==="lineBox",children:r.LineBoxIcon||"LineBox"}),t.triangle&&C("button",{className:o.button,onClick:i.triangle,"data-active":n==="stamp"&&a?.id==="triangle",children:r.TriangleIcon||"Triangle"}),t.hexagon&&C("button",{className:o.button,onClick:i.hexagon,"data-active":n==="stamp"&&a?.id==="hexagon",children:r.HexagonIcon||"Hexagon"}),t.circle&&C("button",{className:o.button,"data-active":n==="stamp"&&a?.id==="circle",onClick:i.circle,children:r.CircleIcon||"Circle"})]}):null,t.delete&&C("button",{className:o.button,onClick:i.remove,children:r.DeleteForeverIcon||"Delete"})]})}import{jsx as wt}from"react/jsx-runtime";function sa({annotation:e,children:t}){return wt(E,{value:{annotation:e},children:t})}import{jsx as qt}from"react/jsx-runtime";function ua({annotationPage:e,children:t}){return qt(E,{value:{annotationPage:e},children:t})}import{jsx as Tt}from"react/jsx-runtime";function ga({collection:e,children:t}){return Tt(E,{value:{collection:e},children:t})}function xa(e,t={}){return A(t)}import{useCanvas as Nt}from"@atlas-viewer/atlas";import{useEffect as Et,useMemo as ee,useState as At}from"react";function Pa({canvasId:e}={}){let t=Nt(),o=ne(),r=ee(()=>e?[e]:t?[t.id]:o.map(m=>m.id),[e,t,o]),[n,i]=At({}),a=xe();Et(()=>{let m=l=>{let h=l.partOf.canvasId;h&&i(S=>({...S,[h]:l.choice}))};return a.on("choice-change",m),()=>{a.off("choice-change",m)}},[]);let s=ee(()=>{let m=[];for(let l of r){let h=n[l];h&&m.push({canvasId:l,choice:h})}return m},[r,n]),f=ee(()=>({makeChoice:(m,l)=>{a.emit("make-choice",{choiceId:m,...l})}}),[a]);return{choices:s,actions:f}}function qa(e,t=!1){}function Aa(e){let o=B().manifest,r=e?e.map(n=>typeof n=="string"?n:n?.id):[];return O(n=>{let i=o?n.iiif.entities.Manifest[o]:void 0,a=i?.items||[];if(typeof e>"u")return a;let s=[];for(let f of i?.items||[])r.indexOf(f.id)!==-1&&s.push(f);return s},[r.join("/")])}import{useMemo as kt}from"react";function La(e,t=[]){let{id:o,selector:r}=e,n=B(),i=o||n.collection,a=O(s=>i?s.iiif.entities.Collection[i]:void 0,[i]);return kt(()=>{if(a)return r?r(a):a},[a,r,...t])}import{startTransition as Mt,useMemo as Ht}from"react";import{useStore as Ve}from"zustand";function Da(){let e=P(),t=Ve(e,r=>r.completeRequest),o=Ve(e,r=>r.cancelRequest);return Ht(()=>({saveAnnotation:()=>{Mt(()=>{t()})},cancelRequest:o}),[t,o])}import{useCallback as zt}from"react";import{useStore as te}from"zustand";function Qa({requestId:e}={}){let t=P(),o=te(t,s=>s.metadata),r=te(t,s=>s.tool.requestId),n=e||r,i=te(t,s=>s.setMetadata),a=zt(s=>i(s,n||void 0),[i,n]);return[n?o[n]||{}:{},a]}import{useStore as Lt}from"zustand";function Ja(e){let t=P(),o=Lt(t,r=>r.tool.requestId);W("polygons.start-transition",r=>{e.requestId&&o!==e.requestId||e?.onStart?.(r.transitionIntent)},[o,e.requestId]),W("polygons.end-transition",r=>{e.requestId&&o!==e.requestId||e?.onEnd?.(r.transitionIntent,r.response)},[o,e.requestId]),W("polygons.transition",r=>{e.requestId&&o!==e.requestId||e?.onTransition?.(r.transitionIntent)},[o,e.requestId])}import{useEffect as Bt,useMemo as Ot}from"react";import{createEventsHelper as Ft}from"@iiif/helpers/events";function os(e,t,o,r,n=[]){let i=R(),a=Ot(()=>Ft(i),[i]);Bt(()=>{let s=e;return s?(a.addEventListener(s,t,o,r),()=>{a.removeEventListener(s,t,o)}):()=>{}},[a,e,t,...n])}function as(e,t){let{id:o,isLoaded:r,error:n,resource:i,requestId:a,cached:s}=ie(e,t);return{id:o,isLoaded:r,error:n,manifest:i,requestId:a,cached:s}}import{getImageServices as $e}from"@iiif/parser/image-3";import{useEffect as Wt,useMemo as Ke,useState as U}from"react";function _e({cacheKey:e}={}){let t=w(),o=A(),r=R(),n=he(),i=ye(),[a,s]=U(void 0),[f,m]=U(!1),[l,h]=U("idle"),[S,b]=U(void 0),x=t?t.id:"undefined",p=Ke(()=>{try{if(t&&o.length){let u=o[0],g=r.get(u.body[0]),y=$e(g)[0];return y&&n(y,{width:y.width||t.width,height:y.height||t.height},!0)||void 0}}catch(u){console.error(u)}},[x,e,t]),v=l==="success"&&a?a:p;return Wt(()=>{(async()=>{try{if(t&&o.length){let u=o[0],g=r.get(u.body[0]),y=$e(g)[0];if(!y)return;m(!0),h("loading");try{let d=await i(y,{width:y.width||t.width,height:y.height||t.height})||void 0;s(d),h("success"),m(!1)}catch(d){h("error"),b(d)}}}catch(u){h("error"),b(u)}})()},[x,e]),Ke(()=>({data:v,isFetching:f,status:l,error:S}),[v,f,l,S])}function hs(){let e=_e();return{isLoading:e.isFetching,tile:e.data?{id:e.data.id||e.data["@id"],width:e.data.width,height:e.data.height,imageService:e.data,thumbnail:void 0}:null}}import{useMemo as oe}from"react";import{createPaintingAnnotationsHelper as Dt}from"@iiif/helpers";function Rs({supports:e=["empty","images","media","3d-model","textual-content","complex-timeline"]}={}){let t=R(),o=w(),r=A(),n=oe(()=>Dt(t),[t]),i=oe(()=>n.getPaintables(r),[n,r]);return oe(()=>Ie({canvas:o,loadImageService:a=>a,paintables:i,supports:e}),[o,i,e])}import{createStylesHelper as Vt}from"@iiif/helpers/styles";import{useMemo as $t}from"react";function Ns(){let e=R();return $t(()=>Vt(e),[e])}function As(e,t){let{x:o,y:r,width:n,height:i}=e,{x:a,y:s}=t,{width:f,height:m}=t;return o+n>a&&o<a+f&&r+i>s&&r<s+m}import Kt from"tiny-invariant";function Bs(e,t){let o=e.boundingBox||ce(e.polygon);if(e.polygon&&!le(e.polygon.points)){let r=e.target||me(e.polygon,t);return Kt(r?.type==="SvgSelector"),{type:"SvgSelector",points:e.polygon.points,spatial:{unit:"pixel",...o||{}},svgShape:e.polygon.open?"polyline":"polygon",svg:r.value}}return{type:"BoxSelector",spatial:o}}export{sa as AnnotationContext,ua as AnnotationPageContext,Wo as AnnotationStyleProvider,Oo as AtlasStoreProvider,Lo as AtlasStoreReactContext,Ro as Auth,ho as AuthProvider,fo as AuthRContext,po as AuthReactContext,go as AuthReactContextActions,Jn as CanvasAnnotations,re as CanvasContext,Pe as CanvasPanel,hn as CanvasStrategyProvider,yn as CanvasWorldObject,ga as CollectionContext,mi as CombinedMetadata,xr as ComplexTimelineProvider,Xr as ContextBridge,sr as ControlsReactContext,Te as CreateCustomShape,_r as CustomContextBridge,Qr as CustomContextBridgeProvider,jr as DefaultEditingTools,Eo as EventEmitterProvider,$r as EventsProvider,ft as Image,Ai as ImageService,hr as ImageServiceLoaderContext,qo as InnerViewerProvider,Ir as LanguageProvider,qr as LanguageString,N as LocaleString,Jt as ManifestContext,Bi as ManifestMetadata,er as MediaPlayerProvider,K as Metadata,$n as PolygonSelector,Zt as RangeContext,No as ReactEmitterContext,Vr as ReactEventContext,Qt as ReactVaultContext,Uo as RegionHighlight,ar as Render3DModelStrategy,cr as RenderAccompanyingCanvas,Xo as RenderAnnotation,Zr as RenderAnnotationEditing,Go as RenderAnnotationPage,pr as RenderAnnotationStrategy,vr as RenderAudioStrategy,Ar as RenderComplexTimelineStrategy,kr as RenderEmptyStrategy,Hr as RenderImageStrategy,ra as RenderSvgEditorControls,zr as RenderTextualContentStrategy,Lr as RenderVideoStrategy,Br as RenderYouTubeStrategy,Qo as ResizeWorldItem,E as ResourceProvider,_t as ResourceReactContext,kn as SelectorControllerProvider,Gi as SequenceThumbnails,To as SimpleViewerProvider,wo as SimpleViewerReactContext,Oe as SingleCanvasThumbnail,nr as StrategyReactContext,yr as ThumbnailFallbackImage,br as TranslationProvider,Cr as TransliterationProvider,Ut as VaultProvider,G as ViewerPresetContext,dr as VirtualAnnotationProvider,Xt as VisibleCanvasReactContext,Bs as annotationResponseToSelector,co as authDetailsForResource,zo as createAtlasStore,so as createAuthStateStore,lo as createProbe,Dr as defaultEmitter,Fr as defaultSvgTheme,on as emptyActions,an as emptyStrategy,eo as findAllCanvasesInRange,jt as findFirstCanvasFromRange,to as findManifestSelectedRange,oo as findSelectedRange,sn as flattenAnnotationPageIds,or as formatTime,mn as get3dStrategy,Bo as getAtlasStoreByName,pn as getComplexTimelineStrategy,Fo as getDefaultAnnotationStyles,un as getImageStrategy,no as getManifestSequence,tn as getParsedTargetSelector,Ie as getRenderingStrategy,fn as getTextualContentStrategy,dn as getVideoStrategy,ro as getVisibleCanvasesFromCanvasId,ao as hasAuth,Mo as isBoxSelector,le as isRectangle,ko as isSvgSelector,uo as makeAccessServiceRequest,mo as makeAccessTokenRequest,en as parseSpecificResource,me as polygonToTarget,ue as requestToAnnotationResponse,Ho as seraliseSupportedSelector,Pn as svgThemes,As as targetIntersects,rn as unknownResponse,nn as unsupportedStrategy,$o as useAnnotation,Yo as useAnnotationPage,Se as useAnnotationPageManager,fe as useAnnotationStyles,xa as useAnnotationsAtTime,Gr as useAtlasContextMenu,P as useAtlasStore,xo as useAuthActions,bo as useAuthService,vo as useAuthStore,Co as useAuthToken,Io as useAuthTokens,w as useCanvas,Pa as useCanvasChoices,qa as useCanvasClock,io as useCanvasSequence,tr as useCanvasStartTime,Aa as useCanvasSubset,Tr as useClosestLanguage,La as useCollection,Sr as useComplexTimeline,Ur as useContextBridge,Yr as useContextMenuStore,Er as useCreateLocaleString,Da as useCurrentAnnotationActions,Qa as useCurrentAnnotationMetadata,Jr as useCurrentAnnotationRequest,Ja as useCurrentAnnotationTransition,So as useCurrentAuth,Kr as useCustomContextBridge,mr as useDispatch,Ao as useEmitter,W as useEvent,xe as useEventEmitter,os as useEventListener,Yt as useExistingVault,as as useExternalCollection,Gt as useExternalManifest,ie as useExternalResource,Pr as useIIIFLanguage,Z as useImage,_e as useImageService,pe as useImageServiceLoader,hs as useImageTile,yo as useIsAuthEnabled,be as useLoadImageService,Nr as useLocaleString,F as useManifest,Zo as useMediaActions,jo as useMediaElements,Jo as useMediaState,cn as usePaintables,A as usePaintingAnnotations,Or as usePolygonHelper,ae as useRange,Vo as useRemoteStylesheet,lr as useRenderControls,gn as useRenderingStrategy,qe as useRequestAnnotation,B as useResourceContext,Ko as useResourceEvents,ln as useResources,Po as useSearchService,He as useSelectorController,Mn as useSelectorEmitter,Me as useSelectorEvents,Hn as useSelectorHelper,rr as useSimpleMediaPlayer,se as useSimpleViewer,Rs as useStaticRenderingStrategy,ir as useStrategy,Ns as useStyleHelper,_o as useStyles,Do as useStylesheetStore,Wr as useSvgEditor,Fe as useSvgEditorControls,ge as useThumbnail,wr as useTranslations,Rr as useTransliteration,R as useVault,gr as useVaultEffect,O as useVaultSelector,Mr as useViewerPreset,ur as useVirtualAnnotationPage,fr as useVirtualAnnotationPageContext,ne as useVisibleCanvases};
|
|
1
|
+
import{$ as Jr,$a as Uo,A as Nr,Aa as Io,Ab as dn,B as Ar,Ba as Ro,Bb as gn,C as kr,Ca as Co,Cb as hn,D as Mr,Da as Po,Db as yn,E as Lr,Ea as Pe,Eb as vn,F as Hr,Fa as To,Fb as bn,G as zr,Ga as wo,Gb as xn,H as Br,Ha as Eo,Hb as Sn,I as Fr,Ia as qo,Ib as In,J as Or,Ja as No,Jb as qn,K as Vr,Ka as Ao,Kb as ke,L as Wr,La as ko,Lb as Nn,M as Dr,Ma as Mo,Mb as Me,N as _r,Na as Lo,Nb as B,O as Ur,Oa as Ho,Ob as An,P as $r,Pa as zo,Pb as Bn,Q as Xr,Qa as Bo,Qb as Fn,R as Kr,Ra as Fo,Rb as On,S as Gr,Sa as Te,Sb as He,T as Qr,Ta as we,Tb as ze,U as be,Ua as Oo,Ub as Be,V as Yr,Va as Vo,W as Zr,Wa as Wo,X as jr,Xa as Do,Y as G,Ya as Ee,Z as xe,Za as qe,_ as Se,_a as _o,a as gr,aa as eo,ab as $o,b as $,ba as to,bb as Xo,c as z,ca as Ie,cb as Ko,d as pe,da as Re,db as Go,e as hr,ea as ro,eb as Qo,f as de,fa as oo,fb as Yo,g as T,ga as w,gb as Zo,h as X,ha as no,hb as jo,i as yr,ia as io,ib as L,j as ge,ja as ao,jb as Ne,k as he,ka as Ce,kb as Jo,l as K,la as so,lb as en,m as ye,ma as co,mb as ae,n as vr,na as lo,nb as tn,o as br,oa as uo,ob as rn,p as xr,pa as E,pb as on,q as Sr,qa as mo,qb as nn,r as Ir,ra as fo,rb as an,s as Rr,sa as po,sb as sn,t as Cr,ta as go,tb as cn,u as Pr,ua as ho,ub as ln,v as Tr,va as yo,vb as un,w as ve,wa as vo,wb as mn,x as wr,xa as bo,xb as Ae,y as Er,ya as xo,yb as fn,z as qr,za as So,zb as pn}from"./chunk-ICQYS35G.js";import"./chunk-UNH7HXGJ.js";import{a as Rn,b as Cn,c as Pn,d as Tn,e as wn,f as En,g as kn,h as Mn,i as Ln,j as Hn,k as zn,l as Le}from"./chunk-FBET7GLW.js";export*from"@iiif/helpers/annotation-targets";import{useEffect as gt}from"react";import{useCallback as Fe,useEffect as pt,useRef as dt,useState as Q}from"react";import{useStore as F}from"zustand";function Oe(e){let[t,r]=Q(0),o=w(),n=F(o,h=>h.tool.enabled),i=F(o,h=>h.tool.requestId),a=F(o,h=>h.getRequestId),c=F(o,h=>h.requestAnnotation),g=F(o,h=>h.completeRequest),m=F(o,h=>h.cancelRequest),s=dt(e?.onSuccess);s.current=e?.onSuccess;let[b,x]=Q(!1),[S,l]=Q(null),[f,v]=Q(null),u=n&&i!==f,y=n&&i===f,p=Fe(async(h,C)=>{if(f){let M=s.current;x(!0);let q=await c(h,{...C,requestId:f});if(q)return M?.(q),r(A=>A+1),x(!1),l(q),q;let H={id:f,cancelled:!0,...Re(h)};return M?.(H),l(H),r(A=>A+1),x(!1),H}return null},[c,f]),d=Fe(()=>{l(null),x(!1)},[]);return pt(()=>{let h=a();return v(h.requestId),()=>{h.clear()}},[t]),{id:t,busy:u,isPending:b,isActive:y,requestId:f,requestAnnotation:p,cancelRequest:()=>f?m(f):void 0,completeRequest:()=>f?g(f):void 0,reset:d,data:S}}var Kn=[{name:"Default",outer:{borderWidth:4,borderColor:"rgba(255, 255, 255, .4)"},inner:{borderWidth:2,borderColor:"#000"}},{name:"High contrast",outer:{borderWidth:3,borderColor:"#fff"},inner:{borderWidth:1,borderColor:"#000"}},{name:"Lightsaber",outer:{borderWidth:"4",borderColor:"rgba(56,68,255,0.64)"},inner:{borderWidth:"2",borderColor:"#fff"}},{name:"Bright",outer:{borderWidth:"6",borderColor:"#25d527"},inner:{borderWidth:"3",borderColor:"#a916ff"}},{name:"pink",outer:{borderWidth:"4",borderColor:"#ff00ff"},inner:{borderWidth:"2",borderColor:"#ffffff"}},{name:"fine (dark)",outer:{borderWidth:"1",borderColor:"#000000"},inner:{}},{name:"fine (light)",outer:{borderWidth:"1",borderColor:"#FFF"},inner:{}}];function Ve(e){let{id:t,data:r,requestAnnotation:o,cancelRequest:n,isPending:i}=Oe({onSuccess:a=>{e.updateShape(a.polygon)}});return gt(()=>(o({type:"polygon",open:e.shape?.open,points:e.shape?.points}),()=>{n()}),[]),null}import{createContext as ht,useCallback as We,useContext as _e,useEffect as De,useMemo as se,useState as yt}from"react";import Ue from"mitt";import{jsx as vt}from"react/jsx-runtime";var Y=ht(Ue());Y.displayName="SelectorHelper";function ei({children:e}){return vt(Y.Provider,{value:se(()=>Ue(),[]),children:e})}function ti(){return _e(Y)}function $e(e){let t=Xe(),[r,o]=yt(!1);De(()=>t.withSelector(e).on("highlight",()=>{o(!0)}),[t,e]),De(()=>t.withSelector(e).on("clear-highlight",()=>{o(!1)}),[t,e]);let n=We(a=>{t.emit("click",{selectorId:e,event:a})},[e,t]),i=We(a=>{t.emit("hover",{selectorId:e,event:a})},[e,t]);return{controller:t,onClick:n,onHover:i,isHighlighted:r}}function Xe(){let e=_e(Y);return se(()=>({withSelector(t){return{on(r,o){let n=i=>{i&&i.selectorId===t&&o(i)};return e.on(r,n),()=>{e.off(r,n)}},emit(r,o){e.emit(r,{...o,selectorId:t})}}},on(t,r){return e.on(t,r),()=>{e.off(t,r)}},emit(t,r){e.emit(t,r)}}),[e])}function ri(){let e=Xe();return se(()=>({withSelector(t){return{highlight(){e.emit("highlight",{selectorId:t})},clearHighlight(){e.emit("clear-highlight",{selectorId:t})},zoomTo(){e.emit("zoom-to",{selectorId:t})},addEventListener(r,o){return e.emit("event-listener",{selectorId:t,name:r,callback:o}),()=>{e.emit("remove-event-listener",{selectorId:t,name:r,callback:o})}},getImagePreview(){return new Promise((r,o)=>{e.emit("image-preview-request",{selectorId:t,resolve:r,reject:o})})},on(r,o){return e.withSelector(t).on(r,o)}}},highlight(t){e.emit("highlight",{selectorId:t})},clearHighlight(t){e.emit("clear-highlight",{selectorId:t})},zoomTo(t){e.emit("zoom-to",{selectorId:t})},addEventListener(t,r,o){return e.emit("event-listener",{selectorId:t,name:r,callback:o}),()=>{e.emit("remove-event-listener",{selectorId:t,name:r,callback:o})}},getImagePreview(t){return new Promise((r,o)=>{e.emit("image-preview-request",{selectorId:t,resolve:r,reject:o})})},on(t,r){return e.on(t,r)}}),[e])}import{jsx as Ke}from"react/jsx-runtime";function mi(e){let t=E(),r=e.annotationBucket,o=e.readOnly,n=e.id,{onClick:i,isHighlighted:a}=$e(e.id),c=Ce(),g=a?c.highlighted:c[r||"hidden"]||c.hidden;if(!t)return null;if(o){let m="shape",s=e.polygon,b=s.open;return s?Ke(m,{id:`shape-${n}`,points:s.points,open:b,onClick:i,relativeStyle:!0,target:{x:0,y:0,width:t.width,height:t.height},style:g}):null}return Ke(Ve,{image:t,shape:e.polygon||{id:e.id,open:!0,points:[]},updateShape:e.updatePolygon,theme:e.theme,controlsHtmlId:e.controlsHtmlId,renderControls:e.renderControls})}import{useCanvas as bt}from"@atlas-viewer/atlas";import{forwardRef as xt,useImperativeHandle as St}from"react";import{Fragment as It,jsx as Ge}from"react/jsx-runtime";var bi=xt(function({canvasId:t},r){let o=bt(),n=ke(t||o?.id),i=T();return St(r,()=>n,[t,o]),!o||n.enabledPageIds.length===0?null:Ge(It,{children:n.enabledPageIds.map(a=>Ge(Be.RenderAnnotationPage,{page:i.get(a)},a))})});import{useMemo as Pt}from"react";import{useMemo as Rt}from"react";import{Fragment as Ct,jsx as R,jsxs as Z}from"react/jsx-runtime";function j({metadata:e=[],config:t,labelWidth:r=16,showEmptyMessage:o=!0,allowHtml:n,emptyFallback:i,classes:a={},emptyMessage:c="No metadata available",emptyValueFallback:g="No value",emptyLabelFallback:m="",separator:s,tableFooter:b,tableHeader:x,customLabelRender:S,customValueRender:l}){let f=Rt(()=>{let u=(t||[]).reduce((p,d)=>[...p,...d.keys],[]),y={};for(let p of e){let d=p?.label?Object.values(p.label):[];for(let h of d)if(h?.length&&(u.indexOf(`metadata.${h[0]}`)!==-1||u.length===0)&&p){let C=`metadata.${h[0]}`;y[C]=y[C]?y[C]:[],y[C].push(p);break}}return y},[t,e]);return Object.keys(f).length===0&&o?R(Ct,{children:i})||R("div",{className:a.empty,children:c}):t?.length?Z("table",{className:a.container,children:[x,R("tbody",{children:t.map((u,y)=>{let p=[];for(let h of u.keys)for(let C of f[h]||[]){let M=R(L,{enableDangerouslySetInnerHTML:n,defaultText:g,separator:s,children:C.value},y+"__"+h);l?p.push(l(C,M)):p.push(M)}if(p.length===0)return null;let d=R(L,{enableDangerouslySetInnerHTML:n,separator:s,defaultText:m,children:u.label});return Z("tr",{className:a.row,children:[R("td",{className:a.label,style:r?{minWidth:r}:{},children:S?S(u.label,d):d}),R("td",{className:a.value,children:p})]},y)})}),b]}):Z("table",{className:a.container,children:[x,R("tbody",{children:e?.length?e.map((u,y)=>{if(!u)return null;let p=R(L,{enableDangerouslySetInnerHTML:n,defaultText:g,separator:s,children:u.label}),d=R(L,{enableDangerouslySetInnerHTML:n,defaultText:g,separator:s,children:u.value});return Z("tr",{className:a.row,children:[R("td",{className:a.label,style:r?{minWidth:r}:{},children:S?S(u.label,p):p}),R("td",{className:a.value,children:l?l(u,d):d})]},y)}):null}),b]})}import{jsx as Tt}from"react/jsx-runtime";function ki(e){let t=K(),r=E(),o=ve(),n=Pt(()=>{let i=t?.metadata||[],a=r?.metadata||[],c=o?.metadata||[];return[...i,...a,...c]},[t,r,o]);return Tt(j,{metadata:n,...e})}import{useEffect as Nt,useState as At}from"react";import{createImageServiceRequest as wt,imageServiceRequestToString as Et}from"@iiif/parser/image-3";import{useMemo as qt}from"react";function ce(e,t={},r=[]){return qt(()=>{if(!e)return null;let o=t.quality;e&&e.extraQualities&&t.quality&&(e.extraQualities.includes(t.quality)||(o="default"));let n=wt(e);return Et({identifier:n.identifier,server:n.server,scheme:n.scheme,type:"image",size:{max:!t.size?.width&&!t.size?.height,confined:!1,upscaled:!1,...t.size||{}},format:t.format||"jpg",region:t.region||{full:!0},rotation:t?.rotation?Number.isInteger(t.rotation)?{angle:t.rotation}:t.rotation:{angle:0},quality:o||"default",prefix:n.prefix,originalPath:n.originalPath})},[...r])}import{jsx as J}from"react/jsx-runtime";function kt(e){let t=typeof e.src=="string"?e.src:e.src.id,r=Te(),[o,n]=At(!1),i;if(t){let c=r.loadServiceSync({id:t});c&&(i=c)}!i&&!o&&r.loadService({id:t}).then(()=>{n(!0)});let a=ce(i,{size:e.size,selector:e.region,rotation:e.rotation,format:e.format,region:e.region,quality:e.quality},[o,e.src,e.size,e.region,e.rotation,e.format,e.region,e.quality]);return Nt(()=>()=>{n(!1)},[t]),a?J("img",{src:a,alt:e.alt,className:e.className,style:e.style}):J(Mt,{...e,fetchImageService:!1})}function Mt(e){if(e.fetchImageService)return J(kt,{...e});let t=typeof e.src=="string"?{id:e.src,profile:"level0"}:e.src,r=ce(t,{size:e.size,selector:e.region,rotation:e.rotation,format:e.format,region:e.region,quality:e.quality},[e.src,e.size,e.region,e.rotation,e.format,e.region,e.quality]);return r?J("img",{src:r,alt:e.alt,className:e.className,style:e.style}):null}import{useMemo as Lt,useState as Ht}from"react";import{ErrorBoundary as zt}from"react-error-boundary";import{jsx as O,jsxs as Ft}from"react/jsx-runtime";function ta({src:e,errorFallback:t,interactive:r,skipSizes:o,children:n,renderViewerControls:i,viewControlsDeps:a,fluid:c,x:g,y:m,...s}){let b=he(),[x,S]=Ht(),l=t||He,[f,v]=Me(),u=Lt(()=>{let p=v[e]?.status,d=f({id:e},{});return d?.height&&d.width&&p!=="loading"?{id:e,width:d.width,height:d.height,service:d,type:"Image",selector:{type:"BoxSelector",spatial:{x:0,y:0,width:d.width,height:d.height}},target:{type:"BoxSelector",spatial:{x:0,y:0,width:d.width,height:d.height}}}:null},[f,e,v]);if(!u||!u.height||!u.width)return null;let y=c?void 0:s.homePosition?s.homePosition.width/s.homePosition.height:u.width/u.height;return O(zt,{resetKeys:[],fallbackRender:p=>O(l,{...s,...p}),children:O(de,{vault:b,children:O(ze,{...s,aspectRatio:y,containerProps:{style:{position:"relative"},...s.containerProps||{}},onCreated:p=>{S(p),s.onCreated&&s.onCreated(p)},children:Ft(ae.Provider,{value:x,children:[O(Ne,{image:u,id:u.id,isStatic:!r,x:g,y:m},u.id),O(Bt,{viewerPreset:x,renderViewerControls:i,image:u,src:e,viewControlsDeps:a}),n]})})})})}function Bt({viewerPreset:e,renderViewerControls:t,image:r,src:o,viewControlsDeps:n}){return Pe(e&&t?"overlay":"none",`canvas-portal-controls-${o}`,ae.Provider,t&&r?{value:e||null,children:t({image:r,images:[r],type:"images"})}:{},[o,e,...n||[]]),null}import{jsx as Ot}from"react/jsx-runtime";function sa(e){let t=K();return Ot(j,{metadata:t?.metadata||[],...e})}import{useLayoutEffect as Ut,useRef as $t}from"react";import*as le from"react-lazy-load-image-component";import{getValue as Vt}from"@iiif/helpers/i18n";import{Fragment as Qe,jsx as k,jsxs as _t}from"react/jsx-runtime";var{LazyLoadComponent:Wt}=le||le.default;function Ye(e){let{size:t,visible:r,classes:o,canvasId:n,figure:i}=e,a=t?.width||128,c=t?.height||t?.width||128,g=k(Dt,{...e}),m=k(Wt,{threshold:300,style:{height:c,width:a},visibleByDefault:r,children:n?k(pe,{canvas:n,children:g}):g});return i?k("figure",{className:o?.figure,children:m}):m}function Dt({fallback:e,size:t,classes:r,showLabel:o,alt:n,dereference:i=!1}){let a=E(),c=t?.width||128,g=t?.height||t?.width||128,m=n||Vt(a?.label)||"",s=we({width:c,height:g,allowUnsafe:!0},i);return!s||s.type!=="fixed"?k(Qe,{children:e}):_t(Qe,{children:[k("div",{className:r?.imageWrapper,children:k("img",{className:r?.img,src:s.id,alt:m})}),o?k(L,{as:"figcaption",className:r?.label,children:a?.label}):null]})}import{jsx as W}from"react/jsx-runtime";function xa({scrollBehaviour:e,dereference:t,flat:r,size:o,classes:n={},showLabel:i,figure:a,fallback:c}){let g=$t(null),{items:m,sequence:s,currentSequenceIndex:b,setSequenceIndex:x}=be(),S={row:n.selected?.row||n.row,item:n.selected?.item||n.item,figure:n.selected?.figure||n.figure,img:n.selected?.img||n.img,label:n.selected?.label||n.label,imageWrapper:n.selected?.imageWrapper||n.imageWrapper};Ut(()=>{if(!g.current)return;let f=g.current.querySelector("[data-selected=true]");f&&f.scrollIntoView({behavior:e||"instant",block:"nearest",inline:"center"})},[b]);let l=[];for(let f of s){let v=[],u=s[b]===f;for(let y of f){let p=m[y];v.push(W("div",{className:u?S.item:n.item,children:W(Ye,{classes:u?S:n,canvasId:p.id,size:o,dereference:t,showLabel:i,figure:a,placeholder:W("div",{style:{height:128,width:128}}),fallback:c})},y))}if(r){l.push(v);continue}l.push(W("div",{onClick:y=>{x(s.indexOf(f))},"data-selected":u,className:u?S.row:n.row,children:v},f.join("-")))}return W("div",{ref:g,className:n.container,children:l})}import{useStore as ee}from"zustand";function Ze(){let e=w(),t=ee(e,i=>i.completeRequest),r=ee(e,i=>i.polygonState.currentTool),o=ee(e,i=>i.polygonState.selectedStamp),n=ee(e,i=>i.switchTool);return{completeRequest:t,currentTool:r,selectedStamp:o,switchTool:n}}import{Fragment as je,jsx as P,jsxs as Je}from"react/jsx-runtime";var Xt={draw:!0,polygon:!0,line:!0,lineBox:!0,box:!0,triangle:!0,hexagon:!0,circle:!0,delete:!0,pen:!0};function wa({showShapes:e=!0,enabled:t=Xt,classNames:r={},icons:o={}}){let{currentTool:n,switchTool:i,selectedStamp:a}=Ze();return Je(je,{children:[n,P("button",{className:r.button,onClick:i.pointer,"data-active":n==="pointer",children:o.PointerIcon||"Pointer"}),P("button",{className:r.button,onClick:i.hand,"data-active":n==="hand",children:o.HandIcon||"Hand"}),e?Je(je,{children:[t.box&&P("button",{className:r.button,onClick:i.box,"data-active":n==="box",children:o.BoxIcon||"Box"}),t.pen&&P("button",{className:r.button,onClick:i.pen,"data-active":n==="pen",children:o.PenIcon||"Pen"}),t.draw&&P("button",{className:r.button,onClick:i.draw,"data-active":n==="pencil",children:o.DrawIcon||"Draw"}),t.line&&P("button",{className:r.button,onClick:i.line,"data-active":n==="line",children:o.LineIcon||"Line"}),t.lineBox&&P("button",{className:r.button,onClick:i.lineBox,"data-active":n==="lineBox",children:o.LineBoxIcon||"LineBox"}),t.triangle&&P("button",{className:r.button,onClick:i.triangle,"data-active":n==="stamp"&&a?.id==="triangle",children:o.TriangleIcon||"Triangle"}),t.hexagon&&P("button",{className:r.button,onClick:i.hexagon,"data-active":n==="stamp"&&a?.id==="hexagon",children:o.HexagonIcon||"Hexagon"}),t.circle&&P("button",{className:r.button,"data-active":n==="stamp"&&a?.id==="circle",onClick:i.circle,children:o.CircleIcon||"Circle"})]}):null,t.delete&&P("button",{className:r.button,onClick:i.remove,children:o.DeleteForeverIcon||"Delete"})]})}import{jsx as Kt}from"react/jsx-runtime";function Aa({annotation:e,children:t}){return Kt(z,{value:{annotation:e},children:t})}import{jsx as Gt}from"react/jsx-runtime";function Ha({annotationPage:e,children:t}){return Gt(z,{value:{annotationPage:e},children:t})}import{jsx as Qt}from"react/jsx-runtime";function Oa({collection:e,children:t}){return Qt(z,{value:{collection:e},children:t})}function _a(e,t={}){return B(t)}import{useCanvas as Yt}from"@atlas-viewer/atlas";import{useEffect as Zt,useMemo as ue,useState as jt}from"react";function Qa({canvasId:e}={}){let t=Yt(),r=ge(),o=ue(()=>e?[e]:t?[t.id]:r.map(m=>m.id),[e,t,r]),[n,i]=jt({}),a=Ae();Zt(()=>{let m=s=>{let b=s.partOf.canvasId;b&&i(x=>({...x,[b]:s.choice}))};return a.on("choice-change",m),()=>{a.off("choice-change",m)}},[]);let c=ue(()=>{let m=[];for(let s of o){let b=n[s];b&&m.push({canvasId:s,choice:b})}return m},[o,n]),g=ue(()=>({makeChoice:(m,s)=>{a.emit("make-choice",{choiceId:m,...s})}}),[a]);return{choices:c,actions:g}}function Za(e,t=!1){}function ts(e){let r=$().manifest,o=e?e.map(n=>typeof n=="string"?n:n?.id):[];return X(n=>{let i=r?n.iiif.entities.Manifest[r]:void 0,a=i?.items||[];if(typeof e>"u")return a;let c=[];for(let g of i?.items||[])o.indexOf(g.id)!==-1&&c.push(g);return c},[o.join("/")])}import{useMemo as Jt}from"react";function as(e,t=[]){let{id:r,selector:o}=e,n=$(),i=r||n.collection,a=X(c=>i?c.iiif.entities.Collection[i]:void 0,[i]);return Jt(()=>{if(a)return o?o(a):a},[a,o,...t])}import{startTransition as er,useMemo as tr}from"react";import{useStore as et}from"zustand";function ms(){let e=w(),t=et(e,o=>o.completeRequest),r=et(e,o=>o.cancelRequest);return tr(()=>({saveAnnotation:()=>{er(()=>{t()})},cancelRequest:r}),[t,r])}import{useCallback as rr}from"react";import{useStore as me}from"zustand";function hs({requestId:e}={}){let t=w(),r=me(t,c=>c.metadata),o=me(t,c=>c.tool.requestId),n=e||o,i=me(t,c=>c.setMetadata),a=rr(c=>i(c,n||void 0),[i,n]);return[n?r[n]||{}:{},a]}import{useStore as or}from"zustand";function Ss(e){let t=w(),r=or(t,o=>o.tool.requestId);G("polygons.start-transition",o=>{e.requestId&&r!==e.requestId||e?.onStart?.(o.transitionIntent)},[r,e.requestId]),G("polygons.end-transition",o=>{e.requestId&&r!==e.requestId||e?.onEnd?.(o.transitionIntent,o.response)},[r,e.requestId]),G("polygons.transition",o=>{e.requestId&&r!==e.requestId||e?.onTransition?.(o.transitionIntent)},[r,e.requestId])}import{useEffect as nr,useMemo as ir}from"react";import{createEventsHelper as ar}from"@iiif/helpers/events";function Ts(e,t,r,o,n=[]){let i=T(),a=ir(()=>ar(i),[i]);nr(()=>{let c=e;return c?(a.addEventListener(c,t,r,o),()=>{a.removeEventListener(c,t,r)}):()=>{}},[a,e,t,...n])}function Ns(e,t){let{id:r,isLoaded:o,error:n,resource:i,requestId:a,cached:c}=ye(e,t);return{id:r,isLoaded:o,error:n,manifest:i,requestId:a,cached:c}}import{getImageServices as tt}from"@iiif/parser/image-3";import{useEffect as sr,useMemo as rt,useState as te}from"react";function ot({cacheKey:e}={}){let t=E(),r=B(),o=T(),n=Ee(),i=qe(),[a,c]=te(void 0),[g,m]=te(!1),[s,b]=te("idle"),[x,S]=te(void 0),l=t?t.id:"undefined",f=rt(()=>{try{if(t&&r.length){let u=r[0],y=o.get(u.body[0]),d=tt(y)[0];return d&&n(d,{width:d.width||t.width,height:d.height||t.height},!0)||void 0}}catch(u){console.error(u)}},[l,e,t]),v=s==="success"&&a?a:f;return sr(()=>{(async()=>{try{if(t&&r.length){let u=r[0],y=o.get(u.body[0]),d=tt(y)[0];if(!d)return;m(!0),b("loading");try{let h=await i(d,{width:d.width||t.width,height:d.height||t.height})||void 0;c(h),b("success"),m(!1)}catch(h){b("error"),S(h)}}}catch(u){b("error"),S(u)}})()},[l,e]),rt(()=>({data:v,isFetching:g,status:s,error:x}),[v,g,s,x])}function Vs(){let e=ot();return{isLoading:e.isFetching,tile:e.data?{id:e.data.id||e.data["@id"],width:e.data.width,height:e.data.height,imageService:e.data,thumbnail:void 0}:null}}import{useMemo as fe}from"react";import{createPaintingAnnotationsHelper as cr}from"@iiif/helpers";function Gs({supports:e=["empty","images","media","3d-model","textual-content","complex-timeline"]}={}){let t=T(),r=E(),o=B(),n=fe(()=>cr(t),[t]),i=fe(()=>n.getPaintables(o),[n,o]);return fe(()=>Le({canvas:r,loadImageService:a=>a,paintables:i,supports:e}),[r,i,e])}import{createStylesHelper as lr}from"@iiif/helpers/styles";import{useMemo as ur}from"react";function Js(){let e=T();return ur(()=>lr(e),[e])}import{useCallback as mr,useEffect as oe,useMemo as lt,useRef as ne,useState as ut}from"react";var re=[.6,.02,0,.75],nt=16,it={linear:[0,0,1,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1],"ease-in-cubic":re,"ease-out-cubic":[.215,.61,.355,1]};function at(e,t,r){let o=Math.max(0,Math.min(1,r));return{x:e.x+(t.x-e.x)*o,y:e.y+(t.y-e.y)*o,width:e.width+(t.width-e.width)*o,height:e.height+(t.height-e.height)*o}}function st(e,t){let r=[],o=e;for(let n of t)r.push({from:o,to:n}),o=n;return r}function D([e,t,r,o]){let n=3*e,i=3*(r-e)-n,a=1-n-i,c=3*t,g=3*(o-t)-c,m=1-c-g;function s(l){return((a*l+i)*l+n)*l}function b(l){return((m*l+g)*l+c)*l}function x(l){return(3*a*l+2*i)*l+n}function S(l,f=1e-6){let v=l;for(let p=0;p<8;p++){let d=s(v)-l;if(Math.abs(d)<f)return v;let h=x(v);if(Math.abs(h)<1e-6)break;v=v-d/h}let u=0,y=1;for(v=l;u<y;){let p=s(v);if(Math.abs(p-l)<f)return v;l>p?u=v:y=v,v=(y-u)*.5+u}return v}return l=>{if(l<=0)return 0;if(l>=1)return 1;let f=S(l);return b(f)}}function ct(e,t){if(!t||t.length===0)return{index:-1,t:0};if(Number.isNaN(e)||!isFinite(e))return{index:-1,t:0};if(e<0)return{index:-1,t:0};if(e>=t.length)return{index:t.length,t:0};let r=Math.floor(e),o=e-r;return{index:r,t:o}}function nc(e){let{initial:t,regions:r,progress:o,getProgress:n,enabled:i=!0,easing:a,reportEveryFrame:c=!1,pollInterval:g=nt,loop:m=!1,onEnter:s,onExit:b,onProgress:x,jumpTo:S}=e,l=lt(()=>st(t,r),[t,r]),[f,v]=ut(()=>-1),[u,y]=ut(0),p=ne(-1),d=ne(0),h=ne(!0),C=ne(()=>{});oe(()=>(h.current=!0,()=>{h.current=!1}),[]);let M=lt(()=>{if(!a)return D(re);if(typeof a=="function")return a;if(Array.isArray(a)&&a.length===4)return D(a);let I=it[a];return I?D(I):D(re)},[a]),q=mr(I=>{if(!(I<0||I>=l.length)&&(v(I),p.current=I,d.current=0,y(0),s))try{s(I)}catch{}},[l,s]);oe(()=>{C.current=q,S&&S(q)},[q,S]);function H(I){let{index:V,t:_}=ct(I,l),N=V;if(m&&l.length>0){let ie=l.length;N=(V%ie+ie)%ie}let U=M(_);if(N!==p.current){if(p.current>=0&&b)try{b(p.current)}catch{}if(N>=0&&s)try{s(N)}catch{}p.current=N,h.current&&v(N)}if(d.current=U,h.current&&(c||N!==f)&&y(U),x&&N>=0)try{x(N,U)}catch{}}oe(()=>{i&&typeof o=="number"&&H(o)},[o,i]),oe(()=>{if(!i||typeof n!="function")return;let I=null,V=()=>{try{let _=n();H(_)}catch{}};return V(),I=setInterval(V,g),()=>clearInterval(I)},[n,i,g]);let A=f>=0&&f<l.length?l[f]:void 0,ft=A?at(A.from,A.to,d.current):void 0;return{transitions:l,currentIndex:f,currentTransition:A,t:d.current,rect:ft,jumpTo:q}}import{useEffect as fr,useRef as mt,useState as pr}from"react";function sc(e,t={}){let{axis:r="y",offset:o=0,steps:n=1,enabled:i=!0}=t,[a,c]=pr(0),g=mt(-1),m=mt(null);return fr(()=>{if(!i||!e||!e.current)return;let s=e.current,b=()=>{let S=r==="y"?s.scrollTop:s.scrollLeft,l=r==="y"?s.clientHeight:s.clientWidth,v=(r==="y"?s.scrollHeight:s.scrollWidth)-l,y=(v<=0?0:Math.max(0,Math.min(1,(S+o)/v)))*n;y!==g.current&&(g.current=y,c(y)),m.current=null},x=()=>{m.current===null&&(m.current=requestAnimationFrame(b))};return s.addEventListener("scroll",x,{passive:!0}),b(),()=>{s.removeEventListener("scroll",x),m.current!==null&&cancelAnimationFrame(m.current)}},[e,r,o,n,i]),a}function lc(e,t){let{x:r,y:o,width:n,height:i}=e,{x:a,y:c}=t,{width:g,height:m}=t;return r+n>a&&r<a+g&&o+i>c&&o<c+m}import dr from"tiny-invariant";function gc(e,t){let r=e.boundingBox||Se(e.polygon);if(e.polygon&&!xe(e.polygon.points)){let o=e.target||Ie(e.polygon,t);return dr(o?.type==="SvgSelector"),{type:"SvgSelector",points:e.polygon.points,spatial:{unit:"pixel",...r||{}},svgShape:e.polygon.open?"polyline":"polygon",svg:o.value}}return{type:"BoxSelector",spatial:r}}export{Aa as AnnotationContext,Ha as AnnotationPageContext,so as AnnotationStyleProvider,io as AtlasStoreProvider,oo as AtlasStoreReactContext,$r as Auth,Br as AuthProvider,Lr as AuthRContext,Hr as AuthReactContext,zr as AuthReactContextActions,bi as CanvasAnnotations,pe as CanvasContext,Be as CanvasPanel,Fn as CanvasStrategyProvider,On as CanvasWorldObject,Oa as CollectionContext,ki as CombinedMetadata,Wo as ComplexTimelineProvider,yn as ContextBridge,qo as ControlsReactContext,Ve as CreateCustomShape,dn as CustomContextBridge,gn as CustomContextBridgeProvider,re as DEFAULT_BEZIER,nt as DEFAULT_POLL_INTERVAL,In as DefaultEditingTools,it as EASING_PRESETS,Zr as EventEmitterProvider,fn as EventsProvider,Mt as Image,ta as ImageService,Fo as ImageServiceLoaderContext,Gr as InnerViewerProvider,Uo as LanguageProvider,Qo as LanguageString,L as LocaleString,br as ManifestContext,sa as ManifestMetadata,Io as MediaPlayerProvider,j as Metadata,mi as PolygonSelector,xr as RangeContext,Yr as ReactEmitterContext,mn as ReactEventContext,hr as ReactVaultContext,go as RegionHighlight,Eo as Render3DModelStrategy,Ao as RenderAccompanyingCanvas,ho as RenderAnnotation,Sn as RenderAnnotationEditing,vo as RenderAnnotationPage,zo as RenderAnnotationStrategy,Vo as RenderAudioStrategy,Jo as RenderComplexTimelineStrategy,en as RenderEmptyStrategy,rn as RenderImageStrategy,wa as RenderSvgEditorControls,on as RenderTextualContentStrategy,nn as RenderVideoStrategy,an as RenderYouTubeStrategy,po as ResizeWorldItem,z as ResourceProvider,gr as ResourceReactContext,ei as SelectorControllerProvider,xa as SequenceThumbnails,Qr as SimpleViewerProvider,Kr as SimpleViewerReactContext,Ye as SingleCanvasThumbnail,To as StrategyReactContext,Oo as ThumbnailFallbackImage,_o as TranslationProvider,$o as TransliterationProvider,de as VaultProvider,ae as ViewerPresetContext,Ho as VirtualAnnotationProvider,yr as VisibleCanvasReactContext,gc as annotationResponseToSelector,Ar as authDetailsForResource,st as buildTransitions,ro as createAtlasStore,qr as createAuthStateStore,Nr as createProbe,D as cubicBezierEasing,un as defaultEmitter,cn as defaultSvgTheme,Pn as emptyActions,En as emptyStrategy,Ir as findAllCanvasesInRange,Sr as findFirstCanvasFromRange,Rr as findManifestSelectedRange,Cr as findSelectedRange,qn as flattenAnnotationPageIds,Co as formatTime,kn as get3dStrategy,no as getAtlasStoreByName,zn as getComplexTimelineStrategy,ao as getDefaultAnnotationStyles,Mn as getImageStrategy,Tr as getManifestSequence,Cn as getParsedTargetSelector,Le as getRenderingStrategy,ct as getStepFromProgress,Ln as getTextualContentStrategy,Hn as getVideoStrategy,Pr as getVisibleCanvasesFromCanvasId,Er as hasAuth,at as interpolateRect,eo as isBoxSelector,xe as isRectangle,Jr as isSvgSelector,Mr as makeAccessServiceRequest,kr as makeAccessTokenRequest,Rn as parseSpecificResource,Ie as polygonToTarget,Re as requestToAnnotationResponse,to as seraliseSupportedSelector,Kn as svgThemes,lc as targetIntersects,Tn as unknownResponse,wn as unsupportedStrategy,uo as useAnnotation,yo as useAnnotationPage,ke as useAnnotationPageManager,Ce as useAnnotationStyles,_a as useAnnotationsAtTime,bn as useAtlasContextMenu,w as useAtlasStore,Vr as useAuthActions,Dr as useAuthService,Or as useAuthStore,Ur as useAuthToken,_r as useAuthTokens,E as useCanvas,Qa as useCanvasChoices,Za as useCanvasClock,wr as useCanvasSequence,Ro as useCanvasStartTime,ts as useCanvasSubset,Yo as useClosestLanguage,as as useCollection,Do as useComplexTimeline,hn as useContextBridge,vn as useContextMenuStore,jo as useCreateLocaleString,ms as useCurrentAnnotationActions,hs as useCurrentAnnotationMetadata,xn as useCurrentAnnotationRequest,Ss as useCurrentAnnotationTransition,Wr as useCurrentAuth,pn as useCustomContextBridge,ko as useDispatch,jr as useEmitter,G as useEvent,Ae as useEventEmitter,Ts as useEventListener,he as useExistingVault,Ns as useExternalCollection,vr as useExternalManifest,ye as useExternalResource,Ko as useIIIFLanguage,ce as useImage,ot as useImageService,Te as useImageServiceLoader,Vs as useImageTile,Fr as useIsAuthEnabled,Me as useLoadImageService,Zo as useLocaleString,K as useManifest,xo as useMediaActions,So as useMediaElements,bo as useMediaState,An as usePaintables,B as usePaintingAnnotations,sn as usePolygonHelper,ve as useRange,lo as useRemoteStylesheet,No as useRenderControls,Bn as useRenderingStrategy,Oe as useRequestAnnotation,$ as useResourceContext,mo as useResourceEvents,Nn as useResources,Xr as useSearchService,Xe as useSelectorController,ti as useSelectorEmitter,$e as useSelectorEvents,ri as useSelectorHelper,Po as useSimpleMediaPlayer,be as useSimpleViewer,Gs as useStaticRenderingStrategy,wo as useStrategy,Js as useStyleHelper,fo as useStyles,co as useStylesheetStore,ln as useSvgEditor,Ze as useSvgEditorControls,we as useThumbnail,Go as useTranslations,Xo as useTransliteration,T as useVault,Bo as useVaultEffect,X as useVaultSelector,tn as useViewerPreset,sc as useViewportScroll,nc as useViewportTour,Mo as useVirtualAnnotationPage,Lo as useVirtualAnnotationPageContext,ge as useVisibleCanvases};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-iiif-vault",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"zustand": "^4.5.2"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"@atlas-viewer/atlas": "^3.0
|
|
78
|
+
"@atlas-viewer/atlas": "^3.1.0",
|
|
79
79
|
"react": "^18.2.0 || ^19.2.0",
|
|
80
80
|
"react-dom": "^18.2.0 || ^19.2.0"
|
|
81
81
|
},
|