@termix-ssh/plugin-sdk 1.0.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 +52 -0
- package/cli/commands/build.mjs +246 -0
- package/cli/commands/migrations.mjs +248 -0
- package/cli/commands/pack.mjs +42 -0
- package/cli/commands/sign.mjs +83 -0
- package/cli/commands/test.mjs +33 -0
- package/cli/commands/validate.mjs +215 -0
- package/cli/index.mjs +65 -0
- package/cli/lib/changelog.mjs +126 -0
- package/cli/lib/externals.mjs +46 -0
- package/cli/lib/plugin-dir.mjs +29 -0
- package/cli/lib/signing.mjs +86 -0
- package/cli/lib/static-url-imports.mjs +54 -0
- package/cli/lib/tmxplug.mjs +106 -0
- package/cli/patches/guacamole-common-js-flush.cjs +76 -0
- package/cli/patches/xterm-android-ime.cjs +130 -0
- package/client.d.ts +13 -0
- package/dist/backend.d.ts +1777 -0
- package/dist/backend.js +84 -0
- package/dist/capabilities.d.ts +38 -0
- package/dist/capabilities.js +71 -0
- package/dist/db.d.ts +112 -0
- package/dist/db.js +189 -0
- package/dist/ddl.d.ts +76 -0
- package/dist/ddl.js +678 -0
- package/dist/desktop.d.ts +346 -0
- package/dist/desktop.js +5 -0
- package/dist/frontend.d.ts +1206 -0
- package/dist/frontend.js +388 -0
- package/dist/host/chunk-F3SDZDDG.js +6017 -0
- package/dist/host/chunk-XGWE7BTJ.js +90 -0
- package/dist/host/chunk-XH5NXL6Y.js +56314 -0
- package/dist/host/chunk-YC2MAKSP.js +14 -0
- package/dist/host/linked-server-FZGWQW32.js +12 -0
- package/dist/host/rbac-api-6KDMBVDZ.js +52 -0
- package/dist/host/testing-host.js +414 -0
- package/dist/host/theme.css +91 -0
- package/dist/host/types/src/types/auth-protocols.d.ts +10 -0
- package/dist/host/types/src/types/connection-log.d.ts +13 -0
- package/dist/host/types/src/types/credential-sidebar-preferences.d.ts +38 -0
- package/dist/host/types/src/types/host-defaults.d.ts +60 -0
- package/dist/host/types/src/types/host-sidebar-preferences.d.ts +55 -0
- package/dist/host/types/src/types/index.d.ts +298 -0
- package/dist/host/types/src/types/keybindings.d.ts +27 -0
- package/dist/host/types/src/types/ui-preferences.d.ts +102 -0
- package/dist/host/types/src/types/ui-types.d.ts +260 -0
- package/dist/host/types/src/ui/api/admin-user-data-api.d.ts +11 -0
- package/dist/host/types/src/ui/api/auth-methods-api.d.ts +63 -0
- package/dist/host/types/src/ui/api/credential-sidebar-preferences-api.d.ts +3 -0
- package/dist/host/types/src/ui/api/credentials-api.d.ts +56 -0
- package/dist/host/types/src/ui/api/dashboard-api.d.ts +23 -0
- package/dist/host/types/src/ui/api/external-account-api.d.ts +8 -0
- package/dist/host/types/src/ui/api/host-sidebar-preferences-api.d.ts +3 -0
- package/dist/host/types/src/ui/api/host-status-api.d.ts +11 -0
- package/dist/host/types/src/ui/api/open-tabs-api.d.ts +74 -0
- package/dist/host/types/src/ui/api/plugins-api.d.ts +128 -0
- package/dist/host/types/src/ui/api/rbac-api.d.ts +167 -0
- package/dist/host/types/src/ui/api/settings-api.d.ts +22 -0
- package/dist/host/types/src/ui/api/ssh-host-management-api.d.ts +65 -0
- package/dist/host/types/src/ui/api/sync-api.d.ts +93 -0
- package/dist/host/types/src/ui/api/system-status-api.d.ts +49 -0
- package/dist/host/types/src/ui/api/ui-preferences-api.d.ts +8 -0
- package/dist/host/types/src/ui/api/user-management-api.d.ts +80 -0
- package/dist/host/types/src/ui/auth/Auth.d.ts +12 -0
- package/dist/host/types/src/ui/auth/auth-bits.d.ts +11 -0
- package/dist/host/types/src/ui/auth/silent-signin.d.ts +2 -0
- package/dist/host/types/src/ui/components/FullScreenAppWrapper.d.ts +9 -0
- package/dist/host/types/src/ui/components/alert-dialog.d.ts +14 -0
- package/dist/host/types/src/ui/components/alert.d.ts +9 -0
- package/dist/host/types/src/ui/components/badge.d.ts +9 -0
- package/dist/host/types/src/ui/components/button.d.ts +13 -0
- package/dist/host/types/src/ui/components/card-grid/CardGridCanvas.d.ts +22 -0
- package/dist/host/types/src/ui/components/card-grid/layout-utils.d.ts +26 -0
- package/dist/host/types/src/ui/components/card-grid/types.d.ts +29 -0
- package/dist/host/types/src/ui/components/card-masonry.d.ts +16 -0
- package/dist/host/types/src/ui/components/card.d.ts +11 -0
- package/dist/host/types/src/ui/components/charts/BarSeries.d.ts +16 -0
- package/dist/host/types/src/ui/components/charts/LineChart.d.ts +17 -0
- package/dist/host/types/src/ui/components/charts/RadialGauge.d.ts +18 -0
- package/dist/host/types/src/ui/components/charts/Sparkline.d.ts +22 -0
- package/dist/host/types/src/ui/components/charts/StatRow.d.ts +15 -0
- package/dist/host/types/src/ui/components/charts/geometry.d.ts +20 -0
- package/dist/host/types/src/ui/components/charts/index.d.ts +4 -0
- package/dist/host/types/src/ui/components/checkbox.d.ts +4 -0
- package/dist/host/types/src/ui/components/connection/ConnectionGate.d.ts +56 -0
- package/dist/host/types/src/ui/components/connection/ConnectionLogPanel.d.ts +9 -0
- package/dist/host/types/src/ui/components/connection/ConnectionScreen.d.ts +34 -0
- package/dist/host/types/src/ui/components/connection/connection-status.d.ts +1 -0
- package/dist/host/types/src/ui/components/data-view.d.ts +32 -0
- package/dist/host/types/src/ui/components/dialog.d.ts +17 -0
- package/dist/host/types/src/ui/components/dropdown-menu.d.ts +29 -0
- package/dist/host/types/src/ui/components/empty-state.d.ts +19 -0
- package/dist/host/types/src/ui/components/form-fields.d.ts +115 -0
- package/dist/host/types/src/ui/components/input.d.ts +3 -0
- package/dist/host/types/src/ui/components/kbd.d.ts +12 -0
- package/dist/host/types/src/ui/components/label.d.ts +4 -0
- package/dist/host/types/src/ui/components/manager-card.d.ts +25 -0
- package/dist/host/types/src/ui/components/meter.d.ts +14 -0
- package/dist/host/types/src/ui/components/metric-card.d.ts +18 -0
- package/dist/host/types/src/ui/components/panel-layout.d.ts +83 -0
- package/dist/host/types/src/ui/components/password-input.d.ts +4 -0
- package/dist/host/types/src/ui/components/popover.d.ts +7 -0
- package/dist/host/types/src/ui/components/scroll-area.d.ts +5 -0
- package/dist/host/types/src/ui/components/section-card.d.ts +29 -0
- package/dist/host/types/src/ui/components/select.d.ts +15 -0
- package/dist/host/types/src/ui/components/select2.d.ts +8 -0
- package/dist/host/types/src/ui/components/separator.d.ts +4 -0
- package/dist/host/types/src/ui/components/sheet.d.ts +14 -0
- package/dist/host/types/src/ui/components/sidebar.d.ts +69 -0
- package/dist/host/types/src/ui/components/skeleton.d.ts +2 -0
- package/dist/host/types/src/ui/components/slider.d.ts +4 -0
- package/dist/host/types/src/ui/components/sonner.d.ts +4 -0
- package/dist/host/types/src/ui/components/surface/prompt-styles.d.ts +4 -0
- package/dist/host/types/src/ui/components/surface/surface-scope.d.ts +79 -0
- package/dist/host/types/src/ui/components/switch.d.ts +4 -0
- package/dist/host/types/src/ui/components/tab-strip.d.ts +19 -0
- package/dist/host/types/src/ui/components/tabs.d.ts +7 -0
- package/dist/host/types/src/ui/components/textarea.d.ts +4 -0
- package/dist/host/types/src/ui/components/theme-provider.d.ts +14 -0
- package/dist/host/types/src/ui/components/tooltip.d.ts +7 -0
- package/dist/host/types/src/ui/contexts/BrandingContext.d.ts +15 -0
- package/dist/host/types/src/ui/contexts/UiPreferencesContext.d.ts +38 -0
- package/dist/host/types/src/ui/contexts/branding-document.d.ts +10 -0
- package/dist/host/types/src/ui/dashboard/dashboard-cards-registry.d.ts +30 -0
- package/dist/host/types/src/ui/hooks/use-action-slot.d.ts +10 -0
- package/dist/host/types/src/ui/hooks/use-adaptive-polling.d.ts +5 -0
- package/dist/host/types/src/ui/hooks/use-mobile.d.ts +1 -0
- package/dist/host/types/src/ui/hooks/use-permissions.d.ts +29 -0
- package/dist/host/types/src/ui/hooks/use-status-color-scheme.d.ts +12 -0
- package/dist/host/types/src/ui/hooks/use-sync-status.d.ts +4 -0
- package/dist/host/types/src/ui/hooks/useSshAuthProviders.d.ts +17 -0
- package/dist/host/types/src/ui/i18n/i18n.d.ts +52 -0
- package/dist/host/types/src/ui/lib/ServerStatusContext.d.ts +33 -0
- package/dist/host/types/src/ui/lib/adaptive-polling.d.ts +29 -0
- package/dist/host/types/src/ui/lib/adaptive-resource-budget.d.ts +39 -0
- package/dist/host/types/src/ui/lib/app-keyboard-shortcuts.d.ts +8 -0
- package/dist/host/types/src/ui/lib/base-path.d.ts +1 -0
- package/dist/host/types/src/ui/lib/clipboard-provider.d.ts +9 -0
- package/dist/host/types/src/ui/lib/clipboard.d.ts +20 -0
- package/dist/host/types/src/ui/lib/connection-origin.d.ts +47 -0
- package/dist/host/types/src/ui/lib/db-health-monitor.d.ts +34 -0
- package/dist/host/types/src/ui/lib/device-id.d.ts +1 -0
- package/dist/host/types/src/ui/lib/electron.d.ts +1 -0
- package/dist/host/types/src/ui/lib/embedded-server-status.d.ts +15 -0
- package/dist/host/types/src/ui/lib/error-message.d.ts +9 -0
- package/dist/host/types/src/ui/lib/frontend-logger.d.ts +67 -0
- package/dist/host/types/src/ui/lib/global-shortcut-handler.d.ts +3 -0
- package/dist/host/types/src/ui/lib/host-defaults-context.d.ts +48 -0
- package/dist/host/types/src/ui/lib/hosts-request-cache.d.ts +9 -0
- package/dist/host/types/src/ui/lib/keybinding-match.d.ts +3 -0
- package/dist/host/types/src/ui/lib/linked-server.d.ts +10 -0
- package/dist/host/types/src/ui/lib/local-adaptive-engine.d.ts +40 -0
- package/dist/host/types/src/ui/lib/permissions.d.ts +16 -0
- package/dist/host/types/src/ui/lib/plugin-i18n.d.ts +11 -0
- package/dist/host/types/src/ui/lib/plugin-icon.d.ts +11 -0
- package/dist/host/types/src/ui/lib/plugin-transport.d.ts +50 -0
- package/dist/host/types/src/ui/lib/registry.d.ts +29 -0
- package/dist/host/types/src/ui/lib/rem.d.ts +7 -0
- package/dist/host/types/src/ui/lib/remote-server-api.d.ts +11 -0
- package/dist/host/types/src/ui/lib/server-status-store.d.ts +37 -0
- package/dist/host/types/src/ui/lib/sync-events.d.ts +2 -0
- package/dist/host/types/src/ui/lib/sync-status.d.ts +6 -0
- package/dist/host/types/src/ui/lib/tab-jump-hotkey.d.ts +4 -0
- package/dist/host/types/src/ui/lib/theme.d.ts +21 -0
- package/dist/host/types/src/ui/lib/ttl-request-cache.d.ts +10 -0
- package/dist/host/types/src/ui/lib/usage-color.d.ts +5 -0
- package/dist/host/types/src/ui/lib/utils.d.ts +2 -0
- package/dist/host/types/src/ui/lib/visible-interval.d.ts +5 -0
- package/dist/host/types/src/ui/lib/widget-title.d.ts +8 -0
- package/dist/host/types/src/ui/lib/ws-auth.d.ts +1 -0
- package/dist/host/types/src/ui/main-axios.d.ts +170 -0
- package/dist/host/types/src/ui/plugin-host/PluginViewPlaceholder.d.ts +13 -0
- package/dist/host/types/src/ui/plugin-host/app.d.ts +18 -0
- package/dist/host/types/src/ui/plugin-host/auth-registry.d.ts +50 -0
- package/dist/host/types/src/ui/plugin-host/bridge.d.ts +26 -0
- package/dist/host/types/src/ui/plugin-host/component-registry.d.ts +24 -0
- package/dist/host/types/src/ui/plugin-host/desktop.d.ts +7 -0
- package/dist/host/types/src/ui/plugin-host/extension-registry.d.ts +16 -0
- package/dist/host/types/src/ui/plugin-host/host-scope.d.ts +26 -0
- package/dist/host/types/src/ui/plugin-host/loader.d.ts +52 -0
- package/dist/host/types/src/ui/plugin-host/plugin-store.d.ts +40 -0
- package/dist/host/types/src/ui/plugin-host/scope.d.ts +20 -0
- package/dist/host/types/src/ui/plugin-host/sdk-ui.d.ts +99 -0
- package/dist/host/types/src/ui/plugin-host/shell-bridge.d.ts +67 -0
- package/dist/host/types/src/ui/plugin-host/view-ownership.d.ts +31 -0
- package/dist/host/types/src/ui/settings/HostPluginSections.d.ts +31 -0
- package/dist/host/types/src/ui/settings/SettingsFields.d.ts +22 -0
- package/dist/host/types/src/ui/settings/host-feature-tabs.d.ts +11 -0
- package/dist/host/types/src/ui/settings/settings-components.d.ts +32 -0
- package/dist/host/types/src/ui/settings/settings-fields-util.d.ts +11 -0
- package/dist/host/types/src/ui/shell/ActionSlot.d.ts +41 -0
- package/dist/host/types/src/ui/shell/TabContext.d.ts +30 -0
- package/dist/host/types/src/ui/shell/action-registry.d.ts +99 -0
- package/dist/host/types/src/ui/shell/keybinding-registry.d.ts +62 -0
- package/dist/host/types/src/ui/shell/palette-registry.d.ts +55 -0
- package/dist/host/types/src/ui/shell/panel-registry.d.ts +24 -0
- package/dist/host/types/src/ui/shell/tab-registry.d.ts +92 -0
- package/dist/host/types/src/ui/sidebar/HostManagerTabs.d.ts +65 -0
- package/dist/host/types/src/ui/sidebar/host-contributions.d.ts +72 -0
- package/dist/host/types/src/ui/sidebar/host-defaults/catalog.d.ts +17 -0
- package/dist/host/types/src/ui/sidebar/host-protocols.d.ts +49 -0
- package/dist/host/types/src/ui/sidebar/quick-connect-host.d.ts +21 -0
- package/dist/host/types/src/ui/sidebar/rail-items.d.ts +103 -0
- package/dist/host/types/src/ui/ssh/connection-log/ConnectionLogContext.d.ts +17 -0
- package/dist/host/types/src/ui/ssh/dialogs/BrowserSignInDialog.d.ts +18 -0
- package/dist/host/types/src/ui/ssh/dialogs/HostKeyVerificationDialog.d.ts +17 -0
- package/dist/host/types/src/ui/ssh/dialogs/PassphraseDialog.d.ts +15 -0
- package/dist/host/types/src/ui/ssh/dialogs/SSHAuthDialog.d.ts +20 -0
- package/dist/host/types/src/ui/ssh/dialogs/TOTPDialog.d.ts +13 -0
- package/dist/host/ui.d.ts +1 -0
- package/dist/host/ui.js +31754 -0
- package/dist/host/use-permissions-NULZL43J.js +18 -0
- package/dist/host-commands.d.ts +89 -0
- package/dist/host-commands.js +387 -0
- package/dist/manifest.d.ts +461 -0
- package/dist/manifest.js +1499 -0
- package/dist/settings.d.ts +43 -0
- package/dist/settings.js +168 -0
- package/dist/ssh-certs.d.ts +25 -0
- package/dist/ssh-certs.js +234 -0
- package/dist/ssh-options.d.ts +23 -0
- package/dist/ssh-options.js +1 -0
- package/dist/table-builder.d.ts +26 -0
- package/dist/table-builder.js +87 -0
- package/dist/testing/safe-ports.d.ts +10 -0
- package/dist/testing/safe-ports.js +59 -0
- package/dist/testing/setup.d.ts +7 -0
- package/dist/testing/setup.js +146 -0
- package/dist/testing.d.ts +537 -0
- package/dist/testing.js +1451 -0
- package/dist/vitest-preset.d.ts +54 -0
- package/dist/vitest-preset.js +96 -0
- package/package.json +143 -0
- package/schema/changelog.schema.json +67 -0
- package/schema/manifest.schema.json +1160 -0
- package/tsconfig.plugin.json +31 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3
|
+
declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): React.JSX.Element;
|
|
6
|
+
declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): React.JSX.Element;
|
|
7
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
3
|
+
declare function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): React.JSX.Element;
|
|
5
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export declare function SectionCard({ title, icon, action, children, className, rowId, }: {
|
|
3
|
+
title: string;
|
|
4
|
+
icon: React.ReactNode;
|
|
5
|
+
action?: React.ReactNode;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Lets settings search jump to this card. */
|
|
9
|
+
rowId?: string;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
export declare function SettingRow({ label, badge, description, defaultKey, rowId, children, }: {
|
|
12
|
+
label: string;
|
|
13
|
+
badge?: string;
|
|
14
|
+
description?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* In the host editor, the host default this row edits: a plugin's own
|
|
17
|
+
* field key, or "core.<key>". Shows where the value comes from.
|
|
18
|
+
*/
|
|
19
|
+
defaultKey?: string;
|
|
20
|
+
/** Lets settings search jump to this row. */
|
|
21
|
+
rowId?: string;
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
}): React.JSX.Element;
|
|
24
|
+
export declare function FakeSwitch({ defaultChecked, disabled, checked, onChange, }: {
|
|
25
|
+
defaultChecked?: boolean;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
checked?: boolean;
|
|
28
|
+
onChange?: (v: boolean) => void;
|
|
29
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3
|
+
declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): React.JSX.Element;
|
|
5
|
+
declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): React.JSX.Element;
|
|
6
|
+
declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
7
|
+
size?: "sm" | "default";
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
declare function SelectContent({ className, children, position, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): React.JSX.Element;
|
|
10
|
+
declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): React.JSX.Element;
|
|
11
|
+
declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): React.JSX.Element;
|
|
12
|
+
declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): React.JSX.Element;
|
|
13
|
+
declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): React.JSX.Element;
|
|
14
|
+
declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): React.JSX.Element;
|
|
15
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type Select2Props = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "value" | "defaultValue" | "onChange"> & Pick<React.SelectHTMLAttributes<HTMLSelectElement>, "value" | "defaultValue" | "onChange" | "required"> & {
|
|
3
|
+
placeholder?: string;
|
|
4
|
+
align?: "start" | "center" | "end";
|
|
5
|
+
contentClassName?: string;
|
|
6
|
+
};
|
|
7
|
+
declare function Select2({ className, children, value, defaultValue, onChange, disabled, placeholder, align, contentClassName, name, id, required, "aria-label": ariaLabel, ...props }: Select2Props): React.JSX.Element;
|
|
8
|
+
export { Select2 };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Dialog as SheetPrimitive } from "radix-ui";
|
|
3
|
+
declare function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>): React.JSX.Element;
|
|
6
|
+
declare function SheetContent({ className, children, side, showCloseButton, ...props }: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
7
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
8
|
+
showCloseButton?: boolean;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
declare function SheetHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
|
+
declare function SheetFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>): React.JSX.Element;
|
|
13
|
+
declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>): React.JSX.Element;
|
|
14
|
+
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { Button } from "./button";
|
|
4
|
+
import { Input } from "./input";
|
|
5
|
+
import { Separator } from "./separator";
|
|
6
|
+
import { TooltipContent } from "./tooltip";
|
|
7
|
+
type SidebarContextProps = {
|
|
8
|
+
state: "expanded" | "collapsed";
|
|
9
|
+
open: boolean;
|
|
10
|
+
setOpen: (open: boolean) => void;
|
|
11
|
+
openMobile: boolean;
|
|
12
|
+
setOpenMobile: (open: boolean) => void;
|
|
13
|
+
isMobile: boolean;
|
|
14
|
+
toggleSidebar: () => void;
|
|
15
|
+
};
|
|
16
|
+
declare function useSidebar(): SidebarContextProps;
|
|
17
|
+
declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }: React.ComponentProps<"div"> & {
|
|
18
|
+
defaultOpen?: boolean;
|
|
19
|
+
open?: boolean;
|
|
20
|
+
onOpenChange?: (open: boolean) => void;
|
|
21
|
+
}): React.JSX.Element;
|
|
22
|
+
declare function Sidebar({ side, variant, collapsible, className, children, dir, ...props }: React.ComponentProps<"div"> & {
|
|
23
|
+
side?: "left" | "right";
|
|
24
|
+
variant?: "sidebar" | "floating" | "inset";
|
|
25
|
+
collapsible?: "offcanvas" | "icon" | "none";
|
|
26
|
+
}): React.JSX.Element;
|
|
27
|
+
declare function SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
28
|
+
declare function SidebarRail({ className, ...props }: React.ComponentProps<"button">): React.JSX.Element;
|
|
29
|
+
declare function SidebarInset({ className, ...props }: React.ComponentProps<"main">): React.JSX.Element;
|
|
30
|
+
declare function SidebarInput({ className, ...props }: React.ComponentProps<typeof Input>): React.JSX.Element;
|
|
31
|
+
declare function SidebarHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
32
|
+
declare function SidebarFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
33
|
+
declare function SidebarSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): React.JSX.Element;
|
|
34
|
+
declare function SidebarContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
35
|
+
declare function SidebarGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
36
|
+
declare function SidebarGroupLabel({ className, asChild, ...props }: React.ComponentProps<"div"> & {
|
|
37
|
+
asChild?: boolean;
|
|
38
|
+
}): React.JSX.Element;
|
|
39
|
+
declare function SidebarGroupAction({ className, asChild, ...props }: React.ComponentProps<"button"> & {
|
|
40
|
+
asChild?: boolean;
|
|
41
|
+
}): React.JSX.Element;
|
|
42
|
+
declare function SidebarGroupContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
43
|
+
declare function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">): React.JSX.Element;
|
|
44
|
+
declare function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
|
45
|
+
declare const sidebarMenuButtonVariants: (props?: {
|
|
46
|
+
variant?: "default" | "outline";
|
|
47
|
+
size?: "default" | "sm" | "lg";
|
|
48
|
+
} & import("class-variance-authority/types").ClassProp) => string;
|
|
49
|
+
declare function SidebarMenuButton({ asChild, isActive, variant, size, tooltip, className, ...props }: React.ComponentProps<"button"> & {
|
|
50
|
+
asChild?: boolean;
|
|
51
|
+
isActive?: boolean;
|
|
52
|
+
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
53
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>): React.JSX.Element;
|
|
54
|
+
declare function SidebarMenuAction({ className, asChild, showOnHover, ...props }: React.ComponentProps<"button"> & {
|
|
55
|
+
asChild?: boolean;
|
|
56
|
+
showOnHover?: boolean;
|
|
57
|
+
}): React.JSX.Element;
|
|
58
|
+
declare function SidebarMenuBadge({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
59
|
+
declare function SidebarMenuSkeleton({ className, showIcon, ...props }: React.ComponentProps<"div"> & {
|
|
60
|
+
showIcon?: boolean;
|
|
61
|
+
}): React.JSX.Element;
|
|
62
|
+
declare function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">): React.JSX.Element;
|
|
63
|
+
declare function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
|
64
|
+
declare function SidebarMenuSubButton({ asChild, size, isActive, className, ...props }: React.ComponentProps<"a"> & {
|
|
65
|
+
asChild?: boolean;
|
|
66
|
+
size?: "sm" | "md";
|
|
67
|
+
isActive?: boolean;
|
|
68
|
+
}): React.JSX.Element;
|
|
69
|
+
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Buttons shared by every PanePrompt, so confirms and prompts match. */
|
|
2
|
+
export declare const PROMPT_BUTTON = "inline-flex h-7 items-center justify-center gap-1.5 border border-border px-3 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50";
|
|
3
|
+
export declare const PROMPT_PRIMARY_BUTTON = "inline-flex h-7 items-center justify-center gap-1.5 border border-accent-brand/40 px-3 text-xs font-medium text-accent-brand transition-colors hover:bg-accent-brand/10 focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50";
|
|
4
|
+
export declare const PROMPT_DESTRUCTIVE_BUTTON = "inline-flex h-7 items-center justify-center gap-1.5 bg-destructive px-3 text-xs font-medium text-white transition-colors hover:bg-destructive/90 focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50";
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* A surface is a sidebar panel, a tab or a split pane. Inline views and
|
|
4
|
+
* confirmations draw over the surface that asked, never over the whole app.
|
|
5
|
+
*/
|
|
6
|
+
export type EditingWidth = boolean | "wide";
|
|
7
|
+
export type SurfaceKind = "panel" | "tab" | "pane";
|
|
8
|
+
export interface ConfirmOptions {
|
|
9
|
+
title: string;
|
|
10
|
+
description?: React.ReactNode;
|
|
11
|
+
confirmLabel?: string;
|
|
12
|
+
cancelLabel?: string;
|
|
13
|
+
/** Red confirm button. Defaults to true, since most confirms delete. */
|
|
14
|
+
destructive?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function SurfaceScope({ kind, onEditingChange, className, children, }: {
|
|
17
|
+
kind?: SurfaceKind;
|
|
18
|
+
/** Gets the widest open inline view, so a sidebar can widen for it. */
|
|
19
|
+
onEditingChange?: (editing: EditingWidth) => void;
|
|
20
|
+
className?: string;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
}): React.JSX.Element;
|
|
23
|
+
/** Which kind of surface this code renders in, or null outside any. */
|
|
24
|
+
export declare function useSurfaceKind(): SurfaceKind | null;
|
|
25
|
+
/**
|
|
26
|
+
* Asks a yes or no question over the surface that called it. Enter confirms
|
|
27
|
+
* and Esc cancels, before a terminal can see the key.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useConfirm(): (options: ConfirmOptions) => Promise<boolean>;
|
|
30
|
+
/**
|
|
31
|
+
* A small card over the surface it sits in. Confirmations use it, and so do
|
|
32
|
+
* prompts that belong to a connection, like a sudo password.
|
|
33
|
+
*/
|
|
34
|
+
export declare function PanePrompt({ open, title, titleId, description, icon, tone, actions, onCancel, role, labelledBy, layer, backgroundColor, className, children, }: {
|
|
35
|
+
open: boolean;
|
|
36
|
+
title: React.ReactNode;
|
|
37
|
+
titleId?: string;
|
|
38
|
+
description?: React.ReactNode;
|
|
39
|
+
icon?: React.ReactNode;
|
|
40
|
+
tone?: "default" | "destructive";
|
|
41
|
+
actions?: React.ReactNode;
|
|
42
|
+
/** Clicking the dimmed backdrop. */
|
|
43
|
+
onCancel?: () => void;
|
|
44
|
+
role?: "dialog" | "alertdialog";
|
|
45
|
+
labelledBy?: string;
|
|
46
|
+
/**
|
|
47
|
+
* "connection" covers a connecting surface (a terminal waiting on a login)
|
|
48
|
+
* with an opaque backdrop, above everything the surface draws.
|
|
49
|
+
*/
|
|
50
|
+
layer?: "pane" | "connection";
|
|
51
|
+
/** Backdrop color for the connection layer, usually the terminal theme. */
|
|
52
|
+
backgroundColor?: string;
|
|
53
|
+
className?: string;
|
|
54
|
+
children?: React.ReactNode;
|
|
55
|
+
}): React.JSX.Element;
|
|
56
|
+
/**
|
|
57
|
+
* What used to be a modal: a view that takes over the surface it was opened
|
|
58
|
+
* from, with a Back button. Opened from a sidebar it widens the sidebar.
|
|
59
|
+
*/
|
|
60
|
+
export declare function InlineView({ open, onOpenChange, title, icon, status, actions, toolbar, footer, width, onBeforeClose, scroll, bare, className, children, }: {
|
|
61
|
+
open: boolean;
|
|
62
|
+
onOpenChange: (open: boolean) => void;
|
|
63
|
+
title: React.ReactNode;
|
|
64
|
+
icon?: React.ReactNode;
|
|
65
|
+
status?: React.ReactNode;
|
|
66
|
+
actions?: React.ReactNode;
|
|
67
|
+
toolbar?: React.ReactNode;
|
|
68
|
+
/** Pinned under the body, usually Cancel and Save. */
|
|
69
|
+
footer?: React.ReactNode;
|
|
70
|
+
/** How far a sidebar widens while this is open. */
|
|
71
|
+
width?: EditingWidth;
|
|
72
|
+
/** Return false to stay open, for an unsaved changes guard. */
|
|
73
|
+
onBeforeClose?: () => boolean | Promise<boolean>;
|
|
74
|
+
scroll?: boolean;
|
|
75
|
+
/** Draw children edge to edge, for views with their own bands. */
|
|
76
|
+
bare?: boolean;
|
|
77
|
+
className?: string;
|
|
78
|
+
children: React.ReactNode;
|
|
79
|
+
}): React.ReactPortal;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface TabStripItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
/** Small count after the label. */
|
|
7
|
+
count?: number;
|
|
8
|
+
}
|
|
9
|
+
/** Scrollable underline tabs with overflow arrows. */
|
|
10
|
+
export declare function TabStrip({ tabs, activeTab, onTabChange, isActive, variant, trailing, className, }: {
|
|
11
|
+
tabs: TabStripItem[];
|
|
12
|
+
activeTab: string;
|
|
13
|
+
onTabChange: (id: string) => void;
|
|
14
|
+
isActive?: (id: string) => boolean;
|
|
15
|
+
variant?: "primary" | "secondary";
|
|
16
|
+
/** Sits after the tabs, outside the scroll area. */
|
|
17
|
+
trailing?: ReactNode;
|
|
18
|
+
className?: string;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
3
|
+
declare function Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>): React.JSX.Element;
|
|
5
|
+
declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>): React.JSX.Element;
|
|
6
|
+
declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): React.JSX.Element;
|
|
7
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ThemeId } from "../../types/ui-types";
|
|
2
|
+
type ThemeProviderProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
defaultTheme?: ThemeId;
|
|
5
|
+
storageKey?: string;
|
|
6
|
+
};
|
|
7
|
+
type ThemeProviderState = {
|
|
8
|
+
theme: ThemeId;
|
|
9
|
+
setTheme: (theme: ThemeId) => void;
|
|
10
|
+
setThemePreview: (theme: ThemeId | null) => void;
|
|
11
|
+
};
|
|
12
|
+
export declare function ThemeProvider({ children, defaultTheme, storageKey, ...props }: ThemeProviderProps): import("react").JSX.Element;
|
|
13
|
+
export declare const useTheme: () => ThemeProviderState;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
3
|
+
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): React.JSX.Element;
|
|
4
|
+
declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): React.JSX.Element;
|
|
5
|
+
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): React.JSX.Element;
|
|
6
|
+
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): React.JSX.Element;
|
|
7
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type BrandingSettings } from "../api/settings-api";
|
|
3
|
+
interface BrandingContextValue {
|
|
4
|
+
ready: boolean;
|
|
5
|
+
appName: string;
|
|
6
|
+
tagline: string;
|
|
7
|
+
logo: string | null;
|
|
8
|
+
/** Re-applies a freshly saved BrandingSettings without a page reload. */
|
|
9
|
+
applyBranding: (settings: BrandingSettings) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function BrandingProvider({ children }: {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
export declare function useBranding(): BrandingContextValue;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type UiPluginPresets, type UiAreaKey, type UiAreaPreferences, type UiPreferences, type UiPreset } from "../../types/ui-preferences";
|
|
3
|
+
interface UiPreferencesContextValue {
|
|
4
|
+
preferences: UiPreferences;
|
|
5
|
+
loaded: boolean;
|
|
6
|
+
resolve: <A extends UiAreaKey>(area: A) => UiAreaPreferences[A];
|
|
7
|
+
setPreset: (preset: UiPreset) => void;
|
|
8
|
+
setOverride: <A extends UiAreaKey, K extends keyof UiAreaPreferences[A]>(area: A, key: K, value: UiAreaPreferences[A][K] | null) => void;
|
|
9
|
+
clearArea: (area: UiAreaKey) => void;
|
|
10
|
+
clearAllOverrides: () => void;
|
|
11
|
+
completeOnboarding: (skipped: boolean) => void;
|
|
12
|
+
/** A plugin's own area, from the presets it declared. */
|
|
13
|
+
resolvePlugin: (pluginId: string, presets: UiPluginPresets | undefined) => Record<string, unknown>;
|
|
14
|
+
setPluginOverride: (pluginId: string, key: string, value: unknown) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* App-wide interface preset and per-area overrides. Cached in localStorage for
|
|
18
|
+
* instant paint and synced to the backend when storageMode is "cloud", the
|
|
19
|
+
* same shape as useHostSidebarPreferences -- but provided once at the app root
|
|
20
|
+
* rather than mounted per consumer, since almost every panel reads it.
|
|
21
|
+
*
|
|
22
|
+
* Writes send only the changed slice: the backend merges overrides two levels
|
|
23
|
+
* deep and treats null as "clear this", so handing a knob back to the preset is
|
|
24
|
+
* a single PUT rather than a read-modify-write of the whole document.
|
|
25
|
+
*/
|
|
26
|
+
export declare function UiPreferencesProvider({ children }: {
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
}): import("react").JSX.Element;
|
|
29
|
+
export declare function useUiPreferencesContext(): UiPreferencesContextValue | null;
|
|
30
|
+
/**
|
|
31
|
+
* Effective settings for one area. Falls back to the balanced preset (today's
|
|
32
|
+
* behavior) outside a provider, so components rendered in isolation -- tests,
|
|
33
|
+
* Electron sub-windows -- behave exactly as they did before presets existed
|
|
34
|
+
* rather than crashing or silently going Simple.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useAreaPreferences<A extends UiAreaKey>(area: A): UiAreaPreferences[A];
|
|
37
|
+
export declare function useUiPreference<A extends UiAreaKey, K extends keyof UiAreaPreferences[A]>(area: A, key: K): UiAreaPreferences[A][K];
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const BRANDING_ICON_SELECTORS: readonly ["link[rel=\"icon\"]", "link[rel=\"apple-touch-icon\"]"];
|
|
2
|
+
/**
|
|
3
|
+
* Snapshot bundled favicon hrefs before the first custom logo is written.
|
|
4
|
+
* Reset then restores those snapshots instead of leaving the previous upload
|
|
5
|
+
* in the tab until a full reload.
|
|
6
|
+
*/
|
|
7
|
+
export declare function captureDefaultIconHrefs(stored: Record<string, string>, query: (selector: string) => {
|
|
8
|
+
href: string;
|
|
9
|
+
} | null): void;
|
|
10
|
+
export declare function nextIconHref(customLogo: string | null, defaultHref: string | undefined, currentHref: string): string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
|
+
import type { TabShellCallbacks } from "../shell/tab-registry";
|
|
3
|
+
export interface DashboardCardRenderProps {
|
|
4
|
+
isVisible: boolean;
|
|
5
|
+
/** The shell, e.g. to open the full-page version of the card. */
|
|
6
|
+
shell: TabShellCallbacks;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A dashboard card a plugin contributes. DashboardTab offers registered cards
|
|
10
|
+
* next to the core ones, and a saved slot whose card is not registered keeps
|
|
11
|
+
* its place and shows a placeholder, so turning a plugin off and on again
|
|
12
|
+
* puts the card back where it was.
|
|
13
|
+
*/
|
|
14
|
+
export interface RegisteredDashboardCard {
|
|
15
|
+
id: string;
|
|
16
|
+
pluginId?: string;
|
|
17
|
+
titleKey: string;
|
|
18
|
+
defaultHeight?: number;
|
|
19
|
+
/** Which column a preset places this card in by default. Defaults to "main". */
|
|
20
|
+
defaultPanel?: "main" | "side";
|
|
21
|
+
/** "framed" gets a titled header from the dashboard; "bare" draws its own. */
|
|
22
|
+
frame?: "framed" | "bare";
|
|
23
|
+
component: ComponentType<DashboardCardRenderProps>;
|
|
24
|
+
}
|
|
25
|
+
export declare const registerDashboardCard: (item: RegisteredDashboardCard) => () => void;
|
|
26
|
+
export declare const unregisterDashboardCard: (id: string) => void;
|
|
27
|
+
export declare const getRegisteredDashboardCard: (id: string) => RegisteredDashboardCard;
|
|
28
|
+
export declare const registeredDashboardCardList: () => RegisteredDashboardCard[];
|
|
29
|
+
export declare const useRegisteredDashboardCards: () => RegisteredDashboardCard[];
|
|
30
|
+
export declare const resetDashboardCards: () => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type SlotContribution } from "../shell/action-registry";
|
|
2
|
+
/**
|
|
3
|
+
* The contributions in a slot that the current user may actually see.
|
|
4
|
+
*
|
|
5
|
+
* A slot owner calls this without knowing which plugins contributed, or
|
|
6
|
+
* whether any did. Contributions the user lacks the permission for are
|
|
7
|
+
* dropped entirely rather than disabled, which is how admin-gated UI already
|
|
8
|
+
* behaves elsewhere in the app.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useActionSlot(slotId: string, context?: Record<string, unknown>): SlotContribution[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type AdaptivePollResult, type AdaptivePollingPolicy } from "../lib/adaptive-polling";
|
|
2
|
+
export declare function useAdaptivePolling(poll: () => AdaptivePollResult | Promise<AdaptivePollResult>, policy: AdaptivePollingPolicy, enabled?: boolean, options?: {
|
|
3
|
+
runImmediately?: boolean;
|
|
4
|
+
onError?: (error: unknown) => void;
|
|
5
|
+
}): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useIsMobile(): boolean;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface PermissionsState {
|
|
2
|
+
permissions: string[];
|
|
3
|
+
isAdmin: boolean;
|
|
4
|
+
/** False until the call answers, so gated UI does not flash in or out. */
|
|
5
|
+
loaded: boolean;
|
|
6
|
+
has: (permission: string) => boolean;
|
|
7
|
+
}
|
|
8
|
+
/** The same answer usePermissions().has gives, for code outside a component. */
|
|
9
|
+
export declare function hasPermission(permission: string): Promise<boolean>;
|
|
10
|
+
/**
|
|
11
|
+
* Warms the permissions cache before the shell mounts, so permission-gated
|
|
12
|
+
* rail items are already known on first paint instead of popping in once
|
|
13
|
+
* usePermissions' own fetch resolves.
|
|
14
|
+
*/
|
|
15
|
+
export declare function preloadPermissions(): Promise<void>;
|
|
16
|
+
export declare function notifyPermissionsChanged(): void;
|
|
17
|
+
/**
|
|
18
|
+
* The current user's grants.
|
|
19
|
+
*
|
|
20
|
+
* Freshness is eventually consistent: the backend caches per user with a TTL
|
|
21
|
+
* and this caches until notifyPermissionsChanged fires, so a revoke can leave
|
|
22
|
+
* a stale button on screen briefly. That is acceptable because the button is
|
|
23
|
+
* not the boundary - clicking it hits a route that checks again and refuses.
|
|
24
|
+
*/
|
|
25
|
+
export declare function usePermissions(): PermissionsState;
|
|
26
|
+
/** Test seam. */
|
|
27
|
+
export declare function resetPermissionsCache(): void;
|
|
28
|
+
/** Test seam: answers every hook with these grants, no request made. */
|
|
29
|
+
export declare function setPermissionsForTesting(permissions: string[], isAdmin?: boolean): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { StatusColorScheme } from "../../types/host-sidebar-preferences";
|
|
2
|
+
export type { StatusColorScheme };
|
|
3
|
+
/**
|
|
4
|
+
* Reads the scheme straight off the sidebar preferences cache that
|
|
5
|
+
* useHostSidebarPreferences writes, so the toggle in Customize Sidebar takes
|
|
6
|
+
* effect without a reload. Exported for imperative callers that build markup
|
|
7
|
+
* outside React (the topology SVG).
|
|
8
|
+
*/
|
|
9
|
+
export declare function readStatusColorScheme(): StatusColorScheme;
|
|
10
|
+
export declare function useStatusColorScheme(): StatusColorScheme;
|
|
11
|
+
/** Returns Tailwind class names for a status dot/stripe. */
|
|
12
|
+
export declare function getStatusClasses(status: boolean | "online" | "offline" | "unknown", scheme: StatusColorScheme, variant: "dot" | "stripe" | "badge", loading?: boolean): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type SshAuthProviderSummary } from "../api/auth-methods-api";
|
|
2
|
+
/** Drops the cached list, e.g. after a plugin was switched on or off. */
|
|
3
|
+
export declare function invalidateSshAuthProviders(): void;
|
|
4
|
+
export interface SshAuthTypeOption extends SshAuthProviderSummary {
|
|
5
|
+
/** Plugin-registered editor title, when there is one. */
|
|
6
|
+
editorTitleKey?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Every SSH auth type the server can connect with, merged with the editors
|
|
10
|
+
* plugins registered in this browser. Types whose plugin is off come back
|
|
11
|
+
* with available: false and missingPlugin set.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useSshAuthProviders(): {
|
|
14
|
+
providers: SshAuthTypeOption[];
|
|
15
|
+
loaded: boolean;
|
|
16
|
+
find: (type: string | null | undefined) => SshAuthTypeOption | undefined;
|
|
17
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import i18n, { type ResourceKey } from "i18next";
|
|
2
|
+
/** i18n code -> translated file name, shared by core and plugin locales. */
|
|
3
|
+
export declare const LOCALE_FILES: {
|
|
4
|
+
readonly af: "af_ZA";
|
|
5
|
+
readonly ar: "ar_SA";
|
|
6
|
+
readonly bn: "bn_BD";
|
|
7
|
+
readonly bg: "bg_BG";
|
|
8
|
+
readonly ca: "ca_ES";
|
|
9
|
+
readonly cs: "cs_CZ";
|
|
10
|
+
readonly da: "da_DK";
|
|
11
|
+
readonly de: "de_DE";
|
|
12
|
+
readonly el: "el_GR";
|
|
13
|
+
readonly "es-ES": "es_ES";
|
|
14
|
+
readonly fi: "fi_FI";
|
|
15
|
+
readonly fr: "fr_FR";
|
|
16
|
+
readonly he: "he_IL";
|
|
17
|
+
readonly hi: "hi_IN";
|
|
18
|
+
readonly hu: "hu_HU";
|
|
19
|
+
readonly id: "id_ID";
|
|
20
|
+
readonly it: "it_IT";
|
|
21
|
+
readonly ja: "ja_JP";
|
|
22
|
+
readonly ko: "ko_KR";
|
|
23
|
+
readonly nl: "nl_NL";
|
|
24
|
+
readonly no: "no_NO";
|
|
25
|
+
readonly pl: "pl_PL";
|
|
26
|
+
readonly "pt-PT": "pt_PT";
|
|
27
|
+
readonly "pt-BR": "pt_BR";
|
|
28
|
+
readonly ro: "ro_RO";
|
|
29
|
+
readonly ru: "ru_RU";
|
|
30
|
+
readonly sr: "sr_SP";
|
|
31
|
+
readonly "sv-SE": "sv_SE";
|
|
32
|
+
readonly th: "th_TH";
|
|
33
|
+
readonly tr: "tr_TR";
|
|
34
|
+
readonly uk: "uk_UA";
|
|
35
|
+
readonly vi: "vi_VN";
|
|
36
|
+
readonly "zh-CN": "zh_CN";
|
|
37
|
+
readonly "zh-TW": "zh_TW";
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Loads a plugin namespace. Set by the plugin loader; until then a plugin
|
|
41
|
+
* namespace resolves to nothing and keys fall back to core.
|
|
42
|
+
*/
|
|
43
|
+
export type PluginLocaleResolver = (namespace: string, language: string, file: string) => Promise<ResourceKey | null>;
|
|
44
|
+
export declare function setPluginLocaleResolver(resolver: PluginLocaleResolver | null): void;
|
|
45
|
+
export declare const supportedLngs: string[];
|
|
46
|
+
/** Core strings. Each plugin gets a namespace named after its id. */
|
|
47
|
+
export declare const CORE_NAMESPACE = "translation";
|
|
48
|
+
export declare function normalizeLanguageCode(language?: string | null): string;
|
|
49
|
+
export declare function changeAppLanguage(language: string): Promise<string>;
|
|
50
|
+
export declare function rememberLoginLanguage(language: string): string;
|
|
51
|
+
export declare function consumeLoginLanguage(): string | null;
|
|
52
|
+
export default i18n;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type ServerStatusEntry, type StatusValue } from "./server-status-store";
|
|
3
|
+
interface ServerStatusContextType {
|
|
4
|
+
statuses: Map<number, ServerStatusEntry>;
|
|
5
|
+
initialLoadComplete: boolean;
|
|
6
|
+
refreshStatuses: () => Promise<void>;
|
|
7
|
+
/** "unknown" until the host has been checked. */
|
|
8
|
+
getStatus: (hostId: number) => StatusValue;
|
|
9
|
+
}
|
|
10
|
+
/** A host's live status outside React. "unknown" with no provider mounted. */
|
|
11
|
+
export declare function getLiveHostStatus(hostId: number): StatusValue;
|
|
12
|
+
export declare function ServerStatusProvider({ children, isAuthenticated, }: {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
isAuthenticated?: boolean;
|
|
15
|
+
}): React.JSX.Element;
|
|
16
|
+
export declare function useServerStatus(): ServerStatusContextType;
|
|
17
|
+
/**
|
|
18
|
+
* Subscribe to a single host's status. Only re-renders when that host's
|
|
19
|
+
* status changes. Null when status checks are off for the host.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useHostStatus(hostId: number, statusCheckEnabled?: boolean): StatusValue | null;
|
|
22
|
+
/** Meta flags without depending on the full status map. */
|
|
23
|
+
export declare function useServerStatusMeta(): {
|
|
24
|
+
initialLoadComplete: boolean;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* One host's status for plugin views, which can render outside the app shell
|
|
28
|
+
* (a standalone window). Null there, and while the host has not been checked.
|
|
29
|
+
*/
|
|
30
|
+
export declare function useOptionalHostStatusEntry(hostId: number | undefined): {
|
|
31
|
+
status: "online" | "offline";
|
|
32
|
+
} | null;
|
|
33
|
+
export {};
|