waybetter 0.1.0 → 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 +143 -9
  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 +148 -6
  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 @@
1
+ {"version":3,"file":"stringPackTranslate.js","sourceRoot":"","sources":["../../../runtime/src/stringPackTranslate.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,iGAAiG;AACjG,iGAAiG;AACjG,iGAAiG;AACjG,+EAA+E;AAC/E,EAAE;AACF,gGAAgG;AAChG,qGAAqG;AACrG,mDAAmD;AACnD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAA6D,MAAM,kBAAkB,CAAC;AAE3I,MAAM,KAAK,GAAG,GAAG,CAAC;AAClB,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACpC,MAAM,MAAM,GAAG,cAAc,CAAC;AAW9B,MAAM,UAAU,YAAY;IAC1B,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,MAAM,IAAI,GAAG,CAAC,EAAU,EAAE,EAAE;QAC1B,IAAI,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACtB,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;YAAC,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;YAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAAC,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAAC,CAAC;QACxE,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,GAAG,CAAC;YAAC,MAAM,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC;YAAC,CAAC,GAAG,IAA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AC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM;QAAE,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC;IACpE,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC7C,IAAI,CAAC;QAAC,WAAW,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC;IAAC,CAAC;IAClE,OAAO,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["// Translate mode for string packs (published as `waybetter/runtime/stringPackTranslate`): the site's\n// strings carry an invisible marker naming their key, so clicking a word on the page tells which\n// key it is. The author types a replacement (checked with the pack rules right there), the edits\n// collect in the tab as a draft pack that applies on the next reload, and Export copies the pack\n// file. Nothing leaves the page; the draft lives in the tab's session storage.\n//\n// The markers change the site's text (invisible characters at the end of each string), so exact\n// comparisons in the site's own code may notice: translate mode is for authors, never on by default,\n// and leaving it reloads the page without markers.\nimport { compilePack, inventoryLookup, validateString, type InventoryLookup, type PageInventory, type StringPack } from './stringPacks.ts';\n\nconst START = '⁣';\nconst DIGITS = ['​', '‌', '‍', '⁠'];\nconst MARKED = /⁣([​‌‍⁠]+)⁣/g;\n\nexport type Marker = {\n /** The value with its key's marker (strings, and functions whose result is a string). */\n mark(id: string, value: unknown): unknown;\n /** The keys marked in a text, in order. */\n ids(text: string): string[];\n /** The text without markers. */\n strip(text: string): string;\n};\n\nexport function createMarker(): Marker {\n const ids: string[] = [];\n const index = new Map<string, number>();\n const code = (id: string) => {\n let n = index.get(id);\n if (n === undefined) { n = ids.length; ids.push(id); index.set(id, n); }\n let digits = '';\n do { digits = DIGITS[n % 4] + digits; n = Math.floor(n / 4); } while (n);\n return START + digits + START;\n };\n return {\n mark(id, value) {\n if (typeof value === 'string') return value + code(id);\n if (typeof value === 'function') {\n const original = value as (...args: unknown[]) => unknown;\n return function (this: unknown, ...args: unknown[]) {\n const out = original.apply(this, args);\n return typeof out === 'string' ? out + code(id) : out;\n };\n }\n return value;\n },\n ids(text) {\n const out: string[] = [];\n for (const match of text.matchAll(MARKED)) {\n let n = 0;\n for (const ch of match[1]!) n = n * 4 + DIGITS.indexOf(ch);\n const id = ids[n];\n if (id && !out.includes(id)) out.push(id);\n }\n return out;\n },\n strip: text => text.replace(MARKED, ''),\n };\n}\n\n/** The author's edits in this tab. */\nexport type TranslateDraft = { language: string; name: string; strings: Record<string, string> };\n\nexport const DRAFT_KEY = 'wayBetter.translateDraft';\n\nexport function readDraft(storage: Pick<Storage, 'getItem'>): TranslateDraft | null {\n try {\n const value = JSON.parse(storage.getItem(DRAFT_KEY) ?? 'null') as TranslateDraft | null;\n return value && typeof value === 'object' && typeof value.strings === 'object' && value.strings !== null ? value : null;\n } catch {\n return null;\n }\n}\n\n/** The draft as a pack document for `site`/`catalog`. */\nexport function draftPack(draft: TranslateDraft, site: string, catalog: string): StringPack {\n return {\n format: 1, site, catalog, language: draft.language || 'en-x-draft', name: draft.name || 'My strings', authors: ['Me'],\n version: '0.1.0', strings: { ...draft.strings },\n };\n}\n\n/** Checks one edit against the key's shape; `null` when it can be used. */\nexport function checkEdit(lookup: InventoryLookup, id: string, value: string): string | null {\n const shape = lookup(id);\n if (!shape) return 'this key is not in the inventory';\n const result = validateString(shape, value);\n return 'reason' in result ? result.reason : null;\n}\n\nexport type TranslateWords = {\n bar: string; hint: string; edits(count: number): string; exportPack: string; copied: string; exit: string; reload: string;\n key: string; original: string; parameters: string; save: string; cancel: string; remove: string; notTranslatable: string; choose: string;\n};\n\n/** English defaults (the app passes its own words). */\nexport const TRANSLATE_WORDS: TranslateWords = {\n bar: 'Translate mode', hint: 'Click a word to change it.', edits: count => `${count} ${count === 1 ? 'edit' : 'edits'}`,\n exportPack: 'Copy pack file', copied: 'Pack file copied', exit: 'Leave', reload: 'Reload to see it',\n key: 'Key', original: 'Now', parameters: 'Parameters', save: 'Save', cancel: 'Cancel', remove: 'Remove edit',\n notTranslatable: 'This string cannot be changed by a pack yet.', choose: 'Which one?',\n};\n\nexport type TranslateUiOptions = {\n inventory: PageInventory;\n marker: Marker;\n site: string;\n catalog: string;\n words?: Partial<TranslateWords>;\n /** Leaves translate mode (the app drops the flag and reloads). */\n exit(): void;\n};\n\nconst CSS = `\n:host { all: initial; }\n.bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 2147483646; display: flex; gap: 10px; align-items: center;\n padding: 8px 12px; border-radius: 12px; background: #111827; color: #f9fafb; font: 13px/1.3 system-ui, sans-serif; box-shadow: 0 8px 24px rgba(0,0,0,.35); }\n.bar b { font-weight: 600; } .bar span { color: #cbd5e1; }\nbutton { font: inherit; border: 0; border-radius: 8px; padding: 6px 10px; cursor: pointer; background: #334155; color: #f9fafb; }\nbutton.primary { background: #2563eb; }\n.pop { position: fixed; z-index: 2147483647; width: 360px; max-width: calc(100vw - 24px); padding: 12px; border-radius: 12px; background: #fff; color: #111827;\n font: 13px/1.4 system-ui, sans-serif; box-shadow: 0 12px 32px rgba(0,0,0,.3); display: grid; gap: 8px; }\n.pop small { color: #475569; } .pop code { font-size: 12px; color: #334155; }\n.pop textarea { width: 100%; box-sizing: border-box; min-height: 64px; font: inherit; padding: 6px; border: 1px solid #cbd5e1; border-radius: 8px; }\n.pop .row { display: flex; gap: 8px; justify-content: flex-end; } .pop .err { color: #b91c1c; }\n.pop .pick { display: grid; gap: 4px; } .pop .pick button { text-align: left; background: #e2e8f0; color: #111827; }\n`;\n\n/**\n * The page part of translate mode: a bar (edits, copy the pack file, leave) and an editor for the\n * string under a click. Clicks on marked text are the editor's while the mode is on.\n */\nexport function installTranslateUi(win: Window, options: TranslateUiOptions): { dispose(): void } {\n const doc = win.document;\n const words = { ...TRANSLATE_WORDS, ...options.words };\n const lookup = inventoryLookup(options.inventory);\n const storage = win.sessionStorage;\n const draft = (): TranslateDraft => readDraft(storage) ?? { language: '', name: '', strings: {} };\n const save = (next: TranslateDraft) => { try { storage.setItem(DRAFT_KEY, JSON.stringify(next)); } catch { /* storage full or blocked */ } };\n\n const host = doc.createElement('wb-translate');\n const root = host.attachShadow({ mode: 'open' });\n const style = doc.createElement('style');\n style.textContent = CSS;\n root.append(style);\n const bar = doc.createElement('div');\n bar.className = 'bar';\n root.append(bar);\n let pop: HTMLElement | null = null;\n let changed = false;\n\n const button = (label: string, onClick: () => void, primary = false) => {\n const el = doc.createElement('button');\n el.textContent = label;\n if (primary) el.className = 'primary';\n el.addEventListener('click', event => { event.preventDefault(); event.stopPropagation(); onClick(); });\n return el;\n };\n const renderBar = () => {\n bar.replaceChildren();\n const title = doc.createElement('b');\n title.textContent = words.bar;\n const hint = doc.createElement('span');\n hint.textContent = `${words.hint} · ${words.edits(Object.keys(draft().strings).length)}`;\n bar.append(title, hint);\n if (changed) bar.append(button(words.reload, () => win.location.reload(), true));\n bar.append(button(words.exportPack, () => {\n const text = JSON.stringify(draftPack(draft(), options.site, options.catalog), null, 2);\n void win.navigator.clipboard?.writeText(text).then(() => { hint.textContent = words.copied; }).catch(() => {});\n }));\n bar.append(button(words.exit, options.exit));\n };\n const closePop = () => { pop?.remove(); pop = null; };\n\n const edit = (id: string, x: number, y: number, now: string) => {\n closePop();\n pop = doc.createElement('div');\n pop.className = 'pop';\n pop.style.left = `${Math.max(12, Math.min(x, win.innerWidth - 372))}px`;\n pop.style.top = `${Math.max(12, Math.min(y + 12, win.innerHeight - 260))}px`;\n const shape = lookup(id);\n const head = doc.createElement('small');\n head.textContent = `${words.key}: `;\n const code = doc.createElement('code');\n code.textContent = id;\n head.append(code);\n const current = doc.createElement('div');\n current.textContent = `${words.original}: ${now}`;\n pop.append(head, current);\n if (!shape || (shape.kind !== 'text' && shape.kind !== 'message')) {\n const note = doc.createElement('div');\n note.textContent = words.notTranslatable;\n pop.append(note, button(words.cancel, closePop));\n root.append(pop);\n return;\n }\n if (shape.params?.length) {\n const params = doc.createElement('small');\n params.textContent = `${words.parameters}: ${shape.params.map(name => `{${name}}${shape.plural?.includes(name) ? ' (plural)' : ''}`).join(', ')}`;\n pop.append(params);\n }\n const input = doc.createElement('textarea');\n input.value = draft().strings[id] ?? now;\n const error = doc.createElement('div');\n error.className = 'err';\n const row = doc.createElement('div');\n row.className = 'row';\n if (draft().strings[id] !== undefined) {\n row.append(button(words.remove, () => { const next = draft(); delete next.strings[id]; save(next); changed = true; closePop(); renderBar(); }));\n }\n row.append(button(words.cancel, closePop), button(words.save, () => {\n const value = input.value.trim();\n const problem = checkEdit(lookup, id, value);\n if (problem) { error.textContent = problem; return; }\n const next = draft();\n next.strings[id] = value;\n save(next);\n changed = true;\n closePop();\n renderBar();\n }, true));\n pop.append(input, error, row);\n root.append(pop);\n input.focus();\n };\n\n /** The marked keys at a click: the element's own text and labels, then up to three parents. */\n const keysAt = (target: Element | null) => {\n for (let el = target, depth = 0; el && depth < 4; el = el.parentElement, depth += 1) {\n const texts = [el.textContent ?? '', el.getAttribute('aria-label') ?? '', el.getAttribute('placeholder') ?? '', el.getAttribute('title') ?? ''];\n const found = texts.flatMap(text => options.marker.ids(text).map(id => ({ id, text: options.marker.strip(text) })));\n if (found.length) return found.filter((item, i) => found.findIndex(other => other.id === item.id) === i).slice(0, 8);\n }\n return [];\n };\n const onClick = (event: MouseEvent) => {\n if (event.composedPath().includes(host)) return;\n const found = keysAt(event.target as Element | null);\n if (!found.length) return;\n event.preventDefault();\n event.stopPropagation();\n if (found.length === 1) { edit(found[0]!.id, event.clientX, event.clientY, found[0]!.text); return; }\n closePop();\n pop = doc.createElement('div');\n pop.className = 'pop';\n pop.style.left = `${Math.max(12, Math.min(event.clientX, win.innerWidth - 372))}px`;\n pop.style.top = `${Math.max(12, Math.min(event.clientY + 12, win.innerHeight - 260))}px`;\n const pick = doc.createElement('div');\n pick.className = 'pick';\n const label = doc.createElement('small');\n label.textContent = words.choose;\n pick.append(label, ...found.map(item => button(`${item.text.slice(0, 60)} · ${item.id}`, () => edit(item.id, event.clientX, event.clientY, item.text))));\n pop.append(pick, button(words.cancel, closePop));\n root.append(pop);\n };\n\n const mount = () => { (doc.body ?? doc.documentElement).append(host); renderBar(); };\n if (doc.body) mount(); else doc.addEventListener('DOMContentLoaded', mount, { once: true });\n win.addEventListener('click', onClick, true);\n return { dispose() { win.removeEventListener('click', onClick, true); host.remove(); } };\n}\n\n/** The draft as the last pack of a delivery (it applies over the others), when it has any string. */\nexport function withDraft(packs: readonly unknown[], storage: Pick<Storage, 'getItem'>, site: string, catalog: string, inventory: PageInventory): unknown[] {\n const draft = readDraft(storage);\n if (!draft || !Object.keys(draft.strings).length) return [...packs];\n const pack = draftPack(draft, site, catalog);\n try { compilePack(pack, inventory); } catch { return [...packs]; }\n return [...packs, pack];\n}\n"]}
@@ -0,0 +1,200 @@
1
+ import { parseMessage } from './i18n.ts';
2
+ type Parts = ReturnType<typeof parseMessage>;
3
+ /**
4
+ * What the site's value for a key is:
5
+ * - `text`: a plain string;
6
+ * - `message`: a function of a parameter object that returns a string;
7
+ * - `rich`: text with element slots (not replaceable by data yet);
8
+ * - `format`: a compiled number/date/currency formatter (not text).
9
+ * Only `text` and `message` can be replaced by a pack.
10
+ */
11
+ export type StringKind = 'text' | 'message' | 'rich' | 'format';
12
+ export type InventoryEntry = {
13
+ kind: StringKind;
14
+ /** Parameter names the site's value takes (`message`). */
15
+ params?: string[];
16
+ /** Parameters the site's value pluralizes: known to be numbers, so a pack may pluralize them. */
17
+ plural?: string[];
18
+ /** Parameters the site's value selects on. */
19
+ select?: string[];
20
+ /** Tag slot names, for catalogs whose values carry `<tag>…</tag>` slots. */
21
+ tags?: string[];
22
+ /** Hash of the base-language value (`hashText`): drift detection; never the text itself. */
23
+ hash: string;
24
+ /** Part of the catalog the key arrives with (default `main`), e.g. a lazily loaded `emoji` group. */
25
+ group?: string;
26
+ };
27
+ /** The known keys of one catalog of one site. It carries ids and shapes, never the site's text. */
28
+ export type StringInventory = {
29
+ format: 1;
30
+ site: string;
31
+ catalog: string;
32
+ /** Language the hashes were taken from. */
33
+ base: string;
34
+ /** The site build the inventory was read from. */
35
+ build?: string;
36
+ entries: Record<string, InventoryEntry>;
37
+ };
38
+ /** A string pack document: metadata and `key id -> text`. */
39
+ export type StringPack = {
40
+ format: 1;
41
+ site: string;
42
+ catalog: string;
43
+ /** BCP 47 tag of the pack's language (private-use tags are fine: `en-x-pirate`). */
44
+ language: string;
45
+ name: string;
46
+ authors: string[];
47
+ /** A language whose plural rules the pack follows when the runtime does not know `language`. */
48
+ base?: string;
49
+ version?: string;
50
+ description?: string;
51
+ strings: Record<string, string>;
52
+ };
53
+ export declare const STRING_PACK_LIMITS: Readonly<{
54
+ strings: 40000;
55
+ value: 2000;
56
+ name: 80;
57
+ authors: 16;
58
+ }>;
59
+ export declare const MAIN_GROUP = "main";
60
+ /** Whether a pack can replace a value of this kind. */
61
+ export declare function translatable(kind: StringKind): boolean;
62
+ /** 53-bit hash of a text as 11 base-36 characters. Same result in every runtime. */
63
+ export declare function hashText(text: string): string;
64
+ /** The facts the validator and the engine need about one key. */
65
+ export type EntryShape = Pick<InventoryEntry, 'kind' | 'params' | 'plural' | 'select' | 'tags'>;
66
+ export type InventoryLookup = (id: string) => EntryShape | undefined;
67
+ /**
68
+ * The inventory as it ships inside a page runtime: ids and shapes only, no hashes, a fraction of
69
+ * the size. `text` and `closed` are space-separated ids; a message is `name name*` (`*` = plural,
70
+ * `?` = select).
71
+ */
72
+ export type PageInventory = {
73
+ site: string;
74
+ catalog: string;
75
+ text: string;
76
+ message: Record<string, string>;
77
+ closed: string;
78
+ /** A slice: only the keys some pack names. A key missing from a slice is not a new key of the site. */
79
+ partial?: boolean;
80
+ };
81
+ export declare function packInventory(inventory: StringInventory): PageInventory;
82
+ /**
83
+ * The part of an inventory that the given keys need: what travels to a page together with the
84
+ * packs it should apply (a page never needs the rest). Keys the inventory does not have are left
85
+ * out, so they stay unknown there too.
86
+ */
87
+ export declare function sliceInventory(inventory: StringInventory | PageInventory, ids: Iterable<string>): PageInventory;
88
+ /** Whether untrusted data has the shape of a page inventory (ids and parameter names only). */
89
+ export declare function isPageInventory(input: unknown): input is PageInventory;
90
+ /** A lookup over either form. The page form is decoded on first use. */
91
+ export declare function inventoryLookup(inventory: StringInventory | PageInventory): InventoryLookup;
92
+ export type PackIssue = {
93
+ level: 'error' | 'warning';
94
+ key?: string;
95
+ message: string;
96
+ };
97
+ /** Checks the document envelope. Errors mean the pack is not applied at all. */
98
+ export declare function checkPackShape(input: unknown): PackIssue[];
99
+ /**
100
+ * Validates one pack value against the key's inventory entry. Returns the parsed message, or the
101
+ * reason it is refused (the original then stays).
102
+ */
103
+ export declare function validateString(shape: EntryShape, value: unknown): {
104
+ parts: Parts;
105
+ } | {
106
+ reason: string;
107
+ };
108
+ export type CompiledValue = {
109
+ text: string;
110
+ } | {
111
+ parts: Parts;
112
+ };
113
+ export type PackReport = {
114
+ /** Entries in the pack. */
115
+ total: number;
116
+ /** Entries that are valid for an inventory key. */
117
+ valid: number;
118
+ /** Ids the inventory does not have: never applied. */
119
+ unknown: string[];
120
+ /** Values that failed validation: not applied, the original stays. */
121
+ rejected: {
122
+ id: string;
123
+ reason: string;
124
+ }[];
125
+ };
126
+ export type CompiledPack = {
127
+ name: string;
128
+ language: string;
129
+ base?: string;
130
+ site: string;
131
+ catalog: string;
132
+ values: ReadonlyMap<string, CompiledValue>;
133
+ report: PackReport;
134
+ };
135
+ /**
136
+ * Validates a pack against an inventory. Throws on a malformed envelope or a pack for another
137
+ * site/catalog; every other problem is per key and lands in `report`.
138
+ */
139
+ export declare function compilePack(input: unknown, inventory: StringInventory | PageInventory): CompiledPack;
140
+ /**
141
+ * Renders a validated message. A parameter is inserted the way string concatenation would
142
+ * (`String(value)`, nothing for a missing one); `#` is the plural's own value.
143
+ */
144
+ export declare function renderMessage(parts: Parts, params: Readonly<Record<string, unknown>>, languages: readonly (string | undefined)[], pound?: unknown): string;
145
+ export type EngineStats = {
146
+ /** Keys the site registered. */
147
+ seen: number;
148
+ /** Keys a pack value was used for. */
149
+ applied: number;
150
+ /** Keys the site registered that the inventory does not have (new keys: drift). */
151
+ unlisted: string[];
152
+ /** Keys whose live value does not have the inventory's kind: left untouched. */
153
+ mismatched: string[];
154
+ };
155
+ export type StringEngine = {
156
+ /**
157
+ * The value to use for `id`, given the site's own value: a pack's, or exactly `original`.
158
+ * Feeding a value this engine produced back in returns the same value (idempotent).
159
+ */
160
+ resolve(id: string, original: unknown): unknown;
161
+ /** The site's own values of the keys a pack changed: what restoring needs. */
162
+ originals(): ReadonlyMap<string, unknown>;
163
+ stats(): EngineStats;
164
+ };
165
+ /** `packs` in application order: a later pack wins over an earlier one for the same key. */
166
+ export declare function createStringEngine(inventory: StringInventory | PageInventory | InventoryLookup, packs: readonly CompiledPack[]): StringEngine;
167
+ /**
168
+ * The whole catalog at once: a new object with the packs applied; `catalog` itself is not
169
+ * changed. `applyPacks(applyPacks(c, …), …)` with one engine equals `applyPacks(c, …)`.
170
+ */
171
+ export declare function applyPacks(catalog: Readonly<Record<string, unknown>>, engine: StringEngine): Record<string, unknown>;
172
+ /** The inverse: every value a pack changed is the site's own again; `catalog` is not changed. */
173
+ export declare function restoreCatalog(catalog: Readonly<Record<string, unknown>>, engine: StringEngine): Record<string, unknown>;
174
+ export type Coverage = {
175
+ /** Keys a pack can replace (text and messages). */
176
+ translatable: number;
177
+ /** Of those, keys the pack has a valid value for. */
178
+ translated: number;
179
+ /** Keys that exist but cannot be replaced by data yet (rich text, formatters). */
180
+ closed: number;
181
+ };
182
+ /** Coverage of a compiled pack per group of the inventory, plus `all`. */
183
+ export declare function coverage(inventory: StringInventory, pack: Pick<CompiledPack, 'values'>): Record<string, Coverage>;
184
+ export type DriftReport = {
185
+ /** Keys the site has that the inventory lacks. */
186
+ added: string[];
187
+ /** Keys whose base-language value changed (same shape). */
188
+ reworded: string[];
189
+ /** Keys whose kind or parameters changed: pack values for them have to be checked again. */
190
+ reshaped: string[];
191
+ /** Inventory keys the site no longer has. Only for groups whose base catalog was loaded. */
192
+ vanished: string[];
193
+ };
194
+ /**
195
+ * Compares an inventory with what was observed now. `loaded` names the groups whose base catalog
196
+ * was actually read: a key can only be called vanished when its group was (a lazily loaded group
197
+ * that never arrived says nothing about its keys).
198
+ */
199
+ export declare function driftReport(inventory: StringInventory, observed: Readonly<Record<string, InventoryEntry>>, loaded: readonly string[]): DriftReport;
200
+ export {};