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