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,463 @@
1
+ // Component tokens: the part of a theme that says how each piece of the site is built (a button's
2
+ // radius and border, a post's padding and fill, the size and case of a handle), instead of one radius
3
+ // and one density for everything. A theme names generic components (`post`, `buttonPrimary`,
4
+ // `navItem`); the site adapter says which selectors they are (its part map). Pure.
5
+ //
6
+ // Safety is the same as the rest of a theme document: every token is a clamped number, a fixed word
7
+ // or a color role name. No token carries CSS text, a selector or a color literal, so one contrast
8
+ // pass over the palette covers every component, and the CSS is built from the vocabulary below.
9
+ //
10
+ // How it lands in the page: values are custom properties at zero specificity
11
+ // (`:where(:root){--wb-part-post-radius:0px}`), rules are rigid (`:root:root <part>{border-radius:
12
+ // var(--wb-part-post-radius) !important}`). An owner's Custom CSS or a plugin overrides a value by
13
+ // setting the variable, for the whole page or for one subtree, without fighting `!important`.
14
+ //
15
+ // The bevel borders (`bevel-out`, `bevel-in`) follow 98.css's raised and sunken edges (MIT, Jordan
16
+ // Scales, https://github.com/jdan/98.css): four inset shadows, here computed from the theme's roles.
17
+ import { contrastRatio, hexToRgb, mix, relativeLuminance } from "./themeApi.js";
18
+ // ---------------------------------------------------------------------------------------------
19
+ // Vocabulary
20
+ /** Color roles a component may name. `onAccent` is the readable label on the accent. */
21
+ export const COLOR_ROLES = ['bg', 'surface', 'elevated', 'page', 'border', 'text', 'muted', 'accent', 'onAccent', 'inverse', 'onInverse'];
22
+ export const BORDER_STYLES = ['none', 'solid', 'dashed', 'dotted', 'double', 'bevel-out', 'bevel-in'];
23
+ export const SHADOWS = ['none', 'soft', 'deep', 'hard', 'inset', 'glow'];
24
+ export const CASES = ['none', 'upper', 'lower', 'capitalize', 'small-caps'];
25
+ export const AVATAR_SHAPES = ['circle', 'rounded', 'square', 'squircle', 'hexagon', 'octagon', 'diamond'];
26
+ export const CORNERS = ['round', 'cut'];
27
+ const FONT_ROLES = ['interface', 'post', 'heading', 'numbers', 'mono', 'chrome', 'dialog'];
28
+ const LABEL = [12, 20];
29
+ const SMALL = [11, 18];
30
+ /** Every component a theme can name. Sites map them to selectors; a component a site does not have is ignored. */
31
+ export const COMPONENTS = {
32
+ nav: { width: [56, 320], glass: true, gradient: true },
33
+ navItem: { height: [36, 64], fontSize: LABEL, text: true },
34
+ topBar: { height: [40, 64], glass: true, gradient: true, fontSize: LABEL },
35
+ tabs: { presets: 'tabs', gradient: true },
36
+ tab: { height: [32, 56], fontSize: LABEL, text: true, presets: 'tabs' },
37
+ post: { corner: true, presets: 'post', contrast: 7 },
38
+ avatar: { size: [20, 64], shape: true, visible: true },
39
+ displayName: { text: true, fontSize: LABEL, visible: true },
40
+ handle: { text: true, fontSize: SMALL, visible: true },
41
+ postText: { text: true, fontSize: [13, 24], contrast: 7 },
42
+ meta: { text: true, fontSize: SMALL },
43
+ actionBar: {},
44
+ action: { size: [28, 44] },
45
+ count: { text: true, fontSize: SMALL, visible: true },
46
+ media: { corner: true, maxHeight: [200, 700] },
47
+ linkCard: { corner: true },
48
+ quote: {},
49
+ button: { height: [24, 56], fontSize: LABEL, text: true, gradient: true, presets: 'button' },
50
+ buttonPrimary: { parent: 'button', height: [24, 56], fontSize: LABEL, text: true, gradient: true, presets: 'button' },
51
+ buttonSecondary: { parent: 'button', height: [24, 56], fontSize: LABEL, text: true, gradient: true, presets: 'button' },
52
+ buttonGhost: { parent: 'button', height: [24, 56], fontSize: LABEL, text: true, gradient: true, presets: 'button' },
53
+ input: { height: [32, 56], fontSize: LABEL, text: true, presets: 'input' },
54
+ search: { height: [32, 56], fontSize: LABEL, text: true, presets: 'input' },
55
+ composer: { fontSize: [13, 24], text: true },
56
+ /** The tool icons under a composer (media, poll, emoji); `text` is their color. */
57
+ composerTool: { size: [28, 44] },
58
+ panel: { glass: true, presets: 'panel' },
59
+ menu: { parent: 'panel', glass: true, presets: 'panel' },
60
+ dialog: { parent: 'panel', glass: true, presets: 'panel' },
61
+ toast: { parent: 'panel', glass: true, presets: 'panel' },
62
+ hoverCard: { parent: 'panel', glass: true, presets: 'panel' },
63
+ sidebarCard: { parent: 'panel', glass: true, corner: true, presets: 'panel' },
64
+ badge: { size: [14, 24], corner: true, fontSize: SMALL, text: true },
65
+ pill: { fontSize: SMALL, text: true },
66
+ divider: {},
67
+ scrollbar: {},
68
+ profileHeader: {},
69
+ };
70
+ export const COMPONENT_IDS = Object.keys(COMPONENTS);
71
+ /** Clamp ranges of the tokens every component shares (the JSON Schema says the same; tested). */
72
+ export const TOKEN_LIMITS = {
73
+ radius: [0, 32], borderWidth: [0, 4], padX: [0, 32], padY: [0, 32], gap: [0, 24], weight: [100, 900],
74
+ tracking: [-0.05, 0.2], leading: [1.1, 2], angle: [0, 360], lift: [0, 4], scale: [0.96, 1.04],
75
+ };
76
+ /** Named token bundles per family; a theme's own tokens win over its preset's. Frozen once shipped. */
77
+ export const PRESETS = {
78
+ button: {
79
+ pill: { radius: 'pill', borderWidth: 0 },
80
+ soft: { radius: 8, borderWidth: 0 },
81
+ square: { radius: 0, borderWidth: 1, borderStyle: 'solid' },
82
+ outline: { radius: 6, borderWidth: 1, borderStyle: 'solid', fill: 'transparent', text: 'text', borderColor: 'border' },
83
+ bevel: { radius: 0, borderStyle: 'bevel-out', fill: 'surface', text: 'text', active: { shadow: 'inset' } },
84
+ gloss: { radius: 'pill', borderWidth: 1, borderStyle: 'solid', shadow: 'soft' },
85
+ 'flat-link': { radius: 0, borderWidth: 0, fill: 'transparent', text: 'accent', hover: { underline: true } },
86
+ },
87
+ post: {
88
+ flat: { radius: 0, borderWidth: 0, fill: 'transparent', shadow: 'none' },
89
+ card: { radius: 14, borderWidth: 1, borderStyle: 'solid', borderColor: 'border', fill: 'surface' },
90
+ bubble: { radius: 20, borderWidth: 0, fill: 'surface' },
91
+ window: { radius: 0, borderStyle: 'bevel-out', fill: 'surface' },
92
+ ruled: { radius: 0, borderWidth: 0, fill: 'transparent' },
93
+ },
94
+ input: {
95
+ pill: { radius: 'pill', borderWidth: 1, borderStyle: 'solid', borderColor: 'border' },
96
+ underline: { radius: 0, borderWidth: 0, fill: 'transparent' },
97
+ sunken: { radius: 0, borderStyle: 'bevel-in', fill: 'bg', text: 'text' },
98
+ boxed: { radius: 4, borderWidth: 1, borderStyle: 'solid', borderColor: 'border', fill: 'bg' },
99
+ },
100
+ panel: {
101
+ sheet: { radius: 12, borderWidth: 1, borderStyle: 'solid', borderColor: 'border', fill: 'surface', shadow: 'soft' },
102
+ window: { radius: 0, borderStyle: 'bevel-out', fill: 'surface', shadow: 'none' },
103
+ glass: { radius: 16, borderWidth: 1, borderStyle: 'solid', borderColor: 'border', fill: 'glass', shadow: 'soft' },
104
+ },
105
+ tabs: {
106
+ underline: { radius: 0 },
107
+ pills: { radius: 'pill' },
108
+ folder: { radius: 6, borderWidth: 1, borderStyle: 'solid', borderColor: 'border' },
109
+ blocks: { radius: 0, borderWidth: 1, borderStyle: 'solid', borderColor: 'border' },
110
+ },
111
+ };
112
+ // ---------------------------------------------------------------------------------------------
113
+ // Sanitizing
114
+ const obj = (value) => value && typeof value === 'object' && !Array.isArray(value) ? value : {};
115
+ const finite = (value) => typeof value === 'number' && Number.isFinite(value);
116
+ const clamp = (value, [min, max]) => Math.min(max, Math.max(min, value));
117
+ const oneOf = (value, options) => options.includes(value) ? value : undefined;
118
+ const role = (value) => oneOf(value, COLOR_ROLES);
119
+ function sanitizeFill(value, def) {
120
+ if (value === 'transparent')
121
+ return 'transparent';
122
+ if (value === 'glass')
123
+ return def.glass ? 'glass' : undefined;
124
+ const named = role(value);
125
+ if (named)
126
+ return named;
127
+ const source = obj(value);
128
+ const from = role(source.from), to = role(source.to);
129
+ if (def.gradient && from && to)
130
+ return { from, to, angle: Math.round(clamp(finite(source.angle) ? source.angle : 180, TOKEN_LIMITS.angle)) };
131
+ return undefined;
132
+ }
133
+ function sanitizeState(value, def) {
134
+ const source = obj(value);
135
+ const out = {};
136
+ const fill = sanitizeFill(source.fill, def);
137
+ if (fill !== undefined)
138
+ out.fill = fill;
139
+ const text = role(source.text);
140
+ if (text)
141
+ out.text = text;
142
+ const borderColor = role(source.borderColor);
143
+ if (borderColor)
144
+ out.borderColor = borderColor;
145
+ const shadow = oneOf(source.shadow, SHADOWS);
146
+ if (shadow)
147
+ out.shadow = shadow;
148
+ if (finite(source.lift))
149
+ out.lift = +clamp(source.lift, TOKEN_LIMITS.lift).toFixed(1);
150
+ if (finite(source.scale))
151
+ out.scale = +clamp(source.scale, TOKEN_LIMITS.scale).toFixed(3);
152
+ if (typeof source.underline === 'boolean')
153
+ out.underline = source.underline;
154
+ return Object.keys(out).length ? out : undefined;
155
+ }
156
+ /** One component's tokens from JSON: clamped, unknown names and tokens the component does not take dropped. */
157
+ export function sanitizeComponentTokens(id, value) {
158
+ const def = COMPONENTS[id];
159
+ const source = obj(value);
160
+ const out = {};
161
+ if (def.presets && typeof source.preset === 'string' && Object.hasOwn(PRESETS[def.presets], source.preset))
162
+ out.preset = source.preset;
163
+ if (source.radius === 'pill')
164
+ out.radius = 'pill';
165
+ else if (finite(source.radius))
166
+ out.radius = Math.round(clamp(source.radius, TOKEN_LIMITS.radius));
167
+ if (finite(source.borderWidth))
168
+ out.borderWidth = +clamp(source.borderWidth, TOKEN_LIMITS.borderWidth).toFixed(1);
169
+ const borderStyle = oneOf(source.borderStyle, BORDER_STYLES);
170
+ if (borderStyle)
171
+ out.borderStyle = borderStyle;
172
+ const borderColor = role(source.borderColor);
173
+ if (borderColor)
174
+ out.borderColor = borderColor;
175
+ const fill = sanitizeFill(source.fill, def);
176
+ if (fill !== undefined)
177
+ out.fill = fill;
178
+ const text = role(source.text);
179
+ if (text)
180
+ out.text = text;
181
+ for (const key of ['padX', 'padY', 'gap'])
182
+ if (finite(source[key]))
183
+ out[key] = Math.round(clamp(source[key], TOKEN_LIMITS[key]));
184
+ for (const key of ['height', 'width', 'size', 'maxHeight', 'fontSize']) {
185
+ const range = def[key];
186
+ if (range && finite(source[key]))
187
+ out[key] = Math.round(clamp(source[key], range));
188
+ }
189
+ if (def.text || def.fontSize) {
190
+ const font = oneOf(source.font, FONT_ROLES);
191
+ if (font)
192
+ out.font = font;
193
+ if (finite(source.weight))
194
+ out.weight = Math.round(clamp(source.weight, TOKEN_LIMITS.weight) / 50) * 50;
195
+ const textCase = oneOf(source.case, CASES);
196
+ if (textCase && id !== 'postText')
197
+ out.case = textCase;
198
+ if (finite(source.tracking))
199
+ out.tracking = +clamp(source.tracking, TOKEN_LIMITS.tracking).toFixed(3);
200
+ if (finite(source.leading))
201
+ out.leading = +clamp(source.leading, TOKEN_LIMITS.leading).toFixed(2);
202
+ }
203
+ const shadow = oneOf(source.shadow, SHADOWS);
204
+ if (shadow)
205
+ out.shadow = shadow;
206
+ if (def.shape) {
207
+ const shape = oneOf(source.shape, AVATAR_SHAPES);
208
+ if (shape)
209
+ out.shape = shape;
210
+ }
211
+ if (def.corner) {
212
+ const corner = oneOf(source.corner, CORNERS);
213
+ if (corner)
214
+ out.corner = corner;
215
+ }
216
+ if (def.visible && typeof source.visible === 'boolean')
217
+ out.visible = source.visible;
218
+ for (const state of ['hover', 'active', 'focus']) {
219
+ const tokens = sanitizeState(source[state], def);
220
+ if (tokens)
221
+ out[state] = tokens;
222
+ }
223
+ return Object.keys(out).length ? out : undefined;
224
+ }
225
+ /** The `components` group from JSON. Null when nothing valid is left (the theme sets no component). */
226
+ export function sanitizeComponents(value) {
227
+ const source = obj(value);
228
+ const out = {};
229
+ for (const id of COMPONENT_IDS) {
230
+ if (!Object.hasOwn(source, id))
231
+ continue;
232
+ const tokens = sanitizeComponentTokens(id, source[id]);
233
+ if (tokens)
234
+ out[id] = tokens;
235
+ }
236
+ return Object.keys(out).length ? out : null;
237
+ }
238
+ /** Every component with its preset and its parent's tokens folded in (own tokens win, then the preset, then the parent). */
239
+ export function resolveComponents(components) {
240
+ const expand = (id, tokens) => {
241
+ if (!tokens)
242
+ return {};
243
+ const def = COMPONENTS[id];
244
+ const preset = tokens.preset && def.presets ? PRESETS[def.presets][tokens.preset] : undefined;
245
+ const { preset: _name, ...own } = tokens;
246
+ return { ...preset, ...own };
247
+ };
248
+ const out = {};
249
+ for (const id of COMPONENT_IDS) {
250
+ const def = COMPONENTS[id];
251
+ const parent = def.parent;
252
+ const inherited = parent ? expand(parent, components[parent]) : {};
253
+ const merged = { ...inherited, ...expand(id, components[id]) };
254
+ if (Object.keys(merged).length)
255
+ out[id] = merged;
256
+ }
257
+ return out;
258
+ }
259
+ const rgba = (hex, alpha) => `rgba(${hexToRgb(hex).join(', ')}, ${alpha})`;
260
+ const dark = (hex) => relativeLuminance(hex) < 0.18;
261
+ /** The most readable of the theme's text-capable roles on `fill`. */
262
+ export function readableRole(fill, colors, preferred) {
263
+ const candidates = ['text', 'onAccent', 'onInverse', 'bg', 'inverse'];
264
+ if (preferred && !candidates.includes(preferred))
265
+ candidates.unshift(preferred);
266
+ return candidates.reduce((best, candidate) => contrastRatio(colors[candidate], fill) > contrastRatio(colors[best], fill) ? candidate : best, preferred ?? 'text');
267
+ }
268
+ function fillCss(fill, colors) {
269
+ if (fill === 'transparent')
270
+ return { decl: [['background-color', 'transparent'], ['background-image', 'none']], solid: null };
271
+ if (fill === 'glass')
272
+ return { decl: [['background-color', rgba(colors.surface, 0.72)], ['backdrop-filter', 'blur(14px) saturate(1.4)'], ['-webkit-backdrop-filter', 'blur(14px) saturate(1.4)']], solid: colors.surface };
273
+ if (typeof fill === 'string')
274
+ return { decl: [['background-color', colors[fill]], ['background-image', 'none']], solid: colors[fill] };
275
+ // A gradient is judged at its less readable end: the midpoint stands in for both when choosing a label.
276
+ return { decl: [['background-color', colors[fill.to]], ['background-image', `linear-gradient(${fill.angle}deg, ${colors[fill.from]}, ${colors[fill.to]})`]], solid: mix(colors[fill.from], colors[fill.to], 0.5) };
277
+ }
278
+ /** Raised and sunken edges after 98.css: two light and two dark inset lines, from the part's own fill. */
279
+ function bevel(out, face) {
280
+ const light = mix(face, '#ffffff', 0.85), soft = mix(face, '#ffffff', 0.35), shade = mix(face, '#000000', 0.35), deep = mix(face, '#000000', 0.9);
281
+ return out
282
+ ? `inset -1px -1px ${deep}, inset 1px 1px ${light}, inset -2px -2px ${shade}, inset 2px 2px ${soft}`
283
+ : `inset -1px -1px ${light}, inset 1px 1px ${shade}, inset -2px -2px ${soft}, inset 2px 2px ${deep}`;
284
+ }
285
+ function shadowCss(name, colors) {
286
+ const base = dark(colors.bg);
287
+ switch (name) {
288
+ case 'soft': return base ? `0 1px 2px ${rgba('#000000', 0.4)}, 0 8px 24px ${rgba('#000000', 0.35)}` : `0 1px 2px ${rgba('#000000', 0.06)}, 0 8px 24px ${rgba('#000000', 0.1)}`;
289
+ case 'deep': return `0 0 0 1px ${rgba(colors.border, 0.6)}, 0 24px 64px ${rgba('#000000', base ? 0.6 : 0.28)}`;
290
+ case 'hard': return `4px 4px 0 ${colors.accent}`;
291
+ case 'inset': return `inset 1px 1px 3px ${rgba('#000000', base ? 0.6 : 0.25)}`;
292
+ case 'glow': return `0 0 0 1px ${rgba(colors.accent, 0.5)}, 0 0 18px ${rgba(colors.accent, 0.35)}`;
293
+ default: return 'none';
294
+ }
295
+ }
296
+ const SHAPES = {
297
+ circle: [['border-radius', '50%']],
298
+ rounded: [['border-radius', '26%']],
299
+ square: [['border-radius', '2px']],
300
+ squircle: [['border-radius', '34%']],
301
+ hexagon: [['border-radius', '0'], ['clip-path', 'polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%)']],
302
+ octagon: [['border-radius', '0'], ['clip-path', 'polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%)']],
303
+ diamond: [['border-radius', '0'], ['clip-path', 'polygon(50% 0, 100% 50%, 50% 100%, 0 50%)']],
304
+ };
305
+ const CASE_CSS = {
306
+ none: [['text-transform', 'none'], ['font-variant-caps', 'normal']],
307
+ upper: [['text-transform', 'uppercase']],
308
+ lower: [['text-transform', 'lowercase']],
309
+ capitalize: [['text-transform', 'capitalize']],
310
+ 'small-caps': [['text-transform', 'none'], ['font-variant-caps', 'all-small-caps']],
311
+ };
312
+ /** A part rule's selector: two `:root`s lift it over the site's atomic classes and inline styles' non-important values. */
313
+ export const partRule = (selector) => selector.split(/,(?![^(]*\))/).map(one => `:root:root ${one.trim()}`).join(',');
314
+ /**
315
+ * CSS for a theme's components over a site's part map. A component without a part, and a token the
316
+ * part skips, emits nothing. Text on a fill the theme chose is held to the component's contrast
317
+ * (the text role is swapped for the most readable one); sizes stay at or above a 24px target.
318
+ */
319
+ export function compileComponents(components, parts, ctx) {
320
+ const values = [], rules = [], notes = [];
321
+ const resolved = resolveComponents(components);
322
+ for (const id of COMPONENT_IDS) {
323
+ const tokens = resolved[id], part = parts[id];
324
+ if (!tokens || !part)
325
+ continue;
326
+ const def = COMPONENTS[id];
327
+ const skip = new Set(part.skip ?? []);
328
+ const has = (key) => tokens[key] !== undefined && !skip.has(key);
329
+ const box = [], type = [], fillRule = [];
330
+ const put = (list, token, property, value) => {
331
+ const name = `--wb-part-${id}-${token}`;
332
+ if (!values.some(item => item.startsWith(`${name}:`)))
333
+ values.push(`${name}:${value}`);
334
+ list.push(`${property}:var(${name}) !important`);
335
+ };
336
+ // Fill first: the text role depends on it.
337
+ let face = null;
338
+ if (has('fill')) {
339
+ const { decl, solid } = fillCss(tokens.fill, ctx.colors);
340
+ face = solid;
341
+ decl.forEach(([property, value], index) => put(part.fill ? fillRule : box, `fill${index ? `-${index}` : ''}`, property, value));
342
+ }
343
+ let textRole = has('text') ? tokens.text : undefined;
344
+ if (face && (def.text || textRole)) {
345
+ const need = def.contrast ?? 4.5;
346
+ if (!textRole || contrastRatio(ctx.colors[textRole], face) < need) {
347
+ const readable = readableRole(face, ctx.colors, textRole);
348
+ if (textRole && readable !== textRole)
349
+ notes.push(`${id}: text "${textRole}" on its fill is under ${need}:1, using "${readable}"`);
350
+ textRole = readable;
351
+ }
352
+ }
353
+ if (textRole)
354
+ put(type, 'text', 'color', ctx.colors[textRole]);
355
+ if (has('radius'))
356
+ put(box, 'radius', 'border-radius', tokens.radius === 'pill' ? '9999px' : `${tokens.radius}px`);
357
+ const style = has('borderStyle') ? tokens.borderStyle : undefined;
358
+ if (style === 'bevel-out' || style === 'bevel-in') {
359
+ const base = face ?? ctx.colors.surface;
360
+ put(box, 'border-style', 'border-style', 'none');
361
+ put(box, 'bevel', 'box-shadow', bevel(style === 'bevel-out', base));
362
+ }
363
+ else {
364
+ if (style)
365
+ put(box, 'border-style', 'border-style', style);
366
+ if (has('borderWidth'))
367
+ put(box, 'border-width', 'border-width', `${tokens.borderWidth}px`);
368
+ // A width without a style would draw nothing: X's boxes are `border: 0 solid`.
369
+ if (has('borderWidth') && !style && tokens.borderWidth > 0)
370
+ put(box, 'border-style', 'border-style', 'solid');
371
+ if (has('shadow'))
372
+ put(box, 'shadow', 'box-shadow', shadowCss(tokens.shadow, ctx.colors));
373
+ }
374
+ if (has('borderColor'))
375
+ put(box, 'border-color', 'border-color', ctx.colors[tokens.borderColor]);
376
+ if (has('padX'))
377
+ put(box, 'pad-x', 'padding-inline', `${tokens.padX}px`);
378
+ if (has('padY'))
379
+ put(box, 'pad-y', 'padding-block', `${tokens.padY}px`);
380
+ if (has('gap'))
381
+ put(box, 'gap', 'gap', `${tokens.gap}px`);
382
+ if (has('height'))
383
+ put(box, 'height', 'min-height', `${Math.max(24, tokens.height)}px`);
384
+ if (has('width'))
385
+ put(box, 'width', 'width', `${tokens.width}px`);
386
+ if (has('size')) {
387
+ put(box, 'size', 'width', `${tokens.size}px`);
388
+ box.push(`height:var(--wb-part-${id}-size) !important`);
389
+ }
390
+ if (has('maxHeight'))
391
+ put(box, 'max-height', 'max-height', `${tokens.maxHeight}px`);
392
+ if (has('shape'))
393
+ SHAPES[tokens.shape].forEach(([property, value], index) => put(box, `shape${index ? `-${index}` : ''}`, property, value));
394
+ if (has('corner') && tokens.corner === 'cut')
395
+ put(box, 'corner', 'clip-path', 'polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px))');
396
+ if (has('visible') && tokens.visible === false)
397
+ put(box, 'display', 'display', 'none');
398
+ if (has('font'))
399
+ put(type, 'font', 'font-family', ctx.fonts[tokens.font]);
400
+ if (has('fontSize')) {
401
+ put(type, 'font-size', 'font-size', `${tokens.fontSize}px`);
402
+ put(type, 'line-height', 'line-height', String(tokens.leading ?? 1.3));
403
+ }
404
+ else if (has('leading'))
405
+ put(type, 'line-height', 'line-height', String(tokens.leading));
406
+ if (has('weight'))
407
+ put(type, 'weight', 'font-weight', String(tokens.weight));
408
+ if (has('case'))
409
+ CASE_CSS[tokens.case].forEach(([property, value], index) => put(type, `case${index ? `-${index}` : ''}`, property, value));
410
+ if (has('tracking'))
411
+ put(type, 'tracking', 'letter-spacing', `${tokens.tracking}em`);
412
+ const textSel = part.text ?? part.sel;
413
+ if (box.length)
414
+ rules.push(`${partRule(part.sel)}{${box.join(';')}}`);
415
+ if (fillRule.length)
416
+ rules.push(`${partRule(part.fill)}{${fillRule.join(';')}}`);
417
+ if (type.length)
418
+ rules.push(`${partRule(textSel)}{${type.join(';')}}`);
419
+ for (const state of ['hover', 'active', 'focus']) {
420
+ const tokensOf = tokens[state];
421
+ if (!tokensOf || skip.has(state))
422
+ continue;
423
+ const pseudo = state === 'focus' ? ':focus-visible' : `:${state}`;
424
+ const still = [], moving = [], label = [];
425
+ let stateFace = face;
426
+ if (tokensOf.fill !== undefined) {
427
+ const { decl, solid } = fillCss(tokensOf.fill, ctx.colors);
428
+ stateFace = solid ?? face;
429
+ for (const [property, value] of decl)
430
+ still.push(`${property}:${value} !important`);
431
+ }
432
+ let stateText = tokensOf.text;
433
+ if (stateFace && (stateText || tokensOf.fill !== undefined) && (def.text || stateText)) {
434
+ if (!stateText || contrastRatio(ctx.colors[stateText], stateFace) < (def.contrast ?? 4.5))
435
+ stateText = readableRole(stateFace, ctx.colors, stateText);
436
+ }
437
+ if (stateText)
438
+ label.push(`color:${ctx.colors[stateText]} !important`);
439
+ if (tokensOf.underline !== undefined)
440
+ label.push(`text-decoration:${tokensOf.underline ? 'underline' : 'none'} !important`);
441
+ if (tokensOf.borderColor)
442
+ still.push(`border-color:${ctx.colors[tokensOf.borderColor]} !important`);
443
+ if (tokensOf.shadow)
444
+ still.push(`box-shadow:${tokensOf.shadow === 'inset' && (style === 'bevel-out' || style === 'bevel-in') ? bevel(false, face ?? ctx.colors.surface) : shadowCss(tokensOf.shadow, ctx.colors)} !important`);
445
+ const transforms = [tokensOf.lift ? `translateY(-${tokensOf.lift}px)` : '', tokensOf.scale && tokensOf.scale !== 1 ? `scale(${tokensOf.scale})` : ''].filter(Boolean);
446
+ if (transforms.length)
447
+ moving.push(`transform:${transforms.join(' ')} !important`);
448
+ const stateSel = (selector) => selector.split(/,(?![^(]*\))/).map(one => `${one.trim()}${pseudo}`).join(',');
449
+ if (still.length)
450
+ rules.push(`${partRule(stateSel(part.sel))}{${still.join(';')}}`);
451
+ // The label of a hovered or pressed part: the box and the text leaves under it.
452
+ if (label.length)
453
+ rules.push(`${partRule(`${stateSel(part.sel)},${part.sel.split(/,(?![^(]*\))/).map(one => `${one.trim()}${pseudo} :is(span,div,a)`).join(',')}`)}{${label.join(';')}}`);
454
+ // Movement only for people who have not asked for less of it.
455
+ if (moving.length)
456
+ rules.push(`@media (prefers-reduced-motion:no-preference){${partRule(stateSel(part.sel))}{${moving.join(';')}}}`);
457
+ }
458
+ }
459
+ return { values, rules, notes };
460
+ }
461
+ /** The `colors.actions` group: the colors of an on state (liked, reposted, bookmarked) and of the reply hover. */
462
+ export const ACTION_NAMES = ['reply', 'repost', 'like', 'bookmark'];
463
+ //# sourceMappingURL=themeComponents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeComponents.js","sourceRoot":"","sources":["../../../runtime/src/theme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border, a post's padding and fill, the size and case of a handle), instead of one radius\n// and one density for everything. A theme names generic components (`post`, `buttonPrimary`,\n// `navItem`); the site adapter says which selectors they are (its part map). Pure.\n//\n// Safety is the same as the rest of a theme document: every token is a clamped number, a fixed word\n// or a color role name. No token carries CSS text, a selector or a color literal, so one contrast\n// pass over the palette covers every component, and the CSS is built from the vocabulary below.\n//\n// How it lands in the page: values are custom properties at zero specificity\n// (`:where(:root){--wb-part-post-radius:0px}`), rules are rigid (`:root:root <part>{border-radius:\n// var(--wb-part-post-radius) !important}`). An owner's Custom CSS or a plugin overrides a value by\n// setting the variable, for the whole page or for one subtree, without fighting `!important`.\n//\n// The bevel borders (`bevel-out`, `bevel-in`) follow 98.css's raised and sunken edges (MIT, Jordan\n// Scales, https://github.com/jdan/98.css): four inset shadows, here computed from the theme's roles.\n\nimport { contrastRatio, hexToRgb, mix, relativeLuminance, type FontRoleName } from './themeApi.ts';\n\n// ---------------------------------------------------------------------------------------------\n// Vocabulary\n\n/** Color roles a component may name. `onAccent` is the readable label on the accent. */\nexport const COLOR_ROLES = ['bg', 'surface', 'elevated', 'page', 'border', 'text', 'muted', 'accent', 'onAccent', 'inverse', 'onInverse'] as const;\nexport type ColorRole = typeof COLOR_ROLES[number];\nexport type RoleColors = Record<ColorRole, string>;\n\nexport const BORDER_STYLES = ['none', 'solid', 'dashed', 'dotted', 'double', 'bevel-out', 'bevel-in'] as const;\nexport const SHADOWS = ['none', 'soft', 'deep', 'hard', 'inset', 'glow'] as const;\nexport const CASES = ['none', 'upper', 'lower', 'capitalize', 'small-caps'] as const;\nexport const AVATAR_SHAPES = ['circle', 'rounded', 'square', 'squircle', 'hexagon', 'octagon', 'diamond'] as const;\nexport const CORNERS = ['round', 'cut'] as const;\nconst FONT_ROLES: readonly FontRoleName[] = ['interface', 'post', 'heading', 'numbers', 'mono', 'chrome', 'dialog'];\n\nexport type Gradient = { from: ColorRole; to: ColorRole; angle: number };\nexport type Fill = ColorRole | 'transparent' | 'glass' | Gradient;\nexport type StateTokens = { fill?: Fill; text?: ColorRole; borderColor?: ColorRole; shadow?: typeof SHADOWS[number]; lift?: number; scale?: number; underline?: boolean };\nexport type ComponentTokens = {\n preset?: string;\n radius?: number | 'pill';\n borderWidth?: number;\n borderStyle?: typeof BORDER_STYLES[number];\n borderColor?: ColorRole;\n fill?: Fill;\n text?: ColorRole;\n padX?: number;\n padY?: number;\n gap?: number;\n height?: number;\n width?: number;\n size?: number;\n maxHeight?: number;\n font?: FontRoleName;\n fontSize?: number;\n weight?: number;\n case?: typeof CASES[number];\n tracking?: number;\n leading?: number;\n shadow?: typeof SHADOWS[number];\n shape?: typeof AVATAR_SHAPES[number];\n corner?: typeof CORNERS[number];\n visible?: boolean;\n hover?: StateTokens;\n active?: StateTokens;\n focus?: StateTokens;\n};\n\ntype ComponentDef = {\n /** Tokens set on the parent apply to this component too. */\n parent?: string;\n /** A text part: type tokens land on its leaves. */\n text?: boolean;\n /** Size ranges in px (absent: the token is not accepted on this component). */\n height?: [number, number]; width?: [number, number]; size?: [number, number]; maxHeight?: [number, number]; fontSize?: [number, number];\n /** Tokens only some components take. */\n shape?: boolean; corner?: boolean; visible?: boolean;\n /** Glass fills (a blur) are allowed here; never on parts that repeat down a timeline. */\n glass?: boolean;\n /** Gradient fills are allowed here (bars and buttons). */\n gradient?: boolean;\n /** Presets of this component's family. */\n presets?: keyof typeof PRESETS;\n /** Contrast its text must reach on its own fill. */\n contrast?: number;\n};\n\nconst LABEL: [number, number] = [12, 20];\nconst SMALL: [number, number] = [11, 18];\n/** Every component a theme can name. Sites map them to selectors; a component a site does not have is ignored. */\nexport const COMPONENTS = {\n nav: { width: [56, 320], glass: true, gradient: true },\n navItem: { height: [36, 64], fontSize: LABEL, text: true },\n topBar: { height: [40, 64], glass: true, gradient: true, fontSize: LABEL },\n tabs: { presets: 'tabs', gradient: true },\n tab: { height: [32, 56], fontSize: LABEL, text: true, presets: 'tabs' },\n post: { corner: true, presets: 'post', contrast: 7 },\n avatar: { size: [20, 64], shape: true, visible: true },\n displayName: { text: true, fontSize: LABEL, visible: true },\n handle: { text: true, fontSize: SMALL, visible: true },\n postText: { text: true, fontSize: [13, 24], contrast: 7 },\n meta: { text: true, fontSize: SMALL },\n actionBar: {},\n action: { size: [28, 44] },\n count: { text: true, fontSize: SMALL, visible: true },\n media: { corner: true, maxHeight: [200, 700] },\n linkCard: { corner: true },\n quote: {},\n button: { height: [24, 56], fontSize: LABEL, text: true, gradient: true, presets: 'button' },\n buttonPrimary: { parent: 'button', height: [24, 56], fontSize: LABEL, text: true, gradient: true, presets: 'button' },\n buttonSecondary: { parent: 'button', height: [24, 56], fontSize: LABEL, text: true, gradient: true, presets: 'button' },\n buttonGhost: { parent: 'button', height: [24, 56], fontSize: LABEL, text: true, gradient: true, presets: 'button' },\n input: { height: [32, 56], fontSize: LABEL, text: true, presets: 'input' },\n search: { height: [32, 56], fontSize: LABEL, text: true, presets: 'input' },\n composer: { fontSize: [13, 24], text: true },\n /** The tool icons under a composer (media, poll, emoji); `text` is their color. */\n composerTool: { size: [28, 44] },\n panel: { glass: true, presets: 'panel' },\n menu: { parent: 'panel', glass: true, presets: 'panel' },\n dialog: { parent: 'panel', glass: true, presets: 'panel' },\n toast: { parent: 'panel', glass: true, presets: 'panel' },\n hoverCard: { parent: 'panel', glass: true, presets: 'panel' },\n sidebarCard: { parent: 'panel', glass: true, corner: true, presets: 'panel' },\n badge: { size: [14, 24], corner: true, fontSize: SMALL, text: true },\n pill: { fontSize: SMALL, text: true },\n divider: {},\n scrollbar: {},\n profileHeader: {},\n} as const satisfies Record<string, ComponentDef>;\nexport type ComponentId = keyof typeof COMPONENTS;\nexport const COMPONENT_IDS = Object.keys(COMPONENTS) as ComponentId[];\nexport type ThemeComponents = Partial<Record<ComponentId, ComponentTokens>>;\n\n/** Clamp ranges of the tokens every component shares (the JSON Schema says the same; tested). */\nexport const TOKEN_LIMITS = {\n radius: [0, 32], borderWidth: [0, 4], padX: [0, 32], padY: [0, 32], gap: [0, 24], weight: [100, 900],\n tracking: [-0.05, 0.2], leading: [1.1, 2], angle: [0, 360], lift: [0, 4], scale: [0.96, 1.04],\n} as const;\n\n/** Named token bundles per family; a theme's own tokens win over its preset's. Frozen once shipped. */\nexport const PRESETS = {\n button: {\n pill: { radius: 'pill', borderWidth: 0 },\n soft: { radius: 8, borderWidth: 0 },\n square: { radius: 0, borderWidth: 1, borderStyle: 'solid' },\n outline: { radius: 6, borderWidth: 1, borderStyle: 'solid', fill: 'transparent', text: 'text', borderColor: 'border' },\n bevel: { radius: 0, borderStyle: 'bevel-out', fill: 'surface', text: 'text', active: { shadow: 'inset' } },\n gloss: { radius: 'pill', borderWidth: 1, borderStyle: 'solid', shadow: 'soft' },\n 'flat-link': { radius: 0, borderWidth: 0, fill: 'transparent', text: 'accent', hover: { underline: true } },\n },\n post: {\n flat: { radius: 0, borderWidth: 0, fill: 'transparent', shadow: 'none' },\n card: { radius: 14, borderWidth: 1, borderStyle: 'solid', borderColor: 'border', fill: 'surface' },\n bubble: { radius: 20, borderWidth: 0, fill: 'surface' },\n window: { radius: 0, borderStyle: 'bevel-out', fill: 'surface' },\n ruled: { radius: 0, borderWidth: 0, fill: 'transparent' },\n },\n input: {\n pill: { radius: 'pill', borderWidth: 1, borderStyle: 'solid', borderColor: 'border' },\n underline: { radius: 0, borderWidth: 0, fill: 'transparent' },\n sunken: { radius: 0, borderStyle: 'bevel-in', fill: 'bg', text: 'text' },\n boxed: { radius: 4, borderWidth: 1, borderStyle: 'solid', borderColor: 'border', fill: 'bg' },\n },\n panel: {\n sheet: { radius: 12, borderWidth: 1, borderStyle: 'solid', borderColor: 'border', fill: 'surface', shadow: 'soft' },\n window: { radius: 0, borderStyle: 'bevel-out', fill: 'surface', shadow: 'none' },\n glass: { radius: 16, borderWidth: 1, borderStyle: 'solid', borderColor: 'border', fill: 'glass', shadow: 'soft' },\n },\n tabs: {\n underline: { radius: 0 },\n pills: { radius: 'pill' },\n folder: { radius: 6, borderWidth: 1, borderStyle: 'solid', borderColor: 'border' },\n blocks: { radius: 0, borderWidth: 1, borderStyle: 'solid', borderColor: 'border' },\n },\n} as const satisfies Record<string, Record<string, ComponentTokens>>;\n\n// ---------------------------------------------------------------------------------------------\n// Sanitizing\n\nconst obj = (value: unknown): Record<string, unknown> => value && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {};\nconst finite = (value: unknown): value is number => typeof value === 'number' && Number.isFinite(value);\nconst clamp = (value: number, [min, max]: readonly [number, number]) => Math.min(max, Math.max(min, value));\nconst oneOf = <T extends string>(value: unknown, options: readonly T[]): T | undefined => options.includes(value as T) ? value as T : undefined;\nconst role = (value: unknown) => oneOf(value, COLOR_ROLES);\n\nfunction sanitizeFill(value: unknown, def: ComponentDef): Fill | undefined {\n if (value === 'transparent') return 'transparent';\n if (value === 'glass') return def.glass ? 'glass' : undefined;\n const named = role(value);\n if (named) return named;\n const source = obj(value);\n const from = role(source.from), to = role(source.to);\n if (def.gradient && from && to) return { from, to, angle: Math.round(clamp(finite(source.angle) ? source.angle : 180, TOKEN_LIMITS.angle)) };\n return undefined;\n}\n\nfunction sanitizeState(value: unknown, def: ComponentDef): StateTokens | undefined {\n const source = obj(value);\n const out: StateTokens = {};\n const fill = sanitizeFill(source.fill, def); if (fill !== undefined) out.fill = fill;\n const text = role(source.text); if (text) out.text = text;\n const borderColor = role(source.borderColor); if (borderColor) out.borderColor = borderColor;\n const shadow = oneOf(source.shadow, SHADOWS); if (shadow) out.shadow = shadow;\n if (finite(source.lift)) out.lift = +clamp(source.lift, TOKEN_LIMITS.lift).toFixed(1);\n if (finite(source.scale)) out.scale = +clamp(source.scale, TOKEN_LIMITS.scale).toFixed(3);\n if (typeof source.underline === 'boolean') out.underline = source.underline;\n return Object.keys(out).length ? out : undefined;\n}\n\n/** One component's tokens from JSON: clamped, unknown names and tokens the component does not take dropped. */\nexport function sanitizeComponentTokens(id: ComponentId, value: unknown): ComponentTokens | undefined {\n const def: ComponentDef = COMPONENTS[id];\n const source = obj(value);\n const out: ComponentTokens = {};\n if (def.presets && typeof source.preset === 'string' && Object.hasOwn(PRESETS[def.presets], source.preset)) out.preset = source.preset;\n if (source.radius === 'pill') out.radius = 'pill';\n else if (finite(source.radius)) out.radius = Math.round(clamp(source.radius, TOKEN_LIMITS.radius));\n if (finite(source.borderWidth)) out.borderWidth = +clamp(source.borderWidth, TOKEN_LIMITS.borderWidth).toFixed(1);\n const borderStyle = oneOf(source.borderStyle, BORDER_STYLES); if (borderStyle) out.borderStyle = borderStyle;\n const borderColor = role(source.borderColor); if (borderColor) out.borderColor = borderColor;\n const fill = sanitizeFill(source.fill, def); if (fill !== undefined) out.fill = fill;\n const text = role(source.text); if (text) out.text = text;\n for (const key of ['padX', 'padY', 'gap'] as const) if (finite(source[key])) out[key] = Math.round(clamp(source[key] as number, TOKEN_LIMITS[key]));\n for (const key of ['height', 'width', 'size', 'maxHeight', 'fontSize'] as const) {\n const range = def[key];\n if (range && finite(source[key])) out[key] = Math.round(clamp(source[key] as number, range));\n }\n if (def.text || def.fontSize) {\n const font = oneOf(source.font, FONT_ROLES); if (font) out.font = font;\n if (finite(source.weight)) out.weight = Math.round(clamp(source.weight, TOKEN_LIMITS.weight) / 50) * 50;\n const textCase = oneOf(source.case, CASES); if (textCase && id !== 'postText') out.case = textCase;\n if (finite(source.tracking)) out.tracking = +clamp(source.tracking, TOKEN_LIMITS.tracking).toFixed(3);\n if (finite(source.leading)) out.leading = +clamp(source.leading, TOKEN_LIMITS.leading).toFixed(2);\n }\n const shadow = oneOf(source.shadow, SHADOWS); if (shadow) out.shadow = shadow;\n if (def.shape) { const shape = oneOf(source.shape, AVATAR_SHAPES); if (shape) out.shape = shape; }\n if (def.corner) { const corner = oneOf(source.corner, CORNERS); if (corner) out.corner = corner; }\n if (def.visible && typeof source.visible === 'boolean') out.visible = source.visible;\n for (const state of ['hover', 'active', 'focus'] as const) { const tokens = sanitizeState(source[state], def); if (tokens) out[state] = tokens; }\n return Object.keys(out).length ? out : undefined;\n}\n\n/** The `components` group from JSON. Null when nothing valid is left (the theme sets no component). */\nexport function sanitizeComponents(value: unknown): ThemeComponents | null {\n const source = obj(value);\n const out: ThemeComponents = {};\n for (const id of COMPONENT_IDS) {\n if (!Object.hasOwn(source, id)) continue;\n const tokens = sanitizeComponentTokens(id, source[id]);\n if (tokens) out[id] = tokens;\n }\n return Object.keys(out).length ? out : null;\n}\n\n/** Every component with its preset and its parent's tokens folded in (own tokens win, then the preset, then the parent). */\nexport function resolveComponents(components: ThemeComponents): ThemeComponents {\n const expand = (id: ComponentId, tokens: ComponentTokens | undefined): ComponentTokens => {\n if (!tokens) return {};\n const def: ComponentDef = COMPONENTS[id];\n const preset = tokens.preset && def.presets ? (PRESETS[def.presets] as Record<string, ComponentTokens>)[tokens.preset] : undefined;\n const { preset: _name, ...own } = tokens;\n return { ...preset, ...own };\n };\n const out: ThemeComponents = {};\n for (const id of COMPONENT_IDS) {\n const def: ComponentDef = COMPONENTS[id];\n const parent = def.parent as ComponentId | undefined;\n const inherited = parent ? expand(parent, components[parent]) : {};\n const merged = { ...inherited, ...expand(id, components[id]) };\n if (Object.keys(merged).length) out[id] = merged;\n }\n return out;\n}\n\n// ---------------------------------------------------------------------------------------------\n// Compiling\n\n/** A site's selectors for one component. */\nexport type PartDef = {\n /** The component's box. */\n sel: string;\n /** Its text leaves (sites often put type on leaf spans); defaults to the box. */\n text?: string;\n /** Where a fill is painted when it is not the box itself. */\n fill?: string;\n /** Tokens the site cannot honor on this part (left out of the CSS). */\n skip?: ReadonlyArray<keyof ComponentTokens>;\n};\nexport type PartMap = Partial<Record<ComponentId, PartDef>>;\n\nexport type ComponentContext = {\n /** Every role as `#rrggbb` (the theme's palette, legible). */\n colors: RoleColors;\n /** `font-family` per font role. */\n fonts: Record<FontRoleName, string>;\n};\n\nconst rgba = (hex: string, alpha: number) => `rgba(${hexToRgb(hex).join(', ')}, ${alpha})`;\nconst dark = (hex: string) => relativeLuminance(hex) < 0.18;\n\n/** The most readable of the theme's text-capable roles on `fill`. */\nexport function readableRole(fill: string, colors: RoleColors, preferred?: ColorRole): ColorRole {\n const candidates: ColorRole[] = ['text', 'onAccent', 'onInverse', 'bg', 'inverse'];\n if (preferred && !candidates.includes(preferred)) candidates.unshift(preferred);\n return candidates.reduce((best, candidate) => contrastRatio(colors[candidate], fill) > contrastRatio(colors[best], fill) ? candidate : best, preferred ?? 'text');\n}\n\nfunction fillCss(fill: Fill, colors: RoleColors): { decl: Array<[string, string]>; solid: string | null } {\n if (fill === 'transparent') return { decl: [['background-color', 'transparent'], ['background-image', 'none']], solid: null };\n if (fill === 'glass') return { decl: [['background-color', rgba(colors.surface, 0.72)], ['backdrop-filter', 'blur(14px) saturate(1.4)'], ['-webkit-backdrop-filter', 'blur(14px) saturate(1.4)']], solid: colors.surface };\n if (typeof fill === 'string') return { decl: [['background-color', colors[fill]], ['background-image', 'none']], solid: colors[fill] };\n // A gradient is judged at its less readable end: the midpoint stands in for both when choosing a label.\n return { decl: [['background-color', colors[fill.to]], ['background-image', `linear-gradient(${fill.angle}deg, ${colors[fill.from]}, ${colors[fill.to]})`]], solid: mix(colors[fill.from], colors[fill.to], 0.5) };\n}\n\n/** Raised and sunken edges after 98.css: two light and two dark inset lines, from the part's own fill. */\nfunction bevel(out: boolean, face: string): string {\n const light = mix(face, '#ffffff', 0.85), soft = mix(face, '#ffffff', 0.35), shade = mix(face, '#000000', 0.35), deep = mix(face, '#000000', 0.9);\n return out\n ? `inset -1px -1px ${deep}, inset 1px 1px ${light}, inset -2px -2px ${shade}, inset 2px 2px ${soft}`\n : `inset -1px -1px ${light}, inset 1px 1px ${shade}, inset -2px -2px ${soft}, inset 2px 2px ${deep}`;\n}\n\nfunction shadowCss(name: typeof SHADOWS[number], colors: RoleColors): string {\n const base = dark(colors.bg);\n switch (name) {\n case 'soft': return base ? `0 1px 2px ${rgba('#000000', 0.4)}, 0 8px 24px ${rgba('#000000', 0.35)}` : `0 1px 2px ${rgba('#000000', 0.06)}, 0 8px 24px ${rgba('#000000', 0.1)}`;\n case 'deep': return `0 0 0 1px ${rgba(colors.border, 0.6)}, 0 24px 64px ${rgba('#000000', base ? 0.6 : 0.28)}`;\n case 'hard': return `4px 4px 0 ${colors.accent}`;\n case 'inset': return `inset 1px 1px 3px ${rgba('#000000', base ? 0.6 : 0.25)}`;\n case 'glow': return `0 0 0 1px ${rgba(colors.accent, 0.5)}, 0 0 18px ${rgba(colors.accent, 0.35)}`;\n default: return 'none';\n }\n}\n\nconst SHAPES: Record<typeof AVATAR_SHAPES[number], Array<[string, string]>> = {\n circle: [['border-radius', '50%']],\n rounded: [['border-radius', '26%']],\n square: [['border-radius', '2px']],\n squircle: [['border-radius', '34%']],\n hexagon: [['border-radius', '0'], ['clip-path', 'polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%)']],\n octagon: [['border-radius', '0'], ['clip-path', 'polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%)']],\n diamond: [['border-radius', '0'], ['clip-path', 'polygon(50% 0, 100% 50%, 50% 100%, 0 50%)']],\n};\nconst CASE_CSS: Record<typeof CASES[number], Array<[string, string]>> = {\n none: [['text-transform', 'none'], ['font-variant-caps', 'normal']],\n upper: [['text-transform', 'uppercase']],\n lower: [['text-transform', 'lowercase']],\n capitalize: [['text-transform', 'capitalize']],\n 'small-caps': [['text-transform', 'none'], ['font-variant-caps', 'all-small-caps']],\n};\n\n/** A part rule's selector: two `:root`s lift it over the site's atomic classes and inline styles' non-important values. */\nexport const partRule = (selector: string) => selector.split(/,(?![^(]*\\))/).map(one => `:root:root ${one.trim()}`).join(',');\n\nexport type CompiledComponents = {\n /** `--wb-part-*` declarations (for `:where(:root)`). */\n values: string[];\n /** Rules that read them. */\n rules: string[];\n /** What the contrast pass changed, for import notes and the builder's report. */\n notes: string[];\n};\n\n/**\n * CSS for a theme's components over a site's part map. A component without a part, and a token the\n * part skips, emits nothing. Text on a fill the theme chose is held to the component's contrast\n * (the text role is swapped for the most readable one); sizes stay at or above a 24px target.\n */\nexport function compileComponents(components: ThemeComponents, parts: PartMap, ctx: ComponentContext): CompiledComponents {\n const values: string[] = [], rules: string[] = [], notes: string[] = [];\n const resolved = resolveComponents(components);\n for (const id of COMPONENT_IDS) {\n const tokens = resolved[id], part = parts[id];\n if (!tokens || !part) continue;\n const def: ComponentDef = COMPONENTS[id];\n const skip = new Set<string>(part.skip ?? []);\n const has = <K extends keyof ComponentTokens>(key: K): boolean => tokens[key] !== undefined && !skip.has(key);\n const box: string[] = [], type: string[] = [], fillRule: string[] = [];\n const put = (list: string[], token: string, property: string, value: string) => {\n const name = `--wb-part-${id}-${token}`;\n if (!values.some(item => item.startsWith(`${name}:`))) values.push(`${name}:${value}`);\n list.push(`${property}:var(${name}) !important`);\n };\n\n // Fill first: the text role depends on it.\n let face: string | null = null;\n if (has('fill')) {\n const { decl, solid } = fillCss(tokens.fill!, ctx.colors);\n face = solid;\n decl.forEach(([property, value], index) => put(part.fill ? fillRule : box, `fill${index ? `-${index}` : ''}`, property, value));\n }\n let textRole = has('text') ? tokens.text! : undefined;\n if (face && (def.text || textRole)) {\n const need = def.contrast ?? 4.5;\n if (!textRole || contrastRatio(ctx.colors[textRole], face) < need) {\n const readable = readableRole(face, ctx.colors, textRole);\n if (textRole && readable !== textRole) notes.push(`${id}: text \"${textRole}\" on its fill is under ${need}:1, using \"${readable}\"`);\n textRole = readable;\n }\n }\n if (textRole) put(type, 'text', 'color', ctx.colors[textRole]);\n\n if (has('radius')) put(box, 'radius', 'border-radius', tokens.radius === 'pill' ? '9999px' : `${tokens.radius}px`);\n const style = has('borderStyle') ? tokens.borderStyle! : undefined;\n if (style === 'bevel-out' || style === 'bevel-in') {\n const base = face ?? ctx.colors.surface;\n put(box, 'border-style', 'border-style', 'none');\n put(box, 'bevel', 'box-shadow', bevel(style === 'bevel-out', base));\n } else {\n if (style) put(box, 'border-style', 'border-style', style);\n if (has('borderWidth')) put(box, 'border-width', 'border-width', `${tokens.borderWidth}px`);\n // A width without a style would draw nothing: X's boxes are `border: 0 solid`.\n if (has('borderWidth') && !style && tokens.borderWidth! > 0) put(box, 'border-style', 'border-style', 'solid');\n if (has('shadow')) put(box, 'shadow', 'box-shadow', shadowCss(tokens.shadow!, ctx.colors));\n }\n if (has('borderColor')) put(box, 'border-color', 'border-color', ctx.colors[tokens.borderColor!]);\n if (has('padX')) put(box, 'pad-x', 'padding-inline', `${tokens.padX}px`);\n if (has('padY')) put(box, 'pad-y', 'padding-block', `${tokens.padY}px`);\n if (has('gap')) put(box, 'gap', 'gap', `${tokens.gap}px`);\n if (has('height')) put(box, 'height', 'min-height', `${Math.max(24, tokens.height!)}px`);\n if (has('width')) put(box, 'width', 'width', `${tokens.width}px`);\n if (has('size')) { put(box, 'size', 'width', `${tokens.size}px`); box.push(`height:var(--wb-part-${id}-size) !important`); }\n if (has('maxHeight')) put(box, 'max-height', 'max-height', `${tokens.maxHeight}px`);\n if (has('shape')) SHAPES[tokens.shape!].forEach(([property, value], index) => put(box, `shape${index ? `-${index}` : ''}`, property, value));\n if (has('corner') && tokens.corner === 'cut') put(box, 'corner', 'clip-path', 'polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px))');\n if (has('visible') && tokens.visible === false) put(box, 'display', 'display', 'none');\n\n if (has('font')) put(type, 'font', 'font-family', ctx.fonts[tokens.font!]);\n if (has('fontSize')) {\n put(type, 'font-size', 'font-size', `${tokens.fontSize}px`);\n put(type, 'line-height', 'line-height', String(tokens.leading ?? 1.3));\n } else if (has('leading')) put(type, 'line-height', 'line-height', String(tokens.leading));\n if (has('weight')) put(type, 'weight', 'font-weight', String(tokens.weight));\n if (has('case')) CASE_CSS[tokens.case!].forEach(([property, value], index) => put(type, `case${index ? `-${index}` : ''}`, property, value));\n if (has('tracking')) put(type, 'tracking', 'letter-spacing', `${tokens.tracking}em`);\n\n const textSel = part.text ?? part.sel;\n if (box.length) rules.push(`${partRule(part.sel)}{${box.join(';')}}`);\n if (fillRule.length) rules.push(`${partRule(part.fill!)}{${fillRule.join(';')}}`);\n if (type.length) rules.push(`${partRule(textSel)}{${type.join(';')}}`);\n\n for (const state of ['hover', 'active', 'focus'] as const) {\n const tokensOf = tokens[state];\n if (!tokensOf || skip.has(state)) continue;\n const pseudo = state === 'focus' ? ':focus-visible' : `:${state}`;\n const still: string[] = [], moving: string[] = [], label: string[] = [];\n let stateFace = face;\n if (tokensOf.fill !== undefined) { const { decl, solid } = fillCss(tokensOf.fill, ctx.colors); stateFace = solid ?? face; for (const [property, value] of decl) still.push(`${property}:${value} !important`); }\n let stateText = tokensOf.text;\n if (stateFace && (stateText || tokensOf.fill !== undefined) && (def.text || stateText)) {\n if (!stateText || contrastRatio(ctx.colors[stateText], stateFace) < (def.contrast ?? 4.5)) stateText = readableRole(stateFace, ctx.colors, stateText);\n }\n if (stateText) label.push(`color:${ctx.colors[stateText]} !important`);\n if (tokensOf.underline !== undefined) label.push(`text-decoration:${tokensOf.underline ? 'underline' : 'none'} !important`);\n if (tokensOf.borderColor) still.push(`border-color:${ctx.colors[tokensOf.borderColor]} !important`);\n if (tokensOf.shadow) still.push(`box-shadow:${tokensOf.shadow === 'inset' && (style === 'bevel-out' || style === 'bevel-in') ? bevel(false, face ?? ctx.colors.surface) : shadowCss(tokensOf.shadow, ctx.colors)} !important`);\n const transforms = [tokensOf.lift ? `translateY(-${tokensOf.lift}px)` : '', tokensOf.scale && tokensOf.scale !== 1 ? `scale(${tokensOf.scale})` : ''].filter(Boolean);\n if (transforms.length) moving.push(`transform:${transforms.join(' ')} !important`);\n const stateSel = (selector: string) => selector.split(/,(?![^(]*\\))/).map(one => `${one.trim()}${pseudo}`).join(',');\n if (still.length) rules.push(`${partRule(stateSel(part.sel))}{${still.join(';')}}`);\n // The label of a hovered or pressed part: the box and the text leaves under it.\n if (label.length) rules.push(`${partRule(`${stateSel(part.sel)},${part.sel.split(/,(?![^(]*\\))/).map(one => `${one.trim()}${pseudo} :is(span,div,a)`).join(',')}`)}{${label.join(';')}}`);\n // Movement only for people who have not asked for less of it.\n if (moving.length) rules.push(`@media (prefers-reduced-motion:no-preference){${partRule(stateSel(part.sel))}{${moving.join(';')}}}`);\n }\n }\n return { values, rules, notes };\n}\n\n/** The `colors.actions` group: the colors of an on state (liked, reposted, bookmarked) and of the reply hover. */\nexport const ACTION_NAMES = ['reply', 'repost', 'like', 'bookmark'] as const;\nexport type ActionColors = Partial<Record<typeof ACTION_NAMES[number], string>>;\n"]}