@pstdio/workbench 0.43.1 → 0.44.0-nightly.20261015030224
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 +27 -8
- package/dist/extensions.js +482 -413
- package/dist/extensions.js.map +1 -1
- package/dist/{file-renderer-view-BRBYhjKd.js → file-renderer-view-B93kU2ZC.js} +217 -216
- package/dist/file-renderer-view-B93kU2ZC.js.map +1 -0
- package/dist/{index-onoay_1m.d.ts → index-CYWM-xe_.d.ts} +22 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.js +717 -651
- package/dist/index.js.map +1 -1
- package/dist/{kanban-presentation-DO5U25GX.d.ts → kanban-presentation-BwUNb4SN.d.ts} +1 -1
- package/dist/{react-BsyyXmgz.js → react-DITDrArT.js} +2763 -2638
- package/dist/react-DITDrArT.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-DITDrArT.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,32 @@ 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) => w(i, {
|
|
964
1025
|
name: e ?? "MoreHorizontal",
|
|
965
1026
|
...t
|
|
966
|
-
}),
|
|
1027
|
+
}), yt = (e, t) => ({
|
|
967
1028
|
color: e?.color,
|
|
968
1029
|
canDragIn: e?.canDragIn,
|
|
969
1030
|
canDragOut: e?.canDragOut,
|
|
@@ -971,12 +1032,12 @@ var Le = (e) => {
|
|
|
971
1032
|
actions: e?.actions?.map((e) => ({
|
|
972
1033
|
id: e.id,
|
|
973
1034
|
label: t(e.label, e.id),
|
|
974
|
-
icon:
|
|
1035
|
+
icon: vt(e.icon)
|
|
975
1036
|
}))
|
|
976
|
-
}),
|
|
1037
|
+
}), bt = (e, t) => `${t.extensionId ?? e.extensionId}.status.${t.id}`, xt = (e, t) => {
|
|
977
1038
|
let n = /* @__PURE__ */ new Map();
|
|
978
1039
|
return (r) => {
|
|
979
|
-
let i =
|
|
1040
|
+
let i = bt(t, r), a = n.get(i);
|
|
980
1041
|
if (a) return a;
|
|
981
1042
|
let o = {
|
|
982
1043
|
getSnapshot: () => (e.workbench.statuses.getStatuses(i) ?? []).map((e) => ({
|
|
@@ -989,12 +1050,12 @@ var Le = (e) => {
|
|
|
989
1050
|
};
|
|
990
1051
|
return n.set(i, o), e.workbench.statuses.load(i).catch(() => void 0), o;
|
|
991
1052
|
};
|
|
992
|
-
},
|
|
1053
|
+
}, St = (e, t, n, r, i) => {
|
|
993
1054
|
let a = n?.find((e) => e.id === r);
|
|
994
1055
|
if (a?.type.kind !== "status") return;
|
|
995
|
-
let o =
|
|
1056
|
+
let o = bt(t, a.type.statuses), s = e.workbench.statuses.getStatuses(o)?.find((e) => e.id === i);
|
|
996
1057
|
return s ? { color: s.color } : void 0;
|
|
997
|
-
},
|
|
1058
|
+
}, H = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ct = (e, t, n, r, i, a) => (t ?? []).map((t) => {
|
|
998
1059
|
let o = t.display, s = o?.kind === "badge-list" && typeof o.itemsAttributeId == "string" ? {
|
|
999
1060
|
kind: "badge-list",
|
|
1000
1061
|
itemsAttributeId: o.itemsAttributeId
|
|
@@ -1019,8 +1080,8 @@ var Le = (e) => {
|
|
|
1019
1080
|
type: c(),
|
|
1020
1081
|
display: s
|
|
1021
1082
|
});
|
|
1022
|
-
}),
|
|
1023
|
-
let o =
|
|
1083
|
+
}), wt = (e, t, n, r, i = () => [], a) => {
|
|
1084
|
+
let o = Ct(e, t, n, r, i, a), s = /* @__PURE__ */ new Set(), c = JSON.stringify(t);
|
|
1024
1085
|
return {
|
|
1025
1086
|
source: {
|
|
1026
1087
|
getSnapshot: () => o,
|
|
@@ -1029,29 +1090,29 @@ var Le = (e) => {
|
|
|
1029
1090
|
set(t) {
|
|
1030
1091
|
let l = JSON.stringify(t);
|
|
1031
1092
|
if (l !== c) {
|
|
1032
|
-
c = l, o =
|
|
1093
|
+
c = l, o = Ct(e, t, n, r, i, a);
|
|
1033
1094
|
for (let e of s) e();
|
|
1034
1095
|
}
|
|
1035
1096
|
}
|
|
1036
1097
|
};
|
|
1037
|
-
},
|
|
1098
|
+
}, Tt = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), Et = (e, t) => {
|
|
1038
1099
|
let { resource: n } = t;
|
|
1039
|
-
if (
|
|
1040
|
-
},
|
|
1041
|
-
let n =
|
|
1100
|
+
if (Tt(n)) return n;
|
|
1101
|
+
}, Dt = (e, t) => {
|
|
1102
|
+
let n = Et(e, t);
|
|
1042
1103
|
if (n) return n;
|
|
1043
1104
|
if (e.resourceKind) return {
|
|
1044
1105
|
type: e.resourceKind,
|
|
1045
1106
|
id: t.id,
|
|
1046
1107
|
label: t.title
|
|
1047
1108
|
};
|
|
1048
|
-
},
|
|
1109
|
+
}, Ot = (e, t) => {
|
|
1049
1110
|
let n = e, r = t(n);
|
|
1050
1111
|
return r === void 0 ? n : {
|
|
1051
1112
|
...n,
|
|
1052
1113
|
resource: r
|
|
1053
1114
|
};
|
|
1054
|
-
},
|
|
1115
|
+
}, kt = (...e) => Object.assign({}, ...e.filter((e) => !!e)), At = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, jt = (e) => Object.keys(e ?? {}).length > 0, Mt = /* @__PURE__ */ new Set([
|
|
1055
1116
|
"text",
|
|
1056
1117
|
"longtext",
|
|
1057
1118
|
"markdown",
|
|
@@ -1060,8 +1121,8 @@ var Le = (e) => {
|
|
|
1060
1121
|
"select",
|
|
1061
1122
|
"multi-select",
|
|
1062
1123
|
"files"
|
|
1063
|
-
]),
|
|
1064
|
-
if (!
|
|
1124
|
+
]), Nt = (e, t, n) => {
|
|
1125
|
+
if (!Mt.has(t.type)) return;
|
|
1065
1126
|
let r = "options" in t && Array.isArray(t.options) ? t.options : [], i = t;
|
|
1066
1127
|
return {
|
|
1067
1128
|
id: e,
|
|
@@ -1079,55 +1140,56 @@ var Le = (e) => {
|
|
|
1079
1140
|
multiple: t.type === "files" ? i.multiple !== !1 : void 0,
|
|
1080
1141
|
accept: t.type === "files" && typeof i.accept == "string" ? i.accept : void 0
|
|
1081
1142
|
};
|
|
1082
|
-
},
|
|
1083
|
-
let r =
|
|
1143
|
+
}, Pt = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([e, n]) => {
|
|
1144
|
+
let r = Nt(e, n, t);
|
|
1084
1145
|
return r ? [r] : [];
|
|
1085
|
-
}),
|
|
1146
|
+
}), Ft = (e, t) => I({
|
|
1086
1147
|
id: t.id,
|
|
1087
1148
|
kind: "kanbanRenderer",
|
|
1088
1149
|
projectId: e.projectId,
|
|
1089
1150
|
context: { kanbanRendererId: t.id }
|
|
1090
|
-
}),
|
|
1091
|
-
let
|
|
1151
|
+
}), U = (e, t, n, r, i, a, o) => {
|
|
1152
|
+
let s = i ?? e.workbench.getPrimaryResource();
|
|
1092
1153
|
return R(e, n, {
|
|
1093
1154
|
params: {
|
|
1094
1155
|
renderer: {
|
|
1095
1156
|
rendererId: t.id,
|
|
1157
|
+
...o ? { pageParams: o } : {},
|
|
1096
1158
|
projectId: e.projectId,
|
|
1097
|
-
...
|
|
1159
|
+
...s ? { resource: s } : {},
|
|
1098
1160
|
invocation: { placement: "visible" }
|
|
1099
1161
|
},
|
|
1100
1162
|
...r
|
|
1101
1163
|
},
|
|
1102
|
-
resource:
|
|
1164
|
+
resource: s,
|
|
1103
1165
|
signal: a,
|
|
1104
|
-
slot:
|
|
1166
|
+
slot: Ft(e, t),
|
|
1105
1167
|
metadata: { kanbanRendererId: t.id }
|
|
1106
1168
|
});
|
|
1107
|
-
},
|
|
1169
|
+
}, It = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, Lt = (e, t, n) => (t.rowActions ?? []).map((r) => {
|
|
1108
1170
|
let i = e.workbench.commands.getCommand(r.commandId)?.command;
|
|
1109
1171
|
return e.workbench.commands.registerCommand({
|
|
1110
|
-
id:
|
|
1172
|
+
id: It(t, r),
|
|
1111
1173
|
label: n(r.label, r.id),
|
|
1112
1174
|
icon: r.icon,
|
|
1113
1175
|
params: i?.params
|
|
1114
|
-
}, { execute: (n, i) =>
|
|
1115
|
-
}),
|
|
1116
|
-
let o =
|
|
1117
|
-
return s &&
|
|
1176
|
+
}, { execute: (n, i) => U(e, t, r.commandId, kt(At(n)), i?.resource) });
|
|
1177
|
+
}), Rt = (e, t, n, r, i, a) => {
|
|
1178
|
+
let o = It(t, n), s = e.workbench.commands.getCommand(o), c = { rowId: r.id }, l = i ? { resource: i } : void 0, u = a(n.label, n.id);
|
|
1179
|
+
return s && jt(s.command.params) ? (e.workbench.commandPalette.requestParams({
|
|
1118
1180
|
record: s,
|
|
1119
1181
|
label: u,
|
|
1120
1182
|
args: c,
|
|
1121
1183
|
context: l
|
|
1122
|
-
}), Promise.resolve()) : s ? e.workbench.commands.executeCommand(s.command.id, c, l).then(() => void 0) :
|
|
1123
|
-
},
|
|
1184
|
+
}), 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);
|
|
1185
|
+
}, zt = (e) => e ? w(i, {
|
|
1124
1186
|
name: e,
|
|
1125
1187
|
size: 16
|
|
1126
|
-
}) : void 0,
|
|
1188
|
+
}) : void 0, Bt = (e, t) => {
|
|
1127
1189
|
if (e.createRow) return {
|
|
1128
1190
|
title: t(e.createRow.title, "Create row"),
|
|
1129
1191
|
submitLabel: t(e.createRow.submitLabel, "Create"),
|
|
1130
|
-
fields:
|
|
1192
|
+
fields: Pt(e, t),
|
|
1131
1193
|
labels: {
|
|
1132
1194
|
cancel: t(e.createRow.labels?.cancel, "Cancel"),
|
|
1133
1195
|
properties: t(e.createRow.labels?.properties, "Properties"),
|
|
@@ -1136,20 +1198,20 @@ var Le = (e) => {
|
|
|
1136
1198
|
submitWithoutOpening: t(void 0, "Create without opening")
|
|
1137
1199
|
}
|
|
1138
1200
|
};
|
|
1139
|
-
},
|
|
1201
|
+
}, Vt = (e, t, n, r, i) => {
|
|
1140
1202
|
if (t.rowActivationHandlerId) return async (n) => {
|
|
1141
1203
|
let a = r(t, n);
|
|
1142
|
-
await
|
|
1204
|
+
await U(e, t, t.rowActivationHandlerId, { row: i(n) }, a);
|
|
1143
1205
|
};
|
|
1144
1206
|
if (n.onRowClick) return (e) => n.onRowClick?.({
|
|
1145
1207
|
record: t,
|
|
1146
1208
|
row: e,
|
|
1147
1209
|
resource: r(t, e)
|
|
1148
1210
|
});
|
|
1149
|
-
},
|
|
1211
|
+
}, Ht = (e, t, n, r) => {
|
|
1150
1212
|
let i = e.createRow;
|
|
1151
1213
|
if (i) return async (a) => {
|
|
1152
|
-
let o =
|
|
1214
|
+
let o = kt(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
1215
|
if (await t.onAfterCreate?.({
|
|
1154
1216
|
record: e,
|
|
1155
1217
|
created: s,
|
|
@@ -1163,15 +1225,15 @@ var Le = (e) => {
|
|
|
1163
1225
|
attributes: c.attributes ?? {}
|
|
1164
1226
|
});
|
|
1165
1227
|
};
|
|
1166
|
-
},
|
|
1228
|
+
}, Ut = (e, t, n, r, i) => {
|
|
1167
1229
|
let a = t.rowActions;
|
|
1168
1230
|
if (a?.length) return (o) => a.map((a) => {
|
|
1169
|
-
let s = i(t, o), c = () =>
|
|
1231
|
+
let s = i(t, o), c = () => Rt(e, t, a, o, s, r);
|
|
1170
1232
|
return {
|
|
1171
1233
|
key: a.id,
|
|
1172
1234
|
label: r(a.label, a.id),
|
|
1173
1235
|
commandId: a.commandId,
|
|
1174
|
-
icon:
|
|
1236
|
+
icon: zt(a.icon),
|
|
1175
1237
|
onClick: () => n.executeRowAction ? n.executeRowAction({
|
|
1176
1238
|
record: t,
|
|
1177
1239
|
action: a,
|
|
@@ -1181,29 +1243,29 @@ var Le = (e) => {
|
|
|
1181
1243
|
}) : c()
|
|
1182
1244
|
};
|
|
1183
1245
|
});
|
|
1184
|
-
},
|
|
1246
|
+
}, Wt = (e, t, n = {}) => {
|
|
1185
1247
|
let r = [], i = n.resolveLabel ?? ((e, t) => P(e, t)), o = (e, t) => {
|
|
1186
1248
|
let r = t.display?.kind === "badge-list" ? {
|
|
1187
1249
|
...t,
|
|
1188
|
-
render: (e, n) =>
|
|
1250
|
+
render: (e, n) => O(t, e, n)
|
|
1189
1251
|
} : t;
|
|
1190
1252
|
return n.decorateAttribute?.(e, r) ?? r;
|
|
1191
|
-
}, s = n.resolveRowResource ??
|
|
1253
|
+
}, s = n.resolveRowResource ?? Et, c = n.resolveRowActionResource ?? Dt, l = n.onAfterMutation ?? (() => {}), u = (t, n, r) => U(e, t, n, r).then((e) => (l(t), e));
|
|
1192
1254
|
for (let l of t) {
|
|
1193
|
-
let t =
|
|
1255
|
+
let t = xt(e, l), d = wt(l, l.attributes, i, o, t, (t, n) => e.workbench.notifications.show({
|
|
1194
1256
|
id: `workbench.extension.${l.extensionId}.kanban.${l.id}.display.${t}`,
|
|
1195
1257
|
level: "error",
|
|
1196
1258
|
title: "Extension display is not available",
|
|
1197
1259
|
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(...
|
|
1260
|
+
})), 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 = Vt(e, l, n, s, (e) => h.get(e) ?? e);
|
|
1261
|
+
r.push(...Lt(e, l, i)), r.push(e.workbench.views.registerView({
|
|
1200
1262
|
id: l.id,
|
|
1201
1263
|
title: i(l.title, l.id),
|
|
1202
1264
|
icon: l.icon,
|
|
1203
1265
|
body: {
|
|
1204
1266
|
kind: "kanban",
|
|
1205
1267
|
resourceKind: l.resourceKind,
|
|
1206
|
-
toolbarActions:
|
|
1268
|
+
toolbarActions: Xe(l),
|
|
1207
1269
|
listRowActions: () => (l.rowActions ?? []).map((e) => ({
|
|
1208
1270
|
commandId: e.commandId,
|
|
1209
1271
|
label: i(e.label, e.id)
|
|
@@ -1222,22 +1284,22 @@ var Le = (e) => {
|
|
|
1222
1284
|
emptyTitle: i(l.emptyTitle, ""),
|
|
1223
1285
|
emptyDescription: i(l.emptyDescription, ""),
|
|
1224
1286
|
hideToolbar: l.hideToolbar,
|
|
1225
|
-
createRow:
|
|
1226
|
-
getBoardColumnConfig: (t) =>
|
|
1287
|
+
createRow: Bt(l, i),
|
|
1288
|
+
getBoardColumnConfig: (t) => yt(g?.[t] ?? St(e, l, f, m, t), i),
|
|
1227
1289
|
onRowActivate: b,
|
|
1228
1290
|
executeQuery: async (t, n) => {
|
|
1229
1291
|
_ += 1;
|
|
1230
|
-
let r = _, i = await
|
|
1292
|
+
let r = _, i = await U(e, l, l.queryHandlerId, {
|
|
1231
1293
|
settings: {
|
|
1232
1294
|
...t.settings,
|
|
1233
|
-
ordering:
|
|
1295
|
+
ordering: re(t.sorts)
|
|
1234
1296
|
},
|
|
1235
1297
|
filter: t.filter,
|
|
1236
1298
|
sorts: t.sorts,
|
|
1237
|
-
filters:
|
|
1238
|
-
}, void 0, n), a = (e) => {
|
|
1299
|
+
filters: A(t.filter)
|
|
1300
|
+
}, void 0, n, t.pageParams), a = (e) => {
|
|
1239
1301
|
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 :
|
|
1302
|
+
let n = e, r = JSON.stringify(e), i = v.get(n.id), a = i?.signature === r ? i.row : Ot(e, y);
|
|
1241
1303
|
return h.set(a, n), t.set(a.id, {
|
|
1242
1304
|
signature: r,
|
|
1243
1305
|
row: a
|
|
@@ -1245,9 +1307,9 @@ var Le = (e) => {
|
|
|
1245
1307
|
});
|
|
1246
1308
|
return r === _ && (v = t), n;
|
|
1247
1309
|
};
|
|
1248
|
-
if (r !== _) return Array.isArray(i) ? a(i) :
|
|
1310
|
+
if (r !== _) return Array.isArray(i) ? a(i) : H(i) ? a(i.rows ?? []) : [];
|
|
1249
1311
|
if (m = t.settings.columnGrouping, Array.isArray(i)) return a(i);
|
|
1250
|
-
if (!
|
|
1312
|
+
if (!H(i)) return [];
|
|
1251
1313
|
let o = i.attributes ?? f;
|
|
1252
1314
|
return f = o, d.set(o), g = i.boardColumnConfigs, a(i.rows ?? []);
|
|
1253
1315
|
},
|
|
@@ -1261,21 +1323,21 @@ var Le = (e) => {
|
|
|
1261
1323
|
rowId: e,
|
|
1262
1324
|
beforeRowId: t
|
|
1263
1325
|
}).then(() => void 0) : void 0,
|
|
1264
|
-
onCreateRow:
|
|
1326
|
+
onCreateRow: Ht(l, n, u, l.rowActivationHandlerId ? b : void 0),
|
|
1265
1327
|
onColumnAction: l.columnActionHandlerId ? async (e, t) => {
|
|
1266
1328
|
await u(l, l.columnActionHandlerId, {
|
|
1267
1329
|
columnId: e,
|
|
1268
1330
|
actionId: t
|
|
1269
1331
|
});
|
|
1270
1332
|
} : void 0,
|
|
1271
|
-
getRowContextMenuActions:
|
|
1333
|
+
getRowContextMenuActions: Ut(e, l, n, i, c)
|
|
1272
1334
|
}
|
|
1273
1335
|
}));
|
|
1274
1336
|
}
|
|
1275
1337
|
return { dispose() {
|
|
1276
1338
|
for (let e = r.length - 1; e >= 0; --e) r[e]?.dispose();
|
|
1277
1339
|
} };
|
|
1278
|
-
},
|
|
1340
|
+
}, Gt = (e) => ({
|
|
1279
1341
|
id: e.treeId,
|
|
1280
1342
|
kind: "renderer",
|
|
1281
1343
|
context: {
|
|
@@ -1287,11 +1349,12 @@ var Le = (e) => {
|
|
|
1287
1349
|
resourceId: e.resource.id
|
|
1288
1350
|
} : {}
|
|
1289
1351
|
}
|
|
1290
|
-
}),
|
|
1352
|
+
}), W = (e, t, n, r) => {
|
|
1291
1353
|
let i = n.resource, a = e.workbench.modes.getActiveModeId();
|
|
1292
1354
|
return {
|
|
1293
1355
|
renderer: {
|
|
1294
1356
|
rendererId: t.id,
|
|
1357
|
+
...n.pageParams ? { pageParams: n.pageParams } : {},
|
|
1295
1358
|
projectId: e.projectId,
|
|
1296
1359
|
...a ? { modeId: a } : {},
|
|
1297
1360
|
...i ? { resource: i } : {},
|
|
@@ -1301,20 +1364,20 @@ var Le = (e) => {
|
|
|
1301
1364
|
...n.filter ? { filter: n.filter } : {},
|
|
1302
1365
|
...r ? { node: r } : {}
|
|
1303
1366
|
};
|
|
1304
|
-
},
|
|
1367
|
+
}, G = async (e, t, n, r, i) => {
|
|
1305
1368
|
let a = r.renderer, o = a?.resource;
|
|
1306
1369
|
return R(e, n, {
|
|
1307
1370
|
params: r,
|
|
1308
1371
|
signal: i,
|
|
1309
1372
|
resource: o,
|
|
1310
|
-
slot:
|
|
1373
|
+
slot: Gt({
|
|
1311
1374
|
modeId: a?.modeId,
|
|
1312
1375
|
projectId: e.projectId,
|
|
1313
1376
|
resource: o,
|
|
1314
1377
|
treeId: t.id
|
|
1315
1378
|
})
|
|
1316
1379
|
});
|
|
1317
|
-
},
|
|
1380
|
+
}, Kt = async (e, t, n, r, i) => {
|
|
1318
1381
|
let a = e.workbench.modes.getActiveModeId();
|
|
1319
1382
|
return R(e, n, {
|
|
1320
1383
|
params: {
|
|
@@ -1328,7 +1391,7 @@ var Le = (e) => {
|
|
|
1328
1391
|
}
|
|
1329
1392
|
},
|
|
1330
1393
|
resource: i,
|
|
1331
|
-
slot:
|
|
1394
|
+
slot: Gt({
|
|
1332
1395
|
modeId: a,
|
|
1333
1396
|
projectId: e.projectId,
|
|
1334
1397
|
resource: i,
|
|
@@ -1336,21 +1399,21 @@ var Le = (e) => {
|
|
|
1336
1399
|
}),
|
|
1337
1400
|
metadata: { treeId: t.id }
|
|
1338
1401
|
});
|
|
1339
|
-
},
|
|
1340
|
-
let { ctx: t, getHostTreeHeaderNodes: n, record: r, treeViews: i } = e, a =
|
|
1402
|
+
}, qt = (e, t) => e.panels.flatMap((e) => [e, ...e.panelMenus ?? []]).filter((e) => e.renderer?.kind === "tree" && e.renderer.id === t.id), Jt = (e, t) => t.viewId ? e.find((e) => e.id === t.viewId) : e.length === 1 ? e[0] : void 0, Yt = async (e) => {
|
|
1403
|
+
let { ctx: t, getHostTreeHeaderNodes: n, record: r, treeViews: i } = e, a = Jt(i, t);
|
|
1341
1404
|
return !a || !("hostTreeHeader" in a) || a.hostTreeHeader !== "default" ? [] : await n?.({
|
|
1342
1405
|
ctx: t,
|
|
1343
1406
|
record: r,
|
|
1344
1407
|
panel: a
|
|
1345
1408
|
}) ?? [];
|
|
1346
|
-
},
|
|
1347
|
-
let { ctx: t, getHostTreeFooterNodes: n, record: r, treeViews: i } = e, a =
|
|
1409
|
+
}, Xt = async (e) => {
|
|
1410
|
+
let { ctx: t, getHostTreeFooterNodes: n, record: r, treeViews: i } = e, a = Jt(i, t);
|
|
1348
1411
|
return !a || !("hostTreeFooter" in a) || a.hostTreeFooter !== "default" ? [] : await n?.({
|
|
1349
1412
|
ctx: t,
|
|
1350
1413
|
record: r,
|
|
1351
1414
|
panel: a
|
|
1352
1415
|
}) ?? [];
|
|
1353
|
-
},
|
|
1416
|
+
}, Zt = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, Qt = (e) => e && !Array.isArray(e) ? e : void 0, $t = (e, t) => {
|
|
1354
1417
|
let n = /* @__PURE__ */ new WeakMap(), r = `workbench.extensionTreeRenderer.${t.id}.command`, i = (t) => e.resolveNodeResource?.(t) ?? t, a = (e) => {
|
|
1355
1418
|
if (e.emptyState) return {
|
|
1356
1419
|
title: P(e.emptyState.title),
|
|
@@ -1381,18 +1444,18 @@ var Le = (e) => {
|
|
|
1381
1444
|
resourceMutation: e.metadata.commands.find((e) => e.id === a)?.resourceMutation,
|
|
1382
1445
|
label: P(n.label),
|
|
1383
1446
|
icon: n.icon,
|
|
1384
|
-
args:
|
|
1447
|
+
args: Qt(n.params),
|
|
1385
1448
|
params: B(n.input, P, t.extensionId),
|
|
1386
1449
|
submitLabel: n.submitLabel,
|
|
1387
1450
|
when: n.when,
|
|
1388
1451
|
disabled: n.disabled,
|
|
1389
1452
|
run: a ? async (o) => {
|
|
1390
|
-
let s =
|
|
1453
|
+
let s = Zt(o, Qt(n.params));
|
|
1391
1454
|
if (n.command?.extensionId === "pstdio") {
|
|
1392
1455
|
await e.workbench.commands.executeCommand(a, s, { resource: r?.resource ?? i.resource });
|
|
1393
1456
|
return;
|
|
1394
1457
|
}
|
|
1395
|
-
await
|
|
1458
|
+
await Kt(e, t, a, s, r?.resource ?? i.resource), i.refresh();
|
|
1396
1459
|
} : void 0
|
|
1397
1460
|
};
|
|
1398
1461
|
}, c = (e, t) => {
|
|
@@ -1436,16 +1499,16 @@ var Le = (e) => {
|
|
|
1436
1499
|
originalNodes: n,
|
|
1437
1500
|
runnerCommandId: r
|
|
1438
1501
|
};
|
|
1439
|
-
},
|
|
1502
|
+
}, K = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "nodes" in e), en = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "id" in e), q = (e, t) => t.length > 0 ? [{
|
|
1440
1503
|
id: e,
|
|
1441
1504
|
nodes: t,
|
|
1442
1505
|
canReorder: !1
|
|
1443
|
-
}] : [],
|
|
1444
|
-
let n =
|
|
1506
|
+
}] : [], tn = (e, t) => {
|
|
1507
|
+
let n = $t(e, t), r = qt(e.metadata, t), i = e.workbench.commands.registerCommand({
|
|
1445
1508
|
id: n.runnerCommandId,
|
|
1446
1509
|
label: `${P(t.title, t.id)} tree command`
|
|
1447
1510
|
}, { execute: async (n) => {
|
|
1448
|
-
let r = n, i = await
|
|
1511
|
+
let r = n, i = await Kt(e, t, r.commandId, r.params, r.resource);
|
|
1449
1512
|
for (let t of e.workbench.views.listViews()) t.body.kind === "file" && e.workbench.views.refreshView(t.id);
|
|
1450
1513
|
return i;
|
|
1451
1514
|
} }), a = e.workbench.views.registerView({
|
|
@@ -1459,35 +1522,35 @@ var Le = (e) => {
|
|
|
1459
1522
|
defaultExpandedNodeIds: t.defaultExpandedNodeIds,
|
|
1460
1523
|
defaultExpandedSectionIds: t.defaultExpandedSectionIds,
|
|
1461
1524
|
getHeader: async (i) => {
|
|
1462
|
-
let a = await
|
|
1525
|
+
let a = await Yt({
|
|
1463
1526
|
ctx: i,
|
|
1464
1527
|
getHostTreeHeaderNodes: e.getHostTreeHeaderNodes,
|
|
1465
1528
|
record: t,
|
|
1466
1529
|
treeViews: r
|
|
1467
1530
|
});
|
|
1468
|
-
if (!t.headerHandlerId) return
|
|
1469
|
-
let o = await
|
|
1470
|
-
return [...
|
|
1531
|
+
if (!t.headerHandlerId) return q(`${t.id}:host-header`, a);
|
|
1532
|
+
let o = await G(e, t, t.headerHandlerId, W(e, t, i), i.signal), s = K(o) ? n.mapSections(o, i) : [];
|
|
1533
|
+
return [...q(`${t.id}:host-header`, a), ...s];
|
|
1471
1534
|
},
|
|
1472
1535
|
getBody: async (r) => {
|
|
1473
|
-
let i = await
|
|
1474
|
-
return
|
|
1536
|
+
let i = await G(e, t, t.bodyHandlerId, W(e, t, r), r.signal);
|
|
1537
|
+
return K(i) ? n.mapSections(i, r) : [];
|
|
1475
1538
|
},
|
|
1476
1539
|
getFooter: async (i) => {
|
|
1477
|
-
let a = await
|
|
1540
|
+
let a = await Xt({
|
|
1478
1541
|
ctx: i,
|
|
1479
1542
|
getHostTreeFooterNodes: e.getHostTreeFooterNodes,
|
|
1480
1543
|
record: t,
|
|
1481
1544
|
treeViews: r
|
|
1482
1545
|
});
|
|
1483
|
-
if (!t.footerHandlerId) return
|
|
1484
|
-
let o = await
|
|
1485
|
-
return [...
|
|
1546
|
+
if (!t.footerHandlerId) return q(`${t.id}:host-footer`, a);
|
|
1547
|
+
let o = await G(e, t, t.footerHandlerId, W(e, t, i), i.signal);
|
|
1548
|
+
return [...K(o) ? n.mapSections(o, i) : [], ...q(`${t.id}:host-footer`, a)];
|
|
1486
1549
|
},
|
|
1487
1550
|
moveNode: t.moveHandlerId ? async (r, i, a) => {
|
|
1488
1551
|
let o = n.originalNodes.get(r), s = i ? n.originalNodes.get(i) : void 0;
|
|
1489
|
-
!o?.canDrag || i && !s?.canDrop || (await
|
|
1490
|
-
...
|
|
1552
|
+
!o?.canDrag || i && !s?.canDrop || (await G(e, t, t.moveHandlerId, {
|
|
1553
|
+
...W(e, t, a),
|
|
1491
1554
|
source: o,
|
|
1492
1555
|
target: s,
|
|
1493
1556
|
position: a.position ?? "inside"
|
|
@@ -1497,38 +1560,38 @@ var Le = (e) => {
|
|
|
1497
1560
|
if (!t.childrenHandlerId) return r.children ?? [];
|
|
1498
1561
|
let a = n.originalNodes.get(r);
|
|
1499
1562
|
if (!a) return r.children ?? [];
|
|
1500
|
-
let o = await
|
|
1501
|
-
return
|
|
1563
|
+
let o = await G(e, t, t.childrenHandlerId, W(e, t, i, a), i.signal);
|
|
1564
|
+
return en(o) ? n.mapNodes(o, i) : [];
|
|
1502
1565
|
}
|
|
1503
1566
|
}
|
|
1504
1567
|
});
|
|
1505
1568
|
return { dispose() {
|
|
1506
1569
|
a.dispose(), i.dispose();
|
|
1507
1570
|
} };
|
|
1508
|
-
},
|
|
1571
|
+
}, nn = (e) => {
|
|
1509
1572
|
let t = [];
|
|
1510
|
-
for (let n of e.metadata.treeRenderers ?? []) t.push(
|
|
1573
|
+
for (let n of e.metadata.treeRenderers ?? []) t.push(tn(e, n));
|
|
1511
1574
|
return { dispose() {
|
|
1512
1575
|
for (let e = t.length - 1; e >= 0; --e) t[e]?.dispose();
|
|
1513
1576
|
} };
|
|
1514
|
-
},
|
|
1577
|
+
}, J = (e) => ({
|
|
1515
1578
|
kind: e.kind,
|
|
1516
1579
|
id: p(e),
|
|
1517
1580
|
extensionId: e.extensionId
|
|
1518
|
-
}),
|
|
1581
|
+
}), rn = (e, t, n) => {
|
|
1519
1582
|
let r = n?.(t.when);
|
|
1520
1583
|
return !r || e.context.matches(r);
|
|
1521
|
-
},
|
|
1584
|
+
}, an = (e) => ({
|
|
1522
1585
|
id: e.id,
|
|
1523
1586
|
label: P(e.label, e.id),
|
|
1524
1587
|
icon: e.icon,
|
|
1525
1588
|
canHide: !0,
|
|
1526
1589
|
canReorder: !0,
|
|
1527
1590
|
target: F(e.action, { extensionId: e.extensionId })
|
|
1528
|
-
}),
|
|
1591
|
+
}), on = (e, n, r) => {
|
|
1529
1592
|
let i = /* @__PURE__ */ new Map();
|
|
1530
1593
|
for (let a of n) {
|
|
1531
|
-
if (!
|
|
1594
|
+
if (!rn(e, a, r)) continue;
|
|
1532
1595
|
let n = a.group || void 0, o = n ? `${a.extensionId}:${n}` : t(a.slot), s = i.get(o) ?? {
|
|
1533
1596
|
id: o,
|
|
1534
1597
|
label: n,
|
|
@@ -1537,60 +1600,60 @@ var Le = (e) => {
|
|
|
1537
1600
|
canReorder: !0,
|
|
1538
1601
|
nodes: []
|
|
1539
1602
|
};
|
|
1540
|
-
s.nodes.push(
|
|
1603
|
+
s.nodes.push(an(a)), i.set(o, s);
|
|
1541
1604
|
}
|
|
1542
1605
|
return [...i.values()];
|
|
1543
|
-
},
|
|
1606
|
+
}, sn = (e) => {
|
|
1544
1607
|
let t = /* @__PURE__ */ new Map();
|
|
1545
1608
|
for (let n of e) {
|
|
1546
|
-
let e =
|
|
1609
|
+
let e = J(n.owner), r = `${n.extensionId}:${e.kind}:${e.id}:${n.slot}`;
|
|
1547
1610
|
t.set(r, [...t.get(r) ?? [], n]);
|
|
1548
1611
|
}
|
|
1549
1612
|
return [...t.values()];
|
|
1550
|
-
},
|
|
1613
|
+
}, cn = (e) => [...new Set(e.flatMap((e) => e.group ? [`${e.extensionId}:${e.group}`] : []))], ln = (e) => sn(e.metadata.navigationItems).map((t) => {
|
|
1551
1614
|
let n = t[0], r = t.some((e) => e.when?.resourceType?.length || e.when?.metadata);
|
|
1552
1615
|
return e.workbench.navigationTrees.registerContribution({
|
|
1553
1616
|
id: `${n.extensionId}.navigation-items.${n.owner.kind}.${p(n.owner)}.${n.slot}`,
|
|
1554
|
-
owner:
|
|
1617
|
+
owner: J(n.owner),
|
|
1555
1618
|
sourceExtensionId: n.extensionId,
|
|
1556
1619
|
declarationIndex: e.metadata.navigationItems.indexOf(n),
|
|
1557
1620
|
slot: n.slot,
|
|
1558
|
-
defaultExpandedSectionIds:
|
|
1621
|
+
defaultExpandedSectionIds: cn(t),
|
|
1559
1622
|
...r ? {} : { resolveResource: () => void 0 },
|
|
1560
|
-
getSections: () =>
|
|
1623
|
+
getSections: () => on(e.workbench, t, e.createWhenExpression),
|
|
1561
1624
|
listActions: () => t.map((e) => ({
|
|
1562
1625
|
label: P(e.label, e.id),
|
|
1563
1626
|
category: e.group || void 0,
|
|
1564
1627
|
action: F(e.action, { extensionId: e.extensionId })
|
|
1565
1628
|
}))
|
|
1566
1629
|
});
|
|
1567
|
-
}),
|
|
1630
|
+
}), un = (e) => e.metadata.navigationTrees.map((t, n) => {
|
|
1568
1631
|
let r = p(t.view);
|
|
1569
1632
|
return e.workbench.navigationTrees.registerContribution({
|
|
1570
1633
|
id: t.id,
|
|
1571
1634
|
idScope: t.id,
|
|
1572
|
-
owner:
|
|
1635
|
+
owner: J(t.owner),
|
|
1573
1636
|
sourceExtensionId: t.extensionId,
|
|
1574
1637
|
declarationIndex: e.metadata.navigationItems.length + n,
|
|
1575
1638
|
slot: t.slot,
|
|
1576
1639
|
viewId: r,
|
|
1577
1640
|
...t.resourceScope === "project" ? { resolveResource: () => void 0 } : {}
|
|
1578
1641
|
});
|
|
1579
|
-
}),
|
|
1642
|
+
}), dn = (e) => [...ln(e), ...un(e)], fn = () => {
|
|
1580
1643
|
if (typeof navigator > "u") return;
|
|
1581
1644
|
let e = `${navigator.platform} ${navigator.userAgent}`.toLowerCase();
|
|
1582
1645
|
if (e.includes("mac")) return "mac";
|
|
1583
1646
|
if (e.includes("win")) return "win";
|
|
1584
1647
|
if (e.includes("linux")) return "linux";
|
|
1585
|
-
},
|
|
1648
|
+
}, pn = (e, t = fn()) => (t ? e.platformOverrides?.[t] : void 0) ?? e.key, mn = (e) => e.bindings.map((t) => e.workbench.keybindings.registerKeybinding({
|
|
1586
1649
|
sourceExtensionId: t.extensionId,
|
|
1587
1650
|
action: F(t.action, { commandIdOf: (e) => e.extensionId ? f({
|
|
1588
1651
|
extensionId: e.extensionId,
|
|
1589
1652
|
id: e.id
|
|
1590
1653
|
}) : void 0 }),
|
|
1591
|
-
keybinding:
|
|
1654
|
+
keybinding: pn(t),
|
|
1592
1655
|
when: e.createWhenExpression?.(t.when)
|
|
1593
|
-
})),
|
|
1656
|
+
})), hn = (e) => {
|
|
1594
1657
|
if (!e) return;
|
|
1595
1658
|
let t = (e) => {
|
|
1596
1659
|
if (e) return Array.isArray(e) ? e.map((e) => p(e)) : p(e);
|
|
@@ -1602,21 +1665,21 @@ var Le = (e) => {
|
|
|
1602
1665
|
resourceType: e.resourceType?.map((e) => e.id),
|
|
1603
1666
|
metadata: e.metadata
|
|
1604
1667
|
};
|
|
1605
|
-
},
|
|
1668
|
+
}, gn = (e, t) => ({
|
|
1606
1669
|
...e,
|
|
1607
1670
|
tab: e.tab && t.createTab ? t.createTab({
|
|
1608
1671
|
...e.tab,
|
|
1609
1672
|
extensionId: t.extensionId,
|
|
1610
1673
|
placementId: t.placementId
|
|
1611
1674
|
}) : void 0
|
|
1612
|
-
}),
|
|
1675
|
+
}), _n = (e, t) => e.kind === "panels" ? e : {
|
|
1613
1676
|
...e,
|
|
1614
1677
|
tab: e.tab && t.createTab ? t.createTab({
|
|
1615
1678
|
...e.tab,
|
|
1616
1679
|
extensionId: t.extensionId,
|
|
1617
1680
|
placementId: t.placementId
|
|
1618
1681
|
}) : void 0
|
|
1619
|
-
},
|
|
1682
|
+
}, vn = (e, t) => e.pages.map((e) => ({
|
|
1620
1683
|
id: e.id,
|
|
1621
1684
|
ref: {
|
|
1622
1685
|
extensionId: e.extensionId,
|
|
@@ -1626,30 +1689,31 @@ var Le = (e) => {
|
|
|
1626
1689
|
title: e.title,
|
|
1627
1690
|
path: e.path,
|
|
1628
1691
|
document: e.document,
|
|
1692
|
+
params: e.params,
|
|
1629
1693
|
modeId: p(e.mode),
|
|
1630
1694
|
resource: e.resource,
|
|
1631
|
-
main:
|
|
1695
|
+
main: _n(e.main, {
|
|
1632
1696
|
extensionId: e.extensionId,
|
|
1633
1697
|
placementId: `${e.id}.$main`,
|
|
1634
1698
|
createTab: t
|
|
1635
1699
|
}),
|
|
1636
|
-
slots: e.slots.map((n) =>
|
|
1700
|
+
slots: e.slots.map((n) => gn(n, {
|
|
1637
1701
|
extensionId: e.extensionId,
|
|
1638
1702
|
placementId: `${e.id}.${n.id}`,
|
|
1639
1703
|
createTab: t
|
|
1640
1704
|
})),
|
|
1641
1705
|
...e.icon ? { icon: e.icon } : {},
|
|
1642
1706
|
...e.parent ? { parentId: p(e.parent) } : {}
|
|
1643
|
-
})),
|
|
1707
|
+
})), Y = (e, t) => {
|
|
1644
1708
|
let n = e.pages.flatMap((e) => [...e.main.kind === "view" && e.resource ? [{
|
|
1645
1709
|
...e.resource,
|
|
1646
1710
|
view: e.main.view
|
|
1647
1711
|
}] : [], ...e.slots.flatMap((e) => e.item.kind === "binding" ? [e.item.binding] : [])]);
|
|
1648
1712
|
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
|
-
},
|
|
1713
|
+
}, yn = (e) => e.body.kind === "webview" ? { webview: e.body.webview } : { renderer: {
|
|
1650
1714
|
kind: e.body.kind,
|
|
1651
1715
|
id: e.id
|
|
1652
|
-
} },
|
|
1716
|
+
} }, bn = (e, t) => e.viewMenus.flatMap((n) => {
|
|
1653
1717
|
if (p(n.owner) !== t.id) return [];
|
|
1654
1718
|
let r = e.views.find((e) => e.id === p(n.view));
|
|
1655
1719
|
return r ? [{
|
|
@@ -1663,22 +1727,22 @@ var Le = (e) => {
|
|
|
1663
1727
|
placement: n.placement,
|
|
1664
1728
|
hostTreeHeader: n.hostTreeHeader,
|
|
1665
1729
|
hostTreeFooter: n.hostTreeFooter,
|
|
1666
|
-
...
|
|
1730
|
+
...yn(r)
|
|
1667
1731
|
}] : [];
|
|
1668
|
-
}),
|
|
1669
|
-
let n =
|
|
1732
|
+
}), xn = (e) => e.views.map((t) => {
|
|
1733
|
+
let n = bn(e, t);
|
|
1670
1734
|
return {
|
|
1671
1735
|
id: t.id,
|
|
1672
1736
|
extensionId: t.extensionId,
|
|
1673
1737
|
title: t.title,
|
|
1674
1738
|
icon: t.icon,
|
|
1675
1739
|
panelMenus: n.length > 0 ? n : void 0,
|
|
1676
|
-
...
|
|
1740
|
+
...yn(t)
|
|
1677
1741
|
};
|
|
1678
|
-
}),
|
|
1742
|
+
}), X = (e) => e?.map(({ command: e, ...t }) => ({
|
|
1679
1743
|
...t,
|
|
1680
1744
|
commandId: f(e)
|
|
1681
|
-
})),
|
|
1745
|
+
})), Sn = (e) => e.views.flatMap((t) => {
|
|
1682
1746
|
let n = t.body;
|
|
1683
1747
|
return n.kind === "kanban" ? [{
|
|
1684
1748
|
...n,
|
|
@@ -1686,7 +1750,7 @@ var Le = (e) => {
|
|
|
1686
1750
|
extensionId: t.extensionId,
|
|
1687
1751
|
title: t.title,
|
|
1688
1752
|
icon: t.icon,
|
|
1689
|
-
resourceKind: n.resourceKind ??
|
|
1753
|
+
resourceKind: n.resourceKind ?? Y(e, t.id),
|
|
1690
1754
|
createRow: n.createRow ? {
|
|
1691
1755
|
title: n.createRow.title,
|
|
1692
1756
|
submitLabel: n.createRow.submitLabel,
|
|
@@ -1701,10 +1765,10 @@ var Le = (e) => {
|
|
|
1701
1765
|
commandId: f(n.createRow.attachments.command)
|
|
1702
1766
|
} : void 0
|
|
1703
1767
|
} : void 0,
|
|
1704
|
-
rowActions:
|
|
1705
|
-
toolbarActions:
|
|
1768
|
+
rowActions: X(n.rowActions),
|
|
1769
|
+
toolbarActions: X(n.toolbarActions)
|
|
1706
1770
|
}] : [];
|
|
1707
|
-
}),
|
|
1771
|
+
}), Cn = (e) => e.views.flatMap((t) => {
|
|
1708
1772
|
let n = t.body;
|
|
1709
1773
|
return n.kind === "dataTable" ? [{
|
|
1710
1774
|
...n,
|
|
@@ -1712,33 +1776,33 @@ var Le = (e) => {
|
|
|
1712
1776
|
extensionId: t.extensionId,
|
|
1713
1777
|
title: t.title,
|
|
1714
1778
|
icon: t.icon,
|
|
1715
|
-
resourceKind: n.resourceKind ??
|
|
1716
|
-
selectionActions:
|
|
1717
|
-
rowActions:
|
|
1718
|
-
toolbarActions:
|
|
1779
|
+
resourceKind: n.resourceKind ?? Y(e, t.id),
|
|
1780
|
+
selectionActions: X(n.selectionActions),
|
|
1781
|
+
rowActions: X(n.rowActions),
|
|
1782
|
+
toolbarActions: X(n.toolbarActions)
|
|
1719
1783
|
}] : [];
|
|
1720
|
-
}),
|
|
1784
|
+
}), wn = (e) => e.views.flatMap((t) => t.body.kind === "tree" ? [{
|
|
1721
1785
|
...t.body,
|
|
1722
1786
|
id: t.id,
|
|
1723
1787
|
extensionId: t.extensionId,
|
|
1724
1788
|
title: t.title,
|
|
1725
1789
|
icon: t.icon,
|
|
1726
|
-
resourceKind: t.body.resourceKind ??
|
|
1727
|
-
}] : []),
|
|
1790
|
+
resourceKind: t.body.resourceKind ?? Y(e, t.id)
|
|
1791
|
+
}] : []), Tn = (e) => e.views.flatMap((t) => t.body.kind === "file" ? [{
|
|
1728
1792
|
...t.body,
|
|
1729
1793
|
id: t.id,
|
|
1730
1794
|
extensionId: t.extensionId,
|
|
1731
1795
|
title: t.title,
|
|
1732
1796
|
icon: t.icon,
|
|
1733
|
-
resourceKind: t.body.resourceKind ??
|
|
1734
|
-
}] : []),
|
|
1797
|
+
resourceKind: t.body.resourceKind ?? Y(e, t.id)
|
|
1798
|
+
}] : []), En = (e) => e.views.flatMap((t) => t.body.kind === "controls" ? [{
|
|
1735
1799
|
...t.body,
|
|
1736
1800
|
id: t.id,
|
|
1737
1801
|
extensionId: t.extensionId,
|
|
1738
1802
|
title: t.title,
|
|
1739
1803
|
icon: t.icon,
|
|
1740
|
-
resourceKind: t.body.resourceKind ??
|
|
1741
|
-
}] : []),
|
|
1804
|
+
resourceKind: t.body.resourceKind ?? Y(e, t.id)
|
|
1805
|
+
}] : []), Dn = (e) => e.modes.map((e) => ({
|
|
1742
1806
|
id: e.id,
|
|
1743
1807
|
extensionId: e.extensionId,
|
|
1744
1808
|
modeId: e.id,
|
|
@@ -1749,15 +1813,15 @@ var Le = (e) => {
|
|
|
1749
1813
|
floatingPanels: e.floatingPanels,
|
|
1750
1814
|
...e.defaultTheme ? { defaultTheme: p(e.defaultTheme) } : {},
|
|
1751
1815
|
...e.chrome ? { chrome: Object.fromEntries(Object.entries(e.chrome).map(([e, t]) => [e, t !== !1 && p(t)])) } : {}
|
|
1752
|
-
})),
|
|
1753
|
-
let n =
|
|
1816
|
+
})), On = (e, t = {}) => {
|
|
1817
|
+
let n = xn(e);
|
|
1754
1818
|
return {
|
|
1755
1819
|
extensions: e.extensions,
|
|
1756
1820
|
commands: e.commands,
|
|
1757
1821
|
menuContributions: e.menuContributions,
|
|
1758
1822
|
commandPaletteContributions: e.commandPaletteContributions,
|
|
1759
|
-
modes:
|
|
1760
|
-
pages:
|
|
1823
|
+
modes: Dn(e),
|
|
1824
|
+
pages: vn(e, t.createTab),
|
|
1761
1825
|
placements: e.placements.map((e) => ({
|
|
1762
1826
|
id: e.id,
|
|
1763
1827
|
ref: {
|
|
@@ -1811,12 +1875,12 @@ var Le = (e) => {
|
|
|
1811
1875
|
section: t.section ? p(t.section) : void 0
|
|
1812
1876
|
}] : [];
|
|
1813
1877
|
}),
|
|
1814
|
-
kanbanRenderers:
|
|
1815
|
-
dataTableRenderers:
|
|
1878
|
+
kanbanRenderers: Sn(e),
|
|
1879
|
+
dataTableRenderers: Cn(e),
|
|
1816
1880
|
commandPaletteResources: e.commandPaletteResources ?? [],
|
|
1817
|
-
treeRenderers:
|
|
1818
|
-
fileRenderers:
|
|
1819
|
-
controlsRenderers:
|
|
1881
|
+
treeRenderers: wn(e),
|
|
1882
|
+
fileRenderers: Tn(e),
|
|
1883
|
+
controlsRenderers: En(e),
|
|
1820
1884
|
keybindings: e.keybindings ?? [],
|
|
1821
1885
|
settingsDefinitions: e.settingsDefinitions ?? [],
|
|
1822
1886
|
statuses: e.statuses,
|
|
@@ -1826,13 +1890,13 @@ var Le = (e) => {
|
|
|
1826
1890
|
viewId: p(e.view),
|
|
1827
1891
|
slot: e.slot.id.endsWith("leading") ? "leading" : "trailing",
|
|
1828
1892
|
order: e.order,
|
|
1829
|
-
when:
|
|
1893
|
+
when: hn(e.when)
|
|
1830
1894
|
})),
|
|
1831
1895
|
diagnostics: e.diagnostics
|
|
1832
1896
|
};
|
|
1833
|
-
},
|
|
1897
|
+
}, kn = (e, t, n = {}) => {
|
|
1834
1898
|
e.views.refreshView(t.id, t.kind === "file" ? n : void 0);
|
|
1835
|
-
},
|
|
1899
|
+
}, An = (e) => {
|
|
1836
1900
|
let t = /* @__PURE__ */ new Map(), n = (e, n) => {
|
|
1837
1901
|
for (let r of new Set(n.refreshEventIds ?? [])) {
|
|
1838
1902
|
let i = t.get(r) ?? [];
|
|
@@ -1847,18 +1911,19 @@ var Le = (e) => {
|
|
|
1847
1911
|
refreshEventIds: t.body.refreshEventIds
|
|
1848
1912
|
});
|
|
1849
1913
|
return t;
|
|
1850
|
-
},
|
|
1851
|
-
let t =
|
|
1914
|
+
}, jn = (e) => {
|
|
1915
|
+
let t = An(e.metadata);
|
|
1852
1916
|
return e.subscribe((n) => {
|
|
1853
1917
|
let { id: r, ...i } = n;
|
|
1854
|
-
for (let n of t.get(r) ?? [])
|
|
1918
|
+
for (let n of t.get(r) ?? []) kn(e.workbench, n, i);
|
|
1855
1919
|
});
|
|
1856
|
-
},
|
|
1920
|
+
}, Mn = (e, t) => {
|
|
1857
1921
|
for (let n of t.views) n.body.kind === "webview" && e.views.getView(n.id) && e.views.refreshView(n.id);
|
|
1858
|
-
},
|
|
1859
|
-
...
|
|
1922
|
+
}, Nn = (e) => (t) => ({
|
|
1923
|
+
...Ne({
|
|
1860
1924
|
workbench: t.workbench,
|
|
1861
1925
|
placement: t.placement,
|
|
1926
|
+
extensionId: t.extensionId ?? e.extensionIdForWebview(t.webviewId),
|
|
1862
1927
|
hostEvents: t.hostEvents
|
|
1863
1928
|
}),
|
|
1864
1929
|
"navigation.open": (n) => {
|
|
@@ -1893,25 +1958,25 @@ var Le = (e) => {
|
|
|
1893
1958
|
"files.delete": e.files.delete
|
|
1894
1959
|
} : {},
|
|
1895
1960
|
...e.artifacts ? { "artifacts.read": (n) => e.artifacts.read(n, { webviewId: t.webviewId }) } : {}
|
|
1896
|
-
}),
|
|
1961
|
+
}), Pn = (e) => ({
|
|
1897
1962
|
title: P(e.title) || void 0,
|
|
1898
1963
|
runtimeUrl: e.runtimeUrl,
|
|
1899
1964
|
moduleUrl: e.moduleUrl,
|
|
1900
1965
|
styles: e.styles,
|
|
1901
1966
|
capabilities: e.capabilities
|
|
1902
|
-
}),
|
|
1967
|
+
}), Fn = "extensions", In = 1e3, Ln = 25, Rn = (e) => e === void 0 ? void 0 : e, zn = (e) => e === "global" ? "user" : "project", Bn = (e, t) => t ? (n) => ({
|
|
1903
1968
|
...e(n),
|
|
1904
1969
|
...t(n)
|
|
1905
|
-
}) : e,
|
|
1970
|
+
}) : e, Vn = (e, t) => Bn(e.createWebviewHostCapabilities ?? Nn({
|
|
1906
1971
|
artifacts: e.webviewArtifacts,
|
|
1907
1972
|
executeCommand: e.executeCommand,
|
|
1908
1973
|
extensionIdForWebview: (t) => e.metadata.panels.find((e) => e.id === t)?.extensionId,
|
|
1909
1974
|
files: e.webviewFiles,
|
|
1910
1975
|
projectId: e.projectId,
|
|
1911
1976
|
slotKind: t
|
|
1912
|
-
}), e.createWebviewHostCapabilityOverrides),
|
|
1977
|
+
}), e.createWebviewHostCapabilityOverrides), Hn = (e) => e.metadata.panels.flatMap((t) => {
|
|
1913
1978
|
if (!t.webview) return [];
|
|
1914
|
-
let n =
|
|
1979
|
+
let n = Pn(t.webview);
|
|
1915
1980
|
return [e.workbench.views.registerView({
|
|
1916
1981
|
id: t.id,
|
|
1917
1982
|
title: P(t.title, t.id),
|
|
@@ -1920,14 +1985,14 @@ var Le = (e) => {
|
|
|
1920
1985
|
kind: "react",
|
|
1921
1986
|
render: (r) => {
|
|
1922
1987
|
let i = e.metadata.settingsPanels.some((e) => e.id === r.instance.panelId && e.viewId === t.id) ? "settings" : "panel";
|
|
1923
|
-
return e.renderWebview?.(r) ??
|
|
1988
|
+
return e.renderWebview?.(r) ?? Le({
|
|
1924
1989
|
context: {
|
|
1925
1990
|
workbench: r.workbench,
|
|
1926
1991
|
webviewId: t.id,
|
|
1927
1992
|
placement: r.instance,
|
|
1928
|
-
hostEvents:
|
|
1993
|
+
hostEvents: Ie(r.workbench, r.instance)
|
|
1929
1994
|
},
|
|
1930
|
-
createHostCapabilities:
|
|
1995
|
+
createHostCapabilities: Vn(e, i),
|
|
1931
1996
|
createProps: e.createWebviewProps ?? (({ placement: e }) => ({
|
|
1932
1997
|
placement: e,
|
|
1933
1998
|
resource: e.resource
|
|
@@ -1940,20 +2005,20 @@ var Le = (e) => {
|
|
|
1940
2005
|
}
|
|
1941
2006
|
}
|
|
1942
2007
|
})];
|
|
1943
|
-
}),
|
|
2008
|
+
}), Un = {
|
|
1944
2009
|
first: 1e6,
|
|
1945
2010
|
default: 0,
|
|
1946
2011
|
last: -1e6
|
|
1947
|
-
},
|
|
2012
|
+
}, Wn = (e) => e.metadata.panels.flatMap((e) => e.panelMenus ?? []).map((t, n) => e.workbench.viewMenus.registerViewMenu({
|
|
1948
2013
|
id: t.id,
|
|
1949
2014
|
ownerViewId: t.ownerPanelId,
|
|
1950
2015
|
viewId: t.viewId,
|
|
1951
2016
|
side: t.side,
|
|
1952
|
-
priority:
|
|
1953
|
-
})),
|
|
2017
|
+
priority: Un[t.placement ?? "default"] - n
|
|
2018
|
+
})), Gn = (e) => {
|
|
1954
2019
|
if (!e || typeof e != "object" || !("statuses" in e) || !Array.isArray(e.statuses)) throw Error("Status provider returned an invalid response");
|
|
1955
2020
|
return e.statuses;
|
|
1956
|
-
},
|
|
2021
|
+
}, Kn = (e, t) => {
|
|
1957
2022
|
let r = e.metadata.statuses ?? [];
|
|
1958
2023
|
if (r.length === 0) return [];
|
|
1959
2024
|
let i = "workbench.extension-statuses.settings", a = r.map((n, r) => e.workbench.statuses.registerStatusSet({
|
|
@@ -1964,8 +2029,8 @@ var Le = (e) => {
|
|
|
1964
2029
|
label: P(e.label, e.id),
|
|
1965
2030
|
icon: e.icon
|
|
1966
2031
|
})),
|
|
1967
|
-
query: async () =>
|
|
1968
|
-
save: n.saveHandlerId ? async (e) =>
|
|
2032
|
+
query: async () => Gn(await R(t, n.queryHandlerId, { params: {} })),
|
|
2033
|
+
save: n.saveHandlerId ? async (e) => Gn(await R(t, n.saveHandlerId, { params: { statuses: e } })) : void 0
|
|
1969
2034
|
}, {
|
|
1970
2035
|
ownerId: n.extensionId,
|
|
1971
2036
|
priority: -r
|
|
@@ -1975,20 +2040,20 @@ var Le = (e) => {
|
|
|
1975
2040
|
title: "Statuses",
|
|
1976
2041
|
body: {
|
|
1977
2042
|
kind: "react",
|
|
1978
|
-
render: () =>
|
|
2043
|
+
render: () => w(n, { workbench: e.workbench })
|
|
1979
2044
|
}
|
|
1980
2045
|
})), a.push(e.workbench.settings.registerPanel({
|
|
1981
2046
|
id: "workbench.statuses",
|
|
1982
2047
|
title: "Statuses",
|
|
1983
2048
|
icon: "list-checks",
|
|
1984
2049
|
kind: "view",
|
|
1985
|
-
order:
|
|
1986
|
-
section: e.settingsSectionId ??
|
|
2050
|
+
order: Ln,
|
|
2051
|
+
section: e.settingsSectionId ?? Fn,
|
|
1987
2052
|
scope: "project",
|
|
1988
2053
|
viewId: i
|
|
1989
2054
|
})), a;
|
|
1990
|
-
},
|
|
1991
|
-
let t = [], n = e.settingsSectionId ??
|
|
2055
|
+
}, qn = (e) => {
|
|
2056
|
+
let t = [], n = e.settingsSectionId ?? Fn;
|
|
1992
2057
|
e.workbench.settings.getSection(n) || t.push(e.workbench.settings.registerSection({
|
|
1993
2058
|
id: n,
|
|
1994
2059
|
title: e.settingsSectionTitle ?? "Extensions"
|
|
@@ -2000,30 +2065,34 @@ var Le = (e) => {
|
|
|
2000
2065
|
order: n.order,
|
|
2001
2066
|
scope: n.scope
|
|
2002
2067
|
}));
|
|
2003
|
-
let i =
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2068
|
+
let i = new Map(e.metadata.settingsDefinitions.map((e) => [e.key, e])), a = /* @__PURE__ */ new Map();
|
|
2069
|
+
for (let e of i.values()) {
|
|
2070
|
+
let t = a.get(e.extensionId) ?? Object.create(null);
|
|
2071
|
+
t[e.key] = {
|
|
2072
|
+
type: e.type,
|
|
2073
|
+
scope: zn(e.scope),
|
|
2074
|
+
default: Rn(e.default),
|
|
2075
|
+
enum: e.enum,
|
|
2076
|
+
description: P(e.description)
|
|
2077
|
+
}, a.set(e.extensionId, t);
|
|
2078
|
+
}
|
|
2079
|
+
for (let [n, r] of a) t.push(e.workbench.preferences.registerSchema({ properties: r }, { ownerId: n }));
|
|
2080
|
+
let o = [...e.metadata.settingsPanels].sort((e, t) => e.extensionId.localeCompare(t.extensionId) || e.id.localeCompare(t.id));
|
|
2081
|
+
for (let [r, i] of o.entries()) i.slotId !== "extension.settings" && t.push(e.workbench.settings.registerPanel({
|
|
2013
2082
|
id: i.id,
|
|
2014
2083
|
title: P(i.title, i.id),
|
|
2015
2084
|
icon: i.icon,
|
|
2016
2085
|
kind: "view",
|
|
2017
|
-
order:
|
|
2086
|
+
order: In + r,
|
|
2018
2087
|
section: i.section ?? n,
|
|
2019
2088
|
scope: i.scope,
|
|
2020
2089
|
viewId: i.viewId
|
|
2021
2090
|
}));
|
|
2022
2091
|
return t;
|
|
2023
|
-
}, Z = (e) => !(!e || typeof e != "object" || Array.isArray(e)),
|
|
2092
|
+
}, Z = (e) => !(!e || typeof e != "object" || Array.isArray(e)), Jn = (e, t, n) => h(e) ? F(e, {
|
|
2024
2093
|
extensionId: t,
|
|
2025
2094
|
projectId: n
|
|
2026
|
-
}) : void 0,
|
|
2095
|
+
}) : void 0, Yn = (e, t, n) => {
|
|
2027
2096
|
if (!Z(e)) return {};
|
|
2028
2097
|
let r = Z(e.indicator) ? {
|
|
2029
2098
|
icon: String(e.indicator.icon ?? ""),
|
|
@@ -2033,7 +2102,7 @@ var Le = (e) => {
|
|
|
2033
2102
|
id: e.id,
|
|
2034
2103
|
rows: e.rows.flatMap((e) => {
|
|
2035
2104
|
if (!Z(e) || typeof e.id != "string") return [];
|
|
2036
|
-
let r =
|
|
2105
|
+
let r = Jn(e.action, t, n);
|
|
2037
2106
|
return [{
|
|
2038
2107
|
id: e.id,
|
|
2039
2108
|
label: P(e.label, e.id),
|
|
@@ -2054,7 +2123,7 @@ var Le = (e) => {
|
|
|
2054
2123
|
indicator: r?.icon ? r : void 0,
|
|
2055
2124
|
menu: i
|
|
2056
2125
|
};
|
|
2057
|
-
},
|
|
2126
|
+
}, Xn = (e, t) => {
|
|
2058
2127
|
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
2128
|
r.set(o.instanceId, o);
|
|
2060
2129
|
let l = i.get(o.instanceId);
|
|
@@ -2072,7 +2141,7 @@ var Le = (e) => {
|
|
|
2072
2141
|
i.delete(o.instanceId), await c(o);
|
|
2073
2142
|
return;
|
|
2074
2143
|
}
|
|
2075
|
-
n.set(o.instanceId,
|
|
2144
|
+
n.set(o.instanceId, Yn(r, t.extensionId, e.projectId));
|
|
2076
2145
|
for (let e of a) e();
|
|
2077
2146
|
}).finally(() => {
|
|
2078
2147
|
i.get(o.instanceId) === f && i.delete(o.instanceId);
|
|
@@ -2087,7 +2156,7 @@ var Le = (e) => {
|
|
|
2087
2156
|
subscribe(t) {
|
|
2088
2157
|
a.add(t);
|
|
2089
2158
|
let n = e.workbench.resources.preview.subscribeRefresh(async (e) => {
|
|
2090
|
-
let t = [...r.values()].filter((t) => t.resource &&
|
|
2159
|
+
let t = [...r.values()].filter((t) => t.resource && y(t.resource) === y(e));
|
|
2091
2160
|
t.length && (s++, await Promise.all(t.map(c)));
|
|
2092
2161
|
}), i = e.subscribeRefreshEvents?.((e) => {
|
|
2093
2162
|
if (o.has(e.id)) {
|
|
@@ -2100,9 +2169,9 @@ var Le = (e) => {
|
|
|
2100
2169
|
} };
|
|
2101
2170
|
}
|
|
2102
2171
|
};
|
|
2103
|
-
},
|
|
2172
|
+
}, Zn = (e) => {
|
|
2104
2173
|
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,
|
|
2174
|
+
}, Q = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, $ = (e, t, n, r, i) => e.prepareCommandArgs?.(t, n, r, i) ?? n, Qn = (e, t) => t.commands.map((t) => e.workbench.commands.registerCommand({
|
|
2106
2175
|
id: t.id,
|
|
2107
2176
|
label: P(t.title, t.id),
|
|
2108
2177
|
description: P(t.description),
|
|
@@ -2115,9 +2184,9 @@ var Le = (e) => {
|
|
|
2115
2184
|
resource: r?.resource,
|
|
2116
2185
|
signal: r?.signal
|
|
2117
2186
|
})
|
|
2118
|
-
})),
|
|
2187
|
+
})), $n = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), er = (e, t) => {
|
|
2119
2188
|
if (!e.menuSlotsById) return [];
|
|
2120
|
-
let { registrations: n } =
|
|
2189
|
+
let { registrations: n } = ut({
|
|
2121
2190
|
metadata: e.metadata,
|
|
2122
2191
|
menuSlotsById: e.menuSlotsById,
|
|
2123
2192
|
menuTargetsById: e.menuTargetsById,
|
|
@@ -2136,7 +2205,7 @@ var Le = (e) => {
|
|
|
2136
2205
|
...n.contribution.params ?? {},
|
|
2137
2206
|
...Q(r) ?? {}
|
|
2138
2207
|
},
|
|
2139
|
-
resource:
|
|
2208
|
+
resource: $n(e, i),
|
|
2140
2209
|
slot: I({
|
|
2141
2210
|
id: n.contribution.slotId,
|
|
2142
2211
|
kind: "menu",
|
|
@@ -2145,14 +2214,14 @@ var Le = (e) => {
|
|
|
2145
2214
|
})
|
|
2146
2215
|
})
|
|
2147
2216
|
}), ...n.menuItems.map(({ menuPath: t, menuItem: n }) => e.workbench.layout.registerMenuItem(t, n))]);
|
|
2148
|
-
},
|
|
2217
|
+
}, tr = (t, n) => dt({ metadata: t.metadata }).flatMap((r) => [t.workbench.commands.registerCommand(r.command, {
|
|
2149
2218
|
prepareArgs: (e, t, i) => $(n, r.targetCommandId, e, t, i),
|
|
2150
2219
|
execute: (e, i) => R(n, r.targetCommandId, {
|
|
2151
2220
|
params: {
|
|
2152
2221
|
...r.contribution.params ?? {},
|
|
2153
2222
|
...Q(e) ?? {}
|
|
2154
2223
|
},
|
|
2155
|
-
resource:
|
|
2224
|
+
resource: $n(t, i),
|
|
2156
2225
|
slot: I({
|
|
2157
2226
|
id: "workbench.commandPalette",
|
|
2158
2227
|
kind: "menu",
|
|
@@ -2161,22 +2230,22 @@ var Le = (e) => {
|
|
|
2161
2230
|
})
|
|
2162
2231
|
}),
|
|
2163
2232
|
isVisible: () => g(r.contribution.when, t.workbench.getPrimaryResource()?.type)
|
|
2164
|
-
}), t.workbench.layout.registerMenuItem(e, r.menuItem)]),
|
|
2233
|
+
}), t.workbench.layout.registerMenuItem(e, r.menuItem)]), nr = (e, t) => {
|
|
2165
2234
|
let n = t?.mode;
|
|
2166
2235
|
if (!n) return !0;
|
|
2167
2236
|
let r = e.workbench.modes.getActiveModeId() ?? "";
|
|
2168
2237
|
return Array.isArray(n) ? n.includes(r) : n === r;
|
|
2169
|
-
},
|
|
2238
|
+
}, rr = (e) => (e.metadata.statusBarItems ?? []).map((t) => e.workbench.statusBar.registerItem({
|
|
2170
2239
|
id: t.id,
|
|
2171
2240
|
viewId: t.viewId,
|
|
2172
2241
|
slot: t.slot,
|
|
2173
2242
|
order: t.order,
|
|
2174
|
-
isVisible: () =>
|
|
2175
|
-
})),
|
|
2243
|
+
isVisible: () => nr(e, t.when)
|
|
2244
|
+
})), ir = (e) => e.metadata.pages.map((t) => e.workbench.pages.registerPage(t)), ar = (e) => e.metadata.resourceKinds.map((t) => e.workbench.resources.registerKind({
|
|
2176
2245
|
kind: t.id,
|
|
2177
2246
|
label: P(t.label, t.id),
|
|
2178
2247
|
icon: t.icon ?? "FileText"
|
|
2179
|
-
})),
|
|
2248
|
+
})), or = (e) => e.metadata.modes.map((t) => e.workbench.modes.registerMode({
|
|
2180
2249
|
id: t.modeId,
|
|
2181
2250
|
label: P(t.label, t.modeId),
|
|
2182
2251
|
panels: t.panelRegions,
|
|
@@ -2185,35 +2254,35 @@ var Le = (e) => {
|
|
|
2185
2254
|
defaultTheme: t.defaultTheme,
|
|
2186
2255
|
chrome: t.chrome,
|
|
2187
2256
|
activate: () => void 0
|
|
2188
|
-
})),
|
|
2257
|
+
})), sr = (e) => e.metadata.placements.map((t) => e.workbench.modePlacements.registerPlacement(t)), cr = (e) => {
|
|
2189
2258
|
let t = {
|
|
2190
2259
|
...e,
|
|
2191
|
-
metadata:
|
|
2260
|
+
metadata: On(e.metadata, { createTab: (t) => Xn(e, t) })
|
|
2192
2261
|
}, n = [], r = t;
|
|
2193
2262
|
try {
|
|
2194
|
-
return n.push(...
|
|
2263
|
+
return n.push(...Qn(r, t.metadata)), n.push(...mn({
|
|
2195
2264
|
bindings: t.metadata.keybindings,
|
|
2196
2265
|
createWhenExpression: t.createKeybindingWhenExpression,
|
|
2197
2266
|
workbench: t.workbench
|
|
2198
|
-
})), n.push(...
|
|
2267
|
+
})), n.push(...er(t, r)), n.push(...tr(t, r)), n.push(nn({
|
|
2199
2268
|
...t,
|
|
2200
2269
|
resolveNodeResource: t.resolveTreeNodeResource
|
|
2201
|
-
})), n.push(
|
|
2270
|
+
})), n.push(_t(t)), n.push(Je(r, t.metadata.controlsRenderers ?? [])), n.push(...Hn(t)), n.push(...qn(t)), n.push(...Kn(t, r)), n.push(Wt(r, t.metadata.kanbanRenderers ?? [], t.kanbanAdapter)), n.push(tt(r, t.metadata.dataTableRenderers ?? [], t.dataTableAdapter)), n.push(...Wn(t)), n.push(Ke(r, t.metadata.commandPaletteResources ?? [])), n.push(...dn({
|
|
2202
2271
|
createWhenExpression: e.createNavigationWhenExpression,
|
|
2203
2272
|
metadata: e.metadata,
|
|
2204
2273
|
workbench: e.workbench
|
|
2205
|
-
})), e.subscribeRefreshEvents && n.push(
|
|
2274
|
+
})), e.subscribeRefreshEvents && n.push(jn({
|
|
2206
2275
|
metadata: e.metadata,
|
|
2207
2276
|
subscribe: e.subscribeRefreshEvents,
|
|
2208
2277
|
workbench: e.workbench
|
|
2209
|
-
})), n.push(...
|
|
2210
|
-
|
|
2278
|
+
})), n.push(...rr(t)), n.push(...ar(t)), n.push(...ir(t)), n.push(...or(t)), n.push(...sr(t)), { dispose() {
|
|
2279
|
+
Zn(n);
|
|
2211
2280
|
} };
|
|
2212
2281
|
} catch (e) {
|
|
2213
|
-
throw
|
|
2282
|
+
throw Zn(n), e;
|
|
2214
2283
|
}
|
|
2215
2284
|
};
|
|
2216
2285
|
//#endregion
|
|
2217
|
-
export {
|
|
2286
|
+
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, Mn as refreshOpenWorkbenchExtensionWebviews, kn as refreshWorkbenchExtensionRenderer, Ke as registerWorkbenchExtensionCommandPaletteResources, cr as registerWorkbenchExtensionContributions, Je as registerWorkbenchExtensionControlsRenderers, tt as registerWorkbenchExtensionDataTableRenderers, _t as registerWorkbenchExtensionFileRenderers, Wt as registerWorkbenchExtensionKanbanRenderers, jn as registerWorkbenchExtensionRendererRefreshEvents, nn as registerWorkbenchExtensionTreeRenderers, Le as renderBridgeWebviewFrame, F as toWorkbenchNavigationTarget, hn as toWorkbenchWhenExpression };
|
|
2218
2287
|
|
|
2219
2288
|
//# sourceMappingURL=extensions.js.map
|