react-iiif-vault 2.0.19 → 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.
- package/README.md +77 -1
- package/dist/Image-CXsx26cA.d.ts +45 -0
- package/dist/Image-g-DyBvi0.d.cts +45 -0
- package/dist/ImageStrategy-BHLIi5gd.d.ts +55 -0
- package/dist/ImageStrategy-Be9YES5a.d.cts +55 -0
- package/dist/SimpleViewerContext.hooks-CTgfe0Gg.d.cts +617 -0
- package/dist/SimpleViewerContext.hooks-DYJSrd-U.d.ts +617 -0
- package/dist/SimpleViewerContext.types-CWf5OFM7.d.ts +51 -0
- package/dist/SimpleViewerContext.types-Df-cpBss.d.cts +51 -0
- package/dist/ViewerPresetContext-D7N6KH9p.d.ts +144 -0
- package/dist/ViewerPresetContext-DwFTIkDx.d.cts +144 -0
- package/dist/bundle.d.ts +290 -196
- package/dist/bundle.global.js +45 -74
- package/dist/canvas-panel/scene.cjs +1 -0
- package/dist/canvas-panel/scene.d.cts +133 -0
- package/dist/canvas-panel/scene.d.ts +133 -0
- package/dist/canvas-panel/scene.js +1 -0
- package/dist/canvas-panel.cjs +1 -47
- package/dist/canvas-panel.d.cts +10 -5
- package/dist/canvas-panel.d.ts +10 -5
- package/dist/canvas-panel.js +1 -1
- package/dist/chunk-3XPYQXUE.js +48 -0
- package/dist/chunk-6WG6RPHU.js +1 -0
- package/dist/chunk-DXC5VCRN.js +1 -0
- package/dist/chunk-DZ7DMQ3V.cjs +1 -0
- package/dist/chunk-HFC72RK6.js +1 -0
- package/dist/chunk-L2GTJVPY.js +1 -0
- package/dist/chunk-L576POBV.cjs +2 -0
- package/dist/chunk-LKWFF45D.cjs +1 -0
- package/dist/chunk-MEQI335A.js +2 -0
- package/dist/chunk-MIANDAMK.cjs +1 -0
- package/dist/chunk-ND2R7OTX.js +1 -0
- package/dist/chunk-R7HZTE2T.cjs +48 -0
- package/dist/chunk-WBVFSMED.cjs +1 -0
- package/dist/chunk-XULFR6E3.cjs +1 -0
- package/dist/chunk-YEU5T67O.js +1 -0
- package/dist/chunk-ZBGD3VEW.cjs +1 -0
- package/dist/chunk-ZEGT4BAR.cjs +1 -0
- package/dist/core.cjs +1 -0
- package/dist/core.d.cts +133 -0
- package/dist/core.d.ts +133 -0
- package/dist/core.js +1 -0
- package/dist/{index-DijgVxjb.d.ts → index-ClFUurPI.d.ts} +15 -69
- package/dist/{index-DHghDluJ.d.cts → index-QFlDahI_.d.cts} +15 -69
- package/dist/index.cjs +1 -49
- package/dist/index.d.cts +33 -1496
- package/dist/index.d.ts +33 -1496
- package/dist/index.js +1 -1
- package/dist/presentation-4.cjs +1 -0
- package/dist/presentation-4.d.cts +304 -0
- package/dist/presentation-4.d.ts +304 -0
- package/dist/presentation-4.js +1 -0
- package/dist/ranges-Cc2ppjFD.d.ts +689 -0
- package/dist/ranges-D-UBNcsJ.d.cts +689 -0
- package/dist/{useRenderingStrategy-CoKE915F.d.cts → useRenderingStrategy-Vubk-vUU.d.cts} +47 -24
- package/dist/{useRenderingStrategy-CoKE915F.d.ts → useRenderingStrategy-Vubk-vUU.d.ts} +47 -24
- package/dist/utils-DHWZGbVU.d.ts +54 -0
- package/dist/utils-De5WTLDh.d.cts +54 -0
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.cts +7 -5
- package/dist/utils.d.ts +7 -5
- package/dist/utils.js +1 -1
- package/package.json +54 -15
- package/dist/chunk-OGCPXOIP.js +0 -49
- package/dist/chunk-P7XHGETS.js +0 -1
- package/dist/utils-BKdiug6F.d.cts +0 -41
- package/dist/utils-CmwQWQLa.d.ts +0 -41
|
@@ -0,0 +1,689 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { BoxStyle, AtlasProps } from '@atlas-viewer/atlas';
|
|
3
|
+
import * as React$1 from 'react';
|
|
4
|
+
import React__default, { ReactNode, Context } from 'react';
|
|
5
|
+
import { S as SVGTheme, l as RenderContextProps, s as AudioComponentProps, V as VideoComponentProps, q as useSvgEditor, c as AtlasStore, A as AnnotationRequest, d as AnnotationResponse, b as AnnotationRequestOptions } from './index-ClFUurPI.js';
|
|
6
|
+
import { b as CanvasWorldObjectProps, I as ImageStrategyProps } from './ImageStrategy-BHLIi5gd.js';
|
|
7
|
+
import { I as ImageOptions } from './Image-CXsx26cA.js';
|
|
8
|
+
import * as polygon_editor from 'polygon-editor';
|
|
9
|
+
import { InputShape, PolygonEvents } from 'polygon-editor';
|
|
10
|
+
import { InternationalString, MetadataItem, ImageService as ImageService$1, ImageSize, SearchServiceQueryParams, SearchServiceSearchResponse, SearchService as SearchService$1, SearchServiceAutocomplete, SvgSelector as SvgSelector$1, FragmentSelector } from '@iiif/parser/presentation-3/types';
|
|
11
|
+
import { RegionParameter, RotationParameter, SizeParameter } from '@iiif/parser/image-3';
|
|
12
|
+
import { a as SingleImageStrategy, E as EmptyStrategy } from './useRenderingStrategy-Vubk-vUU.js';
|
|
13
|
+
import { S as StrategyContext } from './ViewerPresetContext-D7N6KH9p.js';
|
|
14
|
+
import * as mitt from 'mitt';
|
|
15
|
+
import * as zustand from 'zustand';
|
|
16
|
+
import { S as SimpleViewerContext } from './SimpleViewerContext.types-CWf5OFM7.js';
|
|
17
|
+
import * as _iiif_helpers from '@iiif/helpers';
|
|
18
|
+
import { ComplexChoice, SupportedSelector, SvgSelector, BoxSelector } from '@iiif/helpers';
|
|
19
|
+
import { Q as ResourceContextType, aQ as AuthContextState, aR as AuthContextCurrentActions, aS as AuthContextActions } from './SimpleViewerContext.hooks-DYJSrd-U.js';
|
|
20
|
+
import * as _iiif_helpers_vault_4 from '@iiif/helpers/vault-4';
|
|
21
|
+
import { Vault4 } from '@iiif/helpers/vault-4';
|
|
22
|
+
import { Vault } from '@iiif/helpers/vault';
|
|
23
|
+
import { ManifestNormalized, RangeNormalized } from '@iiif/parser/presentation-3-normalized/types';
|
|
24
|
+
import { ManifestNormalized as ManifestNormalized$1, RangeNormalized as RangeNormalized$1 } from '@iiif/parser/presentation-4-normalized/types';
|
|
25
|
+
|
|
26
|
+
type RegionHighlightType = {
|
|
27
|
+
id: any;
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
};
|
|
33
|
+
declare function RegionHighlight({ id, interactive, region, onClick, onHover, onSave, aspectRatio, maintainAspectRatio, disableCardinalControls, isEditing, style, }: {
|
|
34
|
+
id?: string;
|
|
35
|
+
region: RegionHighlightType;
|
|
36
|
+
isEditing: boolean;
|
|
37
|
+
onSave?: (annotation: RegionHighlightType) => void;
|
|
38
|
+
onClick?: (annotation: RegionHighlightType) => void;
|
|
39
|
+
onHover?: (annotation: RegionHighlightType) => void;
|
|
40
|
+
aspectRatio?: number;
|
|
41
|
+
maintainAspectRatio?: boolean;
|
|
42
|
+
disableCardinalControls?: boolean;
|
|
43
|
+
interactive?: boolean;
|
|
44
|
+
style?: BoxStyle;
|
|
45
|
+
}): react_jsx_runtime.JSX.Element;
|
|
46
|
+
|
|
47
|
+
type ResizeWorldItemProps = JSX.IntrinsicElements['worldObject'] & {
|
|
48
|
+
handleSize?: number;
|
|
49
|
+
resizable?: boolean;
|
|
50
|
+
aspectRatio?: number;
|
|
51
|
+
onSave: (pos: Partial<{
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
width: number;
|
|
55
|
+
height: number;
|
|
56
|
+
}>) => void;
|
|
57
|
+
children?: ReactNode;
|
|
58
|
+
maintainAspectRatio?: boolean;
|
|
59
|
+
disableCardinalControls?: boolean;
|
|
60
|
+
};
|
|
61
|
+
declare function ResizeWorldItem({ handleSize: _handleSize, resizable, onSave, children, maintainAspectRatio, disableCardinalControls, aspectRatio, ...props }: ResizeWorldItemProps): react_jsx_runtime.JSX.Element;
|
|
62
|
+
|
|
63
|
+
declare function RenderAnnotationEditing({ theme, renderContextMenu, children, }: {
|
|
64
|
+
theme?: Partial<SVGTheme>;
|
|
65
|
+
renderContextMenu?: (options: RenderContextProps) => React.ReactNode;
|
|
66
|
+
children?: React.ReactNode;
|
|
67
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
68
|
+
declare function DefaultEditingTools(): react_jsx_runtime.JSX.Element | null;
|
|
69
|
+
|
|
70
|
+
declare function CanvasWorldObject({ renderContextMenu, children, ...props }: CanvasWorldObjectProps & {
|
|
71
|
+
renderContextMenu?: (options: RenderContextProps) => ReactNode;
|
|
72
|
+
}): react_jsx_runtime.JSX.Element;
|
|
73
|
+
|
|
74
|
+
declare function ThumbnailFallbackImage({ x, y }: {
|
|
75
|
+
x?: number;
|
|
76
|
+
y?: number;
|
|
77
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
78
|
+
|
|
79
|
+
declare function Render3DModelStrategy(): react_jsx_runtime.JSX.Element | null;
|
|
80
|
+
|
|
81
|
+
declare function RenderAccompanyingCanvas(): react_jsx_runtime.JSX.Element;
|
|
82
|
+
|
|
83
|
+
interface AnnotationStrategyProps {
|
|
84
|
+
children?: ReactNode;
|
|
85
|
+
}
|
|
86
|
+
declare function RenderAnnotationStrategy({ children }: AnnotationStrategyProps): react_jsx_runtime.JSX.Element | null;
|
|
87
|
+
|
|
88
|
+
interface RenderAudioStrategyProps {
|
|
89
|
+
as?: React.ComponentType<AudioComponentProps>;
|
|
90
|
+
}
|
|
91
|
+
declare function RenderAudioStrategy({ as: CustomAudio }: RenderAudioStrategyProps): react_jsx_runtime.JSX.Element | null;
|
|
92
|
+
|
|
93
|
+
declare function RenderComplexTimelineStrategy({ imageOptions }?: {
|
|
94
|
+
imageOptions?: ImageOptions;
|
|
95
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
96
|
+
|
|
97
|
+
interface RenderEmptyStrategyProps {
|
|
98
|
+
backgroundStyle?: BoxStyle;
|
|
99
|
+
alwaysShowBackground?: boolean;
|
|
100
|
+
}
|
|
101
|
+
declare function RenderEmptyStrategy({ backgroundStyle, alwaysShowBackground }: RenderEmptyStrategyProps): react_jsx_runtime.JSX.Element | null;
|
|
102
|
+
|
|
103
|
+
declare function RenderImageStrategy(props: ImageStrategyProps): react_jsx_runtime.JSX.Element;
|
|
104
|
+
|
|
105
|
+
interface TextualContextStrategyProps {
|
|
106
|
+
onClickPaintingAnnotation?: (id: string, e: any) => void;
|
|
107
|
+
children?: ReactNode;
|
|
108
|
+
}
|
|
109
|
+
declare function RenderTextualContentStrategy({ onClickPaintingAnnotation, children }: TextualContextStrategyProps): react_jsx_runtime.JSX.Element | null;
|
|
110
|
+
|
|
111
|
+
interface RenderVideoStrategyProps {
|
|
112
|
+
as?: React__default.ComponentType<VideoComponentProps>;
|
|
113
|
+
}
|
|
114
|
+
declare function RenderVideoStrategy({ as: CustomVideo, }: RenderVideoStrategyProps): react_jsx_runtime.JSX.Element | null;
|
|
115
|
+
|
|
116
|
+
declare function RenderYouTubeStrategy(): react_jsx_runtime.JSX.Element | null;
|
|
117
|
+
|
|
118
|
+
declare const svgThemes: ({
|
|
119
|
+
name: string;
|
|
120
|
+
outer: {
|
|
121
|
+
borderWidth: number;
|
|
122
|
+
borderColor: string;
|
|
123
|
+
};
|
|
124
|
+
inner: {
|
|
125
|
+
borderWidth: number;
|
|
126
|
+
borderColor: string;
|
|
127
|
+
};
|
|
128
|
+
} | {
|
|
129
|
+
name: string;
|
|
130
|
+
outer: {
|
|
131
|
+
borderWidth: string;
|
|
132
|
+
borderColor: string;
|
|
133
|
+
};
|
|
134
|
+
inner: {
|
|
135
|
+
borderWidth: string;
|
|
136
|
+
borderColor: string;
|
|
137
|
+
};
|
|
138
|
+
} | {
|
|
139
|
+
name: string;
|
|
140
|
+
outer: {
|
|
141
|
+
borderWidth: string;
|
|
142
|
+
borderColor: string;
|
|
143
|
+
};
|
|
144
|
+
inner: {
|
|
145
|
+
borderWidth?: undefined;
|
|
146
|
+
borderColor?: undefined;
|
|
147
|
+
};
|
|
148
|
+
})[];
|
|
149
|
+
type HelperType = ReturnType<typeof useSvgEditor>['helper'];
|
|
150
|
+
type StateType = ReturnType<typeof useSvgEditor>['state'];
|
|
151
|
+
type SvgTheme = {
|
|
152
|
+
name?: string;
|
|
153
|
+
outer: BoxStyle;
|
|
154
|
+
inner: BoxStyle;
|
|
155
|
+
};
|
|
156
|
+
interface CreateCustomShapeProps {
|
|
157
|
+
image: {
|
|
158
|
+
width: number;
|
|
159
|
+
height: number;
|
|
160
|
+
};
|
|
161
|
+
shape?: any;
|
|
162
|
+
updateShape: any;
|
|
163
|
+
theme?: {
|
|
164
|
+
name?: string;
|
|
165
|
+
outer: BoxStyle;
|
|
166
|
+
inner: BoxStyle;
|
|
167
|
+
};
|
|
168
|
+
controlsHtmlId?: string;
|
|
169
|
+
renderControls?: (helper: HelperType, state: StateType, showShapes: boolean) => any;
|
|
170
|
+
}
|
|
171
|
+
declare function CreateCustomShape(props: CreateCustomShapeProps): null;
|
|
172
|
+
|
|
173
|
+
interface PolygonSelectorProps {
|
|
174
|
+
id: string;
|
|
175
|
+
polygon: InputShape;
|
|
176
|
+
annotationBucket?: string;
|
|
177
|
+
isHighlighted?: boolean;
|
|
178
|
+
updatePolygon?: (shape: InputShape) => void;
|
|
179
|
+
readOnly?: boolean;
|
|
180
|
+
theme?: SvgTheme;
|
|
181
|
+
controlsHtmlId?: string;
|
|
182
|
+
renderControls?: CreateCustomShapeProps['renderControls'];
|
|
183
|
+
}
|
|
184
|
+
declare function PolygonSelector(props: PolygonSelectorProps): react_jsx_runtime.JSX.Element | null;
|
|
185
|
+
|
|
186
|
+
declare const CanvasAnnotations: React$1.ForwardRefExoticComponent<{
|
|
187
|
+
canvasId?: string | undefined;
|
|
188
|
+
} & React$1.RefAttributes<{
|
|
189
|
+
availablePageIds: string[];
|
|
190
|
+
enabledPageIds: string[];
|
|
191
|
+
setPageEnabled: (id: string, opt?: {
|
|
192
|
+
deselectOthers?: boolean | undefined;
|
|
193
|
+
}) => void;
|
|
194
|
+
setPageDisabled: (deselectId: string) => void;
|
|
195
|
+
}>>;
|
|
196
|
+
|
|
197
|
+
type FacetConfig = {
|
|
198
|
+
id: string;
|
|
199
|
+
label: InternationalString;
|
|
200
|
+
keys: string[];
|
|
201
|
+
values?: FacetConfigValue[];
|
|
202
|
+
};
|
|
203
|
+
type FacetConfigValue = {
|
|
204
|
+
id: string;
|
|
205
|
+
label: InternationalString;
|
|
206
|
+
values: string[];
|
|
207
|
+
key: string;
|
|
208
|
+
};
|
|
209
|
+
interface MetadataProps {
|
|
210
|
+
config?: FacetConfig[];
|
|
211
|
+
metadata?: Array<{
|
|
212
|
+
label: InternationalString;
|
|
213
|
+
value: InternationalString;
|
|
214
|
+
} | null>;
|
|
215
|
+
labelWidth?: number;
|
|
216
|
+
allowHtml?: boolean;
|
|
217
|
+
showEmptyMessage?: boolean;
|
|
218
|
+
separator?: string;
|
|
219
|
+
customLabelRender?: (item: MetadataItem['label'], fallback: React.ReactNode) => React.ReactNode;
|
|
220
|
+
customValueRender?: (item: MetadataItem, fallback: React.ReactNode) => React.ReactNode;
|
|
221
|
+
classes?: {
|
|
222
|
+
container?: string;
|
|
223
|
+
row?: string;
|
|
224
|
+
label?: string;
|
|
225
|
+
value?: string;
|
|
226
|
+
empty?: string;
|
|
227
|
+
};
|
|
228
|
+
emptyMessage?: string;
|
|
229
|
+
emptyValueFallback?: string;
|
|
230
|
+
emptyLabelFallback?: string;
|
|
231
|
+
tableHeader?: React.ReactNode;
|
|
232
|
+
tableFooter?: React.ReactNode;
|
|
233
|
+
emptyFallback?: React.ReactNode;
|
|
234
|
+
}
|
|
235
|
+
declare function Metadata({ metadata, config, labelWidth, showEmptyMessage, allowHtml, emptyFallback, classes, emptyMessage, emptyValueFallback, emptyLabelFallback, separator, tableFooter, tableHeader, customLabelRender, customValueRender, }: MetadataProps): react_jsx_runtime.JSX.Element;
|
|
236
|
+
|
|
237
|
+
type CombinedMetadataProps = Omit<MetadataProps, 'metadata'>;
|
|
238
|
+
declare function CombinedMetadata(props: CombinedMetadataProps): react_jsx_runtime.JSX.Element;
|
|
239
|
+
|
|
240
|
+
interface ImageProps {
|
|
241
|
+
src: string | ImageService$1;
|
|
242
|
+
alt?: string;
|
|
243
|
+
size?: Partial<ImageSize>;
|
|
244
|
+
region?: RegionParameter;
|
|
245
|
+
className?: string;
|
|
246
|
+
style?: React.CSSProperties;
|
|
247
|
+
fetchImageService?: boolean;
|
|
248
|
+
quality?: string;
|
|
249
|
+
rotation?: number | RotationParameter;
|
|
250
|
+
format?: string;
|
|
251
|
+
}
|
|
252
|
+
declare function Image(props: ImageProps): react_jsx_runtime.JSX.Element | null;
|
|
253
|
+
|
|
254
|
+
interface ImageServiceProps {
|
|
255
|
+
src: string;
|
|
256
|
+
atlas?: AtlasProps;
|
|
257
|
+
errorFallback?: React__default.FC;
|
|
258
|
+
interactive?: boolean;
|
|
259
|
+
skipSizes?: boolean;
|
|
260
|
+
renderViewerControls?: (strategy: SingleImageStrategy | EmptyStrategy) => ReactNode;
|
|
261
|
+
viewControlsDeps?: any[];
|
|
262
|
+
fluid?: boolean;
|
|
263
|
+
x?: number;
|
|
264
|
+
y?: number;
|
|
265
|
+
children?: React__default.ReactNode;
|
|
266
|
+
}
|
|
267
|
+
declare function ImageService({ src, errorFallback, interactive, skipSizes, children, renderViewerControls, viewControlsDeps, fluid, x, y, ...atlasProps }: ImageServiceProps & Omit<AtlasProps, 'children'>): react_jsx_runtime.JSX.Element | null;
|
|
268
|
+
|
|
269
|
+
type ManifestMetadataProps = Omit<MetadataProps, 'metadata'>;
|
|
270
|
+
declare function ManifestMetadata(props: ManifestMetadataProps): react_jsx_runtime.JSX.Element;
|
|
271
|
+
|
|
272
|
+
interface SequenceThumbnailsProps {
|
|
273
|
+
flat?: boolean;
|
|
274
|
+
size?: {
|
|
275
|
+
width: number;
|
|
276
|
+
height?: number;
|
|
277
|
+
};
|
|
278
|
+
dereference?: boolean;
|
|
279
|
+
classes?: {
|
|
280
|
+
container?: string;
|
|
281
|
+
row?: string;
|
|
282
|
+
item?: string;
|
|
283
|
+
figure?: string;
|
|
284
|
+
imageWrapper?: string;
|
|
285
|
+
img?: string;
|
|
286
|
+
label?: string;
|
|
287
|
+
selected?: {
|
|
288
|
+
row?: string;
|
|
289
|
+
item?: string;
|
|
290
|
+
figure?: string;
|
|
291
|
+
img?: string;
|
|
292
|
+
label?: string;
|
|
293
|
+
imageWrapper?: string;
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
figure?: boolean;
|
|
297
|
+
showLabel?: boolean;
|
|
298
|
+
fallback?: React.ReactNode;
|
|
299
|
+
scrollBehaviour?: ScrollBehavior;
|
|
300
|
+
}
|
|
301
|
+
declare function SequenceThumbnails({ scrollBehaviour, dereference, flat, size, classes, showLabel, figure, fallback, }: SequenceThumbnailsProps): react_jsx_runtime.JSX.Element;
|
|
302
|
+
|
|
303
|
+
interface SingleCanvasThumbnailProps {
|
|
304
|
+
canvasId?: string;
|
|
305
|
+
size?: Partial<SizeParameter>;
|
|
306
|
+
visible?: boolean;
|
|
307
|
+
alt?: string;
|
|
308
|
+
dereference?: boolean;
|
|
309
|
+
figure?: boolean;
|
|
310
|
+
showLabel?: boolean;
|
|
311
|
+
classes?: {
|
|
312
|
+
figure?: string;
|
|
313
|
+
img?: string;
|
|
314
|
+
label?: string;
|
|
315
|
+
imageWrapper?: string;
|
|
316
|
+
};
|
|
317
|
+
placeholder?: React.ReactNode;
|
|
318
|
+
fallback?: React.ReactNode;
|
|
319
|
+
}
|
|
320
|
+
declare function SingleCanvasThumbnail(props: SingleCanvasThumbnailProps): react_jsx_runtime.JSX.Element;
|
|
321
|
+
|
|
322
|
+
interface RenderSvgEditorControlsProps {
|
|
323
|
+
showShapes?: boolean;
|
|
324
|
+
classNames?: Partial<{
|
|
325
|
+
button: string;
|
|
326
|
+
}>;
|
|
327
|
+
enabled?: {
|
|
328
|
+
draw?: boolean;
|
|
329
|
+
pen?: boolean;
|
|
330
|
+
line?: boolean;
|
|
331
|
+
lineBox?: boolean;
|
|
332
|
+
box?: boolean;
|
|
333
|
+
triangle?: boolean;
|
|
334
|
+
hexagon?: boolean;
|
|
335
|
+
circle?: boolean;
|
|
336
|
+
delete?: boolean;
|
|
337
|
+
};
|
|
338
|
+
icons?: Partial<{
|
|
339
|
+
DrawIcon: ReactNode;
|
|
340
|
+
PenIcon: ReactNode;
|
|
341
|
+
LineIcon: ReactNode;
|
|
342
|
+
LineBoxIcon: ReactNode;
|
|
343
|
+
ShapesIcon: ReactNode;
|
|
344
|
+
BoxIcon: ReactNode;
|
|
345
|
+
TriangleIcon: ReactNode;
|
|
346
|
+
HexagonIcon: ReactNode;
|
|
347
|
+
CircleIcon: ReactNode;
|
|
348
|
+
DeleteForeverIcon: ReactNode;
|
|
349
|
+
PointerIcon: ReactNode;
|
|
350
|
+
HandIcon: ReactNode;
|
|
351
|
+
}>;
|
|
352
|
+
}
|
|
353
|
+
declare function RenderSvgEditorControls({ showShapes, enabled, classNames, icons, }: RenderSvgEditorControlsProps): react_jsx_runtime.JSX.Element;
|
|
354
|
+
|
|
355
|
+
type SearchService = SearchService$1 & {
|
|
356
|
+
service: SearchServiceAutocomplete | SearchServiceAutocomplete[];
|
|
357
|
+
};
|
|
358
|
+
interface Search1Store {
|
|
359
|
+
service: SearchService | undefined;
|
|
360
|
+
lastQuery: SearchServiceQueryParams;
|
|
361
|
+
resources: SearchServiceSearchResponse['resources'];
|
|
362
|
+
loading: boolean;
|
|
363
|
+
error: boolean;
|
|
364
|
+
hasAutocomplete: boolean;
|
|
365
|
+
hasSearch: boolean;
|
|
366
|
+
errorMessage: string;
|
|
367
|
+
highlight: SearchServiceSearchResponse['resources'][number] | null;
|
|
368
|
+
search: (query: SearchServiceQueryParams, options?: {
|
|
369
|
+
headers?: HeadersInit;
|
|
370
|
+
}) => void;
|
|
371
|
+
clearSearch: () => void;
|
|
372
|
+
highlightResult: (id: string) => void;
|
|
373
|
+
nextResult: () => void;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
declare function useCustomContextBridge(): Record<string, {
|
|
377
|
+
value: any;
|
|
378
|
+
Provider: React__default.Provider<any>;
|
|
379
|
+
}>;
|
|
380
|
+
declare function CustomContextBridge(props: Record<string, {
|
|
381
|
+
value: any;
|
|
382
|
+
Provider: React__default.Provider<any>;
|
|
383
|
+
}> & {
|
|
384
|
+
children: React__default.ReactNode;
|
|
385
|
+
}): React__default.ReactNode;
|
|
386
|
+
declare function CustomContextBridgeProvider(props: {
|
|
387
|
+
providers: Record<string, Context<any>>;
|
|
388
|
+
children: React__default.ReactNode;
|
|
389
|
+
}): react_jsx_runtime.JSX.Element;
|
|
390
|
+
declare function useContextBridge(): {
|
|
391
|
+
VaultContext: {
|
|
392
|
+
vault: _iiif_helpers.Vault<_iiif_helpers.Vault3TypeMap> | _iiif_helpers_vault_4.Vault4 | null;
|
|
393
|
+
setVaultInstance: (vault: _iiif_helpers.Vault<_iiif_helpers.Vault3TypeMap> | _iiif_helpers_vault_4.Vault4) => void;
|
|
394
|
+
};
|
|
395
|
+
ResourceContext: ResourceContextType;
|
|
396
|
+
SimpleViewerReactContext: SimpleViewerContext;
|
|
397
|
+
VisibleCanvasReactContext: string[];
|
|
398
|
+
AuthRContext: zustand.StoreApi<AuthContextState & AuthContextCurrentActions & AuthContextActions> | null;
|
|
399
|
+
SearchReactContext: zustand.StoreApi<Search1Store> | null;
|
|
400
|
+
ReactEventContext: {
|
|
401
|
+
emitter: mitt.Emitter<Record<mitt.EventType, unknown>>;
|
|
402
|
+
};
|
|
403
|
+
ReactEmitterContext: mitt.Emitter<any>;
|
|
404
|
+
ContextBridgeReactContext: Record<string, React__default.Context<any>>;
|
|
405
|
+
StrategyReactContext: StrategyContext | null;
|
|
406
|
+
AtlasStoreReactContext: zustand.StoreApi<AtlasStore> | null;
|
|
407
|
+
ViewerIdentifierContext: string;
|
|
408
|
+
};
|
|
409
|
+
declare function ContextBridge(props: {
|
|
410
|
+
bridge: ReturnType<typeof useContextBridge>;
|
|
411
|
+
custom?: ReturnType<typeof useCustomContextBridge>;
|
|
412
|
+
children: ReactNode;
|
|
413
|
+
}): react_jsx_runtime.JSX.Element;
|
|
414
|
+
|
|
415
|
+
declare function useCanvasChoices({ canvasId }?: {
|
|
416
|
+
canvasId?: string;
|
|
417
|
+
}): {
|
|
418
|
+
choices: Array<{
|
|
419
|
+
canvasId: string;
|
|
420
|
+
choice: ComplexChoice;
|
|
421
|
+
}>;
|
|
422
|
+
actions: {
|
|
423
|
+
makeChoice: (id: string, options?: {
|
|
424
|
+
deselectOthers?: boolean;
|
|
425
|
+
deselect?: boolean;
|
|
426
|
+
}) => void;
|
|
427
|
+
};
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
declare function useCurrentAnnotationActions(): {
|
|
431
|
+
saveAnnotation: () => void;
|
|
432
|
+
cancelRequest: (requestId?: string | undefined) => void;
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
declare function useCurrentAnnotationMetadata({ requestId: customRequestId }?: {
|
|
436
|
+
requestId?: string;
|
|
437
|
+
}): readonly [Record<string, any>, (data: Record<string, any>) => void];
|
|
438
|
+
|
|
439
|
+
declare function useCurrentAnnotationRequest(): AnnotationRequest | null;
|
|
440
|
+
|
|
441
|
+
declare function useCurrentAnnotationTransition(options: {
|
|
442
|
+
requestId?: string | null;
|
|
443
|
+
onStart?: (type: string) => void;
|
|
444
|
+
onEnd?: (type: string, response: PolygonEvents['polygons.end-transition']['response']) => void;
|
|
445
|
+
onTransition?: (type: string) => void;
|
|
446
|
+
}): void;
|
|
447
|
+
|
|
448
|
+
declare function usePolygonHelper(render: (t: any, s: any, dt: number) => void): {
|
|
449
|
+
currentShape: polygon_editor.InputShape | null;
|
|
450
|
+
state: polygon_editor.SlowState;
|
|
451
|
+
helper: {
|
|
452
|
+
state: polygon_editor.RenderState;
|
|
453
|
+
setState: (newState: Partial<polygon_editor.SlowState>) => void;
|
|
454
|
+
emitter: mitt.Emitter<polygon_editor.PolygonEvents>;
|
|
455
|
+
modifiers: {
|
|
456
|
+
reset(): void;
|
|
457
|
+
getForType(type: string | null): Record<string, string>;
|
|
458
|
+
set(modifier: string): void;
|
|
459
|
+
unset(modifier: string): void;
|
|
460
|
+
};
|
|
461
|
+
stamps: {
|
|
462
|
+
set(selectedStamp: polygon_editor.InputShape | null): void;
|
|
463
|
+
clear(): void;
|
|
464
|
+
square(): void;
|
|
465
|
+
triangle(): void;
|
|
466
|
+
pentagon(): void;
|
|
467
|
+
hexagon(): void;
|
|
468
|
+
circle(): void;
|
|
469
|
+
};
|
|
470
|
+
history: {
|
|
471
|
+
undo: () => void;
|
|
472
|
+
redo: () => void;
|
|
473
|
+
readonly canUndo: boolean;
|
|
474
|
+
readonly canRedo: boolean;
|
|
475
|
+
};
|
|
476
|
+
key: {
|
|
477
|
+
down(inputKey: string): boolean | undefined;
|
|
478
|
+
up(inputKey: string): void;
|
|
479
|
+
};
|
|
480
|
+
setScale: (scale: number) => void;
|
|
481
|
+
clock: {
|
|
482
|
+
set: (renderFunc: polygon_editor.RenderFunc) => void;
|
|
483
|
+
start: (renderFunc?: polygon_editor.RenderFunc | undefined, setStateFunc?: polygon_editor.SetState | undefined) => void;
|
|
484
|
+
stop: () => void;
|
|
485
|
+
step: (deltaTime?: number | undefined) => void;
|
|
486
|
+
};
|
|
487
|
+
pointer: (pointers: ([number, number] | [number, number, number, number, number, number])[]) => void;
|
|
488
|
+
blur: () => void;
|
|
489
|
+
pointerDown: () => void;
|
|
490
|
+
pointerUp: () => void;
|
|
491
|
+
setShape: (shape: polygon_editor.InputShape | null) => void;
|
|
492
|
+
label: (type: string | null) => string;
|
|
493
|
+
tools: {
|
|
494
|
+
setTool: (tool: polygon_editor.ValidTools) => void;
|
|
495
|
+
unsetTool: (tool: polygon_editor.ValidTools) => void;
|
|
496
|
+
toggleTool: (tool: polygon_editor.ValidTools) => void;
|
|
497
|
+
updateVisibility: (tool: polygon_editor.ValidTools) => void;
|
|
498
|
+
setCanDelete(canDelete: boolean): void;
|
|
499
|
+
setCanDeselect(canDeselect: boolean): void;
|
|
500
|
+
lockToolSwitching(): void;
|
|
501
|
+
unlockToolSwitching(): void;
|
|
502
|
+
toggleToolSwitching(): void;
|
|
503
|
+
shortcuts: {
|
|
504
|
+
[k: string]: string;
|
|
505
|
+
};
|
|
506
|
+
getValidIntents(tool?: polygon_editor.ValidTools | undefined): {
|
|
507
|
+
actions: polygon_editor.ActionIntent[];
|
|
508
|
+
transitions: polygon_editor.TransitionIntent[];
|
|
509
|
+
keys: polygon_editor.ActionIntent[];
|
|
510
|
+
all: Record<string, string>;
|
|
511
|
+
current: Record<string, string>;
|
|
512
|
+
};
|
|
513
|
+
getToolInfo(): {
|
|
514
|
+
name: polygon_editor.ValidTools;
|
|
515
|
+
cursor: string;
|
|
516
|
+
selectionCount: number;
|
|
517
|
+
pointCount: number;
|
|
518
|
+
isOpen: boolean;
|
|
519
|
+
};
|
|
520
|
+
smartSelect(): void;
|
|
521
|
+
clearSelection(): void;
|
|
522
|
+
autoSelect(): void;
|
|
523
|
+
};
|
|
524
|
+
snap: {
|
|
525
|
+
enabled: () => boolean;
|
|
526
|
+
enable: () => void;
|
|
527
|
+
disable: () => void;
|
|
528
|
+
toggle: () => void;
|
|
529
|
+
pointsEnabled: () => boolean;
|
|
530
|
+
enablePoints: () => void;
|
|
531
|
+
disablePoints: () => void;
|
|
532
|
+
togglePoints: () => void;
|
|
533
|
+
linesEnabled: () => boolean;
|
|
534
|
+
enableLines: () => void;
|
|
535
|
+
disableLines: () => void;
|
|
536
|
+
toggleLines: () => void;
|
|
537
|
+
intersectionsEnabled: () => boolean;
|
|
538
|
+
enableIntersections: () => void;
|
|
539
|
+
disableIntersections: () => void;
|
|
540
|
+
toggleIntersections: () => void;
|
|
541
|
+
gridEnabled: () => boolean;
|
|
542
|
+
enableGrid: () => void;
|
|
543
|
+
disableGrid: () => void;
|
|
544
|
+
toggleGrid: () => void;
|
|
545
|
+
parallelEnabled: () => boolean;
|
|
546
|
+
enableParallel: () => void;
|
|
547
|
+
disableParallel: () => void;
|
|
548
|
+
toggleParallel: () => void;
|
|
549
|
+
getThreshold: () => number;
|
|
550
|
+
setThreshold: (threshold: number) => void;
|
|
551
|
+
isActive: () => boolean;
|
|
552
|
+
getSnapPoint: () => ([number, number] | [number, number, number, number, number, number]) | null;
|
|
553
|
+
getActiveGuides: () => polygon_editor.SnapGuide[];
|
|
554
|
+
getTargets: () => polygon_editor.SnapTarget[];
|
|
555
|
+
};
|
|
556
|
+
selectAllPoints: () => void;
|
|
557
|
+
setBounds: (bounds: {
|
|
558
|
+
x: number;
|
|
559
|
+
y: number;
|
|
560
|
+
width: number;
|
|
561
|
+
height: number;
|
|
562
|
+
} | null) => void;
|
|
563
|
+
lockAspectRatio: () => void;
|
|
564
|
+
unlockAspectRatio: () => void;
|
|
565
|
+
};
|
|
566
|
+
};
|
|
567
|
+
|
|
568
|
+
declare function useRequestAnnotation(opts?: {
|
|
569
|
+
onSuccess?: (r: AnnotationResponse) => void;
|
|
570
|
+
}): {
|
|
571
|
+
id: number;
|
|
572
|
+
busy: boolean;
|
|
573
|
+
isPending: boolean;
|
|
574
|
+
isActive: boolean;
|
|
575
|
+
requestId: string | null;
|
|
576
|
+
requestAnnotation: (request: AnnotationRequest, options?: Omit<AnnotationRequestOptions, 'requestId'>) => Promise<AnnotationResponse | null>;
|
|
577
|
+
cancelRequest: () => void;
|
|
578
|
+
completeRequest: () => void;
|
|
579
|
+
reset: () => void;
|
|
580
|
+
data: AnnotationResponse | null;
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
declare function useSvgEditorControls(): {
|
|
584
|
+
completeRequest: (requestId?: string | undefined) => void;
|
|
585
|
+
currentTool: polygon_editor.ValidTools;
|
|
586
|
+
selectedStamp: polygon_editor.InputShape | null;
|
|
587
|
+
switchTool: {
|
|
588
|
+
draw(): void;
|
|
589
|
+
pen(): void;
|
|
590
|
+
line(): void;
|
|
591
|
+
lineBox(): void;
|
|
592
|
+
box(): void;
|
|
593
|
+
triangle(): void;
|
|
594
|
+
hexagon(): void;
|
|
595
|
+
circle(): void;
|
|
596
|
+
remove(): void;
|
|
597
|
+
hand(): void;
|
|
598
|
+
pointer(): void;
|
|
599
|
+
};
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
type AnnotatedResource = {
|
|
603
|
+
annotations: readonly {
|
|
604
|
+
id: string;
|
|
605
|
+
}[];
|
|
606
|
+
};
|
|
607
|
+
declare function flattenAnnotationPageIds({ canvas, manifest, all, canvases, }: {
|
|
608
|
+
manifest?: AnnotatedResource;
|
|
609
|
+
canvas?: AnnotatedResource;
|
|
610
|
+
canvases?: readonly AnnotatedResource[];
|
|
611
|
+
all?: boolean;
|
|
612
|
+
}): string[];
|
|
613
|
+
|
|
614
|
+
declare function TranslationProvider(props: {
|
|
615
|
+
translations: Record<string, string>;
|
|
616
|
+
children: ReactNode;
|
|
617
|
+
}): react_jsx_runtime.JSX.Element;
|
|
618
|
+
declare function LanguageProvider(props: {
|
|
619
|
+
language: string;
|
|
620
|
+
children: ReactNode;
|
|
621
|
+
}): react_jsx_runtime.JSX.Element;
|
|
622
|
+
declare function TransliterationProvider(props: {
|
|
623
|
+
convert: null | ((input: string, targetLang: string) => string);
|
|
624
|
+
children: ReactNode;
|
|
625
|
+
}): react_jsx_runtime.JSX.Element;
|
|
626
|
+
declare function useTransliteration(): ((input: string, targetLang: string) => string) | null;
|
|
627
|
+
declare function useIIIFLanguage(): string;
|
|
628
|
+
declare function useTranslations(): Record<string, string>;
|
|
629
|
+
type LanguageStringProps = {
|
|
630
|
+
[key: string]: any;
|
|
631
|
+
} & {
|
|
632
|
+
as?: string | React__default.FC<any>;
|
|
633
|
+
language: string;
|
|
634
|
+
viewingDirection?: 'rtl' | 'rtl';
|
|
635
|
+
};
|
|
636
|
+
declare function LanguageString({ as: Component, language, children, viewingDirection, ...props }: LanguageStringProps): react_jsx_runtime.JSX.Element;
|
|
637
|
+
declare const useClosestLanguage: (getLanguages: () => string[], deps?: any[]) => string | undefined;
|
|
638
|
+
declare function useLocaleString(inputText: InternationalString | string | null | undefined, defaultText?: string, separator?: string, translations?: Record<string, string>): readonly [string, string | undefined];
|
|
639
|
+
declare function useCreateLocaleString(): (inputText: InternationalString | string | null | undefined, defaultText?: string, separator?: string, translations?: Record<string, string>) => string;
|
|
640
|
+
type LocaleStringProps = {
|
|
641
|
+
as?: string | React__default.FC<any>;
|
|
642
|
+
defaultText?: string;
|
|
643
|
+
to?: string;
|
|
644
|
+
separator?: string;
|
|
645
|
+
enableDangerouslySetInnerHTML?: boolean;
|
|
646
|
+
children: InternationalString | string | null | undefined;
|
|
647
|
+
style?: React__default.CSSProperties;
|
|
648
|
+
extraProps?: any;
|
|
649
|
+
} & Record<string, any>;
|
|
650
|
+
declare function LocaleString({ as: Component, defaultText, enableDangerouslySetInnerHTML, children, separator, ...props }: LocaleStringProps): react_jsx_runtime.JSX.Element;
|
|
651
|
+
|
|
652
|
+
declare function targetIntersects(a: {
|
|
653
|
+
x: number;
|
|
654
|
+
y: number;
|
|
655
|
+
width: number;
|
|
656
|
+
height: number;
|
|
657
|
+
}, b: {
|
|
658
|
+
x: number;
|
|
659
|
+
y: number;
|
|
660
|
+
width: number;
|
|
661
|
+
height: number;
|
|
662
|
+
}): boolean;
|
|
663
|
+
|
|
664
|
+
declare function annotationResponseToSelector(response: {
|
|
665
|
+
polygon: AnnotationResponse['polygon'];
|
|
666
|
+
boundingBox?: AnnotationResponse['boundingBox'];
|
|
667
|
+
target?: AnnotationResponse['target'];
|
|
668
|
+
}, on?: {
|
|
669
|
+
width: number;
|
|
670
|
+
height: number;
|
|
671
|
+
} | null): SupportedSelector;
|
|
672
|
+
|
|
673
|
+
declare function isRectangle(points: InputShape['points']): boolean;
|
|
674
|
+
|
|
675
|
+
declare function isSvgSelector(t: SupportedSelector): t is SvgSelector;
|
|
676
|
+
declare function isBoxSelector(t: SupportedSelector): t is BoxSelector;
|
|
677
|
+
declare function serialiseSupportedSelector(selector: SupportedSelector, on?: {
|
|
678
|
+
width: number;
|
|
679
|
+
height: number;
|
|
680
|
+
} | null): null | SvgSelector$1 | FragmentSelector;
|
|
681
|
+
/** @deprecated Use serialiseSupportedSelector (corrected spelling). */
|
|
682
|
+
declare const seraliseSupportedSelector: typeof serialiseSupportedSelector;
|
|
683
|
+
|
|
684
|
+
declare function findManifestSelectedRange(vault: Vault, manifest: ManifestNormalized, canvasId: string): RangeNormalized | null;
|
|
685
|
+
declare function findManifestSelectedRange(vault: Vault4, manifest: ManifestNormalized$1, canvasId: string): RangeNormalized$1 | null;
|
|
686
|
+
declare function findSelectedRange(vault: Vault, range: RangeNormalized, canvasId: string): RangeNormalized | null;
|
|
687
|
+
declare function findSelectedRange(vault: Vault4, range: RangeNormalized$1, canvasId: string): RangeNormalized$1 | null;
|
|
688
|
+
|
|
689
|
+
export { TransliterationProvider as $, type AnnotationStrategyProps as A, SingleCanvasThumbnail as B, CanvasWorldObject as C, DefaultEditingTools as D, RenderSvgEditorControls as E, useCustomContextBridge as F, CustomContextBridge as G, CustomContextBridgeProvider as H, ImageService as I, useContextBridge as J, ContextBridge as K, useCanvasChoices as L, ManifestMetadata as M, useCurrentAnnotationActions as N, useCurrentAnnotationMetadata as O, type PolygonSelectorProps as P, useCurrentAnnotationRequest as Q, RegionHighlight as R, type SvgTheme as S, ThumbnailFallbackImage as T, useCurrentAnnotationTransition as U, usePolygonHelper as V, useRequestAnnotation as W, useSvgEditorControls as X, flattenAnnotationPageIds as Y, TranslationProvider as Z, LanguageProvider as _, isBoxSelector as a, useTransliteration as a0, useIIIFLanguage as a1, useTranslations as a2, LanguageString as a3, useClosestLanguage as a4, useLocaleString as a5, useCreateLocaleString as a6, LocaleString as a7, targetIntersects as a8, annotationResponseToSelector as a9, serialiseSupportedSelector as aa, seraliseSupportedSelector as ab, findManifestSelectedRange as ac, findSelectedRange as ad, isSvgSelector as b, ResizeWorldItem as c, RenderAnnotationEditing as d, Render3DModelStrategy as e, RenderAccompanyingCanvas as f, RenderAnnotationStrategy as g, RenderAudioStrategy as h, isRectangle as i, RenderComplexTimelineStrategy as j, RenderEmptyStrategy as k, RenderImageStrategy as l, RenderTextualContentStrategy as m, RenderVideoStrategy as n, RenderYouTubeStrategy as o, type CreateCustomShapeProps as p, CreateCustomShape as q, PolygonSelector as r, svgThemes as s, CanvasAnnotations as t, CombinedMetadata as u, type ImageProps as v, Image as w, type MetadataProps as x, Metadata as y, SequenceThumbnails as z };
|