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