waybetter 0.1.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +143 -9
- package/bin/waybetter.mjs +46 -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/privacy.mjs +768 -0
- package/cli/release.mjs +444 -0
- package/cli/remote.mjs +260 -0
- package/cli/store.mjs +326 -0
- package/cli/strings.mjs +121 -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 +59 -0
- package/dist/runtime/stringPackTranslate.js +264 -0
- package/dist/runtime/stringPackTranslate.js.map +1 -0
- package/dist/runtime/stringPacks.d.ts +200 -0
- package/dist/runtime/stringPacks.js +474 -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/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 +463 -0
- package/dist/runtime/themeComponents.js.map +1 -0
- package/dist/runtime/themeDecor.d.ts +73 -0
- package/dist/runtime/themeDecor.js +131 -0
- package/dist/runtime/themeDecor.js.map +1 -0
- package/dist/runtime/themeDoctor.d.ts +11 -0
- package/dist/runtime/themeDoctor.js +51 -0
- package/dist/runtime/themeDoctor.js.map +1 -0
- package/dist/runtime/themeIcons.d.ts +130 -0
- package/dist/runtime/themeIcons.js +263 -0
- package/dist/runtime/themeIcons.js.map +1 -0
- package/dist/runtime/themeRuntime.d.ts +100 -0
- package/dist/runtime/themeRuntime.js +497 -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 +259 -0
- package/dist/runtime/themeSpec.js +439 -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 +170 -0
- package/dist/shell/InstallDialog.js.map +1 -0
- package/dist/shell/StoreView.d.ts +66 -0
- package/dist/shell/StoreView.js +103 -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 +21 -0
- package/dist/shell/frame/AppMenu.js +642 -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 +8 -0
- package/dist/shell/frame/Shell.js +1131 -0
- package/dist/shell/frame/Shell.js.map +1 -0
- package/dist/shell/frame/Titlebar.d.ts +16 -0
- package/dist/shell/frame/Titlebar.js +77 -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 +182 -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 +121 -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 +35 -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 +29 -0
- package/dist/shell/frame/chromeTheme.js +81 -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/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 +34 -0
- package/dist/shell/frame/mediaModel.js +53 -0
- package/dist/shell/frame/mediaModel.js.map +1 -0
- package/dist/shell/frame/menuMessages.en.json +54 -0
- package/dist/shell/frame/menuModel.d.ts +277 -0
- package/dist/shell/frame/menuModel.js +293 -0
- package/dist/shell/frame/menuModel.js.map +1 -0
- package/dist/shell/frame/paletteModel.d.ts +139 -0
- package/dist/shell/frame/paletteModel.js +112 -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 +629 -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 +99 -0
- package/dist/shell/frame/state.js +284 -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 +252 -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 +122 -0
- package/dist/shell/installController.js +146 -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 +256 -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 +116 -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 +6 -0
- package/dist/shell/panel/StoreSection.js +48 -0
- package/dist/shell/panel/StoreSection.js.map +1 -0
- package/dist/shell/panel/StringPacks.d.ts +11 -0
- package/dist/shell/panel/StringPacks.js +106 -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 +232 -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 +72 -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 +763 -0
- package/dist/shell/panel/panelMessages.js +767 -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 +230 -0
- package/dist/shell/storeMessages.d.ts +169 -0
- package/dist/shell/storeMessages.js +172 -0
- package/dist/shell/storeMessages.js.map +1 -0
- package/dist/shell/storeModel.d.ts +181 -0
- package/dist/shell/storeModel.js +133 -0
- package/dist/shell/storeModel.js.map +1 -0
- package/dist/shell/stringPacksModel.d.ts +44 -0
- package/dist/shell/stringPacksModel.js +94 -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 +646 -0
- package/languages.schema.json +23 -0
- package/locales/ar-x-fm.json +11 -0
- package/locales/ar.json +1281 -0
- package/locales/bg.json +1280 -0
- package/locales/bn.json +1280 -0
- package/locales/ca.json +1280 -0
- package/locales/cs.json +1280 -0
- package/locales/da.json +1280 -0
- package/locales/de.json +1280 -0
- package/locales/el.json +1280 -0
- package/locales/en-GB.json +27 -0
- package/locales/en.json +1280 -0
- package/locales/en.meta.json +51 -0
- package/locales/es.json +1280 -0
- package/locales/eu.json +1280 -0
- package/locales/fa.json +1281 -0
- package/locales/fi.json +1280 -0
- package/locales/fil.json +1280 -0
- package/locales/fr.json +1280 -0
- package/locales/ga.json +1280 -0
- package/locales/gl.json +1280 -0
- package/locales/gu.json +1280 -0
- package/locales/ha.json +1280 -0
- package/locales/he.json +1281 -0
- package/locales/hi.json +1280 -0
- package/locales/hr.json +1280 -0
- package/locales/hu.json +1279 -0
- package/locales/id.json +1280 -0
- package/locales/ig.json +1280 -0
- package/locales/it.json +1280 -0
- package/locales/ja.json +1280 -0
- package/locales/kn.json +1280 -0
- package/locales/ko.json +1280 -0
- package/locales/mr.json +1280 -0
- package/locales/ms.json +1280 -0
- package/locales/nb.json +1280 -0
- package/locales/nl.json +1280 -0
- package/locales/pl.json +1280 -0
- package/locales/pt.json +1280 -0
- package/locales/ro.json +1280 -0
- package/locales/ru.json +1280 -0
- package/locales/sk.json +1280 -0
- package/locales/sr.json +1280 -0
- package/locales/sv.json +1280 -0
- package/locales/ta.json +1280 -0
- package/locales/th.json +1280 -0
- package/locales/tr.json +1280 -0
- package/locales/uk.json +1280 -0
- package/locales/ur.json +1281 -0
- package/locales/vi.json +1280 -0
- package/locales/yo.json +1280 -0
- package/locales/zh-Hans.json +1280 -0
- package/locales/zh-Hant.json +1280 -0
- package/package.json +148 -6
- package/store-catalog.schema.json +65 -0
- package/theme.schema.json +4659 -0
- package/windows/installer.nsi +926 -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,84 @@
|
|
|
1
|
+
// "Make" section data every app shares: the `npm create waybetter` commands, the UI kit gallery's
|
|
2
|
+
// calls, and the plugin header rules the Plugins list uses. The example plugins, the example theme
|
|
3
|
+
// and the bundled docs are the app's (`PanelSite.make`). Pure (no React, no Tauri).
|
|
4
|
+
import { t } from "../frame/i18n.js";
|
|
5
|
+
/** `npm create waybetter` commands shown in the section (the framework's create-waybetter). */
|
|
6
|
+
export const CREATE_COMMANDS = [
|
|
7
|
+
{ get label() { return t('wb.make.create.plugin'); }, command: 'npm create waybetter plugin -- --name "My Plugin"' },
|
|
8
|
+
{ get label() { return t('wb.make.create.pluginTs'); }, command: 'npm create waybetter plugin -- --name "My Plugin" --ts' },
|
|
9
|
+
{ get label() { return t('wb.make.create.theme'); }, command: 'npm create waybetter theme -- --name "My Theme" --accent "#3ddc97"' },
|
|
10
|
+
{ get label() { return t('wb.make.create.app'); }, command: 'npm create waybetter app -- --site kick.com' },
|
|
11
|
+
];
|
|
12
|
+
export const KIT_DEMOS = [
|
|
13
|
+
{ id: 'toast', get label() { return t('wb.make.kit.toast'); }, kind: 'toast', code: "ui.toast('Link copied');" },
|
|
14
|
+
{ id: 'toast-success', get label() { return t('wb.make.kit.toastSuccess'); }, kind: 'toast', code: "ui.toast('Saved', { tone: 'success' });" },
|
|
15
|
+
{ id: 'toast-action', get label() { return t('wb.make.kit.toastAction'); }, kind: 'toast', code: "ui.toast('Post hidden', { tone: 'warning', action: { label: 'Undo', onClick: undo } });" },
|
|
16
|
+
{ id: 'toast-danger', get label() { return t('wb.make.kit.toastDanger'); }, kind: 'toast', code: "ui.toast('Could not save', { tone: 'danger' });" },
|
|
17
|
+
{ id: 'alert', get label() { return t('wb.make.kit.alert'); }, kind: 'alert', code: "await ui.alert({ title: 'Exported', message: 'Your list was saved to Downloads.', tone: 'success' });" },
|
|
18
|
+
{ id: 'confirm', get label() { return t('wb.make.kit.confirm'); }, kind: 'confirm', code: "await ui.confirm({ title: 'Delete this note?', message: 'This cannot be undone.', confirmLabel: 'Delete', danger: true });" },
|
|
19
|
+
{ id: 'prompt', get label() { return t('wb.make.kit.prompt'); }, kind: 'prompt', code: "await ui.prompt({ title: 'Rename list', label: 'Name', value: 'Reading', validate: v => v.trim().length < 3 ? 'Use at least 3 characters.' : null });" },
|
|
20
|
+
{ id: 'dialog', get label() { return t('wb.make.kit.dialog'); }, kind: 'dialog', code: "ui.dialog({ title: 'My plugin', message: 'What should be hidden?', content: body => body.append(h('label', { class: 'wb-check' }, h('input', { type: 'checkbox' }), 'Hide trends')), actions: [{ label: 'Cancel' }, { label: 'Save', tone: 'primary', default: true }] });" },
|
|
21
|
+
];
|
|
22
|
+
/** A color role's CSS variable: `onAccent` -> `--wb-on-accent` (the names `themeVars` writes). */
|
|
23
|
+
export const cssVarOf = (role) => `--wb-${role.replace(/[A-Z]/g, c => `-${c.toLowerCase()}`)}`;
|
|
24
|
+
// ---------------------------------------------------------------------------------------------
|
|
25
|
+
// Plugin header: the same rules as the plugin store (waybetter-host `plugins::parse_meta` and
|
|
26
|
+
// `valid_file_name`), so the editor shows what the Plugins list will show.
|
|
27
|
+
export const PLUGIN_SUFFIX = '.plugin.js';
|
|
28
|
+
export function parsePluginHeader(file, source) {
|
|
29
|
+
const meta = { file, name: file.endsWith(PLUGIN_SUFFIX) ? file.slice(0, -PLUGIN_SUFFIX.length) : file, description: '', version: '', author: '', header: false };
|
|
30
|
+
const trimmed = source.replace(/^+/, '').trimStart();
|
|
31
|
+
if (!trimmed.startsWith('/**'))
|
|
32
|
+
return meta;
|
|
33
|
+
const body = trimmed.slice(3);
|
|
34
|
+
const end = body.indexOf('*/');
|
|
35
|
+
if (end < 0)
|
|
36
|
+
return meta;
|
|
37
|
+
meta.header = true;
|
|
38
|
+
for (const raw of body.slice(0, end).split('\n')) {
|
|
39
|
+
const line = raw.trim().replace(/^\*+/, '').trim();
|
|
40
|
+
if (!line.startsWith('@'))
|
|
41
|
+
continue;
|
|
42
|
+
const rest = line.slice(1);
|
|
43
|
+
const space = /\s/.exec(rest);
|
|
44
|
+
const key = space ? rest.slice(0, space.index) : rest;
|
|
45
|
+
const value = [...(space ? rest.slice(space.index) : '').trim()].filter(ch => !/\p{Cc}/u.test(ch)).slice(0, 300).join('');
|
|
46
|
+
if (key === 'name' && value)
|
|
47
|
+
meta.name = value;
|
|
48
|
+
else if (key === 'description')
|
|
49
|
+
meta.description = value;
|
|
50
|
+
else if (key === 'version')
|
|
51
|
+
meta.version = value;
|
|
52
|
+
else if (key === 'author')
|
|
53
|
+
meta.author = value;
|
|
54
|
+
}
|
|
55
|
+
return meta;
|
|
56
|
+
}
|
|
57
|
+
/** A bare `name.plugin.js` the plugins folder accepts. */
|
|
58
|
+
export function validPluginFileName(file) {
|
|
59
|
+
return file.length > PLUGIN_SUFFIX.length && file.length <= 128 && file.endsWith(PLUGIN_SUFFIX) && !file.startsWith('.') && /^[A-Za-z0-9_. -]+$/.test(file);
|
|
60
|
+
}
|
|
61
|
+
/** `Hide Trends` -> `hide-trends.plugin.js`. */
|
|
62
|
+
export function pluginFileFor(name) {
|
|
63
|
+
const slug = name.normalize('NFKD').replace(/\p{M}/gu, '').toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 48).replace(/-+$/, '');
|
|
64
|
+
return `${slug || 'my-plugin'}${PLUGIN_SUFFIX}`;
|
|
65
|
+
}
|
|
66
|
+
/** What the editor warns about before the file is copied into the plugins folder. */
|
|
67
|
+
export function pluginWarnings(meta, source) {
|
|
68
|
+
const warnings = [];
|
|
69
|
+
if (!meta.header)
|
|
70
|
+
warnings.push(t('wb.make.warn.header'));
|
|
71
|
+
else
|
|
72
|
+
for (const tag of ['name', 'description', 'version', 'author']) {
|
|
73
|
+
if (tag === 'name' ? meta.name === meta.file.replace(PLUGIN_SUFFIX, '') && !/@name\s+\S/.test(source) : !meta[tag])
|
|
74
|
+
warnings.push(t('wb.make.warn.tag', { tag: `@${tag}` }));
|
|
75
|
+
}
|
|
76
|
+
if (meta.header && !/^\s*\*?\s*@permissions\b/m.test(source))
|
|
77
|
+
warnings.push(t('wb.make.warn.permissions'));
|
|
78
|
+
if (!/module\.exports\s*=|exports\.default\s*=/.test(source))
|
|
79
|
+
warnings.push(t('wb.make.warn.export'));
|
|
80
|
+
if (!/\bstop\s*\(/.test(source))
|
|
81
|
+
warnings.push(t('wb.make.warn.stop'));
|
|
82
|
+
return warnings;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=makeModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"makeModel.js","sourceRoot":"","sources":["../../../../../../shell/src/panel/makeModel.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,mGAAmG;AACnG,oFAAoF;AAEpF,OAAO,EAAE,CAAC,EAAE,MAAM,kBAAkB,CAAC;AAIrC,+FAA+F;AAC/F,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,EAAE,IAAI,KAAK,KAAK,OAAO,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,mDAAmD,EAAE;IACpH,EAAE,IAAI,KAAK,KAAK,OAAO,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,wDAAwD,EAAE;IAC3H,EAAE,IAAI,KAAK,KAAK,OAAO,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,oEAAoE,EAAE;IACpI,EAAE,IAAI,KAAK,KAAK,OAAO,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,6CAA6C,EAAE;CAC5G,CAAC;AAKF,MAAM,CAA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AQ,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,EAAE,EAAE,GAAG,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;QAC/K,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAC3G,IAAI,CAAC,0CAA0C,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC;IACtG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;IACvE,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["// \"Make\" section data every app shares: the `npm create waybetter` commands, the UI kit gallery's\n// calls, and the plugin header rules the Plugins list uses. The example plugins, the example theme\n// and the bundled docs are the app's (`PanelSite.make`). Pure (no React, no Tauri).\n\nimport { t } from '../frame/i18n.ts';\n\nexport type { PluginExample } from './site.ts';\n\n/** `npm create waybetter` commands shown in the section (the framework's create-waybetter). */\nexport const CREATE_COMMANDS = [\n { get label() { return t('wb.make.create.plugin'); }, command: 'npm create waybetter plugin -- --name \"My Plugin\"' },\n { get label() { return t('wb.make.create.pluginTs'); }, command: 'npm create waybetter plugin -- --name \"My Plugin\" --ts' },\n { get label() { return t('wb.make.create.theme'); }, command: 'npm create waybetter theme -- --name \"My Theme\" --accent \"#3ddc97\"' },\n { get label() { return t('wb.make.create.app'); }, command: 'npm create waybetter app -- --site kick.com' },\n];\n\n/** One UI kit call in the gallery: the code shown is the call the button makes. */\nexport type KitDemo = { id: string; label: string; kind: 'toast' | 'alert' | 'confirm' | 'prompt' | 'dialog'; code: string };\n\nexport const KIT_DEMOS: KitDemo[] = [\n { id: 'toast', get label() { return t('wb.make.kit.toast'); }, kind: 'toast', code: \"ui.toast('Link copied');\" },\n { id: 'toast-success', get label() { return t('wb.make.kit.toastSuccess'); }, kind: 'toast', code: \"ui.toast('Saved', { tone: 'success' });\" },\n { id: 'toast-action', get label() { return t('wb.make.kit.toastAction'); }, kind: 'toast', code: \"ui.toast('Post hidden', { tone: 'warning', action: { label: 'Undo', onClick: undo } });\" },\n { id: 'toast-danger', get label() { return t('wb.make.kit.toastDanger'); }, kind: 'toast', code: \"ui.toast('Could not save', { tone: 'danger' });\" },\n { id: 'alert', get label() { return t('wb.make.kit.alert'); }, kind: 'alert', code: \"await ui.alert({ title: 'Exported', message: 'Your list was saved to Downloads.', tone: 'success' });\" },\n { id: 'confirm', get label() { return t('wb.make.kit.confirm'); }, kind: 'confirm', code: \"await ui.confirm({ title: 'Delete this note?', message: 'This cannot be undone.', confirmLabel: 'Delete', danger: true });\" },\n { id: 'prompt', get label() { return t('wb.make.kit.prompt'); }, kind: 'prompt', code: \"await ui.prompt({ title: 'Rename list', label: 'Name', value: 'Reading', validate: v => v.trim().length < 3 ? 'Use at least 3 characters.' : null });\" },\n { id: 'dialog', get label() { return t('wb.make.kit.dialog'); }, kind: 'dialog', code: \"ui.dialog({ title: 'My plugin', message: 'What should be hidden?', content: body => body.append(h('label', { class: 'wb-check' }, h('input', { type: 'checkbox' }), 'Hide trends')), actions: [{ label: 'Cancel' }, { label: 'Save', tone: 'primary', default: true }] });\" },\n];\n\n/** A color role's CSS variable: `onAccent` -> `--wb-on-accent` (the names `themeVars` writes). */\nexport const cssVarOf = (role: string) => `--wb-${role.replace(/[A-Z]/g, c => `-${c.toLowerCase()}`)}`;\n\n// ---------------------------------------------------------------------------------------------\n// Plugin header: the same rules as the plugin store (waybetter-host `plugins::parse_meta` and\n// `valid_file_name`), so the editor shows what the Plugins list will show.\n\nexport const PLUGIN_SUFFIX = '.plugin.js';\n\nexport type PluginMeta = { file: string; name: string; description: string; version: string; author: string; header: boolean };\n\nexport function parsePluginHeader(file: string, source: string): PluginMeta {\n const meta: PluginMeta = { file, name: file.endsWith(PLUGIN_SUFFIX) ? file.slice(0, -PLUGIN_SUFFIX.length) : file, description: '', version: '', author: '', header: false };\n const trimmed = source.replace(/^+/, '').trimStart();\n if (!trimmed.startsWith('/**')) return meta;\n const body = trimmed.slice(3);\n const end = body.indexOf('*/');\n if (end < 0) return meta;\n meta.header = true;\n for (const raw of body.slice(0, end).split('\\n')) {\n const line = raw.trim().replace(/^\\*+/, '').trim();\n if (!line.startsWith('@')) continue;\n const rest = line.slice(1);\n const space = /\\s/.exec(rest);\n const key = space ? rest.slice(0, space.index) : rest;\n const value = [...(space ? rest.slice(space.index) : '').trim()].filter(ch => !/\\p{Cc}/u.test(ch)).slice(0, 300).join('');\n if (key === 'name' && value) meta.name = value;\n else if (key === 'description') meta.description = value;\n else if (key === 'version') meta.version = value;\n else if (key === 'author') meta.author = value;\n }\n return meta;\n}\n\n/** A bare `name.plugin.js` the plugins folder accepts. */\nexport function validPluginFileName(file: string): boolean {\n return file.length > PLUGIN_SUFFIX.length && file.length <= 128 && file.endsWith(PLUGIN_SUFFIX) && !file.startsWith('.') && /^[A-Za-z0-9_. -]+$/.test(file);\n}\n\n/** `Hide Trends` -> `hide-trends.plugin.js`. */\nexport function pluginFileFor(name: string): string {\n const slug = name.normalize('NFKD').replace(/\\p{M}/gu, '').toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 48).replace(/-+$/, '');\n return `${slug || 'my-plugin'}${PLUGIN_SUFFIX}`;\n}\n\n/** What the editor warns about before the file is copied into the plugins folder. */\nexport function pluginWarnings(meta: PluginMeta, source: string): string[] {\n const warnings: string[] = [];\n if (!meta.header) warnings.push(t('wb.make.warn.header'));\n else for (const tag of ['name', 'description', 'version', 'author'] as const) {\n if (tag === 'name' ? meta.name === meta.file.replace(PLUGIN_SUFFIX, '') && !/@name\\s+\\S/.test(source) : !meta[tag]) warnings.push(t('wb.make.warn.tag', { tag: `@${tag}` }));\n }\n if (meta.header && !/^\\s*\\*?\\s*@permissions\\b/m.test(source)) warnings.push(t('wb.make.warn.permissions'));\n if (!/module\\.exports\\s*=|exports\\.default\\s*=/.test(source)) warnings.push(t('wb.make.warn.export'));\n if (!/\\bstop\\s*\\(/.test(source)) warnings.push(t('wb.make.warn.stop'));\n return warnings;\n}\n"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export type Block = {
|
|
2
|
+
kind: 'heading';
|
|
3
|
+
level: number;
|
|
4
|
+
text: string;
|
|
5
|
+
} | {
|
|
6
|
+
kind: 'paragraph';
|
|
7
|
+
text: string;
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'list';
|
|
10
|
+
ordered: boolean;
|
|
11
|
+
items: string[];
|
|
12
|
+
} | {
|
|
13
|
+
kind: 'table';
|
|
14
|
+
head: string[];
|
|
15
|
+
rows: string[][];
|
|
16
|
+
} | {
|
|
17
|
+
kind: 'code';
|
|
18
|
+
lang: string;
|
|
19
|
+
text: string;
|
|
20
|
+
};
|
|
21
|
+
export type DocLink = {
|
|
22
|
+
doc?: string;
|
|
23
|
+
anchor?: string;
|
|
24
|
+
url?: string;
|
|
25
|
+
};
|
|
26
|
+
/** GitHub-style heading anchors: `## Matching the theme: \`api.theme\`` -> `matching-the-theme-apitheme`. */
|
|
27
|
+
export declare const anchorOf: (text: string) => string;
|
|
28
|
+
export declare function parseMarkdown(source: string): Block[];
|
|
29
|
+
/** Where a Markdown link goes: another bundled doc, an anchor in this one, or the web. */
|
|
30
|
+
export declare function resolveLink(href: string, docs: readonly string[]): DocLink | null;
|
|
31
|
+
export type Inline = {
|
|
32
|
+
kind: 'text';
|
|
33
|
+
text: string;
|
|
34
|
+
} | {
|
|
35
|
+
kind: 'code';
|
|
36
|
+
text: string;
|
|
37
|
+
} | {
|
|
38
|
+
kind: 'bold';
|
|
39
|
+
text: string;
|
|
40
|
+
} | {
|
|
41
|
+
kind: 'link';
|
|
42
|
+
text: string;
|
|
43
|
+
href: string;
|
|
44
|
+
};
|
|
45
|
+
/** Inline code, **bold** and [links](href); everything else is text. */
|
|
46
|
+
export declare function inlineTokens(text: string): Inline[];
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// Markdown for the bundled docs (PLUGINS.md, THEMES.md), parsed into plain data: headings,
|
|
2
|
+
// paragraphs, lists, tables, fenced code and inline code/bold/links. Pure; MarkdownDoc.tsx renders
|
|
3
|
+
// it as React text, never as HTML.
|
|
4
|
+
/** GitHub-style heading anchors: `## Matching the theme: \`api.theme\`` -> `matching-the-theme-apitheme`. */
|
|
5
|
+
export const anchorOf = (text) => text.toLowerCase().replace(/[`*]/g, '').replace(/[^\p{L}\p{N} -]/gu, '').trim().replace(/ /g, '-');
|
|
6
|
+
const cells = (line) => line.trim().replace(/^\||\|$/g, '').split(/(?<!\\)\|/).map(cell => cell.trim().replace(/\\\|/g, '|'));
|
|
7
|
+
export function parseMarkdown(source) {
|
|
8
|
+
const lines = source.replace(/\r\n?/g, '\n').split('\n');
|
|
9
|
+
const blocks = [];
|
|
10
|
+
for (let i = 0; i < lines.length;) {
|
|
11
|
+
const line = lines[i];
|
|
12
|
+
const fence = /^```(\w*)/.exec(line);
|
|
13
|
+
if (fence) {
|
|
14
|
+
const body = [];
|
|
15
|
+
for (i += 1; i < lines.length && !lines[i].startsWith('```'); i += 1)
|
|
16
|
+
body.push(lines[i]);
|
|
17
|
+
blocks.push({ kind: 'code', lang: fence[1] ?? '', text: body.join('\n') });
|
|
18
|
+
i += 1;
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
const heading = /^(#{1,4})\s+(.*)$/.exec(line);
|
|
22
|
+
if (heading) {
|
|
23
|
+
blocks.push({ kind: 'heading', level: heading[1].length, text: heading[2] });
|
|
24
|
+
i += 1;
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if (/^\s*\|/.test(line) && /^\s*\|[\s:|-]+\|\s*$/.test(lines[i + 1] ?? '')) {
|
|
28
|
+
const head = cells(line);
|
|
29
|
+
const rows = [];
|
|
30
|
+
for (i += 2; i < lines.length && /^\s*\|/.test(lines[i]); i += 1)
|
|
31
|
+
rows.push(cells(lines[i]));
|
|
32
|
+
blocks.push({ kind: 'table', head, rows });
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
const item = /^(\s*)([-*]|\d+\.)\s+(.*)$/.exec(line);
|
|
36
|
+
if (item) {
|
|
37
|
+
const ordered = /\d/.test(item[2]);
|
|
38
|
+
const items = [];
|
|
39
|
+
while (i < lines.length) {
|
|
40
|
+
const next = /^(\s*)([-*]|\d+\.)\s+(.*)$/.exec(lines[i]);
|
|
41
|
+
if (next) {
|
|
42
|
+
items.push(next[3]);
|
|
43
|
+
i += 1;
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
// Continuation lines are indented under the item.
|
|
47
|
+
if (/^\s{2,}\S/.test(lines[i]) && items.length) {
|
|
48
|
+
items[items.length - 1] += ` ${lines[i].trim()}`;
|
|
49
|
+
i += 1;
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
blocks.push({ kind: 'list', ordered, items });
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (!line.trim()) {
|
|
58
|
+
i += 1;
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
// The first line always belongs to the paragraph (e.g. a lone `|` line that is not a table).
|
|
62
|
+
const text = [line.trim()];
|
|
63
|
+
for (i += 1; i < lines.length && lines[i].trim() && !/^(```|#{1,4}\s|\s*\||\s*([-*]|\d+\.)\s)/.test(lines[i]); i += 1)
|
|
64
|
+
text.push(lines[i].trim());
|
|
65
|
+
blocks.push({ kind: 'paragraph', text: text.join(' ') });
|
|
66
|
+
}
|
|
67
|
+
return blocks;
|
|
68
|
+
}
|
|
69
|
+
/** Where a Markdown link goes: another bundled doc, an anchor in this one, or the web. */
|
|
70
|
+
export function resolveLink(href, docs) {
|
|
71
|
+
if (href.startsWith('#'))
|
|
72
|
+
return { anchor: href.slice(1) };
|
|
73
|
+
const local = /^\.?\/?([\w.-]+\.md)(?:#(.*))?$/.exec(href);
|
|
74
|
+
if (local && docs.includes(local[1]))
|
|
75
|
+
return { doc: local[1], anchor: local[2] };
|
|
76
|
+
if (/^https:\/\//.test(href))
|
|
77
|
+
return { url: href };
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
/** Inline code, **bold** and [links](href); everything else is text. */
|
|
81
|
+
export function inlineTokens(text) {
|
|
82
|
+
const out = [];
|
|
83
|
+
const pattern = /`([^`]+)`|\*\*([^*]+)\*\*|\[([^\]]+)\]\(([^)\s]+)\)/g;
|
|
84
|
+
let last = 0;
|
|
85
|
+
for (const match of text.matchAll(pattern)) {
|
|
86
|
+
if (match.index > last)
|
|
87
|
+
out.push({ kind: 'text', text: text.slice(last, match.index) });
|
|
88
|
+
if (match[1] !== undefined)
|
|
89
|
+
out.push({ kind: 'code', text: match[1] });
|
|
90
|
+
else if (match[2] !== undefined)
|
|
91
|
+
out.push({ kind: 'bold', text: match[2] });
|
|
92
|
+
else
|
|
93
|
+
out.push({ kind: 'link', text: match[3], href: match[4] });
|
|
94
|
+
last = match.index + match[0].length;
|
|
95
|
+
}
|
|
96
|
+
if (last < text.length)
|
|
97
|
+
out.push({ kind: 'text', text: text.slice(last) });
|
|
98
|
+
return out;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../../../../../shell/src/panel/markdown.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,mGAAmG;AACnG,mCAAmC;AAWnC,6GAA6G;AAC7G,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO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E,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;aAClE,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS;YAAE,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;;YACvE,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAE,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAE,EAAE,CAAC,CAAC;QAClE,IAAI,GAAG,KAAK,CAAC,KAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACxC,CAAC;IACD,IAAI,IAAI,GAAG,IAAI,CAAC,MAAM;QAAE,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3E,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["// Markdown for the bundled docs (PLUGINS.md, THEMES.md), parsed into plain data: headings,\n// paragraphs, lists, tables, fenced code and inline code/bold/links. Pure; MarkdownDoc.tsx renders\n// it as React text, never as HTML.\n\nexport type Block =\n | { kind: 'heading'; level: number; text: string }\n | { kind: 'paragraph'; text: string }\n | { kind: 'list'; ordered: boolean; items: string[] }\n | { kind: 'table'; head: string[]; rows: string[][] }\n | { kind: 'code'; lang: string; text: string };\n\nexport type DocLink = { doc?: string; anchor?: string; url?: string };\n\n/** GitHub-style heading anchors: `## Matching the theme: \\`api.theme\\`` -> `matching-the-theme-apitheme`. */\nexport const anchorOf = (text: string) => text.toLowerCase().replace(/[`*]/g, '').replace(/[^\\p{L}\\p{N} -]/gu, '').trim().replace(/ /g, '-');\n\nconst cells = (line: string) => line.trim().replace(/^\\||\\|$/g, '').split(/(?<!\\\\)\\|/).map(cell => cell.trim().replace(/\\\\\\|/g, '|'));\n\nexport function parseMarkdown(source: string): Block[] {\n const lines = source.replace(/\\r\\n?/g, '\\n').split('\\n');\n const blocks: Block[] = [];\n for (let i = 0; i < lines.length;) {\n const line = lines[i]!;\n const fence = /^```(\\w*)/.exec(line);\n if (fence) {\n const body: string[] = [];\n for (i += 1; i < lines.length && !lines[i]!.startsWith('```'); i += 1) body.push(lines[i]!);\n blocks.push({ kind: 'code', lang: fence[1] ?? '', text: body.join('\\n') });\n i += 1;\n continue;\n }\n const heading = /^(#{1,4})\\s+(.*)$/.exec(line);\n if (heading) { blocks.push({ kind: 'heading', level: heading[1]!.length, text: heading[2]! }); i += 1; continue; }\n if (/^\\s*\\|/.test(line) && /^\\s*\\|[\\s:|-]+\\|\\s*$/.test(lines[i + 1] ?? '')) {\n const head = cells(line);\n const rows: string[][] = [];\n for (i += 2; i < lines.length && /^\\s*\\|/.test(lines[i]!); i += 1) rows.push(cells(lines[i]!));\n blocks.push({ kind: 'table', head, rows });\n continue;\n }\n const item = /^(\\s*)([-*]|\\d+\\.)\\s+(.*)$/.exec(line);\n if (item) {\n const ordered = /\\d/.test(item[2]!);\n const items: string[] = [];\n while (i < lines.length) {\n const next = /^(\\s*)([-*]|\\d+\\.)\\s+(.*)$/.exec(lines[i]!);\n if (next) { items.push(next[3]!); i += 1; continue; }\n // Continuation lines are indented under the item.\n if (/^\\s{2,}\\S/.test(lines[i]!) && items.length) { items[items.length - 1] += ` ${lines[i]!.trim()}`; i += 1; continue; }\n break;\n }\n blocks.push({ kind: 'list', ordered, items });\n continue;\n }\n if (!line.trim()) { i += 1; continue; }\n // The first line always belongs to the paragraph (e.g. a lone `|` line that is not a table).\n const text: string[] = [line.trim()];\n for (i += 1; i < lines.length && lines[i]!.trim() && !/^(```|#{1,4}\\s|\\s*\\||\\s*([-*]|\\d+\\.)\\s)/.test(lines[i]!); i += 1) text.push(lines[i]!.trim());\n blocks.push({ kind: 'paragraph', text: text.join(' ') });\n }\n return blocks;\n}\n\n/** Where a Markdown link goes: another bundled doc, an anchor in this one, or the web. */\nexport function resolveLink(href: string, docs: readonly string[]): DocLink | null {\n if (href.startsWith('#')) return { anchor: href.slice(1) };\n const local = /^\\.?\\/?([\\w.-]+\\.md)(?:#(.*))?$/.exec(href);\n if (local && docs.includes(local[1]!)) return { doc: local[1], anchor: local[2] };\n if (/^https:\\/\\//.test(href)) return { url: href };\n return null;\n}\n\nexport type Inline = { kind: 'text'; text: string } | { kind: 'code'; text: string } | { kind: 'bold'; text: string } | { kind: 'link'; text: string; href: string };\n\n/** Inline code, **bold** and [links](href); everything else is text. */\nexport function inlineTokens(text: string): Inline[] {\n const out: Inline[] = [];\n const pattern = /`([^`]+)`|\\*\\*([^*]+)\\*\\*|\\[([^\\]]+)\\]\\(([^)\\s]+)\\)/g;\n let last = 0;\n for (const match of text.matchAll(pattern)) {\n if (match.index! > last) out.push({ kind: 'text', text: text.slice(last, match.index) });\n if (match[1] !== undefined) out.push({ kind: 'code', text: match[1] });\n else if (match[2] !== undefined) out.push({ kind: 'bold', text: match[2] });\n else out.push({ kind: 'link', text: match[3]!, href: match[4]! });\n last = match.index! + match[0].length;\n }\n if (last < text.length) out.push({ kind: 'text', text: text.slice(last) });\n return out;\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import { type BuiltinSection, type PanelSite, type SectionProps } from './site.ts';
|
|
3
|
+
/** Nav icons of the built-in sections (16x16 stroke paths). */
|
|
4
|
+
export declare const NAV_ICONS: Record<BuiltinSection, string>;
|
|
5
|
+
export type NavEntry = {
|
|
6
|
+
id: string;
|
|
7
|
+
icon: string;
|
|
8
|
+
label(t: (key: string) => string): string;
|
|
9
|
+
component: ComponentType<SectionProps> | null;
|
|
10
|
+
};
|
|
11
|
+
/** The panel's sections in nav order: the built-in ones the app serves and the app's own. */
|
|
12
|
+
export declare function navEntries(panel?: PanelSite): NavEntry[];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { hasFeature, site } from "../frame/site.js";
|
|
2
|
+
import { BUILTIN_SECTIONS, panelSite } from "./site.js";
|
|
3
|
+
/** Nav icons of the built-in sections (16x16 stroke paths). */
|
|
4
|
+
export const NAV_ICONS = {
|
|
5
|
+
home: 'M2.5 7.2 8 2.8l5.5 4.4V13H9.8V9.6H6.2V13H2.5z',
|
|
6
|
+
themes: 'M8 2.5a5.5 5.5 0 1 0 0 11c.9 0 1.2-.6 1.2-1.1 0-.7-.5-.9-.5-1.5 0-.6.5-1 1.1-1h1.2A2.5 2.5 0 0 0 13.5 7.4 5.3 5.3 0 0 0 8 2.5zM5 7.2h.01M7.2 5h.01M10 5.4h.01',
|
|
7
|
+
builder: 'M3 13l.6-2.6L10.5 3.5l2 2-6.9 6.9zM9 5l2 2M2.5 3.5h3M4 2v3',
|
|
8
|
+
plugins: 'M6 2.5v3M10 2.5v3M4 5.5h8V8a4 4 0 0 1-8 0zM8 12v1.5',
|
|
9
|
+
store: 'M2.8 6 3.8 2.8h8.4L13.2 6M2.8 6h10.4v7.2H2.8zM2.8 6a1.7 1.7 0 0 0 3.5 0 1.7 1.7 0 0 0 3.4 0 1.7 1.7 0 0 0 3.5 0M6.7 13.2V10h2.6v3.2',
|
|
10
|
+
make: 'M5.5 4.5 2.5 8l3 3.5M10.5 4.5l3 3.5-3 3.5M9.2 3 6.8 13',
|
|
11
|
+
accounts: 'M6 7.5a2.3 2.3 0 1 0 0-4.6 2.3 2.3 0 0 0 0 4.6zM2 13a4 4 0 0 1 8 0M10.5 3.2a2.3 2.3 0 0 1 0 4.4M12 9.5A3.8 3.8 0 0 1 14 13',
|
|
12
|
+
updates: 'M13 8a5 5 0 1 1-1.5-3.5M13 2.5v2.8h-2.8',
|
|
13
|
+
settings: 'M2.5 4.5h11v8h-11zM2.5 7h11M4.5 5.8h.01M6 5.8h.01',
|
|
14
|
+
power: 'M2.5 3h3v10h-3zM6.5 3h3v10h-3zM10.5 3h3v10h-3z',
|
|
15
|
+
backup: 'M8 2.5v7M5 6.5l3 3 3-3M3 10.5v2h10v-2',
|
|
16
|
+
developer: 'M5.5 5 2.5 8l3 3M10.5 5l3 3-3 3',
|
|
17
|
+
};
|
|
18
|
+
const BUILTIN_LABELS = {
|
|
19
|
+
home: 'wb.panel.section.home', themes: 'wb.panel.section.themes', builder: 'wb.panel.section.builder', plugins: 'wb.panel.section.plugins',
|
|
20
|
+
store: 'wb.panel.section.store', make: 'wb.panel.section.make', accounts: 'wb.panel.section.accounts', power: 'wb.panel.section.power',
|
|
21
|
+
settings: 'wb.panel.section.settings', backup: 'wb.panel.section.backup', developer: 'wb.panel.section.developer', updates: 'wb.panel.section.updates',
|
|
22
|
+
};
|
|
23
|
+
/** Whether the app serves what a built-in section needs. */
|
|
24
|
+
function available(id, panel) {
|
|
25
|
+
switch (id) {
|
|
26
|
+
case 'themes':
|
|
27
|
+
case 'builder': return !!panel.themes;
|
|
28
|
+
case 'store': return !!panel.store && !!panel.themes;
|
|
29
|
+
case 'make': return !!panel.make;
|
|
30
|
+
case 'power': return !!site().deck;
|
|
31
|
+
case 'backup': return !!panel.backup;
|
|
32
|
+
case 'developer': return hasFeature('developer');
|
|
33
|
+
case 'updates': return !!panel.updates;
|
|
34
|
+
default: return true;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/** The panel's sections in nav order: the built-in ones the app serves and the app's own. */
|
|
38
|
+
export function navEntries(panel = panelSite()) {
|
|
39
|
+
const builtin = BUILTIN_SECTIONS.filter(id => available(id, panel));
|
|
40
|
+
const own = panel.sections ?? [];
|
|
41
|
+
const known = new Set([...builtin, ...own.map(section => section.id)]);
|
|
42
|
+
const order = [...(panel.order ?? []).filter(id => known.has(id)), ...[...known].filter(id => !(panel.order ?? []).includes(id))];
|
|
43
|
+
return order.map(id => {
|
|
44
|
+
const custom = own.find(section => section.id === id);
|
|
45
|
+
if (custom)
|
|
46
|
+
return { id, icon: custom.icon, label: () => custom.label(), component: custom.component };
|
|
47
|
+
return { id, icon: NAV_ICONS[id], label: t => t(BUILTIN_LABELS[id]), component: null };
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=nav.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav.js","sourceRoot":"","sources":["../../../../../../shell/src/panel/nav.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAA0D,MAAM,WAAW,CAAC;AAEhH,+DAA+D;AAC/D,MAAM,CAAC,MAAM,SAAS,GAAmC;IACvD,IAAI,EAAE,+CAA+C;IACrD,MAAM,EAAE,+JAA+J;IACvK,OAAO,EAAE,4DAA4D;IACrE,OAAO,EAAE,qDAAqD;IAC9D,KAAK,EAAE,qIAAqI;IAC5I,IAAI,EAAE,wDAAwD;IAC9D,QAAQ,EAAE,4HAA4H;IACtI,OAAO,EAAE,yCAAyC;IAClD,QAAQ,EAAE,mDAAmD;IAC7D,KAAK,EAAE,gDAAgD;IACvD,MAAM,EAAE,uCAAuC;IAC/C,SAAS,EAAE,iCAAiC;CAC7C,CAAC;AACF,MAAM,cAAc,GAAmC;IACrD,IAAI,EAAE,uBAAuB,EAAE,MAAM,EAAE,yBAAyB,EAAE,OAAO,EAAE,0BAA0B,EAAE,OAAO,EAAE,0BAA0B;IAC1I,KAAK,EAAE,wBAAwB,EAAE,IAAI,EAAE,uBAAuB,EAAE,QAAQ,EAAE,2BAA2B,EAAE,KAAK,EAAE,wBAAwB;IACtI,QAAQ,EAAE,2BAA2B,EAAE,MAAM,EAAE,yBAAyB,EAAE,SAAS,EAAE,4BAA4B,EAAE,OAAO,EAAE,0BAA0B;CACvJ,CAAC;AAEF,4DAA4D;AAC5D,SAAS,SAAS,CAAC,EAAkB,EAAE,KAAgB;IACrD,QAAQ,EAAE,EAAE,CAAC;QACX,KAAK,QAAQ,CAAC;QACd,K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E,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClI,OAAO,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;QACpB,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACtD,IAAI,MAAM;YAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC;QACvG,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,EAAoB,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,EAAoB,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAC7H,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// The panel's navigation: the built-in sections (shown when the app serves what each needs) and the\n// app's own, in the app's order. Pure (no JSX), unit-tested under node.\nimport type { ComponentType } from 'react';\nimport { hasFeature, site } from '../frame/site.ts';\nimport { BUILTIN_SECTIONS, panelSite, type BuiltinSection, type PanelSite, type SectionProps } from './site.ts';\n\n/** Nav icons of the built-in sections (16x16 stroke paths). */\nexport const NAV_ICONS: Record<BuiltinSection, string> = {\n home: 'M2.5 7.2 8 2.8l5.5 4.4V13H9.8V9.6H6.2V13H2.5z',\n themes: 'M8 2.5a5.5 5.5 0 1 0 0 11c.9 0 1.2-.6 1.2-1.1 0-.7-.5-.9-.5-1.5 0-.6.5-1 1.1-1h1.2A2.5 2.5 0 0 0 13.5 7.4 5.3 5.3 0 0 0 8 2.5zM5 7.2h.01M7.2 5h.01M10 5.4h.01',\n builder: 'M3 13l.6-2.6L10.5 3.5l2 2-6.9 6.9zM9 5l2 2M2.5 3.5h3M4 2v3',\n plugins: 'M6 2.5v3M10 2.5v3M4 5.5h8V8a4 4 0 0 1-8 0zM8 12v1.5',\n store: 'M2.8 6 3.8 2.8h8.4L13.2 6M2.8 6h10.4v7.2H2.8zM2.8 6a1.7 1.7 0 0 0 3.5 0 1.7 1.7 0 0 0 3.4 0 1.7 1.7 0 0 0 3.5 0M6.7 13.2V10h2.6v3.2',\n make: 'M5.5 4.5 2.5 8l3 3.5M10.5 4.5l3 3.5-3 3.5M9.2 3 6.8 13',\n accounts: 'M6 7.5a2.3 2.3 0 1 0 0-4.6 2.3 2.3 0 0 0 0 4.6zM2 13a4 4 0 0 1 8 0M10.5 3.2a2.3 2.3 0 0 1 0 4.4M12 9.5A3.8 3.8 0 0 1 14 13',\n updates: 'M13 8a5 5 0 1 1-1.5-3.5M13 2.5v2.8h-2.8',\n settings: 'M2.5 4.5h11v8h-11zM2.5 7h11M4.5 5.8h.01M6 5.8h.01',\n power: 'M2.5 3h3v10h-3zM6.5 3h3v10h-3zM10.5 3h3v10h-3z',\n backup: 'M8 2.5v7M5 6.5l3 3 3-3M3 10.5v2h10v-2',\n developer: 'M5.5 5 2.5 8l3 3M10.5 5l3 3-3 3',\n};\nconst BUILTIN_LABELS: Record<BuiltinSection, string> = {\n home: 'wb.panel.section.home', themes: 'wb.panel.section.themes', builder: 'wb.panel.section.builder', plugins: 'wb.panel.section.plugins',\n store: 'wb.panel.section.store', make: 'wb.panel.section.make', accounts: 'wb.panel.section.accounts', power: 'wb.panel.section.power',\n settings: 'wb.panel.section.settings', backup: 'wb.panel.section.backup', developer: 'wb.panel.section.developer', updates: 'wb.panel.section.updates',\n};\n\n/** Whether the app serves what a built-in section needs. */\nfunction available(id: BuiltinSection, panel: PanelSite): boolean {\n switch (id) {\n case 'themes':\n case 'builder': return !!panel.themes;\n case 'store': return !!panel.store && !!panel.themes;\n case 'make': return !!panel.make;\n case 'power': return !!site().deck;\n case 'backup': return !!panel.backup;\n case 'developer': return hasFeature('developer');\n case 'updates': return !!panel.updates;\n default: return true;\n }\n}\n\nexport type NavEntry = { id: string; icon: string; label(t: (key: string) => string): string; component: ComponentType<SectionProps> | null };\n\n/** The panel's sections in nav order: the built-in ones the app serves and the app's own. */\nexport function navEntries(panel: PanelSite = panelSite()): NavEntry[] {\n const builtin = BUILTIN_SECTIONS.filter(id => available(id, panel));\n const own = panel.sections ?? [];\n const known = new Set<string>([...builtin, ...own.map(section => section.id)]);\n const order = [...(panel.order ?? []).filter(id => known.has(id)), ...[...known].filter(id => !(panel.order ?? []).includes(id))];\n return order.map(id => {\n const custom = own.find(section => section.id === id);\n if (custom) return { id, icon: custom.icon, label: () => custom.label(), component: custom.component };\n return { id, icon: NAV_ICONS[id as BuiltinSection], label: t => t(BUILTIN_LABELS[id as BuiltinSection]), component: null };\n });\n}\n"]}
|