deck-plugin-sdk 1.5.0 → 1.6.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.5.0",
3
+ "version": "1.6.1",
4
4
  "description": "Build a plugin for Deck, outside the Deck repository.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/shim/bridge.js CHANGED
@@ -10,12 +10,47 @@ const b = () => {
10
10
  return x;
11
11
  };
12
12
 
13
+ export const adblockConfig = (...a) => b().adblockConfig(...a);
14
+ export const adblockInfo = (...a) => b().adblockInfo(...a);
15
+ export const adblockRebuild = (...a) => b().adblockRebuild(...a);
16
+ export const adblockUpdate = (...a) => b().adblockUpdate(...a);
13
17
  export const agentClis = (...a) => b().agentClis(...a);
14
18
  export const agentMcpStatus = (...a) => b().agentMcpStatus(...a);
15
19
  export const askSudoPassword = (...a) => b().askSudoPassword(...a);
16
20
  export const backupExport = (...a) => b().backupExport(...a);
17
21
  export const backupInspect = (...a) => b().backupInspect(...a);
18
22
  export const backupRestore = (...a) => b().backupRestore(...a);
23
+ export const bookmarksBarMode = (...a) => b().bookmarksBarMode(...a);
24
+ export const browserAgentAnswer = (...a) => b().browserAgentAnswer(...a);
25
+ export const browserAgentConfig = (...a) => b().browserAgentConfig(...a);
26
+ export const browserAgentFillAnswer = (...a) => b().browserAgentFillAnswer(...a);
27
+ export const browserBounds = (...a) => b().browserBounds(...a);
28
+ export const browserCapture = (...a) => b().browserCapture(...a);
29
+ export const browserCdp = (...a) => b().browserCdp(...a);
30
+ export const browserClear = (...a) => b().browserClear(...a);
31
+ export const browserClose = (...a) => b().browserClose(...a);
32
+ export const browserDefaultRegister = (...a) => b().browserDefaultRegister(...a);
33
+ export const browserDefaultStatus = (...a) => b().browserDefaultStatus(...a);
34
+ export const browserDevtools = (...a) => b().browserDevtools(...a);
35
+ export const browserDownload = (...a) => b().browserDownload(...a);
36
+ export const browserFind = (...a) => b().browserFind(...a);
37
+ export const browserHistoryCount = (...a) => b().browserHistoryCount(...a);
38
+ export const browserHistoryForgetRange = (...a) => b().browserHistoryForgetRange(...a);
39
+ export const browserHistoryForgetUrl = (...a) => b().browserHistoryForgetUrl(...a);
40
+ export const browserHistoryList = (...a) => b().browserHistoryList(...a);
41
+ export const browserHistoryRecent = (...a) => b().browserHistoryRecent(...a);
42
+ export const browserHistorySuggest = (...a) => b().browserHistorySuggest(...a);
43
+ export const browserHistoryVisit = (...a) => b().browserHistoryVisit(...a);
44
+ export const browserMute = (...a) => b().browserMute(...a);
45
+ export const browserNav = (...a) => b().browserNav(...a);
46
+ export const browserOpen = (...a) => b().browserOpen(...a);
47
+ export const browserPermissionSet = (...a) => b().browserPermissionSet(...a);
48
+ export const browserPermissions = (...a) => b().browserPermissions(...a);
49
+ export const browserPrivacy = (...a) => b().browserPrivacy(...a);
50
+ export const browserSetKeys = (...a) => b().browserSetKeys(...a);
51
+ export const browserSite = (...a) => b().browserSite(...a);
52
+ export const browserSiteClear = (...a) => b().browserSiteClear(...a);
53
+ export const browserZoom = (...a) => b().browserZoom(...a);
19
54
  export const claudePlanLimits = (...a) => b().claudePlanLimits(...a);
20
55
  export const claudeUsage = (...a) => b().claudeUsage(...a);
21
56
  export const clearWallpaper = (...a) => b().clearWallpaper(...a);
@@ -28,9 +63,18 @@ export const dbConnect = (...a) => b().dbConnect(...a);
28
63
  export const dbDisconnect = (...a) => b().dbDisconnect(...a);
29
64
  export const dbQuery = (...a) => b().dbQuery(...a);
30
65
  export const dbSchema = (...a) => b().dbSchema(...a);
66
+ export const deckReady = (...a) => b().deckReady(...a);
31
67
  export const deleteIconPack = (...a) => b().deleteIconPack(...a);
32
68
  export const dirsDownload = (...a) => b().dirsDownload(...a);
33
69
  export const exec = (...a) => b().exec(...a);
70
+ export const extensionInstallFolder = (...a) => b().extensionInstallFolder(...a);
71
+ export const extensionInstallStore = (...a) => b().extensionInstallStore(...a);
72
+ export const extensionPopup = (...a) => b().extensionPopup(...a);
73
+ export const extensionPopupClose = (...a) => b().extensionPopupClose(...a);
74
+ export const extensionReload = (...a) => b().extensionReload(...a);
75
+ export const extensionRemove = (...a) => b().extensionRemove(...a);
76
+ export const extensionSetEnabled = (...a) => b().extensionSetEnabled(...a);
77
+ export const extensionsList = (...a) => b().extensionsList(...a);
34
78
  export const footerOrder = (...a) => b().footerOrder(...a);
35
79
  export const fsCopy = (...a) => b().fsCopy(...a);
36
80
  export const fsCreateDir = (...a) => b().fsCreateDir(...a);
@@ -97,6 +141,7 @@ export const installFromRegistry = (...a) => b().installFromRegistry(...a);
97
141
  export const isFullscreen = (...a) => b().isFullscreen(...a);
98
142
  export const languagesDir = (...a) => b().languagesDir(...a);
99
143
  export const launchFiles = (...a) => b().launchFiles(...a);
144
+ export const launchUrls = (...a) => b().launchUrls(...a);
100
145
  export const listApps = (...a) => b().listApps(...a);
101
146
  export const listInstalled = (...a) => b().listInstalled(...a);
102
147
  export const logLatest = (...a) => b().logLatest(...a);
@@ -138,6 +183,26 @@ export const sshTunnelClose = (...a) => b().sshTunnelClose(...a);
138
183
  export const sshTunnelOpen = (...a) => b().sshTunnelOpen(...a);
139
184
  export const startupMarks = (...a) => b().startupMarks(...a);
140
185
  export const toggleFullscreen = (...a) => b().toggleFullscreen(...a);
186
+ export const vaultChangePassword = (...a) => b().vaultChangePassword(...a);
187
+ export const vaultConfig = (...a) => b().vaultConfig(...a);
188
+ export const vaultCreate = (...a) => b().vaultCreate(...a);
189
+ export const vaultDelete = (...a) => b().vaultDelete(...a);
190
+ export const vaultExport = (...a) => b().vaultExport(...a);
191
+ export const vaultFill = (...a) => b().vaultFill(...a);
192
+ export const vaultFillNew = (...a) => b().vaultFillNew(...a);
193
+ export const vaultGenerate = (...a) => b().vaultGenerate(...a);
194
+ export const vaultImport = (...a) => b().vaultImport(...a);
195
+ export const vaultList = (...a) => b().vaultList(...a);
196
+ export const vaultLock = (...a) => b().vaultLock(...a);
197
+ export const vaultMatches = (...a) => b().vaultMatches(...a);
198
+ export const vaultNeverList = (...a) => b().vaultNeverList(...a);
199
+ export const vaultNeverRemove = (...a) => b().vaultNeverRemove(...a);
200
+ export const vaultOfferAnswer = (...a) => b().vaultOfferAnswer(...a);
201
+ export const vaultSave = (...a) => b().vaultSave(...a);
202
+ export const vaultSecret = (...a) => b().vaultSecret(...a);
203
+ export const vaultStatus = (...a) => b().vaultStatus(...a);
204
+ export const vaultTotp = (...a) => b().vaultTotp(...a);
205
+ export const vaultUnlock = (...a) => b().vaultUnlock(...a);
141
206
  export const vpsRunsPull = (...a) => b().vpsRunsPull(...a);
142
207
  export const watchFiles = (...a) => b().watchFiles(...a);
143
208
 
package/shim/ui.d.ts CHANGED
@@ -6,6 +6,7 @@ export * from "../types/components/ConfirmDialog";
6
6
  export * from "../types/components/NamePrompt";
7
7
  export * from "../types/components/ContextMenu";
8
8
  export * from "../types/components/Toast";
9
+ export * from "../types/core/notifyapi";
9
10
  export * from "../types/components/useResize";
10
11
  export * from "../types/modules/editor/MarkdownLive";
11
12
  export * from "../types/components/TreeRow";
package/shim/ui.js CHANGED
@@ -10,13 +10,17 @@ const u = () => {
10
10
  };
11
11
 
12
12
  export const ActivityBar = (...a) => u().ActivityBar(...a);
13
+ export const Chip = (...a) => u().Chip(...a);
13
14
  export const ConfirmDialog = (...a) => u().ConfirmDialog(...a);
14
15
  export const ContextMenu = (...a) => u().ContextMenu(...a);
16
+ export const CountChip = (...a) => u().CountChip(...a);
15
17
  export const DayPicker = (...a) => u().DayPicker(...a);
18
+ export const EmptyState = (...a) => u().EmptyState(...a);
16
19
  export const Field = (...a) => u().Field(...a);
17
20
  export const FileIcon = (...a) => u().FileIcon(...a);
18
21
  export const FontViewer = (...a) => u().FontViewer(...a);
19
22
  export const GhostButton = (...a) => u().GhostButton(...a);
23
+ export const IconButton = (...a) => u().IconButton(...a);
20
24
  export const ImageViewer = (...a) => u().ImageViewer(...a);
21
25
  export const MarkdownLive = (...a) => u().MarkdownLive(...a);
22
26
  export const MarkdownToolbar = (...a) => u().MarkdownToolbar(...a);
@@ -50,6 +54,7 @@ export const cmSurface = (...a) => u().cmSurface(...a);
50
54
  export const collectFiles = (...a) => u().collectFiles(...a);
51
55
  export const conflict = (...a) => u().conflict(...a);
52
56
  export const decodeText = (...a) => u().decodeText(...a);
57
+ export const dismissNotification = (...a) => u().dismissNotification(...a);
53
58
  export const dispatch = (...a) => u().dispatch(...a);
54
59
  export const forLanguage = (...a) => u().forLanguage(...a);
55
60
  export const formatChord = (...a) => u().formatChord(...a);
@@ -60,6 +65,7 @@ export const mediaKind = (...a) => u().mediaKind(...a);
60
65
  export const modelOptionsFor = (...a) => u().modelOptionsFor(...a);
61
66
  export const monacoOptionsFrom = (...a) => u().monacoOptionsFrom(...a);
62
67
  export const normalizeChord = (...a) => u().normalizeChord(...a);
68
+ export const notify = (...a) => u().notify(...a);
63
69
  export const onKey = (...a) => u().onKey(...a);
64
70
  export const onKeys = (...a) => u().onKeys(...a);
65
71
  export const parseChord = (...a) => u().parseChord(...a);
@@ -75,6 +81,7 @@ export const subscribeEditorSettings = (...a) => u().subscribeEditorSettings(...
75
81
  export const themeById = (...a) => u().themeById(...a);
76
82
  export const toMonaco = (...a) => u().toMonaco(...a);
77
83
  export const toast = (...a) => u().toast(...a);
84
+ export const tone = (...a) => u().tone(...a);
78
85
  export const updateEditorSettings = (...a) => u().updateEditorSettings(...a);
79
86
  export const useEditorSettings = (...a) => u().useEditorSettings(...a);
80
87
  export const useIconThemesVersion = (...a) => u().useIconThemesVersion(...a);
@@ -5,5 +5,5 @@
5
5
  "icon": "Sparkles",
6
6
  "color": "#a78bfa",
7
7
  "version": "0.1.0",
8
- "minDeck": "1.5.0"
8
+ "minDeck": "1.6.1"
9
9
  }
@@ -11,10 +11,12 @@ export interface ActivityView<Id extends string> {
11
11
  onClick?: (el: HTMLElement) => void;
12
12
  }
13
13
  export default ActivityBar;
14
- export declare function ActivityBar<Id extends string>({ views, active, onSelect, trailing, }: {
14
+ export declare function ActivityBar<Id extends string>({ views, active, onSelect, trailing, grouped, }: {
15
15
  views: readonly ActivityView<Id>[];
16
16
  active: Id;
17
17
  onSelect: (id: Id) => void;
18
18
  /** Fixed controls pinned to the right — present for every view, or the icons shift. */
19
19
  trailing?: React.ReactNode;
20
+ /** The icons together in one rounded group, smaller, rather than loose pills. */
21
+ grouped?: boolean;
20
22
  }): import("react").JSX.Element;
@@ -26,6 +26,9 @@ export interface MenuItem {
26
26
  /** A setting rather than an action: renders a checkbox and does NOT close the menu, so several
27
27
  * can be flipped in one visit. The caller re-renders with the new value. */
28
28
  checked?: boolean;
29
+ /** Controls of its own at the row's right (a zoom's − and +, a slider): the row is not
30
+ * clicked itself, and using them leaves the menu open. */
31
+ controls?: React.ReactNode;
29
32
  }
30
33
  export type MenuEntry = MenuItem | "sep";
31
34
  export declare function ContextMenu({ x, y, items, alignRight, onClose, onReorder, flipAt, up }: {
@@ -12,7 +12,7 @@ export interface TabItem {
12
12
  /** Tooltip for the close button; defaults to "Close". */
13
13
  closeTitle?: string;
14
14
  }
15
- export declare function TabStrip({ tabs, activeId, onSelect, onClose, onReorder, onDoubleClick, trailing, pill, onAdd, addTitle, }: {
15
+ export declare function TabStrip({ tabs, activeId, onSelect, onClose, onReorder, onDoubleClick, leading, trailing, pill: pillProp, chip, onAdd, addTitle, }: {
16
16
  tabs: readonly TabItem[];
17
17
  activeId: string | null;
18
18
  onSelect: (id: string) => void;
@@ -20,11 +20,16 @@ export declare function TabStrip({ tabs, activeId, onSelect, onClose, onReorder,
20
20
  /** Moves `from` to `to`'s position. Omit to make the strip non-reorderable. */
21
21
  onReorder?: (from: string, to: string) => void;
22
22
  onDoubleClick?: (id: string) => void;
23
+ /** Controls before the first tab. */
24
+ leading?: ReactNode;
23
25
  /** Right-aligned controls after the tabs — view toggles, save state. */
24
26
  trailing?: ReactNode;
25
27
  /** Rounded tabs with the active one lit in the accent, the look of the workspace tabs in the
26
28
  * title bar, instead of the editor-style boxed row. */
27
29
  pill?: boolean;
30
+ /** Rounded like `pill`, with the open tab raised on the card colour rather than lit in the
31
+ * accent: the editor's tabs, where the accent already marks the open file in the tree. */
32
+ chip?: boolean;
28
33
  /** A + right after the last tab, as the workspace tabs have. */
29
34
  onAdd?: () => void;
30
35
  addTitle?: string;
@@ -58,10 +58,14 @@ export declare function DayPicker({ value, onChange, }: {
58
58
  onChange: (days: string[]) => void;
59
59
  }): import("react").JSX.Element;
60
60
  /** One readout in the footer strip: an icon, a short label, and an optional click. */
61
- export declare function StatusItem({ icon, color, label, title, onClick, }: {
61
+ export declare function StatusItem({ icon, color, label, detail, meter, title, onClick, }: {
62
62
  icon: React.ReactNode;
63
63
  color: string;
64
64
  label: string;
65
+ /** A second, quieter part after the label: a branch, a commit. */
66
+ detail?: string;
67
+ /** 0 to 100: a small bar before the label, in the item's colour (a limit's use). */
68
+ meter?: number;
65
69
  title?: string;
66
70
  onClick?: () => void;
67
71
  }): import("react").JSX.Element;
@@ -100,3 +104,46 @@ export declare function Toggle({ on, onChange }: {
100
104
  on: boolean;
101
105
  onChange: (v: boolean) => void;
102
106
  }): import("react").JSX.Element;
107
+ /** A state in its colour: Ready, Running, Paused, Failed. `color` is any CSS colour; a `--tone-*`
108
+ * one (`tone("green")`) follows a light theme. */
109
+ export declare function Chip({ color, title, children }: {
110
+ color: string;
111
+ title?: string;
112
+ children: ReactNode;
113
+ }): import("react").JSX.Element;
114
+ /** A `--tone-*` colour as CSS, for a Chip, a dot or text: `tone("amber")`. */
115
+ export declare function tone(name: "red" | "emerald" | "amber" | "blue" | "green" | "cyan" | "sky" | "violet" | "pink" | "orange", shade?: 300 | 400): string;
116
+ /** How many, after a heading or a row. */
117
+ export declare function CountChip({ n, title }: {
118
+ n: number;
119
+ title?: string;
120
+ }): import("react").JSX.Element;
121
+ /**
122
+ * What a space is for and the way in, when it has nothing to show: a sentence and, usually, a
123
+ * button. `card` puts it in a quiet card, for when it is the only thing on screen.
124
+ */
125
+ export declare function EmptyState({ icon, title, children, action, card }: {
126
+ icon?: ReactNode;
127
+ /** A short line above the sentence, when the space needs naming. */
128
+ title?: string;
129
+ children: ReactNode;
130
+ action?: {
131
+ label: string;
132
+ onClick: () => void;
133
+ };
134
+ card?: boolean;
135
+ }): import("react").JSX.Element;
136
+ /**
137
+ * An icon-only button. `toolbar` (size-7) for a panel's own actions, `row` (size-5) for one inside
138
+ * a list row, shown on the row's hover by the caller. `danger` turns it red on hover only; `active`
139
+ * marks a toggle that is on. `title` is required: it is the only label the button has.
140
+ */
141
+ export declare function IconButton({ title, onClick, children, size, danger, active, disabled }: {
142
+ title: string;
143
+ onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
144
+ children: ReactNode;
145
+ size?: "toolbar" | "row";
146
+ danger?: boolean;
147
+ active?: boolean;
148
+ disabled?: boolean;
149
+ }): import("react").JSX.Element;
@@ -19,7 +19,7 @@ export declare function useNarrow(px: number): [boolean, (el: HTMLElement | null
19
19
  * Listeners go on `window`, not the divider, so a fast drag that outruns the pointer keeps
20
20
  * resizing instead of stopping the moment the cursor leaves the 4px handle.
21
21
  */
22
- export declare function useResize({ initial, min, max, direction, invert, }: {
22
+ export declare function useResize({ initial, min, max, direction, invert, collapseBelow, onCollapse, }: {
23
23
  initial: number;
24
24
  min: number;
25
25
  max: number;
@@ -31,6 +31,13 @@ export declare function useResize({ initial, min, max, direction, invert, }: {
31
31
  * would grow a pane that is actually being squeezed from above.
32
32
  */
33
33
  invert?: boolean;
34
+ /**
35
+ * Dragged this far down (below `min`), the drag ends and `onCollapse` runs: the pane snaps shut
36
+ * rather than stopping at its minimum. Its size goes back to what it was when the drag began, so
37
+ * opening it again gives the width it had.
38
+ */
39
+ collapseBelow?: number;
40
+ onCollapse?: () => void;
34
41
  }): readonly [number, {
35
42
  readonly onMouseDown: (e: React.MouseEvent) => void;
36
43
  }, boolean];
@@ -0,0 +1,79 @@
1
+ // GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
2
+ export interface BookmarkNode {
3
+ id: string;
4
+ title: string;
5
+ /** A page has a URL; a folder has children instead. */
6
+ url?: string;
7
+ children?: BookmarkNode[];
8
+ }
9
+ export interface Bookmarks {
10
+ bar: BookmarkNode[];
11
+ other: BookmarkNode[];
12
+ }
13
+ export declare const EMPTY: Bookmarks;
14
+ export declare const isFolder: (n: BookmarkNode) => boolean;
15
+ /** An id unique within this run and across runs: time, then a counter. */
16
+ export declare const newId: () => string;
17
+ /** Every page in the tree, depth first, with the folder titles above it. */
18
+ export declare function pages(b: Bookmarks): {
19
+ node: BookmarkNode;
20
+ path: string[];
21
+ }[];
22
+ /** The bookmark for `url`, if there is one (the first, when it was saved twice). */
23
+ export declare const findByUrl: (b: Bookmarks, url: string) => BookmarkNode | undefined;
24
+ /** Every folder, for a "save in" list: the two roots first, then each folder by its path. */
25
+ export declare function folders(b: Bookmarks): {
26
+ id: string;
27
+ path: string;
28
+ }[];
29
+ /** Add `node` at the end of `folder`. */
30
+ export declare const add: (b: Bookmarks, folder: string, node: BookmarkNode) => Bookmarks;
31
+ /** Remove the node with `id`, wherever it is (a folder goes with what is in it). */
32
+ export declare function remove(b: Bookmarks, id: string): Bookmarks;
33
+ /** Change a node's title or URL. */
34
+ export declare function update(b: Bookmarks, id: string, patch: Partial<Pick<BookmarkNode, "title" | "url">>): Bookmarks;
35
+ /** The node with `id`, and the id of the folder it is in. */
36
+ export declare function locate(b: Bookmarks, id: string): {
37
+ node: BookmarkNode;
38
+ folder: string;
39
+ } | null;
40
+ /** Move a node to the end of another folder. A folder cannot go inside itself. */
41
+ export declare function move(b: Bookmarks, id: string, folder: string): Bookmarks;
42
+ /**
43
+ * A Chromium browser's Bookmarks file (Chrome, Edge, Brave all keep the same JSON) as Deck's
44
+ * nodes: its bar, its other bookmarks, and on Chrome its mobile ones, each as given. Anything that
45
+ * is not a page or a folder (a separator, an app link) is left out.
46
+ */
47
+ export declare function fromChrome(json: string): {
48
+ bar: BookmarkNode[];
49
+ other: BookmarkNode[];
50
+ };
51
+ /** An import, as one folder in each root named after where it came from ("From Chrome"), left out
52
+ * of a root it has nothing for. */
53
+ export declare function addImport(b: Bookmarks, from: string, got: {
54
+ bar: BookmarkNode[];
55
+ other: BookmarkNode[];
56
+ }): Bookmarks;
57
+ /** How many pages a set of nodes holds. */
58
+ export declare const countPages: (ns: readonly BookmarkNode[]) => number;
59
+ /** Deck's bookmarks as a bookmarks HTML file. */
60
+ export declare function toHtml(b: Bookmarks): string;
61
+ /** A bookmarks HTML file as Deck's two roots. Read by its tags, not as a page: folders (H3) open
62
+ * the list (DL) that follows them, pages are links (A HREF). */
63
+ export declare function fromHtml(html: string): {
64
+ bar: BookmarkNode[];
65
+ other: BookmarkNode[];
66
+ };
67
+ /**
68
+ * An import merged in: a folder joins the folder of the same name where it lands (made if there
69
+ * is none), and a page already bookmarked anywhere is left out. So a file exported from Deck
70
+ * restores into the same places, and importing one twice adds nothing the second time.
71
+ * Returns the bookmarks and how many pages were added.
72
+ */
73
+ export declare function mergeImport(b: Bookmarks, got: {
74
+ bar: BookmarkNode[];
75
+ other: BookmarkNode[];
76
+ }): {
77
+ bookmarks: Bookmarks;
78
+ added: number;
79
+ };