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