deck-plugin-sdk 1.15.2 → 1.16.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deck-plugin-sdk",
3
- "version": "1.15.2",
3
+ "version": "1.16.1",
4
4
  "description": "Build a plugin for Deck, outside the Deck repository.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/shim/terminals.js CHANGED
@@ -33,7 +33,6 @@ export const getInstance = (...a) => t().getInstance(...a);
33
33
  export const getLayout = (...a) => t().getLayout(...a);
34
34
  export const hasSelection = (...a) => t().hasSelection(...a);
35
35
  export const insertBeside = (...a) => t().insertBeside(...a);
36
- export const isPinned = (...a) => t().isPinned(...a);
37
36
  export const isWorkspaceActive = (...a) => t().isWorkspaceActive(...a);
38
37
  export const leafIds = (...a) => t().leafIds(...a);
39
38
  export const leaveGroup = (...a) => t().leaveGroup(...a);
@@ -91,11 +90,9 @@ export const termSpawn = (...a) => t().termSpawn(...a);
91
90
  export const termSweepScrollback = (...a) => t().termSweepScrollback(...a);
92
91
  export const termWrite = (...a) => t().termWrite(...a);
93
92
  export const toggleGroupFold = (...a) => t().toggleGroupFold(...a);
94
- export const togglePin = (...a) => t().togglePin(...a);
95
93
  export const ungroup = (...a) => t().ungroup(...a);
96
94
  export const useAgentPanesVersion = (...a) => t().useAgentPanesVersion(...a);
97
95
  export const useLayout = (...a) => t().useLayout(...a);
98
- export const usePinnedPanes = (...a) => t().usePinnedPanes(...a);
99
96
  export const webglLimit = (...a) => t().webglLimit(...a);
100
97
  export const workspaceByCwd = (...a) => t().workspaceByCwd(...a);
101
98
  export const workspaceShellCount = (...a) => t().workspaceShellCount(...a);
@@ -5,6 +5,6 @@
5
5
  "icon": "Sparkles",
6
6
  "color": "#a78bfa",
7
7
  "version": "0.1.0",
8
- "minDeck": "1.15.2",
8
+ "minDeck": "1.16.1",
9
9
  "permissions": []
10
10
  }
@@ -12,8 +12,9 @@ export interface PhysRect {
12
12
  h: number;
13
13
  }
14
14
  /** Open `url` in the browser pane's own webview (created the first time) at `r`. A private one
15
- * keeps no cookies, history or cache. */
16
- export declare const browserOpen: (pane: string, url: string, isPrivate: boolean, r: PhysRect, window?: string) => Promise<void>;
15
+ * keeps no cookies, history or cache. A webview it already has goes to `url` only with `go` (sent
16
+ * there); shown again, a page keeps what it is doing. */
17
+ export declare const browserOpen: (pane: string, url: string, isPrivate: boolean, r: PhysRect, window?: string, go?: boolean) => Promise<void>;
17
18
  /** Move the pane's webview, or hide it. */
18
19
  export declare const browserBounds: (pane: string, r: PhysRect, visible: boolean, window?: string) => Promise<void>;
19
20
  export declare const browserNav: (pane: string, action: "back" | "forward" | "reload" | "go" | "focus", url?: string) => Promise<void>;
@@ -316,6 +317,11 @@ export interface Settings {
316
317
  askBeforeClose?: "running" | "always" | "never";
317
318
  /** The workspace sidebar is a button in the title bar that opens it over the panes, rather than a column. */
318
319
  sidebarMenu?: boolean;
320
+ /** Which dock of pinned panes takes the corner between them: the right one full height (unset),
321
+ * or the bottom one full width (modules/terminals/Dock.tsx). */
322
+ dockCorner?: "right" | "bottom";
323
+ /** The docks show every project's pinned panes (unset), or only the active project's. */
324
+ dockScope?: "all" | "project";
319
325
  /** Pane controls float over the pane's top-right corner on hover, instead of a header row. */
320
326
  floatingPaneControls: boolean;
321
327
  /** Per notification kind, whether it shows as a card, in the bell, with a sound, and as a Windows
@@ -148,12 +148,7 @@ export declare function browserInFloat(url: string, where: {
148
148
  beside?: string;
149
149
  focus?: boolean;
150
150
  }, isPrivate?: boolean): void;
151
- /** Read once, before the first browser pane asks. */
152
- export declare const loadPanes: () => Promise<void>;
153
- /** The page a pane was on when Deck last closed. */
154
- export declare const savedPage: (pane: string) => string | undefined;
155
- /** The page a pane should open on, as a restarted Deck reopens one: a closed tab reopened. */
156
- export declare function seedPage(pane: string, url: string): void;
151
+ export { loadPanes, savedPage, savedLook, seedPage, subscribePanes } from "./browserpanes";
157
152
  /** How Ctrl+Shift+B shows or hides the bookmarks bar: set by the browser pane, which holds the settings. */
158
153
  export declare const setBarToggle: (f: () => void) => void;
159
154
  /** Bookmark the pane's page, as its star does: Ctrl+D, and the browser menu. */
@@ -0,0 +1,24 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ /** The title and icon a pane's page had. An icon past this length (a big data: address) is not kept. */
3
+ export interface PageLook {
4
+ title?: string;
5
+ icon?: string;
6
+ }
7
+ /** Read once, before the first browser pane asks. */
8
+ export declare const loadPanes: () => Promise<void>;
9
+ /** Told once the kept pages have been read: a tab waiting on its page's title. */
10
+ export declare const subscribePanes: (f: () => void) => () => void;
11
+ /** The page a pane was on when Deck last closed. */
12
+ export declare const savedPage: (pane: string) => string | undefined;
13
+ /** The title and icon that page had, for its tab until it loads. The same object until it changes. */
14
+ export declare const savedLook: (pane: string) => PageLook | undefined;
15
+ export declare function rememberPane(pane: string, s: {
16
+ url: string;
17
+ home: boolean;
18
+ private: boolean;
19
+ title: string;
20
+ favicon: string;
21
+ } | undefined): void;
22
+ /** The page a pane should open on, as a restarted Deck reopens one: a closed tab reopened. */
23
+ export declare function seedPage(pane: string, url: string): void;
24
+ export declare function forgetPane(pane: string): void;
@@ -0,0 +1,55 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ import { type Layout, type LayoutTab, type LayoutWorkspace } from "./layout";
3
+ export type DockSide = "right" | "bottom";
4
+ export declare const DOCK_SIDES: readonly DockSide[];
5
+ /** The `window` of a tab in each dock. */
6
+ export declare const DOCK_WINDOW: Record<DockSide, string>;
7
+ export declare const isDock: (win?: string) => boolean;
8
+ export declare const sideOf: (win: string) => DockSide;
9
+ export interface DockState {
10
+ /** Shown rather than folded to its strip of buttons. Absent means open. */
11
+ open?: boolean;
12
+ /** The right dock's width, the bottom one's height, in px. */
13
+ size?: number;
14
+ /** The docked tab it shows; absent or gone, the first one. */
15
+ shown?: string;
16
+ }
17
+ export type Docks = Partial<Record<DockSide, DockState>>;
18
+ export declare const setDockScope: (onlyActive: boolean) => void;
19
+ /** The tabs in one dock, or in either, with the workspace each belongs to, in workspace order. */
20
+ export declare function dockTabs(l: Layout | null, side?: DockSide): {
21
+ ws: LayoutWorkspace;
22
+ tab: LayoutTab;
23
+ }[];
24
+ /** The tabs a dock shows: `dockTabs`, only the active project's while the docks are per project. */
25
+ export declare function shownDockTabs(l: Layout | null, side: DockSide): {
26
+ ws: LayoutWorkspace;
27
+ tab: LayoutTab;
28
+ }[];
29
+ /** The docks show tab `tabId`'s project: per project, that one comes to the front. */
30
+ export declare const withProjectOf: (l: Layout, tabId: string) => Layout;
31
+ /** The dock pane `paneId` is in, if it is in one. */
32
+ export declare function dockOf(paneId: string): DockSide | undefined;
33
+ export declare function setDock(side: DockSide, patch: DockState): void;
34
+ /**
35
+ * Pin a pane to a dock. The only pane of its tab takes the tab with it; one pane of a split leaves
36
+ * the split and gets a docked tab of its own, which remembers the tab it came from (`from`) to go
37
+ * back to. The pane keeps its id, so a terminal keeps its shell and a tool its state. A pane in the
38
+ * other dock moves across.
39
+ */
40
+ export declare function pinPane(paneId: string, side?: DockSide): void;
41
+ /** Tab `tabId`, all its panes, into a dock: from a zone, a floating window or the other dock. */
42
+ export declare function pinTab(tabId: string, side: DockSide): void;
43
+ /** Docked tab `tabId`, all its panes, into the other dock. */
44
+ export declare function moveDocked(tabId: string, side: DockSide): void;
45
+ /**
46
+ * Take docked tab `tabId` out of its dock: beside the panes of the tab it came from when that tab
47
+ * is still there, else as a tab in the zone in front, never a zone of its own (the zone it left may
48
+ * be gone, or its cell taken). Either way its workspace comes to the front showing it, so you see
49
+ * where it went.
50
+ */
51
+ export declare function unpinTab(tabId: string): void;
52
+ /** Unpin whichever docked tab holds pane `paneId`. */
53
+ export declare function unpinPane(paneId: string): void;
54
+ /** Both docks folded when either is open, else both open. */
55
+ export declare function toggleDocks(): void;
@@ -1,5 +1,6 @@
1
1
  // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
2
  import { TabGroup } from "./zones";
3
+ import type { Docks } from "./dock";
3
4
  export type SplitDir = "h" | "v";
4
5
  export type LayoutNode = {
5
6
  kind: "leaf";
@@ -52,6 +53,9 @@ export interface LayoutTab {
52
53
  /** Pinned from its menu (tabops.ts): only its icon, before the unpinned tabs beside it, and left
53
54
  * open by Close others, Close to the right and Close all. */
54
55
  pinned?: true;
56
+ /** In a dock (`window` "dock" or "dock-bottom", core/workspaces/dock.ts) as one pane taken out of a split: the
57
+ * tab it came from, which unpinning puts it back beside. */
58
+ from?: string;
55
59
  }
56
60
  export interface LayoutWorkspace {
57
61
  id: string;
@@ -79,6 +83,8 @@ export interface Layout {
79
83
  workspaces: LayoutWorkspace[];
80
84
  activeWs: string;
81
85
  floats?: FloatBounds[];
86
+ /** The two docks of panes kept in view across workspaces (core/workspaces/dock.ts). */
87
+ dock?: Docks;
82
88
  }
83
89
  export declare let currentLayout: Layout | null;
84
90
  export declare const layoutSubs: Set<() => void>;
@@ -94,8 +100,10 @@ export declare let loadPromise: Promise<void> | null;
94
100
  export declare let liveAtLoad: Set<string> | null;
95
101
  export declare function loadLayoutOnce(): Promise<void>;
96
102
  /**
97
- * What every layout write leaves true of a workspace: its active tab is one the main window draws
98
- * (a tab in a floating window is not; going to one leaves the main window on a neighbour), its zone
103
+ * What every layout write leaves true of a workspace: the main window has a tab of it to draw (its
104
+ * last one closed with the rest in floating windows or docks, a fresh terminal), its active tab is
105
+ * one the main window draws (a tab in a floating window or a dock is not; going to one leaves the
106
+ * main window on a neighbour), its zone
99
107
  * shows it (showActiveTab), a folded group holding it opens (openActiveGroup), and a tab group
100
108
  * whose last tab went goes with it (pruneGroups).
101
109
  */
@@ -247,6 +247,3 @@ export declare function restartPane(id: string, cwd: string): Promise<void>;
247
247
  */
248
248
  export declare function suspendWorkspace(wsId: string): Promise<number>;
249
249
  export declare function destroy(id: string): void;
250
- export declare function usePinnedPanes(): string[];
251
- export declare const isPinned: (id: string) => boolean;
252
- export declare function togglePin(id: string): void;