react-iiif-vault 1.3.6 → 1.5.0
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 +192 -44
- package/dist/bundle.global.js +30 -28
- package/dist/canvas-panel.cjs +7 -7
- package/dist/canvas-panel.d.cts +2 -3
- package/dist/canvas-panel.d.ts +2 -3
- package/dist/canvas-panel.js +1 -1
- package/dist/chunk-LXMMN7PH.js +48 -0
- package/dist/chunk-PCXRCBVF.js +1 -0
- package/dist/{index-B6kdyv-j.d.cts → index-Cs7EchlV.d.cts} +43 -34
- package/dist/{index-D1lST-Xy.d.ts → index-DZK6q9iO.d.ts} +43 -34
- package/dist/index.cjs +9 -9
- package/dist/index.d.cts +142 -18
- package/dist/index.d.ts +142 -18
- package/dist/index.js +1 -1
- package/dist/{useRenderingStrategy-2EaRC2Nc.d.cts → useRenderingStrategy-B03X9rQS.d.cts} +15 -2
- package/dist/{useRenderingStrategy-2EaRC2Nc.d.ts → useRenderingStrategy-B03X9rQS.d.ts} +15 -2
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.cts +4 -3
- package/dist/utils.d.ts +4 -3
- package/dist/utils.js +1 -1
- package/package.json +4 -5
- package/dist/chunk-HGERM6K7.js +0 -48
- package/dist/chunk-UFC4ZSNV.js +0 -1
package/dist/bundle.d.ts
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
|
-
import React__default, { ReactNode, FC, RefObject, ForwardRefExoticComponent, RefAttributes, FunctionComponent } from 'react';
|
|
2
|
+
import React__default, { ReactNode, FC, ComponentType, RefObject, ForwardRefExoticComponent, RefAttributes, FunctionComponent, Context } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { AtlasProps, Preset, BoxStyle, ViewerMode } from '@atlas-viewer/atlas';
|
|
5
|
-
import { AnnotationPage, ImageService, ExternalWebResource, InternationalString, Reference, ImageSize, AuthProbeService2, Auth2LocationResource, Auth2SubstituteResource, AuthAccessService2, AuthAccessTokenService2, AuthAccessToken2, SearchServiceQueryParams, SearchServiceSearchResponse, SearchService as SearchService$1, SearchServiceAutocomplete, ContentResource, W3CAnnotationTarget, PointSelector, Annotation } from '@iiif/presentation-3';
|
|
5
|
+
import { AnnotationPage, ImageService as ImageService$1, ExternalWebResource, InternationalString, Reference, ImageSize, AuthProbeService2, Auth2LocationResource, Auth2SubstituteResource, AuthAccessService2, AuthAccessTokenService2, AuthAccessToken2, SearchServiceQueryParams, SearchServiceSearchResponse, SearchService as SearchService$1, SearchServiceAutocomplete, ContentResource, W3CAnnotationTarget, PointSelector, Annotation } from '@iiif/presentation-3';
|
|
6
6
|
import { AnnotationPageNormalized, CanvasNormalized, AnnotationNormalized, CollectionNormalized, ManifestNormalized, RangeNormalized } from '@iiif/presentation-3-normalized';
|
|
7
7
|
import * as _iiif_helpers from '@iiif/helpers';
|
|
8
|
-
import { ChoiceDescription, Paintables, SupportedTarget, ComplexChoice, BoxSelector as BoxSelector$1, TemporalBoxSelector as TemporalBoxSelector$1 } from '@iiif/helpers';
|
|
8
|
+
import { ChoiceDescription, Paintables, SupportedTarget, ComplexChoice, ImageCandidate, BoxSelector as BoxSelector$1, TemporalBoxSelector as TemporalBoxSelector$1, Vault as Vault$1 } from '@iiif/helpers';
|
|
9
9
|
import { BoxSelector, TemporalBoxSelector, TemporalSelector } from '@iiif/helpers/annotation-targets';
|
|
10
10
|
export * from '@iiif/helpers/annotation-targets';
|
|
11
11
|
import * as mitt from 'mitt';
|
|
12
12
|
import { Emitter, EventType, Handler } from 'mitt';
|
|
13
|
-
import { ImageCandidate, RegionParameter, RotationParameter, SizeParameter, ImageServiceLoader, ImageCandidateRequest } from '@atlas-viewer/iiif-image-api';
|
|
14
13
|
import { Vault, VaultOptions, NormalizedEntity, IIIFStore } from '@iiif/helpers/vault';
|
|
14
|
+
import { RegionParameter, RotationParameter, SizeParameter } from '@iiif/parser/image-3';
|
|
15
15
|
import * as polygon_editor from 'polygon-editor';
|
|
16
16
|
import { RenderState, InputShape, SlowState } from 'polygon-editor';
|
|
17
17
|
import * as zustand_vanilla from 'zustand/vanilla';
|
|
18
18
|
import { StoreApi } from 'zustand/vanilla';
|
|
19
19
|
import * as zustand from 'zustand';
|
|
20
20
|
import { StoreApi as StoreApi$1 } from 'zustand';
|
|
21
|
+
import { ImageServiceLoader, ImageCandidateRequest, ImageCandidate as ImageCandidate$1 } from '@iiif/helpers/image-service';
|
|
21
22
|
import * as _iiif_helpers_painting_annotations from '@iiif/helpers/painting-annotations';
|
|
22
23
|
import { Paintables as Paintables$1 } from '@iiif/helpers/painting-annotations';
|
|
23
24
|
import { VaultZustandStore } from '@iiif/helpers/vault/store';
|
|
@@ -53,7 +54,7 @@ type ImageWithOptionalService = {
|
|
|
53
54
|
id: string;
|
|
54
55
|
annotationId: string;
|
|
55
56
|
type: 'Image';
|
|
56
|
-
service?: ImageService;
|
|
57
|
+
service?: ImageService$1;
|
|
57
58
|
width?: number;
|
|
58
59
|
height?: number;
|
|
59
60
|
sizes?: Array<{
|
|
@@ -114,8 +115,14 @@ type AnnotationPageDescription = {
|
|
|
114
115
|
type ImageServiceLoaderType = (imageService: any | undefined, { height, width }: {
|
|
115
116
|
height: number;
|
|
116
117
|
width: number;
|
|
117
|
-
}) => ImageService | undefined;
|
|
118
|
-
declare function useLoadImageService(): readonly [ImageServiceLoaderType, Record<string,
|
|
118
|
+
}) => ImageService$1 | undefined;
|
|
119
|
+
declare function useLoadImageService(): readonly [ImageServiceLoaderType, Record<string, {
|
|
120
|
+
status: "error" | "loading" | "done";
|
|
121
|
+
service: ImageService$1 | null;
|
|
122
|
+
error?: boolean | undefined;
|
|
123
|
+
errorMesage?: string | undefined;
|
|
124
|
+
real?: boolean | undefined;
|
|
125
|
+
}>];
|
|
119
126
|
|
|
120
127
|
type SingleImageStrategy = {
|
|
121
128
|
type: 'images';
|
|
@@ -153,6 +160,13 @@ type MediaStrategy = {
|
|
|
153
160
|
media: SingleAudio | SingleVideo | AudioSequence | VideoSequence | SingleYouTubeVideo;
|
|
154
161
|
choice?: ChoiceDescription;
|
|
155
162
|
annotations?: AnnotationPageDescription;
|
|
163
|
+
captions?: Array<{
|
|
164
|
+
id: string;
|
|
165
|
+
type: string;
|
|
166
|
+
format: string;
|
|
167
|
+
label?: InternationalString;
|
|
168
|
+
language?: string;
|
|
169
|
+
}>;
|
|
156
170
|
};
|
|
157
171
|
type ComplexTimelineStrategy = {
|
|
158
172
|
type: 'complex-timeline';
|
|
@@ -215,6 +229,38 @@ type UseRenderingStrategyOptions = {
|
|
|
215
229
|
};
|
|
216
230
|
declare function useRenderingStrategy(options?: UseRenderingStrategyOptions): UseRenderingStrategy;
|
|
217
231
|
|
|
232
|
+
interface AudioComponentProps {
|
|
233
|
+
media: SingleAudio;
|
|
234
|
+
startTime?: number | null;
|
|
235
|
+
children: ReactNode;
|
|
236
|
+
}
|
|
237
|
+
declare function AudioHTML({ media, startTime, children }: AudioComponentProps): react_jsx_runtime.JSX.Element;
|
|
238
|
+
declare function Audio({ media, mediaControlsDeps, audioCopmonent, children, }: {
|
|
239
|
+
media: SingleAudio;
|
|
240
|
+
mediaControlsDeps?: any[];
|
|
241
|
+
children: ReactNode;
|
|
242
|
+
audioCopmonent?: ComponentType<AudioComponentProps>;
|
|
243
|
+
}): null;
|
|
244
|
+
|
|
245
|
+
interface VideoComponentProps {
|
|
246
|
+
element: RefObject<HTMLVideoElement>;
|
|
247
|
+
media: SingleVideo;
|
|
248
|
+
playPause: () => void;
|
|
249
|
+
canvas: CanvasNormalized;
|
|
250
|
+
poster?: string;
|
|
251
|
+
startTime?: number;
|
|
252
|
+
captions?: MediaStrategy['captions'];
|
|
253
|
+
}
|
|
254
|
+
declare function VideoHTML({ element, media, startTime, playPause, poster }: VideoComponentProps): react_jsx_runtime.JSX.Element;
|
|
255
|
+
declare function Video({ media, mediaControlsDeps, children, videoComponent, captions, }: {
|
|
256
|
+
media: SingleVideo;
|
|
257
|
+
mediaControlsDeps?: any[];
|
|
258
|
+
children: ReactNode;
|
|
259
|
+
posterCanvasId?: string;
|
|
260
|
+
videoComponent?: ComponentType<VideoComponentProps>;
|
|
261
|
+
captions?: MediaStrategy['captions'];
|
|
262
|
+
}): null;
|
|
263
|
+
|
|
218
264
|
type CanvasProps = {
|
|
219
265
|
x?: number;
|
|
220
266
|
y?: number;
|
|
@@ -232,6 +278,7 @@ type CanvasProps = {
|
|
|
232
278
|
viewControlsDeps?: any[];
|
|
233
279
|
renderMediaControls?: (strategy: MediaStrategy) => ReactNode;
|
|
234
280
|
renderComplexTimelineControls?: (strategy: ComplexTimelineStrategy) => ReactNode;
|
|
281
|
+
complexTimelineControlsDeps?: any[];
|
|
235
282
|
mediaControlsDeps?: any[];
|
|
236
283
|
strategies?: Array<RenderingStrategy['type']>;
|
|
237
284
|
backgroundStyle?: BoxStyle;
|
|
@@ -241,8 +288,12 @@ type CanvasProps = {
|
|
|
241
288
|
ignoreSize?: boolean;
|
|
242
289
|
throwOnUnknown?: boolean;
|
|
243
290
|
onClickPaintingAnnotation?: (id: string, image: ImageWithOptionalService, e: any) => void;
|
|
291
|
+
components?: {
|
|
292
|
+
Video?: React__default.ComponentType<VideoComponentProps>;
|
|
293
|
+
Audio?: React__default.ComponentType<AudioComponentProps>;
|
|
294
|
+
};
|
|
244
295
|
};
|
|
245
|
-
declare function RenderCanvas({ x, y, onChoiceChange, registerActions, defaultChoices, isStatic, renderViewerControls, renderMediaControls, renderComplexTimelineControls, viewControlsDeps, mediaControlsDeps, strategies, throwOnUnknown, backgroundStyle, alwaysShowBackground, keepCanvasScale, enableSizes, enableYouTube, onClickPaintingAnnotation, children, }: CanvasProps): react_jsx_runtime.JSX.Element
|
|
296
|
+
declare function RenderCanvas({ x, y, onChoiceChange, registerActions, defaultChoices, isStatic, renderViewerControls, renderMediaControls, renderComplexTimelineControls, complexTimelineControlsDeps, viewControlsDeps, mediaControlsDeps, strategies, throwOnUnknown, backgroundStyle, alwaysShowBackground, keepCanvasScale, enableSizes, enableYouTube, onClickPaintingAnnotation, components, children, }: CanvasProps): react_jsx_runtime.JSX.Element;
|
|
246
297
|
|
|
247
298
|
declare function RenderImage({ id, image, thumbnail, isStatic, x, y, children, selector, onClick, enableSizes, }: {
|
|
248
299
|
id: string;
|
|
@@ -305,33 +356,6 @@ type SimpleViewerActionsType = {
|
|
|
305
356
|
};
|
|
306
357
|
}[keyof SimpleViewerActions];
|
|
307
358
|
|
|
308
|
-
declare function AudioHTML({ media, startTime, children, }: {
|
|
309
|
-
media: SingleAudio;
|
|
310
|
-
startTime?: number | null;
|
|
311
|
-
children: ReactNode;
|
|
312
|
-
}): react_jsx_runtime.JSX.Element;
|
|
313
|
-
declare function Audio({ media, mediaControlsDeps, children, }: {
|
|
314
|
-
media: SingleAudio;
|
|
315
|
-
mediaControlsDeps?: any[];
|
|
316
|
-
children: ReactNode;
|
|
317
|
-
}): null;
|
|
318
|
-
|
|
319
|
-
interface VideoComponentProps {
|
|
320
|
-
element: RefObject<HTMLVideoElement>;
|
|
321
|
-
media: SingleVideo;
|
|
322
|
-
playPause: () => void;
|
|
323
|
-
poster?: string;
|
|
324
|
-
startTime?: number;
|
|
325
|
-
}
|
|
326
|
-
declare function VideoHTML({ element, media, startTime, playPause, poster }: VideoComponentProps): react_jsx_runtime.JSX.Element;
|
|
327
|
-
declare function Video({ media, mediaControlsDeps, children, videoComponent, }: {
|
|
328
|
-
media: SingleVideo;
|
|
329
|
-
mediaControlsDeps?: any[];
|
|
330
|
-
children: ReactNode;
|
|
331
|
-
posterCanvasId?: string;
|
|
332
|
-
videoComponent?: FC<VideoComponentProps>;
|
|
333
|
-
}): null;
|
|
334
|
-
|
|
335
359
|
declare function ModelHTML({ model }: {
|
|
336
360
|
model: any;
|
|
337
361
|
}): react_jsx_runtime.JSX.Element;
|
|
@@ -383,6 +407,81 @@ type CanvasPanelType = ForwardRefExoticComponent<CanvasPanelProps & RefAttribute
|
|
|
383
407
|
};
|
|
384
408
|
declare const CanvasPanel: CanvasPanelType;
|
|
385
409
|
|
|
410
|
+
interface CanvasStrategyProviderProps {
|
|
411
|
+
onChoiceChange?: (choice?: ChoiceDescription) => void;
|
|
412
|
+
strategies?: Array<RenderingStrategy['type']>;
|
|
413
|
+
registerActions?: (actions: StrategyActions) => void;
|
|
414
|
+
defaultChoices?: Array<{
|
|
415
|
+
id: string;
|
|
416
|
+
opacity?: number;
|
|
417
|
+
}>;
|
|
418
|
+
children: ReactNode;
|
|
419
|
+
renderMediaControls?: (strategy: MediaStrategy) => ReactNode;
|
|
420
|
+
viewControlsDeps?: any[];
|
|
421
|
+
renderViewerControls?: (strategy: SingleImageStrategy | EmptyStrategy) => ReactNode;
|
|
422
|
+
renderComplexTimelineControls?: (strategy: ComplexTimelineStrategy) => ReactNode;
|
|
423
|
+
complexTimelineControlsDeps?: any[];
|
|
424
|
+
mediaControlsDeps?: any[];
|
|
425
|
+
throwOnUnknown?: boolean;
|
|
426
|
+
}
|
|
427
|
+
declare function CanvasStrategyProvider({ strategies, registerActions, defaultChoices, onChoiceChange, mediaControlsDeps, renderMediaControls, renderViewerControls, viewControlsDeps, renderComplexTimelineControls, complexTimelineControlsDeps, throwOnUnknown, children, }: CanvasStrategyProviderProps): react_jsx_runtime.JSX.Element;
|
|
428
|
+
|
|
429
|
+
interface CanvasWorldObjectProps {
|
|
430
|
+
x?: number;
|
|
431
|
+
y?: number;
|
|
432
|
+
keepCanvasScale?: boolean;
|
|
433
|
+
children?: ReactNode;
|
|
434
|
+
}
|
|
435
|
+
declare function CanvasWorldObject({ x, y, keepCanvasScale, children }: CanvasWorldObjectProps): react_jsx_runtime.JSX.Element | null;
|
|
436
|
+
|
|
437
|
+
declare function ThumbnailFallbackImage({ x, y }: {
|
|
438
|
+
x?: number;
|
|
439
|
+
y?: number;
|
|
440
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
441
|
+
|
|
442
|
+
interface RenderEmptyStrategyProps {
|
|
443
|
+
backgroundStyle?: BoxStyle;
|
|
444
|
+
alwaysShowBackground?: boolean;
|
|
445
|
+
}
|
|
446
|
+
declare function RenderEmptyStrategy({ backgroundStyle, alwaysShowBackground }: RenderEmptyStrategyProps): react_jsx_runtime.JSX.Element | null;
|
|
447
|
+
|
|
448
|
+
declare function RenderComplexTimelineStrategy(): react_jsx_runtime.JSX.Element | null;
|
|
449
|
+
|
|
450
|
+
interface TextualContextStrategyProps {
|
|
451
|
+
onClickPaintingAnnotation?: (id: string, e: any) => void;
|
|
452
|
+
children?: ReactNode;
|
|
453
|
+
}
|
|
454
|
+
declare function RenderTextualContentStrategy({ onClickPaintingAnnotation, children }: TextualContextStrategyProps): react_jsx_runtime.JSX.Element | null;
|
|
455
|
+
|
|
456
|
+
interface ImageStrategyProps {
|
|
457
|
+
isStatic?: boolean;
|
|
458
|
+
enableSizes?: boolean;
|
|
459
|
+
onClickPaintingAnnotation?: (id: string, image: ImageWithOptionalService, e: any) => void;
|
|
460
|
+
children?: ReactNode;
|
|
461
|
+
}
|
|
462
|
+
declare function RenderImageStrategy({ isStatic, enableSizes, onClickPaintingAnnotation, children, }: ImageStrategyProps): react_jsx_runtime.JSX.Element | null;
|
|
463
|
+
|
|
464
|
+
declare function Render3DModelStrategy(): react_jsx_runtime.JSX.Element | null;
|
|
465
|
+
|
|
466
|
+
interface AnnotationStrategyProps {
|
|
467
|
+
children?: ReactNode;
|
|
468
|
+
}
|
|
469
|
+
declare function RenderAnnotationStrategy({ children }: AnnotationStrategyProps): react_jsx_runtime.JSX.Element | null;
|
|
470
|
+
|
|
471
|
+
interface RenderAudioStrategyProps {
|
|
472
|
+
as?: React.ComponentType<AudioComponentProps>;
|
|
473
|
+
}
|
|
474
|
+
declare function RenderAudioStrategy({ as: CustomAudio }: RenderAudioStrategyProps): react_jsx_runtime.JSX.Element | null;
|
|
475
|
+
|
|
476
|
+
declare function RenderAccompanyingCanvas(): react_jsx_runtime.JSX.Element;
|
|
477
|
+
|
|
478
|
+
interface RenderVideoStrategyProps {
|
|
479
|
+
as?: React__default.ComponentType<VideoComponentProps>;
|
|
480
|
+
}
|
|
481
|
+
declare function RenderVideoStrategy({ as: CustomVideo }: RenderVideoStrategyProps): react_jsx_runtime.JSX.Element | null;
|
|
482
|
+
|
|
483
|
+
declare function RenderYouTubeStrategy(): react_jsx_runtime.JSX.Element | null;
|
|
484
|
+
|
|
386
485
|
declare const CanvasAnnotations: React$1.ForwardRefExoticComponent<{
|
|
387
486
|
canvasId?: string | undefined;
|
|
388
487
|
} & React$1.RefAttributes<{
|
|
@@ -436,7 +535,7 @@ type CombinedMetadataProps = Omit<MetadataProps, 'metadata'>;
|
|
|
436
535
|
declare function CombinedMetadata(props: CombinedMetadataProps): react_jsx_runtime.JSX.Element;
|
|
437
536
|
|
|
438
537
|
interface ImageProps {
|
|
439
|
-
src: string | ImageService;
|
|
538
|
+
src: string | ImageService$1;
|
|
440
539
|
alt?: string;
|
|
441
540
|
size?: Partial<ImageSize>;
|
|
442
541
|
region?: RegionParameter;
|
|
@@ -671,6 +770,21 @@ interface PolygonSelectorProps {
|
|
|
671
770
|
}
|
|
672
771
|
declare function PolygonSelector(props: PolygonSelectorProps): react_jsx_runtime.JSX.Element | null;
|
|
673
772
|
|
|
773
|
+
interface ImageServiceProps {
|
|
774
|
+
src: string;
|
|
775
|
+
atlas?: AtlasProps;
|
|
776
|
+
errorFallback?: React__default.FC;
|
|
777
|
+
interactive?: boolean;
|
|
778
|
+
skipSizes?: boolean;
|
|
779
|
+
renderViewerControls?: (strategy: SingleImageStrategy | EmptyStrategy) => ReactNode;
|
|
780
|
+
viewControlsDeps?: any[];
|
|
781
|
+
fluid?: boolean;
|
|
782
|
+
x?: number;
|
|
783
|
+
y?: number;
|
|
784
|
+
children?: React__default.ReactNode;
|
|
785
|
+
}
|
|
786
|
+
declare function ImageService({ src, errorFallback, interactive, skipSizes, children, renderViewerControls, viewControlsDeps, fluid, x, y, ...atlasProps }: ImageServiceProps & Omit<AtlasProps, 'children'>): react_jsx_runtime.JSX.Element | null;
|
|
787
|
+
|
|
674
788
|
declare function AnnotationContext({ annotation, children }: {
|
|
675
789
|
annotation: string;
|
|
676
790
|
children: ReactNode;
|
|
@@ -956,6 +1070,20 @@ interface Search1Store {
|
|
|
956
1070
|
nextResult: () => void;
|
|
957
1071
|
}
|
|
958
1072
|
|
|
1073
|
+
declare function useCustomContextBridge(): Record<string, {
|
|
1074
|
+
value: any;
|
|
1075
|
+
Provider: React__default.Provider<any>;
|
|
1076
|
+
}>;
|
|
1077
|
+
declare function CustomContextBridge(props: Record<string, {
|
|
1078
|
+
value: any;
|
|
1079
|
+
Provider: React__default.Provider<any>;
|
|
1080
|
+
}> & {
|
|
1081
|
+
children: React__default.ReactNode;
|
|
1082
|
+
}): ReactNode;
|
|
1083
|
+
declare function CustomContextBridgeProvider(props: {
|
|
1084
|
+
providers: Record<string, Context<any>>;
|
|
1085
|
+
children: React__default.ReactNode;
|
|
1086
|
+
}): react_jsx_runtime.JSX.Element;
|
|
959
1087
|
declare function useContextBridge(): {
|
|
960
1088
|
VaultContext: {
|
|
961
1089
|
vault: _iiif_helpers.Vault | null;
|
|
@@ -972,6 +1100,7 @@ declare function useContextBridge(): {
|
|
|
972
1100
|
};
|
|
973
1101
|
declare function ContextBridge(props: {
|
|
974
1102
|
bridge: ReturnType<typeof useContextBridge>;
|
|
1103
|
+
custom?: ReturnType<typeof useCustomContextBridge>;
|
|
975
1104
|
children: ReactNode;
|
|
976
1105
|
}): react_jsx_runtime.JSX.Element;
|
|
977
1106
|
|
|
@@ -1084,6 +1213,24 @@ declare function AnnotationStyleProvider({ theme, children, }: {
|
|
|
1084
1213
|
children: React.ReactNode;
|
|
1085
1214
|
}): react_jsx_runtime.JSX.Element;
|
|
1086
1215
|
|
|
1216
|
+
interface StrategyContext {
|
|
1217
|
+
strategy: RenderingStrategy;
|
|
1218
|
+
choices: ChoiceDescription | null;
|
|
1219
|
+
}
|
|
1220
|
+
declare const StrategyReactContext: React$1.Context<StrategyContext | null>;
|
|
1221
|
+
declare function useStrategy(): StrategyContext;
|
|
1222
|
+
|
|
1223
|
+
interface ControlsContext {
|
|
1224
|
+
renderMediaControls?: (strategy: MediaStrategy) => ReactNode;
|
|
1225
|
+
viewControlsDeps: any[];
|
|
1226
|
+
renderViewerControls?: (strategy: SingleImageStrategy | EmptyStrategy) => ReactNode;
|
|
1227
|
+
mediaControlsDeps: any[];
|
|
1228
|
+
renderComplexTimelineControls?: (strategy: ComplexTimelineStrategy) => ReactNode;
|
|
1229
|
+
complexTimelineControlsDeps: any[];
|
|
1230
|
+
}
|
|
1231
|
+
declare const ControlsReactContext: React$1.Context<ControlsContext | null>;
|
|
1232
|
+
declare function useRenderControls(): ControlsContext;
|
|
1233
|
+
|
|
1087
1234
|
/**
|
|
1088
1235
|
* Parse specific resource.
|
|
1089
1236
|
*
|
|
@@ -1100,17 +1247,18 @@ declare const unknownResponse: UseRenderingStrategy[0];
|
|
|
1100
1247
|
declare const unsupportedStrategy: (reason: string) => UnknownStrategy;
|
|
1101
1248
|
declare const emptyStrategy: (width: number, height: number) => UseRenderingStrategy[0];
|
|
1102
1249
|
|
|
1103
|
-
declare function getVideoStrategy(canvas: CanvasNormalized, paintables: Paintables): UnknownStrategy | MediaStrategy;
|
|
1250
|
+
declare function getVideoStrategy(canvas: CanvasNormalized, paintables: Paintables, vault: Vault$1): UnknownStrategy | MediaStrategy;
|
|
1104
1251
|
|
|
1105
1252
|
interface GetRenderStrategyOptions {
|
|
1106
1253
|
canvas: CanvasNormalized | null | undefined;
|
|
1107
1254
|
paintables: Paintables$1;
|
|
1108
1255
|
supports: string[];
|
|
1109
1256
|
loadImageService: ImageServiceLoaderType;
|
|
1257
|
+
vault: Vault$1;
|
|
1110
1258
|
}
|
|
1111
|
-
declare function getRenderingStrategy({ canvas, paintables, supports, loadImageService }: GetRenderStrategyOptions): RenderingStrategy;
|
|
1259
|
+
declare function getRenderingStrategy({ canvas, paintables, supports, loadImageService, vault, }: GetRenderStrategyOptions): RenderingStrategy;
|
|
1112
1260
|
|
|
1113
|
-
declare function getComplexTimelineStrategy(canvas: CanvasNormalized, paintables: Paintables, loadImageService: ImageServiceLoaderType): ComplexTimelineStrategy;
|
|
1261
|
+
declare function getComplexTimelineStrategy(canvas: CanvasNormalized, paintables: Paintables, loadImageService: ImageServiceLoaderType, vault: Vault$1): ComplexTimelineStrategy;
|
|
1114
1262
|
|
|
1115
1263
|
declare function useAnnotation(options?: {
|
|
1116
1264
|
id: string;
|
|
@@ -1231,7 +1379,7 @@ declare function useExternalManifest(idOrRef: string | {
|
|
|
1231
1379
|
manifest?: ManifestNormalized;
|
|
1232
1380
|
};
|
|
1233
1381
|
|
|
1234
|
-
declare function useImage(service: ImageService | undefined, data?: {
|
|
1382
|
+
declare function useImage(service: ImageService$1 | undefined, data?: {
|
|
1235
1383
|
size?: Partial<ImageSize>;
|
|
1236
1384
|
selector?: RegionParameter;
|
|
1237
1385
|
rotation?: number | RotationParameter;
|
|
@@ -1249,7 +1397,7 @@ interface ImageServiceRequestOptions {
|
|
|
1249
1397
|
* @note It is better to use the hook useRenderingStrategy for rendering.
|
|
1250
1398
|
*/
|
|
1251
1399
|
declare function useImageService({ cacheKey }?: ImageServiceRequestOptions): {
|
|
1252
|
-
data: ImageService | undefined;
|
|
1400
|
+
data: ImageService$1 | undefined;
|
|
1253
1401
|
isFetching: boolean;
|
|
1254
1402
|
status: 'error' | 'success' | 'loading' | 'idle';
|
|
1255
1403
|
};
|
|
@@ -1260,7 +1408,7 @@ declare function useImageTile(): {
|
|
|
1260
1408
|
id: string | undefined;
|
|
1261
1409
|
width: number | null | undefined;
|
|
1262
1410
|
height: number | null | undefined;
|
|
1263
|
-
imageService: ImageService;
|
|
1411
|
+
imageService: ImageService$1;
|
|
1264
1412
|
thumbnail: undefined;
|
|
1265
1413
|
} | null;
|
|
1266
1414
|
};
|
|
@@ -1310,7 +1458,7 @@ declare function useStyles<Style extends Record<string, any>>(resource: undefine
|
|
|
1310
1458
|
declare function useThumbnail(request: ImageCandidateRequest, dereference?: boolean, { canvasId, manifestId }?: {
|
|
1311
1459
|
canvasId?: string;
|
|
1312
1460
|
manifestId?: string;
|
|
1313
|
-
}): ImageCandidate | undefined;
|
|
1461
|
+
}): ImageCandidate$1 | undefined;
|
|
1314
1462
|
|
|
1315
1463
|
declare const useVault: () => Vault;
|
|
1316
1464
|
|
|
@@ -1501,4 +1649,4 @@ declare function findAllCanvasesInRange(vault: Vault, range: RangeNormalized): A
|
|
|
1501
1649
|
declare function findManifestSelectedRange(vault: Vault, manifest: ManifestNormalized, canvasId: string): null | RangeNormalized;
|
|
1502
1650
|
declare function findSelectedRange(vault: Vault, range: RangeNormalized, canvasId: string): null | RangeNormalized;
|
|
1503
1651
|
|
|
1504
|
-
export { AnnotationContext, AnnotationPageContext, type AnnotationPageDescription, AnnotationStyleProvider, type AnnotationStyles, type AnnotationThemeDefinition, type AudioSequence, Auth, type AuthAccessState, type AuthContextActions, type AuthContextCurrentActions, type AuthContextState, AuthProvider, AuthRContext, AuthReactContext, AuthReactContextActions, type AuthState, CanvasAnnotations, CanvasContext, CanvasPanel, type ChoiceEvents, CollectionContext, CombinedMetadata, ComplexTimelineProvider, type ComplexTimelineStrategy, ContextBridge, CreateCustomShape, type CreateCustomShapeProps, type EmptyStrategy, EventsProvider, Image, type ImageProps, ImageServiceLoaderContext, type ImageServiceLoaderType, type ImageServiceRequestOptions, type ImageWithOptionalService, InnerViewerProvider, LanguageProvider, LanguageString, LocaleString, ManifestContext, ManifestMetadata, type MediaPlayerActions, MediaPlayerProvider, type MediaPlayerState, type MediaStrategy, Metadata, type MetadataProps, PolygonSelector, type PolygonSelectorProps, type ProbeStore, RangeContext, ReactEventContext, ReactVaultContext, RenderSvgEditorControls, type RenderingStrategy, type ResourceContextType, ResourceProvider, ResourceReactContext, type ResourceRequestOptions, SelectorControllerProvider, type SelectorHelperEventTypes, SequenceThumbnails, type SimpleViewerActions, type SimpleViewerActionsType, type SimpleViewerContext, type SimpleViewerProps, SimpleViewerProvider, SimpleViewerReactContext, type SimpleViewerReducerState, type Single3DModelStrategy, type SingleAudio, SingleCanvasThumbnail, type SingleImageStrategy, type SingleVideo, type SingleYouTubeVideo, type StrategyActions, type SvgTheme, type TextContent, type TextualContentStrategy, type TimelineKeyframe, TranslationProvider, TransliterationProvider, type UnknownStrategy, type UseRenderingStrategy, type UseRenderingStrategyOptions, type VaultActivatedAnnotation, VaultProvider, type VideoSequence, ViewerPresetContext, VirtualAnnotationProvider, VisibleCanvasReactContext, authDetailsForResource, createAuthStateStore, createProbe, defaultEmitter, emptyActions, emptyStrategy, findAllCanvasesInRange, findFirstCanvasFromRange, findManifestSelectedRange, findSelectedRange, flattenAnnotationPageIds, formatTime, get3dStrategy, getComplexTimelineStrategy, getDefaultAnnotationStyles, getImageStrategy, getManifestSequence, getParsedTargetSelector, getRenderingStrategy, getTextualContentStrategy, getVideoStrategy, getVisibleCanvasesFromCanvasId, hasAuth, makeAccessServiceRequest, makeAccessTokenRequest, parseSpecificResource, svgThemes, unknownResponse, unsupportedStrategy, useAnnotation, useAnnotationPage, useAnnotationPageManager, useAnnotationStyles, useAnnotationsAtTime, useAuthActions, useAuthService, useAuthStore, useAuthToken, useAuthTokens, useCanvas, useCanvasChoices, useCanvasClock, useCanvasSequence, useCanvasStartTime, useCanvasSubset, useClosestLanguage, useCollection, useComplexTimeline, useContextBridge, useCreateLocaleString, useCurrentAuth, useDispatch, useEventEmitter, useEventListener, useExistingVault, useExternalCollection, useExternalManifest, useExternalResource, useIIIFLanguage, useImage, useImageService, useImageServiceLoader, useImageTile, useIsAuthEnabled, useLoadImageService, useLocaleString, useManifest, useMediaActions, useMediaElements, useMediaState, usePaintables, usePaintingAnnotations, usePolygonHelper, useRange, useRenderingStrategy, useResourceContext, useResourceEvents, useResources, useSearchService, useSelectorController, useSelectorEmitter, useSelectorEvents, useSelectorHelper, useSimpleMediaPlayer, useSimpleViewer, useStyleHelper, useStyles, useSvgEditor, useThumbnail, useTranslations, useTransliteration, useVault, useVaultEffect, useVaultSelector, useViewerPreset, useVirtualAnnotationPage, useVirtualAnnotationPageContext, useVisibleCanvases };
|
|
1652
|
+
export { AnnotationContext, AnnotationPageContext, type AnnotationPageDescription, type AnnotationStrategyProps, AnnotationStyleProvider, type AnnotationStyles, type AnnotationThemeDefinition, type AudioSequence, Auth, type AuthAccessState, type AuthContextActions, type AuthContextCurrentActions, type AuthContextState, AuthProvider, AuthRContext, AuthReactContext, AuthReactContextActions, type AuthState, CanvasAnnotations, CanvasContext, CanvasPanel, CanvasStrategyProvider, CanvasWorldObject, type ChoiceEvents, CollectionContext, CombinedMetadata, ComplexTimelineProvider, type ComplexTimelineStrategy, ContextBridge, type ControlsContext, ControlsReactContext, CreateCustomShape, type CreateCustomShapeProps, CustomContextBridge, CustomContextBridgeProvider, type EmptyStrategy, EventsProvider, Image, type ImageProps, ImageService, ImageServiceLoaderContext, type ImageServiceLoaderType, type ImageServiceRequestOptions, type ImageStrategyProps, type ImageWithOptionalService, InnerViewerProvider, LanguageProvider, LanguageString, LocaleString, ManifestContext, ManifestMetadata, type MediaPlayerActions, MediaPlayerProvider, type MediaPlayerState, type MediaStrategy, Metadata, type MetadataProps, PolygonSelector, type PolygonSelectorProps, type ProbeStore, RangeContext, ReactEventContext, ReactVaultContext, Render3DModelStrategy, RenderAccompanyingCanvas, RenderAnnotationStrategy, RenderAudioStrategy, RenderComplexTimelineStrategy, RenderEmptyStrategy, RenderImageStrategy, RenderSvgEditorControls, RenderTextualContentStrategy, RenderVideoStrategy, RenderYouTubeStrategy, type RenderingStrategy, type ResourceContextType, ResourceProvider, ResourceReactContext, type ResourceRequestOptions, SelectorControllerProvider, type SelectorHelperEventTypes, SequenceThumbnails, type SimpleViewerActions, type SimpleViewerActionsType, type SimpleViewerContext, type SimpleViewerProps, SimpleViewerProvider, SimpleViewerReactContext, type SimpleViewerReducerState, type Single3DModelStrategy, type SingleAudio, SingleCanvasThumbnail, type SingleImageStrategy, type SingleVideo, type SingleYouTubeVideo, type StrategyActions, type StrategyContext, StrategyReactContext, type SvgTheme, type TextContent, type TextualContentStrategy, ThumbnailFallbackImage, type TimelineKeyframe, TranslationProvider, TransliterationProvider, type UnknownStrategy, type UseRenderingStrategy, type UseRenderingStrategyOptions, type VaultActivatedAnnotation, VaultProvider, type VideoSequence, ViewerPresetContext, VirtualAnnotationProvider, VisibleCanvasReactContext, authDetailsForResource, createAuthStateStore, createProbe, defaultEmitter, emptyActions, emptyStrategy, findAllCanvasesInRange, findFirstCanvasFromRange, findManifestSelectedRange, findSelectedRange, flattenAnnotationPageIds, formatTime, get3dStrategy, getComplexTimelineStrategy, getDefaultAnnotationStyles, getImageStrategy, getManifestSequence, getParsedTargetSelector, getRenderingStrategy, getTextualContentStrategy, getVideoStrategy, getVisibleCanvasesFromCanvasId, hasAuth, makeAccessServiceRequest, makeAccessTokenRequest, parseSpecificResource, svgThemes, unknownResponse, unsupportedStrategy, useAnnotation, useAnnotationPage, useAnnotationPageManager, useAnnotationStyles, useAnnotationsAtTime, useAuthActions, useAuthService, useAuthStore, useAuthToken, useAuthTokens, useCanvas, useCanvasChoices, useCanvasClock, useCanvasSequence, useCanvasStartTime, useCanvasSubset, useClosestLanguage, useCollection, useComplexTimeline, useContextBridge, useCreateLocaleString, useCurrentAuth, useCustomContextBridge, useDispatch, useEventEmitter, useEventListener, useExistingVault, useExternalCollection, useExternalManifest, useExternalResource, useIIIFLanguage, useImage, useImageService, useImageServiceLoader, useImageTile, useIsAuthEnabled, useLoadImageService, useLocaleString, useManifest, useMediaActions, useMediaElements, useMediaState, usePaintables, usePaintingAnnotations, usePolygonHelper, useRange, useRenderControls, useRenderingStrategy, useResourceContext, useResourceEvents, useResources, useSearchService, useSelectorController, useSelectorEmitter, useSelectorEvents, useSelectorHelper, useSimpleMediaPlayer, useSimpleViewer, useStrategy, useStyleHelper, useStyles, useSvgEditor, useThumbnail, useTranslations, useTransliteration, useVault, useVaultEffect, useVaultSelector, useViewerPreset, useVirtualAnnotationPage, useVirtualAnnotationPageContext, useVisibleCanvases };
|