@pstdio/workbench 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{context-key-service-W4QEfVdN.js → context-key-service-B2K9LAec.js} +370 -367
- package/dist/context-key-service-B2K9LAec.js.map +1 -0
- package/dist/extensions.d.ts +22 -22
- package/dist/extensions.js +910 -838
- package/dist/extensions.js.map +1 -1
- package/dist/index.d.ts +19 -4
- package/dist/index.js +650 -590
- package/dist/index.js.map +1 -1
- package/dist/layout-types-DMoZz38-.js.map +1 -1
- package/dist/react.d.ts +16 -3
- package/dist/react.js +2591 -2627
- package/dist/react.js.map +1 -1
- package/dist/storage.d.ts +96 -2
- package/dist/storage.js +201 -120
- package/dist/storage.js.map +1 -1
- package/dist/testing.d.ts +5 -1
- package/package.json +3 -3
- package/dist/context-key-service-W4QEfVdN.js.map +0 -1
package/dist/extensions.js
CHANGED
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as I, useState as
|
|
3
|
-
import { host as
|
|
4
|
-
import { W as
|
|
5
|
-
import { isLocalizedString as
|
|
6
|
-
import { w as
|
|
7
|
-
const
|
|
8
|
-
const [t, r] = e.split("@"),
|
|
1
|
+
import { jsxs as be, jsx as S } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as I, useState as fe, useEffect as T, createElement as W } from "react";
|
|
3
|
+
import { host as _e } from "rimless";
|
|
4
|
+
import { W as j } from "./icon-B9XolQG8.js";
|
|
5
|
+
import { isLocalizedString as qe, matchesResourceWhen as ze } from "@pstdio/sdk/extensions";
|
|
6
|
+
import { w as Qe } from "./workbench-menu-paths-B_QJzcNU.js";
|
|
7
|
+
const te = 1, Ge = ["commands.execute", "resource.open", "notification.show", "notification.action", "notification.resolve", "notification.dismiss", "preferences.get", "preferences.set", "extension.settings.all", "extension.settings.get", "extension.settings.set", "extension.settings.delete", "terminal.session", "files.upload", "files.list", "files.delete"], Ee = ["host.dispatchKeyboardEvent"], Ye = [...Ge, ...Ee], Xe = new Set(Ye), xe = (e) => Xe.has(e), Je = (e) => {
|
|
8
|
+
const [t, r] = e.split("@"), n = r === void 0 ? te : Number(r);
|
|
9
9
|
return {
|
|
10
10
|
capability: e,
|
|
11
11
|
name: t ?? "",
|
|
12
|
-
version:
|
|
12
|
+
version: n
|
|
13
13
|
};
|
|
14
14
|
}, V = (e) => ({
|
|
15
15
|
capability: e,
|
|
16
16
|
code: "unsupported_webview_capability",
|
|
17
17
|
message: `Unsupported webview capability: ${e}`,
|
|
18
18
|
severity: "error"
|
|
19
|
-
}),
|
|
19
|
+
}), Ze = (e, t, r) => ({
|
|
20
20
|
capability: e,
|
|
21
21
|
code: "unsupported_webview_capability_version",
|
|
22
|
-
message: `Unsupported webview capability version: ${t}@${r.toString()} (supported: ${
|
|
22
|
+
message: `Unsupported webview capability version: ${t}@${r.toString()} (supported: ${te.toString()})`,
|
|
23
23
|
severity: "error"
|
|
24
|
-
}),
|
|
24
|
+
}), et = (e) => ({
|
|
25
25
|
capability: e,
|
|
26
26
|
code: "undeclared_webview_capability",
|
|
27
27
|
message: `Webview did not declare host capability: ${e}`,
|
|
28
28
|
severity: "error"
|
|
29
|
-
}),
|
|
30
|
-
const r = [],
|
|
31
|
-
for (const
|
|
32
|
-
t[
|
|
33
|
-
for (const
|
|
34
|
-
const s =
|
|
35
|
-
if (!
|
|
36
|
-
r.push(V(
|
|
29
|
+
}), tt = (e, t = {}) => {
|
|
30
|
+
const r = [], n = /* @__PURE__ */ new Set();
|
|
31
|
+
for (const o of Ee)
|
|
32
|
+
t[o] && n.add(o);
|
|
33
|
+
for (const o of e ?? []) {
|
|
34
|
+
const s = Je(o);
|
|
35
|
+
if (!xe(s.name)) {
|
|
36
|
+
r.push(V(o));
|
|
37
37
|
continue;
|
|
38
38
|
}
|
|
39
|
-
if (s.version !==
|
|
40
|
-
r.push(
|
|
39
|
+
if (s.version !== te) {
|
|
40
|
+
r.push(Ze(o, s.name, s.version));
|
|
41
41
|
continue;
|
|
42
42
|
}
|
|
43
43
|
if (!t[s.name]) {
|
|
44
|
-
r.push(V(
|
|
44
|
+
r.push(V(o));
|
|
45
45
|
continue;
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
n.add(s.name);
|
|
48
48
|
}
|
|
49
49
|
return {
|
|
50
|
-
allowed:
|
|
50
|
+
allowed: n,
|
|
51
51
|
diagnostics: r
|
|
52
52
|
};
|
|
53
|
-
},
|
|
53
|
+
}, rt = (e) => {
|
|
54
54
|
const {
|
|
55
55
|
allowed: t,
|
|
56
56
|
diagnostics: r
|
|
57
|
-
} =
|
|
58
|
-
e.onDiagnostic?.(
|
|
57
|
+
} = tt(e.declaredCapabilities, e.capabilities), n = (o) => {
|
|
58
|
+
e.onDiagnostic?.(o);
|
|
59
59
|
};
|
|
60
60
|
return {
|
|
61
61
|
diagnostics: r,
|
|
62
|
-
async call(
|
|
63
|
-
if (!
|
|
64
|
-
const
|
|
65
|
-
throw
|
|
62
|
+
async call(o) {
|
|
63
|
+
if (!xe(o.method)) {
|
|
64
|
+
const i = V(o.method);
|
|
65
|
+
throw n(i), new Error(i.message);
|
|
66
66
|
}
|
|
67
|
-
if (!t.has(
|
|
68
|
-
const
|
|
69
|
-
throw
|
|
67
|
+
if (!t.has(o.method)) {
|
|
68
|
+
const i = et(o.method);
|
|
69
|
+
throw n(i), new Error(i.message);
|
|
70
70
|
}
|
|
71
|
-
const s = e.capabilities[
|
|
71
|
+
const s = e.capabilities[o.method];
|
|
72
72
|
if (!s) {
|
|
73
|
-
const
|
|
74
|
-
throw
|
|
73
|
+
const i = V(o.method);
|
|
74
|
+
throw n(i), new Error(i.message);
|
|
75
75
|
}
|
|
76
|
-
return await s(
|
|
76
|
+
return await s(o.params);
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
|
-
},
|
|
79
|
+
}, nt = (e) => typeof e == "object" && e !== null, pe = (e) => {
|
|
80
80
|
try {
|
|
81
81
|
const t = JSON.stringify(e);
|
|
82
82
|
if (typeof t == "string" && t.length > 0) return t;
|
|
@@ -87,7 +87,7 @@ const X = 1, Ne = ["commands.execute", "resource.open", "notification.show", "no
|
|
|
87
87
|
} catch {
|
|
88
88
|
return "Unknown error";
|
|
89
89
|
}
|
|
90
|
-
},
|
|
90
|
+
}, ot = (e) => {
|
|
91
91
|
if (e instanceof Error) return {
|
|
92
92
|
message: e.message,
|
|
93
93
|
stack: e.stack
|
|
@@ -95,7 +95,7 @@ const X = 1, Ne = ["commands.execute", "resource.open", "notification.show", "no
|
|
|
95
95
|
if (typeof e == "string") return {
|
|
96
96
|
message: e
|
|
97
97
|
};
|
|
98
|
-
if (
|
|
98
|
+
if (nt(e)) {
|
|
99
99
|
const t = typeof e.message == "string" ? e.message : null, r = typeof e.stack == "string" ? e.stack : void 0;
|
|
100
100
|
return t ? r ? {
|
|
101
101
|
message: t,
|
|
@@ -103,42 +103,42 @@ const X = 1, Ne = ["commands.execute", "resource.open", "notification.show", "no
|
|
|
103
103
|
} : {
|
|
104
104
|
message: t
|
|
105
105
|
} : {
|
|
106
|
-
message:
|
|
106
|
+
message: pe(e)
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
109
|
return e == null ? {
|
|
110
110
|
message: "Unknown error"
|
|
111
111
|
} : {
|
|
112
|
-
message:
|
|
112
|
+
message: pe(e)
|
|
113
113
|
};
|
|
114
|
-
},
|
|
114
|
+
}, Q = () => {
|
|
115
115
|
if (typeof document > "u") return {};
|
|
116
116
|
const e = getComputedStyle(document.documentElement), t = {};
|
|
117
117
|
for (let r = 0; r < e.length; r += 1) {
|
|
118
|
-
const
|
|
119
|
-
|
|
118
|
+
const n = e.item(r);
|
|
119
|
+
n.startsWith("--chakra-") && (t[n] = e.getPropertyValue(n).trim());
|
|
120
120
|
}
|
|
121
121
|
return t;
|
|
122
|
-
},
|
|
122
|
+
}, G = (e) => {
|
|
123
123
|
if (typeof document > "u") return e;
|
|
124
124
|
const t = document.documentElement.getAttribute("data-theme");
|
|
125
125
|
if (t === "dark" || t === "light") return t;
|
|
126
126
|
const r = document.documentElement.getAttribute("data-color-mode");
|
|
127
127
|
return r === "dark" || r === "light" ? r : e;
|
|
128
|
-
},
|
|
128
|
+
}, st = {
|
|
129
129
|
border: 0,
|
|
130
130
|
display: "block",
|
|
131
131
|
flex: "1 1 0%",
|
|
132
132
|
height: "100%",
|
|
133
133
|
minHeight: 0,
|
|
134
134
|
width: "100%"
|
|
135
|
-
},
|
|
135
|
+
}, it = {
|
|
136
136
|
display: "flex",
|
|
137
137
|
height: "100%",
|
|
138
138
|
minHeight: 0,
|
|
139
139
|
position: "relative",
|
|
140
140
|
width: "100%"
|
|
141
|
-
},
|
|
141
|
+
}, at = {
|
|
142
142
|
alignItems: "center",
|
|
143
143
|
background: "rgba(255, 255, 255, 0.92)",
|
|
144
144
|
color: "#7a1f12",
|
|
@@ -149,151 +149,163 @@ const X = 1, Ne = ["commands.execute", "resource.open", "notification.show", "no
|
|
|
149
149
|
position: "absolute",
|
|
150
150
|
textAlign: "center",
|
|
151
151
|
zIndex: 1
|
|
152
|
-
},
|
|
152
|
+
}, dt = "allow-scripts allow-forms allow-popups", ct = (e) => {
|
|
153
153
|
const {
|
|
154
154
|
view: t,
|
|
155
155
|
props: r,
|
|
156
|
-
theme:
|
|
157
|
-
capabilities:
|
|
156
|
+
theme: n,
|
|
157
|
+
capabilities: o,
|
|
158
158
|
hostEvents: s,
|
|
159
|
-
onReady:
|
|
159
|
+
onReady: i,
|
|
160
160
|
onError: d,
|
|
161
161
|
onDiagnostics: c,
|
|
162
162
|
title: b
|
|
163
|
-
} = e,
|
|
164
|
-
return p.current = r,
|
|
165
|
-
const
|
|
166
|
-
if (!
|
|
167
|
-
const C =
|
|
163
|
+
} = e, a = I(null), l = I(null), m = I(!1), f = I(null), p = I(r), w = I(n), v = I(o), se = I(s), ie = I(t.webview.capabilities), ae = I(i), L = I(d), de = I(c), [ce, O] = fe(null), [q, le] = fe(0);
|
|
164
|
+
return p.current = r, w.current = n, v.current = o, se.current = s, ie.current = t.webview.capabilities, ae.current = i, L.current = d, de.current = c, T(() => {
|
|
165
|
+
const h = a.current;
|
|
166
|
+
if (!h) return;
|
|
167
|
+
const C = () => {
|
|
168
|
+
m.current && le((g) => g + 1);
|
|
169
|
+
};
|
|
170
|
+
h.addEventListener("load", C);
|
|
171
|
+
const E = () => h.removeEventListener("load", C), P = `${q}
|
|
172
|
+
${t.webview.runtimeUrl}
|
|
168
173
|
${t.webview.moduleUrl}`;
|
|
169
|
-
if (f.current ===
|
|
170
|
-
f.current =
|
|
171
|
-
const
|
|
172
|
-
g.length > 0 &&
|
|
173
|
-
},
|
|
174
|
+
if (f.current === P) return E;
|
|
175
|
+
f.current = P;
|
|
176
|
+
const Ve = t.webview.styles, Fe = t.webview.moduleUrl, me = (g) => {
|
|
177
|
+
g.length > 0 && de.current?.(g);
|
|
178
|
+
}, ue = () => rt({
|
|
174
179
|
capabilities: v.current ?? {},
|
|
175
|
-
declaredCapabilities:
|
|
176
|
-
onDiagnostic: (g) =>
|
|
180
|
+
declaredCapabilities: ie.current,
|
|
181
|
+
onDiagnostic: (g) => me([g])
|
|
177
182
|
});
|
|
178
|
-
|
|
179
|
-
const
|
|
183
|
+
me(ue().diagnostics);
|
|
184
|
+
const Ne = {
|
|
180
185
|
ready: () => {
|
|
181
186
|
},
|
|
182
187
|
runtimeError: (g) => {
|
|
183
|
-
|
|
188
|
+
O(g.message), L.current?.(g);
|
|
184
189
|
},
|
|
185
|
-
call: async (g) => await
|
|
186
|
-
}, Be = Ve.connect(w, $e);
|
|
187
|
-
return w.contentWindow?.location.replace(t.webview.runtimeUrl), Be.then(async (g) => {
|
|
188
|
-
const E = g.remote;
|
|
189
|
-
l.current = E, te.current?.bind((De) => E.hostEvent?.(De)), await E.init({
|
|
190
|
-
moduleUrl: H,
|
|
191
|
-
styles: x,
|
|
192
|
-
props: p.current,
|
|
193
|
-
theme: _(h.current),
|
|
194
|
-
themeVariables: U()
|
|
195
|
-
}), u.current = !0, D(null), oe.current?.();
|
|
196
|
-
}).catch((g) => {
|
|
197
|
-
const E = Je(g);
|
|
198
|
-
D(E.message), B.current?.(E);
|
|
199
|
-
}), () => {
|
|
190
|
+
call: async (g) => await ue().call(g)
|
|
200
191
|
};
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
192
|
+
return (() => {
|
|
193
|
+
m.current = !1, l.current = null;
|
|
194
|
+
const g = _e.connect(h, Ne);
|
|
195
|
+
h.contentWindow?.location.replace(t.webview.runtimeUrl), g.then(async (z) => {
|
|
196
|
+
const x = z.remote;
|
|
197
|
+
l.current = x, se.current?.bind((Ue) => x.hostEvent?.(Ue)), await x.init({
|
|
198
|
+
moduleUrl: Fe,
|
|
199
|
+
styles: Ve,
|
|
200
|
+
props: p.current,
|
|
201
|
+
theme: G(w.current),
|
|
202
|
+
themeVariables: Q()
|
|
203
|
+
}), m.current = !0, O(null), ae.current?.();
|
|
204
|
+
}).catch((z) => {
|
|
205
|
+
const x = ot(z);
|
|
206
|
+
O(x.message), L.current?.(x);
|
|
207
|
+
});
|
|
208
|
+
})(), E;
|
|
209
|
+
}, [q, t.webview.runtimeUrl, t.webview.moduleUrl, t.webview.styles]), T(() => {
|
|
210
|
+
const h = l.current;
|
|
211
|
+
if (!(!h || !s))
|
|
212
|
+
return s.bind((C) => h.hostEvent?.(C)), () => s.unbind();
|
|
213
|
+
}, [s]), T(() => {
|
|
214
|
+
m.current && l.current?.propsUpdate({
|
|
207
215
|
props: r
|
|
208
216
|
});
|
|
209
|
-
}, [r]),
|
|
210
|
-
|
|
211
|
-
theme:
|
|
212
|
-
variables:
|
|
217
|
+
}, [r]), T(() => {
|
|
218
|
+
m.current && l.current?.themeUpdate({
|
|
219
|
+
theme: G(n),
|
|
220
|
+
variables: Q()
|
|
213
221
|
});
|
|
214
|
-
}, [
|
|
222
|
+
}, [n]), T(() => {
|
|
215
223
|
if (typeof window > "u" || typeof MutationObserver > "u") return;
|
|
216
|
-
let
|
|
224
|
+
let h = null;
|
|
217
225
|
const C = () => {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
theme:
|
|
221
|
-
variables:
|
|
226
|
+
h !== null && cancelAnimationFrame(h), h = requestAnimationFrame(() => {
|
|
227
|
+
h = null, m.current && l.current?.themeUpdate({
|
|
228
|
+
theme: G(w.current),
|
|
229
|
+
variables: Q()
|
|
222
230
|
});
|
|
223
231
|
});
|
|
224
|
-
},
|
|
232
|
+
}, E = new MutationObserver(C), P = {
|
|
225
233
|
attributeFilter: ["class", "data-color-mode", "data-theme", "style"],
|
|
226
234
|
attributes: !0
|
|
227
235
|
};
|
|
228
|
-
return
|
|
229
|
-
|
|
236
|
+
return E.observe(document.documentElement, P), E.observe(document.body, P), () => {
|
|
237
|
+
E.disconnect(), h !== null && cancelAnimationFrame(h);
|
|
230
238
|
};
|
|
231
|
-
}, []), /* @__PURE__ */
|
|
232
|
-
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
/* @__PURE__ */
|
|
239
|
+
}, []), /* @__PURE__ */ be("div", { style: it, children: [
|
|
240
|
+
ce ? /* @__PURE__ */ S("div", { role: "alert", style: at, children: /* @__PURE__ */ be("div", { children: [
|
|
241
|
+
/* @__PURE__ */ S("strong", { children: "Extension view failed to load." }),
|
|
242
|
+
/* @__PURE__ */ S("div", { children: ce })
|
|
235
243
|
] }) }) : null,
|
|
236
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ S(
|
|
237
245
|
"iframe",
|
|
238
246
|
{
|
|
239
|
-
ref:
|
|
247
|
+
ref: a,
|
|
240
248
|
title: b ?? t.label,
|
|
241
249
|
allow: "fullscreen",
|
|
242
250
|
allowFullScreen: !0,
|
|
243
|
-
sandbox:
|
|
251
|
+
sandbox: dt,
|
|
244
252
|
style: {
|
|
245
|
-
...
|
|
246
|
-
colorScheme:
|
|
253
|
+
...st,
|
|
254
|
+
colorScheme: n
|
|
255
|
+
},
|
|
256
|
+
onLoad: () => {
|
|
257
|
+
m.current && le((h) => h + 1);
|
|
247
258
|
},
|
|
248
259
|
onError: () => {
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
message:
|
|
260
|
+
const h = `Failed to load extension runtime at ${t.webview.runtimeUrl}`;
|
|
261
|
+
O(h), L.current?.({
|
|
262
|
+
message: h
|
|
252
263
|
});
|
|
253
264
|
}
|
|
254
|
-
}
|
|
265
|
+
},
|
|
266
|
+
q
|
|
255
267
|
)
|
|
256
268
|
] });
|
|
257
|
-
},
|
|
269
|
+
}, lt = () => {
|
|
258
270
|
let e = null;
|
|
259
271
|
const t = [], r = /* @__PURE__ */ new Set();
|
|
260
272
|
return {
|
|
261
|
-
emit(
|
|
262
|
-
e ? e(
|
|
273
|
+
emit(n) {
|
|
274
|
+
e ? e(n) : t.push(n);
|
|
263
275
|
},
|
|
264
|
-
bind(
|
|
265
|
-
for (e =
|
|
276
|
+
bind(n) {
|
|
277
|
+
for (e = n; t.length > 0; ) n(t.shift());
|
|
266
278
|
},
|
|
267
|
-
onDisconnect(
|
|
268
|
-
return r.add(
|
|
279
|
+
onDisconnect(n) {
|
|
280
|
+
return r.add(n), () => r.delete(n);
|
|
269
281
|
},
|
|
270
282
|
unbind() {
|
|
271
283
|
e = null;
|
|
272
|
-
for (const
|
|
284
|
+
for (const n of r) n();
|
|
273
285
|
}
|
|
274
286
|
};
|
|
275
|
-
},
|
|
287
|
+
}, mt = "terminal.session", ut = (e) => {
|
|
276
288
|
const {
|
|
277
289
|
terminal: t,
|
|
278
290
|
hostEvents: r
|
|
279
|
-
} = e,
|
|
291
|
+
} = e, n = (o) => {
|
|
280
292
|
r.emit({
|
|
281
|
-
scope:
|
|
282
|
-
payload:
|
|
293
|
+
scope: mt,
|
|
294
|
+
payload: o
|
|
283
295
|
});
|
|
284
296
|
};
|
|
285
|
-
return async (
|
|
286
|
-
const s =
|
|
297
|
+
return async (o) => {
|
|
298
|
+
const s = o;
|
|
287
299
|
switch (s.operation) {
|
|
288
300
|
case "open": {
|
|
289
301
|
const {
|
|
290
|
-
sessionId:
|
|
302
|
+
sessionId: i
|
|
291
303
|
} = await t.open({
|
|
292
304
|
request: s.request
|
|
293
305
|
});
|
|
294
306
|
return {
|
|
295
307
|
operation: "open",
|
|
296
|
-
sessionId:
|
|
308
|
+
sessionId: i
|
|
297
309
|
};
|
|
298
310
|
}
|
|
299
311
|
case "write":
|
|
@@ -323,36 +335,36 @@ ${t.webview.moduleUrl}`;
|
|
|
323
335
|
};
|
|
324
336
|
case "subscribe": {
|
|
325
337
|
const {
|
|
326
|
-
sessionId:
|
|
338
|
+
sessionId: i
|
|
327
339
|
} = s;
|
|
328
340
|
let d = () => {
|
|
329
341
|
}, c = () => {
|
|
330
342
|
}, b = !1;
|
|
331
|
-
const
|
|
343
|
+
const a = () => {
|
|
332
344
|
b || (b = !0, d(), c());
|
|
333
345
|
};
|
|
334
|
-
return d = t.subscribe(
|
|
335
|
-
onData: (l) =>
|
|
336
|
-
sessionId:
|
|
346
|
+
return d = t.subscribe(i, {
|
|
347
|
+
onData: (l) => n({
|
|
348
|
+
sessionId: i,
|
|
337
349
|
kind: "data",
|
|
338
350
|
chunk: l
|
|
339
351
|
}),
|
|
340
352
|
onExit: (l) => {
|
|
341
|
-
|
|
342
|
-
sessionId:
|
|
353
|
+
n({
|
|
354
|
+
sessionId: i,
|
|
343
355
|
kind: "exit",
|
|
344
356
|
code: l.code,
|
|
345
357
|
signal: l.signal
|
|
346
|
-
}),
|
|
358
|
+
}), a();
|
|
347
359
|
}
|
|
348
|
-
}), c = r.onDisconnect(
|
|
360
|
+
}), c = r.onDisconnect(a), {
|
|
349
361
|
operation: "subscribe",
|
|
350
362
|
accepted: !0
|
|
351
363
|
};
|
|
352
364
|
}
|
|
353
365
|
}
|
|
354
366
|
};
|
|
355
|
-
},
|
|
367
|
+
}, bt = (e) => {
|
|
356
368
|
if (typeof document > "u") return;
|
|
357
369
|
const t = new KeyboardEvent("keydown", {
|
|
358
370
|
...e,
|
|
@@ -360,7 +372,7 @@ ${t.webview.moduleUrl}`;
|
|
|
360
372
|
cancelable: !0
|
|
361
373
|
});
|
|
362
374
|
document.dispatchEvent(t);
|
|
363
|
-
},
|
|
375
|
+
}, Ae = (e) => ({
|
|
364
376
|
"commands.execute": (t) => {
|
|
365
377
|
const r = t;
|
|
366
378
|
return e.workbench.commands.executeCommand(r.commandId, r.params);
|
|
@@ -391,79 +403,79 @@ ${t.webview.moduleUrl}`;
|
|
|
391
403
|
value: r.value
|
|
392
404
|
};
|
|
393
405
|
},
|
|
394
|
-
"host.dispatchKeyboardEvent": (t) => (e.dispatchKeyboardEvent ??
|
|
406
|
+
"host.dispatchKeyboardEvent": (t) => (e.dispatchKeyboardEvent ?? bt)(t),
|
|
395
407
|
...e.hostEvents ? {
|
|
396
|
-
"terminal.session":
|
|
408
|
+
"terminal.session": ut({
|
|
397
409
|
terminal: e.workbench.terminal,
|
|
398
410
|
hostEvents: e.hostEvents
|
|
399
411
|
})
|
|
400
412
|
} : {}
|
|
401
|
-
}),
|
|
413
|
+
}), ft = (e, t) => {
|
|
402
414
|
for (const r of t)
|
|
403
415
|
console.warn(`[workbench.webview:${e}] ${r.code}/${r.capability}: ${r.message}`);
|
|
404
|
-
},
|
|
416
|
+
}, pt = (e, t) => {
|
|
405
417
|
console.error(`[workbench.webview:${e}] runtime error: ${t}`);
|
|
406
|
-
},
|
|
418
|
+
}, K = "webview:bridge", ht = (e) => {
|
|
407
419
|
if (typeof e != "object" || e === null || Array.isArray(e)) return !1;
|
|
408
420
|
const t = e;
|
|
409
421
|
return typeof t.runtimeUrl == "string" && typeof t.moduleUrl == "string";
|
|
410
|
-
},
|
|
422
|
+
}, wt = ({
|
|
411
423
|
placement: e
|
|
412
424
|
}) => ({
|
|
413
425
|
placement: e,
|
|
414
426
|
resource: e.resource
|
|
415
|
-
}),
|
|
416
|
-
let r =
|
|
417
|
-
r || (r = /* @__PURE__ */ new Map(),
|
|
418
|
-
const
|
|
419
|
-
let
|
|
420
|
-
return
|
|
421
|
-
},
|
|
427
|
+
}), Pe = () => "light", he = /* @__PURE__ */ new WeakMap(), Te = (e, t) => {
|
|
428
|
+
let r = he.get(e);
|
|
429
|
+
r || (r = /* @__PURE__ */ new Map(), he.set(e, r));
|
|
430
|
+
const n = t.instanceId;
|
|
431
|
+
let o = r.get(n);
|
|
432
|
+
return o || (o = lt(), r.set(n, o)), o;
|
|
433
|
+
}, Se = (e) => {
|
|
422
434
|
const {
|
|
423
435
|
context: t,
|
|
424
436
|
createHostCapabilities: r,
|
|
425
|
-
createProps:
|
|
426
|
-
createTheme:
|
|
437
|
+
createProps: n,
|
|
438
|
+
createTheme: o = Pe,
|
|
427
439
|
ownerId: s,
|
|
428
|
-
title:
|
|
440
|
+
title: i,
|
|
429
441
|
webview: d
|
|
430
442
|
} = e;
|
|
431
|
-
return /* @__PURE__ */
|
|
443
|
+
return /* @__PURE__ */ S(ct, { view: {
|
|
432
444
|
extensionId: s ?? "workbench",
|
|
433
445
|
id: t.webviewId,
|
|
434
|
-
label: d.title ??
|
|
446
|
+
label: d.title ?? i,
|
|
435
447
|
webview: {
|
|
436
448
|
capabilities: d.capabilities,
|
|
437
449
|
moduleUrl: d.moduleUrl,
|
|
438
450
|
runtimeUrl: d.runtimeUrl,
|
|
439
451
|
styles: d.styles ?? []
|
|
440
452
|
}
|
|
441
|
-
}, props:
|
|
442
|
-
},
|
|
453
|
+
}, props: n(t), theme: o(t), capabilities: r(t), hostEvents: t.hostEvents, onDiagnostics: (c) => ft(t.webviewId, c), onError: (c) => pt(t.webviewId, c.message) });
|
|
454
|
+
}, gt = (e, t, r, n) => {
|
|
443
455
|
const {
|
|
444
|
-
workbench:
|
|
456
|
+
workbench: o,
|
|
445
457
|
panel: s,
|
|
446
|
-
instance:
|
|
447
|
-
} = e, d =
|
|
448
|
-
return d ?
|
|
458
|
+
instance: i
|
|
459
|
+
} = e, d = ht(s.config) ? s.config : null;
|
|
460
|
+
return d ? Se({
|
|
449
461
|
context: {
|
|
450
|
-
workbench:
|
|
451
|
-
webviewId:
|
|
452
|
-
placement:
|
|
453
|
-
hostEvents:
|
|
462
|
+
workbench: o,
|
|
463
|
+
webviewId: i.panelId,
|
|
464
|
+
placement: i,
|
|
465
|
+
hostEvents: Te(o, i)
|
|
454
466
|
},
|
|
455
467
|
createHostCapabilities: t,
|
|
456
468
|
createProps: r,
|
|
457
|
-
createTheme:
|
|
469
|
+
createTheme: n,
|
|
458
470
|
ownerId: "ownerId" in s ? s.ownerId : void 0,
|
|
459
471
|
title: s.title,
|
|
460
472
|
webview: d
|
|
461
473
|
}) : null;
|
|
462
|
-
},
|
|
463
|
-
const t = e.createHostCapabilities ??
|
|
474
|
+
}, It = (e = {}) => {
|
|
475
|
+
const t = e.createHostCapabilities ?? Ae, r = e.createProps ?? wt, n = e.createTheme ?? Pe;
|
|
464
476
|
return {
|
|
465
|
-
id:
|
|
466
|
-
render: (
|
|
477
|
+
id: K,
|
|
478
|
+
render: (o) => gt(o, t, r, n)
|
|
467
479
|
};
|
|
468
480
|
}, y = (e, t) => ({
|
|
469
481
|
id: e,
|
|
@@ -495,12 +507,12 @@ y("workspace.headerPrimary", {
|
|
|
495
507
|
}), y("workspace.sidenav", {
|
|
496
508
|
kind: "panel"
|
|
497
509
|
});
|
|
498
|
-
const
|
|
510
|
+
const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e.$l10n == "string", u = (e, t = "") => e === void 0 ? t : yt(e) ? e.default ?? e.$l10n : e, N = (e) => {
|
|
499
511
|
const t = e;
|
|
500
512
|
if (!t?.outcome) return e;
|
|
501
513
|
if (t.outcome.status === "success") return t.outcome.value;
|
|
502
514
|
throw new Error(t.outcome.reason ?? t.outcome.error?.message ?? "Extension command failed.");
|
|
503
|
-
},
|
|
515
|
+
}, re = (e) => {
|
|
504
516
|
if (e)
|
|
505
517
|
return {
|
|
506
518
|
type: e.kind,
|
|
@@ -508,13 +520,13 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
508
520
|
label: e.label,
|
|
509
521
|
metadata: e.metadata
|
|
510
522
|
};
|
|
511
|
-
},
|
|
523
|
+
}, U = (e) => ({
|
|
512
524
|
kind: e.type,
|
|
513
525
|
uri: `pstdio://extension-resource/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}`,
|
|
514
526
|
id: e.id,
|
|
515
527
|
label: e.label,
|
|
516
528
|
metadata: e.metadata
|
|
517
|
-
}),
|
|
529
|
+
}), M = (e) => ({
|
|
518
530
|
id: e.id,
|
|
519
531
|
kind: e.kind,
|
|
520
532
|
context: {
|
|
@@ -522,13 +534,13 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
522
534
|
...e.context ?? {}
|
|
523
535
|
}
|
|
524
536
|
}), k = async (e, t, r = {}) => {
|
|
525
|
-
const
|
|
537
|
+
const n = re(r.resource), o = await e.executeCommand(t, {
|
|
526
538
|
projectId: e.projectId,
|
|
527
539
|
...r.params ? {
|
|
528
540
|
params: r.params
|
|
529
541
|
} : {},
|
|
530
|
-
...
|
|
531
|
-
resource:
|
|
542
|
+
...n ? {
|
|
543
|
+
resource: n
|
|
532
544
|
} : {},
|
|
533
545
|
...r.slot ? {
|
|
534
546
|
slot: r.slot
|
|
@@ -538,168 +550,189 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
538
550
|
metadata: r.metadata
|
|
539
551
|
} : {}
|
|
540
552
|
});
|
|
541
|
-
return
|
|
542
|
-
},
|
|
553
|
+
return N(o);
|
|
554
|
+
}, vt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), kt = (e) => typeof e == "string" ? e : e?.id, Rt = async (e, t) => {
|
|
543
555
|
if (t.kind === "resource" && t.resource) {
|
|
544
|
-
await e.workbench.resources.openResource(
|
|
556
|
+
await e.workbench.resources.openResource(U(t.resource), {
|
|
545
557
|
replaceActive: !0
|
|
546
558
|
}).catch(() => {
|
|
547
559
|
});
|
|
548
560
|
return;
|
|
549
561
|
}
|
|
550
|
-
const r =
|
|
562
|
+
const r = kt(t.command);
|
|
551
563
|
r && (await k(e, r, {
|
|
552
564
|
params: t.params
|
|
553
565
|
}), e.workbench.commandPaletteResources.refresh());
|
|
554
|
-
},
|
|
555
|
-
id: `${t.id}:${
|
|
556
|
-
label:
|
|
557
|
-
description:
|
|
558
|
-
icon:
|
|
559
|
-
keywords:
|
|
566
|
+
}, Ct = (e, t, r, n) => ({
|
|
567
|
+
id: `${t.id}:${n.id}`,
|
|
568
|
+
label: n.label,
|
|
569
|
+
description: n.description,
|
|
570
|
+
icon: n.icon,
|
|
571
|
+
keywords: n.keywords,
|
|
560
572
|
group: r,
|
|
561
|
-
activate: () =>
|
|
562
|
-
}),
|
|
573
|
+
activate: () => Rt(e, n.target)
|
|
574
|
+
}), Et = (e, t) => {
|
|
563
575
|
const r = [];
|
|
564
|
-
for (const
|
|
565
|
-
const
|
|
576
|
+
for (const n of t) {
|
|
577
|
+
const o = u(n.title, n.id);
|
|
566
578
|
r.push(e.workbench.commandPaletteResources.registerProvider({
|
|
567
|
-
id:
|
|
568
|
-
title:
|
|
569
|
-
refreshEventIds:
|
|
579
|
+
id: n.id,
|
|
580
|
+
title: o,
|
|
581
|
+
refreshEventIds: n.refreshEventIds,
|
|
570
582
|
query: async ({
|
|
571
583
|
query: s,
|
|
572
|
-
limit:
|
|
584
|
+
limit: i
|
|
573
585
|
}) => {
|
|
574
|
-
const d = e.workbench.getActiveResource(), c = await k(e,
|
|
586
|
+
const d = e.workbench.getActiveResource(), c = await k(e, n.queryCommandId, {
|
|
575
587
|
params: {
|
|
576
588
|
projectId: e.projectId,
|
|
577
589
|
modeId: e.workbench.modes.getActiveModeId(),
|
|
578
|
-
activeResource:
|
|
579
|
-
providerId:
|
|
590
|
+
activeResource: re(d),
|
|
591
|
+
providerId: n.id,
|
|
580
592
|
query: s,
|
|
581
|
-
limit:
|
|
593
|
+
limit: i
|
|
582
594
|
}
|
|
583
595
|
});
|
|
584
|
-
return
|
|
596
|
+
return vt(c) ? (c.items ?? []).map((b) => Ct(e, n, o, b)) : [];
|
|
585
597
|
}
|
|
586
598
|
}));
|
|
587
599
|
}
|
|
588
600
|
return {
|
|
589
601
|
dispose() {
|
|
590
|
-
for (let
|
|
602
|
+
for (let n = r.length - 1; n >= 0; n -= 1) r[n]?.dispose();
|
|
591
603
|
}
|
|
592
604
|
};
|
|
593
|
-
},
|
|
594
|
-
title:
|
|
605
|
+
}, _ = (e) => ({
|
|
606
|
+
title: u(e.title),
|
|
595
607
|
runtimeUrl: e.runtimeUrl,
|
|
596
608
|
moduleUrl: e.moduleUrl,
|
|
597
609
|
styles: e.styles,
|
|
598
610
|
capabilities: e.capabilities
|
|
599
|
-
}),
|
|
611
|
+
}), D = (e) => e ? {
|
|
600
612
|
resourceKinds: e.resourceKinds ? [...e.resourceKinds] : void 0
|
|
601
|
-
} : void 0,
|
|
602
|
-
|
|
613
|
+
} : void 0, xt = {
|
|
614
|
+
first: 1e6,
|
|
615
|
+
default: 0,
|
|
616
|
+
last: -1e6
|
|
617
|
+
}, A = (e) => ({
|
|
618
|
+
priority: xt[e.placement ?? "default"] - (e.declarationIndex ?? 0)
|
|
619
|
+
}), $ = (e) => {
|
|
620
|
+
const t = [];
|
|
621
|
+
let r = 0;
|
|
622
|
+
for (const n of e)
|
|
623
|
+
t.push(r), r += n.panelMenus?.length ?? 0;
|
|
624
|
+
return t;
|
|
625
|
+
}, At = (e) => {
|
|
626
|
+
const t = e.treeRendererId ?? e.fileRendererId ?? e.controlsRendererId ?? e.dataTableRendererId ?? (e.webview ? K : void 0);
|
|
603
627
|
if (!t) throw new Error(`Panel Menu has no renderer: ${e.id}`);
|
|
604
628
|
return t;
|
|
605
|
-
},
|
|
606
|
-
id:
|
|
607
|
-
title:
|
|
608
|
-
side:
|
|
609
|
-
rendererId:
|
|
610
|
-
config:
|
|
611
|
-
|
|
612
|
-
|
|
629
|
+
}, B = (e, t = 0) => e?.map((r, n) => ({
|
|
630
|
+
id: r.id,
|
|
631
|
+
title: u(r.title, r.id),
|
|
632
|
+
side: r.side,
|
|
633
|
+
rendererId: At(r),
|
|
634
|
+
config: r.webview ? _(r.webview) : void 0,
|
|
635
|
+
...A({
|
|
636
|
+
placement: r.placement,
|
|
637
|
+
declarationIndex: t + n
|
|
638
|
+
})
|
|
639
|
+
})), H = (e) => e.workbench.layout.registerPanel(e.contribution), Y = (e, t = "") => u(e, t), Pt = (e) => !!e && typeof e == "object" && !Array.isArray(e), Tt = (e, t, r) => {
|
|
640
|
+
const n = (o, s, i) => o ? k(e, o, {
|
|
613
641
|
params: s,
|
|
614
|
-
resource:
|
|
642
|
+
resource: i
|
|
615
643
|
}) : Promise.resolve(void 0);
|
|
616
644
|
return e.workbench.renderers.registerControlsRenderer({
|
|
617
645
|
id: t.id,
|
|
618
|
-
title:
|
|
619
|
-
emptyTitle:
|
|
620
|
-
emptyDescription:
|
|
646
|
+
title: Y(t.title, t.id),
|
|
647
|
+
emptyTitle: Y(t.emptyTitle, ""),
|
|
648
|
+
emptyDescription: Y(t.emptyDescription, ""),
|
|
621
649
|
defaultValues: t.defaultValues,
|
|
622
|
-
executeQuery: async (
|
|
623
|
-
const s = await
|
|
624
|
-
return
|
|
650
|
+
executeQuery: async (o) => {
|
|
651
|
+
const s = await n(t.queryCommandId, {}, o ?? r.resolveResource?.(t));
|
|
652
|
+
return Pt(s) ? s : {};
|
|
625
653
|
},
|
|
626
654
|
updateValue: t.updateValueCommandId ? ({
|
|
627
|
-
controlId:
|
|
655
|
+
controlId: o,
|
|
628
656
|
value: s,
|
|
629
|
-
values:
|
|
657
|
+
values: i,
|
|
630
658
|
resource: d
|
|
631
|
-
}) =>
|
|
632
|
-
controlId:
|
|
659
|
+
}) => n(t.updateValueCommandId, {
|
|
660
|
+
controlId: o,
|
|
633
661
|
value: s,
|
|
634
|
-
values:
|
|
662
|
+
values: i
|
|
635
663
|
}, d).then(() => {
|
|
636
664
|
}) : void 0,
|
|
637
665
|
apply: t.applyCommandId ? ({
|
|
638
|
-
values:
|
|
666
|
+
values: o,
|
|
639
667
|
resource: s
|
|
640
|
-
}) =>
|
|
641
|
-
values:
|
|
668
|
+
}) => n(t.applyCommandId, {
|
|
669
|
+
values: o
|
|
642
670
|
}, s).then(() => {
|
|
643
671
|
}) : void 0,
|
|
644
672
|
reset: t.resetCommandId ? ({
|
|
645
|
-
controlIds:
|
|
673
|
+
controlIds: o,
|
|
646
674
|
resource: s
|
|
647
|
-
}) =>
|
|
648
|
-
controlIds:
|
|
675
|
+
}) => n(t.resetCommandId, {
|
|
676
|
+
controlIds: o
|
|
649
677
|
}, s).then(() => {
|
|
650
678
|
}) : void 0
|
|
651
679
|
});
|
|
652
|
-
},
|
|
680
|
+
}, St = (e, t, r, n) => {
|
|
653
681
|
if (t.controlsRendererId)
|
|
654
|
-
return
|
|
682
|
+
return H({
|
|
655
683
|
workbench: e.workbench,
|
|
656
684
|
contribution: {
|
|
657
685
|
id: t.id,
|
|
658
|
-
title:
|
|
686
|
+
title: u(t.title, t.id),
|
|
687
|
+
icon: t.icon,
|
|
659
688
|
region: t.region,
|
|
660
689
|
closable: t.closable,
|
|
661
690
|
rendererId: t.controlsRendererId,
|
|
662
691
|
singleton: !0,
|
|
663
692
|
resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
|
|
664
|
-
eligibleLocations:
|
|
665
|
-
panelMenus:
|
|
693
|
+
eligibleLocations: D(t.eligibleLocations),
|
|
694
|
+
panelMenus: B(t.panelMenus, n),
|
|
695
|
+
...A({
|
|
696
|
+
placement: t.placement,
|
|
697
|
+
declarationIndex: r
|
|
698
|
+
})
|
|
666
699
|
}
|
|
667
700
|
});
|
|
668
|
-
},
|
|
669
|
-
const
|
|
670
|
-
for (const
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
701
|
+
}, un = (e, t, r, n = {}) => {
|
|
702
|
+
const o = [];
|
|
703
|
+
for (const i of t) o.push(Tt(e, i, n));
|
|
704
|
+
const s = $(r);
|
|
705
|
+
return r.forEach((i, d) => {
|
|
706
|
+
const c = St(e, i, d, s[d]);
|
|
707
|
+
c && o.push(c);
|
|
708
|
+
}), {
|
|
676
709
|
dispose() {
|
|
677
|
-
for (let
|
|
710
|
+
for (let i = o.length - 1; i >= 0; i -= 1) o[i]?.dispose();
|
|
678
711
|
}
|
|
679
712
|
};
|
|
680
|
-
}, R = (e, t = "") =>
|
|
713
|
+
}, R = (e, t = "") => u(e, t), we = (e) => ({
|
|
681
714
|
...e,
|
|
682
715
|
label: R(e.label, e.id),
|
|
683
716
|
description: e.description ? R(e.description) : void 0,
|
|
684
|
-
icon: e.icon ?
|
|
717
|
+
icon: e.icon ? W(j, {
|
|
685
718
|
name: e.icon,
|
|
686
719
|
size: 14
|
|
687
720
|
}) : void 0
|
|
688
|
-
}),
|
|
721
|
+
}), Wt = (e) => !!(e && typeof e == "object" && Array.isArray(e.rows)), jt = (e) => ({
|
|
689
722
|
id: e.id,
|
|
690
723
|
values: e.values,
|
|
691
|
-
resource: e.resource ?
|
|
692
|
-
}),
|
|
693
|
-
const r =
|
|
724
|
+
resource: e.resource ? U(e.resource) : void 0
|
|
725
|
+
}), Kt = (e, t) => {
|
|
726
|
+
const r = M({
|
|
694
727
|
id: t.id,
|
|
695
728
|
kind: "dataTableRenderer",
|
|
696
729
|
projectId: e.projectId,
|
|
697
730
|
context: {
|
|
698
731
|
dataTableRendererId: t.id
|
|
699
732
|
}
|
|
700
|
-
}),
|
|
733
|
+
}), n = (o, s, i) => k(e, o, {
|
|
701
734
|
params: s,
|
|
702
|
-
resource:
|
|
735
|
+
resource: i,
|
|
703
736
|
slot: r,
|
|
704
737
|
metadata: {
|
|
705
738
|
dataTableRendererId: t.id
|
|
@@ -709,93 +742,98 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
709
742
|
id: t.id,
|
|
710
743
|
title: R(t.title, t.id),
|
|
711
744
|
resourceKind: t.resourceKind,
|
|
712
|
-
columns: t.columns?.map(
|
|
745
|
+
columns: t.columns?.map(we),
|
|
713
746
|
initialPageSize: t.initialPageSize,
|
|
714
747
|
pageSizeOptions: t.pageSizeOptions,
|
|
715
748
|
selectionMode: t.selectionMode,
|
|
716
|
-
selectionActions: t.selectionActions?.map((
|
|
717
|
-
id:
|
|
718
|
-
label: R(
|
|
719
|
-
icon:
|
|
720
|
-
name:
|
|
749
|
+
selectionActions: t.selectionActions?.map((o) => ({
|
|
750
|
+
id: o.id,
|
|
751
|
+
label: R(o.label, o.id),
|
|
752
|
+
icon: o.icon ? W(j, {
|
|
753
|
+
name: o.icon,
|
|
721
754
|
size: 16
|
|
722
755
|
}) : void 0,
|
|
723
|
-
destructive:
|
|
724
|
-
run: (s) => o
|
|
725
|
-
rowIds: s.map((
|
|
756
|
+
destructive: o.destructive,
|
|
757
|
+
run: (s) => n(o.commandId, {
|
|
758
|
+
rowIds: s.map((i) => i.id)
|
|
726
759
|
}).then(() => {
|
|
727
760
|
})
|
|
728
761
|
})),
|
|
729
762
|
emptyTitle: t.emptyTitle ? R(t.emptyTitle) : void 0,
|
|
730
763
|
emptyDescription: t.emptyDescription ? R(t.emptyDescription) : void 0,
|
|
731
764
|
executeQuery: async ({
|
|
732
|
-
resource:
|
|
765
|
+
resource: o,
|
|
733
766
|
modeId: s
|
|
734
767
|
}) => {
|
|
735
|
-
const
|
|
768
|
+
const i = await n(t.queryCommandId, {
|
|
736
769
|
rendererId: t.id,
|
|
737
770
|
projectId: e.projectId,
|
|
738
771
|
modeId: s,
|
|
739
|
-
resource:
|
|
740
|
-
type:
|
|
741
|
-
id:
|
|
742
|
-
label:
|
|
743
|
-
metadata:
|
|
772
|
+
resource: o ? {
|
|
773
|
+
type: o.kind,
|
|
774
|
+
id: o.id ?? o.uri,
|
|
775
|
+
label: o.label,
|
|
776
|
+
metadata: o.metadata
|
|
744
777
|
} : void 0
|
|
745
|
-
},
|
|
746
|
-
return
|
|
747
|
-
rows:
|
|
748
|
-
columns:
|
|
778
|
+
}, o);
|
|
779
|
+
return Wt(i) ? {
|
|
780
|
+
rows: i.rows.map(jt),
|
|
781
|
+
columns: i.columns?.map(we)
|
|
749
782
|
} : {
|
|
750
783
|
rows: []
|
|
751
784
|
};
|
|
752
785
|
},
|
|
753
|
-
rowActions: t.rowActions?.map((
|
|
754
|
-
id:
|
|
755
|
-
label: R(
|
|
756
|
-
icon:
|
|
757
|
-
name:
|
|
786
|
+
rowActions: t.rowActions?.map((o) => ({
|
|
787
|
+
id: o.id,
|
|
788
|
+
label: R(o.label, o.id),
|
|
789
|
+
icon: o.icon ? W(j, {
|
|
790
|
+
name: o.icon,
|
|
758
791
|
size: 16
|
|
759
792
|
}) : void 0,
|
|
760
|
-
destructive:
|
|
761
|
-
run: (s) =>
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
793
|
+
destructive: o.destructive,
|
|
794
|
+
run: async (s) => {
|
|
795
|
+
await n(o.commandId, {
|
|
796
|
+
rowId: s.id
|
|
797
|
+
}, s.resource), e.workbench.renderers.refreshDataTableRenderer(t.id);
|
|
798
|
+
}
|
|
765
799
|
}))
|
|
766
800
|
});
|
|
767
|
-
},
|
|
801
|
+
}, Mt = (e, t, r, n) => {
|
|
768
802
|
if (t.dataTableRendererId)
|
|
769
|
-
return
|
|
803
|
+
return H({
|
|
770
804
|
workbench: e.workbench,
|
|
771
805
|
contribution: {
|
|
772
806
|
id: t.id,
|
|
773
|
-
title:
|
|
807
|
+
title: u(t.title, t.id),
|
|
808
|
+
icon: t.icon,
|
|
774
809
|
region: t.region,
|
|
775
810
|
closable: t.closable,
|
|
776
811
|
rendererId: t.dataTableRendererId,
|
|
777
812
|
singleton: !0,
|
|
778
813
|
resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
|
|
779
|
-
eligibleLocations:
|
|
780
|
-
panelMenus:
|
|
814
|
+
eligibleLocations: D(t.eligibleLocations),
|
|
815
|
+
panelMenus: B(t.panelMenus, n),
|
|
816
|
+
...A({
|
|
817
|
+
placement: t.placement,
|
|
818
|
+
declarationIndex: r
|
|
819
|
+
})
|
|
781
820
|
}
|
|
782
821
|
});
|
|
783
|
-
},
|
|
784
|
-
const
|
|
785
|
-
|
|
786
|
-
const
|
|
787
|
-
|
|
788
|
-
}
|
|
789
|
-
return {
|
|
822
|
+
}, Dt = (e, t, r) => {
|
|
823
|
+
const n = t.map((s) => Kt(e, s)), o = $(r);
|
|
824
|
+
return r.forEach((s, i) => {
|
|
825
|
+
const d = Mt(e, s, i, o[i]);
|
|
826
|
+
d && n.push(d);
|
|
827
|
+
}), {
|
|
790
828
|
dispose() {
|
|
791
|
-
for (let
|
|
829
|
+
for (let s = n.length - 1; s >= 0; s -= 1) n[s]?.dispose();
|
|
792
830
|
}
|
|
793
831
|
};
|
|
794
|
-
},
|
|
832
|
+
}, $t = {
|
|
795
833
|
first: 0,
|
|
796
834
|
default: 1,
|
|
797
835
|
last: 2
|
|
798
|
-
},
|
|
836
|
+
}, bn = {
|
|
799
837
|
commands: [],
|
|
800
838
|
commandPaletteContributions: [],
|
|
801
839
|
diagnostics: [],
|
|
@@ -812,112 +850,112 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
812
850
|
settingsDefinitions: [],
|
|
813
851
|
treeItems: [],
|
|
814
852
|
panels: []
|
|
815
|
-
},
|
|
853
|
+
}, Bt = (e) => `workbench.extension.menu.${e.id}`, Ht = (e) => `workbench.extension.palette.${e.id}`, We = (e, t) => $t[e.placement ?? "default"] * 1e3 + t, je = (e) => e === void 0 ? "" : qe(e) ? e.default ?? e.$l10n : e, Lt = (e) => {
|
|
816
854
|
const {
|
|
817
855
|
commandId: t,
|
|
818
856
|
contribution: r,
|
|
819
|
-
index:
|
|
820
|
-
resolveString:
|
|
857
|
+
index: n,
|
|
858
|
+
resolveString: o,
|
|
821
859
|
slot: s,
|
|
822
|
-
when:
|
|
860
|
+
when: i
|
|
823
861
|
} = e;
|
|
824
862
|
return {
|
|
825
863
|
commandId: t,
|
|
826
864
|
sourceCommandId: r.commandId,
|
|
827
|
-
label:
|
|
865
|
+
label: o(r.label, r.extensionId),
|
|
828
866
|
icon: r.icon,
|
|
829
867
|
group: s.group ?? r.group,
|
|
830
868
|
overflowLabel: s.overflowLabel,
|
|
831
|
-
order:
|
|
832
|
-
when:
|
|
869
|
+
order: We(r, n),
|
|
870
|
+
when: i
|
|
833
871
|
};
|
|
834
|
-
},
|
|
872
|
+
}, Ot = (e) => {
|
|
835
873
|
const {
|
|
836
874
|
commandId: t,
|
|
837
875
|
contribution: r,
|
|
838
|
-
index:
|
|
839
|
-
resolveString:
|
|
876
|
+
index: n,
|
|
877
|
+
resolveString: o
|
|
840
878
|
} = e;
|
|
841
879
|
return {
|
|
842
880
|
commandId: t,
|
|
843
|
-
label:
|
|
881
|
+
label: o(r.label, r.extensionId),
|
|
844
882
|
icon: r.icon,
|
|
845
883
|
group: r.group,
|
|
846
|
-
order:
|
|
884
|
+
order: We(r, n)
|
|
847
885
|
};
|
|
848
|
-
},
|
|
886
|
+
}, Vt = (e) => {
|
|
849
887
|
const {
|
|
850
|
-
createCommandId: t =
|
|
888
|
+
createCommandId: t = Bt,
|
|
851
889
|
createWhenExpression: r,
|
|
852
|
-
menuSlotsById:
|
|
853
|
-
menuTargetsById:
|
|
890
|
+
menuSlotsById: n,
|
|
891
|
+
menuTargetsById: o,
|
|
854
892
|
metadata: s,
|
|
855
|
-
resolveString:
|
|
893
|
+
resolveString: i = je
|
|
856
894
|
} = e, d = [];
|
|
857
895
|
return s.menuContributions.forEach((c, b) => {
|
|
858
|
-
const
|
|
859
|
-
if (!
|
|
860
|
-
const l = t(c),
|
|
896
|
+
const a = c.target ? o?.get(c.target) : n.get(c.slotId);
|
|
897
|
+
if (!a) return;
|
|
898
|
+
const l = t(c), m = s.commands.find((f) => f.id === c.commandId);
|
|
861
899
|
d.push({
|
|
862
900
|
command: {
|
|
863
901
|
id: l,
|
|
864
|
-
label:
|
|
902
|
+
label: i(c.label, c.extensionId),
|
|
865
903
|
category: c.group,
|
|
866
|
-
description:
|
|
904
|
+
description: m ? i(m.description, m.extensionId) : void 0,
|
|
867
905
|
icon: c.icon,
|
|
868
|
-
params:
|
|
906
|
+
params: m?.params
|
|
869
907
|
},
|
|
870
908
|
contribution: c,
|
|
871
|
-
menuItem:
|
|
909
|
+
menuItem: Lt({
|
|
872
910
|
commandId: l,
|
|
873
911
|
contribution: c,
|
|
874
912
|
index: b,
|
|
875
|
-
resolveString:
|
|
876
|
-
slot:
|
|
913
|
+
resolveString: i,
|
|
914
|
+
slot: a,
|
|
877
915
|
when: r?.(c)
|
|
878
916
|
}),
|
|
879
|
-
menuPath:
|
|
917
|
+
menuPath: a.menuPath,
|
|
880
918
|
targetCommandId: c.commandId
|
|
881
919
|
});
|
|
882
920
|
}), d;
|
|
883
|
-
},
|
|
921
|
+
}, Ft = (e) => {
|
|
884
922
|
const {
|
|
885
|
-
createCommandId: t =
|
|
923
|
+
createCommandId: t = Ht,
|
|
886
924
|
metadata: r,
|
|
887
|
-
resolveString:
|
|
888
|
-
} = e,
|
|
889
|
-
return (r.commandPaletteContributions ?? []).forEach((s,
|
|
925
|
+
resolveString: n = je
|
|
926
|
+
} = e, o = [];
|
|
927
|
+
return (r.commandPaletteContributions ?? []).forEach((s, i) => {
|
|
890
928
|
const d = t(s), c = r.commands.find((b) => b.id === s.commandId);
|
|
891
|
-
|
|
929
|
+
o.push({
|
|
892
930
|
command: {
|
|
893
931
|
id: d,
|
|
894
|
-
label:
|
|
932
|
+
label: n(s.label, s.extensionId),
|
|
895
933
|
category: s.group,
|
|
896
|
-
description: c ?
|
|
934
|
+
description: c ? n(c.description, c.extensionId) : void 0,
|
|
897
935
|
icon: s.icon,
|
|
898
936
|
params: c?.params
|
|
899
937
|
},
|
|
900
938
|
contribution: s,
|
|
901
|
-
menuItem:
|
|
939
|
+
menuItem: Ot({
|
|
902
940
|
commandId: d,
|
|
903
941
|
contribution: s,
|
|
904
|
-
index:
|
|
905
|
-
resolveString:
|
|
942
|
+
index: i,
|
|
943
|
+
resolveString: n
|
|
906
944
|
}),
|
|
907
945
|
targetCommandId: s.commandId
|
|
908
946
|
});
|
|
909
|
-
}),
|
|
910
|
-
},
|
|
947
|
+
}), o;
|
|
948
|
+
}, fn = (e) => {
|
|
911
949
|
const {
|
|
912
950
|
createResource: t,
|
|
913
951
|
metadata: r
|
|
914
952
|
} = e;
|
|
915
|
-
return r ? r.routes.map((
|
|
953
|
+
return r ? r.routes.map((n) => ({
|
|
916
954
|
resource: t({
|
|
917
|
-
route:
|
|
955
|
+
route: n
|
|
918
956
|
})
|
|
919
957
|
})) : [];
|
|
920
|
-
},
|
|
958
|
+
}, Nt = (e) => {
|
|
921
959
|
if (e)
|
|
922
960
|
return {
|
|
923
961
|
type: e.kind,
|
|
@@ -925,7 +963,7 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
925
963
|
label: e.label,
|
|
926
964
|
metadata: e.metadata
|
|
927
965
|
};
|
|
928
|
-
},
|
|
966
|
+
}, Ut = (e) => ({
|
|
929
967
|
id: e.rendererId,
|
|
930
968
|
kind: "renderer",
|
|
931
969
|
context: {
|
|
@@ -935,174 +973,179 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
935
973
|
resourceId: e.resource.id
|
|
936
974
|
} : {}
|
|
937
975
|
}
|
|
938
|
-
}),
|
|
939
|
-
const s =
|
|
976
|
+
}), ge = async (e, t, r, n, o = {}) => {
|
|
977
|
+
const s = Nt(n), i = await e.executeCommand(r, {
|
|
940
978
|
projectId: e.projectId,
|
|
941
979
|
params: {
|
|
942
980
|
projectId: e.projectId,
|
|
943
981
|
resource: s,
|
|
944
|
-
...
|
|
982
|
+
...o
|
|
945
983
|
},
|
|
946
984
|
resource: s,
|
|
947
|
-
slot:
|
|
985
|
+
slot: Ut({
|
|
948
986
|
projectId: e.projectId,
|
|
949
987
|
rendererId: t,
|
|
950
988
|
resource: s
|
|
951
989
|
}),
|
|
952
990
|
source: "dashboard"
|
|
953
991
|
});
|
|
954
|
-
return
|
|
955
|
-
},
|
|
992
|
+
return N(i);
|
|
993
|
+
}, _t = (e, t) => e.workbench.renderers.registerFileRenderer({
|
|
956
994
|
id: t.id,
|
|
957
|
-
title:
|
|
995
|
+
title: u(t.title, t.id),
|
|
958
996
|
resourceKind: t.resourceKind,
|
|
959
|
-
load: async (r) => await
|
|
960
|
-
save: t.saveCommandId ? async (r,
|
|
961
|
-
await
|
|
962
|
-
content:
|
|
997
|
+
load: async (r) => await ge(e, t.id, t.loadCommandId, r) ?? {},
|
|
998
|
+
save: t.saveCommandId ? async (r, n) => {
|
|
999
|
+
await ge(e, t.id, t.saveCommandId, r, {
|
|
1000
|
+
content: n
|
|
963
1001
|
});
|
|
964
1002
|
} : void 0
|
|
965
|
-
}),
|
|
1003
|
+
}), qt = (e, t, r, n) => {
|
|
966
1004
|
if (t.fileRendererId)
|
|
967
|
-
return
|
|
1005
|
+
return H({
|
|
968
1006
|
workbench: e.workbench,
|
|
969
1007
|
contribution: {
|
|
970
1008
|
id: t.id,
|
|
971
|
-
title:
|
|
1009
|
+
title: u(t.title, t.id),
|
|
1010
|
+
icon: t.icon,
|
|
972
1011
|
region: t.region,
|
|
973
1012
|
closable: t.closable,
|
|
974
1013
|
rendererId: t.fileRendererId,
|
|
975
1014
|
singleton: !0,
|
|
976
1015
|
resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
|
|
977
|
-
eligibleLocations:
|
|
978
|
-
panelMenus:
|
|
1016
|
+
eligibleLocations: D(t.eligibleLocations),
|
|
1017
|
+
panelMenus: B(t.panelMenus, n),
|
|
1018
|
+
...A({
|
|
1019
|
+
placement: t.placement,
|
|
1020
|
+
declarationIndex: r
|
|
1021
|
+
})
|
|
979
1022
|
}
|
|
980
1023
|
});
|
|
981
|
-
},
|
|
1024
|
+
}, zt = (e) => {
|
|
982
1025
|
const t = [];
|
|
983
|
-
for (const
|
|
984
|
-
t.push(
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
1026
|
+
for (const n of e.metadata.fileRenderers ?? [])
|
|
1027
|
+
t.push(_t(e, n));
|
|
1028
|
+
const r = $(e.metadata.panels);
|
|
1029
|
+
return e.metadata.panels.forEach((n, o) => {
|
|
1030
|
+
const s = qt(e, n, o, r[o]);
|
|
1031
|
+
s && t.push(s);
|
|
1032
|
+
}), {
|
|
990
1033
|
dispose() {
|
|
991
|
-
for (let
|
|
1034
|
+
for (let n = t.length - 1; n >= 0; n -= 1) t[n]?.dispose();
|
|
992
1035
|
}
|
|
993
1036
|
};
|
|
994
|
-
},
|
|
1037
|
+
}, Qt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Ie = (e, t, r, n) => (t ?? []).map((o) => {
|
|
995
1038
|
const s = {
|
|
996
|
-
...
|
|
997
|
-
label: r(
|
|
998
|
-
type:
|
|
999
|
-
...
|
|
1000
|
-
options: Array.isArray(
|
|
1001
|
-
...
|
|
1002
|
-
label: r(
|
|
1003
|
-
})) :
|
|
1004
|
-
} :
|
|
1039
|
+
...o,
|
|
1040
|
+
label: r(o.label, o.id),
|
|
1041
|
+
type: o.type.kind === "enum" || o.type.kind === "enum-multi" ? {
|
|
1042
|
+
...o.type,
|
|
1043
|
+
options: Array.isArray(o.type.options) ? o.type.options.map((i) => ({
|
|
1044
|
+
...i,
|
|
1045
|
+
label: r(i.label, i.value)
|
|
1046
|
+
})) : o.type.options
|
|
1047
|
+
} : o.type
|
|
1005
1048
|
};
|
|
1006
|
-
return
|
|
1007
|
-
}),
|
|
1008
|
-
let
|
|
1049
|
+
return n(e, s);
|
|
1050
|
+
}), Gt = (e, t, r, n) => {
|
|
1051
|
+
let o = Ie(e, t, r, n);
|
|
1009
1052
|
const s = /* @__PURE__ */ new Set();
|
|
1010
1053
|
return {
|
|
1011
1054
|
source: {
|
|
1012
|
-
getSnapshot: () =>
|
|
1013
|
-
subscribe: (
|
|
1055
|
+
getSnapshot: () => o,
|
|
1056
|
+
subscribe: (i) => (s.add(i), () => s.delete(i))
|
|
1014
1057
|
},
|
|
1015
|
-
set(
|
|
1016
|
-
|
|
1058
|
+
set(i) {
|
|
1059
|
+
o = Ie(e, i, r, n);
|
|
1017
1060
|
for (const d of s) d();
|
|
1018
1061
|
}
|
|
1019
1062
|
};
|
|
1020
|
-
},
|
|
1063
|
+
}, Yt = (e) => !!(e && typeof e == "object" && typeof e.kind == "string"), Xt = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), Jt = (e, t) => `pstdio://extension-resource/${encodeURIComponent(e)}/${encodeURIComponent(t)}`, Ke = (e, t) => {
|
|
1021
1064
|
const {
|
|
1022
1065
|
resource: r
|
|
1023
1066
|
} = t;
|
|
1024
|
-
if (
|
|
1025
|
-
if (
|
|
1026
|
-
},
|
|
1027
|
-
const r =
|
|
1067
|
+
if (Yt(r)) return r;
|
|
1068
|
+
if (Xt(r)) return U(r);
|
|
1069
|
+
}, Zt = (e, t) => {
|
|
1070
|
+
const r = Ke(e, t);
|
|
1028
1071
|
if (r) return r;
|
|
1029
1072
|
if (e.resourceKind)
|
|
1030
1073
|
return {
|
|
1031
1074
|
kind: e.resourceKind,
|
|
1032
|
-
uri:
|
|
1075
|
+
uri: Jt(e.resourceKind, t.id),
|
|
1033
1076
|
id: t.id,
|
|
1034
1077
|
label: t.title
|
|
1035
1078
|
};
|
|
1036
|
-
},
|
|
1037
|
-
const r = e,
|
|
1038
|
-
return
|
|
1079
|
+
}, ye = (e, t) => {
|
|
1080
|
+
const r = e, n = t(r);
|
|
1081
|
+
return n === void 0 ? r : {
|
|
1039
1082
|
...r,
|
|
1040
|
-
resource:
|
|
1083
|
+
resource: n
|
|
1041
1084
|
};
|
|
1042
|
-
},
|
|
1043
|
-
if (!
|
|
1044
|
-
const
|
|
1085
|
+
}, Me = (...e) => Object.assign({}, ...e.filter((t) => !!t)), er = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, tr = (e) => Object.keys(e ?? {}).length > 0, rr = /* @__PURE__ */ new Set(["text", "longtext", "markdown", "number", "boolean", "select", "multi-select", "files"]), nr = (e, t, r) => {
|
|
1086
|
+
if (!rr.has(t.type)) return;
|
|
1087
|
+
const n = "options" in t && Array.isArray(t.options) ? t.options : [], o = t;
|
|
1045
1088
|
return {
|
|
1046
1089
|
id: e,
|
|
1047
1090
|
label: r(t.label, e),
|
|
1048
1091
|
description: t.description === void 0 ? void 0 : r(t.description),
|
|
1049
|
-
placeholder:
|
|
1092
|
+
placeholder: o.placeholder === void 0 ? void 0 : r(o.placeholder),
|
|
1050
1093
|
type: t.type,
|
|
1051
1094
|
required: t.required === !0,
|
|
1052
1095
|
defaultValue: t.defaultValue,
|
|
1053
|
-
options: t.type === "select" || t.type === "multi-select" ?
|
|
1096
|
+
options: t.type === "select" || t.type === "multi-select" ? n.map((s) => ({
|
|
1054
1097
|
value: s.value,
|
|
1055
1098
|
label: r(s.label, s.value),
|
|
1056
1099
|
icon: s.icon
|
|
1057
1100
|
})) : void 0,
|
|
1058
|
-
multiple: t.type === "files" ?
|
|
1059
|
-
accept: t.type === "files" && typeof
|
|
1101
|
+
multiple: t.type === "files" ? o.multiple !== !1 : void 0,
|
|
1102
|
+
accept: t.type === "files" && typeof o.accept == "string" ? o.accept : void 0
|
|
1060
1103
|
};
|
|
1061
|
-
},
|
|
1062
|
-
const
|
|
1063
|
-
return
|
|
1064
|
-
}),
|
|
1104
|
+
}, or = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([r, n]) => {
|
|
1105
|
+
const o = nr(r, n, t);
|
|
1106
|
+
return o ? [o] : [];
|
|
1107
|
+
}), sr = (e, t) => M({
|
|
1065
1108
|
id: t.id,
|
|
1066
1109
|
kind: "kanbanRenderer",
|
|
1067
1110
|
projectId: e.projectId,
|
|
1068
1111
|
context: {
|
|
1069
1112
|
kanbanRendererId: t.id
|
|
1070
1113
|
}
|
|
1071
|
-
}), F = (e, t, r,
|
|
1072
|
-
params:
|
|
1073
|
-
resource:
|
|
1074
|
-
slot:
|
|
1114
|
+
}), F = (e, t, r, n, o) => k(e, r, {
|
|
1115
|
+
params: n,
|
|
1116
|
+
resource: o ?? e.workbench.getPrimaryResource(),
|
|
1117
|
+
slot: sr(e, t),
|
|
1075
1118
|
metadata: {
|
|
1076
1119
|
kanbanRendererId: t.id
|
|
1077
1120
|
}
|
|
1078
|
-
}),
|
|
1079
|
-
const
|
|
1121
|
+
}), De = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, ir = (e, t, r) => (t.rowActions ?? []).map((n) => {
|
|
1122
|
+
const o = e.workbench.commands.getCommand(n.commandId)?.command;
|
|
1080
1123
|
return e.workbench.commands.registerCommand({
|
|
1081
|
-
id:
|
|
1082
|
-
label: r(
|
|
1083
|
-
icon:
|
|
1084
|
-
params:
|
|
1124
|
+
id: De(t, n),
|
|
1125
|
+
label: r(n.label, n.id),
|
|
1126
|
+
icon: n.icon,
|
|
1127
|
+
params: o?.params
|
|
1085
1128
|
}, {
|
|
1086
|
-
execute: (s,
|
|
1129
|
+
execute: (s, i) => F(e, t, n.commandId, Me(er(s)), i?.resource)
|
|
1087
1130
|
});
|
|
1088
|
-
}),
|
|
1089
|
-
const
|
|
1090
|
-
rowId:
|
|
1091
|
-
}, b =
|
|
1092
|
-
resource:
|
|
1093
|
-
} : void 0,
|
|
1094
|
-
return d &&
|
|
1131
|
+
}), ar = (e, t, r, n, o, s) => {
|
|
1132
|
+
const i = De(t, r), d = e.workbench.commands.getCommand(i), c = {
|
|
1133
|
+
rowId: n.id
|
|
1134
|
+
}, b = o ? {
|
|
1135
|
+
resource: o
|
|
1136
|
+
} : void 0, a = s(r.label, r.id);
|
|
1137
|
+
return d && tr(d.command.params) ? (e.workbench.commandPalette.requestParams({
|
|
1095
1138
|
record: d,
|
|
1096
|
-
label:
|
|
1139
|
+
label: a,
|
|
1097
1140
|
args: c,
|
|
1098
1141
|
context: b
|
|
1099
1142
|
}), Promise.resolve()) : d ? e.workbench.commands.executeCommand(d.command.id, c, b).then(() => {
|
|
1100
|
-
}) : F(e, t, r.commandId, c,
|
|
1143
|
+
}) : F(e, t, r.commandId, c, o).then(() => {
|
|
1101
1144
|
});
|
|
1102
|
-
},
|
|
1145
|
+
}, dr = (e) => (r) => W(j, {
|
|
1103
1146
|
name: e ?? "MoreHorizontal",
|
|
1104
1147
|
...r
|
|
1105
|
-
}),
|
|
1148
|
+
}), cr = (e, t) => ({
|
|
1106
1149
|
color: e?.color,
|
|
1107
1150
|
canDragIn: e?.canDragIn,
|
|
1108
1151
|
canDragOut: e?.canDragOut,
|
|
@@ -1110,17 +1153,17 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
1110
1153
|
actions: e?.actions?.map((r) => ({
|
|
1111
1154
|
id: r.id,
|
|
1112
1155
|
label: t(r.label, r.id),
|
|
1113
|
-
icon:
|
|
1156
|
+
icon: dr(r.icon)
|
|
1114
1157
|
}))
|
|
1115
|
-
}),
|
|
1158
|
+
}), lr = (e) => e ? W(j, {
|
|
1116
1159
|
name: e,
|
|
1117
1160
|
size: 16
|
|
1118
|
-
}) : void 0,
|
|
1161
|
+
}) : void 0, mr = (e, t) => {
|
|
1119
1162
|
if (e.createRow)
|
|
1120
1163
|
return {
|
|
1121
1164
|
title: t(e.createRow.title, "Create row"),
|
|
1122
1165
|
submitLabel: t(e.createRow.submitLabel, "Create"),
|
|
1123
|
-
fields:
|
|
1166
|
+
fields: or(e, t),
|
|
1124
1167
|
labels: {
|
|
1125
1168
|
cancel: t(e.createRow.labels?.cancel, "Cancel"),
|
|
1126
1169
|
properties: t(e.createRow.labels?.properties, "Properties"),
|
|
@@ -1128,161 +1171,166 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
1128
1171
|
removeFile: t(e.createRow.labels?.removeFile, "Remove file")
|
|
1129
1172
|
}
|
|
1130
1173
|
};
|
|
1131
|
-
},
|
|
1174
|
+
}, ur = (e, t, r) => {
|
|
1132
1175
|
if (t.onRowClick)
|
|
1133
|
-
return (
|
|
1176
|
+
return (n) => t.onRowClick?.({
|
|
1134
1177
|
record: e,
|
|
1135
|
-
row:
|
|
1136
|
-
resource: r(e,
|
|
1178
|
+
row: n,
|
|
1179
|
+
resource: r(e, n)
|
|
1137
1180
|
});
|
|
1138
|
-
},
|
|
1139
|
-
const
|
|
1140
|
-
if (
|
|
1141
|
-
return async (
|
|
1142
|
-
const s =
|
|
1143
|
-
[
|
|
1144
|
-
} : void 0,
|
|
1145
|
-
[
|
|
1146
|
-
} : void 0),
|
|
1181
|
+
}, br = (e, t, r) => {
|
|
1182
|
+
const n = e.createRow;
|
|
1183
|
+
if (n)
|
|
1184
|
+
return async (o) => {
|
|
1185
|
+
const s = Me(o.values, n.columnParam ? {
|
|
1186
|
+
[n.columnParam]: o.columnId
|
|
1187
|
+
} : void 0, n.attributesParam ? {
|
|
1188
|
+
[n.attributesParam]: o.attributeValues
|
|
1189
|
+
} : void 0), i = await r(e, n.commandId, s);
|
|
1147
1190
|
await t.onAfterCreate?.({
|
|
1148
1191
|
record: e,
|
|
1149
|
-
created:
|
|
1150
|
-
submission:
|
|
1192
|
+
created: i,
|
|
1193
|
+
submission: o
|
|
1151
1194
|
});
|
|
1152
1195
|
};
|
|
1153
|
-
},
|
|
1196
|
+
}, fr = (e, t, r, n, o) => {
|
|
1154
1197
|
const s = t.rowActions;
|
|
1155
1198
|
if (s?.length)
|
|
1156
|
-
return (
|
|
1157
|
-
const c =
|
|
1199
|
+
return (i) => s.map((d) => {
|
|
1200
|
+
const c = o(t, i), b = () => ar(e, t, d, i, c, n);
|
|
1158
1201
|
return {
|
|
1159
1202
|
key: d.id,
|
|
1160
|
-
label:
|
|
1203
|
+
label: n(d.label, d.id),
|
|
1161
1204
|
commandId: d.commandId,
|
|
1162
|
-
icon:
|
|
1205
|
+
icon: lr(d.icon),
|
|
1163
1206
|
onClick: () => r.executeRowAction ? r.executeRowAction({
|
|
1164
1207
|
record: t,
|
|
1165
1208
|
action: d,
|
|
1166
|
-
row:
|
|
1209
|
+
row: i,
|
|
1167
1210
|
resource: c,
|
|
1168
1211
|
runDefault: b
|
|
1169
1212
|
}) : b()
|
|
1170
1213
|
};
|
|
1171
1214
|
});
|
|
1172
|
-
},
|
|
1173
|
-
const
|
|
1174
|
-
}), b = (
|
|
1175
|
-
for (const
|
|
1176
|
-
const l =
|
|
1177
|
-
let
|
|
1178
|
-
const f = (p) => a
|
|
1179
|
-
|
|
1180
|
-
id:
|
|
1181
|
-
title:
|
|
1182
|
-
resourceKind:
|
|
1215
|
+
}, pr = (e, t, r = {}) => {
|
|
1216
|
+
const n = [], o = r.resolveLabel ?? ((a, l) => u(a, l)), s = r.decorateAttribute ?? ((a, l) => l), i = r.resolveRowResource ?? Ke, d = r.resolveRowActionResource ?? Zt, c = r.onAfterMutation ?? (() => {
|
|
1217
|
+
}), b = (a, l, m) => F(e, a, l, m).then((f) => (c(a), f));
|
|
1218
|
+
for (const a of t) {
|
|
1219
|
+
const l = Gt(a, a.attributes, o, s);
|
|
1220
|
+
let m;
|
|
1221
|
+
const f = (p) => i(a, p);
|
|
1222
|
+
n.push(...ir(e, a, o)), n.push(e.workbench.renderers.registerKanbanRenderer({
|
|
1223
|
+
id: a.id,
|
|
1224
|
+
title: o(a.title, a.id),
|
|
1225
|
+
resourceKind: a.resourceKind,
|
|
1183
1226
|
attributes: l.source,
|
|
1184
|
-
defaultSettings:
|
|
1185
|
-
defaultFilters:
|
|
1186
|
-
defaultViews:
|
|
1227
|
+
defaultSettings: a.defaultSettings,
|
|
1228
|
+
defaultFilters: a.defaultFilters,
|
|
1229
|
+
defaultViews: a.defaultViews?.map((p) => ({
|
|
1187
1230
|
...p,
|
|
1188
|
-
title:
|
|
1231
|
+
title: o(p.title, p.id)
|
|
1189
1232
|
})),
|
|
1190
|
-
defaultActiveViewId:
|
|
1191
|
-
emptyTitle:
|
|
1192
|
-
emptyDescription:
|
|
1193
|
-
hideToolbar:
|
|
1194
|
-
createRow:
|
|
1195
|
-
getBoardColumnConfig: (p) =>
|
|
1196
|
-
onRowClick:
|
|
1233
|
+
defaultActiveViewId: a.defaultActiveViewId,
|
|
1234
|
+
emptyTitle: o(a.emptyTitle, ""),
|
|
1235
|
+
emptyDescription: o(a.emptyDescription, ""),
|
|
1236
|
+
hideToolbar: a.hideToolbar,
|
|
1237
|
+
createRow: mr(a, o),
|
|
1238
|
+
getBoardColumnConfig: (p) => cr(m?.[p], o),
|
|
1239
|
+
onRowClick: ur(a, r, i),
|
|
1197
1240
|
executeQuery: async (p) => {
|
|
1198
|
-
const
|
|
1241
|
+
const w = await F(e, a, a.queryCommandId, {
|
|
1199
1242
|
settings: p.settings,
|
|
1200
1243
|
filters: p.filters
|
|
1201
1244
|
});
|
|
1202
|
-
return Array.isArray(
|
|
1245
|
+
return Array.isArray(w) ? w.map((v) => ye(v, f)) : Qt(w) ? (l.set(w.attributes), m = w.boardColumnConfigs, (w.rows ?? []).map((v) => ye(v, f))) : [];
|
|
1203
1246
|
},
|
|
1204
|
-
onAttributeChange:
|
|
1247
|
+
onAttributeChange: a.updateAttributeCommandId ? (p, w, v) => b(a, a.updateAttributeCommandId, {
|
|
1205
1248
|
rowId: p,
|
|
1206
|
-
attributeId:
|
|
1249
|
+
attributeId: w,
|
|
1207
1250
|
value: v
|
|
1208
1251
|
}).then(() => {
|
|
1209
1252
|
}) : void 0,
|
|
1210
|
-
onReorder:
|
|
1253
|
+
onReorder: a.reorderCommandId ? (p, w) => b(a, a.reorderCommandId, {
|
|
1211
1254
|
rowId: p,
|
|
1212
|
-
beforeRowId:
|
|
1255
|
+
beforeRowId: w
|
|
1213
1256
|
}).then(() => {
|
|
1214
1257
|
}) : void 0,
|
|
1215
|
-
onCreateRow:
|
|
1216
|
-
onColumnAction:
|
|
1217
|
-
await b(
|
|
1258
|
+
onCreateRow: br(a, r, b),
|
|
1259
|
+
onColumnAction: a.columnActionCommandId ? async (p, w) => {
|
|
1260
|
+
await b(a, a.columnActionCommandId, {
|
|
1218
1261
|
columnId: p,
|
|
1219
|
-
actionId:
|
|
1262
|
+
actionId: w
|
|
1220
1263
|
});
|
|
1221
1264
|
} : void 0,
|
|
1222
|
-
getRowContextMenuActions:
|
|
1223
|
-
})),
|
|
1265
|
+
getRowContextMenuActions: fr(e, a, r, o, d)
|
|
1266
|
+
})), n.push(e.workbench.layout.registerPanel({
|
|
1224
1267
|
closable: !1,
|
|
1225
|
-
id:
|
|
1226
|
-
title:
|
|
1268
|
+
id: a.id,
|
|
1269
|
+
title: o(a.title, a.id),
|
|
1227
1270
|
region: "main",
|
|
1228
|
-
rendererId:
|
|
1271
|
+
rendererId: a.id,
|
|
1229
1272
|
singleton: !0,
|
|
1230
|
-
resourceKinds:
|
|
1273
|
+
resourceKinds: a.resourceKind ? [a.resourceKind] : void 0
|
|
1231
1274
|
}));
|
|
1232
1275
|
}
|
|
1233
1276
|
return {
|
|
1234
1277
|
dispose() {
|
|
1235
|
-
for (let
|
|
1278
|
+
for (let a = n.length - 1; a >= 0; a -= 1) n[a]?.dispose();
|
|
1236
1279
|
}
|
|
1237
1280
|
};
|
|
1238
|
-
},
|
|
1281
|
+
}, hr = (e, t) => {
|
|
1239
1282
|
if (e)
|
|
1240
|
-
return Object.fromEntries(Object.entries(e).map(([r,
|
|
1241
|
-
...
|
|
1242
|
-
label:
|
|
1243
|
-
description:
|
|
1283
|
+
return Object.fromEntries(Object.entries(e).map(([r, n]) => [r, {
|
|
1284
|
+
...n,
|
|
1285
|
+
label: n.label === void 0 ? void 0 : t(n.label, r),
|
|
1286
|
+
description: n.description === void 0 ? void 0 : t(n.description)
|
|
1244
1287
|
}]));
|
|
1245
|
-
},
|
|
1288
|
+
}, wr = (e, t) => e.panels.flatMap((r) => [r, ...r.panelMenus ?? []]).filter((r) => r.treeRendererId === t.id), $e = (e, t) => t.viewId ? e.find((r) => r.id === t.viewId) : e.length === 1 ? e[0] : void 0, gr = async (e) => {
|
|
1246
1289
|
const {
|
|
1247
1290
|
ctx: t,
|
|
1248
1291
|
getHostTreeHeaderNodes: r,
|
|
1249
|
-
record:
|
|
1250
|
-
treeViews:
|
|
1251
|
-
} = e, s =
|
|
1292
|
+
record: n,
|
|
1293
|
+
treeViews: o
|
|
1294
|
+
} = e, s = $e(o, t);
|
|
1252
1295
|
return !s || !("hostTreeHeader" in s) || s.hostTreeHeader !== "default" ? [] : await r?.({
|
|
1253
1296
|
ctx: t,
|
|
1254
|
-
record:
|
|
1297
|
+
record: n,
|
|
1255
1298
|
panel: s
|
|
1256
1299
|
}) ?? [];
|
|
1257
|
-
},
|
|
1300
|
+
}, Ir = async (e) => {
|
|
1258
1301
|
const {
|
|
1259
1302
|
ctx: t,
|
|
1260
1303
|
getHostTreeFooterNodes: r,
|
|
1261
|
-
record:
|
|
1262
|
-
treeViews:
|
|
1263
|
-
} = e, s =
|
|
1304
|
+
record: n,
|
|
1305
|
+
treeViews: o
|
|
1306
|
+
} = e, s = $e(o, t);
|
|
1264
1307
|
return !s || !("hostTreeFooter" in s) || s.hostTreeFooter !== "default" ? [] : await r?.({
|
|
1265
1308
|
ctx: t,
|
|
1266
|
-
record:
|
|
1309
|
+
record: n,
|
|
1267
1310
|
panel: s
|
|
1268
1311
|
}) ?? [];
|
|
1269
|
-
},
|
|
1312
|
+
}, yr = (e, t, r, n) => {
|
|
1270
1313
|
if (t.treeRendererId)
|
|
1271
|
-
return
|
|
1314
|
+
return H({
|
|
1272
1315
|
workbench: e.workbench,
|
|
1273
1316
|
contribution: {
|
|
1274
1317
|
id: t.id,
|
|
1275
|
-
title:
|
|
1318
|
+
title: u(t.title, t.id),
|
|
1319
|
+
icon: t.icon,
|
|
1276
1320
|
region: t.region,
|
|
1277
1321
|
closable: t.closable,
|
|
1278
1322
|
rendererId: t.treeRendererId,
|
|
1279
1323
|
singleton: !0,
|
|
1280
1324
|
resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
|
|
1281
|
-
eligibleLocations:
|
|
1282
|
-
panelMenus:
|
|
1325
|
+
eligibleLocations: D(t.eligibleLocations),
|
|
1326
|
+
panelMenus: B(t.panelMenus, n),
|
|
1327
|
+
...A({
|
|
1328
|
+
placement: t.placement,
|
|
1329
|
+
declarationIndex: r
|
|
1330
|
+
})
|
|
1283
1331
|
}
|
|
1284
1332
|
});
|
|
1285
|
-
},
|
|
1333
|
+
}, Z = (e) => {
|
|
1286
1334
|
if (e)
|
|
1287
1335
|
return {
|
|
1288
1336
|
type: e.kind,
|
|
@@ -1290,13 +1338,13 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
1290
1338
|
label: e.label,
|
|
1291
1339
|
metadata: e.metadata
|
|
1292
1340
|
};
|
|
1293
|
-
},
|
|
1341
|
+
}, ve = (e) => ({
|
|
1294
1342
|
kind: e.type,
|
|
1295
1343
|
uri: `pstdio://extension-resource/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}`,
|
|
1296
1344
|
id: e.id,
|
|
1297
1345
|
label: e.label,
|
|
1298
1346
|
metadata: e.metadata
|
|
1299
|
-
}),
|
|
1347
|
+
}), Be = (e) => ({
|
|
1300
1348
|
id: e.treeId,
|
|
1301
1349
|
kind: "renderer",
|
|
1302
1350
|
context: {
|
|
@@ -1310,46 +1358,46 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
1310
1358
|
resourceId: e.resource.id
|
|
1311
1359
|
} : {}
|
|
1312
1360
|
}
|
|
1313
|
-
}),
|
|
1314
|
-
const
|
|
1361
|
+
}), X = (e, t, r, n) => {
|
|
1362
|
+
const o = Z(r.resource);
|
|
1315
1363
|
return {
|
|
1316
1364
|
projectId: e.projectId,
|
|
1317
1365
|
modeId: e.workbench.modes.getActiveModeId(),
|
|
1318
|
-
resource:
|
|
1366
|
+
resource: o,
|
|
1319
1367
|
treeId: t.id,
|
|
1320
1368
|
state: e.workbench.renderers.getTreeState(t.id),
|
|
1321
1369
|
...r.filter ? {
|
|
1322
1370
|
filter: r.filter
|
|
1323
1371
|
} : {},
|
|
1324
|
-
...
|
|
1325
|
-
node:
|
|
1372
|
+
...n ? {
|
|
1373
|
+
node: n
|
|
1326
1374
|
} : {}
|
|
1327
1375
|
};
|
|
1328
|
-
},
|
|
1329
|
-
const
|
|
1376
|
+
}, J = async (e, t, r) => {
|
|
1377
|
+
const n = r.resource, o = await e.executeCommand(t, {
|
|
1330
1378
|
projectId: e.projectId,
|
|
1331
1379
|
params: r,
|
|
1332
|
-
resource:
|
|
1333
|
-
slot:
|
|
1380
|
+
resource: n,
|
|
1381
|
+
slot: Be({
|
|
1334
1382
|
modeId: r.modeId,
|
|
1335
1383
|
projectId: e.projectId,
|
|
1336
|
-
resource:
|
|
1384
|
+
resource: n,
|
|
1337
1385
|
treeId: r.treeId
|
|
1338
1386
|
}),
|
|
1339
1387
|
source: "dashboard"
|
|
1340
1388
|
});
|
|
1341
|
-
return
|
|
1342
|
-
},
|
|
1343
|
-
const s = e.workbench.modes.getActiveModeId(),
|
|
1389
|
+
return N(o);
|
|
1390
|
+
}, He = async (e, t, r, n, o) => {
|
|
1391
|
+
const s = e.workbench.modes.getActiveModeId(), i = await e.executeCommand(r, {
|
|
1344
1392
|
projectId: e.projectId,
|
|
1345
|
-
...
|
|
1346
|
-
params:
|
|
1393
|
+
...n ? {
|
|
1394
|
+
params: n
|
|
1347
1395
|
} : {},
|
|
1348
|
-
resource:
|
|
1349
|
-
slot:
|
|
1396
|
+
resource: o,
|
|
1397
|
+
slot: Be({
|
|
1350
1398
|
modeId: s,
|
|
1351
1399
|
projectId: e.projectId,
|
|
1352
|
-
resource:
|
|
1400
|
+
resource: o,
|
|
1353
1401
|
treeId: t.id
|
|
1354
1402
|
}),
|
|
1355
1403
|
source: "dashboard",
|
|
@@ -1357,190 +1405,190 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
1357
1405
|
treeId: t.id
|
|
1358
1406
|
}
|
|
1359
1407
|
});
|
|
1360
|
-
return
|
|
1361
|
-
},
|
|
1362
|
-
const r = /* @__PURE__ */ new WeakMap(),
|
|
1363
|
-
if (
|
|
1408
|
+
return N(i);
|
|
1409
|
+
}, vr = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, kr = (e, t) => {
|
|
1410
|
+
const r = /* @__PURE__ */ new WeakMap(), n = `workbench.extensionTreeRenderer.${t.id}.command`, o = (a) => {
|
|
1411
|
+
if (a.emptyState)
|
|
1364
1412
|
return {
|
|
1365
|
-
title:
|
|
1366
|
-
description:
|
|
1367
|
-
icon:
|
|
1413
|
+
title: u(a.emptyState.title),
|
|
1414
|
+
description: u(a.emptyState.description),
|
|
1415
|
+
icon: a.emptyState.icon
|
|
1368
1416
|
};
|
|
1369
|
-
}, s = (
|
|
1370
|
-
if (
|
|
1371
|
-
if (
|
|
1417
|
+
}, s = (a, l, m) => {
|
|
1418
|
+
if (a) {
|
|
1419
|
+
if (a.kind === "resource" && a.resource)
|
|
1372
1420
|
return {
|
|
1373
1421
|
kind: "resource",
|
|
1374
|
-
resource:
|
|
1422
|
+
resource: ve(a.resource),
|
|
1375
1423
|
input: {
|
|
1376
1424
|
replaceActive: !0
|
|
1377
1425
|
}
|
|
1378
1426
|
};
|
|
1379
|
-
if (
|
|
1427
|
+
if (a.kind === "panel" && a.panelId) return {
|
|
1380
1428
|
kind: "panel",
|
|
1381
|
-
panelId:
|
|
1429
|
+
panelId: a.panelId
|
|
1382
1430
|
};
|
|
1383
|
-
if (!(
|
|
1431
|
+
if (!(a.kind !== "command" || !a.commandId))
|
|
1384
1432
|
return {
|
|
1385
1433
|
kind: "command",
|
|
1386
|
-
commandId:
|
|
1434
|
+
commandId: n,
|
|
1387
1435
|
args: {
|
|
1388
|
-
commandId:
|
|
1436
|
+
commandId: a.commandId,
|
|
1389
1437
|
nodeId: l.id,
|
|
1390
|
-
params:
|
|
1391
|
-
resource: l.resource ??
|
|
1438
|
+
params: a.args,
|
|
1439
|
+
resource: l.resource ?? Z(m.resource),
|
|
1392
1440
|
treeId: t.id
|
|
1393
1441
|
}
|
|
1394
1442
|
};
|
|
1395
1443
|
}
|
|
1396
|
-
},
|
|
1397
|
-
const f =
|
|
1444
|
+
}, i = (a, l, m) => {
|
|
1445
|
+
const f = a.commandId;
|
|
1398
1446
|
return {
|
|
1399
|
-
id:
|
|
1400
|
-
label:
|
|
1401
|
-
icon:
|
|
1402
|
-
args:
|
|
1403
|
-
params:
|
|
1404
|
-
submitLabel:
|
|
1405
|
-
when:
|
|
1406
|
-
disabled:
|
|
1447
|
+
id: a.id,
|
|
1448
|
+
label: u(a.label),
|
|
1449
|
+
icon: a.icon,
|
|
1450
|
+
args: a.args,
|
|
1451
|
+
params: hr(a.params, u),
|
|
1452
|
+
submitLabel: a.submitLabel,
|
|
1453
|
+
when: a.when,
|
|
1454
|
+
disabled: a.disabled,
|
|
1407
1455
|
// Actions mutate tree data (create/delete/...), so refresh afterwards. Plain
|
|
1408
1456
|
// node-target navigation runs through the runner command and must not refetch.
|
|
1409
1457
|
run: f ? async (p) => {
|
|
1410
|
-
await
|
|
1458
|
+
await He(e, t, f, vr(p, a.args), l?.resource ?? Z(m.resource)), e.workbench.renderers.refresh(t.id);
|
|
1411
1459
|
} : void 0
|
|
1412
1460
|
};
|
|
1413
|
-
}, d = (
|
|
1414
|
-
const
|
|
1415
|
-
id:
|
|
1416
|
-
label:
|
|
1417
|
-
icon:
|
|
1418
|
-
iconColor:
|
|
1419
|
-
iconTooltip:
|
|
1420
|
-
resource:
|
|
1421
|
-
target: s(
|
|
1422
|
-
rowVariant:
|
|
1423
|
-
actions:
|
|
1424
|
-
contextMenuActions:
|
|
1425
|
-
collapsible:
|
|
1426
|
-
disabled:
|
|
1427
|
-
children:
|
|
1428
|
-
description:
|
|
1429
|
-
contextValue:
|
|
1430
|
-
hiddenByDefault:
|
|
1431
|
-
canHide:
|
|
1461
|
+
}, d = (a, l) => {
|
|
1462
|
+
const m = {
|
|
1463
|
+
id: a.id,
|
|
1464
|
+
label: u(a.label),
|
|
1465
|
+
icon: a.icon,
|
|
1466
|
+
iconColor: a.iconColor,
|
|
1467
|
+
iconTooltip: a.iconTooltip,
|
|
1468
|
+
resource: a.resource ? ve(a.resource) : void 0,
|
|
1469
|
+
target: s(a.target, a, l),
|
|
1470
|
+
rowVariant: a.rowVariant,
|
|
1471
|
+
actions: a.actions?.map((f) => i(f, a, l)),
|
|
1472
|
+
contextMenuActions: a.contextMenuActions?.map((f) => i(f, a, l)),
|
|
1473
|
+
collapsible: a.collapsible,
|
|
1474
|
+
disabled: a.disabled,
|
|
1475
|
+
children: a.children?.map((f) => d(f, l)),
|
|
1476
|
+
description: a.description,
|
|
1477
|
+
contextValue: a.contextValue,
|
|
1478
|
+
hiddenByDefault: a.hiddenByDefault,
|
|
1479
|
+
canHide: a.canHide
|
|
1432
1480
|
};
|
|
1433
|
-
return r.set(
|
|
1481
|
+
return r.set(m, a), m;
|
|
1434
1482
|
};
|
|
1435
1483
|
return {
|
|
1436
|
-
mapNodes: (
|
|
1437
|
-
mapSections: (
|
|
1438
|
-
id:
|
|
1439
|
-
label: m
|
|
1440
|
-
actions:
|
|
1441
|
-
collapsible:
|
|
1442
|
-
emptyState:
|
|
1443
|
-
nodes:
|
|
1444
|
-
hiddenByDefault:
|
|
1445
|
-
canHide:
|
|
1484
|
+
mapNodes: (a, l) => a.map((m) => d(m, l)),
|
|
1485
|
+
mapSections: (a, l) => a.map((m) => ({
|
|
1486
|
+
id: m.id,
|
|
1487
|
+
label: u(m.label),
|
|
1488
|
+
actions: m.actions?.map((f) => i(f, void 0, l)),
|
|
1489
|
+
collapsible: m.collapsible,
|
|
1490
|
+
emptyState: o(m),
|
|
1491
|
+
nodes: m.nodes.map((f) => d(f, l)),
|
|
1492
|
+
hiddenByDefault: m.hiddenByDefault,
|
|
1493
|
+
canHide: m.canHide
|
|
1446
1494
|
})),
|
|
1447
1495
|
originalNodes: r,
|
|
1448
|
-
runnerCommandId:
|
|
1496
|
+
runnerCommandId: n
|
|
1449
1497
|
};
|
|
1450
|
-
},
|
|
1498
|
+
}, Rr = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "nodes" in t), ke = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "id" in t), Cr = (e) => {
|
|
1451
1499
|
for (const t of e)
|
|
1452
1500
|
for (const r of t.nodes)
|
|
1453
1501
|
if (r.selected) return r.id;
|
|
1454
|
-
},
|
|
1455
|
-
const r =
|
|
1502
|
+
}, Er = (e, t) => {
|
|
1503
|
+
const r = kr(e, t), n = wr(e.metadata, t), o = e.workbench.commands.registerCommand({
|
|
1456
1504
|
id: r.runnerCommandId,
|
|
1457
|
-
label: `${
|
|
1505
|
+
label: `${u(t.title, t.id)} tree command`
|
|
1458
1506
|
}, {
|
|
1459
|
-
execute: async (
|
|
1460
|
-
const d =
|
|
1507
|
+
execute: async (i) => {
|
|
1508
|
+
const d = i;
|
|
1461
1509
|
d.nodeId && e.workbench.renderers.setSelectedNode(t.id, d.nodeId);
|
|
1462
|
-
const c = await
|
|
1510
|
+
const c = await He(e, t, d.commandId, d.params, d.resource);
|
|
1463
1511
|
for (const b of e.workbench.renderers.listFileRenderers())
|
|
1464
1512
|
e.workbench.renderers.refreshFileRenderer(b.id);
|
|
1465
1513
|
return c;
|
|
1466
1514
|
}
|
|
1467
1515
|
}), s = e.workbench.renderers.registerTreeRenderer({
|
|
1468
1516
|
id: t.id,
|
|
1469
|
-
title:
|
|
1517
|
+
title: u(t.title, t.id),
|
|
1470
1518
|
icon: t.icon,
|
|
1471
1519
|
defaultExpandedNodeIds: t.defaultExpandedNodeIds,
|
|
1472
1520
|
defaultExpandedSectionIds: t.defaultExpandedSectionIds,
|
|
1473
|
-
getHeader: (
|
|
1474
|
-
ctx:
|
|
1521
|
+
getHeader: (i) => gr({
|
|
1522
|
+
ctx: i,
|
|
1475
1523
|
getHostTreeHeaderNodes: e.getHostTreeHeaderNodes,
|
|
1476
1524
|
record: t,
|
|
1477
|
-
treeViews:
|
|
1525
|
+
treeViews: n
|
|
1478
1526
|
}),
|
|
1479
|
-
getBody: async (
|
|
1480
|
-
const d = await
|
|
1481
|
-
if (!
|
|
1482
|
-
const c =
|
|
1483
|
-
return c && e.workbench.renderers.setSelectedNode(t.id, c), r.mapSections(d,
|
|
1527
|
+
getBody: async (i) => {
|
|
1528
|
+
const d = await J(e, t.bodyCommandId, X(e, t, i));
|
|
1529
|
+
if (!Rr(d)) return [];
|
|
1530
|
+
const c = Cr(d);
|
|
1531
|
+
return c && e.workbench.renderers.setSelectedNode(t.id, c), r.mapSections(d, i);
|
|
1484
1532
|
},
|
|
1485
|
-
getFooter: async (
|
|
1486
|
-
const d = await
|
|
1487
|
-
ctx:
|
|
1533
|
+
getFooter: async (i) => {
|
|
1534
|
+
const d = await Ir({
|
|
1535
|
+
ctx: i,
|
|
1488
1536
|
getHostTreeFooterNodes: e.getHostTreeFooterNodes,
|
|
1489
1537
|
record: t,
|
|
1490
|
-
treeViews:
|
|
1538
|
+
treeViews: n
|
|
1491
1539
|
});
|
|
1492
1540
|
if (!t.footerCommandId) return d;
|
|
1493
|
-
const c = await
|
|
1494
|
-
return [...
|
|
1541
|
+
const c = await J(e, t.footerCommandId, X(e, t, i));
|
|
1542
|
+
return [...ke(c) ? r.mapNodes(c, i) : [], ...d];
|
|
1495
1543
|
},
|
|
1496
|
-
getChildren: async (
|
|
1497
|
-
if (!t.childrenCommandId) return
|
|
1498
|
-
const c = r.originalNodes.get(
|
|
1499
|
-
return
|
|
1544
|
+
getChildren: async (i, d) => {
|
|
1545
|
+
if (!t.childrenCommandId) return i.children ?? [];
|
|
1546
|
+
const c = r.originalNodes.get(i) ?? i, b = await J(e, t.childrenCommandId, X(e, t, d, c));
|
|
1547
|
+
return ke(b) ? r.mapNodes(b, d) : [];
|
|
1500
1548
|
}
|
|
1501
1549
|
});
|
|
1502
1550
|
return {
|
|
1503
1551
|
dispose() {
|
|
1504
|
-
s.dispose(),
|
|
1552
|
+
s.dispose(), o.dispose();
|
|
1505
1553
|
}
|
|
1506
1554
|
};
|
|
1507
|
-
},
|
|
1555
|
+
}, xr = (e) => {
|
|
1508
1556
|
const t = [];
|
|
1509
|
-
for (const
|
|
1510
|
-
t.push(
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1557
|
+
for (const n of e.metadata.treeRenderers ?? [])
|
|
1558
|
+
t.push(Er(e, n));
|
|
1559
|
+
const r = $(e.metadata.panels);
|
|
1560
|
+
return e.metadata.panels.forEach((n, o) => {
|
|
1561
|
+
const s = yr(e, n, o, r[o]);
|
|
1562
|
+
s && t.push(s);
|
|
1563
|
+
}), {
|
|
1516
1564
|
dispose() {
|
|
1517
|
-
for (let
|
|
1565
|
+
for (let n = t.length - 1; n >= 0; n -= 1) t[n]?.dispose();
|
|
1518
1566
|
}
|
|
1519
1567
|
};
|
|
1520
|
-
},
|
|
1521
|
-
...
|
|
1568
|
+
}, Ar = (e) => (t) => ({
|
|
1569
|
+
...Ae({
|
|
1522
1570
|
workbench: t.workbench,
|
|
1523
1571
|
hostEvents: t.hostEvents
|
|
1524
1572
|
}),
|
|
1525
1573
|
// Extension guests speak the SDK resource shape (`type`); normalize to the
|
|
1526
1574
|
// workbench shape (`kind` + synthesized uri) the resource registry expects,
|
|
1527
1575
|
// mirroring how commands.execute and tree targets normalize their resources.
|
|
1528
|
-
"resource.open": (
|
|
1529
|
-
const
|
|
1530
|
-
if (!
|
|
1531
|
-
return t.workbench.resources.openResource(
|
|
1576
|
+
"resource.open": (n) => {
|
|
1577
|
+
const o = n;
|
|
1578
|
+
if (!o.resource) throw new Error("resource.open requires a resource.");
|
|
1579
|
+
return t.workbench.resources.openResource(U(o.resource), o.input);
|
|
1532
1580
|
},
|
|
1533
|
-
"commands.execute": async (
|
|
1534
|
-
const
|
|
1535
|
-
return e.executeCommand(
|
|
1581
|
+
"commands.execute": async (n) => {
|
|
1582
|
+
const o = n, s = o.resource ?? re(t.placement.resource);
|
|
1583
|
+
return e.executeCommand(o.commandId, {
|
|
1536
1584
|
projectId: e.projectId,
|
|
1537
|
-
...
|
|
1538
|
-
params:
|
|
1585
|
+
...o.params ? {
|
|
1586
|
+
params: o.params
|
|
1539
1587
|
} : {},
|
|
1540
1588
|
...s ? {
|
|
1541
1589
|
resource: s
|
|
1542
1590
|
} : {},
|
|
1543
|
-
slot:
|
|
1591
|
+
slot: M({
|
|
1544
1592
|
id: t.webviewId,
|
|
1545
1593
|
kind: e.slotKind,
|
|
1546
1594
|
projectId: e.projectId,
|
|
@@ -1556,17 +1604,17 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
1556
1604
|
"files.list": e.files.list,
|
|
1557
1605
|
"files.delete": e.files.delete
|
|
1558
1606
|
} : {}
|
|
1559
|
-
}),
|
|
1607
|
+
}), ne = (e, t) => ({
|
|
1560
1608
|
kind: t,
|
|
1561
1609
|
uri: `workbench://extension-route/${encodeURIComponent(e.id)}`,
|
|
1562
1610
|
id: e.id,
|
|
1563
|
-
label:
|
|
1611
|
+
label: u(e.label, e.id),
|
|
1564
1612
|
metadata: {
|
|
1565
1613
|
extensionId: e.extensionId,
|
|
1566
1614
|
extensionRouteId: e.id,
|
|
1567
1615
|
path: e.path
|
|
1568
1616
|
}
|
|
1569
|
-
}),
|
|
1617
|
+
}), Re = (e, t) => e.routes.find((r) => t.id === r.id || t.metadata?.extensionRouteId === r.id), Pr = (e) => {
|
|
1570
1618
|
if (e.metadata.routes.length === 0) return [];
|
|
1571
1619
|
const t = [];
|
|
1572
1620
|
e.workbench.resources.getKind(e.routeResourceKind) || t.push(e.workbench.resources.registerKind({
|
|
@@ -1578,48 +1626,48 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
1578
1626
|
t.push(e.workbench.layout.registerPanel({
|
|
1579
1627
|
closable: !1,
|
|
1580
1628
|
id: r.id,
|
|
1581
|
-
title:
|
|
1629
|
+
title: u(r.label, r.id),
|
|
1582
1630
|
region: "main",
|
|
1583
|
-
rendererId:
|
|
1631
|
+
rendererId: K,
|
|
1584
1632
|
singleton: !0,
|
|
1585
|
-
config:
|
|
1633
|
+
config: _(r.webview)
|
|
1586
1634
|
}));
|
|
1587
1635
|
return t.push(e.workbench.resources.registerProvider({
|
|
1588
1636
|
id: "workbench.extension.routes",
|
|
1589
1637
|
kind: e.routeResourceKind,
|
|
1590
1638
|
list: () => e.metadata.routes.map((r) => ({
|
|
1591
|
-
resource:
|
|
1639
|
+
resource: ne(r, e.routeResourceKind)
|
|
1592
1640
|
}))
|
|
1593
1641
|
}), e.workbench.resources.registerPresenter({
|
|
1594
1642
|
id: "workbench.extension.routes",
|
|
1595
|
-
canOpen: (r) => r.kind === e.routeResourceKind && !!
|
|
1596
|
-
open: (r,
|
|
1597
|
-
const
|
|
1598
|
-
return e.workbench.layout.openPanel(
|
|
1599
|
-
strategy:
|
|
1643
|
+
canOpen: (r) => r.kind === e.routeResourceKind && !!Re(e.metadata, r),
|
|
1644
|
+
open: (r, n) => {
|
|
1645
|
+
const o = Re(e.metadata, r);
|
|
1646
|
+
return e.workbench.layout.openPanel(o.id, {
|
|
1647
|
+
strategy: n.replaceActive ? {
|
|
1600
1648
|
kind: "replace-active"
|
|
1601
1649
|
} : {
|
|
1602
|
-
kind: "
|
|
1650
|
+
kind: "persistent"
|
|
1603
1651
|
},
|
|
1604
|
-
title:
|
|
1652
|
+
title: u(o.label, o.id)
|
|
1605
1653
|
});
|
|
1606
1654
|
}
|
|
1607
1655
|
})), t;
|
|
1608
|
-
},
|
|
1656
|
+
}, Tr = {
|
|
1609
1657
|
"workbench.left.tree": "sidenav",
|
|
1610
1658
|
"workbench.main.left.tree": "main-left-menu",
|
|
1611
1659
|
"workbench.main.right.tree": "main-right-menu"
|
|
1612
|
-
},
|
|
1660
|
+
}, Sr = (e) => e ? Tr[e] ?? "sidenav" : "sidenav", Wr = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, jr = (e, t) => {
|
|
1613
1661
|
if (t.action.kind === "kanbanRenderer") return {
|
|
1614
1662
|
kind: "panel",
|
|
1615
1663
|
panelId: t.action.kanbanRendererId
|
|
1616
1664
|
};
|
|
1617
1665
|
const r = t.action;
|
|
1618
1666
|
if (r.kind === "route") {
|
|
1619
|
-
const
|
|
1620
|
-
return
|
|
1667
|
+
const n = e.metadata.routes.find((o) => o.id === r.route);
|
|
1668
|
+
return n ? {
|
|
1621
1669
|
kind: "resource",
|
|
1622
|
-
resource:
|
|
1670
|
+
resource: ne(n, e.routeResourceKind)
|
|
1623
1671
|
} : void 0;
|
|
1624
1672
|
}
|
|
1625
1673
|
return r.kind === "command" ? {
|
|
@@ -1633,15 +1681,15 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
1633
1681
|
href: r.href
|
|
1634
1682
|
}
|
|
1635
1683
|
};
|
|
1636
|
-
},
|
|
1684
|
+
}, Kr = (e) => {
|
|
1637
1685
|
const t = e.metadata.treeItems ?? [];
|
|
1638
1686
|
if (t.length === 0) return [];
|
|
1639
|
-
const r = [],
|
|
1640
|
-
for (const
|
|
1641
|
-
for (const [
|
|
1642
|
-
const
|
|
1687
|
+
const r = [], n = /* @__PURE__ */ new Map();
|
|
1688
|
+
for (const o of t) n.set(o.target, [...n.get(o.target) ?? [], o]);
|
|
1689
|
+
for (const [o, s] of n) {
|
|
1690
|
+
const i = `workbench.extension.treeItems.${o}`;
|
|
1643
1691
|
r.push(e.workbench.renderers.registerTreeRenderer({
|
|
1644
|
-
id:
|
|
1692
|
+
id: i,
|
|
1645
1693
|
title: "Extensions",
|
|
1646
1694
|
getChildren: (d) => d.children ?? [],
|
|
1647
1695
|
getBody: () => [{
|
|
@@ -1649,286 +1697,310 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
1649
1697
|
label: "Extensions",
|
|
1650
1698
|
nodes: s.map((d) => ({
|
|
1651
1699
|
id: d.id,
|
|
1652
|
-
label:
|
|
1700
|
+
label: u(d.label, d.id),
|
|
1653
1701
|
icon: d.icon,
|
|
1654
|
-
target:
|
|
1702
|
+
target: jr(e, d)
|
|
1655
1703
|
}))
|
|
1656
1704
|
}]
|
|
1657
1705
|
}), e.workbench.layout.registerPanel({
|
|
1658
1706
|
closable: !1,
|
|
1659
|
-
id:
|
|
1707
|
+
id: i,
|
|
1660
1708
|
title: "Extensions",
|
|
1661
|
-
region:
|
|
1662
|
-
rendererId:
|
|
1709
|
+
region: Sr(o),
|
|
1710
|
+
rendererId: i,
|
|
1663
1711
|
singleton: !0
|
|
1664
1712
|
}));
|
|
1665
1713
|
}
|
|
1666
|
-
for (const
|
|
1667
|
-
const s =
|
|
1714
|
+
for (const o of t.filter((s) => s.action.kind === "href")) {
|
|
1715
|
+
const s = o.action;
|
|
1668
1716
|
s.kind === "href" && r.push(e.workbench.commands.registerCommand({
|
|
1669
|
-
id: `workbench.extension.href.${
|
|
1670
|
-
label:
|
|
1717
|
+
id: `workbench.extension.href.${o.id}`,
|
|
1718
|
+
label: u(o.label, o.id)
|
|
1671
1719
|
}, {
|
|
1672
|
-
execute: (
|
|
1720
|
+
execute: (i) => e.openHref?.(Wr(i)?.href ?? s.href)
|
|
1673
1721
|
}));
|
|
1674
1722
|
}
|
|
1675
1723
|
return r;
|
|
1676
|
-
},
|
|
1724
|
+
}, ee = "extension-route", Mr = "extensions", Dr = (e) => {
|
|
1677
1725
|
for (let t = e.length - 1; t >= 0; t -= 1) e[t]?.dispose();
|
|
1678
|
-
},
|
|
1726
|
+
}, oe = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, $r = (e) => e === void 0 ? void 0 : e, Br = (e) => e === "global" ? "user" : "project", Hr = (e, t) => t ? (r) => ({
|
|
1679
1727
|
...e(r),
|
|
1680
1728
|
...t(r)
|
|
1681
|
-
}) : e,
|
|
1682
|
-
const r = e.createWebviewHostCapabilities ??
|
|
1729
|
+
}) : e, Le = (e, t) => {
|
|
1730
|
+
const r = e.createWebviewHostCapabilities ?? Ar({
|
|
1683
1731
|
executeCommand: e.executeCommand,
|
|
1684
1732
|
files: e.webviewFiles,
|
|
1685
1733
|
projectId: e.projectId,
|
|
1686
1734
|
slotKind: t
|
|
1687
1735
|
});
|
|
1688
|
-
return
|
|
1689
|
-
},
|
|
1690
|
-
e.workbench.renderers.getRenderer(
|
|
1691
|
-
createHostCapabilities:
|
|
1736
|
+
return Hr(r, e.createWebviewHostCapabilityOverrides);
|
|
1737
|
+
}, Lr = (e, t) => {
|
|
1738
|
+
e.workbench.renderers.getRenderer(K) || t.push(e.workbench.renderers.registerRenderer(It({
|
|
1739
|
+
createHostCapabilities: Le(e, "panel"),
|
|
1692
1740
|
createProps: e.createWebviewProps,
|
|
1693
1741
|
createTheme: e.createWebviewTheme
|
|
1694
1742
|
})));
|
|
1695
|
-
},
|
|
1743
|
+
}, Or = (e, t) => t.commands.map((r) => e.workbench.commands.registerCommand({
|
|
1696
1744
|
id: r.id,
|
|
1697
|
-
label:
|
|
1698
|
-
description:
|
|
1745
|
+
label: u(r.title, r.id),
|
|
1746
|
+
description: u(r.description),
|
|
1699
1747
|
params: r.params
|
|
1700
1748
|
}, {
|
|
1701
|
-
execute: (
|
|
1702
|
-
params:
|
|
1703
|
-
resource:
|
|
1749
|
+
execute: (n, o) => k(e, r.id, {
|
|
1750
|
+
params: oe(n),
|
|
1751
|
+
resource: o?.resource
|
|
1704
1752
|
})
|
|
1705
|
-
})),
|
|
1753
|
+
})), Oe = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), Vr = (e, t) => e.menuSlotsById ? Vt({
|
|
1706
1754
|
metadata: e.metadata,
|
|
1707
1755
|
menuSlotsById: e.menuSlotsById,
|
|
1708
1756
|
menuTargetsById: e.menuTargetsById,
|
|
1709
1757
|
createWhenExpression: e.createMenuWhenExpression
|
|
1710
|
-
}).flatMap((
|
|
1711
|
-
execute: (
|
|
1758
|
+
}).flatMap((n) => [e.workbench.commands.registerCommand(n.command, {
|
|
1759
|
+
execute: (o, s) => k(t, n.targetCommandId, {
|
|
1712
1760
|
params: {
|
|
1713
|
-
...
|
|
1714
|
-
...
|
|
1761
|
+
...n.contribution.params ?? {},
|
|
1762
|
+
...oe(o) ?? {}
|
|
1715
1763
|
},
|
|
1716
|
-
resource:
|
|
1717
|
-
slot:
|
|
1718
|
-
id:
|
|
1764
|
+
resource: Oe(e, s),
|
|
1765
|
+
slot: M({
|
|
1766
|
+
id: n.contribution.slotId,
|
|
1719
1767
|
kind: "menu",
|
|
1720
1768
|
projectId: e.projectId,
|
|
1721
1769
|
context: {
|
|
1722
|
-
panelId:
|
|
1770
|
+
panelId: n.contribution.id
|
|
1723
1771
|
}
|
|
1724
1772
|
})
|
|
1725
1773
|
})
|
|
1726
|
-
}), e.workbench.layout.registerMenuItem(
|
|
1774
|
+
}), e.workbench.layout.registerMenuItem(n.menuPath, n.menuItem)]) : [], Fr = (e, t) => Ft({
|
|
1727
1775
|
metadata: e.metadata
|
|
1728
|
-
}).flatMap((
|
|
1729
|
-
execute: (
|
|
1776
|
+
}).flatMap((n) => [e.workbench.commands.registerCommand(n.command, {
|
|
1777
|
+
execute: (o, s) => k(t, n.targetCommandId, {
|
|
1730
1778
|
params: {
|
|
1731
|
-
...
|
|
1732
|
-
...
|
|
1779
|
+
...n.contribution.params ?? {},
|
|
1780
|
+
...oe(o) ?? {}
|
|
1733
1781
|
},
|
|
1734
|
-
resource:
|
|
1735
|
-
slot:
|
|
1782
|
+
resource: Oe(e, s),
|
|
1783
|
+
slot: M({
|
|
1736
1784
|
id: "workbench.commandPalette",
|
|
1737
1785
|
kind: "menu",
|
|
1738
1786
|
projectId: e.projectId,
|
|
1739
1787
|
context: {
|
|
1740
|
-
panelId:
|
|
1788
|
+
panelId: n.contribution.id
|
|
1741
1789
|
}
|
|
1742
1790
|
})
|
|
1743
1791
|
}),
|
|
1744
|
-
isVisible: () =>
|
|
1745
|
-
}), e.workbench.layout.registerMenuItem(
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
...
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1792
|
+
isVisible: () => ze(n.contribution.when, e.workbench.getPrimaryResource()?.kind)
|
|
1793
|
+
}), e.workbench.layout.registerMenuItem(Qe, n.menuItem)]), Nr = (e) => {
|
|
1794
|
+
const t = $(e.metadata.panels);
|
|
1795
|
+
return e.metadata.panels.flatMap((r, n) => r.webview ? [H({
|
|
1796
|
+
workbench: e.workbench,
|
|
1797
|
+
contribution: {
|
|
1798
|
+
id: r.id,
|
|
1799
|
+
title: u(r.title, r.id),
|
|
1800
|
+
region: r.region,
|
|
1801
|
+
closable: r.closable,
|
|
1802
|
+
rendererId: K,
|
|
1803
|
+
singleton: !0,
|
|
1804
|
+
resourceKinds: r.resourceKind ? [r.resourceKind] : void 0,
|
|
1805
|
+
eligibleLocations: D(r.eligibleLocations),
|
|
1806
|
+
panelMenus: B(r.panelMenus, t[n]),
|
|
1807
|
+
...A({
|
|
1808
|
+
placement: r.placement,
|
|
1809
|
+
declarationIndex: n
|
|
1810
|
+
}),
|
|
1811
|
+
config: {
|
|
1812
|
+
..._(r.webview),
|
|
1813
|
+
...r.region === "overlay" ? {
|
|
1814
|
+
size: "lg",
|
|
1815
|
+
scrollBehavior: "inside",
|
|
1816
|
+
contentHeight: "min(560px, calc(100dvh - 48px))"
|
|
1817
|
+
} : {}
|
|
1818
|
+
}
|
|
1764
1819
|
}
|
|
1765
|
-
}
|
|
1766
|
-
}
|
|
1767
|
-
const t = [], r = e.settingsSectionId ??
|
|
1820
|
+
})] : []);
|
|
1821
|
+
}, Ur = (e) => {
|
|
1822
|
+
const t = [], r = e.settingsSectionId ?? Mr;
|
|
1768
1823
|
e.workbench.settings.getSection(r) || t.push(e.workbench.settings.registerSection({
|
|
1769
1824
|
id: r,
|
|
1770
1825
|
title: e.settingsSectionTitle ?? "Extensions"
|
|
1771
1826
|
}));
|
|
1772
|
-
const
|
|
1773
|
-
type:
|
|
1774
|
-
scope:
|
|
1775
|
-
default:
|
|
1776
|
-
enum:
|
|
1777
|
-
description:
|
|
1827
|
+
const n = Object.fromEntries((e.metadata.settingsDefinitions ?? []).map((o) => [o.key, {
|
|
1828
|
+
type: o.type,
|
|
1829
|
+
scope: Br(o.scope),
|
|
1830
|
+
default: $r(o.default),
|
|
1831
|
+
enum: o.enum,
|
|
1832
|
+
description: u(o.description)
|
|
1778
1833
|
}]));
|
|
1779
|
-
Object.keys(
|
|
1780
|
-
properties:
|
|
1834
|
+
Object.keys(n).length > 0 && t.push(e.workbench.preferences.registerSchema({
|
|
1835
|
+
properties: n
|
|
1781
1836
|
}));
|
|
1782
|
-
for (const
|
|
1837
|
+
for (const o of e.metadata.settingsPanels)
|
|
1783
1838
|
t.push(e.workbench.settings.registerPanel({
|
|
1784
|
-
id:
|
|
1785
|
-
title:
|
|
1839
|
+
id: o.id,
|
|
1840
|
+
title: u(o.title, o.id),
|
|
1786
1841
|
kind: "custom",
|
|
1787
1842
|
section: r,
|
|
1788
|
-
scope:
|
|
1789
|
-
render: (s) =>
|
|
1843
|
+
scope: o.scope,
|
|
1844
|
+
render: (s) => Se({
|
|
1790
1845
|
context: {
|
|
1791
1846
|
workbench: s.workbench,
|
|
1792
|
-
webviewId:
|
|
1847
|
+
webviewId: o.id,
|
|
1793
1848
|
placement: {
|
|
1794
1849
|
...s.instance,
|
|
1795
|
-
panelId:
|
|
1850
|
+
panelId: o.id
|
|
1796
1851
|
},
|
|
1797
|
-
hostEvents:
|
|
1852
|
+
hostEvents: Te(s.workbench, s.instance)
|
|
1798
1853
|
},
|
|
1799
|
-
createHostCapabilities:
|
|
1854
|
+
createHostCapabilities: Le(e, "settings"),
|
|
1800
1855
|
createProps: e.createWebviewProps ?? (({
|
|
1801
|
-
placement:
|
|
1856
|
+
placement: i
|
|
1802
1857
|
}) => ({
|
|
1803
|
-
placement:
|
|
1804
|
-
resource:
|
|
1858
|
+
placement: i,
|
|
1859
|
+
resource: i.resource
|
|
1805
1860
|
})),
|
|
1806
1861
|
createTheme: e.createWebviewTheme,
|
|
1807
|
-
ownerId:
|
|
1808
|
-
title:
|
|
1809
|
-
webview:
|
|
1862
|
+
ownerId: o.extensionId,
|
|
1863
|
+
title: u(o.title, o.id),
|
|
1864
|
+
webview: _(o.webview)
|
|
1810
1865
|
})
|
|
1811
1866
|
}));
|
|
1812
1867
|
return t;
|
|
1813
|
-
},
|
|
1868
|
+
}, _r = (e) => {
|
|
1814
1869
|
const t = /* @__PURE__ */ new Set();
|
|
1815
|
-
for (const
|
|
1816
|
-
for (const
|
|
1870
|
+
for (const n of e.metadata.panels) n.resourceKind && t.add(n.resourceKind);
|
|
1871
|
+
for (const n of e.metadata.kanbanRenderers ?? []) n.resourceKind && t.add(n.resourceKind);
|
|
1817
1872
|
const r = [];
|
|
1818
|
-
for (const
|
|
1819
|
-
e.workbench.resources.getKind(
|
|
1820
|
-
kind:
|
|
1821
|
-
label:
|
|
1873
|
+
for (const n of t) {
|
|
1874
|
+
e.workbench.resources.getKind(n) || r.push(e.workbench.resources.registerKind({
|
|
1875
|
+
kind: n,
|
|
1876
|
+
label: n,
|
|
1822
1877
|
icon: "FileText",
|
|
1823
1878
|
surface: "primary"
|
|
1824
1879
|
}));
|
|
1825
|
-
const
|
|
1826
|
-
|
|
1827
|
-
id: `workbench.extension.resource.${
|
|
1828
|
-
canOpen: (s) => s.kind ===
|
|
1880
|
+
const o = e.metadata.panels.filter((s) => s.resourceKind === n && s.region !== "overlay");
|
|
1881
|
+
o.length > 0 && r.push(e.workbench.resources.registerPresenter({
|
|
1882
|
+
id: `workbench.extension.resource.${n}`,
|
|
1883
|
+
canOpen: (s) => s.kind === n,
|
|
1829
1884
|
open: (s) => {
|
|
1830
|
-
const
|
|
1885
|
+
const i = o.map((d) => e.workbench.layout.openPanel(d.id, {
|
|
1831
1886
|
resource: s,
|
|
1832
|
-
title: s.label ?? s.id ?? s.uri
|
|
1887
|
+
title: s.label ?? s.id ?? s.uri,
|
|
1888
|
+
strategy: {
|
|
1889
|
+
kind: "persistent"
|
|
1890
|
+
}
|
|
1833
1891
|
}));
|
|
1834
|
-
return
|
|
1892
|
+
return i.find((d, c) => o[c]?.region === "main") ?? i[0];
|
|
1835
1893
|
}
|
|
1836
1894
|
}));
|
|
1837
1895
|
}
|
|
1838
1896
|
return r;
|
|
1839
|
-
},
|
|
1840
|
-
|
|
1897
|
+
}, qr = (e, t) => {
|
|
1898
|
+
if (!t.panel) return;
|
|
1899
|
+
e.layout.openPanel(t.panel, {
|
|
1841
1900
|
region: t.region,
|
|
1842
1901
|
pinned: t.pinned,
|
|
1843
|
-
title:
|
|
1844
|
-
|
|
1845
|
-
|
|
1902
|
+
title: u(t.title),
|
|
1903
|
+
strategy: {
|
|
1904
|
+
kind: "persistent"
|
|
1905
|
+
}
|
|
1906
|
+
}), (t.region ?? e.layout.getPanel(t.panel)?.region) === "side" && e.shell.setSidePanelPresentation("attached");
|
|
1907
|
+
}, zr = (e, t, r) => {
|
|
1846
1908
|
if (!r.resource) return;
|
|
1847
|
-
const
|
|
1848
|
-
|
|
1849
|
-
},
|
|
1850
|
-
for (const
|
|
1851
|
-
|
|
1852
|
-
},
|
|
1909
|
+
const n = e.metadata.routes.find((o) => o.id === r.resource || o.path === r.resource);
|
|
1910
|
+
n && t.resources.openResource(ne(n, e.routeResourceKind ?? ee));
|
|
1911
|
+
}, Qr = (e, t, r) => {
|
|
1912
|
+
for (const n of r.layout?.open ?? [])
|
|
1913
|
+
qr(t, n), zr(e, t, n);
|
|
1914
|
+
}, Gr = (e) => e.metadata.modes.map((t) => e.workbench.modes.registerMode({
|
|
1853
1915
|
id: t.modeId,
|
|
1854
|
-
label:
|
|
1916
|
+
label: u(t.label, t.modeId),
|
|
1855
1917
|
panels: t.layout?.panels,
|
|
1856
1918
|
activate: () => {
|
|
1857
1919
|
},
|
|
1858
1920
|
seed: (r) => {
|
|
1859
|
-
|
|
1921
|
+
Qr(e, r, t);
|
|
1860
1922
|
}
|
|
1861
|
-
})),
|
|
1923
|
+
})), pn = (e) => {
|
|
1862
1924
|
const t = [], r = e;
|
|
1863
|
-
return
|
|
1925
|
+
return Lr(e, t), t.push(...Or(r, e.metadata)), t.push(...Vr(e, r)), t.push(...Fr(e, r)), t.push(xr(e)), t.push(zt(e)), t.push(...Nr(e)), t.push(pr(r, e.metadata.kanbanRenderers ?? [])), t.push(Dt(r, e.metadata.dataTableRenderers ?? [], e.metadata.panels)), t.push(Et(r, e.metadata.commandPaletteResources ?? [])), t.push(...Ur(e)), t.push(...Pr({
|
|
1864
1926
|
metadata: e.metadata,
|
|
1865
|
-
routeResourceKind: e.routeResourceKind ??
|
|
1927
|
+
routeResourceKind: e.routeResourceKind ?? ee,
|
|
1866
1928
|
workbench: e.workbench
|
|
1867
|
-
})), t.push(...
|
|
1929
|
+
})), t.push(...Kr({
|
|
1868
1930
|
metadata: e.metadata,
|
|
1869
1931
|
openHref: e.openHref,
|
|
1870
|
-
routeResourceKind: e.routeResourceKind ??
|
|
1932
|
+
routeResourceKind: e.routeResourceKind ?? ee,
|
|
1871
1933
|
workbench: e.workbench
|
|
1872
|
-
})), t.push(...
|
|
1934
|
+
})), t.push(..._r(e)), t.push(...Gr(e)), {
|
|
1873
1935
|
dispose() {
|
|
1874
|
-
|
|
1936
|
+
Dr(t);
|
|
1875
1937
|
}
|
|
1876
1938
|
};
|
|
1877
|
-
},
|
|
1939
|
+
}, Yr = (e) => new Set((e.treeRenderers ?? []).flatMap((t) => [t.bodyCommandId, t.childrenCommandId, t.footerCommandId].filter((r) => r))), Xr = (e) => new Set((e.kanbanRenderers ?? []).map((t) => t.queryCommandId)), Jr = (e) => new Set((e.dataTableRenderers ?? []).map((t) => t.queryCommandId)), Ce = (e, t) => e.layout.listPanelInstances().find((r) => r.panelId === t), Zr = (e, t) => {
|
|
1878
1940
|
if (t)
|
|
1879
1941
|
try {
|
|
1880
1942
|
e.layout.activatePanel(t);
|
|
1881
1943
|
} catch {
|
|
1882
1944
|
}
|
|
1883
|
-
},
|
|
1945
|
+
}, en = (e, t) => !Yr(e).has(t), tn = (e, t) => !Xr(e).has(t), rn = (e, t) => !Jr(e).has(t), nn = (e, t) => {
|
|
1884
1946
|
const r = e.layout.getLayout().activeWidgetId;
|
|
1885
|
-
for (const
|
|
1886
|
-
if (!
|
|
1887
|
-
const
|
|
1888
|
-
|
|
1889
|
-
resource:
|
|
1890
|
-
title:
|
|
1947
|
+
for (const n of t.panels) {
|
|
1948
|
+
if (!n.webview || n.region === "overlay") continue;
|
|
1949
|
+
const o = Ce(e, n.id);
|
|
1950
|
+
o && e.layout.openPanel(n.id, {
|
|
1951
|
+
resource: o.resource,
|
|
1952
|
+
title: u(n.title, o.title),
|
|
1953
|
+
strategy: {
|
|
1954
|
+
kind: "replace-panel",
|
|
1955
|
+
instanceId: o.instanceId
|
|
1956
|
+
}
|
|
1891
1957
|
});
|
|
1892
1958
|
}
|
|
1893
|
-
for (const
|
|
1894
|
-
if (!
|
|
1895
|
-
const
|
|
1896
|
-
|
|
1897
|
-
resource:
|
|
1898
|
-
title:
|
|
1959
|
+
for (const n of t.routes) {
|
|
1960
|
+
if (!n.webview) continue;
|
|
1961
|
+
const o = Ce(e, n.id);
|
|
1962
|
+
o && e.layout.openPanel(n.id, {
|
|
1963
|
+
resource: o.resource,
|
|
1964
|
+
title: u(n.label, o.title),
|
|
1965
|
+
strategy: {
|
|
1966
|
+
kind: "replace-panel",
|
|
1967
|
+
instanceId: o.instanceId
|
|
1968
|
+
}
|
|
1899
1969
|
});
|
|
1900
1970
|
}
|
|
1901
|
-
|
|
1902
|
-
},
|
|
1903
|
-
if (
|
|
1904
|
-
for (const
|
|
1905
|
-
if (
|
|
1906
|
-
for (const
|
|
1907
|
-
if (
|
|
1908
|
-
for (const
|
|
1909
|
-
e.renderers.refreshDataTableRenderer(
|
|
1971
|
+
Zr(e, r);
|
|
1972
|
+
}, hn = (e, t, r) => {
|
|
1973
|
+
if (nn(e, t), en(t, r))
|
|
1974
|
+
for (const n of t.treeRenderers ?? []) e.renderers.refresh(n.id);
|
|
1975
|
+
if (tn(t, r))
|
|
1976
|
+
for (const n of t.kanbanRenderers ?? []) e.renderers.refreshKanbanRenderer(n.id);
|
|
1977
|
+
if (rn(t, r))
|
|
1978
|
+
for (const n of t.dataTableRenderers ?? [])
|
|
1979
|
+
e.renderers.refreshDataTableRenderer(n.id);
|
|
1910
1980
|
};
|
|
1911
1981
|
export {
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1982
|
+
K as BRIDGE_WEBVIEW_RENDERER_ID,
|
|
1983
|
+
Ft as buildWorkbenchExtensionCommandPaletteRegistrations,
|
|
1984
|
+
Vt as buildWorkbenchExtensionMenuRegistrations,
|
|
1985
|
+
fn as buildWorkbenchExtensionRouteEntries,
|
|
1986
|
+
It as createBridgeWebviewRenderer,
|
|
1987
|
+
ut as createTerminalSessionCapability,
|
|
1988
|
+
Ae as createWorkbenchWebviewHostCapabilities,
|
|
1989
|
+
bn as emptyWorkbenchExtensionMetadata,
|
|
1990
|
+
$ as panelMenuDeclarationOffsets,
|
|
1991
|
+
nn as refreshOpenWorkbenchExtensionWebviews,
|
|
1992
|
+
hn as refreshWorkbenchExtensionContributions,
|
|
1993
|
+
Et as registerWorkbenchExtensionCommandPaletteResources,
|
|
1994
|
+
pn as registerWorkbenchExtensionContributions,
|
|
1995
|
+
un as registerWorkbenchExtensionControlsRenderers,
|
|
1996
|
+
Dt as registerWorkbenchExtensionDataTableRenderers,
|
|
1997
|
+
zt as registerWorkbenchExtensionFileRenderers,
|
|
1998
|
+
pr as registerWorkbenchExtensionKanbanRenderers,
|
|
1999
|
+
H as registerWorkbenchExtensionPanel,
|
|
2000
|
+
xr as registerWorkbenchExtensionTreeRenderers,
|
|
2001
|
+
Se as renderBridgeWebviewFrame,
|
|
2002
|
+
rn as shouldRefreshWorkbenchExtensionDataTableRenderers,
|
|
2003
|
+
en as shouldRefreshWorkbenchExtensionTrees,
|
|
2004
|
+
A as toWorkbenchExtensionPlacementMetadata
|
|
1933
2005
|
};
|
|
1934
2006
|
//# sourceMappingURL=extensions.js.map
|