react-iiif-vault 1.5.10 → 2.0.1
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 +1015 -494
- package/dist/bundle.global.js +53 -86
- package/dist/canvas-panel.cjs +5 -5
- package/dist/canvas-panel.d.cts +8 -5
- package/dist/canvas-panel.d.ts +8 -5
- package/dist/canvas-panel.js +1 -1
- package/dist/chunk-5VWTU5L4.js +48 -0
- package/dist/{chunk-XNDN34SQ.js → chunk-OTG27VBE.js} +1 -1
- package/dist/index-CawyvZZf.d.cts +643 -0
- package/dist/index-yy_738ck.d.ts +643 -0
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +478 -378
- package/dist/index.d.ts +478 -378
- package/dist/index.js +1 -1
- package/dist/{useRenderingStrategy-BiuSDiXu.d.cts → useRenderingStrategy-PvoNjiMV.d.cts} +10 -10
- package/dist/{useRenderingStrategy-BiuSDiXu.d.ts → useRenderingStrategy-PvoNjiMV.d.ts} +10 -10
- package/dist/{utils-CvRzsfRK.d.cts → utils-BVhGgVd5.d.cts} +18 -18
- package/dist/{utils-C-h4SU3S.d.ts → utils-DyrEcegR.d.ts} +18 -18
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.cts +2 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +1 -1
- package/package.json +6 -5
- package/dist/chunk-2ATWK7I4.js +0 -48
- package/dist/index-BJveLrlu.d.cts +0 -214
- package/dist/index-CrfymD6m.d.ts +0 -214
|
@@ -0,0 +1,643 @@
|
|
|
1
|
+
import { ViewerMode, Runtime, BoxStyle, AtlasProps, Preset } from '@atlas-viewer/atlas';
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
|
+
import React__default, { ReactNode, FC, ComponentType, RefObject, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
+
import * as zustand from 'zustand';
|
|
6
|
+
import { StoreApi } from 'zustand';
|
|
7
|
+
import * as mitt from 'mitt';
|
|
8
|
+
import { Emitter } from 'mitt';
|
|
9
|
+
import * as polygon_editor from 'polygon-editor';
|
|
10
|
+
import { RenderState, SlowState, InputShape, ValidTools, createHelper } from 'polygon-editor';
|
|
11
|
+
import { Vault } from '@iiif/helpers/vault';
|
|
12
|
+
import { Reference, FragmentSelector, SvgSelector, AnnotationPage } from '@iiif/presentation-3';
|
|
13
|
+
import * as zustand_vanilla from 'zustand/vanilla';
|
|
14
|
+
import { AnnotationPageNormalized, CanvasNormalized } from '@iiif/presentation-3-normalized';
|
|
15
|
+
import { S as SingleAudio, a as SingleVideo, M as MediaStrategy, b as StrategyActions, c as SingleImageStrategy, E as EmptyStrategy, C as ComplexTimelineStrategy, R as RenderingStrategy, I as ImageWithOptionalService } from './useRenderingStrategy-PvoNjiMV.js';
|
|
16
|
+
import { ChoiceDescription, ImageCandidate, BoxSelector } from '@iiif/helpers';
|
|
17
|
+
|
|
18
|
+
type RenderContextProps = {
|
|
19
|
+
canvasId?: string;
|
|
20
|
+
position: {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
};
|
|
24
|
+
close: () => void;
|
|
25
|
+
};
|
|
26
|
+
declare const useContextMenuStore: zustand.UseBoundStore<zustand.StoreApi<{
|
|
27
|
+
isMenuOpen: boolean;
|
|
28
|
+
menuPosition: {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
};
|
|
32
|
+
open(position: {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
}): void;
|
|
36
|
+
toggle(position: {
|
|
37
|
+
x: number;
|
|
38
|
+
y: number;
|
|
39
|
+
}): void;
|
|
40
|
+
setMenuPosition(position: {
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
}): void;
|
|
44
|
+
setIsMenuOpen(isMenuOpen: boolean | ((prev: boolean) => boolean)): void;
|
|
45
|
+
close(): void;
|
|
46
|
+
}>>;
|
|
47
|
+
declare function useAtlasContextMenu(id: string, canvasId?: string, renderContextMenu?: (props: RenderContextProps) => React.ReactNode): readonly [react_jsx_runtime.JSX.Element, {
|
|
48
|
+
onContextMenu: (e: any) => void;
|
|
49
|
+
}, {
|
|
50
|
+
readonly open: (position: {
|
|
51
|
+
x: number;
|
|
52
|
+
y: number;
|
|
53
|
+
}) => void;
|
|
54
|
+
readonly close: () => void;
|
|
55
|
+
readonly toggle: (position: {
|
|
56
|
+
x: number;
|
|
57
|
+
y: number;
|
|
58
|
+
}) => void;
|
|
59
|
+
readonly isMenuOpen: boolean;
|
|
60
|
+
readonly setIsMenuOpen: (isMenuOpen: boolean | ((prev: boolean) => boolean)) => void;
|
|
61
|
+
readonly menuPosition: {
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
};
|
|
65
|
+
readonly setMenuPosition: (position: {
|
|
66
|
+
x: number;
|
|
67
|
+
y: number;
|
|
68
|
+
}) => void;
|
|
69
|
+
}];
|
|
70
|
+
|
|
71
|
+
interface SvgEditorOptions {
|
|
72
|
+
image: {
|
|
73
|
+
height: number;
|
|
74
|
+
width: number;
|
|
75
|
+
};
|
|
76
|
+
hideShapeLines?: boolean;
|
|
77
|
+
onChange?: (shape: InputShape) => void;
|
|
78
|
+
theme?: Partial<SVGTheme>;
|
|
79
|
+
}
|
|
80
|
+
declare const defaultSvgTheme: {
|
|
81
|
+
shapeFill: string;
|
|
82
|
+
shapeStroke: string;
|
|
83
|
+
lineStroke: string;
|
|
84
|
+
ghostLineStroke: string;
|
|
85
|
+
activeLineStroke: string;
|
|
86
|
+
boundingBoxDottedStroke: string;
|
|
87
|
+
boundingBoxStroke: string;
|
|
88
|
+
controlFill: string;
|
|
89
|
+
};
|
|
90
|
+
type SVGTheme = typeof defaultSvgTheme;
|
|
91
|
+
declare function useSvgEditor(options: SvgEditorOptions): {
|
|
92
|
+
currentTool: polygon_editor.ValidTools;
|
|
93
|
+
setCurrentTool: (tool: polygon_editor.ValidTools) => void;
|
|
94
|
+
helper: {
|
|
95
|
+
state: RenderState;
|
|
96
|
+
setState: (newState: Partial<SlowState>) => void;
|
|
97
|
+
emitter: mitt.Emitter<polygon_editor.PolygonEvents>;
|
|
98
|
+
modifiers: {
|
|
99
|
+
reset(): void;
|
|
100
|
+
getForType(type: string | null): Record<string, string>;
|
|
101
|
+
set(modifier: string): void;
|
|
102
|
+
unset(modifier: string): void;
|
|
103
|
+
};
|
|
104
|
+
stamps: {
|
|
105
|
+
set(selectedStamp: InputShape | null): void;
|
|
106
|
+
clear(): void;
|
|
107
|
+
square(): void;
|
|
108
|
+
triangle(): void;
|
|
109
|
+
pentagon(): void;
|
|
110
|
+
hexagon(): void;
|
|
111
|
+
circle(): void;
|
|
112
|
+
};
|
|
113
|
+
history: {
|
|
114
|
+
undo: () => void;
|
|
115
|
+
redo: () => void;
|
|
116
|
+
readonly canUndo: boolean;
|
|
117
|
+
readonly canRedo: boolean;
|
|
118
|
+
};
|
|
119
|
+
key: {
|
|
120
|
+
down(inputKey: string): boolean | undefined;
|
|
121
|
+
up(inputKey: string): void;
|
|
122
|
+
};
|
|
123
|
+
setScale: (scale: number) => void;
|
|
124
|
+
clock: {
|
|
125
|
+
set: (renderFunc: polygon_editor.RenderFunc) => void;
|
|
126
|
+
start: (renderFunc?: polygon_editor.RenderFunc | undefined, setStateFunc?: polygon_editor.SetState | undefined) => void;
|
|
127
|
+
stop: () => void;
|
|
128
|
+
step: (deltaTime?: number | undefined) => void;
|
|
129
|
+
};
|
|
130
|
+
pointer: (pointers: ([number, number] | [number, number, number, number, number, number])[]) => void;
|
|
131
|
+
blur: () => void;
|
|
132
|
+
pointerDown: () => void;
|
|
133
|
+
pointerUp: () => void;
|
|
134
|
+
setShape: (shape: InputShape | null) => void;
|
|
135
|
+
label: (type: string | null) => string;
|
|
136
|
+
tools: {
|
|
137
|
+
setTool: (tool: polygon_editor.ValidTools) => void;
|
|
138
|
+
unsetTool: (tool: polygon_editor.ValidTools) => void;
|
|
139
|
+
toggleTool: (tool: polygon_editor.ValidTools) => void;
|
|
140
|
+
updateVisibility: (tool: polygon_editor.ValidTools) => void;
|
|
141
|
+
setCanDelete(canDelete: boolean): void;
|
|
142
|
+
setCanDeselect(canDeselect: boolean): void;
|
|
143
|
+
lockToolSwitching(): void;
|
|
144
|
+
unlockToolSwitching(): void;
|
|
145
|
+
toggleToolSwitching(): void;
|
|
146
|
+
shortcuts: {
|
|
147
|
+
[k: string]: string;
|
|
148
|
+
};
|
|
149
|
+
getValidIntents(tool?: polygon_editor.ValidTools | undefined): {
|
|
150
|
+
actions: polygon_editor.ActionIntent[];
|
|
151
|
+
transitions: polygon_editor.TransitionIntent[];
|
|
152
|
+
keys: polygon_editor.ActionIntent[];
|
|
153
|
+
all: Record<string, string>;
|
|
154
|
+
current: Record<string, string>;
|
|
155
|
+
};
|
|
156
|
+
getToolInfo(): {
|
|
157
|
+
name: polygon_editor.ValidTools;
|
|
158
|
+
cursor: string;
|
|
159
|
+
selectionCount: number;
|
|
160
|
+
pointCount: number;
|
|
161
|
+
isOpen: boolean;
|
|
162
|
+
};
|
|
163
|
+
smartSelect(): void;
|
|
164
|
+
clearSelection(): void;
|
|
165
|
+
autoSelect(): void;
|
|
166
|
+
};
|
|
167
|
+
snap: {
|
|
168
|
+
enabled: () => boolean;
|
|
169
|
+
enable: () => void;
|
|
170
|
+
disable: () => void;
|
|
171
|
+
toggle: () => void;
|
|
172
|
+
pointsEnabled: () => boolean;
|
|
173
|
+
enablePoints: () => void;
|
|
174
|
+
disablePoints: () => void;
|
|
175
|
+
togglePoints: () => void;
|
|
176
|
+
linesEnabled: () => boolean;
|
|
177
|
+
enableLines: () => void;
|
|
178
|
+
disableLines: () => void;
|
|
179
|
+
toggleLines: () => void;
|
|
180
|
+
intersectionsEnabled: () => boolean;
|
|
181
|
+
enableIntersections: () => void;
|
|
182
|
+
disableIntersections: () => void;
|
|
183
|
+
toggleIntersections: () => void;
|
|
184
|
+
gridEnabled: () => boolean;
|
|
185
|
+
enableGrid: () => void;
|
|
186
|
+
disableGrid: () => void;
|
|
187
|
+
toggleGrid: () => void;
|
|
188
|
+
parallelEnabled: () => boolean;
|
|
189
|
+
enableParallel: () => void;
|
|
190
|
+
disableParallel: () => void;
|
|
191
|
+
toggleParallel: () => void;
|
|
192
|
+
getThreshold: () => number;
|
|
193
|
+
setThreshold: (threshold: number) => void;
|
|
194
|
+
isActive: () => boolean;
|
|
195
|
+
getSnapPoint: () => ([number, number] | [number, number, number, number, number, number]) | null;
|
|
196
|
+
getActiveGuides: () => polygon_editor.SnapGuide[];
|
|
197
|
+
getTargets: () => polygon_editor.SnapTarget[];
|
|
198
|
+
};
|
|
199
|
+
selectAllPoints: () => void;
|
|
200
|
+
setBounds: (bounds: {
|
|
201
|
+
x: number;
|
|
202
|
+
y: number;
|
|
203
|
+
width: number;
|
|
204
|
+
height: number;
|
|
205
|
+
} | null) => void;
|
|
206
|
+
lockAspectRatio: () => void;
|
|
207
|
+
unlockAspectRatio: () => void;
|
|
208
|
+
};
|
|
209
|
+
currentShape: InputShape | null;
|
|
210
|
+
state: SlowState;
|
|
211
|
+
isAddingPoint: boolean;
|
|
212
|
+
isSplitting: boolean;
|
|
213
|
+
isStamping: boolean | null;
|
|
214
|
+
isHoveringPoint: boolean;
|
|
215
|
+
transitionDirection: string | null;
|
|
216
|
+
transitionRotate: boolean;
|
|
217
|
+
defs: react_jsx_runtime.JSX.Element;
|
|
218
|
+
editor: react_jsx_runtime.JSX.Element | null;
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
type SimpleViewerContext = {
|
|
222
|
+
items: Reference<'Canvas'>[];
|
|
223
|
+
sequence: number[][];
|
|
224
|
+
hasNext: boolean;
|
|
225
|
+
hasPrevious: boolean;
|
|
226
|
+
setSequenceIndex: (newId: number) => void;
|
|
227
|
+
setCurrentCanvasId: (newId: string) => void;
|
|
228
|
+
setCurrentCanvasIndex: (newId: number) => void;
|
|
229
|
+
currentSequenceIndex: number;
|
|
230
|
+
nextCanvas: () => void;
|
|
231
|
+
previousCanvas: () => void;
|
|
232
|
+
};
|
|
233
|
+
type SimpleViewerProps = {
|
|
234
|
+
vault?: Vault;
|
|
235
|
+
manifest: string;
|
|
236
|
+
pagingEnabled?: boolean;
|
|
237
|
+
children: ReactNode;
|
|
238
|
+
startCanvas?: string;
|
|
239
|
+
rangeId?: string;
|
|
240
|
+
};
|
|
241
|
+
type SimpleViewerReducerState = {
|
|
242
|
+
sequence: number[][];
|
|
243
|
+
availableCanvases: Reference<'Canvas'>[];
|
|
244
|
+
visibleCanvases: Reference<'Canvas'>[];
|
|
245
|
+
currentCanvas: string | null;
|
|
246
|
+
isPaged: boolean;
|
|
247
|
+
rangeId: string | null;
|
|
248
|
+
};
|
|
249
|
+
interface SimpleViewerActions {
|
|
250
|
+
setCurrentCanvasId(newId: string): void;
|
|
251
|
+
setCurrentCanvasIndex(newId: number): void;
|
|
252
|
+
nextCanvas(): void;
|
|
253
|
+
previousCanvas(): void;
|
|
254
|
+
setCurrentRange(newId: string): void;
|
|
255
|
+
clearRange(): void;
|
|
256
|
+
setPagingEnabled(isEnabled: boolean): void;
|
|
257
|
+
}
|
|
258
|
+
type SimpleViewerActionsType = {
|
|
259
|
+
[T in keyof SimpleViewerActions]: {
|
|
260
|
+
type: T;
|
|
261
|
+
payload: Parameters<SimpleViewerActions[T]>[0];
|
|
262
|
+
};
|
|
263
|
+
}[keyof SimpleViewerActions];
|
|
264
|
+
|
|
265
|
+
type Polygons = ReturnType<typeof createHelper>;
|
|
266
|
+
type Point = [number, number] | [number, number, number, number, number, number];
|
|
267
|
+
type AnnotationRequest = {
|
|
268
|
+
annotationPopup?: React.ReactNode;
|
|
269
|
+
arguments?: Record<string, any>;
|
|
270
|
+
svgTheme?: Partial<SVGTheme>;
|
|
271
|
+
selectByDefault?: boolean;
|
|
272
|
+
bounds?: null | {
|
|
273
|
+
x: number;
|
|
274
|
+
y: number;
|
|
275
|
+
width: number;
|
|
276
|
+
height: number;
|
|
277
|
+
};
|
|
278
|
+
} & ({
|
|
279
|
+
type: 'polygon' | 'draw';
|
|
280
|
+
noBox?: boolean;
|
|
281
|
+
points?: Array<Point>;
|
|
282
|
+
open?: boolean;
|
|
283
|
+
selector?: undefined;
|
|
284
|
+
} | {
|
|
285
|
+
type: 'target';
|
|
286
|
+
selector: null | {
|
|
287
|
+
x: number;
|
|
288
|
+
y: number;
|
|
289
|
+
width: number;
|
|
290
|
+
height: number;
|
|
291
|
+
};
|
|
292
|
+
} | {
|
|
293
|
+
type: 'box';
|
|
294
|
+
selector?: null | {
|
|
295
|
+
x: number;
|
|
296
|
+
y: number;
|
|
297
|
+
width: number;
|
|
298
|
+
height: number;
|
|
299
|
+
};
|
|
300
|
+
});
|
|
301
|
+
type AnnotationRequestOptions = {
|
|
302
|
+
requestId: string;
|
|
303
|
+
canvasId?: string | null;
|
|
304
|
+
toolId?: keyof AtlasStore['switchTool'];
|
|
305
|
+
};
|
|
306
|
+
interface AtlasStore {
|
|
307
|
+
mode: ViewerMode;
|
|
308
|
+
tool: {
|
|
309
|
+
enabled: boolean;
|
|
310
|
+
requestId: string | null;
|
|
311
|
+
canvasId: string | null;
|
|
312
|
+
};
|
|
313
|
+
requestType: null | 'polygon' | 'target' | 'box' | 'draw';
|
|
314
|
+
metadata: Record<string, any>;
|
|
315
|
+
requests: Record<string, AnnotationRequest>;
|
|
316
|
+
switchTool: {
|
|
317
|
+
draw(): void;
|
|
318
|
+
pen(): void;
|
|
319
|
+
line(): void;
|
|
320
|
+
lineBox(): void;
|
|
321
|
+
box(): void;
|
|
322
|
+
triangle(): void;
|
|
323
|
+
hexagon(): void;
|
|
324
|
+
circle(): void;
|
|
325
|
+
remove(): void;
|
|
326
|
+
hand(): void;
|
|
327
|
+
pointer(): void;
|
|
328
|
+
};
|
|
329
|
+
history: {
|
|
330
|
+
canUndo: boolean;
|
|
331
|
+
canRedo: boolean;
|
|
332
|
+
undo(): void;
|
|
333
|
+
redo(): void;
|
|
334
|
+
};
|
|
335
|
+
stableViewport: null | {
|
|
336
|
+
x: number;
|
|
337
|
+
y: number;
|
|
338
|
+
width: number;
|
|
339
|
+
height: number;
|
|
340
|
+
zoom: number;
|
|
341
|
+
};
|
|
342
|
+
canvasRelativePositions: Record<string, {
|
|
343
|
+
x: number;
|
|
344
|
+
y: number;
|
|
345
|
+
width: number;
|
|
346
|
+
height: number;
|
|
347
|
+
}>;
|
|
348
|
+
canvasViewports: Record<string, {
|
|
349
|
+
x: number;
|
|
350
|
+
y: number;
|
|
351
|
+
width: number;
|
|
352
|
+
height: number;
|
|
353
|
+
zoom?: number;
|
|
354
|
+
}>;
|
|
355
|
+
validRequestIds: string[];
|
|
356
|
+
polygon: InputShape | null;
|
|
357
|
+
polygons: Polygons;
|
|
358
|
+
polygonState: SlowState;
|
|
359
|
+
setPolygonState: (state: SlowState | ((prev: SlowState) => SlowState)) => void;
|
|
360
|
+
setToolCanvasId: (canvasId: string) => void;
|
|
361
|
+
setMetadata(data: Record<string, any>, requestId?: string): void;
|
|
362
|
+
getRequestId(): {
|
|
363
|
+
requestId: string;
|
|
364
|
+
clear: () => void;
|
|
365
|
+
};
|
|
366
|
+
requestAnnotation(req: AnnotationRequest, options: AnnotationRequestOptions): Promise<AnnotationResponse | null>;
|
|
367
|
+
setAtlasRuntime(runtime: Runtime): void;
|
|
368
|
+
setCanvasRelativePosition(canvasId: string, position: {
|
|
369
|
+
x: number;
|
|
370
|
+
y: number;
|
|
371
|
+
width: number;
|
|
372
|
+
height: number;
|
|
373
|
+
}): void;
|
|
374
|
+
clearCanvasRelativePosition(canvasId: string): void;
|
|
375
|
+
clearAtlasRuntime(): void;
|
|
376
|
+
completeRequest(requestId?: string): void;
|
|
377
|
+
cancelRequest(requestId?: string): void;
|
|
378
|
+
reset(): void;
|
|
379
|
+
changeMode(mode: ViewerMode): void;
|
|
380
|
+
nudgeLeft(): void;
|
|
381
|
+
nudgeRight(): void;
|
|
382
|
+
nudgeUp(): void;
|
|
383
|
+
nudgeDown(): void;
|
|
384
|
+
zoomIn(): void;
|
|
385
|
+
zoomOut(): void;
|
|
386
|
+
goHome(): void;
|
|
387
|
+
}
|
|
388
|
+
declare function polygonToTarget(polygon: InputShape, on?: {
|
|
389
|
+
width: number;
|
|
390
|
+
height: number;
|
|
391
|
+
} | null): FragmentSelector | SvgSelector | null;
|
|
392
|
+
declare function requestToAnnotationResponse(request: AnnotationRequest): Omit<AnnotationResponse, 'id'>;
|
|
393
|
+
type AnnotationResponse = {
|
|
394
|
+
id: string;
|
|
395
|
+
canvasId?: string | null;
|
|
396
|
+
polygon: InputShape | null;
|
|
397
|
+
cancelled?: boolean;
|
|
398
|
+
requestType: 'draw' | 'polygon' | 'target' | 'box';
|
|
399
|
+
target: FragmentSelector | SvgSelector | null;
|
|
400
|
+
boundingBox: {
|
|
401
|
+
x: number;
|
|
402
|
+
y: number;
|
|
403
|
+
width: number;
|
|
404
|
+
height: number;
|
|
405
|
+
} | null;
|
|
406
|
+
metadata: Record<string, any>;
|
|
407
|
+
arguments: Record<string, any>;
|
|
408
|
+
};
|
|
409
|
+
type AtlasStoreEvents = {
|
|
410
|
+
'atlas.canvas-click': {
|
|
411
|
+
canvasId: string;
|
|
412
|
+
target: {
|
|
413
|
+
x: number;
|
|
414
|
+
y: number;
|
|
415
|
+
};
|
|
416
|
+
worldTarget: {
|
|
417
|
+
x: number;
|
|
418
|
+
y: number;
|
|
419
|
+
};
|
|
420
|
+
};
|
|
421
|
+
'atlas.viewport-change': {
|
|
422
|
+
x: number;
|
|
423
|
+
y: number;
|
|
424
|
+
width: number;
|
|
425
|
+
height: number;
|
|
426
|
+
zoom: number;
|
|
427
|
+
};
|
|
428
|
+
'atlas.ready': {
|
|
429
|
+
runtime: Runtime;
|
|
430
|
+
};
|
|
431
|
+
'atlas.annotation-completed': AnnotationResponse;
|
|
432
|
+
'atlas.annotation-request': {
|
|
433
|
+
id: string;
|
|
434
|
+
};
|
|
435
|
+
'atlas.request-cancelled': {
|
|
436
|
+
id: string;
|
|
437
|
+
};
|
|
438
|
+
'atlas.polygon-render': {
|
|
439
|
+
state: RenderState;
|
|
440
|
+
slowState: SlowState;
|
|
441
|
+
dt: number;
|
|
442
|
+
};
|
|
443
|
+
'atlas.polygon-update': {
|
|
444
|
+
id?: string;
|
|
445
|
+
points: Array<Point>;
|
|
446
|
+
open: boolean;
|
|
447
|
+
};
|
|
448
|
+
};
|
|
449
|
+
interface CreateAtlasStoreProps {
|
|
450
|
+
events: Emitter<AtlasStoreEvents>;
|
|
451
|
+
keyboardShortcutsEnabled?: boolean;
|
|
452
|
+
keyboardShortcutMapping?: Record<string, string>;
|
|
453
|
+
enabledTools?: Array<ValidTools>;
|
|
454
|
+
debug?: boolean;
|
|
455
|
+
}
|
|
456
|
+
declare function createAtlasStore({ events, enabledTools, keyboardShortcutMapping, keyboardShortcutsEnabled, debug, }: CreateAtlasStoreProps): zustand_vanilla.StoreApi<AtlasStore>;
|
|
457
|
+
|
|
458
|
+
declare const AtlasStoreReactContext: React$1.Context<StoreApi<AtlasStore> | null>;
|
|
459
|
+
declare function useAtlasStore(): StoreApi<AtlasStore>;
|
|
460
|
+
declare function getAtlasStoreByName(name?: string): AtlasStore;
|
|
461
|
+
declare function AtlasStoreProvider({ children, name, existing, atlasStoreConfig, }: {
|
|
462
|
+
name?: string;
|
|
463
|
+
children: React.ReactNode;
|
|
464
|
+
existing?: StoreApi<AtlasStore>;
|
|
465
|
+
atlasStoreConfig?: Partial<CreateAtlasStoreProps>;
|
|
466
|
+
}): react_jsx_runtime.JSX.Element;
|
|
467
|
+
|
|
468
|
+
declare const RenderAnnotation: FC<{
|
|
469
|
+
id: string;
|
|
470
|
+
className?: string;
|
|
471
|
+
style?: BoxStyle;
|
|
472
|
+
interactive?: boolean;
|
|
473
|
+
}>;
|
|
474
|
+
|
|
475
|
+
declare const RenderAnnotationPage: FC<{
|
|
476
|
+
page: AnnotationPage | AnnotationPageNormalized;
|
|
477
|
+
className?: string;
|
|
478
|
+
}>;
|
|
479
|
+
|
|
480
|
+
interface AudioComponentProps {
|
|
481
|
+
media: SingleAudio;
|
|
482
|
+
startTime?: number | null;
|
|
483
|
+
children: ReactNode;
|
|
484
|
+
}
|
|
485
|
+
declare function AudioHTML({ media, startTime, children }: AudioComponentProps): react_jsx_runtime.JSX.Element;
|
|
486
|
+
declare function Audio({ media, mediaControlsDeps, audioCopmonent, children, }: {
|
|
487
|
+
media: SingleAudio;
|
|
488
|
+
mediaControlsDeps?: any[];
|
|
489
|
+
children: ReactNode;
|
|
490
|
+
audioCopmonent?: ComponentType<AudioComponentProps>;
|
|
491
|
+
}): null;
|
|
492
|
+
|
|
493
|
+
interface VideoComponentProps {
|
|
494
|
+
element: RefObject<HTMLVideoElement>;
|
|
495
|
+
media: SingleVideo;
|
|
496
|
+
playPause: () => void;
|
|
497
|
+
canvas: CanvasNormalized;
|
|
498
|
+
poster?: string;
|
|
499
|
+
startTime?: number;
|
|
500
|
+
captions?: MediaStrategy['captions'];
|
|
501
|
+
}
|
|
502
|
+
declare function VideoHTML({ element, media, startTime, playPause, poster, }: VideoComponentProps): react_jsx_runtime.JSX.Element;
|
|
503
|
+
declare function Video({ media, mediaControlsDeps, children, videoComponent, captions, }: {
|
|
504
|
+
media: SingleVideo;
|
|
505
|
+
mediaControlsDeps?: any[];
|
|
506
|
+
children: ReactNode;
|
|
507
|
+
posterCanvasId?: string;
|
|
508
|
+
videoComponent?: ComponentType<VideoComponentProps>;
|
|
509
|
+
captions?: MediaStrategy['captions'];
|
|
510
|
+
}): null;
|
|
511
|
+
|
|
512
|
+
type CanvasProps = {
|
|
513
|
+
x?: number;
|
|
514
|
+
y?: number;
|
|
515
|
+
onCreated?: any;
|
|
516
|
+
onChoiceChange?: (choice?: ChoiceDescription) => void;
|
|
517
|
+
registerActions?: (actions: StrategyActions) => void;
|
|
518
|
+
defaultChoices?: Array<{
|
|
519
|
+
id: string;
|
|
520
|
+
opacity?: number;
|
|
521
|
+
}>;
|
|
522
|
+
isStatic?: boolean;
|
|
523
|
+
keepCanvasScale?: boolean;
|
|
524
|
+
children?: ReactNode;
|
|
525
|
+
renderViewerControls?: (strategy: SingleImageStrategy | EmptyStrategy) => ReactNode;
|
|
526
|
+
viewControlsDeps?: any[];
|
|
527
|
+
renderMediaControls?: (strategy: MediaStrategy) => ReactNode;
|
|
528
|
+
renderComplexTimelineControls?: (strategy: ComplexTimelineStrategy) => ReactNode;
|
|
529
|
+
complexTimelineControlsDeps?: any[];
|
|
530
|
+
mediaControlsDeps?: any[];
|
|
531
|
+
strategies?: Array<RenderingStrategy['type']>;
|
|
532
|
+
backgroundStyle?: BoxStyle;
|
|
533
|
+
alwaysShowBackground?: boolean;
|
|
534
|
+
enableSizes?: boolean;
|
|
535
|
+
enableYouTube?: boolean;
|
|
536
|
+
ignoreSize?: boolean;
|
|
537
|
+
throwOnUnknown?: boolean;
|
|
538
|
+
renderContextMenu?: (options: RenderContextProps) => ReactNode;
|
|
539
|
+
onClickPaintingAnnotation?: (id: string, image: ImageWithOptionalService, e: any) => void;
|
|
540
|
+
components?: {
|
|
541
|
+
Video?: React__default.ComponentType<VideoComponentProps>;
|
|
542
|
+
Audio?: React__default.ComponentType<AudioComponentProps>;
|
|
543
|
+
};
|
|
544
|
+
annotationPopup?: React__default.ReactNode;
|
|
545
|
+
svgTheme?: Partial<SVGTheme>;
|
|
546
|
+
renderAnnotationContextMenu?: (options: RenderContextProps) => React__default.ReactNode;
|
|
547
|
+
};
|
|
548
|
+
declare function RenderCanvas({ x, y, onChoiceChange, registerActions, defaultChoices, isStatic, renderViewerControls, renderMediaControls, renderComplexTimelineControls, complexTimelineControlsDeps, viewControlsDeps, mediaControlsDeps, strategies, throwOnUnknown, backgroundStyle, alwaysShowBackground, keepCanvasScale, enableSizes, enableYouTube, onClickPaintingAnnotation, components, children, annotationPopup, svgTheme, renderContextMenu, renderAnnotationContextMenu, }: CanvasProps): react_jsx_runtime.JSX.Element;
|
|
549
|
+
|
|
550
|
+
declare function CanvasBackground({ style }: {
|
|
551
|
+
style?: BoxStyle;
|
|
552
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
553
|
+
|
|
554
|
+
declare function RenderImage({ id, image, thumbnail, isStatic, x, y, children, selector, onClick, enableSizes, }: {
|
|
555
|
+
id: string;
|
|
556
|
+
image: ImageWithOptionalService;
|
|
557
|
+
thumbnail?: ImageCandidate;
|
|
558
|
+
isStatic?: boolean;
|
|
559
|
+
enableSizes?: boolean;
|
|
560
|
+
selector?: BoxSelector;
|
|
561
|
+
x?: number;
|
|
562
|
+
y?: number;
|
|
563
|
+
children?: ReactNode;
|
|
564
|
+
onClick?: (e: any) => void;
|
|
565
|
+
}): react_jsx_runtime.JSX.Element;
|
|
566
|
+
|
|
567
|
+
declare function ModelHTML({ model }: {
|
|
568
|
+
model: any;
|
|
569
|
+
}): react_jsx_runtime.JSX.Element;
|
|
570
|
+
declare function Model({ model, name }: {
|
|
571
|
+
model: any;
|
|
572
|
+
name?: string;
|
|
573
|
+
}): null;
|
|
574
|
+
|
|
575
|
+
interface PlaceholderCanvasProps {
|
|
576
|
+
renderViewerControls?: (strategy: SingleImageStrategy | EmptyStrategy) => ReactNode;
|
|
577
|
+
}
|
|
578
|
+
declare function PlaceholderCanvas(props: PlaceholderCanvasProps): react_jsx_runtime.JSX.Element | null;
|
|
579
|
+
|
|
580
|
+
type ViewerProps = AtlasProps & {
|
|
581
|
+
name?: string;
|
|
582
|
+
height?: number | string;
|
|
583
|
+
width?: number | string;
|
|
584
|
+
resizeHash?: number;
|
|
585
|
+
containerProps?: any;
|
|
586
|
+
outerContainerProps?: any;
|
|
587
|
+
aspectRatio?: number;
|
|
588
|
+
errorFallback?: any;
|
|
589
|
+
renderPreset?: Preset;
|
|
590
|
+
worldScale?: number;
|
|
591
|
+
updateViewportTimeout?: number;
|
|
592
|
+
} & {
|
|
593
|
+
children: ReactNode;
|
|
594
|
+
};
|
|
595
|
+
declare function Viewer(props: ViewerProps): react_jsx_runtime.JSX.Element;
|
|
596
|
+
|
|
597
|
+
interface CanvasPanelProps {
|
|
598
|
+
manifest: string;
|
|
599
|
+
startCanvas?: string;
|
|
600
|
+
rangeId?: string;
|
|
601
|
+
pagingEnabled?: boolean;
|
|
602
|
+
header?: ReactNode;
|
|
603
|
+
children?: ReactNode;
|
|
604
|
+
mode?: ViewerMode;
|
|
605
|
+
reuseAtlas?: boolean;
|
|
606
|
+
runtimeOptions?: any;
|
|
607
|
+
renderPreset?: any;
|
|
608
|
+
name?: string;
|
|
609
|
+
height?: number;
|
|
610
|
+
spacing?: number;
|
|
611
|
+
components?: {
|
|
612
|
+
ViewerControls?: FC;
|
|
613
|
+
MediaControls?: FC;
|
|
614
|
+
ComplexTimelineControls?: FC;
|
|
615
|
+
};
|
|
616
|
+
canvasProps?: Omit<Partial<CanvasProps>, 'x'>;
|
|
617
|
+
annotations?: ReactNode;
|
|
618
|
+
annotationPopup?: ReactNode;
|
|
619
|
+
svgTheme?: SVGTheme;
|
|
620
|
+
updateViewportTimeout?: number;
|
|
621
|
+
renderContextMenu?: (options: RenderContextProps) => ReactNode;
|
|
622
|
+
keepCanvasScale?: boolean;
|
|
623
|
+
renderAnnotationContextMenu?: (options: RenderContextProps) => ReactNode;
|
|
624
|
+
}
|
|
625
|
+
type CanvasPanelType = ForwardRefExoticComponent<CanvasPanelProps & RefAttributes<SimpleViewerContext>> & {
|
|
626
|
+
RenderImage: typeof RenderImage;
|
|
627
|
+
RenderCanvas: typeof RenderCanvas;
|
|
628
|
+
RenderAnnotationPage: typeof RenderAnnotationPage;
|
|
629
|
+
RenderAnnotation: typeof RenderAnnotation;
|
|
630
|
+
Viewer: typeof Viewer;
|
|
631
|
+
CanvasBackground: typeof CanvasBackground;
|
|
632
|
+
Audio: typeof Audio;
|
|
633
|
+
Video: typeof Video;
|
|
634
|
+
Model: typeof Model;
|
|
635
|
+
AudioHTML: typeof AudioHTML;
|
|
636
|
+
VideoHTML: typeof VideoHTML;
|
|
637
|
+
ModelHTML: typeof ModelHTML;
|
|
638
|
+
PlaceholderCanvas: typeof PlaceholderCanvas;
|
|
639
|
+
getAtlasStoreByName: typeof getAtlasStoreByName;
|
|
640
|
+
};
|
|
641
|
+
declare const CanvasPanel: CanvasPanelType;
|
|
642
|
+
|
|
643
|
+
export { type AudioComponentProps as A, type CanvasPanelProps as C, type RenderContextProps as R, type SVGTheme as S, type VideoComponentProps as V, type SimpleViewerContext as a, type AtlasStore as b, type AnnotationRequest as c, type AnnotationResponse as d, type AnnotationRequestOptions as e, type SimpleViewerProps as f, CanvasPanel as g, type AtlasStoreEvents as h, type CreateAtlasStoreProps as i, createAtlasStore as j, AtlasStoreReactContext as k, useAtlasStore as l, getAtlasStoreByName as m, AtlasStoreProvider as n, RenderAnnotation as o, polygonToTarget as p, RenderAnnotationPage as q, requestToAnnotationResponse as r, useContextMenuStore as s, useAtlasContextMenu as t, useSvgEditor as u, defaultSvgTheme as v, type SimpleViewerReducerState as w, type SimpleViewerActions as x, type SimpleViewerActionsType as y };
|