@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.
Files changed (358) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +30 -0
  3. package/README.md +1009 -2
  4. package/dist/app/application.d.ts +47 -0
  5. package/dist/app/application.js +115 -0
  6. package/dist/app/create-application.d.ts +13 -0
  7. package/dist/app/create-application.js +178 -0
  8. package/dist/app/service-registry.d.ts +44 -0
  9. package/dist/app/service-registry.js +116 -0
  10. package/dist/appearance/appearance-host.d.ts +62 -0
  11. package/dist/appearance/appearance-host.js +115 -0
  12. package/dist/appearance/appearance-preferences.d.ts +106 -0
  13. package/dist/appearance/appearance-preferences.js +175 -0
  14. package/dist/appearance/composition.d.ts +11 -0
  15. package/dist/appearance/composition.js +16 -0
  16. package/dist/appearance/custom-theme-import.d.ts +14 -0
  17. package/dist/appearance/custom-theme-import.js +315 -0
  18. package/dist/appearance/custom-theme-library.d.ts +146 -0
  19. package/dist/appearance/custom-theme-library.js +378 -0
  20. package/dist/appearance/editor.d.ts +20 -0
  21. package/dist/appearance/editor.js +47 -0
  22. package/dist/appearance/theme-file-importer.d.ts +23 -0
  23. package/dist/appearance/theme-file-importer.js +66 -0
  24. package/dist/appearance/theme-record-adapter.d.ts +26 -0
  25. package/dist/appearance/theme-record-adapter.js +64 -0
  26. package/dist/appearance/theme-registry.d.ts +10 -0
  27. package/dist/appearance/theme-registry.js +16 -0
  28. package/dist/appearance/window-surface.d.ts +5 -0
  29. package/dist/appearance/window-surface.js +9 -0
  30. package/dist/ci/toolchain-identity.d.ts +39 -0
  31. package/dist/ci/toolchain-identity.js +196 -0
  32. package/dist/cli/cef-helper-cli.d.ts +2 -0
  33. package/dist/cli/cef-helper-cli.js +18 -0
  34. package/dist/cli/cli-runner.d.ts +8 -0
  35. package/dist/cli/cli-runner.js +23 -0
  36. package/dist/cli/create-application-cli.d.ts +2 -0
  37. package/dist/cli/create-application-cli.js +40 -0
  38. package/dist/cli/electrobun-shortcut-patch-cli.d.ts +2 -0
  39. package/dist/cli/electrobun-shortcut-patch-cli.js +17 -0
  40. package/dist/cli/framework-update-cli.d.ts +2 -0
  41. package/dist/cli/framework-update-cli.js +40 -0
  42. package/dist/cli/release-assets-plan-cli.d.ts +2 -0
  43. package/dist/cli/release-assets-plan-cli.js +14 -0
  44. package/dist/cli/release-cut-cli.d.ts +2 -0
  45. package/dist/cli/release-cut-cli.js +27 -0
  46. package/dist/cli/release-descriptor-staging-cli.d.ts +2 -0
  47. package/dist/cli/release-descriptor-staging-cli.js +45 -0
  48. package/dist/cli/release-finalize-cli.d.ts +1 -0
  49. package/dist/cli/release-finalize-cli.js +30 -0
  50. package/dist/cli/release-promote-cli.d.ts +2 -0
  51. package/dist/cli/release-promote-cli.js +32 -0
  52. package/dist/cli/release-publish-cli.d.ts +2 -0
  53. package/dist/cli/release-publish-cli.js +48 -0
  54. package/dist/cli/release-sign-cli.d.ts +2 -0
  55. package/dist/cli/release-sign-cli.js +13 -0
  56. package/dist/cli/release-step-cli.d.ts +2 -0
  57. package/dist/cli/release-step-cli.js +44 -0
  58. package/dist/cli/toolchain-identity-cli.d.ts +2 -0
  59. package/dist/cli/toolchain-identity-cli.js +10 -0
  60. package/dist/cli/update-helper-cli.d.ts +1 -0
  61. package/dist/cli/update-helper-cli.js +10 -0
  62. package/dist/cli/windows-runtime-patch-cli.d.ts +2 -0
  63. package/dist/cli/windows-runtime-patch-cli.js +17 -0
  64. package/dist/desktop/application-command-client.d.ts +15 -0
  65. package/dist/desktop/application-command-client.js +21 -0
  66. package/dist/desktop/channel-handshake.d.ts +32 -0
  67. package/dist/desktop/channel-handshake.js +111 -0
  68. package/dist/desktop/channel-proof.d.ts +43 -0
  69. package/dist/desktop/channel-proof.js +85 -0
  70. package/dist/desktop/client-assets.d.ts +7 -0
  71. package/dist/desktop/client-assets.js +59 -0
  72. package/dist/desktop/desktop-client.d.ts +23 -0
  73. package/dist/desktop/desktop-client.js +231 -0
  74. package/dist/desktop/desktop-gateway.d.ts +18 -0
  75. package/dist/desktop/desktop-gateway.js +146 -0
  76. package/dist/desktop/desktop-host.d.ts +48 -0
  77. package/dist/desktop/desktop-host.js +208 -0
  78. package/dist/desktop/desktop-stream.d.ts +36 -0
  79. package/dist/desktop/desktop-stream.js +231 -0
  80. package/dist/desktop/loopback-policy.d.ts +19 -0
  81. package/dist/desktop/loopback-policy.js +23 -0
  82. package/dist/desktop/open-url-channel.d.ts +15 -0
  83. package/dist/desktop/open-url-channel.js +55 -0
  84. package/dist/desktop/string-policy.d.ts +2 -0
  85. package/dist/desktop/string-policy.js +11 -0
  86. package/dist/framework-source.json +1 -0
  87. package/dist/installer/archive-entry.d.ts +6 -0
  88. package/dist/installer/archive-entry.js +14 -0
  89. package/dist/installer/command-artifact.d.ts +47 -0
  90. package/dist/installer/command-artifact.js +261 -0
  91. package/dist/installer/command-qualification-command.d.ts +12 -0
  92. package/dist/installer/command-qualification-command.js +71 -0
  93. package/dist/installer/hosted-runner.d.ts +4 -0
  94. package/dist/installer/hosted-runner.js +10 -0
  95. package/dist/installer/installed-payload.d.ts +29 -0
  96. package/dist/installer/installed-payload.js +312 -0
  97. package/dist/installer/installer-ci-bootstrap.d.ts +26 -0
  98. package/dist/installer/installer-ci-bootstrap.js +160 -0
  99. package/dist/installer/installer-ci-preflight.d.ts +1 -0
  100. package/dist/installer/installer-ci-preflight.js +49 -0
  101. package/dist/installer/installer-ci-worker.d.ts +1 -0
  102. package/dist/installer/installer-ci-worker.js +105 -0
  103. package/dist/installer/installer-extraction.d.ts +14 -0
  104. package/dist/installer/installer-extraction.js +289 -0
  105. package/dist/installer/installer-fetch-guard.d.ts +15 -0
  106. package/dist/installer/installer-fetch-guard.js +50 -0
  107. package/dist/installer/installer-identity.d.ts +23 -0
  108. package/dist/installer/installer-identity.js +286 -0
  109. package/dist/installer/installer-layout.d.ts +21 -0
  110. package/dist/installer/installer-layout.js +89 -0
  111. package/dist/installer/installer-observation.d.ts +64 -0
  112. package/dist/installer/installer-observation.js +473 -0
  113. package/dist/installer/installer-process-cleanup.d.ts +18 -0
  114. package/dist/installer/installer-process-cleanup.js +158 -0
  115. package/dist/installer/installer-qualification-command.d.ts +11 -0
  116. package/dist/installer/installer-qualification-command.js +71 -0
  117. package/dist/installer/installer-renderer-evidence.d.ts +43 -0
  118. package/dist/installer/installer-renderer-evidence.js +136 -0
  119. package/dist/installer/installer-upgrade-command.d.ts +37 -0
  120. package/dist/installer/installer-upgrade-command.js +172 -0
  121. package/dist/installer/installer-worker-guard.d.ts +21 -0
  122. package/dist/installer/installer-worker-guard.js +72 -0
  123. package/dist/installer/native-executable.d.ts +5 -0
  124. package/dist/installer/native-executable.js +21 -0
  125. package/dist/installer/upgrade-asset-download.d.ts +13 -0
  126. package/dist/installer/upgrade-asset-download.js +41 -0
  127. package/dist/installer/write-all.d.ts +6 -0
  128. package/dist/installer/write-all.js +11 -0
  129. package/dist/native/app-bundle.d.ts +28 -0
  130. package/dist/native/app-bundle.js +60 -0
  131. package/dist/native/cef-helper.d.ts +28 -0
  132. package/dist/native/cef-helper.js +402 -0
  133. package/dist/native/desktop-build-hook.d.ts +7 -0
  134. package/dist/native/desktop-build-hook.js +20 -0
  135. package/dist/native/electrobun-source-patch.d.ts +25 -0
  136. package/dist/native/electrobun-source-patch.js +93 -0
  137. package/dist/native/linux-cef-links.d.ts +2 -0
  138. package/dist/native/linux-cef-links.js +15 -0
  139. package/dist/native/native-secret-store.d.ts +27 -0
  140. package/dist/native/native-secret-store.js +70 -0
  141. package/dist/native/native-utilities.d.ts +24 -0
  142. package/dist/native/native-utilities.js +85 -0
  143. package/dist/native/partitioned-window.d.ts +34 -0
  144. package/dist/native/partitioned-window.js +44 -0
  145. package/dist/native/renderer-profile.d.ts +53 -0
  146. package/dist/native/renderer-profile.js +30 -0
  147. package/dist/native/secure-window.d.ts +38 -0
  148. package/dist/native/secure-window.js +77 -0
  149. package/dist/native/sidecar-services.d.ts +23 -0
  150. package/dist/native/sidecar-services.js +46 -0
  151. package/dist/native/sidecar.d.ts +81 -0
  152. package/dist/native/sidecar.js +250 -0
  153. package/dist/native/window-bootstrap.d.ts +24 -0
  154. package/dist/native/window-bootstrap.js +63 -0
  155. package/dist/native/window-options.d.ts +32 -0
  156. package/dist/native/window-options.js +23 -0
  157. package/dist/native/windows-build-hook-internal.d.ts +2 -0
  158. package/dist/native/windows-build-hook-internal.js +32 -0
  159. package/dist/native/windows-build-hook.d.ts +2 -0
  160. package/dist/native/windows-build-hook.js +12 -0
  161. package/dist/native/windows-runtime-patch-internal.d.ts +3 -0
  162. package/dist/native/windows-runtime-patch-internal.js +20 -0
  163. package/dist/native/windows-runtime-patch.d.ts +4 -0
  164. package/dist/native/windows-runtime-patch.js +12 -0
  165. package/dist/release/feed-release-cut.d.ts +23 -0
  166. package/dist/release/feed-release-cut.js +93 -0
  167. package/dist/release/feed-state.d.ts +25 -0
  168. package/dist/release/feed-state.js +81 -0
  169. package/dist/release/framework-package-publish.d.ts +21 -0
  170. package/dist/release/framework-package-publish.js +127 -0
  171. package/dist/release/framework-update.d.ts +30 -0
  172. package/dist/release/framework-update.js +139 -0
  173. package/dist/release/github-cli.d.ts +6 -0
  174. package/dist/release/github-cli.js +16 -0
  175. package/dist/release/github-release-assets.d.ts +3 -0
  176. package/dist/release/github-release-assets.js +24 -0
  177. package/dist/release/github-release-cut.d.ts +14 -0
  178. package/dist/release/github-release-cut.js +174 -0
  179. package/dist/release/github-release-lookup.d.ts +7 -0
  180. package/dist/release/github-release-lookup.js +29 -0
  181. package/dist/release/github-release-promotion.d.ts +10 -0
  182. package/dist/release/github-release-promotion.js +78 -0
  183. package/dist/release/github-release-provenance.d.ts +9 -0
  184. package/dist/release/github-release-provenance.js +27 -0
  185. package/dist/release/github-release-publisher.d.ts +9 -0
  186. package/dist/release/github-release-publisher.js +63 -0
  187. package/dist/release/github-release-qualification.d.ts +12 -0
  188. package/dist/release/github-release-qualification.js +80 -0
  189. package/dist/release/local-provenance.d.ts +24 -0
  190. package/dist/release/local-provenance.js +72 -0
  191. package/dist/release/local-release.d.ts +133 -0
  192. package/dist/release/local-release.js +387 -0
  193. package/dist/release/macos-dmg.d.ts +22 -0
  194. package/dist/release/macos-dmg.js +91 -0
  195. package/dist/release/release-artifact.d.ts +6 -0
  196. package/dist/release/release-artifact.js +38 -0
  197. package/dist/release/release-assets-plan.d.ts +14 -0
  198. package/dist/release/release-assets-plan.js +65 -0
  199. package/dist/release/release-config.d.ts +76 -0
  200. package/dist/release/release-config.js +180 -0
  201. package/dist/release/release-cut-command.d.ts +13 -0
  202. package/dist/release/release-cut-command.js +39 -0
  203. package/dist/release/release-cut.d.ts +54 -0
  204. package/dist/release/release-cut.js +76 -0
  205. package/dist/release/release-descriptor-staging.d.ts +34 -0
  206. package/dist/release/release-descriptor-staging.js +147 -0
  207. package/dist/release/release-finalize.d.ts +16 -0
  208. package/dist/release/release-finalize.js +104 -0
  209. package/dist/release/release-promotion-command.d.ts +12 -0
  210. package/dist/release/release-promotion-command.js +28 -0
  211. package/dist/release/release-promotion.d.ts +29 -0
  212. package/dist/release/release-promotion.js +57 -0
  213. package/dist/release/release-publication.d.ts +33 -0
  214. package/dist/release/release-publication.js +138 -0
  215. package/dist/release/release-publish-command.d.ts +7 -0
  216. package/dist/release/release-publish-command.js +91 -0
  217. package/dist/release/release-qualification.d.ts +106 -0
  218. package/dist/release/release-qualification.js +135 -0
  219. package/dist/release/release-staging.d.ts +9 -0
  220. package/dist/release/release-staging.js +61 -0
  221. package/dist/release/release-steps.d.ts +38 -0
  222. package/dist/release/release-steps.js +147 -0
  223. package/dist/release/retained-release-build.d.ts +19 -0
  224. package/dist/release/retained-release-build.js +122 -0
  225. package/dist/shell/app-shell.d.ts +61 -0
  226. package/dist/shell/app-shell.js +306 -0
  227. package/dist/shell/app-utilities.d.ts +122 -0
  228. package/dist/shell/app-utilities.js +334 -0
  229. package/dist/shell/application-menu-commands.d.ts +5 -0
  230. package/dist/shell/application-menu-commands.js +11 -0
  231. package/dist/shell/application-menu.d.ts +61 -0
  232. package/dist/shell/application-menu.js +208 -0
  233. package/dist/shell/help-shortcuts.d.ts +12 -0
  234. package/dist/shell/help-shortcuts.js +22 -0
  235. package/dist/shell/navigation-drawer.d.ts +12 -0
  236. package/dist/shell/navigation-drawer.js +42 -0
  237. package/dist/shell/settings-sections.d.ts +31 -0
  238. package/dist/shell/settings-sections.js +50 -0
  239. package/dist/shell/shortcut-platform.d.ts +17 -0
  240. package/dist/shell/shortcut-platform.js +25 -0
  241. package/dist/update-helper.bundle.js +260 -0
  242. package/dist/updates/channel-update-manager.d.ts +46 -0
  243. package/dist/updates/channel-update-manager.js +114 -0
  244. package/dist/updates/desktop-updater.d.ts +104 -0
  245. package/dist/updates/desktop-updater.js +345 -0
  246. package/dist/updates/release-feed.d.ts +61 -0
  247. package/dist/updates/release-feed.js +111 -0
  248. package/dist/updates/release-location.d.ts +9 -0
  249. package/dist/updates/release-location.js +80 -0
  250. package/dist/updates/release-version.d.ts +12 -0
  251. package/dist/updates/release-version.js +43 -0
  252. package/dist/updates/signed-release.d.ts +63 -0
  253. package/dist/updates/signed-release.js +162 -0
  254. package/dist/updates/stable-file.d.ts +10 -0
  255. package/dist/updates/stable-file.js +22 -0
  256. package/dist/updates/update-adapter.d.ts +57 -0
  257. package/dist/updates/update-adapter.js +72 -0
  258. package/dist/updates/update-arm.d.ts +24 -0
  259. package/dist/updates/update-arm.js +95 -0
  260. package/dist/updates/update-channel-store.d.ts +8 -0
  261. package/dist/updates/update-channel-store.js +72 -0
  262. package/dist/updates/update-discovery.d.ts +13 -0
  263. package/dist/updates/update-discovery.js +56 -0
  264. package/dist/updates/update-download.d.ts +14 -0
  265. package/dist/updates/update-download.js +67 -0
  266. package/dist/updates/update-exclusive-rename.d.ts +2 -0
  267. package/dist/updates/update-exclusive-rename.js +52 -0
  268. package/dist/updates/update-extraction.d.ts +18 -0
  269. package/dist/updates/update-extraction.js +183 -0
  270. package/dist/updates/update-handoff-plan.d.ts +22 -0
  271. package/dist/updates/update-handoff-plan.js +28 -0
  272. package/dist/updates/update-helper.d.ts +24 -0
  273. package/dist/updates/update-helper.js +56 -0
  274. package/dist/updates/update-launch.d.ts +5 -0
  275. package/dist/updates/update-launch.js +27 -0
  276. package/dist/updates/update-manager.d.ts +40 -0
  277. package/dist/updates/update-manager.js +83 -0
  278. package/dist/updates/update-process-fence.d.ts +10 -0
  279. package/dist/updates/update-process-fence.js +114 -0
  280. package/dist/updates/update-resume.d.ts +13 -0
  281. package/dist/updates/update-resume.js +34 -0
  282. package/dist/updates/update-shutdown.d.ts +15 -0
  283. package/dist/updates/update-shutdown.js +29 -0
  284. package/dist/updates/update-state.d.ts +30 -0
  285. package/dist/updates/update-state.js +18 -0
  286. package/dist/updates/update-swap-stage.d.ts +27 -0
  287. package/dist/updates/update-swap-stage.js +58 -0
  288. package/dist/updates/update-swap.d.ts +10 -0
  289. package/dist/updates/update-swap.js +30 -0
  290. package/dist/views/app-about.d.ts +22 -0
  291. package/dist/views/app-about.js +43 -0
  292. package/dist/views/app-appearance.d.ts +11 -0
  293. package/dist/views/app-appearance.js +42 -0
  294. package/dist/views/app-help.d.ts +17 -0
  295. package/dist/views/app-help.js +42 -0
  296. package/dist/views/app-settings.d.ts +26 -0
  297. package/dist/views/app-settings.js +97 -0
  298. package/dist/views/appearance-surface.d.ts +9 -0
  299. package/dist/views/appearance-surface.js +334 -0
  300. package/dist/views/update-surface.d.ts +34 -0
  301. package/dist/views/update-surface.js +64 -0
  302. package/package.json +374 -4
  303. package/src/app/application.tsx +138 -0
  304. package/src/appearance/appearance-host.tsx +205 -0
  305. package/src/appearance/appearance-preferences.ts +287 -0
  306. package/src/appearance/composition.ts +29 -0
  307. package/src/appearance/custom-theme-import.ts +424 -0
  308. package/src/appearance/custom-theme-library.ts +600 -0
  309. package/src/appearance/editor.ts +94 -0
  310. package/src/appearance/theme-file-importer.ts +103 -0
  311. package/src/appearance/theme-record-adapter.ts +106 -0
  312. package/src/appearance/theme-registry.ts +20 -0
  313. package/src/appearance/window-surface.ts +18 -0
  314. package/src/desktop/client-assets.ts +75 -0
  315. package/src/native/electrobun-cef-main-frame-bridges.patch +63 -0
  316. package/src/native/electrobun-windows-shortcut-com.patch +923 -0
  317. package/src/native/renderer-profile.ts +27 -0
  318. package/src/native/window-options.ts +24 -0
  319. package/src/shell/app-shell.tsx +294 -0
  320. package/src/shell/app-utilities.tsx +437 -0
  321. package/src/shell/help-shortcuts.ts +24 -0
  322. package/src/shell/navigation-drawer.tsx +36 -0
  323. package/src/shell/settings-sections.ts +74 -0
  324. package/src/shell/shortcut-platform.ts +35 -0
  325. package/src/updates/release-version.ts +57 -0
  326. package/src/updates/update-adapter.ts +129 -0
  327. package/src/updates/update-state.ts +34 -0
  328. package/src/views/app-about.tsx +44 -0
  329. package/src/views/app-appearance.tsx +32 -0
  330. package/src/views/app-help.tsx +43 -0
  331. package/src/views/app-settings.tsx +88 -0
  332. package/src/views/appearance-surface.tsx +427 -0
  333. package/src/views/update-surface.tsx +85 -0
  334. package/templates/application/.gitattributes +1 -0
  335. package/templates/application/.github/workflows/release-assets.yml +29 -0
  336. package/templates/application/.github/workflows/release-finalize.yml +29 -0
  337. package/templates/application/.github/workflows/release-please.yml +19 -0
  338. package/templates/application/.github/workflows/release.yml +29 -0
  339. package/templates/application/.github/workflows/validation.yml +28 -0
  340. package/templates/application/.oxfmtrc.json +6 -0
  341. package/templates/application/.oxlintrc.json +48 -0
  342. package/templates/application/.release-please-manifest.json +3 -0
  343. package/templates/application/README.md +47 -0
  344. package/templates/application/electrobun.config.ts +22 -0
  345. package/templates/application/release-please-config.json +12 -0
  346. package/templates/application/scripts/app-version.ts +9 -0
  347. package/templates/application/scripts/build-desktop.ts +34 -0
  348. package/templates/application/scripts/secure-build.ts +1 -0
  349. package/templates/application/scripts/stage-release.ts +21 -0
  350. package/templates/application/src/bun/index.ts +80 -0
  351. package/templates/application/src/electrobun.d.ts +27 -0
  352. package/templates/application/src/web/index.html +12 -0
  353. package/templates/application/src/web/main.tsx +97 -0
  354. package/templates/application/src/web/public/icon.svg +1 -0
  355. package/templates/application/src/web/style.css +3 -0
  356. package/templates/application/tests/app-config.test.ts +9 -0
  357. package/templates/application/tsconfig.json +15 -0
  358. package/templates/application/vite.config.ts +10 -0
@@ -0,0 +1,427 @@
1
+ /*
2
+ * Adea host adapter for the published @adea-ai/ui AppearanceEditor.
3
+ *
4
+ * The published component owns presentation only. This host keeps Adea's V2
5
+ * preference schema, provider preview/persistence, native transparency policy,
6
+ * accepted compatibility IDs, and declared-license theme-library flow.
7
+ */
8
+ import {
9
+ AppearanceEditor,
10
+ AppearancePopover,
11
+ type AppearanceDraft,
12
+ type AppearanceEditorProps,
13
+ } from '@adea-ai/ui/components/composites/appearance-editor'
14
+ import {
15
+ accents as accentPresets,
16
+ getAccent as accentPresetById,
17
+ } from '@adea-ai/ui/lib/accent-presets'
18
+ import { isThemeAccentId } from '@adea-ai/ui/lib/themes'
19
+ import {
20
+ preferencesFromSelection,
21
+ type AppearancePreferencesV2,
22
+ } from '../appearance/appearance-preferences'
23
+ import {
24
+ readCustomThemeLibrary,
25
+ removeCustomTheme,
26
+ subscribeCustomThemes,
27
+ } from '../appearance/custom-theme-library'
28
+ import { useTheme } from '../appearance/appearance-host'
29
+ import { mirrorWindowSurface } from '../appearance/window-surface'
30
+ import { Button } from '@adea-ai/ui/components/ui/button'
31
+ import { Input } from '@adea-ai/ui/components/ui/input'
32
+ import { ModalDialog } from '@adea-ai/ui/components/ui/modal-dialog'
33
+ import { Heading } from '@adea-ai/ui/components/ui/typography'
34
+ import { createEffect, createMemo, createSignal, onCleanup, onMount, untrack } from 'solid-js'
35
+ import { MonitorCog } from 'lucide-solid'
36
+
37
+ import { For, Show } from 'solid-js'
38
+ import { themeAccentsForRecords } from '@adea-ai/ui/lib/theme-projection'
39
+
40
+ import { draftVariants } from '../appearance/composition'
41
+ import { createAppearanceEditor } from '../appearance/editor'
42
+ import { createThemeFileImporter } from '../appearance/theme-file-importer'
43
+ import {
44
+ allThemeRecords,
45
+ appearanceThemeForPreview,
46
+ DEFAULT_CUSTOM_ACCENT,
47
+ normalizeCustomAccent,
48
+ } from '../appearance/theme-record-adapter'
49
+
50
+ // The shared catalogue owns every preset; theme-specific slots are offered separately.
51
+ const appearanceAccentOptions = Object.freeze(accentPresets.map((accent) => ({ ...accent })))
52
+
53
+ function customAccentValue(accent: string): string {
54
+ return accent === 'theme' || accentPresetById(accent) || isThemeAccentId(accent) ? '' : accent
55
+ }
56
+
57
+ type AppearanceControlProps = {
58
+ open: boolean
59
+ onOpen(): void
60
+ onClose(): void
61
+ }
62
+
63
+ export function AppearancePanel() {
64
+ return <AppearanceHost />
65
+ }
66
+
67
+ /** Device-local preview and persistence around the shared live popover. */
68
+ export function AppearanceControl(props: AppearanceControlProps) {
69
+ return <AppearanceHost popover={props} />
70
+ }
71
+
72
+ function AppearanceHost(props: { popover?: AppearanceControlProps }) {
73
+ const appearance = useTheme()
74
+ const editor = createAppearanceEditor()
75
+ // The shell starts without the 34-theme catalogue (ADR 0014). A draft of a
76
+ // catalogue theme previews once it has loaded, so fetch it when the editor opens
77
+ // instead of on the first click. Idempotent; a failure leaves the default pair.
78
+ onMount(() => void appearance.loadCatalogue?.())
79
+ // Mirror the glass choice to the native window whenever it changes (the
80
+ // desktop host registers the transport; everywhere else this is a no-op).
81
+ // The mirror is idempotent, so firing on the restored draft is harmless.
82
+ createEffect(() => {
83
+ const surface = editor.draft().surface
84
+ mirrorWindowSurface(surface === 'translucent' ? 'theme' : surface)
85
+ })
86
+ const [customAccent, setCustomAccent] = createSignal('')
87
+ // The published editor is controlled by the draft it receives. Keep an
88
+ // invalid raw string in that presentation draft while the host's canonical
89
+ // editor draft and live preview remain on the last validated accent.
90
+ const [rawCustomAccent, setRawCustomAccent] = createSignal('')
91
+ const [accentStatus, setAccentStatus] = createSignal('')
92
+ const [libraryOpen, setLibraryOpen] = createSignal(false)
93
+
94
+ const miniatures = createMemo(() => draftVariants(editor.draft()))
95
+ // Imported themes: refreshed through the registry subscription so the
96
+ // picker and this dialog track imports and removals without prop drilling.
97
+ const [library, setLibrary] = createSignal(
98
+ readCustomThemeLibrary(typeof window === 'undefined' ? undefined : window.localStorage)
99
+ )
100
+ onMount(() => {
101
+ setLibrary(readCustomThemeLibrary(window.localStorage))
102
+ onCleanup(subscribeCustomThemes(() => setLibrary(readCustomThemeLibrary(window.localStorage))))
103
+ })
104
+ // Reading the library signal here ties the editor's theme list to imports
105
+ // and removals: the record projection itself has no reactive dependency.
106
+ const themes = () => {
107
+ library()
108
+ return allThemeRecords()
109
+ }
110
+ const [importStatus, setImportStatus] = createSignal('')
111
+ const [importPending, setImportPending] = createSignal(false)
112
+ // The parsing and projection code loads when a file is chosen, not when the
113
+ // editor opens. A newer file, a closed dialog or an unmounted panel drops an
114
+ // import still in flight before it stores or selects anything.
115
+ const themeImporter = createThemeFileImporter({
116
+ load: async () => {
117
+ const { importCustomTheme } = await import('../appearance/custom-theme-import')
118
+ return (text) =>
119
+ importCustomTheme(text, window.localStorage, readCustomThemeLibrary(window.localStorage))
120
+ },
121
+ onPending: setImportPending,
122
+ onStatus: setImportStatus,
123
+ // Select the imported theme for its appearance so the user sees it land.
124
+ onImported: (theme) =>
125
+ setDraft(
126
+ theme.appearance === 'dark' ? { darkThemeId: theme.id } : { lightThemeId: theme.id }
127
+ ),
128
+ })
129
+ onCleanup(themeImporter.cancel)
130
+ const closeLibrary = () => {
131
+ themeImporter.cancel()
132
+ setLibraryOpen(false)
133
+ }
134
+
135
+ const themeAccentOptions = createMemo(() => {
136
+ const draft = editor.draft()
137
+ const records = themes()
138
+ const light = records.find((record) => record.id === draft.lightThemeId)
139
+ const dark = records.find((record) => record.id === draft.darkThemeId)
140
+ return light && dark ? themeAccentsForRecords(light, dark) : []
141
+ })
142
+
143
+ const publishedDraft = createMemo<AppearanceDraft>(() => {
144
+ const draft = editor.draft()
145
+ return {
146
+ ...draft,
147
+ accent:
148
+ rawCustomAccent() &&
149
+ !accentPresetById(draft.accent) &&
150
+ !isThemeAccentId(draft.accent) &&
151
+ draft.accent !== 'theme'
152
+ ? rawCustomAccent()
153
+ : draft.accent,
154
+ surface: draft.surface === 'translucent' ? 'theme' : draft.surface,
155
+ }
156
+ })
157
+
158
+ const sampleVariant = () => {
159
+ const variants = miniatures()
160
+ const mode = editor.draft().mode
161
+ if (mode === 'light') return variants.light
162
+ if (mode === 'dark') return variants.dark
163
+ return untrack(() => document.documentElement.classList.contains('dark'))
164
+ ? variants.dark
165
+ : variants.light
166
+ }
167
+
168
+ const preview = () => appearance.preview(editor.draft())
169
+
170
+ const revertDraft = () => {
171
+ appearance.preview(undefined)
172
+ const reverted = editor.revert()
173
+ setCustomAccent(customAccentValue(reverted.accent))
174
+ setRawCustomAccent(customAccentValue(reverted.accent))
175
+ setAccentStatus('')
176
+ closeLibrary()
177
+ }
178
+
179
+ const setDraft = (patch: Partial<AppearancePreferencesV2>) => {
180
+ editor.set(patch)
181
+ preview()
182
+ }
183
+
184
+ const setAccent = (value: string) => {
185
+ if (value === 'theme' || accentPresetById(value) || isThemeAccentId(value)) {
186
+ setCustomAccent('')
187
+ setRawCustomAccent('')
188
+ setAccentStatus('')
189
+ setDraft({ accent: value })
190
+ return
191
+ }
192
+
193
+ const validation = normalizeCustomAccent(value, sampleVariant().colors.background)
194
+ if (validation.value === undefined) {
195
+ // Keep the previous preview active while preserving the invalid input
196
+ // in the controlled published editor for correction and recovery.
197
+ setRawCustomAccent(value)
198
+ setAccentStatus(validation.error ?? 'Invalid custom accent.')
199
+ return
200
+ }
201
+ setCustomAccent(validation.value)
202
+ setRawCustomAccent(validation.value)
203
+ setAccentStatus('')
204
+ setDraft({ accent: validation.value })
205
+ }
206
+
207
+ const onChange = (patch: Partial<AppearanceDraft>) => {
208
+ if (patch.accent !== undefined) {
209
+ setAccent(patch.accent)
210
+ return
211
+ }
212
+ if (patch.surface !== undefined) {
213
+ setDraft({ surface: patch.surface === 'theme' ? 'translucent' : patch.surface })
214
+ return
215
+ }
216
+ setDraft(patch as Partial<AppearancePreferencesV2>)
217
+ }
218
+
219
+ const save = () => {
220
+ // The embedded section's published action stays disabled until the draft
221
+ // differs from the snapshot (saveDisabledReason below); this guard keeps a
222
+ // no-op open→close from writing even if the action were invoked through
223
+ // another path. The sheet keeps Save available instead: with nothing to
224
+ // write, saving is dismissing, so the sheet never shows disabled-state
225
+ // copy — it reverts the (unchanged) draft and closes.
226
+ if (accentStatus()) return
227
+ if (!editor.dirty()) {
228
+ revertDraft()
229
+ props.popover?.onClose()
230
+ return
231
+ }
232
+ const committed = editor.save()
233
+ appearance.update(committed)
234
+ appearance.preview(undefined)
235
+ props.popover?.onClose()
236
+ }
237
+
238
+ const reset = () => {
239
+ editor.reset()
240
+ setCustomAccent('')
241
+ setRawCustomAccent('')
242
+ setAccentStatus('')
243
+ preview()
244
+ }
245
+
246
+ const openDraft = () => {
247
+ const committed = untrack(() => preferencesFromSelection(appearance.selection()))
248
+ editor.open(committed)
249
+ setCustomAccent(customAccentValue(committed.accent))
250
+ setRawCustomAccent(customAccentValue(committed.accent))
251
+ setAccentStatus('')
252
+ closeLibrary()
253
+ }
254
+
255
+ onMount(openDraft)
256
+
257
+ onCleanup(revertDraft)
258
+
259
+ const editorProps: AppearanceEditorProps = {
260
+ get draft() {
261
+ return publishedDraft()
262
+ },
263
+ get lightTheme() {
264
+ return appearanceThemeForPreview(miniatures().light, editor.draft().accent, editor.draft())
265
+ },
266
+ get darkTheme() {
267
+ return appearanceThemeForPreview(miniatures().dark, editor.draft().accent, editor.draft())
268
+ },
269
+ get resolvedAppearance() {
270
+ return appearance.resolvedAppearance()
271
+ },
272
+ get themes() {
273
+ return themes()
274
+ },
275
+ // Adea's option order and accent presentation, as published options: the
276
+ // text settings close the list, the default accent is the Violet preset
277
+ // (so no extra "Theme default" swatch), the presets sit in one line with
278
+ // Custom opening the native colour selector, and each mode card carries
279
+ // its glyph.
280
+ fontSettingsPlacement: 'end',
281
+ accentEntryStyle: 'row',
282
+ showThemeDefaultAccent: false,
283
+ showModeIcons: true,
284
+ accentOptions: appearanceAccentOptions,
285
+ get themeAccentOptions() {
286
+ return themeAccentOptions()
287
+ },
288
+ get customAccentValue() {
289
+ return customAccent() || DEFAULT_CUSTOM_ACCENT
290
+ },
291
+ get customAccentError() {
292
+ return accentStatus()
293
+ },
294
+ // The published composite renders the reason as the action row's status
295
+ // line and disables Save while it is set. The embedded settings section
296
+ // keeps that disabled-with-reason treatment: its action row sits at the
297
+ // bottom of a long scrolling form, where "Save" being unavailable needs
298
+ // its one-line why. The sheet renders Save always available instead —
299
+ // with no edits, saving is dismissing (save above) — so the sheet never
300
+ // opens showing "No changes to save yet." over its action row.
301
+ get saveDisabledReason() {
302
+ if (props.popover) return undefined
303
+ return editor.dirty() ? undefined : 'No changes to save yet.'
304
+ },
305
+ surfaceCapability: {
306
+ frosted: true,
307
+ themeDefaultDescription:
308
+ 'Frosted makes the whole window translucent on macOS (applies after a relaunch).',
309
+ },
310
+ onChange,
311
+ onSave: save,
312
+ onCancel: () => {
313
+ revertDraft()
314
+ props.popover?.onClose()
315
+ },
316
+ onReset: reset,
317
+ onManageThemes: () => setLibraryOpen(true),
318
+ }
319
+
320
+ return (
321
+ <>
322
+ <Show
323
+ when={props.popover}
324
+ fallback={
325
+ <section aria-label="Appearance" class="grid gap-4">
326
+ <header class="flex items-start gap-3">
327
+ <MonitorCog aria-hidden="true" />
328
+ <div>
329
+ <Heading as="h3" size="card">
330
+ Appearance
331
+ </Heading>
332
+ <p>
333
+ Changes preview immediately. Save keeps them; leaving this section without saving
334
+ restores your previous appearance.
335
+ </p>
336
+ </div>
337
+ </header>
338
+ <AppearanceEditor {...editorProps} />
339
+ </section>
340
+ }
341
+ >
342
+ {(control) => (
343
+ <AppearancePopover
344
+ {...editorProps}
345
+ triggerVariant="toolbar"
346
+ open={control().open}
347
+ onOpen={() => {
348
+ openDraft()
349
+ control().onOpen()
350
+ }}
351
+ onDismiss={() => {
352
+ revertDraft()
353
+ control().onClose()
354
+ }}
355
+ />
356
+ )}
357
+ </Show>
358
+ <ModalDialog
359
+ modal={props.popover !== undefined}
360
+ open={libraryOpen()}
361
+ onClose={closeLibrary}
362
+ title="Manage themes"
363
+ description="Import a theme file. Imported themes appear in the Light and Dark theme menus and stay on this device."
364
+ class="max-h-full w-full max-w-104 overflow-y-auto"
365
+ >
366
+ <div class="flex flex-col gap-4">
367
+ <Button as="label" class="w-full">
368
+ <Input
369
+ type="file"
370
+ accept=".json,application/json"
371
+ class="sr-only"
372
+ onChange={(event) => {
373
+ const file = event.currentTarget.files?.[0]
374
+ event.currentTarget.value = ''
375
+ if (file) void themeImporter.importFile(file)
376
+ }}
377
+ />
378
+ Import a theme file (.json)
379
+ </Button>
380
+ <Show when={importStatus()}>
381
+ <p class="text-sm text-muted-foreground" role="status" aria-busy={importPending()}>
382
+ {importStatus()}
383
+ </p>
384
+ </Show>
385
+ <Show when={library().length > 0}>
386
+ <ul class="flex flex-col gap-2">
387
+ <For each={library()}>
388
+ {(theme) => (
389
+ <li class="flex items-center gap-2">
390
+ <span class="font-medium">{theme.name}</span>
391
+ <span class="text-sm text-muted-foreground">
392
+ {theme.appearance} · imported{' '}
393
+ {new Date(theme.importedAt).toLocaleDateString()}
394
+ </span>
395
+ <Button
396
+ type="button"
397
+ size="sm"
398
+ variant="ghost"
399
+ onClick={() => {
400
+ const removed = removeCustomTheme(
401
+ theme.id,
402
+ typeof window === 'undefined' ? undefined : window.localStorage
403
+ )
404
+ setImportStatus(
405
+ removed
406
+ ? ''
407
+ : 'The theme could not be removed. Check your storage and try again.'
408
+ )
409
+ }}
410
+ >
411
+ Remove
412
+ </Button>
413
+ </li>
414
+ )}
415
+ </For>
416
+ </ul>
417
+ </Show>
418
+ </div>
419
+ <footer class="flex justify-end">
420
+ <Button type="button" variant="outline" onClick={() => closeLibrary()}>
421
+ Close
422
+ </Button>
423
+ </footer>
424
+ </ModalDialog>
425
+ </>
426
+ )
427
+ }
@@ -0,0 +1,85 @@
1
+ import {
2
+ UpdateChannelControl,
3
+ UpdateDialog,
4
+ type ChannelControlActions,
5
+ type UpdateAdapter,
6
+ type UpdateChannel,
7
+ type UpdateState,
8
+ } from '@adea-ai/ui/components/composites/update-dialog'
9
+ import { createMemo, type Accessor } from 'solid-js'
10
+ import {
11
+ mirrorUpdateState,
12
+ updateChannelStore,
13
+ type UpdateChannelSource,
14
+ } from '../updates/update-adapter'
15
+
16
+ export * from '../updates/update-adapter'
17
+ export type { ChannelControlActions }
18
+
19
+ export type ApplicationUpdateSurfaceProps = {
20
+ adapter: UpdateAdapter
21
+ /** The application's name, icon and build version shown by the dialog. */
22
+ identity: Readonly<{ name: string; icon?: string; version?: string }>
23
+ /** Release-channel persistence: `read`/`persist`, or a service with `channel`/`setChannel`. */
24
+ channel?: UpdateChannelSource
25
+ /** Per-channel option labels, e.g. `{ 'pre-release': 'Daily' }`. */
26
+ channelLabels?: Partial<Record<UpdateChannel, string>>
27
+ /** Per-channel row descriptions. */
28
+ channelDescriptions?: Partial<Record<UpdateChannel, string>>
29
+ /** Receives every updater snapshot, for a pending-update badge. */
30
+ onUpdateState?(state: UpdateState): void
31
+ /** Complete build-time history, shown before the native status arrives. */
32
+ changelog?: string
33
+ /** Copy for a build without an installer. */
34
+ desktopOnlyMessage?: string
35
+ open: boolean
36
+ /** Called when the dialog asks to close. */
37
+ onClose?(): void
38
+ /** Called with every open-state change the dialog requests. */
39
+ onOpenChange?(open: boolean): void
40
+ restoreFocusRef?: Accessor<HTMLElement | undefined>
41
+ }
42
+
43
+ /** Updates only move forward, so leaving a pre-release channel never installs an older
44
+ * build: the app keeps the current one until a newer Stable release is published. */
45
+ const STABLE_DESCRIPTION =
46
+ 'Tested releases after about four days in pre-release. Switching from a newer pre-release keeps your current build until a newer Stable release is published.'
47
+
48
+ /** The shared Version & updates dialog, with an optional release-channel control. */
49
+ export function ApplicationUpdateSurface(props: ApplicationUpdateSurfaceProps) {
50
+ const adapter = createMemo(() => {
51
+ const onState = props.onUpdateState
52
+ return onState ? mirrorUpdateState(props.adapter, (state) => onState(state)) : props.adapter
53
+ })
54
+ const channel = createMemo(() => (props.channel ? updateChannelStore(props.channel) : undefined))
55
+ return (
56
+ <UpdateDialog
57
+ adapter={adapter()}
58
+ appName={props.identity.name}
59
+ appIcon={props.identity.icon}
60
+ fallbackVersion={props.identity.version}
61
+ changelog={props.changelog}
62
+ desktopOnlyMessage={props.desktopOnlyMessage}
63
+ open={props.open}
64
+ onOpenChange={(open) => {
65
+ props.onOpenChange?.(open)
66
+ if (!open) props.onClose?.()
67
+ }}
68
+ restoreFocusRef={props.restoreFocusRef}
69
+ channelControl={
70
+ channel()
71
+ ? (controls) => (
72
+ <UpdateChannelControl
73
+ controls={controls}
74
+ read={() => channel()!.read()}
75
+ persist={(value) => channel()!.persist(value)}
76
+ labels={props.channelLabels}
77
+ descriptions={{ stable: STABLE_DESCRIPTION, ...props.channelDescriptions }}
78
+ reloadOn={() => props.open}
79
+ />
80
+ )
81
+ : undefined
82
+ }
83
+ />
84
+ )
85
+ }
@@ -0,0 +1 @@
1
+ * text=auto eol=lf
@@ -0,0 +1,29 @@
1
+ name: Desktop release assets
2
+ # Builds, qualifies, signs and publishes one dev or daily tag. release:cut dispatches it;
3
+ # the framework CLIs verify this file's path (releaseWorkflows.assets), its
4
+ # workflow_dispatch event and this exact run name.
5
+ run-name: framework-release-assets:${{ inputs.tag }}
6
+ on:
7
+ workflow_dispatch:
8
+ inputs:
9
+ tag:
10
+ description: Existing dev or daily release tag
11
+ required: true
12
+ type: string
13
+ permissions: {}
14
+ concurrency:
15
+ group: desktop-release-assets-${{ github.repository }}-${{ inputs.tag }}
16
+ cancel-in-progress: false
17
+ jobs:
18
+ assets:
19
+ uses: adea-ai/app-framework/.github/workflows/desktop-release-assets.yml@{{FRAMEWORK_REF}}
20
+ permissions:
21
+ contents: write
22
+ actions: write
23
+ with:
24
+ tag: ${{ inputs.tag }}
25
+ renderer: '{{RENDERER}}'
26
+ # Daily runs dispatch finalization; a token-started run never triggers workflow_run.
27
+ finalize-workflow: release-finalize.yml
28
+ secrets:
29
+ ADEA_RELEASE_SIGNING_KEY: ${{ secrets.ADEA_RELEASE_SIGNING_KEY }}
@@ -0,0 +1,29 @@
1
+ name: Desktop release finalize
2
+ # Publishes a qualified Release Please draft. A daily Desktop release assets run dispatches
3
+ # it with its own run ID and attempt; to retry, dispatch from main with the tag and the
4
+ # successful assets run ID and attempt.
5
+ on:
6
+ workflow_dispatch:
7
+ inputs:
8
+ tag:
9
+ description: Existing Release Please tag
10
+ required: true
11
+ type: string
12
+ run_id:
13
+ description: Successful Desktop release assets run ID
14
+ required: true
15
+ type: string
16
+ run_attempt:
17
+ description: Successful workflow attempt number
18
+ required: true
19
+ type: string
20
+ permissions: {}
21
+ concurrency:
22
+ group: desktop-release-finalize-${{ github.repository }}
23
+ cancel-in-progress: false
24
+ jobs:
25
+ finalize:
26
+ uses: adea-ai/app-framework/.github/workflows/desktop-release-finalize.yml@{{FRAMEWORK_REF}}
27
+ permissions:
28
+ contents: write
29
+ actions: read
@@ -0,0 +1,19 @@
1
+ name: Release Please
2
+ # Owns the app version. Merging its release pull request bumps package.json and stages a
3
+ # draft release; the next scheduled Desktop release run builds it as the daily, and dev
4
+ # releases count v<next minor>-dev.N from 1 for each version after it.
5
+ on:
6
+ push:
7
+ branches: [main]
8
+ permissions: {}
9
+ concurrency:
10
+ group: release-please-${{ github.repository }}
11
+ cancel-in-progress: false
12
+ jobs:
13
+ release-please:
14
+ runs-on: ubuntu-latest
15
+ permissions:
16
+ contents: write
17
+ pull-requests: write
18
+ steps:
19
+ - uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5
@@ -0,0 +1,29 @@
1
+ name: Desktop release
2
+ # The shared framework release schedule: every merge to main cuts a dev release
3
+ # (v<next minor>-dev.N); each scheduled run builds the newest Release Please version as a
4
+ # daily and then promotes the newest qualified daily once `soakHours` (96) have passed
5
+ # since the last stable. The cron is the daily cadence; any interval works. Set
6
+ # DESKTOP_RELEASES_ENABLED=true once the release signing key is configured.
7
+ on:
8
+ push:
9
+ branches: [main]
10
+ schedule:
11
+ - cron: '23 12 * * *'
12
+ workflow_dispatch:
13
+ inputs:
14
+ operation:
15
+ description: dev or daily cuts a release from main; stable promotes the qualified daily.
16
+ type: choice
17
+ options: [dev, daily, stable]
18
+ required: true
19
+ permissions: {}
20
+ concurrency:
21
+ group: desktop-release-control-${{ github.repository }}
22
+ cancel-in-progress: false
23
+ jobs:
24
+ release:
25
+ if: vars.DESKTOP_RELEASES_ENABLED == 'true'
26
+ uses: adea-ai/app-framework/.github/workflows/desktop-release-control.yml@{{FRAMEWORK_REF}}
27
+ permissions:
28
+ contents: write
29
+ actions: write
@@ -0,0 +1,28 @@
1
+ name: Validation
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ pull_request:
6
+ branches: [main]
7
+ permissions:
8
+ contents: read
9
+ concurrency:
10
+ group: validation-${{ github.event.pull_request.number || github.ref }}
11
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-latest
15
+ timeout-minutes: 20
16
+ steps:
17
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
18
+ with:
19
+ persist-credentials: false
20
+ - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
21
+ with:
22
+ bun-version: 1.4.4
23
+ - run: bun install --frozen-lockfile
24
+ - run: bun run format:check
25
+ - run: bun run lint
26
+ - run: bun run typecheck
27
+ - run: bun run test
28
+ - run: bun run build:web
@@ -0,0 +1,6 @@
1
+ {
2
+ "semi": false,
3
+ "singleQuote": true,
4
+ "trailingComma": "es5",
5
+ "printWidth": 100
6
+ }