@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
|
@@ -67,14 +67,14 @@ function clearResult() {
|
|
|
67
67
|
|
|
68
68
|
<div class="flex flex-wrap gap-2">
|
|
69
69
|
<button
|
|
70
|
-
class="bg-primary text-primary-foreground hover:bg-primary/90
|
|
70
|
+
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"
|
|
71
71
|
@click="runGetProfile"
|
|
72
72
|
:disabled="running"
|
|
73
73
|
>
|
|
74
74
|
Get Profile
|
|
75
75
|
</button>
|
|
76
76
|
<button
|
|
77
|
-
class="bg-primary text-primary-foreground hover:bg-primary/90
|
|
77
|
+
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"
|
|
78
78
|
@click="handleNotify"
|
|
79
79
|
:disabled="running"
|
|
80
80
|
>
|
|
@@ -89,11 +89,20 @@ function clearResult() {
|
|
|
89
89
|
</button>
|
|
90
90
|
</div>
|
|
91
91
|
|
|
92
|
-
<div
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
<div
|
|
93
|
+
class="border-border bg-background flex min-h-0 flex-1 flex-col overflow-hidden rounded border"
|
|
94
|
+
>
|
|
95
|
+
<div
|
|
96
|
+
v-if="result.status === 'idle'"
|
|
97
|
+
class="text-muted-foreground flex h-full items-center justify-center p-3 text-center text-xs leading-5"
|
|
98
|
+
>
|
|
99
|
+
Run a query to see results. If the host session is missing, the transport route will
|
|
100
|
+
return 401.
|
|
95
101
|
</div>
|
|
96
|
-
<div
|
|
102
|
+
<div
|
|
103
|
+
v-else-if="result.status === 'loading'"
|
|
104
|
+
class="flex h-full flex-col items-center justify-center gap-2 p-3"
|
|
105
|
+
>
|
|
97
106
|
<div class="text-muted-foreground font-mono text-xs">{{ result.request }}</div>
|
|
98
107
|
<div class="text-muted-foreground text-xs">Loading…</div>
|
|
99
108
|
</div>
|
|
@@ -103,11 +112,18 @@ function clearResult() {
|
|
|
103
112
|
</div>
|
|
104
113
|
<div class="text-destructive whitespace-pre-wrap break-all">{{ result.message }}</div>
|
|
105
114
|
</div>
|
|
106
|
-
<div
|
|
107
|
-
|
|
115
|
+
<div
|
|
116
|
+
v-else-if="result.status === 'success'"
|
|
117
|
+
class="flex h-full flex-col gap-0 overflow-hidden"
|
|
118
|
+
>
|
|
119
|
+
<div
|
|
120
|
+
class="border-border text-muted-foreground shrink-0 border-b px-3 py-1 font-mono text-xs"
|
|
121
|
+
>
|
|
108
122
|
{{ result.request }}
|
|
109
123
|
</div>
|
|
110
|
-
<pre class="text-foreground flex-1 overflow-auto p-3 text-[11px] leading-5">{{
|
|
124
|
+
<pre class="text-foreground flex-1 overflow-auto p-3 text-[11px] leading-5">{{
|
|
125
|
+
JSON.stringify(result.data, null, 2)
|
|
126
|
+
}}</pre>
|
|
111
127
|
</div>
|
|
112
128
|
</div>
|
|
113
129
|
</div>
|
|
@@ -4,20 +4,20 @@ import { inject, type InjectionKey } from 'vue';
|
|
|
4
4
|
export const BARDIOC_BRIDGE_KEY: InjectionKey<HostBridge> = Symbol('bardiocBridge');
|
|
5
5
|
|
|
6
6
|
export function createAppSdkBridge(appId: string): HostBridge {
|
|
7
|
-
|
|
7
|
+
return createHostBridge({ appId });
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export function useBardiocBridge(): HostBridge {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const bridge = inject(BARDIOC_BRIDGE_KEY);
|
|
12
|
+
if (!bridge) {
|
|
13
|
+
throw new Error('useBardiocBridge() must be used after providing BARDIOC_BRIDGE_KEY');
|
|
14
|
+
}
|
|
15
|
+
return bridge;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export function useNotify() {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
19
|
+
const bridge = useBardiocBridge();
|
|
20
|
+
return (message: string, level?: NotifyLevel) => {
|
|
21
|
+
bridge.notify(message, level);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -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,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="vite/client" />
|
|
2
2
|
|
|
3
3
|
interface ImportMetaEnv {
|
|
4
|
-
readonly VITE_APP_NAME: string
|
|
4
|
+
readonly VITE_APP_NAME: string;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
interface ImportMeta {
|
|
8
|
-
readonly env: ImportMetaEnv
|
|
8
|
+
readonly env: ImportMetaEnv;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
declare module '*.vue' {
|