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,102 @@
|
|
|
1
|
+
/** One entry of a list the bar shows with a check (themes, modes, accounts, plugins, workspaces). */
|
|
2
|
+
export type Choice = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
checked: boolean;
|
|
6
|
+
};
|
|
7
|
+
/** What the bar reflects right now. Absent lists leave their submenu out. */
|
|
8
|
+
export type NativeMenuState = {
|
|
9
|
+
product: string;
|
|
10
|
+
hasPanel: boolean;
|
|
11
|
+
canSplit: boolean;
|
|
12
|
+
canFind: boolean;
|
|
13
|
+
safeActive: boolean;
|
|
14
|
+
features: {
|
|
15
|
+
find: boolean;
|
|
16
|
+
zoom: boolean;
|
|
17
|
+
deck: boolean;
|
|
18
|
+
store: boolean;
|
|
19
|
+
safeMode: boolean;
|
|
20
|
+
workspaces: boolean;
|
|
21
|
+
updates: boolean;
|
|
22
|
+
};
|
|
23
|
+
themes?: Choice[];
|
|
24
|
+
iconPacks?: Choice[];
|
|
25
|
+
modes?: Choice[];
|
|
26
|
+
accounts: Choice[];
|
|
27
|
+
plugins?: Choice[];
|
|
28
|
+
workspaces?: Choice[];
|
|
29
|
+
/** The app can install a file chosen from a dialog, share the setup, has docs and a website. */
|
|
30
|
+
installFromFile: boolean;
|
|
31
|
+
shareSetup: boolean;
|
|
32
|
+
docs: boolean;
|
|
33
|
+
website?: string;
|
|
34
|
+
};
|
|
35
|
+
/** What a chosen id does. The controller (nativeMenu.ts) wires these to the shell. */
|
|
36
|
+
export type NativeMenuActions = {
|
|
37
|
+
about(): void;
|
|
38
|
+
checkUpdates(): void;
|
|
39
|
+
settings(): void;
|
|
40
|
+
safeMode(): void;
|
|
41
|
+
newTab(): void;
|
|
42
|
+
splitRight(): void;
|
|
43
|
+
splitDown(): void;
|
|
44
|
+
closeTab(): void;
|
|
45
|
+
installFromFile(): void;
|
|
46
|
+
shareSetup(): void;
|
|
47
|
+
find(): void;
|
|
48
|
+
findNext(): void;
|
|
49
|
+
findPrevious(): void;
|
|
50
|
+
zoomIn(): void;
|
|
51
|
+
zoomOut(): void;
|
|
52
|
+
zoomReset(): void;
|
|
53
|
+
deck(): void;
|
|
54
|
+
theme(id: string): void;
|
|
55
|
+
iconPack(id: string): void;
|
|
56
|
+
mode(id: string): void;
|
|
57
|
+
account(id: string): void;
|
|
58
|
+
addAccount(): void;
|
|
59
|
+
plugin(id: string, on: boolean): void;
|
|
60
|
+
store(): void;
|
|
61
|
+
pluginsFolder(): void;
|
|
62
|
+
workspace(id: string): void;
|
|
63
|
+
saveWorkspace(): void;
|
|
64
|
+
docs(): void;
|
|
65
|
+
report(): void;
|
|
66
|
+
website(): void;
|
|
67
|
+
};
|
|
68
|
+
type Words = (name: string, params?: Record<string, string | number>) => string;
|
|
69
|
+
type Node = {
|
|
70
|
+
kind: 'item';
|
|
71
|
+
id: string;
|
|
72
|
+
label: string;
|
|
73
|
+
accelerator?: string;
|
|
74
|
+
checked?: boolean;
|
|
75
|
+
enabled?: boolean;
|
|
76
|
+
} | {
|
|
77
|
+
kind: 'separator';
|
|
78
|
+
} | {
|
|
79
|
+
kind: 'submenu';
|
|
80
|
+
label: string;
|
|
81
|
+
items: Node[];
|
|
82
|
+
enabled?: boolean;
|
|
83
|
+
role?: 'window' | 'help';
|
|
84
|
+
} | {
|
|
85
|
+
kind: 'predefined';
|
|
86
|
+
role: string;
|
|
87
|
+
label?: string;
|
|
88
|
+
};
|
|
89
|
+
/** The description `menu_set` takes. */
|
|
90
|
+
export type NativeMenuSpec = {
|
|
91
|
+
menus: Node[];
|
|
92
|
+
};
|
|
93
|
+
/** Ids carry only their alphabet (menu.rs `valid_id`); an app's ids are folded into it. */
|
|
94
|
+
export declare const safeId: (id: string) => string;
|
|
95
|
+
/**
|
|
96
|
+
* The whole bar: App, File, Edit, View, Account, Plugins, Window, Help. `w` reads a `wb.menu.*` word,
|
|
97
|
+
* `text` a catalog key of the frame (the labels the in-app menu already uses).
|
|
98
|
+
*/
|
|
99
|
+
export declare function planNativeMenu(state: NativeMenuState, w: Words, text: (key: string) => string): NativeMenuSpec;
|
|
100
|
+
/** Runs what `id` (an id of [`planNativeMenu`]) stands for; false for an id it does not know. */
|
|
101
|
+
export declare function runNativeMenu(id: string, state: NativeMenuState, act: NativeMenuActions): boolean;
|
|
102
|
+
export {};
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
// Pure model of the native menu bar (macOS): what the shell describes to native code (`menu_set`,
|
|
2
|
+
// waybetter-host menu.rs) and which action each chosen id runs. No React, no Tauri: it is tested
|
|
3
|
+
// under node. Every item runs what the in-app menu, the palette or the keys already run; the bar
|
|
4
|
+
// adds no capability. Words are `wb.menu.*` (menuMessages.en.json) and the frame's own catalog keys.
|
|
5
|
+
/** One line, at most 120 characters (what menu.rs accepts), never empty. */
|
|
6
|
+
const clean = (label, fallback = '-') => label.replace(/[\u0000-\u001f\u007f-\u009f]+/g, ' ').trim().slice(0, 120) || fallback;
|
|
7
|
+
/** Ids carry only their alphabet (menu.rs `valid_id`); an app's ids are folded into it. */
|
|
8
|
+
export const safeId = (id) => id.replace(/[^A-Za-z0-9_.-]/g, '_').slice(0, 60);
|
|
9
|
+
const item = (id, label, rest = {}) => ({ kind: 'item', id, label: clean(label), ...rest });
|
|
10
|
+
const system = (role, label) => ({ kind: 'predefined', role, ...(label ? { label: clean(label) } : {}) });
|
|
11
|
+
const sep = { kind: 'separator' };
|
|
12
|
+
const submenu = (label, items, rest = {}) => ({ kind: 'submenu', label: clean(label), items, ...rest });
|
|
13
|
+
const choices = (prefix, list) => list.map(choice => item(`${prefix}:${safeId(choice.id)}`, choice.label, { checked: choice.checked }));
|
|
14
|
+
/** Separates non-empty groups with rules. */
|
|
15
|
+
const groups = (...parts) => parts.filter(part => part.length).flatMap((part, index) => (index ? [sep, ...part] : part));
|
|
16
|
+
/**
|
|
17
|
+
* The whole bar: App, File, Edit, View, Account, Plugins, Window, Help. `w` reads a `wb.menu.*` word,
|
|
18
|
+
* `text` a catalog key of the frame (the labels the in-app menu already uses).
|
|
19
|
+
*/
|
|
20
|
+
export function planNativeMenu(state, w, text) {
|
|
21
|
+
const { product, features } = state;
|
|
22
|
+
const app = submenu(product, groups([item('app.about', w('about', { product }))], [
|
|
23
|
+
...(features.updates ? [item('app.updates', w('appUpdates'))] : []),
|
|
24
|
+
item('app.settings', w('appSettings'), { accelerator: 'CmdOrCtrl+,' }),
|
|
25
|
+
...(features.safeMode ? [item('app.safe', w('appSafe'), { checked: state.safeActive })] : []),
|
|
26
|
+
], [system('services', w('appServices'))], [system('hide', w('appHide', { product })), system('hide_others', w('appHideOthers')), system('show_all', w('appShowAll'))], [system('quit', w('appQuit', { product }))]));
|
|
27
|
+
const file = submenu(w('barFile'), groups([item('file.new-tab', text('wb.shell.tab.new'), { accelerator: 'CmdOrCtrl+T' })], [
|
|
28
|
+
item('file.split-right', text('wb.shell.menu.splitRight'), { accelerator: 'CmdOrCtrl+\\', enabled: state.canSplit }),
|
|
29
|
+
item('file.split-down', text('wb.shell.menu.splitDown'), { accelerator: 'CmdOrCtrl+Shift+\\', enabled: state.canSplit }),
|
|
30
|
+
], [item('file.close', w('fileClose'), { accelerator: 'CmdOrCtrl+W', enabled: state.hasPanel })], [...(state.installFromFile ? [item('file.install', w('fileInstall'))] : []), ...(state.shareSetup ? [item('file.share', w('fileShare'))] : [])]));
|
|
31
|
+
const edit = submenu(w('barEdit'), groups([system('undo', w('editUndo')), system('redo', w('editRedo'))], [system('cut', w('editCut')), system('copy', w('editCopy')), system('paste', w('editPaste')), system('select_all', w('editSelectAll'))], features.find ? [
|
|
32
|
+
item('edit.find', w('editFind'), { accelerator: 'CmdOrCtrl+F', enabled: state.canFind }),
|
|
33
|
+
item('edit.find-next', w('editFindNext'), { accelerator: 'CmdOrCtrl+G', enabled: state.canFind }),
|
|
34
|
+
item('edit.find-previous', w('editFindPrevious'), { accelerator: 'CmdOrCtrl+Shift+G', enabled: state.canFind }),
|
|
35
|
+
] : []));
|
|
36
|
+
const view = submenu(w('barView'), groups(features.zoom ? [
|
|
37
|
+
item('view.zoom-in', w('viewZoomIn'), { accelerator: 'CmdOrCtrl+=' }),
|
|
38
|
+
item('view.zoom-out', w('viewZoomOut'), { accelerator: 'CmdOrCtrl+-' }),
|
|
39
|
+
item('view.zoom-reset', w('viewActual'), { accelerator: 'CmdOrCtrl+0' }),
|
|
40
|
+
] : [], [
|
|
41
|
+
...(state.themes?.length ? [submenu(w('theme'), choices('theme', state.themes))] : []),
|
|
42
|
+
...(state.iconPacks?.length ? [submenu(w('viewIconPack'), choices('icons', state.iconPacks))] : []),
|
|
43
|
+
...(state.modes?.length ? [submenu(text('wb.modes.section'), choices('mode', state.modes))] : []),
|
|
44
|
+
], features.deck ? [item('view.deck', w('viewDeck'), { accelerator: 'CmdOrCtrl+Shift+D' })] : [], [system('fullscreen', w('viewFullScreen'))]));
|
|
45
|
+
const account = submenu(w('barAccount'), groups(state.accounts.length ? choices('acct', state.accounts) : [item('acct.none', w('acctNone'), { enabled: false })], [item('acct.add', w('acctAdd'))]));
|
|
46
|
+
const plugins = submenu(w('barPlugins'), groups(state.plugins?.length ? choices('plugin', state.plugins) : [], [...(features.store ? [item('plugins.store', w('plugStore'))] : []), item('plugins.folder', w('plugFolder'))]));
|
|
47
|
+
const window = submenu(w('barWindow'), groups([system('minimize', w('winMinimize')), system('maximize', w('winZoom'))], features.workspaces ? [submenu(w('winWorkspaces'), groups(state.workspaces?.length ? choices('ws', state.workspaces) : [item('ws.none', w('noWorkspaces'), { enabled: false })], [item('ws.save', w('saveLayout'))]))] : []), { role: 'window' });
|
|
48
|
+
const help = submenu(w('barHelp'), groups(state.docs ? [item('help.docs', w('helpDocs'))] : [], [item('help.report', w('helpReport'))], state.website ? [item('help.website', state.website)] : []), { role: 'help' });
|
|
49
|
+
return { menus: [app, file, edit, view, account, plugins, window, help] };
|
|
50
|
+
}
|
|
51
|
+
/** Runs what `id` (an id of [`planNativeMenu`]) stands for; false for an id it does not know. */
|
|
52
|
+
export function runNativeMenu(id, state, act) {
|
|
53
|
+
const colon = id.indexOf(':');
|
|
54
|
+
if (colon > 0) {
|
|
55
|
+
const prefix = id.slice(0, colon);
|
|
56
|
+
const rest = id.slice(colon + 1);
|
|
57
|
+
const find = (list) => list?.find(choice => safeId(choice.id) === rest);
|
|
58
|
+
switch (prefix) {
|
|
59
|
+
case 'theme': {
|
|
60
|
+
const choice = find(state.themes);
|
|
61
|
+
if (choice) {
|
|
62
|
+
act.theme(choice.id);
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
case 'icons': {
|
|
68
|
+
const choice = find(state.iconPacks);
|
|
69
|
+
if (choice) {
|
|
70
|
+
act.iconPack(choice.id);
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
case 'mode': {
|
|
76
|
+
const choice = find(state.modes);
|
|
77
|
+
if (choice) {
|
|
78
|
+
act.mode(choice.id);
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
case 'acct': {
|
|
84
|
+
const choice = find(state.accounts);
|
|
85
|
+
if (choice) {
|
|
86
|
+
act.account(choice.id);
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
case 'plugin': {
|
|
92
|
+
const choice = find(state.plugins);
|
|
93
|
+
if (choice) {
|
|
94
|
+
act.plugin(choice.id, !choice.checked);
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
case 'ws': {
|
|
100
|
+
const choice = find(state.workspaces);
|
|
101
|
+
if (choice) {
|
|
102
|
+
act.workspace(choice.id);
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
default: return false;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
switch (id) {
|
|
111
|
+
case 'app.about':
|
|
112
|
+
act.about();
|
|
113
|
+
return true;
|
|
114
|
+
case 'app.updates':
|
|
115
|
+
act.checkUpdates();
|
|
116
|
+
return true;
|
|
117
|
+
case 'app.settings':
|
|
118
|
+
act.settings();
|
|
119
|
+
return true;
|
|
120
|
+
case 'app.safe':
|
|
121
|
+
act.safeMode();
|
|
122
|
+
return true;
|
|
123
|
+
case 'file.new-tab':
|
|
124
|
+
act.newTab();
|
|
125
|
+
return true;
|
|
126
|
+
case 'file.split-right':
|
|
127
|
+
act.splitRight();
|
|
128
|
+
return true;
|
|
129
|
+
case 'file.split-down':
|
|
130
|
+
act.splitDown();
|
|
131
|
+
return true;
|
|
132
|
+
case 'file.close':
|
|
133
|
+
act.closeTab();
|
|
134
|
+
return true;
|
|
135
|
+
case 'file.install':
|
|
136
|
+
act.installFromFile();
|
|
137
|
+
return true;
|
|
138
|
+
case 'file.share':
|
|
139
|
+
act.shareSetup();
|
|
140
|
+
return true;
|
|
141
|
+
case 'edit.find':
|
|
142
|
+
act.find();
|
|
143
|
+
return true;
|
|
144
|
+
case 'edit.find-next':
|
|
145
|
+
act.findNext();
|
|
146
|
+
return true;
|
|
147
|
+
case 'edit.find-previous':
|
|
148
|
+
act.findPrevious();
|
|
149
|
+
return true;
|
|
150
|
+
case 'view.zoom-in':
|
|
151
|
+
act.zoomIn();
|
|
152
|
+
return true;
|
|
153
|
+
case 'view.zoom-out':
|
|
154
|
+
act.zoomOut();
|
|
155
|
+
return true;
|
|
156
|
+
case 'view.zoom-reset':
|
|
157
|
+
act.zoomReset();
|
|
158
|
+
return true;
|
|
159
|
+
case 'view.deck':
|
|
160
|
+
act.deck();
|
|
161
|
+
return true;
|
|
162
|
+
case 'acct.add':
|
|
163
|
+
act.addAccount();
|
|
164
|
+
return true;
|
|
165
|
+
case 'plugins.store':
|
|
166
|
+
act.store();
|
|
167
|
+
return true;
|
|
168
|
+
case 'plugins.folder':
|
|
169
|
+
act.pluginsFolder();
|
|
170
|
+
return true;
|
|
171
|
+
case 'ws.save':
|
|
172
|
+
act.saveWorkspace();
|
|
173
|
+
return true;
|
|
174
|
+
case 'help.docs':
|
|
175
|
+
act.docs();
|
|
176
|
+
return true;
|
|
177
|
+
case 'help.report':
|
|
178
|
+
act.report();
|
|
179
|
+
return true;
|
|
180
|
+
case 'help.website':
|
|
181
|
+
act.website();
|
|
182
|
+
return true;
|
|
183
|
+
default: return false;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=nativeMenuModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeMenuModel.js","sourceRoot":"","sources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AAI,CAAC;QACjD,KAAK,WAAW;YAAE,GAAG,CAAC,IAAI,EAAE,CAAC;YAAC,OAAO,IAAI,CAAC;QAC1C,KAAK,aAAa;YAAE,GAAG,CAAC,MAAM,EAAE,CAAC;YAAC,OAAO,IAAI,CAAC;QAC9C,KAAK,cAAc;YAAE,GAAG,CAAC,OAAO,EAAE,CAAC;YAAC,OAAO,IAAI,CAAC;QAChD,OAAO,CAAC,CAAC,OAAO,KAAK,CAAC;IACxB,CAAC;AACH,CAAC","sourcesContent":["// Pure model of the native menu bar (macOS): what the shell describes to native code (`menu_set`,\n// waybetter-host menu.rs) and which action each chosen id runs. No React, no Tauri: it is tested\n// under node. Every item runs what the in-app menu, the palette or the keys already run; the bar\n// adds no capability. Words are `wb.menu.*` (menuMessages.en.json) and the frame's own catalog keys.\n\n/** One entry of a list the bar shows with a check (themes, modes, accounts, plugins, workspaces). */\nexport type Choice = { id: string; label: string; checked: boolean };\n\n/** What the bar reflects right now. Absent lists leave their submenu out. */\nexport type NativeMenuState = {\n product: string;\n hasPanel: boolean;\n canSplit: boolean;\n canFind: boolean;\n safeActive: boolean;\n features: { find: boolean; zoom: boolean; deck: boolean; store: boolean; safeMode: boolean; workspaces: boolean; updates: boolean };\n themes?: Choice[];\n iconPacks?: Choice[];\n modes?: Choice[];\n accounts: Choice[];\n plugins?: Choice[];\n workspaces?: Choice[];\n /** The app can install a file chosen from a dialog, share the setup, has docs and a website. */\n installFromFile: boolean;\n shareSetup: boolean;\n docs: boolean;\n website?: string;\n};\n\n/** What a chosen id does. The controller (nativeMenu.ts) wires these to the shell. */\nexport type NativeMenuActions = {\n about(): void;\n checkUpdates(): void;\n settings(): void;\n safeMode(): void;\n newTab(): void;\n splitRight(): void;\n splitDown(): void;\n closeTab(): void;\n installFromFile(): void;\n shareSetup(): void;\n find(): void;\n findNext(): void;\n findPrevious(): void;\n zoomIn(): void;\n zoomOut(): void;\n zoomReset(): void;\n deck(): void;\n theme(id: string): void;\n iconPack(id: string): void;\n mode(id: string): void;\n account(id: string): void;\n addAccount(): void;\n plugin(id: string, on: boolean): void;\n store(): void;\n pluginsFolder(): void;\n workspace(id: string): void;\n saveWorkspace(): void;\n docs(): void;\n report(): void;\n website(): void;\n};\n\ntype Words = (name: string, params?: Record<string, string | number>) => string;\n\ntype Node =\n | { kind: 'item'; id: string; label: string; accelerator?: string; checked?: boolean; enabled?: boolean }\n | { kind: 'separator' }\n | { kind: 'submenu'; label: string; items: Node[]; enabled?: boolean; role?: 'window' | 'help' }\n | { kind: 'predefined'; role: string; label?: string };\n\n/** The description `menu_set` takes. */\nexport type NativeMenuSpec = { menus: Node[] };\n\n/** One line, at most 120 characters (what menu.rs accepts), never empty. */\nconst clean = (label: string, fallback = '-') => label.replace(/[\\u0000-\\u001f\\u007f-\\u009f]+/g, ' ').trim().slice(0, 120) || fallback;\n/** Ids carry only their alphabet (menu.rs `valid_id`); an app's ids are folded into it. */\nexport const safeId = (id: string) => id.replace(/[^A-Za-z0-9_.-]/g, '_').slice(0, 60);\n\nconst item = (id: string, label: string, rest: { accelerator?: string; checked?: boolean; enabled?: boolean } = {}): Node => ({ kind: 'item', id, label: clean(label), ...rest });\nconst system = (role: string, label?: string): Node => ({ kind: 'predefined', role, ...(label ? { label: clean(label) } : {}) });\nconst sep: Node = { kind: 'separator' };\nconst submenu = (label: string, items: Node[], rest: { enabled?: boolean; role?: 'window' | 'help' } = {}): Node => ({ kind: 'submenu', label: clean(label), items, ...rest });\nconst choices = (prefix: string, list: readonly Choice[]): Node[] => list.map(choice => item(`${prefix}:${safeId(choice.id)}`, choice.label, { checked: choice.checked }));\n\n/** Separates non-empty groups with rules. */\nconst groups = (...parts: Node[][]): Node[] => parts.filter(part => part.length).flatMap((part, index) => (index ? [sep, ...part] : part));\n\n/**\n * The whole bar: App, File, Edit, View, Account, Plugins, Window, Help. `w` reads a `wb.menu.*` word,\n * `text` a catalog key of the frame (the labels the in-app menu already uses).\n */\nexport function planNativeMenu(state: NativeMenuState, w: Words, text: (key: string) => string): NativeMenuSpec {\n const { product, features } = state;\n const app = submenu(product, groups(\n [item('app.about', w('about', { product }))],\n [\n ...(features.updates ? [item('app.updates', w('appUpdates'))] : []),\n item('app.settings', w('appSettings'), { accelerator: 'CmdOrCtrl+,' }),\n ...(features.safeMode ? [item('app.safe', w('appSafe'), { checked: state.safeActive })] : []),\n ],\n [system('services', w('appServices'))],\n [system('hide', w('appHide', { product })), system('hide_others', w('appHideOthers')), system('show_all', w('appShowAll'))],\n [system('quit', w('appQuit', { product }))],\n ));\n const file = submenu(w('barFile'), groups(\n [item('file.new-tab', text('wb.shell.tab.new'), { accelerator: 'CmdOrCtrl+T' })],\n [\n item('file.split-right', text('wb.shell.menu.splitRight'), { accelerator: 'CmdOrCtrl+\\\\', enabled: state.canSplit }),\n item('file.split-down', text('wb.shell.menu.splitDown'), { accelerator: 'CmdOrCtrl+Shift+\\\\', enabled: state.canSplit }),\n ],\n [item('file.close', w('fileClose'), { accelerator: 'CmdOrCtrl+W', enabled: state.hasPanel })],\n [...(state.installFromFile ? [item('file.install', w('fileInstall'))] : []), ...(state.shareSetup ? [item('file.share', w('fileShare'))] : [])],\n ));\n const edit = submenu(w('barEdit'), groups(\n [system('undo', w('editUndo')), system('redo', w('editRedo'))],\n [system('cut', w('editCut')), system('copy', w('editCopy')), system('paste', w('editPaste')), system('select_all', w('editSelectAll'))],\n features.find ? [\n item('edit.find', w('editFind'), { accelerator: 'CmdOrCtrl+F', enabled: state.canFind }),\n item('edit.find-next', w('editFindNext'), { accelerator: 'CmdOrCtrl+G', enabled: state.canFind }),\n item('edit.find-previous', w('editFindPrevious'), { accelerator: 'CmdOrCtrl+Shift+G', enabled: state.canFind }),\n ] : [],\n ));\n const view = submenu(w('barView'), groups(\n features.zoom ? [\n item('view.zoom-in', w('viewZoomIn'), { accelerator: 'CmdOrCtrl+=' }),\n item('view.zoom-out', w('viewZoomOut'), { accelerator: 'CmdOrCtrl+-' }),\n item('view.zoom-reset', w('viewActual'), { accelerator: 'CmdOrCtrl+0' }),\n ] : [],\n [\n ...(state.themes?.length ? [submenu(w('theme'), choices('theme', state.themes))] : []),\n ...(state.iconPacks?.length ? [submenu(w('viewIconPack'), choices('icons', state.iconPacks))] : []),\n ...(state.modes?.length ? [submenu(text('wb.modes.section'), choices('mode', state.modes))] : []),\n ],\n features.deck ? [item('view.deck', w('viewDeck'), { accelerator: 'CmdOrCtrl+Shift+D' })] : [],\n [system('fullscreen', w('viewFullScreen'))],\n ));\n const account = submenu(w('barAccount'), groups(\n state.accounts.length ? choices('acct', state.accounts) : [item('acct.none', w('acctNone'), { enabled: false })],\n [item('acct.add', w('acctAdd'))],\n ));\n const plugins = submenu(w('barPlugins'), groups(\n state.plugins?.length ? choices('plugin', state.plugins) : [],\n [...(features.store ? [item('plugins.store', w('plugStore'))] : []), item('plugins.folder', w('plugFolder'))],\n ));\n const window = submenu(w('barWindow'), groups(\n [system('minimize', w('winMinimize')), system('maximize', w('winZoom'))],\n features.workspaces ? [submenu(w('winWorkspaces'), groups(\n state.workspaces?.length ? choices('ws', state.workspaces) : [item('ws.none', w('noWorkspaces'), { enabled: false })],\n [item('ws.save', w('saveLayout'))],\n ))] : [],\n ), { role: 'window' });\n const help = submenu(w('barHelp'), groups(\n state.docs ? [item('help.docs', w('helpDocs'))] : [],\n [item('help.report', w('helpReport'))],\n state.website ? [item('help.website', state.website)] : [],\n ), { role: 'help' });\n return { menus: [app, file, edit, view, account, plugins, window, help] };\n}\n\n/** Runs what `id` (an id of [`planNativeMenu`]) stands for; false for an id it does not know. */\nexport function runNativeMenu(id: string, state: NativeMenuState, act: NativeMenuActions): boolean {\n const colon = id.indexOf(':');\n if (colon > 0) {\n const prefix = id.slice(0, colon);\n const rest = id.slice(colon + 1);\n const find = (list?: readonly Choice[]) => list?.find(choice => safeId(choice.id) === rest);\n switch (prefix) {\n case 'theme': { const choice = find(state.themes); if (choice) { act.theme(choice.id); return true; } return false; }\n case 'icons': { const choice = find(state.iconPacks); if (choice) { act.iconPack(choice.id); return true; } return false; }\n case 'mode': { const choice = find(state.modes); if (choice) { act.mode(choice.id); return true; } return false; }\n case 'acct': { const choice = find(state.accounts); if (choice) { act.account(choice.id); return true; } return false; }\n case 'plugin': { const choice = find(state.plugins); if (choice) { act.plugin(choice.id, !choice.checked); return true; } return false; }\n case 'ws': { const choice = find(state.workspaces); if (choice) { act.workspace(choice.id); return true; } return false; }\n default: return false;\n }\n }\n switch (id) {\n case 'app.about': act.about(); return true;\n case 'app.updates': act.checkUpdates(); return true;\n case 'app.settings': act.settings(); return true;\n case 'app.safe': act.safeMode(); return true;\n case 'file.new-tab': act.newTab(); return true;\n case 'file.split-right': act.splitRight(); return true;\n case 'file.split-down': act.splitDown(); return true;\n case 'file.close': act.closeTab(); return true;\n case 'file.install': act.installFromFile(); return true;\n case 'file.share': act.shareSetup(); return true;\n case 'edit.find': act.find(); return true;\n case 'edit.find-next': act.findNext(); return true;\n case 'edit.find-previous': act.findPrevious(); return true;\n case 'view.zoom-in': act.zoomIn(); return true;\n case 'view.zoom-out': act.zoomOut(); return true;\n case 'view.zoom-reset': act.zoomReset(); return true;\n case 'view.deck': act.deck(); return true;\n case 'acct.add': act.addAccount(); return true;\n case 'plugins.store': act.store(); return true;\n case 'plugins.folder': act.pluginsFolder(); return true;\n case 'ws.save': act.saveWorkspace(); return true;\n case 'help.docs': act.docs(); return true;\n case 'help.report': act.report(); return true;\n case 'help.website': act.website(); return true;\n default: return false;\n }\n}\n"]}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { IconName } from './icons.tsx';
|
|
2
|
+
import type { PaletteSite } from './site.ts';
|
|
3
|
+
export { fuzzyScore, moveSelection } from '../palette.ts';
|
|
4
|
+
export type PaletteAction = {
|
|
5
|
+
type: 'focus-tab';
|
|
6
|
+
id: string;
|
|
7
|
+
} | {
|
|
8
|
+
type: 'new-tab';
|
|
9
|
+
profile: string;
|
|
10
|
+
} | {
|
|
11
|
+
type: 'panel';
|
|
12
|
+
section: string;
|
|
13
|
+
} | {
|
|
14
|
+
type: 'open';
|
|
15
|
+
url: string;
|
|
16
|
+
} | {
|
|
17
|
+
type: 'media';
|
|
18
|
+
}
|
|
19
|
+
/** Decks (navigation only): open a deck, make a new one, add or focus a column. */
|
|
20
|
+
| {
|
|
21
|
+
type: 'deck';
|
|
22
|
+
deckId?: string;
|
|
23
|
+
} | {
|
|
24
|
+
type: 'deck-new';
|
|
25
|
+
} | {
|
|
26
|
+
type: 'deck-add';
|
|
27
|
+
deckId: string;
|
|
28
|
+
} | {
|
|
29
|
+
type: 'deck-focus';
|
|
30
|
+
deckId: string;
|
|
31
|
+
columnId: string;
|
|
32
|
+
}
|
|
33
|
+
/** Replaces the palette query (a completion); never navigates. */
|
|
34
|
+
| {
|
|
35
|
+
type: 'complete';
|
|
36
|
+
text: string;
|
|
37
|
+
}
|
|
38
|
+
/** A plugin's command: the shell asks tab `tab` to run it in its page (`tab_run_command`). */
|
|
39
|
+
| {
|
|
40
|
+
type: 'plugin-command';
|
|
41
|
+
tab: string;
|
|
42
|
+
command: string;
|
|
43
|
+
}
|
|
44
|
+
/** Workspaces: restore one, or save the current layout under a name. */
|
|
45
|
+
| {
|
|
46
|
+
type: 'workspace';
|
|
47
|
+
id: string;
|
|
48
|
+
} | {
|
|
49
|
+
type: 'workspace-save';
|
|
50
|
+
}
|
|
51
|
+
/** Opens the app menu (the titlebar's "Settings and more"). */
|
|
52
|
+
| {
|
|
53
|
+
type: 'menu';
|
|
54
|
+
}
|
|
55
|
+
/** Opens the find bar of the tab in front. */
|
|
56
|
+
| {
|
|
57
|
+
type: 'find';
|
|
58
|
+
};
|
|
59
|
+
/** The frame's groups; the app's items are grouped under its product name, plugin commands under the plugin's. */
|
|
60
|
+
export type PaletteGroup = 'Tabs' | 'Deck' | 'Workspaces' | 'Profiles';
|
|
61
|
+
export type PaletteItem = {
|
|
62
|
+
id: string;
|
|
63
|
+
/** A fixed group, the site's group, or a plugin's name for its commands. */
|
|
64
|
+
group: PaletteGroup | (string & {});
|
|
65
|
+
label: string;
|
|
66
|
+
hint?: string;
|
|
67
|
+
keywords?: string;
|
|
68
|
+
/** The row's glyph (tabs show their favicon, profiles their avatar). */
|
|
69
|
+
icon?: IconName;
|
|
70
|
+
action: PaletteAction;
|
|
71
|
+
};
|
|
72
|
+
export type PaletteContext = {
|
|
73
|
+
/** `favicon` and `color` only decorate the list; matching ignores them. */
|
|
74
|
+
tabs: Array<{
|
|
75
|
+
id: string;
|
|
76
|
+
title: string;
|
|
77
|
+
url: string;
|
|
78
|
+
favicon?: string;
|
|
79
|
+
}>;
|
|
80
|
+
profiles: Array<{
|
|
81
|
+
id: string;
|
|
82
|
+
name: string;
|
|
83
|
+
color?: string;
|
|
84
|
+
}>;
|
|
85
|
+
activeProfile: string;
|
|
86
|
+
/** Decks and their columns (titles only); absent when the app has no decks. */
|
|
87
|
+
decks?: Array<{
|
|
88
|
+
id: string;
|
|
89
|
+
name: string;
|
|
90
|
+
columns: Array<{
|
|
91
|
+
id: string;
|
|
92
|
+
title: string;
|
|
93
|
+
profile: string;
|
|
94
|
+
}>;
|
|
95
|
+
}>;
|
|
96
|
+
/** The deck tab in front, if any. */
|
|
97
|
+
activeDeck?: string;
|
|
98
|
+
/** Saved workspaces (names only) and the one opened last. */
|
|
99
|
+
workspaces?: Array<{
|
|
100
|
+
id: string;
|
|
101
|
+
name: string;
|
|
102
|
+
tabs: number;
|
|
103
|
+
isDefault?: boolean;
|
|
104
|
+
}>;
|
|
105
|
+
activeWorkspace?: string;
|
|
106
|
+
/** Plugin commands of the focused site tab, already named by plugin (`pluginCommandItems`). */
|
|
107
|
+
commands?: {
|
|
108
|
+
tab: string;
|
|
109
|
+
items: PluginCommandItem[];
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
/** What the palette knows about the app: its site items, its name and which frame features it has. */
|
|
113
|
+
export type PaletteSetup = {
|
|
114
|
+
site: PaletteSite;
|
|
115
|
+
product: string;
|
|
116
|
+
decks: boolean;
|
|
117
|
+
media: boolean;
|
|
118
|
+
workspaces?: boolean;
|
|
119
|
+
find?: boolean;
|
|
120
|
+
};
|
|
121
|
+
/** A plugin command as the palette lists it: the tab's report plus the plugin's display name. */
|
|
122
|
+
export type PluginCommandItem = {
|
|
123
|
+
id: string;
|
|
124
|
+
title: string;
|
|
125
|
+
keywords: string;
|
|
126
|
+
plugin: string;
|
|
127
|
+
};
|
|
128
|
+
/** Commands at most listed from one tab (the runtime and native code cap them too). */
|
|
129
|
+
export declare const MAX_PLUGIN_COMMANDS = 48;
|
|
130
|
+
/**
|
|
131
|
+
* Names each reported command (`<file>:<id>`) after its plugin (`@name` from the Plugins list);
|
|
132
|
+
* commands registered outside a plugin's start are listed under "Plugins". Bounded.
|
|
133
|
+
*/
|
|
134
|
+
export declare function pluginCommandItems(reported: ReadonlyArray<{
|
|
135
|
+
id: string;
|
|
136
|
+
title: string;
|
|
137
|
+
keywords?: string;
|
|
138
|
+
}>, pluginNames: Readonly<Record<string, string>>): PluginCommandItem[];
|
|
139
|
+
export declare function buildItems(context: PaletteContext, query: string, setup: PaletteSetup): PaletteItem[];
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// Pure model for the command palette (no Tauri/DOM imports, so it is unit-tested under node).
|
|
2
|
+
// Every item is navigation only: tabs are focused, profiles open a tab, decks and workspaces open,
|
|
3
|
+
// the app's panel opens at a section, plugin commands run in their tab; the site adds its own
|
|
4
|
+
// pages and completions (`site.palette`). Nothing here performs an account action on the user's behalf.
|
|
5
|
+
import { rankItems } from "../palette.js";
|
|
6
|
+
import { os } from "../windowControls.js";
|
|
7
|
+
import { t } from "./i18n.js";
|
|
8
|
+
import { mediaShortcutLabel } from "./mediaModel.js";
|
|
9
|
+
import { menuText } from "./menuModel.js";
|
|
10
|
+
export { fuzzyScore, moveSelection } from "../palette.js";
|
|
11
|
+
/** Commands at most listed from one tab (the runtime and native code cap them too). */
|
|
12
|
+
export const MAX_PLUGIN_COMMANDS = 48;
|
|
13
|
+
/**
|
|
14
|
+
* Names each reported command (`<file>:<id>`) after its plugin (`@name` from the Plugins list);
|
|
15
|
+
* commands registered outside a plugin's start are listed under "Plugins". Bounded.
|
|
16
|
+
*/
|
|
17
|
+
export function pluginCommandItems(reported, pluginNames) {
|
|
18
|
+
const out = [];
|
|
19
|
+
for (const command of reported) {
|
|
20
|
+
if (out.length >= MAX_PLUGIN_COMMANDS)
|
|
21
|
+
break;
|
|
22
|
+
if (typeof command?.id !== 'string' || typeof command.title !== 'string')
|
|
23
|
+
continue;
|
|
24
|
+
const at = command.id.indexOf(':');
|
|
25
|
+
if (at <= 0)
|
|
26
|
+
continue;
|
|
27
|
+
const owner = command.id.slice(0, at);
|
|
28
|
+
const plugin = (owner !== '_' && pluginNames[owner]) || (owner === '_' ? t('wb.palette.plugins') : owner.replace(/\.plugin\.js$/, ''));
|
|
29
|
+
out.push({ id: command.id, title: command.title.slice(0, 80), keywords: (command.keywords ?? '').slice(0, 160), plugin });
|
|
30
|
+
}
|
|
31
|
+
return out;
|
|
32
|
+
}
|
|
33
|
+
/** The "Workspaces" group: switch to a saved workspace, save the current layout. */
|
|
34
|
+
function workspaceItems(context) {
|
|
35
|
+
const items = [];
|
|
36
|
+
for (const workspace of context.workspaces ?? []) {
|
|
37
|
+
items.push({
|
|
38
|
+
id: `ws:${workspace.id}`, group: 'Workspaces', label: t('wb.palette.switchTo', { name: workspace.name }),
|
|
39
|
+
hint: workspace.id === context.activeWorkspace ? t('wb.palette.active') : `${t('wb.ws.tabs', { count: workspace.tabs })}${workspace.isDefault ? ` · ${t('wb.palette.onStart')}` : ''}`,
|
|
40
|
+
keywords: 'workspace layout restore session switch', action: { type: 'workspace', id: workspace.id },
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
items.push({ id: 'ws-save', group: 'Workspaces', label: t('wb.ws.save'), keywords: 'workspace layout save session tabs panes', action: { type: 'workspace-save' } });
|
|
44
|
+
return items;
|
|
45
|
+
}
|
|
46
|
+
/** The "Deck" group: open/switch decks, add a column, focus a column of the active deck. */
|
|
47
|
+
function deckItems(context) {
|
|
48
|
+
const decks = context.decks ?? [];
|
|
49
|
+
const items = [];
|
|
50
|
+
const active = decks.find(deck => deck.id === context.activeDeck);
|
|
51
|
+
if (!decks.length) {
|
|
52
|
+
items.push({ id: 'deck:open', group: 'Deck', label: t('wb.palette.openPower'), hint: 'Ctrl+Shift+D', keywords: 'deck tweetdeck columns power user', action: { type: 'deck' } });
|
|
53
|
+
return items;
|
|
54
|
+
}
|
|
55
|
+
for (const deck of decks) {
|
|
56
|
+
if (deck.id === active?.id)
|
|
57
|
+
continue;
|
|
58
|
+
items.push({ id: `deck:${deck.id}`, group: 'Deck', label: t('wb.palette.switchTo', { name: deck.name }), hint: t('wb.deck.columnCount', { count: deck.columns.length }), keywords: 'deck tweetdeck columns power user switch', action: { type: 'deck', deckId: deck.id } });
|
|
59
|
+
}
|
|
60
|
+
const target = active ?? decks[0];
|
|
61
|
+
items.push({ id: `deck-add:${target.id}`, group: 'Deck', label: t('wb.palette.addColumn'), hint: target.name, keywords: 'deck column new tweetdeck', action: { type: 'deck-add', deckId: target.id } });
|
|
62
|
+
if (active) {
|
|
63
|
+
active.columns.forEach((column, index) => {
|
|
64
|
+
items.push({ id: `deck-focus:${column.id}`, group: 'Deck', label: t('wb.palette.focusColumn', { name: column.title }), hint: index < 9 ? `Alt+${index + 1}` : undefined, keywords: 'column deck', action: { type: 'deck-focus', deckId: active.id, columnId: column.id } });
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
items.push({ id: 'deck-new', group: 'Deck', label: t('wb.palette.newDeck'), keywords: 'deck columns power user create', action: { type: 'deck-new' } });
|
|
68
|
+
return items;
|
|
69
|
+
}
|
|
70
|
+
export function buildItems(context, query, setup) {
|
|
71
|
+
const { site } = setup;
|
|
72
|
+
const items = [];
|
|
73
|
+
const text = query.trim();
|
|
74
|
+
const search = text ? site.search?.(text) ?? null : null;
|
|
75
|
+
if (search)
|
|
76
|
+
items.push(search);
|
|
77
|
+
for (const tab of context.tabs) {
|
|
78
|
+
items.push({ id: `tab:${tab.id}`, group: 'Tabs', label: tab.title || tab.url, hint: tab.url, keywords: tab.url, action: { type: 'focus-tab', id: tab.id } });
|
|
79
|
+
}
|
|
80
|
+
if (setup.decks)
|
|
81
|
+
items.push(...deckItems(context));
|
|
82
|
+
if (setup.workspaces !== false)
|
|
83
|
+
items.push(...workspaceItems(context));
|
|
84
|
+
for (const profile of context.profiles) {
|
|
85
|
+
items.push({ id: `profile:${profile.id}`, group: 'Profiles', label: t('wb.palette.newTabAs', { name: profile.name }), hint: profile.id === context.activeProfile ? t('wb.palette.active') : undefined, keywords: 'account switch', action: { type: 'new-tab', profile: profile.id } });
|
|
86
|
+
}
|
|
87
|
+
for (const section of site.sections) {
|
|
88
|
+
items.push({ id: `panel:${section.id}`, group: setup.product, label: section.label(), keywords: section.keywords, icon: section.icon, action: { type: 'panel', section: section.id } });
|
|
89
|
+
}
|
|
90
|
+
if (setup.media)
|
|
91
|
+
items.push({ id: 'media', group: setup.product, label: t('wb.palette.media'), hint: mediaShortcutLabel(os), keywords: 'photos images screenshots attach paste media', icon: 'image', action: { type: 'media' } });
|
|
92
|
+
// Find in the page of the tab in front (the shell's find bar; nothing is sent anywhere).
|
|
93
|
+
if (setup.find !== false)
|
|
94
|
+
items.push({ id: 'find', group: setup.product, label: menuText('find'), hint: 'Ctrl+F', keywords: 'find search page text match', icon: 'search', action: { type: 'find' } });
|
|
95
|
+
// The app menu (the titlebar's "Settings and more"): language, theme, mode, zoom and the rest.
|
|
96
|
+
items.push({ id: 'app-menu', group: setup.product, label: menuText('label'), hint: 'Alt+F', keywords: 'menu more settings language theme mode zoom options preferences', icon: 'settings', action: { type: 'menu' } });
|
|
97
|
+
// Plugin commands, grouped under each plugin's name; they run in the focused site tab.
|
|
98
|
+
if (context.commands) {
|
|
99
|
+
const { tab } = context.commands;
|
|
100
|
+
// One heading per plugin: stable sort keeps each plugin's own order.
|
|
101
|
+
const sorted = context.commands.items.slice(0, MAX_PLUGIN_COMMANDS).sort((a, b) => a.plugin.localeCompare(b.plugin));
|
|
102
|
+
for (const command of sorted) {
|
|
103
|
+
items.push({ id: `cmd:${command.id}`, group: command.plugin, label: command.title, keywords: `${command.plugin} plugin ${command.keywords}`, icon: 'bolt', action: { type: 'plugin-command', tab, command: command.id } });
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
items.push(...site.items?.() ?? []);
|
|
107
|
+
if (!text)
|
|
108
|
+
return items;
|
|
109
|
+
const completions = site.completions?.(query.replace(/^\s+/, '')) ?? [];
|
|
110
|
+
const scored = rankItems(items, text, item => item === search);
|
|
111
|
+
// The literal search stays available as the last resort.
|
|
112
|
+
return search ? [...completions, ...scored, search] : [...completions, ...scored];
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=paletteModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paletteModel.js","sourceRoot":"","sources":["../../../../../../shell/src/frame/paletteModel.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,mGAAmG;AACnG,8FAA8F;AAC9F,wGAAwG;AAExG,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAC;AAE9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AA8D1D,uFAAuF;AACvF,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAEtC;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAyE,EAAE,WAA6C;IACzJ,MAAM,GAAG,GAAwB,EAAE,CAAC;IACpC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAA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EAAE,GAAG,MAAM,CAAC,CAAC;AACpF,CAAC","sourcesContent":["// Pure model for the command palette (no Tauri/DOM imports, so it is unit-tested under node).\n// Every item is navigation only: tabs are focused, profiles open a tab, decks and workspaces open,\n// the app's panel opens at a section, plugin commands run in their tab; the site adds its own\n// pages and completions (`site.palette`). Nothing here performs an account action on the user's behalf.\n\nimport { rankItems } from '../palette.ts';\nimport { os } from '../windowControls.ts';\nimport { t } from './i18n.ts';\nimport type { IconName } from './icons.tsx';\nimport { mediaShortcutLabel } from './mediaModel.ts';\nimport { menuText } from './menuModel.ts';\nimport type { PaletteSite } from './site.ts';\n\nexport { fuzzyScore, moveSelection } from '../palette.ts';\n\nexport type PaletteAction =\n | { type: 'focus-tab'; id: string }\n | { type: 'new-tab'; profile: string }\n | { type: 'panel'; section: string }\n | { type: 'open'; url: string }\n | { type: 'media' }\n /** Decks (navigation only): open a deck, make a new one, add or focus a column. */\n | { type: 'deck'; deckId?: string }\n | { type: 'deck-new' }\n | { type: 'deck-add'; deckId: string }\n | { type: 'deck-focus'; deckId: string; columnId: string }\n /** Replaces the palette query (a completion); never navigates. */\n | { type: 'complete'; text: string }\n /** A plugin's command: the shell asks tab `tab` to run it in its page (`tab_run_command`). */\n | { type: 'plugin-command'; tab: string; command: string }\n /** Workspaces: restore one, or save the current layout under a name. */\n | { type: 'workspace'; id: string }\n | { type: 'workspace-save' }\n /** Opens the app menu (the titlebar's \"Settings and more\"). */\n | { type: 'menu' }\n /** Opens the find bar of the tab in front. */\n | { type: 'find' };\n\n/** The frame's groups; the app's items are grouped under its product name, plugin commands under the plugin's. */\nexport type PaletteGroup = 'Tabs' | 'Deck' | 'Workspaces' | 'Profiles';\n\nexport type PaletteItem = {\n id: string;\n /** A fixed group, the site's group, or a plugin's name for its commands. */\n group: PaletteGroup | (string & {});\n label: string;\n hint?: string;\n keywords?: string;\n /** The row's glyph (tabs show their favicon, profiles their avatar). */\n icon?: IconName;\n action: PaletteAction;\n};\n\nexport type PaletteContext = {\n /** `favicon` and `color` only decorate the list; matching ignores them. */\n tabs: Array<{ id: string; title: string; url: string; favicon?: string }>;\n profiles: Array<{ id: string; name: string; color?: string }>;\n activeProfile: string;\n /** Decks and their columns (titles only); absent when the app has no decks. */\n decks?: Array<{ id: string; name: string; columns: Array<{ id: string; title: string; profile: string }> }>;\n /** The deck tab in front, if any. */\n activeDeck?: string;\n /** Saved workspaces (names only) and the one opened last. */\n workspaces?: Array<{ id: string; name: string; tabs: number; isDefault?: boolean }>;\n activeWorkspace?: string;\n /** Plugin commands of the focused site tab, already named by plugin (`pluginCommandItems`). */\n commands?: { tab: string; items: PluginCommandItem[] };\n};\n\n/** What the palette knows about the app: its site items, its name and which frame features it has. */\nexport type PaletteSetup = { site: PaletteSite; product: string; decks: boolean; media: boolean; workspaces?: boolean; find?: boolean };\n\n/** A plugin command as the palette lists it: the tab's report plus the plugin's display name. */\nexport type PluginCommandItem = { id: string; title: string; keywords: string; plugin: string };\n\n/** Commands at most listed from one tab (the runtime and native code cap them too). */\nexport const MAX_PLUGIN_COMMANDS = 48;\n\n/**\n * Names each reported command (`<file>:<id>`) after its plugin (`@name` from the Plugins list);\n * commands registered outside a plugin's start are listed under \"Plugins\". Bounded.\n */\nexport function pluginCommandItems(reported: ReadonlyArray<{ id: string; title: string; keywords?: string }>, pluginNames: Readonly<Record<string, string>>): PluginCommandItem[] {\n const out: PluginCommandItem[] = [];\n for (const command of reported) {\n if (out.length >= MAX_PLUGIN_COMMANDS) break;\n if (typeof command?.id !== 'string' || typeof command.title !== 'string') continue;\n const at = command.id.indexOf(':');\n if (at <= 0) continue;\n const owner = command.id.slice(0, at);\n const plugin = (owner !== '_' && pluginNames[owner]) || (owner === '_' ? t('wb.palette.plugins') : owner.replace(/\\.plugin\\.js$/, ''));\n out.push({ id: command.id, title: command.title.slice(0, 80), keywords: (command.keywords ?? '').slice(0, 160), plugin });\n }\n return out;\n}\n\n/** The \"Workspaces\" group: switch to a saved workspace, save the current layout. */\nfunction workspaceItems(context: PaletteContext): PaletteItem[] {\n const items: PaletteItem[] = [];\n for (const workspace of context.workspaces ?? []) {\n items.push({\n id: `ws:${workspace.id}`, group: 'Workspaces', label: t('wb.palette.switchTo', { name: workspace.name }),\n hint: workspace.id === context.activeWorkspace ? t('wb.palette.active') : `${t('wb.ws.tabs', { count: workspace.tabs })}${workspace.isDefault ? ` · ${t('wb.palette.onStart')}` : ''}`,\n keywords: 'workspace layout restore session switch', action: { type: 'workspace', id: workspace.id },\n });\n }\n items.push({ id: 'ws-save', group: 'Workspaces', label: t('wb.ws.save'), keywords: 'workspace layout save session tabs panes', action: { type: 'workspace-save' } });\n return items;\n}\n\n/** The \"Deck\" group: open/switch decks, add a column, focus a column of the active deck. */\nfunction deckItems(context: PaletteContext): PaletteItem[] {\n const decks = context.decks ?? [];\n const items: PaletteItem[] = [];\n const active = decks.find(deck => deck.id === context.activeDeck);\n if (!decks.length) {\n items.push({ id: 'deck:open', group: 'Deck', label: t('wb.palette.openPower'), hint: 'Ctrl+Shift+D', keywords: 'deck tweetdeck columns power user', action: { type: 'deck' } });\n return items;\n }\n for (const deck of decks) {\n if (deck.id === active?.id) continue;\n items.push({ id: `deck:${deck.id}`, group: 'Deck', label: t('wb.palette.switchTo', { name: deck.name }), hint: t('wb.deck.columnCount', { count: deck.columns.length }), keywords: 'deck tweetdeck columns power user switch', action: { type: 'deck', deckId: deck.id } });\n }\n const target = active ?? decks[0]!;\n items.push({ id: `deck-add:${target.id}`, group: 'Deck', label: t('wb.palette.addColumn'), hint: target.name, keywords: 'deck column new tweetdeck', action: { type: 'deck-add', deckId: target.id } });\n if (active) {\n active.columns.forEach((column, index) => {\n items.push({ id: `deck-focus:${column.id}`, group: 'Deck', label: t('wb.palette.focusColumn', { name: column.title }), hint: index < 9 ? `Alt+${index + 1}` : undefined, keywords: 'column deck', action: { type: 'deck-focus', deckId: active.id, columnId: column.id } });\n });\n }\n items.push({ id: 'deck-new', group: 'Deck', label: t('wb.palette.newDeck'), keywords: 'deck columns power user create', action: { type: 'deck-new' } });\n return items;\n}\n\nexport function buildItems(context: PaletteContext, query: string, setup: PaletteSetup): PaletteItem[] {\n const { site } = setup;\n const items: PaletteItem[] = [];\n const text = query.trim();\n const search = text ? site.search?.(text) ?? null : null;\n if (search) items.push(search);\n for (const tab of context.tabs) {\n items.push({ id: `tab:${tab.id}`, group: 'Tabs', label: tab.title || tab.url, hint: tab.url, keywords: tab.url, action: { type: 'focus-tab', id: tab.id } });\n }\n if (setup.decks) items.push(...deckItems(context));\n if (setup.workspaces !== false) items.push(...workspaceItems(context));\n for (const profile of context.profiles) {\n items.push({ id: `profile:${profile.id}`, group: 'Profiles', label: t('wb.palette.newTabAs', { name: profile.name }), hint: profile.id === context.activeProfile ? t('wb.palette.active') : undefined, keywords: 'account switch', action: { type: 'new-tab', profile: profile.id } });\n }\n for (const section of site.sections) {\n items.push({ id: `panel:${section.id}`, group: setup.product, label: section.label(), keywords: section.keywords, icon: section.icon, action: { type: 'panel', section: section.id } });\n }\n if (setup.media) items.push({ id: 'media', group: setup.product, label: t('wb.palette.media'), hint: mediaShortcutLabel(os), keywords: 'photos images screenshots attach paste media', icon: 'image', action: { type: 'media' } });\n // Find in the page of the tab in front (the shell's find bar; nothing is sent anywhere).\n if (setup.find !== false) items.push({ id: 'find', group: setup.product, label: menuText('find'), hint: 'Ctrl+F', keywords: 'find search page text match', icon: 'search', action: { type: 'find' } });\n // The app menu (the titlebar's \"Settings and more\"): language, theme, mode, zoom and the rest.\n items.push({ id: 'app-menu', group: setup.product, label: menuText('label'), hint: 'Alt+F', keywords: 'menu more settings language theme mode zoom options preferences', icon: 'settings', action: { type: 'menu' } });\n // Plugin commands, grouped under each plugin's name; they run in the focused site tab.\n if (context.commands) {\n const { tab } = context.commands;\n // One heading per plugin: stable sort keeps each plugin's own order.\n const sorted = context.commands.items.slice(0, MAX_PLUGIN_COMMANDS).sort((a, b) => a.plugin.localeCompare(b.plugin));\n for (const command of sorted) {\n items.push({ id: `cmd:${command.id}`, group: command.plugin, label: command.title, keywords: `${command.plugin} plugin ${command.keywords}`, icon: 'bolt', action: { type: 'plugin-command', tab, command: command.id } });\n }\n }\n items.push(...site.items?.() ?? []);\n if (!text) return items;\n const completions = site.completions?.(query.replace(/^\\s+/, '')) ?? [];\n const scored = rankItems(items, text, item => item === search);\n // The literal search stays available as the last resort.\n return search ? [...completions, ...scored, search] : [...completions, ...scored];\n}\n\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* Theme swatches (page, text, accent) and the "Theme for this pane" menu. */
|
|
2
|
+
.wb-dots { display: inline-flex; align-items: center; gap: 3px; flex: none; height: 18px; padding: 0 5px; border-radius: calc(6px * var(--bt-rs, 1)); box-shadow: inset 0 0 0 1px rgb(127 127 127 / .28); }
|
|
3
|
+
.wb-dots i { width: 7px; height: 7px; border-radius: 50%; }
|
|
4
|
+
.wb-pane-menu { width: 272px; }
|
|
5
|
+
.wb-pane-menu-head { display: flex; align-items: center; gap: 8px; padding: 7px 10px 6px; color: var(--bt-muted); font: 600 11px/1 var(--bt-ui); letter-spacing: .04em; text-transform: uppercase; }
|
|
6
|
+
.wb-pane-menu-head .bt-glyph { width: 14px; height: 14px; }
|
|
7
|
+
.wb-pane-menu-list { display: flex; flex-direction: column; gap: 1px; max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
|
|
8
|
+
.wb-pane-menu small { color: var(--bt-muted); font-weight: 450; }
|
|
9
|
+
.wb-pane-menu button > .bt-glyph:last-child { margin-inline-start: auto; color: var(--bt-accent); }
|