@termix-ssh/plugin-sdk 1.0.11 → 1.0.13
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/CHANGELOG.md +37 -0
- package/PLUGIN-GUIDE.md +178 -54
- package/cli/commands/build.mjs +36 -22
- package/cli/commands/pack.mjs +12 -2
- package/cli/commands/validate.mjs +63 -3
- package/cli/lib/plugin-dir.mjs +11 -0
- package/cli/lib/tmxplug.mjs +9 -0
- package/dist/backend.d.ts +404 -0
- package/dist/capabilities.js +7 -0
- package/dist/db.js +1 -0
- package/dist/desktop.d.ts +0 -243
- package/dist/frontend.d.ts +175 -2
- package/dist/frontend.js +7 -0
- package/dist/host/PluginsTab-OXQQ7M4I.js +3266 -0
- package/dist/host/chunk-54KCK6IZ.js +3167 -0
- package/dist/host/chunk-CALNJCHN.js +10435 -0
- package/dist/host/{chunk-7RRTYD6B.js → chunk-CN5UBTBP.js} +1412 -14
- package/dist/host/{chunk-RLQBKJRK.js → chunk-ERGN4YW6.js} +9204 -11492
- package/dist/host/{chunk-LSWB3ZZV.js → chunk-T2PZWXFJ.js} +6 -1
- package/dist/host/chunk-YGYBM7SQ.js +58 -0
- package/dist/host/core-classes.json +1 -1
- package/dist/host/{linked-server-UCW74T2V.js → linked-server-5VFO4XQB.js} +2 -2
- package/dist/host/{rbac-api-6UYMFIFV.js → rbac-api-5YMBJAO5.js} +2 -2
- package/dist/host/testing-host.js +123 -57
- package/dist/host/types/src/types/onboarding.d.ts +0 -2
- package/dist/host/types/src/types/ui-types.d.ts +2 -1
- package/dist/host/types/src/ui/api/audit-log-api.d.ts +36 -0
- package/dist/host/types/src/ui/api/credentials-api.d.ts +0 -22
- package/dist/host/types/src/ui/api/host-defaults-api.d.ts +42 -0
- package/dist/host/types/src/ui/api/host-tags-api.d.ts +2 -0
- package/dist/host/types/src/ui/api/look-api.d.ts +40 -0
- package/dist/host/types/src/ui/api/open-tabs-api.d.ts +4 -0
- package/dist/host/types/src/ui/api/plugins-api.d.ts +30 -0
- package/dist/host/types/src/ui/api/private-endpoints-api.d.ts +6 -0
- package/dist/host/types/src/ui/api/settings-api.d.ts +0 -6
- package/dist/host/types/src/ui/api/ssh-host-management-api.d.ts +0 -28
- package/dist/host/types/src/ui/api/tls-api.d.ts +25 -0
- package/dist/host/types/src/ui/auth/ElectronLoginForm.d.ts +9 -0
- package/dist/host/types/src/ui/components/command.d.ts +78 -0
- package/dist/host/types/src/ui/components/folder-style.d.ts +16 -0
- package/dist/host/types/src/ui/components/theme-provider.d.ts +2 -1
- package/dist/host/types/src/ui/components/version-badge.d.ts +7 -0
- package/dist/host/types/src/ui/hooks/use-page-visible-interval.d.ts +10 -0
- package/dist/host/types/src/ui/lib/activity-types.d.ts +15 -0
- package/dist/host/types/src/ui/lib/app-version.d.ts +2 -0
- package/dist/host/types/src/ui/lib/apply-ui-preset.d.ts +19 -0
- package/dist/host/types/src/ui/lib/create-id.d.ts +2 -0
- package/dist/host/types/src/ui/lib/database-transfer-url.d.ts +8 -0
- package/dist/host/types/src/ui/lib/desktop-updates.d.ts +29 -0
- package/dist/host/types/src/ui/lib/host-connection-tabs.d.ts +14 -0
- package/dist/host/types/src/ui/lib/host-to-ssh-host.d.ts +4 -0
- package/dist/host/types/src/ui/lib/issue-url.d.ts +21 -0
- package/dist/host/types/src/ui/lib/local-adaptive-preferences.d.ts +9 -0
- package/dist/host/types/src/ui/lib/pane-nav-hotkey.d.ts +7 -0
- package/dist/host/types/src/ui/lib/plugin-i18n.d.ts +4 -3
- package/dist/host/types/src/ui/lib/role-label.d.ts +3 -0
- package/dist/host/types/src/ui/look/LookSettings.d.ts +8 -0
- package/dist/host/types/src/ui/look/layout-registry.d.ts +34 -0
- package/dist/host/types/src/ui/look/look-store.d.ts +29 -0
- package/dist/host/types/src/ui/look/resolve-look.d.ts +18 -0
- package/dist/host/types/src/ui/look/theme-css.d.ts +7 -0
- package/dist/host/types/src/ui/look/theme-registry.d.ts +41 -0
- package/dist/host/types/src/ui/look/use-look-theme.d.ts +12 -0
- package/dist/host/types/src/ui/main-axios.d.ts +2 -2
- package/dist/host/types/src/ui/manage/manage-requests.d.ts +34 -0
- package/dist/host/types/src/ui/onboarding/onboarding-registry.d.ts +3 -1
- package/dist/host/types/src/ui/plugin-host/loader.d.ts +2 -0
- package/dist/host/types/src/ui/plugin-host/scope.d.ts +6 -0
- package/dist/host/types/src/ui/plugin-host/sdk-ui.d.ts +101 -0
- package/dist/host/types/src/ui/plugin-host/view-ownership.d.ts +1 -1
- package/dist/host/types/src/ui/plugins/PluginConsentPrompt.d.ts +20 -0
- package/dist/host/types/src/ui/plugins/PluginDetail.d.ts +7 -0
- package/dist/host/types/src/ui/plugins/PluginReleaseNotes.d.ts +14 -0
- package/dist/host/types/src/ui/plugins/PluginsTab.d.ts +1 -0
- package/dist/host/types/src/ui/plugins/RegistriesSection.d.ts +4 -0
- package/dist/host/types/src/ui/plugins/plugin-bits.d.ts +23 -0
- package/dist/host/types/src/ui/plugins/plugin-model.d.ts +136 -0
- package/dist/host/types/src/ui/plugins/use-plugins-manager.d.ts +78 -0
- package/dist/host/types/src/ui/settings/appearance/appearance-controls.d.ts +53 -0
- package/dist/host/types/src/ui/settings/sync/LinkServerDialog.d.ts +12 -0
- package/dist/host/types/src/ui/settings/sync/ProxySettingsFields.d.ts +15 -0
- package/dist/host/types/src/ui/settings/sync/saved-servers.d.ts +3 -0
- package/dist/host/types/src/ui/shell/controller/ShellControllerProvider.d.ts +20 -0
- package/dist/host/types/src/ui/shell/controller/plugin-shell.d.ts +7 -0
- package/dist/host/types/src/ui/shell/controller/shell-store.d.ts +4 -0
- package/dist/host/types/src/ui/shell/controller/types.d.ts +156 -0
- package/dist/host/types/src/ui/shell/controller/use-hosts.d.ts +10 -0
- package/dist/host/types/src/ui/shell/controller/use-regions.d.ts +5 -0
- package/dist/host/types/src/ui/shell/controller/use-shell-keybindings.d.ts +12 -0
- package/dist/host/types/src/ui/shell/controller/use-shell-lifecycle.d.ts +17 -0
- package/dist/host/types/src/ui/shell/controller/use-split.d.ts +21 -0
- package/dist/host/types/src/ui/shell/controller/use-tabs.d.ts +70 -0
- package/dist/host/types/src/ui/shell/controller/use-workspace-layout.d.ts +4 -0
- package/dist/host/types/src/ui/shell/reconnect-tabs.d.ts +6 -0
- package/dist/host/types/src/ui/shell/shell-layout.d.ts +46 -0
- package/dist/host/types/src/ui/shell/split/EmptyPanePicker.d.ts +32 -0
- package/dist/host/types/src/ui/shell/split/SplitDropOverlay.d.ts +9 -0
- package/dist/host/types/src/ui/shell/split/SplitLayoutMenu.d.ts +16 -0
- package/dist/host/types/src/ui/shell/split/SplitView.d.ts +31 -0
- package/dist/host/types/src/ui/shell/split/split-drag.d.ts +58 -0
- package/dist/host/types/src/ui/shell/split/split-presets.d.ts +28 -0
- package/dist/host/types/src/ui/shell/split/split-tabs.d.ts +95 -0
- package/dist/host/types/src/ui/shell/split/split-targets.d.ts +30 -0
- package/dist/host/types/src/ui/shell/split/split-tree.d.ts +89 -0
- package/dist/host/types/src/ui/shell/stage/TabStage.d.ts +9 -0
- package/dist/host/types/src/ui/shell/stage/tab-stage-store.d.ts +24 -0
- package/dist/host/types/src/ui/shell/tab-close-guards.d.ts +9 -0
- package/dist/host/types/src/ui/shell/tab-handles.d.ts +8 -0
- package/dist/host/types/src/ui/shell/tabUtils.d.ts +15 -0
- package/dist/host/types/src/ui/sidebar/AuthEnrollmentSections.d.ts +5 -0
- package/dist/host/types/src/ui/sidebar/HostManagerData.d.ts +4 -0
- package/dist/host/types/src/ui/sidebar/build-host-tree.d.ts +25 -0
- package/dist/host/types/src/ui/sidebar/host-contributions.d.ts +10 -0
- package/dist/host/ui.js +6045 -4055
- package/dist/host/{use-permissions-GYCBY2AU.js → use-permissions-ISEDRY3J.js} +2 -2
- package/dist/manifest.d.ts +50 -1
- package/dist/manifest.js +104 -1
- package/dist/ssh-keys.d.ts +29 -0
- package/dist/ssh-keys.js +85 -0
- package/dist/testing/setup.js +1 -0
- package/dist/testing.d.ts +32 -15
- package/dist/testing.js +218 -1
- package/dist/theme-css.d.ts +11 -0
- package/dist/theme-css.js +142 -0
- package/dist/vitest-preset.d.ts +18 -0
- package/dist/vitest-preset.js +14 -3
- package/package.json +5 -1
- package/schema/manifest.schema.json +121 -8
- package/tsconfig.plugin.json +1 -0
- package/dist/host/chunk-YC2MAKSP.js +0 -14
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type LayoutNode, type SplitState } from "./split-tree";
|
|
2
|
+
/** Starting layouts offered in the layout picker. Any pane can be split further. */
|
|
3
|
+
export type SplitPresetId = "columns-2" | "rows-2" | "columns-3" | "main-left-3" | "main-bottom-3" | "grid-4" | "grid-5" | "grid-6";
|
|
4
|
+
export interface SplitPreset {
|
|
5
|
+
id: SplitPresetId;
|
|
6
|
+
titleKey: string;
|
|
7
|
+
panes: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const SPLIT_PRESETS: SplitPreset[];
|
|
10
|
+
type Sizes = {
|
|
11
|
+
outer?: number[];
|
|
12
|
+
inner?: number[][];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Builds a preset's tree, filling panes in reading order from `tabIds`.
|
|
16
|
+
* `sizes` lets the legacy mapping keep the user's divider positions.
|
|
17
|
+
*/
|
|
18
|
+
export declare function buildPreset(id: SplitPresetId, tabIds?: (string | null)[], sizes?: Sizes): LayoutNode;
|
|
19
|
+
/**
|
|
20
|
+
* Re-lays an existing split out as a preset, keeping its tabs in reading
|
|
21
|
+
* order. Tabs past the preset's pane count drop out of the split.
|
|
22
|
+
*/
|
|
23
|
+
export declare function applyPreset(state: SplitState, id: SplitPresetId): SplitState;
|
|
24
|
+
/** Split modes from before the layout tree, still found in storage and old workspaces. */
|
|
25
|
+
export type LegacySplitMode = "2-way" | "2-way-horizontal" | "3-way" | "3-way-horizontal" | "4-way" | "5-way" | "6-way";
|
|
26
|
+
/** Maps an old fixed-mode split onto the tree, keeping sizes where they fit. */
|
|
27
|
+
export declare function fromLegacyConfig(mode: string, paneTabIds: (string | null)[], rowSizes?: unknown, rowColSizes?: unknown): LayoutNode | null;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { LayoutNode, SplitState, Tab } from "../../../types/ui-types";
|
|
2
|
+
import { type SplitPresetId } from "./split-presets";
|
|
3
|
+
/**
|
|
4
|
+
* Split tabs as they live in the shell's tab list. A split tab owns its
|
|
5
|
+
* layout tree; every tab shown in one of its panes carries parentSplitTabId
|
|
6
|
+
* so the tab bar hides it. These keep the two in step.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SPLIT_TAB_TYPE = "split-screen";
|
|
9
|
+
export type SplitTab = Tab & {
|
|
10
|
+
split: SplitState;
|
|
11
|
+
};
|
|
12
|
+
export declare function isSplitTab(tab: Tab | undefined | null): tab is SplitTab;
|
|
13
|
+
/** Tabs a pane may hold: anything but the dashboard and other splits. */
|
|
14
|
+
export declare function canJoinSplit(tab: Tab | undefined | null): boolean;
|
|
15
|
+
export declare function splitTabOf(tabs: Tab[], tabId: string): SplitTab | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Makes parentSplitTabId match the trees. Pane tab ids that no longer exist
|
|
18
|
+
* are emptied, and a tab claimed by two splits stays with the first.
|
|
19
|
+
*/
|
|
20
|
+
export declare function syncSplitChildren(tabs: Tab[]): Tab[];
|
|
21
|
+
/**
|
|
22
|
+
* Applies `fn` to one split's state. Returning null closes the split and
|
|
23
|
+
* sends its tabs back to the tab bar.
|
|
24
|
+
*/
|
|
25
|
+
export declare function updateSplit(tabs: Tab[], splitTabId: string, fn: (state: SplitState) => SplitState | null): Tab[];
|
|
26
|
+
export declare function makeSplitTab(instanceId: string, label: string, split: SplitState, openedAt?: number): SplitTab;
|
|
27
|
+
/** Adds a split tab, taking its tabs out of any other split. */
|
|
28
|
+
export declare function addSplitTab(tabs: Tab[], splitTab: SplitTab): Tab[];
|
|
29
|
+
/** Removes a split tab. Its tabs go back to the tab bar. */
|
|
30
|
+
export declare function closeSplitTab(tabs: Tab[], splitTabId: string): Tab[];
|
|
31
|
+
/**
|
|
32
|
+
* Removes a closed tab. A pane that held it stays, empty and focused, so the
|
|
33
|
+
* next thing the user opens can go straight into it.
|
|
34
|
+
*/
|
|
35
|
+
export declare function removeTab(tabs: Tab[], tabId: string): Tab[];
|
|
36
|
+
/** Puts a tab in a pane of a split and focuses that pane. */
|
|
37
|
+
export declare function placeTabInPane(tabs: Tab[], splitTabId: string, paneId: string, tabId: string): Tab[];
|
|
38
|
+
/** What the tab bar asks the shell to do with splits. */
|
|
39
|
+
export type TabSplitAction = {
|
|
40
|
+
kind: "split";
|
|
41
|
+
tabId: string;
|
|
42
|
+
edge: "right" | "bottom";
|
|
43
|
+
} | {
|
|
44
|
+
kind: "addToPane";
|
|
45
|
+
tabId: string;
|
|
46
|
+
splitTabId: string;
|
|
47
|
+
paneId: string;
|
|
48
|
+
} | {
|
|
49
|
+
kind: "addPane";
|
|
50
|
+
tabId: string;
|
|
51
|
+
splitTabId: string;
|
|
52
|
+
edge: "right" | "bottom";
|
|
53
|
+
} | {
|
|
54
|
+
kind: "unsplit";
|
|
55
|
+
splitTabId: string;
|
|
56
|
+
} | {
|
|
57
|
+
kind: "splitActive";
|
|
58
|
+
edge: "right" | "bottom";
|
|
59
|
+
} | {
|
|
60
|
+
kind: "preset";
|
|
61
|
+
presetId: SplitPresetId;
|
|
62
|
+
};
|
|
63
|
+
/** The lowest N not already used by a "Split N" style label. */
|
|
64
|
+
export declare function nextSplitNumber(tabs: Tab[], labelFor: (n: number) => string): number;
|
|
65
|
+
export interface SplitPaneSummary {
|
|
66
|
+
id: string;
|
|
67
|
+
/** 1-based, in reading order. */
|
|
68
|
+
index: number;
|
|
69
|
+
tabId: string | null;
|
|
70
|
+
/** The tab's label, or null for an empty pane. */
|
|
71
|
+
label: string | null;
|
|
72
|
+
}
|
|
73
|
+
export interface SplitSummary {
|
|
74
|
+
id: string;
|
|
75
|
+
label: string;
|
|
76
|
+
panes: SplitPaneSummary[];
|
|
77
|
+
full: boolean;
|
|
78
|
+
}
|
|
79
|
+
export declare function summarizeSplits(tabs: Tab[], maxPanes: number): SplitSummary[];
|
|
80
|
+
/** Saved in localStorage; pane tab ids are tab instanceIds, which survive a reload. */
|
|
81
|
+
export type PersistedSplitTab = {
|
|
82
|
+
version: 2;
|
|
83
|
+
instanceId: string;
|
|
84
|
+
label: string;
|
|
85
|
+
root: LayoutNode;
|
|
86
|
+
focusedPaneId: string;
|
|
87
|
+
};
|
|
88
|
+
export declare function serializeSplitTabs(tabs: Tab[]): PersistedSplitTab[];
|
|
89
|
+
/**
|
|
90
|
+
* Rebuilds a saved split's tree with live tab ids. `resolve` maps whatever
|
|
91
|
+
* the save used (instanceIds, workspace slotIds) to a live tab id. Null when
|
|
92
|
+
* the entry is unreadable or none of its tabs came back.
|
|
93
|
+
*/
|
|
94
|
+
export declare function restoreSplitState(entry: unknown, resolve: (savedId: string) => string | null): SplitState | null;
|
|
95
|
+
export declare function restoreSplitTabs(persisted: unknown[], tabs: Tab[], openedAt?: number): Tab[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { SplitSummary } from "./split-tabs";
|
|
2
|
+
/**
|
|
3
|
+
* Lets menus outside the shell (the host list) offer "Open in split" without
|
|
4
|
+
* threading split state through every sidebar component. The shell publishes
|
|
5
|
+
* its splits here and registers how to aim the next opened tab at a pane.
|
|
6
|
+
*/
|
|
7
|
+
export type SplitOpenTarget = {
|
|
8
|
+
kind: "pane";
|
|
9
|
+
splitTabId: string;
|
|
10
|
+
paneId: string;
|
|
11
|
+
} | {
|
|
12
|
+
kind: "newPane";
|
|
13
|
+
splitTabId: string;
|
|
14
|
+
}
|
|
15
|
+
/** A new split holding the active tab and the opened one. */
|
|
16
|
+
| {
|
|
17
|
+
kind: "newSplit";
|
|
18
|
+
};
|
|
19
|
+
export interface SplitTargetsSnapshot {
|
|
20
|
+
splits: SplitSummary[];
|
|
21
|
+
/** The active tab can start a new split. */
|
|
22
|
+
canStartSplit: boolean;
|
|
23
|
+
}
|
|
24
|
+
type Opener = (target: SplitOpenTarget, open: () => void) => void;
|
|
25
|
+
export declare function publishSplitTargets(next: SplitTargetsSnapshot): void;
|
|
26
|
+
export declare function setSplitOpener(next: Opener): () => void;
|
|
27
|
+
/** Runs `open` so whatever tab it opens lands in `target`. */
|
|
28
|
+
export declare function openInSplit(target: SplitOpenTarget, open: () => void): void;
|
|
29
|
+
export declare function useSplitTargets(): SplitTargetsSnapshot;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { LayoutNode, PaneNode, SplitDirection, SplitNode, SplitState } from "../../../types/ui-types";
|
|
2
|
+
/**
|
|
3
|
+
* The layout of one split tab: a tree where every leaf is a pane holding at
|
|
4
|
+
* most one tab, and every inner node lays its children out in a row (side by
|
|
5
|
+
* side) or a column (stacked). All functions here are pure and return a new
|
|
6
|
+
* state, so the shell can keep the whole thing on the split tab itself.
|
|
7
|
+
*/
|
|
8
|
+
export declare const MAX_PANES = 8;
|
|
9
|
+
/** Smallest share of its parent a pane or group can be dragged down to. */
|
|
10
|
+
export declare const MIN_PANE_SIZE = 10;
|
|
11
|
+
export type { SplitDirection, PaneNode, SplitNode, LayoutNode, SplitState, } from "../../../types/ui-types";
|
|
12
|
+
export type PaneEdge = "left" | "right" | "top" | "bottom";
|
|
13
|
+
export type DropTarget = PaneEdge | "center";
|
|
14
|
+
export type NavDirection = "left" | "right" | "up" | "down";
|
|
15
|
+
export interface PaneRect {
|
|
16
|
+
left: number;
|
|
17
|
+
top: number;
|
|
18
|
+
right: number;
|
|
19
|
+
bottom: number;
|
|
20
|
+
}
|
|
21
|
+
export declare function createPane(tabId?: string | null): PaneNode;
|
|
22
|
+
export declare function evenSizes(count: number): number[];
|
|
23
|
+
export declare function createSplitNode(direction: SplitDirection, children: LayoutNode[], sizes?: number[]): SplitNode;
|
|
24
|
+
export declare function createSplitState(root: LayoutNode, focusedPaneId?: string): SplitState;
|
|
25
|
+
export declare function listPanes(node: LayoutNode): PaneNode[];
|
|
26
|
+
export declare function paneCount(state: SplitState): number;
|
|
27
|
+
export declare function findPane(state: SplitState, paneId: string): PaneNode | undefined;
|
|
28
|
+
export declare function findPaneByTab(state: SplitState, tabId: string): PaneNode | undefined;
|
|
29
|
+
export declare function emptyPanes(state: SplitState): PaneNode[];
|
|
30
|
+
export declare function tabIdsInSplit(state: SplitState): string[];
|
|
31
|
+
/**
|
|
32
|
+
* The panes on screen: just the zoomed one, just the focused one when only
|
|
33
|
+
* one fits (mobile), else all of them.
|
|
34
|
+
*/
|
|
35
|
+
export declare function shownPanes(state: SplitState, onePaneOnly?: boolean): PaneNode[];
|
|
36
|
+
export declare function canAddPane(state: SplitState): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Collapses groups with one child, inlines a child group running the same
|
|
39
|
+
* way as its parent, and rescales sizes. Keeps the tree in the one shape the
|
|
40
|
+
* rest of the code expects after any edit.
|
|
41
|
+
*/
|
|
42
|
+
export declare function normalizeNode(node: LayoutNode): LayoutNode;
|
|
43
|
+
/**
|
|
44
|
+
* Adds a pane next to `paneId`, holding `tabId` or empty. Null when the pane
|
|
45
|
+
* does not exist or the split is full.
|
|
46
|
+
*/
|
|
47
|
+
export declare function splitPane(state: SplitState, paneId: string, edge: PaneEdge, tabId?: string | null): {
|
|
48
|
+
state: SplitState;
|
|
49
|
+
paneId: string;
|
|
50
|
+
} | null;
|
|
51
|
+
/** Adds a pane along one outer edge of the whole split. */
|
|
52
|
+
export declare function addPaneAtEdge(state: SplitState, edge: PaneEdge, tabId?: string | null): {
|
|
53
|
+
state: SplitState;
|
|
54
|
+
paneId: string;
|
|
55
|
+
} | null;
|
|
56
|
+
/** Removes a pane. Null when it was the last one, so the split should close. */
|
|
57
|
+
export declare function removePane(state: SplitState, paneId: string): SplitState | null;
|
|
58
|
+
/** Puts a tab in a pane (or empties it with null), moving it out of any other pane. */
|
|
59
|
+
export declare function assignTab(state: SplitState, paneId: string, tabId: string | null): SplitState;
|
|
60
|
+
/** Empties whichever pane holds the tab, leaving the pane in place. */
|
|
61
|
+
export declare function clearTab(state: SplitState, tabId: string): SplitState;
|
|
62
|
+
export declare function swapPanes(state: SplitState, firstId: string, secondId: string): SplitState;
|
|
63
|
+
/**
|
|
64
|
+
* Drops one pane onto another: the center swaps their contents, an edge
|
|
65
|
+
* moves the dragged pane to that side of the target.
|
|
66
|
+
*/
|
|
67
|
+
export declare function movePane(state: SplitState, fromId: string, toId: string, target: DropTarget): SplitState;
|
|
68
|
+
export declare function focusPane(state: SplitState, paneId: string): SplitState;
|
|
69
|
+
export declare function toggleZoom(state: SplitState, paneId: string): SplitState;
|
|
70
|
+
export declare function resizeSplit(state: SplitState, splitId: string, sizes: number[]): SplitState;
|
|
71
|
+
export declare function equalizeSplit(state: SplitState, splitId: string): SplitState;
|
|
72
|
+
/**
|
|
73
|
+
* Moves the divider between children `index` and `index + 1` by `delta`
|
|
74
|
+
* percent, keeping both above MIN_PANE_SIZE.
|
|
75
|
+
*/
|
|
76
|
+
export declare function moveDivider(sizes: number[], index: number, delta: number): number[];
|
|
77
|
+
/**
|
|
78
|
+
* Repairs a state read from storage or left over after tabs closed: drops
|
|
79
|
+
* tab ids that no longer exist, keeps each tab in one pane, fixes focus.
|
|
80
|
+
*/
|
|
81
|
+
export declare function normalizeState(state: SplitState, isLiveTab?: (tabId: string) => boolean): SplitState;
|
|
82
|
+
/** Rewrites every pane's tab id, e.g. live ids to saved instance ids and back. */
|
|
83
|
+
export declare function mapTabIds(node: LayoutNode, fn: (tabId: string) => string | null): LayoutNode;
|
|
84
|
+
/**
|
|
85
|
+
* The pane next to `paneId` in a direction, by on-screen position. Picks the
|
|
86
|
+
* closest pane that overlaps along the other axis, then the one with the
|
|
87
|
+
* most overlap, so it works for any tree shape.
|
|
88
|
+
*/
|
|
89
|
+
export declare function neighborPane(paneId: string, direction: NavDirection, rects: Record<string, PaneRect>): string | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The area tabs show in: the active tab, or the active split's panes, plus
|
|
3
|
+
* the drop zones for dragging a tab or pane into a split. A layout places it
|
|
4
|
+
* wherever its main area is. Tabs are never mounted here, only moved in, so
|
|
5
|
+
* moving or remounting the stage keeps every session alive.
|
|
6
|
+
*/
|
|
7
|
+
export declare function TabStage({ className }: {
|
|
8
|
+
className?: string;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Tab } from "../../../types/ui-types";
|
|
2
|
+
/**
|
|
3
|
+
* Where tab content lives in the DOM.
|
|
4
|
+
*
|
|
5
|
+
* Every tab gets one stable node, created once and kept while the tab lives.
|
|
6
|
+
* React portals the tab into that node and never changes the portal target,
|
|
7
|
+
* since changing it remounts the tab (and drops a live terminal). The node is
|
|
8
|
+
* moved with plain DOM between the stage's normal view and pane elements, or
|
|
9
|
+
* left detached while no stage is mounted, e.g. while a layout is swapped.
|
|
10
|
+
*/
|
|
11
|
+
export interface TabStageStore {
|
|
12
|
+
getNode: (tabId: string, ownBackground: boolean) => HTMLDivElement;
|
|
13
|
+
/** Tab ids in the order their portals render: append only, never reordered. */
|
|
14
|
+
portalOrder: (tabs: Tab[]) => Tab[];
|
|
15
|
+
paneEls: Map<string, HTMLDivElement>;
|
|
16
|
+
setPaneEl: (paneId: string, el: HTMLDivElement | null) => void;
|
|
17
|
+
normalView: () => HTMLDivElement | null;
|
|
18
|
+
setNormalView: (el: HTMLDivElement | null) => void;
|
|
19
|
+
/** Moves every node where it belongs and sets its visibility. */
|
|
20
|
+
place: (tabs: Tab[], activeTabId: string, paneIdByTabId: Map<string, string>, ownBackground: (tab: Tab) => boolean) => void;
|
|
21
|
+
subscribe: (listener: () => void) => () => void;
|
|
22
|
+
version: () => number;
|
|
23
|
+
}
|
|
24
|
+
export declare function createTabStageStore(): TabStageStore;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type Guard = () => boolean | Promise<boolean>;
|
|
2
|
+
/**
|
|
3
|
+
* Lets a tab with no session handle, like Manage, ask before it closes.
|
|
4
|
+
* Returns the unregister function.
|
|
5
|
+
*/
|
|
6
|
+
export declare function registerTabCloseGuard(tabId: string, guard: Guard): () => void;
|
|
7
|
+
/** Whether the tab may close: true when it has no guard or the guard agrees. */
|
|
8
|
+
export declare function canCloseTab(tabId: string): Promise<boolean>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Ref, type RefObject } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* A callback ref that fills `ref` and tells the tab bar. The same function
|
|
4
|
+
* comes back for the same ref, so React never detaches and reattaches it.
|
|
5
|
+
*/
|
|
6
|
+
export declare function trackTabHandle(ref: RefObject<unknown> | undefined): Ref<unknown> | undefined;
|
|
7
|
+
/** Changes whenever any tab's handle attaches or goes away. */
|
|
8
|
+
export declare function useTabHandlesVersion(): number;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Tab, TabType } from "../../types/ui-types";
|
|
2
|
+
import { type TabShellCallbacks } from "./tab-registry";
|
|
3
|
+
/** Download a likely next tab without starting a connection or mounting UI. */
|
|
4
|
+
export declare function preloadTabSurface(type: TabType): void;
|
|
5
|
+
export declare function markTabSurfaceUsed(type: TabType): void;
|
|
6
|
+
export declare function tabIcon(type: TabType): import("react").JSX.Element;
|
|
7
|
+
export interface TabRenderContext {
|
|
8
|
+
shell: TabShellCallbacks;
|
|
9
|
+
/** The terminal a panel shown as a tab sends commands to. */
|
|
10
|
+
panelTargetTab?: Tab;
|
|
11
|
+
isVisible?: boolean;
|
|
12
|
+
isFocusedPane?: boolean;
|
|
13
|
+
inSplit?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function renderTabContent(tab: Tab, context: TabRenderContext): import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SSHHostWithStatus } from "../main-axios";
|
|
2
|
+
import type { HostFolder } from "../../types/ui-types";
|
|
3
|
+
/**
|
|
4
|
+
* Builds the sidebar's host tree from the flat host list returned by the
|
|
5
|
+
* API, nesting via two independent mechanisms:
|
|
6
|
+
*
|
|
7
|
+
* - folder: a " / "-separated string path, split into synthetic HostFolder
|
|
8
|
+
* nodes (folders are virtual -- they only exist as this derived tree).
|
|
9
|
+
* - parentHostId: sub-host nesting, where a real host acts as an
|
|
10
|
+
* organizational parent for other real hosts. A host with children stays
|
|
11
|
+
* a normal, connectable Host -- it is never wrapped in a synthetic node,
|
|
12
|
+
* just given a childHosts array the tree/virtualizer walk into.
|
|
13
|
+
*
|
|
14
|
+
* The backend already enforces that folder and parentHostId are mutually
|
|
15
|
+
* exclusive on write and rejects cycles, but this still defends against
|
|
16
|
+
* stale/imported/synced data: a missing, inaccessible, or cyclic parent
|
|
17
|
+
* falls back to folder/root placement rather than being dropped or looping.
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildHostTree(hosts: SSHHostWithStatus[], folderMeta?: Map<string, {
|
|
20
|
+
color?: string;
|
|
21
|
+
icon?: string;
|
|
22
|
+
credentialId?: number | null;
|
|
23
|
+
sortOrder?: number | null;
|
|
24
|
+
localOnly?: boolean;
|
|
25
|
+
}>): HostFolder;
|
|
@@ -45,6 +45,10 @@ export interface HostBadgeDef {
|
|
|
45
45
|
}>;
|
|
46
46
|
order?: number;
|
|
47
47
|
}
|
|
48
|
+
/** The dot or stripe on a host row that shows its status. */
|
|
49
|
+
export type HostStatusIndicatorDef = HostBadgeDef;
|
|
50
|
+
/** A button in the host editor's toolbar. */
|
|
51
|
+
export type HostEditorToolbarItemDef = HostBadgeDef;
|
|
48
52
|
export interface HostContextMenuItemDef {
|
|
49
53
|
id: string;
|
|
50
54
|
pluginId?: string;
|
|
@@ -61,12 +65,18 @@ export declare function actionOrder(action: HostActionDef): number;
|
|
|
61
65
|
export declare const listHostActions: () => HostActionDef[];
|
|
62
66
|
export declare const registerHostBadge: (item: HostBadgeDef) => () => void;
|
|
63
67
|
export declare const useHostBadges: () => HostBadgeDef[];
|
|
68
|
+
export declare const registerHostStatusIndicator: (item: HostBadgeDef) => () => void;
|
|
69
|
+
export declare const useHostStatusIndicators: () => HostBadgeDef[];
|
|
70
|
+
export declare const registerHostEditorToolbarItem: (item: HostBadgeDef) => () => void;
|
|
71
|
+
export declare const useHostEditorToolbarItems: () => HostBadgeDef[];
|
|
64
72
|
export declare const registerHostContextMenuItem: (item: HostContextMenuItemDef) => () => void;
|
|
65
73
|
export declare const useHostContextMenuItems: () => HostContextMenuItemDef[];
|
|
66
74
|
export declare function hostActionsFor(all: HostActionDef[], host: Host, kind?: HostActionDef["kind"]): HostActionDef[];
|
|
67
75
|
/** The connect action a click on the host should run, by priority. */
|
|
68
76
|
export declare function defaultConnectAction(all: HostActionDef[], host: Host): HostActionDef | undefined;
|
|
69
77
|
export declare function hostBadgesFor(all: HostBadgeDef[], host: Host): HostBadgeDef[];
|
|
78
|
+
export declare function hostStatusIndicatorsFor(all: HostStatusIndicatorDef[], host: Host): HostStatusIndicatorDef[];
|
|
79
|
+
export declare function hostEditorToolbarItemsFor(all: HostEditorToolbarItemDef[], host: Host): HostEditorToolbarItemDef[];
|
|
70
80
|
export declare function hostMenuItemsFor(all: HostContextMenuItemDef[], host: Host): HostContextMenuItemDef[];
|
|
71
81
|
/** Runs an action, falling back to opening its tab type. */
|
|
72
82
|
export declare function runHostAction(action: HostActionDef, host: Host, shell: TabShellCallbacks): void;
|