@semiont/react-ui 0.2.28-build.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +287 -0
- package/dist/TranslationManager-Co_5fSxl.d.mts +118 -0
- package/dist/ar-TQSFB35U.mjs +325 -0
- package/dist/ar-TQSFB35U.mjs.map +1 -0
- package/dist/bn-525U24T3.mjs +325 -0
- package/dist/bn-525U24T3.mjs.map +1 -0
- package/dist/chunk-3JTO27MH.mjs +50 -0
- package/dist/chunk-3JTO27MH.mjs.map +1 -0
- package/dist/chunk-BHAP6MVA.mjs +325 -0
- package/dist/chunk-BHAP6MVA.mjs.map +1 -0
- package/dist/chunk-W6E2UESX.mjs +387 -0
- package/dist/chunk-W6E2UESX.mjs.map +1 -0
- package/dist/cs-OYWTGLFM.mjs +325 -0
- package/dist/cs-OYWTGLFM.mjs.map +1 -0
- package/dist/da-BDXG2ITK.mjs +325 -0
- package/dist/da-BDXG2ITK.mjs.map +1 -0
- package/dist/de-NB5JLMES.mjs +325 -0
- package/dist/de-NB5JLMES.mjs.map +1 -0
- package/dist/el-3SVXEAJI.mjs +325 -0
- package/dist/el-3SVXEAJI.mjs.map +1 -0
- package/dist/en-DVB4OE2R.mjs +39 -0
- package/dist/en-DVB4OE2R.mjs.map +1 -0
- package/dist/es-YBOFA3W5.mjs +325 -0
- package/dist/es-YBOFA3W5.mjs.map +1 -0
- package/dist/fa-7MU36AMY.mjs +325 -0
- package/dist/fa-7MU36AMY.mjs.map +1 -0
- package/dist/fi-PQKJB32G.mjs +325 -0
- package/dist/fi-PQKJB32G.mjs.map +1 -0
- package/dist/fr-U4HK5GM6.mjs +325 -0
- package/dist/fr-U4HK5GM6.mjs.map +1 -0
- package/dist/he-F5MNZHAL.mjs +325 -0
- package/dist/he-F5MNZHAL.mjs.map +1 -0
- package/dist/hi-2PHI37ZX.mjs +325 -0
- package/dist/hi-2PHI37ZX.mjs.map +1 -0
- package/dist/id-JPRBNCGS.mjs +325 -0
- package/dist/id-JPRBNCGS.mjs.map +1 -0
- package/dist/index.d.mts +3003 -0
- package/dist/index.mjs +51026 -0
- package/dist/index.mjs.map +1 -0
- package/dist/it-MRLWI5OS.mjs +325 -0
- package/dist/it-MRLWI5OS.mjs.map +1 -0
- package/dist/ja-YQ6RPI2T.mjs +325 -0
- package/dist/ja-YQ6RPI2T.mjs.map +1 -0
- package/dist/ko-DUAVCEXX.mjs +325 -0
- package/dist/ko-DUAVCEXX.mjs.map +1 -0
- package/dist/magic-string.es-7FJ3LUGB.mjs +1310 -0
- package/dist/magic-string.es-7FJ3LUGB.mjs.map +1 -0
- package/dist/ms-FBHSR4PG.mjs +325 -0
- package/dist/ms-FBHSR4PG.mjs.map +1 -0
- package/dist/nl-IC2MPZXN.mjs +325 -0
- package/dist/nl-IC2MPZXN.mjs.map +1 -0
- package/dist/no-LLD43NRM.mjs +325 -0
- package/dist/no-LLD43NRM.mjs.map +1 -0
- package/dist/pl-DDOJBR4D.mjs +325 -0
- package/dist/pl-DDOJBR4D.mjs.map +1 -0
- package/dist/pt-7TFHQRRN.mjs +325 -0
- package/dist/pt-7TFHQRRN.mjs.map +1 -0
- package/dist/ro-P4PJEGDU.mjs +325 -0
- package/dist/ro-P4PJEGDU.mjs.map +1 -0
- package/dist/sv-LF3VEQD2.mjs +325 -0
- package/dist/sv-LF3VEQD2.mjs.map +1 -0
- package/dist/test-utils.d.mts +104 -0
- package/dist/test-utils.mjs +34240 -0
- package/dist/test-utils.mjs.map +1 -0
- package/dist/th-YUQAOFXF.mjs +325 -0
- package/dist/th-YUQAOFXF.mjs.map +1 -0
- package/dist/tr-CSIGLMJC.mjs +325 -0
- package/dist/tr-CSIGLMJC.mjs.map +1 -0
- package/dist/uk-LW3QBKSR.mjs +325 -0
- package/dist/uk-LW3QBKSR.mjs.map +1 -0
- package/dist/vi-W464Y6ZC.mjs +325 -0
- package/dist/vi-W464Y6ZC.mjs.map +1 -0
- package/dist/zh-R5XLM3EI.mjs +325 -0
- package/dist/zh-R5XLM3EI.mjs.map +1 -0
- package/package.json +62 -0
- package/translations/ar.json +287 -0
- package/translations/bn.json +287 -0
- package/translations/cs.json +287 -0
- package/translations/da.json +287 -0
- package/translations/de.json +287 -0
- package/translations/el.json +287 -0
- package/translations/en.json +287 -0
- package/translations/es.json +287 -0
- package/translations/fa.json +287 -0
- package/translations/fi.json +287 -0
- package/translations/fr.json +287 -0
- package/translations/he.json +287 -0
- package/translations/hi.json +287 -0
- package/translations/id.json +287 -0
- package/translations/it.json +287 -0
- package/translations/ja.json +287 -0
- package/translations/ko.json +287 -0
- package/translations/ms.json +287 -0
- package/translations/nl.json +287 -0
- package/translations/no.json +287 -0
- package/translations/pl.json +287 -0
- package/translations/pt.json +287 -0
- package/translations/ro.json +287 -0
- package/translations/sv.json +287 -0
- package/translations/th.json +287 -0
- package/translations/tr.json +287 -0
- package/translations/uk.json +287 -0
- package/translations/vi.json +287 -0
- package/translations/zh.json +287 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,3003 @@
|
|
|
1
|
+
import * as _semiont_api_client from '@semiont/api-client';
|
|
2
|
+
import { components, ResourceUri, Selector, GenerationContext, SemiontApiClient, AnnotationUri, ResourceAnnotationUri, ValidationResult, DetectionProgress as DetectionProgress$1, GenerationProgress as GenerationProgress$1, ResourceEvent as ResourceEvent$1, StoredEvent, paths } from '@semiont/api-client';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { A as ApiClientManager, O as OpenResourcesManager, S as SessionManager, T as TranslationManager } from './TranslationManager-Co_5fSxl.mjs';
|
|
5
|
+
export { a as OpenResource, b as SessionState } from './TranslationManager-Co_5fSxl.mjs';
|
|
6
|
+
import * as React$1 from 'react';
|
|
7
|
+
import React__default, { MutableRefObject, KeyboardEvent as KeyboardEvent$1, ReactNode, Component, ErrorInfo } from 'react';
|
|
8
|
+
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
9
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
10
|
+
import * as _codemirror_state from '@codemirror/state';
|
|
11
|
+
import { HighlightStyle } from '@codemirror/language';
|
|
12
|
+
import { WidgetType } from '@codemirror/view';
|
|
13
|
+
import { Root } from 'hast';
|
|
14
|
+
import { Root as Root$1 } from 'mdast';
|
|
15
|
+
import { VFile } from 'vfile';
|
|
16
|
+
import { TagSchema } from '@semiont/ontology';
|
|
17
|
+
export { TAG_SCHEMAS, TagCategory, TagSchema, getAllTagSchemas, getSchemaCategory as getTagCategory, getTagSchema, getTagSchemasByDomain, isValidCategory } from '@semiont/ontology';
|
|
18
|
+
|
|
19
|
+
type Annotation$o = components['schemas']['Annotation'];
|
|
20
|
+
/**
|
|
21
|
+
* Collection of all annotation types for a resource.
|
|
22
|
+
* Replaces separate highlights, references, assessments, comments, tags props.
|
|
23
|
+
*/
|
|
24
|
+
interface AnnotationsCollection {
|
|
25
|
+
highlights: Annotation$o[];
|
|
26
|
+
references: Annotation$o[];
|
|
27
|
+
assessments: Annotation$o[];
|
|
28
|
+
comments: Annotation$o[];
|
|
29
|
+
tags: Annotation$o[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Event handlers for annotation interactions.
|
|
33
|
+
* Groups multiple click and hover handlers into a single interface.
|
|
34
|
+
*/
|
|
35
|
+
interface AnnotationHandlers {
|
|
36
|
+
/** Unified click handler - routes based on annotation type and current mode */
|
|
37
|
+
onClick?: (annotation: Annotation$o, event?: React.MouseEvent) => void;
|
|
38
|
+
/** Unified hover handler for all annotation types */
|
|
39
|
+
onHover?: (annotationId: string | null) => void;
|
|
40
|
+
/** Hover handler specifically for comment panel highlighting */
|
|
41
|
+
onCommentHover?: (commentId: string | null) => void;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* UI-level parameters for annotation creation.
|
|
45
|
+
* Works for both text selections and image shapes.
|
|
46
|
+
* Used by annotation UI components before converting to AnnotationManager params.
|
|
47
|
+
*/
|
|
48
|
+
interface UICreateAnnotationParams {
|
|
49
|
+
/** The motivation for creating this annotation */
|
|
50
|
+
motivation: SelectionMotivation;
|
|
51
|
+
/** Selector information - either text or SVG */
|
|
52
|
+
selector: {
|
|
53
|
+
/** Selector type */
|
|
54
|
+
type: 'TextQuoteSelector' | 'SvgSelector';
|
|
55
|
+
/** For TextQuoteSelector: the exact text selected */
|
|
56
|
+
exact?: string;
|
|
57
|
+
/** For TextQuoteSelector: context before selection */
|
|
58
|
+
prefix?: string;
|
|
59
|
+
/** For TextQuoteSelector: context after selection */
|
|
60
|
+
suffix?: string;
|
|
61
|
+
/** For TextPositionSelector: start position in document */
|
|
62
|
+
start?: number;
|
|
63
|
+
/** For TextPositionSelector: end position in document */
|
|
64
|
+
end?: number;
|
|
65
|
+
/** For SvgSelector: the SVG shape string */
|
|
66
|
+
value?: string;
|
|
67
|
+
};
|
|
68
|
+
/** Optional position for popup placement (text: near selection, image: shape center) */
|
|
69
|
+
position?: {
|
|
70
|
+
x: number;
|
|
71
|
+
y: number;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Unified creation handler for new annotations.
|
|
76
|
+
* Works for both text and image annotations.
|
|
77
|
+
*
|
|
78
|
+
* Behavior by motivation:
|
|
79
|
+
* - highlighting/assessing: Creates annotation immediately
|
|
80
|
+
* - commenting: Creates annotation, then opens Comment Panel
|
|
81
|
+
* - linking: Shows Quick Reference popup FIRST, creates when user confirms
|
|
82
|
+
*/
|
|
83
|
+
interface AnnotationCreationHandler {
|
|
84
|
+
onCreate?: (params: UICreateAnnotationParams) => void | Promise<void> | Promise<Annotation$o | undefined>;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* UI state for annotation toolbar and interactions.
|
|
88
|
+
* Groups multiple UI state props into a single object.
|
|
89
|
+
*/
|
|
90
|
+
interface AnnotationUIState {
|
|
91
|
+
/** Currently selected annotation motivation (linking, highlighting, etc.) */
|
|
92
|
+
selectedMotivation: SelectionMotivation | null;
|
|
93
|
+
/** Currently selected click mode (detail, follow, delete, jsonld) */
|
|
94
|
+
selectedClick: ClickAction;
|
|
95
|
+
/** Currently selected shape for image annotations */
|
|
96
|
+
selectedShape: ShapeType;
|
|
97
|
+
/** ID of currently hovered annotation (optional - only set when hovering) */
|
|
98
|
+
hoveredAnnotationId?: string | null;
|
|
99
|
+
/** ID of currently hovered comment for panel highlighting (optional - only set when hovering) */
|
|
100
|
+
hoveredCommentId?: string | null;
|
|
101
|
+
/** ID of annotation to scroll to (optional - only set when scrolling needed) */
|
|
102
|
+
scrollToAnnotationId?: string | null;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Configuration options for annotation views.
|
|
106
|
+
* Groups feature flags and settings.
|
|
107
|
+
*/
|
|
108
|
+
interface AnnotationConfig {
|
|
109
|
+
/** Whether content is editable */
|
|
110
|
+
editable?: boolean;
|
|
111
|
+
/** Whether to show annotation widgets (entity types, reference buttons) */
|
|
112
|
+
enableWidgets?: boolean;
|
|
113
|
+
/** Whether to show line numbers in code view */
|
|
114
|
+
showLineNumbers?: boolean;
|
|
115
|
+
/** Whether view is in annotate mode or browse mode */
|
|
116
|
+
annotateMode?: boolean;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
type Annotation$n = components['schemas']['Annotation'];
|
|
120
|
+
/**
|
|
121
|
+
* Parameters for creating an annotation
|
|
122
|
+
*/
|
|
123
|
+
interface CreateAnnotationParams {
|
|
124
|
+
rUri: ResourceUri;
|
|
125
|
+
motivation: 'highlighting' | 'linking' | 'assessing' | 'commenting' | 'tagging';
|
|
126
|
+
selector: Selector | Selector[];
|
|
127
|
+
body?: any[];
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Parameters for deleting an annotation
|
|
131
|
+
*/
|
|
132
|
+
interface DeleteAnnotationParams {
|
|
133
|
+
annotationId: string;
|
|
134
|
+
rUri: ResourceUri;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Annotation Manager Interface
|
|
138
|
+
*
|
|
139
|
+
* Framework-agnostic interface for annotation mutations.
|
|
140
|
+
* Apps provide implementations via AnnotationProvider.
|
|
141
|
+
*
|
|
142
|
+
* Example implementation (React Query):
|
|
143
|
+
* ```typescript
|
|
144
|
+
* function useAnnotationManager(): AnnotationManager {
|
|
145
|
+
* const createMutation = useAnnotations().create.useMutation();
|
|
146
|
+
* const deleteMutation = useAnnotations().delete.useMutation();
|
|
147
|
+
*
|
|
148
|
+
* return {
|
|
149
|
+
* createAnnotation: async (params) => {
|
|
150
|
+
* const result = await createMutation.mutateAsync({...});
|
|
151
|
+
* return result.annotation;
|
|
152
|
+
* },
|
|
153
|
+
* deleteAnnotation: async (params) => {
|
|
154
|
+
* await deleteMutation.mutateAsync({...});
|
|
155
|
+
* }
|
|
156
|
+
* };
|
|
157
|
+
* }
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
interface AnnotationManager {
|
|
161
|
+
/**
|
|
162
|
+
* Create a new annotation
|
|
163
|
+
* @param params - Creation parameters (rUri, motivation, selector, body)
|
|
164
|
+
* @returns Promise resolving to the created annotation, or undefined if creation fails
|
|
165
|
+
*/
|
|
166
|
+
createAnnotation: (params: CreateAnnotationParams) => Promise<Annotation$n | undefined>;
|
|
167
|
+
/**
|
|
168
|
+
* Delete an annotation
|
|
169
|
+
* @param params - Deletion parameters (annotationId, rUri)
|
|
170
|
+
* @returns Promise resolving when deletion completes
|
|
171
|
+
*/
|
|
172
|
+
deleteAnnotation: (params: DeleteAnnotationParams) => Promise<void>;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Cache Manager Interface
|
|
177
|
+
*
|
|
178
|
+
* Framework-agnostic interface for cache invalidation.
|
|
179
|
+
* Apps provide implementations via CacheProvider.
|
|
180
|
+
*
|
|
181
|
+
* This abstraction allows react-ui to trigger cache invalidation
|
|
182
|
+
* without depending on a specific data fetching library (React Query, SWR, Apollo, etc.)
|
|
183
|
+
*
|
|
184
|
+
* Example implementation (React Query):
|
|
185
|
+
* ```typescript
|
|
186
|
+
* function useCacheManager(): CacheManager {
|
|
187
|
+
* const queryClient = useQueryClient();
|
|
188
|
+
*
|
|
189
|
+
* return {
|
|
190
|
+
* invalidateAnnotations: (rUri) => {
|
|
191
|
+
* queryClient.invalidateQueries({ queryKey: ['annotations', rUri] });
|
|
192
|
+
* },
|
|
193
|
+
* invalidateEvents: (rUri) => {
|
|
194
|
+
* queryClient.invalidateQueries({ queryKey: ['documents', 'events', rUri] });
|
|
195
|
+
* }
|
|
196
|
+
* };
|
|
197
|
+
* }
|
|
198
|
+
* ```
|
|
199
|
+
*
|
|
200
|
+
* Example implementation (SWR):
|
|
201
|
+
* ```typescript
|
|
202
|
+
* function useCacheManager(): CacheManager {
|
|
203
|
+
* const { mutate } = useSWRConfig();
|
|
204
|
+
*
|
|
205
|
+
* return {
|
|
206
|
+
* invalidateAnnotations: (rUri) => {
|
|
207
|
+
* mutate((key) => Array.isArray(key) && key[0] === 'annotations' && key[1] === rUri);
|
|
208
|
+
* },
|
|
209
|
+
* invalidateEvents: (rUri) => {
|
|
210
|
+
* mutate((key) => Array.isArray(key) && key[0] === 'events' && key[1] === rUri);
|
|
211
|
+
* }
|
|
212
|
+
* };
|
|
213
|
+
* }
|
|
214
|
+
* ```
|
|
215
|
+
*/
|
|
216
|
+
interface CacheManager {
|
|
217
|
+
/**
|
|
218
|
+
* Invalidate annotation cache for a resource
|
|
219
|
+
* @param rUri - Resource URI
|
|
220
|
+
* @returns Promise or void (synchronous invalidation is acceptable)
|
|
221
|
+
*/
|
|
222
|
+
invalidateAnnotations: (rUri: ResourceUri) => void | Promise<void>;
|
|
223
|
+
/**
|
|
224
|
+
* Invalidate events cache for a resource
|
|
225
|
+
* @param rUri - Resource URI
|
|
226
|
+
* @returns Promise or void (synchronous invalidation is acceptable)
|
|
227
|
+
*/
|
|
228
|
+
invalidateEvents: (rUri: ResourceUri) => void | Promise<void>;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Type definitions for resource viewer feature
|
|
233
|
+
*/
|
|
234
|
+
|
|
235
|
+
type SemiontResource$2 = components['schemas']['ResourceDescriptor'];
|
|
236
|
+
type Annotation$m = components['schemas']['Annotation'];
|
|
237
|
+
type Motivation$2 = components['schemas']['Motivation'];
|
|
238
|
+
/**
|
|
239
|
+
* Selection for creating annotations
|
|
240
|
+
*/
|
|
241
|
+
interface TextSelection {
|
|
242
|
+
exact: string;
|
|
243
|
+
start: number;
|
|
244
|
+
end: number;
|
|
245
|
+
prefix?: string;
|
|
246
|
+
suffix?: string;
|
|
247
|
+
svgSelector?: string;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Generation options
|
|
251
|
+
*/
|
|
252
|
+
interface GenerationOptions {
|
|
253
|
+
title: string;
|
|
254
|
+
prompt?: string;
|
|
255
|
+
language?: string;
|
|
256
|
+
temperature?: number;
|
|
257
|
+
maxTokens?: number;
|
|
258
|
+
context?: GenerationContext;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Centralized annotation type registry
|
|
263
|
+
*
|
|
264
|
+
* Single source of truth for W3C annotation motivation metadata including:
|
|
265
|
+
* - Visual styling (CSS classes)
|
|
266
|
+
* - Behavior flags (clickable, hover, side panel)
|
|
267
|
+
* - Type guards (motivation matching)
|
|
268
|
+
* - Accessibility (screen reader announcements)
|
|
269
|
+
* - Runtime handlers (click, hover, detect, update, create)
|
|
270
|
+
*
|
|
271
|
+
* Per CLAUDE.md: This is the ONLY place to define annotation type metadata.
|
|
272
|
+
* No aliasing, wrappers, or compatibility layers elsewhere.
|
|
273
|
+
*/
|
|
274
|
+
|
|
275
|
+
type Annotation$l = components['schemas']['Annotation'];
|
|
276
|
+
type Motivation$1 = components['schemas']['Motivation'];
|
|
277
|
+
/**
|
|
278
|
+
* Detection configuration for SSE-based annotation detection
|
|
279
|
+
*/
|
|
280
|
+
interface DetectionConfig {
|
|
281
|
+
sseMethod: 'detectAnnotations' | 'detectHighlights' | 'detectAssessments' | 'detectComments' | 'detectTags';
|
|
282
|
+
countField: 'foundCount' | 'createdCount' | 'tagsCreated';
|
|
283
|
+
displayNamePlural: string;
|
|
284
|
+
displayNameSingular: string;
|
|
285
|
+
formatRequestParams?: (args: any[]) => Array<{
|
|
286
|
+
label: string;
|
|
287
|
+
value: string;
|
|
288
|
+
}>;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Annotator: Encapsulates all motivation-specific behavior
|
|
292
|
+
* Handles clicks, hovers, detection, and other operations for one annotation type
|
|
293
|
+
*
|
|
294
|
+
* Metadata is static (defined in registry), handlers are injected at runtime (from page.tsx)
|
|
295
|
+
*/
|
|
296
|
+
interface Annotator {
|
|
297
|
+
motivation: Motivation$1;
|
|
298
|
+
internalType: string;
|
|
299
|
+
displayName: string;
|
|
300
|
+
description: string;
|
|
301
|
+
className: string;
|
|
302
|
+
iconEmoji?: string;
|
|
303
|
+
isClickable: boolean;
|
|
304
|
+
hasHoverInteraction: boolean;
|
|
305
|
+
hasSidePanel: boolean;
|
|
306
|
+
matchesAnnotation: (annotation: Annotation$l) => boolean;
|
|
307
|
+
announceOnCreate: string;
|
|
308
|
+
detection?: DetectionConfig;
|
|
309
|
+
handlers?: {
|
|
310
|
+
onClick?: (annotation: Annotation$l) => void;
|
|
311
|
+
onHover?: (annotationId: string | null) => void;
|
|
312
|
+
onDetect?: (...args: any[]) => void | Promise<void>;
|
|
313
|
+
onUpdate?: (annotationId: string, ...args: any[]) => void | Promise<void>;
|
|
314
|
+
onCreate?: (...args: any[]) => void | Promise<void>;
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Registry of all annotators (motivation handlers)
|
|
319
|
+
* Metadata is defined here, handlers are injected at runtime
|
|
320
|
+
*/
|
|
321
|
+
declare const ANNOTATORS: Record<string, Annotator>;
|
|
322
|
+
/**
|
|
323
|
+
* Get annotator for an annotation by checking all registered types
|
|
324
|
+
* Returns null if annotation doesn't match any registered type
|
|
325
|
+
*/
|
|
326
|
+
declare function getAnnotator(annotation: Annotation$l): Annotator | null;
|
|
327
|
+
/**
|
|
328
|
+
* Get CSS className for an annotation
|
|
329
|
+
* Falls back to highlight style if no match found
|
|
330
|
+
*/
|
|
331
|
+
declare function getAnnotationClassName(annotation: Annotation$l): string;
|
|
332
|
+
/**
|
|
333
|
+
* Get internal type string for an annotation (e.g., 'highlight', 'comment')
|
|
334
|
+
* Falls back to 'highlight' if no match found
|
|
335
|
+
*/
|
|
336
|
+
declare function getAnnotationInternalType(annotation: Annotation$l): string;
|
|
337
|
+
/**
|
|
338
|
+
* Group annotations by their internal type
|
|
339
|
+
* Returns a record with keys like 'highlight', 'comment', 'assessment', 'reference'
|
|
340
|
+
* Each value is an array of annotations of that type
|
|
341
|
+
*/
|
|
342
|
+
declare function groupAnnotationsByType(annotations: Annotation$l[]): Record<string, Annotation$l[]>;
|
|
343
|
+
/**
|
|
344
|
+
* Create a copy of annotators with handlers injected
|
|
345
|
+
* Use this in page.tsx to inject runtime handlers into the registry
|
|
346
|
+
*/
|
|
347
|
+
declare function withHandlers(handlers: Record<string, Annotator['handlers']>): Record<string, Annotator>;
|
|
348
|
+
/**
|
|
349
|
+
* Generic detection handler factory
|
|
350
|
+
* Creates a detection handler for any annotator with detection config
|
|
351
|
+
*
|
|
352
|
+
* This eliminates the need for motivation-specific detection handlers
|
|
353
|
+
* (handleDetectHighlights, handleDetectAssessments, etc.)
|
|
354
|
+
*/
|
|
355
|
+
declare function createDetectionHandler(annotator: Annotator, context: {
|
|
356
|
+
client: any;
|
|
357
|
+
rUri: any;
|
|
358
|
+
setDetectingMotivation: (motivation: Motivation$1 | null) => void;
|
|
359
|
+
setMotivationDetectionProgress: (progress: any) => void;
|
|
360
|
+
detectionStreamRef: MutableRefObject<any>;
|
|
361
|
+
cacheManager: CacheManager;
|
|
362
|
+
showSuccess: (message: string) => void;
|
|
363
|
+
showError: (message: string) => void;
|
|
364
|
+
}): (...args: any[]) => Promise<void>;
|
|
365
|
+
/**
|
|
366
|
+
* Generic detection cancellation handler
|
|
367
|
+
* Cancels any active detection stream
|
|
368
|
+
*/
|
|
369
|
+
declare function createCancelDetectionHandler(context: {
|
|
370
|
+
detectionStreamRef: MutableRefObject<any>;
|
|
371
|
+
setDetectingMotivation: (motivation: Motivation$1 | null) => void;
|
|
372
|
+
setMotivationDetectionProgress: (progress: any) => void;
|
|
373
|
+
}): () => void;
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Resource operations
|
|
377
|
+
*/
|
|
378
|
+
declare function useResources(): {
|
|
379
|
+
list: {
|
|
380
|
+
useQuery: (options?: {
|
|
381
|
+
limit?: number;
|
|
382
|
+
archived?: boolean;
|
|
383
|
+
query?: string;
|
|
384
|
+
}) => _tanstack_react_query.UseQueryResult<{
|
|
385
|
+
resources: _semiont_api_client.components["schemas"]["ResourceDescriptor"][];
|
|
386
|
+
total: number;
|
|
387
|
+
offset: number;
|
|
388
|
+
limit: number;
|
|
389
|
+
}, Error>;
|
|
390
|
+
};
|
|
391
|
+
get: {
|
|
392
|
+
useQuery: (rUri: ResourceUri, options?: Omit<UseQueryOptions, "queryKey" | "queryFn">) => _tanstack_react_query.UseQueryResult<unknown, Error>;
|
|
393
|
+
};
|
|
394
|
+
events: {
|
|
395
|
+
useQuery: (rUri: ResourceUri) => _tanstack_react_query.UseQueryResult<{
|
|
396
|
+
events: any[];
|
|
397
|
+
}, Error>;
|
|
398
|
+
};
|
|
399
|
+
annotations: {
|
|
400
|
+
useQuery: (rUri: ResourceUri) => _tanstack_react_query.UseQueryResult<{
|
|
401
|
+
resource: _semiont_api_client.components["schemas"]["ResourceDescriptor"];
|
|
402
|
+
annotations: _semiont_api_client.components["schemas"]["Annotation"][];
|
|
403
|
+
}, Error>;
|
|
404
|
+
};
|
|
405
|
+
referencedBy: {
|
|
406
|
+
useQuery: (rUri: ResourceUri) => _tanstack_react_query.UseQueryResult<{
|
|
407
|
+
referencedBy: any[];
|
|
408
|
+
}, Error>;
|
|
409
|
+
};
|
|
410
|
+
search: {
|
|
411
|
+
useQuery: (query: string, limit: number) => _tanstack_react_query.UseQueryResult<{
|
|
412
|
+
resources: _semiont_api_client.components["schemas"]["ResourceDescriptor"][];
|
|
413
|
+
total: number;
|
|
414
|
+
offset: number;
|
|
415
|
+
limit: number;
|
|
416
|
+
}, Error>;
|
|
417
|
+
};
|
|
418
|
+
create: {
|
|
419
|
+
useMutation: () => _tanstack_react_query.UseMutationResult<{
|
|
420
|
+
resource: _semiont_api_client.components["schemas"]["ResourceDescriptor"];
|
|
421
|
+
annotations: _semiont_api_client.components["schemas"]["Annotation"][];
|
|
422
|
+
}, Error, {
|
|
423
|
+
name: string;
|
|
424
|
+
file: File | Buffer;
|
|
425
|
+
format: string;
|
|
426
|
+
entityTypes?: string[];
|
|
427
|
+
language?: string;
|
|
428
|
+
creationMethod?: string;
|
|
429
|
+
sourceAnnotationId?: string;
|
|
430
|
+
sourceResourceId?: string;
|
|
431
|
+
}, unknown>;
|
|
432
|
+
};
|
|
433
|
+
update: {
|
|
434
|
+
useMutation: () => _tanstack_react_query.UseMutationResult<{
|
|
435
|
+
resource: _semiont_api_client.components["schemas"]["ResourceDescriptor"];
|
|
436
|
+
annotations: _semiont_api_client.components["schemas"]["Annotation"][];
|
|
437
|
+
entityReferences: _semiont_api_client.components["schemas"]["Annotation"][];
|
|
438
|
+
}, Error, {
|
|
439
|
+
rUri: ResourceUri;
|
|
440
|
+
data: Parameters<SemiontApiClient["updateResource"]>[1];
|
|
441
|
+
}, unknown>;
|
|
442
|
+
};
|
|
443
|
+
generateCloneToken: {
|
|
444
|
+
useMutation: () => _tanstack_react_query.UseMutationResult<{
|
|
445
|
+
token: string;
|
|
446
|
+
expiresAt: string;
|
|
447
|
+
resource: _semiont_api_client.components["schemas"]["ResourceDescriptor"];
|
|
448
|
+
}, Error, ResourceUri, unknown>;
|
|
449
|
+
};
|
|
450
|
+
getByToken: {
|
|
451
|
+
useQuery: (token: string) => _tanstack_react_query.UseQueryResult<{
|
|
452
|
+
sourceResource: _semiont_api_client.components["schemas"]["ResourceDescriptor"];
|
|
453
|
+
expiresAt: string;
|
|
454
|
+
}, Error>;
|
|
455
|
+
};
|
|
456
|
+
createFromToken: {
|
|
457
|
+
useMutation: () => _tanstack_react_query.UseMutationResult<{
|
|
458
|
+
resource: _semiont_api_client.components["schemas"]["ResourceDescriptor"];
|
|
459
|
+
annotations: _semiont_api_client.components["schemas"]["Annotation"][];
|
|
460
|
+
}, Error, {
|
|
461
|
+
token: string;
|
|
462
|
+
name: string;
|
|
463
|
+
content: string;
|
|
464
|
+
archiveOriginal?: boolean;
|
|
465
|
+
}, unknown>;
|
|
466
|
+
};
|
|
467
|
+
};
|
|
468
|
+
/**
|
|
469
|
+
* Annotation operations
|
|
470
|
+
*/
|
|
471
|
+
declare function useAnnotations(): {
|
|
472
|
+
get: {
|
|
473
|
+
useQuery: (annotationUri: AnnotationUri) => _tanstack_react_query.UseQueryResult<never, Error>;
|
|
474
|
+
};
|
|
475
|
+
getResourceAnnotation: {
|
|
476
|
+
useQuery: (annotationUri: ResourceAnnotationUri) => _tanstack_react_query.UseQueryResult<{
|
|
477
|
+
annotation: _semiont_api_client.components["schemas"]["Annotation"];
|
|
478
|
+
resource: _semiont_api_client.components["schemas"]["ResourceDescriptor"] | null;
|
|
479
|
+
resolvedResource: _semiont_api_client.components["schemas"]["ResourceDescriptor"] | null;
|
|
480
|
+
}, Error>;
|
|
481
|
+
};
|
|
482
|
+
history: {
|
|
483
|
+
useQuery: (annotationUri: ResourceAnnotationUri) => _tanstack_react_query.UseQueryResult<{
|
|
484
|
+
events: {
|
|
485
|
+
id: string;
|
|
486
|
+
type: string;
|
|
487
|
+
timestamp: string;
|
|
488
|
+
userId: string;
|
|
489
|
+
resourceId: string;
|
|
490
|
+
payload: {
|
|
491
|
+
name: string;
|
|
492
|
+
format: _semiont_api_client.components["schemas"]["ContentFormat"];
|
|
493
|
+
contentChecksum: string;
|
|
494
|
+
creationMethod: "api" | "upload" | "ui" | "reference" | "clone" | "generated";
|
|
495
|
+
entityTypes?: string[];
|
|
496
|
+
metadata?: {
|
|
497
|
+
[key: string]: unknown;
|
|
498
|
+
};
|
|
499
|
+
} | {
|
|
500
|
+
name: string;
|
|
501
|
+
format: _semiont_api_client.components["schemas"]["ContentFormat"];
|
|
502
|
+
contentChecksum: string;
|
|
503
|
+
parentResourceId: string;
|
|
504
|
+
creationMethod: "api" | "upload" | "ui" | "reference" | "clone" | "generated";
|
|
505
|
+
entityTypes?: string[];
|
|
506
|
+
metadata?: {
|
|
507
|
+
[key: string]: unknown;
|
|
508
|
+
};
|
|
509
|
+
} | {
|
|
510
|
+
reason?: string;
|
|
511
|
+
} | Record<string, never> | {
|
|
512
|
+
annotation: _semiont_api_client.components["schemas"]["Annotation"];
|
|
513
|
+
} | {
|
|
514
|
+
annotationId: string;
|
|
515
|
+
} | {
|
|
516
|
+
annotationId: string;
|
|
517
|
+
targetResourceId: string;
|
|
518
|
+
} | {
|
|
519
|
+
entityType: string;
|
|
520
|
+
} | {
|
|
521
|
+
entityType: string;
|
|
522
|
+
};
|
|
523
|
+
metadata: {
|
|
524
|
+
sequenceNumber: number;
|
|
525
|
+
prevEventHash?: string;
|
|
526
|
+
checksum?: string;
|
|
527
|
+
};
|
|
528
|
+
}[];
|
|
529
|
+
total: number;
|
|
530
|
+
annotationId: string;
|
|
531
|
+
resourceId: string;
|
|
532
|
+
}, Error>;
|
|
533
|
+
};
|
|
534
|
+
create: {
|
|
535
|
+
useMutation: () => _tanstack_react_query.UseMutationResult<{
|
|
536
|
+
annotation: _semiont_api_client.components["schemas"]["Annotation"];
|
|
537
|
+
}, Error, {
|
|
538
|
+
rUri: ResourceUri;
|
|
539
|
+
data: Parameters<SemiontApiClient["createAnnotation"]>[1];
|
|
540
|
+
}, unknown>;
|
|
541
|
+
};
|
|
542
|
+
delete: {
|
|
543
|
+
useMutation: () => _tanstack_react_query.UseMutationResult<void, Error, ResourceAnnotationUri, unknown>;
|
|
544
|
+
};
|
|
545
|
+
updateBody: {
|
|
546
|
+
useMutation: () => _tanstack_react_query.UseMutationResult<{
|
|
547
|
+
annotation: _semiont_api_client.components["schemas"]["Annotation"];
|
|
548
|
+
}, Error, {
|
|
549
|
+
annotationUri: ResourceAnnotationUri;
|
|
550
|
+
data: Parameters<SemiontApiClient["updateAnnotationBody"]>[1];
|
|
551
|
+
}, unknown>;
|
|
552
|
+
};
|
|
553
|
+
llmContext: {
|
|
554
|
+
useQuery: (resourceUri: ResourceUri, annotationId: string, options?: {
|
|
555
|
+
contextWindow?: number;
|
|
556
|
+
}) => _tanstack_react_query.UseQueryResult<{
|
|
557
|
+
annotation: _semiont_api_client.components["schemas"]["Annotation"];
|
|
558
|
+
sourceResource: _semiont_api_client.components["schemas"]["ResourceDescriptor"];
|
|
559
|
+
targetResource?: _semiont_api_client.components["schemas"]["ResourceDescriptor"] | null;
|
|
560
|
+
context?: _semiont_api_client.components["schemas"]["GenerationContext"];
|
|
561
|
+
sourceContext?: {
|
|
562
|
+
before: string;
|
|
563
|
+
selected: string;
|
|
564
|
+
after: string;
|
|
565
|
+
};
|
|
566
|
+
targetContext?: {
|
|
567
|
+
content: string;
|
|
568
|
+
summary?: string;
|
|
569
|
+
};
|
|
570
|
+
suggestedResolution?: {
|
|
571
|
+
resourceId: string;
|
|
572
|
+
resourceName: string;
|
|
573
|
+
confidence: number;
|
|
574
|
+
reasoning: string;
|
|
575
|
+
};
|
|
576
|
+
}, Error>;
|
|
577
|
+
};
|
|
578
|
+
};
|
|
579
|
+
/**
|
|
580
|
+
* Entity type operations
|
|
581
|
+
*/
|
|
582
|
+
declare function useEntityTypes(): {
|
|
583
|
+
list: {
|
|
584
|
+
useQuery: (options?: Omit<UseQueryOptions<{
|
|
585
|
+
entityTypes: string[];
|
|
586
|
+
}>, "queryKey" | "queryFn">) => _tanstack_react_query.UseQueryResult<{
|
|
587
|
+
entityTypes: string[];
|
|
588
|
+
}, Error>;
|
|
589
|
+
};
|
|
590
|
+
add: {
|
|
591
|
+
useMutation: () => _tanstack_react_query.UseMutationResult<{
|
|
592
|
+
success: boolean;
|
|
593
|
+
entityTypes: string[];
|
|
594
|
+
}, Error, string, unknown>;
|
|
595
|
+
};
|
|
596
|
+
addBulk: {
|
|
597
|
+
useMutation: () => _tanstack_react_query.UseMutationResult<{
|
|
598
|
+
success: boolean;
|
|
599
|
+
entityTypes: string[];
|
|
600
|
+
}, Error, string[], unknown>;
|
|
601
|
+
};
|
|
602
|
+
};
|
|
603
|
+
/**
|
|
604
|
+
* Admin operations
|
|
605
|
+
*/
|
|
606
|
+
declare function useAdmin(): {
|
|
607
|
+
users: {
|
|
608
|
+
list: {
|
|
609
|
+
useQuery: () => _tanstack_react_query.UseQueryResult<{
|
|
610
|
+
success: boolean;
|
|
611
|
+
users: {
|
|
612
|
+
id: string;
|
|
613
|
+
email: string;
|
|
614
|
+
name: string | null;
|
|
615
|
+
image: string | null;
|
|
616
|
+
domain: string;
|
|
617
|
+
provider: string;
|
|
618
|
+
isAdmin: boolean;
|
|
619
|
+
isActive: boolean;
|
|
620
|
+
lastLogin: string | null;
|
|
621
|
+
created: string;
|
|
622
|
+
updatedAt: string;
|
|
623
|
+
}[];
|
|
624
|
+
}, Error>;
|
|
625
|
+
};
|
|
626
|
+
stats: {
|
|
627
|
+
useQuery: () => _tanstack_react_query.UseQueryResult<{
|
|
628
|
+
success: boolean;
|
|
629
|
+
stats: {
|
|
630
|
+
totalUsers: number;
|
|
631
|
+
activeUsers: number;
|
|
632
|
+
adminUsers: number;
|
|
633
|
+
regularUsers: number;
|
|
634
|
+
domainBreakdown: {
|
|
635
|
+
domain: string;
|
|
636
|
+
count: number;
|
|
637
|
+
}[];
|
|
638
|
+
recentSignups: {
|
|
639
|
+
id: string;
|
|
640
|
+
email: string;
|
|
641
|
+
name: string | null;
|
|
642
|
+
created: string;
|
|
643
|
+
}[];
|
|
644
|
+
};
|
|
645
|
+
}, Error>;
|
|
646
|
+
};
|
|
647
|
+
update: {
|
|
648
|
+
useMutation: () => _tanstack_react_query.UseMutationResult<{
|
|
649
|
+
success: boolean;
|
|
650
|
+
user: {
|
|
651
|
+
id: string;
|
|
652
|
+
email: string;
|
|
653
|
+
name: string | null;
|
|
654
|
+
image: string | null;
|
|
655
|
+
domain: string;
|
|
656
|
+
provider: string;
|
|
657
|
+
isAdmin: boolean;
|
|
658
|
+
isActive: boolean;
|
|
659
|
+
lastLogin: string | null;
|
|
660
|
+
created: string;
|
|
661
|
+
updatedAt: string;
|
|
662
|
+
};
|
|
663
|
+
}, Error, {
|
|
664
|
+
id: string;
|
|
665
|
+
data: Parameters<SemiontApiClient["updateUser"]>[1];
|
|
666
|
+
}, unknown>;
|
|
667
|
+
};
|
|
668
|
+
};
|
|
669
|
+
oauth: {
|
|
670
|
+
config: {
|
|
671
|
+
useQuery: () => _tanstack_react_query.UseQueryResult<{
|
|
672
|
+
providers: {
|
|
673
|
+
name: string;
|
|
674
|
+
isConfigured: boolean;
|
|
675
|
+
clientId: string;
|
|
676
|
+
}[];
|
|
677
|
+
allowedDomains: string[];
|
|
678
|
+
}, Error>;
|
|
679
|
+
};
|
|
680
|
+
};
|
|
681
|
+
};
|
|
682
|
+
/**
|
|
683
|
+
* Authentication and user operations via API
|
|
684
|
+
*/
|
|
685
|
+
declare function useAuthApi(): {
|
|
686
|
+
me: {
|
|
687
|
+
useQuery: () => _tanstack_react_query.UseQueryResult<{
|
|
688
|
+
id: string;
|
|
689
|
+
email: string;
|
|
690
|
+
name: string | null;
|
|
691
|
+
image: string | null;
|
|
692
|
+
domain: string;
|
|
693
|
+
provider: string;
|
|
694
|
+
isAdmin: boolean;
|
|
695
|
+
isActive: boolean;
|
|
696
|
+
termsAcceptedAt: string | null;
|
|
697
|
+
lastLogin: string | null;
|
|
698
|
+
created: string;
|
|
699
|
+
}, Error>;
|
|
700
|
+
};
|
|
701
|
+
acceptTerms: {
|
|
702
|
+
useMutation: () => _tanstack_react_query.UseMutationResult<{
|
|
703
|
+
success: boolean;
|
|
704
|
+
message: string;
|
|
705
|
+
}, Error, void, unknown>;
|
|
706
|
+
};
|
|
707
|
+
generateMCPToken: {
|
|
708
|
+
useMutation: () => _tanstack_react_query.UseMutationResult<{
|
|
709
|
+
refresh_token: string;
|
|
710
|
+
}, Error, void, unknown>;
|
|
711
|
+
};
|
|
712
|
+
logout: {
|
|
713
|
+
useMutation: () => _tanstack_react_query.UseMutationResult<{
|
|
714
|
+
success: boolean;
|
|
715
|
+
message: string;
|
|
716
|
+
}, Error, void, unknown>;
|
|
717
|
+
};
|
|
718
|
+
};
|
|
719
|
+
/**
|
|
720
|
+
* Health check and system status
|
|
721
|
+
*/
|
|
722
|
+
declare function useHealth(): {
|
|
723
|
+
check: {
|
|
724
|
+
useQuery: () => _tanstack_react_query.UseQueryResult<{
|
|
725
|
+
status: string;
|
|
726
|
+
message: string;
|
|
727
|
+
version: string;
|
|
728
|
+
timestamp: string;
|
|
729
|
+
database: "connected" | "disconnected" | "unknown";
|
|
730
|
+
environment: string;
|
|
731
|
+
}, Error>;
|
|
732
|
+
};
|
|
733
|
+
status: {
|
|
734
|
+
useQuery: (refetchInterval?: number) => _tanstack_react_query.UseQueryResult<{
|
|
735
|
+
status: string;
|
|
736
|
+
version: string;
|
|
737
|
+
features: {
|
|
738
|
+
semanticContent: string;
|
|
739
|
+
collaboration: string;
|
|
740
|
+
rbac: string;
|
|
741
|
+
};
|
|
742
|
+
message: string;
|
|
743
|
+
authenticatedAs?: string;
|
|
744
|
+
}, Error>;
|
|
745
|
+
};
|
|
746
|
+
};
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* Global authentication event system for coordinating auth state across components
|
|
750
|
+
*/
|
|
751
|
+
declare const AUTH_EVENTS: {
|
|
752
|
+
readonly UNAUTHORIZED: "auth:unauthorized";
|
|
753
|
+
readonly FORBIDDEN: "auth:forbidden";
|
|
754
|
+
readonly SESSION_EXPIRED: "auth:session-expired";
|
|
755
|
+
};
|
|
756
|
+
type AuthEventType = typeof AUTH_EVENTS[keyof typeof AUTH_EVENTS];
|
|
757
|
+
interface AuthEventDetail {
|
|
758
|
+
message?: string;
|
|
759
|
+
statusCode?: number;
|
|
760
|
+
timestamp: number;
|
|
761
|
+
}
|
|
762
|
+
/**
|
|
763
|
+
* Dispatch an authentication event
|
|
764
|
+
*/
|
|
765
|
+
declare function dispatchAuthEvent(type: AuthEventType, detail?: Partial<AuthEventDetail>): void;
|
|
766
|
+
/**
|
|
767
|
+
* Listen for authentication events
|
|
768
|
+
*/
|
|
769
|
+
declare function onAuthEvent(type: AuthEventType, handler: (event: CustomEvent<AuthEventDetail>) => void): () => void;
|
|
770
|
+
/**
|
|
771
|
+
* Dispatch a 401 Unauthorized event
|
|
772
|
+
*/
|
|
773
|
+
declare function dispatch401Error(message?: string): void;
|
|
774
|
+
/**
|
|
775
|
+
* Dispatch a 403 Forbidden event
|
|
776
|
+
*/
|
|
777
|
+
declare function dispatch403Error(message?: string): void;
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* Centralized button styles matching Figma design
|
|
781
|
+
* Two primary styles from authenticated home page:
|
|
782
|
+
* 1. Primary (cyan/blue gradient) - for main CTAs
|
|
783
|
+
* 2. Secondary (gray with black outline) - for secondary actions
|
|
784
|
+
*/
|
|
785
|
+
declare const buttonStyles: {
|
|
786
|
+
readonly primary: {
|
|
787
|
+
readonly base: "px-6 py-2 bg-gradient-to-r from-cyan-500/20 to-blue-500/20 hover:from-cyan-600 hover:to-blue-600 dark:from-cyan-600/20 dark:to-blue-600/20 dark:hover:from-cyan-500 dark:hover:to-blue-500 text-cyan-700 hover:text-white dark:text-cyan-400 dark:hover:text-white border border-cyan-400/30 hover:border-cyan-600 dark:border-cyan-500/30 dark:hover:border-cyan-400 rounded-lg transition-all duration-300 backdrop-blur-sm disabled:opacity-50 disabled:cursor-not-allowed";
|
|
788
|
+
readonly large: "w-full py-3 bg-gradient-to-r from-cyan-500/20 to-blue-500/20 hover:from-cyan-600 hover:to-blue-600 dark:from-cyan-600/20 dark:to-blue-600/20 dark:hover:from-cyan-500 dark:hover:to-blue-500 text-cyan-700 hover:text-white dark:text-cyan-400 dark:hover:text-white border border-cyan-400/30 hover:border-cyan-600 dark:border-cyan-500/30 dark:hover:border-cyan-400 rounded-lg transition-all duration-300 transform hover:scale-[1.02] font-medium flex items-center justify-center gap-2 backdrop-blur-sm disabled:opacity-50 disabled:cursor-not-allowed";
|
|
789
|
+
};
|
|
790
|
+
readonly secondary: {
|
|
791
|
+
readonly base: "px-6 py-2 bg-black/10 hover:bg-black/20 dark:bg-white/10 dark:hover:bg-white/20 border border-black/20 dark:border-white/20 text-gray-900 dark:text-white rounded-lg disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-300";
|
|
792
|
+
readonly withScale: "px-6 py-2 bg-black/10 hover:bg-black/20 dark:bg-white/10 dark:hover:bg-white/20 border border-black/20 dark:border-white/20 text-gray-900 dark:text-white rounded-lg disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-300 transform hover:scale-105";
|
|
793
|
+
};
|
|
794
|
+
readonly tertiary: {
|
|
795
|
+
readonly base: "px-4 py-2 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors";
|
|
796
|
+
};
|
|
797
|
+
readonly danger: {
|
|
798
|
+
readonly base: "px-6 py-2 text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg transition-all duration-300";
|
|
799
|
+
};
|
|
800
|
+
readonly warning: {
|
|
801
|
+
readonly base: "px-6 py-2 bg-yellow-400/20 hover:bg-yellow-400/30 dark:bg-yellow-500/20 dark:hover:bg-yellow-500/30 text-yellow-800 hover:text-yellow-900 dark:text-yellow-300 dark:hover:text-yellow-200 border border-yellow-400/30 hover:border-yellow-500 dark:border-yellow-500/30 dark:hover:border-yellow-400 rounded-lg transition-all duration-300 backdrop-blur-sm";
|
|
802
|
+
};
|
|
803
|
+
readonly combine: (...classes: string[]) => string;
|
|
804
|
+
};
|
|
805
|
+
|
|
806
|
+
declare const jsonLightTheme: _codemirror_state.Extension;
|
|
807
|
+
declare const jsonLightHighlightStyle: HighlightStyle;
|
|
808
|
+
|
|
809
|
+
/**
|
|
810
|
+
* CodeMirror Inline Widgets
|
|
811
|
+
*
|
|
812
|
+
* Custom widgets for enhancing the document editing experience:
|
|
813
|
+
* - Wiki link pills (clickable, styled)
|
|
814
|
+
* - Reference previews (hover for context)
|
|
815
|
+
* - Entity type badges
|
|
816
|
+
*/
|
|
817
|
+
|
|
818
|
+
type Annotation$k = components['schemas']['Annotation'];
|
|
819
|
+
/**
|
|
820
|
+
* Reference Resolution Widget
|
|
821
|
+
* Shows a small indicator next to references with hover preview
|
|
822
|
+
*/
|
|
823
|
+
declare class ReferenceResolutionWidget extends WidgetType {
|
|
824
|
+
readonly annotation: Annotation$k;
|
|
825
|
+
readonly targetDocumentName?: string | undefined;
|
|
826
|
+
readonly onNavigate?: ((documentId: string) => void) | undefined;
|
|
827
|
+
readonly onUnresolvedClick?: ((annotation: Annotation$k) => void) | undefined;
|
|
828
|
+
readonly isGenerating?: boolean | undefined;
|
|
829
|
+
constructor(annotation: Annotation$k, targetDocumentName?: string | undefined, onNavigate?: ((documentId: string) => void) | undefined, onUnresolvedClick?: ((annotation: Annotation$k) => void) | undefined, isGenerating?: boolean | undefined);
|
|
830
|
+
eq(other: ReferenceResolutionWidget): boolean;
|
|
831
|
+
toDOM(): HTMLSpanElement;
|
|
832
|
+
private showPreview;
|
|
833
|
+
private hidePreview;
|
|
834
|
+
ignoreEvent(event: Event): boolean;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* Centralized query keys for React Query
|
|
839
|
+
* Following TanStack Query best practices for type-safe cache invalidation
|
|
840
|
+
* @see https://tanstack.com/query/latest/docs/framework/react/guides/query-keys
|
|
841
|
+
*
|
|
842
|
+
* Keys use semantic names (not URL paths) and are properly typed with 'as const'
|
|
843
|
+
*/
|
|
844
|
+
|
|
845
|
+
declare const QUERY_KEYS: {
|
|
846
|
+
users: {
|
|
847
|
+
me: () => readonly ["users", "me"];
|
|
848
|
+
};
|
|
849
|
+
health: () => readonly ["health"];
|
|
850
|
+
status: () => readonly ["status"];
|
|
851
|
+
resources: {
|
|
852
|
+
all: (limit?: number, archived?: boolean) => readonly ["resources", {
|
|
853
|
+
readonly limit: number | undefined;
|
|
854
|
+
readonly archived: boolean | undefined;
|
|
855
|
+
}];
|
|
856
|
+
detail: (rUri: ResourceUri) => readonly ["resources", ResourceUri];
|
|
857
|
+
byToken: (token: string) => readonly ["resources", "by-token", string];
|
|
858
|
+
search: (query: string, limit: number) => readonly ["resources", "search", {
|
|
859
|
+
readonly query: string;
|
|
860
|
+
readonly limit: number;
|
|
861
|
+
}];
|
|
862
|
+
events: (rUri: ResourceUri) => readonly ["resources", ResourceUri, "events"];
|
|
863
|
+
annotations: (rUri: ResourceUri) => readonly ["resources", ResourceUri, "annotations"];
|
|
864
|
+
referencedBy: (rUri: ResourceUri) => readonly ["resources", ResourceUri, "referenced-by"];
|
|
865
|
+
};
|
|
866
|
+
annotations: {
|
|
867
|
+
detail: (aUri: AnnotationUri) => readonly ["annotations", AnnotationUri];
|
|
868
|
+
history: (aUri: ResourceAnnotationUri) => readonly ["annotations", ResourceAnnotationUri, "history"];
|
|
869
|
+
llmContext: (resourceUri: ResourceUri, annotationId: string) => readonly ["annotations", "llm-context", ResourceUri, string];
|
|
870
|
+
};
|
|
871
|
+
entityTypes: {
|
|
872
|
+
all: () => readonly ["entity-types"];
|
|
873
|
+
};
|
|
874
|
+
admin: {
|
|
875
|
+
users: {
|
|
876
|
+
all: () => readonly ["admin", "users"];
|
|
877
|
+
stats: () => readonly ["admin", "users", "stats"];
|
|
878
|
+
};
|
|
879
|
+
oauth: {
|
|
880
|
+
config: () => readonly ["admin", "oauth", "config"];
|
|
881
|
+
};
|
|
882
|
+
};
|
|
883
|
+
documents: {
|
|
884
|
+
all: (limit?: number, archived?: boolean) => readonly ["resources", {
|
|
885
|
+
readonly limit: number | undefined;
|
|
886
|
+
readonly archived: boolean | undefined;
|
|
887
|
+
}];
|
|
888
|
+
detail: (rUri: ResourceUri) => readonly ["resources", ResourceUri];
|
|
889
|
+
byToken: (token: string) => readonly ["resources", "by-token", string];
|
|
890
|
+
search: (query: string, limit: number) => readonly ["resources", "search", {
|
|
891
|
+
readonly query: string;
|
|
892
|
+
readonly limit: number;
|
|
893
|
+
}];
|
|
894
|
+
events: (rUri: ResourceUri) => readonly ["resources", ResourceUri, "events"];
|
|
895
|
+
annotations: (rUri: ResourceUri) => readonly ["resources", ResourceUri, "annotations"];
|
|
896
|
+
referencedBy: (rUri: ResourceUri) => readonly ["resources", ResourceUri, "referenced-by"];
|
|
897
|
+
};
|
|
898
|
+
};
|
|
899
|
+
|
|
900
|
+
declare function rehypeRenderAnnotations(): (tree: Root, file: any) => void;
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* Simplified annotation format for remark plugin.
|
|
904
|
+
* This is NOT the W3C Annotation - it's a pre-processed format with offset/length
|
|
905
|
+
* for efficient markdown text processing.
|
|
906
|
+
*/
|
|
907
|
+
interface PreparedAnnotation {
|
|
908
|
+
id: string;
|
|
909
|
+
exact: string;
|
|
910
|
+
offset: number;
|
|
911
|
+
length: number;
|
|
912
|
+
type: string;
|
|
913
|
+
source: string | null;
|
|
914
|
+
}
|
|
915
|
+
interface RemarkAnnotationsOptions {
|
|
916
|
+
annotations: PreparedAnnotation[];
|
|
917
|
+
}
|
|
918
|
+
declare function remarkAnnotations(options: RemarkAnnotationsOptions): (tree: Root$1, file: VFile) => void;
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* Resource utilities
|
|
922
|
+
* Shared helper functions for resource display and metadata
|
|
923
|
+
*/
|
|
924
|
+
/**
|
|
925
|
+
* Get icon emoji based on media type
|
|
926
|
+
*/
|
|
927
|
+
declare function getResourceIcon(mediaType: string | undefined): string;
|
|
928
|
+
/**
|
|
929
|
+
* Check if a resource supports text-based AI detection features
|
|
930
|
+
*
|
|
931
|
+
* Currently returns true for any text/* media type.
|
|
932
|
+
* Future enhancements may include:
|
|
933
|
+
* - Checking resource language/locale compatibility
|
|
934
|
+
* - Validating content size limits
|
|
935
|
+
* - Checking for specific text format requirements
|
|
936
|
+
*
|
|
937
|
+
* @param mediaType - The media type string (e.g., 'text/plain', 'text/markdown')
|
|
938
|
+
* @returns true if the resource supports AI detection features
|
|
939
|
+
*/
|
|
940
|
+
declare function supportsDetection(mediaType: string | undefined): boolean;
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* Frontend-specific validation utilities
|
|
944
|
+
*
|
|
945
|
+
* Browser and Next.js specific validation with security checks.
|
|
946
|
+
* For generic validation utilities, see @semiont/api-client/utils/validation
|
|
947
|
+
*/
|
|
948
|
+
|
|
949
|
+
/**
|
|
950
|
+
* Image URL validation with security checks (browser-specific)
|
|
951
|
+
*
|
|
952
|
+
* Validates image URLs for use in browser environments with XSS prevention.
|
|
953
|
+
* Only allows HTTPS for external images, blocks suspicious patterns.
|
|
954
|
+
*/
|
|
955
|
+
declare const ImageURLSchema: {
|
|
956
|
+
parse(url: unknown): string;
|
|
957
|
+
safeParse(url: unknown): ValidationResult<string>;
|
|
958
|
+
};
|
|
959
|
+
/**
|
|
960
|
+
* OAuth user validation (Next.js NextAuth specific)
|
|
961
|
+
*
|
|
962
|
+
* Validates user objects returned from OAuth providers.
|
|
963
|
+
* Includes domain validation for access control.
|
|
964
|
+
*/
|
|
965
|
+
interface OAuthUser {
|
|
966
|
+
id: string;
|
|
967
|
+
email: string;
|
|
968
|
+
name?: string | null;
|
|
969
|
+
image?: string | null;
|
|
970
|
+
domain: string;
|
|
971
|
+
isAdmin: boolean;
|
|
972
|
+
isModerator: boolean;
|
|
973
|
+
}
|
|
974
|
+
declare const OAuthUserSchema: {
|
|
975
|
+
parse(data: unknown): OAuthUser;
|
|
976
|
+
safeParse(data: unknown): ValidationResult<OAuthUser>;
|
|
977
|
+
};
|
|
978
|
+
/**
|
|
979
|
+
* URL sanitization for images (browser-specific security)
|
|
980
|
+
*
|
|
981
|
+
* Sanitizes image URLs by validating and reconstructing with only safe parts.
|
|
982
|
+
* Returns null if validation fails.
|
|
983
|
+
*
|
|
984
|
+
* @param url - Image URL to sanitize
|
|
985
|
+
* @returns Sanitized URL or null if invalid
|
|
986
|
+
*/
|
|
987
|
+
declare function sanitizeImageURL(url: string): string | null;
|
|
988
|
+
|
|
989
|
+
type Annotation$j = components['schemas']['Annotation'];
|
|
990
|
+
/**
|
|
991
|
+
* Shared logic for annotation panel components
|
|
992
|
+
*
|
|
993
|
+
* Handles:
|
|
994
|
+
* - Sorting annotations by position in the resource
|
|
995
|
+
* - Hover effects: scroll to annotation and pulse highlight
|
|
996
|
+
* - Ref management for annotation elements
|
|
997
|
+
*
|
|
998
|
+
* Used by: HighlightPanel, AssessmentPanel, CommentsPanel, ReferencesPanel
|
|
999
|
+
*/
|
|
1000
|
+
declare function useAnnotationPanel<T extends Annotation$j>(annotations: T[], hoveredId: string | null | undefined): {
|
|
1001
|
+
sortedAnnotations: T[];
|
|
1002
|
+
containerRef: React$1.RefObject<HTMLDivElement>;
|
|
1003
|
+
handleAnnotationRef: (id: string, el: HTMLElement | null) => void;
|
|
1004
|
+
};
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* Creates a debounced version of a callback function
|
|
1008
|
+
*
|
|
1009
|
+
* @param callback - The function to debounce
|
|
1010
|
+
* @param delay - Debounce delay in milliseconds
|
|
1011
|
+
* @returns Debounced function
|
|
1012
|
+
*
|
|
1013
|
+
* @example
|
|
1014
|
+
* const debouncedSearch = useDebouncedCallback(
|
|
1015
|
+
* (query) => performSearch(query),
|
|
1016
|
+
* 500
|
|
1017
|
+
* );
|
|
1018
|
+
*/
|
|
1019
|
+
declare function useDebouncedCallback<T extends (...args: any[]) => any>(callback: T, delay: number): (...args: Parameters<T>) => void;
|
|
1020
|
+
/**
|
|
1021
|
+
* useDebounce Hook
|
|
1022
|
+
*
|
|
1023
|
+
* Custom hook for debouncing values (e.g., search input).
|
|
1024
|
+
* Returns a debounced value that updates after the specified delay.
|
|
1025
|
+
*
|
|
1026
|
+
* @param value - The value to debounce
|
|
1027
|
+
* @param delay - Debounce delay in milliseconds
|
|
1028
|
+
* @returns Debounced value
|
|
1029
|
+
*
|
|
1030
|
+
* @example
|
|
1031
|
+
* const debouncedQuery = useDebounce(searchQuery, 500);
|
|
1032
|
+
*/
|
|
1033
|
+
declare function useDebounce<T>(value: T, delay: number): T;
|
|
1034
|
+
|
|
1035
|
+
interface DetectionProgress extends DetectionProgress$1 {
|
|
1036
|
+
completedEntityTypes?: Array<{
|
|
1037
|
+
entityType: string;
|
|
1038
|
+
foundCount: number;
|
|
1039
|
+
}>;
|
|
1040
|
+
}
|
|
1041
|
+
interface UseDetectionProgressOptions {
|
|
1042
|
+
rUri: ResourceUri;
|
|
1043
|
+
onComplete?: (progress: DetectionProgress) => void;
|
|
1044
|
+
onError?: (error: string) => void;
|
|
1045
|
+
onProgress?: (progress: DetectionProgress) => void;
|
|
1046
|
+
}
|
|
1047
|
+
declare function useDetectionProgress({ rUri, onComplete, onError, onProgress }: UseDetectionProgressOptions): {
|
|
1048
|
+
isDetecting: boolean;
|
|
1049
|
+
progress: DetectionProgress | null;
|
|
1050
|
+
startDetection: (entityTypes: string[]) => Promise<void>;
|
|
1051
|
+
cancelDetection: () => void;
|
|
1052
|
+
};
|
|
1053
|
+
|
|
1054
|
+
declare function useFormattedTime(milliseconds: number | null): string | null;
|
|
1055
|
+
|
|
1056
|
+
interface UseFormValidationOptions {
|
|
1057
|
+
announceErrors?: boolean;
|
|
1058
|
+
}
|
|
1059
|
+
declare function useFormValidation(options?: UseFormValidationOptions): {
|
|
1060
|
+
errors: Record<string, string>;
|
|
1061
|
+
setFieldError: (field: string, message: string) => void;
|
|
1062
|
+
clearFieldError: (field: string) => void;
|
|
1063
|
+
clearAllErrors: () => void;
|
|
1064
|
+
validateField: (field: string, value: any, rules: Record<string, (value: any) => string | null>) => boolean;
|
|
1065
|
+
announceSuccess: (message: string) => void;
|
|
1066
|
+
getFieldError: (field: string) => string | null;
|
|
1067
|
+
hasErrors: () => boolean;
|
|
1068
|
+
};
|
|
1069
|
+
declare const validationRules: {
|
|
1070
|
+
required: (message?: string) => (value: any) => string | null;
|
|
1071
|
+
minLength: (min: number, message?: string) => (value: string) => string | null;
|
|
1072
|
+
maxLength: (max: number, message?: string) => (value: string) => string | null;
|
|
1073
|
+
email: (message?: string) => (value: string) => string | null;
|
|
1074
|
+
url: (message?: string) => (value: string) => string | null;
|
|
1075
|
+
pattern: (regex: RegExp, message: string) => (value: string) => string | null;
|
|
1076
|
+
};
|
|
1077
|
+
|
|
1078
|
+
type GenerationProgress = GenerationProgress$1;
|
|
1079
|
+
interface UseGenerationProgressOptions {
|
|
1080
|
+
onComplete?: (progress: GenerationProgress) => void;
|
|
1081
|
+
onError?: (error: string) => void;
|
|
1082
|
+
onProgress?: (progress: GenerationProgress) => void;
|
|
1083
|
+
}
|
|
1084
|
+
declare function useGenerationProgress({ onComplete, onError, onProgress }: UseGenerationProgressOptions): {
|
|
1085
|
+
isGenerating: boolean;
|
|
1086
|
+
progress: GenerationProgress$1 | null;
|
|
1087
|
+
startGeneration: (referenceId: AnnotationUri, resourceId: ResourceUri, options: {
|
|
1088
|
+
title?: string;
|
|
1089
|
+
prompt?: string;
|
|
1090
|
+
language?: string;
|
|
1091
|
+
context: GenerationContext;
|
|
1092
|
+
temperature?: number;
|
|
1093
|
+
maxTokens?: number;
|
|
1094
|
+
}) => Promise<void>;
|
|
1095
|
+
cancelGeneration: () => void;
|
|
1096
|
+
clearProgress: () => void;
|
|
1097
|
+
};
|
|
1098
|
+
|
|
1099
|
+
interface KeyboardShortcut {
|
|
1100
|
+
key: string;
|
|
1101
|
+
ctrlOrCmd?: boolean;
|
|
1102
|
+
shift?: boolean;
|
|
1103
|
+
alt?: boolean;
|
|
1104
|
+
handler: (event: KeyboardEvent) => void;
|
|
1105
|
+
description?: string;
|
|
1106
|
+
enabled?: boolean;
|
|
1107
|
+
}
|
|
1108
|
+
/**
|
|
1109
|
+
* Hook for managing keyboard shortcuts
|
|
1110
|
+
* Handles platform differences (Cmd on Mac, Ctrl on Windows/Linux)
|
|
1111
|
+
* Prevents conflicts with browser shortcuts
|
|
1112
|
+
*/
|
|
1113
|
+
declare function useKeyboardShortcuts(shortcuts: KeyboardShortcut[]): void;
|
|
1114
|
+
/**
|
|
1115
|
+
* Hook for double key press detection (e.g., double Escape)
|
|
1116
|
+
*/
|
|
1117
|
+
declare function useDoubleKeyPress(key: string, handler: () => void, timeout?: number): void;
|
|
1118
|
+
/**
|
|
1119
|
+
* Get keyboard shortcut display text based on platform
|
|
1120
|
+
*/
|
|
1121
|
+
declare function getShortcutDisplay(shortcut: KeyboardShortcut): string;
|
|
1122
|
+
/**
|
|
1123
|
+
* Hook to check if user is currently typing in an input field
|
|
1124
|
+
* Keyboard shortcuts should generally be disabled when typing
|
|
1125
|
+
*/
|
|
1126
|
+
declare function useIsTyping(): boolean;
|
|
1127
|
+
|
|
1128
|
+
/**
|
|
1129
|
+
* Hook to manage line numbers display setting with localStorage persistence
|
|
1130
|
+
*/
|
|
1131
|
+
declare function useLineNumbers(): {
|
|
1132
|
+
showLineNumbers: boolean;
|
|
1133
|
+
toggleLineNumbers: () => void;
|
|
1134
|
+
};
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* Resource event structure from the event store
|
|
1138
|
+
* (Re-exported from api-client for consistency)
|
|
1139
|
+
*/
|
|
1140
|
+
type ResourceEvent = ResourceEvent$1;
|
|
1141
|
+
/**
|
|
1142
|
+
* Stream connection status
|
|
1143
|
+
*/
|
|
1144
|
+
type StreamStatus = 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
1145
|
+
interface UseResourceEventsOptions {
|
|
1146
|
+
rUri: ResourceUri;
|
|
1147
|
+
onEvent?: (event: ResourceEvent) => void;
|
|
1148
|
+
onAnnotationAdded?: (event: ResourceEvent) => void;
|
|
1149
|
+
onAnnotationRemoved?: (event: ResourceEvent) => void;
|
|
1150
|
+
onAnnotationBodyUpdated?: (event: ResourceEvent) => void;
|
|
1151
|
+
onEntityTagAdded?: (event: ResourceEvent) => void;
|
|
1152
|
+
onEntityTagRemoved?: (event: ResourceEvent) => void;
|
|
1153
|
+
onDocumentArchived?: (event: ResourceEvent) => void;
|
|
1154
|
+
onDocumentUnarchived?: (event: ResourceEvent) => void;
|
|
1155
|
+
onError?: (error: string) => void;
|
|
1156
|
+
autoConnect?: boolean;
|
|
1157
|
+
}
|
|
1158
|
+
/**
|
|
1159
|
+
* React hook for subscribing to real-time document events via SSE
|
|
1160
|
+
*
|
|
1161
|
+
* Opens a long-lived SSE connection to receive events as they happen.
|
|
1162
|
+
* Automatically reconnects on disconnect (with exponential backoff).
|
|
1163
|
+
*
|
|
1164
|
+
* @example
|
|
1165
|
+
* ```tsx
|
|
1166
|
+
* const { status, connect, disconnect } = useResourceEvents({
|
|
1167
|
+
* rUri: resourceUri('http://localhost:4000/resources/doc-123'),
|
|
1168
|
+
* onAnnotationAdded: (event) => {
|
|
1169
|
+
* console.log('New annotation:', event.payload);
|
|
1170
|
+
* // Update UI to show new annotation (highlight, reference, or assessment)
|
|
1171
|
+
* },
|
|
1172
|
+
* onAnnotationBodyUpdated: (event) => {
|
|
1173
|
+
* console.log('Annotation body updated:', event.payload);
|
|
1174
|
+
* // Update annotation display to reflect body changes
|
|
1175
|
+
* }
|
|
1176
|
+
* });
|
|
1177
|
+
* ```
|
|
1178
|
+
*/
|
|
1179
|
+
declare function useResourceEvents({ rUri, onEvent, onAnnotationAdded, onAnnotationRemoved, onAnnotationBodyUpdated, onEntityTagAdded, onEntityTagRemoved, onDocumentArchived, onDocumentUnarchived, onError, autoConnect, }: UseResourceEventsOptions): {
|
|
1180
|
+
status: StreamStatus;
|
|
1181
|
+
lastEvent: ResourceEvent$1 | null;
|
|
1182
|
+
eventCount: number;
|
|
1183
|
+
connect: () => Promise<void>;
|
|
1184
|
+
disconnect: () => void;
|
|
1185
|
+
isConnected: boolean;
|
|
1186
|
+
};
|
|
1187
|
+
|
|
1188
|
+
interface UseRovingTabIndexOptions {
|
|
1189
|
+
orientation?: 'horizontal' | 'vertical' | 'grid';
|
|
1190
|
+
loop?: boolean;
|
|
1191
|
+
cols?: number;
|
|
1192
|
+
}
|
|
1193
|
+
declare function useRovingTabIndex<T extends HTMLElement>(itemCount: number, options?: UseRovingTabIndexOptions): {
|
|
1194
|
+
containerRef: React$1.RefObject<T>;
|
|
1195
|
+
handleKeyDown: (event: KeyboardEvent$1) => void;
|
|
1196
|
+
focusItem: (index: number) => void;
|
|
1197
|
+
};
|
|
1198
|
+
|
|
1199
|
+
declare function useSessionExpiry(): {
|
|
1200
|
+
timeRemaining: number | null;
|
|
1201
|
+
isExpiringSoon: boolean;
|
|
1202
|
+
};
|
|
1203
|
+
|
|
1204
|
+
type Theme = 'light' | 'dark' | 'system';
|
|
1205
|
+
declare function useTheme(): {
|
|
1206
|
+
theme: Theme;
|
|
1207
|
+
setTheme: (newTheme: Theme) => void;
|
|
1208
|
+
};
|
|
1209
|
+
|
|
1210
|
+
type ToolbarPanelType = 'document' | 'history' | 'info' | 'annotations' | 'settings' | 'collaboration' | 'user' | 'jsonld';
|
|
1211
|
+
interface UseToolbarOptions {
|
|
1212
|
+
/** Initial panel to show (default: null) */
|
|
1213
|
+
initialPanel?: ToolbarPanelType | null;
|
|
1214
|
+
/** Whether to persist active panel to localStorage (default: false) */
|
|
1215
|
+
persistToStorage?: boolean;
|
|
1216
|
+
/** Storage key for persistence (default: 'activeToolbarPanel') */
|
|
1217
|
+
storageKey?: string;
|
|
1218
|
+
}
|
|
1219
|
+
declare function useToolbar(options?: UseToolbarOptions): {
|
|
1220
|
+
activePanel: ToolbarPanelType | null;
|
|
1221
|
+
togglePanel: (panel: ToolbarPanelType) => void;
|
|
1222
|
+
setActivePanel: React$1.Dispatch<React$1.SetStateAction<ToolbarPanelType | null>>;
|
|
1223
|
+
};
|
|
1224
|
+
|
|
1225
|
+
/**
|
|
1226
|
+
* Hook for managing dropdown/menu visibility with click outside handling
|
|
1227
|
+
*/
|
|
1228
|
+
declare function useDropdown(): {
|
|
1229
|
+
isOpen: boolean;
|
|
1230
|
+
toggle: () => void;
|
|
1231
|
+
open: () => void;
|
|
1232
|
+
close: () => void;
|
|
1233
|
+
dropdownRef: React$1.RefObject<HTMLDivElement>;
|
|
1234
|
+
};
|
|
1235
|
+
/**
|
|
1236
|
+
* Hook for managing loading states with minimum display time
|
|
1237
|
+
*/
|
|
1238
|
+
declare function useLoadingState(minLoadingTime?: number): {
|
|
1239
|
+
isLoading: boolean;
|
|
1240
|
+
showLoading: boolean;
|
|
1241
|
+
startLoading: () => void;
|
|
1242
|
+
stopLoading: () => void;
|
|
1243
|
+
};
|
|
1244
|
+
/**
|
|
1245
|
+
* Hook for local storage with SSR safety
|
|
1246
|
+
*/
|
|
1247
|
+
declare function useLocalStorage<T>(key: string, initialValue: T): [T, (value: T | ((val: T) => T)) => void];
|
|
1248
|
+
|
|
1249
|
+
interface AnnotationProviderProps {
|
|
1250
|
+
annotationManager: AnnotationManager;
|
|
1251
|
+
children: React__default.ReactNode;
|
|
1252
|
+
}
|
|
1253
|
+
/**
|
|
1254
|
+
* Annotation Provider
|
|
1255
|
+
*
|
|
1256
|
+
* Provides annotation mutation capabilities (create, delete) via the Provider Pattern.
|
|
1257
|
+
* Apps inject their own AnnotationManager implementation.
|
|
1258
|
+
*
|
|
1259
|
+
* Example usage:
|
|
1260
|
+
* ```typescript
|
|
1261
|
+
* // In app (apps/frontend/src/hooks/useAnnotationManager.ts)
|
|
1262
|
+
* function useAnnotationManager(): AnnotationManager {
|
|
1263
|
+
* const annotations = useAnnotations();
|
|
1264
|
+
* const createMutation = annotations.create.useMutation();
|
|
1265
|
+
* const deleteMutation = annotations.delete.useMutation();
|
|
1266
|
+
*
|
|
1267
|
+
* return {
|
|
1268
|
+
* createAnnotation: async (params) => {
|
|
1269
|
+
* const result = await createMutation.mutateAsync({
|
|
1270
|
+
* rUri: params.rUri,
|
|
1271
|
+
* data: { motivation: params.motivation, target: { source: params.rUri, selector: params.selector }, body: params.body }
|
|
1272
|
+
* });
|
|
1273
|
+
* return result.annotation;
|
|
1274
|
+
* },
|
|
1275
|
+
* deleteAnnotation: async (params) => {
|
|
1276
|
+
* const annotationIdSegment = params.annotationId.split('/').pop() || params.annotationId;
|
|
1277
|
+
* await deleteMutation.mutateAsync(resourceAnnotationUri(`${params.rUri}/annotations/${annotationIdSegment}`));
|
|
1278
|
+
* }
|
|
1279
|
+
* };
|
|
1280
|
+
* }
|
|
1281
|
+
*
|
|
1282
|
+
* // In app layout
|
|
1283
|
+
* const annotationManager = useAnnotationManager();
|
|
1284
|
+
* <AnnotationProvider annotationManager={annotationManager}>
|
|
1285
|
+
* <YourComponents />
|
|
1286
|
+
* </AnnotationProvider>
|
|
1287
|
+
* ```
|
|
1288
|
+
*/
|
|
1289
|
+
declare function AnnotationProvider({ annotationManager, children }: AnnotationProviderProps): react_jsx_runtime.JSX.Element;
|
|
1290
|
+
/**
|
|
1291
|
+
* Hook to access the AnnotationManager
|
|
1292
|
+
*
|
|
1293
|
+
* @throws Error if used outside AnnotationProvider
|
|
1294
|
+
* @returns AnnotationManager instance
|
|
1295
|
+
*/
|
|
1296
|
+
declare function useAnnotationManager(): AnnotationManager;
|
|
1297
|
+
|
|
1298
|
+
interface AnnotationUIContextType {
|
|
1299
|
+
newAnnotationIds: Set<string>;
|
|
1300
|
+
clearNewAnnotationId: (id: AnnotationUri) => void;
|
|
1301
|
+
triggerSparkleAnimation: (annotationId: string) => void;
|
|
1302
|
+
}
|
|
1303
|
+
interface AnnotationUIProviderProps {
|
|
1304
|
+
children: React__default.ReactNode;
|
|
1305
|
+
}
|
|
1306
|
+
/**
|
|
1307
|
+
* Annotation UI Provider
|
|
1308
|
+
*
|
|
1309
|
+
* Manages UI-only state for annotation interactions (sparkle animations).
|
|
1310
|
+
* This is NOT part of the Provider Pattern - it's internal react-ui state management.
|
|
1311
|
+
*
|
|
1312
|
+
* Usage:
|
|
1313
|
+
* ```typescript
|
|
1314
|
+
* <AnnotationUIProvider>
|
|
1315
|
+
* <ResourceViewer ... />
|
|
1316
|
+
* </AnnotationUIProvider>
|
|
1317
|
+
* ```
|
|
1318
|
+
*/
|
|
1319
|
+
declare function AnnotationUIProvider({ children }: AnnotationUIProviderProps): react_jsx_runtime.JSX.Element;
|
|
1320
|
+
/**
|
|
1321
|
+
* Hook to access annotation UI state
|
|
1322
|
+
*
|
|
1323
|
+
* @throws Error if used outside AnnotationUIProvider
|
|
1324
|
+
* @returns AnnotationUI context
|
|
1325
|
+
*/
|
|
1326
|
+
declare function useAnnotationUI(): AnnotationUIContextType;
|
|
1327
|
+
|
|
1328
|
+
interface ApiClientProviderProps {
|
|
1329
|
+
apiClientManager: ApiClientManager;
|
|
1330
|
+
children: ReactNode;
|
|
1331
|
+
}
|
|
1332
|
+
/**
|
|
1333
|
+
* Provider for API client management
|
|
1334
|
+
* Apps must provide an ApiClientManager implementation
|
|
1335
|
+
*/
|
|
1336
|
+
declare function ApiClientProvider({ apiClientManager, children, }: ApiClientProviderProps): react_jsx_runtime.JSX.Element;
|
|
1337
|
+
/**
|
|
1338
|
+
* Hook to access the API client
|
|
1339
|
+
* Must be used within an ApiClientProvider
|
|
1340
|
+
* @returns API client instance (null if not authenticated)
|
|
1341
|
+
*/
|
|
1342
|
+
declare function useApiClient(): _semiont_api_client.SemiontApiClient | null;
|
|
1343
|
+
|
|
1344
|
+
interface CacheProviderProps {
|
|
1345
|
+
cacheManager: CacheManager;
|
|
1346
|
+
children: React__default.ReactNode;
|
|
1347
|
+
}
|
|
1348
|
+
/**
|
|
1349
|
+
* Cache Provider
|
|
1350
|
+
*
|
|
1351
|
+
* Provides cache invalidation capabilities via the Provider Pattern.
|
|
1352
|
+
* Apps inject their own CacheManager implementation.
|
|
1353
|
+
*
|
|
1354
|
+
* Example usage:
|
|
1355
|
+
* ```typescript
|
|
1356
|
+
* // In app (apps/frontend/src/hooks/useCacheManager.ts)
|
|
1357
|
+
* function useCacheManager(): CacheManager {
|
|
1358
|
+
* const queryClient = useQueryClient();
|
|
1359
|
+
*
|
|
1360
|
+
* return {
|
|
1361
|
+
* invalidateAnnotations: (rUri) => {
|
|
1362
|
+
* queryClient.invalidateQueries({ queryKey: ['annotations', rUri] });
|
|
1363
|
+
* },
|
|
1364
|
+
* invalidateEvents: (rUri) => {
|
|
1365
|
+
* queryClient.invalidateQueries({ queryKey: ['documents', 'events', rUri] });
|
|
1366
|
+
* }
|
|
1367
|
+
* };
|
|
1368
|
+
* }
|
|
1369
|
+
*
|
|
1370
|
+
* // In app layout
|
|
1371
|
+
* const cacheManager = useCacheManager();
|
|
1372
|
+
* <CacheProvider cacheManager={cacheManager}>
|
|
1373
|
+
* <YourComponents />
|
|
1374
|
+
* </CacheProvider>
|
|
1375
|
+
* ```
|
|
1376
|
+
*/
|
|
1377
|
+
declare function CacheProvider({ cacheManager, children }: CacheProviderProps): react_jsx_runtime.JSX.Element;
|
|
1378
|
+
/**
|
|
1379
|
+
* Hook to access the CacheManager
|
|
1380
|
+
*
|
|
1381
|
+
* @throws Error if used outside CacheProvider
|
|
1382
|
+
* @returns CacheManager instance
|
|
1383
|
+
*/
|
|
1384
|
+
declare function useCacheManager(): CacheManager;
|
|
1385
|
+
|
|
1386
|
+
/**
|
|
1387
|
+
* Provider Pattern: Accepts OpenResourcesManager implementation as prop
|
|
1388
|
+
* and makes it available to child components via Context.
|
|
1389
|
+
*
|
|
1390
|
+
* Apps provide their own implementation (localStorage, sessionStorage, database, etc.)
|
|
1391
|
+
* and pass it to this provider at the root level.
|
|
1392
|
+
*
|
|
1393
|
+
* @example
|
|
1394
|
+
* ```tsx
|
|
1395
|
+
* // In app root
|
|
1396
|
+
* const openResourcesManager = useOpenResourcesManager(); // App's implementation
|
|
1397
|
+
*
|
|
1398
|
+
* <OpenResourcesProvider openResourcesManager={openResourcesManager}>
|
|
1399
|
+
* <App />
|
|
1400
|
+
* </OpenResourcesProvider>
|
|
1401
|
+
* ```
|
|
1402
|
+
*/
|
|
1403
|
+
declare function OpenResourcesProvider({ openResourcesManager, children }: {
|
|
1404
|
+
openResourcesManager: OpenResourcesManager;
|
|
1405
|
+
children: React__default.ReactNode;
|
|
1406
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1407
|
+
/**
|
|
1408
|
+
* Hook to access OpenResourcesManager from Context
|
|
1409
|
+
* Components use this hook to access open resources functionality
|
|
1410
|
+
*/
|
|
1411
|
+
declare function useOpenResources(): OpenResourcesManager;
|
|
1412
|
+
|
|
1413
|
+
type Annotation$i = components['schemas']['Annotation'];
|
|
1414
|
+
interface SelectionData {
|
|
1415
|
+
exact: string;
|
|
1416
|
+
start: number;
|
|
1417
|
+
end: number;
|
|
1418
|
+
}
|
|
1419
|
+
interface ResourceAnnotationsContextType {
|
|
1420
|
+
newAnnotationIds: Set<string>;
|
|
1421
|
+
createAnnotation: (rUri: ResourceUri, motivation: 'highlighting' | 'linking' | 'assessing' | 'commenting' | 'tagging', selector: Selector | Selector[], body?: any[]) => Promise<Annotation$i | undefined>;
|
|
1422
|
+
deleteAnnotation: (annotationId: string, rUri: ResourceUri) => Promise<void>;
|
|
1423
|
+
clearNewAnnotationId: (id: AnnotationUri) => void;
|
|
1424
|
+
triggerSparkleAnimation: (annotationId: string) => void;
|
|
1425
|
+
}
|
|
1426
|
+
declare function ResourceAnnotationsProvider({ children }: {
|
|
1427
|
+
children: React__default.ReactNode;
|
|
1428
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1429
|
+
declare function useResourceAnnotations(): ResourceAnnotationsContextType;
|
|
1430
|
+
|
|
1431
|
+
/**
|
|
1432
|
+
* Standard Link component interface
|
|
1433
|
+
* Compatible with Next.js Link, React Router Link, etc.
|
|
1434
|
+
*
|
|
1435
|
+
* Components accept Link as a prop to remain framework-agnostic.
|
|
1436
|
+
* Apps provide their framework-specific Link component (Next.js, React Router, etc.)
|
|
1437
|
+
*/
|
|
1438
|
+
interface LinkComponentProps {
|
|
1439
|
+
href: string;
|
|
1440
|
+
children: React__default.ReactNode;
|
|
1441
|
+
className?: string;
|
|
1442
|
+
title?: string;
|
|
1443
|
+
onClick?: (e: React__default.MouseEvent) => void;
|
|
1444
|
+
[key: string]: any;
|
|
1445
|
+
}
|
|
1446
|
+
/**
|
|
1447
|
+
* Route builder interface
|
|
1448
|
+
* Apps provide concrete implementations for their routing scheme
|
|
1449
|
+
*
|
|
1450
|
+
* Components accept routes as a prop to build URLs without framework dependencies.
|
|
1451
|
+
*
|
|
1452
|
+
* @example
|
|
1453
|
+
* ```tsx
|
|
1454
|
+
* // In app (e.g., frontend/src/lib/routing.ts)
|
|
1455
|
+
* export const routes: RouteBuilder = {
|
|
1456
|
+
* resourceDetail: (id) => `/know/resource/${id}`,
|
|
1457
|
+
* userProfile: (id) => `/users/${id}`,
|
|
1458
|
+
* search: (query) => `/search?q=${query}`,
|
|
1459
|
+
* home: () => '/',
|
|
1460
|
+
* };
|
|
1461
|
+
*
|
|
1462
|
+
* // Pass to components as props
|
|
1463
|
+
* <MyComponent Link={Link} routes={routes} />
|
|
1464
|
+
* ```
|
|
1465
|
+
*/
|
|
1466
|
+
interface RouteBuilder {
|
|
1467
|
+
/** Resource detail page */
|
|
1468
|
+
resourceDetail: (id: string) => string;
|
|
1469
|
+
/** User profile page */
|
|
1470
|
+
userProfile: (id: string) => string;
|
|
1471
|
+
/** Search page with query */
|
|
1472
|
+
search: (query: string) => string;
|
|
1473
|
+
/** Home/root page */
|
|
1474
|
+
home: () => string;
|
|
1475
|
+
/** About page */
|
|
1476
|
+
about?: () => string;
|
|
1477
|
+
/** Privacy policy page */
|
|
1478
|
+
privacy?: () => string;
|
|
1479
|
+
/** Terms of service page */
|
|
1480
|
+
terms?: () => string;
|
|
1481
|
+
/** Knowledge base page */
|
|
1482
|
+
knowledge?: () => string;
|
|
1483
|
+
/** Moderation dashboard */
|
|
1484
|
+
moderate?: () => string;
|
|
1485
|
+
/** Admin dashboard */
|
|
1486
|
+
admin?: () => string;
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
/**
|
|
1490
|
+
* Provider Pattern: Accepts SessionManager implementation as prop
|
|
1491
|
+
* and makes it available to child components via Context.
|
|
1492
|
+
*
|
|
1493
|
+
* Apps provide their own implementation (next-auth, custom auth, etc.)
|
|
1494
|
+
* and pass it to this provider at the root level.
|
|
1495
|
+
*
|
|
1496
|
+
* @example
|
|
1497
|
+
* ```tsx
|
|
1498
|
+
* // In app root
|
|
1499
|
+
* const sessionManager = useSessionManager(); // App's implementation
|
|
1500
|
+
*
|
|
1501
|
+
* <SessionProvider sessionManager={sessionManager}>
|
|
1502
|
+
* <App />
|
|
1503
|
+
* </SessionProvider>
|
|
1504
|
+
* ```
|
|
1505
|
+
*/
|
|
1506
|
+
declare function SessionProvider({ sessionManager, children }: {
|
|
1507
|
+
sessionManager: SessionManager;
|
|
1508
|
+
children: ReactNode;
|
|
1509
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1510
|
+
/**
|
|
1511
|
+
* Hook to access SessionManager from Context
|
|
1512
|
+
* Components use this hook to access session state and expiry information
|
|
1513
|
+
*/
|
|
1514
|
+
declare function useSessionContext(): SessionManager;
|
|
1515
|
+
|
|
1516
|
+
declare const AVAILABLE_LOCALES: readonly ["ar", "bn", "cs", "da", "de", "el", "en", "es", "fa", "fi", "fr", "he", "hi", "id", "it", "ja", "ko", "ms", "nl", "no", "pl", "pt", "ro", "sv", "th", "tr", "uk", "vi", "zh"];
|
|
1517
|
+
type AvailableLocale = typeof AVAILABLE_LOCALES[number];
|
|
1518
|
+
interface TranslationProviderProps {
|
|
1519
|
+
/**
|
|
1520
|
+
* Option 1: Provide a complete TranslationManager implementation
|
|
1521
|
+
*/
|
|
1522
|
+
translationManager?: TranslationManager;
|
|
1523
|
+
/**
|
|
1524
|
+
* Option 2: Use built-in translations by specifying a locale
|
|
1525
|
+
* When adding new locales, just add the JSON file and update AVAILABLE_LOCALES
|
|
1526
|
+
*/
|
|
1527
|
+
locale?: string;
|
|
1528
|
+
/**
|
|
1529
|
+
* Loading component to show while translations are being loaded
|
|
1530
|
+
* Only relevant when using dynamic locale loading
|
|
1531
|
+
*/
|
|
1532
|
+
loadingComponent?: ReactNode;
|
|
1533
|
+
children: ReactNode;
|
|
1534
|
+
}
|
|
1535
|
+
/**
|
|
1536
|
+
* Provider for translation management with dynamic loading
|
|
1537
|
+
*
|
|
1538
|
+
* Three modes of operation:
|
|
1539
|
+
* 1. No provider: Components use default English strings
|
|
1540
|
+
* 2. With locale prop: Dynamically loads translations for that locale
|
|
1541
|
+
* 3. With translationManager: Use custom translation implementation
|
|
1542
|
+
*/
|
|
1543
|
+
declare function TranslationProvider({ translationManager, locale, loadingComponent, children, }: TranslationProviderProps): react_jsx_runtime.JSX.Element;
|
|
1544
|
+
/**
|
|
1545
|
+
* Hook to access translations within a namespace
|
|
1546
|
+
*
|
|
1547
|
+
* Works in three modes:
|
|
1548
|
+
* 1. Without provider: Returns default English translations
|
|
1549
|
+
* 2. With provider using locale: Returns dynamically loaded translations for that locale
|
|
1550
|
+
* 3. With custom provider: Uses the custom translation manager
|
|
1551
|
+
*
|
|
1552
|
+
* @param namespace - Translation namespace (e.g., 'Toolbar', 'ResourceViewer')
|
|
1553
|
+
* @returns Function to translate keys within the namespace
|
|
1554
|
+
*/
|
|
1555
|
+
declare function useTranslations(namespace: string): (key: string, params?: Record<string, any>) => string;
|
|
1556
|
+
/**
|
|
1557
|
+
* Hook to preload translations for a locale
|
|
1558
|
+
* Useful for preloading translations before navigation
|
|
1559
|
+
*/
|
|
1560
|
+
declare function usePreloadTranslations(): {
|
|
1561
|
+
preload: (locale: string) => Promise<boolean>;
|
|
1562
|
+
isLoaded: (locale: string) => boolean;
|
|
1563
|
+
};
|
|
1564
|
+
|
|
1565
|
+
type Annotation$h = components['schemas']['Annotation'];
|
|
1566
|
+
interface TextSegment {
|
|
1567
|
+
exact: string;
|
|
1568
|
+
annotation?: Annotation$h;
|
|
1569
|
+
start: number;
|
|
1570
|
+
end: number;
|
|
1571
|
+
}
|
|
1572
|
+
interface Props$b {
|
|
1573
|
+
content: string;
|
|
1574
|
+
segments: TextSegment[];
|
|
1575
|
+
onAnnotationClick?: (annotation: Annotation$h) => void;
|
|
1576
|
+
onAnnotationHover?: (annotationId: string | null) => void;
|
|
1577
|
+
onTextSelect?: (exact: string, position: {
|
|
1578
|
+
start: number;
|
|
1579
|
+
end: number;
|
|
1580
|
+
}) => void;
|
|
1581
|
+
onChange?: (content: string) => void;
|
|
1582
|
+
editable?: boolean;
|
|
1583
|
+
newAnnotationIds?: Set<string>;
|
|
1584
|
+
hoveredAnnotationId?: string | null;
|
|
1585
|
+
hoveredCommentId?: string | null;
|
|
1586
|
+
scrollToAnnotationId?: string | null;
|
|
1587
|
+
sourceView?: boolean;
|
|
1588
|
+
showLineNumbers?: boolean;
|
|
1589
|
+
enableWidgets?: boolean;
|
|
1590
|
+
onEntityTypeClick?: (entityType: string) => void;
|
|
1591
|
+
onReferenceNavigate?: (documentId: string) => void;
|
|
1592
|
+
onUnresolvedReferenceClick?: (annotation: Annotation$h) => void;
|
|
1593
|
+
getTargetDocumentName?: (documentId: string) => string | undefined;
|
|
1594
|
+
generatingReferenceId?: string | null;
|
|
1595
|
+
onDeleteAnnotation?: (annotation: Annotation$h) => void;
|
|
1596
|
+
}
|
|
1597
|
+
declare function CodeMirrorRenderer({ content, segments, onAnnotationClick, onAnnotationHover, onTextSelect, onChange, editable, newAnnotationIds, hoveredAnnotationId, hoveredCommentId, scrollToAnnotationId, sourceView, showLineNumbers, enableWidgets, onEntityTypeClick, onReferenceNavigate, onUnresolvedReferenceClick, getTargetDocumentName, generatingReferenceId, onDeleteAnnotation }: Props$b): react_jsx_runtime.JSX.Element;
|
|
1598
|
+
|
|
1599
|
+
interface DetectionProgressWidgetProps {
|
|
1600
|
+
progress: DetectionProgress | null;
|
|
1601
|
+
onCancel?: () => void;
|
|
1602
|
+
}
|
|
1603
|
+
declare function DetectionProgressWidget({ progress, onCancel }: DetectionProgressWidgetProps): react_jsx_runtime.JSX.Element | null;
|
|
1604
|
+
|
|
1605
|
+
interface Props$a {
|
|
1606
|
+
children: ReactNode;
|
|
1607
|
+
fallback?: (error: Error, reset: () => void) => ReactNode;
|
|
1608
|
+
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
1609
|
+
}
|
|
1610
|
+
interface State {
|
|
1611
|
+
hasError: boolean;
|
|
1612
|
+
error: Error | null;
|
|
1613
|
+
errorInfo: ErrorInfo | null;
|
|
1614
|
+
}
|
|
1615
|
+
/**
|
|
1616
|
+
* Generic Error Boundary component that catches JavaScript errors
|
|
1617
|
+
* in child components and displays a fallback UI.
|
|
1618
|
+
*/
|
|
1619
|
+
declare class ErrorBoundary extends Component<Props$a, State> {
|
|
1620
|
+
constructor(props: Props$a);
|
|
1621
|
+
static getDerivedStateFromError(error: Error): State;
|
|
1622
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
1623
|
+
handleReset: () => void;
|
|
1624
|
+
render(): string | number | boolean | Iterable<React__default.ReactNode> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
1625
|
+
}
|
|
1626
|
+
/**
|
|
1627
|
+
* Specialized error boundary for async components
|
|
1628
|
+
*/
|
|
1629
|
+
declare function AsyncErrorBoundary({ children }: {
|
|
1630
|
+
children: ReactNode;
|
|
1631
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1632
|
+
|
|
1633
|
+
type Annotation$g = components['schemas']['Annotation'];
|
|
1634
|
+
interface LiveRegionContextType {
|
|
1635
|
+
announce: (message: string, priority?: 'polite' | 'assertive') => void;
|
|
1636
|
+
}
|
|
1637
|
+
declare function useLiveRegion(): LiveRegionContextType;
|
|
1638
|
+
interface LiveRegionProviderProps {
|
|
1639
|
+
children: React__default.ReactNode;
|
|
1640
|
+
}
|
|
1641
|
+
declare function LiveRegionProvider({ children }: LiveRegionProviderProps): react_jsx_runtime.JSX.Element;
|
|
1642
|
+
declare function useSearchAnnouncements(): {
|
|
1643
|
+
announceSearchResults: (count: number, query: string) => void;
|
|
1644
|
+
announceSearching: () => void;
|
|
1645
|
+
};
|
|
1646
|
+
declare function useDocumentAnnouncements(): {
|
|
1647
|
+
announceDocumentSaved: () => void;
|
|
1648
|
+
announceDocumentDeleted: () => void;
|
|
1649
|
+
announceAnnotationCreated: (annotation: Annotation$g) => void;
|
|
1650
|
+
announceAnnotationDeleted: () => void;
|
|
1651
|
+
announceError: (message: string) => void;
|
|
1652
|
+
};
|
|
1653
|
+
|
|
1654
|
+
interface ResourceTagsInlineProps {
|
|
1655
|
+
documentId: string;
|
|
1656
|
+
tags: string[];
|
|
1657
|
+
isEditing: boolean;
|
|
1658
|
+
onUpdate: (tags: string[]) => Promise<void>;
|
|
1659
|
+
disabled?: boolean;
|
|
1660
|
+
}
|
|
1661
|
+
declare function ResourceTagsInline({ documentId, tags, isEditing, onUpdate, disabled }: ResourceTagsInlineProps): react_jsx_runtime.JSX.Element | null;
|
|
1662
|
+
|
|
1663
|
+
type ToastType = 'success' | 'error' | 'info' | 'warning';
|
|
1664
|
+
interface ToastMessage {
|
|
1665
|
+
id: string;
|
|
1666
|
+
message: string;
|
|
1667
|
+
type: ToastType;
|
|
1668
|
+
duration?: number;
|
|
1669
|
+
}
|
|
1670
|
+
interface ToastContainerProps {
|
|
1671
|
+
toasts: ToastMessage[];
|
|
1672
|
+
onClose: (id: string) => void;
|
|
1673
|
+
}
|
|
1674
|
+
declare function ToastContainer({ toasts, onClose }: ToastContainerProps): React__default.ReactPortal | null;
|
|
1675
|
+
interface ToastContextType {
|
|
1676
|
+
showToast: (message: string, type?: ToastType, duration?: number) => void;
|
|
1677
|
+
showSuccess: (message: string, duration?: number) => void;
|
|
1678
|
+
showError: (message: string, duration?: number) => void;
|
|
1679
|
+
showWarning: (message: string, duration?: number) => void;
|
|
1680
|
+
showInfo: (message: string, duration?: number) => void;
|
|
1681
|
+
}
|
|
1682
|
+
declare function ToastProvider({ children }: {
|
|
1683
|
+
children: React__default.ReactNode;
|
|
1684
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1685
|
+
declare function useToast(): ToastContextType;
|
|
1686
|
+
|
|
1687
|
+
type ToolbarContext = 'document' | 'simple';
|
|
1688
|
+
interface Props$9<T extends string = string> {
|
|
1689
|
+
context: ToolbarContext;
|
|
1690
|
+
activePanel: T | null;
|
|
1691
|
+
onPanelToggle: (panel: T) => void;
|
|
1692
|
+
isArchived?: boolean;
|
|
1693
|
+
}
|
|
1694
|
+
declare function Toolbar<T extends string = string>({ context, activePanel, onPanelToggle, isArchived }: Props$9<T>): react_jsx_runtime.JSX.Element;
|
|
1695
|
+
|
|
1696
|
+
type SelectionMotivation = 'linking' | 'highlighting' | 'assessing' | 'commenting' | 'tagging';
|
|
1697
|
+
type ClickAction = 'detail' | 'follow' | 'jsonld' | 'deleting';
|
|
1698
|
+
type ShapeType = 'rectangle' | 'circle' | 'polygon';
|
|
1699
|
+
interface AnnotateToolbarProps {
|
|
1700
|
+
selectedMotivation: SelectionMotivation | null;
|
|
1701
|
+
selectedClick: ClickAction;
|
|
1702
|
+
onSelectionChange: (motivation: SelectionMotivation | null) => void;
|
|
1703
|
+
onClickChange: (motivation: ClickAction) => void;
|
|
1704
|
+
showSelectionGroup?: boolean;
|
|
1705
|
+
showDeleteButton?: boolean;
|
|
1706
|
+
showShapeGroup?: boolean;
|
|
1707
|
+
selectedShape?: ShapeType;
|
|
1708
|
+
onShapeChange?: (shape: ShapeType) => void;
|
|
1709
|
+
annotateMode: boolean;
|
|
1710
|
+
onAnnotateModeToggle: () => void;
|
|
1711
|
+
}
|
|
1712
|
+
declare function AnnotateToolbar({ selectedMotivation, selectedClick, onSelectionChange, onClickChange, showSelectionGroup, showDeleteButton, showShapeGroup, selectedShape, onShapeChange, annotateMode, onAnnotateModeToggle }: AnnotateToolbarProps): react_jsx_runtime.JSX.Element;
|
|
1713
|
+
|
|
1714
|
+
type Annotation$f = components['schemas']['Annotation'];
|
|
1715
|
+
interface JsonLdViewProps {
|
|
1716
|
+
annotation: Annotation$f;
|
|
1717
|
+
onBack: () => void;
|
|
1718
|
+
}
|
|
1719
|
+
declare function JsonLdView({ annotation, onBack }: JsonLdViewProps): react_jsx_runtime.JSX.Element;
|
|
1720
|
+
|
|
1721
|
+
interface SelectedTextDisplayProps {
|
|
1722
|
+
exact: string;
|
|
1723
|
+
}
|
|
1724
|
+
declare function SelectedTextDisplay({ exact }: SelectedTextDisplayProps): react_jsx_runtime.JSX.Element;
|
|
1725
|
+
interface EntityTypeBadgesProps {
|
|
1726
|
+
entityTypes: string;
|
|
1727
|
+
}
|
|
1728
|
+
declare function EntityTypeBadges({ entityTypes }: EntityTypeBadgesProps): react_jsx_runtime.JSX.Element | null;
|
|
1729
|
+
interface PopupHeaderProps {
|
|
1730
|
+
title: string;
|
|
1731
|
+
selectedText?: string;
|
|
1732
|
+
onClose: () => void;
|
|
1733
|
+
}
|
|
1734
|
+
declare function PopupHeader({ title, selectedText, onClose }: PopupHeaderProps): react_jsx_runtime.JSX.Element;
|
|
1735
|
+
interface PopupContainerProps {
|
|
1736
|
+
children: React__default.ReactNode;
|
|
1737
|
+
position: {
|
|
1738
|
+
x: number;
|
|
1739
|
+
y: number;
|
|
1740
|
+
};
|
|
1741
|
+
onClose: () => void;
|
|
1742
|
+
isOpen: boolean;
|
|
1743
|
+
wide?: boolean;
|
|
1744
|
+
}
|
|
1745
|
+
declare function PopupContainer({ children, position, onClose, isOpen, wide }: PopupContainerProps): react_jsx_runtime.JSX.Element;
|
|
1746
|
+
|
|
1747
|
+
type Annotation$e = components['schemas']['Annotation'];
|
|
1748
|
+
interface AnnotationOverlayProps {
|
|
1749
|
+
annotations: Annotation$e[];
|
|
1750
|
+
imageWidth: number;
|
|
1751
|
+
imageHeight: number;
|
|
1752
|
+
displayWidth: number;
|
|
1753
|
+
displayHeight: number;
|
|
1754
|
+
onAnnotationClick?: (annotation: Annotation$e) => void;
|
|
1755
|
+
onAnnotationHover?: (annotationId: string | null) => void;
|
|
1756
|
+
hoveredAnnotationId?: string | null;
|
|
1757
|
+
selectedAnnotationId?: string | null;
|
|
1758
|
+
}
|
|
1759
|
+
/**
|
|
1760
|
+
* Render annotation overlay - displays existing annotations as SVG shapes
|
|
1761
|
+
*/
|
|
1762
|
+
declare function AnnotationOverlay({ annotations, imageWidth, imageHeight, displayWidth, displayHeight, onAnnotationClick, onAnnotationHover, hoveredAnnotationId, selectedAnnotationId }: AnnotationOverlayProps): react_jsx_runtime.JSX.Element;
|
|
1763
|
+
|
|
1764
|
+
type Annotation$d = components['schemas']['Annotation'];
|
|
1765
|
+
type DrawingMode = 'rectangle' | 'polygon' | 'circle' | 'freeform' | null;
|
|
1766
|
+
interface SvgDrawingCanvasProps {
|
|
1767
|
+
resourceUri: ResourceUri;
|
|
1768
|
+
existingAnnotations?: Annotation$d[];
|
|
1769
|
+
drawingMode: DrawingMode;
|
|
1770
|
+
selectedMotivation?: SelectionMotivation | null;
|
|
1771
|
+
onAnnotationCreate?: (svg: string, position?: {
|
|
1772
|
+
x: number;
|
|
1773
|
+
y: number;
|
|
1774
|
+
}) => void;
|
|
1775
|
+
onAnnotationClick?: (annotation: Annotation$d) => void;
|
|
1776
|
+
onAnnotationHover?: (annotationId: string | null) => void;
|
|
1777
|
+
hoveredAnnotationId?: string | null;
|
|
1778
|
+
selectedAnnotationId?: string | null;
|
|
1779
|
+
}
|
|
1780
|
+
declare function SvgDrawingCanvas({ resourceUri, existingAnnotations, drawingMode, selectedMotivation, onAnnotationCreate, onAnnotationClick, onAnnotationHover, hoveredAnnotationId, selectedAnnotationId }: SvgDrawingCanvasProps): react_jsx_runtime.JSX.Element;
|
|
1781
|
+
|
|
1782
|
+
interface KeyboardShortcutsHelpModalProps {
|
|
1783
|
+
isOpen: boolean;
|
|
1784
|
+
onClose: () => void;
|
|
1785
|
+
}
|
|
1786
|
+
declare function KeyboardShortcutsHelpModal({ isOpen, onClose }: KeyboardShortcutsHelpModalProps): react_jsx_runtime.JSX.Element;
|
|
1787
|
+
|
|
1788
|
+
interface ProposeEntitiesModalProps {
|
|
1789
|
+
isOpen: boolean;
|
|
1790
|
+
onConfirm: (selectedTypes: string[]) => void;
|
|
1791
|
+
onCancel: () => void;
|
|
1792
|
+
}
|
|
1793
|
+
declare function ProposeEntitiesModal({ isOpen, onConfirm, onCancel }: ProposeEntitiesModalProps): react_jsx_runtime.JSX.Element;
|
|
1794
|
+
|
|
1795
|
+
type Annotation$c = components['schemas']['Annotation'];
|
|
1796
|
+
|
|
1797
|
+
interface Props$8 {
|
|
1798
|
+
content: string;
|
|
1799
|
+
mimeType?: string;
|
|
1800
|
+
resourceUri?: string;
|
|
1801
|
+
annotations: AnnotationsCollection;
|
|
1802
|
+
handlers?: AnnotationHandlers;
|
|
1803
|
+
creationHandler?: AnnotationCreationHandler;
|
|
1804
|
+
uiState: AnnotationUIState;
|
|
1805
|
+
onUIStateChange?: (state: Partial<AnnotationUIState>) => void;
|
|
1806
|
+
editable?: boolean;
|
|
1807
|
+
enableWidgets?: boolean;
|
|
1808
|
+
onEntityTypeClick?: (entityType: string) => void;
|
|
1809
|
+
onReferenceNavigate?: (documentId: string) => void;
|
|
1810
|
+
onUnresolvedReferenceClick?: (annotation: Annotation$c) => void;
|
|
1811
|
+
getTargetDocumentName?: (documentId: string) => string | undefined;
|
|
1812
|
+
generatingReferenceId?: string | null;
|
|
1813
|
+
onDeleteAnnotation?: (annotation: Annotation$c) => void;
|
|
1814
|
+
showLineNumbers?: boolean;
|
|
1815
|
+
annotateMode: boolean;
|
|
1816
|
+
onAnnotateModeToggle: () => void;
|
|
1817
|
+
}
|
|
1818
|
+
declare function AnnotateView({ content, mimeType, resourceUri, annotations, handlers, creationHandler, uiState, onUIStateChange, editable, enableWidgets, onEntityTypeClick, onReferenceNavigate, onUnresolvedReferenceClick, getTargetDocumentName, generatingReferenceId, onDeleteAnnotation, showLineNumbers, annotateMode, onAnnotateModeToggle }: Props$8): react_jsx_runtime.JSX.Element;
|
|
1819
|
+
|
|
1820
|
+
interface Props$7 {
|
|
1821
|
+
rUri: ResourceUri;
|
|
1822
|
+
hoveredAnnotationId?: string | null;
|
|
1823
|
+
onEventHover?: (annotationId: string | null) => void;
|
|
1824
|
+
onEventClick?: (annotationId: string | null) => void;
|
|
1825
|
+
Link: React__default.ComponentType<LinkComponentProps>;
|
|
1826
|
+
routes: RouteBuilder;
|
|
1827
|
+
}
|
|
1828
|
+
declare function AnnotationHistory({ rUri, hoveredAnnotationId, onEventHover, onEventClick, Link, routes }: Props$7): react_jsx_runtime.JSX.Element | null;
|
|
1829
|
+
|
|
1830
|
+
interface Props$6 {
|
|
1831
|
+
content: string;
|
|
1832
|
+
mimeType: string;
|
|
1833
|
+
resourceUri: string;
|
|
1834
|
+
annotations: AnnotationsCollection;
|
|
1835
|
+
handlers?: AnnotationHandlers;
|
|
1836
|
+
hoveredAnnotationId?: string | null;
|
|
1837
|
+
hoveredCommentId?: string | null;
|
|
1838
|
+
selectedClick?: ClickAction;
|
|
1839
|
+
onClickChange?: (motivation: ClickAction) => void;
|
|
1840
|
+
annotateMode: boolean;
|
|
1841
|
+
onAnnotateModeToggle: () => void;
|
|
1842
|
+
}
|
|
1843
|
+
declare function BrowseView({ content, mimeType, resourceUri, annotations, handlers, hoveredAnnotationId, hoveredCommentId, selectedClick, onClickChange, annotateMode, onAnnotateModeToggle }: Props$6): react_jsx_runtime.JSX.Element;
|
|
1844
|
+
|
|
1845
|
+
type TranslateFn$4 = (key: string, params?: Record<string, string | number>) => string;
|
|
1846
|
+
interface Props$5 {
|
|
1847
|
+
event: StoredEvent;
|
|
1848
|
+
annotations: any[];
|
|
1849
|
+
allEvents: StoredEvent[];
|
|
1850
|
+
isRelated: boolean;
|
|
1851
|
+
t: TranslateFn$4;
|
|
1852
|
+
Link: React__default.ComponentType<LinkComponentProps>;
|
|
1853
|
+
routes: RouteBuilder;
|
|
1854
|
+
onEventRef?: (annotationId: string | null, element: HTMLElement | null) => void;
|
|
1855
|
+
onEventClick?: (annotationId: string | null) => void;
|
|
1856
|
+
onEventHover?: (annotationId: string | null) => void;
|
|
1857
|
+
}
|
|
1858
|
+
declare function HistoryEvent({ event, annotations, allEvents, isRelated, t, Link, routes, onEventRef, onEventClick, onEventHover }: Props$5): react_jsx_runtime.JSX.Element;
|
|
1859
|
+
|
|
1860
|
+
type SemiontResource$1 = components['schemas']['ResourceDescriptor'];
|
|
1861
|
+
interface Props$4 {
|
|
1862
|
+
resource: SemiontResource$1 & {
|
|
1863
|
+
content: string;
|
|
1864
|
+
};
|
|
1865
|
+
annotations: AnnotationsCollection;
|
|
1866
|
+
onRefetchAnnotations?: () => void;
|
|
1867
|
+
annotateMode: boolean;
|
|
1868
|
+
onAnnotateModeToggle: () => void;
|
|
1869
|
+
generatingReferenceId?: string | null;
|
|
1870
|
+
onAnnotationHover?: (annotationId: string | null) => void;
|
|
1871
|
+
onCommentHover?: (commentId: string | null) => void;
|
|
1872
|
+
hoveredAnnotationId?: string | null;
|
|
1873
|
+
hoveredCommentId?: string | null;
|
|
1874
|
+
scrollToAnnotationId?: string | null;
|
|
1875
|
+
showLineNumbers?: boolean;
|
|
1876
|
+
onCommentCreationRequested?: (selection: {
|
|
1877
|
+
exact: string;
|
|
1878
|
+
start: number;
|
|
1879
|
+
end: number;
|
|
1880
|
+
}) => void;
|
|
1881
|
+
onTagCreationRequested?: (selection: {
|
|
1882
|
+
exact: string;
|
|
1883
|
+
start: number;
|
|
1884
|
+
end: number;
|
|
1885
|
+
}) => void;
|
|
1886
|
+
onReferenceCreationRequested?: (selection: {
|
|
1887
|
+
exact: string;
|
|
1888
|
+
start: number;
|
|
1889
|
+
end: number;
|
|
1890
|
+
prefix?: string;
|
|
1891
|
+
suffix?: string;
|
|
1892
|
+
svgSelector?: string;
|
|
1893
|
+
}) => void;
|
|
1894
|
+
onCommentClick?: (commentId: string) => void;
|
|
1895
|
+
onReferenceClick?: (referenceId: string) => void;
|
|
1896
|
+
onHighlightClick?: (highlightId: string) => void;
|
|
1897
|
+
onAssessmentClick?: (assessmentId: string) => void;
|
|
1898
|
+
onTagClick?: (tagId: string) => void;
|
|
1899
|
+
}
|
|
1900
|
+
declare function ResourceViewer({ resource, annotations, onRefetchAnnotations, annotateMode, onAnnotateModeToggle, generatingReferenceId, onAnnotationHover, onCommentHover, hoveredAnnotationId, hoveredCommentId, scrollToAnnotationId, showLineNumbers, onCommentCreationRequested, onTagCreationRequested, onReferenceCreationRequested, onCommentClick, onReferenceClick, onHighlightClick, onAssessmentClick, onTagClick }: Props$4): react_jsx_runtime.JSX.Element;
|
|
1901
|
+
|
|
1902
|
+
type Annotation$b = components['schemas']['Annotation'];
|
|
1903
|
+
interface AssessmentEntryProps {
|
|
1904
|
+
assessment: Annotation$b;
|
|
1905
|
+
isFocused: boolean;
|
|
1906
|
+
onClick: () => void;
|
|
1907
|
+
onAssessmentRef: (assessmentId: string, el: HTMLElement | null) => void;
|
|
1908
|
+
onAssessmentHover?: (assessmentId: string | null) => void;
|
|
1909
|
+
}
|
|
1910
|
+
declare function AssessmentEntry({ assessment, isFocused, onClick, onAssessmentRef, onAssessmentHover, }: AssessmentEntryProps): react_jsx_runtime.JSX.Element;
|
|
1911
|
+
|
|
1912
|
+
type Annotation$a = components['schemas']['Annotation'];
|
|
1913
|
+
interface AssessmentPanelProps {
|
|
1914
|
+
annotations: Annotation$a[];
|
|
1915
|
+
onAnnotationClick: (annotation: Annotation$a) => void;
|
|
1916
|
+
focusedAnnotationId: string | null;
|
|
1917
|
+
hoveredAnnotationId?: string | null;
|
|
1918
|
+
onAnnotationHover?: (annotationId: string | null) => void;
|
|
1919
|
+
onDetect?: (instructions?: string) => void | Promise<void>;
|
|
1920
|
+
isDetecting?: boolean;
|
|
1921
|
+
detectionProgress?: {
|
|
1922
|
+
status: string;
|
|
1923
|
+
percentage?: number;
|
|
1924
|
+
message?: string;
|
|
1925
|
+
} | null;
|
|
1926
|
+
annotateMode?: boolean;
|
|
1927
|
+
}
|
|
1928
|
+
declare function AssessmentPanel({ annotations, onAnnotationClick, focusedAnnotationId, hoveredAnnotationId, onAnnotationHover, onDetect, isDetecting, detectionProgress, annotateMode, }: AssessmentPanelProps): react_jsx_runtime.JSX.Element;
|
|
1929
|
+
|
|
1930
|
+
interface Props$3 {
|
|
1931
|
+
isConnected: boolean;
|
|
1932
|
+
eventCount: number;
|
|
1933
|
+
lastEventTimestamp?: string;
|
|
1934
|
+
}
|
|
1935
|
+
declare function CollaborationPanel({ isConnected, eventCount, lastEventTimestamp }: Props$3): react_jsx_runtime.JSX.Element;
|
|
1936
|
+
|
|
1937
|
+
type Annotation$9 = components['schemas']['Annotation'];
|
|
1938
|
+
interface CommentEntryProps {
|
|
1939
|
+
comment: Annotation$9;
|
|
1940
|
+
isFocused: boolean;
|
|
1941
|
+
onClick: () => void;
|
|
1942
|
+
onUpdate: (newText: string) => void;
|
|
1943
|
+
onCommentRef: (commentId: string, el: HTMLElement | null) => void;
|
|
1944
|
+
onCommentHover?: (commentId: string | null) => void;
|
|
1945
|
+
annotateMode?: boolean;
|
|
1946
|
+
}
|
|
1947
|
+
declare function CommentEntry({ comment, isFocused, onClick, onUpdate, onCommentRef, onCommentHover, annotateMode, }: CommentEntryProps): react_jsx_runtime.JSX.Element;
|
|
1948
|
+
|
|
1949
|
+
type Annotation$8 = components['schemas']['Annotation'];
|
|
1950
|
+
interface CommentsPanelProps {
|
|
1951
|
+
annotations: Annotation$8[];
|
|
1952
|
+
onAnnotationClick: (annotation: Annotation$8) => void;
|
|
1953
|
+
onUpdate: (annotationId: string, newText: string) => void;
|
|
1954
|
+
onCreate?: (commentText: string) => void;
|
|
1955
|
+
focusedAnnotationId: string | null;
|
|
1956
|
+
hoveredAnnotationId?: string | null;
|
|
1957
|
+
onAnnotationHover?: (annotationId: string | null) => void;
|
|
1958
|
+
pendingSelection?: {
|
|
1959
|
+
exact: string;
|
|
1960
|
+
start: number;
|
|
1961
|
+
end: number;
|
|
1962
|
+
} | null;
|
|
1963
|
+
annotateMode?: boolean;
|
|
1964
|
+
onDetect?: (instructions?: string, tone?: string) => void | Promise<void>;
|
|
1965
|
+
isDetecting?: boolean;
|
|
1966
|
+
detectionProgress?: {
|
|
1967
|
+
status: string;
|
|
1968
|
+
percentage?: number;
|
|
1969
|
+
message?: string;
|
|
1970
|
+
} | null;
|
|
1971
|
+
}
|
|
1972
|
+
declare function CommentsPanel({ annotations, onAnnotationClick, onUpdate, onCreate, focusedAnnotationId, hoveredAnnotationId, onAnnotationHover, pendingSelection, annotateMode, onDetect, isDetecting, detectionProgress, }: CommentsPanelProps): react_jsx_runtime.JSX.Element;
|
|
1973
|
+
|
|
1974
|
+
interface DetectSectionProps {
|
|
1975
|
+
annotationType: 'highlight' | 'assessment' | 'comment';
|
|
1976
|
+
isDetecting: boolean;
|
|
1977
|
+
detectionProgress?: {
|
|
1978
|
+
status: string;
|
|
1979
|
+
percentage?: number;
|
|
1980
|
+
message?: string;
|
|
1981
|
+
requestParams?: Array<{
|
|
1982
|
+
label: string;
|
|
1983
|
+
value: string;
|
|
1984
|
+
}>;
|
|
1985
|
+
} | null | undefined;
|
|
1986
|
+
onDetect: (instructions?: string, tone?: string, density?: number) => void | Promise<void>;
|
|
1987
|
+
}
|
|
1988
|
+
/**
|
|
1989
|
+
* Shared detect section for Highlight, Assessment, and Comment panels
|
|
1990
|
+
*
|
|
1991
|
+
* Provides:
|
|
1992
|
+
* - Optional instructions textarea
|
|
1993
|
+
* - Optional tone selector (for comments)
|
|
1994
|
+
* - Detect button with sparkle animation
|
|
1995
|
+
* - Progress display during detection
|
|
1996
|
+
*/
|
|
1997
|
+
declare function DetectSection({ annotationType, isDetecting, detectionProgress, onDetect }: DetectSectionProps): react_jsx_runtime.JSX.Element;
|
|
1998
|
+
|
|
1999
|
+
type Annotation$7 = components['schemas']['Annotation'];
|
|
2000
|
+
interface HighlightEntryProps {
|
|
2001
|
+
highlight: Annotation$7;
|
|
2002
|
+
isFocused: boolean;
|
|
2003
|
+
onClick: () => void;
|
|
2004
|
+
onHighlightRef: (highlightId: string, el: HTMLElement | null) => void;
|
|
2005
|
+
onHighlightHover?: (highlightId: string | null) => void;
|
|
2006
|
+
}
|
|
2007
|
+
declare function HighlightEntry({ highlight, isFocused, onClick, onHighlightRef, onHighlightHover, }: HighlightEntryProps): react_jsx_runtime.JSX.Element;
|
|
2008
|
+
|
|
2009
|
+
type Annotation$6 = components['schemas']['Annotation'];
|
|
2010
|
+
interface HighlightPanelProps {
|
|
2011
|
+
annotations: Annotation$6[];
|
|
2012
|
+
onAnnotationClick: (annotation: Annotation$6) => void;
|
|
2013
|
+
focusedAnnotationId: string | null;
|
|
2014
|
+
hoveredAnnotationId?: string | null;
|
|
2015
|
+
onAnnotationHover?: (annotationId: string | null) => void;
|
|
2016
|
+
onDetect?: (instructions?: string) => void | Promise<void>;
|
|
2017
|
+
isDetecting?: boolean;
|
|
2018
|
+
detectionProgress?: {
|
|
2019
|
+
status: string;
|
|
2020
|
+
percentage?: number;
|
|
2021
|
+
message?: string;
|
|
2022
|
+
} | null;
|
|
2023
|
+
annotateMode?: boolean;
|
|
2024
|
+
}
|
|
2025
|
+
declare function HighlightPanel({ annotations, onAnnotationClick, focusedAnnotationId, hoveredAnnotationId, onAnnotationHover, onDetect, isDetecting, detectionProgress, annotateMode, }: HighlightPanelProps): react_jsx_runtime.JSX.Element;
|
|
2026
|
+
|
|
2027
|
+
type SemiontResource = components['schemas']['ResourceDescriptor'];
|
|
2028
|
+
interface Props$2 {
|
|
2029
|
+
resource: SemiontResource;
|
|
2030
|
+
}
|
|
2031
|
+
declare function JsonLdPanel({ resource: semiontResource }: Props$2): react_jsx_runtime.JSX.Element;
|
|
2032
|
+
|
|
2033
|
+
interface PanelHeaderProps {
|
|
2034
|
+
annotationType: keyof typeof ANNOTATORS;
|
|
2035
|
+
count: number;
|
|
2036
|
+
title: string;
|
|
2037
|
+
}
|
|
2038
|
+
/**
|
|
2039
|
+
* Shared header for annotation panels
|
|
2040
|
+
*
|
|
2041
|
+
* Displays the annotation icon, translated title, and count in a consistent format
|
|
2042
|
+
*/
|
|
2043
|
+
declare function PanelHeader({ annotationType, count, title }: PanelHeaderProps): react_jsx_runtime.JSX.Element;
|
|
2044
|
+
|
|
2045
|
+
type Annotation$5 = components['schemas']['Annotation'];
|
|
2046
|
+
interface ReferenceEntryProps {
|
|
2047
|
+
reference: Annotation$5;
|
|
2048
|
+
isFocused: boolean;
|
|
2049
|
+
onClick: () => void;
|
|
2050
|
+
routes: RouteBuilder;
|
|
2051
|
+
onReferenceRef: (referenceId: string, el: HTMLElement | null) => void;
|
|
2052
|
+
onReferenceHover?: (referenceId: string | null) => void;
|
|
2053
|
+
onGenerateDocument?: (referenceId: string, options: {
|
|
2054
|
+
title: string;
|
|
2055
|
+
prompt?: string;
|
|
2056
|
+
}) => void;
|
|
2057
|
+
onSearchDocuments?: (referenceId: string, searchTerm: string) => void;
|
|
2058
|
+
onUpdateReference?: (referenceId: string, updates: Partial<Annotation$5>) => void;
|
|
2059
|
+
annotateMode?: boolean;
|
|
2060
|
+
}
|
|
2061
|
+
declare function ReferenceEntry({ reference, isFocused, onClick, routes, onReferenceRef, onReferenceHover, onGenerateDocument, onSearchDocuments, onUpdateReference, annotateMode, }: ReferenceEntryProps): react_jsx_runtime.JSX.Element;
|
|
2062
|
+
|
|
2063
|
+
type Annotation$4 = components['schemas']['Annotation'];
|
|
2064
|
+
type ResponseContent<T> = T extends {
|
|
2065
|
+
responses: {
|
|
2066
|
+
200: {
|
|
2067
|
+
content: {
|
|
2068
|
+
'application/json': infer R;
|
|
2069
|
+
};
|
|
2070
|
+
};
|
|
2071
|
+
};
|
|
2072
|
+
} ? R : never;
|
|
2073
|
+
type ReferencedBy = ResponseContent<paths['/resources/{id}/referenced-by']['get']>['referencedBy'][number];
|
|
2074
|
+
interface Props$1 {
|
|
2075
|
+
annotations?: Annotation$4[];
|
|
2076
|
+
onAnnotationClick?: (annotation: Annotation$4) => void;
|
|
2077
|
+
focusedAnnotationId?: string | null;
|
|
2078
|
+
hoveredAnnotationId?: string | null;
|
|
2079
|
+
onAnnotationHover?: (annotationId: string | null) => void;
|
|
2080
|
+
onDetect: (selectedTypes: string[], includeDescriptiveReferences?: boolean) => void;
|
|
2081
|
+
onCreate?: (entityType?: string) => void;
|
|
2082
|
+
isDetecting: boolean;
|
|
2083
|
+
detectionProgress: any;
|
|
2084
|
+
annotateMode?: boolean;
|
|
2085
|
+
Link: React__default.ComponentType<LinkComponentProps>;
|
|
2086
|
+
routes: RouteBuilder;
|
|
2087
|
+
allEntityTypes: string[];
|
|
2088
|
+
onCancelDetection: () => void;
|
|
2089
|
+
onSearchDocuments?: (referenceId: string, searchTerm: string) => void;
|
|
2090
|
+
onUpdate?: (referenceId: string, updates: Partial<Annotation$4>) => void;
|
|
2091
|
+
onGenerateDocument?: (referenceId: string, options: {
|
|
2092
|
+
title: string;
|
|
2093
|
+
prompt?: string;
|
|
2094
|
+
}) => void;
|
|
2095
|
+
mediaType?: string | undefined;
|
|
2096
|
+
referencedBy?: ReferencedBy[];
|
|
2097
|
+
referencedByLoading?: boolean;
|
|
2098
|
+
pendingSelection?: {
|
|
2099
|
+
exact: string;
|
|
2100
|
+
start: number;
|
|
2101
|
+
end: number;
|
|
2102
|
+
prefix?: string;
|
|
2103
|
+
suffix?: string;
|
|
2104
|
+
svgSelector?: string;
|
|
2105
|
+
} | null;
|
|
2106
|
+
}
|
|
2107
|
+
declare function ReferencesPanel({ annotations, onAnnotationClick, focusedAnnotationId, hoveredAnnotationId, onAnnotationHover, onDetect, onCreate, isDetecting, detectionProgress, annotateMode, Link, routes, allEntityTypes, onCancelDetection, onSearchDocuments, onUpdate, onGenerateDocument, mediaType, referencedBy, referencedByLoading, pendingSelection, }: Props$1): react_jsx_runtime.JSX.Element;
|
|
2108
|
+
|
|
2109
|
+
interface Props {
|
|
2110
|
+
documentEntityTypes: string[];
|
|
2111
|
+
documentLocale?: string | undefined;
|
|
2112
|
+
primaryMediaType?: string | undefined;
|
|
2113
|
+
primaryByteSize?: number | undefined;
|
|
2114
|
+
isArchived?: boolean;
|
|
2115
|
+
onArchive?: () => void;
|
|
2116
|
+
onUnarchive?: () => void;
|
|
2117
|
+
onClone?: () => void;
|
|
2118
|
+
}
|
|
2119
|
+
declare function ResourceInfoPanel({ documentEntityTypes, documentLocale, primaryMediaType, primaryByteSize, isArchived, onArchive, onUnarchive, onClone }: Props): react_jsx_runtime.JSX.Element;
|
|
2120
|
+
|
|
2121
|
+
type Annotation$3 = components['schemas']['Annotation'];
|
|
2122
|
+
interface StatisticsPanelProps {
|
|
2123
|
+
highlights: Annotation$3[];
|
|
2124
|
+
comments: Annotation$3[];
|
|
2125
|
+
assessments: Annotation$3[];
|
|
2126
|
+
references: Annotation$3[];
|
|
2127
|
+
tags: Annotation$3[];
|
|
2128
|
+
}
|
|
2129
|
+
declare function StatisticsPanel({ highlights, comments, assessments, references, tags }: StatisticsPanelProps): react_jsx_runtime.JSX.Element;
|
|
2130
|
+
|
|
2131
|
+
type Annotation$2 = components['schemas']['Annotation'];
|
|
2132
|
+
interface TagEntryProps {
|
|
2133
|
+
tag: Annotation$2;
|
|
2134
|
+
isFocused: boolean;
|
|
2135
|
+
onClick: () => void;
|
|
2136
|
+
onTagRef: (tagId: string, el: HTMLElement | null) => void;
|
|
2137
|
+
onTagHover?: (tagId: string | null) => void;
|
|
2138
|
+
}
|
|
2139
|
+
declare function TagEntry({ tag, isFocused, onClick, onTagRef, onTagHover, }: TagEntryProps): react_jsx_runtime.JSX.Element;
|
|
2140
|
+
|
|
2141
|
+
type Annotation$1 = components['schemas']['Annotation'];
|
|
2142
|
+
interface TaggingPanelProps {
|
|
2143
|
+
annotations: Annotation$1[];
|
|
2144
|
+
onAnnotationClick: (annotation: Annotation$1) => void;
|
|
2145
|
+
focusedAnnotationId: string | null;
|
|
2146
|
+
hoveredAnnotationId?: string | null;
|
|
2147
|
+
onAnnotationHover?: (annotationId: string | null) => void;
|
|
2148
|
+
annotateMode?: boolean;
|
|
2149
|
+
onDetect?: (schemaId: string, categories: string[]) => void | Promise<void>;
|
|
2150
|
+
onCreate?: (selection: {
|
|
2151
|
+
exact: string;
|
|
2152
|
+
start: number;
|
|
2153
|
+
end: number;
|
|
2154
|
+
}, schemaId: string, category: string) => void | Promise<void>;
|
|
2155
|
+
isDetecting?: boolean;
|
|
2156
|
+
detectionProgress?: {
|
|
2157
|
+
status: string;
|
|
2158
|
+
percentage?: number;
|
|
2159
|
+
currentCategory?: string;
|
|
2160
|
+
processedCategories?: number;
|
|
2161
|
+
totalCategories?: number;
|
|
2162
|
+
message?: string;
|
|
2163
|
+
requestParams?: Array<{
|
|
2164
|
+
label: string;
|
|
2165
|
+
value: string;
|
|
2166
|
+
}>;
|
|
2167
|
+
} | null;
|
|
2168
|
+
pendingSelection?: {
|
|
2169
|
+
exact: string;
|
|
2170
|
+
start: number;
|
|
2171
|
+
end: number;
|
|
2172
|
+
} | null;
|
|
2173
|
+
}
|
|
2174
|
+
declare function TaggingPanel({ annotations, onAnnotationClick, focusedAnnotationId, hoveredAnnotationId, onAnnotationHover, annotateMode, onDetect, onCreate, isDetecting, detectionProgress, pendingSelection }: TaggingPanelProps): react_jsx_runtime.JSX.Element;
|
|
2175
|
+
|
|
2176
|
+
type Annotation = components['schemas']['Annotation'];
|
|
2177
|
+
type Motivation = components['schemas']['Motivation'];
|
|
2178
|
+
type AnnotatorKey = keyof typeof ANNOTATORS;
|
|
2179
|
+
type TabKey = 'statistics' | AnnotatorKey;
|
|
2180
|
+
/**
|
|
2181
|
+
* Simplified UnifiedAnnotationsPanel using Annotator abstraction
|
|
2182
|
+
*
|
|
2183
|
+
* Key simplifications:
|
|
2184
|
+
* - Single annotations array (grouped internally by motivation)
|
|
2185
|
+
* - Single focusedAnnotationId (motivation-agnostic)
|
|
2186
|
+
* - Single hoveredAnnotationId (motivation-agnostic)
|
|
2187
|
+
* - Annotators contain handlers (no explosion of onXClick, onXHover props)
|
|
2188
|
+
*/
|
|
2189
|
+
interface UnifiedAnnotationsPanelProps {
|
|
2190
|
+
annotations: Annotation[];
|
|
2191
|
+
annotators: Record<string, Annotator>;
|
|
2192
|
+
focusedAnnotationId: string | null;
|
|
2193
|
+
hoveredAnnotationId?: string | null;
|
|
2194
|
+
annotateMode?: boolean;
|
|
2195
|
+
detectingMotivation?: Motivation | null;
|
|
2196
|
+
detectionProgress?: {
|
|
2197
|
+
status: string;
|
|
2198
|
+
percentage?: number;
|
|
2199
|
+
message?: string;
|
|
2200
|
+
currentCategory?: string;
|
|
2201
|
+
processedCategories?: number;
|
|
2202
|
+
totalCategories?: number;
|
|
2203
|
+
} | null;
|
|
2204
|
+
pendingCommentSelection?: {
|
|
2205
|
+
exact: string;
|
|
2206
|
+
start: number;
|
|
2207
|
+
end: number;
|
|
2208
|
+
} | null;
|
|
2209
|
+
pendingTagSelection?: {
|
|
2210
|
+
exact: string;
|
|
2211
|
+
start: number;
|
|
2212
|
+
end: number;
|
|
2213
|
+
} | null;
|
|
2214
|
+
pendingReferenceSelection?: {
|
|
2215
|
+
exact: string;
|
|
2216
|
+
start: number;
|
|
2217
|
+
end: number;
|
|
2218
|
+
prefix?: string;
|
|
2219
|
+
suffix?: string;
|
|
2220
|
+
svgSelector?: string;
|
|
2221
|
+
} | null;
|
|
2222
|
+
allEntityTypes?: string[];
|
|
2223
|
+
generatingReferenceId?: string | null;
|
|
2224
|
+
onGenerateDocument?: (referenceId: string, options: {
|
|
2225
|
+
title: string;
|
|
2226
|
+
prompt?: string;
|
|
2227
|
+
}) => void;
|
|
2228
|
+
onSearchDocuments?: (referenceId: string, searchTerm: string) => void;
|
|
2229
|
+
onUpdateReference?: (referenceId: string, updates: Partial<Annotation>) => void;
|
|
2230
|
+
onCancelDetection?: () => void;
|
|
2231
|
+
mediaType?: string;
|
|
2232
|
+
referencedBy?: any[];
|
|
2233
|
+
referencedByLoading?: boolean;
|
|
2234
|
+
resourceId?: string;
|
|
2235
|
+
initialTab?: TabKey;
|
|
2236
|
+
Link: React__default.ComponentType<LinkComponentProps>;
|
|
2237
|
+
routes: RouteBuilder;
|
|
2238
|
+
}
|
|
2239
|
+
declare function UnifiedAnnotationsPanel(props: UnifiedAnnotationsPanelProps): react_jsx_runtime.JSX.Element;
|
|
2240
|
+
|
|
2241
|
+
interface ImageViewerProps {
|
|
2242
|
+
resourceUri: ResourceUri;
|
|
2243
|
+
mimeType: string;
|
|
2244
|
+
alt?: string;
|
|
2245
|
+
}
|
|
2246
|
+
declare function ImageViewer({ resourceUri, mimeType, alt }: ImageViewerProps): react_jsx_runtime.JSX.Element;
|
|
2247
|
+
|
|
2248
|
+
type TranslateFn$3 = (key: string, params?: Record<string, any>) => string;
|
|
2249
|
+
interface FooterProps {
|
|
2250
|
+
Link: React__default.ComponentType<LinkComponentProps>;
|
|
2251
|
+
routes: RouteBuilder;
|
|
2252
|
+
t: TranslateFn$3;
|
|
2253
|
+
CookiePreferences?: React__default.ComponentType<{
|
|
2254
|
+
isOpen: boolean;
|
|
2255
|
+
onClose: () => void;
|
|
2256
|
+
}>;
|
|
2257
|
+
onOpenKeyboardHelp?: () => void;
|
|
2258
|
+
apiDocsUrl?: string;
|
|
2259
|
+
sourceCodeUrl?: string;
|
|
2260
|
+
}
|
|
2261
|
+
declare function Footer({ Link, routes, t, CookiePreferences, onOpenKeyboardHelp, apiDocsUrl, sourceCodeUrl }: FooterProps): react_jsx_runtime.JSX.Element;
|
|
2262
|
+
|
|
2263
|
+
type TranslateFn$2 = (key: string, params?: Record<string, any>) => string;
|
|
2264
|
+
interface NavigationMenuProps {
|
|
2265
|
+
Link: React__default.ComponentType<LinkComponentProps>;
|
|
2266
|
+
routes: RouteBuilder;
|
|
2267
|
+
t: TranslateFn$2;
|
|
2268
|
+
isAdmin?: boolean;
|
|
2269
|
+
isModerator?: boolean;
|
|
2270
|
+
brandingLink?: string;
|
|
2271
|
+
onItemClick?: () => void;
|
|
2272
|
+
className?: string;
|
|
2273
|
+
}
|
|
2274
|
+
declare function NavigationMenu({ Link, routes, t, isAdmin, isModerator, brandingLink, onItemClick, className }: NavigationMenuProps): react_jsx_runtime.JSX.Element;
|
|
2275
|
+
|
|
2276
|
+
/**
|
|
2277
|
+
* Skip links for keyboard navigation accessibility
|
|
2278
|
+
* These links are visually hidden but become visible when focused
|
|
2279
|
+
* They allow keyboard users to quickly jump to main content areas
|
|
2280
|
+
*/
|
|
2281
|
+
declare function SkipLinks(): react_jsx_runtime.JSX.Element;
|
|
2282
|
+
|
|
2283
|
+
interface StatusDisplayProps {
|
|
2284
|
+
isFullyAuthenticated?: boolean;
|
|
2285
|
+
isAuthenticated?: boolean;
|
|
2286
|
+
hasValidBackendToken?: boolean;
|
|
2287
|
+
}
|
|
2288
|
+
declare function StatusDisplay({ isFullyAuthenticated, isAuthenticated, hasValidBackendToken }: StatusDisplayProps): react_jsx_runtime.JSX.Element;
|
|
2289
|
+
|
|
2290
|
+
declare function SessionTimer(): react_jsx_runtime.JSX.Element | null;
|
|
2291
|
+
|
|
2292
|
+
declare function SessionExpiryBanner(): react_jsx_runtime.JSX.Element | null;
|
|
2293
|
+
|
|
2294
|
+
declare function UserMenuSkeleton(): react_jsx_runtime.JSX.Element;
|
|
2295
|
+
|
|
2296
|
+
type TranslateFn$1 = (key: string) => string;
|
|
2297
|
+
interface SemiontBrandingProps {
|
|
2298
|
+
t: TranslateFn$1;
|
|
2299
|
+
className?: string;
|
|
2300
|
+
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
2301
|
+
showTagline?: boolean;
|
|
2302
|
+
animated?: boolean;
|
|
2303
|
+
compactTagline?: boolean;
|
|
2304
|
+
}
|
|
2305
|
+
declare function SemiontBranding({ t, className, size, showTagline, animated, compactTagline }: SemiontBrandingProps): react_jsx_runtime.JSX.Element;
|
|
2306
|
+
|
|
2307
|
+
/**
|
|
2308
|
+
* Translation function type for framework-agnostic components
|
|
2309
|
+
*/
|
|
2310
|
+
type TranslateFn = (key: string, params?: Record<string, any>) => string;
|
|
2311
|
+
|
|
2312
|
+
interface UnifiedHeaderProps {
|
|
2313
|
+
Link: React__default.ComponentType<LinkComponentProps>;
|
|
2314
|
+
routes: RouteBuilder;
|
|
2315
|
+
t: TranslateFn;
|
|
2316
|
+
tHome: TranslateFn;
|
|
2317
|
+
showBranding?: boolean;
|
|
2318
|
+
showAuthLinks?: boolean;
|
|
2319
|
+
brandingLink?: string;
|
|
2320
|
+
variant?: 'standalone' | 'embedded' | 'floating';
|
|
2321
|
+
isAuthenticated?: boolean;
|
|
2322
|
+
isAdmin?: boolean;
|
|
2323
|
+
isModerator?: boolean;
|
|
2324
|
+
}
|
|
2325
|
+
declare function UnifiedHeader({ Link, routes, t, tHome, showBranding, showAuthLinks, brandingLink, variant, isAuthenticated, isAdmin, isModerator }: UnifiedHeaderProps): react_jsx_runtime.JSX.Element;
|
|
2326
|
+
|
|
2327
|
+
interface LeftSidebarProps {
|
|
2328
|
+
Link: React__default.ComponentType<LinkComponentProps>;
|
|
2329
|
+
routes: RouteBuilder;
|
|
2330
|
+
t: TranslateFn;
|
|
2331
|
+
tHome: TranslateFn;
|
|
2332
|
+
children: React__default.ReactNode | ((isCollapsed: boolean, toggleCollapsed: () => void) => React__default.ReactNode);
|
|
2333
|
+
brandingLink?: string;
|
|
2334
|
+
collapsible?: boolean;
|
|
2335
|
+
storageKey?: string;
|
|
2336
|
+
isAuthenticated?: boolean;
|
|
2337
|
+
isAdmin?: boolean;
|
|
2338
|
+
isModerator?: boolean;
|
|
2339
|
+
}
|
|
2340
|
+
declare function LeftSidebar({ Link, routes, t, tHome, children, brandingLink, collapsible, storageKey, isAuthenticated, isAdmin, isModerator }: LeftSidebarProps): react_jsx_runtime.JSX.Element;
|
|
2341
|
+
|
|
2342
|
+
interface PageLayoutProps {
|
|
2343
|
+
Link: React__default.ComponentType<LinkComponentProps>;
|
|
2344
|
+
routes: RouteBuilder;
|
|
2345
|
+
t: TranslateFn;
|
|
2346
|
+
tNav: TranslateFn;
|
|
2347
|
+
tHome: TranslateFn;
|
|
2348
|
+
children: React__default.ReactNode;
|
|
2349
|
+
className?: string;
|
|
2350
|
+
showAuthLinks?: boolean;
|
|
2351
|
+
CookiePreferences?: React__default.ComponentType<{
|
|
2352
|
+
isOpen: boolean;
|
|
2353
|
+
onClose: () => void;
|
|
2354
|
+
}>;
|
|
2355
|
+
onOpenKeyboardHelp?: () => void;
|
|
2356
|
+
}
|
|
2357
|
+
declare function PageLayout({ Link, routes, t, tNav, tHome, children, className, showAuthLinks, CookiePreferences, onOpenKeyboardHelp }: PageLayoutProps): react_jsx_runtime.JSX.Element;
|
|
2358
|
+
|
|
2359
|
+
/**
|
|
2360
|
+
* ComposeLoadingState Component
|
|
2361
|
+
*
|
|
2362
|
+
* Simple loading state display for the compose page.
|
|
2363
|
+
*/
|
|
2364
|
+
interface ComposeLoadingStateProps {
|
|
2365
|
+
message: string;
|
|
2366
|
+
}
|
|
2367
|
+
declare function ComposeLoadingState({ message }: ComposeLoadingStateProps): react_jsx_runtime.JSX.Element;
|
|
2368
|
+
|
|
2369
|
+
/**
|
|
2370
|
+
* ResourceLoadingState - Loading state component for resource viewer
|
|
2371
|
+
*
|
|
2372
|
+
* Pure React component - no Next.js dependencies.
|
|
2373
|
+
*/
|
|
2374
|
+
declare function ResourceLoadingState(): react_jsx_runtime.JSX.Element;
|
|
2375
|
+
|
|
2376
|
+
/**
|
|
2377
|
+
* ResourceErrorState - Error state component for resource viewer
|
|
2378
|
+
*
|
|
2379
|
+
* Pure React component - no Next.js dependencies.
|
|
2380
|
+
*/
|
|
2381
|
+
interface ResourceErrorStateProps {
|
|
2382
|
+
error: unknown;
|
|
2383
|
+
onRetry: () => void;
|
|
2384
|
+
}
|
|
2385
|
+
declare function ResourceErrorState({ error, onRetry }: ResourceErrorStateProps): react_jsx_runtime.JSX.Element;
|
|
2386
|
+
|
|
2387
|
+
interface DevOpsFeature {
|
|
2388
|
+
title: string;
|
|
2389
|
+
description: string;
|
|
2390
|
+
icon: React__default.ComponentType<any>;
|
|
2391
|
+
available: string;
|
|
2392
|
+
}
|
|
2393
|
+
interface AdminDevOpsPageProps {
|
|
2394
|
+
suggestedFeatures: DevOpsFeature[];
|
|
2395
|
+
theme: 'light' | 'dark' | 'system';
|
|
2396
|
+
onThemeChange: (theme: 'light' | 'dark' | 'system') => void;
|
|
2397
|
+
showLineNumbers: boolean;
|
|
2398
|
+
onLineNumbersToggle: () => void;
|
|
2399
|
+
activePanel: string | null;
|
|
2400
|
+
onPanelToggle: (panel: string | null) => void;
|
|
2401
|
+
translations: {
|
|
2402
|
+
title: string;
|
|
2403
|
+
subtitle: string;
|
|
2404
|
+
systemStatus: string;
|
|
2405
|
+
cliOperations: string;
|
|
2406
|
+
cliOperationsDescription: string;
|
|
2407
|
+
cliTitle: string;
|
|
2408
|
+
cliDescription: string;
|
|
2409
|
+
};
|
|
2410
|
+
StatusDisplay: React__default.ComponentType<any>;
|
|
2411
|
+
ToolbarPanels: React__default.ComponentType<any>;
|
|
2412
|
+
Toolbar: React__default.ComponentType<any>;
|
|
2413
|
+
}
|
|
2414
|
+
declare function AdminDevOpsPage({ suggestedFeatures, theme, onThemeChange, showLineNumbers, onLineNumbersToggle, activePanel, onPanelToggle, translations: t, StatusDisplay, ToolbarPanels, Toolbar, }: AdminDevOpsPageProps): react_jsx_runtime.JSX.Element;
|
|
2415
|
+
|
|
2416
|
+
interface OAuthProvider {
|
|
2417
|
+
name: string;
|
|
2418
|
+
clientId?: string;
|
|
2419
|
+
}
|
|
2420
|
+
interface AdminSecurityPageProps {
|
|
2421
|
+
providers: OAuthProvider[];
|
|
2422
|
+
allowedDomains: string[];
|
|
2423
|
+
isLoading: boolean;
|
|
2424
|
+
theme: 'light' | 'dark' | 'system';
|
|
2425
|
+
onThemeChange: (theme: 'light' | 'dark' | 'system') => void;
|
|
2426
|
+
showLineNumbers: boolean;
|
|
2427
|
+
onLineNumbersToggle: () => void;
|
|
2428
|
+
activePanel: string | null;
|
|
2429
|
+
onPanelToggle: (panel: string | null) => void;
|
|
2430
|
+
translations: {
|
|
2431
|
+
title: string;
|
|
2432
|
+
subtitle: string;
|
|
2433
|
+
oauthProviders: string;
|
|
2434
|
+
oauthProvidersDescription: string;
|
|
2435
|
+
clientId: string;
|
|
2436
|
+
configured: string;
|
|
2437
|
+
noProvidersConfigured: string;
|
|
2438
|
+
allowedDomains: string;
|
|
2439
|
+
allowedDomainsDescription: string;
|
|
2440
|
+
noDomainsConfigured: string;
|
|
2441
|
+
configManagementTitle: string;
|
|
2442
|
+
configManagementDescription: string;
|
|
2443
|
+
configLocalDev: string;
|
|
2444
|
+
configCloudDeploy: string;
|
|
2445
|
+
configCloudDeployCommand: string;
|
|
2446
|
+
configCloudDeployEnd: string;
|
|
2447
|
+
configAWS: string;
|
|
2448
|
+
};
|
|
2449
|
+
ToolbarPanels: React__default.ComponentType<any>;
|
|
2450
|
+
Toolbar: React__default.ComponentType<any>;
|
|
2451
|
+
}
|
|
2452
|
+
declare function AdminSecurityPage({ providers, allowedDomains, isLoading, theme, onThemeChange, showLineNumbers, onLineNumbersToggle, activePanel, onPanelToggle, translations: t, ToolbarPanels, Toolbar, }: AdminSecurityPageProps): react_jsx_runtime.JSX.Element;
|
|
2453
|
+
|
|
2454
|
+
interface AdminUser {
|
|
2455
|
+
id: string;
|
|
2456
|
+
email: string;
|
|
2457
|
+
name?: string | null;
|
|
2458
|
+
domain: string;
|
|
2459
|
+
isAdmin: boolean;
|
|
2460
|
+
isActive: boolean;
|
|
2461
|
+
lastLogin?: string | null;
|
|
2462
|
+
created: string;
|
|
2463
|
+
}
|
|
2464
|
+
interface AdminUserStats {
|
|
2465
|
+
totalUsers: number;
|
|
2466
|
+
activeUsers: number;
|
|
2467
|
+
adminUsers: number;
|
|
2468
|
+
recentSignups: string[];
|
|
2469
|
+
}
|
|
2470
|
+
interface AdminUsersPageProps {
|
|
2471
|
+
users: AdminUser[];
|
|
2472
|
+
userStats: AdminUserStats | null;
|
|
2473
|
+
isLoadingUsers: boolean;
|
|
2474
|
+
isLoadingStats: boolean;
|
|
2475
|
+
onUpdateUser: (id: string, data: {
|
|
2476
|
+
isAdmin?: boolean;
|
|
2477
|
+
isActive?: boolean;
|
|
2478
|
+
}) => void;
|
|
2479
|
+
onDeleteUser: (id: string) => void;
|
|
2480
|
+
onAddUser: () => void;
|
|
2481
|
+
onExportUsers: () => void;
|
|
2482
|
+
theme: 'light' | 'dark' | 'system';
|
|
2483
|
+
onThemeChange: (theme: 'light' | 'dark' | 'system') => void;
|
|
2484
|
+
showLineNumbers: boolean;
|
|
2485
|
+
onLineNumbersToggle: () => void;
|
|
2486
|
+
activePanel: string | null;
|
|
2487
|
+
onPanelToggle: (panel: string | null) => void;
|
|
2488
|
+
translations: {
|
|
2489
|
+
title: string;
|
|
2490
|
+
subtitle: string;
|
|
2491
|
+
addUser: string;
|
|
2492
|
+
totalUsers: string;
|
|
2493
|
+
activeUsers: string;
|
|
2494
|
+
administrators: string;
|
|
2495
|
+
recentUsers: string;
|
|
2496
|
+
searchUsers: string;
|
|
2497
|
+
searchPlaceholder: string;
|
|
2498
|
+
role: string;
|
|
2499
|
+
allRoles: string;
|
|
2500
|
+
admin: string;
|
|
2501
|
+
user: string;
|
|
2502
|
+
status: string;
|
|
2503
|
+
allStatus: string;
|
|
2504
|
+
active: string;
|
|
2505
|
+
inactive: string;
|
|
2506
|
+
exportUsers: string;
|
|
2507
|
+
loadingUsers: string;
|
|
2508
|
+
userColumn: string;
|
|
2509
|
+
domainColumn: string;
|
|
2510
|
+
roleColumn: string;
|
|
2511
|
+
statusColumn: string;
|
|
2512
|
+
lastLoginColumn: string;
|
|
2513
|
+
joinedColumn: string;
|
|
2514
|
+
actionsColumn: string;
|
|
2515
|
+
noUsersFound: string;
|
|
2516
|
+
noUsersFoundDescription: string;
|
|
2517
|
+
noName: string;
|
|
2518
|
+
never: string;
|
|
2519
|
+
removeAdmin: string;
|
|
2520
|
+
makeAdmin: string;
|
|
2521
|
+
deactivateUser: string;
|
|
2522
|
+
activateUser: string;
|
|
2523
|
+
deleteUser: string;
|
|
2524
|
+
};
|
|
2525
|
+
ToolbarPanels: React__default.ComponentType<any>;
|
|
2526
|
+
Toolbar: React__default.ComponentType<any>;
|
|
2527
|
+
buttonStyles: {
|
|
2528
|
+
primary: {
|
|
2529
|
+
base: string;
|
|
2530
|
+
};
|
|
2531
|
+
secondary: {
|
|
2532
|
+
base: string;
|
|
2533
|
+
};
|
|
2534
|
+
};
|
|
2535
|
+
}
|
|
2536
|
+
declare function AdminUsersPage({ users, userStats, isLoadingUsers, isLoadingStats, onUpdateUser, onDeleteUser, onAddUser, onExportUsers, theme, onThemeChange, showLineNumbers, onLineNumbersToggle, activePanel, onPanelToggle, translations: t, ToolbarPanels, Toolbar, buttonStyles, }: AdminUsersPageProps): react_jsx_runtime.JSX.Element;
|
|
2537
|
+
|
|
2538
|
+
interface SignInFormProps {
|
|
2539
|
+
/**
|
|
2540
|
+
* Callback when user clicks Google sign-in
|
|
2541
|
+
*/
|
|
2542
|
+
onGoogleSignIn: () => Promise<void>;
|
|
2543
|
+
/**
|
|
2544
|
+
* Callback when user submits email/password credentials
|
|
2545
|
+
*/
|
|
2546
|
+
onCredentialsSignIn?: ((email: string, password: string) => Promise<void>) | undefined;
|
|
2547
|
+
/**
|
|
2548
|
+
* Error message to display (if any)
|
|
2549
|
+
*/
|
|
2550
|
+
error?: string | null;
|
|
2551
|
+
/**
|
|
2552
|
+
* Whether to show email/password auth form
|
|
2553
|
+
*/
|
|
2554
|
+
showCredentialsAuth?: boolean;
|
|
2555
|
+
/**
|
|
2556
|
+
* Link component for routing - passed from parent
|
|
2557
|
+
*/
|
|
2558
|
+
Link: React__default.ComponentType<any>;
|
|
2559
|
+
/**
|
|
2560
|
+
* Translation strings
|
|
2561
|
+
*/
|
|
2562
|
+
translations: {
|
|
2563
|
+
pageTitle: string;
|
|
2564
|
+
welcomeBack: string;
|
|
2565
|
+
signInPrompt: string;
|
|
2566
|
+
continueWithGoogle: string;
|
|
2567
|
+
emailLabel: string;
|
|
2568
|
+
emailPlaceholder: string;
|
|
2569
|
+
passwordLabel: string;
|
|
2570
|
+
passwordPlaceholder: string;
|
|
2571
|
+
signInWithCredentials: string;
|
|
2572
|
+
or: string;
|
|
2573
|
+
credentialsAuthEnabled: string;
|
|
2574
|
+
approvedDomainsOnly: string;
|
|
2575
|
+
backToHome: string;
|
|
2576
|
+
learnMore: string;
|
|
2577
|
+
signUpInstead: string;
|
|
2578
|
+
errorEmailRequired: string;
|
|
2579
|
+
errorPasswordRequired: string;
|
|
2580
|
+
tagline: string;
|
|
2581
|
+
};
|
|
2582
|
+
}
|
|
2583
|
+
/**
|
|
2584
|
+
* SignInForm - Main sign-in component
|
|
2585
|
+
*/
|
|
2586
|
+
declare function SignInForm({ onGoogleSignIn, onCredentialsSignIn, error, showCredentialsAuth, Link, translations: t, }: SignInFormProps): react_jsx_runtime.JSX.Element;
|
|
2587
|
+
|
|
2588
|
+
interface SignUpFormProps {
|
|
2589
|
+
/**
|
|
2590
|
+
* Link component for routing - passed from parent
|
|
2591
|
+
*/
|
|
2592
|
+
Link: React__default.ComponentType<any>;
|
|
2593
|
+
/**
|
|
2594
|
+
* Callback when user clicks the Google sign-up button
|
|
2595
|
+
*/
|
|
2596
|
+
onSignUp: () => Promise<void>;
|
|
2597
|
+
/**
|
|
2598
|
+
* Translation strings for the form
|
|
2599
|
+
*/
|
|
2600
|
+
translations: {
|
|
2601
|
+
pageTitle: string;
|
|
2602
|
+
signUpPrompt: string;
|
|
2603
|
+
signUpWithGoogle: string;
|
|
2604
|
+
creatingAccount: string;
|
|
2605
|
+
approvedDomainsInfo: string;
|
|
2606
|
+
termsAgreement: string;
|
|
2607
|
+
alreadyHaveAccount: string;
|
|
2608
|
+
};
|
|
2609
|
+
}
|
|
2610
|
+
/**
|
|
2611
|
+
* SignUpForm component
|
|
2612
|
+
*
|
|
2613
|
+
* Renders the sign-up form with Google OAuth button.
|
|
2614
|
+
* Manages loading state internally.
|
|
2615
|
+
*/
|
|
2616
|
+
declare function SignUpForm({ onSignUp, Link, translations: t }: SignUpFormProps): react_jsx_runtime.JSX.Element;
|
|
2617
|
+
|
|
2618
|
+
interface AuthErrorDisplayProps {
|
|
2619
|
+
/**
|
|
2620
|
+
* Link component for routing - passed from parent
|
|
2621
|
+
*/
|
|
2622
|
+
Link: React__default.ComponentType<any>;
|
|
2623
|
+
/**
|
|
2624
|
+
* Error type from URL parameter
|
|
2625
|
+
*/
|
|
2626
|
+
errorType: string | null;
|
|
2627
|
+
/**
|
|
2628
|
+
* Translation strings
|
|
2629
|
+
*/
|
|
2630
|
+
translations: {
|
|
2631
|
+
pageTitle: string;
|
|
2632
|
+
tryAgain: string;
|
|
2633
|
+
errorConfiguration: string;
|
|
2634
|
+
errorAccessDenied: string;
|
|
2635
|
+
errorVerification: string;
|
|
2636
|
+
errorGeneric: string;
|
|
2637
|
+
};
|
|
2638
|
+
}
|
|
2639
|
+
/**
|
|
2640
|
+
* AuthErrorDisplay component
|
|
2641
|
+
*
|
|
2642
|
+
* Displays authentication error messages with a link to try again.
|
|
2643
|
+
*/
|
|
2644
|
+
declare function AuthErrorDisplay({ errorType, Link, translations: t }: AuthErrorDisplayProps): react_jsx_runtime.JSX.Element;
|
|
2645
|
+
|
|
2646
|
+
interface WelcomePageProps {
|
|
2647
|
+
userName?: string;
|
|
2648
|
+
termsAcceptedAt?: string | null;
|
|
2649
|
+
isNewUser?: boolean;
|
|
2650
|
+
status: 'loading' | 'accepted' | 'form';
|
|
2651
|
+
isProcessing: boolean;
|
|
2652
|
+
onAccept: () => void;
|
|
2653
|
+
onDecline: () => void;
|
|
2654
|
+
translations: {
|
|
2655
|
+
loading: string;
|
|
2656
|
+
welcomeTitle: string;
|
|
2657
|
+
thanksForAccepting: string;
|
|
2658
|
+
welcomeUser: string;
|
|
2659
|
+
reviewTermsPrompt: string;
|
|
2660
|
+
termsSummaryTitle: string;
|
|
2661
|
+
termsSummaryIntro: string;
|
|
2662
|
+
acceptableUseTitle: string;
|
|
2663
|
+
acceptableUseResponsible: string;
|
|
2664
|
+
acceptableUseRespect: string;
|
|
2665
|
+
acceptableUseConduct: string;
|
|
2666
|
+
prohibitedContentTitle: string;
|
|
2667
|
+
prohibitedContentIntro: string;
|
|
2668
|
+
prohibitedIllegal: string;
|
|
2669
|
+
prohibitedAdult: string;
|
|
2670
|
+
prohibitedHate: string;
|
|
2671
|
+
prohibitedViolence: string;
|
|
2672
|
+
prohibitedMisinformation: string;
|
|
2673
|
+
prohibitedPrivacy: string;
|
|
2674
|
+
prohibitedCopyright: string;
|
|
2675
|
+
prohibitedMalware: string;
|
|
2676
|
+
prohibitedSpam: string;
|
|
2677
|
+
conductTitle: string;
|
|
2678
|
+
conductDescription: string;
|
|
2679
|
+
conductLink: string;
|
|
2680
|
+
conductPromotion: string;
|
|
2681
|
+
responsibilitiesTitle: string;
|
|
2682
|
+
responsibilitiesSecure: string;
|
|
2683
|
+
responsibilitiesReport: string;
|
|
2684
|
+
responsibilitiesAccurate: string;
|
|
2685
|
+
responsibilitiesComply: string;
|
|
2686
|
+
violationsWarning: string;
|
|
2687
|
+
readFullTerms: string;
|
|
2688
|
+
termsOfService: string;
|
|
2689
|
+
and: string;
|
|
2690
|
+
privacyPolicy: string;
|
|
2691
|
+
declineAndSignOut: string;
|
|
2692
|
+
acceptAndContinue: string;
|
|
2693
|
+
processing: string;
|
|
2694
|
+
legallyBound: string;
|
|
2695
|
+
};
|
|
2696
|
+
PageLayout: React__default.ComponentType<any>;
|
|
2697
|
+
Link: React__default.ComponentType<any>;
|
|
2698
|
+
}
|
|
2699
|
+
declare function WelcomePage({ userName, status, isProcessing, onAccept, onDecline, translations: t, PageLayout, Link, }: WelcomePageProps): react_jsx_runtime.JSX.Element;
|
|
2700
|
+
|
|
2701
|
+
interface EntityTagsPageProps {
|
|
2702
|
+
entityTypes: string[];
|
|
2703
|
+
isLoading: boolean;
|
|
2704
|
+
error: string;
|
|
2705
|
+
newTag: string;
|
|
2706
|
+
onNewTagChange: (value: string) => void;
|
|
2707
|
+
onAddTag: () => void;
|
|
2708
|
+
isAddingTag: boolean;
|
|
2709
|
+
theme: 'light' | 'dark' | 'system';
|
|
2710
|
+
onThemeChange: (theme: 'light' | 'dark' | 'system') => void;
|
|
2711
|
+
showLineNumbers: boolean;
|
|
2712
|
+
onLineNumbersToggle: () => void;
|
|
2713
|
+
activePanel: string | null;
|
|
2714
|
+
onPanelToggle: (panel: string | null) => void;
|
|
2715
|
+
translations: {
|
|
2716
|
+
pageTitle: string;
|
|
2717
|
+
pageDescription: string;
|
|
2718
|
+
sectionTitle: string;
|
|
2719
|
+
sectionDescription: string;
|
|
2720
|
+
inputPlaceholder: string;
|
|
2721
|
+
addTag: string;
|
|
2722
|
+
adding: string;
|
|
2723
|
+
};
|
|
2724
|
+
ToolbarPanels: React__default.ComponentType<any>;
|
|
2725
|
+
Toolbar: React__default.ComponentType<any>;
|
|
2726
|
+
}
|
|
2727
|
+
declare function EntityTagsPage({ entityTypes, isLoading, error, newTag, onNewTagChange, onAddTag, isAddingTag, theme, onThemeChange, showLineNumbers, onLineNumbersToggle, activePanel, onPanelToggle, translations: t, ToolbarPanels, Toolbar, }: EntityTagsPageProps): react_jsx_runtime.JSX.Element;
|
|
2728
|
+
|
|
2729
|
+
interface RecentDocumentsPageProps {
|
|
2730
|
+
hasDocuments: boolean;
|
|
2731
|
+
isLoading: boolean;
|
|
2732
|
+
theme: 'light' | 'dark' | 'system';
|
|
2733
|
+
onThemeChange: (theme: 'light' | 'dark' | 'system') => void;
|
|
2734
|
+
showLineNumbers: boolean;
|
|
2735
|
+
onLineNumbersToggle: () => void;
|
|
2736
|
+
activePanel: string | null;
|
|
2737
|
+
onPanelToggle: (panel: string | null) => void;
|
|
2738
|
+
translations: {
|
|
2739
|
+
pageTitle: string;
|
|
2740
|
+
pageDescription: string;
|
|
2741
|
+
sectionTitle: string;
|
|
2742
|
+
sectionDescription: string;
|
|
2743
|
+
noDocuments: string;
|
|
2744
|
+
activityWillAppear: string;
|
|
2745
|
+
loading: string;
|
|
2746
|
+
};
|
|
2747
|
+
ToolbarPanels: React__default.ComponentType<any>;
|
|
2748
|
+
Toolbar: React__default.ComponentType<any>;
|
|
2749
|
+
}
|
|
2750
|
+
declare function RecentDocumentsPage({ hasDocuments, isLoading, theme, onThemeChange, showLineNumbers, onLineNumbersToggle, activePanel, onPanelToggle, translations: t, ToolbarPanels, Toolbar, }: RecentDocumentsPageProps): react_jsx_runtime.JSX.Element;
|
|
2751
|
+
|
|
2752
|
+
interface TagSchemasPageProps {
|
|
2753
|
+
schemas: TagSchema[];
|
|
2754
|
+
isLoading: boolean;
|
|
2755
|
+
theme: 'light' | 'dark' | 'system';
|
|
2756
|
+
onThemeChange: (theme: 'light' | 'dark' | 'system') => void;
|
|
2757
|
+
showLineNumbers: boolean;
|
|
2758
|
+
onLineNumbersToggle: () => void;
|
|
2759
|
+
activePanel: string | null;
|
|
2760
|
+
onPanelToggle: (panel: string | null) => void;
|
|
2761
|
+
translations: {
|
|
2762
|
+
pageTitle: string;
|
|
2763
|
+
pageDescription: string;
|
|
2764
|
+
categories: string;
|
|
2765
|
+
loading: string;
|
|
2766
|
+
};
|
|
2767
|
+
ToolbarPanels: React__default.ComponentType<any>;
|
|
2768
|
+
Toolbar: React__default.ComponentType<any>;
|
|
2769
|
+
}
|
|
2770
|
+
declare function TagSchemasPage({ schemas, isLoading, theme, onThemeChange, showLineNumbers, onLineNumbersToggle, activePanel, onPanelToggle, translations: t, ToolbarPanels, Toolbar, }: TagSchemasPageProps): react_jsx_runtime.JSX.Element;
|
|
2771
|
+
|
|
2772
|
+
type ResourceDescriptor$2 = components['schemas']['ResourceDescriptor'];
|
|
2773
|
+
interface ResourceComposePageProps {
|
|
2774
|
+
mode: 'new' | 'clone' | 'reference';
|
|
2775
|
+
cloneData?: {
|
|
2776
|
+
sourceResource: ResourceDescriptor$2;
|
|
2777
|
+
sourceContent: string;
|
|
2778
|
+
};
|
|
2779
|
+
referenceData?: {
|
|
2780
|
+
referenceId: string;
|
|
2781
|
+
sourceDocumentId: string;
|
|
2782
|
+
name: string;
|
|
2783
|
+
entityTypes: string[];
|
|
2784
|
+
};
|
|
2785
|
+
availableEntityTypes: string[];
|
|
2786
|
+
initialLocale: string;
|
|
2787
|
+
theme: 'light' | 'dark';
|
|
2788
|
+
onThemeChange: (theme: 'light' | 'dark') => void;
|
|
2789
|
+
showLineNumbers: boolean;
|
|
2790
|
+
onLineNumbersToggle: () => void;
|
|
2791
|
+
activePanel: string | null;
|
|
2792
|
+
onPanelToggle: (panel: string) => void;
|
|
2793
|
+
onSaveResource: (params: SaveResourceParams) => Promise<void>;
|
|
2794
|
+
onCancel: () => void;
|
|
2795
|
+
translations: {
|
|
2796
|
+
title: string;
|
|
2797
|
+
titleEditClone: string;
|
|
2798
|
+
titleCompleteReference: string;
|
|
2799
|
+
subtitleClone: string;
|
|
2800
|
+
subtitleReference: string;
|
|
2801
|
+
linkedNoticePrefix: string;
|
|
2802
|
+
resourceName: string;
|
|
2803
|
+
resourceNamePlaceholder: string;
|
|
2804
|
+
entityTypes: string;
|
|
2805
|
+
language: string;
|
|
2806
|
+
contentSource: string;
|
|
2807
|
+
uploadFile: string;
|
|
2808
|
+
uploadFileDescription: string;
|
|
2809
|
+
writeContent: string;
|
|
2810
|
+
writeContentDescription: string;
|
|
2811
|
+
dropFileOrClick: string;
|
|
2812
|
+
supportedFormats: string;
|
|
2813
|
+
mediaType: string;
|
|
2814
|
+
autoDetected: string;
|
|
2815
|
+
format: string;
|
|
2816
|
+
content: string;
|
|
2817
|
+
resourceContent: string;
|
|
2818
|
+
encoding: string;
|
|
2819
|
+
archiveOriginal: string;
|
|
2820
|
+
cancel: string;
|
|
2821
|
+
saving: string;
|
|
2822
|
+
creating: string;
|
|
2823
|
+
creatingAndLinking: string;
|
|
2824
|
+
saveClonedResource: string;
|
|
2825
|
+
createAndLinkResource: string;
|
|
2826
|
+
createResource: string;
|
|
2827
|
+
};
|
|
2828
|
+
ToolbarPanels: React__default.ComponentType<any>;
|
|
2829
|
+
Toolbar: React__default.ComponentType<any>;
|
|
2830
|
+
}
|
|
2831
|
+
interface SaveResourceParams {
|
|
2832
|
+
mode: 'new' | 'clone' | 'reference';
|
|
2833
|
+
name: string;
|
|
2834
|
+
content?: string;
|
|
2835
|
+
file?: File;
|
|
2836
|
+
format?: string;
|
|
2837
|
+
charset?: string;
|
|
2838
|
+
entityTypes?: string[];
|
|
2839
|
+
language: string;
|
|
2840
|
+
archiveOriginal?: boolean;
|
|
2841
|
+
referenceId?: string;
|
|
2842
|
+
sourceDocumentId?: string;
|
|
2843
|
+
}
|
|
2844
|
+
declare function ResourceComposePage({ mode, cloneData, referenceData, availableEntityTypes, initialLocale, theme, onThemeChange, showLineNumbers, onLineNumbersToggle, activePanel, onPanelToggle, onSaveResource, onCancel, translations: t, ToolbarPanels, Toolbar, }: ResourceComposePageProps): react_jsx_runtime.JSX.Element;
|
|
2845
|
+
|
|
2846
|
+
type ResourceDescriptor$1 = components['schemas']['ResourceDescriptor'];
|
|
2847
|
+
interface ResourceDiscoveryPageProps {
|
|
2848
|
+
recentDocuments: ResourceDescriptor$1[];
|
|
2849
|
+
searchDocuments: ResourceDescriptor$1[];
|
|
2850
|
+
entityTypes: string[];
|
|
2851
|
+
isLoadingRecent: boolean;
|
|
2852
|
+
isSearching: boolean;
|
|
2853
|
+
theme: 'light' | 'dark';
|
|
2854
|
+
onThemeChange: (theme: 'light' | 'dark') => void;
|
|
2855
|
+
showLineNumbers: boolean;
|
|
2856
|
+
onLineNumbersToggle: () => void;
|
|
2857
|
+
activePanel: string | null;
|
|
2858
|
+
onPanelToggle: (panel: string) => void;
|
|
2859
|
+
onNavigateToResource: (resourceId: string) => void;
|
|
2860
|
+
onNavigateToCompose: () => void;
|
|
2861
|
+
translations: {
|
|
2862
|
+
title: string;
|
|
2863
|
+
subtitle: string;
|
|
2864
|
+
searchPlaceholder: string;
|
|
2865
|
+
searchButton: string;
|
|
2866
|
+
searching: string;
|
|
2867
|
+
filterByEntityType: string;
|
|
2868
|
+
all: string;
|
|
2869
|
+
recentResources: string;
|
|
2870
|
+
searchResults: (count: number) => string;
|
|
2871
|
+
documentsTaggedWith: (entityType: string) => string;
|
|
2872
|
+
noResultsFound: (query: string) => string;
|
|
2873
|
+
noResourcesAvailable: string;
|
|
2874
|
+
composeFirstResource: string;
|
|
2875
|
+
archived: string;
|
|
2876
|
+
created: string;
|
|
2877
|
+
loadingKnowledgeBase: string;
|
|
2878
|
+
};
|
|
2879
|
+
ToolbarPanels: React__default.ComponentType<any>;
|
|
2880
|
+
}
|
|
2881
|
+
declare function ResourceDiscoveryPage({ recentDocuments, searchDocuments, entityTypes, isLoadingRecent, isSearching, theme, onThemeChange, showLineNumbers, onLineNumbersToggle, activePanel, onPanelToggle, onNavigateToResource, onNavigateToCompose, translations: t, ToolbarPanels, }: ResourceDiscoveryPageProps): react_jsx_runtime.JSX.Element;
|
|
2882
|
+
|
|
2883
|
+
type ResourceDescriptor = components['schemas']['ResourceDescriptor'];
|
|
2884
|
+
interface ResourceCardProps {
|
|
2885
|
+
resource: ResourceDescriptor;
|
|
2886
|
+
onOpen: (resource: ResourceDescriptor) => void;
|
|
2887
|
+
tabIndex?: number;
|
|
2888
|
+
archivedLabel: string;
|
|
2889
|
+
createdLabel: string;
|
|
2890
|
+
}
|
|
2891
|
+
declare const ResourceCard: React__default.MemoExoticComponent<({ resource, onOpen, tabIndex, archivedLabel, createdLabel }: ResourceCardProps) => react_jsx_runtime.JSX.Element>;
|
|
2892
|
+
|
|
2893
|
+
interface ResourceViewerPageProps {
|
|
2894
|
+
/**
|
|
2895
|
+
* The resource to display
|
|
2896
|
+
*/
|
|
2897
|
+
resource: SemiontResource$2;
|
|
2898
|
+
/**
|
|
2899
|
+
* Resource URI
|
|
2900
|
+
*/
|
|
2901
|
+
rUri: ResourceUri;
|
|
2902
|
+
/**
|
|
2903
|
+
* Document content (already loaded)
|
|
2904
|
+
*/
|
|
2905
|
+
content: string;
|
|
2906
|
+
/**
|
|
2907
|
+
* Whether content is still loading
|
|
2908
|
+
*/
|
|
2909
|
+
contentLoading: boolean;
|
|
2910
|
+
/**
|
|
2911
|
+
* All annotations for this resource
|
|
2912
|
+
*/
|
|
2913
|
+
annotations: Annotation$m[];
|
|
2914
|
+
/**
|
|
2915
|
+
* Resources that reference this resource
|
|
2916
|
+
*/
|
|
2917
|
+
referencedBy: any[];
|
|
2918
|
+
/**
|
|
2919
|
+
* Whether referencedBy is loading
|
|
2920
|
+
*/
|
|
2921
|
+
referencedByLoading: boolean;
|
|
2922
|
+
/**
|
|
2923
|
+
* All available entity types
|
|
2924
|
+
*/
|
|
2925
|
+
allEntityTypes: string[];
|
|
2926
|
+
/**
|
|
2927
|
+
* Current locale
|
|
2928
|
+
*/
|
|
2929
|
+
locale: string;
|
|
2930
|
+
/**
|
|
2931
|
+
* Theme state
|
|
2932
|
+
*/
|
|
2933
|
+
theme: any;
|
|
2934
|
+
onThemeChange: (theme: any) => void;
|
|
2935
|
+
/**
|
|
2936
|
+
* Line numbers state
|
|
2937
|
+
*/
|
|
2938
|
+
showLineNumbers: boolean;
|
|
2939
|
+
onLineNumbersToggle: () => void;
|
|
2940
|
+
/**
|
|
2941
|
+
* Active toolbar panel
|
|
2942
|
+
*/
|
|
2943
|
+
activePanel: any;
|
|
2944
|
+
onPanelToggle: (panel: any) => void;
|
|
2945
|
+
setActivePanel: (panel: any) => void;
|
|
2946
|
+
/**
|
|
2947
|
+
* Callbacks for resource actions
|
|
2948
|
+
*/
|
|
2949
|
+
onUpdateDocumentTags: (tags: string[]) => Promise<void>;
|
|
2950
|
+
onArchive: () => Promise<void>;
|
|
2951
|
+
onUnarchive: () => Promise<void>;
|
|
2952
|
+
onClone: () => Promise<void>;
|
|
2953
|
+
onUpdateAnnotationBody: (annotationUri: string, data: any) => Promise<void>;
|
|
2954
|
+
onRefetchAnnotations: () => Promise<void>;
|
|
2955
|
+
/**
|
|
2956
|
+
* Annotation CRUD callbacks
|
|
2957
|
+
*/
|
|
2958
|
+
onCreateAnnotation: (rUri: ResourceUri, motivation: Motivation$2, selector: any, body: any[]) => Promise<void>;
|
|
2959
|
+
onDeleteAnnotation: (annotationId: string) => Promise<void>;
|
|
2960
|
+
onTriggerSparkleAnimation: (annotationId: string) => void;
|
|
2961
|
+
onClearNewAnnotationId: (annotationId: string) => void;
|
|
2962
|
+
/**
|
|
2963
|
+
* Toast notifications
|
|
2964
|
+
*/
|
|
2965
|
+
showSuccess: (message: string) => void;
|
|
2966
|
+
showError: (message: string) => void;
|
|
2967
|
+
/**
|
|
2968
|
+
* Real-time event handlers
|
|
2969
|
+
*/
|
|
2970
|
+
onAnnotationAdded: (event: any) => void;
|
|
2971
|
+
onAnnotationRemoved: (event: any) => void;
|
|
2972
|
+
onAnnotationBodyUpdated: (event: any) => void;
|
|
2973
|
+
onDocumentArchived: (event: any) => void;
|
|
2974
|
+
onDocumentUnarchived: (event: any) => void;
|
|
2975
|
+
onEntityTagAdded: (event: any) => void;
|
|
2976
|
+
onEntityTagRemoved: (event: any) => void;
|
|
2977
|
+
onEventError: (error: any) => void;
|
|
2978
|
+
/**
|
|
2979
|
+
* Cache manager for detection
|
|
2980
|
+
*/
|
|
2981
|
+
cacheManager: any;
|
|
2982
|
+
/**
|
|
2983
|
+
* API client
|
|
2984
|
+
*/
|
|
2985
|
+
client: any;
|
|
2986
|
+
/**
|
|
2987
|
+
* Link component for routing
|
|
2988
|
+
*/
|
|
2989
|
+
Link: React__default.ComponentType<any>;
|
|
2990
|
+
/**
|
|
2991
|
+
* Routes configuration
|
|
2992
|
+
*/
|
|
2993
|
+
routes: any;
|
|
2994
|
+
/**
|
|
2995
|
+
* Component dependencies - passed from frontend
|
|
2996
|
+
*/
|
|
2997
|
+
ToolbarPanels: React__default.ComponentType<any>;
|
|
2998
|
+
SearchResourcesModal: React__default.ComponentType<any>;
|
|
2999
|
+
GenerationConfigModal: React__default.ComponentType<any>;
|
|
3000
|
+
}
|
|
3001
|
+
declare function ResourceViewerPage({ resource, rUri, content, contentLoading, annotations, referencedBy, referencedByLoading, allEntityTypes, locale, theme, onThemeChange, showLineNumbers, onLineNumbersToggle, activePanel, onPanelToggle, setActivePanel, onUpdateDocumentTags, onArchive, onUnarchive, onClone, onUpdateAnnotationBody, onRefetchAnnotations, onCreateAnnotation, onDeleteAnnotation, onTriggerSparkleAnimation, onClearNewAnnotationId, showSuccess, showError, onAnnotationAdded, onAnnotationRemoved, onAnnotationBodyUpdated, onDocumentArchived, onDocumentUnarchived, onEntityTagAdded, onEntityTagRemoved, onEventError, cacheManager, client, Link, routes, ToolbarPanels, SearchResourcesModal, GenerationConfigModal, }: ResourceViewerPageProps): react_jsx_runtime.JSX.Element;
|
|
3002
|
+
|
|
3003
|
+
export { ANNOTATORS, AUTH_EVENTS, AVAILABLE_LOCALES, AdminDevOpsPage, type AdminDevOpsPageProps, AdminSecurityPage, type AdminSecurityPageProps, type AdminUser, type AdminUserStats, AdminUsersPage, type AdminUsersPageProps, AnnotateToolbar, AnnotateView, type Annotation$m as Annotation, type AnnotationConfig, type AnnotationCreationHandler, type AnnotationHandlers, AnnotationHistory, type AnnotationManager, AnnotationOverlay, AnnotationProvider, type AnnotationProviderProps, AnnotationUIProvider, type AnnotationUIProviderProps, type AnnotationUIState, type AnnotationsCollection, type Annotator, ApiClientManager, ApiClientProvider, type ApiClientProviderProps, AssessmentEntry, AssessmentPanel, AsyncErrorBoundary, AuthErrorDisplay, type AuthErrorDisplayProps, type AuthEventDetail, type AuthEventType, type AvailableLocale, BrowseView, type CacheManager, CacheProvider, type CacheProviderProps, type ClickAction, CodeMirrorRenderer, CollaborationPanel, CommentEntry, CommentsPanel, ComposeLoadingState, type ComposeLoadingStateProps, type CreateAnnotationParams, type DeleteAnnotationParams, DetectSection, type DetectionConfig, type DetectionProgress, DetectionProgressWidget, type DevOpsFeature, type DrawingMode, EntityTagsPage, type EntityTagsPageProps, EntityTypeBadges, ErrorBoundary, Footer, type GenerationOptions, type GenerationProgress, HighlightEntry, HighlightPanel, HistoryEvent, ImageURLSchema, ImageViewer, JsonLdPanel, JsonLdView, type KeyboardShortcut, KeyboardShortcutsHelpModal, LeftSidebar, type LinkComponentProps, LiveRegionProvider, type Motivation$2 as Motivation, NavigationMenu, type OAuthProvider, type OAuthUser, OAuthUserSchema, OpenResourcesManager, OpenResourcesProvider, PageLayout, PanelHeader, PopupContainer, PopupHeader, type PreparedAnnotation, ProposeEntitiesModal, QUERY_KEYS, RecentDocumentsPage, type RecentDocumentsPageProps, ReferenceEntry, ReferenceResolutionWidget, ReferencesPanel, ResourceAnnotationsProvider, ResourceCard, type ResourceCardProps, ResourceComposePage, type ResourceComposePageProps, ResourceDiscoveryPage, type ResourceDiscoveryPageProps, ResourceErrorState, type ResourceErrorStateProps, type ResourceEvent, ResourceInfoPanel, ResourceLoadingState, ResourceTagsInline, ResourceViewer, ResourceViewerPage, type ResourceViewerPageProps, type RouteBuilder, type SaveResourceParams, SelectedTextDisplay, type SelectionData, type SelectionMotivation, SemiontBranding, type SemiontResource$2 as SemiontResource, SessionExpiryBanner, SessionManager, SessionProvider, SessionTimer, type ShapeType, SignInForm, type SignInFormProps, SignUpForm, type SignUpFormProps, SkipLinks, StatisticsPanel, StatusDisplay, type StreamStatus, SvgDrawingCanvas, TagEntry, TagSchemasPage, type TagSchemasPageProps, TaggingPanel, type TextSegment, type TextSelection, ToastContainer, type ToastMessage, ToastProvider, type ToastType, Toolbar, type ToolbarPanelType, TranslationManager, TranslationProvider, type TranslationProviderProps, type UICreateAnnotationParams, UnifiedAnnotationsPanel, UnifiedHeader, UserMenuSkeleton, WelcomePage, type WelcomePageProps, buttonStyles, createCancelDetectionHandler, createDetectionHandler, dispatch401Error, dispatch403Error, dispatchAuthEvent, getAnnotationClassName, getAnnotationInternalType, getAnnotator, getResourceIcon, getShortcutDisplay, groupAnnotationsByType, jsonLightHighlightStyle, jsonLightTheme, onAuthEvent, rehypeRenderAnnotations, remarkAnnotations, sanitizeImageURL, supportsDetection, useAdmin, useAnnotationManager, useAnnotationPanel, useAnnotationUI, useAnnotations, useApiClient, useAuthApi, useCacheManager, useDebounce, useDebouncedCallback, useDetectionProgress, useDocumentAnnouncements, useDoubleKeyPress, useDropdown, useEntityTypes, useFormValidation, useFormattedTime, useGenerationProgress, useHealth, useIsTyping, useKeyboardShortcuts, useLineNumbers, useLiveRegion, useLoadingState, useLocalStorage, useOpenResources, usePreloadTranslations, useResourceAnnotations, useResourceEvents, useResources, useRovingTabIndex, useSearchAnnouncements, useSessionContext, useSessionExpiry, useTheme, useToast, useToolbar, useTranslations, validationRules, withHandlers };
|