@semiont/react-ui 0.2.45 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/dist/{PdfAnnotationCanvas.client-COQREPXU.mjs → PdfAnnotationCanvas.client-PVTVPDBQ.mjs} +3 -4
  2. package/dist/PdfAnnotationCanvas.client-PVTVPDBQ.mjs.map +1 -0
  3. package/dist/{ar-7SUXNE34.mjs → ar-APUOG2AP.mjs} +46 -6
  4. package/dist/ar-APUOG2AP.mjs.map +1 -0
  5. package/dist/{bn-XOET3DOI.mjs → bn-EFK2LJGK.mjs} +46 -6
  6. package/dist/bn-EFK2LJGK.mjs.map +1 -0
  7. package/dist/{chunk-JH7BXE2P.mjs → chunk-7DW2P4UE.mjs} +45 -5
  8. package/dist/chunk-7DW2P4UE.mjs.map +1 -0
  9. package/dist/{chunk-Q2KV6Y2J.mjs → chunk-7GEYABC6.mjs} +32 -32
  10. package/dist/{chunk-3JTO27MH.mjs → chunk-D4GAAQMM.mjs} +2 -9
  11. package/dist/{cs-X63DXX7L.mjs → cs-A26MEEQE.mjs} +46 -6
  12. package/dist/cs-A26MEEQE.mjs.map +1 -0
  13. package/dist/{da-OWTCV57A.mjs → da-U3L2FHSZ.mjs} +46 -6
  14. package/dist/da-U3L2FHSZ.mjs.map +1 -0
  15. package/dist/{de-77BMFDVF.mjs → de-Y5BHEBT7.mjs} +46 -6
  16. package/dist/de-Y5BHEBT7.mjs.map +1 -0
  17. package/dist/dist-YLEIY3JJ.mjs +547 -0
  18. package/dist/dist-YLEIY3JJ.mjs.map +1 -0
  19. package/dist/{el-FIBNLH2V.mjs → el-HU7LAWQY.mjs} +46 -6
  20. package/dist/el-HU7LAWQY.mjs.map +1 -0
  21. package/dist/{en-XWEPVTB4.mjs → en-HAKDCFKL.mjs} +5 -3
  22. package/dist/{es-726NTS53.mjs → es-4BN64QH5.mjs} +46 -6
  23. package/dist/es-4BN64QH5.mjs.map +1 -0
  24. package/dist/{fa-3N4CIWE6.mjs → fa-6ELTBARU.mjs} +46 -6
  25. package/dist/fa-6ELTBARU.mjs.map +1 -0
  26. package/dist/{fi-JOM3M7Z4.mjs → fi-DJ4WGIFW.mjs} +46 -6
  27. package/dist/fi-DJ4WGIFW.mjs.map +1 -0
  28. package/dist/{fr-56QSXS7E.mjs → fr-23XM6H6H.mjs} +46 -6
  29. package/dist/fr-23XM6H6H.mjs.map +1 -0
  30. package/dist/{he-SNAXPJEK.mjs → he-JSWJC2XU.mjs} +46 -6
  31. package/dist/he-JSWJC2XU.mjs.map +1 -0
  32. package/dist/{hi-CRBRD5TB.mjs → hi-BENHG3OJ.mjs} +46 -6
  33. package/dist/hi-BENHG3OJ.mjs.map +1 -0
  34. package/dist/{id-BRCVLICF.mjs → id-4HHQJQNF.mjs} +46 -6
  35. package/dist/id-4HHQJQNF.mjs.map +1 -0
  36. package/dist/index.css +108 -12
  37. package/dist/index.css.map +1 -1
  38. package/dist/index.d.mts +399 -147
  39. package/dist/index.mjs +3573 -2226
  40. package/dist/index.mjs.map +1 -1
  41. package/dist/{it-M2Z27BNB.mjs → it-U6I5PDKU.mjs} +46 -6
  42. package/dist/it-U6I5PDKU.mjs.map +1 -0
  43. package/dist/{ja-TZUKW7HD.mjs → ja-K3YBDWDP.mjs} +46 -6
  44. package/dist/ja-K3YBDWDP.mjs.map +1 -0
  45. package/dist/{ko-NKBGGOL6.mjs → ko-KC2HXRXG.mjs} +46 -6
  46. package/dist/ko-KC2HXRXG.mjs.map +1 -0
  47. package/dist/{magic-string.es-7FJ3LUGB.mjs → magic-string.es-K77I4ZQN.mjs} +2 -2
  48. package/dist/{ms-XFXPN6RX.mjs → ms-KY5QGBNN.mjs} +46 -6
  49. package/dist/ms-KY5QGBNN.mjs.map +1 -0
  50. package/dist/{nl-MVYXAS5C.mjs → nl-6PZFLGY2.mjs} +46 -6
  51. package/dist/nl-6PZFLGY2.mjs.map +1 -0
  52. package/dist/{no-XOLO4JPV.mjs → no-5QR7PLVJ.mjs} +46 -6
  53. package/dist/no-5QR7PLVJ.mjs.map +1 -0
  54. package/dist/{pl-TRWLMMC4.mjs → pl-4GV2NQXE.mjs} +46 -6
  55. package/dist/pl-4GV2NQXE.mjs.map +1 -0
  56. package/dist/{pt-M3TE24UI.mjs → pt-F3F5QD2P.mjs} +46 -6
  57. package/dist/pt-F3F5QD2P.mjs.map +1 -0
  58. package/dist/{ro-QBFG2T64.mjs → ro-TFYL2IQB.mjs} +46 -6
  59. package/dist/ro-TFYL2IQB.mjs.map +1 -0
  60. package/dist/{sv-IUECBXWX.mjs → sv-PRVF2QLR.mjs} +46 -6
  61. package/dist/sv-PRVF2QLR.mjs.map +1 -0
  62. package/dist/test-utils.mjs +16994 -22140
  63. package/dist/test-utils.mjs.map +1 -1
  64. package/dist/{th-US7KIN5Q.mjs → th-SUQOQFUZ.mjs} +46 -6
  65. package/dist/th-SUQOQFUZ.mjs.map +1 -0
  66. package/dist/{tr-DWJ2FFUK.mjs → tr-AYUJZOFJ.mjs} +46 -6
  67. package/dist/tr-AYUJZOFJ.mjs.map +1 -0
  68. package/dist/{uk-M4ZE4DPZ.mjs → uk-YY5WGLBM.mjs} +46 -6
  69. package/dist/uk-YY5WGLBM.mjs.map +1 -0
  70. package/dist/{vi-FERZNPSH.mjs → vi-6RO77ITD.mjs} +46 -6
  71. package/dist/{vi-FERZNPSH.mjs.map → vi-6RO77ITD.mjs.map} +1 -1
  72. package/dist/{zh-3J2I3WYK.mjs → zh-L6GA65H6.mjs} +46 -6
  73. package/dist/zh-L6GA65H6.mjs.map +1 -0
  74. package/package.json +18 -14
  75. package/src/components/Button/Button.tsx +23 -25
  76. package/src/components/annotation/AnnotateToolbar.tsx +1 -1
  77. package/src/components/annotation-popups/SharedPopupElements.tsx +5 -7
  78. package/src/components/image-annotation/SvgDrawingCanvas.tsx +3 -4
  79. package/src/components/modals/ConfigureGenerationStep.tsx +190 -0
  80. package/src/components/modals/ConfigureSearchStep.tsx +105 -0
  81. package/src/components/modals/ContextSummary.tsx +183 -0
  82. package/src/components/modals/GatherContextStep.tsx +89 -0
  83. package/src/components/modals/KeyboardShortcutsHelpModal.tsx +4 -6
  84. package/src/components/modals/ProposeEntitiesModal.tsx +4 -6
  85. package/src/components/modals/ReferenceWizardModal.tsx +326 -0
  86. package/src/components/modals/ResourceSearchModal.tsx +4 -6
  87. package/src/components/modals/SearchModal.css +43 -0
  88. package/src/components/modals/SearchModal.tsx +4 -6
  89. package/src/components/modals/SearchResultsStep.tsx +126 -0
  90. package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +3 -4
  91. package/src/components/pdf-annotation/__tests__/PdfAnnotationCanvas.test.tsx +36 -14
  92. package/src/components/resource/AnnotateView.tsx +4 -4
  93. package/src/components/resource/AnnotationHistory.tsx +2 -2
  94. package/src/components/resource/BrowseView.tsx +4 -4
  95. package/src/components/resource/ResourceViewer.tsx +5 -8
  96. package/src/components/resource/__tests__/AnnotationHistory.test.tsx +16 -16
  97. package/src/components/resource/__tests__/BrowseView.test.tsx +2 -2
  98. package/src/components/resource/__tests__/HistoryEvent.test.tsx +1 -1
  99. package/src/components/resource/__tests__/ResourceViewer.mode-switch.test.tsx +1 -1
  100. package/src/components/resource/panels/AssessmentEntry.tsx +9 -11
  101. package/src/components/resource/panels/AssessmentPanel.tsx +1 -1
  102. package/src/components/resource/panels/CommentEntry.tsx +10 -12
  103. package/src/components/resource/panels/CommentsPanel.tsx +1 -1
  104. package/src/components/resource/panels/HighlightEntry.tsx +9 -11
  105. package/src/components/resource/panels/HighlightPanel.tsx +2 -2
  106. package/src/components/resource/panels/ReferenceEntry.tsx +57 -104
  107. package/src/components/resource/panels/ReferencesPanel.css +85 -13
  108. package/src/components/resource/panels/ReferencesPanel.tsx +2 -3
  109. package/src/components/resource/panels/TagEntry.tsx +9 -11
  110. package/src/components/resource/panels/TaggingPanel.tsx +1 -1
  111. package/src/components/resource/panels/__tests__/AssessmentPanel.test.tsx +4 -4
  112. package/src/components/resource/panels/__tests__/AssistSection.test.tsx +7 -7
  113. package/src/components/resource/panels/__tests__/CommentsPanel.test.tsx +3 -3
  114. package/src/components/resource/panels/__tests__/HighlightPanel.annotationProgress.test.tsx +2 -2
  115. package/src/components/resource/panels/__tests__/ReferenceEntry.test.tsx +64 -101
  116. package/src/components/resource/panels/__tests__/StatisticsPanel.test.tsx +1 -1
  117. package/src/components/resource/panels/__tests__/TaggingPanel.test.tsx +7 -7
  118. package/src/components/viewers/ImageViewer.tsx +3 -6
  119. package/src/components/viewers/__tests__/ImageViewer.test.tsx +3 -3
  120. package/src/features/admin-devops/__tests__/AdminDevOpsPage.test.tsx +5 -5
  121. package/src/features/admin-exchange/__tests__/AdminExchangePage.test.tsx +141 -0
  122. package/src/features/admin-exchange/__tests__/ExportCard.test.tsx +41 -0
  123. package/src/features/admin-exchange/__tests__/ImportCard.test.tsx +148 -0
  124. package/src/features/admin-exchange/__tests__/ImportProgress.test.tsx +106 -0
  125. package/src/features/admin-exchange/components/AdminExchangePage.tsx +120 -0
  126. package/src/features/admin-exchange/components/ExportCard.tsx +35 -0
  127. package/src/features/admin-exchange/components/ImportCard.tsx +188 -0
  128. package/src/features/admin-exchange/components/ImportProgress.tsx +86 -0
  129. package/src/features/admin-security/__tests__/AdminSecurityPage.test.tsx +3 -3
  130. package/src/features/moderate-entity-tags/__tests__/EntityTagsPage.test.tsx +2 -2
  131. package/src/features/moderate-recent/__tests__/RecentDocumentsPage.test.tsx +4 -4
  132. package/src/features/moderate-tag-schemas/__tests__/TagSchemasPage.test.tsx +3 -3
  133. package/src/features/moderation-linked-data/__tests__/LinkedDataPage.test.tsx +117 -0
  134. package/src/features/moderation-linked-data/components/LinkedDataPage.tsx +121 -0
  135. package/src/features/resource-compose/__tests__/ResourceComposePage.test.tsx +5 -5
  136. package/src/features/resource-compose/components/ResourceComposePage.tsx +56 -1
  137. package/src/features/resource-discovery/__tests__/ResourceCard.test.tsx +1 -1
  138. package/src/features/resource-discovery/__tests__/ResourceDiscoveryPage.test.tsx +2 -2
  139. package/src/features/resource-viewer/__tests__/AnnotationCreationPending.test.tsx +14 -14
  140. package/src/features/resource-viewer/__tests__/AnnotationDeletionIntegration.test.tsx +12 -11
  141. package/src/features/resource-viewer/__tests__/AnnotationProgressDismissal.test.tsx +2 -2
  142. package/src/features/resource-viewer/__tests__/BindFlowIntegration.test.tsx +22 -115
  143. package/src/features/resource-viewer/__tests__/DetectionFlowBug.test.tsx +3 -3
  144. package/src/features/resource-viewer/__tests__/DetectionFlowIntegration.test.tsx +20 -20
  145. package/src/features/resource-viewer/__tests__/ResourceMutations.test.tsx +7 -7
  146. package/src/features/resource-viewer/__tests__/ResourceViewerPage.test.tsx +43 -20
  147. package/src/features/resource-viewer/__tests__/ToastNotifications.test.tsx +2 -2
  148. package/src/features/resource-viewer/__tests__/YieldFlowIntegration.test.tsx +45 -82
  149. package/src/features/resource-viewer/__tests__/annotation-progress-flow.test.tsx +4 -4
  150. package/src/features/resource-viewer/components/ResourceViewerPage.tsx +151 -74
  151. package/src/integrations/tailwind-plugin.js +3 -3
  152. package/src/styles/core/buttons.css +31 -0
  153. package/src/styles/features/exchange.css +404 -0
  154. package/src/styles/index.css +1 -0
  155. package/translations/ar.json +42 -4
  156. package/translations/bn.json +42 -4
  157. package/translations/cs.json +42 -4
  158. package/translations/da.json +128 -90
  159. package/translations/de.json +122 -84
  160. package/translations/el.json +42 -4
  161. package/translations/en.json +42 -4
  162. package/translations/es.json +42 -4
  163. package/translations/fa.json +42 -4
  164. package/translations/fi.json +68 -30
  165. package/translations/fr.json +42 -4
  166. package/translations/he.json +42 -4
  167. package/translations/hi.json +42 -4
  168. package/translations/id.json +43 -5
  169. package/translations/it.json +62 -24
  170. package/translations/ja.json +43 -5
  171. package/translations/ko.json +42 -4
  172. package/translations/ms.json +43 -5
  173. package/translations/nl.json +41 -3
  174. package/translations/no.json +104 -66
  175. package/translations/pl.json +42 -4
  176. package/translations/pt.json +43 -5
  177. package/translations/ro.json +42 -4
  178. package/translations/sv.json +42 -4
  179. package/translations/th.json +42 -4
  180. package/translations/tr.json +42 -4
  181. package/translations/uk.json +42 -4
  182. package/translations/vi.json +42 -4
  183. package/translations/zh.json +42 -4
  184. package/dist/PdfAnnotationCanvas.client-COQREPXU.mjs.map +0 -1
  185. package/dist/ar-7SUXNE34.mjs.map +0 -1
  186. package/dist/bn-XOET3DOI.mjs.map +0 -1
  187. package/dist/chunk-JH7BXE2P.mjs.map +0 -1
  188. package/dist/cs-X63DXX7L.mjs.map +0 -1
  189. package/dist/da-OWTCV57A.mjs.map +0 -1
  190. package/dist/de-77BMFDVF.mjs.map +0 -1
  191. package/dist/el-FIBNLH2V.mjs.map +0 -1
  192. package/dist/es-726NTS53.mjs.map +0 -1
  193. package/dist/fa-3N4CIWE6.mjs.map +0 -1
  194. package/dist/fi-JOM3M7Z4.mjs.map +0 -1
  195. package/dist/fr-56QSXS7E.mjs.map +0 -1
  196. package/dist/he-SNAXPJEK.mjs.map +0 -1
  197. package/dist/hi-CRBRD5TB.mjs.map +0 -1
  198. package/dist/id-BRCVLICF.mjs.map +0 -1
  199. package/dist/it-M2Z27BNB.mjs.map +0 -1
  200. package/dist/ja-TZUKW7HD.mjs.map +0 -1
  201. package/dist/ko-NKBGGOL6.mjs.map +0 -1
  202. package/dist/ms-XFXPN6RX.mjs.map +0 -1
  203. package/dist/nl-MVYXAS5C.mjs.map +0 -1
  204. package/dist/no-XOLO4JPV.mjs.map +0 -1
  205. package/dist/pl-TRWLMMC4.mjs.map +0 -1
  206. package/dist/pt-M3TE24UI.mjs.map +0 -1
  207. package/dist/ro-QBFG2T64.mjs.map +0 -1
  208. package/dist/sv-IUECBXWX.mjs.map +0 -1
  209. package/dist/th-US7KIN5Q.mjs.map +0 -1
  210. package/dist/tr-DWJ2FFUK.mjs.map +0 -1
  211. package/dist/uk-M4ZE4DPZ.mjs.map +0 -1
  212. package/dist/zh-3J2I3WYK.mjs.map +0 -1
  213. package/src/examples/ButtonUsageExample.tsx +0 -242
  214. package/src/examples/button-css-modules.module.css +0 -164
  215. package/src/examples/button-styled-components.tsx +0 -215
  216. package/src/examples/button-tailwind.css +0 -51
  217. /package/dist/{chunk-Q2KV6Y2J.mjs.map → chunk-7GEYABC6.mjs.map} +0 -0
  218. /package/dist/{chunk-3JTO27MH.mjs.map → chunk-D4GAAQMM.mjs.map} +0 -0
  219. /package/dist/{en-XWEPVTB4.mjs.map → en-HAKDCFKL.mjs.map} +0 -0
  220. /package/dist/{magic-string.es-7FJ3LUGB.mjs.map → magic-string.es-K77I4ZQN.mjs.map} +0 -0
@@ -19,7 +19,7 @@ import { render, waitFor, act } from '@testing-library/react';
19
19
  import { EventBusProvider, resetEventBusForTesting, useEventBus } from '../../../contexts/EventBusContext';
20
20
  import { ApiClientProvider } from '../../../contexts/ApiClientContext';
21
21
  import { AuthTokenProvider } from '../../../contexts/AuthTokenContext';
22
- import { resourceUri } from '@semiont/core';
22
+ import { resourceId } from '@semiont/core';
23
23
  import { useMarkFlow } from '../../../hooks/useMarkFlow';
24
24
  import { useYieldFlow } from '../../../hooks/useYieldFlow';
25
25
 
@@ -38,7 +38,7 @@ vi.mock('../../../components/Toast', () => ({
38
38
 
39
39
  describe('Toast Notifications - Verifies Toast Integration', () => {
40
40
  let eventBusInstance: any;
41
- const rUri = resourceUri('https://example.com/resources/test');
41
+ const rUri = resourceId('test');
42
42
 
43
43
  beforeEach(() => {
44
44
  resetEventBusForTesting();
@@ -27,8 +27,8 @@ import { ApiClientProvider } from '../../../contexts/ApiClientContext';
27
27
  import { AuthTokenProvider } from '../../../contexts/AuthTokenContext';
28
28
  import { useBindFlow } from '../../../hooks/useBindFlow';
29
29
  import { SSEClient } from '@semiont/api-client';
30
- import type { ResourceUri, AnnotationUri } from '@semiont/core';
31
- import { resourceUri, annotationUri } from '@semiont/core';
30
+ import type { AnnotationId, ResourceId } from '@semiont/core';
31
+ import { resourceId, annotationId } from '@semiont/core';
32
32
  import type { Emitter } from 'mitt';
33
33
  import type { EventMap } from '@semiont/core';
34
34
 
@@ -76,38 +76,17 @@ describe('Generation Flow - Feature Integration', () => {
76
76
  vi.restoreAllMocks();
77
77
  });
78
78
 
79
- it('should open modal when yield:modal-open event is emitted', async () => {
80
- const testResourceUri = resourceUri('http://localhost:4000/resources/test-resource');
81
- const testAnnotationUri = annotationUri('http://localhost:4000/resources/test-resource/annotations/test-annotation');
82
-
83
- const { emitModalOpen } = renderYieldFlow(
84
- testResourceUri
85
- );
86
-
87
- // Emit modal open event
88
- act(() => {
89
- emitModalOpen(testAnnotationUri, testResourceUri, 'Test Reference');
90
- });
91
-
92
- // Verify modal state updated
93
- await waitFor(() => {
94
- expect(screen.getByTestId('modal-open')).toHaveTextContent('true');
95
- expect(screen.getByTestId('reference-id')).toHaveTextContent(testAnnotationUri);
96
- expect(screen.getByTestId('default-title')).toHaveTextContent('Test Reference');
97
- });
98
- });
99
-
100
79
  it('should call yieldResourceFromAnnotation exactly ONCE when generation starts', async () => {
101
- const testResourceUri = resourceUri('http://localhost:4000/resources/test-resource');
102
- const testAnnotationUri = annotationUri('http://localhost:4000/resources/test-resource/annotations/test-annotation');
80
+ const testResourceId = resourceId('test-resource');
81
+ const testAnnotationId = annotationId('test-annotation');
103
82
 
104
83
  const { emitGenerationStart, getEventBus } = renderYieldFlow(
105
- testResourceUri
84
+ testResourceId
106
85
  );
107
86
 
108
87
  // Trigger generation with full options
109
88
  act(() => {
110
- emitGenerationStart(testAnnotationUri, testResourceUri, {
89
+ emitGenerationStart(testAnnotationId, testResourceId, {
111
90
  title: 'Generated Document',
112
91
  prompt: 'Create a comprehensive document',
113
92
  language: 'en',
@@ -125,10 +104,10 @@ describe('Generation Flow - Feature Integration', () => {
125
104
  expect(generateResourceSpy).toHaveBeenCalledTimes(1);
126
105
  });
127
106
 
128
- // Verify correct parameters
107
+ // Verify correct parameters — resourceId and annotationId are now bare IDs
129
108
  expect(generateResourceSpy).toHaveBeenCalledWith(
130
- testResourceUri,
131
- testAnnotationUri,
109
+ testResourceId,
110
+ testAnnotationId,
132
111
  {
133
112
  title: 'Generated Document',
134
113
  prompt: 'Create a comprehensive document',
@@ -145,16 +124,16 @@ describe('Generation Flow - Feature Integration', () => {
145
124
  });
146
125
 
147
126
  it('should propagate SSE progress events to useYieldProgress state', async () => {
148
- const testResourceUri = resourceUri('http://localhost:4000/resources/test-resource');
149
- const testAnnotationUri = annotationUri('http://localhost:4000/resources/test-resource/annotations/test-annotation');
127
+ const testResourceId = resourceId('test-resource');
128
+ const testAnnotationId = annotationId('test-annotation');
150
129
 
151
130
  const { emitGenerationStart, getEventBus } = renderYieldFlow(
152
- testResourceUri
131
+ testResourceId
153
132
  );
154
133
 
155
134
  // Start generation
156
135
  act(() => {
157
- emitGenerationStart(testAnnotationUri, testResourceUri, {
136
+ emitGenerationStart(testAnnotationId, testResourceId, {
158
137
  title: 'Test Doc',
159
138
  context: { sourceText: 'test' },
160
139
  });
@@ -182,16 +161,16 @@ describe('Generation Flow - Feature Integration', () => {
182
161
  });
183
162
 
184
163
  it('should handle multiple progress updates correctly', async () => {
185
- const testResourceUri = resourceUri('http://localhost:4000/resources/test-resource');
186
- const testAnnotationUri = annotationUri('http://localhost:4000/resources/test-resource/annotations/test-annotation');
164
+ const testResourceId = resourceId('test-resource');
165
+ const testAnnotationId = annotationId('test-annotation');
187
166
 
188
167
  const { emitGenerationStart, getEventBus } = renderYieldFlow(
189
- testResourceUri
168
+ testResourceId
190
169
  );
191
170
 
192
171
  // Start generation
193
172
  act(() => {
194
- emitGenerationStart(testAnnotationUri, testResourceUri, {
173
+ emitGenerationStart(testAnnotationId, testResourceId, {
195
174
  title: 'Test',
196
175
  context: { sourceText: 'test' },
197
176
  });
@@ -231,7 +210,7 @@ describe('Generation Flow - Feature Integration', () => {
231
210
  act(() => {
232
211
  getEventBus().get('yield:finished').next({
233
212
  status: 'complete',
234
- referenceId: testAnnotationUri,
213
+ referenceId: testAnnotationId,
235
214
  message: 'Document created successfully',
236
215
  percentage: 100,
237
216
  resourceName: 'Generated Document',
@@ -245,16 +224,16 @@ describe('Generation Flow - Feature Integration', () => {
245
224
  });
246
225
 
247
226
  it('should show success toast on generation complete', async () => {
248
- const testResourceUri = resourceUri('http://localhost:4000/resources/test-resource');
249
- const testAnnotationUri = annotationUri('http://localhost:4000/resources/test-resource/annotations/test-annotation');
227
+ const testResourceId = resourceId('test-resource');
228
+ const testAnnotationId = annotationId('test-annotation');
250
229
 
251
230
  const { emitGenerationStart, getEventBus } = renderYieldFlow(
252
- testResourceUri
231
+ testResourceId
253
232
  );
254
233
 
255
234
  // Start generation
256
235
  act(() => {
257
- emitGenerationStart(testAnnotationUri, testResourceUri, {
236
+ emitGenerationStart(testAnnotationId, testResourceId, {
258
237
  title: 'Test',
259
238
  context: { sourceText: 'test' },
260
239
  });
@@ -277,7 +256,7 @@ describe('Generation Flow - Feature Integration', () => {
277
256
  act(() => {
278
257
  getEventBus().get('yield:finished').next({
279
258
  status: 'complete',
280
- referenceId: testAnnotationUri,
259
+ referenceId: testAnnotationId,
281
260
  resourceName: 'Generated Document',
282
261
  percentage: 100,
283
262
  });
@@ -288,16 +267,16 @@ describe('Generation Flow - Feature Integration', () => {
288
267
  });
289
268
 
290
269
  it('should clear progress on generation failure', async () => {
291
- const testResourceUri = resourceUri('http://localhost:4000/resources/test-resource');
292
- const testAnnotationUri = annotationUri('http://localhost:4000/resources/test-resource/annotations/test-annotation');
270
+ const testResourceId = resourceId('test-resource');
271
+ const testAnnotationId = annotationId('test-annotation');
293
272
 
294
273
  const { emitGenerationStart, getEventBus } = renderYieldFlow(
295
- testResourceUri
274
+ testResourceId
296
275
  );
297
276
 
298
277
  // Start generation
299
278
  act(() => {
300
- emitGenerationStart(testAnnotationUri, testResourceUri, {
279
+ emitGenerationStart(testAnnotationId, testResourceId, {
301
280
  title: 'Test',
302
281
  context: { sourceText: 'test' },
303
282
  });
@@ -328,11 +307,11 @@ describe('Generation Flow - Feature Integration', () => {
328
307
  });
329
308
 
330
309
  it('should only call API once even with multiple event listeners', async () => {
331
- const testResourceUri = resourceUri('http://localhost:4000/resources/test-resource');
332
- const testAnnotationUri = annotationUri('http://localhost:4000/resources/test-resource/annotations/test-annotation');
310
+ const testResourceId = resourceId('test-resource');
311
+ const testAnnotationId = annotationId('test-annotation');
333
312
 
334
313
  const { emitGenerationStart, getEventBus } = renderYieldFlow(
335
- testResourceUri
314
+ testResourceId
336
315
  );
337
316
 
338
317
  // Add an additional event listener (simulating multiple subscribers)
@@ -341,7 +320,7 @@ describe('Generation Flow - Feature Integration', () => {
341
320
 
342
321
  // Trigger generation
343
322
  act(() => {
344
- emitGenerationStart(testAnnotationUri, testResourceUri, {
323
+ emitGenerationStart(testAnnotationId, testResourceId, {
345
324
  title: 'Test',
346
325
  context: { sourceText: 'test' },
347
326
  });
@@ -362,16 +341,16 @@ describe('Generation Flow - Feature Integration', () => {
362
341
  });
363
342
 
364
343
  it('should forward final chunk as progress before emitting complete', async () => {
365
- const testResourceUri = resourceUri('http://localhost:4000/resources/test-resource');
366
- const testAnnotationUri = annotationUri('http://localhost:4000/resources/test-resource/annotations/test-annotation');
344
+ const testResourceId = resourceId('test-resource');
345
+ const testAnnotationId = annotationId('test-annotation');
367
346
 
368
347
  const { emitGenerationStart, getEventBus } = renderYieldFlow(
369
- testResourceUri
348
+ testResourceId
370
349
  );
371
350
 
372
351
  // Start generation
373
352
  act(() => {
374
- emitGenerationStart(testAnnotationUri, testResourceUri, {
353
+ emitGenerationStart(testAnnotationId, testResourceId, {
375
354
  title: 'Test',
376
355
  context: { sourceText: 'test' },
377
356
  });
@@ -385,7 +364,7 @@ describe('Generation Flow - Feature Integration', () => {
385
364
  act(() => {
386
365
  getEventBus().get('yield:finished').next({
387
366
  status: 'complete',
388
- referenceId: testAnnotationUri,
367
+ referenceId: testAnnotationId,
389
368
  message: 'Document created: My Document',
390
369
  resourceName: 'My Document',
391
370
  percentage: 100,
@@ -405,7 +384,7 @@ describe('Generation Flow - Feature Integration', () => {
405
384
  * Returns methods to interact with the rendered component
406
385
  */
407
386
  function renderYieldFlow(
408
- testResourceUri: ResourceUri
387
+ testResourceId: ResourceId
409
388
  ) {
410
389
  let eventBusInstance: Emitter<EventMap>;
411
390
 
@@ -414,7 +393,7 @@ function renderYieldFlow(
414
393
  eventBusInstance = useEventBus();
415
394
 
416
395
  // Set up resolution flow (resolve:update-body, resolve:link)
417
- useBindFlow(testResourceUri);
396
+ useBindFlow(testResourceId);
418
397
 
419
398
  return null;
420
399
  }
@@ -422,23 +401,18 @@ function renderYieldFlow(
422
401
  // Test harness component that uses the hook
423
402
  function YieldFlowTestHarness() {
424
403
  const {
404
+ isGenerating,
425
405
  generationProgress,
426
- generationModalOpen,
427
- generationReferenceId,
428
- generationDefaultTitle,
429
406
  } = useYieldFlow(
430
407
  'en',
431
- testResourceUri.split('/resources/')[1] || 'test-resource',
408
+ testResourceId,
432
409
  vi.fn()
433
410
  );
434
411
 
435
412
  return (
436
413
  <div>
437
- <div data-testid="modal-open">{generationModalOpen ? 'true' : 'false'}</div>
438
- <div data-testid="reference-id">{generationReferenceId || 'none'}</div>
439
- <div data-testid="default-title">{generationDefaultTitle || 'none'}</div>
440
414
  <div data-testid="is-generating">
441
- {generationProgress ? 'true' : 'false'}
415
+ {isGenerating ? 'true' : 'false'}
442
416
  </div>
443
417
  <div data-testid="progress">
444
418
  {generationProgress?.message || 'No progress'}
@@ -459,20 +433,9 @@ function renderYieldFlow(
459
433
  );
460
434
 
461
435
  return {
462
- emitModalOpen: (
463
- annotationUri: AnnotationUri,
464
- resourceUri: ResourceUri,
465
- defaultTitle: string
466
- ) => {
467
- eventBusInstance.get('yield:modal-open').next({
468
- annotationUri,
469
- resourceUri,
470
- defaultTitle,
471
- });
472
- },
473
436
  emitGenerationStart: (
474
- annotationUri: AnnotationUri,
475
- resourceUri: ResourceUri,
437
+ aId: AnnotationId,
438
+ rId: ResourceId,
476
439
  options: {
477
440
  title: string;
478
441
  prompt?: string;
@@ -483,8 +446,8 @@ function renderYieldFlow(
483
446
  }
484
447
  ) => {
485
448
  eventBusInstance.get('yield:request').next({
486
- annotationUri,
487
- resourceUri,
449
+ annotationId: aId,
450
+ resourceId: rId,
488
451
  options,
489
452
  });
490
453
  },
@@ -180,7 +180,7 @@ describe('Detection Progress Flow Integration (Layer 3)', () => {
180
180
  expect(screen.queryByText(/Analyzing/)).not.toBeInTheDocument();
181
181
 
182
182
  // Click annotate button
183
- const annotateButton = screen.getByRole('button', { name: /✨ Annotate/ });
183
+ const annotateButton = screen.getByRole('button', { name: /✨\s*Annotate/ });
184
184
  await user.click(annotateButton);
185
185
 
186
186
  // Simulate SSE progress chunk #1: Starting
@@ -244,7 +244,7 @@ describe('Detection Progress Flow Integration (Layer 3)', () => {
244
244
  renderDetectionFlow();
245
245
 
246
246
  // Click annotate button
247
- const annotateButton = screen.getByRole('button', { name: /✨ Annotate/ });
247
+ const annotateButton = screen.getByRole('button', { name: /✨\s*Annotate/ });
248
248
  await user.click(annotateButton);
249
249
 
250
250
  // Simulate initial progress
@@ -284,7 +284,7 @@ describe('Detection Progress Flow Integration (Layer 3)', () => {
284
284
 
285
285
  renderDetectionFlow();
286
286
 
287
- const annotateButton = screen.getByRole('button', { name: /✨ Annotate/ });
287
+ const annotateButton = screen.getByRole('button', { name: /✨\s*Annotate/ });
288
288
  await user.click(annotateButton);
289
289
 
290
290
  // Simulate progress with request parameters
@@ -310,7 +310,7 @@ describe('Detection Progress Flow Integration (Layer 3)', () => {
310
310
 
311
311
  renderDetectionFlow();
312
312
 
313
- const annotateButton = screen.getByRole('button', { name: /✨ Annotate/ });
313
+ const annotateButton = screen.getByRole('button', { name: /✨\s*Annotate/ });
314
314
  await user.click(annotateButton);
315
315
 
316
316
  // Show progress