@stoa-dev/kit 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +80 -2
- package/dist/hooks/index.js +7 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useOnlineStatus/index.js +14 -0
- package/dist/hooks/useOnlineStatus/index.js.map +1 -0
- package/dist/hooks/useRouting/index.js +17 -0
- package/dist/hooks/useRouting/index.js.map +1 -0
- package/dist/i18n/index.js +30 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/locales/at.json.js +16 -0
- package/dist/i18n/locales/at.json.js.map +1 -0
- package/dist/i18n/locales/de.json.js +16 -0
- package/dist/i18n/locales/de.json.js.map +1 -0
- package/dist/i18n/locales/en.json.js +16 -0
- package/dist/i18n/locales/en.json.js.map +1 -0
- package/dist/i18n/locales/it.json.js +16 -0
- package/dist/i18n/locales/it.json.js.map +1 -0
- package/dist/i18n/namespace.js +5 -0
- package/dist/i18n/namespace.js.map +1 -0
- package/dist/kit.css +1 -0
- package/dist/licensing/LicenseActivation/index.js +101 -0
- package/dist/licensing/LicenseActivation/index.js.map +1 -0
- package/dist/licensing/LicenseCard/index.js +149 -0
- package/dist/licensing/LicenseCard/index.js.map +1 -0
- package/dist/licensing/LicenseGate/index.js +72 -0
- package/dist/licensing/LicenseGate/index.js.map +1 -0
- package/dist/licensing/LicenseProvider/index.js +137 -0
- package/dist/licensing/LicenseProvider/index.js.map +1 -0
- package/dist/licensing/LicenseStatusBanner/index.js +135 -0
- package/dist/licensing/LicenseStatusBanner/index.js.map +1 -0
- package/dist/licensing/api.js +57 -0
- package/dist/licensing/api.js.map +1 -0
- package/dist/licensing/index.js +23 -0
- package/dist/licensing/index.js.map +1 -0
- package/dist/shell/AppNavigation/AppNavigation.module.scss.js +16 -0
- package/dist/shell/AppNavigation/AppNavigation.module.scss.js.map +1 -0
- package/dist/shell/AppNavigation/index.js +136 -0
- package/dist/shell/AppNavigation/index.js.map +1 -0
- package/dist/shell/BackHomeButton/index.js +23 -0
- package/dist/shell/BackHomeButton/index.js.map +1 -0
- package/dist/shell/BrandLines/BrandLines.module.scss.js +10 -0
- package/dist/shell/BrandLines/BrandLines.module.scss.js.map +1 -0
- package/dist/shell/BrandLines/index.js +25 -0
- package/dist/shell/BrandLines/index.js.map +1 -0
- package/dist/shell/ConfirmDialog/index.js +53 -0
- package/dist/shell/ConfirmDialog/index.js.map +1 -0
- package/dist/shell/DatePicker/index.js +219 -0
- package/dist/shell/DatePicker/index.js.map +1 -0
- package/dist/shell/ErrorBoundary/index.js +29 -0
- package/dist/shell/ErrorBoundary/index.js.map +1 -0
- package/dist/shell/NativeSelect/index.js +24 -0
- package/dist/shell/NativeSelect/index.js.map +1 -0
- package/dist/shell/PageHeading/PageHeading.module.scss.js +8 -0
- package/dist/shell/PageHeading/PageHeading.module.scss.js.map +1 -0
- package/dist/shell/PageHeading/index.js +14 -0
- package/dist/shell/PageHeading/index.js.map +1 -0
- package/dist/shell/SectionNavigation/index.js +116 -0
- package/dist/shell/SectionNavigation/index.js.map +1 -0
- package/dist/shell/Spinner/index.js +16 -0
- package/dist/shell/Spinner/index.js.map +1 -0
- package/dist/shell/UploadButton/index.js +44 -0
- package/dist/shell/UploadButton/index.js.map +1 -0
- package/dist/shell/index.js +29 -0
- package/dist/shell/index.js.map +1 -0
- package/dist/types/hooks/index.d.ts +3 -0
- package/dist/types/hooks/index.d.ts.map +1 -0
- package/dist/types/hooks/useOnlineStatus/index.d.ts +2 -0
- package/dist/types/hooks/useOnlineStatus/index.d.ts.map +1 -0
- package/dist/types/hooks/useRouting/index.d.ts +14 -0
- package/dist/types/hooks/useRouting/index.d.ts.map +1 -0
- package/dist/types/i18n/index.d.ts +582 -0
- package/dist/types/i18n/index.d.ts.map +1 -0
- package/dist/types/i18n/namespace.d.ts +3 -0
- package/dist/types/i18n/namespace.d.ts.map +1 -0
- package/dist/types/licensing/LicenseActivation/index.d.ts +8 -0
- package/dist/types/licensing/LicenseActivation/index.d.ts.map +1 -0
- package/dist/types/licensing/LicenseCard/index.d.ts +2 -0
- package/dist/types/licensing/LicenseCard/index.d.ts.map +1 -0
- package/dist/types/licensing/LicenseGate/index.d.ts +11 -0
- package/dist/types/licensing/LicenseGate/index.d.ts.map +1 -0
- package/dist/types/licensing/LicenseProvider/index.d.ts +20 -0
- package/dist/types/licensing/LicenseProvider/index.d.ts.map +1 -0
- package/dist/types/licensing/LicenseStatusBanner/index.d.ts +4 -0
- package/dist/types/licensing/LicenseStatusBanner/index.d.ts.map +1 -0
- package/dist/types/licensing/api.d.ts +28 -0
- package/dist/types/licensing/api.d.ts.map +1 -0
- package/dist/types/licensing/index.d.ts +7 -0
- package/dist/types/licensing/index.d.ts.map +1 -0
- package/dist/types/shell/AppNavigation/index.d.ts +45 -0
- package/dist/types/shell/AppNavigation/index.d.ts.map +1 -0
- package/dist/types/shell/BackHomeButton/index.d.ts +7 -0
- package/dist/types/shell/BackHomeButton/index.d.ts.map +1 -0
- package/dist/types/shell/BrandLines/index.d.ts +6 -0
- package/dist/types/shell/BrandLines/index.d.ts.map +1 -0
- package/dist/types/shell/ConfirmDialog/index.d.ts +21 -0
- package/dist/types/shell/ConfirmDialog/index.d.ts.map +1 -0
- package/dist/types/shell/DatePicker/index.d.ts +14 -0
- package/dist/types/shell/DatePicker/index.d.ts.map +1 -0
- package/dist/types/shell/ErrorBoundary/index.d.ts +20 -0
- package/dist/types/shell/ErrorBoundary/index.d.ts.map +1 -0
- package/dist/types/shell/NativeSelect/index.d.ts +3 -0
- package/dist/types/shell/NativeSelect/index.d.ts.map +1 -0
- package/dist/types/shell/PageHeading/index.d.ts +9 -0
- package/dist/types/shell/PageHeading/index.d.ts.map +1 -0
- package/dist/types/shell/SectionNavigation/index.d.ts +12 -0
- package/dist/types/shell/SectionNavigation/index.d.ts.map +1 -0
- package/dist/types/shell/Spinner/index.d.ts +6 -0
- package/dist/types/shell/Spinner/index.d.ts.map +1 -0
- package/dist/types/shell/UploadButton/index.d.ts +6 -0
- package/dist/types/shell/UploadButton/index.d.ts.map +1 -0
- package/dist/types/shell/index.d.ts +12 -0
- package/dist/types/shell/index.d.ts.map +1 -0
- package/dist/types/ui/accordion/index.d.ts +8 -0
- package/dist/types/ui/accordion/index.d.ts.map +1 -0
- package/dist/types/ui/button/index.d.ts +11 -0
- package/dist/types/ui/button/index.d.ts.map +1 -0
- package/dist/types/ui/calendar/index.d.ts +11 -0
- package/dist/types/ui/calendar/index.d.ts.map +1 -0
- package/dist/types/ui/card/index.d.ts +12 -0
- package/dist/types/ui/card/index.d.ts.map +1 -0
- package/dist/types/ui/dialog/index.d.ts +18 -0
- package/dist/types/ui/dialog/index.d.ts.map +1 -0
- package/dist/types/ui/dropdown-menu/index.d.ts +30 -0
- package/dist/types/ui/dropdown-menu/index.d.ts.map +1 -0
- package/dist/types/ui/field/index.d.ts +25 -0
- package/dist/types/ui/field/index.d.ts.map +1 -0
- package/dist/types/ui/index.d.ts +21 -0
- package/dist/types/ui/index.d.ts.map +1 -0
- package/dist/types/ui/input/index.d.ts +4 -0
- package/dist/types/ui/input/index.d.ts.map +1 -0
- package/dist/types/ui/input-group/index.d.ts +17 -0
- package/dist/types/ui/input-group/index.d.ts.map +1 -0
- package/dist/types/ui/label/index.d.ts +5 -0
- package/dist/types/ui/label/index.d.ts.map +1 -0
- package/dist/types/ui/popover/index.d.ts +11 -0
- package/dist/types/ui/popover/index.d.ts.map +1 -0
- package/dist/types/ui/radio-group/index.d.ts +6 -0
- package/dist/types/ui/radio-group/index.d.ts.map +1 -0
- package/dist/types/ui/scroll-area/index.d.ts +6 -0
- package/dist/types/ui/scroll-area/index.d.ts.map +1 -0
- package/dist/types/ui/select/index.d.ts +16 -0
- package/dist/types/ui/select/index.d.ts.map +1 -0
- package/dist/types/ui/separator/index.d.ts +5 -0
- package/dist/types/ui/separator/index.d.ts.map +1 -0
- package/dist/types/ui/sonner/index.d.ts +4 -0
- package/dist/types/ui/sonner/index.d.ts.map +1 -0
- package/dist/types/ui/switch/index.d.ts +7 -0
- package/dist/types/ui/switch/index.d.ts.map +1 -0
- package/dist/types/ui/textarea/index.d.ts +4 -0
- package/dist/types/ui/textarea/index.d.ts.map +1 -0
- package/dist/types/ui/toggle/index.d.ts +10 -0
- package/dist/types/ui/toggle/index.d.ts.map +1 -0
- package/dist/types/ui/tooltip/index.d.ts +8 -0
- package/dist/types/ui/tooltip/index.d.ts.map +1 -0
- package/dist/types/utils/cn.d.ts +3 -0
- package/dist/types/utils/cn.d.ts.map +1 -0
- package/dist/types/utils/colors.d.ts +3 -0
- package/dist/types/utils/colors.d.ts.map +1 -0
- package/dist/types/utils/dates.d.ts +9 -0
- package/dist/types/utils/dates.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +4 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/ui/accordion/index.js +65 -0
- package/dist/ui/accordion/index.js.map +1 -0
- package/dist/ui/button/index.js +57 -0
- package/dist/ui/button/index.js.map +1 -0
- package/dist/ui/calendar/index.js +179 -0
- package/dist/ui/calendar/index.js.map +1 -0
- package/dist/ui/card/index.js +102 -0
- package/dist/ui/card/index.js.map +1 -0
- package/dist/ui/dialog/index.js +158 -0
- package/dist/ui/dialog/index.js.map +1 -0
- package/dist/ui/dropdown-menu/index.js +252 -0
- package/dist/ui/dropdown-menu/index.js.map +1 -0
- package/dist/ui/field/index.js +209 -0
- package/dist/ui/field/index.js.map +1 -0
- package/dist/ui/index.js +112 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/input/index.js +20 -0
- package/dist/ui/input/index.js.map +1 -0
- package/dist/ui/input-group/index.js +143 -0
- package/dist/ui/input-group/index.js.map +1 -0
- package/dist/ui/label/index.js +23 -0
- package/dist/ui/label/index.js.map +1 -0
- package/dist/ui/popover/index.js +81 -0
- package/dist/ui/popover/index.js.map +1 -0
- package/dist/ui/radio-group/index.js +45 -0
- package/dist/ui/radio-group/index.js.map +1 -0
- package/dist/ui/scroll-area/index.js +60 -0
- package/dist/ui/scroll-area/index.js.map +1 -0
- package/dist/ui/select/index.js +182 -0
- package/dist/ui/select/index.js.map +1 -0
- package/dist/ui/separator/index.js +27 -0
- package/dist/ui/separator/index.js.map +1 -0
- package/dist/ui/sonner/index.js +37 -0
- package/dist/ui/sonner/index.js.map +1 -0
- package/dist/ui/switch/index.js +32 -0
- package/dist/ui/switch/index.js.map +1 -0
- package/dist/ui/textarea/index.js +19 -0
- package/dist/ui/textarea/index.js.map +1 -0
- package/dist/ui/toggle/index.js +44 -0
- package/dist/ui/toggle/index.js.map +1 -0
- package/dist/ui/tooltip/index.js +56 -0
- package/dist/ui/tooltip/index.js.map +1 -0
- package/dist/utils/cn.js +9 -0
- package/dist/utils/cn.js.map +1 -0
- package/dist/utils/colors.js +8 -0
- package/dist/utils/colors.js.map +1 -0
- package/dist/utils/dates.js +28 -0
- package/dist/utils/dates.js.map +1 -0
- package/dist/utils/index.js +12 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +112 -4
- package/scss/_index.scss +4 -0
- package/scss/_tools.scss +21 -0
- package/styles/theme.css +192 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ruben Giannotti
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,81 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @stoa-dev/kit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Gemeinsame React-Komponenten, Hooks, Hilfsfunktionen, Lizenz-UI und Theme der STOA-Desktop-Apps.
|
|
4
|
+
|
|
5
|
+
| Import | Inhalt |
|
|
6
|
+
|---|---|
|
|
7
|
+
| `@stoa-dev/kit/ui` | shadcn-Primitives (Button, Dialog, Select, Calendar, …) |
|
|
8
|
+
| `@stoa-dev/kit/shell` | AppNavigation, SectionNavigation, PageHeading, BrandLines, Spinner, BackHomeButton, ErrorBoundary, ConfirmDialog, DatePickerInput, NativeSelect, UploadButton |
|
|
9
|
+
| `@stoa-dev/kit/licensing` | LicenseProvider/`useLicense`, LicenseGate, LicenseCard, LicenseActivation, LicenseStatusBanner, Tauri-API |
|
|
10
|
+
| `@stoa-dev/kit/hooks` | `useOnlineStatus`, `useRouting<Route>()` |
|
|
11
|
+
| `@stoa-dev/kit/utils` | `cn`, `formatDate`, `formatTimestamp`, `parseHexColor`, … |
|
|
12
|
+
| `@stoa-dev/kit/i18n` | `registerStoaLocales`, `supportedLanguages`, Namespace `stoa` (de, de-AT, en, it) |
|
|
13
|
+
| `@stoa-dev/kit/theme.css` | Tailwind-4-Tokens (shadcn-Variablen + STOA-Extras), Quelle für die App-Tailwind |
|
|
14
|
+
| `@stoa-dev/kit/styles.css` | Kompilierte SCSS-Module der Komponenten |
|
|
15
|
+
| `@stoa-dev/kit/scss` | SCSS-Werkzeuge (`reduced-motion`, `dark`, `accent-mix`, …) für App-Module |
|
|
16
|
+
|
|
17
|
+
## Einbindung in eine App
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm i @stoa-dev/kit sass-embedded
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```css
|
|
24
|
+
/* src/App.css */
|
|
25
|
+
@import "tailwindcss";
|
|
26
|
+
@import "tw-animate-css";
|
|
27
|
+
@import "shadcn/tailwind.css";
|
|
28
|
+
@import "@stoa-dev/kit/theme.css";
|
|
29
|
+
@import "@stoa-dev/kit/styles.css";
|
|
30
|
+
@source "../node_modules/@stoa-dev/kit/dist"; /* Tailwind 4 scannt node_modules nicht von selbst */
|
|
31
|
+
|
|
32
|
+
:root { --stoa-accent: #0093af; } /* Akzent je App */
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
// src/i18n.ts – nach i18next.init(...)
|
|
37
|
+
import { registerStoaLocales } from '@stoa-dev/kit/i18n'
|
|
38
|
+
registerStoaLocales(i18next)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
// App-Navigation
|
|
43
|
+
import { AppNavigation, AppNavigationThemeToggle } from '@stoa-dev/kit/shell'
|
|
44
|
+
|
|
45
|
+
<AppNavigation
|
|
46
|
+
logo='/practicr.svg'
|
|
47
|
+
groups={[
|
|
48
|
+
[{ path: '/', label: t('common.app.home'), Icon: Home }],
|
|
49
|
+
[<AppNavigationThemeToggle key='theme' theme={settings.theme} onToggle={saveTheme} disabled={!canWrite} />],
|
|
50
|
+
[{ path: '/settings', label: t('common.app.settings'), Icon: Settings }],
|
|
51
|
+
]}
|
|
52
|
+
/>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
// Lizenz-Gate mit Startup-Overlay der App
|
|
57
|
+
<LicenseProvider>
|
|
58
|
+
<LicenseGate onInteractionRequired={finishStartup}>…</LicenseGate>
|
|
59
|
+
</LicenseProvider>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Konventionen
|
|
63
|
+
|
|
64
|
+
- **Ein Ordner je Komponente**: `Name/index.tsx` und optional `Name/Name.module.scss`.
|
|
65
|
+
- **Tailwind liefert Layout und Abstände**, SCSS-Module den eigenen Anstrich (Pseudo-Elemente,
|
|
66
|
+
Animationen, Zustände). Farben immer über CSS-Variablen, damit Theming zur Laufzeit greift.
|
|
67
|
+
- Klassen aus Modulen heißen `stoa-<Komponente>-<klasse>-<hash>` und lassen sich so in Apps gezielt
|
|
68
|
+
überschreiben.
|
|
69
|
+
- Keine App-Imports (`@/…`) im Paket: App-Spezifisches kommt über Props/Callbacks herein.
|
|
70
|
+
- Texte liegen im i18next-Namespace `stoa`; einzelne Strings überschreibt eine App mit
|
|
71
|
+
`registerStoaLocales(i18next, { de: { app: { back: 'Zurück' } } })`.
|
|
72
|
+
|
|
73
|
+
## Lokale Entwicklung
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
cd stoa-dev && npm run dev # baut bei Änderungen neu
|
|
77
|
+
cd ../practicr && npm link ../stoa-dev/packages/kit
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Vite: Bei verlinkten Paketen `resolve.dedupe: ['react', 'react-dom', 'react-router', 'i18next', 'react-i18next']`
|
|
81
|
+
setzen, damit Kontext-Provider (Router, i18n) nicht doppelt geladen werden.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useState as o, useEffect as r } from "react";
|
|
2
|
+
function f() {
|
|
3
|
+
const [i, n] = o(navigator.onLine);
|
|
4
|
+
return r(() => {
|
|
5
|
+
const e = () => n(!0), t = () => n(!1);
|
|
6
|
+
return window.addEventListener("online", e), window.addEventListener("offline", t), () => {
|
|
7
|
+
window.removeEventListener("online", e), window.removeEventListener("offline", t);
|
|
8
|
+
};
|
|
9
|
+
}, []), i;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
f as useOnlineStatus
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/hooks/useOnlineStatus/index.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n\nexport function useOnlineStatus(): boolean {\n\tconst [isOnline, setIsOnline] = useState(navigator.onLine)\n\n\tuseEffect(() => {\n\t\tconst onOnline = () => setIsOnline(true)\n\t\tconst onOffline = () => setIsOnline(false)\n\n\t\twindow.addEventListener('online', onOnline)\n\t\twindow.addEventListener('offline', onOffline)\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener('online', onOnline)\n\t\t\twindow.removeEventListener('offline', onOffline)\n\t\t}\n\t}, [])\n\n\treturn isOnline\n}\n"],"names":["useOnlineStatus","isOnline","setIsOnline","useState","useEffect","onOnline","onOffline"],"mappings":";AAEO,SAASA,IAA2B;AAC1C,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAS,UAAU,MAAM;AAEzD,SAAAC,EAAU,MAAM;AACf,UAAMC,IAAW,MAAMH,EAAY,EAAI,GACjCI,IAAY,MAAMJ,EAAY,EAAK;AAEzC,kBAAO,iBAAiB,UAAUG,CAAQ,GAC1C,OAAO,iBAAiB,WAAWC,CAAS,GAErC,MAAM;AACZ,aAAO,oBAAoB,UAAUD,CAAQ,GAC7C,OAAO,oBAAoB,WAAWC,CAAS;AAAA,IAChD;AAAA,EACD,GAAG,CAAA,CAAE,GAEEL;AACR;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useCallback as r } from "react";
|
|
2
|
+
import { useNavigate as c } from "react-router";
|
|
3
|
+
function p(e = "/") {
|
|
4
|
+
const t = c(), o = r(
|
|
5
|
+
(n, u) => {
|
|
6
|
+
t(n, { replace: u?.replace ?? !0 });
|
|
7
|
+
},
|
|
8
|
+
[t]
|
|
9
|
+
), a = r(() => {
|
|
10
|
+
o(e);
|
|
11
|
+
}, [o, e]);
|
|
12
|
+
return { routeTo: o, routeToDefault: a };
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
p as useRouting
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/hooks/useRouting/index.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport { useNavigate } from 'react-router'\n\n/**\n * Typed navigation helper. Apps bind their own route union once:\n *\n * ```ts\n * export const useAppRouting = () => useRouting<RegisteredRoutes>('/')\n * ```\n */\nexport function useRouting<Route extends string = string>(\n\tdefaultRoute = '/' as Route,\n) {\n\tconst navigate = useNavigate()\n\n\tconst routeTo = useCallback(\n\t\t(route: Route, options?: { replace?: boolean }) => {\n\t\t\tvoid navigate(route, { replace: options?.replace ?? true })\n\t\t},\n\t\t[navigate],\n\t)\n\n\tconst routeToDefault = useCallback(() => {\n\t\trouteTo(defaultRoute)\n\t}, [routeTo, defaultRoute])\n\n\treturn { routeTo, routeToDefault }\n}\n"],"names":["useRouting","defaultRoute","navigate","useNavigate","routeTo","useCallback","route","options","routeToDefault"],"mappings":";;AAUO,SAASA,EACfC,IAAe,KACd;AACD,QAAMC,IAAWC,EAAA,GAEXC,IAAUC;AAAA,IACf,CAACC,GAAcC,MAAoC;AAClD,MAAKL,EAASI,GAAO,EAAE,SAASC,GAAS,WAAW,IAAM;AAAA,IAC3D;AAAA,IACA,CAACL,CAAQ;AAAA,EAAA,GAGJM,IAAiBH,EAAY,MAAM;AACxC,IAAAD,EAAQH,CAAY;AAAA,EACrB,GAAG,CAACG,GAASH,CAAY,CAAC;AAE1B,SAAO,EAAE,SAAAG,GAAS,gBAAAI,EAAA;AACnB;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import s from "./locales/at.json.js";
|
|
2
|
+
import u from "./locales/de.json.js";
|
|
3
|
+
import i from "./locales/en.json.js";
|
|
4
|
+
import n from "./locales/it.json.js";
|
|
5
|
+
import { STOA_NS as t } from "./namespace.js";
|
|
6
|
+
const c = {
|
|
7
|
+
de: u,
|
|
8
|
+
en: i,
|
|
9
|
+
"de-AT": s,
|
|
10
|
+
it: n
|
|
11
|
+
}, g = [
|
|
12
|
+
{ value: "en", label: "English" },
|
|
13
|
+
{ value: "de", label: "Deutsch" },
|
|
14
|
+
{ value: "de-AT", label: "Österreichisch" },
|
|
15
|
+
{ value: "it", label: "Italiano" }
|
|
16
|
+
];
|
|
17
|
+
function v(o, a = {}) {
|
|
18
|
+
for (const [e, l] of Object.entries(c)) {
|
|
19
|
+
o.addResourceBundle(e, t, l, !0, !1);
|
|
20
|
+
const r = a[e];
|
|
21
|
+
r && o.addResourceBundle(e, t, r, !0, !0);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
t as STOA_NS,
|
|
26
|
+
v as registerStoaLocales,
|
|
27
|
+
c as stoaResources,
|
|
28
|
+
g as supportedLanguages
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/i18n/index.ts"],"sourcesContent":["import type { i18n as I18n } from 'i18next'\nimport at from './locales/at.json'\nimport de from './locales/de.json'\nimport en from './locales/en.json'\nimport it from './locales/it.json'\nimport { STOA_NS } from './namespace'\n\nexport { STOA_NS }\n\nexport const stoaResources = {\n\tde,\n\ten,\n\t'de-AT': at,\n\tit,\n} as const\n\nexport const supportedLanguages = [\n\t{ value: 'en', label: 'English' },\n\t{ value: 'de', label: 'Deutsch' },\n\t{ value: 'de-AT', label: 'Österreichisch' },\n\t{ value: 'it', label: 'Italiano' },\n] as const\n\nexport type SupportedLanguage = (typeof supportedLanguages)[number]['value']\n\n/**\n * Adds the @stoa-dev/kit strings as the `stoa` namespace. Call once after `i18next.init()`.\n * App strings keep living in the app's own `translation` namespace.\n * Pass `overrides` to adjust single strings per app without forking the bundle.\n */\nexport function registerStoaLocales(\n\ti18n: I18n,\n\toverrides: Partial<Record<SupportedLanguage, Record<string, unknown>>> = {},\n) {\n\tfor (const [language, bundle] of Object.entries(stoaResources)) {\n\t\ti18n.addResourceBundle(language, STOA_NS, bundle, true, false)\n\t\tconst override = overrides[language as SupportedLanguage]\n\t\tif (override)\n\t\t\ti18n.addResourceBundle(language, STOA_NS, override, true, true)\n\t}\n}\n"],"names":["stoaResources","de","en","at","it","supportedLanguages","registerStoaLocales","i18n","overrides","language","bundle","STOA_NS","override"],"mappings":";;;;;AASO,MAAMA,IAAgB;AAAA,EAC5B,IAAAC;AAAA,EACA,IAAAC;AAAA,EACA,SAASC;AAAA,EACT,IAAAC;AACD,GAEaC,IAAqB;AAAA,EACjC,EAAE,OAAO,MAAM,OAAO,UAAA;AAAA,EACtB,EAAE,OAAO,MAAM,OAAO,UAAA;AAAA,EACtB,EAAE,OAAO,SAAS,OAAO,iBAAA;AAAA,EACzB,EAAE,OAAO,MAAM,OAAO,WAAA;AACvB;AASO,SAASC,EACfC,GACAC,IAAyE,IACxE;AACD,aAAW,CAACC,GAAUC,CAAM,KAAK,OAAO,QAAQV,CAAa,GAAG;AAC/D,IAAAO,EAAK,kBAAkBE,GAAUE,GAASD,GAAQ,IAAM,EAAK;AAC7D,UAAME,IAAWJ,EAAUC,CAA6B;AACxD,IAAIG,KACHL,EAAK,kBAAkBE,GAAUE,GAASC,GAAU,IAAM,EAAI;AAAA,EAChE;AACD;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const e = { cancel: "Obbrechn", close: "Zumachn" }, n = { back: "Zruck zur Startseitn", errorDescription: "Start de Oberfläche neu und probier’s no amoi.", errorTitle: "Do is wos schiefganga.", loadingApp: "App vorbereitn …", navigation: "Hauptnavigation", restart: "Neu ladn", switchTheme: "Aussehn wechseln" }, i = { selectDate: "Datum aussuachn", today: "Heit", nextMonth: "Nächster Monat", previousMonth: "Voriger Monat", chooseMonth: "Monat aussuachn", chooseYear: "Joahr aussuachn", navigation: "Kalendernavigation", selected: "ausgsuacht" }, r = { checking: "Wird grad prüft …", checkAgain: "No amoi prüfen", gate: { loading: "Lizenz und Gerätestatus werdn grad prüft …", failed: "De Lizenzprüfung hat ned funktioniert.", activationRequired: "De bisherige Aktivierung is nimmer gültig. Aktivier de Installation bitte no amoi. Dei Daten bleiben erhalten.", readOnly: "Vorhandene Daten anschaun und exportieren" }, activation: { title: "App aktivieren", renew: "Aktivierung erneuern", description: "Gib deinen Aktivierungscode ein, damit de Installation mit deiner Lizenz verbunden wird.", replacementDescription: "Gib an neichen Aktivierungscode für de bisherige oder a andere gültige Lizenz ein. Dei Daten bleiben erhalten. De bisherige Aktivierung wird erst nach erfolgreicher Aktivierung ersetzt.", replacementNotice: "De bestehende Aktivierung wird erst nach erfolgreicher Prüfung ersetzt.", code: "Aktivierungscode", deviceName: "Gerätename", devicePlaceholder: "Mein Gerät", defaultDeviceName: "Mein Gerät", pending: "Aktivierung lauft …", submit: "Lizenz aktivieren" }, banner: { readOnlyTitle: "Schreibgschützter Modus", refreshFailed: "Lizenzaktualisierung geht grad ned", retryStorage: "Speichern no amoi probiern", readOnlyDescription: "Du kannst vorhandene Daten weiter anschaun und exportieren. Neich anlegen und Ändern san gsperrt.", persistencePending: "Da gsperrte Lizenzstatus hat si no ned vollständig speichern lassn. Des Gerät bleibt gsperrt. Probier’s Speichern bitte no amoi." }, errors: { activationRequired: "De bisherige Aktivierung is am Lizenzserver nimmer gültig. Gib bitte an neichen Aktivierungscode ein.", network: "Da Lizenzserver is grad ned erreichbar. De lokale Gültigkeit bleibt unverändert.", deviceRevoked: "De Aktivierung von dem Gerät is widerrufen worden.", licenseRevoked: "De Lizenz is widerrufen worden.", storage: "Da lokale Lizenzstatus hat si ned sicher lesen oder speichern lassn.", certificate: "Da Lizenznachweis is ungültig.", alreadyActivated: "De Installation is scho aktiviert.", api: "Da Lizenzserver hat d’Aktivierung oder Aktualisierung abglehnt. Prüf den Code und den Status von da Lizenz.", protocol: "De Antwort vom Lizenzserver hat si ned verarbeiten lassn.", unactivated: "De Installation is no ned aktiviert.", stateChanged: "Da Lizenzstatus hat si inzwischen gändert. Prüf ihn bitte no amoi.", synchronization: "De Lizenzsynchronisierung is grad ned verfügbar. Probier’s bitte no amoi.", readOnly: "Für de Aktion brauchst a gültige Aktivierung. Vorhandene Daten kannst weiter anschaun und exportieren.", featureDenied: "De Funktion is in deiner Lizenz ned freigschaltet.", unknown: "De Lizenzprüfung hat ned funktioniert. Probier’s bitte no amoi." } }, t = { title: "Lizenz", checking: "Lizenz wird grad prüft …", unknown: "Ned verfügbar", plan: "Tarif", licenseTerm: "Laufzeit von da kauften Lizenz", termUnknown: "Vom Server ned mitgschickt", certificateExpires: "Aktueller Nachweis gültig bis", nextSync: "Nächste Synchronisierung", syncDue: "Fällig seit {{date}}", noSyncScheduled: "Grad ka automatischer Termin", features: "Funktionen laut Lizenznachweis", noFeatures: "Im aktuellen Nachweis san kane Funktionen verfügbar.", validityHint: "De Gültigkeit vom Nachweis begrenzt d’Offline-Nutzung. Sein Ablaufdatum heißt ned automatisch, dass dei kaufte Lizenz endet. De tatsächliche Lizenzlaufzeit wird grad ned extra mitgschickt.", synchronize: "Lizenz synchronisieren", syncing: "Wird synchronisiert …", synchronized: "Lizenzstatus aktualisiert.", persistencePending: "Da gsperrte Lizenzstatus hat si no ned vollständig speichern lassn. Bitte synchronisier no amoi.", deviceDetails: "Erweiterte Gerätedetails", deviceId: "Aktuelle Geräte-ID", noDevice: "No ka Geräteaktivierung vorhanden.", deviceReleaseHint: "A Gerätefreigabe gibt’s in da App no ned. Wennst lokale Lizenzdaten löschst, wird am Server ka Geräteplatz frei.", status: { active: { label: "Aktiv", description: "Dei signierter Lizenznachweis is gültig. Du kannst d’App ganz normal verwenden." }, offline_grace: { label: "Offline gültig", description: "Da vorhandene Nachweis erlaubt weiter d’lokale Nutzung. A Synchronisierung is fällig; verlängert wird da Nachweis erst nach erfolgreicher Serverprüfung." }, expired: { label: "Nachweis abglaufen", description: "Dei lokaler Lizenznachweis is abglaufen. Synchronisier, damitst an neichen kriagst. Ob dei kaufte Lizenz aa abglaufen is, lässt si daraus allein ned sagen. Vorhandene Daten kannst weiter anschaun und exportieren." }, revoked: { label: "Geräteaktivierung widerrufen", description: "De Aktivierung von dem Gerät is widerrufen worden. Änderungen san gsperrt; vorhandene Daten kannst weiter anschaun und exportieren." }, license_revoked: { label: "Lizenz widerrufen", description: "Da Server hat den Widerruf von dera Lizenz bestätigt. Änderungen san gsperrt; vorhandene Daten kannst weiter anschaun und exportieren." }, unactivated: { label: "Ned aktiviert", description: "De Installation is no kana Lizenz zugeordnet. Zum Verwenden brauchst an Aktivierungscode." }, activation_required: { label: "Aktivierung nötig", description: "De bisherige Zuordnung am Server fehlt oder passt nimmer zu dera Installation. Erneuer d’Aktivierung. Dei vorhandenen Daten bleiben erhalten." }, invalid: { label: "Ned überprüfbar", description: "Da lokale Nachweis lässt si grad ned zuverlässig prüfen. Änderungen bleiben gsperrt. Synchronisier, damit da Lizenzstatus no amoi prüft wird." } }, plans: { trial: "Testversion", personal: "Personal", professional: "Professional", lifetime: "Lifetime" }, featureLabels: { all_features: "Alle Funktionen", core: "Grundfunktionen" } }, a = {
|
|
2
|
+
actions: e,
|
|
3
|
+
app: n,
|
|
4
|
+
datePicker: i,
|
|
5
|
+
licensing: r,
|
|
6
|
+
licenseProfile: t
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
e as actions,
|
|
10
|
+
n as app,
|
|
11
|
+
i as datePicker,
|
|
12
|
+
a as default,
|
|
13
|
+
t as licenseProfile,
|
|
14
|
+
r as licensing
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=at.json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"at.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const e = { cancel: "Abbrechen", close: "Schließen" }, i = { back: "Zurück zur Startseite", errorDescription: "Starte die Oberfläche neu und versuche es erneut.", errorTitle: "Etwas ist schiefgelaufen.", loadingApp: "App vorbereiten …", navigation: "Hauptnavigation", restart: "Neu laden", switchTheme: "Darstellung wechseln" }, n = { selectDate: "Datum auswählen", today: "Heute", nextMonth: "Nächster Monat", previousMonth: "Vorheriger Monat", chooseMonth: "Monat auswählen", chooseYear: "Jahr auswählen", navigation: "Kalendernavigation", selected: "ausgewählt" }, r = { checking: "Wird geprüft …", checkAgain: "Erneut prüfen", gate: { loading: "Lizenz und Gerätestatus werden geprüft …", failed: "Die Lizenzprüfung ist fehlgeschlagen.", activationRequired: "Die bisherige Aktivierung ist nicht mehr gültig. Bitte aktiviere diese Installation erneut. Deine Daten bleiben erhalten.", readOnly: "Vorhandene Daten ansehen und exportieren" }, activation: { title: "App aktivieren", renew: "Aktivierung erneuern", description: "Gib deinen Aktivierungscode ein, um diese Installation mit deiner Lizenz zu verbinden.", replacementDescription: "Gib einen neuen Aktivierungscode für die bisherige oder eine andere gültige Lizenz ein. Deine Daten bleiben erhalten. Erst nach erfolgreicher Aktivierung wird die bisherige Aktivierung ersetzt.", replacementNotice: "Die bestehende Aktivierung wird erst nach erfolgreicher Prüfung ersetzt.", code: "Aktivierungscode", deviceName: "Gerätename", devicePlaceholder: "Mein Gerät", defaultDeviceName: "Mein Gerät", pending: "Aktivierung läuft …", submit: "Lizenz aktivieren" }, banner: { readOnlyTitle: "Schreibgeschützter Modus", refreshFailed: "Lizenzaktualisierung nicht möglich", retryStorage: "Speicherung erneut versuchen", readOnlyDescription: "Du kannst vorhandene Daten weiterhin ansehen und exportieren. Das Erstellen und Ändern ist gesperrt.", persistencePending: "Der gesperrte Lizenzstatus konnte noch nicht vollständig gespeichert werden. Dieses Gerät bleibt gesperrt. Bitte versuche die Speicherung erneut." }, errors: { activationRequired: "Die bisherige Aktivierung ist auf dem Lizenzserver nicht mehr gültig. Bitte gib einen neuen Aktivierungscode ein.", network: "Der Lizenzserver ist derzeit nicht erreichbar. Die lokale Gültigkeit bleibt unverändert.", deviceRevoked: "Die Aktivierung dieses Geräts wurde widerrufen.", licenseRevoked: "Diese Lizenz wurde widerrufen.", storage: "Der lokale Lizenzzustand konnte nicht sicher gelesen oder gespeichert werden.", certificate: "Der Lizenznachweis ist ungültig.", alreadyActivated: "Diese Installation ist bereits aktiviert.", api: "Der Lizenzserver hat die Aktivierung oder Aktualisierung abgelehnt. Prüfe den Code und den Status der Lizenz.", protocol: "Die Antwort des Lizenzservers konnte nicht verarbeitet werden.", unactivated: "Diese Installation ist noch nicht aktiviert.", stateChanged: "Der Lizenzzustand wurde inzwischen geändert. Bitte prüfe ihn erneut.", synchronization: "Die Lizenzsynchronisierung ist derzeit nicht verfügbar. Bitte versuche es erneut.", readOnly: "Für diese Aktion ist eine gültige Aktivierung erforderlich. Vorhandene Daten bleiben lesbar und exportierbar.", featureDenied: "Diese Funktion ist in deiner Lizenz nicht freigeschaltet.", unknown: "Die Lizenzprüfung ist fehlgeschlagen. Bitte versuche es erneut." } }, t = { title: "Lizenz", checking: "Lizenz wird geprüft …", unknown: "Nicht verfügbar", plan: "Tarif", licenseTerm: "Laufzeit der gekauften Lizenz", termUnknown: "Vom Server nicht übermittelt", certificateExpires: "Aktueller Nachweis gültig bis", nextSync: "Nächste Synchronisierung", syncDue: "Fällig seit {{date}}", noSyncScheduled: "Derzeit kein automatischer Termin", features: "Funktionen laut Lizenznachweis", noFeatures: "Keine Funktionen im aktuellen Nachweis verfügbar.", validityHint: "Die Gültigkeit des Nachweises begrenzt die Offline-Nutzung. Sein Ablaufdatum ist nicht automatisch das Ende deiner gekauften Lizenz. Die tatsächliche Lizenzlaufzeit wird derzeit nicht separat übermittelt.", synchronize: "Lizenz synchronisieren", syncing: "Wird synchronisiert …", synchronized: "Lizenzstatus aktualisiert.", persistencePending: "Der gesperrte Lizenzstatus konnte noch nicht vollständig gespeichert werden. Bitte synchronisiere erneut.", deviceDetails: "Erweiterte Gerätedetails", deviceId: "Aktuelle Geräte-ID", noDevice: "Noch keine Geräteaktivierung vorhanden.", deviceReleaseHint: "Eine Gerätefreigabe ist in dieser App noch nicht verfügbar. Das Löschen lokaler Lizenzdaten gibt keinen Geräteplatz auf dem Server frei.", status: { active: { label: "Aktiv", description: "Dein signierter Lizenznachweis ist gültig. Die App kann regulär genutzt werden." }, offline_grace: { label: "Offline gültig", description: "Der vorhandene Nachweis erlaubt weiterhin die lokale Nutzung. Eine Synchronisierung ist fällig; sie verlängert den Nachweis nur nach erfolgreicher Serverprüfung." }, expired: { label: "Nachweis abgelaufen", description: "Der lokale Lizenznachweis ist abgelaufen. Synchronisiere, um einen neuen Nachweis zu erhalten. Ob deine gekaufte Lizenz ebenfalls abgelaufen ist, lässt sich daraus allein nicht ableiten. Vorhandene Daten bleiben lesbar und exportierbar." }, revoked: { label: "Geräteaktivierung widerrufen", description: "Die Aktivierung dieses Geräts wurde widerrufen. Änderungen sind gesperrt; vorhandene Daten bleiben lesbar und exportierbar." }, license_revoked: { label: "Lizenz widerrufen", description: "Der Server hat den Widerruf dieser Lizenz bestätigt. Änderungen sind gesperrt; vorhandene Daten bleiben lesbar und exportierbar." }, unactivated: { label: "Nicht aktiviert", description: "Diese Installation ist noch keiner Lizenz zugeordnet. Für die Nutzung ist ein Aktivierungscode erforderlich." }, activation_required: { label: "Aktivierung erforderlich", description: "Die bisherige Zuordnung auf dem Server fehlt oder passt nicht mehr zu dieser Installation. Erneuere die Aktivierung. Vorhandene Daten bleiben erhalten." }, invalid: { label: "Nicht überprüfbar", description: "Der lokale Nachweis kann derzeit nicht zuverlässig geprüft werden. Änderungen bleiben gesperrt. Synchronisiere, um den Lizenzstatus erneut zu prüfen." } }, plans: { trial: "Testversion", personal: "Personal", professional: "Professional", lifetime: "Lifetime" }, featureLabels: { all_features: "Alle Funktionen", core: "Grundfunktionen" } }, a = {
|
|
2
|
+
actions: e,
|
|
3
|
+
app: i,
|
|
4
|
+
datePicker: n,
|
|
5
|
+
licensing: r,
|
|
6
|
+
licenseProfile: t
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
e as actions,
|
|
10
|
+
i as app,
|
|
11
|
+
n as datePicker,
|
|
12
|
+
a as default,
|
|
13
|
+
t as licenseProfile,
|
|
14
|
+
r as licensing
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=de.json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"de.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const e = { cancel: "Cancel", close: "Close" }, i = { back: "Back to home", errorDescription: "Reload the interface and try again.", errorTitle: "Something went wrong.", loadingApp: "Preparing app …", navigation: "Main navigation", restart: "Reload", switchTheme: "Change appearance" }, a = { selectDate: "Select date", today: "Today", nextMonth: "Next month", previousMonth: "Previous month", chooseMonth: "Choose month", chooseYear: "Choose year", navigation: "Calendar navigation", selected: "selected" }, t = { checking: "Checking …", checkAgain: "Check again", gate: { loading: "Checking license and device status …", failed: "The license check failed.", activationRequired: "The previous activation is no longer valid. Please activate this installation again. Your data will be preserved.", readOnly: "View and export existing data" }, activation: { title: "Activate App", renew: "Renew activation", description: "Enter your activation code to link this installation to your license.", replacementDescription: "Enter a new activation code for the current license or another valid license. Your data will be preserved. The previous activation is replaced only after successful activation.", replacementNotice: "The existing activation is replaced only after successful verification.", code: "Activation code", deviceName: "Device name", devicePlaceholder: "My device", defaultDeviceName: "My device", pending: "Activating …", submit: "Activate license" }, banner: { readOnlyTitle: "Read-only mode", refreshFailed: "License update unavailable", retryStorage: "Retry saving", readOnlyDescription: "You can still view and export existing data. Creating and editing are blocked.", persistencePending: "The blocked license state could not yet be fully saved. This device remains blocked. Please try saving again." }, errors: { activationRequired: "The previous activation is no longer valid on the license server. Please enter a new activation code.", network: "The license server is currently unreachable. Local validity remains unchanged.", deviceRevoked: "The activation of this device has been revoked.", licenseRevoked: "This license has been revoked.", storage: "The local license state could not be read or saved safely.", certificate: "The license certificate is invalid.", alreadyActivated: "This installation is already activated.", api: "The license server rejected the activation or update. Check the code and the license status.", protocol: "The license server response could not be processed.", unactivated: "This installation is not activated yet.", stateChanged: "The license state has changed. Please check it again.", synchronization: "License synchronization is currently unavailable. Please try again.", readOnly: "This action requires a valid activation. Existing data remains readable and exportable.", featureDenied: "This feature is not enabled in your license.", unknown: "The license check failed. Please try again." } }, n = { title: "License", checking: "Checking license …", unknown: "Unavailable", plan: "Plan", licenseTerm: "Purchased license term", termUnknown: "Not provided by the server", certificateExpires: "Current certificate valid until", nextSync: "Next synchronization", syncDue: "Due since {{date}}", noSyncScheduled: "No automatic synchronization currently scheduled", features: "Features listed in the certificate", noFeatures: "No features available in the current certificate.", validityHint: "The certificate validity limits offline use. Its expiration does not automatically mean your purchased license has ended. The actual license term is not currently provided separately.", synchronize: "Synchronize license", syncing: "Synchronizing …", synchronized: "License status updated.", persistencePending: "The blocked license state could not yet be fully saved. Please synchronize again.", deviceDetails: "Advanced device details", deviceId: "Current device ID", noDevice: "No device activation yet.", deviceReleaseHint: "Releasing a device is not yet available in this app. Deleting local license data does not free a device slot on the server.", status: { active: { label: "Active", description: "Your signed license certificate is valid. The app can be used normally." }, offline_grace: { label: "Valid offline", description: "Your existing certificate still permits local use. Synchronization is due; the certificate is renewed only after successful server verification." }, expired: { label: "Certificate expired", description: "Your local certificate has expired. Synchronize to obtain a new one. This alone does not tell us whether your purchased license has also expired. Existing data remains readable and exportable." }, revoked: { label: "Device activation revoked", description: "This device activation has been revoked. Editing is blocked; existing data remains readable and exportable." }, license_revoked: { label: "License revoked", description: "The server has confirmed that this license was revoked. Editing is blocked; existing data remains readable and exportable." }, unactivated: { label: "Not activated", description: "This installation is not associated with a license yet. An activation code is required to use it." }, activation_required: { label: "Activation required", description: "The previous server association is missing or no longer matches this installation. Renew the activation. Existing data is preserved." }, invalid: { label: "Cannot be verified", description: "The local certificate cannot currently be verified reliably. Editing remains blocked. Synchronize to check the license status again." } }, plans: { trial: "Trial", personal: "Personal", professional: "Professional", lifetime: "Lifetime" }, featureLabels: { all_features: "All features", core: "Core features" } }, s = {
|
|
2
|
+
actions: e,
|
|
3
|
+
app: i,
|
|
4
|
+
datePicker: a,
|
|
5
|
+
licensing: t,
|
|
6
|
+
licenseProfile: n
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
e as actions,
|
|
10
|
+
i as app,
|
|
11
|
+
a as datePicker,
|
|
12
|
+
s as default,
|
|
13
|
+
n as licenseProfile,
|
|
14
|
+
t as licensing
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=en.json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const e = { cancel: "Annulla", close: "Chiudi" }, i = { back: "Torna alla home", errorDescription: "Ricarica l’interfaccia e riprova.", errorTitle: "Qualcosa è andato storto.", loadingApp: "Preparazione dell’app …", navigation: "Navigazione principale", restart: "Ricarica", switchTheme: "Cambia aspetto" }, a = { selectDate: "Seleziona data", today: "Oggi", nextMonth: "Mese successivo", previousMonth: "Mese precedente", chooseMonth: "Scegli mese", chooseYear: "Scegli anno", navigation: "Navigazione del calendario", selected: "selezionato" }, t = { checking: "Verifica in corso …", checkAgain: "Verifica nuovamente", gate: { loading: "Verifica della licenza e dello stato del dispositivo …", failed: "Verifica della licenza non riuscita.", activationRequired: "L’attivazione precedente non è più valida. Attiva nuovamente questa installazione. I dati verranno conservate.", readOnly: "Consulta ed esporta i dati esistenti" }, activation: { title: "Attiva App", renew: "Rinnova attivazione", description: "Inserisci il codice di attivazione per collegare questa installazione alla tua licenza.", replacementDescription: "Inserisci un nuovo codice di attivazione per la licenza attuale o per un’altra licenza valida. I dati verranno conservate. L’attivazione precedente viene sostituita solo dopo l’attivazione riuscita.", replacementNotice: "L’attivazione esistente viene sostituita solo dopo una verifica riuscita.", code: "Codice di attivazione", deviceName: "Nome del dispositivo", devicePlaceholder: "Il mio dispositivo", defaultDeviceName: "Il mio dispositivo", pending: "Attivazione in corso …", submit: "Attiva licenza" }, banner: { readOnlyTitle: "Modalità di sola lettura", refreshFailed: "Aggiornamento della licenza non disponibile", retryStorage: "Riprova il salvataggio", readOnlyDescription: "Puoi ancora consultare ed esportare i dati esistenti. La creazione e la modifica sono bloccate.", persistencePending: "Non è stato ancora possibile salvare completamente lo stato di blocco della licenza. Il dispositivo resta bloccato. Riprova il salvataggio." }, errors: { activationRequired: "L’attivazione precedente non è più valida sul server delle licenze. Inserisci un nuovo codice di attivazione.", network: "Il server delle licenze non è attualmente raggiungibile. La validità locale resta invariata.", deviceRevoked: "L’attivazione di questo dispositivo è stata revocata.", licenseRevoked: "Questa licenza è stata revocata.", storage: "Non è stato possibile leggere o salvare in modo sicuro lo stato locale della licenza.", certificate: "Il certificato della licenza non è valido.", alreadyActivated: "Questa installazione è già attivata.", api: "Il server ha rifiutato l’attivazione o l’aggiornamento. Verifica il codice e lo stato della licenza.", protocol: "Non è stato possibile elaborare la risposta del server delle licenze.", unactivated: "Questa installazione non è ancora attivata.", stateChanged: "Lo stato della licenza è cambiato. Verificalo nuovamente.", synchronization: "La sincronizzazione della licenza non è attualmente disponibile. Riprova.", readOnly: "Questa azione richiede un’attivazione valida. I dati esistenti restano consultabili ed esportabili.", featureDenied: "Questa funzionalità non è abilitata nella tua licenza.", unknown: "Verifica della licenza non riuscita. Riprova." } }, o = { title: "Licenza", checking: "Verifica della licenza …", unknown: "Non disponibile", plan: "Piano", licenseTerm: "Durata della licenza acquistata", termUnknown: "Non comunicata dal server", certificateExpires: "Certificato attuale valido fino al", nextSync: "Prossima sincronizzazione", syncDue: "Dovuta dal {{date}}", noSyncScheduled: "Nessuna sincronizzazione automatica attualmente prevista", features: "Funzionalità indicate nel certificato", noFeatures: "Nessuna funzionalità disponibile nel certificato attuale.", validityHint: "La validità del certificato limita l’uso offline. La sua scadenza non coincide necessariamente con la fine della licenza acquistata. La durata effettiva della licenza non viene attualmente comunicata separatamente.", synchronize: "Sincronizza licenza", syncing: "Sincronizzazione …", synchronized: "Stato della licenza aggiornato.", persistencePending: "Non è stato ancora possibile salvare completamente lo stato di blocco della licenza. Sincronizza nuovamente.", deviceDetails: "Dettagli avanzati del dispositivo", deviceId: "ID del dispositivo attuale", noDevice: "Nessuna attivazione del dispositivo presente.", deviceReleaseHint: "La disattivazione di un dispositivo non è ancora disponibile nell’app. Eliminare i dati locali della licenza non libera un posto dispositivo sul server.", status: { active: { label: "Attiva", description: "Il certificato firmato della licenza è valido. Puoi usare normalmente l’app." }, offline_grace: { label: "Valida offline", description: "Il certificato esistente consente ancora l’uso locale. È dovuta una sincronizzazione; il certificato viene rinnovato solo dopo una verifica riuscita del server." }, expired: { label: "Certificato scaduto", description: "Il certificato locale è scaduto. Sincronizza per ottenerne uno nuovo. Questo da solo non indica se anche la licenza acquistata sia scaduta. I dati esistenti restano consultabili ed esportabili." }, revoked: { label: "Attivazione del dispositivo revocata", description: "L’attivazione di questo dispositivo è stata revocata. Le modifiche sono bloccate; i dati esistenti restano consultabili ed esportabili." }, license_revoked: { label: "Licenza revocata", description: "Il server ha confermato la revoca della licenza. Le modifiche sono bloccate; i dati esistenti restano consultabili ed esportabili." }, unactivated: { label: "Non attivata", description: "Questa installazione non è ancora associata a una licenza. Per usarla serve un codice di attivazione." }, activation_required: { label: "Attivazione necessaria", description: "L’associazione precedente sul server manca o non corrisponde più a questa installazione. Rinnova l’attivazione. I dati esistenti vengono conservati." }, invalid: { label: "Non verificabile", description: "Al momento il certificato locale non può essere verificato in modo affidabile. Le modifiche restano bloccate. Sincronizza per verificare nuovamente lo stato della licenza." } }, plans: { trial: "Versione di prova", personal: "Personal", professional: "Professional", lifetime: "Lifetime" }, featureLabels: { all_features: "Tutte le funzionalità", core: "Funzioni di base" } }, n = {
|
|
2
|
+
actions: e,
|
|
3
|
+
app: i,
|
|
4
|
+
datePicker: a,
|
|
5
|
+
licensing: t,
|
|
6
|
+
licenseProfile: o
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
e as actions,
|
|
10
|
+
i as app,
|
|
11
|
+
a as datePicker,
|
|
12
|
+
n as default,
|
|
13
|
+
o as licenseProfile,
|
|
14
|
+
t as licensing
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=it.json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"it.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespace.js","sources":["../../src/i18n/namespace.ts"],"sourcesContent":["/** i18next namespace that holds every string shipped with @stoa-dev/kit. */\nexport const STOA_NS = 'stoa'\n"],"names":["STOA_NS"],"mappings":"AACO,MAAMA,IAAU;"}
|
package/dist/kit.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.stoa-AppNavigation-root-q2bm{position:fixed;inset-block:.75rem;inset-inline-start:.75rem;z-index:40;display:flex;flex-direction:column;align-items:center;gap:.75rem;width:4rem;padding-block:1.25rem;border-radius:1rem;background:color-mix(in srgb,var(--card) 95%,transparent);box-shadow:var(--surface-shadow)}.stoa-AppNavigation-logo-q27s{width:2.25rem;height:2.25rem;margin-bottom:.75rem;border-radius:.5rem}.stoa-AppNavigation-divider-1iif{width:1.5rem;margin-block:.5rem;border-top:1px solid var(--border)}.stoa-AppNavigation-spacer-19m9{flex:1}.stoa-AppNavigation-menuButton-8y5h{position:relative}.stoa-AppNavigation-menuButton-8y5h[aria-current=page]{background:var(--accent-wash);color:var(--foreground)}.stoa-AppNavigation-menuButton-8y5h[aria-current=page]:before{content:"";position:absolute;left:-9px;width:3px;height:16px;border-radius:2px;background:var(--accent)}.stoa-AppNavigation-menuButton-8y5h svg{stroke:currentColor}@media(prefers-reduced-motion:reduce){.stoa-AppNavigation-menuButton-8y5h{transition:none}}.stoa-BrandLines-brand-lines-1m2u{display:inline-flex;flex:none;flex-direction:column;align-items:flex-start;gap:4px;width:20px;color:var(--accent)}.stoa-BrandLines-brand-lines-1m2u>i{display:block;width:100%;height:2px;border-radius:2px;background:currentColor}.stoa-BrandLines-brand-lines-1m2u>i:nth-child(2){width:75%}.stoa-BrandLines-brand-lines-1m2u>i:nth-child(3){width:50%}.stoa-BrandLines-brand-lines-loading-v0s9>i{transform-origin:left;animation:stoa-BrandLines-brand-line-pulse-z7rz 1.1s ease-in-out infinite alternate}.stoa-BrandLines-brand-lines-loading-v0s9>i:nth-child(2){animation-delay:.15s}.stoa-BrandLines-brand-lines-loading-v0s9>i:nth-child(3){animation-delay:.3s}@keyframes stoa-BrandLines-brand-line-pulse-z7rz{0%{opacity:.35;transform:scaleX(.55)}to{opacity:1;transform:scaleX(1)}}@media(prefers-reduced-motion:reduce){.stoa-BrandLines-brand-lines-loading-v0s9>i{animation:none}}.stoa-PageHeading-page-heading-1k1w{display:flex;align-items:center;gap:.875rem;min-width:0;margin-block:.25rem .5rem;font-size:clamp(1.75rem,2.4vw,2.5rem);line-height:1.15;letter-spacing:-.045em;font-weight:650;overflow-wrap:anywhere}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as o } from "react";
|
|
3
|
+
import { useTranslation as N } from "react-i18next";
|
|
4
|
+
import { STOA_NS as y } from "../../i18n/namespace.js";
|
|
5
|
+
import { Input as f } from "../../ui/input/index.js";
|
|
6
|
+
import { Label as g } from "../../ui/label/index.js";
|
|
7
|
+
import { licenseErrorMessage as w, activateLicense as C } from "../api.js";
|
|
8
|
+
import { useLicense as L } from "../LicenseProvider/index.js";
|
|
9
|
+
function T({
|
|
10
|
+
onActivated: X,
|
|
11
|
+
replacement: i = !1
|
|
12
|
+
}) {
|
|
13
|
+
const { change: h } = L(), { t: e } = N(y), [r, s] = o(""), [m, x] = o(""), [c, d] = o(!1), [u, v] = o(null), p = u === null ? "" : w(u, e);
|
|
14
|
+
async function b(n) {
|
|
15
|
+
n.preventDefault(), v(null), d(!0);
|
|
16
|
+
try {
|
|
17
|
+
const l = await (i ? h : C)(
|
|
18
|
+
r.trim(),
|
|
19
|
+
m.trim() || e("licensing.activation.defaultDeviceName")
|
|
20
|
+
);
|
|
21
|
+
s(""), X(l);
|
|
22
|
+
} catch (l) {
|
|
23
|
+
v(l);
|
|
24
|
+
} finally {
|
|
25
|
+
d(!1);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return /* @__PURE__ */ a(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
className: i ? "space-y-6" : "mx-auto w-full max-w-md space-y-6 p-8",
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ a("div", { children: [
|
|
34
|
+
/* @__PURE__ */ t("h2", { className: "text-2xl font-semibold", children: e(i ? "licensing.activation.renew" : "licensing.activation.title") }),
|
|
35
|
+
/* @__PURE__ */ t("p", { className: "mt-2 text-sm text-neutral-500", children: e(i ? "licensing.activation.replacementDescription" : "licensing.activation.description") })
|
|
36
|
+
] }),
|
|
37
|
+
/* @__PURE__ */ a("form", { onSubmit: b, className: "space-y-5", "aria-busy": c, children: [
|
|
38
|
+
/* @__PURE__ */ a("div", { children: [
|
|
39
|
+
/* @__PURE__ */ t(
|
|
40
|
+
g,
|
|
41
|
+
{
|
|
42
|
+
htmlFor: "activation-code",
|
|
43
|
+
className: "mb-2 block text-sm font-medium",
|
|
44
|
+
children: e("licensing.activation.code")
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ t(
|
|
48
|
+
f,
|
|
49
|
+
{
|
|
50
|
+
id: "activation-code",
|
|
51
|
+
autoFocus: !0,
|
|
52
|
+
required: !0,
|
|
53
|
+
value: r,
|
|
54
|
+
onChange: (n) => s(n.target.value.toUpperCase()),
|
|
55
|
+
placeholder: "XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XX",
|
|
56
|
+
autoComplete: "off",
|
|
57
|
+
spellCheck: !1,
|
|
58
|
+
className: "w-full rounded-lg border px-4 py-3 font-mono tracking-wider"
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
] }),
|
|
62
|
+
/* @__PURE__ */ a("div", { children: [
|
|
63
|
+
/* @__PURE__ */ t(
|
|
64
|
+
g,
|
|
65
|
+
{
|
|
66
|
+
htmlFor: "activation-device-name",
|
|
67
|
+
className: "mb-2 block text-sm font-medium",
|
|
68
|
+
children: e("licensing.activation.deviceName")
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ t(
|
|
72
|
+
f,
|
|
73
|
+
{
|
|
74
|
+
id: "activation-device-name",
|
|
75
|
+
value: m,
|
|
76
|
+
maxLength: 120,
|
|
77
|
+
onChange: (n) => x(n.target.value),
|
|
78
|
+
placeholder: e("licensing.activation.devicePlaceholder"),
|
|
79
|
+
className: "w-full rounded-lg border px-4 py-3"
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
] }),
|
|
83
|
+
p && /* @__PURE__ */ t("p", { role: "alert", className: "text-sm text-red-600", children: p }),
|
|
84
|
+
/* @__PURE__ */ t(
|
|
85
|
+
"button",
|
|
86
|
+
{
|
|
87
|
+
type: "submit",
|
|
88
|
+
disabled: c,
|
|
89
|
+
className: "w-full rounded-lg bg-neutral-900 px-5 py-3 font-medium text-white disabled:opacity-50",
|
|
90
|
+
children: e(c ? "licensing.activation.pending" : i ? "licensing.activation.renew" : "licensing.activation.submit")
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
] })
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
export {
|
|
99
|
+
T as LicenseActivation
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/licensing/LicenseActivation/index.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { STOA_NS } from '../../i18n/namespace'\nimport { Input } from '../../ui/input'\nimport { Label } from '../../ui/label'\nimport { activateLicense, type LicenseState, licenseErrorMessage } from '../api'\nimport { useLicense } from '../LicenseProvider'\n\ninterface LicenseActivationProps {\n\tonActivated: (state: LicenseState) => void\n\treplacement?: boolean\n}\n\nexport function LicenseActivation({\n\tonActivated,\n\treplacement = false,\n}: LicenseActivationProps) {\n\tconst { change } = useLicense()\n\tconst { t } = useTranslation(STOA_NS)\n\tconst [code, setCode] = useState<string>('')\n\tconst [deviceName, setDeviceName] = useState<string>('')\n\tconst [pending, setPending] = useState<boolean>(false)\n\tconst [errorCause, setError] = useState<unknown>(null)\n\tconst error = errorCause === null ? '' : licenseErrorMessage(errorCause, t)\n\n\tasync function handleSubmit(event: React.SubmitEvent) {\n\t\tevent.preventDefault()\n\t\tsetError(null)\n\t\tsetPending(true)\n\n\t\ttry {\n\t\t\tconst result = await (replacement ? change : activateLicense)(\n\t\t\t\tcode.trim(),\n\t\t\t\tdeviceName.trim() || t('licensing.activation.defaultDeviceName'),\n\t\t\t)\n\n\t\t\tsetCode('')\n\t\t\tonActivated(result)\n\t\t} catch (error) {\n\t\t\tsetError(error)\n\t\t} finally {\n\t\t\tsetPending(false)\n\t\t}\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName={\n\t\t\t\treplacement ? 'space-y-6' : 'mx-auto w-full max-w-md space-y-6 p-8'\n\t\t\t}\n\t\t>\n\t\t\t<div>\n\t\t\t\t<h2 className='text-2xl font-semibold'>\n\t\t\t\t\t{replacement\n\t\t\t\t\t\t? t('licensing.activation.renew')\n\t\t\t\t\t\t: t('licensing.activation.title')}\n\t\t\t\t</h2>\n\t\t\t\t<p className='mt-2 text-sm text-neutral-500'>\n\t\t\t\t\t{replacement\n\t\t\t\t\t\t? t('licensing.activation.replacementDescription')\n\t\t\t\t\t\t: t('licensing.activation.description')}\n\t\t\t\t</p>\n\t\t\t</div>\n\n\t\t\t<form onSubmit={handleSubmit} className='space-y-5' aria-busy={pending}>\n\t\t\t\t<div>\n\t\t\t\t\t<Label\n\t\t\t\t\t\thtmlFor='activation-code'\n\t\t\t\t\t\tclassName='mb-2 block text-sm font-medium'\n\t\t\t\t\t>\n\t\t\t\t\t\t{t('licensing.activation.code')}\n\t\t\t\t\t</Label>\n\n\t\t\t\t\t<Input\n\t\t\t\t\t\tid='activation-code'\n\t\t\t\t\t\tautoFocus\n\t\t\t\t\t\trequired\n\t\t\t\t\t\tvalue={code}\n\t\t\t\t\t\tonChange={(e) => setCode(e.target.value.toUpperCase())}\n\t\t\t\t\t\tplaceholder='XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XX'\n\t\t\t\t\t\tautoComplete='off'\n\t\t\t\t\t\tspellCheck={false}\n\t\t\t\t\t\tclassName='w-full rounded-lg border px-4 py-3 font-mono tracking-wider'\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t<div>\n\t\t\t\t\t<Label\n\t\t\t\t\t\thtmlFor='activation-device-name'\n\t\t\t\t\t\tclassName='mb-2 block text-sm font-medium'\n\t\t\t\t\t>\n\t\t\t\t\t\t{t('licensing.activation.deviceName')}\n\t\t\t\t\t</Label>\n\t\t\t\t\t<Input\n\t\t\t\t\t\tid='activation-device-name'\n\t\t\t\t\t\tvalue={deviceName}\n\t\t\t\t\t\tmaxLength={120}\n\t\t\t\t\t\tonChange={(e) => setDeviceName(e.target.value)}\n\t\t\t\t\t\tplaceholder={t('licensing.activation.devicePlaceholder')}\n\t\t\t\t\t\tclassName='w-full rounded-lg border px-4 py-3'\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t{error && (\n\t\t\t\t\t<p role='alert' className='text-sm text-red-600'>\n\t\t\t\t\t\t{error}\n\t\t\t\t\t</p>\n\t\t\t\t)}\n\n\t\t\t\t<button\n\t\t\t\t\ttype='submit'\n\t\t\t\t\tdisabled={pending}\n\t\t\t\t\tclassName='w-full rounded-lg bg-neutral-900 px-5 py-3 font-medium text-white disabled:opacity-50'\n\t\t\t\t>\n\t\t\t\t\t{pending\n\t\t\t\t\t\t? t('licensing.activation.pending')\n\t\t\t\t\t\t: replacement\n\t\t\t\t\t\t\t? t('licensing.activation.renew')\n\t\t\t\t\t\t\t: t('licensing.activation.submit')}\n\t\t\t\t</button>\n\t\t\t</form>\n\t\t</div>\n\t)\n}\n"],"names":["LicenseActivation","onActivated","replacement","change","useLicense","t","useTranslation","STOA_NS","code","setCode","useState","deviceName","setDeviceName","pending","setPending","errorCause","setError","error","licenseErrorMessage","handleSubmit","event","result","activateLicense","jsxs","jsx","Label","Input","e"],"mappings":";;;;;;;;AAaO,SAASA,EAAkB;AAAA,EACjC,aAAAC;AAAA,EACA,aAAAC,IAAc;AACf,GAA2B;AAC1B,QAAM,EAAE,QAAAC,EAAA,IAAWC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAeC,CAAO,GAC9B,CAACC,GAAMC,CAAO,IAAIC,EAAiB,EAAE,GACrC,CAACC,GAAYC,CAAa,IAAIF,EAAiB,EAAE,GACjD,CAACG,GAASC,CAAU,IAAIJ,EAAkB,EAAK,GAC/C,CAACK,GAAYC,CAAQ,IAAIN,EAAkB,IAAI,GAC/CO,IAAQF,MAAe,OAAO,KAAKG,EAAoBH,GAAYV,CAAC;AAE1E,iBAAec,EAAaC,GAA0B;AACrD,IAAAA,EAAM,eAAA,GACNJ,EAAS,IAAI,GACbF,EAAW,EAAI;AAEf,QAAI;AACH,YAAMO,IAAS,OAAOnB,IAAcC,IAASmB;AAAA,QAC5Cd,EAAK,KAAA;AAAA,QACLG,EAAW,UAAUN,EAAE,wCAAwC;AAAA,MAAA;AAGhE,MAAAI,EAAQ,EAAE,GACVR,EAAYoB,CAAM;AAAA,IACnB,SAASJ,GAAO;AACf,MAAAD,EAASC,CAAK;AAAA,IACf,UAAA;AACC,MAAAH,EAAW,EAAK;AAAA,IACjB;AAAA,EACD;AAEA,SACC,gBAAAS;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,WACCrB,IAAc,cAAc;AAAA,MAG7B,UAAA;AAAA,QAAA,gBAAAqB,EAAC,OAAA,EACA,UAAA;AAAA,UAAA,gBAAAC,EAAC,MAAA,EAAG,WAAU,0BACZ,UACEnB,EADFH,IACI,+BACA,4BAD4B,EACA,CAClC;AAAA,UACA,gBAAAsB,EAAC,KAAA,EAAE,WAAU,iCACX,UACEnB,EADFH,IACI,gDACA,kCAD6C,EACX,CACxC;AAAA,QAAA,GACD;AAAA,0BAEC,QAAA,EAAK,UAAUiB,GAAc,WAAU,aAAY,aAAWN,GAC9D,UAAA;AAAA,UAAA,gBAAAU,EAAC,OAAA,EACA,UAAA;AAAA,YAAA,gBAAAC;AAAA,cAACC;AAAA,cAAA;AAAA,gBACA,SAAQ;AAAA,gBACR,WAAU;AAAA,gBAET,YAAE,2BAA2B;AAAA,cAAA;AAAA,YAAA;AAAA,YAG/B,gBAAAD;AAAA,cAACE;AAAA,cAAA;AAAA,gBACA,IAAG;AAAA,gBACH,WAAS;AAAA,gBACT,UAAQ;AAAA,gBACR,OAAOlB;AAAA,gBACP,UAAU,CAACmB,MAAMlB,EAAQkB,EAAE,OAAO,MAAM,aAAa;AAAA,gBACrD,aAAY;AAAA,gBACZ,cAAa;AAAA,gBACb,YAAY;AAAA,gBACZ,WAAU;AAAA,cAAA;AAAA,YAAA;AAAA,UACX,GACD;AAAA,4BAEC,OAAA,EACA,UAAA;AAAA,YAAA,gBAAAH;AAAA,cAACC;AAAA,cAAA;AAAA,gBACA,SAAQ;AAAA,gBACR,WAAU;AAAA,gBAET,YAAE,iCAAiC;AAAA,cAAA;AAAA,YAAA;AAAA,YAErC,gBAAAD;AAAA,cAACE;AAAA,cAAA;AAAA,gBACA,IAAG;AAAA,gBACH,OAAOf;AAAA,gBACP,WAAW;AAAA,gBACX,UAAU,CAACgB,MAAMf,EAAce,EAAE,OAAO,KAAK;AAAA,gBAC7C,aAAatB,EAAE,wCAAwC;AAAA,gBACvD,WAAU;AAAA,cAAA;AAAA,YAAA;AAAA,UACX,GACD;AAAA,UAECY,KACA,gBAAAO,EAAC,KAAA,EAAE,MAAK,SAAQ,WAAU,wBACxB,UAAAP,GACF;AAAA,UAGD,gBAAAO;AAAA,YAAC;AAAA,YAAA;AAAA,cACA,MAAK;AAAA,cACL,UAAUX;AAAA,cACV,WAAU;AAAA,cAET,UACER,EADFQ,IACI,iCACFX,IACG,+BACA,6BAH6B;AAAA,YAGA;AAAA,UAAA;AAAA,QACpC,EAAA,CACD;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGH;"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { ShieldCheck as N, ShieldAlert as y, RefreshCw as v, ChevronRight as P } from "lucide-react";
|
|
3
|
+
import { useState as k } from "react";
|
|
4
|
+
import { useTranslation as w } from "react-i18next";
|
|
5
|
+
import { STOA_NS as S } from "../../i18n/namespace.js";
|
|
6
|
+
import { Button as C } from "../../ui/button/index.js";
|
|
7
|
+
import { Card as z, CardHeader as D, CardTitle as T, CardContent as A } from "../../ui/card/index.js";
|
|
8
|
+
import { useLicense as _ } from "../LicenseProvider/index.js";
|
|
9
|
+
const $ = {
|
|
10
|
+
active: "border-emerald-500/30 bg-emerald-500/10 text-emerald-800 dark:text-emerald-300",
|
|
11
|
+
offline_grace: "border-sky-500/30 bg-sky-500/10 text-sky-800 dark:text-sky-300",
|
|
12
|
+
expired: "border-amber-500/30 bg-amber-500/10 text-amber-800 dark:text-amber-300",
|
|
13
|
+
revoked: "border-red-500/30 bg-red-500/10 text-red-800 dark:text-red-300",
|
|
14
|
+
license_revoked: "border-red-500/30 bg-red-500/10 text-red-800 dark:text-red-300",
|
|
15
|
+
unactivated: "border-border bg-muted/30 text-muted-foreground",
|
|
16
|
+
activation_required: "border-amber-500/30 bg-amber-500/10 text-amber-800 dark:text-amber-300",
|
|
17
|
+
invalid: "border-red-500/30 bg-red-500/10 text-red-800 dark:text-red-300"
|
|
18
|
+
};
|
|
19
|
+
function B() {
|
|
20
|
+
const { license: i, loading: a, refreshing: d, refresh: f, error: c } = _(), { t: e, i18n: x } = w(S), [p, m] = k(!1), l = i?.status ?? "invalid", h = l === "active" || l === "offline_grace" ? N : y;
|
|
21
|
+
function o(n) {
|
|
22
|
+
if (n == null || !Number.isFinite(n))
|
|
23
|
+
return e("licenseProfile.unknown");
|
|
24
|
+
const u = new Date(n * 1e3);
|
|
25
|
+
return Number.isFinite(u.getTime()) ? new Intl.DateTimeFormat(x.resolvedLanguage || "de", {
|
|
26
|
+
dateStyle: "medium",
|
|
27
|
+
timeStyle: "short"
|
|
28
|
+
}).format(u) : e("licenseProfile.unknown");
|
|
29
|
+
}
|
|
30
|
+
async function g() {
|
|
31
|
+
m(!1);
|
|
32
|
+
try {
|
|
33
|
+
await f(), m(!0);
|
|
34
|
+
} catch {
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const s = i?.nextSyncAt, b = i?.certificateExpiresAt ?? i?.expiresAt;
|
|
38
|
+
return /* @__PURE__ */ t(
|
|
39
|
+
z,
|
|
40
|
+
{
|
|
41
|
+
className: "mb-4",
|
|
42
|
+
role: "region",
|
|
43
|
+
"aria-labelledby": "profile-license-title",
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ r(D, { children: /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
46
|
+
/* @__PURE__ */ r(T, { id: "profile-license-title", children: e("licenseProfile.title") }),
|
|
47
|
+
/* @__PURE__ */ t(
|
|
48
|
+
"span",
|
|
49
|
+
{
|
|
50
|
+
className: `inline-flex items-center gap-2 rounded-full border px-3 py-1 text-xs font-medium ${$[l]}`,
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ r(h, { className: "size-4", "aria-hidden": "true" }),
|
|
53
|
+
e(a ? "licenseProfile.checking" : `licenseProfile.status.${l}.label`)
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
] }) }),
|
|
58
|
+
/* @__PURE__ */ t(A, { className: "grid gap-5", children: [
|
|
59
|
+
/* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground", children: e(a ? "licenseProfile.checking" : `licenseProfile.status.${l}.description`) }),
|
|
60
|
+
/* @__PURE__ */ t("dl", { className: "grid gap-4 sm:grid-cols-2", children: [
|
|
61
|
+
/* @__PURE__ */ t("div", { className: "min-w-0 space-y-1", children: [
|
|
62
|
+
/* @__PURE__ */ r("dt", { className: "text-xs text-muted-foreground", children: e("licenseProfile.plan") }),
|
|
63
|
+
/* @__PURE__ */ r("dd", { className: "wrap-break-word font-medium", children: i?.plan ? e(`licenseProfile.plans.${i.plan}`, {
|
|
64
|
+
defaultValue: i.plan
|
|
65
|
+
}) : e("licenseProfile.unknown") })
|
|
66
|
+
] }),
|
|
67
|
+
/* @__PURE__ */ t("div", { className: "min-w-0 space-y-1", children: [
|
|
68
|
+
/* @__PURE__ */ r("dt", { className: "text-xs text-muted-foreground", children: e("licenseProfile.licenseTerm") }),
|
|
69
|
+
/* @__PURE__ */ r("dd", { children: e("licenseProfile.termUnknown") })
|
|
70
|
+
] }),
|
|
71
|
+
/* @__PURE__ */ t("div", { className: "min-w-0 space-y-1", children: [
|
|
72
|
+
/* @__PURE__ */ r("dt", { className: "text-xs text-muted-foreground", children: e("licenseProfile.certificateExpires") }),
|
|
73
|
+
/* @__PURE__ */ r("dd", { children: o(b) })
|
|
74
|
+
] }),
|
|
75
|
+
/* @__PURE__ */ t("div", { className: "min-w-0 space-y-1", children: [
|
|
76
|
+
/* @__PURE__ */ r("dt", { className: "text-xs text-muted-foreground", children: e("licenseProfile.nextSync") }),
|
|
77
|
+
/* @__PURE__ */ r("dd", { children: s != null ? s <= Date.now() / 1e3 ? e("licenseProfile.syncDue", {
|
|
78
|
+
date: o(s)
|
|
79
|
+
}) : o(s) : e("licenseProfile.noSyncScheduled") })
|
|
80
|
+
] }),
|
|
81
|
+
/* @__PURE__ */ t("div", { className: "space-y-2 sm:col-span-2", children: [
|
|
82
|
+
/* @__PURE__ */ r("dt", { className: "text-xs text-muted-foreground", children: e("licenseProfile.features") }),
|
|
83
|
+
/* @__PURE__ */ r("dd", { children: i?.features.length ? /* @__PURE__ */ r("ul", { className: "flex flex-wrap gap-2", children: [...new Set(i.features)].map((n) => /* @__PURE__ */ r(
|
|
84
|
+
"li",
|
|
85
|
+
{
|
|
86
|
+
className: "max-w-full break-all rounded-md border px-2 py-1 text-xs",
|
|
87
|
+
children: e(`licenseProfile.featureLabels.${n}`, {
|
|
88
|
+
defaultValue: n
|
|
89
|
+
})
|
|
90
|
+
},
|
|
91
|
+
n
|
|
92
|
+
)) }) : e("licenseProfile.noFeatures") })
|
|
93
|
+
] })
|
|
94
|
+
] }),
|
|
95
|
+
/* @__PURE__ */ r("p", { className: "rounded-lg bg-muted/30 p-3 text-xs text-muted-foreground", children: e("licenseProfile.validityHint") }),
|
|
96
|
+
/* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
97
|
+
/* @__PURE__ */ t(
|
|
98
|
+
C,
|
|
99
|
+
{
|
|
100
|
+
type: "button",
|
|
101
|
+
variant: "outline",
|
|
102
|
+
disabled: a || d || !i || l === "unactivated",
|
|
103
|
+
onClick: () => {
|
|
104
|
+
g();
|
|
105
|
+
},
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ r(
|
|
108
|
+
v,
|
|
109
|
+
{
|
|
110
|
+
"aria-hidden": "true",
|
|
111
|
+
className: d ? "animate-spin motion-reduce:animate-none" : void 0
|
|
112
|
+
}
|
|
113
|
+
),
|
|
114
|
+
e(
|
|
115
|
+
d ? "licenseProfile.syncing" : "licenseProfile.synchronize"
|
|
116
|
+
)
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
p && !c && /* @__PURE__ */ r("p", { role: "status", className: "text-xs text-muted-foreground", children: e("licenseProfile.synchronized") })
|
|
121
|
+
] }),
|
|
122
|
+
c && /* @__PURE__ */ r("p", { role: "alert", className: "wrap-break-word text-sm text-destructive", children: c }),
|
|
123
|
+
i?.persistencePending && /* @__PURE__ */ r("p", { role: "alert", className: "text-sm text-destructive", children: e("licenseProfile.persistencePending") }),
|
|
124
|
+
/* @__PURE__ */ t("details", { className: "group mt-1 border-t pt-5", children: [
|
|
125
|
+
/* @__PURE__ */ t("summary", { className: "flex w-fit cursor-pointer list-none items-center gap-2 rounded-sm text-sm font-medium outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden", children: [
|
|
126
|
+
/* @__PURE__ */ r(
|
|
127
|
+
P,
|
|
128
|
+
{
|
|
129
|
+
"aria-hidden": "true",
|
|
130
|
+
className: "size-4 transition-transform group-open:rotate-90 motion-reduce:transition-none"
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
e("licenseProfile.deviceDetails")
|
|
134
|
+
] }),
|
|
135
|
+
/* @__PURE__ */ t("div", { className: "mt-3 grid gap-3", children: [
|
|
136
|
+
/* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground", children: e("licenseProfile.deviceId") }),
|
|
137
|
+
/* @__PURE__ */ r("code", { className: "block select-all break-all rounded-md bg-muted/30 p-3 text-xs", children: i?.deviceId ?? e("licenseProfile.noDevice") }),
|
|
138
|
+
/* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground", children: e("licenseProfile.deviceReleaseHint") })
|
|
139
|
+
] })
|
|
140
|
+
] })
|
|
141
|
+
] })
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
export {
|
|
147
|
+
B as LicenseCard
|
|
148
|
+
};
|
|
149
|
+
//# sourceMappingURL=index.js.map
|