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