react-iiif-vault 2.0.2 → 2.0.5
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 +72 -3
- package/dist/bundle.global.js +72 -47
- package/dist/canvas-panel.cjs +6 -5
- package/dist/canvas-panel.js +1 -1
- package/dist/chunk-SNWQWQTN.js +49 -0
- package/dist/chunk-UNH7HXGJ.js +0 -0
- package/dist/index.cjs +8 -7
- package/dist/index.d.cts +73 -4
- package/dist/index.d.ts +73 -4
- package/dist/index.js +1 -1
- package/dist/utils.js +1 -1
- package/package.json +11 -7
- package/dist/chunk-CX7UL3H3.js +0 -48
package/dist/bundle.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import * as polygon_editor from 'polygon-editor';
|
|
|
12
12
|
import { RenderState, SlowState, InputShape, ValidTools, createHelper, PolygonEvents } from 'polygon-editor';
|
|
13
13
|
import * as _iiif_helpers_vault from '@iiif/helpers/vault';
|
|
14
14
|
import { Vault, VaultOptions, NormalizedEntity, IIIFStore } from '@iiif/helpers/vault';
|
|
15
|
-
import { Reference, FragmentSelector, SvgSelector, AnnotationPage, ImageService as ImageService$1, ExternalWebResource, InternationalString, ImageSize, AuthProbeService2, Auth2LocationResource, Auth2SubstituteResource, AuthAccessService2, AuthAccessTokenService2, AuthAccessToken2, SearchServiceQueryParams, SearchServiceSearchResponse, SearchService as SearchService$1, SearchServiceAutocomplete, ContentResource, W3CAnnotationTarget, PointSelector, Annotation } from '@iiif/presentation-3';
|
|
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';
|
|
16
16
|
import * as zustand_vanilla from 'zustand/vanilla';
|
|
17
17
|
import { StoreApi as StoreApi$1 } from 'zustand/vanilla';
|
|
18
18
|
import { AnnotationPageNormalized, AnnotationNormalized, CanvasNormalized, CollectionNormalized, ManifestNormalized, RangeNormalized } from '@iiif/presentation-3-normalized';
|
|
@@ -846,6 +846,43 @@ type CanvasPanelType = ForwardRefExoticComponent<CanvasPanelProps & RefAttribute
|
|
|
846
846
|
};
|
|
847
847
|
declare const CanvasPanel: CanvasPanelType;
|
|
848
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
|
+
|
|
849
886
|
declare function RenderAnnotationEditing({ theme, renderContextMenu, children, }: {
|
|
850
887
|
theme?: Partial<SVGTheme>;
|
|
851
888
|
renderContextMenu?: (options: RenderContextProps) => React.ReactNode;
|
|
@@ -1031,6 +1068,8 @@ interface MetadataProps {
|
|
|
1031
1068
|
allowHtml?: boolean;
|
|
1032
1069
|
showEmptyMessage?: boolean;
|
|
1033
1070
|
separator?: string;
|
|
1071
|
+
customLabelRender?: (item: MetadataItem['label'], fallback: React.ReactNode) => React.ReactNode;
|
|
1072
|
+
customValueRender?: (item: MetadataItem, fallback: React.ReactNode) => React.ReactNode;
|
|
1034
1073
|
classes?: {
|
|
1035
1074
|
container?: string;
|
|
1036
1075
|
row?: string;
|
|
@@ -1045,7 +1084,7 @@ interface MetadataProps {
|
|
|
1045
1084
|
tableFooter?: React.ReactNode;
|
|
1046
1085
|
emptyFallback?: React.ReactNode;
|
|
1047
1086
|
}
|
|
1048
|
-
declare function Metadata({ metadata, config, labelWidth, showEmptyMessage, allowHtml, emptyFallback, classes, emptyMessage, emptyValueFallback, emptyLabelFallback, separator, tableFooter, tableHeader, }: MetadataProps): react_jsx_runtime.JSX.Element;
|
|
1087
|
+
declare function Metadata({ metadata, config, labelWidth, showEmptyMessage, allowHtml, emptyFallback, classes, emptyMessage, emptyValueFallback, emptyLabelFallback, separator, tableFooter, tableHeader, customLabelRender, customValueRender, }: MetadataProps): react_jsx_runtime.JSX.Element;
|
|
1049
1088
|
|
|
1050
1089
|
type CombinedMetadataProps = Omit<MetadataProps, 'metadata'>;
|
|
1051
1090
|
declare function CombinedMetadata(props: CombinedMetadataProps): react_jsx_runtime.JSX.Element;
|
|
@@ -1981,6 +2020,36 @@ declare function useRange<T>(options?: {
|
|
|
1981
2020
|
selector: (range: RangeNormalized) => T;
|
|
1982
2021
|
}, deps?: any[]): T | undefined;
|
|
1983
2022
|
|
|
2023
|
+
declare function useStaticRenderingStrategy({ supports }?: {
|
|
2024
|
+
supports?: Array<RenderingStrategy['type']>;
|
|
2025
|
+
}): RenderingStrategy;
|
|
2026
|
+
|
|
2027
|
+
interface StylesheetStore {
|
|
2028
|
+
stylesheets: Record<string, string>;
|
|
2029
|
+
loading: string[];
|
|
2030
|
+
errors: Array<{
|
|
2031
|
+
url: string;
|
|
2032
|
+
error: Error;
|
|
2033
|
+
}>;
|
|
2034
|
+
loadStylesheet(url: string): Promise<string>;
|
|
2035
|
+
setStylesheet(value: string, url?: string): string;
|
|
2036
|
+
parseStylesheet(stylesheet: Annotation['stylesheet'] | null): Promise<null | {
|
|
2037
|
+
id: string;
|
|
2038
|
+
type: 'CssStylesheet';
|
|
2039
|
+
value: string;
|
|
2040
|
+
}>;
|
|
2041
|
+
}
|
|
2042
|
+
declare const useStylesheetStore: zustand.UseBoundStore<zustand.StoreApi<StylesheetStore>>;
|
|
2043
|
+
declare function useRemoteStylesheet(stylesheet?: Annotation['stylesheet'] | null): readonly [Record<string, string>, {
|
|
2044
|
+
readonly id: string;
|
|
2045
|
+
readonly stylesheets: Record<string, string>;
|
|
2046
|
+
readonly loading: string[];
|
|
2047
|
+
readonly errors: {
|
|
2048
|
+
url: string;
|
|
2049
|
+
error: Error;
|
|
2050
|
+
}[];
|
|
2051
|
+
}];
|
|
2052
|
+
|
|
1984
2053
|
declare function useRequestAnnotation(opts?: {
|
|
1985
2054
|
onSuccess?: (r: AnnotationResponse) => void;
|
|
1986
2055
|
}): {
|
|
@@ -2199,4 +2268,4 @@ declare function getManifestSequence(vault: Vault, manifestOrRange: ManifestNorm
|
|
|
2199
2268
|
skipNonPaged?: boolean;
|
|
2200
2269
|
}): [Reference<'Canvas'>[], number[][]];
|
|
2201
2270
|
|
|
2202
|
-
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 };
|
|
2271
|
+
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 };
|