@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.
- package/README.md +1 -1
- package/dist/{PdfAnnotationCanvas.client-U4EVBZEV.js → PdfAnnotationCanvas.client-KWQ7XDWT.js} +5 -2
- package/dist/PdfAnnotationCanvas.client-KWQ7XDWT.js.map +1 -0
- package/dist/{ar-WA47UUWA.js → ar-ZHKO4XDR.js} +45 -4
- package/dist/ar-ZHKO4XDR.js.map +1 -0
- package/dist/{bn-5ANDRIU6.js → bn-3BUDKAK5.js} +45 -4
- package/dist/bn-3BUDKAK5.js.map +1 -0
- package/dist/{chunk-YBGN4ACY.js → chunk-O23TLLXW.js} +1 -6
- package/dist/{chunk-WHUGODTB.js → chunk-PFUXQPWJ.js} +127 -127
- package/dist/{chunk-WHUGODTB.js.map → chunk-PFUXQPWJ.js.map} +1 -1
- package/dist/{chunk-GERSK2DY.js → chunk-R52YAGHK.js} +42 -1
- package/dist/chunk-R52YAGHK.js.map +1 -0
- package/dist/{cs-3RU7F4JX.js → cs-2EFEUKTW.js} +45 -4
- package/dist/cs-2EFEUKTW.js.map +1 -0
- package/dist/{da-GSW5P5HG.js → da-SUD3Q44Q.js} +45 -4
- package/dist/da-SUD3Q44Q.js.map +1 -0
- package/dist/{de-JUAUYF4Z.js → de-6IC5QRX7.js} +45 -4
- package/dist/de-6IC5QRX7.js.map +1 -0
- package/dist/{el-JNLWCKEC.js → el-Q4NAXFRC.js} +45 -4
- package/dist/el-Q4NAXFRC.js.map +1 -0
- package/dist/{en-RBN2GUHF.js → en-P2L4X27N.js} +5 -3
- package/dist/{es-WPOX225H.js → es-YUKZBD4W.js} +45 -4
- package/dist/es-YUKZBD4W.js.map +1 -0
- package/dist/{fa-TAEP6N77.js → fa-OJ47LILE.js} +45 -4
- package/dist/fa-OJ47LILE.js.map +1 -0
- package/dist/{fi-ZVZHANSP.js → fi-QFFL5CUB.js} +45 -4
- package/dist/fi-QFFL5CUB.js.map +1 -0
- package/dist/{fr-VLZW7M4N.js → fr-BOQZZWP4.js} +45 -4
- package/dist/fr-BOQZZWP4.js.map +1 -0
- package/dist/{he-QFAFYA77.js → he-LXDY3TFA.js} +45 -4
- package/dist/he-LXDY3TFA.js.map +1 -0
- package/dist/{hi-AO3DQPCV.js → hi-HOJER77V.js} +45 -4
- package/dist/hi-HOJER77V.js.map +1 -0
- package/dist/{id-GTXF42WM.js → id-I5WQ6EWD.js} +45 -4
- package/dist/id-I5WQ6EWD.js.map +1 -0
- package/dist/index.css +150 -112
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +403 -45
- package/dist/index.js +4660 -18860
- package/dist/index.js.map +1 -1
- package/dist/integrations/css-modules-helper.js +1 -1
- package/dist/integrations/styled-components-theme.js +1 -1
- package/dist/{it-AS5GM232.js → it-UYH642IJ.js} +45 -4
- package/dist/it-UYH642IJ.js.map +1 -0
- package/dist/{ja-GZ4HLUOF.js → ja-JTVWAC4L.js} +45 -4
- package/dist/ja-JTVWAC4L.js.map +1 -0
- package/dist/{ko-A4XUXFGJ.js → ko-IHXFMOIZ.js} +45 -4
- package/dist/ko-IHXFMOIZ.js.map +1 -0
- package/dist/{ms-YBAO3S6K.js → ms-JH25VFLO.js} +45 -4
- package/dist/ms-JH25VFLO.js.map +1 -0
- package/dist/{nl-3TJGIIIU.js → nl-SURXW7IQ.js} +45 -4
- package/dist/nl-SURXW7IQ.js.map +1 -0
- package/dist/{no-4AXIQPRQ.js → no-HXIKQFDZ.js} +45 -4
- package/dist/no-HXIKQFDZ.js.map +1 -0
- package/dist/{pl-5GP6GKXO.js → pl-7A4KU6XK.js} +45 -4
- package/dist/pl-7A4KU6XK.js.map +1 -0
- package/dist/{pt-26Y6JFG5.js → pt-6MGYP7Q5.js} +45 -4
- package/dist/pt-6MGYP7Q5.js.map +1 -0
- package/dist/{ro-C7UXFRWJ.js → ro-IROCHNIA.js} +45 -4
- package/dist/ro-IROCHNIA.js.map +1 -0
- package/dist/{sv-44DVD76T.js → sv-WDJD75CV.js} +45 -4
- package/dist/sv-WDJD75CV.js.map +1 -0
- package/dist/test-utils.js +9 -4
- package/dist/test-utils.js.map +1 -1
- package/dist/{th-GIQRTBOY.js → th-RIO2E6B3.js} +45 -4
- package/dist/th-RIO2E6B3.js.map +1 -0
- package/dist/{tr-WMQWO4D6.js → tr-TZ7ERCIN.js} +45 -4
- package/dist/tr-TZ7ERCIN.js.map +1 -0
- package/dist/{uk-I7ML6RGG.js → uk-ZFWDKLUE.js} +45 -4
- package/dist/uk-ZFWDKLUE.js.map +1 -0
- package/dist/{vi-FGWECASQ.js → vi-UIOSP2JG.js} +45 -4
- package/dist/vi-UIOSP2JG.js.map +1 -0
- package/dist/{zh-L5FN73XC.js → zh-6R6YUY46.js} +45 -4
- package/dist/zh-6R6YUY46.js.map +1 -0
- package/package.json +18 -9
- package/src/components/AnnotateReferencesProgressWidget.tsx +35 -16
- package/src/components/ResourceTagsInline.tsx +94 -11
- package/src/components/StatusDisplay.css +36 -0
- package/src/components/__tests__/AnnotateReferencesProgressWidget.test.tsx +41 -91
- package/src/components/__tests__/ResourceTagsInline.test.tsx +101 -3
- package/src/components/annotation/AnnotateToolbar.tsx +53 -28
- package/src/components/annotation/__tests__/AnnotateToolbar.display.test.tsx +76 -0
- package/src/components/annotation/__tests__/AnnotateToolbar.test.tsx +124 -360
- package/src/components/image-annotation/SvgDrawingCanvas.tsx +5 -1
- package/src/components/modals/ConfigureGatherStep.tsx +102 -0
- package/src/components/modals/ContextSummary.tsx +15 -6
- package/src/components/modals/GatherContextStep.tsx +104 -59
- package/src/components/modals/ResourceGenerateModal.tsx +258 -0
- package/src/components/modals/__tests__/ConfigureGatherStep.test.tsx +82 -0
- package/src/components/modals/__tests__/GatherContextStep.resource.test.tsx +107 -0
- package/src/components/modals/__tests__/ResourceGenerateModal.test.tsx +197 -0
- package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +5 -0
- package/src/components/pdf-annotation/__tests__/PdfAnnotationCanvas.test.tsx +6 -6
- package/src/components/resource/AnnotateView.tsx +59 -38
- package/src/components/resource/BrowseView.tsx +159 -133
- package/src/components/resource/ResourceViewer.tsx +119 -128
- package/src/components/resource/__tests__/AnnotateView.embeddable.test.tsx +55 -0
- package/src/components/resource/__tests__/BrowseView.embeddable.test.tsx +49 -0
- package/src/components/resource/__tests__/BrowseView.links.test.tsx +60 -0
- package/src/components/resource/__tests__/BrowseView.overlay-async.test.tsx +113 -0
- package/src/components/resource/__tests__/BrowseView.reference-hover.test.tsx +161 -0
- package/src/components/resource/__tests__/BrowseView.registry.test.tsx +43 -0
- package/src/components/resource/__tests__/BrowseView.test.tsx +35 -22
- package/src/components/resource/__tests__/ResourceViewer.embeddable.test.tsx +63 -0
- package/src/components/resource/__tests__/ResourceViewer.mode-switch.test.tsx +12 -7
- package/src/components/resource/__tests__/ResourceViewer.toolbar-opt-out.test.tsx +135 -0
- package/src/components/resource/__tests__/ResourceViewer.toolbar-prefs.test.tsx +200 -0
- package/src/components/resource/__tests__/browse-renderers.test.tsx +34 -0
- package/src/components/resource/__tests__/inline-embedding.test.tsx +81 -0
- package/src/components/resource/__tests__/media-completeness.test.tsx +88 -0
- package/src/components/resource/browse-renderers.tsx +63 -0
- package/src/components/resource/panels/AssessmentPanel.tsx +4 -0
- package/src/components/resource/panels/CommentsPanel.tsx +4 -0
- package/src/components/resource/panels/HighlightPanel.tsx +4 -0
- package/src/components/resource/panels/ReferencesPanel.tsx +14 -0
- package/src/components/resource/panels/ResourceInfoPanel.tsx +22 -0
- package/src/components/resource/panels/TaggingPanel.tsx +4 -0
- package/src/components/resource/panels/UnifiedAnnotationsPanel.tsx +5 -2
- package/src/components/resource/panels/__tests__/AssessmentPanel.test.tsx +1 -0
- package/src/components/resource/panels/__tests__/CommentsPanel.test.tsx +1 -0
- package/src/components/resource/panels/__tests__/HighlightPanel.annotationProgress.test.tsx +16 -16
- package/src/components/resource/panels/__tests__/ReferencesPanel.observable-flow.test.tsx +1 -1
- package/src/components/resource/panels/__tests__/ReferencesPanel.test.tsx +1 -0
- package/src/components/resource/panels/__tests__/ResourceInfoPanel.test.tsx +26 -0
- package/src/components/resource/panels/__tests__/TaggingPanel.test.tsx +1 -0
- package/src/components/toolbar/Toolbar.css +14 -0
- package/src/features/admin-exchange/state/__tests__/exchange-state-unit.test.ts +14 -0
- package/src/features/admin-exchange/state/exchange-state-unit.ts +4 -2
- package/src/features/admin-security/state/__tests__/admin-security-state-unit.test.ts +14 -0
- package/src/features/admin-security/state/admin-security-state-unit.ts +4 -2
- package/src/features/admin-users/state/__tests__/admin-users-state-unit.test.ts +12 -5
- package/src/features/admin-users/state/admin-users-state-unit.ts +4 -2
- package/src/features/auth-welcome/state/__tests__/welcome-state-unit.test.ts +11 -0
- package/src/features/auth-welcome/state/welcome-state-unit.ts +1 -1
- package/src/features/moderate-entity-tags/state/__tests__/entity-tags-state-unit.test.ts +14 -0
- package/src/features/moderate-entity-tags/state/entity-tags-state-unit.ts +4 -2
- package/src/features/resource-compose/components/ResourceComposePage.tsx +13 -7
- package/src/features/resource-compose/state/__tests__/compose-page-state-unit.test.ts +13 -0
- package/src/features/resource-compose/state/compose-page-state-unit.ts +5 -2
- package/src/features/resource-discovery/state/__tests__/discover-state-unit.test.ts +15 -9
- package/src/features/resource-discovery/state/discover-state-unit.ts +5 -2
- package/src/features/resource-viewer/__tests__/ResourceViewerPage.test.tsx +7 -17
- package/src/features/resource-viewer/components/ResourceViewerPage.tsx +119 -17
- package/src/features/resource-viewer/state/__tests__/resource-loader-state-unit.test.ts +11 -0
- package/src/features/resource-viewer/state/__tests__/resource-viewer-page-state-unit.test.ts +30 -0
- package/src/features/resource-viewer/state/resource-loader-state-unit.ts +1 -1
- package/src/features/resource-viewer/state/resource-viewer-page-state-unit.ts +7 -16
- package/src/styles/features/resource-viewer.css +19 -0
- package/translations/ar.json +41 -2
- package/translations/bn.json +41 -2
- package/translations/cs.json +41 -2
- package/translations/da.json +41 -2
- package/translations/de.json +41 -2
- package/translations/el.json +41 -2
- package/translations/en.json +39 -0
- package/translations/es.json +41 -2
- package/translations/fa.json +41 -2
- package/translations/fi.json +41 -2
- package/translations/fr.json +41 -2
- package/translations/he.json +41 -2
- package/translations/hi.json +41 -2
- package/translations/id.json +41 -2
- package/translations/it.json +41 -2
- package/translations/ja.json +41 -2
- package/translations/ko.json +41 -2
- package/translations/ms.json +41 -2
- package/translations/nl.json +41 -2
- package/translations/no.json +41 -2
- package/translations/pl.json +41 -2
- package/translations/pt.json +41 -2
- package/translations/ro.json +41 -2
- package/translations/sv.json +41 -2
- package/translations/th.json +41 -2
- package/translations/tr.json +41 -2
- package/translations/uk.json +41 -2
- package/translations/vi.json +41 -2
- package/translations/zh.json +41 -2
- package/dist/PdfAnnotationCanvas.client-U4EVBZEV.js.map +0 -1
- package/dist/ar-WA47UUWA.js.map +0 -1
- package/dist/bn-5ANDRIU6.js.map +0 -1
- package/dist/chunk-GERSK2DY.js.map +0 -1
- package/dist/cs-3RU7F4JX.js.map +0 -1
- package/dist/da-GSW5P5HG.js.map +0 -1
- package/dist/de-JUAUYF4Z.js.map +0 -1
- package/dist/el-JNLWCKEC.js.map +0 -1
- package/dist/es-WPOX225H.js.map +0 -1
- package/dist/fa-TAEP6N77.js.map +0 -1
- package/dist/fi-ZVZHANSP.js.map +0 -1
- package/dist/fr-VLZW7M4N.js.map +0 -1
- package/dist/he-QFAFYA77.js.map +0 -1
- package/dist/hi-AO3DQPCV.js.map +0 -1
- package/dist/id-GTXF42WM.js.map +0 -1
- package/dist/it-AS5GM232.js.map +0 -1
- package/dist/ja-GZ4HLUOF.js.map +0 -1
- package/dist/ko-A4XUXFGJ.js.map +0 -1
- package/dist/ms-YBAO3S6K.js.map +0 -1
- package/dist/nl-3TJGIIIU.js.map +0 -1
- package/dist/no-4AXIQPRQ.js.map +0 -1
- package/dist/pl-5GP6GKXO.js.map +0 -1
- package/dist/pt-26Y6JFG5.js.map +0 -1
- package/dist/ro-C7UXFRWJ.js.map +0 -1
- package/dist/sv-44DVD76T.js.map +0 -1
- package/dist/th-GIQRTBOY.js.map +0 -1
- package/dist/tr-WMQWO4D6.js.map +0 -1
- package/dist/uk-I7ML6RGG.js.map +0 -1
- package/dist/vi-FGWECASQ.js.map +0 -1
- package/dist/zh-L5FN73XC.js.map +0 -1
- /package/dist/{chunk-YBGN4ACY.js.map → chunk-O23TLLXW.js.map} +0 -0
- /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-
|
|
4
|
+
} from "./chunk-R52YAGHK.js";
|
|
5
5
|
import {
|
|
6
6
|
__commonJS,
|
|
7
7
|
__glob
|
|
8
|
-
} from "./chunk-
|
|
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
|
|
9548
|
-
import { Fragment, jsx as
|
|
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-
|
|
9553
|
-
"../../translations/bn.json": () => import("./bn-
|
|
9554
|
-
"../../translations/cs.json": () => import("./cs-
|
|
9555
|
-
"../../translations/da.json": () => import("./da-
|
|
9556
|
-
"../../translations/de.json": () => import("./de-
|
|
9557
|
-
"../../translations/el.json": () => import("./el-
|
|
9558
|
-
"../../translations/en.json": () => import("./en-
|
|
9559
|
-
"../../translations/es.json": () => import("./es-
|
|
9560
|
-
"../../translations/fa.json": () => import("./fa-
|
|
9561
|
-
"../../translations/fi.json": () => import("./fi-
|
|
9562
|
-
"../../translations/fr.json": () => import("./fr-
|
|
9563
|
-
"../../translations/he.json": () => import("./he-
|
|
9564
|
-
"../../translations/hi.json": () => import("./hi-
|
|
9565
|
-
"../../translations/id.json": () => import("./id-
|
|
9566
|
-
"../../translations/it.json": () => import("./it-
|
|
9567
|
-
"../../translations/ja.json": () => import("./ja-
|
|
9568
|
-
"../../translations/ko.json": () => import("./ko-
|
|
9569
|
-
"../../translations/ms.json": () => import("./ms-
|
|
9570
|
-
"../../translations/nl.json": () => import("./nl-
|
|
9571
|
-
"../../translations/no.json": () => import("./no-
|
|
9572
|
-
"../../translations/pl.json": () => import("./pl-
|
|
9573
|
-
"../../translations/pt.json": () => import("./pt-
|
|
9574
|
-
"../../translations/ro.json": () => import("./ro-
|
|
9575
|
-
"../../translations/sv.json": () => import("./sv-
|
|
9576
|
-
"../../translations/th.json": () => import("./th-
|
|
9577
|
-
"../../translations/tr.json": () => import("./tr-
|
|
9578
|
-
"../../translations/uk.json": () => import("./uk-
|
|
9579
|
-
"../../translations/vi.json": () => import("./vi-
|
|
9580
|
-
"../../translations/zh.json": () => import("./zh-
|
|
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] =
|
|
9734
|
-
const [isLoading, setIsLoading] =
|
|
9735
|
-
|
|
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__ */
|
|
9687
|
+
return /* @__PURE__ */ jsx2(TranslationContext.Provider, { value: translationManager, children });
|
|
9771
9688
|
}
|
|
9772
9689
|
if (locale && isLoading) {
|
|
9773
|
-
return /* @__PURE__ */
|
|
9690
|
+
return /* @__PURE__ */ jsx2(Fragment, { children: loadingComponent });
|
|
9774
9691
|
}
|
|
9775
9692
|
if (locale && localeManager) {
|
|
9776
|
-
return /* @__PURE__ */
|
|
9693
|
+
return /* @__PURE__ */ jsx2(TranslationContext.Provider, { value: localeManager, children });
|
|
9777
9694
|
}
|
|
9778
|
-
return /* @__PURE__ */
|
|
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-
|
|
9944
|
+
//# sourceMappingURL=chunk-PFUXQPWJ.js.map
|