@adea-ai/app-framework 0.46.12 → 0.48.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/README.md +2 -1
- package/dist/app/application.d.ts +2 -1
- package/dist/app/application.js +27 -16
- package/dist/app/create-application.js +6 -3
- package/dist/appearance/appearance-host.d.ts +2 -1
- package/dist/appearance/appearance-host.js +28 -21
- package/dist/appearance/editor.js +21 -3
- package/dist/framework-source.json +1 -1
- package/dist/shell/app-shell.d.ts +1 -1
- package/dist/shell/app-shell.js +97 -87
- package/dist/shell/app-utilities.d.ts +1 -1
- package/dist/shell/app-utilities.js +42 -23
- package/dist/shell/media-query.js +12 -10
- package/dist/shell/navigation-drawer.d.ts +1 -1
- package/dist/shell/navigation-drawer.js +6 -4
- package/dist/shell/poll.js +9 -11
- package/dist/shell/settings-sections.d.ts +1 -1
- package/dist/views/app-about.d.ts +1 -1
- package/dist/views/app-about.js +1 -1
- package/dist/views/app-appearance.d.ts +2 -1
- package/dist/views/app-appearance.js +4 -4
- package/dist/views/app-help.d.ts +1 -1
- package/dist/views/app-help.js +1 -1
- package/dist/views/app-settings.d.ts +2 -1
- package/dist/views/app-settings.js +15 -10
- package/dist/views/appearance-surface.d.ts +1 -1
- package/dist/views/appearance-surface.js +116 -91
- package/dist/views/update-surface.d.ts +1 -1
- package/dist/views/update-surface.js +1 -1
- package/dist/voice/voice-build.d.ts +62 -0
- package/dist/voice/voice-build.js +247 -0
- package/dist/voice/voice-client.d.ts +130 -0
- package/dist/voice/voice-client.js +405 -0
- package/dist/voice/voice-controls.d.ts +43 -0
- package/dist/voice/voice-controls.js +313 -0
- package/dist/voice/voice-host.d.ts +29 -0
- package/dist/voice/voice-host.js +248 -0
- package/dist/voice/voice-protocol.d.ts +127 -0
- package/dist/voice/voice-protocol.js +120 -0
- package/dist/voice/voice-settings.d.ts +15 -0
- package/dist/voice/voice-settings.js +1095 -0
- package/dist/voice/voice.d.ts +5 -0
- package/dist/voice/voice.js +5 -0
- package/package.json +32 -14
- package/src/app/application.tsx +28 -32
- package/src/appearance/appearance-host.tsx +30 -19
- package/src/appearance/editor.ts +25 -3
- package/src/shell/app-shell.tsx +46 -37
- package/src/shell/app-utilities.tsx +38 -40
- package/src/shell/media-query.ts +15 -10
- package/src/shell/navigation-drawer.tsx +1 -1
- package/src/shell/poll.ts +9 -10
- package/src/shell/settings-sections.ts +1 -1
- package/src/views/app-appearance.tsx +4 -3
- package/src/views/app-settings.tsx +2 -1
- package/src/views/appearance-surface.tsx +46 -35
- package/src/voice/voice-client.ts +579 -0
- package/src/voice/voice-controls.tsx +354 -0
- package/src/voice/voice-protocol.ts +189 -0
- package/src/voice/voice-settings.tsx +879 -0
- package/src/voice/voice.ts +13 -0
- package/templates/application/AGENTS.md +29 -0
- package/templates/application/src/web/main.tsx +2 -2
- package/templates/application/tsconfig.json +1 -1
- package/templates/application/vite.config.ts +1 -1
package/README.md
CHANGED
|
@@ -101,7 +101,7 @@ workflow commit and `CI_PIPELINE_ID` as the run, attempt 1.
|
|
|
101
101
|
|
|
102
102
|
Import a subpath; the package has no root export. Entries marked _solid_ also
|
|
103
103
|
export TypeScript source under the `solid` condition, which a Vite consumer with
|
|
104
|
-
|
|
104
|
+
`@solidjs/vite-plugin` (Solid 2) compiles itself. Entries marked _source only_ export
|
|
105
105
|
TypeScript source alone, and the rest resolve to `dist`. The package ships only
|
|
106
106
|
the source those entries reach, plus the Electrobun patches in `src/native`; a
|
|
107
107
|
test checks the file list against the exports.
|
|
@@ -117,6 +117,7 @@ fails if a library module gains a top-level statement.
|
|
|
117
117
|
| Appearance | `appearance-host`, `appearance-preferences`, `appearance-surface`, `custom-theme-library`, `window-surface` (all _solid_) |
|
|
118
118
|
| Desktop host | `desktop-host`, `desktop-gateway`, `desktop-client`, `desktop-detection`, `desktop-stream`, `channel-handshake`, `channel-proof`, `loopback-policy`, `bounded-body`, `open-url-channel`, `client-asset-manifest`, `client-assets` (source only), `client-dev-proxy` |
|
|
119
119
|
| Native windows and OS | `renderer-profile`, `secure-window`, `partitioned-window`, `window-options` (source only), `native-utilities`, `native-secret-store`, `app-bundle`, `sidecar`, `sidecar-services`, `desktop-build-hook`, `desktop-build`, `electrobun-types` (ambient types only) |
|
|
120
|
+
| Voice | `voice` (_solid_: the voice client, the Voice settings section, dictation and read-aloud controls), `voice-host` (the shell service over `@adea-ai/voice/desktop`), `voice-build` (stage and verify the pinned Voice helpers) |
|
|
120
121
|
| Native installers | `windows-extractor-build`, `installer-archive`, `window-surface-store` |
|
|
121
122
|
| Updates | `desktop-updater`, `update-manager`, `update-inherited-launch-lease`, `packaged-launch-admission`, `packaged-update-startup`, `update-resume`, `channel-update-manager`, `update-channel-store`, `update-discovery`, `update-download`, `update-extraction`, `signed-release`, `release-feed`, `update-adapter` (_solid_), `release-version` (_solid_), `update-state` (source only), `update-helper.js` (bundled helper) |
|
|
122
123
|
| Release tooling | `release-config`, `release-cut`, `release-steps`, `release-staging`, `release-artifact`, `release-assets-plan`, `release-descriptor-staging`, `release-publication`, `release-publish-command`, `release-promotion`, `retained-release-build`, `github-release-publisher`, `github-release-qualification`, `github-release-promotion`, `macos-dmg` |
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type Component, type
|
|
1
|
+
import { type Component, type ParentProps } from 'solid-js';
|
|
2
|
+
import { type JSX } from '@solidjs/web';
|
|
2
3
|
import type { ContextualSidebarProps } from '@adea-ai/ui/components/layout/contextual-sidebar';
|
|
3
4
|
import type { ThemeProviderProps } from '@adea-ai/ui/components/theme/lazy';
|
|
4
5
|
import { type ApplicationIdentity, type ApplicationUtilitiesProps } from '../shell/app-utilities';
|
package/dist/app/application.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ApplicationShell } from "../shell/app-shell.js";
|
|
2
2
|
import { ApplicationThemeProvider, ApplicationUtilities } from "../shell/app-utilities.js";
|
|
3
|
-
import { createComponent, memo, mergeProps } from "
|
|
4
|
-
import { createEffect, createMemo, createSignal
|
|
3
|
+
import { Dynamic, createComponent, memo, mergeProps } from "@solidjs/web";
|
|
4
|
+
import { createEffect, createMemo, createSignal } from "solid-js";
|
|
5
5
|
// src/app/application.tsx
|
|
6
6
|
/** Validate the static app identity and destinations before the UI mounts. */
|
|
7
7
|
function defineApplication(definition) {
|
|
@@ -21,23 +21,22 @@ function defineApplication(definition) {
|
|
|
21
21
|
}
|
|
22
22
|
/** Mount shared UI chrome from an app's own views and identity. */
|
|
23
23
|
function Application(props) {
|
|
24
|
-
const [localView, setLocalView] = createSignal(
|
|
24
|
+
const [localView, setLocalView] = createSignal();
|
|
25
25
|
const [routerRevision, setRouterRevision] = createSignal(0);
|
|
26
|
-
createEffect(() => {
|
|
27
|
-
const router = props.router;
|
|
26
|
+
createEffect(() => props.router, (router) => {
|
|
28
27
|
if (!router?.subscribe) return;
|
|
29
28
|
let active = true;
|
|
30
29
|
const unsubscribe = router.subscribe(() => {
|
|
31
30
|
if (active) setRouterRevision((revision) => revision + 1);
|
|
32
31
|
});
|
|
33
|
-
|
|
32
|
+
return () => {
|
|
34
33
|
active = false;
|
|
35
34
|
unsubscribe();
|
|
36
|
-
}
|
|
35
|
+
};
|
|
37
36
|
});
|
|
38
37
|
const view = createMemo(() => {
|
|
39
38
|
routerRevision();
|
|
40
|
-
const selected = props.router?.current() ?? localView();
|
|
39
|
+
const selected = props.router?.current() ?? localView() ?? props.definition.initialView;
|
|
41
40
|
return props.definition.views.find((item) => item.id === selected) ?? props.definition.views.find((item) => item.id === props.definition.initialView);
|
|
42
41
|
});
|
|
43
42
|
const navigate = (id) => {
|
|
@@ -49,14 +48,17 @@ function Application(props) {
|
|
|
49
48
|
setRouterRevision((revision) => revision + 1);
|
|
50
49
|
}
|
|
51
50
|
};
|
|
52
|
-
const
|
|
51
|
+
const DefaultTheme = (providerProps) => createComponent(ApplicationThemeProvider, mergeProps(() => {
|
|
52
|
+
return props.theme;
|
|
53
|
+
}, {
|
|
53
54
|
get storageKey() {
|
|
54
55
|
return props.definition.storageKey;
|
|
55
56
|
},
|
|
56
57
|
get children() {
|
|
57
58
|
return providerProps.children;
|
|
58
59
|
}
|
|
59
|
-
}))
|
|
60
|
+
}));
|
|
61
|
+
const theme = createMemo(() => props.themeProvider ?? DefaultTheme);
|
|
60
62
|
const Shell = () => {
|
|
61
63
|
const content = createMemo(() => view().render());
|
|
62
64
|
const sidebar = createMemo(() => view().sidebar?.());
|
|
@@ -114,13 +116,17 @@ function Application(props) {
|
|
|
114
116
|
return props.windowsInset;
|
|
115
117
|
},
|
|
116
118
|
get footer() {
|
|
117
|
-
return props.footer ?? createComponent(ApplicationUtilities, mergeProps(() =>
|
|
119
|
+
return props.footer ?? createComponent(ApplicationUtilities, mergeProps(() => {
|
|
120
|
+
return props.utilities;
|
|
121
|
+
}, {
|
|
118
122
|
get help() {
|
|
119
|
-
return memo(() =>
|
|
123
|
+
return memo(() => {
|
|
124
|
+
return !!props.utilities?.help;
|
|
125
|
+
})() ? {
|
|
120
126
|
search: Boolean(props.onSearch),
|
|
121
127
|
...props.utilities.help,
|
|
122
128
|
searchBinding: Boolean(props.onSearch)
|
|
123
|
-
};
|
|
129
|
+
} : props.utilities?.help;
|
|
124
130
|
},
|
|
125
131
|
get identity() {
|
|
126
132
|
return props.definition.identity;
|
|
@@ -132,8 +138,13 @@ function Application(props) {
|
|
|
132
138
|
}
|
|
133
139
|
});
|
|
134
140
|
};
|
|
135
|
-
return createComponent(
|
|
136
|
-
|
|
137
|
-
|
|
141
|
+
return createComponent(Dynamic, {
|
|
142
|
+
get component() {
|
|
143
|
+
return theme();
|
|
144
|
+
},
|
|
145
|
+
get children() {
|
|
146
|
+
return createComponent(Shell, {});
|
|
147
|
+
}
|
|
148
|
+
});
|
|
138
149
|
}
|
|
139
150
|
export { Application, defineApplication };
|
|
@@ -170,8 +170,11 @@ async function createApplication(options, dependencies = {}) {
|
|
|
170
170
|
dependencies: {
|
|
171
171
|
"@adea-ai/app-framework": options.frameworkSpecifier,
|
|
172
172
|
"@adea-ai/ui": uiVersion,
|
|
173
|
-
"lucide
|
|
174
|
-
"
|
|
173
|
+
"@lucide/solid": "^1.77.0",
|
|
174
|
+
"@solidjs/web": "2.0.3",
|
|
175
|
+
"@ui-sdk/core": "0.1.0-beta.13",
|
|
176
|
+
"@ui-sdk/solid": "0.1.0-beta.13",
|
|
177
|
+
"solid-js": "2.0.3"
|
|
175
178
|
},
|
|
176
179
|
devDependencies: {
|
|
177
180
|
"@shadcn/lint": "^0.2.0",
|
|
@@ -181,7 +184,7 @@ async function createApplication(options, dependencies = {}) {
|
|
|
181
184
|
tailwindcss: "^4.3.3",
|
|
182
185
|
vite: "npm:@voidzero-dev/vite-plus-core@1.4.0",
|
|
183
186
|
"vite-plus": "1.4.0",
|
|
184
|
-
"vite-plugin
|
|
187
|
+
"@solidjs/vite-plugin": "3.0.1",
|
|
185
188
|
electrobun: "2.0.5",
|
|
186
189
|
typescript: "^7.0.2",
|
|
187
190
|
"@types/bun": "^1.4.4"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ParentProps } from 'solid-js';
|
|
2
|
+
import type { JSX } from '@solidjs/web';
|
|
2
3
|
import { type ThemeContextValue as UiThemeContextValue, type ThemeProviderProps as UiThemeProviderProps } from '@adea-ai/ui/components/theme/lazy';
|
|
3
4
|
import { type AppearancePreferencesV2 } from './appearance-preferences';
|
|
4
5
|
/**
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { appearanceThemeScript, createAppearancePersistence, selectionFromPreferences } from "./appearance-preferences.js";
|
|
2
2
|
import { customUiVariants, readCustomThemeLibrary, subscribeCustomThemes } from "./theme-library-store.js";
|
|
3
3
|
import { LEGACY_IMPORTED_THEME_TOKEN_PROJECTION } from "./legacy-imported-theme-token-projection.js";
|
|
4
|
-
import { createComponent, effect, mergeProps, template } from "
|
|
4
|
+
import { createComponent, effect, mergeProps, template } from "@solidjs/web";
|
|
5
5
|
import { createContext, createEffect, createSignal, useContext } from "solid-js";
|
|
6
6
|
import { ThemeProvider as ThemeProvider$1, useOptionalTheme } from "@adea-ai/ui/components/theme/lazy";
|
|
7
7
|
import { projectThemeTokens } from "@adea-ai/ui/components/theme/token-projection";
|
|
8
8
|
import { defaultPreferenceStorage } from "@adea-ai/ui/lib/preference-store";
|
|
9
9
|
import { tokensAsHex } from "@adea-ai/ui/lib/themes";
|
|
10
10
|
// src/appearance/appearance-host.tsx
|
|
11
|
-
var _tmpl$ =
|
|
11
|
+
var _tmpl$ = /* @__PURE__ */ template(`<script>`);
|
|
12
12
|
var [libraryRevision, setLibraryRevision] = createSignal(0);
|
|
13
13
|
var subscribedToLibrary = false;
|
|
14
14
|
function libraryThemes() {
|
|
@@ -70,30 +70,35 @@ function createAppearanceContext(ui) {
|
|
|
70
70
|
};
|
|
71
71
|
createEffect(() => {
|
|
72
72
|
ui.selection();
|
|
73
|
-
|
|
73
|
+
return ui.previewing();
|
|
74
|
+
}, (previewing) => {
|
|
75
|
+
if (draft !== void 0 && !previewing) ui.preview(previewSelection(draft));
|
|
74
76
|
});
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
const update = (patch) => ui.setSelection(selectionFromPreferences(patch));
|
|
78
|
+
return Object.defineProperties({}, {
|
|
79
|
+
...Object.getOwnPropertyDescriptors(ui),
|
|
80
|
+
update: {
|
|
81
|
+
value: update,
|
|
82
|
+
enumerable: true
|
|
79
83
|
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
preview: {
|
|
85
|
+
value: preview,
|
|
86
|
+
enumerable: true
|
|
87
|
+
}
|
|
88
|
+
});
|
|
83
89
|
}
|
|
84
90
|
var CONTEXT_KEY = Symbol.for("adea.app.theme");
|
|
85
91
|
function appearanceContext() {
|
|
86
92
|
const host = globalThis;
|
|
87
|
-
return host[CONTEXT_KEY] ??= createContext();
|
|
93
|
+
return host[CONTEXT_KEY] ??= createContext(null);
|
|
88
94
|
}
|
|
89
95
|
function AppearanceBridge(props) {
|
|
90
96
|
const ui = useOptionalTheme();
|
|
91
97
|
if (!ui) throw new Error("The appearance bridge must render inside the shared ThemeProvider.");
|
|
92
98
|
const Context = appearanceContext();
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
},
|
|
99
|
+
const value = createAppearanceContext(ui);
|
|
100
|
+
return createComponent(Context, {
|
|
101
|
+
value,
|
|
97
102
|
get children() {
|
|
98
103
|
return props.children;
|
|
99
104
|
}
|
|
@@ -107,7 +112,9 @@ function AppearanceBridge(props) {
|
|
|
107
112
|
*/
|
|
108
113
|
function ThemeProvider(props) {
|
|
109
114
|
readCustomThemeLibrary(defaultPreferenceStorage());
|
|
110
|
-
return createComponent(ThemeProvider$1, mergeProps(() =>
|
|
115
|
+
return createComponent(ThemeProvider$1, mergeProps(() => {
|
|
116
|
+
return appearanceProviderProps({ nativeTranslucency: () => props.nativeTranslucency ?? false });
|
|
117
|
+
}, { get children() {
|
|
111
118
|
return createComponent(AppearanceBridge, { get children() {
|
|
112
119
|
return props.children;
|
|
113
120
|
} });
|
|
@@ -131,10 +138,10 @@ function useTheme() {
|
|
|
131
138
|
* wrong theme.
|
|
132
139
|
*/
|
|
133
140
|
function ThemeScript() {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
141
|
+
var _el$ = _tmpl$();
|
|
142
|
+
effect(() => appearanceThemeScript(), (_v$) => {
|
|
143
|
+
_el$.innerHTML = _v$;
|
|
144
|
+
});
|
|
145
|
+
return _el$;
|
|
139
146
|
}
|
|
140
147
|
export { ThemeProvider, ThemeScript, appearanceProviderProps, createAppearanceContext, useTheme };
|
|
@@ -33,9 +33,27 @@ function sameOptionalFont(left, right) {
|
|
|
33
33
|
return left?.family === right?.family && left?.size === right?.size;
|
|
34
34
|
}
|
|
35
35
|
function createAppearanceEditor(committed = defaultAppearancePreferences) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
let draftValue = committed;
|
|
37
|
+
let snapshotValue = committed;
|
|
38
|
+
let resetValue = false;
|
|
39
|
+
const [draftChanged, setDraftChanged] = createSignal(committed);
|
|
40
|
+
const [snapshotChanged, setSnapshotChanged] = createSignal(committed);
|
|
41
|
+
const [resetChanged, setResetChanged] = createSignal(false);
|
|
42
|
+
const draft = () => (draftChanged(), draftValue);
|
|
43
|
+
const snapshot = () => (snapshotChanged(), snapshotValue);
|
|
44
|
+
const resetAll = () => (resetChanged(), resetValue);
|
|
45
|
+
const setDraft = (value) => {
|
|
46
|
+
draftValue = value;
|
|
47
|
+
setDraftChanged(() => value);
|
|
48
|
+
};
|
|
49
|
+
const setSnapshot = (value) => {
|
|
50
|
+
snapshotValue = value;
|
|
51
|
+
setSnapshotChanged(() => value);
|
|
52
|
+
};
|
|
53
|
+
const setResetAll = (value) => {
|
|
54
|
+
resetValue = value;
|
|
55
|
+
setResetChanged(value);
|
|
56
|
+
};
|
|
39
57
|
return {
|
|
40
58
|
draft,
|
|
41
59
|
dirty: () => resetAll() || !samePreferences(draft(), snapshot()),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.
|
|
1
|
+
{"version":"0.48.0","commit":"b96e5139ca262974cd8958271ee60c72b5287c1c"}
|
package/dist/shell/app-shell.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { hasEditableKeyboardTarget } from "./keyboard-target.js";
|
|
2
2
|
import { createMediaQuery } from "./media-query.js";
|
|
3
|
-
import { className, createComponent, effect, insert, memo, mergeProps, template } from "
|
|
4
|
-
import { For,
|
|
3
|
+
import { className, createComponent, effect, insert, memo, mergeProps, template } from "@solidjs/web";
|
|
4
|
+
import { For, Loading, Show, children, createEffect, createMemo, createRenderEffect, createSignal, lazy, onSettled } from "solid-js";
|
|
5
5
|
import { AppShell, AppShellBody, AppShellContent, AppShellMain, SkipLink } from "@adea-ai/ui/components/layout/app-shell";
|
|
6
6
|
import { ContextualSidebar } from "@adea-ai/ui/components/layout/contextual-sidebar";
|
|
7
7
|
import { PixelPane } from "@adea-ai/ui/components/layout/pixel-pane";
|
|
@@ -10,10 +10,10 @@ import { ShellTopBar } from "@adea-ai/ui/components/layout/shell-top-bar";
|
|
|
10
10
|
import { SideRailItem, SideRailSection } from "@adea-ai/ui/components/layout/side-rail";
|
|
11
11
|
import { ActionButton } from "@adea-ai/ui/components/composites/action-button";
|
|
12
12
|
import { TooltipProvider } from "@adea-ai/ui/components/ui/tooltip";
|
|
13
|
-
import { PanelLeftClose, PanelLeftIcon, PanelLeftOpen } from "lucide
|
|
13
|
+
import { PanelLeftClose, PanelLeftIcon, PanelLeftOpen } from "@lucide/solid";
|
|
14
14
|
// src/shell/app-shell.tsx
|
|
15
|
-
var _tmpl$ =
|
|
16
|
-
var _tmpl$2 =
|
|
15
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div><!><!><!><!>`);
|
|
16
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<div data-slot=app-shell-main class="flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden">`);
|
|
17
17
|
var NavigationDrawer = lazy(() => import("./navigation-drawer.js").then((module) => ({ default: module.NavigationDrawer })));
|
|
18
18
|
function getSidebarResponsiveMode(sidebar) {
|
|
19
19
|
return sidebar?.responsiveMode;
|
|
@@ -33,8 +33,7 @@ function ApplicationShell(props) {
|
|
|
33
33
|
const [sidebarElementMobile, setSidebarElementMobile] = createSignal();
|
|
34
34
|
const sidebarElements = /* @__PURE__ */ new Map();
|
|
35
35
|
const sidebarElementCallbacks = /* @__PURE__ */ new Map();
|
|
36
|
-
createEffect(() => {
|
|
37
|
-
const nextCallback = sidebarProps()?.onSidebarElement;
|
|
36
|
+
createEffect(() => sidebarProps()?.onSidebarElement, (nextCallback) => {
|
|
38
37
|
for (const [mobile, element] of sidebarElements) {
|
|
39
38
|
const previousCallback = sidebarElementCallbacks.get(mobile);
|
|
40
39
|
if (previousCallback === nextCallback) continue;
|
|
@@ -51,25 +50,25 @@ function ApplicationShell(props) {
|
|
|
51
50
|
if (mode === "desktop") return false;
|
|
52
51
|
return sidebarMobile();
|
|
53
52
|
};
|
|
54
|
-
const restoreSidebarFocus = (sidebar) => {
|
|
53
|
+
const restoreSidebarFocus = (sidebar, current) => {
|
|
55
54
|
const active = sidebar?.ownerDocument.activeElement;
|
|
56
|
-
if (!
|
|
57
|
-
const restoreFocusRef =
|
|
55
|
+
if (!current || sidebar?.dataset.open !== "true" || !sidebar.isConnected || !active || !sidebar.contains(active)) return;
|
|
56
|
+
const restoreFocusRef = current.restoreFocusRef;
|
|
58
57
|
const target = restoreFocusRef ? restoreFocusRef() : sidebarToggle;
|
|
59
58
|
if (target?.isConnected) target.focus({ preventScroll: true });
|
|
60
59
|
};
|
|
61
60
|
let requestedModeInitialized = false;
|
|
62
61
|
let previousRequestedMode;
|
|
63
|
-
|
|
64
|
-
const next = getSidebarResponsiveMode(
|
|
62
|
+
createRenderEffect(() => sidebarProps(), (current) => {
|
|
63
|
+
const next = getSidebarResponsiveMode(current);
|
|
65
64
|
const shouldRestore = requestedModeInitialized && next === "mobile" && previousRequestedMode !== "mobile";
|
|
66
65
|
previousRequestedMode = next;
|
|
67
66
|
requestedModeInitialized = true;
|
|
68
|
-
if (shouldRestore)
|
|
67
|
+
if (shouldRestore) restoreSidebarFocus(sidebarElements.get(false), current);
|
|
69
68
|
});
|
|
70
69
|
const handleSidebarModeTransition = (event) => {
|
|
71
70
|
sidebarProps()?.onResponsiveModeTransition?.(event);
|
|
72
|
-
if (event.phase === "before" && event.from === "desktop" && event.to === "mobile") restoreSidebarFocus(event.desktopSidebar);
|
|
71
|
+
if (event.phase === "before" && event.from === "desktop" && event.to === "mobile") restoreSidebarFocus(event.desktopSidebar, sidebarProps());
|
|
73
72
|
};
|
|
74
73
|
const handleSidebarElement = (element, mobile) => {
|
|
75
74
|
if (element) {
|
|
@@ -88,8 +87,8 @@ function ApplicationShell(props) {
|
|
|
88
87
|
};
|
|
89
88
|
const [drawerOpen, setDrawerOpen] = createSignal(false);
|
|
90
89
|
const [drawerMounted, setDrawerMounted] = createSignal(false);
|
|
91
|
-
createEffect(() => {
|
|
92
|
-
if (
|
|
90
|
+
createEffect(narrow, (isNarrow) => {
|
|
91
|
+
if (isNarrow) setDrawerMounted(true);
|
|
93
92
|
else setDrawerOpen(false);
|
|
94
93
|
});
|
|
95
94
|
const leading = () => sidebarProps() ?? props.pane;
|
|
@@ -115,13 +114,13 @@ function ApplicationShell(props) {
|
|
|
115
114
|
event.preventDefault();
|
|
116
115
|
if (!event.repeat) props.onSearch();
|
|
117
116
|
};
|
|
118
|
-
|
|
117
|
+
onSettled(() => {
|
|
119
118
|
window.addEventListener("keydown", handleSearch);
|
|
120
119
|
window.addEventListener("keydown", handleToggle);
|
|
121
|
-
|
|
120
|
+
return () => {
|
|
122
121
|
window.removeEventListener("keydown", handleSearch);
|
|
123
122
|
window.removeEventListener("keydown", handleToggle);
|
|
124
|
-
}
|
|
123
|
+
};
|
|
125
124
|
});
|
|
126
125
|
const RailContent = () => {
|
|
127
126
|
const rail = children(() => props.rail);
|
|
@@ -143,14 +142,14 @@ function ApplicationShell(props) {
|
|
|
143
142
|
get label() {
|
|
144
143
|
return item.label;
|
|
145
144
|
},
|
|
146
|
-
get
|
|
145
|
+
get "aria-label"() {
|
|
147
146
|
return item.label;
|
|
148
147
|
},
|
|
149
148
|
get active() {
|
|
150
149
|
return props.activeDestination === item.id;
|
|
151
150
|
},
|
|
152
|
-
get
|
|
153
|
-
return props.activeDestination === item.id;
|
|
151
|
+
get "aria-pressed"() {
|
|
152
|
+
return props.activeDestination === item.id ? "true" : "false";
|
|
154
153
|
},
|
|
155
154
|
onClick: () => props.onNavigate(item.id),
|
|
156
155
|
get children() {
|
|
@@ -170,14 +169,18 @@ function ApplicationShell(props) {
|
|
|
170
169
|
openDelay: 150,
|
|
171
170
|
get children() {
|
|
172
171
|
var _el$ = _tmpl$();
|
|
172
|
+
var _el$2 = _el$.firstChild;
|
|
173
|
+
var _el$3 = _el$2.nextSibling;
|
|
174
|
+
var _el$4 = _el$3.nextSibling;
|
|
175
|
+
var _el$5 = _el$4.nextSibling;
|
|
173
176
|
insert(_el$, createComponent(SkipLink, {
|
|
174
177
|
get href() {
|
|
175
178
|
return `#${props.viewLandmark ?? "app-main"}`;
|
|
176
179
|
},
|
|
177
180
|
children: "Skip to content"
|
|
178
|
-
}),
|
|
181
|
+
}), _el$2);
|
|
179
182
|
insert(_el$, createComponent(ShellTopBar, {
|
|
180
|
-
get
|
|
183
|
+
get "aria-label"() {
|
|
181
184
|
return `${props.name} toolbar`;
|
|
182
185
|
},
|
|
183
186
|
get navigation() {
|
|
@@ -187,7 +190,9 @@ function ApplicationShell(props) {
|
|
|
187
190
|
return props.workspace;
|
|
188
191
|
},
|
|
189
192
|
get sidebarOpen() {
|
|
190
|
-
return memo(() =>
|
|
193
|
+
return memo(() => {
|
|
194
|
+
return !!(!narrow() && leading()?.open);
|
|
195
|
+
})() ? !isSidebarMobile() : !narrow() && leading()?.open;
|
|
191
196
|
},
|
|
192
197
|
get alignSidebarAtNarrow() {
|
|
193
198
|
return getSidebarResponsiveMode(sidebarProps()) === "desktop";
|
|
@@ -226,46 +231,42 @@ function ApplicationShell(props) {
|
|
|
226
231
|
get tooltip() {
|
|
227
232
|
return toggleLabel();
|
|
228
233
|
},
|
|
229
|
-
get
|
|
234
|
+
get "aria-label"() {
|
|
230
235
|
return toggleLabel();
|
|
231
236
|
},
|
|
232
|
-
get
|
|
233
|
-
return expanded();
|
|
237
|
+
get "aria-expanded"() {
|
|
238
|
+
return expanded() ? "true" : "false";
|
|
234
239
|
},
|
|
235
|
-
get
|
|
236
|
-
return memo(() =>
|
|
240
|
+
get "aria-controls"() {
|
|
241
|
+
return memo(() => {
|
|
242
|
+
return !!(narrow() || sidebarProps());
|
|
243
|
+
})() ? void 0 : props.pane?.id;
|
|
237
244
|
},
|
|
238
245
|
onClick: toggle,
|
|
239
246
|
get children() {
|
|
240
|
-
return
|
|
241
|
-
|
|
242
|
-
return narrow();
|
|
243
|
-
},
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
},
|
|
257
|
-
get children() {
|
|
258
|
-
return createComponent(PanelLeftIcon, { "aria-hidden": "true" });
|
|
259
|
-
}
|
|
247
|
+
return memo(() => {
|
|
248
|
+
return memo(() => {
|
|
249
|
+
return !!narrow();
|
|
250
|
+
})() ? createComponent(PanelLeftIcon, { "aria-hidden": "true" }) : createComponent(Show, {
|
|
251
|
+
get when() {
|
|
252
|
+
return leading()?.open;
|
|
253
|
+
},
|
|
254
|
+
get fallback() {
|
|
255
|
+
return createComponent(PanelLeftOpen, { "aria-hidden": "true" });
|
|
256
|
+
},
|
|
257
|
+
get children() {
|
|
258
|
+
return createComponent(PanelLeftClose, { "aria-hidden": "true" });
|
|
259
|
+
}
|
|
260
|
+
});
|
|
260
261
|
});
|
|
261
262
|
}
|
|
262
263
|
});
|
|
263
264
|
}
|
|
264
265
|
});
|
|
265
266
|
}
|
|
266
|
-
}),
|
|
267
|
+
}), _el$3);
|
|
267
268
|
insert(_el$, createComponent(AppShell, {
|
|
268
|
-
|
|
269
|
+
class: "min-h-0 h-full flex-1",
|
|
269
270
|
get children() {
|
|
270
271
|
return [createComponent(Show, {
|
|
271
272
|
get when() {
|
|
@@ -273,7 +274,7 @@ function ApplicationShell(props) {
|
|
|
273
274
|
},
|
|
274
275
|
get children() {
|
|
275
276
|
return createComponent(ShellRail, {
|
|
276
|
-
get
|
|
277
|
+
get "aria-label"() {
|
|
277
278
|
return `${props.name} navigation`;
|
|
278
279
|
},
|
|
279
280
|
get mark() {
|
|
@@ -306,34 +307,35 @@ function ApplicationShell(props) {
|
|
|
306
307
|
return sidebarProps();
|
|
307
308
|
},
|
|
308
309
|
children: (sidebar) => createComponent(PixelPane, {
|
|
309
|
-
|
|
310
|
+
class: "overflow-visible",
|
|
310
311
|
get hidden() {
|
|
311
312
|
return narrow() || isSidebarMobile();
|
|
312
313
|
},
|
|
313
314
|
get width() {
|
|
314
|
-
return memo(() =>
|
|
315
|
+
return memo(() => {
|
|
316
|
+
return !!sidebar().open;
|
|
317
|
+
})() ? sidebar().width : 0;
|
|
315
318
|
},
|
|
316
319
|
get children() {
|
|
317
|
-
return
|
|
318
|
-
|
|
319
|
-
return !props.drawer || !narrow();
|
|
320
|
-
},
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}
|
|
320
|
+
return memo(() => {
|
|
321
|
+
return memo(() => {
|
|
322
|
+
return !!(!props.drawer || !narrow());
|
|
323
|
+
})() ? createComponent(ContextualSidebar, mergeProps(() => {
|
|
324
|
+
return sidebar();
|
|
325
|
+
}, {
|
|
326
|
+
content: renderSidebarContent,
|
|
327
|
+
get header() {
|
|
328
|
+
return sidebarHeader() && renderSidebarHeader;
|
|
329
|
+
},
|
|
330
|
+
get footer() {
|
|
331
|
+
return sidebarFooter() && renderSidebarFooter;
|
|
332
|
+
},
|
|
333
|
+
onSidebarElement: handleSidebarElement,
|
|
334
|
+
onResponsiveModeTransition: handleSidebarModeTransition,
|
|
335
|
+
get restoreFocusRef() {
|
|
336
|
+
return sidebar().restoreFocusRef ?? (() => sidebarToggle);
|
|
337
|
+
}
|
|
338
|
+
})) : void 0;
|
|
337
339
|
});
|
|
338
340
|
}
|
|
339
341
|
})
|
|
@@ -342,11 +344,11 @@ function ApplicationShell(props) {
|
|
|
342
344
|
return !props.viewLandmark;
|
|
343
345
|
},
|
|
344
346
|
get fallback() {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
347
|
+
var _el$6 = _tmpl$2();
|
|
348
|
+
insert(_el$6, () => {
|
|
349
|
+
return props.content;
|
|
350
|
+
});
|
|
351
|
+
return _el$6;
|
|
350
352
|
},
|
|
351
353
|
get children() {
|
|
352
354
|
return createComponent(AppShellMain, {
|
|
@@ -358,21 +360,27 @@ function ApplicationShell(props) {
|
|
|
358
360
|
});
|
|
359
361
|
}
|
|
360
362
|
})];
|
|
361
|
-
} }), memo(() =>
|
|
363
|
+
} }), memo(() => {
|
|
364
|
+
return props.status;
|
|
365
|
+
})];
|
|
362
366
|
} })];
|
|
363
367
|
}
|
|
364
|
-
}),
|
|
368
|
+
}), _el$4);
|
|
365
369
|
insert(_el$, createComponent(Show, {
|
|
366
370
|
get when() {
|
|
367
|
-
return memo(() =>
|
|
371
|
+
return memo(() => {
|
|
372
|
+
return !!drawerMounted();
|
|
373
|
+
})() ? props.drawer : drawerMounted();
|
|
368
374
|
},
|
|
369
|
-
children: (drawer) => createComponent(
|
|
375
|
+
children: (drawer) => createComponent(Loading, { get children() {
|
|
370
376
|
return createComponent(NavigationDrawer, {
|
|
371
377
|
get name() {
|
|
372
378
|
return props.name;
|
|
373
379
|
},
|
|
374
380
|
get open() {
|
|
375
|
-
return memo(() =>
|
|
381
|
+
return memo(() => {
|
|
382
|
+
return !!narrow();
|
|
383
|
+
})() ? drawerOpen() : narrow();
|
|
376
384
|
},
|
|
377
385
|
onOpenChange: setDrawerOpen,
|
|
378
386
|
restoreFocus: () => sidebarToggle,
|
|
@@ -381,8 +389,10 @@ function ApplicationShell(props) {
|
|
|
381
389
|
}
|
|
382
390
|
});
|
|
383
391
|
} })
|
|
384
|
-
}),
|
|
385
|
-
effect(() =>
|
|
392
|
+
}), _el$5);
|
|
393
|
+
effect(() => `flex h-screen w-screen flex-col overflow-hidden ${props.class ?? ""}`, (_v$, _$p) => {
|
|
394
|
+
className(_el$, _v$, _$p);
|
|
395
|
+
});
|
|
386
396
|
return _el$;
|
|
387
397
|
}
|
|
388
398
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type AccountMenuItem } from '@adea-ai/ui/components/composites/account-menu';
|
|
2
2
|
import type { UpdateAdapter, UpdateState } from '@adea-ai/ui/components/composites/update-dialog';
|
|
3
3
|
import { type ThemeProviderProps } from '@adea-ai/ui/components/theme/lazy';
|
|
4
|
-
import {
|
|
4
|
+
import type { JSX } from '@solidjs/web';
|
|
5
5
|
import { type HelpLink, type HelpShortcut } from './help-shortcuts';
|
|
6
6
|
import { type ApplicationSettingsSection } from './settings-sections';
|
|
7
7
|
import { type ShortcutPlatform } from './shortcut-platform';
|