@pstdio/workbench 0.36.1 → 0.38.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 +1 -1
- package/dist/extensions.d.ts +5 -7
- package/dist/extensions.js +380 -393
- package/dist/extensions.js.map +1 -1
- package/dist/{file-renderer-view-DKu2l8bT.js → file-renderer-view-B1tNSzpa.js} +2 -2
- package/dist/{file-renderer-view-DKu2l8bT.js.map → file-renderer-view-B1tNSzpa.js.map} +1 -1
- package/dist/{index-DSsmgN2a.d.ts → index-Cl3NI1pb.d.ts} +11 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/{kanban-presentation-BWhkLbw3.d.ts → kanban-presentation-Mb9rbE48.d.ts} +1 -1
- package/dist/navigation-tree-registry-CKB9qsW1.js +102 -0
- package/dist/navigation-tree-registry-CKB9qsW1.js.map +1 -0
- package/dist/{react-BxrTklvM.js → react-Dnt2zZRw.js} +349 -306
- package/dist/react-Dnt2zZRw.js.map +1 -0
- package/dist/react.d.ts +2 -2
- package/dist/react.js +1 -1
- package/dist/storage.d.ts +1 -1
- package/dist/webview-runtime.js +1 -1
- package/package.json +3 -3
- package/dist/navigation-tree-registry-CTidmvVs.js +0 -91
- package/dist/navigation-tree-registry-CTidmvVs.js.map +0 -1
- package/dist/react-BxrTklvM.js.map +0 -1
package/dist/extensions.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { x as e } from "./workbench-renderers-RPeMVtTc.js";
|
|
2
|
-
import { n as t } from "./navigation-tree-registry-
|
|
3
|
-
import { b as n, c as r, rt as i } from "./react-
|
|
4
|
-
import { ALWAYS_AVAILABLE_WEBVIEW_CAPABILITIES as a,
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { createElement as
|
|
7
|
-
import { renderBadgeListDisplay as
|
|
2
|
+
import { n as t } from "./navigation-tree-registry-CKB9qsW1.js";
|
|
3
|
+
import { b as n, c as r, rt as i } from "./react-Dnt2zZRw.js";
|
|
4
|
+
import { ALWAYS_AVAILABLE_WEBVIEW_CAPABILITIES as a, WEBVIEW_DECLARABLE_CAPABILITIES as o, WEBVIEW_HOST_CAPABILITIES as s, WEBVIEW_HOST_CAPABILITY_VERSION as c, WEBVIEW_SCOPED_DECLARABLE_CAPABILITIES as l, isLocalizedString as u, isNavigationTarget as d, matchesResourceWhen as f, qualifyNavigationTarget as p, resourceKey as m } from "@pstdio/sdk/extensions";
|
|
5
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
6
|
+
import { createElement as _, useEffect as v, useRef as y, useState as ee } from "react";
|
|
7
|
+
import { renderBadgeListDisplay as b } from "@pstdio/ui/kanban-renderer";
|
|
8
8
|
import { host as te } from "rimless";
|
|
9
9
|
//#region ../pstdio-api-contracts/src/extension-kernel/l10n.ts
|
|
10
|
-
var
|
|
10
|
+
var x = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n == "string", S = /* @__PURE__ */ new Set([...s, ...o]), C = new Set(l), w = (e) => S.has(e), T = (e) => C.has(e), E = (e) => {
|
|
11
11
|
let [t = "", n] = e.split("@"), r = t.indexOf(":");
|
|
12
12
|
return {
|
|
13
13
|
capability: e,
|
|
14
14
|
name: r === -1 ? t : t.slice(0, r),
|
|
15
15
|
scope: r === -1 ? void 0 : t.slice(r + 1),
|
|
16
|
-
version: n === void 0 ?
|
|
16
|
+
version: n === void 0 ? c : Number(n)
|
|
17
17
|
};
|
|
18
|
-
},
|
|
18
|
+
}, D = (e) => T(e.name) ? !!e.scope : e.scope === void 0, O = (e) => ({
|
|
19
19
|
capability: e,
|
|
20
20
|
code: "unsupported_webview_capability",
|
|
21
21
|
message: `Unsupported webview capability: ${e}`,
|
|
22
22
|
severity: "error"
|
|
23
|
-
}),
|
|
23
|
+
}), k = (e, t, n) => ({
|
|
24
24
|
capability: e,
|
|
25
25
|
code: "unsupported_webview_capability_version",
|
|
26
|
-
message: `Unsupported webview capability version: ${t}@${n.toString()} (supported: ${
|
|
26
|
+
message: `Unsupported webview capability version: ${t}@${n.toString()} (supported: ${c.toString()})`,
|
|
27
27
|
severity: "error"
|
|
28
|
-
}),
|
|
28
|
+
}), A = (e) => ({
|
|
29
29
|
capability: e,
|
|
30
30
|
code: "undeclared_webview_capability",
|
|
31
31
|
message: `Webview did not declare host capability: ${e}`,
|
|
@@ -34,17 +34,18 @@ var b = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
34
34
|
let n = [], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map();
|
|
35
35
|
for (let e of a) t[e] && r.add(e);
|
|
36
36
|
for (let a of e ?? []) {
|
|
37
|
-
let e =
|
|
38
|
-
if (!
|
|
39
|
-
n.push(
|
|
37
|
+
let e = E(a);
|
|
38
|
+
if (!w(e.name) || !D(e)) {
|
|
39
|
+
n.push(O(a));
|
|
40
40
|
continue;
|
|
41
41
|
}
|
|
42
|
-
if (e.version !==
|
|
43
|
-
n.push(
|
|
42
|
+
if (e.version !== c) {
|
|
43
|
+
n.push(k(a, e.name, e.version));
|
|
44
44
|
continue;
|
|
45
45
|
}
|
|
46
|
+
if (e.name === "clipboard.write") continue;
|
|
46
47
|
if (!t[e.name]) {
|
|
47
|
-
n.push(
|
|
48
|
+
n.push(O(a));
|
|
48
49
|
continue;
|
|
49
50
|
}
|
|
50
51
|
if (e.scope === void 0) {
|
|
@@ -69,14 +70,14 @@ var b = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
69
70
|
return {
|
|
70
71
|
diagnostics: r,
|
|
71
72
|
async call(r) {
|
|
72
|
-
if (!
|
|
73
|
-
if (
|
|
73
|
+
if (!w(r.method) || r.method === "clipboard.write") throw a(O(r.method));
|
|
74
|
+
if (T(r.method)) {
|
|
74
75
|
let e = re(r);
|
|
75
|
-
if (!e) throw a(
|
|
76
|
-
if (!n.get(r.method)?.has(e)) throw a(
|
|
77
|
-
} else if (!t.has(r.method)) throw a(
|
|
76
|
+
if (!e) throw a(O(r.method));
|
|
77
|
+
if (!n.get(r.method)?.has(e)) throw a(A(`${r.method}:${e}`));
|
|
78
|
+
} else if (!t.has(r.method)) throw a(A(r.method));
|
|
78
79
|
let i = e.capabilities[r.method];
|
|
79
|
-
if (!i) throw a(
|
|
80
|
+
if (!i) throw a(O(r.method));
|
|
80
81
|
return await i(r.params);
|
|
81
82
|
}
|
|
82
83
|
};
|
|
@@ -104,7 +105,7 @@ var b = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
104
105
|
} : { message: t } : { message: oe(e) };
|
|
105
106
|
}
|
|
106
107
|
return e == null ? { message: "Unknown error" } : { message: oe(e) };
|
|
107
|
-
},
|
|
108
|
+
}, ce = (e = []) => e.some((e) => e === "clipboard.write" || e === "clipboard.write@1") ? "fullscreen; clipboard-write" : "fullscreen", j = () => {
|
|
108
109
|
if (typeof document > "u") return {};
|
|
109
110
|
let e = getComputedStyle(document.documentElement), t = {};
|
|
110
111
|
for (let n = 0; n < e.length; n += 1) {
|
|
@@ -112,26 +113,26 @@ var b = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
112
113
|
r.startsWith("--chakra-") && (t[r] = e.getPropertyValue(r).trim());
|
|
113
114
|
}
|
|
114
115
|
return t;
|
|
115
|
-
},
|
|
116
|
+
}, M = (e) => {
|
|
116
117
|
if (typeof document > "u") return e;
|
|
117
118
|
let t = document.documentElement.getAttribute("data-theme");
|
|
118
119
|
if (t === "dark" || t === "light") return t;
|
|
119
120
|
let n = document.documentElement.getAttribute("data-color-mode");
|
|
120
121
|
return n === "dark" || n === "light" ? n : e;
|
|
121
|
-
},
|
|
122
|
+
}, le = {
|
|
122
123
|
border: 0,
|
|
123
124
|
display: "block",
|
|
124
125
|
flex: "1 1 0%",
|
|
125
126
|
height: "100%",
|
|
126
127
|
minHeight: 0,
|
|
127
128
|
width: "100%"
|
|
128
|
-
},
|
|
129
|
+
}, ue = {
|
|
129
130
|
display: "flex",
|
|
130
131
|
height: "100%",
|
|
131
132
|
minHeight: 0,
|
|
132
133
|
position: "relative",
|
|
133
134
|
width: "100%"
|
|
134
|
-
},
|
|
135
|
+
}, de = {
|
|
135
136
|
alignItems: "center",
|
|
136
137
|
background: "rgba(255, 255, 255, 0.92)",
|
|
137
138
|
color: "#7a1f12",
|
|
@@ -142,18 +143,18 @@ var b = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
142
143
|
position: "absolute",
|
|
143
144
|
textAlign: "center",
|
|
144
145
|
zIndex: 1
|
|
145
|
-
},
|
|
146
|
-
let { view: t, props: n, theme: r, capabilities: i, hostEvents: a, onReady: o, onError: s, onDiagnostics: c, title: l } = e, u =
|
|
147
|
-
return
|
|
146
|
+
}, fe = "allow-scripts allow-forms allow-popups", pe = (e) => {
|
|
147
|
+
let { view: t, props: n, theme: r, capabilities: i, hostEvents: a, onReady: o, onError: s, onDiagnostics: c, title: l } = e, u = y(null), d = y(null), f = y(null), p = y(!1), m = y(null), _ = y(n), b = y(r), x = y(i), S = y(a), C = y(t.webview.capabilities), w = y(o), T = y(s), E = y(c), [D, O] = ee(null), [k, A] = ee(0);
|
|
148
|
+
return _.current = n, b.current = r, x.current = i, S.current = a, C.current = t.webview.capabilities, w.current = o, T.current = s, E.current = c, v(() => {
|
|
148
149
|
let e = u.current;
|
|
149
150
|
if (!e) return;
|
|
150
151
|
let n = () => {
|
|
151
|
-
d.current === e ?
|
|
152
|
+
d.current === e ? A((e) => e + 1) : d.current = e;
|
|
152
153
|
};
|
|
153
154
|
e.addEventListener("load", n);
|
|
154
155
|
let r = () => e.removeEventListener("load", n), i = `${k}\n${t.webview.runtimeUrl}\n${t.webview.moduleUrl}`;
|
|
155
|
-
if (
|
|
156
|
-
|
|
156
|
+
if (m.current === i) return r;
|
|
157
|
+
m.current = i;
|
|
157
158
|
let a = t.webview.styles, o = t.webview.moduleUrl, s = (e) => {
|
|
158
159
|
e.length > 0 && E.current?.(e);
|
|
159
160
|
}, c = () => ie({
|
|
@@ -178,9 +179,9 @@ var b = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
178
179
|
f.current = r, S.current?.bind((e) => r.hostEvent?.(e)), await r.init({
|
|
179
180
|
moduleUrl: o,
|
|
180
181
|
styles: a,
|
|
181
|
-
props:
|
|
182
|
-
theme:
|
|
183
|
-
themeVariables:
|
|
182
|
+
props: _.current,
|
|
183
|
+
theme: M(b.current),
|
|
184
|
+
themeVariables: j(),
|
|
184
185
|
extensionId: t.extensionId
|
|
185
186
|
}), u.current === e && (p.current = !0, O(null), w.current?.());
|
|
186
187
|
}).catch((t) => {
|
|
@@ -195,23 +196,23 @@ var b = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
195
196
|
t.webview.runtimeUrl,
|
|
196
197
|
t.webview.moduleUrl,
|
|
197
198
|
t.webview.styles
|
|
198
|
-
]),
|
|
199
|
+
]), v(() => {
|
|
199
200
|
let e = f.current;
|
|
200
201
|
if (e && a) return a.bind((t) => e.hostEvent?.(t)), () => a.unbind();
|
|
201
|
-
}, [a]),
|
|
202
|
+
}, [a]), v(() => {
|
|
202
203
|
p.current && f.current?.propsUpdate({ props: n });
|
|
203
|
-
}, [n]),
|
|
204
|
+
}, [n]), v(() => {
|
|
204
205
|
p.current && f.current?.themeUpdate({
|
|
205
|
-
theme:
|
|
206
|
-
variables:
|
|
206
|
+
theme: M(r),
|
|
207
|
+
variables: j()
|
|
207
208
|
});
|
|
208
|
-
}, [r]),
|
|
209
|
+
}, [r]), v(() => {
|
|
209
210
|
if (typeof window > "u" || typeof MutationObserver > "u") return;
|
|
210
211
|
let e = null, t = new MutationObserver(() => {
|
|
211
212
|
e !== null && cancelAnimationFrame(e), e = requestAnimationFrame(() => {
|
|
212
213
|
e = null, p.current && f.current?.themeUpdate({
|
|
213
|
-
theme:
|
|
214
|
-
variables:
|
|
214
|
+
theme: M(b.current),
|
|
215
|
+
variables: j()
|
|
215
216
|
});
|
|
216
217
|
});
|
|
217
218
|
}), n = {
|
|
@@ -226,20 +227,20 @@ var b = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
226
227
|
return t.observe(document.documentElement, n), t.observe(document.body, n), () => {
|
|
227
228
|
t.disconnect(), e !== null && cancelAnimationFrame(e);
|
|
228
229
|
};
|
|
229
|
-
}, []), /* @__PURE__ */
|
|
230
|
-
style:
|
|
231
|
-
children: [D ? /* @__PURE__ */
|
|
230
|
+
}, []), /* @__PURE__ */ g("div", {
|
|
231
|
+
style: ue,
|
|
232
|
+
children: [D ? /* @__PURE__ */ h("div", {
|
|
232
233
|
role: "alert",
|
|
233
|
-
style:
|
|
234
|
-
children: /* @__PURE__ */
|
|
235
|
-
}) : null, /* @__PURE__ */
|
|
234
|
+
style: de,
|
|
235
|
+
children: /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("strong", { children: "Extension view failed to load." }), /* @__PURE__ */ h("div", { children: D })] })
|
|
236
|
+
}) : null, /* @__PURE__ */ h("iframe", {
|
|
236
237
|
ref: u,
|
|
237
238
|
title: l ?? t.label,
|
|
238
|
-
allow:
|
|
239
|
+
allow: ce(t.webview.capabilities),
|
|
239
240
|
allowFullScreen: !0,
|
|
240
|
-
sandbox:
|
|
241
|
+
sandbox: fe,
|
|
241
242
|
style: {
|
|
242
|
-
...
|
|
243
|
+
...le,
|
|
243
244
|
colorScheme: r
|
|
244
245
|
},
|
|
245
246
|
onError: () => {
|
|
@@ -248,10 +249,10 @@ var b = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
248
249
|
}
|
|
249
250
|
}, `${k}\n${t.webview.runtimeUrl}\n${t.webview.moduleUrl}`)]
|
|
250
251
|
});
|
|
251
|
-
},
|
|
252
|
-
t(`${
|
|
253
|
-
},
|
|
254
|
-
let n = (n) =>
|
|
252
|
+
}, me = "[pstdio.extension-host] ", he = (e, t = console.info) => {
|
|
253
|
+
t(`${me}${JSON.stringify(e)}`);
|
|
254
|
+
}, ge = (e, t) => {
|
|
255
|
+
let n = (n) => he({
|
|
255
256
|
extensionId: e.extensionId,
|
|
256
257
|
contributionId: e.id,
|
|
257
258
|
...n
|
|
@@ -269,7 +270,7 @@ var b = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
269
270
|
});
|
|
270
271
|
}
|
|
271
272
|
};
|
|
272
|
-
},
|
|
273
|
+
}, _e = () => {
|
|
273
274
|
let e = null, t = [], n = /* @__PURE__ */ new Set();
|
|
274
275
|
return {
|
|
275
276
|
emit(n) {
|
|
@@ -286,10 +287,10 @@ var b = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
286
287
|
for (let e of n) e();
|
|
287
288
|
}
|
|
288
289
|
};
|
|
289
|
-
},
|
|
290
|
+
}, ve = "terminal.session", ye = (e) => {
|
|
290
291
|
let { terminal: t, hostEvents: n } = e, r = (e) => {
|
|
291
292
|
n.emit({
|
|
292
|
-
scope:
|
|
293
|
+
scope: ve,
|
|
293
294
|
payload: e
|
|
294
295
|
});
|
|
295
296
|
};
|
|
@@ -350,7 +351,7 @@ var b = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
350
351
|
}
|
|
351
352
|
}
|
|
352
353
|
};
|
|
353
|
-
},
|
|
354
|
+
}, be = (e) => {
|
|
354
355
|
if (typeof document > "u") return;
|
|
355
356
|
let t = new KeyboardEvent("keydown", {
|
|
356
357
|
...e,
|
|
@@ -358,7 +359,7 @@ var b = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
358
359
|
cancelable: !0
|
|
359
360
|
});
|
|
360
361
|
document.dispatchEvent(t);
|
|
361
|
-
},
|
|
362
|
+
}, xe = (e) => ({
|
|
362
363
|
...e.placement?.placementIdentity ? { "placement.close": (t) => {
|
|
363
364
|
if (t !== void 0 && (typeof t != "object" || !t || Array.isArray(t) || Object.keys(t).length > 0)) throw Error("placement.close takes no parameters; the host supplies the calling placement.");
|
|
364
365
|
e.workbench.closePlacement(e.placement.placementIdentity);
|
|
@@ -391,19 +392,19 @@ var b = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
391
392
|
value: n.value
|
|
392
393
|
};
|
|
393
394
|
},
|
|
394
|
-
"host.dispatchKeyboardEvent": (t) => (e.dispatchKeyboardEvent ??
|
|
395
|
-
...e.hostEvents ? { "terminal.session":
|
|
395
|
+
"host.dispatchKeyboardEvent": (t) => (e.dispatchKeyboardEvent ?? be)(t),
|
|
396
|
+
...e.hostEvents ? { "terminal.session": ye({
|
|
396
397
|
terminal: e.workbench.terminal,
|
|
397
398
|
hostEvents: e.hostEvents
|
|
398
399
|
}) } : {}
|
|
399
|
-
}),
|
|
400
|
-
let n =
|
|
401
|
-
n || (n = /* @__PURE__ */ new Map(),
|
|
400
|
+
}), Se = () => "light", Ce = /* @__PURE__ */ new WeakMap(), we = (e, t) => {
|
|
401
|
+
let n = Ce.get(e);
|
|
402
|
+
n || (n = /* @__PURE__ */ new Map(), Ce.set(e, n));
|
|
402
403
|
let r = t.instanceId, i = n.get(r);
|
|
403
|
-
return i || (i =
|
|
404
|
-
},
|
|
405
|
-
let { context: t, createHostCapabilities: n, createProps: r, createTheme: i =
|
|
406
|
-
return /* @__PURE__ */
|
|
404
|
+
return i || (i = _e(), n.set(r, i)), i;
|
|
405
|
+
}, Te = (e) => {
|
|
406
|
+
let { context: t, createHostCapabilities: n, createProps: r, createTheme: i = Se, ownerId: a, title: o, webview: s } = e;
|
|
407
|
+
return /* @__PURE__ */ h(pe, {
|
|
407
408
|
view: {
|
|
408
409
|
extensionId: a ?? "workbench",
|
|
409
410
|
id: t.webviewId,
|
|
@@ -419,12 +420,12 @@ var b = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
419
420
|
theme: i(t),
|
|
420
421
|
capabilities: n(t),
|
|
421
422
|
hostEvents: t.hostEvents,
|
|
422
|
-
...
|
|
423
|
+
...ge({
|
|
423
424
|
extensionId: a ?? "workbench",
|
|
424
425
|
id: t.webviewId
|
|
425
426
|
})
|
|
426
427
|
});
|
|
427
|
-
},
|
|
428
|
+
}, N = (e, t = "") => e === void 0 ? t : x(e) ? e.default ?? e.$l10n : e, Ee = (e, t) => {
|
|
428
429
|
let n = t.commandTargetOf?.(e);
|
|
429
430
|
if (n) return n;
|
|
430
431
|
let r = e.target.command, i = r.extensionId ?? t.extensionId;
|
|
@@ -434,37 +435,28 @@ var b = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
434
435
|
args: e.target.params
|
|
435
436
|
};
|
|
436
437
|
};
|
|
437
|
-
function
|
|
438
|
-
if (!
|
|
439
|
-
return t.extensionId && (e =
|
|
438
|
+
function P(e, t = {}) {
|
|
439
|
+
if (!d(e)) throw Error("Invalid navigation target.");
|
|
440
|
+
return t.extensionId && (e = p(e, t.extensionId, t.projectId)), e.kind === "command" ? Ee(e, t) : e.kind === "href" || e.kind === "page" || e.kind === "panel" ? e : {
|
|
440
441
|
kind: "compound",
|
|
441
|
-
targets: e.targets.map((e) =>
|
|
442
|
+
targets: e.targets.map((e) => P(e, t))
|
|
442
443
|
};
|
|
443
444
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
return N(e, t);
|
|
448
|
-
}
|
|
449
|
-
}, Ee = (e) => {
|
|
445
|
+
//#endregion
|
|
446
|
+
//#region src/extensions/host/command-response.ts
|
|
447
|
+
var De = (e) => {
|
|
450
448
|
let t = e;
|
|
451
449
|
if (!t?.outcome) return e;
|
|
452
450
|
if (t.outcome.status === "success") return t.outcome.value;
|
|
453
451
|
throw Error(t.outcome.reason ?? t.outcome.error?.message ?? "Extension command failed.");
|
|
454
|
-
},
|
|
452
|
+
}, F = (e) => ({
|
|
455
453
|
id: e.id,
|
|
456
454
|
kind: e.kind,
|
|
457
455
|
context: {
|
|
458
456
|
projectId: e.projectId,
|
|
459
457
|
...e.context ?? {}
|
|
460
458
|
}
|
|
461
|
-
}),
|
|
462
|
-
if (De(e) && e.deleted === !0) return typeof e.id == "string" ? e.id : void 0;
|
|
463
|
-
}, ke = async (e, t, n) => {
|
|
464
|
-
if (!t || Oe(n) !== (t.id ?? p(t)) || p(e.workbench.getPrimaryResource()) !== p(t)) return;
|
|
465
|
-
let r = e.workbench.pageLocations.navigateToParent();
|
|
466
|
-
if (!r.ok) throw Error(r.diagnostic.message);
|
|
467
|
-
}, L = async (e, t, n = {}) => {
|
|
459
|
+
}), I = async (e, t, n = {}) => {
|
|
468
460
|
let r = n.resource, i = await e.executeCommand(t, {
|
|
469
461
|
projectId: e.projectId,
|
|
470
462
|
...n.workspaceId ? { workspaceId: n.workspaceId } : {},
|
|
@@ -474,10 +466,10 @@ var P = u, F = (e, t = {}) => {
|
|
|
474
466
|
source: "dashboard",
|
|
475
467
|
...n.metadata ? { metadata: n.metadata } : {}
|
|
476
468
|
}, n.signal);
|
|
477
|
-
|
|
469
|
+
De(i);
|
|
478
470
|
let a = i?.outcome;
|
|
479
471
|
if (a?.status === "success") for (let t of a.navigationRequests ?? []) try {
|
|
480
|
-
await e.workbench.navigation.openTarget(
|
|
472
|
+
await e.workbench.navigation.openTarget(P(t));
|
|
481
473
|
} catch (t) {
|
|
482
474
|
e.workbench.notifications.show({
|
|
483
475
|
level: "warning",
|
|
@@ -486,34 +478,31 @@ var P = u, F = (e, t = {}) => {
|
|
|
486
478
|
});
|
|
487
479
|
}
|
|
488
480
|
return i;
|
|
489
|
-
},
|
|
490
|
-
let r = Ee(await L(e, t, n));
|
|
491
|
-
return await ke(e, n.resource, r), r;
|
|
492
|
-
}, Ae = (e) => typeof e == "object" && !!e && !Array.isArray(e), je = (e, t) => `${e.extensionId ?? t}.command.${e.id}`, Me = async (e, t, n) => {
|
|
481
|
+
}, L = async (e, t, n = {}) => De(await I(e, t, n)), Oe = (e) => typeof e == "object" && !!e && !Array.isArray(e), ke = (e, t) => `${e.extensionId ?? t}.command.${e.id}`, Ae = async (e, t, n) => {
|
|
493
482
|
let { target: r } = n;
|
|
494
483
|
if (r.kind === "command") {
|
|
495
|
-
await
|
|
484
|
+
await L(e, ke(r.target.command, t.extensionId), { params: r.target.params }), e.workbench.commandPaletteResources.refresh();
|
|
496
485
|
return;
|
|
497
486
|
}
|
|
498
|
-
await e.workbench.navigation.openTarget(
|
|
499
|
-
},
|
|
487
|
+
await e.workbench.navigation.openTarget(P(r, { extensionId: t.extensionId }));
|
|
488
|
+
}, je = (e, t, n, r) => ({
|
|
500
489
|
id: `${t.id}:${r.id}`,
|
|
501
490
|
label: r.label,
|
|
502
491
|
description: r.description,
|
|
503
492
|
icon: r.icon,
|
|
504
493
|
keywords: r.keywords,
|
|
505
494
|
group: n,
|
|
506
|
-
activate: () =>
|
|
507
|
-
}),
|
|
495
|
+
activate: () => Ae(e, t, r)
|
|
496
|
+
}), Me = (e, t) => {
|
|
508
497
|
let n = [];
|
|
509
498
|
for (let r of t) {
|
|
510
|
-
let t =
|
|
499
|
+
let t = N(r.title, r.id);
|
|
511
500
|
n.push(e.workbench.commandPaletteResources.registerProvider({
|
|
512
501
|
id: r.id,
|
|
513
502
|
title: t,
|
|
514
503
|
refreshEventIds: r.refreshEventIds,
|
|
515
504
|
query: async ({ query: n, limit: i }) => {
|
|
516
|
-
let a = e.workbench.getActiveResource(), o = await
|
|
505
|
+
let a = e.workbench.getActiveResource(), o = await L(e, r.queryHandlerId, { params: {
|
|
517
506
|
projectId: e.projectId,
|
|
518
507
|
modeId: e.workbench.modes.getActiveModeId(),
|
|
519
508
|
activeResource: a,
|
|
@@ -521,20 +510,20 @@ var P = u, F = (e, t = {}) => {
|
|
|
521
510
|
query: n,
|
|
522
511
|
limit: i
|
|
523
512
|
} });
|
|
524
|
-
return
|
|
513
|
+
return Oe(o) ? (o.items ?? []).map((n) => je(e, r, t, n)) : [];
|
|
525
514
|
}
|
|
526
515
|
}));
|
|
527
516
|
}
|
|
528
517
|
return { dispose() {
|
|
529
518
|
for (let e = n.length - 1; e >= 0; --e) n[e]?.dispose();
|
|
530
519
|
} };
|
|
531
|
-
},
|
|
532
|
-
let i =
|
|
520
|
+
}, R = (e, t = "") => N(e, t), Ne = (e, t, n) => {
|
|
521
|
+
let i = F({
|
|
533
522
|
id: t.id,
|
|
534
523
|
kind: "renderer",
|
|
535
524
|
projectId: e.projectId,
|
|
536
525
|
context: { controlsRendererId: t.id }
|
|
537
|
-
}), a = (n, r, a, o) => n ?
|
|
526
|
+
}), a = (n, r, a, o) => n ? L(e, n, {
|
|
538
527
|
params: {
|
|
539
528
|
renderer: {
|
|
540
529
|
rendererId: t.id,
|
|
@@ -551,12 +540,12 @@ var P = u, F = (e, t = {}) => {
|
|
|
551
540
|
}) : Promise.resolve(void 0);
|
|
552
541
|
return e.workbench.views.registerView({
|
|
553
542
|
id: t.id,
|
|
554
|
-
title:
|
|
543
|
+
title: R(t.title, t.id),
|
|
555
544
|
icon: t.icon,
|
|
556
545
|
body: {
|
|
557
546
|
kind: "controls",
|
|
558
|
-
emptyTitle:
|
|
559
|
-
emptyDescription:
|
|
547
|
+
emptyTitle: R(t.emptyTitle, ""),
|
|
548
|
+
emptyDescription: R(t.emptyDescription, ""),
|
|
560
549
|
defaultValues: t.defaultValues,
|
|
561
550
|
executeQuery: async (e, i) => {
|
|
562
551
|
let o = await a(t.queryHandlerId, {}, e ?? n.resolveResource?.(t), i), s = r.safeParse(o);
|
|
@@ -575,31 +564,31 @@ var P = u, F = (e, t = {}) => {
|
|
|
575
564
|
reset: t.resetHandlerId ? ({ controlIds: e, resource: n }) => a(t.resetHandlerId, { controlIds: e }, n).then(() => void 0) : void 0
|
|
576
565
|
}
|
|
577
566
|
});
|
|
578
|
-
},
|
|
567
|
+
}, Pe = (e, t, n = {}) => {
|
|
579
568
|
let r = [];
|
|
580
|
-
for (let i of t) r.push(
|
|
569
|
+
for (let i of t) r.push(Ne(e, i, n));
|
|
581
570
|
return { dispose() {
|
|
582
571
|
for (let e = r.length - 1; e >= 0; --e) r[e]?.dispose();
|
|
583
572
|
} };
|
|
584
|
-
},
|
|
573
|
+
}, z = (e, t = "") => N(e, t), Fe = (e) => ({
|
|
585
574
|
...e,
|
|
586
|
-
label:
|
|
587
|
-
description: e.description ?
|
|
588
|
-
icon: e.icon ?
|
|
575
|
+
label: z(e.label, e.id),
|
|
576
|
+
description: e.description ? z(e.description) : void 0,
|
|
577
|
+
icon: e.icon ? _(i, {
|
|
589
578
|
name: e.icon,
|
|
590
579
|
size: 14
|
|
591
580
|
}) : void 0
|
|
592
|
-
}),
|
|
581
|
+
}), Ie = (e) => !!(e && typeof e == "object" && Array.isArray(e.rows)), Le = (e) => ({
|
|
593
582
|
id: e.id,
|
|
594
583
|
values: e.values,
|
|
595
584
|
resource: e.resource ? e.resource : void 0
|
|
596
|
-
}),
|
|
597
|
-
let n = /* @__PURE__ */ new WeakMap(), r =
|
|
585
|
+
}), Re = (e, t) => {
|
|
586
|
+
let n = /* @__PURE__ */ new WeakMap(), r = F({
|
|
598
587
|
id: t.id,
|
|
599
588
|
kind: "dataTableRenderer",
|
|
600
589
|
projectId: e.projectId,
|
|
601
590
|
context: { dataTableRendererId: t.id }
|
|
602
|
-
}), a = (n, i, a, o, s) =>
|
|
591
|
+
}), a = (n, i, a, o, s) => L(e, n, {
|
|
603
592
|
params: {
|
|
604
593
|
renderer: {
|
|
605
594
|
rendererId: t.id,
|
|
@@ -617,41 +606,41 @@ var P = u, F = (e, t = {}) => {
|
|
|
617
606
|
});
|
|
618
607
|
return e.workbench.views.registerView({
|
|
619
608
|
id: t.id,
|
|
620
|
-
title:
|
|
609
|
+
title: z(t.title, t.id),
|
|
621
610
|
icon: t.icon,
|
|
622
611
|
body: {
|
|
623
612
|
kind: "dataTable",
|
|
624
613
|
resourceKind: t.resourceKind,
|
|
625
|
-
columns: t.columns?.map(
|
|
614
|
+
columns: t.columns?.map(Fe),
|
|
626
615
|
initialPageSize: t.initialPageSize,
|
|
627
616
|
pageSizeOptions: t.pageSizeOptions,
|
|
628
617
|
selectionMode: t.selectionMode,
|
|
629
618
|
selectionActions: t.selectionActions?.map((e) => ({
|
|
630
619
|
id: e.id,
|
|
631
|
-
label:
|
|
632
|
-
icon: e.icon ?
|
|
620
|
+
label: z(e.label, e.id),
|
|
621
|
+
icon: e.icon ? _(i, {
|
|
633
622
|
name: e.icon,
|
|
634
623
|
size: 16
|
|
635
624
|
}) : void 0,
|
|
636
625
|
destructive: e.destructive,
|
|
637
626
|
run: (t) => a(e.commandId, { rowIds: t.map((e) => e.id) }).then(() => void 0)
|
|
638
627
|
})),
|
|
639
|
-
emptyTitle: t.emptyTitle ?
|
|
640
|
-
emptyDescription: t.emptyDescription ?
|
|
628
|
+
emptyTitle: t.emptyTitle ? z(t.emptyTitle) : void 0,
|
|
629
|
+
emptyDescription: t.emptyDescription ? z(t.emptyDescription) : void 0,
|
|
641
630
|
executeQuery: async ({ resource: e, modeId: r }, i) => {
|
|
642
631
|
let o = await a(t.queryHandlerId, {}, e, r, i);
|
|
643
|
-
return
|
|
632
|
+
return Ie(o) ? {
|
|
644
633
|
rows: o.rows.map((e) => {
|
|
645
|
-
let t =
|
|
634
|
+
let t = Le(e);
|
|
646
635
|
return n.set(t, e), t;
|
|
647
636
|
}),
|
|
648
|
-
columns: o.columns?.map(
|
|
637
|
+
columns: o.columns?.map(Fe)
|
|
649
638
|
} : { rows: [] };
|
|
650
639
|
},
|
|
651
640
|
rowActions: t.rowActions?.map((n) => ({
|
|
652
641
|
id: n.id,
|
|
653
|
-
label:
|
|
654
|
-
icon: n.icon ?
|
|
642
|
+
label: z(n.label, n.id),
|
|
643
|
+
icon: n.icon ? _(i, {
|
|
655
644
|
name: n.icon,
|
|
656
645
|
size: 16
|
|
657
646
|
}) : void 0,
|
|
@@ -660,22 +649,21 @@ var P = u, F = (e, t = {}) => {
|
|
|
660
649
|
await a(n.commandId, { rowId: r.id }, r.resource), e.workbench.views.refreshView(t.id);
|
|
661
650
|
}
|
|
662
651
|
})),
|
|
663
|
-
onRowActivate: t.rowActivationHandlerId ? async (
|
|
664
|
-
|
|
665
|
-
i && await e.workbench.navigation.openTarget(i);
|
|
652
|
+
onRowActivate: t.rowActivationHandlerId ? async (e) => {
|
|
653
|
+
await a(t.rowActivationHandlerId, { row: n.get(e) ?? e }, e.resource);
|
|
666
654
|
} : void 0
|
|
667
655
|
}
|
|
668
656
|
});
|
|
669
|
-
},
|
|
670
|
-
let n = t.map((t) =>
|
|
657
|
+
}, ze = (e, t) => {
|
|
658
|
+
let n = t.map((t) => Re(e, t));
|
|
671
659
|
return { dispose() {
|
|
672
660
|
for (let e = n.length - 1; e >= 0; --e) n[e]?.dispose();
|
|
673
661
|
} };
|
|
674
|
-
},
|
|
662
|
+
}, Be = {
|
|
675
663
|
first: 0,
|
|
676
664
|
default: 1,
|
|
677
665
|
last: 2
|
|
678
|
-
},
|
|
666
|
+
}, Ve = {
|
|
679
667
|
commands: [],
|
|
680
668
|
commandPaletteContributions: [],
|
|
681
669
|
diagnostics: [],
|
|
@@ -693,7 +681,7 @@ var P = u, F = (e, t = {}) => {
|
|
|
693
681
|
statuses: [],
|
|
694
682
|
settingsPanels: [],
|
|
695
683
|
settingsDefinitions: []
|
|
696
|
-
},
|
|
684
|
+
}, He = (e) => `workbench.extension.menu.${e.id}`, Ue = (e) => `workbench.extension.palette.${e.id}`, We = (e, t) => Be[e.placement ?? "default"] * 1e3 + t, Ge = (e) => e === void 0 ? "" : u(e) ? e.default ?? e.$l10n : e, Ke = (e) => {
|
|
697
685
|
let { commandId: t, contribution: n, index: r, resolveString: i, slot: a, when: o } = e;
|
|
698
686
|
return {
|
|
699
687
|
commandId: t,
|
|
@@ -703,10 +691,10 @@ var P = u, F = (e, t = {}) => {
|
|
|
703
691
|
group: a.group ?? n.group,
|
|
704
692
|
args: n.params,
|
|
705
693
|
overflowLabel: a.overflowLabel,
|
|
706
|
-
order:
|
|
694
|
+
order: We(n, r),
|
|
707
695
|
when: o
|
|
708
696
|
};
|
|
709
|
-
},
|
|
697
|
+
}, qe = (e) => {
|
|
710
698
|
let { commandId: t, contribution: n, index: r, resolveString: i } = e;
|
|
711
699
|
return {
|
|
712
700
|
commandId: t,
|
|
@@ -714,10 +702,10 @@ var P = u, F = (e, t = {}) => {
|
|
|
714
702
|
icon: n.icon,
|
|
715
703
|
group: n.group,
|
|
716
704
|
args: n.params,
|
|
717
|
-
order:
|
|
705
|
+
order: We(n, r)
|
|
718
706
|
};
|
|
719
|
-
},
|
|
720
|
-
let { createCommandId: t =
|
|
707
|
+
}, Je = (e) => {
|
|
708
|
+
let { createCommandId: t = He, createWhenExpression: n, menuSlotsById: r, menuTargetsById: i, metadata: a, resolveString: o = Ge } = e, s = [], c = [];
|
|
721
709
|
return a.menuContributions.forEach((e, l) => {
|
|
722
710
|
let u = e.target ? i?.get(e.target) : r.get(e.slotId);
|
|
723
711
|
if (!u) {
|
|
@@ -738,7 +726,7 @@ var P = u, F = (e, t = {}) => {
|
|
|
738
726
|
params: f?.params
|
|
739
727
|
},
|
|
740
728
|
contribution: e,
|
|
741
|
-
menuItem:
|
|
729
|
+
menuItem: Ke({
|
|
742
730
|
commandId: d,
|
|
743
731
|
contribution: e,
|
|
744
732
|
index: l,
|
|
@@ -753,8 +741,8 @@ var P = u, F = (e, t = {}) => {
|
|
|
753
741
|
registrations: s,
|
|
754
742
|
unresolved: c
|
|
755
743
|
};
|
|
756
|
-
},
|
|
757
|
-
let { createCommandId: t =
|
|
744
|
+
}, Ye = (e) => {
|
|
745
|
+
let { createCommandId: t = Ue, metadata: n, resolveString: r = Ge } = e, i = [];
|
|
758
746
|
return (n.commandPaletteContributions ?? []).forEach((e, a) => {
|
|
759
747
|
let o = t(e), s = n.commands.find((t) => t.id === e.commandId);
|
|
760
748
|
i.push({
|
|
@@ -767,7 +755,7 @@ var P = u, F = (e, t = {}) => {
|
|
|
767
755
|
params: s?.params
|
|
768
756
|
},
|
|
769
757
|
contribution: e,
|
|
770
|
-
menuItem:
|
|
758
|
+
menuItem: qe({
|
|
771
759
|
commandId: o,
|
|
772
760
|
contribution: e,
|
|
773
761
|
index: a,
|
|
@@ -776,7 +764,7 @@ var P = u, F = (e, t = {}) => {
|
|
|
776
764
|
targetCommandId: e.commandId
|
|
777
765
|
});
|
|
778
766
|
}), i;
|
|
779
|
-
},
|
|
767
|
+
}, Xe = (e) => ({
|
|
780
768
|
id: e.rendererId,
|
|
781
769
|
kind: "renderer",
|
|
782
770
|
context: {
|
|
@@ -786,9 +774,9 @@ var P = u, F = (e, t = {}) => {
|
|
|
786
774
|
resourceId: e.resource.id
|
|
787
775
|
} : {}
|
|
788
776
|
}
|
|
789
|
-
}),
|
|
777
|
+
}), Ze = async (e, t, n, r, i = {}, a, o) => {
|
|
790
778
|
let s = r;
|
|
791
|
-
return
|
|
779
|
+
return L(e, n, {
|
|
792
780
|
params: {
|
|
793
781
|
renderer: {
|
|
794
782
|
rendererId: t,
|
|
@@ -800,23 +788,23 @@ var P = u, F = (e, t = {}) => {
|
|
|
800
788
|
},
|
|
801
789
|
resource: s,
|
|
802
790
|
signal: o,
|
|
803
|
-
slot:
|
|
791
|
+
slot: Xe({
|
|
804
792
|
projectId: e.projectId,
|
|
805
793
|
rendererId: t,
|
|
806
794
|
resource: s
|
|
807
795
|
}),
|
|
808
796
|
...a ? { metadata: a } : {}
|
|
809
797
|
});
|
|
810
|
-
},
|
|
798
|
+
}, Qe = (e) => {
|
|
811
799
|
if (!e || typeof e != "object") return;
|
|
812
800
|
let t = e.revision;
|
|
813
801
|
return typeof t == "string" ? t : void 0;
|
|
814
|
-
},
|
|
802
|
+
}, $e = (e, t) => {
|
|
815
803
|
let n = e.metadata, r = n?.fileRendererOrigin;
|
|
816
804
|
if (!r || typeof r != "object") return;
|
|
817
805
|
let i = r;
|
|
818
806
|
if (typeof i.rendererId != "string" || typeof i.instanceId != "string" || typeof i.operationId != "string") return;
|
|
819
|
-
let a = n?.fileRendererResourceKey, o =
|
|
807
|
+
let a = n?.fileRendererResourceKey, o = Qe(t.outcome.value);
|
|
820
808
|
return {
|
|
821
809
|
origin: {
|
|
822
810
|
rendererId: i.rendererId,
|
|
@@ -826,32 +814,32 @@ var P = u, F = (e, t = {}) => {
|
|
|
826
814
|
...typeof a == "string" ? { resourceKey: a } : {},
|
|
827
815
|
...o ? { revision: o } : {}
|
|
828
816
|
};
|
|
829
|
-
},
|
|
817
|
+
}, et = (e, t) => e.workbench.views.registerView({
|
|
830
818
|
id: t.id,
|
|
831
|
-
title:
|
|
819
|
+
title: N(t.title, t.id),
|
|
832
820
|
icon: t.icon,
|
|
833
821
|
body: {
|
|
834
822
|
kind: "file",
|
|
835
823
|
resourceKind: t.resourceKind,
|
|
836
|
-
load: async (n, r) => await
|
|
824
|
+
load: async (n, r) => await Ze(e, t.id, t.loadHandlerId, n, {}, void 0, r) ?? {},
|
|
837
825
|
save: t.saveHandlerId ? async (n, r, i) => {
|
|
838
|
-
let a =
|
|
826
|
+
let a = Qe(await Ze(e, t.id, t.saveHandlerId, n, { content: r }, {
|
|
839
827
|
...i ? { fileRendererOrigin: i } : {},
|
|
840
|
-
...
|
|
828
|
+
...m(n) ? { fileRendererResourceKey: m(n) } : {}
|
|
841
829
|
}));
|
|
842
830
|
return a ? { revision: a } : void 0;
|
|
843
831
|
} : void 0
|
|
844
832
|
}
|
|
845
|
-
}),
|
|
833
|
+
}), tt = (e) => {
|
|
846
834
|
let t = [];
|
|
847
|
-
for (let n of e.metadata.fileRenderers ?? []) t.push(
|
|
835
|
+
for (let n of e.metadata.fileRenderers ?? []) t.push(et(e, n));
|
|
848
836
|
return { dispose() {
|
|
849
837
|
for (let e = t.length - 1; e >= 0; --e) t[e]?.dispose();
|
|
850
838
|
} };
|
|
851
|
-
},
|
|
839
|
+
}, nt = (e) => (t) => _(i, {
|
|
852
840
|
name: e ?? "MoreHorizontal",
|
|
853
841
|
...t
|
|
854
|
-
}),
|
|
842
|
+
}), rt = (e, t) => ({
|
|
855
843
|
color: e?.color,
|
|
856
844
|
canDragIn: e?.canDragIn,
|
|
857
845
|
canDragOut: e?.canDragOut,
|
|
@@ -859,12 +847,12 @@ var P = u, F = (e, t = {}) => {
|
|
|
859
847
|
actions: e?.actions?.map((e) => ({
|
|
860
848
|
id: e.id,
|
|
861
849
|
label: t(e.label, e.id),
|
|
862
|
-
icon:
|
|
850
|
+
icon: nt(e.icon)
|
|
863
851
|
}))
|
|
864
|
-
}),
|
|
852
|
+
}), it = (e, t) => `${t.extensionId ?? e.extensionId}.status.${t.id}`, at = (e, t) => {
|
|
865
853
|
let n = /* @__PURE__ */ new Map();
|
|
866
854
|
return (r) => {
|
|
867
|
-
let i =
|
|
855
|
+
let i = it(t, r), a = n.get(i);
|
|
868
856
|
if (a) return a;
|
|
869
857
|
let o = {
|
|
870
858
|
getSnapshot: () => (e.workbench.statuses.getStatuses(i) ?? []).map((e) => ({
|
|
@@ -877,16 +865,16 @@ var P = u, F = (e, t = {}) => {
|
|
|
877
865
|
};
|
|
878
866
|
return n.set(i, o), e.workbench.statuses.load(i).catch(() => void 0), o;
|
|
879
867
|
};
|
|
880
|
-
},
|
|
868
|
+
}, ot = (e, t, n, r, i) => {
|
|
881
869
|
let a = n?.find((e) => e.id === r);
|
|
882
870
|
if (a?.type.kind !== "status") return;
|
|
883
|
-
let o =
|
|
871
|
+
let o = it(t, a.type.statuses), s = e.workbench.statuses.getStatuses(o)?.find((e) => e.id === i);
|
|
884
872
|
return s ? { color: s.color } : void 0;
|
|
885
|
-
},
|
|
873
|
+
}, st = (e) => {
|
|
886
874
|
if (e.defaultSettings?.columnGrouping) return e.defaultSettings.columnGrouping;
|
|
887
875
|
let t = e.attributes?.filter((e) => e.type.kind === "status") ?? [];
|
|
888
876
|
return t.length === 1 ? t[0]?.id : void 0;
|
|
889
|
-
},
|
|
877
|
+
}, ct = (e) => typeof e == "object" && !!e && !Array.isArray(e), lt = (e, t, n, r, i, a) => (t ?? []).map((t) => {
|
|
890
878
|
let o = t.display, s = o?.kind === "badge-list" && typeof o.itemsAttributeId == "string" ? {
|
|
891
879
|
kind: "badge-list",
|
|
892
880
|
itemsAttributeId: o.itemsAttributeId
|
|
@@ -906,36 +894,36 @@ var P = u, F = (e, t = {}) => {
|
|
|
906
894
|
} : t.type,
|
|
907
895
|
display: s
|
|
908
896
|
});
|
|
909
|
-
}),
|
|
910
|
-
let o =
|
|
897
|
+
}), ut = (e, t, n, r, i = () => [], a) => {
|
|
898
|
+
let o = lt(e, t, n, r, i, a), s = /* @__PURE__ */ new Set();
|
|
911
899
|
return {
|
|
912
900
|
source: {
|
|
913
901
|
getSnapshot: () => o,
|
|
914
902
|
subscribe: (e) => (s.add(e), () => s.delete(e))
|
|
915
903
|
},
|
|
916
904
|
set(t) {
|
|
917
|
-
o =
|
|
905
|
+
o = lt(e, t, n, r, i, a);
|
|
918
906
|
for (let e of s) e();
|
|
919
907
|
}
|
|
920
908
|
};
|
|
921
|
-
},
|
|
909
|
+
}, dt = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), ft = (e, t) => {
|
|
922
910
|
let { resource: n } = t;
|
|
923
|
-
if (
|
|
924
|
-
},
|
|
925
|
-
let n =
|
|
911
|
+
if (dt(n)) return n;
|
|
912
|
+
}, pt = (e, t) => {
|
|
913
|
+
let n = ft(e, t);
|
|
926
914
|
if (n) return n;
|
|
927
915
|
if (e.resourceKind) return {
|
|
928
916
|
type: e.resourceKind,
|
|
929
917
|
id: t.id,
|
|
930
918
|
label: t.title
|
|
931
919
|
};
|
|
932
|
-
},
|
|
920
|
+
}, mt = (e, t) => {
|
|
933
921
|
let n = e, r = t(n);
|
|
934
922
|
return r === void 0 ? n : {
|
|
935
923
|
...n,
|
|
936
924
|
resource: r
|
|
937
925
|
};
|
|
938
|
-
},
|
|
926
|
+
}, ht = (...e) => Object.assign({}, ...e.filter((e) => !!e)), gt = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, _t = (e) => Object.keys(e ?? {}).length > 0, vt = /* @__PURE__ */ new Set([
|
|
939
927
|
"text",
|
|
940
928
|
"longtext",
|
|
941
929
|
"markdown",
|
|
@@ -944,8 +932,8 @@ var P = u, F = (e, t = {}) => {
|
|
|
944
932
|
"select",
|
|
945
933
|
"multi-select",
|
|
946
934
|
"files"
|
|
947
|
-
]),
|
|
948
|
-
if (!
|
|
935
|
+
]), yt = (e, t, n) => {
|
|
936
|
+
if (!vt.has(t.type)) return;
|
|
949
937
|
let r = "options" in t && Array.isArray(t.options) ? t.options : [], i = t;
|
|
950
938
|
return {
|
|
951
939
|
id: e,
|
|
@@ -963,17 +951,17 @@ var P = u, F = (e, t = {}) => {
|
|
|
963
951
|
multiple: t.type === "files" ? i.multiple !== !1 : void 0,
|
|
964
952
|
accept: t.type === "files" && typeof i.accept == "string" ? i.accept : void 0
|
|
965
953
|
};
|
|
966
|
-
},
|
|
967
|
-
let r =
|
|
954
|
+
}, bt = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([e, n]) => {
|
|
955
|
+
let r = yt(e, n, t);
|
|
968
956
|
return r ? [r] : [];
|
|
969
|
-
}),
|
|
957
|
+
}), xt = (e, t) => F({
|
|
970
958
|
id: t.id,
|
|
971
959
|
kind: "kanbanRenderer",
|
|
972
960
|
projectId: e.projectId,
|
|
973
961
|
context: { kanbanRendererId: t.id }
|
|
974
|
-
}),
|
|
962
|
+
}), B = (e, t, n, r, i, a) => {
|
|
975
963
|
let o = i ?? e.workbench.getPrimaryResource();
|
|
976
|
-
return
|
|
964
|
+
return L(e, n, {
|
|
977
965
|
params: {
|
|
978
966
|
renderer: {
|
|
979
967
|
rendererId: t.id,
|
|
@@ -985,33 +973,33 @@ var P = u, F = (e, t = {}) => {
|
|
|
985
973
|
},
|
|
986
974
|
resource: o,
|
|
987
975
|
signal: a,
|
|
988
|
-
slot:
|
|
976
|
+
slot: xt(e, t),
|
|
989
977
|
metadata: { kanbanRendererId: t.id }
|
|
990
978
|
});
|
|
991
|
-
},
|
|
979
|
+
}, St = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, Ct = (e, t, n) => (t.rowActions ?? []).map((r) => {
|
|
992
980
|
let i = e.workbench.commands.getCommand(r.commandId)?.command;
|
|
993
981
|
return e.workbench.commands.registerCommand({
|
|
994
|
-
id:
|
|
982
|
+
id: St(t, r),
|
|
995
983
|
label: n(r.label, r.id),
|
|
996
984
|
icon: r.icon,
|
|
997
985
|
params: i?.params
|
|
998
|
-
}, { execute: (n, i) =>
|
|
999
|
-
}),
|
|
1000
|
-
let o =
|
|
1001
|
-
return s &&
|
|
986
|
+
}, { execute: (n, i) => B(e, t, r.commandId, ht(gt(n)), i?.resource) });
|
|
987
|
+
}), wt = (e, t, n, r, i, a) => {
|
|
988
|
+
let o = St(t, n), s = e.workbench.commands.getCommand(o), c = { rowId: r.id }, l = i ? { resource: i } : void 0, u = a(n.label, n.id);
|
|
989
|
+
return s && _t(s.command.params) ? (e.workbench.commandPalette.requestParams({
|
|
1002
990
|
record: s,
|
|
1003
991
|
label: u,
|
|
1004
992
|
args: c,
|
|
1005
993
|
context: l
|
|
1006
|
-
}), Promise.resolve()) : s ? e.workbench.commands.executeCommand(s.command.id, c, l).then(() => void 0) :
|
|
1007
|
-
},
|
|
994
|
+
}), Promise.resolve()) : s ? e.workbench.commands.executeCommand(s.command.id, c, l).then(() => void 0) : B(e, t, n.commandId, c, i).then(() => void 0);
|
|
995
|
+
}, Tt = (e) => e ? _(i, {
|
|
1008
996
|
name: e,
|
|
1009
997
|
size: 16
|
|
1010
|
-
}) : void 0,
|
|
998
|
+
}) : void 0, Et = (e, t) => {
|
|
1011
999
|
if (e.createRow) return {
|
|
1012
1000
|
title: t(e.createRow.title, "Create row"),
|
|
1013
1001
|
submitLabel: t(e.createRow.submitLabel, "Create"),
|
|
1014
|
-
fields:
|
|
1002
|
+
fields: bt(e, t),
|
|
1015
1003
|
labels: {
|
|
1016
1004
|
cancel: t(e.createRow.labels?.cancel, "Cancel"),
|
|
1017
1005
|
properties: t(e.createRow.labels?.properties, "Properties"),
|
|
@@ -1019,20 +1007,20 @@ var P = u, F = (e, t = {}) => {
|
|
|
1019
1007
|
removeFile: t(e.createRow.labels?.removeFile, "Remove file")
|
|
1020
1008
|
}
|
|
1021
1009
|
};
|
|
1022
|
-
},
|
|
1010
|
+
}, Dt = (e, t, n, r, i) => {
|
|
1023
1011
|
if (t.rowActivationHandlerId) return async (n) => {
|
|
1024
|
-
let a = r(t, n)
|
|
1025
|
-
|
|
1012
|
+
let a = r(t, n);
|
|
1013
|
+
await B(e, t, t.rowActivationHandlerId, { row: i(n) }, a);
|
|
1026
1014
|
};
|
|
1027
1015
|
if (n.onRowClick) return (e) => n.onRowClick?.({
|
|
1028
1016
|
record: t,
|
|
1029
1017
|
row: e,
|
|
1030
1018
|
resource: r(t, e)
|
|
1031
1019
|
});
|
|
1032
|
-
},
|
|
1020
|
+
}, Ot = (e, t, n, r) => {
|
|
1033
1021
|
let i = e.createRow;
|
|
1034
1022
|
if (i) return async (a) => {
|
|
1035
|
-
let o =
|
|
1023
|
+
let o = ht(a.values, i.columnParam ? { [i.columnParam]: a.columnId } : void 0, i.attributesParam ? { [i.attributesParam]: a.attributeValues } : void 0), s = await n(e, i.commandId, o);
|
|
1036
1024
|
if (await t.onAfterCreate?.({
|
|
1037
1025
|
record: e,
|
|
1038
1026
|
created: s,
|
|
@@ -1046,15 +1034,15 @@ var P = u, F = (e, t = {}) => {
|
|
|
1046
1034
|
attributes: c.attributes ?? {}
|
|
1047
1035
|
});
|
|
1048
1036
|
};
|
|
1049
|
-
},
|
|
1037
|
+
}, kt = (e, t, n, r, i) => {
|
|
1050
1038
|
let a = t.rowActions;
|
|
1051
1039
|
if (a?.length) return (o) => a.map((a) => {
|
|
1052
|
-
let s = i(t, o), c = () =>
|
|
1040
|
+
let s = i(t, o), c = () => wt(e, t, a, o, s, r);
|
|
1053
1041
|
return {
|
|
1054
1042
|
key: a.id,
|
|
1055
1043
|
label: r(a.label, a.id),
|
|
1056
1044
|
commandId: a.commandId,
|
|
1057
|
-
icon:
|
|
1045
|
+
icon: Tt(a.icon),
|
|
1058
1046
|
onClick: () => n.executeRowAction ? n.executeRowAction({
|
|
1059
1047
|
record: t,
|
|
1060
1048
|
action: a,
|
|
@@ -1064,22 +1052,22 @@ var P = u, F = (e, t = {}) => {
|
|
|
1064
1052
|
}) : c()
|
|
1065
1053
|
};
|
|
1066
1054
|
});
|
|
1067
|
-
},
|
|
1068
|
-
let r = [], i = n.resolveLabel ?? ((e, t) =>
|
|
1055
|
+
}, V = (e, t, n = {}) => {
|
|
1056
|
+
let r = [], i = n.resolveLabel ?? ((e, t) => N(e, t)), a = (e, t) => {
|
|
1069
1057
|
let r = t.display?.kind === "badge-list" ? {
|
|
1070
1058
|
...t,
|
|
1071
|
-
render: (e, n) =>
|
|
1059
|
+
render: (e, n) => b(t, e, n)
|
|
1072
1060
|
} : t;
|
|
1073
1061
|
return n.decorateAttribute?.(e, r) ?? r;
|
|
1074
|
-
}, o = n.resolveRowResource ??
|
|
1062
|
+
}, o = n.resolveRowResource ?? ft, s = n.resolveRowActionResource ?? pt, c = n.onAfterMutation ?? (() => {}), l = (t, n, r) => B(e, t, n, r).then((e) => (c(t), e));
|
|
1075
1063
|
for (let c of t) {
|
|
1076
|
-
let t =
|
|
1064
|
+
let t = at(e, c), u = ut(c, c.attributes, i, a, t, (t, n) => e.workbench.notifications.show({
|
|
1077
1065
|
id: `workbench.extension.${c.extensionId}.kanban.${c.id}.display.${t}`,
|
|
1078
1066
|
level: "error",
|
|
1079
1067
|
title: "Extension display is not available",
|
|
1080
1068
|
message: `Attribute "${t}" in renderer "${c.id}" uses unknown display kind "${n}".`
|
|
1081
|
-
})), d = c.attributes, f =
|
|
1082
|
-
r.push(...
|
|
1069
|
+
})), d = c.attributes, f = st(c), p = /* @__PURE__ */ new WeakMap(), m, h = 0, g = (e) => o(c, e), _ = Dt(e, c, n, o, (e) => p.get(e) ?? e);
|
|
1070
|
+
r.push(...Ct(e, c, i)), r.push(e.workbench.views.registerView({
|
|
1083
1071
|
id: c.id,
|
|
1084
1072
|
title: i(c.title, c.id),
|
|
1085
1073
|
icon: c.icon,
|
|
@@ -1098,21 +1086,21 @@ var P = u, F = (e, t = {}) => {
|
|
|
1098
1086
|
emptyTitle: i(c.emptyTitle, ""),
|
|
1099
1087
|
emptyDescription: i(c.emptyDescription, ""),
|
|
1100
1088
|
hideToolbar: c.hideToolbar,
|
|
1101
|
-
createRow:
|
|
1102
|
-
getBoardColumnConfig: (t) =>
|
|
1089
|
+
createRow: Et(c, i),
|
|
1090
|
+
getBoardColumnConfig: (t) => rt(m?.[t] ?? ot(e, c, d, f, t), i),
|
|
1103
1091
|
onRowActivate: _,
|
|
1104
1092
|
executeQuery: async (t, n) => {
|
|
1105
1093
|
h += 1;
|
|
1106
|
-
let r = h, i = await
|
|
1094
|
+
let r = h, i = await B(e, c, c.queryHandlerId, {
|
|
1107
1095
|
settings: t.settings,
|
|
1108
1096
|
filters: t.filters
|
|
1109
1097
|
}, void 0, n), a = (e) => e.map((e) => {
|
|
1110
|
-
let t =
|
|
1098
|
+
let t = mt(e, g);
|
|
1111
1099
|
return p.set(t, e), t;
|
|
1112
1100
|
});
|
|
1113
|
-
if (r !== h) return Array.isArray(i) ? a(i) :
|
|
1101
|
+
if (r !== h) return Array.isArray(i) ? a(i) : ct(i) ? a(i.rows ?? []) : [];
|
|
1114
1102
|
if (f = t.settings.columnGrouping, Array.isArray(i)) return a(i);
|
|
1115
|
-
if (!
|
|
1103
|
+
if (!ct(i)) return [];
|
|
1116
1104
|
let o = i.attributes ?? d;
|
|
1117
1105
|
return d = o, u.set(o), m = i.boardColumnConfigs, a(i.rows ?? []);
|
|
1118
1106
|
},
|
|
@@ -1125,21 +1113,21 @@ var P = u, F = (e, t = {}) => {
|
|
|
1125
1113
|
rowId: e,
|
|
1126
1114
|
beforeRowId: t
|
|
1127
1115
|
}).then(() => void 0) : void 0,
|
|
1128
|
-
onCreateRow:
|
|
1116
|
+
onCreateRow: Ot(c, n, l, c.rowActivationHandlerId ? _ : void 0),
|
|
1129
1117
|
onColumnAction: c.columnActionHandlerId ? async (e, t) => {
|
|
1130
1118
|
await l(c, c.columnActionHandlerId, {
|
|
1131
1119
|
columnId: e,
|
|
1132
1120
|
actionId: t
|
|
1133
1121
|
});
|
|
1134
1122
|
} : void 0,
|
|
1135
|
-
getRowContextMenuActions:
|
|
1123
|
+
getRowContextMenuActions: kt(e, c, n, i, s)
|
|
1136
1124
|
}
|
|
1137
1125
|
}));
|
|
1138
1126
|
}
|
|
1139
1127
|
return { dispose() {
|
|
1140
1128
|
for (let e = r.length - 1; e >= 0; --e) r[e]?.dispose();
|
|
1141
1129
|
} };
|
|
1142
|
-
}, H = (e) => e.extensionId === "pstdio" ? e.id : `${e.extensionId}.${e.kind}.${e.id}`, U = (e) => e.extensionId === "pstdio" ? e.id : `${e.extensionId}.command.${e.id}`,
|
|
1130
|
+
}, H = (e) => e.extensionId === "pstdio" ? e.id : `${e.extensionId}.${e.kind}.${e.id}`, U = (e) => e.extensionId === "pstdio" ? e.id : `${e.extensionId}.command.${e.id}`, At = (e) => {
|
|
1143
1131
|
if (!e) return;
|
|
1144
1132
|
let t = (e) => {
|
|
1145
1133
|
if (e) return Array.isArray(e) ? e.map(H) : H(e);
|
|
@@ -1151,13 +1139,13 @@ var P = u, F = (e, t = {}) => {
|
|
|
1151
1139
|
resourceType: e.resourceType?.map((e) => e.id),
|
|
1152
1140
|
metadata: e.metadata
|
|
1153
1141
|
};
|
|
1154
|
-
},
|
|
1142
|
+
}, jt = At, Mt = (e, t) => {
|
|
1155
1143
|
if (e) return Object.fromEntries(Object.entries(e).map(([e, n]) => [e, {
|
|
1156
1144
|
...n,
|
|
1157
1145
|
label: n.label === void 0 ? void 0 : t(n.label, e),
|
|
1158
1146
|
description: n.description === void 0 ? void 0 : t(n.description)
|
|
1159
1147
|
}]));
|
|
1160
|
-
},
|
|
1148
|
+
}, Nt = (e) => ({
|
|
1161
1149
|
id: e.treeId,
|
|
1162
1150
|
kind: "renderer",
|
|
1163
1151
|
context: {
|
|
@@ -1185,20 +1173,20 @@ var P = u, F = (e, t = {}) => {
|
|
|
1185
1173
|
};
|
|
1186
1174
|
}, G = async (e, t, n, r, i) => {
|
|
1187
1175
|
let a = r.renderer, o = a?.resource;
|
|
1188
|
-
return
|
|
1176
|
+
return L(e, n, {
|
|
1189
1177
|
params: r,
|
|
1190
1178
|
signal: i,
|
|
1191
1179
|
resource: o,
|
|
1192
|
-
slot:
|
|
1180
|
+
slot: Nt({
|
|
1193
1181
|
modeId: a?.modeId,
|
|
1194
1182
|
projectId: e.projectId,
|
|
1195
1183
|
resource: o,
|
|
1196
1184
|
treeId: t.id
|
|
1197
1185
|
})
|
|
1198
1186
|
});
|
|
1199
|
-
},
|
|
1187
|
+
}, Pt = async (e, t, n, r, i) => {
|
|
1200
1188
|
let a = e.workbench.modes.getActiveModeId();
|
|
1201
|
-
return
|
|
1189
|
+
return L(e, n, {
|
|
1202
1190
|
params: {
|
|
1203
1191
|
...r ?? {},
|
|
1204
1192
|
renderer: {
|
|
@@ -1210,7 +1198,7 @@ var P = u, F = (e, t = {}) => {
|
|
|
1210
1198
|
}
|
|
1211
1199
|
},
|
|
1212
1200
|
resource: i,
|
|
1213
|
-
slot:
|
|
1201
|
+
slot: Nt({
|
|
1214
1202
|
modeId: a,
|
|
1215
1203
|
projectId: e.projectId,
|
|
1216
1204
|
resource: i,
|
|
@@ -1218,28 +1206,28 @@ var P = u, F = (e, t = {}) => {
|
|
|
1218
1206
|
}),
|
|
1219
1207
|
metadata: { treeId: t.id }
|
|
1220
1208
|
});
|
|
1221
|
-
},
|
|
1222
|
-
let { ctx: t, getHostTreeHeaderNodes: n, record: r, treeViews: i } = e, a =
|
|
1209
|
+
}, Ft = (e, t) => e.panels.flatMap((e) => [e, ...e.panelMenus ?? []]).filter((e) => e.renderer?.kind === "tree" && e.renderer.id === t.id), It = (e, t) => t.viewId ? e.find((e) => e.id === t.viewId) : e.length === 1 ? e[0] : void 0, Lt = async (e) => {
|
|
1210
|
+
let { ctx: t, getHostTreeHeaderNodes: n, record: r, treeViews: i } = e, a = It(i, t);
|
|
1223
1211
|
return !a || !("hostTreeHeader" in a) || a.hostTreeHeader !== "default" ? [] : await n?.({
|
|
1224
1212
|
ctx: t,
|
|
1225
1213
|
record: r,
|
|
1226
1214
|
panel: a
|
|
1227
1215
|
}) ?? [];
|
|
1228
|
-
},
|
|
1229
|
-
let { ctx: t, getHostTreeFooterNodes: n, record: r, treeViews: i } = e, a =
|
|
1216
|
+
}, Rt = async (e) => {
|
|
1217
|
+
let { ctx: t, getHostTreeFooterNodes: n, record: r, treeViews: i } = e, a = It(i, t);
|
|
1230
1218
|
return !a || !("hostTreeFooter" in a) || a.hostTreeFooter !== "default" ? [] : await n?.({
|
|
1231
1219
|
ctx: t,
|
|
1232
1220
|
record: r,
|
|
1233
1221
|
panel: a
|
|
1234
1222
|
}) ?? [];
|
|
1235
|
-
},
|
|
1223
|
+
}, zt = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, Bt = (e) => e && !Array.isArray(e) ? e : void 0, Vt = (e, t) => {
|
|
1236
1224
|
let n = /* @__PURE__ */ new WeakMap(), r = `workbench.extensionTreeRenderer.${t.id}.command`, i = (t) => e.resolveNodeResource?.(t) ?? t, a = (e) => {
|
|
1237
1225
|
if (e.emptyState) return {
|
|
1238
|
-
title:
|
|
1239
|
-
description:
|
|
1226
|
+
title: N(e.emptyState.title),
|
|
1227
|
+
description: N(e.emptyState.description),
|
|
1240
1228
|
icon: e.emptyState.icon
|
|
1241
1229
|
};
|
|
1242
|
-
}, o = (n, i, a) => n ?
|
|
1230
|
+
}, o = (n, i, a) => n ? P(n, {
|
|
1243
1231
|
commandTargetOf: (e) => ({
|
|
1244
1232
|
kind: "command",
|
|
1245
1233
|
commandId: r,
|
|
@@ -1260,30 +1248,27 @@ var P = u, F = (e, t = {}) => {
|
|
|
1260
1248
|
}) : void 0;
|
|
1261
1249
|
return {
|
|
1262
1250
|
id: n.id,
|
|
1263
|
-
label:
|
|
1251
|
+
label: N(n.label),
|
|
1264
1252
|
icon: n.icon,
|
|
1265
|
-
args:
|
|
1266
|
-
params:
|
|
1253
|
+
args: Bt(n.params),
|
|
1254
|
+
params: Mt(n.input, N),
|
|
1267
1255
|
submitLabel: n.submitLabel,
|
|
1268
1256
|
when: n.when,
|
|
1269
1257
|
disabled: n.disabled,
|
|
1270
|
-
run: a ? async (
|
|
1271
|
-
let
|
|
1258
|
+
run: a ? async (o) => {
|
|
1259
|
+
let s = zt(o, Bt(n.params));
|
|
1272
1260
|
if (n.command?.extensionId === "pstdio") {
|
|
1273
|
-
await e.workbench.commands.executeCommand(a,
|
|
1261
|
+
await e.workbench.commands.executeCommand(a, s, { resource: r?.resource ?? i.resource });
|
|
1274
1262
|
return;
|
|
1275
1263
|
}
|
|
1276
|
-
|
|
1277
|
-
i.refresh();
|
|
1278
|
-
let u = P(l) ? o(l, r, i) : void 0;
|
|
1279
|
-
u && await e.workbench.navigation.openTarget(u);
|
|
1264
|
+
await Pt(e, t, a, s, r?.resource ?? i.resource), i.refresh();
|
|
1280
1265
|
} : void 0
|
|
1281
1266
|
};
|
|
1282
1267
|
}, c = (e, t) => {
|
|
1283
1268
|
let r = {
|
|
1284
1269
|
id: e.id,
|
|
1285
1270
|
selected: e.selected,
|
|
1286
|
-
label:
|
|
1271
|
+
label: N(e.label),
|
|
1287
1272
|
icon: e.icon,
|
|
1288
1273
|
iconColor: e.iconColor,
|
|
1289
1274
|
iconTooltip: e.iconTooltip,
|
|
@@ -1306,7 +1291,7 @@ var P = u, F = (e, t = {}) => {
|
|
|
1306
1291
|
mapNodes: (e, t) => e.map((e) => c(e, t)),
|
|
1307
1292
|
mapSections: (e, t) => e.map((e) => ({
|
|
1308
1293
|
id: e.id,
|
|
1309
|
-
label:
|
|
1294
|
+
label: N(e.label),
|
|
1310
1295
|
actions: e.actions?.map((e) => s(e, void 0, t)),
|
|
1311
1296
|
collapsible: e.collapsible,
|
|
1312
1297
|
emptyState: a(e),
|
|
@@ -1317,30 +1302,30 @@ var P = u, F = (e, t = {}) => {
|
|
|
1317
1302
|
originalNodes: n,
|
|
1318
1303
|
runnerCommandId: r
|
|
1319
1304
|
};
|
|
1320
|
-
}, K = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "nodes" in e),
|
|
1305
|
+
}, K = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "nodes" in e), Ht = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "id" in e), q = (e, t) => t.length > 0 ? [{
|
|
1321
1306
|
id: e,
|
|
1322
1307
|
nodes: t,
|
|
1323
1308
|
canReorder: !1
|
|
1324
|
-
}] : [],
|
|
1325
|
-
let n =
|
|
1309
|
+
}] : [], Ut = (e, t) => {
|
|
1310
|
+
let n = Vt(e, t), r = Ft(e.metadata, t), i = e.workbench.commands.registerCommand({
|
|
1326
1311
|
id: n.runnerCommandId,
|
|
1327
|
-
label: `${
|
|
1312
|
+
label: `${N(t.title, t.id)} tree command`
|
|
1328
1313
|
}, { execute: async (n) => {
|
|
1329
|
-
let r = n, i = await
|
|
1314
|
+
let r = n, i = await Pt(e, t, r.commandId, r.params, r.resource);
|
|
1330
1315
|
for (let t of e.workbench.views.listViews()) t.body.kind === "file" && e.workbench.views.refreshView(t.id);
|
|
1331
1316
|
return i;
|
|
1332
1317
|
} }), a = e.workbench.views.registerView({
|
|
1333
1318
|
id: t.id,
|
|
1334
|
-
title:
|
|
1319
|
+
title: N(t.title, t.id),
|
|
1335
1320
|
icon: t.icon,
|
|
1336
1321
|
body: {
|
|
1337
1322
|
kind: "tree",
|
|
1338
1323
|
searchable: t.searchable,
|
|
1339
|
-
searchPlaceholder:
|
|
1324
|
+
searchPlaceholder: N(t.searchPlaceholder, "Search files"),
|
|
1340
1325
|
defaultExpandedNodeIds: t.defaultExpandedNodeIds,
|
|
1341
1326
|
defaultExpandedSectionIds: t.defaultExpandedSectionIds,
|
|
1342
1327
|
getHeader: async (i) => {
|
|
1343
|
-
let a = await
|
|
1328
|
+
let a = await Lt({
|
|
1344
1329
|
ctx: i,
|
|
1345
1330
|
getHostTreeHeaderNodes: e.getHostTreeHeaderNodes,
|
|
1346
1331
|
record: t,
|
|
@@ -1355,7 +1340,7 @@ var P = u, F = (e, t = {}) => {
|
|
|
1355
1340
|
return K(i) ? n.mapSections(i, r) : [];
|
|
1356
1341
|
},
|
|
1357
1342
|
getFooter: async (i) => {
|
|
1358
|
-
let a = await
|
|
1343
|
+
let a = await Rt({
|
|
1359
1344
|
ctx: i,
|
|
1360
1345
|
getHostTreeFooterNodes: e.getHostTreeFooterNodes,
|
|
1361
1346
|
record: t,
|
|
@@ -1370,16 +1355,16 @@ var P = u, F = (e, t = {}) => {
|
|
|
1370
1355
|
let a = n.originalNodes.get(r);
|
|
1371
1356
|
if (!a) return r.children ?? [];
|
|
1372
1357
|
let o = await G(e, t, t.childrenHandlerId, W(e, t, i, a), i.signal);
|
|
1373
|
-
return
|
|
1358
|
+
return Ht(o) ? n.mapNodes(o, i) : [];
|
|
1374
1359
|
}
|
|
1375
1360
|
}
|
|
1376
1361
|
});
|
|
1377
1362
|
return { dispose() {
|
|
1378
1363
|
a.dispose(), i.dispose();
|
|
1379
1364
|
} };
|
|
1380
|
-
},
|
|
1365
|
+
}, Wt = (e) => {
|
|
1381
1366
|
let t = [];
|
|
1382
|
-
for (let n of e.metadata.treeRenderers ?? []) t.push(
|
|
1367
|
+
for (let n of e.metadata.treeRenderers ?? []) t.push(Ut(e, n));
|
|
1383
1368
|
return { dispose() {
|
|
1384
1369
|
for (let e = t.length - 1; e >= 0; --e) t[e]?.dispose();
|
|
1385
1370
|
} };
|
|
@@ -1387,20 +1372,20 @@ var P = u, F = (e, t = {}) => {
|
|
|
1387
1372
|
kind: e.kind,
|
|
1388
1373
|
id: H(e),
|
|
1389
1374
|
extensionId: e.extensionId
|
|
1390
|
-
}),
|
|
1375
|
+
}), Gt = (e, t, n) => {
|
|
1391
1376
|
let r = n?.(t.when);
|
|
1392
1377
|
return !r || e.context.matches(r);
|
|
1393
|
-
},
|
|
1378
|
+
}, Kt = (e) => ({
|
|
1394
1379
|
id: e.id,
|
|
1395
|
-
label:
|
|
1380
|
+
label: N(e.label, e.id),
|
|
1396
1381
|
icon: e.icon,
|
|
1397
1382
|
canHide: !0,
|
|
1398
1383
|
canReorder: !0,
|
|
1399
|
-
target:
|
|
1400
|
-
}),
|
|
1384
|
+
target: P(e.action, { extensionId: e.extensionId })
|
|
1385
|
+
}), qt = (e, n, r) => {
|
|
1401
1386
|
let i = /* @__PURE__ */ new Map();
|
|
1402
1387
|
for (let a of n) {
|
|
1403
|
-
if (!
|
|
1388
|
+
if (!Gt(e, a, r)) continue;
|
|
1404
1389
|
let n = a.group || void 0, o = n ? `${a.extensionId}:${n}` : t, s = i.get(o) ?? {
|
|
1405
1390
|
id: o,
|
|
1406
1391
|
label: n,
|
|
@@ -1409,28 +1394,29 @@ var P = u, F = (e, t = {}) => {
|
|
|
1409
1394
|
canReorder: !0,
|
|
1410
1395
|
nodes: []
|
|
1411
1396
|
};
|
|
1412
|
-
s.nodes.push(
|
|
1397
|
+
s.nodes.push(Kt(a)), i.set(o, s);
|
|
1413
1398
|
}
|
|
1414
1399
|
return [...i.values()];
|
|
1415
|
-
},
|
|
1400
|
+
}, Jt = (e) => {
|
|
1416
1401
|
let t = /* @__PURE__ */ new Map();
|
|
1417
1402
|
for (let n of e) {
|
|
1418
1403
|
let e = J(n.owner), r = `${n.extensionId}:${e.kind}:${e.id}:${n.slot}`;
|
|
1419
1404
|
t.set(r, [...t.get(r) ?? [], n]);
|
|
1420
1405
|
}
|
|
1421
1406
|
return [...t.values()];
|
|
1422
|
-
},
|
|
1423
|
-
let n = t[0];
|
|
1407
|
+
}, Yt = (e) => [...new Set(e.flatMap((e) => e.group ? [`${e.extensionId}:${e.group}`] : []))], Xt = (e) => Jt(e.metadata.navigationItems).map((t) => {
|
|
1408
|
+
let n = t[0], r = t.some((e) => e.when?.resourceType?.length || e.when?.metadata);
|
|
1424
1409
|
return e.workbench.navigationTrees.registerContribution({
|
|
1425
1410
|
id: `${n.extensionId}.navigation-items.${n.owner.kind}.${H(n.owner)}.${n.slot}`,
|
|
1426
1411
|
owner: J(n.owner),
|
|
1427
1412
|
sourceExtensionId: n.extensionId,
|
|
1428
1413
|
declarationIndex: e.metadata.navigationItems.indexOf(n),
|
|
1429
1414
|
slot: n.slot,
|
|
1430
|
-
defaultExpandedSectionIds:
|
|
1431
|
-
|
|
1415
|
+
defaultExpandedSectionIds: Yt(t),
|
|
1416
|
+
...r ? {} : { resolveResource: () => void 0 },
|
|
1417
|
+
getSections: () => qt(e.workbench, t, e.createWhenExpression)
|
|
1432
1418
|
});
|
|
1433
|
-
}),
|
|
1419
|
+
}), Zt = (e) => e.metadata.navigationTrees.map((t, n) => {
|
|
1434
1420
|
let r = H(t.view);
|
|
1435
1421
|
return e.workbench.navigationTrees.registerContribution({
|
|
1436
1422
|
id: t.id,
|
|
@@ -1439,36 +1425,37 @@ var P = u, F = (e, t = {}) => {
|
|
|
1439
1425
|
sourceExtensionId: t.extensionId,
|
|
1440
1426
|
declarationIndex: e.metadata.navigationItems.length + n,
|
|
1441
1427
|
slot: t.slot,
|
|
1442
|
-
viewId: r
|
|
1428
|
+
viewId: r,
|
|
1429
|
+
...t.resourceScope === "project" ? { resolveResource: () => void 0 } : {}
|
|
1443
1430
|
});
|
|
1444
|
-
}),
|
|
1431
|
+
}), Qt = (e) => [...Xt(e), ...Zt(e)], $t = () => {
|
|
1445
1432
|
if (typeof navigator > "u") return;
|
|
1446
1433
|
let e = `${navigator.platform} ${navigator.userAgent}`.toLowerCase();
|
|
1447
1434
|
if (e.includes("mac")) return "mac";
|
|
1448
1435
|
if (e.includes("win")) return "win";
|
|
1449
1436
|
if (e.includes("linux")) return "linux";
|
|
1450
|
-
},
|
|
1451
|
-
action:
|
|
1437
|
+
}, en = (e, t = $t()) => (t ? e.platformOverrides?.[t] : void 0) ?? e.key, tn = (e) => e.bindings.map((t) => e.workbench.keybindings.registerKeybinding({
|
|
1438
|
+
action: P(t.action, { commandIdOf: (e) => e.extensionId ? U({
|
|
1452
1439
|
extensionId: e.extensionId,
|
|
1453
1440
|
id: e.id
|
|
1454
1441
|
}) : void 0 }),
|
|
1455
|
-
keybinding:
|
|
1442
|
+
keybinding: en(t),
|
|
1456
1443
|
when: e.createWhenExpression?.(t.when)
|
|
1457
|
-
})),
|
|
1444
|
+
})), nn = (e, t) => ({
|
|
1458
1445
|
...e,
|
|
1459
1446
|
tab: e.tab && t.createTab ? t.createTab({
|
|
1460
1447
|
...e.tab,
|
|
1461
1448
|
extensionId: t.extensionId,
|
|
1462
1449
|
placementId: t.placementId
|
|
1463
1450
|
}) : void 0
|
|
1464
|
-
}),
|
|
1451
|
+
}), rn = (e, t) => e.kind === "panels" ? e : {
|
|
1465
1452
|
...e,
|
|
1466
1453
|
tab: e.tab && t.createTab ? t.createTab({
|
|
1467
1454
|
...e.tab,
|
|
1468
1455
|
extensionId: t.extensionId,
|
|
1469
1456
|
placementId: t.placementId
|
|
1470
1457
|
}) : void 0
|
|
1471
|
-
},
|
|
1458
|
+
}, an = (e, t) => e.pages.map((e) => ({
|
|
1472
1459
|
id: e.id,
|
|
1473
1460
|
ref: {
|
|
1474
1461
|
extensionId: e.extensionId,
|
|
@@ -1479,12 +1466,12 @@ var P = u, F = (e, t = {}) => {
|
|
|
1479
1466
|
path: e.path,
|
|
1480
1467
|
modeId: H(e.mode),
|
|
1481
1468
|
resource: e.resource,
|
|
1482
|
-
main:
|
|
1469
|
+
main: rn(e.main, {
|
|
1483
1470
|
extensionId: e.extensionId,
|
|
1484
1471
|
placementId: `${e.id}.$main`,
|
|
1485
1472
|
createTab: t
|
|
1486
1473
|
}),
|
|
1487
|
-
slots: e.slots.map((n) =>
|
|
1474
|
+
slots: e.slots.map((n) => nn(n, {
|
|
1488
1475
|
extensionId: e.extensionId,
|
|
1489
1476
|
placementId: `${e.id}.${n.id}`,
|
|
1490
1477
|
createTab: t
|
|
@@ -1497,10 +1484,10 @@ var P = u, F = (e, t = {}) => {
|
|
|
1497
1484
|
view: e.main.view
|
|
1498
1485
|
}] : [], ...e.slots.flatMap((e) => e.item.kind === "binding" ? [e.item.binding] : [])]);
|
|
1499
1486
|
return n.push(...e.placements.flatMap((e) => e.item.kind === "binding" ? [e.item.binding] : [])), n.find((e) => H(e.view) === t)?.kinds[0]?.id;
|
|
1500
|
-
},
|
|
1487
|
+
}, on = (e) => e.body.kind === "webview" ? { webview: e.body.webview } : { renderer: {
|
|
1501
1488
|
kind: e.body.kind,
|
|
1502
1489
|
id: e.id
|
|
1503
|
-
} },
|
|
1490
|
+
} }, sn = (e, t) => e.viewMenus.flatMap((n) => {
|
|
1504
1491
|
if (H(n.owner) !== t.id) return [];
|
|
1505
1492
|
let r = e.views.find((e) => e.id === H(n.view));
|
|
1506
1493
|
return r ? [{
|
|
@@ -1514,22 +1501,22 @@ var P = u, F = (e, t = {}) => {
|
|
|
1514
1501
|
placement: n.placement,
|
|
1515
1502
|
hostTreeHeader: n.hostTreeHeader,
|
|
1516
1503
|
hostTreeFooter: n.hostTreeFooter,
|
|
1517
|
-
...
|
|
1504
|
+
...on(r)
|
|
1518
1505
|
}] : [];
|
|
1519
|
-
}),
|
|
1520
|
-
let n =
|
|
1506
|
+
}), cn = (e) => e.views.map((t) => {
|
|
1507
|
+
let n = sn(e, t);
|
|
1521
1508
|
return {
|
|
1522
1509
|
id: t.id,
|
|
1523
1510
|
extensionId: t.extensionId,
|
|
1524
1511
|
title: t.title,
|
|
1525
1512
|
icon: t.icon,
|
|
1526
1513
|
panelMenus: n.length > 0 ? n : void 0,
|
|
1527
|
-
...
|
|
1514
|
+
...on(t)
|
|
1528
1515
|
};
|
|
1529
1516
|
}), X = (e) => e?.map(({ command: e, ...t }) => ({
|
|
1530
1517
|
...t,
|
|
1531
1518
|
commandId: U(e)
|
|
1532
|
-
})),
|
|
1519
|
+
})), ln = (e) => e.views.flatMap((t) => {
|
|
1533
1520
|
let n = t.body;
|
|
1534
1521
|
return n.kind === "kanban" ? [{
|
|
1535
1522
|
...n,
|
|
@@ -1554,7 +1541,7 @@ var P = u, F = (e, t = {}) => {
|
|
|
1554
1541
|
} : void 0,
|
|
1555
1542
|
rowActions: X(n.rowActions)
|
|
1556
1543
|
}] : [];
|
|
1557
|
-
}),
|
|
1544
|
+
}), un = (e) => e.views.flatMap((t) => {
|
|
1558
1545
|
let n = t.body;
|
|
1559
1546
|
return n.kind === "dataTable" ? [{
|
|
1560
1547
|
...n,
|
|
@@ -1566,28 +1553,28 @@ var P = u, F = (e, t = {}) => {
|
|
|
1566
1553
|
selectionActions: X(n.selectionActions),
|
|
1567
1554
|
rowActions: X(n.rowActions)
|
|
1568
1555
|
}] : [];
|
|
1569
|
-
}),
|
|
1556
|
+
}), dn = (e) => e.views.flatMap((t) => t.body.kind === "tree" ? [{
|
|
1570
1557
|
...t.body,
|
|
1571
1558
|
id: t.id,
|
|
1572
1559
|
extensionId: t.extensionId,
|
|
1573
1560
|
title: t.title,
|
|
1574
1561
|
icon: t.icon,
|
|
1575
1562
|
resourceKind: Y(e, t.id)
|
|
1576
|
-
}] : []),
|
|
1563
|
+
}] : []), fn = (e) => e.views.flatMap((t) => t.body.kind === "file" ? [{
|
|
1577
1564
|
...t.body,
|
|
1578
1565
|
id: t.id,
|
|
1579
1566
|
extensionId: t.extensionId,
|
|
1580
1567
|
title: t.title,
|
|
1581
1568
|
icon: t.icon,
|
|
1582
1569
|
resourceKind: Y(e, t.id)
|
|
1583
|
-
}] : []),
|
|
1570
|
+
}] : []), pn = (e) => e.views.flatMap((t) => t.body.kind === "controls" ? [{
|
|
1584
1571
|
...t.body,
|
|
1585
1572
|
id: t.id,
|
|
1586
1573
|
extensionId: t.extensionId,
|
|
1587
1574
|
title: t.title,
|
|
1588
1575
|
icon: t.icon,
|
|
1589
1576
|
resourceKind: Y(e, t.id)
|
|
1590
|
-
}] : []),
|
|
1577
|
+
}] : []), mn = (e) => e.modes.map((e) => ({
|
|
1591
1578
|
id: e.id,
|
|
1592
1579
|
extensionId: e.extensionId,
|
|
1593
1580
|
modeId: e.id,
|
|
@@ -1598,15 +1585,15 @@ var P = u, F = (e, t = {}) => {
|
|
|
1598
1585
|
floatingPanels: e.floatingPanels,
|
|
1599
1586
|
...e.defaultTheme ? { defaultTheme: H(e.defaultTheme) } : {},
|
|
1600
1587
|
...e.chrome ? { chrome: Object.fromEntries(Object.entries(e.chrome).map(([e, t]) => [e, t !== !1 && H(t)])) } : {}
|
|
1601
|
-
})),
|
|
1602
|
-
let n =
|
|
1588
|
+
})), hn = (e, t = {}) => {
|
|
1589
|
+
let n = cn(e);
|
|
1603
1590
|
return {
|
|
1604
1591
|
extensions: e.extensions,
|
|
1605
1592
|
commands: e.commands,
|
|
1606
1593
|
menuContributions: e.menuContributions,
|
|
1607
1594
|
commandPaletteContributions: e.commandPaletteContributions,
|
|
1608
|
-
modes:
|
|
1609
|
-
pages:
|
|
1595
|
+
modes: mn(e),
|
|
1596
|
+
pages: an(e, t.createTab),
|
|
1610
1597
|
placements: e.placements.map((e) => ({
|
|
1611
1598
|
id: e.id,
|
|
1612
1599
|
ref: {
|
|
@@ -1660,12 +1647,12 @@ var P = u, F = (e, t = {}) => {
|
|
|
1660
1647
|
section: t.section ? H(t.section) : void 0
|
|
1661
1648
|
}] : [];
|
|
1662
1649
|
}),
|
|
1663
|
-
kanbanRenderers:
|
|
1664
|
-
dataTableRenderers:
|
|
1650
|
+
kanbanRenderers: ln(e),
|
|
1651
|
+
dataTableRenderers: un(e),
|
|
1665
1652
|
commandPaletteResources: e.commandPaletteResources ?? [],
|
|
1666
|
-
treeRenderers:
|
|
1667
|
-
fileRenderers:
|
|
1668
|
-
controlsRenderers:
|
|
1653
|
+
treeRenderers: dn(e),
|
|
1654
|
+
fileRenderers: fn(e),
|
|
1655
|
+
controlsRenderers: pn(e),
|
|
1669
1656
|
keybindings: e.keybindings ?? [],
|
|
1670
1657
|
settingsDefinitions: e.settingsDefinitions ?? [],
|
|
1671
1658
|
statuses: e.statuses,
|
|
@@ -1675,13 +1662,13 @@ var P = u, F = (e, t = {}) => {
|
|
|
1675
1662
|
viewId: H(e.view),
|
|
1676
1663
|
slot: e.slot.id.endsWith("leading") ? "leading" : "trailing",
|
|
1677
1664
|
order: e.order,
|
|
1678
|
-
when:
|
|
1665
|
+
when: At(e.when)
|
|
1679
1666
|
})),
|
|
1680
1667
|
diagnostics: e.diagnostics
|
|
1681
1668
|
};
|
|
1682
|
-
},
|
|
1669
|
+
}, gn = (e, t, n = {}) => {
|
|
1683
1670
|
e.views.refreshView(t.id, t.kind === "file" ? n : void 0);
|
|
1684
|
-
},
|
|
1671
|
+
}, _n = (e) => {
|
|
1685
1672
|
let t = /* @__PURE__ */ new Map(), n = (e, n) => {
|
|
1686
1673
|
for (let r of new Set(n.refreshEventIds ?? [])) {
|
|
1687
1674
|
let i = t.get(r) ?? [];
|
|
@@ -1696,16 +1683,16 @@ var P = u, F = (e, t = {}) => {
|
|
|
1696
1683
|
refreshEventIds: t.body.refreshEventIds
|
|
1697
1684
|
});
|
|
1698
1685
|
return t;
|
|
1699
|
-
},
|
|
1700
|
-
let t =
|
|
1686
|
+
}, vn = (e) => {
|
|
1687
|
+
let t = _n(e.metadata);
|
|
1701
1688
|
return e.subscribe((n) => {
|
|
1702
1689
|
let { id: r, ...i } = n;
|
|
1703
|
-
for (let n of t.get(r) ?? [])
|
|
1690
|
+
for (let n of t.get(r) ?? []) gn(e.workbench, n, i);
|
|
1704
1691
|
});
|
|
1705
|
-
},
|
|
1692
|
+
}, yn = (e, t) => {
|
|
1706
1693
|
for (let n of t.views) n.body.kind === "webview" && e.views.getView(n.id) && e.views.refreshView(n.id);
|
|
1707
|
-
},
|
|
1708
|
-
...
|
|
1694
|
+
}, bn = (e) => (t) => ({
|
|
1695
|
+
...xe({
|
|
1709
1696
|
workbench: t.workbench,
|
|
1710
1697
|
placement: t.placement,
|
|
1711
1698
|
hostEvents: t.hostEvents
|
|
@@ -1713,14 +1700,14 @@ var P = u, F = (e, t = {}) => {
|
|
|
1713
1700
|
"navigation.open": (n) => {
|
|
1714
1701
|
let r = n;
|
|
1715
1702
|
if (!r.target) throw Error("navigation.open requires a target.");
|
|
1716
|
-
return t.workbench.navigation.openTarget(
|
|
1703
|
+
return t.workbench.navigation.openTarget(P(r.target, {
|
|
1717
1704
|
extensionId: e.extensionIdForWebview(t.webviewId),
|
|
1718
1705
|
projectId: e.projectId
|
|
1719
1706
|
}));
|
|
1720
1707
|
},
|
|
1721
1708
|
"commands.execute": async (n) => {
|
|
1722
1709
|
let r = n, i = r.resource ?? t.placement.resource;
|
|
1723
|
-
return
|
|
1710
|
+
return I({
|
|
1724
1711
|
...e,
|
|
1725
1712
|
workbench: t.workbench
|
|
1726
1713
|
}, r.commandId, {
|
|
@@ -1728,7 +1715,7 @@ var P = u, F = (e, t = {}) => {
|
|
|
1728
1715
|
...r.workspaceId ? { workspaceId: r.workspaceId } : {},
|
|
1729
1716
|
...r.metadata ? { metadata: r.metadata } : {},
|
|
1730
1717
|
...i ? { resource: i } : {},
|
|
1731
|
-
slot:
|
|
1718
|
+
slot: F({
|
|
1732
1719
|
id: t.webviewId,
|
|
1733
1720
|
kind: e.slotKind,
|
|
1734
1721
|
projectId: e.projectId,
|
|
@@ -1742,79 +1729,79 @@ var P = u, F = (e, t = {}) => {
|
|
|
1742
1729
|
"files.delete": e.files.delete
|
|
1743
1730
|
} : {},
|
|
1744
1731
|
...e.artifacts ? { "artifacts.read": (n) => e.artifacts.read(n, { webviewId: t.webviewId }) } : {}
|
|
1745
|
-
}),
|
|
1746
|
-
title:
|
|
1732
|
+
}), xn = (e) => ({
|
|
1733
|
+
title: N(e.title) || void 0,
|
|
1747
1734
|
runtimeUrl: e.runtimeUrl,
|
|
1748
1735
|
moduleUrl: e.moduleUrl,
|
|
1749
1736
|
styles: e.styles,
|
|
1750
1737
|
capabilities: e.capabilities
|
|
1751
|
-
}),
|
|
1738
|
+
}), Sn = "extensions", Cn = 1e3, wn = 25, Tn = (e) => e === void 0 ? void 0 : e, En = (e) => e === "global" ? "user" : "project", Dn = (e, t) => t ? (n) => ({
|
|
1752
1739
|
...e(n),
|
|
1753
1740
|
...t(n)
|
|
1754
|
-
}) : e,
|
|
1741
|
+
}) : e, On = (e, t) => Dn(e.createWebviewHostCapabilities ?? bn({
|
|
1755
1742
|
artifacts: e.webviewArtifacts,
|
|
1756
1743
|
executeCommand: e.executeCommand,
|
|
1757
1744
|
extensionIdForWebview: (t) => e.metadata.panels.find((e) => e.id === t)?.extensionId,
|
|
1758
1745
|
files: e.webviewFiles,
|
|
1759
1746
|
projectId: e.projectId,
|
|
1760
1747
|
slotKind: t
|
|
1761
|
-
}), e.createWebviewHostCapabilityOverrides),
|
|
1748
|
+
}), e.createWebviewHostCapabilityOverrides), kn = (e) => e.metadata.panels.flatMap((t) => {
|
|
1762
1749
|
if (!t.webview) return [];
|
|
1763
|
-
let n =
|
|
1750
|
+
let n = xn(t.webview);
|
|
1764
1751
|
return [e.workbench.views.registerView({
|
|
1765
1752
|
id: t.id,
|
|
1766
|
-
title:
|
|
1753
|
+
title: N(t.title, t.id),
|
|
1767
1754
|
icon: t.icon,
|
|
1768
1755
|
body: {
|
|
1769
1756
|
kind: "react",
|
|
1770
1757
|
render: (r) => {
|
|
1771
1758
|
let i = e.metadata.settingsPanels.some((e) => e.id === r.instance.panelId && e.viewId === t.id) ? "settings" : "panel";
|
|
1772
|
-
return e.renderWebview?.(r) ??
|
|
1759
|
+
return e.renderWebview?.(r) ?? Te({
|
|
1773
1760
|
context: {
|
|
1774
1761
|
workbench: r.workbench,
|
|
1775
1762
|
webviewId: t.id,
|
|
1776
1763
|
placement: r.instance,
|
|
1777
|
-
hostEvents:
|
|
1764
|
+
hostEvents: we(r.workbench, r.instance)
|
|
1778
1765
|
},
|
|
1779
|
-
createHostCapabilities:
|
|
1766
|
+
createHostCapabilities: On(e, i),
|
|
1780
1767
|
createProps: e.createWebviewProps ?? (({ placement: e }) => ({
|
|
1781
1768
|
placement: e,
|
|
1782
1769
|
resource: e.resource
|
|
1783
1770
|
})),
|
|
1784
1771
|
createTheme: e.createWebviewTheme,
|
|
1785
1772
|
ownerId: t.extensionId,
|
|
1786
|
-
title:
|
|
1773
|
+
title: N(t.title, t.id),
|
|
1787
1774
|
webview: n
|
|
1788
1775
|
});
|
|
1789
1776
|
}
|
|
1790
1777
|
}
|
|
1791
1778
|
})];
|
|
1792
|
-
}),
|
|
1779
|
+
}), An = {
|
|
1793
1780
|
first: 1e6,
|
|
1794
1781
|
default: 0,
|
|
1795
1782
|
last: -1e6
|
|
1796
|
-
},
|
|
1783
|
+
}, jn = (e) => e.metadata.panels.flatMap((e) => e.panelMenus ?? []).map((t, n) => e.workbench.viewMenus.registerViewMenu({
|
|
1797
1784
|
id: t.id,
|
|
1798
1785
|
ownerViewId: t.ownerPanelId,
|
|
1799
1786
|
viewId: t.viewId,
|
|
1800
1787
|
side: t.side,
|
|
1801
|
-
priority:
|
|
1802
|
-
})),
|
|
1788
|
+
priority: An[t.placement ?? "default"] - n
|
|
1789
|
+
})), Mn = (e) => {
|
|
1803
1790
|
if (!e || typeof e != "object" || !("statuses" in e) || !Array.isArray(e.statuses)) throw Error("Status provider returned an invalid response");
|
|
1804
1791
|
return e.statuses;
|
|
1805
|
-
},
|
|
1792
|
+
}, Nn = (e, t) => {
|
|
1806
1793
|
let r = e.metadata.statuses ?? [];
|
|
1807
1794
|
if (r.length === 0) return [];
|
|
1808
1795
|
let i = "workbench.extension-statuses.settings", a = r.map((n, r) => e.workbench.statuses.registerStatusSet({
|
|
1809
1796
|
id: n.id,
|
|
1810
|
-
title:
|
|
1797
|
+
title: N(n.title, n.id),
|
|
1811
1798
|
actions: n.actions?.map((e) => ({
|
|
1812
1799
|
id: e.id,
|
|
1813
|
-
label:
|
|
1800
|
+
label: N(e.label, e.id),
|
|
1814
1801
|
icon: e.icon
|
|
1815
1802
|
})),
|
|
1816
|
-
query: async () =>
|
|
1817
|
-
save: n.saveHandlerId ? async (e) =>
|
|
1803
|
+
query: async () => Mn(await L(t, n.queryHandlerId, { params: {} })),
|
|
1804
|
+
save: n.saveHandlerId ? async (e) => Mn(await L(t, n.saveHandlerId, { params: { statuses: e } })) : void 0
|
|
1818
1805
|
}, {
|
|
1819
1806
|
ownerId: n.extensionId,
|
|
1820
1807
|
priority: -r
|
|
@@ -1824,20 +1811,20 @@ var P = u, F = (e, t = {}) => {
|
|
|
1824
1811
|
title: "Statuses",
|
|
1825
1812
|
body: {
|
|
1826
1813
|
kind: "react",
|
|
1827
|
-
render: () =>
|
|
1814
|
+
render: () => _(n, { workbench: e.workbench })
|
|
1828
1815
|
}
|
|
1829
1816
|
})), a.push(e.workbench.settings.registerPanel({
|
|
1830
1817
|
id: "workbench.statuses",
|
|
1831
1818
|
title: "Statuses",
|
|
1832
1819
|
icon: "list-checks",
|
|
1833
1820
|
kind: "view",
|
|
1834
|
-
order:
|
|
1835
|
-
section: e.settingsSectionId ??
|
|
1821
|
+
order: wn,
|
|
1822
|
+
section: e.settingsSectionId ?? Sn,
|
|
1836
1823
|
scope: "project",
|
|
1837
1824
|
viewId: i
|
|
1838
1825
|
})), a;
|
|
1839
|
-
},
|
|
1840
|
-
let t = [], n = e.settingsSectionId ??
|
|
1826
|
+
}, Pn = (e) => {
|
|
1827
|
+
let t = [], n = e.settingsSectionId ?? Sn;
|
|
1841
1828
|
e.workbench.settings.getSection(n) || t.push(e.workbench.settings.registerSection({
|
|
1842
1829
|
id: n,
|
|
1843
1830
|
title: e.settingsSectionTitle ?? "Extensions"
|
|
@@ -1845,47 +1832,47 @@ var P = u, F = (e, t = {}) => {
|
|
|
1845
1832
|
let r = [...e.metadata.settingsSections].sort((e, t) => (e.order ?? 0) - (t.order ?? 0) || e.extensionId.localeCompare(t.extensionId) || e.id.localeCompare(t.id));
|
|
1846
1833
|
for (let n of r) t.push(e.workbench.settings.registerSection({
|
|
1847
1834
|
id: n.id,
|
|
1848
|
-
title:
|
|
1835
|
+
title: N(n.title, n.id),
|
|
1849
1836
|
order: n.order,
|
|
1850
1837
|
scope: n.scope
|
|
1851
1838
|
}));
|
|
1852
1839
|
let i = Object.fromEntries((e.metadata.settingsDefinitions ?? []).map((e) => [e.key, {
|
|
1853
1840
|
type: e.type,
|
|
1854
|
-
scope:
|
|
1855
|
-
default:
|
|
1841
|
+
scope: En(e.scope),
|
|
1842
|
+
default: Tn(e.default),
|
|
1856
1843
|
enum: e.enum,
|
|
1857
|
-
description:
|
|
1844
|
+
description: N(e.description)
|
|
1858
1845
|
}]));
|
|
1859
1846
|
Object.keys(i).length > 0 && t.push(e.workbench.preferences.registerSchema({ properties: i }));
|
|
1860
1847
|
let a = [...e.metadata.settingsPanels].sort((e, t) => e.extensionId.localeCompare(t.extensionId) || e.id.localeCompare(t.id));
|
|
1861
1848
|
for (let [r, i] of a.entries()) t.push(e.workbench.settings.registerPanel({
|
|
1862
1849
|
id: i.id,
|
|
1863
|
-
title:
|
|
1850
|
+
title: N(i.title, i.id),
|
|
1864
1851
|
icon: i.icon,
|
|
1865
1852
|
kind: "view",
|
|
1866
|
-
order:
|
|
1853
|
+
order: Cn + r,
|
|
1867
1854
|
section: i.section ?? n,
|
|
1868
1855
|
scope: i.scope,
|
|
1869
1856
|
viewId: i.viewId
|
|
1870
1857
|
}));
|
|
1871
1858
|
return t;
|
|
1872
|
-
}, Z = (e) => !(!e || typeof e != "object" || Array.isArray(e)),
|
|
1859
|
+
}, Z = (e) => !(!e || typeof e != "object" || Array.isArray(e)), Fn = (e, t, n) => d(e) ? P(e, {
|
|
1873
1860
|
extensionId: t,
|
|
1874
1861
|
projectId: n
|
|
1875
|
-
}) : void 0,
|
|
1862
|
+
}) : void 0, In = (e, t, n) => {
|
|
1876
1863
|
if (!Z(e)) return {};
|
|
1877
1864
|
let r = Z(e.indicator) ? {
|
|
1878
1865
|
icon: String(e.indicator.icon ?? ""),
|
|
1879
1866
|
color: typeof e.indicator.color == "string" ? e.indicator.color : void 0,
|
|
1880
|
-
label:
|
|
1867
|
+
label: N(e.indicator.label)
|
|
1881
1868
|
} : void 0, i = Array.isArray(e.menu) ? e.menu.flatMap((e) => !Z(e) || typeof e.id != "string" || !Array.isArray(e.rows) ? [] : [{
|
|
1882
1869
|
id: e.id,
|
|
1883
1870
|
rows: e.rows.flatMap((e) => {
|
|
1884
1871
|
if (!Z(e) || typeof e.id != "string") return [];
|
|
1885
|
-
let r =
|
|
1872
|
+
let r = Fn(e.action, t, n);
|
|
1886
1873
|
return [{
|
|
1887
1874
|
id: e.id,
|
|
1888
|
-
label:
|
|
1875
|
+
label: N(e.label, e.id),
|
|
1889
1876
|
icon: typeof e.icon == "string" ? e.icon : void 0,
|
|
1890
1877
|
iconColor: typeof e.iconColor == "string" ? e.iconColor : void 0,
|
|
1891
1878
|
selected: e.selected === !0,
|
|
@@ -1898,22 +1885,22 @@ var P = u, F = (e, t = {}) => {
|
|
|
1898
1885
|
})
|
|
1899
1886
|
}]) : void 0;
|
|
1900
1887
|
return {
|
|
1901
|
-
label:
|
|
1888
|
+
label: N(e.label),
|
|
1902
1889
|
icon: typeof e.icon == "string" ? e.icon : void 0,
|
|
1903
1890
|
indicator: r?.icon ? r : void 0,
|
|
1904
1891
|
menu: i
|
|
1905
1892
|
};
|
|
1906
|
-
},
|
|
1893
|
+
}, Ln = (e, t) => {
|
|
1907
1894
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = new Set(t.refreshEventIds ?? []), o = (a) => {
|
|
1908
1895
|
if (r.has(a.instanceId)) return;
|
|
1909
1896
|
r.add(a.instanceId);
|
|
1910
1897
|
let o = a.resource ? {
|
|
1911
1898
|
type: a.resource.type,
|
|
1912
|
-
id: a.resource.id ??
|
|
1899
|
+
id: a.resource.id ?? m(a.resource),
|
|
1913
1900
|
label: a.resource.label,
|
|
1914
1901
|
metadata: a.resource.metadata
|
|
1915
1902
|
} : void 0;
|
|
1916
|
-
Promise.resolve(
|
|
1903
|
+
Promise.resolve(L(e, t.queryHandlerId, {
|
|
1917
1904
|
resource: o,
|
|
1918
1905
|
params: { renderer: {
|
|
1919
1906
|
rendererId: t.placementId,
|
|
@@ -1922,7 +1909,7 @@ var P = u, F = (e, t = {}) => {
|
|
|
1922
1909
|
invocation: { placement: "visible" }
|
|
1923
1910
|
} }
|
|
1924
1911
|
})).then((r) => {
|
|
1925
|
-
n.set(a.instanceId,
|
|
1912
|
+
n.set(a.instanceId, In(r, t.extensionId, e.projectId));
|
|
1926
1913
|
for (let e of i) e();
|
|
1927
1914
|
}).finally(() => r.delete(a.instanceId));
|
|
1928
1915
|
};
|
|
@@ -1941,22 +1928,22 @@ var P = u, F = (e, t = {}) => {
|
|
|
1941
1928
|
} };
|
|
1942
1929
|
}
|
|
1943
1930
|
};
|
|
1944
|
-
},
|
|
1931
|
+
}, Rn = (e) => {
|
|
1945
1932
|
for (let t = e.length - 1; t >= 0; --t) e[t]?.dispose();
|
|
1946
|
-
}, Q = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, $ = (e, t, n, r, i) => e.prepareCommandArgs?.(t, n, r, i) ?? n,
|
|
1933
|
+
}, Q = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, $ = (e, t, n, r, i) => e.prepareCommandArgs?.(t, n, r, i) ?? n, zn = (e, t) => t.commands.map((t) => e.workbench.commands.registerCommand({
|
|
1947
1934
|
id: t.id,
|
|
1948
|
-
label:
|
|
1949
|
-
description:
|
|
1935
|
+
label: N(t.title, t.id),
|
|
1936
|
+
description: N(t.description),
|
|
1950
1937
|
params: t.params
|
|
1951
1938
|
}, {
|
|
1952
1939
|
prepareArgs: (n, r, i) => $(e, t.id, n, r, i),
|
|
1953
|
-
execute: (n, r) =>
|
|
1940
|
+
execute: (n, r) => L(e, t.id, {
|
|
1954
1941
|
params: Q(n),
|
|
1955
1942
|
resource: r?.resource
|
|
1956
1943
|
})
|
|
1957
|
-
})),
|
|
1944
|
+
})), Bn = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), Vn = (e, t) => {
|
|
1958
1945
|
if (!e.menuSlotsById) return [];
|
|
1959
|
-
let { registrations: n } =
|
|
1946
|
+
let { registrations: n } = Je({
|
|
1960
1947
|
metadata: e.metadata,
|
|
1961
1948
|
menuSlotsById: e.menuSlotsById,
|
|
1962
1949
|
menuTargetsById: e.menuTargetsById,
|
|
@@ -1970,13 +1957,13 @@ var P = u, F = (e, t = {}) => {
|
|
|
1970
1957
|
}));
|
|
1971
1958
|
return (e.menuRegistrations ?? r).flatMap((n) => [e.workbench.commands.registerCommand(n.command, {
|
|
1972
1959
|
prepareArgs: (e, r, i) => $(t, n.targetCommandId, e, r, i),
|
|
1973
|
-
execute: (r, i) =>
|
|
1960
|
+
execute: (r, i) => L(t, n.targetCommandId, {
|
|
1974
1961
|
params: {
|
|
1975
1962
|
...n.contribution.params ?? {},
|
|
1976
1963
|
...Q(r) ?? {}
|
|
1977
1964
|
},
|
|
1978
|
-
resource:
|
|
1979
|
-
slot:
|
|
1965
|
+
resource: Bn(e, i),
|
|
1966
|
+
slot: F({
|
|
1980
1967
|
id: n.contribution.slotId,
|
|
1981
1968
|
kind: "menu",
|
|
1982
1969
|
projectId: e.projectId,
|
|
@@ -1984,75 +1971,75 @@ var P = u, F = (e, t = {}) => {
|
|
|
1984
1971
|
})
|
|
1985
1972
|
})
|
|
1986
1973
|
}), ...n.menuItems.map(({ menuPath: t, menuItem: n }) => e.workbench.layout.registerMenuItem(t, n))]);
|
|
1987
|
-
},
|
|
1974
|
+
}, Hn = (t, n) => Ye({ metadata: t.metadata }).flatMap((r) => [t.workbench.commands.registerCommand(r.command, {
|
|
1988
1975
|
prepareArgs: (e, t, i) => $(n, r.targetCommandId, e, t, i),
|
|
1989
|
-
execute: (e, i) =>
|
|
1976
|
+
execute: (e, i) => L(n, r.targetCommandId, {
|
|
1990
1977
|
params: {
|
|
1991
1978
|
...r.contribution.params ?? {},
|
|
1992
1979
|
...Q(e) ?? {}
|
|
1993
1980
|
},
|
|
1994
|
-
resource:
|
|
1995
|
-
slot:
|
|
1981
|
+
resource: Bn(t, i),
|
|
1982
|
+
slot: F({
|
|
1996
1983
|
id: "workbench.commandPalette",
|
|
1997
1984
|
kind: "menu",
|
|
1998
1985
|
projectId: t.projectId,
|
|
1999
1986
|
context: { panelId: r.contribution.id }
|
|
2000
1987
|
})
|
|
2001
1988
|
}),
|
|
2002
|
-
isVisible: () =>
|
|
2003
|
-
}), t.workbench.layout.registerMenuItem(e, r.menuItem)]),
|
|
1989
|
+
isVisible: () => f(r.contribution.when, t.workbench.getPrimaryResource()?.type)
|
|
1990
|
+
}), t.workbench.layout.registerMenuItem(e, r.menuItem)]), Un = (e, t) => {
|
|
2004
1991
|
let n = t?.mode;
|
|
2005
1992
|
if (!n) return !0;
|
|
2006
1993
|
let r = e.workbench.modes.getActiveModeId() ?? "";
|
|
2007
1994
|
return Array.isArray(n) ? n.includes(r) : n === r;
|
|
2008
|
-
},
|
|
1995
|
+
}, Wn = (e) => (e.metadata.statusBarItems ?? []).map((t) => e.workbench.statusBar.registerItem({
|
|
2009
1996
|
id: t.id,
|
|
2010
1997
|
viewId: t.viewId,
|
|
2011
1998
|
slot: t.slot,
|
|
2012
1999
|
order: t.order,
|
|
2013
|
-
isVisible: () =>
|
|
2014
|
-
})),
|
|
2000
|
+
isVisible: () => Un(e, t.when)
|
|
2001
|
+
})), Gn = (e) => e.metadata.pages.map((t) => e.workbench.pages.registerPage(t)), Kn = (e) => e.metadata.resourceKinds.map((t) => e.workbench.resources.registerKind({
|
|
2015
2002
|
kind: t.id,
|
|
2016
|
-
label:
|
|
2003
|
+
label: N(t.label, t.id),
|
|
2017
2004
|
icon: t.icon ?? "FileText"
|
|
2018
|
-
})),
|
|
2005
|
+
})), qn = (e) => e.metadata.modes.map((t) => e.workbench.modes.registerMode({
|
|
2019
2006
|
id: t.modeId,
|
|
2020
|
-
label:
|
|
2007
|
+
label: N(t.label, t.modeId),
|
|
2021
2008
|
panels: t.panelRegions,
|
|
2022
2009
|
regionSettings: t.regionSettings,
|
|
2023
2010
|
floatingPanels: t.floatingPanels,
|
|
2024
2011
|
defaultTheme: t.defaultTheme,
|
|
2025
2012
|
chrome: t.chrome,
|
|
2026
2013
|
activate: () => void 0
|
|
2027
|
-
})),
|
|
2014
|
+
})), Jn = (e) => e.metadata.placements.map((t) => e.workbench.modePlacements.registerPlacement(t)), Yn = (e) => {
|
|
2028
2015
|
let t = {
|
|
2029
2016
|
...e,
|
|
2030
|
-
metadata:
|
|
2017
|
+
metadata: hn(e.metadata, { createTab: (t) => Ln(e, t) })
|
|
2031
2018
|
}, n = [], r = t;
|
|
2032
2019
|
try {
|
|
2033
|
-
return n.push(...
|
|
2020
|
+
return n.push(...zn(r, t.metadata)), n.push(...tn({
|
|
2034
2021
|
bindings: t.metadata.keybindings,
|
|
2035
2022
|
createWhenExpression: t.createKeybindingWhenExpression,
|
|
2036
2023
|
workbench: t.workbench
|
|
2037
|
-
})), n.push(...
|
|
2024
|
+
})), n.push(...Vn(t, r)), n.push(...Hn(t, r)), n.push(Wt({
|
|
2038
2025
|
...t,
|
|
2039
2026
|
resolveNodeResource: t.resolveTreeNodeResource
|
|
2040
|
-
})), n.push(
|
|
2027
|
+
})), n.push(tt(t)), n.push(Pe(r, t.metadata.controlsRenderers ?? [])), n.push(...kn(t)), n.push(...Pn(t)), n.push(...Nn(t, r)), n.push(V(r, t.metadata.kanbanRenderers ?? [], t.kanbanAdapter)), n.push(ze(r, t.metadata.dataTableRenderers ?? [])), n.push(...jn(t)), n.push(Me(r, t.metadata.commandPaletteResources ?? [])), n.push(...Qt({
|
|
2041
2028
|
createWhenExpression: e.createNavigationWhenExpression,
|
|
2042
2029
|
metadata: e.metadata,
|
|
2043
2030
|
workbench: e.workbench
|
|
2044
|
-
})), e.subscribeRefreshEvents && n.push(
|
|
2031
|
+
})), e.subscribeRefreshEvents && n.push(vn({
|
|
2045
2032
|
metadata: e.metadata,
|
|
2046
2033
|
subscribe: e.subscribeRefreshEvents,
|
|
2047
2034
|
workbench: e.workbench
|
|
2048
|
-
})), n.push(...
|
|
2049
|
-
|
|
2035
|
+
})), n.push(...Wn(t)), n.push(...Kn(t)), n.push(...Gn(t)), n.push(...qn(t)), n.push(...Jn(t)), { dispose() {
|
|
2036
|
+
Rn(n);
|
|
2050
2037
|
} };
|
|
2051
2038
|
} catch (e) {
|
|
2052
|
-
throw
|
|
2039
|
+
throw Rn(n), e;
|
|
2053
2040
|
}
|
|
2054
2041
|
};
|
|
2055
2042
|
//#endregion
|
|
2056
|
-
export {
|
|
2043
|
+
export { Ye as buildWorkbenchExtensionCommandPaletteRegistrations, Je as buildWorkbenchExtensionMenuRegistrations, ye as createTerminalSessionCapability, xe as createWorkbenchWebviewHostCapabilities, Ve as emptyWorkbenchExtensionMetadata, I as executeWorkbenchExtensionCommandResponse, $e as fileRendererRefreshEnvelopeFromCommand, we as getBridgeWebviewHostEventPublisher, yn as refreshOpenWorkbenchExtensionWebviews, gn as refreshWorkbenchExtensionRenderer, Me as registerWorkbenchExtensionCommandPaletteResources, Yn as registerWorkbenchExtensionContributions, Pe as registerWorkbenchExtensionControlsRenderers, ze as registerWorkbenchExtensionDataTableRenderers, tt as registerWorkbenchExtensionFileRenderers, V as registerWorkbenchExtensionKanbanRenderers, vn as registerWorkbenchExtensionRendererRefreshEvents, Wt as registerWorkbenchExtensionTreeRenderers, Te as renderBridgeWebviewFrame, P as toWorkbenchNavigationTarget, jt as toWorkbenchWhenExpression };
|
|
2057
2044
|
|
|
2058
2045
|
//# sourceMappingURL=extensions.js.map
|