@manifest-editor/shell 1.1.0 → 1.3.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/dist/index.cjs +1775 -967
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +345 -79
- package/dist/index.d.ts +345 -79
- package/dist/index.js +1681 -865
- package/dist/index.js.map +1 -1
- package/package.json +13 -10
package/dist/index.d.ts
CHANGED
|
@@ -1,78 +1,23 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ReactNode, SetStateAction, Dispatch, HTMLAttributes } from 'react';
|
|
4
|
+
import * as _manifest_editor_creator_api from '@manifest-editor/creator-api';
|
|
5
|
+
import { CreatableResource, CreatorDefinition as CreatorDefinition$1, Creator } from '@manifest-editor/creator-api';
|
|
6
|
+
import * as _iiif_presentation_3 from '@iiif/presentation-3';
|
|
7
|
+
import { Collection, Reference, SpecificResource, FragmentSelector, SvgSelector } from '@iiif/presentation-3';
|
|
4
8
|
import { Vault } from '@iiif/helpers/vault';
|
|
9
|
+
import { RenderingStrategy } from 'react-iiif-vault';
|
|
5
10
|
import { TransitionStatus } from 'react-transition-group';
|
|
6
|
-
import * as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
11
|
+
import * as zustand from 'zustand';
|
|
12
|
+
import { StoreApi } from 'zustand';
|
|
13
|
+
import { ViewerMode, Runtime } from '@atlas-viewer/atlas';
|
|
14
|
+
import { Emitter } from 'mitt';
|
|
15
|
+
import { InputShape, SlowState, RenderState, createHelper } from 'polygon-editor';
|
|
9
16
|
import { Vault as Vault$1 } from '@iiif/helpers';
|
|
10
17
|
import { EditorInstance } from '@manifest-editor/editor-api';
|
|
11
18
|
import * as styled_components from 'styled-components';
|
|
12
19
|
import * as styled_components_dist_types from 'styled-components/dist/types';
|
|
13
|
-
import { Emitter } from 'mitt';
|
|
14
20
|
import { ManifestNormalized } from '@iiif/presentation-3-normalized';
|
|
15
|
-
import * as zustand from 'zustand';
|
|
16
|
-
|
|
17
|
-
interface EditableResource {
|
|
18
|
-
parent?: Reference;
|
|
19
|
-
property?: string;
|
|
20
|
-
index?: number;
|
|
21
|
-
resource: SpecificResource;
|
|
22
|
-
onlyReference?: boolean;
|
|
23
|
-
}
|
|
24
|
-
interface CreatableResource {
|
|
25
|
-
type: string;
|
|
26
|
-
parent?: Reference;
|
|
27
|
-
property?: string;
|
|
28
|
-
index?: number;
|
|
29
|
-
onlyReference?: boolean;
|
|
30
|
-
target?: Reference;
|
|
31
|
-
initialData?: any;
|
|
32
|
-
isPainting?: boolean;
|
|
33
|
-
}
|
|
34
|
-
interface EditingStackState {
|
|
35
|
-
current: EditableResource | null;
|
|
36
|
-
stack: Array<EditableResource>;
|
|
37
|
-
create: {
|
|
38
|
-
resource: CreatableResource;
|
|
39
|
-
options: any;
|
|
40
|
-
} | null;
|
|
41
|
-
}
|
|
42
|
-
interface EditingStackActions {
|
|
43
|
-
edit(resource: EditableResource | null, reset?: boolean): void;
|
|
44
|
-
updateCurrent(resource: Partial<EditableResource>): void;
|
|
45
|
-
close(): void;
|
|
46
|
-
back(): void;
|
|
47
|
-
create(resource: CreatableResource, options?: any): () => void;
|
|
48
|
-
}
|
|
49
|
-
type EditingStackActionCreators = {
|
|
50
|
-
type: "edit";
|
|
51
|
-
payload: {
|
|
52
|
-
resource: EditableResource | null;
|
|
53
|
-
reset?: boolean;
|
|
54
|
-
};
|
|
55
|
-
} | {
|
|
56
|
-
type: "updateCurrent";
|
|
57
|
-
payload: {
|
|
58
|
-
resource: EditableResource;
|
|
59
|
-
};
|
|
60
|
-
} | {
|
|
61
|
-
type: "syncRemoval";
|
|
62
|
-
payload: {
|
|
63
|
-
resource: EditableResource;
|
|
64
|
-
};
|
|
65
|
-
} | {
|
|
66
|
-
type: "back";
|
|
67
|
-
} | {
|
|
68
|
-
type: "create";
|
|
69
|
-
payload: {
|
|
70
|
-
resource: CreatableResource | null;
|
|
71
|
-
options?: any;
|
|
72
|
-
};
|
|
73
|
-
} | {
|
|
74
|
-
type: "close";
|
|
75
|
-
};
|
|
76
21
|
|
|
77
22
|
interface Preview {
|
|
78
23
|
id: string;
|
|
@@ -152,6 +97,7 @@ interface Config {
|
|
|
152
97
|
defaultLanguage: string;
|
|
153
98
|
availableLanguages: string[];
|
|
154
99
|
advancedLanguageMode: boolean;
|
|
100
|
+
textGranularityEnabled?: boolean;
|
|
155
101
|
};
|
|
156
102
|
export: {
|
|
157
103
|
baseIdentifier: string | null;
|
|
@@ -183,6 +129,56 @@ declare function ConfigProvider({ children, config, saveConfig, }: {
|
|
|
183
129
|
saveConfig?: (config: Partial<Config>) => void;
|
|
184
130
|
}): react_jsx_runtime.JSX.Element;
|
|
185
131
|
|
|
132
|
+
interface EditableResource {
|
|
133
|
+
parent?: Reference;
|
|
134
|
+
property?: string;
|
|
135
|
+
index?: number;
|
|
136
|
+
resource: SpecificResource;
|
|
137
|
+
onlyReference?: boolean;
|
|
138
|
+
}
|
|
139
|
+
interface EditingStackState {
|
|
140
|
+
current: EditableResource | null;
|
|
141
|
+
stack: Array<EditableResource>;
|
|
142
|
+
create: {
|
|
143
|
+
resource: CreatableResource;
|
|
144
|
+
options: any;
|
|
145
|
+
} | null;
|
|
146
|
+
}
|
|
147
|
+
interface EditingStackActions {
|
|
148
|
+
edit(resource: EditableResource | null, reset?: boolean): void;
|
|
149
|
+
updateCurrent(resource: Partial<EditableResource>): void;
|
|
150
|
+
close(): void;
|
|
151
|
+
back(): void;
|
|
152
|
+
create(resource: CreatableResource, options?: any): () => void;
|
|
153
|
+
}
|
|
154
|
+
type EditingStackActionCreators = {
|
|
155
|
+
type: "edit";
|
|
156
|
+
payload: {
|
|
157
|
+
resource: EditableResource | null;
|
|
158
|
+
reset?: boolean;
|
|
159
|
+
};
|
|
160
|
+
} | {
|
|
161
|
+
type: "updateCurrent";
|
|
162
|
+
payload: {
|
|
163
|
+
resource: EditableResource;
|
|
164
|
+
};
|
|
165
|
+
} | {
|
|
166
|
+
type: "syncRemoval";
|
|
167
|
+
payload: {
|
|
168
|
+
resource: EditableResource;
|
|
169
|
+
};
|
|
170
|
+
} | {
|
|
171
|
+
type: "back";
|
|
172
|
+
} | {
|
|
173
|
+
type: "create";
|
|
174
|
+
payload: {
|
|
175
|
+
resource: CreatableResource | null;
|
|
176
|
+
options?: any;
|
|
177
|
+
};
|
|
178
|
+
} | {
|
|
179
|
+
type: "close";
|
|
180
|
+
};
|
|
181
|
+
|
|
186
182
|
type CreatorDefinition = any;
|
|
187
183
|
interface LayoutProviderProps {
|
|
188
184
|
loading?: true;
|
|
@@ -190,6 +186,7 @@ interface LayoutProviderProps {
|
|
|
190
186
|
rightPanels: Array<LayoutPanel>;
|
|
191
187
|
centerPanels: Array<LayoutPanel>;
|
|
192
188
|
modals?: Array<LayoutPanel>;
|
|
189
|
+
annotations?: Array<AnnotationPanel>;
|
|
193
190
|
}
|
|
194
191
|
interface LayoutContext extends LayoutProviderProps {
|
|
195
192
|
state: LayoutState;
|
|
@@ -314,6 +311,11 @@ type LayoutFunction = (state: any, ctx: {
|
|
|
314
311
|
vault?: Vault;
|
|
315
312
|
transition?: TransitionStatus;
|
|
316
313
|
} & LayoutContext, app: AppState) => ReactNode;
|
|
314
|
+
interface AnnotationPanel {
|
|
315
|
+
id: string;
|
|
316
|
+
label: string;
|
|
317
|
+
render: () => React.ReactNode | null;
|
|
318
|
+
}
|
|
317
319
|
interface LayoutPanel {
|
|
318
320
|
id: string;
|
|
319
321
|
label: string;
|
|
@@ -351,6 +353,14 @@ interface PinnedLayoutPanel<T = any> extends LayoutPanel {
|
|
|
351
353
|
pinned: true;
|
|
352
354
|
state: T;
|
|
353
355
|
}
|
|
356
|
+
interface CanvasEditorDefinition {
|
|
357
|
+
id: string;
|
|
358
|
+
label: string;
|
|
359
|
+
supports: {
|
|
360
|
+
strategy: (strategy: RenderingStrategy, resource: EditableResource, vault: Vault) => boolean;
|
|
361
|
+
};
|
|
362
|
+
component: (strategy: RenderingStrategy) => ReactNode | null;
|
|
363
|
+
}
|
|
354
364
|
interface EditorDefinition {
|
|
355
365
|
id: string;
|
|
356
366
|
label: string;
|
|
@@ -390,6 +400,7 @@ interface LayoutProps$1 {
|
|
|
390
400
|
rightPanels: Array<LayoutPanel>;
|
|
391
401
|
centerPanels: Array<LayoutPanel>;
|
|
392
402
|
modals?: Array<LayoutPanel>;
|
|
403
|
+
annotations?: Array<AnnotationPanel>;
|
|
393
404
|
footer?: ReactNode;
|
|
394
405
|
menu?: ReactNode;
|
|
395
406
|
header?: ReactNode;
|
|
@@ -403,6 +414,7 @@ interface LayoutProps$1 {
|
|
|
403
414
|
editors?: EditorDefinition[];
|
|
404
415
|
resources?: (string | ResourceDefinition)[];
|
|
405
416
|
creators?: CreatorDefinition[];
|
|
417
|
+
canvasEditors?: CanvasEditorDefinition[];
|
|
406
418
|
}
|
|
407
419
|
|
|
408
420
|
type AppContext = {
|
|
@@ -411,6 +423,7 @@ type AppContext = {
|
|
|
411
423
|
args?: any;
|
|
412
424
|
};
|
|
413
425
|
type LoadedApp = Partial<LayoutProps$1> & {
|
|
426
|
+
config?: Partial<Config>;
|
|
414
427
|
default: {
|
|
415
428
|
id: string;
|
|
416
429
|
title: string;
|
|
@@ -426,7 +439,21 @@ type LoadedApp = Partial<LayoutProps$1> & {
|
|
|
426
439
|
type MappedApp$1 = {
|
|
427
440
|
metadata: LoadedApp["default"];
|
|
428
441
|
layout: LayoutProps$1;
|
|
442
|
+
config?: Partial<Config>;
|
|
429
443
|
};
|
|
444
|
+
interface AppExtension {
|
|
445
|
+
config?: Partial<Config>;
|
|
446
|
+
leftPanels?: LayoutPanel[];
|
|
447
|
+
centerPanels?: LayoutPanel[];
|
|
448
|
+
rightPanels?: LayoutPanel[];
|
|
449
|
+
modalPanels?: LayoutPanel[];
|
|
450
|
+
editors?: EditorDefinition[];
|
|
451
|
+
creators?: CreatorDefinition$1[];
|
|
452
|
+
canvasEditors?: CanvasEditorDefinition[];
|
|
453
|
+
annotations?: AnnotationPanel[];
|
|
454
|
+
leftPanelIds?: string[];
|
|
455
|
+
disableSideEffects?: string[];
|
|
456
|
+
}
|
|
430
457
|
type AppState = {
|
|
431
458
|
state: null | any;
|
|
432
459
|
setState: SetStateAction<any>;
|
|
@@ -435,8 +462,8 @@ declare const PrimeAppReactContext: react.Context<MappedApp$1 | null>;
|
|
|
435
462
|
declare function useAppInstance(): AppContext;
|
|
436
463
|
declare function useApp(): MappedApp$1;
|
|
437
464
|
declare function useAppState<S = any>(): {
|
|
438
|
-
state: any;
|
|
439
|
-
setState: any
|
|
465
|
+
state: null | any;
|
|
466
|
+
setState: SetStateAction<any>;
|
|
440
467
|
};
|
|
441
468
|
declare function AppProvider({ instanceId, appId, args, definition, children, initialState, }: {
|
|
442
469
|
initialState?: any;
|
|
@@ -519,17 +546,182 @@ declare function AppResourceProvider({ resource, children }: {
|
|
|
519
546
|
children: React.ReactNode;
|
|
520
547
|
}): react_jsx_runtime.JSX.Element;
|
|
521
548
|
|
|
549
|
+
type Polygons = ReturnType<typeof createHelper>;
|
|
550
|
+
type Point = [number, number] | [number, number, number, number, number, number];
|
|
551
|
+
type AnnotationRequest = {
|
|
552
|
+
type: "polygon";
|
|
553
|
+
points?: Array<Point>;
|
|
554
|
+
open?: boolean;
|
|
555
|
+
} | {
|
|
556
|
+
type: "target";
|
|
557
|
+
selector: null | {
|
|
558
|
+
x: number;
|
|
559
|
+
y: number;
|
|
560
|
+
width: number;
|
|
561
|
+
height: number;
|
|
562
|
+
};
|
|
563
|
+
} | {
|
|
564
|
+
type: "box";
|
|
565
|
+
selector: null | {
|
|
566
|
+
x: number;
|
|
567
|
+
y: number;
|
|
568
|
+
width: number;
|
|
569
|
+
height: number;
|
|
570
|
+
};
|
|
571
|
+
};
|
|
572
|
+
type AnnotationRequestOptions = {
|
|
573
|
+
requestId: string;
|
|
574
|
+
canvasId?: string | null;
|
|
575
|
+
toolId?: keyof AtlasStore["switchTool"];
|
|
576
|
+
};
|
|
577
|
+
interface AtlasStore {
|
|
578
|
+
mode: ViewerMode;
|
|
579
|
+
tool: {
|
|
580
|
+
enabled: boolean;
|
|
581
|
+
requestId: string | null;
|
|
582
|
+
canvasId: string | null;
|
|
583
|
+
};
|
|
584
|
+
requestType: null | "polygon" | "target" | "box";
|
|
585
|
+
switchTool: {
|
|
586
|
+
draw(): void;
|
|
587
|
+
polygon(): void;
|
|
588
|
+
line(): void;
|
|
589
|
+
lineBox(): void;
|
|
590
|
+
square(): void;
|
|
591
|
+
triangle(): void;
|
|
592
|
+
hexagon(): void;
|
|
593
|
+
circle(): void;
|
|
594
|
+
remove(): void;
|
|
595
|
+
};
|
|
596
|
+
history: {
|
|
597
|
+
canUndo: boolean;
|
|
598
|
+
canRedo: boolean;
|
|
599
|
+
undo(): void;
|
|
600
|
+
redo(): void;
|
|
601
|
+
};
|
|
602
|
+
stableViewport: null | {
|
|
603
|
+
x: number;
|
|
604
|
+
y: number;
|
|
605
|
+
width: number;
|
|
606
|
+
height: number;
|
|
607
|
+
zoom: number;
|
|
608
|
+
};
|
|
609
|
+
canvasRelativePositions: Record<string, {
|
|
610
|
+
x: number;
|
|
611
|
+
y: number;
|
|
612
|
+
width: number;
|
|
613
|
+
height: number;
|
|
614
|
+
}>;
|
|
615
|
+
canvasViewports: Record<string, {
|
|
616
|
+
x: number;
|
|
617
|
+
y: number;
|
|
618
|
+
width: number;
|
|
619
|
+
height: number;
|
|
620
|
+
zoom: number;
|
|
621
|
+
}>;
|
|
622
|
+
validRequestIds: string[];
|
|
623
|
+
polygon: InputShape | null;
|
|
624
|
+
polygons: Polygons;
|
|
625
|
+
polygonState: SlowState;
|
|
626
|
+
setPolygonState: (state: SlowState | ((prev: SlowState) => SlowState)) => void;
|
|
627
|
+
setToolCanvasId: (canvasId: string) => void;
|
|
628
|
+
getRequestId(): {
|
|
629
|
+
requestId: string;
|
|
630
|
+
clear: () => void;
|
|
631
|
+
};
|
|
632
|
+
requestAnnotation(req: AnnotationRequest, options: AnnotationRequestOptions): Promise<AnnotationResponse | null>;
|
|
633
|
+
setAtlasRuntime(runtime: Runtime): void;
|
|
634
|
+
setCanvasRelativePosition(canvasId: string, position: {
|
|
635
|
+
x: number;
|
|
636
|
+
y: number;
|
|
637
|
+
width: number;
|
|
638
|
+
height: number;
|
|
639
|
+
}): void;
|
|
640
|
+
clearCanvasRelativePosition(canvasId: string): void;
|
|
641
|
+
clearAtlasRuntime(): void;
|
|
642
|
+
completeRequest(requestId?: string): void;
|
|
643
|
+
cancelRequest(requestId: string): void;
|
|
644
|
+
reset(): void;
|
|
645
|
+
changeMode(mode: ViewerMode): void;
|
|
646
|
+
nudgeLeft(): void;
|
|
647
|
+
nudgeRight(): void;
|
|
648
|
+
nudgeUp(): void;
|
|
649
|
+
nudgeDown(): void;
|
|
650
|
+
zoomIn(): void;
|
|
651
|
+
zoomOut(): void;
|
|
652
|
+
goHome(): void;
|
|
653
|
+
}
|
|
654
|
+
declare function requestToAnnotationResponse(request: AnnotationRequest): Omit<AnnotationResponse, "id">;
|
|
655
|
+
type AnnotationResponse = {
|
|
656
|
+
id: string;
|
|
657
|
+
canvasId?: string | null;
|
|
658
|
+
polygon: InputShape | null;
|
|
659
|
+
cancelled?: boolean;
|
|
660
|
+
requestType: "polygon" | "target" | "box";
|
|
661
|
+
target: FragmentSelector | SvgSelector | null;
|
|
662
|
+
boundingBox: {
|
|
663
|
+
x: number;
|
|
664
|
+
y: number;
|
|
665
|
+
width: number;
|
|
666
|
+
height: number;
|
|
667
|
+
} | null;
|
|
668
|
+
};
|
|
669
|
+
type AtlasStoreEvents = {
|
|
670
|
+
"atlas.canvas-click": {
|
|
671
|
+
canvasId: string;
|
|
672
|
+
target: {
|
|
673
|
+
x: number;
|
|
674
|
+
y: number;
|
|
675
|
+
};
|
|
676
|
+
worldTarget: {
|
|
677
|
+
x: number;
|
|
678
|
+
y: number;
|
|
679
|
+
};
|
|
680
|
+
};
|
|
681
|
+
"atlas.viewport-change": {
|
|
682
|
+
x: number;
|
|
683
|
+
y: number;
|
|
684
|
+
width: number;
|
|
685
|
+
height: number;
|
|
686
|
+
zoom: number;
|
|
687
|
+
};
|
|
688
|
+
"atlas.ready": {
|
|
689
|
+
runtime: Runtime;
|
|
690
|
+
};
|
|
691
|
+
"atlas.annotation-completed": AnnotationResponse;
|
|
692
|
+
"atlas.annotation-request": {
|
|
693
|
+
id: string;
|
|
694
|
+
};
|
|
695
|
+
"atlas.request-cancelled": {
|
|
696
|
+
id: string;
|
|
697
|
+
};
|
|
698
|
+
"atlas.polygon-render": {
|
|
699
|
+
state: RenderState;
|
|
700
|
+
slowState: SlowState;
|
|
701
|
+
dt: number;
|
|
702
|
+
};
|
|
703
|
+
};
|
|
704
|
+
interface CreateAtlasStoreProps {
|
|
705
|
+
events: Emitter<AtlasStoreEvents>;
|
|
706
|
+
}
|
|
707
|
+
declare function createAtlasStore({ events }: CreateAtlasStoreProps): zustand.StoreApi<AtlasStore>;
|
|
708
|
+
|
|
709
|
+
declare const AtlasStoreReactContext: react.Context<StoreApi<AtlasStore> | null>;
|
|
710
|
+
declare function useAtlasStore(): StoreApi<AtlasStore>;
|
|
711
|
+
declare function AtlasStoreProvider({ children, }: {
|
|
712
|
+
children: React.ReactNode;
|
|
713
|
+
}): react_jsx_runtime.JSX.Element;
|
|
714
|
+
|
|
522
715
|
declare const baseCreator: LayoutPanel;
|
|
523
716
|
|
|
524
|
-
declare function matchBasedOnResource(resource: CreatableResource, list: CreatorDefinition$1[], options: {
|
|
525
|
-
vault: Vault;
|
|
526
|
-
}): CreatorDefinition$1[];
|
|
527
717
|
declare function useCreator(parent: any, property: string, type: string, target?: Reference, options?: {
|
|
528
718
|
isPainting?: boolean;
|
|
529
719
|
onlyReference?: boolean;
|
|
530
720
|
}): readonly [any, {
|
|
531
721
|
readonly create: (index?: number, initialData?: any) => void;
|
|
532
722
|
readonly edit: (resource: any, index?: number) => void;
|
|
723
|
+
readonly createFiltered: (filter: string, index?: number, initialData?: any) => void;
|
|
724
|
+
readonly creator: (initialCreator: string, initialData?: any) => void;
|
|
533
725
|
readonly buttonProps: {
|
|
534
726
|
"data-action-id": string;
|
|
535
727
|
};
|
|
@@ -544,9 +736,9 @@ declare function editBasedOnResource(resource: EditableResource, list: ResourceD
|
|
|
544
736
|
edit?: boolean;
|
|
545
737
|
vault: Vault$1;
|
|
546
738
|
}, config: EditorConfig): ResourceDefinition | null;
|
|
547
|
-
declare function BaseEditor({ currentTab }: {
|
|
739
|
+
declare function BaseEditor({ currentTab, }: {
|
|
548
740
|
currentTab?: string;
|
|
549
|
-
}): react_jsx_runtime.JSX.Element | null;
|
|
741
|
+
}): string | number | boolean | Iterable<ReactNode> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
550
742
|
|
|
551
743
|
declare function ConfigEditor(): react_jsx_runtime.JSX.Element;
|
|
552
744
|
|
|
@@ -554,7 +746,7 @@ declare function useEditingStack(): EditingStackActions;
|
|
|
554
746
|
declare function useEditingResource(): EditableResource | null;
|
|
555
747
|
declare function useEditingResourceStack(): EditableResource[];
|
|
556
748
|
declare function useCreatingResource(): {
|
|
557
|
-
resource: CreatableResource;
|
|
749
|
+
resource: _manifest_editor_creator_api.CreatableResource;
|
|
558
750
|
options: any;
|
|
559
751
|
} | null;
|
|
560
752
|
declare function useManifestEditor(): EditorInstance<Partial<_iiif_presentation_3.DescriptiveProperties> & Partial<_iiif_presentation_3.TechnicalProperties> & Partial<_iiif_presentation_3.LinkingProperties> & Partial<_iiif_presentation_3.StructuralProperties<unknown>> & Partial<_iiif_presentation_3.NavPlaceExtension & _iiif_presentation_3.TextGranularityExtension>>;
|
|
@@ -593,6 +785,7 @@ interface LayoutProps {
|
|
|
593
785
|
isLoading?: boolean;
|
|
594
786
|
className?: string;
|
|
595
787
|
centerPanelMenuPosition?: "top" | "bottom";
|
|
788
|
+
disableSideEffects?: string[];
|
|
596
789
|
}
|
|
597
790
|
declare const Layout: react.NamedExoticComponent<LayoutProps>;
|
|
598
791
|
|
|
@@ -629,8 +822,8 @@ declare const HandleControls: react.ForwardRefExoticComponent<{
|
|
|
629
822
|
dir: "left" | "right";
|
|
630
823
|
open: boolean;
|
|
631
824
|
actions: PanelActions;
|
|
632
|
-
transition?: TransitionStatus
|
|
633
|
-
reset?: (
|
|
825
|
+
transition?: TransitionStatus;
|
|
826
|
+
reset?: () => void;
|
|
634
827
|
} & react.RefAttributes<HTMLDivElement>>;
|
|
635
828
|
|
|
636
829
|
interface ModularPanelProps {
|
|
@@ -647,8 +840,8 @@ interface ModularPanelProps {
|
|
|
647
840
|
}
|
|
648
841
|
declare function useSetCustomTitle(): (title: string) => void;
|
|
649
842
|
declare const ModularPanelHeader: styled_components.IStyledComponent<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
650
|
-
$tabs?: boolean
|
|
651
|
-
$error?: boolean
|
|
843
|
+
$tabs?: boolean;
|
|
844
|
+
$error?: boolean;
|
|
652
845
|
}>>;
|
|
653
846
|
declare const ModulePanelButton: styled_components.IStyledComponent<"web", styled_components_dist_types.FastOmit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>>;
|
|
654
847
|
declare function ModularPanel({ panel, state, actions, isLeft, pinActions, transition, close, available, style, noHeader, }: ModularPanelProps): react_jsx_runtime.JSX.Element | null;
|
|
@@ -658,7 +851,7 @@ declare function PanelError(props: {
|
|
|
658
851
|
resetErrorBoundary: () => void;
|
|
659
852
|
}): react_jsx_runtime.JSX.Element;
|
|
660
853
|
|
|
661
|
-
declare function PreviewButton({ downloadEnabled, fileName }: {
|
|
854
|
+
declare function PreviewButton({ downloadEnabled, fileName, }: {
|
|
662
855
|
downloadEnabled?: boolean;
|
|
663
856
|
fileName?: string;
|
|
664
857
|
}): react_jsx_runtime.JSX.Element;
|
|
@@ -694,6 +887,7 @@ declare function createPreviewVault(homepageCollectionId?: string): {
|
|
|
694
887
|
interface ResourceEditingContext {
|
|
695
888
|
resource: Reference<any> | null;
|
|
696
889
|
}
|
|
890
|
+
declare const ResourceEditingReactContext: react.Context<ResourceEditingContext>;
|
|
697
891
|
declare function useEditingContext(): ResourceEditingContext;
|
|
698
892
|
/**
|
|
699
893
|
* useResource
|
|
@@ -785,6 +979,7 @@ declare function createDownload(data: any, fileName: string, fileType?: string):
|
|
|
785
979
|
declare function copyToClipboard(json: string | any): Promise<void>;
|
|
786
980
|
declare function randomId(): string;
|
|
787
981
|
declare function mapApp(input: any, map?: (app: MappedApp$1) => MappedApp$1): MappedApp$1;
|
|
982
|
+
declare function extendApp(app: MappedApp$1, metadata: MappedApp$1["metadata"], extensions: AppExtension): MappedApp$1;
|
|
788
983
|
|
|
789
984
|
type Projection = {
|
|
790
985
|
x: number;
|
|
@@ -814,4 +1009,75 @@ declare function useDecayState(time: number): readonly [boolean, {
|
|
|
814
1009
|
readonly clear: (existing?: boolean) => void;
|
|
815
1010
|
}];
|
|
816
1011
|
|
|
817
|
-
|
|
1012
|
+
declare const ReactEmitterContext: react.Context<Emitter<any>>;
|
|
1013
|
+
declare function EventEmitterProvider({ children, emitter, }: {
|
|
1014
|
+
children: React.ReactNode;
|
|
1015
|
+
emitter: Emitter<any>;
|
|
1016
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1017
|
+
declare function useEmitter<Event extends Record<string | symbol, unknown>>(): Emitter<Event>;
|
|
1018
|
+
declare function useEvent<Event extends Record<string | symbol, unknown>, Key extends keyof Event>(key: Key, listener: (data: Event[Key]) => void, deps?: any[]): void;
|
|
1019
|
+
|
|
1020
|
+
declare function useSvgTools(): {
|
|
1021
|
+
draw: {
|
|
1022
|
+
active: boolean;
|
|
1023
|
+
enable: () => void;
|
|
1024
|
+
};
|
|
1025
|
+
polygon: {
|
|
1026
|
+
active: boolean;
|
|
1027
|
+
enable: () => void;
|
|
1028
|
+
};
|
|
1029
|
+
line: {
|
|
1030
|
+
active: boolean;
|
|
1031
|
+
enable: () => void;
|
|
1032
|
+
};
|
|
1033
|
+
lineBox: {
|
|
1034
|
+
active: boolean;
|
|
1035
|
+
enable: () => void;
|
|
1036
|
+
};
|
|
1037
|
+
square: {
|
|
1038
|
+
active: boolean;
|
|
1039
|
+
enable: () => void;
|
|
1040
|
+
};
|
|
1041
|
+
triangle: {
|
|
1042
|
+
active: boolean;
|
|
1043
|
+
enable: () => void;
|
|
1044
|
+
};
|
|
1045
|
+
hexagon: {
|
|
1046
|
+
active: boolean;
|
|
1047
|
+
enable: () => void;
|
|
1048
|
+
};
|
|
1049
|
+
circle: {
|
|
1050
|
+
active: boolean;
|
|
1051
|
+
enable: () => void;
|
|
1052
|
+
};
|
|
1053
|
+
remove: {
|
|
1054
|
+
active: boolean;
|
|
1055
|
+
enable: () => void;
|
|
1056
|
+
};
|
|
1057
|
+
};
|
|
1058
|
+
|
|
1059
|
+
type IMediaQuery = Array<string>;
|
|
1060
|
+
type IMatchedMedia = Array<boolean>;
|
|
1061
|
+
declare function useMatchMedia(queries: IMediaQuery, defaultValues?: IMatchedMedia): IMatchedMedia;
|
|
1062
|
+
|
|
1063
|
+
declare function useRequestAnnotation(opts?: {
|
|
1064
|
+
onSuccess?: (r: AnnotationResponse) => void;
|
|
1065
|
+
}): {
|
|
1066
|
+
id: number;
|
|
1067
|
+
busy: boolean;
|
|
1068
|
+
isPending: boolean;
|
|
1069
|
+
requestAnnotation: (request: AnnotationRequest, options?: Omit<AnnotationRequestOptions, "requestId">) => Promise<AnnotationResponse | null>;
|
|
1070
|
+
cancelRequest: () => void;
|
|
1071
|
+
completeRequest: () => void;
|
|
1072
|
+
reset: () => void;
|
|
1073
|
+
data: AnnotationResponse | null;
|
|
1074
|
+
};
|
|
1075
|
+
|
|
1076
|
+
declare function polygonToBoundingBox(polygon: InputShape | null): {
|
|
1077
|
+
x: number;
|
|
1078
|
+
y: number;
|
|
1079
|
+
width: number;
|
|
1080
|
+
height: number;
|
|
1081
|
+
} | null;
|
|
1082
|
+
|
|
1083
|
+
export { type AnnotationPanel, type AnnotationRequest, type AnnotationRequestOptions, type AnnotationResponse, type AppContext, type AppExtension, AppHeader, AppMenuProvider, AppProvider, AppResourceInstanceProvider, AppResourceProvider, type AppState, type AtlasStore, type AtlasStoreEvents, AtlasStoreProvider, AtlasStoreReactContext, BaseEditor, BaseEditorBackButton, BaseEditorCloseButton, type CanvasEditorDefinition, type Config, ConfigEditor, ConfigProvider, type EditableResource, EditingStack, type EditingStackActionCreators, type EditingStackActions, type EditingStackState, type EditorConfig, type EditorDefinition, EventEmitterProvider, ExportPanel, type ExportPanelProps, HOMEPAGE_COLLECTION, HandleContainer, HandleControls, Layout, type LayoutActions, LayoutActionsReactContext, type LayoutContext, type LayoutFunction, type LayoutPanel, type LayoutPanelContext, type LayoutProps$1 as LayoutProps, type LayoutProviderProps, type LayoutState, LayoutStateReactContext, type LoadedApp, type MappedApp$1 as MappedApp, type MenuPositions, ModularPanel, ModularPanelHeader, ModulePanelButton, type MultiAppContext, MultiAppProvider, type PanelActionType, type PanelActions, PanelError, type PanelState, type PinnablePanelActions, type PinnablePanelState, type PinnedLayoutPanel, type Preview, type PreviewActions, type PreviewActionsType, PreviewButton, type PreviewConfiguration, type PreviewContext, type PreviewHandler, PreviewProvider, type PreviewState, PreviewVaultBoundary, PreviewVaultContext, PrimeAppReactContext, ReactEmitterContext, type Resource, type ResourceDefinition, ResourceEditingProvider, ResourceEditingReactContext, ShellProvider, TaskBridge, type UniversalCopyPasteProps, UniversalCopyTarget, type UploadBackendConfig, analyse, analyseJson, baseCreator, baseEditor, copyToClipboard, createActionIdentity, createAtlasStore, createDownload, createPreviewVault, detectMedia, editBasedOnResource, extendApp, getDefaultLayoutState, getDefaultPanelState, getFormat, getImageDimensions, getManifestNomalized, isPinnableState, layoutReducer, mapApp, panelSizing, polygonToBoundingBox, randomId, renderHelper, requestToAnnotationResponse, useAnnotationPageEditor, useApp, useAppInstance, useAppMenu, useAppMenuItem, useAppResource, useAppResourceInstance, useAppState, useApps, useAtlasStore, useAvailableLayouts, useCollectionEditor, useConfig, useCreatingResource, useCreator, useDecayState, useEditingContext, useEditingResource, useEditingResourceStack, useEditingStack, useEditor, useEmitter, useEvent, useGenericEditor, useHighlightedImageResource, useHoverHighlightImageResource, useInlineCreator, useLayoutActions, useLayoutProvider, useLayoutState, useManifestEditor, useMatchMedia, useOptionalResource, usePanelActions, usePreviewContext, usePreviewHistory, usePreviewVault, usePreviews, useRequestAnnotation, useResource, useSaveConfig, useSaveVault, useSetCustomTitle, useSvgTools, useTask, useTaskDispatch, useTaskEvent, useTaskRunner, useTemporaryHighlight };
|