@bardioc/create-bardioc-app 0.5.4 → 0.5.5
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 +2 -2
- package/package.json +5 -5
- package/templates/angular/public/runtime-env.js +1 -1
- package/templates/angular/src/app/bardioc-bridge.ts +1 -1
- package/templates/angular/src/index.html +2 -2
- package/templates/angular/src/runtime-env.ts +1 -1
- package/templates/angular/src/styles.css +84 -80
- package/templates/angular/src/vite-env.d.ts +3 -3
- package/templates/manifest.json +2 -10
- package/templates/nextjs/app/globals.css +31 -28
- package/templates/nextjs/app/page.tsx +3 -3
- package/templates/nextjs/global.d.ts +1 -1
- package/templates/nextjs/next.config.ts +23 -23
- package/templates/nextjs/tailwind.config.ts +1 -4
- package/templates/preact/index.html +2 -2
- package/templates/preact/src/App.tsx +5 -4
- package/templates/preact/src/index.css +31 -28
- package/templates/preact/src/vite-env.d.ts +2 -2
- package/templates/solid/index.html +2 -2
- package/templates/solid/src/App.tsx +5 -4
- package/templates/solid/src/bardioc-sdk.tsx +18 -18
- package/templates/solid/src/index.css +31 -28
- package/templates/solid/src/vite-env.d.ts +2 -2
- package/templates/svelte/index.html +2 -2
- package/templates/svelte/src/index.css +31 -28
- package/templates/svelte/src/main.ts +1 -1
- package/templates/svelte/src/vite-env.d.ts +2 -2
- package/templates/vite/CLAUDE.md +5 -7
- package/templates/vite/index.html +2 -2
- package/templates/vite/package.json +2 -4
- package/templates/vite/src/climate/conditions-chart.tsx +6 -8
- package/templates/vite/src/events/live-events-view.tsx +1 -3
- package/templates/vite/src/i18n.tsx +7 -9
- package/templates/vite/src/shell/header.tsx +1 -2
- package/templates/vue/index.html +2 -2
- package/templates/vue/src/App.vue +25 -9
- package/templates/vue/src/bardioc-sdk.ts +11 -11
- package/templates/vue/src/index.css +31 -28
- package/templates/vue/src/vite-env.d.ts +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isDevStandalone, isInsideIframe } from '@bardioc/app-sdk/dev';
|
|
2
|
-
import {
|
|
2
|
+
import { useNotify, useSdk } from '@bardioc/app-sdk/react';
|
|
3
3
|
import { useState } from 'preact/hooks';
|
|
4
4
|
|
|
5
5
|
type ResultState =
|
|
@@ -59,14 +59,14 @@ function SdkDemo() {
|
|
|
59
59
|
|
|
60
60
|
<div className="flex flex-wrap gap-2">
|
|
61
61
|
<button
|
|
62
|
-
className="bg-primary text-primary-foreground hover:bg-primary/90
|
|
62
|
+
className="bg-primary text-primary-foreground hover:bg-primary/90 rounded px-3 py-1 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50"
|
|
63
63
|
onClick={() => void runGetProfile()}
|
|
64
64
|
disabled={running}
|
|
65
65
|
>
|
|
66
66
|
Get Profile
|
|
67
67
|
</button>
|
|
68
68
|
<button
|
|
69
|
-
className="bg-primary text-primary-foreground hover:bg-primary/90
|
|
69
|
+
className="bg-primary text-primary-foreground hover:bg-primary/90 rounded px-3 py-1 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50"
|
|
70
70
|
onClick={handleNotify}
|
|
71
71
|
disabled={running}
|
|
72
72
|
>
|
|
@@ -84,7 +84,8 @@ function SdkDemo() {
|
|
|
84
84
|
<div className="border-border bg-background flex min-h-0 flex-1 flex-col overflow-hidden rounded border">
|
|
85
85
|
{result.status === 'idle' && (
|
|
86
86
|
<div className="text-muted-foreground flex h-full items-center justify-center p-3 text-center text-xs leading-5">
|
|
87
|
-
Run a query to see results. If the host session is missing, the transport route will
|
|
87
|
+
Run a query to see results. If the host session is missing, the transport route will
|
|
88
|
+
return 401.
|
|
88
89
|
</div>
|
|
89
90
|
)}
|
|
90
91
|
{result.status === 'loading' && (
|
|
@@ -1,76 +1,79 @@
|
|
|
1
1
|
@import 'tailwindcss';
|
|
2
2
|
|
|
3
3
|
* {
|
|
4
|
-
|
|
4
|
+
box-sizing: border-box;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
html,
|
|
8
8
|
body,
|
|
9
9
|
#root {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: 0;
|
|
12
|
+
height: 100%;
|
|
13
|
+
width: 100%;
|
|
14
|
+
overflow: hidden;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
:root {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
--background: oklch(17.88% 0.0075 229.38);
|
|
19
|
+
--foreground: oklch(98.69% 0.0093 99.98);
|
|
20
|
+
--muted-foreground: oklch(86.03% 0.0056 95.11);
|
|
21
|
+
--border: oklch(1 0 0 / 10%);
|
|
22
|
+
--primary: oklch(97.02% 0 0);
|
|
23
|
+
--primary-foreground: oklch(36.94% 0.0053 236.64);
|
|
24
|
+
--destructive: oklch(68.04% 0.1386 21.38);
|
|
25
|
+
--ring: oklch(79.43% 0.0084 98.91);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
body {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
background: var(--background);
|
|
30
|
+
color: var(--foreground);
|
|
31
|
+
font-family:
|
|
32
|
+
system-ui,
|
|
33
|
+
-apple-system,
|
|
34
|
+
sans-serif;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
code {
|
|
35
|
-
|
|
38
|
+
font-family: inherit;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
.bg-background {
|
|
39
|
-
|
|
42
|
+
background-color: var(--background);
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
.text-foreground {
|
|
43
|
-
|
|
46
|
+
color: var(--foreground);
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
.text-muted-foreground {
|
|
47
|
-
|
|
50
|
+
color: var(--muted-foreground);
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
.border-border {
|
|
51
|
-
|
|
54
|
+
border-color: var(--border);
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
.bg-primary {
|
|
55
|
-
|
|
58
|
+
background-color: var(--primary);
|
|
56
59
|
}
|
|
57
60
|
|
|
58
61
|
.text-primary-foreground {
|
|
59
|
-
|
|
62
|
+
color: var(--primary-foreground);
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
.text-destructive {
|
|
63
|
-
|
|
66
|
+
color: var(--destructive);
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
.focus\:ring-ring:focus {
|
|
67
|
-
|
|
70
|
+
--tw-ring-color: var(--ring);
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
.hover\:bg-primary\/90:hover {
|
|
71
|
-
|
|
74
|
+
background-color: oklch(from var(--primary) calc(l * 0.9) c h);
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
.hover\:text-foreground:hover {
|
|
75
|
-
|
|
78
|
+
color: var(--foreground);
|
|
76
79
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<!
|
|
2
|
-
<html lang="en" class="dark" style="height: 100%; margin: 0">
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en" class="dark" style="height: 100%; margin: 0; color-scheme: dark">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isDevStandalone, isInsideIframe } from '@bardioc/app-sdk/dev';
|
|
2
2
|
import { createSignal } from 'solid-js';
|
|
3
|
-
import {
|
|
3
|
+
import { useNotify, useSdk } from './bardioc-sdk';
|
|
4
4
|
|
|
5
5
|
type ResultState =
|
|
6
6
|
| { status: 'idle' }
|
|
@@ -59,14 +59,14 @@ function SdkDemo() {
|
|
|
59
59
|
|
|
60
60
|
<div class="flex flex-wrap gap-2">
|
|
61
61
|
<button
|
|
62
|
-
class="bg-primary text-primary-foreground hover:bg-primary/90
|
|
62
|
+
class="bg-primary text-primary-foreground hover:bg-primary/90 rounded px-3 py-1 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50"
|
|
63
63
|
onclick={runGetProfile}
|
|
64
64
|
disabled={running()}
|
|
65
65
|
>
|
|
66
66
|
Get Profile
|
|
67
67
|
</button>
|
|
68
68
|
<button
|
|
69
|
-
class="bg-primary text-primary-foreground hover:bg-primary/90
|
|
69
|
+
class="bg-primary text-primary-foreground hover:bg-primary/90 rounded px-3 py-1 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50"
|
|
70
70
|
onclick={handleNotify}
|
|
71
71
|
disabled={running()}
|
|
72
72
|
>
|
|
@@ -87,7 +87,8 @@ function SdkDemo() {
|
|
|
87
87
|
if (r.status === 'idle') {
|
|
88
88
|
return (
|
|
89
89
|
<div class="text-muted-foreground flex h-full items-center justify-center p-3 text-center text-xs leading-5">
|
|
90
|
-
Run a query to see results. If the host session is missing, the transport route will
|
|
90
|
+
Run a query to see results. If the host session is missing, the transport route will
|
|
91
|
+
return 401.
|
|
91
92
|
</div>
|
|
92
93
|
);
|
|
93
94
|
}
|
|
@@ -4,30 +4,30 @@ import { createContext, onCleanup, onMount, useContext, type JSX } from 'solid-j
|
|
|
4
4
|
const BardiocContext = createContext<HostBridge>();
|
|
5
5
|
|
|
6
6
|
export function AppSdkProvider(props: { appId: string; children: JSX.Element }) {
|
|
7
|
-
|
|
7
|
+
const bridge = createHostBridge({ appId: props.appId });
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
onMount(() => {
|
|
10
|
+
void bridge.connect();
|
|
11
|
+
});
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
onCleanup(() => {
|
|
14
|
+
bridge.destroy();
|
|
15
|
+
});
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
return <BardiocContext.Provider value={bridge}>{props.children}</BardiocContext.Provider>;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export function useSdk(): HostBridge {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
const bridge = useContext(BardiocContext);
|
|
22
|
+
if (!bridge) {
|
|
23
|
+
throw new Error('useSdk() must be used inside AppSdkProvider');
|
|
24
|
+
}
|
|
25
|
+
return bridge;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export function useNotify() {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
29
|
+
const bridge = useSdk();
|
|
30
|
+
return (message: string, level?: NotifyLevel) => {
|
|
31
|
+
bridge.notify(message, level);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -1,76 +1,79 @@
|
|
|
1
1
|
@import 'tailwindcss';
|
|
2
2
|
|
|
3
3
|
* {
|
|
4
|
-
|
|
4
|
+
box-sizing: border-box;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
html,
|
|
8
8
|
body,
|
|
9
9
|
#root {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: 0;
|
|
12
|
+
height: 100%;
|
|
13
|
+
width: 100%;
|
|
14
|
+
overflow: hidden;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
:root {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
--background: oklch(17.88% 0.0075 229.38);
|
|
19
|
+
--foreground: oklch(98.69% 0.0093 99.98);
|
|
20
|
+
--muted-foreground: oklch(86.03% 0.0056 95.11);
|
|
21
|
+
--border: oklch(1 0 0 / 10%);
|
|
22
|
+
--primary: oklch(97.02% 0 0);
|
|
23
|
+
--primary-foreground: oklch(36.94% 0.0053 236.64);
|
|
24
|
+
--destructive: oklch(68.04% 0.1386 21.38);
|
|
25
|
+
--ring: oklch(79.43% 0.0084 98.91);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
body {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
background: var(--background);
|
|
30
|
+
color: var(--foreground);
|
|
31
|
+
font-family:
|
|
32
|
+
system-ui,
|
|
33
|
+
-apple-system,
|
|
34
|
+
sans-serif;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
code {
|
|
35
|
-
|
|
38
|
+
font-family: inherit;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
.bg-background {
|
|
39
|
-
|
|
42
|
+
background-color: var(--background);
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
.text-foreground {
|
|
43
|
-
|
|
46
|
+
color: var(--foreground);
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
.text-muted-foreground {
|
|
47
|
-
|
|
50
|
+
color: var(--muted-foreground);
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
.border-border {
|
|
51
|
-
|
|
54
|
+
border-color: var(--border);
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
.bg-primary {
|
|
55
|
-
|
|
58
|
+
background-color: var(--primary);
|
|
56
59
|
}
|
|
57
60
|
|
|
58
61
|
.text-primary-foreground {
|
|
59
|
-
|
|
62
|
+
color: var(--primary-foreground);
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
.text-destructive {
|
|
63
|
-
|
|
66
|
+
color: var(--destructive);
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
.focus\:ring-ring:focus {
|
|
67
|
-
|
|
70
|
+
--tw-ring-color: var(--ring);
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
.hover\:bg-primary\/90:hover {
|
|
71
|
-
|
|
74
|
+
background-color: oklch(from var(--primary) calc(l * 0.9) c h);
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
.hover\:text-foreground:hover {
|
|
75
|
-
|
|
78
|
+
color: var(--foreground);
|
|
76
79
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<!
|
|
2
|
-
<html lang="en" class="dark" style="height: 100%; margin: 0">
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en" class="dark" style="height: 100%; margin: 0; color-scheme: dark">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
@@ -1,76 +1,79 @@
|
|
|
1
1
|
@import 'tailwindcss';
|
|
2
2
|
|
|
3
3
|
* {
|
|
4
|
-
|
|
4
|
+
box-sizing: border-box;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
html,
|
|
8
8
|
body,
|
|
9
9
|
#app {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
margin: 0;
|
|
11
|
+
padding: 0;
|
|
12
|
+
height: 100%;
|
|
13
|
+
width: 100%;
|
|
14
|
+
overflow: hidden;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
:root {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
--background: oklch(17.88% 0.0075 229.38);
|
|
19
|
+
--foreground: oklch(98.69% 0.0093 99.98);
|
|
20
|
+
--muted-foreground: oklch(86.03% 0.0056 95.11);
|
|
21
|
+
--border: oklch(1 0 0 / 10%);
|
|
22
|
+
--primary: oklch(97.02% 0 0);
|
|
23
|
+
--primary-foreground: oklch(36.94% 0.0053 236.64);
|
|
24
|
+
--destructive: oklch(68.04% 0.1386 21.38);
|
|
25
|
+
--ring: oklch(79.43% 0.0084 98.91);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
body {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
background: var(--background);
|
|
30
|
+
color: var(--foreground);
|
|
31
|
+
font-family:
|
|
32
|
+
system-ui,
|
|
33
|
+
-apple-system,
|
|
34
|
+
sans-serif;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
code {
|
|
35
|
-
|
|
38
|
+
font-family: inherit;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
.bg-background {
|
|
39
|
-
|
|
42
|
+
background-color: var(--background);
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
.text-foreground {
|
|
43
|
-
|
|
46
|
+
color: var(--foreground);
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
.text-muted-foreground {
|
|
47
|
-
|
|
50
|
+
color: var(--muted-foreground);
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
.border-border {
|
|
51
|
-
|
|
54
|
+
border-color: var(--border);
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
.bg-primary {
|
|
55
|
-
|
|
58
|
+
background-color: var(--primary);
|
|
56
59
|
}
|
|
57
60
|
|
|
58
61
|
.text-primary-foreground {
|
|
59
|
-
|
|
62
|
+
color: var(--primary-foreground);
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
.text-destructive {
|
|
63
|
-
|
|
66
|
+
color: var(--destructive);
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
.focus\:ring-ring:focus {
|
|
67
|
-
|
|
70
|
+
--tw-ring-color: var(--ring);
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
.hover\:bg-primary\/90:hover {
|
|
71
|
-
|
|
74
|
+
background-color: oklch(from var(--primary) calc(l * 0.9) c h);
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
.hover\:text-foreground:hover {
|
|
75
|
-
|
|
78
|
+
color: var(--foreground);
|
|
76
79
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { installDevBridge, isDevStandalone, isInsideIframe } from '@bardioc/app-sdk/dev';
|
|
2
1
|
import { createHostBridge } from '@bardioc/app-sdk';
|
|
2
|
+
import { installDevBridge, isDevStandalone, isInsideIframe } from '@bardioc/app-sdk/dev';
|
|
3
3
|
import { mount } from 'svelte';
|
|
4
4
|
import App from './App.svelte';
|
|
5
5
|
import './index.css';
|
package/templates/vite/CLAUDE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# {{DISPLAY_NAME}}
|
|
2
2
|
|
|
3
3
|
Bardioc hosted app. Vite + React 19 + TypeScript 6 + `@bardioc/app-sdk`, with
|
|
4
|
-
`@bardioc/ui` (components + theme)
|
|
4
|
+
`@bardioc/ui` (components + theme) and `@bardioc/i18n-core` (translations).
|
|
5
5
|
|
|
6
6
|
The starter ships a **Climate Dashboard** — a worked example of how a real Bardioc app
|
|
7
7
|
is wired: a sidebar shell with multiple views, `@bardioc/ui` components (cards, metrics,
|
|
@@ -127,9 +127,9 @@ OS windows); the language switcher is `ConnectedLanguageSwitcher useI18n={useI18
|
|
|
127
127
|
|
|
128
128
|
---
|
|
129
129
|
|
|
130
|
-
## i18n — `@bardioc/i18n`
|
|
130
|
+
## i18n — `@bardioc/i18n-core`
|
|
131
131
|
|
|
132
|
-
All user-facing strings go through `t()`. Locales: `en`, `de` (
|
|
132
|
+
All user-facing strings go through `t()`. Locales: `en`, `de` (defined in `src/i18n.tsx`).
|
|
133
133
|
|
|
134
134
|
```typescript
|
|
135
135
|
import { useTranslation } from './i18n';
|
|
@@ -143,10 +143,8 @@ t('overview.updated', { fallback: 'Updated {time}', params: { time } });
|
|
|
143
143
|
- `AppI18nProvider syncWithOs` follows the OS language (`useOsConfig().language`); the header's
|
|
144
144
|
`ConnectedLanguageSwitcher` lets the user switch it manually.
|
|
145
145
|
- Always pass a `fallback` so a missing key degrades gracefully.
|
|
146
|
-
- `@bardioc/ui`
|
|
147
|
-
|
|
148
|
-
the app locales: `common.button.previous/next` and the `genericTable.*` set (DataTable pagination
|
|
149
|
-
"1 to 5 of 5", Previous/Next). Without them those strings silently fall back to English.
|
|
146
|
+
- `@bardioc/ui` component strings ship with the `@bardioc/ui` package itself — the app only
|
|
147
|
+
carries its own `en/de.json`.
|
|
150
148
|
|
|
151
149
|
---
|
|
152
150
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<!
|
|
2
|
-
<html lang="en" class="dark" style="height: 100%; margin: 0">
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en" class="dark" style="height: 100%; margin: 0; color-scheme: dark">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
8
|
-
"dev:live": "BARDIOC_TUNNEL=1 vite",
|
|
9
8
|
"build": "tsc && vite build && node scripts/stamp-manifest.mjs dist",
|
|
10
9
|
"bundle": "rm -f {{APP_NAME}}.zip && tsc && vite build && node scripts/stamp-manifest.mjs dist && cd dist && zip -r ../{{APP_NAME}}.zip .",
|
|
11
10
|
"preview": "vite preview",
|
|
@@ -17,9 +16,8 @@
|
|
|
17
16
|
},
|
|
18
17
|
"dependencies": {
|
|
19
18
|
"@bardioc/app-sdk": "latest",
|
|
20
|
-
"@bardioc/i18n": "
|
|
21
|
-
"@bardioc/
|
|
22
|
-
"@bardioc/ui": "^0.2.11",
|
|
19
|
+
"@bardioc/i18n-core": "latest",
|
|
20
|
+
"@bardioc/ui": "latest",
|
|
23
21
|
"lucide-react": "^0.544.0",
|
|
24
22
|
"react": "19.2.6",
|
|
25
23
|
"react-dom": "19.2.6"
|
|
@@ -16,14 +16,12 @@ export function ConditionsChart({ forecast }: Readonly<ConditionsChartProps>) {
|
|
|
16
16
|
rainy: { label: t('conditions.rainy', { fallback: 'Rainy' }), color: 'var(--chart-1)' },
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
const seriesData = forecast.map(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
})
|
|
26
|
-
);
|
|
19
|
+
const seriesData = forecast.map((entry): Record<string, string | number> => ({
|
|
20
|
+
day: entry.day,
|
|
21
|
+
sunny: entry.sunny,
|
|
22
|
+
cloudy: entry.cloudy,
|
|
23
|
+
rainy: entry.rainy,
|
|
24
|
+
}));
|
|
27
25
|
|
|
28
26
|
return (
|
|
29
27
|
<BarChartMultiple
|
|
@@ -24,9 +24,7 @@ export function LiveEventsView() {
|
|
|
24
24
|
return (
|
|
25
25
|
<div className="flex h-full min-w-0 flex-col gap-3">
|
|
26
26
|
<div>
|
|
27
|
-
<h2 className="text-lg font-semibold">
|
|
28
|
-
{t('events.title', { fallback: 'Live Events' })}
|
|
29
|
-
</h2>
|
|
27
|
+
<h2 className="text-lg font-semibold">{t('events.title', { fallback: 'Live Events' })}</h2>
|
|
30
28
|
<p className="text-muted-foreground text-xs">
|
|
31
29
|
{t('events.description', {
|
|
32
30
|
fallback: 'Live graph events streamed from the OS over SSE (permission "events").',
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { useOsConfig } from '@bardioc/app-sdk/react';
|
|
2
2
|
import {
|
|
3
3
|
I18nProvider as BaseI18nProvider,
|
|
4
|
-
mergeTranslations,
|
|
5
4
|
useI18n,
|
|
6
5
|
type I18nConfig,
|
|
7
6
|
type TranslationMessages,
|
|
8
|
-
} from '@bardioc/i18n';
|
|
9
|
-
import { deMessages as baseDe, enMessages as baseEn } from '@bardioc/i18n/translations';
|
|
10
|
-
import { SUPPORTED_LOCALES, type Locale } from '@bardioc/types';
|
|
7
|
+
} from '@bardioc/i18n-core';
|
|
11
8
|
import { useEffect, useMemo, type ReactNode } from 'react';
|
|
12
9
|
import deMessages from './locales/de.json';
|
|
13
10
|
import enMessages from './locales/en.json';
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
export const SUPPORTED_LOCALES = ['en', 'de'] as const;
|
|
13
|
+
export type Locale = (typeof SUPPORTED_LOCALES)[number];
|
|
14
|
+
|
|
17
15
|
const DEFAULT_MESSAGES: Record<Locale, TranslationMessages> = {
|
|
18
|
-
en:
|
|
19
|
-
de:
|
|
16
|
+
en: enMessages,
|
|
17
|
+
de: deMessages,
|
|
20
18
|
};
|
|
21
19
|
|
|
22
20
|
const STORAGE_KEY = '{{APP_NAME}}.locale';
|
|
@@ -65,4 +63,4 @@ export function AppI18nProvider({ children, syncWithOs = false }: Readonly<AppI1
|
|
|
65
63
|
);
|
|
66
64
|
}
|
|
67
65
|
|
|
68
|
-
export { useI18n, useTranslation } from '@bardioc/i18n';
|
|
66
|
+
export { useI18n, useTranslation } from '@bardioc/i18n-core';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { SUPPORTED_LOCALES } from '@bardioc/types';
|
|
2
1
|
import { Button, ConnectedLanguageSwitcher } from '@bardioc/ui/components';
|
|
3
2
|
import { RefreshCw } from 'lucide-react';
|
|
4
3
|
import { LocationSelect } from '../climate/location-select';
|
|
5
4
|
import { useDashboard } from '../dashboard-provider';
|
|
6
|
-
import { useI18n, useTranslation } from '../i18n';
|
|
5
|
+
import { SUPPORTED_LOCALES, useI18n, useTranslation } from '../i18n';
|
|
7
6
|
|
|
8
7
|
export function Header() {
|
|
9
8
|
const { t } = useTranslation();
|
package/templates/vue/index.html
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<!
|
|
2
|
-
<html lang="en" class="dark" style="height: 100%; margin: 0">
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en" class="dark" style="height: 100%; margin: 0; color-scheme: dark">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|