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,150 @@
1
+ // The JSON Schema of a theme's structure groups and of an icon pack, generated from the same tables
2
+ // the sanitizers use (themeComponents.ts, themeVariants.ts, themeDecor.ts, themeIcons.ts), so a range
3
+ // or a word exists in one place. `theme.schema.json` and `icons.schema.json` in the `waybetter`
4
+ // package are written from here (`scripts/theme-schema.mjs`); a test fails when they are stale. Pure.
5
+ import { ACTION_NAMES, AVATAR_SHAPES, BORDER_STYLES, CASES, COLOR_ROLES, COMPONENTS, COMPONENT_IDS, CORNERS, PRESETS, SHADOWS, TOKEN_LIMITS, } from "./themeComponents.js";
6
+ import { CHROME_KINDS, DIVIDER_STYLES, LINK_UNDERLINES, MOTION_CURVES, RING_STYLES } from "./themeDecor.js";
7
+ import { ICON_LABEL_NAMES, ICON_LIMITS, ICON_NAMES, PATH_GRAMMAR } from "./themeIcons.js";
8
+ import { VARIANT_AXES, VARIANT_AXIS_NAMES } from "./themeVariants.js";
9
+ const range = ([minimum, maximum], type = 'number') => ({ type, minimum, maximum });
10
+ const words = (values) => ({ enum: [...values] });
11
+ const closed = (properties, extra = {}) => ({ type: 'object', additionalProperties: false, properties, ...extra });
12
+ /** Schema-side guard for words written into CSS strings (the sanitizer's allow-list is stricter: letters, digits and a little punctuation). */
13
+ const LABEL_PATTERN = String.raw `^[^\u0000-\u001f"\\<>&{};'` + '`]+$';
14
+ const role = { $ref: '#/$defs/role' };
15
+ const hex = { $ref: '#/$defs/hex' };
16
+ // Fills and states come in four kinds (with or without glass, with or without a gradient); each is one shared definition.
17
+ const kind = (def) => `${def.glass ? 'Glass' : ''}${def.gradient ? 'Gradient' : ''}`;
18
+ function fillDef(glass, gradient) {
19
+ const options = [role, { const: 'transparent' }];
20
+ if (glass)
21
+ options.push({ const: 'glass' });
22
+ if (gradient)
23
+ options.push(closed({ from: role, to: role, angle: range(TOKEN_LIMITS.angle) }, { required: ['from', 'to'] }));
24
+ return { oneOf: options };
25
+ }
26
+ const stateDef = (name) => closed({
27
+ fill: { $ref: `#/$defs/fill${name}` }, text: role, borderColor: role, shadow: { $ref: '#/$defs/shadow' }, lift: range(TOKEN_LIMITS.lift), scale: range(TOKEN_LIMITS.scale), underline: { type: 'boolean' },
28
+ });
29
+ const fill = (def) => ({ $ref: `#/$defs/fill${kind(def)}` });
30
+ const state = (def) => ({ $ref: `#/$defs/state${kind(def)}` });
31
+ function component(def, id) {
32
+ const properties = {
33
+ radius: { oneOf: [range(TOKEN_LIMITS.radius), { const: 'pill' }] },
34
+ borderWidth: range(TOKEN_LIMITS.borderWidth), borderStyle: words(BORDER_STYLES), borderColor: role,
35
+ fill: fill(def), text: role,
36
+ padX: range(TOKEN_LIMITS.padX), padY: range(TOKEN_LIMITS.padY), gap: range(TOKEN_LIMITS.gap),
37
+ shadow: { $ref: '#/$defs/shadow' }, hover: state(def), active: state(def), focus: state(def),
38
+ };
39
+ if (def.presets)
40
+ properties.preset = words(Object.keys(PRESETS[def.presets]));
41
+ for (const key of ['height', 'width', 'size', 'maxHeight', 'fontSize'])
42
+ if (def[key])
43
+ properties[key] = range(def[key]);
44
+ if (def.text || def.fontSize) {
45
+ properties.font = { $ref: '#/$defs/fontRoleName' };
46
+ properties.weight = range(TOKEN_LIMITS.weight);
47
+ if (id !== 'postText')
48
+ properties.case = words(CASES);
49
+ properties.tracking = range(TOKEN_LIMITS.tracking);
50
+ properties.leading = range(TOKEN_LIMITS.leading);
51
+ }
52
+ if (def.shape)
53
+ properties.shape = words(AVATAR_SHAPES);
54
+ if (def.corner)
55
+ properties.corner = words(CORNERS);
56
+ if (def.visible)
57
+ properties.visible = { type: 'boolean' };
58
+ return closed(properties);
59
+ }
60
+ const glyph = {
61
+ oneOf: [
62
+ closed({ d: { $ref: '#/$defs/pathData' }, rule: { const: 'evenodd' }, stroke: { type: 'boolean' } }, { required: ['d'] }),
63
+ closed({
64
+ layers: {
65
+ type: 'array', minItems: 1, maxItems: ICON_LIMITS.layers,
66
+ items: closed({ d: { $ref: '#/$defs/pathData' }, fill: { oneOf: [role, hex, closed({ from: hex, to: hex }, { required: ['from', 'to'] })] }, opacity: range([0, 1]), rule: { const: 'evenodd' } }, { required: ['d', 'fill'] }),
67
+ },
68
+ }, { required: ['layers'] }),
69
+ closed({ png: { type: 'string', maxLength: ICON_LIMITS.pngChars + 22, pattern: '^data:image/png;base64,[A-Za-z0-9+/]+={0,2}$' }, pixel: { type: 'boolean' } }, { required: ['png'] }),
70
+ ],
71
+ };
72
+ const iconStyle = closed({ stroke: range([1, 2.5]), cap: words(['round', 'square', 'butt']), join: words(['round', 'miter', 'bevel']), scale: range([0.8, 1.25]) });
73
+ const symbols = closed({ like: words(['heart', 'star', 'custom']), separator: words(['dot', 'bullet', 'slash', 'dash', 'pipe', 'none']) });
74
+ const labels = closed(Object.fromEntries(ICON_LABEL_NAMES.map(name => [name, { type: 'string', minLength: 1, maxLength: ICON_LIMITS.labelChars, pattern: LABEL_PATTERN }])));
75
+ const glyphs = (maxProperties) => closed(Object.fromEntries(ICON_NAMES.map(name => [name, { $ref: '#/$defs/glyph' }])), { maxProperties });
76
+ /** `$defs` shared by the structure groups and the pack schema. */
77
+ export const structureDefs = () => ({
78
+ role: { description: 'A color role of the theme. Components never carry a color literal.', ...words(COLOR_ROLES) },
79
+ fontRoleName: words(['interface', 'post', 'heading', 'numbers', 'mono', 'chrome', 'dialog']),
80
+ shadow: words(SHADOWS),
81
+ ...Object.fromEntries([[false, false], [true, false], [false, true], [true, true]].flatMap(([glass, gradient]) => {
82
+ const name = `${glass ? 'Glass' : ''}${gradient ? 'Gradient' : ''}`;
83
+ return [[`fill${name}`, fillDef(glass, gradient)], [`state${name}`, stateDef(name)]];
84
+ })),
85
+ pathData: { type: 'string', minLength: 1, maxLength: ICON_LIMITS.pathChars, pattern: PATH_GRAMMAR.source.replace(/\{1,4000\}\$$/, '+$') },
86
+ glyph,
87
+ });
88
+ /** The properties a theme document gains: `components`, `variants`, `decor`, `icons`. */
89
+ export function structureProperties() {
90
+ return {
91
+ components: {
92
+ description: 'How each piece of the site is built. Every token is optional; a missing token changes nothing.',
93
+ ...closed(Object.fromEntries(COMPONENT_IDS.map(id => [id, component(COMPONENTS[id], id)]))),
94
+ },
95
+ variants: {
96
+ description: 'Structural choices. The first option of each axis is the site\'s own layout.',
97
+ ...closed(Object.fromEntries(VARIANT_AXIS_NAMES.map(axis => [axis, words(VARIANT_AXES[axis])]))),
98
+ },
99
+ decor: {
100
+ description: 'Lines, bars, focus ring, selection, scrollbars, link underlines, motion.',
101
+ ...closed({
102
+ dividers: closed({ style: words(DIVIDER_STYLES), color: role, width: range([0, 3]) }, { required: ['style'] }),
103
+ chrome: closed({ kind: words(CHROME_KINDS), title: { type: 'string', maxLength: 24 } }, { required: ['kind'] }),
104
+ focusRing: closed({ width: range([2, 4]), style: words(RING_STYLES), color: role, offset: range([0, 4]) }),
105
+ selection: closed({ fill: role, text: role }, { required: ['fill', 'text'] }),
106
+ scrollbar: closed({ width: words(['auto', 'thin']), thumb: role, track: role, style: words(['flat', 'classic']) }),
107
+ links: closed({ underline: words(LINK_UNDERLINES) }, { required: ['underline'] }),
108
+ motion: closed({ duration: range([0, 400]), curve: words(MOTION_CURVES), press: range([0.96, 1]) }),
109
+ }),
110
+ },
111
+ icons: {
112
+ description: 'The icon pack this theme suggests (by id), with small adjustments. A whole pack is its own document (icons.schema.json).',
113
+ ...closed({ pack: { type: 'string', pattern: '^[a-z0-9-]{1,40}$' }, style: iconStyle, overrides: glyphs(ICON_LIMITS.overrides), symbols, labels }),
114
+ },
115
+ };
116
+ }
117
+ /** `colors.actions`. */
118
+ export const actionColorsSchema = () => ({
119
+ description: 'Colors of a set action (liked, reposted, bookmarked) and of the reply hover. Absent: the site\'s own.',
120
+ ...closed(Object.fromEntries(ACTION_NAMES.map(name => [name, hex]))),
121
+ });
122
+ /** The JSON Schema of an icon pack document (`*.icons.json`). */
123
+ export function iconPackSchema(id) {
124
+ return {
125
+ $schema: 'https://json-schema.org/draft/2020-12/schema',
126
+ $id: id,
127
+ title: 'wayBetter icon pack',
128
+ description: 'Glyphs by semantic name, drawn over a site\'s own icons. Path data, colored layers of path data, or small PNGs: never an SVG document.',
129
+ type: 'object',
130
+ required: ['id', 'name', 'license', 'glyphs'],
131
+ additionalProperties: false,
132
+ properties: {
133
+ $schema: { type: 'string' },
134
+ id: { type: 'string', pattern: '^[a-z0-9-]{1,40}$' },
135
+ name: { type: 'string', minLength: 1, maxLength: 60 },
136
+ description: { type: 'string', maxLength: 200 },
137
+ author: { type: 'string', maxLength: 60 },
138
+ license: { type: 'string', minLength: 1, maxLength: 60, description: 'SPDX id, "own" for the author\'s own drawings, or a plain name for artwork under other terms.' },
139
+ source: { type: 'string', maxLength: 200 },
140
+ credits: { type: 'string', maxLength: 400 },
141
+ version: { const: 1 },
142
+ style: iconStyle,
143
+ glyphs: { ...glyphs(ICON_LIMITS.names), minProperties: 1 },
144
+ symbols,
145
+ labels,
146
+ },
147
+ $defs: { hex: { type: 'string', pattern: '^#[0-9a-fA-F]{6}$' }, ...structureDefs() },
148
+ };
149
+ }
150
+ //# sourceMappingURL=themeSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeSchema.js","sourceRoot":"","sources":["../../../runtime/src/themeSchema.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,sGAAsG;AACtG,gGAAgG;AAChG,sGAAsG;AAEtG,OAAO,EACL,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,GACnI,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,a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E,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE;YAC1C,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE;YAC3C,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;YACrB,KAAK,EAAE,SAAS;YAChB,MAAM,EAAE,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE;YAC1D,OAAO;YACP,MAAM;SACP;QACD,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,mBAAmB,EAAE,EAAE,GAAG,aAAa,EAAE,EAAE;KACrF,CAAC;AACJ,CAAC","sourcesContent":["// The JSON Schema of a theme's structure groups and of an icon pack, generated from the same tables\n// the sanitizers use (themeComponents.ts, themeVariants.ts, themeDecor.ts, themeIcons.ts), so a range\n// or a word exists in one place. `theme.schema.json` and `icons.schema.json` in the `waybetter`\n// package are written from here (`scripts/theme-schema.mjs`); a test fails when they are stale. Pure.\n\nimport {\n ACTION_NAMES, AVATAR_SHAPES, BORDER_STYLES, CASES, COLOR_ROLES, COMPONENTS, COMPONENT_IDS, CORNERS, PRESETS, SHADOWS, TOKEN_LIMITS,\n} from './themeComponents.ts';\nimport { CHROME_KINDS, DIVIDER_STYLES, LINK_UNDERLINES, MOTION_CURVES, RING_STYLES } from './themeDecor.ts';\nimport { ICON_LABEL_NAMES, ICON_LIMITS, ICON_NAMES, PATH_GRAMMAR } from './themeIcons.ts';\nimport { VARIANT_AXES, VARIANT_AXIS_NAMES } from './themeVariants.ts';\n\ntype Json = Record<string, unknown>;\nconst range = ([minimum, maximum]: readonly [number, number], type = 'number'): Json => ({ type, minimum, maximum });\nconst words = (values: readonly string[]): Json => ({ enum: [...values] });\nconst closed = (properties: Json, extra: Json = {}): Json => ({ type: 'object', additionalProperties: false, properties, ...extra });\n/** Schema-side guard for words written into CSS strings (the sanitizer's allow-list is stricter: letters, digits and a little punctuation). */\nconst LABEL_PATTERN = String.raw`^[^\\u0000-\\u001f\"\\\\<>&{};'` + '`]+$';\nconst role = { $ref: '#/$defs/role' };\nconst hex = { $ref: '#/$defs/hex' };\n\ntype Def = { parent?: string; text?: boolean; height?: readonly [number, number]; width?: readonly [number, number]; size?: readonly [number, number]; maxHeight?: readonly [number, number]; fontSize?: readonly [number, number]; shape?: boolean; corner?: boolean; visible?: boolean; glass?: boolean; gradient?: boolean; presets?: keyof typeof PRESETS };\n\n// Fills and states come in four kinds (with or without glass, with or without a gradient); each is one shared definition.\nconst kind = (def: Def) => `${def.glass ? 'Glass' : ''}${def.gradient ? 'Gradient' : ''}`;\nfunction fillDef(glass: boolean, gradient: boolean): Json {\n const options: Json[] = [role, { const: 'transparent' }];\n if (glass) options.push({ const: 'glass' });\n if (gradient) options.push(closed({ from: role, to: role, angle: range(TOKEN_LIMITS.angle) }, { required: ['from', 'to'] }));\n return { oneOf: options };\n}\nconst stateDef = (name: string): Json => closed({\n fill: { $ref: `#/$defs/fill${name}` }, text: role, borderColor: role, shadow: { $ref: '#/$defs/shadow' }, lift: range(TOKEN_LIMITS.lift), scale: range(TOKEN_LIMITS.scale), underline: { type: 'boolean' },\n});\nconst fill = (def: Def): Json => ({ $ref: `#/$defs/fill${kind(def)}` });\nconst state = (def: Def): Json => ({ $ref: `#/$defs/state${kind(def)}` });\n\nfunction component(def: Def, id: string): Json {\n const properties: Json = {\n radius: { oneOf: [range(TOKEN_LIMITS.radius), { const: 'pill' }] },\n borderWidth: range(TOKEN_LIMITS.borderWidth), borderStyle: words(BORDER_STYLES), borderColor: role,\n fill: fill(def), text: role,\n padX: range(TOKEN_LIMITS.padX), padY: range(TOKEN_LIMITS.padY), gap: range(TOKEN_LIMITS.gap),\n shadow: { $ref: '#/$defs/shadow' }, hover: state(def), active: state(def), focus: state(def),\n };\n if (def.presets) properties.preset = words(Object.keys(PRESETS[def.presets]));\n for (const key of ['height', 'width', 'size', 'maxHeight', 'fontSize'] as const) if (def[key]) properties[key] = range(def[key]!);\n if (def.text || def.fontSize) {\n properties.font = { $ref: '#/$defs/fontRoleName' };\n properties.weight = range(TOKEN_LIMITS.weight);\n if (id !== 'postText') properties.case = words(CASES);\n properties.tracking = range(TOKEN_LIMITS.tracking);\n properties.leading = range(TOKEN_LIMITS.leading);\n }\n if (def.shape) properties.shape = words(AVATAR_SHAPES);\n if (def.corner) properties.corner = words(CORNERS);\n if (def.visible) properties.visible = { type: 'boolean' };\n return closed(properties);\n}\n\nconst glyph: Json = {\n oneOf: [\n closed({ d: { $ref: '#/$defs/pathData' }, rule: { const: 'evenodd' }, stroke: { type: 'boolean' } }, { required: ['d'] }),\n closed({\n layers: {\n type: 'array', minItems: 1, maxItems: ICON_LIMITS.layers,\n items: closed({ d: { $ref: '#/$defs/pathData' }, fill: { oneOf: [role, hex, closed({ from: hex, to: hex }, { required: ['from', 'to'] })] }, opacity: range([0, 1]), rule: { const: 'evenodd' } }, { required: ['d', 'fill'] }),\n },\n }, { required: ['layers'] }),\n closed({ png: { type: 'string', maxLength: ICON_LIMITS.pngChars + 22, pattern: '^data:image/png;base64,[A-Za-z0-9+/]+={0,2}$' }, pixel: { type: 'boolean' } }, { required: ['png'] }),\n ],\n};\nconst iconStyle = closed({ stroke: range([1, 2.5]), cap: words(['round', 'square', 'butt']), join: words(['round', 'miter', 'bevel']), scale: range([0.8, 1.25]) });\nconst symbols = closed({ like: words(['heart', 'star', 'custom']), separator: words(['dot', 'bullet', 'slash', 'dash', 'pipe', 'none']) });\nconst labels = closed(Object.fromEntries(ICON_LABEL_NAMES.map(name => [name, { type: 'string', minLength: 1, maxLength: ICON_LIMITS.labelChars, pattern: LABEL_PATTERN }])));\nconst glyphs = (maxProperties: number): Json => closed(Object.fromEntries(ICON_NAMES.map(name => [name, { $ref: '#/$defs/glyph' }])), { maxProperties });\n\n/** `$defs` shared by the structure groups and the pack schema. */\nexport const structureDefs = (): Json => ({\n role: { description: 'A color role of the theme. Components never carry a color literal.', ...words(COLOR_ROLES) },\n fontRoleName: words(['interface', 'post', 'heading', 'numbers', 'mono', 'chrome', 'dialog']),\n shadow: words(SHADOWS),\n ...Object.fromEntries([[false, false], [true, false], [false, true], [true, true]].flatMap(([glass, gradient]) => {\n const name = `${glass ? 'Glass' : ''}${gradient ? 'Gradient' : ''}`;\n return [[`fill${name}`, fillDef(glass!, gradient!)], [`state${name}`, stateDef(name)]];\n })),\n pathData: { type: 'string', minLength: 1, maxLength: ICON_LIMITS.pathChars, pattern: PATH_GRAMMAR.source.replace(/\\{1,4000\\}\\$$/, '+$') },\n glyph,\n});\n\n/** The properties a theme document gains: `components`, `variants`, `decor`, `icons`. */\nexport function structureProperties(): Json {\n return {\n components: {\n description: 'How each piece of the site is built. Every token is optional; a missing token changes nothing.',\n ...closed(Object.fromEntries(COMPONENT_IDS.map(id => [id, component(COMPONENTS[id] as Def, id)]))),\n },\n variants: {\n description: 'Structural choices. The first option of each axis is the site\\'s own layout.',\n ...closed(Object.fromEntries(VARIANT_AXIS_NAMES.map(axis => [axis, words(VARIANT_AXES[axis])]))),\n },\n decor: {\n description: 'Lines, bars, focus ring, selection, scrollbars, link underlines, motion.',\n ...closed({\n dividers: closed({ style: words(DIVIDER_STYLES), color: role, width: range([0, 3]) }, { required: ['style'] }),\n chrome: closed({ kind: words(CHROME_KINDS), title: { type: 'string', maxLength: 24 } }, { required: ['kind'] }),\n focusRing: closed({ width: range([2, 4]), style: words(RING_STYLES), color: role, offset: range([0, 4]) }),\n selection: closed({ fill: role, text: role }, { required: ['fill', 'text'] }),\n scrollbar: closed({ width: words(['auto', 'thin']), thumb: role, track: role, style: words(['flat', 'classic']) }),\n links: closed({ underline: words(LINK_UNDERLINES) }, { required: ['underline'] }),\n motion: closed({ duration: range([0, 400]), curve: words(MOTION_CURVES), press: range([0.96, 1]) }),\n }),\n },\n icons: {\n description: 'The icon pack this theme suggests (by id), with small adjustments. A whole pack is its own document (icons.schema.json).',\n ...closed({ pack: { type: 'string', pattern: '^[a-z0-9-]{1,40}$' }, style: iconStyle, overrides: glyphs(ICON_LIMITS.overrides), symbols, labels }),\n },\n };\n}\n\n/** `colors.actions`. */\nexport const actionColorsSchema = (): Json => ({\n description: 'Colors of a set action (liked, reposted, bookmarked) and of the reply hover. Absent: the site\\'s own.',\n ...closed(Object.fromEntries(ACTION_NAMES.map(name => [name, hex]))),\n});\n\n/** The JSON Schema of an icon pack document (`*.icons.json`). */\nexport function iconPackSchema(id: string): Json {\n return {\n $schema: 'https://json-schema.org/draft/2020-12/schema',\n $id: id,\n title: 'wayBetter icon pack',\n description: 'Glyphs by semantic name, drawn over a site\\'s own icons. Path data, colored layers of path data, or small PNGs: never an SVG document.',\n type: 'object',\n required: ['id', 'name', 'license', 'glyphs'],\n additionalProperties: false,\n properties: {\n $schema: { type: 'string' },\n id: { type: 'string', pattern: '^[a-z0-9-]{1,40}$' },\n name: { type: 'string', minLength: 1, maxLength: 60 },\n description: { type: 'string', maxLength: 200 },\n author: { type: 'string', maxLength: 60 },\n license: { type: 'string', minLength: 1, maxLength: 60, description: 'SPDX id, \"own\" for the author\\'s own drawings, or a plain name for artwork under other terms.' },\n source: { type: 'string', maxLength: 200 },\n credits: { type: 'string', maxLength: 400 },\n version: { const: 1 },\n style: iconStyle,\n glyphs: { ...glyphs(ICON_LIMITS.names), minProperties: 1 },\n symbols,\n labels,\n },\n $defs: { hex: { type: 'string', pattern: '^#[0-9a-fA-F]{6}$' }, ...structureDefs() },\n };\n}\n"]}
@@ -0,0 +1,259 @@
1
+ import { type FontRoleName } from './themeApi.ts';
2
+ import { type ActionColors, type ThemeComponents } from './themeComponents.ts';
3
+ import { type ThemeDecor } from './themeDecor.ts';
4
+ import { type ThemeIcons } from './themeIcons.ts';
5
+ import { type ThemeVariants } from './themeVariants.ts';
6
+ export { FONT_ROLE_NAMES } from './themeApi.ts';
7
+ export type { FontRoleName } from './themeApi.ts';
8
+ export type Role = 'bg' | 'surface' | 'elevated' | 'border' | 'text' | 'muted' | 'accent';
9
+ /** The site's filled primary button (X: "Post"/"Follow"): an `inverse` background with an `onInverse` label. */
10
+ export type ButtonRole = 'inverse' | 'onInverse';
11
+ export type Palette = Record<Role, string> & Partial<Record<ButtonRole, string>>;
12
+ /**
13
+ * `page` is the canvas behind the site's columns (defaults to `bg`); the columns stay on `bg`.
14
+ * `actions` are the colors of a set action (liked, reposted, bookmarked) and of the reply hover;
15
+ * absent, the site's own action colors stay.
16
+ */
17
+ export type ThemeColors = Palette & {
18
+ page?: string;
19
+ actions?: ActionColors;
20
+ };
21
+ export type Density = 'compact' | 'default' | 'comfortable';
22
+ export type AvatarShape = 'circle' | 'rounded' | 'square';
23
+ export type Pattern = 'dots' | 'grid' | 'diagonal' | 'scanlines' | 'paper' | 'clouds';
24
+ export type Background = {
25
+ kind: 'none';
26
+ } | {
27
+ kind: 'gradient';
28
+ from: string;
29
+ to: string;
30
+ angle: number;
31
+ glow?: string;
32
+ } | {
33
+ kind: 'pattern';
34
+ pattern: Pattern;
35
+ ink: string;
36
+ opacity: number;
37
+ size: number;
38
+ } | {
39
+ kind: 'image';
40
+ url: string;
41
+ fit: 'cover' | 'tile';
42
+ dim: number;
43
+ };
44
+ /**
45
+ * One role's font (roles: themeApi.ts `FONT_ROLE_NAMES`). `family` is a font stack; empty keeps the
46
+ * inherited family and only changes the rest. `source: "google"` says the first family comes from
47
+ * Google Fonts (downloaded once, asked first when a theme is imported, loaded from bytes). `weight`
48
+ * (100-900), `size` (0.75-1.5, relative to the site's size), `tracking` (em) and `tabular` figures
49
+ * are optional; the interface role takes only `family`/`source` (its size, weights and tracking are
50
+ * `scale`, `weight`, `bold` and `tracking` of the whole theme).
51
+ */
52
+ export type FontRoleSpec = {
53
+ family: string[];
54
+ source?: 'google';
55
+ weight?: number;
56
+ size?: number;
57
+ tracking?: number;
58
+ tabular?: boolean;
59
+ };
60
+ export type FontRole = 'inherit' | FontRoleSpec;
61
+ export type FontRoles = Record<FontRoleName, FontRole>;
62
+ export type FontSpec = {
63
+ /**
64
+ * Interface font stack (replaces the site's own font everywhere). Empty keeps the site's.
65
+ * Shorthand kept for older theme files and older apps: it always equals `roles.interface`'s family.
66
+ */
67
+ family: string[];
68
+ /** Post text stack (e.g. a serif reading face); shorthand of `roles.post`'s family. */
69
+ tweet: string[];
70
+ /** Which font goes where. Every role inherits from `interface` unless it says otherwise. */
71
+ roles: FontRoles;
72
+ /** Multiplies the site's pixel font sizes (0.85-1.2). */
73
+ scale: number;
74
+ /** Regular weight (300-500) and bold weight (500-800) that replace the site's 400/700. */
75
+ weight: number;
76
+ bold: number;
77
+ /** Letter spacing in em (-0.03-0.06). */
78
+ tracking: number;
79
+ /** Line height multiplier for post text (0 keeps the site's). */
80
+ leading: number;
81
+ };
82
+ export type ShapeSpec = {
83
+ radius: number;
84
+ button: number;
85
+ avatar: AvatarShape;
86
+ };
87
+ export type LayoutSpec = {
88
+ column: number;
89
+ sidebar: number;
90
+ density: Density;
91
+ cards: boolean;
92
+ frame: boolean;
93
+ };
94
+ export type EffectsSpec = {
95
+ motion: number;
96
+ hover: 'none' | 'tint' | 'lift' | 'glow';
97
+ shadow: 'none' | 'soft' | 'deep';
98
+ crt: boolean;
99
+ };
100
+ export type ThemeSpec = {
101
+ id: string;
102
+ name: string;
103
+ description: string;
104
+ author: string;
105
+ version: 1;
106
+ /** Which way the theme leans; used for scrollbars/form controls and previews. */
107
+ mode: 'light' | 'dark' | 'auto';
108
+ /** null keeps the site's own colors (X: Default / Dim / Lights out). */
109
+ colors: ThemeColors | null;
110
+ font: FontSpec;
111
+ shape: ShapeSpec;
112
+ layout: LayoutSpec;
113
+ background: Background;
114
+ effects: EffectsSpec;
115
+ /** Free-form CSS appended last (owner-trusted, like Custom CSS). */
116
+ css: string;
117
+ /** How each piece of the site is built (themeComponents.ts). */
118
+ components?: ThemeComponents;
119
+ /** Structural choices: where the navigation sits, how a post is laid out (themeVariants.ts). */
120
+ variants?: ThemeVariants;
121
+ /** Lines, bars, focus ring, selection, scrollbars, motion (themeDecor.ts). */
122
+ decor?: ThemeDecor;
123
+ /** Which icon pack the theme suggests, with small adjustments (themeIcons.ts). */
124
+ icons?: ThemeIcons;
125
+ };
126
+ /** Panel overrides: any group may be partially overridden on top of the selected theme. */
127
+ export type ThemeOverrides = {
128
+ colors?: Partial<ThemeColors>;
129
+ /** `roles` is merged role by role (a named role replaces that role only). */
130
+ font?: Partial<Omit<FontSpec, 'roles'>> & {
131
+ roles?: Partial<FontRoles>;
132
+ };
133
+ shape?: Partial<ShapeSpec>;
134
+ layout?: Partial<LayoutSpec>;
135
+ background?: Background;
136
+ effects?: Partial<EffectsSpec>;
137
+ /** The theme's own CSS as edited in the panel (replaces the theme document's `css`). */
138
+ css?: {
139
+ text: string;
140
+ };
141
+ /** The owner's say on a theme's layout suggestions, axis by axis (an axis set to the site's own option switches it off). */
142
+ variants?: Record<string, string>;
143
+ };
144
+ export declare const BASE_SHAPE: ShapeSpec;
145
+ export declare const INHERIT_ROLES: FontRoles;
146
+ /** A font spec from the interface/post stacks alone (every other role inherits). */
147
+ export declare const withRoles: (font: Omit<FontSpec, "roles">) => FontSpec;
148
+ export declare const BASE_FONT: FontSpec;
149
+ export declare const BASE_LAYOUT: LayoutSpec;
150
+ export declare const BASE_EFFECTS: EffectsSpec;
151
+ /** The system UI stack themes put after their own sans-serif families. */
152
+ export declare const SYSTEM_SANS: string[];
153
+ export declare const isHex: (value: unknown) => value is string;
154
+ /** `#rrggbb` + alpha as `rgba()`. */
155
+ export declare const rgba: (hex: string, alpha: number) => string;
156
+ /** Moves `color` toward black or white until it reaches `ratio` against every surface. */
157
+ export declare function reach(color: string, surfaces: string[], ratio: number): string;
158
+ /**
159
+ * Guarantees legibility for any palette (built-in, imported or overridden): text, secondary text
160
+ * and links reach WCAG AA (4.5:1) on every surface, including the page canvas, and the site's filled
161
+ * button keeps a readable label and stands out from the page (3:1).
162
+ */
163
+ export declare function ensureContrast<T extends Palette & {
164
+ page?: string;
165
+ actions?: ActionColors;
166
+ }>(colors: T): T;
167
+ export declare const MAX_IMAGE_CHARS = 1100000;
168
+ export declare const MAX_CSS_CHARS = 60000;
169
+ export declare function sanitizeFonts(value: unknown): string[];
170
+ export declare function sanitizeBackground(value: unknown): Background;
171
+ /** Bounds of a role's own settings (the JSON Schema says the same; tested). */
172
+ export declare const ROLE_LIMITS: {
173
+ readonly weight: readonly [100, 900];
174
+ readonly size: readonly [0.75, 1.5];
175
+ readonly tracking: readonly [-0.05, 0.1];
176
+ };
177
+ /** One role from JSON: "inherit", or a stack with optional extras (clamped; unknown keys dropped). */
178
+ export declare function sanitizeFontRole(value: unknown, role: FontRoleName): FontRole;
179
+ /** A role with a new family, keeping its other settings (and its Google source only for the same font). */
180
+ export declare function withFamily(role: FontRole, family: string[], source?: 'google'): FontRole;
181
+ export declare const slug: (value: string) => string;
182
+ /** Any JSON to a complete, safe theme. Missing groups fall back to the schema's defaults. */
183
+ export declare function sanitizeSpec(input: unknown): ThemeSpec;
184
+ /** True when a theme carries any of the structure groups (components, variants, decoration, icons). */
185
+ export declare const hasStructure: (theme: ThemeSpec) => boolean;
186
+ /** Parses an imported file; errors are human-readable. */
187
+ export declare function parseThemeJson(json: string): {
188
+ theme: ThemeSpec;
189
+ warnings: string[];
190
+ } | {
191
+ error: string;
192
+ };
193
+ /** Applies panel overrides (and an accent) on top of a theme. Colors are then made legible. */
194
+ export declare function applyOverrides(theme: ThemeSpec, overrides?: ThemeOverrides, accent?: string | null): ThemeSpec;
195
+ /** True when a theme changes nothing about the site (the site's own look without overrides). */
196
+ export declare function isNeutral(theme: ThemeSpec): boolean;
197
+ /** Bundled families and the names they are registered under (shell: @fontsource; site pages: FontFace, fonts.ts). */
198
+ export declare const BUNDLED_FONTS: Record<string, string>;
199
+ export declare function fontStack(names: string[]): string;
200
+ /** Roles that are drawn inside the site's page (chrome is wayBetter's own window). */
201
+ export declare const PAGE_ROLES: FontRoleName[];
202
+ /** Bundled families (Geist, Geist Mono) a theme names in the site's page. */
203
+ export declare const bundledFontsUsed: (theme: ThemeSpec, roles?: readonly FontRoleName[]) => string[];
204
+ /** Google Fonts families a theme uses (`source: "google"`), for the given roles. */
205
+ export declare function googleFontsUsed(theme: ThemeSpec, roles?: readonly FontRoleName[]): string[];
206
+ /** A role resolved to what is drawn: the stack actually used and its settings. */
207
+ export type ResolvedFontRole = {
208
+ /** CSS `font-family`. */
209
+ stack: string;
210
+ /** The families of that stack (empty when it is the site's or app's own font). */
211
+ family: string[];
212
+ /** True when the family comes from another role (or the site/app default). */
213
+ inherited: boolean;
214
+ /** A Google Fonts family the stack starts with. */
215
+ google: string | null;
216
+ weight: number | null;
217
+ size: number;
218
+ tracking: number | null;
219
+ tabular: boolean;
220
+ };
221
+ export type ResolvedFontRoles = Record<FontRoleName, ResolvedFontRole>;
222
+ /**
223
+ * Every role resolved. `site` is the stack an inheriting interface uses: the site's own font in its
224
+ * page, wayBetter's own UI font in the shell. Every other role inherits the interface, except that an
225
+ * inheriting `mono` keeps a monospaced stack (`mono`: themeApi.ts `MONO_FAMILIES`, code rarely suits
226
+ * an interface font).
227
+ */
228
+ export declare function resolveFontRoles(font: FontSpec, site: string, mono?: string): ResolvedFontRoles;
229
+ /**
230
+ * A named font stack offered by the panel's pickers. `key` names its translated label
231
+ * (`wb.fonts.choice.*`); `label` is the English one. A site adds its own font first (X: "X's Chirp",
232
+ * an empty family that keeps the site's type).
233
+ */
234
+ export type FontChoice = {
235
+ id: string;
236
+ label: string;
237
+ key?: string;
238
+ family: string[];
239
+ };
240
+ /** Font choices offered by the panel; any installed family can also be named in theme JSON. */
241
+ export declare const FONT_CHOICES: FontChoice[];
242
+ /** The choice whose stack is exactly `family` in `choices`, or `custom`. */
243
+ export declare const fontChoiceOf: (family: string[], choices?: readonly FontChoice[]) => string;
244
+ /**
245
+ * The site's page background. A site's `<html>` and `<body>` are often one viewport tall while the
246
+ * content overflows them (X's timeline), so a background painted on both had `<body>` paint its own
247
+ * copy over its box, which scrolls away: after a partial scroll the gradient/glow showed only below a hard seam. Now
248
+ * `<html>` holds the plain page color, `<body>` is transparent (beating, by specificity, the
249
+ * palette's `html,body{background-color}` and its `[style^="background-color: …"]` remap of the
250
+ * inline color X puts on `<body>`) and every layer sits on one viewport-sized fixed
251
+ * layer behind all of the page (`z-index:-1` in the root stacking context), with no `fixed` attachments.
252
+ */
253
+ export declare function pageBackgroundCss(background: Background, page: string): string[];
254
+ /**
255
+ * CSS `background` layers for the page canvas (behind the site's columns). `attach` keeps the `fixed`
256
+ * attachments for a box that scrolls (the Theme Builder preview); the site's page gets the layers without
257
+ * them, on one viewport-sized fixed layer (`pageBackgroundCss`).
258
+ */
259
+ export declare function backgroundLayers(background: Background, page: string, attach?: boolean): string;