@semiont/react-ui 0.2.33-build.79 → 0.2.33-build.81

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.
Files changed (213) hide show
  1. package/dist/EventBusContext-CJjL_cCf.d.mts +462 -0
  2. package/dist/{PdfAnnotationCanvas.client-ADC4FFSE.mjs → PdfAnnotationCanvas.client-RAJRPQLU.mjs} +42 -27
  3. package/dist/PdfAnnotationCanvas.client-RAJRPQLU.mjs.map +1 -0
  4. package/dist/{ar-EMHEHPCJ.mjs → ar-4ZEORRW2.mjs} +7 -4
  5. package/dist/ar-4ZEORRW2.mjs.map +1 -0
  6. package/dist/{bn-OVCI4F6X.mjs → bn-SEDE5BQJ.mjs} +7 -4
  7. package/dist/bn-SEDE5BQJ.mjs.map +1 -0
  8. package/dist/{chunk-LIHZTECW.mjs → chunk-D7NBW4RV.mjs} +7 -4
  9. package/dist/chunk-D7NBW4RV.mjs.map +1 -0
  10. package/dist/{chunk-JZIO2A3B.mjs → chunk-QB52Q7EQ.mjs} +206 -146
  11. package/dist/chunk-QB52Q7EQ.mjs.map +1 -0
  12. package/dist/{cs-FAN66Q2F.mjs → cs-7W4WF5WD.mjs} +7 -4
  13. package/dist/cs-7W4WF5WD.mjs.map +1 -0
  14. package/dist/{da-YBBIHI2O.mjs → da-75XGBCBK.mjs} +7 -4
  15. package/dist/da-75XGBCBK.mjs.map +1 -0
  16. package/dist/{de-MAYU33LB.mjs → de-ODJVFLHM.mjs} +7 -4
  17. package/dist/de-ODJVFLHM.mjs.map +1 -0
  18. package/dist/{el-MKGSWN4O.mjs → el-C4PM4WB3.mjs} +7 -4
  19. package/dist/el-C4PM4WB3.mjs.map +1 -0
  20. package/dist/{en-DDLIXJCU.mjs → en-KJCJQ4OO.mjs} +2 -2
  21. package/dist/{es-52LHUWJD.mjs → es-WD33R7QL.mjs} +7 -4
  22. package/dist/es-WD33R7QL.mjs.map +1 -0
  23. package/dist/{fa-FJICRANB.mjs → fa-2BP6V56P.mjs} +7 -4
  24. package/dist/fa-2BP6V56P.mjs.map +1 -0
  25. package/dist/{fi-O455XFCR.mjs → fi-USRRW24J.mjs} +7 -4
  26. package/dist/fi-USRRW24J.mjs.map +1 -0
  27. package/dist/{fr-TXIXHOOE.mjs → fr-EC5S6WVF.mjs} +7 -4
  28. package/dist/fr-EC5S6WVF.mjs.map +1 -0
  29. package/dist/{he-JBSOX5IN.mjs → he-7TBVIKAA.mjs} +7 -4
  30. package/dist/he-7TBVIKAA.mjs.map +1 -0
  31. package/dist/{hi-KGHI3XVT.mjs → hi-FO4VIZLA.mjs} +7 -4
  32. package/dist/hi-FO4VIZLA.mjs.map +1 -0
  33. package/dist/{id-5OCPPZLO.mjs → id-7U7GGVWY.mjs} +7 -4
  34. package/dist/id-7U7GGVWY.mjs.map +1 -0
  35. package/dist/index.css +123 -85
  36. package/dist/index.css.map +1 -1
  37. package/dist/index.d.mts +715 -574
  38. package/dist/index.mjs +3898 -3575
  39. package/dist/index.mjs.map +1 -1
  40. package/dist/{it-PNBBZSM2.mjs → it-Y4OPL6I2.mjs} +7 -4
  41. package/dist/it-Y4OPL6I2.mjs.map +1 -0
  42. package/dist/{ja-LDD7R3TJ.mjs → ja-PK7SQL55.mjs} +7 -4
  43. package/dist/ja-PK7SQL55.mjs.map +1 -0
  44. package/dist/{ko-F47ZDEY3.mjs → ko-L25PXMYD.mjs} +7 -4
  45. package/dist/ko-L25PXMYD.mjs.map +1 -0
  46. package/dist/{ms-Z7LMXJWL.mjs → ms-STH777QM.mjs} +7 -4
  47. package/dist/ms-STH777QM.mjs.map +1 -0
  48. package/dist/{nl-6SJFBPJ3.mjs → nl-Y7LECDDR.mjs} +7 -4
  49. package/dist/nl-Y7LECDDR.mjs.map +1 -0
  50. package/dist/{no-YXPBPSGF.mjs → no-KEKCEWU6.mjs} +7 -4
  51. package/dist/no-KEKCEWU6.mjs.map +1 -0
  52. package/dist/{pl-P4AZ2QME.mjs → pl-7A7OC75O.mjs} +7 -4
  53. package/dist/pl-7A7OC75O.mjs.map +1 -0
  54. package/dist/{pt-LHWUS6U6.mjs → pt-35HTM7RA.mjs} +7 -4
  55. package/dist/pt-35HTM7RA.mjs.map +1 -0
  56. package/dist/{ro-EA5J2ZON.mjs → ro-VAWL5KQA.mjs} +7 -4
  57. package/dist/ro-VAWL5KQA.mjs.map +1 -0
  58. package/dist/{sv-DATBS3UQ.mjs → sv-7ZK5EQEB.mjs} +7 -4
  59. package/dist/sv-7ZK5EQEB.mjs.map +1 -0
  60. package/dist/test-utils.d.mts +18 -8
  61. package/dist/test-utils.mjs +36 -14
  62. package/dist/test-utils.mjs.map +1 -1
  63. package/dist/{th-WTFJRWPT.mjs → th-UDWZ4X34.mjs} +7 -4
  64. package/dist/th-UDWZ4X34.mjs.map +1 -0
  65. package/dist/{tr-IKO3RXOX.mjs → tr-4WMPK3UX.mjs} +7 -4
  66. package/dist/tr-4WMPK3UX.mjs.map +1 -0
  67. package/dist/{uk-CF6CTTRK.mjs → uk-SSLASQYJ.mjs} +7 -4
  68. package/dist/uk-SSLASQYJ.mjs.map +1 -0
  69. package/dist/{vi-AJLTXPZQ.mjs → vi-IF42Z5PU.mjs} +7 -4
  70. package/dist/vi-IF42Z5PU.mjs.map +1 -0
  71. package/dist/{zh-U3ORHHYH.mjs → zh-HRQTNTAI.mjs} +7 -4
  72. package/dist/zh-HRQTNTAI.mjs.map +1 -0
  73. package/package.json +3 -1
  74. package/src/components/CodeMirrorRenderer.tsx +66 -93
  75. package/src/components/DetectionProgressWidget.tsx +16 -5
  76. package/src/components/ResizeHandle.tsx +10 -4
  77. package/src/components/SessionExpiryBanner.tsx +2 -3
  78. package/src/components/SessionTimer.tsx +3 -3
  79. package/src/components/Toolbar.tsx +18 -9
  80. package/src/components/__tests__/SessionTimer.test.tsx +33 -33
  81. package/src/components/annotation/AnnotateToolbar.tsx +17 -15
  82. package/src/components/annotation/__tests__/AnnotateToolbar.test.tsx +165 -63
  83. package/src/components/annotation/annotation-entries.css +10 -0
  84. package/src/components/annotation-popups/JsonLdView.tsx +8 -2
  85. package/src/components/image-annotation/AnnotationOverlay.tsx +42 -22
  86. package/src/components/image-annotation/SvgDrawingCanvas.tsx +27 -30
  87. package/src/components/layout/__tests__/LeftSidebar.test.tsx +12 -33
  88. package/src/components/layout/__tests__/PageLayout.test.tsx +37 -32
  89. package/src/components/layout/__tests__/UnifiedHeader.test.tsx +21 -40
  90. package/src/components/modals/ResourceSearchModal.tsx +2 -2
  91. package/src/components/modals/SearchModal.tsx +1 -1
  92. package/src/components/navigation/CollapsibleResourceNavigation.tsx +14 -9
  93. package/src/components/navigation/NavigationTabs.css +36 -24
  94. package/src/components/navigation/ObservableLink.tsx +91 -0
  95. package/src/components/navigation/SimpleNavigation.tsx +20 -16
  96. package/src/components/navigation/SortableResourceTab.tsx +11 -5
  97. package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +51 -26
  98. package/src/components/pdf-annotation/__tests__/PdfAnnotationCanvas.test.tsx +28 -22
  99. package/src/components/resource/AnnotateView.tsx +64 -134
  100. package/src/components/resource/BrowseView.tsx +86 -166
  101. package/src/components/resource/HistoryEvent.tsx +13 -7
  102. package/src/components/resource/ResourceViewer.tsx +122 -264
  103. package/src/components/resource/__tests__/BrowseView.test.tsx +631 -0
  104. package/src/components/resource/__tests__/ResourceViewer.mode-switch.test.tsx +231 -0
  105. package/src/components/resource/panels/AssessmentEntry.tsx +25 -33
  106. package/src/components/resource/panels/AssessmentPanel.tsx +106 -28
  107. package/src/components/resource/panels/CommentEntry.tsx +38 -32
  108. package/src/components/resource/panels/CommentsPanel.tsx +121 -28
  109. package/src/components/resource/panels/DetectSection.css +36 -1
  110. package/src/components/resource/panels/DetectSection.tsx +49 -15
  111. package/src/components/resource/panels/HighlightEntry.tsx +25 -33
  112. package/src/components/resource/panels/HighlightPanel.tsx +100 -25
  113. package/src/components/resource/panels/ReferenceEntry.tsx +61 -75
  114. package/src/components/resource/panels/ReferencesPanel.tsx +134 -42
  115. package/src/components/resource/panels/ResourceInfoPanel.tsx +47 -48
  116. package/src/components/resource/panels/TagEntry.tsx +25 -33
  117. package/src/components/resource/panels/TaggingPanel.tsx +118 -30
  118. package/src/components/resource/panels/UnifiedAnnotationsPanel.tsx +30 -92
  119. package/src/components/resource/panels/__tests__/AssessmentPanel.test.tsx +129 -110
  120. package/src/components/resource/panels/__tests__/CommentEntry.test.tsx +86 -78
  121. package/src/components/resource/panels/__tests__/CommentsPanel.test.tsx +144 -149
  122. package/src/components/resource/panels/__tests__/DetectSection.test.tsx +480 -0
  123. package/src/components/resource/panels/__tests__/HighlightPanel.detectionProgress.test.tsx +362 -0
  124. package/src/components/resource/panels/__tests__/ReferencesPanel.test.tsx +226 -111
  125. package/src/components/resource/panels/__tests__/ResourceInfoPanel.test.tsx +117 -61
  126. package/src/components/resource/panels/__tests__/TaggingPanel.test.tsx +128 -106
  127. package/src/components/settings/SettingsPanel.tsx +15 -12
  128. package/src/features/admin-devops/__tests__/AdminDevOpsPage.test.tsx +1 -46
  129. package/src/features/admin-devops/components/AdminDevOpsPage.tsx +0 -9
  130. package/src/features/admin-security/__tests__/AdminSecurityPage.test.tsx +0 -3
  131. package/src/features/admin-security/components/AdminSecurityPage.tsx +0 -9
  132. package/src/features/admin-users/__tests__/AdminUsersPage.test.tsx +0 -3
  133. package/src/features/admin-users/components/AdminUsersPage.tsx +0 -9
  134. package/src/features/moderate-entity-tags/__tests__/EntityTagsPage.test.tsx +0 -3
  135. package/src/features/moderate-entity-tags/components/EntityTagsPage.tsx +1 -9
  136. package/src/features/moderate-recent/__tests__/RecentDocumentsPage.test.tsx +0 -32
  137. package/src/features/moderate-recent/components/RecentDocumentsPage.tsx +1 -9
  138. package/src/features/moderate-tag-schemas/__tests__/TagSchemasPage.test.tsx +0 -32
  139. package/src/features/moderate-tag-schemas/components/TagSchemasPage.tsx +1 -9
  140. package/src/features/resource-compose/__tests__/ResourceComposePage.test.tsx +51 -54
  141. package/src/features/resource-compose/components/ResourceComposePage.tsx +3 -13
  142. package/src/features/resource-discovery/__tests__/ResourceDiscoveryPage.test.tsx +39 -45
  143. package/src/features/resource-discovery/components/ResourceDiscoveryPage.tsx +9 -13
  144. package/src/features/resource-viewer/__tests__/AnnotationDeletionIntegration.test.tsx +234 -0
  145. package/src/features/resource-viewer/__tests__/DetectionFlowBug.test.tsx +234 -0
  146. package/src/features/resource-viewer/__tests__/DetectionFlowIntegration.test.tsx +388 -0
  147. package/src/features/resource-viewer/__tests__/DetectionProgressDismissal.test.tsx +318 -0
  148. package/src/features/resource-viewer/__tests__/GenerationFlowIntegration.test.tsx +503 -0
  149. package/src/features/resource-viewer/__tests__/ResourceViewerPage.test.tsx +139 -93
  150. package/src/features/resource-viewer/__tests__/detection-progress-flow.test.tsx +322 -0
  151. package/src/features/resource-viewer/components/ResourceViewerPage.tsx +341 -524
  152. package/translations/ar.json +6 -3
  153. package/translations/bn.json +6 -3
  154. package/translations/cs.json +6 -3
  155. package/translations/da.json +6 -3
  156. package/translations/de.json +6 -3
  157. package/translations/el.json +6 -3
  158. package/translations/en.json +6 -3
  159. package/translations/es.json +6 -3
  160. package/translations/fa.json +6 -3
  161. package/translations/fi.json +6 -3
  162. package/translations/fr.json +6 -3
  163. package/translations/he.json +6 -3
  164. package/translations/hi.json +6 -3
  165. package/translations/id.json +6 -3
  166. package/translations/it.json +6 -3
  167. package/translations/ja.json +6 -3
  168. package/translations/ko.json +6 -3
  169. package/translations/ms.json +6 -3
  170. package/translations/nl.json +6 -3
  171. package/translations/no.json +6 -3
  172. package/translations/pl.json +6 -3
  173. package/translations/pt.json +6 -3
  174. package/translations/ro.json +6 -3
  175. package/translations/sv.json +6 -3
  176. package/translations/th.json +6 -3
  177. package/translations/tr.json +6 -3
  178. package/translations/uk.json +6 -3
  179. package/translations/vi.json +6 -3
  180. package/translations/zh.json +6 -3
  181. package/dist/PdfAnnotationCanvas.client-ADC4FFSE.mjs.map +0 -1
  182. package/dist/TranslationManager-Co_5fSxl.d.mts +0 -118
  183. package/dist/ar-EMHEHPCJ.mjs.map +0 -1
  184. package/dist/bn-OVCI4F6X.mjs.map +0 -1
  185. package/dist/chunk-JZIO2A3B.mjs.map +0 -1
  186. package/dist/chunk-LIHZTECW.mjs.map +0 -1
  187. package/dist/cs-FAN66Q2F.mjs.map +0 -1
  188. package/dist/da-YBBIHI2O.mjs.map +0 -1
  189. package/dist/de-MAYU33LB.mjs.map +0 -1
  190. package/dist/el-MKGSWN4O.mjs.map +0 -1
  191. package/dist/es-52LHUWJD.mjs.map +0 -1
  192. package/dist/fa-FJICRANB.mjs.map +0 -1
  193. package/dist/fi-O455XFCR.mjs.map +0 -1
  194. package/dist/fr-TXIXHOOE.mjs.map +0 -1
  195. package/dist/he-JBSOX5IN.mjs.map +0 -1
  196. package/dist/hi-KGHI3XVT.mjs.map +0 -1
  197. package/dist/id-5OCPPZLO.mjs.map +0 -1
  198. package/dist/it-PNBBZSM2.mjs.map +0 -1
  199. package/dist/ja-LDD7R3TJ.mjs.map +0 -1
  200. package/dist/ko-F47ZDEY3.mjs.map +0 -1
  201. package/dist/ms-Z7LMXJWL.mjs.map +0 -1
  202. package/dist/nl-6SJFBPJ3.mjs.map +0 -1
  203. package/dist/no-YXPBPSGF.mjs.map +0 -1
  204. package/dist/pl-P4AZ2QME.mjs.map +0 -1
  205. package/dist/pt-LHWUS6U6.mjs.map +0 -1
  206. package/dist/ro-EA5J2ZON.mjs.map +0 -1
  207. package/dist/sv-DATBS3UQ.mjs.map +0 -1
  208. package/dist/th-WTFJRWPT.mjs.map +0 -1
  209. package/dist/tr-IKO3RXOX.mjs.map +0 -1
  210. package/dist/uk-CF6CTTRK.mjs.map +0 -1
  211. package/dist/vi-AJLTXPZQ.mjs.map +0 -1
  212. package/dist/zh-U3ORHHYH.mjs.map +0 -1
  213. /package/dist/{en-DDLIXJCU.mjs.map → en-KJCJQ4OO.mjs.map} +0 -0
package/dist/index.d.mts CHANGED
@@ -1,10 +1,10 @@
1
1
  import * as _semiont_api_client from '@semiont/api-client';
2
- import { components, ResourceUri, Selector, SemiontApiClient, AnnotationUri, ResourceAnnotationUri, ValidationResult, DetectionProgress as DetectionProgress$1, GenerationProgress as GenerationProgress$1, GenerationContext, paths } from '@semiont/api-client';
2
+ import { components, ResourceUri, Selector, SemiontApiClient, SSEStream, AnnotationUri, ResourceAnnotationUri, ValidationResult, paths, Motivation as Motivation$9, GenerationContext } from '@semiont/api-client';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as React$1 from 'react';
5
5
  import React__default, { ComponentType, ReactNode, MutableRefObject, KeyboardEvent as KeyboardEvent$1, Component, ErrorInfo } from 'react';
6
- import { A as ApiClientManager, O as OpenResourcesManager, S as SessionManager, T as TranslationManager } from './TranslationManager-Co_5fSxl.mjs';
7
- export { a as OpenResourceFromManager, b as SessionState } from './TranslationManager-Co_5fSxl.mjs';
6
+ import { D as DetectionProgress, E as EventBus, a as EventMap, O as OpenResourcesManager, S as SessionManager, T as TranslationManager, G as GenerationProgress } from './EventBusContext-CJjL_cCf.mjs';
7
+ export { e as EventBusProvider, d as EventBusProviderProps, b as OpenResourceFromManager, c as SessionState, r as resetEventBusForTesting, u as useEventBus } from './EventBusContext-CJjL_cCf.mjs';
8
8
  import * as _tanstack_react_query from '@tanstack/react-query';
9
9
  import { UseQueryOptions } from '@tanstack/react-query';
10
10
  import * as _codemirror_state from '@codemirror/state';
@@ -16,19 +16,19 @@ import { VFile } from 'vfile';
16
16
  import { TagSchema } from '@semiont/ontology';
17
17
  export { TAG_SCHEMAS, TagCategory, TagSchema, getAllTagSchemas, getSchemaCategory as getTagCategory, getTagSchema, getTagSchemasByDomain, isValidCategory } from '@semiont/ontology';
18
18
  import { ResourceEvent, StoredEvent } from '@semiont/core';
19
- import mitt from 'mitt';
19
+ import { Emitter } from 'mitt';
20
20
 
21
- type Annotation$p = components['schemas']['Annotation'];
21
+ type Annotation$m = components['schemas']['Annotation'];
22
22
  /**
23
23
  * Collection of all annotation types for a resource.
24
24
  * Replaces separate highlights, references, assessments, comments, tags props.
25
25
  */
26
26
  interface AnnotationsCollection {
27
- highlights: Annotation$p[];
28
- references: Annotation$p[];
29
- assessments: Annotation$p[];
30
- comments: Annotation$p[];
31
- tags: Annotation$p[];
27
+ highlights: Annotation$m[];
28
+ references: Annotation$m[];
29
+ assessments: Annotation$m[];
30
+ comments: Annotation$m[];
31
+ tags: Annotation$m[];
32
32
  }
33
33
  /**
34
34
  * Event handlers for annotation interactions.
@@ -36,7 +36,7 @@ interface AnnotationsCollection {
36
36
  */
37
37
  interface AnnotationHandlers {
38
38
  /** Unified click handler - routes based on annotation type and current mode */
39
- onClick?: (annotation: Annotation$p, event?: React.MouseEvent) => void;
39
+ onClick?: (annotation: Annotation$m, event?: React.MouseEvent) => void;
40
40
  /** Unified hover handler for all annotation types */
41
41
  onHover?: (annotationId: string | null) => void;
42
42
  /** Hover handler specifically for comment panel highlighting */
@@ -85,7 +85,7 @@ interface UICreateAnnotationParams {
85
85
  * - linking: Shows Quick Reference popup FIRST, creates when user confirms
86
86
  */
87
87
  interface AnnotationCreationHandler {
88
- onCreate?: (params: UICreateAnnotationParams) => void | Promise<void> | Promise<Annotation$p | undefined>;
88
+ onCreate?: (params: UICreateAnnotationParams) => void | Promise<void> | Promise<Annotation$m | undefined>;
89
89
  }
90
90
  /**
91
91
  * UI state for annotation toolbar and interactions.
@@ -120,7 +120,7 @@ interface AnnotationConfig {
120
120
  annotateMode?: boolean;
121
121
  }
122
122
 
123
- type Annotation$o = components['schemas']['Annotation'];
123
+ type Annotation$l = components['schemas']['Annotation'];
124
124
  /**
125
125
  * Parameters for creating an annotation
126
126
  */
@@ -167,7 +167,7 @@ interface AnnotationManager {
167
167
  * @param params - Creation parameters (rUri, motivation, selector, body)
168
168
  * @returns Promise resolving to the created annotation, or undefined if creation fails
169
169
  */
170
- createAnnotation: (params: CreateAnnotationParams) => Promise<Annotation$o | undefined>;
170
+ createAnnotation: (params: CreateAnnotationParams) => Promise<Annotation$l | undefined>;
171
171
  /**
172
172
  * Delete an annotation
173
173
  * @param params - Deletion parameters (annotationId, rUri)
@@ -270,9 +270,9 @@ interface NavigationProps {
270
270
  * Type definitions for resource viewer feature
271
271
  */
272
272
 
273
- type SemiontResource$3 = components['schemas']['ResourceDescriptor'];
274
- type Annotation$n = components['schemas']['Annotation'];
275
- type Motivation$b = components['schemas']['Motivation'];
273
+ type SemiontResource$4 = components['schemas']['ResourceDescriptor'];
274
+ type Annotation$k = components['schemas']['Annotation'];
275
+ type Motivation$8 = components['schemas']['Motivation'];
276
276
  /**
277
277
  * Selection for creating annotations
278
278
  */
@@ -299,17 +299,17 @@ interface TextSelection {
299
299
  * No aliasing, wrappers, or compatibility layers elsewhere.
300
300
  */
301
301
 
302
- type Annotation$m = components['schemas']['Annotation'];
303
- type Motivation$a = components['schemas']['Motivation'];
302
+ type Annotation$j = components['schemas']['Annotation'];
303
+ type Motivation$7 = components['schemas']['Motivation'];
304
304
  /**
305
305
  * Detection configuration for SSE-based annotation detection
306
306
  */
307
307
  interface DetectionConfig {
308
- sseMethod: 'detectAnnotations' | 'detectHighlights' | 'detectAssessments' | 'detectComments' | 'detectTags';
308
+ sseMethod: 'detectReferences' | 'detectHighlights' | 'detectAssessments' | 'detectComments' | 'detectTags';
309
309
  countField: 'foundCount' | 'createdCount' | 'tagsCreated';
310
310
  displayNamePlural: string;
311
311
  displayNameSingular: string;
312
- formatRequestParams?: (args: any[]) => Array<{
312
+ formatRequestParams?: (args: unknown[]) => Array<{
313
313
  label: string;
314
314
  value: string;
315
315
  }>;
@@ -327,7 +327,7 @@ interface CreateConfig {
327
327
  * Handles clicks, hovers, detection, and other operations for one annotation type
328
328
  */
329
329
  interface Annotator {
330
- motivation: Motivation$a;
330
+ motivation: Motivation$7;
331
331
  internalType: string;
332
332
  displayName: string;
333
333
  description: string;
@@ -336,7 +336,7 @@ interface Annotator {
336
336
  isClickable: boolean;
337
337
  hasHoverInteraction: boolean;
338
338
  hasSidePanel: boolean;
339
- matchesAnnotation: (annotation: Annotation$m) => boolean;
339
+ matchesAnnotation: (annotation: Annotation$j) => boolean;
340
340
  announceOnCreate: string;
341
341
  detection?: DetectionConfig;
342
342
  create: CreateConfig;
@@ -353,23 +353,23 @@ declare const ANNOTATORS: Record<string, Annotator>;
353
353
  * (handleDetectHighlights, handleDetectAssessments, etc.)
354
354
  */
355
355
  declare function createDetectionHandler(annotator: Annotator, context: {
356
- client: any;
357
- rUri: any;
358
- setDetectingMotivation: (motivation: Motivation$a | null) => void;
359
- setMotivationDetectionProgress: (progress: any) => void;
360
- detectionStreamRef: MutableRefObject<any>;
356
+ client: SemiontApiClient;
357
+ rUri: ResourceUri;
358
+ setDetectingMotivation: (motivation: Motivation$7 | null) => void;
359
+ setMotivationDetectionProgress: (progress: DetectionProgress | null) => void;
360
+ detectionStreamRef: MutableRefObject<SSEStream<DetectionProgress, object> | null>;
361
361
  cacheManager: CacheManager;
362
362
  showSuccess: (message: string) => void;
363
363
  showError: (message: string) => void;
364
- }): (...args: any[]) => Promise<void>;
364
+ }): (...args: unknown[]) => Promise<void>;
365
365
  /**
366
366
  * Generic detection cancellation handler
367
367
  * Cancels any active detection stream
368
368
  */
369
369
  declare function createCancelDetectionHandler(context: {
370
- detectionStreamRef: MutableRefObject<any>;
371
- setDetectingMotivation: (motivation: Motivation$a | null) => void;
372
- setMotivationDetectionProgress: (progress: any) => void;
370
+ detectionStreamRef: MutableRefObject<SSEStream<DetectionProgress, object> | null>;
371
+ setDetectingMotivation: (motivation: Motivation$7 | null) => void;
372
+ setMotivationDetectionProgress: (progress: DetectionProgress | null) => void;
373
373
  }): () => void;
374
374
 
375
375
  /**
@@ -407,6 +407,9 @@ declare function useResources(): {
407
407
  referencedBy: any[];
408
408
  }, Error>;
409
409
  };
410
+ representation: {
411
+ useQuery: (rUri: ResourceUri, mediaType: string) => _tanstack_react_query.UseQueryResult<string, Error>;
412
+ };
410
413
  search: {
411
414
  useQuery: (query: string, limit: number) => _tanstack_react_query.UseQueryResult<{
412
415
  resources: _semiont_api_client.components["schemas"]["ResourceDescriptor"][];
@@ -448,7 +451,7 @@ declare function useResources(): {
448
451
  }, Error, ResourceUri, unknown>;
449
452
  };
450
453
  getByToken: {
451
- useQuery: (token: string) => _tanstack_react_query.UseQueryResult<{
454
+ useQuery: (cloneTokenStr: string) => _tanstack_react_query.UseQueryResult<{
452
455
  sourceResource: _semiont_api_client.components["schemas"]["ResourceDescriptor"];
453
456
  expiresAt: string;
454
457
  }, Error>;
@@ -540,7 +543,10 @@ declare function useAnnotations(): {
540
543
  }, unknown>;
541
544
  };
542
545
  delete: {
543
- useMutation: () => _tanstack_react_query.UseMutationResult<void, Error, ResourceAnnotationUri, unknown>;
546
+ useMutation: () => _tanstack_react_query.UseMutationResult<void, Error, {
547
+ annotationUri: ResourceAnnotationUri;
548
+ resourceUri: ResourceUri;
549
+ }, unknown>;
544
550
  };
545
551
  updateBody: {
546
552
  useMutation: () => _tanstack_react_query.UseMutationResult<{
@@ -815,18 +821,17 @@ declare const jsonLightHighlightStyle: HighlightStyle;
815
821
  * - Entity type badges
816
822
  */
817
823
 
818
- type Annotation$l = components['schemas']['Annotation'];
824
+ type Annotation$i = components['schemas']['Annotation'];
819
825
  /**
820
826
  * Reference Resolution Widget
821
827
  * Shows a small indicator next to references with hover preview
822
828
  */
823
829
  declare class ReferenceResolutionWidget extends WidgetType {
824
- readonly annotation: Annotation$l;
830
+ readonly annotation: Annotation$i;
825
831
  readonly targetDocumentName?: string | undefined;
826
- readonly onNavigate?: ((documentId: string) => void) | undefined;
827
- readonly onUnresolvedClick?: ((annotation: Annotation$l) => void) | undefined;
832
+ readonly eventBus?: EventBus | undefined;
828
833
  readonly isGenerating?: boolean | undefined;
829
- constructor(annotation: Annotation$l, targetDocumentName?: string | undefined, onNavigate?: ((documentId: string) => void) | undefined, onUnresolvedClick?: ((annotation: Annotation$l) => void) | undefined, isGenerating?: boolean | undefined);
834
+ constructor(annotation: Annotation$i, targetDocumentName?: string | undefined, eventBus?: EventBus | undefined, isGenerating?: boolean | undefined);
830
835
  eq(other: ReferenceResolutionWidget): boolean;
831
836
  toDOM(): HTMLSpanElement;
832
837
  private showPreview;
@@ -840,19 +845,23 @@ type ShapeType = 'rectangle' | 'circle' | 'polygon';
840
845
  interface AnnotateToolbarProps {
841
846
  selectedMotivation: SelectionMotivation | null;
842
847
  selectedClick: ClickAction;
843
- onSelectionChange: (motivation: SelectionMotivation | null) => void;
844
- onClickChange: (motivation: ClickAction) => void;
845
848
  showSelectionGroup?: boolean;
846
849
  showDeleteButton?: boolean;
847
850
  showShapeGroup?: boolean;
848
851
  selectedShape?: ShapeType;
849
- onShapeChange?: (shape: ShapeType) => void;
850
852
  mediaType?: string | null;
851
853
  annotateMode: boolean;
852
- onAnnotateModeToggle: () => void;
853
854
  annotators: Record<string, Annotator>;
854
855
  }
855
- declare function AnnotateToolbar({ selectedMotivation, selectedClick, onSelectionChange, onClickChange, showSelectionGroup, showDeleteButton, showShapeGroup, selectedShape, onShapeChange, mediaType, annotateMode, onAnnotateModeToggle, annotators }: AnnotateToolbarProps): react_jsx_runtime.JSX.Element;
856
+ /**
857
+ * Toolbar for annotation controls with mode, selection, click, and shape options
858
+ *
859
+ * @emits toolbar:selection-changed - Selection motivation changed. Payload: { motivation: SelectionMotivation | null }
860
+ * @emits toolbar:click-changed - Click action mode changed. Payload: { action: ClickAction }
861
+ * @emits toolbar:shape-changed - Drawing shape changed. Payload: { shape: ShapeType }
862
+ * @emits view:mode-toggled - View mode toggled between browse and annotate. Payload: undefined
863
+ */
864
+ declare function AnnotateToolbar({ selectedMotivation, selectedClick, showSelectionGroup, showDeleteButton, showShapeGroup, selectedShape, mediaType, annotateMode, annotators }: AnnotateToolbarProps): react_jsx_runtime.JSX.Element;
856
865
 
857
866
  /**
858
867
  * Media Type Shape Support
@@ -933,6 +942,7 @@ declare const QUERY_KEYS: {
933
942
  events: (rUri: ResourceUri) => readonly ["resources", ResourceUri, "events"];
934
943
  annotations: (rUri: ResourceUri) => readonly ["resources", ResourceUri, "annotations"];
935
944
  referencedBy: (rUri: ResourceUri) => readonly ["resources", ResourceUri, "referenced-by"];
945
+ representation: (rUri: ResourceUri) => readonly ["resources", ResourceUri, "representation"];
936
946
  };
937
947
  annotations: {
938
948
  detail: (aUri: AnnotationUri) => readonly ["annotations", AnnotationUri];
@@ -951,21 +961,6 @@ declare const QUERY_KEYS: {
951
961
  config: () => readonly ["admin", "oauth", "config"];
952
962
  };
953
963
  };
954
- documents: {
955
- all: (limit?: number, archived?: boolean) => readonly ["resources", {
956
- readonly limit: number | undefined;
957
- readonly archived: boolean | undefined;
958
- }];
959
- detail: (rUri: ResourceUri) => readonly ["resources", ResourceUri];
960
- byToken: (token: string) => readonly ["resources", "by-token", string];
961
- search: (query: string, limit: number) => readonly ["resources", "search", {
962
- readonly query: string;
963
- readonly limit: number;
964
- }];
965
- events: (rUri: ResourceUri) => readonly ["resources", ResourceUri, "events"];
966
- annotations: (rUri: ResourceUri) => readonly ["resources", ResourceUri, "annotations"];
967
- referencedBy: (rUri: ResourceUri) => readonly ["resources", ResourceUri, "referenced-by"];
968
- };
969
964
  };
970
965
 
971
966
  declare function rehypeRenderAnnotations(): (tree: Root, file: any) => void;
@@ -1057,23 +1052,6 @@ declare const OAuthUserSchema: {
1057
1052
  */
1058
1053
  declare function sanitizeImageURL(url: string): string | null;
1059
1054
 
1060
- type Annotation$k = components['schemas']['Annotation'];
1061
- /**
1062
- * Shared logic for annotation panel components
1063
- *
1064
- * Handles:
1065
- * - Sorting annotations by position in the resource
1066
- * - Hover effects: scroll to annotation and pulse highlight
1067
- * - Ref management for annotation elements
1068
- *
1069
- * Used by: HighlightPanel, AssessmentPanel, CommentsPanel, ReferencesPanel
1070
- */
1071
- declare function useAnnotationPanel<T extends Annotation$k>(annotations: T[], hoveredId: string | null | undefined): {
1072
- sortedAnnotations: T[];
1073
- containerRef: React$1.RefObject<HTMLDivElement>;
1074
- handleAnnotationRef: (id: string, el: HTMLElement | null) => void;
1075
- };
1076
-
1077
1055
  /**
1078
1056
  * Creates a debounced version of a callback function
1079
1057
  *
@@ -1103,79 +1081,7 @@ declare function useDebouncedCallback<T extends (...args: any[]) => any>(callbac
1103
1081
  */
1104
1082
  declare function useDebounce<T>(value: T, delay: number): T;
1105
1083
 
1106
- interface DetectionProgress extends DetectionProgress$1 {
1107
- completedEntityTypes?: Array<{
1108
- entityType: string;
1109
- foundCount: number;
1110
- }>;
1111
- }
1112
- interface UseDetectionProgressOptions {
1113
- rUri: ResourceUri;
1114
- onComplete?: (progress: DetectionProgress) => void;
1115
- onError?: (error: string) => void;
1116
- onProgress?: (progress: DetectionProgress) => void;
1117
- }
1118
- declare function useDetectionProgress({ rUri, onComplete, onError, onProgress }: UseDetectionProgressOptions): {
1119
- isDetecting: boolean;
1120
- progress: DetectionProgress | null;
1121
- startDetection: (entityTypes: string[]) => Promise<void>;
1122
- cancelDetection: () => void;
1123
- };
1124
-
1125
- declare function useFormattedTime(milliseconds: number | null): string | null;
1126
-
1127
- interface UseFormValidationOptions {
1128
- announceErrors?: boolean;
1129
- }
1130
- declare function useFormValidation(options?: UseFormValidationOptions): {
1131
- errors: Record<string, string>;
1132
- setFieldError: (field: string, message: string) => void;
1133
- clearFieldError: (field: string) => void;
1134
- clearAllErrors: () => void;
1135
- validateField: (field: string, value: any, rules: Record<string, (value: any) => string | null>) => boolean;
1136
- announceSuccess: (message: string) => void;
1137
- getFieldError: (field: string) => string | null;
1138
- hasErrors: () => boolean;
1139
- getFieldProps: (fieldName: string) => {
1140
- 'aria-invalid': boolean;
1141
- 'aria-describedby': string | undefined;
1142
- id: string;
1143
- };
1144
- getErrorProps: (fieldName: string) => {
1145
- id: string;
1146
- role: string;
1147
- 'aria-live': string;
1148
- };
1149
- };
1150
- declare const validationRules: {
1151
- required: (message?: string) => (value: any) => string | null;
1152
- minLength: (min: number, message?: string) => (value: string) => string | null;
1153
- maxLength: (max: number, message?: string) => (value: string) => string | null;
1154
- email: (message?: string) => (value: string) => string | null;
1155
- url: (message?: string) => (value: string) => string | null;
1156
- pattern: (regex: RegExp, message: string) => (value: string) => string | null;
1157
- };
1158
-
1159
- type GenerationProgress = GenerationProgress$1;
1160
- interface UseGenerationProgressOptions {
1161
- onComplete?: (progress: GenerationProgress) => void;
1162
- onError?: (error: string) => void;
1163
- onProgress?: (progress: GenerationProgress) => void;
1164
- }
1165
- declare function useGenerationProgress({ onComplete, onError, onProgress }: UseGenerationProgressOptions): {
1166
- isGenerating: boolean;
1167
- progress: GenerationProgress$1 | null;
1168
- startGeneration: (referenceId: AnnotationUri, resourceId: ResourceUri, options: {
1169
- title?: string;
1170
- prompt?: string;
1171
- language?: string;
1172
- context: GenerationContext;
1173
- temperature?: number;
1174
- maxTokens?: number;
1175
- }) => Promise<void>;
1176
- cancelGeneration: () => void;
1177
- clearProgress: () => void;
1178
- };
1084
+ declare function formatTime(milliseconds: number | null): string | null;
1179
1085
 
1180
1086
  interface KeyboardShortcut {
1181
1087
  key: string;
@@ -1214,6 +1120,75 @@ declare function useLineNumbers(): {
1214
1120
  toggleLineNumbers: () => void;
1215
1121
  };
1216
1122
 
1123
+ /**
1124
+ * Generic router interface - works with any router that has push/replace methods
1125
+ * (Next.js App Router, Next.js Pages Router, React Router, etc.)
1126
+ */
1127
+ interface Router {
1128
+ push: (path: string) => void;
1129
+ replace?: (path: string) => void;
1130
+ [key: string]: any;
1131
+ }
1132
+ /**
1133
+ * Hook that wraps any router with event emission for observability
1134
+ *
1135
+ * Use this to wrap your router (Next.js, React Router, etc.) when you want
1136
+ * navigation actions to be observable through the NavigationEventBus.
1137
+ *
1138
+ * @emits navigation:router-push - Router navigation requested. Payload: { path: string, reason?: string }
1139
+ *
1140
+ * @example
1141
+ * ```typescript
1142
+ * // Next.js App Router
1143
+ * import { useRouter } from 'next/navigation';
1144
+ * const nextRouter = useRouter();
1145
+ * const router = useObservableRouter(nextRouter);
1146
+ * router.push('/know/discover', { reason: 'resource-closed' });
1147
+ *
1148
+ * // React Router
1149
+ * import { useNavigate } from 'react-router-dom';
1150
+ * const navigate = useNavigate();
1151
+ * const router = useObservableRouter({ push: navigate });
1152
+ * router.push('/know/discover', { reason: 'resource-closed' });
1153
+ * ```
1154
+ */
1155
+ declare function useObservableRouter<T extends Router>(baseRouter: T): T;
1156
+ /**
1157
+ * Request navigation with event emission
1158
+ *
1159
+ * This hook emits a navigation request event. The app must subscribe to
1160
+ * 'navigation:external-navigate' and perform the actual navigation using
1161
+ * its router (Next.js, React Router, etc.) to enable client-side routing.
1162
+ *
1163
+ * If no subscriber handles the event, falls back to window.location.href
1164
+ * after a brief delay to allow for event handling.
1165
+ *
1166
+ * @emits navigation:external-navigate - External navigation requested. Payload: { url: string, resourceId?: string, cancelFallback: () => void }
1167
+ *
1168
+ * The payload includes a `cancelFallback` function that subscribers must call to
1169
+ * prevent the window.location fallback from firing. Subscribers that handle the
1170
+ * navigation (e.g. via client-side routing) should always call cancelFallback().
1171
+ *
1172
+ * @example
1173
+ * ```typescript
1174
+ * // In component (react-ui package)
1175
+ * const navigate = useObservableExternalNavigation();
1176
+ * navigate('/know/resource/123', { resourceId: '123' });
1177
+ *
1178
+ * // In app (frontend package) - subscribe, cancel fallback, and handle with Next.js router
1179
+ * const router = useRouter();
1180
+ * useEventSubscriptions({
1181
+ * 'navigation:external-navigate': ({ url, cancelFallback }) => {
1182
+ * cancelFallback(); // Prevent window.location fallback
1183
+ * router.push(url); // Client-side navigation
1184
+ * },
1185
+ * });
1186
+ * ```
1187
+ */
1188
+ declare function useObservableExternalNavigation(): (url: string, metadata?: {
1189
+ resourceId?: string;
1190
+ }) => void;
1191
+
1217
1192
  interface UsePanelWidthOptions {
1218
1193
  defaultWidth?: number;
1219
1194
  minWidth?: number;
@@ -1329,27 +1304,16 @@ declare function useSessionExpiry(): {
1329
1304
 
1330
1305
  type Theme = 'light' | 'dark' | 'system';
1331
1306
  type ResolvedTheme = 'light' | 'dark';
1332
- declare function useTheme(): {
1307
+ interface ThemeContextValue {
1333
1308
  theme: Theme;
1334
- setTheme: (newTheme: Theme) => void;
1309
+ setTheme: (theme: Theme) => void;
1335
1310
  resolvedTheme: ResolvedTheme;
1336
1311
  systemTheme: ResolvedTheme;
1337
- };
1338
-
1339
- type ToolbarPanelType = 'document' | 'history' | 'info' | 'annotations' | 'settings' | 'collaboration' | 'user' | 'jsonld';
1340
- interface UseToolbarOptions {
1341
- /** Initial panel to show (default: null) */
1342
- initialPanel?: ToolbarPanelType | null;
1343
- /** Whether to persist active panel to localStorage (default: false) */
1344
- persistToStorage?: boolean;
1345
- /** Storage key for persistence (default: 'activeToolbarPanel') */
1346
- storageKey?: string;
1347
1312
  }
1348
- declare function useToolbar(options?: UseToolbarOptions): {
1349
- activePanel: ToolbarPanelType | null;
1350
- togglePanel: (panel: ToolbarPanelType) => void;
1351
- setActivePanel: React$1.Dispatch<React$1.SetStateAction<ToolbarPanelType | null>>;
1352
- };
1313
+ declare function ThemeProvider({ children }: {
1314
+ children: ReactNode;
1315
+ }): react_jsx_runtime.JSX.Element;
1316
+ declare function useTheme(): ThemeContextValue;
1353
1317
 
1354
1318
  /**
1355
1319
  * Hook for managing dropdown/menu visibility with click outside handling
@@ -1375,6 +1339,19 @@ declare function useLoadingState(minLoadingTime?: number): {
1375
1339
  */
1376
1340
  declare function useLocalStorage<T>(key: string, initialValue: T): [T, (value: T | ((val: T) => T)) => void];
1377
1341
 
1342
+ type SemiontResource$3 = components['schemas']['ResourceDescriptor'];
1343
+ interface UseResourceContentResult {
1344
+ content: string;
1345
+ loading: boolean;
1346
+ }
1347
+ /**
1348
+ * Hook to load resource content (representation)
1349
+ *
1350
+ * Fetches the primary representation of a resource based on its media type.
1351
+ * Uses React Query for caching, deduplication, and consistent loading state.
1352
+ */
1353
+ declare function useResourceContent(rUri: ResourceUri, resource: SemiontResource$3): UseResourceContentResult;
1354
+
1378
1355
  interface AnnotationProviderProps {
1379
1356
  annotationManager: AnnotationManager;
1380
1357
  children: React__default.ReactNode;
@@ -1388,6 +1365,8 @@ interface AnnotationProviderProps {
1388
1365
  * Example usage:
1389
1366
  * ```typescript
1390
1367
  * // In app (apps/frontend/src/hooks/useAnnotationManager.ts)
1368
+ * import { uriToAnnotationIdOrPassthrough } from '@semiont/core';
1369
+ *
1391
1370
  * function useAnnotationManager(): AnnotationManager {
1392
1371
  * const annotations = useAnnotations();
1393
1372
  * const createMutation = annotations.create.useMutation();
@@ -1402,7 +1381,7 @@ interface AnnotationProviderProps {
1402
1381
  * return result.annotation;
1403
1382
  * },
1404
1383
  * deleteAnnotation: async (params) => {
1405
- * const annotationIdSegment = params.annotationId.split('/').pop() || params.annotationId;
1384
+ * const annotationIdSegment = uriToAnnotationIdOrPassthrough(params.annotationId);
1406
1385
  * await deleteMutation.mutateAsync(resourceAnnotationUri(`${params.rUri}/annotations/${annotationIdSegment}`));
1407
1386
  * }
1408
1387
  * };
@@ -1424,51 +1403,42 @@ declare function AnnotationProvider({ annotationManager, children }: AnnotationP
1424
1403
  */
1425
1404
  declare function useAnnotationManager(): AnnotationManager;
1426
1405
 
1427
- interface AnnotationUIContextType {
1428
- newAnnotationIds: Set<string>;
1429
- clearNewAnnotationId: (id: AnnotationUri) => void;
1430
- triggerSparkleAnimation: (annotationId: string) => void;
1431
- }
1432
- interface AnnotationUIProviderProps {
1433
- children: React__default.ReactNode;
1406
+ interface ApiClientProviderProps {
1407
+ baseUrl: string;
1408
+ children: ReactNode;
1434
1409
  }
1435
1410
  /**
1436
- * Annotation UI Provider
1437
- *
1438
- * Manages UI-only state for annotation interactions (sparkle animations).
1439
- * This is NOT part of the Provider Pattern - it's internal react-ui state management.
1440
- *
1441
- * Usage:
1442
- * ```typescript
1443
- * <AnnotationUIProvider>
1444
- * <ResourceViewer ... />
1445
- * </AnnotationUIProvider>
1446
- * ```
1411
+ * Provider for API client - creates a stateless singleton client
1412
+ * The client instance never changes (no token dependency)
1413
+ * Auth tokens are passed per-request via useAuthToken() in calling code
1447
1414
  */
1448
- declare function AnnotationUIProvider({ children }: AnnotationUIProviderProps): react_jsx_runtime.JSX.Element;
1415
+ declare function ApiClientProvider({ baseUrl: url, children, }: ApiClientProviderProps): react_jsx_runtime.JSX.Element;
1449
1416
  /**
1450
- * Hook to access annotation UI state
1451
- *
1452
- * @throws Error if used outside AnnotationUIProvider
1453
- * @returns AnnotationUI context
1417
+ * Hook to access the stateless API client singleton
1418
+ * Must be used within an ApiClientProvider
1419
+ * @returns Stateless SemiontApiClient instance
1454
1420
  */
1455
- declare function useAnnotationUI(): AnnotationUIContextType;
1421
+ declare function useApiClient(): SemiontApiClient;
1456
1422
 
1457
- interface ApiClientProviderProps {
1458
- apiClientManager: ApiClientManager;
1423
+ interface AuthTokenProviderProps {
1424
+ token: string | null;
1459
1425
  children: ReactNode;
1460
1426
  }
1461
1427
  /**
1462
- * Provider for API client management
1463
- * Apps must provide an ApiClientManager implementation
1428
+ * Provider for auth token
1429
+ * Pass the current token value - React handles the rest
1464
1430
  */
1465
- declare function ApiClientProvider({ apiClientManager, children, }: ApiClientProviderProps): react_jsx_runtime.JSX.Element;
1431
+ declare function AuthTokenProvider({ token, children, }: AuthTokenProviderProps): react_jsx_runtime.JSX.Element;
1466
1432
  /**
1467
- * Hook to access the API client
1468
- * Must be used within an ApiClientProvider
1469
- * @returns API client instance (null if not authenticated)
1433
+ * Hook to get current auth token
1434
+ *
1435
+ * Returns the current token value from context.
1436
+ * Re-renders automatically when token changes (normal React behavior).
1437
+ *
1438
+ * @returns Current access token (null if not authenticated)
1439
+ * @throws Error if used outside AuthTokenProvider
1470
1440
  */
1471
- declare function useApiClient(): _semiont_api_client.SemiontApiClient | null;
1441
+ declare function useAuthToken(): string | null;
1472
1442
 
1473
1443
  interface CacheProviderProps {
1474
1444
  cacheManager: CacheManager;
@@ -1512,60 +1482,56 @@ declare function CacheProvider({ cacheManager, children }: CacheProviderProps):
1512
1482
  */
1513
1483
  declare function useCacheManager(): CacheManager;
1514
1484
 
1515
- /**
1516
- * Selection data for annotation creation
1517
- */
1518
- interface SelectionData {
1519
- exact: string;
1520
- start: number;
1521
- end: number;
1522
- svgSelector?: string;
1523
- fragmentSelector?: string;
1524
- conformsTo?: string;
1525
- prefix?: string;
1526
- suffix?: string;
1485
+ interface ResolutionFlowConfig {
1486
+ client: SemiontApiClient;
1487
+ resourceUri: ResourceUri;
1527
1488
  }
1528
- type EventBus = ReturnType<typeof mitt<MakeMeaningEventMap>>;
1529
- interface MakeMeaningEventBusProviderProps {
1530
- rUri: ResourceUri;
1531
- children: ReactNode;
1489
+ interface ResolutionFlowState {
1490
+ searchModalOpen: boolean;
1491
+ pendingReferenceId: string | null;
1492
+ onCloseSearchModal: () => void;
1532
1493
  }
1533
1494
  /**
1534
- * Unified event bus provider for all events (backend + UI)
1495
+ * Hook that handles the Resolution capability: resolving reference annotations
1496
+ * to existing resources (search) or new resources (manual creation).
1535
1497
  *
1536
- * Backend events: Make-meaning's event-sourced domain events from SSE
1537
- * UI events: Local user interactions (enables real-time collaboration)
1498
+ * Handles: annotation:update-body, reference:link, resolution:search-requested
1538
1499
  *
1539
- * This unified bus allows:
1540
- * 1. Components to emit UI events (selections, requests)
1541
- * 2. Other components to react to those events
1542
- * 3. Backend events to flow through the same bus
1543
- * 4. Foundation for peer-to-peer real-time collaboration
1500
+ * @param emitter - The mitt event bus instance
1501
+ * @param config - Configuration including API client and resource URI
1502
+ * @returns Resolution flow state (search modal open state and close handler)
1544
1503
  */
1545
- declare function MakeMeaningEventBusProvider({ rUri, children }: MakeMeaningEventBusProviderProps): react_jsx_runtime.JSX.Element;
1504
+ declare function useResolutionFlow(emitter: Emitter<EventMap>, config: ResolutionFlowConfig): ResolutionFlowState;
1505
+
1546
1506
  /**
1547
- * Hook to access make-meaning event bus
1507
+ * Subscribe to an event bus event with automatic cleanup.
1548
1508
  *
1549
- * Use this to subscribe to make-meaning's domain events directly.
1550
- * Think in detection, generation, annotation semantics - not HTTP.
1509
+ * This hook solves the "stale closure" problem by always using the latest
1510
+ * version of the handler without re-subscribing.
1551
1511
  *
1552
1512
  * @example
1553
- * ```typescript
1554
- * const eventBus = useMakeMeaningEvents();
1555
- *
1556
- * useEffect(() => {
1557
- * // Listen to make-meaning's detection progress
1558
- * const handler = (event) => {
1559
- * console.log('Make-meaning is detecting:', event.payload.currentStep);
1560
- * console.log('Found so far:', event.payload.foundCount);
1561
- * };
1513
+ * ```tsx
1514
+ * useEventSubscription('annotation:created', ({ annotation }) => {
1515
+ * // This always uses the latest props/state
1516
+ * triggerSparkleAnimation(annotation.id);
1517
+ * });
1518
+ * ```
1519
+ */
1520
+ declare function useEventSubscription<K extends keyof EventMap>(eventName: K, handler: (payload: EventMap[K]) => void): void;
1521
+ /**
1522
+ * Subscribe to multiple events at once.
1562
1523
  *
1563
- * eventBus.on('detection:progress', handler);
1564
- * return () => eventBus.off('detection:progress', handler);
1565
- * }, [eventBus]);
1524
+ * @example
1525
+ * ```tsx
1526
+ * useEventSubscriptions({
1527
+ * 'annotation:created': ({ annotation }) => setNewAnnotation(annotation),
1528
+ * 'annotation:deleted': ({ annotationId }) => removeAnnotation(annotationId),
1529
+ * });
1566
1530
  * ```
1567
1531
  */
1568
- declare function useMakeMeaningEvents(): EventBus;
1532
+ declare function useEventSubscriptions(subscriptions: {
1533
+ [K in keyof EventMap]?: (payload: EventMap[K]) => void;
1534
+ }): void;
1569
1535
 
1570
1536
  /**
1571
1537
  * Provider Pattern: Accepts OpenResourcesManager implementation as prop
@@ -1594,11 +1560,10 @@ declare function OpenResourcesProvider({ openResourcesManager, children }: {
1594
1560
  */
1595
1561
  declare function useOpenResources(): OpenResourcesManager;
1596
1562
 
1597
- type Annotation$j = components['schemas']['Annotation'];
1563
+ type Annotation$h = components['schemas']['Annotation'];
1598
1564
  interface ResourceAnnotationsContextType {
1599
1565
  newAnnotationIds: Set<string>;
1600
- createAnnotation: (rUri: ResourceUri, motivation: 'highlighting' | 'linking' | 'assessing' | 'commenting' | 'tagging', selector: Selector | Selector[], body?: any[]) => Promise<Annotation$j | undefined>;
1601
- deleteAnnotation: (annotationId: string, rUri: ResourceUri) => Promise<void>;
1566
+ createAnnotation: (rUri: ResourceUri, motivation: 'highlighting' | 'linking' | 'assessing' | 'commenting' | 'tagging', selector: Selector | Selector[], body?: any[]) => Promise<Annotation$h | undefined>;
1602
1567
  clearNewAnnotationId: (id: AnnotationUri) => void;
1603
1568
  triggerSparkleAnimation: (annotationId: string) => void;
1604
1569
  }
@@ -1741,18 +1706,16 @@ declare function usePreloadTranslations(): {
1741
1706
  isLoaded: (locale: string) => boolean;
1742
1707
  };
1743
1708
 
1744
- type Annotation$i = components['schemas']['Annotation'];
1709
+ type Annotation$g = components['schemas']['Annotation'];
1745
1710
  interface TextSegment {
1746
1711
  exact: string;
1747
- annotation?: Annotation$i;
1712
+ annotation?: Annotation$g;
1748
1713
  start: number;
1749
1714
  end: number;
1750
1715
  }
1751
1716
  interface Props$b {
1752
1717
  content: string;
1753
- segments: TextSegment[];
1754
- onAnnotationClick?: (annotation: Annotation$i) => void;
1755
- onAnnotationHover?: (annotationId: string | null) => void;
1718
+ segments?: TextSegment[];
1756
1719
  onTextSelect?: (exact: string, position: {
1757
1720
  start: number;
1758
1721
  end: number;
@@ -1766,23 +1729,23 @@ interface Props$b {
1766
1729
  sourceView?: boolean;
1767
1730
  showLineNumbers?: boolean;
1768
1731
  enableWidgets?: boolean;
1769
- onEntityTypeClick?: (entityType: string) => void;
1770
- onReferenceNavigate?: (documentId: string) => void;
1771
- onUnresolvedReferenceClick?: (annotation: Annotation$i) => void;
1732
+ eventBus?: EventBus;
1772
1733
  getTargetDocumentName?: (documentId: string) => string | undefined;
1773
1734
  generatingReferenceId?: string | null;
1774
- onDeleteAnnotation?: (annotation: Annotation$i) => void;
1775
- annotators: Record<string, Annotator>;
1776
1735
  }
1777
- declare function CodeMirrorRenderer({ content, segments, onAnnotationClick, onAnnotationHover, onChange, editable, newAnnotationIds, hoveredAnnotationId, hoveredCommentId, scrollToAnnotationId, sourceView, showLineNumbers, enableWidgets, onEntityTypeClick, onReferenceNavigate, onUnresolvedReferenceClick, getTargetDocumentName, generatingReferenceId, onDeleteAnnotation, annotators }: Props$b): react_jsx_runtime.JSX.Element;
1736
+ declare function CodeMirrorRenderer({ content, segments, onChange, editable, newAnnotationIds, hoveredAnnotationId, hoveredCommentId, scrollToAnnotationId, sourceView, showLineNumbers, enableWidgets, eventBus, getTargetDocumentName, generatingReferenceId }: Props$b): react_jsx_runtime.JSX.Element;
1778
1737
 
1779
- type Motivation$9 = components['schemas']['Motivation'];
1738
+ type Motivation$6 = components['schemas']['Motivation'];
1780
1739
  interface DetectionProgressWidgetProps {
1781
1740
  progress: DetectionProgress | null;
1782
- onCancel?: () => void;
1783
- annotationType?: Motivation$9 | 'reference';
1741
+ annotationType?: Motivation$6 | 'reference';
1784
1742
  }
1785
- declare function DetectionProgressWidget({ progress, onCancel, annotationType }: DetectionProgressWidgetProps): react_jsx_runtime.JSX.Element | null;
1743
+ /**
1744
+ * Widget for displaying detection progress with cancel functionality
1745
+ *
1746
+ * @emits job:cancel-requested - User requested to cancel detection job. Payload: { jobType: string }
1747
+ */
1748
+ declare function DetectionProgressWidget({ progress, annotationType }: DetectionProgressWidgetProps): react_jsx_runtime.JSX.Element | null;
1786
1749
 
1787
1750
  interface Props$a {
1788
1751
  children: ReactNode;
@@ -1812,7 +1775,7 @@ declare function AsyncErrorBoundary({ children }: {
1812
1775
  children: ReactNode;
1813
1776
  }): react_jsx_runtime.JSX.Element;
1814
1777
 
1815
- type Annotation$h = components['schemas']['Annotation'];
1778
+ type Annotation$f = components['schemas']['Annotation'];
1816
1779
  interface LiveRegionContextType {
1817
1780
  announce: (message: string, priority?: 'polite' | 'assertive') => void;
1818
1781
  }
@@ -1828,9 +1791,9 @@ declare function useSearchAnnouncements(): {
1828
1791
  declare function useDocumentAnnouncements(annotators?: Record<string, Annotator>): {
1829
1792
  announceDocumentSaved: () => void;
1830
1793
  announceDocumentDeleted: () => void;
1831
- announceAnnotationCreated: (annotation: Annotation$h) => void;
1794
+ announceAnnotationCreated: (annotation: Annotation$f) => void;
1832
1795
  announceAnnotationDeleted: () => void;
1833
- announceAnnotationUpdated: (annotation: Annotation$h) => void;
1796
+ announceAnnotationUpdated: (annotation: Annotation$f) => void;
1834
1797
  announceError: (message: string) => void;
1835
1798
  };
1836
1799
  declare function useResourceLoadingAnnouncements(): {
@@ -1924,25 +1887,33 @@ type ToolbarContext = 'document' | 'simple';
1924
1887
  interface Props$9<T extends string = string> {
1925
1888
  context: ToolbarContext;
1926
1889
  activePanel: T | null;
1927
- onPanelToggle: (panel: T) => void;
1928
1890
  isArchived?: boolean;
1929
1891
  }
1930
- declare function Toolbar<T extends string = string>({ context, activePanel, onPanelToggle, isArchived }: Props$9<T>): react_jsx_runtime.JSX.Element;
1892
+ /**
1893
+ * Toolbar component for panel navigation
1894
+ *
1895
+ * @emits panel:toggle - Toggle panel visibility. Payload: { panel: string }
1896
+ */
1897
+ declare function Toolbar<T extends string = string>({ context, activePanel, isArchived }: Props$9<T>): react_jsx_runtime.JSX.Element;
1931
1898
 
1932
1899
  interface SettingsPanelProps {
1933
1900
  showLineNumbers: boolean;
1934
- onLineNumbersToggle: () => void;
1935
1901
  theme: 'light' | 'dark' | 'system';
1936
- onThemeChange: (theme: 'light' | 'dark' | 'system') => void;
1937
1902
  locale: string;
1938
- onLocaleChange: (locale: string) => void;
1939
1903
  isPendingLocaleChange?: boolean;
1940
1904
  }
1941
- declare function SettingsPanel({ showLineNumbers, onLineNumbersToggle, theme, onThemeChange, locale, onLocaleChange, isPendingLocaleChange }: SettingsPanelProps): react_jsx_runtime.JSX.Element;
1905
+ /**
1906
+ * Settings panel for application preferences
1907
+ *
1908
+ * @emits settings:locale-changed - Locale changed by user. Payload: { locale: string }
1909
+ * @emits settings:line-numbers-toggled - Line numbers toggled on/off. Payload: undefined
1910
+ * @emits settings:theme-changed - Theme changed by user. Payload: { theme: 'light' | 'dark' | 'system' }
1911
+ */
1912
+ declare function SettingsPanel({ showLineNumbers, theme, locale, isPendingLocaleChange }: SettingsPanelProps): react_jsx_runtime.JSX.Element;
1942
1913
 
1943
- type Annotation$g = components['schemas']['Annotation'];
1914
+ type Annotation$e = components['schemas']['Annotation'];
1944
1915
  interface JsonLdViewProps {
1945
- annotation: Annotation$g;
1916
+ annotation: Annotation$e;
1946
1917
  onBack: () => void;
1947
1918
  }
1948
1919
  declare function JsonLdView({ annotation, onBack }: JsonLdViewProps): react_jsx_runtime.JSX.Element;
@@ -1973,40 +1944,43 @@ interface PopupContainerProps {
1973
1944
  }
1974
1945
  declare function PopupContainer({ children, position, onClose, isOpen, wide }: PopupContainerProps): react_jsx_runtime.JSX.Element;
1975
1946
 
1976
- type Annotation$f = components['schemas']['Annotation'];
1947
+ type Annotation$d = components['schemas']['Annotation'];
1977
1948
  interface AnnotationOverlayProps {
1978
- annotations: Annotation$f[];
1949
+ annotations: Annotation$d[];
1979
1950
  imageWidth: number;
1980
1951
  imageHeight: number;
1981
1952
  displayWidth: number;
1982
1953
  displayHeight: number;
1983
- onAnnotationClick?: (annotation: Annotation$f) => void;
1984
- onAnnotationHover?: (annotationId: string | null) => void;
1954
+ eventBus?: EventBus;
1985
1955
  hoveredAnnotationId?: string | null;
1986
1956
  selectedAnnotationId?: string | null;
1987
1957
  }
1988
1958
  /**
1989
1959
  * Render annotation overlay - displays existing annotations as SVG shapes
1960
+ *
1961
+ * @emits annotation:hover - Annotation hovered or unhovered. Payload: { annotationId: string | null }
1962
+ * @emits annotation:click - Annotation clicked. Payload: { annotationId: string, motivation: Motivation }
1990
1963
  */
1991
- declare function AnnotationOverlay({ annotations, imageWidth, imageHeight, displayWidth, displayHeight, onAnnotationClick, onAnnotationHover, hoveredAnnotationId, selectedAnnotationId }: AnnotationOverlayProps): react_jsx_runtime.JSX.Element;
1964
+ declare function AnnotationOverlay({ annotations, imageWidth, imageHeight, displayWidth, displayHeight, eventBus, hoveredAnnotationId, selectedAnnotationId }: AnnotationOverlayProps): react_jsx_runtime.JSX.Element;
1992
1965
 
1993
- type Annotation$e = components['schemas']['Annotation'];
1966
+ type Annotation$c = components['schemas']['Annotation'];
1994
1967
  type DrawingMode = 'rectangle' | 'polygon' | 'circle' | 'freeform' | null;
1995
1968
  interface SvgDrawingCanvasProps {
1996
1969
  resourceUri: ResourceUri;
1997
- existingAnnotations?: Annotation$e[];
1970
+ existingAnnotations?: Annotation$c[];
1998
1971
  drawingMode: DrawingMode;
1999
1972
  selectedMotivation?: SelectionMotivation | null;
2000
- onAnnotationCreate?: (svg: string, position?: {
2001
- x: number;
2002
- y: number;
2003
- }) => void;
2004
- onAnnotationClick?: (annotation: Annotation$e) => void;
2005
- onAnnotationHover?: (annotationId: string | null) => void;
1973
+ eventBus?: EventBus;
2006
1974
  hoveredAnnotationId?: string | null;
2007
1975
  selectedAnnotationId?: string | null;
2008
1976
  }
2009
- declare function SvgDrawingCanvas({ resourceUri, existingAnnotations, drawingMode, selectedMotivation, onAnnotationCreate, onAnnotationClick, onAnnotationHover, hoveredAnnotationId, selectedAnnotationId }: SvgDrawingCanvasProps): react_jsx_runtime.JSX.Element;
1977
+ /**
1978
+ * SVG-based drawing canvas for creating image annotations with shapes
1979
+ *
1980
+ * @emits annotation:click - Annotation clicked on canvas. Payload: { annotationId: string, motivation: Motivation }
1981
+ * @emits annotation:requested - New annotation drawn on canvas. Payload: { selector: SvgSelector, motivation: SelectionMotivation }
1982
+ */
1983
+ declare function SvgDrawingCanvas({ resourceUri, existingAnnotations, drawingMode, selectedMotivation, eventBus, hoveredAnnotationId, selectedAnnotationId }: SvgDrawingCanvasProps): react_jsx_runtime.JSX.Element;
2010
1984
 
2011
1985
  interface KeyboardShortcutsHelpModalProps {
2012
1986
  isOpen: boolean;
@@ -2021,37 +1995,30 @@ interface ProposeEntitiesModalProps {
2021
1995
  }
2022
1996
  declare function ProposeEntitiesModal({ isOpen, onConfirm, onCancel }: ProposeEntitiesModalProps): react_jsx_runtime.JSX.Element;
2023
1997
 
2024
- type Annotation$d = components['schemas']['Annotation'];
2025
- type Motivation$8 = components['schemas']['Motivation'];
2026
- interface PendingAnnotation$7 {
2027
- selector: Selector | Selector[];
2028
- motivation: Motivation$8;
2029
- }
2030
-
2031
1998
  interface Props$8 {
2032
1999
  content: string;
2033
2000
  mimeType?: string;
2034
2001
  resourceUri?: string;
2035
2002
  annotations: AnnotationsCollection;
2036
- handlers?: AnnotationHandlers;
2037
- creationHandler?: AnnotationCreationHandler;
2038
2003
  uiState: AnnotationUIState;
2039
2004
  onUIStateChange?: (state: Partial<AnnotationUIState>) => void;
2040
2005
  editable?: boolean;
2041
2006
  enableWidgets?: boolean;
2042
- onEntityTypeClick?: (entityType: string) => void;
2043
- onReferenceNavigate?: (documentId: string) => void;
2044
- onUnresolvedReferenceClick?: (annotation: Annotation$d) => void;
2045
2007
  getTargetDocumentName?: (documentId: string) => string | undefined;
2046
2008
  generatingReferenceId?: string | null;
2047
- onDeleteAnnotation?: (annotation: Annotation$d) => void;
2048
2009
  showLineNumbers?: boolean;
2049
2010
  annotateMode: boolean;
2050
- onAnnotateModeToggle: () => void;
2051
- onAnnotationRequested?: (pending: PendingAnnotation$7) => void;
2052
- annotators: Record<string, Annotator>;
2053
2011
  }
2054
- declare function AnnotateView({ content, mimeType, resourceUri, annotations, handlers, creationHandler, uiState, onUIStateChange, enableWidgets, onEntityTypeClick, onReferenceNavigate, onUnresolvedReferenceClick, getTargetDocumentName, generatingReferenceId, onDeleteAnnotation, showLineNumbers, annotateMode, onAnnotateModeToggle, onAnnotationRequested, annotators }: Props$8): react_jsx_runtime.JSX.Element;
2012
+ /**
2013
+ * View component for annotating resources with text selection and drawing
2014
+ *
2015
+ * @emits annotation:requested - User requested to create annotation. Payload: { selector: Selector | Selector[], motivation: SelectionMotivation }
2016
+ * @subscribes toolbar:selection-changed - Toolbar selection changed. Payload: { motivation: string | null }
2017
+ * @subscribes toolbar:click-changed - Toolbar click action changed. Payload: { action: string }
2018
+ * @subscribes toolbar:shape-changed - Toolbar shape changed. Payload: { shape: string }
2019
+ * @subscribes annotation:hover - Annotation hovered. Payload: { annotationId: string | null }
2020
+ */
2021
+ declare function AnnotateView({ content, mimeType, resourceUri, annotations, uiState, onUIStateChange, enableWidgets, getTargetDocumentName, generatingReferenceId, showLineNumbers, annotateMode }: Props$8): react_jsx_runtime.JSX.Element;
2055
2022
 
2056
2023
  interface Props$7 {
2057
2024
  rUri: ResourceUri;
@@ -2068,16 +2035,21 @@ interface Props$6 {
2068
2035
  mimeType: string;
2069
2036
  resourceUri: string;
2070
2037
  annotations: AnnotationsCollection;
2071
- handlers?: AnnotationHandlers;
2072
2038
  hoveredAnnotationId?: string | null;
2073
2039
  hoveredCommentId?: string | null;
2074
2040
  selectedClick?: ClickAction;
2075
- onClickChange?: (motivation: ClickAction) => void;
2076
2041
  annotateMode: boolean;
2077
- onAnnotateModeToggle: () => void;
2078
- annotators: Record<string, Annotator>;
2079
2042
  }
2080
- declare function BrowseView({ content, mimeType, resourceUri, annotations, handlers, hoveredAnnotationId, hoveredCommentId, selectedClick, onClickChange, annotateMode, onAnnotateModeToggle, annotators }: Props$6): react_jsx_runtime.JSX.Element;
2043
+ /**
2044
+ * View component for browsing annotated resources in read-only mode
2045
+ *
2046
+ * @emits annotation:click - User clicked on annotation. Payload: { annotationId: string, motivation: Motivation }
2047
+ * @emits annotation:hover - User hovered over annotation. Payload: { annotationId: string | null }
2048
+ *
2049
+ * @subscribes annotation:hover - Highlight annotation on hover. Payload: { annotationId: string | null }
2050
+ * @subscribes annotation:focus - Scroll to and highlight annotation. Payload: { annotationId: string }
2051
+ */
2052
+ declare function BrowseView({ content, mimeType, resourceUri, annotations, selectedClick, annotateMode }: Props$6): react_jsx_runtime.JSX.Element;
2081
2053
 
2082
2054
  type TranslateFn$4 = (key: string, params?: Record<string, string | number>) => string;
2083
2055
  interface Props$5 {
@@ -2095,11 +2067,6 @@ interface Props$5 {
2095
2067
  declare function HistoryEvent({ event, annotations, allEvents, isRelated, t, Link, routes, onEventRef, onEventClick, onEventHover }: Props$5): react_jsx_runtime.JSX.Element;
2096
2068
 
2097
2069
  type SemiontResource$2 = components['schemas']['ResourceDescriptor'];
2098
- type Motivation$7 = components['schemas']['Motivation'];
2099
- interface PendingAnnotation$6 {
2100
- selector: Selector | Selector[];
2101
- motivation: Motivation$7;
2102
- }
2103
2070
  /**
2104
2071
  * ResourceViewer - Display and interact with resource content and annotations
2105
2072
  *
@@ -2125,36 +2092,40 @@ interface Props$4 {
2125
2092
  annotations: AnnotationsCollection;
2126
2093
  generatingReferenceId?: string | null;
2127
2094
  showLineNumbers?: boolean;
2128
- onAnnotationRequested?: (pending: PendingAnnotation$6) => void;
2129
- annotators: Record<string, Annotator>;
2095
+ hoveredAnnotationId?: string | null;
2130
2096
  }
2131
- declare function ResourceViewer({ resource, annotations, generatingReferenceId, showLineNumbers, onAnnotationRequested, annotators }: Props$4): react_jsx_runtime.JSX.Element;
2097
+ /**
2098
+ * @emits annotation:delete - User requested to delete annotation. Payload: { annotationId: string }
2099
+ * @emits panel:open - Request to open panel with annotation. Payload: { panel: string, scrollToAnnotationId?: string, motivation?: Motivation }
2100
+ *
2101
+ * @subscribes view:mode-toggled - Toggles between browse and annotate mode. Payload: { mode: 'browse' | 'annotate' }
2102
+ * @subscribes annotation:added - New annotation was added. Payload: { annotation: Annotation }
2103
+ * @subscribes annotation:removed - Annotation was removed. Payload: { annotationId: string }
2104
+ * @subscribes annotation:updated - Annotation was updated. Payload: { annotation: Annotation }
2105
+ * @subscribes toolbar:selection-changed - Text selection tool changed. Payload: { selection: boolean }
2106
+ * @subscribes toolbar:click-changed - Click annotation tool changed. Payload: { click: 'detail' | 'scroll' | null }
2107
+ * @subscribes toolbar:shape-changed - Drawing shape changed. Payload: { shape: string }
2108
+ * @subscribes annotation:click - User clicked on annotation. Payload: { annotationId: string }
2109
+ */
2110
+ declare function ResourceViewer({ resource, annotations, generatingReferenceId, showLineNumbers, hoveredAnnotationId: hoveredAnnotationIdProp }: Props$4): react_jsx_runtime.JSX.Element;
2132
2111
 
2133
- type Annotation$c = components['schemas']['Annotation'];
2112
+ type Annotation$b = components['schemas']['Annotation'];
2134
2113
  interface AssessmentEntryProps {
2135
- assessment: Annotation$c;
2114
+ assessment: Annotation$b;
2136
2115
  isFocused: boolean;
2137
- onClick: () => void;
2138
- onAssessmentRef: (assessmentId: string, el: HTMLElement | null) => void;
2139
- onAssessmentHover?: (assessmentId: string | null) => void;
2116
+ isHovered?: boolean;
2140
2117
  }
2141
- declare function AssessmentEntry({ assessment, isFocused, onClick, onAssessmentRef, onAssessmentHover, }: AssessmentEntryProps): react_jsx_runtime.JSX.Element;
2118
+ declare const AssessmentEntry: React$1.ForwardRefExoticComponent<AssessmentEntryProps & React$1.RefAttributes<HTMLDivElement>>;
2142
2119
 
2143
- type Annotation$b = components['schemas']['Annotation'];
2144
- type Motivation$6 = components['schemas']['Motivation'];
2145
- interface PendingAnnotation$5 {
2120
+ type Annotation$a = components['schemas']['Annotation'];
2121
+ type Motivation$5 = components['schemas']['Motivation'];
2122
+ interface PendingAnnotation$6 {
2146
2123
  selector: Selector | Selector[];
2147
- motivation: Motivation$6;
2124
+ motivation: Motivation$5;
2148
2125
  }
2149
2126
  interface AssessmentPanelProps {
2150
- annotations: Annotation$b[];
2151
- onAnnotationClick: (annotation: Annotation$b) => void;
2152
- focusedAnnotationId: string | null;
2153
- hoveredAnnotationId?: string | null;
2154
- onAnnotationHover?: (annotationId: string | null) => void;
2155
- onCreate: (assessmentText: string) => void;
2156
- pendingAnnotation: PendingAnnotation$5 | null;
2157
- onDetect?: (instructions?: string) => void | Promise<void>;
2127
+ annotations: Annotation$a[];
2128
+ pendingAnnotation: PendingAnnotation$6 | null;
2158
2129
  isDetecting?: boolean;
2159
2130
  detectionProgress?: {
2160
2131
  status: string;
@@ -2162,8 +2133,18 @@ interface AssessmentPanelProps {
2162
2133
  message?: string;
2163
2134
  } | null;
2164
2135
  annotateMode?: boolean;
2136
+ scrollToAnnotationId?: string | null;
2137
+ onScrollCompleted?: () => void;
2138
+ hoveredAnnotationId?: string | null;
2165
2139
  }
2166
- declare function AssessmentPanel({ annotations, onAnnotationClick, focusedAnnotationId, hoveredAnnotationId, onAnnotationHover, onCreate, pendingAnnotation, onDetect, isDetecting, detectionProgress, annotateMode, }: AssessmentPanelProps): react_jsx_runtime.JSX.Element;
2140
+ /**
2141
+ * Panel for managing assessment annotations with text input
2142
+ *
2143
+ * @emits annotation:create - Create new assessment annotation. Payload: { motivation: 'assessing', selector: Selector | Selector[], body: Body[] }
2144
+ * @emits annotation:cancel-pending - Cancel pending assessment annotation. Payload: undefined
2145
+ * @subscribes annotation:click - Annotation clicked. Payload: { annotationId: string }
2146
+ */
2147
+ declare function AssessmentPanel({ annotations, pendingAnnotation, isDetecting, detectionProgress, annotateMode, scrollToAnnotationId, onScrollCompleted, hoveredAnnotationId, }: AssessmentPanelProps): react_jsx_runtime.JSX.Element;
2167
2148
 
2168
2149
  interface Props$3 {
2169
2150
  isConnected: boolean;
@@ -2172,41 +2153,43 @@ interface Props$3 {
2172
2153
  }
2173
2154
  declare function CollaborationPanel({ isConnected, eventCount, lastEventTimestamp }: Props$3): react_jsx_runtime.JSX.Element;
2174
2155
 
2175
- type Annotation$a = components['schemas']['Annotation'];
2156
+ type Annotation$9 = components['schemas']['Annotation'];
2176
2157
  interface CommentEntryProps {
2177
- comment: Annotation$a;
2158
+ comment: Annotation$9;
2178
2159
  isFocused: boolean;
2179
- onClick: () => void;
2180
- onCommentRef: (commentId: string, el: HTMLElement | null) => void;
2181
- onCommentHover?: (commentId: string | null) => void;
2160
+ isHovered?: boolean;
2182
2161
  annotateMode?: boolean;
2183
2162
  }
2184
- declare function CommentEntry({ comment, isFocused, onClick, onCommentRef, onCommentHover, annotateMode, }: CommentEntryProps): react_jsx_runtime.JSX.Element;
2163
+ declare const CommentEntry: React$1.ForwardRefExoticComponent<CommentEntryProps & React$1.RefAttributes<HTMLDivElement>>;
2185
2164
 
2186
- type Annotation$9 = components['schemas']['Annotation'];
2187
- type Motivation$5 = components['schemas']['Motivation'];
2188
- interface PendingAnnotation$4 {
2165
+ type Annotation$8 = components['schemas']['Annotation'];
2166
+ type Motivation$4 = components['schemas']['Motivation'];
2167
+ interface PendingAnnotation$5 {
2189
2168
  selector: Selector | Selector[];
2190
- motivation: Motivation$5;
2169
+ motivation: Motivation$4;
2191
2170
  }
2192
2171
  interface CommentsPanelProps {
2193
- annotations: Annotation$9[];
2194
- onAnnotationClick: (annotation: Annotation$9) => void;
2195
- onCreate: (commentText: string) => void;
2196
- focusedAnnotationId: string | null;
2197
- hoveredAnnotationId?: string | null;
2198
- onAnnotationHover?: (annotationId: string | null) => void;
2199
- pendingAnnotation: PendingAnnotation$4 | null;
2172
+ annotations: Annotation$8[];
2173
+ pendingAnnotation: PendingAnnotation$5 | null;
2200
2174
  annotateMode?: boolean;
2201
- onDetect?: (instructions?: string, tone?: string) => void | Promise<void>;
2202
2175
  isDetecting?: boolean;
2203
2176
  detectionProgress?: {
2204
2177
  status: string;
2205
2178
  percentage?: number;
2206
2179
  message?: string;
2207
2180
  } | null;
2181
+ scrollToAnnotationId?: string | null;
2182
+ onScrollCompleted?: () => void;
2183
+ hoveredAnnotationId?: string | null;
2208
2184
  }
2209
- declare function CommentsPanel({ annotations, onAnnotationClick, onCreate, focusedAnnotationId, hoveredAnnotationId, onAnnotationHover, pendingAnnotation, annotateMode, onDetect, isDetecting, detectionProgress, }: CommentsPanelProps): react_jsx_runtime.JSX.Element;
2185
+ /**
2186
+ * Panel for managing comment annotations with text input
2187
+ *
2188
+ * @emits annotation:create - Create new comment annotation. Payload: { motivation: 'commenting', selector: Selector | Selector[], body: Body[] }
2189
+ * @emits annotation:cancel-pending - Cancel pending comment annotation. Payload: undefined
2190
+ * @subscribes annotation:click - Annotation clicked. Payload: { annotationId: string }
2191
+ */
2192
+ declare function CommentsPanel({ annotations, pendingAnnotation, annotateMode, isDetecting, detectionProgress, scrollToAnnotationId, onScrollCompleted, hoveredAnnotationId, }: CommentsPanelProps): react_jsx_runtime.JSX.Element;
2210
2193
 
2211
2194
  interface DetectSectionProps {
2212
2195
  annotationType: 'highlight' | 'assessment' | 'comment';
@@ -2220,7 +2203,6 @@ interface DetectSectionProps {
2220
2203
  value: string;
2221
2204
  }>;
2222
2205
  } | null | undefined;
2223
- onDetect: (instructions?: string, tone?: string, density?: number) => void | Promise<void>;
2224
2206
  }
2225
2207
  /**
2226
2208
  * Shared detect section for Highlight, Assessment, and Comment panels
@@ -2230,34 +2212,29 @@ interface DetectSectionProps {
2230
2212
  * - Optional tone selector (for comments)
2231
2213
  * - Detect button with sparkle animation
2232
2214
  * - Progress display during detection
2215
+ *
2216
+ * @emits detection:start - Start detection for annotation type. Payload: { motivation: Motivation, options: { instructions?: string, tone?: string, density?: number } }
2217
+ * @emits detection:dismiss-progress - Dismiss the detection progress display
2233
2218
  */
2234
- declare function DetectSection({ annotationType, isDetecting, detectionProgress, onDetect }: DetectSectionProps): react_jsx_runtime.JSX.Element;
2219
+ declare function DetectSection({ annotationType, isDetecting, detectionProgress, }: DetectSectionProps): react_jsx_runtime.JSX.Element;
2235
2220
 
2236
- type Annotation$8 = components['schemas']['Annotation'];
2221
+ type Annotation$7 = components['schemas']['Annotation'];
2237
2222
  interface HighlightEntryProps {
2238
- highlight: Annotation$8;
2223
+ highlight: Annotation$7;
2239
2224
  isFocused: boolean;
2240
- onClick: () => void;
2241
- onHighlightRef: (highlightId: string, el: HTMLElement | null) => void;
2242
- onHighlightHover?: (highlightId: string | null) => void;
2225
+ isHovered?: boolean;
2243
2226
  }
2244
- declare function HighlightEntry({ highlight, isFocused, onClick, onHighlightRef, onHighlightHover, }: HighlightEntryProps): react_jsx_runtime.JSX.Element;
2227
+ declare const HighlightEntry: React$1.ForwardRefExoticComponent<HighlightEntryProps & React$1.RefAttributes<HTMLDivElement>>;
2245
2228
 
2246
- type Annotation$7 = components['schemas']['Annotation'];
2247
- type Motivation$4 = components['schemas']['Motivation'];
2248
- interface PendingAnnotation$3 {
2229
+ type Annotation$6 = components['schemas']['Annotation'];
2230
+ type Motivation$3 = components['schemas']['Motivation'];
2231
+ interface PendingAnnotation$4 {
2249
2232
  selector: Selector | Selector[];
2250
- motivation: Motivation$4;
2233
+ motivation: Motivation$3;
2251
2234
  }
2252
2235
  interface HighlightPanelProps {
2253
- annotations: Annotation$7[];
2254
- onAnnotationClick: (annotation: Annotation$7) => void;
2255
- focusedAnnotationId: string | null;
2256
- hoveredAnnotationId?: string | null;
2257
- onAnnotationHover?: (annotationId: string | null) => void;
2258
- onDetect?: (instructions?: string) => void | Promise<void>;
2259
- onCreate: (selector: Selector | Selector[]) => void;
2260
- pendingAnnotation: PendingAnnotation$3 | null;
2236
+ annotations: Annotation$6[];
2237
+ pendingAnnotation: PendingAnnotation$4 | null;
2261
2238
  isDetecting?: boolean;
2262
2239
  detectionProgress?: {
2263
2240
  status: string;
@@ -2265,8 +2242,17 @@ interface HighlightPanelProps {
2265
2242
  message?: string;
2266
2243
  } | null;
2267
2244
  annotateMode?: boolean;
2245
+ scrollToAnnotationId?: string | null;
2246
+ onScrollCompleted?: () => void;
2247
+ hoveredAnnotationId?: string | null;
2268
2248
  }
2269
- declare function HighlightPanel({ annotations, onAnnotationClick, focusedAnnotationId, hoveredAnnotationId, onAnnotationHover, onDetect, onCreate, pendingAnnotation, isDetecting, detectionProgress, annotateMode, }: HighlightPanelProps): react_jsx_runtime.JSX.Element;
2249
+ /**
2250
+ * Panel for managing highlight annotations with auto-creation
2251
+ *
2252
+ * @emits annotation:create - Create new highlight annotation (auto-triggered). Payload: { motivation: 'highlighting', selector: Selector | Selector[], body: Body[] }
2253
+ * @subscribes annotation:click - Annotation clicked. Payload: { annotationId: string }
2254
+ */
2255
+ declare function HighlightPanel({ annotations, pendingAnnotation, isDetecting, detectionProgress, annotateMode, scrollToAnnotationId, onScrollCompleted, hoveredAnnotationId, }: HighlightPanelProps): react_jsx_runtime.JSX.Element;
2270
2256
 
2271
2257
  type SemiontResource$1 = components['schemas']['ResourceDescriptor'];
2272
2258
  interface Props$2 {
@@ -2286,28 +2272,19 @@ interface PanelHeaderProps {
2286
2272
  */
2287
2273
  declare function PanelHeader({ count, title }: PanelHeaderProps): react_jsx_runtime.JSX.Element;
2288
2274
 
2289
- type Annotation$6 = components['schemas']['Annotation'];
2275
+ type Annotation$5 = components['schemas']['Annotation'];
2290
2276
  interface ReferenceEntryProps {
2291
- reference: Annotation$6;
2277
+ reference: Annotation$5;
2292
2278
  isFocused: boolean;
2293
- onClick: () => void;
2279
+ isHovered?: boolean;
2294
2280
  routes: RouteBuilder;
2295
- onReferenceRef: (referenceId: string, el: HTMLElement | null) => void;
2296
- onReferenceHover?: (referenceId: string | null) => void;
2297
- onGenerateDocument?: (referenceId: string, options: {
2298
- title: string;
2299
- prompt?: string;
2300
- }) => void;
2301
- onCreateDocument?: (annotationUri: string, title: string, entityTypes: string[]) => void;
2302
- onSearchDocuments?: (referenceId: string, searchTerm: string) => void;
2303
- onUpdateReference?: (referenceId: string, updates: Partial<Annotation$6>) => void;
2304
2281
  annotateMode?: boolean;
2305
2282
  isGenerating?: boolean;
2306
2283
  }
2307
- declare function ReferenceEntry({ reference, isFocused, onClick, routes, onReferenceRef, onReferenceHover, onGenerateDocument, onCreateDocument, onSearchDocuments, onUpdateReference, annotateMode, isGenerating, }: ReferenceEntryProps): react_jsx_runtime.JSX.Element;
2284
+ declare const ReferenceEntry: React$1.ForwardRefExoticComponent<ReferenceEntryProps & React$1.RefAttributes<HTMLDivElement>>;
2308
2285
 
2309
- type Annotation$5 = components['schemas']['Annotation'];
2310
- type Motivation$3 = components['schemas']['Motivation'];
2286
+ type Annotation$4 = components['schemas']['Annotation'];
2287
+ type Motivation$2 = components['schemas']['Motivation'];
2311
2288
  type ResponseContent<T> = T extends {
2312
2289
  responses: {
2313
2290
  200: {
@@ -2318,37 +2295,35 @@ type ResponseContent<T> = T extends {
2318
2295
  };
2319
2296
  } ? R : never;
2320
2297
  type ReferencedBy = ResponseContent<paths['/resources/{id}/referenced-by']['get']>['referencedBy'][number];
2321
- interface PendingAnnotation$2 {
2298
+ interface PendingAnnotation$3 {
2322
2299
  selector: Selector | Selector[];
2323
- motivation: Motivation$3;
2300
+ motivation: Motivation$2;
2324
2301
  }
2325
2302
  interface Props$1 {
2326
- annotations?: Annotation$5[];
2327
- onAnnotationClick?: (annotation: Annotation$5) => void;
2328
- focusedAnnotationId?: string | null;
2329
- hoveredAnnotationId?: string | null;
2330
- onAnnotationHover?: (annotationId: string | null) => void;
2331
- onDetect?: (selectedTypes: string[], includeDescriptiveReferences?: boolean) => void;
2332
- onCreate: (entityType?: string) => void;
2303
+ annotations?: Annotation$4[];
2333
2304
  isDetecting: boolean;
2334
2305
  detectionProgress: any;
2335
2306
  annotateMode?: boolean;
2336
2307
  Link: React__default.ComponentType<LinkComponentProps>;
2337
2308
  routes: RouteBuilder;
2338
2309
  allEntityTypes: string[];
2339
- onCancelDetection: () => void;
2340
- onSearchDocuments?: (referenceId: string, searchTerm: string) => void;
2341
- onGenerateDocument?: (referenceId: string, options: {
2342
- title: string;
2343
- prompt?: string;
2344
- }) => void;
2345
- onCreateDocument?: (annotationUri: string, title: string, entityTypes: string[]) => void;
2346
2310
  generatingReferenceId?: string | null;
2347
2311
  referencedBy?: ReferencedBy[];
2348
2312
  referencedByLoading?: boolean;
2349
- pendingAnnotation: PendingAnnotation$2 | null;
2313
+ pendingAnnotation: PendingAnnotation$3 | null;
2314
+ scrollToAnnotationId?: string | null;
2315
+ onScrollCompleted?: () => void;
2316
+ hoveredAnnotationId?: string | null;
2350
2317
  }
2351
- declare function ReferencesPanel({ annotations, onAnnotationClick, focusedAnnotationId, hoveredAnnotationId, onAnnotationHover, onDetect, onCreate, isDetecting, detectionProgress, annotateMode, Link, routes, allEntityTypes, onCancelDetection, onSearchDocuments, onGenerateDocument, onCreateDocument, generatingReferenceId, referencedBy, referencedByLoading, pendingAnnotation, }: Props$1): react_jsx_runtime.JSX.Element;
2318
+ /**
2319
+ * Panel for managing reference annotations with entity type detection
2320
+ *
2321
+ * @emits detection:start - Start reference detection. Payload: { motivation: 'linking', options: { entityTypes: string[], includeDescriptiveReferences: boolean } }
2322
+ * @emits annotation:create - Create new reference annotation. Payload: { motivation: 'linking', selector: Selector | Selector[], body: Body[] }
2323
+ * @emits annotation:cancel-pending - Cancel pending reference annotation. Payload: undefined
2324
+ * @subscribes annotation:click - Annotation clicked. Payload: { annotationId: string }
2325
+ */
2326
+ declare function ReferencesPanel({ annotations, isDetecting, detectionProgress, annotateMode, Link, routes, allEntityTypes, generatingReferenceId, referencedBy, referencedByLoading, pendingAnnotation, scrollToAnnotationId, onScrollCompleted, hoveredAnnotationId, }: Props$1): react_jsx_runtime.JSX.Element;
2352
2327
 
2353
2328
  interface Props {
2354
2329
  documentEntityTypes: string[];
@@ -2356,47 +2331,43 @@ interface Props {
2356
2331
  primaryMediaType?: string | undefined;
2357
2332
  primaryByteSize?: number | undefined;
2358
2333
  isArchived?: boolean;
2359
- onArchive?: () => void;
2360
- onUnarchive?: () => void;
2361
- onClone?: () => void;
2362
2334
  }
2363
- declare function ResourceInfoPanel({ documentEntityTypes, documentLocale, primaryMediaType, primaryByteSize, isArchived, onArchive, onUnarchive, onClone }: Props): react_jsx_runtime.JSX.Element;
2335
+ /**
2336
+ * Panel for displaying resource metadata and management actions
2337
+ *
2338
+ * @emits resource:clone - Clone this resource. Payload: undefined
2339
+ * @emits resource:unarchive - Unarchive this resource. Payload: undefined
2340
+ * @emits resource:archive - Archive this resource. Payload: undefined
2341
+ */
2342
+ declare function ResourceInfoPanel({ documentEntityTypes, documentLocale, primaryMediaType, primaryByteSize, isArchived, }: Props): react_jsx_runtime.JSX.Element;
2364
2343
 
2365
- type Annotation$4 = components['schemas']['Annotation'];
2344
+ type Annotation$3 = components['schemas']['Annotation'];
2366
2345
  interface StatisticsPanelProps {
2367
- highlights: Annotation$4[];
2368
- comments: Annotation$4[];
2369
- assessments: Annotation$4[];
2370
- references: Annotation$4[];
2371
- tags: Annotation$4[];
2346
+ highlights: Annotation$3[];
2347
+ comments: Annotation$3[];
2348
+ assessments: Annotation$3[];
2349
+ references: Annotation$3[];
2350
+ tags: Annotation$3[];
2372
2351
  }
2373
2352
  declare function StatisticsPanel({ highlights, comments, assessments, references, tags }: StatisticsPanelProps): react_jsx_runtime.JSX.Element;
2374
2353
 
2375
- type Annotation$3 = components['schemas']['Annotation'];
2354
+ type Annotation$2 = components['schemas']['Annotation'];
2376
2355
  interface TagEntryProps {
2377
- tag: Annotation$3;
2356
+ tag: Annotation$2;
2378
2357
  isFocused: boolean;
2379
- onClick: () => void;
2380
- onTagRef: (tagId: string, el: HTMLElement | null) => void;
2381
- onTagHover?: (tagId: string | null) => void;
2358
+ isHovered?: boolean;
2382
2359
  }
2383
- declare function TagEntry({ tag, isFocused, onClick, onTagRef, onTagHover, }: TagEntryProps): react_jsx_runtime.JSX.Element;
2360
+ declare const TagEntry: React$1.ForwardRefExoticComponent<TagEntryProps & React$1.RefAttributes<HTMLDivElement>>;
2384
2361
 
2385
- type Annotation$2 = components['schemas']['Annotation'];
2386
- type Motivation$2 = components['schemas']['Motivation'];
2387
- interface PendingAnnotation$1 {
2362
+ type Annotation$1 = components['schemas']['Annotation'];
2363
+ type Motivation$1 = components['schemas']['Motivation'];
2364
+ interface PendingAnnotation$2 {
2388
2365
  selector: Selector | Selector[];
2389
- motivation: Motivation$2;
2366
+ motivation: Motivation$1;
2390
2367
  }
2391
2368
  interface TaggingPanelProps {
2392
- annotations: Annotation$2[];
2393
- onAnnotationClick: (annotation: Annotation$2) => void;
2394
- focusedAnnotationId: string | null;
2395
- hoveredAnnotationId?: string | null;
2396
- onAnnotationHover?: (annotationId: string | null) => void;
2369
+ annotations: Annotation$1[];
2397
2370
  annotateMode?: boolean;
2398
- onDetect?: (schemaId: string, categories: string[]) => void | Promise<void>;
2399
- onCreate: (schemaId: string, category: string) => void | Promise<void>;
2400
2371
  isDetecting?: boolean;
2401
2372
  detectionProgress?: {
2402
2373
  status: string;
@@ -2410,46 +2381,42 @@ interface TaggingPanelProps {
2410
2381
  value: string;
2411
2382
  }>;
2412
2383
  } | null;
2413
- pendingAnnotation: PendingAnnotation$1 | null;
2384
+ pendingAnnotation: PendingAnnotation$2 | null;
2385
+ scrollToAnnotationId?: string | null;
2386
+ onScrollCompleted?: () => void;
2387
+ hoveredAnnotationId?: string | null;
2414
2388
  }
2415
- declare function TaggingPanel({ annotations, onAnnotationClick, focusedAnnotationId, hoveredAnnotationId, onAnnotationHover, annotateMode, onDetect, onCreate, isDetecting, detectionProgress, pendingAnnotation }: TaggingPanelProps): react_jsx_runtime.JSX.Element;
2389
+ /**
2390
+ * Panel for managing tag annotations with schema-based detection
2391
+ *
2392
+ * @emits detection:start - Start tag detection. Payload: { motivation: 'tagging', options: { schemaId: string, categories: string[] } }
2393
+ * @emits annotation:cancel-pending - Cancel pending tag annotation. Payload: undefined
2394
+ * @emits annotation:create - Create new tag annotation. Payload: { motivation: 'tagging', selector: Selector | Selector[], body: Body[] }
2395
+ * @subscribes annotation:click - Annotation clicked. Payload: { annotationId: string }
2396
+ */
2397
+ declare function TaggingPanel({ annotations, annotateMode, isDetecting, detectionProgress, pendingAnnotation, scrollToAnnotationId, onScrollCompleted, hoveredAnnotationId, }: TaggingPanelProps): react_jsx_runtime.JSX.Element;
2416
2398
 
2417
- type Annotation$1 = components['schemas']['Annotation'];
2418
- type Motivation$1 = components['schemas']['Motivation'];
2399
+ type Annotation = components['schemas']['Annotation'];
2400
+ type Motivation = components['schemas']['Motivation'];
2419
2401
  type TabKey = 'statistics' | 'reference' | 'highlight' | 'assessment' | 'comment' | 'tag';
2420
- interface PendingAnnotation {
2402
+ interface PendingAnnotation$1 {
2421
2403
  selector: Selector | Selector[];
2422
- motivation: Motivation$1;
2404
+ motivation: Motivation;
2423
2405
  }
2424
2406
  /**
2425
- * Simplified UnifiedAnnotationsPanel using Annotator abstraction
2407
+ * Simplified UnifiedAnnotationsPanel using event-driven architecture
2426
2408
  *
2427
2409
  * Key simplifications:
2428
2410
  * - Single annotations array (grouped internally by motivation)
2429
2411
  * - Single focusedAnnotationId (motivation-agnostic)
2430
- * - Single hoveredAnnotationId (motivation-agnostic)
2431
- * - Single onCreateAnnotation handler (motivation-based dispatch)
2412
+ * - Hover state managed via event bus (no props needed)
2413
+ * - All operations managed via event bus (no callback props)
2432
2414
  */
2433
2415
  interface UnifiedAnnotationsPanelProps {
2434
- annotations: Annotation$1[];
2416
+ annotations: Annotation[];
2435
2417
  annotators: Record<string, Annotator>;
2436
- detectionContext?: {
2437
- client: any;
2438
- rUri: any;
2439
- setDetectingMotivation: (motivation: Motivation$1 | null) => void;
2440
- setMotivationDetectionProgress: (progress: any) => void;
2441
- detectionStreamRef: any;
2442
- cacheManager: any;
2443
- showSuccess: (message: string) => void;
2444
- showError: (message: string) => void;
2445
- };
2446
- focusedAnnotationId: string | null;
2447
- hoveredAnnotationId?: string | null;
2448
- onAnnotationClick: (annotation: Annotation$1) => void;
2449
- onAnnotationHover?: (annotationId: string | null) => void;
2450
- onCreateAnnotation: (motivation: Motivation$1, ...args: any[]) => void;
2451
2418
  annotateMode?: boolean;
2452
- detectingMotivation?: Motivation$1 | null;
2419
+ detectingMotivation?: Motivation | null;
2453
2420
  detectionProgress?: {
2454
2421
  status: string;
2455
2422
  percentage?: number;
@@ -2458,21 +2425,17 @@ interface UnifiedAnnotationsPanelProps {
2458
2425
  processedCategories?: number;
2459
2426
  totalCategories?: number;
2460
2427
  } | null;
2461
- pendingAnnotation: PendingAnnotation | null;
2428
+ pendingAnnotation: PendingAnnotation$1 | null;
2462
2429
  allEntityTypes?: string[];
2463
2430
  generatingReferenceId?: string | null;
2464
- onGenerateDocument?: (referenceId: string, options: {
2465
- title: string;
2466
- prompt?: string;
2467
- }) => void;
2468
- onCreateDocument?: (annotationUri: string, title: string, entityTypes: string[]) => void;
2469
- onSearchDocuments?: (referenceId: string, searchTerm: string) => void;
2470
- onCancelDetection?: () => void;
2471
- mediaType?: string;
2472
2431
  referencedBy?: any[];
2473
2432
  referencedByLoading?: boolean;
2474
2433
  resourceId?: string;
2475
2434
  initialTab?: TabKey;
2435
+ initialTabGeneration?: number;
2436
+ scrollToAnnotationId?: string | null;
2437
+ onScrollCompleted?: () => void;
2438
+ hoveredAnnotationId?: string | null;
2476
2439
  Link: React__default.ComponentType<LinkComponentProps>;
2477
2440
  routes: RouteBuilder;
2478
2441
  }
@@ -2514,6 +2477,57 @@ interface NavigationMenuProps {
2514
2477
  }
2515
2478
  declare function NavigationMenu({ Link, routes, t, isAdmin, isModerator, onItemClick, className, currentPath }: NavigationMenuProps): react_jsx_runtime.JSX.Element;
2516
2479
 
2480
+ /**
2481
+ * Props for ObservableLink component
2482
+ *
2483
+ * Accepts any props that a standard anchor element accepts,
2484
+ * plus optional navigation metadata for event emission.
2485
+ */
2486
+ interface ObservableLinkProps extends React__default.AnchorHTMLAttributes<HTMLAnchorElement> {
2487
+ /** The URL to navigate to */
2488
+ href: string;
2489
+ /** Optional label for the link (used in event metadata) */
2490
+ label?: string;
2491
+ /** Children to render inside the link */
2492
+ children: React__default.ReactNode;
2493
+ }
2494
+ /**
2495
+ * Link component that emits navigation events for observability
2496
+ *
2497
+ * Use this instead of Next.js <Link> when you want link clicks to be
2498
+ * observable through the NavigationEventBus. This is useful for:
2499
+ * - Analytics tracking
2500
+ * - State coordination before navigation
2501
+ * - Logging navigation flows
2502
+ *
2503
+ * The component emits 'navigation:link-clicked' event before allowing
2504
+ * the browser to follow the link.
2505
+ *
2506
+ * @example
2507
+ * ```typescript
2508
+ * <ObservableLink
2509
+ * href="/know/discover"
2510
+ * label="Discover"
2511
+ * >
2512
+ * Discover Resources
2513
+ * </ObservableLink>
2514
+ * ```
2515
+ *
2516
+ * @example With Next.js Link integration
2517
+ * ```typescript
2518
+ * import Link from 'next/link';
2519
+ *
2520
+ * <Link href="/know/discover" legacyBehavior passHref>
2521
+ * <ObservableLink label="Discover">
2522
+ * Discover Resources
2523
+ * </ObservableLink>
2524
+ * </Link>
2525
+ * ```
2526
+ *
2527
+ * @emits navigation:link-clicked - Link clicked by user. Payload: { href: string, label?: string }
2528
+ */
2529
+ declare function ObservableLink({ href, label, onClick, children, ...anchorProps }: ObservableLinkProps): react_jsx_runtime.JSX.Element;
2530
+
2517
2531
  interface SimpleNavigationItem$1 {
2518
2532
  name: string;
2519
2533
  href: string;
@@ -2529,7 +2543,6 @@ interface SimpleNavigationProps$1 {
2529
2543
  LinkComponent: React__default.ComponentType<any>;
2530
2544
  dropdownContent?: (onClose: () => void) => React__default.ReactNode;
2531
2545
  isCollapsed: boolean;
2532
- onToggleCollapse: () => void;
2533
2546
  icons: {
2534
2547
  chevronLeft: React__default.ComponentType<{
2535
2548
  className?: string;
@@ -2544,8 +2557,10 @@ interface SimpleNavigationProps$1 {
2544
2557
  /**
2545
2558
  * Simple navigation component for Admin and Moderation modes.
2546
2559
  * Renders a section header with optional dropdown and static navigation tabs.
2560
+ *
2561
+ * @emits navigation:sidebar-toggle - Toggle sidebar collapsed/expanded state. Payload: undefined
2547
2562
  */
2548
- declare function SimpleNavigation({ title, items, currentPath, LinkComponent, dropdownContent, isCollapsed, onToggleCollapse, icons, collapseSidebarLabel, expandSidebarLabel }: SimpleNavigationProps$1): react_jsx_runtime.JSX.Element;
2563
+ declare function SimpleNavigation({ title, items, currentPath, LinkComponent, dropdownContent, isCollapsed, icons, collapseSidebarLabel, expandSidebarLabel }: SimpleNavigationProps$1): react_jsx_runtime.JSX.Element;
2549
2564
 
2550
2565
  /**
2551
2566
  * Represents an open resource/document in the navigation
@@ -2592,10 +2607,6 @@ interface CollapsibleResourceNavigationProps {
2592
2607
  }>;
2593
2608
  resources: OpenResource[];
2594
2609
  isCollapsed: boolean;
2595
- onToggleCollapse: () => void;
2596
- onResourceClose: (id: string) => void;
2597
- onResourceReorder: (oldIndex: number, newIndex: number) => void;
2598
- onResourceSelect?: (id: string) => void;
2599
2610
  currentPath: string;
2600
2611
  LinkComponent: ComponentType<any>;
2601
2612
  onNavigate?: (path: string) => void;
@@ -2622,8 +2633,12 @@ interface CollapsibleResourceNavigationProps {
2622
2633
  * A comprehensive collapsible navigation component with fixed items and dynamic resource tabs.
2623
2634
  * Supports drag and drop for resource reordering when expanded.
2624
2635
  * Platform-agnostic design for use across different React environments.
2636
+ *
2637
+ * @emits navigation:resource-reorder - Resource tab reordered. Payload: { oldIndex: number, newIndex: number }
2638
+ * @emits navigation:resource-close - Resource tab closed. Payload: { resourceId: string }
2639
+ * @emits navigation:sidebar-toggle - Toggle sidebar collapsed/expanded state. Payload: undefined
2625
2640
  */
2626
- declare function CollapsibleResourceNavigation({ fixedItems, resources, isCollapsed, onToggleCollapse, onResourceClose, onResourceReorder, currentPath, LinkComponent, onNavigate, getResourceHref, className, translations, icons, navigationMenu }: CollapsibleResourceNavigationProps): react_jsx_runtime.JSX.Element;
2641
+ declare function CollapsibleResourceNavigation({ fixedItems, resources, isCollapsed, currentPath, LinkComponent, onNavigate, getResourceHref, className, translations, icons, navigationMenu }: CollapsibleResourceNavigationProps): react_jsx_runtime.JSX.Element;
2627
2642
 
2628
2643
  /**
2629
2644
  * A sortable tab for an open resource in the navigation sidebar.
@@ -3126,11 +3141,8 @@ interface DevOpsFeature {
3126
3141
  interface AdminDevOpsPageProps {
3127
3142
  suggestedFeatures: DevOpsFeature[];
3128
3143
  theme: 'light' | 'dark' | 'system';
3129
- onThemeChange: (theme: 'light' | 'dark' | 'system') => void;
3130
3144
  showLineNumbers: boolean;
3131
- onLineNumbersToggle: () => void;
3132
3145
  activePanel: string | null;
3133
- onPanelToggle: (panel: string | null) => void;
3134
3146
  translations: {
3135
3147
  title: string;
3136
3148
  subtitle: string;
@@ -3144,7 +3156,7 @@ interface AdminDevOpsPageProps {
3144
3156
  ToolbarPanels: React__default.ComponentType<any>;
3145
3157
  Toolbar: React__default.ComponentType<any>;
3146
3158
  }
3147
- declare function AdminDevOpsPage({ suggestedFeatures, theme, onThemeChange, showLineNumbers, onLineNumbersToggle, activePanel, onPanelToggle, translations: t, StatusDisplay, ToolbarPanels, Toolbar, }: AdminDevOpsPageProps): react_jsx_runtime.JSX.Element;
3159
+ declare function AdminDevOpsPage({ suggestedFeatures, theme, showLineNumbers, activePanel, translations: t, StatusDisplay, ToolbarPanels, Toolbar, }: AdminDevOpsPageProps): react_jsx_runtime.JSX.Element;
3148
3160
 
3149
3161
  interface OAuthProvider {
3150
3162
  name: string;
@@ -3155,11 +3167,8 @@ interface AdminSecurityPageProps {
3155
3167
  allowedDomains: string[];
3156
3168
  isLoading: boolean;
3157
3169
  theme: 'light' | 'dark' | 'system';
3158
- onThemeChange: (theme: 'light' | 'dark' | 'system') => void;
3159
3170
  showLineNumbers: boolean;
3160
- onLineNumbersToggle: () => void;
3161
3171
  activePanel: string | null;
3162
- onPanelToggle: (panel: string | null) => void;
3163
3172
  translations: {
3164
3173
  title: string;
3165
3174
  subtitle: string;
@@ -3182,7 +3191,7 @@ interface AdminSecurityPageProps {
3182
3191
  ToolbarPanels: React__default.ComponentType<any>;
3183
3192
  Toolbar: React__default.ComponentType<any>;
3184
3193
  }
3185
- declare function AdminSecurityPage({ providers, allowedDomains, isLoading, theme, onThemeChange, showLineNumbers, onLineNumbersToggle, activePanel, onPanelToggle, translations: t, ToolbarPanels, Toolbar, }: AdminSecurityPageProps): react_jsx_runtime.JSX.Element;
3194
+ declare function AdminSecurityPage({ providers, allowedDomains, isLoading, theme, showLineNumbers, activePanel, translations: t, ToolbarPanels, Toolbar, }: AdminSecurityPageProps): react_jsx_runtime.JSX.Element;
3186
3195
 
3187
3196
  interface AdminUser {
3188
3197
  id: string;
@@ -3213,11 +3222,8 @@ interface AdminUsersPageProps {
3213
3222
  onAddUser: () => void;
3214
3223
  onExportUsers: () => void;
3215
3224
  theme: 'light' | 'dark' | 'system';
3216
- onThemeChange: (theme: 'light' | 'dark' | 'system') => void;
3217
3225
  showLineNumbers: boolean;
3218
- onLineNumbersToggle: () => void;
3219
3226
  activePanel: string | null;
3220
- onPanelToggle: (panel: string | null) => void;
3221
3227
  translations: {
3222
3228
  title: string;
3223
3229
  subtitle: string;
@@ -3266,7 +3272,7 @@ interface AdminUsersPageProps {
3266
3272
  };
3267
3273
  };
3268
3274
  }
3269
- 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;
3275
+ declare function AdminUsersPage({ users, userStats, isLoadingUsers, isLoadingStats, onUpdateUser, onDeleteUser, onAddUser, onExportUsers, theme, showLineNumbers, activePanel, translations: t, ToolbarPanels, Toolbar, buttonStyles, }: AdminUsersPageProps): react_jsx_runtime.JSX.Element;
3270
3276
 
3271
3277
  interface SignInFormProps {
3272
3278
  /**
@@ -3446,11 +3452,8 @@ interface EntityTagsPageProps {
3446
3452
  onAddTag: () => void;
3447
3453
  isAddingTag: boolean;
3448
3454
  theme: 'light' | 'dark' | 'system';
3449
- onThemeChange: (theme: 'light' | 'dark' | 'system') => void;
3450
3455
  showLineNumbers: boolean;
3451
- onLineNumbersToggle: () => void;
3452
3456
  activePanel: string | null;
3453
- onPanelToggle: (panel: string | null) => void;
3454
3457
  translations: {
3455
3458
  pageTitle: string;
3456
3459
  pageDescription: string;
@@ -3463,17 +3466,14 @@ interface EntityTagsPageProps {
3463
3466
  ToolbarPanels: React__default.ComponentType<any>;
3464
3467
  Toolbar: React__default.ComponentType<any>;
3465
3468
  }
3466
- declare function EntityTagsPage({ entityTypes, error, newTag, onNewTagChange, onAddTag, isAddingTag, theme, onThemeChange, showLineNumbers, onLineNumbersToggle, activePanel, onPanelToggle, translations: t, ToolbarPanels, Toolbar, }: EntityTagsPageProps): react_jsx_runtime.JSX.Element;
3469
+ declare function EntityTagsPage({ entityTypes, error, newTag, onNewTagChange, onAddTag, isAddingTag, theme, showLineNumbers, activePanel, translations: t, ToolbarPanels, Toolbar, }: EntityTagsPageProps): react_jsx_runtime.JSX.Element;
3467
3470
 
3468
3471
  interface RecentDocumentsPageProps {
3469
3472
  hasDocuments: boolean;
3470
3473
  isLoading: boolean;
3471
3474
  theme: 'light' | 'dark' | 'system';
3472
- onThemeChange: (theme: 'light' | 'dark' | 'system') => void;
3473
3475
  showLineNumbers: boolean;
3474
- onLineNumbersToggle: () => void;
3475
3476
  activePanel: string | null;
3476
- onPanelToggle: (panel: string | null) => void;
3477
3477
  translations: {
3478
3478
  pageTitle: string;
3479
3479
  pageDescription: string;
@@ -3486,17 +3486,14 @@ interface RecentDocumentsPageProps {
3486
3486
  ToolbarPanels: React__default.ComponentType<any>;
3487
3487
  Toolbar: React__default.ComponentType<any>;
3488
3488
  }
3489
- declare function RecentDocumentsPage({ isLoading, theme, onThemeChange, showLineNumbers, onLineNumbersToggle, activePanel, onPanelToggle, translations: t, ToolbarPanels, Toolbar, }: RecentDocumentsPageProps): react_jsx_runtime.JSX.Element;
3489
+ declare function RecentDocumentsPage({ isLoading, theme, showLineNumbers, activePanel, translations: t, ToolbarPanels, Toolbar, }: RecentDocumentsPageProps): react_jsx_runtime.JSX.Element;
3490
3490
 
3491
3491
  interface TagSchemasPageProps {
3492
3492
  schemas: TagSchema[];
3493
3493
  isLoading: boolean;
3494
3494
  theme: 'light' | 'dark' | 'system';
3495
- onThemeChange: (theme: 'light' | 'dark' | 'system') => void;
3496
3495
  showLineNumbers: boolean;
3497
- onLineNumbersToggle: () => void;
3498
3496
  activePanel: string | null;
3499
- onPanelToggle: (panel: string | null) => void;
3500
3497
  translations: {
3501
3498
  pageTitle: string;
3502
3499
  pageDescription: string;
@@ -3506,7 +3503,7 @@ interface TagSchemasPageProps {
3506
3503
  ToolbarPanels: React__default.ComponentType<any>;
3507
3504
  Toolbar: React__default.ComponentType<any>;
3508
3505
  }
3509
- declare function TagSchemasPage({ schemas, isLoading, theme, onThemeChange, showLineNumbers, onLineNumbersToggle, activePanel, onPanelToggle, translations: t, ToolbarPanels, Toolbar, }: TagSchemasPageProps): react_jsx_runtime.JSX.Element;
3506
+ declare function TagSchemasPage({ schemas, isLoading, theme, showLineNumbers, activePanel, translations: t, ToolbarPanels, Toolbar, }: TagSchemasPageProps): react_jsx_runtime.JSX.Element;
3510
3507
 
3511
3508
  type ResourceDescriptor$2 = components['schemas']['ResourceDescriptor'];
3512
3509
  interface ResourceComposePageProps {
@@ -3524,11 +3521,8 @@ interface ResourceComposePageProps {
3524
3521
  availableEntityTypes: string[];
3525
3522
  initialLocale: string;
3526
3523
  theme: 'light' | 'dark';
3527
- onThemeChange: (theme: 'light' | 'dark') => void;
3528
3524
  showLineNumbers: boolean;
3529
- onLineNumbersToggle: () => void;
3530
3525
  activePanel: string | null;
3531
- onPanelToggle: (panel: string) => void;
3532
3526
  onSaveResource: (params: SaveResourceParams) => Promise<void>;
3533
3527
  onCancel: () => void;
3534
3528
  translations: {
@@ -3580,7 +3574,7 @@ interface SaveResourceParams {
3580
3574
  annotationUri?: string;
3581
3575
  sourceDocumentId?: string;
3582
3576
  }
3583
- 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;
3577
+ declare function ResourceComposePage({ mode, cloneData, referenceData, availableEntityTypes, initialLocale, theme, showLineNumbers, activePanel, onSaveResource, onCancel, translations: t, ToolbarPanels, Toolbar, }: ResourceComposePageProps): react_jsx_runtime.JSX.Element;
3584
3578
 
3585
3579
  type ResourceDescriptor$1 = components['schemas']['ResourceDescriptor'];
3586
3580
  interface ResourceDiscoveryPageProps {
@@ -3590,11 +3584,8 @@ interface ResourceDiscoveryPageProps {
3590
3584
  isLoadingRecent: boolean;
3591
3585
  isSearching: boolean;
3592
3586
  theme: 'light' | 'dark';
3593
- onThemeChange: (theme: 'light' | 'dark') => void;
3594
3587
  showLineNumbers: boolean;
3595
- onLineNumbersToggle: () => void;
3596
3588
  activePanel: string | null;
3597
- onPanelToggle: (panel: string) => void;
3598
3589
  onNavigateToResource: (resourceId: string) => void;
3599
3590
  onNavigateToCompose: () => void;
3600
3591
  translations: {
@@ -3617,7 +3608,7 @@ interface ResourceDiscoveryPageProps {
3617
3608
  };
3618
3609
  ToolbarPanels: React__default.ComponentType<any>;
3619
3610
  }
3620
- 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;
3611
+ declare function ResourceDiscoveryPage({ recentDocuments, searchDocuments, entityTypes, isLoadingRecent, isSearching, theme, showLineNumbers, activePanel, onNavigateToResource, onNavigateToCompose, translations: t, ToolbarPanels, }: ResourceDiscoveryPageProps): react_jsx_runtime.JSX.Element;
3621
3612
 
3622
3613
  type ResourceDescriptor = components['schemas']['ResourceDescriptor'];
3623
3614
  interface ResourceCardProps {
@@ -3630,8 +3621,6 @@ interface ResourceCardProps {
3630
3621
  declare const ResourceCard: React__default.MemoExoticComponent<({ resource, onOpen, tabIndex, archivedLabel, createdLabel }: ResourceCardProps) => react_jsx_runtime.JSX.Element>;
3631
3622
 
3632
3623
  type SemiontResource = components['schemas']['ResourceDescriptor'];
3633
- type Annotation = components['schemas']['Annotation'];
3634
- type Motivation = components['schemas']['Motivation'];
3635
3624
  interface ResourceViewerPageProps {
3636
3625
  /**
3637
3626
  * The resource to display
@@ -3641,76 +3630,14 @@ interface ResourceViewerPageProps {
3641
3630
  * Resource URI
3642
3631
  */
3643
3632
  rUri: ResourceUri;
3644
- /**
3645
- * Document content (already loaded)
3646
- */
3647
- content: string;
3648
- /**
3649
- * Whether content is still loading
3650
- */
3651
- contentLoading: boolean;
3652
- /**
3653
- * All annotations for this resource
3654
- */
3655
- annotations: Annotation[];
3656
- /**
3657
- * Resources that reference this resource
3658
- */
3659
- referencedBy: any[];
3660
- /**
3661
- * Whether referencedBy is loading
3662
- */
3663
- referencedByLoading: boolean;
3664
- /**
3665
- * All available entity types
3666
- */
3667
- allEntityTypes: string[];
3668
3633
  /**
3669
3634
  * Current locale
3670
3635
  */
3671
3636
  locale: string;
3672
- /**
3673
- * Theme state
3674
- */
3675
- theme: any;
3676
- onThemeChange: (theme: any) => void;
3677
- /**
3678
- * Line numbers state
3679
- */
3680
- showLineNumbers: boolean;
3681
- onLineNumbersToggle: () => void;
3682
- /**
3683
- * Active toolbar panel
3684
- */
3685
- activePanel: any;
3686
- onPanelToggle: (panel: any) => void;
3687
- setActivePanel: (panel: any) => void;
3688
- /**
3689
- * Callbacks for resource actions
3690
- */
3691
- onArchive: () => Promise<void>;
3692
- onUnarchive: () => Promise<void>;
3693
- onClone: () => Promise<void>;
3694
- onUpdateAnnotationBody: (annotationUri: string, data: any) => Promise<void>;
3695
- /**
3696
- * Annotation CRUD callbacks
3697
- */
3698
- onCreateAnnotation: (rUri: ResourceUri, motivation: Motivation, selector: any, body: any[]) => Promise<void>;
3699
- onTriggerSparkleAnimation: (annotationId: string) => void;
3700
- onClearNewAnnotationId: (annotationId: string) => void;
3701
- /**
3702
- * Toast notifications
3703
- */
3704
- showSuccess: (message: string) => void;
3705
- showError: (message: string) => void;
3706
3637
  /**
3707
3638
  * Cache manager for detection
3708
3639
  */
3709
3640
  cacheManager: any;
3710
- /**
3711
- * API client
3712
- */
3713
- client: any;
3714
3641
  /**
3715
3642
  * Link component for routing
3716
3643
  */
@@ -3720,12 +3647,226 @@ interface ResourceViewerPageProps {
3720
3647
  */
3721
3648
  routes: any;
3722
3649
  /**
3723
- * Component dependencies - passed from frontend
3650
+ * Component dependencies - passed from framework layer
3724
3651
  */
3725
3652
  ToolbarPanels: React__default.ComponentType<any>;
3726
3653
  SearchResourcesModal: React__default.ComponentType<any>;
3727
3654
  GenerationConfigModal: React__default.ComponentType<any>;
3655
+ /**
3656
+ * Callback to refetch document from parent
3657
+ */
3658
+ refetchDocument: () => Promise<unknown>;
3659
+ }
3660
+ /**
3661
+ * ResourceViewerPage - Main component
3662
+ *
3663
+ * Uses hooks directly (NO containers, NO render props, NO ResourceViewerPageContent wrapper)
3664
+ *
3665
+ * @emits navigation:router-push - Navigate to a resource or filtered view
3666
+ * @emits annotation:sparkle - Trigger sparkle animation on an annotation
3667
+ * @emits annotation:update-body - Update annotation body content
3668
+ * @subscribes resource:archive - Archive the current resource
3669
+ * @subscribes resource:unarchive - Unarchive the current resource
3670
+ * @subscribes resource:clone - Clone the current resource
3671
+ * @subscribes annotation:sparkle - Trigger sparkle animation
3672
+ * @subscribes annotation:created - Annotation was created
3673
+ * @subscribes annotation:deleted - Annotation was deleted
3674
+ * @subscribes annotation:create-failed - Annotation creation failed
3675
+ * @subscribes annotation:delete-failed - Annotation deletion failed
3676
+ * @subscribes annotation:body-updated - Annotation body was updated
3677
+ * @subscribes annotation:body-update-failed - Annotation body update failed
3678
+ * @subscribes settings:theme-changed - UI theme changed
3679
+ * @subscribes settings:line-numbers-toggled - Line numbers display toggled
3680
+ * @subscribes detection:complete - Detection completed
3681
+ * @subscribes detection:failed - Detection failed
3682
+ * @subscribes generation:complete - Generation completed
3683
+ * @subscribes generation:failed - Generation failed
3684
+ * @subscribes navigation:reference-navigate - Navigate to a referenced document
3685
+ * @subscribes navigation:entity-type-clicked - Navigate filtered by entity type
3686
+ */
3687
+ declare function ResourceViewerPage({ resource, rUri, locale, cacheManager, Link, routes, ToolbarPanels, SearchResourcesModal, GenerationConfigModal, refetchDocument, }: ResourceViewerPageProps): react_jsx_runtime.JSX.Element;
3688
+
3689
+ /**
3690
+ * useDetectionFlow - Detection state management hook
3691
+ *
3692
+ * Manages all annotation detection (manual and AI-driven):
3693
+ * - Pending annotation state (user selected text, waiting for confirmation)
3694
+ * - Selection events → pending annotation conversion
3695
+ * - Annotation interaction (hover, click)
3696
+ * - Annotation request routing to appropriate panel
3697
+ * - Tracking currently detecting motivation (AI-driven detection)
3698
+ * - Detection progress updates from SSE
3699
+ * - Detection lifecycle (start, progress, complete, failed)
3700
+ * - Auto-dismiss progress after completion (5 seconds)
3701
+ * - Manual dismiss via detection:dismiss-progress event
3702
+ * - Annotation create/delete API calls
3703
+ * - AI detection SSE streams (all 5 motivation types)
3704
+ *
3705
+ * "Detection" covers both forms: a human selecting text is manual detection;
3706
+ * AI-driven SSE streams are automated detection. Same concept, same hook.
3707
+ *
3708
+ * Follows react-rxjs-guide.md Layer 2 pattern: Hook bridge that
3709
+ * subscribes to events and pushes values into React state.
3710
+ */
3711
+
3712
+ interface PendingAnnotation {
3713
+ selector: Selector | Selector[];
3714
+ motivation: Motivation$9;
3715
+ }
3716
+ interface DetectionFlowState {
3717
+ pendingAnnotation: PendingAnnotation | null;
3718
+ hoveredAnnotationId: string | null;
3719
+ detectingMotivation: Motivation$9 | null;
3720
+ detectionProgress: DetectionProgress | null;
3721
+ detectionStreamRef: React.MutableRefObject<AbortController | null>;
3722
+ }
3723
+ /**
3724
+ * Hook for annotation detection flow (manual and AI-driven)
3725
+ *
3726
+ * @param rUri - Resource URI being detected
3727
+ * @emits panel:open - Open the annotations panel when annotation is requested
3728
+ * @emits annotation:sparkle - Trigger sparkle animation on hovered annotation
3729
+ * @emits annotation:focus - Focus/scroll to clicked annotation
3730
+ * @emits annotation:created - Annotation successfully created
3731
+ * @emits annotation:create-failed - Annotation creation failed
3732
+ * @emits annotation:deleted - Annotation successfully deleted
3733
+ * @emits annotation:delete-failed - Annotation deletion failed
3734
+ * @emits detection:progress - Progress update from SSE stream
3735
+ * @emits detection:complete - SSE detection completed
3736
+ * @emits detection:failed - SSE detection failed
3737
+ * @emits detection:cancelled - SSE detection cancelled
3738
+ * @subscribes annotation:requested - User requested a new annotation
3739
+ * @subscribes annotation:create - Create annotation via API
3740
+ * @subscribes annotation:delete - Delete annotation via API
3741
+ * @subscribes selection:comment-requested - User selected text for a comment
3742
+ * @subscribes selection:tag-requested - User selected text for a tag
3743
+ * @subscribes selection:assessment-requested - User selected text for an assessment
3744
+ * @subscribes selection:reference-requested - User selected text for a reference
3745
+ * @subscribes annotation:cancel-pending - Cancel pending annotation creation
3746
+ * @subscribes annotation:hover - Annotation hover state change
3747
+ * @subscribes annotation:click - Annotation clicked
3748
+ * @subscribes detection:start - Trigger AI detection SSE stream
3749
+ * @subscribes job:cancel-requested - Cancels in-flight detection stream (detection half only)
3750
+ * @subscribes detection:progress - Progress update during detection
3751
+ * @subscribes detection:complete - Detection completed successfully
3752
+ * @subscribes detection:failed - Error during detection
3753
+ * @subscribes detection:dismiss-progress - Manually dismiss progress display
3754
+ * @returns Detection state
3755
+ */
3756
+ declare function useDetectionFlow(rUri: ResourceUri): DetectionFlowState;
3757
+
3758
+ /**
3759
+ * usePanelNavigation - Panel navigation and scroll coordination hook
3760
+ *
3761
+ * Manages sidebar panel state:
3762
+ * - Active panel tracking (which panel is open)
3763
+ * - Scroll coordination (scrollToAnnotationId)
3764
+ * - Panel routing with initial tab
3765
+ * - LocalStorage persistence
3766
+ *
3767
+ * Follows react-rxjs-guide.md Layer 2 pattern: Hook bridge that
3768
+ * subscribes to events and pushes values into React state.
3769
+ */
3770
+ type ToolbarPanelType = 'document' | 'history' | 'info' | 'annotations' | 'settings' | 'collaboration' | 'user' | 'jsonld';
3771
+ interface PanelNavigationState {
3772
+ activePanel: ToolbarPanelType | null;
3773
+ scrollToAnnotationId: string | null;
3774
+ panelInitialTab: {
3775
+ tab: string;
3776
+ generation: number;
3777
+ } | null;
3778
+ onScrollCompleted: () => void;
3779
+ }
3780
+ /**
3781
+ * Hook for panel navigation state management
3782
+ *
3783
+ * @subscribes panel:toggle - Toggle a panel open/closed
3784
+ * @subscribes panel:open - Open a panel, optionally scrolling to an annotation
3785
+ * @subscribes panel:close - Close the active panel
3786
+ * @returns Panel navigation state
3787
+ */
3788
+ declare function usePanelNavigation(): PanelNavigationState;
3789
+
3790
+ /**
3791
+ * useGenerationFlow - Document generation flow hook
3792
+ *
3793
+ * Manages document generation state:
3794
+ * - Generation progress tracking
3795
+ * - Generation modal state
3796
+ * - Reference search modal state
3797
+ * - Generation completion/error handling
3798
+ *
3799
+ * Follows react-rxjs-guide.md Layer 2 pattern: Hook bridge that
3800
+ * subscribes to events and pushes values into React state.
3801
+ */
3802
+
3803
+ interface GenerationFlowState {
3804
+ isGenerating: boolean;
3805
+ generationProgress: GenerationProgress | null;
3806
+ generationModalOpen: boolean;
3807
+ generationReferenceId: string | null;
3808
+ generationDefaultTitle: string;
3809
+ onGenerateDocument: (referenceId: string, options: {
3810
+ title: string;
3811
+ prompt?: string;
3812
+ language?: string;
3813
+ temperature?: number;
3814
+ maxTokens?: number;
3815
+ context?: GenerationContext;
3816
+ }) => void;
3817
+ onCloseGenerationModal: () => void;
3818
+ }
3819
+ /**
3820
+ * Hook for document generation flow
3821
+ *
3822
+ * @param locale - Current locale for language defaults
3823
+ * @param resourceId - Resource ID for generation
3824
+ * @param showSuccess - Success toast callback
3825
+ * @param showError - Error toast callback
3826
+ * @param cacheManager - Cache manager for invalidation
3827
+ * @param clearNewAnnotationId - Clear animation callback
3828
+ * @emits generation:start - Start document generation (consumed internally by this hook)
3829
+ * @emits generation:progress - SSE progress chunk from generation stream
3830
+ * @emits generation:complete - Generation completed successfully
3831
+ * @emits generation:failed - Error during generation
3832
+ * @subscribes generation:start - Triggers SSE call to generateResourceFromAnnotation
3833
+ * @subscribes job:cancel-requested - Cancels in-flight generation stream
3834
+ * @subscribes reference:create-manual - Navigates to compose page for new document reference
3835
+ * @subscribes generation:modal-open - Open the generation config modal; triggers context:retrieval-requested
3836
+ * @subscribes generation:complete - Generation completed successfully
3837
+ * @subscribes generation:failed - Error during generation
3838
+ * @returns Generation flow state
3839
+ */
3840
+ declare function useGenerationFlow(locale: string, resourceId: string, showSuccess: (message: string) => void, showError: (message: string) => void, cacheManager: any, clearNewAnnotationId: (annotationId: AnnotationUri) => void): GenerationFlowState;
3841
+
3842
+ /**
3843
+ * useContextRetrievalFlow - Context retrieval capability hook
3844
+ *
3845
+ * Retrieval capability: given a reference annotation, fetch the surrounding
3846
+ * text context (before/selected/after) from the source document so it can
3847
+ * be used as grounding material for generation.
3848
+ *
3849
+ * This hook is the single owner of retrieval state. It is triggered by
3850
+ * context:retrieval-requested on the event bus, making the capability
3851
+ * accessible to both human UI flows and agents.
3852
+ *
3853
+ * @subscribes context:retrieval-requested - Fetch LLM context for an annotation
3854
+ * @emits context:retrieval-complete - Context successfully fetched
3855
+ * @emits context:retrieval-failed - Context fetch failed
3856
+ * @returns Retrieval state (context, loading, error, which annotation)
3857
+ */
3858
+
3859
+ interface ContextRetrievalFlowConfig {
3860
+ client: SemiontApiClient;
3861
+ resourceUri: ResourceUri;
3862
+ }
3863
+ interface ContextRetrievalFlowState {
3864
+ retrievalContext: GenerationContext | null;
3865
+ retrievalLoading: boolean;
3866
+ retrievalError: Error | null;
3867
+ /** The annotationUri for which context was most recently retrieved */
3868
+ retrievalAnnotationUri: string | null;
3728
3869
  }
3729
- declare function ResourceViewerPage(props: ResourceViewerPageProps): react_jsx_runtime.JSX.Element;
3870
+ declare function useContextRetrievalFlow(emitter: Emitter<EventMap>, config: ContextRetrievalFlowConfig): ContextRetrievalFlowState;
3730
3871
 
3731
- export { ANNOTATORS, AUTH_EVENTS, AVAILABLE_LOCALES, AdminDevOpsPage, type AdminDevOpsPageProps, AdminSecurityPage, type AdminSecurityPageProps, type AdminUser, type AdminUserStats, AdminUsersPage, type AdminUsersPageProps, AnnotateToolbar, AnnotateView, type Annotation$n 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, type BorderRadiusToken, BrowseView, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type CacheManager, CacheProvider, type CacheProviderProps, type ClickAction, CodeMirrorRenderer, CollaborationPanel, CollapsibleResourceNavigation, type CollapsibleResourceNavigationProps, type ColorToken, CommentEntry, CommentsPanel, ComposeLoadingState, type ComposeLoadingStateProps, type CreateAnnotationParams, type CreateConfig, 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, MakeMeaningEventBusProvider, type MakeMeaningEventBusProviderProps, type Motivation$b as Motivation, type NavigationItem, NavigationMenu, type NavigationMenuHelper, type NavigationProps, type OAuthProvider, type OAuthUser, OAuthUserSchema, type OpenResource, OpenResourcesManager, OpenResourcesProvider, PageLayout, PanelHeader, PopupContainer, PopupHeader, type PreparedAnnotation, ProposeEntitiesModal, QUERY_KEYS, RecentDocumentsPage, type RecentDocumentsPageProps, ReferenceEntry, ReferenceResolutionWidget, ReferencesPanel, ResizeHandle, type ResolvedTheme, ResourceAnnotationsProvider, ResourceCard, type ResourceCardProps, ResourceComposePage, type ResourceComposePageProps, ResourceDiscoveryPage, type ResourceDiscoveryPageProps, ResourceErrorState, type ResourceErrorStateProps, ResourceInfoPanel, ResourceLoadingState, ResourceSearchModal, type ResourceSearchModalProps, ResourceTagsInline, ResourceViewer, ResourceViewerPage, type ResourceViewerPageProps, type RouteBuilder, type SaveResourceParams, SearchModal, type SearchModalProps, SelectedTextDisplay, type SelectionData, type SelectionMotivation, type SelectorType, SemiontBranding, SemiontFavicon, type SemiontResource$3 as SemiontResource, SessionExpiryBanner, SessionManager, SessionProvider, SessionTimer, SettingsPanel, type ShadowToken, type ShapeType, SignInForm, type SignInFormProps, SignUpForm, type SignUpFormProps, SimpleNavigation, type SimpleNavigationItem, type SimpleNavigationProps, SkipLinks, SortableResourceTab, type SortableResourceTabProps, type SpacingToken, StatisticsPanel, StatusDisplay, type StreamStatus, SvgDrawingCanvas, TagEntry, TagSchemasPage, type TagSchemasPageProps, TaggingPanel, type TextSegment, type TextSelection, type Theme, ToastContainer, type ToastMessage, ToastProvider, type ToastType, Toolbar, type ToolbarPanelType, type TransitionToken, TranslationManager, TranslationProvider, type TranslationProviderProps, type TypographyToken, type UICreateAnnotationParams, UnifiedAnnotationsPanel, UnifiedHeader, UserMenuSkeleton, WelcomePage, type WelcomePageProps, buttonStyles, createCancelDetectionHandler, createDetectionHandler, cssVariables, dispatch401Error, dispatch403Error, dispatchAuthEvent, faviconPaths, generateCSSVariables, getResourceIcon, getSelectedShapeForSelectorType, getSelectorType, getShortcutDisplay, getSupportedShapes, isShapeSupported, jsonLightHighlightStyle, jsonLightTheme, onAuthEvent, rehypeRenderAnnotations, remarkAnnotations, sanitizeImageURL, saveSelectedShapeForSelectorType, supportsDetection, tokens, useAdmin, useAnnotationManager, useAnnotationPanel, useAnnotationUI, useAnnotations, useApiClient, useAuthApi, useCacheManager, useDebounce, useDebouncedCallback, useDetectionProgress, useDocumentAnnouncements, useDoubleKeyPress, useDropdown, useEntityTypes, useFormAnnouncements, useFormValidation, useFormattedTime, useGenerationProgress, useHealth, useIsTyping, useKeyboardShortcuts, useLanguageChangeAnnouncements, useLineNumbers, useLiveRegion, useLoadingState, useLocalStorage, useMakeMeaningEvents, useOpenResources, usePanelWidth, usePreloadTranslations, useResourceAnnotations, useResourceEvents, useResourceLoadingAnnouncements, useResources, useRovingTabIndex, useSearchAnnouncements, useSessionContext, useSessionExpiry, useTheme, useToast, useToolbar, useTranslations, validationRules };
3872
+ export { ANNOTATORS, AUTH_EVENTS, AVAILABLE_LOCALES, AdminDevOpsPage, type AdminDevOpsPageProps, AdminSecurityPage, type AdminSecurityPageProps, type AdminUser, type AdminUserStats, AdminUsersPage, type AdminUsersPageProps, AnnotateToolbar, AnnotateView, type Annotation$k as Annotation, type AnnotationConfig, type AnnotationCreationHandler, type AnnotationHandlers, AnnotationHistory, type AnnotationManager, AnnotationOverlay, AnnotationProvider, type AnnotationProviderProps, type AnnotationUIState, type AnnotationsCollection, type Annotator, ApiClientProvider, type ApiClientProviderProps, AssessmentEntry, AssessmentPanel, AsyncErrorBoundary, AuthErrorDisplay, type AuthErrorDisplayProps, type AuthEventDetail, type AuthEventType, AuthTokenProvider, type AuthTokenProviderProps, type AvailableLocale, type BorderRadiusToken, BrowseView, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type CacheManager, CacheProvider, type CacheProviderProps, type ClickAction, CodeMirrorRenderer, CollaborationPanel, CollapsibleResourceNavigation, type CollapsibleResourceNavigationProps, type ColorToken, CommentEntry, CommentsPanel, ComposeLoadingState, type ComposeLoadingStateProps, type ContextRetrievalFlowConfig, type ContextRetrievalFlowState, type CreateAnnotationParams, type CreateConfig, type DeleteAnnotationParams, DetectSection, type DetectionConfig, type DetectionFlowState, DetectionProgress, DetectionProgressWidget, type DevOpsFeature, type DrawingMode, EntityTagsPage, type EntityTagsPageProps, EntityTypeBadges, ErrorBoundary, EventBus, EventMap, Footer, type GenerationFlowState, type GenerationOptions, GenerationProgress, HighlightEntry, HighlightPanel, HistoryEvent, ImageURLSchema, ImageViewer, JsonLdPanel, JsonLdView, type KeyboardShortcut, KeyboardShortcutsHelpModal, LeftSidebar, type LinkComponentProps, LiveRegionProvider, type Motivation$8 as Motivation, type NavigationItem, NavigationMenu, type NavigationMenuHelper, type NavigationProps, type OAuthProvider, type OAuthUser, OAuthUserSchema, ObservableLink, type ObservableLinkProps, type OpenResource, OpenResourcesManager, OpenResourcesProvider, PageLayout, PanelHeader, type PanelNavigationState, PopupContainer, PopupHeader, type PreparedAnnotation, ProposeEntitiesModal, QUERY_KEYS, RecentDocumentsPage, type RecentDocumentsPageProps, ReferenceEntry, ReferenceResolutionWidget, ReferencesPanel, ResizeHandle, type ResolutionFlowConfig, type ResolutionFlowState, type ResolvedTheme, ResourceAnnotationsProvider, ResourceCard, type ResourceCardProps, ResourceComposePage, type ResourceComposePageProps, ResourceDiscoveryPage, type ResourceDiscoveryPageProps, ResourceErrorState, type ResourceErrorStateProps, ResourceInfoPanel, ResourceLoadingState, ResourceSearchModal, type ResourceSearchModalProps, ResourceTagsInline, ResourceViewer, ResourceViewerPage, type ResourceViewerPageProps, type RouteBuilder, type SaveResourceParams, SearchModal, type SearchModalProps, SelectedTextDisplay, type SelectionMotivation, type SelectorType, SemiontBranding, SemiontFavicon, type SemiontResource$4 as SemiontResource, SessionExpiryBanner, SessionManager, SessionProvider, SessionTimer, SettingsPanel, type ShadowToken, type ShapeType, SignInForm, type SignInFormProps, SignUpForm, type SignUpFormProps, SimpleNavigation, type SimpleNavigationItem, type SimpleNavigationProps, SkipLinks, SortableResourceTab, type SortableResourceTabProps, type SpacingToken, StatisticsPanel, StatusDisplay, type StreamStatus, SvgDrawingCanvas, TagEntry, TagSchemasPage, type TagSchemasPageProps, TaggingPanel, type TextSegment, type TextSelection, type Theme, ThemeProvider, ToastContainer, type ToastMessage, ToastProvider, type ToastType, Toolbar, type ToolbarPanelType, type TransitionToken, TranslationManager, TranslationProvider, type TranslationProviderProps, type TypographyToken, type UICreateAnnotationParams, UnifiedAnnotationsPanel, UnifiedHeader, type UseResourceContentResult, UserMenuSkeleton, WelcomePage, type WelcomePageProps, buttonStyles, createCancelDetectionHandler, createDetectionHandler, cssVariables, dispatch401Error, dispatch403Error, dispatchAuthEvent, faviconPaths, formatTime, generateCSSVariables, getResourceIcon, getSelectedShapeForSelectorType, getSelectorType, getShortcutDisplay, getSupportedShapes, isShapeSupported, jsonLightHighlightStyle, jsonLightTheme, onAuthEvent, rehypeRenderAnnotations, remarkAnnotations, sanitizeImageURL, saveSelectedShapeForSelectorType, supportsDetection, tokens, useAdmin, useAnnotationManager, useAnnotations, useApiClient, useAuthApi, useAuthToken, useCacheManager, useContextRetrievalFlow, useDebounce, useDebouncedCallback, useDetectionFlow, useDocumentAnnouncements, useDoubleKeyPress, useDropdown, useEntityTypes, useEventSubscription, useEventSubscriptions, useFormAnnouncements, useGenerationFlow, useHealth, useIsTyping, useKeyboardShortcuts, useLanguageChangeAnnouncements, useLineNumbers, useLiveRegion, useLoadingState, useLocalStorage, useObservableExternalNavigation, useObservableRouter, useOpenResources, usePanelNavigation, usePanelWidth, usePreloadTranslations, useResolutionFlow, useResourceAnnotations, useResourceContent, useResourceEvents, useResourceLoadingAnnouncements, useResources, useRovingTabIndex, useSearchAnnouncements, useSessionContext, useSessionExpiry, useTheme, useToast, useTranslations };