deck-plugin-sdk 0.21.0 → 1.1.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/build-plugin.mjs +150 -143
- package/package.json +1 -1
- package/shim/bridge.js +13 -12
- package/shim/react-dom.js +19 -0
- package/shim/ui.d.ts +10 -0
- package/shim/ui.js +47 -0
- package/types/components/ActivityBar.d.ts +20 -0
- package/types/components/FileIcon.d.ts +7 -0
- package/types/components/TabStrip.d.ts +7 -1
- package/types/components/useResize.d.ts +12 -0
- package/types/core/bridge.d.ts +55 -77
- package/types/core/dap.d.ts +181 -0
- package/types/core/decode.d.ts +13 -0
- package/types/core/icontheme.d.ts +28 -0
- package/types/core/inlay.d.ts +37 -0
- package/types/core/keys.d.ts +1 -1
- package/types/core/keystore.d.ts +16 -2
- package/types/core/lsp.d.ts +190 -0
- package/types/core/patterntokens.d.ts +24 -0
- package/types/core/remotepath.d.ts +17 -0
- package/types/core/settingsstore.d.ts +0 -3
- package/types/core/snippets.d.ts +15 -0
- package/types/core/timeFormat.d.ts +12 -0
- package/types/modules/editor/MonacoHosts.d.ts +80 -0
- package/types/modules/editor/annotations.d.ts +2 -0
- package/types/modules/editor/diffline.d.ts +13 -0
- package/types/modules/editor/editorstatus.d.ts +16 -0
- package/types/modules/editor/models.d.ts +8 -0
- package/types/modules/editor/tree.d.ts +59 -0
- package/types/modules/editor/viewers.d.ts +41 -0
package/build-plugin.mjs
CHANGED
|
@@ -1,143 +1,150 @@
|
|
|
1
|
-
// Build a Deck plugin: TSX sources -> one plugin.js Deck can import.
|
|
2
|
-
//
|
|
3
|
-
// The same build Deck's own plugins get, with one difference: the shim is shipped with this
|
|
4
|
-
// package rather than generated, because generating it needs Deck's TypeScript sources and the
|
|
5
|
-
// point of this package is that you do not have them.
|
|
6
|
-
//
|
|
7
|
-
// Why a plugin wants a build step at all: JSX, and ordinary imports across as many files as you
|
|
8
|
-
// like. It is not rebuilding Deck — it is what a VS Code extension does.
|
|
9
|
-
//
|
|
10
|
-
// The shim is the whole trick. Deck hands React, its bridge, `listen`, its icons and its
|
|
11
|
-
// animation library over on `window.__deck`, and esbuild resolves those module names to files
|
|
12
|
-
// that read from there. So your sources import "react" as normal code does, and at run time get
|
|
13
|
-
// DECK'S React — which is not an optimisation but a requirement, since two Reacts in one tree
|
|
14
|
-
// break hooks.
|
|
15
|
-
import { build } from "esbuild";
|
|
16
|
-
import { cpSync, existsSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
17
|
-
import { createRequire } from "node:module";
|
|
18
|
-
import { dirname, join } from "node:path";
|
|
19
|
-
import { fileURLToPath } from "node:url";
|
|
20
|
-
|
|
21
|
-
const sdk = dirname(fileURLToPath(import.meta.url));
|
|
22
|
-
const require = createRequire(import.meta.url);
|
|
23
|
-
|
|
24
|
-
/** The module names a plugin may import, and the shipped file each resolves to. */
|
|
25
|
-
function shimMap(shimDir) {
|
|
26
|
-
return {
|
|
27
|
-
react: join(shimDir, "react.js"),
|
|
28
|
-
"deckreact/jsx-runtime": join(shimDir, "jsx-runtime.js"),
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
*
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
//
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
//
|
|
111
|
-
|
|
112
|
-
// A
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
//
|
|
116
|
-
//
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
1
|
+
// Build a Deck plugin: TSX sources -> one plugin.js Deck can import.
|
|
2
|
+
//
|
|
3
|
+
// The same build Deck's own plugins get, with one difference: the shim is shipped with this
|
|
4
|
+
// package rather than generated, because generating it needs Deck's TypeScript sources and the
|
|
5
|
+
// point of this package is that you do not have them.
|
|
6
|
+
//
|
|
7
|
+
// Why a plugin wants a build step at all: JSX, and ordinary imports across as many files as you
|
|
8
|
+
// like. It is not rebuilding Deck — it is what a VS Code extension does.
|
|
9
|
+
//
|
|
10
|
+
// The shim is the whole trick. Deck hands React, its bridge, `listen`, its icons and its
|
|
11
|
+
// animation library over on `window.__deck`, and esbuild resolves those module names to files
|
|
12
|
+
// that read from there. So your sources import "react" as normal code does, and at run time get
|
|
13
|
+
// DECK'S React — which is not an optimisation but a requirement, since two Reacts in one tree
|
|
14
|
+
// break hooks.
|
|
15
|
+
import { build } from "esbuild";
|
|
16
|
+
import { cpSync, existsSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
17
|
+
import { createRequire } from "node:module";
|
|
18
|
+
import { dirname, join } from "node:path";
|
|
19
|
+
import { fileURLToPath } from "node:url";
|
|
20
|
+
|
|
21
|
+
const sdk = dirname(fileURLToPath(import.meta.url));
|
|
22
|
+
const require = createRequire(import.meta.url);
|
|
23
|
+
|
|
24
|
+
/** The module names a plugin may import, and the shipped file each resolves to. */
|
|
25
|
+
function shimMap(shimDir) {
|
|
26
|
+
return {
|
|
27
|
+
react: join(shimDir, "react.js"),
|
|
28
|
+
"deckreact/jsx-runtime": join(shimDir, "jsx-runtime.js"),
|
|
29
|
+
// A library compiled with the automatic runtime imports it under its real name.
|
|
30
|
+
"react/jsx-runtime": join(shimDir, "jsx-runtime.js"),
|
|
31
|
+
// Deck's react-dom (needs Deck 1.1); only bundled when a plugin or its library imports it.
|
|
32
|
+
"react-dom": join(shimDir, "react-dom.js"),
|
|
33
|
+
"@tauri-apps/api/event": join(shimDir, "event.js"),
|
|
34
|
+
"lucide-react": join(shimDir, "icons.js"),
|
|
35
|
+
"framer-motion": join(shimDir, "motion.js"),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Build the plugin in `dir`.
|
|
41
|
+
*
|
|
42
|
+
* The shim is copied in rather than imported from node_modules, because a plugin's sources refer
|
|
43
|
+
* to it by relative path (`../shim/bridge.js`) and that has to resolve on disk. Copied on every
|
|
44
|
+
* build so updating the SDK updates the shim, which is the behaviour someone upgrading expects.
|
|
45
|
+
*/
|
|
46
|
+
export async function buildPlugin(dir, { entry = "plugin.tsx" } = {}) {
|
|
47
|
+
const manifestPath = join(dir, "plugin.json");
|
|
48
|
+
if (!existsSync(manifestPath)) {
|
|
49
|
+
throw new Error(`no plugin.json in ${dir}`);
|
|
50
|
+
}
|
|
51
|
+
const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
|
|
52
|
+
|
|
53
|
+
const shimDir = join(dir, "shim");
|
|
54
|
+
rmSync(shimDir, { recursive: true, force: true });
|
|
55
|
+
cpSync(join(sdk, "shim"), shimDir, { recursive: true });
|
|
56
|
+
// The declarations the shim's .d.ts files point at, as ../types/. Copied beside it for the
|
|
57
|
+
// same reason: a relative reference has to find something.
|
|
58
|
+
const typesDir = join(dir, "types");
|
|
59
|
+
rmSync(typesDir, { recursive: true, force: true });
|
|
60
|
+
cpSync(join(sdk, "types"), typesDir, { recursive: true });
|
|
61
|
+
|
|
62
|
+
// ---- icons and animation, generated per plugin ----
|
|
63
|
+
//
|
|
64
|
+
// These two cannot be shipped pre-generated like the rest of the shim. They name only the
|
|
65
|
+
// exports THIS plugin imports, on purpose: re-exporting the whole package goes through a
|
|
66
|
+
// module esbuild cannot see into, which defeats tree-shaking — doing that with lucide took a
|
|
67
|
+
// bundle from 403kb to 640kb, larger than just bundling it.
|
|
68
|
+
//
|
|
69
|
+
// Nothing about this needs Deck's source, only the plugin's own and the real package, so it
|
|
70
|
+
// runs here the same way it runs inside the Deck repository.
|
|
71
|
+
const sources = readdirSync(join(dir, "src"), { recursive: true })
|
|
72
|
+
.filter((f) => typeof f === "string" && /\.tsx?$/.test(f))
|
|
73
|
+
.map((f) => readFileSync(join(dir, "src", f), "utf8"));
|
|
74
|
+
|
|
75
|
+
for (const [pkg, file, global] of [
|
|
76
|
+
["lucide-react", "icons.js", "icons"],
|
|
77
|
+
["framer-motion", "motion.js", "motion"],
|
|
78
|
+
]) {
|
|
79
|
+
const re = new RegExp(String.raw`import\s*\{([^}]*)\}\s*from\s*"${pkg}"`, "g");
|
|
80
|
+
const names = [...new Set(sources.flatMap((src) => [...src.matchAll(re)]
|
|
81
|
+
.flatMap((m) => m[1].split(",").map((n) => n.trim().split(/\s+as\s+/)[0]).filter(Boolean))))].sort();
|
|
82
|
+
|
|
83
|
+
// Checked against the real package, so a typo fails here rather than as a blank icon at run
|
|
84
|
+
// time. Only loaded when something is actually imported from it, since framer-motion is an
|
|
85
|
+
// optional peer dependency.
|
|
86
|
+
if (names.length) {
|
|
87
|
+
let real;
|
|
88
|
+
try { real = require(pkg); }
|
|
89
|
+
catch { throw new Error(`this plugin imports from "${pkg}" — run: npm i ${pkg}`); }
|
|
90
|
+
for (const n of names) if (!(n in real)) throw new Error(`${pkg} has no export "${n}"`);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
writeFileSync(join(shimDir, file), `// GENERATED by the Deck plugin build — do not edit.
|
|
94
|
+
//
|
|
95
|
+
// Deck's ${pkg}, so this plugin does not bundle its own copy. Only the names this plugin
|
|
96
|
+
// imports: naming every export would defeat tree-shaking and make the bundle larger.
|
|
97
|
+
const __src = window.__deck.${global};
|
|
98
|
+
${names.map((n) => `export const ${n} = __src.${n};`).join("\n")}
|
|
99
|
+
`);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const shims = shimMap(shimDir);
|
|
103
|
+
|
|
104
|
+
await build({
|
|
105
|
+
entryPoints: [join(dir, "src", entry)],
|
|
106
|
+
outfile: join(dir, "plugin.js"),
|
|
107
|
+
bundle: true,
|
|
108
|
+
format: "esm",
|
|
109
|
+
target: "es2022",
|
|
110
|
+
// Nobody reads a plugin bundle; it is loaded by one import() at startup.
|
|
111
|
+
minify: true,
|
|
112
|
+
// A package that ships separate builds picks the production one.
|
|
113
|
+
conditions: ["production"],
|
|
114
|
+
jsx: "automatic",
|
|
115
|
+
// React comes from Deck, so the automatic runtime must import from the shim rather than a
|
|
116
|
+
// "react/jsx-runtime" that does not exist here.
|
|
117
|
+
jsxImportSource: "deckreact",
|
|
118
|
+
// A .wasm import becomes a Uint8Array inlined in the bundle rather than a sidecar file. A
|
|
119
|
+
// plugin is installed as plugin.json + plugin.js, so a file beside them would never arrive.
|
|
120
|
+
// A .css import becomes its text, for the plugin to inject as a <style>, for the same reason.
|
|
121
|
+
loader: { ".wasm": "binary", ".css": "text" },
|
|
122
|
+
// A resolve plugin rather than esbuild's `alias`, which maps package to package while these
|
|
123
|
+
// point at single files.
|
|
124
|
+
plugins: [{
|
|
125
|
+
name: "deck-runtime",
|
|
126
|
+
setup(b) {
|
|
127
|
+
const filter = new RegExp(`^(${Object.keys(shims)
|
|
128
|
+
.map((k) => k.replace(/[/\\^$*+?.()|[\]{}]/g, "\\$&")).join("|")})$`);
|
|
129
|
+
b.onResolve({ filter }, (a) => ({ path: shims[a.path] }));
|
|
130
|
+
},
|
|
131
|
+
}],
|
|
132
|
+
logLevel: "info",
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
// Optional: only a plugin that brings agent-facing tools has one. Built for node, because the
|
|
136
|
+
// MCP server runs outside the webview.
|
|
137
|
+
if (existsSync(join(dir, "src", "mcp.ts"))) {
|
|
138
|
+
await build({
|
|
139
|
+
entryPoints: [join(dir, "src", "mcp.ts")],
|
|
140
|
+
outfile: join(dir, "mcp.js"),
|
|
141
|
+
platform: "node",
|
|
142
|
+
format: "esm",
|
|
143
|
+
target: "node18",
|
|
144
|
+
bundle: true,
|
|
145
|
+
logLevel: "info",
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return manifest;
|
|
150
|
+
}
|
package/package.json
CHANGED
package/shim/bridge.js
CHANGED
|
@@ -9,9 +9,10 @@ const b = () => {
|
|
|
9
9
|
return x;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
export const
|
|
13
|
-
export const
|
|
14
|
-
export const
|
|
12
|
+
export const askSudoPassword = (...a) => b().askSudoPassword(...a);
|
|
13
|
+
export const backupExport = (...a) => b().backupExport(...a);
|
|
14
|
+
export const backupInspect = (...a) => b().backupInspect(...a);
|
|
15
|
+
export const backupRestore = (...a) => b().backupRestore(...a);
|
|
15
16
|
export const claudeMcpEntry = (...a) => b().claudeMcpEntry(...a);
|
|
16
17
|
export const claudeMcpStatus = (...a) => b().claudeMcpStatus(...a);
|
|
17
18
|
export const claudePlanLimits = (...a) => b().claudePlanLimits(...a);
|
|
@@ -130,21 +131,20 @@ export const googleSignOut = (...a) => b().googleSignOut(...a);
|
|
|
130
131
|
export const googleToken = (...a) => b().googleToken(...a);
|
|
131
132
|
export const historyClear = (...a) => b().historyClear(...a);
|
|
132
133
|
export const historyDelete = (...a) => b().historyDelete(...a);
|
|
134
|
+
export const httpCancel = (...a) => b().httpCancel(...a);
|
|
133
135
|
export const httpSend = (...a) => b().httpSend(...a);
|
|
136
|
+
export const httpSendAs = (...a) => b().httpSendAs(...a);
|
|
137
|
+
export const httpSendReply = (...a) => b().httpSendReply(...a);
|
|
134
138
|
export const importIconPack = (...a) => b().importIconPack(...a);
|
|
135
139
|
export const installClaudeHooks = (...a) => b().installClaudeHooks(...a);
|
|
136
140
|
export const installClaudeMcp = (...a) => b().installClaudeMcp(...a);
|
|
137
141
|
export const installFromRegistry = (...a) => b().installFromRegistry(...a);
|
|
138
142
|
export const installPlugin = (...a) => b().installPlugin(...a);
|
|
139
143
|
export const isFullscreen = (...a) => b().isFullscreen(...a);
|
|
140
|
-
export const jiraCached = (...a) => b().jiraCached(...a);
|
|
141
|
-
export const jiraRefresh = (...a) => b().jiraRefresh(...a);
|
|
142
144
|
export const languagesDir = (...a) => b().languagesDir(...a);
|
|
143
145
|
export const launchFiles = (...a) => b().launchFiles(...a);
|
|
144
146
|
export const listApps = (...a) => b().listApps(...a);
|
|
145
147
|
export const listInstalled = (...a) => b().listInstalled(...a);
|
|
146
|
-
export const mailCached = (...a) => b().mailCached(...a);
|
|
147
|
-
export const mailRefresh = (...a) => b().mailRefresh(...a);
|
|
148
148
|
export const mediaMeta = (...a) => b().mediaMeta(...a);
|
|
149
149
|
export const mediaSetNowPlaying = (...a) => b().mediaSetNowPlaying(...a);
|
|
150
150
|
export const mediaSetPlayback = (...a) => b().mediaSetPlayback(...a);
|
|
@@ -178,6 +178,9 @@ export const readMusicSuggestions = (...a) => b().readMusicSuggestions(...a);
|
|
|
178
178
|
export const readMusicTaste = (...a) => b().readMusicTaste(...a);
|
|
179
179
|
export const readTermLayout = (...a) => b().readTermLayout(...a);
|
|
180
180
|
export const readTrackMeta = (...a) => b().readTrackMeta(...a);
|
|
181
|
+
export const remoteHome = (...a) => b().remoteHome(...a);
|
|
182
|
+
export const remoteStat = (...a) => b().remoteStat(...a);
|
|
183
|
+
export const remoteSudoPassword = (...a) => b().remoteSudoPassword(...a);
|
|
181
184
|
export const removeClaudeHooks = (...a) => b().removeClaudeHooks(...a);
|
|
182
185
|
export const removeClaudeMcp = (...a) => b().removeClaudeMcp(...a);
|
|
183
186
|
export const removeLanguage = (...a) => b().removeLanguage(...a);
|
|
@@ -189,21 +192,19 @@ export const setAutostart = (...a) => b().setAutostart(...a);
|
|
|
189
192
|
export const setDebugTargets = (...a) => b().setDebugTargets(...a);
|
|
190
193
|
export const setVaultRoot = (...a) => b().setVaultRoot(...a);
|
|
191
194
|
export const setWallpaper = (...a) => b().setWallpaper(...a);
|
|
192
|
-
export const
|
|
193
|
-
export const slackCached = (...a) => b().slackCached(...a);
|
|
194
|
-
export const slackRefresh = (...a) => b().slackRefresh(...a);
|
|
195
|
-
export const speakWithVoice = (...a) => b().speakWithVoice(...a);
|
|
195
|
+
export const sshHosts = (...a) => b().sshHosts(...a);
|
|
196
196
|
export const sshTunnelClose = (...a) => b().sshTunnelClose(...a);
|
|
197
197
|
export const sshTunnelList = (...a) => b().sshTunnelList(...a);
|
|
198
198
|
export const sshTunnelOpen = (...a) => b().sshTunnelOpen(...a);
|
|
199
|
+
export const startupMarks = (...a) => b().startupMarks(...a);
|
|
199
200
|
export const startupRead = (...a) => b().startupRead(...a);
|
|
200
201
|
export const startupWrite = (...a) => b().startupWrite(...a);
|
|
201
|
-
export const stopSpeaking = (...a) => b().stopSpeaking(...a);
|
|
202
202
|
export const toggleFullscreen = (...a) => b().toggleFullscreen(...a);
|
|
203
203
|
export const vaultDataRead = (...a) => b().vaultDataRead(...a);
|
|
204
204
|
export const vaultDataWrite = (...a) => b().vaultDataWrite(...a);
|
|
205
205
|
export const vaultRelativize = (...a) => b().vaultRelativize(...a);
|
|
206
206
|
export const vaultResolve = (...a) => b().vaultResolve(...a);
|
|
207
|
+
export const vpsRunsPull = (...a) => b().vpsRunsPull(...a);
|
|
207
208
|
export const watchFiles = (...a) => b().watchFiles(...a);
|
|
208
209
|
export const writeDownloads = (...a) => b().writeDownloads(...a);
|
|
209
210
|
export const writeLibrary = (...a) => b().writeLibrary(...a);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// GENERATED by sdk/gen-shim.mjs — do not edit.
|
|
2
|
+
//
|
|
3
|
+
// Deck's react-dom, not a second copy.
|
|
4
|
+
const ReactDOM = window.__deck.ReactDOM;
|
|
5
|
+
export default ReactDOM;
|
|
6
|
+
export const __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
7
|
+
export const createPortal = ReactDOM.createPortal;
|
|
8
|
+
export const flushSync = ReactDOM.flushSync;
|
|
9
|
+
export const preconnect = ReactDOM.preconnect;
|
|
10
|
+
export const prefetchDNS = ReactDOM.prefetchDNS;
|
|
11
|
+
export const preinit = ReactDOM.preinit;
|
|
12
|
+
export const preinitModule = ReactDOM.preinitModule;
|
|
13
|
+
export const preload = ReactDOM.preload;
|
|
14
|
+
export const preloadModule = ReactDOM.preloadModule;
|
|
15
|
+
export const requestFormReset = ReactDOM.requestFormReset;
|
|
16
|
+
export const unstable_batchedUpdates = ReactDOM.unstable_batchedUpdates;
|
|
17
|
+
export const useFormState = ReactDOM.useFormState;
|
|
18
|
+
export const useFormStatus = ReactDOM.useFormStatus;
|
|
19
|
+
export const version = ReactDOM.version;
|
package/shim/ui.d.ts
CHANGED
|
@@ -12,3 +12,13 @@ export * from "../types/components/TreeRow";
|
|
|
12
12
|
export * from "../types/components/dragrow";
|
|
13
13
|
export * from "../types/components/TabStrip";
|
|
14
14
|
export * from "../types/components/MarkdownToolbar";
|
|
15
|
+
export * from "../types/components/ActivityBar";
|
|
16
|
+
export * from "../types/core/editorsettings";
|
|
17
|
+
export * from "../types/core/keystore";
|
|
18
|
+
export * from "../types/modules/editor/viewers";
|
|
19
|
+
export * from "../types/components/FileIcon";
|
|
20
|
+
export * from "../types/core/icontheme";
|
|
21
|
+
export * from "../types/modules/editor/tree";
|
|
22
|
+
export * from "../types/core/decode";
|
|
23
|
+
export * from "../types/core/keys";
|
|
24
|
+
export * from "../types/modules/editor/MonacoHosts";
|
package/shim/ui.js
CHANGED
|
@@ -9,13 +9,21 @@ const u = () => {
|
|
|
9
9
|
return x;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
+
export const ActivityBar = (...a) => u().ActivityBar(...a);
|
|
12
13
|
export const ConfirmDialog = (...a) => u().ConfirmDialog(...a);
|
|
13
14
|
export const ContextMenu = (...a) => u().ContextMenu(...a);
|
|
14
15
|
export const DayPicker = (...a) => u().DayPicker(...a);
|
|
15
16
|
export const Field = (...a) => u().Field(...a);
|
|
17
|
+
export const FileIcon = (...a) => u().FileIcon(...a);
|
|
18
|
+
export const FontViewer = (...a) => u().FontViewer(...a);
|
|
16
19
|
export const GhostButton = (...a) => u().GhostButton(...a);
|
|
20
|
+
export const ImageViewer = (...a) => u().ImageViewer(...a);
|
|
17
21
|
export const MarkdownLive = (...a) => u().MarkdownLive(...a);
|
|
18
22
|
export const MarkdownToolbar = (...a) => u().MarkdownToolbar(...a);
|
|
23
|
+
export const MediaDiff = (...a) => u().MediaDiff(...a);
|
|
24
|
+
export const MediaViewer = (...a) => u().MediaViewer(...a);
|
|
25
|
+
export const MonacoDiff = (...a) => u().MonacoDiff(...a);
|
|
26
|
+
export const MonacoViewer = (...a) => u().MonacoViewer(...a);
|
|
19
27
|
export const NamePrompt = (...a) => u().NamePrompt(...a);
|
|
20
28
|
export const PanelHead = (...a) => u().PanelHead(...a);
|
|
21
29
|
export const PrimaryButton = (...a) => u().PrimaryButton(...a);
|
|
@@ -30,8 +38,47 @@ export const TextInput = (...a) => u().TextInput(...a);
|
|
|
30
38
|
export const TimeInput = (...a) => u().TimeInput(...a);
|
|
31
39
|
export const Toggle = (...a) => u().Toggle(...a);
|
|
32
40
|
export const TreeRow = (...a) => u().TreeRow(...a);
|
|
41
|
+
export const activeScopes = (...a) => u().activeScopes(...a);
|
|
42
|
+
export const allBindings = (...a) => u().allBindings(...a);
|
|
43
|
+
export const allThemes = (...a) => u().allThemes(...a);
|
|
44
|
+
export const applyLineChanges = (...a) => u().applyLineChanges(...a);
|
|
45
|
+
export const buildChangeTree = (...a) => u().buildChangeTree(...a);
|
|
46
|
+
export const chordFor = (...a) => u().chordFor(...a);
|
|
47
|
+
export const chordIndex = (...a) => u().chordIndex(...a);
|
|
48
|
+
export const claimedOutsideTerminal = (...a) => u().claimedOutsideTerminal(...a);
|
|
33
49
|
export const cmSurface = (...a) => u().cmSurface(...a);
|
|
50
|
+
export const collectFiles = (...a) => u().collectFiles(...a);
|
|
51
|
+
export const conflict = (...a) => u().conflict(...a);
|
|
52
|
+
export const decodeText = (...a) => u().decodeText(...a);
|
|
53
|
+
export const dispatch = (...a) => u().dispatch(...a);
|
|
54
|
+
export const formatChord = (...a) => u().formatChord(...a);
|
|
55
|
+
export const getEditorSettings = (...a) => u().getEditorSettings(...a);
|
|
56
|
+
export const getOverrides = (...a) => u().getOverrides(...a);
|
|
57
|
+
export const match = (...a) => u().match(...a);
|
|
58
|
+
export const mediaKind = (...a) => u().mediaKind(...a);
|
|
59
|
+
export const monacoOptionsFrom = (...a) => u().monacoOptionsFrom(...a);
|
|
60
|
+
export const normalizeChord = (...a) => u().normalizeChord(...a);
|
|
61
|
+
export const onKey = (...a) => u().onKey(...a);
|
|
62
|
+
export const onKeys = (...a) => u().onKeys(...a);
|
|
63
|
+
export const parseChord = (...a) => u().parseChord(...a);
|
|
64
|
+
export const parseDirty = (...a) => u().parseDirty(...a);
|
|
65
|
+
export const pushScope = (...a) => u().pushScope(...a);
|
|
66
|
+
export const repoLabel = (...a) => u().repoLabel(...a);
|
|
67
|
+
export const resolve = (...a) => u().resolve(...a);
|
|
34
68
|
export const rowAt = (...a) => u().rowAt(...a);
|
|
69
|
+
export const sameRows = (...a) => u().sameRows(...a);
|
|
70
|
+
export const scopeActive = (...a) => u().scopeActive(...a);
|
|
71
|
+
export const setPluginBindings = (...a) => u().setPluginBindings(...a);
|
|
72
|
+
export const statusColor = (...a) => u().statusColor(...a);
|
|
73
|
+
export const subscribeEditorSettings = (...a) => u().subscribeEditorSettings(...a);
|
|
74
|
+
export const themeById = (...a) => u().themeById(...a);
|
|
75
|
+
export const toMonaco = (...a) => u().toMonaco(...a);
|
|
35
76
|
export const toast = (...a) => u().toast(...a);
|
|
77
|
+
export const updateEditorSettings = (...a) => u().updateEditorSettings(...a);
|
|
78
|
+
export const useEditorSettings = (...a) => u().useEditorSettings(...a);
|
|
79
|
+
export const useIconThemesVersion = (...a) => u().useIconThemesVersion(...a);
|
|
80
|
+
export const useKeybindings = (...a) => u().useKeybindings(...a);
|
|
81
|
+
export const useNarrow = (...a) => u().useNarrow(...a);
|
|
36
82
|
export const useResize = (...a) => u().useResize(...a);
|
|
37
83
|
export const useRowDrag = (...a) => u().useRowDrag(...a);
|
|
84
|
+
export const useScope = (...a) => u().useScope(...a);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
|
+
import type { LucideIcon } from "lucide-react";
|
|
3
|
+
export interface ActivityView<Id extends string> {
|
|
4
|
+
id: Id;
|
|
5
|
+
icon: LucideIcon;
|
|
6
|
+
title: string;
|
|
7
|
+
/** Small count bubble on the icon. Absolutely positioned, so it never affects layout. */
|
|
8
|
+
badge?: number;
|
|
9
|
+
/** Makes this icon a plain action — it opens a menu or dialog instead of switching the panel,
|
|
10
|
+
* and never takes the selected state. Receives its own button for anchoring a popup. */
|
|
11
|
+
onClick?: (el: HTMLElement) => void;
|
|
12
|
+
}
|
|
13
|
+
export default ActivityBar;
|
|
14
|
+
export declare function ActivityBar<Id extends string>({ views, active, onSelect, trailing, }: {
|
|
15
|
+
views: readonly ActivityView<Id>[];
|
|
16
|
+
active: Id;
|
|
17
|
+
onSelect: (id: Id) => void;
|
|
18
|
+
/** Fixed controls pinned to the right — present for every view, or the icons shift. */
|
|
19
|
+
trailing?: React.ReactNode;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
@@ -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, }: {
|
|
15
|
+
export declare function TabStrip({ tabs, activeId, onSelect, onClose, onReorder, onDoubleClick, trailing, pill, onAdd, addTitle, }: {
|
|
16
16
|
tabs: readonly TabItem[];
|
|
17
17
|
activeId: string | null;
|
|
18
18
|
onSelect: (id: string) => void;
|
|
@@ -22,5 +22,11 @@ export declare function TabStrip({ tabs, activeId, onSelect, onClose, onReorder,
|
|
|
22
22
|
onDoubleClick?: (id: string) => void;
|
|
23
23
|
/** Right-aligned controls after the tabs — view toggles, save state. */
|
|
24
24
|
trailing?: ReactNode;
|
|
25
|
+
/** Rounded tabs with the active one lit in the accent, the look of the workspace tabs in the
|
|
26
|
+
* title bar, instead of the editor-style boxed row. */
|
|
27
|
+
pill?: boolean;
|
|
28
|
+
/** A + right after the last tab, as the workspace tabs have. */
|
|
29
|
+
onAdd?: () => void;
|
|
30
|
+
addTitle?: string;
|
|
25
31
|
}): import("react").JSX.Element;
|
|
26
32
|
export default TabStrip;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
// GENERATED by sdk/gen-types.mjs from Deck's source — do not edit.
|
|
2
|
+
/**
|
|
3
|
+
* Whether an element is narrower than `px`, kept current as it resizes.
|
|
4
|
+
*
|
|
5
|
+
* A tool can now be a pane of any width, not the whole window, so a layout with a fixed sidebar
|
|
6
|
+
* asks this about its own box (never the window) and folds the sidebar away when it would leave
|
|
7
|
+
* the content too little room.
|
|
8
|
+
*
|
|
9
|
+
* Returns the answer and a ref callback to put on the element. A callback rather than a ref
|
|
10
|
+
* object, so the measuring starts whenever the element appears: a component that first renders a
|
|
11
|
+
* loading state has no element on its first run, and an effect reading a ref then never ran again.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useNarrow(px: number): [boolean, (el: HTMLElement | null) => void];
|
|
2
14
|
/**
|
|
3
15
|
* A draggable split. Returns the size in px, the props for the divider, and whether a drag is
|
|
4
16
|
* in progress — the last so an animated pane can turn its transition off while dragging, or the
|