waybetter 0.1.1 → 0.7.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.
Files changed (537) hide show
  1. package/README.md +139 -6
  2. package/bin/waybetter.mjs +43 -0
  3. package/build/runtime.mjs +105 -0
  4. package/cli/buildenv.mjs +130 -0
  5. package/cli/dev.mjs +97 -0
  6. package/cli/i18n.mjs +382 -0
  7. package/cli/manifests.mjs +383 -0
  8. package/cli/release.mjs +437 -0
  9. package/cli/releasecheck.mjs +15 -0
  10. package/cli/remote.mjs +260 -0
  11. package/cli/store.mjs +378 -0
  12. package/cli/strings.mjs +123 -0
  13. package/dist/runtime/column.d.ts +93 -0
  14. package/dist/runtime/column.js +451 -0
  15. package/dist/runtime/column.js.map +1 -0
  16. package/dist/runtime/commandReport.d.ts +19 -0
  17. package/dist/runtime/commandReport.js +47 -0
  18. package/dist/runtime/commandReport.js.map +1 -0
  19. package/dist/runtime/commands.d.ts +72 -0
  20. package/dist/runtime/commands.js +214 -0
  21. package/dist/runtime/commands.js.map +1 -0
  22. package/dist/runtime/devErrors.d.ts +16 -0
  23. package/dist/runtime/devErrors.js +30 -0
  24. package/dist/runtime/devErrors.js.map +1 -0
  25. package/dist/runtime/domHub.d.ts +21 -0
  26. package/dist/runtime/domHub.js +139 -4
  27. package/dist/runtime/domHub.js.map +1 -1
  28. package/dist/runtime/featureModules.d.ts +157 -0
  29. package/dist/runtime/featureModules.js +484 -0
  30. package/dist/runtime/featureModules.js.map +1 -0
  31. package/dist/runtime/featureTable.d.ts +144 -0
  32. package/dist/runtime/featureTable.js +223 -0
  33. package/dist/runtime/featureTable.js.map +1 -0
  34. package/dist/runtime/fonts.d.ts +22 -0
  35. package/dist/runtime/fonts.js +72 -0
  36. package/dist/runtime/fonts.js.map +1 -0
  37. package/dist/runtime/i18n.d.ts +138 -0
  38. package/dist/runtime/i18n.js +614 -0
  39. package/dist/runtime/i18n.js.map +1 -0
  40. package/dist/runtime/i18nCheck.d.ts +30 -0
  41. package/dist/runtime/i18nCheck.js +224 -0
  42. package/dist/runtime/i18nCheck.js.map +1 -0
  43. package/dist/runtime/pageLang.d.ts +8 -0
  44. package/dist/runtime/pageLang.js +64 -0
  45. package/dist/runtime/pageLang.js.map +1 -0
  46. package/dist/runtime/pageStrings.d.ts +35 -0
  47. package/dist/runtime/pageStrings.js +76 -0
  48. package/dist/runtime/pageStrings.js.map +1 -0
  49. package/dist/runtime/panelButton.d.ts +33 -0
  50. package/dist/runtime/panelButton.js +83 -0
  51. package/dist/runtime/panelButton.js.map +1 -0
  52. package/dist/runtime/permissions.d.ts +47 -0
  53. package/dist/runtime/permissions.js +141 -0
  54. package/dist/runtime/permissions.js.map +1 -0
  55. package/dist/runtime/pluginApi.d.ts +51 -2
  56. package/dist/runtime/pluginApi.js +137 -22
  57. package/dist/runtime/pluginApi.js.map +1 -1
  58. package/dist/runtime/pluginI18n.d.ts +29 -0
  59. package/dist/runtime/pluginI18n.js +119 -0
  60. package/dist/runtime/pluginI18n.js.map +1 -0
  61. package/dist/runtime/settingsForm.d.ts +66 -0
  62. package/dist/runtime/settingsForm.js +114 -0
  63. package/dist/runtime/settingsForm.js.map +1 -0
  64. package/dist/runtime/site.d.ts +5 -0
  65. package/dist/runtime/site.js +1 -1
  66. package/dist/runtime/site.js.map +1 -1
  67. package/dist/runtime/siteRuntime.d.ts +144 -0
  68. package/dist/runtime/siteRuntime.js +175 -0
  69. package/dist/runtime/siteRuntime.js.map +1 -0
  70. package/dist/runtime/stringPackHook.d.ts +84 -0
  71. package/dist/runtime/stringPackHook.js +220 -0
  72. package/dist/runtime/stringPackHook.js.map +1 -0
  73. package/dist/runtime/stringPackTranslate.d.ts +61 -0
  74. package/dist/runtime/stringPackTranslate.js +267 -0
  75. package/dist/runtime/stringPackTranslate.js.map +1 -0
  76. package/dist/runtime/stringPacks.d.ts +248 -0
  77. package/dist/runtime/stringPacks.js +610 -0
  78. package/dist/runtime/stringPacks.js.map +1 -0
  79. package/dist/runtime/styles.d.ts +15 -0
  80. package/dist/runtime/styles.js +81 -0
  81. package/dist/runtime/styles.js.map +1 -0
  82. package/dist/runtime/textNet.d.ts +15 -0
  83. package/dist/runtime/textNet.js +131 -0
  84. package/dist/runtime/textNet.js.map +1 -0
  85. package/dist/runtime/themeApi.d.ts +121 -0
  86. package/dist/runtime/themeApi.js +220 -0
  87. package/dist/runtime/themeApi.js.map +1 -0
  88. package/dist/runtime/themeBar.d.ts +28 -0
  89. package/dist/runtime/themeBar.js +82 -0
  90. package/dist/runtime/themeBar.js.map +1 -0
  91. package/dist/runtime/themeChoice.d.ts +52 -0
  92. package/dist/runtime/themeChoice.js +69 -0
  93. package/dist/runtime/themeChoice.js.map +1 -0
  94. package/dist/runtime/themeComponents.d.ts +435 -0
  95. package/dist/runtime/themeComponents.js +476 -0
  96. package/dist/runtime/themeComponents.js.map +1 -0
  97. package/dist/runtime/themeDecor.d.ts +73 -0
  98. package/dist/runtime/themeDecor.js +133 -0
  99. package/dist/runtime/themeDecor.js.map +1 -0
  100. package/dist/runtime/themeDerive.d.ts +69 -0
  101. package/dist/runtime/themeDerive.js +117 -0
  102. package/dist/runtime/themeDerive.js.map +1 -0
  103. package/dist/runtime/themeDoctor.d.ts +52 -0
  104. package/dist/runtime/themeDoctor.js +112 -0
  105. package/dist/runtime/themeDoctor.js.map +1 -0
  106. package/dist/runtime/themeGuards.d.ts +60 -0
  107. package/dist/runtime/themeGuards.js +235 -0
  108. package/dist/runtime/themeGuards.js.map +1 -0
  109. package/dist/runtime/themeIcons.d.ts +130 -0
  110. package/dist/runtime/themeIcons.js +271 -0
  111. package/dist/runtime/themeIcons.js.map +1 -0
  112. package/dist/runtime/themeInk.d.ts +37 -0
  113. package/dist/runtime/themeInk.js +111 -0
  114. package/dist/runtime/themeInk.js.map +1 -0
  115. package/dist/runtime/themeInvariants.d.ts +39 -0
  116. package/dist/runtime/themeInvariants.js +273 -0
  117. package/dist/runtime/themeInvariants.js.map +1 -0
  118. package/dist/runtime/themeRuntime.d.ts +114 -0
  119. package/dist/runtime/themeRuntime.js +570 -0
  120. package/dist/runtime/themeRuntime.js.map +1 -0
  121. package/dist/runtime/themeSchema.d.ts +10 -0
  122. package/dist/runtime/themeSchema.js +150 -0
  123. package/dist/runtime/themeSchema.js.map +1 -0
  124. package/dist/runtime/themeSpec.d.ts +263 -0
  125. package/dist/runtime/themeSpec.js +435 -0
  126. package/dist/runtime/themeSpec.js.map +1 -0
  127. package/dist/runtime/themeTokens.d.ts +12 -0
  128. package/dist/runtime/themeTokens.js +14 -6
  129. package/dist/runtime/themeTokens.js.map +1 -1
  130. package/dist/runtime/themeVariants.d.ts +30 -0
  131. package/dist/runtime/themeVariants.js +53 -0
  132. package/dist/runtime/themeVariants.js.map +1 -0
  133. package/dist/runtime/ui.d.ts +192 -0
  134. package/dist/runtime/ui.js +926 -0
  135. package/dist/runtime/ui.js.map +1 -0
  136. package/dist/shell/InstallDialog.d.ts +40 -0
  137. package/dist/shell/InstallDialog.js +176 -0
  138. package/dist/shell/InstallDialog.js.map +1 -0
  139. package/dist/shell/StoreView.d.ts +78 -0
  140. package/dist/shell/StoreView.js +108 -0
  141. package/dist/shell/StoreView.js.map +1 -0
  142. package/dist/shell/addressModel.js.map +1 -1
  143. package/dist/shell/chrome.js.map +1 -1
  144. package/dist/shell/deckModel.d.ts +117 -0
  145. package/dist/shell/deckModel.js +267 -0
  146. package/dist/shell/deckModel.js.map +1 -0
  147. package/dist/shell/frame/AccountSwitcher.d.ts +42 -0
  148. package/dist/shell/frame/AccountSwitcher.js +243 -0
  149. package/dist/shell/frame/AccountSwitcher.js.map +1 -0
  150. package/dist/shell/frame/AddColumnDialog.d.ts +8 -0
  151. package/dist/shell/frame/AddColumnDialog.js +81 -0
  152. package/dist/shell/frame/AddColumnDialog.js.map +1 -0
  153. package/dist/shell/frame/AppMenu.d.ts +44 -0
  154. package/dist/shell/frame/AppMenu.js +721 -0
  155. package/dist/shell/frame/AppMenu.js.map +1 -0
  156. package/dist/shell/frame/CommandPalette.d.ts +7 -0
  157. package/dist/shell/frame/CommandPalette.js +118 -0
  158. package/dist/shell/frame/CommandPalette.js.map +1 -0
  159. package/dist/shell/frame/DeckView.d.ts +13 -0
  160. package/dist/shell/frame/DeckView.js +287 -0
  161. package/dist/shell/frame/DeckView.js.map +1 -0
  162. package/dist/shell/frame/FindBar.d.ts +10 -0
  163. package/dist/shell/frame/FindBar.js +108 -0
  164. package/dist/shell/frame/FindBar.js.map +1 -0
  165. package/dist/shell/frame/MediaPanel.d.ts +8 -0
  166. package/dist/shell/frame/MediaPanel.js +76 -0
  167. package/dist/shell/frame/MediaPanel.js.map +1 -0
  168. package/dist/shell/frame/NewTabPage.d.ts +9 -0
  169. package/dist/shell/frame/NewTabPage.js +71 -0
  170. package/dist/shell/frame/NewTabPage.js.map +1 -0
  171. package/dist/shell/frame/PaneTheme.d.ts +16 -0
  172. package/dist/shell/frame/PaneTheme.js +67 -0
  173. package/dist/shell/frame/PaneTheme.js.map +1 -0
  174. package/dist/shell/frame/ReportDialog.d.ts +3 -0
  175. package/dist/shell/frame/ReportDialog.js +95 -0
  176. package/dist/shell/frame/ReportDialog.js.map +1 -0
  177. package/dist/shell/frame/Shell.d.ts +9 -0
  178. package/dist/shell/frame/Shell.js +1139 -0
  179. package/dist/shell/frame/Shell.js.map +1 -0
  180. package/dist/shell/frame/Titlebar.d.ts +17 -0
  181. package/dist/shell/frame/Titlebar.js +79 -0
  182. package/dist/shell/frame/Titlebar.js.map +1 -0
  183. package/dist/shell/frame/TitlebarExtras.d.ts +4 -0
  184. package/dist/shell/frame/TitlebarExtras.js +202 -0
  185. package/dist/shell/frame/TitlebarExtras.js.map +1 -0
  186. package/dist/shell/frame/WebPanel.d.ts +4 -0
  187. package/dist/shell/frame/WebPanel.js +185 -0
  188. package/dist/shell/frame/WebPanel.js.map +1 -0
  189. package/dist/shell/frame/accountModel.d.ts +49 -0
  190. package/dist/shell/frame/accountModel.js +67 -0
  191. package/dist/shell/frame/accountModel.js.map +1 -0
  192. package/dist/shell/frame/accountSwitcher.css +91 -0
  193. package/dist/shell/frame/appI18n.d.ts +44 -0
  194. package/dist/shell/frame/appI18n.js +64 -0
  195. package/dist/shell/frame/appI18n.js.map +1 -0
  196. package/dist/shell/frame/appMenu.css +127 -0
  197. package/dist/shell/frame/backupModel.d.ts +38 -0
  198. package/dist/shell/frame/backupModel.js +192 -0
  199. package/dist/shell/frame/backupModel.js.map +1 -0
  200. package/dist/shell/frame/boot.d.ts +8 -0
  201. package/dist/shell/frame/boot.js +37 -0
  202. package/dist/shell/frame/boot.js.map +1 -0
  203. package/dist/shell/frame/brand.d.ts +1 -0
  204. package/dist/shell/frame/brand.js +4 -0
  205. package/dist/shell/frame/brand.js.map +1 -0
  206. package/dist/shell/frame/bridge.d.ts +35 -0
  207. package/dist/shell/frame/bridge.js +70 -0
  208. package/dist/shell/frame/bridge.js.map +1 -0
  209. package/dist/shell/frame/chromeTheme.d.ts +47 -0
  210. package/dist/shell/frame/chromeTheme.js +118 -0
  211. package/dist/shell/frame/chromeTheme.js.map +1 -0
  212. package/dist/shell/frame/deck.css +209 -0
  213. package/dist/shell/frame/deckStore.d.ts +89 -0
  214. package/dist/shell/frame/deckStore.js +239 -0
  215. package/dist/shell/frame/deckStore.js.map +1 -0
  216. package/dist/shell/frame/devHost.d.ts +35 -0
  217. package/dist/shell/frame/devHost.js +80 -0
  218. package/dist/shell/frame/devHost.js.map +1 -0
  219. package/dist/shell/frame/devModel.d.ts +7 -0
  220. package/dist/shell/frame/devModel.js +17 -0
  221. package/dist/shell/frame/devModel.js.map +1 -0
  222. package/dist/shell/frame/diag.d.ts +7 -0
  223. package/dist/shell/frame/diag.js +39 -0
  224. package/dist/shell/frame/diag.js.map +1 -0
  225. package/dist/shell/frame/edges.css +159 -0
  226. package/dist/shell/frame/findBar.css +14 -0
  227. package/dist/shell/frame/frameMessages.d.ts +248 -0
  228. package/dist/shell/frame/frameMessages.js +252 -0
  229. package/dist/shell/frame/frameMessages.js.map +1 -0
  230. package/dist/shell/frame/hooks.d.ts +39 -0
  231. package/dist/shell/frame/hooks.js +97 -0
  232. package/dist/shell/frame/hooks.js.map +1 -0
  233. package/dist/shell/frame/i18n.d.ts +27 -0
  234. package/dist/shell/frame/i18n.js +66 -0
  235. package/dist/shell/frame/i18n.js.map +1 -0
  236. package/dist/shell/frame/iconPack.d.ts +11 -0
  237. package/dist/shell/frame/iconPack.js +45 -0
  238. package/dist/shell/frame/iconPack.js.map +1 -0
  239. package/dist/shell/frame/icons.d.ts +71 -0
  240. package/dist/shell/frame/icons.js +75 -0
  241. package/dist/shell/frame/icons.js.map +1 -0
  242. package/dist/shell/frame/index.d.ts +34 -0
  243. package/dist/shell/frame/index.js +43 -0
  244. package/dist/shell/frame/index.js.map +1 -0
  245. package/dist/shell/frame/language.d.ts +58 -0
  246. package/dist/shell/frame/language.js +165 -0
  247. package/dist/shell/frame/language.js.map +1 -0
  248. package/dist/shell/frame/mediaModel.d.ts +47 -0
  249. package/dist/shell/frame/mediaModel.js +67 -0
  250. package/dist/shell/frame/mediaModel.js.map +1 -0
  251. package/dist/shell/frame/menuMessages.en.json +96 -0
  252. package/dist/shell/frame/menuModel.d.ts +319 -0
  253. package/dist/shell/frame/menuModel.js +301 -0
  254. package/dist/shell/frame/menuModel.js.map +1 -0
  255. package/dist/shell/frame/nativeMenu.d.ts +5 -0
  256. package/dist/shell/frame/nativeMenu.js +178 -0
  257. package/dist/shell/frame/nativeMenu.js.map +1 -0
  258. package/dist/shell/frame/nativeMenuModel.d.ts +102 -0
  259. package/dist/shell/frame/nativeMenuModel.js +186 -0
  260. package/dist/shell/frame/nativeMenuModel.js.map +1 -0
  261. package/dist/shell/frame/paletteModel.d.ts +139 -0
  262. package/dist/shell/frame/paletteModel.js +114 -0
  263. package/dist/shell/frame/paletteModel.js.map +1 -0
  264. package/dist/shell/frame/paneTheme.css +9 -0
  265. package/dist/shell/frame/pluginCommandStore.d.ts +23 -0
  266. package/dist/shell/frame/pluginCommandStore.js +70 -0
  267. package/dist/shell/frame/pluginCommandStore.js.map +1 -0
  268. package/dist/shell/frame/reportModel.d.ts +52 -0
  269. package/dist/shell/frame/reportModel.js +105 -0
  270. package/dist/shell/frame/reportModel.js.map +1 -0
  271. package/dist/shell/frame/safeStore.d.ts +7 -0
  272. package/dist/shell/frame/safeStore.js +40 -0
  273. package/dist/shell/frame/safeStore.js.map +1 -0
  274. package/dist/shell/frame/searchInput.d.ts +2 -0
  275. package/dist/shell/frame/searchInput.js +11 -0
  276. package/dist/shell/frame/searchInput.js.map +1 -0
  277. package/dist/shell/frame/shell.css +634 -0
  278. package/dist/shell/frame/site.d.ts +206 -0
  279. package/dist/shell/frame/site.js +22 -0
  280. package/dist/shell/frame/site.js.map +1 -0
  281. package/dist/shell/frame/state.d.ts +101 -0
  282. package/dist/shell/frame/state.js +286 -0
  283. package/dist/shell/frame/state.js.map +1 -0
  284. package/dist/shell/frame/syncGate.d.ts +10 -0
  285. package/dist/shell/frame/syncGate.js +36 -0
  286. package/dist/shell/frame/syncGate.js.map +1 -0
  287. package/dist/shell/frame/syncHost.d.ts +35 -0
  288. package/dist/shell/frame/syncHost.js +85 -0
  289. package/dist/shell/frame/syncHost.js.map +1 -0
  290. package/dist/shell/frame/tabStill.d.ts +2 -0
  291. package/dist/shell/frame/tabStill.js +62 -0
  292. package/dist/shell/frame/tabStill.js.map +1 -0
  293. package/dist/shell/frame/themeScopes.d.ts +29 -0
  294. package/dist/shell/frame/themeScopes.js +61 -0
  295. package/dist/shell/frame/themeScopes.js.map +1 -0
  296. package/dist/shell/frame/themeStore.d.ts +99 -0
  297. package/dist/shell/frame/themeStore.js +267 -0
  298. package/dist/shell/frame/themeStore.js.map +1 -0
  299. package/dist/shell/frame/windowBinding.d.ts +2 -0
  300. package/dist/shell/frame/windowBinding.js +7 -0
  301. package/dist/shell/frame/windowBinding.js.map +1 -0
  302. package/dist/shell/frame/workspaceModel.d.ts +82 -0
  303. package/dist/shell/frame/workspaceModel.js +250 -0
  304. package/dist/shell/frame/workspaceModel.js.map +1 -0
  305. package/dist/shell/frame/workspaces.css +84 -0
  306. package/dist/shell/frame/workspaces.d.ts +22 -0
  307. package/dist/shell/frame/workspaces.js +125 -0
  308. package/dist/shell/frame/workspaces.js.map +1 -0
  309. package/dist/shell/frame/zoomStore.d.ts +10 -0
  310. package/dist/shell/frame/zoomStore.js +65 -0
  311. package/dist/shell/frame/zoomStore.js.map +1 -0
  312. package/dist/shell/installController.d.ts +137 -0
  313. package/dist/shell/installController.js +172 -0
  314. package/dist/shell/installController.js.map +1 -0
  315. package/dist/shell/installerMessages.d.ts +30 -0
  316. package/dist/shell/installerMessages.js +36 -0
  317. package/dist/shell/installerMessages.js.map +1 -0
  318. package/dist/shell/linkDrop.js.map +1 -1
  319. package/dist/shell/messages.d.ts +16 -0
  320. package/dist/shell/messages.js +27 -0
  321. package/dist/shell/messages.js.map +1 -0
  322. package/dist/shell/palette.js.map +1 -1
  323. package/dist/shell/paneModel.d.ts +22 -0
  324. package/dist/shell/paneModel.js +24 -1
  325. package/dist/shell/paneModel.js.map +1 -1
  326. package/dist/shell/panel/Appearance.d.ts +8 -0
  327. package/dist/shell/panel/Appearance.js +265 -0
  328. package/dist/shell/panel/Appearance.js.map +1 -0
  329. package/dist/shell/panel/BackupPanel.d.ts +5 -0
  330. package/dist/shell/panel/BackupPanel.js +198 -0
  331. package/dist/shell/panel/BackupPanel.js.map +1 -0
  332. package/dist/shell/panel/DeveloperPanel.d.ts +4 -0
  333. package/dist/shell/panel/DeveloperPanel.js +51 -0
  334. package/dist/shell/panel/DeveloperPanel.js.map +1 -0
  335. package/dist/shell/panel/FeatureToggles.d.ts +13 -0
  336. package/dist/shell/panel/FeatureToggles.js +42 -0
  337. package/dist/shell/panel/FeatureToggles.js.map +1 -0
  338. package/dist/shell/panel/Home.d.ts +3 -0
  339. package/dist/shell/panel/Home.js +23 -0
  340. package/dist/shell/panel/Home.js.map +1 -0
  341. package/dist/shell/panel/IconPackInstall.d.ts +15 -0
  342. package/dist/shell/panel/IconPackInstall.js +41 -0
  343. package/dist/shell/panel/IconPackInstall.js.map +1 -0
  344. package/dist/shell/panel/LanguageSettings.d.ts +1 -0
  345. package/dist/shell/panel/LanguageSettings.js +54 -0
  346. package/dist/shell/panel/LanguageSettings.js.map +1 -0
  347. package/dist/shell/panel/MakePanel.d.ts +3 -0
  348. package/dist/shell/panel/MakePanel.js +237 -0
  349. package/dist/shell/panel/MakePanel.js.map +1 -0
  350. package/dist/shell/panel/MarkdownDoc.d.ts +6 -0
  351. package/dist/shell/panel/MarkdownDoc.js +35 -0
  352. package/dist/shell/panel/MarkdownDoc.js.map +1 -0
  353. package/dist/shell/panel/Modes.d.ts +40 -0
  354. package/dist/shell/panel/Modes.js +270 -0
  355. package/dist/shell/panel/Modes.js.map +1 -0
  356. package/dist/shell/panel/NavIcon.d.ts +4 -0
  357. package/dist/shell/panel/NavIcon.js +6 -0
  358. package/dist/shell/panel/NavIcon.js.map +1 -0
  359. package/dist/shell/panel/Panel.d.ts +7 -0
  360. package/dist/shell/panel/Panel.js +139 -0
  361. package/dist/shell/panel/Panel.js.map +1 -0
  362. package/dist/shell/panel/PluginFeatures.d.ts +24 -0
  363. package/dist/shell/panel/PluginFeatures.js +165 -0
  364. package/dist/shell/panel/PluginFeatures.js.map +1 -0
  365. package/dist/shell/panel/Plugins.d.ts +33 -0
  366. package/dist/shell/panel/Plugins.js +112 -0
  367. package/dist/shell/panel/Plugins.js.map +1 -0
  368. package/dist/shell/panel/PowerSettings.d.ts +4 -0
  369. package/dist/shell/panel/PowerSettings.js +52 -0
  370. package/dist/shell/panel/PowerSettings.js.map +1 -0
  371. package/dist/shell/panel/Settings.d.ts +23 -0
  372. package/dist/shell/panel/Settings.js +117 -0
  373. package/dist/shell/panel/Settings.js.map +1 -0
  374. package/dist/shell/panel/ShareSetup.d.ts +8 -0
  375. package/dist/shell/panel/ShareSetup.js +130 -0
  376. package/dist/shell/panel/ShareSetup.js.map +1 -0
  377. package/dist/shell/panel/StoreSection.d.ts +7 -0
  378. package/dist/shell/panel/StoreSection.js +78 -0
  379. package/dist/shell/panel/StoreSection.js.map +1 -0
  380. package/dist/shell/panel/StringPacks.d.ts +20 -0
  381. package/dist/shell/panel/StringPacks.js +131 -0
  382. package/dist/shell/panel/StringPacks.js.map +1 -0
  383. package/dist/shell/panel/ThemeBuilder.d.ts +5 -0
  384. package/dist/shell/panel/ThemeBuilder.js +205 -0
  385. package/dist/shell/panel/ThemeBuilder.js.map +1 -0
  386. package/dist/shell/panel/backup.css +34 -0
  387. package/dist/shell/panel/builder.css +240 -0
  388. package/dist/shell/panel/builderModel.d.ts +55 -0
  389. package/dist/shell/panel/builderModel.js +95 -0
  390. package/dist/shell/panel/builderModel.js.map +1 -0
  391. package/dist/shell/panel/compare.d.ts +10 -0
  392. package/dist/shell/panel/compare.js +51 -0
  393. package/dist/shell/panel/compare.js.map +1 -0
  394. package/dist/shell/panel/controls.d.ts +135 -0
  395. package/dist/shell/panel/controls.js +213 -0
  396. package/dist/shell/panel/controls.js.map +1 -0
  397. package/dist/shell/panel/featureModel.d.ts +69 -0
  398. package/dist/shell/panel/featureModel.js +79 -0
  399. package/dist/shell/panel/featureModel.js.map +1 -0
  400. package/dist/shell/panel/fonts/FontBrowser.d.ts +10 -0
  401. package/dist/shell/panel/fonts/FontBrowser.js +189 -0
  402. package/dist/shell/panel/fonts/FontBrowser.js.map +1 -0
  403. package/dist/shell/panel/fonts/FontRoles.d.ts +20 -0
  404. package/dist/shell/panel/fonts/FontRoles.js +77 -0
  405. package/dist/shell/panel/fonts/FontRoles.js.map +1 -0
  406. package/dist/shell/panel/fonts/catalog.d.ts +37 -0
  407. package/dist/shell/panel/fonts/catalog.js +68 -0
  408. package/dist/shell/panel/fonts/catalog.js.map +1 -0
  409. package/dist/shell/panel/fonts/googleFontsCatalog.json +1 -0
  410. package/dist/shell/panel/index.d.ts +20 -0
  411. package/dist/shell/panel/index.js +34 -0
  412. package/dist/shell/panel/index.js.map +1 -0
  413. package/dist/shell/panel/languageModel.d.ts +5 -0
  414. package/dist/shell/panel/languageModel.js +7 -0
  415. package/dist/shell/panel/languageModel.js.map +1 -0
  416. package/dist/shell/panel/make.css +73 -0
  417. package/dist/shell/panel/makeModel.d.ts +32 -0
  418. package/dist/shell/panel/makeModel.js +84 -0
  419. package/dist/shell/panel/makeModel.js.map +1 -0
  420. package/dist/shell/panel/markdown.d.ts +46 -0
  421. package/dist/shell/panel/markdown.js +100 -0
  422. package/dist/shell/panel/markdown.js.map +1 -0
  423. package/dist/shell/panel/nav.d.ts +12 -0
  424. package/dist/shell/panel/nav.js +50 -0
  425. package/dist/shell/panel/nav.js.map +1 -0
  426. package/dist/shell/panel/panel.css +401 -0
  427. package/dist/shell/panel/panelMessages.d.ts +803 -0
  428. package/dist/shell/panel/panelMessages.js +779 -0
  429. package/dist/shell/panel/panelMessages.js.map +1 -0
  430. package/dist/shell/panel/plugins.css +59 -0
  431. package/dist/shell/panel/setupModel.d.ts +87 -0
  432. package/dist/shell/panel/setupModel.js +152 -0
  433. package/dist/shell/panel/setupModel.js.map +1 -0
  434. package/dist/shell/panel/site.d.ts +259 -0
  435. package/dist/shell/panel/site.js +25 -0
  436. package/dist/shell/panel/site.js.map +1 -0
  437. package/dist/shell/panel/strings.css +7 -0
  438. package/dist/shell/panel/themes.d.ts +10 -0
  439. package/dist/shell/panel/themes.js +8 -0
  440. package/dist/shell/panel/themes.js.map +1 -0
  441. package/dist/shell/profileModel.d.ts +3 -2
  442. package/dist/shell/profileModel.js +7 -5
  443. package/dist/shell/profileModel.js.map +1 -1
  444. package/dist/shell/store.css +250 -0
  445. package/dist/shell/storeMessages.d.ts +193 -0
  446. package/dist/shell/storeMessages.js +196 -0
  447. package/dist/shell/storeMessages.js.map +1 -0
  448. package/dist/shell/storeModel.d.ts +205 -0
  449. package/dist/shell/storeModel.js +146 -0
  450. package/dist/shell/storeModel.js.map +1 -0
  451. package/dist/shell/stringPacksModel.d.ts +44 -0
  452. package/dist/shell/stringPacksModel.js +99 -0
  453. package/dist/shell/stringPacksModel.js.map +1 -0
  454. package/dist/shell/updateModel.d.ts +2 -1
  455. package/dist/shell/updateModel.js +5 -4
  456. package/dist/shell/updateModel.js.map +1 -1
  457. package/dist/shell/windowControls.d.ts +4 -0
  458. package/dist/shell/windowControls.js +5 -0
  459. package/dist/shell/windowControls.js.map +1 -1
  460. package/i18n-config.schema.json +29 -0
  461. package/i18n-meta.schema.json +26 -0
  462. package/i18n.schema.json +42 -0
  463. package/icons.schema.json +655 -0
  464. package/languages.schema.json +23 -0
  465. package/locales/ar-x-fm.json +11 -0
  466. package/locales/ar.json +1388 -0
  467. package/locales/bg.json +1387 -0
  468. package/locales/bn.json +1387 -0
  469. package/locales/ca.json +1387 -0
  470. package/locales/cs.json +1387 -0
  471. package/locales/da.json +1387 -0
  472. package/locales/de.json +1387 -0
  473. package/locales/el.json +1387 -0
  474. package/locales/en-GB.json +27 -0
  475. package/locales/en.json +1386 -0
  476. package/locales/en.meta.json +51 -0
  477. package/locales/es.json +1387 -0
  478. package/locales/eu.json +1387 -0
  479. package/locales/fa.json +1388 -0
  480. package/locales/fi.json +1387 -0
  481. package/locales/fil.json +1387 -0
  482. package/locales/fr.json +1387 -0
  483. package/locales/ga.json +1387 -0
  484. package/locales/gl.json +1387 -0
  485. package/locales/gu.json +1387 -0
  486. package/locales/ha.json +1387 -0
  487. package/locales/he.json +1388 -0
  488. package/locales/hi.json +1387 -0
  489. package/locales/hr.json +1387 -0
  490. package/locales/hu.json +1387 -0
  491. package/locales/id.json +1387 -0
  492. package/locales/ig.json +1387 -0
  493. package/locales/it.json +1387 -0
  494. package/locales/ja.json +1387 -0
  495. package/locales/kn.json +1387 -0
  496. package/locales/ko.json +1387 -0
  497. package/locales/mr.json +1387 -0
  498. package/locales/ms.json +1387 -0
  499. package/locales/nb.json +1387 -0
  500. package/locales/nl.json +1387 -0
  501. package/locales/pl.json +1387 -0
  502. package/locales/pt.json +1387 -0
  503. package/locales/ro.json +1387 -0
  504. package/locales/ru.json +1387 -0
  505. package/locales/sk.json +1387 -0
  506. package/locales/sr.json +1387 -0
  507. package/locales/sv.json +1387 -0
  508. package/locales/ta.json +1387 -0
  509. package/locales/th.json +1387 -0
  510. package/locales/tr.json +1387 -0
  511. package/locales/uk.json +1387 -0
  512. package/locales/ur.json +1388 -0
  513. package/locales/vi.json +1387 -0
  514. package/locales/yo.json +1387 -0
  515. package/locales/zh-Hans.json +1387 -0
  516. package/locales/zh-Hant.json +1387 -0
  517. package/package.json +138 -5
  518. package/store-catalog.schema.json +78 -0
  519. package/theme.schema.json +4668 -0
  520. package/windows/installer.nsi +946 -0
  521. package/windows/languages/Basque.nsh +28 -0
  522. package/windows/languages/Catalan.nsh +28 -0
  523. package/windows/languages/Croatian.nsh +28 -0
  524. package/windows/languages/Czech.nsh +28 -0
  525. package/windows/languages/Danish.nsh +28 -0
  526. package/windows/languages/Finnish.nsh +28 -0
  527. package/windows/languages/Galician.nsh +28 -0
  528. package/windows/languages/Greek.nsh +28 -0
  529. package/windows/languages/Hungarian.nsh +28 -0
  530. package/windows/languages/Indonesian.nsh +28 -0
  531. package/windows/languages/Irish.nsh +28 -0
  532. package/windows/languages/Malay.nsh +28 -0
  533. package/windows/languages/Polish.nsh +28 -0
  534. package/windows/languages/Romanian.nsh +28 -0
  535. package/windows/languages/Serbian.nsh +28 -0
  536. package/windows/languages/Slovak.nsh +28 -0
  537. package/windows/languages/Thai.nsh +28 -0
@@ -0,0 +1,267 @@
1
+ // The shell's view of theming: the global theme choice, account/pane themes (scopes), installed
2
+ // Google fonts and a theme editor's live preview. The app's settings, pane menus and the chrome
3
+ // share it (they all live in the shell webview). Native code persists everything and themes the
4
+ // site tabs; this module themes the app's own window with the same documents. What a theme
5
+ // document is belongs to the app (`ThemeAdapter`); `createThemeStore(adapter)` makes the store the
6
+ // app keeps and hands to the frame (`site.themes`).
7
+ import { setChromeIconPack } from "./iconPack.js";
8
+ import { BOOT_CACHE_KEY } from "./boot.js";
9
+ import { invoke } from "./bridge.js";
10
+ import { CHROME_VAR_NAMES, chromeEdges, chromeVars } from "./chromeTheme.js";
11
+ import { SCOPES_DEFAULT, normalizeScopes, prunePanes, themeIdFor } from "./themeScopes.js";
12
+ import { safe } from "./safeStore.js";
13
+ import { shell } from "./state.js";
14
+ const getError = (error) => error instanceof Error ? error.message : String(error);
15
+ export function createThemeStore(adapter) {
16
+ const state = { ready: false, choice: adapter.defaultChoice, scopes: SCOPES_DEFAULT, fonts: [], preview: null };
17
+ const listeners = new Set();
18
+ let snapshot = { ...state };
19
+ const emit = () => { snapshot = { ...state }; for (const listener of [...listeners])
20
+ listener(); applyChrome(); };
21
+ let loading = null;
22
+ /** Reads the persisted theme state once (every caller shares the same load). */
23
+ function loadThemes() {
24
+ loading ??= Promise.all([
25
+ adapter.load().catch(() => adapter.defaultChoice),
26
+ invoke('theme_scopes_get').then(normalizeScopes).catch(() => SCOPES_DEFAULT),
27
+ invoke('gfonts_installed').catch(() => []),
28
+ ]).then(([choice, scopes, fonts]) => {
29
+ Object.assign(state, { ready: true, choice, scopes, fonts: Array.isArray(fonts) ? fonts : [] });
30
+ committed = choice;
31
+ emit();
32
+ });
33
+ return loading;
34
+ }
35
+ /** The last choice native code acknowledged (an error reverts to it). */
36
+ let committed = null;
37
+ /** Shows `next` right away; `commit` persists it and themes every site tab (reverted on error). */
38
+ async function setChoice(next, commit = true) {
39
+ const previous = state.choice;
40
+ state.choice = next;
41
+ emit();
42
+ if (!commit)
43
+ return;
44
+ try {
45
+ await adapter.commit(next);
46
+ committed = next;
47
+ }
48
+ catch (error) {
49
+ state.choice = committed ?? previous;
50
+ emit();
51
+ throw new Error(getError(error));
52
+ }
53
+ }
54
+ async function setScopes(next) {
55
+ const previous = state.scopes;
56
+ state.scopes = normalizeScopes(next);
57
+ emit();
58
+ try {
59
+ await invoke('theme_scopes_set', { scopes: state.scopes });
60
+ }
61
+ catch (error) {
62
+ state.scopes = previous;
63
+ emit();
64
+ throw new Error(getError(error));
65
+ }
66
+ }
67
+ /** A theme editor's draft, shown in every site tab and the chrome until it is saved or closed. */
68
+ async function setPreview(theme) {
69
+ state.preview = theme;
70
+ emit();
71
+ try {
72
+ await adapter.preview(theme);
73
+ }
74
+ catch { /* Preview is best effort (browser preview). */ }
75
+ }
76
+ const themeState = () => state;
77
+ const allThemes = (choice = state.choice) => adapter.all(choice);
78
+ const knownTheme = (id, choice = state.choice) => allThemes(choice).some(theme => theme.id === id);
79
+ const themeName = (id) => allThemes().find(theme => theme.id === id)?.name ?? id;
80
+ /** The theme a tab (or pane) shows, as the chrome and the theme lists describe it. */
81
+ function tabTheme(tab) {
82
+ const found = themeIdFor(state.scopes, tab, adapter.preset(state.choice), id => knownTheme(id));
83
+ return { ...found, theme: adapter.resolve(adapter.choiceForId(state.choice, found.id)) };
84
+ }
85
+ // -------------------------------------------------------------------------------------------
86
+ // Google fonts in the shell (chrome, previews): registered from bytes like in the site's page.
87
+ const shellFonts = new Map();
88
+ function register(family, faces) {
89
+ for (const face of faces) {
90
+ const bytes = Uint8Array.from(atob(face.data), char => char.charCodeAt(0));
91
+ const [min, max] = face.weight;
92
+ const descriptors = { weight: min === max ? String(min) : `${min} ${max}`, style: 'normal', display: 'swap' };
93
+ if (face.unicodeRange)
94
+ descriptors.unicodeRange = face.unicodeRange;
95
+ const fontFace = new FontFace(family, bytes.buffer, descriptors);
96
+ document.fonts.add(fontFace);
97
+ void fontFace.load().catch(() => { });
98
+ }
99
+ }
100
+ /** Registers an installed Google font in the shell document once. */
101
+ function ensureShellFont(family) {
102
+ let pending = shellFonts.get(family);
103
+ if (!pending) {
104
+ pending = invoke('gfonts_faces', { family })
105
+ .then(result => { register(family, result.faces); return true; })
106
+ .catch(() => { shellFonts.delete(family); return false; });
107
+ shellFonts.set(family, pending);
108
+ }
109
+ return pending;
110
+ }
111
+ const previews = new Map();
112
+ let previewSeq = 0;
113
+ /**
114
+ * A text-subset preview of any Google font (a few KB, fetched natively): registers it under a
115
+ * private family name and resolves to that name, or null when it failed.
116
+ */
117
+ function previewFont(family, weights, text) {
118
+ const key = `${family}|${JSON.stringify(weights)}|${text}`;
119
+ let pending = previews.get(key);
120
+ if (!pending) {
121
+ const alias = `wbp-${++previewSeq}`;
122
+ const attempt = (tries) => invoke('gfonts_preview', { family, weights, text })
123
+ .then(faces => { register(alias, faces); return alias; })
124
+ .catch(error => {
125
+ // Six previews at most are in flight natively; the list retries shortly.
126
+ if (tries > 0 && /busy/i.test(getError(error)))
127
+ return new Promise(done => setTimeout(() => done(attempt(tries - 1)), 250 + Math.random() * 400));
128
+ previews.delete(key);
129
+ return null;
130
+ });
131
+ pending = attempt(12);
132
+ previews.set(key, pending);
133
+ }
134
+ return pending;
135
+ }
136
+ async function installFont(family, weights) {
137
+ const font = await invoke('gfonts_install', { family, weights });
138
+ state.fonts = [...state.fonts.filter(item => item.family !== family), font].sort((a, b) => a.family.localeCompare(b.family));
139
+ shellFonts.delete(family);
140
+ emit();
141
+ return font;
142
+ }
143
+ async function removeFont(family) {
144
+ await invoke('gfonts_remove', { family });
145
+ state.fonts = state.fonts.filter(item => item.family !== family);
146
+ emit();
147
+ }
148
+ const isInstalled = (family) => state.fonts.some(font => font.family === family);
149
+ /** Google families a theme needs that are not downloaded yet. */
150
+ const missingFonts = (theme) => adapter.googleFonts(theme).filter(family => !isInstalled(family));
151
+ // -------------------------------------------------------------------------------------------
152
+ // Chrome
153
+ function setVars(element, vars) {
154
+ for (const name of CHROME_VAR_NAMES)
155
+ if (!(name in vars))
156
+ element.style.removeProperty(name);
157
+ for (const [name, value] of Object.entries(vars))
158
+ element.style.setProperty(name, value);
159
+ }
160
+ /** The window's edge style (frame/edges.css). Global only: a pane theme brings its colors, fonts and radii, not its edges. */
161
+ function setEdges(edges) {
162
+ if (edges)
163
+ document.documentElement.dataset.wbEdges = edges;
164
+ else
165
+ delete document.documentElement.dataset.wbEdges;
166
+ }
167
+ function chromeFontsFor(theme) {
168
+ for (const family of adapter.googleFonts(theme, ['chrome', 'mono']))
169
+ if (isInstalled(family))
170
+ void ensureShellFont(family);
171
+ }
172
+ /** The chrome follows the global theme (or the editor's draft); panes with their own theme follow theirs. */
173
+ function applyChrome() {
174
+ if (typeof document === 'undefined')
175
+ return;
176
+ // Safe mode: the frame's own look, whatever the theme (a theme may be what broke the chrome). The
177
+ // first-frame cache is left alone, so the next normal start paints the owner's theme again.
178
+ if (safe.active) {
179
+ setVars(document.documentElement, {});
180
+ setEdges(null);
181
+ syncGroups();
182
+ return;
183
+ }
184
+ if (!state.ready)
185
+ return;
186
+ const own = state.scopes.chrome === 'own';
187
+ const global = state.preview ?? adapter.resolve(state.choice);
188
+ chromeFontsFor(global);
189
+ const vars = chromeVars(adapter.chrome(global), own);
190
+ setVars(document.documentElement, vars);
191
+ setEdges(chromeEdges(vars));
192
+ try {
193
+ setChromeIconPack(own ? null : adapter.iconPack?.(global, state.choice) ?? null);
194
+ }
195
+ catch {
196
+ setChromeIconPack(null);
197
+ }
198
+ // The next start paints these from its first frame (boot.ts); an editor's draft is not kept.
199
+ if (!state.preview) {
200
+ try {
201
+ localStorage.setItem(BOOT_CACHE_KEY, JSON.stringify(vars));
202
+ }
203
+ catch { /* Best effort. */ }
204
+ }
205
+ syncGroups();
206
+ }
207
+ let dock = null;
208
+ /** Pane chrome: a dock group whose active tab shows another theme than the global one gets that theme. */
209
+ function syncGroups() {
210
+ const api = dock ?? shell.api;
211
+ if (!api)
212
+ return;
213
+ const own = state.scopes.chrome === 'own';
214
+ for (const group of api.groups) {
215
+ const params = group.activePanel?.params;
216
+ const tab = params && (params.kind === 'web' || params.kind === 'start') ? { id: params.kind === 'web' ? group.activePanel.id : undefined, profile: params.profile ?? 'default' } : null;
217
+ const scoped = !own && !safe.active && !state.preview && tab ? tabTheme(tab) : null;
218
+ const element = group.element;
219
+ if (scoped && scoped.source !== 'global') {
220
+ chromeFontsFor(scoped.theme);
221
+ element.classList.add('wb-pane-theme');
222
+ const vars = chromeVars(adapter.chrome(scoped.theme));
223
+ setVars(element, vars);
224
+ element.dataset.wbTheme = scoped.id;
225
+ // A pane's edges are its own theme's (edges.css: `.dv-groupview.wb-bevel`).
226
+ element.classList.toggle('wb-bevel', chromeEdges(vars) === 'bevel');
227
+ }
228
+ else {
229
+ if (element.classList.contains('wb-pane-theme')) {
230
+ element.classList.remove('wb-pane-theme');
231
+ setVars(element, {});
232
+ delete element.dataset.wbTheme;
233
+ }
234
+ element.classList.toggle('wb-bevel', !own && !safe.active && document.documentElement.dataset.wbEdges === 'bevel');
235
+ }
236
+ }
237
+ }
238
+ // Safe mode switched: the chrome drops (or takes back) the theme at once.
239
+ if (typeof window !== 'undefined')
240
+ window.addEventListener('bt-safe', applyChrome);
241
+ /** Shell.tsx hands over the dock once it exists: pane chrome follows focus and layout changes. */
242
+ function attachDock(api) {
243
+ dock = api;
244
+ const sync = () => requestAnimationFrame(syncGroups);
245
+ api.onDidActivePanelChange(sync);
246
+ api.onDidLayoutChange(sync);
247
+ api.onDidAddPanel(sync);
248
+ api.onDidRemovePanel(() => {
249
+ sync();
250
+ // A closed pane's theme goes with it.
251
+ const open = api.panels.map(panel => panel.id);
252
+ const pruned = prunePanes(state.scopes, open);
253
+ if (pruned !== state.scopes && !shell.restoring)
254
+ void setScopes(pruned).catch(() => { });
255
+ });
256
+ window.addEventListener('bt-profiles', sync);
257
+ void loadThemes().then(sync);
258
+ }
259
+ /** For `useThemeState` (hooks.ts): subscribe, and the current snapshot. */
260
+ const subscribe = (listener) => { listeners.add(listener); return () => { listeners.delete(listener); }; };
261
+ const current = () => snapshot;
262
+ return {
263
+ adapter, loadThemes, setChoice, setScopes, setPreview, themeState, allThemes, knownTheme, themeName, tabTheme,
264
+ ensureShellFont, previewFont, installFont, removeFont, isInstalled, missingFonts, attachDock, subscribe, current,
265
+ };
266
+ }
267
+ //# sourceMappingURL=themeStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeStore.js","sourceRoot":"","sources":["../../../../../../shell/src/frame/themeSt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C,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvH,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC;IAE/B,OAAO;QACL,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ;QAC7G,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO;KACjH,CAAC;AACJ,CAAC","sourcesContent":["// The shell's view of theming: the global theme choice, account/pane themes (scopes), installed\n// Google fonts and a theme editor's live preview. The app's settings, pane menus and the chrome\n// share it (they all live in the shell webview). Native code persists everything and themes the\n// site tabs; this module themes the app's own window with the same documents. What a theme\n// document is belongs to the app (`ThemeAdapter`); `createThemeStore(adapter)` makes the store the\n// app keeps and hands to the frame (`site.themes`).\n\nimport type { IconPack } from '../../../runtime/src/themeIcons.ts';\nimport { setChromeIconPack } from './iconPack.tsx';\nimport type { DockviewApi } from 'dockview';\nimport { BOOT_CACHE_KEY } from './boot.ts';\nimport { invoke } from './bridge.ts';\nimport { CHROME_VAR_NAMES, chromeEdges, chromeVars, type ChromeTheme } from './chromeTheme.ts';\nimport { SCOPES_DEFAULT, normalizeScopes, prunePanes, themeIdFor, type ScopeSource, type ThemeScopes } from './themeScopes.ts';\nimport { safe } from './safeStore.ts';\nimport { shell, type TabParams } from './state.ts';\n\nexport type Weights = { kind: 'range'; min: number; max: number } | { kind: 'list'; values: number[] };\nexport type InstalledFont = { family: string; weights: Weights; bytes: number; faces: number; installedAt: string };\ntype FaceData = { weight: [number, number]; unicodeRange: string | null; data: string };\n\n/** A theme document as the frame needs it: an id and a name (the rest is the app's). */\nexport type ThemeDoc = { id: string; name: string };\n\n/** What the app's themes are and how native code stores them. */\nexport type ThemeAdapter<Choice = unknown, Spec extends ThemeDoc = ThemeDoc> = {\n /** The choice before anything is read (and when reading fails). */\n defaultChoice: Choice;\n /** Reads the persisted global choice (normalized). */\n load(): Promise<Choice>;\n /** Persists `choice` and themes every site tab (throws native code's error). */\n commit(choice: Choice): Promise<void>;\n /** Shows `spec` (a draft) in every site tab until it is saved or closed; null ends it. */\n preview(spec: Spec | null): Promise<void>;\n /** The theme document a choice shows (its customizations applied). */\n resolve(choice: Choice): Spec;\n /** The chosen theme's id. */\n preset(choice: Choice): string;\n /** The choice a theme id stands for: the global choice itself, or that theme without customizations. */\n choiceForId(choice: Choice, id: string): Choice;\n /** Every theme that can be picked: built-in ones and the choice's imported ones. */\n all(choice: Choice): Spec[];\n /** Google font families a theme uses (in `roles` only, when given). */\n googleFonts(spec: Spec, roles?: readonly string[]): string[];\n /** The chrome's colors and fonts for a theme. */\n chrome(spec: Spec): ChromeTheme;\n /** The icon pack a theme suggests for the chrome (theme engine v2); absent: the frame's own glyphs. */\n iconPack?(spec: Spec, choice?: Choice): IconPack | null;\n /** Three swatch colors for menus (page, text, accent, on the theme's surface and border). */\n dots(spec: Spec): { page: string; bg: string; border: string; text: string; accent: string };\n};\n\nexport type ThemeState<Choice, Spec> = { ready: boolean; choice: Choice; scopes: ThemeScopes; fonts: InstalledFont[]; preview: Spec | null };\n\nconst getError = (error: unknown) => error instanceof Error ? error.message : String(error);\n\nexport type ThemeStore<Choice = unknown, Spec extends ThemeDoc = ThemeDoc> = ReturnType<typeof createThemeStore<Choice, Spec>>;\n\nexport function createThemeStore<Choice, Spec extends ThemeDoc>(adapter: ThemeAdapter<Choice, Spec>) {\n const state: ThemeState<Choice, Spec> = { ready: false, choice: adapter.defaultChoice, scopes: SCOPES_DEFAULT, fonts: [], preview: null };\n const listeners = new Set<() => void>();\n let snapshot = { ...state };\n const emit = () => { snapshot = { ...state }; for (const listener of [...listeners]) listener(); applyChrome(); };\n\n let loading: Promise<void> | null = null;\n /** Reads the persisted theme state once (every caller shares the same load). */\n function loadThemes(): Promise<void> {\n loading ??= Promise.all([\n adapter.load().catch(() => adapter.defaultChoice),\n invoke<unknown>('theme_scopes_get').then(normalizeScopes).catch(() => SCOPES_DEFAULT),\n invoke<InstalledFont[]>('gfonts_installed').catch(() => [] as InstalledFont[]),\n ]).then(([choice, scopes, fonts]) => {\n Object.assign(state, { ready: true, choice, scopes, fonts: Array.isArray(fonts) ? fonts : [] });\n committed = choice;\n emit();\n });\n return loading;\n }\n\n /** The last choice native code acknowledged (an error reverts to it). */\n let committed: Choice | null = null;\n /** Shows `next` right away; `commit` persists it and themes every site tab (reverted on error). */\n async function setChoice(next: Choice, commit = true): Promise<void> {\n const previous = state.choice;\n state.choice = next;\n emit();\n if (!commit) return;\n try { await adapter.commit(next); committed = next; }\n catch (error) { state.choice = committed ?? previous; emit(); throw new Error(getError(error)); }\n }\n async function setScopes(next: ThemeScopes): Promise<void> {\n const previous = state.scopes;\n state.scopes = normalizeScopes(next);\n emit();\n try { await invoke('theme_scopes_set', { scopes: state.scopes }); }\n catch (error) { state.scopes = previous; emit(); throw new Error(getError(error)); }\n }\n\n /** A theme editor's draft, shown in every site tab and the chrome until it is saved or closed. */\n async function setPreview(theme: Spec | null): Promise<void> {\n state.preview = theme;\n emit();\n try { await adapter.preview(theme); } catch { /* Preview is best effort (browser preview). */ }\n }\n\n const themeState = () => state;\n const allThemes = (choice: Choice = state.choice) => adapter.all(choice);\n const knownTheme = (id: string, choice: Choice = state.choice) => allThemes(choice).some(theme => theme.id === id);\n const themeName = (id: string) => allThemes().find(theme => theme.id === id)?.name ?? id;\n\n /** The theme a tab (or pane) shows, as the chrome and the theme lists describe it. */\n function tabTheme(tab: { id?: string; profile?: string }): { id: string; source: ScopeSource; theme: Spec } {\n const found = themeIdFor(state.scopes, tab, adapter.preset(state.choice), id => knownTheme(id));\n return { ...found, theme: adapter.resolve(adapter.choiceForId(state.choice, found.id)) };\n }\n\n // -------------------------------------------------------------------------------------------\n // Google fonts in the shell (chrome, previews): registered from bytes like in the site's page.\n\n const shellFonts = new Map<string, Promise<boolean>>();\n function register(family: string, faces: FaceData[]) {\n for (const face of faces) {\n const bytes = Uint8Array.from(atob(face.data), char => char.charCodeAt(0));\n const [min, max] = face.weight;\n const descriptors: FontFaceDescriptors = { weight: min === max ? String(min) : `${min} ${max}`, style: 'normal', display: 'swap' };\n if (face.unicodeRange) descriptors.unicodeRange = face.unicodeRange;\n const fontFace = new FontFace(family, bytes.buffer, descriptors);\n document.fonts.add(fontFace);\n void fontFace.load().catch(() => {});\n }\n }\n /** Registers an installed Google font in the shell document once. */\n function ensureShellFont(family: string): Promise<boolean> {\n let pending = shellFonts.get(family);\n if (!pending) {\n pending = invoke<{ faces: FaceData[] }>('gfonts_faces', { family })\n .then(result => { register(family, result.faces); return true; })\n .catch(() => { shellFonts.delete(family); return false; });\n shellFonts.set(family, pending);\n }\n return pending;\n }\n\n const previews = new Map<string, Promise<string | null>>();\n let previewSeq = 0;\n /**\n * A text-subset preview of any Google font (a few KB, fetched natively): registers it under a\n * private family name and resolves to that name, or null when it failed.\n */\n function previewFont(family: string, weights: Weights, text: string): Promise<string | null> {\n const key = `${family}|${JSON.stringify(weights)}|${text}`;\n let pending = previews.get(key);\n if (!pending) {\n const alias = `wbp-${++previewSeq}`;\n const attempt = (tries: number): Promise<string | null> => invoke<FaceData[]>('gfonts_preview', { family, weights, text })\n .then(faces => { register(alias, faces); return alias; })\n .catch(error => {\n // Six previews at most are in flight natively; the list retries shortly.\n if (tries > 0 && /busy/i.test(getError(error))) return new Promise<string | null>(done => setTimeout(() => done(attempt(tries - 1)), 250 + Math.random() * 400));\n previews.delete(key);\n return null;\n });\n pending = attempt(12);\n previews.set(key, pending);\n }\n return pending;\n }\n\n async function installFont(family: string, weights: Weights): Promise<InstalledFont> {\n const font = await invoke<InstalledFont>('gfonts_install', { family, weights });\n state.fonts = [...state.fonts.filter(item => item.family !== family), font].sort((a, b) => a.family.localeCompare(b.family));\n shellFonts.delete(family);\n emit();\n return font;\n }\n\n async function removeFont(family: string): Promise<void> {\n await invoke('gfonts_remove', { family });\n state.fonts = state.fonts.filter(item => item.family !== family);\n emit();\n }\n\n const isInstalled = (family: string) => state.fonts.some(font => font.family === family);\n /** Google families a theme needs that are not downloaded yet. */\n const missingFonts = (theme: Spec) => adapter.googleFonts(theme).filter(family => !isInstalled(family));\n\n // -------------------------------------------------------------------------------------------\n // Chrome\n\n function setVars(element: HTMLElement, vars: Record<string, string>) {\n for (const name of CHROME_VAR_NAMES) if (!(name in vars)) element.style.removeProperty(name);\n for (const [name, value] of Object.entries(vars)) element.style.setProperty(name, value);\n }\n\n /** The window's edge style (frame/edges.css). Global only: a pane theme brings its colors, fonts and radii, not its edges. */\n function setEdges(edges: string | null) {\n if (edges) document.documentElement.dataset.wbEdges = edges;\n else delete document.documentElement.dataset.wbEdges;\n }\n\n function chromeFontsFor(theme: Spec) {\n for (const family of adapter.googleFonts(theme, ['chrome', 'mono'])) if (isInstalled(family)) void ensureShellFont(family);\n }\n\n /** The chrome follows the global theme (or the editor's draft); panes with their own theme follow theirs. */\n function applyChrome() {\n if (typeof document === 'undefined') return;\n // Safe mode: the frame's own look, whatever the theme (a theme may be what broke the chrome). The\n // first-frame cache is left alone, so the next normal start paints the owner's theme again.\n if (safe.active) { setVars(document.documentElement, {}); setEdges(null); syncGroups(); return; }\n if (!state.ready) return;\n const own = state.scopes.chrome === 'own';\n const global = state.preview ?? adapter.resolve(state.choice);\n chromeFontsFor(global);\n const vars = chromeVars(adapter.chrome(global), own);\n setVars(document.documentElement, vars);\n setEdges(chromeEdges(vars));\n try { setChromeIconPack(own ? null : adapter.iconPack?.(global, state.choice) ?? null); } catch { setChromeIconPack(null); }\n // The next start paints these from its first frame (boot.ts); an editor's draft is not kept.\n if (!state.preview) { try { localStorage.setItem(BOOT_CACHE_KEY, JSON.stringify(vars)); } catch { /* Best effort. */ } }\n syncGroups();\n }\n\n let dock: DockviewApi | null = null;\n /** Pane chrome: a dock group whose active tab shows another theme than the global one gets that theme. */\n function syncGroups() {\n const api = dock ?? shell.api;\n if (!api) return;\n const own = state.scopes.chrome === 'own';\n for (const group of api.groups) {\n const params = group.activePanel?.params as TabParams | undefined;\n const tab = params && (params.kind === 'web' || params.kind === 'start') ? { id: params.kind === 'web' ? group.activePanel!.id : undefined, profile: params.profile ?? 'default' } : null;\n const scoped = !own && !safe.active && !state.preview && tab ? tabTheme(tab) : null;\n const element = group.element;\n if (scoped && scoped.source !== 'global') {\n chromeFontsFor(scoped.theme);\n element.classList.add('wb-pane-theme');\n const vars = chromeVars(adapter.chrome(scoped.theme));\n setVars(element, vars);\n element.dataset.wbTheme = scoped.id;\n // A pane's edges are its own theme's (edges.css: `.dv-groupview.wb-bevel`).\n element.classList.toggle('wb-bevel', chromeEdges(vars) === 'bevel');\n } else {\n if (element.classList.contains('wb-pane-theme')) {\n element.classList.remove('wb-pane-theme');\n setVars(element, {});\n delete element.dataset.wbTheme;\n }\n element.classList.toggle('wb-bevel', !own && !safe.active && document.documentElement.dataset.wbEdges === 'bevel');\n }\n }\n }\n\n // Safe mode switched: the chrome drops (or takes back) the theme at once.\n if (typeof window !== 'undefined') window.addEventListener('bt-safe', applyChrome);\n\n /** Shell.tsx hands over the dock once it exists: pane chrome follows focus and layout changes. */\n function attachDock(api: DockviewApi) {\n dock = api;\n const sync = () => requestAnimationFrame(syncGroups);\n api.onDidActivePanelChange(sync);\n api.onDidLayoutChange(sync);\n api.onDidAddPanel(sync);\n api.onDidRemovePanel(() => {\n sync();\n // A closed pane's theme goes with it.\n const open = api.panels.map(panel => panel.id);\n const pruned = prunePanes(state.scopes, open);\n if (pruned !== state.scopes && !shell.restoring) void setScopes(pruned).catch(() => {});\n });\n window.addEventListener('bt-profiles', sync);\n void loadThemes().then(sync);\n }\n\n /** For `useThemeState` (hooks.ts): subscribe, and the current snapshot. */\n const subscribe = (listener: () => void) => { listeners.add(listener); return () => { listeners.delete(listener); }; };\n const current = () => snapshot;\n\n return {\n adapter, loadThemes, setChoice, setScopes, setPreview, themeState, allThemes, knownTheme, themeName, tabTheme,\n ensureShellFont, previewFont, installFont, removeFont, isInstalled, missingFonts, attachDock, subscribe, current,\n };\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export { frameless, isTauri, os, type ResizeDirection } from '../windowControls.ts';
2
+ export declare const minimize: () => Promise<void>, toggleMaximize: () => Promise<void>, close: () => Promise<void>, startResize: (direction: import("./windowBinding.ts").ResizeDirection) => Promise<void>, startDrag: () => void, onMaximizedChange: (cb: (maximized: boolean) => void) => Promise<() => void>, systemMenu: (x: number, y: number) => Promise<unknown>;
@@ -0,0 +1,7 @@
1
+ // The frame's window controls (custom titlebar, grips, caption buttons), bound to the app's Tauri
2
+ // API as handed to createShell.
3
+ import { createWindowControls } from "../windowControls.js";
4
+ import { currentWindow, invoke } from "./bridge.js";
5
+ export { frameless, isTauri, os } from "../windowControls.js";
6
+ export const { minimize, toggleMaximize, close, startResize, startDrag, onMaximizedChange, systemMenu } = createWindowControls((command, args) => invoke(command, args), currentWindow);
7
+ //# sourceMappingURL=windowBinding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"windowBinding.js","sourceRoot":"","sources":["../../../../../../shell/src/frame/windowBinding.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,gCAAgC;AAEhC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAwB,MAAM,sBAAsB,CAAC;AAEpF,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAE,GACrG,oBAAoB,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,aAAa,CAAC,CAAC","sourcesContent":["// The frame's window controls (custom titlebar, grips, caption buttons), bound to the app's Tauri\n// API as handed to createShell.\n\nimport { createWindowControls } from '../windowControls.ts';\nimport { currentWindow, invoke } from './bridge.ts';\n\nexport { frameless, isTauri, os, type ResizeDirection } from '../windowControls.ts';\n\nexport const { minimize, toggleMaximize, close, startResize, startDrag, onMaximizedChange, systemMenu } =\n createWindowControls((command, args) => invoke(command, args), currentWindow);\n"]}
@@ -0,0 +1,82 @@
1
+ export declare const WORKSPACE_LIMITS: Readonly<{
2
+ /** Saved workspaces. */
3
+ count: 20;
4
+ name: 60;
5
+ /** Tabs in one workspace. */
6
+ tabs: 64;
7
+ /** Serialized size of one workspace (JSON characters). */
8
+ bytes: number;
9
+ url: 4096;
10
+ title: 300;
11
+ }>;
12
+ export type WorkspaceTab = {
13
+ kind: 'web' | 'panel' | 'start' | 'deck';
14
+ url?: string;
15
+ profile?: string;
16
+ title?: string;
17
+ };
18
+ export type Workspace = {
19
+ id: string;
20
+ name: string;
21
+ savedAt: string;
22
+ /** dockview's `SerializedDockview`, reduced (see `captureWorkspace`). */
23
+ layout: SerializedLayout;
24
+ /** Pane themes of this workspace's tabs: tab id (in `layout`) → theme id. */
25
+ paneThemes: Record<string, string>;
26
+ /** Decks the workspace shows (Power User Mode), so a deck deleted since can come back. */
27
+ decks?: unknown[];
28
+ };
29
+ export type WorkspaceStore = {
30
+ version: 1;
31
+ default: string | null;
32
+ items: Workspace[];
33
+ };
34
+ export declare const EMPTY_WORKSPACES: WorkspaceStore;
35
+ type Json = Record<string, unknown>;
36
+ export type SerializedLayout = {
37
+ grid: Json;
38
+ panels: Record<string, Json>;
39
+ activeGroup?: string;
40
+ floatingGroups?: unknown[];
41
+ popoutGroups?: unknown[];
42
+ };
43
+ export declare function httpUrl(value: unknown): string | null;
44
+ export declare function cleanName(value: unknown): string;
45
+ /** A slug for a new workspace id, unique among `taken`. */
46
+ export declare function workspaceId(name: string, taken: Iterable<string>): string;
47
+ export type CaptureInput = {
48
+ id: string;
49
+ name: string;
50
+ layout: unknown;
51
+ /** The pane theme map (`ThemeScopes.panes`); only this layout's tabs are kept. */
52
+ paneThemes?: Record<string, string>;
53
+ decks?: Array<{
54
+ id: string;
55
+ }>;
56
+ now?: Date;
57
+ };
58
+ /** Makes a workspace from the live dockview layout. Throws when there is nothing to keep or it is too large. */
59
+ export declare function captureWorkspace(input: CaptureInput): Workspace;
60
+ /** Tabs of a workspace in layout order (for menus: "3 tabs · x.com/home, …"). */
61
+ export declare function workspaceTabs(workspace: Workspace): WorkspaceTab[];
62
+ export type RestorePlan = {
63
+ layout: SerializedLayout;
64
+ /** Pane themes for the restored tab ids. */
65
+ paneThemes: Record<string, string>;
66
+ /** Tab id in the workspace → id it gets now. */
67
+ ids: Record<string, string>;
68
+ };
69
+ /**
70
+ * The layout to hand dockview's `fromJSON`: web and new-tab pages get fresh ids from `newId`
71
+ * (a live tab never keeps its webview across a switch), deck and wayBetter tabs keep theirs.
72
+ * `profileKnown` drops accounts that no longer exist (the tab opens in the default account).
73
+ */
74
+ export declare function planRestore(workspace: Workspace, newId: () => string, profileKnown?: (id: string) => boolean): RestorePlan;
75
+ /** Parses what native code returned; anything malformed is dropped, never thrown. */
76
+ export declare function normalizeWorkspaces(value: unknown): WorkspaceStore;
77
+ /** Adds or replaces (same id) a workspace; the list stays bounded. */
78
+ export declare function upsertWorkspace(store: WorkspaceStore, workspace: Workspace): WorkspaceStore;
79
+ export declare function removeWorkspace(store: WorkspaceStore, id: string): WorkspaceStore;
80
+ export declare function renameWorkspace(store: WorkspaceStore, id: string, name: string): WorkspaceStore;
81
+ export declare function setDefaultWorkspace(store: WorkspaceStore, id: string | null): WorkspaceStore;
82
+ export {};