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