react-iiif-vault 0.9.7 → 0.9.10
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 +1007 -267
- package/dist/esm/index.mjs +945 -215
- package/dist/index.d.ts +108 -29
- package/dist/index.umd.js +27592 -26855
- package/package.json +14 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
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
|
-
import { InternationalString, ImageService, AnnotationPageNormalized, ContentResource, IIIFExternalWebResource, SpecificResource, AnnotationNormalized, CanvasNormalized, CollectionNormalized, Reference, ManifestNormalized, RangeNormalized, SearchService, Annotation, ExternalWebResource, W3CAnnotationTarget, Selector } from '@iiif/presentation-3';
|
|
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';
|
|
7
7
|
import { Vault, VaultOptions, ReduxStore, NormalizedEntity, IIIFStore } from '@iiif/vault';
|
|
8
|
+
import { ExternalWebResource } from '@iiif/presentation-3/resources/annotation';
|
|
8
9
|
import { ImageCandidate, ImageServiceLoader, ImageCandidateRequest } from '@atlas-viewer/iiif-image-api';
|
|
9
10
|
import * as _iiif_vault__ from '@iiif/vault/*';
|
|
10
11
|
import * as _iiif_vault_helpers from '@iiif/vault-helpers';
|
|
11
12
|
|
|
12
|
-
declare function Viewer({ children, ...props }: AtlasProps & {
|
|
13
|
+
declare function Viewer({ children, errorFallback, outerContainerProps, ...props }: AtlasProps & {
|
|
13
14
|
height?: number | string;
|
|
14
15
|
width?: number | string;
|
|
15
16
|
resizeHash?: number;
|
|
16
17
|
containerProps?: any;
|
|
18
|
+
outerContainerProps?: any;
|
|
17
19
|
aspectRatio?: number;
|
|
20
|
+
errorFallback?: any;
|
|
18
21
|
} & {
|
|
19
22
|
children: ReactNode;
|
|
20
23
|
}): JSX.Element;
|
|
@@ -114,8 +117,8 @@ declare type SingleVideo = {
|
|
|
114
117
|
url: string;
|
|
115
118
|
format: string;
|
|
116
119
|
duration: number;
|
|
117
|
-
target: TemporalBoxSelector;
|
|
118
|
-
selector: TemporalBoxSelector;
|
|
120
|
+
target: TemporalSelector | TemporalBoxSelector;
|
|
121
|
+
selector: TemporalSelector | TemporalBoxSelector;
|
|
119
122
|
};
|
|
120
123
|
declare type AudioSequence = {
|
|
121
124
|
type: 'SoundSequence';
|
|
@@ -162,6 +165,13 @@ declare type SingleImageStrategy = {
|
|
|
162
165
|
};
|
|
163
166
|
declare function getImageStrategy(canvas: CanvasNormalized, paintables: Paintables, loadImageService: ImageServiceLoaderType): RenderingStrategy;
|
|
164
167
|
|
|
168
|
+
declare type Single3DModelStrategy = {
|
|
169
|
+
type: '3d-model';
|
|
170
|
+
model: ExternalWebResource;
|
|
171
|
+
choice?: ChoiceDescription;
|
|
172
|
+
annotations?: AnnotationPageDescription;
|
|
173
|
+
};
|
|
174
|
+
|
|
165
175
|
declare type MediaStrategy = {
|
|
166
176
|
type: 'media';
|
|
167
177
|
media: SingleAudio | SingleVideo | AudioSequence | VideoSequence;
|
|
@@ -179,7 +189,7 @@ declare type UnknownStrategy = {
|
|
|
179
189
|
reason?: string;
|
|
180
190
|
annotations?: AnnotationPageDescription;
|
|
181
191
|
};
|
|
182
|
-
declare type RenderingStrategy = SingleImageStrategy | MediaStrategy | ComplexTimelineStrategy | UnknownStrategy;
|
|
192
|
+
declare type RenderingStrategy = SingleImageStrategy | MediaStrategy | ComplexTimelineStrategy | Single3DModelStrategy | UnknownStrategy;
|
|
183
193
|
|
|
184
194
|
declare type StrategyActions = {
|
|
185
195
|
makeChoice: (id: string, options?: {
|
|
@@ -206,17 +216,22 @@ declare type CanvasProps = {
|
|
|
206
216
|
opacity?: number;
|
|
207
217
|
}>;
|
|
208
218
|
isStatic?: boolean;
|
|
219
|
+
children?: ReactNode;
|
|
220
|
+
renderViewerControls?: (strategy: SingleImageStrategy) => ReactNode;
|
|
221
|
+
renderMediaControls?: (strategy: MediaStrategy) => ReactNode;
|
|
222
|
+
strategies?: Array<RenderingStrategy['type']>;
|
|
209
223
|
};
|
|
210
|
-
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;
|
|
211
225
|
|
|
212
|
-
declare function RenderImage({ id, image, thumbnail, isStatic, x, y, annotations, }: {
|
|
226
|
+
declare function RenderImage({ id, image, thumbnail, isStatic, x, y, annotations, children, }: {
|
|
213
227
|
id: string;
|
|
214
228
|
image: ImageWithOptionalService;
|
|
215
229
|
thumbnail?: ImageCandidate;
|
|
216
230
|
isStatic?: boolean;
|
|
217
231
|
x?: number;
|
|
218
232
|
y?: number;
|
|
219
|
-
annotations?:
|
|
233
|
+
annotations?: ReactNode;
|
|
234
|
+
children?: ReactNode;
|
|
220
235
|
}): JSX.Element;
|
|
221
236
|
|
|
222
237
|
declare const CanvasPanel: {
|
|
@@ -235,25 +250,85 @@ declare const CanvasPanel: {
|
|
|
235
250
|
Viewer: typeof Viewer;
|
|
236
251
|
};
|
|
237
252
|
|
|
238
|
-
declare
|
|
253
|
+
declare function AnnotationContext({ annotation, children }: {
|
|
239
254
|
annotation: string;
|
|
240
|
-
|
|
255
|
+
children: ReactNode;
|
|
256
|
+
}): JSX.Element;
|
|
241
257
|
|
|
242
|
-
declare
|
|
258
|
+
declare function CanvasContext({ canvas, children }: {
|
|
243
259
|
canvas: string;
|
|
244
|
-
|
|
260
|
+
children: ReactNode;
|
|
261
|
+
}): JSX.Element;
|
|
245
262
|
|
|
246
|
-
declare
|
|
263
|
+
declare function CollectionContext({ collection, children }: {
|
|
247
264
|
collection: string;
|
|
248
|
-
|
|
265
|
+
children: ReactNode;
|
|
266
|
+
}): JSX.Element;
|
|
249
267
|
|
|
250
|
-
declare
|
|
268
|
+
declare function ManifestContext({ manifest, children }: {
|
|
251
269
|
manifest: string;
|
|
252
|
-
|
|
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;
|
|
320
|
+
|
|
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;
|
|
253
327
|
|
|
254
|
-
declare
|
|
328
|
+
declare function RangeContext({ range, children }: {
|
|
255
329
|
range: string;
|
|
256
|
-
|
|
330
|
+
children: ReactNode;
|
|
331
|
+
}): JSX.Element;
|
|
257
332
|
|
|
258
333
|
declare type ResourceContextType = {
|
|
259
334
|
collection?: string;
|
|
@@ -264,20 +339,22 @@ declare type ResourceContextType = {
|
|
|
264
339
|
};
|
|
265
340
|
declare const ResourceReactContext: React__default.Context<ResourceContextType>;
|
|
266
341
|
declare const useResourceContext: () => ResourceContextType;
|
|
267
|
-
declare
|
|
342
|
+
declare function ResourceProvider({ value, children }: {
|
|
268
343
|
value: ResourceContextType;
|
|
269
|
-
|
|
344
|
+
children: ReactNode;
|
|
345
|
+
}): JSX.Element;
|
|
270
346
|
|
|
271
347
|
declare const ReactVaultContext: React__default.Context<{
|
|
272
348
|
vault: Vault | null;
|
|
273
349
|
setVaultInstance: (vault: Vault) => void;
|
|
274
350
|
}>;
|
|
275
|
-
declare
|
|
351
|
+
declare function VaultProvider({ vault, vaultOptions, useGlobal, resources, children, }: {
|
|
276
352
|
vault?: Vault;
|
|
277
353
|
useGlobal?: boolean;
|
|
278
354
|
vaultOptions?: VaultOptions;
|
|
279
355
|
resources?: ResourceContextType;
|
|
280
|
-
|
|
356
|
+
children: ReactNode;
|
|
357
|
+
}): JSX.Element;
|
|
281
358
|
|
|
282
359
|
declare function useContextBridge(): {
|
|
283
360
|
VaultContext: {
|
|
@@ -296,9 +373,10 @@ declare function useContextBridge(): {
|
|
|
296
373
|
};
|
|
297
374
|
VisibleCanvasReactContext: string[];
|
|
298
375
|
};
|
|
299
|
-
declare
|
|
376
|
+
declare function ContextBridge(props: {
|
|
300
377
|
bridge: ReturnType<typeof useContextBridge>;
|
|
301
|
-
|
|
378
|
+
children: ReactNode;
|
|
379
|
+
}): JSX.Element;
|
|
302
380
|
|
|
303
381
|
declare const VisibleCanvasReactContext: React__default.Context<string[]>;
|
|
304
382
|
declare function useVisibleCanvases(): CanvasNormalized[];
|
|
@@ -488,7 +566,7 @@ declare function VirtualAnnotationProvider({ children }: {
|
|
|
488
566
|
|
|
489
567
|
declare type SupportedTarget = {
|
|
490
568
|
type: 'SpecificResource';
|
|
491
|
-
source: ExternalWebResource | {
|
|
569
|
+
source: ExternalWebResource$1 | {
|
|
492
570
|
id: string;
|
|
493
571
|
type: 'Unknown' | 'Canvas' | 'Range' | 'Manifest';
|
|
494
572
|
partOf?: Array<{
|
|
@@ -527,10 +605,11 @@ declare type SimpleViewerContext = {
|
|
|
527
605
|
previousCanvas: () => void;
|
|
528
606
|
};
|
|
529
607
|
declare const SimpleViewerReactContext: React__default.Context<SimpleViewerContext>;
|
|
530
|
-
declare
|
|
608
|
+
declare function SimpleViewerProvider(props: {
|
|
531
609
|
manifest: string;
|
|
532
610
|
pagingEnabled?: boolean;
|
|
533
|
-
|
|
611
|
+
children: ReactNode;
|
|
612
|
+
}): JSX.Element;
|
|
534
613
|
declare function useSimpleViewer(): SimpleViewerContext;
|
|
535
614
|
|
|
536
|
-
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 };
|