waybetter 0.1.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (515) hide show
  1. package/README.md +140 -6
  2. package/bin/waybetter.mjs +46 -0
  3. package/build/runtime.mjs +105 -0
  4. package/cli/buildenv.mjs +130 -0
  5. package/cli/dev.mjs +97 -0
  6. package/cli/i18n.mjs +382 -0
  7. package/cli/manifests.mjs +383 -0
  8. package/cli/privacy.mjs +768 -0
  9. package/cli/release.mjs +444 -0
  10. package/cli/remote.mjs +260 -0
  11. package/cli/store.mjs +326 -0
  12. package/cli/strings.mjs +121 -0
  13. package/dist/runtime/column.d.ts +93 -0
  14. package/dist/runtime/column.js +451 -0
  15. package/dist/runtime/column.js.map +1 -0
  16. package/dist/runtime/commandReport.d.ts +19 -0
  17. package/dist/runtime/commandReport.js +47 -0
  18. package/dist/runtime/commandReport.js.map +1 -0
  19. package/dist/runtime/commands.d.ts +72 -0
  20. package/dist/runtime/commands.js +214 -0
  21. package/dist/runtime/commands.js.map +1 -0
  22. package/dist/runtime/devErrors.d.ts +16 -0
  23. package/dist/runtime/devErrors.js +30 -0
  24. package/dist/runtime/devErrors.js.map +1 -0
  25. package/dist/runtime/domHub.d.ts +21 -0
  26. package/dist/runtime/domHub.js +139 -4
  27. package/dist/runtime/domHub.js.map +1 -1
  28. package/dist/runtime/featureModules.d.ts +157 -0
  29. package/dist/runtime/featureModules.js +484 -0
  30. package/dist/runtime/featureModules.js.map +1 -0
  31. package/dist/runtime/featureTable.d.ts +144 -0
  32. package/dist/runtime/featureTable.js +223 -0
  33. package/dist/runtime/featureTable.js.map +1 -0
  34. package/dist/runtime/fonts.d.ts +22 -0
  35. package/dist/runtime/fonts.js +72 -0
  36. package/dist/runtime/fonts.js.map +1 -0
  37. package/dist/runtime/i18n.d.ts +138 -0
  38. package/dist/runtime/i18n.js +614 -0
  39. package/dist/runtime/i18n.js.map +1 -0
  40. package/dist/runtime/i18nCheck.d.ts +30 -0
  41. package/dist/runtime/i18nCheck.js +224 -0
  42. package/dist/runtime/i18nCheck.js.map +1 -0
  43. package/dist/runtime/pageLang.d.ts +8 -0
  44. package/dist/runtime/pageLang.js +64 -0
  45. package/dist/runtime/pageLang.js.map +1 -0
  46. package/dist/runtime/pageStrings.d.ts +35 -0
  47. package/dist/runtime/pageStrings.js +76 -0
  48. package/dist/runtime/pageStrings.js.map +1 -0
  49. package/dist/runtime/panelButton.d.ts +33 -0
  50. package/dist/runtime/panelButton.js +83 -0
  51. package/dist/runtime/panelButton.js.map +1 -0
  52. package/dist/runtime/permissions.d.ts +47 -0
  53. package/dist/runtime/permissions.js +141 -0
  54. package/dist/runtime/permissions.js.map +1 -0
  55. package/dist/runtime/pluginApi.d.ts +51 -2
  56. package/dist/runtime/pluginApi.js +137 -22
  57. package/dist/runtime/pluginApi.js.map +1 -1
  58. package/dist/runtime/pluginI18n.d.ts +29 -0
  59. package/dist/runtime/pluginI18n.js +119 -0
  60. package/dist/runtime/pluginI18n.js.map +1 -0
  61. package/dist/runtime/settingsForm.d.ts +66 -0
  62. package/dist/runtime/settingsForm.js +114 -0
  63. package/dist/runtime/settingsForm.js.map +1 -0
  64. package/dist/runtime/site.d.ts +5 -0
  65. package/dist/runtime/site.js +1 -1
  66. package/dist/runtime/site.js.map +1 -1
  67. package/dist/runtime/siteRuntime.d.ts +144 -0
  68. package/dist/runtime/siteRuntime.js +175 -0
  69. package/dist/runtime/siteRuntime.js.map +1 -0
  70. package/dist/runtime/stringPackHook.d.ts +84 -0
  71. package/dist/runtime/stringPackHook.js +220 -0
  72. package/dist/runtime/stringPackHook.js.map +1 -0
  73. package/dist/runtime/stringPackTranslate.d.ts +59 -0
  74. package/dist/runtime/stringPackTranslate.js +264 -0
  75. package/dist/runtime/stringPackTranslate.js.map +1 -0
  76. package/dist/runtime/stringPacks.d.ts +200 -0
  77. package/dist/runtime/stringPacks.js +474 -0
  78. package/dist/runtime/stringPacks.js.map +1 -0
  79. package/dist/runtime/styles.d.ts +15 -0
  80. package/dist/runtime/styles.js +81 -0
  81. package/dist/runtime/styles.js.map +1 -0
  82. package/dist/runtime/textNet.d.ts +15 -0
  83. package/dist/runtime/textNet.js +131 -0
  84. package/dist/runtime/textNet.js.map +1 -0
  85. package/dist/runtime/themeApi.d.ts +121 -0
  86. package/dist/runtime/themeApi.js +220 -0
  87. package/dist/runtime/themeApi.js.map +1 -0
  88. package/dist/runtime/themeChoice.d.ts +52 -0
  89. package/dist/runtime/themeChoice.js +69 -0
  90. package/dist/runtime/themeChoice.js.map +1 -0
  91. package/dist/runtime/themeComponents.d.ts +435 -0
  92. package/dist/runtime/themeComponents.js +463 -0
  93. package/dist/runtime/themeComponents.js.map +1 -0
  94. package/dist/runtime/themeDecor.d.ts +73 -0
  95. package/dist/runtime/themeDecor.js +131 -0
  96. package/dist/runtime/themeDecor.js.map +1 -0
  97. package/dist/runtime/themeDoctor.d.ts +11 -0
  98. package/dist/runtime/themeDoctor.js +51 -0
  99. package/dist/runtime/themeDoctor.js.map +1 -0
  100. package/dist/runtime/themeIcons.d.ts +130 -0
  101. package/dist/runtime/themeIcons.js +263 -0
  102. package/dist/runtime/themeIcons.js.map +1 -0
  103. package/dist/runtime/themeRuntime.d.ts +100 -0
  104. package/dist/runtime/themeRuntime.js +497 -0
  105. package/dist/runtime/themeRuntime.js.map +1 -0
  106. package/dist/runtime/themeSchema.d.ts +10 -0
  107. package/dist/runtime/themeSchema.js +150 -0
  108. package/dist/runtime/themeSchema.js.map +1 -0
  109. package/dist/runtime/themeSpec.d.ts +259 -0
  110. package/dist/runtime/themeSpec.js +439 -0
  111. package/dist/runtime/themeSpec.js.map +1 -0
  112. package/dist/runtime/themeTokens.d.ts +12 -0
  113. package/dist/runtime/themeTokens.js +14 -6
  114. package/dist/runtime/themeTokens.js.map +1 -1
  115. package/dist/runtime/themeVariants.d.ts +30 -0
  116. package/dist/runtime/themeVariants.js +53 -0
  117. package/dist/runtime/themeVariants.js.map +1 -0
  118. package/dist/runtime/ui.d.ts +192 -0
  119. package/dist/runtime/ui.js +926 -0
  120. package/dist/runtime/ui.js.map +1 -0
  121. package/dist/shell/InstallDialog.d.ts +40 -0
  122. package/dist/shell/InstallDialog.js +170 -0
  123. package/dist/shell/InstallDialog.js.map +1 -0
  124. package/dist/shell/StoreView.d.ts +66 -0
  125. package/dist/shell/StoreView.js +103 -0
  126. package/dist/shell/StoreView.js.map +1 -0
  127. package/dist/shell/addressModel.js.map +1 -1
  128. package/dist/shell/chrome.js.map +1 -1
  129. package/dist/shell/deckModel.d.ts +117 -0
  130. package/dist/shell/deckModel.js +267 -0
  131. package/dist/shell/deckModel.js.map +1 -0
  132. package/dist/shell/frame/AccountSwitcher.d.ts +42 -0
  133. package/dist/shell/frame/AccountSwitcher.js +243 -0
  134. package/dist/shell/frame/AccountSwitcher.js.map +1 -0
  135. package/dist/shell/frame/AddColumnDialog.d.ts +8 -0
  136. package/dist/shell/frame/AddColumnDialog.js +81 -0
  137. package/dist/shell/frame/AddColumnDialog.js.map +1 -0
  138. package/dist/shell/frame/AppMenu.d.ts +21 -0
  139. package/dist/shell/frame/AppMenu.js +642 -0
  140. package/dist/shell/frame/AppMenu.js.map +1 -0
  141. package/dist/shell/frame/CommandPalette.d.ts +7 -0
  142. package/dist/shell/frame/CommandPalette.js +118 -0
  143. package/dist/shell/frame/CommandPalette.js.map +1 -0
  144. package/dist/shell/frame/DeckView.d.ts +13 -0
  145. package/dist/shell/frame/DeckView.js +287 -0
  146. package/dist/shell/frame/DeckView.js.map +1 -0
  147. package/dist/shell/frame/FindBar.d.ts +10 -0
  148. package/dist/shell/frame/FindBar.js +108 -0
  149. package/dist/shell/frame/FindBar.js.map +1 -0
  150. package/dist/shell/frame/MediaPanel.d.ts +8 -0
  151. package/dist/shell/frame/MediaPanel.js +76 -0
  152. package/dist/shell/frame/MediaPanel.js.map +1 -0
  153. package/dist/shell/frame/NewTabPage.d.ts +9 -0
  154. package/dist/shell/frame/NewTabPage.js +71 -0
  155. package/dist/shell/frame/NewTabPage.js.map +1 -0
  156. package/dist/shell/frame/PaneTheme.d.ts +16 -0
  157. package/dist/shell/frame/PaneTheme.js +67 -0
  158. package/dist/shell/frame/PaneTheme.js.map +1 -0
  159. package/dist/shell/frame/ReportDialog.d.ts +3 -0
  160. package/dist/shell/frame/ReportDialog.js +95 -0
  161. package/dist/shell/frame/ReportDialog.js.map +1 -0
  162. package/dist/shell/frame/Shell.d.ts +8 -0
  163. package/dist/shell/frame/Shell.js +1131 -0
  164. package/dist/shell/frame/Shell.js.map +1 -0
  165. package/dist/shell/frame/Titlebar.d.ts +16 -0
  166. package/dist/shell/frame/Titlebar.js +77 -0
  167. package/dist/shell/frame/Titlebar.js.map +1 -0
  168. package/dist/shell/frame/TitlebarExtras.d.ts +4 -0
  169. package/dist/shell/frame/TitlebarExtras.js +202 -0
  170. package/dist/shell/frame/TitlebarExtras.js.map +1 -0
  171. package/dist/shell/frame/WebPanel.d.ts +4 -0
  172. package/dist/shell/frame/WebPanel.js +182 -0
  173. package/dist/shell/frame/WebPanel.js.map +1 -0
  174. package/dist/shell/frame/accountModel.d.ts +49 -0
  175. package/dist/shell/frame/accountModel.js +67 -0
  176. package/dist/shell/frame/accountModel.js.map +1 -0
  177. package/dist/shell/frame/accountSwitcher.css +91 -0
  178. package/dist/shell/frame/appI18n.d.ts +44 -0
  179. package/dist/shell/frame/appI18n.js +64 -0
  180. package/dist/shell/frame/appI18n.js.map +1 -0
  181. package/dist/shell/frame/appMenu.css +121 -0
  182. package/dist/shell/frame/backupModel.d.ts +38 -0
  183. package/dist/shell/frame/backupModel.js +192 -0
  184. package/dist/shell/frame/backupModel.js.map +1 -0
  185. package/dist/shell/frame/boot.d.ts +8 -0
  186. package/dist/shell/frame/boot.js +35 -0
  187. package/dist/shell/frame/boot.js.map +1 -0
  188. package/dist/shell/frame/brand.d.ts +1 -0
  189. package/dist/shell/frame/brand.js +4 -0
  190. package/dist/shell/frame/brand.js.map +1 -0
  191. package/dist/shell/frame/bridge.d.ts +35 -0
  192. package/dist/shell/frame/bridge.js +70 -0
  193. package/dist/shell/frame/bridge.js.map +1 -0
  194. package/dist/shell/frame/chromeTheme.d.ts +29 -0
  195. package/dist/shell/frame/chromeTheme.js +81 -0
  196. package/dist/shell/frame/chromeTheme.js.map +1 -0
  197. package/dist/shell/frame/deck.css +209 -0
  198. package/dist/shell/frame/deckStore.d.ts +89 -0
  199. package/dist/shell/frame/deckStore.js +239 -0
  200. package/dist/shell/frame/deckStore.js.map +1 -0
  201. package/dist/shell/frame/devHost.d.ts +35 -0
  202. package/dist/shell/frame/devHost.js +80 -0
  203. package/dist/shell/frame/devHost.js.map +1 -0
  204. package/dist/shell/frame/devModel.d.ts +7 -0
  205. package/dist/shell/frame/devModel.js +17 -0
  206. package/dist/shell/frame/devModel.js.map +1 -0
  207. package/dist/shell/frame/diag.d.ts +7 -0
  208. package/dist/shell/frame/diag.js +39 -0
  209. package/dist/shell/frame/diag.js.map +1 -0
  210. package/dist/shell/frame/findBar.css +14 -0
  211. package/dist/shell/frame/frameMessages.d.ts +248 -0
  212. package/dist/shell/frame/frameMessages.js +252 -0
  213. package/dist/shell/frame/frameMessages.js.map +1 -0
  214. package/dist/shell/frame/hooks.d.ts +39 -0
  215. package/dist/shell/frame/hooks.js +97 -0
  216. package/dist/shell/frame/hooks.js.map +1 -0
  217. package/dist/shell/frame/i18n.d.ts +27 -0
  218. package/dist/shell/frame/i18n.js +66 -0
  219. package/dist/shell/frame/i18n.js.map +1 -0
  220. package/dist/shell/frame/iconPack.d.ts +11 -0
  221. package/dist/shell/frame/iconPack.js +45 -0
  222. package/dist/shell/frame/iconPack.js.map +1 -0
  223. package/dist/shell/frame/icons.d.ts +71 -0
  224. package/dist/shell/frame/icons.js +75 -0
  225. package/dist/shell/frame/icons.js.map +1 -0
  226. package/dist/shell/frame/index.d.ts +34 -0
  227. package/dist/shell/frame/index.js +43 -0
  228. package/dist/shell/frame/index.js.map +1 -0
  229. package/dist/shell/frame/language.d.ts +58 -0
  230. package/dist/shell/frame/language.js +165 -0
  231. package/dist/shell/frame/language.js.map +1 -0
  232. package/dist/shell/frame/mediaModel.d.ts +34 -0
  233. package/dist/shell/frame/mediaModel.js +53 -0
  234. package/dist/shell/frame/mediaModel.js.map +1 -0
  235. package/dist/shell/frame/menuMessages.en.json +54 -0
  236. package/dist/shell/frame/menuModel.d.ts +277 -0
  237. package/dist/shell/frame/menuModel.js +293 -0
  238. package/dist/shell/frame/menuModel.js.map +1 -0
  239. package/dist/shell/frame/paletteModel.d.ts +139 -0
  240. package/dist/shell/frame/paletteModel.js +112 -0
  241. package/dist/shell/frame/paletteModel.js.map +1 -0
  242. package/dist/shell/frame/paneTheme.css +9 -0
  243. package/dist/shell/frame/pluginCommandStore.d.ts +23 -0
  244. package/dist/shell/frame/pluginCommandStore.js +70 -0
  245. package/dist/shell/frame/pluginCommandStore.js.map +1 -0
  246. package/dist/shell/frame/reportModel.d.ts +52 -0
  247. package/dist/shell/frame/reportModel.js +105 -0
  248. package/dist/shell/frame/reportModel.js.map +1 -0
  249. package/dist/shell/frame/safeStore.d.ts +7 -0
  250. package/dist/shell/frame/safeStore.js +40 -0
  251. package/dist/shell/frame/safeStore.js.map +1 -0
  252. package/dist/shell/frame/searchInput.d.ts +2 -0
  253. package/dist/shell/frame/searchInput.js +11 -0
  254. package/dist/shell/frame/searchInput.js.map +1 -0
  255. package/dist/shell/frame/shell.css +629 -0
  256. package/dist/shell/frame/site.d.ts +206 -0
  257. package/dist/shell/frame/site.js +22 -0
  258. package/dist/shell/frame/site.js.map +1 -0
  259. package/dist/shell/frame/state.d.ts +99 -0
  260. package/dist/shell/frame/state.js +284 -0
  261. package/dist/shell/frame/state.js.map +1 -0
  262. package/dist/shell/frame/syncGate.d.ts +10 -0
  263. package/dist/shell/frame/syncGate.js +36 -0
  264. package/dist/shell/frame/syncGate.js.map +1 -0
  265. package/dist/shell/frame/syncHost.d.ts +35 -0
  266. package/dist/shell/frame/syncHost.js +85 -0
  267. package/dist/shell/frame/syncHost.js.map +1 -0
  268. package/dist/shell/frame/tabStill.d.ts +2 -0
  269. package/dist/shell/frame/tabStill.js +62 -0
  270. package/dist/shell/frame/tabStill.js.map +1 -0
  271. package/dist/shell/frame/themeScopes.d.ts +29 -0
  272. package/dist/shell/frame/themeScopes.js +61 -0
  273. package/dist/shell/frame/themeScopes.js.map +1 -0
  274. package/dist/shell/frame/themeStore.d.ts +99 -0
  275. package/dist/shell/frame/themeStore.js +252 -0
  276. package/dist/shell/frame/themeStore.js.map +1 -0
  277. package/dist/shell/frame/windowBinding.d.ts +2 -0
  278. package/dist/shell/frame/windowBinding.js +7 -0
  279. package/dist/shell/frame/windowBinding.js.map +1 -0
  280. package/dist/shell/frame/workspaceModel.d.ts +82 -0
  281. package/dist/shell/frame/workspaceModel.js +250 -0
  282. package/dist/shell/frame/workspaceModel.js.map +1 -0
  283. package/dist/shell/frame/workspaces.css +84 -0
  284. package/dist/shell/frame/workspaces.d.ts +22 -0
  285. package/dist/shell/frame/workspaces.js +125 -0
  286. package/dist/shell/frame/workspaces.js.map +1 -0
  287. package/dist/shell/frame/zoomStore.d.ts +10 -0
  288. package/dist/shell/frame/zoomStore.js +65 -0
  289. package/dist/shell/frame/zoomStore.js.map +1 -0
  290. package/dist/shell/installController.d.ts +122 -0
  291. package/dist/shell/installController.js +146 -0
  292. package/dist/shell/installController.js.map +1 -0
  293. package/dist/shell/installerMessages.d.ts +30 -0
  294. package/dist/shell/installerMessages.js +36 -0
  295. package/dist/shell/installerMessages.js.map +1 -0
  296. package/dist/shell/linkDrop.js.map +1 -1
  297. package/dist/shell/messages.d.ts +16 -0
  298. package/dist/shell/messages.js +27 -0
  299. package/dist/shell/messages.js.map +1 -0
  300. package/dist/shell/palette.js.map +1 -1
  301. package/dist/shell/paneModel.d.ts +22 -0
  302. package/dist/shell/paneModel.js +24 -1
  303. package/dist/shell/paneModel.js.map +1 -1
  304. package/dist/shell/panel/Appearance.d.ts +8 -0
  305. package/dist/shell/panel/Appearance.js +256 -0
  306. package/dist/shell/panel/Appearance.js.map +1 -0
  307. package/dist/shell/panel/BackupPanel.d.ts +5 -0
  308. package/dist/shell/panel/BackupPanel.js +198 -0
  309. package/dist/shell/panel/BackupPanel.js.map +1 -0
  310. package/dist/shell/panel/DeveloperPanel.d.ts +4 -0
  311. package/dist/shell/panel/DeveloperPanel.js +51 -0
  312. package/dist/shell/panel/DeveloperPanel.js.map +1 -0
  313. package/dist/shell/panel/FeatureToggles.d.ts +13 -0
  314. package/dist/shell/panel/FeatureToggles.js +42 -0
  315. package/dist/shell/panel/FeatureToggles.js.map +1 -0
  316. package/dist/shell/panel/Home.d.ts +3 -0
  317. package/dist/shell/panel/Home.js +23 -0
  318. package/dist/shell/panel/Home.js.map +1 -0
  319. package/dist/shell/panel/IconPackInstall.d.ts +15 -0
  320. package/dist/shell/panel/IconPackInstall.js +41 -0
  321. package/dist/shell/panel/IconPackInstall.js.map +1 -0
  322. package/dist/shell/panel/LanguageSettings.d.ts +1 -0
  323. package/dist/shell/panel/LanguageSettings.js +54 -0
  324. package/dist/shell/panel/LanguageSettings.js.map +1 -0
  325. package/dist/shell/panel/MakePanel.d.ts +3 -0
  326. package/dist/shell/panel/MakePanel.js +237 -0
  327. package/dist/shell/panel/MakePanel.js.map +1 -0
  328. package/dist/shell/panel/MarkdownDoc.d.ts +6 -0
  329. package/dist/shell/panel/MarkdownDoc.js +35 -0
  330. package/dist/shell/panel/MarkdownDoc.js.map +1 -0
  331. package/dist/shell/panel/Modes.d.ts +40 -0
  332. package/dist/shell/panel/Modes.js +270 -0
  333. package/dist/shell/panel/Modes.js.map +1 -0
  334. package/dist/shell/panel/NavIcon.d.ts +4 -0
  335. package/dist/shell/panel/NavIcon.js +6 -0
  336. package/dist/shell/panel/NavIcon.js.map +1 -0
  337. package/dist/shell/panel/Panel.d.ts +7 -0
  338. package/dist/shell/panel/Panel.js +139 -0
  339. package/dist/shell/panel/Panel.js.map +1 -0
  340. package/dist/shell/panel/PluginFeatures.d.ts +24 -0
  341. package/dist/shell/panel/PluginFeatures.js +165 -0
  342. package/dist/shell/panel/PluginFeatures.js.map +1 -0
  343. package/dist/shell/panel/Plugins.d.ts +33 -0
  344. package/dist/shell/panel/Plugins.js +112 -0
  345. package/dist/shell/panel/Plugins.js.map +1 -0
  346. package/dist/shell/panel/PowerSettings.d.ts +4 -0
  347. package/dist/shell/panel/PowerSettings.js +52 -0
  348. package/dist/shell/panel/PowerSettings.js.map +1 -0
  349. package/dist/shell/panel/Settings.d.ts +23 -0
  350. package/dist/shell/panel/Settings.js +116 -0
  351. package/dist/shell/panel/Settings.js.map +1 -0
  352. package/dist/shell/panel/ShareSetup.d.ts +8 -0
  353. package/dist/shell/panel/ShareSetup.js +130 -0
  354. package/dist/shell/panel/ShareSetup.js.map +1 -0
  355. package/dist/shell/panel/StoreSection.d.ts +6 -0
  356. package/dist/shell/panel/StoreSection.js +48 -0
  357. package/dist/shell/panel/StoreSection.js.map +1 -0
  358. package/dist/shell/panel/StringPacks.d.ts +11 -0
  359. package/dist/shell/panel/StringPacks.js +106 -0
  360. package/dist/shell/panel/StringPacks.js.map +1 -0
  361. package/dist/shell/panel/ThemeBuilder.d.ts +5 -0
  362. package/dist/shell/panel/ThemeBuilder.js +205 -0
  363. package/dist/shell/panel/ThemeBuilder.js.map +1 -0
  364. package/dist/shell/panel/backup.css +34 -0
  365. package/dist/shell/panel/builder.css +232 -0
  366. package/dist/shell/panel/builderModel.d.ts +55 -0
  367. package/dist/shell/panel/builderModel.js +95 -0
  368. package/dist/shell/panel/builderModel.js.map +1 -0
  369. package/dist/shell/panel/compare.d.ts +10 -0
  370. package/dist/shell/panel/compare.js +51 -0
  371. package/dist/shell/panel/compare.js.map +1 -0
  372. package/dist/shell/panel/controls.d.ts +135 -0
  373. package/dist/shell/panel/controls.js +213 -0
  374. package/dist/shell/panel/controls.js.map +1 -0
  375. package/dist/shell/panel/featureModel.d.ts +69 -0
  376. package/dist/shell/panel/featureModel.js +79 -0
  377. package/dist/shell/panel/featureModel.js.map +1 -0
  378. package/dist/shell/panel/fonts/FontBrowser.d.ts +10 -0
  379. package/dist/shell/panel/fonts/FontBrowser.js +189 -0
  380. package/dist/shell/panel/fonts/FontBrowser.js.map +1 -0
  381. package/dist/shell/panel/fonts/FontRoles.d.ts +20 -0
  382. package/dist/shell/panel/fonts/FontRoles.js +77 -0
  383. package/dist/shell/panel/fonts/FontRoles.js.map +1 -0
  384. package/dist/shell/panel/fonts/catalog.d.ts +37 -0
  385. package/dist/shell/panel/fonts/catalog.js +68 -0
  386. package/dist/shell/panel/fonts/catalog.js.map +1 -0
  387. package/dist/shell/panel/fonts/googleFontsCatalog.json +1 -0
  388. package/dist/shell/panel/index.d.ts +20 -0
  389. package/dist/shell/panel/index.js +34 -0
  390. package/dist/shell/panel/index.js.map +1 -0
  391. package/dist/shell/panel/languageModel.d.ts +5 -0
  392. package/dist/shell/panel/languageModel.js +7 -0
  393. package/dist/shell/panel/languageModel.js.map +1 -0
  394. package/dist/shell/panel/make.css +72 -0
  395. package/dist/shell/panel/makeModel.d.ts +32 -0
  396. package/dist/shell/panel/makeModel.js +84 -0
  397. package/dist/shell/panel/makeModel.js.map +1 -0
  398. package/dist/shell/panel/markdown.d.ts +46 -0
  399. package/dist/shell/panel/markdown.js +100 -0
  400. package/dist/shell/panel/markdown.js.map +1 -0
  401. package/dist/shell/panel/nav.d.ts +12 -0
  402. package/dist/shell/panel/nav.js +50 -0
  403. package/dist/shell/panel/nav.js.map +1 -0
  404. package/dist/shell/panel/panel.css +401 -0
  405. package/dist/shell/panel/panelMessages.d.ts +763 -0
  406. package/dist/shell/panel/panelMessages.js +767 -0
  407. package/dist/shell/panel/panelMessages.js.map +1 -0
  408. package/dist/shell/panel/plugins.css +59 -0
  409. package/dist/shell/panel/setupModel.d.ts +87 -0
  410. package/dist/shell/panel/setupModel.js +152 -0
  411. package/dist/shell/panel/setupModel.js.map +1 -0
  412. package/dist/shell/panel/site.d.ts +259 -0
  413. package/dist/shell/panel/site.js +25 -0
  414. package/dist/shell/panel/site.js.map +1 -0
  415. package/dist/shell/panel/strings.css +7 -0
  416. package/dist/shell/panel/themes.d.ts +10 -0
  417. package/dist/shell/panel/themes.js +8 -0
  418. package/dist/shell/panel/themes.js.map +1 -0
  419. package/dist/shell/profileModel.d.ts +3 -2
  420. package/dist/shell/profileModel.js +7 -5
  421. package/dist/shell/profileModel.js.map +1 -1
  422. package/dist/shell/store.css +230 -0
  423. package/dist/shell/storeMessages.d.ts +169 -0
  424. package/dist/shell/storeMessages.js +172 -0
  425. package/dist/shell/storeMessages.js.map +1 -0
  426. package/dist/shell/storeModel.d.ts +181 -0
  427. package/dist/shell/storeModel.js +133 -0
  428. package/dist/shell/storeModel.js.map +1 -0
  429. package/dist/shell/stringPacksModel.d.ts +44 -0
  430. package/dist/shell/stringPacksModel.js +94 -0
  431. package/dist/shell/stringPacksModel.js.map +1 -0
  432. package/dist/shell/updateModel.d.ts +2 -1
  433. package/dist/shell/updateModel.js +5 -4
  434. package/dist/shell/updateModel.js.map +1 -1
  435. package/dist/shell/windowControls.d.ts +4 -0
  436. package/dist/shell/windowControls.js +5 -0
  437. package/dist/shell/windowControls.js.map +1 -1
  438. package/i18n-config.schema.json +29 -0
  439. package/i18n-meta.schema.json +26 -0
  440. package/i18n.schema.json +42 -0
  441. package/icons.schema.json +646 -0
  442. package/languages.schema.json +23 -0
  443. package/locales/ar-x-fm.json +11 -0
  444. package/locales/ar.json +1281 -0
  445. package/locales/bg.json +1280 -0
  446. package/locales/bn.json +1280 -0
  447. package/locales/ca.json +1280 -0
  448. package/locales/cs.json +1280 -0
  449. package/locales/da.json +1280 -0
  450. package/locales/de.json +1280 -0
  451. package/locales/el.json +1280 -0
  452. package/locales/en-GB.json +27 -0
  453. package/locales/en.json +1280 -0
  454. package/locales/en.meta.json +51 -0
  455. package/locales/es.json +1280 -0
  456. package/locales/eu.json +1280 -0
  457. package/locales/fa.json +1281 -0
  458. package/locales/fi.json +1280 -0
  459. package/locales/fil.json +1280 -0
  460. package/locales/fr.json +1280 -0
  461. package/locales/ga.json +1280 -0
  462. package/locales/gl.json +1280 -0
  463. package/locales/gu.json +1280 -0
  464. package/locales/ha.json +1280 -0
  465. package/locales/he.json +1281 -0
  466. package/locales/hi.json +1280 -0
  467. package/locales/hr.json +1280 -0
  468. package/locales/hu.json +1279 -0
  469. package/locales/id.json +1280 -0
  470. package/locales/ig.json +1280 -0
  471. package/locales/it.json +1280 -0
  472. package/locales/ja.json +1280 -0
  473. package/locales/kn.json +1280 -0
  474. package/locales/ko.json +1280 -0
  475. package/locales/mr.json +1280 -0
  476. package/locales/ms.json +1280 -0
  477. package/locales/nb.json +1280 -0
  478. package/locales/nl.json +1280 -0
  479. package/locales/pl.json +1280 -0
  480. package/locales/pt.json +1280 -0
  481. package/locales/ro.json +1280 -0
  482. package/locales/ru.json +1280 -0
  483. package/locales/sk.json +1280 -0
  484. package/locales/sr.json +1280 -0
  485. package/locales/sv.json +1280 -0
  486. package/locales/ta.json +1280 -0
  487. package/locales/th.json +1280 -0
  488. package/locales/tr.json +1280 -0
  489. package/locales/uk.json +1280 -0
  490. package/locales/ur.json +1281 -0
  491. package/locales/vi.json +1280 -0
  492. package/locales/yo.json +1280 -0
  493. package/locales/zh-Hans.json +1280 -0
  494. package/locales/zh-Hant.json +1280 -0
  495. package/package.json +139 -5
  496. package/store-catalog.schema.json +65 -0
  497. package/theme.schema.json +4659 -0
  498. package/windows/installer.nsi +926 -0
  499. package/windows/languages/Basque.nsh +28 -0
  500. package/windows/languages/Catalan.nsh +28 -0
  501. package/windows/languages/Croatian.nsh +28 -0
  502. package/windows/languages/Czech.nsh +28 -0
  503. package/windows/languages/Danish.nsh +28 -0
  504. package/windows/languages/Finnish.nsh +28 -0
  505. package/windows/languages/Galician.nsh +28 -0
  506. package/windows/languages/Greek.nsh +28 -0
  507. package/windows/languages/Hungarian.nsh +28 -0
  508. package/windows/languages/Indonesian.nsh +28 -0
  509. package/windows/languages/Irish.nsh +28 -0
  510. package/windows/languages/Malay.nsh +28 -0
  511. package/windows/languages/Polish.nsh +28 -0
  512. package/windows/languages/Romanian.nsh +28 -0
  513. package/windows/languages/Serbian.nsh +28 -0
  514. package/windows/languages/Slovak.nsh +28 -0
  515. package/windows/languages/Thai.nsh +28 -0
@@ -0,0 +1,54 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Settings → Language: follow the site, follow the system, or pick one of the languages the app has
3
+ // a catalog for (`PanelSite.languages`, the app's frame/language.ts state). Supported languages come
4
+ // first, community translations (machine drafts nobody has reviewed) in a group below; the two
5
+ // automatic choices only pick supported ones, so a community language the site or system uses is
6
+ // offered as a one-click switch. Machine-drafted translations link to the app's contributor guide.
7
+ import { useMemo, useSyncExternalStore } from 'react';
8
+ import { invoke } from "../frame/bridge.js";
9
+ import { useT } from "../frame/hooks.js";
10
+ import { formatNumber } from "../frame/i18n.js";
11
+ import { Badge, Row, Section, Select } from "./controls.js";
12
+ import { groupLanguages } from "./languageModel.js";
13
+ import { panelSite } from "./site.js";
14
+ /** The language state as a store for React (the snapshot only changes when the state does). */
15
+ function languageStore(languages) {
16
+ let cached = languages.state();
17
+ const snapshot = () => {
18
+ const next = languages.state();
19
+ if (next.preference !== cached.preference || next.siteLang !== cached.siteLang || next.locale !== cached.locale || next.system !== cached.system || next.community !== cached.community)
20
+ cached = next;
21
+ return cached;
22
+ };
23
+ return { subscribe: (listener) => languages.subscribe(listener), snapshot };
24
+ }
25
+ export function LanguageSettings() {
26
+ const t = useT();
27
+ const languages = panelSite().languages;
28
+ const LANGUAGES = languages.list;
29
+ const store = useMemo(() => languageStore(languages), [languages]);
30
+ const current = useSyncExternalStore(store.subscribe, store.snapshot, store.snapshot);
31
+ const active = LANGUAGES.find(language => language.code === current.locale);
32
+ const { supported, community } = groupLanguages(LANGUAGES);
33
+ const siteLanguage = current.siteLang ? LANGUAGES.find(language => language.code === current.siteLang) : null;
34
+ const options = [
35
+ { value: 'site', label: t('wb.settings.language.followSite'), hint: siteLanguage ? t('wb.settings.language.followSiteNow', { language: siteLanguage.name }) : t('wb.settings.language.followSiteHint') },
36
+ { value: 'system', label: t('wb.settings.language.followSystem'), hint: t('wb.settings.language.followSystemHint') },
37
+ ...[...supported, ...community].map(language => ({
38
+ value: language.code,
39
+ label: language.name,
40
+ hint: language.name === language.englishName ? undefined : language.englishName,
41
+ style: { direction: language.dir },
42
+ group: community.length ? (language.tier === 'community' ? t('wb.settings.language.groupCommunity') : t('wb.settings.language.groupSupported')) : undefined,
43
+ })),
44
+ ];
45
+ const suggested = current.community ? LANGUAGES.find(language => language.code === current.community) : null;
46
+ const guide = languages.translateUrl;
47
+ const open = () => { if (guide)
48
+ invoke('open_external_url', { url: guide }).catch(() => window.open(guide, '_blank', 'noopener')); };
49
+ const machine = active && active.status === 'machine';
50
+ return _jsxs(Section, { title: t('wb.settings.language.title'), id: "language", hint: t('wb.settings.language.hint'), children: [_jsx(Row, { label: t('wb.settings.language.label'), keywords: t('wb.settings.language.keywords'), hint: active ? t('wb.settings.language.active', { language: active.name }) : undefined, badge: machine ? _jsx(Badge, { tone: "warn", children: t('wb.settings.language.machine') }) : active?.status === 'reviewed' ? _jsx(Badge, { tone: "ok", children: t('wb.settings.language.reviewed') }) : undefined, children: _jsx(Select, { label: t('wb.settings.language.label'), value: current.preference, options: options, width: 240, onChange: value => { void languages.set(value); } }) }), suggested && _jsx(Row, { label: t('wb.settings.language.communityAvailable', { language: suggested.name }), keywords: "community translation machine", children: _jsx("button", { type: "button", className: "bt-btn is-plain is-sm", onClick: () => { void languages.set(suggested.code); }, children: t('wb.settings.language.communitySwitch') }) }), guide && active && active.code !== 'en' && _jsx(Row, { label: t('wb.settings.language.helpTitle'), keywords: "translate translation crowdin contribute", hint: machine
51
+ ? t('wb.settings.language.helpMachine', { language: active.name })
52
+ : t('wb.settings.language.helpReviewed', { language: active.name, percent: formatNumber(active.coverage, { style: 'percent', maximumFractionDigits: 0 }) }), children: _jsx("button", { type: "button", className: "bt-btn is-plain is-sm", onClick: open, children: t('wb.settings.language.help') }) })] });
53
+ }
54
+ //# sourceMappingURL=LanguageSettings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LanguageSettings.js","sourceRoot":"","sources":["../../../../../../shell/src/panel/LanguageSettings.tsx"],"names":[],"mappings":";AAAA,oGAAoG;AACpG,qGAAqG;AACrG,+FAA+F;AAC/F,iGAAiG;AACjG,mGAAmG;AACnG,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAe,MAAM,eAAgB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAuB,MAAM,WAAW,CAAC;AAE3D,+FAA+F;AAC/F,SAAS,aAAa,CAAC,SAAyB;IAC9C,IAAI,MAAM,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC;IAC/B,MAAM,QAAQ,GAAG,GAAG,EAAE;QACpB,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC;QAC/B,IAAI,IAAI,CAAC,UAAU,KAAK,MAAM,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,KAAK,MAAM,CAAC,SAAS;YAAE,MAAM,GAAG,IAAI,CAAC;QACvM,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;IACF,OAAO,EAAE,SAAS,EAAE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C,IAAI,CAAC,CAAC,CAAC,CAAC,YAAG,CAAC,CAAC,sCAAsC,CAAC,GAAU,GAChK,EACL,KAAK,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,IAAI,KAAC,GAAG,IAAC,KAAK,EAAE,CAAC,CAAC,gCAAgC,CAAC,EAAE,QAAQ,EAAC,0CAA0C,EAC9I,IAAI,EAAE,OAAO;oBACX,CAAC,CAAC,CAAC,CAAC,kCAAkC,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;oBAClE,CAAC,CAAC,CAAC,CAAC,mCAAmC,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,YAC7J,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,uBAAuB,EAAC,OAAO,EAAE,IAAI,YAAG,CAAC,CAAC,2BAA2B,CAAC,GAAU,GAC5G,IACE,CAAC;AACb,CAAC","sourcesContent":["// Settings → Language: follow the site, follow the system, or pick one of the languages the app has\n// a catalog for (`PanelSite.languages`, the app's frame/language.ts state). Supported languages come\n// first, community translations (machine drafts nobody has reviewed) in a group below; the two\n// automatic choices only pick supported ones, so a community language the site or system uses is\n// offered as a one-click switch. Machine-drafted translations link to the app's contributor guide.\nimport { useMemo, useSyncExternalStore } from 'react';\nimport { invoke } from '../frame/bridge.ts';\nimport { useT } from '../frame/hooks.ts';\nimport { formatNumber } from '../frame/i18n.ts';\nimport type { LanguagePreference } from '../frame/language.ts';\nimport { Badge, Row, Section, Select, type Option } from './controls.tsx';\nimport { groupLanguages } from './languageModel.ts';\nimport { panelSite, type PanelLanguages } from './site.ts';\n\n/** The language state as a store for React (the snapshot only changes when the state does). */\nfunction languageStore(languages: PanelLanguages) {\n let cached = languages.state();\n const snapshot = () => {\n const next = languages.state();\n if (next.preference !== cached.preference || next.siteLang !== cached.siteLang || next.locale !== cached.locale || next.system !== cached.system || next.community !== cached.community) cached = next;\n return cached;\n };\n return { subscribe: (listener: () => void) => languages.subscribe(listener), snapshot };\n}\n\nexport function LanguageSettings() {\n const t = useT();\n const languages = panelSite().languages!;\n const LANGUAGES = languages.list;\n const store = useMemo(() => languageStore(languages), [languages]);\n const current = useSyncExternalStore(store.subscribe, store.snapshot, store.snapshot);\n const active = LANGUAGES.find(language => language.code === current.locale);\n const { supported, community } = groupLanguages(LANGUAGES);\n const siteLanguage = current.siteLang ? LANGUAGES.find(language => language.code === current.siteLang) : null;\n const options: Array<Option<LanguagePreference>> = [\n { value: 'site', label: t('wb.settings.language.followSite'), hint: siteLanguage ? t('wb.settings.language.followSiteNow', { language: siteLanguage.name }) : t('wb.settings.language.followSiteHint') },\n { value: 'system', label: t('wb.settings.language.followSystem'), hint: t('wb.settings.language.followSystemHint') },\n ...[...supported, ...community].map(language => ({\n value: language.code,\n label: language.name,\n hint: language.name === language.englishName ? undefined : language.englishName,\n style: { direction: language.dir },\n group: community.length ? (language.tier === 'community' ? t('wb.settings.language.groupCommunity') : t('wb.settings.language.groupSupported')) : undefined,\n })),\n ];\n const suggested = current.community ? LANGUAGES.find(language => language.code === current.community) : null;\n const guide = languages.translateUrl;\n const open = () => { if (guide) invoke('open_external_url', { url: guide }).catch(() => window.open(guide, '_blank', 'noopener')); };\n const machine = active && active.status === 'machine';\n return <Section title={t('wb.settings.language.title')} id=\"language\" hint={t('wb.settings.language.hint')}>\n <Row label={t('wb.settings.language.label')} keywords={t('wb.settings.language.keywords')}\n hint={active ? t('wb.settings.language.active', { language: active.name }) : undefined}\n badge={machine ? <Badge tone=\"warn\">{t('wb.settings.language.machine')}</Badge> : active?.status === 'reviewed' ? <Badge tone=\"ok\">{t('wb.settings.language.reviewed')}</Badge> : undefined}>\n <Select label={t('wb.settings.language.label')} value={current.preference} options={options} width={240}\n onChange={value => { void languages.set(value); }}/>\n </Row>\n {suggested && <Row label={t('wb.settings.language.communityAvailable', { language: suggested.name })} keywords=\"community translation machine\">\n <button type=\"button\" className=\"bt-btn is-plain is-sm\" onClick={() => { void languages.set(suggested.code); }}>{t('wb.settings.language.communitySwitch')}</button>\n </Row>}\n {guide && active && active.code !== 'en' && <Row label={t('wb.settings.language.helpTitle')} keywords=\"translate translation crowdin contribute\"\n hint={machine\n ? t('wb.settings.language.helpMachine', { language: active.name })\n : t('wb.settings.language.helpReviewed', { language: active.name, percent: formatNumber(active.coverage, { style: 'percent', maximumFractionDigits: 0 }) })}>\n <button type=\"button\" className=\"bt-btn is-plain is-sm\" onClick={open}>{t('wb.settings.language.help')}</button>\n </Row>}\n </Section>;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import { type SectionProps } from './site.ts';
2
+ import './make.css';
3
+ export declare function MakePanel({ notify, openSection }: SectionProps): import("react").JSX.Element;
@@ -0,0 +1,237 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ // "Make": build a plugin or theme from inside the app. Example plugins in an editor that checks
3
+ // the header the way the Plugins list reads it (Copy / Download / Open plugins folder: plugins are
4
+ // installed only by copying a file into the folder, never by the app), a gallery that opens the
5
+ // real plugin UI kit in the current theme, a live view of the theme API (`api.theme.current()`
6
+ // and the `--wb-*` variables) and the app's bundled docs. The examples, the theme file and the
7
+ // docs are the app's (`PanelSite.make`). Everything is local.
8
+ import { useEffect, useMemo, useRef, useState } from 'react';
9
+ import { createThemeApi, themeVars } from "../../runtime/themeApi.js";
10
+ import { createUiKit } from "../../runtime/ui.js";
11
+ import { invoke } from "../frame/bridge.js";
12
+ import { useT } from "../frame/hooks.js";
13
+ import { t, tx } from "../frame/i18n.js";
14
+ import { setOverlay } from "../frame/state.js";
15
+ import { Button, Section, Segmented } from "./controls.js";
16
+ import { CREATE_COMMANDS, KIT_DEMOS, cssVarOf, parsePluginHeader, pluginWarnings, validPluginFileName } from "./makeModel.js";
17
+ import { MarkdownDoc } from "./MarkdownDoc.js";
18
+ import { panelSite } from "./site.js";
19
+ import './make.css';
20
+ /** The docs the intro line links to, when the app bundles them. */
21
+ const REFERENCE_DOCS = ['PLUGINS.md', 'THEMES.md'];
22
+ const make = () => panelSite().make;
23
+ const runtimeGlobal = () => make().global ?? 'wayBetter';
24
+ const getError = (error) => error instanceof Error ? error.message : String(error);
25
+ function copy(text, notify, what = t('wb.common.copied')) {
26
+ navigator.clipboard.writeText(text).then(() => notify(what), () => notify(t('wb.common.clipboardUnavailable'), true));
27
+ }
28
+ /** Saves `text` through the webview's ordinary download (the Downloads folder). */
29
+ function download(file, text, type) {
30
+ const url = URL.createObjectURL(new Blob([text], { type }));
31
+ const anchor = document.createElement('a');
32
+ anchor.href = url;
33
+ anchor.download = file;
34
+ anchor.click();
35
+ setTimeout(() => URL.revokeObjectURL(url), 1000);
36
+ }
37
+ /** The persisted theme choice, re-read while the section is open so the explorer stays live. */
38
+ function useThemeChoice() {
39
+ const [choice, setChoice] = useState(null);
40
+ useEffect(() => {
41
+ const themes = panelSite().themes;
42
+ if (!themes)
43
+ return;
44
+ let alive = true;
45
+ let last = '';
46
+ const load = () => themes.store.adapter.load().then(value => {
47
+ const key = JSON.stringify(value);
48
+ if (alive && key !== last) {
49
+ last = key;
50
+ setChoice(value);
51
+ }
52
+ }).catch(() => { if (alive && !last)
53
+ setChoice(themes.catalog.defaultChoice); });
54
+ void load();
55
+ const timer = setInterval(load, 1500);
56
+ window.addEventListener('focus', load);
57
+ return () => { alive = false; clearInterval(timer); window.removeEventListener('focus', load); };
58
+ }, []);
59
+ return choice;
60
+ }
61
+ export function MakePanel({ notify, openSection }) {
62
+ const t = useT();
63
+ const themes = panelSite().themes;
64
+ const docs = make().docs ?? {};
65
+ const docNames = Object.keys(docs);
66
+ const reference = REFERENCE_DOCS.filter(name => name in docs);
67
+ const [tab, setTab] = useState('plugin');
68
+ const [doc, setDoc] = useState(docNames[0] ?? '');
69
+ const [mode, setMode] = useState(themes?.modes?.initial ?? 'dark');
70
+ const choice = useThemeChoice();
71
+ const resolved = useMemo(() => choice && themes?.resolved ? themes.resolved(choice, mode) : null, [choice, mode]);
72
+ const readDoc = (name) => { setDoc(name); setTab('docs'); };
73
+ return _jsxs("div", { className: "bmk", children: [_jsxs("section", { className: "bmk-intro", children: [_jsx("p", { children: t('wb.make.intro') }), _jsx("ul", { className: "bmk-commands", children: CREATE_COMMANDS.map(item => _jsxs("li", { children: [_jsx("span", { children: item.label }), _jsx("code", { children: item.command }), _jsx(Button, { size: "sm", tone: "ghost", label: t('wb.make.copyCommand', { command: item.command }), onClick: () => copy(item.command, notify), children: t('wb.common.copy') })] }, item.command)) }), reference.length > 0 && _jsxs("p", { className: "bmk-muted", children: [t('wb.make.reference'), " ", reference.map((name, index) => _jsxs("span", { children: [index > 0 && _jsxs(_Fragment, { children: [" \u00B7", ' '] }), _jsx("button", { type: "button", className: "bmk-doc-link", onClick: () => readDoc(name), children: name })] }, name)), " ", t('wb.make.referenceBundled')] })] }), _jsx("div", { className: "bmk-tabs", children: _jsx(Segmented, { label: t('wb.panel.section.make'), value: tab, onChange: setTab, options: [
74
+ { value: 'plugin', label: t('wb.store.plugin') }, { value: 'kit', label: t('wb.make.tab.kit') },
75
+ ...(themes?.resolved ? [{ value: 'theme', label: t('wb.make.tab.theme') }] : []),
76
+ ...(docNames.length ? [{ value: 'docs', label: t('wb.make.tab.docs') }] : []),
77
+ ] }) }), tab === 'plugin' && _jsx(PluginWorkbench, { notify: notify, openSection: openSection }), tab === 'kit' && _jsx(KitGallery, { resolved: resolved, notify: notify }), tab === 'theme' && _jsx(ThemeExplorer, { choice: choice, resolved: resolved, mode: mode, setMode: setMode, notify: notify, openSection: openSection }), tab === 'docs' && _jsx(Docs, { docs: docs, doc: doc, setDoc: setDoc, notify: notify })] });
78
+ }
79
+ // ---------------------------------------------------------------------------------------------
80
+ // Plugin examples
81
+ function PluginWorkbench({ notify, openSection }) {
82
+ const t = useT();
83
+ const PLUGIN_EXAMPLES = make().examples;
84
+ const [exampleId, setExampleId] = useState(PLUGIN_EXAMPLES[0]?.id ?? '');
85
+ const [edits, setEdits] = useState({});
86
+ const [names, setNames] = useState({});
87
+ const example = PLUGIN_EXAMPLES.find(item => item.id === exampleId) ?? PLUGIN_EXAMPLES[0];
88
+ if (!example)
89
+ return null;
90
+ const source = edits[example.id] ?? example.source;
91
+ const file = names[example.id] ?? example.file;
92
+ const meta = parsePluginHeader(file, source);
93
+ const warnings = pluginWarnings(meta, source);
94
+ const fileOk = validPluginFileName(file);
95
+ const edited = source !== example.source;
96
+ return _jsxs(_Fragment, { children: [_jsx(Section, { title: t('wb.make.examples'), hint: t('wb.make.examplesHint'), children: _jsx("div", { className: "bmk-examples", role: "tablist", "aria-label": t('wb.make.examples'), children: PLUGIN_EXAMPLES.map(item => _jsxs("button", { type: "button", role: "tab", "aria-selected": item.id === example.id, className: `bmk-example ${item.id === example.id ? 'is-on' : ''}`, onClick: () => setExampleId(item.id), children: [_jsx("strong", { children: item.title }), _jsx("span", { children: item.blurb })] }, item.id)) }) }), _jsxs(Section, { title: meta.name, hint: _jsxs(_Fragment, { children: [t('wb.make.pluginsList'), " ", _jsx("b", { children: meta.name }), meta.version && ` ${meta.version}`, meta.author && ` · ${meta.author}`, meta.description && ` — ${meta.description}`] }), action: edited ? _jsx(Button, { size: "sm", tone: "ghost", onClick: () => setEdits(current => { const next = { ...current }; delete next[example.id]; return next; }), children: t('wb.common.reset') }) : undefined, children: [_jsxs("div", { className: "bt-code bmk-editor", children: [_jsx("textarea", { "aria-label": t('wb.make.source', { file }), spellCheck: false, value: source, rows: Math.min(28, source.split('\n').length + 1), onChange: event => setEdits(current => ({ ...current, [example.id]: event.target.value })) }), _jsxs("div", { className: "bt-code-bar", children: [_jsxs("label", { className: "bmk-file", children: [_jsx("span", { children: t('wb.make.file') }), _jsx("input", { className: "bt-input", "aria-label": t('wb.make.fileName'), spellCheck: false, value: file, "aria-invalid": !fileOk, onChange: event => setNames(current => ({ ...current, [example.id]: event.target.value.trim() })) })] }), _jsx(Button, { size: "sm", onClick: () => copy(source, notify, t('wb.make.pluginCopied')), children: t('wb.common.copy') }), _jsx(Button, { size: "sm", disabled: !fileOk, onClick: () => { download(file, source, 'text/javascript'); notify(t('wb.make.savedDownloads', { file })); }, children: t('wb.panel.updates.download') }), _jsx(Button, { size: "sm", tone: "primary", onClick: () => void invoke('plugins_open_folder').catch(error => notify(getError(error), true)), children: t('wb.make.openPluginsFolder') })] })] }), (warnings.length > 0 || !fileOk) && _jsxs("ul", { className: "bmk-warnings", role: "status", children: [!fileOk && _jsx("li", { children: t('wb.make.fileRule') }), warnings.map(warning => _jsx("li", { children: warning }, warning))] }), _jsxs("ol", { className: "bmk-steps", children: [_jsx("li", { children: t('wb.make.step1', { file: fileOk ? file : 'name.plugin.js' }) }), _jsxs("li", { children: [t('wb.make.step2Before'), " ", _jsx("button", { type: "button", className: "bmk-doc-link", onClick: () => openSection?.('plugins'), children: t('wb.panel.section.plugins') }), t('wb.make.step2After')] }), _jsx("li", { children: t('wb.make.step3') })] })] })] });
97
+ }
98
+ // ---------------------------------------------------------------------------------------------
99
+ // UI kit gallery: the real kit, drawn in this window with the current theme.
100
+ function KitGallery({ resolved, notify }) {
101
+ const t = useT();
102
+ const latest = useRef(resolved);
103
+ const listeners = useRef(new Set());
104
+ const kit = useRef(null);
105
+ const [result, setResult] = useState(null);
106
+ useEffect(() => {
107
+ latest.current = resolved;
108
+ for (const listener of [...listeners.current])
109
+ listener();
110
+ }, [resolved]);
111
+ useEffect(() => {
112
+ const source = {
113
+ current: () => latest.current,
114
+ onChange: listener => { listeners.current.add(listener); return () => { listeners.current.delete(listener); }; },
115
+ };
116
+ const root = createUiKit(window, { theme: createThemeApi(window, source), product: panelSite().brand.name, hostId: 'wb-make-ui', text: key => tx(key, undefined, '') || undefined });
117
+ kit.current = root.scoped();
118
+ // Leaving the section closes whatever the gallery opened.
119
+ return () => { kit.current?.dispose(); kit.current = null; };
120
+ }, []);
121
+ /**
122
+ * Tab webviews are native and sit above this page. A dialog is a shell overlay (the shell rises
123
+ * above the panes); a toast needs none: its layer is pinned to this panel, like `.btp-toast`.
124
+ */
125
+ async function show(demo) {
126
+ const ui = kit.current?.kit;
127
+ if (!ui)
128
+ return;
129
+ const h = ui.h;
130
+ const toast = demo.kind === 'toast';
131
+ const panel = document.querySelector('.bmk-kit')?.closest('.bt-panel')?.getBoundingClientRect();
132
+ // The kit adds its host on demand: place it once the demo below has (same task, before paint).
133
+ // A transformed host is the containing block of the kit's fixed layers.
134
+ queueMicrotask(() => {
135
+ const host = document.getElementById('wb-make-ui');
136
+ if (host)
137
+ Object.assign(host.style, toast && panel
138
+ ? { inset: 'auto', left: `${panel.left}px`, top: `${panel.top}px`, width: `${panel.width}px`, height: `${panel.height}px`, transform: 'translateZ(0)' }
139
+ : { inset: '0', left: '', top: '', width: '', height: '', transform: '' });
140
+ });
141
+ if (!toast)
142
+ setOverlay(1);
143
+ try {
144
+ let value;
145
+ switch (demo.id) {
146
+ case 'toast':
147
+ await ui.toast(t('wb.make.demo.linkCopied')).closed;
148
+ break;
149
+ case 'toast-success':
150
+ await ui.toast(t('wb.make.demo.saved'), { tone: 'success' }).closed;
151
+ break;
152
+ case 'toast-action':
153
+ await ui.toast(t('wb.make.demo.postHidden'), { tone: 'warning', action: { label: t('wb.make.demo.undo'), onClick: () => setResult({ id: demo.id, text: t('wb.make.demo.undoClicked') }) } }).closed;
154
+ break;
155
+ case 'toast-danger':
156
+ await ui.toast(t('wb.make.demo.couldNotSave'), { tone: 'danger' }).closed;
157
+ break;
158
+ case 'alert':
159
+ value = await ui.alert({ title: t('wb.make.demo.exported'), message: t('wb.make.demo.exportedText'), tone: 'success' });
160
+ break;
161
+ case 'confirm':
162
+ value = await ui.confirm({ title: t('wb.make.demo.deleteNote'), message: t('wb.make.demo.cannotUndo'), danger: true });
163
+ break;
164
+ case 'prompt':
165
+ value = await ui.prompt({ title: t('wb.make.demo.renameList'), label: t('wb.make.demo.name'), value: t('wb.make.demo.reading'), validate: v => v.trim().length < 3 ? t('wb.make.demo.min3') : null });
166
+ break;
167
+ case 'dialog':
168
+ value = await ui.dialog({
169
+ title: t('wb.make.demo.myPlugin'), message: t('wb.make.demo.whatHidden'),
170
+ content: body => body.append(h('label', { class: 'wb-check' }, h('input', { type: 'checkbox' }), t('wb.make.demo.hideTrends'))),
171
+ actions: [{ label: t('wb.common.cancel') }, { label: t('wb.common.save'), tone: 'primary', default: true }],
172
+ }).closed;
173
+ break;
174
+ }
175
+ if (demo.kind !== 'toast')
176
+ setResult({ id: demo.id, text: `→ ${value === undefined ? 'undefined' : JSON.stringify(value)}` });
177
+ }
178
+ catch (error) {
179
+ notify(getError(error), true);
180
+ }
181
+ finally {
182
+ if (!toast)
183
+ setOverlay(-1);
184
+ }
185
+ }
186
+ return _jsx(Section, { title: t('wb.make.kitTitle'), hint: t('wb.make.kitHint'), children: _jsx("div", { className: "bmk-kit", children: KIT_DEMOS.map(demo => _jsxs("div", { className: "bmk-kit-row", children: [_jsx(Button, { size: "sm", tone: demo.kind === 'toast' ? 'plain' : 'primary', onClick: () => void show(demo), children: demo.label }), _jsx("code", { className: "bmk-kit-code", children: demo.code }), result?.id === demo.id && _jsx("span", { className: "bmk-kit-result", role: "status", children: result.text })] }, demo.id)) }) });
187
+ }
188
+ // ---------------------------------------------------------------------------------------------
189
+ // Theme API explorer
190
+ /** What each theme color is for: `make.role.<role>` in the catalogs. */
191
+ const roleHint = (role) => tx(`wb.make.role.${role}`, undefined, '');
192
+ function ThemeExplorer({ choice, resolved, mode, setMode, notify, openSection }) {
193
+ const t = useT();
194
+ const themes = panelSite().themes;
195
+ if (!themes || !choice || !resolved)
196
+ return _jsx("p", { className: "bmk-muted", children: t('wb.make.loadingTheme') });
197
+ const vars = themeVars(resolved);
198
+ const spec = themes.catalog.resolve(choice);
199
+ const modes = themes.modes;
200
+ const example = make().themeExample;
201
+ const global = runtimeGlobal();
202
+ // Font roles, when this build's runtime reports them (`fonts`), else the interface font only.
203
+ const roles = resolved.fonts;
204
+ const fontRows = roles && typeof roles === 'object'
205
+ ? Object.entries(roles).filter((entry) => typeof entry[1] === 'string')
206
+ : [['font', resolved.font]];
207
+ return _jsxs(_Fragment, { children: [_jsxs(Section, { title: `${resolved.name || resolved.id}`, hint: _jsxs(_Fragment, { children: [t('wb.make.liveBefore'), " ", _jsxs("code", { children: [global, ".api.theme.current()"] }), " ", t('wb.make.liveMiddle'), " ", _jsx("button", { type: "button", className: "bmk-doc-link", onClick: () => openSection?.('themes'), children: t('wb.panel.section.themes') }), " ", t('wb.make.liveAfter')] }), action: resolved.siteDefault && modes ? _jsx(Segmented, { size: "sm", label: modes.label(), value: mode, onChange: setMode, options: modes.options.map(option => ({ value: option.value, label: option.label() })) }) : undefined, children: [_jsxs("div", { className: "bmk-facts", children: [_jsxs("span", { children: [_jsx("b", { children: "id" }), " ", resolved.id] }), _jsxs("span", { children: [_jsx("b", { children: "mode" }), " ", resolved.mode] }), _jsxs("span", { children: [_jsx("b", { children: "siteDefault" }), " ", String(resolved.siteDefault)] }), _jsxs("span", { children: [_jsx("b", { children: "radius" }), " ", resolved.radius, "px"] }), _jsxs("span", { children: [_jsx("b", { children: "buttonRadius" }), " ", resolved.buttonRadius, "px"] })] }), _jsx("div", { className: "bmk-swatches", children: Object.keys(resolved.colors).map(role => {
208
+ const name = cssVarOf(role);
209
+ return _jsxs("button", { type: "button", className: "bmk-swatch", title: t('wb.make.copyVar', { name: `var(${name})` }), onClick: () => copy(`var(${name})`, notify, t('wb.make.copiedVar', { name: `var(${name})` })), children: [_jsx("span", { className: "bmk-chip", style: { background: resolved.colors[role] } }), _jsxs("span", { className: "bmk-swatch-text", children: [_jsx("b", { children: role }), _jsx("code", { children: name }), _jsxs("small", { children: [resolved.colors[role], " \u00B7 ", roleHint(role)] })] })] }, role);
210
+ }) })] }), _jsx(Section, { title: t('wb.appearance.fonts'), hint: t('wb.make.fontsHint'), children: _jsxs("div", { className: "bmk-fonts", children: [fontRows.map(([role, stack]) => _jsxs("div", { className: "bmk-font", children: [_jsxs("div", { children: [_jsx("b", { children: role }), _jsx("code", { children: stack })] }), _jsx("p", { style: { fontFamily: stack }, children: "The quick brown fox jumps over the lazy dog \u00B7 0123456789" })] }, role)), _jsxs("div", { className: "bmk-facts", children: [_jsxs("span", { children: [_jsx("b", { children: "scale" }), " ", spec.font.scale] }), _jsxs("span", { children: [_jsx("b", { children: "weight" }), " ", spec.font.weight] }), _jsxs("span", { children: [_jsx("b", { children: "bold" }), " ", spec.font.bold] }), _jsxs("span", { children: [_jsx("b", { children: "tracking" }), " ", spec.font.tracking, "em"] }), _jsxs("span", { children: [_jsx("b", { children: "leading" }), " ", spec.font.leading || t('wb.make.siteDefaultLeading')] })] })] }) }), _jsxs(Section, { title: t('wb.make.inCode'), hint: t('wb.make.inCodeHint'), children: [_jsx("pre", { className: "bt-snippet bmk-pre", children: `const theme = ${global}.api.theme.current();\nthis.scope.onThemeChange(theme => this.redraw(theme));\n\n// = ${JSON.stringify(resolved, null, 2).replace(/\n/g, '\n// ')}` }), _jsx("pre", { className: "bt-snippet bmk-pre", children: `:root {\n${Object.entries(vars).map(([key, value]) => ` ${key}: ${value};`).join('\n')}\n}` })] }), example && _jsxs(Section, { title: t('wb.make.themeFile'), hint: t('wb.make.themeFileHint'), children: [_jsx("pre", { className: "bt-snippet bmk-pre", children: example.source }), _jsxs("div", { className: "bmk-actions", children: [_jsx(Button, { size: "sm", onClick: () => copy(example.source, notify, t('wb.make.themeCopied')), children: t('wb.common.copy') }), _jsx(Button, { size: "sm", onClick: () => { download(example.file, example.source, 'application/json'); notify(t('wb.make.savedDownloads', { file: example.file })); }, children: t('wb.panel.updates.download') })] })] })] });
211
+ }
212
+ // ---------------------------------------------------------------------------------------------
213
+ // Bundled docs
214
+ function Docs({ docs, doc, setDoc, notify }) {
215
+ const t = useT();
216
+ const names = Object.keys(docs);
217
+ const source = docs[doc] ?? '';
218
+ const root = useRef(null);
219
+ const [anchor, setAnchor] = useState(null);
220
+ useEffect(() => {
221
+ if (anchor)
222
+ root.current?.querySelector(`#doc-${CSS.escape(anchor)}`)?.scrollIntoView({ block: 'start' });
223
+ else
224
+ root.current?.scrollIntoView({ block: 'start' });
225
+ }, [doc, anchor]);
226
+ const onLink = (link) => {
227
+ if (link.url) {
228
+ invoke('open_external_url', { url: link.url }).catch(error => notify(getError(error), true));
229
+ return;
230
+ }
231
+ if (link.doc && names.includes(link.doc))
232
+ setDoc(link.doc);
233
+ setAnchor(link.anchor ?? null);
234
+ };
235
+ return _jsxs("section", { className: "bmk-docs", ref: root, children: [_jsxs("div", { className: "bmk-actions", children: [_jsx(Segmented, { size: "sm", label: t('wb.make.document'), value: doc, onChange: next => { setDoc(next); setAnchor(null); }, options: names.map(name => ({ value: name, label: name })) }), _jsx(Button, { size: "sm", tone: "ghost", onClick: () => copy(source, notify, t('wb.make.copiedDoc', { doc })), children: t('wb.make.copyMarkdown') })] }), _jsx(MarkdownDoc, { source: source, docs: names, onLink: onLink })] });
236
+ }
237
+ //# sourceMappingURL=MakePanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MakePanel.js","sourceRoot":"","sources":["../../../../../../shell/src/panel/MakePanel.tsx"],"names":[],"mappings":";AAAA,gGAAgG;AAChG,mGAAmG;AACnG,gGAAgG;AAChG,+FAA+F;AAC/F,+FAA+F;AAC/F,8DAA8D;AAC9D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,SAAS,EAAwC,MAAM,kCAAkC,CAAC;AAEnH,OAAO,EAAE,WAAW,EAAc,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,kBAAk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in or theme from inside the app. Example plugins in an editor that checks\n// the header the way the Plugins list reads it (Copy / Download / Open plugins folder: plugins are\n// installed only by copying a file into the folder, never by the app), a gallery that opens the\n// real plugin UI kit in the current theme, a live view of the theme API (`api.theme.current()`\n// and the `--wb-*` variables) and the app's bundled docs. The examples, the theme file and the\n// docs are the app's (`PanelSite.make`). Everything is local.\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { createThemeApi, themeVars, type ResolvedTheme, type ThemeSource } from '../../../runtime/src/themeApi.ts';\nimport type { ThemeChoice } from '../../../runtime/src/themeChoice.ts';\nimport { createUiKit, type UiKit } from '../../../runtime/src/ui.ts';\nimport { invoke } from '../frame/bridge.ts';\nimport { useT } from '../frame/hooks.ts';\nimport { t, tx } from '../frame/i18n.ts';\nimport { setOverlay } from '../frame/state.ts';\nimport { Button, Section, Segmented } from './controls.tsx';\nimport { CREATE_COMMANDS, KIT_DEMOS, cssVarOf, parsePluginHeader, pluginWarnings, validPluginFileName, type KitDemo } from './makeModel.ts';\nimport type { DocLink } from './markdown.ts';\nimport { MarkdownDoc } from './MarkdownDoc.tsx';\nimport { panelSite, type Notify, type PanelMake, type SectionProps } from './site.ts';\nimport './make.css';\n\ntype Tab = 'plugin' | 'kit' | 'theme' | 'docs';\n/** The docs the intro line links to, when the app bundles them. */\nconst REFERENCE_DOCS = ['PLUGINS.md', 'THEMES.md'];\nconst make = (): PanelMake => panelSite().make!;\nconst runtimeGlobal = () => make().global ?? 'wayBetter';\n\nconst getError = (error: unknown) => error instanceof Error ? error.message : String(error);\n\nfunction copy(text: string, notify: Notify, what = t('wb.common.copied')) {\n navigator.clipboard.writeText(text).then(() => notify(what), () => notify(t('wb.common.clipboardUnavailable'), true));\n}\n\n/** Saves `text` through the webview's ordinary download (the Downloads folder). */\nfunction download(file: string, text: string, type: string) {\n const url = URL.createObjectURL(new Blob([text], { type }));\n const anchor = document.createElement('a');\n anchor.href = url;\n anchor.download = file;\n anchor.click();\n setTimeout(() => URL.revokeObjectURL(url), 1000);\n}\n\n/** The persisted theme choice, re-read while the section is open so the explorer stays live. */\nfunction useThemeChoice(): ThemeChoice | null {\n const [choice, setChoice] = useState<ThemeChoice | null>(null);\n useEffect(() => {\n const themes = panelSite().themes;\n if (!themes) return;\n let alive = true;\n let last = '';\n const load = () => themes.store.adapter.load().then(value => {\n const key = JSON.stringify(value);\n if (alive && key !== last) { last = key; setChoice(value); }\n }).catch(() => { if (alive && !last) setChoice(themes.catalog.defaultChoice); });\n void load();\n const timer = setInterval(load, 1500);\n window.addEventListener('focus', load);\n return () => { alive = false; clearInterval(timer); window.removeEventListener('focus', load); };\n }, []);\n return choice;\n}\n\nexport function MakePanel({ notify, openSection }: SectionProps) {\n const t = useT();\n const themes = panelSite().themes;\n const docs = make().docs ?? {};\n const docNames = Object.keys(docs);\n const reference = REFERENCE_DOCS.filter(name => name in docs);\n const [tab, setTab] = useState<Tab>('plugin');\n const [doc, setDoc] = useState(docNames[0] ?? '');\n const [mode, setMode] = useState(themes?.modes?.initial ?? 'dark');\n const choice = useThemeChoice();\n const resolved = useMemo(() => choice && themes?.resolved ? themes.resolved(choice, mode) : null, [choice, mode]);\n const readDoc = (name: string) => { setDoc(name); setTab('docs'); };\n\n return <div className=\"bmk\">\n <section className=\"bmk-intro\">\n <p>{t('wb.make.intro')}</p>\n <ul className=\"bmk-commands\">\n {CREATE_COMMANDS.map(item => <li key={item.command}>\n <span>{item.label}</span>\n <code>{item.command}</code>\n <Button size=\"sm\" tone=\"ghost\" label={t('wb.make.copyCommand', { command: item.command })} onClick={() => copy(item.command, notify)}>{t('wb.common.copy')}</Button>\n </li>)}\n </ul>\n {reference.length > 0 && <p className=\"bmk-muted\">{t('wb.make.reference')} {reference.map((name, index) => <span key={name}>{index > 0 && <> ·{' '}</>}\n <button type=\"button\" className=\"bmk-doc-link\" onClick={() => readDoc(name)}>{name}</button></span>)} {t('wb.make.referenceBundled')}</p>}\n </section>\n <div className=\"bmk-tabs\">\n <Segmented<Tab> label={t('wb.panel.section.make')} value={tab} onChange={setTab} options={[\n { value: 'plugin' as Tab, label: t('wb.store.plugin') }, { value: 'kit' as Tab, label: t('wb.make.tab.kit') },\n ...(themes?.resolved ? [{ value: 'theme' as Tab, label: t('wb.make.tab.theme') }] : []),\n ...(docNames.length ? [{ value: 'docs' as Tab, label: t('wb.make.tab.docs') }] : []),\n ]}/>\n </div>\n {tab === 'plugin' && <PluginWorkbench notify={notify} openSection={openSection}/>}\n {tab === 'kit' && <KitGallery resolved={resolved} notify={notify}/>}\n {tab === 'theme' && <ThemeExplorer choice={choice} resolved={resolved} mode={mode} setMode={setMode} notify={notify} openSection={openSection}/>}\n {tab === 'docs' && <Docs docs={docs} doc={doc} setDoc={setDoc} notify={notify}/>}\n </div>;\n}\n\n// ---------------------------------------------------------------------------------------------\n// Plugin examples\n\nfunction PluginWorkbench({ notify, openSection }: { notify: Notify; openSection?(section: 'plugins'): void }) {\n const t = useT();\n const PLUGIN_EXAMPLES = make().examples;\n const [exampleId, setExampleId] = useState(PLUGIN_EXAMPLES[0]?.id ?? '');\n const [edits, setEdits] = useState<Record<string, string>>({});\n const [names, setNames] = useState<Record<string, string>>({});\n const example = PLUGIN_EXAMPLES.find(item => item.id === exampleId) ?? PLUGIN_EXAMPLES[0];\n if (!example) return null;\n const source = edits[example.id] ?? example.source;\n const file = names[example.id] ?? example.file;\n const meta = parsePluginHeader(file, source);\n const warnings = pluginWarnings(meta, source);\n const fileOk = validPluginFileName(file);\n const edited = source !== example.source;\n\n return <>\n <Section title={t('wb.make.examples')} hint={t('wb.make.examplesHint')}>\n <div className=\"bmk-examples\" role=\"tablist\" aria-label={t('wb.make.examples')}>\n {PLUGIN_EXAMPLES.map(item => <button key={item.id} type=\"button\" role=\"tab\" aria-selected={item.id === example.id}\n className={`bmk-example ${item.id === example.id ? 'is-on' : ''}`} onClick={() => setExampleId(item.id)}>\n <strong>{item.title}</strong><span>{item.blurb}</span>\n </button>)}\n </div>\n </Section>\n <Section title={meta.name} hint={<>{t('wb.make.pluginsList')} <b>{meta.name}</b>{meta.version && ` ${meta.version}`}{meta.author && ` · ${meta.author}`}{meta.description && ` — ${meta.description}`}</>}\n action={edited ? <Button size=\"sm\" tone=\"ghost\" onClick={() => setEdits(current => { const next = { ...current }; delete next[example.id]; return next; })}>{t('wb.common.reset')}</Button> : undefined}>\n <div className=\"bt-code bmk-editor\">\n <textarea aria-label={t('wb.make.source', { file })} spellCheck={false} value={source} rows={Math.min(28, source.split('\\n').length + 1)}\n onChange={event => setEdits(current => ({ ...current, [example.id]: event.target.value }))}/>\n <div className=\"bt-code-bar\">\n <label className=\"bmk-file\">\n <span>{t('wb.make.file')}</span>\n <input className=\"bt-input\" aria-label={t('wb.make.fileName')} spellCheck={false} value={file} aria-invalid={!fileOk}\n onChange={event => setNames(current => ({ ...current, [example.id]: event.target.value.trim() }))}/>\n </label>\n <Button size=\"sm\" onClick={() => copy(source, notify, t('wb.make.pluginCopied'))}>{t('wb.common.copy')}</Button>\n <Button size=\"sm\" disabled={!fileOk} onClick={() => { download(file, source, 'text/javascript'); notify(t('wb.make.savedDownloads', { file })); }}>{t('wb.panel.updates.download')}</Button>\n <Button size=\"sm\" tone=\"primary\" onClick={() => void invoke('plugins_open_folder').catch(error => notify(getError(error), true))}>{t('wb.make.openPluginsFolder')}</Button>\n </div>\n </div>\n {(warnings.length > 0 || !fileOk) && <ul className=\"bmk-warnings\" role=\"status\">\n {!fileOk && <li>{t('wb.make.fileRule')}</li>}\n {warnings.map(warning => <li key={warning}>{warning}</li>)}\n </ul>}\n <ol className=\"bmk-steps\">\n <li>{t('wb.make.step1', { file: fileOk ? file : 'name.plugin.js' })}</li>\n <li>{t('wb.make.step2Before')} <button type=\"button\" className=\"bmk-doc-link\" onClick={() => openSection?.('plugins')}>{t('wb.panel.section.plugins')}</button>{t('wb.make.step2After')}</li>\n <li>{t('wb.make.step3')}</li>\n </ol>\n </Section>\n </>;\n}\n\n// ---------------------------------------------------------------------------------------------\n// UI kit gallery: the real kit, drawn in this window with the current theme.\n\nfunction KitGallery({ resolved, notify }: { resolved: ResolvedTheme | null; notify: Notify }) {\n const t = useT();\n const latest = useRef<ResolvedTheme | null>(resolved);\n const listeners = useRef(new Set<() => void>());\n const kit = useRef<{ kit: UiKit; dispose(): void } | null>(null);\n const [result, setResult] = useState<{ id: string; text: string } | null>(null);\n\n useEffect(() => {\n latest.current = resolved;\n for (const listener of [...listeners.current]) listener();\n }, [resolved]);\n useEffect(() => {\n const source: ThemeSource = {\n current: () => latest.current,\n onChange: listener => { listeners.current.add(listener); return () => { listeners.current.delete(listener); }; },\n };\n const root = createUiKit(window, { theme: createThemeApi(window, source), product: panelSite().brand.name, hostId: 'wb-make-ui', text: key => tx(key, undefined, '') || undefined });\n kit.current = root.scoped();\n // Leaving the section closes whatever the gallery opened.\n return () => { kit.current?.dispose(); kit.current = null; };\n }, []);\n\n /**\n * Tab webviews are native and sit above this page. A dialog is a shell overlay (the shell rises\n * above the panes); a toast needs none: its layer is pinned to this panel, like `.btp-toast`.\n */\n async function show(demo: KitDemo) {\n const ui = kit.current?.kit;\n if (!ui) return;\n const h = ui.h;\n const toast = demo.kind === 'toast';\n const panel = document.querySelector('.bmk-kit')?.closest('.bt-panel')?.getBoundingClientRect();\n // The kit adds its host on demand: place it once the demo below has (same task, before paint).\n // A transformed host is the containing block of the kit's fixed layers.\n queueMicrotask(() => {\n const host = document.getElementById('wb-make-ui');\n if (host) Object.assign(host.style, toast && panel\n ? { inset: 'auto', left: `${panel.left}px`, top: `${panel.top}px`, width: `${panel.width}px`, height: `${panel.height}px`, transform: 'translateZ(0)' }\n : { inset: '0', left: '', top: '', width: '', height: '', transform: '' });\n });\n if (!toast) setOverlay(1);\n try {\n let value: unknown;\n switch (demo.id) {\n case 'toast': await ui.toast(t('wb.make.demo.linkCopied')).closed; break;\n case 'toast-success': await ui.toast(t('wb.make.demo.saved'), { tone: 'success' }).closed; break;\n case 'toast-action': await ui.toast(t('wb.make.demo.postHidden'), { tone: 'warning', action: { label: t('wb.make.demo.undo'), onClick: () => setResult({ id: demo.id, text: t('wb.make.demo.undoClicked') }) } }).closed; break;\n case 'toast-danger': await ui.toast(t('wb.make.demo.couldNotSave'), { tone: 'danger' }).closed; break;\n case 'alert': value = await ui.alert({ title: t('wb.make.demo.exported'), message: t('wb.make.demo.exportedText'), tone: 'success' }); break;\n case 'confirm': value = await ui.confirm({ title: t('wb.make.demo.deleteNote'), message: t('wb.make.demo.cannotUndo'), danger: true }); break;\n case 'prompt': value = await ui.prompt({ title: t('wb.make.demo.renameList'), label: t('wb.make.demo.name'), value: t('wb.make.demo.reading'), validate: v => v.trim().length < 3 ? t('wb.make.demo.min3') : null }); break;\n case 'dialog': value = await ui.dialog({\n title: t('wb.make.demo.myPlugin'), message: t('wb.make.demo.whatHidden'),\n content: body => body.append(h('label', { class: 'wb-check' }, h('input', { type: 'checkbox' }), t('wb.make.demo.hideTrends'))),\n actions: [{ label: t('wb.common.cancel') }, { label: t('wb.common.save'), tone: 'primary', default: true }],\n }).closed; break;\n }\n if (demo.kind !== 'toast') setResult({ id: demo.id, text: `→ ${value === undefined ? 'undefined' : JSON.stringify(value)}` });\n } catch (error) {\n notify(getError(error), true);\n } finally {\n if (!toast) setOverlay(-1);\n }\n }\n\n return <Section title={t('wb.make.kitTitle')} hint={t('wb.make.kitHint')}>\n <div className=\"bmk-kit\">\n {KIT_DEMOS.map(demo => <div key={demo.id} className=\"bmk-kit-row\">\n <Button size=\"sm\" tone={demo.kind === 'toast' ? 'plain' : 'primary'} onClick={() => void show(demo)}>{demo.label}</Button>\n <code className=\"bmk-kit-code\">{demo.code}</code>\n {result?.id === demo.id && <span className=\"bmk-kit-result\" role=\"status\">{result.text}</span>}\n </div>)}\n </div>\n </Section>;\n}\n\n// ---------------------------------------------------------------------------------------------\n// Theme API explorer\n\n/** What each theme color is for: `make.role.<role>` in the catalogs. */\nconst roleHint = (role: string) => tx(`wb.make.role.${role}`, undefined, '');\n\nfunction ThemeExplorer({ choice, resolved, mode, setMode, notify, openSection }: {\n choice: ThemeChoice | null; resolved: ResolvedTheme | null; mode: string; setMode(mode: string): void; notify: Notify; openSection?(section: 'themes'): void;\n}) {\n const t = useT();\n const themes = panelSite().themes;\n if (!themes || !choice || !resolved) return <p className=\"bmk-muted\">{t('wb.make.loadingTheme')}</p>;\n const vars = themeVars(resolved);\n const spec = themes.catalog.resolve(choice);\n const modes = themes.modes;\n const example = make().themeExample;\n const global = runtimeGlobal();\n // Font roles, when this build's runtime reports them (`fonts`), else the interface font only.\n const roles = (resolved as ResolvedTheme & { fonts?: Record<string, unknown> }).fonts;\n const fontRows: Array<[string, string]> = roles && typeof roles === 'object'\n ? Object.entries(roles).filter((entry): entry is [string, string] => typeof entry[1] === 'string')\n : [['font', resolved.font]];\n\n return <>\n <Section title={`${resolved.name || resolved.id}`} hint={<>{t('wb.make.liveBefore')} <code>{global}.api.theme.current()</code> {t('wb.make.liveMiddle')} <button type=\"button\" className=\"bmk-doc-link\" onClick={() => openSection?.('themes')}>{t('wb.panel.section.themes')}</button> {t('wb.make.liveAfter')}</>}\n action={resolved.siteDefault && modes ? <Segmented<string> size=\"sm\" label={modes.label()} value={mode} onChange={setMode}\n options={modes.options.map(option => ({ value: option.value, label: option.label() }))}/> : undefined}>\n <div className=\"bmk-facts\">\n <span><b>id</b> {resolved.id}</span>\n <span><b>mode</b> {resolved.mode}</span>\n <span><b>siteDefault</b> {String(resolved.siteDefault)}</span>\n <span><b>radius</b> {resolved.radius}px</span>\n <span><b>buttonRadius</b> {resolved.buttonRadius}px</span>\n </div>\n <div className=\"bmk-swatches\">\n {(Object.keys(resolved.colors) as Array<keyof ResolvedTheme['colors']>).map(role => {\n const name = cssVarOf(role);\n return <button key={role} type=\"button\" className=\"bmk-swatch\" title={t('wb.make.copyVar', { name: `var(${name})` })} onClick={() => copy(`var(${name})`, notify, t('wb.make.copiedVar', { name: `var(${name})` }))}>\n <span className=\"bmk-chip\" style={{ background: resolved.colors[role] }}/>\n <span className=\"bmk-swatch-text\"><b>{role}</b><code>{name}</code><small>{resolved.colors[role]} · {roleHint(role)}</small></span>\n </button>;\n })}\n </div>\n </Section>\n <Section title={t('wb.appearance.fonts')} hint={t('wb.make.fontsHint')}>\n <div className=\"bmk-fonts\">\n {fontRows.map(([role, stack]) => <div key={role} className=\"bmk-font\">\n <div><b>{role}</b><code>{stack}</code></div>\n <p style={{ fontFamily: stack }}>The quick brown fox jumps over the lazy dog · 0123456789</p>\n </div>)}\n <div className=\"bmk-facts\">\n <span><b>scale</b> {spec.font.scale}</span><span><b>weight</b> {spec.font.weight}</span><span><b>bold</b> {spec.font.bold}</span>\n <span><b>tracking</b> {spec.font.tracking}em</span><span><b>leading</b> {spec.font.leading || t('wb.make.siteDefaultLeading')}</span>\n </div>\n </div>\n </Section>\n <Section title={t('wb.make.inCode')} hint={t('wb.make.inCodeHint')}>\n <pre className=\"bt-snippet bmk-pre\">{`const theme = ${global}.api.theme.current();\\nthis.scope.onThemeChange(theme => this.redraw(theme));\\n\\n// = ${JSON.stringify(resolved, null, 2).replace(/\\n/g, '\\n// ')}`}</pre>\n <pre className=\"bt-snippet bmk-pre\">{`:root {\\n${Object.entries(vars).map(([key, value]) => ` ${key}: ${value};`).join('\\n')}\\n}`}</pre>\n </Section>\n {example && <Section title={t('wb.make.themeFile')} hint={t('wb.make.themeFileHint')}>\n <pre className=\"bt-snippet bmk-pre\">{example.source}</pre>\n <div className=\"bmk-actions\">\n <Button size=\"sm\" onClick={() => copy(example.source, notify, t('wb.make.themeCopied'))}>{t('wb.common.copy')}</Button>\n <Button size=\"sm\" onClick={() => { download(example.file, example.source, 'application/json'); notify(t('wb.make.savedDownloads', { file: example.file })); }}>{t('wb.panel.updates.download')}</Button>\n </div>\n </Section>}\n </>;\n}\n\n// ---------------------------------------------------------------------------------------------\n// Bundled docs\n\nfunction Docs({ docs, doc, setDoc, notify }: { docs: Readonly<Record<string, string>>; doc: string; setDoc(doc: string): void; notify: Notify }) {\n const t = useT();\n const names = Object.keys(docs);\n const source = docs[doc] ?? '';\n const root = useRef<HTMLDivElement>(null);\n const [anchor, setAnchor] = useState<string | null>(null);\n useEffect(() => {\n if (anchor) root.current?.querySelector(`#doc-${CSS.escape(anchor)}`)?.scrollIntoView({ block: 'start' });\n else root.current?.scrollIntoView({ block: 'start' });\n }, [doc, anchor]);\n const onLink = (link: DocLink) => {\n if (link.url) { invoke('open_external_url', { url: link.url }).catch(error => notify(getError(error), true)); return; }\n if (link.doc && names.includes(link.doc)) setDoc(link.doc);\n setAnchor(link.anchor ?? null);\n };\n return <section className=\"bmk-docs\" ref={root}>\n <div className=\"bmk-actions\">\n <Segmented<string> size=\"sm\" label={t('wb.make.document')} value={doc} onChange={next => { setDoc(next); setAnchor(null); }} options={names.map(name => ({ value: name, label: name }))}/>\n <Button size=\"sm\" tone=\"ghost\" onClick={() => copy(source, notify, t('wb.make.copiedDoc', { doc }))}>{t('wb.make.copyMarkdown')}</Button>\n </div>\n <MarkdownDoc source={source} docs={names} onLink={onLink}/>\n </section>;\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { type DocLink } from './markdown.ts';
2
+ export declare function MarkdownDoc({ source, docs, onLink }: {
3
+ source: string;
4
+ docs: readonly string[];
5
+ onLink(link: DocLink): void;
6
+ }): import("react").JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { anchorOf, inlineTokens, parseMarkdown, resolveLink } from "./markdown.js";
3
+ function inline(text, onLink, docs) {
4
+ return inlineTokens(text).map((token, index) => {
5
+ if (token.kind === 'text')
6
+ return token.text;
7
+ if (token.kind === 'code')
8
+ return _jsx("code", { children: token.text }, index);
9
+ if (token.kind === 'bold')
10
+ return _jsx("strong", { children: token.text }, index);
11
+ const link = resolveLink(token.href, docs);
12
+ return link
13
+ ? _jsx("button", { type: "button", className: "bmk-doc-link", title: link.url ?? token.href, onClick: () => onLink(link), children: inline(token.text, onLink, docs) }, index)
14
+ : _jsx("span", { children: token.text }, index);
15
+ });
16
+ }
17
+ export function MarkdownDoc({ source, docs, onLink }) {
18
+ const blocks = parseMarkdown(source);
19
+ return _jsx("div", { className: "bmk-doc", children: blocks.map((block, index) => {
20
+ switch (block.kind) {
21
+ case 'heading': {
22
+ const Tag = `h${Math.min(block.level + 1, 5)}`;
23
+ return _jsx(Tag, { id: `doc-${anchorOf(block.text)}`, children: inline(block.text, onLink, docs) }, index);
24
+ }
25
+ case 'paragraph': return _jsx("p", { children: inline(block.text, onLink, docs) }, index);
26
+ case 'list': {
27
+ const List = block.ordered ? 'ol' : 'ul';
28
+ return _jsx(List, { children: block.items.map((item, n) => _jsx("li", { children: inline(item, onLink, docs) }, n)) }, index);
29
+ }
30
+ case 'table': return _jsx("div", { className: "bmk-doc-table", children: _jsxs("table", { children: [_jsx("thead", { children: _jsx("tr", { children: block.head.map((cell, n) => _jsx("th", { children: inline(cell, onLink, docs) }, n)) }) }), _jsx("tbody", { children: block.rows.map((row, r) => _jsx("tr", { children: row.map((cell, n) => _jsx("td", { children: inline(cell, onLink, docs) }, n)) }, r)) })] }) }, index);
31
+ case 'code': return _jsx("pre", { className: "bt-snippet", "data-lang": block.lang || undefined, children: block.text }, index);
32
+ }
33
+ }) });
34
+ }
35
+ //# sourceMappingURL=MarkdownDoc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarkdownDoc.js","sourceRoot":"","sources":["../../../../../../shell/src/panel/MarkdownDoc.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAgB,MAAM,eAAe,CAAC;AAEjG,SAAS,MAAM,CAAC,IAAY,EAAE,MAA+B,EAAE,IAAuB;IACpF,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QAC7C,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM;YAAE,OAAO,KAAK,CAAC,IAAI,CAAC;QAC7C,IAA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C,IAAI,IAAI,SAAS,YAAG,KAAK,CAAC,IAAI,IAA7E,KAAK,CAA+E,CAAC;YACrH,CAAC;QACH,CAAC,CAAC,GAAO,CAAC;AACZ,CAAC","sourcesContent":["// Renders the bundled docs (see markdown.ts) as React text nodes; nothing is parsed as HTML.\n// Links to the other bundled doc switch docs, `#anchors` scroll, and web links open in the\n// system browser.\nimport type { ReactNode } from 'react';\nimport { anchorOf, inlineTokens, parseMarkdown, resolveLink, type DocLink } from './markdown.ts';\n\nfunction inline(text: string, onLink: (link: DocLink) => void, docs: readonly string[]): ReactNode[] {\n return inlineTokens(text).map((token, index) => {\n if (token.kind === 'text') return token.text;\n if (token.kind === 'code') return <code key={index}>{token.text}</code>;\n if (token.kind === 'bold') return <strong key={index}>{token.text}</strong>;\n const link = resolveLink(token.href, docs);\n return link\n ? <button key={index} type=\"button\" className=\"bmk-doc-link\" title={link.url ?? token.href} onClick={() => onLink(link)}>{inline(token.text, onLink, docs)}</button>\n : <span key={index}>{token.text}</span>;\n });\n}\n\nexport function MarkdownDoc({ source, docs, onLink }: { source: string; docs: readonly string[]; onLink(link: DocLink): void }) {\n const blocks = parseMarkdown(source);\n return <div className=\"bmk-doc\">{blocks.map((block, index) => {\n switch (block.kind) {\n case 'heading': {\n const Tag = `h${Math.min(block.level + 1, 5)}` as 'h2';\n return <Tag key={index} id={`doc-${anchorOf(block.text)}`}>{inline(block.text, onLink, docs)}</Tag>;\n }\n case 'paragraph': return <p key={index}>{inline(block.text, onLink, docs)}</p>;\n case 'list': {\n const List = block.ordered ? 'ol' : 'ul';\n return <List key={index}>{block.items.map((item, n) => <li key={n}>{inline(item, onLink, docs)}</li>)}</List>;\n }\n case 'table': return <div key={index} className=\"bmk-doc-table\"><table>\n <thead><tr>{block.head.map((cell, n) => <th key={n}>{inline(cell, onLink, docs)}</th>)}</tr></thead>\n <tbody>{block.rows.map((row, r) => <tr key={r}>{row.map((cell, n) => <td key={n}>{inline(cell, onLink, docs)}</td>)}</tr>)}</tbody>\n </table></div>;\n case 'code': return <pre key={index} className=\"bt-snippet\" data-lang={block.lang || undefined}>{block.text}</pre>;\n }\n })}</div>;\n}\n"]}
@@ -0,0 +1,40 @@
1
+ import { type FeatureTable } from '../../runtime/featureTable.ts';
2
+ import type { MenuModes } from '../frame/menuModel.ts';
3
+ import { type Notify } from './site.ts';
4
+ import './plugins.css';
5
+ /**
6
+ * The onboarding state native code keeps (waybetter-host `modes::ModeState`). `preset`: the mode's
7
+ * flags as they were when it was applied (absent: not known).
8
+ */
9
+ export type ModeState = {
10
+ mode: string | null;
11
+ onboarded: boolean;
12
+ existing: boolean;
13
+ preset?: Record<string, boolean> | null;
14
+ };
15
+ /** Tells the mode screens a mode was stored from elsewhere (an imported setup). */
16
+ export declare const rememberModeState: (next: ModeState) => void;
17
+ /** The mode state, loaded once and shared by the first-run screen and Settings. Null until loaded (or without modes). */
18
+ export declare function useModeState(): [ModeState | null, (next: ModeState) => void];
19
+ /** A flag as the owner knows it: the feature's label, or the area's name for its switch. */
20
+ export declare function flagName(table: FeatureTable, id: string): string;
21
+ /** The first-run screen. `done` runs once a mode was chosen or the screen was dismissed. */
22
+ export declare function Onboarding({ state, done, notify }: {
23
+ state: ModeState;
24
+ done(next: ModeState): void;
25
+ notify: Notify;
26
+ }): import("react").JSX.Element;
27
+ /** Settings: the mode in use and the way to another one, keeping or dropping the owner's changes. */
28
+ export declare function ModeSettings({ notify }: {
29
+ notify: Notify;
30
+ }): import("react").JSX.Element | null;
31
+ /**
32
+ * Opens the app's panel (which shows the first-run screen) when the screen has not been answered.
33
+ * Call it from the app's `ShellSite.start`: it waits until the shell has restored its tabs.
34
+ */
35
+ export declare function openOnboardingWhenDue(): void;
36
+ /**
37
+ * The app menu's Mode submenu (the frame's `ShellSite.menu.modes`): the same modes, the same
38
+ * question (keep my changes or take the mode as it is) and the same steps as Settings.
39
+ */
40
+ export declare function menuModes(): MenuModes;