@semiont/react-ui 0.5.25 → 0.5.27
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 +28 -4
- package/dist/PdfAnnotationCanvas.client-EVUPTUWZ.js +677 -0
- package/dist/PdfAnnotationCanvas.client-EVUPTUWZ.js.map +1 -0
- package/dist/PdfAnnotationCanvas.client-TGDPPGXJ.css +185 -0
- package/dist/PdfAnnotationCanvas.client-TGDPPGXJ.css.map +1 -0
- package/dist/{ar-CULRHLNG.js → ar-OU3DQGC6.js} +65 -7
- package/dist/ar-OU3DQGC6.js.map +1 -0
- package/dist/{bn-HYR7CEL2.js → bn-PHWCR6AZ.js} +65 -7
- package/dist/bn-PHWCR6AZ.js.map +1 -0
- package/dist/chunk-5VDTWRXJ.js +287 -0
- package/dist/chunk-5VDTWRXJ.js.map +1 -0
- package/dist/{chunk-TG2XQEC4.js → chunk-BTUG3VJJ.js} +18 -298
- package/dist/chunk-BTUG3VJJ.js.map +1 -0
- package/dist/{chunk-NH6L2GIL.js → chunk-PCRRBU7H.js} +65 -7
- package/dist/chunk-PCRRBU7H.js.map +1 -0
- package/dist/{cs-YBRWY7NH.js → cs-NEXYZ62I.js} +65 -7
- package/dist/cs-NEXYZ62I.js.map +1 -0
- package/dist/{da-PHDEOBV3.js → da-FAT43YCU.js} +65 -7
- package/dist/da-FAT43YCU.js.map +1 -0
- package/dist/{de-O4UCCVLJ.js → de-KRQ3WBCU.js} +65 -7
- package/dist/de-KRQ3WBCU.js.map +1 -0
- package/dist/{el-MVGO6WZV.js → el-Q4IU3EKC.js} +65 -7
- package/dist/el-Q4IU3EKC.js.map +1 -0
- package/dist/{en-2KQILFKQ.js → en-2KADE7N4.js} +6 -2
- package/dist/{es-USSLXQY7.js → es-2IO3R2MK.js} +65 -7
- package/dist/es-2IO3R2MK.js.map +1 -0
- package/dist/{fa-WMAREFWY.js → fa-Q5GOQFXX.js} +65 -7
- package/dist/fa-Q5GOQFXX.js.map +1 -0
- package/dist/{fi-B3NBNOTS.js → fi-R6NMRWBE.js} +65 -7
- package/dist/fi-R6NMRWBE.js.map +1 -0
- package/dist/{fr-TXYK5T5W.js → fr-QY4D5E6J.js} +65 -7
- package/dist/fr-QY4D5E6J.js.map +1 -0
- package/dist/{he-JCJACW5D.js → he-X6Y77XHY.js} +65 -7
- package/dist/he-X6Y77XHY.js.map +1 -0
- package/dist/{hi-VOQLZNJU.js → hi-XL7IOEQM.js} +65 -7
- package/dist/hi-XL7IOEQM.js.map +1 -0
- package/dist/{id-BFN5RZNZ.js → id-QZ4ZZS67.js} +65 -7
- package/dist/id-QZ4ZZS67.js.map +1 -0
- package/dist/index.css +241 -508
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +155 -54
- package/dist/index.js +1815 -1642
- package/dist/index.js.map +1 -1
- package/dist/integrations/css-modules-helper.js +1 -3
- package/dist/integrations/css-modules-helper.js.map +1 -1
- package/dist/{it-TWWDHKKM.js → it-ME2Q7OB6.js} +65 -7
- package/dist/it-ME2Q7OB6.js.map +1 -0
- package/dist/{ja-YRQLEBFM.js → ja-HX7QASRI.js} +65 -7
- package/dist/ja-HX7QASRI.js.map +1 -0
- package/dist/{ko-PG6B3CRB.js → ko-EQO5AHAV.js} +65 -7
- package/dist/ko-EQO5AHAV.js.map +1 -0
- package/dist/{ms-7EZECVKM.js → ms-UILFSF3I.js} +65 -7
- package/dist/ms-UILFSF3I.js.map +1 -0
- package/dist/{nl-HP753YAP.js → nl-NNI45PMK.js} +65 -7
- package/dist/nl-NNI45PMK.js.map +1 -0
- package/dist/{no-JUD5WX3N.js → no-MAL5F6P6.js} +65 -7
- package/dist/no-MAL5F6P6.js.map +1 -0
- package/dist/{pl-RVUL4CBM.js → pl-4RMY6JAJ.js} +65 -7
- package/dist/pl-4RMY6JAJ.js.map +1 -0
- package/dist/{pt-RPOVD4QM.js → pt-VQH2X3QQ.js} +65 -7
- package/dist/pt-VQH2X3QQ.js.map +1 -0
- package/dist/{ro-DMYWQTRD.js → ro-XXCQO2OG.js} +65 -7
- package/dist/ro-XXCQO2OG.js.map +1 -0
- package/dist/{sv-DMZ4FGXD.js → sv-7Z6EJ6U4.js} +65 -7
- package/dist/sv-7Z6EJ6U4.js.map +1 -0
- package/dist/test-utils.css +1 -1
- package/dist/test-utils.css.map +1 -1
- package/dist/test-utils.d.ts +1 -1
- package/dist/test-utils.js +5 -3
- package/dist/test-utils.js.map +1 -1
- package/dist/{th-4HVBJBQ2.js → th-L3DXXYVQ.js} +65 -7
- package/dist/th-L3DXXYVQ.js.map +1 -0
- package/dist/{tr-6BDPU5ML.js → tr-P3DFVLFJ.js} +65 -7
- package/dist/tr-P3DFVLFJ.js.map +1 -0
- package/dist/{uk-TBZBT2TL.js → uk-7C5D3PXS.js} +65 -7
- package/dist/uk-7C5D3PXS.js.map +1 -0
- package/dist/{vi-UMKZKZL3.js → vi-ZLTLEO7P.js} +65 -7
- package/dist/vi-ZLTLEO7P.js.map +1 -0
- package/dist/{zh-YBJWJJYB.js → zh-5FHVWDIN.js} +65 -7
- package/dist/zh-5FHVWDIN.js.map +1 -0
- package/package.json +7 -7
- package/src/components/AssistProgress.tsx +144 -134
- package/src/components/{EntityFoundLog.tsx → ItemFoundLog.tsx} +12 -7
- package/src/components/ProtectedErrorBoundary.css +3 -1
- package/src/components/StatusDisplay.css +35 -35
- package/src/components/Toast.css +3 -1
- package/src/components/__tests__/AssistProgress.test.tsx +216 -148
- package/src/components/annotation/annotation-entries.css +0 -4
- package/src/components/annotation/annotations.css +1 -1
- package/src/components/annotation/references.css +0 -4
- package/src/components/image-annotation/AnnotationOverlay.tsx +6 -6
- package/src/components/image-annotation/SvgDrawingCanvas.tsx +1 -1
- package/src/components/image-annotation/__tests__/AnnotationOverlay.click.test.tsx +7 -9
- package/src/components/image-annotation/__tests__/SvgDrawingCanvas.click.test.tsx +1 -2
- package/src/components/layout/Header.css +0 -4
- package/src/components/layout/LeftSidebar.css +0 -4
- package/src/components/modals/ConfigureGenerationStep.tsx +109 -48
- package/src/components/modals/ConfigureSearchStep.tsx +23 -40
- package/src/components/modals/ReferenceWizardModal.tsx +55 -16
- package/src/components/modals/ResourceGenerateModal.tsx +24 -8
- package/src/components/modals/ResourceSearchModal.tsx +1 -1
- package/src/components/modals/SearchModal.css +5 -17
- package/src/components/modals/SearchModal.tsx +1 -1
- package/src/components/modals/SearchResultsStep.tsx +2 -20
- package/src/components/modals/WizardFooter.tsx +63 -0
- package/src/components/modals/__tests__/ConfigureGenerationStep.test.tsx +255 -0
- package/src/components/modals/__tests__/ConfigureSearchStep.test.tsx +72 -0
- package/src/components/modals/__tests__/ReferenceWizardModal.test.tsx +256 -0
- package/src/components/modals/__tests__/ResourceGenerateModal.test.tsx +1 -0
- package/src/components/modals/__tests__/ResourceSearchModal.test.tsx +6 -2
- package/src/components/modals/__tests__/SearchModal.search-wiring.test.tsx +6 -2
- package/src/components/modals/__tests__/WizardFooter.test.tsx +235 -0
- package/src/components/modals/modals.css +16 -42
- package/src/components/navigation/NavigationTabs.css +0 -20
- package/src/components/pdf-annotation/PdfAnnotationCanvas.css +162 -6
- package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +623 -232
- package/src/components/pdf-annotation/__tests__/PdfAnnotationCanvas.test.tsx +764 -7
- package/src/components/pdf-annotation/__tests__/estimate-slot-height.test.ts +53 -0
- package/src/components/pdf-annotation/estimate-slot-height.ts +31 -0
- package/src/components/resource/AnnotateView.tsx +16 -5
- package/src/components/resource/AnnotationHistory.tsx +2 -0
- package/src/components/resource/BrowseView.tsx +15 -4
- package/src/components/resource/ResourceViewer.tsx +23 -24
- package/src/components/resource/__tests__/AnnotateView.focus.test.tsx +50 -0
- package/src/components/resource/__tests__/AnnotationHistory.test.tsx +2 -0
- package/src/components/resource/__tests__/BrowseView.test.tsx +29 -3
- package/src/components/resource/__tests__/ResourceViewer.embeddable.test.tsx +47 -3
- package/src/components/resource/__tests__/browse-renderers.dispatch.test.tsx +33 -0
- package/src/components/resource/annotate-renderers.tsx +10 -1
- package/src/components/resource/browse-renderers.tsx +10 -1
- package/src/components/resource/event-formatting.ts +0 -3
- package/src/components/resource/panels/AssessmentEntry.tsx +1 -1
- package/src/components/resource/panels/AssessmentPanel.css +5 -6
- package/src/components/resource/panels/AssistSection.css +68 -271
- package/src/components/resource/panels/AssistSection.tsx +4 -4
- package/src/components/resource/panels/AssistShell.tsx +12 -4
- package/src/components/resource/panels/CollaborationPanel.css +47 -22
- package/src/components/resource/panels/CollaborationPanel.tsx +93 -2
- package/src/components/resource/panels/CommentEntry.tsx +1 -1
- package/src/components/resource/panels/CommentsPanel.css +0 -16
- package/src/components/resource/panels/HighlightEntry.tsx +1 -1
- package/src/components/resource/panels/HighlightPanel.css +0 -7
- package/src/components/resource/panels/JsonLdPanel.css +0 -4
- package/src/components/resource/panels/ReferenceEntry.tsx +1 -1
- package/src/components/resource/panels/ReferencesPanel.css +0 -12
- package/src/components/resource/panels/ReferencesPanel.tsx +12 -20
- package/src/components/resource/panels/ResourceInfoPanel.css +0 -32
- package/src/components/resource/panels/ResourceInfoPanel.tsx +1 -1
- package/src/components/resource/panels/StatisticsPanel.css +0 -20
- package/src/components/resource/panels/TagEntry.tsx +1 -1
- package/src/components/resource/panels/TaggingPanel.css +0 -4
- package/src/components/resource/panels/TaggingPanel.tsx +2 -10
- package/src/components/resource/panels/UnifiedAnnotationsPanel.css +0 -4
- package/src/components/resource/panels/__tests__/AssessmentEntry.test.tsx +0 -1
- package/src/components/resource/panels/__tests__/AssistSection.test.tsx +48 -50
- package/src/components/resource/panels/__tests__/AssistShell.test.tsx +11 -6
- package/src/components/resource/panels/__tests__/CollaborationPanel.test.tsx +89 -0
- package/src/components/resource/panels/__tests__/CommentEntry.test.tsx +1 -2
- package/src/components/resource/panels/__tests__/HighlightEntry.test.tsx +0 -1
- package/src/components/resource/panels/__tests__/HighlightPanel.annotationProgress.test.tsx +44 -36
- package/src/components/resource/panels/__tests__/ReferenceEntry.test.tsx +0 -1
- package/src/components/resource/panels/__tests__/ReferencesPanel.headless.test.tsx +1 -1
- package/src/components/resource/panels/__tests__/ReferencesPanel.test.tsx +34 -53
- package/src/components/resource/panels/__tests__/ResourceInfoPanel.test.tsx +37 -1
- package/src/components/resource/panels/__tests__/TagEntry.test.tsx +0 -1
- package/src/components/settings/SettingsPanel.css +0 -4
- package/src/features/auth/auth.css +9 -33
- package/src/features/resource-compose/state/__tests__/compose-page-state-unit.test.ts +25 -1
- package/src/features/resource-compose/state/compose-page-state-unit.ts +11 -2
- package/src/features/resource-discovery/__tests__/ResourceDiscoveryPage.test.tsx +55 -0
- package/src/features/resource-discovery/components/ResourceDiscoveryPage.tsx +29 -0
- package/src/features/resource-discovery/state/__tests__/discover-state-unit.test.ts +53 -3
- package/src/features/resource-discovery/state/discover-state-unit.ts +29 -8
- package/src/features/resource-viewer/__tests__/ResourceViewerPage.test.tsx +26 -0
- package/src/features/resource-viewer/components/ResourceViewerPage.tsx +42 -21
- package/src/features/resource-viewer/hooks/__tests__/useResourceViewedReport.test.tsx +63 -0
- package/src/features/resource-viewer/hooks/useResourceViewedReport.ts +33 -0
- package/src/features/resource-viewer/state/__tests__/resource-viewer-page-state-unit.test.ts +2 -2
- package/src/features/resource-viewer/state/resource-viewer-page-state-unit.ts +1 -1
- package/src/styles/core/buttons.css +3 -1
- package/src/styles/core/forms.css +0 -21
- package/src/styles/core/indicators.css +0 -4
- package/src/styles/core/inputs.css +1 -5
- package/src/styles/core/progress.css +2 -34
- package/src/styles/core/sliders.css +0 -4
- package/src/styles/core/toggles.css +0 -4
- package/src/styles/features/compose.css +1 -1
- package/src/styles/features/resource-discovery.css +13 -0
- package/src/styles/features/resource-viewer.css +1 -21
- package/src/styles/features/static-pages.css +11 -11
- package/src/styles/motivations/motivation-assessment.css +2 -2
- package/src/styles/motivations/motivation-comment.css +2 -2
- package/src/styles/motivations/motivation-reference.css +2 -2
- package/src/styles/panels/history-panel.css +0 -40
- package/src/styles/panels/user-panel.css +0 -3
- package/src/styles/patterns/panel-helpers.css +0 -27
- package/src/styles/patterns/panel-sections.css +0 -59
- package/src/styles/patterns/panels-base.css +4 -36
- package/src/styles/utilities/motion.css +15 -15
- package/src/styles/variables.css +29 -1
- package/translations/ar.json +59 -5
- package/translations/bn.json +59 -5
- package/translations/cs.json +59 -5
- package/translations/da.json +59 -5
- package/translations/de.json +59 -5
- package/translations/el.json +59 -5
- package/translations/en.json +59 -5
- package/translations/es.json +59 -5
- package/translations/fa.json +59 -5
- package/translations/fi.json +59 -5
- package/translations/fr.json +59 -5
- package/translations/he.json +59 -5
- package/translations/hi.json +59 -5
- package/translations/id.json +59 -5
- package/translations/it.json +59 -5
- package/translations/ja.json +59 -5
- package/translations/ko.json +59 -5
- package/translations/ms.json +59 -5
- package/translations/nl.json +59 -5
- package/translations/no.json +59 -5
- package/translations/pl.json +59 -5
- package/translations/pt.json +59 -5
- package/translations/ro.json +59 -5
- package/translations/sv.json +59 -5
- package/translations/th.json +59 -5
- package/translations/tr.json +59 -5
- package/translations/uk.json +59 -5
- package/translations/vi.json +59 -5
- package/translations/zh.json +59 -5
- package/dist/PdfAnnotationCanvas.client-EHQWF6BR.js +0 -462
- package/dist/PdfAnnotationCanvas.client-EHQWF6BR.js.map +0 -1
- package/dist/PdfAnnotationCanvas.client-SU5KNT7G.css +0 -98
- package/dist/PdfAnnotationCanvas.client-SU5KNT7G.css.map +0 -1
- package/dist/ar-CULRHLNG.js.map +0 -1
- package/dist/bn-HYR7CEL2.js.map +0 -1
- package/dist/chunk-NH6L2GIL.js.map +0 -1
- package/dist/chunk-TG2XQEC4.js.map +0 -1
- package/dist/chunk-XUDKYAVC.js +0 -21
- package/dist/chunk-XUDKYAVC.js.map +0 -1
- package/dist/cs-YBRWY7NH.js.map +0 -1
- package/dist/da-PHDEOBV3.js.map +0 -1
- package/dist/de-O4UCCVLJ.js.map +0 -1
- package/dist/el-MVGO6WZV.js.map +0 -1
- package/dist/es-USSLXQY7.js.map +0 -1
- package/dist/fa-WMAREFWY.js.map +0 -1
- package/dist/fi-B3NBNOTS.js.map +0 -1
- package/dist/fr-TXYK5T5W.js.map +0 -1
- package/dist/he-JCJACW5D.js.map +0 -1
- package/dist/hi-VOQLZNJU.js.map +0 -1
- package/dist/id-BFN5RZNZ.js.map +0 -1
- package/dist/it-TWWDHKKM.js.map +0 -1
- package/dist/ja-YRQLEBFM.js.map +0 -1
- package/dist/ko-PG6B3CRB.js.map +0 -1
- package/dist/ms-7EZECVKM.js.map +0 -1
- package/dist/nl-HP753YAP.js.map +0 -1
- package/dist/no-JUD5WX3N.js.map +0 -1
- package/dist/pl-RVUL4CBM.js.map +0 -1
- package/dist/pt-RPOVD4QM.js.map +0 -1
- package/dist/ro-DMYWQTRD.js.map +0 -1
- package/dist/sv-DMZ4FGXD.js.map +0 -1
- package/dist/th-4HVBJBQ2.js.map +0 -1
- package/dist/tr-6BDPU5ML.js.map +0 -1
- package/dist/uk-TBZBT2TL.js.map +0 -1
- package/dist/vi-UMKZKZL3.js.map +0 -1
- package/dist/zh-YBJWJJYB.js.map +0 -1
- package/src/integrations/tailwind-plugin.cjs +0 -224
- /package/dist/{en-2KQILFKQ.js.map → en-2KADE7N4.js.map} +0 -0
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./chunk-NH6L2GIL.js";
|
|
5
|
-
import {
|
|
6
|
-
__commonJS,
|
|
7
|
-
__glob
|
|
3
|
+
__commonJS
|
|
8
4
|
} from "./chunk-O23TLLXW.js";
|
|
9
5
|
|
|
10
6
|
// ../../node_modules/rxjs/dist/cjs/internal/util/isFunction.js
|
|
@@ -9490,290 +9486,18 @@ function useSemiont() {
|
|
|
9490
9486
|
return ctx;
|
|
9491
9487
|
}
|
|
9492
9488
|
|
|
9493
|
-
// src/contexts/TranslationContext.tsx
|
|
9494
|
-
import { createContext as createContext3, useContext as useContext3, useState as useState2, useEffect, useMemo as useMemo2 } from "react";
|
|
9495
|
-
import { Fragment, jsx as jsx3 } from "react/jsx-runtime";
|
|
9496
|
-
|
|
9497
|
-
// import("../../translations/**/*.json") in src/contexts/TranslationContext.tsx
|
|
9498
|
-
var globImport_translations_json = __glob({
|
|
9499
|
-
"../../translations/ar.json": () => import("./ar-CULRHLNG.js"),
|
|
9500
|
-
"../../translations/bn.json": () => import("./bn-HYR7CEL2.js"),
|
|
9501
|
-
"../../translations/cs.json": () => import("./cs-YBRWY7NH.js"),
|
|
9502
|
-
"../../translations/da.json": () => import("./da-PHDEOBV3.js"),
|
|
9503
|
-
"../../translations/de.json": () => import("./de-O4UCCVLJ.js"),
|
|
9504
|
-
"../../translations/el.json": () => import("./el-MVGO6WZV.js"),
|
|
9505
|
-
"../../translations/en.json": () => import("./en-2KQILFKQ.js"),
|
|
9506
|
-
"../../translations/es.json": () => import("./es-USSLXQY7.js"),
|
|
9507
|
-
"../../translations/fa.json": () => import("./fa-WMAREFWY.js"),
|
|
9508
|
-
"../../translations/fi.json": () => import("./fi-B3NBNOTS.js"),
|
|
9509
|
-
"../../translations/fr.json": () => import("./fr-TXYK5T5W.js"),
|
|
9510
|
-
"../../translations/he.json": () => import("./he-JCJACW5D.js"),
|
|
9511
|
-
"../../translations/hi.json": () => import("./hi-VOQLZNJU.js"),
|
|
9512
|
-
"../../translations/id.json": () => import("./id-BFN5RZNZ.js"),
|
|
9513
|
-
"../../translations/it.json": () => import("./it-TWWDHKKM.js"),
|
|
9514
|
-
"../../translations/ja.json": () => import("./ja-YRQLEBFM.js"),
|
|
9515
|
-
"../../translations/ko.json": () => import("./ko-PG6B3CRB.js"),
|
|
9516
|
-
"../../translations/ms.json": () => import("./ms-7EZECVKM.js"),
|
|
9517
|
-
"../../translations/nl.json": () => import("./nl-HP753YAP.js"),
|
|
9518
|
-
"../../translations/no.json": () => import("./no-JUD5WX3N.js"),
|
|
9519
|
-
"../../translations/pl.json": () => import("./pl-RVUL4CBM.js"),
|
|
9520
|
-
"../../translations/pt.json": () => import("./pt-RPOVD4QM.js"),
|
|
9521
|
-
"../../translations/ro.json": () => import("./ro-DMYWQTRD.js"),
|
|
9522
|
-
"../../translations/sv.json": () => import("./sv-DMZ4FGXD.js"),
|
|
9523
|
-
"../../translations/th.json": () => import("./th-4HVBJBQ2.js"),
|
|
9524
|
-
"../../translations/tr.json": () => import("./tr-6BDPU5ML.js"),
|
|
9525
|
-
"../../translations/uk.json": () => import("./uk-TBZBT2TL.js"),
|
|
9526
|
-
"../../translations/vi.json": () => import("./vi-UMKZKZL3.js"),
|
|
9527
|
-
"../../translations/zh.json": () => import("./zh-YBJWJJYB.js")
|
|
9528
|
-
});
|
|
9529
|
-
|
|
9530
|
-
// src/contexts/TranslationContext.tsx
|
|
9531
|
-
var TranslationContext = createContext3(null);
|
|
9532
|
-
var translationCache = /* @__PURE__ */ new Map();
|
|
9533
|
-
function processPluralFormat(text, params) {
|
|
9534
|
-
const pluralMatch = text.match(/\{(\w+),\s*plural,\s*/);
|
|
9535
|
-
if (!pluralMatch) {
|
|
9536
|
-
return text;
|
|
9537
|
-
}
|
|
9538
|
-
const paramName = pluralMatch[1];
|
|
9539
|
-
const count = params[paramName];
|
|
9540
|
-
if (count === void 0) {
|
|
9541
|
-
return text;
|
|
9542
|
-
}
|
|
9543
|
-
let startPos = pluralMatch[0].length;
|
|
9544
|
-
let braceCount = 1;
|
|
9545
|
-
let endPos = startPos;
|
|
9546
|
-
for (let i = startPos; i < text.length; i++) {
|
|
9547
|
-
if (text[i] === "{") braceCount++;
|
|
9548
|
-
else if (text[i] === "}") {
|
|
9549
|
-
braceCount--;
|
|
9550
|
-
if (braceCount === 0) {
|
|
9551
|
-
endPos = i;
|
|
9552
|
-
break;
|
|
9553
|
-
}
|
|
9554
|
-
}
|
|
9555
|
-
}
|
|
9556
|
-
const pluralCases = text.substring(startPos, endPos);
|
|
9557
|
-
const cases = {};
|
|
9558
|
-
const caseRegex = /(?:=(\d+)|(\w+))\s*\{([^}]+)\}/g;
|
|
9559
|
-
let caseMatch;
|
|
9560
|
-
while ((caseMatch = caseRegex.exec(pluralCases)) !== null) {
|
|
9561
|
-
const [, exactNumber, keyword, textContent] = caseMatch;
|
|
9562
|
-
const key = exactNumber !== void 0 ? `=${exactNumber}` : keyword;
|
|
9563
|
-
cases[key] = textContent;
|
|
9564
|
-
}
|
|
9565
|
-
const exactMatch = cases[`=${count}`];
|
|
9566
|
-
if (exactMatch !== void 0) {
|
|
9567
|
-
const result = exactMatch.replace(/#/g, String(count));
|
|
9568
|
-
return text.substring(0, pluralMatch.index) + result + text.substring(endPos + 1);
|
|
9569
|
-
}
|
|
9570
|
-
const otherCase = cases["other"];
|
|
9571
|
-
if (otherCase !== void 0) {
|
|
9572
|
-
const result = otherCase.replace(/#/g, String(count));
|
|
9573
|
-
return text.substring(0, pluralMatch.index) + result + text.substring(endPos + 1);
|
|
9574
|
-
}
|
|
9575
|
-
return text;
|
|
9576
|
-
}
|
|
9577
|
-
var AVAILABLE_LOCALES = [
|
|
9578
|
-
"ar",
|
|
9579
|
-
// Arabic
|
|
9580
|
-
"bn",
|
|
9581
|
-
// Bengali
|
|
9582
|
-
"cs",
|
|
9583
|
-
// Czech
|
|
9584
|
-
"da",
|
|
9585
|
-
// Danish
|
|
9586
|
-
"de",
|
|
9587
|
-
// German
|
|
9588
|
-
"el",
|
|
9589
|
-
// Greek
|
|
9590
|
-
"en",
|
|
9591
|
-
// English
|
|
9592
|
-
"es",
|
|
9593
|
-
// Spanish
|
|
9594
|
-
"fa",
|
|
9595
|
-
// Persian/Farsi
|
|
9596
|
-
"fi",
|
|
9597
|
-
// Finnish
|
|
9598
|
-
"fr",
|
|
9599
|
-
// French
|
|
9600
|
-
"he",
|
|
9601
|
-
// Hebrew
|
|
9602
|
-
"hi",
|
|
9603
|
-
// Hindi
|
|
9604
|
-
"id",
|
|
9605
|
-
// Indonesian
|
|
9606
|
-
"it",
|
|
9607
|
-
// Italian
|
|
9608
|
-
"ja",
|
|
9609
|
-
// Japanese
|
|
9610
|
-
"ko",
|
|
9611
|
-
// Korean
|
|
9612
|
-
"ms",
|
|
9613
|
-
// Malay
|
|
9614
|
-
"nl",
|
|
9615
|
-
// Dutch
|
|
9616
|
-
"no",
|
|
9617
|
-
// Norwegian
|
|
9618
|
-
"pl",
|
|
9619
|
-
// Polish
|
|
9620
|
-
"pt",
|
|
9621
|
-
// Portuguese
|
|
9622
|
-
"ro",
|
|
9623
|
-
// Romanian
|
|
9624
|
-
"sv",
|
|
9625
|
-
// Swedish
|
|
9626
|
-
"th",
|
|
9627
|
-
// Thai
|
|
9628
|
-
"tr",
|
|
9629
|
-
// Turkish
|
|
9630
|
-
"uk",
|
|
9631
|
-
// Ukrainian
|
|
9632
|
-
"vi",
|
|
9633
|
-
// Vietnamese
|
|
9634
|
-
"zh"
|
|
9635
|
-
// Chinese
|
|
9636
|
-
];
|
|
9637
|
-
async function loadTranslations(locale) {
|
|
9638
|
-
if (translationCache.has(locale)) {
|
|
9639
|
-
return translationCache.get(locale);
|
|
9640
|
-
}
|
|
9641
|
-
if (locale === "en") {
|
|
9642
|
-
translationCache.set("en", en_default);
|
|
9643
|
-
return en_default;
|
|
9644
|
-
}
|
|
9645
|
-
try {
|
|
9646
|
-
const translations = await globImport_translations_json(`../../translations/${locale}.json`);
|
|
9647
|
-
const translationData = translations.default || translations;
|
|
9648
|
-
translationCache.set(locale, translationData);
|
|
9649
|
-
return translationData;
|
|
9650
|
-
} catch (error) {
|
|
9651
|
-
console.error(`Failed to load translations for locale: ${locale}`, error);
|
|
9652
|
-
return en_default;
|
|
9653
|
-
}
|
|
9654
|
-
}
|
|
9655
|
-
var defaultTranslationManager = {
|
|
9656
|
-
t: (namespace, key, params) => {
|
|
9657
|
-
const translations = en_default;
|
|
9658
|
-
const translation = translations[namespace]?.[key];
|
|
9659
|
-
if (!translation) {
|
|
9660
|
-
console.warn(`Translation not found for ${namespace}.${key}`);
|
|
9661
|
-
return `${namespace}.${key}`;
|
|
9662
|
-
}
|
|
9663
|
-
if (params && typeof translation === "string") {
|
|
9664
|
-
let result = translation;
|
|
9665
|
-
result = processPluralFormat(result, params);
|
|
9666
|
-
Object.entries(params).forEach(([paramKey, paramValue]) => {
|
|
9667
|
-
result = result.replace(new RegExp(`\\{\\{${paramKey}\\}\\}`, "g"), String(paramValue));
|
|
9668
|
-
});
|
|
9669
|
-
return result;
|
|
9670
|
-
}
|
|
9671
|
-
return translation;
|
|
9672
|
-
}
|
|
9673
|
-
};
|
|
9674
|
-
function TranslationProvider({
|
|
9675
|
-
translationManager,
|
|
9676
|
-
locale,
|
|
9677
|
-
loadingComponent = null,
|
|
9678
|
-
children
|
|
9679
|
-
}) {
|
|
9680
|
-
const [loadedTranslations, setLoadedTranslations] = useState2(null);
|
|
9681
|
-
const [isLoading, setIsLoading] = useState2(false);
|
|
9682
|
-
useEffect(() => {
|
|
9683
|
-
if (locale && !translationManager) {
|
|
9684
|
-
setIsLoading(true);
|
|
9685
|
-
loadTranslations(locale).then((translations) => {
|
|
9686
|
-
setLoadedTranslations(translations);
|
|
9687
|
-
setIsLoading(false);
|
|
9688
|
-
}).catch((error) => {
|
|
9689
|
-
console.error("Failed to load translations:", error);
|
|
9690
|
-
setLoadedTranslations(en_default);
|
|
9691
|
-
setIsLoading(false);
|
|
9692
|
-
});
|
|
9693
|
-
}
|
|
9694
|
-
}, [locale, translationManager]);
|
|
9695
|
-
const localeManager = useMemo2(() => {
|
|
9696
|
-
if (!loadedTranslations) return null;
|
|
9697
|
-
return {
|
|
9698
|
-
t: (namespace, key, params) => {
|
|
9699
|
-
const translation = loadedTranslations[namespace]?.[key];
|
|
9700
|
-
if (!translation) {
|
|
9701
|
-
console.warn(`Translation not found for ${namespace}.${key} in locale ${locale}`);
|
|
9702
|
-
return `${namespace}.${key}`;
|
|
9703
|
-
}
|
|
9704
|
-
if (params && typeof translation === "string") {
|
|
9705
|
-
let result = translation;
|
|
9706
|
-
result = processPluralFormat(result, params);
|
|
9707
|
-
Object.entries(params).forEach(([paramKey, paramValue]) => {
|
|
9708
|
-
result = result.replace(new RegExp(`\\{\\{${paramKey}\\}\\}`, "g"), String(paramValue));
|
|
9709
|
-
});
|
|
9710
|
-
return result;
|
|
9711
|
-
}
|
|
9712
|
-
return translation;
|
|
9713
|
-
}
|
|
9714
|
-
};
|
|
9715
|
-
}, [loadedTranslations, locale]);
|
|
9716
|
-
if (translationManager) {
|
|
9717
|
-
return /* @__PURE__ */ jsx3(TranslationContext.Provider, { value: translationManager, children });
|
|
9718
|
-
}
|
|
9719
|
-
if (locale && isLoading) {
|
|
9720
|
-
return /* @__PURE__ */ jsx3(Fragment, { children: loadingComponent });
|
|
9721
|
-
}
|
|
9722
|
-
if (locale && localeManager) {
|
|
9723
|
-
return /* @__PURE__ */ jsx3(TranslationContext.Provider, { value: localeManager, children });
|
|
9724
|
-
}
|
|
9725
|
-
return /* @__PURE__ */ jsx3(TranslationContext.Provider, { value: defaultTranslationManager, children });
|
|
9726
|
-
}
|
|
9727
|
-
function useTranslations(namespace) {
|
|
9728
|
-
const context = useContext3(TranslationContext);
|
|
9729
|
-
if (!context) {
|
|
9730
|
-
return (key, params) => {
|
|
9731
|
-
const translations = en_default;
|
|
9732
|
-
const translation = translations[namespace]?.[key];
|
|
9733
|
-
if (!translation) {
|
|
9734
|
-
console.warn(`Translation not found for ${namespace}.${key}`);
|
|
9735
|
-
return `${namespace}.${key}`;
|
|
9736
|
-
}
|
|
9737
|
-
if (params && typeof translation === "string") {
|
|
9738
|
-
let result = translation;
|
|
9739
|
-
result = processPluralFormat(result, params);
|
|
9740
|
-
Object.entries(params).forEach(([paramKey, paramValue]) => {
|
|
9741
|
-
result = result.replace(new RegExp(`\\{\\{${paramKey}\\}\\}`, "g"), String(paramValue));
|
|
9742
|
-
});
|
|
9743
|
-
return result;
|
|
9744
|
-
}
|
|
9745
|
-
return translation;
|
|
9746
|
-
};
|
|
9747
|
-
}
|
|
9748
|
-
return (key, params) => context.t(namespace, key, params);
|
|
9749
|
-
}
|
|
9750
|
-
function usePreloadTranslations() {
|
|
9751
|
-
return {
|
|
9752
|
-
preload: async (locale) => {
|
|
9753
|
-
try {
|
|
9754
|
-
await loadTranslations(locale);
|
|
9755
|
-
return true;
|
|
9756
|
-
} catch (error) {
|
|
9757
|
-
console.error(`Failed to preload translations for ${locale}:`, error);
|
|
9758
|
-
return false;
|
|
9759
|
-
}
|
|
9760
|
-
},
|
|
9761
|
-
isLoaded: (locale) => translationCache.has(locale)
|
|
9762
|
-
};
|
|
9763
|
-
}
|
|
9764
|
-
|
|
9765
9489
|
// src/components/Toast.tsx
|
|
9766
|
-
import React, { useEffect
|
|
9490
|
+
import React, { useEffect, useState as useState2 } from "react";
|
|
9767
9491
|
import { createPortal } from "react-dom";
|
|
9768
|
-
import { jsx as
|
|
9492
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
9769
9493
|
var icons = {
|
|
9770
|
-
success: /* @__PURE__ */
|
|
9771
|
-
error: /* @__PURE__ */
|
|
9772
|
-
warning: /* @__PURE__ */
|
|
9773
|
-
info: /* @__PURE__ */
|
|
9494
|
+
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" }) }),
|
|
9495
|
+
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" }) }),
|
|
9496
|
+
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" }) }),
|
|
9497
|
+
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" }) })
|
|
9774
9498
|
};
|
|
9775
9499
|
function Toast({ toast, onClose }) {
|
|
9776
|
-
|
|
9500
|
+
useEffect(() => {
|
|
9777
9501
|
const timer = setTimeout(() => {
|
|
9778
9502
|
onClose(toast.id);
|
|
9779
9503
|
}, toast.duration || 3e3);
|
|
@@ -9786,15 +9510,15 @@ function Toast({ toast, onClose }) {
|
|
|
9786
9510
|
"data-variant": toast.type,
|
|
9787
9511
|
role: "alert",
|
|
9788
9512
|
children: [
|
|
9789
|
-
/* @__PURE__ */
|
|
9790
|
-
/* @__PURE__ */
|
|
9791
|
-
/* @__PURE__ */
|
|
9513
|
+
/* @__PURE__ */ jsx3("div", { className: "semiont-toast-icon-wrapper", children: icons[toast.type] }),
|
|
9514
|
+
/* @__PURE__ */ jsx3("p", { className: "semiont-toast-message", children: toast.message }),
|
|
9515
|
+
/* @__PURE__ */ jsx3(
|
|
9792
9516
|
"button",
|
|
9793
9517
|
{
|
|
9794
9518
|
onClick: () => onClose(toast.id),
|
|
9795
9519
|
className: "semiont-toast-close",
|
|
9796
9520
|
"aria-label": "Close",
|
|
9797
|
-
children: /* @__PURE__ */
|
|
9521
|
+
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" }) })
|
|
9798
9522
|
}
|
|
9799
9523
|
)
|
|
9800
9524
|
]
|
|
@@ -9802,20 +9526,20 @@ function Toast({ toast, onClose }) {
|
|
|
9802
9526
|
);
|
|
9803
9527
|
}
|
|
9804
9528
|
function ToastContainer({ toasts, onClose }) {
|
|
9805
|
-
const [mounted, setMounted] =
|
|
9806
|
-
|
|
9529
|
+
const [mounted, setMounted] = useState2(false);
|
|
9530
|
+
useEffect(() => {
|
|
9807
9531
|
setMounted(true);
|
|
9808
9532
|
return () => setMounted(false);
|
|
9809
9533
|
}, []);
|
|
9810
9534
|
if (!mounted) return null;
|
|
9811
9535
|
return createPortal(
|
|
9812
|
-
/* @__PURE__ */
|
|
9536
|
+
/* @__PURE__ */ jsx3("div", { className: "semiont-toast-container", children: toasts.map((toast) => /* @__PURE__ */ jsx3(Toast, { toast, onClose }, toast.id)) }),
|
|
9813
9537
|
document.body
|
|
9814
9538
|
);
|
|
9815
9539
|
}
|
|
9816
9540
|
var ToastContext = React.createContext(void 0);
|
|
9817
9541
|
function ToastProvider({ children }) {
|
|
9818
|
-
const [toasts, setToasts] =
|
|
9542
|
+
const [toasts, setToasts] = useState2([]);
|
|
9819
9543
|
const showToast = React.useCallback((message, type = "info", duration) => {
|
|
9820
9544
|
const id = Date.now().toString();
|
|
9821
9545
|
const newToast = duration !== void 0 ? { id, message, type, duration } : { id, message, type };
|
|
@@ -9834,7 +9558,7 @@ function ToastProvider({ children }) {
|
|
|
9834
9558
|
);
|
|
9835
9559
|
return /* @__PURE__ */ jsxs(ToastContext.Provider, { value: contextValue, children: [
|
|
9836
9560
|
children,
|
|
9837
|
-
/* @__PURE__ */
|
|
9561
|
+
/* @__PURE__ */ jsx3(ToastContainer, { toasts, onClose: handleClose })
|
|
9838
9562
|
] });
|
|
9839
9563
|
}
|
|
9840
9564
|
function useToast() {
|
|
@@ -9851,10 +9575,6 @@ export {
|
|
|
9851
9575
|
WebBrowserStorage,
|
|
9852
9576
|
SemiontProvider,
|
|
9853
9577
|
useSemiont,
|
|
9854
|
-
AVAILABLE_LOCALES,
|
|
9855
|
-
TranslationProvider,
|
|
9856
|
-
useTranslations,
|
|
9857
|
-
usePreloadTranslations,
|
|
9858
9578
|
ToastContainer,
|
|
9859
9579
|
ToastProvider,
|
|
9860
9580
|
useToast,
|
|
@@ -9973,4 +9693,4 @@ export {
|
|
|
9973
9693
|
require_zipWith,
|
|
9974
9694
|
require_cjs
|
|
9975
9695
|
};
|
|
9976
|
-
//# sourceMappingURL=chunk-
|
|
9696
|
+
//# sourceMappingURL=chunk-BTUG3VJJ.js.map
|