react-iiif-vault 2.0.18 → 4.0.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.
Files changed (67) hide show
  1. package/README.md +77 -1
  2. package/dist/Image-CXsx26cA.d.ts +45 -0
  3. package/dist/Image-g-DyBvi0.d.cts +45 -0
  4. package/dist/ImageStrategy-BHLIi5gd.d.ts +55 -0
  5. package/dist/ImageStrategy-Be9YES5a.d.cts +55 -0
  6. package/dist/SimpleViewerContext.hooks-CTgfe0Gg.d.cts +617 -0
  7. package/dist/SimpleViewerContext.hooks-DYJSrd-U.d.ts +617 -0
  8. package/dist/SimpleViewerContext.types-CWf5OFM7.d.ts +51 -0
  9. package/dist/SimpleViewerContext.types-Df-cpBss.d.cts +51 -0
  10. package/dist/ViewerPresetContext-D7N6KH9p.d.ts +144 -0
  11. package/dist/ViewerPresetContext-DwFTIkDx.d.cts +144 -0
  12. package/dist/bundle.d.ts +290 -196
  13. package/dist/bundle.global.js +45 -74
  14. package/dist/canvas-panel/scene.cjs +1 -0
  15. package/dist/canvas-panel/scene.d.cts +133 -0
  16. package/dist/canvas-panel/scene.d.ts +133 -0
  17. package/dist/canvas-panel/scene.js +1 -0
  18. package/dist/canvas-panel.cjs +1 -47
  19. package/dist/canvas-panel.d.cts +10 -5
  20. package/dist/canvas-panel.d.ts +10 -5
  21. package/dist/canvas-panel.js +1 -1
  22. package/dist/chunk-3XPYQXUE.js +48 -0
  23. package/dist/chunk-6WG6RPHU.js +1 -0
  24. package/dist/chunk-DXC5VCRN.js +1 -0
  25. package/dist/chunk-DZ7DMQ3V.cjs +1 -0
  26. package/dist/chunk-HFC72RK6.js +1 -0
  27. package/dist/chunk-L2GTJVPY.js +1 -0
  28. package/dist/chunk-L576POBV.cjs +2 -0
  29. package/dist/chunk-LKWFF45D.cjs +1 -0
  30. package/dist/chunk-MEQI335A.js +2 -0
  31. package/dist/chunk-MIANDAMK.cjs +1 -0
  32. package/dist/chunk-ND2R7OTX.js +1 -0
  33. package/dist/chunk-R7HZTE2T.cjs +48 -0
  34. package/dist/chunk-WBVFSMED.cjs +1 -0
  35. package/dist/chunk-XULFR6E3.cjs +1 -0
  36. package/dist/chunk-YEU5T67O.js +1 -0
  37. package/dist/chunk-ZBGD3VEW.cjs +1 -0
  38. package/dist/chunk-ZEGT4BAR.cjs +1 -0
  39. package/dist/core.cjs +1 -0
  40. package/dist/core.d.cts +133 -0
  41. package/dist/core.d.ts +133 -0
  42. package/dist/core.js +1 -0
  43. package/dist/{index-DijgVxjb.d.ts → index-ClFUurPI.d.ts} +15 -69
  44. package/dist/{index-DHghDluJ.d.cts → index-QFlDahI_.d.cts} +15 -69
  45. package/dist/index.cjs +1 -49
  46. package/dist/index.d.cts +33 -1496
  47. package/dist/index.d.ts +33 -1496
  48. package/dist/index.js +1 -1
  49. package/dist/presentation-4.cjs +1 -0
  50. package/dist/presentation-4.d.cts +304 -0
  51. package/dist/presentation-4.d.ts +304 -0
  52. package/dist/presentation-4.js +1 -0
  53. package/dist/ranges-Cc2ppjFD.d.ts +689 -0
  54. package/dist/ranges-D-UBNcsJ.d.cts +689 -0
  55. package/dist/{useRenderingStrategy-CoKE915F.d.cts → useRenderingStrategy-Vubk-vUU.d.cts} +47 -24
  56. package/dist/{useRenderingStrategy-CoKE915F.d.ts → useRenderingStrategy-Vubk-vUU.d.ts} +47 -24
  57. package/dist/utils-DHWZGbVU.d.ts +54 -0
  58. package/dist/utils-De5WTLDh.d.cts +54 -0
  59. package/dist/utils.cjs +1 -1
  60. package/dist/utils.d.cts +7 -5
  61. package/dist/utils.d.ts +7 -5
  62. package/dist/utils.js +1 -1
  63. package/package.json +54 -15
  64. package/dist/chunk-KUNXFW7A.js +0 -49
  65. package/dist/chunk-P7XHGETS.js +0 -1
  66. package/dist/utils-BKdiug6F.d.cts +0 -41
  67. package/dist/utils-CmwQWQLa.d.ts +0 -41
package/dist/bundle.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import { TransformPoint, SelectorTransform, BoxStyle as BoxStyle$1, BoxSelector, TemporalBoxSelector, TemporalSelector } from '@iiif/helpers/annotation-targets';
2
2
  export * from '@iiif/helpers/annotation-targets';
3
- import { ViewerMode, Runtime, BoxStyle, AtlasProps, Preset } from '@atlas-viewer/atlas';
3
+ export { PointSelector, SvgSelector, cachedParseCssToBoxStyleMap, convertBoxStyleToSelectorStyle, convertSelectorStyleToBoxStyle, expandTarget, expandTargets, getSelectorTransformAttributes, isImageApiSelector, isValidCanvasFragment, parseCssToBoxStyleMap, parseCssTransform, parseCssTransformOrigin, parseCssTransformStyle, parseRotation, parseSelector, parseWkt, polygonToBoundingBox, resolveSelectorStyle, serializeSupportedSelector, splitCanvasFragment } from '@iiif/helpers/annotation-targets';
4
+ import { ViewerMode, Runtime, BoxStyle, CompositeResourceProps, AtlasProps, Preset } from '@atlas-viewer/atlas';
4
5
  import * as React$1 from 'react';
5
- import React__default, { ReactNode, FC, ComponentType, RefObject, ForwardRefExoticComponent, RefAttributes, FunctionComponent, Context } from 'react';
6
+ import React__default, { ReactNode, FC, ComponentType, RefObject, ComponentProps, ForwardRefExoticComponent, RefAttributes, FunctionComponent, Context, DependencyList } from 'react';
6
7
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
8
  import * as zustand from 'zustand';
8
9
  import { StoreApi } from 'zustand';
@@ -10,20 +11,31 @@ import * as mitt from 'mitt';
10
11
  import { Emitter, EventType, Handler } from 'mitt';
11
12
  import * as polygon_editor from 'polygon-editor';
12
13
  import { RenderState, SlowState, InputShape, ValidTools, createHelper, PolygonEvents } from 'polygon-editor';
14
+ import * as _iiif_helpers_vault_4 from '@iiif/helpers/vault-4';
15
+ import { Vault4 } from '@iiif/helpers/vault-4';
13
16
  import * as _iiif_helpers_vault from '@iiif/helpers/vault';
14
- import { Vault, VaultOptions, NormalizedEntity, IIIFStore } from '@iiif/helpers/vault';
15
- import { Reference, FragmentSelector, SvgSelector, AnnotationPage, ImageService as ImageService$1, ExternalWebResource, InternationalString, MetadataItem, ImageSize, AuthProbeService2, Auth2LocationResource, Auth2SubstituteResource, AuthAccessService2, AuthAccessTokenService2, AuthAccessToken2, SearchServiceQueryParams, SearchServiceSearchResponse, SearchService as SearchService$1, SearchServiceAutocomplete, ContentResource, W3CAnnotationTarget, PointSelector, Annotation } from '@iiif/presentation-3';
17
+ import { Vault, VaultOptions, IIIFStore, NormalizedEntity } from '@iiif/helpers/vault';
18
+ export { Vault } from '@iiif/helpers/vault';
19
+ import { Reference, FragmentSelector, SvgSelector, AnnotationPage, ImageService as ImageService$1, ExternalWebResource, InternationalString, MetadataItem, ImageSize, AuthProbeService2, Auth2LocationResource, Auth2SubstituteResource, AuthAccessService2, AuthAccessTokenService2, AuthAccessToken2, SearchServiceQueryParams, SearchServiceSearchResponse, SearchService as SearchService$1, SearchServiceAutocomplete, PointSelector, ContentResource as ContentResource$1, Annotation } from '@iiif/parser/presentation-3/types';
20
+ export * from '@iiif/parser/presentation-3/types';
21
+ export { ImageService as IIIFImageService, ResourceProvider as IIIFResourceProvider } from '@iiif/parser/presentation-3/types';
22
+ import { CanvasNormalized, AnnotationPageNormalized as AnnotationPageNormalized$1, AnnotationNormalized as AnnotationNormalized$3, ManifestNormalized, RangeNormalized, CollectionNormalized } from '@iiif/parser/presentation-3-normalized/types';
23
+ export * from '@iiif/parser/presentation-3-normalized/types';
24
+ import * as _iiif_parser_presentation_4_normalized_types from '@iiif/parser/presentation-4-normalized/types';
25
+ import { CanvasNormalized as CanvasNormalized$1, TimelineNormalized, AnnotationPageNormalized as AnnotationPageNormalized$2, ManifestNormalized as ManifestNormalized$1, RangeNormalized as RangeNormalized$1 } from '@iiif/parser/presentation-4-normalized/types';
16
26
  import * as zustand_vanilla from 'zustand/vanilla';
17
27
  import { StoreApi as StoreApi$1 } from 'zustand/vanilla';
18
- import { AnnotationPageNormalized, AnnotationNormalized, CanvasNormalized, CollectionNormalized, ManifestNormalized, RangeNormalized } from '@iiif/presentation-3-normalized';
28
+ import * as _iiif_helpers_painting_annotations from '@iiif/helpers/painting-annotations';
29
+ import { Paintables } from '@iiif/helpers/painting-annotations';
19
30
  import * as _iiif_helpers from '@iiif/helpers';
20
- import { ChoiceDescription, Paintables, SupportedTarget, ComplexChoice, ImageCandidate, BoxSelector as BoxSelector$1, TemporalBoxSelector as TemporalBoxSelector$1, SupportedSelector, SvgSelector as SvgSelector$1 } from '@iiif/helpers';
31
+ import { ChoiceDescription, Paintables as Paintables$1, SupportedTarget, ComplexChoice, ImageCandidate, BoxSelector as BoxSelector$1, expandTarget, TemporalBoxSelector as TemporalBoxSelector$1, SupportedSelector, SvgSelector as SvgSelector$1 } from '@iiif/helpers';
21
32
  import { RegionParameter, RotationParameter, SizeParameter } from '@iiif/parser/image-3';
22
33
  import { ImageServiceLoader, ImageCandidateRequest, ImageCandidate as ImageCandidate$1 } from '@iiif/helpers/image-service';
23
- import * as _iiif_helpers_painting_annotations from '@iiif/helpers/painting-annotations';
24
- import { Paintables as Paintables$1 } from '@iiif/helpers/painting-annotations';
34
+ import { ContentResource as ContentResource$2 } from '@iiif/parser/presentation-4/types';
25
35
  import { VaultZustandStore } from '@iiif/helpers/vault/store';
26
36
  import * as _iiif_helpers_styles from '@iiif/helpers/styles';
37
+ export { getManifestSequence, getVisibleCanvasesFromCanvasId } from '@iiif/helpers/sequences';
38
+ export { findAllCanvasesInRange, findFirstCanvasFromRange } from '@iiif/helpers/ranges';
27
39
 
28
40
  type RenderContextProps = {
29
41
  canvasId?: string;
@@ -228,8 +240,21 @@ declare function useSvgEditor(options: SvgEditorOptions): {
228
240
  editor: react_jsx_runtime.JSX.Element | null;
229
241
  };
230
242
 
243
+ type CompatibleCanvas = (CanvasNormalized | CanvasNormalized$1 | TimelineNormalized) & {
244
+ width?: number;
245
+ height?: number;
246
+ duration?: number;
247
+ };
248
+ type CanvasContainerReference = {
249
+ id: string;
250
+ type: 'Canvas' | 'Timeline' | 'Scene';
251
+ };
252
+ type ViewableContainerReference = Pick<CanvasContainerReference, 'id'> & {
253
+ type: 'Canvas' | 'Timeline';
254
+ };
255
+
231
256
  type SimpleViewerContext = {
232
- items: Reference<'Canvas'>[];
257
+ items: ViewableContainerReference[];
233
258
  sequence: number[][];
234
259
  hasNext: boolean;
235
260
  hasPrevious: boolean;
@@ -241,7 +266,7 @@ type SimpleViewerContext = {
241
266
  previousCanvas: () => void;
242
267
  };
243
268
  type SimpleViewerProps = {
244
- vault?: Vault;
269
+ vault?: Vault | _iiif_helpers_vault_4.Vault4;
245
270
  manifest: string;
246
271
  pagingEnabled?: boolean;
247
272
  children: ReactNode;
@@ -498,16 +523,20 @@ declare const RenderAnnotationPage: FC<{
498
523
  page: {
499
524
  id: string;
500
525
  type: string;
501
- } | AnnotationPage | AnnotationPageNormalized;
526
+ } | AnnotationPage | AnnotationPageNormalized$1;
502
527
  className?: string;
503
528
  targetId?: string;
504
529
  ignoreTargetId?: boolean;
505
530
  }>;
506
531
 
532
+ type AnnotationPageNormalized = AnnotationPageNormalized$1 | AnnotationPageNormalized$2;
533
+
534
+ type AnnotationNormalized$2 = Paintables['items'][number]['annotation'];
535
+
507
536
  type ImageWithOptionalService = {
508
537
  id: string;
509
538
  annotationId: string;
510
- annotation: AnnotationNormalized;
539
+ annotation: AnnotationNormalized$2;
511
540
  type: 'Image';
512
541
  service?: ImageService$1;
513
542
  width?: number;
@@ -529,7 +558,7 @@ type ImageWithOptionalService = {
529
558
  type SingleAudio = {
530
559
  type: 'Sound';
531
560
  annotationId: string;
532
- annotation: AnnotationNormalized;
561
+ annotation: AnnotationNormalized$2;
533
562
  url: string;
534
563
  format: string;
535
564
  duration: number;
@@ -542,7 +571,7 @@ type SingleAudio = {
542
571
  type SingleYouTubeVideo = {
543
572
  type: 'VideoYouTube';
544
573
  annotationId: string;
545
- annotation: AnnotationNormalized;
574
+ annotation: AnnotationNormalized$2;
546
575
  url: string;
547
576
  youTubeId: string;
548
577
  duration: number;
@@ -552,7 +581,7 @@ type SingleYouTubeVideo = {
552
581
  type SingleVideo = {
553
582
  type: 'Video';
554
583
  annotationId: string;
555
- annotation: AnnotationNormalized;
584
+ annotation: AnnotationNormalized$2;
556
585
  url: string;
557
586
  format: string;
558
587
  duration: number;
@@ -590,6 +619,18 @@ declare function Audio({ media, mediaControlsDeps, audioCopmonent, children, }:
590
619
  audioCopmonent?: ComponentType<AudioComponentProps>;
591
620
  }): null;
592
621
 
622
+ type AnnotationNormalized$1 = Paintables['items'][number]['annotation'];
623
+
624
+ type Single3DModelStrategy = {
625
+ type: '3d-model';
626
+ model: ExternalWebResource;
627
+ choice?: ChoiceDescription;
628
+ annotations?: AnnotationPageDescription;
629
+ annotation: AnnotationNormalized$1;
630
+ annotationId: string;
631
+ };
632
+ declare function get3dStrategy(canvas: CompatibleCanvas, paintables: Paintables$1): RenderingStrategy;
633
+
593
634
  type ImageServiceLoaderType = (imageService: any | undefined, { height, width }: {
594
635
  height: number;
595
636
  width: number;
@@ -602,15 +643,16 @@ declare function useLoadImageService(): readonly [ImageServiceLoaderType, Record
602
643
  real?: boolean | undefined;
603
644
  }>];
604
645
 
605
- type Single3DModelStrategy = {
606
- type: '3d-model';
607
- model: ExternalWebResource;
646
+ type SingleImageStrategy = {
647
+ type: 'images';
648
+ image: ImageWithOptionalService;
649
+ images: Array<ImageWithOptionalService>;
608
650
  choice?: ChoiceDescription;
609
651
  annotations?: AnnotationPageDescription;
610
- annotation: AnnotationNormalized;
611
- annotationId: string;
612
652
  };
613
- declare function get3dStrategy(canvas: CanvasNormalized, paintables: Paintables): RenderingStrategy;
653
+ declare function getImageStrategy(canvas: CompatibleCanvas, paintables: Paintables$1, loadImageService: ImageServiceLoaderType): SingleImageStrategy | UnknownStrategy;
654
+
655
+ type AnnotationNormalized = Paintables['items'][number]['annotation'];
614
656
 
615
657
  type TextualContentStrategy = {
616
658
  type: 'textual-content';
@@ -625,7 +667,7 @@ type TextContent = {
625
667
  annotationId: string;
626
668
  annotation: AnnotationNormalized;
627
669
  };
628
- declare function getTextualContentStrategy(canvas: CanvasNormalized, paintables: Paintables): RenderingStrategy;
670
+ declare function getTextualContentStrategy(canvas: CompatibleCanvas, paintables: Paintables$1): RenderingStrategy;
629
671
 
630
672
  type MediaStrategy = {
631
673
  type: 'media';
@@ -673,15 +715,6 @@ type UnknownStrategy = {
673
715
  };
674
716
  type RenderingStrategy = SingleImageStrategy | MediaStrategy | ComplexTimelineStrategy | Single3DModelStrategy | TextualContentStrategy | UnknownStrategy | EmptyStrategy;
675
717
 
676
- type SingleImageStrategy = {
677
- type: 'images';
678
- image: ImageWithOptionalService;
679
- images: Array<ImageWithOptionalService>;
680
- choice?: ChoiceDescription;
681
- annotations?: AnnotationPageDescription;
682
- };
683
- declare function getImageStrategy(canvas: CanvasNormalized, paintables: Paintables, loadImageService: ImageServiceLoaderType): SingleImageStrategy | UnknownStrategy;
684
-
685
718
  type StrategyActions = {
686
719
  makeChoice: (id: string, options?: {
687
720
  deselectOthers?: boolean;
@@ -712,17 +745,37 @@ type UseRenderingStrategyOptions = {
712
745
  };
713
746
  declare function useRenderingStrategy(options?: UseRenderingStrategyOptions): UseRenderingStrategy;
714
747
 
748
+ /** Shared image options. Hosts translate legacy skip/disable flags into enable flags. */
749
+ interface ImageOptions {
750
+ isStatic?: boolean;
751
+ enableSizes?: boolean;
752
+ enableThumbnail?: boolean;
753
+ /** Additional, already resolved image candidates (including virtual sizes). */
754
+ imageCandidates?: Array<{
755
+ id: string;
756
+ width: number;
757
+ height: number;
758
+ }>;
759
+ useFloorCalc?: boolean;
760
+ format?: string;
761
+ renderOptions?: CompositeResourceProps;
762
+ style?: {
763
+ opacity?: number;
764
+ [key: string]: unknown;
765
+ };
766
+ }
767
+
715
768
  interface VideoComponentProps {
716
769
  element: RefObject<HTMLVideoElement>;
717
770
  media: SingleVideo;
718
771
  playPause: () => void;
719
- canvas: CanvasNormalized;
772
+ canvas: CompatibleCanvas;
720
773
  poster?: string;
721
774
  startTime?: number;
722
775
  captions?: MediaStrategy['captions'];
723
776
  }
724
777
  declare function VideoHTML({ element, media, startTime, playPause, poster, }: VideoComponentProps): react_jsx_runtime.JSX.Element;
725
- declare function Video({ media, mediaControlsDeps, children, videoComponent, captions, }: {
778
+ declare function Video({ media, mediaControlsDeps, children, posterCanvasId: posterCanvasIdProp, videoComponent, captions, }: {
726
779
  media: SingleVideo;
727
780
  mediaControlsDeps?: any[];
728
781
  children: ReactNode;
@@ -731,12 +784,14 @@ declare function Video({ media, mediaControlsDeps, children, videoComponent, cap
731
784
  captions?: MediaStrategy['captions'];
732
785
  }): null;
733
786
 
734
- type CanvasProps = {
787
+ type CanvasProps = ImageOptions & {
735
788
  x?: number;
736
789
  y?: number;
737
790
  onCreated?: any;
738
791
  onChoiceChange?: (choice?: ChoiceDescription) => void;
739
792
  registerActions?: (actions: StrategyActions) => void;
793
+ emitter?: UseRenderingStrategyOptions["emitter"];
794
+ annotationPageManagerId?: string;
740
795
  defaultChoices?: Array<{
741
796
  id: string;
742
797
  opacity?: number;
@@ -768,13 +823,14 @@ type CanvasProps = {
768
823
  svgTheme?: Partial<SVGTheme>;
769
824
  renderAnnotationContextMenu?: (options: RenderContextProps) => React__default.ReactNode;
770
825
  };
771
- declare function RenderCanvas({ x, y, onChoiceChange, registerActions, defaultChoices, isStatic, renderViewerControls, renderMediaControls, renderComplexTimelineControls, complexTimelineControlsDeps, viewControlsDeps, mediaControlsDeps, strategies, throwOnUnknown, rotation, backgroundStyle, alwaysShowBackground, keepCanvasScale, enableSizes, enableYouTube, onClickPaintingAnnotation, components, children, annotationPopup, svgTheme, renderContextMenu, renderAnnotationContextMenu, }: CanvasProps): react_jsx_runtime.JSX.Element;
826
+ declare function RenderCanvas({ x, y, onChoiceChange, registerActions, emitter, annotationPageManagerId, defaultChoices, isStatic, renderViewerControls, renderMediaControls, renderComplexTimelineControls, complexTimelineControlsDeps, viewControlsDeps, mediaControlsDeps, strategies, throwOnUnknown, rotation, backgroundStyle, alwaysShowBackground, keepCanvasScale, enableSizes, enableThumbnail, imageCandidates, format, useFloorCalc, renderOptions, style, enableYouTube, onClickPaintingAnnotation, components, children, annotationPopup, svgTheme, renderContextMenu, renderAnnotationContextMenu, }: CanvasProps): react_jsx_runtime.JSX.Element;
772
827
 
773
828
  declare function CanvasBackground({ style }: {
774
829
  style?: BoxStyle;
775
830
  }): react_jsx_runtime.JSX.Element | null;
776
831
 
777
- declare function RenderImage({ id, image, thumbnail, isStatic, x, y, children, selector, onClick, rotation: _rotation, enableSizes, enableAnnotations, }: {
832
+ declare function ImageContent({ id, image, thumbnail, isStatic, x, y, children, selector, onClick, rotation: _rotation, enableSizes, enableAnnotations, events, ...options }: ImageOptions & {
833
+ events?: Record<string, unknown>;
778
834
  id: string;
779
835
  image: ImageWithOptionalService;
780
836
  thumbnail?: ImageCandidate;
@@ -788,6 +844,10 @@ declare function RenderImage({ id, image, thumbnail, isStatic, x, y, children, s
788
844
  onClick?: (e: any) => void;
789
845
  rotation?: number;
790
846
  }): react_jsx_runtime.JSX.Element;
847
+ type RenderImageProps = React__default.ComponentProps<typeof ImageContent>;
848
+ declare function RenderImage$1(props: RenderImageProps): react_jsx_runtime.JSX.Element;
849
+
850
+ declare function RenderImage(props: ComponentProps<typeof RenderImage$1>): react_jsx_runtime.JSX.Element;
791
851
 
792
852
  declare function ModelHTML({ model }: {
793
853
  model: any;
@@ -912,6 +972,10 @@ declare function RenderAnnotationEditing({ theme, renderContextMenu, children, }
912
972
  declare function DefaultEditingTools(): react_jsx_runtime.JSX.Element | null;
913
973
 
914
974
  interface CanvasStrategyProviderProps {
975
+ /** Keep default-choice opacity local instead of writing shared Vault metadata. */
976
+ scopedStyles?: boolean;
977
+ emitter?: UseRenderingStrategyOptions["emitter"];
978
+ annotationPageManagerId?: string;
915
979
  onChoiceChange?: (choice?: ChoiceDescription) => void;
916
980
  strategies?: Array<RenderingStrategy['type']>;
917
981
  registerActions?: (actions: StrategyActions) => void;
@@ -928,16 +992,25 @@ interface CanvasStrategyProviderProps {
928
992
  mediaControlsDeps?: any[];
929
993
  throwOnUnknown?: boolean;
930
994
  }
931
- declare function CanvasStrategyProvider({ strategies, registerActions, defaultChoices, onChoiceChange, mediaControlsDeps, renderMediaControls, renderViewerControls, viewControlsDeps, renderComplexTimelineControls, complexTimelineControlsDeps, throwOnUnknown, children, }: CanvasStrategyProviderProps): react_jsx_runtime.JSX.Element;
995
+ declare function CanvasStrategyProvider({ strategies, scopedStyles, emitter, annotationPageManagerId, registerActions, defaultChoices, onChoiceChange, mediaControlsDeps, renderMediaControls, renderViewerControls, viewControlsDeps, renderComplexTimelineControls, complexTimelineControlsDeps, throwOnUnknown, children, }: CanvasStrategyProviderProps): react_jsx_runtime.JSX.Element;
932
996
 
933
997
  interface CanvasWorldObjectProps {
934
998
  x?: number;
935
999
  y?: number;
936
1000
  keepCanvasScale?: boolean;
937
1001
  children?: ReactNode;
938
- renderContextMenu?: (options: RenderContextProps) => ReactNode;
1002
+ events?: Record<string, unknown>;
1003
+ onPositionChange?: (canvasId: string, position: {
1004
+ x: number;
1005
+ y: number;
1006
+ width: number;
1007
+ height: number;
1008
+ } | null) => void;
939
1009
  }
940
- declare function CanvasWorldObject({ x, y, keepCanvasScale, renderContextMenu, children, }: CanvasWorldObjectProps): react_jsx_runtime.JSX.Element | null;
1010
+
1011
+ declare function CanvasWorldObject({ renderContextMenu, children, ...props }: CanvasWorldObjectProps & {
1012
+ renderContextMenu?: (options: RenderContextProps) => ReactNode;
1013
+ }): react_jsx_runtime.JSX.Element;
941
1014
 
942
1015
  declare function ThumbnailFallbackImage({ x, y }: {
943
1016
  x?: number;
@@ -958,7 +1031,9 @@ interface RenderAudioStrategyProps {
958
1031
  }
959
1032
  declare function RenderAudioStrategy({ as: CustomAudio }: RenderAudioStrategyProps): react_jsx_runtime.JSX.Element | null;
960
1033
 
961
- declare function RenderComplexTimelineStrategy(): react_jsx_runtime.JSX.Element | null;
1034
+ declare function RenderComplexTimelineStrategy({ imageOptions }?: {
1035
+ imageOptions?: ImageOptions;
1036
+ }): react_jsx_runtime.JSX.Element | null;
962
1037
 
963
1038
  interface RenderEmptyStrategyProps {
964
1039
  backgroundStyle?: BoxStyle;
@@ -966,7 +1041,7 @@ interface RenderEmptyStrategyProps {
966
1041
  }
967
1042
  declare function RenderEmptyStrategy({ backgroundStyle, alwaysShowBackground }: RenderEmptyStrategyProps): react_jsx_runtime.JSX.Element | null;
968
1043
 
969
- interface ImageStrategyProps {
1044
+ interface ImageStrategyProps extends ImageOptions {
970
1045
  isStatic?: boolean;
971
1046
  enableSizes?: boolean;
972
1047
  enableAnnotations?: boolean;
@@ -974,7 +1049,8 @@ interface ImageStrategyProps {
974
1049
  rotation?: number;
975
1050
  children?: ReactNode;
976
1051
  }
977
- declare function RenderImageStrategy({ isStatic, enableSizes, enableAnnotations, onClickPaintingAnnotation, rotation, children, }: ImageStrategyProps): react_jsx_runtime.JSX.Element | null;
1052
+
1053
+ declare function RenderImageStrategy(props: ImageStrategyProps): react_jsx_runtime.JSX.Element;
978
1054
 
979
1055
  interface TextualContextStrategyProps {
980
1056
  onClickPaintingAnnotation?: (id: string, e: any) => void;
@@ -1172,7 +1248,7 @@ interface SequenceThumbnailsProps {
1172
1248
  fallback?: React.ReactNode;
1173
1249
  scrollBehaviour?: ScrollBehavior;
1174
1250
  }
1175
- declare function SequenceThumbnails({ scrollBehaviour, dereference, flat, size, classes, showLabel, figure, fallback }: SequenceThumbnailsProps): react_jsx_runtime.JSX.Element;
1251
+ declare function SequenceThumbnails({ scrollBehaviour, dereference, flat, size, classes, showLabel, figure, fallback, }: SequenceThumbnailsProps): react_jsx_runtime.JSX.Element;
1176
1252
 
1177
1253
  interface SingleCanvasThumbnailProps {
1178
1254
  canvasId?: string;
@@ -1425,6 +1501,7 @@ interface ComplexTimelineStore extends MediaPlayerActions {
1425
1501
  complexTimeline: ComplexTimelineStrategy;
1426
1502
  visibleElements: Record<string, TimelineKeyframe | null>;
1427
1503
  isReady: boolean;
1504
+ unseekableMedia: string[];
1428
1505
  isBuffering: boolean;
1429
1506
  bufferMap: Record<string, boolean>;
1430
1507
  isMuted: boolean;
@@ -1440,6 +1517,10 @@ interface ComplexTimelineStore extends MediaPlayerActions {
1440
1517
  clockStartRequests: number;
1441
1518
  startClock: () => void;
1442
1519
  stopClock: () => void;
1520
+ playbackError: unknown | null;
1521
+ attachMediaElement: (id: string, element: HTMLMediaElement) => () => void;
1522
+ dispose: () => void;
1523
+ updateTimeline: (timeline: ComplexTimelineStrategy) => void;
1443
1524
  setElement: (id: string, element: HTMLVideoElement | HTMLAudioElement) => void;
1444
1525
  removeElement: (id: string) => void;
1445
1526
  applyKeyframes(newIdx: number, keyframes: TimelineKeyframe[]): void;
@@ -1454,10 +1535,15 @@ declare function ComplexTimelineProvider({ children, store, }: {
1454
1535
  children: React.ReactNode;
1455
1536
  store: StoreApi<ComplexTimelineStore>;
1456
1537
  }): react_jsx_runtime.JSX.Element;
1538
+ declare function useComplexTimelineStore(): StoreApi<ComplexTimelineStore>;
1457
1539
  declare function useComplexTimeline<T>(selector: (store: ComplexTimelineStore) => T): T;
1458
1540
 
1459
1541
  interface StrategyContext {
1460
1542
  strategy: RenderingStrategy;
1543
+ actions?: StrategyActions;
1544
+ imageStyles?: Record<string, {
1545
+ opacity?: number;
1546
+ }>;
1461
1547
  choices: ChoiceDescription | null;
1462
1548
  }
1463
1549
  declare const StrategyReactContext: React$1.Context<StrategyContext | null>;
@@ -1491,6 +1577,8 @@ type ResourceContextType = {
1491
1577
  canvas?: string;
1492
1578
  annotation?: string;
1493
1579
  annotationPage?: string;
1580
+ scene?: string;
1581
+ timeline?: string;
1494
1582
  };
1495
1583
  declare const ResourceReactContext: React__default.Context<ResourceContextType>;
1496
1584
  declare const useResourceContext: () => ResourceContextType;
@@ -1515,8 +1603,8 @@ declare function CustomContextBridgeProvider(props: {
1515
1603
  }): react_jsx_runtime.JSX.Element;
1516
1604
  declare function useContextBridge(): {
1517
1605
  VaultContext: {
1518
- vault: _iiif_helpers.Vault | null;
1519
- setVaultInstance: (vault: _iiif_helpers.Vault) => void;
1606
+ vault: _iiif_helpers.Vault<_iiif_helpers.Vault3TypeMap> | _iiif_helpers_vault_4.Vault4 | null;
1607
+ setVaultInstance: (vault: _iiif_helpers.Vault<_iiif_helpers.Vault3TypeMap> | _iiif_helpers_vault_4.Vault4) => void;
1520
1608
  };
1521
1609
  ResourceContext: ResourceContextType;
1522
1610
  SimpleViewerReactContext: SimpleViewerContext;
@@ -1660,11 +1748,12 @@ declare function useSelectorHelper(): {
1660
1748
  };
1661
1749
 
1662
1750
  declare const ReactVaultContext: React__default.Context<{
1663
- vault: Vault | null;
1664
- setVaultInstance: (vault: Vault) => void;
1751
+ vault: Vault | Vault4 | null;
1752
+ setVaultInstance: (vault: Vault | Vault4) => void;
1665
1753
  }>;
1666
- declare function VaultProvider({ vault, vaultOptions, useGlobal, resources, children, }: {
1667
- vault?: Vault;
1754
+ declare function VaultProvider({ vault, vaultOptions, useGlobal, resources, version, children, }: {
1755
+ vault?: Vault | Vault4;
1756
+ version?: 3 | 4;
1668
1757
  useGlobal?: boolean;
1669
1758
  vaultOptions?: VaultOptions;
1670
1759
  resources?: ResourceContextType;
@@ -1676,6 +1765,7 @@ declare function useViewerPreset(): Preset | null | undefined;
1676
1765
 
1677
1766
  declare const VisibleCanvasReactContext: React__default.Context<string[]>;
1678
1767
  declare function useVisibleCanvases(): CanvasNormalized[];
1768
+ declare function useVisibleCanvasContainers(): CompatibleCanvas[];
1679
1769
 
1680
1770
  type CompatVault = {
1681
1771
  get: _iiif_helpers_vault.Vault['get'];
@@ -1685,17 +1775,18 @@ type CompatVault = {
1685
1775
  requestStatus: _iiif_helpers_vault.Vault['requestStatus'];
1686
1776
  };
1687
1777
 
1688
- declare function getComplexTimelineStrategy(canvas: CanvasNormalized, paintables: Paintables, loadImageService: ImageServiceLoaderType, vault: CompatVault): ComplexTimelineStrategy;
1778
+ declare function getComplexTimelineStrategy(canvas: CompatibleCanvas, paintables: Paintables$1, loadImageService: ImageServiceLoaderType, vault: CompatVault): ComplexTimelineStrategy;
1689
1779
 
1690
1780
  interface GetRenderStrategyOptions {
1691
- canvas: CanvasNormalized | null | undefined;
1692
- paintables: Paintables$1;
1781
+ canvas: CompatibleCanvas | _iiif_parser_presentation_4_normalized_types.SceneNormalized | null | undefined;
1782
+ paintables: Paintables;
1693
1783
  supports: string[];
1694
1784
  loadImageService: ImageServiceLoaderType;
1695
1785
  vault?: CompatVault;
1696
1786
  }
1697
1787
  declare function getRenderingStrategy({ canvas, paintables, supports, loadImageService, vault, }: GetRenderStrategyOptions): RenderingStrategy;
1698
1788
 
1789
+ type ContentResource = ContentResource$1 | ContentResource$2;
1699
1790
  /**
1700
1791
  * Parse specific resource.
1701
1792
  *
@@ -1704,7 +1795,18 @@ declare function getRenderingStrategy({ canvas, paintables, supports, loadImageS
1704
1795
  * @param resource
1705
1796
  */
1706
1797
  declare function parseSpecificResource(resource: ContentResource): any[];
1707
- declare function getParsedTargetSelector(canvas: CanvasNormalized, target: W3CAnnotationTarget | W3CAnnotationTarget[]): [TemporalBoxSelector$1 | BoxSelector$1 | PointSelector | null, SupportedTarget['source']];
1798
+ /** Keep canvas placement and source cropping separate for both audio and video. */
1799
+ declare function getMediaTemporalSelectors(canvas: CompatibleCanvas, item: Paintables$1['items'][number]): {
1800
+ target: {
1801
+ startTime: number;
1802
+ endTime: number;
1803
+ };
1804
+ source: {
1805
+ startTime: number;
1806
+ endTime?: number | undefined;
1807
+ };
1808
+ };
1809
+ declare function getParsedTargetSelector(canvas: CompatibleCanvas, target: Parameters<typeof expandTarget>[0]): [TemporalBoxSelector$1 | BoxSelector$1 | PointSelector | null, SupportedTarget['source']];
1708
1810
  declare const emptyActions: {
1709
1811
  makeChoice: () => void;
1710
1812
  };
@@ -1712,23 +1814,22 @@ declare const unknownResponse: UseRenderingStrategy[0];
1712
1814
  declare const unsupportedStrategy: (reason: string) => UnknownStrategy;
1713
1815
  declare const emptyStrategy: (width: number, height: number) => UseRenderingStrategy[0];
1714
1816
 
1715
- declare function getVideoStrategy(canvas: CanvasNormalized, paintables: Paintables, vault: CompatVault, enforceSpatial?: boolean): UnknownStrategy | MediaStrategy;
1817
+ declare function getVideoStrategy(canvas: CompatibleCanvas, paintables: Paintables$1, vault: CompatVault, enforceSpatial?: boolean): UnknownStrategy | MediaStrategy;
1716
1818
 
1717
- declare function useAnnotation(options?: {
1718
- id: string;
1719
- }): AnnotationNormalized | undefined;
1720
- declare function useAnnotation<T>(options?: {
1721
- id: string;
1722
- selector: (annotation: AnnotationNormalized) => T;
1723
- }, deps?: any[]): T | undefined;
1819
+ type ActiveVault = Vault | Vault4;
1820
+ declare function useActiveVault(): ActiveVault;
1821
+ declare function useVault(): Vault;
1724
1822
 
1725
- declare function useAnnotationPage(options?: {
1726
- id: string;
1727
- }): AnnotationPageNormalized | undefined;
1728
- declare function useAnnotationPage<T>(options?: {
1729
- id: string;
1730
- selector: (annotation: AnnotationPageNormalized) => T;
1731
- }, deps?: any[]): T | undefined;
1823
+ type VaultHooks<TVault extends ActiveVault> = {
1824
+ useVault(): TVault;
1825
+ useExistingVault(vault?: TVault): TVault;
1826
+ useVaultEffect(callback: (vault: TVault) => void, deps?: DependencyList): void;
1827
+ useVaultSelector<T>(selector: (state: IIIFStore, vault: TVault) => T, deps?: DependencyList): T;
1828
+ };
1829
+ /** Creates Vault hooks bound to one Presentation version and rejects a mismatched provider at runtime. */
1830
+ declare function createVaultHooks(): VaultHooks<Vault>;
1831
+ declare function createVaultHooks(version: 3): VaultHooks<Vault>;
1832
+ declare function createVaultHooks(version: 4): VaultHooks<Vault4>;
1732
1833
 
1733
1834
  declare function useAnnotationPageManager(resourceId?: string, options?: {
1734
1835
  all?: boolean;
@@ -1743,15 +1844,7 @@ declare function useAnnotationPageManager(resourceId?: string, options?: {
1743
1844
 
1744
1845
  declare function useAnnotationsAtTime(time: number, options?: {
1745
1846
  canvasId?: string;
1746
- }): AnnotationNormalized[];
1747
-
1748
- declare function useCanvas(options?: {
1749
- id: string;
1750
- }): CanvasNormalized | undefined;
1751
- declare function useCanvas<T>(options?: {
1752
- id: string;
1753
- selector: (canvas: CanvasNormalized) => T;
1754
- }, deps?: any[]): T | undefined;
1847
+ }): AnnotationNormalized$3[];
1755
1848
 
1756
1849
  declare function useCanvasChoices({ canvasId }?: {
1757
1850
  canvasId?: string;
@@ -1777,14 +1870,6 @@ declare function useCanvasStartTime(): {
1777
1870
 
1778
1871
  declare function useCanvasSubset(idsOrRefs?: Array<string | Reference>): Reference<'Canvas'>[];
1779
1872
 
1780
- declare function useCollection(options: {
1781
- id: string;
1782
- }): CollectionNormalized | undefined;
1783
- declare function useCollection<T>(options: {
1784
- id: string;
1785
- selector: (collection: CollectionNormalized) => T;
1786
- }, deps?: any[]): T | undefined;
1787
-
1788
1873
  declare function useCurrentAnnotationActions(): {
1789
1874
  saveAnnotation: () => void;
1790
1875
  cancelRequest: (requestId?: string | undefined) => void;
@@ -1816,8 +1901,6 @@ declare function EventEmitterProvider({ children, emitter, }: {
1816
1901
  declare function useEmitter<Event extends Record<string | symbol, unknown>>(): Emitter<Event>;
1817
1902
  declare function useEvent<Event extends Record<string | symbol, unknown>, Key extends keyof Event>(key: Key, listener: (data: Event[Key]) => void, deps?: any[]): void;
1818
1903
 
1819
- declare function useExistingVault(vault?: Vault): Vault;
1820
-
1821
1904
  type ResourceRequestOptions = {
1822
1905
  noCache?: boolean;
1823
1906
  };
@@ -1830,35 +1913,11 @@ declare function useExternalResource<T extends {
1830
1913
  id: string;
1831
1914
  requestId: string;
1832
1915
  isLoaded: boolean;
1833
- error: any;
1916
+ error: Error | undefined;
1834
1917
  cached: boolean;
1835
1918
  resource?: T;
1836
1919
  };
1837
1920
 
1838
- declare function useExternalCollection(idOrRef: string | {
1839
- id: string;
1840
- type: string;
1841
- }, options?: ResourceRequestOptions): {
1842
- id: string;
1843
- requestId: string;
1844
- isLoaded: boolean;
1845
- cached?: boolean;
1846
- error: any;
1847
- manifest?: CollectionNormalized;
1848
- };
1849
-
1850
- declare function useExternalManifest(idOrRef: string | {
1851
- id: string;
1852
- type: string;
1853
- }, options?: ResourceRequestOptions): {
1854
- id: string;
1855
- requestId: string;
1856
- isLoaded: boolean;
1857
- cached?: boolean;
1858
- error: any;
1859
- manifest?: ManifestNormalized;
1860
- };
1861
-
1862
1921
  declare function useImage(service: ImageService$1 | undefined, data?: {
1863
1922
  size?: Partial<ImageSize>;
1864
1923
  selector?: RegionParameter;
@@ -1871,15 +1930,12 @@ declare function useImage(service: ImageService$1 | undefined, data?: {
1871
1930
  interface ImageServiceRequestOptions {
1872
1931
  cacheKey?: string;
1873
1932
  }
1874
- /**
1875
- * Returns the First image service on the current canvas.
1876
- *
1877
- * @note It is better to use the hook useRenderingStrategy for rendering.
1878
- */
1933
+ /** Returns the first painting image service on the current Canvas. */
1879
1934
  declare function useImageService({ cacheKey }?: ImageServiceRequestOptions): {
1880
1935
  data: ImageService$1 | undefined;
1881
1936
  isFetching: boolean;
1882
1937
  status: 'error' | 'success' | 'loading' | 'idle';
1938
+ error?: Error;
1883
1939
  };
1884
1940
 
1885
1941
  declare function useImageTile(): {
@@ -1893,14 +1949,6 @@ declare function useImageTile(): {
1893
1949
  } | null;
1894
1950
  };
1895
1951
 
1896
- declare function useManifest(options?: {
1897
- id: string;
1898
- }): ManifestNormalized | undefined;
1899
- declare function useManifest<T>(options?: {
1900
- id: string;
1901
- selector: (manifest: ManifestNormalized) => T;
1902
- }, deps?: any[]): T | undefined;
1903
-
1904
1952
  declare function usePaintables(options?: {
1905
1953
  defaultChoices?: string[];
1906
1954
  enableSingleAnnotation?: boolean;
@@ -1914,7 +1962,7 @@ declare function usePaintables(options?: {
1914
1962
  declare function usePaintingAnnotations(options?: {
1915
1963
  canvasId?: string;
1916
1964
  enableSingleAnnotation?: boolean;
1917
- }): AnnotationNormalized[];
1965
+ }): AnnotationNormalized$3[];
1918
1966
 
1919
1967
  declare function usePolygonHelper(render: (t: any, s: any, dt: number) => void): {
1920
1968
  currentShape: polygon_editor.InputShape | null;
@@ -2036,14 +2084,6 @@ declare function usePolygonHelper(render: (t: any, s: any, dt: number) => void):
2036
2084
  };
2037
2085
  };
2038
2086
 
2039
- declare function useRange(options?: {
2040
- id: string;
2041
- }): RangeNormalized | undefined;
2042
- declare function useRange<T>(options?: {
2043
- id: string;
2044
- selector: (range: RangeNormalized) => T;
2045
- }, deps?: any[]): T | undefined;
2046
-
2047
2087
  declare function useStaticRenderingStrategy({ supports }?: {
2048
2088
  supports?: Array<RenderingStrategy['type']>;
2049
2089
  }): RenderingStrategy;
@@ -2125,12 +2165,6 @@ declare function useThumbnail(request: ImageCandidateRequest, dereference?: bool
2125
2165
  manifestId?: string;
2126
2166
  }): ImageCandidate$1 | undefined;
2127
2167
 
2128
- declare const useVault: () => Vault;
2129
-
2130
- declare const useVaultEffect: (callback: (vault: Vault) => void, deps?: any[]) => void;
2131
-
2132
- declare function useVaultSelector<T>(selector: (state: IIIFStore, vault: Vault) => T, deps?: any[]): T;
2133
-
2134
2168
  type Rect = {
2135
2169
  x: number;
2136
2170
  y: number;
@@ -2211,23 +2245,28 @@ interface VaultActivatedAnnotation {
2211
2245
  id: string;
2212
2246
  };
2213
2247
  }
2214
- declare function useVirtualAnnotationPage(): readonly [AnnotationPageNormalized | null, {
2215
- readonly addAnnotation: (id: string | Annotation | VaultActivatedAnnotation | AnnotationNormalized, atIndex?: number) => void;
2216
- readonly removeAnnotation: (id: string | Annotation | VaultActivatedAnnotation | AnnotationNormalized) => void;
2248
+ declare function useVirtualAnnotationPage(): readonly [AnnotationPageNormalized$1 | null, {
2249
+ readonly addAnnotation: (id: string | Annotation | VaultActivatedAnnotation | AnnotationNormalized$3, atIndex?: number) => void;
2250
+ readonly removeAnnotation: (id: string | Annotation | VaultActivatedAnnotation | AnnotationNormalized$3) => void;
2217
2251
  }];
2218
2252
 
2219
- declare function useVirtualAnnotationPageContext(): [AnnotationPageNormalized | null, {
2220
- addAnnotation: (id: string | Annotation | VaultActivatedAnnotation | AnnotationNormalized, atIndex?: number | undefined) => void;
2221
- removeAnnotation: (id: string | Annotation | VaultActivatedAnnotation | AnnotationNormalized) => void;
2253
+ declare function useVirtualAnnotationPageContext(): [AnnotationPageNormalized$1 | null, {
2254
+ addAnnotation: (id: string | Annotation | VaultActivatedAnnotation | AnnotationNormalized$3, atIndex?: number | undefined) => void;
2255
+ removeAnnotation: (id: string | Annotation | VaultActivatedAnnotation | AnnotationNormalized$3) => void;
2222
2256
  }];
2223
2257
  declare function VirtualAnnotationProvider({ children }: {
2224
2258
  children: any;
2225
2259
  }): react_jsx_runtime.JSX.Element;
2226
2260
 
2261
+ type AnnotatedResource = {
2262
+ annotations: readonly {
2263
+ id: string;
2264
+ }[];
2265
+ };
2227
2266
  declare function flattenAnnotationPageIds({ canvas, manifest, all, canvases, }: {
2228
- manifest?: ManifestNormalized;
2229
- canvas?: CanvasNormalized;
2230
- canvases?: CanvasNormalized[];
2267
+ manifest?: AnnotatedResource;
2268
+ canvas?: AnnotatedResource;
2269
+ canvases?: readonly AnnotatedResource[];
2231
2270
  all?: boolean;
2232
2271
  }): string[];
2233
2272
 
@@ -2294,26 +2333,25 @@ declare function isRectangle(points: InputShape['points']): boolean;
2294
2333
 
2295
2334
  declare function isSvgSelector(t: SupportedSelector): t is SvgSelector$1;
2296
2335
  declare function isBoxSelector(t: SupportedSelector): t is BoxSelector$1;
2297
- declare function seraliseSupportedSelector(selector: SupportedSelector, on?: {
2336
+ declare function serialiseSupportedSelector(selector: SupportedSelector, on?: {
2298
2337
  width: number;
2299
2338
  height: number;
2300
2339
  } | null): null | SvgSelector | FragmentSelector;
2340
+ /** @deprecated Use serialiseSupportedSelector (corrected spelling). */
2341
+ declare const seraliseSupportedSelector: typeof serialiseSupportedSelector;
2301
2342
 
2302
2343
  declare const SimpleViewerReactContext: React__default.Context<SimpleViewerContext>;
2303
2344
  declare function InnerViewerProvider(props: SimpleViewerProps): react_jsx_runtime.JSX.Element | null;
2304
2345
  declare function SimpleViewerProvider(props: SimpleViewerProps): react_jsx_runtime.JSX.Element;
2305
2346
  declare function useSimpleViewer(): SimpleViewerContext;
2306
2347
 
2307
- declare function useCanvasSequence({ startCanvas, disablePaging }: {
2348
+ declare function useContainerSequence({ startCanvas, disablePaging }: {
2308
2349
  startCanvas?: string;
2309
2350
  disablePaging?: boolean;
2310
2351
  }): {
2311
2352
  visibleItems: string[];
2312
2353
  cursor: number;
2313
- items: {
2314
- type: "Canvas";
2315
- id: string;
2316
- }[];
2354
+ items: ViewableContainerReference[];
2317
2355
  sequence: number[][];
2318
2356
  hasPrevious: boolean;
2319
2357
  hasNext: boolean;
@@ -2323,47 +2361,103 @@ declare function useCanvasSequence({ startCanvas, disablePaging }: {
2323
2361
  next: () => void;
2324
2362
  previous: () => void;
2325
2363
  };
2364
+ /** @deprecated Use useContainerSequence for Canvas and Timeline navigation. Root imports retain Presentation 3 item types. */
2365
+ declare function useCanvasSequence(options: Parameters<typeof useContainerSequence>[0]): Omit<ReturnType<typeof useContainerSequence>, 'items'> & {
2366
+ items: Reference<'Canvas'>[];
2367
+ };
2326
2368
 
2327
- declare function findFirstCanvasFromRange(vault: Vault, range: RangeNormalized): null | Reference<'Canvas'>;
2328
- declare function findAllCanvasesInRange(vault: Vault, range: RangeNormalized): Array<Reference<'Canvas'>>;
2329
- declare function findManifestSelectedRange(vault: Vault, manifest: ManifestNormalized, canvasId: string): null | RangeNormalized;
2330
- declare function findSelectedRange(vault: Vault, range: RangeNormalized, canvasId: string): null | RangeNormalized;
2369
+ declare function findManifestSelectedRange(vault: Vault, manifest: ManifestNormalized, canvasId: string): RangeNormalized | null;
2370
+ declare function findManifestSelectedRange(vault: Vault4, manifest: ManifestNormalized$1, canvasId: string): RangeNormalized$1 | null;
2371
+ declare function findSelectedRange(vault: Vault, range: RangeNormalized, canvasId: string): RangeNormalized | null;
2372
+ declare function findSelectedRange(vault: Vault4, range: RangeNormalized$1, canvasId: string): RangeNormalized$1 | null;
2331
2373
 
2332
- /**
2333
- * Get visible canvases from canvas ID
2334
- *
2335
- * This function returns a list of canvas references that should all be displayed
2336
- * when the passed canvasId is visible. This should work for individual items,
2337
- * 2-up paged view and continuous (scrolls).
2338
- *
2339
- * The options are listed below (from IIIF docs)
2340
- *
2341
- * - `unordered` - Valid on Collections, Manifests and Ranges. The Canvases included in resources that have this behavior
2342
- * have no inherent order, and user interfaces should avoid implying an order to the user. Disjoint with individuals,
2343
- * continuous, and paged.
2344
- *
2345
- * - `individuals` - Valid on Collections, Manifests, and Ranges. For Collections that have this behavior, each of the
2346
- * included Manifests are distinct objects in the given order. For Manifests and Ranges, the included Canvases are
2347
- * distinct views, and should not be presented in a page-turning interface. This is the default layout behavior if
2348
- * not specified. Disjoint with unordered, continuous, and paged.
2349
- *
2350
- * - `continuous` Valid on Collections, Manifests and Ranges, which include Canvases that have at least height and
2351
- * width dimensions. Canvases included in resources that have this behavior are partial views and an appropriate
2352
- * rendering might display all of the Canvases virtually stitched together, such as a long scroll split into
2353
- * sections. This behavior has no implication for audio resources. The viewingDirection of the Manifest will
2354
- * determine the appropriate arrangement of the Canvases. Disjoint with unordered, individuals and paged.
2355
- *
2356
- * - `paged` Valid on Collections, Manifests and Ranges, which include Canvases that have at least height and width
2357
- * dimensions. Canvases included in resources that have this behavior represent views that should be presented in
2358
- * a page-turning interface if one is available. The first canvas is a single view (the first recto) and thus the
2359
- * second canvas likely represents the back of the object in the first canvas. If this is not the case, see the
2360
- * behavior value non-paged. Disjoint with unordered, individuals, continuous, facing-pages and non-paged.
2361
- *
2362
- */
2363
- declare function getVisibleCanvasesFromCanvasId(vault: Vault, manifestOrRange: ManifestNormalized | RangeNormalized, canvasId: string | null, preventPaged?: boolean): Reference<'Canvas'>[];
2364
- declare function getManifestSequence(vault: Vault, manifestOrRange: ManifestNormalized | RangeNormalized, { disablePaging, skipNonPaged }?: {
2365
- disablePaging?: boolean;
2366
- skipNonPaged?: boolean;
2367
- }): [Reference<'Canvas'>[], number[][]];
2374
+ declare function useAnnotation(options?: {
2375
+ id?: string;
2376
+ selector?: undefined;
2377
+ }): AnnotationNormalized$3 | undefined;
2378
+ declare function useAnnotation<T>(options?: {
2379
+ id: string;
2380
+ selector: (annotation: AnnotationNormalized$3) => T;
2381
+ }, deps?: DependencyList): T | undefined;
2382
+
2383
+ declare function useAnnotationPage(options?: {
2384
+ id?: string;
2385
+ selector?: undefined;
2386
+ }): AnnotationPageNormalized$1 | undefined;
2387
+ declare function useAnnotationPage<T>(options?: {
2388
+ id: string;
2389
+ selector: (annotation: AnnotationPageNormalized$1) => T;
2390
+ }, deps?: DependencyList): T | undefined;
2391
+
2392
+ declare function useCanvas(options?: {
2393
+ id?: string;
2394
+ selector?: undefined;
2395
+ }): CanvasNormalized | undefined;
2396
+ declare function useCanvas<T>(options?: {
2397
+ id: string;
2398
+ selector: (canvas: CanvasNormalized) => T;
2399
+ }, deps?: DependencyList): T | undefined;
2400
+
2401
+ declare function useCollection(options: {
2402
+ id: string;
2403
+ selector?: undefined;
2404
+ }): CollectionNormalized | undefined;
2405
+ declare function useCollection<T>(options: {
2406
+ id: string;
2407
+ selector: (collection: CollectionNormalized) => T;
2408
+ }, deps?: DependencyList): T | undefined;
2409
+
2410
+ declare function useExistingVault(vault?: Vault): Vault;
2411
+ declare function useExistingVault<TVault extends Vault | Vault4>(vault: TVault): TVault;
2412
+ declare function useExistingVault(vault: Vault | Vault4 | undefined): Vault | Vault4;
2413
+
2414
+ declare function useExternalCollection(idOrRef: string | {
2415
+ id: string;
2416
+ type: string;
2417
+ }, options?: ResourceRequestOptions): {
2418
+ id: string;
2419
+ requestId: string;
2420
+ isLoaded: boolean;
2421
+ cached?: boolean;
2422
+ error: any;
2423
+ /** @deprecated Use collection. Retained for existing consumers. */
2424
+ manifest?: CollectionNormalized;
2425
+ collection?: CollectionNormalized;
2426
+ };
2427
+
2428
+ declare function useExternalManifest(idOrRef: string | {
2429
+ id: string;
2430
+ type: string;
2431
+ }, options?: ResourceRequestOptions): {
2432
+ id: string;
2433
+ requestId: string;
2434
+ isLoaded: boolean;
2435
+ cached?: boolean;
2436
+ error: any;
2437
+ manifest?: ManifestNormalized;
2438
+ };
2439
+
2440
+ declare function useManifest(options?: {
2441
+ id?: string;
2442
+ selector?: undefined;
2443
+ }): ManifestNormalized | undefined;
2444
+ declare function useManifest<T>(options?: {
2445
+ id: string;
2446
+ selector: (manifest: ManifestNormalized) => T;
2447
+ }, deps?: DependencyList): T | undefined;
2448
+
2449
+ declare function useRange(options?: {
2450
+ id?: string;
2451
+ selector?: undefined;
2452
+ }): RangeNormalized | undefined;
2453
+ declare function useRange<T>(options?: {
2454
+ id: string;
2455
+ selector: (range: RangeNormalized) => T;
2456
+ }, deps?: DependencyList): T | undefined;
2457
+
2458
+ declare function useVaultEffect(callback: (vault: Vault) => void, deps?: DependencyList): void;
2459
+
2460
+ declare function useSelectorForVault<T, TVault extends ActiveVault>(vault: TVault, selector: (state: IIIFStore, vault: TVault) => T, deps?: DependencyList): T;
2461
+ declare function useVaultSelector<T>(selector: (state: IIIFStore, vault: Vault) => T, deps?: DependencyList): T;
2368
2462
 
2369
- export { AnnotationContext, AnnotationPageContext, type AnnotationPageDescription, type AnnotationRequest, type AnnotationRequestOptions, type AnnotationResponse, type AnnotationStrategyProps, AnnotationStyleProvider, type AnnotationStyles, type AnnotationThemeDefinition, type AtlasStore, type AtlasStoreEvents, AtlasStoreProvider, AtlasStoreReactContext, type AudioSequence, Auth, type AuthAccessState, type AuthContextActions, type AuthContextCurrentActions, type AuthContextState, AuthProvider, AuthRContext, AuthReactContext, AuthReactContextActions, type AuthState, CanvasAnnotations, CanvasContext, CanvasPanel, type CanvasPanelProps, CanvasStrategyProvider, CanvasWorldObject, type ChoiceEvents, CollectionContext, CombinedMetadata, ComplexTimelineProvider, type ComplexTimelineStrategy, ContextBridge, type ControlsContext, ControlsReactContext, type CreateAtlasStoreProps, CreateCustomShape, type CreateCustomShapeProps, CustomContextBridge, CustomContextBridgeProvider, DEFAULT_BEZIER, DEFAULT_POLL_INTERVAL, DefaultEditingTools, EASING_PRESETS, type EasingInput, type EasingPreset, type EmptyStrategy, EventEmitterProvider, 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, ReactEmitterContext, ReactEventContext, ReactVaultContext, type Rect, RegionHighlight, Render3DModelStrategy, RenderAccompanyingCanvas, RenderAnnotation, RenderAnnotationEditing, RenderAnnotationPage, RenderAnnotationStrategy, RenderAudioStrategy, RenderComplexTimelineStrategy, type RenderContextProps, RenderEmptyStrategy, RenderImageStrategy, RenderSvgEditorControls, RenderTextualContentStrategy, RenderVideoStrategy, RenderYouTubeStrategy, type RenderingStrategy, ResizeWorldItem, type ResourceContextType, ResourceProvider, ResourceReactContext, type ResourceRequestOptions, type SVGTheme, 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, type Transition, TranslationProvider, TransliterationProvider, type UnknownStrategy, type UseRenderingStrategy, type UseRenderingStrategyOptions, type UseViewportScrollOptions, type UseViewportTourOptions, type VaultActivatedAnnotation, VaultProvider, type VideoSequence, ViewerPresetContext, VirtualAnnotationProvider, VisibleCanvasReactContext, annotationResponseToSelector, authDetailsForResource, buildTransitions, createAtlasStore, createAuthStateStore, createProbe, cubicBezierEasing, defaultEmitter, defaultSvgTheme, emptyActions, emptyStrategy, findAllCanvasesInRange, findFirstCanvasFromRange, findManifestSelectedRange, findSelectedRange, flattenAnnotationPageIds, formatTime, get3dStrategy, getAtlasStoreByName, getComplexTimelineStrategy, getCroppedThumbnail, getDefaultAnnotationStyles, getImageStrategy, getManifestSequence, getParsedTargetSelector, getRenderingStrategy, getStepFromProgress, getTextualContentStrategy, getVideoStrategy, getVisibleCanvasesFromCanvasId, hasAuth, interpolateRect, isBoxSelector, isRectangle, isSvgSelector, makeAccessServiceRequest, makeAccessTokenRequest, parseSpecificResource, polygonToTarget, requestToAnnotationResponse, seraliseSupportedSelector, svgThemes, targetIntersects, unknownResponse, unsupportedStrategy, useAnnotation, useAnnotationPage, useAnnotationPageManager, useAnnotationStyles, useAnnotationsAtTime, useAtlasContextMenu, useAtlasStore, useAuthActions, useAuthService, useAuthStore, useAuthToken, useAuthTokens, useCanvas, useCanvasChoices, useCanvasClock, useCanvasSequence, useCanvasStartTime, useCanvasSubset, useClosestLanguage, useCollection, useComplexTimeline, useContextBridge, useContextMenuStore, useCreateLocaleString, useCurrentAnnotationActions, useCurrentAnnotationMetadata, useCurrentAnnotationRequest, useCurrentAnnotationTransition, useCurrentAuth, useCustomContextBridge, useDispatch, useEmitter, useEvent, useEventEmitter, useEventListener, useExistingVault, useExternalCollection, useExternalManifest, useExternalResource, useIIIFLanguage, useImage, useImageService, useImageServiceLoader, useImageTile, useIsAuthEnabled, useLoadImageService, useLocaleString, useManifest, useMediaActions, useMediaElements, useMediaState, usePaintables, usePaintingAnnotations, usePolygonHelper, useRange, useRemoteStylesheet, useRenderControls, useRenderingStrategy, 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 };
2463
+ export { type ActiveVault, AnnotationContext, AnnotationPageContext, type AnnotationPageDescription, type AnnotationRequest, type AnnotationRequestOptions, type AnnotationResponse, type AnnotationStrategyProps, AnnotationStyleProvider, type AnnotationStyles, type AnnotationThemeDefinition, type AtlasStore, type AtlasStoreEvents, AtlasStoreProvider, AtlasStoreReactContext, type AudioSequence, Auth, type AuthAccessState, type AuthContextActions, type AuthContextCurrentActions, type AuthContextState, AuthProvider, AuthRContext, AuthReactContext, AuthReactContextActions, type AuthState, CanvasAnnotations, CanvasContext, CanvasPanel, type CanvasPanelProps, CanvasStrategyProvider, type CanvasStrategyProviderProps, CanvasWorldObject, type ChoiceEvents, CollectionContext, CombinedMetadata, ComplexTimelineProvider, type ComplexTimelineStrategy, ContextBridge, type ControlsContext, ControlsReactContext, type CreateAtlasStoreProps, CreateCustomShape, type CreateCustomShapeProps, CustomContextBridge, CustomContextBridgeProvider, DEFAULT_BEZIER, DEFAULT_POLL_INTERVAL, DefaultEditingTools, EASING_PRESETS, type EasingInput, type EasingPreset, type EmptyStrategy, EventEmitterProvider, 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, ReactEmitterContext, ReactEventContext, ReactVaultContext, type Rect, RegionHighlight, Render3DModelStrategy, RenderAccompanyingCanvas, RenderAnnotation, RenderAnnotationEditing, RenderAnnotationPage, RenderAnnotationStrategy, RenderAudioStrategy, RenderComplexTimelineStrategy, type RenderContextProps, RenderEmptyStrategy, RenderImageStrategy, RenderSvgEditorControls, RenderTextualContentStrategy, RenderVideoStrategy, RenderYouTubeStrategy, type RenderingStrategy, ResizeWorldItem, type ResourceContextType, ResourceProvider, ResourceReactContext, type ResourceRequestOptions, type SVGTheme, 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, type Transition, TranslationProvider, TransliterationProvider, type UnknownStrategy, type UseRenderingStrategy, type UseRenderingStrategyOptions, type UseViewportScrollOptions, type UseViewportTourOptions, type VaultActivatedAnnotation, type VaultHooks, VaultProvider, type VideoSequence, ViewerPresetContext, VirtualAnnotationProvider, VisibleCanvasReactContext, annotationResponseToSelector, authDetailsForResource, buildTransitions, createAtlasStore, createAuthStateStore, createProbe, createVaultHooks, cubicBezierEasing, defaultEmitter, defaultSvgTheme, emptyActions, emptyStrategy, findManifestSelectedRange, findSelectedRange, flattenAnnotationPageIds, formatTime, get3dStrategy, getAtlasStoreByName, getComplexTimelineStrategy, getCroppedThumbnail, getDefaultAnnotationStyles, getImageStrategy, getMediaTemporalSelectors, getParsedTargetSelector, getRenderingStrategy, getStepFromProgress, getTextualContentStrategy, getVideoStrategy, hasAuth, interpolateRect, isBoxSelector, isRectangle, isSvgSelector, makeAccessServiceRequest, makeAccessTokenRequest, parseSpecificResource, polygonToTarget, requestToAnnotationResponse, seraliseSupportedSelector, serialiseSupportedSelector, svgThemes, targetIntersects, unknownResponse, unsupportedStrategy, useActiveVault, useAnnotation, useAnnotationPage, useAnnotationPageManager, useAnnotationStyles, useAnnotationsAtTime, useAtlasContextMenu, useAtlasStore, useAuthActions, useAuthService, useAuthStore, useAuthToken, useAuthTokens, useCanvas, useCanvasChoices, useCanvasClock, useCanvasSequence, useCanvasStartTime, useCanvasSubset, useClosestLanguage, useCollection, useComplexTimeline, useComplexTimelineStore, useContainerSequence, useContextBridge, useContextMenuStore, useCreateLocaleString, useCurrentAnnotationActions, useCurrentAnnotationMetadata, useCurrentAnnotationRequest, useCurrentAnnotationTransition, useCurrentAuth, useCustomContextBridge, useDispatch, useEmitter, useEvent, useEventEmitter, useEventListener, useExistingVault, useExternalCollection, useExternalManifest, useExternalResource, useIIIFLanguage, useImage, useImageService, useImageServiceLoader, useImageTile, useIsAuthEnabled, useLoadImageService, useLocaleString, useManifest, useMediaActions, useMediaElements, useMediaState, usePaintables, usePaintingAnnotations, usePolygonHelper, useRange, useRemoteStylesheet, useRenderControls, useRenderingStrategy, useRequestAnnotation, useResourceContext, useResourceEvents, useResources, useSearchService, useSelectorController, useSelectorEmitter, useSelectorEvents, useSelectorForVault, useSelectorHelper, useSimpleMediaPlayer, useSimpleViewer, useStaticRenderingStrategy, useStrategy, useStyleHelper, useStyles, useStylesheetStore, useSvgEditor, useSvgEditorControls, useThumbnail, useTranslations, useTransliteration, useVault, useVaultEffect, useVaultSelector, useViewerPreset, useViewportScroll, useViewportTour, useVirtualAnnotationPage, useVirtualAnnotationPageContext, useVisibleCanvasContainers, useVisibleCanvases };