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,263 @@
1
+ // Icon packs: a standalone document (`*.icons.json`) of glyphs by semantic name (`home`, `like`,
2
+ // `reply`), drawn over a site's own icons. A theme only names a pack (a suggestion); the owner's icon
3
+ // choice is separate ("Follow the theme", a pack, or the site's own icons). Pure.
4
+ //
5
+ // A pack is data, never an SVG document: a glyph is path data (checked against a path grammar), a few
6
+ // colored layers of path data, or a small PNG. The engine builds the SVG itself, so no element,
7
+ // attribute, script or reference can arrive with a pack.
8
+ //
9
+ // Drawing: nothing in the site's DOM is rewritten. The site's own `<svg>` box gets the glyph as a CSS
10
+ // mask filled with `currentColor` (so the site's color states keep working: a liked heart stays the
11
+ // like color) and its own paths are made transparent. Colored glyphs (layers, PNG) are a background
12
+ // image instead. Which `<svg>` is which icon is the site's table (container first, path signature
13
+ // second). No glyph, no match or no pack: no rule, the site's icon stays.
14
+ import { COLOR_ROLES } from "./themeComponents.js";
15
+ /** Semantic names a pack may draw. `.active` is a selected navigation item, `.on` an action that is set. */
16
+ export const ICON_NAMES = [
17
+ 'home', 'home.active', 'explore', 'explore.active', 'notifications', 'notifications.active', 'messages', 'messages.active',
18
+ 'grok', 'bookmarks', 'bookmarks.active', 'lists', 'communities', 'premium', 'profile', 'profile.active', 'more', 'compose',
19
+ 'reply', 'repost', 'repost.on', 'like', 'like.on', 'views', 'bookmark', 'bookmark.on', 'share',
20
+ 'verified', 'logo', 'caret', 'back', 'close', 'search', 'settings',
21
+ 'media', 'gif', 'poll', 'emoji', 'schedule', 'location', 'pinned', 'repostContext', 'lock',
22
+ ];
23
+ export const ICON_GROUPS = ['nav', 'actions', 'composer', 'misc'];
24
+ /** Limits of a pack (the JSON Schema and the Store check say the same). */
25
+ export const ICON_LIMITS = { names: 64, pathChars: 4000, layers: 6, pngChars: 6000, packBytes: 120_000, labelChars: 12, overrides: 8 };
26
+ /** Path data only: commands, numbers, separators. */
27
+ export const PATH_GRAMMAR = /^[MmLlHhVvCcSsQqTtAaZz0-9eE\s,.+-]{1,4000}$/;
28
+ const PNG_DATA = /^data:image\/png;base64,[A-Za-z0-9+/]+={0,2}$/;
29
+ const HEX = /^#[0-9a-f]{6}$/i;
30
+ /** Words a theme or pack may put next to an action: written into CSS strings. */
31
+ const LABEL_TEXT = /^[\p{L}\p{N} [\]().:+\-_/#@*~!?]{1,12}$/u;
32
+ export const BASE_ICON_STYLE = { stroke: 1.75, cap: 'round', join: 'round', scale: 1 };
33
+ export const ICON_LABEL_NAMES = ['reply', 'repost', 'like', 'views', 'bookmark', 'share'];
34
+ const obj = (value) => value && typeof value === 'object' && !Array.isArray(value) ? value : {};
35
+ const plain = (value, max) => typeof value === 'string' ? value.replace(/[\u0000-\u001f\u007f<>]/g, '').trim().slice(0, max) : '';
36
+ const num = (value, min, max, fallback) => typeof value === 'number' && Number.isFinite(value) ? Math.min(max, Math.max(min, value)) : fallback;
37
+ const path = (value) => typeof value === 'string' && PATH_GRAMMAR.test(value);
38
+ function sanitizeFill(value) {
39
+ if (typeof value === 'string')
40
+ return COLOR_ROLES.includes(value) ? value : HEX.test(value) ? value.toLowerCase() : null;
41
+ const source = obj(value);
42
+ return typeof source.from === 'string' && typeof source.to === 'string' && HEX.test(source.from) && HEX.test(source.to) ? { from: source.from.toLowerCase(), to: source.to.toLowerCase() } : null;
43
+ }
44
+ /** One glyph from JSON, or null when it is not valid path data, layers or a small PNG. */
45
+ export function sanitizeGlyph(value) {
46
+ const source = obj(value);
47
+ if (path(source.d))
48
+ return { d: source.d.trim(), ...(source.rule === 'evenodd' ? { rule: 'evenodd' } : {}), ...(source.stroke === true ? { stroke: true } : {}) };
49
+ if (Array.isArray(source.layers)) {
50
+ const layers = source.layers.slice(0, ICON_LIMITS.layers).flatMap(raw => {
51
+ const layer = obj(raw), fill = sanitizeFill(layer.fill);
52
+ if (!path(layer.d) || !fill)
53
+ return [];
54
+ return [{ d: layer.d.trim(), fill, ...(typeof layer.opacity === 'number' ? { opacity: +num(layer.opacity, 0, 1, 1).toFixed(2) } : {}), ...(layer.rule === 'evenodd' ? { rule: 'evenodd' } : {}) }];
55
+ });
56
+ return layers.length ? { layers } : null;
57
+ }
58
+ if (typeof source.png === 'string' && source.png.length <= ICON_LIMITS.pngChars + 22 && PNG_DATA.test(source.png))
59
+ return { png: source.png, ...(source.pixel === true ? { pixel: true } : {}) };
60
+ return null;
61
+ }
62
+ export const sanitizeIconStyle = (value, base = BASE_ICON_STYLE) => {
63
+ const source = obj(value);
64
+ const pick = (item, options, fallback) => options.includes(item) ? item : fallback;
65
+ return {
66
+ stroke: +num(source.stroke, 1, 2.5, base.stroke).toFixed(2), cap: pick(source.cap, ['round', 'square', 'butt'], base.cap),
67
+ join: pick(source.join, ['round', 'miter', 'bevel'], base.join), scale: +num(source.scale, 0.8, 1.25, base.scale).toFixed(2),
68
+ };
69
+ };
70
+ function sanitizeGlyphs(value, max) {
71
+ const source = obj(value);
72
+ const out = {};
73
+ let count = 0;
74
+ for (const name of ICON_NAMES) {
75
+ if (count >= max || !Object.hasOwn(source, name))
76
+ continue;
77
+ const glyph = sanitizeGlyph(source[name]);
78
+ if (glyph) {
79
+ out[name] = glyph;
80
+ count++;
81
+ }
82
+ }
83
+ return out;
84
+ }
85
+ function sanitizeSymbols(value) {
86
+ const source = obj(value);
87
+ const out = {};
88
+ if (source.like === 'heart' || source.like === 'star' || source.like === 'custom')
89
+ out.like = source.like;
90
+ if (['dot', 'bullet', 'slash', 'dash', 'pipe', 'none'].includes(source.separator))
91
+ out.separator = source.separator;
92
+ return Object.keys(out).length ? out : undefined;
93
+ }
94
+ function sanitizeLabels(value) {
95
+ const source = obj(value);
96
+ const out = {};
97
+ for (const name of ICON_LABEL_NAMES)
98
+ if (typeof source[name] === 'string' && LABEL_TEXT.test(source[name]))
99
+ out[name] = source[name].trim();
100
+ return Object.keys(out).length ? out : undefined;
101
+ }
102
+ /** Any JSON to a valid pack, or null when it has no id, no name or no valid glyph. */
103
+ export function sanitizeIconPack(input) {
104
+ const source = obj(input);
105
+ const name = plain(source.name, 60);
106
+ const id = typeof source.id === 'string' && /^[a-z0-9-]{1,40}$/.test(source.id) ? source.id : '';
107
+ const glyphs = sanitizeGlyphs(source.glyphs, ICON_LIMITS.names);
108
+ if (!id || !name || !Object.keys(glyphs).length)
109
+ return null;
110
+ const symbols = sanitizeSymbols(source.symbols), labels = sanitizeLabels(source.labels);
111
+ return {
112
+ id, name, description: plain(source.description, 200), author: plain(source.author, 60), license: plain(source.license, 60) || 'unknown',
113
+ source: plain(source.source, 200), credits: plain(source.credits, 400), version: 1, style: sanitizeIconStyle(source.style), glyphs,
114
+ ...(symbols ? { symbols } : {}), ...(labels ? { labels } : {}),
115
+ };
116
+ }
117
+ /** Parses an imported `*.icons.json`; errors are human-readable. */
118
+ export function parseIconPackJson(json) {
119
+ if (json.length > ICON_LIMITS.packBytes)
120
+ return { error: 'This icon pack is larger than 120 KB.' };
121
+ let raw;
122
+ try {
123
+ raw = JSON.parse(json);
124
+ }
125
+ catch {
126
+ return { error: 'This file is not valid JSON.' };
127
+ }
128
+ const pack = sanitizeIconPack(raw);
129
+ if (!pack)
130
+ return { error: 'An icon pack needs an "id", a "name" and at least one valid glyph.' };
131
+ const dropped = Object.keys(obj(obj(raw).glyphs)).length - Object.keys(pack.glyphs).length;
132
+ const warnings = [];
133
+ if (dropped > 0)
134
+ warnings.push(`${dropped} glyph(s) were ignored: unknown names, or drawings that are not plain path data.`);
135
+ if (pack.license === 'unknown')
136
+ warnings.push('This pack does not say under which license its drawings are.');
137
+ return { pack, warnings };
138
+ }
139
+ /** The `icons` group of a theme from JSON. Null when it says nothing valid. */
140
+ export function sanitizeThemeIcons(value) {
141
+ const source = obj(value);
142
+ const out = {};
143
+ if (typeof source.pack === 'string' && /^[a-z0-9-]{1,40}$/.test(source.pack))
144
+ out.pack = source.pack;
145
+ if (Object.keys(obj(source.style)).length) {
146
+ const style = obj(source.style), full = sanitizeIconStyle(style);
147
+ out.style = Object.fromEntries(['stroke', 'cap', 'join', 'scale'].filter(key => key in style).map(key => [key, full[key]]));
148
+ }
149
+ const overrides = sanitizeGlyphs(source.overrides, ICON_LIMITS.overrides);
150
+ if (Object.keys(overrides).length)
151
+ out.overrides = overrides;
152
+ const symbols = sanitizeSymbols(source.symbols);
153
+ if (symbols)
154
+ out.symbols = symbols;
155
+ const labels = sanitizeLabels(source.labels);
156
+ if (labels)
157
+ out.labels = labels;
158
+ return Object.keys(out).length ? out : null;
159
+ }
160
+ export const normalizeIconChoice = (value) => typeof value === 'string' && /^[a-z0-9-]{1,40}$/.test(value) ? value : 'theme';
161
+ export function createIconCatalog(builtins, installed = []) {
162
+ const packs = [...builtins, ...installed.filter(pack => !builtins.some(item => item.id === pack.id))];
163
+ const get = (id) => packs.find(pack => pack.id === id) ?? null;
164
+ return { packs, get, resolve: (choice, theme) => choice === 'site' ? null : choice === 'theme' ? get(theme?.pack) : get(choice) };
165
+ }
166
+ // ---------------------------------------------------------------------------------------------
167
+ // Drawing
168
+ const esc = (value) => value.replace(/[<>&"']/g, '');
169
+ const paint = (fill, colors, id) => {
170
+ if (typeof fill === 'string')
171
+ return { attr: HEX.test(fill) ? fill : colors?.[fill] ?? '#000000', def: '' };
172
+ return { attr: `url(#${id})`, def: `<linearGradient id="${id}" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="${esc(fill.from)}"/><stop offset="1" stop-color="${esc(fill.to)}"/></linearGradient>` };
173
+ };
174
+ /** The SVG document of a glyph, built from validated data. `colors` resolves role fills of layers; a single path is black (it is used as a mask). */
175
+ export function glyphSvg(glyph, style, colors = null) {
176
+ const open = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">';
177
+ if ('d' in glyph) {
178
+ const attrs = glyph.stroke
179
+ ? `fill="none" stroke="#000" stroke-width="${style.stroke}" stroke-linecap="${style.cap}" stroke-linejoin="${style.join}"`
180
+ : `fill="#000"${glyph.rule ? ' fill-rule="evenodd"' : ''}`;
181
+ return `${open}<path d="${esc(glyph.d)}" ${attrs}/></svg>`;
182
+ }
183
+ if ('layers' in glyph) {
184
+ const defs = [];
185
+ const paths = glyph.layers.map((layer, index) => {
186
+ const { attr, def } = paint(layer.fill, colors, `g${index}`);
187
+ if (def)
188
+ defs.push(def);
189
+ return `<path d="${esc(layer.d)}" fill="${attr}"${layer.opacity !== undefined ? ` opacity="${layer.opacity}"` : ''}${layer.rule ? ' fill-rule="evenodd"' : ''}/>`;
190
+ });
191
+ return `${open}${defs.length ? `<defs>${defs.join('')}</defs>` : ''}${paths.join('')}</svg>`;
192
+ }
193
+ return null;
194
+ }
195
+ const svgUrl = (svg) => `url("data:image/svg+xml,${encodeURIComponent(svg).replace(/'/g, '%27').replace(/"/g, '%22')}")`;
196
+ /** True for glyphs that carry their own colors (drawn as an image, not as a mask of the current color). */
197
+ export const isColored = (glyph) => !('d' in glyph);
198
+ /** Selectors of the `<svg>` boxes of one icon. */
199
+ export function iconSelectors(matcher) {
200
+ const out = [];
201
+ if (matcher.ctx)
202
+ out.push(...matcher.ctx.split(/,(?![^(]*\))/).map(one => one.trim()));
203
+ for (const prefix of matcher.sig ?? [])
204
+ if (PATH_GRAMMAR.test(prefix))
205
+ out.push(`svg:has(> g > path[d^="${prefix}"])`);
206
+ return out;
207
+ }
208
+ /**
209
+ * CSS that draws `pack` over a site's icons. One rule per glyph the pack has and the site's table
210
+ * knows, inside guards: forced colors remove backgrounds (a masked icon would vanish) and an engine
211
+ * without masks would paint solid squares.
212
+ */
213
+ export function compileIcons(pack, theme, table, ctx) {
214
+ if (ctx.allowed === false)
215
+ return '';
216
+ const glyphs = { ...pack?.glyphs, ...theme?.overrides };
217
+ const style = { ...(pack?.style ?? BASE_ICON_STYLE), ...theme?.style };
218
+ const masked = [], colored = [], hidden = [];
219
+ for (const name of ICON_NAMES) {
220
+ const glyph = glyphs[name], matcher = table[name];
221
+ if (!glyph || !matcher)
222
+ continue;
223
+ const gate = ctx.gate ? `html[${ctx.gate}~="${matcher.group}"] ` : '';
224
+ const selectors = iconSelectors(matcher).map(one => `${gate}${one}`);
225
+ if (!selectors.length)
226
+ continue;
227
+ const size = `${Math.round(style.scale * 100)}%`;
228
+ if ('png' in glyph) {
229
+ colored.push(`${selectors.join(',')}{background:url("${glyph.png}") center / ${size} no-repeat !important;${glyph.pixel ? 'image-rendering:pixelated;' : ''}}`);
230
+ }
231
+ else {
232
+ const svg = glyphSvg(glyph, style, ctx.colors);
233
+ if (!svg)
234
+ continue;
235
+ if (isColored(glyph))
236
+ colored.push(`${selectors.join(',')}{background:${svgUrl(svg)} center / ${size} no-repeat !important}`);
237
+ else
238
+ masked.push(`${selectors.join(',')}{background-color:currentColor !important;-webkit-mask:${svgUrl(svg)} center / ${size} no-repeat;mask:${svgUrl(svg)} center / ${size} no-repeat}`);
239
+ }
240
+ hidden.push(...selectors.map(one => `${one} > *`));
241
+ }
242
+ if (!hidden.length)
243
+ return '';
244
+ const hide = `${hidden.join(',')}{opacity:0 !important}`;
245
+ const images = colored.length ? `${colored.join('\n')}\n` : '';
246
+ // Colored glyphs need no mask support; masked ones are dropped together with their hiding rule where masks are missing.
247
+ if (!masked.length)
248
+ return `@media (forced-colors:none){\n${images}${hide}\n}`;
249
+ return `@media (forced-colors:none){@supports ((mask-image:url("")) or (-webkit-mask-image:url(""))){\n${images}${masked.join('\n')}\n${hide}\n}}`;
250
+ }
251
+ /** The groups of `table` whose core icons are all on the page (`has(selector)` says whether one matches). Empty table entries count as present. */
252
+ export function iconGroupsPresent(table, has) {
253
+ return ICON_GROUPS.filter(group => {
254
+ const core = ICON_NAMES.map(name => table[name]).filter((matcher) => !!matcher && matcher.group === group && !!matcher.core);
255
+ return core.every(matcher => iconSelectors(matcher).some(selector => { try {
256
+ return has(selector);
257
+ }
258
+ catch {
259
+ return false;
260
+ } }));
261
+ });
262
+ }
263
+ //# sourceMappingURL=themeIcons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeIcons.js","sourceRoot":"","sources":["../../../runtime/src/themeIcons.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,sGAAsG;AACtG,kFAAkF;AAClF,EAAE;AACF,sGAAsG;AACtG,gGAAgG;AAChG,yDAAyD;AACzD,EAAE;AACF,sGAAsG;AACtG,oGAAoG;AACpG,oGAAoG;AACpG,kGAAkG;AAClG,0EAA0E;AAE1E,OAAO,EAAE,WAAW,EAAmC,MAAM,sBAAsB,CAAC;AAEpF,4GAA4G;AAC5G,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,gBAAgB,EAAE,eAAe,EAAE,sBAAsB,EAAE,UAAU,EAAE,iBAAiB;IAC1H,MAAM,EAAE,WAAW,EAAE,kBAAkB,EAAE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,EAAE,SAAS;IAC1H,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO;IAC9F,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU;IAClE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM;CAClF,CAAC;AAEX,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAU,CAAC;AAG3E,2EAA2E;AAC3E,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EA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C,CAAC,CAAC;IACnI,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Icon packs: a standalone document (`*.icons.json`) of glyphs by semantic name (`home`, `like`,\n// `reply`), drawn over a site's own icons. A theme only names a pack (a suggestion); the owner's icon\n// choice is separate (\"Follow the theme\", a pack, or the site's own icons). Pure.\n//\n// A pack is data, never an SVG document: a glyph is path data (checked against a path grammar), a few\n// colored layers of path data, or a small PNG. The engine builds the SVG itself, so no element,\n// attribute, script or reference can arrive with a pack.\n//\n// Drawing: nothing in the site's DOM is rewritten. The site's own `<svg>` box gets the glyph as a CSS\n// mask filled with `currentColor` (so the site's color states keep working: a liked heart stays the\n// like color) and its own paths are made transparent. Colored glyphs (layers, PNG) are a background\n// image instead. Which `<svg>` is which icon is the site's table (container first, path signature\n// second). No glyph, no match or no pack: no rule, the site's icon stays.\n\nimport { COLOR_ROLES, type ColorRole, type RoleColors } from './themeComponents.ts';\n\n/** Semantic names a pack may draw. `.active` is a selected navigation item, `.on` an action that is set. */\nexport const ICON_NAMES = [\n 'home', 'home.active', 'explore', 'explore.active', 'notifications', 'notifications.active', 'messages', 'messages.active',\n 'grok', 'bookmarks', 'bookmarks.active', 'lists', 'communities', 'premium', 'profile', 'profile.active', 'more', 'compose',\n 'reply', 'repost', 'repost.on', 'like', 'like.on', 'views', 'bookmark', 'bookmark.on', 'share',\n 'verified', 'logo', 'caret', 'back', 'close', 'search', 'settings',\n 'media', 'gif', 'poll', 'emoji', 'schedule', 'location', 'pinned', 'repostContext', 'lock',\n] as const;\nexport type IconName = typeof ICON_NAMES[number];\nexport const ICON_GROUPS = ['nav', 'actions', 'composer', 'misc'] as const;\nexport type IconGroup = typeof ICON_GROUPS[number];\n\n/** Limits of a pack (the JSON Schema and the Store check say the same). */\nexport const ICON_LIMITS = { names: 64, pathChars: 4000, layers: 6, pngChars: 6000, packBytes: 120_000, labelChars: 12, overrides: 8 } as const;\n/** Path data only: commands, numbers, separators. */\nexport const PATH_GRAMMAR = /^[MmLlHhVvCcSsQqTtAaZz0-9eE\\s,.+-]{1,4000}$/;\nconst PNG_DATA = /^data:image\\/png;base64,[A-Za-z0-9+/]+={0,2}$/;\nconst HEX = /^#[0-9a-f]{6}$/i;\n/** Words a theme or pack may put next to an action: written into CSS strings. */\nconst LABEL_TEXT = /^[\\p{L}\\p{N} [\\]().:+\\-_/#@*~!?]{1,12}$/u;\n\nexport type IconFill = ColorRole | string | { from: string; to: string };\nexport type IconGlyph =\n | { d: string; rule?: 'evenodd'; stroke?: boolean }\n | { layers: Array<{ d: string; fill: IconFill; opacity?: number; rule?: 'evenodd' }> }\n | { png: string; pixel?: boolean };\nexport type IconStyle = { stroke: number; cap: 'round' | 'square' | 'butt'; join: 'round' | 'miter' | 'bevel'; scale: number };\nexport const BASE_ICON_STYLE: IconStyle = { stroke: 1.75, cap: 'round', join: 'round', scale: 1 };\nexport const ICON_LABEL_NAMES = ['reply', 'repost', 'like', 'views', 'bookmark', 'share'] as const;\nexport type IconLabels = Partial<Record<typeof ICON_LABEL_NAMES[number], string>>;\nexport type IconSymbols = { like?: 'heart' | 'star' | 'custom'; separator?: 'dot' | 'bullet' | 'slash' | 'dash' | 'pipe' | 'none' };\n\nexport type IconPack = {\n id: string;\n name: string;\n description: string;\n author: string;\n /** SPDX id, or `own` for the author's own drawings, or a plain name for artwork under other terms. */\n license: string;\n /** Where the drawings come from (a project name or URL as text) and whom to credit. */\n source: string;\n credits: string;\n version: 1;\n style: IconStyle;\n glyphs: Partial<Record<IconName, IconGlyph>>;\n symbols?: IconSymbols;\n labels?: IconLabels;\n};\n\n/** What a theme says about icons: a pack by id, plus small adjustments. Never a whole pack. */\nexport type ThemeIcons = { pack?: string; style?: Partial<IconStyle>; overrides?: Partial<Record<IconName, IconGlyph>>; symbols?: IconSymbols; labels?: IconLabels };\n\nconst obj = (value: unknown): Record<string, unknown> => value && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {};\nconst plain = (value: unknown, max: number) => typeof value === 'string' ? value.replace(/[\\u0000-\\u001f\\u007f<>]/g, '').trim().slice(0, max) : '';\nconst num = (value: unknown, min: number, max: number, fallback: number) => typeof value === 'number' && Number.isFinite(value) ? Math.min(max, Math.max(min, value)) : fallback;\nconst path = (value: unknown): value is string => typeof value === 'string' && PATH_GRAMMAR.test(value);\n\nfunction sanitizeFill(value: unknown): IconFill | null {\n if (typeof value === 'string') return (COLOR_ROLES as readonly string[]).includes(value) ? value : HEX.test(value) ? value.toLowerCase() : null;\n const source = obj(value);\n return typeof source.from === 'string' && typeof source.to === 'string' && HEX.test(source.from) && HEX.test(source.to) ? { from: source.from.toLowerCase(), to: source.to.toLowerCase() } : null;\n}\n\n/** One glyph from JSON, or null when it is not valid path data, layers or a small PNG. */\nexport function sanitizeGlyph(value: unknown): IconGlyph | null {\n const source = obj(value);\n if (path(source.d)) return { d: source.d.trim(), ...(source.rule === 'evenodd' ? { rule: 'evenodd' as const } : {}), ...(source.stroke === true ? { stroke: true } : {}) };\n if (Array.isArray(source.layers)) {\n const layers = source.layers.slice(0, ICON_LIMITS.layers).flatMap(raw => {\n const layer = obj(raw), fill = sanitizeFill(layer.fill);\n if (!path(layer.d) || !fill) return [];\n return [{ d: layer.d.trim(), fill, ...(typeof layer.opacity === 'number' ? { opacity: +num(layer.opacity, 0, 1, 1).toFixed(2) } : {}), ...(layer.rule === 'evenodd' ? { rule: 'evenodd' as const } : {}) }];\n });\n return layers.length ? { layers } : null;\n }\n if (typeof source.png === 'string' && source.png.length <= ICON_LIMITS.pngChars + 22 && PNG_DATA.test(source.png)) return { png: source.png, ...(source.pixel === true ? { pixel: true } : {}) };\n return null;\n}\n\nexport const sanitizeIconStyle = (value: unknown, base: IconStyle = BASE_ICON_STYLE): IconStyle => {\n const source = obj(value);\n const pick = <T extends string>(item: unknown, options: readonly T[], fallback: T) => options.includes(item as T) ? item as T : fallback;\n return {\n stroke: +num(source.stroke, 1, 2.5, base.stroke).toFixed(2), cap: pick(source.cap, ['round', 'square', 'butt'] as const, base.cap),\n join: pick(source.join, ['round', 'miter', 'bevel'] as const, base.join), scale: +num(source.scale, 0.8, 1.25, base.scale).toFixed(2),\n };\n};\n\nfunction sanitizeGlyphs(value: unknown, max: number): Partial<Record<IconName, IconGlyph>> {\n const source = obj(value);\n const out: Partial<Record<IconName, IconGlyph>> = {};\n let count = 0;\n for (const name of ICON_NAMES) {\n if (count >= max || !Object.hasOwn(source, name)) continue;\n const glyph = sanitizeGlyph(source[name]);\n if (glyph) { out[name] = glyph; count++; }\n }\n return out;\n}\nfunction sanitizeSymbols(value: unknown): IconSymbols | undefined {\n const source = obj(value);\n const out: IconSymbols = {};\n if (source.like === 'heart' || source.like === 'star' || source.like === 'custom') out.like = source.like;\n if (['dot', 'bullet', 'slash', 'dash', 'pipe', 'none'].includes(source.separator as string)) out.separator = source.separator as IconSymbols['separator'];\n return Object.keys(out).length ? out : undefined;\n}\nfunction sanitizeLabels(value: unknown): IconLabels | undefined {\n const source = obj(value);\n const out: IconLabels = {};\n for (const name of ICON_LABEL_NAMES) if (typeof source[name] === 'string' && LABEL_TEXT.test(source[name] as string)) out[name] = (source[name] as string).trim();\n return Object.keys(out).length ? out : undefined;\n}\n\n/** Any JSON to a valid pack, or null when it has no id, no name or no valid glyph. */\nexport function sanitizeIconPack(input: unknown): IconPack | null {\n const source = obj(input);\n const name = plain(source.name, 60);\n const id = typeof source.id === 'string' && /^[a-z0-9-]{1,40}$/.test(source.id) ? source.id : '';\n const glyphs = sanitizeGlyphs(source.glyphs, ICON_LIMITS.names);\n if (!id || !name || !Object.keys(glyphs).length) return null;\n const symbols = sanitizeSymbols(source.symbols), labels = sanitizeLabels(source.labels);\n return {\n id, name, description: plain(source.description, 200), author: plain(source.author, 60), license: plain(source.license, 60) || 'unknown',\n source: plain(source.source, 200), credits: plain(source.credits, 400), version: 1, style: sanitizeIconStyle(source.style), glyphs,\n ...(symbols ? { symbols } : {}), ...(labels ? { labels } : {}),\n };\n}\n\n/** Parses an imported `*.icons.json`; errors are human-readable. */\nexport function parseIconPackJson(json: string): { pack: IconPack; warnings: string[] } | { error: string } {\n if (json.length > ICON_LIMITS.packBytes) return { error: 'This icon pack is larger than 120 KB.' };\n let raw: unknown;\n try { raw = JSON.parse(json); } catch { return { error: 'This file is not valid JSON.' }; }\n const pack = sanitizeIconPack(raw);\n if (!pack) return { error: 'An icon pack needs an \"id\", a \"name\" and at least one valid glyph.' };\n const dropped = Object.keys(obj(obj(raw).glyphs)).length - Object.keys(pack.glyphs).length;\n const warnings: string[] = [];\n if (dropped > 0) warnings.push(`${dropped} glyph(s) were ignored: unknown names, or drawings that are not plain path data.`);\n if (pack.license === 'unknown') warnings.push('This pack does not say under which license its drawings are.');\n return { pack, warnings };\n}\n\n/** The `icons` group of a theme from JSON. Null when it says nothing valid. */\nexport function sanitizeThemeIcons(value: unknown): ThemeIcons | null {\n const source = obj(value);\n const out: ThemeIcons = {};\n if (typeof source.pack === 'string' && /^[a-z0-9-]{1,40}$/.test(source.pack)) out.pack = source.pack;\n if (Object.keys(obj(source.style)).length) {\n const style = obj(source.style), full = sanitizeIconStyle(style);\n out.style = Object.fromEntries((['stroke', 'cap', 'join', 'scale'] as const).filter(key => key in style).map(key => [key, full[key]])) as Partial<IconStyle>;\n }\n const overrides = sanitizeGlyphs(source.overrides, ICON_LIMITS.overrides);\n if (Object.keys(overrides).length) out.overrides = overrides;\n const symbols = sanitizeSymbols(source.symbols); if (symbols) out.symbols = symbols;\n const labels = sanitizeLabels(source.labels); if (labels) out.labels = labels;\n return Object.keys(out).length ? out : null;\n}\n\n// ---------------------------------------------------------------------------------------------\n// The owner's choice and the catalog\n\n/** `theme`: follow the theme's suggestion; `site`: the site's own icons; otherwise a pack id. */\nexport type IconChoice = 'theme' | 'site' | string;\nexport const normalizeIconChoice = (value: unknown): IconChoice => typeof value === 'string' && /^[a-z0-9-]{1,40}$/.test(value) ? value : 'theme';\n\nexport type IconCatalog = {\n packs: readonly IconPack[];\n get(id: string | undefined): IconPack | null;\n /** The pack that is drawn: the owner's pick, else the theme's suggestion; null for the site's own icons or an unknown pack. */\n resolve(choice: IconChoice, theme: ThemeIcons | null | undefined): IconPack | null;\n};\nexport function createIconCatalog(builtins: readonly IconPack[], installed: readonly IconPack[] = []): IconCatalog {\n const packs = [...builtins, ...installed.filter(pack => !builtins.some(item => item.id === pack.id))];\n const get = (id: string | undefined) => packs.find(pack => pack.id === id) ?? null;\n return { packs, get, resolve: (choice, theme) => choice === 'site' ? null : choice === 'theme' ? get(theme?.pack) : get(choice) };\n}\n\n// ---------------------------------------------------------------------------------------------\n// Drawing\n\nconst esc = (value: string) => value.replace(/[<>&\"']/g, '');\nconst paint = (fill: IconFill, colors: RoleColors | null, id: string): { attr: string; def: string } => {\n if (typeof fill === 'string') return { attr: HEX.test(fill) ? fill : colors?.[fill as ColorRole] ?? '#000000', def: '' };\n return { attr: `url(#${id})`, def: `<linearGradient id=\"${id}\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\"><stop offset=\"0\" stop-color=\"${esc(fill.from)}\"/><stop offset=\"1\" stop-color=\"${esc(fill.to)}\"/></linearGradient>` };\n};\n\n/** The SVG document of a glyph, built from validated data. `colors` resolves role fills of layers; a single path is black (it is used as a mask). */\nexport function glyphSvg(glyph: IconGlyph, style: IconStyle, colors: RoleColors | null = null): string | null {\n const open = '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">';\n if ('d' in glyph) {\n const attrs = glyph.stroke\n ? `fill=\"none\" stroke=\"#000\" stroke-width=\"${style.stroke}\" stroke-linecap=\"${style.cap}\" stroke-linejoin=\"${style.join}\"`\n : `fill=\"#000\"${glyph.rule ? ' fill-rule=\"evenodd\"' : ''}`;\n return `${open}<path d=\"${esc(glyph.d)}\" ${attrs}/></svg>`;\n }\n if ('layers' in glyph) {\n const defs: string[] = [];\n const paths = glyph.layers.map((layer, index) => {\n const { attr, def } = paint(layer.fill, colors, `g${index}`);\n if (def) defs.push(def);\n return `<path d=\"${esc(layer.d)}\" fill=\"${attr}\"${layer.opacity !== undefined ? ` opacity=\"${layer.opacity}\"` : ''}${layer.rule ? ' fill-rule=\"evenodd\"' : ''}/>`;\n });\n return `${open}${defs.length ? `<defs>${defs.join('')}</defs>` : ''}${paths.join('')}</svg>`;\n }\n return null;\n}\nconst svgUrl = (svg: string) => `url(\"data:image/svg+xml,${encodeURIComponent(svg).replace(/'/g, '%27').replace(/\"/g, '%22')}\")`;\n/** True for glyphs that carry their own colors (drawn as an image, not as a mask of the current color). */\nexport const isColored = (glyph: IconGlyph) => !('d' in glyph);\n\n/** How a site finds one of its icons: the container that holds it (stable hooks), else the start of its path data. */\nexport type IconMatcher = {\n /** Selector of the icon's `<svg>` by its container (`[data-testid=\"like\"] svg`). */\n ctx?: string;\n /** Prefixes of the site's own path data for this icon, for icons without a container hook. */\n sig?: readonly string[];\n group: IconGroup;\n /** Needed for its group to be drawn at all (a rail never shows half ours, half the site's). */\n core?: boolean;\n};\nexport type IconTable = Partial<Record<IconName, IconMatcher>>;\n\n/** Selectors of the `<svg>` boxes of one icon. */\nexport function iconSelectors(matcher: IconMatcher): string[] {\n const out: string[] = [];\n if (matcher.ctx) out.push(...matcher.ctx.split(/,(?![^(]*\\))/).map(one => one.trim()));\n for (const prefix of matcher.sig ?? []) if (PATH_GRAMMAR.test(prefix)) out.push(`svg:has(> g > path[d^=\"${prefix}\"])`);\n return out;\n}\n\nexport type IconContext = {\n colors: RoleColors | null;\n /** Attribute on `<html>` that lists the groups that are on (`data-wb-icons=\"nav actions\"`); absent: every group draws. */\n gate?: string;\n /** The owner lets themes and packs change icons (default: yes). */\n allowed?: boolean;\n};\n\n/**\n * CSS that draws `pack` over a site's icons. One rule per glyph the pack has and the site's table\n * knows, inside guards: forced colors remove backgrounds (a masked icon would vanish) and an engine\n * without masks would paint solid squares.\n */\nexport function compileIcons(pack: IconPack | null, theme: ThemeIcons | null | undefined, table: IconTable, ctx: IconContext): string {\n if (ctx.allowed === false) return '';\n const glyphs: Partial<Record<IconName, IconGlyph>> = { ...pack?.glyphs, ...theme?.overrides };\n const style = { ...(pack?.style ?? BASE_ICON_STYLE), ...theme?.style };\n const masked: string[] = [], colored: string[] = [], hidden: string[] = [];\n for (const name of ICON_NAMES) {\n const glyph = glyphs[name], matcher = table[name];\n if (!glyph || !matcher) continue;\n const gate = ctx.gate ? `html[${ctx.gate}~=\"${matcher.group}\"] ` : '';\n const selectors = iconSelectors(matcher).map(one => `${gate}${one}`);\n if (!selectors.length) continue;\n const size = `${Math.round(style.scale * 100)}%`;\n if ('png' in glyph) {\n colored.push(`${selectors.join(',')}{background:url(\"${glyph.png}\") center / ${size} no-repeat !important;${glyph.pixel ? 'image-rendering:pixelated;' : ''}}`);\n } else {\n const svg = glyphSvg(glyph, style, ctx.colors);\n if (!svg) continue;\n if (isColored(glyph)) colored.push(`${selectors.join(',')}{background:${svgUrl(svg)} center / ${size} no-repeat !important}`);\n else masked.push(`${selectors.join(',')}{background-color:currentColor !important;-webkit-mask:${svgUrl(svg)} center / ${size} no-repeat;mask:${svgUrl(svg)} center / ${size} no-repeat}`);\n }\n hidden.push(...selectors.map(one => `${one} > *`));\n }\n if (!hidden.length) return '';\n const hide = `${hidden.join(',')}{opacity:0 !important}`;\n const images = colored.length ? `${colored.join('\\n')}\\n` : '';\n // Colored glyphs need no mask support; masked ones are dropped together with their hiding rule where masks are missing.\n if (!masked.length) return `@media (forced-colors:none){\\n${images}${hide}\\n}`;\n return `@media (forced-colors:none){@supports ((mask-image:url(\"\")) or (-webkit-mask-image:url(\"\"))){\\n${images}${masked.join('\\n')}\\n${hide}\\n}}`;\n}\n\n/** The groups of `table` whose core icons are all on the page (`has(selector)` says whether one matches). Empty table entries count as present. */\nexport function iconGroupsPresent(table: IconTable, has: (selector: string) => boolean): IconGroup[] {\n return ICON_GROUPS.filter(group => {\n const core = ICON_NAMES.map(name => table[name]).filter((matcher): matcher is IconMatcher => !!matcher && matcher.group === group && !!matcher.core);\n return core.every(matcher => iconSelectors(matcher).some(selector => { try { return has(selector); } catch { return false; } }));\n });\n}\n"]}
@@ -0,0 +1,100 @@
1
+ import { type ResolvedFonts, type ResolvedTheme } from './themeApi.ts';
2
+ import type { ThemeCatalog, ThemeChoice } from './themeChoice.ts';
3
+ import { type FontSpec, type ThemeSpec } from './themeSpec.ts';
4
+ /** A style rule as the engine reads it (CSSStyleRule, or a plain object in tests). */
5
+ export type RuleLike = {
6
+ selectorText: string;
7
+ style: {
8
+ getPropertyValue(name: string): string;
9
+ length?: number;
10
+ };
11
+ };
12
+ /** The font roles as the plugin API reports them in a site's page; an inheriting interface uses `siteStack` (the site's own font). */
13
+ export declare function resolvedFonts(font: FontSpec, siteStack: string): ResolvedFonts;
14
+ /**
15
+ * Every style rule of `doc`'s stylesheets (inside media/supports groups too), except `own`'s (the
16
+ * engine's own sheets: read as the site's, their radii and colors would be re-declared), each as it
17
+ * takes effect (`effectiveRule`). A `@supports` group the browser does not pass is left out.
18
+ */
19
+ export declare function collectRules(doc: Document, own: HTMLStyleElement | null | ReadonlyArray<HTMLStyleElement | null>): RuleLike[];
20
+ type SheetLike = {
21
+ cssRules: CSSRuleList | ArrayLike<unknown>;
22
+ };
23
+ /**
24
+ * The same for an open shadow root the site renders a part of itself in (X's chat embed): its adopted
25
+ * sheets and its `<style>` elements, except the engine's own adopted `own` sheet.
26
+ */
27
+ export declare function collectRootRules(root: {
28
+ adoptedStyleSheets?: readonly SheetLike[];
29
+ styleSheets?: ArrayLike<SheetLike>;
30
+ }, own: SheetLike | null, css?: {
31
+ supports?(condition: string): boolean;
32
+ }): RuleLike[];
33
+ /**
34
+ * The last theme CSS a tab showed, kept in the page's own storage so the next document paints it
35
+ * from its first frame: native code only hands the theme over once the page has finished loading,
36
+ * and the live CSS needs the site's rules, which it inserts while it renders. sessionStorage is per
37
+ * tab and survives reloads and navigations; localStorage (smaller cap: the site uses it too) is per
38
+ * account and covers a tab's first document.
39
+ */
40
+ export type ThemeSnapshot = {
41
+ key: string;
42
+ choice: unknown;
43
+ css: string;
44
+ };
45
+ export declare const SNAPSHOT_SESSION_MAX = 1000000;
46
+ export declare const SNAPSHOT_LOCAL_MAX = 200000;
47
+ export type SnapshotStores = {
48
+ session?: Storage | null;
49
+ local?: Storage | null;
50
+ };
51
+ export declare function readSnapshot({ session, local }: SnapshotStores): ThemeSnapshot | null;
52
+ /** Stores `snapshot` (null clears it: the site's own look needs none), each store within its cap. */
53
+ export declare function writeSnapshot({ session, local }: SnapshotStores, snapshot: ThemeSnapshot | null): void;
54
+ /** What the engine needs to know about a site. `Mode` is the site's own color mode (X: light, dim, dark). */
55
+ export type ThemeRuntimeSite<Mode extends string = string> = {
56
+ /** The site's built-in themes (themeChoice.ts). */
57
+ catalog: ThemeCatalog;
58
+ /** The mode before the page has a body. */
59
+ initialMode: Mode;
60
+ /** The site's color mode as the page paints it now (read before the theme's own override: e.g. the body's inline style). */
61
+ readMode(win: Window): Mode;
62
+ /** The theme's CSS for the site's current `rules` (the engine's own sheet excluded) in `mode`; `vars` are `siteVars` as the site sets them. */
63
+ css(rules: RuleLike[], choice: ThemeChoice, mode: Mode, vars: Record<string, string>): string;
64
+ /** The active theme resolved for plugins and the UI kit (the site's own palette when the theme keeps its colors). */
65
+ resolved(choice: ThemeChoice, mode: Mode): ResolvedTheme;
66
+ /** Custom properties of the site's root read with the theme's sheet disabled (their unthemed values). */
67
+ siteVars?: readonly string[];
68
+ /**
69
+ * The theme's CSS that does not depend on the site's stylesheet: components, variants, decoration,
70
+ * icons. It lives in its own sheet (`staticId`), so the site inserting rules never rebuilds it; it is
71
+ * rebuilt when the theme or the site's mode changes and on `refresh()` (the owner's switches, the
72
+ * icon choice, the language).
73
+ */
74
+ staticCss?(choice: ThemeChoice, mode: Mode): string;
75
+ /** Id of that sheet's `<style>` (default `wb-theme-static`). */
76
+ staticId?: string;
77
+ /** Id of the theme's `<style>` (default `wb-theme-css`). */
78
+ styleId?: string;
79
+ /** Name in console errors. */
80
+ name?: string;
81
+ };
82
+ export type ThemeHandle<Mode extends string = string> = {
83
+ apply(choice: unknown): void;
84
+ current(): ThemeChoice;
85
+ theme(): ThemeSpec;
86
+ /** The site's color mode the theme was last rendered for. */
87
+ mode(): Mode;
88
+ /** The active theme as values for plugins (`api.theme.current()`). */
89
+ resolved(): ResolvedTheme;
90
+ /** Calls `listener` after the theme or the site's color mode changes. */
91
+ onChange(listener: () => void): () => void;
92
+ /** Rebuilds the theme's CSS now: something it depends on besides the theme changed (the owner's switches, the icon choice). */
93
+ refresh(): void;
94
+ };
95
+ export type ThemeRuntimeOptions = {
96
+ loadFonts?(names: string[]): void;
97
+ };
98
+ /** Keeps the site's page in the owner's theme (see the top of this file). */
99
+ export declare function installThemeRuntime<Mode extends string>(win: Window, site: ThemeRuntimeSite<Mode>, options?: ThemeRuntimeOptions): ThemeHandle<Mode>;
100
+ export {};