@adea-ai/app-framework 0.0.0-stage → 0.24.1
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 +201 -0
- package/NOTICE +30 -0
- package/README.md +1009 -2
- package/dist/app/application.d.ts +47 -0
- package/dist/app/application.js +115 -0
- package/dist/app/create-application.d.ts +13 -0
- package/dist/app/create-application.js +178 -0
- package/dist/app/service-registry.d.ts +44 -0
- package/dist/app/service-registry.js +116 -0
- package/dist/appearance/appearance-host.d.ts +62 -0
- package/dist/appearance/appearance-host.js +115 -0
- package/dist/appearance/appearance-preferences.d.ts +106 -0
- package/dist/appearance/appearance-preferences.js +175 -0
- package/dist/appearance/composition.d.ts +11 -0
- package/dist/appearance/composition.js +16 -0
- package/dist/appearance/custom-theme-import.d.ts +14 -0
- package/dist/appearance/custom-theme-import.js +315 -0
- package/dist/appearance/custom-theme-library.d.ts +146 -0
- package/dist/appearance/custom-theme-library.js +378 -0
- package/dist/appearance/editor.d.ts +20 -0
- package/dist/appearance/editor.js +47 -0
- package/dist/appearance/theme-file-importer.d.ts +23 -0
- package/dist/appearance/theme-file-importer.js +66 -0
- package/dist/appearance/theme-record-adapter.d.ts +26 -0
- package/dist/appearance/theme-record-adapter.js +64 -0
- package/dist/appearance/theme-registry.d.ts +10 -0
- package/dist/appearance/theme-registry.js +16 -0
- package/dist/appearance/window-surface.d.ts +5 -0
- package/dist/appearance/window-surface.js +9 -0
- package/dist/ci/toolchain-identity.d.ts +39 -0
- package/dist/ci/toolchain-identity.js +196 -0
- package/dist/cli/cef-helper-cli.d.ts +2 -0
- package/dist/cli/cef-helper-cli.js +18 -0
- package/dist/cli/cli-runner.d.ts +8 -0
- package/dist/cli/cli-runner.js +23 -0
- package/dist/cli/create-application-cli.d.ts +2 -0
- package/dist/cli/create-application-cli.js +40 -0
- package/dist/cli/electrobun-shortcut-patch-cli.d.ts +2 -0
- package/dist/cli/electrobun-shortcut-patch-cli.js +17 -0
- package/dist/cli/framework-update-cli.d.ts +2 -0
- package/dist/cli/framework-update-cli.js +40 -0
- package/dist/cli/release-assets-plan-cli.d.ts +2 -0
- package/dist/cli/release-assets-plan-cli.js +14 -0
- package/dist/cli/release-cut-cli.d.ts +2 -0
- package/dist/cli/release-cut-cli.js +27 -0
- package/dist/cli/release-descriptor-staging-cli.d.ts +2 -0
- package/dist/cli/release-descriptor-staging-cli.js +45 -0
- package/dist/cli/release-finalize-cli.d.ts +1 -0
- package/dist/cli/release-finalize-cli.js +30 -0
- package/dist/cli/release-promote-cli.d.ts +2 -0
- package/dist/cli/release-promote-cli.js +32 -0
- package/dist/cli/release-publish-cli.d.ts +2 -0
- package/dist/cli/release-publish-cli.js +48 -0
- package/dist/cli/release-sign-cli.d.ts +2 -0
- package/dist/cli/release-sign-cli.js +13 -0
- package/dist/cli/release-step-cli.d.ts +2 -0
- package/dist/cli/release-step-cli.js +44 -0
- package/dist/cli/toolchain-identity-cli.d.ts +2 -0
- package/dist/cli/toolchain-identity-cli.js +10 -0
- package/dist/cli/update-helper-cli.d.ts +1 -0
- package/dist/cli/update-helper-cli.js +10 -0
- package/dist/cli/windows-runtime-patch-cli.d.ts +2 -0
- package/dist/cli/windows-runtime-patch-cli.js +17 -0
- package/dist/desktop/application-command-client.d.ts +15 -0
- package/dist/desktop/application-command-client.js +21 -0
- package/dist/desktop/channel-handshake.d.ts +32 -0
- package/dist/desktop/channel-handshake.js +111 -0
- package/dist/desktop/channel-proof.d.ts +43 -0
- package/dist/desktop/channel-proof.js +85 -0
- package/dist/desktop/client-assets.d.ts +7 -0
- package/dist/desktop/client-assets.js +59 -0
- package/dist/desktop/desktop-client.d.ts +23 -0
- package/dist/desktop/desktop-client.js +231 -0
- package/dist/desktop/desktop-gateway.d.ts +18 -0
- package/dist/desktop/desktop-gateway.js +146 -0
- package/dist/desktop/desktop-host.d.ts +48 -0
- package/dist/desktop/desktop-host.js +208 -0
- package/dist/desktop/desktop-stream.d.ts +36 -0
- package/dist/desktop/desktop-stream.js +231 -0
- package/dist/desktop/loopback-policy.d.ts +19 -0
- package/dist/desktop/loopback-policy.js +23 -0
- package/dist/desktop/open-url-channel.d.ts +15 -0
- package/dist/desktop/open-url-channel.js +55 -0
- package/dist/desktop/string-policy.d.ts +2 -0
- package/dist/desktop/string-policy.js +11 -0
- package/dist/framework-source.json +1 -0
- package/dist/installer/archive-entry.d.ts +6 -0
- package/dist/installer/archive-entry.js +14 -0
- package/dist/installer/command-artifact.d.ts +47 -0
- package/dist/installer/command-artifact.js +261 -0
- package/dist/installer/command-qualification-command.d.ts +12 -0
- package/dist/installer/command-qualification-command.js +71 -0
- package/dist/installer/hosted-runner.d.ts +4 -0
- package/dist/installer/hosted-runner.js +10 -0
- package/dist/installer/installed-payload.d.ts +29 -0
- package/dist/installer/installed-payload.js +312 -0
- package/dist/installer/installer-ci-bootstrap.d.ts +26 -0
- package/dist/installer/installer-ci-bootstrap.js +160 -0
- package/dist/installer/installer-ci-preflight.d.ts +1 -0
- package/dist/installer/installer-ci-preflight.js +49 -0
- package/dist/installer/installer-ci-worker.d.ts +1 -0
- package/dist/installer/installer-ci-worker.js +105 -0
- package/dist/installer/installer-extraction.d.ts +14 -0
- package/dist/installer/installer-extraction.js +289 -0
- package/dist/installer/installer-fetch-guard.d.ts +15 -0
- package/dist/installer/installer-fetch-guard.js +50 -0
- package/dist/installer/installer-identity.d.ts +23 -0
- package/dist/installer/installer-identity.js +286 -0
- package/dist/installer/installer-layout.d.ts +21 -0
- package/dist/installer/installer-layout.js +89 -0
- package/dist/installer/installer-observation.d.ts +64 -0
- package/dist/installer/installer-observation.js +473 -0
- package/dist/installer/installer-process-cleanup.d.ts +18 -0
- package/dist/installer/installer-process-cleanup.js +158 -0
- package/dist/installer/installer-qualification-command.d.ts +11 -0
- package/dist/installer/installer-qualification-command.js +71 -0
- package/dist/installer/installer-renderer-evidence.d.ts +43 -0
- package/dist/installer/installer-renderer-evidence.js +136 -0
- package/dist/installer/installer-upgrade-command.d.ts +37 -0
- package/dist/installer/installer-upgrade-command.js +172 -0
- package/dist/installer/installer-worker-guard.d.ts +21 -0
- package/dist/installer/installer-worker-guard.js +72 -0
- package/dist/installer/native-executable.d.ts +5 -0
- package/dist/installer/native-executable.js +21 -0
- package/dist/installer/upgrade-asset-download.d.ts +13 -0
- package/dist/installer/upgrade-asset-download.js +41 -0
- package/dist/installer/write-all.d.ts +6 -0
- package/dist/installer/write-all.js +11 -0
- package/dist/native/app-bundle.d.ts +28 -0
- package/dist/native/app-bundle.js +60 -0
- package/dist/native/cef-helper.d.ts +28 -0
- package/dist/native/cef-helper.js +402 -0
- package/dist/native/desktop-build-hook.d.ts +7 -0
- package/dist/native/desktop-build-hook.js +20 -0
- package/dist/native/electrobun-source-patch.d.ts +25 -0
- package/dist/native/electrobun-source-patch.js +93 -0
- package/dist/native/linux-cef-links.d.ts +2 -0
- package/dist/native/linux-cef-links.js +15 -0
- package/dist/native/native-secret-store.d.ts +27 -0
- package/dist/native/native-secret-store.js +70 -0
- package/dist/native/native-utilities.d.ts +24 -0
- package/dist/native/native-utilities.js +85 -0
- package/dist/native/partitioned-window.d.ts +34 -0
- package/dist/native/partitioned-window.js +44 -0
- package/dist/native/renderer-profile.d.ts +53 -0
- package/dist/native/renderer-profile.js +30 -0
- package/dist/native/secure-window.d.ts +38 -0
- package/dist/native/secure-window.js +77 -0
- package/dist/native/sidecar-services.d.ts +23 -0
- package/dist/native/sidecar-services.js +46 -0
- package/dist/native/sidecar.d.ts +81 -0
- package/dist/native/sidecar.js +250 -0
- package/dist/native/window-bootstrap.d.ts +24 -0
- package/dist/native/window-bootstrap.js +63 -0
- package/dist/native/window-options.d.ts +32 -0
- package/dist/native/window-options.js +23 -0
- package/dist/native/windows-build-hook-internal.d.ts +2 -0
- package/dist/native/windows-build-hook-internal.js +32 -0
- package/dist/native/windows-build-hook.d.ts +2 -0
- package/dist/native/windows-build-hook.js +12 -0
- package/dist/native/windows-runtime-patch-internal.d.ts +3 -0
- package/dist/native/windows-runtime-patch-internal.js +20 -0
- package/dist/native/windows-runtime-patch.d.ts +4 -0
- package/dist/native/windows-runtime-patch.js +12 -0
- package/dist/release/feed-release-cut.d.ts +23 -0
- package/dist/release/feed-release-cut.js +93 -0
- package/dist/release/feed-state.d.ts +25 -0
- package/dist/release/feed-state.js +81 -0
- package/dist/release/framework-package-publish.d.ts +21 -0
- package/dist/release/framework-package-publish.js +127 -0
- package/dist/release/framework-update.d.ts +30 -0
- package/dist/release/framework-update.js +139 -0
- package/dist/release/github-cli.d.ts +6 -0
- package/dist/release/github-cli.js +16 -0
- package/dist/release/github-release-assets.d.ts +3 -0
- package/dist/release/github-release-assets.js +24 -0
- package/dist/release/github-release-cut.d.ts +14 -0
- package/dist/release/github-release-cut.js +174 -0
- package/dist/release/github-release-lookup.d.ts +7 -0
- package/dist/release/github-release-lookup.js +29 -0
- package/dist/release/github-release-promotion.d.ts +10 -0
- package/dist/release/github-release-promotion.js +78 -0
- package/dist/release/github-release-provenance.d.ts +9 -0
- package/dist/release/github-release-provenance.js +27 -0
- package/dist/release/github-release-publisher.d.ts +9 -0
- package/dist/release/github-release-publisher.js +63 -0
- package/dist/release/github-release-qualification.d.ts +12 -0
- package/dist/release/github-release-qualification.js +80 -0
- package/dist/release/local-provenance.d.ts +24 -0
- package/dist/release/local-provenance.js +72 -0
- package/dist/release/local-release.d.ts +133 -0
- package/dist/release/local-release.js +387 -0
- package/dist/release/macos-dmg.d.ts +22 -0
- package/dist/release/macos-dmg.js +91 -0
- package/dist/release/release-artifact.d.ts +6 -0
- package/dist/release/release-artifact.js +38 -0
- package/dist/release/release-assets-plan.d.ts +14 -0
- package/dist/release/release-assets-plan.js +65 -0
- package/dist/release/release-config.d.ts +76 -0
- package/dist/release/release-config.js +180 -0
- package/dist/release/release-cut-command.d.ts +13 -0
- package/dist/release/release-cut-command.js +39 -0
- package/dist/release/release-cut.d.ts +54 -0
- package/dist/release/release-cut.js +76 -0
- package/dist/release/release-descriptor-staging.d.ts +34 -0
- package/dist/release/release-descriptor-staging.js +147 -0
- package/dist/release/release-finalize.d.ts +16 -0
- package/dist/release/release-finalize.js +104 -0
- package/dist/release/release-promotion-command.d.ts +12 -0
- package/dist/release/release-promotion-command.js +28 -0
- package/dist/release/release-promotion.d.ts +29 -0
- package/dist/release/release-promotion.js +57 -0
- package/dist/release/release-publication.d.ts +33 -0
- package/dist/release/release-publication.js +138 -0
- package/dist/release/release-publish-command.d.ts +7 -0
- package/dist/release/release-publish-command.js +91 -0
- package/dist/release/release-qualification.d.ts +106 -0
- package/dist/release/release-qualification.js +135 -0
- package/dist/release/release-staging.d.ts +9 -0
- package/dist/release/release-staging.js +61 -0
- package/dist/release/release-steps.d.ts +38 -0
- package/dist/release/release-steps.js +147 -0
- package/dist/release/retained-release-build.d.ts +19 -0
- package/dist/release/retained-release-build.js +122 -0
- package/dist/shell/app-shell.d.ts +61 -0
- package/dist/shell/app-shell.js +306 -0
- package/dist/shell/app-utilities.d.ts +122 -0
- package/dist/shell/app-utilities.js +334 -0
- package/dist/shell/application-menu-commands.d.ts +5 -0
- package/dist/shell/application-menu-commands.js +11 -0
- package/dist/shell/application-menu.d.ts +61 -0
- package/dist/shell/application-menu.js +208 -0
- package/dist/shell/help-shortcuts.d.ts +12 -0
- package/dist/shell/help-shortcuts.js +22 -0
- package/dist/shell/navigation-drawer.d.ts +12 -0
- package/dist/shell/navigation-drawer.js +42 -0
- package/dist/shell/settings-sections.d.ts +31 -0
- package/dist/shell/settings-sections.js +50 -0
- package/dist/shell/shortcut-platform.d.ts +17 -0
- package/dist/shell/shortcut-platform.js +25 -0
- package/dist/update-helper.bundle.js +260 -0
- package/dist/updates/channel-update-manager.d.ts +46 -0
- package/dist/updates/channel-update-manager.js +114 -0
- package/dist/updates/desktop-updater.d.ts +104 -0
- package/dist/updates/desktop-updater.js +345 -0
- package/dist/updates/release-feed.d.ts +61 -0
- package/dist/updates/release-feed.js +111 -0
- package/dist/updates/release-location.d.ts +9 -0
- package/dist/updates/release-location.js +80 -0
- package/dist/updates/release-version.d.ts +12 -0
- package/dist/updates/release-version.js +43 -0
- package/dist/updates/signed-release.d.ts +63 -0
- package/dist/updates/signed-release.js +162 -0
- package/dist/updates/stable-file.d.ts +10 -0
- package/dist/updates/stable-file.js +22 -0
- package/dist/updates/update-adapter.d.ts +57 -0
- package/dist/updates/update-adapter.js +72 -0
- package/dist/updates/update-arm.d.ts +24 -0
- package/dist/updates/update-arm.js +95 -0
- package/dist/updates/update-channel-store.d.ts +8 -0
- package/dist/updates/update-channel-store.js +72 -0
- package/dist/updates/update-discovery.d.ts +13 -0
- package/dist/updates/update-discovery.js +56 -0
- package/dist/updates/update-download.d.ts +14 -0
- package/dist/updates/update-download.js +67 -0
- package/dist/updates/update-exclusive-rename.d.ts +2 -0
- package/dist/updates/update-exclusive-rename.js +52 -0
- package/dist/updates/update-extraction.d.ts +18 -0
- package/dist/updates/update-extraction.js +183 -0
- package/dist/updates/update-handoff-plan.d.ts +22 -0
- package/dist/updates/update-handoff-plan.js +28 -0
- package/dist/updates/update-helper.d.ts +24 -0
- package/dist/updates/update-helper.js +56 -0
- package/dist/updates/update-launch.d.ts +5 -0
- package/dist/updates/update-launch.js +27 -0
- package/dist/updates/update-manager.d.ts +40 -0
- package/dist/updates/update-manager.js +83 -0
- package/dist/updates/update-process-fence.d.ts +10 -0
- package/dist/updates/update-process-fence.js +114 -0
- package/dist/updates/update-resume.d.ts +13 -0
- package/dist/updates/update-resume.js +34 -0
- package/dist/updates/update-shutdown.d.ts +15 -0
- package/dist/updates/update-shutdown.js +29 -0
- package/dist/updates/update-state.d.ts +30 -0
- package/dist/updates/update-state.js +18 -0
- package/dist/updates/update-swap-stage.d.ts +27 -0
- package/dist/updates/update-swap-stage.js +58 -0
- package/dist/updates/update-swap.d.ts +10 -0
- package/dist/updates/update-swap.js +30 -0
- package/dist/views/app-about.d.ts +22 -0
- package/dist/views/app-about.js +43 -0
- package/dist/views/app-appearance.d.ts +11 -0
- package/dist/views/app-appearance.js +42 -0
- package/dist/views/app-help.d.ts +17 -0
- package/dist/views/app-help.js +42 -0
- package/dist/views/app-settings.d.ts +26 -0
- package/dist/views/app-settings.js +97 -0
- package/dist/views/appearance-surface.d.ts +9 -0
- package/dist/views/appearance-surface.js +334 -0
- package/dist/views/update-surface.d.ts +34 -0
- package/dist/views/update-surface.js +64 -0
- package/package.json +374 -4
- package/src/app/application.tsx +138 -0
- package/src/appearance/appearance-host.tsx +205 -0
- package/src/appearance/appearance-preferences.ts +287 -0
- package/src/appearance/composition.ts +29 -0
- package/src/appearance/custom-theme-import.ts +424 -0
- package/src/appearance/custom-theme-library.ts +600 -0
- package/src/appearance/editor.ts +94 -0
- package/src/appearance/theme-file-importer.ts +103 -0
- package/src/appearance/theme-record-adapter.ts +106 -0
- package/src/appearance/theme-registry.ts +20 -0
- package/src/appearance/window-surface.ts +18 -0
- package/src/desktop/client-assets.ts +75 -0
- package/src/native/electrobun-cef-main-frame-bridges.patch +63 -0
- package/src/native/electrobun-windows-shortcut-com.patch +923 -0
- package/src/native/renderer-profile.ts +27 -0
- package/src/native/window-options.ts +24 -0
- package/src/shell/app-shell.tsx +294 -0
- package/src/shell/app-utilities.tsx +437 -0
- package/src/shell/help-shortcuts.ts +24 -0
- package/src/shell/navigation-drawer.tsx +36 -0
- package/src/shell/settings-sections.ts +74 -0
- package/src/shell/shortcut-platform.ts +35 -0
- package/src/updates/release-version.ts +57 -0
- package/src/updates/update-adapter.ts +129 -0
- package/src/updates/update-state.ts +34 -0
- package/src/views/app-about.tsx +44 -0
- package/src/views/app-appearance.tsx +32 -0
- package/src/views/app-help.tsx +43 -0
- package/src/views/app-settings.tsx +88 -0
- package/src/views/appearance-surface.tsx +427 -0
- package/src/views/update-surface.tsx +85 -0
- package/templates/application/.gitattributes +1 -0
- package/templates/application/.github/workflows/release-assets.yml +29 -0
- package/templates/application/.github/workflows/release-finalize.yml +29 -0
- package/templates/application/.github/workflows/release-please.yml +19 -0
- package/templates/application/.github/workflows/release.yml +29 -0
- package/templates/application/.github/workflows/validation.yml +28 -0
- package/templates/application/.oxfmtrc.json +6 -0
- package/templates/application/.oxlintrc.json +48 -0
- package/templates/application/.release-please-manifest.json +3 -0
- package/templates/application/README.md +47 -0
- package/templates/application/electrobun.config.ts +22 -0
- package/templates/application/release-please-config.json +12 -0
- package/templates/application/scripts/app-version.ts +9 -0
- package/templates/application/scripts/build-desktop.ts +34 -0
- package/templates/application/scripts/secure-build.ts +1 -0
- package/templates/application/scripts/stage-release.ts +21 -0
- package/templates/application/src/bun/index.ts +80 -0
- package/templates/application/src/electrobun.d.ts +27 -0
- package/templates/application/src/web/index.html +12 -0
- package/templates/application/src/web/main.tsx +97 -0
- package/templates/application/src/web/public/icon.svg +1 -0
- package/templates/application/src/web/style.css +3 -0
- package/templates/application/tests/app-config.test.ts +9 -0
- package/templates/application/tsconfig.json +15 -0
- package/templates/application/vite.config.ts +10 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
UpdateAdapter,
|
|
3
|
+
UpdateChannel,
|
|
4
|
+
UpdateState,
|
|
5
|
+
} from '@adea-ai/ui/components/composites/update-dialog'
|
|
6
|
+
|
|
7
|
+
export type { UpdateAdapter, UpdateChannel, UpdateState }
|
|
8
|
+
|
|
9
|
+
/** Channel persistence as a `read`/`persist` pair. */
|
|
10
|
+
export type UpdateChannelStore = Readonly<{
|
|
11
|
+
read(): Promise<UpdateChannel>
|
|
12
|
+
/** Persist a selection; resolves with the channel that actually stuck. */
|
|
13
|
+
persist(channel: UpdateChannel): Promise<UpdateChannel>
|
|
14
|
+
}>
|
|
15
|
+
|
|
16
|
+
/** Channel persistence as a service exposing `channel`/`setChannel`. */
|
|
17
|
+
export type UpdateChannelService = Readonly<{
|
|
18
|
+
channel(): Promise<UpdateChannel>
|
|
19
|
+
setChannel(channel: UpdateChannel): Promise<UpdateChannel>
|
|
20
|
+
}>
|
|
21
|
+
|
|
22
|
+
/** Either channel shape the update surface accepts. */
|
|
23
|
+
export type UpdateChannelSource = UpdateChannelStore | UpdateChannelService
|
|
24
|
+
|
|
25
|
+
/** Normalize either channel shape to `read`/`persist`. */
|
|
26
|
+
export function updateChannelStore(source: UpdateChannelSource): UpdateChannelStore {
|
|
27
|
+
if ('read' in source) return source
|
|
28
|
+
return {
|
|
29
|
+
read: () => source.channel(),
|
|
30
|
+
persist: (channel) => source.setChannel(channel),
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Report every snapshot the updater answers with, for a pending-update badge that
|
|
36
|
+
* must not run a second checker. The wrapped adapter otherwise behaves identically.
|
|
37
|
+
*/
|
|
38
|
+
export function mirrorUpdateState(
|
|
39
|
+
adapter: UpdateAdapter,
|
|
40
|
+
onState: (state: UpdateState) => void
|
|
41
|
+
): UpdateAdapter {
|
|
42
|
+
const note = async (pending: Promise<UpdateState>) => {
|
|
43
|
+
const state = await pending
|
|
44
|
+
onState(state)
|
|
45
|
+
return state
|
|
46
|
+
}
|
|
47
|
+
const cancel = adapter.cancel
|
|
48
|
+
return {
|
|
49
|
+
...adapter,
|
|
50
|
+
check: () => note(adapter.check()),
|
|
51
|
+
getStatus: () => note(adapter.getStatus()),
|
|
52
|
+
install: (expectedVersion) => note(adapter.install(expectedVersion)),
|
|
53
|
+
...(cancel ? { cancel: () => note(cancel.call(adapter)) } : {}),
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** A native updater snapshot in snake_case, as Rust and older desktop hosts report it. */
|
|
58
|
+
export type NativeUpdateSnapshot = Readonly<{
|
|
59
|
+
available_version: string | null
|
|
60
|
+
changelog: string
|
|
61
|
+
current_version: string
|
|
62
|
+
downloaded_bytes: number
|
|
63
|
+
error: string | null
|
|
64
|
+
github_url: string | null
|
|
65
|
+
phase: UpdateState['phase']
|
|
66
|
+
release_date: string | null
|
|
67
|
+
release_notes?: string | null
|
|
68
|
+
restart_required: boolean
|
|
69
|
+
total_bytes: number | null
|
|
70
|
+
}>
|
|
71
|
+
|
|
72
|
+
/** A native updater that answers with snake_case snapshots. */
|
|
73
|
+
export type NativeUpdateAdapter = Readonly<{
|
|
74
|
+
check(): Promise<NativeUpdateSnapshot>
|
|
75
|
+
getStatus(): Promise<NativeUpdateSnapshot>
|
|
76
|
+
install(expectedVersion: string): Promise<NativeUpdateSnapshot>
|
|
77
|
+
isDesktopRuntime(): boolean
|
|
78
|
+
pollIntervalMs?: number
|
|
79
|
+
}>
|
|
80
|
+
|
|
81
|
+
/** Map a snake_case native snapshot to the shared update state. */
|
|
82
|
+
export function updateStateFromNative(
|
|
83
|
+
update: NativeUpdateSnapshot,
|
|
84
|
+
options: { releaseNotes?: boolean } = {}
|
|
85
|
+
): UpdateState {
|
|
86
|
+
return {
|
|
87
|
+
availableVersion: update.available_version,
|
|
88
|
+
changelog: update.changelog,
|
|
89
|
+
currentVersion: update.current_version,
|
|
90
|
+
downloadedBytes: update.downloaded_bytes,
|
|
91
|
+
error: update.error,
|
|
92
|
+
phase: update.phase,
|
|
93
|
+
releaseDate: update.release_date,
|
|
94
|
+
releaseNotes: options.releaseNotes ? (update.release_notes ?? null) : null,
|
|
95
|
+
releaseUrl: update.github_url,
|
|
96
|
+
restartRequired: update.restart_required,
|
|
97
|
+
totalBytes: update.total_bytes,
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Bridge a snake_case native updater to the shared adapter. Release notes are dropped
|
|
103
|
+
* unless requested, which keeps the dialog's per-release notes section hidden.
|
|
104
|
+
*/
|
|
105
|
+
export function nativeUpdateAdapter(
|
|
106
|
+
native: NativeUpdateAdapter | (() => NativeUpdateAdapter),
|
|
107
|
+
options: { releaseNotes?: boolean } = {}
|
|
108
|
+
): UpdateAdapter {
|
|
109
|
+
const current = typeof native === 'function' ? native : () => native
|
|
110
|
+
return {
|
|
111
|
+
check: async () => updateStateFromNative(await current().check(), options),
|
|
112
|
+
getStatus: async () => updateStateFromNative(await current().getStatus(), options),
|
|
113
|
+
install: async (expectedVersion) =>
|
|
114
|
+
updateStateFromNative(await current().install(expectedVersion), options),
|
|
115
|
+
isDesktopRuntime: () => current().isDesktopRuntime(),
|
|
116
|
+
pollIntervalMs: current().pollIntervalMs,
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** The adapter for a build with no installer: the dialog explains updates are desktop-only. */
|
|
121
|
+
export function browserUpdateAdapter(currentVersion = ''): UpdateAdapter {
|
|
122
|
+
const state: UpdateState = { phase: 'unavailable', currentVersion }
|
|
123
|
+
return {
|
|
124
|
+
check: async () => state,
|
|
125
|
+
getStatus: async () => state,
|
|
126
|
+
install: async () => state,
|
|
127
|
+
isDesktopRuntime: () => false,
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** The shared fields returned by the desktop update services. */
|
|
2
|
+
export type NativeUpdateState<Phase extends string = string> = Readonly<{
|
|
3
|
+
phase: Phase
|
|
4
|
+
current_version: string
|
|
5
|
+
available_version: string | null
|
|
6
|
+
changelog: string
|
|
7
|
+
release_notes: string | null
|
|
8
|
+
release_date: string | null
|
|
9
|
+
downloaded_bytes: number
|
|
10
|
+
total_bytes: number | null
|
|
11
|
+
error: string | null
|
|
12
|
+
github_url: string
|
|
13
|
+
restart_required: boolean
|
|
14
|
+
}>
|
|
15
|
+
|
|
16
|
+
/** Project a native snapshot into the shared UI update dialog contract. */
|
|
17
|
+
export function toUpdateState<Phase extends string>(
|
|
18
|
+
update: NativeUpdateState<Phase>,
|
|
19
|
+
options: { includeReleaseNotes?: boolean } = {}
|
|
20
|
+
) {
|
|
21
|
+
return {
|
|
22
|
+
phase: update.phase,
|
|
23
|
+
currentVersion: update.current_version,
|
|
24
|
+
availableVersion: update.available_version,
|
|
25
|
+
changelog: update.changelog,
|
|
26
|
+
releaseNotes: options.includeReleaseNotes === false ? null : update.release_notes,
|
|
27
|
+
releaseDate: update.release_date,
|
|
28
|
+
downloadedBytes: update.downloaded_bytes,
|
|
29
|
+
totalBytes: update.total_bytes,
|
|
30
|
+
error: update.error,
|
|
31
|
+
releaseUrl: update.github_url,
|
|
32
|
+
restartRequired: update.restart_required,
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { AboutDialog } from '@adea-ai/ui/components/composites/about-dialog'
|
|
2
|
+
import type { Accessor } from 'solid-js'
|
|
3
|
+
|
|
4
|
+
export type ApplicationAboutProps = {
|
|
5
|
+
/** The application's identity; `platform` is the label About shows. */
|
|
6
|
+
identity: Readonly<{
|
|
7
|
+
name: string
|
|
8
|
+
icon: string
|
|
9
|
+
version?: string
|
|
10
|
+
platform: string
|
|
11
|
+
copyright: string
|
|
12
|
+
sourceUrl: string
|
|
13
|
+
}>
|
|
14
|
+
open: boolean
|
|
15
|
+
/** Called when the dialog asks to close. */
|
|
16
|
+
onClose?(): void
|
|
17
|
+
/** Called with every open-state change the dialog requests. */
|
|
18
|
+
onOpenChange?(open: boolean): void
|
|
19
|
+
copyVersionInfo?(text: string): Promise<void>
|
|
20
|
+
openExternal?(url: string): Promise<void>
|
|
21
|
+
restoreFocusRef?: Accessor<HTMLElement | undefined>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** The shared About dialog, usable without `ApplicationUtilities`. Load it lazily. */
|
|
25
|
+
export function ApplicationAbout(props: ApplicationAboutProps) {
|
|
26
|
+
return (
|
|
27
|
+
<AboutDialog
|
|
28
|
+
appName={props.identity.name}
|
|
29
|
+
appIcon={props.identity.icon}
|
|
30
|
+
version={props.identity.version}
|
|
31
|
+
platform={props.identity.platform}
|
|
32
|
+
copyright={props.identity.copyright}
|
|
33
|
+
sourceUrl={props.identity.sourceUrl}
|
|
34
|
+
copyVersionInfo={props.copyVersionInfo}
|
|
35
|
+
openExternal={props.openExternal}
|
|
36
|
+
open={props.open}
|
|
37
|
+
onOpenChange={(open) => {
|
|
38
|
+
props.onOpenChange?.(open)
|
|
39
|
+
if (!open) props.onClose?.()
|
|
40
|
+
}}
|
|
41
|
+
restoreFocusRef={props.restoreFocusRef}
|
|
42
|
+
/>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ModalDialog } from '@adea-ai/ui/components/ui/modal-dialog'
|
|
2
|
+
import { lazy, Show, Suspense, type Accessor, type JSX } from 'solid-js'
|
|
3
|
+
|
|
4
|
+
const AppearancePanel = lazy(() =>
|
|
5
|
+
import('@adea-ai/ui/components/theme').then((module) => ({ default: module.AppearancePanel }))
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
export type ApplicationAppearanceProps = {
|
|
9
|
+
open: boolean
|
|
10
|
+
onClose(): void
|
|
11
|
+
/** The app's appearance surface; defaults to the shared provider's panel. */
|
|
12
|
+
panel?: JSX.Element
|
|
13
|
+
title?: string
|
|
14
|
+
restoreFocusRef?: Accessor<HTMLElement | undefined>
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** The shared Appearance dialog, usable without `ApplicationUtilities`. Load it lazily. */
|
|
18
|
+
export function ApplicationAppearance(props: ApplicationAppearanceProps) {
|
|
19
|
+
return (
|
|
20
|
+
<ModalDialog
|
|
21
|
+
open={props.open}
|
|
22
|
+
onClose={props.onClose}
|
|
23
|
+
title={props.title ?? 'Appearance'}
|
|
24
|
+
size="settings"
|
|
25
|
+
restoreFocusRef={props.restoreFocusRef}
|
|
26
|
+
>
|
|
27
|
+
<Suspense fallback={<span role="status">Loading appearance…</span>}>
|
|
28
|
+
<Show when={props.open}>{props.panel ?? <AppearancePanel />}</Show>
|
|
29
|
+
</Suspense>
|
|
30
|
+
</ModalDialog>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { HelpCenter } from '@adea-ai/ui/components/composites/help-center'
|
|
2
|
+
import { ModalDialog } from '@adea-ai/ui/components/ui/modal-dialog'
|
|
3
|
+
import type { Accessor } from 'solid-js'
|
|
4
|
+
import { standardShortcuts, type HelpLink, type HelpShortcut } from '../shell/help-shortcuts'
|
|
5
|
+
|
|
6
|
+
export * from '../shell/help-shortcuts'
|
|
7
|
+
|
|
8
|
+
export type ApplicationHelpProps = {
|
|
9
|
+
open: boolean
|
|
10
|
+
onClose(): void
|
|
11
|
+
appName: string
|
|
12
|
+
/** App-specific shortcuts, listed before the framework's own. */
|
|
13
|
+
shortcuts: readonly HelpShortcut[]
|
|
14
|
+
/** Appends the chords the framework binds; omit to list only the app's shortcuts. */
|
|
15
|
+
standard?: Parameters<typeof standardShortcuts>[0]
|
|
16
|
+
links: readonly HelpLink[]
|
|
17
|
+
openExternal?(url: string): Promise<void>
|
|
18
|
+
restoreFocusRef?: Accessor<HTMLElement | undefined>
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** The shared Help Center dialog: the app's real shortcuts and project resources. */
|
|
22
|
+
export function ApplicationHelp(props: ApplicationHelpProps) {
|
|
23
|
+
return (
|
|
24
|
+
<ModalDialog
|
|
25
|
+
open={props.open}
|
|
26
|
+
onClose={props.onClose}
|
|
27
|
+
title="Help Center"
|
|
28
|
+
description={`Keyboard shortcuts and resources for ${props.appName}.`}
|
|
29
|
+
restoreFocusRef={props.restoreFocusRef}
|
|
30
|
+
>
|
|
31
|
+
<HelpCenter
|
|
32
|
+
appName={props.appName}
|
|
33
|
+
shortcuts={[
|
|
34
|
+
...props.shortcuts,
|
|
35
|
+
...(props.standard ? standardShortcuts(props.standard) : []),
|
|
36
|
+
]}
|
|
37
|
+
links={props.links}
|
|
38
|
+
showHeader={false}
|
|
39
|
+
openExternal={props.openExternal}
|
|
40
|
+
/>
|
|
41
|
+
</ModalDialog>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { SettingsLayout } from '@adea-ai/ui/components/composites/settings'
|
|
2
|
+
import { ModalDialog } from '@adea-ai/ui/components/ui/modal-dialog'
|
|
3
|
+
import { TabsContent } from '@adea-ai/ui/components/ui/tabs'
|
|
4
|
+
import { Text } from '@adea-ai/ui/components/ui/typography'
|
|
5
|
+
import { For, Show, untrack, type Accessor, type JSX } from 'solid-js'
|
|
6
|
+
|
|
7
|
+
import { settingsGroups, type ApplicationSettingsSection } from '../shell/settings-sections'
|
|
8
|
+
|
|
9
|
+
export * from '../shell/settings-sections'
|
|
10
|
+
|
|
11
|
+
export type ApplicationSettingsProps = {
|
|
12
|
+
open: boolean
|
|
13
|
+
onClose(): void
|
|
14
|
+
sections: readonly ApplicationSettingsSection[]
|
|
15
|
+
section: string
|
|
16
|
+
onSectionChange(id: string): void
|
|
17
|
+
title?: string
|
|
18
|
+
restoreFocusRef?: Accessor<HTMLElement | undefined>
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type ApplicationSettingsPanelProps = {
|
|
22
|
+
sections: readonly ApplicationSettingsSection[]
|
|
23
|
+
section: string
|
|
24
|
+
onSectionChange(id: string): void
|
|
25
|
+
/** Wraps the panels, such as in one form that saves every section together. */
|
|
26
|
+
wrap?(panels: JSX.Element): JSX.Element
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Grouped settings navigation beside the selected app-owned panel, for an app that shows
|
|
31
|
+
* settings as a page. `ApplicationSettings` shows the same panel in a dialog.
|
|
32
|
+
*/
|
|
33
|
+
export function ApplicationSettingsPanel(props: ApplicationSettingsPanelProps) {
|
|
34
|
+
const active = () =>
|
|
35
|
+
props.sections.find((section) => section.id === props.section) ?? props.sections[0]
|
|
36
|
+
// Panels are keyed by section id, not by section object, so a caller that rebuilds its
|
|
37
|
+
// section list (an inline config read again) keeps the open panel mounted with its state;
|
|
38
|
+
// only the description follows the list. Panels are built inside the layout, whose tabs
|
|
39
|
+
// context they read.
|
|
40
|
+
const panels = () => (
|
|
41
|
+
<For each={props.sections.map((section) => section.id)}>
|
|
42
|
+
{(id) => {
|
|
43
|
+
const section = () => props.sections.find((candidate) => candidate.id === id)
|
|
44
|
+
return (
|
|
45
|
+
<TabsContent value={id}>
|
|
46
|
+
<Show when={active()?.id === id}>
|
|
47
|
+
<div class="flex min-w-0 flex-col gap-4">
|
|
48
|
+
<Show when={section()?.description}>
|
|
49
|
+
{(description) => <Text tone="muted">{description()}</Text>}
|
|
50
|
+
</Show>
|
|
51
|
+
{untrack(() => section()?.render())}
|
|
52
|
+
</div>
|
|
53
|
+
</Show>
|
|
54
|
+
</TabsContent>
|
|
55
|
+
)
|
|
56
|
+
}}
|
|
57
|
+
</For>
|
|
58
|
+
)
|
|
59
|
+
return (
|
|
60
|
+
<SettingsLayout
|
|
61
|
+
aria-label="Settings sections"
|
|
62
|
+
groups={settingsGroups(props.sections)}
|
|
63
|
+
value={active()?.id ?? ''}
|
|
64
|
+
onChange={props.onSectionChange}
|
|
65
|
+
>
|
|
66
|
+
{props.wrap ? props.wrap(panels()) : panels()}
|
|
67
|
+
</SettingsLayout>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** The shared settings dialog: grouped navigation beside the selected app-owned panel. */
|
|
72
|
+
export function ApplicationSettings(props: ApplicationSettingsProps) {
|
|
73
|
+
return (
|
|
74
|
+
<ModalDialog
|
|
75
|
+
open={props.open}
|
|
76
|
+
onClose={props.onClose}
|
|
77
|
+
title={props.title ?? 'Settings'}
|
|
78
|
+
size="settings"
|
|
79
|
+
restoreFocusRef={props.restoreFocusRef}
|
|
80
|
+
>
|
|
81
|
+
<ApplicationSettingsPanel
|
|
82
|
+
sections={props.sections}
|
|
83
|
+
section={props.section}
|
|
84
|
+
onSectionChange={props.onSectionChange}
|
|
85
|
+
/>
|
|
86
|
+
</ModalDialog>
|
|
87
|
+
)
|
|
88
|
+
}
|