waybetter 0.1.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +139 -6
- package/bin/waybetter.mjs +43 -0
- package/build/runtime.mjs +105 -0
- package/cli/buildenv.mjs +130 -0
- package/cli/dev.mjs +97 -0
- package/cli/i18n.mjs +382 -0
- package/cli/manifests.mjs +383 -0
- package/cli/release.mjs +437 -0
- package/cli/releasecheck.mjs +15 -0
- package/cli/remote.mjs +260 -0
- package/cli/store.mjs +378 -0
- package/cli/strings.mjs +123 -0
- package/dist/runtime/column.d.ts +93 -0
- package/dist/runtime/column.js +451 -0
- package/dist/runtime/column.js.map +1 -0
- package/dist/runtime/commandReport.d.ts +19 -0
- package/dist/runtime/commandReport.js +47 -0
- package/dist/runtime/commandReport.js.map +1 -0
- package/dist/runtime/commands.d.ts +72 -0
- package/dist/runtime/commands.js +214 -0
- package/dist/runtime/commands.js.map +1 -0
- package/dist/runtime/devErrors.d.ts +16 -0
- package/dist/runtime/devErrors.js +30 -0
- package/dist/runtime/devErrors.js.map +1 -0
- package/dist/runtime/domHub.d.ts +21 -0
- package/dist/runtime/domHub.js +139 -4
- package/dist/runtime/domHub.js.map +1 -1
- package/dist/runtime/featureModules.d.ts +157 -0
- package/dist/runtime/featureModules.js +484 -0
- package/dist/runtime/featureModules.js.map +1 -0
- package/dist/runtime/featureTable.d.ts +144 -0
- package/dist/runtime/featureTable.js +223 -0
- package/dist/runtime/featureTable.js.map +1 -0
- package/dist/runtime/fonts.d.ts +22 -0
- package/dist/runtime/fonts.js +72 -0
- package/dist/runtime/fonts.js.map +1 -0
- package/dist/runtime/i18n.d.ts +138 -0
- package/dist/runtime/i18n.js +614 -0
- package/dist/runtime/i18n.js.map +1 -0
- package/dist/runtime/i18nCheck.d.ts +30 -0
- package/dist/runtime/i18nCheck.js +224 -0
- package/dist/runtime/i18nCheck.js.map +1 -0
- package/dist/runtime/pageLang.d.ts +8 -0
- package/dist/runtime/pageLang.js +64 -0
- package/dist/runtime/pageLang.js.map +1 -0
- package/dist/runtime/pageStrings.d.ts +35 -0
- package/dist/runtime/pageStrings.js +76 -0
- package/dist/runtime/pageStrings.js.map +1 -0
- package/dist/runtime/panelButton.d.ts +33 -0
- package/dist/runtime/panelButton.js +83 -0
- package/dist/runtime/panelButton.js.map +1 -0
- package/dist/runtime/permissions.d.ts +47 -0
- package/dist/runtime/permissions.js +141 -0
- package/dist/runtime/permissions.js.map +1 -0
- package/dist/runtime/pluginApi.d.ts +51 -2
- package/dist/runtime/pluginApi.js +137 -22
- package/dist/runtime/pluginApi.js.map +1 -1
- package/dist/runtime/pluginI18n.d.ts +29 -0
- package/dist/runtime/pluginI18n.js +119 -0
- package/dist/runtime/pluginI18n.js.map +1 -0
- package/dist/runtime/settingsForm.d.ts +66 -0
- package/dist/runtime/settingsForm.js +114 -0
- package/dist/runtime/settingsForm.js.map +1 -0
- package/dist/runtime/site.d.ts +5 -0
- package/dist/runtime/site.js +1 -1
- package/dist/runtime/site.js.map +1 -1
- package/dist/runtime/siteRuntime.d.ts +144 -0
- package/dist/runtime/siteRuntime.js +175 -0
- package/dist/runtime/siteRuntime.js.map +1 -0
- package/dist/runtime/stringPackHook.d.ts +84 -0
- package/dist/runtime/stringPackHook.js +220 -0
- package/dist/runtime/stringPackHook.js.map +1 -0
- package/dist/runtime/stringPackTranslate.d.ts +61 -0
- package/dist/runtime/stringPackTranslate.js +267 -0
- package/dist/runtime/stringPackTranslate.js.map +1 -0
- package/dist/runtime/stringPacks.d.ts +248 -0
- package/dist/runtime/stringPacks.js +610 -0
- package/dist/runtime/stringPacks.js.map +1 -0
- package/dist/runtime/styles.d.ts +15 -0
- package/dist/runtime/styles.js +81 -0
- package/dist/runtime/styles.js.map +1 -0
- package/dist/runtime/textNet.d.ts +15 -0
- package/dist/runtime/textNet.js +131 -0
- package/dist/runtime/textNet.js.map +1 -0
- package/dist/runtime/themeApi.d.ts +121 -0
- package/dist/runtime/themeApi.js +220 -0
- package/dist/runtime/themeApi.js.map +1 -0
- package/dist/runtime/themeBar.d.ts +28 -0
- package/dist/runtime/themeBar.js +82 -0
- package/dist/runtime/themeBar.js.map +1 -0
- package/dist/runtime/themeChoice.d.ts +52 -0
- package/dist/runtime/themeChoice.js +69 -0
- package/dist/runtime/themeChoice.js.map +1 -0
- package/dist/runtime/themeComponents.d.ts +435 -0
- package/dist/runtime/themeComponents.js +476 -0
- package/dist/runtime/themeComponents.js.map +1 -0
- package/dist/runtime/themeDecor.d.ts +73 -0
- package/dist/runtime/themeDecor.js +133 -0
- package/dist/runtime/themeDecor.js.map +1 -0
- package/dist/runtime/themeDerive.d.ts +69 -0
- package/dist/runtime/themeDerive.js +117 -0
- package/dist/runtime/themeDerive.js.map +1 -0
- package/dist/runtime/themeDoctor.d.ts +52 -0
- package/dist/runtime/themeDoctor.js +112 -0
- package/dist/runtime/themeDoctor.js.map +1 -0
- package/dist/runtime/themeGuards.d.ts +60 -0
- package/dist/runtime/themeGuards.js +235 -0
- package/dist/runtime/themeGuards.js.map +1 -0
- package/dist/runtime/themeIcons.d.ts +130 -0
- package/dist/runtime/themeIcons.js +271 -0
- package/dist/runtime/themeIcons.js.map +1 -0
- package/dist/runtime/themeInk.d.ts +37 -0
- package/dist/runtime/themeInk.js +111 -0
- package/dist/runtime/themeInk.js.map +1 -0
- package/dist/runtime/themeInvariants.d.ts +39 -0
- package/dist/runtime/themeInvariants.js +273 -0
- package/dist/runtime/themeInvariants.js.map +1 -0
- package/dist/runtime/themeRuntime.d.ts +114 -0
- package/dist/runtime/themeRuntime.js +570 -0
- package/dist/runtime/themeRuntime.js.map +1 -0
- package/dist/runtime/themeSchema.d.ts +10 -0
- package/dist/runtime/themeSchema.js +150 -0
- package/dist/runtime/themeSchema.js.map +1 -0
- package/dist/runtime/themeSpec.d.ts +263 -0
- package/dist/runtime/themeSpec.js +435 -0
- package/dist/runtime/themeSpec.js.map +1 -0
- package/dist/runtime/themeTokens.d.ts +12 -0
- package/dist/runtime/themeTokens.js +14 -6
- package/dist/runtime/themeTokens.js.map +1 -1
- package/dist/runtime/themeVariants.d.ts +30 -0
- package/dist/runtime/themeVariants.js +53 -0
- package/dist/runtime/themeVariants.js.map +1 -0
- package/dist/runtime/ui.d.ts +192 -0
- package/dist/runtime/ui.js +926 -0
- package/dist/runtime/ui.js.map +1 -0
- package/dist/shell/InstallDialog.d.ts +40 -0
- package/dist/shell/InstallDialog.js +176 -0
- package/dist/shell/InstallDialog.js.map +1 -0
- package/dist/shell/StoreView.d.ts +78 -0
- package/dist/shell/StoreView.js +108 -0
- package/dist/shell/StoreView.js.map +1 -0
- package/dist/shell/addressModel.js.map +1 -1
- package/dist/shell/chrome.js.map +1 -1
- package/dist/shell/deckModel.d.ts +117 -0
- package/dist/shell/deckModel.js +267 -0
- package/dist/shell/deckModel.js.map +1 -0
- package/dist/shell/frame/AccountSwitcher.d.ts +42 -0
- package/dist/shell/frame/AccountSwitcher.js +243 -0
- package/dist/shell/frame/AccountSwitcher.js.map +1 -0
- package/dist/shell/frame/AddColumnDialog.d.ts +8 -0
- package/dist/shell/frame/AddColumnDialog.js +81 -0
- package/dist/shell/frame/AddColumnDialog.js.map +1 -0
- package/dist/shell/frame/AppMenu.d.ts +44 -0
- package/dist/shell/frame/AppMenu.js +721 -0
- package/dist/shell/frame/AppMenu.js.map +1 -0
- package/dist/shell/frame/CommandPalette.d.ts +7 -0
- package/dist/shell/frame/CommandPalette.js +118 -0
- package/dist/shell/frame/CommandPalette.js.map +1 -0
- package/dist/shell/frame/DeckView.d.ts +13 -0
- package/dist/shell/frame/DeckView.js +287 -0
- package/dist/shell/frame/DeckView.js.map +1 -0
- package/dist/shell/frame/FindBar.d.ts +10 -0
- package/dist/shell/frame/FindBar.js +108 -0
- package/dist/shell/frame/FindBar.js.map +1 -0
- package/dist/shell/frame/MediaPanel.d.ts +8 -0
- package/dist/shell/frame/MediaPanel.js +76 -0
- package/dist/shell/frame/MediaPanel.js.map +1 -0
- package/dist/shell/frame/NewTabPage.d.ts +9 -0
- package/dist/shell/frame/NewTabPage.js +71 -0
- package/dist/shell/frame/NewTabPage.js.map +1 -0
- package/dist/shell/frame/PaneTheme.d.ts +16 -0
- package/dist/shell/frame/PaneTheme.js +67 -0
- package/dist/shell/frame/PaneTheme.js.map +1 -0
- package/dist/shell/frame/ReportDialog.d.ts +3 -0
- package/dist/shell/frame/ReportDialog.js +95 -0
- package/dist/shell/frame/ReportDialog.js.map +1 -0
- package/dist/shell/frame/Shell.d.ts +9 -0
- package/dist/shell/frame/Shell.js +1139 -0
- package/dist/shell/frame/Shell.js.map +1 -0
- package/dist/shell/frame/Titlebar.d.ts +17 -0
- package/dist/shell/frame/Titlebar.js +79 -0
- package/dist/shell/frame/Titlebar.js.map +1 -0
- package/dist/shell/frame/TitlebarExtras.d.ts +4 -0
- package/dist/shell/frame/TitlebarExtras.js +202 -0
- package/dist/shell/frame/TitlebarExtras.js.map +1 -0
- package/dist/shell/frame/WebPanel.d.ts +4 -0
- package/dist/shell/frame/WebPanel.js +185 -0
- package/dist/shell/frame/WebPanel.js.map +1 -0
- package/dist/shell/frame/accountModel.d.ts +49 -0
- package/dist/shell/frame/accountModel.js +67 -0
- package/dist/shell/frame/accountModel.js.map +1 -0
- package/dist/shell/frame/accountSwitcher.css +91 -0
- package/dist/shell/frame/appI18n.d.ts +44 -0
- package/dist/shell/frame/appI18n.js +64 -0
- package/dist/shell/frame/appI18n.js.map +1 -0
- package/dist/shell/frame/appMenu.css +127 -0
- package/dist/shell/frame/backupModel.d.ts +38 -0
- package/dist/shell/frame/backupModel.js +192 -0
- package/dist/shell/frame/backupModel.js.map +1 -0
- package/dist/shell/frame/boot.d.ts +8 -0
- package/dist/shell/frame/boot.js +37 -0
- package/dist/shell/frame/boot.js.map +1 -0
- package/dist/shell/frame/brand.d.ts +1 -0
- package/dist/shell/frame/brand.js +4 -0
- package/dist/shell/frame/brand.js.map +1 -0
- package/dist/shell/frame/bridge.d.ts +35 -0
- package/dist/shell/frame/bridge.js +70 -0
- package/dist/shell/frame/bridge.js.map +1 -0
- package/dist/shell/frame/chromeTheme.d.ts +47 -0
- package/dist/shell/frame/chromeTheme.js +118 -0
- package/dist/shell/frame/chromeTheme.js.map +1 -0
- package/dist/shell/frame/deck.css +209 -0
- package/dist/shell/frame/deckStore.d.ts +89 -0
- package/dist/shell/frame/deckStore.js +239 -0
- package/dist/shell/frame/deckStore.js.map +1 -0
- package/dist/shell/frame/devHost.d.ts +35 -0
- package/dist/shell/frame/devHost.js +80 -0
- package/dist/shell/frame/devHost.js.map +1 -0
- package/dist/shell/frame/devModel.d.ts +7 -0
- package/dist/shell/frame/devModel.js +17 -0
- package/dist/shell/frame/devModel.js.map +1 -0
- package/dist/shell/frame/diag.d.ts +7 -0
- package/dist/shell/frame/diag.js +39 -0
- package/dist/shell/frame/diag.js.map +1 -0
- package/dist/shell/frame/edges.css +159 -0
- package/dist/shell/frame/findBar.css +14 -0
- package/dist/shell/frame/frameMessages.d.ts +248 -0
- package/dist/shell/frame/frameMessages.js +252 -0
- package/dist/shell/frame/frameMessages.js.map +1 -0
- package/dist/shell/frame/hooks.d.ts +39 -0
- package/dist/shell/frame/hooks.js +97 -0
- package/dist/shell/frame/hooks.js.map +1 -0
- package/dist/shell/frame/i18n.d.ts +27 -0
- package/dist/shell/frame/i18n.js +66 -0
- package/dist/shell/frame/i18n.js.map +1 -0
- package/dist/shell/frame/iconPack.d.ts +11 -0
- package/dist/shell/frame/iconPack.js +45 -0
- package/dist/shell/frame/iconPack.js.map +1 -0
- package/dist/shell/frame/icons.d.ts +71 -0
- package/dist/shell/frame/icons.js +75 -0
- package/dist/shell/frame/icons.js.map +1 -0
- package/dist/shell/frame/index.d.ts +34 -0
- package/dist/shell/frame/index.js +43 -0
- package/dist/shell/frame/index.js.map +1 -0
- package/dist/shell/frame/language.d.ts +58 -0
- package/dist/shell/frame/language.js +165 -0
- package/dist/shell/frame/language.js.map +1 -0
- package/dist/shell/frame/mediaModel.d.ts +47 -0
- package/dist/shell/frame/mediaModel.js +67 -0
- package/dist/shell/frame/mediaModel.js.map +1 -0
- package/dist/shell/frame/menuMessages.en.json +96 -0
- package/dist/shell/frame/menuModel.d.ts +319 -0
- package/dist/shell/frame/menuModel.js +301 -0
- package/dist/shell/frame/menuModel.js.map +1 -0
- package/dist/shell/frame/nativeMenu.d.ts +5 -0
- package/dist/shell/frame/nativeMenu.js +178 -0
- package/dist/shell/frame/nativeMenu.js.map +1 -0
- package/dist/shell/frame/nativeMenuModel.d.ts +102 -0
- package/dist/shell/frame/nativeMenuModel.js +186 -0
- package/dist/shell/frame/nativeMenuModel.js.map +1 -0
- package/dist/shell/frame/paletteModel.d.ts +139 -0
- package/dist/shell/frame/paletteModel.js +114 -0
- package/dist/shell/frame/paletteModel.js.map +1 -0
- package/dist/shell/frame/paneTheme.css +9 -0
- package/dist/shell/frame/pluginCommandStore.d.ts +23 -0
- package/dist/shell/frame/pluginCommandStore.js +70 -0
- package/dist/shell/frame/pluginCommandStore.js.map +1 -0
- package/dist/shell/frame/reportModel.d.ts +52 -0
- package/dist/shell/frame/reportModel.js +105 -0
- package/dist/shell/frame/reportModel.js.map +1 -0
- package/dist/shell/frame/safeStore.d.ts +7 -0
- package/dist/shell/frame/safeStore.js +40 -0
- package/dist/shell/frame/safeStore.js.map +1 -0
- package/dist/shell/frame/searchInput.d.ts +2 -0
- package/dist/shell/frame/searchInput.js +11 -0
- package/dist/shell/frame/searchInput.js.map +1 -0
- package/dist/shell/frame/shell.css +634 -0
- package/dist/shell/frame/site.d.ts +206 -0
- package/dist/shell/frame/site.js +22 -0
- package/dist/shell/frame/site.js.map +1 -0
- package/dist/shell/frame/state.d.ts +101 -0
- package/dist/shell/frame/state.js +286 -0
- package/dist/shell/frame/state.js.map +1 -0
- package/dist/shell/frame/syncGate.d.ts +10 -0
- package/dist/shell/frame/syncGate.js +36 -0
- package/dist/shell/frame/syncGate.js.map +1 -0
- package/dist/shell/frame/syncHost.d.ts +35 -0
- package/dist/shell/frame/syncHost.js +85 -0
- package/dist/shell/frame/syncHost.js.map +1 -0
- package/dist/shell/frame/tabStill.d.ts +2 -0
- package/dist/shell/frame/tabStill.js +62 -0
- package/dist/shell/frame/tabStill.js.map +1 -0
- package/dist/shell/frame/themeScopes.d.ts +29 -0
- package/dist/shell/frame/themeScopes.js +61 -0
- package/dist/shell/frame/themeScopes.js.map +1 -0
- package/dist/shell/frame/themeStore.d.ts +99 -0
- package/dist/shell/frame/themeStore.js +267 -0
- package/dist/shell/frame/themeStore.js.map +1 -0
- package/dist/shell/frame/windowBinding.d.ts +2 -0
- package/dist/shell/frame/windowBinding.js +7 -0
- package/dist/shell/frame/windowBinding.js.map +1 -0
- package/dist/shell/frame/workspaceModel.d.ts +82 -0
- package/dist/shell/frame/workspaceModel.js +250 -0
- package/dist/shell/frame/workspaceModel.js.map +1 -0
- package/dist/shell/frame/workspaces.css +84 -0
- package/dist/shell/frame/workspaces.d.ts +22 -0
- package/dist/shell/frame/workspaces.js +125 -0
- package/dist/shell/frame/workspaces.js.map +1 -0
- package/dist/shell/frame/zoomStore.d.ts +10 -0
- package/dist/shell/frame/zoomStore.js +65 -0
- package/dist/shell/frame/zoomStore.js.map +1 -0
- package/dist/shell/installController.d.ts +137 -0
- package/dist/shell/installController.js +172 -0
- package/dist/shell/installController.js.map +1 -0
- package/dist/shell/installerMessages.d.ts +30 -0
- package/dist/shell/installerMessages.js +36 -0
- package/dist/shell/installerMessages.js.map +1 -0
- package/dist/shell/linkDrop.js.map +1 -1
- package/dist/shell/messages.d.ts +16 -0
- package/dist/shell/messages.js +27 -0
- package/dist/shell/messages.js.map +1 -0
- package/dist/shell/palette.js.map +1 -1
- package/dist/shell/paneModel.d.ts +22 -0
- package/dist/shell/paneModel.js +24 -1
- package/dist/shell/paneModel.js.map +1 -1
- package/dist/shell/panel/Appearance.d.ts +8 -0
- package/dist/shell/panel/Appearance.js +265 -0
- package/dist/shell/panel/Appearance.js.map +1 -0
- package/dist/shell/panel/BackupPanel.d.ts +5 -0
- package/dist/shell/panel/BackupPanel.js +198 -0
- package/dist/shell/panel/BackupPanel.js.map +1 -0
- package/dist/shell/panel/DeveloperPanel.d.ts +4 -0
- package/dist/shell/panel/DeveloperPanel.js +51 -0
- package/dist/shell/panel/DeveloperPanel.js.map +1 -0
- package/dist/shell/panel/FeatureToggles.d.ts +13 -0
- package/dist/shell/panel/FeatureToggles.js +42 -0
- package/dist/shell/panel/FeatureToggles.js.map +1 -0
- package/dist/shell/panel/Home.d.ts +3 -0
- package/dist/shell/panel/Home.js +23 -0
- package/dist/shell/panel/Home.js.map +1 -0
- package/dist/shell/panel/IconPackInstall.d.ts +15 -0
- package/dist/shell/panel/IconPackInstall.js +41 -0
- package/dist/shell/panel/IconPackInstall.js.map +1 -0
- package/dist/shell/panel/LanguageSettings.d.ts +1 -0
- package/dist/shell/panel/LanguageSettings.js +54 -0
- package/dist/shell/panel/LanguageSettings.js.map +1 -0
- package/dist/shell/panel/MakePanel.d.ts +3 -0
- package/dist/shell/panel/MakePanel.js +237 -0
- package/dist/shell/panel/MakePanel.js.map +1 -0
- package/dist/shell/panel/MarkdownDoc.d.ts +6 -0
- package/dist/shell/panel/MarkdownDoc.js +35 -0
- package/dist/shell/panel/MarkdownDoc.js.map +1 -0
- package/dist/shell/panel/Modes.d.ts +40 -0
- package/dist/shell/panel/Modes.js +270 -0
- package/dist/shell/panel/Modes.js.map +1 -0
- package/dist/shell/panel/NavIcon.d.ts +4 -0
- package/dist/shell/panel/NavIcon.js +6 -0
- package/dist/shell/panel/NavIcon.js.map +1 -0
- package/dist/shell/panel/Panel.d.ts +7 -0
- package/dist/shell/panel/Panel.js +139 -0
- package/dist/shell/panel/Panel.js.map +1 -0
- package/dist/shell/panel/PluginFeatures.d.ts +24 -0
- package/dist/shell/panel/PluginFeatures.js +165 -0
- package/dist/shell/panel/PluginFeatures.js.map +1 -0
- package/dist/shell/panel/Plugins.d.ts +33 -0
- package/dist/shell/panel/Plugins.js +112 -0
- package/dist/shell/panel/Plugins.js.map +1 -0
- package/dist/shell/panel/PowerSettings.d.ts +4 -0
- package/dist/shell/panel/PowerSettings.js +52 -0
- package/dist/shell/panel/PowerSettings.js.map +1 -0
- package/dist/shell/panel/Settings.d.ts +23 -0
- package/dist/shell/panel/Settings.js +117 -0
- package/dist/shell/panel/Settings.js.map +1 -0
- package/dist/shell/panel/ShareSetup.d.ts +8 -0
- package/dist/shell/panel/ShareSetup.js +130 -0
- package/dist/shell/panel/ShareSetup.js.map +1 -0
- package/dist/shell/panel/StoreSection.d.ts +7 -0
- package/dist/shell/panel/StoreSection.js +78 -0
- package/dist/shell/panel/StoreSection.js.map +1 -0
- package/dist/shell/panel/StringPacks.d.ts +20 -0
- package/dist/shell/panel/StringPacks.js +131 -0
- package/dist/shell/panel/StringPacks.js.map +1 -0
- package/dist/shell/panel/ThemeBuilder.d.ts +5 -0
- package/dist/shell/panel/ThemeBuilder.js +205 -0
- package/dist/shell/panel/ThemeBuilder.js.map +1 -0
- package/dist/shell/panel/backup.css +34 -0
- package/dist/shell/panel/builder.css +240 -0
- package/dist/shell/panel/builderModel.d.ts +55 -0
- package/dist/shell/panel/builderModel.js +95 -0
- package/dist/shell/panel/builderModel.js.map +1 -0
- package/dist/shell/panel/compare.d.ts +10 -0
- package/dist/shell/panel/compare.js +51 -0
- package/dist/shell/panel/compare.js.map +1 -0
- package/dist/shell/panel/controls.d.ts +135 -0
- package/dist/shell/panel/controls.js +213 -0
- package/dist/shell/panel/controls.js.map +1 -0
- package/dist/shell/panel/featureModel.d.ts +69 -0
- package/dist/shell/panel/featureModel.js +79 -0
- package/dist/shell/panel/featureModel.js.map +1 -0
- package/dist/shell/panel/fonts/FontBrowser.d.ts +10 -0
- package/dist/shell/panel/fonts/FontBrowser.js +189 -0
- package/dist/shell/panel/fonts/FontBrowser.js.map +1 -0
- package/dist/shell/panel/fonts/FontRoles.d.ts +20 -0
- package/dist/shell/panel/fonts/FontRoles.js +77 -0
- package/dist/shell/panel/fonts/FontRoles.js.map +1 -0
- package/dist/shell/panel/fonts/catalog.d.ts +37 -0
- package/dist/shell/panel/fonts/catalog.js +68 -0
- package/dist/shell/panel/fonts/catalog.js.map +1 -0
- package/dist/shell/panel/fonts/googleFontsCatalog.json +1 -0
- package/dist/shell/panel/index.d.ts +20 -0
- package/dist/shell/panel/index.js +34 -0
- package/dist/shell/panel/index.js.map +1 -0
- package/dist/shell/panel/languageModel.d.ts +5 -0
- package/dist/shell/panel/languageModel.js +7 -0
- package/dist/shell/panel/languageModel.js.map +1 -0
- package/dist/shell/panel/make.css +73 -0
- package/dist/shell/panel/makeModel.d.ts +32 -0
- package/dist/shell/panel/makeModel.js +84 -0
- package/dist/shell/panel/makeModel.js.map +1 -0
- package/dist/shell/panel/markdown.d.ts +46 -0
- package/dist/shell/panel/markdown.js +100 -0
- package/dist/shell/panel/markdown.js.map +1 -0
- package/dist/shell/panel/nav.d.ts +12 -0
- package/dist/shell/panel/nav.js +50 -0
- package/dist/shell/panel/nav.js.map +1 -0
- package/dist/shell/panel/panel.css +401 -0
- package/dist/shell/panel/panelMessages.d.ts +803 -0
- package/dist/shell/panel/panelMessages.js +779 -0
- package/dist/shell/panel/panelMessages.js.map +1 -0
- package/dist/shell/panel/plugins.css +59 -0
- package/dist/shell/panel/setupModel.d.ts +87 -0
- package/dist/shell/panel/setupModel.js +152 -0
- package/dist/shell/panel/setupModel.js.map +1 -0
- package/dist/shell/panel/site.d.ts +259 -0
- package/dist/shell/panel/site.js +25 -0
- package/dist/shell/panel/site.js.map +1 -0
- package/dist/shell/panel/strings.css +7 -0
- package/dist/shell/panel/themes.d.ts +10 -0
- package/dist/shell/panel/themes.js +8 -0
- package/dist/shell/panel/themes.js.map +1 -0
- package/dist/shell/profileModel.d.ts +3 -2
- package/dist/shell/profileModel.js +7 -5
- package/dist/shell/profileModel.js.map +1 -1
- package/dist/shell/store.css +250 -0
- package/dist/shell/storeMessages.d.ts +193 -0
- package/dist/shell/storeMessages.js +196 -0
- package/dist/shell/storeMessages.js.map +1 -0
- package/dist/shell/storeModel.d.ts +205 -0
- package/dist/shell/storeModel.js +146 -0
- package/dist/shell/storeModel.js.map +1 -0
- package/dist/shell/stringPacksModel.d.ts +44 -0
- package/dist/shell/stringPacksModel.js +99 -0
- package/dist/shell/stringPacksModel.js.map +1 -0
- package/dist/shell/updateModel.d.ts +2 -1
- package/dist/shell/updateModel.js +5 -4
- package/dist/shell/updateModel.js.map +1 -1
- package/dist/shell/windowControls.d.ts +4 -0
- package/dist/shell/windowControls.js +5 -0
- package/dist/shell/windowControls.js.map +1 -1
- package/i18n-config.schema.json +29 -0
- package/i18n-meta.schema.json +26 -0
- package/i18n.schema.json +42 -0
- package/icons.schema.json +655 -0
- package/languages.schema.json +23 -0
- package/locales/ar-x-fm.json +11 -0
- package/locales/ar.json +1388 -0
- package/locales/bg.json +1387 -0
- package/locales/bn.json +1387 -0
- package/locales/ca.json +1387 -0
- package/locales/cs.json +1387 -0
- package/locales/da.json +1387 -0
- package/locales/de.json +1387 -0
- package/locales/el.json +1387 -0
- package/locales/en-GB.json +27 -0
- package/locales/en.json +1386 -0
- package/locales/en.meta.json +51 -0
- package/locales/es.json +1387 -0
- package/locales/eu.json +1387 -0
- package/locales/fa.json +1388 -0
- package/locales/fi.json +1387 -0
- package/locales/fil.json +1387 -0
- package/locales/fr.json +1387 -0
- package/locales/ga.json +1387 -0
- package/locales/gl.json +1387 -0
- package/locales/gu.json +1387 -0
- package/locales/ha.json +1387 -0
- package/locales/he.json +1388 -0
- package/locales/hi.json +1387 -0
- package/locales/hr.json +1387 -0
- package/locales/hu.json +1387 -0
- package/locales/id.json +1387 -0
- package/locales/ig.json +1387 -0
- package/locales/it.json +1387 -0
- package/locales/ja.json +1387 -0
- package/locales/kn.json +1387 -0
- package/locales/ko.json +1387 -0
- package/locales/mr.json +1387 -0
- package/locales/ms.json +1387 -0
- package/locales/nb.json +1387 -0
- package/locales/nl.json +1387 -0
- package/locales/pl.json +1387 -0
- package/locales/pt.json +1387 -0
- package/locales/ro.json +1387 -0
- package/locales/ru.json +1387 -0
- package/locales/sk.json +1387 -0
- package/locales/sr.json +1387 -0
- package/locales/sv.json +1387 -0
- package/locales/ta.json +1387 -0
- package/locales/th.json +1387 -0
- package/locales/tr.json +1387 -0
- package/locales/uk.json +1387 -0
- package/locales/ur.json +1388 -0
- package/locales/vi.json +1387 -0
- package/locales/yo.json +1387 -0
- package/locales/zh-Hans.json +1387 -0
- package/locales/zh-Hant.json +1387 -0
- package/package.json +138 -5
- package/store-catalog.schema.json +78 -0
- package/theme.schema.json +4668 -0
- package/windows/installer.nsi +946 -0
- package/windows/languages/Basque.nsh +28 -0
- package/windows/languages/Catalan.nsh +28 -0
- package/windows/languages/Croatian.nsh +28 -0
- package/windows/languages/Czech.nsh +28 -0
- package/windows/languages/Danish.nsh +28 -0
- package/windows/languages/Finnish.nsh +28 -0
- package/windows/languages/Galician.nsh +28 -0
- package/windows/languages/Greek.nsh +28 -0
- package/windows/languages/Hungarian.nsh +28 -0
- package/windows/languages/Indonesian.nsh +28 -0
- package/windows/languages/Irish.nsh +28 -0
- package/windows/languages/Malay.nsh +28 -0
- package/windows/languages/Polish.nsh +28 -0
- package/windows/languages/Romanian.nsh +28 -0
- package/windows/languages/Serbian.nsh +28 -0
- package/windows/languages/Slovak.nsh +28 -0
- 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":["../../../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AAE,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,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,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,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,YAAG,CAAC,CAAC,sBAAsB,CAAC,GAAU,IACrI,EACN,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,IACnD,CAAC;AACb,CAAC","sourcesContent":["// \"Make\": build a plugin 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,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.t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C,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,uBAAa,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,uBAAa,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,IAA9B,CAAC,CAAmC,CAAC,IAAvE,CAAC,CAA4E,CAAC,GAAS,IAC7H,IAHuB,KAAK,CAGtB,CAAC;gBACf,KAAK,MAAM,CAAC,CAAC,OAAO,cAAiB,SAAS,EAAC,YAAY,eAAY,KAAK,CAAC,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;
|