@pstdio/workbench 0.44.0-nightly.20261017030225 → 0.44.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/dist/extensions.d.ts +163 -1040
- package/dist/extensions.js +1194 -808
- package/dist/extensions.js.map +1 -1
- package/dist/{file-renderer-view-r1qeAkQT.js → file-renderer-view-C5dyoQQW.js} +211 -214
- package/dist/file-renderer-view-C5dyoQQW.js.map +1 -0
- package/dist/{index-zQfxsv7O.d.ts → index-8x-QT7wg.d.ts} +1994 -533
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2052 -2002
- package/dist/index.js.map +1 -1
- package/dist/{kanban-presentation-BtBGjJnW.d.ts → kanban-presentation-pexk_oCY.d.ts} +1 -1
- package/dist/layout-tab-presentation-Bz6EgFEa.js +15 -0
- package/dist/layout-tab-presentation-Bz6EgFEa.js.map +1 -0
- package/dist/{navigation-tree-registry-CIwRvLFJ.js → navigation-tree-registry-C5l3eO3n.js} +2 -2
- package/dist/{navigation-tree-registry-CIwRvLFJ.js.map → navigation-tree-registry-C5l3eO3n.js.map} +1 -1
- package/dist/react-C-HbdPSw.js +8881 -0
- package/dist/react-C-HbdPSw.js.map +1 -0
- package/dist/react.d.ts +75 -29
- package/dist/react.js +2 -2
- package/dist/storage.d.ts +3 -2
- package/dist/storage.js +142 -123
- package/dist/storage.js.map +1 -1
- package/dist/webview-runtime.js +1 -1
- package/dist/workbench-renderers-Bz_dLyHW.js +4775 -0
- package/dist/workbench-renderers-Bz_dLyHW.js.map +1 -0
- package/package.json +3 -3
- package/dist/file-renderer-view-r1qeAkQT.js.map +0 -1
- package/dist/react-CoeiP5wi.js +0 -10939
- package/dist/react-CoeiP5wi.js.map +0 -1
- package/dist/workbench-renderers-Bj4sazP5.js +0 -976
- package/dist/workbench-renderers-Bj4sazP5.js.map +0 -1
package/dist/extensions.js
CHANGED
|
@@ -1,61 +1,116 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { createElement as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { Cn as e, O as t, Tn as n, _n as r, an as i, dn as a, fn as o, gn as s, hn as c, on as l, pn as u, sn as d, vn as f, wn as p, xn as m, yn as h } from "./workbench-renderers-Bz_dLyHW.js";
|
|
2
|
+
import { n as g } from "./navigation-tree-registry-C5l3eO3n.js";
|
|
3
|
+
import { l as _, st as v, u as y } from "./react-C-HbdPSw.js";
|
|
4
|
+
import { z as b } from "zod";
|
|
5
|
+
import { CommandOutcomeError as x, commandRefId as S, contributionRefId as C, getCommandValue as ee, isLocalizedString as te, isNavigationTarget as ne, matchesResourceWhen as re, resourceKey as w } from "@pstdio/sdk/extensions";
|
|
6
|
+
import { c as ie } from "react/compiler-runtime";
|
|
7
|
+
import { Box as ae, Center as oe, Stack as se, Text as ce } from "@chakra-ui/react";
|
|
8
|
+
import { createElement as T, useEffect as E, useRef as D, useState as le } from "react";
|
|
9
|
+
import { jsx as O, jsxs as ue } from "react/jsx-runtime";
|
|
10
|
+
import { renderBadgeListDisplay as de } from "@pstdio/ui/kanban-renderer";
|
|
11
|
+
import { host as fe } from "rimless";
|
|
12
|
+
//#region ../pstdio-api-contracts/src/extension-kernel/l10n.ts
|
|
13
|
+
var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n == "string", k = (e) => !(!e || typeof e != "object" || Array.isArray(e)), A = (e, t) => k(e) && e.kind === t && typeof e.id == "string", me = (e) => k(e) && typeof e.type == "string" && typeof e.id == "string", he = (e) => e === void 0 || e === "preview" || e === "pin", ge = (t, n = /* @__PURE__ */ new Set()) => {
|
|
14
|
+
if (!k(t) || t.kind !== "page" || !A(t.page, "page") || n.has(t) || t.resource !== void 0 && !me(t.resource) || t.section !== void 0 && !k(t.section) || t.position !== void 0 && (!e(t.position) || t.section !== void 0) || !he(t.open)) return !1;
|
|
15
|
+
if (t.parent === void 0) return !0;
|
|
16
|
+
let r = new Set(n);
|
|
17
|
+
return r.add(t), ge(t.parent, r);
|
|
18
|
+
}, _e = (e) => {
|
|
19
|
+
if (!k(e) || e.kind !== "panel" || !k(e.panel)) return !1;
|
|
20
|
+
let t = e.panel;
|
|
21
|
+
return (A(t, "placement") || t.kind === "page-slot" && A(t.page, "page") && typeof t.id == "string") && (e.resource === void 0 || me(e.resource)) && he(e.open);
|
|
22
|
+
}, ve = (e) => k(e) ? e.kind === "page" ? ge(e) : e.kind === "panel" ? _e(e) : e.kind === "href" ? p(e.href) : e.kind === "command" && k(e.target) && A(e.target.command, "command") && (e.target.params === void 0 || k(e.target.params)) : !1, ye = (e) => ve(e) ? !0 : !k(e) || e.kind !== "compound" || !Array.isArray(e.targets) || e.targets.length === 0 ? !1 : e.targets.every((e) => ge(e) || _e(e)), j = (e, t) => e.extensionId !== void 0 || t === void 0 ? e : {
|
|
23
|
+
...e,
|
|
24
|
+
extensionId: t
|
|
25
|
+
}, be = (e, t, n) => ({
|
|
26
|
+
...e,
|
|
27
|
+
page: j(e.page, t),
|
|
28
|
+
...e.resource ? { resource: xe(e.resource, t, n) } : {},
|
|
29
|
+
...e.parent ? { parent: be(e.parent, t, n) } : {}
|
|
30
|
+
}), xe = (e, t, n) => ({
|
|
31
|
+
...e,
|
|
32
|
+
extensionId: e.extensionId ?? t,
|
|
33
|
+
projectId: e.projectId ?? n
|
|
34
|
+
}), Se = (e, t, n) => {
|
|
35
|
+
if (!ye(e)) throw Error("Invalid navigation target.");
|
|
36
|
+
return e.kind === "page" ? be(e, t, n) : e.kind === "panel" ? {
|
|
37
|
+
...e,
|
|
38
|
+
panel: e.panel.kind === "page-slot" ? {
|
|
39
|
+
...e.panel,
|
|
40
|
+
page: j(e.panel.page, t)
|
|
41
|
+
} : j(e.panel, t),
|
|
42
|
+
...e.resource ? { resource: xe(e.resource, t, n) } : {}
|
|
43
|
+
} : e.kind === "command" ? {
|
|
44
|
+
...e,
|
|
45
|
+
target: {
|
|
46
|
+
...e.target,
|
|
47
|
+
command: j(e.target.command, t)
|
|
48
|
+
}
|
|
49
|
+
} : e.kind === "href" ? e : {
|
|
50
|
+
...e,
|
|
51
|
+
targets: e.targets.map((e) => Se(e, t, n))
|
|
52
|
+
};
|
|
53
|
+
}, Ce = (e) => {
|
|
54
|
+
let t = [], n = (e) => ({
|
|
55
|
+
...e,
|
|
56
|
+
name: e.name,
|
|
57
|
+
message: e.message,
|
|
58
|
+
...e.stack ? { stack: e.stack } : {},
|
|
59
|
+
...e.cause === void 0 ? {} : { cause: e.cause }
|
|
60
|
+
}), r = /* @__PURE__ */ new WeakMap(), i = (e) => {
|
|
61
|
+
let t = r.get(e);
|
|
62
|
+
if (t) return t;
|
|
63
|
+
let i = n(e);
|
|
64
|
+
return r.set(e, i), i;
|
|
65
|
+
}, a = e instanceof Error ? i(e) : { message: String(e) };
|
|
66
|
+
return JSON.parse(JSON.stringify(a, function(e, n) {
|
|
67
|
+
let r = n instanceof Error ? i(n) : n;
|
|
68
|
+
if (typeof r == "bigint") return String(r);
|
|
69
|
+
if (r && typeof r == "object") {
|
|
70
|
+
for (; t.length && t.at(-1) !== this;) t.pop();
|
|
71
|
+
if (t.includes(r)) return "[Circular]";
|
|
72
|
+
t.push(r);
|
|
73
|
+
}
|
|
74
|
+
return r;
|
|
75
|
+
}));
|
|
76
|
+
}, we = /* @__PURE__ */ new Set([...l, ...i]), Te = new Set(d), Ee = (e) => we.has(e), De = (e) => Te.has(e), Oe = (e) => {
|
|
21
77
|
let [t = "", n] = e.split("@"), r = t.indexOf(":");
|
|
22
78
|
return {
|
|
23
79
|
capability: e,
|
|
24
80
|
name: r === -1 ? t : t.slice(0, r),
|
|
25
81
|
scope: r === -1 ? void 0 : t.slice(r + 1),
|
|
26
|
-
version: n === void 0 ?
|
|
82
|
+
version: n === void 0 ? 1 : Number(n)
|
|
27
83
|
};
|
|
28
|
-
},
|
|
84
|
+
}, ke = (e) => De(e.name) ? !!e.scope : e.scope === void 0, M = (e) => ({
|
|
29
85
|
capability: e,
|
|
30
86
|
code: "unsupported_webview_capability",
|
|
31
87
|
message: `Unsupported webview capability: ${e}`,
|
|
32
88
|
severity: "error"
|
|
33
|
-
}),
|
|
89
|
+
}), Ae = (e, t, n) => ({
|
|
34
90
|
capability: e,
|
|
35
91
|
code: "unsupported_webview_capability_version",
|
|
36
|
-
message: `Unsupported webview capability version: ${t}@${n.toString()} (supported:
|
|
92
|
+
message: `Unsupported webview capability version: ${t}@${n.toString()} (supported: 1)`,
|
|
37
93
|
severity: "error"
|
|
38
|
-
}),
|
|
94
|
+
}), je = (e) => ({
|
|
39
95
|
capability: e,
|
|
40
96
|
code: "undeclared_webview_capability",
|
|
41
97
|
message: `Webview did not declare host capability: ${e}`,
|
|
42
98
|
severity: "error"
|
|
43
|
-
}),
|
|
99
|
+
}), Me = (e, t = {}) => {
|
|
44
100
|
let n = [], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map();
|
|
45
|
-
for (let e of s) t[e] && r.add(e);
|
|
46
101
|
for (let a of e ?? []) {
|
|
47
|
-
let e =
|
|
48
|
-
if (!
|
|
49
|
-
n.push(
|
|
102
|
+
let e = Oe(a);
|
|
103
|
+
if (!Ee(e.name) || !ke(e)) {
|
|
104
|
+
n.push(M(a));
|
|
50
105
|
continue;
|
|
51
106
|
}
|
|
52
|
-
if (e.version !==
|
|
53
|
-
n.push(
|
|
107
|
+
if (e.version !== 1) {
|
|
108
|
+
n.push(Ae(a, e.name, e.version));
|
|
54
109
|
continue;
|
|
55
110
|
}
|
|
56
111
|
if (e.name === "clipboard.write") continue;
|
|
57
112
|
if (!t[e.name]) {
|
|
58
|
-
n.push(
|
|
113
|
+
n.push(M(a));
|
|
59
114
|
continue;
|
|
60
115
|
}
|
|
61
116
|
if (e.scope === void 0) {
|
|
@@ -70,28 +125,48 @@ var A = (e) => {
|
|
|
70
125
|
allowedScopes: i,
|
|
71
126
|
diagnostics: n
|
|
72
127
|
};
|
|
73
|
-
},
|
|
128
|
+
}, Ne = (e) => {
|
|
74
129
|
let t = e.params;
|
|
75
130
|
return typeof t?.mount == "string" && t.mount.length > 0 ? t.mount : void 0;
|
|
76
|
-
},
|
|
77
|
-
let { allowed: t, allowedScopes: n, diagnostics: r } =
|
|
131
|
+
}, Pe = (e) => {
|
|
132
|
+
let { allowed: t, allowedScopes: n, diagnostics: r } = Me(e.declaredCapabilities, e.capabilities), i = (t) => {
|
|
78
133
|
e.onDiagnostic?.(t);
|
|
79
|
-
}, a = (e) => (i(e), Error(e.message)
|
|
134
|
+
}, a = (e) => (i(e), Object.assign(Error(e.message), {
|
|
135
|
+
code: e.code,
|
|
136
|
+
data: { capability: e.capability }
|
|
137
|
+
}));
|
|
80
138
|
return {
|
|
81
139
|
diagnostics: r,
|
|
82
140
|
async call(r) {
|
|
83
|
-
if (!
|
|
84
|
-
if (
|
|
85
|
-
let e =
|
|
86
|
-
if (!e) throw a(
|
|
87
|
-
if (!n.get(r.method)?.has(e)) throw a(
|
|
88
|
-
} else if (!t.has(r.method)) throw a(
|
|
141
|
+
if (!Ee(r.method) || r.method === "clipboard.write") throw a(M(r.method));
|
|
142
|
+
if (De(r.method)) {
|
|
143
|
+
let e = Ne(r);
|
|
144
|
+
if (!e) throw a(M(r.method));
|
|
145
|
+
if (!n.get(r.method)?.has(e)) throw a(je(`${r.method}:${e}`));
|
|
146
|
+
} else if (!t.has(r.method)) throw a(je(r.method));
|
|
89
147
|
let i = e.capabilities[r.method];
|
|
90
|
-
if (!i) throw a(
|
|
148
|
+
if (!i) throw a(M(r.method));
|
|
91
149
|
return await i(r.params);
|
|
92
150
|
}
|
|
93
151
|
};
|
|
94
|
-
},
|
|
152
|
+
}, Fe = (e = {}) => {
|
|
153
|
+
let t = e.locale ?? "en";
|
|
154
|
+
return {
|
|
155
|
+
...e,
|
|
156
|
+
projectId: e.projectId,
|
|
157
|
+
themePreference: e.themePreference ?? "system",
|
|
158
|
+
locale: t,
|
|
159
|
+
resource: e.resource,
|
|
160
|
+
pageLocation: e.pageLocation,
|
|
161
|
+
pageParams: e.pageParams ?? {},
|
|
162
|
+
translations: e.translations ?? {
|
|
163
|
+
locale: t,
|
|
164
|
+
defaultLocale: t,
|
|
165
|
+
bundle: {},
|
|
166
|
+
defaultBundle: {}
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
}, Ie = (e) => typeof e == "object" && !!e, Le = (e) => {
|
|
95
170
|
try {
|
|
96
171
|
let t = JSON.stringify(e);
|
|
97
172
|
if (typeof t == "string" && t.length > 0) return t;
|
|
@@ -101,21 +176,38 @@ var A = (e) => {
|
|
|
101
176
|
} catch {
|
|
102
177
|
return "Unknown error";
|
|
103
178
|
}
|
|
104
|
-
},
|
|
179
|
+
}, Re = (e) => {
|
|
105
180
|
if (e instanceof Error) return {
|
|
106
181
|
message: e.message,
|
|
107
182
|
stack: e.stack
|
|
108
183
|
};
|
|
109
184
|
if (typeof e == "string") return { message: e };
|
|
110
|
-
if (
|
|
185
|
+
if (Ie(e)) {
|
|
111
186
|
let t = typeof e.message == "string" ? e.message : null, n = typeof e.stack == "string" ? e.stack : void 0;
|
|
112
187
|
return t ? n ? {
|
|
113
188
|
message: t,
|
|
114
189
|
stack: n
|
|
115
|
-
} : { message: t } : { message:
|
|
190
|
+
} : { message: t } : { message: Le(e) };
|
|
116
191
|
}
|
|
117
|
-
return e == null ? { message: "Unknown error" } : { message:
|
|
118
|
-
},
|
|
192
|
+
return e == null ? { message: "Unknown error" } : { message: Le(e) };
|
|
193
|
+
}, ze = async (e) => {
|
|
194
|
+
try {
|
|
195
|
+
return {
|
|
196
|
+
ok: !0,
|
|
197
|
+
value: await e()
|
|
198
|
+
};
|
|
199
|
+
} catch (e) {
|
|
200
|
+
let t = typeof e == "object" && e ? e : {};
|
|
201
|
+
return {
|
|
202
|
+
ok: !1,
|
|
203
|
+
error: {
|
|
204
|
+
code: "code" in t && typeof t.code == "string" ? t.code : "webview_capability_failed",
|
|
205
|
+
message: Re(e).message,
|
|
206
|
+
..."data" in t ? { data: t.data } : {}
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
}, Be = (e = []) => e.some((e) => e === "clipboard.write" || e === "clipboard.write@1") ? "fullscreen; clipboard-write" : "fullscreen", N = () => {
|
|
119
211
|
if (typeof document > "u") return {};
|
|
120
212
|
let e = getComputedStyle(document.documentElement), t = {};
|
|
121
213
|
for (let n = 0; n < e.length; n += 1) {
|
|
@@ -123,93 +215,101 @@ var A = (e) => {
|
|
|
123
215
|
r.startsWith("--chakra-") && (t[r] = e.getPropertyValue(r).trim());
|
|
124
216
|
}
|
|
125
217
|
return t;
|
|
126
|
-
},
|
|
218
|
+
}, Ve = (e) => {
|
|
127
219
|
if (typeof document > "u") return e;
|
|
128
220
|
let t = document.documentElement.getAttribute("data-theme");
|
|
129
221
|
if (t === "dark" || t === "light") return t;
|
|
130
222
|
let n = document.documentElement.getAttribute("data-color-mode");
|
|
131
223
|
return n === "dark" || n === "light" ? n : e;
|
|
132
|
-
},
|
|
224
|
+
}, He = {
|
|
133
225
|
border: 0,
|
|
134
226
|
display: "block",
|
|
135
227
|
flex: "1 1 0%",
|
|
136
228
|
height: "100%",
|
|
137
229
|
minHeight: 0,
|
|
138
230
|
width: "100%"
|
|
139
|
-
},
|
|
231
|
+
}, Ue = {
|
|
140
232
|
display: "flex",
|
|
141
233
|
height: "100%",
|
|
142
234
|
minHeight: 0,
|
|
143
235
|
position: "relative",
|
|
144
236
|
width: "100%"
|
|
145
|
-
},
|
|
146
|
-
let { view: t, props: n, theme: r, capabilities: i,
|
|
147
|
-
return
|
|
148
|
-
let e =
|
|
237
|
+
}, We = "allow-scripts allow-forms allow-popups", Ge = (e) => {
|
|
238
|
+
let { view: t, props: n, theme: r, capabilities: i, onKeyboardEvent: a, hostEvents: o, onReady: s, onError: c, onDiagnostics: l, title: u } = e, d = D(null), f = D(null), p = D(!1), m = D(null), h = D(Fe(n)), g = D(r), _ = D(i), v = D(a), y = D(o), b = D(t.webview.capabilities), x = D(s), S = D(c), C = D(l), [ee, te] = le(0);
|
|
239
|
+
return h.current = Fe(n), g.current = r, _.current = i, v.current = a, y.current = o, b.current = t.webview.capabilities, x.current = s, S.current = c, C.current = l, E(() => {
|
|
240
|
+
let e = d.current;
|
|
149
241
|
if (!e) return;
|
|
150
242
|
let n = () => {
|
|
151
|
-
e.contentWindow !==
|
|
243
|
+
e.contentWindow !== m.current && te((e) => e + 1);
|
|
152
244
|
};
|
|
153
245
|
e.addEventListener("load", n);
|
|
154
246
|
let r = () => e.removeEventListener("load", n);
|
|
155
|
-
if (e.contentWindow ===
|
|
156
|
-
|
|
247
|
+
if (e.contentWindow === m.current) return r;
|
|
248
|
+
m.current = e.contentWindow;
|
|
157
249
|
let i = t.webview.styles, a = t.webview.moduleUrl, o = (e) => {
|
|
158
|
-
e.length > 0 &&
|
|
159
|
-
}, s = () =>
|
|
160
|
-
capabilities:
|
|
161
|
-
declaredCapabilities:
|
|
250
|
+
e.length > 0 && C.current?.(e);
|
|
251
|
+
}, s = () => Pe({
|
|
252
|
+
capabilities: _.current ?? {},
|
|
253
|
+
declaredCapabilities: b.current,
|
|
162
254
|
onDiagnostic: (e) => o([e])
|
|
163
255
|
});
|
|
164
256
|
o(s().diagnostics);
|
|
165
257
|
let c = {
|
|
258
|
+
dispatchKeyboardEvent: async (e) => {
|
|
259
|
+
if (v.current) return v.current(e);
|
|
260
|
+
document.dispatchEvent(new KeyboardEvent("keydown", {
|
|
261
|
+
...e,
|
|
262
|
+
bubbles: !0,
|
|
263
|
+
cancelable: !0
|
|
264
|
+
}));
|
|
265
|
+
},
|
|
166
266
|
ready: () => {},
|
|
167
267
|
runtimeError: (e) => {
|
|
168
|
-
|
|
268
|
+
S.current?.(e);
|
|
169
269
|
},
|
|
170
|
-
call: async (e) => await s().call(e)
|
|
270
|
+
call: async (e) => await ze(() => s().call(e))
|
|
171
271
|
};
|
|
172
272
|
return (() => {
|
|
173
|
-
|
|
174
|
-
let n =
|
|
273
|
+
p.current = !1, f.current = null;
|
|
274
|
+
let n = fe.connect(e, c);
|
|
175
275
|
e.contentWindow?.location.replace(t.webview.runtimeUrl), n.then(async (n) => {
|
|
176
|
-
if (
|
|
276
|
+
if (d.current !== e) return;
|
|
177
277
|
let r = n.remote;
|
|
178
|
-
|
|
278
|
+
f.current = r, y.current?.bind((e) => r.hostEvent?.(e)), await r.init({
|
|
179
279
|
moduleUrl: a,
|
|
180
280
|
styles: i,
|
|
181
|
-
props:
|
|
182
|
-
theme:
|
|
183
|
-
themeVariables:
|
|
281
|
+
props: h.current,
|
|
282
|
+
theme: Ve(g.current),
|
|
283
|
+
themeVariables: N(),
|
|
184
284
|
extensionId: t.extensionId
|
|
185
|
-
}),
|
|
285
|
+
}), d.current === e && (p.current = !0, x.current?.());
|
|
186
286
|
}).catch((t) => {
|
|
187
|
-
|
|
287
|
+
d.current === e && S.current?.(Re(t));
|
|
188
288
|
});
|
|
189
289
|
})(), r;
|
|
190
290
|
}, [
|
|
191
|
-
|
|
291
|
+
ee,
|
|
192
292
|
t.extensionId,
|
|
193
293
|
t.webview.runtimeUrl,
|
|
194
294
|
t.webview.moduleUrl,
|
|
195
295
|
t.webview.styles
|
|
196
|
-
]),
|
|
197
|
-
let e =
|
|
198
|
-
if (e &&
|
|
199
|
-
}, [
|
|
200
|
-
|
|
201
|
-
}, [n]),
|
|
202
|
-
|
|
203
|
-
theme:
|
|
204
|
-
variables:
|
|
296
|
+
]), E(() => {
|
|
297
|
+
let e = f.current;
|
|
298
|
+
if (e && o) return o.bind((t) => e.hostEvent?.(t)), () => o.unbind();
|
|
299
|
+
}, [o]), E(() => {
|
|
300
|
+
p.current && f.current?.propsUpdate({ props: Fe(n) });
|
|
301
|
+
}, [n]), E(() => {
|
|
302
|
+
p.current && f.current?.themeUpdate({
|
|
303
|
+
theme: Ve(r),
|
|
304
|
+
variables: N()
|
|
205
305
|
});
|
|
206
|
-
}, [r]),
|
|
306
|
+
}, [r]), E(() => {
|
|
207
307
|
if (typeof window > "u" || typeof MutationObserver > "u") return;
|
|
208
308
|
let e = null, t = new MutationObserver(() => {
|
|
209
309
|
e !== null && cancelAnimationFrame(e), e = requestAnimationFrame(() => {
|
|
210
|
-
e = null,
|
|
211
|
-
theme:
|
|
212
|
-
variables:
|
|
310
|
+
e = null, p.current && f.current?.themeUpdate({
|
|
311
|
+
theme: Ve(g.current),
|
|
312
|
+
variables: N()
|
|
213
313
|
});
|
|
214
314
|
});
|
|
215
315
|
}), n = {
|
|
@@ -224,26 +324,26 @@ var A = (e) => {
|
|
|
224
324
|
return t.observe(document.documentElement, n), t.observe(document.body, n), () => {
|
|
225
325
|
t.disconnect(), e !== null && cancelAnimationFrame(e);
|
|
226
326
|
};
|
|
227
|
-
}, []), /* @__PURE__ */
|
|
228
|
-
style:
|
|
229
|
-
children: /* @__PURE__ */
|
|
230
|
-
ref:
|
|
231
|
-
title:
|
|
232
|
-
allow:
|
|
233
|
-
sandbox:
|
|
327
|
+
}, []), /* @__PURE__ */ O("div", {
|
|
328
|
+
style: Ue,
|
|
329
|
+
children: /* @__PURE__ */ O("iframe", {
|
|
330
|
+
ref: d,
|
|
331
|
+
title: u ?? t.label,
|
|
332
|
+
allow: Be(t.webview.capabilities),
|
|
333
|
+
sandbox: We,
|
|
234
334
|
style: {
|
|
235
|
-
...
|
|
335
|
+
...He,
|
|
236
336
|
colorScheme: r
|
|
237
337
|
},
|
|
238
338
|
onError: () => {
|
|
239
|
-
|
|
339
|
+
S.current?.({ message: `Failed to load extension runtime at ${t.webview.runtimeUrl}` });
|
|
240
340
|
}
|
|
241
|
-
}, `${
|
|
341
|
+
}, `${ee}\n${t.webview.runtimeUrl}\n${t.webview.moduleUrl}`)
|
|
242
342
|
});
|
|
243
|
-
},
|
|
244
|
-
t(`${
|
|
245
|
-
},
|
|
246
|
-
let n = (n) =>
|
|
343
|
+
}, Ke = "[pstdio.extension-host] ", qe = (e, t = console.info) => {
|
|
344
|
+
t(`${Ke}${JSON.stringify(e)}`);
|
|
345
|
+
}, Je = (e, t) => {
|
|
346
|
+
let n = (n) => qe({
|
|
247
347
|
extensionId: e.extensionId,
|
|
248
348
|
contributionId: e.id,
|
|
249
349
|
...n
|
|
@@ -261,7 +361,7 @@ var A = (e) => {
|
|
|
261
361
|
});
|
|
262
362
|
}
|
|
263
363
|
};
|
|
264
|
-
},
|
|
364
|
+
}, Ye = () => {
|
|
265
365
|
let e = null, t = [], n = /* @__PURE__ */ new Set();
|
|
266
366
|
return {
|
|
267
367
|
emit(n) {
|
|
@@ -278,83 +378,83 @@ var A = (e) => {
|
|
|
278
378
|
for (let e of n) e();
|
|
279
379
|
}
|
|
280
380
|
};
|
|
281
|
-
},
|
|
282
|
-
let t =
|
|
381
|
+
}, Xe = (e) => {
|
|
382
|
+
let t = ie(37), n, r, i;
|
|
283
383
|
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({view: r, workbench: i, ...n} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
284
|
-
let [a, o] =
|
|
384
|
+
let [a, o] = le(i.pages.store.getState), s;
|
|
285
385
|
t[4] === i.pages.store ? s = t[5] : (s = () => i.pages.store.subscribe((e) => o(e)), t[4] = i.pages.store, t[5] = s);
|
|
286
386
|
let c;
|
|
287
|
-
t[6] === i ? c = t[7] : (c = [i], t[6] = i, t[7] = c),
|
|
387
|
+
t[6] === i ? c = t[7] : (c = [i], t[6] = i, t[7] = c), E(s, c);
|
|
288
388
|
let l, u;
|
|
289
389
|
if (t[8] !== a.activePageId || t[9] !== a.location || t[10] !== i.pages) {
|
|
290
390
|
let e = a.activePageId ? i.pages.getPage(a.activePageId) : void 0;
|
|
291
|
-
l = a.location, u =
|
|
391
|
+
l = a.location, u = m(e?.params, a.location?.params), t[8] = a.activePageId, t[9] = a.location, t[10] = i.pages, t[11] = l, t[12] = u;
|
|
292
392
|
} else l = t[11], u = t[12];
|
|
293
393
|
let d;
|
|
294
394
|
t[13] !== l || t[14] !== u ? (d = {
|
|
295
395
|
pageLocation: l,
|
|
296
396
|
pageParams: u
|
|
297
397
|
}, t[13] = l, t[14] = u, t[15] = d) : d = t[15];
|
|
298
|
-
let f = d, [p,
|
|
299
|
-
t[16] === r ?
|
|
300
|
-
let
|
|
301
|
-
t[18] === p ?
|
|
398
|
+
let f = d, [p, h] = le(null), g;
|
|
399
|
+
t[16] === r ? g = t[17] : (g = Je(r), t[16] = r, t[17] = g);
|
|
400
|
+
let _ = g, v;
|
|
401
|
+
t[18] === p ? v = t[19] : (v = p ? /* @__PURE__ */ O(oe, {
|
|
302
402
|
position: "absolute",
|
|
303
403
|
inset: "0",
|
|
304
404
|
px: "md",
|
|
305
405
|
zIndex: 1,
|
|
306
406
|
bg: "bg",
|
|
307
|
-
children: /* @__PURE__ */
|
|
407
|
+
children: /* @__PURE__ */ ue(se, {
|
|
308
408
|
gap: "xs",
|
|
309
409
|
maxW: "md",
|
|
310
410
|
textAlign: "center",
|
|
311
|
-
children: [/* @__PURE__ */
|
|
411
|
+
children: [/* @__PURE__ */ O(ce, {
|
|
312
412
|
textStyle: "paragraph/S/medium",
|
|
313
413
|
color: "fg.error",
|
|
314
414
|
children: "Extension view failed to load."
|
|
315
|
-
}), /* @__PURE__ */
|
|
415
|
+
}), /* @__PURE__ */ O(ce, {
|
|
316
416
|
textStyle: "paragraph/XS/regular",
|
|
317
417
|
color: "fg.muted",
|
|
318
418
|
children: p
|
|
319
419
|
})]
|
|
320
420
|
})
|
|
321
|
-
}) : null, t[18] = p, t[19] =
|
|
322
|
-
let y
|
|
323
|
-
t[20] !==
|
|
324
|
-
...
|
|
421
|
+
}) : null, t[18] = p, t[19] = v);
|
|
422
|
+
let y;
|
|
423
|
+
t[20] !== n.props || t[21] !== f ? (y = {
|
|
424
|
+
...n.props,
|
|
325
425
|
...f
|
|
326
|
-
}, t[20] =
|
|
327
|
-
let
|
|
328
|
-
t[23] ===
|
|
329
|
-
|
|
330
|
-
}, t[23] =
|
|
331
|
-
let
|
|
332
|
-
t[25] ===
|
|
333
|
-
|
|
334
|
-
}, t[25] =
|
|
335
|
-
let
|
|
336
|
-
t[27] !==
|
|
426
|
+
}, t[20] = n.props, t[21] = f, t[22] = y) : y = t[22];
|
|
427
|
+
let b;
|
|
428
|
+
t[23] === _ ? b = t[24] : (b = () => {
|
|
429
|
+
_.onReady(), h(null);
|
|
430
|
+
}, t[23] = _, t[24] = b);
|
|
431
|
+
let x;
|
|
432
|
+
t[25] === _ ? x = t[26] : (x = (e) => {
|
|
433
|
+
_.onError(e), h(e.message);
|
|
434
|
+
}, t[25] = _, t[26] = x);
|
|
435
|
+
let S;
|
|
436
|
+
t[27] !== _.onDiagnostics || t[28] !== n || t[29] !== y || t[30] !== b || t[31] !== x || t[32] !== r ? (S = /* @__PURE__ */ O(Ge, {
|
|
337
437
|
view: r,
|
|
338
438
|
...n,
|
|
339
|
-
props:
|
|
340
|
-
onReady:
|
|
341
|
-
onDiagnostics:
|
|
342
|
-
onError:
|
|
343
|
-
}), t[27] =
|
|
344
|
-
let
|
|
345
|
-
return t[34] !==
|
|
439
|
+
props: y,
|
|
440
|
+
onReady: b,
|
|
441
|
+
onDiagnostics: _.onDiagnostics,
|
|
442
|
+
onError: x
|
|
443
|
+
}), t[27] = _.onDiagnostics, t[28] = n, t[29] = y, t[30] = b, t[31] = x, t[32] = r, t[33] = S) : S = t[33];
|
|
444
|
+
let C;
|
|
445
|
+
return t[34] !== S || t[35] !== v ? (C = /* @__PURE__ */ ue(ae, {
|
|
346
446
|
position: "relative",
|
|
347
447
|
width: "100%",
|
|
348
448
|
height: "100%",
|
|
349
449
|
minH: "0",
|
|
350
450
|
display: "flex",
|
|
351
451
|
flexDirection: "column",
|
|
352
|
-
children: [
|
|
353
|
-
}), t[34] =
|
|
354
|
-
},
|
|
452
|
+
children: [v, S]
|
|
453
|
+
}), t[34] = S, t[35] = v, t[36] = C) : C = t[36], C;
|
|
454
|
+
}, Ze = "terminal.session", Qe = (e) => {
|
|
355
455
|
let { terminal: t, hostEvents: n } = e, r = (e) => {
|
|
356
456
|
n.emit({
|
|
357
|
-
scope:
|
|
457
|
+
scope: Ze,
|
|
358
458
|
payload: e
|
|
359
459
|
});
|
|
360
460
|
};
|
|
@@ -415,7 +515,394 @@ var A = (e) => {
|
|
|
415
515
|
}
|
|
416
516
|
}
|
|
417
517
|
};
|
|
418
|
-
},
|
|
518
|
+
}, $e = b.discriminatedUnion("kind", [
|
|
519
|
+
b.object({
|
|
520
|
+
kind: b.literal("navigate"),
|
|
521
|
+
id: b.string(),
|
|
522
|
+
label: b.string(),
|
|
523
|
+
target: b.custom(ye, "Invalid navigation target."),
|
|
524
|
+
primary: b.boolean().optional()
|
|
525
|
+
}),
|
|
526
|
+
b.object({
|
|
527
|
+
kind: b.literal("command"),
|
|
528
|
+
id: b.string(),
|
|
529
|
+
label: b.string(),
|
|
530
|
+
command: b.string(),
|
|
531
|
+
params: n.optional(),
|
|
532
|
+
primary: b.boolean().optional(),
|
|
533
|
+
destructive: b.boolean().optional()
|
|
534
|
+
}),
|
|
535
|
+
b.object({
|
|
536
|
+
kind: b.literal("url"),
|
|
537
|
+
id: b.string(),
|
|
538
|
+
label: b.string(),
|
|
539
|
+
href: b.string(),
|
|
540
|
+
primary: b.boolean().optional()
|
|
541
|
+
})
|
|
542
|
+
]), et = b.object({
|
|
543
|
+
title: b.string().min(1),
|
|
544
|
+
body: b.string().optional(),
|
|
545
|
+
kind: b.enum([
|
|
546
|
+
"needs_review",
|
|
547
|
+
"ready_to_merge",
|
|
548
|
+
"blocked",
|
|
549
|
+
"approval_required",
|
|
550
|
+
"failed",
|
|
551
|
+
"info"
|
|
552
|
+
]),
|
|
553
|
+
priority: b.enum([
|
|
554
|
+
"low",
|
|
555
|
+
"normal",
|
|
556
|
+
"high",
|
|
557
|
+
"urgent"
|
|
558
|
+
]).optional(),
|
|
559
|
+
target: f.optional(),
|
|
560
|
+
related: b.array(f).optional(),
|
|
561
|
+
actions: b.array($e).optional(),
|
|
562
|
+
dedupeKey: b.string().optional(),
|
|
563
|
+
expiresAt: b.string().optional(),
|
|
564
|
+
snoozedUntil: b.string().optional(),
|
|
565
|
+
metadata: n.optional()
|
|
566
|
+
}), P = class extends Error {
|
|
567
|
+
code;
|
|
568
|
+
data;
|
|
569
|
+
constructor(e, t, n) {
|
|
570
|
+
super(t), this.code = e, this.data = n, this.name = "WebviewHostCapabilityError";
|
|
571
|
+
}
|
|
572
|
+
}, F = b.string().min(1), tt = b.object({}).strict().optional(), nt = b.object({
|
|
573
|
+
commandId: F,
|
|
574
|
+
params: n.optional(),
|
|
575
|
+
workspaceId: F.optional(),
|
|
576
|
+
resource: f.optional(),
|
|
577
|
+
metadata: n.optional()
|
|
578
|
+
}), rt = { streamId: F }, it = b.object({
|
|
579
|
+
scope: b.enum([
|
|
580
|
+
"default",
|
|
581
|
+
"user",
|
|
582
|
+
"project",
|
|
583
|
+
"workspace",
|
|
584
|
+
"extension",
|
|
585
|
+
"session"
|
|
586
|
+
]),
|
|
587
|
+
scopeId: b.string().optional()
|
|
588
|
+
}), at = b.object({
|
|
589
|
+
name: F,
|
|
590
|
+
scope: it.optional()
|
|
591
|
+
}), ot = b.object({
|
|
592
|
+
id: F.optional(),
|
|
593
|
+
dedupeKey: b.string().optional(),
|
|
594
|
+
status: b.enum([
|
|
595
|
+
"done",
|
|
596
|
+
"dismissed",
|
|
597
|
+
"expired"
|
|
598
|
+
]).optional()
|
|
599
|
+
}).refine((e) => e.id !== void 0 || e.dedupeKey !== void 0, "Provide a notification ID or dedupe key."), st = b.union([b.instanceof(Uint8Array), b.instanceof(ArrayBuffer)]), ct = b.object({
|
|
600
|
+
type: F,
|
|
601
|
+
id: b.string().optional()
|
|
602
|
+
}), I = { sessionId: F }, lt = b.object({
|
|
603
|
+
cols: b.number().int().positive(),
|
|
604
|
+
rows: b.number().int().positive(),
|
|
605
|
+
command: b.array(b.string()).optional(),
|
|
606
|
+
cwd: b.string().optional(),
|
|
607
|
+
env: b.record(b.string(), b.string()).optional()
|
|
608
|
+
}), ut = {
|
|
609
|
+
"commands.execute": nt,
|
|
610
|
+
"commands.stream": b.discriminatedUnion("operation", [
|
|
611
|
+
nt.extend({
|
|
612
|
+
...rt,
|
|
613
|
+
operation: b.literal("start")
|
|
614
|
+
}),
|
|
615
|
+
b.object({
|
|
616
|
+
...rt,
|
|
617
|
+
operation: b.literal("cancel")
|
|
618
|
+
}),
|
|
619
|
+
b.object({
|
|
620
|
+
...rt,
|
|
621
|
+
operation: b.literal("ack"),
|
|
622
|
+
bytes: b.number().int().positive()
|
|
623
|
+
})
|
|
624
|
+
]),
|
|
625
|
+
"navigation.open": b.object({ target: b.custom(ye, "Invalid navigation target.") }),
|
|
626
|
+
"page.params.update": b.object({ params: b.record(b.string(), h.nullable()) }),
|
|
627
|
+
"placement.close": tt,
|
|
628
|
+
"notification.show": b.union([b.object({
|
|
629
|
+
type: b.enum([
|
|
630
|
+
"info",
|
|
631
|
+
"success",
|
|
632
|
+
"warning",
|
|
633
|
+
"error"
|
|
634
|
+
]),
|
|
635
|
+
title: b.string().optional(),
|
|
636
|
+
message: b.string(),
|
|
637
|
+
metadata: n.optional()
|
|
638
|
+
}), b.object({
|
|
639
|
+
level: b.enum([
|
|
640
|
+
"info",
|
|
641
|
+
"success",
|
|
642
|
+
"warning",
|
|
643
|
+
"error"
|
|
644
|
+
]),
|
|
645
|
+
title: b.string().optional(),
|
|
646
|
+
message: b.string().optional()
|
|
647
|
+
})]),
|
|
648
|
+
"notification.action": et,
|
|
649
|
+
"notification.resolve": ot,
|
|
650
|
+
"notification.dismiss": ot,
|
|
651
|
+
"preferences.get": at,
|
|
652
|
+
"preferences.set": at.extend({ value: b.union([
|
|
653
|
+
b.boolean(),
|
|
654
|
+
b.number(),
|
|
655
|
+
b.string(),
|
|
656
|
+
b.array(b.string()),
|
|
657
|
+
b.array(b.number()),
|
|
658
|
+
b.array(b.boolean()),
|
|
659
|
+
n
|
|
660
|
+
]) }),
|
|
661
|
+
"extension.settings.all": tt,
|
|
662
|
+
"extension.settings.get": b.object({ key: F }),
|
|
663
|
+
"extension.settings.set": b.object({
|
|
664
|
+
key: F,
|
|
665
|
+
value: b.unknown()
|
|
666
|
+
}),
|
|
667
|
+
"extension.settings.delete": b.object({ key: F }),
|
|
668
|
+
"terminal.session": b.discriminatedUnion("operation", [
|
|
669
|
+
b.object({
|
|
670
|
+
operation: b.literal("open"),
|
|
671
|
+
request: lt
|
|
672
|
+
}),
|
|
673
|
+
b.object({
|
|
674
|
+
...I,
|
|
675
|
+
operation: b.literal("write"),
|
|
676
|
+
data: b.union([b.string(), b.instanceof(Uint8Array)])
|
|
677
|
+
}),
|
|
678
|
+
b.object({
|
|
679
|
+
...I,
|
|
680
|
+
operation: b.literal("resize"),
|
|
681
|
+
cols: b.number().int().positive(),
|
|
682
|
+
rows: b.number().int().positive()
|
|
683
|
+
}),
|
|
684
|
+
b.object({
|
|
685
|
+
...I,
|
|
686
|
+
operation: b.literal("kill"),
|
|
687
|
+
signal: b.string().optional()
|
|
688
|
+
}),
|
|
689
|
+
b.object({
|
|
690
|
+
...I,
|
|
691
|
+
operation: b.literal("subscribe")
|
|
692
|
+
})
|
|
693
|
+
]),
|
|
694
|
+
"files.upload": b.object({
|
|
695
|
+
name: F,
|
|
696
|
+
data: st,
|
|
697
|
+
mimeType: b.string().optional(),
|
|
698
|
+
scope: ct.optional()
|
|
699
|
+
}),
|
|
700
|
+
"files.list": b.object({ scope: ct.optional() }),
|
|
701
|
+
"files.delete": b.object({ id: F }),
|
|
702
|
+
"artifacts.read": b.discriminatedUnion("op", [
|
|
703
|
+
b.object({
|
|
704
|
+
op: b.literal("list"),
|
|
705
|
+
mount: F,
|
|
706
|
+
prefix: b.string().optional()
|
|
707
|
+
}),
|
|
708
|
+
b.object({
|
|
709
|
+
op: b.literal("readText"),
|
|
710
|
+
mount: F,
|
|
711
|
+
path: b.string()
|
|
712
|
+
}),
|
|
713
|
+
b.object({
|
|
714
|
+
op: b.literal("imageUrl"),
|
|
715
|
+
mount: F,
|
|
716
|
+
path: b.string()
|
|
717
|
+
})
|
|
718
|
+
])
|
|
719
|
+
}, dt = (e, t) => {
|
|
720
|
+
let n = ut[e].safeParse(t);
|
|
721
|
+
if (!n.success) throw new P("invalid_params", `Invalid parameters for ${e}.`, {
|
|
722
|
+
capability: e,
|
|
723
|
+
issues: n.error.issues.map((e) => ({
|
|
724
|
+
path: e.path.map(String),
|
|
725
|
+
message: e.message
|
|
726
|
+
}))
|
|
727
|
+
});
|
|
728
|
+
return n.data;
|
|
729
|
+
}, ft = (e, t = e) => ({
|
|
730
|
+
ok: !1,
|
|
731
|
+
status: "error",
|
|
732
|
+
code: e,
|
|
733
|
+
reason: t
|
|
734
|
+
}), pt = (e) => {
|
|
735
|
+
let t = Ce(e);
|
|
736
|
+
return {
|
|
737
|
+
ok: !1,
|
|
738
|
+
status: "error",
|
|
739
|
+
code: e?.code ?? "command_stream_disconnected",
|
|
740
|
+
reason: t.message,
|
|
741
|
+
error: t,
|
|
742
|
+
...t.cause === void 0 ? {} : { cause: t.cause }
|
|
743
|
+
};
|
|
744
|
+
}, mt = (e) => Object.assign(Error(e), { code: e }), ht = 16, gt = 8388608, _t = async (e, t) => {
|
|
745
|
+
let n = new AbortController(), r = e.onDisconnect(() => n.abort());
|
|
746
|
+
try {
|
|
747
|
+
return await t(n.signal);
|
|
748
|
+
} finally {
|
|
749
|
+
r();
|
|
750
|
+
}
|
|
751
|
+
}, vt = (e) => {
|
|
752
|
+
let t = /* @__PURE__ */ new Map();
|
|
753
|
+
return async (n, r) => {
|
|
754
|
+
let { streamId: i } = n;
|
|
755
|
+
if (n.operation === "cancel") t.get(i)?.stop("command_stream_cancelled");
|
|
756
|
+
else if (n.operation === "ack") {
|
|
757
|
+
let e = t.get(i);
|
|
758
|
+
e && Number.isSafeInteger(n.bytes) && n.bytes > 0 && n.bytes <= e.unread && (e.unread -= n.bytes);
|
|
759
|
+
} else {
|
|
760
|
+
if (t.has(i)) throw mt("command_stream_duplicate");
|
|
761
|
+
if (t.size >= ht) throw mt("command_stream_limit");
|
|
762
|
+
let a = new AbortController(), o = !1, c = () => {}, l = (t) => e.emit({
|
|
763
|
+
scope: "commands.stream",
|
|
764
|
+
payload: {
|
|
765
|
+
streamId: i,
|
|
766
|
+
...t
|
|
767
|
+
}
|
|
768
|
+
}), u = (e, n = !0) => {
|
|
769
|
+
o || (o = !0, t.delete(i), c(), a.abort(), n && l({
|
|
770
|
+
type: "end",
|
|
771
|
+
outcome: e
|
|
772
|
+
}));
|
|
773
|
+
}, d = {
|
|
774
|
+
unread: 0,
|
|
775
|
+
stop: (e, t = !0) => u(ft(e), t)
|
|
776
|
+
};
|
|
777
|
+
t.set(i, d), c = e.onDisconnect(() => d.stop("command_stream_cancelled", !1));
|
|
778
|
+
let { operation: f, streamId: p, commandId: m, ...h } = n, g = (e) => {
|
|
779
|
+
if (e.type === "end") {
|
|
780
|
+
let t = s.parse(e.response);
|
|
781
|
+
r.publish?.(t), u(t.outcome);
|
|
782
|
+
return;
|
|
783
|
+
}
|
|
784
|
+
d.unread += new TextEncoder().encode(JSON.stringify(e.data)).byteLength, d.unread > gt ? d.stop("command_stream_overflow") : l(e);
|
|
785
|
+
};
|
|
786
|
+
(async () => {
|
|
787
|
+
try {
|
|
788
|
+
for await (let e of r.stream({
|
|
789
|
+
commandId: m,
|
|
790
|
+
...h
|
|
791
|
+
}, a.signal)) {
|
|
792
|
+
if (o) break;
|
|
793
|
+
g(e);
|
|
794
|
+
}
|
|
795
|
+
o || d.stop("command_stream_disconnected");
|
|
796
|
+
} catch (e) {
|
|
797
|
+
u(pt(e));
|
|
798
|
+
}
|
|
799
|
+
})();
|
|
800
|
+
}
|
|
801
|
+
return {
|
|
802
|
+
operation: n.operation,
|
|
803
|
+
accepted: !0
|
|
804
|
+
};
|
|
805
|
+
};
|
|
806
|
+
}, yt = b.object({ outcome: r }).passthrough(), bt = /* @__PURE__ */ new WeakMap(), xt = (e) => {
|
|
807
|
+
let t = bt.get(e);
|
|
808
|
+
return t || (t = vt(e), bt.set(e, t)), t;
|
|
809
|
+
}, St = (e, t) => e instanceof Promise ? e.then(t) : t(), L = (e, t) => (n) => {
|
|
810
|
+
if (!t) throw new P("unsupported", `The host does not support ${e}.`, { capability: e });
|
|
811
|
+
return t(dt(e, n));
|
|
812
|
+
}, Ct = (e) => {
|
|
813
|
+
let { executeCommand: t, hostEvents: n } = e;
|
|
814
|
+
if (t) return async (e) => {
|
|
815
|
+
try {
|
|
816
|
+
let r = n ? await _t(n, (n) => Promise.resolve(t(e, n))) : await t(e);
|
|
817
|
+
return yt.parse(r);
|
|
818
|
+
} catch (e) {
|
|
819
|
+
if (e instanceof x) return yt.parse({ outcome: e.outcome });
|
|
820
|
+
throw e;
|
|
821
|
+
}
|
|
822
|
+
};
|
|
823
|
+
}, wt = (e) => {
|
|
824
|
+
let { streamCommand: t, hostEvents: n } = e;
|
|
825
|
+
if (t && n) return (r) => xt(n)(r, {
|
|
826
|
+
stream: t,
|
|
827
|
+
publish: e.commandCompleted
|
|
828
|
+
});
|
|
829
|
+
}, Tt = (e) => {
|
|
830
|
+
let { hostEvents: t, navigation: n, pageParams: r, placement: i, notifications: a, settings: o, preferences: s, files: c, artifacts: l, terminal: u } = e, d = u && t ? Qe({
|
|
831
|
+
terminal: u,
|
|
832
|
+
hostEvents: t
|
|
833
|
+
}) : void 0;
|
|
834
|
+
return {
|
|
835
|
+
"commands.execute": L("commands.execute", Ct(e)),
|
|
836
|
+
"commands.stream": L("commands.stream", wt(e)),
|
|
837
|
+
"navigation.open": L("navigation.open", n && ((e) => St(n.open(e.target), () => void 0))),
|
|
838
|
+
"page.params.update": L("page.params.update", r && ((e) => {
|
|
839
|
+
let t = r.update(e.params);
|
|
840
|
+
return t instanceof Promise ? t.then((e) => ({ location: e })) : { location: t };
|
|
841
|
+
})),
|
|
842
|
+
"placement.close": L("placement.close", i && (() => i.close())),
|
|
843
|
+
"notification.show": L("notification.show", a?.show && ((e) => St(a.show("type" in e ? e : {
|
|
844
|
+
type: e.level,
|
|
845
|
+
...e.title === void 0 ? {} : { title: e.title },
|
|
846
|
+
message: e.message ?? ""
|
|
847
|
+
}), () => void 0))),
|
|
848
|
+
"notification.action": L("notification.action", a?.create && ((e) => a.create(e))),
|
|
849
|
+
"notification.resolve": L("notification.resolve", a?.resolve && ((e) => a.resolve({
|
|
850
|
+
...e,
|
|
851
|
+
status: e.status ?? "done"
|
|
852
|
+
}))),
|
|
853
|
+
"notification.dismiss": L("notification.dismiss", a?.resolve && ((e) => a.resolve({
|
|
854
|
+
...e,
|
|
855
|
+
status: "dismissed"
|
|
856
|
+
}))),
|
|
857
|
+
"preferences.get": L("preferences.get", s && ((e) => s.get(e.name, e.scope))),
|
|
858
|
+
"preferences.set": L("preferences.set", s && ((e) => {
|
|
859
|
+
let t = e.scope ?? { scope: "user" };
|
|
860
|
+
if (t.scope === "default") throw new P("preference_scope_read_only", "Default preferences are read-only.", {});
|
|
861
|
+
return St(s.set(e.name, e.value, t), () => ({
|
|
862
|
+
name: e.name,
|
|
863
|
+
value: e.value
|
|
864
|
+
}));
|
|
865
|
+
})),
|
|
866
|
+
"extension.settings.all": L("extension.settings.all", o && (() => o.all())),
|
|
867
|
+
"extension.settings.get": L("extension.settings.get", o && ((e) => o.get(e.key))),
|
|
868
|
+
"extension.settings.set": L("extension.settings.set", o && (async (e) => ({
|
|
869
|
+
key: e.key,
|
|
870
|
+
value: (await o.set(e.key, e.value)).value
|
|
871
|
+
}))),
|
|
872
|
+
"extension.settings.delete": L("extension.settings.delete", o && ((e) => o.delete(e.key))),
|
|
873
|
+
"terminal.session": L("terminal.session", d && ((e) => d(e))),
|
|
874
|
+
"files.upload": L("files.upload", c && ((e) => c.upload(e))),
|
|
875
|
+
"files.list": L("files.list", c && ((e) => c.list(e))),
|
|
876
|
+
"files.delete": L("files.delete", c && ((e) => c.delete(e))),
|
|
877
|
+
"artifacts.read": L("artifacts.read", l && ((e) => l.read(e)))
|
|
878
|
+
};
|
|
879
|
+
}, Et = (e, t) => {
|
|
880
|
+
let n = t.commandTargetOf?.(e);
|
|
881
|
+
if (n) return {
|
|
882
|
+
...n,
|
|
883
|
+
...t.region ? { region: t.region } : {}
|
|
884
|
+
};
|
|
885
|
+
let r = e.target.command, i = r.extensionId ?? t.extensionId;
|
|
886
|
+
return {
|
|
887
|
+
kind: "command",
|
|
888
|
+
commandId: t.commandIdOf?.(r) ?? (i && i !== "pstdio" ? `${i}.command.${r.id}` : r.id),
|
|
889
|
+
args: e.target.params,
|
|
890
|
+
...t.region ? { region: t.region } : {}
|
|
891
|
+
};
|
|
892
|
+
};
|
|
893
|
+
function R(e, t = {}) {
|
|
894
|
+
if (!ne(e)) throw Error("Invalid navigation target.");
|
|
895
|
+
return t.extensionId && (e = Se(e, t.extensionId, t.projectId)), e.kind === "command" ? Et(e, t) : e.kind === "href" || e.kind === "page" ? e : e.kind === "panel" ? {
|
|
896
|
+
...e,
|
|
897
|
+
...t.region ? { region: t.region } : {}
|
|
898
|
+
} : {
|
|
899
|
+
kind: "compound",
|
|
900
|
+
targets: e.targets.map((e) => R(e, t))
|
|
901
|
+
};
|
|
902
|
+
}
|
|
903
|
+
//#endregion
|
|
904
|
+
//#region src/extensions/bridge/webview-preferences-capability.ts
|
|
905
|
+
var Dt = (e) => {
|
|
419
906
|
let t = e.workbench.preferences, n = () => {
|
|
420
907
|
if (!e.extensionId) throw Error("Preferences require the calling extension identity");
|
|
421
908
|
return e.extensionId;
|
|
@@ -424,85 +911,52 @@ var A = (e) => {
|
|
|
424
911
|
return r && e.extensionId && r.ownerId !== "workbench.core" && r.ownerId !== e.extensionId && (e.warn ?? console.warn)(`Cross-extension preference access to ${n} is deprecated. Use preferences owned by ${e.extensionId}.`), !!r;
|
|
425
912
|
};
|
|
426
913
|
return {
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
"preferences.set": (i) => {
|
|
432
|
-
let { name: a, value: o, scope: s = { scope: "user" } } = i;
|
|
433
|
-
if (s.scope === "default") throw Error("preference_scope_read_only");
|
|
434
|
-
if (r(a)) {
|
|
435
|
-
let e = t.setValue(a, o, s);
|
|
436
|
-
return e instanceof Promise ? e.then(() => ({
|
|
437
|
-
name: a,
|
|
438
|
-
value: o
|
|
439
|
-
})) : {
|
|
440
|
-
name: a,
|
|
441
|
-
value: o
|
|
442
|
-
};
|
|
443
|
-
}
|
|
444
|
-
n();
|
|
445
|
-
let c = e.ownedPreferences ? e.ownedPreferences.set(a, o, s) : t.setOwnedValue(n(), a, o, s);
|
|
446
|
-
return c instanceof Promise ? c.then(() => ({
|
|
447
|
-
name: a,
|
|
448
|
-
value: o
|
|
449
|
-
})) : {
|
|
450
|
-
name: a,
|
|
451
|
-
value: o
|
|
452
|
-
};
|
|
914
|
+
get: (i, a) => r(i) ? t.getValue(i, a) : (n(), e.ownedPreferences?.get(i, a) ?? t.getOwnedValue(n(), i, a)),
|
|
915
|
+
set: (i, a, o) => {
|
|
916
|
+
if (o.scope === "default") throw Error("preference_scope_read_only");
|
|
917
|
+
return r(i) ? t.setValue(i, a, o) : (n(), e.ownedPreferences ? e.ownedPreferences.set(i, a, o) : t.setOwnedValue(n(), i, a, o));
|
|
453
918
|
}
|
|
454
919
|
};
|
|
455
|
-
},
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
});
|
|
491
|
-
},
|
|
492
|
-
...je(e),
|
|
493
|
-
"host.dispatchKeyboardEvent": (t) => (e.dispatchKeyboardEvent ?? Me)(t),
|
|
494
|
-
...e.hostEvents ? { "terminal.session": Ae({
|
|
495
|
-
terminal: e.workbench.terminal,
|
|
496
|
-
hostEvents: e.hostEvents
|
|
497
|
-
}) } : {}
|
|
498
|
-
}), Pe = () => "light", Fe = /* @__PURE__ */ new WeakMap(), Ie = (e, t) => {
|
|
499
|
-
let n = Fe.get(e);
|
|
500
|
-
n || (n = /* @__PURE__ */ new Map(), Fe.set(e, n));
|
|
920
|
+
}, Ot = (e) => {
|
|
921
|
+
let { workbench: t, placement: n, extensionId: r, projectId: i, hostEvents: a } = e;
|
|
922
|
+
return {
|
|
923
|
+
hostEvents: a,
|
|
924
|
+
executeCommand: async (e, n) => ({ outcome: {
|
|
925
|
+
ok: !0,
|
|
926
|
+
status: "success",
|
|
927
|
+
value: await t.commands.executeCommand(e.commandId, e.params, {
|
|
928
|
+
resource: e.resource,
|
|
929
|
+
signal: n
|
|
930
|
+
})
|
|
931
|
+
} }),
|
|
932
|
+
placement: n?.placementIdentity ? { close: () => t.closePlacement(n.placementIdentity) } : void 0,
|
|
933
|
+
pageParams: { update: (e) => {
|
|
934
|
+
let n = t.pages.store.getState();
|
|
935
|
+
if (!n.location) throw Error("page_params_no_page");
|
|
936
|
+
if (!r || r !== n.location.page.extensionId) throw Error("page_params_not_owner");
|
|
937
|
+
return t.pageLocations.updateParams(e);
|
|
938
|
+
} },
|
|
939
|
+
navigation: { open: (e) => t.navigation.openTarget(R(e, {
|
|
940
|
+
extensionId: r,
|
|
941
|
+
projectId: i
|
|
942
|
+
})) },
|
|
943
|
+
notifications: { show: (e) => t.notifications.show({
|
|
944
|
+
level: e.type,
|
|
945
|
+
metadata: e.metadata,
|
|
946
|
+
title: e.title ?? e.message,
|
|
947
|
+
message: e.title === void 0 ? void 0 : e.message
|
|
948
|
+
}) },
|
|
949
|
+
preferences: Dt(e),
|
|
950
|
+
terminal: t.terminal
|
|
951
|
+
};
|
|
952
|
+
}, kt = (e) => Tt(Ot(e)), At = () => "light", jt = /* @__PURE__ */ new WeakMap(), Mt = (e, t) => {
|
|
953
|
+
let n = jt.get(e);
|
|
954
|
+
n || (n = /* @__PURE__ */ new Map(), jt.set(e, n));
|
|
501
955
|
let r = t.instanceId, i = n.get(r);
|
|
502
|
-
return i || (i =
|
|
503
|
-
},
|
|
504
|
-
let { context: t,
|
|
505
|
-
return /* @__PURE__ */
|
|
956
|
+
return i || (i = Ye(), n.set(r, i)), i;
|
|
957
|
+
}, Nt = (e) => {
|
|
958
|
+
let { context: t, createHostAdapters: n, createProps: r, createTheme: i = At, ownerId: a, title: o, webview: s } = e;
|
|
959
|
+
return /* @__PURE__ */ O(Xe, {
|
|
506
960
|
view: {
|
|
507
961
|
extensionId: a ?? "workbench",
|
|
508
962
|
id: t.webviewId,
|
|
@@ -517,37 +971,16 @@ var A = (e) => {
|
|
|
517
971
|
props: r(t),
|
|
518
972
|
workbench: t.workbench,
|
|
519
973
|
theme: i(t),
|
|
520
|
-
capabilities: n({
|
|
974
|
+
capabilities: Tt(n({
|
|
521
975
|
...t,
|
|
522
976
|
extensionId: a ?? t.extensionId
|
|
523
|
-
}),
|
|
977
|
+
})),
|
|
524
978
|
hostEvents: t.hostEvents
|
|
525
979
|
});
|
|
526
|
-
},
|
|
527
|
-
let n = t.commandTargetOf?.(e);
|
|
528
|
-
if (n) return n;
|
|
529
|
-
let r = e.target.command, i = r.extensionId ?? t.extensionId;
|
|
530
|
-
return {
|
|
531
|
-
kind: "command",
|
|
532
|
-
commandId: t.commandIdOf?.(r) ?? (i && i !== "pstdio" ? `${i}.command.${r.id}` : r.id),
|
|
533
|
-
args: e.target.params
|
|
534
|
-
};
|
|
535
|
-
};
|
|
536
|
-
function F(e, t = {}) {
|
|
537
|
-
if (!h(e)) throw Error("Invalid navigation target.");
|
|
538
|
-
return t.extensionId && (e = _(e, t.extensionId, t.projectId)), e.kind === "command" ? Re(e, t) : e.kind === "href" || e.kind === "page" || e.kind === "panel" ? e : {
|
|
539
|
-
kind: "compound",
|
|
540
|
-
targets: e.targets.map((e) => F(e, t))
|
|
541
|
-
};
|
|
542
|
-
}
|
|
543
|
-
//#endregion
|
|
544
|
-
//#region src/extensions/host/command-response.ts
|
|
545
|
-
var ze = (e) => {
|
|
980
|
+
}, z = (e, t = "") => e === void 0 ? t : pe(e) ? e.default ?? e.$l10n : e, B = (e) => {
|
|
546
981
|
let t = e;
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
throw Error(t.outcome.reason ?? t.outcome.error?.message ?? "Extension command failed.");
|
|
550
|
-
}, Be = async (e, t, n, r, i) => {
|
|
982
|
+
return t?.outcome ? ee(t.outcome) : e;
|
|
983
|
+
}, Pt = async (e, t, n, r, i) => {
|
|
551
984
|
let a = t.resourceMutation;
|
|
552
985
|
if (!a) return i();
|
|
553
986
|
let o = n?.[a.idParam] ?? r?.resource?.id;
|
|
@@ -558,7 +991,7 @@ var ze = (e) => {
|
|
|
558
991
|
extensionId: t.extensionId,
|
|
559
992
|
projectId: e.projectId
|
|
560
993
|
};
|
|
561
|
-
if (a.kind === "remove" && !await e.workbench.commandPalette.requestConfirmation(
|
|
994
|
+
if (a.kind === "remove" && !await e.workbench.commandPalette.requestConfirmation(z(t.title, "Delete"))) return;
|
|
562
995
|
let c = a.kind === "rename" ? n?.[a.labelParam] : void 0;
|
|
563
996
|
if (a.kind === "rename" && (typeof c != "string" || !c.trim())) return i();
|
|
564
997
|
let l = e.workbench.resources.preview.begin(s, a.kind === "remove" ? { removed: !0 } : { label: c.trim() });
|
|
@@ -568,14 +1001,14 @@ var ze = (e) => {
|
|
|
568
1001
|
} catch (e) {
|
|
569
1002
|
throw l.rollback(), e;
|
|
570
1003
|
}
|
|
571
|
-
},
|
|
1004
|
+
}, V = (e) => ({
|
|
572
1005
|
id: e.id,
|
|
573
1006
|
kind: e.kind,
|
|
574
1007
|
context: {
|
|
575
1008
|
projectId: e.projectId,
|
|
576
1009
|
...e.context ?? {}
|
|
577
1010
|
}
|
|
578
|
-
}),
|
|
1011
|
+
}), H = async (e, t, n = {}) => {
|
|
579
1012
|
let r = n.resource, i = await e.executeCommand(t, {
|
|
580
1013
|
projectId: e.projectId,
|
|
581
1014
|
...n.workspaceId ? { workspaceId: n.workspaceId } : {},
|
|
@@ -584,11 +1017,9 @@ var ze = (e) => {
|
|
|
584
1017
|
...n.slot ? { slot: n.slot } : {},
|
|
585
1018
|
source: "dashboard",
|
|
586
1019
|
...n.metadata ? { metadata: n.metadata } : {}
|
|
587
|
-
}, n.signal);
|
|
588
|
-
ze(i);
|
|
589
|
-
let a = i?.outcome;
|
|
1020
|
+
}, n.signal), a = i?.outcome;
|
|
590
1021
|
if (a?.status === "success") for (let t of a.navigationRequests ?? []) try {
|
|
591
|
-
await e.workbench.navigation.openTarget(
|
|
1022
|
+
await e.workbench.navigation.openTarget(R(t, { region: n.region }));
|
|
592
1023
|
} catch (t) {
|
|
593
1024
|
e.workbench.notifications.show({
|
|
594
1025
|
level: "warning",
|
|
@@ -597,23 +1028,23 @@ var ze = (e) => {
|
|
|
597
1028
|
});
|
|
598
1029
|
}
|
|
599
1030
|
return i;
|
|
600
|
-
},
|
|
601
|
-
let r = async () =>
|
|
602
|
-
return i ?
|
|
603
|
-
},
|
|
1031
|
+
}, U = async (e, t, n = {}) => {
|
|
1032
|
+
let r = async () => B(await H(e, t, n)), i = e.metadata?.commands.find((e) => e.id === t);
|
|
1033
|
+
return i ? Pt(e, i, n.params, { resource: n.resource }, r) : r();
|
|
1034
|
+
}, Ft = (e) => typeof e == "object" && !!e && !Array.isArray(e), It = (e, t) => `${e.extensionId ?? t}.command.${e.id}`, Lt = async (e, t, n) => {
|
|
604
1035
|
let { target: r } = n;
|
|
605
1036
|
if (r.kind === "command") {
|
|
606
|
-
await
|
|
1037
|
+
await U(e, It(r.target.command, t.extensionId), { params: r.target.params }), e.workbench.commandPaletteResources.refresh();
|
|
607
1038
|
return;
|
|
608
1039
|
}
|
|
609
|
-
await e.workbench.navigation.openTarget(
|
|
610
|
-
},
|
|
1040
|
+
await e.workbench.navigation.openTarget(R(r, { extensionId: t.extensionId }));
|
|
1041
|
+
}, Rt = (e) => {
|
|
611
1042
|
if (e.kind === "page" || e.kind === "panel") return e.resource;
|
|
612
1043
|
if (e.kind === "compound") return e.targets.find((e) => e.resource)?.resource;
|
|
613
|
-
},
|
|
1044
|
+
}, zt = (e, t, n, r) => ({
|
|
614
1045
|
id: `${t.id}:${r.id}`,
|
|
615
1046
|
resource: (() => {
|
|
616
|
-
let n =
|
|
1047
|
+
let n = Rt(r.target);
|
|
617
1048
|
return n ? {
|
|
618
1049
|
...n,
|
|
619
1050
|
projectId: n.projectId ?? e.projectId,
|
|
@@ -625,17 +1056,17 @@ var ze = (e) => {
|
|
|
625
1056
|
icon: r.icon,
|
|
626
1057
|
keywords: r.keywords,
|
|
627
1058
|
group: n,
|
|
628
|
-
activate: () =>
|
|
629
|
-
}),
|
|
1059
|
+
activate: () => Lt(e, t, r)
|
|
1060
|
+
}), Bt = (e, t) => {
|
|
630
1061
|
let n = [];
|
|
631
1062
|
for (let r of t) {
|
|
632
|
-
let t =
|
|
1063
|
+
let t = z(r.title, r.id);
|
|
633
1064
|
n.push(e.workbench.commandPaletteResources.registerProvider({
|
|
634
1065
|
id: r.id,
|
|
635
1066
|
title: t,
|
|
636
1067
|
refreshEventIds: r.refreshEventIds,
|
|
637
1068
|
query: async ({ query: n, limit: i, signal: a }) => {
|
|
638
|
-
let o = e.workbench.getActiveResource(), s = await
|
|
1069
|
+
let o = e.workbench.getActiveResource(), s = await U(e, r.queryHandlerId, {
|
|
639
1070
|
signal: a,
|
|
640
1071
|
params: {
|
|
641
1072
|
projectId: e.projectId,
|
|
@@ -646,20 +1077,20 @@ var ze = (e) => {
|
|
|
646
1077
|
limit: i
|
|
647
1078
|
}
|
|
648
1079
|
});
|
|
649
|
-
return
|
|
1080
|
+
return Ft(s) ? (s.items ?? []).map((n) => zt(e, r, t, n)) : [];
|
|
650
1081
|
}
|
|
651
1082
|
}));
|
|
652
1083
|
}
|
|
653
1084
|
return { dispose() {
|
|
654
1085
|
for (let e = n.length - 1; e >= 0; --e) n[e]?.dispose();
|
|
655
1086
|
} };
|
|
656
|
-
},
|
|
657
|
-
let r =
|
|
1087
|
+
}, Vt = (e, t = "") => z(e, t), Ht = (e, t, n) => {
|
|
1088
|
+
let r = V({
|
|
658
1089
|
id: t.id,
|
|
659
1090
|
kind: "renderer",
|
|
660
1091
|
projectId: e.projectId,
|
|
661
1092
|
context: { controlsRendererId: t.id }
|
|
662
|
-
}), i = (n, i, a, o, s) => n ?
|
|
1093
|
+
}), i = (n, i, a, o, s) => n ? U(e, n, {
|
|
663
1094
|
params: {
|
|
664
1095
|
renderer: {
|
|
665
1096
|
rendererId: t.id,
|
|
@@ -677,20 +1108,20 @@ var ze = (e) => {
|
|
|
677
1108
|
}) : Promise.resolve(void 0);
|
|
678
1109
|
return e.workbench.views.registerView({
|
|
679
1110
|
id: t.id,
|
|
680
|
-
title:
|
|
1111
|
+
title: Vt(t.title, t.id),
|
|
681
1112
|
icon: t.icon,
|
|
682
1113
|
body: {
|
|
683
1114
|
kind: "controls",
|
|
684
|
-
emptyTitle:
|
|
685
|
-
emptyDescription:
|
|
1115
|
+
emptyTitle: Vt(t.emptyTitle, ""),
|
|
1116
|
+
emptyDescription: Vt(t.emptyDescription, ""),
|
|
686
1117
|
defaultValues: t.defaultValues,
|
|
687
1118
|
executeQuery: async (e, r, a) => {
|
|
688
|
-
let
|
|
689
|
-
if (!
|
|
690
|
-
let e =
|
|
1119
|
+
let o = await i(t.queryHandlerId, {}, e ?? n.resolveResource?.(t), r, a), s = c.safeParse(o);
|
|
1120
|
+
if (!s.success) {
|
|
1121
|
+
let e = s.error.issues.map((e) => `body.query.${e.path.join(".")}: ${e.message}`).join("; ");
|
|
691
1122
|
throw Error(`Extension "${t.extensionId}" view "${t.id}" has invalid controls. Expected serializable control declarations. ${e}`);
|
|
692
1123
|
}
|
|
693
|
-
return
|
|
1124
|
+
return s.data;
|
|
694
1125
|
},
|
|
695
1126
|
updateValue: t.valueChangeHandlerId ? ({ controlId: e, value: n, values: r, resource: a }) => i(t.valueChangeHandlerId, {
|
|
696
1127
|
controlId: e,
|
|
@@ -701,93 +1132,93 @@ var ze = (e) => {
|
|
|
701
1132
|
reset: t.resetHandlerId ? ({ controlIds: e, resource: n }) => i(t.resetHandlerId, { controlIds: e }, n).then(() => void 0) : void 0
|
|
702
1133
|
}
|
|
703
1134
|
});
|
|
704
|
-
},
|
|
1135
|
+
}, Ut = (e, t, n = {}) => {
|
|
705
1136
|
let r = [];
|
|
706
|
-
for (let i of t) r.push(
|
|
1137
|
+
for (let i of t) r.push(Ht(e, i, n));
|
|
707
1138
|
return { dispose() {
|
|
708
1139
|
for (let e = r.length - 1; e >= 0; --e) r[e]?.dispose();
|
|
709
1140
|
} };
|
|
710
|
-
},
|
|
1141
|
+
}, W = (e, t, n) => {
|
|
711
1142
|
if (e) return Object.fromEntries(Object.entries(e).map(([e, r]) => [e, {
|
|
712
1143
|
...r,
|
|
713
|
-
...r.options && !Array.isArray(r.options) ? { options:
|
|
1144
|
+
...r.options && !Array.isArray(r.options) ? { options: Wt(r.options, n) } : {},
|
|
714
1145
|
label: r.label === void 0 ? void 0 : t(r.label, e),
|
|
715
1146
|
description: r.description === void 0 ? void 0 : t(r.description)
|
|
716
1147
|
}]));
|
|
717
|
-
},
|
|
1148
|
+
}, Wt = (e, t) => {
|
|
718
1149
|
let n = e;
|
|
719
1150
|
return {
|
|
720
1151
|
valueField: n.valueField,
|
|
721
1152
|
labelField: n.labelField,
|
|
722
1153
|
params: n.params,
|
|
723
|
-
commandId:
|
|
1154
|
+
commandId: S({
|
|
724
1155
|
id: n.command.id,
|
|
725
1156
|
extensionId: n.command.extensionId ?? t ?? "pstdio"
|
|
726
1157
|
})
|
|
727
1158
|
};
|
|
728
|
-
},
|
|
1159
|
+
}, Gt = (e) => e.toolbarActions?.map((t) => ({
|
|
729
1160
|
id: t.id,
|
|
730
|
-
label:
|
|
1161
|
+
label: z(t.label, t.id),
|
|
731
1162
|
icon: t.icon,
|
|
732
1163
|
presentation: t.presentation,
|
|
733
1164
|
commandId: t.commandId,
|
|
734
1165
|
args: t.params,
|
|
735
|
-
params:
|
|
1166
|
+
params: W(t.input, z, e.extensionId),
|
|
736
1167
|
submitLabel: t.submitLabel,
|
|
737
1168
|
disabled: t.disabled,
|
|
738
1169
|
when: t.when
|
|
739
|
-
})),
|
|
1170
|
+
})), G = (e, t = "") => z(e, t), Kt = (e) => ({
|
|
740
1171
|
...e,
|
|
741
|
-
label:
|
|
742
|
-
description: e.description ?
|
|
743
|
-
icon: e.icon ?
|
|
1172
|
+
label: G(e.label, e.id),
|
|
1173
|
+
description: e.description ? G(e.description) : void 0,
|
|
1174
|
+
icon: e.icon ? T(v, {
|
|
744
1175
|
name: e.icon,
|
|
745
1176
|
size: 14
|
|
746
1177
|
}) : void 0
|
|
747
|
-
}),
|
|
1178
|
+
}), qt = (e) => !!(e && typeof e == "object" && Array.isArray(e.rows)), Jt = (e) => ({
|
|
748
1179
|
id: e.id,
|
|
749
1180
|
values: e.values,
|
|
750
1181
|
resource: e.resource ? e.resource : void 0
|
|
751
|
-
}),
|
|
752
|
-
let
|
|
1182
|
+
}), Yt = (e, t, n) => {
|
|
1183
|
+
let r = o(t), i = /* @__PURE__ */ new WeakMap(), a = V({
|
|
753
1184
|
id: t.id,
|
|
754
1185
|
kind: "dataTableRenderer",
|
|
755
1186
|
projectId: e.projectId,
|
|
756
1187
|
context: { dataTableRendererId: t.id }
|
|
757
|
-
}),
|
|
1188
|
+
}), s = (n, r, i, o, s, c) => U(e, n, {
|
|
758
1189
|
params: {
|
|
759
1190
|
renderer: {
|
|
760
1191
|
rendererId: t.id,
|
|
761
1192
|
...c ? { pageParams: c } : {},
|
|
762
1193
|
projectId: e.projectId,
|
|
763
|
-
...
|
|
1194
|
+
...o ? { modeId: o } : {},
|
|
764
1195
|
...i ? { resource: i } : {},
|
|
765
1196
|
invocation: { placement: "visible" }
|
|
766
1197
|
},
|
|
767
1198
|
...r
|
|
768
1199
|
},
|
|
769
1200
|
resource: i,
|
|
770
|
-
signal:
|
|
771
|
-
slot:
|
|
1201
|
+
signal: s,
|
|
1202
|
+
slot: a,
|
|
772
1203
|
metadata: { dataTableRendererId: t.id }
|
|
773
1204
|
});
|
|
774
1205
|
return e.workbench.views.registerView({
|
|
775
1206
|
id: t.id,
|
|
776
|
-
title:
|
|
1207
|
+
title: G(t.title, t.id),
|
|
777
1208
|
icon: t.icon,
|
|
778
1209
|
body: {
|
|
779
1210
|
kind: "dataTable",
|
|
780
1211
|
resourceKind: t.resourceKind,
|
|
781
|
-
toolbarActions:
|
|
782
|
-
columns: t.columns?.map(
|
|
1212
|
+
toolbarActions: Gt(t),
|
|
1213
|
+
columns: t.columns?.map(Kt),
|
|
783
1214
|
initialPageSize: t.initialPageSize,
|
|
784
1215
|
pageSizeOptions: t.pageSizeOptions,
|
|
785
|
-
defaultSettings:
|
|
1216
|
+
defaultSettings: r.settings,
|
|
786
1217
|
defaultFilter: t.defaultFilter,
|
|
787
1218
|
defaultSorts: t.defaultSorts,
|
|
788
|
-
defaultViews:
|
|
1219
|
+
defaultViews: r.views.map((e) => ({
|
|
789
1220
|
...e,
|
|
790
|
-
title:
|
|
1221
|
+
title: G(e.title, e.id)
|
|
791
1222
|
})),
|
|
792
1223
|
defaultActiveViewId: t.defaultActiveViewId,
|
|
793
1224
|
viewsProvider: n.createViewsProvider?.(t),
|
|
@@ -795,58 +1226,58 @@ var ze = (e) => {
|
|
|
795
1226
|
selectionActions: t.selectionActions?.map((e) => ({
|
|
796
1227
|
id: e.id,
|
|
797
1228
|
commandId: e.commandId,
|
|
798
|
-
label:
|
|
799
|
-
icon: e.icon ?
|
|
1229
|
+
label: G(e.label, e.id),
|
|
1230
|
+
icon: e.icon ? T(v, {
|
|
800
1231
|
name: e.icon,
|
|
801
1232
|
size: 16
|
|
802
1233
|
}) : void 0,
|
|
803
1234
|
destructive: e.destructive,
|
|
804
|
-
run: (t) =>
|
|
1235
|
+
run: (t) => s(e.commandId, { rowIds: t.map((e) => e.id) }).then(() => void 0)
|
|
805
1236
|
})),
|
|
806
|
-
emptyTitle: t.emptyTitle ?
|
|
807
|
-
emptyDescription: t.emptyDescription ?
|
|
808
|
-
executeQuery: async ({ resource: e, modeId: r, filter:
|
|
809
|
-
let d = await
|
|
810
|
-
filter:
|
|
811
|
-
sorts:
|
|
812
|
-
settings:
|
|
1237
|
+
emptyTitle: t.emptyTitle ? G(t.emptyTitle) : void 0,
|
|
1238
|
+
emptyDescription: t.emptyDescription ? G(t.emptyDescription) : void 0,
|
|
1239
|
+
executeQuery: async ({ resource: e, modeId: r, filter: a, sorts: o, settings: c, pageParams: l }, u) => {
|
|
1240
|
+
let d = await s(t.queryHandlerId, {
|
|
1241
|
+
filter: a,
|
|
1242
|
+
sorts: o,
|
|
1243
|
+
settings: c
|
|
813
1244
|
}, e, r, u, l);
|
|
814
|
-
return
|
|
1245
|
+
return qt(d) ? {
|
|
815
1246
|
rows: d.rows.map((e) => {
|
|
816
|
-
let r =
|
|
817
|
-
return n.resolveRowResource && (r.resource = n.resolveRowResource(t, e)),
|
|
1247
|
+
let r = Jt(e);
|
|
1248
|
+
return n.resolveRowResource && (r.resource = n.resolveRowResource(t, e)), i.set(r, e), r;
|
|
818
1249
|
}),
|
|
819
|
-
columns: d.columns?.map(
|
|
1250
|
+
columns: d.columns?.map(Kt)
|
|
820
1251
|
} : { rows: [] };
|
|
821
1252
|
},
|
|
822
1253
|
rowActions: t.rowActions?.map((n) => ({
|
|
823
1254
|
id: n.id,
|
|
824
1255
|
commandId: n.commandId,
|
|
825
|
-
label:
|
|
826
|
-
icon: n.icon ?
|
|
1256
|
+
label: G(n.label, n.id),
|
|
1257
|
+
icon: n.icon ? T(v, {
|
|
827
1258
|
name: n.icon,
|
|
828
1259
|
size: 16
|
|
829
1260
|
}) : void 0,
|
|
830
1261
|
destructive: n.destructive,
|
|
831
1262
|
run: async (r) => {
|
|
832
|
-
await
|
|
1263
|
+
await s(n.commandId, { rowId: r.id }, r.resource), e.workbench.views.refreshView(t.id);
|
|
833
1264
|
}
|
|
834
1265
|
})),
|
|
835
1266
|
onRowActivate: t.rowActivationHandlerId ? async (e) => {
|
|
836
|
-
await
|
|
1267
|
+
await s(t.rowActivationHandlerId, { row: i.get(e) ?? e }, e.resource);
|
|
837
1268
|
} : void 0
|
|
838
1269
|
}
|
|
839
1270
|
});
|
|
840
|
-
},
|
|
841
|
-
let r = t.map((t) =>
|
|
1271
|
+
}, Xt = (e, t, n = {}) => {
|
|
1272
|
+
let r = t.map((t) => Yt(e, t, n));
|
|
842
1273
|
return { dispose() {
|
|
843
1274
|
for (let e = r.length - 1; e >= 0; --e) r[e]?.dispose();
|
|
844
1275
|
} };
|
|
845
|
-
},
|
|
1276
|
+
}, Zt = {
|
|
846
1277
|
first: 0,
|
|
847
1278
|
default: 1,
|
|
848
1279
|
last: 2
|
|
849
|
-
},
|
|
1280
|
+
}, Qt = {
|
|
850
1281
|
commands: [],
|
|
851
1282
|
commandPaletteContributions: [],
|
|
852
1283
|
diagnostics: [],
|
|
@@ -861,23 +1292,26 @@ var ze = (e) => {
|
|
|
861
1292
|
navigationItems: [],
|
|
862
1293
|
navigationTrees: [],
|
|
863
1294
|
statusBarItems: [],
|
|
864
|
-
statuses: [],
|
|
865
1295
|
settingsPanels: [],
|
|
866
1296
|
settingsDefinitions: []
|
|
867
|
-
},
|
|
868
|
-
let { commandId: t, contribution: n, index: r, resolveString: i, slot: a, when: o } = e;
|
|
1297
|
+
}, $t = (e) => `workbench.extension.menu.${e.id}`, en = (e) => `workbench.extension.palette.${e.id}`, tn = (e, t) => Zt[e.placement ?? "default"] * 1e3 + t, nn = (e) => e === void 0 ? "" : te(e) ? e.default ?? e.$l10n : e, rn = (e) => {
|
|
1298
|
+
let { commandId: t, contribution: n, index: r, resolveString: i, slot: a, when: o, disabledWhen: s } = e;
|
|
869
1299
|
return {
|
|
870
1300
|
commandId: t,
|
|
1301
|
+
id: n.id,
|
|
871
1302
|
sourceCommandId: n.commandId,
|
|
872
1303
|
label: i(n.label, n.extensionId),
|
|
873
1304
|
icon: n.icon,
|
|
874
1305
|
group: a.group ?? n.group,
|
|
1306
|
+
resourceGroup: a.resourceGroup,
|
|
875
1307
|
args: n.params,
|
|
876
1308
|
overflowLabel: a.overflowLabel,
|
|
877
|
-
order:
|
|
878
|
-
when: o
|
|
1309
|
+
order: tn(n, r),
|
|
1310
|
+
when: o,
|
|
1311
|
+
disabledWhen: s,
|
|
1312
|
+
disabledReason: i(n.disabledReason, n.extensionId)
|
|
879
1313
|
};
|
|
880
|
-
},
|
|
1314
|
+
}, an = (e) => {
|
|
881
1315
|
let { commandId: t, contribution: n, index: r, resolveString: i } = e;
|
|
882
1316
|
return {
|
|
883
1317
|
commandId: t,
|
|
@@ -886,10 +1320,10 @@ var ze = (e) => {
|
|
|
886
1320
|
icon: n.icon,
|
|
887
1321
|
group: n.group,
|
|
888
1322
|
args: n.params,
|
|
889
|
-
order:
|
|
1323
|
+
order: tn(n, r)
|
|
890
1324
|
};
|
|
891
|
-
},
|
|
892
|
-
let { createCommandId: t =
|
|
1325
|
+
}, on = (e) => {
|
|
1326
|
+
let { createCommandId: t = $t, createWhenExpression: n, menuSlotsById: r, menuTargetsById: i, metadata: a, resolveString: o = nn } = e, s = [], c = [];
|
|
893
1327
|
return a.menuContributions.forEach((e, l) => {
|
|
894
1328
|
let u = e.target ? i?.get(e.target) : r.get(e.slotId);
|
|
895
1329
|
if (!u) {
|
|
@@ -905,18 +1339,23 @@ var ze = (e) => {
|
|
|
905
1339
|
id: d,
|
|
906
1340
|
label: o(e.label, e.extensionId),
|
|
907
1341
|
category: e.group,
|
|
1342
|
+
resourceMutation: f?.resourceMutation,
|
|
908
1343
|
description: f ? o(f.description, f.extensionId) : void 0,
|
|
909
1344
|
icon: e.icon,
|
|
910
|
-
params:
|
|
1345
|
+
params: W(f?.params, (t) => o(t, f?.extensionId ?? e.extensionId), f?.extensionId)
|
|
911
1346
|
},
|
|
912
1347
|
contribution: e,
|
|
913
|
-
menuItem:
|
|
1348
|
+
menuItem: rn({
|
|
914
1349
|
commandId: d,
|
|
915
1350
|
contribution: e,
|
|
916
1351
|
index: l,
|
|
917
1352
|
resolveString: o,
|
|
918
1353
|
slot: u,
|
|
919
|
-
when: n?.(e)
|
|
1354
|
+
when: n?.(e),
|
|
1355
|
+
disabledWhen: e.disabledWhen ? n?.({
|
|
1356
|
+
...e,
|
|
1357
|
+
when: e.disabledWhen
|
|
1358
|
+
}) : void 0
|
|
920
1359
|
}),
|
|
921
1360
|
menuPath: u.menuPath,
|
|
922
1361
|
targetCommandId: e.commandId
|
|
@@ -925,8 +1364,8 @@ var ze = (e) => {
|
|
|
925
1364
|
registrations: s,
|
|
926
1365
|
unresolved: c
|
|
927
1366
|
};
|
|
928
|
-
},
|
|
929
|
-
let { createCommandId: t =
|
|
1367
|
+
}, sn = (e) => {
|
|
1368
|
+
let { createCommandId: t = en, metadata: n, resolveString: r = nn } = e, i = [];
|
|
930
1369
|
return (n.commandPaletteContributions ?? []).forEach((e, a) => {
|
|
931
1370
|
let o = t(e), s = n.commands.find((t) => t.id === e.commandId);
|
|
932
1371
|
i.push({
|
|
@@ -936,10 +1375,10 @@ var ze = (e) => {
|
|
|
936
1375
|
category: e.group,
|
|
937
1376
|
description: s ? r(s.description, s.extensionId) : void 0,
|
|
938
1377
|
icon: e.icon,
|
|
939
|
-
params:
|
|
1378
|
+
params: W(s?.params, (t) => r(t, s?.extensionId ?? e.extensionId), s?.extensionId)
|
|
940
1379
|
},
|
|
941
1380
|
contribution: e,
|
|
942
|
-
menuItem:
|
|
1381
|
+
menuItem: an({
|
|
943
1382
|
commandId: o,
|
|
944
1383
|
contribution: e,
|
|
945
1384
|
index: a,
|
|
@@ -948,7 +1387,7 @@ var ze = (e) => {
|
|
|
948
1387
|
targetCommandId: e.commandId
|
|
949
1388
|
});
|
|
950
1389
|
}), i;
|
|
951
|
-
},
|
|
1390
|
+
}, cn = (e) => ({
|
|
952
1391
|
id: e.rendererId,
|
|
953
1392
|
kind: "renderer",
|
|
954
1393
|
context: {
|
|
@@ -958,9 +1397,9 @@ var ze = (e) => {
|
|
|
958
1397
|
resourceId: e.resource.id
|
|
959
1398
|
} : {}
|
|
960
1399
|
}
|
|
961
|
-
}),
|
|
1400
|
+
}), ln = async (e, t, n, r, i = {}, a, o, s) => {
|
|
962
1401
|
let c = r;
|
|
963
|
-
return
|
|
1402
|
+
return H(e, n, {
|
|
964
1403
|
params: {
|
|
965
1404
|
renderer: {
|
|
966
1405
|
rendererId: t,
|
|
@@ -973,23 +1412,23 @@ var ze = (e) => {
|
|
|
973
1412
|
},
|
|
974
1413
|
resource: c,
|
|
975
1414
|
signal: o,
|
|
976
|
-
slot:
|
|
1415
|
+
slot: cn({
|
|
977
1416
|
projectId: e.projectId,
|
|
978
1417
|
rendererId: t,
|
|
979
1418
|
resource: c
|
|
980
1419
|
}),
|
|
981
1420
|
...a ? { metadata: a } : {}
|
|
982
1421
|
});
|
|
983
|
-
},
|
|
1422
|
+
}, un = (e) => {
|
|
984
1423
|
if (!e || typeof e != "object") return;
|
|
985
1424
|
let t = e.revision;
|
|
986
1425
|
return typeof t == "string" ? t : void 0;
|
|
987
|
-
},
|
|
1426
|
+
}, dn = (e, t) => {
|
|
988
1427
|
let n = e.metadata, r = n?.fileRendererOrigin;
|
|
989
1428
|
if (!r || typeof r != "object") return;
|
|
990
1429
|
let i = r;
|
|
991
1430
|
if (typeof i.rendererId != "string" || typeof i.instanceId != "string" || typeof i.operationId != "string") return;
|
|
992
|
-
let a = n?.fileRendererResourceKey, o =
|
|
1431
|
+
let a = n?.fileRendererResourceKey, o = t.outcome.ok ? un(t.outcome.value) : void 0;
|
|
993
1432
|
return {
|
|
994
1433
|
origin: {
|
|
995
1434
|
rendererId: i.rendererId,
|
|
@@ -999,38 +1438,42 @@ var ze = (e) => {
|
|
|
999
1438
|
...typeof a == "string" ? { resourceKey: a } : {},
|
|
1000
1439
|
...o ? { revision: o } : {}
|
|
1001
1440
|
};
|
|
1002
|
-
},
|
|
1441
|
+
}, fn = (e, t) => e.workbench.views.registerView({
|
|
1003
1442
|
id: t.id,
|
|
1004
|
-
title:
|
|
1443
|
+
title: z(t.title, t.id),
|
|
1005
1444
|
icon: t.icon,
|
|
1006
1445
|
body: {
|
|
1007
1446
|
kind: "file",
|
|
1008
1447
|
resourceKind: t.resourceKind,
|
|
1009
|
-
load: async (n, r, i) =>
|
|
1010
|
-
|
|
1011
|
-
|
|
1448
|
+
load: async (n, r, i) => {
|
|
1449
|
+
let a = await ln(e, t.id, t.loadHandlerId, n, {}, { fileStorageVersions: {} }, r, i);
|
|
1450
|
+
return _(B(a) ?? {}, a);
|
|
1451
|
+
},
|
|
1452
|
+
save: t.saveHandlerId ? async (n, r, i, a) => {
|
|
1453
|
+
let o = await ln(e, t.id, t.saveHandlerId, n, { content: r }, {
|
|
1454
|
+
fileStorageVersions: y(a),
|
|
1012
1455
|
...i ? { fileRendererOrigin: i } : {},
|
|
1013
|
-
...
|
|
1014
|
-
}));
|
|
1015
|
-
return
|
|
1456
|
+
...w(n) ? { fileRendererResourceKey: w(n) } : {}
|
|
1457
|
+
}), s = un(B(o));
|
|
1458
|
+
return _(s ? { revision: s } : {}, o);
|
|
1016
1459
|
} : void 0
|
|
1017
1460
|
}
|
|
1018
|
-
}),
|
|
1461
|
+
}), pn = (e) => {
|
|
1019
1462
|
let t = [];
|
|
1020
|
-
for (let n of e.metadata.fileRenderers ?? []) t.push(
|
|
1463
|
+
for (let n of e.metadata.fileRenderers ?? []) t.push(fn(e, n));
|
|
1021
1464
|
return { dispose() {
|
|
1022
1465
|
for (let e = t.length - 1; e >= 0; --e) t[e]?.dispose();
|
|
1023
1466
|
} };
|
|
1024
|
-
},
|
|
1467
|
+
}, mn = (e, t, n, r, i) => {
|
|
1025
1468
|
let a = e.attributes[t]?.find((e) => e.id === n);
|
|
1026
|
-
return a?.target ?
|
|
1469
|
+
return a?.target ? R(a.target, {
|
|
1027
1470
|
extensionId: r,
|
|
1028
1471
|
projectId: i
|
|
1029
1472
|
}) : void 0;
|
|
1030
|
-
},
|
|
1473
|
+
}, hn = (e) => (t) => T(v, {
|
|
1031
1474
|
name: e ?? "MoreHorizontal",
|
|
1032
1475
|
...t
|
|
1033
|
-
}),
|
|
1476
|
+
}), gn = (e, t) => ({
|
|
1034
1477
|
color: e?.color,
|
|
1035
1478
|
canDragIn: e?.canDragIn,
|
|
1036
1479
|
canDragOut: e?.canDragOut,
|
|
@@ -1038,41 +1481,17 @@ var ze = (e) => {
|
|
|
1038
1481
|
actions: e?.actions?.map((e) => ({
|
|
1039
1482
|
id: e.id,
|
|
1040
1483
|
label: t(e.label, e.id),
|
|
1041
|
-
icon:
|
|
1484
|
+
icon: hn(e.icon)
|
|
1042
1485
|
}))
|
|
1043
|
-
}),
|
|
1044
|
-
let
|
|
1045
|
-
return (r) => {
|
|
1046
|
-
let i = xt(t, r), a = n.get(i);
|
|
1047
|
-
if (a) return a;
|
|
1048
|
-
let o = {
|
|
1049
|
-
getSnapshot: () => (e.workbench.statuses.getStatuses(i) ?? []).map((e) => ({
|
|
1050
|
-
value: e.id,
|
|
1051
|
-
label: e.label,
|
|
1052
|
-
color: e.color,
|
|
1053
|
-
icon: e.icon
|
|
1054
|
-
})),
|
|
1055
|
-
subscribe: (t) => e.workbench.statuses.store.subscribeSelector((e) => e.values[i], t)
|
|
1056
|
-
};
|
|
1057
|
-
return n.set(i, o), e.workbench.statuses.load(i).catch(() => void 0), o;
|
|
1058
|
-
};
|
|
1059
|
-
}, Ct = (e, t, n, r, i) => {
|
|
1060
|
-
let a = n?.find((e) => e.id === r);
|
|
1061
|
-
if (a?.type.kind !== "status") return;
|
|
1062
|
-
let o = xt(t, a.type.statuses), s = e.workbench.statuses.getStatuses(o)?.find((e) => e.id === i);
|
|
1063
|
-
return s ? { color: s.color } : void 0;
|
|
1064
|
-
}, H = (e) => typeof e == "object" && !!e && !Array.isArray(e), wt = (e, t, n, r, i, a) => (t ?? []).map((t) => {
|
|
1065
|
-
let o = t.display, s = o?.kind === "badge-list" && typeof o.itemsAttributeId == "string" ? {
|
|
1486
|
+
}), _n = (e) => typeof e == "object" && !!e && !Array.isArray(e), vn = (e, t, n, r, i) => (t ?? []).map((t) => {
|
|
1487
|
+
let a = t.display, o = a?.kind === "badge-list" && typeof a.itemsAttributeId == "string" ? {
|
|
1066
1488
|
kind: "badge-list",
|
|
1067
|
-
itemsAttributeId:
|
|
1489
|
+
itemsAttributeId: a.itemsAttributeId
|
|
1068
1490
|
} : void 0;
|
|
1069
|
-
|
|
1070
|
-
let
|
|
1491
|
+
a && !o && i?.(t.id, a.kind);
|
|
1492
|
+
let s = () => {
|
|
1071
1493
|
let { type: e } = t;
|
|
1072
|
-
return e.kind
|
|
1073
|
-
kind: "enum",
|
|
1074
|
-
options: i(e.statuses)
|
|
1075
|
-
} : e.kind !== "enum" && e.kind !== "enum-multi" ? e : {
|
|
1494
|
+
return e.kind !== "enum" && e.kind !== "enum-multi" ? e : {
|
|
1076
1495
|
...e,
|
|
1077
1496
|
options: Array.isArray(e.options) ? e.options.map((e) => ({
|
|
1078
1497
|
...e,
|
|
@@ -1083,42 +1502,42 @@ var ze = (e) => {
|
|
|
1083
1502
|
return r(e, {
|
|
1084
1503
|
...t,
|
|
1085
1504
|
label: n(t.label, t.id),
|
|
1086
|
-
type:
|
|
1087
|
-
display:
|
|
1505
|
+
type: s(),
|
|
1506
|
+
display: o
|
|
1088
1507
|
});
|
|
1089
|
-
}),
|
|
1090
|
-
let
|
|
1508
|
+
}), yn = (e, t, n, r, i) => {
|
|
1509
|
+
let a = vn(e, t, n, r, i), o = /* @__PURE__ */ new Set(), s = JSON.stringify(t);
|
|
1091
1510
|
return {
|
|
1092
1511
|
source: {
|
|
1093
|
-
getSnapshot: () =>
|
|
1094
|
-
subscribe: (e) => (
|
|
1512
|
+
getSnapshot: () => a,
|
|
1513
|
+
subscribe: (e) => (o.add(e), () => o.delete(e))
|
|
1095
1514
|
},
|
|
1096
1515
|
set(t) {
|
|
1097
|
-
let
|
|
1098
|
-
if (
|
|
1099
|
-
|
|
1100
|
-
for (let e of
|
|
1516
|
+
let c = JSON.stringify(t);
|
|
1517
|
+
if (c !== s) {
|
|
1518
|
+
s = c, a = vn(e, t, n, r, i);
|
|
1519
|
+
for (let e of o) e();
|
|
1101
1520
|
}
|
|
1102
1521
|
}
|
|
1103
1522
|
};
|
|
1104
|
-
},
|
|
1523
|
+
}, bn = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), xn = (e, t) => {
|
|
1105
1524
|
let { resource: n } = t;
|
|
1106
|
-
if (
|
|
1107
|
-
},
|
|
1108
|
-
let n =
|
|
1525
|
+
if (bn(n)) return n;
|
|
1526
|
+
}, Sn = (e, t) => {
|
|
1527
|
+
let n = xn(e, t);
|
|
1109
1528
|
if (n) return n;
|
|
1110
1529
|
if (e.resourceKind) return {
|
|
1111
1530
|
type: e.resourceKind,
|
|
1112
1531
|
id: t.id,
|
|
1113
1532
|
label: t.title
|
|
1114
1533
|
};
|
|
1115
|
-
},
|
|
1534
|
+
}, Cn = (e, t) => {
|
|
1116
1535
|
let n = e, r = t(n);
|
|
1117
1536
|
return r === void 0 ? n : {
|
|
1118
1537
|
...n,
|
|
1119
1538
|
resource: r
|
|
1120
1539
|
};
|
|
1121
|
-
},
|
|
1540
|
+
}, wn = (...e) => Object.assign({}, ...e.filter((e) => !!e)), Tn = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, En = (e) => Object.keys(e ?? {}).length > 0, Dn = /* @__PURE__ */ new Set([
|
|
1122
1541
|
"text",
|
|
1123
1542
|
"longtext",
|
|
1124
1543
|
"markdown",
|
|
@@ -1127,8 +1546,8 @@ var ze = (e) => {
|
|
|
1127
1546
|
"select",
|
|
1128
1547
|
"multi-select",
|
|
1129
1548
|
"files"
|
|
1130
|
-
]),
|
|
1131
|
-
if (!
|
|
1549
|
+
]), On = (e, t, n) => {
|
|
1550
|
+
if (!Dn.has(t.type)) return;
|
|
1132
1551
|
let r = "options" in t && Array.isArray(t.options) ? t.options : [], i = t;
|
|
1133
1552
|
return {
|
|
1134
1553
|
id: e,
|
|
@@ -1146,17 +1565,17 @@ var ze = (e) => {
|
|
|
1146
1565
|
multiple: t.type === "files" ? i.multiple !== !1 : void 0,
|
|
1147
1566
|
accept: t.type === "files" && typeof i.accept == "string" ? i.accept : void 0
|
|
1148
1567
|
};
|
|
1149
|
-
},
|
|
1150
|
-
let r =
|
|
1568
|
+
}, kn = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([e, n]) => {
|
|
1569
|
+
let r = On(e, n, t);
|
|
1151
1570
|
return r ? [r] : [];
|
|
1152
|
-
}),
|
|
1571
|
+
}), An = (e, t) => V({
|
|
1153
1572
|
id: t.id,
|
|
1154
1573
|
kind: "kanbanRenderer",
|
|
1155
1574
|
projectId: e.projectId,
|
|
1156
1575
|
context: { kanbanRendererId: t.id }
|
|
1157
|
-
}),
|
|
1576
|
+
}), K = (e, t, n, r, i, a, o) => {
|
|
1158
1577
|
let s = i ?? e.workbench.getPrimaryResource();
|
|
1159
|
-
return
|
|
1578
|
+
return U(e, n, {
|
|
1160
1579
|
params: {
|
|
1161
1580
|
renderer: {
|
|
1162
1581
|
rendererId: t.id,
|
|
@@ -1169,33 +1588,33 @@ var ze = (e) => {
|
|
|
1169
1588
|
},
|
|
1170
1589
|
resource: s,
|
|
1171
1590
|
signal: a,
|
|
1172
|
-
slot:
|
|
1591
|
+
slot: An(e, t),
|
|
1173
1592
|
metadata: { kanbanRendererId: t.id }
|
|
1174
1593
|
});
|
|
1175
|
-
},
|
|
1594
|
+
}, jn = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, Mn = (e, t, n) => (t.rowActions ?? []).map((r) => {
|
|
1176
1595
|
let i = e.workbench.commands.getCommand(r.commandId)?.command;
|
|
1177
1596
|
return e.workbench.commands.registerCommand({
|
|
1178
|
-
id:
|
|
1597
|
+
id: jn(t, r),
|
|
1179
1598
|
label: n(r.label, r.id),
|
|
1180
1599
|
icon: r.icon,
|
|
1181
1600
|
params: i?.params
|
|
1182
|
-
}, { execute: (n, i) =>
|
|
1183
|
-
}),
|
|
1184
|
-
let o =
|
|
1185
|
-
return s &&
|
|
1601
|
+
}, { execute: (n, i) => K(e, t, r.commandId, wn(Tn(n)), i?.resource) });
|
|
1602
|
+
}), Nn = (e, t, n, r, i, a) => {
|
|
1603
|
+
let o = jn(t, n), s = e.workbench.commands.getCommand(o), c = { rowId: r.id }, l = i ? { resource: i } : void 0, u = a(n.label, n.id);
|
|
1604
|
+
return s && En(s.command.params) ? (e.workbench.commandPalette.requestParams({
|
|
1186
1605
|
record: s,
|
|
1187
1606
|
label: u,
|
|
1188
1607
|
args: c,
|
|
1189
1608
|
context: l
|
|
1190
|
-
}), Promise.resolve()) : s ? e.workbench.commands.executeCommand(s.command.id, c, l).then(() => void 0) :
|
|
1191
|
-
},
|
|
1609
|
+
}), Promise.resolve()) : s ? e.workbench.commands.executeCommand(s.command.id, c, l).then(() => void 0) : K(e, t, n.commandId, c, i).then(() => void 0);
|
|
1610
|
+
}, Pn = (e) => e ? T(v, {
|
|
1192
1611
|
name: e,
|
|
1193
1612
|
size: 16
|
|
1194
|
-
}) : void 0,
|
|
1613
|
+
}) : void 0, Fn = (e, t) => {
|
|
1195
1614
|
if (e.createRow) return {
|
|
1196
1615
|
title: t(e.createRow.title, "Create row"),
|
|
1197
1616
|
submitLabel: t(e.createRow.submitLabel, "Create"),
|
|
1198
|
-
fields:
|
|
1617
|
+
fields: kn(e, t),
|
|
1199
1618
|
labels: {
|
|
1200
1619
|
cancel: t(e.createRow.labels?.cancel, "Cancel"),
|
|
1201
1620
|
properties: t(e.createRow.labels?.properties, "Properties"),
|
|
@@ -1204,20 +1623,20 @@ var ze = (e) => {
|
|
|
1204
1623
|
submitWithoutOpening: t(void 0, "Create without opening")
|
|
1205
1624
|
}
|
|
1206
1625
|
};
|
|
1207
|
-
},
|
|
1626
|
+
}, In = (e, t, n, r, i) => {
|
|
1208
1627
|
if (t.rowActivationHandlerId) return async (n) => {
|
|
1209
1628
|
let a = r(t, n);
|
|
1210
|
-
await
|
|
1629
|
+
await K(e, t, t.rowActivationHandlerId, { row: i(n) }, a);
|
|
1211
1630
|
};
|
|
1212
1631
|
if (n.onRowClick) return (e) => n.onRowClick?.({
|
|
1213
1632
|
record: t,
|
|
1214
1633
|
row: e,
|
|
1215
1634
|
resource: r(t, e)
|
|
1216
1635
|
});
|
|
1217
|
-
},
|
|
1636
|
+
}, Ln = (e, t, n, r) => {
|
|
1218
1637
|
let i = e.createRow;
|
|
1219
1638
|
if (i) return async (a) => {
|
|
1220
|
-
let o =
|
|
1639
|
+
let o = wn(a.values, i.columnParam ? { [i.columnParam]: a.columnId } : void 0, i.attributesParam ? { [i.attributesParam]: a.attributeValues } : void 0), s = await n(e, i.commandId, o);
|
|
1221
1640
|
if (await t.onAfterCreate?.({
|
|
1222
1641
|
record: e,
|
|
1223
1642
|
created: s,
|
|
@@ -1231,15 +1650,15 @@ var ze = (e) => {
|
|
|
1231
1650
|
attributes: c.attributes ?? {}
|
|
1232
1651
|
});
|
|
1233
1652
|
};
|
|
1234
|
-
},
|
|
1653
|
+
}, Rn = (e, t, n, r, i) => {
|
|
1235
1654
|
let a = t.rowActions;
|
|
1236
1655
|
if (a?.length) return (o) => a.map((a) => {
|
|
1237
|
-
let s = i(t, o), c = () =>
|
|
1656
|
+
let s = i(t, o), c = () => Nn(e, t, a, o, s, r);
|
|
1238
1657
|
return {
|
|
1239
1658
|
key: a.id,
|
|
1240
1659
|
label: r(a.label, a.id),
|
|
1241
1660
|
commandId: a.commandId,
|
|
1242
|
-
icon:
|
|
1661
|
+
icon: Pn(a.icon),
|
|
1243
1662
|
onClick: () => n.executeRowAction ? n.executeRowAction({
|
|
1244
1663
|
record: t,
|
|
1245
1664
|
action: a,
|
|
@@ -1249,107 +1668,99 @@ var ze = (e) => {
|
|
|
1249
1668
|
}) : c()
|
|
1250
1669
|
};
|
|
1251
1670
|
});
|
|
1252
|
-
},
|
|
1253
|
-
let r = [], i = n.resolveLabel ?? ((e, t) =>
|
|
1671
|
+
}, zn = (e, t, n = {}) => {
|
|
1672
|
+
let r = [], i = n.resolveLabel ?? ((e, t) => z(e, t)), a = (t, r) => {
|
|
1254
1673
|
let i = r.display?.kind === "badge-list" ? {
|
|
1255
1674
|
...r,
|
|
1256
|
-
render: (n, i) =>
|
|
1675
|
+
render: (n, i) => de(r, n, i, void 0, (n) => {
|
|
1257
1676
|
if (r.display?.kind !== "badge-list") return;
|
|
1258
|
-
let a =
|
|
1677
|
+
let a = mn(i, r.display.itemsAttributeId, n, t.extensionId, e.projectId);
|
|
1259
1678
|
return a ? () => {
|
|
1260
1679
|
e.workbench.navigation.openTarget(a);
|
|
1261
1680
|
} : void 0;
|
|
1262
1681
|
})
|
|
1263
1682
|
} : r;
|
|
1264
1683
|
return n.decorateAttribute?.(t, i) ?? i;
|
|
1265
|
-
},
|
|
1266
|
-
for (let
|
|
1267
|
-
let t =
|
|
1268
|
-
id: `workbench.extension.${
|
|
1684
|
+
}, o = n.resolveRowResource ?? xn, s = n.resolveRowActionResource ?? Sn, c = n.onAfterMutation ?? (() => {}), l = (t, n, r) => K(e, t, n, r).then((e) => (c(t), e));
|
|
1685
|
+
for (let c of t) {
|
|
1686
|
+
let t = yn(c, c.attributes, i, a, (t, n) => e.workbench.notifications.show({
|
|
1687
|
+
id: `workbench.extension.${c.extensionId}.kanban.${c.id}.display.${t}`,
|
|
1269
1688
|
level: "error",
|
|
1270
1689
|
title: "Extension display is not available",
|
|
1271
|
-
message: `Attribute "${t}" in renderer "${
|
|
1272
|
-
})),
|
|
1273
|
-
r.push(...
|
|
1274
|
-
id:
|
|
1275
|
-
title: i(
|
|
1276
|
-
icon:
|
|
1690
|
+
message: `Attribute "${t}" in renderer "${c.id}" uses unknown display kind "${n}".`
|
|
1691
|
+
})), d = c.attributes, f = u(c), p = /* @__PURE__ */ new WeakMap(), m, h = 0, g = /* @__PURE__ */ new Map(), _ = (e) => o(c, e), v = In(e, c, n, o, (e) => p.get(e) ?? e);
|
|
1692
|
+
r.push(...Mn(e, c, i)), r.push(e.workbench.views.registerView({
|
|
1693
|
+
id: c.id,
|
|
1694
|
+
title: i(c.title, c.id),
|
|
1695
|
+
icon: c.icon,
|
|
1277
1696
|
body: {
|
|
1278
1697
|
kind: "kanban",
|
|
1279
|
-
resourceKind:
|
|
1280
|
-
toolbarActions:
|
|
1281
|
-
listRowActions: () => (
|
|
1698
|
+
resourceKind: c.resourceKind,
|
|
1699
|
+
toolbarActions: Gt(c),
|
|
1700
|
+
listRowActions: () => (c.rowActions ?? []).map((e) => ({
|
|
1282
1701
|
commandId: e.commandId,
|
|
1283
1702
|
label: i(e.label, e.id)
|
|
1284
1703
|
})),
|
|
1285
1704
|
storageScope: e.projectId,
|
|
1286
|
-
attributes:
|
|
1287
|
-
defaultSettings:
|
|
1288
|
-
defaultFilter:
|
|
1289
|
-
defaultSorts:
|
|
1290
|
-
viewsProvider: n.createViewsProvider?.(
|
|
1291
|
-
defaultViews:
|
|
1705
|
+
attributes: t.source,
|
|
1706
|
+
defaultSettings: f.settings,
|
|
1707
|
+
defaultFilter: c.defaultFilter,
|
|
1708
|
+
defaultSorts: c.defaultSorts,
|
|
1709
|
+
viewsProvider: n.createViewsProvider?.(c),
|
|
1710
|
+
defaultViews: f.views.map((e) => ({
|
|
1292
1711
|
...e,
|
|
1293
1712
|
title: i(e.title, e.id)
|
|
1294
1713
|
})),
|
|
1295
|
-
defaultActiveViewId:
|
|
1296
|
-
emptyTitle: i(
|
|
1297
|
-
emptyDescription: i(
|
|
1298
|
-
hideToolbar:
|
|
1299
|
-
createRow:
|
|
1300
|
-
getBoardColumnConfig: (
|
|
1301
|
-
onRowActivate:
|
|
1302
|
-
executeQuery: async (
|
|
1303
|
-
|
|
1304
|
-
let
|
|
1305
|
-
settings:
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
filter: t.filter,
|
|
1310
|
-
sorts: t.sorts,
|
|
1311
|
-
filters: A(t.filter)
|
|
1312
|
-
}, void 0, n, t.pageParams), a = (e) => {
|
|
1714
|
+
defaultActiveViewId: c.defaultActiveViewId,
|
|
1715
|
+
emptyTitle: i(c.emptyTitle, ""),
|
|
1716
|
+
emptyDescription: i(c.emptyDescription, ""),
|
|
1717
|
+
hideToolbar: c.hideToolbar,
|
|
1718
|
+
createRow: Fn(c, i),
|
|
1719
|
+
getBoardColumnConfig: (e) => gn(m?.[e], i),
|
|
1720
|
+
onRowActivate: v,
|
|
1721
|
+
executeQuery: async (n, r) => {
|
|
1722
|
+
h += 1;
|
|
1723
|
+
let i = h, a = await K(e, c, c.queryHandlerId, {
|
|
1724
|
+
settings: n.settings,
|
|
1725
|
+
filter: n.filter,
|
|
1726
|
+
sorts: n.sorts
|
|
1727
|
+
}, void 0, r, n.pageParams), o = (e) => {
|
|
1313
1728
|
let t = /* @__PURE__ */ new Map(), n = e.map((e) => {
|
|
1314
|
-
let n = e, r = JSON.stringify(e), i =
|
|
1315
|
-
return
|
|
1729
|
+
let n = e, r = JSON.stringify(e), i = g.get(n.id), a = i?.signature === r ? i.row : Cn(e, _);
|
|
1730
|
+
return p.set(a, n), t.set(a.id, {
|
|
1316
1731
|
signature: r,
|
|
1317
1732
|
row: a
|
|
1318
1733
|
}), a;
|
|
1319
1734
|
});
|
|
1320
|
-
return
|
|
1735
|
+
return i === h && (g = t), n;
|
|
1321
1736
|
};
|
|
1322
|
-
if (
|
|
1323
|
-
if (
|
|
1324
|
-
if (!
|
|
1325
|
-
let
|
|
1326
|
-
return
|
|
1737
|
+
if (i !== h) return Array.isArray(a) ? o(a) : _n(a) ? o(a.rows ?? []) : [];
|
|
1738
|
+
if (Array.isArray(a)) return o(a);
|
|
1739
|
+
if (!_n(a)) return [];
|
|
1740
|
+
let s = a.attributes ?? d;
|
|
1741
|
+
return d = s, t.set(s), m = a.boardColumnConfigs, o(a.rows ?? []);
|
|
1327
1742
|
},
|
|
1328
|
-
onAttributeChange:
|
|
1743
|
+
onAttributeChange: c.attributeChangeHandlerId ? (e, t, n) => l(c, c.attributeChangeHandlerId, {
|
|
1329
1744
|
rowId: e,
|
|
1330
1745
|
attributeId: t,
|
|
1331
1746
|
value: n
|
|
1332
1747
|
}).then(() => void 0) : void 0,
|
|
1333
|
-
onMove:
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
}).then(() => void 0) : void 0,
|
|
1338
|
-
onCreateRow: Ut(l, n, u, l.rowActivationHandlerId ? b : void 0),
|
|
1339
|
-
onColumnAction: l.columnActionHandlerId ? async (e, t) => {
|
|
1340
|
-
await u(l, l.columnActionHandlerId, {
|
|
1748
|
+
onMove: c.moveHandlerId ? (e) => l(c, c.moveHandlerId, { ...e }).then(() => void 0) : void 0,
|
|
1749
|
+
onCreateRow: Ln(c, n, l, c.rowActivationHandlerId ? v : void 0),
|
|
1750
|
+
onColumnAction: c.columnActionHandlerId ? async (e, t) => {
|
|
1751
|
+
await l(c, c.columnActionHandlerId, {
|
|
1341
1752
|
columnId: e,
|
|
1342
1753
|
actionId: t
|
|
1343
1754
|
});
|
|
1344
1755
|
} : void 0,
|
|
1345
|
-
getRowContextMenuActions:
|
|
1756
|
+
getRowContextMenuActions: Rn(e, c, n, i, s)
|
|
1346
1757
|
}
|
|
1347
1758
|
}));
|
|
1348
1759
|
}
|
|
1349
1760
|
return { dispose() {
|
|
1350
1761
|
for (let e = r.length - 1; e >= 0; --e) r[e]?.dispose();
|
|
1351
1762
|
} };
|
|
1352
|
-
},
|
|
1763
|
+
}, Bn = (e) => ({
|
|
1353
1764
|
id: e.treeId,
|
|
1354
1765
|
kind: "renderer",
|
|
1355
1766
|
context: {
|
|
@@ -1361,7 +1772,7 @@ var ze = (e) => {
|
|
|
1361
1772
|
resourceId: e.resource.id
|
|
1362
1773
|
} : {}
|
|
1363
1774
|
}
|
|
1364
|
-
}),
|
|
1775
|
+
}), q = (e, t, n, r) => {
|
|
1365
1776
|
let i = n.resource, a = e.workbench.modes.getActiveModeId();
|
|
1366
1777
|
return {
|
|
1367
1778
|
renderer: {
|
|
@@ -1376,22 +1787,22 @@ var ze = (e) => {
|
|
|
1376
1787
|
...n.filter ? { filter: n.filter } : {},
|
|
1377
1788
|
...r ? { node: r } : {}
|
|
1378
1789
|
};
|
|
1379
|
-
},
|
|
1790
|
+
}, J = async (e, t, n, r, i) => {
|
|
1380
1791
|
let a = r.renderer, o = a?.resource;
|
|
1381
|
-
return
|
|
1792
|
+
return U(e, n, {
|
|
1382
1793
|
params: r,
|
|
1383
1794
|
signal: i,
|
|
1384
1795
|
resource: o,
|
|
1385
|
-
slot:
|
|
1796
|
+
slot: Bn({
|
|
1386
1797
|
modeId: a?.modeId,
|
|
1387
1798
|
projectId: e.projectId,
|
|
1388
1799
|
resource: o,
|
|
1389
1800
|
treeId: t.id
|
|
1390
1801
|
})
|
|
1391
1802
|
});
|
|
1392
|
-
},
|
|
1803
|
+
}, Vn = async (e, t, n, r, i) => {
|
|
1393
1804
|
let a = e.workbench.modes.getActiveModeId();
|
|
1394
|
-
return
|
|
1805
|
+
return U(e, n, {
|
|
1395
1806
|
params: {
|
|
1396
1807
|
...r ?? {},
|
|
1397
1808
|
renderer: {
|
|
@@ -1403,7 +1814,7 @@ var ze = (e) => {
|
|
|
1403
1814
|
}
|
|
1404
1815
|
},
|
|
1405
1816
|
resource: i,
|
|
1406
|
-
slot:
|
|
1817
|
+
slot: Bn({
|
|
1407
1818
|
modeId: a,
|
|
1408
1819
|
projectId: e.projectId,
|
|
1409
1820
|
resource: i,
|
|
@@ -1411,28 +1822,28 @@ var ze = (e) => {
|
|
|
1411
1822
|
}),
|
|
1412
1823
|
metadata: { treeId: t.id }
|
|
1413
1824
|
});
|
|
1414
|
-
},
|
|
1415
|
-
let { ctx: t, getHostTreeHeaderNodes: n, record: r, treeViews: i } = e, a =
|
|
1825
|
+
}, Hn = (e, t) => e.panels.flatMap((e) => [e, ...e.panelMenus ?? []]).filter((e) => e.renderer?.kind === "tree" && e.renderer.id === t.id), Un = (e, t) => t.viewId ? e.find((e) => e.id === t.viewId) : e.length === 1 ? e[0] : void 0, Wn = async (e) => {
|
|
1826
|
+
let { ctx: t, getHostTreeHeaderNodes: n, record: r, treeViews: i } = e, a = Un(i, t);
|
|
1416
1827
|
return !a || !("hostTreeHeader" in a) || a.hostTreeHeader !== "default" ? [] : await n?.({
|
|
1417
1828
|
ctx: t,
|
|
1418
1829
|
record: r,
|
|
1419
1830
|
panel: a
|
|
1420
1831
|
}) ?? [];
|
|
1421
|
-
},
|
|
1422
|
-
let { ctx: t, getHostTreeFooterNodes: n, record: r, treeViews: i } = e, a =
|
|
1832
|
+
}, Gn = async (e) => {
|
|
1833
|
+
let { ctx: t, getHostTreeFooterNodes: n, record: r, treeViews: i } = e, a = Un(i, t);
|
|
1423
1834
|
return !a || !("hostTreeFooter" in a) || a.hostTreeFooter !== "default" ? [] : await n?.({
|
|
1424
1835
|
ctx: t,
|
|
1425
1836
|
record: r,
|
|
1426
1837
|
panel: a
|
|
1427
1838
|
}) ?? [];
|
|
1428
|
-
},
|
|
1839
|
+
}, Kn = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, qn = (e) => e && !Array.isArray(e) ? e : void 0, Jn = (e, t) => {
|
|
1429
1840
|
let n = /* @__PURE__ */ new WeakMap(), r = `workbench.extensionTreeRenderer.${t.id}.command`, i = (t) => e.resolveNodeResource?.(t) ?? t, a = (e) => {
|
|
1430
1841
|
if (e.emptyState) return {
|
|
1431
|
-
title:
|
|
1432
|
-
description:
|
|
1842
|
+
title: z(e.emptyState.title),
|
|
1843
|
+
description: z(e.emptyState.description),
|
|
1433
1844
|
icon: e.emptyState.icon
|
|
1434
1845
|
};
|
|
1435
|
-
}, o = (n, i, a) => n ?
|
|
1846
|
+
}, o = (n, i, a) => n ? R(n, {
|
|
1436
1847
|
commandTargetOf: (e) => ({
|
|
1437
1848
|
kind: "command",
|
|
1438
1849
|
commandId: r,
|
|
@@ -1447,34 +1858,34 @@ var ze = (e) => {
|
|
|
1447
1858
|
extensionId: t.extensionId,
|
|
1448
1859
|
projectId: e.projectId
|
|
1449
1860
|
}) : void 0, s = (n, r, i) => {
|
|
1450
|
-
let a = n.command ?
|
|
1861
|
+
let a = n.command ? S({
|
|
1451
1862
|
...n.command,
|
|
1452
1863
|
extensionId: n.command.extensionId ?? t.extensionId
|
|
1453
1864
|
}) : void 0;
|
|
1454
1865
|
return {
|
|
1455
1866
|
id: n.id,
|
|
1456
1867
|
resourceMutation: e.metadata.commands.find((e) => e.id === a)?.resourceMutation,
|
|
1457
|
-
label:
|
|
1868
|
+
label: z(n.label),
|
|
1458
1869
|
icon: n.icon,
|
|
1459
|
-
args:
|
|
1460
|
-
params:
|
|
1870
|
+
args: qn(n.params),
|
|
1871
|
+
params: W(n.input, z, t.extensionId),
|
|
1461
1872
|
submitLabel: n.submitLabel,
|
|
1462
1873
|
when: n.when,
|
|
1463
1874
|
disabled: n.disabled,
|
|
1464
1875
|
run: a ? async (o) => {
|
|
1465
|
-
let s =
|
|
1876
|
+
let s = Kn(o, qn(n.params));
|
|
1466
1877
|
if (n.command?.extensionId === "pstdio") {
|
|
1467
1878
|
await e.workbench.commands.executeCommand(a, s, { resource: r?.resource ?? i.resource });
|
|
1468
1879
|
return;
|
|
1469
1880
|
}
|
|
1470
|
-
await
|
|
1881
|
+
await Vn(e, t, a, s, r?.resource ?? i.resource), i.refresh();
|
|
1471
1882
|
} : void 0
|
|
1472
1883
|
};
|
|
1473
1884
|
}, c = (e, t) => {
|
|
1474
1885
|
let r = {
|
|
1475
1886
|
id: e.id,
|
|
1476
1887
|
selected: e.selected,
|
|
1477
|
-
label:
|
|
1888
|
+
label: z(e.label),
|
|
1478
1889
|
icon: e.icon,
|
|
1479
1890
|
iconColor: e.iconColor,
|
|
1480
1891
|
badge: e.badge,
|
|
@@ -1501,7 +1912,7 @@ var ze = (e) => {
|
|
|
1501
1912
|
mapNodes: (e, t) => e.map((e) => c(e, t)),
|
|
1502
1913
|
mapSections: (e, t) => e.map((e) => ({
|
|
1503
1914
|
id: e.id,
|
|
1504
|
-
label:
|
|
1915
|
+
label: z(e.label),
|
|
1505
1916
|
actions: e.actions?.map((e) => s(e, void 0, t)),
|
|
1506
1917
|
collapsible: e.collapsible,
|
|
1507
1918
|
emptyState: a(e),
|
|
@@ -1512,58 +1923,58 @@ var ze = (e) => {
|
|
|
1512
1923
|
originalNodes: n,
|
|
1513
1924
|
runnerCommandId: r
|
|
1514
1925
|
};
|
|
1515
|
-
},
|
|
1926
|
+
}, Yn = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "nodes" in e), Xn = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "id" in e), Y = (e, t) => t.length > 0 ? [{
|
|
1516
1927
|
id: e,
|
|
1517
1928
|
nodes: t,
|
|
1518
1929
|
canReorder: !1
|
|
1519
|
-
}] : [],
|
|
1520
|
-
let n =
|
|
1930
|
+
}] : [], Zn = (e, t) => {
|
|
1931
|
+
let n = Jn(e, t), r = Hn(e.metadata, t), i = e.workbench.commands.registerCommand({
|
|
1521
1932
|
id: n.runnerCommandId,
|
|
1522
|
-
label: `${
|
|
1933
|
+
label: `${z(t.title, t.id)} tree command`
|
|
1523
1934
|
}, { execute: async (n) => {
|
|
1524
|
-
let r = n, i = await
|
|
1935
|
+
let r = n, i = await Vn(e, t, r.commandId, r.params, r.resource);
|
|
1525
1936
|
for (let t of e.workbench.views.listViews()) t.body.kind === "file" && e.workbench.views.refreshView(t.id);
|
|
1526
1937
|
return i;
|
|
1527
1938
|
} }), a = e.workbench.views.registerView({
|
|
1528
1939
|
id: t.id,
|
|
1529
|
-
title:
|
|
1940
|
+
title: z(t.title, t.id),
|
|
1530
1941
|
icon: t.icon,
|
|
1531
1942
|
body: {
|
|
1532
1943
|
kind: "tree",
|
|
1533
1944
|
searchable: t.searchable,
|
|
1534
|
-
searchPlaceholder:
|
|
1945
|
+
searchPlaceholder: z(t.searchPlaceholder, "Search files"),
|
|
1535
1946
|
defaultExpandedNodeIds: t.defaultExpandedNodeIds,
|
|
1536
1947
|
defaultExpandedSectionIds: t.defaultExpandedSectionIds,
|
|
1537
1948
|
getHeader: async (i) => {
|
|
1538
|
-
let a = await
|
|
1949
|
+
let a = await Wn({
|
|
1539
1950
|
ctx: i,
|
|
1540
1951
|
getHostTreeHeaderNodes: e.getHostTreeHeaderNodes,
|
|
1541
1952
|
record: t,
|
|
1542
1953
|
treeViews: r
|
|
1543
1954
|
});
|
|
1544
|
-
if (!t.headerHandlerId) return
|
|
1545
|
-
let o = await
|
|
1546
|
-
return [...
|
|
1955
|
+
if (!t.headerHandlerId) return Y(`${t.id}:host-header`, a);
|
|
1956
|
+
let o = await J(e, t, t.headerHandlerId, q(e, t, i), i.signal), s = Yn(o) ? n.mapSections(o, i) : [];
|
|
1957
|
+
return [...Y(`${t.id}:host-header`, a), ...s];
|
|
1547
1958
|
},
|
|
1548
1959
|
getBody: async (r) => {
|
|
1549
|
-
let i = await
|
|
1550
|
-
return
|
|
1960
|
+
let i = await J(e, t, t.bodyHandlerId, q(e, t, r), r.signal);
|
|
1961
|
+
return Yn(i) ? n.mapSections(i, r) : [];
|
|
1551
1962
|
},
|
|
1552
1963
|
getFooter: async (i) => {
|
|
1553
|
-
let a = await
|
|
1964
|
+
let a = await Gn({
|
|
1554
1965
|
ctx: i,
|
|
1555
1966
|
getHostTreeFooterNodes: e.getHostTreeFooterNodes,
|
|
1556
1967
|
record: t,
|
|
1557
1968
|
treeViews: r
|
|
1558
1969
|
});
|
|
1559
|
-
if (!t.footerHandlerId) return
|
|
1560
|
-
let o = await
|
|
1561
|
-
return [...
|
|
1970
|
+
if (!t.footerHandlerId) return Y(`${t.id}:host-footer`, a);
|
|
1971
|
+
let o = await J(e, t, t.footerHandlerId, q(e, t, i), i.signal);
|
|
1972
|
+
return [...Yn(o) ? n.mapSections(o, i) : [], ...Y(`${t.id}:host-footer`, a)];
|
|
1562
1973
|
},
|
|
1563
1974
|
moveNode: t.moveHandlerId ? async (r, i, a) => {
|
|
1564
1975
|
let o = n.originalNodes.get(r), s = i ? n.originalNodes.get(i) : void 0;
|
|
1565
|
-
!o?.canDrag || i && !s?.canDrop || (await
|
|
1566
|
-
...
|
|
1976
|
+
!o?.canDrag || i && !s?.canDrop || (await J(e, t, t.moveHandlerId, {
|
|
1977
|
+
...q(e, t, a),
|
|
1567
1978
|
source: o,
|
|
1568
1979
|
target: s,
|
|
1569
1980
|
position: a.position ?? "inside"
|
|
@@ -1573,103 +1984,123 @@ var ze = (e) => {
|
|
|
1573
1984
|
if (!t.childrenHandlerId) return r.children ?? [];
|
|
1574
1985
|
let a = n.originalNodes.get(r);
|
|
1575
1986
|
if (!a) return r.children ?? [];
|
|
1576
|
-
let o = await
|
|
1577
|
-
return
|
|
1987
|
+
let o = await J(e, t, t.childrenHandlerId, q(e, t, i, a), i.signal);
|
|
1988
|
+
return Xn(o) ? n.mapNodes(o, i) : [];
|
|
1578
1989
|
}
|
|
1579
1990
|
}
|
|
1580
1991
|
});
|
|
1581
1992
|
return { dispose() {
|
|
1582
1993
|
a.dispose(), i.dispose();
|
|
1583
1994
|
} };
|
|
1584
|
-
},
|
|
1995
|
+
}, Qn = (e) => {
|
|
1585
1996
|
let t = [];
|
|
1586
|
-
for (let n of e.metadata.treeRenderers ?? []) t.push(
|
|
1997
|
+
for (let n of e.metadata.treeRenderers ?? []) t.push(Zn(e, n));
|
|
1587
1998
|
return { dispose() {
|
|
1588
1999
|
for (let e = t.length - 1; e >= 0; --e) t[e]?.dispose();
|
|
1589
2000
|
} };
|
|
1590
|
-
},
|
|
2001
|
+
}, X = (e) => ({
|
|
1591
2002
|
kind: e.kind,
|
|
1592
|
-
id:
|
|
2003
|
+
id: C(e),
|
|
1593
2004
|
extensionId: e.extensionId
|
|
1594
|
-
}),
|
|
2005
|
+
}), $n = (e, t, n) => {
|
|
1595
2006
|
let r = n?.(t.when);
|
|
1596
2007
|
return !r || e.context.matches(r);
|
|
1597
|
-
},
|
|
2008
|
+
}, er = (e) => ({
|
|
1598
2009
|
id: e.id,
|
|
1599
|
-
label:
|
|
2010
|
+
label: z(e.label, e.id),
|
|
1600
2011
|
icon: e.icon,
|
|
1601
2012
|
canHide: !0,
|
|
1602
2013
|
canReorder: !0,
|
|
1603
|
-
target:
|
|
1604
|
-
}),
|
|
1605
|
-
let
|
|
1606
|
-
for (let
|
|
1607
|
-
if (
|
|
1608
|
-
let
|
|
1609
|
-
id:
|
|
1610
|
-
label:
|
|
1611
|
-
collapsible: !!
|
|
2014
|
+
target: R(e.action, { extensionId: e.extensionId })
|
|
2015
|
+
}), tr = (e, t, n) => {
|
|
2016
|
+
let r = /* @__PURE__ */ new Map();
|
|
2017
|
+
for (let i of t) {
|
|
2018
|
+
if (!$n(e, i, n)) continue;
|
|
2019
|
+
let t = i.group || void 0, a = t ? `${i.extensionId}:${t}` : g(i.slot), o = r.get(a) ?? {
|
|
2020
|
+
id: a,
|
|
2021
|
+
label: t,
|
|
2022
|
+
collapsible: !!t,
|
|
1612
2023
|
canHide: !0,
|
|
1613
2024
|
canReorder: !0,
|
|
1614
2025
|
nodes: []
|
|
1615
2026
|
};
|
|
1616
|
-
|
|
2027
|
+
o.nodes.push(er(i)), r.set(a, o);
|
|
1617
2028
|
}
|
|
1618
|
-
return [...
|
|
1619
|
-
},
|
|
2029
|
+
return [...r.values()];
|
|
2030
|
+
}, nr = (e) => {
|
|
1620
2031
|
let t = /* @__PURE__ */ new Map();
|
|
1621
2032
|
for (let n of e) {
|
|
1622
|
-
let e =
|
|
2033
|
+
let e = X(n.owner), r = `${n.extensionId}:${e.kind}:${e.id}:${n.slot}`;
|
|
1623
2034
|
t.set(r, [...t.get(r) ?? [], n]);
|
|
1624
2035
|
}
|
|
1625
2036
|
return [...t.values()];
|
|
1626
|
-
},
|
|
2037
|
+
}, rr = (e) => [...new Set(e.flatMap((e) => e.group ? [`${e.extensionId}:${e.group}`] : []))], ir = (e) => nr(e.metadata.navigationItems).map((t) => {
|
|
1627
2038
|
let n = t[0], r = t.some((e) => e.when?.resourceType?.length || e.when?.metadata);
|
|
1628
2039
|
return e.workbench.navigationTrees.registerContribution({
|
|
1629
|
-
id: `${n.extensionId}.navigation-items.${n.owner.kind}.${
|
|
1630
|
-
owner:
|
|
2040
|
+
id: `${n.extensionId}.navigation-items.${n.owner.kind}.${C(n.owner)}.${n.slot}`,
|
|
2041
|
+
owner: X(n.owner),
|
|
1631
2042
|
sourceExtensionId: n.extensionId,
|
|
1632
2043
|
declarationIndex: e.metadata.navigationItems.indexOf(n),
|
|
1633
2044
|
slot: n.slot,
|
|
1634
|
-
defaultExpandedSectionIds:
|
|
2045
|
+
defaultExpandedSectionIds: rr(t),
|
|
1635
2046
|
...r ? {} : { resolveResource: () => void 0 },
|
|
1636
|
-
getSections: () =>
|
|
2047
|
+
getSections: () => tr(e.workbench, t, e.createWhenExpression),
|
|
1637
2048
|
listActions: () => t.map((e) => ({
|
|
1638
|
-
label:
|
|
2049
|
+
label: z(e.label, e.id),
|
|
1639
2050
|
category: e.group || void 0,
|
|
1640
|
-
action:
|
|
2051
|
+
action: R(e.action, { extensionId: e.extensionId })
|
|
1641
2052
|
}))
|
|
1642
2053
|
});
|
|
1643
|
-
}),
|
|
1644
|
-
let r =
|
|
2054
|
+
}), ar = (e) => e.metadata.navigationTrees.map((t, n) => {
|
|
2055
|
+
let r = C(t.view);
|
|
1645
2056
|
return e.workbench.navigationTrees.registerContribution({
|
|
1646
2057
|
id: t.id,
|
|
1647
2058
|
idScope: t.id,
|
|
1648
|
-
owner:
|
|
2059
|
+
owner: X(t.owner),
|
|
1649
2060
|
sourceExtensionId: t.extensionId,
|
|
1650
2061
|
declarationIndex: e.metadata.navigationItems.length + n,
|
|
1651
2062
|
slot: t.slot,
|
|
1652
2063
|
viewId: r,
|
|
1653
2064
|
...t.resourceScope === "project" ? { resolveResource: () => void 0 } : {}
|
|
1654
2065
|
});
|
|
1655
|
-
}),
|
|
2066
|
+
}), or = (e) => [...ir(e), ...ar(e)], sr = (e) => e.metadata.resourceKinds.map((t) => e.workbench.resources.registerKind({
|
|
2067
|
+
kind: t.id,
|
|
2068
|
+
extensionId: t.extensionId,
|
|
2069
|
+
label: z(t.label, t.id),
|
|
2070
|
+
icon: t.icon ?? "FileText",
|
|
2071
|
+
relatedOpenings: t.relatedOpeningsCommand ? async (n, r) => {
|
|
2072
|
+
let i = await e.executeCommand(t.relatedOpeningsCommand, {
|
|
2073
|
+
projectId: e.projectId,
|
|
2074
|
+
resource: n,
|
|
2075
|
+
source: "dashboard"
|
|
2076
|
+
}, r);
|
|
2077
|
+
return r.throwIfAborted(), a.array().parse(B(i)).map((n) => ({
|
|
2078
|
+
...n,
|
|
2079
|
+
resource: {
|
|
2080
|
+
...n.resource,
|
|
2081
|
+
projectId: n.resource.projectId ?? e.projectId,
|
|
2082
|
+
extensionId: n.resource.extensionId ?? t.extensionId
|
|
2083
|
+
}
|
|
2084
|
+
}));
|
|
2085
|
+
} : void 0
|
|
2086
|
+
})), cr = () => {
|
|
1656
2087
|
if (typeof navigator > "u") return;
|
|
1657
2088
|
let e = `${navigator.platform} ${navigator.userAgent}`.toLowerCase();
|
|
1658
2089
|
if (e.includes("mac")) return "mac";
|
|
1659
2090
|
if (e.includes("win")) return "win";
|
|
1660
2091
|
if (e.includes("linux")) return "linux";
|
|
1661
|
-
},
|
|
2092
|
+
}, lr = (e, t = cr()) => (t ? e.platformOverrides?.[t] : void 0) ?? e.key, ur = (e) => e.bindings.map((t) => e.workbench.keybindings.registerKeybinding({
|
|
1662
2093
|
sourceExtensionId: t.extensionId,
|
|
1663
|
-
action:
|
|
2094
|
+
action: R(t.action, { commandIdOf: (e) => e.extensionId ? S({
|
|
1664
2095
|
extensionId: e.extensionId,
|
|
1665
2096
|
id: e.id
|
|
1666
2097
|
}) : void 0 }),
|
|
1667
|
-
keybinding:
|
|
2098
|
+
keybinding: lr(t),
|
|
1668
2099
|
when: e.createWhenExpression?.(t.when)
|
|
1669
|
-
})),
|
|
2100
|
+
})), dr = (e) => {
|
|
1670
2101
|
if (!e) return;
|
|
1671
2102
|
let t = (e) => {
|
|
1672
|
-
if (e) return Array.isArray(e) ? e.map((e) =>
|
|
2103
|
+
if (e) return Array.isArray(e) ? e.map((e) => C(e)) : C(e);
|
|
1673
2104
|
};
|
|
1674
2105
|
return {
|
|
1675
2106
|
mode: t(e.mode),
|
|
@@ -1678,21 +2109,21 @@ var ze = (e) => {
|
|
|
1678
2109
|
resourceType: e.resourceType?.map((e) => e.id),
|
|
1679
2110
|
metadata: e.metadata
|
|
1680
2111
|
};
|
|
1681
|
-
},
|
|
2112
|
+
}, fr = (e, t) => ({
|
|
1682
2113
|
...e,
|
|
1683
2114
|
tab: e.tab && t.createTab ? t.createTab({
|
|
1684
2115
|
...e.tab,
|
|
1685
2116
|
extensionId: t.extensionId,
|
|
1686
2117
|
placementId: t.placementId
|
|
1687
2118
|
}) : void 0
|
|
1688
|
-
}),
|
|
2119
|
+
}), pr = (e, t) => e.kind === "panels" ? e : {
|
|
1689
2120
|
...e,
|
|
1690
2121
|
tab: e.tab && t.createTab ? t.createTab({
|
|
1691
2122
|
...e.tab,
|
|
1692
2123
|
extensionId: t.extensionId,
|
|
1693
2124
|
placementId: t.placementId
|
|
1694
2125
|
}) : void 0
|
|
1695
|
-
},
|
|
2126
|
+
}, mr = (e, t) => e.pages.map((e) => ({
|
|
1696
2127
|
id: e.id,
|
|
1697
2128
|
ref: {
|
|
1698
2129
|
extensionId: e.extensionId,
|
|
@@ -1703,32 +2134,32 @@ var ze = (e) => {
|
|
|
1703
2134
|
path: e.path,
|
|
1704
2135
|
document: e.document,
|
|
1705
2136
|
params: e.params,
|
|
1706
|
-
modeId:
|
|
2137
|
+
modeId: C(e.mode),
|
|
1707
2138
|
resource: e.resource,
|
|
1708
|
-
main:
|
|
2139
|
+
main: pr(e.main, {
|
|
1709
2140
|
extensionId: e.extensionId,
|
|
1710
2141
|
placementId: `${e.id}.$main`,
|
|
1711
2142
|
createTab: t
|
|
1712
2143
|
}),
|
|
1713
|
-
slots: e.slots.map((n) =>
|
|
2144
|
+
slots: e.slots.map((n) => fr(n, {
|
|
1714
2145
|
extensionId: e.extensionId,
|
|
1715
2146
|
placementId: `${e.id}.${n.id}`,
|
|
1716
2147
|
createTab: t
|
|
1717
2148
|
})),
|
|
1718
2149
|
...e.icon ? { icon: e.icon } : {},
|
|
1719
|
-
...e.parent ? { parentId:
|
|
1720
|
-
})),
|
|
2150
|
+
...e.parent ? { parentId: C(e.parent) } : {}
|
|
2151
|
+
})), Z = (e, t) => {
|
|
1721
2152
|
let n = e.pages.flatMap((e) => [...e.main.kind === "view" && e.resource ? [{
|
|
1722
2153
|
...e.resource,
|
|
1723
2154
|
view: e.main.view
|
|
1724
2155
|
}] : [], ...e.slots.flatMap((e) => e.item.kind === "binding" ? [e.item.binding] : [])]);
|
|
1725
|
-
return n.push(...e.placements.flatMap((e) => e.item.kind === "binding" ? [e.item.binding] : [])), n.find((e) =>
|
|
1726
|
-
},
|
|
2156
|
+
return n.push(...e.placements.flatMap((e) => e.item.kind === "binding" ? [e.item.binding] : [])), n.find((e) => C(e.view) === t)?.kinds[0]?.id;
|
|
2157
|
+
}, hr = (e) => e.body.kind === "webview" ? { webview: e.body.webview } : { renderer: {
|
|
1727
2158
|
kind: e.body.kind,
|
|
1728
2159
|
id: e.id
|
|
1729
|
-
} },
|
|
1730
|
-
if (
|
|
1731
|
-
let r = e.views.find((e) => e.id ===
|
|
2160
|
+
} }, gr = (e, t) => e.viewMenus.flatMap((n) => {
|
|
2161
|
+
if (C(n.owner) !== t.id) return [];
|
|
2162
|
+
let r = e.views.find((e) => e.id === C(n.view));
|
|
1732
2163
|
return r ? [{
|
|
1733
2164
|
id: n.id,
|
|
1734
2165
|
extensionId: n.extensionId,
|
|
@@ -1740,22 +2171,22 @@ var ze = (e) => {
|
|
|
1740
2171
|
placement: n.placement,
|
|
1741
2172
|
hostTreeHeader: n.hostTreeHeader,
|
|
1742
2173
|
hostTreeFooter: n.hostTreeFooter,
|
|
1743
|
-
...
|
|
2174
|
+
...hr(r)
|
|
1744
2175
|
}] : [];
|
|
1745
|
-
}),
|
|
1746
|
-
let n =
|
|
2176
|
+
}), _r = (e) => e.views.map((t) => {
|
|
2177
|
+
let n = gr(e, t);
|
|
1747
2178
|
return {
|
|
1748
2179
|
id: t.id,
|
|
1749
2180
|
extensionId: t.extensionId,
|
|
1750
2181
|
title: t.title,
|
|
1751
2182
|
icon: t.icon,
|
|
1752
2183
|
panelMenus: n.length > 0 ? n : void 0,
|
|
1753
|
-
...
|
|
2184
|
+
...hr(t)
|
|
1754
2185
|
};
|
|
1755
|
-
}),
|
|
2186
|
+
}), Q = (e) => e?.map(({ command: e, ...t }) => ({
|
|
1756
2187
|
...t,
|
|
1757
|
-
commandId:
|
|
1758
|
-
})),
|
|
2188
|
+
commandId: S(e)
|
|
2189
|
+
})), vr = (e) => e.views.flatMap((t) => {
|
|
1759
2190
|
let n = t.body;
|
|
1760
2191
|
return n.kind === "kanban" ? [{
|
|
1761
2192
|
...n,
|
|
@@ -1763,7 +2194,7 @@ var ze = (e) => {
|
|
|
1763
2194
|
extensionId: t.extensionId,
|
|
1764
2195
|
title: t.title,
|
|
1765
2196
|
icon: t.icon,
|
|
1766
|
-
resourceKind: n.resourceKind ??
|
|
2197
|
+
resourceKind: n.resourceKind ?? Z(e, t.id),
|
|
1767
2198
|
createRow: n.createRow ? {
|
|
1768
2199
|
title: n.createRow.title,
|
|
1769
2200
|
submitLabel: n.createRow.submitLabel,
|
|
@@ -1771,17 +2202,17 @@ var ze = (e) => {
|
|
|
1771
2202
|
params: n.createRow.params,
|
|
1772
2203
|
attributesParam: n.createRow.attributesParam,
|
|
1773
2204
|
labels: n.createRow.labels,
|
|
1774
|
-
commandId:
|
|
2205
|
+
commandId: S(n.createRow.command),
|
|
1775
2206
|
attachments: n.createRow.attachments ? {
|
|
1776
2207
|
resourceParam: n.createRow.attachments.resourceParam,
|
|
1777
2208
|
fileParam: n.createRow.attachments.fileParam,
|
|
1778
|
-
commandId:
|
|
2209
|
+
commandId: S(n.createRow.attachments.command)
|
|
1779
2210
|
} : void 0
|
|
1780
2211
|
} : void 0,
|
|
1781
|
-
rowActions:
|
|
1782
|
-
toolbarActions:
|
|
2212
|
+
rowActions: Q(n.rowActions),
|
|
2213
|
+
toolbarActions: Q(n.toolbarActions)
|
|
1783
2214
|
}] : [];
|
|
1784
|
-
}),
|
|
2215
|
+
}), yr = (e) => e.views.flatMap((t) => {
|
|
1785
2216
|
let n = t.body;
|
|
1786
2217
|
return n.kind === "dataTable" ? [{
|
|
1787
2218
|
...n,
|
|
@@ -1789,33 +2220,33 @@ var ze = (e) => {
|
|
|
1789
2220
|
extensionId: t.extensionId,
|
|
1790
2221
|
title: t.title,
|
|
1791
2222
|
icon: t.icon,
|
|
1792
|
-
resourceKind: n.resourceKind ??
|
|
1793
|
-
selectionActions:
|
|
1794
|
-
rowActions:
|
|
1795
|
-
toolbarActions:
|
|
2223
|
+
resourceKind: n.resourceKind ?? Z(e, t.id),
|
|
2224
|
+
selectionActions: Q(n.selectionActions),
|
|
2225
|
+
rowActions: Q(n.rowActions),
|
|
2226
|
+
toolbarActions: Q(n.toolbarActions)
|
|
1796
2227
|
}] : [];
|
|
1797
|
-
}),
|
|
2228
|
+
}), br = (e) => e.views.flatMap((t) => t.body.kind === "tree" ? [{
|
|
1798
2229
|
...t.body,
|
|
1799
2230
|
id: t.id,
|
|
1800
2231
|
extensionId: t.extensionId,
|
|
1801
2232
|
title: t.title,
|
|
1802
2233
|
icon: t.icon,
|
|
1803
|
-
resourceKind: t.body.resourceKind ??
|
|
1804
|
-
}] : []),
|
|
2234
|
+
resourceKind: t.body.resourceKind ?? Z(e, t.id)
|
|
2235
|
+
}] : []), xr = (e) => e.views.flatMap((t) => t.body.kind === "file" ? [{
|
|
1805
2236
|
...t.body,
|
|
1806
2237
|
id: t.id,
|
|
1807
2238
|
extensionId: t.extensionId,
|
|
1808
2239
|
title: t.title,
|
|
1809
2240
|
icon: t.icon,
|
|
1810
|
-
resourceKind: t.body.resourceKind ??
|
|
1811
|
-
}] : []),
|
|
2241
|
+
resourceKind: t.body.resourceKind ?? Z(e, t.id)
|
|
2242
|
+
}] : []), Sr = (e) => e.views.flatMap((t) => t.body.kind === "controls" ? [{
|
|
1812
2243
|
...t.body,
|
|
1813
2244
|
id: t.id,
|
|
1814
2245
|
extensionId: t.extensionId,
|
|
1815
2246
|
title: t.title,
|
|
1816
2247
|
icon: t.icon,
|
|
1817
|
-
resourceKind: t.body.resourceKind ??
|
|
1818
|
-
}] : []),
|
|
2248
|
+
resourceKind: t.body.resourceKind ?? Z(e, t.id)
|
|
2249
|
+
}] : []), Cr = (e) => e.modes.map((e) => ({
|
|
1819
2250
|
id: e.id,
|
|
1820
2251
|
extensionId: e.extensionId,
|
|
1821
2252
|
modeId: e.id,
|
|
@@ -1824,17 +2255,17 @@ var ze = (e) => {
|
|
|
1824
2255
|
panelRegions: e.regions,
|
|
1825
2256
|
regionSettings: e.regionSettings,
|
|
1826
2257
|
floatingPanels: e.floatingPanels,
|
|
1827
|
-
...e.defaultTheme ? { defaultTheme:
|
|
1828
|
-
...e.chrome ? { chrome: Object.fromEntries(Object.entries(e.chrome).map(([e, t]) => [e, t !== !1 &&
|
|
1829
|
-
})),
|
|
1830
|
-
let n =
|
|
2258
|
+
...e.defaultTheme ? { defaultTheme: C(e.defaultTheme) } : {},
|
|
2259
|
+
...e.chrome ? { chrome: Object.fromEntries(Object.entries(e.chrome).map(([e, t]) => [e, t !== !1 && C(t)])) } : {}
|
|
2260
|
+
})), wr = (e, t = {}) => {
|
|
2261
|
+
let n = _r(e);
|
|
1831
2262
|
return {
|
|
1832
2263
|
extensions: e.extensions,
|
|
1833
2264
|
commands: e.commands,
|
|
1834
2265
|
menuContributions: e.menuContributions,
|
|
1835
2266
|
commandPaletteContributions: e.commandPaletteContributions,
|
|
1836
|
-
modes:
|
|
1837
|
-
pages:
|
|
2267
|
+
modes: Cr(e),
|
|
2268
|
+
pages: mr(e, t.createTab),
|
|
1838
2269
|
placements: e.placements.map((e) => ({
|
|
1839
2270
|
id: e.id,
|
|
1840
2271
|
ref: {
|
|
@@ -1842,7 +2273,7 @@ var ze = (e) => {
|
|
|
1842
2273
|
kind: "placement",
|
|
1843
2274
|
id: e.localId
|
|
1844
2275
|
},
|
|
1845
|
-
modeId:
|
|
2276
|
+
modeId: C(e.mode),
|
|
1846
2277
|
item: e.item,
|
|
1847
2278
|
region: e.region,
|
|
1848
2279
|
order: e.order,
|
|
@@ -1859,6 +2290,7 @@ var ze = (e) => {
|
|
|
1859
2290
|
panels: n,
|
|
1860
2291
|
resourceKinds: e.resourceKinds.map((e) => ({
|
|
1861
2292
|
id: e.id,
|
|
2293
|
+
relatedOpeningsCommand: e.relatedOpeningsCommand,
|
|
1862
2294
|
extensionId: e.extensionId,
|
|
1863
2295
|
label: e.label,
|
|
1864
2296
|
icon: e.icon,
|
|
@@ -1876,7 +2308,7 @@ var ze = (e) => {
|
|
|
1876
2308
|
})),
|
|
1877
2309
|
settingsSections: e.settingsSections ?? [],
|
|
1878
2310
|
settingsPanels: e.settingsPanels.flatMap((t) => {
|
|
1879
|
-
let n = e.views.find((e) => e.id ===
|
|
2311
|
+
let n = e.views.find((e) => e.id === C(t.view));
|
|
1880
2312
|
return n ? [{
|
|
1881
2313
|
id: t.id,
|
|
1882
2314
|
viewId: n.id,
|
|
@@ -1885,31 +2317,30 @@ var ze = (e) => {
|
|
|
1885
2317
|
scope: t.slot.id.includes("global") ? "global" : "project",
|
|
1886
2318
|
title: n.title,
|
|
1887
2319
|
icon: n.icon,
|
|
1888
|
-
section: t.section ?
|
|
2320
|
+
section: t.section ? C(t.section) : void 0
|
|
1889
2321
|
}] : [];
|
|
1890
2322
|
}),
|
|
1891
|
-
kanbanRenderers:
|
|
1892
|
-
dataTableRenderers:
|
|
2323
|
+
kanbanRenderers: vr(e),
|
|
2324
|
+
dataTableRenderers: yr(e),
|
|
1893
2325
|
commandPaletteResources: e.commandPaletteResources ?? [],
|
|
1894
|
-
treeRenderers:
|
|
1895
|
-
fileRenderers:
|
|
1896
|
-
controlsRenderers:
|
|
2326
|
+
treeRenderers: br(e),
|
|
2327
|
+
fileRenderers: xr(e),
|
|
2328
|
+
controlsRenderers: Sr(e),
|
|
1897
2329
|
keybindings: e.keybindings ?? [],
|
|
1898
2330
|
settingsDefinitions: e.settingsDefinitions ?? [],
|
|
1899
|
-
statuses: e.statuses,
|
|
1900
2331
|
statusBarItems: e.statusBarItems.map((e) => ({
|
|
1901
2332
|
id: e.id,
|
|
1902
2333
|
extensionId: e.extensionId,
|
|
1903
|
-
viewId:
|
|
2334
|
+
viewId: C(e.view),
|
|
1904
2335
|
slot: e.slot.id.endsWith("leading") ? "leading" : "trailing",
|
|
1905
2336
|
order: e.order,
|
|
1906
|
-
when:
|
|
2337
|
+
when: dr(e.when)
|
|
1907
2338
|
})),
|
|
1908
2339
|
diagnostics: e.diagnostics
|
|
1909
2340
|
};
|
|
1910
|
-
},
|
|
2341
|
+
}, Tr = (e, t, n = {}) => {
|
|
1911
2342
|
e.views.refreshView(t.id, t.kind === "file" ? n : void 0);
|
|
1912
|
-
},
|
|
2343
|
+
}, Er = (e) => {
|
|
1913
2344
|
let t = /* @__PURE__ */ new Map(), n = (e, n) => {
|
|
1914
2345
|
for (let r of new Set(n.refreshEventIds ?? [])) {
|
|
1915
2346
|
let i = t.get(r) ?? [];
|
|
@@ -1924,149 +2355,106 @@ var ze = (e) => {
|
|
|
1924
2355
|
refreshEventIds: t.body.refreshEventIds
|
|
1925
2356
|
});
|
|
1926
2357
|
return t;
|
|
1927
|
-
},
|
|
1928
|
-
let t =
|
|
2358
|
+
}, Dr = (e) => {
|
|
2359
|
+
let t = Er(e.metadata);
|
|
1929
2360
|
return e.subscribe((n) => {
|
|
1930
2361
|
let { id: r, ...i } = n;
|
|
1931
|
-
for (let n of t.get(r) ?? [])
|
|
2362
|
+
for (let n of t.get(r) ?? []) Tr(e.workbench, n, i);
|
|
1932
2363
|
});
|
|
1933
|
-
},
|
|
2364
|
+
}, Or = (e, t) => {
|
|
1934
2365
|
for (let n of t.views) n.body.kind === "webview" && e.views.getView(n.id) && e.views.refreshView(n.id);
|
|
1935
|
-
},
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
}),
|
|
1942
|
-
"navigation.open": (n) => {
|
|
1943
|
-
let r = n;
|
|
1944
|
-
if (!r.target) throw Error("navigation.open requires a target.");
|
|
1945
|
-
return t.workbench.navigation.openTarget(F(r.target, {
|
|
1946
|
-
extensionId: e.extensionIdForWebview(t.webviewId),
|
|
2366
|
+
}, kr = (e) => (t) => {
|
|
2367
|
+
let n = t.extensionId ?? e.extensionIdForWebview(t.webviewId);
|
|
2368
|
+
return {
|
|
2369
|
+
...Ot({
|
|
2370
|
+
...t,
|
|
2371
|
+
extensionId: n,
|
|
1947
2372
|
projectId: e.projectId
|
|
1948
|
-
})
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
...e.artifacts ? { "artifacts.read": (n) => e.artifacts.read(n, { webviewId: t.webviewId }) } : {}
|
|
1974
|
-
}), Fn = (e) => ({
|
|
1975
|
-
title: P(e.title) || void 0,
|
|
2373
|
+
}),
|
|
2374
|
+
executeCommand: (n, r) => {
|
|
2375
|
+
let i = n.resource ?? t.placement.resource;
|
|
2376
|
+
return H({
|
|
2377
|
+
...e,
|
|
2378
|
+
workbench: t.workbench
|
|
2379
|
+
}, n.commandId, {
|
|
2380
|
+
params: n.params,
|
|
2381
|
+
workspaceId: n.workspaceId,
|
|
2382
|
+
metadata: n.metadata,
|
|
2383
|
+
resource: i,
|
|
2384
|
+
signal: r,
|
|
2385
|
+
slot: V({
|
|
2386
|
+
id: t.webviewId,
|
|
2387
|
+
kind: e.slotKind,
|
|
2388
|
+
projectId: e.projectId,
|
|
2389
|
+
context: { panelId: t.webviewId }
|
|
2390
|
+
})
|
|
2391
|
+
});
|
|
2392
|
+
},
|
|
2393
|
+
files: e.files,
|
|
2394
|
+
artifacts: e.artifacts ? { read: (n) => e.artifacts.read(n, { webviewId: t.webviewId }) } : void 0
|
|
2395
|
+
};
|
|
2396
|
+
}, Ar = (e) => ({
|
|
2397
|
+
title: z(e.title) || void 0,
|
|
1976
2398
|
runtimeUrl: e.runtimeUrl,
|
|
1977
2399
|
moduleUrl: e.moduleUrl,
|
|
1978
2400
|
styles: e.styles,
|
|
1979
2401
|
capabilities: e.capabilities
|
|
1980
|
-
}),
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
2402
|
+
}), jr = "extensions", Mr = 1e3, Nr = (e) => e === void 0 ? void 0 : e, Pr = (e) => e === "global" ? "user" : "project", Fr = (e, t) => {
|
|
2403
|
+
let n = kr({
|
|
2404
|
+
artifacts: e.webviewArtifacts,
|
|
2405
|
+
executeCommand: e.executeCommand,
|
|
2406
|
+
extensionIdForWebview: (t) => e.metadata.panels.find((e) => e.id === t)?.extensionId,
|
|
2407
|
+
files: e.webviewFiles,
|
|
2408
|
+
projectId: e.projectId,
|
|
2409
|
+
slotKind: t
|
|
2410
|
+
});
|
|
2411
|
+
return (t) => ({
|
|
2412
|
+
...n(t),
|
|
2413
|
+
...e.createWebviewHostAdapters?.(t)
|
|
2414
|
+
});
|
|
2415
|
+
}, Ir = (e) => e.metadata.panels.flatMap((t) => {
|
|
1991
2416
|
if (!t.webview) return [];
|
|
1992
|
-
let n =
|
|
2417
|
+
let n = Ar(t.webview);
|
|
1993
2418
|
return [e.workbench.views.registerView({
|
|
1994
2419
|
id: t.id,
|
|
1995
|
-
title:
|
|
2420
|
+
title: z(t.title, t.id),
|
|
1996
2421
|
icon: t.icon,
|
|
1997
2422
|
body: {
|
|
1998
2423
|
kind: "react",
|
|
1999
2424
|
render: (r) => {
|
|
2000
2425
|
let i = e.metadata.settingsPanels.some((e) => e.id === r.instance.panelId && e.viewId === t.id) ? "settings" : "panel";
|
|
2001
|
-
return e.renderWebview?.(r) ??
|
|
2426
|
+
return e.renderWebview?.(r) ?? Nt({
|
|
2002
2427
|
context: {
|
|
2003
2428
|
workbench: r.workbench,
|
|
2004
2429
|
webviewId: t.id,
|
|
2005
2430
|
placement: r.instance,
|
|
2006
|
-
hostEvents:
|
|
2431
|
+
hostEvents: Mt(r.workbench, r.instance)
|
|
2007
2432
|
},
|
|
2008
|
-
|
|
2433
|
+
createHostAdapters: Fr(e, i),
|
|
2009
2434
|
createProps: e.createWebviewProps ?? (({ placement: e }) => ({
|
|
2010
2435
|
placement: e,
|
|
2011
2436
|
resource: e.resource
|
|
2012
2437
|
})),
|
|
2013
2438
|
createTheme: e.createWebviewTheme,
|
|
2014
2439
|
ownerId: t.extensionId,
|
|
2015
|
-
title:
|
|
2440
|
+
title: z(t.title, t.id),
|
|
2016
2441
|
webview: n
|
|
2017
2442
|
});
|
|
2018
2443
|
}
|
|
2019
2444
|
}
|
|
2020
2445
|
})];
|
|
2021
|
-
}),
|
|
2446
|
+
}), Lr = {
|
|
2022
2447
|
first: 1e6,
|
|
2023
2448
|
default: 0,
|
|
2024
2449
|
last: -1e6
|
|
2025
|
-
},
|
|
2450
|
+
}, Rr = (e) => e.metadata.panels.flatMap((e) => e.panelMenus ?? []).map((t, n) => e.workbench.viewMenus.registerViewMenu({
|
|
2026
2451
|
id: t.id,
|
|
2027
2452
|
ownerViewId: t.ownerPanelId,
|
|
2028
2453
|
viewId: t.viewId,
|
|
2029
2454
|
side: t.side,
|
|
2030
|
-
priority:
|
|
2031
|
-
})),
|
|
2032
|
-
|
|
2033
|
-
return e.statuses;
|
|
2034
|
-
}, qn = (e, t) => {
|
|
2035
|
-
let r = e.metadata.statuses ?? [];
|
|
2036
|
-
if (r.length === 0) return [];
|
|
2037
|
-
let i = "workbench.extension-statuses.settings", a = r.map((n, r) => e.workbench.statuses.registerStatusSet({
|
|
2038
|
-
id: n.id,
|
|
2039
|
-
title: P(n.title, n.id),
|
|
2040
|
-
actions: n.actions?.map((e) => ({
|
|
2041
|
-
id: e.id,
|
|
2042
|
-
label: P(e.label, e.id),
|
|
2043
|
-
icon: e.icon
|
|
2044
|
-
})),
|
|
2045
|
-
query: async () => Kn(await R(t, n.queryHandlerId, { params: {} })),
|
|
2046
|
-
save: n.saveHandlerId ? async (e) => Kn(await R(t, n.saveHandlerId, { params: { statuses: e } })) : void 0
|
|
2047
|
-
}, {
|
|
2048
|
-
ownerId: n.extensionId,
|
|
2049
|
-
priority: -r
|
|
2050
|
-
}));
|
|
2051
|
-
return a.push(e.workbench.views.registerView({
|
|
2052
|
-
id: i,
|
|
2053
|
-
title: "Statuses",
|
|
2054
|
-
body: {
|
|
2055
|
-
kind: "react",
|
|
2056
|
-
render: () => w(n, { workbench: e.workbench })
|
|
2057
|
-
}
|
|
2058
|
-
})), a.push(e.workbench.settings.registerPanel({
|
|
2059
|
-
id: "workbench.statuses",
|
|
2060
|
-
title: "Statuses",
|
|
2061
|
-
icon: "list-checks",
|
|
2062
|
-
kind: "view",
|
|
2063
|
-
order: Rn,
|
|
2064
|
-
section: e.settingsSectionId ?? In,
|
|
2065
|
-
scope: "project",
|
|
2066
|
-
viewId: i
|
|
2067
|
-
})), a;
|
|
2068
|
-
}, Jn = (e) => {
|
|
2069
|
-
let t = [], n = e.settingsSectionId ?? In;
|
|
2455
|
+
priority: Lr[t.placement ?? "default"] - n
|
|
2456
|
+
})), zr = (e) => {
|
|
2457
|
+
let t = [], n = e.settingsSectionId ?? jr;
|
|
2070
2458
|
e.workbench.settings.getSection(n) || t.push(e.workbench.settings.registerSection({
|
|
2071
2459
|
id: n,
|
|
2072
2460
|
title: e.settingsSectionTitle ?? "Extensions"
|
|
@@ -2074,7 +2462,7 @@ var ze = (e) => {
|
|
|
2074
2462
|
let r = [...e.metadata.settingsSections].sort((e, t) => (e.order ?? 0) - (t.order ?? 0) || e.extensionId.localeCompare(t.extensionId) || e.id.localeCompare(t.id));
|
|
2075
2463
|
for (let n of r) t.push(e.workbench.settings.registerSection({
|
|
2076
2464
|
id: n.id,
|
|
2077
|
-
title:
|
|
2465
|
+
title: z(n.title, n.id),
|
|
2078
2466
|
order: n.order,
|
|
2079
2467
|
scope: n.scope
|
|
2080
2468
|
}));
|
|
@@ -2083,65 +2471,66 @@ var ze = (e) => {
|
|
|
2083
2471
|
let t = a.get(e.extensionId) ?? Object.create(null);
|
|
2084
2472
|
t[e.key] = {
|
|
2085
2473
|
type: e.type,
|
|
2086
|
-
scope:
|
|
2087
|
-
default:
|
|
2474
|
+
scope: Pr(e.scope),
|
|
2475
|
+
default: Nr(e.default),
|
|
2088
2476
|
enum: e.enum,
|
|
2089
|
-
description:
|
|
2477
|
+
description: z(e.description)
|
|
2090
2478
|
}, a.set(e.extensionId, t);
|
|
2091
2479
|
}
|
|
2092
2480
|
for (let [n, r] of a) t.push(e.workbench.preferences.registerSchema({ properties: r }, { ownerId: n }));
|
|
2093
2481
|
let o = [...e.metadata.settingsPanels].sort((e, t) => e.extensionId.localeCompare(t.extensionId) || e.id.localeCompare(t.id));
|
|
2094
2482
|
for (let [r, i] of o.entries()) i.slotId !== "extension.settings" && t.push(e.workbench.settings.registerPanel({
|
|
2095
2483
|
id: i.id,
|
|
2096
|
-
title:
|
|
2484
|
+
title: z(i.title, i.id),
|
|
2097
2485
|
icon: i.icon,
|
|
2098
2486
|
kind: "view",
|
|
2099
|
-
order:
|
|
2487
|
+
order: Mr + r,
|
|
2100
2488
|
section: i.section ?? n,
|
|
2101
2489
|
scope: i.scope,
|
|
2102
2490
|
viewId: i.viewId
|
|
2103
2491
|
}));
|
|
2104
2492
|
return t;
|
|
2105
|
-
},
|
|
2493
|
+
}, $ = (e) => !(!e || typeof e != "object" || Array.isArray(e)), Br = (e, t, n) => ne(e) ? R(e, {
|
|
2106
2494
|
extensionId: t,
|
|
2107
2495
|
projectId: n
|
|
2108
|
-
}) : void 0,
|
|
2109
|
-
if (
|
|
2110
|
-
let r =
|
|
2496
|
+
}) : void 0, Vr = (e, t, n) => Array.isArray(e) ? e.flatMap((e) => {
|
|
2497
|
+
if (!$(e) || typeof e.id != "string") return [];
|
|
2498
|
+
let r = Br(e.action, t, n);
|
|
2499
|
+
return [{
|
|
2500
|
+
id: e.id,
|
|
2501
|
+
label: z(e.label, e.id),
|
|
2502
|
+
icon: typeof e.icon == "string" ? e.icon : void 0,
|
|
2503
|
+
iconColor: typeof e.iconColor == "string" ? e.iconColor : void 0,
|
|
2504
|
+
selected: e.selected === !0,
|
|
2505
|
+
disabled: e.disabled === !0,
|
|
2506
|
+
action: r ? {
|
|
2507
|
+
kind: "navigation",
|
|
2508
|
+
target: r
|
|
2509
|
+
} : void 0
|
|
2510
|
+
}];
|
|
2511
|
+
}) : [], Hr = (e, t, n) => {
|
|
2512
|
+
if (!$(e)) return {};
|
|
2513
|
+
let r = $(e.indicator) ? {
|
|
2111
2514
|
icon: String(e.indicator.icon ?? ""),
|
|
2112
2515
|
color: typeof e.indicator.color == "string" ? e.indicator.color : void 0,
|
|
2113
|
-
label:
|
|
2114
|
-
} : void 0, i = Array.isArray(e.menu) ? e.menu.flatMap((e) =>
|
|
2516
|
+
label: z(e.indicator.label)
|
|
2517
|
+
} : void 0, i = Array.isArray(e.menu) ? e.menu.flatMap((e) => !$(e) || typeof e.id != "string" || !Array.isArray(e.rows) ? [] : [{
|
|
2115
2518
|
id: e.id,
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
let r = Yn(e.action, t, n);
|
|
2119
|
-
return [{
|
|
2120
|
-
id: e.id,
|
|
2121
|
-
label: P(e.label, e.id),
|
|
2122
|
-
icon: typeof e.icon == "string" ? e.icon : void 0,
|
|
2123
|
-
iconColor: typeof e.iconColor == "string" ? e.iconColor : void 0,
|
|
2124
|
-
selected: e.selected === !0,
|
|
2125
|
-
disabled: e.disabled === !0,
|
|
2126
|
-
action: r ? {
|
|
2127
|
-
kind: "navigation",
|
|
2128
|
-
target: r
|
|
2129
|
-
} : void 0
|
|
2130
|
-
}];
|
|
2131
|
-
})
|
|
2519
|
+
label: z(e.label),
|
|
2520
|
+
rows: Vr(e.rows, t, n)
|
|
2132
2521
|
}]) : void 0;
|
|
2133
2522
|
return {
|
|
2134
|
-
label:
|
|
2523
|
+
label: z(e.label),
|
|
2135
2524
|
icon: typeof e.icon == "string" ? e.icon : void 0,
|
|
2136
2525
|
indicator: r?.icon ? r : void 0,
|
|
2137
2526
|
menu: i
|
|
2138
2527
|
};
|
|
2139
|
-
},
|
|
2528
|
+
}, Ur = (e, t) => {
|
|
2140
2529
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), o = new Set(t.refreshEventIds ?? []), s = 0, c = (o) => {
|
|
2141
2530
|
r.set(o.instanceId, o);
|
|
2142
2531
|
let l = i.get(o.instanceId);
|
|
2143
2532
|
if (l) return l;
|
|
2144
|
-
let u = o.resource, d = s, f = Promise.resolve(
|
|
2533
|
+
let u = o.resource, d = s, f = Promise.resolve(U(e, t.queryHandlerId, {
|
|
2145
2534
|
resource: u,
|
|
2146
2535
|
params: { renderer: {
|
|
2147
2536
|
rendererId: t.placementId,
|
|
@@ -2154,7 +2543,7 @@ var ze = (e) => {
|
|
|
2154
2543
|
i.delete(o.instanceId), await c(o);
|
|
2155
2544
|
return;
|
|
2156
2545
|
}
|
|
2157
|
-
n.set(o.instanceId,
|
|
2546
|
+
n.set(o.instanceId, Hr(r, t.extensionId, e.projectId));
|
|
2158
2547
|
for (let e of a) e();
|
|
2159
2548
|
}).finally(() => {
|
|
2160
2549
|
i.get(o.instanceId) === f && i.delete(o.instanceId);
|
|
@@ -2169,7 +2558,7 @@ var ze = (e) => {
|
|
|
2169
2558
|
subscribe(t) {
|
|
2170
2559
|
a.add(t);
|
|
2171
2560
|
let n = e.workbench.resources.preview.subscribeRefresh(async (e) => {
|
|
2172
|
-
let t = [...r.values()].filter((t) => t.resource &&
|
|
2561
|
+
let t = [...r.values()].filter((t) => t.resource && w(t.resource) === w(e));
|
|
2173
2562
|
t.length && (s++, await Promise.all(t.map(c)));
|
|
2174
2563
|
}), i = e.subscribeRefreshEvents?.((e) => {
|
|
2175
2564
|
if (o.has(e.id)) {
|
|
@@ -2182,24 +2571,25 @@ var ze = (e) => {
|
|
|
2182
2571
|
} };
|
|
2183
2572
|
}
|
|
2184
2573
|
};
|
|
2185
|
-
},
|
|
2574
|
+
}, Wr = (e) => {
|
|
2186
2575
|
for (let t = e.length - 1; t >= 0; --t) e[t]?.dispose();
|
|
2187
|
-
},
|
|
2576
|
+
}, Gr = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, Kr = (e, t, n, r, i) => e.prepareCommandArgs?.(t, n, r, i) ?? n, qr = (e, t) => t.commands.map((t) => e.workbench.commands.registerCommand({
|
|
2188
2577
|
id: t.id,
|
|
2189
|
-
label:
|
|
2190
|
-
description:
|
|
2191
|
-
params:
|
|
2578
|
+
label: z(t.title, t.id),
|
|
2579
|
+
description: z(t.description),
|
|
2580
|
+
params: W(t.params, z, t.extensionId),
|
|
2192
2581
|
resourceMutation: t.resourceMutation
|
|
2193
2582
|
}, {
|
|
2194
|
-
prepareArgs: (n, r, i) =>
|
|
2195
|
-
execute: (n, r) =>
|
|
2196
|
-
params:
|
|
2583
|
+
prepareArgs: (n, r, i) => Kr(e, t.id, n, r, i),
|
|
2584
|
+
execute: (n, r) => U(e, t.id, {
|
|
2585
|
+
params: Gr(n),
|
|
2197
2586
|
resource: r?.resource,
|
|
2198
|
-
signal: r?.signal
|
|
2587
|
+
signal: r?.signal,
|
|
2588
|
+
region: r?.region
|
|
2199
2589
|
})
|
|
2200
|
-
})),
|
|
2590
|
+
})), Jr = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), Yr = (e, t) => {
|
|
2201
2591
|
if (!e.menuSlotsById) return [];
|
|
2202
|
-
let { registrations: n } =
|
|
2592
|
+
let { registrations: n } = on({
|
|
2203
2593
|
metadata: e.metadata,
|
|
2204
2594
|
menuSlotsById: e.menuSlotsById,
|
|
2205
2595
|
menuTargetsById: e.menuTargetsById,
|
|
@@ -2212,14 +2602,14 @@ var ze = (e) => {
|
|
|
2212
2602
|
}]
|
|
2213
2603
|
}));
|
|
2214
2604
|
return (e.menuRegistrations ?? r).flatMap((n) => [e.workbench.commands.registerCommand(n.command, {
|
|
2215
|
-
prepareArgs: (e, r, i) =>
|
|
2216
|
-
execute: (r, i) =>
|
|
2605
|
+
prepareArgs: (e, r, i) => Kr(t, n.targetCommandId, e, r, i),
|
|
2606
|
+
execute: (r, i) => U(t, n.targetCommandId, {
|
|
2217
2607
|
params: {
|
|
2218
2608
|
...n.contribution.params ?? {},
|
|
2219
|
-
...
|
|
2609
|
+
...Gr(r) ?? {}
|
|
2220
2610
|
},
|
|
2221
|
-
resource:
|
|
2222
|
-
slot:
|
|
2611
|
+
resource: Jr(e, i),
|
|
2612
|
+
slot: V({
|
|
2223
2613
|
id: n.contribution.slotId,
|
|
2224
2614
|
kind: "menu",
|
|
2225
2615
|
projectId: e.projectId,
|
|
@@ -2227,75 +2617,71 @@ var ze = (e) => {
|
|
|
2227
2617
|
})
|
|
2228
2618
|
})
|
|
2229
2619
|
}), ...n.menuItems.map(({ menuPath: t, menuItem: n }) => e.workbench.layout.registerMenuItem(t, n))]);
|
|
2230
|
-
},
|
|
2231
|
-
prepareArgs: (e, t, i) =>
|
|
2232
|
-
execute: (
|
|
2620
|
+
}, Xr = (e, n) => sn({ metadata: e.metadata }).flatMap((r) => [e.workbench.commands.registerCommand(r.command, {
|
|
2621
|
+
prepareArgs: (e, t, i) => Kr(n, r.targetCommandId, e, t, i),
|
|
2622
|
+
execute: (t, i) => U(n, r.targetCommandId, {
|
|
2233
2623
|
params: {
|
|
2234
2624
|
...r.contribution.params ?? {},
|
|
2235
|
-
...
|
|
2625
|
+
...Gr(t) ?? {}
|
|
2236
2626
|
},
|
|
2237
|
-
resource:
|
|
2238
|
-
slot:
|
|
2627
|
+
resource: Jr(e, i),
|
|
2628
|
+
slot: V({
|
|
2239
2629
|
id: "workbench.commandPalette",
|
|
2240
2630
|
kind: "menu",
|
|
2241
|
-
projectId:
|
|
2631
|
+
projectId: e.projectId,
|
|
2242
2632
|
context: { panelId: r.contribution.id }
|
|
2243
2633
|
})
|
|
2244
2634
|
}),
|
|
2245
|
-
isVisible: () =>
|
|
2246
|
-
}),
|
|
2635
|
+
isVisible: () => re(r.contribution.when, e.workbench.getPrimaryResource()?.type)
|
|
2636
|
+
}), e.workbench.layout.registerMenuItem(t, r.menuItem)]), Zr = (e, t) => {
|
|
2247
2637
|
let n = t?.mode;
|
|
2248
2638
|
if (!n) return !0;
|
|
2249
2639
|
let r = e.workbench.modes.getActiveModeId() ?? "";
|
|
2250
2640
|
return Array.isArray(n) ? n.includes(r) : n === r;
|
|
2251
|
-
},
|
|
2641
|
+
}, Qr = (e) => (e.metadata.statusBarItems ?? []).map((t) => e.workbench.statusBar.registerItem({
|
|
2252
2642
|
id: t.id,
|
|
2253
2643
|
viewId: t.viewId,
|
|
2254
2644
|
slot: t.slot,
|
|
2255
2645
|
order: t.order,
|
|
2256
|
-
isVisible: () =>
|
|
2257
|
-
})),
|
|
2258
|
-
kind: t.id,
|
|
2259
|
-
label: P(t.label, t.id),
|
|
2260
|
-
icon: t.icon ?? "FileText"
|
|
2261
|
-
})), sr = (e) => e.metadata.modes.map((t) => e.workbench.modes.registerMode({
|
|
2646
|
+
isVisible: () => Zr(e, t.when)
|
|
2647
|
+
})), $r = (e) => e.metadata.pages.map((t) => e.workbench.pages.registerPage(t)), ei = (e) => e.metadata.modes.map((t) => e.workbench.modes.registerMode({
|
|
2262
2648
|
id: t.modeId,
|
|
2263
|
-
label:
|
|
2649
|
+
label: z(t.label, t.modeId),
|
|
2264
2650
|
panels: t.panelRegions,
|
|
2265
2651
|
regionSettings: t.regionSettings,
|
|
2266
2652
|
floatingPanels: t.floatingPanels,
|
|
2267
2653
|
defaultTheme: t.defaultTheme,
|
|
2268
2654
|
chrome: t.chrome,
|
|
2269
2655
|
activate: () => void 0
|
|
2270
|
-
})),
|
|
2656
|
+
})), ti = (e) => e.metadata.placements.map((t) => e.workbench.modePlacements.registerPlacement(t)), ni = (e) => {
|
|
2271
2657
|
let t = {
|
|
2272
2658
|
...e,
|
|
2273
|
-
metadata:
|
|
2659
|
+
metadata: wr(e.metadata, { createTab: (t) => Ur(e, t) })
|
|
2274
2660
|
}, n = [], r = t;
|
|
2275
2661
|
try {
|
|
2276
|
-
return n.push(
|
|
2662
|
+
return n.push(...qr(r, t.metadata)), n.push(...ur({
|
|
2277
2663
|
bindings: t.metadata.keybindings,
|
|
2278
2664
|
createWhenExpression: t.createKeybindingWhenExpression,
|
|
2279
2665
|
workbench: t.workbench
|
|
2280
|
-
})), n.push(...
|
|
2666
|
+
})), n.push(...Yr(t, r)), n.push(...Xr(t, r)), n.push(Qn({
|
|
2281
2667
|
...t,
|
|
2282
2668
|
resolveNodeResource: t.resolveTreeNodeResource
|
|
2283
|
-
})), n.push(
|
|
2669
|
+
})), n.push(pn(t)), n.push(Ut(r, t.metadata.controlsRenderers ?? [])), n.push(...Ir(t)), n.push(...zr(t)), n.push(zn(r, t.metadata.kanbanRenderers ?? [], t.kanbanAdapter)), n.push(Xt(r, t.metadata.dataTableRenderers ?? [], t.dataTableAdapter)), n.push(...Rr(t)), n.push(Bt(r, t.metadata.commandPaletteResources ?? [])), n.push(...or({
|
|
2284
2670
|
createWhenExpression: e.createNavigationWhenExpression,
|
|
2285
2671
|
metadata: e.metadata,
|
|
2286
2672
|
workbench: e.workbench
|
|
2287
|
-
})), e.subscribeRefreshEvents && n.push(
|
|
2673
|
+
})), e.subscribeRefreshEvents && n.push(Dr({
|
|
2288
2674
|
metadata: e.metadata,
|
|
2289
2675
|
subscribe: e.subscribeRefreshEvents,
|
|
2290
2676
|
workbench: e.workbench
|
|
2291
|
-
})), n.push(...
|
|
2292
|
-
|
|
2677
|
+
})), n.push(...Qr(t)), n.push(...sr(t)), n.push(...$r(t)), n.push(...ei(t)), n.push(...ti(t)), { dispose() {
|
|
2678
|
+
Wr(n);
|
|
2293
2679
|
} };
|
|
2294
2680
|
} catch (e) {
|
|
2295
|
-
throw
|
|
2681
|
+
throw Wr(n), e;
|
|
2296
2682
|
}
|
|
2297
2683
|
};
|
|
2298
2684
|
//#endregion
|
|
2299
|
-
export {
|
|
2685
|
+
export { P as WebviewHostCapabilityError, sn as buildWorkbenchExtensionCommandPaletteRegistrations, on as buildWorkbenchExtensionMenuRegistrations, V as createExtensionSlot, Tt as createExtensionWebviewHostCapabilities, Qe as createTerminalSessionCapability, Ot as createWorkbenchWebviewHostAdapters, kt as createWorkbenchWebviewHostCapabilities, Qt as emptyWorkbenchExtensionMetadata, H as executeWorkbenchExtensionCommandResponse, dn as fileRendererRefreshEnvelopeFromCommand, Mt as getBridgeWebviewHostEventPublisher, Or as refreshOpenWorkbenchExtensionWebviews, Tr as refreshWorkbenchExtensionRenderer, Bt as registerWorkbenchExtensionCommandPaletteResources, ni as registerWorkbenchExtensionContributions, Ut as registerWorkbenchExtensionControlsRenderers, Xt as registerWorkbenchExtensionDataTableRenderers, pn as registerWorkbenchExtensionFileRenderers, zn as registerWorkbenchExtensionKanbanRenderers, Dr as registerWorkbenchExtensionRendererRefreshEvents, Qn as registerWorkbenchExtensionTreeRenderers, Nt as renderBridgeWebviewFrame, R as toWorkbenchNavigationTarget, dr as toWorkbenchWhenExpression, _t as withFrameSignal };
|
|
2300
2686
|
|
|
2301
2687
|
//# sourceMappingURL=extensions.js.map
|