react-iiif-vault 2.0.1 → 2.0.4

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 CHANGED
@@ -480,11 +480,18 @@ declare const RenderAnnotation: FC<{
480
480
  className?: string;
481
481
  style?: BoxStyle;
482
482
  interactive?: boolean;
483
+ targetId?: string;
484
+ ignoreTargetId?: boolean;
483
485
  }>;
484
486
 
485
487
  declare const RenderAnnotationPage: FC<{
486
- page: AnnotationPage | AnnotationPageNormalized;
488
+ page: {
489
+ id: string;
490
+ type: string;
491
+ } | AnnotationPage | AnnotationPageNormalized;
487
492
  className?: string;
493
+ targetId?: string;
494
+ ignoreTargetId?: boolean;
488
495
  }>;
489
496
 
490
497
  type ImageWithOptionalService = {
@@ -501,6 +508,7 @@ type ImageWithOptionalService = {
501
508
  }>;
502
509
  target: BoxSelector | TemporalBoxSelector;
503
510
  selector?: BoxSelector;
511
+ annotationPages?: AnnotationPageNormalized[];
504
512
  };
505
513
  type SingleAudio = {
506
514
  type: 'Sound';
@@ -623,11 +631,12 @@ type ComplexTimelineStrategy = {
623
631
  duration: number;
624
632
  choice?: ChoiceDescription;
625
633
  annotations?: AnnotationPageDescription;
634
+ highlights: Array<any>;
626
635
  };
627
636
  interface TimelineKeyframe {
628
637
  id: string;
629
638
  type: 'enter' | 'exit' | 'change';
630
- resourceType: 'image' | 'audio' | 'video' | 'text';
639
+ resourceType: 'image' | 'audio' | 'video' | 'text' | 'highlight';
631
640
  timeDelta?: number;
632
641
  isPrime?: boolean;
633
642
  time: number;
@@ -747,12 +756,13 @@ declare function CanvasBackground({ style }: {
747
756
  style?: BoxStyle;
748
757
  }): react_jsx_runtime.JSX.Element | null;
749
758
 
750
- declare function RenderImage({ id, image, thumbnail, isStatic, x, y, children, selector, onClick, enableSizes, }: {
759
+ declare function RenderImage({ id, image, thumbnail, isStatic, x, y, children, selector, onClick, enableSizes, enableAnnotations, }: {
751
760
  id: string;
752
761
  image: ImageWithOptionalService;
753
762
  thumbnail?: ImageCandidate;
754
763
  isStatic?: boolean;
755
764
  enableSizes?: boolean;
765
+ enableAnnotations?: boolean;
756
766
  selector?: BoxSelector$1;
757
767
  x?: number;
758
768
  y?: number;
@@ -836,6 +846,43 @@ type CanvasPanelType = ForwardRefExoticComponent<CanvasPanelProps & RefAttribute
836
846
  };
837
847
  declare const CanvasPanel: CanvasPanelType;
838
848
 
849
+ type RegionHighlightType = {
850
+ id: any;
851
+ x: number;
852
+ y: number;
853
+ width: number;
854
+ height: number;
855
+ };
856
+ declare function RegionHighlight({ id, interactive, region, onClick, onHover, onSave, aspectRatio, maintainAspectRatio, disableCardinalControls, isEditing, style, }: {
857
+ id?: string;
858
+ region: RegionHighlightType;
859
+ isEditing: boolean;
860
+ onSave?: (annotation: RegionHighlightType) => void;
861
+ onClick?: (annotation: RegionHighlightType) => void;
862
+ onHover?: (annotation: RegionHighlightType) => void;
863
+ aspectRatio?: number;
864
+ maintainAspectRatio?: boolean;
865
+ disableCardinalControls?: boolean;
866
+ interactive?: boolean;
867
+ style?: BoxStyle;
868
+ }): react_jsx_runtime.JSX.Element;
869
+
870
+ type ResizeWorldItemProps = JSX.IntrinsicElements['worldObject'] & {
871
+ handleSize?: number;
872
+ resizable?: boolean;
873
+ aspectRatio?: number;
874
+ onSave: (pos: Partial<{
875
+ x: number;
876
+ y: number;
877
+ width: number;
878
+ height: number;
879
+ }>) => void;
880
+ children?: ReactNode;
881
+ maintainAspectRatio?: boolean;
882
+ disableCardinalControls?: boolean;
883
+ };
884
+ declare function ResizeWorldItem({ handleSize: _handleSize, resizable, onSave, children, maintainAspectRatio, disableCardinalControls, aspectRatio, ...props }: ResizeWorldItemProps): react_jsx_runtime.JSX.Element;
885
+
839
886
  declare function RenderAnnotationEditing({ theme, renderContextMenu, children, }: {
840
887
  theme?: Partial<SVGTheme>;
841
888
  renderContextMenu?: (options: RenderContextProps) => React.ReactNode;
@@ -901,10 +948,11 @@ declare function RenderEmptyStrategy({ backgroundStyle, alwaysShowBackground }:
901
948
  interface ImageStrategyProps {
902
949
  isStatic?: boolean;
903
950
  enableSizes?: boolean;
951
+ enableAnnotations?: boolean;
904
952
  onClickPaintingAnnotation?: (id: string, image: ImageWithOptionalService, e: any) => void;
905
953
  children?: ReactNode;
906
954
  }
907
- declare function RenderImageStrategy({ isStatic, enableSizes, onClickPaintingAnnotation, children, }: ImageStrategyProps): react_jsx_runtime.JSX.Element | null;
955
+ declare function RenderImageStrategy({ isStatic, enableSizes, enableAnnotations, onClickPaintingAnnotation, children, }: ImageStrategyProps): react_jsx_runtime.JSX.Element | null;
908
956
 
909
957
  interface TextualContextStrategyProps {
910
958
  onClickPaintingAnnotation?: (id: string, e: any) => void;
@@ -1970,6 +2018,36 @@ declare function useRange<T>(options?: {
1970
2018
  selector: (range: RangeNormalized) => T;
1971
2019
  }, deps?: any[]): T | undefined;
1972
2020
 
2021
+ declare function useStaticRenderingStrategy({ supports }?: {
2022
+ supports?: Array<RenderingStrategy['type']>;
2023
+ }): RenderingStrategy;
2024
+
2025
+ interface StylesheetStore {
2026
+ stylesheets: Record<string, string>;
2027
+ loading: string[];
2028
+ errors: Array<{
2029
+ url: string;
2030
+ error: Error;
2031
+ }>;
2032
+ loadStylesheet(url: string): Promise<string>;
2033
+ setStylesheet(value: string, url?: string): string;
2034
+ parseStylesheet(stylesheet: Annotation['stylesheet'] | null): Promise<null | {
2035
+ id: string;
2036
+ type: 'CssStylesheet';
2037
+ value: string;
2038
+ }>;
2039
+ }
2040
+ declare const useStylesheetStore: zustand.UseBoundStore<zustand.StoreApi<StylesheetStore>>;
2041
+ declare function useRemoteStylesheet(stylesheet?: Annotation['stylesheet'] | null): readonly [Record<string, string>, {
2042
+ readonly id: string;
2043
+ readonly stylesheets: Record<string, string>;
2044
+ readonly loading: string[];
2045
+ readonly errors: {
2046
+ url: string;
2047
+ error: Error;
2048
+ }[];
2049
+ }];
2050
+
1973
2051
  declare function useRequestAnnotation(opts?: {
1974
2052
  onSuccess?: (r: AnnotationResponse) => void;
1975
2053
  }): {
@@ -2188,4 +2266,4 @@ declare function getManifestSequence(vault: Vault, manifestOrRange: ManifestNorm
2188
2266
  skipNonPaged?: boolean;
2189
2267
  }): [Reference<'Canvas'>[], number[][]];
2190
2268
 
2191
- 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, DefaultEditingTools, 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, Render3DModelStrategy, RenderAccompanyingCanvas, RenderAnnotation, RenderAnnotationEditing, RenderAnnotationPage, RenderAnnotationStrategy, RenderAudioStrategy, RenderComplexTimelineStrategy, type RenderContextProps, RenderEmptyStrategy, RenderImageStrategy, RenderSvgEditorControls, RenderTextualContentStrategy, RenderVideoStrategy, RenderYouTubeStrategy, type RenderingStrategy, 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, TranslationProvider, TransliterationProvider, type UnknownStrategy, type UseRenderingStrategy, type UseRenderingStrategyOptions, type VaultActivatedAnnotation, VaultProvider, type VideoSequence, ViewerPresetContext, VirtualAnnotationProvider, VisibleCanvasReactContext, annotationResponseToSelector, authDetailsForResource, createAtlasStore, createAuthStateStore, createProbe, defaultEmitter, defaultSvgTheme, emptyActions, emptyStrategy, findAllCanvasesInRange, findFirstCanvasFromRange, findManifestSelectedRange, findSelectedRange, flattenAnnotationPageIds, formatTime, get3dStrategy, getAtlasStoreByName, getComplexTimelineStrategy, getDefaultAnnotationStyles, getImageStrategy, getManifestSequence, getParsedTargetSelector, getRenderingStrategy, getTextualContentStrategy, getVideoStrategy, getVisibleCanvasesFromCanvasId, hasAuth, 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, useRenderControls, useRenderingStrategy, useRequestAnnotation, useResourceContext, useResourceEvents, useResources, useSearchService, useSelectorController, useSelectorEmitter, useSelectorEvents, useSelectorHelper, useSimpleMediaPlayer, useSimpleViewer, useStrategy, useStyleHelper, useStyles, useSvgEditor, useSvgEditorControls, useThumbnail, useTranslations, useTransliteration, useVault, useVaultEffect, useVaultSelector, useViewerPreset, useVirtualAnnotationPage, useVirtualAnnotationPageContext, useVisibleCanvases };
2269
+ 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, DefaultEditingTools, 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, 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, TranslationProvider, TransliterationProvider, type UnknownStrategy, type UseRenderingStrategy, type UseRenderingStrategyOptions, type VaultActivatedAnnotation, VaultProvider, type VideoSequence, ViewerPresetContext, VirtualAnnotationProvider, VisibleCanvasReactContext, annotationResponseToSelector, authDetailsForResource, createAtlasStore, createAuthStateStore, createProbe, defaultEmitter, defaultSvgTheme, emptyActions, emptyStrategy, findAllCanvasesInRange, findFirstCanvasFromRange, findManifestSelectedRange, findSelectedRange, flattenAnnotationPageIds, formatTime, get3dStrategy, getAtlasStoreByName, getComplexTimelineStrategy, getDefaultAnnotationStyles, getImageStrategy, getManifestSequence, getParsedTargetSelector, getRenderingStrategy, getTextualContentStrategy, getVideoStrategy, getVisibleCanvasesFromCanvasId, hasAuth, 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, useVirtualAnnotationPage, useVirtualAnnotationPageContext, useVisibleCanvases };