@pstdio/workbench 0.3.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 +30 -1
- package/dist/extensions.js +923 -837
- package/dist/extensions.js.map +1 -1
- package/dist/index.d.ts +29 -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 +26 -3
- package/dist/react.js +2592 -2605
- 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 +15 -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(
|
|
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(
|
|
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
|
|
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 C = g.remote;
|
|
189
|
-
l.current = C, te.current?.bind((De) => C.hostEvent?.(De)), await C.init({
|
|
190
|
-
moduleUrl: B,
|
|
191
|
-
styles: x,
|
|
192
|
-
props: p.current,
|
|
193
|
-
theme: _(h.current),
|
|
194
|
-
themeVariables: U()
|
|
195
|
-
}), u.current = !0, $(null), oe.current?.();
|
|
196
|
-
}).catch((g) => {
|
|
197
|
-
const C = Je(g);
|
|
198
|
-
$(C.message), M.current?.(C);
|
|
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
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
theme:
|
|
221
|
-
variables:
|
|
224
|
+
let h = null;
|
|
225
|
+
const C = () => {
|
|
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
|
-
},
|
|
713
|
+
}, R = (e, t = "") => u(e, t), we = (e) => ({
|
|
681
714
|
...e,
|
|
682
|
-
label:
|
|
683
|
-
description: e.description ?
|
|
684
|
-
icon: e.icon ?
|
|
715
|
+
label: R(e.label, e.id),
|
|
716
|
+
description: e.description ? R(e.description) : void 0,
|
|
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
|
|
@@ -707,81 +740,100 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
707
740
|
});
|
|
708
741
|
return e.workbench.renderers.registerDataTableRenderer({
|
|
709
742
|
id: t.id,
|
|
710
|
-
title:
|
|
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
|
-
|
|
716
|
-
|
|
748
|
+
selectionMode: t.selectionMode,
|
|
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,
|
|
754
|
+
size: 16
|
|
755
|
+
}) : void 0,
|
|
756
|
+
destructive: o.destructive,
|
|
757
|
+
run: (s) => n(o.commandId, {
|
|
758
|
+
rowIds: s.map((i) => i.id)
|
|
759
|
+
}).then(() => {
|
|
760
|
+
})
|
|
761
|
+
})),
|
|
762
|
+
emptyTitle: t.emptyTitle ? R(t.emptyTitle) : void 0,
|
|
763
|
+
emptyDescription: t.emptyDescription ? R(t.emptyDescription) : void 0,
|
|
717
764
|
executeQuery: async ({
|
|
718
|
-
resource:
|
|
765
|
+
resource: o,
|
|
719
766
|
modeId: s
|
|
720
767
|
}) => {
|
|
721
|
-
const
|
|
768
|
+
const i = await n(t.queryCommandId, {
|
|
722
769
|
rendererId: t.id,
|
|
723
770
|
projectId: e.projectId,
|
|
724
771
|
modeId: s,
|
|
725
|
-
resource:
|
|
726
|
-
type:
|
|
727
|
-
id:
|
|
728
|
-
label:
|
|
729
|
-
metadata:
|
|
772
|
+
resource: o ? {
|
|
773
|
+
type: o.kind,
|
|
774
|
+
id: o.id ?? o.uri,
|
|
775
|
+
label: o.label,
|
|
776
|
+
metadata: o.metadata
|
|
730
777
|
} : void 0
|
|
731
|
-
},
|
|
732
|
-
return
|
|
733
|
-
rows:
|
|
734
|
-
columns:
|
|
778
|
+
}, o);
|
|
779
|
+
return Wt(i) ? {
|
|
780
|
+
rows: i.rows.map(jt),
|
|
781
|
+
columns: i.columns?.map(we)
|
|
735
782
|
} : {
|
|
736
783
|
rows: []
|
|
737
784
|
};
|
|
738
785
|
},
|
|
739
|
-
rowActions: t.rowActions?.map((
|
|
740
|
-
id:
|
|
741
|
-
label:
|
|
742
|
-
icon:
|
|
743
|
-
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,
|
|
744
791
|
size: 16
|
|
745
792
|
}) : void 0,
|
|
746
|
-
destructive:
|
|
747
|
-
run: (s) =>
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
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
|
+
}
|
|
751
799
|
}))
|
|
752
800
|
});
|
|
753
|
-
},
|
|
801
|
+
}, Mt = (e, t, r, n) => {
|
|
754
802
|
if (t.dataTableRendererId)
|
|
755
|
-
return
|
|
803
|
+
return H({
|
|
756
804
|
workbench: e.workbench,
|
|
757
805
|
contribution: {
|
|
758
806
|
id: t.id,
|
|
759
|
-
title:
|
|
807
|
+
title: u(t.title, t.id),
|
|
808
|
+
icon: t.icon,
|
|
760
809
|
region: t.region,
|
|
761
810
|
closable: t.closable,
|
|
762
811
|
rendererId: t.dataTableRendererId,
|
|
763
812
|
singleton: !0,
|
|
764
813
|
resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
|
|
765
|
-
eligibleLocations:
|
|
766
|
-
panelMenus:
|
|
814
|
+
eligibleLocations: D(t.eligibleLocations),
|
|
815
|
+
panelMenus: B(t.panelMenus, n),
|
|
816
|
+
...A({
|
|
817
|
+
placement: t.placement,
|
|
818
|
+
declarationIndex: r
|
|
819
|
+
})
|
|
767
820
|
}
|
|
768
821
|
});
|
|
769
|
-
},
|
|
770
|
-
const
|
|
771
|
-
|
|
772
|
-
const
|
|
773
|
-
|
|
774
|
-
}
|
|
775
|
-
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
|
+
}), {
|
|
776
828
|
dispose() {
|
|
777
|
-
for (let
|
|
829
|
+
for (let s = n.length - 1; s >= 0; s -= 1) n[s]?.dispose();
|
|
778
830
|
}
|
|
779
831
|
};
|
|
780
|
-
},
|
|
832
|
+
}, $t = {
|
|
781
833
|
first: 0,
|
|
782
834
|
default: 1,
|
|
783
835
|
last: 2
|
|
784
|
-
},
|
|
836
|
+
}, bn = {
|
|
785
837
|
commands: [],
|
|
786
838
|
commandPaletteContributions: [],
|
|
787
839
|
diagnostics: [],
|
|
@@ -798,112 +850,112 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
798
850
|
settingsDefinitions: [],
|
|
799
851
|
treeItems: [],
|
|
800
852
|
panels: []
|
|
801
|
-
},
|
|
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) => {
|
|
802
854
|
const {
|
|
803
855
|
commandId: t,
|
|
804
856
|
contribution: r,
|
|
805
|
-
index:
|
|
806
|
-
resolveString:
|
|
857
|
+
index: n,
|
|
858
|
+
resolveString: o,
|
|
807
859
|
slot: s,
|
|
808
|
-
when:
|
|
860
|
+
when: i
|
|
809
861
|
} = e;
|
|
810
862
|
return {
|
|
811
863
|
commandId: t,
|
|
812
864
|
sourceCommandId: r.commandId,
|
|
813
|
-
label:
|
|
865
|
+
label: o(r.label, r.extensionId),
|
|
814
866
|
icon: r.icon,
|
|
815
867
|
group: s.group ?? r.group,
|
|
816
868
|
overflowLabel: s.overflowLabel,
|
|
817
|
-
order:
|
|
818
|
-
when:
|
|
869
|
+
order: We(r, n),
|
|
870
|
+
when: i
|
|
819
871
|
};
|
|
820
|
-
},
|
|
872
|
+
}, Ot = (e) => {
|
|
821
873
|
const {
|
|
822
874
|
commandId: t,
|
|
823
875
|
contribution: r,
|
|
824
|
-
index:
|
|
825
|
-
resolveString:
|
|
876
|
+
index: n,
|
|
877
|
+
resolveString: o
|
|
826
878
|
} = e;
|
|
827
879
|
return {
|
|
828
880
|
commandId: t,
|
|
829
|
-
label:
|
|
881
|
+
label: o(r.label, r.extensionId),
|
|
830
882
|
icon: r.icon,
|
|
831
883
|
group: r.group,
|
|
832
|
-
order:
|
|
884
|
+
order: We(r, n)
|
|
833
885
|
};
|
|
834
|
-
},
|
|
886
|
+
}, Vt = (e) => {
|
|
835
887
|
const {
|
|
836
|
-
createCommandId: t =
|
|
888
|
+
createCommandId: t = Bt,
|
|
837
889
|
createWhenExpression: r,
|
|
838
|
-
menuSlotsById:
|
|
839
|
-
menuTargetsById:
|
|
890
|
+
menuSlotsById: n,
|
|
891
|
+
menuTargetsById: o,
|
|
840
892
|
metadata: s,
|
|
841
|
-
resolveString:
|
|
893
|
+
resolveString: i = je
|
|
842
894
|
} = e, d = [];
|
|
843
895
|
return s.menuContributions.forEach((c, b) => {
|
|
844
|
-
const
|
|
845
|
-
if (!
|
|
846
|
-
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);
|
|
847
899
|
d.push({
|
|
848
900
|
command: {
|
|
849
901
|
id: l,
|
|
850
|
-
label:
|
|
902
|
+
label: i(c.label, c.extensionId),
|
|
851
903
|
category: c.group,
|
|
852
|
-
description:
|
|
904
|
+
description: m ? i(m.description, m.extensionId) : void 0,
|
|
853
905
|
icon: c.icon,
|
|
854
|
-
params:
|
|
906
|
+
params: m?.params
|
|
855
907
|
},
|
|
856
908
|
contribution: c,
|
|
857
|
-
menuItem:
|
|
909
|
+
menuItem: Lt({
|
|
858
910
|
commandId: l,
|
|
859
911
|
contribution: c,
|
|
860
912
|
index: b,
|
|
861
|
-
resolveString:
|
|
862
|
-
slot:
|
|
913
|
+
resolveString: i,
|
|
914
|
+
slot: a,
|
|
863
915
|
when: r?.(c)
|
|
864
916
|
}),
|
|
865
|
-
menuPath:
|
|
917
|
+
menuPath: a.menuPath,
|
|
866
918
|
targetCommandId: c.commandId
|
|
867
919
|
});
|
|
868
920
|
}), d;
|
|
869
|
-
},
|
|
921
|
+
}, Ft = (e) => {
|
|
870
922
|
const {
|
|
871
|
-
createCommandId: t =
|
|
923
|
+
createCommandId: t = Ht,
|
|
872
924
|
metadata: r,
|
|
873
|
-
resolveString:
|
|
874
|
-
} = e,
|
|
875
|
-
return (r.commandPaletteContributions ?? []).forEach((s,
|
|
925
|
+
resolveString: n = je
|
|
926
|
+
} = e, o = [];
|
|
927
|
+
return (r.commandPaletteContributions ?? []).forEach((s, i) => {
|
|
876
928
|
const d = t(s), c = r.commands.find((b) => b.id === s.commandId);
|
|
877
|
-
|
|
929
|
+
o.push({
|
|
878
930
|
command: {
|
|
879
931
|
id: d,
|
|
880
|
-
label:
|
|
932
|
+
label: n(s.label, s.extensionId),
|
|
881
933
|
category: s.group,
|
|
882
|
-
description: c ?
|
|
934
|
+
description: c ? n(c.description, c.extensionId) : void 0,
|
|
883
935
|
icon: s.icon,
|
|
884
936
|
params: c?.params
|
|
885
937
|
},
|
|
886
938
|
contribution: s,
|
|
887
|
-
menuItem:
|
|
939
|
+
menuItem: Ot({
|
|
888
940
|
commandId: d,
|
|
889
941
|
contribution: s,
|
|
890
|
-
index:
|
|
891
|
-
resolveString:
|
|
942
|
+
index: i,
|
|
943
|
+
resolveString: n
|
|
892
944
|
}),
|
|
893
945
|
targetCommandId: s.commandId
|
|
894
946
|
});
|
|
895
|
-
}),
|
|
896
|
-
},
|
|
947
|
+
}), o;
|
|
948
|
+
}, fn = (e) => {
|
|
897
949
|
const {
|
|
898
950
|
createResource: t,
|
|
899
951
|
metadata: r
|
|
900
952
|
} = e;
|
|
901
|
-
return r ? r.routes.map((
|
|
953
|
+
return r ? r.routes.map((n) => ({
|
|
902
954
|
resource: t({
|
|
903
|
-
route:
|
|
955
|
+
route: n
|
|
904
956
|
})
|
|
905
957
|
})) : [];
|
|
906
|
-
},
|
|
958
|
+
}, Nt = (e) => {
|
|
907
959
|
if (e)
|
|
908
960
|
return {
|
|
909
961
|
type: e.kind,
|
|
@@ -911,7 +963,7 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
911
963
|
label: e.label,
|
|
912
964
|
metadata: e.metadata
|
|
913
965
|
};
|
|
914
|
-
},
|
|
966
|
+
}, Ut = (e) => ({
|
|
915
967
|
id: e.rendererId,
|
|
916
968
|
kind: "renderer",
|
|
917
969
|
context: {
|
|
@@ -921,174 +973,179 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
921
973
|
resourceId: e.resource.id
|
|
922
974
|
} : {}
|
|
923
975
|
}
|
|
924
|
-
}),
|
|
925
|
-
const s =
|
|
976
|
+
}), ge = async (e, t, r, n, o = {}) => {
|
|
977
|
+
const s = Nt(n), i = await e.executeCommand(r, {
|
|
926
978
|
projectId: e.projectId,
|
|
927
979
|
params: {
|
|
928
980
|
projectId: e.projectId,
|
|
929
981
|
resource: s,
|
|
930
|
-
...
|
|
982
|
+
...o
|
|
931
983
|
},
|
|
932
984
|
resource: s,
|
|
933
|
-
slot:
|
|
985
|
+
slot: Ut({
|
|
934
986
|
projectId: e.projectId,
|
|
935
987
|
rendererId: t,
|
|
936
988
|
resource: s
|
|
937
989
|
}),
|
|
938
990
|
source: "dashboard"
|
|
939
991
|
});
|
|
940
|
-
return
|
|
941
|
-
},
|
|
992
|
+
return N(i);
|
|
993
|
+
}, _t = (e, t) => e.workbench.renderers.registerFileRenderer({
|
|
942
994
|
id: t.id,
|
|
943
|
-
title:
|
|
995
|
+
title: u(t.title, t.id),
|
|
944
996
|
resourceKind: t.resourceKind,
|
|
945
|
-
load: async (r) => await
|
|
946
|
-
save: t.saveCommandId ? async (r,
|
|
947
|
-
await
|
|
948
|
-
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
|
|
949
1001
|
});
|
|
950
1002
|
} : void 0
|
|
951
|
-
}),
|
|
1003
|
+
}), qt = (e, t, r, n) => {
|
|
952
1004
|
if (t.fileRendererId)
|
|
953
|
-
return
|
|
1005
|
+
return H({
|
|
954
1006
|
workbench: e.workbench,
|
|
955
1007
|
contribution: {
|
|
956
1008
|
id: t.id,
|
|
957
|
-
title:
|
|
1009
|
+
title: u(t.title, t.id),
|
|
1010
|
+
icon: t.icon,
|
|
958
1011
|
region: t.region,
|
|
959
1012
|
closable: t.closable,
|
|
960
1013
|
rendererId: t.fileRendererId,
|
|
961
1014
|
singleton: !0,
|
|
962
1015
|
resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
|
|
963
|
-
eligibleLocations:
|
|
964
|
-
panelMenus:
|
|
1016
|
+
eligibleLocations: D(t.eligibleLocations),
|
|
1017
|
+
panelMenus: B(t.panelMenus, n),
|
|
1018
|
+
...A({
|
|
1019
|
+
placement: t.placement,
|
|
1020
|
+
declarationIndex: r
|
|
1021
|
+
})
|
|
965
1022
|
}
|
|
966
1023
|
});
|
|
967
|
-
},
|
|
1024
|
+
}, zt = (e) => {
|
|
968
1025
|
const t = [];
|
|
969
|
-
for (const
|
|
970
|
-
t.push(
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
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
|
+
}), {
|
|
976
1033
|
dispose() {
|
|
977
|
-
for (let
|
|
1034
|
+
for (let n = t.length - 1; n >= 0; n -= 1) t[n]?.dispose();
|
|
978
1035
|
}
|
|
979
1036
|
};
|
|
980
|
-
},
|
|
1037
|
+
}, Qt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Ie = (e, t, r, n) => (t ?? []).map((o) => {
|
|
981
1038
|
const s = {
|
|
982
|
-
...
|
|
983
|
-
label: r(
|
|
984
|
-
type:
|
|
985
|
-
...
|
|
986
|
-
options: Array.isArray(
|
|
987
|
-
...
|
|
988
|
-
label: r(
|
|
989
|
-
})) :
|
|
990
|
-
} :
|
|
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
|
|
991
1048
|
};
|
|
992
|
-
return
|
|
993
|
-
}),
|
|
994
|
-
let
|
|
1049
|
+
return n(e, s);
|
|
1050
|
+
}), Gt = (e, t, r, n) => {
|
|
1051
|
+
let o = Ie(e, t, r, n);
|
|
995
1052
|
const s = /* @__PURE__ */ new Set();
|
|
996
1053
|
return {
|
|
997
1054
|
source: {
|
|
998
|
-
getSnapshot: () =>
|
|
999
|
-
subscribe: (
|
|
1055
|
+
getSnapshot: () => o,
|
|
1056
|
+
subscribe: (i) => (s.add(i), () => s.delete(i))
|
|
1000
1057
|
},
|
|
1001
|
-
set(
|
|
1002
|
-
|
|
1058
|
+
set(i) {
|
|
1059
|
+
o = Ie(e, i, r, n);
|
|
1003
1060
|
for (const d of s) d();
|
|
1004
1061
|
}
|
|
1005
1062
|
};
|
|
1006
|
-
},
|
|
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) => {
|
|
1007
1064
|
const {
|
|
1008
1065
|
resource: r
|
|
1009
1066
|
} = t;
|
|
1010
|
-
if (
|
|
1011
|
-
if (
|
|
1012
|
-
},
|
|
1013
|
-
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);
|
|
1014
1071
|
if (r) return r;
|
|
1015
1072
|
if (e.resourceKind)
|
|
1016
1073
|
return {
|
|
1017
1074
|
kind: e.resourceKind,
|
|
1018
|
-
uri:
|
|
1075
|
+
uri: Jt(e.resourceKind, t.id),
|
|
1019
1076
|
id: t.id,
|
|
1020
1077
|
label: t.title
|
|
1021
1078
|
};
|
|
1022
|
-
},
|
|
1023
|
-
const r = e,
|
|
1024
|
-
return
|
|
1079
|
+
}, ye = (e, t) => {
|
|
1080
|
+
const r = e, n = t(r);
|
|
1081
|
+
return n === void 0 ? r : {
|
|
1025
1082
|
...r,
|
|
1026
|
-
resource:
|
|
1083
|
+
resource: n
|
|
1027
1084
|
};
|
|
1028
|
-
},
|
|
1029
|
-
if (!
|
|
1030
|
-
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;
|
|
1031
1088
|
return {
|
|
1032
1089
|
id: e,
|
|
1033
1090
|
label: r(t.label, e),
|
|
1034
1091
|
description: t.description === void 0 ? void 0 : r(t.description),
|
|
1035
|
-
placeholder:
|
|
1092
|
+
placeholder: o.placeholder === void 0 ? void 0 : r(o.placeholder),
|
|
1036
1093
|
type: t.type,
|
|
1037
1094
|
required: t.required === !0,
|
|
1038
1095
|
defaultValue: t.defaultValue,
|
|
1039
|
-
options: t.type === "select" || t.type === "multi-select" ?
|
|
1096
|
+
options: t.type === "select" || t.type === "multi-select" ? n.map((s) => ({
|
|
1040
1097
|
value: s.value,
|
|
1041
1098
|
label: r(s.label, s.value),
|
|
1042
1099
|
icon: s.icon
|
|
1043
1100
|
})) : void 0,
|
|
1044
|
-
multiple: t.type === "files" ?
|
|
1045
|
-
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
|
|
1046
1103
|
};
|
|
1047
|
-
},
|
|
1048
|
-
const
|
|
1049
|
-
return
|
|
1050
|
-
}),
|
|
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({
|
|
1051
1108
|
id: t.id,
|
|
1052
1109
|
kind: "kanbanRenderer",
|
|
1053
1110
|
projectId: e.projectId,
|
|
1054
1111
|
context: {
|
|
1055
1112
|
kanbanRendererId: t.id
|
|
1056
1113
|
}
|
|
1057
|
-
}),
|
|
1058
|
-
params:
|
|
1059
|
-
resource:
|
|
1060
|
-
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),
|
|
1061
1118
|
metadata: {
|
|
1062
1119
|
kanbanRendererId: t.id
|
|
1063
1120
|
}
|
|
1064
|
-
}),
|
|
1065
|
-
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;
|
|
1066
1123
|
return e.workbench.commands.registerCommand({
|
|
1067
|
-
id:
|
|
1068
|
-
label: r(
|
|
1069
|
-
icon:
|
|
1070
|
-
params:
|
|
1124
|
+
id: De(t, n),
|
|
1125
|
+
label: r(n.label, n.id),
|
|
1126
|
+
icon: n.icon,
|
|
1127
|
+
params: o?.params
|
|
1071
1128
|
}, {
|
|
1072
|
-
execute: (s,
|
|
1129
|
+
execute: (s, i) => F(e, t, n.commandId, Me(er(s)), i?.resource)
|
|
1073
1130
|
});
|
|
1074
|
-
}),
|
|
1075
|
-
const
|
|
1076
|
-
rowId:
|
|
1077
|
-
}, b =
|
|
1078
|
-
resource:
|
|
1079
|
-
} : void 0,
|
|
1080
|
-
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({
|
|
1081
1138
|
record: d,
|
|
1082
|
-
label:
|
|
1139
|
+
label: a,
|
|
1083
1140
|
args: c,
|
|
1084
1141
|
context: b
|
|
1085
1142
|
}), Promise.resolve()) : d ? e.workbench.commands.executeCommand(d.command.id, c, b).then(() => {
|
|
1086
|
-
}) :
|
|
1143
|
+
}) : F(e, t, r.commandId, c, o).then(() => {
|
|
1087
1144
|
});
|
|
1088
|
-
},
|
|
1145
|
+
}, dr = (e) => (r) => W(j, {
|
|
1089
1146
|
name: e ?? "MoreHorizontal",
|
|
1090
1147
|
...r
|
|
1091
|
-
}),
|
|
1148
|
+
}), cr = (e, t) => ({
|
|
1092
1149
|
color: e?.color,
|
|
1093
1150
|
canDragIn: e?.canDragIn,
|
|
1094
1151
|
canDragOut: e?.canDragOut,
|
|
@@ -1096,17 +1153,17 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
1096
1153
|
actions: e?.actions?.map((r) => ({
|
|
1097
1154
|
id: r.id,
|
|
1098
1155
|
label: t(r.label, r.id),
|
|
1099
|
-
icon:
|
|
1156
|
+
icon: dr(r.icon)
|
|
1100
1157
|
}))
|
|
1101
|
-
}),
|
|
1158
|
+
}), lr = (e) => e ? W(j, {
|
|
1102
1159
|
name: e,
|
|
1103
1160
|
size: 16
|
|
1104
|
-
}) : void 0,
|
|
1161
|
+
}) : void 0, mr = (e, t) => {
|
|
1105
1162
|
if (e.createRow)
|
|
1106
1163
|
return {
|
|
1107
1164
|
title: t(e.createRow.title, "Create row"),
|
|
1108
1165
|
submitLabel: t(e.createRow.submitLabel, "Create"),
|
|
1109
|
-
fields:
|
|
1166
|
+
fields: or(e, t),
|
|
1110
1167
|
labels: {
|
|
1111
1168
|
cancel: t(e.createRow.labels?.cancel, "Cancel"),
|
|
1112
1169
|
properties: t(e.createRow.labels?.properties, "Properties"),
|
|
@@ -1114,161 +1171,166 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
1114
1171
|
removeFile: t(e.createRow.labels?.removeFile, "Remove file")
|
|
1115
1172
|
}
|
|
1116
1173
|
};
|
|
1117
|
-
},
|
|
1174
|
+
}, ur = (e, t, r) => {
|
|
1118
1175
|
if (t.onRowClick)
|
|
1119
|
-
return (
|
|
1176
|
+
return (n) => t.onRowClick?.({
|
|
1120
1177
|
record: e,
|
|
1121
|
-
row:
|
|
1122
|
-
resource: r(e,
|
|
1178
|
+
row: n,
|
|
1179
|
+
resource: r(e, n)
|
|
1123
1180
|
});
|
|
1124
|
-
},
|
|
1125
|
-
const
|
|
1126
|
-
if (
|
|
1127
|
-
return async (
|
|
1128
|
-
const s =
|
|
1129
|
-
[
|
|
1130
|
-
} : void 0,
|
|
1131
|
-
[
|
|
1132
|
-
} : 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);
|
|
1133
1190
|
await t.onAfterCreate?.({
|
|
1134
1191
|
record: e,
|
|
1135
|
-
created:
|
|
1136
|
-
submission:
|
|
1192
|
+
created: i,
|
|
1193
|
+
submission: o
|
|
1137
1194
|
});
|
|
1138
1195
|
};
|
|
1139
|
-
},
|
|
1196
|
+
}, fr = (e, t, r, n, o) => {
|
|
1140
1197
|
const s = t.rowActions;
|
|
1141
1198
|
if (s?.length)
|
|
1142
|
-
return (
|
|
1143
|
-
const c =
|
|
1199
|
+
return (i) => s.map((d) => {
|
|
1200
|
+
const c = o(t, i), b = () => ar(e, t, d, i, c, n);
|
|
1144
1201
|
return {
|
|
1145
1202
|
key: d.id,
|
|
1146
|
-
label:
|
|
1203
|
+
label: n(d.label, d.id),
|
|
1147
1204
|
commandId: d.commandId,
|
|
1148
|
-
icon:
|
|
1205
|
+
icon: lr(d.icon),
|
|
1149
1206
|
onClick: () => r.executeRowAction ? r.executeRowAction({
|
|
1150
1207
|
record: t,
|
|
1151
1208
|
action: d,
|
|
1152
|
-
row:
|
|
1209
|
+
row: i,
|
|
1153
1210
|
resource: c,
|
|
1154
1211
|
runDefault: b
|
|
1155
1212
|
}) : b()
|
|
1156
1213
|
};
|
|
1157
1214
|
});
|
|
1158
|
-
},
|
|
1159
|
-
const
|
|
1160
|
-
}), b = (
|
|
1161
|
-
for (const
|
|
1162
|
-
const l =
|
|
1163
|
-
let
|
|
1164
|
-
const f = (p) => a
|
|
1165
|
-
|
|
1166
|
-
id:
|
|
1167
|
-
title:
|
|
1168
|
-
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,
|
|
1169
1226
|
attributes: l.source,
|
|
1170
|
-
defaultSettings:
|
|
1171
|
-
defaultFilters:
|
|
1172
|
-
defaultViews:
|
|
1227
|
+
defaultSettings: a.defaultSettings,
|
|
1228
|
+
defaultFilters: a.defaultFilters,
|
|
1229
|
+
defaultViews: a.defaultViews?.map((p) => ({
|
|
1173
1230
|
...p,
|
|
1174
|
-
title:
|
|
1231
|
+
title: o(p.title, p.id)
|
|
1175
1232
|
})),
|
|
1176
|
-
defaultActiveViewId:
|
|
1177
|
-
emptyTitle:
|
|
1178
|
-
emptyDescription:
|
|
1179
|
-
hideToolbar:
|
|
1180
|
-
createRow:
|
|
1181
|
-
getBoardColumnConfig: (p) =>
|
|
1182
|
-
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),
|
|
1183
1240
|
executeQuery: async (p) => {
|
|
1184
|
-
const
|
|
1241
|
+
const w = await F(e, a, a.queryCommandId, {
|
|
1185
1242
|
settings: p.settings,
|
|
1186
1243
|
filters: p.filters
|
|
1187
1244
|
});
|
|
1188
|
-
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))) : [];
|
|
1189
1246
|
},
|
|
1190
|
-
onAttributeChange:
|
|
1247
|
+
onAttributeChange: a.updateAttributeCommandId ? (p, w, v) => b(a, a.updateAttributeCommandId, {
|
|
1191
1248
|
rowId: p,
|
|
1192
|
-
attributeId:
|
|
1249
|
+
attributeId: w,
|
|
1193
1250
|
value: v
|
|
1194
1251
|
}).then(() => {
|
|
1195
1252
|
}) : void 0,
|
|
1196
|
-
onReorder:
|
|
1253
|
+
onReorder: a.reorderCommandId ? (p, w) => b(a, a.reorderCommandId, {
|
|
1197
1254
|
rowId: p,
|
|
1198
|
-
beforeRowId:
|
|
1255
|
+
beforeRowId: w
|
|
1199
1256
|
}).then(() => {
|
|
1200
1257
|
}) : void 0,
|
|
1201
|
-
onCreateRow:
|
|
1202
|
-
onColumnAction:
|
|
1203
|
-
await b(
|
|
1258
|
+
onCreateRow: br(a, r, b),
|
|
1259
|
+
onColumnAction: a.columnActionCommandId ? async (p, w) => {
|
|
1260
|
+
await b(a, a.columnActionCommandId, {
|
|
1204
1261
|
columnId: p,
|
|
1205
|
-
actionId:
|
|
1262
|
+
actionId: w
|
|
1206
1263
|
});
|
|
1207
1264
|
} : void 0,
|
|
1208
|
-
getRowContextMenuActions:
|
|
1209
|
-
})),
|
|
1265
|
+
getRowContextMenuActions: fr(e, a, r, o, d)
|
|
1266
|
+
})), n.push(e.workbench.layout.registerPanel({
|
|
1210
1267
|
closable: !1,
|
|
1211
|
-
id:
|
|
1212
|
-
title:
|
|
1268
|
+
id: a.id,
|
|
1269
|
+
title: o(a.title, a.id),
|
|
1213
1270
|
region: "main",
|
|
1214
|
-
rendererId:
|
|
1271
|
+
rendererId: a.id,
|
|
1215
1272
|
singleton: !0,
|
|
1216
|
-
resourceKinds:
|
|
1273
|
+
resourceKinds: a.resourceKind ? [a.resourceKind] : void 0
|
|
1217
1274
|
}));
|
|
1218
1275
|
}
|
|
1219
1276
|
return {
|
|
1220
1277
|
dispose() {
|
|
1221
|
-
for (let
|
|
1278
|
+
for (let a = n.length - 1; a >= 0; a -= 1) n[a]?.dispose();
|
|
1222
1279
|
}
|
|
1223
1280
|
};
|
|
1224
|
-
},
|
|
1281
|
+
}, hr = (e, t) => {
|
|
1225
1282
|
if (e)
|
|
1226
|
-
return Object.fromEntries(Object.entries(e).map(([r,
|
|
1227
|
-
...
|
|
1228
|
-
label:
|
|
1229
|
-
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)
|
|
1230
1287
|
}]));
|
|
1231
|
-
},
|
|
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) => {
|
|
1232
1289
|
const {
|
|
1233
1290
|
ctx: t,
|
|
1234
1291
|
getHostTreeHeaderNodes: r,
|
|
1235
|
-
record:
|
|
1236
|
-
treeViews:
|
|
1237
|
-
} = e, s =
|
|
1292
|
+
record: n,
|
|
1293
|
+
treeViews: o
|
|
1294
|
+
} = e, s = $e(o, t);
|
|
1238
1295
|
return !s || !("hostTreeHeader" in s) || s.hostTreeHeader !== "default" ? [] : await r?.({
|
|
1239
1296
|
ctx: t,
|
|
1240
|
-
record:
|
|
1297
|
+
record: n,
|
|
1241
1298
|
panel: s
|
|
1242
1299
|
}) ?? [];
|
|
1243
|
-
},
|
|
1300
|
+
}, Ir = async (e) => {
|
|
1244
1301
|
const {
|
|
1245
1302
|
ctx: t,
|
|
1246
1303
|
getHostTreeFooterNodes: r,
|
|
1247
|
-
record:
|
|
1248
|
-
treeViews:
|
|
1249
|
-
} = e, s =
|
|
1304
|
+
record: n,
|
|
1305
|
+
treeViews: o
|
|
1306
|
+
} = e, s = $e(o, t);
|
|
1250
1307
|
return !s || !("hostTreeFooter" in s) || s.hostTreeFooter !== "default" ? [] : await r?.({
|
|
1251
1308
|
ctx: t,
|
|
1252
|
-
record:
|
|
1309
|
+
record: n,
|
|
1253
1310
|
panel: s
|
|
1254
1311
|
}) ?? [];
|
|
1255
|
-
},
|
|
1312
|
+
}, yr = (e, t, r, n) => {
|
|
1256
1313
|
if (t.treeRendererId)
|
|
1257
|
-
return
|
|
1314
|
+
return H({
|
|
1258
1315
|
workbench: e.workbench,
|
|
1259
1316
|
contribution: {
|
|
1260
1317
|
id: t.id,
|
|
1261
|
-
title:
|
|
1318
|
+
title: u(t.title, t.id),
|
|
1319
|
+
icon: t.icon,
|
|
1262
1320
|
region: t.region,
|
|
1263
1321
|
closable: t.closable,
|
|
1264
1322
|
rendererId: t.treeRendererId,
|
|
1265
1323
|
singleton: !0,
|
|
1266
1324
|
resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
|
|
1267
|
-
eligibleLocations:
|
|
1268
|
-
panelMenus:
|
|
1325
|
+
eligibleLocations: D(t.eligibleLocations),
|
|
1326
|
+
panelMenus: B(t.panelMenus, n),
|
|
1327
|
+
...A({
|
|
1328
|
+
placement: t.placement,
|
|
1329
|
+
declarationIndex: r
|
|
1330
|
+
})
|
|
1269
1331
|
}
|
|
1270
1332
|
});
|
|
1271
|
-
},
|
|
1333
|
+
}, Z = (e) => {
|
|
1272
1334
|
if (e)
|
|
1273
1335
|
return {
|
|
1274
1336
|
type: e.kind,
|
|
@@ -1276,13 +1338,13 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
1276
1338
|
label: e.label,
|
|
1277
1339
|
metadata: e.metadata
|
|
1278
1340
|
};
|
|
1279
|
-
},
|
|
1341
|
+
}, ve = (e) => ({
|
|
1280
1342
|
kind: e.type,
|
|
1281
1343
|
uri: `pstdio://extension-resource/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}`,
|
|
1282
1344
|
id: e.id,
|
|
1283
1345
|
label: e.label,
|
|
1284
1346
|
metadata: e.metadata
|
|
1285
|
-
}),
|
|
1347
|
+
}), Be = (e) => ({
|
|
1286
1348
|
id: e.treeId,
|
|
1287
1349
|
kind: "renderer",
|
|
1288
1350
|
context: {
|
|
@@ -1296,46 +1358,46 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
1296
1358
|
resourceId: e.resource.id
|
|
1297
1359
|
} : {}
|
|
1298
1360
|
}
|
|
1299
|
-
}),
|
|
1300
|
-
const
|
|
1361
|
+
}), X = (e, t, r, n) => {
|
|
1362
|
+
const o = Z(r.resource);
|
|
1301
1363
|
return {
|
|
1302
1364
|
projectId: e.projectId,
|
|
1303
1365
|
modeId: e.workbench.modes.getActiveModeId(),
|
|
1304
|
-
resource:
|
|
1366
|
+
resource: o,
|
|
1305
1367
|
treeId: t.id,
|
|
1306
1368
|
state: e.workbench.renderers.getTreeState(t.id),
|
|
1307
1369
|
...r.filter ? {
|
|
1308
1370
|
filter: r.filter
|
|
1309
1371
|
} : {},
|
|
1310
|
-
...
|
|
1311
|
-
node:
|
|
1372
|
+
...n ? {
|
|
1373
|
+
node: n
|
|
1312
1374
|
} : {}
|
|
1313
1375
|
};
|
|
1314
|
-
},
|
|
1315
|
-
const
|
|
1376
|
+
}, J = async (e, t, r) => {
|
|
1377
|
+
const n = r.resource, o = await e.executeCommand(t, {
|
|
1316
1378
|
projectId: e.projectId,
|
|
1317
1379
|
params: r,
|
|
1318
|
-
resource:
|
|
1319
|
-
slot:
|
|
1380
|
+
resource: n,
|
|
1381
|
+
slot: Be({
|
|
1320
1382
|
modeId: r.modeId,
|
|
1321
1383
|
projectId: e.projectId,
|
|
1322
|
-
resource:
|
|
1384
|
+
resource: n,
|
|
1323
1385
|
treeId: r.treeId
|
|
1324
1386
|
}),
|
|
1325
1387
|
source: "dashboard"
|
|
1326
1388
|
});
|
|
1327
|
-
return
|
|
1328
|
-
},
|
|
1329
|
-
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, {
|
|
1330
1392
|
projectId: e.projectId,
|
|
1331
|
-
...
|
|
1332
|
-
params:
|
|
1393
|
+
...n ? {
|
|
1394
|
+
params: n
|
|
1333
1395
|
} : {},
|
|
1334
|
-
resource:
|
|
1335
|
-
slot:
|
|
1396
|
+
resource: o,
|
|
1397
|
+
slot: Be({
|
|
1336
1398
|
modeId: s,
|
|
1337
1399
|
projectId: e.projectId,
|
|
1338
|
-
resource:
|
|
1400
|
+
resource: o,
|
|
1339
1401
|
treeId: t.id
|
|
1340
1402
|
}),
|
|
1341
1403
|
source: "dashboard",
|
|
@@ -1343,190 +1405,190 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
1343
1405
|
treeId: t.id
|
|
1344
1406
|
}
|
|
1345
1407
|
});
|
|
1346
|
-
return
|
|
1347
|
-
},
|
|
1348
|
-
const r = /* @__PURE__ */ new WeakMap(),
|
|
1349
|
-
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)
|
|
1350
1412
|
return {
|
|
1351
|
-
title:
|
|
1352
|
-
description:
|
|
1353
|
-
icon:
|
|
1413
|
+
title: u(a.emptyState.title),
|
|
1414
|
+
description: u(a.emptyState.description),
|
|
1415
|
+
icon: a.emptyState.icon
|
|
1354
1416
|
};
|
|
1355
|
-
}, s = (
|
|
1356
|
-
if (
|
|
1357
|
-
if (
|
|
1417
|
+
}, s = (a, l, m) => {
|
|
1418
|
+
if (a) {
|
|
1419
|
+
if (a.kind === "resource" && a.resource)
|
|
1358
1420
|
return {
|
|
1359
1421
|
kind: "resource",
|
|
1360
|
-
resource:
|
|
1422
|
+
resource: ve(a.resource),
|
|
1361
1423
|
input: {
|
|
1362
1424
|
replaceActive: !0
|
|
1363
1425
|
}
|
|
1364
1426
|
};
|
|
1365
|
-
if (
|
|
1427
|
+
if (a.kind === "panel" && a.panelId) return {
|
|
1366
1428
|
kind: "panel",
|
|
1367
|
-
panelId:
|
|
1429
|
+
panelId: a.panelId
|
|
1368
1430
|
};
|
|
1369
|
-
if (!(
|
|
1431
|
+
if (!(a.kind !== "command" || !a.commandId))
|
|
1370
1432
|
return {
|
|
1371
1433
|
kind: "command",
|
|
1372
|
-
commandId:
|
|
1434
|
+
commandId: n,
|
|
1373
1435
|
args: {
|
|
1374
|
-
commandId:
|
|
1436
|
+
commandId: a.commandId,
|
|
1375
1437
|
nodeId: l.id,
|
|
1376
|
-
params:
|
|
1377
|
-
resource: l.resource ??
|
|
1438
|
+
params: a.args,
|
|
1439
|
+
resource: l.resource ?? Z(m.resource),
|
|
1378
1440
|
treeId: t.id
|
|
1379
1441
|
}
|
|
1380
1442
|
};
|
|
1381
1443
|
}
|
|
1382
|
-
},
|
|
1383
|
-
const f =
|
|
1444
|
+
}, i = (a, l, m) => {
|
|
1445
|
+
const f = a.commandId;
|
|
1384
1446
|
return {
|
|
1385
|
-
id:
|
|
1386
|
-
label:
|
|
1387
|
-
icon:
|
|
1388
|
-
args:
|
|
1389
|
-
params:
|
|
1390
|
-
submitLabel:
|
|
1391
|
-
when:
|
|
1392
|
-
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,
|
|
1393
1455
|
// Actions mutate tree data (create/delete/...), so refresh afterwards. Plain
|
|
1394
1456
|
// node-target navigation runs through the runner command and must not refetch.
|
|
1395
1457
|
run: f ? async (p) => {
|
|
1396
|
-
await
|
|
1458
|
+
await He(e, t, f, vr(p, a.args), l?.resource ?? Z(m.resource)), e.workbench.renderers.refresh(t.id);
|
|
1397
1459
|
} : void 0
|
|
1398
1460
|
};
|
|
1399
|
-
}, d = (
|
|
1400
|
-
const
|
|
1401
|
-
id:
|
|
1402
|
-
label:
|
|
1403
|
-
icon:
|
|
1404
|
-
iconColor:
|
|
1405
|
-
iconTooltip:
|
|
1406
|
-
resource:
|
|
1407
|
-
target: s(
|
|
1408
|
-
rowVariant:
|
|
1409
|
-
actions:
|
|
1410
|
-
contextMenuActions:
|
|
1411
|
-
collapsible:
|
|
1412
|
-
disabled:
|
|
1413
|
-
children:
|
|
1414
|
-
description:
|
|
1415
|
-
contextValue:
|
|
1416
|
-
hiddenByDefault:
|
|
1417
|
-
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
|
|
1418
1480
|
};
|
|
1419
|
-
return r.set(
|
|
1481
|
+
return r.set(m, a), m;
|
|
1420
1482
|
};
|
|
1421
1483
|
return {
|
|
1422
|
-
mapNodes: (
|
|
1423
|
-
mapSections: (
|
|
1424
|
-
id:
|
|
1425
|
-
label: m
|
|
1426
|
-
actions:
|
|
1427
|
-
collapsible:
|
|
1428
|
-
emptyState:
|
|
1429
|
-
nodes:
|
|
1430
|
-
hiddenByDefault:
|
|
1431
|
-
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
|
|
1432
1494
|
})),
|
|
1433
1495
|
originalNodes: r,
|
|
1434
|
-
runnerCommandId:
|
|
1496
|
+
runnerCommandId: n
|
|
1435
1497
|
};
|
|
1436
|
-
},
|
|
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) => {
|
|
1437
1499
|
for (const t of e)
|
|
1438
1500
|
for (const r of t.nodes)
|
|
1439
1501
|
if (r.selected) return r.id;
|
|
1440
|
-
},
|
|
1441
|
-
const r =
|
|
1502
|
+
}, Er = (e, t) => {
|
|
1503
|
+
const r = kr(e, t), n = wr(e.metadata, t), o = e.workbench.commands.registerCommand({
|
|
1442
1504
|
id: r.runnerCommandId,
|
|
1443
|
-
label: `${
|
|
1505
|
+
label: `${u(t.title, t.id)} tree command`
|
|
1444
1506
|
}, {
|
|
1445
|
-
execute: async (
|
|
1446
|
-
const d =
|
|
1507
|
+
execute: async (i) => {
|
|
1508
|
+
const d = i;
|
|
1447
1509
|
d.nodeId && e.workbench.renderers.setSelectedNode(t.id, d.nodeId);
|
|
1448
|
-
const c = await
|
|
1510
|
+
const c = await He(e, t, d.commandId, d.params, d.resource);
|
|
1449
1511
|
for (const b of e.workbench.renderers.listFileRenderers())
|
|
1450
1512
|
e.workbench.renderers.refreshFileRenderer(b.id);
|
|
1451
1513
|
return c;
|
|
1452
1514
|
}
|
|
1453
1515
|
}), s = e.workbench.renderers.registerTreeRenderer({
|
|
1454
1516
|
id: t.id,
|
|
1455
|
-
title:
|
|
1517
|
+
title: u(t.title, t.id),
|
|
1456
1518
|
icon: t.icon,
|
|
1457
1519
|
defaultExpandedNodeIds: t.defaultExpandedNodeIds,
|
|
1458
1520
|
defaultExpandedSectionIds: t.defaultExpandedSectionIds,
|
|
1459
|
-
getHeader: (
|
|
1460
|
-
ctx:
|
|
1521
|
+
getHeader: (i) => gr({
|
|
1522
|
+
ctx: i,
|
|
1461
1523
|
getHostTreeHeaderNodes: e.getHostTreeHeaderNodes,
|
|
1462
1524
|
record: t,
|
|
1463
|
-
treeViews:
|
|
1525
|
+
treeViews: n
|
|
1464
1526
|
}),
|
|
1465
|
-
getBody: async (
|
|
1466
|
-
const d = await
|
|
1467
|
-
if (!
|
|
1468
|
-
const c =
|
|
1469
|
-
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);
|
|
1470
1532
|
},
|
|
1471
|
-
getFooter: async (
|
|
1472
|
-
const d = await
|
|
1473
|
-
ctx:
|
|
1533
|
+
getFooter: async (i) => {
|
|
1534
|
+
const d = await Ir({
|
|
1535
|
+
ctx: i,
|
|
1474
1536
|
getHostTreeFooterNodes: e.getHostTreeFooterNodes,
|
|
1475
1537
|
record: t,
|
|
1476
|
-
treeViews:
|
|
1538
|
+
treeViews: n
|
|
1477
1539
|
});
|
|
1478
1540
|
if (!t.footerCommandId) return d;
|
|
1479
|
-
const c = await
|
|
1480
|
-
return [...
|
|
1541
|
+
const c = await J(e, t.footerCommandId, X(e, t, i));
|
|
1542
|
+
return [...ke(c) ? r.mapNodes(c, i) : [], ...d];
|
|
1481
1543
|
},
|
|
1482
|
-
getChildren: async (
|
|
1483
|
-
if (!t.childrenCommandId) return
|
|
1484
|
-
const c = r.originalNodes.get(
|
|
1485
|
-
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) : [];
|
|
1486
1548
|
}
|
|
1487
1549
|
});
|
|
1488
1550
|
return {
|
|
1489
1551
|
dispose() {
|
|
1490
|
-
s.dispose(),
|
|
1552
|
+
s.dispose(), o.dispose();
|
|
1491
1553
|
}
|
|
1492
1554
|
};
|
|
1493
|
-
},
|
|
1555
|
+
}, xr = (e) => {
|
|
1494
1556
|
const t = [];
|
|
1495
|
-
for (const
|
|
1496
|
-
t.push(
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
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
|
+
}), {
|
|
1502
1564
|
dispose() {
|
|
1503
|
-
for (let
|
|
1565
|
+
for (let n = t.length - 1; n >= 0; n -= 1) t[n]?.dispose();
|
|
1504
1566
|
}
|
|
1505
1567
|
};
|
|
1506
|
-
},
|
|
1507
|
-
...
|
|
1568
|
+
}, Ar = (e) => (t) => ({
|
|
1569
|
+
...Ae({
|
|
1508
1570
|
workbench: t.workbench,
|
|
1509
1571
|
hostEvents: t.hostEvents
|
|
1510
1572
|
}),
|
|
1511
1573
|
// Extension guests speak the SDK resource shape (`type`); normalize to the
|
|
1512
1574
|
// workbench shape (`kind` + synthesized uri) the resource registry expects,
|
|
1513
1575
|
// mirroring how commands.execute and tree targets normalize their resources.
|
|
1514
|
-
"resource.open": (
|
|
1515
|
-
const
|
|
1516
|
-
if (!
|
|
1517
|
-
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);
|
|
1518
1580
|
},
|
|
1519
|
-
"commands.execute": async (
|
|
1520
|
-
const
|
|
1521
|
-
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, {
|
|
1522
1584
|
projectId: e.projectId,
|
|
1523
|
-
...
|
|
1524
|
-
params:
|
|
1585
|
+
...o.params ? {
|
|
1586
|
+
params: o.params
|
|
1525
1587
|
} : {},
|
|
1526
1588
|
...s ? {
|
|
1527
1589
|
resource: s
|
|
1528
1590
|
} : {},
|
|
1529
|
-
slot:
|
|
1591
|
+
slot: M({
|
|
1530
1592
|
id: t.webviewId,
|
|
1531
1593
|
kind: e.slotKind,
|
|
1532
1594
|
projectId: e.projectId,
|
|
@@ -1542,17 +1604,17 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
1542
1604
|
"files.list": e.files.list,
|
|
1543
1605
|
"files.delete": e.files.delete
|
|
1544
1606
|
} : {}
|
|
1545
|
-
}),
|
|
1607
|
+
}), ne = (e, t) => ({
|
|
1546
1608
|
kind: t,
|
|
1547
1609
|
uri: `workbench://extension-route/${encodeURIComponent(e.id)}`,
|
|
1548
1610
|
id: e.id,
|
|
1549
|
-
label:
|
|
1611
|
+
label: u(e.label, e.id),
|
|
1550
1612
|
metadata: {
|
|
1551
1613
|
extensionId: e.extensionId,
|
|
1552
1614
|
extensionRouteId: e.id,
|
|
1553
1615
|
path: e.path
|
|
1554
1616
|
}
|
|
1555
|
-
}),
|
|
1617
|
+
}), Re = (e, t) => e.routes.find((r) => t.id === r.id || t.metadata?.extensionRouteId === r.id), Pr = (e) => {
|
|
1556
1618
|
if (e.metadata.routes.length === 0) return [];
|
|
1557
1619
|
const t = [];
|
|
1558
1620
|
e.workbench.resources.getKind(e.routeResourceKind) || t.push(e.workbench.resources.registerKind({
|
|
@@ -1564,48 +1626,48 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
1564
1626
|
t.push(e.workbench.layout.registerPanel({
|
|
1565
1627
|
closable: !1,
|
|
1566
1628
|
id: r.id,
|
|
1567
|
-
title:
|
|
1629
|
+
title: u(r.label, r.id),
|
|
1568
1630
|
region: "main",
|
|
1569
|
-
rendererId:
|
|
1631
|
+
rendererId: K,
|
|
1570
1632
|
singleton: !0,
|
|
1571
|
-
config:
|
|
1633
|
+
config: _(r.webview)
|
|
1572
1634
|
}));
|
|
1573
1635
|
return t.push(e.workbench.resources.registerProvider({
|
|
1574
1636
|
id: "workbench.extension.routes",
|
|
1575
1637
|
kind: e.routeResourceKind,
|
|
1576
1638
|
list: () => e.metadata.routes.map((r) => ({
|
|
1577
|
-
resource:
|
|
1639
|
+
resource: ne(r, e.routeResourceKind)
|
|
1578
1640
|
}))
|
|
1579
1641
|
}), e.workbench.resources.registerPresenter({
|
|
1580
1642
|
id: "workbench.extension.routes",
|
|
1581
|
-
canOpen: (r) => r.kind === e.routeResourceKind && !!
|
|
1582
|
-
open: (r,
|
|
1583
|
-
const
|
|
1584
|
-
return e.workbench.layout.openPanel(
|
|
1585
|
-
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 ? {
|
|
1586
1648
|
kind: "replace-active"
|
|
1587
1649
|
} : {
|
|
1588
|
-
kind: "
|
|
1650
|
+
kind: "persistent"
|
|
1589
1651
|
},
|
|
1590
|
-
title:
|
|
1652
|
+
title: u(o.label, o.id)
|
|
1591
1653
|
});
|
|
1592
1654
|
}
|
|
1593
1655
|
})), t;
|
|
1594
|
-
},
|
|
1656
|
+
}, Tr = {
|
|
1595
1657
|
"workbench.left.tree": "sidenav",
|
|
1596
1658
|
"workbench.main.left.tree": "main-left-menu",
|
|
1597
1659
|
"workbench.main.right.tree": "main-right-menu"
|
|
1598
|
-
},
|
|
1660
|
+
}, Sr = (e) => e ? Tr[e] ?? "sidenav" : "sidenav", Wr = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, jr = (e, t) => {
|
|
1599
1661
|
if (t.action.kind === "kanbanRenderer") return {
|
|
1600
1662
|
kind: "panel",
|
|
1601
1663
|
panelId: t.action.kanbanRendererId
|
|
1602
1664
|
};
|
|
1603
1665
|
const r = t.action;
|
|
1604
1666
|
if (r.kind === "route") {
|
|
1605
|
-
const
|
|
1606
|
-
return
|
|
1667
|
+
const n = e.metadata.routes.find((o) => o.id === r.route);
|
|
1668
|
+
return n ? {
|
|
1607
1669
|
kind: "resource",
|
|
1608
|
-
resource:
|
|
1670
|
+
resource: ne(n, e.routeResourceKind)
|
|
1609
1671
|
} : void 0;
|
|
1610
1672
|
}
|
|
1611
1673
|
return r.kind === "command" ? {
|
|
@@ -1619,15 +1681,15 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
1619
1681
|
href: r.href
|
|
1620
1682
|
}
|
|
1621
1683
|
};
|
|
1622
|
-
},
|
|
1684
|
+
}, Kr = (e) => {
|
|
1623
1685
|
const t = e.metadata.treeItems ?? [];
|
|
1624
1686
|
if (t.length === 0) return [];
|
|
1625
|
-
const r = [],
|
|
1626
|
-
for (const
|
|
1627
|
-
for (const [
|
|
1628
|
-
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}`;
|
|
1629
1691
|
r.push(e.workbench.renderers.registerTreeRenderer({
|
|
1630
|
-
id:
|
|
1692
|
+
id: i,
|
|
1631
1693
|
title: "Extensions",
|
|
1632
1694
|
getChildren: (d) => d.children ?? [],
|
|
1633
1695
|
getBody: () => [{
|
|
@@ -1635,286 +1697,310 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
|
|
|
1635
1697
|
label: "Extensions",
|
|
1636
1698
|
nodes: s.map((d) => ({
|
|
1637
1699
|
id: d.id,
|
|
1638
|
-
label:
|
|
1700
|
+
label: u(d.label, d.id),
|
|
1639
1701
|
icon: d.icon,
|
|
1640
|
-
target:
|
|
1702
|
+
target: jr(e, d)
|
|
1641
1703
|
}))
|
|
1642
1704
|
}]
|
|
1643
1705
|
}), e.workbench.layout.registerPanel({
|
|
1644
1706
|
closable: !1,
|
|
1645
|
-
id:
|
|
1707
|
+
id: i,
|
|
1646
1708
|
title: "Extensions",
|
|
1647
|
-
region:
|
|
1648
|
-
rendererId:
|
|
1709
|
+
region: Sr(o),
|
|
1710
|
+
rendererId: i,
|
|
1649
1711
|
singleton: !0
|
|
1650
1712
|
}));
|
|
1651
1713
|
}
|
|
1652
|
-
for (const
|
|
1653
|
-
const s =
|
|
1714
|
+
for (const o of t.filter((s) => s.action.kind === "href")) {
|
|
1715
|
+
const s = o.action;
|
|
1654
1716
|
s.kind === "href" && r.push(e.workbench.commands.registerCommand({
|
|
1655
|
-
id: `workbench.extension.href.${
|
|
1656
|
-
label:
|
|
1717
|
+
id: `workbench.extension.href.${o.id}`,
|
|
1718
|
+
label: u(o.label, o.id)
|
|
1657
1719
|
}, {
|
|
1658
|
-
execute: (
|
|
1720
|
+
execute: (i) => e.openHref?.(Wr(i)?.href ?? s.href)
|
|
1659
1721
|
}));
|
|
1660
1722
|
}
|
|
1661
1723
|
return r;
|
|
1662
|
-
},
|
|
1724
|
+
}, ee = "extension-route", Mr = "extensions", Dr = (e) => {
|
|
1663
1725
|
for (let t = e.length - 1; t >= 0; t -= 1) e[t]?.dispose();
|
|
1664
|
-
},
|
|
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) => ({
|
|
1665
1727
|
...e(r),
|
|
1666
1728
|
...t(r)
|
|
1667
|
-
}) : e,
|
|
1668
|
-
const r = e.createWebviewHostCapabilities ??
|
|
1729
|
+
}) : e, Le = (e, t) => {
|
|
1730
|
+
const r = e.createWebviewHostCapabilities ?? Ar({
|
|
1669
1731
|
executeCommand: e.executeCommand,
|
|
1670
1732
|
files: e.webviewFiles,
|
|
1671
1733
|
projectId: e.projectId,
|
|
1672
1734
|
slotKind: t
|
|
1673
1735
|
});
|
|
1674
|
-
return
|
|
1675
|
-
},
|
|
1676
|
-
e.workbench.renderers.getRenderer(
|
|
1677
|
-
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"),
|
|
1678
1740
|
createProps: e.createWebviewProps,
|
|
1679
1741
|
createTheme: e.createWebviewTheme
|
|
1680
1742
|
})));
|
|
1681
|
-
},
|
|
1743
|
+
}, Or = (e, t) => t.commands.map((r) => e.workbench.commands.registerCommand({
|
|
1682
1744
|
id: r.id,
|
|
1683
|
-
label:
|
|
1684
|
-
description:
|
|
1745
|
+
label: u(r.title, r.id),
|
|
1746
|
+
description: u(r.description),
|
|
1685
1747
|
params: r.params
|
|
1686
1748
|
}, {
|
|
1687
|
-
execute: (
|
|
1688
|
-
params:
|
|
1689
|
-
resource:
|
|
1749
|
+
execute: (n, o) => k(e, r.id, {
|
|
1750
|
+
params: oe(n),
|
|
1751
|
+
resource: o?.resource
|
|
1690
1752
|
})
|
|
1691
|
-
})),
|
|
1753
|
+
})), Oe = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), Vr = (e, t) => e.menuSlotsById ? Vt({
|
|
1692
1754
|
metadata: e.metadata,
|
|
1693
1755
|
menuSlotsById: e.menuSlotsById,
|
|
1694
1756
|
menuTargetsById: e.menuTargetsById,
|
|
1695
1757
|
createWhenExpression: e.createMenuWhenExpression
|
|
1696
|
-
}).flatMap((
|
|
1697
|
-
execute: (
|
|
1758
|
+
}).flatMap((n) => [e.workbench.commands.registerCommand(n.command, {
|
|
1759
|
+
execute: (o, s) => k(t, n.targetCommandId, {
|
|
1698
1760
|
params: {
|
|
1699
|
-
...
|
|
1700
|
-
...
|
|
1761
|
+
...n.contribution.params ?? {},
|
|
1762
|
+
...oe(o) ?? {}
|
|
1701
1763
|
},
|
|
1702
|
-
resource:
|
|
1703
|
-
slot:
|
|
1704
|
-
id:
|
|
1764
|
+
resource: Oe(e, s),
|
|
1765
|
+
slot: M({
|
|
1766
|
+
id: n.contribution.slotId,
|
|
1705
1767
|
kind: "menu",
|
|
1706
1768
|
projectId: e.projectId,
|
|
1707
1769
|
context: {
|
|
1708
|
-
panelId:
|
|
1770
|
+
panelId: n.contribution.id
|
|
1709
1771
|
}
|
|
1710
1772
|
})
|
|
1711
1773
|
})
|
|
1712
|
-
}), e.workbench.layout.registerMenuItem(
|
|
1774
|
+
}), e.workbench.layout.registerMenuItem(n.menuPath, n.menuItem)]) : [], Fr = (e, t) => Ft({
|
|
1713
1775
|
metadata: e.metadata
|
|
1714
|
-
}).flatMap((
|
|
1715
|
-
execute: (
|
|
1776
|
+
}).flatMap((n) => [e.workbench.commands.registerCommand(n.command, {
|
|
1777
|
+
execute: (o, s) => k(t, n.targetCommandId, {
|
|
1716
1778
|
params: {
|
|
1717
|
-
...
|
|
1718
|
-
...
|
|
1779
|
+
...n.contribution.params ?? {},
|
|
1780
|
+
...oe(o) ?? {}
|
|
1719
1781
|
},
|
|
1720
|
-
resource:
|
|
1721
|
-
slot:
|
|
1782
|
+
resource: Oe(e, s),
|
|
1783
|
+
slot: M({
|
|
1722
1784
|
id: "workbench.commandPalette",
|
|
1723
1785
|
kind: "menu",
|
|
1724
1786
|
projectId: e.projectId,
|
|
1725
1787
|
context: {
|
|
1726
|
-
panelId:
|
|
1788
|
+
panelId: n.contribution.id
|
|
1727
1789
|
}
|
|
1728
1790
|
})
|
|
1729
1791
|
}),
|
|
1730
|
-
isVisible: () =>
|
|
1731
|
-
}), e.workbench.layout.registerMenuItem(
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
...
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
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
|
+
}
|
|
1750
1819
|
}
|
|
1751
|
-
}
|
|
1752
|
-
}
|
|
1753
|
-
const t = [], r = e.settingsSectionId ??
|
|
1820
|
+
})] : []);
|
|
1821
|
+
}, Ur = (e) => {
|
|
1822
|
+
const t = [], r = e.settingsSectionId ?? Mr;
|
|
1754
1823
|
e.workbench.settings.getSection(r) || t.push(e.workbench.settings.registerSection({
|
|
1755
1824
|
id: r,
|
|
1756
1825
|
title: e.settingsSectionTitle ?? "Extensions"
|
|
1757
1826
|
}));
|
|
1758
|
-
const
|
|
1759
|
-
type:
|
|
1760
|
-
scope:
|
|
1761
|
-
default:
|
|
1762
|
-
enum:
|
|
1763
|
-
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)
|
|
1764
1833
|
}]));
|
|
1765
|
-
Object.keys(
|
|
1766
|
-
properties:
|
|
1834
|
+
Object.keys(n).length > 0 && t.push(e.workbench.preferences.registerSchema({
|
|
1835
|
+
properties: n
|
|
1767
1836
|
}));
|
|
1768
|
-
for (const
|
|
1837
|
+
for (const o of e.metadata.settingsPanels)
|
|
1769
1838
|
t.push(e.workbench.settings.registerPanel({
|
|
1770
|
-
id:
|
|
1771
|
-
title:
|
|
1839
|
+
id: o.id,
|
|
1840
|
+
title: u(o.title, o.id),
|
|
1772
1841
|
kind: "custom",
|
|
1773
1842
|
section: r,
|
|
1774
|
-
scope:
|
|
1775
|
-
render: (s) =>
|
|
1843
|
+
scope: o.scope,
|
|
1844
|
+
render: (s) => Se({
|
|
1776
1845
|
context: {
|
|
1777
1846
|
workbench: s.workbench,
|
|
1778
|
-
webviewId:
|
|
1847
|
+
webviewId: o.id,
|
|
1779
1848
|
placement: {
|
|
1780
1849
|
...s.instance,
|
|
1781
|
-
panelId:
|
|
1850
|
+
panelId: o.id
|
|
1782
1851
|
},
|
|
1783
|
-
hostEvents:
|
|
1852
|
+
hostEvents: Te(s.workbench, s.instance)
|
|
1784
1853
|
},
|
|
1785
|
-
createHostCapabilities:
|
|
1854
|
+
createHostCapabilities: Le(e, "settings"),
|
|
1786
1855
|
createProps: e.createWebviewProps ?? (({
|
|
1787
|
-
placement:
|
|
1856
|
+
placement: i
|
|
1788
1857
|
}) => ({
|
|
1789
|
-
placement:
|
|
1790
|
-
resource:
|
|
1858
|
+
placement: i,
|
|
1859
|
+
resource: i.resource
|
|
1791
1860
|
})),
|
|
1792
1861
|
createTheme: e.createWebviewTheme,
|
|
1793
|
-
ownerId:
|
|
1794
|
-
title:
|
|
1795
|
-
webview:
|
|
1862
|
+
ownerId: o.extensionId,
|
|
1863
|
+
title: u(o.title, o.id),
|
|
1864
|
+
webview: _(o.webview)
|
|
1796
1865
|
})
|
|
1797
1866
|
}));
|
|
1798
1867
|
return t;
|
|
1799
|
-
},
|
|
1868
|
+
}, _r = (e) => {
|
|
1800
1869
|
const t = /* @__PURE__ */ new Set();
|
|
1801
|
-
for (const
|
|
1802
|
-
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);
|
|
1803
1872
|
const r = [];
|
|
1804
|
-
for (const
|
|
1805
|
-
e.workbench.resources.getKind(
|
|
1806
|
-
kind:
|
|
1807
|
-
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,
|
|
1808
1877
|
icon: "FileText",
|
|
1809
1878
|
surface: "primary"
|
|
1810
1879
|
}));
|
|
1811
|
-
const
|
|
1812
|
-
|
|
1813
|
-
id: `workbench.extension.resource.${
|
|
1814
|
-
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,
|
|
1815
1884
|
open: (s) => {
|
|
1816
|
-
const
|
|
1885
|
+
const i = o.map((d) => e.workbench.layout.openPanel(d.id, {
|
|
1817
1886
|
resource: s,
|
|
1818
|
-
title: s.label ?? s.id ?? s.uri
|
|
1887
|
+
title: s.label ?? s.id ?? s.uri,
|
|
1888
|
+
strategy: {
|
|
1889
|
+
kind: "persistent"
|
|
1890
|
+
}
|
|
1819
1891
|
}));
|
|
1820
|
-
return
|
|
1892
|
+
return i.find((d, c) => o[c]?.region === "main") ?? i[0];
|
|
1821
1893
|
}
|
|
1822
1894
|
}));
|
|
1823
1895
|
}
|
|
1824
1896
|
return r;
|
|
1825
|
-
},
|
|
1826
|
-
|
|
1897
|
+
}, qr = (e, t) => {
|
|
1898
|
+
if (!t.panel) return;
|
|
1899
|
+
e.layout.openPanel(t.panel, {
|
|
1827
1900
|
region: t.region,
|
|
1828
1901
|
pinned: t.pinned,
|
|
1829
|
-
title:
|
|
1830
|
-
|
|
1831
|
-
|
|
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) => {
|
|
1832
1908
|
if (!r.resource) return;
|
|
1833
|
-
const
|
|
1834
|
-
|
|
1835
|
-
},
|
|
1836
|
-
for (const
|
|
1837
|
-
|
|
1838
|
-
},
|
|
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({
|
|
1839
1915
|
id: t.modeId,
|
|
1840
|
-
label:
|
|
1916
|
+
label: u(t.label, t.modeId),
|
|
1841
1917
|
panels: t.layout?.panels,
|
|
1842
1918
|
activate: () => {
|
|
1843
1919
|
},
|
|
1844
1920
|
seed: (r) => {
|
|
1845
|
-
|
|
1921
|
+
Qr(e, r, t);
|
|
1846
1922
|
}
|
|
1847
|
-
})),
|
|
1923
|
+
})), pn = (e) => {
|
|
1848
1924
|
const t = [], r = e;
|
|
1849
|
-
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({
|
|
1850
1926
|
metadata: e.metadata,
|
|
1851
|
-
routeResourceKind: e.routeResourceKind ??
|
|
1927
|
+
routeResourceKind: e.routeResourceKind ?? ee,
|
|
1852
1928
|
workbench: e.workbench
|
|
1853
|
-
})), t.push(...
|
|
1929
|
+
})), t.push(...Kr({
|
|
1854
1930
|
metadata: e.metadata,
|
|
1855
1931
|
openHref: e.openHref,
|
|
1856
|
-
routeResourceKind: e.routeResourceKind ??
|
|
1932
|
+
routeResourceKind: e.routeResourceKind ?? ee,
|
|
1857
1933
|
workbench: e.workbench
|
|
1858
|
-
})), t.push(...
|
|
1934
|
+
})), t.push(..._r(e)), t.push(...Gr(e)), {
|
|
1859
1935
|
dispose() {
|
|
1860
|
-
|
|
1936
|
+
Dr(t);
|
|
1861
1937
|
}
|
|
1862
1938
|
};
|
|
1863
|
-
},
|
|
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) => {
|
|
1864
1940
|
if (t)
|
|
1865
1941
|
try {
|
|
1866
1942
|
e.layout.activatePanel(t);
|
|
1867
1943
|
} catch {
|
|
1868
1944
|
}
|
|
1869
|
-
},
|
|
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) => {
|
|
1870
1946
|
const r = e.layout.getLayout().activeWidgetId;
|
|
1871
|
-
for (const
|
|
1872
|
-
if (!
|
|
1873
|
-
const
|
|
1874
|
-
|
|
1875
|
-
resource:
|
|
1876
|
-
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
|
+
}
|
|
1877
1957
|
});
|
|
1878
1958
|
}
|
|
1879
|
-
for (const
|
|
1880
|
-
if (!
|
|
1881
|
-
const
|
|
1882
|
-
|
|
1883
|
-
resource:
|
|
1884
|
-
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
|
+
}
|
|
1885
1969
|
});
|
|
1886
1970
|
}
|
|
1887
|
-
|
|
1888
|
-
},
|
|
1889
|
-
if (
|
|
1890
|
-
for (const
|
|
1891
|
-
if (
|
|
1892
|
-
for (const
|
|
1893
|
-
if (
|
|
1894
|
-
for (const
|
|
1895
|
-
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);
|
|
1896
1980
|
};
|
|
1897
1981
|
export {
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
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
|
|
1919
2005
|
};
|
|
1920
2006
|
//# sourceMappingURL=extensions.js.map
|