react-iiif-vault 0.9.8 → 0.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +979 -271
- package/dist/esm/index.mjs +917 -219
- package/dist/index.d.ts +97 -26
- package/dist/index.umd.js +27573 -26870
- package/package.json +13 -10
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _atlas_viewer_atlas from '@atlas-viewer/atlas';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import React__default, { ReactNode,
|
|
3
|
+
import React__default, { ReactNode, RefObject } from 'react';
|
|
4
4
|
import * as _iiif_presentation_3 from '@iiif/presentation-3';
|
|
5
5
|
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
6
|
import { AtlasProps } from '@atlas-viewer/atlas/dist/types/modules/react-reconciler/Atlas';
|
|
@@ -10,12 +10,14 @@ import { ImageCandidate, ImageServiceLoader, ImageCandidateRequest } from '@atla
|
|
|
10
10
|
import * as _iiif_vault__ from '@iiif/vault/*';
|
|
11
11
|
import * as _iiif_vault_helpers from '@iiif/vault-helpers';
|
|
12
12
|
|
|
13
|
-
declare function Viewer({ children, ...props }: AtlasProps & {
|
|
13
|
+
declare function Viewer({ children, errorFallback, outerContainerProps, ...props }: AtlasProps & {
|
|
14
14
|
height?: number | string;
|
|
15
15
|
width?: number | string;
|
|
16
16
|
resizeHash?: number;
|
|
17
17
|
containerProps?: any;
|
|
18
|
+
outerContainerProps?: any;
|
|
18
19
|
aspectRatio?: number;
|
|
20
|
+
errorFallback?: any;
|
|
19
21
|
} & {
|
|
20
22
|
children: ReactNode;
|
|
21
23
|
}): JSX.Element;
|
|
@@ -115,8 +117,8 @@ declare type SingleVideo = {
|
|
|
115
117
|
url: string;
|
|
116
118
|
format: string;
|
|
117
119
|
duration: number;
|
|
118
|
-
target: TemporalBoxSelector;
|
|
119
|
-
selector: TemporalBoxSelector;
|
|
120
|
+
target: TemporalSelector | TemporalBoxSelector;
|
|
121
|
+
selector: TemporalSelector | TemporalBoxSelector;
|
|
120
122
|
};
|
|
121
123
|
declare type AudioSequence = {
|
|
122
124
|
type: 'SoundSequence';
|
|
@@ -214,17 +216,22 @@ declare type CanvasProps = {
|
|
|
214
216
|
opacity?: number;
|
|
215
217
|
}>;
|
|
216
218
|
isStatic?: boolean;
|
|
219
|
+
children?: ReactNode;
|
|
220
|
+
renderViewerControls?: (strategy: SingleImageStrategy) => ReactNode;
|
|
221
|
+
renderMediaControls?: (strategy: MediaStrategy) => ReactNode;
|
|
222
|
+
strategies?: Array<RenderingStrategy['type']>;
|
|
217
223
|
};
|
|
218
|
-
declare function RenderCanvas({ x, y, onChoiceChange, registerActions, defaultChoices, isStatic }: CanvasProps): JSX.Element | null;
|
|
224
|
+
declare function RenderCanvas({ x, y, onChoiceChange, registerActions, defaultChoices, isStatic, renderViewerControls, renderMediaControls, strategies, children, }: CanvasProps): JSX.Element | null;
|
|
219
225
|
|
|
220
|
-
declare function RenderImage({ id, image, thumbnail, isStatic, x, y, annotations, }: {
|
|
226
|
+
declare function RenderImage({ id, image, thumbnail, isStatic, x, y, annotations, children, }: {
|
|
221
227
|
id: string;
|
|
222
228
|
image: ImageWithOptionalService;
|
|
223
229
|
thumbnail?: ImageCandidate;
|
|
224
230
|
isStatic?: boolean;
|
|
225
231
|
x?: number;
|
|
226
232
|
y?: number;
|
|
227
|
-
annotations?:
|
|
233
|
+
annotations?: ReactNode;
|
|
234
|
+
children?: ReactNode;
|
|
228
235
|
}): JSX.Element;
|
|
229
236
|
|
|
230
237
|
declare const CanvasPanel: {
|
|
@@ -243,25 +250,85 @@ declare const CanvasPanel: {
|
|
|
243
250
|
Viewer: typeof Viewer;
|
|
244
251
|
};
|
|
245
252
|
|
|
246
|
-
declare
|
|
253
|
+
declare function AnnotationContext({ annotation, children }: {
|
|
247
254
|
annotation: string;
|
|
248
|
-
|
|
255
|
+
children: ReactNode;
|
|
256
|
+
}): JSX.Element;
|
|
249
257
|
|
|
250
|
-
declare
|
|
258
|
+
declare function CanvasContext({ canvas, children }: {
|
|
251
259
|
canvas: string;
|
|
252
|
-
|
|
260
|
+
children: ReactNode;
|
|
261
|
+
}): JSX.Element;
|
|
253
262
|
|
|
254
|
-
declare
|
|
263
|
+
declare function CollectionContext({ collection, children }: {
|
|
255
264
|
collection: string;
|
|
256
|
-
|
|
265
|
+
children: ReactNode;
|
|
266
|
+
}): JSX.Element;
|
|
257
267
|
|
|
258
|
-
declare
|
|
268
|
+
declare function ManifestContext({ manifest, children }: {
|
|
259
269
|
manifest: string;
|
|
260
|
-
|
|
270
|
+
children: ReactNode;
|
|
271
|
+
}): JSX.Element;
|
|
272
|
+
|
|
273
|
+
declare type MediaPlayerState = {
|
|
274
|
+
isPlaying: boolean;
|
|
275
|
+
isMuted: boolean;
|
|
276
|
+
playRequested: boolean;
|
|
277
|
+
volume: number;
|
|
278
|
+
isFinished: boolean;
|
|
279
|
+
duration: number;
|
|
280
|
+
};
|
|
281
|
+
declare type MediaPlayerActions = {
|
|
282
|
+
play(): void;
|
|
283
|
+
pause(): void;
|
|
284
|
+
playPause(): void;
|
|
285
|
+
mute(): void;
|
|
286
|
+
unmute(): void;
|
|
287
|
+
toggleMute(): void;
|
|
288
|
+
setVolume(volume: number): void;
|
|
289
|
+
setDurationPercent(percent: number): void;
|
|
290
|
+
setTime(time: number): void;
|
|
291
|
+
};
|
|
292
|
+
declare function formatTime(time: number): string;
|
|
293
|
+
declare function useSimpleMediaPlayer(props: {
|
|
294
|
+
duration: number;
|
|
295
|
+
}): readonly [
|
|
296
|
+
{
|
|
297
|
+
element: RefObject<HTMLAudioElement | HTMLVideoElement>;
|
|
298
|
+
currentTime: RefObject<HTMLDivElement>;
|
|
299
|
+
progress: RefObject<HTMLDivElement>;
|
|
300
|
+
},
|
|
301
|
+
MediaPlayerState,
|
|
302
|
+
MediaPlayerActions
|
|
303
|
+
];
|
|
304
|
+
|
|
305
|
+
declare function useMediaState(): MediaPlayerState;
|
|
306
|
+
declare function useMediaActions(): MediaPlayerActions;
|
|
307
|
+
declare function useMediaElements(): {
|
|
308
|
+
element: RefObject<HTMLAudioElement | HTMLVideoElement>;
|
|
309
|
+
currentTime: RefObject<HTMLDivElement>;
|
|
310
|
+
progress: RefObject<HTMLDivElement>;
|
|
311
|
+
};
|
|
312
|
+
declare function MediaPlayerProvider({ actions, state, children, currentTime, progress, element, }: {
|
|
313
|
+
actions: MediaPlayerActions;
|
|
314
|
+
state: MediaPlayerState;
|
|
315
|
+
children: ReactNode;
|
|
316
|
+
currentTime: RefObject<HTMLDivElement>;
|
|
317
|
+
progress: RefObject<HTMLDivElement>;
|
|
318
|
+
element: RefObject<HTMLAudioElement | HTMLVideoElement>;
|
|
319
|
+
}): JSX.Element;
|
|
261
320
|
|
|
262
|
-
declare const
|
|
321
|
+
declare const PortalContext: React__default.Context<HTMLDivElement | null>;
|
|
322
|
+
declare const OverlayPortalContext: React__default.Context<HTMLDivElement | null>;
|
|
323
|
+
declare function CanvasPortal({ children, overlay }: {
|
|
324
|
+
children: ReactNode;
|
|
325
|
+
overlay?: boolean;
|
|
326
|
+
}): null;
|
|
327
|
+
|
|
328
|
+
declare function RangeContext({ range, children }: {
|
|
263
329
|
range: string;
|
|
264
|
-
|
|
330
|
+
children: ReactNode;
|
|
331
|
+
}): JSX.Element;
|
|
265
332
|
|
|
266
333
|
declare type ResourceContextType = {
|
|
267
334
|
collection?: string;
|
|
@@ -272,20 +339,22 @@ declare type ResourceContextType = {
|
|
|
272
339
|
};
|
|
273
340
|
declare const ResourceReactContext: React__default.Context<ResourceContextType>;
|
|
274
341
|
declare const useResourceContext: () => ResourceContextType;
|
|
275
|
-
declare
|
|
342
|
+
declare function ResourceProvider({ value, children }: {
|
|
276
343
|
value: ResourceContextType;
|
|
277
|
-
|
|
344
|
+
children: ReactNode;
|
|
345
|
+
}): JSX.Element;
|
|
278
346
|
|
|
279
347
|
declare const ReactVaultContext: React__default.Context<{
|
|
280
348
|
vault: Vault | null;
|
|
281
349
|
setVaultInstance: (vault: Vault) => void;
|
|
282
350
|
}>;
|
|
283
|
-
declare
|
|
351
|
+
declare function VaultProvider({ vault, vaultOptions, useGlobal, resources, children, }: {
|
|
284
352
|
vault?: Vault;
|
|
285
353
|
useGlobal?: boolean;
|
|
286
354
|
vaultOptions?: VaultOptions;
|
|
287
355
|
resources?: ResourceContextType;
|
|
288
|
-
|
|
356
|
+
children: ReactNode;
|
|
357
|
+
}): JSX.Element;
|
|
289
358
|
|
|
290
359
|
declare function useContextBridge(): {
|
|
291
360
|
VaultContext: {
|
|
@@ -304,9 +373,10 @@ declare function useContextBridge(): {
|
|
|
304
373
|
};
|
|
305
374
|
VisibleCanvasReactContext: string[];
|
|
306
375
|
};
|
|
307
|
-
declare
|
|
376
|
+
declare function ContextBridge(props: {
|
|
308
377
|
bridge: ReturnType<typeof useContextBridge>;
|
|
309
|
-
|
|
378
|
+
children: ReactNode;
|
|
379
|
+
}): JSX.Element;
|
|
310
380
|
|
|
311
381
|
declare const VisibleCanvasReactContext: React__default.Context<string[]>;
|
|
312
382
|
declare function useVisibleCanvases(): CanvasNormalized[];
|
|
@@ -535,10 +605,11 @@ declare type SimpleViewerContext = {
|
|
|
535
605
|
previousCanvas: () => void;
|
|
536
606
|
};
|
|
537
607
|
declare const SimpleViewerReactContext: React__default.Context<SimpleViewerContext>;
|
|
538
|
-
declare
|
|
608
|
+
declare function SimpleViewerProvider(props: {
|
|
539
609
|
manifest: string;
|
|
540
610
|
pagingEnabled?: boolean;
|
|
541
|
-
|
|
611
|
+
children: ReactNode;
|
|
612
|
+
}): JSX.Element;
|
|
542
613
|
declare function useSimpleViewer(): SimpleViewerContext;
|
|
543
614
|
|
|
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 };
|
|
615
|
+
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, 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, useVirtualAnnotationPage, useVirtualAnnotationPageContext, useVisibleCanvases };
|