waybetter 0.1.1 → 0.6.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 (515) hide show
  1. package/README.md +140 -6
  2. package/bin/waybetter.mjs +46 -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/privacy.mjs +768 -0
  9. package/cli/release.mjs +444 -0
  10. package/cli/remote.mjs +260 -0
  11. package/cli/store.mjs +326 -0
  12. package/cli/strings.mjs +121 -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 +59 -0
  74. package/dist/runtime/stringPackTranslate.js +264 -0
  75. package/dist/runtime/stringPackTranslate.js.map +1 -0
  76. package/dist/runtime/stringPacks.d.ts +200 -0
  77. package/dist/runtime/stringPacks.js +474 -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/themeChoice.d.ts +52 -0
  89. package/dist/runtime/themeChoice.js +69 -0
  90. package/dist/runtime/themeChoice.js.map +1 -0
  91. package/dist/runtime/themeComponents.d.ts +435 -0
  92. package/dist/runtime/themeComponents.js +463 -0
  93. package/dist/runtime/themeComponents.js.map +1 -0
  94. package/dist/runtime/themeDecor.d.ts +73 -0
  95. package/dist/runtime/themeDecor.js +131 -0
  96. package/dist/runtime/themeDecor.js.map +1 -0
  97. package/dist/runtime/themeDoctor.d.ts +11 -0
  98. package/dist/runtime/themeDoctor.js +51 -0
  99. package/dist/runtime/themeDoctor.js.map +1 -0
  100. package/dist/runtime/themeIcons.d.ts +130 -0
  101. package/dist/runtime/themeIcons.js +263 -0
  102. package/dist/runtime/themeIcons.js.map +1 -0
  103. package/dist/runtime/themeRuntime.d.ts +100 -0
  104. package/dist/runtime/themeRuntime.js +497 -0
  105. package/dist/runtime/themeRuntime.js.map +1 -0
  106. package/dist/runtime/themeSchema.d.ts +10 -0
  107. package/dist/runtime/themeSchema.js +150 -0
  108. package/dist/runtime/themeSchema.js.map +1 -0
  109. package/dist/runtime/themeSpec.d.ts +259 -0
  110. package/dist/runtime/themeSpec.js +439 -0
  111. package/dist/runtime/themeSpec.js.map +1 -0
  112. package/dist/runtime/themeTokens.d.ts +12 -0
  113. package/dist/runtime/themeTokens.js +14 -6
  114. package/dist/runtime/themeTokens.js.map +1 -1
  115. package/dist/runtime/themeVariants.d.ts +30 -0
  116. package/dist/runtime/themeVariants.js +53 -0
  117. package/dist/runtime/themeVariants.js.map +1 -0
  118. package/dist/runtime/ui.d.ts +192 -0
  119. package/dist/runtime/ui.js +926 -0
  120. package/dist/runtime/ui.js.map +1 -0
  121. package/dist/shell/InstallDialog.d.ts +40 -0
  122. package/dist/shell/InstallDialog.js +170 -0
  123. package/dist/shell/InstallDialog.js.map +1 -0
  124. package/dist/shell/StoreView.d.ts +66 -0
  125. package/dist/shell/StoreView.js +103 -0
  126. package/dist/shell/StoreView.js.map +1 -0
  127. package/dist/shell/addressModel.js.map +1 -1
  128. package/dist/shell/chrome.js.map +1 -1
  129. package/dist/shell/deckModel.d.ts +117 -0
  130. package/dist/shell/deckModel.js +267 -0
  131. package/dist/shell/deckModel.js.map +1 -0
  132. package/dist/shell/frame/AccountSwitcher.d.ts +42 -0
  133. package/dist/shell/frame/AccountSwitcher.js +243 -0
  134. package/dist/shell/frame/AccountSwitcher.js.map +1 -0
  135. package/dist/shell/frame/AddColumnDialog.d.ts +8 -0
  136. package/dist/shell/frame/AddColumnDialog.js +81 -0
  137. package/dist/shell/frame/AddColumnDialog.js.map +1 -0
  138. package/dist/shell/frame/AppMenu.d.ts +21 -0
  139. package/dist/shell/frame/AppMenu.js +642 -0
  140. package/dist/shell/frame/AppMenu.js.map +1 -0
  141. package/dist/shell/frame/CommandPalette.d.ts +7 -0
  142. package/dist/shell/frame/CommandPalette.js +118 -0
  143. package/dist/shell/frame/CommandPalette.js.map +1 -0
  144. package/dist/shell/frame/DeckView.d.ts +13 -0
  145. package/dist/shell/frame/DeckView.js +287 -0
  146. package/dist/shell/frame/DeckView.js.map +1 -0
  147. package/dist/shell/frame/FindBar.d.ts +10 -0
  148. package/dist/shell/frame/FindBar.js +108 -0
  149. package/dist/shell/frame/FindBar.js.map +1 -0
  150. package/dist/shell/frame/MediaPanel.d.ts +8 -0
  151. package/dist/shell/frame/MediaPanel.js +76 -0
  152. package/dist/shell/frame/MediaPanel.js.map +1 -0
  153. package/dist/shell/frame/NewTabPage.d.ts +9 -0
  154. package/dist/shell/frame/NewTabPage.js +71 -0
  155. package/dist/shell/frame/NewTabPage.js.map +1 -0
  156. package/dist/shell/frame/PaneTheme.d.ts +16 -0
  157. package/dist/shell/frame/PaneTheme.js +67 -0
  158. package/dist/shell/frame/PaneTheme.js.map +1 -0
  159. package/dist/shell/frame/ReportDialog.d.ts +3 -0
  160. package/dist/shell/frame/ReportDialog.js +95 -0
  161. package/dist/shell/frame/ReportDialog.js.map +1 -0
  162. package/dist/shell/frame/Shell.d.ts +8 -0
  163. package/dist/shell/frame/Shell.js +1131 -0
  164. package/dist/shell/frame/Shell.js.map +1 -0
  165. package/dist/shell/frame/Titlebar.d.ts +16 -0
  166. package/dist/shell/frame/Titlebar.js +77 -0
  167. package/dist/shell/frame/Titlebar.js.map +1 -0
  168. package/dist/shell/frame/TitlebarExtras.d.ts +4 -0
  169. package/dist/shell/frame/TitlebarExtras.js +202 -0
  170. package/dist/shell/frame/TitlebarExtras.js.map +1 -0
  171. package/dist/shell/frame/WebPanel.d.ts +4 -0
  172. package/dist/shell/frame/WebPanel.js +182 -0
  173. package/dist/shell/frame/WebPanel.js.map +1 -0
  174. package/dist/shell/frame/accountModel.d.ts +49 -0
  175. package/dist/shell/frame/accountModel.js +67 -0
  176. package/dist/shell/frame/accountModel.js.map +1 -0
  177. package/dist/shell/frame/accountSwitcher.css +91 -0
  178. package/dist/shell/frame/appI18n.d.ts +44 -0
  179. package/dist/shell/frame/appI18n.js +64 -0
  180. package/dist/shell/frame/appI18n.js.map +1 -0
  181. package/dist/shell/frame/appMenu.css +121 -0
  182. package/dist/shell/frame/backupModel.d.ts +38 -0
  183. package/dist/shell/frame/backupModel.js +192 -0
  184. package/dist/shell/frame/backupModel.js.map +1 -0
  185. package/dist/shell/frame/boot.d.ts +8 -0
  186. package/dist/shell/frame/boot.js +35 -0
  187. package/dist/shell/frame/boot.js.map +1 -0
  188. package/dist/shell/frame/brand.d.ts +1 -0
  189. package/dist/shell/frame/brand.js +4 -0
  190. package/dist/shell/frame/brand.js.map +1 -0
  191. package/dist/shell/frame/bridge.d.ts +35 -0
  192. package/dist/shell/frame/bridge.js +70 -0
  193. package/dist/shell/frame/bridge.js.map +1 -0
  194. package/dist/shell/frame/chromeTheme.d.ts +29 -0
  195. package/dist/shell/frame/chromeTheme.js +81 -0
  196. package/dist/shell/frame/chromeTheme.js.map +1 -0
  197. package/dist/shell/frame/deck.css +209 -0
  198. package/dist/shell/frame/deckStore.d.ts +89 -0
  199. package/dist/shell/frame/deckStore.js +239 -0
  200. package/dist/shell/frame/deckStore.js.map +1 -0
  201. package/dist/shell/frame/devHost.d.ts +35 -0
  202. package/dist/shell/frame/devHost.js +80 -0
  203. package/dist/shell/frame/devHost.js.map +1 -0
  204. package/dist/shell/frame/devModel.d.ts +7 -0
  205. package/dist/shell/frame/devModel.js +17 -0
  206. package/dist/shell/frame/devModel.js.map +1 -0
  207. package/dist/shell/frame/diag.d.ts +7 -0
  208. package/dist/shell/frame/diag.js +39 -0
  209. package/dist/shell/frame/diag.js.map +1 -0
  210. package/dist/shell/frame/findBar.css +14 -0
  211. package/dist/shell/frame/frameMessages.d.ts +248 -0
  212. package/dist/shell/frame/frameMessages.js +252 -0
  213. package/dist/shell/frame/frameMessages.js.map +1 -0
  214. package/dist/shell/frame/hooks.d.ts +39 -0
  215. package/dist/shell/frame/hooks.js +97 -0
  216. package/dist/shell/frame/hooks.js.map +1 -0
  217. package/dist/shell/frame/i18n.d.ts +27 -0
  218. package/dist/shell/frame/i18n.js +66 -0
  219. package/dist/shell/frame/i18n.js.map +1 -0
  220. package/dist/shell/frame/iconPack.d.ts +11 -0
  221. package/dist/shell/frame/iconPack.js +45 -0
  222. package/dist/shell/frame/iconPack.js.map +1 -0
  223. package/dist/shell/frame/icons.d.ts +71 -0
  224. package/dist/shell/frame/icons.js +75 -0
  225. package/dist/shell/frame/icons.js.map +1 -0
  226. package/dist/shell/frame/index.d.ts +34 -0
  227. package/dist/shell/frame/index.js +43 -0
  228. package/dist/shell/frame/index.js.map +1 -0
  229. package/dist/shell/frame/language.d.ts +58 -0
  230. package/dist/shell/frame/language.js +165 -0
  231. package/dist/shell/frame/language.js.map +1 -0
  232. package/dist/shell/frame/mediaModel.d.ts +34 -0
  233. package/dist/shell/frame/mediaModel.js +53 -0
  234. package/dist/shell/frame/mediaModel.js.map +1 -0
  235. package/dist/shell/frame/menuMessages.en.json +54 -0
  236. package/dist/shell/frame/menuModel.d.ts +277 -0
  237. package/dist/shell/frame/menuModel.js +293 -0
  238. package/dist/shell/frame/menuModel.js.map +1 -0
  239. package/dist/shell/frame/paletteModel.d.ts +139 -0
  240. package/dist/shell/frame/paletteModel.js +112 -0
  241. package/dist/shell/frame/paletteModel.js.map +1 -0
  242. package/dist/shell/frame/paneTheme.css +9 -0
  243. package/dist/shell/frame/pluginCommandStore.d.ts +23 -0
  244. package/dist/shell/frame/pluginCommandStore.js +70 -0
  245. package/dist/shell/frame/pluginCommandStore.js.map +1 -0
  246. package/dist/shell/frame/reportModel.d.ts +52 -0
  247. package/dist/shell/frame/reportModel.js +105 -0
  248. package/dist/shell/frame/reportModel.js.map +1 -0
  249. package/dist/shell/frame/safeStore.d.ts +7 -0
  250. package/dist/shell/frame/safeStore.js +40 -0
  251. package/dist/shell/frame/safeStore.js.map +1 -0
  252. package/dist/shell/frame/searchInput.d.ts +2 -0
  253. package/dist/shell/frame/searchInput.js +11 -0
  254. package/dist/shell/frame/searchInput.js.map +1 -0
  255. package/dist/shell/frame/shell.css +629 -0
  256. package/dist/shell/frame/site.d.ts +206 -0
  257. package/dist/shell/frame/site.js +22 -0
  258. package/dist/shell/frame/site.js.map +1 -0
  259. package/dist/shell/frame/state.d.ts +99 -0
  260. package/dist/shell/frame/state.js +284 -0
  261. package/dist/shell/frame/state.js.map +1 -0
  262. package/dist/shell/frame/syncGate.d.ts +10 -0
  263. package/dist/shell/frame/syncGate.js +36 -0
  264. package/dist/shell/frame/syncGate.js.map +1 -0
  265. package/dist/shell/frame/syncHost.d.ts +35 -0
  266. package/dist/shell/frame/syncHost.js +85 -0
  267. package/dist/shell/frame/syncHost.js.map +1 -0
  268. package/dist/shell/frame/tabStill.d.ts +2 -0
  269. package/dist/shell/frame/tabStill.js +62 -0
  270. package/dist/shell/frame/tabStill.js.map +1 -0
  271. package/dist/shell/frame/themeScopes.d.ts +29 -0
  272. package/dist/shell/frame/themeScopes.js +61 -0
  273. package/dist/shell/frame/themeScopes.js.map +1 -0
  274. package/dist/shell/frame/themeStore.d.ts +99 -0
  275. package/dist/shell/frame/themeStore.js +252 -0
  276. package/dist/shell/frame/themeStore.js.map +1 -0
  277. package/dist/shell/frame/windowBinding.d.ts +2 -0
  278. package/dist/shell/frame/windowBinding.js +7 -0
  279. package/dist/shell/frame/windowBinding.js.map +1 -0
  280. package/dist/shell/frame/workspaceModel.d.ts +82 -0
  281. package/dist/shell/frame/workspaceModel.js +250 -0
  282. package/dist/shell/frame/workspaceModel.js.map +1 -0
  283. package/dist/shell/frame/workspaces.css +84 -0
  284. package/dist/shell/frame/workspaces.d.ts +22 -0
  285. package/dist/shell/frame/workspaces.js +125 -0
  286. package/dist/shell/frame/workspaces.js.map +1 -0
  287. package/dist/shell/frame/zoomStore.d.ts +10 -0
  288. package/dist/shell/frame/zoomStore.js +65 -0
  289. package/dist/shell/frame/zoomStore.js.map +1 -0
  290. package/dist/shell/installController.d.ts +122 -0
  291. package/dist/shell/installController.js +146 -0
  292. package/dist/shell/installController.js.map +1 -0
  293. package/dist/shell/installerMessages.d.ts +30 -0
  294. package/dist/shell/installerMessages.js +36 -0
  295. package/dist/shell/installerMessages.js.map +1 -0
  296. package/dist/shell/linkDrop.js.map +1 -1
  297. package/dist/shell/messages.d.ts +16 -0
  298. package/dist/shell/messages.js +27 -0
  299. package/dist/shell/messages.js.map +1 -0
  300. package/dist/shell/palette.js.map +1 -1
  301. package/dist/shell/paneModel.d.ts +22 -0
  302. package/dist/shell/paneModel.js +24 -1
  303. package/dist/shell/paneModel.js.map +1 -1
  304. package/dist/shell/panel/Appearance.d.ts +8 -0
  305. package/dist/shell/panel/Appearance.js +256 -0
  306. package/dist/shell/panel/Appearance.js.map +1 -0
  307. package/dist/shell/panel/BackupPanel.d.ts +5 -0
  308. package/dist/shell/panel/BackupPanel.js +198 -0
  309. package/dist/shell/panel/BackupPanel.js.map +1 -0
  310. package/dist/shell/panel/DeveloperPanel.d.ts +4 -0
  311. package/dist/shell/panel/DeveloperPanel.js +51 -0
  312. package/dist/shell/panel/DeveloperPanel.js.map +1 -0
  313. package/dist/shell/panel/FeatureToggles.d.ts +13 -0
  314. package/dist/shell/panel/FeatureToggles.js +42 -0
  315. package/dist/shell/panel/FeatureToggles.js.map +1 -0
  316. package/dist/shell/panel/Home.d.ts +3 -0
  317. package/dist/shell/panel/Home.js +23 -0
  318. package/dist/shell/panel/Home.js.map +1 -0
  319. package/dist/shell/panel/IconPackInstall.d.ts +15 -0
  320. package/dist/shell/panel/IconPackInstall.js +41 -0
  321. package/dist/shell/panel/IconPackInstall.js.map +1 -0
  322. package/dist/shell/panel/LanguageSettings.d.ts +1 -0
  323. package/dist/shell/panel/LanguageSettings.js +54 -0
  324. package/dist/shell/panel/LanguageSettings.js.map +1 -0
  325. package/dist/shell/panel/MakePanel.d.ts +3 -0
  326. package/dist/shell/panel/MakePanel.js +237 -0
  327. package/dist/shell/panel/MakePanel.js.map +1 -0
  328. package/dist/shell/panel/MarkdownDoc.d.ts +6 -0
  329. package/dist/shell/panel/MarkdownDoc.js +35 -0
  330. package/dist/shell/panel/MarkdownDoc.js.map +1 -0
  331. package/dist/shell/panel/Modes.d.ts +40 -0
  332. package/dist/shell/panel/Modes.js +270 -0
  333. package/dist/shell/panel/Modes.js.map +1 -0
  334. package/dist/shell/panel/NavIcon.d.ts +4 -0
  335. package/dist/shell/panel/NavIcon.js +6 -0
  336. package/dist/shell/panel/NavIcon.js.map +1 -0
  337. package/dist/shell/panel/Panel.d.ts +7 -0
  338. package/dist/shell/panel/Panel.js +139 -0
  339. package/dist/shell/panel/Panel.js.map +1 -0
  340. package/dist/shell/panel/PluginFeatures.d.ts +24 -0
  341. package/dist/shell/panel/PluginFeatures.js +165 -0
  342. package/dist/shell/panel/PluginFeatures.js.map +1 -0
  343. package/dist/shell/panel/Plugins.d.ts +33 -0
  344. package/dist/shell/panel/Plugins.js +112 -0
  345. package/dist/shell/panel/Plugins.js.map +1 -0
  346. package/dist/shell/panel/PowerSettings.d.ts +4 -0
  347. package/dist/shell/panel/PowerSettings.js +52 -0
  348. package/dist/shell/panel/PowerSettings.js.map +1 -0
  349. package/dist/shell/panel/Settings.d.ts +23 -0
  350. package/dist/shell/panel/Settings.js +116 -0
  351. package/dist/shell/panel/Settings.js.map +1 -0
  352. package/dist/shell/panel/ShareSetup.d.ts +8 -0
  353. package/dist/shell/panel/ShareSetup.js +130 -0
  354. package/dist/shell/panel/ShareSetup.js.map +1 -0
  355. package/dist/shell/panel/StoreSection.d.ts +6 -0
  356. package/dist/shell/panel/StoreSection.js +48 -0
  357. package/dist/shell/panel/StoreSection.js.map +1 -0
  358. package/dist/shell/panel/StringPacks.d.ts +11 -0
  359. package/dist/shell/panel/StringPacks.js +106 -0
  360. package/dist/shell/panel/StringPacks.js.map +1 -0
  361. package/dist/shell/panel/ThemeBuilder.d.ts +5 -0
  362. package/dist/shell/panel/ThemeBuilder.js +205 -0
  363. package/dist/shell/panel/ThemeBuilder.js.map +1 -0
  364. package/dist/shell/panel/backup.css +34 -0
  365. package/dist/shell/panel/builder.css +232 -0
  366. package/dist/shell/panel/builderModel.d.ts +55 -0
  367. package/dist/shell/panel/builderModel.js +95 -0
  368. package/dist/shell/panel/builderModel.js.map +1 -0
  369. package/dist/shell/panel/compare.d.ts +10 -0
  370. package/dist/shell/panel/compare.js +51 -0
  371. package/dist/shell/panel/compare.js.map +1 -0
  372. package/dist/shell/panel/controls.d.ts +135 -0
  373. package/dist/shell/panel/controls.js +213 -0
  374. package/dist/shell/panel/controls.js.map +1 -0
  375. package/dist/shell/panel/featureModel.d.ts +69 -0
  376. package/dist/shell/panel/featureModel.js +79 -0
  377. package/dist/shell/panel/featureModel.js.map +1 -0
  378. package/dist/shell/panel/fonts/FontBrowser.d.ts +10 -0
  379. package/dist/shell/panel/fonts/FontBrowser.js +189 -0
  380. package/dist/shell/panel/fonts/FontBrowser.js.map +1 -0
  381. package/dist/shell/panel/fonts/FontRoles.d.ts +20 -0
  382. package/dist/shell/panel/fonts/FontRoles.js +77 -0
  383. package/dist/shell/panel/fonts/FontRoles.js.map +1 -0
  384. package/dist/shell/panel/fonts/catalog.d.ts +37 -0
  385. package/dist/shell/panel/fonts/catalog.js +68 -0
  386. package/dist/shell/panel/fonts/catalog.js.map +1 -0
  387. package/dist/shell/panel/fonts/googleFontsCatalog.json +1 -0
  388. package/dist/shell/panel/index.d.ts +20 -0
  389. package/dist/shell/panel/index.js +34 -0
  390. package/dist/shell/panel/index.js.map +1 -0
  391. package/dist/shell/panel/languageModel.d.ts +5 -0
  392. package/dist/shell/panel/languageModel.js +7 -0
  393. package/dist/shell/panel/languageModel.js.map +1 -0
  394. package/dist/shell/panel/make.css +72 -0
  395. package/dist/shell/panel/makeModel.d.ts +32 -0
  396. package/dist/shell/panel/makeModel.js +84 -0
  397. package/dist/shell/panel/makeModel.js.map +1 -0
  398. package/dist/shell/panel/markdown.d.ts +46 -0
  399. package/dist/shell/panel/markdown.js +100 -0
  400. package/dist/shell/panel/markdown.js.map +1 -0
  401. package/dist/shell/panel/nav.d.ts +12 -0
  402. package/dist/shell/panel/nav.js +50 -0
  403. package/dist/shell/panel/nav.js.map +1 -0
  404. package/dist/shell/panel/panel.css +401 -0
  405. package/dist/shell/panel/panelMessages.d.ts +763 -0
  406. package/dist/shell/panel/panelMessages.js +767 -0
  407. package/dist/shell/panel/panelMessages.js.map +1 -0
  408. package/dist/shell/panel/plugins.css +59 -0
  409. package/dist/shell/panel/setupModel.d.ts +87 -0
  410. package/dist/shell/panel/setupModel.js +152 -0
  411. package/dist/shell/panel/setupModel.js.map +1 -0
  412. package/dist/shell/panel/site.d.ts +259 -0
  413. package/dist/shell/panel/site.js +25 -0
  414. package/dist/shell/panel/site.js.map +1 -0
  415. package/dist/shell/panel/strings.css +7 -0
  416. package/dist/shell/panel/themes.d.ts +10 -0
  417. package/dist/shell/panel/themes.js +8 -0
  418. package/dist/shell/panel/themes.js.map +1 -0
  419. package/dist/shell/profileModel.d.ts +3 -2
  420. package/dist/shell/profileModel.js +7 -5
  421. package/dist/shell/profileModel.js.map +1 -1
  422. package/dist/shell/store.css +230 -0
  423. package/dist/shell/storeMessages.d.ts +169 -0
  424. package/dist/shell/storeMessages.js +172 -0
  425. package/dist/shell/storeMessages.js.map +1 -0
  426. package/dist/shell/storeModel.d.ts +181 -0
  427. package/dist/shell/storeModel.js +133 -0
  428. package/dist/shell/storeModel.js.map +1 -0
  429. package/dist/shell/stringPacksModel.d.ts +44 -0
  430. package/dist/shell/stringPacksModel.js +94 -0
  431. package/dist/shell/stringPacksModel.js.map +1 -0
  432. package/dist/shell/updateModel.d.ts +2 -1
  433. package/dist/shell/updateModel.js +5 -4
  434. package/dist/shell/updateModel.js.map +1 -1
  435. package/dist/shell/windowControls.d.ts +4 -0
  436. package/dist/shell/windowControls.js +5 -0
  437. package/dist/shell/windowControls.js.map +1 -1
  438. package/i18n-config.schema.json +29 -0
  439. package/i18n-meta.schema.json +26 -0
  440. package/i18n.schema.json +42 -0
  441. package/icons.schema.json +646 -0
  442. package/languages.schema.json +23 -0
  443. package/locales/ar-x-fm.json +11 -0
  444. package/locales/ar.json +1281 -0
  445. package/locales/bg.json +1280 -0
  446. package/locales/bn.json +1280 -0
  447. package/locales/ca.json +1280 -0
  448. package/locales/cs.json +1280 -0
  449. package/locales/da.json +1280 -0
  450. package/locales/de.json +1280 -0
  451. package/locales/el.json +1280 -0
  452. package/locales/en-GB.json +27 -0
  453. package/locales/en.json +1280 -0
  454. package/locales/en.meta.json +51 -0
  455. package/locales/es.json +1280 -0
  456. package/locales/eu.json +1280 -0
  457. package/locales/fa.json +1281 -0
  458. package/locales/fi.json +1280 -0
  459. package/locales/fil.json +1280 -0
  460. package/locales/fr.json +1280 -0
  461. package/locales/ga.json +1280 -0
  462. package/locales/gl.json +1280 -0
  463. package/locales/gu.json +1280 -0
  464. package/locales/ha.json +1280 -0
  465. package/locales/he.json +1281 -0
  466. package/locales/hi.json +1280 -0
  467. package/locales/hr.json +1280 -0
  468. package/locales/hu.json +1279 -0
  469. package/locales/id.json +1280 -0
  470. package/locales/ig.json +1280 -0
  471. package/locales/it.json +1280 -0
  472. package/locales/ja.json +1280 -0
  473. package/locales/kn.json +1280 -0
  474. package/locales/ko.json +1280 -0
  475. package/locales/mr.json +1280 -0
  476. package/locales/ms.json +1280 -0
  477. package/locales/nb.json +1280 -0
  478. package/locales/nl.json +1280 -0
  479. package/locales/pl.json +1280 -0
  480. package/locales/pt.json +1280 -0
  481. package/locales/ro.json +1280 -0
  482. package/locales/ru.json +1280 -0
  483. package/locales/sk.json +1280 -0
  484. package/locales/sr.json +1280 -0
  485. package/locales/sv.json +1280 -0
  486. package/locales/ta.json +1280 -0
  487. package/locales/th.json +1280 -0
  488. package/locales/tr.json +1280 -0
  489. package/locales/uk.json +1280 -0
  490. package/locales/ur.json +1281 -0
  491. package/locales/vi.json +1280 -0
  492. package/locales/yo.json +1280 -0
  493. package/locales/zh-Hans.json +1280 -0
  494. package/locales/zh-Hant.json +1280 -0
  495. package/package.json +139 -5
  496. package/store-catalog.schema.json +65 -0
  497. package/theme.schema.json +4659 -0
  498. package/windows/installer.nsi +926 -0
  499. package/windows/languages/Basque.nsh +28 -0
  500. package/windows/languages/Catalan.nsh +28 -0
  501. package/windows/languages/Croatian.nsh +28 -0
  502. package/windows/languages/Czech.nsh +28 -0
  503. package/windows/languages/Danish.nsh +28 -0
  504. package/windows/languages/Finnish.nsh +28 -0
  505. package/windows/languages/Galician.nsh +28 -0
  506. package/windows/languages/Greek.nsh +28 -0
  507. package/windows/languages/Hungarian.nsh +28 -0
  508. package/windows/languages/Indonesian.nsh +28 -0
  509. package/windows/languages/Irish.nsh +28 -0
  510. package/windows/languages/Malay.nsh +28 -0
  511. package/windows/languages/Polish.nsh +28 -0
  512. package/windows/languages/Romanian.nsh +28 -0
  513. package/windows/languages/Serbian.nsh +28 -0
  514. package/windows/languages/Slovak.nsh +28 -0
  515. package/windows/languages/Thai.nsh +28 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeApi.js","sourceRoot":"","sources":["../../../runtime/src/themeApi.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,gGAAgG;AAChG,iGAAiG;AACjG,+FAA+F;AAC/F,8FAA8F;AAC9F,EAAE;AACF,uEAAuE;AA+CvE;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAiBhH,wGAAwG;AACxG,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,eAAe,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;AAC5G,MAAM,CAAC,MAAM,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAe9H,mHAAmH;AACnH,MAAM,CAAC,MAAM,gBAAgB,GAAG,+CAA+C,CAAC;AAEhF,MAAM,CAAC,MAAM,aAAa,GAAG,4EAA4E,CAAC;AAE1G,MAAM,GAAG,GAAG,iBAAiB,CAAC;AAE9B,6BAA6B;AAC7B,MAAM,UAAU,QAAQ,CAAC,GAAW;IAClC,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;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AO;QACP,QAAQ,CAAC,QAAwC;YAC/C,IAAI,CAAC,MAAM;gBAAE,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;YAC7B,IAAI,IAAI,GAAG,EAAE,CAAC;YACd,IAAI,CAAC;gBAAC,IAAI,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,4BAA4B,CAAC,CAAC;YAC1E,OAAO,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE;gBAC1B,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;gBACvB,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;gBAC3B,IAAI,GAAG,KAAK,IAAI;oBAAE,OAAO;gBACzB,IAAI,GAAG,GAAG,CAAC;gBACX,IAAI,CAAC;oBAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;gBAAC,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAAC,CAAC;YAC1D,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["// `api.theme`: the active theme as plain values, so plugins (and the UI kit) can match it. The site\n// adapter resolves its own theme document into a `ResolvedTheme` (colors by role, radius, font,\n// mode) and says when it changes; this module turns that into `--wb-*` CSS custom properties and\n// a small `current()` / `onChange()` API. When the site keeps its own colors (no theme, e.g. X\n// default), the adapter still resolves the site's palette, so plugins always see real colors.\n//\n// Pure except `createThemeApi` / `readPageTheme`, which read the page.\n\nexport type ThemeMode = 'light' | 'dark';\n\n/** Every color role a theme has, resolved (derived roles filled in, legibility enforced). */\nexport type ResolvedColors = {\n /** The main surface behind content (the site's column background). */\n bg: string;\n /** A raised surface (cards, inputs). */\n surface: string;\n /** Hover / selected surface, one step above `surface`. */\n elevated: string;\n border: string;\n text: string;\n /** Secondary text. */\n muted: string;\n accent: string;\n /** Readable text on `accent`. */\n onAccent: string;\n /** The site's filled primary button and its label. */\n inverse: string;\n onInverse: string;\n /** The canvas behind the columns (equals `bg` unless the theme paints a page). */\n page: string;\n};\n\nexport type ResolvedTheme = {\n /** Theme id (`x` for the site's own look). */\n id: string;\n name: string;\n mode: ThemeMode;\n /** True when the site's own colors are shown (no theme colors). */\n siteDefault: boolean;\n colors: ResolvedColors;\n /** Card / dialog corner radius in px. */\n radius: number;\n /** Button corner radius in px (9999 = pill). */\n buttonRadius: number;\n /** CSS `font-family` stack of the interface. */\n font: string;\n /**\n * Which font goes where: every role resolved (a role that inherits carries the stack it inherits).\n * Always present after `normalizeResolved`; adapters without font roles may leave it out.\n */\n fonts?: ResolvedFonts;\n};\n\n/**\n * Font roles: `interface` (the site's UI), `post` (main content text), `heading` (names and\n * headings), `numbers` (counts), `mono` (code), `chrome` (the app's own window: tabs, address bar,\n * panel) and `dialog` (plugin dialogs and toasts from the UI kit).\n */\nexport const FONT_ROLE_NAMES = ['interface', 'post', 'heading', 'numbers', 'mono', 'chrome', 'dialog'] as const;\nexport type FontRoleName = typeof FONT_ROLE_NAMES[number];\nexport type ResolvedFont = {\n /** CSS `font-family` stack. */\n stack: string;\n /** Weight the role asks for, or null to keep the text's own. */\n weight: number | null;\n /** Size relative to the site's (1 = unchanged). */\n size: number;\n /** Letter spacing in em, or null to keep the text's own. */\n tracking: number | null;\n /** Tabular (fixed-width) figures. */\n tabular: boolean;\n /** True when the role inherits its family from another role or the site. */\n inherited: boolean;\n};\nexport type ResolvedFonts = Record<FontRoleName, ResolvedFont>;\n/** Monospaced families, in order: what a `mono` role that inherits (or a source without fonts) gets. */\nexport const MONO_FAMILIES = ['Cascadia Mono', 'SF Mono', 'Consolas', 'Menlo', 'ui-monospace', 'monospace'];\nexport const MONO_FONT = MONO_FAMILIES.map(name => (/^(ui-monospace|monospace)$/.test(name) ? name : `\"${name}\"`)).join(', ');\n\n/** What a site adapter provides: the current resolved theme and change notifications. */\nexport type ThemeSource = {\n current(): ResolvedTheme | null;\n onChange(listener: () => void): () => void;\n};\n\nexport type ThemeApi = {\n /** The active theme, resolved. A frozen snapshot: call again after `onChange`. */\n current(): ResolvedTheme;\n /** Calls `listener(theme)` after the theme (or the site's light/dark mode) changes. Returns a dispose. */\n onChange(listener: (theme: ResolvedTheme) => void): () => void;\n};\n\n/** Where the theme file JSON Schema is published with the `waybetter` npm package (`\"$schema\"` in theme files). */\nexport const THEME_SCHEMA_URL = 'https://unpkg.com/waybetter/theme.schema.json';\n\nexport const FALLBACK_FONT = 'system-ui, -apple-system, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif';\n\nconst HEX = /^#[0-9a-f]{6}$/i;\n\n/** `#rrggbb` → [r, g, b]. */\nexport function hexToRgb(hex: string): [number, number, number] {\n const n = parseInt(hex.slice(1, 7), 16);\n return [(n >> 16) & 255, (n >> 8) & 255, n & 255];\n}\n\n/** WCAG relative luminance of `#rrggbb`. */\nexport function relativeLuminance(hex: string): number {\n const [r, g, b] = hexToRgb(hex).map(v => { const c = v / 255; return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4; }) as [number, number, number];\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n}\n\n/** WCAG contrast ratio of two `#rrggbb` colors (1–21). */\nexport function contrastRatio(a: string, b: string): number {\n const [x, y] = [relativeLuminance(a), relativeLuminance(b)].sort((m, n) => n - m) as [number, number];\n return (x + 0.05) / (y + 0.05);\n}\n\n/** White when it reaches 4.5:1 on `hex`, otherwise whichever of black and white reads better. */\nexport function readableOn(hex: string): string {\n const white = contrastRatio(hex, '#ffffff');\n return white >= 4.5 || white >= contrastRatio(hex, '#000000') ? '#ffffff' : '#000000';\n}\n\n/** `rgb(…)` / `rgba(…)` / `#rgb` / `#rrggbb` to `#rrggbb`; null when it is transparent or unparsable. */\nexport function toHex(value: string | null | undefined): string | null {\n const text = (value ?? '').trim();\n if (HEX.test(text)) return text.toLowerCase();\n const short = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(text);\n if (short) return `#${short[1]}${short[1]}${short[2]}${short[2]}${short[3]}${short[3]}`.toLowerCase();\n const match = /^rgba?\\(\\s*(\\d+)[,\\s]+(\\d+)[,\\s]+(\\d+)(?:\\s*[,/]\\s*([\\d.]+%?))?\\s*\\)$/.exec(text);\n if (!match) return null;\n if (match[4] !== undefined && parseFloat(match[4]) === 0) return null;\n return `#${[match[1], match[2], match[3]].map(v => Math.min(255, Number(v)).toString(16).padStart(2, '0')).join('')}`;\n}\n\n/** `a` moved toward `b` by `t` (0–1), per channel. */\nexport function mix(a: string, b: string, t: number): string {\n const [x, y] = [hexToRgb(a), hexToRgb(b)];\n return `#${x.map((v, i) => Math.round(v + (y[i]! - v) * t).toString(16).padStart(2, '0')).join('')}`;\n}\n\n/**\n * A complete resolved theme from a few page colors (background, text, accent), for sites or moments\n * without a theme engine. Surfaces, border and muted text sit between background and text.\n */\nexport function themeFromColors(bg: string, text: string, accent: string, extra: Partial<Omit<ResolvedTheme, 'colors'>> = {}): ResolvedTheme {\n const dark = relativeLuminance(bg) < relativeLuminance(text);\n const colors: ResolvedColors = {\n bg, text, accent,\n surface: mix(bg, text, dark ? 0.05 : 0.03),\n elevated: mix(bg, text, dark ? 0.1 : 0.07),\n border: mix(bg, text, dark ? 0.2 : 0.15),\n muted: mix(bg, text, 0.62),\n onAccent: readableOn(accent),\n inverse: text,\n onInverse: bg,\n page: bg,\n };\n return { id: 'page', name: 'Page colors', mode: dark ? 'dark' : 'light', siteDefault: true, radius: 16, buttonRadius: 9999, font: FALLBACK_FONT, ...extra, colors };\n}\n\n/** The page's own colors (computed body background and text), used when no theme source exists. */\nexport function readPageTheme(win: Window, accent = '#1d9bf0'): ResolvedTheme {\n let bg: string | null = null;\n let text: string | null = null;\n let font = '';\n try {\n const body = win.document.body;\n if (body) {\n const style = win.getComputedStyle(body);\n bg = toHex(style.backgroundColor) ?? toHex(win.getComputedStyle(win.document.documentElement).backgroundColor);\n text = toHex(style.color);\n font = style.fontFamily;\n }\n } catch { /* No layout yet. */ }\n const dark = !!win.matchMedia?.('(prefers-color-scheme: dark)').matches;\n bg ??= dark ? '#000000' : '#ffffff';\n text ??= relativeLuminance(bg) < 0.2 ? '#e7e9ea' : '#0f1419';\n if (contrastRatio(bg, text) < 3) text = readableOn(bg);\n return themeFromColors(bg, text, accent, font ? { font } : {});\n}\n\n/** Fills in any role a source left out and freezes the result. */\nexport function normalizeResolved(theme: ResolvedTheme): ResolvedTheme {\n const bg = toHex(theme.colors?.bg) ?? '#ffffff';\n let text = toHex(theme.colors?.text) ?? readableOn(bg);\n if (contrastRatio(bg, text) < 3) text = readableOn(bg);\n const base = themeFromColors(bg, text, toHex(theme.colors?.accent) ?? '#1d9bf0');\n const colors = { ...base.colors };\n for (const key of Object.keys(colors) as Array<keyof ResolvedColors>) {\n const value = theme.colors?.[key];\n if (key !== 'bg' && key !== 'text' && typeof value === 'string' && HEX.test(value)) colors[key] = value.toLowerCase();\n }\n if (!HEX.test(theme.colors.onAccent ?? '')) colors.onAccent = readableOn(colors.accent);\n const radius = Number.isFinite(theme.radius) ? Math.max(0, Math.min(28, theme.radius)) : 16;\n const buttonRadius = Number.isFinite(theme.buttonRadius) ? Math.max(0, theme.buttonRadius) : 9999;\n const font = theme.font || FALLBACK_FONT;\n return Object.freeze({\n id: String(theme.id || 'theme'), name: String(theme.name || ''), mode: theme.mode === 'light' ? 'light' : 'dark',\n siteDefault: !!theme.siteDefault, radius, buttonRadius, font,\n colors: Object.freeze(colors),\n fonts: normalizeFonts(theme.fonts, font),\n });\n}\n\nconst cssSafe = (value: string) => value.replace(/[;{}<>\\\\]/g, '');\nconst finite = (value: unknown, min: number, max: number): number | null =>\n typeof value === 'number' && Number.isFinite(value) ? Math.min(max, Math.max(min, value)) : null;\n\n/** Every role filled in: missing roles inherit the interface font (`mono` a monospaced stack). */\nexport function normalizeFonts(fonts: Partial<Record<FontRoleName, Partial<ResolvedFont>>> | undefined, font: string): ResolvedFonts {\n const out = {} as Record<FontRoleName, ResolvedFont>;\n const base = fonts?.interface?.stack ? cssSafe(fonts.interface.stack) : font;\n for (const role of FONT_ROLE_NAMES) {\n const given = fonts?.[role];\n const stack = given?.stack ? cssSafe(given.stack) : role === 'mono' ? MONO_FONT : base;\n out[role] = Object.freeze({\n stack,\n weight: finite(given?.weight, 100, 900),\n size: finite(given?.size, 0.5, 2) ?? 1,\n tracking: finite(given?.tracking, -0.1, 0.2),\n tabular: !!given?.tabular,\n inherited: given ? !!given.inherited : true,\n });\n }\n return Object.freeze(out);\n}\n\nconst VAR_NAMES: Record<keyof ResolvedColors, string> = {\n bg: '--wb-bg', surface: '--wb-surface', elevated: '--wb-elevated', border: '--wb-border', text: '--wb-text', muted: '--wb-muted',\n accent: '--wb-accent', onAccent: '--wb-on-accent', inverse: '--wb-inverse', onInverse: '--wb-on-inverse', page: '--wb-page',\n};\n\n/**\n * The theme as CSS custom properties: `--wb-bg`, `--wb-surface`, `--wb-elevated`, `--wb-border`,\n * `--wb-text`, `--wb-muted`, `--wb-accent`, `--wb-on-accent`, `--wb-inverse`, `--wb-on-inverse`,\n * `--wb-page`, `--wb-radius`, `--wb-button-radius`, `--wb-font`, `--wb-mode` (`light`/`dark`), and\n * one stack per font role: `--wb-font-interface`, `--wb-font-post`, `--wb-font-heading`,\n * `--wb-font-numbers`, `--wb-font-mono`, `--wb-font-chrome`, `--wb-font-dialog`.\n */\nexport function themeVars(theme: ResolvedTheme): Record<string, string> {\n const vars: Record<string, string> = {};\n for (const [key, name] of Object.entries(VAR_NAMES)) vars[name] = theme.colors[key as keyof ResolvedColors];\n vars['--wb-radius'] = `${theme.radius}px`;\n vars['--wb-button-radius'] = `${theme.buttonRadius}px`;\n vars['--wb-font'] = theme.font;\n const fonts = theme.fonts ?? normalizeFonts(undefined, theme.font);\n for (const role of FONT_ROLE_NAMES) vars[`--wb-font-${role}`] = fonts[role].stack;\n vars['--wb-mode'] = theme.mode;\n return vars;\n}\n\n/** `:root{--wb-…}` for a `<style>` element (values come from a resolved theme, never raw input). */\nexport function themeVarsCss(theme: ResolvedTheme, selector = ':root'): string {\n const safe = (value: string) => value.replace(/[;{}<>\\\\]/g, '');\n return `${selector}{${Object.entries(themeVars(theme)).map(([name, value]) => `${name}:${safe(value)}`).join(';')}}`;\n}\n\n/** A stable key: equal keys mean nothing visible changed. */\nexport const themeKey = (theme: ResolvedTheme) => JSON.stringify(theme);\n\n/**\n * `api.theme`. With a site `source` it reports the site's resolved theme (falling back to the page's\n * computed colors while the source has none); without one, only the page's colors.\n */\nexport function createThemeApi(win: Window, source?: ThemeSource, fallbackAccent?: string): ThemeApi {\n const report = (error: unknown) => console.error('[wayBetter] theme listener failed', error);\n const current = (): ResolvedTheme => {\n let resolved: ResolvedTheme | null = null;\n try { resolved = source?.current() ?? null; } catch (error) { report(error); }\n return normalizeResolved(resolved ?? readPageTheme(win, fallbackAccent));\n };\n return Object.freeze({\n current,\n onChange(listener: (theme: ResolvedTheme) => void) {\n if (!source) return () => {};\n let last = '';\n try { last = themeKey(current()); } catch { /* Reported by current(). */ }\n return source.onChange(() => {\n const next = current();\n const key = themeKey(next);\n if (key === last) return;\n last = key;\n try { listener(next); } catch (error) { report(error); }\n });\n },\n });\n}\n"]}
@@ -0,0 +1,52 @@
1
+ import { type IconPack } from './themeIcons.ts';
2
+ import { type Palette, type ThemeOverrides, type ThemeSpec } from './themeSpec.ts';
3
+ /**
4
+ * What is persisted natively and handed to the page runtime. `icons` is the owner's icon pack (theme
5
+ * engine v2): absent follows the theme's suggestion, `site` keeps the site's own icons, else a pack id.
6
+ */
7
+ export type ThemeChoice = {
8
+ preset: string;
9
+ accent: string | null;
10
+ overrides: ThemeOverrides;
11
+ themes: ThemeSpec[];
12
+ icons?: string;
13
+ packs?: IconPack[];
14
+ };
15
+ /** Icon packs the owner imported (standalone documents, kept with the choice so every site tab has them). */
16
+ export declare const MAX_USER_PACKS = 8;
17
+ /** Imported themes kept in a choice (the JSON Schema of the native side says the same). */
18
+ export declare const MAX_USER_THEMES = 24;
19
+ export type ThemeCatalog = {
20
+ /** The site's built-in themes; the first is its own look (and the default choice). */
21
+ builtins: readonly ThemeSpec[];
22
+ /** Nothing chosen: the first built-in theme, no customizations. */
23
+ defaultChoice: ThemeChoice;
24
+ /** Any JSON to a valid choice (imported themes sanitized, bounded and deduplicated; unknown ids fall back). */
25
+ normalize(input: unknown): ThemeChoice;
26
+ /** The theme document a choice refers to (built-in or imported), before overrides. */
27
+ base(choice: ThemeChoice): ThemeSpec;
28
+ /** The effective theme: the selected document with the panel's overrides and accent, legible. */
29
+ resolve(choice: ThemeChoice): ThemeSpec;
30
+ /** The effective palette: the theme's colors (or none for the site's own) with the accent override applied. */
31
+ palette(choice: ThemeChoice): Partial<Palette> | null;
32
+ /** Every theme that can be picked: the built-in ones, then the choice's imported ones. */
33
+ all(choice: ThemeChoice): ThemeSpec[];
34
+ };
35
+ export declare function createThemeCatalog(builtins: readonly ThemeSpec[]): ThemeCatalog;
36
+ /** The choice a tab's theme id stands for (themeScopes: account and pane themes): the global choice itself, or that theme without customizations. */
37
+ export declare function choiceForId(global: ThemeChoice, id: string): ThemeChoice;
38
+ /** The shape persisted natively: empty groups are dropped so "no override" stays unambiguous. */
39
+ export declare function serializeChoice(choice: ThemeChoice): {
40
+ packs?: IconPack[] | undefined;
41
+ icons?: string | undefined;
42
+ themes?: ThemeSpec[] | undefined;
43
+ overrides?: {
44
+ [k: string]: Record<string, string> | import("./themeSpec.ts").Background | Partial<import("./themeSpec.ts").ThemeColors> | (Partial<Omit<import("./themeSpec.ts").FontSpec, "roles">> & {
45
+ roles?: Partial<import("./themeSpec.ts").FontRoles>;
46
+ }) | Partial<import("./themeSpec.ts").ShapeSpec> | Partial<import("./themeSpec.ts").LayoutSpec> | Partial<import("./themeSpec.ts").EffectsSpec> | {
47
+ text: string;
48
+ };
49
+ } | undefined;
50
+ preset: string;
51
+ accent: string | null;
52
+ };
@@ -0,0 +1,69 @@
1
+ // The owner's theme choice: which theme document is on (a built-in one or an imported one), the
2
+ // panel's customizations on top of it and an accent override. Native code persists it and hands it
3
+ // to every site tab; the shell's theme store and the panel edit it. A site brings its built-in
4
+ // themes (`createThemeCatalog(builtins)`; the first one is the site's own look, the default). Pure.
5
+ import { sanitizeIconPack } from "./themeIcons.js";
6
+ import { applyOverrides, isHex, sanitizeSpec } from "./themeSpec.js";
7
+ /** Icon packs the owner imported (standalone documents, kept with the choice so every site tab has them). */
8
+ export const MAX_USER_PACKS = 8;
9
+ /** Imported themes kept in a choice (the JSON Schema of the native side says the same). */
10
+ export const MAX_USER_THEMES = 24;
11
+ const OVERRIDE_GROUPS = ['colors', 'font', 'shape', 'layout', 'background', 'effects', 'css', 'variants'];
12
+ export function createThemeCatalog(builtins) {
13
+ if (!builtins.length)
14
+ throw new Error('wayBetter themes: a site needs at least one built-in theme (its own look)');
15
+ const first = builtins[0];
16
+ const defaultChoice = { preset: first.id, accent: null, overrides: {}, themes: [] };
17
+ const isBuiltin = (id) => builtins.some(item => item.id === id);
18
+ function normalize(input) {
19
+ const source = input && typeof input === 'object' ? input : {};
20
+ const themes = [];
21
+ if (Array.isArray(source.themes)) {
22
+ for (const raw of source.themes.slice(0, MAX_USER_THEMES)) {
23
+ const theme = sanitizeSpec(raw);
24
+ if (!isBuiltin(theme.id) && !themes.some(item => item.id === theme.id))
25
+ themes.push(theme);
26
+ }
27
+ }
28
+ const known = (id) => typeof id === 'string' && (isBuiltin(id) || themes.some(item => item.id === id));
29
+ const preset = known(source.preset) ? source.preset : first.id;
30
+ const accent = isHex(source.accent) ? source.accent.toLowerCase() : null;
31
+ const overrides = {};
32
+ const rawOverrides = source.overrides && typeof source.overrides === 'object' ? source.overrides : {};
33
+ for (const key of OVERRIDE_GROUPS) {
34
+ const value = rawOverrides[key];
35
+ if (value && typeof value === 'object' && !Array.isArray(value))
36
+ overrides[key] = value;
37
+ }
38
+ const icons = typeof source.icons === 'string' && /^[a-z0-9-]{1,40}$/.test(source.icons) && source.icons !== 'theme' ? source.icons : undefined;
39
+ const packs = [];
40
+ if (Array.isArray(source.packs)) {
41
+ for (const raw of source.packs.slice(0, MAX_USER_PACKS)) {
42
+ const pack = sanitizeIconPack(raw);
43
+ if (pack && !packs.some(item => item.id === pack.id))
44
+ packs.push(pack);
45
+ }
46
+ }
47
+ return { preset, accent, overrides, themes, ...(icons ? { icons } : {}), ...(packs.length ? { packs } : {}) };
48
+ }
49
+ const base = (choice) => choice.themes.find(item => item.id === choice.preset) ?? builtins.find(item => item.id === choice.preset) ?? first;
50
+ const resolve = (choice) => applyOverrides(base(choice), choice.overrides, choice.accent);
51
+ function palette(choice) {
52
+ const theme = resolve(choice);
53
+ if (theme.colors)
54
+ return theme.colors;
55
+ return choice.accent ? { accent: choice.accent } : null;
56
+ }
57
+ const all = (choice) => [...builtins, ...choice.themes];
58
+ return { builtins, defaultChoice, normalize, base, resolve, palette, all };
59
+ }
60
+ /** The choice a tab's theme id stands for (themeScopes: account and pane themes): the global choice itself, or that theme without customizations. */
61
+ export function choiceForId(global, id) {
62
+ return id === global.preset ? global : { preset: id, accent: null, overrides: {}, themes: global.themes, ...(global.icons ? { icons: global.icons } : {}), ...(global.packs?.length ? { packs: global.packs } : {}) };
63
+ }
64
+ /** The shape persisted natively: empty groups are dropped so "no override" stays unambiguous. */
65
+ export function serializeChoice(choice) {
66
+ const overrides = Object.fromEntries(Object.entries(choice.overrides).filter(([, value]) => value && Object.keys(value).length));
67
+ return { preset: choice.preset, accent: choice.accent, ...(Object.keys(overrides).length ? { overrides } : {}), ...(choice.themes.length ? { themes: choice.themes } : {}), ...(choice.icons ? { icons: choice.icons } : {}), ...(choice.packs?.length ? { packs: choice.packs } : {}) };
68
+ }
69
+ //# sourceMappingURL=themeChoice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeChoice.js","sourceRoot":"","sources":["../../../runtime/src/themeChoice.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,mGAAmG;AACnG,+FAA+F;AAC/F,oGAAoG;AAEpG,OAAO,EAAE,gBAAgB,EAAi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,iGAAiG;AACjG,MAAM,UAAU,eAAe,CAAC,MAAmB;IACjD,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IACjI,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AAC3R,CAAC","sourcesContent":["// The owner's theme choice: which theme document is on (a built-in one or an imported one), the\n// panel's customizations on top of it and an accent override. Native code persists it and hands it\n// to every site tab; the shell's theme store and the panel edit it. A site brings its built-in\n// themes (`createThemeCatalog(builtins)`; the first one is the site's own look, the default). Pure.\n\nimport { sanitizeIconPack, type IconPack } from './themeIcons.ts';\nimport { applyOverrides, isHex, sanitizeSpec, type Palette, type ThemeOverrides, type ThemeSpec } from './themeSpec.ts';\n\n/**\n * What is persisted natively and handed to the page runtime. `icons` is the owner's icon pack (theme\n * engine v2): absent follows the theme's suggestion, `site` keeps the site's own icons, else a pack id.\n */\nexport type ThemeChoice = { preset: string; accent: string | null; overrides: ThemeOverrides; themes: ThemeSpec[]; icons?: string; packs?: IconPack[] };\n\n/** Icon packs the owner imported (standalone documents, kept with the choice so every site tab has them). */\nexport const MAX_USER_PACKS = 8;\n\n/** Imported themes kept in a choice (the JSON Schema of the native side says the same). */\nexport const MAX_USER_THEMES = 24;\nconst OVERRIDE_GROUPS = ['colors', 'font', 'shape', 'layout', 'background', 'effects', 'css', 'variants'] as const;\n\nexport type ThemeCatalog = {\n /** The site's built-in themes; the first is its own look (and the default choice). */\n builtins: readonly ThemeSpec[];\n /** Nothing chosen: the first built-in theme, no customizations. */\n defaultChoice: ThemeChoice;\n /** Any JSON to a valid choice (imported themes sanitized, bounded and deduplicated; unknown ids fall back). */\n normalize(input: unknown): ThemeChoice;\n /** The theme document a choice refers to (built-in or imported), before overrides. */\n base(choice: ThemeChoice): ThemeSpec;\n /** The effective theme: the selected document with the panel's overrides and accent, legible. */\n resolve(choice: ThemeChoice): ThemeSpec;\n /** The effective palette: the theme's colors (or none for the site's own) with the accent override applied. */\n palette(choice: ThemeChoice): Partial<Palette> | null;\n /** Every theme that can be picked: the built-in ones, then the choice's imported ones. */\n all(choice: ThemeChoice): ThemeSpec[];\n};\n\nexport function createThemeCatalog(builtins: readonly ThemeSpec[]): ThemeCatalog {\n if (!builtins.length) throw new Error('wayBetter themes: a site needs at least one built-in theme (its own look)');\n const first = builtins[0]!;\n const defaultChoice: ThemeChoice = { preset: first.id, accent: null, overrides: {}, themes: [] };\n const isBuiltin = (id: unknown) => builtins.some(item => item.id === id);\n\n function normalize(input: unknown): ThemeChoice {\n const source = input && typeof input === 'object' ? input as Record<string, unknown> : {};\n const themes: ThemeSpec[] = [];\n if (Array.isArray(source.themes)) {\n for (const raw of source.themes.slice(0, MAX_USER_THEMES)) {\n const theme = sanitizeSpec(raw);\n if (!isBuiltin(theme.id) && !themes.some(item => item.id === theme.id)) themes.push(theme);\n }\n }\n const known = (id: unknown) => typeof id === 'string' && (isBuiltin(id) || themes.some(item => item.id === id));\n const preset = known(source.preset) ? source.preset as string : first.id;\n const accent = isHex(source.accent) ? source.accent.toLowerCase() : null;\n const overrides: ThemeOverrides = {};\n const rawOverrides = source.overrides && typeof source.overrides === 'object' ? source.overrides as Record<string, unknown> : {};\n for (const key of OVERRIDE_GROUPS) {\n const value = rawOverrides[key];\n if (value && typeof value === 'object' && !Array.isArray(value)) (overrides as Record<string, unknown>)[key] = value;\n }\n const icons = typeof source.icons === 'string' && /^[a-z0-9-]{1,40}$/.test(source.icons) && source.icons !== 'theme' ? source.icons : undefined;\n const packs: IconPack[] = [];\n if (Array.isArray(source.packs)) {\n for (const raw of source.packs.slice(0, MAX_USER_PACKS)) {\n const pack = sanitizeIconPack(raw);\n if (pack && !packs.some(item => item.id === pack.id)) packs.push(pack);\n }\n }\n return { preset, accent, overrides, themes, ...(icons ? { icons } : {}), ...(packs.length ? { packs } : {}) };\n }\n\n const base = (choice: ThemeChoice) => choice.themes.find(item => item.id === choice.preset) ?? builtins.find(item => item.id === choice.preset) ?? first;\n const resolve = (choice: ThemeChoice) => applyOverrides(base(choice), choice.overrides, choice.accent);\n function palette(choice: ThemeChoice): Partial<Palette> | null {\n const theme = resolve(choice);\n if (theme.colors) return theme.colors;\n return choice.accent ? { accent: choice.accent } : null;\n }\n const all = (choice: ThemeChoice) => [...builtins, ...choice.themes];\n return { builtins, defaultChoice, normalize, base, resolve, palette, all };\n}\n\n/** The choice a tab's theme id stands for (themeScopes: account and pane themes): the global choice itself, or that theme without customizations. */\nexport function choiceForId(global: ThemeChoice, id: string): ThemeChoice {\n return id === global.preset ? global : { preset: id, accent: null, overrides: {}, themes: global.themes, ...(global.icons ? { icons: global.icons } : {}), ...(global.packs?.length ? { packs: global.packs } : {}) };\n}\n\n/** The shape persisted natively: empty groups are dropped so \"no override\" stays unambiguous. */\nexport function serializeChoice(choice: ThemeChoice) {\n const overrides = Object.fromEntries(Object.entries(choice.overrides).filter(([, value]) => value && Object.keys(value).length));\n return { preset: choice.preset, accent: choice.accent, ...(Object.keys(overrides).length ? { overrides } : {}), ...(choice.themes.length ? { themes: choice.themes } : {}), ...(choice.icons ? { icons: choice.icons } : {}), ...(choice.packs?.length ? { packs: choice.packs } : {}) };\n}\n"]}
@@ -0,0 +1,435 @@
1
+ import { type FontRoleName } from './themeApi.ts';
2
+ /** Color roles a component may name. `onAccent` is the readable label on the accent. */
3
+ export declare const COLOR_ROLES: readonly ["bg", "surface", "elevated", "page", "border", "text", "muted", "accent", "onAccent", "inverse", "onInverse"];
4
+ export type ColorRole = typeof COLOR_ROLES[number];
5
+ export type RoleColors = Record<ColorRole, string>;
6
+ export declare const BORDER_STYLES: readonly ["none", "solid", "dashed", "dotted", "double", "bevel-out", "bevel-in"];
7
+ export declare const SHADOWS: readonly ["none", "soft", "deep", "hard", "inset", "glow"];
8
+ export declare const CASES: readonly ["none", "upper", "lower", "capitalize", "small-caps"];
9
+ export declare const AVATAR_SHAPES: readonly ["circle", "rounded", "square", "squircle", "hexagon", "octagon", "diamond"];
10
+ export declare const CORNERS: readonly ["round", "cut"];
11
+ export type Gradient = {
12
+ from: ColorRole;
13
+ to: ColorRole;
14
+ angle: number;
15
+ };
16
+ export type Fill = ColorRole | 'transparent' | 'glass' | Gradient;
17
+ export type StateTokens = {
18
+ fill?: Fill;
19
+ text?: ColorRole;
20
+ borderColor?: ColorRole;
21
+ shadow?: typeof SHADOWS[number];
22
+ lift?: number;
23
+ scale?: number;
24
+ underline?: boolean;
25
+ };
26
+ export type ComponentTokens = {
27
+ preset?: string;
28
+ radius?: number | 'pill';
29
+ borderWidth?: number;
30
+ borderStyle?: typeof BORDER_STYLES[number];
31
+ borderColor?: ColorRole;
32
+ fill?: Fill;
33
+ text?: ColorRole;
34
+ padX?: number;
35
+ padY?: number;
36
+ gap?: number;
37
+ height?: number;
38
+ width?: number;
39
+ size?: number;
40
+ maxHeight?: number;
41
+ font?: FontRoleName;
42
+ fontSize?: number;
43
+ weight?: number;
44
+ case?: typeof CASES[number];
45
+ tracking?: number;
46
+ leading?: number;
47
+ shadow?: typeof SHADOWS[number];
48
+ shape?: typeof AVATAR_SHAPES[number];
49
+ corner?: typeof CORNERS[number];
50
+ visible?: boolean;
51
+ hover?: StateTokens;
52
+ active?: StateTokens;
53
+ focus?: StateTokens;
54
+ };
55
+ /** Every component a theme can name. Sites map them to selectors; a component a site does not have is ignored. */
56
+ export declare const COMPONENTS: {
57
+ readonly nav: {
58
+ readonly width: [56, 320];
59
+ readonly glass: true;
60
+ readonly gradient: true;
61
+ };
62
+ readonly navItem: {
63
+ readonly height: [36, 64];
64
+ readonly fontSize: [number, number];
65
+ readonly text: true;
66
+ };
67
+ readonly topBar: {
68
+ readonly height: [40, 64];
69
+ readonly glass: true;
70
+ readonly gradient: true;
71
+ readonly fontSize: [number, number];
72
+ };
73
+ readonly tabs: {
74
+ readonly presets: "tabs";
75
+ readonly gradient: true;
76
+ };
77
+ readonly tab: {
78
+ readonly height: [32, 56];
79
+ readonly fontSize: [number, number];
80
+ readonly text: true;
81
+ readonly presets: "tabs";
82
+ };
83
+ readonly post: {
84
+ readonly corner: true;
85
+ readonly presets: "post";
86
+ readonly contrast: 7;
87
+ };
88
+ readonly avatar: {
89
+ readonly size: [20, 64];
90
+ readonly shape: true;
91
+ readonly visible: true;
92
+ };
93
+ readonly displayName: {
94
+ readonly text: true;
95
+ readonly fontSize: [number, number];
96
+ readonly visible: true;
97
+ };
98
+ readonly handle: {
99
+ readonly text: true;
100
+ readonly fontSize: [number, number];
101
+ readonly visible: true;
102
+ };
103
+ readonly postText: {
104
+ readonly text: true;
105
+ readonly fontSize: [13, 24];
106
+ readonly contrast: 7;
107
+ };
108
+ readonly meta: {
109
+ readonly text: true;
110
+ readonly fontSize: [number, number];
111
+ };
112
+ readonly actionBar: {};
113
+ readonly action: {
114
+ readonly size: [28, 44];
115
+ };
116
+ readonly count: {
117
+ readonly text: true;
118
+ readonly fontSize: [number, number];
119
+ readonly visible: true;
120
+ };
121
+ readonly media: {
122
+ readonly corner: true;
123
+ readonly maxHeight: [200, 700];
124
+ };
125
+ readonly linkCard: {
126
+ readonly corner: true;
127
+ };
128
+ readonly quote: {};
129
+ readonly button: {
130
+ readonly height: [24, 56];
131
+ readonly fontSize: [number, number];
132
+ readonly text: true;
133
+ readonly gradient: true;
134
+ readonly presets: "button";
135
+ };
136
+ readonly buttonPrimary: {
137
+ readonly parent: "button";
138
+ readonly height: [24, 56];
139
+ readonly fontSize: [number, number];
140
+ readonly text: true;
141
+ readonly gradient: true;
142
+ readonly presets: "button";
143
+ };
144
+ readonly buttonSecondary: {
145
+ readonly parent: "button";
146
+ readonly height: [24, 56];
147
+ readonly fontSize: [number, number];
148
+ readonly text: true;
149
+ readonly gradient: true;
150
+ readonly presets: "button";
151
+ };
152
+ readonly buttonGhost: {
153
+ readonly parent: "button";
154
+ readonly height: [24, 56];
155
+ readonly fontSize: [number, number];
156
+ readonly text: true;
157
+ readonly gradient: true;
158
+ readonly presets: "button";
159
+ };
160
+ readonly input: {
161
+ readonly height: [32, 56];
162
+ readonly fontSize: [number, number];
163
+ readonly text: true;
164
+ readonly presets: "input";
165
+ };
166
+ readonly search: {
167
+ readonly height: [32, 56];
168
+ readonly fontSize: [number, number];
169
+ readonly text: true;
170
+ readonly presets: "input";
171
+ };
172
+ readonly composer: {
173
+ readonly fontSize: [13, 24];
174
+ readonly text: true;
175
+ };
176
+ /** The tool icons under a composer (media, poll, emoji); `text` is their color. */
177
+ readonly composerTool: {
178
+ readonly size: [28, 44];
179
+ };
180
+ readonly panel: {
181
+ readonly glass: true;
182
+ readonly presets: "panel";
183
+ };
184
+ readonly menu: {
185
+ readonly parent: "panel";
186
+ readonly glass: true;
187
+ readonly presets: "panel";
188
+ };
189
+ readonly dialog: {
190
+ readonly parent: "panel";
191
+ readonly glass: true;
192
+ readonly presets: "panel";
193
+ };
194
+ readonly toast: {
195
+ readonly parent: "panel";
196
+ readonly glass: true;
197
+ readonly presets: "panel";
198
+ };
199
+ readonly hoverCard: {
200
+ readonly parent: "panel";
201
+ readonly glass: true;
202
+ readonly presets: "panel";
203
+ };
204
+ readonly sidebarCard: {
205
+ readonly parent: "panel";
206
+ readonly glass: true;
207
+ readonly corner: true;
208
+ readonly presets: "panel";
209
+ };
210
+ readonly badge: {
211
+ readonly size: [14, 24];
212
+ readonly corner: true;
213
+ readonly fontSize: [number, number];
214
+ readonly text: true;
215
+ };
216
+ readonly pill: {
217
+ readonly fontSize: [number, number];
218
+ readonly text: true;
219
+ };
220
+ readonly divider: {};
221
+ readonly scrollbar: {};
222
+ readonly profileHeader: {};
223
+ };
224
+ export type ComponentId = keyof typeof COMPONENTS;
225
+ export declare const COMPONENT_IDS: ComponentId[];
226
+ export type ThemeComponents = Partial<Record<ComponentId, ComponentTokens>>;
227
+ /** Clamp ranges of the tokens every component shares (the JSON Schema says the same; tested). */
228
+ export declare const TOKEN_LIMITS: {
229
+ readonly radius: readonly [0, 32];
230
+ readonly borderWidth: readonly [0, 4];
231
+ readonly padX: readonly [0, 32];
232
+ readonly padY: readonly [0, 32];
233
+ readonly gap: readonly [0, 24];
234
+ readonly weight: readonly [100, 900];
235
+ readonly tracking: readonly [-0.05, 0.2];
236
+ readonly leading: readonly [1.1, 2];
237
+ readonly angle: readonly [0, 360];
238
+ readonly lift: readonly [0, 4];
239
+ readonly scale: readonly [0.96, 1.04];
240
+ };
241
+ /** Named token bundles per family; a theme's own tokens win over its preset's. Frozen once shipped. */
242
+ export declare const PRESETS: {
243
+ readonly button: {
244
+ readonly pill: {
245
+ readonly radius: "pill";
246
+ readonly borderWidth: 0;
247
+ };
248
+ readonly soft: {
249
+ readonly radius: 8;
250
+ readonly borderWidth: 0;
251
+ };
252
+ readonly square: {
253
+ readonly radius: 0;
254
+ readonly borderWidth: 1;
255
+ readonly borderStyle: "solid";
256
+ };
257
+ readonly outline: {
258
+ readonly radius: 6;
259
+ readonly borderWidth: 1;
260
+ readonly borderStyle: "solid";
261
+ readonly fill: "transparent";
262
+ readonly text: "text";
263
+ readonly borderColor: "border";
264
+ };
265
+ readonly bevel: {
266
+ readonly radius: 0;
267
+ readonly borderStyle: "bevel-out";
268
+ readonly fill: "surface";
269
+ readonly text: "text";
270
+ readonly active: {
271
+ readonly shadow: "inset";
272
+ };
273
+ };
274
+ readonly gloss: {
275
+ readonly radius: "pill";
276
+ readonly borderWidth: 1;
277
+ readonly borderStyle: "solid";
278
+ readonly shadow: "soft";
279
+ };
280
+ readonly 'flat-link': {
281
+ readonly radius: 0;
282
+ readonly borderWidth: 0;
283
+ readonly fill: "transparent";
284
+ readonly text: "accent";
285
+ readonly hover: {
286
+ readonly underline: true;
287
+ };
288
+ };
289
+ };
290
+ readonly post: {
291
+ readonly flat: {
292
+ readonly radius: 0;
293
+ readonly borderWidth: 0;
294
+ readonly fill: "transparent";
295
+ readonly shadow: "none";
296
+ };
297
+ readonly card: {
298
+ readonly radius: 14;
299
+ readonly borderWidth: 1;
300
+ readonly borderStyle: "solid";
301
+ readonly borderColor: "border";
302
+ readonly fill: "surface";
303
+ };
304
+ readonly bubble: {
305
+ readonly radius: 20;
306
+ readonly borderWidth: 0;
307
+ readonly fill: "surface";
308
+ };
309
+ readonly window: {
310
+ readonly radius: 0;
311
+ readonly borderStyle: "bevel-out";
312
+ readonly fill: "surface";
313
+ };
314
+ readonly ruled: {
315
+ readonly radius: 0;
316
+ readonly borderWidth: 0;
317
+ readonly fill: "transparent";
318
+ };
319
+ };
320
+ readonly input: {
321
+ readonly pill: {
322
+ readonly radius: "pill";
323
+ readonly borderWidth: 1;
324
+ readonly borderStyle: "solid";
325
+ readonly borderColor: "border";
326
+ };
327
+ readonly underline: {
328
+ readonly radius: 0;
329
+ readonly borderWidth: 0;
330
+ readonly fill: "transparent";
331
+ };
332
+ readonly sunken: {
333
+ readonly radius: 0;
334
+ readonly borderStyle: "bevel-in";
335
+ readonly fill: "bg";
336
+ readonly text: "text";
337
+ };
338
+ readonly boxed: {
339
+ readonly radius: 4;
340
+ readonly borderWidth: 1;
341
+ readonly borderStyle: "solid";
342
+ readonly borderColor: "border";
343
+ readonly fill: "bg";
344
+ };
345
+ };
346
+ readonly panel: {
347
+ readonly sheet: {
348
+ readonly radius: 12;
349
+ readonly borderWidth: 1;
350
+ readonly borderStyle: "solid";
351
+ readonly borderColor: "border";
352
+ readonly fill: "surface";
353
+ readonly shadow: "soft";
354
+ };
355
+ readonly window: {
356
+ readonly radius: 0;
357
+ readonly borderStyle: "bevel-out";
358
+ readonly fill: "surface";
359
+ readonly shadow: "none";
360
+ };
361
+ readonly glass: {
362
+ readonly radius: 16;
363
+ readonly borderWidth: 1;
364
+ readonly borderStyle: "solid";
365
+ readonly borderColor: "border";
366
+ readonly fill: "glass";
367
+ readonly shadow: "soft";
368
+ };
369
+ };
370
+ readonly tabs: {
371
+ readonly underline: {
372
+ readonly radius: 0;
373
+ };
374
+ readonly pills: {
375
+ readonly radius: "pill";
376
+ };
377
+ readonly folder: {
378
+ readonly radius: 6;
379
+ readonly borderWidth: 1;
380
+ readonly borderStyle: "solid";
381
+ readonly borderColor: "border";
382
+ };
383
+ readonly blocks: {
384
+ readonly radius: 0;
385
+ readonly borderWidth: 1;
386
+ readonly borderStyle: "solid";
387
+ readonly borderColor: "border";
388
+ };
389
+ };
390
+ };
391
+ /** One component's tokens from JSON: clamped, unknown names and tokens the component does not take dropped. */
392
+ export declare function sanitizeComponentTokens(id: ComponentId, value: unknown): ComponentTokens | undefined;
393
+ /** The `components` group from JSON. Null when nothing valid is left (the theme sets no component). */
394
+ export declare function sanitizeComponents(value: unknown): ThemeComponents | null;
395
+ /** Every component with its preset and its parent's tokens folded in (own tokens win, then the preset, then the parent). */
396
+ export declare function resolveComponents(components: ThemeComponents): ThemeComponents;
397
+ /** A site's selectors for one component. */
398
+ export type PartDef = {
399
+ /** The component's box. */
400
+ sel: string;
401
+ /** Its text leaves (sites often put type on leaf spans); defaults to the box. */
402
+ text?: string;
403
+ /** Where a fill is painted when it is not the box itself. */
404
+ fill?: string;
405
+ /** Tokens the site cannot honor on this part (left out of the CSS). */
406
+ skip?: ReadonlyArray<keyof ComponentTokens>;
407
+ };
408
+ export type PartMap = Partial<Record<ComponentId, PartDef>>;
409
+ export type ComponentContext = {
410
+ /** Every role as `#rrggbb` (the theme's palette, legible). */
411
+ colors: RoleColors;
412
+ /** `font-family` per font role. */
413
+ fonts: Record<FontRoleName, string>;
414
+ };
415
+ /** The most readable of the theme's text-capable roles on `fill`. */
416
+ export declare function readableRole(fill: string, colors: RoleColors, preferred?: ColorRole): ColorRole;
417
+ /** A part rule's selector: two `:root`s lift it over the site's atomic classes and inline styles' non-important values. */
418
+ export declare const partRule: (selector: string) => string;
419
+ export type CompiledComponents = {
420
+ /** `--wb-part-*` declarations (for `:where(:root)`). */
421
+ values: string[];
422
+ /** Rules that read them. */
423
+ rules: string[];
424
+ /** What the contrast pass changed, for import notes and the builder's report. */
425
+ notes: string[];
426
+ };
427
+ /**
428
+ * CSS for a theme's components over a site's part map. A component without a part, and a token the
429
+ * part skips, emits nothing. Text on a fill the theme chose is held to the component's contrast
430
+ * (the text role is swapped for the most readable one); sizes stay at or above a 24px target.
431
+ */
432
+ export declare function compileComponents(components: ThemeComponents, parts: PartMap, ctx: ComponentContext): CompiledComponents;
433
+ /** The `colors.actions` group: the colors of an on state (liked, reposted, bookmarked) and of the reply hover. */
434
+ export declare const ACTION_NAMES: readonly ["reply", "repost", "like", "bookmark"];
435
+ export type ActionColors = Partial<Record<typeof ACTION_NAMES[number], string>>;