waybetter 0.1.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (537) hide show
  1. package/README.md +139 -6
  2. package/bin/waybetter.mjs +43 -0
  3. package/build/runtime.mjs +105 -0
  4. package/cli/buildenv.mjs +130 -0
  5. package/cli/dev.mjs +97 -0
  6. package/cli/i18n.mjs +382 -0
  7. package/cli/manifests.mjs +383 -0
  8. package/cli/release.mjs +437 -0
  9. package/cli/releasecheck.mjs +15 -0
  10. package/cli/remote.mjs +260 -0
  11. package/cli/store.mjs +378 -0
  12. package/cli/strings.mjs +123 -0
  13. package/dist/runtime/column.d.ts +93 -0
  14. package/dist/runtime/column.js +451 -0
  15. package/dist/runtime/column.js.map +1 -0
  16. package/dist/runtime/commandReport.d.ts +19 -0
  17. package/dist/runtime/commandReport.js +47 -0
  18. package/dist/runtime/commandReport.js.map +1 -0
  19. package/dist/runtime/commands.d.ts +72 -0
  20. package/dist/runtime/commands.js +214 -0
  21. package/dist/runtime/commands.js.map +1 -0
  22. package/dist/runtime/devErrors.d.ts +16 -0
  23. package/dist/runtime/devErrors.js +30 -0
  24. package/dist/runtime/devErrors.js.map +1 -0
  25. package/dist/runtime/domHub.d.ts +21 -0
  26. package/dist/runtime/domHub.js +139 -4
  27. package/dist/runtime/domHub.js.map +1 -1
  28. package/dist/runtime/featureModules.d.ts +157 -0
  29. package/dist/runtime/featureModules.js +484 -0
  30. package/dist/runtime/featureModules.js.map +1 -0
  31. package/dist/runtime/featureTable.d.ts +144 -0
  32. package/dist/runtime/featureTable.js +223 -0
  33. package/dist/runtime/featureTable.js.map +1 -0
  34. package/dist/runtime/fonts.d.ts +22 -0
  35. package/dist/runtime/fonts.js +72 -0
  36. package/dist/runtime/fonts.js.map +1 -0
  37. package/dist/runtime/i18n.d.ts +138 -0
  38. package/dist/runtime/i18n.js +614 -0
  39. package/dist/runtime/i18n.js.map +1 -0
  40. package/dist/runtime/i18nCheck.d.ts +30 -0
  41. package/dist/runtime/i18nCheck.js +224 -0
  42. package/dist/runtime/i18nCheck.js.map +1 -0
  43. package/dist/runtime/pageLang.d.ts +8 -0
  44. package/dist/runtime/pageLang.js +64 -0
  45. package/dist/runtime/pageLang.js.map +1 -0
  46. package/dist/runtime/pageStrings.d.ts +35 -0
  47. package/dist/runtime/pageStrings.js +76 -0
  48. package/dist/runtime/pageStrings.js.map +1 -0
  49. package/dist/runtime/panelButton.d.ts +33 -0
  50. package/dist/runtime/panelButton.js +83 -0
  51. package/dist/runtime/panelButton.js.map +1 -0
  52. package/dist/runtime/permissions.d.ts +47 -0
  53. package/dist/runtime/permissions.js +141 -0
  54. package/dist/runtime/permissions.js.map +1 -0
  55. package/dist/runtime/pluginApi.d.ts +51 -2
  56. package/dist/runtime/pluginApi.js +137 -22
  57. package/dist/runtime/pluginApi.js.map +1 -1
  58. package/dist/runtime/pluginI18n.d.ts +29 -0
  59. package/dist/runtime/pluginI18n.js +119 -0
  60. package/dist/runtime/pluginI18n.js.map +1 -0
  61. package/dist/runtime/settingsForm.d.ts +66 -0
  62. package/dist/runtime/settingsForm.js +114 -0
  63. package/dist/runtime/settingsForm.js.map +1 -0
  64. package/dist/runtime/site.d.ts +5 -0
  65. package/dist/runtime/site.js +1 -1
  66. package/dist/runtime/site.js.map +1 -1
  67. package/dist/runtime/siteRuntime.d.ts +144 -0
  68. package/dist/runtime/siteRuntime.js +175 -0
  69. package/dist/runtime/siteRuntime.js.map +1 -0
  70. package/dist/runtime/stringPackHook.d.ts +84 -0
  71. package/dist/runtime/stringPackHook.js +220 -0
  72. package/dist/runtime/stringPackHook.js.map +1 -0
  73. package/dist/runtime/stringPackTranslate.d.ts +61 -0
  74. package/dist/runtime/stringPackTranslate.js +267 -0
  75. package/dist/runtime/stringPackTranslate.js.map +1 -0
  76. package/dist/runtime/stringPacks.d.ts +248 -0
  77. package/dist/runtime/stringPacks.js +610 -0
  78. package/dist/runtime/stringPacks.js.map +1 -0
  79. package/dist/runtime/styles.d.ts +15 -0
  80. package/dist/runtime/styles.js +81 -0
  81. package/dist/runtime/styles.js.map +1 -0
  82. package/dist/runtime/textNet.d.ts +15 -0
  83. package/dist/runtime/textNet.js +131 -0
  84. package/dist/runtime/textNet.js.map +1 -0
  85. package/dist/runtime/themeApi.d.ts +121 -0
  86. package/dist/runtime/themeApi.js +220 -0
  87. package/dist/runtime/themeApi.js.map +1 -0
  88. package/dist/runtime/themeBar.d.ts +28 -0
  89. package/dist/runtime/themeBar.js +82 -0
  90. package/dist/runtime/themeBar.js.map +1 -0
  91. package/dist/runtime/themeChoice.d.ts +52 -0
  92. package/dist/runtime/themeChoice.js +69 -0
  93. package/dist/runtime/themeChoice.js.map +1 -0
  94. package/dist/runtime/themeComponents.d.ts +435 -0
  95. package/dist/runtime/themeComponents.js +476 -0
  96. package/dist/runtime/themeComponents.js.map +1 -0
  97. package/dist/runtime/themeDecor.d.ts +73 -0
  98. package/dist/runtime/themeDecor.js +133 -0
  99. package/dist/runtime/themeDecor.js.map +1 -0
  100. package/dist/runtime/themeDerive.d.ts +69 -0
  101. package/dist/runtime/themeDerive.js +117 -0
  102. package/dist/runtime/themeDerive.js.map +1 -0
  103. package/dist/runtime/themeDoctor.d.ts +52 -0
  104. package/dist/runtime/themeDoctor.js +112 -0
  105. package/dist/runtime/themeDoctor.js.map +1 -0
  106. package/dist/runtime/themeGuards.d.ts +60 -0
  107. package/dist/runtime/themeGuards.js +235 -0
  108. package/dist/runtime/themeGuards.js.map +1 -0
  109. package/dist/runtime/themeIcons.d.ts +130 -0
  110. package/dist/runtime/themeIcons.js +271 -0
  111. package/dist/runtime/themeIcons.js.map +1 -0
  112. package/dist/runtime/themeInk.d.ts +37 -0
  113. package/dist/runtime/themeInk.js +111 -0
  114. package/dist/runtime/themeInk.js.map +1 -0
  115. package/dist/runtime/themeInvariants.d.ts +39 -0
  116. package/dist/runtime/themeInvariants.js +273 -0
  117. package/dist/runtime/themeInvariants.js.map +1 -0
  118. package/dist/runtime/themeRuntime.d.ts +114 -0
  119. package/dist/runtime/themeRuntime.js +570 -0
  120. package/dist/runtime/themeRuntime.js.map +1 -0
  121. package/dist/runtime/themeSchema.d.ts +10 -0
  122. package/dist/runtime/themeSchema.js +150 -0
  123. package/dist/runtime/themeSchema.js.map +1 -0
  124. package/dist/runtime/themeSpec.d.ts +263 -0
  125. package/dist/runtime/themeSpec.js +435 -0
  126. package/dist/runtime/themeSpec.js.map +1 -0
  127. package/dist/runtime/themeTokens.d.ts +12 -0
  128. package/dist/runtime/themeTokens.js +14 -6
  129. package/dist/runtime/themeTokens.js.map +1 -1
  130. package/dist/runtime/themeVariants.d.ts +30 -0
  131. package/dist/runtime/themeVariants.js +53 -0
  132. package/dist/runtime/themeVariants.js.map +1 -0
  133. package/dist/runtime/ui.d.ts +192 -0
  134. package/dist/runtime/ui.js +926 -0
  135. package/dist/runtime/ui.js.map +1 -0
  136. package/dist/shell/InstallDialog.d.ts +40 -0
  137. package/dist/shell/InstallDialog.js +176 -0
  138. package/dist/shell/InstallDialog.js.map +1 -0
  139. package/dist/shell/StoreView.d.ts +78 -0
  140. package/dist/shell/StoreView.js +108 -0
  141. package/dist/shell/StoreView.js.map +1 -0
  142. package/dist/shell/addressModel.js.map +1 -1
  143. package/dist/shell/chrome.js.map +1 -1
  144. package/dist/shell/deckModel.d.ts +117 -0
  145. package/dist/shell/deckModel.js +267 -0
  146. package/dist/shell/deckModel.js.map +1 -0
  147. package/dist/shell/frame/AccountSwitcher.d.ts +42 -0
  148. package/dist/shell/frame/AccountSwitcher.js +243 -0
  149. package/dist/shell/frame/AccountSwitcher.js.map +1 -0
  150. package/dist/shell/frame/AddColumnDialog.d.ts +8 -0
  151. package/dist/shell/frame/AddColumnDialog.js +81 -0
  152. package/dist/shell/frame/AddColumnDialog.js.map +1 -0
  153. package/dist/shell/frame/AppMenu.d.ts +44 -0
  154. package/dist/shell/frame/AppMenu.js +721 -0
  155. package/dist/shell/frame/AppMenu.js.map +1 -0
  156. package/dist/shell/frame/CommandPalette.d.ts +7 -0
  157. package/dist/shell/frame/CommandPalette.js +118 -0
  158. package/dist/shell/frame/CommandPalette.js.map +1 -0
  159. package/dist/shell/frame/DeckView.d.ts +13 -0
  160. package/dist/shell/frame/DeckView.js +287 -0
  161. package/dist/shell/frame/DeckView.js.map +1 -0
  162. package/dist/shell/frame/FindBar.d.ts +10 -0
  163. package/dist/shell/frame/FindBar.js +108 -0
  164. package/dist/shell/frame/FindBar.js.map +1 -0
  165. package/dist/shell/frame/MediaPanel.d.ts +8 -0
  166. package/dist/shell/frame/MediaPanel.js +76 -0
  167. package/dist/shell/frame/MediaPanel.js.map +1 -0
  168. package/dist/shell/frame/NewTabPage.d.ts +9 -0
  169. package/dist/shell/frame/NewTabPage.js +71 -0
  170. package/dist/shell/frame/NewTabPage.js.map +1 -0
  171. package/dist/shell/frame/PaneTheme.d.ts +16 -0
  172. package/dist/shell/frame/PaneTheme.js +67 -0
  173. package/dist/shell/frame/PaneTheme.js.map +1 -0
  174. package/dist/shell/frame/ReportDialog.d.ts +3 -0
  175. package/dist/shell/frame/ReportDialog.js +95 -0
  176. package/dist/shell/frame/ReportDialog.js.map +1 -0
  177. package/dist/shell/frame/Shell.d.ts +9 -0
  178. package/dist/shell/frame/Shell.js +1139 -0
  179. package/dist/shell/frame/Shell.js.map +1 -0
  180. package/dist/shell/frame/Titlebar.d.ts +17 -0
  181. package/dist/shell/frame/Titlebar.js +79 -0
  182. package/dist/shell/frame/Titlebar.js.map +1 -0
  183. package/dist/shell/frame/TitlebarExtras.d.ts +4 -0
  184. package/dist/shell/frame/TitlebarExtras.js +202 -0
  185. package/dist/shell/frame/TitlebarExtras.js.map +1 -0
  186. package/dist/shell/frame/WebPanel.d.ts +4 -0
  187. package/dist/shell/frame/WebPanel.js +185 -0
  188. package/dist/shell/frame/WebPanel.js.map +1 -0
  189. package/dist/shell/frame/accountModel.d.ts +49 -0
  190. package/dist/shell/frame/accountModel.js +67 -0
  191. package/dist/shell/frame/accountModel.js.map +1 -0
  192. package/dist/shell/frame/accountSwitcher.css +91 -0
  193. package/dist/shell/frame/appI18n.d.ts +44 -0
  194. package/dist/shell/frame/appI18n.js +64 -0
  195. package/dist/shell/frame/appI18n.js.map +1 -0
  196. package/dist/shell/frame/appMenu.css +127 -0
  197. package/dist/shell/frame/backupModel.d.ts +38 -0
  198. package/dist/shell/frame/backupModel.js +192 -0
  199. package/dist/shell/frame/backupModel.js.map +1 -0
  200. package/dist/shell/frame/boot.d.ts +8 -0
  201. package/dist/shell/frame/boot.js +37 -0
  202. package/dist/shell/frame/boot.js.map +1 -0
  203. package/dist/shell/frame/brand.d.ts +1 -0
  204. package/dist/shell/frame/brand.js +4 -0
  205. package/dist/shell/frame/brand.js.map +1 -0
  206. package/dist/shell/frame/bridge.d.ts +35 -0
  207. package/dist/shell/frame/bridge.js +70 -0
  208. package/dist/shell/frame/bridge.js.map +1 -0
  209. package/dist/shell/frame/chromeTheme.d.ts +47 -0
  210. package/dist/shell/frame/chromeTheme.js +118 -0
  211. package/dist/shell/frame/chromeTheme.js.map +1 -0
  212. package/dist/shell/frame/deck.css +209 -0
  213. package/dist/shell/frame/deckStore.d.ts +89 -0
  214. package/dist/shell/frame/deckStore.js +239 -0
  215. package/dist/shell/frame/deckStore.js.map +1 -0
  216. package/dist/shell/frame/devHost.d.ts +35 -0
  217. package/dist/shell/frame/devHost.js +80 -0
  218. package/dist/shell/frame/devHost.js.map +1 -0
  219. package/dist/shell/frame/devModel.d.ts +7 -0
  220. package/dist/shell/frame/devModel.js +17 -0
  221. package/dist/shell/frame/devModel.js.map +1 -0
  222. package/dist/shell/frame/diag.d.ts +7 -0
  223. package/dist/shell/frame/diag.js +39 -0
  224. package/dist/shell/frame/diag.js.map +1 -0
  225. package/dist/shell/frame/edges.css +159 -0
  226. package/dist/shell/frame/findBar.css +14 -0
  227. package/dist/shell/frame/frameMessages.d.ts +248 -0
  228. package/dist/shell/frame/frameMessages.js +252 -0
  229. package/dist/shell/frame/frameMessages.js.map +1 -0
  230. package/dist/shell/frame/hooks.d.ts +39 -0
  231. package/dist/shell/frame/hooks.js +97 -0
  232. package/dist/shell/frame/hooks.js.map +1 -0
  233. package/dist/shell/frame/i18n.d.ts +27 -0
  234. package/dist/shell/frame/i18n.js +66 -0
  235. package/dist/shell/frame/i18n.js.map +1 -0
  236. package/dist/shell/frame/iconPack.d.ts +11 -0
  237. package/dist/shell/frame/iconPack.js +45 -0
  238. package/dist/shell/frame/iconPack.js.map +1 -0
  239. package/dist/shell/frame/icons.d.ts +71 -0
  240. package/dist/shell/frame/icons.js +75 -0
  241. package/dist/shell/frame/icons.js.map +1 -0
  242. package/dist/shell/frame/index.d.ts +34 -0
  243. package/dist/shell/frame/index.js +43 -0
  244. package/dist/shell/frame/index.js.map +1 -0
  245. package/dist/shell/frame/language.d.ts +58 -0
  246. package/dist/shell/frame/language.js +165 -0
  247. package/dist/shell/frame/language.js.map +1 -0
  248. package/dist/shell/frame/mediaModel.d.ts +47 -0
  249. package/dist/shell/frame/mediaModel.js +67 -0
  250. package/dist/shell/frame/mediaModel.js.map +1 -0
  251. package/dist/shell/frame/menuMessages.en.json +96 -0
  252. package/dist/shell/frame/menuModel.d.ts +319 -0
  253. package/dist/shell/frame/menuModel.js +301 -0
  254. package/dist/shell/frame/menuModel.js.map +1 -0
  255. package/dist/shell/frame/nativeMenu.d.ts +5 -0
  256. package/dist/shell/frame/nativeMenu.js +178 -0
  257. package/dist/shell/frame/nativeMenu.js.map +1 -0
  258. package/dist/shell/frame/nativeMenuModel.d.ts +102 -0
  259. package/dist/shell/frame/nativeMenuModel.js +186 -0
  260. package/dist/shell/frame/nativeMenuModel.js.map +1 -0
  261. package/dist/shell/frame/paletteModel.d.ts +139 -0
  262. package/dist/shell/frame/paletteModel.js +114 -0
  263. package/dist/shell/frame/paletteModel.js.map +1 -0
  264. package/dist/shell/frame/paneTheme.css +9 -0
  265. package/dist/shell/frame/pluginCommandStore.d.ts +23 -0
  266. package/dist/shell/frame/pluginCommandStore.js +70 -0
  267. package/dist/shell/frame/pluginCommandStore.js.map +1 -0
  268. package/dist/shell/frame/reportModel.d.ts +52 -0
  269. package/dist/shell/frame/reportModel.js +105 -0
  270. package/dist/shell/frame/reportModel.js.map +1 -0
  271. package/dist/shell/frame/safeStore.d.ts +7 -0
  272. package/dist/shell/frame/safeStore.js +40 -0
  273. package/dist/shell/frame/safeStore.js.map +1 -0
  274. package/dist/shell/frame/searchInput.d.ts +2 -0
  275. package/dist/shell/frame/searchInput.js +11 -0
  276. package/dist/shell/frame/searchInput.js.map +1 -0
  277. package/dist/shell/frame/shell.css +634 -0
  278. package/dist/shell/frame/site.d.ts +206 -0
  279. package/dist/shell/frame/site.js +22 -0
  280. package/dist/shell/frame/site.js.map +1 -0
  281. package/dist/shell/frame/state.d.ts +101 -0
  282. package/dist/shell/frame/state.js +286 -0
  283. package/dist/shell/frame/state.js.map +1 -0
  284. package/dist/shell/frame/syncGate.d.ts +10 -0
  285. package/dist/shell/frame/syncGate.js +36 -0
  286. package/dist/shell/frame/syncGate.js.map +1 -0
  287. package/dist/shell/frame/syncHost.d.ts +35 -0
  288. package/dist/shell/frame/syncHost.js +85 -0
  289. package/dist/shell/frame/syncHost.js.map +1 -0
  290. package/dist/shell/frame/tabStill.d.ts +2 -0
  291. package/dist/shell/frame/tabStill.js +62 -0
  292. package/dist/shell/frame/tabStill.js.map +1 -0
  293. package/dist/shell/frame/themeScopes.d.ts +29 -0
  294. package/dist/shell/frame/themeScopes.js +61 -0
  295. package/dist/shell/frame/themeScopes.js.map +1 -0
  296. package/dist/shell/frame/themeStore.d.ts +99 -0
  297. package/dist/shell/frame/themeStore.js +267 -0
  298. package/dist/shell/frame/themeStore.js.map +1 -0
  299. package/dist/shell/frame/windowBinding.d.ts +2 -0
  300. package/dist/shell/frame/windowBinding.js +7 -0
  301. package/dist/shell/frame/windowBinding.js.map +1 -0
  302. package/dist/shell/frame/workspaceModel.d.ts +82 -0
  303. package/dist/shell/frame/workspaceModel.js +250 -0
  304. package/dist/shell/frame/workspaceModel.js.map +1 -0
  305. package/dist/shell/frame/workspaces.css +84 -0
  306. package/dist/shell/frame/workspaces.d.ts +22 -0
  307. package/dist/shell/frame/workspaces.js +125 -0
  308. package/dist/shell/frame/workspaces.js.map +1 -0
  309. package/dist/shell/frame/zoomStore.d.ts +10 -0
  310. package/dist/shell/frame/zoomStore.js +65 -0
  311. package/dist/shell/frame/zoomStore.js.map +1 -0
  312. package/dist/shell/installController.d.ts +137 -0
  313. package/dist/shell/installController.js +172 -0
  314. package/dist/shell/installController.js.map +1 -0
  315. package/dist/shell/installerMessages.d.ts +30 -0
  316. package/dist/shell/installerMessages.js +36 -0
  317. package/dist/shell/installerMessages.js.map +1 -0
  318. package/dist/shell/linkDrop.js.map +1 -1
  319. package/dist/shell/messages.d.ts +16 -0
  320. package/dist/shell/messages.js +27 -0
  321. package/dist/shell/messages.js.map +1 -0
  322. package/dist/shell/palette.js.map +1 -1
  323. package/dist/shell/paneModel.d.ts +22 -0
  324. package/dist/shell/paneModel.js +24 -1
  325. package/dist/shell/paneModel.js.map +1 -1
  326. package/dist/shell/panel/Appearance.d.ts +8 -0
  327. package/dist/shell/panel/Appearance.js +265 -0
  328. package/dist/shell/panel/Appearance.js.map +1 -0
  329. package/dist/shell/panel/BackupPanel.d.ts +5 -0
  330. package/dist/shell/panel/BackupPanel.js +198 -0
  331. package/dist/shell/panel/BackupPanel.js.map +1 -0
  332. package/dist/shell/panel/DeveloperPanel.d.ts +4 -0
  333. package/dist/shell/panel/DeveloperPanel.js +51 -0
  334. package/dist/shell/panel/DeveloperPanel.js.map +1 -0
  335. package/dist/shell/panel/FeatureToggles.d.ts +13 -0
  336. package/dist/shell/panel/FeatureToggles.js +42 -0
  337. package/dist/shell/panel/FeatureToggles.js.map +1 -0
  338. package/dist/shell/panel/Home.d.ts +3 -0
  339. package/dist/shell/panel/Home.js +23 -0
  340. package/dist/shell/panel/Home.js.map +1 -0
  341. package/dist/shell/panel/IconPackInstall.d.ts +15 -0
  342. package/dist/shell/panel/IconPackInstall.js +41 -0
  343. package/dist/shell/panel/IconPackInstall.js.map +1 -0
  344. package/dist/shell/panel/LanguageSettings.d.ts +1 -0
  345. package/dist/shell/panel/LanguageSettings.js +54 -0
  346. package/dist/shell/panel/LanguageSettings.js.map +1 -0
  347. package/dist/shell/panel/MakePanel.d.ts +3 -0
  348. package/dist/shell/panel/MakePanel.js +237 -0
  349. package/dist/shell/panel/MakePanel.js.map +1 -0
  350. package/dist/shell/panel/MarkdownDoc.d.ts +6 -0
  351. package/dist/shell/panel/MarkdownDoc.js +35 -0
  352. package/dist/shell/panel/MarkdownDoc.js.map +1 -0
  353. package/dist/shell/panel/Modes.d.ts +40 -0
  354. package/dist/shell/panel/Modes.js +270 -0
  355. package/dist/shell/panel/Modes.js.map +1 -0
  356. package/dist/shell/panel/NavIcon.d.ts +4 -0
  357. package/dist/shell/panel/NavIcon.js +6 -0
  358. package/dist/shell/panel/NavIcon.js.map +1 -0
  359. package/dist/shell/panel/Panel.d.ts +7 -0
  360. package/dist/shell/panel/Panel.js +139 -0
  361. package/dist/shell/panel/Panel.js.map +1 -0
  362. package/dist/shell/panel/PluginFeatures.d.ts +24 -0
  363. package/dist/shell/panel/PluginFeatures.js +165 -0
  364. package/dist/shell/panel/PluginFeatures.js.map +1 -0
  365. package/dist/shell/panel/Plugins.d.ts +33 -0
  366. package/dist/shell/panel/Plugins.js +112 -0
  367. package/dist/shell/panel/Plugins.js.map +1 -0
  368. package/dist/shell/panel/PowerSettings.d.ts +4 -0
  369. package/dist/shell/panel/PowerSettings.js +52 -0
  370. package/dist/shell/panel/PowerSettings.js.map +1 -0
  371. package/dist/shell/panel/Settings.d.ts +23 -0
  372. package/dist/shell/panel/Settings.js +117 -0
  373. package/dist/shell/panel/Settings.js.map +1 -0
  374. package/dist/shell/panel/ShareSetup.d.ts +8 -0
  375. package/dist/shell/panel/ShareSetup.js +130 -0
  376. package/dist/shell/panel/ShareSetup.js.map +1 -0
  377. package/dist/shell/panel/StoreSection.d.ts +7 -0
  378. package/dist/shell/panel/StoreSection.js +78 -0
  379. package/dist/shell/panel/StoreSection.js.map +1 -0
  380. package/dist/shell/panel/StringPacks.d.ts +20 -0
  381. package/dist/shell/panel/StringPacks.js +131 -0
  382. package/dist/shell/panel/StringPacks.js.map +1 -0
  383. package/dist/shell/panel/ThemeBuilder.d.ts +5 -0
  384. package/dist/shell/panel/ThemeBuilder.js +205 -0
  385. package/dist/shell/panel/ThemeBuilder.js.map +1 -0
  386. package/dist/shell/panel/backup.css +34 -0
  387. package/dist/shell/panel/builder.css +240 -0
  388. package/dist/shell/panel/builderModel.d.ts +55 -0
  389. package/dist/shell/panel/builderModel.js +95 -0
  390. package/dist/shell/panel/builderModel.js.map +1 -0
  391. package/dist/shell/panel/compare.d.ts +10 -0
  392. package/dist/shell/panel/compare.js +51 -0
  393. package/dist/shell/panel/compare.js.map +1 -0
  394. package/dist/shell/panel/controls.d.ts +135 -0
  395. package/dist/shell/panel/controls.js +213 -0
  396. package/dist/shell/panel/controls.js.map +1 -0
  397. package/dist/shell/panel/featureModel.d.ts +69 -0
  398. package/dist/shell/panel/featureModel.js +79 -0
  399. package/dist/shell/panel/featureModel.js.map +1 -0
  400. package/dist/shell/panel/fonts/FontBrowser.d.ts +10 -0
  401. package/dist/shell/panel/fonts/FontBrowser.js +189 -0
  402. package/dist/shell/panel/fonts/FontBrowser.js.map +1 -0
  403. package/dist/shell/panel/fonts/FontRoles.d.ts +20 -0
  404. package/dist/shell/panel/fonts/FontRoles.js +77 -0
  405. package/dist/shell/panel/fonts/FontRoles.js.map +1 -0
  406. package/dist/shell/panel/fonts/catalog.d.ts +37 -0
  407. package/dist/shell/panel/fonts/catalog.js +68 -0
  408. package/dist/shell/panel/fonts/catalog.js.map +1 -0
  409. package/dist/shell/panel/fonts/googleFontsCatalog.json +1 -0
  410. package/dist/shell/panel/index.d.ts +20 -0
  411. package/dist/shell/panel/index.js +34 -0
  412. package/dist/shell/panel/index.js.map +1 -0
  413. package/dist/shell/panel/languageModel.d.ts +5 -0
  414. package/dist/shell/panel/languageModel.js +7 -0
  415. package/dist/shell/panel/languageModel.js.map +1 -0
  416. package/dist/shell/panel/make.css +73 -0
  417. package/dist/shell/panel/makeModel.d.ts +32 -0
  418. package/dist/shell/panel/makeModel.js +84 -0
  419. package/dist/shell/panel/makeModel.js.map +1 -0
  420. package/dist/shell/panel/markdown.d.ts +46 -0
  421. package/dist/shell/panel/markdown.js +100 -0
  422. package/dist/shell/panel/markdown.js.map +1 -0
  423. package/dist/shell/panel/nav.d.ts +12 -0
  424. package/dist/shell/panel/nav.js +50 -0
  425. package/dist/shell/panel/nav.js.map +1 -0
  426. package/dist/shell/panel/panel.css +401 -0
  427. package/dist/shell/panel/panelMessages.d.ts +803 -0
  428. package/dist/shell/panel/panelMessages.js +779 -0
  429. package/dist/shell/panel/panelMessages.js.map +1 -0
  430. package/dist/shell/panel/plugins.css +59 -0
  431. package/dist/shell/panel/setupModel.d.ts +87 -0
  432. package/dist/shell/panel/setupModel.js +152 -0
  433. package/dist/shell/panel/setupModel.js.map +1 -0
  434. package/dist/shell/panel/site.d.ts +259 -0
  435. package/dist/shell/panel/site.js +25 -0
  436. package/dist/shell/panel/site.js.map +1 -0
  437. package/dist/shell/panel/strings.css +7 -0
  438. package/dist/shell/panel/themes.d.ts +10 -0
  439. package/dist/shell/panel/themes.js +8 -0
  440. package/dist/shell/panel/themes.js.map +1 -0
  441. package/dist/shell/profileModel.d.ts +3 -2
  442. package/dist/shell/profileModel.js +7 -5
  443. package/dist/shell/profileModel.js.map +1 -1
  444. package/dist/shell/store.css +250 -0
  445. package/dist/shell/storeMessages.d.ts +193 -0
  446. package/dist/shell/storeMessages.js +196 -0
  447. package/dist/shell/storeMessages.js.map +1 -0
  448. package/dist/shell/storeModel.d.ts +205 -0
  449. package/dist/shell/storeModel.js +146 -0
  450. package/dist/shell/storeModel.js.map +1 -0
  451. package/dist/shell/stringPacksModel.d.ts +44 -0
  452. package/dist/shell/stringPacksModel.js +99 -0
  453. package/dist/shell/stringPacksModel.js.map +1 -0
  454. package/dist/shell/updateModel.d.ts +2 -1
  455. package/dist/shell/updateModel.js +5 -4
  456. package/dist/shell/updateModel.js.map +1 -1
  457. package/dist/shell/windowControls.d.ts +4 -0
  458. package/dist/shell/windowControls.js +5 -0
  459. package/dist/shell/windowControls.js.map +1 -1
  460. package/i18n-config.schema.json +29 -0
  461. package/i18n-meta.schema.json +26 -0
  462. package/i18n.schema.json +42 -0
  463. package/icons.schema.json +655 -0
  464. package/languages.schema.json +23 -0
  465. package/locales/ar-x-fm.json +11 -0
  466. package/locales/ar.json +1388 -0
  467. package/locales/bg.json +1387 -0
  468. package/locales/bn.json +1387 -0
  469. package/locales/ca.json +1387 -0
  470. package/locales/cs.json +1387 -0
  471. package/locales/da.json +1387 -0
  472. package/locales/de.json +1387 -0
  473. package/locales/el.json +1387 -0
  474. package/locales/en-GB.json +27 -0
  475. package/locales/en.json +1386 -0
  476. package/locales/en.meta.json +51 -0
  477. package/locales/es.json +1387 -0
  478. package/locales/eu.json +1387 -0
  479. package/locales/fa.json +1388 -0
  480. package/locales/fi.json +1387 -0
  481. package/locales/fil.json +1387 -0
  482. package/locales/fr.json +1387 -0
  483. package/locales/ga.json +1387 -0
  484. package/locales/gl.json +1387 -0
  485. package/locales/gu.json +1387 -0
  486. package/locales/ha.json +1387 -0
  487. package/locales/he.json +1388 -0
  488. package/locales/hi.json +1387 -0
  489. package/locales/hr.json +1387 -0
  490. package/locales/hu.json +1387 -0
  491. package/locales/id.json +1387 -0
  492. package/locales/ig.json +1387 -0
  493. package/locales/it.json +1387 -0
  494. package/locales/ja.json +1387 -0
  495. package/locales/kn.json +1387 -0
  496. package/locales/ko.json +1387 -0
  497. package/locales/mr.json +1387 -0
  498. package/locales/ms.json +1387 -0
  499. package/locales/nb.json +1387 -0
  500. package/locales/nl.json +1387 -0
  501. package/locales/pl.json +1387 -0
  502. package/locales/pt.json +1387 -0
  503. package/locales/ro.json +1387 -0
  504. package/locales/ru.json +1387 -0
  505. package/locales/sk.json +1387 -0
  506. package/locales/sr.json +1387 -0
  507. package/locales/sv.json +1387 -0
  508. package/locales/ta.json +1387 -0
  509. package/locales/th.json +1387 -0
  510. package/locales/tr.json +1387 -0
  511. package/locales/uk.json +1387 -0
  512. package/locales/ur.json +1388 -0
  513. package/locales/vi.json +1387 -0
  514. package/locales/yo.json +1387 -0
  515. package/locales/zh-Hans.json +1387 -0
  516. package/locales/zh-Hant.json +1387 -0
  517. package/package.json +138 -5
  518. package/store-catalog.schema.json +78 -0
  519. package/theme.schema.json +4668 -0
  520. package/windows/installer.nsi +946 -0
  521. package/windows/languages/Basque.nsh +28 -0
  522. package/windows/languages/Catalan.nsh +28 -0
  523. package/windows/languages/Croatian.nsh +28 -0
  524. package/windows/languages/Czech.nsh +28 -0
  525. package/windows/languages/Danish.nsh +28 -0
  526. package/windows/languages/Finnish.nsh +28 -0
  527. package/windows/languages/Galician.nsh +28 -0
  528. package/windows/languages/Greek.nsh +28 -0
  529. package/windows/languages/Hungarian.nsh +28 -0
  530. package/windows/languages/Indonesian.nsh +28 -0
  531. package/windows/languages/Irish.nsh +28 -0
  532. package/windows/languages/Malay.nsh +28 -0
  533. package/windows/languages/Polish.nsh +28 -0
  534. package/windows/languages/Romanian.nsh +28 -0
  535. package/windows/languages/Serbian.nsh +28 -0
  536. package/windows/languages/Slovak.nsh +28 -0
  537. package/windows/languages/Thai.nsh +28 -0
@@ -0,0 +1,23 @@
1
+ import { type PluginCommandItem } from './paletteModel.ts';
2
+ type Reported = {
3
+ id: string;
4
+ title: string;
5
+ keywords: string;
6
+ };
7
+ /** Dispatched on `window` when a tab's reported commands changed. */
8
+ export declare const COMMANDS_CHANGED = "wb-tab-commands";
9
+ /** Names for command owners the Plugins list does not know (createPanel: the feature table's areas). */
10
+ export declare function setCommandOwnerNames(value: Record<string, string>): void;
11
+ export declare function installPluginCommands(): () => void;
12
+ /** Called when the active tab changes. */
13
+ export declare function notePanelActive(id: string | undefined): void;
14
+ export declare function refreshPluginNames(): Promise<void>;
15
+ /** The focused site tab's commands for the palette, or undefined when it has none. */
16
+ export declare function focusedCommands(): {
17
+ tab: string;
18
+ items: PluginCommandItem[];
19
+ } | undefined;
20
+ export declare function runPluginCommand(tab: string, command: string): void;
21
+ /** Tests and the preview harness. */
22
+ export declare function setReportedCommands(tab: string, commands: Reported[], pluginNames?: Record<string, string>): void;
23
+ export {};
@@ -0,0 +1,70 @@
1
+ // Plugin palette commands as the shell knows them: what each site tab last reported (native
2
+ // `tab-commands` event, validated natively: waybetter-host `plugins::commands`) and the plugins'
3
+ // display names (`plugins_list`). The palette lists the commands of the focused site tab and runs
4
+ // one there (`tab_run_command`).
5
+ import { invoke, listen } from "./bridge.js";
6
+ import { pluginCommandItems } from "./paletteModel.js";
7
+ import { isWeb, shell } from "./state.js";
8
+ /** Dispatched on `window` when a tab's reported commands changed. */
9
+ export const COMMANDS_CHANGED = 'wb-tab-commands';
10
+ const byTab = new Map();
11
+ let names = {};
12
+ /** Owners that are not plugin files: an app's area plugins, by the owner id their commands carry. */
13
+ let owners = {};
14
+ /** Names for command owners the Plugins list does not know (createPanel: the feature table's areas). */
15
+ export function setCommandOwnerNames(value) {
16
+ owners = { ...value };
17
+ }
18
+ /** The last web tab that was active (the palette may be opened from the app's panel). */
19
+ let lastWebTab = null;
20
+ export function installPluginCommands() {
21
+ const off = listen('tab-commands', ({ payload }) => {
22
+ if (!payload || typeof payload.id !== 'string')
23
+ return;
24
+ if (Array.isArray(payload.commands) && payload.commands.length)
25
+ byTab.set(payload.id, payload.commands);
26
+ else
27
+ byTab.delete(payload.id);
28
+ // The panel's area cards show what a tab says about its features (a paused one).
29
+ window.dispatchEvent(new CustomEvent(COMMANDS_CHANGED));
30
+ });
31
+ void refreshPluginNames();
32
+ return () => { void off.then(dispose => dispose(), () => { }); };
33
+ }
34
+ /** Called when the active tab changes. */
35
+ export function notePanelActive(id) {
36
+ const panel = id ? shell.api?.getPanel(id) : undefined;
37
+ if (panel && isWeb(panel))
38
+ lastWebTab = panel.id;
39
+ }
40
+ export async function refreshPluginNames() {
41
+ try {
42
+ const list = await invoke('plugins_list');
43
+ names = Object.fromEntries(list.map(plugin => [plugin.file, plugin.name]));
44
+ }
45
+ catch { /* browser preview: no plugins */ }
46
+ }
47
+ /** The focused site tab's commands for the palette, or undefined when it has none. */
48
+ export function focusedCommands() {
49
+ const api = shell.api;
50
+ const active = api?.activePanel;
51
+ const tab = active && isWeb(active) ? active.id : lastWebTab && api?.getPanel(lastWebTab) ? lastWebTab : null;
52
+ if (!tab)
53
+ return undefined;
54
+ const reported = byTab.get(tab);
55
+ if (!reported?.length)
56
+ return undefined;
57
+ return { tab, items: pluginCommandItems(reported, { ...owners, ...names }) };
58
+ }
59
+ export function runPluginCommand(tab, command) {
60
+ const panel = shell.api?.getPanel(tab);
61
+ panel?.api.setActive();
62
+ invoke('tab_run_command', { id: tab, command }).catch(error => console.warn('[shell] plugin command', error));
63
+ }
64
+ /** Tests and the preview harness. */
65
+ export function setReportedCommands(tab, commands, pluginNames) {
66
+ byTab.set(tab, commands);
67
+ if (pluginNames)
68
+ names = { ...names, ...pluginNames };
69
+ }
70
+ //# sourceMappingURL=pluginCommandStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginCommandStore.js","sourceRoot":"","sources":["../../../../../../shell/src/frame/pluginCommandStore.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,iGAAiG;AACjG,kGAAkG;AAClG,iCAAiC;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAA0B,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAI1C,qEAAqE;AACrE,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAElD,MAAM,KAAK,GAAG,IAAI,GA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C,KAAK,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC;IACvB,MAAM,CAAC,iBAAiB,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC,CAAC;AAChH,CAAC;AAED,qCAAqC;AACrC,MAAM,UAAU,mBAAmB,CAAC,GAAW,EAAE,QAAoB,EAAE,WAAoC;IACzG,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IACzB,IAAI,WAAW;QAAE,KAAK,GAAG,EAAE,GAAG,KAAK,EAAE,GAAG,WAAW,EAAE,CAAC;AACxD,CAAC","sourcesContent":["// Plugin palette commands as the shell knows them: what each site tab last reported (native\n// `tab-commands` event, validated natively: waybetter-host `plugins::commands`) and the plugins'\n// display names (`plugins_list`). The palette lists the commands of the focused site tab and runs\n// one there (`tab_run_command`).\n\nimport { invoke, listen } from './bridge.ts';\nimport { pluginCommandItems, type PluginCommandItem } from './paletteModel.ts';\nimport { isWeb, shell } from './state.ts';\n\ntype Reported = { id: string; title: string; keywords: string };\n\n/** Dispatched on `window` when a tab's reported commands changed. */\nexport const COMMANDS_CHANGED = 'wb-tab-commands';\n\nconst byTab = new Map<string, Reported[]>();\nlet names: Record<string, string> = {};\n/** Owners that are not plugin files: an app's area plugins, by the owner id their commands carry. */\nlet owners: Record<string, string> = {};\n\n/** Names for command owners the Plugins list does not know (createPanel: the feature table's areas). */\nexport function setCommandOwnerNames(value: Record<string, string>) {\n owners = { ...value };\n}\n/** The last web tab that was active (the palette may be opened from the app's panel). */\nlet lastWebTab: string | null = null;\n\nexport function installPluginCommands(): () => void {\n const off = listen<{ id: string; commands: Reported[] }>('tab-commands', ({ payload }) => {\n if (!payload || typeof payload.id !== 'string') return;\n if (Array.isArray(payload.commands) && payload.commands.length) byTab.set(payload.id, payload.commands);\n else byTab.delete(payload.id);\n // The panel's area cards show what a tab says about its features (a paused one).\n window.dispatchEvent(new CustomEvent(COMMANDS_CHANGED));\n });\n void refreshPluginNames();\n return () => { void off.then(dispose => dispose(), () => {}); };\n}\n\n/** Called when the active tab changes. */\nexport function notePanelActive(id: string | undefined) {\n const panel = id ? shell.api?.getPanel(id) : undefined;\n if (panel && isWeb(panel)) lastWebTab = panel.id;\n}\n\nexport async function refreshPluginNames(): Promise<void> {\n try {\n const list = await invoke<Array<{ file: string; name: string }>>('plugins_list');\n names = Object.fromEntries(list.map(plugin => [plugin.file, plugin.name]));\n } catch { /* browser preview: no plugins */ }\n}\n\n/** The focused site tab's commands for the palette, or undefined when it has none. */\nexport function focusedCommands(): { tab: string; items: PluginCommandItem[] } | undefined {\n const api = shell.api;\n const active = api?.activePanel;\n const tab = active && isWeb(active) ? active.id : lastWebTab && api?.getPanel(lastWebTab) ? lastWebTab : null;\n if (!tab) return undefined;\n const reported = byTab.get(tab);\n if (!reported?.length) return undefined;\n return { tab, items: pluginCommandItems(reported, { ...owners, ...names }) };\n}\n\nexport function runPluginCommand(tab: string, command: string) {\n const panel = shell.api?.getPanel(tab);\n panel?.api.setActive();\n invoke('tab_run_command', { id: tab, command }).catch(error => console.warn('[shell] plugin command', error));\n}\n\n/** Tests and the preview harness. */\nexport function setReportedCommands(tab: string, commands: Reported[], pluginNames?: Record<string, string>) {\n byTab.set(tab, commands);\n if (pluginNames) names = { ...names, ...pluginNames };\n}\n"]}
@@ -0,0 +1,52 @@
1
+ /** The framework's version (kept in step with packages/waybetter/package.json by a test). */
2
+ export declare const FRAMEWORK_VERSION = "0.7.0";
3
+ /** Everything a report may say. */
4
+ export type ReportInfo = {
5
+ /** The app's name and version ("wayBetter for X", "1.3.2"). */
6
+ product: string;
7
+ appVersion: string;
8
+ /** "Windows 11 (x64)", "macOS", "Linux (x86_64)". */
9
+ system: string;
10
+ /** "WebView2 141.0.3537.71", "WebKit 605.1.15". */
11
+ webview: string;
12
+ /** The catalog in use and how it was chosen (`site`, `system` or a language tag). */
13
+ language: string;
14
+ languageChoice: string;
15
+ /** The mode in use (its id), when the app has modes. */
16
+ mode?: string | null;
17
+ /** The theme's id and the icon pack it uses, when the app has themes. */
18
+ theme?: string;
19
+ iconPack?: string;
20
+ /** File names of the plugins that are switched on (null: could not be read). */
21
+ plugins: readonly string[] | null;
22
+ /** Lines the app adds: a fixed English label and ids (what paused itself, which areas are on). */
23
+ details?: ReadonlyArray<{
24
+ label: string;
25
+ values: readonly string[];
26
+ }>;
27
+ safeMode: boolean;
28
+ };
29
+ /** An id or a version as it is, or nothing: anything that is not made of id characters is left out, never trimmed into shape. */
30
+ export declare function reportValue(value: unknown): string;
31
+ /** A plugin's file name: the name itself (never where the file is), or nothing. */
32
+ export declare function reportFileName(value: unknown): string;
33
+ /** The report's text: one fact per line. */
34
+ export declare function buildReport(info: ReportInfo): string;
35
+ /**
36
+ * The webview engine and its version from a user agent string. Chromium reduces the version in the
37
+ * user agent ("154.0.0.0"); the full one comes from the engine's brand list when it gives one.
38
+ */
39
+ export declare function webviewFromUserAgent(userAgent: string, brands?: ReadonlyArray<{
40
+ brand?: string;
41
+ version?: string;
42
+ }>): string;
43
+ /**
44
+ * The operating system from a user agent string, refined by what the engine says when asked
45
+ * (`platformVersion`: on Windows a major of 13 or more is Windows 11; `architecture`). Coarse on
46
+ * purpose: a family and a version, nothing that names a machine.
47
+ */
48
+ export declare function systemFromUserAgent(userAgent: string, hints?: {
49
+ platformVersion?: string;
50
+ architecture?: string;
51
+ bitness?: string;
52
+ }): string;
@@ -0,0 +1,105 @@
1
+ // "Report a problem": the diagnostic summary, as a pure model (unit-tested under node). It is a
2
+ // short plain text in English (the people who read reports do) built from a fixed set of facts
3
+ // about the app, never about the person: versions, the system, the language, the mode, the ids of
4
+ // what is switched on, what paused itself, safe mode. It has no field for an account, a handle, an
5
+ // address, a tab, a file path or anything of the site's, and every value must be made of the
6
+ // characters an id or a version is made of, or it is left out (never trimmed into shape), so
7
+ // nothing of that kind can ride along in a value either. The text is shown to the owner exactly as it would be shared and is
8
+ // never sent anywhere by the app (no request, and nothing is put in a URL).
9
+ /** The framework's version (kept in step with packages/waybetter/package.json by a test). */
10
+ export const FRAMEWORK_VERSION = '0.7.0';
11
+ const MAX_ITEMS = 60;
12
+ const ID = /^[A-Za-z0-9][A-Za-z0-9._+-]{0,63}$/;
13
+ /** An id or a version as it is, or nothing: anything that is not made of id characters is left out, never trimmed into shape. */
14
+ export function reportValue(value) {
15
+ const text = typeof value === 'number' ? String(value) : typeof value === 'string' ? value : '';
16
+ return ID.test(text) ? text : '';
17
+ }
18
+ /** A plugin's file name: the name itself (never where the file is), or nothing. */
19
+ export function reportFileName(value) {
20
+ return typeof value === 'string' ? reportValue(value.split(/[\\/]/).pop()) : '';
21
+ }
22
+ /** A language tag (`tr`, `zh-Hant`) or one of the automatic choices; anything else is left out. */
23
+ function languageValue(value) {
24
+ return typeof value === 'string' && (/^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8}){0,3}$/.test(value) || ['site', 'system', 'fixed'].includes(value)) ? value : '';
25
+ }
26
+ /** What `systemFromUserAgent` and `webviewFromUserAgent` write, and nothing else. */
27
+ const SYSTEM = /^(Windows|macOS|Linux)( \d+(\.\d+)?| 10 or 11)?( \([A-Za-z0-9_]{1,12}\))?$/;
28
+ const WEBVIEW = /^(WebView2|Chromium|WebKit) [0-9.]{1,24}$/;
29
+ /** The app's name and its labels are its own constants: letters, digits and spaces. */
30
+ const NAME = /^[A-Za-z][A-Za-z0-9 ]{0,39}$/;
31
+ function list(values, clean) {
32
+ if (!values)
33
+ return 'unknown';
34
+ const kept = values.map(clean).filter(Boolean);
35
+ const left = values.length - kept.length;
36
+ const shown = kept.slice(0, MAX_ITEMS);
37
+ const more = kept.length - shown.length + left;
38
+ if (!shown.length)
39
+ return more ? `${more} not shown` : 'none';
40
+ return `${shown.join(', ')}${more ? `, and ${more} more` : ''}`;
41
+ }
42
+ /** The report's text: one fact per line. */
43
+ export function buildReport(info) {
44
+ const lines = [
45
+ `${NAME.test(info.product) ? info.product : 'App'} ${reportValue(info.appVersion) || 'unknown version'}`,
46
+ `Framework: wayBetter ${FRAMEWORK_VERSION}`,
47
+ `System: ${SYSTEM.test(info.system) ? info.system : 'unknown'}`,
48
+ `Webview: ${WEBVIEW.test(info.webview) ? info.webview : 'unknown'}`,
49
+ `Language: ${languageValue(info.language) || 'unknown'} (chosen: ${languageValue(info.languageChoice) || 'unknown'})`,
50
+ ];
51
+ if (info.mode !== undefined)
52
+ lines.push(`Mode: ${info.mode === null ? 'none chosen' : reportValue(info.mode) || 'unknown'}`);
53
+ if (info.theme !== undefined)
54
+ lines.push(`Theme: ${reportValue(info.theme) || 'unknown'}`);
55
+ if (info.iconPack !== undefined)
56
+ lines.push(`Icon pack: ${info.iconPack === '' ? "the site's own" : reportValue(info.iconPack) || 'unknown'}`);
57
+ lines.push(`Plugins on: ${list(info.plugins, reportFileName)}`);
58
+ for (const detail of (info.details ?? []).slice(0, 12)) {
59
+ if (NAME.test(detail.label))
60
+ lines.push(`${detail.label}: ${list(detail.values, reportValue)}`);
61
+ }
62
+ lines.push(`Safe mode: ${info.safeMode ? 'yes' : 'no'}`);
63
+ return lines.join('\n');
64
+ }
65
+ /**
66
+ * The webview engine and its version from a user agent string. Chromium reduces the version in the
67
+ * user agent ("154.0.0.0"); the full one comes from the engine's brand list when it gives one.
68
+ */
69
+ export function webviewFromUserAgent(userAgent, brands = []) {
70
+ const full = brands.find(entry => /WebView2|Microsoft Edge/.test(entry.brand ?? '') && /^[\d.]+$/.test(entry.version ?? ''));
71
+ const edge = /\bEdg\/([\d.]+)/.exec(userAgent);
72
+ if (edge)
73
+ return `WebView2 ${full?.version ?? edge[1]}`;
74
+ const chrome = /\bChrom(?:e|ium)\/([\d.]+)/.exec(userAgent);
75
+ if (chrome)
76
+ return `Chromium ${chrome[1]}`;
77
+ const webkit = /\bAppleWebKit\/([\d.]+)/.exec(userAgent);
78
+ if (webkit)
79
+ return `WebKit ${webkit[1]}`;
80
+ return 'unknown';
81
+ }
82
+ /**
83
+ * The operating system from a user agent string, refined by what the engine says when asked
84
+ * (`platformVersion`: on Windows a major of 13 or more is Windows 11; `architecture`). Coarse on
85
+ * purpose: a family and a version, nothing that names a machine.
86
+ */
87
+ export function systemFromUserAgent(userAgent, hints = {}) {
88
+ const arch = hints.architecture ? `${hints.architecture}${hints.bitness === '64' && hints.architecture === 'x86' ? '_64' : ''}` : '';
89
+ if (/Windows NT/.test(userAgent)) {
90
+ const major = Number.parseInt(hints.platformVersion ?? '', 10);
91
+ const version = Number.isFinite(major) && major > 0 ? (major >= 13 ? '11' : '10') : /Windows NT 10\.0/.test(userAgent) ? '10 or 11' : '';
92
+ const bits = arch || (/Win64|x64|WOW64/.test(userAgent) ? 'x64' : /ARM64/i.test(userAgent) ? 'arm64' : '');
93
+ return `Windows${version ? ` ${version}` : ''}${bits ? ` (${bits})` : ''}`;
94
+ }
95
+ if (/Macintosh|Mac OS X/.test(userAgent)) {
96
+ const version = (hints.platformVersion ?? '').split('.').slice(0, 2).join('.');
97
+ return `macOS${/^\d+(\.\d+)?$/.test(version) && version !== '0' ? ` ${version}` : ''}${arch ? ` (${arch})` : ''}`;
98
+ }
99
+ if (/Linux|X11/.test(userAgent)) {
100
+ const machine = /Linux (x86_64|aarch64|armv\w+|i686)/.exec(userAgent)?.[1] ?? arch;
101
+ return `Linux${machine ? ` (${machine})` : ''}`;
102
+ }
103
+ return 'unknown';
104
+ }
105
+ //# sourceMappingURL=reportModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reportModel.js","sourceRoot":"","sources":["../../../../../../shell/src/frame/reportModel.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,+FAA+F;AAC/F,kGAAkG;AAClG,mGAAmG;AACnG,6FAA6F;AAC7F,6FAA6F;AAC7F,6HAA6H;AAC7H,4EAA4E;AAE5E,6FAA6F;AAC7F,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAC;A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,qCAAqC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;QACnF,OAAO,QAAQ,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAClD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// \"Report a problem\": the diagnostic summary, as a pure model (unit-tested under node). It is a\n// short plain text in English (the people who read reports do) built from a fixed set of facts\n// about the app, never about the person: versions, the system, the language, the mode, the ids of\n// what is switched on, what paused itself, safe mode. It has no field for an account, a handle, an\n// address, a tab, a file path or anything of the site's, and every value must be made of the\n// characters an id or a version is made of, or it is left out (never trimmed into shape), so\n// nothing of that kind can ride along in a value either. The text is shown to the owner exactly as it would be shared and is\n// never sent anywhere by the app (no request, and nothing is put in a URL).\n\n/** The framework's version (kept in step with packages/waybetter/package.json by a test). */\nexport const FRAMEWORK_VERSION = '0.7.0';\n\n/** Everything a report may say. */\nexport type ReportInfo = {\n /** The app's name and version (\"wayBetter for X\", \"1.3.2\"). */\n product: string;\n appVersion: string;\n /** \"Windows 11 (x64)\", \"macOS\", \"Linux (x86_64)\". */\n system: string;\n /** \"WebView2 141.0.3537.71\", \"WebKit 605.1.15\". */\n webview: string;\n /** The catalog in use and how it was chosen (`site`, `system` or a language tag). */\n language: string;\n languageChoice: string;\n /** The mode in use (its id), when the app has modes. */\n mode?: string | null;\n /** The theme's id and the icon pack it uses, when the app has themes. */\n theme?: string;\n iconPack?: string;\n /** File names of the plugins that are switched on (null: could not be read). */\n plugins: readonly string[] | null;\n /** Lines the app adds: a fixed English label and ids (what paused itself, which areas are on). */\n details?: ReadonlyArray<{ label: string; values: readonly string[] }>;\n safeMode: boolean;\n};\n\nconst MAX_ITEMS = 60;\n\nconst ID = /^[A-Za-z0-9][A-Za-z0-9._+-]{0,63}$/;\n\n/** An id or a version as it is, or nothing: anything that is not made of id characters is left out, never trimmed into shape. */\nexport function reportValue(value: unknown): string {\n const text = typeof value === 'number' ? String(value) : typeof value === 'string' ? value : '';\n return ID.test(text) ? text : '';\n}\n\n/** A plugin's file name: the name itself (never where the file is), or nothing. */\nexport function reportFileName(value: unknown): string {\n return typeof value === 'string' ? reportValue(value.split(/[\\\\/]/).pop()) : '';\n}\n\n/** A language tag (`tr`, `zh-Hant`) or one of the automatic choices; anything else is left out. */\nfunction languageValue(value: unknown): string {\n return typeof value === 'string' && (/^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8}){0,3}$/.test(value) || ['site', 'system', 'fixed'].includes(value)) ? value : '';\n}\n\n/** What `systemFromUserAgent` and `webviewFromUserAgent` write, and nothing else. */\nconst SYSTEM = /^(Windows|macOS|Linux)( \\d+(\\.\\d+)?| 10 or 11)?( \\([A-Za-z0-9_]{1,12}\\))?$/;\nconst WEBVIEW = /^(WebView2|Chromium|WebKit) [0-9.]{1,24}$/;\n/** The app's name and its labels are its own constants: letters, digits and spaces. */\nconst NAME = /^[A-Za-z][A-Za-z0-9 ]{0,39}$/;\n\nfunction list(values: readonly unknown[] | null | undefined, clean: (value: unknown) => string): string {\n if (!values) return 'unknown';\n const kept = values.map(clean).filter(Boolean);\n const left = values.length - kept.length;\n const shown = kept.slice(0, MAX_ITEMS);\n const more = kept.length - shown.length + left;\n if (!shown.length) return more ? `${more} not shown` : 'none';\n return `${shown.join(', ')}${more ? `, and ${more} more` : ''}`;\n}\n\n/** The report's text: one fact per line. */\nexport function buildReport(info: ReportInfo): string {\n const lines = [\n `${NAME.test(info.product) ? info.product : 'App'} ${reportValue(info.appVersion) || 'unknown version'}`,\n `Framework: wayBetter ${FRAMEWORK_VERSION}`,\n `System: ${SYSTEM.test(info.system) ? info.system : 'unknown'}`,\n `Webview: ${WEBVIEW.test(info.webview) ? info.webview : 'unknown'}`,\n `Language: ${languageValue(info.language) || 'unknown'} (chosen: ${languageValue(info.languageChoice) || 'unknown'})`,\n ];\n if (info.mode !== undefined) lines.push(`Mode: ${info.mode === null ? 'none chosen' : reportValue(info.mode) || 'unknown'}`);\n if (info.theme !== undefined) lines.push(`Theme: ${reportValue(info.theme) || 'unknown'}`);\n if (info.iconPack !== undefined) lines.push(`Icon pack: ${info.iconPack === '' ? \"the site's own\" : reportValue(info.iconPack) || 'unknown'}`);\n lines.push(`Plugins on: ${list(info.plugins, reportFileName)}`);\n for (const detail of (info.details ?? []).slice(0, 12)) {\n if (NAME.test(detail.label)) lines.push(`${detail.label}: ${list(detail.values, reportValue)}`);\n }\n lines.push(`Safe mode: ${info.safeMode ? 'yes' : 'no'}`);\n return lines.join('\\n');\n}\n\n/**\n * The webview engine and its version from a user agent string. Chromium reduces the version in the\n * user agent (\"154.0.0.0\"); the full one comes from the engine's brand list when it gives one.\n */\nexport function webviewFromUserAgent(userAgent: string, brands: ReadonlyArray<{ brand?: string; version?: string }> = []): string {\n const full = brands.find(entry => /WebView2|Microsoft Edge/.test(entry.brand ?? '') && /^[\\d.]+$/.test(entry.version ?? ''));\n const edge = /\\bEdg\\/([\\d.]+)/.exec(userAgent);\n if (edge) return `WebView2 ${full?.version ?? edge[1]}`;\n const chrome = /\\bChrom(?:e|ium)\\/([\\d.]+)/.exec(userAgent);\n if (chrome) return `Chromium ${chrome[1]}`;\n const webkit = /\\bAppleWebKit\\/([\\d.]+)/.exec(userAgent);\n if (webkit) return `WebKit ${webkit[1]}`;\n return 'unknown';\n}\n\n/**\n * The operating system from a user agent string, refined by what the engine says when asked\n * (`platformVersion`: on Windows a major of 13 or more is Windows 11; `architecture`). Coarse on\n * purpose: a family and a version, nothing that names a machine.\n */\nexport function systemFromUserAgent(userAgent: string, hints: { platformVersion?: string; architecture?: string; bitness?: string } = {}): string {\n const arch = hints.architecture ? `${hints.architecture}${hints.bitness === '64' && hints.architecture === 'x86' ? '_64' : ''}` : '';\n if (/Windows NT/.test(userAgent)) {\n const major = Number.parseInt(hints.platformVersion ?? '', 10);\n const version = Number.isFinite(major) && major > 0 ? (major >= 13 ? '11' : '10') : /Windows NT 10\\.0/.test(userAgent) ? '10 or 11' : '';\n const bits = arch || (/Win64|x64|WOW64/.test(userAgent) ? 'x64' : /ARM64/i.test(userAgent) ? 'arm64' : '');\n return `Windows${version ? ` ${version}` : ''}${bits ? ` (${bits})` : ''}`;\n }\n if (/Macintosh|Mac OS X/.test(userAgent)) {\n const version = (hints.platformVersion ?? '').split('.').slice(0, 2).join('.');\n return `macOS${/^\\d+(\\.\\d+)?$/.test(version) && version !== '0' ? ` ${version}` : ''}${arch ? ` (${arch})` : ''}`;\n }\n if (/Linux|X11/.test(userAgent)) {\n const machine = /Linux (x86_64|aarch64|armv\\w+|i686)/.exec(userAgent)?.[1] ?? arch;\n return `Linux${machine ? ` (${machine})` : ''}`;\n }\n return 'unknown';\n}\n"]}
@@ -0,0 +1,7 @@
1
+ export declare const safe: {
2
+ active: boolean;
3
+ };
4
+ /** Switches safe mode for this run; every tab is rebuilt with or without the app's page layers. */
5
+ export declare function setSafeMode(on: boolean): Promise<void>;
6
+ /** Reads the flag and follows its changes (Shell.tsx, once). Returns a cleanup. */
7
+ export declare function installSafeMode(): () => void;
@@ -0,0 +1,40 @@
1
+ // Safe mode, as the shell knows it. Native code owns the flag (waybetter-host `safe.rs`: memory
2
+ // only, for this run; site tabs get the tab bridge and nothing of the app's page layers). The
3
+ // shell reads it at start (`safe_mode_get`), switches it from the app menu and the titlebar chip
4
+ // (`safe_mode_set`, which rebuilds every tab), hears a switch as the `safe-mode` event, shows it in
5
+ // the titlebar for as long as it is on and drops its own chrome theme meanwhile (themeStore.ts).
6
+ import { invoke, listen } from "./bridge.js";
7
+ export const safe = { active: false };
8
+ function note(active) {
9
+ const next = active === true;
10
+ if (typeof document !== 'undefined') {
11
+ if (next)
12
+ document.documentElement.dataset.safe = 'on';
13
+ else
14
+ delete document.documentElement.dataset.safe;
15
+ }
16
+ if (safe.active === next)
17
+ return;
18
+ safe.active = next;
19
+ window.dispatchEvent(new CustomEvent('bt-safe'));
20
+ }
21
+ /** Switches safe mode for this run; every tab is rebuilt with or without the app's page layers. */
22
+ export async function setSafeMode(on) {
23
+ const state = await invoke('safe_mode_set', { on });
24
+ note(state?.active);
25
+ }
26
+ /** Reads the flag and follows its changes (Shell.tsx, once). Returns a cleanup. */
27
+ export function installSafeMode() {
28
+ let disposed = false;
29
+ let unlisten;
30
+ invoke('safe_mode_get').then(state => { if (!disposed)
31
+ note(state?.active); }).catch(() => { });
32
+ listen('safe-mode', ({ payload }) => note(payload?.active))
33
+ .then(dispose => { if (disposed)
34
+ dispose();
35
+ else
36
+ unlisten = dispose; })
37
+ .catch(() => { });
38
+ return () => { disposed = true; unlisten?.(); };
39
+ }
40
+ //# sourceMappingURL=safeStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safeStore.js","sourceRoot":"","sources":["../../../../../../shell/src/frame/safeStore.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,8FAA8F;AAC9F,iGAAiG;AACjG,oGAAoG;AACpG,iGAAiG;AAEjG,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAEtC,SAAS,IAAI,CAAC,MAAe;IAC3B,MAAM,IAAI,GAAG,MAAM,KAAK,IAAI,CAAC;IAC7B,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;QACpC,IAAI,IAAI;YAAE,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;;YAAM,OAAO,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC;IAC5G,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI;QAAE,OAAO;IACjC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACnB,MAAM,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC;AACnD,CAAC;AAED,mGAAmG;AACnG,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,EAAW;IAC3C,MAAM,KAAK,GAAG,MAAM,MAAM,CAAuB,eAAe,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1E,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACtB,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,eAAe;IAC7B,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,IAAI,QAAkC,CAAC;IACvC,MAAM,CAAuB,eAAe,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,QAAQ;QAAE,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACrH,MAAM,CAAuB,WAAW,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;SAC9E,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,QAAQ;QAAE,OAAO,EAAE,CAAC;;QAAM,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;SACtE,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACnB,OAAO,GAAG,EAAE,GAAG,QAAQ,GAAG,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AAClD,CAAC","sourcesContent":["// Safe mode, as the shell knows it. Native code owns the flag (waybetter-host `safe.rs`: memory\n// only, for this run; site tabs get the tab bridge and nothing of the app's page layers). The\n// shell reads it at start (`safe_mode_get`), switches it from the app menu and the titlebar chip\n// (`safe_mode_set`, which rebuilds every tab), hears a switch as the `safe-mode` event, shows it in\n// the titlebar for as long as it is on and drops its own chrome theme meanwhile (themeStore.ts).\n\nimport { invoke, listen } from './bridge.ts';\n\nexport const safe = { active: false };\n\nfunction note(active: unknown) {\n const next = active === true;\n if (typeof document !== 'undefined') {\n if (next) document.documentElement.dataset.safe = 'on'; else delete document.documentElement.dataset.safe;\n }\n if (safe.active === next) return;\n safe.active = next;\n window.dispatchEvent(new CustomEvent('bt-safe'));\n}\n\n/** Switches safe mode for this run; every tab is rebuilt with or without the app's page layers. */\nexport async function setSafeMode(on: boolean): Promise<void> {\n const state = await invoke<{ active?: boolean }>('safe_mode_set', { on });\n note(state?.active);\n}\n\n/** Reads the flag and follows its changes (Shell.tsx, once). Returns a cleanup. */\nexport function installSafeMode(): () => void {\n let disposed = false;\n let unlisten: (() => void) | undefined;\n invoke<{ active?: boolean }>('safe_mode_get').then(state => { if (!disposed) note(state?.active); }).catch(() => {});\n listen<{ active?: boolean }>('safe-mode', ({ payload }) => note(payload?.active))\n .then(dispose => { if (disposed) dispose(); else unlisten = dispose; })\n .catch(() => {});\n return () => { disposed = true; unlisten?.(); };\n}\n"]}
@@ -0,0 +1,2 @@
1
+ /** Full URLs as-is, bare domains over https, anything else searches the site (`search`). */
2
+ export declare function toUrl(input: string, search: (text: string) => string): string;
@@ -0,0 +1,11 @@
1
+ // Address-bar / palette text → URL. Pure, so it is unit-tested under node.
2
+ /** Full URLs as-is, bare domains over https, anything else searches the site (`search`). */
3
+ export function toUrl(input, search) {
4
+ const text = input.trim();
5
+ if (/^https?:\/\//i.test(text))
6
+ return text;
7
+ if (/^(localhost|[\w-]+(\.[\w-]+)+)(:\d+)?([/?#].*)?$/i.test(text))
8
+ return `https://${text}`;
9
+ return search(text);
10
+ }
11
+ //# sourceMappingURL=searchInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"searchInput.js","sourceRoot":"","sources":["../../../../../../shell/src/frame/searchInput.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAE3E,4FAA4F;AAC5F,MAAM,UAAU,KAAK,CAAC,KAAa,EAAE,MAAgC;IACnE,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC1B,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5C,IAAI,mDAAmD,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,WAAW,IAAI,EAAE,CAAC;IAC7F,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;AACtB,CAAC","sourcesContent":["// Address-bar / palette text → URL. Pure, so it is unit-tested under node.\n\n/** Full URLs as-is, bare domains over https, anything else searches the site (`search`). */\nexport function toUrl(input: string, search: (text: string) => string): string {\n const text = input.trim();\n if (/^https?:\\/\\//i.test(text)) return text;\n if (/^(localhost|[\\w-]+(\\.[\\w-]+)+)(:\\d+)?([/?#].*)?$/i.test(text)) return `https://${text}`;\n return search(text);\n}\n"]}