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