@manifest-editor/shell 1.4.3 → 2.0.1-next.0.ede7d58

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.d.ts CHANGED
@@ -1,1084 +1,1155 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as react from 'react';
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';
8
- import { Vault } from '@iiif/helpers/vault';
9
- import { RenderingStrategy } from 'react-iiif-vault';
10
- import { TransitionStatus } from 'react-transition-group';
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';
16
- import { Vault as Vault$1 } from '@iiif/helpers';
17
- import { EditorInstance } from '@manifest-editor/editor-api';
18
- import * as styled_components from 'styled-components';
19
- import * as styled_components_dist_types from 'styled-components/dist/types';
20
- import { ManifestNormalized } from '@iiif/presentation-3-normalized';
1
+ import { useLocalStorage, useOptionalLocalStorage } from "@manifest-editor/components";
2
+ import * as react11 from "react";
3
+ import { Dispatch, HTMLAttributes, ReactNode, SetStateAction } from "react";
4
+ import * as react_jsx_runtime7 from "react/jsx-runtime";
5
+ import * as styled_components0 from "styled-components";
6
+ import { AtlasStore, AtlasStoreProvider, AtlasStoreReactContext, RenderingStrategy } from "react-iiif-vault";
7
+ import { Vault } from "@iiif/helpers";
8
+ import { Vault as Vault$1 } from "@iiif/helpers/vault";
9
+ import * as _manifest_editor_creator_api0 from "@manifest-editor/creator-api";
10
+ import { CreatableResource, Creator, CreatorDefinition } from "@manifest-editor/creator-api";
11
+ import * as zustand0 from "zustand";
12
+ import { StoreApi } from "zustand";
13
+ import { EditorInstance } from "@manifest-editor/editor-api";
14
+ import { Emitter } from "mitt";
15
+ import { TransitionStatus } from "react-transition-group";
16
+ import * as _iiif_presentation_30 from "@iiif/presentation-3";
17
+ import { Collection, Reference, SpecificResource } from "@iiif/presentation-3";
18
+ import * as polygon_editor0 from "polygon-editor";
19
+ import { InputShape } from "polygon-editor";
20
+ import { ManifestNormalized } from "@iiif/presentation-3-normalized";
21
+ import * as styled_components_dist_types0 from "styled-components/dist/types";
21
22
 
23
+ //#region src/PreviewContext/PreviewContext.types.d.ts
22
24
  interface Preview {
23
- id: string;
24
- type: string;
25
- data: any;
25
+ id: string;
26
+ type: string;
27
+ data: any;
26
28
  }
27
29
  type PreviewContext = PreviewState & {
28
- handlers: Array<PreviewHandler>;
29
- actions: PreviewActions;
30
- configs: Array<PreviewConfiguration>;
30
+ handlers: Array<PreviewHandler>;
31
+ actions: PreviewActions;
32
+ configs: Array<PreviewConfiguration>;
31
33
  };
32
34
  interface PreviewState {
33
- selected: string | null;
34
- active: string[];
35
+ selected: string | null;
36
+ active: string[];
35
37
  }
36
38
  interface PreviewActions {
37
- activatePreview(id: string): void;
38
- updatePreviews(): void;
39
- selectPreview(id: string): void;
40
- deletePreview(id: string): void;
41
- focusPreview(id: string): void;
42
- getPreviewLink(): Promise<string | null>;
39
+ activatePreview(id: string): void;
40
+ updatePreviews(): void;
41
+ selectPreview(id: string): void;
42
+ deletePreview(id: string): void;
43
+ focusPreview(id: string): void;
44
+ getPreviewLink(): Promise<string | null>;
43
45
  }
44
- type PreviewActionsType = {
45
- [T in keyof PreviewActions]: {
46
- type: T;
47
- payload: Parameters<PreviewActions[T]>[0];
48
- };
49
- }[keyof PreviewActions];
50
- interface PreviewConfiguration<Config = any> {
51
- id: string;
52
- type: string;
53
- label: string;
54
- config: Config;
46
+ type PreviewActionsType = { [T in keyof PreviewActions]: {
47
+ type: T;
48
+ payload: Parameters<PreviewActions[T]>[0];
49
+ } }[keyof PreviewActions];
50
+ interface PreviewConfiguration<Config$1 = any> {
51
+ id: string;
52
+ type: string;
53
+ label: string;
54
+ config: Config$1;
55
55
  }
56
56
  interface PreviewHandler {
57
+ id: string;
58
+ label: string;
59
+ type: string;
60
+ focusable: boolean;
61
+ getRequires(): string[];
62
+ getProvides(): string[];
63
+ isPreviewValid(instanceId: string, instance: Preview): boolean | Promise<boolean>;
64
+ createPreview(instanceId: string, resource: {
65
+ id: string;
66
+ type: string;
67
+ }, vault: Vault$1, ctx: any): Promise<Preview>;
68
+ focus(instanceId: string): Promise<void>;
69
+ updatePreview(instanceId: string, resource: {
57
70
  id: string;
58
- label: string;
59
71
  type: string;
60
- focusable: boolean;
61
- getRequires(): string[];
62
- getProvides(): string[];
63
- isPreviewValid(instanceId: string, instance: Preview): boolean | Promise<boolean>;
64
- createPreview(instanceId: string, resource: {
65
- id: string;
66
- type: string;
67
- }, vault: Vault, ctx: any): Promise<Preview>;
68
- focus(instanceId: string): Promise<void>;
69
- updatePreview(instanceId: string, resource: {
70
- id: string;
71
- type: string;
72
- }, vault: Vault, ctx: any): Promise<Preview | null>;
73
- deletePreview(id: string): Promise<void>;
72
+ }, vault: Vault$1, ctx: any): Promise<Preview | null>;
73
+ deletePreview(id: string): Promise<void>;
74
74
  }
75
-
75
+ //#endregion
76
+ //#region src/ConfigContext/ConfigContext.d.ts
76
77
  interface Config {
77
- previews: PreviewConfiguration[];
78
- behaviorPresets: string[];
79
- newTemplates: Collection | null;
80
- defaultPreview: string | null;
81
- editorConfig: {
82
- All?: EditorConfig;
83
- Manifest?: EditorConfig;
84
- Canvas?: EditorConfig;
85
- Annotation?: EditorConfig;
86
- AnnotationPage?: EditorConfig;
87
- AnnotationCollection?: EditorConfig;
88
- Range?: EditorConfig;
89
- Collection?: EditorConfig;
90
- ContentResource?: EditorConfig;
91
- EmbeddedCollection?: EditorConfig;
92
- };
93
- editorFeatureFlags: {
94
- enableMultiImageCanvases?: boolean;
95
- enableMultiMediaCanvases?: boolean;
96
- };
97
- i18n: {
98
- defaultLanguage: string;
99
- availableLanguages: string[];
100
- advancedLanguageMode: boolean;
101
- textGranularityEnabled?: boolean;
102
- };
103
- export: {
104
- baseIdentifier: string | null;
105
- version: 3 | 2;
106
- };
107
- uploadBackends: Array<UploadBackendConfig>;
78
+ previews: PreviewConfiguration[];
79
+ behaviorPresets: string[];
80
+ newTemplates: Collection | null;
81
+ defaultPreview: string | null;
82
+ editorConfig: {
83
+ All?: EditorConfig;
84
+ Manifest?: EditorConfig;
85
+ Canvas?: EditorConfig;
86
+ Annotation?: EditorConfig;
87
+ AnnotationPage?: EditorConfig;
88
+ AnnotationCollection?: EditorConfig;
89
+ Range?: EditorConfig;
90
+ Collection?: EditorConfig;
91
+ ContentResource?: EditorConfig;
92
+ EmbeddedCollection?: EditorConfig;
93
+ };
94
+ editorFeatureFlags: {
95
+ enableMultiImageCanvases?: boolean;
96
+ enableMultiMediaCanvases?: boolean;
97
+ rememberCanvasId?: boolean;
98
+ rememberLeftPanelId?: boolean;
99
+ annotationPopups?: boolean;
100
+ manifestGridOptions?: boolean;
101
+ };
102
+ i18n: {
103
+ defaultLanguage: string;
104
+ availableLanguages: string[];
105
+ advancedLanguageMode: boolean;
106
+ textGranularityEnabled?: boolean;
107
+ };
108
+ export: {
109
+ baseIdentifier: string | null;
110
+ version: 3 | 2;
111
+ };
112
+ uploadBackends: Array<UploadBackendConfig>;
108
113
  }
109
114
  interface EditorConfig {
110
- singleTab?: string;
111
- fields?: string[];
112
- hideTabs?: string[];
113
- onlyTabs?: string[];
115
+ singleTab?: string;
116
+ fields?: string[];
117
+ hideTabs?: string[];
118
+ onlyTabs?: string[];
114
119
  }
115
120
  interface UploadBackendConfig {
121
+ id: string;
122
+ label: string;
123
+ resourceTypes: string[];
124
+ canUpload?: () => Promise<boolean>;
125
+ upload: (resource: File) => Promise<{
116
126
  id: string;
117
- label: string;
118
- resourceTypes: string[];
119
- canUpload?: () => Promise<boolean>;
120
- upload: (resource: File) => Promise<{
121
- id: string;
122
- type: string;
123
- }> | null;
127
+ type: string;
128
+ }> | null;
124
129
  }
130
+ declare const ConfigReactContext: react11.Context<Config>;
131
+ declare const SaveConfigReactContext: react11.Context<(config: Partial<Config>) => void>;
125
132
  declare function useConfig(): Config;
126
133
  declare function useSaveConfig(): (config: Partial<Config>) => void;
127
- declare function ConfigProvider({ children, config, saveConfig, }: {
128
- children: ReactNode;
129
- config?: Partial<Config>;
130
- saveConfig?: (config: Partial<Config>) => void;
131
- }): react_jsx_runtime.JSX.Element;
132
-
134
+ declare function ConfigProvider({
135
+ children,
136
+ config,
137
+ saveConfig
138
+ }: {
139
+ children: ReactNode;
140
+ config?: Partial<Config>;
141
+ saveConfig?: (config: Partial<Config>) => void;
142
+ }): react_jsx_runtime7.JSX.Element;
143
+ //#endregion
144
+ //#region src/EditingStack/EditingStack.types.d.ts
133
145
  interface EditableResource {
134
- parent?: Reference;
135
- property?: string;
136
- index?: number;
137
- resource: SpecificResource;
138
- onlyReference?: boolean;
146
+ parent?: Reference;
147
+ property?: string;
148
+ index?: number;
149
+ resource: SpecificResource;
150
+ onlyReference?: boolean;
139
151
  }
140
152
  interface EditingStackState {
141
- current: EditableResource | null;
142
- stack: Array<EditableResource>;
143
- create: {
144
- resource: CreatableResource;
145
- options: any;
146
- } | null;
153
+ current: EditableResource | null;
154
+ stack: Array<EditableResource>;
155
+ create: {
156
+ resource: CreatableResource;
157
+ options: any;
158
+ } | null;
147
159
  }
148
160
  interface EditingStackActions {
149
- edit(resource: EditableResource | null, reset?: boolean): void;
150
- updateCurrent(resource: Partial<EditableResource>): void;
151
- close(): void;
152
- back(): void;
153
- create(resource: CreatableResource, options?: any): () => void;
161
+ edit(resource: EditableResource | null, reset?: boolean): void;
162
+ updateCurrent(resource: Partial<EditableResource>): void;
163
+ close(): void;
164
+ back(): void;
165
+ setStack(stack: EditableResource[]): void;
166
+ create(resource: CreatableResource, options?: any): () => void;
154
167
  }
155
168
  type EditingStackActionCreators = {
156
- type: "edit";
157
- payload: {
158
- resource: EditableResource | null;
159
- reset?: boolean;
160
- };
169
+ type: "edit";
170
+ payload: {
171
+ resource: EditableResource | null;
172
+ reset?: boolean;
173
+ };
161
174
  } | {
162
- type: "updateCurrent";
163
- payload: {
164
- resource: EditableResource;
165
- };
175
+ type: "updateCurrent";
176
+ payload: {
177
+ resource: EditableResource;
178
+ };
166
179
  } | {
167
- type: "syncRemoval";
168
- payload: {
169
- resource: EditableResource;
170
- };
180
+ type: "syncRemoval";
181
+ payload: {
182
+ resource: EditableResource;
183
+ };
171
184
  } | {
172
- type: "back";
185
+ type: "back";
173
186
  } | {
174
- type: "create";
175
- payload: {
176
- resource: CreatableResource | null;
177
- options?: any;
178
- };
187
+ type: "setStack";
188
+ payload: {
189
+ resources: EditableResource[];
190
+ };
191
+ } | {
192
+ type: "create";
193
+ payload: {
194
+ resource: CreatableResource | null;
195
+ options?: any;
196
+ };
179
197
  } | {
180
- type: "close";
198
+ type: "close";
181
199
  };
182
-
183
- type CreatorDefinition = any;
200
+ //#endregion
201
+ //#region src/Layout/Layout.types.d.ts
202
+ type CreatorDefinition$1 = any;
184
203
  interface LayoutProviderProps {
185
- loading?: true;
186
- leftPanels: Array<LayoutPanel>;
187
- rightPanels: Array<LayoutPanel>;
188
- centerPanels: Array<LayoutPanel>;
189
- modals?: Array<LayoutPanel>;
190
- annotations?: Array<AnnotationPanel>;
204
+ loading?: true;
205
+ leftPanels: Array<LayoutPanel>;
206
+ rightPanels: Array<LayoutPanel>;
207
+ centerPanels: Array<LayoutPanel>;
208
+ modals?: Array<LayoutPanel>;
209
+ annotations?: Array<AnnotationPanel>;
210
+ background?: Array<BackgroundPanel>;
191
211
  }
192
212
  interface LayoutContext extends LayoutProviderProps {
193
- state: LayoutState;
194
- actions: LayoutActions;
213
+ state: LayoutState;
214
+ actions: LayoutActions;
195
215
  }
196
216
  interface LayoutState {
197
- leftPanel: PanelState;
198
- centerPanel: PanelState;
199
- rightPanel: PanelState;
200
- pinnedRightPanel: PinnablePanelState;
201
- modal: PanelState;
217
+ leftPanel: PanelState;
218
+ centerPanel: PanelState;
219
+ rightPanel: PanelState;
220
+ pinnedRightPanel: PinnablePanelState;
221
+ modal: PanelState;
202
222
  }
203
223
  interface LayoutActions {
204
- stack(id: string, state?: any): void;
205
- stack(args: {
206
- id: string;
207
- state?: any;
208
- }): void;
209
- open(id: string, state?: any): void;
210
- open(args: {
211
- id: string;
212
- state?: any;
213
- stacked?: boolean;
214
- unique?: boolean;
215
- }): void;
216
- change(id: string, state?: any): void;
217
- change(args: {
218
- id: string;
219
- state?: any;
220
- stacked?: boolean;
221
- unique?: boolean;
222
- }): void;
223
- close(id: string, state?: any): void;
224
- close(args: {
225
- id: string;
226
- state?: any;
227
- }): void;
228
- toggle(id: string, state?: any): void;
229
- toggle(args: {
230
- id: string;
231
- state?: any;
232
- }): void;
233
- edit(resource: Reference | SpecificResource, context?: Omit<EditableResource, "resource">, options?: {
234
- reset?: boolean;
235
- property?: string;
236
- stacked?: boolean | undefined;
237
- selectedTab?: string;
238
- }): void;
239
- create(resource: CreatableResource): void;
240
- leftPanel: PanelActions;
241
- centerPanel: PanelActions;
242
- rightPanel: PanelActions;
243
- pinnedRightPanel: PinnablePanelActions;
244
- modal: PanelActions;
224
+ stack(id: string, state?: any): void;
225
+ stack(args: {
226
+ id: string;
227
+ state?: any;
228
+ }): void;
229
+ open(id: string, state?: any): void;
230
+ open(args: {
231
+ id: string;
232
+ state?: any;
233
+ stacked?: boolean;
234
+ unique?: boolean;
235
+ }): void;
236
+ change(id: string, state?: any): void;
237
+ change(args: {
238
+ id: string;
239
+ state?: any;
240
+ stacked?: boolean;
241
+ unique?: boolean;
242
+ }): void;
243
+ close(id: string, state?: any): void;
244
+ close(args: {
245
+ id: string;
246
+ state?: any;
247
+ }): void;
248
+ toggle(id: string, state?: any): void;
249
+ toggle(args: {
250
+ id: string;
251
+ state?: any;
252
+ }): void;
253
+ edit(resource: Reference | SpecificResource, context?: Omit<EditableResource, "resource">, options?: {
254
+ reset?: boolean;
255
+ property?: string;
256
+ stacked?: boolean | undefined;
257
+ selectedTab?: string;
258
+ forceOpen?: boolean;
259
+ }): void;
260
+ create(resource: CreatableResource): Promise<any>;
261
+ leftPanel: PanelActions;
262
+ centerPanel: PanelActions;
263
+ rightPanel: PanelActions;
264
+ pinnedRightPanel: PinnablePanelActions;
265
+ modal: PanelActions;
245
266
  }
246
267
  interface PanelState {
247
- current: string | null;
268
+ current: string | null;
269
+ state: any;
270
+ open: boolean;
271
+ minimised: boolean;
272
+ customWidth?: number;
273
+ stack: Array<{
274
+ id: string;
248
275
  state: any;
249
- open: boolean;
250
- minimised: boolean;
251
- customWidth?: number;
252
- stack: Array<{
253
- id: string;
254
- state: any;
255
- }>;
276
+ }>;
256
277
  }
257
278
  interface PanelActions {
258
- change(args: {
259
- id: string;
260
- state?: any;
261
- stacked?: boolean;
262
- unique?: boolean;
263
- }): void;
264
- open(args?: {
265
- id: string;
266
- state?: any;
267
- stacked?: boolean;
268
- unique?: boolean;
269
- }): void;
270
- close(): void;
271
- toggle(): void;
272
- minimise(): void;
273
- maximise(args?: {
274
- id: string;
275
- state?: any;
276
- }): void;
277
- setCustomWidth(size: number): void;
278
- resetSize(): void;
279
- popStack(): void;
279
+ change(args: {
280
+ id: string;
281
+ state?: any;
282
+ stacked?: boolean;
283
+ unique?: boolean;
284
+ }): void;
285
+ open(args?: {
286
+ id: string;
287
+ state?: any;
288
+ stacked?: boolean;
289
+ unique?: boolean;
290
+ }): void;
291
+ close(): void;
292
+ toggle(): void;
293
+ minimise(): void;
294
+ maximise(args?: {
295
+ id: string;
296
+ state?: any;
297
+ }): void;
298
+ setCustomWidth(size: number): void;
299
+ resetSize(): void;
300
+ popStack(): void;
280
301
  }
281
- type PanelActionType = {
282
- [T in keyof PinnablePanelActions]: {
283
- type: T;
284
- panel: keyof LayoutState;
285
- payload: Parameters<PinnablePanelActions[T]>[0];
286
- };
287
- }[keyof PinnablePanelActions];
302
+ type PanelActionType = { [T in keyof PinnablePanelActions]: {
303
+ type: T;
304
+ panel: keyof LayoutState;
305
+ payload: Parameters<PinnablePanelActions[T]>[0];
306
+ } }[keyof PinnablePanelActions];
288
307
  interface PinnablePanelState extends PanelState {
289
- pinnable: true;
290
- pinned: boolean;
308
+ pinnable: true;
309
+ pinned: boolean;
291
310
  }
292
311
  interface PinnablePanelActions extends PanelActions {
293
- pin(args: {
294
- id: string;
295
- state?: any;
296
- }): void;
297
- unpin(): void;
312
+ pin(args: {
313
+ id: string;
314
+ state?: any;
315
+ }): void;
316
+ unpin(): void;
298
317
  }
299
318
  type LayoutPanelContext = {
300
- global: {
301
- currentCanvasId: string | null;
302
- };
303
- current: {
304
- actions: PanelActions;
305
- state: any;
306
- };
307
- actions: LayoutActions;
308
- state: LayoutState;
319
+ global: {
320
+ currentCanvasId: string | null;
321
+ };
322
+ current: {
323
+ actions: PanelActions;
324
+ state: any;
325
+ };
326
+ actions: LayoutActions;
327
+ state: LayoutState;
309
328
  };
310
329
  type LayoutFunction = (state: any, ctx: {
311
- current: PanelActions;
312
- vault?: Vault;
313
- transition?: TransitionStatus;
330
+ current: PanelActions;
331
+ vault?: Vault$1;
332
+ transition?: TransitionStatus;
314
333
  } & LayoutContext, app: AppState) => ReactNode;
315
334
  interface AnnotationPanel {
316
- id: string;
317
- label: string;
318
- render: () => React.ReactNode | null;
335
+ id: string;
336
+ label: string;
337
+ render: () => React.ReactNode | null;
338
+ }
339
+ interface BackgroundPanel {
340
+ id: string;
341
+ label: string;
342
+ render: () => React.ReactNode | null;
319
343
  }
320
344
  interface LayoutPanel {
321
- id: string;
322
- label: string;
323
- divide?: boolean;
324
- icon?: null | string | ReactNode;
325
- render: LayoutFunction;
326
- onMount?: (state: any, ctx: {
327
- current: PanelActions;
328
- vault?: Vault;
329
- } & LayoutContext, app: AppState) => (() => void) | void;
330
- defaultState?: any;
331
- requiresState?: boolean;
332
- backAction?: (state: any, ctx: {
333
- current: PanelActions;
334
- } & LayoutContext, app: AppState) => void;
335
- renderBackAction?: (options: {
336
- backAction: (e?: React.MouseEvent) => void;
337
- fallback: any;
338
- }) => ReactNode | null;
339
- renderCloseAction?: (options: {
340
- closeAction: () => void;
341
- fallback: any;
342
- }) => ReactNode | null;
343
- options?: {
344
- minWidth?: number;
345
- maxWidth?: number;
346
- hideHeader?: boolean;
347
- pinnable?: boolean;
348
- openPinned?: boolean;
349
- tabs?: boolean;
350
- };
345
+ id: string;
346
+ label: string;
347
+ divide?: boolean;
348
+ icon?: null | string | ReactNode;
349
+ render: LayoutFunction;
350
+ onMount?: (state: any, ctx: {
351
+ current: PanelActions;
352
+ vault?: Vault$1;
353
+ } & LayoutContext, app: AppState) => (() => void) | void;
354
+ defaultState?: any;
355
+ requiresState?: boolean;
356
+ backAction?: (state: any, ctx: {
357
+ current: PanelActions;
358
+ } & LayoutContext, app: AppState) => void;
359
+ renderBackAction?: (options: {
360
+ backAction: (e?: React.MouseEvent) => void;
361
+ fallback: any;
362
+ }) => ReactNode | null;
363
+ renderCloseAction?: (options: {
364
+ closeAction: () => void;
365
+ fallback: any;
366
+ }) => ReactNode | null;
367
+ options?: {
368
+ minWidth?: number;
369
+ maxWidth?: number;
370
+ hideHeader?: boolean;
371
+ pinnable?: boolean;
372
+ openPinned?: boolean;
373
+ tabs?: boolean;
374
+ };
351
375
  }
352
376
  type MenuPositions = "left" | "right" | "bottom" | "top";
353
- interface PinnedLayoutPanel<T = any> extends LayoutPanel {
354
- pinned: true;
355
- state: T;
377
+ interface PinnedLayoutPanel<T$1 = any> extends LayoutPanel {
378
+ pinned: true;
379
+ state: T$1;
356
380
  }
357
381
  interface CanvasEditorDefinition {
358
- id: string;
359
- label: string;
360
- supports: {
361
- strategy: (strategy: RenderingStrategy, resource: EditableResource, vault: Vault) => boolean;
362
- };
363
- component: (strategy: RenderingStrategy) => ReactNode | null;
382
+ id: string;
383
+ label: string;
384
+ supports: {
385
+ strategy: (strategy: RenderingStrategy, resource: EditableResource, vault: Vault$1) => boolean;
386
+ };
387
+ component: (strategy: RenderingStrategy) => ReactNode | null;
364
388
  }
365
389
  interface EditorDefinition {
366
- id: string;
367
- label: string;
368
- tabs?: {
369
- showTitle?: boolean;
370
- hide?: boolean;
371
- };
372
- supports: {
373
- properties: string[];
374
- readOnlyProperties?: string[];
375
- resourceTypes: string[];
376
- sortKey?: string;
377
- sortFallback?: boolean;
378
- read?: boolean;
379
- edit?: boolean;
380
- customLocking?: boolean;
381
- target?: boolean;
382
- multi?: boolean;
383
- custom?: (resource: EditableResource, vault: Vault) => boolean;
384
- };
385
- component: (config: EditorConfig) => ReactNode;
390
+ id: string;
391
+ label: string;
392
+ tabs?: {
393
+ showTitle?: boolean;
394
+ hide?: boolean;
395
+ };
396
+ supports: {
397
+ properties: string[];
398
+ readOnlyProperties?: string[];
399
+ resourceTypes: string[];
400
+ sortKey?: string;
401
+ sortFallback?: boolean;
402
+ read?: boolean;
403
+ edit?: boolean;
404
+ customLocking?: boolean;
405
+ target?: boolean;
406
+ multi?: boolean;
407
+ custom?: (resource: EditableResource, vault: Vault$1) => boolean;
408
+ };
409
+ component: (config: EditorConfig) => ReactNode;
386
410
  }
387
411
  interface ResourceDefinition {
388
- id: string;
389
- label: string;
390
- resourceType: string;
391
- auto: boolean;
392
- editors: EditorDefinition[];
412
+ id: string;
413
+ label: string;
414
+ resourceType: string;
415
+ auto: boolean;
416
+ editors: EditorDefinition[];
393
417
  }
394
- interface LayoutProps$1 {
395
- isLoading?: boolean;
396
- className?: string;
397
- hideHeader?: boolean;
398
- isProject?: boolean;
399
- provider?: React.FC;
400
- leftPanels: Array<LayoutPanel>;
401
- rightPanels: Array<LayoutPanel>;
402
- centerPanels: Array<LayoutPanel>;
403
- modals?: Array<LayoutPanel>;
404
- annotations?: Array<AnnotationPanel>;
405
- footer?: ReactNode;
406
- menu?: ReactNode;
407
- header?: ReactNode;
408
- onClickLogo?: (e: React.MouseEvent) => void;
409
- leftPanelMenu?: ReactNode;
410
- centerPanelMenu?: ReactNode;
411
- rightPanelMenu?: ReactNode;
412
- leftPanelMenuPosition?: MenuPositions;
413
- centerPanelMenuPosition?: MenuPositions;
414
- rightPanelMenuPosition?: MenuPositions;
415
- editors?: EditorDefinition[];
416
- resources?: (string | ResourceDefinition)[];
417
- creators?: CreatorDefinition[];
418
- canvasEditors?: CanvasEditorDefinition[];
418
+ interface LayoutProps {
419
+ isLoading?: boolean;
420
+ className?: string;
421
+ hideHeader?: boolean;
422
+ isProject?: boolean;
423
+ provider?: React.FC;
424
+ leftPanels: Array<LayoutPanel>;
425
+ rightPanels: Array<LayoutPanel>;
426
+ centerPanels: Array<LayoutPanel>;
427
+ modals?: Array<LayoutPanel>;
428
+ annotations?: Array<AnnotationPanel>;
429
+ background?: Array<BackgroundPanel>;
430
+ footer?: ReactNode;
431
+ menu?: ReactNode;
432
+ header?: ReactNode;
433
+ onClickLogo?: (e: React.MouseEvent) => void;
434
+ leftPanelMenu?: ReactNode;
435
+ centerPanelMenu?: ReactNode;
436
+ rightPanelMenu?: ReactNode;
437
+ leftPanelMenuPosition?: MenuPositions;
438
+ centerPanelMenuPosition?: MenuPositions;
439
+ rightPanelMenuPosition?: MenuPositions;
440
+ editors?: EditorDefinition[];
441
+ resources?: (string | ResourceDefinition)[];
442
+ creators?: CreatorDefinition$1[];
443
+ canvasEditors?: CanvasEditorDefinition[];
419
444
  }
420
-
445
+ //#endregion
446
+ //#region src/AppContext/AppContext.d.ts
421
447
  type AppContext = {
422
- instanceId: string;
423
- appId: string;
424
- args?: any;
448
+ instanceId: string;
449
+ appId: string;
450
+ args?: any;
425
451
  };
426
- type LoadedApp = Partial<LayoutProps$1> & {
427
- config?: Partial<Config>;
428
- default: {
429
- id: string;
430
- title: string;
431
- type?: "manifest" | "launcher";
432
- project?: boolean;
433
- projectType?: "Manifest" | "Collection";
434
- dev?: boolean;
435
- desktop?: boolean;
436
- web?: boolean;
437
- drafts?: boolean;
438
- };
452
+ type LoadedApp = Partial<LayoutProps> & {
453
+ config?: Partial<Config>;
454
+ default: {
455
+ id: string;
456
+ title: string;
457
+ type?: "manifest" | "launcher";
458
+ project?: boolean;
459
+ projectType?: "Manifest" | "Collection";
460
+ dev?: boolean;
461
+ desktop?: boolean;
462
+ web?: boolean;
463
+ drafts?: boolean;
464
+ };
439
465
  };
440
- type MappedApp$1 = {
441
- metadata: LoadedApp["default"];
442
- layout: LayoutProps$1;
443
- config?: Partial<Config>;
466
+ type MappedApp = {
467
+ metadata: LoadedApp["default"];
468
+ layout: LayoutProps;
469
+ config?: Partial<Config>;
444
470
  };
445
471
  interface AppExtension {
446
- config?: Partial<Config>;
447
- leftPanels?: LayoutPanel[];
448
- centerPanels?: LayoutPanel[];
449
- rightPanels?: LayoutPanel[];
450
- modalPanels?: LayoutPanel[];
451
- editors?: EditorDefinition[];
452
- creators?: CreatorDefinition$1[];
453
- canvasEditors?: CanvasEditorDefinition[];
454
- annotations?: AnnotationPanel[];
455
- leftPanelIds?: string[];
456
- disableSideEffects?: string[];
472
+ config?: Partial<Config>;
473
+ leftPanels?: LayoutPanel[];
474
+ centerPanels?: LayoutPanel[];
475
+ rightPanels?: LayoutPanel[];
476
+ modalPanels?: LayoutPanel[];
477
+ editors?: EditorDefinition[];
478
+ creators?: CreatorDefinition[];
479
+ canvasEditors?: CanvasEditorDefinition[];
480
+ annotations?: AnnotationPanel[];
481
+ background?: BackgroundPanel[];
482
+ leftPanelIds?: string[];
483
+ disableSideEffects?: string[];
457
484
  }
458
485
  type AppState = {
459
- state: null | any;
460
- setState: SetStateAction<any>;
486
+ state: null | any;
487
+ setState: SetStateAction<any>;
461
488
  };
462
- declare const PrimeAppReactContext: react.Context<MappedApp$1 | null>;
489
+ declare const PrimeAppReactContext: react11.Context<MappedApp | null>;
490
+ declare const AppReactContext: react11.Context<AppContext | null>;
491
+ declare const AppStateReactContext: react11.Context<{
492
+ state: null | any;
493
+ setState: SetStateAction<any>;
494
+ }>;
463
495
  declare function useAppInstance(): AppContext;
464
- declare function useApp(): MappedApp$1;
496
+ declare function useApp(): MappedApp;
465
497
  declare function useAppState<S = any>(): {
466
- state: null | any;
467
- setState: SetStateAction<any>;
498
+ state: null | any;
499
+ setState: SetStateAction<any>;
468
500
  };
469
- declare function AppProvider({ instanceId, appId, args, definition, children, initialState, }: {
470
- initialState?: any;
471
- instanceId: string;
472
- appId: string;
473
- args?: any;
474
- definition: MappedApp$1;
475
- children: ReactNode;
476
- }): react_jsx_runtime.JSX.Element;
477
-
478
- type MappedApp = any;
501
+ declare function AppProvider({
502
+ instanceId,
503
+ appId,
504
+ args,
505
+ definition,
506
+ children,
507
+ initialState
508
+ }: {
509
+ initialState?: any;
510
+ instanceId: string;
511
+ appId: string;
512
+ args?: any;
513
+ definition: MappedApp;
514
+ children: ReactNode;
515
+ }): react_jsx_runtime7.JSX.Element;
516
+ //#endregion
517
+ //#region src/AppContext/MultiAppContext.d.ts
518
+ type MappedApp$1 = any;
479
519
  type MultiAppContext = {
480
- apps: Record<string, MappedApp>;
481
- currentApp: {
482
- id: string;
483
- args?: any;
484
- };
485
- initialApp: {
486
- id: string;
487
- args?: any;
488
- };
489
- changeApp: (app: {
490
- id: string;
491
- args?: any;
492
- }) => void;
493
- changeProjectType: (type: "Manifest" | "Collection") => void;
520
+ apps: Record<string, MappedApp$1>;
521
+ currentApp: {
522
+ id: string;
523
+ args?: any;
524
+ };
525
+ initialApp: {
526
+ id: string;
527
+ args?: any;
528
+ };
529
+ changeApp: (app: {
530
+ id: string;
531
+ args?: any;
532
+ }) => void;
533
+ changeProjectType: (type: "Manifest" | "Collection") => void;
494
534
  };
495
535
  declare function useApps(): MultiAppContext;
496
- declare function MultiAppProvider({ apps, initialApp, saveCurrentApp, instanceId, children, config, }: {
497
- apps: Record<string, MappedApp>;
498
- initialApp?: MultiAppContext["currentApp"];
499
- saveCurrentApp?: boolean;
500
- instanceId: string;
501
- children: ReactNode;
502
- config?: {
503
- defaultApp?: string;
504
- manifestApp?: string;
505
- collectionApp?: string;
506
- };
507
- }): react_jsx_runtime.JSX.Element | null;
508
-
536
+ declare function MultiAppProvider({
537
+ apps,
538
+ initialApp,
539
+ saveCurrentApp,
540
+ instanceId,
541
+ children,
542
+ config
543
+ }: {
544
+ apps: Record<string, MappedApp$1>;
545
+ initialApp?: MultiAppContext["currentApp"];
546
+ saveCurrentApp?: boolean;
547
+ instanceId: string;
548
+ children: ReactNode;
549
+ config?: {
550
+ defaultApp?: string;
551
+ manifestApp?: string;
552
+ collectionApp?: string;
553
+ };
554
+ }): react_jsx_runtime7.JSX.Element | null;
555
+ //#endregion
556
+ //#region src/AppHeader/AppHeader.d.ts
509
557
  interface AppHeaderProps {
510
- onClickLogo?: () => void;
558
+ onClickLogo?: () => void;
511
559
  }
512
- declare const AppHeader: react.NamedExoticComponent<AppHeaderProps>;
513
-
560
+ declare const AppHeader: react11.NamedExoticComponent<AppHeaderProps>;
561
+ //#endregion
562
+ //#region src/AppMenu/AppMenuContext.d.ts
514
563
  type MenuItem = {
515
- label: string;
516
- onClick?: () => void;
517
- active?: boolean;
564
+ label: string;
565
+ onClick?: () => void;
566
+ active?: boolean;
518
567
  };
519
568
  interface AppMenuContext {
520
- file: {
521
- new: MenuItem;
522
- edit: MenuItem;
523
- open: MenuItem;
524
- newOptions: MenuItem[];
525
- openOptions: MenuItem[];
526
- };
569
+ file: {
570
+ new: MenuItem;
571
+ edit: MenuItem;
572
+ open: MenuItem;
573
+ newOptions: MenuItem[];
574
+ openOptions: MenuItem[];
575
+ };
527
576
  }
528
577
  declare function useAppMenu(): AppMenuContext | null;
529
578
  declare function useAppMenuItem<Key extends keyof AppMenuContext, Name extends keyof AppMenuContext[Key], Return extends AppMenuContext[Key][Name]>(menu: Key, name: Name): Return | null;
530
- declare function AppMenuProvider({ children, menu }: {
531
- children: React.ReactNode;
532
- menu: AppMenuContext;
533
- }): react_jsx_runtime.JSX.Element;
534
-
579
+ declare function AppMenuProvider({
580
+ children,
581
+ menu
582
+ }: {
583
+ children: React.ReactNode;
584
+ menu: AppMenuContext;
585
+ }): react_jsx_runtime7.JSX.Element;
586
+ //#endregion
587
+ //#region src/AppResourceProvider/AppResourceProvider.d.ts
535
588
  interface Resource {
536
- id: string;
537
- type: string;
589
+ id: string;
590
+ type: string;
538
591
  }
539
592
  declare function useAppResourceInstance(): string;
540
593
  declare function useAppResource(): Resource;
541
- declare function AppResourceInstanceProvider({ id, children }: {
542
- id?: string;
543
- children: React.ReactNode;
544
- }): string | number | boolean | Iterable<react.ReactNode> | react_jsx_runtime.JSX.Element | null | undefined;
545
- declare function AppResourceProvider({ resource, children }: {
546
- resource?: Resource;
547
- children: React.ReactNode;
548
- }): react_jsx_runtime.JSX.Element;
549
-
550
- type Polygons = ReturnType<typeof createHelper>;
551
- type Point = [number, number] | [number, number, number, number, number, number];
552
- type AnnotationRequest = {
553
- type: "polygon";
554
- points?: Array<Point>;
555
- open?: boolean;
556
- } | {
557
- type: "target";
558
- selector: null | {
559
- x: number;
560
- y: number;
561
- width: number;
562
- height: number;
563
- };
564
- } | {
565
- type: "box";
566
- selector: null | {
567
- x: number;
568
- y: number;
569
- width: number;
570
- height: number;
571
- };
572
- };
573
- type AnnotationRequestOptions = {
574
- requestId: string;
575
- canvasId?: string | null;
576
- toolId?: keyof AtlasStore["switchTool"];
577
- };
578
- interface AtlasStore {
579
- mode: ViewerMode;
580
- tool: {
581
- enabled: boolean;
582
- requestId: string | null;
583
- canvasId: string | null;
584
- };
585
- requestType: null | "polygon" | "target" | "box";
586
- switchTool: {
587
- draw(): void;
588
- polygon(): void;
589
- line(): void;
590
- lineBox(): void;
591
- square(): void;
592
- triangle(): void;
593
- hexagon(): void;
594
- circle(): void;
595
- remove(): void;
596
- };
597
- history: {
598
- canUndo: boolean;
599
- canRedo: boolean;
600
- undo(): void;
601
- redo(): void;
602
- };
603
- stableViewport: null | {
604
- x: number;
605
- y: number;
606
- width: number;
607
- height: number;
608
- zoom: number;
609
- };
610
- canvasRelativePositions: Record<string, {
611
- x: number;
612
- y: number;
613
- width: number;
614
- height: number;
615
- }>;
616
- canvasViewports: Record<string, {
617
- x: number;
618
- y: number;
619
- width: number;
620
- height: number;
621
- zoom: number;
622
- }>;
623
- validRequestIds: string[];
624
- polygon: InputShape | null;
625
- polygons: Polygons;
626
- polygonState: SlowState;
627
- setPolygonState: (state: SlowState | ((prev: SlowState) => SlowState)) => void;
628
- setToolCanvasId: (canvasId: string) => void;
629
- getRequestId(): {
630
- requestId: string;
631
- clear: () => void;
632
- };
633
- requestAnnotation(req: AnnotationRequest, options: AnnotationRequestOptions): Promise<AnnotationResponse | null>;
634
- setAtlasRuntime(runtime: Runtime): void;
635
- setCanvasRelativePosition(canvasId: string, position: {
636
- x: number;
637
- y: number;
638
- width: number;
639
- height: number;
640
- }): void;
641
- clearCanvasRelativePosition(canvasId: string): void;
642
- clearAtlasRuntime(): void;
643
- completeRequest(requestId?: string): void;
644
- cancelRequest(requestId: string): void;
645
- reset(): void;
646
- changeMode(mode: ViewerMode): void;
647
- nudgeLeft(): void;
648
- nudgeRight(): void;
649
- nudgeUp(): void;
650
- nudgeDown(): void;
651
- zoomIn(): void;
652
- zoomOut(): void;
653
- goHome(): void;
654
- }
655
- declare function requestToAnnotationResponse(request: AnnotationRequest): Omit<AnnotationResponse, "id">;
656
- type AnnotationResponse = {
657
- id: string;
658
- canvasId?: string | null;
659
- polygon: InputShape | null;
660
- cancelled?: boolean;
661
- requestType: "polygon" | "target" | "box";
662
- target: FragmentSelector | SvgSelector | null;
663
- boundingBox: {
664
- x: number;
665
- y: number;
666
- width: number;
667
- height: number;
668
- } | null;
669
- };
670
- type AtlasStoreEvents = {
671
- "atlas.canvas-click": {
672
- canvasId: string;
673
- target: {
674
- x: number;
675
- y: number;
676
- };
677
- worldTarget: {
678
- x: number;
679
- y: number;
680
- };
681
- };
682
- "atlas.viewport-change": {
683
- x: number;
684
- y: number;
685
- width: number;
686
- height: number;
687
- zoom: number;
688
- };
689
- "atlas.ready": {
690
- runtime: Runtime;
691
- };
692
- "atlas.annotation-completed": AnnotationResponse;
693
- "atlas.annotation-request": {
694
- id: string;
695
- };
696
- "atlas.request-cancelled": {
697
- id: string;
698
- };
699
- "atlas.polygon-render": {
700
- state: RenderState;
701
- slowState: SlowState;
702
- dt: number;
703
- };
704
- };
705
- interface CreateAtlasStoreProps {
706
- events: Emitter<AtlasStoreEvents>;
707
- }
708
- declare function createAtlasStore({ events }: CreateAtlasStoreProps): zustand.StoreApi<AtlasStore>;
709
-
710
- declare const AtlasStoreReactContext: react.Context<StoreApi<AtlasStore> | null>;
594
+ declare function AppResourceInstanceProvider({
595
+ id,
596
+ children
597
+ }: {
598
+ id?: string;
599
+ children: React.ReactNode;
600
+ }): string | number | bigint | boolean | Iterable<react11.ReactNode> | Promise<string | number | bigint | boolean | react11.ReactPortal | react11.ReactElement<unknown, string | react11.JSXElementConstructor<any>> | Iterable<react11.ReactNode> | null | undefined> | react_jsx_runtime7.JSX.Element | null | undefined;
601
+ declare function AppResourceProvider({
602
+ resource,
603
+ children
604
+ }: {
605
+ resource?: Resource;
606
+ children: React.ReactNode;
607
+ }): react_jsx_runtime7.JSX.Element;
608
+ //#endregion
609
+ //#region src/AtlasStore/AtlasStoreProvider.d.ts
711
610
  declare function useAtlasStore(): StoreApi<AtlasStore>;
712
- declare function AtlasStoreProvider({ children, }: {
713
- children: React.ReactNode;
714
- }): react_jsx_runtime.JSX.Element;
715
-
611
+ //#endregion
612
+ //#region src/AtlasStore/polygon-to-bounding-box.d.ts
613
+ declare function polygonToBoundingBox(polygon: InputShape | null): {
614
+ x: number;
615
+ y: number;
616
+ width: number;
617
+ height: number;
618
+ } | null;
619
+ //#endregion
620
+ //#region src/analysis.d.ts
621
+ declare function detectMedia(): Promise<void>;
622
+ declare function analyse(url: string, ...expectedTypes: string[]): Promise<any>;
623
+ declare function analyseJson(data: any, url: string): Promise<any>;
624
+ declare function getFormat(url: string, capturedContentType?: string): Promise<string>;
625
+ declare function getImageDimensions(url: string): Promise<{
626
+ width: number;
627
+ height: number;
628
+ } | null>;
629
+ //#endregion
630
+ //#region src/BaseCreator/index.d.ts
716
631
  declare const baseCreator: LayoutPanel;
717
-
632
+ //#endregion
633
+ //#region src/BaseCreator/BaseCreator.hooks.d.ts
718
634
  declare function useCreator(parent: any, property: string, type: string, target?: Reference, options?: {
719
- isPainting?: boolean;
720
- onlyReference?: boolean;
635
+ isPainting?: boolean;
636
+ onlyReference?: boolean;
721
637
  }): readonly [any, {
722
- readonly create: (index?: number, initialData?: any) => void;
723
- readonly edit: (resource: any, index?: number) => void;
724
- readonly createFiltered: (filter: string, index?: number, initialData?: any) => void;
725
- readonly creator: (initialCreator: string, initialData?: any) => void;
726
- readonly buttonProps: {
727
- "data-action-id": string;
728
- };
638
+ readonly create: (index?: number, initialData?: any) => Promise<any> | undefined;
639
+ readonly edit: (resource: any, index?: number) => void;
640
+ readonly createFiltered: (filter: string, index?: number, initialData?: any) => Promise<any> | undefined;
641
+ readonly creator: (initialCreator: string, initialData?: any) => Promise<any> | undefined;
642
+ readonly buttonProps: {
643
+ "data-action-id": string;
644
+ };
729
645
  }];
730
646
  declare function useInlineCreator(): Creator;
731
-
647
+ //#endregion
648
+ //#region src/BaseEditor/index.d.ts
732
649
  declare const baseEditor: LayoutPanel;
733
-
734
- declare function BaseEditorBackButton({ fallback, backAction }: any): any;
735
- declare function BaseEditorCloseButton({ closeAction, fallback }: any): any;
650
+ //#endregion
651
+ //#region src/BaseEditor/BaseEditor.d.ts
652
+ declare function BaseEditorBackButton({
653
+ fallback,
654
+ backAction
655
+ }: any): any;
656
+ declare function BaseEditorCloseButton({
657
+ closeAction,
658
+ fallback
659
+ }: any): any;
736
660
  declare function editBasedOnResource(resource: EditableResource, list: ResourceDefinition[], options: {
737
- edit?: boolean;
738
- vault: Vault$1;
661
+ edit?: boolean;
662
+ vault: Vault;
739
663
  }, config: EditorConfig): ResourceDefinition | null;
740
- declare function BaseEditor({ currentTab }: {
741
- currentTab?: string;
742
- }): string | number | boolean | Iterable<ReactNode> | react_jsx_runtime.JSX.Element | null | undefined;
743
-
744
- declare function ConfigEditor(): react_jsx_runtime.JSX.Element;
745
-
664
+ declare function BaseEditor({
665
+ currentTab
666
+ }: {
667
+ currentTab?: string;
668
+ }): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react11.ReactPortal | react11.ReactElement<unknown, string | react11.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime7.JSX.Element | null | undefined;
669
+ //#endregion
670
+ //#region src/BaseCreator/BaseAnnotationCreator.d.ts
671
+ interface BaseAnnotationCreatorProps {
672
+ resource: CreatableResource;
673
+ onCreate: () => void;
674
+ }
675
+ declare function BaseAnnotationCreator(props: BaseAnnotationCreatorProps): react_jsx_runtime7.JSX.Element;
676
+ //#endregion
677
+ //#region src/ConfigContext/ConfigEditor.d.ts
678
+ declare function ConfigEditor(): react_jsx_runtime7.JSX.Element;
679
+ //#endregion
680
+ //#region src/ContextMenu/ContextMenuContext.d.ts
681
+ type ContextMenuItem = {
682
+ id: string;
683
+ label: string;
684
+ onAction: (options: {
685
+ position: {
686
+ x: number;
687
+ y: number;
688
+ };
689
+ resource: {
690
+ id: string;
691
+ type: string;
692
+ };
693
+ }) => void;
694
+ disabled?: boolean;
695
+ enabled?: boolean;
696
+ enabledFunction?: (options: {
697
+ resource: {
698
+ id: string;
699
+ type: string;
700
+ };
701
+ }) => boolean;
702
+ order?: number;
703
+ };
704
+ type ContextMenuRequest = {
705
+ resource?: {
706
+ id?: string;
707
+ type: string;
708
+ };
709
+ sectionTitle?: string;
710
+ items: Array<ContextMenuItem>;
711
+ };
712
+ type ContextMenuStore = {
713
+ specificMenus: Record<string, {
714
+ menus: Record<string, {
715
+ sectionTitle?: string;
716
+ items: Array<ContextMenuItem>;
717
+ } | undefined>;
718
+ }>;
719
+ resourceMenus: Record<string, {
720
+ menus: Record<string, {
721
+ sectionTitle?: string;
722
+ items: Array<ContextMenuItem>;
723
+ } | undefined>;
724
+ }>;
725
+ hookMenuItem(req: ContextMenuRequest): () => void;
726
+ };
727
+ declare const ContextMenuReactContext: react11.Context<StoreApi<ContextMenuStore> | null>;
728
+ declare function ContextMenuProvider({
729
+ children
730
+ }: {
731
+ children: React.ReactNode;
732
+ }): react_jsx_runtime7.JSX.Element;
733
+ declare function useResourceContextMenuItems(req: {
734
+ id?: string;
735
+ type: string;
736
+ }): {
737
+ sectionTitle?: string;
738
+ items: Array<ContextMenuItem>;
739
+ }[];
740
+ declare function useCustomContextMenu(req: ContextMenuRequest, deps?: any[]): void;
741
+ //#endregion
742
+ //#region src/EditingStack/EditingStack.d.ts
743
+ declare const EditingStackContext: react11.Context<EditingStackState>;
746
744
  declare function useEditingStack(): EditingStackActions;
747
745
  declare function useEditingResource(): EditableResource | null;
748
746
  declare function useEditingResourceStack(): EditableResource[];
749
747
  declare function useCreatingResource(): {
750
- resource: _manifest_editor_creator_api.CreatableResource;
751
- options: any;
748
+ resource: _manifest_editor_creator_api0.CreatableResource;
749
+ options: any;
752
750
  } | null;
753
- 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>>;
754
- declare function useCollectionEditor(): 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>>;
751
+ declare function useManifestEditor(): EditorInstance<Partial<_iiif_presentation_30.DescriptiveProperties> & Partial<_iiif_presentation_30.TechnicalProperties> & Partial<_iiif_presentation_30.LinkingProperties> & Partial<_iiif_presentation_30.StructuralProperties<unknown>> & Partial<_iiif_presentation_30.NavPlaceExtension & _iiif_presentation_30.TextGranularityExtension>>;
752
+ declare function useCollectionEditor(): EditorInstance<Partial<_iiif_presentation_30.DescriptiveProperties> & Partial<_iiif_presentation_30.TechnicalProperties> & Partial<_iiif_presentation_30.LinkingProperties> & Partial<_iiif_presentation_30.StructuralProperties<unknown>> & Partial<_iiif_presentation_30.NavPlaceExtension & _iiif_presentation_30.TextGranularityExtension>>;
755
753
  declare function useGenericEditor(ref: Reference<any> | SpecificResource | undefined, ctx?: {
756
- parent?: Reference;
757
- parentProperty?: string;
758
- index?: number;
759
- }): 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>>;
760
- declare function useAnnotationPageEditor(): 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>>;
761
- declare function useEditor(): 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>>;
754
+ parent?: Reference;
755
+ parentProperty?: string;
756
+ index?: number;
757
+ allowNull?: boolean;
758
+ }): EditorInstance<Partial<_iiif_presentation_30.DescriptiveProperties> & Partial<_iiif_presentation_30.TechnicalProperties> & Partial<_iiif_presentation_30.LinkingProperties> & Partial<_iiif_presentation_30.StructuralProperties<unknown>> & Partial<_iiif_presentation_30.NavPlaceExtension & _iiif_presentation_30.TextGranularityExtension>> | EditorInstance<{}>;
759
+ declare function useAnnotationPageEditor(): EditorInstance<Partial<_iiif_presentation_30.DescriptiveProperties> & Partial<_iiif_presentation_30.TechnicalProperties> & Partial<_iiif_presentation_30.LinkingProperties> & Partial<_iiif_presentation_30.StructuralProperties<unknown>> & Partial<_iiif_presentation_30.NavPlaceExtension & _iiif_presentation_30.TextGranularityExtension>> | EditorInstance<{}>;
760
+ declare function useEditor(): EditorInstance<Partial<_iiif_presentation_30.DescriptiveProperties> & Partial<_iiif_presentation_30.TechnicalProperties> & Partial<_iiif_presentation_30.LinkingProperties> & Partial<_iiif_presentation_30.StructuralProperties<unknown>> & Partial<_iiif_presentation_30.NavPlaceExtension & _iiif_presentation_30.TextGranularityExtension>>;
762
761
  declare function EditingStack(props: {
763
- children?: any;
764
- editing?: {
765
- id: string;
766
- type: string;
767
- };
768
- }): react_jsx_runtime.JSX.Element;
769
-
762
+ children?: any;
763
+ initialState?: EditingStackState;
764
+ editing?: {
765
+ id: string;
766
+ type: string;
767
+ };
768
+ }): react_jsx_runtime7.JSX.Element;
769
+ declare function InlineEditingStack({
770
+ resource,
771
+ children
772
+ }: {
773
+ resource: {
774
+ id: string;
775
+ type: string;
776
+ };
777
+ children?: React.ReactNode;
778
+ }): react_jsx_runtime7.JSX.Element;
779
+ //#endregion
780
+ //#region src/ExportPanel/ExportPanel.d.ts
770
781
  interface ExportPanelProps {
771
- initialVersion?: 2 | 3;
772
- versions?: Array<2 | 3>;
782
+ initialVersion?: 2 | 3;
783
+ versions?: Array<2 | 3>;
773
784
  }
774
- declare function ExportPanel(props: ExportPanelProps): react_jsx_runtime.JSX.Element;
775
-
776
- interface LayoutProps {
777
- header?: React.ReactNode;
778
- footer?: React.ReactNode;
779
- menu?: React.ReactNode;
780
- leftPanelMenu?: React.ReactNode;
781
- rightPanelMenu?: React.ReactNode;
782
- centerPanelMenu?: React.ReactNode;
783
- leftPanelMenuPosition?: "top" | "bottom";
784
- rightPanelMenuPosition?: "top" | "bottom";
785
- hideHeader?: boolean;
786
- isLoading?: boolean;
787
- className?: string;
788
- centerPanelMenuPosition?: "top" | "bottom";
789
- disableSideEffects?: string[];
785
+ declare function ExportPanel(props: ExportPanelProps): react_jsx_runtime7.JSX.Element;
786
+ //#endregion
787
+ //#region src/helpers.d.ts
788
+ declare function getManifestNomalized(id: string): Promise<ManifestNormalized | undefined>;
789
+ declare function createActionIdentity(type: string, property: string, parent: any): string;
790
+ declare function createDownload(data: any, fileName: string, fileType?: string): void;
791
+ declare function copyToClipboard(json: string | any): Promise<void>;
792
+ declare function randomId(): string;
793
+ declare function mapApp(input: any, map?: (app: MappedApp) => MappedApp): MappedApp;
794
+ declare function extendApp(app: MappedApp, metadata: MappedApp["metadata"], extensions: AppExtension): MappedApp;
795
+ //#endregion
796
+ //#region src/highlighted-image-resources.d.ts
797
+ type Projection = {
798
+ x: number;
799
+ y: number;
800
+ width: number;
801
+ height: number;
802
+ };
803
+ interface HighlightedImageResources {
804
+ regions: Record<string, Projection | null>;
805
+ resources: string[];
806
+ setRegion: (id: string, region?: Projection | null) => void;
807
+ setHighlight: (id: string | string[]) => void;
808
+ highlight: (id: string) => void;
809
+ clearHighlight: (id: string) => void;
790
810
  }
791
- declare const Layout: react.NamedExoticComponent<LayoutProps>;
792
-
793
- declare const LayoutActionsReactContext: react.Context<LayoutActions>;
794
- declare const LayoutStateReactContext: react.Context<LayoutState>;
811
+ declare const useHighlightedImageResource: zustand0.UseBoundStore<zustand0.StoreApi<HighlightedImageResources>>;
812
+ declare function useTemporaryHighlight(newValue?: Projection | null): void;
813
+ declare function useHoverHighlightImageResource(id?: string): {
814
+ onMouseEnter(): void;
815
+ onMouseLeave(): void;
816
+ };
817
+ //#endregion
818
+ //#region src/hooks/use-decay-state.d.ts
819
+ declare function useDecayState(time: number): readonly [boolean, {
820
+ readonly set: () => void;
821
+ readonly clear: (existing?: boolean) => void;
822
+ }];
823
+ //#endregion
824
+ //#region src/hooks/use-event.d.ts
825
+ declare const ReactEmitterContext: react11.Context<Emitter<any>>;
826
+ declare function EventEmitterProvider({
827
+ children,
828
+ emitter
829
+ }: {
830
+ children: React.ReactNode;
831
+ emitter: Emitter<any>;
832
+ }): react_jsx_runtime7.JSX.Element;
833
+ declare function useEmitter<Event extends Record<string | symbol, unknown>>(): Emitter<Event>;
834
+ declare function useEvent<Event extends Record<string | symbol, unknown>, Key extends keyof Event>(key: Key, listener: (data: Event[Key]) => void, deps?: any[]): void;
835
+ //#endregion
836
+ //#region src/hooks/use-match-media.d.ts
837
+ type IMediaQuery = Array<string>;
838
+ type IMatchedMedia = Array<boolean>;
839
+ declare function useMatchMedia(queries: IMediaQuery, defaultValues?: IMatchedMedia): IMatchedMedia;
840
+ //#endregion
841
+ //#region src/hooks/use-save-vault.d.ts
842
+ declare function useSaveVault(vault: Vault, saveChanges: () => void, saveInterval: number, enabled?: boolean): void;
843
+ //#endregion
844
+ //#region src/hooks/use-svg-tools.d.ts
845
+ declare function useSvgTools(): {
846
+ currentTool: polygon_editor0.ValidTools;
847
+ selectedStamp: polygon_editor0.InputShape | null;
848
+ draw: {
849
+ active: boolean;
850
+ enable: () => void;
851
+ };
852
+ polygon: {
853
+ active: boolean;
854
+ enable: () => void;
855
+ };
856
+ line: {
857
+ active: boolean;
858
+ enable: () => void;
859
+ };
860
+ lineBox: {
861
+ active: boolean;
862
+ enable: () => void;
863
+ };
864
+ square: {
865
+ active: boolean;
866
+ enable: () => void;
867
+ };
868
+ triangle: {
869
+ active: boolean;
870
+ enable: () => void;
871
+ };
872
+ hexagon: {
873
+ active: boolean;
874
+ enable: () => void;
875
+ };
876
+ circle: {
877
+ active: boolean;
878
+ enable: () => void;
879
+ };
880
+ remove: {
881
+ active: boolean;
882
+ enable: () => void;
883
+ };
884
+ };
885
+ //#endregion
886
+ //#region src/hooks/use-annotation-creator-state.d.ts
887
+ declare function useAnnotationCreatorState<Type = any>({
888
+ key,
889
+ initialValue,
890
+ requestId,
891
+ getInitialValue
892
+ }: {
893
+ key: string;
894
+ initialValue?: Type;
895
+ requestId?: string;
896
+ getInitialValue?: (metadata: any) => (Type | null);
897
+ }): readonly [Type, (newValue: Type) => void];
898
+ //#endregion
899
+ //#region src/Layout/components/HandleControls.d.ts
900
+ declare const HandleContainer: styled_components0.IStyledComponent<"web", styled_components_dist_types0.FastOmit<react11.DetailedHTMLProps<react11.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
901
+ declare const HandleControls: react11.ForwardRefExoticComponent<{
902
+ dir: "left" | "right";
903
+ open: boolean;
904
+ actions: PanelActions;
905
+ transition?: TransitionStatus;
906
+ reset?: () => void;
907
+ } & react11.RefAttributes<HTMLDivElement>>;
908
+ //#endregion
909
+ //#region src/Layout/components/ModularPanel.d.ts
910
+ interface ModularPanelProps {
911
+ panel?: LayoutPanel;
912
+ isLeft?: boolean;
913
+ state: PinnablePanelState | PanelState;
914
+ actions: PanelActions;
915
+ pinActions?: PinnablePanelActions;
916
+ transition?: TransitionStatus;
917
+ noHeader?: boolean;
918
+ close?: () => void;
919
+ available?: LayoutPanel[];
920
+ style?: any;
921
+ }
922
+ declare function useSetCustomTitle(): (title: string) => void;
923
+ declare const ModularPanelHeader: styled_components0.IStyledComponent<"web", styled_components_dist_types0.Substitute<react11.DetailedHTMLProps<react11.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
924
+ $tabs?: boolean;
925
+ $error?: boolean;
926
+ }>>;
927
+ declare const ModulePanelButton: styled_components0.IStyledComponent<"web", styled_components_dist_types0.FastOmit<react11.DetailedHTMLProps<react11.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>>;
928
+ declare function ModularPanel({
929
+ panel,
930
+ state,
931
+ actions,
932
+ isLeft,
933
+ pinActions,
934
+ transition,
935
+ close,
936
+ available,
937
+ style,
938
+ noHeader
939
+ }: ModularPanelProps): react_jsx_runtime7.JSX.Element | null;
940
+ //#endregion
941
+ //#region src/Layout/components/PanelError.d.ts
942
+ declare function PanelError(props: {
943
+ error: Error;
944
+ resetErrorBoundary: () => void;
945
+ }): react_jsx_runtime7.JSX.Element;
946
+ //#endregion
947
+ //#region src/Layout/Layout.d.ts
948
+ interface LayoutProps$1 {
949
+ header?: React.ReactNode;
950
+ footer?: React.ReactNode;
951
+ menu?: React.ReactNode;
952
+ leftPanelMenu?: React.ReactNode;
953
+ rightPanelMenu?: React.ReactNode;
954
+ centerPanelMenu?: React.ReactNode;
955
+ leftPanelMenuPosition?: "top" | "bottom";
956
+ rightPanelMenuPosition?: "top" | "bottom";
957
+ hideHeader?: boolean;
958
+ isLoading?: boolean;
959
+ className?: string;
960
+ centerPanelMenuPosition?: "top" | "bottom";
961
+ disableSideEffects?: string[];
962
+ }
963
+ declare const Layout: react11.NamedExoticComponent<LayoutProps$1>;
964
+ //#endregion
965
+ //#region src/Layout/Layout.context.d.ts
966
+ declare const LayoutActionsReactContext: react11.Context<LayoutActions>;
967
+ declare const LayoutStateReactContext: react11.Context<LayoutState>;
795
968
  declare function useLayoutState(): LayoutState;
796
969
  declare function useLayoutActions(): LayoutActions;
797
- declare function useAvailableLayouts(): LayoutProps$1;
970
+ declare function useAvailableLayouts(): LayoutProps;
798
971
  declare function useLayoutProvider(): LayoutProviderProps & {
799
- loading?: true;
800
- actions: LayoutActions;
801
- state: LayoutState;
972
+ loading?: true;
973
+ actions: LayoutActions;
974
+ state: LayoutState;
802
975
  };
803
-
976
+ //#endregion
977
+ //#region src/Layout/Layout.helpers.d.ts
804
978
  declare function isPinnableState(t: unknown): t is PinnablePanelState;
805
- declare function panelSizing({ initial, fallback, options, }: {
806
- initial?: number;
807
- fallback: number;
808
- options?: {
809
- minWidth?: number;
810
- maxWidth?: number;
811
- };
979
+ declare function panelSizing({
980
+ initial,
981
+ fallback,
982
+ options
983
+ }: {
984
+ initial?: number;
985
+ fallback: number;
986
+ options?: {
987
+ minWidth?: number;
988
+ maxWidth?: number;
989
+ };
812
990
  }): number;
813
991
  declare function renderHelper(htmlOrReact: string | ReactNode): ReactNode;
814
-
992
+ //#endregion
993
+ //#region src/Layout/Layout.hooks.d.ts
815
994
  declare function usePanelActions(panel: keyof LayoutState, dispatch: Dispatch<PanelActionType>): PanelActions | PinnablePanelActions;
816
-
995
+ //#endregion
996
+ //#region src/Layout/Layout.reducer.d.ts
817
997
  declare const layoutReducer: (state: LayoutState, args_0: PanelActionType) => LayoutState;
818
998
  declare function getDefaultPanelState(): PanelState;
819
999
  declare function getDefaultLayoutState(): LayoutState;
820
-
821
- declare const HandleContainer: styled_components.IStyledComponent<"web", styled_components_dist_types.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
822
- declare const HandleControls: react.ForwardRefExoticComponent<{
823
- dir: "left" | "right";
824
- open: boolean;
825
- actions: PanelActions;
826
- transition?: TransitionStatus;
827
- reset?: () => void;
828
- } & react.RefAttributes<HTMLDivElement>>;
829
-
830
- interface ModularPanelProps {
831
- panel?: LayoutPanel;
832
- isLeft?: boolean;
833
- state: PinnablePanelState | PanelState;
834
- actions: PanelActions;
835
- pinActions?: PinnablePanelActions;
836
- transition?: TransitionStatus;
837
- noHeader?: boolean;
838
- close?: () => void;
839
- available?: LayoutPanel[];
840
- style?: any;
841
- }
842
- declare function useSetCustomTitle(): (title: string) => void;
843
- declare const ModularPanelHeader: styled_components.IStyledComponent<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
844
- $tabs?: boolean;
845
- $error?: boolean;
846
- }>>;
847
- declare const ModulePanelButton: styled_components.IStyledComponent<"web", styled_components_dist_types.FastOmit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>>;
848
- declare function ModularPanel({ panel, state, actions, isLeft, pinActions, transition, close, available, style, noHeader, }: ModularPanelProps): react_jsx_runtime.JSX.Element | null;
849
-
850
- declare function PanelError(props: {
851
- error: Error;
852
- resetErrorBoundary: () => void;
853
- }): react_jsx_runtime.JSX.Element;
854
-
855
- declare function PreviewButton({ downloadEnabled, fileName }: {
856
- downloadEnabled?: boolean;
857
- fileName?: string;
858
- }): react_jsx_runtime.JSX.Element;
859
-
860
- declare const PreviewProvider: react.NamedExoticComponent<{
861
- previews: Preview[];
862
- children: ReactNode;
863
- configs: PreviewConfiguration[];
1000
+ //#endregion
1001
+ //#region src/PreviewButton/PreviewButton.d.ts
1002
+ declare function PreviewButton({
1003
+ downloadEnabled,
1004
+ fileName
1005
+ }: {
1006
+ downloadEnabled?: boolean;
1007
+ fileName?: string;
1008
+ }): react_jsx_runtime7.JSX.Element;
1009
+ //#endregion
1010
+ //#region src/PreviewContext/PreviewContext.d.ts
1011
+ declare const PreviewProvider: react11.NamedExoticComponent<{
1012
+ previews: Preview[];
1013
+ children: ReactNode;
1014
+ configs: PreviewConfiguration[];
864
1015
  }>;
865
1016
  declare function usePreviews(): Preview[];
866
1017
  declare function usePreviewContext(): PreviewContext;
867
-
868
- declare function usePreviewVault(): Vault;
1018
+ //#endregion
1019
+ //#region src/PreviewVault/create-preview-vault.d.ts
1020
+ declare function createPreviewVault(homepageCollectionId?: string): {
1021
+ readonly vault: Vault$1;
1022
+ readonly unsubscribe: () => void;
1023
+ readonly addHistory: (id: string, type: string) => void;
1024
+ readonly clearHistory: () => void;
1025
+ };
1026
+ //#endregion
1027
+ //#region src/PreviewVault/PreviewVault.d.ts
1028
+ declare function usePreviewVault(): Vault$1;
869
1029
  declare const HOMEPAGE_COLLECTION = "manifest-editor://homepage-collection.json";
870
1030
  declare function usePreviewHistory(): {
871
- addHistory: (id: string, type: string) => void;
872
- clearHistory: () => void;
1031
+ addHistory: (id: string, type: string) => void;
1032
+ clearHistory: () => void;
873
1033
  };
874
1034
  declare function PreviewVaultContext(props: {
875
- children: any;
876
- }): react_jsx_runtime.JSX.Element;
877
- declare function PreviewVaultBoundary({ children }: {
878
- children: any;
879
- }): react_jsx_runtime.JSX.Element;
880
-
881
- declare function createPreviewVault(homepageCollectionId?: string): {
882
- readonly vault: Vault;
883
- readonly unsubscribe: () => void;
884
- readonly addHistory: (id: string, type: string) => void;
885
- readonly clearHistory: () => void;
886
- };
887
-
1035
+ children: any;
1036
+ }): react_jsx_runtime7.JSX.Element;
1037
+ declare function PreviewVaultBoundary({
1038
+ children
1039
+ }: {
1040
+ children: any;
1041
+ }): react_jsx_runtime7.JSX.Element;
1042
+ //#endregion
1043
+ //#region src/ResourceEditingContext/ResourceEditingContext.d.ts
888
1044
  interface ResourceEditingContext {
889
- resource: Reference<any> | null;
1045
+ resource: Reference<any> | null;
890
1046
  }
891
- declare const ResourceEditingReactContext: react.Context<ResourceEditingContext>;
1047
+ declare const ResourceEditingReactContext: react11.Context<ResourceEditingContext>;
892
1048
  declare function useEditingContext(): ResourceEditingContext;
893
1049
  /**
894
1050
  * useResource
895
1051
  *
896
1052
  * Only use this if you KNOW that there is a resource (e.g. in a panel)
897
1053
  */
898
- declare function useResource<T = Record<string, never>>(): T & Reference<any>;
1054
+ declare function useResource<T$1 = Record<string, never>>(): T$1 & Reference<any>;
899
1055
  /**
900
1056
  * useOptionalResource
901
1057
  *
902
1058
  * Use in components where you don't know if something is editing. (e.g. canvas listing)
903
1059
  */
904
1060
  declare function useOptionalResource(): {
905
- type: any;
906
- id: string;
1061
+ type: any;
1062
+ id: string;
907
1063
  } | null;
908
- declare function ResourceEditingProvider({ resource, children, }: {
909
- resource: {
910
- id: string;
911
- type: string;
912
- } | null | undefined;
913
- children: ReactNode;
914
- }): react_jsx_runtime.JSX.Element;
915
-
916
- declare function ShellProvider({ config, saveConfig, children, theme, previews, resource, editing, }: {
917
- resource: Resource;
918
- config?: Partial<Config>;
919
- saveConfig?: (config: Partial<Config>) => void;
920
- children: ReactNode;
921
- theme?: any;
922
- previews?: Preview[];
923
- editing?: {
924
- id: string;
925
- type: string;
926
- };
927
- }): react_jsx_runtime.JSX.Element;
928
-
1064
+ declare function ResourceEditingProvider({
1065
+ resource,
1066
+ children
1067
+ }: {
1068
+ resource: {
1069
+ id: string;
1070
+ type: string;
1071
+ } | null | undefined;
1072
+ children: ReactNode;
1073
+ }): react_jsx_runtime7.JSX.Element;
1074
+ //#endregion
1075
+ //#region src/ShellContext/ShellContext.d.ts
1076
+ declare function ShellProvider({
1077
+ config,
1078
+ saveConfig,
1079
+ children,
1080
+ theme,
1081
+ previews,
1082
+ resource,
1083
+ editing
1084
+ }: {
1085
+ resource: Resource;
1086
+ config?: Partial<Config>;
1087
+ saveConfig?: (config: Partial<Config>) => void;
1088
+ children: ReactNode;
1089
+ theme?: any;
1090
+ previews?: Preview[];
1091
+ editing?: {
1092
+ id: string;
1093
+ type: string;
1094
+ };
1095
+ }): react_jsx_runtime7.JSX.Element;
1096
+ //#endregion
1097
+ //#region src/TaskBridge/TaskBridge.d.ts
929
1098
  interface Task<Req = any, Res = any> {
930
- name: string;
931
- status: "idle" | "running" | "complete" | "error";
932
- emitter: Emitter<any>;
933
- promise: Promise<any>;
934
- abort: AbortController;
935
- resolve: (value?: any) => void;
936
- reject: (reason?: any) => void;
937
- error?: string;
938
- request?: Req;
939
- response?: Res;
1099
+ name: string;
1100
+ status: "idle" | "running" | "complete" | "error";
1101
+ emitter: Emitter<any>;
1102
+ promise: Promise<any>;
1103
+ abort: AbortController;
1104
+ resolve: (value?: any) => void;
1105
+ reject: (reason?: any) => void;
1106
+ error?: string;
1107
+ request?: Req;
1108
+ response?: Res;
940
1109
  }
941
1110
  declare function useTask(name: string): Task<any, any>;
942
1111
  declare function useTaskEvent<Req = any, Res = any>(task: Task<Req, Res>, name: string, _cb: (task: Task<Req, Res>) => any): void;
943
1112
  declare function useTaskDispatch<Req = any, Res = any>(name: string, onComplete?: (task: Task<Req, Res>) => void | Promise<void>): readonly [(request?: any) => void, Task<any, any>];
944
1113
  declare function useTaskRunner<Req = any, Res = any>(name: string, onRun: (task: Task<Req, Res>) => void | Promise<void>): readonly [(response?: any) => void, Task<any, any>, (reason?: any, error?: any) => void];
945
- declare function TaskBridge({ children }: {
946
- children?: ReactNode;
947
- }): react_jsx_runtime.JSX.Element;
948
-
949
- interface UniversalCopyPasteProps<T> {
950
- as?: keyof JSX.IntrinsicElements | react.ComponentType<T>;
951
- children?: ReactNode;
952
- reference?: Reference;
953
- onReference?: (reference: Reference) => void;
954
- onPasteReference?: (reference: Reference) => void;
955
- onDropReference?: (reference: Reference, e: DragEvent) => void;
956
- onLink?: (link: string) => void;
957
- onPasteLink?: (link: string) => void;
958
- onDropLink?: (link: string) => void;
959
- onAnalysis?: (analysisResults: any) => void;
960
- onPasteAnalysis?: (analysisResults: any) => void;
961
- onDropAnalysis?: (analysisResults: any) => void;
962
- onLoading?: () => void;
963
- onComplete?: () => void;
964
- }
965
-
966
- declare function UniversalCopyTarget<T>({ as, reference: _ref, onReference, onLink, onAnalysis, onDropReference: _onDropReference, onDropLink: _onDropLink, onDropAnalysis: _onDropAnalysis, onPasteReference: _onPasteReference, onPasteLink: _onPasteLink, onPasteAnalysis: _onPasteAnalysis, ...props }: Partial<HTMLAttributes<HTMLElement>> & UniversalCopyPasteProps<T> & T): react_jsx_runtime.JSX.Element;
967
-
968
- declare function detectMedia(): Promise<void>;
969
- declare function analyse(url: string, ...expectedTypes: string[]): Promise<any>;
970
- declare function analyseJson(data: any, url: string): Promise<any>;
971
- declare function getFormat(url: string, capturedContentType?: string): Promise<string>;
972
- declare function getImageDimensions(url: string): Promise<{
973
- width: number;
974
- height: number;
975
- } | null>;
976
-
977
- declare function getManifestNomalized(id: string): Promise<ManifestNormalized | undefined>;
978
- declare function createActionIdentity(type: string, property: string, parent: any): string;
979
- declare function createDownload(data: any, fileName: string, fileType?: string): void;
980
- declare function copyToClipboard(json: string | any): Promise<void>;
981
- declare function randomId(): string;
982
- declare function mapApp(input: any, map?: (app: MappedApp$1) => MappedApp$1): MappedApp$1;
983
- declare function extendApp(app: MappedApp$1, metadata: MappedApp$1["metadata"], extensions: AppExtension): MappedApp$1;
984
-
985
- type Projection = {
986
- x: number;
987
- y: number;
988
- width: number;
989
- height: number;
990
- };
991
- interface HighlightedImageResources {
992
- regions: Record<string, Projection | null>;
993
- resources: string[];
994
- setRegion: (id: string, region?: Projection | null) => void;
995
- setHighlight: (id: string | string[]) => void;
996
- highlight: (id: string) => void;
997
- clearHighlight: (id: string) => void;
1114
+ declare function TaskBridge({
1115
+ children
1116
+ }: {
1117
+ children?: ReactNode;
1118
+ }): react_jsx_runtime7.JSX.Element;
1119
+ //#endregion
1120
+ //#region src/Universal/UniversalCopyPaste.types.d.ts
1121
+ interface UniversalCopyPasteProps<T$1> {
1122
+ as?: keyof JSX.IntrinsicElements | react11.ComponentType<T$1>;
1123
+ children?: ReactNode;
1124
+ reference?: Reference;
1125
+ onReference?: (reference: Reference) => void;
1126
+ onPasteReference?: (reference: Reference) => void;
1127
+ onDropReference?: (reference: Reference, e: DragEvent) => void;
1128
+ onLink?: (link: string) => void;
1129
+ onPasteLink?: (link: string) => void;
1130
+ onDropLink?: (link: string) => void;
1131
+ onAnalysis?: (analysisResults: any) => void;
1132
+ onPasteAnalysis?: (analysisResults: any) => void;
1133
+ onDropAnalysis?: (analysisResults: any) => void;
1134
+ onLoading?: () => void;
1135
+ onComplete?: () => void;
998
1136
  }
999
- declare const useHighlightedImageResource: zustand.UseBoundStore<zustand.StoreApi<HighlightedImageResources>>;
1000
- declare function useTemporaryHighlight(newValue?: Projection | null): void;
1001
- declare function useHoverHighlightImageResource(id?: string): {
1002
- onMouseEnter(): void;
1003
- onMouseLeave(): void;
1004
- };
1005
-
1006
- declare function useSaveVault(vault: Vault$1, saveChanges: () => void, saveInterval: number, enabled?: boolean): void;
1007
-
1008
- declare function useDecayState(time: number): readonly [boolean, {
1009
- readonly set: () => void;
1010
- readonly clear: (existing?: boolean) => void;
1011
- }];
1012
-
1013
- declare const ReactEmitterContext: react.Context<Emitter<any>>;
1014
- declare function EventEmitterProvider({ children, emitter, }: {
1015
- children: React.ReactNode;
1016
- emitter: Emitter<any>;
1017
- }): react_jsx_runtime.JSX.Element;
1018
- declare function useEmitter<Event extends Record<string | symbol, unknown>>(): Emitter<Event>;
1019
- declare function useEvent<Event extends Record<string | symbol, unknown>, Key extends keyof Event>(key: Key, listener: (data: Event[Key]) => void, deps?: any[]): void;
1020
-
1021
- declare function useSvgTools(): {
1022
- draw: {
1023
- active: boolean;
1024
- enable: () => void;
1025
- };
1026
- polygon: {
1027
- active: boolean;
1028
- enable: () => void;
1029
- };
1030
- line: {
1031
- active: boolean;
1032
- enable: () => void;
1033
- };
1034
- lineBox: {
1035
- active: boolean;
1036
- enable: () => void;
1037
- };
1038
- square: {
1039
- active: boolean;
1040
- enable: () => void;
1041
- };
1042
- triangle: {
1043
- active: boolean;
1044
- enable: () => void;
1045
- };
1046
- hexagon: {
1047
- active: boolean;
1048
- enable: () => void;
1049
- };
1050
- circle: {
1051
- active: boolean;
1052
- enable: () => void;
1053
- };
1054
- remove: {
1055
- active: boolean;
1056
- enable: () => void;
1057
- };
1058
- };
1059
-
1060
- type IMediaQuery = Array<string>;
1061
- type IMatchedMedia = Array<boolean>;
1062
- declare function useMatchMedia(queries: IMediaQuery, defaultValues?: IMatchedMedia): IMatchedMedia;
1063
-
1064
- declare function useRequestAnnotation(opts?: {
1065
- onSuccess?: (r: AnnotationResponse) => void;
1066
- }): {
1067
- id: number;
1068
- busy: boolean;
1069
- isPending: boolean;
1070
- requestAnnotation: (request: AnnotationRequest, options?: Omit<AnnotationRequestOptions, "requestId">) => Promise<AnnotationResponse | null>;
1071
- cancelRequest: () => void;
1072
- completeRequest: () => void;
1073
- reset: () => void;
1074
- data: AnnotationResponse | null;
1075
- };
1076
-
1077
- declare function polygonToBoundingBox(polygon: InputShape | null): {
1078
- x: number;
1079
- y: number;
1080
- width: number;
1081
- height: number;
1082
- } | null;
1083
-
1084
- 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 };
1137
+ //#endregion
1138
+ //#region src/Universal/UniversalCopyPaste.d.ts
1139
+ declare function UniversalCopyTarget<T$1>({
1140
+ as,
1141
+ reference: _ref,
1142
+ onReference,
1143
+ onLink,
1144
+ onAnalysis,
1145
+ onDropReference: _onDropReference,
1146
+ onDropLink: _onDropLink,
1147
+ onDropAnalysis: _onDropAnalysis,
1148
+ onPasteReference: _onPasteReference,
1149
+ onPasteLink: _onPasteLink,
1150
+ onPasteAnalysis: _onPasteAnalysis,
1151
+ ...props
1152
+ }: Partial<HTMLAttributes<HTMLElement>> & UniversalCopyPasteProps<T$1> & T$1): react_jsx_runtime7.JSX.Element;
1153
+ //#endregion
1154
+ export { AnnotationPanel, AppContext, AppExtension, AppHeader, AppMenuProvider, AppProvider, AppReactContext, AppResourceInstanceProvider, AppResourceProvider, AppState, AppStateReactContext, AtlasStoreProvider, AtlasStoreReactContext, BackgroundPanel, BaseAnnotationCreator, BaseEditor, BaseEditorBackButton, BaseEditorCloseButton, CanvasEditorDefinition, Config, ConfigEditor, ConfigProvider, ConfigReactContext, ContextMenuItem, ContextMenuProvider, ContextMenuReactContext, ContextMenuRequest, EditableResource, EditingStack, EditingStackActionCreators, EditingStackActions, EditingStackContext, EditingStackState, EditorConfig, EditorDefinition, EventEmitterProvider, ExportPanel, ExportPanelProps, HOMEPAGE_COLLECTION, HandleContainer, HandleControls, InlineEditingStack, Layout, LayoutActions, LayoutActionsReactContext, LayoutContext, LayoutFunction, LayoutPanel, LayoutPanelContext, LayoutProps, LayoutProviderProps, LayoutState, LayoutStateReactContext, LoadedApp, MappedApp, MenuPositions, ModularPanel, ModularPanelHeader, ModulePanelButton, MultiAppContext, MultiAppProvider, PanelActionType, PanelActions, PanelError, PanelState, PinnablePanelActions, PinnablePanelState, PinnedLayoutPanel, Preview, PreviewActions, PreviewActionsType, PreviewButton, PreviewConfiguration, PreviewContext, PreviewHandler, PreviewProvider, PreviewState, PreviewVaultBoundary, PreviewVaultContext, PrimeAppReactContext, ReactEmitterContext, Resource, ResourceDefinition, ResourceEditingProvider, ResourceEditingReactContext, SaveConfigReactContext, ShellProvider, TaskBridge, UniversalCopyPasteProps, UniversalCopyTarget, UploadBackendConfig, analyse, analyseJson, baseCreator, baseEditor, copyToClipboard, createActionIdentity, createDownload, createPreviewVault, detectMedia, editBasedOnResource, extendApp, getDefaultLayoutState, getDefaultPanelState, getFormat, getImageDimensions, getManifestNomalized, isPinnableState, layoutReducer, mapApp, panelSizing, polygonToBoundingBox, randomId, renderHelper, useAnnotationCreatorState, useAnnotationPageEditor, useApp, useAppInstance, useAppMenu, useAppMenuItem, useAppResource, useAppResourceInstance, useAppState, useApps, useAtlasStore, useAvailableLayouts, useCollectionEditor, useConfig, useCreatingResource, useCreator, useCustomContextMenu, useDecayState, useEditingContext, useEditingResource, useEditingResourceStack, useEditingStack, useEditor, useEmitter, useEvent, useGenericEditor, useHighlightedImageResource, useHoverHighlightImageResource, useInlineCreator, useLayoutActions, useLayoutProvider, useLayoutState, useLocalStorage, useManifestEditor, useMatchMedia, useOptionalLocalStorage, useOptionalResource, usePanelActions, usePreviewContext, usePreviewHistory, usePreviewVault, usePreviews, useResource, useResourceContextMenuItems, useSaveConfig, useSaveVault, useSetCustomTitle, useSvgTools, useTask, useTaskDispatch, useTaskEvent, useTaskRunner, useTemporaryHighlight };
1155
+ //# sourceMappingURL=index.d.ts.map