react-iiif-vault 0.9.8 → 0.9.11
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/cjs/index.js +989 -271
- package/dist/esm/index.mjs +925 -219
- package/dist/index.d.ts +101 -26
- package/dist/index.umd.js +27593 -26878
- package/package.json +14 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as _atlas_viewer_atlas from '@atlas-viewer/atlas';
|
|
2
|
+
import { Preset } from '@atlas-viewer/atlas';
|
|
2
3
|
import * as React from 'react';
|
|
3
|
-
import React__default, { ReactNode,
|
|
4
|
+
import React__default, { ReactNode, RefObject } from 'react';
|
|
4
5
|
import * as _iiif_presentation_3 from '@iiif/presentation-3';
|
|
5
6
|
import { InternationalString, ImageService, AnnotationPageNormalized, ContentResource, IIIFExternalWebResource, SpecificResource, AnnotationNormalized, CanvasNormalized, CollectionNormalized, Reference, ManifestNormalized, RangeNormalized, SearchService, Annotation, ExternalWebResource as ExternalWebResource$1, W3CAnnotationTarget, Selector } from '@iiif/presentation-3';
|
|
6
7
|
import { AtlasProps } from '@atlas-viewer/atlas/dist/types/modules/react-reconciler/Atlas';
|
|
@@ -10,12 +11,14 @@ import { ImageCandidate, ImageServiceLoader, ImageCandidateRequest } from '@atla
|
|
|
10
11
|
import * as _iiif_vault__ from '@iiif/vault/*';
|
|
11
12
|
import * as _iiif_vault_helpers from '@iiif/vault-helpers';
|
|
12
13
|
|
|
13
|
-
declare function Viewer({ children, ...props }: AtlasProps & {
|
|
14
|
+
declare function Viewer({ children, errorFallback, outerContainerProps, ...props }: AtlasProps & {
|
|
14
15
|
height?: number | string;
|
|
15
16
|
width?: number | string;
|
|
16
17
|
resizeHash?: number;
|
|
17
18
|
containerProps?: any;
|
|
19
|
+
outerContainerProps?: any;
|
|
18
20
|
aspectRatio?: number;
|
|
21
|
+
errorFallback?: any;
|
|
19
22
|
} & {
|
|
20
23
|
children: ReactNode;
|
|
21
24
|
}): JSX.Element;
|
|
@@ -115,8 +118,8 @@ declare type SingleVideo = {
|
|
|
115
118
|
url: string;
|
|
116
119
|
format: string;
|
|
117
120
|
duration: number;
|
|
118
|
-
target: TemporalBoxSelector;
|
|
119
|
-
selector: TemporalBoxSelector;
|
|
121
|
+
target: TemporalSelector | TemporalBoxSelector;
|
|
122
|
+
selector: TemporalSelector | TemporalBoxSelector;
|
|
120
123
|
};
|
|
121
124
|
declare type AudioSequence = {
|
|
122
125
|
type: 'SoundSequence';
|
|
@@ -214,17 +217,22 @@ declare type CanvasProps = {
|
|
|
214
217
|
opacity?: number;
|
|
215
218
|
}>;
|
|
216
219
|
isStatic?: boolean;
|
|
220
|
+
children?: ReactNode;
|
|
221
|
+
renderViewerControls?: (strategy: SingleImageStrategy) => ReactNode;
|
|
222
|
+
renderMediaControls?: (strategy: MediaStrategy) => ReactNode;
|
|
223
|
+
strategies?: Array<RenderingStrategy['type']>;
|
|
217
224
|
};
|
|
218
|
-
declare function RenderCanvas({ x, y, onChoiceChange, registerActions, defaultChoices, isStatic }: CanvasProps): JSX.Element | null;
|
|
225
|
+
declare function RenderCanvas({ x, y, onChoiceChange, registerActions, defaultChoices, isStatic, renderViewerControls, renderMediaControls, strategies, children, }: CanvasProps): JSX.Element | null;
|
|
219
226
|
|
|
220
|
-
declare function RenderImage({ id, image, thumbnail, isStatic, x, y, annotations, }: {
|
|
227
|
+
declare function RenderImage({ id, image, thumbnail, isStatic, x, y, annotations, children, }: {
|
|
221
228
|
id: string;
|
|
222
229
|
image: ImageWithOptionalService;
|
|
223
230
|
thumbnail?: ImageCandidate;
|
|
224
231
|
isStatic?: boolean;
|
|
225
232
|
x?: number;
|
|
226
233
|
y?: number;
|
|
227
|
-
annotations?:
|
|
234
|
+
annotations?: ReactNode;
|
|
235
|
+
children?: ReactNode;
|
|
228
236
|
}): JSX.Element;
|
|
229
237
|
|
|
230
238
|
declare const CanvasPanel: {
|
|
@@ -243,25 +251,85 @@ declare const CanvasPanel: {
|
|
|
243
251
|
Viewer: typeof Viewer;
|
|
244
252
|
};
|
|
245
253
|
|
|
246
|
-
declare
|
|
254
|
+
declare function AnnotationContext({ annotation, children }: {
|
|
247
255
|
annotation: string;
|
|
248
|
-
|
|
256
|
+
children: ReactNode;
|
|
257
|
+
}): JSX.Element;
|
|
249
258
|
|
|
250
|
-
declare
|
|
259
|
+
declare function CanvasContext({ canvas, children }: {
|
|
251
260
|
canvas: string;
|
|
252
|
-
|
|
261
|
+
children: ReactNode;
|
|
262
|
+
}): JSX.Element;
|
|
253
263
|
|
|
254
|
-
declare
|
|
264
|
+
declare function CollectionContext({ collection, children }: {
|
|
255
265
|
collection: string;
|
|
256
|
-
|
|
266
|
+
children: ReactNode;
|
|
267
|
+
}): JSX.Element;
|
|
257
268
|
|
|
258
|
-
declare
|
|
269
|
+
declare function ManifestContext({ manifest, children }: {
|
|
259
270
|
manifest: string;
|
|
260
|
-
|
|
271
|
+
children: ReactNode;
|
|
272
|
+
}): JSX.Element;
|
|
261
273
|
|
|
262
|
-
declare
|
|
274
|
+
declare type MediaPlayerState = {
|
|
275
|
+
isPlaying: boolean;
|
|
276
|
+
isMuted: boolean;
|
|
277
|
+
playRequested: boolean;
|
|
278
|
+
volume: number;
|
|
279
|
+
isFinished: boolean;
|
|
280
|
+
duration: number;
|
|
281
|
+
};
|
|
282
|
+
declare type MediaPlayerActions = {
|
|
283
|
+
play(): void;
|
|
284
|
+
pause(): void;
|
|
285
|
+
playPause(): void;
|
|
286
|
+
mute(): void;
|
|
287
|
+
unmute(): void;
|
|
288
|
+
toggleMute(): void;
|
|
289
|
+
setVolume(volume: number): void;
|
|
290
|
+
setDurationPercent(percent: number): void;
|
|
291
|
+
setTime(time: number): void;
|
|
292
|
+
};
|
|
293
|
+
declare function formatTime(time: number): string;
|
|
294
|
+
declare function useSimpleMediaPlayer(props: {
|
|
295
|
+
duration: number;
|
|
296
|
+
}): readonly [
|
|
297
|
+
{
|
|
298
|
+
element: RefObject<HTMLAudioElement | HTMLVideoElement>;
|
|
299
|
+
currentTime: RefObject<HTMLDivElement>;
|
|
300
|
+
progress: RefObject<HTMLDivElement>;
|
|
301
|
+
},
|
|
302
|
+
MediaPlayerState,
|
|
303
|
+
MediaPlayerActions
|
|
304
|
+
];
|
|
305
|
+
|
|
306
|
+
declare function useMediaState(): MediaPlayerState;
|
|
307
|
+
declare function useMediaActions(): MediaPlayerActions;
|
|
308
|
+
declare function useMediaElements(): {
|
|
309
|
+
element: RefObject<HTMLAudioElement | HTMLVideoElement>;
|
|
310
|
+
currentTime: RefObject<HTMLDivElement>;
|
|
311
|
+
progress: RefObject<HTMLDivElement>;
|
|
312
|
+
};
|
|
313
|
+
declare function MediaPlayerProvider({ actions, state, children, currentTime, progress, element, }: {
|
|
314
|
+
actions: MediaPlayerActions;
|
|
315
|
+
state: MediaPlayerState;
|
|
316
|
+
children: ReactNode;
|
|
317
|
+
currentTime: RefObject<HTMLDivElement>;
|
|
318
|
+
progress: RefObject<HTMLDivElement>;
|
|
319
|
+
element: RefObject<HTMLAudioElement | HTMLVideoElement>;
|
|
320
|
+
}): JSX.Element;
|
|
321
|
+
|
|
322
|
+
declare const PortalContext: React__default.Context<HTMLDivElement | null>;
|
|
323
|
+
declare const OverlayPortalContext: React__default.Context<HTMLDivElement | null>;
|
|
324
|
+
declare function CanvasPortal({ children, overlay }: {
|
|
325
|
+
children: ReactNode;
|
|
326
|
+
overlay?: boolean;
|
|
327
|
+
}): null;
|
|
328
|
+
|
|
329
|
+
declare function RangeContext({ range, children }: {
|
|
263
330
|
range: string;
|
|
264
|
-
|
|
331
|
+
children: ReactNode;
|
|
332
|
+
}): JSX.Element;
|
|
265
333
|
|
|
266
334
|
declare type ResourceContextType = {
|
|
267
335
|
collection?: string;
|
|
@@ -272,20 +340,22 @@ declare type ResourceContextType = {
|
|
|
272
340
|
};
|
|
273
341
|
declare const ResourceReactContext: React__default.Context<ResourceContextType>;
|
|
274
342
|
declare const useResourceContext: () => ResourceContextType;
|
|
275
|
-
declare
|
|
343
|
+
declare function ResourceProvider({ value, children }: {
|
|
276
344
|
value: ResourceContextType;
|
|
277
|
-
|
|
345
|
+
children: ReactNode;
|
|
346
|
+
}): JSX.Element;
|
|
278
347
|
|
|
279
348
|
declare const ReactVaultContext: React__default.Context<{
|
|
280
349
|
vault: Vault | null;
|
|
281
350
|
setVaultInstance: (vault: Vault) => void;
|
|
282
351
|
}>;
|
|
283
|
-
declare
|
|
352
|
+
declare function VaultProvider({ vault, vaultOptions, useGlobal, resources, children, }: {
|
|
284
353
|
vault?: Vault;
|
|
285
354
|
useGlobal?: boolean;
|
|
286
355
|
vaultOptions?: VaultOptions;
|
|
287
356
|
resources?: ResourceContextType;
|
|
288
|
-
|
|
357
|
+
children: ReactNode;
|
|
358
|
+
}): JSX.Element;
|
|
289
359
|
|
|
290
360
|
declare function useContextBridge(): {
|
|
291
361
|
VaultContext: {
|
|
@@ -304,13 +374,17 @@ declare function useContextBridge(): {
|
|
|
304
374
|
};
|
|
305
375
|
VisibleCanvasReactContext: string[];
|
|
306
376
|
};
|
|
307
|
-
declare
|
|
377
|
+
declare function ContextBridge(props: {
|
|
308
378
|
bridge: ReturnType<typeof useContextBridge>;
|
|
309
|
-
|
|
379
|
+
children: ReactNode;
|
|
380
|
+
}): JSX.Element;
|
|
310
381
|
|
|
311
382
|
declare const VisibleCanvasReactContext: React__default.Context<string[]>;
|
|
312
383
|
declare function useVisibleCanvases(): CanvasNormalized[];
|
|
313
384
|
|
|
385
|
+
declare const ViewerPresetContext: React.Context<Preset | null | undefined>;
|
|
386
|
+
declare function useViewerPreset(): Preset | null | undefined;
|
|
387
|
+
|
|
314
388
|
declare const ImageServiceLoaderContext: React__default.Context<ImageServiceLoader>;
|
|
315
389
|
declare function useImageServiceLoader(): ImageServiceLoader;
|
|
316
390
|
|
|
@@ -535,10 +609,11 @@ declare type SimpleViewerContext = {
|
|
|
535
609
|
previousCanvas: () => void;
|
|
536
610
|
};
|
|
537
611
|
declare const SimpleViewerReactContext: React__default.Context<SimpleViewerContext>;
|
|
538
|
-
declare
|
|
612
|
+
declare function SimpleViewerProvider(props: {
|
|
539
613
|
manifest: string;
|
|
540
614
|
pagingEnabled?: boolean;
|
|
541
|
-
|
|
615
|
+
children: ReactNode;
|
|
616
|
+
}): JSX.Element;
|
|
542
617
|
declare function useSimpleViewer(): SimpleViewerContext;
|
|
543
618
|
|
|
544
|
-
export { AnnotationContext, AnnotationPageDescription, AudioSequence, BoxSelector, CanvasContext, CanvasPanel, ChoiceDescription, CollectionContext, ComplexChoice, ComplexTimelineStrategy, ContextBridge, ImageServiceLoaderContext, ImageServiceLoaderType, ImageServiceRequestOptions, ImageWithOptionalService, ManifestContext, MediaStrategy, Paintables, ParsedSelector, PointSelector, RangeContext, ReactVaultContext, RenderingStrategy, ResourceContextType, ResourceProvider, ResourceReactContext, ResourceRequestOptions, SimpleViewerProvider, SimpleViewerReactContext, SingleAudio, SingleChoice, SingleImageStrategy, SingleVideo, StrategyActions, SupportedSelector, SupportedSelectors, SupportedTarget, TemporalBoxSelector, TemporalSelector, UnknownStrategy, UseRenderingStrategy, UseRenderingStrategyOptions, VaultActivatedAnnotation, VaultProvider, VideoSequence, VirtualAnnotationProvider, VisibleCanvasReactContext, emptyActions, expandTarget, flattenAnnotationPageIds, getImageStrategy, getPaintables, parseSelector, parseSpecificResource, unknownResponse, unsupportedStrategy, useAnnotation, useAnnotationPageManager, useAnnotationsAtTime, useCanvas, useCanvasClock, useCollection, useContextBridge, useDispatch, useEventListener, useExistingVault, useExternalCollection, useExternalManifest, useExternalResource, useImageService, useImageServiceLoader, useImageTile, useLoadImageService, useManifest, usePaintables, usePaintingAnnotations, useRange, useRenderingStrategy, useResourceContext, useResourceEvents, useResources, useSearchService, useSimpleViewer, useStyleHelper, useStyles, useThumbnail, useVault, useVaultEffect, useVaultSelector, useVirtualAnnotationPage, useVirtualAnnotationPageContext, useVisibleCanvases };
|
|
619
|
+
export { AnnotationContext, AnnotationPageDescription, AudioSequence, BoxSelector, CanvasContext, CanvasPanel, CanvasPortal, ChoiceDescription, CollectionContext, ComplexChoice, ComplexTimelineStrategy, ContextBridge, ImageServiceLoaderContext, ImageServiceLoaderType, ImageServiceRequestOptions, ImageWithOptionalService, ManifestContext, MediaPlayerActions, MediaPlayerProvider, MediaPlayerState, MediaStrategy, OverlayPortalContext, Paintables, ParsedSelector, PointSelector, PortalContext, RangeContext, ReactVaultContext, RenderingStrategy, ResourceContextType, ResourceProvider, ResourceReactContext, ResourceRequestOptions, SimpleViewerProvider, SimpleViewerReactContext, SingleAudio, SingleChoice, SingleImageStrategy, SingleVideo, StrategyActions, SupportedSelector, SupportedSelectors, SupportedTarget, TemporalBoxSelector, TemporalSelector, UnknownStrategy, UseRenderingStrategy, UseRenderingStrategyOptions, VaultActivatedAnnotation, VaultProvider, VideoSequence, ViewerPresetContext, VirtualAnnotationProvider, VisibleCanvasReactContext, emptyActions, expandTarget, flattenAnnotationPageIds, formatTime, getImageStrategy, getPaintables, parseSelector, parseSpecificResource, unknownResponse, unsupportedStrategy, useAnnotation, useAnnotationPageManager, useAnnotationsAtTime, useCanvas, useCanvasClock, useCollection, useContextBridge, useDispatch, useEventListener, useExistingVault, useExternalCollection, useExternalManifest, useExternalResource, useImageService, useImageServiceLoader, useImageTile, useLoadImageService, useManifest, useMediaActions, useMediaElements, useMediaState, usePaintables, usePaintingAnnotations, useRange, useRenderingStrategy, useResourceContext, useResourceEvents, useResources, useSearchService, useSimpleMediaPlayer, useSimpleViewer, useStyleHelper, useStyles, useThumbnail, useVault, useVaultEffect, useVaultSelector, useViewerPreset, useVirtualAnnotationPage, useVirtualAnnotationPageContext, useVisibleCanvases };
|