@semiont/react-ui 0.5.9 → 0.5.11

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 (209) hide show
  1. package/README.md +1 -1
  2. package/dist/{PdfAnnotationCanvas.client-U4EVBZEV.js → PdfAnnotationCanvas.client-KWQ7XDWT.js} +5 -2
  3. package/dist/PdfAnnotationCanvas.client-KWQ7XDWT.js.map +1 -0
  4. package/dist/{ar-WA47UUWA.js → ar-ZHKO4XDR.js} +45 -4
  5. package/dist/ar-ZHKO4XDR.js.map +1 -0
  6. package/dist/{bn-5ANDRIU6.js → bn-3BUDKAK5.js} +45 -4
  7. package/dist/bn-3BUDKAK5.js.map +1 -0
  8. package/dist/{chunk-YBGN4ACY.js → chunk-O23TLLXW.js} +1 -6
  9. package/dist/{chunk-WHUGODTB.js → chunk-PFUXQPWJ.js} +127 -127
  10. package/dist/{chunk-WHUGODTB.js.map → chunk-PFUXQPWJ.js.map} +1 -1
  11. package/dist/{chunk-GERSK2DY.js → chunk-R52YAGHK.js} +42 -1
  12. package/dist/chunk-R52YAGHK.js.map +1 -0
  13. package/dist/{cs-3RU7F4JX.js → cs-2EFEUKTW.js} +45 -4
  14. package/dist/cs-2EFEUKTW.js.map +1 -0
  15. package/dist/{da-GSW5P5HG.js → da-SUD3Q44Q.js} +45 -4
  16. package/dist/da-SUD3Q44Q.js.map +1 -0
  17. package/dist/{de-JUAUYF4Z.js → de-6IC5QRX7.js} +45 -4
  18. package/dist/de-6IC5QRX7.js.map +1 -0
  19. package/dist/{el-JNLWCKEC.js → el-Q4NAXFRC.js} +45 -4
  20. package/dist/el-Q4NAXFRC.js.map +1 -0
  21. package/dist/{en-RBN2GUHF.js → en-P2L4X27N.js} +5 -3
  22. package/dist/{es-WPOX225H.js → es-YUKZBD4W.js} +45 -4
  23. package/dist/es-YUKZBD4W.js.map +1 -0
  24. package/dist/{fa-TAEP6N77.js → fa-OJ47LILE.js} +45 -4
  25. package/dist/fa-OJ47LILE.js.map +1 -0
  26. package/dist/{fi-ZVZHANSP.js → fi-QFFL5CUB.js} +45 -4
  27. package/dist/fi-QFFL5CUB.js.map +1 -0
  28. package/dist/{fr-VLZW7M4N.js → fr-BOQZZWP4.js} +45 -4
  29. package/dist/fr-BOQZZWP4.js.map +1 -0
  30. package/dist/{he-QFAFYA77.js → he-LXDY3TFA.js} +45 -4
  31. package/dist/he-LXDY3TFA.js.map +1 -0
  32. package/dist/{hi-AO3DQPCV.js → hi-HOJER77V.js} +45 -4
  33. package/dist/hi-HOJER77V.js.map +1 -0
  34. package/dist/{id-GTXF42WM.js → id-I5WQ6EWD.js} +45 -4
  35. package/dist/id-I5WQ6EWD.js.map +1 -0
  36. package/dist/index.css +150 -112
  37. package/dist/index.css.map +1 -1
  38. package/dist/index.d.ts +403 -45
  39. package/dist/index.js +4660 -18860
  40. package/dist/index.js.map +1 -1
  41. package/dist/integrations/css-modules-helper.js +1 -1
  42. package/dist/integrations/styled-components-theme.js +1 -1
  43. package/dist/{it-AS5GM232.js → it-UYH642IJ.js} +45 -4
  44. package/dist/it-UYH642IJ.js.map +1 -0
  45. package/dist/{ja-GZ4HLUOF.js → ja-JTVWAC4L.js} +45 -4
  46. package/dist/ja-JTVWAC4L.js.map +1 -0
  47. package/dist/{ko-A4XUXFGJ.js → ko-IHXFMOIZ.js} +45 -4
  48. package/dist/ko-IHXFMOIZ.js.map +1 -0
  49. package/dist/{ms-YBAO3S6K.js → ms-JH25VFLO.js} +45 -4
  50. package/dist/ms-JH25VFLO.js.map +1 -0
  51. package/dist/{nl-3TJGIIIU.js → nl-SURXW7IQ.js} +45 -4
  52. package/dist/nl-SURXW7IQ.js.map +1 -0
  53. package/dist/{no-4AXIQPRQ.js → no-HXIKQFDZ.js} +45 -4
  54. package/dist/no-HXIKQFDZ.js.map +1 -0
  55. package/dist/{pl-5GP6GKXO.js → pl-7A4KU6XK.js} +45 -4
  56. package/dist/pl-7A4KU6XK.js.map +1 -0
  57. package/dist/{pt-26Y6JFG5.js → pt-6MGYP7Q5.js} +45 -4
  58. package/dist/pt-6MGYP7Q5.js.map +1 -0
  59. package/dist/{ro-C7UXFRWJ.js → ro-IROCHNIA.js} +45 -4
  60. package/dist/ro-IROCHNIA.js.map +1 -0
  61. package/dist/{sv-44DVD76T.js → sv-WDJD75CV.js} +45 -4
  62. package/dist/sv-WDJD75CV.js.map +1 -0
  63. package/dist/test-utils.js +9 -4
  64. package/dist/test-utils.js.map +1 -1
  65. package/dist/{th-GIQRTBOY.js → th-RIO2E6B3.js} +45 -4
  66. package/dist/th-RIO2E6B3.js.map +1 -0
  67. package/dist/{tr-WMQWO4D6.js → tr-TZ7ERCIN.js} +45 -4
  68. package/dist/tr-TZ7ERCIN.js.map +1 -0
  69. package/dist/{uk-I7ML6RGG.js → uk-ZFWDKLUE.js} +45 -4
  70. package/dist/uk-ZFWDKLUE.js.map +1 -0
  71. package/dist/{vi-FGWECASQ.js → vi-UIOSP2JG.js} +45 -4
  72. package/dist/vi-UIOSP2JG.js.map +1 -0
  73. package/dist/{zh-L5FN73XC.js → zh-6R6YUY46.js} +45 -4
  74. package/dist/zh-6R6YUY46.js.map +1 -0
  75. package/package.json +18 -9
  76. package/src/components/AnnotateReferencesProgressWidget.tsx +35 -16
  77. package/src/components/ResourceTagsInline.tsx +94 -11
  78. package/src/components/StatusDisplay.css +36 -0
  79. package/src/components/__tests__/AnnotateReferencesProgressWidget.test.tsx +41 -91
  80. package/src/components/__tests__/ResourceTagsInline.test.tsx +101 -3
  81. package/src/components/annotation/AnnotateToolbar.tsx +53 -28
  82. package/src/components/annotation/__tests__/AnnotateToolbar.display.test.tsx +76 -0
  83. package/src/components/annotation/__tests__/AnnotateToolbar.test.tsx +124 -360
  84. package/src/components/image-annotation/SvgDrawingCanvas.tsx +5 -1
  85. package/src/components/modals/ConfigureGatherStep.tsx +102 -0
  86. package/src/components/modals/ContextSummary.tsx +15 -6
  87. package/src/components/modals/GatherContextStep.tsx +104 -59
  88. package/src/components/modals/ResourceGenerateModal.tsx +258 -0
  89. package/src/components/modals/__tests__/ConfigureGatherStep.test.tsx +82 -0
  90. package/src/components/modals/__tests__/GatherContextStep.resource.test.tsx +107 -0
  91. package/src/components/modals/__tests__/ResourceGenerateModal.test.tsx +197 -0
  92. package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +5 -0
  93. package/src/components/pdf-annotation/__tests__/PdfAnnotationCanvas.test.tsx +6 -6
  94. package/src/components/resource/AnnotateView.tsx +59 -38
  95. package/src/components/resource/BrowseView.tsx +159 -133
  96. package/src/components/resource/ResourceViewer.tsx +119 -128
  97. package/src/components/resource/__tests__/AnnotateView.embeddable.test.tsx +55 -0
  98. package/src/components/resource/__tests__/BrowseView.embeddable.test.tsx +49 -0
  99. package/src/components/resource/__tests__/BrowseView.links.test.tsx +60 -0
  100. package/src/components/resource/__tests__/BrowseView.overlay-async.test.tsx +113 -0
  101. package/src/components/resource/__tests__/BrowseView.reference-hover.test.tsx +161 -0
  102. package/src/components/resource/__tests__/BrowseView.registry.test.tsx +43 -0
  103. package/src/components/resource/__tests__/BrowseView.test.tsx +35 -22
  104. package/src/components/resource/__tests__/ResourceViewer.embeddable.test.tsx +63 -0
  105. package/src/components/resource/__tests__/ResourceViewer.mode-switch.test.tsx +12 -7
  106. package/src/components/resource/__tests__/ResourceViewer.toolbar-opt-out.test.tsx +135 -0
  107. package/src/components/resource/__tests__/ResourceViewer.toolbar-prefs.test.tsx +200 -0
  108. package/src/components/resource/__tests__/browse-renderers.test.tsx +34 -0
  109. package/src/components/resource/__tests__/inline-embedding.test.tsx +81 -0
  110. package/src/components/resource/__tests__/media-completeness.test.tsx +88 -0
  111. package/src/components/resource/browse-renderers.tsx +63 -0
  112. package/src/components/resource/panels/AssessmentPanel.tsx +4 -0
  113. package/src/components/resource/panels/CommentsPanel.tsx +4 -0
  114. package/src/components/resource/panels/HighlightPanel.tsx +4 -0
  115. package/src/components/resource/panels/ReferencesPanel.tsx +14 -0
  116. package/src/components/resource/panels/ResourceInfoPanel.tsx +22 -0
  117. package/src/components/resource/panels/TaggingPanel.tsx +4 -0
  118. package/src/components/resource/panels/UnifiedAnnotationsPanel.tsx +5 -2
  119. package/src/components/resource/panels/__tests__/AssessmentPanel.test.tsx +1 -0
  120. package/src/components/resource/panels/__tests__/CommentsPanel.test.tsx +1 -0
  121. package/src/components/resource/panels/__tests__/HighlightPanel.annotationProgress.test.tsx +16 -16
  122. package/src/components/resource/panels/__tests__/ReferencesPanel.observable-flow.test.tsx +1 -1
  123. package/src/components/resource/panels/__tests__/ReferencesPanel.test.tsx +1 -0
  124. package/src/components/resource/panels/__tests__/ResourceInfoPanel.test.tsx +26 -0
  125. package/src/components/resource/panels/__tests__/TaggingPanel.test.tsx +1 -0
  126. package/src/components/toolbar/Toolbar.css +14 -0
  127. package/src/features/admin-exchange/state/__tests__/exchange-state-unit.test.ts +14 -0
  128. package/src/features/admin-exchange/state/exchange-state-unit.ts +4 -2
  129. package/src/features/admin-security/state/__tests__/admin-security-state-unit.test.ts +14 -0
  130. package/src/features/admin-security/state/admin-security-state-unit.ts +4 -2
  131. package/src/features/admin-users/state/__tests__/admin-users-state-unit.test.ts +12 -5
  132. package/src/features/admin-users/state/admin-users-state-unit.ts +4 -2
  133. package/src/features/auth-welcome/state/__tests__/welcome-state-unit.test.ts +11 -0
  134. package/src/features/auth-welcome/state/welcome-state-unit.ts +1 -1
  135. package/src/features/moderate-entity-tags/state/__tests__/entity-tags-state-unit.test.ts +14 -0
  136. package/src/features/moderate-entity-tags/state/entity-tags-state-unit.ts +4 -2
  137. package/src/features/resource-compose/components/ResourceComposePage.tsx +13 -7
  138. package/src/features/resource-compose/state/__tests__/compose-page-state-unit.test.ts +13 -0
  139. package/src/features/resource-compose/state/compose-page-state-unit.ts +5 -2
  140. package/src/features/resource-discovery/state/__tests__/discover-state-unit.test.ts +15 -9
  141. package/src/features/resource-discovery/state/discover-state-unit.ts +5 -2
  142. package/src/features/resource-viewer/__tests__/ResourceViewerPage.test.tsx +7 -17
  143. package/src/features/resource-viewer/components/ResourceViewerPage.tsx +119 -17
  144. package/src/features/resource-viewer/state/__tests__/resource-loader-state-unit.test.ts +11 -0
  145. package/src/features/resource-viewer/state/__tests__/resource-viewer-page-state-unit.test.ts +30 -0
  146. package/src/features/resource-viewer/state/resource-loader-state-unit.ts +1 -1
  147. package/src/features/resource-viewer/state/resource-viewer-page-state-unit.ts +7 -16
  148. package/src/styles/features/resource-viewer.css +19 -0
  149. package/translations/ar.json +41 -2
  150. package/translations/bn.json +41 -2
  151. package/translations/cs.json +41 -2
  152. package/translations/da.json +41 -2
  153. package/translations/de.json +41 -2
  154. package/translations/el.json +41 -2
  155. package/translations/en.json +39 -0
  156. package/translations/es.json +41 -2
  157. package/translations/fa.json +41 -2
  158. package/translations/fi.json +41 -2
  159. package/translations/fr.json +41 -2
  160. package/translations/he.json +41 -2
  161. package/translations/hi.json +41 -2
  162. package/translations/id.json +41 -2
  163. package/translations/it.json +41 -2
  164. package/translations/ja.json +41 -2
  165. package/translations/ko.json +41 -2
  166. package/translations/ms.json +41 -2
  167. package/translations/nl.json +41 -2
  168. package/translations/no.json +41 -2
  169. package/translations/pl.json +41 -2
  170. package/translations/pt.json +41 -2
  171. package/translations/ro.json +41 -2
  172. package/translations/sv.json +41 -2
  173. package/translations/th.json +41 -2
  174. package/translations/tr.json +41 -2
  175. package/translations/uk.json +41 -2
  176. package/translations/vi.json +41 -2
  177. package/translations/zh.json +41 -2
  178. package/dist/PdfAnnotationCanvas.client-U4EVBZEV.js.map +0 -1
  179. package/dist/ar-WA47UUWA.js.map +0 -1
  180. package/dist/bn-5ANDRIU6.js.map +0 -1
  181. package/dist/chunk-GERSK2DY.js.map +0 -1
  182. package/dist/cs-3RU7F4JX.js.map +0 -1
  183. package/dist/da-GSW5P5HG.js.map +0 -1
  184. package/dist/de-JUAUYF4Z.js.map +0 -1
  185. package/dist/el-JNLWCKEC.js.map +0 -1
  186. package/dist/es-WPOX225H.js.map +0 -1
  187. package/dist/fa-TAEP6N77.js.map +0 -1
  188. package/dist/fi-ZVZHANSP.js.map +0 -1
  189. package/dist/fr-VLZW7M4N.js.map +0 -1
  190. package/dist/he-QFAFYA77.js.map +0 -1
  191. package/dist/hi-AO3DQPCV.js.map +0 -1
  192. package/dist/id-GTXF42WM.js.map +0 -1
  193. package/dist/it-AS5GM232.js.map +0 -1
  194. package/dist/ja-GZ4HLUOF.js.map +0 -1
  195. package/dist/ko-A4XUXFGJ.js.map +0 -1
  196. package/dist/ms-YBAO3S6K.js.map +0 -1
  197. package/dist/nl-3TJGIIIU.js.map +0 -1
  198. package/dist/no-4AXIQPRQ.js.map +0 -1
  199. package/dist/pl-5GP6GKXO.js.map +0 -1
  200. package/dist/pt-26Y6JFG5.js.map +0 -1
  201. package/dist/ro-C7UXFRWJ.js.map +0 -1
  202. package/dist/sv-44DVD76T.js.map +0 -1
  203. package/dist/th-GIQRTBOY.js.map +0 -1
  204. package/dist/tr-WMQWO4D6.js.map +0 -1
  205. package/dist/uk-I7ML6RGG.js.map +0 -1
  206. package/dist/vi-FGWECASQ.js.map +0 -1
  207. package/dist/zh-L5FN73XC.js.map +0 -1
  208. /package/dist/{chunk-YBGN4ACY.js.map → chunk-O23TLLXW.js.map} +0 -0
  209. /package/dist/{en-RBN2GUHF.js.map → en-P2L4X27N.js.map} +0 -0
@@ -1,11 +1,11 @@
1
1
  'use client';
2
2
  import {
3
3
  en_default
4
- } from "./chunk-GERSK2DY.js";
4
+ } from "./chunk-R52YAGHK.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __glob
8
- } from "./chunk-YBGN4ACY.js";
8
+ } from "./chunk-O23TLLXW.js";
9
9
 
10
10
  // ../../node_modules/rxjs/dist/cjs/internal/util/isFunction.js
11
11
  var require_isFunction = __commonJS({
@@ -9460,124 +9460,41 @@ function useSemiont() {
9460
9460
  return ctx;
9461
9461
  }
9462
9462
 
9463
- // src/components/Toast.tsx
9464
- import React, { useEffect, useState } from "react";
9465
- import { createPortal } from "react-dom";
9466
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
9467
- var icons = {
9468
- success: /* @__PURE__ */ jsx2("svg", { className: "semiont-toast-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx2("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }),
9469
- error: /* @__PURE__ */ jsx2("svg", { className: "semiont-toast-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx2("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }),
9470
- warning: /* @__PURE__ */ jsx2("svg", { className: "semiont-toast-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx2("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" }) }),
9471
- info: /* @__PURE__ */ jsx2("svg", { className: "semiont-toast-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx2("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" }) })
9472
- };
9473
- function Toast({ toast, onClose }) {
9474
- useEffect(() => {
9475
- const timer = setTimeout(() => {
9476
- onClose(toast.id);
9477
- }, toast.duration || 3e3);
9478
- return () => clearTimeout(timer);
9479
- }, [toast, onClose]);
9480
- return /* @__PURE__ */ jsxs(
9481
- "div",
9482
- {
9483
- className: "semiont-toast",
9484
- "data-variant": toast.type,
9485
- role: "alert",
9486
- children: [
9487
- /* @__PURE__ */ jsx2("div", { className: "semiont-toast-icon-wrapper", children: icons[toast.type] }),
9488
- /* @__PURE__ */ jsx2("p", { className: "semiont-toast-message", children: toast.message }),
9489
- /* @__PURE__ */ jsx2(
9490
- "button",
9491
- {
9492
- onClick: () => onClose(toast.id),
9493
- className: "semiont-toast-close",
9494
- "aria-label": "Close",
9495
- children: /* @__PURE__ */ jsx2("svg", { className: "semiont-toast-close-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx2("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
9496
- }
9497
- )
9498
- ]
9499
- }
9500
- );
9501
- }
9502
- function ToastContainer({ toasts, onClose }) {
9503
- const [mounted, setMounted] = useState(false);
9504
- useEffect(() => {
9505
- setMounted(true);
9506
- return () => setMounted(false);
9507
- }, []);
9508
- if (!mounted) return null;
9509
- return createPortal(
9510
- /* @__PURE__ */ jsx2("div", { className: "semiont-toast-container", children: toasts.map((toast) => /* @__PURE__ */ jsx2(Toast, { toast, onClose }, toast.id)) }),
9511
- document.body
9512
- );
9513
- }
9514
- var ToastContext = React.createContext(void 0);
9515
- function ToastProvider({ children }) {
9516
- const [toasts, setToasts] = useState([]);
9517
- const showToast = React.useCallback((message, type = "info", duration) => {
9518
- const id = Date.now().toString();
9519
- const newToast = duration !== void 0 ? { id, message, type, duration } : { id, message, type };
9520
- setToasts((prev) => [...prev, newToast]);
9521
- }, []);
9522
- const showSuccess = React.useCallback((message, duration) => showToast(message, "success", duration), [showToast]);
9523
- const showError = React.useCallback((message, duration) => showToast(message, "error", duration), [showToast]);
9524
- const showWarning = React.useCallback((message, duration) => showToast(message, "warning", duration), [showToast]);
9525
- const showInfo = React.useCallback((message, duration) => showToast(message, "info", duration), [showToast]);
9526
- const handleClose = React.useCallback((id) => {
9527
- setToasts((prev) => prev.filter((toast) => toast.id !== id));
9528
- }, []);
9529
- const contextValue = React.useMemo(
9530
- () => ({ showToast, showSuccess, showError, showWarning, showInfo }),
9531
- [showToast, showSuccess, showError, showWarning, showInfo]
9532
- );
9533
- return /* @__PURE__ */ jsxs(ToastContext.Provider, { value: contextValue, children: [
9534
- children,
9535
- /* @__PURE__ */ jsx2(ToastContainer, { toasts, onClose: handleClose })
9536
- ] });
9537
- }
9538
- function useToast() {
9539
- const context = React.useContext(ToastContext);
9540
- if (context === void 0) {
9541
- throw new Error("useToast must be used within a ToastProvider");
9542
- }
9543
- return context;
9544
- }
9545
-
9546
9463
  // src/contexts/TranslationContext.tsx
9547
- import { createContext as createContext2, useContext as useContext2, useState as useState2, useEffect as useEffect2, useMemo as useMemo2 } from "react";
9548
- import { Fragment, jsx as jsx3 } from "react/jsx-runtime";
9464
+ import { createContext as createContext2, useContext as useContext2, useState, useEffect, useMemo as useMemo2 } from "react";
9465
+ import { Fragment, jsx as jsx2 } from "react/jsx-runtime";
9549
9466
 
9550
9467
  // import("../../translations/**/*.json") in src/contexts/TranslationContext.tsx
9551
9468
  var globImport_translations_json = __glob({
9552
- "../../translations/ar.json": () => import("./ar-WA47UUWA.js"),
9553
- "../../translations/bn.json": () => import("./bn-5ANDRIU6.js"),
9554
- "../../translations/cs.json": () => import("./cs-3RU7F4JX.js"),
9555
- "../../translations/da.json": () => import("./da-GSW5P5HG.js"),
9556
- "../../translations/de.json": () => import("./de-JUAUYF4Z.js"),
9557
- "../../translations/el.json": () => import("./el-JNLWCKEC.js"),
9558
- "../../translations/en.json": () => import("./en-RBN2GUHF.js"),
9559
- "../../translations/es.json": () => import("./es-WPOX225H.js"),
9560
- "../../translations/fa.json": () => import("./fa-TAEP6N77.js"),
9561
- "../../translations/fi.json": () => import("./fi-ZVZHANSP.js"),
9562
- "../../translations/fr.json": () => import("./fr-VLZW7M4N.js"),
9563
- "../../translations/he.json": () => import("./he-QFAFYA77.js"),
9564
- "../../translations/hi.json": () => import("./hi-AO3DQPCV.js"),
9565
- "../../translations/id.json": () => import("./id-GTXF42WM.js"),
9566
- "../../translations/it.json": () => import("./it-AS5GM232.js"),
9567
- "../../translations/ja.json": () => import("./ja-GZ4HLUOF.js"),
9568
- "../../translations/ko.json": () => import("./ko-A4XUXFGJ.js"),
9569
- "../../translations/ms.json": () => import("./ms-YBAO3S6K.js"),
9570
- "../../translations/nl.json": () => import("./nl-3TJGIIIU.js"),
9571
- "../../translations/no.json": () => import("./no-4AXIQPRQ.js"),
9572
- "../../translations/pl.json": () => import("./pl-5GP6GKXO.js"),
9573
- "../../translations/pt.json": () => import("./pt-26Y6JFG5.js"),
9574
- "../../translations/ro.json": () => import("./ro-C7UXFRWJ.js"),
9575
- "../../translations/sv.json": () => import("./sv-44DVD76T.js"),
9576
- "../../translations/th.json": () => import("./th-GIQRTBOY.js"),
9577
- "../../translations/tr.json": () => import("./tr-WMQWO4D6.js"),
9578
- "../../translations/uk.json": () => import("./uk-I7ML6RGG.js"),
9579
- "../../translations/vi.json": () => import("./vi-FGWECASQ.js"),
9580
- "../../translations/zh.json": () => import("./zh-L5FN73XC.js")
9469
+ "../../translations/ar.json": () => import("./ar-ZHKO4XDR.js"),
9470
+ "../../translations/bn.json": () => import("./bn-3BUDKAK5.js"),
9471
+ "../../translations/cs.json": () => import("./cs-2EFEUKTW.js"),
9472
+ "../../translations/da.json": () => import("./da-SUD3Q44Q.js"),
9473
+ "../../translations/de.json": () => import("./de-6IC5QRX7.js"),
9474
+ "../../translations/el.json": () => import("./el-Q4NAXFRC.js"),
9475
+ "../../translations/en.json": () => import("./en-P2L4X27N.js"),
9476
+ "../../translations/es.json": () => import("./es-YUKZBD4W.js"),
9477
+ "../../translations/fa.json": () => import("./fa-OJ47LILE.js"),
9478
+ "../../translations/fi.json": () => import("./fi-QFFL5CUB.js"),
9479
+ "../../translations/fr.json": () => import("./fr-BOQZZWP4.js"),
9480
+ "../../translations/he.json": () => import("./he-LXDY3TFA.js"),
9481
+ "../../translations/hi.json": () => import("./hi-HOJER77V.js"),
9482
+ "../../translations/id.json": () => import("./id-I5WQ6EWD.js"),
9483
+ "../../translations/it.json": () => import("./it-UYH642IJ.js"),
9484
+ "../../translations/ja.json": () => import("./ja-JTVWAC4L.js"),
9485
+ "../../translations/ko.json": () => import("./ko-IHXFMOIZ.js"),
9486
+ "../../translations/ms.json": () => import("./ms-JH25VFLO.js"),
9487
+ "../../translations/nl.json": () => import("./nl-SURXW7IQ.js"),
9488
+ "../../translations/no.json": () => import("./no-HXIKQFDZ.js"),
9489
+ "../../translations/pl.json": () => import("./pl-7A4KU6XK.js"),
9490
+ "../../translations/pt.json": () => import("./pt-6MGYP7Q5.js"),
9491
+ "../../translations/ro.json": () => import("./ro-IROCHNIA.js"),
9492
+ "../../translations/sv.json": () => import("./sv-WDJD75CV.js"),
9493
+ "../../translations/th.json": () => import("./th-RIO2E6B3.js"),
9494
+ "../../translations/tr.json": () => import("./tr-TZ7ERCIN.js"),
9495
+ "../../translations/uk.json": () => import("./uk-ZFWDKLUE.js"),
9496
+ "../../translations/vi.json": () => import("./vi-UIOSP2JG.js"),
9497
+ "../../translations/zh.json": () => import("./zh-6R6YUY46.js")
9581
9498
  });
9582
9499
 
9583
9500
  // src/contexts/TranslationContext.tsx
@@ -9730,9 +9647,9 @@ function TranslationProvider({
9730
9647
  loadingComponent = null,
9731
9648
  children
9732
9649
  }) {
9733
- const [loadedTranslations, setLoadedTranslations] = useState2(null);
9734
- const [isLoading, setIsLoading] = useState2(false);
9735
- useEffect2(() => {
9650
+ const [loadedTranslations, setLoadedTranslations] = useState(null);
9651
+ const [isLoading, setIsLoading] = useState(false);
9652
+ useEffect(() => {
9736
9653
  if (locale && !translationManager) {
9737
9654
  setIsLoading(true);
9738
9655
  loadTranslations(locale).then((translations) => {
@@ -9767,15 +9684,15 @@ function TranslationProvider({
9767
9684
  };
9768
9685
  }, [loadedTranslations, locale]);
9769
9686
  if (translationManager) {
9770
- return /* @__PURE__ */ jsx3(TranslationContext.Provider, { value: translationManager, children });
9687
+ return /* @__PURE__ */ jsx2(TranslationContext.Provider, { value: translationManager, children });
9771
9688
  }
9772
9689
  if (locale && isLoading) {
9773
- return /* @__PURE__ */ jsx3(Fragment, { children: loadingComponent });
9690
+ return /* @__PURE__ */ jsx2(Fragment, { children: loadingComponent });
9774
9691
  }
9775
9692
  if (locale && localeManager) {
9776
- return /* @__PURE__ */ jsx3(TranslationContext.Provider, { value: localeManager, children });
9693
+ return /* @__PURE__ */ jsx2(TranslationContext.Provider, { value: localeManager, children });
9777
9694
  }
9778
- return /* @__PURE__ */ jsx3(TranslationContext.Provider, { value: defaultTranslationManager, children });
9695
+ return /* @__PURE__ */ jsx2(TranslationContext.Provider, { value: defaultTranslationManager, children });
9779
9696
  }
9780
9697
  function useTranslations(namespace) {
9781
9698
  const context = useContext2(TranslationContext);
@@ -9815,17 +9732,100 @@ function usePreloadTranslations() {
9815
9732
  };
9816
9733
  }
9817
9734
 
9735
+ // src/components/Toast.tsx
9736
+ import React, { useEffect as useEffect2, useState as useState2 } from "react";
9737
+ import { createPortal } from "react-dom";
9738
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
9739
+ var icons = {
9740
+ success: /* @__PURE__ */ jsx3("svg", { className: "semiont-toast-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx3("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }),
9741
+ error: /* @__PURE__ */ jsx3("svg", { className: "semiont-toast-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx3("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }),
9742
+ warning: /* @__PURE__ */ jsx3("svg", { className: "semiont-toast-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx3("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" }) }),
9743
+ info: /* @__PURE__ */ jsx3("svg", { className: "semiont-toast-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx3("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" }) })
9744
+ };
9745
+ function Toast({ toast, onClose }) {
9746
+ useEffect2(() => {
9747
+ const timer = setTimeout(() => {
9748
+ onClose(toast.id);
9749
+ }, toast.duration || 3e3);
9750
+ return () => clearTimeout(timer);
9751
+ }, [toast, onClose]);
9752
+ return /* @__PURE__ */ jsxs(
9753
+ "div",
9754
+ {
9755
+ className: "semiont-toast",
9756
+ "data-variant": toast.type,
9757
+ role: "alert",
9758
+ children: [
9759
+ /* @__PURE__ */ jsx3("div", { className: "semiont-toast-icon-wrapper", children: icons[toast.type] }),
9760
+ /* @__PURE__ */ jsx3("p", { className: "semiont-toast-message", children: toast.message }),
9761
+ /* @__PURE__ */ jsx3(
9762
+ "button",
9763
+ {
9764
+ onClick: () => onClose(toast.id),
9765
+ className: "semiont-toast-close",
9766
+ "aria-label": "Close",
9767
+ children: /* @__PURE__ */ jsx3("svg", { className: "semiont-toast-close-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx3("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
9768
+ }
9769
+ )
9770
+ ]
9771
+ }
9772
+ );
9773
+ }
9774
+ function ToastContainer({ toasts, onClose }) {
9775
+ const [mounted, setMounted] = useState2(false);
9776
+ useEffect2(() => {
9777
+ setMounted(true);
9778
+ return () => setMounted(false);
9779
+ }, []);
9780
+ if (!mounted) return null;
9781
+ return createPortal(
9782
+ /* @__PURE__ */ jsx3("div", { className: "semiont-toast-container", children: toasts.map((toast) => /* @__PURE__ */ jsx3(Toast, { toast, onClose }, toast.id)) }),
9783
+ document.body
9784
+ );
9785
+ }
9786
+ var ToastContext = React.createContext(void 0);
9787
+ function ToastProvider({ children }) {
9788
+ const [toasts, setToasts] = useState2([]);
9789
+ const showToast = React.useCallback((message, type = "info", duration) => {
9790
+ const id = Date.now().toString();
9791
+ const newToast = duration !== void 0 ? { id, message, type, duration } : { id, message, type };
9792
+ setToasts((prev) => [...prev, newToast]);
9793
+ }, []);
9794
+ const showSuccess = React.useCallback((message, duration) => showToast(message, "success", duration), [showToast]);
9795
+ const showError = React.useCallback((message, duration) => showToast(message, "error", duration), [showToast]);
9796
+ const showWarning = React.useCallback((message, duration) => showToast(message, "warning", duration), [showToast]);
9797
+ const showInfo = React.useCallback((message, duration) => showToast(message, "info", duration), [showToast]);
9798
+ const handleClose = React.useCallback((id) => {
9799
+ setToasts((prev) => prev.filter((toast) => toast.id !== id));
9800
+ }, []);
9801
+ const contextValue = React.useMemo(
9802
+ () => ({ showToast, showSuccess, showError, showWarning, showInfo }),
9803
+ [showToast, showSuccess, showError, showWarning, showInfo]
9804
+ );
9805
+ return /* @__PURE__ */ jsxs(ToastContext.Provider, { value: contextValue, children: [
9806
+ children,
9807
+ /* @__PURE__ */ jsx3(ToastContainer, { toasts, onClose: handleClose })
9808
+ ] });
9809
+ }
9810
+ function useToast() {
9811
+ const context = React.useContext(ToastContext);
9812
+ if (context === void 0) {
9813
+ throw new Error("useToast must be used within a ToastProvider");
9814
+ }
9815
+ return context;
9816
+ }
9817
+
9818
9818
  export {
9819
9819
  WebBrowserStorage,
9820
9820
  SemiontProvider,
9821
9821
  useSemiont,
9822
- ToastContainer,
9823
- ToastProvider,
9824
- useToast,
9825
9822
  AVAILABLE_LOCALES,
9826
9823
  TranslationProvider,
9827
9824
  useTranslations,
9828
9825
  usePreloadTranslations,
9826
+ ToastContainer,
9827
+ ToastProvider,
9828
+ useToast,
9829
9829
  require_audit,
9830
9830
  require_auditTime,
9831
9831
  require_buffer,
@@ -9941,4 +9941,4 @@ export {
9941
9941
  require_zipWith,
9942
9942
  require_cjs
9943
9943
  };
9944
- //# sourceMappingURL=chunk-WHUGODTB.js.map
9944
+ //# sourceMappingURL=chunk-PFUXQPWJ.js.map