waybetter 0.1.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +140 -6
- 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 +139 -5
- 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,232 @@
|
|
|
1
|
+
/* Theme Builder, font roles and the font browser. Panel tokens (--c-*, --f-*) from panel.css, so all
|
|
2
|
+
of it follows the active theme like the rest of the panel. */
|
|
3
|
+
|
|
4
|
+
/* ---------------------------------------------------------------------------------------------
|
|
5
|
+
* Builder layout: controls left, a sticky preview right (stacked under 980px). */
|
|
6
|
+
.wb-builder { --wb-gap: 14px; display: flex; flex-direction: column; gap: 16px; margin: -4px 0 0; }
|
|
7
|
+
.wb-builder.is-loading { min-height: 320px; }
|
|
8
|
+
.btp-page:has(.wb-builder) { max-width: 1320px; }
|
|
9
|
+
.wb-builder-bar {
|
|
10
|
+
position: sticky; top: -18px; z-index: 12; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
|
|
11
|
+
margin: 0 -4px; padding: 10px 12px; border: 1px solid var(--c-line); border-radius: 14px;
|
|
12
|
+
background: color-mix(in srgb, var(--c-card) 88%, transparent); backdrop-filter: blur(14px) saturate(1.2);
|
|
13
|
+
box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .6);
|
|
14
|
+
}
|
|
15
|
+
.wb-builder-name { flex: 1 1 200px; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--c-text); font: 650 17px/1 var(--f-ui); letter-spacing: -.02em; }
|
|
16
|
+
.wb-builder-name:hover { border-color: var(--c-line); }
|
|
17
|
+
.wb-builder-name:focus { outline: none; border-color: var(--c-accent); background: var(--c-field); }
|
|
18
|
+
.wb-builder-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
|
|
19
|
+
.wb-divider { width: 1px; height: 20px; margin: 0 4px; background: var(--c-line); }
|
|
20
|
+
.wb-icon-button { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--c-line); border-radius: 9px; background: var(--c-field); color: var(--c-text); cursor: pointer; transition: background-color .15s, border-color .15s; }
|
|
21
|
+
.wb-icon-button:hover:not(:disabled) { border-color: var(--c-line-strong); background: var(--c-raise); }
|
|
22
|
+
.wb-icon-button:disabled { opacity: .38; cursor: default; }
|
|
23
|
+
.wb-live { display: inline-flex; align-items: center; gap: 8px; margin-inline-end: 4px; color: var(--c-muted); font-size: 12px; font-weight: 520; }
|
|
24
|
+
|
|
25
|
+
.wb-builder-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
|
|
26
|
+
.wb-builder-controls { display: flex; flex-direction: column; gap: var(--wb-gap); min-width: 0; }
|
|
27
|
+
.wb-builder-preview { display: flex; flex-direction: column; gap: 10px; min-width: 0; order: -1; }
|
|
28
|
+
@container panel (min-width: 980px) {
|
|
29
|
+
.wb-builder-grid { grid-template-columns: minmax(0, 1fr) minmax(360px, 44%); }
|
|
30
|
+
.wb-builder-preview { order: 0; position: sticky; top: 52px; }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.wb-card { padding: 16px 16px 14px; border: 1px solid var(--c-line-soft); border-radius: 14px; background: var(--c-card); }
|
|
34
|
+
.wb-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
|
|
35
|
+
.wb-card h3 { margin: 0; font-size: 14px; font-weight: 640; letter-spacing: -.01em; }
|
|
36
|
+
.wb-card header p { margin: 3px 0 0; max-width: 62ch; color: var(--c-muted); font-size: 12px; line-height: 1.45; }
|
|
37
|
+
.wb-ok { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; background: color-mix(in srgb, var(--c-ok) 14%, transparent); color: var(--c-ok); font-size: 12px; font-weight: 600; white-space: nowrap; }
|
|
38
|
+
|
|
39
|
+
.wb-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px 18px; margin-top: 14px; }
|
|
40
|
+
.wb-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
|
|
41
|
+
.wb-field > span { color: var(--c-muted); font-size: 11.5px; font-weight: 560; letter-spacing: .01em; }
|
|
42
|
+
.wb-field .bt-slider { width: 100%; }
|
|
43
|
+
|
|
44
|
+
/* Base colors */
|
|
45
|
+
.wb-base { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
|
|
46
|
+
.wb-base-item { display: flex; flex-direction: column; gap: 9px; padding: 10px; border: 1px solid var(--c-line-soft); border-radius: 12px; background: var(--c-ground); }
|
|
47
|
+
.wb-base-swatch { position: relative; display: flex; align-items: flex-end; justify-content: space-between; height: 62px; padding: 10px 11px; border-radius: 9px; box-shadow: inset 0 0 0 1px rgb(127 127 127 / .22); }
|
|
48
|
+
.wb-base-swatch span { font-size: 13px; font-weight: 650; letter-spacing: -.01em; }
|
|
49
|
+
.wb-base-swatch code { padding: 2px 6px; border: 0; border-radius: 6px; background: rgb(0 0 0 / .32); color: #fff; font: 500 11px/1.4 var(--f-mono); }
|
|
50
|
+
.wb-base-item .bt-color { flex-wrap: wrap; gap: 6px; }
|
|
51
|
+
.wb-base-item .bt-swatch { width: 22px; height: 22px; }
|
|
52
|
+
|
|
53
|
+
/* Derived palette */
|
|
54
|
+
.wb-palette { margin-top: 12px; }
|
|
55
|
+
.wb-palette-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
|
|
56
|
+
.wb-chip { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 7px 9px; border: 1px solid var(--c-line-soft); border-radius: 10px; background: var(--c-ground); color: var(--c-text); text-align: start; cursor: pointer; transition: border-color .15s, background-color .15s; }
|
|
57
|
+
.wb-chip:hover { border-color: var(--c-line-strong); }
|
|
58
|
+
.wb-chip.is-on { border-color: var(--c-accent); box-shadow: 0 0 0 1px var(--c-accent); }
|
|
59
|
+
.wb-chip-swatch { flex: none; width: 22px; height: 22px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgb(127 127 127 / .3); }
|
|
60
|
+
.wb-chip-copy { display: flex; flex-direction: column; min-width: 0; }
|
|
61
|
+
.wb-chip-copy b { font-size: 12px; font-weight: 600; }
|
|
62
|
+
.wb-chip-copy small { overflow: hidden; color: var(--c-muted); font: 10.5px/1.4 var(--f-mono); white-space: nowrap; text-overflow: ellipsis; }
|
|
63
|
+
.wb-palette-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; padding: 10px; border-radius: 10px; background: var(--c-field); }
|
|
64
|
+
.wb-palette-edit > span { font-size: 12px; font-weight: 600; }
|
|
65
|
+
|
|
66
|
+
/* Contrast */
|
|
67
|
+
.wb-contrast { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
|
|
68
|
+
.wb-contrast li { display: grid; grid-template-columns: 40px 1fr auto auto 76px; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 9px; }
|
|
69
|
+
.wb-contrast li:hover { background: var(--c-field); }
|
|
70
|
+
.wb-contrast li.is-fail { background: color-mix(in srgb, var(--c-danger) 7%, transparent); }
|
|
71
|
+
.wb-contrast-sample { display: grid; place-items: center; width: 40px; height: 28px; border-radius: 7px; box-shadow: inset 0 0 0 1px rgb(127 127 127 / .25); font-size: 14px; font-weight: 700; }
|
|
72
|
+
.wb-contrast-label { font-size: 12.5px; }
|
|
73
|
+
.wb-contrast-ratio { font: 12px/1 var(--f-mono); color: var(--c-muted); }
|
|
74
|
+
.wb-contrast-ratio b { color: var(--c-text); font-weight: 600; }
|
|
75
|
+
.wb-contrast-need { color: var(--c-faint); font-size: 11.5px; }
|
|
76
|
+
.wb-contrast-badge { justify-self: end; padding: 3px 7px; border-radius: 6px; font: 600 10.5px/1.2 var(--f-mono); text-align: center; }
|
|
77
|
+
.wb-contrast-badge.is-pass { background: color-mix(in srgb, var(--c-ok) 14%, transparent); color: var(--c-ok); }
|
|
78
|
+
.wb-contrast-badge.is-fail { background: color-mix(in srgb, var(--c-danger) 16%, transparent); color: var(--c-danger); }
|
|
79
|
+
@container panel (max-width: 560px) {
|
|
80
|
+
.wb-contrast li { grid-template-columns: 40px 1fr auto; }
|
|
81
|
+
.wb-contrast-need, .wb-contrast-badge { display: none; }
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Background */
|
|
85
|
+
.wb-bg .bt-seg { margin-bottom: 2px; }
|
|
86
|
+
|
|
87
|
+
/* Preview column */
|
|
88
|
+
.wb-preview-frame { overflow: hidden; border: 1px solid var(--c-line); border-radius: 14px; background: var(--c-ground); box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .7); }
|
|
89
|
+
.wb-preview-frame .tp { border-radius: 0; }
|
|
90
|
+
.wb-preview-note { display: flex; align-items: center; gap: 8px; margin: 0 2px; color: var(--c-muted); font-size: 12px; line-height: 1.4; }
|
|
91
|
+
.wb-live-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c-ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-ok) 22%, transparent); animation: wb-pulse 2.4s ease-in-out infinite; }
|
|
92
|
+
@keyframes wb-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--c-ok) 0%, transparent); } }
|
|
93
|
+
@media (prefers-reduced-motion: reduce) { .wb-live-dot { animation: none; } }
|
|
94
|
+
.wb-meta { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--c-line-soft); border-radius: 12px; background: var(--c-card); }
|
|
95
|
+
.wb-meta label { display: flex; flex-direction: column; gap: 5px; }
|
|
96
|
+
.wb-meta span { color: var(--c-muted); font-size: 11.5px; font-weight: 560; }
|
|
97
|
+
.wb-meta input, .wb-meta textarea { padding: 7px 9px; border: 1px solid var(--c-line); border-radius: 8px; background: var(--c-field); color: var(--c-text); font: 13px/1.4 var(--f-ui); resize: vertical; }
|
|
98
|
+
.wb-meta input:focus, .wb-meta textarea:focus { outline: none; border-color: var(--c-accent); }
|
|
99
|
+
|
|
100
|
+
/* The chrome in the draft (tokens straight from chromeVars, Night Ink fallbacks). */
|
|
101
|
+
.wb-chrome-preview { padding: 7px 8px 0; background: var(--wb-c-ground, #07080c); font-family: var(--wb-f-chrome, 'Geist Variable', system-ui, sans-serif); }
|
|
102
|
+
.wb-cp-tabs { display: flex; gap: 4px; }
|
|
103
|
+
.wb-cp-tab { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 12px; border-radius: 8px 8px 0 0; color: var(--wb-c-muted, #8a90a6); font-size: 11.5px; font-weight: 520; }
|
|
104
|
+
.wb-cp-tab i { width: 10px; height: 10px; border-radius: 3px; background: var(--wb-c-line-strong, #2a3044); }
|
|
105
|
+
.wb-cp-tab.is-on { background: var(--wb-c-chrome, #0d1017); color: var(--wb-c-text, #eef0f7); }
|
|
106
|
+
.wb-cp-tab.is-on i { background: var(--wb-c-accent, #1d9bf0); }
|
|
107
|
+
.wb-cp-bar { display: flex; align-items: center; gap: 8px; margin: 0 -8px; padding: 7px 10px; background: var(--wb-c-chrome, #0d1017); border-bottom: 1px solid var(--wb-c-line-soft, #161a26); }
|
|
108
|
+
.wb-cp-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--wb-c-raised, #141823); }
|
|
109
|
+
.wb-cp-omni { flex: 1; display: flex; align-items: center; gap: 7px; height: 24px; padding: 0 9px; border-radius: 7px; background: var(--wb-c-field, #11141c); color: var(--wb-c-text, #eef0f7); font-size: 11.5px; }
|
|
110
|
+
.wb-cp-omni b { padding: 2px 7px; border-radius: 5px; background: rgb(var(--wb-c-accent-rgb, 29 155 240) / .16); color: var(--wb-c-accent-ink, #cfe6ff); font-weight: 600; }
|
|
111
|
+
.wb-cp-omni em { color: var(--wb-c-faint, #5d6379); font-style: normal; }
|
|
112
|
+
.wb-cp-brand { width: 26px; height: 16px; border-radius: 5px; background: linear-gradient(90deg, #4f6bff, #22d3ee 55%, #a855f7); opacity: .85; }
|
|
113
|
+
|
|
114
|
+
/* ---------------------------------------------------------------------------------------------
|
|
115
|
+
* Font roles */
|
|
116
|
+
.wb-roles { display: flex; flex-direction: column; border: 1px solid var(--c-line-soft); border-radius: 12px; overflow: hidden; }
|
|
117
|
+
.wb-role + .wb-role { border-top: 1px solid var(--c-line-soft); }
|
|
118
|
+
.wb-role-main { display: grid; grid-template-columns: minmax(130px, .8fr) minmax(0, 1.4fr) auto; align-items: center; gap: 12px; padding-block: 9px; padding-inline: 14px 10px; }
|
|
119
|
+
.wb-role-copy { display: flex; flex-direction: column; min-width: 0; }
|
|
120
|
+
.wb-role-copy strong { font-size: 13px; font-weight: 600; }
|
|
121
|
+
.wb-role-copy small { color: var(--c-muted); font-size: 11.5px; line-height: 1.35; }
|
|
122
|
+
.wb-role-font { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: 7px 11px; border: 1px solid var(--c-line); border-radius: 10px; background: var(--c-field); color: var(--c-text); text-align: start; cursor: pointer; transition: border-color .15s, background-color .15s; }
|
|
123
|
+
.wb-role-font:hover { border-color: var(--c-line-strong); background: var(--c-raise); }
|
|
124
|
+
.wb-role-font.is-inherited { border-style: dashed; background: transparent; }
|
|
125
|
+
.wb-role-sample { max-width: 100%; overflow: hidden; font-size: 17px; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
|
|
126
|
+
.wb-role-name { display: inline-flex; align-items: center; gap: 6px; color: var(--c-muted); font-size: 11px; }
|
|
127
|
+
.wb-role-name em { padding: 1px 5px; border-radius: 4px; background: var(--c-accent-soft); color: var(--c-accent); font: 600 9.5px/1.3 var(--f-mono); font-style: normal; letter-spacing: .02em; text-transform: uppercase; }
|
|
128
|
+
.wb-role-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 96px; }
|
|
129
|
+
.wb-role-tune { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--c-muted); cursor: pointer; }
|
|
130
|
+
.wb-role-tune:hover, .wb-role-tune[aria-expanded=true] { border-color: var(--c-line); background: var(--c-field); color: var(--c-text); }
|
|
131
|
+
.wb-role-tune.is-tuned { color: var(--c-accent); }
|
|
132
|
+
.wb-role-tuning { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 18px; padding: 4px 14px 14px; }
|
|
133
|
+
.wb-role-tuning label { display: flex; flex-direction: column; gap: 6px; }
|
|
134
|
+
.wb-role-tuning label.is-inline { flex-direction: row; align-items: center; justify-content: space-between; }
|
|
135
|
+
.wb-role-tuning label > span { color: var(--c-muted); font-size: 11.5px; font-weight: 560; }
|
|
136
|
+
.wb-roles.is-compact .wb-role-main { grid-template-columns: minmax(110px, .6fr) minmax(0, 1.4fr) auto; }
|
|
137
|
+
@container panel (max-width: 560px) {
|
|
138
|
+
.wb-role-main { grid-template-columns: 1fr auto; }
|
|
139
|
+
.wb-role-font { grid-column: 1 / -1; grid-row: 2; }
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* ---------------------------------------------------------------------------------------------
|
|
143
|
+
* Sheets (font browser): cover the panel, not the window (X panes are native webviews). */
|
|
144
|
+
.wb-sheet-backdrop { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px; background: rgb(0 0 0 / .5); backdrop-filter: blur(4px); animation: bt-pop .16s var(--ease); }
|
|
145
|
+
.wb-sheet { display: flex; flex-direction: column; width: min(1040px, 100%); height: min(720px, 100%); overflow: hidden; border: 1px solid var(--c-line-strong); border-radius: 16px; background: var(--c-card); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgb(0 0 0 / .3); }
|
|
146
|
+
.wb-sheet-head { display: flex; align-items: center; gap: 14px; padding-block: 16px 12px; padding-inline: 20px 16px; border-bottom: 1px solid var(--c-line-soft); }
|
|
147
|
+
.wb-sheet-head > div:first-child { flex: 1; min-width: 0; }
|
|
148
|
+
.wb-sheet-head .bt-seg { flex: none; }
|
|
149
|
+
.wb-sheet-head h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
|
|
150
|
+
.wb-sheet-head h2 span { color: var(--c-muted); font-weight: 450; }
|
|
151
|
+
.wb-sheet-head p { margin: 3px 0 0; color: var(--c-muted); font-size: 12px; }
|
|
152
|
+
.wb-sheet-close { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--c-line); border-radius: 9px; background: var(--c-field); color: var(--c-muted); cursor: pointer; }
|
|
153
|
+
.wb-sheet-close:hover { color: var(--c-text); border-color: var(--c-line-strong); }
|
|
154
|
+
.wb-sheet-foot { padding: 10px 20px 12px; border-top: 1px solid var(--c-line-soft); color: var(--c-faint); font-size: 11px; line-height: 1.5; }
|
|
155
|
+
|
|
156
|
+
.wb-fb-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 20px; }
|
|
157
|
+
.wb-fb-search { flex: 1 1 260px; }
|
|
158
|
+
.wb-fb-cats { display: flex; flex-wrap: wrap; gap: 4px; }
|
|
159
|
+
.wb-fb-cats button { height: 28px; padding: 0 11px; border: 1px solid var(--c-line); border-radius: 999px; background: transparent; color: var(--c-muted); font-size: 12px; font-weight: 540; cursor: pointer; transition: color .15s, background-color .15s, border-color .15s; }
|
|
160
|
+
.wb-fb-cats button:hover { color: var(--c-text); border-color: var(--c-line-strong); }
|
|
161
|
+
.wb-fb-cats button.is-on { background: var(--c-text); border-color: var(--c-text); color: var(--c-ground); }
|
|
162
|
+
.wb-fb-cats .wb-fb-installed { margin-inline-start: 6px; }
|
|
163
|
+
.wb-fb-cats .wb-fb-installed.is-on { background: var(--c-accent-soft); border-color: var(--c-accent); color: var(--c-accent); }
|
|
164
|
+
|
|
165
|
+
.wb-fb-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 1.05fr); min-height: 0; border-top: 1px solid var(--c-line-soft); }
|
|
166
|
+
@container panel (max-width: 760px) { .wb-fb-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } .wb-fb-detail { max-height: 50%; border-inline-start: 0 !important; border-top: 1px solid var(--c-line-soft); } }
|
|
167
|
+
.wb-fb-list { margin: 0; padding: 6px; overflow-y: auto; list-style: none; scrollbar-width: thin; scrollbar-color: var(--c-line) transparent; outline: none; }
|
|
168
|
+
.wb-fb-list:focus-visible { box-shadow: inset 0 0 0 2px var(--c-accent); }
|
|
169
|
+
.wb-fb-list li[role=option] { display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'name tags' 'meta tags'; align-items: center; column-gap: 10px; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
|
|
170
|
+
.wb-fb-list li.is-active { background: var(--c-field); }
|
|
171
|
+
.wb-fb-list li.is-on { background: var(--c-accent-soft); box-shadow: inset 0 0 0 1px rgb(var(--c-accent-rgb) / .45); }
|
|
172
|
+
.wb-fb-name { grid-area: name; overflow: hidden; font-size: 21px; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; transition: opacity .2s; }
|
|
173
|
+
.wb-fb-name.is-loading { opacity: .45; }
|
|
174
|
+
.wb-fb-meta { grid-area: meta; color: var(--c-muted); font-size: 11px; }
|
|
175
|
+
.wb-fb-tag { grid-area: tags; justify-self: end; padding: 2px 7px; border-radius: 6px; background: var(--c-field); color: var(--c-muted); font: 600 10px/1.4 var(--f-mono); letter-spacing: .02em; }
|
|
176
|
+
.wb-fb-tag.is-accent { background: var(--c-accent-soft); color: var(--c-accent); }
|
|
177
|
+
.wb-fb-tag + .wb-fb-tag { grid-row: 2; }
|
|
178
|
+
.wb-fb-empty { padding: 30px 14px; color: var(--c-muted); text-align: center; }
|
|
179
|
+
.wb-fb-more { display: flex; justify-content: center; padding: 8px; }
|
|
180
|
+
|
|
181
|
+
.wb-fb-detail { display: flex; flex-direction: column; gap: 16px; padding: 18px 20px; overflow-y: auto; border-inline-start: 1px solid var(--c-line-soft); background: var(--c-ground); scrollbar-width: thin; }
|
|
182
|
+
.wb-fb-detail.is-empty { justify-content: center; color: var(--c-muted); text-align: center; }
|
|
183
|
+
.wb-fb-hero { display: flex; flex-direction: column; gap: 4px; }
|
|
184
|
+
.wb-fb-hero-name { font-size: 40px; line-height: 1.1; letter-spacing: -.01em; overflow-wrap: anywhere; }
|
|
185
|
+
.wb-fb-hero-meta { color: var(--c-muted); font-size: 12px; }
|
|
186
|
+
.wb-fb-sample { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--c-line-soft); border-radius: 12px; background: var(--c-card); }
|
|
187
|
+
.wb-fb-sample-text { min-height: 2.6em; font-size: 24px; line-height: 1.3; overflow-wrap: anywhere; }
|
|
188
|
+
.wb-fb-sample textarea { width: 100%; padding: 7px 9px; border: 1px solid var(--c-line); border-radius: 8px; background: var(--c-field); color: var(--c-text); font: 12.5px/1.45 var(--f-ui); resize: none; }
|
|
189
|
+
.wb-fb-sample textarea:focus { outline: none; border-color: var(--c-accent); }
|
|
190
|
+
.wb-fb-samples { display: flex; flex-wrap: wrap; gap: 4px; }
|
|
191
|
+
.wb-fb-samples button { height: 24px; padding: 0 9px; border: 1px solid var(--c-line); border-radius: 999px; background: transparent; color: var(--c-muted); font-size: 11px; cursor: pointer; }
|
|
192
|
+
.wb-fb-samples button.is-on, .wb-fb-samples button:hover { color: var(--c-text); border-color: var(--c-line-strong); }
|
|
193
|
+
.wb-fb-field { display: flex; flex-direction: column; gap: 8px; }
|
|
194
|
+
.wb-fb-field > span { color: var(--c-muted); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
|
|
195
|
+
.wb-fb-field > small { color: var(--c-faint); font-size: 11.5px; line-height: 1.45; }
|
|
196
|
+
.wb-fb-range { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
|
|
197
|
+
.wb-fb-weights { display: flex; flex-wrap: wrap; gap: 4px; }
|
|
198
|
+
.wb-fb-weights button { min-width: 44px; height: 28px; padding: 0 9px; border: 1px solid var(--c-line); border-radius: 8px; background: var(--c-field); color: var(--c-muted); font: 500 11.5px/1 var(--f-mono); cursor: pointer; }
|
|
199
|
+
.wb-fb-weights button.is-on { border-color: var(--c-accent); background: var(--c-accent-soft); color: var(--c-text); }
|
|
200
|
+
.wb-fb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
|
|
201
|
+
.wb-fb-error { margin: 0; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--c-danger) 12%, transparent); color: var(--c-danger); font-size: 12px; }
|
|
202
|
+
|
|
203
|
+
.wb-fb-system { flex: 1; overflow-y: auto; padding: 16px 20px; }
|
|
204
|
+
.wb-fb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
|
|
205
|
+
.wb-fb-grid button { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 14px; border: 1px solid var(--c-line-soft); border-radius: 12px; background: var(--c-ground); color: var(--c-text); text-align: start; cursor: pointer; }
|
|
206
|
+
.wb-fb-grid button:hover { border-color: var(--c-line-strong); }
|
|
207
|
+
.wb-fb-grid button.is-on { border-color: var(--c-accent); box-shadow: 0 0 0 1px var(--c-accent); }
|
|
208
|
+
.wb-fb-grid span { font-size: 18px; }
|
|
209
|
+
.wb-fb-grid small { color: var(--c-muted); font-size: 12px; }
|
|
210
|
+
.wb-fb-custom { display: flex; align-items: flex-end; gap: 10px; padding: 14px; border: 1px dashed var(--c-line-strong); border-radius: 12px; }
|
|
211
|
+
.wb-fb-custom label { flex: 1; display: flex; flex-direction: column; gap: 6px; }
|
|
212
|
+
.wb-fb-custom label span { color: var(--c-muted); font-size: 12px; }
|
|
213
|
+
.wb-fb-custom input { height: 34px; padding: 0 10px; border: 1px solid var(--c-line); border-radius: 9px; background: var(--c-field); color: var(--c-text); font-size: 15px; }
|
|
214
|
+
.wb-fb-custom input:focus { outline: none; border-color: var(--c-accent); }
|
|
215
|
+
|
|
216
|
+
/* ---------------------------------------------------------------------------------------------
|
|
217
|
+
* Appearance: account and pane themes, downloaded fonts */
|
|
218
|
+
.wb-scope-list { display: flex; flex-direction: column; gap: 2px; width: 100%; }
|
|
219
|
+
.wb-scope { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 6px 2px; }
|
|
220
|
+
.wb-scope-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
|
|
221
|
+
.wb-scope-who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
|
|
222
|
+
.wb-scope-who b { overflow: hidden; font-size: 13px; font-weight: 560; white-space: nowrap; text-overflow: ellipsis; }
|
|
223
|
+
.wb-scope-who small { overflow: hidden; color: var(--c-muted); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
|
|
224
|
+
.wb-scope-avatar { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; color: #fff; font-size: 12px; font-weight: 650; }
|
|
225
|
+
.wb-scope-avatar img { width: 100%; height: 100%; object-fit: cover; }
|
|
226
|
+
.wb-scope .wb-dots { margin-inline-end: 2px; }
|
|
227
|
+
.wb-fontlist { display: flex; flex-direction: column; width: 100%; }
|
|
228
|
+
.wb-fontlist li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 7px 2px; }
|
|
229
|
+
.wb-fontlist li + li { border-top: 1px solid var(--c-line-soft); }
|
|
230
|
+
.wb-fontlist b { font-size: 17px; font-weight: 450; }
|
|
231
|
+
.wb-fontlist small { color: var(--c-muted); font: 11px/1.4 var(--f-mono); }
|
|
232
|
+
.wb-fontlist ul { margin: 0; padding: 0; list-style: none; }
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type Palette, type ThemeColors, type ThemeSpec } from '../../runtime/themeSpec.ts';
|
|
2
|
+
export type History = {
|
|
3
|
+
past: ThemeSpec[];
|
|
4
|
+
present: ThemeSpec;
|
|
5
|
+
future: ThemeSpec[];
|
|
6
|
+
};
|
|
7
|
+
export declare const MAX_HISTORY = 100;
|
|
8
|
+
export declare const startHistory: (theme: ThemeSpec) => History;
|
|
9
|
+
/** A change. `commit: false` updates the present in place (a slider being dragged); the drag's
|
|
10
|
+
* final commit records one undo step from where the drag started (`from`). */
|
|
11
|
+
export declare function record(history: History, next: ThemeSpec, options?: {
|
|
12
|
+
commit?: boolean;
|
|
13
|
+
from?: ThemeSpec;
|
|
14
|
+
}): History;
|
|
15
|
+
export declare function undo(history: History): History;
|
|
16
|
+
export declare function redo(history: History): History;
|
|
17
|
+
/** Where a draft starts when its theme keeps the site's own colors, and which theme that is. */
|
|
18
|
+
export type DraftSite = {
|
|
19
|
+
colors: Base;
|
|
20
|
+
siteTheme: string;
|
|
21
|
+
};
|
|
22
|
+
/** A draft to edit from any theme: the site's own look (no colors) starts from `site.colors`. */
|
|
23
|
+
export declare function draftFrom(theme: ThemeSpec, site: DraftSite, name?: string): ThemeSpec;
|
|
24
|
+
export type Base = {
|
|
25
|
+
bg: string;
|
|
26
|
+
text: string;
|
|
27
|
+
accent: string;
|
|
28
|
+
};
|
|
29
|
+
export declare const DERIVED_ROLES: readonly ["surface", "elevated", "border", "muted", "inverse", "onInverse", "page"];
|
|
30
|
+
export type DerivedRole = typeof DERIVED_ROLES[number];
|
|
31
|
+
/** The full palette from three base colors; `pinned` roles keep the value the owner set by hand. */
|
|
32
|
+
export declare function paletteFrom(base: Base, pinned?: Partial<Record<DerivedRole, string>>): ThemeColors;
|
|
33
|
+
/** Which derived roles differ from what the three base colors would give (they are "pinned"). */
|
|
34
|
+
export declare function pinnedRoles(colors: ThemeColors): Partial<Record<DerivedRole, string>>;
|
|
35
|
+
/** Light or dark, from the palette itself. */
|
|
36
|
+
export declare const modeOf: (colors: Pick<Palette, "bg" | "text">) => "light" | "dark";
|
|
37
|
+
export type ContrastCheck = {
|
|
38
|
+
id: string;
|
|
39
|
+
label: string;
|
|
40
|
+
fg: string;
|
|
41
|
+
bg: string;
|
|
42
|
+
ratio: number;
|
|
43
|
+
need: number;
|
|
44
|
+
pass: boolean;
|
|
45
|
+
};
|
|
46
|
+
/** The pairs a site's page draws, with the level wayBetter enforces for each (7:1 text, 4.5:1 secondary text, links and labels, 3:1 the button on the page). */
|
|
47
|
+
export declare function contrastReport(colors: ThemeColors): ContrastCheck[];
|
|
48
|
+
/** WCAG level of a ratio for normal text. */
|
|
49
|
+
export declare const wcagLevel: (ratio: number) => "AAA" | "AA" | "AA large" | "Fail";
|
|
50
|
+
/** What the runtime would draw anyway: the palette moved just enough to pass every check. */
|
|
51
|
+
export declare const autoFix: (colors: ThemeColors) => ThemeColors;
|
|
52
|
+
/** A unique id for a new theme named `name` among `taken` ids (pass the built-in ones too). */
|
|
53
|
+
export declare function uniqueId(name: string, taken: Iterable<string>): string;
|
|
54
|
+
/** The theme file: sanitized, `$schema` first, pretty-printed. */
|
|
55
|
+
export declare function themeJson(theme: ThemeSpec): string;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// The Theme Builder's model: a draft theme document with undo/redo, a palette derived from three
|
|
2
|
+
// base colors, the contrast report the builder shows (and its auto-fix), and export/share JSON.
|
|
3
|
+
// Pure, so the tests exercise exactly what the builder does.
|
|
4
|
+
import { THEME_SCHEMA_URL, contrastRatio, relativeLuminance } from "../../runtime/themeApi.js";
|
|
5
|
+
import { ensureContrast, sanitizeSpec, slug } from "../../runtime/themeSpec.js";
|
|
6
|
+
import { deriveColors } from "../../runtime/themeTokens.js";
|
|
7
|
+
export const MAX_HISTORY = 100;
|
|
8
|
+
export const startHistory = (theme) => ({ past: [], present: theme, future: [] });
|
|
9
|
+
/** A change. `commit: false` updates the present in place (a slider being dragged); the drag's
|
|
10
|
+
* final commit records one undo step from where the drag started (`from`). */
|
|
11
|
+
export function record(history, next, options = {}) {
|
|
12
|
+
if (options.commit === false)
|
|
13
|
+
return { ...history, present: next };
|
|
14
|
+
const base = options.from ?? history.present;
|
|
15
|
+
if (JSON.stringify(base) === JSON.stringify(next))
|
|
16
|
+
return { ...history, present: next };
|
|
17
|
+
return { past: [...history.past, base].slice(-MAX_HISTORY), present: next, future: [] };
|
|
18
|
+
}
|
|
19
|
+
export function undo(history) {
|
|
20
|
+
const previous = history.past[history.past.length - 1];
|
|
21
|
+
if (!previous)
|
|
22
|
+
return history;
|
|
23
|
+
return { past: history.past.slice(0, -1), present: previous, future: [history.present, ...history.future] };
|
|
24
|
+
}
|
|
25
|
+
export function redo(history) {
|
|
26
|
+
const next = history.future[0];
|
|
27
|
+
if (!next)
|
|
28
|
+
return history;
|
|
29
|
+
return { past: [...history.past, history.present], present: next, future: history.future.slice(1) };
|
|
30
|
+
}
|
|
31
|
+
/** A draft to edit from any theme: the site's own look (no colors) starts from `site.colors`. */
|
|
32
|
+
export function draftFrom(theme, site, name = `${theme.name} remix`) {
|
|
33
|
+
const colors = theme.colors ?? deriveColors({ ...site.colors });
|
|
34
|
+
return sanitizeSpec({ ...JSON.parse(JSON.stringify(theme)), id: slug(name), name, author: 'You', description: theme.id === site.siteTheme ? '' : `Based on ${theme.name}.`, colors, mode: theme.mode === 'auto' ? 'dark' : theme.mode });
|
|
35
|
+
}
|
|
36
|
+
export const DERIVED_ROLES = ['surface', 'elevated', 'border', 'muted', 'inverse', 'onInverse', 'page'];
|
|
37
|
+
/** The full palette from three base colors; `pinned` roles keep the value the owner set by hand. */
|
|
38
|
+
export function paletteFrom(base, pinned = {}) {
|
|
39
|
+
const derived = deriveColors(base);
|
|
40
|
+
return { ...derived, inverse: base.text, onInverse: base.bg, page: base.bg, ...pinned };
|
|
41
|
+
}
|
|
42
|
+
/** Which derived roles differ from what the three base colors would give (they are "pinned"). */
|
|
43
|
+
export function pinnedRoles(colors) {
|
|
44
|
+
const auto = paletteFrom({ bg: colors.bg, text: colors.text, accent: colors.accent });
|
|
45
|
+
const out = {};
|
|
46
|
+
for (const role of DERIVED_ROLES) {
|
|
47
|
+
const value = colors[role];
|
|
48
|
+
if (value && value !== auto[role])
|
|
49
|
+
out[role] = value;
|
|
50
|
+
}
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
|
+
/** Light or dark, from the palette itself. */
|
|
54
|
+
export const modeOf = (colors) => relativeLuminance(colors.bg) < relativeLuminance(colors.text) ? 'dark' : 'light';
|
|
55
|
+
/** The pairs a site's page draws, with the level wayBetter enforces for each (7:1 text, 4.5:1 secondary text, links and labels, 3:1 the button on the page). */
|
|
56
|
+
export function contrastReport(colors) {
|
|
57
|
+
const page = colors.page ?? colors.bg;
|
|
58
|
+
const inverse = colors.inverse ?? colors.text;
|
|
59
|
+
const onInverse = colors.onInverse ?? colors.bg;
|
|
60
|
+
const pairs = [
|
|
61
|
+
['text-bg', 'Text on background', colors.text, colors.bg, 7],
|
|
62
|
+
['text-surface', 'Text on cards and menus', colors.text, colors.surface, 7],
|
|
63
|
+
['text-page', 'Text on the page canvas', colors.text, page, 7],
|
|
64
|
+
['muted-bg', 'Secondary text', colors.muted, colors.bg, 4.5],
|
|
65
|
+
['muted-surface', 'Secondary text on cards', colors.muted, colors.surface, 4.5],
|
|
66
|
+
['accent-bg', 'Links and accent', colors.accent, colors.bg, 4.5],
|
|
67
|
+
['accent-elevated', 'Links on hover', colors.accent, colors.elevated, 4.5],
|
|
68
|
+
['button-label', 'Post button label', onInverse, inverse, 4.5],
|
|
69
|
+
['button-page', 'Post button on the page', inverse, colors.bg, 3],
|
|
70
|
+
];
|
|
71
|
+
return pairs.map(([id, label, fg, bg, need]) => {
|
|
72
|
+
const ratio = contrastRatio(fg, bg);
|
|
73
|
+
return { id, label, fg, bg, ratio: Math.round(ratio * 100) / 100, need, pass: ratio >= need - 0.005 };
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/** WCAG level of a ratio for normal text. */
|
|
77
|
+
export const wcagLevel = (ratio) => ratio >= 7 ? 'AAA' : ratio >= 4.5 ? 'AA' : ratio >= 3 ? 'AA large' : 'Fail';
|
|
78
|
+
/** What the runtime would draw anyway: the palette moved just enough to pass every check. */
|
|
79
|
+
export const autoFix = (colors) => ensureContrast(colors);
|
|
80
|
+
// ---------------------------------------------------------------------------------------------
|
|
81
|
+
// Saving and sharing
|
|
82
|
+
/** A unique id for a new theme named `name` among `taken` ids (pass the built-in ones too). */
|
|
83
|
+
export function uniqueId(name, taken) {
|
|
84
|
+
const used = new Set(taken);
|
|
85
|
+
const base = slug(name);
|
|
86
|
+
let id = base;
|
|
87
|
+
for (let n = 2; used.has(id); n++)
|
|
88
|
+
id = `${base.slice(0, 36)}-${n}`;
|
|
89
|
+
return id;
|
|
90
|
+
}
|
|
91
|
+
/** The theme file: sanitized, `$schema` first, pretty-printed. */
|
|
92
|
+
export function themeJson(theme) {
|
|
93
|
+
return JSON.stringify({ $schema: THEME_SCHEMA_URL, ...sanitizeSpec(theme) }, null, 2);
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=builderModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builderModel.js","sourceRoot":"","sources":["../../../../../../shell/src/panel/builderModel.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,gGAAgG;AAChG,6DAA6D;AAC7D,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACtG,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,IAAI,EAAkD,MAAM,mCAAmC,CAAC;AACvI,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAMnE,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAC;AAE/B,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAgB,EAAW,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;AAEtG;8EAC8E;AAC9E,MAAM,UAAU,MAAM,CAAC,OAAgB,EAAE,IAAe,EAAE,UAAkD,EAAE;IAC5G,IAAI,OAAO,CAAC,MAAM,KAAK,KAAK;QAAE,OAAO,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACnE,MAAM,IAAI,GAAG,OAA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AAO,GAAG,CAAC,MAAmB,EAAe,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;AAEpF,gGAAgG;AAChG,qBAAqB;AAErB,+FAA+F;AAC/F,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,KAAuB;IAC5D,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;IACxB,IAAI,EAAE,GAAG,IAAI,CAAC;IACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;QAAE,EAAE,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;IACpE,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,SAAS,CAAC,KAAgB;IACxC,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACxF,CAAC","sourcesContent":["// The Theme Builder's model: a draft theme document with undo/redo, a palette derived from three\n// base colors, the contrast report the builder shows (and its auto-fix), and export/share JSON.\n// Pure, so the tests exercise exactly what the builder does.\nimport { THEME_SCHEMA_URL, contrastRatio, relativeLuminance } from '../../../runtime/src/themeApi.ts';\nimport { ensureContrast, sanitizeSpec, slug, type Palette, type ThemeColors, type ThemeSpec } from '../../../runtime/src/themeSpec.ts';\nimport { deriveColors } from '../../../runtime/src/themeTokens.ts';\n\n// ---------------------------------------------------------------------------------------------\n// History\n\nexport type History = { past: ThemeSpec[]; present: ThemeSpec; future: ThemeSpec[] };\nexport const MAX_HISTORY = 100;\n\nexport const startHistory = (theme: ThemeSpec): History => ({ past: [], present: theme, future: [] });\n\n/** A change. `commit: false` updates the present in place (a slider being dragged); the drag's\n * final commit records one undo step from where the drag started (`from`). */\nexport function record(history: History, next: ThemeSpec, options: { commit?: boolean; from?: ThemeSpec } = {}): History {\n if (options.commit === false) return { ...history, present: next };\n const base = options.from ?? history.present;\n if (JSON.stringify(base) === JSON.stringify(next)) return { ...history, present: next };\n return { past: [...history.past, base].slice(-MAX_HISTORY), present: next, future: [] };\n}\nexport function undo(history: History): History {\n const previous = history.past[history.past.length - 1];\n if (!previous) return history;\n return { past: history.past.slice(0, -1), present: previous, future: [history.present, ...history.future] };\n}\nexport function redo(history: History): History {\n const next = history.future[0];\n if (!next) return history;\n return { past: [...history.past, history.present], present: next, future: history.future.slice(1) };\n}\n\n// ---------------------------------------------------------------------------------------------\n// Drafts and colors\n\n/** Where a draft starts when its theme keeps the site's own colors, and which theme that is. */\nexport type DraftSite = { colors: Base; siteTheme: string };\n\n/** A draft to edit from any theme: the site's own look (no colors) starts from `site.colors`. */\nexport function draftFrom(theme: ThemeSpec, site: DraftSite, name = `${theme.name} remix`): ThemeSpec {\n const colors = theme.colors ?? deriveColors({ ...site.colors }) as ThemeColors;\n return sanitizeSpec({ ...JSON.parse(JSON.stringify(theme)), id: slug(name), name, author: 'You', description: theme.id === site.siteTheme ? '' : `Based on ${theme.name}.`, colors, mode: theme.mode === 'auto' ? 'dark' : theme.mode });\n}\n\nexport type Base = { bg: string; text: string; accent: string };\nexport const DERIVED_ROLES = ['surface', 'elevated', 'border', 'muted', 'inverse', 'onInverse', 'page'] as const;\nexport type DerivedRole = typeof DERIVED_ROLES[number];\n\n/** The full palette from three base colors; `pinned` roles keep the value the owner set by hand. */\nexport function paletteFrom(base: Base, pinned: Partial<Record<DerivedRole, string>> = {}): ThemeColors {\n const derived = deriveColors(base) as ThemeColors;\n return { ...derived, inverse: base.text, onInverse: base.bg, page: base.bg, ...pinned };\n}\n\n/** Which derived roles differ from what the three base colors would give (they are \"pinned\"). */\nexport function pinnedRoles(colors: ThemeColors): Partial<Record<DerivedRole, string>> {\n const auto = paletteFrom({ bg: colors.bg, text: colors.text, accent: colors.accent });\n const out: Partial<Record<DerivedRole, string>> = {};\n for (const role of DERIVED_ROLES) { const value = colors[role]; if (value && value !== auto[role]) out[role] = value; }\n return out;\n}\n\n/** Light or dark, from the palette itself. */\nexport const modeOf = (colors: Pick<Palette, 'bg' | 'text'>): 'light' | 'dark' => relativeLuminance(colors.bg) < relativeLuminance(colors.text) ? 'dark' : 'light';\n\n// ---------------------------------------------------------------------------------------------\n// Contrast\n\nexport type ContrastCheck = { id: string; label: string; fg: string; bg: string; ratio: number; need: number; pass: boolean };\n\n/** The pairs a site's page draws, with the level wayBetter enforces for each (7:1 text, 4.5:1 secondary text, links and labels, 3:1 the button on the page). */\nexport function contrastReport(colors: ThemeColors): ContrastCheck[] {\n const page = colors.page ?? colors.bg;\n const inverse = colors.inverse ?? colors.text;\n const onInverse = colors.onInverse ?? colors.bg;\n const pairs: Array<[string, string, string, string, number]> = [\n ['text-bg', 'Text on background', colors.text, colors.bg, 7],\n ['text-surface', 'Text on cards and menus', colors.text, colors.surface, 7],\n ['text-page', 'Text on the page canvas', colors.text, page, 7],\n ['muted-bg', 'Secondary text', colors.muted, colors.bg, 4.5],\n ['muted-surface', 'Secondary text on cards', colors.muted, colors.surface, 4.5],\n ['accent-bg', 'Links and accent', colors.accent, colors.bg, 4.5],\n ['accent-elevated', 'Links on hover', colors.accent, colors.elevated, 4.5],\n ['button-label', 'Post button label', onInverse, inverse, 4.5],\n ['button-page', 'Post button on the page', inverse, colors.bg, 3],\n ];\n return pairs.map(([id, label, fg, bg, need]) => {\n const ratio = contrastRatio(fg, bg);\n return { id, label, fg, bg, ratio: Math.round(ratio * 100) / 100, need, pass: ratio >= need - 0.005 };\n });\n}\n\n/** WCAG level of a ratio for normal text. */\nexport const wcagLevel = (ratio: number) => ratio >= 7 ? 'AAA' : ratio >= 4.5 ? 'AA' : ratio >= 3 ? 'AA large' : 'Fail';\n\n/** What the runtime would draw anyway: the palette moved just enough to pass every check. */\nexport const autoFix = (colors: ThemeColors): ThemeColors => ensureContrast(colors);\n\n// ---------------------------------------------------------------------------------------------\n// Saving and sharing\n\n/** A unique id for a new theme named `name` among `taken` ids (pass the built-in ones too). */\nexport function uniqueId(name: string, taken: Iterable<string>): string {\n const used = new Set(taken);\n const base = slug(name);\n let id = base;\n for (let n = 2; used.has(id); n++) id = `${base.slice(0, 36)}-${n}`;\n return id;\n}\n\n/** The theme file: sanitized, `$schema` first, pretty-printed. */\nexport function themeJson(theme: ThemeSpec): string {\n return JSON.stringify({ $schema: THEME_SCHEMA_URL, ...sanitizeSpec(theme) }, null, 2);\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ComparedLine = {
|
|
2
|
+
text: string;
|
|
3
|
+
changed: boolean;
|
|
4
|
+
};
|
|
5
|
+
/** A bounded line comparison: large documents use prefix/suffix matching. */
|
|
6
|
+
export declare function compareLines(previous: string, current: string): {
|
|
7
|
+
previous: ComparedLine[];
|
|
8
|
+
current: ComparedLine[];
|
|
9
|
+
simplified: boolean;
|
|
10
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** A bounded line comparison: large documents use prefix/suffix matching. */
|
|
2
|
+
export function compareLines(previous, current) {
|
|
3
|
+
const oldLines = previous.split('\n');
|
|
4
|
+
const newLines = current.split('\n');
|
|
5
|
+
const oldSame = new Set();
|
|
6
|
+
const newSame = new Set();
|
|
7
|
+
const simplified = oldLines.length * newLines.length > 160_000;
|
|
8
|
+
if (simplified) {
|
|
9
|
+
let start = 0;
|
|
10
|
+
while (start < oldLines.length && start < newLines.length && oldLines[start] === newLines[start]) {
|
|
11
|
+
oldSame.add(start);
|
|
12
|
+
newSame.add(start);
|
|
13
|
+
start++;
|
|
14
|
+
}
|
|
15
|
+
let oldEnd = oldLines.length - 1;
|
|
16
|
+
let newEnd = newLines.length - 1;
|
|
17
|
+
while (oldEnd >= start && newEnd >= start && oldLines[oldEnd] === newLines[newEnd]) {
|
|
18
|
+
oldSame.add(oldEnd--);
|
|
19
|
+
newSame.add(newEnd--);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
const columns = newLines.length + 1;
|
|
24
|
+
const lengths = new Uint32Array((oldLines.length + 1) * columns);
|
|
25
|
+
for (let i = oldLines.length - 1; i >= 0; i--) {
|
|
26
|
+
for (let j = newLines.length - 1; j >= 0; j--) {
|
|
27
|
+
lengths[i * columns + j] = oldLines[i] === newLines[j]
|
|
28
|
+
? lengths[(i + 1) * columns + j + 1] + 1
|
|
29
|
+
: Math.max(lengths[(i + 1) * columns + j], lengths[i * columns + j + 1]);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
let i = 0;
|
|
33
|
+
let j = 0;
|
|
34
|
+
while (i < oldLines.length && j < newLines.length) {
|
|
35
|
+
if (oldLines[i] === newLines[j]) {
|
|
36
|
+
oldSame.add(i++);
|
|
37
|
+
newSame.add(j++);
|
|
38
|
+
}
|
|
39
|
+
else if (lengths[(i + 1) * columns + j] >= lengths[i * columns + j + 1])
|
|
40
|
+
i++;
|
|
41
|
+
else
|
|
42
|
+
j++;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
previous: oldLines.map((text, index) => ({ text, changed: !oldSame.has(index) })),
|
|
47
|
+
current: newLines.map((text, index) => ({ text, changed: !newSame.has(index) })),
|
|
48
|
+
simplified,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=compare.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare.js","sourceRoot":"","sources":["../../../../../../shell/src/panel/compare.ts"],"names":[],"mappings":"AAEA,6EAA6E;AAC7E,MAAM,UAAU,YAAY,CAAC,QAAgB,EAAE,OAAe;IAC5D,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,IAA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AAK,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACjF,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAChF,UAAU;KACX,CAAC;AACJ,CAAC","sourcesContent":["export type ComparedLine = { text: string; changed: boolean };\n\n/** A bounded line comparison: large documents use prefix/suffix matching. */\nexport function compareLines(previous: string, current: string): { previous: ComparedLine[]; current: ComparedLine[]; simplified: boolean } {\n const oldLines = previous.split('\\n');\n const newLines = current.split('\\n');\n const oldSame = new Set<number>();\n const newSame = new Set<number>();\n const simplified = oldLines.length * newLines.length > 160_000;\n if (simplified) {\n let start = 0;\n while (start < oldLines.length && start < newLines.length && oldLines[start] === newLines[start]) {\n oldSame.add(start); newSame.add(start); start++;\n }\n let oldEnd = oldLines.length - 1;\n let newEnd = newLines.length - 1;\n while (oldEnd >= start && newEnd >= start && oldLines[oldEnd] === newLines[newEnd]) {\n oldSame.add(oldEnd--); newSame.add(newEnd--);\n }\n } else {\n const columns = newLines.length + 1;\n const lengths = new Uint32Array((oldLines.length + 1) * columns);\n for (let i = oldLines.length - 1; i >= 0; i--) {\n for (let j = newLines.length - 1; j >= 0; j--) {\n lengths[i * columns + j] = oldLines[i] === newLines[j]\n ? lengths[(i + 1) * columns + j + 1] + 1\n : Math.max(lengths[(i + 1) * columns + j], lengths[i * columns + j + 1]);\n }\n }\n let i = 0; let j = 0;\n while (i < oldLines.length && j < newLines.length) {\n if (oldLines[i] === newLines[j]) { oldSame.add(i++); newSame.add(j++); }\n else if (lengths[(i + 1) * columns + j] >= lengths[i * columns + j + 1]) i++;\n else j++;\n }\n }\n return {\n previous: oldLines.map((text, index) => ({ text, changed: !oldSame.has(index) })),\n current: newLines.map((text, index) => ({ text, changed: !newSame.has(index) })),\n simplified,\n };\n}\n"]}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
export declare const SearchProvider: import("react").Provider<string>;
|
|
3
|
+
export declare const useSettingsQuery: () => string;
|
|
4
|
+
/** Whether every word of the settings search is in one of `texts`. */
|
|
5
|
+
export declare const matchesQuery: (query: string, ...texts: Array<string | undefined>) => boolean;
|
|
6
|
+
export declare function Section({ title, hint, action, children, id }: {
|
|
7
|
+
title: string;
|
|
8
|
+
hint?: ReactNode;
|
|
9
|
+
action?: ReactNode;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
id?: string;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
/** A setting: label and hint on the left, one control on the right. `wide` puts the control on its own line. */
|
|
14
|
+
export declare function Row({ label, hint, children, keywords, wide, badge }: {
|
|
15
|
+
label: string;
|
|
16
|
+
hint?: ReactNode;
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
keywords?: string;
|
|
19
|
+
wide?: boolean;
|
|
20
|
+
badge?: ReactNode;
|
|
21
|
+
}): import("react").JSX.Element | null;
|
|
22
|
+
export declare function Badge({ children, tone }: {
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
tone?: 'plain' | 'accent' | 'warn' | 'ok';
|
|
25
|
+
}): import("react").JSX.Element;
|
|
26
|
+
export declare function EmptyState({ icon, title, children, action }: {
|
|
27
|
+
icon?: ReactNode;
|
|
28
|
+
title: string;
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
action?: ReactNode;
|
|
31
|
+
}): import("react").JSX.Element;
|
|
32
|
+
type ButtonProps = {
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
onClick?: () => void;
|
|
35
|
+
tone?: 'plain' | 'primary' | 'danger' | 'ghost';
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
title?: string;
|
|
38
|
+
icon?: ReactNode;
|
|
39
|
+
size?: 'sm' | 'md';
|
|
40
|
+
type?: 'button' | 'submit';
|
|
41
|
+
label?: string;
|
|
42
|
+
};
|
|
43
|
+
export declare function Button({ children, onClick, tone, disabled, title, icon, size, type, label }: ButtonProps): import("react").JSX.Element;
|
|
44
|
+
export declare function Toggle({ checked, onChange, label, disabled }: {
|
|
45
|
+
checked: boolean;
|
|
46
|
+
onChange(next: boolean): void;
|
|
47
|
+
label: string;
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
}): import("react").JSX.Element;
|
|
50
|
+
/** `group`: a Select shows a heading above the first option of each group (options of a group are consecutive). */
|
|
51
|
+
export type Option<T extends string | number> = {
|
|
52
|
+
value: T;
|
|
53
|
+
label: string;
|
|
54
|
+
hint?: string;
|
|
55
|
+
icon?: ReactNode;
|
|
56
|
+
style?: CSSProperties;
|
|
57
|
+
group?: string;
|
|
58
|
+
};
|
|
59
|
+
export declare function Segmented<T extends string | number>({ value, options, onChange, label, size }: {
|
|
60
|
+
value: T | null;
|
|
61
|
+
options: Array<Option<T>>;
|
|
62
|
+
onChange(next: T): void;
|
|
63
|
+
label: string;
|
|
64
|
+
size?: 'sm' | 'md';
|
|
65
|
+
}): import("react").JSX.Element;
|
|
66
|
+
export declare function Select<T extends string>({ value, options, onChange, label, placeholder: givenPlaceholder, width }: {
|
|
67
|
+
value: T | null;
|
|
68
|
+
options: Array<Option<T>>;
|
|
69
|
+
onChange(next: T): void;
|
|
70
|
+
label: string;
|
|
71
|
+
placeholder?: string;
|
|
72
|
+
width?: number;
|
|
73
|
+
}): import("react").JSX.Element;
|
|
74
|
+
export declare function Slider({ value, min, max, step, onChange, onCommit, label, format }: {
|
|
75
|
+
value: number;
|
|
76
|
+
min: number;
|
|
77
|
+
max: number;
|
|
78
|
+
step?: number;
|
|
79
|
+
onChange(next: number): void;
|
|
80
|
+
onCommit?(next: number): void;
|
|
81
|
+
label: string;
|
|
82
|
+
format(value: number): string;
|
|
83
|
+
}): import("react").JSX.Element;
|
|
84
|
+
export declare function ColorField({ value, swatches, onChange, autoLabel, label }: {
|
|
85
|
+
value: string | null;
|
|
86
|
+
swatches: string[];
|
|
87
|
+
onChange(next: string | null): void;
|
|
88
|
+
autoLabel?: string;
|
|
89
|
+
label: string;
|
|
90
|
+
}): import("react").JSX.Element;
|
|
91
|
+
export declare function TextInput({ value, onChange, placeholder, label, type, width, onEnter, mono }: {
|
|
92
|
+
value: string;
|
|
93
|
+
onChange(next: string): void;
|
|
94
|
+
placeholder?: string;
|
|
95
|
+
label: string;
|
|
96
|
+
type?: string;
|
|
97
|
+
width?: number | string;
|
|
98
|
+
onEnter?(): void;
|
|
99
|
+
mono?: boolean;
|
|
100
|
+
}): import("react").JSX.Element;
|
|
101
|
+
/** An input with its action button attached (Save, Add…). */
|
|
102
|
+
export declare function InputRow({ value, onChange, onSubmit, placeholder, label, button, disabled, mono }: {
|
|
103
|
+
value: string;
|
|
104
|
+
onChange(next: string): void;
|
|
105
|
+
onSubmit(): void;
|
|
106
|
+
placeholder?: string;
|
|
107
|
+
label: string;
|
|
108
|
+
button: string;
|
|
109
|
+
disabled?: boolean;
|
|
110
|
+
mono?: boolean;
|
|
111
|
+
}): import("react").JSX.Element;
|
|
112
|
+
export declare function SearchField({ value, onChange, placeholder, label }: {
|
|
113
|
+
value: string;
|
|
114
|
+
onChange(next: string): void;
|
|
115
|
+
placeholder: string;
|
|
116
|
+
label: string;
|
|
117
|
+
}): import("react").JSX.Element;
|
|
118
|
+
export declare function ChipList({ items, onRemove, render, title, empty, icon }: {
|
|
119
|
+
items: string[];
|
|
120
|
+
onRemove(item: string): void;
|
|
121
|
+
render?(item: string): string;
|
|
122
|
+
title?(item: string): string;
|
|
123
|
+
empty?: string;
|
|
124
|
+
icon?: ReactNode;
|
|
125
|
+
}): import("react").JSX.Element | null;
|
|
126
|
+
/** Number with − / + buttons. */
|
|
127
|
+
export declare function Stepper({ value, min, max, onChange, label, suffix }: {
|
|
128
|
+
value: number;
|
|
129
|
+
min: number;
|
|
130
|
+
max: number;
|
|
131
|
+
onChange(next: number): void;
|
|
132
|
+
label: string;
|
|
133
|
+
suffix?: string;
|
|
134
|
+
}): import("react").JSX.Element;
|
|
135
|
+
export {};
|