@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
@@ -1,59 +1,199 @@
1
1
  'use client';
2
2
  import {
3
3
  en_default
4
- } from "./chunk-LIHZTECW.mjs";
4
+ } from "./chunk-D7NBW4RV.mjs";
5
5
  import {
6
6
  __glob
7
7
  } from "./chunk-3JTO27MH.mjs";
8
8
 
9
9
  // src/contexts/ApiClientContext.tsx
10
- import { createContext, useContext } from "react";
10
+ import { createContext, useContext, useMemo } from "react";
11
+ import { SemiontApiClient, baseUrl } from "@semiont/api-client";
11
12
  import { jsx } from "react/jsx-runtime";
12
- var ApiClientContext = createContext(null);
13
+ var ApiClientContext = createContext(void 0);
13
14
  function ApiClientProvider({
14
- apiClientManager,
15
+ baseUrl: url,
15
16
  children
16
17
  }) {
17
- return /* @__PURE__ */ jsx(ApiClientContext.Provider, { value: apiClientManager, children });
18
+ const client = useMemo(
19
+ () => new SemiontApiClient({
20
+ baseUrl: baseUrl(url),
21
+ // Use no timeout in test environment to avoid AbortController issues with ky + vitest
22
+ ...process.env.NODE_ENV !== "test" && { timeout: 3e4 }
23
+ }),
24
+ [url]
25
+ // Only baseUrl in deps, token removed
26
+ );
27
+ return /* @__PURE__ */ jsx(ApiClientContext.Provider, { value: client, children });
18
28
  }
19
29
  function useApiClient() {
20
30
  const context = useContext(ApiClientContext);
21
- if (!context) {
31
+ if (context === void 0) {
22
32
  throw new Error("useApiClient must be used within an ApiClientProvider");
23
33
  }
24
- return context.client;
34
+ return context;
25
35
  }
26
36
 
27
- // src/contexts/SessionContext.tsx
28
- import { createContext as createContext2, useContext as useContext2 } from "react";
37
+ // src/contexts/EventBusContext.tsx
38
+ import { createContext as createContext2, useContext as useContext2, useMemo as useMemo2 } from "react";
39
+ import mitt from "mitt";
29
40
  import { jsx as jsx2 } from "react/jsx-runtime";
30
- var SessionContext = createContext2(null);
41
+ var EventBusContext = createContext2(null);
42
+ function generateBusId() {
43
+ return Math.floor(Math.random() * 4294967295).toString(16).padStart(8, "0");
44
+ }
45
+ function createEventBus() {
46
+ const bus = mitt();
47
+ const busId = generateBusId();
48
+ bus.busId = busId;
49
+ const originalEmit = bus.emit.bind(bus);
50
+ bus.emit = (eventName, payload) => {
51
+ console.info(`[EventBus:${busId}] emit:`, eventName, payload);
52
+ return originalEmit(eventName, payload);
53
+ };
54
+ const originalOn = bus.on.bind(bus);
55
+ bus.on = (eventName, handler) => {
56
+ console.debug(`[EventBus:${busId}] subscribe:`, eventName);
57
+ return originalOn(eventName, handler);
58
+ };
59
+ const originalOff = bus.off.bind(bus);
60
+ bus.off = (eventName, handler) => {
61
+ console.debug(`[EventBus:${busId}] unsubscribe:`, eventName);
62
+ return originalOff(eventName, handler);
63
+ };
64
+ return bus;
65
+ }
66
+ var globalEventBus = createEventBus();
67
+ function resetEventBusForTesting() {
68
+ globalEventBus = createEventBus();
69
+ }
70
+ function EventBusProvider({
71
+ children
72
+ }) {
73
+ const eventBus = useMemo2(() => globalEventBus, []);
74
+ return /* @__PURE__ */ jsx2(EventBusContext.Provider, { value: eventBus, children });
75
+ }
76
+ function useEventBus() {
77
+ const bus = useContext2(EventBusContext);
78
+ if (!bus) {
79
+ throw new Error("useEventBus must be used within EventBusProvider");
80
+ }
81
+ return bus;
82
+ }
83
+
84
+ // src/contexts/SessionContext.tsx
85
+ import { createContext as createContext3, useContext as useContext3 } from "react";
86
+ import { jsx as jsx3 } from "react/jsx-runtime";
87
+ var SessionContext = createContext3(null);
31
88
  function SessionProvider({
32
89
  sessionManager,
33
90
  children
34
91
  }) {
35
- return /* @__PURE__ */ jsx2(SessionContext.Provider, { value: sessionManager, children });
92
+ return /* @__PURE__ */ jsx3(SessionContext.Provider, { value: sessionManager, children });
36
93
  }
37
94
  function useSessionContext() {
38
- const context = useContext2(SessionContext);
95
+ const context = useContext3(SessionContext);
39
96
  if (!context) {
40
97
  throw new Error("useSessionContext must be used within SessionProvider");
41
98
  }
42
99
  return context;
43
100
  }
44
101
 
102
+ // src/components/Toast.tsx
103
+ import React, { useEffect, useState } from "react";
104
+ import { createPortal } from "react-dom";
105
+ import { jsx as jsx4, jsxs } from "react/jsx-runtime";
106
+ var icons = {
107
+ success: /* @__PURE__ */ jsx4("svg", { className: "semiont-toast-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx4("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }),
108
+ error: /* @__PURE__ */ jsx4("svg", { className: "semiont-toast-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx4("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }),
109
+ warning: /* @__PURE__ */ jsx4("svg", { className: "semiont-toast-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx4("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }),
110
+ info: /* @__PURE__ */ jsx4("svg", { className: "semiont-toast-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx4("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) })
111
+ };
112
+ function Toast({ toast, onClose }) {
113
+ useEffect(() => {
114
+ const timer = setTimeout(() => {
115
+ onClose(toast.id);
116
+ }, toast.duration || 3e3);
117
+ return () => clearTimeout(timer);
118
+ }, [toast, onClose]);
119
+ return /* @__PURE__ */ jsxs(
120
+ "div",
121
+ {
122
+ className: "semiont-toast",
123
+ "data-variant": toast.type,
124
+ role: "alert",
125
+ children: [
126
+ /* @__PURE__ */ jsx4("div", { className: "semiont-toast-icon-wrapper", children: icons[toast.type] }),
127
+ /* @__PURE__ */ jsx4("p", { className: "semiont-toast-message", children: toast.message }),
128
+ /* @__PURE__ */ jsx4(
129
+ "button",
130
+ {
131
+ onClick: () => onClose(toast.id),
132
+ className: "semiont-toast-close",
133
+ "aria-label": "Close",
134
+ children: /* @__PURE__ */ jsx4("svg", { className: "semiont-toast-close-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx4("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
135
+ }
136
+ )
137
+ ]
138
+ }
139
+ );
140
+ }
141
+ function ToastContainer({ toasts, onClose }) {
142
+ const [mounted, setMounted] = useState(false);
143
+ useEffect(() => {
144
+ setMounted(true);
145
+ return () => setMounted(false);
146
+ }, []);
147
+ if (!mounted) return null;
148
+ return createPortal(
149
+ /* @__PURE__ */ jsx4("div", { className: "semiont-toast-container", children: toasts.map((toast) => /* @__PURE__ */ jsx4(Toast, { toast, onClose }, toast.id)) }),
150
+ document.body
151
+ );
152
+ }
153
+ var ToastContext = React.createContext(void 0);
154
+ function ToastProvider({ children }) {
155
+ const [toasts, setToasts] = useState([]);
156
+ const showToast = React.useCallback((message, type = "info", duration) => {
157
+ const id = Date.now().toString();
158
+ const newToast = duration !== void 0 ? { id, message, type, duration } : { id, message, type };
159
+ setToasts((prev) => [...prev, newToast]);
160
+ }, []);
161
+ const showSuccess = React.useCallback((message, duration) => showToast(message, "success", duration), [showToast]);
162
+ const showError = React.useCallback((message, duration) => showToast(message, "error", duration), [showToast]);
163
+ const showWarning = React.useCallback((message, duration) => showToast(message, "warning", duration), [showToast]);
164
+ const showInfo = React.useCallback((message, duration) => showToast(message, "info", duration), [showToast]);
165
+ const handleClose = React.useCallback((id) => {
166
+ setToasts((prev) => prev.filter((toast) => toast.id !== id));
167
+ }, []);
168
+ const contextValue = React.useMemo(
169
+ () => ({ showToast, showSuccess, showError, showWarning, showInfo }),
170
+ [showToast, showSuccess, showError, showWarning, showInfo]
171
+ );
172
+ return /* @__PURE__ */ jsxs(ToastContext.Provider, { value: contextValue, children: [
173
+ children,
174
+ /* @__PURE__ */ jsx4(ToastContainer, { toasts, onClose: handleClose })
175
+ ] });
176
+ }
177
+ function useToast() {
178
+ const context = React.useContext(ToastContext);
179
+ if (context === void 0) {
180
+ throw new Error("useToast must be used within a ToastProvider");
181
+ }
182
+ return context;
183
+ }
184
+
45
185
  // src/contexts/OpenResourcesContext.tsx
46
- import { createContext as createContext3, useContext as useContext3 } from "react";
47
- import { jsx as jsx3 } from "react/jsx-runtime";
48
- var OpenResourcesContext = createContext3(void 0);
186
+ import { createContext as createContext4, useContext as useContext4 } from "react";
187
+ import { jsx as jsx5 } from "react/jsx-runtime";
188
+ var OpenResourcesContext = createContext4(void 0);
49
189
  function OpenResourcesProvider({
50
190
  openResourcesManager,
51
191
  children
52
192
  }) {
53
- return /* @__PURE__ */ jsx3(OpenResourcesContext.Provider, { value: openResourcesManager, children });
193
+ return /* @__PURE__ */ jsx5(OpenResourcesContext.Provider, { value: openResourcesManager, children });
54
194
  }
55
195
  function useOpenResources() {
56
- const context = useContext3(OpenResourcesContext);
196
+ const context = useContext4(OpenResourcesContext);
57
197
  if (context === void 0) {
58
198
  throw new Error("useOpenResources must be used within an OpenResourcesProvider");
59
199
  }
@@ -61,44 +201,44 @@ function useOpenResources() {
61
201
  }
62
202
 
63
203
  // src/contexts/TranslationContext.tsx
64
- import { createContext as createContext4, useContext as useContext4, useState, useEffect, useMemo } from "react";
65
- import { Fragment, jsx as jsx4 } from "react/jsx-runtime";
204
+ import { createContext as createContext5, useContext as useContext5, useState as useState2, useEffect as useEffect2, useMemo as useMemo3 } from "react";
205
+ import { Fragment, jsx as jsx6 } from "react/jsx-runtime";
66
206
 
67
207
  // import("../../translations/**/*.json") in src/contexts/TranslationContext.tsx
68
208
  var globImport_translations_json = __glob({
69
- "../../translations/ar.json": () => import("./ar-EMHEHPCJ.mjs"),
70
- "../../translations/bn.json": () => import("./bn-OVCI4F6X.mjs"),
71
- "../../translations/cs.json": () => import("./cs-FAN66Q2F.mjs"),
72
- "../../translations/da.json": () => import("./da-YBBIHI2O.mjs"),
73
- "../../translations/de.json": () => import("./de-MAYU33LB.mjs"),
74
- "../../translations/el.json": () => import("./el-MKGSWN4O.mjs"),
75
- "../../translations/en.json": () => import("./en-DDLIXJCU.mjs"),
76
- "../../translations/es.json": () => import("./es-52LHUWJD.mjs"),
77
- "../../translations/fa.json": () => import("./fa-FJICRANB.mjs"),
78
- "../../translations/fi.json": () => import("./fi-O455XFCR.mjs"),
79
- "../../translations/fr.json": () => import("./fr-TXIXHOOE.mjs"),
80
- "../../translations/he.json": () => import("./he-JBSOX5IN.mjs"),
81
- "../../translations/hi.json": () => import("./hi-KGHI3XVT.mjs"),
82
- "../../translations/id.json": () => import("./id-5OCPPZLO.mjs"),
83
- "../../translations/it.json": () => import("./it-PNBBZSM2.mjs"),
84
- "../../translations/ja.json": () => import("./ja-LDD7R3TJ.mjs"),
85
- "../../translations/ko.json": () => import("./ko-F47ZDEY3.mjs"),
86
- "../../translations/ms.json": () => import("./ms-Z7LMXJWL.mjs"),
87
- "../../translations/nl.json": () => import("./nl-6SJFBPJ3.mjs"),
88
- "../../translations/no.json": () => import("./no-YXPBPSGF.mjs"),
89
- "../../translations/pl.json": () => import("./pl-P4AZ2QME.mjs"),
90
- "../../translations/pt.json": () => import("./pt-LHWUS6U6.mjs"),
91
- "../../translations/ro.json": () => import("./ro-EA5J2ZON.mjs"),
92
- "../../translations/sv.json": () => import("./sv-DATBS3UQ.mjs"),
93
- "../../translations/th.json": () => import("./th-WTFJRWPT.mjs"),
94
- "../../translations/tr.json": () => import("./tr-IKO3RXOX.mjs"),
95
- "../../translations/uk.json": () => import("./uk-CF6CTTRK.mjs"),
96
- "../../translations/vi.json": () => import("./vi-AJLTXPZQ.mjs"),
97
- "../../translations/zh.json": () => import("./zh-U3ORHHYH.mjs")
209
+ "../../translations/ar.json": () => import("./ar-4ZEORRW2.mjs"),
210
+ "../../translations/bn.json": () => import("./bn-SEDE5BQJ.mjs"),
211
+ "../../translations/cs.json": () => import("./cs-7W4WF5WD.mjs"),
212
+ "../../translations/da.json": () => import("./da-75XGBCBK.mjs"),
213
+ "../../translations/de.json": () => import("./de-ODJVFLHM.mjs"),
214
+ "../../translations/el.json": () => import("./el-C4PM4WB3.mjs"),
215
+ "../../translations/en.json": () => import("./en-KJCJQ4OO.mjs"),
216
+ "../../translations/es.json": () => import("./es-WD33R7QL.mjs"),
217
+ "../../translations/fa.json": () => import("./fa-2BP6V56P.mjs"),
218
+ "../../translations/fi.json": () => import("./fi-USRRW24J.mjs"),
219
+ "../../translations/fr.json": () => import("./fr-EC5S6WVF.mjs"),
220
+ "../../translations/he.json": () => import("./he-7TBVIKAA.mjs"),
221
+ "../../translations/hi.json": () => import("./hi-FO4VIZLA.mjs"),
222
+ "../../translations/id.json": () => import("./id-7U7GGVWY.mjs"),
223
+ "../../translations/it.json": () => import("./it-Y4OPL6I2.mjs"),
224
+ "../../translations/ja.json": () => import("./ja-PK7SQL55.mjs"),
225
+ "../../translations/ko.json": () => import("./ko-L25PXMYD.mjs"),
226
+ "../../translations/ms.json": () => import("./ms-STH777QM.mjs"),
227
+ "../../translations/nl.json": () => import("./nl-Y7LECDDR.mjs"),
228
+ "../../translations/no.json": () => import("./no-KEKCEWU6.mjs"),
229
+ "../../translations/pl.json": () => import("./pl-7A7OC75O.mjs"),
230
+ "../../translations/pt.json": () => import("./pt-35HTM7RA.mjs"),
231
+ "../../translations/ro.json": () => import("./ro-VAWL5KQA.mjs"),
232
+ "../../translations/sv.json": () => import("./sv-7ZK5EQEB.mjs"),
233
+ "../../translations/th.json": () => import("./th-UDWZ4X34.mjs"),
234
+ "../../translations/tr.json": () => import("./tr-4WMPK3UX.mjs"),
235
+ "../../translations/uk.json": () => import("./uk-SSLASQYJ.mjs"),
236
+ "../../translations/vi.json": () => import("./vi-IF42Z5PU.mjs"),
237
+ "../../translations/zh.json": () => import("./zh-HRQTNTAI.mjs")
98
238
  });
99
239
 
100
240
  // src/contexts/TranslationContext.tsx
101
- var TranslationContext = createContext4(null);
241
+ var TranslationContext = createContext5(null);
102
242
  var translationCache = /* @__PURE__ */ new Map();
103
243
  function processPluralFormat(text, params) {
104
244
  const pluralMatch = text.match(/\{(\w+),\s*plural,\s*/);
@@ -247,9 +387,9 @@ function TranslationProvider({
247
387
  loadingComponent = null,
248
388
  children
249
389
  }) {
250
- const [loadedTranslations, setLoadedTranslations] = useState(null);
251
- const [isLoading, setIsLoading] = useState(false);
252
- useEffect(() => {
390
+ const [loadedTranslations, setLoadedTranslations] = useState2(null);
391
+ const [isLoading, setIsLoading] = useState2(false);
392
+ useEffect2(() => {
253
393
  if (locale && !translationManager) {
254
394
  setIsLoading(true);
255
395
  loadTranslations(locale).then((translations) => {
@@ -262,7 +402,7 @@ function TranslationProvider({
262
402
  });
263
403
  }
264
404
  }, [locale, translationManager]);
265
- const localeManager = useMemo(() => {
405
+ const localeManager = useMemo3(() => {
266
406
  if (!loadedTranslations) return null;
267
407
  return {
268
408
  t: (namespace, key, params) => {
@@ -284,18 +424,18 @@ function TranslationProvider({
284
424
  };
285
425
  }, [loadedTranslations, locale]);
286
426
  if (translationManager) {
287
- return /* @__PURE__ */ jsx4(TranslationContext.Provider, { value: translationManager, children });
427
+ return /* @__PURE__ */ jsx6(TranslationContext.Provider, { value: translationManager, children });
288
428
  }
289
429
  if (locale && isLoading) {
290
- return /* @__PURE__ */ jsx4(Fragment, { children: loadingComponent });
430
+ return /* @__PURE__ */ jsx6(Fragment, { children: loadingComponent });
291
431
  }
292
432
  if (locale && localeManager) {
293
- return /* @__PURE__ */ jsx4(TranslationContext.Provider, { value: localeManager, children });
433
+ return /* @__PURE__ */ jsx6(TranslationContext.Provider, { value: localeManager, children });
294
434
  }
295
- return /* @__PURE__ */ jsx4(TranslationContext.Provider, { value: defaultTranslationManager, children });
435
+ return /* @__PURE__ */ jsx6(TranslationContext.Provider, { value: defaultTranslationManager, children });
296
436
  }
297
437
  function useTranslations(namespace) {
298
- const context = useContext4(TranslationContext);
438
+ const context = useContext5(TranslationContext);
299
439
  if (!context) {
300
440
  return (key, params) => {
301
441
  const translations = en_default;
@@ -332,102 +472,22 @@ function usePreloadTranslations() {
332
472
  };
333
473
  }
334
474
 
335
- // src/components/Toast.tsx
336
- import React2, { useEffect as useEffect2, useState as useState2 } from "react";
337
- import { createPortal } from "react-dom";
338
- import { jsx as jsx5, jsxs } from "react/jsx-runtime";
339
- var icons = {
340
- success: /* @__PURE__ */ jsx5("svg", { className: "semiont-toast-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }),
341
- error: /* @__PURE__ */ jsx5("svg", { className: "semiont-toast-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }),
342
- warning: /* @__PURE__ */ jsx5("svg", { className: "semiont-toast-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }),
343
- info: /* @__PURE__ */ jsx5("svg", { className: "semiont-toast-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) })
344
- };
345
- function Toast({ toast, onClose }) {
346
- useEffect2(() => {
347
- const timer = setTimeout(() => {
348
- onClose(toast.id);
349
- }, toast.duration || 3e3);
350
- return () => clearTimeout(timer);
351
- }, [toast, onClose]);
352
- return /* @__PURE__ */ jsxs(
353
- "div",
354
- {
355
- className: "semiont-toast",
356
- "data-variant": toast.type,
357
- role: "alert",
358
- children: [
359
- /* @__PURE__ */ jsx5("div", { className: "semiont-toast-icon-wrapper", children: icons[toast.type] }),
360
- /* @__PURE__ */ jsx5("p", { className: "semiont-toast-message", children: toast.message }),
361
- /* @__PURE__ */ jsx5(
362
- "button",
363
- {
364
- onClick: () => onClose(toast.id),
365
- className: "semiont-toast-close",
366
- "aria-label": "Close",
367
- children: /* @__PURE__ */ jsx5("svg", { className: "semiont-toast-close-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
368
- }
369
- )
370
- ]
371
- }
372
- );
373
- }
374
- function ToastContainer({ toasts, onClose }) {
375
- const [mounted, setMounted] = useState2(false);
376
- useEffect2(() => {
377
- setMounted(true);
378
- return () => setMounted(false);
379
- }, []);
380
- if (!mounted) return null;
381
- return createPortal(
382
- /* @__PURE__ */ jsx5("div", { className: "semiont-toast-container", children: toasts.map((toast) => /* @__PURE__ */ jsx5(Toast, { toast, onClose }, toast.id)) }),
383
- document.body
384
- );
385
- }
386
- var ToastContext = React2.createContext(void 0);
387
- function ToastProvider({ children }) {
388
- const [toasts, setToasts] = useState2([]);
389
- const showToast = React2.useCallback((message, type = "info", duration) => {
390
- const id = Date.now().toString();
391
- const newToast = duration !== void 0 ? { id, message, type, duration } : { id, message, type };
392
- setToasts((prev) => [...prev, newToast]);
393
- }, []);
394
- const showSuccess = React2.useCallback((message, duration) => showToast(message, "success", duration), [showToast]);
395
- const showError = React2.useCallback((message, duration) => showToast(message, "error", duration), [showToast]);
396
- const showWarning = React2.useCallback((message, duration) => showToast(message, "warning", duration), [showToast]);
397
- const showInfo = React2.useCallback((message, duration) => showToast(message, "info", duration), [showToast]);
398
- const handleClose = React2.useCallback((id) => {
399
- setToasts((prev) => prev.filter((toast) => toast.id !== id));
400
- }, []);
401
- const contextValue = React2.useMemo(
402
- () => ({ showToast, showSuccess, showError, showWarning, showInfo }),
403
- [showToast, showSuccess, showError, showWarning, showInfo]
404
- );
405
- return /* @__PURE__ */ jsxs(ToastContext.Provider, { value: contextValue, children: [
406
- children,
407
- /* @__PURE__ */ jsx5(ToastContainer, { toasts, onClose: handleClose })
408
- ] });
409
- }
410
- function useToast() {
411
- const context = React2.useContext(ToastContext);
412
- if (context === void 0) {
413
- throw new Error("useToast must be used within a ToastProvider");
414
- }
415
- return context;
416
- }
417
-
418
475
  export {
419
476
  ApiClientProvider,
420
477
  useApiClient,
478
+ resetEventBusForTesting,
479
+ EventBusProvider,
480
+ useEventBus,
421
481
  SessionProvider,
422
482
  useSessionContext,
483
+ ToastContainer,
484
+ ToastProvider,
485
+ useToast,
423
486
  OpenResourcesProvider,
424
487
  useOpenResources,
425
488
  AVAILABLE_LOCALES,
426
489
  TranslationProvider,
427
490
  useTranslations,
428
- usePreloadTranslations,
429
- ToastContainer,
430
- ToastProvider,
431
- useToast
491
+ usePreloadTranslations
432
492
  };
433
- //# sourceMappingURL=chunk-JZIO2A3B.mjs.map
493
+ //# sourceMappingURL=chunk-QB52Q7EQ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/contexts/ApiClientContext.tsx","../src/contexts/EventBusContext.tsx","../src/contexts/SessionContext.tsx","../src/components/Toast.tsx","../src/contexts/OpenResourcesContext.tsx","../src/contexts/TranslationContext.tsx"],"sourcesContent":["'use client';\n\nimport { createContext, useContext, ReactNode, useMemo } from 'react';\nimport { SemiontApiClient, baseUrl } from '@semiont/api-client';\n\nconst ApiClientContext = createContext<SemiontApiClient | undefined>(undefined);\n\nexport interface ApiClientProviderProps {\n baseUrl: string;\n children: ReactNode;\n}\n\n/**\n * Provider for API client - creates a stateless singleton client\n * The client instance never changes (no token dependency)\n * Auth tokens are passed per-request via useAuthToken() in calling code\n */\nexport function ApiClientProvider({\n baseUrl: url,\n children,\n}: ApiClientProviderProps) {\n // Client created once and never recreated (no token dependency)\n const client = useMemo(\n () => new SemiontApiClient({\n baseUrl: baseUrl(url),\n // Use no timeout in test environment to avoid AbortController issues with ky + vitest\n ...(process.env.NODE_ENV !== 'test' && { timeout: 30000 }),\n }),\n [url] // Only baseUrl in deps, token removed\n );\n\n return (\n <ApiClientContext.Provider value={client}>\n {children}\n </ApiClientContext.Provider>\n );\n}\n\n/**\n * Hook to access the stateless API client singleton\n * Must be used within an ApiClientProvider\n * @returns Stateless SemiontApiClient instance\n */\nexport function useApiClient(): SemiontApiClient {\n const context = useContext(ApiClientContext);\n\n if (context === undefined) {\n throw new Error('useApiClient must be used within an ApiClientProvider');\n }\n\n return context;\n}\n","'use client';\n\nimport { createContext, useContext, useMemo, type ReactNode } from 'react';\nimport mitt from 'mitt';\nimport type { Handler } from 'mitt';\nimport type { ResourceEvent } from '@semiont/core';\nimport type { components, Selector, ResourceUri, GenerationContext } from '@semiont/api-client';\nimport type { DetectionProgress, GenerationProgress } from '../types/progress';\n\ntype Annotation = components['schemas']['Annotation'];\ntype Motivation = components['schemas']['Motivation'];\n\ninterface SelectionData {\n exact: string;\n start: number;\n end: number;\n svgSelector?: string;\n fragmentSelector?: string;\n conformsTo?: string;\n prefix?: string;\n suffix?: string;\n}\n\n/**\n * Unified event map for all application events\n *\n * Consolidates events from:\n * - MakeMeaningEventBus (document/annotation operations)\n * - NavigationEventBus (navigation and sidebar UI)\n * - GlobalSettingsEventBus (app-wide settings)\n */\nexport type EventMap = {\n // ===== BACKEND EVENTS (from SSE) =====\n\n // Generic event (all types)\n 'make-meaning:event': ResourceEvent;\n\n // Detection events (backend real-time stream via GET /resources/:id/events/stream)\n 'detection:started': Extract<ResourceEvent, { type: 'job.started' }>;\n 'detection:entity-found': Extract<ResourceEvent, { type: 'annotation.added' }>;\n 'detection:completed': Extract<ResourceEvent, { type: 'job.completed' }>;\n 'detection:failed': Extract<ResourceEvent, { type: 'job.failed' }>;\n // Detection progress from SSE detection streams (all 5 motivation types)\n 'detection:progress': DetectionProgress;\n\n // Annotation events (backend)\n 'annotation:added': Extract<ResourceEvent, { type: 'annotation.added' }>;\n 'annotation:removed': Extract<ResourceEvent, { type: 'annotation.removed' }>;\n 'annotation:updated': Extract<ResourceEvent, { type: 'annotation.body.updated' }>;\n\n // Entity tag events (backend)\n 'entity-tag:added': Extract<ResourceEvent, { type: 'entitytag.added' }>;\n 'entity-tag:removed': Extract<ResourceEvent, { type: 'entitytag.removed' }>;\n\n // Resource events (backend)\n 'resource:archived': Extract<ResourceEvent, { type: 'resource.archived' }>;\n 'resource:unarchived': Extract<ResourceEvent, { type: 'resource.unarchived' }>;\n\n // ===== USER INTERACTION EVENTS =====\n\n // Selection events (user highlighting text/regions)\n 'selection:comment-requested': SelectionData;\n 'selection:tag-requested': SelectionData;\n 'selection:assessment-requested': SelectionData;\n 'selection:reference-requested': SelectionData;\n\n // Unified annotation request event (all motivations)\n 'annotation:requested': {\n selector: Selector | Selector[];\n motivation: Motivation;\n };\n\n // Annotation interaction events\n 'annotation:cancel-pending': void;\n 'annotation:hover': { annotationId: string | null }; // Bidirectional hover: annotation overlay ↔ panel entry\n 'annotation:click': { annotationId: string; motivation: Motivation }; // Click on annotation - includes motivation for panel coordination\n 'annotation:focus': { annotationId: string | null };\n 'annotation:sparkle': { annotationId: string };\n\n // Panel management events\n 'panel:toggle': { panel: string };\n 'panel:open': { panel: string; scrollToAnnotationId?: string; motivation?: string };\n 'panel:close': void;\n\n // View mode events\n 'view:mode-toggled': void;\n\n // Toolbar events (annotation UI controls)\n 'toolbar:selection-changed': { motivation: string | null };\n 'toolbar:click-changed': { action: string };\n 'toolbar:shape-changed': { shape: string };\n\n // Navigation events (sidebar UI)\n 'navigation:sidebar-toggle': void;\n 'navigation:resource-close': { resourceId: string };\n 'navigation:resource-reorder': { oldIndex: number; newIndex: number };\n 'navigation:link-clicked': { href: string; label?: string };\n 'navigation:router-push': { path: string; reason?: string };\n 'navigation:external-navigate': { url: string; resourceId?: string; cancelFallback: () => void };\n 'navigation:reference-navigate': { documentId: string };\n 'navigation:entity-type-clicked': { entityType: string };\n\n // Settings events (app-wide)\n 'settings:theme-changed': { theme: 'light' | 'dark' | 'system' };\n 'settings:line-numbers-toggled': void;\n 'settings:locale-changed': { locale: string };\n\n // ===== API OPERATION EVENTS =====\n\n // Resource operations\n 'resource:archive': void;\n 'resource:unarchive': void;\n 'resource:clone': void;\n\n // Job control\n 'job:cancel-requested': { jobType: 'detection' | 'generation' };\n\n // Annotation CRUD operations\n 'annotation:create': {\n motivation: Motivation;\n selector: Selector | Selector[];\n body: components['schemas']['AnnotationBody'][];\n };\n 'annotation:created': { annotation: Annotation };\n 'annotation:create-failed': { error: Error };\n 'annotation:delete': { annotationId: string };\n 'annotation:deleted': { annotationId: string };\n 'annotation:delete-failed': { error: Error };\n 'annotation:update-body': {\n annotationUri: string;\n resourceId: string;\n operations: Array<{\n op: 'add' | 'remove' | 'replace';\n item?: components['schemas']['AnnotationBody'];\n oldItem?: components['schemas']['AnnotationBody'];\n newItem?: components['schemas']['AnnotationBody'];\n }>;\n };\n 'annotation:body-updated': { annotationUri: string };\n 'annotation:body-update-failed': { error: Error };\n\n // Detection operations\n 'detection:start': {\n motivation: Motivation;\n options: {\n instructions?: string;\n /** Comment tone */\n tone?: 'scholarly' | 'explanatory' | 'conversational' | 'technical' | 'analytical' | 'critical' | 'balanced' | 'constructive';\n density?: number;\n entityTypes?: string[];\n includeDescriptiveReferences?: boolean;\n schemaId?: string;\n categories?: string[];\n };\n };\n 'detection:complete': { motivation?: Motivation; resourceUri?: ResourceUri; progress?: DetectionProgress };\n 'detection:cancelled': void;\n 'detection:dismiss-progress': void;\n\n // Resource generation operations (unified event-driven flow)\n 'generation:start': {\n annotationUri: string;\n resourceUri: string;\n options: {\n title: string;\n prompt?: string;\n language?: string;\n temperature?: number;\n maxTokens?: number;\n context: GenerationContext;\n };\n };\n 'generation:progress': GenerationProgress;\n 'generation:complete': { annotationUri: string; progress: GenerationProgress };\n 'generation:failed': { error: Error };\n 'generation:modal-open': {\n annotationUri: string;\n resourceUri: string;\n defaultTitle: string;\n };\n 'reference:create-manual': {\n annotationUri: string;\n title: string;\n entityTypes: string[];\n };\n 'reference:link': {\n annotationUri: string;\n searchTerm: string;\n };\n 'resolution:search-requested': {\n referenceId: string;\n searchTerm: string;\n };\n 'context:retrieval-requested': {\n annotationUri: string;\n resourceUri: string;\n };\n 'context:retrieval-complete': {\n annotationUri: string;\n context: GenerationContext;\n };\n 'context:retrieval-failed': {\n annotationUri: string;\n error: Error;\n };\n};\n\nexport type EventBus = ReturnType<typeof mitt<EventMap>> & { busId: string };\n\nconst EventBusContext = createContext<EventBus | null>(null);\n\n/**\n * Generate an 8-digit hex identifier for an event bus instance\n */\nfunction generateBusId(): string {\n return Math.floor(Math.random() * 0xFFFFFFFF).toString(16).padStart(8, '0');\n}\n\n/**\n * Create an EventBus instance with logging and unique identifier\n */\nfunction createEventBus(): EventBus {\n const bus = mitt<EventMap>() as EventBus;\n const busId = generateBusId();\n\n // Add busId property\n bus.busId = busId;\n\n // Wrap emit to add logging with busId\n const originalEmit = bus.emit.bind(bus);\n bus.emit = <Key extends keyof EventMap>(eventName: Key, payload?: EventMap[Key]) => {\n console.info(`[EventBus:${busId}] emit:`, eventName, payload);\n return originalEmit(eventName, payload as EventMap[Key]);\n };\n\n // Wrap on to add logging with busId\n const originalOn = bus.on.bind(bus);\n bus.on = <Key extends keyof EventMap>(eventName: Key, handler: Handler<EventMap[Key]>) => {\n console.debug(`[EventBus:${busId}] subscribe:`, eventName);\n return originalOn(eventName, handler);\n };\n\n // Wrap off to add logging with busId\n const originalOff = bus.off.bind(bus);\n bus.off = <Key extends keyof EventMap>(eventName: Key, handler?: Handler<EventMap[Key]>) => {\n console.debug(`[EventBus:${busId}] unsubscribe:`, eventName);\n return originalOff(eventName, handler);\n };\n\n return bus;\n}\n\n/**\n * Global singleton event bus.\n *\n * This ensures all components in the application share the same event bus instance,\n * which is critical for cross-component communication (e.g., hovering an annotation\n * in one component scrolls the panel in another component).\n *\n * FUTURE: Multi-Window Support\n * When we need to support multiple document windows (e.g., pop-out resource viewers),\n * we'll need to transition to a per-window event bus architecture:\n *\n * Option 1: Window-scoped event bus\n * - Create a new event bus for each window/portal\n * - Pass windowId or documentId to EventBusProvider\n * - Store Map<windowId, EventBus> instead of single global\n * - Components use useEventBus(windowId) to get correct bus\n *\n * Option 2: Event bus hierarchy\n * - Global event bus for app-wide events (settings, navigation)\n * - Per-document event bus for document-specific events (annotation hover)\n * - Components subscribe to both buses as needed\n *\n * Option 3: Cross-window event bridge\n * - Keep per-window buses isolated\n * - Use BroadcastChannel or postMessage for cross-window events\n * - Bridge pattern to sync certain events across windows\n *\n * For now, single global bus is correct for single-window app.\n */\nlet globalEventBus = createEventBus();\n\n/**\n * Reset the global event bus - FOR TESTING ONLY.\n *\n * Call this in test setup (beforeEach) to ensure test isolation.\n * Each test gets a fresh event bus with no lingering subscriptions.\n *\n * @example\n * ```typescript\n * beforeEach(() => {\n * resetEventBusForTesting();\n * });\n * ```\n */\nexport function resetEventBusForTesting() {\n globalEventBus = createEventBus();\n}\n\nexport interface EventBusProviderProps {\n children: ReactNode;\n // rUri and client removed - operation handlers are now set up via useResolutionFlow hook\n}\n\n/**\n * Unified event bus provider for all application events\n *\n * Consolidates three previous event buses:\n * - MakeMeaningEventBus (document/annotation operations)\n * - NavigationEventBus (navigation and sidebar UI)\n * - GlobalSettingsEventBus (app-wide settings)\n *\n * Benefits:\n * - Single import: useEventBus()\n * - No decision fatigue about which bus to use\n * - Easier cross-domain coordination\n * - Simpler provider hierarchy\n *\n * NOTE: This provider uses a global singleton event bus to ensure all components\n * share the same instance. Multiple providers in the tree will all reference the\n * same global bus.\n *\n * Operation handlers (API calls triggered by events) are set up separately via\n * the useResolutionFlow hook, which should be called at the resource page level.\n */\nexport function EventBusProvider({\n children,\n}: EventBusProviderProps) {\n const eventBus = useMemo(() => globalEventBus, []);\n\n return (\n <EventBusContext.Provider value={eventBus}>\n {children}\n </EventBusContext.Provider>\n );\n}\n\n/**\n * Hook to access the unified event bus\n *\n * Use this everywhere instead of:\n * - useMakeMeaningEvents()\n * - useNavigationEvents()\n * - useGlobalSettingsEvents()\n *\n * @example\n * ```typescript\n * const eventBus = useEventBus();\n *\n * // Emit any event\n * eventBus.emit('annotation:hover', { annotationId: '123' });\n * eventBus.emit('navigation:sidebar-toggle', undefined);\n * eventBus.emit('settings:theme-changed', { theme: 'dark' });\n *\n * // Subscribe to any event\n * useEffect(() => {\n * const handler = ({ annotationId }) => console.log(annotationId);\n * eventBus.on('annotation:hover', handler);\n * return () => eventBus.off('annotation:hover', handler);\n * }, []);\n * ```\n */\nexport function useEventBus(): EventBus {\n const bus = useContext(EventBusContext);\n if (!bus) {\n throw new Error('useEventBus must be used within EventBusProvider');\n }\n return bus;\n}\n","'use client';\n\nimport { createContext, useContext, ReactNode } from 'react';\nimport type { SessionManager } from '../types/SessionManager';\n\nconst SessionContext = createContext<SessionManager | null>(null);\n\n/**\n * Provider Pattern: Accepts SessionManager implementation as prop\n * and makes it available to child components via Context.\n *\n * Apps provide their own implementation (next-auth, custom auth, etc.)\n * and pass it to this provider at the root level.\n *\n * @example\n * ```tsx\n * // In app root\n * const sessionManager = useSessionManager(); // App's implementation\n *\n * <SessionProvider sessionManager={sessionManager}>\n * <App />\n * </SessionProvider>\n * ```\n */\nexport function SessionProvider({\n sessionManager,\n children\n}: {\n sessionManager: SessionManager;\n children: ReactNode;\n}) {\n return (\n <SessionContext.Provider value={sessionManager}>\n {children}\n </SessionContext.Provider>\n );\n}\n\n/**\n * Hook to access SessionManager from Context\n * Components use this hook to access session state and expiry information\n */\nexport function useSessionContext() {\n const context = useContext(SessionContext);\n if (!context) {\n throw new Error('useSessionContext must be used within SessionProvider');\n }\n return context;\n}","'use client';\n\nimport React, { useEffect, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport './Toast.css';\n\nexport type ToastType = 'success' | 'error' | 'info' | 'warning';\n\nexport interface ToastMessage {\n id: string;\n message: string;\n type: ToastType;\n duration?: number;\n}\n\ninterface ToastProps {\n toast: ToastMessage;\n onClose: (id: string) => void;\n}\n\nconst icons = {\n success: (\n <svg className=\"semiont-toast-icon\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M5 13l4 4L19 7\" />\n </svg>\n ),\n error: (\n <svg className=\"semiont-toast-icon\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n ),\n warning: (\n <svg className=\"semiont-toast-icon\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\" />\n </svg>\n ),\n info: (\n <svg className=\"semiont-toast-icon\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z\" />\n </svg>\n ),\n};\n\nfunction Toast({ toast, onClose }: ToastProps) {\n useEffect(() => {\n const timer = setTimeout(() => {\n onClose(toast.id);\n }, toast.duration || 3000);\n\n return () => clearTimeout(timer);\n }, [toast, onClose]);\n\n return (\n <div\n className=\"semiont-toast\"\n data-variant={toast.type}\n role=\"alert\"\n >\n <div className=\"semiont-toast-icon-wrapper\">{icons[toast.type]}</div>\n <p className=\"semiont-toast-message\">{toast.message}</p>\n <button\n onClick={() => onClose(toast.id)}\n className=\"semiont-toast-close\"\n aria-label=\"Close\"\n >\n <svg className=\"semiont-toast-close-icon\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n );\n}\n\ninterface ToastContainerProps {\n toasts: ToastMessage[];\n onClose: (id: string) => void;\n}\n\nexport function ToastContainer({ toasts, onClose }: ToastContainerProps) {\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n setMounted(true);\n return () => setMounted(false);\n }, []);\n\n if (!mounted) return null;\n\n return createPortal(\n <div className=\"semiont-toast-container\">\n {toasts.map((toast) => (\n <Toast key={toast.id} toast={toast} onClose={onClose} />\n ))}\n </div>,\n document.body\n );\n}\n\n// Toast context and hook for global toast management\ninterface ToastContextType {\n showToast: (message: string, type?: ToastType, duration?: number) => void;\n showSuccess: (message: string, duration?: number) => void;\n showError: (message: string, duration?: number) => void;\n showWarning: (message: string, duration?: number) => void;\n showInfo: (message: string, duration?: number) => void;\n}\n\nconst ToastContext = React.createContext<ToastContextType | undefined>(undefined);\n\nexport function ToastProvider({ children }: { children: React.ReactNode }) {\n const [toasts, setToasts] = useState<ToastMessage[]>([]);\n\n const showToast = React.useCallback((message: string, type: ToastType = 'info', duration?: number) => {\n const id = Date.now().toString();\n const newToast: ToastMessage = duration !== undefined\n ? { id, message, type, duration }\n : { id, message, type };\n setToasts((prev) => [...prev, newToast]);\n }, []);\n\n const showSuccess = React.useCallback((message: string, duration?: number) => showToast(message, 'success', duration), [showToast]);\n const showError = React.useCallback((message: string, duration?: number) => showToast(message, 'error', duration), [showToast]);\n const showWarning = React.useCallback((message: string, duration?: number) => showToast(message, 'warning', duration), [showToast]);\n const showInfo = React.useCallback((message: string, duration?: number) => showToast(message, 'info', duration), [showToast]);\n\n const handleClose = React.useCallback((id: string) => {\n setToasts((prev) => prev.filter((toast) => toast.id !== id));\n }, []);\n\n const contextValue = React.useMemo(\n () => ({ showToast, showSuccess, showError, showWarning, showInfo }),\n [showToast, showSuccess, showError, showWarning, showInfo]\n );\n\n return (\n <ToastContext.Provider value={contextValue}>\n {children}\n <ToastContainer toasts={toasts} onClose={handleClose} />\n </ToastContext.Provider>\n );\n}\n\nexport function useToast() {\n const context = React.useContext(ToastContext);\n if (context === undefined) {\n throw new Error('useToast must be used within a ToastProvider');\n }\n return context;\n}","'use client';\n\nimport React, { createContext, useContext } from 'react';\nimport type { OpenResourcesManager } from '../types/OpenResourcesManager';\n\nconst OpenResourcesContext = createContext<OpenResourcesManager | undefined>(undefined);\n\n/**\n * Provider Pattern: Accepts OpenResourcesManager implementation as prop\n * and makes it available to child components via Context.\n *\n * Apps provide their own implementation (localStorage, sessionStorage, database, etc.)\n * and pass it to this provider at the root level.\n *\n * @example\n * ```tsx\n * // In app root\n * const openResourcesManager = useOpenResourcesManager(); // App's implementation\n *\n * <OpenResourcesProvider openResourcesManager={openResourcesManager}>\n * <App />\n * </OpenResourcesProvider>\n * ```\n */\nexport function OpenResourcesProvider({\n openResourcesManager,\n children\n}: {\n openResourcesManager: OpenResourcesManager;\n children: React.ReactNode;\n}) {\n return (\n <OpenResourcesContext.Provider value={openResourcesManager}>\n {children}\n </OpenResourcesContext.Provider>\n );\n}\n\n/**\n * Hook to access OpenResourcesManager from Context\n * Components use this hook to access open resources functionality\n */\nexport function useOpenResources(): OpenResourcesManager {\n const context = useContext(OpenResourcesContext);\n if (context === undefined) {\n throw new Error('useOpenResources must be used within an OpenResourcesProvider');\n }\n return context;\n}","'use client';\n\nimport { createContext, useContext, ReactNode, useState, useEffect, useMemo } from 'react';\nimport type { TranslationManager } from '../types/TranslationManager';\n\n// Static import for default English only - always needed as fallback\nimport enTranslations from '../../translations/en.json';\n\nconst TranslationContext = createContext<TranslationManager | null>(null);\n\n// Cache for dynamically loaded translations\nconst translationCache = new Map<string, any>();\n\n/**\n * Process ICU MessageFormat plural syntax\n * Supports: {count, plural, =0 {text} =1 {text} other {text}}\n */\nfunction processPluralFormat(text: string, params: Record<string, any>): string {\n // Match {paramName, plural, ...} with proper brace counting\n const pluralMatch = text.match(/\\{(\\w+),\\s*plural,\\s*/);\n if (!pluralMatch) {\n return text;\n }\n\n const paramName = pluralMatch[1];\n const count = params[paramName];\n if (count === undefined) {\n return text;\n }\n\n // Find the matching closing brace by counting\n let startPos = pluralMatch[0].length;\n let braceCount = 1; // We're inside the first {\n let endPos = startPos;\n\n for (let i = startPos; i < text.length; i++) {\n if (text[i] === '{') braceCount++;\n else if (text[i] === '}') {\n braceCount--;\n if (braceCount === 0) {\n endPos = i;\n break;\n }\n }\n }\n\n const pluralCases = text.substring(startPos, endPos);\n\n // Parse plural cases: =0 {text} =1 {text} other {text}\n const cases: Record<string, string> = {};\n const caseRegex = /(?:=(\\d+)|(\\w+))\\s*\\{([^}]+)\\}/g;\n let caseMatch;\n\n while ((caseMatch = caseRegex.exec(pluralCases)) !== null) {\n const [, exactNumber, keyword, textContent] = caseMatch;\n const key = exactNumber !== undefined ? `=${exactNumber}` : keyword;\n cases[key] = textContent;\n }\n\n // Select appropriate case\n const exactMatch = cases[`=${count}`];\n if (exactMatch !== undefined) {\n const result = exactMatch.replace(/#/g, String(count));\n return text.substring(0, pluralMatch.index!) + result + text.substring(endPos + 1);\n }\n\n const otherCase = cases['other'];\n if (otherCase !== undefined) {\n const result = otherCase.replace(/#/g, String(count));\n return text.substring(0, pluralMatch.index!) + result + text.substring(endPos + 1);\n }\n\n return text;\n}\n\n// List of available locales (can be extended without importing all files)\nexport const AVAILABLE_LOCALES = [\n 'ar', // Arabic\n 'bn', // Bengali\n 'cs', // Czech\n 'da', // Danish\n 'de', // German\n 'el', // Greek\n 'en', // English\n 'es', // Spanish\n 'fa', // Persian/Farsi\n 'fi', // Finnish\n 'fr', // French\n 'he', // Hebrew\n 'hi', // Hindi\n 'id', // Indonesian\n 'it', // Italian\n 'ja', // Japanese\n 'ko', // Korean\n 'ms', // Malay\n 'nl', // Dutch\n 'no', // Norwegian\n 'pl', // Polish\n 'pt', // Portuguese\n 'ro', // Romanian\n 'sv', // Swedish\n 'th', // Thai\n 'tr', // Turkish\n 'uk', // Ukrainian\n 'vi', // Vietnamese\n 'zh', // Chinese\n] as const;\nexport type AvailableLocale = typeof AVAILABLE_LOCALES[number];\n\n// Lazy load translations for a specific locale\nasync function loadTranslations(locale: string): Promise<any> {\n // Check cache first\n if (translationCache.has(locale)) {\n return translationCache.get(locale);\n }\n\n // English is already loaded statically\n if (locale === 'en') {\n translationCache.set('en', enTranslations);\n return enTranslations;\n }\n\n try {\n // Dynamic import for all other locales\n const translations = await import(`../../translations/${locale}.json`);\n const translationData = translations.default || translations;\n translationCache.set(locale, translationData);\n return translationData;\n } catch (error) {\n console.error(`Failed to load translations for locale: ${locale}`, error);\n // Fall back to English\n return enTranslations;\n }\n}\n\n// Default English translation manager (using static import)\nconst defaultTranslationManager: TranslationManager = {\n t: (namespace: string, key: string, params?: Record<string, any>) => {\n const translations = enTranslations as Record<string, Record<string, string>>;\n const translation = translations[namespace]?.[key];\n\n if (!translation) {\n console.warn(`Translation not found for ${namespace}.${key}`);\n return `${namespace}.${key}`;\n }\n\n // Handle parameter interpolation and plural format\n if (params && typeof translation === 'string') {\n let result = translation;\n // First process plural format\n result = processPluralFormat(result, params);\n // Then handle simple parameter interpolation\n Object.entries(params).forEach(([paramKey, paramValue]) => {\n result = result.replace(new RegExp(`\\\\{${paramKey}\\\\}`, 'g'), String(paramValue));\n });\n return result;\n }\n\n return translation;\n },\n};\n\nexport interface TranslationProviderProps {\n /**\n * Option 1: Provide a complete TranslationManager implementation\n */\n translationManager?: TranslationManager;\n\n /**\n * Option 2: Use built-in translations by specifying a locale\n * When adding new locales, just add the JSON file and update AVAILABLE_LOCALES\n */\n locale?: string;\n\n /**\n * Loading component to show while translations are being loaded\n * Only relevant when using dynamic locale loading\n */\n loadingComponent?: ReactNode;\n\n children: ReactNode;\n}\n\n/**\n * Provider for translation management with dynamic loading\n *\n * Three modes of operation:\n * 1. No provider: Components use default English strings\n * 2. With locale prop: Dynamically loads translations for that locale\n * 3. With translationManager: Use custom translation implementation\n */\nexport function TranslationProvider({\n translationManager,\n locale,\n loadingComponent = null,\n children,\n}: TranslationProviderProps) {\n const [loadedTranslations, setLoadedTranslations] = useState<any>(null);\n const [isLoading, setIsLoading] = useState(false);\n\n // Load translations when locale changes\n useEffect(() => {\n if (locale && !translationManager) {\n setIsLoading(true);\n loadTranslations(locale)\n .then(translations => {\n setLoadedTranslations(translations);\n setIsLoading(false);\n })\n .catch(error => {\n console.error('Failed to load translations:', error);\n setLoadedTranslations(enTranslations); // Fall back to English\n setIsLoading(false);\n });\n }\n }, [locale, translationManager]);\n\n // Create translation manager from loaded translations\n const localeManager = useMemo<TranslationManager | null>(() => {\n if (!loadedTranslations) return null;\n\n return {\n t: (namespace: string, key: string, params?: Record<string, any>) => {\n const translation = loadedTranslations[namespace]?.[key];\n\n if (!translation) {\n console.warn(`Translation not found for ${namespace}.${key} in locale ${locale}`);\n return `${namespace}.${key}`;\n }\n\n // Handle parameter interpolation and plural format\n if (params && typeof translation === 'string') {\n let result = translation;\n // First process plural format\n result = processPluralFormat(result, params);\n // Then handle simple parameter interpolation\n Object.entries(params).forEach(([paramKey, paramValue]) => {\n result = result.replace(new RegExp(`\\\\{${paramKey}\\\\}`, 'g'), String(paramValue));\n });\n return result;\n }\n\n return translation;\n },\n };\n }, [loadedTranslations, locale]);\n\n // If custom translation manager provided, use it\n if (translationManager) {\n return (\n <TranslationContext.Provider value={translationManager}>\n {children}\n </TranslationContext.Provider>\n );\n }\n\n // If locale provided and still loading, show loading component\n if (locale && isLoading) {\n return <>{loadingComponent}</>;\n }\n\n // If locale provided and translations loaded, use them\n if (locale && localeManager) {\n return (\n <TranslationContext.Provider value={localeManager}>\n {children}\n </TranslationContext.Provider>\n );\n }\n\n // Default: use English translations\n return (\n <TranslationContext.Provider value={defaultTranslationManager}>\n {children}\n </TranslationContext.Provider>\n );\n}\n\n/**\n * Hook to access translations within a namespace\n *\n * Works in three modes:\n * 1. Without provider: Returns default English translations\n * 2. With provider using locale: Returns dynamically loaded translations for that locale\n * 3. With custom provider: Uses the custom translation manager\n *\n * @param namespace - Translation namespace (e.g., 'Toolbar', 'ResourceViewer')\n * @returns Function to translate keys within the namespace\n */\nexport function useTranslations(namespace: string) {\n const context = useContext(TranslationContext);\n\n // If no context (no provider), use default English translations\n if (!context) {\n return (key: string, params?: Record<string, any>) => {\n const translations = enTranslations as Record<string, Record<string, string>>;\n const translation = translations[namespace]?.[key];\n\n if (!translation) {\n console.warn(`Translation not found for ${namespace}.${key}`);\n return `${namespace}.${key}`;\n }\n\n // Handle parameter interpolation and plural format\n if (params && typeof translation === 'string') {\n let result = translation;\n // First process plural format\n result = processPluralFormat(result, params);\n // Then handle simple parameter interpolation\n Object.entries(params).forEach(([paramKey, paramValue]) => {\n result = result.replace(new RegExp(`\\\\{${paramKey}\\\\}`, 'g'), String(paramValue));\n });\n return result;\n }\n\n return translation;\n };\n }\n\n // Return a function that translates keys within this namespace\n return (key: string, params?: Record<string, any>) => context.t(namespace, key, params);\n}\n\n/**\n * Hook to preload translations for a locale\n * Useful for preloading translations before navigation\n */\nexport function usePreloadTranslations() {\n return {\n preload: async (locale: string) => {\n try {\n await loadTranslations(locale);\n return true;\n } catch (error) {\n console.error(`Failed to preload translations for ${locale}:`, error);\n return false;\n }\n },\n isLoaded: (locale: string) => translationCache.has(locale),\n };\n}"],"mappings":";;;;;;;;;AAEA,SAAS,eAAe,YAAuB,eAAe;AAC9D,SAAS,kBAAkB,eAAe;AA6BtC;AA3BJ,IAAM,mBAAmB,cAA4C,MAAS;AAYvE,SAAS,kBAAkB;AAAA,EAChC,SAAS;AAAA,EACT;AACF,GAA2B;AAEzB,QAAM,SAAS;AAAA,IACb,MAAM,IAAI,iBAAiB;AAAA,MACzB,SAAS,QAAQ,GAAG;AAAA;AAAA,MAEpB,GAAI,QAAQ,IAAI,aAAa,UAAU,EAAE,SAAS,IAAM;AAAA,IAC1D,CAAC;AAAA,IACD,CAA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iB,IAAI,MAAM;AAAA,EAC3D;AACF;","names":["createContext","useContext","useMemo","jsx","createContext","useContext","jsx","jsx","createContext","useContext","jsx","createContext","useContext","useState","useEffect","useMemo","jsx","createContext","useState","useEffect","useMemo","jsx","useContext"]}
@@ -96,7 +96,8 @@ var CommentsPanel = {
96
96
  densitySparse: "Sparse",
97
97
  densityDense: "Dense",
98
98
  fragmentSelected: "Fragment selected",
99
- imageRegionSelected: "Image region selected"
99
+ imageRegionSelected: "Image region selected",
100
+ closeProgress: "Close"
100
101
  };
101
102
  var HighlightPanel = {
102
103
  title: "Highlights",
@@ -110,7 +111,8 @@ var HighlightPanel = {
110
111
  cancel: "Cancel",
111
112
  densityLabel: "Density",
112
113
  densitySparse: "Sparse",
113
- densityDense: "Dense"
114
+ densityDense: "Dense",
115
+ closeProgress: "Close"
114
116
  };
115
117
  var AssessmentPanel = {
116
118
  title: "Assessments",
@@ -134,7 +136,8 @@ var AssessmentPanel = {
134
136
  densitySparse: "Sparse",
135
137
  densityDense: "Dense",
136
138
  fragmentSelected: "Fragment selected",
137
- imageRegionSelected: "Image region selected"
139
+ imageRegionSelected: "Image region selected",
140
+ closeProgress: "Close"
138
141
  };
139
142
  var TaggingPanel = {
140
143
  title: "Tags",
@@ -374,4 +377,4 @@ export {
374
377
  UnifiedAnnotationsPanel,
375
378
  cs_default as default
376
379
  };
377
- //# sourceMappingURL=cs-FAN66Q2F.mjs.map
380
+ //# sourceMappingURL=cs-7W4WF5WD.mjs.map