@adea-ai/app-framework 0.0.0-stage → 0.24.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/LICENSE +201 -0
- package/NOTICE +30 -0
- package/README.md +967 -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 +125 -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 +318 -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/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 +363 -4
- package/src/app/application.tsx +138 -0
- package/src/app/create-application.ts +245 -0
- package/src/app/service-registry.ts +124 -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/ci/toolchain-identity.ts +244 -0
- package/src/cli/cef-helper-cli.ts +21 -0
- package/src/cli/cli-runner.ts +29 -0
- package/src/cli/create-application-cli.ts +62 -0
- package/src/cli/electrobun-shortcut-patch-cli.ts +24 -0
- package/src/cli/framework-update-cli.ts +41 -0
- package/src/cli/release-assets-plan-cli.ts +14 -0
- package/src/cli/release-cut-cli.ts +41 -0
- package/src/cli/release-descriptor-staging-cli.ts +57 -0
- package/src/cli/release-finalize-cli.ts +34 -0
- package/src/cli/release-promote-cli.ts +31 -0
- package/src/cli/release-publish-cli.ts +46 -0
- package/src/cli/release-sign-cli.ts +24 -0
- package/src/cli/release-step-cli.ts +71 -0
- package/src/cli/toolchain-identity-cli.ts +12 -0
- package/src/cli/update-helper-cli.ts +12 -0
- package/src/cli/windows-runtime-patch-cli.ts +17 -0
- package/src/desktop/application-command-client.ts +43 -0
- package/src/desktop/channel-handshake.ts +136 -0
- package/src/desktop/channel-proof.ts +122 -0
- package/src/desktop/client-assets.ts +75 -0
- package/src/desktop/desktop-client.ts +303 -0
- package/src/desktop/desktop-gateway.ts +189 -0
- package/src/desktop/desktop-host.ts +335 -0
- package/src/desktop/desktop-stream.ts +324 -0
- package/src/desktop/loopback-policy.ts +41 -0
- package/src/desktop/open-url-channel.ts +79 -0
- package/src/desktop/string-policy.ts +9 -0
- package/src/installer/archive-entry.ts +32 -0
- package/src/installer/command-artifact.ts +307 -0
- package/src/installer/command-qualification-command.ts +75 -0
- package/src/installer/hosted-runner.ts +11 -0
- package/src/installer/installed-payload.ts +408 -0
- package/src/installer/installer-ci-bootstrap.ts +199 -0
- package/src/installer/installer-ci-preflight.ts +61 -0
- package/src/installer/installer-ci-worker.ts +105 -0
- package/src/installer/installer-extraction.ts +367 -0
- package/src/installer/installer-fetch-guard.ts +75 -0
- package/src/installer/installer-identity.ts +331 -0
- package/src/installer/installer-layout.ts +167 -0
- package/src/installer/installer-observation.ts +671 -0
- package/src/installer/installer-process-cleanup.ts +167 -0
- package/src/installer/installer-qualification-command.ts +81 -0
- package/src/installer/installer-renderer-evidence.ts +268 -0
- package/src/installer/installer-upgrade-command.ts +226 -0
- package/src/installer/installer-worker-guard.ts +112 -0
- package/src/installer/native-executable.ts +37 -0
- package/src/installer/upgrade-asset-download.ts +72 -0
- package/src/installer/write-all.ts +19 -0
- package/src/native/app-bundle.ts +86 -0
- package/src/native/cef-helper.ts +471 -0
- package/src/native/desktop-build-hook.ts +21 -0
- package/src/native/electrobun-cef-main-frame-bridges.patch +63 -0
- package/src/native/electrobun-source-patch.ts +107 -0
- package/src/native/electrobun-windows-shortcut-com.patch +923 -0
- package/src/native/linux-cef-links.ts +14 -0
- package/src/native/native-secret-store.ts +99 -0
- package/src/native/native-utilities.ts +166 -0
- package/src/native/partitioned-window.ts +62 -0
- package/src/native/renderer-profile.ts +27 -0
- package/src/native/secure-window.ts +115 -0
- package/src/native/sidecar-services.ts +71 -0
- package/src/native/sidecar.ts +387 -0
- package/src/native/window-bootstrap.ts +77 -0
- package/src/native/window-options.ts +24 -0
- package/src/native/windows-build-hook-internal.ts +49 -0
- package/src/native/windows-build-hook.ts +12 -0
- package/src/native/windows-runtime-patch-internal.ts +48 -0
- package/src/native/windows-runtime-patch.ts +15 -0
- package/src/release/feed-release-cut.ts +110 -0
- package/src/release/feed-state.ts +135 -0
- package/src/release/framework-package-publish.ts +163 -0
- package/src/release/framework-update.ts +196 -0
- package/src/release/github-cli.ts +27 -0
- package/src/release/github-release-assets.ts +36 -0
- package/src/release/github-release-cut.ts +237 -0
- package/src/release/github-release-lookup.ts +39 -0
- package/src/release/github-release-promotion.ts +112 -0
- package/src/release/github-release-provenance.ts +65 -0
- package/src/release/github-release-publisher.ts +90 -0
- package/src/release/github-release-qualification.ts +144 -0
- package/src/release/local-provenance.ts +92 -0
- package/src/release/local-release.ts +525 -0
- package/src/release/macos-dmg.ts +113 -0
- package/src/release/release-artifact.ts +53 -0
- package/src/release/release-assets-plan.ts +118 -0
- package/src/release/release-config.ts +420 -0
- package/src/release/release-cut-command.ts +80 -0
- package/src/release/release-cut.ts +133 -0
- package/src/release/release-descriptor-staging.ts +242 -0
- package/src/release/release-finalize.ts +191 -0
- package/src/release/release-promotion-command.ts +36 -0
- package/src/release/release-promotion.ts +132 -0
- package/src/release/release-publication.ts +213 -0
- package/src/release/release-publish-command.ts +163 -0
- package/src/release/release-qualification.ts +397 -0
- package/src/release/release-staging.ts +87 -0
- package/src/release/release-steps.ts +173 -0
- package/src/release/retained-release-build.ts +217 -0
- package/src/shell/app-shell.tsx +285 -0
- package/src/shell/app-utilities.tsx +437 -0
- package/src/shell/application-menu-commands.ts +6 -0
- package/src/shell/application-menu.ts +250 -0
- package/src/shell/help-shortcuts.ts +24 -0
- package/src/shell/settings-sections.ts +74 -0
- package/src/shell/shortcut-platform.ts +35 -0
- package/src/updates/channel-update-manager.ts +127 -0
- package/src/updates/desktop-updater.ts +440 -0
- package/src/updates/release-feed.ts +187 -0
- package/src/updates/release-location.ts +101 -0
- package/src/updates/release-version.ts +57 -0
- package/src/updates/signed-release.ts +311 -0
- package/src/updates/stable-file.ts +32 -0
- package/src/updates/update-adapter.ts +129 -0
- package/src/updates/update-arm.ts +107 -0
- package/src/updates/update-channel-store.ts +86 -0
- package/src/updates/update-discovery.ts +113 -0
- package/src/updates/update-download.ts +82 -0
- package/src/updates/update-exclusive-rename.ts +58 -0
- package/src/updates/update-extraction.ts +261 -0
- package/src/updates/update-handoff-plan.ts +75 -0
- package/src/updates/update-helper.ts +87 -0
- package/src/updates/update-launch.ts +33 -0
- package/src/updates/update-manager.ts +130 -0
- package/src/updates/update-process-fence.ts +125 -0
- package/src/updates/update-resume.ts +34 -0
- package/src/updates/update-shutdown.ts +37 -0
- package/src/updates/update-state.ts +34 -0
- package/src/updates/update-swap-stage.ts +75 -0
- package/src/updates/update-swap.ts +30 -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,115 @@
|
|
|
1
|
+
import { appearanceThemeScript, createAppearancePersistence, selectionFromPreferences } from "./appearance-preferences.js";
|
|
2
|
+
import { customUiVariants, readCustomThemeLibrary, subscribeCustomThemes } from "./custom-theme-library.js";
|
|
3
|
+
import { createComponent, effect, mergeProps, template } from "solid-js/web";
|
|
4
|
+
import { createContext, createEffect, createSignal, useContext } from "solid-js";
|
|
5
|
+
import { ThemeProvider as ThemeProvider$1, useOptionalTheme } from "@adea-ai/ui/components/theme/lazy";
|
|
6
|
+
import { defaultPreferenceStorage } from "@adea-ai/ui/lib/preference-store";
|
|
7
|
+
import { tokensAsHex } from "@adea-ai/ui/lib/themes";
|
|
8
|
+
// src/appearance/appearance-host.tsx
|
|
9
|
+
var _tmpl$ = /*#__PURE__*/ template(`<script>`);
|
|
10
|
+
var [libraryRevision, setLibraryRevision] = createSignal(0);
|
|
11
|
+
var subscribedToLibrary = false;
|
|
12
|
+
function libraryThemes() {
|
|
13
|
+
if (!subscribedToLibrary) {
|
|
14
|
+
subscribedToLibrary = true;
|
|
15
|
+
subscribeCustomThemes(() => setLibraryRevision((revision) => revision + 1));
|
|
16
|
+
}
|
|
17
|
+
libraryRevision();
|
|
18
|
+
return customUiVariants();
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Everything the shared provider is told about Adea: where the preference lives, the
|
|
22
|
+
* imported themes, and the policies that make Adea's document what it has always
|
|
23
|
+
* been. A function so a test and the component build the same provider.
|
|
24
|
+
*/
|
|
25
|
+
function appearanceProviderProps(options = {}) {
|
|
26
|
+
return {
|
|
27
|
+
persistence: createAppearancePersistence(),
|
|
28
|
+
themes: libraryThemes,
|
|
29
|
+
surface: { nativeTranslucency: options.nativeTranslucency ?? false },
|
|
30
|
+
palette: "stylesheet",
|
|
31
|
+
accentContrastFloor: 3,
|
|
32
|
+
editorRoles: "floor",
|
|
33
|
+
transformTokens: tokensAsHex,
|
|
34
|
+
disableTransitionOnChange: true,
|
|
35
|
+
fontZoom: true
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The V2 view of a shared theme context. Reads derive from the provider's selection;
|
|
40
|
+
* writes go through its `setSelection`, so the shared provider remains the only
|
|
41
|
+
* writer of the document and of storage.
|
|
42
|
+
*/
|
|
43
|
+
function createAppearanceContext(ui) {
|
|
44
|
+
let draft;
|
|
45
|
+
const preview = (next) => {
|
|
46
|
+
draft = next;
|
|
47
|
+
ui.preview(next ? selectionFromPreferences(next) : void 0);
|
|
48
|
+
};
|
|
49
|
+
createEffect(() => {
|
|
50
|
+
ui.selection();
|
|
51
|
+
if (draft !== void 0 && !ui.previewing()) ui.preview(selectionFromPreferences(draft));
|
|
52
|
+
});
|
|
53
|
+
return {
|
|
54
|
+
...ui,
|
|
55
|
+
update: (patch) => ui.setSelection(selectionFromPreferences(patch)),
|
|
56
|
+
preview
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
var CONTEXT_KEY = Symbol.for("adea.app.theme");
|
|
60
|
+
function appearanceContext() {
|
|
61
|
+
const host = globalThis;
|
|
62
|
+
return host[CONTEXT_KEY] ??= createContext();
|
|
63
|
+
}
|
|
64
|
+
function AppearanceBridge(props) {
|
|
65
|
+
const ui = useOptionalTheme();
|
|
66
|
+
if (!ui) throw new Error("The appearance bridge must render inside the shared ThemeProvider.");
|
|
67
|
+
const Context = appearanceContext();
|
|
68
|
+
return createComponent(Context.Provider, {
|
|
69
|
+
get value() {
|
|
70
|
+
return createAppearanceContext(ui);
|
|
71
|
+
},
|
|
72
|
+
get children() {
|
|
73
|
+
return props.children;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Adea's appearance provider: the shared ThemeProvider configured for Adea's V2
|
|
79
|
+
* document, with the V2 context on top. It owns the versioned appearance preference
|
|
80
|
+
* (mode, independent light/dark themes, accent, surface) and applies it to the
|
|
81
|
+
* document.
|
|
82
|
+
*/
|
|
83
|
+
function ThemeProvider(props) {
|
|
84
|
+
readCustomThemeLibrary(defaultPreferenceStorage());
|
|
85
|
+
return createComponent(ThemeProvider$1, mergeProps(() => appearanceProviderProps({ nativeTranslucency: () => props.nativeTranslucency ?? false }), { get children() {
|
|
86
|
+
return createComponent(AppearanceBridge, { get children() {
|
|
87
|
+
return props.children;
|
|
88
|
+
} });
|
|
89
|
+
} }));
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The appearance editor's view of the context: the shared context with the V2
|
|
93
|
+
* `update` and `preview` seam. Shell code that only reads the theme (the selection,
|
|
94
|
+
* the variant, `accentRolesFor`) uses the shared `useOptionalTheme` of
|
|
95
|
+
* `@adea-ai/ui/components/theme` instead.
|
|
96
|
+
*/
|
|
97
|
+
function useTheme() {
|
|
98
|
+
const context = useContext(appearanceContext());
|
|
99
|
+
if (!context) throw new Error("useTheme must be used within a ThemeProvider.");
|
|
100
|
+
return context;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Pre-paint appearance restore for server-rendered documents. Rendered in the
|
|
104
|
+
* document head, it resolves the stored preference against the OS
|
|
105
|
+
* and applies the document state before first paint so hydration never shows the
|
|
106
|
+
* wrong theme.
|
|
107
|
+
*/
|
|
108
|
+
function ThemeScript() {
|
|
109
|
+
return (() => {
|
|
110
|
+
var _el$ = _tmpl$();
|
|
111
|
+
effect(() => _el$.innerHTML = appearanceThemeScript());
|
|
112
|
+
return _el$;
|
|
113
|
+
})();
|
|
114
|
+
}
|
|
115
|
+
export { ThemeProvider, ThemeScript, appearanceProviderProps, createAppearanceContext, useTheme };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { type ThemePersistence, type ThemeSelection, type VersionedCodec } from '@adea-ai/ui/components/theme/lazy';
|
|
2
|
+
import { type AppearanceEditorFontSettings } from '@adea-ai/ui/lib/appearance-font-settings';
|
|
3
|
+
/**
|
|
4
|
+
* The versioned client appearance preference (Dev Runtime spec,
|
|
5
|
+
* "Appearance and App Library"). Stored as one JSON document.
|
|
6
|
+
*
|
|
7
|
+
* The document is Adea's product schema. The shared ThemeProvider owns what a
|
|
8
|
+
* selection resolves to and paints; this module owns what is stored, under which
|
|
9
|
+
* keys, and how an unreadable or older record is corrected. The stored bytes are
|
|
10
|
+
* the same as they were before the provider was shared.
|
|
11
|
+
*/
|
|
12
|
+
export type AppearancePreferencesV2 = Readonly<{
|
|
13
|
+
version: 2;
|
|
14
|
+
mode: AppearanceMode;
|
|
15
|
+
lightThemeId: string;
|
|
16
|
+
darkThemeId: string;
|
|
17
|
+
/**
|
|
18
|
+
* The terminal's palette: `'theme'` follows the resolved interface theme, a
|
|
19
|
+
* theme id pins that theme's terminal colours regardless of appearance.
|
|
20
|
+
*/
|
|
21
|
+
terminalThemeId: 'theme' | string;
|
|
22
|
+
/** A built-in preset id, a theme-carried `ansi-<slot>` id, or a validated `#rrggbb` color. `'theme'` normalizes to the default preset. */
|
|
23
|
+
accent: 'theme' | string;
|
|
24
|
+
surface: SurfacePreference;
|
|
25
|
+
reduceTransparency: boolean;
|
|
26
|
+
/** Missing in older V2 documents; the shared font defaults recover each text role. */
|
|
27
|
+
fonts?: AppearanceEditorFontSettings;
|
|
28
|
+
}>;
|
|
29
|
+
export type AppearanceMode = 'system' | 'light' | 'dark';
|
|
30
|
+
export type ResolvedAppearance = 'light' | 'dark';
|
|
31
|
+
export type SurfacePreference = 'opaque' | 'frosted' | 'translucent';
|
|
32
|
+
export declare const APPEARANCE_STORAGE_KEY = "appearance";
|
|
33
|
+
/**
|
|
34
|
+
* Recovery envelope for unread preference documents (Dev Runtime spec,
|
|
35
|
+
* "Compatibility, migrations, and waivers": a failed migration retains the
|
|
36
|
+
* original record; it never silently rewrites or deletes the input). A
|
|
37
|
+
* malformed or future-version document is quarantined here, before any write can
|
|
38
|
+
* touch the main key, so saving valid preferences later can never destroy the
|
|
39
|
+
* user's unread data.
|
|
40
|
+
*/
|
|
41
|
+
export declare const APPEARANCE_RECOVERY_STORAGE_KEY = "appearance.recovery";
|
|
42
|
+
/** The imported-theme library the boot script reads for a stored custom selection. */
|
|
43
|
+
export declare const APPEARANCE_LIBRARY_STORAGE_KEY = "appearance.library";
|
|
44
|
+
/**
|
|
45
|
+
* The default accent is the catalogue's Violet brand preset, one of the six
|
|
46
|
+
* accents, not a separate "theme default" entry beside them. `'theme'` and any
|
|
47
|
+
* unknown value normalize to it.
|
|
48
|
+
*/
|
|
49
|
+
export declare const DEFAULT_ACCENT_PRESET_ID = "violet";
|
|
50
|
+
/**
|
|
51
|
+
* The contrast an accent is held to against any theme, the imported ones included.
|
|
52
|
+
* The catalogue's presets already clear it on the catalogue's own themes, so the
|
|
53
|
+
* floor changes no preset there; it exists for custom colours and imported themes.
|
|
54
|
+
*/
|
|
55
|
+
export declare const APPEARANCE_ACCENT_CONTRAST_FLOOR = 3;
|
|
56
|
+
export declare const defaultAppearancePreferences: AppearancePreferencesV2;
|
|
57
|
+
export type NormalizedPreferences = Readonly<{
|
|
58
|
+
/** The strict v2 document, with every unknown field corrected to defaults. */
|
|
59
|
+
value: AppearancePreferencesV2;
|
|
60
|
+
/**
|
|
61
|
+
* The raw stored document when it was not a valid v2 record. Retained so a
|
|
62
|
+
* future version (or a repaired write) never loses the user's data.
|
|
63
|
+
*/
|
|
64
|
+
retainedRaw?: unknown;
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* Parse a stored appearance document. Anything that is not a strict version-2
|
|
68
|
+
* record falls back to the defaults and keeps the raw value for retention;
|
|
69
|
+
* individual unknown values inside a v2 record are corrected field by field.
|
|
70
|
+
*/
|
|
71
|
+
export declare function normalizeAppearancePreferences(raw: unknown): NormalizedPreferences;
|
|
72
|
+
/**
|
|
73
|
+
* A V2 preference, or a patch of one, as a selection patch. Only the fields present
|
|
74
|
+
* are returned: a patch key left `undefined` would overwrite the selection's value.
|
|
75
|
+
*/
|
|
76
|
+
export declare function selectionFromPreferences(preferences: Partial<AppearancePreferencesV2>): Partial<ThemeSelection>;
|
|
77
|
+
/** The V2 view of the provider's committed selection. */
|
|
78
|
+
export declare function preferencesFromSelection(selection: ThemeSelection): AppearancePreferencesV2;
|
|
79
|
+
/**
|
|
80
|
+
* Where the V2 document lives. One object feeds the persistence and the boot
|
|
81
|
+
* script, so the two cannot disagree about a key, a version or a field name.
|
|
82
|
+
*/
|
|
83
|
+
export declare const appearanceSchema: {
|
|
84
|
+
key: string;
|
|
85
|
+
version: number;
|
|
86
|
+
appearanceField: "mode";
|
|
87
|
+
libraryKey: string;
|
|
88
|
+
recoveryKey: string;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* The document written for a selection: exactly the V2 fields, in the order they
|
|
92
|
+
* have always been written. `fonts` is written when the record last read or written
|
|
93
|
+
* carried it, or when the text settings differ from the defaults, so a document
|
|
94
|
+
* whose text was never touched keeps the bytes it had.
|
|
95
|
+
*/
|
|
96
|
+
export declare function appearanceDocument(next: ThemeSelection, previous?: Readonly<Record<string, unknown>>): AppearancePreferencesV2;
|
|
97
|
+
export declare const adeaV2Codec: VersionedCodec<AppearancePreferencesV2>;
|
|
98
|
+
/** The provider's persistence over the V2 document. */
|
|
99
|
+
export declare function createAppearancePersistence(): ThemePersistence;
|
|
100
|
+
/**
|
|
101
|
+
* The boot script rendered in the document head: the shared `themeScript` over this
|
|
102
|
+
* schema, so first paint and the mounted provider read one document. The default
|
|
103
|
+
* accent matches the codec's fresh-install accent, so a fresh page paints the
|
|
104
|
+
* accent the provider will keep.
|
|
105
|
+
*/
|
|
106
|
+
export declare function appearanceThemeScript(): string;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { createVersionedPersistence, themeScript } from "@adea-ai/ui/components/theme/lazy";
|
|
2
|
+
import { isThemeAccentId } from "@adea-ai/ui/lib/themes";
|
|
3
|
+
import { getAccent } from "@adea-ai/ui/lib/accent-presets";
|
|
4
|
+
import { colorToHex, parseColor } from "@adea-ai/ui/lib/accent-roles";
|
|
5
|
+
import { DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, normalizeAppearanceEditorFontSettings } from "@adea-ai/ui/lib/appearance-font-settings";
|
|
6
|
+
import { normalizeSurface } from "@adea-ai/ui/lib/theme-surface";
|
|
7
|
+
// src/appearance/appearance-preferences.ts
|
|
8
|
+
var APPEARANCE_STORAGE_KEY = "appearance";
|
|
9
|
+
/**
|
|
10
|
+
* Recovery envelope for unread preference documents (Dev Runtime spec,
|
|
11
|
+
* "Compatibility, migrations, and waivers": a failed migration retains the
|
|
12
|
+
* original record; it never silently rewrites or deletes the input). A
|
|
13
|
+
* malformed or future-version document is quarantined here, before any write can
|
|
14
|
+
* touch the main key, so saving valid preferences later can never destroy the
|
|
15
|
+
* user's unread data.
|
|
16
|
+
*/
|
|
17
|
+
var APPEARANCE_RECOVERY_STORAGE_KEY = "appearance.recovery";
|
|
18
|
+
/** The imported-theme library the boot script reads for a stored custom selection. */
|
|
19
|
+
var APPEARANCE_LIBRARY_STORAGE_KEY = "appearance.library";
|
|
20
|
+
/**
|
|
21
|
+
* The default accent is the catalogue's Violet brand preset, one of the six
|
|
22
|
+
* accents, not a separate "theme default" entry beside them. `'theme'` and any
|
|
23
|
+
* unknown value normalize to it.
|
|
24
|
+
*/
|
|
25
|
+
var DEFAULT_ACCENT_PRESET_ID = "violet";
|
|
26
|
+
/**
|
|
27
|
+
* The contrast an accent is held to against any theme, the imported ones included.
|
|
28
|
+
* The catalogue's presets already clear it on the catalogue's own themes, so the
|
|
29
|
+
* floor changes no preset there; it exists for custom colours and imported themes.
|
|
30
|
+
*/
|
|
31
|
+
var APPEARANCE_ACCENT_CONTRAST_FLOOR = 3;
|
|
32
|
+
var defaultAppearancePreferences = Object.freeze({
|
|
33
|
+
version: 2,
|
|
34
|
+
mode: "system",
|
|
35
|
+
lightThemeId: "adea-light",
|
|
36
|
+
darkThemeId: "adea-dark",
|
|
37
|
+
terminalThemeId: "theme",
|
|
38
|
+
accent: DEFAULT_ACCENT_PRESET_ID,
|
|
39
|
+
surface: "opaque",
|
|
40
|
+
reduceTransparency: false
|
|
41
|
+
});
|
|
42
|
+
function normalizeMode(value) {
|
|
43
|
+
return value === "light" || value === "dark" || value === "system" ? value : "system";
|
|
44
|
+
}
|
|
45
|
+
function normalizeSurface$1(value) {
|
|
46
|
+
return normalizeSurface(value) ?? "opaque";
|
|
47
|
+
}
|
|
48
|
+
function normalizeThemeId(value, fallback) {
|
|
49
|
+
return typeof value === "string" && value.trim().length > 0 ? value : fallback;
|
|
50
|
+
}
|
|
51
|
+
function normalizeAccent(value) {
|
|
52
|
+
if (value === "theme" || typeof value !== "string") return DEFAULT_ACCENT_PRESET_ID;
|
|
53
|
+
if (getAccent(value) || isThemeAccentId(value)) return value;
|
|
54
|
+
const parsed = parseColor(value);
|
|
55
|
+
return parsed ? colorToHex({
|
|
56
|
+
...parsed,
|
|
57
|
+
a: 255
|
|
58
|
+
}) : DEFAULT_ACCENT_PRESET_ID;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Parse a stored appearance document. Anything that is not a strict version-2
|
|
62
|
+
* record falls back to the defaults and keeps the raw value for retention;
|
|
63
|
+
* individual unknown values inside a v2 record are corrected field by field.
|
|
64
|
+
*/
|
|
65
|
+
function normalizeAppearancePreferences(raw) {
|
|
66
|
+
if (typeof raw !== "object" || raw === null || raw.version !== 2) return {
|
|
67
|
+
value: defaultAppearancePreferences,
|
|
68
|
+
retainedRaw: raw
|
|
69
|
+
};
|
|
70
|
+
const record = raw;
|
|
71
|
+
return { value: {
|
|
72
|
+
version: 2,
|
|
73
|
+
mode: normalizeMode(record.mode),
|
|
74
|
+
lightThemeId: normalizeThemeId(record.lightThemeId, defaultAppearancePreferences.lightThemeId),
|
|
75
|
+
darkThemeId: normalizeThemeId(record.darkThemeId, defaultAppearancePreferences.darkThemeId),
|
|
76
|
+
terminalThemeId: normalizeThemeId(record.terminalThemeId, "theme"),
|
|
77
|
+
accent: normalizeAccent(record.accent),
|
|
78
|
+
surface: normalizeSurface$1(record.surface),
|
|
79
|
+
reduceTransparency: record.reduceTransparency === true,
|
|
80
|
+
...record.fonts === void 0 ? {} : { fonts: normalizeAppearanceEditorFontSettings(record.fonts).settings }
|
|
81
|
+
} };
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* A V2 preference, or a patch of one, as a selection patch. Only the fields present
|
|
85
|
+
* are returned: a patch key left `undefined` would overwrite the selection's value.
|
|
86
|
+
*/
|
|
87
|
+
function selectionFromPreferences(preferences) {
|
|
88
|
+
return {
|
|
89
|
+
...preferences.mode === void 0 ? {} : { appearance: preferences.mode },
|
|
90
|
+
...preferences.lightThemeId === void 0 ? {} : { lightThemeId: preferences.lightThemeId },
|
|
91
|
+
...preferences.darkThemeId === void 0 ? {} : { darkThemeId: preferences.darkThemeId },
|
|
92
|
+
...preferences.terminalThemeId === void 0 ? {} : { terminalThemeId: preferences.terminalThemeId },
|
|
93
|
+
...preferences.accent === void 0 ? {} : { accent: preferences.accent === "theme" ? DEFAULT_ACCENT_PRESET_ID : preferences.accent },
|
|
94
|
+
...preferences.surface === void 0 ? {} : { surface: preferences.surface },
|
|
95
|
+
...preferences.reduceTransparency === void 0 ? {} : { reduceTransparency: preferences.reduceTransparency },
|
|
96
|
+
...preferences.fonts === void 0 ? {} : { fonts: preferences.fonts }
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/** The V2 view of the provider's committed selection. */
|
|
100
|
+
function preferencesFromSelection(selection) {
|
|
101
|
+
return {
|
|
102
|
+
version: 2,
|
|
103
|
+
mode: selection.appearance,
|
|
104
|
+
lightThemeId: selection.lightThemeId,
|
|
105
|
+
darkThemeId: selection.darkThemeId,
|
|
106
|
+
terminalThemeId: selection.terminalThemeId ?? "theme",
|
|
107
|
+
accent: selection.accent === "theme" ? DEFAULT_ACCENT_PRESET_ID : selection.accent,
|
|
108
|
+
surface: selection.surface ?? "opaque",
|
|
109
|
+
reduceTransparency: selection.reduceTransparency === true,
|
|
110
|
+
...selection.fonts === void 0 ? {} : { fonts: selection.fonts }
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function sameFonts(left, right) {
|
|
114
|
+
return [
|
|
115
|
+
"ui",
|
|
116
|
+
"content",
|
|
117
|
+
"code"
|
|
118
|
+
].every((axis) => left[axis].family === right[axis].family && left[axis].size === right[axis].size);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Where the V2 document lives. One object feeds the persistence and the boot
|
|
122
|
+
* script, so the two cannot disagree about a key, a version or a field name.
|
|
123
|
+
*/
|
|
124
|
+
var appearanceSchema = {
|
|
125
|
+
key: APPEARANCE_STORAGE_KEY,
|
|
126
|
+
version: 2,
|
|
127
|
+
appearanceField: "mode",
|
|
128
|
+
libraryKey: APPEARANCE_LIBRARY_STORAGE_KEY,
|
|
129
|
+
recoveryKey: APPEARANCE_RECOVERY_STORAGE_KEY
|
|
130
|
+
};
|
|
131
|
+
/** What a store with nothing readable answers: Adea's fresh-install preference. */
|
|
132
|
+
function installDefaults() {
|
|
133
|
+
return selectionFromPreferences(defaultAppearancePreferences);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* The document written for a selection: exactly the V2 fields, in the order they
|
|
137
|
+
* have always been written. `fonts` is written when the record last read or written
|
|
138
|
+
* carried it, or when the text settings differ from the defaults, so a document
|
|
139
|
+
* whose text was never touched keeps the bytes it had.
|
|
140
|
+
*/
|
|
141
|
+
function appearanceDocument(next, previous) {
|
|
142
|
+
const fonts = normalizeAppearanceEditorFontSettings(next.fonts, next.font).settings;
|
|
143
|
+
const keepFonts = previous?.fonts !== void 0 || !sameFonts(fonts, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS);
|
|
144
|
+
return {
|
|
145
|
+
...preferencesFromSelection({
|
|
146
|
+
...next,
|
|
147
|
+
fonts: void 0
|
|
148
|
+
}),
|
|
149
|
+
...keepFonts ? { fonts } : {}
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
var adeaV2Codec = {
|
|
153
|
+
decode: (record) => selectionFromPreferences(normalizeAppearancePreferences(record).value),
|
|
154
|
+
defaults: installDefaults,
|
|
155
|
+
encode: appearanceDocument
|
|
156
|
+
};
|
|
157
|
+
/** The provider's persistence over the V2 document. */
|
|
158
|
+
function createAppearancePersistence() {
|
|
159
|
+
return createVersionedPersistence(appearanceSchema, adeaV2Codec);
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* The boot script rendered in the document head: the shared `themeScript` over this
|
|
163
|
+
* schema, so first paint and the mounted provider read one document. The default
|
|
164
|
+
* accent matches the codec's fresh-install accent, so a fresh page paints the
|
|
165
|
+
* accent the provider will keep.
|
|
166
|
+
*/
|
|
167
|
+
function appearanceThemeScript() {
|
|
168
|
+
return themeScript({
|
|
169
|
+
...appearanceSchema,
|
|
170
|
+
defaultAccent: DEFAULT_ACCENT_PRESET_ID,
|
|
171
|
+
surface: true,
|
|
172
|
+
palette: "stylesheet"
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
export { APPEARANCE_ACCENT_CONTRAST_FLOOR, APPEARANCE_LIBRARY_STORAGE_KEY, APPEARANCE_RECOVERY_STORAGE_KEY, APPEARANCE_STORAGE_KEY, DEFAULT_ACCENT_PRESET_ID, adeaV2Codec, appearanceDocument, appearanceSchema, appearanceThemeScript, createAppearancePersistence, defaultAppearancePreferences, normalizeAppearancePreferences, preferencesFromSelection, selectionFromPreferences };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ThemeVariant } from '@adea-ai/ui/lib/themes';
|
|
2
|
+
import type { AppearancePreferencesV2 } from './appearance-preferences';
|
|
3
|
+
/**
|
|
4
|
+
* The variants behind the mode miniatures: resolved per appearance from the
|
|
5
|
+
* draft so the System split, Light, and Dark cards track unsaved theme picks
|
|
6
|
+
* the same instant the real chrome does.
|
|
7
|
+
*/
|
|
8
|
+
export declare function draftVariants(preferences: AppearancePreferencesV2): {
|
|
9
|
+
light: ThemeVariant;
|
|
10
|
+
dark: ThemeVariant;
|
|
11
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { themeRegistry } from "./theme-registry.js";
|
|
2
|
+
import { resolveVariant } from "@adea-ai/ui/lib/themes";
|
|
3
|
+
// src/appearance/composition.ts
|
|
4
|
+
/**
|
|
5
|
+
* The variants behind the mode miniatures: resolved per appearance from the
|
|
6
|
+
* draft so the System split, Light, and Dark cards track unsaved theme picks
|
|
7
|
+
* the same instant the real chrome does.
|
|
8
|
+
*/
|
|
9
|
+
function draftVariants(preferences) {
|
|
10
|
+
const registry = themeRegistry();
|
|
11
|
+
return {
|
|
12
|
+
light: resolveVariant(registry, preferences.lightThemeId, "light"),
|
|
13
|
+
dark: resolveVariant(registry, preferences.darkThemeId, "dark")
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export { draftVariants };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type AppearanceStorage, type CustomThemeStored } from './custom-theme-library';
|
|
2
|
+
export type CustomThemeImportResult = {
|
|
3
|
+
ok: true;
|
|
4
|
+
theme: CustomThemeStored;
|
|
5
|
+
} | {
|
|
6
|
+
ok: false;
|
|
7
|
+
error: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Parse and store an uploaded theme. The only hard failure is unparseable
|
|
11
|
+
* JSON: everything else normalizes, fills from the same-appearance default,
|
|
12
|
+
* and reports what it had to adjust.
|
|
13
|
+
*/
|
|
14
|
+
export declare function importCustomTheme(text: string, storage: AppearanceStorage | undefined, existing: readonly CustomThemeStored[]): CustomThemeImportResult;
|