@astrale-os/shell-react 0.4.0-beta.20 → 0.4.0-beta.21
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Spinner } from '@astrale-os/ui/spinner';
|
|
2
3
|
import { Component, Fragment } from 'react';
|
|
3
4
|
import { useConnection } from '../session/connection/connection.hook.js';
|
|
4
5
|
export function ViewBoundary(props) {
|
|
@@ -38,8 +39,22 @@ export class ViewErrorBoundary extends Component {
|
|
|
38
39
|
return _jsx(Fragment, { children: content }, this.state.generation);
|
|
39
40
|
}
|
|
40
41
|
}
|
|
42
|
+
// The boot fallback also renders before an application supplies any theme or Tailwind CSS.
|
|
43
|
+
const VIEW_LOADING_STYLES = `
|
|
44
|
+
@keyframes astrale-view-loading-spin { to { transform: rotate(360deg); } }
|
|
45
|
+
[data-astrale-view-loading] { animation: astrale-view-loading-spin 1s linear infinite; }
|
|
46
|
+
@media (prefers-reduced-motion: reduce) {
|
|
47
|
+
[data-astrale-view-loading] { animation: none; }
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
41
50
|
export function defaultViewLoading() {
|
|
42
|
-
return (
|
|
51
|
+
return (_jsxs("div", { style: {
|
|
52
|
+
display: 'grid',
|
|
53
|
+
position: 'fixed',
|
|
54
|
+
inset: 0,
|
|
55
|
+
placeItems: 'center',
|
|
56
|
+
color: 'var(--ui-muted-foreground, GrayText)',
|
|
57
|
+
}, children: [_jsx("style", { children: VIEW_LOADING_STYLES }), _jsx("span", { "data-astrale-view-loading": "", style: { display: 'flex' }, children: _jsx(Spinner, { "aria-label": "Loading view\u2026", "aria-live": "polite", style: { width: 20, height: 20, animation: 'none' } }) })] }));
|
|
43
58
|
}
|
|
44
59
|
export function defaultViewError(error, retry) {
|
|
45
60
|
const message = error instanceof Error ? error.message : String(error);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrale-os/shell-react",
|
|
3
|
-
"version": "0.4.0-beta.
|
|
3
|
+
"version": "0.4.0-beta.21",
|
|
4
4
|
"description": "Astrale shell-react — the React face of the shell (provider, hooks, view components)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@astrale-os/shell": ">=0.5.0-beta.15 <1.0.0",
|
|
30
|
+
"@astrale-os/ui": ">=0.3.0-beta.29 <1.0.0",
|
|
30
31
|
"jose": "^6.2.8",
|
|
31
32
|
"zod": "4.4.3"
|
|
32
33
|
},
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CredentialSnapshot } from '@astrale-os/shell'
|
|
2
2
|
import type { ReactElement, ReactNode } from 'react'
|
|
3
3
|
|
|
4
|
+
import { Spinner } from '@astrale-os/ui/spinner'
|
|
4
5
|
import { Component, Fragment } from 'react'
|
|
5
6
|
|
|
6
7
|
import type { GraphResource } from '../graph/resource.js'
|
|
@@ -67,10 +68,34 @@ export class ViewErrorBoundary extends Component<
|
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
|
|
71
|
+
// The boot fallback also renders before an application supplies any theme or Tailwind CSS.
|
|
72
|
+
const VIEW_LOADING_STYLES = `
|
|
73
|
+
@keyframes astrale-view-loading-spin { to { transform: rotate(360deg); } }
|
|
74
|
+
[data-astrale-view-loading] { animation: astrale-view-loading-spin 1s linear infinite; }
|
|
75
|
+
@media (prefers-reduced-motion: reduce) {
|
|
76
|
+
[data-astrale-view-loading] { animation: none; }
|
|
77
|
+
}
|
|
78
|
+
`
|
|
79
|
+
|
|
70
80
|
export function defaultViewLoading(): ReactElement {
|
|
71
81
|
return (
|
|
72
|
-
<div
|
|
73
|
-
|
|
82
|
+
<div
|
|
83
|
+
style={{
|
|
84
|
+
display: 'grid',
|
|
85
|
+
position: 'fixed',
|
|
86
|
+
inset: 0,
|
|
87
|
+
placeItems: 'center',
|
|
88
|
+
color: 'var(--ui-muted-foreground, GrayText)',
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
<style>{VIEW_LOADING_STYLES}</style>
|
|
92
|
+
<span data-astrale-view-loading="" style={{ display: 'flex' }}>
|
|
93
|
+
<Spinner
|
|
94
|
+
aria-label="Loading view…"
|
|
95
|
+
aria-live="polite"
|
|
96
|
+
style={{ width: 20, height: 20, animation: 'none' }}
|
|
97
|
+
/>
|
|
98
|
+
</span>
|
|
74
99
|
</div>
|
|
75
100
|
)
|
|
76
101
|
}
|