waybetter 0.1.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (537) hide show
  1. package/README.md +139 -6
  2. package/bin/waybetter.mjs +43 -0
  3. package/build/runtime.mjs +105 -0
  4. package/cli/buildenv.mjs +130 -0
  5. package/cli/dev.mjs +97 -0
  6. package/cli/i18n.mjs +382 -0
  7. package/cli/manifests.mjs +383 -0
  8. package/cli/release.mjs +437 -0
  9. package/cli/releasecheck.mjs +15 -0
  10. package/cli/remote.mjs +260 -0
  11. package/cli/store.mjs +378 -0
  12. package/cli/strings.mjs +123 -0
  13. package/dist/runtime/column.d.ts +93 -0
  14. package/dist/runtime/column.js +451 -0
  15. package/dist/runtime/column.js.map +1 -0
  16. package/dist/runtime/commandReport.d.ts +19 -0
  17. package/dist/runtime/commandReport.js +47 -0
  18. package/dist/runtime/commandReport.js.map +1 -0
  19. package/dist/runtime/commands.d.ts +72 -0
  20. package/dist/runtime/commands.js +214 -0
  21. package/dist/runtime/commands.js.map +1 -0
  22. package/dist/runtime/devErrors.d.ts +16 -0
  23. package/dist/runtime/devErrors.js +30 -0
  24. package/dist/runtime/devErrors.js.map +1 -0
  25. package/dist/runtime/domHub.d.ts +21 -0
  26. package/dist/runtime/domHub.js +139 -4
  27. package/dist/runtime/domHub.js.map +1 -1
  28. package/dist/runtime/featureModules.d.ts +157 -0
  29. package/dist/runtime/featureModules.js +484 -0
  30. package/dist/runtime/featureModules.js.map +1 -0
  31. package/dist/runtime/featureTable.d.ts +144 -0
  32. package/dist/runtime/featureTable.js +223 -0
  33. package/dist/runtime/featureTable.js.map +1 -0
  34. package/dist/runtime/fonts.d.ts +22 -0
  35. package/dist/runtime/fonts.js +72 -0
  36. package/dist/runtime/fonts.js.map +1 -0
  37. package/dist/runtime/i18n.d.ts +138 -0
  38. package/dist/runtime/i18n.js +614 -0
  39. package/dist/runtime/i18n.js.map +1 -0
  40. package/dist/runtime/i18nCheck.d.ts +30 -0
  41. package/dist/runtime/i18nCheck.js +224 -0
  42. package/dist/runtime/i18nCheck.js.map +1 -0
  43. package/dist/runtime/pageLang.d.ts +8 -0
  44. package/dist/runtime/pageLang.js +64 -0
  45. package/dist/runtime/pageLang.js.map +1 -0
  46. package/dist/runtime/pageStrings.d.ts +35 -0
  47. package/dist/runtime/pageStrings.js +76 -0
  48. package/dist/runtime/pageStrings.js.map +1 -0
  49. package/dist/runtime/panelButton.d.ts +33 -0
  50. package/dist/runtime/panelButton.js +83 -0
  51. package/dist/runtime/panelButton.js.map +1 -0
  52. package/dist/runtime/permissions.d.ts +47 -0
  53. package/dist/runtime/permissions.js +141 -0
  54. package/dist/runtime/permissions.js.map +1 -0
  55. package/dist/runtime/pluginApi.d.ts +51 -2
  56. package/dist/runtime/pluginApi.js +137 -22
  57. package/dist/runtime/pluginApi.js.map +1 -1
  58. package/dist/runtime/pluginI18n.d.ts +29 -0
  59. package/dist/runtime/pluginI18n.js +119 -0
  60. package/dist/runtime/pluginI18n.js.map +1 -0
  61. package/dist/runtime/settingsForm.d.ts +66 -0
  62. package/dist/runtime/settingsForm.js +114 -0
  63. package/dist/runtime/settingsForm.js.map +1 -0
  64. package/dist/runtime/site.d.ts +5 -0
  65. package/dist/runtime/site.js +1 -1
  66. package/dist/runtime/site.js.map +1 -1
  67. package/dist/runtime/siteRuntime.d.ts +144 -0
  68. package/dist/runtime/siteRuntime.js +175 -0
  69. package/dist/runtime/siteRuntime.js.map +1 -0
  70. package/dist/runtime/stringPackHook.d.ts +84 -0
  71. package/dist/runtime/stringPackHook.js +220 -0
  72. package/dist/runtime/stringPackHook.js.map +1 -0
  73. package/dist/runtime/stringPackTranslate.d.ts +61 -0
  74. package/dist/runtime/stringPackTranslate.js +267 -0
  75. package/dist/runtime/stringPackTranslate.js.map +1 -0
  76. package/dist/runtime/stringPacks.d.ts +248 -0
  77. package/dist/runtime/stringPacks.js +610 -0
  78. package/dist/runtime/stringPacks.js.map +1 -0
  79. package/dist/runtime/styles.d.ts +15 -0
  80. package/dist/runtime/styles.js +81 -0
  81. package/dist/runtime/styles.js.map +1 -0
  82. package/dist/runtime/textNet.d.ts +15 -0
  83. package/dist/runtime/textNet.js +131 -0
  84. package/dist/runtime/textNet.js.map +1 -0
  85. package/dist/runtime/themeApi.d.ts +121 -0
  86. package/dist/runtime/themeApi.js +220 -0
  87. package/dist/runtime/themeApi.js.map +1 -0
  88. package/dist/runtime/themeBar.d.ts +28 -0
  89. package/dist/runtime/themeBar.js +82 -0
  90. package/dist/runtime/themeBar.js.map +1 -0
  91. package/dist/runtime/themeChoice.d.ts +52 -0
  92. package/dist/runtime/themeChoice.js +69 -0
  93. package/dist/runtime/themeChoice.js.map +1 -0
  94. package/dist/runtime/themeComponents.d.ts +435 -0
  95. package/dist/runtime/themeComponents.js +476 -0
  96. package/dist/runtime/themeComponents.js.map +1 -0
  97. package/dist/runtime/themeDecor.d.ts +73 -0
  98. package/dist/runtime/themeDecor.js +133 -0
  99. package/dist/runtime/themeDecor.js.map +1 -0
  100. package/dist/runtime/themeDerive.d.ts +69 -0
  101. package/dist/runtime/themeDerive.js +117 -0
  102. package/dist/runtime/themeDerive.js.map +1 -0
  103. package/dist/runtime/themeDoctor.d.ts +52 -0
  104. package/dist/runtime/themeDoctor.js +112 -0
  105. package/dist/runtime/themeDoctor.js.map +1 -0
  106. package/dist/runtime/themeGuards.d.ts +60 -0
  107. package/dist/runtime/themeGuards.js +235 -0
  108. package/dist/runtime/themeGuards.js.map +1 -0
  109. package/dist/runtime/themeIcons.d.ts +130 -0
  110. package/dist/runtime/themeIcons.js +271 -0
  111. package/dist/runtime/themeIcons.js.map +1 -0
  112. package/dist/runtime/themeInk.d.ts +37 -0
  113. package/dist/runtime/themeInk.js +111 -0
  114. package/dist/runtime/themeInk.js.map +1 -0
  115. package/dist/runtime/themeInvariants.d.ts +39 -0
  116. package/dist/runtime/themeInvariants.js +273 -0
  117. package/dist/runtime/themeInvariants.js.map +1 -0
  118. package/dist/runtime/themeRuntime.d.ts +114 -0
  119. package/dist/runtime/themeRuntime.js +570 -0
  120. package/dist/runtime/themeRuntime.js.map +1 -0
  121. package/dist/runtime/themeSchema.d.ts +10 -0
  122. package/dist/runtime/themeSchema.js +150 -0
  123. package/dist/runtime/themeSchema.js.map +1 -0
  124. package/dist/runtime/themeSpec.d.ts +263 -0
  125. package/dist/runtime/themeSpec.js +435 -0
  126. package/dist/runtime/themeSpec.js.map +1 -0
  127. package/dist/runtime/themeTokens.d.ts +12 -0
  128. package/dist/runtime/themeTokens.js +14 -6
  129. package/dist/runtime/themeTokens.js.map +1 -1
  130. package/dist/runtime/themeVariants.d.ts +30 -0
  131. package/dist/runtime/themeVariants.js +53 -0
  132. package/dist/runtime/themeVariants.js.map +1 -0
  133. package/dist/runtime/ui.d.ts +192 -0
  134. package/dist/runtime/ui.js +926 -0
  135. package/dist/runtime/ui.js.map +1 -0
  136. package/dist/shell/InstallDialog.d.ts +40 -0
  137. package/dist/shell/InstallDialog.js +176 -0
  138. package/dist/shell/InstallDialog.js.map +1 -0
  139. package/dist/shell/StoreView.d.ts +78 -0
  140. package/dist/shell/StoreView.js +108 -0
  141. package/dist/shell/StoreView.js.map +1 -0
  142. package/dist/shell/addressModel.js.map +1 -1
  143. package/dist/shell/chrome.js.map +1 -1
  144. package/dist/shell/deckModel.d.ts +117 -0
  145. package/dist/shell/deckModel.js +267 -0
  146. package/dist/shell/deckModel.js.map +1 -0
  147. package/dist/shell/frame/AccountSwitcher.d.ts +42 -0
  148. package/dist/shell/frame/AccountSwitcher.js +243 -0
  149. package/dist/shell/frame/AccountSwitcher.js.map +1 -0
  150. package/dist/shell/frame/AddColumnDialog.d.ts +8 -0
  151. package/dist/shell/frame/AddColumnDialog.js +81 -0
  152. package/dist/shell/frame/AddColumnDialog.js.map +1 -0
  153. package/dist/shell/frame/AppMenu.d.ts +44 -0
  154. package/dist/shell/frame/AppMenu.js +721 -0
  155. package/dist/shell/frame/AppMenu.js.map +1 -0
  156. package/dist/shell/frame/CommandPalette.d.ts +7 -0
  157. package/dist/shell/frame/CommandPalette.js +118 -0
  158. package/dist/shell/frame/CommandPalette.js.map +1 -0
  159. package/dist/shell/frame/DeckView.d.ts +13 -0
  160. package/dist/shell/frame/DeckView.js +287 -0
  161. package/dist/shell/frame/DeckView.js.map +1 -0
  162. package/dist/shell/frame/FindBar.d.ts +10 -0
  163. package/dist/shell/frame/FindBar.js +108 -0
  164. package/dist/shell/frame/FindBar.js.map +1 -0
  165. package/dist/shell/frame/MediaPanel.d.ts +8 -0
  166. package/dist/shell/frame/MediaPanel.js +76 -0
  167. package/dist/shell/frame/MediaPanel.js.map +1 -0
  168. package/dist/shell/frame/NewTabPage.d.ts +9 -0
  169. package/dist/shell/frame/NewTabPage.js +71 -0
  170. package/dist/shell/frame/NewTabPage.js.map +1 -0
  171. package/dist/shell/frame/PaneTheme.d.ts +16 -0
  172. package/dist/shell/frame/PaneTheme.js +67 -0
  173. package/dist/shell/frame/PaneTheme.js.map +1 -0
  174. package/dist/shell/frame/ReportDialog.d.ts +3 -0
  175. package/dist/shell/frame/ReportDialog.js +95 -0
  176. package/dist/shell/frame/ReportDialog.js.map +1 -0
  177. package/dist/shell/frame/Shell.d.ts +9 -0
  178. package/dist/shell/frame/Shell.js +1139 -0
  179. package/dist/shell/frame/Shell.js.map +1 -0
  180. package/dist/shell/frame/Titlebar.d.ts +17 -0
  181. package/dist/shell/frame/Titlebar.js +79 -0
  182. package/dist/shell/frame/Titlebar.js.map +1 -0
  183. package/dist/shell/frame/TitlebarExtras.d.ts +4 -0
  184. package/dist/shell/frame/TitlebarExtras.js +202 -0
  185. package/dist/shell/frame/TitlebarExtras.js.map +1 -0
  186. package/dist/shell/frame/WebPanel.d.ts +4 -0
  187. package/dist/shell/frame/WebPanel.js +185 -0
  188. package/dist/shell/frame/WebPanel.js.map +1 -0
  189. package/dist/shell/frame/accountModel.d.ts +49 -0
  190. package/dist/shell/frame/accountModel.js +67 -0
  191. package/dist/shell/frame/accountModel.js.map +1 -0
  192. package/dist/shell/frame/accountSwitcher.css +91 -0
  193. package/dist/shell/frame/appI18n.d.ts +44 -0
  194. package/dist/shell/frame/appI18n.js +64 -0
  195. package/dist/shell/frame/appI18n.js.map +1 -0
  196. package/dist/shell/frame/appMenu.css +127 -0
  197. package/dist/shell/frame/backupModel.d.ts +38 -0
  198. package/dist/shell/frame/backupModel.js +192 -0
  199. package/dist/shell/frame/backupModel.js.map +1 -0
  200. package/dist/shell/frame/boot.d.ts +8 -0
  201. package/dist/shell/frame/boot.js +37 -0
  202. package/dist/shell/frame/boot.js.map +1 -0
  203. package/dist/shell/frame/brand.d.ts +1 -0
  204. package/dist/shell/frame/brand.js +4 -0
  205. package/dist/shell/frame/brand.js.map +1 -0
  206. package/dist/shell/frame/bridge.d.ts +35 -0
  207. package/dist/shell/frame/bridge.js +70 -0
  208. package/dist/shell/frame/bridge.js.map +1 -0
  209. package/dist/shell/frame/chromeTheme.d.ts +47 -0
  210. package/dist/shell/frame/chromeTheme.js +118 -0
  211. package/dist/shell/frame/chromeTheme.js.map +1 -0
  212. package/dist/shell/frame/deck.css +209 -0
  213. package/dist/shell/frame/deckStore.d.ts +89 -0
  214. package/dist/shell/frame/deckStore.js +239 -0
  215. package/dist/shell/frame/deckStore.js.map +1 -0
  216. package/dist/shell/frame/devHost.d.ts +35 -0
  217. package/dist/shell/frame/devHost.js +80 -0
  218. package/dist/shell/frame/devHost.js.map +1 -0
  219. package/dist/shell/frame/devModel.d.ts +7 -0
  220. package/dist/shell/frame/devModel.js +17 -0
  221. package/dist/shell/frame/devModel.js.map +1 -0
  222. package/dist/shell/frame/diag.d.ts +7 -0
  223. package/dist/shell/frame/diag.js +39 -0
  224. package/dist/shell/frame/diag.js.map +1 -0
  225. package/dist/shell/frame/edges.css +159 -0
  226. package/dist/shell/frame/findBar.css +14 -0
  227. package/dist/shell/frame/frameMessages.d.ts +248 -0
  228. package/dist/shell/frame/frameMessages.js +252 -0
  229. package/dist/shell/frame/frameMessages.js.map +1 -0
  230. package/dist/shell/frame/hooks.d.ts +39 -0
  231. package/dist/shell/frame/hooks.js +97 -0
  232. package/dist/shell/frame/hooks.js.map +1 -0
  233. package/dist/shell/frame/i18n.d.ts +27 -0
  234. package/dist/shell/frame/i18n.js +66 -0
  235. package/dist/shell/frame/i18n.js.map +1 -0
  236. package/dist/shell/frame/iconPack.d.ts +11 -0
  237. package/dist/shell/frame/iconPack.js +45 -0
  238. package/dist/shell/frame/iconPack.js.map +1 -0
  239. package/dist/shell/frame/icons.d.ts +71 -0
  240. package/dist/shell/frame/icons.js +75 -0
  241. package/dist/shell/frame/icons.js.map +1 -0
  242. package/dist/shell/frame/index.d.ts +34 -0
  243. package/dist/shell/frame/index.js +43 -0
  244. package/dist/shell/frame/index.js.map +1 -0
  245. package/dist/shell/frame/language.d.ts +58 -0
  246. package/dist/shell/frame/language.js +165 -0
  247. package/dist/shell/frame/language.js.map +1 -0
  248. package/dist/shell/frame/mediaModel.d.ts +47 -0
  249. package/dist/shell/frame/mediaModel.js +67 -0
  250. package/dist/shell/frame/mediaModel.js.map +1 -0
  251. package/dist/shell/frame/menuMessages.en.json +96 -0
  252. package/dist/shell/frame/menuModel.d.ts +319 -0
  253. package/dist/shell/frame/menuModel.js +301 -0
  254. package/dist/shell/frame/menuModel.js.map +1 -0
  255. package/dist/shell/frame/nativeMenu.d.ts +5 -0
  256. package/dist/shell/frame/nativeMenu.js +178 -0
  257. package/dist/shell/frame/nativeMenu.js.map +1 -0
  258. package/dist/shell/frame/nativeMenuModel.d.ts +102 -0
  259. package/dist/shell/frame/nativeMenuModel.js +186 -0
  260. package/dist/shell/frame/nativeMenuModel.js.map +1 -0
  261. package/dist/shell/frame/paletteModel.d.ts +139 -0
  262. package/dist/shell/frame/paletteModel.js +114 -0
  263. package/dist/shell/frame/paletteModel.js.map +1 -0
  264. package/dist/shell/frame/paneTheme.css +9 -0
  265. package/dist/shell/frame/pluginCommandStore.d.ts +23 -0
  266. package/dist/shell/frame/pluginCommandStore.js +70 -0
  267. package/dist/shell/frame/pluginCommandStore.js.map +1 -0
  268. package/dist/shell/frame/reportModel.d.ts +52 -0
  269. package/dist/shell/frame/reportModel.js +105 -0
  270. package/dist/shell/frame/reportModel.js.map +1 -0
  271. package/dist/shell/frame/safeStore.d.ts +7 -0
  272. package/dist/shell/frame/safeStore.js +40 -0
  273. package/dist/shell/frame/safeStore.js.map +1 -0
  274. package/dist/shell/frame/searchInput.d.ts +2 -0
  275. package/dist/shell/frame/searchInput.js +11 -0
  276. package/dist/shell/frame/searchInput.js.map +1 -0
  277. package/dist/shell/frame/shell.css +634 -0
  278. package/dist/shell/frame/site.d.ts +206 -0
  279. package/dist/shell/frame/site.js +22 -0
  280. package/dist/shell/frame/site.js.map +1 -0
  281. package/dist/shell/frame/state.d.ts +101 -0
  282. package/dist/shell/frame/state.js +286 -0
  283. package/dist/shell/frame/state.js.map +1 -0
  284. package/dist/shell/frame/syncGate.d.ts +10 -0
  285. package/dist/shell/frame/syncGate.js +36 -0
  286. package/dist/shell/frame/syncGate.js.map +1 -0
  287. package/dist/shell/frame/syncHost.d.ts +35 -0
  288. package/dist/shell/frame/syncHost.js +85 -0
  289. package/dist/shell/frame/syncHost.js.map +1 -0
  290. package/dist/shell/frame/tabStill.d.ts +2 -0
  291. package/dist/shell/frame/tabStill.js +62 -0
  292. package/dist/shell/frame/tabStill.js.map +1 -0
  293. package/dist/shell/frame/themeScopes.d.ts +29 -0
  294. package/dist/shell/frame/themeScopes.js +61 -0
  295. package/dist/shell/frame/themeScopes.js.map +1 -0
  296. package/dist/shell/frame/themeStore.d.ts +99 -0
  297. package/dist/shell/frame/themeStore.js +267 -0
  298. package/dist/shell/frame/themeStore.js.map +1 -0
  299. package/dist/shell/frame/windowBinding.d.ts +2 -0
  300. package/dist/shell/frame/windowBinding.js +7 -0
  301. package/dist/shell/frame/windowBinding.js.map +1 -0
  302. package/dist/shell/frame/workspaceModel.d.ts +82 -0
  303. package/dist/shell/frame/workspaceModel.js +250 -0
  304. package/dist/shell/frame/workspaceModel.js.map +1 -0
  305. package/dist/shell/frame/workspaces.css +84 -0
  306. package/dist/shell/frame/workspaces.d.ts +22 -0
  307. package/dist/shell/frame/workspaces.js +125 -0
  308. package/dist/shell/frame/workspaces.js.map +1 -0
  309. package/dist/shell/frame/zoomStore.d.ts +10 -0
  310. package/dist/shell/frame/zoomStore.js +65 -0
  311. package/dist/shell/frame/zoomStore.js.map +1 -0
  312. package/dist/shell/installController.d.ts +137 -0
  313. package/dist/shell/installController.js +172 -0
  314. package/dist/shell/installController.js.map +1 -0
  315. package/dist/shell/installerMessages.d.ts +30 -0
  316. package/dist/shell/installerMessages.js +36 -0
  317. package/dist/shell/installerMessages.js.map +1 -0
  318. package/dist/shell/linkDrop.js.map +1 -1
  319. package/dist/shell/messages.d.ts +16 -0
  320. package/dist/shell/messages.js +27 -0
  321. package/dist/shell/messages.js.map +1 -0
  322. package/dist/shell/palette.js.map +1 -1
  323. package/dist/shell/paneModel.d.ts +22 -0
  324. package/dist/shell/paneModel.js +24 -1
  325. package/dist/shell/paneModel.js.map +1 -1
  326. package/dist/shell/panel/Appearance.d.ts +8 -0
  327. package/dist/shell/panel/Appearance.js +265 -0
  328. package/dist/shell/panel/Appearance.js.map +1 -0
  329. package/dist/shell/panel/BackupPanel.d.ts +5 -0
  330. package/dist/shell/panel/BackupPanel.js +198 -0
  331. package/dist/shell/panel/BackupPanel.js.map +1 -0
  332. package/dist/shell/panel/DeveloperPanel.d.ts +4 -0
  333. package/dist/shell/panel/DeveloperPanel.js +51 -0
  334. package/dist/shell/panel/DeveloperPanel.js.map +1 -0
  335. package/dist/shell/panel/FeatureToggles.d.ts +13 -0
  336. package/dist/shell/panel/FeatureToggles.js +42 -0
  337. package/dist/shell/panel/FeatureToggles.js.map +1 -0
  338. package/dist/shell/panel/Home.d.ts +3 -0
  339. package/dist/shell/panel/Home.js +23 -0
  340. package/dist/shell/panel/Home.js.map +1 -0
  341. package/dist/shell/panel/IconPackInstall.d.ts +15 -0
  342. package/dist/shell/panel/IconPackInstall.js +41 -0
  343. package/dist/shell/panel/IconPackInstall.js.map +1 -0
  344. package/dist/shell/panel/LanguageSettings.d.ts +1 -0
  345. package/dist/shell/panel/LanguageSettings.js +54 -0
  346. package/dist/shell/panel/LanguageSettings.js.map +1 -0
  347. package/dist/shell/panel/MakePanel.d.ts +3 -0
  348. package/dist/shell/panel/MakePanel.js +237 -0
  349. package/dist/shell/panel/MakePanel.js.map +1 -0
  350. package/dist/shell/panel/MarkdownDoc.d.ts +6 -0
  351. package/dist/shell/panel/MarkdownDoc.js +35 -0
  352. package/dist/shell/panel/MarkdownDoc.js.map +1 -0
  353. package/dist/shell/panel/Modes.d.ts +40 -0
  354. package/dist/shell/panel/Modes.js +270 -0
  355. package/dist/shell/panel/Modes.js.map +1 -0
  356. package/dist/shell/panel/NavIcon.d.ts +4 -0
  357. package/dist/shell/panel/NavIcon.js +6 -0
  358. package/dist/shell/panel/NavIcon.js.map +1 -0
  359. package/dist/shell/panel/Panel.d.ts +7 -0
  360. package/dist/shell/panel/Panel.js +139 -0
  361. package/dist/shell/panel/Panel.js.map +1 -0
  362. package/dist/shell/panel/PluginFeatures.d.ts +24 -0
  363. package/dist/shell/panel/PluginFeatures.js +165 -0
  364. package/dist/shell/panel/PluginFeatures.js.map +1 -0
  365. package/dist/shell/panel/Plugins.d.ts +33 -0
  366. package/dist/shell/panel/Plugins.js +112 -0
  367. package/dist/shell/panel/Plugins.js.map +1 -0
  368. package/dist/shell/panel/PowerSettings.d.ts +4 -0
  369. package/dist/shell/panel/PowerSettings.js +52 -0
  370. package/dist/shell/panel/PowerSettings.js.map +1 -0
  371. package/dist/shell/panel/Settings.d.ts +23 -0
  372. package/dist/shell/panel/Settings.js +117 -0
  373. package/dist/shell/panel/Settings.js.map +1 -0
  374. package/dist/shell/panel/ShareSetup.d.ts +8 -0
  375. package/dist/shell/panel/ShareSetup.js +130 -0
  376. package/dist/shell/panel/ShareSetup.js.map +1 -0
  377. package/dist/shell/panel/StoreSection.d.ts +7 -0
  378. package/dist/shell/panel/StoreSection.js +78 -0
  379. package/dist/shell/panel/StoreSection.js.map +1 -0
  380. package/dist/shell/panel/StringPacks.d.ts +20 -0
  381. package/dist/shell/panel/StringPacks.js +131 -0
  382. package/dist/shell/panel/StringPacks.js.map +1 -0
  383. package/dist/shell/panel/ThemeBuilder.d.ts +5 -0
  384. package/dist/shell/panel/ThemeBuilder.js +205 -0
  385. package/dist/shell/panel/ThemeBuilder.js.map +1 -0
  386. package/dist/shell/panel/backup.css +34 -0
  387. package/dist/shell/panel/builder.css +240 -0
  388. package/dist/shell/panel/builderModel.d.ts +55 -0
  389. package/dist/shell/panel/builderModel.js +95 -0
  390. package/dist/shell/panel/builderModel.js.map +1 -0
  391. package/dist/shell/panel/compare.d.ts +10 -0
  392. package/dist/shell/panel/compare.js +51 -0
  393. package/dist/shell/panel/compare.js.map +1 -0
  394. package/dist/shell/panel/controls.d.ts +135 -0
  395. package/dist/shell/panel/controls.js +213 -0
  396. package/dist/shell/panel/controls.js.map +1 -0
  397. package/dist/shell/panel/featureModel.d.ts +69 -0
  398. package/dist/shell/panel/featureModel.js +79 -0
  399. package/dist/shell/panel/featureModel.js.map +1 -0
  400. package/dist/shell/panel/fonts/FontBrowser.d.ts +10 -0
  401. package/dist/shell/panel/fonts/FontBrowser.js +189 -0
  402. package/dist/shell/panel/fonts/FontBrowser.js.map +1 -0
  403. package/dist/shell/panel/fonts/FontRoles.d.ts +20 -0
  404. package/dist/shell/panel/fonts/FontRoles.js +77 -0
  405. package/dist/shell/panel/fonts/FontRoles.js.map +1 -0
  406. package/dist/shell/panel/fonts/catalog.d.ts +37 -0
  407. package/dist/shell/panel/fonts/catalog.js +68 -0
  408. package/dist/shell/panel/fonts/catalog.js.map +1 -0
  409. package/dist/shell/panel/fonts/googleFontsCatalog.json +1 -0
  410. package/dist/shell/panel/index.d.ts +20 -0
  411. package/dist/shell/panel/index.js +34 -0
  412. package/dist/shell/panel/index.js.map +1 -0
  413. package/dist/shell/panel/languageModel.d.ts +5 -0
  414. package/dist/shell/panel/languageModel.js +7 -0
  415. package/dist/shell/panel/languageModel.js.map +1 -0
  416. package/dist/shell/panel/make.css +73 -0
  417. package/dist/shell/panel/makeModel.d.ts +32 -0
  418. package/dist/shell/panel/makeModel.js +84 -0
  419. package/dist/shell/panel/makeModel.js.map +1 -0
  420. package/dist/shell/panel/markdown.d.ts +46 -0
  421. package/dist/shell/panel/markdown.js +100 -0
  422. package/dist/shell/panel/markdown.js.map +1 -0
  423. package/dist/shell/panel/nav.d.ts +12 -0
  424. package/dist/shell/panel/nav.js +50 -0
  425. package/dist/shell/panel/nav.js.map +1 -0
  426. package/dist/shell/panel/panel.css +401 -0
  427. package/dist/shell/panel/panelMessages.d.ts +803 -0
  428. package/dist/shell/panel/panelMessages.js +779 -0
  429. package/dist/shell/panel/panelMessages.js.map +1 -0
  430. package/dist/shell/panel/plugins.css +59 -0
  431. package/dist/shell/panel/setupModel.d.ts +87 -0
  432. package/dist/shell/panel/setupModel.js +152 -0
  433. package/dist/shell/panel/setupModel.js.map +1 -0
  434. package/dist/shell/panel/site.d.ts +259 -0
  435. package/dist/shell/panel/site.js +25 -0
  436. package/dist/shell/panel/site.js.map +1 -0
  437. package/dist/shell/panel/strings.css +7 -0
  438. package/dist/shell/panel/themes.d.ts +10 -0
  439. package/dist/shell/panel/themes.js +8 -0
  440. package/dist/shell/panel/themes.js.map +1 -0
  441. package/dist/shell/profileModel.d.ts +3 -2
  442. package/dist/shell/profileModel.js +7 -5
  443. package/dist/shell/profileModel.js.map +1 -1
  444. package/dist/shell/store.css +250 -0
  445. package/dist/shell/storeMessages.d.ts +193 -0
  446. package/dist/shell/storeMessages.js +196 -0
  447. package/dist/shell/storeMessages.js.map +1 -0
  448. package/dist/shell/storeModel.d.ts +205 -0
  449. package/dist/shell/storeModel.js +146 -0
  450. package/dist/shell/storeModel.js.map +1 -0
  451. package/dist/shell/stringPacksModel.d.ts +44 -0
  452. package/dist/shell/stringPacksModel.js +99 -0
  453. package/dist/shell/stringPacksModel.js.map +1 -0
  454. package/dist/shell/updateModel.d.ts +2 -1
  455. package/dist/shell/updateModel.js +5 -4
  456. package/dist/shell/updateModel.js.map +1 -1
  457. package/dist/shell/windowControls.d.ts +4 -0
  458. package/dist/shell/windowControls.js +5 -0
  459. package/dist/shell/windowControls.js.map +1 -1
  460. package/i18n-config.schema.json +29 -0
  461. package/i18n-meta.schema.json +26 -0
  462. package/i18n.schema.json +42 -0
  463. package/icons.schema.json +655 -0
  464. package/languages.schema.json +23 -0
  465. package/locales/ar-x-fm.json +11 -0
  466. package/locales/ar.json +1388 -0
  467. package/locales/bg.json +1387 -0
  468. package/locales/bn.json +1387 -0
  469. package/locales/ca.json +1387 -0
  470. package/locales/cs.json +1387 -0
  471. package/locales/da.json +1387 -0
  472. package/locales/de.json +1387 -0
  473. package/locales/el.json +1387 -0
  474. package/locales/en-GB.json +27 -0
  475. package/locales/en.json +1386 -0
  476. package/locales/en.meta.json +51 -0
  477. package/locales/es.json +1387 -0
  478. package/locales/eu.json +1387 -0
  479. package/locales/fa.json +1388 -0
  480. package/locales/fi.json +1387 -0
  481. package/locales/fil.json +1387 -0
  482. package/locales/fr.json +1387 -0
  483. package/locales/ga.json +1387 -0
  484. package/locales/gl.json +1387 -0
  485. package/locales/gu.json +1387 -0
  486. package/locales/ha.json +1387 -0
  487. package/locales/he.json +1388 -0
  488. package/locales/hi.json +1387 -0
  489. package/locales/hr.json +1387 -0
  490. package/locales/hu.json +1387 -0
  491. package/locales/id.json +1387 -0
  492. package/locales/ig.json +1387 -0
  493. package/locales/it.json +1387 -0
  494. package/locales/ja.json +1387 -0
  495. package/locales/kn.json +1387 -0
  496. package/locales/ko.json +1387 -0
  497. package/locales/mr.json +1387 -0
  498. package/locales/ms.json +1387 -0
  499. package/locales/nb.json +1387 -0
  500. package/locales/nl.json +1387 -0
  501. package/locales/pl.json +1387 -0
  502. package/locales/pt.json +1387 -0
  503. package/locales/ro.json +1387 -0
  504. package/locales/ru.json +1387 -0
  505. package/locales/sk.json +1387 -0
  506. package/locales/sr.json +1387 -0
  507. package/locales/sv.json +1387 -0
  508. package/locales/ta.json +1387 -0
  509. package/locales/th.json +1387 -0
  510. package/locales/tr.json +1387 -0
  511. package/locales/uk.json +1387 -0
  512. package/locales/ur.json +1388 -0
  513. package/locales/vi.json +1387 -0
  514. package/locales/yo.json +1387 -0
  515. package/locales/zh-Hans.json +1387 -0
  516. package/locales/zh-Hant.json +1387 -0
  517. package/package.json +138 -5
  518. package/store-catalog.schema.json +78 -0
  519. package/theme.schema.json +4668 -0
  520. package/windows/installer.nsi +946 -0
  521. package/windows/languages/Basque.nsh +28 -0
  522. package/windows/languages/Catalan.nsh +28 -0
  523. package/windows/languages/Croatian.nsh +28 -0
  524. package/windows/languages/Czech.nsh +28 -0
  525. package/windows/languages/Danish.nsh +28 -0
  526. package/windows/languages/Finnish.nsh +28 -0
  527. package/windows/languages/Galician.nsh +28 -0
  528. package/windows/languages/Greek.nsh +28 -0
  529. package/windows/languages/Hungarian.nsh +28 -0
  530. package/windows/languages/Indonesian.nsh +28 -0
  531. package/windows/languages/Irish.nsh +28 -0
  532. package/windows/languages/Malay.nsh +28 -0
  533. package/windows/languages/Polish.nsh +28 -0
  534. package/windows/languages/Romanian.nsh +28 -0
  535. package/windows/languages/Serbian.nsh +28 -0
  536. package/windows/languages/Slovak.nsh +28 -0
  537. package/windows/languages/Thai.nsh +28 -0
@@ -0,0 +1,476 @@
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 { inkOnEvery } from "./themeInk.js";
18
+ import { contrastRatio, hexToRgb, mix, relativeLuminance } from "./themeApi.js";
19
+ // ---------------------------------------------------------------------------------------------
20
+ // Vocabulary
21
+ /** Color roles a component may name. `onAccent` is the readable label on the accent. */
22
+ export const COLOR_ROLES = ['bg', 'surface', 'elevated', 'page', 'border', 'text', 'muted', 'accent', 'onAccent', 'inverse', 'onInverse'];
23
+ export const BORDER_STYLES = ['none', 'solid', 'dashed', 'dotted', 'double', 'bevel-out', 'bevel-in'];
24
+ export const SHADOWS = ['none', 'soft', 'deep', 'hard', 'inset', 'glow'];
25
+ export const CASES = ['none', 'upper', 'lower', 'capitalize', 'small-caps'];
26
+ export const AVATAR_SHAPES = ['circle', 'rounded', 'square', 'squircle', 'hexagon', 'octagon', 'diamond'];
27
+ export const CORNERS = ['round', 'cut'];
28
+ const FONT_ROLES = ['interface', 'post', 'heading', 'numbers', 'mono', 'chrome', 'dialog'];
29
+ const LABEL = [12, 20];
30
+ const SMALL = [11, 18];
31
+ /** Every component a theme can name. Sites map them to selectors; a component a site does not have is ignored. */
32
+ export const COMPONENTS = {
33
+ nav: { width: [56, 320], glass: true, gradient: true },
34
+ navItem: { height: [36, 64], fontSize: LABEL, text: true },
35
+ topBar: { height: [40, 64], glass: true, gradient: true, fontSize: LABEL },
36
+ tabs: { presets: 'tabs', gradient: true },
37
+ tab: { height: [32, 56], fontSize: LABEL, text: true, presets: 'tabs' },
38
+ post: { corner: true, presets: 'post', contrast: 7 },
39
+ avatar: { size: [20, 64], shape: true, visible: true },
40
+ displayName: { text: true, fontSize: LABEL, visible: true },
41
+ handle: { text: true, fontSize: SMALL, visible: true },
42
+ postText: { text: true, fontSize: [13, 24], contrast: 7 },
43
+ meta: { text: true, fontSize: SMALL },
44
+ actionBar: {},
45
+ action: { size: [28, 44] },
46
+ count: { text: true, fontSize: SMALL, visible: true },
47
+ media: { corner: true, maxHeight: [200, 700] },
48
+ linkCard: { corner: true },
49
+ quote: {},
50
+ button: { height: [24, 56], fontSize: LABEL, text: true, gradient: true, presets: 'button' },
51
+ buttonPrimary: { parent: 'button', height: [24, 56], fontSize: LABEL, text: true, gradient: true, presets: 'button' },
52
+ buttonSecondary: { parent: 'button', height: [24, 56], fontSize: LABEL, text: true, gradient: true, presets: 'button' },
53
+ buttonGhost: { parent: 'button', height: [24, 56], fontSize: LABEL, text: true, gradient: true, presets: 'button' },
54
+ input: { height: [32, 56], fontSize: LABEL, text: true, presets: 'input' },
55
+ search: { height: [32, 56], fontSize: LABEL, text: true, presets: 'input' },
56
+ composer: { fontSize: [13, 24], text: true },
57
+ /** The tool icons under a composer (media, poll, emoji); `text` is their color. */
58
+ composerTool: { size: [28, 44] },
59
+ panel: { glass: true, presets: 'panel' },
60
+ menu: { parent: 'panel', glass: true, presets: 'panel' },
61
+ dialog: { parent: 'panel', glass: true, presets: 'panel' },
62
+ toast: { parent: 'panel', glass: true, presets: 'panel' },
63
+ hoverCard: { parent: 'panel', glass: true, presets: 'panel' },
64
+ sidebarCard: { parent: 'panel', glass: true, corner: true, presets: 'panel' },
65
+ badge: { size: [14, 24], corner: true, fontSize: SMALL, text: true },
66
+ pill: { fontSize: SMALL, text: true },
67
+ divider: {},
68
+ scrollbar: {},
69
+ profileHeader: {},
70
+ };
71
+ export const COMPONENT_IDS = Object.keys(COMPONENTS);
72
+ /** Clamp ranges of the tokens every component shares (the JSON Schema says the same; tested). */
73
+ export const TOKEN_LIMITS = {
74
+ radius: [0, 32], borderWidth: [0, 4], padX: [0, 32], padY: [0, 32], gap: [0, 24], weight: [100, 900],
75
+ tracking: [-0.05, 0.2], leading: [1.1, 2], angle: [0, 360], lift: [0, 4], scale: [0.96, 1.04],
76
+ };
77
+ /** Named token bundles per family; a theme's own tokens win over its preset's. Frozen once shipped. */
78
+ export const PRESETS = {
79
+ button: {
80
+ pill: { radius: 'pill', borderWidth: 0 },
81
+ soft: { radius: 8, borderWidth: 0 },
82
+ square: { radius: 0, borderWidth: 1, borderStyle: 'solid' },
83
+ outline: { radius: 6, borderWidth: 1, borderStyle: 'solid', fill: 'transparent', text: 'text', borderColor: 'border' },
84
+ bevel: { radius: 0, borderStyle: 'bevel-out', fill: 'surface', text: 'text', active: { shadow: 'inset' } },
85
+ gloss: { radius: 'pill', borderWidth: 1, borderStyle: 'solid', shadow: 'soft' },
86
+ 'flat-link': { radius: 0, borderWidth: 0, fill: 'transparent', text: 'accent', hover: { underline: true } },
87
+ },
88
+ post: {
89
+ flat: { radius: 0, borderWidth: 0, fill: 'transparent', shadow: 'none' },
90
+ card: { radius: 14, borderWidth: 1, borderStyle: 'solid', borderColor: 'border', fill: 'surface' },
91
+ bubble: { radius: 20, borderWidth: 0, fill: 'surface' },
92
+ window: { radius: 0, borderStyle: 'bevel-out', fill: 'surface' },
93
+ ruled: { radius: 0, borderWidth: 0, fill: 'transparent' },
94
+ },
95
+ input: {
96
+ pill: { radius: 'pill', borderWidth: 1, borderStyle: 'solid', borderColor: 'border' },
97
+ underline: { radius: 0, borderWidth: 0, fill: 'transparent' },
98
+ sunken: { radius: 0, borderStyle: 'bevel-in', fill: 'bg', text: 'text' },
99
+ boxed: { radius: 4, borderWidth: 1, borderStyle: 'solid', borderColor: 'border', fill: 'bg' },
100
+ },
101
+ panel: {
102
+ sheet: { radius: 12, borderWidth: 1, borderStyle: 'solid', borderColor: 'border', fill: 'surface', shadow: 'soft' },
103
+ window: { radius: 0, borderStyle: 'bevel-out', fill: 'surface', shadow: 'none' },
104
+ glass: { radius: 16, borderWidth: 1, borderStyle: 'solid', borderColor: 'border', fill: 'glass', shadow: 'soft' },
105
+ },
106
+ tabs: {
107
+ underline: { radius: 0 },
108
+ pills: { radius: 'pill' },
109
+ folder: { radius: 6, borderWidth: 1, borderStyle: 'solid', borderColor: 'border' },
110
+ blocks: { radius: 0, borderWidth: 1, borderStyle: 'solid', borderColor: 'border' },
111
+ },
112
+ };
113
+ // ---------------------------------------------------------------------------------------------
114
+ // Sanitizing
115
+ const obj = (value) => value && typeof value === 'object' && !Array.isArray(value) ? value : {};
116
+ const finite = (value) => typeof value === 'number' && Number.isFinite(value);
117
+ const clamp = (value, [min, max]) => Math.min(max, Math.max(min, value));
118
+ const oneOf = (value, options) => options.includes(value) ? value : undefined;
119
+ const role = (value) => oneOf(value, COLOR_ROLES);
120
+ function sanitizeFill(value, def) {
121
+ if (value === 'transparent')
122
+ return 'transparent';
123
+ if (value === 'glass')
124
+ return def.glass ? 'glass' : undefined;
125
+ const named = role(value);
126
+ if (named)
127
+ return named;
128
+ const source = obj(value);
129
+ const from = role(source.from), to = role(source.to);
130
+ if (def.gradient && from && to)
131
+ return { from, to, angle: Math.round(clamp(finite(source.angle) ? source.angle : 180, TOKEN_LIMITS.angle)) };
132
+ return undefined;
133
+ }
134
+ function sanitizeState(value, def) {
135
+ const source = obj(value);
136
+ const out = {};
137
+ const fill = sanitizeFill(source.fill, def);
138
+ if (fill !== undefined)
139
+ out.fill = fill;
140
+ const text = role(source.text);
141
+ if (text)
142
+ out.text = text;
143
+ const borderColor = role(source.borderColor);
144
+ if (borderColor)
145
+ out.borderColor = borderColor;
146
+ const shadow = oneOf(source.shadow, SHADOWS);
147
+ if (shadow)
148
+ out.shadow = shadow;
149
+ if (finite(source.lift))
150
+ out.lift = +clamp(source.lift, TOKEN_LIMITS.lift).toFixed(1);
151
+ if (finite(source.scale))
152
+ out.scale = +clamp(source.scale, TOKEN_LIMITS.scale).toFixed(3);
153
+ if (typeof source.underline === 'boolean')
154
+ out.underline = source.underline;
155
+ return Object.keys(out).length ? out : undefined;
156
+ }
157
+ /** One component's tokens from JSON: clamped, unknown names and tokens the component does not take dropped. */
158
+ export function sanitizeComponentTokens(id, value) {
159
+ const def = COMPONENTS[id];
160
+ const source = obj(value);
161
+ const out = {};
162
+ if (def.presets && typeof source.preset === 'string' && Object.hasOwn(PRESETS[def.presets], source.preset))
163
+ out.preset = source.preset;
164
+ if (source.radius === 'pill')
165
+ out.radius = 'pill';
166
+ else if (finite(source.radius))
167
+ out.radius = Math.round(clamp(source.radius, TOKEN_LIMITS.radius));
168
+ if (finite(source.borderWidth))
169
+ out.borderWidth = +clamp(source.borderWidth, TOKEN_LIMITS.borderWidth).toFixed(1);
170
+ const borderStyle = oneOf(source.borderStyle, BORDER_STYLES);
171
+ if (borderStyle)
172
+ out.borderStyle = borderStyle;
173
+ const borderColor = role(source.borderColor);
174
+ if (borderColor)
175
+ out.borderColor = borderColor;
176
+ const fill = sanitizeFill(source.fill, def);
177
+ if (fill !== undefined)
178
+ out.fill = fill;
179
+ const text = role(source.text);
180
+ if (text)
181
+ out.text = text;
182
+ for (const key of ['padX', 'padY', 'gap'])
183
+ if (finite(source[key]))
184
+ out[key] = Math.round(clamp(source[key], TOKEN_LIMITS[key]));
185
+ for (const key of ['height', 'width', 'size', 'maxHeight', 'fontSize']) {
186
+ const range = def[key];
187
+ if (range && finite(source[key]))
188
+ out[key] = Math.round(clamp(source[key], range));
189
+ }
190
+ if (def.text || def.fontSize) {
191
+ const font = oneOf(source.font, FONT_ROLES);
192
+ if (font)
193
+ out.font = font;
194
+ if (finite(source.weight))
195
+ out.weight = Math.round(clamp(source.weight, TOKEN_LIMITS.weight) / 50) * 50;
196
+ const textCase = oneOf(source.case, CASES);
197
+ if (textCase && id !== 'postText')
198
+ out.case = textCase;
199
+ if (finite(source.tracking))
200
+ out.tracking = +clamp(source.tracking, TOKEN_LIMITS.tracking).toFixed(3);
201
+ if (finite(source.leading))
202
+ out.leading = +clamp(source.leading, TOKEN_LIMITS.leading).toFixed(2);
203
+ }
204
+ const shadow = oneOf(source.shadow, SHADOWS);
205
+ if (shadow)
206
+ out.shadow = shadow;
207
+ if (def.shape) {
208
+ const shape = oneOf(source.shape, AVATAR_SHAPES);
209
+ if (shape)
210
+ out.shape = shape;
211
+ }
212
+ if (def.corner) {
213
+ const corner = oneOf(source.corner, CORNERS);
214
+ if (corner)
215
+ out.corner = corner;
216
+ }
217
+ if (def.visible && typeof source.visible === 'boolean')
218
+ out.visible = source.visible;
219
+ for (const state of ['hover', 'active', 'focus']) {
220
+ const tokens = sanitizeState(source[state], def);
221
+ if (tokens)
222
+ out[state] = tokens;
223
+ }
224
+ return Object.keys(out).length ? out : undefined;
225
+ }
226
+ /** The `components` group from JSON. Null when nothing valid is left (the theme sets no component). */
227
+ export function sanitizeComponents(value) {
228
+ const source = obj(value);
229
+ const out = {};
230
+ for (const id of COMPONENT_IDS) {
231
+ if (!Object.hasOwn(source, id))
232
+ continue;
233
+ const tokens = sanitizeComponentTokens(id, source[id]);
234
+ if (tokens)
235
+ out[id] = tokens;
236
+ }
237
+ return Object.keys(out).length ? out : null;
238
+ }
239
+ /** Every component with its preset and its parent's tokens folded in (own tokens win, then the preset, then the parent). */
240
+ export function resolveComponents(components) {
241
+ const expand = (id, tokens) => {
242
+ if (!tokens)
243
+ return {};
244
+ const def = COMPONENTS[id];
245
+ const preset = tokens.preset && def.presets ? PRESETS[def.presets][tokens.preset] : undefined;
246
+ const { preset: _name, ...own } = tokens;
247
+ return { ...preset, ...own };
248
+ };
249
+ const out = {};
250
+ for (const id of COMPONENT_IDS) {
251
+ const def = COMPONENTS[id];
252
+ const parent = def.parent;
253
+ const inherited = parent ? expand(parent, components[parent]) : {};
254
+ const merged = { ...inherited, ...expand(id, components[id]) };
255
+ if (Object.keys(merged).length)
256
+ out[id] = merged;
257
+ }
258
+ return out;
259
+ }
260
+ const rgba = (hex, alpha) => `rgba(${hexToRgb(hex).join(', ')}, ${alpha})`;
261
+ const dark = (hex) => relativeLuminance(hex) < 0.18;
262
+ /** The most readable of the theme's text-capable roles on `fill`. */
263
+ export function readableRole(fill, colors, preferred) {
264
+ const candidates = ['text', 'onAccent', 'onInverse', 'bg', 'inverse'];
265
+ if (preferred && !candidates.includes(preferred))
266
+ candidates.unshift(preferred);
267
+ return candidates.reduce((best, candidate) => contrastRatio(colors[candidate], fill) > contrastRatio(colors[best], fill) ? candidate : best, preferred ?? 'text');
268
+ }
269
+ function fillCss(fill, colors) {
270
+ if (fill === 'transparent')
271
+ return { decl: [['background-color', 'transparent'], ['background-image', 'none']], solid: null };
272
+ if (fill === 'glass')
273
+ 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 };
274
+ if (typeof fill === 'string')
275
+ return { decl: [['background-color', colors[fill]], ['background-image', 'none']], solid: colors[fill] };
276
+ // A gradient is judged at its less readable end: the midpoint stands in for both when choosing a label.
277
+ 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) };
278
+ }
279
+ /** Raised and sunken edges after 98.css: two light and two dark inset lines, from the part's own fill. */
280
+ function bevel(out, face) {
281
+ 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);
282
+ return out
283
+ ? `inset -1px -1px ${deep}, inset 1px 1px ${light}, inset -2px -2px ${shade}, inset 2px 2px ${soft}`
284
+ : `inset -1px -1px ${light}, inset 1px 1px ${shade}, inset -2px -2px ${soft}, inset 2px 2px ${deep}`;
285
+ }
286
+ function shadowCss(name, colors) {
287
+ const base = dark(colors.bg);
288
+ switch (name) {
289
+ 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)}`;
290
+ case 'deep': return `0 0 0 1px ${rgba(colors.border, 0.6)}, 0 24px 64px ${rgba('#000000', base ? 0.6 : 0.28)}`;
291
+ case 'hard': return `4px 4px 0 ${colors.accent}`;
292
+ case 'inset': return `inset 1px 1px 3px ${rgba('#000000', base ? 0.6 : 0.25)}`;
293
+ case 'glow': return `0 0 0 1px ${rgba(colors.accent, 0.5)}, 0 0 18px ${rgba(colors.accent, 0.35)}`;
294
+ default: return 'none';
295
+ }
296
+ }
297
+ const SHAPES = {
298
+ circle: [['border-radius', '50%']],
299
+ rounded: [['border-radius', '26%']],
300
+ square: [['border-radius', '2px']],
301
+ squircle: [['border-radius', '34%']],
302
+ hexagon: [['border-radius', '0'], ['clip-path', 'polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%)']],
303
+ octagon: [['border-radius', '0'], ['clip-path', 'polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%)']],
304
+ diamond: [['border-radius', '0'], ['clip-path', 'polygon(50% 0, 100% 50%, 50% 100%, 0 50%)']],
305
+ };
306
+ const CASE_CSS = {
307
+ none: [['text-transform', 'none'], ['font-variant-caps', 'normal']],
308
+ upper: [['text-transform', 'uppercase']],
309
+ lower: [['text-transform', 'lowercase']],
310
+ capitalize: [['text-transform', 'capitalize']],
311
+ 'small-caps': [['text-transform', 'none'], ['font-variant-caps', 'all-small-caps']],
312
+ };
313
+ /** A part rule's selector: two `:root`s lift it over the site's atomic classes and inline styles' non-important values. */
314
+ export const partRule = (selector) => selector.split(/,(?![^(]*\))/).map(one => `:root:root ${one.trim()}`).join(',');
315
+ /**
316
+ * CSS for a theme's components over a site's part map. A component without a part, and a token the
317
+ * part skips, emits nothing. Text on a fill the theme chose is held to the component's contrast
318
+ * (the text role is swapped for the most readable one); sizes stay at or above a 24px target.
319
+ */
320
+ export function compileComponents(components, parts, ctx) {
321
+ const values = [], rules = [], notes = [];
322
+ const resolved = resolveComponents(components);
323
+ for (const id of COMPONENT_IDS) {
324
+ const tokens = resolved[id], part = parts[id];
325
+ if (!tokens || !part)
326
+ continue;
327
+ const def = COMPONENTS[id];
328
+ const skip = new Set(part.skip ?? []);
329
+ const has = (key) => tokens[key] !== undefined && !skip.has(key);
330
+ const box = [], type = [], fillRule = [];
331
+ const put = (list, token, property, value) => {
332
+ const name = `--wb-part-${id}-${token}`;
333
+ if (!values.some(item => item.startsWith(`${name}:`)))
334
+ values.push(`${name}:${value}`);
335
+ list.push(`${property}:var(${name}) !important`);
336
+ };
337
+ // Fill first: the text role depends on it.
338
+ let face = null;
339
+ if (has('fill')) {
340
+ const { decl, solid } = fillCss(tokens.fill, ctx.colors);
341
+ face = solid;
342
+ decl.forEach(([property, value], index) => put(part.fill ? fillRule : box, `fill${index ? `-${index}` : ''}`, property, value));
343
+ }
344
+ let textRole = has('text') ? tokens.text : undefined;
345
+ const need = def.contrast ?? 4.5;
346
+ if (face && (def.text || textRole)) {
347
+ // A role that cannot read on this fill gives way to the best role (white label on an accent fill)...
348
+ if (!textRole || contrastRatio(ctx.colors[textRole], face) < need) {
349
+ const readable = readableRole(face, ctx.colors, textRole);
350
+ if (textRole && readable !== textRole)
351
+ notes.push(`${id}: text "${textRole}" on its fill is under ${need}:1, using "${readable}"`);
352
+ textRole = readable;
353
+ }
354
+ }
355
+ if (textRole) {
356
+ // ...and the ink is then solved on the grounds it really sits on (theme engine v3 3.3): its fill, or with
357
+ // no fill of its own every surface it can sit on, the page canvas included (an outline button in the
358
+ // rail sits on the page: Solarized's accent read 4.45:1 there).
359
+ // A role made for another ground (onAccent, onInverse, bg: a label on a fill some parent paints, the
360
+ // Classic bar) is the theme's statement about that parent and stands.
361
+ const surfaceInk = textRole === 'text' || textRole === 'muted' || textRole === 'accent';
362
+ const grounds = face ? [face] : surfaceInk ? [ctx.colors.bg, ctx.colors.surface, ctx.colors.elevated, ctx.colors.page] : [];
363
+ const solved = grounds.length ? inkOnEvery(grounds, ctx.colors[textRole], need) : { ink: ctx.colors[textRole], adjusted: false };
364
+ if (solved.adjusted)
365
+ notes.push(`${id}: text "${textRole}" moved to ${solved.ink} to read ${need}:1 on ${grounds.join('/')}`);
366
+ put(type, 'text', 'color', solved.ink);
367
+ }
368
+ if (has('radius'))
369
+ put(box, 'radius', 'border-radius', tokens.radius === 'pill' ? '9999px' : `${tokens.radius}px`);
370
+ const style = has('borderStyle') ? tokens.borderStyle : undefined;
371
+ if (style === 'bevel-out' || style === 'bevel-in') {
372
+ const base = face ?? ctx.colors.surface;
373
+ put(box, 'border-style', 'border-style', 'none');
374
+ put(box, 'bevel', 'box-shadow', bevel(style === 'bevel-out', base));
375
+ }
376
+ else {
377
+ if (style)
378
+ put(box, 'border-style', 'border-style', style);
379
+ if (has('borderWidth'))
380
+ put(box, 'border-width', 'border-width', `${tokens.borderWidth}px`);
381
+ // A width without a style would draw nothing: X's boxes are `border: 0 solid`.
382
+ if (has('borderWidth') && !style && tokens.borderWidth > 0)
383
+ put(box, 'border-style', 'border-style', 'solid');
384
+ if (has('shadow'))
385
+ put(box, 'shadow', 'box-shadow', shadowCss(tokens.shadow, ctx.colors));
386
+ }
387
+ if (has('borderColor'))
388
+ put(box, 'border-color', 'border-color', ctx.colors[tokens.borderColor]);
389
+ if (has('padX'))
390
+ put(box, 'pad-x', 'padding-inline', `${tokens.padX}px`);
391
+ if (has('padY'))
392
+ put(box, 'pad-y', 'padding-block', `${tokens.padY}px`);
393
+ if (has('gap'))
394
+ put(box, 'gap', 'gap', `${tokens.gap}px`);
395
+ if (has('height'))
396
+ put(box, 'height', 'min-height', `${Math.max(24, tokens.height)}px`);
397
+ if (has('width'))
398
+ put(box, 'width', 'width', `${tokens.width}px`);
399
+ if (has('size')) {
400
+ put(box, 'size', 'width', `${tokens.size}px`);
401
+ box.push(`height:var(--wb-part-${id}-size) !important`);
402
+ }
403
+ if (has('maxHeight'))
404
+ put(box, 'max-height', 'max-height', `${tokens.maxHeight}px`);
405
+ if (has('shape'))
406
+ SHAPES[tokens.shape].forEach(([property, value], index) => put(box, `shape${index ? `-${index}` : ''}`, property, value));
407
+ if (has('corner') && tokens.corner === 'cut')
408
+ put(box, 'corner', 'clip-path', 'polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px))');
409
+ if (has('visible') && tokens.visible === false)
410
+ put(box, 'display', 'display', 'none');
411
+ if (has('font'))
412
+ put(type, 'font', 'font-family', ctx.fonts[tokens.font]);
413
+ if (has('fontSize')) {
414
+ put(type, 'font-size', 'font-size', `${tokens.fontSize}px`);
415
+ put(type, 'line-height', 'line-height', String(tokens.leading ?? 1.3));
416
+ }
417
+ else if (has('leading'))
418
+ put(type, 'line-height', 'line-height', String(tokens.leading));
419
+ if (has('weight'))
420
+ put(type, 'weight', 'font-weight', String(tokens.weight));
421
+ if (has('case'))
422
+ CASE_CSS[tokens.case].forEach(([property, value], index) => put(type, `case${index ? `-${index}` : ''}`, property, value));
423
+ if (has('tracking'))
424
+ put(type, 'tracking', 'letter-spacing', `${tokens.tracking}em`);
425
+ const textSel = part.text ?? part.sel;
426
+ if (box.length)
427
+ rules.push(`${partRule(part.sel)}{${box.join(';')}}`);
428
+ if (fillRule.length)
429
+ rules.push(`${partRule(part.fill)}{${fillRule.join(';')}}`);
430
+ if (type.length)
431
+ rules.push(`${partRule(textSel)}{${type.join(';')}}`);
432
+ for (const state of ['hover', 'active', 'focus']) {
433
+ const tokensOf = tokens[state];
434
+ if (!tokensOf || skip.has(state))
435
+ continue;
436
+ const pseudo = state === 'focus' ? ':focus-visible' : `:${state}`;
437
+ const still = [], moving = [], label = [];
438
+ let stateFace = face;
439
+ if (tokensOf.fill !== undefined) {
440
+ const { decl, solid } = fillCss(tokensOf.fill, ctx.colors);
441
+ stateFace = solid ?? face;
442
+ for (const [property, value] of decl)
443
+ still.push(`${property}:${value} !important`);
444
+ }
445
+ let stateText = tokensOf.text;
446
+ if (stateFace && (stateText || tokensOf.fill !== undefined) && (def.text || stateText)) {
447
+ if (!stateText || contrastRatio(ctx.colors[stateText], stateFace) < (def.contrast ?? 4.5))
448
+ stateText = readableRole(stateFace, ctx.colors, stateText);
449
+ }
450
+ if (stateText)
451
+ label.push(`color:${ctx.colors[stateText]} !important`);
452
+ if (tokensOf.underline !== undefined)
453
+ label.push(`text-decoration:${tokensOf.underline ? 'underline' : 'none'} !important`);
454
+ if (tokensOf.borderColor)
455
+ still.push(`border-color:${ctx.colors[tokensOf.borderColor]} !important`);
456
+ if (tokensOf.shadow)
457
+ 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`);
458
+ const transforms = [tokensOf.lift ? `translateY(-${tokensOf.lift}px)` : '', tokensOf.scale && tokensOf.scale !== 1 ? `scale(${tokensOf.scale})` : ''].filter(Boolean);
459
+ if (transforms.length)
460
+ moving.push(`transform:${transforms.join(' ')} !important`);
461
+ const stateSel = (selector) => selector.split(/,(?![^(]*\))/).map(one => `${one.trim()}${pseudo}`).join(',');
462
+ if (still.length)
463
+ rules.push(`${partRule(stateSel(part.sel))}{${still.join(';')}}`);
464
+ // The label of a hovered or pressed part: the box and the text leaves under it.
465
+ if (label.length)
466
+ rules.push(`${partRule(`${stateSel(part.sel)},${part.sel.split(/,(?![^(]*\))/).map(one => `${one.trim()}${pseudo} :is(span,div,a)`).join(',')}`)}{${label.join(';')}}`);
467
+ // Movement only for people who have not asked for less of it.
468
+ if (moving.length)
469
+ rules.push(`@media (prefers-reduced-motion:no-preference){${partRule(stateSel(part.sel))}{${moving.join(';')}}}`);
470
+ }
471
+ }
472
+ return { values, rules, notes };
473
+ }
474
+ /** The `colors.actions` group: the colors of an on state (liked, reposted, bookmarked) and of the reply hover. */
475
+ export const ACTION_NAMES = ['reply', 'repost', 'like', 'bookmark'];
476
+ //# sourceMappingURL=themeCompon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AC,CAAC;YACrH,IAAI,KAAK,CAAC,MAAM;gBAAE,KAAK,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACpF,gFAAgF;YAChF,IAAI,KAAK,CAAC,MAAM;gBAAE,KAAK,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,GAAG,MAAM,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC1L,8DAA8D;YAC9D,IAAI,MAAM,CAAC,MAAM;gBAAE,KAAK,CAAC,IAAI,CAAC,iDAAiD,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACvI,CAAC;IACH,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAClC,CAAC;AAED,kHAAkH;AAClH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAU,CAAC","sourcesContent":["// Component tokens: the part of a theme that says how each piece of the site is built (a button's\n// radius and 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 { inkOnEvery } from './themeInk.ts';\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 const need = def.contrast ?? 4.5;\n if (face && (def.text || textRole)) {\n // A role that cannot read on this fill gives way to the best role (white label on an accent fill)...\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) {\n // ...and the ink is then solved on the grounds it really sits on (theme engine v3 3.3): its fill, or with\n // no fill of its own every surface it can sit on, the page canvas included (an outline button in the\n // rail sits on the page: Solarized's accent read 4.45:1 there).\n // A role made for another ground (onAccent, onInverse, bg: a label on a fill some parent paints, the\n // Classic bar) is the theme's statement about that parent and stands.\n const surfaceInk = textRole === 'text' || textRole === 'muted' || textRole === 'accent';\n const grounds = face ? [face] : surfaceInk ? [ctx.colors.bg, ctx.colors.surface, ctx.colors.elevated, ctx.colors.page] : [];\n const solved = grounds.length ? inkOnEvery(grounds, ctx.colors[textRole], need) : { ink: ctx.colors[textRole], adjusted: false };\n if (solved.adjusted) notes.push(`${id}: text \"${textRole}\" moved to ${solved.ink} to read ${need}:1 on ${grounds.join('/')}`);\n put(type, 'text', 'color', solved.ink);\n }\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"]}