@pstdio/workbench 0.44.0 → 0.45.0-nightly.20261021030241
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 +30 -4
- package/dist/extensions.js +1321 -786
- package/dist/extensions.js.map +1 -1
- package/dist/{file-renderer-view-C5dyoQQW.js → file-renderer-view-CJBCZZIE.js} +46 -46
- package/dist/{file-renderer-view-C5dyoQQW.js.map → file-renderer-view-CJBCZZIE.js.map} +1 -1
- package/dist/{index-8x-QT7wg.d.ts → index-CEjUGkgB.d.ts} +341 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2039 -1656
- package/dist/index.js.map +1 -1
- package/dist/{kanban-presentation-pexk_oCY.d.ts → kanban-presentation-CQNhh7IY.d.ts} +1 -1
- package/dist/navigation-tree-registry-BsMNSEyZ.js +145 -0
- package/dist/navigation-tree-registry-BsMNSEyZ.js.map +1 -0
- package/dist/{react-C-HbdPSw.js → react-hsii-4ZV.js} +3816 -2958
- package/dist/react-hsii-4ZV.js.map +1 -0
- package/dist/react.d.ts +18 -5
- package/dist/react.js +2 -2
- package/dist/storage.d.ts +1 -1
- package/dist/webview-runtime.js +1 -1
- package/dist/workbench-renderers-Ku0_knjs.js +1602 -0
- package/dist/workbench-renderers-Ku0_knjs.js.map +1 -0
- package/package.json +3 -3
- package/dist/navigation-tree-registry-C5l3eO3n.js +0 -120
- package/dist/navigation-tree-registry-C5l3eO3n.js.map +0 -1
- package/dist/react-C-HbdPSw.js.map +0 -1
- package/dist/workbench-renderers-Bz_dLyHW.js +0 -4775
- package/dist/workbench-renderers-Bz_dLyHW.js.map +0 -1
package/dist/extensions.js
CHANGED
|
@@ -1,56 +1,461 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
import {
|
|
4
|
-
import { z as
|
|
5
|
-
import { CommandOutcomeError as
|
|
6
|
-
import { c as
|
|
7
|
-
import { Box as
|
|
8
|
-
import { createElement as
|
|
9
|
-
import { jsx as
|
|
10
|
-
import { renderBadgeListDisplay as
|
|
11
|
-
import { host as
|
|
12
|
-
//#region ../pstdio-api-contracts/src/extension-kernel/
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { Ct as e, St as t, Tt as n, _t as r, bt as i, ct as a, dt as o, l as s, lt as c, u as l, ut as u, vt as d, wt as f, xt as p } from "./react-hsii-4ZV.js";
|
|
2
|
+
import { n as m, r as h } from "./navigation-tree-registry-BsMNSEyZ.js";
|
|
3
|
+
import { D as g, dn as _, fn as v } from "./workbench-renderers-Ku0_knjs.js";
|
|
4
|
+
import { z as y } from "zod";
|
|
5
|
+
import { CommandOutcomeError as b, commandRefId as x, contributionRefId as S, getCommandValue as C, isLocalizedString as w, isNavigationTarget as T, matchesResourceWhen as ee, resourceKey as E } from "@pstdio/sdk/extensions";
|
|
6
|
+
import { c as te } from "react/compiler-runtime";
|
|
7
|
+
import { Box as ne, Center as re, Stack as ie, Text as ae } from "@chakra-ui/react";
|
|
8
|
+
import { createElement as D, useEffect as O, useRef as k, useState as A } from "react";
|
|
9
|
+
import { jsx as j, jsxs as oe } from "react/jsx-runtime";
|
|
10
|
+
import { renderBadgeListDisplay as se } from "@pstdio/ui/kanban-renderer";
|
|
11
|
+
import { host as ce } from "rimless";
|
|
12
|
+
//#region ../pstdio-api-contracts/src/extension-kernel/workbench-targets.ts
|
|
13
|
+
var le = ["workbench.nav.actions", "workbench.nav.overflow"], ue = [
|
|
14
|
+
"workbench.left.tree",
|
|
15
|
+
"workbench.main.left.tree",
|
|
16
|
+
"workbench.main.right.tree"
|
|
17
|
+
], de = [
|
|
18
|
+
"nav",
|
|
19
|
+
"activity",
|
|
20
|
+
"sidenav",
|
|
21
|
+
"main-header",
|
|
22
|
+
"main",
|
|
23
|
+
"secondary-header",
|
|
24
|
+
"secondary",
|
|
25
|
+
"side-header",
|
|
26
|
+
"side",
|
|
27
|
+
"status",
|
|
28
|
+
"overlay"
|
|
29
|
+
], fe = [
|
|
30
|
+
"workbench.main",
|
|
31
|
+
"workbench.main.left",
|
|
32
|
+
"workbench.main.right",
|
|
33
|
+
"workbench.secondary"
|
|
34
|
+
], pe = ["workbench.settings"], me = ["project", "global"], he = [
|
|
35
|
+
"workbench.left",
|
|
36
|
+
"workbench.main.left",
|
|
37
|
+
"workbench.main",
|
|
38
|
+
"workbench.main.right",
|
|
39
|
+
"workbench.secondary"
|
|
40
|
+
], ge = y.enum(le), _e = y.enum(ue);
|
|
41
|
+
y.enum(de);
|
|
42
|
+
var ve = y.enum(fe), ye = y.enum(pe);
|
|
43
|
+
y.enum(he);
|
|
44
|
+
var be = y.union([
|
|
45
|
+
ge,
|
|
46
|
+
_e,
|
|
47
|
+
ve,
|
|
48
|
+
ye
|
|
49
|
+
]);
|
|
50
|
+
y.enum(me);
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region ../pstdio-api-contracts/src/extension-kernel/types/composition.ts
|
|
53
|
+
var xe = [
|
|
54
|
+
"main",
|
|
55
|
+
"secondary",
|
|
56
|
+
"side"
|
|
57
|
+
], Se = (e) => {
|
|
58
|
+
if (typeof e != "string") return !1;
|
|
59
|
+
try {
|
|
60
|
+
let { protocol: t } = new URL(e);
|
|
61
|
+
return t === "https:" || t === "http:";
|
|
62
|
+
} catch {
|
|
63
|
+
return !1;
|
|
64
|
+
}
|
|
65
|
+
}, Ce = y.union([
|
|
66
|
+
y.string(),
|
|
67
|
+
y.number(),
|
|
68
|
+
y.boolean(),
|
|
69
|
+
y.array(y.string())
|
|
70
|
+
]);
|
|
71
|
+
y.record(y.string(), y.discriminatedUnion("type", [
|
|
72
|
+
y.object({
|
|
73
|
+
type: y.literal("string"),
|
|
74
|
+
default: y.string().optional(),
|
|
75
|
+
values: y.array(y.string()).readonly().optional()
|
|
76
|
+
}).strict(),
|
|
77
|
+
y.object({
|
|
78
|
+
type: y.literal("number"),
|
|
79
|
+
default: y.number().optional()
|
|
80
|
+
}).strict(),
|
|
81
|
+
y.object({
|
|
82
|
+
type: y.literal("boolean"),
|
|
83
|
+
default: y.boolean().optional()
|
|
84
|
+
}).strict(),
|
|
85
|
+
y.object({
|
|
86
|
+
type: y.literal("string[]"),
|
|
87
|
+
default: y.array(y.string()).readonly().optional()
|
|
88
|
+
}).strict()
|
|
89
|
+
])).superRefine((e, t) => {
|
|
90
|
+
try {
|
|
91
|
+
v(e);
|
|
92
|
+
} catch (e) {
|
|
93
|
+
t.addIssue({
|
|
94
|
+
code: "custom",
|
|
95
|
+
message: String(e)
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region ../pstdio-api-contracts/src/extensions/workbench-refs-metadata.ts
|
|
101
|
+
var M = (e) => y.object({
|
|
102
|
+
extensionId: y.string(),
|
|
103
|
+
kind: y.literal(e),
|
|
104
|
+
id: y.string()
|
|
105
|
+
}), we = M("page"), Te = M("placement");
|
|
106
|
+
M("mode"), M("view"), M("resource-kind");
|
|
107
|
+
var Ee = y.object({
|
|
108
|
+
kind: y.literal("page-slot"),
|
|
109
|
+
page: we,
|
|
110
|
+
id: y.string()
|
|
111
|
+
}), De = y.union([Te, Ee]), Oe = y.object({
|
|
112
|
+
command: M("command"),
|
|
113
|
+
params: n.optional()
|
|
114
|
+
}), ke = y.object({
|
|
115
|
+
line: y.number().int().positive(),
|
|
116
|
+
column: y.number().int().positive().optional(),
|
|
117
|
+
endLine: y.number().int().positive().optional(),
|
|
118
|
+
endColumn: y.number().int().positive().optional()
|
|
119
|
+
}).refine(h, "Expected ordered source coordinates"), Ae = y.object({ anchors: y.array(y.object({
|
|
120
|
+
id: y.string(),
|
|
121
|
+
heading: y.string(),
|
|
122
|
+
occurrence: y.number().int().nonnegative().optional()
|
|
123
|
+
})) }), je = y.lazy(() => y.object({
|
|
124
|
+
kind: y.literal("page"),
|
|
125
|
+
page: we,
|
|
126
|
+
resource: p.optional(),
|
|
127
|
+
open: y.enum(["preview", "pin"]).optional(),
|
|
128
|
+
section: Ae.optional(),
|
|
129
|
+
position: ke.optional(),
|
|
130
|
+
params: y.record(y.string(), Ce).optional(),
|
|
131
|
+
parent: je.optional()
|
|
132
|
+
}).refine((e) => !(e.position && e.section), "Choose a source position or a heading section")).meta({ id: "WorkbenchMetadataPageTarget" }), Me = y.union([je, y.object({
|
|
133
|
+
kind: y.literal("panel"),
|
|
134
|
+
panel: De,
|
|
135
|
+
resource: p.optional(),
|
|
136
|
+
open: y.enum(["preview", "pin"]).optional()
|
|
137
|
+
})]), Ne = y.union([
|
|
138
|
+
Me,
|
|
139
|
+
y.object({
|
|
140
|
+
kind: y.literal("command"),
|
|
141
|
+
target: Oe
|
|
142
|
+
}),
|
|
143
|
+
y.object({
|
|
144
|
+
kind: y.literal("href"),
|
|
145
|
+
href: y.string().refine(Se, "Expected an HTTP or HTTPS URL")
|
|
146
|
+
}),
|
|
147
|
+
y.object({
|
|
148
|
+
kind: y.literal("compound"),
|
|
149
|
+
targets: y.array(Me).min(1)
|
|
150
|
+
})
|
|
151
|
+
]), Pe = y.object({
|
|
152
|
+
type: y.enum([
|
|
153
|
+
"info",
|
|
154
|
+
"success",
|
|
155
|
+
"warning",
|
|
156
|
+
"error"
|
|
157
|
+
]),
|
|
158
|
+
title: y.string().optional(),
|
|
159
|
+
message: y.string(),
|
|
160
|
+
metadata: n.optional()
|
|
161
|
+
}), Fe = y.object({
|
|
162
|
+
code: y.string(),
|
|
163
|
+
message: y.string(),
|
|
164
|
+
severity: y.enum([
|
|
165
|
+
"info",
|
|
166
|
+
"warning",
|
|
167
|
+
"error"
|
|
168
|
+
]),
|
|
169
|
+
extensionId: y.string().optional(),
|
|
170
|
+
commandId: y.string().optional(),
|
|
171
|
+
metadata: n.optional()
|
|
172
|
+
}), Ie = (e) => {
|
|
173
|
+
let t = y.object({
|
|
174
|
+
name: y.string().optional(),
|
|
175
|
+
message: y.string(),
|
|
176
|
+
stack: y.string().optional(),
|
|
177
|
+
cause: e.optional()
|
|
178
|
+
}), r = {
|
|
179
|
+
notices: y.array(Pe).optional(),
|
|
180
|
+
diagnostics: y.array(Fe).optional()
|
|
181
|
+
}, i = {
|
|
182
|
+
...r,
|
|
183
|
+
ok: y.literal(!1),
|
|
184
|
+
code: y.string().optional(),
|
|
185
|
+
reason: y.string(),
|
|
186
|
+
data: n.optional(),
|
|
187
|
+
cause: e.optional(),
|
|
188
|
+
error: t.optional()
|
|
189
|
+
}, a = Ne;
|
|
190
|
+
return y.discriminatedUnion("status", [
|
|
191
|
+
y.object({
|
|
192
|
+
...r,
|
|
193
|
+
ok: y.literal(!0),
|
|
194
|
+
status: y.literal("success"),
|
|
195
|
+
value: y.unknown().optional(),
|
|
196
|
+
navigationRequests: y.array(a).optional()
|
|
197
|
+
}).transform((e) => ({
|
|
198
|
+
...e,
|
|
199
|
+
value: e.value
|
|
200
|
+
})),
|
|
201
|
+
y.object({
|
|
202
|
+
...i,
|
|
203
|
+
status: y.literal("rejected")
|
|
204
|
+
}),
|
|
205
|
+
y.object({
|
|
206
|
+
...i,
|
|
207
|
+
status: y.literal("error")
|
|
208
|
+
})
|
|
209
|
+
]);
|
|
210
|
+
}, Le = Ie(y.json()), Re = y.object({
|
|
211
|
+
id: y.string(),
|
|
212
|
+
kind: e,
|
|
213
|
+
context: f
|
|
214
|
+
}), ze = y.object({
|
|
215
|
+
target: be,
|
|
216
|
+
mode: y.string().optional(),
|
|
217
|
+
projectId: y.string().optional(),
|
|
218
|
+
resource: p.optional()
|
|
219
|
+
});
|
|
220
|
+
y.object({
|
|
221
|
+
rendererId: y.string(),
|
|
222
|
+
pageParams: y.record(y.string(), Ce).optional(),
|
|
223
|
+
projectId: y.string().optional(),
|
|
224
|
+
modeId: y.string().optional(),
|
|
225
|
+
resource: p.optional(),
|
|
226
|
+
invocation: y.object({ placement: y.enum(["visible", "background"]) }).optional()
|
|
227
|
+
}), y.object({
|
|
228
|
+
projectId: y.string().min(1),
|
|
229
|
+
workspaceId: y.string().optional(),
|
|
230
|
+
params: f.optional(),
|
|
231
|
+
resource: p.optional(),
|
|
232
|
+
attachment: ze.optional(),
|
|
233
|
+
slot: Re.optional(),
|
|
234
|
+
source: t.optional(),
|
|
235
|
+
metadata: f.optional()
|
|
236
|
+
}), y.object({
|
|
237
|
+
workspaceId: y.string().optional(),
|
|
238
|
+
params: f.optional(),
|
|
239
|
+
resource: p.optional(),
|
|
240
|
+
attachment: ze.optional(),
|
|
241
|
+
slot: Re.optional(),
|
|
242
|
+
source: t.optional(),
|
|
243
|
+
metadata: f.optional()
|
|
244
|
+
}), y.object({
|
|
245
|
+
eventId: y.string().min(1),
|
|
246
|
+
payload: f
|
|
247
|
+
}).strict();
|
|
248
|
+
var Be = Ne, Ve = y.object({
|
|
249
|
+
ok: y.boolean(),
|
|
250
|
+
status: y.enum([
|
|
251
|
+
"success",
|
|
252
|
+
"rejected",
|
|
253
|
+
"error"
|
|
254
|
+
]),
|
|
255
|
+
value: y.unknown().optional(),
|
|
256
|
+
navigationRequests: y.array(Be).optional(),
|
|
257
|
+
code: y.string().optional(),
|
|
258
|
+
reason: y.string().optional(),
|
|
259
|
+
data: f.optional(),
|
|
260
|
+
error: y.object({
|
|
261
|
+
name: y.string().optional(),
|
|
262
|
+
message: y.string(),
|
|
263
|
+
stack: y.string().optional()
|
|
264
|
+
}).optional(),
|
|
265
|
+
notices: y.array(y.object({
|
|
266
|
+
type: y.enum([
|
|
267
|
+
"info",
|
|
268
|
+
"success",
|
|
269
|
+
"warning",
|
|
270
|
+
"error"
|
|
271
|
+
]),
|
|
272
|
+
title: y.string().optional(),
|
|
273
|
+
message: y.string(),
|
|
274
|
+
metadata: f.optional()
|
|
275
|
+
})).optional(),
|
|
276
|
+
diagnostics: y.array(y.object({
|
|
277
|
+
code: y.string(),
|
|
278
|
+
message: y.string(),
|
|
279
|
+
severity: y.enum([
|
|
280
|
+
"info",
|
|
281
|
+
"warning",
|
|
282
|
+
"error"
|
|
283
|
+
]),
|
|
284
|
+
extensionId: y.string().optional(),
|
|
285
|
+
commandId: y.string().optional(),
|
|
286
|
+
metadata: f.optional()
|
|
287
|
+
})).optional()
|
|
288
|
+
}), He = {
|
|
289
|
+
commandId: y.string(),
|
|
290
|
+
extensionId: y.string(),
|
|
291
|
+
eventIds: y.array(y.string()).optional()
|
|
292
|
+
};
|
|
293
|
+
y.object({
|
|
294
|
+
...He,
|
|
295
|
+
outcome: Ve
|
|
296
|
+
});
|
|
297
|
+
var Ue = ((e) => y.object({
|
|
298
|
+
...He,
|
|
299
|
+
outcome: Ie(e)
|
|
300
|
+
}))(y.json()), We = [
|
|
301
|
+
"is-any-of",
|
|
302
|
+
"is-none-of",
|
|
303
|
+
"is-empty",
|
|
304
|
+
"is-not-empty"
|
|
305
|
+
], Ge = {
|
|
306
|
+
boolean: [
|
|
307
|
+
"is",
|
|
308
|
+
"is-not",
|
|
309
|
+
"is-empty",
|
|
310
|
+
"is-not-empty"
|
|
311
|
+
],
|
|
312
|
+
string: [
|
|
313
|
+
"contains",
|
|
314
|
+
"does-not-contain",
|
|
315
|
+
"is",
|
|
316
|
+
"is-not",
|
|
317
|
+
"is-empty",
|
|
318
|
+
"is-not-empty"
|
|
319
|
+
],
|
|
320
|
+
number: [
|
|
321
|
+
"is",
|
|
322
|
+
"is-not",
|
|
323
|
+
"gt",
|
|
324
|
+
"gte",
|
|
325
|
+
"lt",
|
|
326
|
+
"lte",
|
|
327
|
+
"is-empty",
|
|
328
|
+
"is-not-empty"
|
|
329
|
+
],
|
|
330
|
+
date: [
|
|
331
|
+
"is",
|
|
332
|
+
"is-before",
|
|
333
|
+
"is-after",
|
|
334
|
+
"is-on-or-before",
|
|
335
|
+
"is-on-or-after",
|
|
336
|
+
"is-empty",
|
|
337
|
+
"is-not-empty"
|
|
338
|
+
],
|
|
339
|
+
enum: We,
|
|
340
|
+
status: We,
|
|
341
|
+
user: We,
|
|
342
|
+
"enum-multi": [
|
|
343
|
+
"has-any-of",
|
|
344
|
+
"has-all-of",
|
|
345
|
+
"has-none-of",
|
|
346
|
+
"is-empty",
|
|
347
|
+
"is-not-empty"
|
|
348
|
+
]
|
|
349
|
+
}, Ke = {
|
|
350
|
+
conjunction: "and",
|
|
351
|
+
rules: []
|
|
352
|
+
}, qe = [...new Set(Object.values(Ge).flat())], Je = y.enum(qe), Ye = y.object({
|
|
353
|
+
attributeId: y.string().min(1),
|
|
354
|
+
condition: Je,
|
|
355
|
+
value: y.union([
|
|
356
|
+
y.boolean(),
|
|
357
|
+
y.string(),
|
|
358
|
+
y.number(),
|
|
359
|
+
y.array(y.string())
|
|
360
|
+
]).optional()
|
|
361
|
+
}), Xe = y.strictObject({
|
|
362
|
+
conjunction: y.enum(["and", "or"]),
|
|
363
|
+
rules: y.array(Ye)
|
|
364
|
+
});
|
|
365
|
+
Xe.extend({ groups: y.array(Xe).optional() }).refine((e) => !e.groups?.length || e.conjunction === "and", { message: "Normal rules and advanced groups combine using AND" });
|
|
366
|
+
var Ze = y.object({
|
|
367
|
+
attributeId: y.string().min(1),
|
|
368
|
+
direction: y.enum(["asc", "desc"])
|
|
369
|
+
});
|
|
370
|
+
y.array(Ze).max(1, "A view allows only one sort");
|
|
371
|
+
//#endregion
|
|
372
|
+
//#region ../pstdio-api-contracts/src/extension-kernel/types/data-table-renderer.ts
|
|
373
|
+
var Qe = {
|
|
374
|
+
grouping: "none",
|
|
375
|
+
rowNumbers: !0,
|
|
376
|
+
wrapRows: !1,
|
|
377
|
+
showStats: !0,
|
|
378
|
+
hiddenColumns: [],
|
|
379
|
+
columnOrder: []
|
|
380
|
+
}, $e = {
|
|
381
|
+
viewMode: "board",
|
|
382
|
+
columnGrouping: "none",
|
|
383
|
+
rowGrouping: "none",
|
|
384
|
+
displayProperties: []
|
|
385
|
+
}, et = (e, t) => {
|
|
386
|
+
let n = {
|
|
387
|
+
...e,
|
|
388
|
+
...t.defaultSettings
|
|
389
|
+
};
|
|
390
|
+
return t.defaultViews?.length ? {
|
|
391
|
+
settings: n,
|
|
392
|
+
views: t.defaultViews.map((e) => ({
|
|
393
|
+
...e,
|
|
394
|
+
settings: {
|
|
395
|
+
...n,
|
|
396
|
+
...e.settings
|
|
397
|
+
},
|
|
398
|
+
filter: e.filter ?? Ke,
|
|
399
|
+
sorts: e.sorts ?? [],
|
|
400
|
+
builtIn: !0
|
|
401
|
+
}))
|
|
402
|
+
} : {
|
|
403
|
+
settings: n,
|
|
404
|
+
views: [{
|
|
405
|
+
id: "default",
|
|
406
|
+
title: "All",
|
|
407
|
+
settings: n,
|
|
408
|
+
filter: t.defaultFilter ?? Ke,
|
|
409
|
+
sorts: t.defaultSorts ?? [],
|
|
410
|
+
builtIn: !0
|
|
411
|
+
}]
|
|
412
|
+
};
|
|
413
|
+
}, tt = (e) => et($e, e), nt = (e) => et(Qe, e), rt = y.object({
|
|
414
|
+
resource: p,
|
|
415
|
+
autoOpen: y.boolean().optional(),
|
|
416
|
+
region: y.enum(xe),
|
|
417
|
+
open: y.enum(["preview", "pin"]).optional()
|
|
418
|
+
}), it = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n == "string", N = (e) => !(!e || typeof e != "object" || Array.isArray(e)), P = (e, t) => N(e) && e.kind === t && typeof e.id == "string", at = (e) => N(e) && typeof e.type == "string" && typeof e.id == "string", ot = (e) => e === void 0 || e === "preview" || e === "pin", st = (e, t = /* @__PURE__ */ new Set()) => {
|
|
419
|
+
if (!N(e) || e.kind !== "page" || !P(e.page, "page") || t.has(e) || e.resource !== void 0 && !at(e.resource) || e.section !== void 0 && !N(e.section) || e.position !== void 0 && (!h(e.position) || e.section !== void 0) || !ot(e.open)) return !1;
|
|
420
|
+
if (e.parent === void 0) return !0;
|
|
421
|
+
let n = new Set(t);
|
|
422
|
+
return n.add(e), st(e.parent, n);
|
|
423
|
+
}, ct = (e) => {
|
|
424
|
+
if (!N(e) || e.kind !== "panel" || !N(e.panel)) return !1;
|
|
20
425
|
let t = e.panel;
|
|
21
|
-
return (
|
|
22
|
-
},
|
|
426
|
+
return (P(t, "placement") || t.kind === "page-slot" && P(t.page, "page") && typeof t.id == "string") && (e.resource === void 0 || at(e.resource)) && ot(e.open);
|
|
427
|
+
}, lt = (e) => N(e) ? e.kind === "page" ? st(e) : e.kind === "panel" ? ct(e) : e.kind === "href" ? Se(e.href) : e.kind === "command" && N(e.target) && P(e.target.command, "command") && (e.target.params === void 0 || N(e.target.params)) : !1, ut = (e) => lt(e) ? !0 : !N(e) || e.kind !== "compound" || !Array.isArray(e.targets) || e.targets.length === 0 ? !1 : e.targets.every((e) => st(e) || ct(e)), F = (e, t) => e.extensionId !== void 0 || t === void 0 ? e : {
|
|
23
428
|
...e,
|
|
24
429
|
extensionId: t
|
|
25
|
-
},
|
|
430
|
+
}, dt = (e, t, n) => ({
|
|
26
431
|
...e,
|
|
27
|
-
page:
|
|
28
|
-
...e.resource ? { resource:
|
|
29
|
-
...e.parent ? { parent:
|
|
30
|
-
}),
|
|
432
|
+
page: F(e.page, t),
|
|
433
|
+
...e.resource ? { resource: ft(e.resource, t, n) } : {},
|
|
434
|
+
...e.parent ? { parent: dt(e.parent, t, n) } : {}
|
|
435
|
+
}), ft = (e, t, n) => ({
|
|
31
436
|
...e,
|
|
32
437
|
extensionId: e.extensionId ?? t,
|
|
33
438
|
projectId: e.projectId ?? n
|
|
34
|
-
}),
|
|
35
|
-
if (!
|
|
36
|
-
return e.kind === "page" ?
|
|
439
|
+
}), pt = (e, t, n) => {
|
|
440
|
+
if (!ut(e)) throw Error("Invalid navigation target.");
|
|
441
|
+
return e.kind === "page" ? dt(e, t, n) : e.kind === "panel" ? {
|
|
37
442
|
...e,
|
|
38
443
|
panel: e.panel.kind === "page-slot" ? {
|
|
39
444
|
...e.panel,
|
|
40
|
-
page:
|
|
41
|
-
} :
|
|
42
|
-
...e.resource ? { resource:
|
|
445
|
+
page: F(e.panel.page, t)
|
|
446
|
+
} : F(e.panel, t),
|
|
447
|
+
...e.resource ? { resource: ft(e.resource, t, n) } : {}
|
|
43
448
|
} : e.kind === "command" ? {
|
|
44
449
|
...e,
|
|
45
450
|
target: {
|
|
46
451
|
...e.target,
|
|
47
|
-
command:
|
|
452
|
+
command: F(e.target.command, t)
|
|
48
453
|
}
|
|
49
454
|
} : e.kind === "href" ? e : {
|
|
50
455
|
...e,
|
|
51
|
-
targets: e.targets.map((e) =>
|
|
456
|
+
targets: e.targets.map((e) => pt(e, t, n))
|
|
52
457
|
};
|
|
53
|
-
},
|
|
458
|
+
}, mt = (e) => {
|
|
54
459
|
let t = [], n = (e) => ({
|
|
55
460
|
...e,
|
|
56
461
|
name: e.name,
|
|
@@ -73,7 +478,30 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
73
478
|
}
|
|
74
479
|
return r;
|
|
75
480
|
}));
|
|
76
|
-
},
|
|
481
|
+
}, ht = [
|
|
482
|
+
"clipboard.write",
|
|
483
|
+
"commands.execute",
|
|
484
|
+
"commands.stream",
|
|
485
|
+
"harnesses.read",
|
|
486
|
+
"resources.actions",
|
|
487
|
+
"navigation.open",
|
|
488
|
+
"page.params.update",
|
|
489
|
+
"placement.close",
|
|
490
|
+
"notification.show",
|
|
491
|
+
"notification.action",
|
|
492
|
+
"notification.resolve",
|
|
493
|
+
"notification.dismiss",
|
|
494
|
+
"preferences.get",
|
|
495
|
+
"preferences.set",
|
|
496
|
+
"extension.settings.all",
|
|
497
|
+
"extension.settings.get",
|
|
498
|
+
"extension.settings.set",
|
|
499
|
+
"extension.settings.delete",
|
|
500
|
+
"terminal.session",
|
|
501
|
+
"files.upload",
|
|
502
|
+
"files.list",
|
|
503
|
+
"files.delete"
|
|
504
|
+
], gt = ["artifacts.read"], _t = [...ht.filter((e) => e !== "clipboard.write"), ...gt], vt = "resources.actions", yt = /* @__PURE__ */ new Set([..._t, ...ht]), bt = new Set(gt), xt = (e) => yt.has(e), St = (e) => bt.has(e), Ct = (e) => {
|
|
77
505
|
let [t = "", n] = e.split("@"), r = t.indexOf(":");
|
|
78
506
|
return {
|
|
79
507
|
capability: e,
|
|
@@ -81,36 +509,36 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
81
509
|
scope: r === -1 ? void 0 : t.slice(r + 1),
|
|
82
510
|
version: n === void 0 ? 1 : Number(n)
|
|
83
511
|
};
|
|
84
|
-
},
|
|
512
|
+
}, wt = (e) => St(e.name) ? !!e.scope : e.scope === void 0, I = (e) => ({
|
|
85
513
|
capability: e,
|
|
86
514
|
code: "unsupported_webview_capability",
|
|
87
515
|
message: `Unsupported webview capability: ${e}`,
|
|
88
516
|
severity: "error"
|
|
89
|
-
}),
|
|
517
|
+
}), Tt = (e, t, n) => ({
|
|
90
518
|
capability: e,
|
|
91
519
|
code: "unsupported_webview_capability_version",
|
|
92
520
|
message: `Unsupported webview capability version: ${t}@${n.toString()} (supported: 1)`,
|
|
93
521
|
severity: "error"
|
|
94
|
-
}),
|
|
522
|
+
}), Et = (e) => ({
|
|
95
523
|
capability: e,
|
|
96
524
|
code: "undeclared_webview_capability",
|
|
97
525
|
message: `Webview did not declare host capability: ${e}`,
|
|
98
526
|
severity: "error"
|
|
99
|
-
}),
|
|
527
|
+
}), Dt = (e, t = {}) => {
|
|
100
528
|
let n = [], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map();
|
|
101
529
|
for (let a of e ?? []) {
|
|
102
|
-
let e =
|
|
103
|
-
if (!
|
|
104
|
-
n.push(
|
|
530
|
+
let e = Ct(a);
|
|
531
|
+
if (!xt(e.name) || !wt(e)) {
|
|
532
|
+
n.push(I(a));
|
|
105
533
|
continue;
|
|
106
534
|
}
|
|
107
535
|
if (e.version !== 1) {
|
|
108
|
-
n.push(
|
|
536
|
+
n.push(Tt(a, e.name, e.version));
|
|
109
537
|
continue;
|
|
110
538
|
}
|
|
111
539
|
if (e.name === "clipboard.write") continue;
|
|
112
540
|
if (!t[e.name]) {
|
|
113
|
-
n.push(
|
|
541
|
+
n.push(I(a));
|
|
114
542
|
continue;
|
|
115
543
|
}
|
|
116
544
|
if (e.scope === void 0) {
|
|
@@ -125,11 +553,11 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
125
553
|
allowedScopes: i,
|
|
126
554
|
diagnostics: n
|
|
127
555
|
};
|
|
128
|
-
},
|
|
556
|
+
}, Ot = (e) => {
|
|
129
557
|
let t = e.params;
|
|
130
558
|
return typeof t?.mount == "string" && t.mount.length > 0 ? t.mount : void 0;
|
|
131
|
-
},
|
|
132
|
-
let { allowed: t, allowedScopes: n, diagnostics: r } =
|
|
559
|
+
}, kt = (e) => {
|
|
560
|
+
let { allowed: t, allowedScopes: n, diagnostics: r } = Dt(e.declaredCapabilities, e.capabilities), i = (t) => {
|
|
133
561
|
e.onDiagnostic?.(t);
|
|
134
562
|
}, a = (e) => (i(e), Object.assign(Error(e.message), {
|
|
135
563
|
code: e.code,
|
|
@@ -138,18 +566,18 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
138
566
|
return {
|
|
139
567
|
diagnostics: r,
|
|
140
568
|
async call(r) {
|
|
141
|
-
if (!
|
|
142
|
-
if (
|
|
143
|
-
let e =
|
|
144
|
-
if (!e) throw a(
|
|
145
|
-
if (!n.get(r.method)?.has(e)) throw a(
|
|
146
|
-
} else if (!t.has(r.method)) throw a(
|
|
569
|
+
if (!xt(r.method) || r.method === "clipboard.write") throw a(I(r.method));
|
|
570
|
+
if (St(r.method)) {
|
|
571
|
+
let e = Ot(r);
|
|
572
|
+
if (!e) throw a(I(r.method));
|
|
573
|
+
if (!n.get(r.method)?.has(e)) throw a(Et(`${r.method}:${e}`));
|
|
574
|
+
} else if (!t.has(r.method)) throw a(Et(r.method));
|
|
147
575
|
let i = e.capabilities[r.method];
|
|
148
|
-
if (!i) throw a(
|
|
576
|
+
if (!i) throw a(I(r.method));
|
|
149
577
|
return await i(r.params);
|
|
150
578
|
}
|
|
151
579
|
};
|
|
152
|
-
},
|
|
580
|
+
}, At = (e = {}) => {
|
|
153
581
|
let t = e.locale ?? "en";
|
|
154
582
|
return {
|
|
155
583
|
...e,
|
|
@@ -166,7 +594,7 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
166
594
|
defaultBundle: {}
|
|
167
595
|
}
|
|
168
596
|
};
|
|
169
|
-
},
|
|
597
|
+
}, jt = (e) => typeof e == "object" && !!e, Mt = (e) => {
|
|
170
598
|
try {
|
|
171
599
|
let t = JSON.stringify(e);
|
|
172
600
|
if (typeof t == "string" && t.length > 0) return t;
|
|
@@ -176,21 +604,21 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
176
604
|
} catch {
|
|
177
605
|
return "Unknown error";
|
|
178
606
|
}
|
|
179
|
-
},
|
|
607
|
+
}, Nt = (e) => {
|
|
180
608
|
if (e instanceof Error) return {
|
|
181
609
|
message: e.message,
|
|
182
610
|
stack: e.stack
|
|
183
611
|
};
|
|
184
612
|
if (typeof e == "string") return { message: e };
|
|
185
|
-
if (
|
|
613
|
+
if (jt(e)) {
|
|
186
614
|
let t = typeof e.message == "string" ? e.message : null, n = typeof e.stack == "string" ? e.stack : void 0;
|
|
187
615
|
return t ? n ? {
|
|
188
616
|
message: t,
|
|
189
617
|
stack: n
|
|
190
|
-
} : { message: t } : { message:
|
|
618
|
+
} : { message: t } : { message: Mt(e) };
|
|
191
619
|
}
|
|
192
|
-
return e == null ? { message: "Unknown error" } : { message:
|
|
193
|
-
},
|
|
620
|
+
return e == null ? { message: "Unknown error" } : { message: Mt(e) };
|
|
621
|
+
}, Pt = async (e) => {
|
|
194
622
|
try {
|
|
195
623
|
return {
|
|
196
624
|
ok: !0,
|
|
@@ -202,12 +630,12 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
202
630
|
ok: !1,
|
|
203
631
|
error: {
|
|
204
632
|
code: "code" in t && typeof t.code == "string" ? t.code : "webview_capability_failed",
|
|
205
|
-
message:
|
|
633
|
+
message: Nt(e).message,
|
|
206
634
|
..."data" in t ? { data: t.data } : {}
|
|
207
635
|
}
|
|
208
636
|
};
|
|
209
637
|
}
|
|
210
|
-
},
|
|
638
|
+
}, Ft = (e = []) => e.some((e) => e === "clipboard.write" || e === "clipboard.write@1") ? "fullscreen; clipboard-write" : "fullscreen", It = () => {
|
|
211
639
|
if (typeof document > "u") return {};
|
|
212
640
|
let e = getComputedStyle(document.documentElement), t = {};
|
|
213
641
|
for (let n = 0; n < e.length; n += 1) {
|
|
@@ -215,48 +643,63 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
215
643
|
r.startsWith("--chakra-") && (t[r] = e.getPropertyValue(r).trim());
|
|
216
644
|
}
|
|
217
645
|
return t;
|
|
218
|
-
},
|
|
646
|
+
}, Lt = (e) => {
|
|
219
647
|
if (typeof document > "u") return e;
|
|
220
648
|
let t = document.documentElement.getAttribute("data-theme");
|
|
221
649
|
if (t === "dark" || t === "light") return t;
|
|
222
650
|
let n = document.documentElement.getAttribute("data-color-mode");
|
|
223
651
|
return n === "dark" || n === "light" ? n : e;
|
|
224
|
-
},
|
|
652
|
+
}, Rt = {
|
|
225
653
|
border: 0,
|
|
226
654
|
display: "block",
|
|
227
655
|
flex: "1 1 0%",
|
|
228
656
|
height: "100%",
|
|
229
657
|
minHeight: 0,
|
|
230
658
|
width: "100%"
|
|
231
|
-
},
|
|
659
|
+
}, zt = {
|
|
232
660
|
display: "flex",
|
|
233
661
|
height: "100%",
|
|
234
662
|
minHeight: 0,
|
|
235
663
|
position: "relative",
|
|
236
664
|
width: "100%"
|
|
237
|
-
},
|
|
238
|
-
let { view: t, props: n, theme: r, capabilities: i, onKeyboardEvent: a, hostEvents: o, onReady: s, onError: c, onDiagnostics: l, title: u } = e,
|
|
239
|
-
return
|
|
240
|
-
let e =
|
|
665
|
+
}, Bt = "allow-scripts allow-forms allow-popups", Vt = (e) => {
|
|
666
|
+
let { view: t, props: n, theme: r, capabilities: i, onKeyboardEvent: a, hostEvents: o, onReady: s, onError: c, onDiagnostics: l, title: u, sizing: d } = e, f = k(null), p = k(null), m = k(!1), h = k(null), g = k(At(n)), _ = k(r), v = k(i), y = k(a), b = k(o), x = k(t.webview.capabilities), S = k(s), C = k(c), w = k(l), [T, ee] = A(0), [E, te] = A(0);
|
|
667
|
+
return g.current = At(n), _.current = r, v.current = i, y.current = a, b.current = o, x.current = t.webview.capabilities, S.current = s, C.current = c, w.current = l, O(() => {
|
|
668
|
+
let e = f.current;
|
|
241
669
|
if (!e) return;
|
|
242
670
|
let n = () => {
|
|
243
|
-
e.contentWindow !==
|
|
671
|
+
e.contentWindow !== h.current && ee((e) => e + 1);
|
|
244
672
|
};
|
|
245
673
|
e.addEventListener("load", n);
|
|
246
674
|
let r = () => e.removeEventListener("load", n);
|
|
247
|
-
if (e.contentWindow ===
|
|
248
|
-
|
|
675
|
+
if (e.contentWindow === h.current) return r;
|
|
676
|
+
h.current = e.contentWindow;
|
|
249
677
|
let i = t.webview.styles, a = t.webview.moduleUrl, o = (e) => {
|
|
250
|
-
e.length > 0 &&
|
|
251
|
-
}, s = () =>
|
|
252
|
-
capabilities:
|
|
253
|
-
declaredCapabilities:
|
|
678
|
+
e.length > 0 && w.current?.(e);
|
|
679
|
+
}, s = () => kt({
|
|
680
|
+
capabilities: v.current ?? {},
|
|
681
|
+
declaredCapabilities: x.current,
|
|
254
682
|
onDiagnostic: (e) => o([e])
|
|
255
683
|
});
|
|
256
684
|
o(s().diagnostics);
|
|
257
685
|
let c = {
|
|
686
|
+
dispatchPointerEvent: (t) => {
|
|
687
|
+
if (f.current !== e || !e.isConnected || t.type !== "pointerdown" && t.type !== "click") return;
|
|
688
|
+
let n = e.getBoundingClientRect();
|
|
689
|
+
n.width && n.height && e.dispatchEvent(new PointerEvent(t.type, {
|
|
690
|
+
...t,
|
|
691
|
+
bubbles: !0,
|
|
692
|
+
composed: !0,
|
|
693
|
+
cancelable: !0,
|
|
694
|
+
clientX: n.left + t.clientX * (n.width / e.clientWidth),
|
|
695
|
+
clientY: n.top + t.clientY * (n.height / e.clientHeight)
|
|
696
|
+
}));
|
|
697
|
+
},
|
|
698
|
+
contentWidthChanged: (e) => {
|
|
699
|
+
d === "content-width" && Number.isFinite(e) && e >= 0 && te(e);
|
|
700
|
+
},
|
|
258
701
|
dispatchKeyboardEvent: async (e) => {
|
|
259
|
-
if (
|
|
702
|
+
if (y.current) return y.current(e);
|
|
260
703
|
document.dispatchEvent(new KeyboardEvent("keydown", {
|
|
261
704
|
...e,
|
|
262
705
|
bubbles: !0,
|
|
@@ -265,51 +708,53 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
265
708
|
},
|
|
266
709
|
ready: () => {},
|
|
267
710
|
runtimeError: (e) => {
|
|
268
|
-
|
|
711
|
+
C.current?.(e);
|
|
269
712
|
},
|
|
270
|
-
call: async (e) => await
|
|
713
|
+
call: async (e) => await Pt(() => s().call(e))
|
|
271
714
|
};
|
|
272
715
|
return (() => {
|
|
273
|
-
|
|
274
|
-
let n =
|
|
716
|
+
m.current = !1, p.current = null;
|
|
717
|
+
let n = ce.connect(e, c);
|
|
275
718
|
e.contentWindow?.location.replace(t.webview.runtimeUrl), n.then(async (n) => {
|
|
276
|
-
if (
|
|
719
|
+
if (f.current !== e) return;
|
|
277
720
|
let r = n.remote;
|
|
278
|
-
|
|
721
|
+
p.current = r, b.current?.bind((e) => r.hostEvent?.(e)), await r.init({
|
|
722
|
+
sizing: d,
|
|
279
723
|
moduleUrl: a,
|
|
280
724
|
styles: i,
|
|
281
|
-
props:
|
|
282
|
-
theme:
|
|
283
|
-
themeVariables:
|
|
725
|
+
props: g.current,
|
|
726
|
+
theme: Lt(_.current),
|
|
727
|
+
themeVariables: It(),
|
|
284
728
|
extensionId: t.extensionId
|
|
285
|
-
}),
|
|
729
|
+
}), f.current === e && (m.current = !0, S.current?.());
|
|
286
730
|
}).catch((t) => {
|
|
287
|
-
|
|
731
|
+
f.current === e && C.current?.(Nt(t));
|
|
288
732
|
});
|
|
289
733
|
})(), r;
|
|
290
734
|
}, [
|
|
291
|
-
|
|
735
|
+
T,
|
|
736
|
+
d,
|
|
292
737
|
t.extensionId,
|
|
293
738
|
t.webview.runtimeUrl,
|
|
294
739
|
t.webview.moduleUrl,
|
|
295
740
|
t.webview.styles
|
|
296
|
-
]),
|
|
297
|
-
let e =
|
|
741
|
+
]), O(() => {
|
|
742
|
+
let e = p.current;
|
|
298
743
|
if (e && o) return o.bind((t) => e.hostEvent?.(t)), () => o.unbind();
|
|
299
|
-
}, [o]),
|
|
300
|
-
|
|
301
|
-
}, [n]),
|
|
302
|
-
|
|
303
|
-
theme:
|
|
304
|
-
variables:
|
|
744
|
+
}, [o]), O(() => {
|
|
745
|
+
m.current && p.current?.propsUpdate({ props: At(n) });
|
|
746
|
+
}, [n]), O(() => {
|
|
747
|
+
m.current && p.current?.themeUpdate({
|
|
748
|
+
theme: Lt(r),
|
|
749
|
+
variables: It()
|
|
305
750
|
});
|
|
306
|
-
}, [r]),
|
|
751
|
+
}, [r]), O(() => {
|
|
307
752
|
if (typeof window > "u" || typeof MutationObserver > "u") return;
|
|
308
753
|
let e = null, t = new MutationObserver(() => {
|
|
309
754
|
e !== null && cancelAnimationFrame(e), e = requestAnimationFrame(() => {
|
|
310
|
-
e = null,
|
|
311
|
-
theme:
|
|
312
|
-
variables:
|
|
755
|
+
e = null, m.current && p.current?.themeUpdate({
|
|
756
|
+
theme: Lt(_.current),
|
|
757
|
+
variables: It()
|
|
313
758
|
});
|
|
314
759
|
});
|
|
315
760
|
}), n = {
|
|
@@ -324,26 +769,29 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
324
769
|
return t.observe(document.documentElement, n), t.observe(document.body, n), () => {
|
|
325
770
|
t.disconnect(), e !== null && cancelAnimationFrame(e);
|
|
326
771
|
};
|
|
327
|
-
}, []), /* @__PURE__ */
|
|
328
|
-
style:
|
|
329
|
-
|
|
330
|
-
|
|
772
|
+
}, []), /* @__PURE__ */ j("div", {
|
|
773
|
+
style: {
|
|
774
|
+
...zt,
|
|
775
|
+
width: d === "content-width" ? E : "100%"
|
|
776
|
+
},
|
|
777
|
+
children: /* @__PURE__ */ j("iframe", {
|
|
778
|
+
ref: f,
|
|
331
779
|
title: u ?? t.label,
|
|
332
|
-
allow:
|
|
333
|
-
sandbox:
|
|
780
|
+
allow: Ft(t.webview.capabilities),
|
|
781
|
+
sandbox: Bt,
|
|
334
782
|
style: {
|
|
335
|
-
...
|
|
783
|
+
...Rt,
|
|
336
784
|
colorScheme: r
|
|
337
785
|
},
|
|
338
786
|
onError: () => {
|
|
339
|
-
|
|
787
|
+
C.current?.({ message: `Failed to load extension runtime at ${t.webview.runtimeUrl}` });
|
|
340
788
|
}
|
|
341
|
-
}, `${
|
|
789
|
+
}, `${T}\n${t.webview.runtimeUrl}\n${t.webview.moduleUrl}`)
|
|
342
790
|
});
|
|
343
|
-
},
|
|
344
|
-
t(`${
|
|
345
|
-
},
|
|
346
|
-
let n = (n) =>
|
|
791
|
+
}, Ht = "[pstdio.extension-host] ", Ut = (e, t = console.info) => {
|
|
792
|
+
t(`${Ht}${JSON.stringify(e)}`);
|
|
793
|
+
}, Wt = (e, t) => {
|
|
794
|
+
let n = (n) => Ut({
|
|
347
795
|
extensionId: e.extensionId,
|
|
348
796
|
contributionId: e.id,
|
|
349
797
|
...n
|
|
@@ -361,7 +809,7 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
361
809
|
});
|
|
362
810
|
}
|
|
363
811
|
};
|
|
364
|
-
},
|
|
812
|
+
}, Gt = () => {
|
|
365
813
|
let e = null, t = [], n = /* @__PURE__ */ new Set();
|
|
366
814
|
return {
|
|
367
815
|
emit(n) {
|
|
@@ -378,83 +826,83 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
378
826
|
for (let e of n) e();
|
|
379
827
|
}
|
|
380
828
|
};
|
|
381
|
-
},
|
|
382
|
-
let t =
|
|
829
|
+
}, Kt = (e) => {
|
|
830
|
+
let t = te(38), n, r, i;
|
|
383
831
|
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({view: r, workbench: i, ...n} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
|
|
384
|
-
let [a, o] =
|
|
832
|
+
let [a, o] = A(i.pages.store.getState), s;
|
|
385
833
|
t[4] === i.pages.store ? s = t[5] : (s = () => i.pages.store.subscribe((e) => o(e)), t[4] = i.pages.store, t[5] = s);
|
|
386
834
|
let c;
|
|
387
|
-
t[6] === i ? c = t[7] : (c = [i], t[6] = i, t[7] = c),
|
|
835
|
+
t[6] === i ? c = t[7] : (c = [i], t[6] = i, t[7] = c), O(s, c);
|
|
388
836
|
let l, u;
|
|
389
837
|
if (t[8] !== a.activePageId || t[9] !== a.location || t[10] !== i.pages) {
|
|
390
838
|
let e = a.activePageId ? i.pages.getPage(a.activePageId) : void 0;
|
|
391
|
-
l = a.location, u =
|
|
839
|
+
l = a.location, u = _(e?.params, a.location?.params), t[8] = a.activePageId, t[9] = a.location, t[10] = i.pages, t[11] = l, t[12] = u;
|
|
392
840
|
} else l = t[11], u = t[12];
|
|
393
841
|
let d;
|
|
394
842
|
t[13] !== l || t[14] !== u ? (d = {
|
|
395
843
|
pageLocation: l,
|
|
396
844
|
pageParams: u
|
|
397
845
|
}, t[13] = l, t[14] = u, t[15] = d) : d = t[15];
|
|
398
|
-
let f = d, [p,
|
|
399
|
-
t[16] === r ?
|
|
400
|
-
let
|
|
401
|
-
t[18] === p ?
|
|
846
|
+
let f = d, [p, m] = A(null), h;
|
|
847
|
+
t[16] === r ? h = t[17] : (h = Wt(r), t[16] = r, t[17] = h);
|
|
848
|
+
let g = h, v = e.sizing ? "max-content" : "full", y;
|
|
849
|
+
t[18] === p ? y = t[19] : (y = p ? /* @__PURE__ */ j(re, {
|
|
402
850
|
position: "absolute",
|
|
403
851
|
inset: "0",
|
|
404
852
|
px: "md",
|
|
405
853
|
zIndex: 1,
|
|
406
854
|
bg: "bg",
|
|
407
|
-
children: /* @__PURE__ */
|
|
855
|
+
children: /* @__PURE__ */ oe(ie, {
|
|
408
856
|
gap: "xs",
|
|
409
857
|
maxW: "md",
|
|
410
858
|
textAlign: "center",
|
|
411
|
-
children: [/* @__PURE__ */
|
|
859
|
+
children: [/* @__PURE__ */ j(ae, {
|
|
412
860
|
textStyle: "paragraph/S/medium",
|
|
413
861
|
color: "fg.error",
|
|
414
862
|
children: "Extension view failed to load."
|
|
415
|
-
}), /* @__PURE__ */
|
|
863
|
+
}), /* @__PURE__ */ j(ae, {
|
|
416
864
|
textStyle: "paragraph/XS/regular",
|
|
417
865
|
color: "fg.muted",
|
|
418
866
|
children: p
|
|
419
867
|
})]
|
|
420
868
|
})
|
|
421
|
-
}) : null, t[18] = p, t[19] =
|
|
422
|
-
let
|
|
423
|
-
t[20] !== n.props || t[21] !== f ? (
|
|
869
|
+
}) : null, t[18] = p, t[19] = y);
|
|
870
|
+
let b;
|
|
871
|
+
t[20] !== n.props || t[21] !== f ? (b = {
|
|
424
872
|
...n.props,
|
|
425
873
|
...f
|
|
426
|
-
}, t[20] = n.props, t[21] = f, t[22] =
|
|
427
|
-
let b;
|
|
428
|
-
t[23] === _ ? b = t[24] : (b = () => {
|
|
429
|
-
_.onReady(), h(null);
|
|
430
|
-
}, t[23] = _, t[24] = b);
|
|
874
|
+
}, t[20] = n.props, t[21] = f, t[22] = b) : b = t[22];
|
|
431
875
|
let x;
|
|
432
|
-
t[
|
|
433
|
-
|
|
434
|
-
}, t[
|
|
876
|
+
t[23] === g ? x = t[24] : (x = () => {
|
|
877
|
+
g.onReady(), m(null);
|
|
878
|
+
}, t[23] = g, t[24] = x);
|
|
435
879
|
let S;
|
|
436
|
-
t[
|
|
880
|
+
t[25] === g ? S = t[26] : (S = (e) => {
|
|
881
|
+
g.onError(e), m(e.message);
|
|
882
|
+
}, t[25] = g, t[26] = S);
|
|
883
|
+
let C;
|
|
884
|
+
t[27] !== g.onDiagnostics || t[28] !== n || t[29] !== S || t[30] !== b || t[31] !== x || t[32] !== r ? (C = /* @__PURE__ */ j(Vt, {
|
|
437
885
|
view: r,
|
|
438
886
|
...n,
|
|
439
|
-
props:
|
|
440
|
-
onReady:
|
|
441
|
-
onDiagnostics:
|
|
442
|
-
onError:
|
|
443
|
-
}), t[27] =
|
|
444
|
-
let
|
|
445
|
-
return t[34] !==
|
|
887
|
+
props: b,
|
|
888
|
+
onReady: x,
|
|
889
|
+
onDiagnostics: g.onDiagnostics,
|
|
890
|
+
onError: S
|
|
891
|
+
}), t[27] = g.onDiagnostics, t[28] = n, t[29] = S, t[30] = b, t[31] = x, t[32] = r, t[33] = C) : C = t[33];
|
|
892
|
+
let w;
|
|
893
|
+
return t[34] !== C || t[35] !== v || t[36] !== y ? (w = /* @__PURE__ */ oe(ne, {
|
|
446
894
|
position: "relative",
|
|
447
|
-
width:
|
|
448
|
-
height: "
|
|
895
|
+
width: v,
|
|
896
|
+
height: "full",
|
|
449
897
|
minH: "0",
|
|
450
898
|
display: "flex",
|
|
451
899
|
flexDirection: "column",
|
|
452
|
-
children: [
|
|
453
|
-
}), t[34] =
|
|
454
|
-
},
|
|
900
|
+
children: [y, C]
|
|
901
|
+
}), t[34] = C, t[35] = v, t[36] = y, t[37] = w) : w = t[37], w;
|
|
902
|
+
}, qt = "terminal.session", Jt = (e) => {
|
|
455
903
|
let { terminal: t, hostEvents: n } = e, r = (e) => {
|
|
456
904
|
n.emit({
|
|
457
|
-
scope:
|
|
905
|
+
scope: qt,
|
|
458
906
|
payload: e
|
|
459
907
|
});
|
|
460
908
|
};
|
|
@@ -515,34 +963,34 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
515
963
|
}
|
|
516
964
|
}
|
|
517
965
|
};
|
|
518
|
-
},
|
|
519
|
-
|
|
520
|
-
kind:
|
|
521
|
-
id:
|
|
522
|
-
label:
|
|
523
|
-
target:
|
|
524
|
-
primary:
|
|
966
|
+
}, Yt = y.discriminatedUnion("kind", [
|
|
967
|
+
y.object({
|
|
968
|
+
kind: y.literal("navigate"),
|
|
969
|
+
id: y.string(),
|
|
970
|
+
label: y.string(),
|
|
971
|
+
target: y.custom(ut, "Invalid navigation target."),
|
|
972
|
+
primary: y.boolean().optional()
|
|
525
973
|
}),
|
|
526
|
-
|
|
527
|
-
kind:
|
|
528
|
-
id:
|
|
529
|
-
label:
|
|
530
|
-
command:
|
|
531
|
-
params:
|
|
532
|
-
primary:
|
|
533
|
-
destructive:
|
|
974
|
+
y.object({
|
|
975
|
+
kind: y.literal("command"),
|
|
976
|
+
id: y.string(),
|
|
977
|
+
label: y.string(),
|
|
978
|
+
command: y.string(),
|
|
979
|
+
params: f.optional(),
|
|
980
|
+
primary: y.boolean().optional(),
|
|
981
|
+
destructive: y.boolean().optional()
|
|
534
982
|
}),
|
|
535
|
-
|
|
536
|
-
kind:
|
|
537
|
-
id:
|
|
538
|
-
label:
|
|
539
|
-
href:
|
|
540
|
-
primary:
|
|
983
|
+
y.object({
|
|
984
|
+
kind: y.literal("url"),
|
|
985
|
+
id: y.string(),
|
|
986
|
+
label: y.string(),
|
|
987
|
+
href: y.string(),
|
|
988
|
+
primary: y.boolean().optional()
|
|
541
989
|
})
|
|
542
|
-
]),
|
|
543
|
-
title:
|
|
544
|
-
body:
|
|
545
|
-
kind:
|
|
990
|
+
]), Xt = y.object({
|
|
991
|
+
title: y.string().min(1),
|
|
992
|
+
body: y.string().optional(),
|
|
993
|
+
kind: y.enum([
|
|
546
994
|
"needs_review",
|
|
547
995
|
"ready_to_merge",
|
|
548
996
|
"blocked",
|
|
@@ -550,33 +998,33 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
550
998
|
"failed",
|
|
551
999
|
"info"
|
|
552
1000
|
]),
|
|
553
|
-
priority:
|
|
1001
|
+
priority: y.enum([
|
|
554
1002
|
"low",
|
|
555
1003
|
"normal",
|
|
556
1004
|
"high",
|
|
557
1005
|
"urgent"
|
|
558
1006
|
]).optional(),
|
|
559
|
-
target:
|
|
560
|
-
related:
|
|
561
|
-
actions:
|
|
562
|
-
dedupeKey:
|
|
563
|
-
expiresAt:
|
|
564
|
-
snoozedUntil:
|
|
565
|
-
metadata:
|
|
566
|
-
}),
|
|
1007
|
+
target: p.optional(),
|
|
1008
|
+
related: y.array(p).optional(),
|
|
1009
|
+
actions: y.array(Yt).optional(),
|
|
1010
|
+
dedupeKey: y.string().optional(),
|
|
1011
|
+
expiresAt: y.string().optional(),
|
|
1012
|
+
snoozedUntil: y.string().optional(),
|
|
1013
|
+
metadata: f.optional()
|
|
1014
|
+
}), L = class extends Error {
|
|
567
1015
|
code;
|
|
568
1016
|
data;
|
|
569
1017
|
constructor(e, t, n) {
|
|
570
1018
|
super(t), this.code = e, this.data = n, this.name = "WebviewHostCapabilityError";
|
|
571
1019
|
}
|
|
572
|
-
},
|
|
573
|
-
commandId:
|
|
574
|
-
params:
|
|
575
|
-
workspaceId:
|
|
576
|
-
resource:
|
|
577
|
-
metadata:
|
|
578
|
-
}),
|
|
579
|
-
scope:
|
|
1020
|
+
}, R = y.string().min(1), Zt = y.object({}).strict().optional(), Qt = y.object({
|
|
1021
|
+
commandId: R,
|
|
1022
|
+
params: f.optional(),
|
|
1023
|
+
workspaceId: R.optional(),
|
|
1024
|
+
resource: p.optional(),
|
|
1025
|
+
metadata: f.optional()
|
|
1026
|
+
}), $t = { streamId: R }, en = y.object({
|
|
1027
|
+
scope: y.enum([
|
|
580
1028
|
"default",
|
|
581
1029
|
"user",
|
|
582
1030
|
"project",
|
|
@@ -584,141 +1032,153 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
584
1032
|
"extension",
|
|
585
1033
|
"session"
|
|
586
1034
|
]),
|
|
587
|
-
scopeId:
|
|
588
|
-
}),
|
|
589
|
-
name:
|
|
590
|
-
scope:
|
|
591
|
-
}),
|
|
592
|
-
id:
|
|
593
|
-
dedupeKey:
|
|
594
|
-
status:
|
|
1035
|
+
scopeId: y.string().optional()
|
|
1036
|
+
}), tn = y.object({
|
|
1037
|
+
name: R,
|
|
1038
|
+
scope: en.optional()
|
|
1039
|
+
}), nn = y.object({
|
|
1040
|
+
id: R.optional(),
|
|
1041
|
+
dedupeKey: y.string().optional(),
|
|
1042
|
+
status: y.enum([
|
|
595
1043
|
"done",
|
|
596
1044
|
"dismissed",
|
|
597
1045
|
"expired"
|
|
598
1046
|
]).optional()
|
|
599
|
-
}).refine((e) => e.id !== void 0 || e.dedupeKey !== void 0, "Provide a notification ID or dedupe key."),
|
|
600
|
-
type:
|
|
601
|
-
id:
|
|
602
|
-
}),
|
|
603
|
-
cols:
|
|
604
|
-
rows:
|
|
605
|
-
command:
|
|
606
|
-
cwd:
|
|
607
|
-
env:
|
|
608
|
-
}),
|
|
609
|
-
"
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
1047
|
+
}).refine((e) => e.id !== void 0 || e.dedupeKey !== void 0, "Provide a notification ID or dedupe key."), rn = y.union([y.instanceof(Uint8Array), y.instanceof(ArrayBuffer)]), an = y.object({
|
|
1048
|
+
type: R,
|
|
1049
|
+
id: y.string().optional()
|
|
1050
|
+
}), on = { sessionId: R }, sn = y.object({
|
|
1051
|
+
cols: y.number().int().positive(),
|
|
1052
|
+
rows: y.number().int().positive(),
|
|
1053
|
+
command: y.array(y.string()).optional(),
|
|
1054
|
+
cwd: y.string().optional(),
|
|
1055
|
+
env: y.record(y.string(), y.string()).optional()
|
|
1056
|
+
}), cn = {
|
|
1057
|
+
"harnesses.read": y.object({
|
|
1058
|
+
harnessId: R.optional(),
|
|
1059
|
+
model: y.string().optional()
|
|
1060
|
+
}),
|
|
1061
|
+
"resources.actions": y.discriminatedUnion("operation", [y.object({
|
|
1062
|
+
operation: y.literal("list"),
|
|
1063
|
+
resource: p
|
|
1064
|
+
}), y.object({
|
|
1065
|
+
operation: y.literal("execute"),
|
|
1066
|
+
resource: p,
|
|
1067
|
+
key: R
|
|
1068
|
+
})]),
|
|
1069
|
+
"commands.execute": Qt,
|
|
1070
|
+
"commands.stream": y.discriminatedUnion("operation", [
|
|
1071
|
+
Qt.extend({
|
|
1072
|
+
...$t,
|
|
1073
|
+
operation: y.literal("start")
|
|
614
1074
|
}),
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
operation:
|
|
1075
|
+
y.object({
|
|
1076
|
+
...$t,
|
|
1077
|
+
operation: y.literal("cancel")
|
|
618
1078
|
}),
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
operation:
|
|
622
|
-
bytes:
|
|
1079
|
+
y.object({
|
|
1080
|
+
...$t,
|
|
1081
|
+
operation: y.literal("ack"),
|
|
1082
|
+
bytes: y.number().int().positive()
|
|
623
1083
|
})
|
|
624
1084
|
]),
|
|
625
|
-
"navigation.open":
|
|
626
|
-
"page.params.update":
|
|
627
|
-
"placement.close":
|
|
628
|
-
"notification.show":
|
|
629
|
-
type:
|
|
1085
|
+
"navigation.open": y.object({ target: y.custom(ut, "Invalid navigation target.") }),
|
|
1086
|
+
"page.params.update": y.object({ params: y.record(y.string(), Ce.nullable()) }),
|
|
1087
|
+
"placement.close": Zt,
|
|
1088
|
+
"notification.show": y.union([y.object({
|
|
1089
|
+
type: y.enum([
|
|
630
1090
|
"info",
|
|
631
1091
|
"success",
|
|
632
1092
|
"warning",
|
|
633
1093
|
"error"
|
|
634
1094
|
]),
|
|
635
|
-
title:
|
|
636
|
-
message:
|
|
637
|
-
metadata:
|
|
638
|
-
}),
|
|
639
|
-
level:
|
|
1095
|
+
title: y.string().optional(),
|
|
1096
|
+
message: y.string(),
|
|
1097
|
+
metadata: f.optional()
|
|
1098
|
+
}), y.object({
|
|
1099
|
+
level: y.enum([
|
|
640
1100
|
"info",
|
|
641
1101
|
"success",
|
|
642
1102
|
"warning",
|
|
643
1103
|
"error"
|
|
644
1104
|
]),
|
|
645
|
-
title:
|
|
646
|
-
message:
|
|
1105
|
+
title: y.string().optional(),
|
|
1106
|
+
message: y.string().optional()
|
|
647
1107
|
})]),
|
|
648
|
-
"notification.action":
|
|
649
|
-
"notification.resolve":
|
|
650
|
-
"notification.dismiss":
|
|
651
|
-
"preferences.get":
|
|
652
|
-
"preferences.set":
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
1108
|
+
"notification.action": Xt,
|
|
1109
|
+
"notification.resolve": nn,
|
|
1110
|
+
"notification.dismiss": nn,
|
|
1111
|
+
"preferences.get": tn,
|
|
1112
|
+
"preferences.set": tn.extend({ value: y.union([
|
|
1113
|
+
y.boolean(),
|
|
1114
|
+
y.number(),
|
|
1115
|
+
y.string(),
|
|
1116
|
+
y.array(y.string()),
|
|
1117
|
+
y.array(y.number()),
|
|
1118
|
+
y.array(y.boolean()),
|
|
1119
|
+
f
|
|
660
1120
|
]) }),
|
|
661
|
-
"extension.settings.all":
|
|
662
|
-
"extension.settings.get":
|
|
663
|
-
"extension.settings.set":
|
|
664
|
-
key:
|
|
665
|
-
value:
|
|
1121
|
+
"extension.settings.all": Zt,
|
|
1122
|
+
"extension.settings.get": y.object({ key: R }),
|
|
1123
|
+
"extension.settings.set": y.object({
|
|
1124
|
+
key: R,
|
|
1125
|
+
value: y.unknown()
|
|
666
1126
|
}),
|
|
667
|
-
"extension.settings.delete":
|
|
668
|
-
"terminal.session":
|
|
669
|
-
|
|
670
|
-
operation:
|
|
671
|
-
request:
|
|
1127
|
+
"extension.settings.delete": y.object({ key: R }),
|
|
1128
|
+
"terminal.session": y.discriminatedUnion("operation", [
|
|
1129
|
+
y.object({
|
|
1130
|
+
operation: y.literal("open"),
|
|
1131
|
+
request: sn
|
|
672
1132
|
}),
|
|
673
|
-
|
|
674
|
-
...
|
|
675
|
-
operation:
|
|
676
|
-
data:
|
|
1133
|
+
y.object({
|
|
1134
|
+
...on,
|
|
1135
|
+
operation: y.literal("write"),
|
|
1136
|
+
data: y.union([y.string(), y.instanceof(Uint8Array)])
|
|
677
1137
|
}),
|
|
678
|
-
|
|
679
|
-
...
|
|
680
|
-
operation:
|
|
681
|
-
cols:
|
|
682
|
-
rows:
|
|
1138
|
+
y.object({
|
|
1139
|
+
...on,
|
|
1140
|
+
operation: y.literal("resize"),
|
|
1141
|
+
cols: y.number().int().positive(),
|
|
1142
|
+
rows: y.number().int().positive()
|
|
683
1143
|
}),
|
|
684
|
-
|
|
685
|
-
...
|
|
686
|
-
operation:
|
|
687
|
-
signal:
|
|
1144
|
+
y.object({
|
|
1145
|
+
...on,
|
|
1146
|
+
operation: y.literal("kill"),
|
|
1147
|
+
signal: y.string().optional()
|
|
688
1148
|
}),
|
|
689
|
-
|
|
690
|
-
...
|
|
691
|
-
operation:
|
|
1149
|
+
y.object({
|
|
1150
|
+
...on,
|
|
1151
|
+
operation: y.literal("subscribe")
|
|
692
1152
|
})
|
|
693
1153
|
]),
|
|
694
|
-
"files.upload":
|
|
695
|
-
name:
|
|
696
|
-
data:
|
|
697
|
-
mimeType:
|
|
698
|
-
scope:
|
|
1154
|
+
"files.upload": y.object({
|
|
1155
|
+
name: R,
|
|
1156
|
+
data: rn,
|
|
1157
|
+
mimeType: y.string().optional(),
|
|
1158
|
+
scope: an.optional()
|
|
699
1159
|
}),
|
|
700
|
-
"files.list":
|
|
701
|
-
"files.delete":
|
|
702
|
-
"artifacts.read":
|
|
703
|
-
|
|
704
|
-
op:
|
|
705
|
-
mount:
|
|
706
|
-
prefix:
|
|
1160
|
+
"files.list": y.object({ scope: an.optional() }),
|
|
1161
|
+
"files.delete": y.object({ id: R }),
|
|
1162
|
+
"artifacts.read": y.discriminatedUnion("op", [
|
|
1163
|
+
y.object({
|
|
1164
|
+
op: y.literal("list"),
|
|
1165
|
+
mount: R,
|
|
1166
|
+
prefix: y.string().optional()
|
|
707
1167
|
}),
|
|
708
|
-
|
|
709
|
-
op:
|
|
710
|
-
mount:
|
|
711
|
-
path:
|
|
1168
|
+
y.object({
|
|
1169
|
+
op: y.literal("readText"),
|
|
1170
|
+
mount: R,
|
|
1171
|
+
path: y.string()
|
|
712
1172
|
}),
|
|
713
|
-
|
|
714
|
-
op:
|
|
715
|
-
mount:
|
|
716
|
-
path:
|
|
1173
|
+
y.object({
|
|
1174
|
+
op: y.literal("imageUrl"),
|
|
1175
|
+
mount: R,
|
|
1176
|
+
path: y.string()
|
|
717
1177
|
})
|
|
718
1178
|
])
|
|
719
|
-
},
|
|
720
|
-
let n =
|
|
721
|
-
if (!n.success) throw new
|
|
1179
|
+
}, ln = (e, t) => {
|
|
1180
|
+
let n = cn[e].safeParse(t);
|
|
1181
|
+
if (!n.success) throw new L("invalid_params", `Invalid parameters for ${e}.`, {
|
|
722
1182
|
capability: e,
|
|
723
1183
|
issues: n.error.issues.map((e) => ({
|
|
724
1184
|
path: e.path.map(String),
|
|
@@ -726,13 +1186,13 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
726
1186
|
}))
|
|
727
1187
|
});
|
|
728
1188
|
return n.data;
|
|
729
|
-
},
|
|
1189
|
+
}, un = (e, t = e) => ({
|
|
730
1190
|
ok: !1,
|
|
731
1191
|
status: "error",
|
|
732
1192
|
code: e,
|
|
733
1193
|
reason: t
|
|
734
|
-
}),
|
|
735
|
-
let t =
|
|
1194
|
+
}), dn = (e) => {
|
|
1195
|
+
let t = mt(e);
|
|
736
1196
|
return {
|
|
737
1197
|
ok: !1,
|
|
738
1198
|
status: "error",
|
|
@@ -741,14 +1201,14 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
741
1201
|
error: t,
|
|
742
1202
|
...t.cause === void 0 ? {} : { cause: t.cause }
|
|
743
1203
|
};
|
|
744
|
-
},
|
|
1204
|
+
}, fn = (e) => Object.assign(Error(e), { code: e }), pn = 16, mn = 8388608, hn = async (e, t) => {
|
|
745
1205
|
let n = new AbortController(), r = e.onDisconnect(() => n.abort());
|
|
746
1206
|
try {
|
|
747
1207
|
return await t(n.signal);
|
|
748
1208
|
} finally {
|
|
749
1209
|
r();
|
|
750
1210
|
}
|
|
751
|
-
},
|
|
1211
|
+
}, gn = (e) => {
|
|
752
1212
|
let t = /* @__PURE__ */ new Map();
|
|
753
1213
|
return async (n, r) => {
|
|
754
1214
|
let { streamId: i } = n;
|
|
@@ -757,44 +1217,44 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
757
1217
|
let e = t.get(i);
|
|
758
1218
|
e && Number.isSafeInteger(n.bytes) && n.bytes > 0 && n.bytes <= e.unread && (e.unread -= n.bytes);
|
|
759
1219
|
} else {
|
|
760
|
-
if (t.has(i)) throw
|
|
761
|
-
if (t.size >=
|
|
762
|
-
let a = new AbortController(), o = !1,
|
|
1220
|
+
if (t.has(i)) throw fn("command_stream_duplicate");
|
|
1221
|
+
if (t.size >= pn) throw fn("command_stream_limit");
|
|
1222
|
+
let a = new AbortController(), o = !1, s = () => {}, c = (t) => e.emit({
|
|
763
1223
|
scope: "commands.stream",
|
|
764
1224
|
payload: {
|
|
765
1225
|
streamId: i,
|
|
766
1226
|
...t
|
|
767
1227
|
}
|
|
768
|
-
}),
|
|
769
|
-
o || (o = !0, t.delete(i),
|
|
1228
|
+
}), l = (e, n = !0) => {
|
|
1229
|
+
o || (o = !0, t.delete(i), s(), a.abort(), n && c({
|
|
770
1230
|
type: "end",
|
|
771
1231
|
outcome: e
|
|
772
1232
|
}));
|
|
773
|
-
},
|
|
1233
|
+
}, u = {
|
|
774
1234
|
unread: 0,
|
|
775
|
-
stop: (e, t = !0) =>
|
|
1235
|
+
stop: (e, t = !0) => l(un(e), t)
|
|
776
1236
|
};
|
|
777
|
-
t.set(i,
|
|
778
|
-
let { operation:
|
|
1237
|
+
t.set(i, u), s = e.onDisconnect(() => u.stop("command_stream_cancelled", !1));
|
|
1238
|
+
let { operation: d, streamId: f, commandId: p, ...m } = n, h = (e) => {
|
|
779
1239
|
if (e.type === "end") {
|
|
780
|
-
let t =
|
|
781
|
-
r.publish?.(t),
|
|
1240
|
+
let t = Ue.parse(e.response);
|
|
1241
|
+
r.publish?.(t), l(t.outcome);
|
|
782
1242
|
return;
|
|
783
1243
|
}
|
|
784
|
-
|
|
1244
|
+
u.unread += new TextEncoder().encode(JSON.stringify(e.data)).byteLength, u.unread > mn ? u.stop("command_stream_overflow") : c(e);
|
|
785
1245
|
};
|
|
786
1246
|
(async () => {
|
|
787
1247
|
try {
|
|
788
1248
|
for await (let e of r.stream({
|
|
789
|
-
commandId:
|
|
790
|
-
...
|
|
1249
|
+
commandId: p,
|
|
1250
|
+
...m
|
|
791
1251
|
}, a.signal)) {
|
|
792
1252
|
if (o) break;
|
|
793
|
-
|
|
1253
|
+
h(e);
|
|
794
1254
|
}
|
|
795
|
-
o ||
|
|
1255
|
+
o || u.stop("command_stream_disconnected");
|
|
796
1256
|
} catch (e) {
|
|
797
|
-
|
|
1257
|
+
l(dn(e));
|
|
798
1258
|
}
|
|
799
1259
|
})();
|
|
800
1260
|
}
|
|
@@ -803,80 +1263,82 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
803
1263
|
accepted: !0
|
|
804
1264
|
};
|
|
805
1265
|
};
|
|
806
|
-
},
|
|
807
|
-
let t =
|
|
808
|
-
return t || (t =
|
|
809
|
-
},
|
|
810
|
-
if (!t) throw new
|
|
811
|
-
return t(
|
|
812
|
-
},
|
|
1266
|
+
}, _n = y.object({ outcome: Le }).passthrough(), vn = /* @__PURE__ */ new WeakMap(), yn = (e) => {
|
|
1267
|
+
let t = vn.get(e);
|
|
1268
|
+
return t || (t = gn(e), vn.set(e, t)), t;
|
|
1269
|
+
}, bn = (e, t) => e instanceof Promise ? e.then(t) : t(), z = (e, t) => (n) => {
|
|
1270
|
+
if (!t) throw new L("unsupported", `The host does not support ${e}.`, { capability: e });
|
|
1271
|
+
return t(ln(e, n));
|
|
1272
|
+
}, xn = (e) => {
|
|
813
1273
|
let { executeCommand: t, hostEvents: n } = e;
|
|
814
1274
|
if (t) return async (e) => {
|
|
815
1275
|
try {
|
|
816
|
-
let r = n ? await
|
|
817
|
-
return
|
|
1276
|
+
let r = n ? await hn(n, (n) => Promise.resolve(t(e, n))) : await t(e);
|
|
1277
|
+
return _n.parse(r);
|
|
818
1278
|
} catch (e) {
|
|
819
|
-
if (e instanceof
|
|
1279
|
+
if (e instanceof b) return _n.parse({ outcome: e.outcome });
|
|
820
1280
|
throw e;
|
|
821
1281
|
}
|
|
822
1282
|
};
|
|
823
|
-
},
|
|
1283
|
+
}, Sn = (e) => {
|
|
824
1284
|
let { streamCommand: t, hostEvents: n } = e;
|
|
825
|
-
if (t && n) return (r) =>
|
|
1285
|
+
if (t && n) return (r) => yn(n)(r, {
|
|
826
1286
|
stream: t,
|
|
827
1287
|
publish: e.commandCompleted
|
|
828
1288
|
});
|
|
829
|
-
},
|
|
830
|
-
let { hostEvents: t, navigation: n, pageParams: r, placement: i, notifications: a, settings: o, preferences: s, files: c, artifacts: l, terminal: u } = e, d = u && t ?
|
|
1289
|
+
}, Cn = (e) => {
|
|
1290
|
+
let { hostEvents: t, navigation: n, pageParams: r, placement: i, notifications: a, settings: o, preferences: s, files: c, artifacts: l, terminal: u } = e, d = u && t ? Jt({
|
|
831
1291
|
terminal: u,
|
|
832
1292
|
hostEvents: t
|
|
833
|
-
}) : void 0;
|
|
1293
|
+
}) : void 0, f = e.harnesses?.read.bind(e.harnesses);
|
|
834
1294
|
return {
|
|
835
|
-
"
|
|
836
|
-
"
|
|
837
|
-
"
|
|
838
|
-
"
|
|
1295
|
+
"harnesses.read": z("harnesses.read", f),
|
|
1296
|
+
"resources.actions": z("resources.actions", e.resourceActions),
|
|
1297
|
+
"commands.execute": z("commands.execute", xn(e)),
|
|
1298
|
+
"commands.stream": z("commands.stream", Sn(e)),
|
|
1299
|
+
"navigation.open": z("navigation.open", n && ((e) => bn(n.open(e.target), () => void 0))),
|
|
1300
|
+
"page.params.update": z("page.params.update", r && ((e) => {
|
|
839
1301
|
let t = r.update(e.params);
|
|
840
1302
|
return t instanceof Promise ? t.then((e) => ({ location: e })) : { location: t };
|
|
841
1303
|
})),
|
|
842
|
-
"placement.close":
|
|
843
|
-
"notification.show":
|
|
1304
|
+
"placement.close": z("placement.close", i && (() => i.close())),
|
|
1305
|
+
"notification.show": z("notification.show", a?.show && ((e) => bn(a.show("type" in e ? e : {
|
|
844
1306
|
type: e.level,
|
|
845
1307
|
...e.title === void 0 ? {} : { title: e.title },
|
|
846
1308
|
message: e.message ?? ""
|
|
847
1309
|
}), () => void 0))),
|
|
848
|
-
"notification.action":
|
|
849
|
-
"notification.resolve":
|
|
1310
|
+
"notification.action": z("notification.action", a?.create && ((e) => a.create(e))),
|
|
1311
|
+
"notification.resolve": z("notification.resolve", a?.resolve && ((e) => a.resolve({
|
|
850
1312
|
...e,
|
|
851
1313
|
status: e.status ?? "done"
|
|
852
1314
|
}))),
|
|
853
|
-
"notification.dismiss":
|
|
1315
|
+
"notification.dismiss": z("notification.dismiss", a?.resolve && ((e) => a.resolve({
|
|
854
1316
|
...e,
|
|
855
1317
|
status: "dismissed"
|
|
856
1318
|
}))),
|
|
857
|
-
"preferences.get":
|
|
858
|
-
"preferences.set":
|
|
1319
|
+
"preferences.get": z("preferences.get", s && ((e) => s.get(e.name, e.scope))),
|
|
1320
|
+
"preferences.set": z("preferences.set", s && ((e) => {
|
|
859
1321
|
let t = e.scope ?? { scope: "user" };
|
|
860
|
-
if (t.scope === "default") throw new
|
|
861
|
-
return
|
|
1322
|
+
if (t.scope === "default") throw new L("preference_scope_read_only", "Default preferences are read-only.", {});
|
|
1323
|
+
return bn(s.set(e.name, e.value, t), () => ({
|
|
862
1324
|
name: e.name,
|
|
863
1325
|
value: e.value
|
|
864
1326
|
}));
|
|
865
1327
|
})),
|
|
866
|
-
"extension.settings.all":
|
|
867
|
-
"extension.settings.get":
|
|
868
|
-
"extension.settings.set":
|
|
1328
|
+
"extension.settings.all": z("extension.settings.all", o && (() => o.all())),
|
|
1329
|
+
"extension.settings.get": z("extension.settings.get", o && ((e) => o.get(e.key))),
|
|
1330
|
+
"extension.settings.set": z("extension.settings.set", o && (async (e) => ({
|
|
869
1331
|
key: e.key,
|
|
870
1332
|
value: (await o.set(e.key, e.value)).value
|
|
871
1333
|
}))),
|
|
872
|
-
"extension.settings.delete":
|
|
873
|
-
"terminal.session":
|
|
874
|
-
"files.upload":
|
|
875
|
-
"files.list":
|
|
876
|
-
"files.delete":
|
|
877
|
-
"artifacts.read":
|
|
1334
|
+
"extension.settings.delete": z("extension.settings.delete", o && ((e) => o.delete(e.key))),
|
|
1335
|
+
"terminal.session": z("terminal.session", d && ((e) => d(e))),
|
|
1336
|
+
"files.upload": z("files.upload", c && ((e) => c.upload(e))),
|
|
1337
|
+
"files.list": z("files.list", c && ((e) => c.list(e))),
|
|
1338
|
+
"files.delete": z("files.delete", c && ((e) => c.delete(e))),
|
|
1339
|
+
"artifacts.read": z("artifacts.read", l && ((e) => l.read(e)))
|
|
878
1340
|
};
|
|
879
|
-
},
|
|
1341
|
+
}, wn = (e, t) => {
|
|
880
1342
|
let n = t.commandTargetOf?.(e);
|
|
881
1343
|
if (n) return {
|
|
882
1344
|
...n,
|
|
@@ -890,19 +1352,19 @@ var pe = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n ==
|
|
|
890
1352
|
...t.region ? { region: t.region } : {}
|
|
891
1353
|
};
|
|
892
1354
|
};
|
|
893
|
-
function
|
|
894
|
-
if (!
|
|
895
|
-
return t.extensionId && (e =
|
|
1355
|
+
function B(e, t = {}) {
|
|
1356
|
+
if (!T(e)) throw Error("Invalid navigation target.");
|
|
1357
|
+
return t.extensionId && (e = pt(e, t.extensionId, t.projectId)), e.kind === "command" ? wn(e, t) : e.kind === "href" || e.kind === "page" ? e : e.kind === "panel" ? {
|
|
896
1358
|
...e,
|
|
897
1359
|
...t.region ? { region: t.region } : {}
|
|
898
1360
|
} : {
|
|
899
1361
|
kind: "compound",
|
|
900
|
-
targets: e.targets.map((e) =>
|
|
1362
|
+
targets: e.targets.map((e) => B(e, t))
|
|
901
1363
|
};
|
|
902
1364
|
}
|
|
903
1365
|
//#endregion
|
|
904
1366
|
//#region src/extensions/bridge/webview-preferences-capability.ts
|
|
905
|
-
var
|
|
1367
|
+
var Tn = (e) => {
|
|
906
1368
|
let t = e.workbench.preferences, n = () => {
|
|
907
1369
|
if (!e.extensionId) throw Error("Preferences require the calling extension identity");
|
|
908
1370
|
return e.extensionId;
|
|
@@ -917,9 +1379,50 @@ var Dt = (e) => {
|
|
|
917
1379
|
return r(i) ? t.setValue(i, a, o) : (n(), e.ownedPreferences ? e.ownedPreferences.set(i, a, o) : t.setOwnedValue(n(), i, a, o));
|
|
918
1380
|
}
|
|
919
1381
|
};
|
|
920
|
-
},
|
|
1382
|
+
}, En = (e, t) => {
|
|
1383
|
+
let n, r = !1, i = () => {
|
|
1384
|
+
r || (r = !0, queueMicrotask(() => {
|
|
1385
|
+
r = !1, t?.emit({
|
|
1386
|
+
scope: vt,
|
|
1387
|
+
payload: { type: "changed" }
|
|
1388
|
+
});
|
|
1389
|
+
}));
|
|
1390
|
+
};
|
|
1391
|
+
return () => {
|
|
1392
|
+
if (!t || n) return;
|
|
1393
|
+
let r = c(e, i), a = t.onDisconnect(() => n?.());
|
|
1394
|
+
n = () => {
|
|
1395
|
+
r(), a(), n = void 0;
|
|
1396
|
+
};
|
|
1397
|
+
};
|
|
1398
|
+
}, Dn = (e, t, n) => {
|
|
1399
|
+
let r = En(e, n);
|
|
1400
|
+
return async (n) => {
|
|
1401
|
+
let i = a(e, t ? {
|
|
1402
|
+
...n.resource,
|
|
1403
|
+
projectId: t
|
|
1404
|
+
} : n.resource), s = i ? u(o(i)) : [];
|
|
1405
|
+
if (n.operation === "execute") {
|
|
1406
|
+
let e = s.find(({ id: e }) => e === n.key);
|
|
1407
|
+
if (!e?.run || e.disabled) throw Error("This resource action is no longer available.");
|
|
1408
|
+
return await e.run(), [];
|
|
1409
|
+
}
|
|
1410
|
+
return r(), s.map((e) => ({
|
|
1411
|
+
key: e.id,
|
|
1412
|
+
label: e.label,
|
|
1413
|
+
commandId: e.commandId,
|
|
1414
|
+
icon: e.icon,
|
|
1415
|
+
iconSrc: e.iconSrc,
|
|
1416
|
+
description: e.description,
|
|
1417
|
+
isDisabled: e.disabled,
|
|
1418
|
+
separatorBefore: e.separatorBefore,
|
|
1419
|
+
group: e.group ?? i?.group
|
|
1420
|
+
}));
|
|
1421
|
+
};
|
|
1422
|
+
}, On = (e) => {
|
|
921
1423
|
let { workbench: t, placement: n, extensionId: r, projectId: i, hostEvents: a } = e;
|
|
922
1424
|
return {
|
|
1425
|
+
resourceActions: Dn(t, i, a),
|
|
923
1426
|
hostEvents: a,
|
|
924
1427
|
executeCommand: async (e, n) => ({ outcome: {
|
|
925
1428
|
ok: !0,
|
|
@@ -936,27 +1439,34 @@ var Dt = (e) => {
|
|
|
936
1439
|
if (!r || r !== n.location.page.extensionId) throw Error("page_params_not_owner");
|
|
937
1440
|
return t.pageLocations.updateParams(e);
|
|
938
1441
|
} },
|
|
939
|
-
navigation: { open: (e) => t.navigation.openTarget(
|
|
1442
|
+
navigation: { open: (e) => t.navigation.openTarget(B(e, {
|
|
940
1443
|
extensionId: r,
|
|
941
1444
|
projectId: i
|
|
942
1445
|
})) },
|
|
943
|
-
notifications: { show: (e) =>
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
1446
|
+
notifications: { show: (e) => {
|
|
1447
|
+
if (e.type === "error") {
|
|
1448
|
+
t.notifications.captureActionError(e.title ?? "Extension action", n?.instanceId)(Error(e.message));
|
|
1449
|
+
return;
|
|
1450
|
+
}
|
|
1451
|
+
t.notifications.show({
|
|
1452
|
+
level: e.type,
|
|
1453
|
+
metadata: e.metadata,
|
|
1454
|
+
title: e.title ?? e.message,
|
|
1455
|
+
message: e.title === void 0 ? void 0 : e.message
|
|
1456
|
+
});
|
|
1457
|
+
} },
|
|
1458
|
+
preferences: Tn(e),
|
|
950
1459
|
terminal: t.terminal
|
|
951
1460
|
};
|
|
952
|
-
},
|
|
953
|
-
let n =
|
|
954
|
-
n || (n = /* @__PURE__ */ new Map(),
|
|
1461
|
+
}, kn = (e) => Cn(On(e)), An = () => "light", jn = /* @__PURE__ */ new WeakMap(), Mn = (e, t) => {
|
|
1462
|
+
let n = jn.get(e);
|
|
1463
|
+
n || (n = /* @__PURE__ */ new Map(), jn.set(e, n));
|
|
955
1464
|
let r = t.instanceId, i = n.get(r);
|
|
956
|
-
return i || (i =
|
|
957
|
-
},
|
|
958
|
-
let { context: t, createHostAdapters: n, createProps: r, createTheme: i =
|
|
959
|
-
return /* @__PURE__ */
|
|
1465
|
+
return i || (i = Gt(), n.set(r, i)), i;
|
|
1466
|
+
}, Nn = (e) => {
|
|
1467
|
+
let { context: t, createHostAdapters: n, createProps: r, createTheme: i = An, ownerId: a, title: o, webview: s } = e;
|
|
1468
|
+
return /* @__PURE__ */ j(Kt, {
|
|
1469
|
+
sizing: e.sizing,
|
|
960
1470
|
view: {
|
|
961
1471
|
extensionId: a ?? "workbench",
|
|
962
1472
|
id: t.webviewId,
|
|
@@ -971,16 +1481,16 @@ var Dt = (e) => {
|
|
|
971
1481
|
props: r(t),
|
|
972
1482
|
workbench: t.workbench,
|
|
973
1483
|
theme: i(t),
|
|
974
|
-
capabilities:
|
|
1484
|
+
capabilities: Cn(n({
|
|
975
1485
|
...t,
|
|
976
1486
|
extensionId: a ?? t.extensionId
|
|
977
1487
|
})),
|
|
978
1488
|
hostEvents: t.hostEvents
|
|
979
1489
|
});
|
|
980
|
-
},
|
|
1490
|
+
}, V = (e, t = "") => e === void 0 ? t : it(e) ? e.default ?? e.$l10n : e, H = (e) => {
|
|
981
1491
|
let t = e;
|
|
982
|
-
return t?.outcome ?
|
|
983
|
-
},
|
|
1492
|
+
return t?.outcome ? C(t.outcome) : e;
|
|
1493
|
+
}, Pn = async (e, t, n, r, i) => {
|
|
984
1494
|
let a = t.resourceMutation;
|
|
985
1495
|
if (!a) return i();
|
|
986
1496
|
let o = n?.[a.idParam] ?? r?.resource?.id;
|
|
@@ -991,7 +1501,7 @@ var Dt = (e) => {
|
|
|
991
1501
|
extensionId: t.extensionId,
|
|
992
1502
|
projectId: e.projectId
|
|
993
1503
|
};
|
|
994
|
-
if (a.kind === "remove" && !await e.workbench.commandPalette.requestConfirmation(
|
|
1504
|
+
if (a.kind === "remove" && !await e.workbench.commandPalette.requestConfirmation(V(t.title, "Delete"))) return;
|
|
995
1505
|
let c = a.kind === "rename" ? n?.[a.labelParam] : void 0;
|
|
996
1506
|
if (a.kind === "rename" && (typeof c != "string" || !c.trim())) return i();
|
|
997
1507
|
let l = e.workbench.resources.preview.begin(s, a.kind === "remove" ? { removed: !0 } : { label: c.trim() });
|
|
@@ -1001,15 +1511,15 @@ var Dt = (e) => {
|
|
|
1001
1511
|
} catch (e) {
|
|
1002
1512
|
throw l.rollback(), e;
|
|
1003
1513
|
}
|
|
1004
|
-
},
|
|
1514
|
+
}, U = (e) => ({
|
|
1005
1515
|
id: e.id,
|
|
1006
1516
|
kind: e.kind,
|
|
1007
1517
|
context: {
|
|
1008
1518
|
projectId: e.projectId,
|
|
1009
1519
|
...e.context ?? {}
|
|
1010
1520
|
}
|
|
1011
|
-
}),
|
|
1012
|
-
let r = n.resource, i = await e.executeCommand(t, {
|
|
1521
|
+
}), W = async (e, t, n = {}) => {
|
|
1522
|
+
let r = n.resource, i = e.workbench.notifications.captureActionError("Open command result"), a = await e.executeCommand(t, {
|
|
1013
1523
|
projectId: e.projectId,
|
|
1014
1524
|
...n.workspaceId ? { workspaceId: n.workspaceId } : {},
|
|
1015
1525
|
...n.params ? { params: n.params } : {},
|
|
@@ -1017,34 +1527,36 @@ var Dt = (e) => {
|
|
|
1017
1527
|
...n.slot ? { slot: n.slot } : {},
|
|
1018
1528
|
source: "dashboard",
|
|
1019
1529
|
...n.metadata ? { metadata: n.metadata } : {}
|
|
1020
|
-
}, n.signal),
|
|
1021
|
-
if (
|
|
1022
|
-
await e.workbench.navigation.openTarget(
|
|
1023
|
-
} catch (
|
|
1024
|
-
e
|
|
1025
|
-
level: "warning",
|
|
1026
|
-
title: "Command completed, but navigation failed",
|
|
1027
|
-
message: t instanceof Error ? t.message : String(t)
|
|
1028
|
-
});
|
|
1530
|
+
}, n.signal), o = a?.outcome;
|
|
1531
|
+
if (o?.status === "success") for (let t of o.navigationRequests ?? []) try {
|
|
1532
|
+
await e.workbench.navigation.openTarget(B(t, { region: n.region }));
|
|
1533
|
+
} catch (e) {
|
|
1534
|
+
i(e);
|
|
1029
1535
|
}
|
|
1030
|
-
return
|
|
1031
|
-
},
|
|
1032
|
-
let
|
|
1033
|
-
|
|
1034
|
-
|
|
1536
|
+
return a;
|
|
1537
|
+
}, G = async (e, t, n = {}) => {
|
|
1538
|
+
let i = e.metadata?.commands.find((e) => e.id === t), a = i ? {
|
|
1539
|
+
...r(i.params, n.params, { resource: n.resource }),
|
|
1540
|
+
...n.params
|
|
1541
|
+
} : n.params, o = async () => H(await W(e, t, {
|
|
1542
|
+
...n,
|
|
1543
|
+
params: a
|
|
1544
|
+
}));
|
|
1545
|
+
return i ? Pn(e, i, a, { resource: n.resource }, o) : o();
|
|
1546
|
+
}, Fn = (e) => typeof e == "object" && !!e && !Array.isArray(e), In = (e, t) => `${e.extensionId ?? t}.command.${e.id}`, Ln = async (e, t, n) => {
|
|
1035
1547
|
let { target: r } = n;
|
|
1036
1548
|
if (r.kind === "command") {
|
|
1037
|
-
await
|
|
1549
|
+
await G(e, In(r.target.command, t.extensionId), { params: r.target.params }), e.workbench.commandPaletteResources.refresh();
|
|
1038
1550
|
return;
|
|
1039
1551
|
}
|
|
1040
|
-
await e.workbench.navigation.openTarget(
|
|
1041
|
-
},
|
|
1552
|
+
await e.workbench.navigation.openTarget(B(r, { extensionId: t.extensionId }));
|
|
1553
|
+
}, Rn = (e) => {
|
|
1042
1554
|
if (e.kind === "page" || e.kind === "panel") return e.resource;
|
|
1043
1555
|
if (e.kind === "compound") return e.targets.find((e) => e.resource)?.resource;
|
|
1044
|
-
},
|
|
1556
|
+
}, zn = (e, t, n, r) => ({
|
|
1045
1557
|
id: `${t.id}:${r.id}`,
|
|
1046
1558
|
resource: (() => {
|
|
1047
|
-
let n =
|
|
1559
|
+
let n = Rn(r.target);
|
|
1048
1560
|
return n ? {
|
|
1049
1561
|
...n,
|
|
1050
1562
|
projectId: n.projectId ?? e.projectId,
|
|
@@ -1056,17 +1568,17 @@ var Dt = (e) => {
|
|
|
1056
1568
|
icon: r.icon,
|
|
1057
1569
|
keywords: r.keywords,
|
|
1058
1570
|
group: n,
|
|
1059
|
-
activate: () =>
|
|
1060
|
-
}),
|
|
1571
|
+
activate: () => Ln(e, t, r)
|
|
1572
|
+
}), Bn = (e, t) => {
|
|
1061
1573
|
let n = [];
|
|
1062
1574
|
for (let r of t) {
|
|
1063
|
-
let t =
|
|
1575
|
+
let t = V(r.title, r.id);
|
|
1064
1576
|
n.push(e.workbench.commandPaletteResources.registerProvider({
|
|
1065
1577
|
id: r.id,
|
|
1066
1578
|
title: t,
|
|
1067
1579
|
refreshEventIds: r.refreshEventIds,
|
|
1068
1580
|
query: async ({ query: n, limit: i, signal: a }) => {
|
|
1069
|
-
let o = e.workbench.getActiveResource(), s = await
|
|
1581
|
+
let o = e.workbench.getActiveResource(), s = await G(e, r.queryHandlerId, {
|
|
1070
1582
|
signal: a,
|
|
1071
1583
|
params: {
|
|
1072
1584
|
projectId: e.projectId,
|
|
@@ -1077,20 +1589,20 @@ var Dt = (e) => {
|
|
|
1077
1589
|
limit: i
|
|
1078
1590
|
}
|
|
1079
1591
|
});
|
|
1080
|
-
return
|
|
1592
|
+
return Fn(s) ? (s.items ?? []).map((n) => zn(e, r, t, n)) : [];
|
|
1081
1593
|
}
|
|
1082
1594
|
}));
|
|
1083
1595
|
}
|
|
1084
1596
|
return { dispose() {
|
|
1085
1597
|
for (let e = n.length - 1; e >= 0; --e) n[e]?.dispose();
|
|
1086
1598
|
} };
|
|
1087
|
-
},
|
|
1088
|
-
let r =
|
|
1599
|
+
}, Vn = (e, t = "") => V(e, t), Hn = (e, t, n) => {
|
|
1600
|
+
let r = U({
|
|
1089
1601
|
id: t.id,
|
|
1090
1602
|
kind: "renderer",
|
|
1091
1603
|
projectId: e.projectId,
|
|
1092
1604
|
context: { controlsRendererId: t.id }
|
|
1093
|
-
}),
|
|
1605
|
+
}), a = (n, i, a, o, s) => n ? G(e, n, {
|
|
1094
1606
|
params: {
|
|
1095
1607
|
renderer: {
|
|
1096
1608
|
rendererId: t.id,
|
|
@@ -1108,84 +1620,84 @@ var Dt = (e) => {
|
|
|
1108
1620
|
}) : Promise.resolve(void 0);
|
|
1109
1621
|
return e.workbench.views.registerView({
|
|
1110
1622
|
id: t.id,
|
|
1111
|
-
title:
|
|
1623
|
+
title: Vn(t.title, t.id),
|
|
1112
1624
|
icon: t.icon,
|
|
1113
1625
|
body: {
|
|
1114
1626
|
kind: "controls",
|
|
1115
|
-
emptyTitle:
|
|
1116
|
-
emptyDescription:
|
|
1627
|
+
emptyTitle: Vn(t.emptyTitle, ""),
|
|
1628
|
+
emptyDescription: Vn(t.emptyDescription, ""),
|
|
1117
1629
|
defaultValues: t.defaultValues,
|
|
1118
|
-
executeQuery: async (e, r,
|
|
1119
|
-
let
|
|
1120
|
-
if (!
|
|
1121
|
-
let e =
|
|
1630
|
+
executeQuery: async (e, r, o) => {
|
|
1631
|
+
let s = await a(t.queryHandlerId, {}, e ?? n.resolveResource?.(t), r, o), c = i.safeParse(s);
|
|
1632
|
+
if (!c.success) {
|
|
1633
|
+
let e = c.error.issues.map((e) => `body.query.${e.path.join(".")}: ${e.message}`).join("; ");
|
|
1122
1634
|
throw Error(`Extension "${t.extensionId}" view "${t.id}" has invalid controls. Expected serializable control declarations. ${e}`);
|
|
1123
1635
|
}
|
|
1124
|
-
return
|
|
1636
|
+
return c.data;
|
|
1125
1637
|
},
|
|
1126
|
-
updateValue: t.valueChangeHandlerId ? ({ controlId: e, value: n, values: r, resource:
|
|
1638
|
+
updateValue: t.valueChangeHandlerId ? ({ controlId: e, value: n, values: r, resource: i }) => a(t.valueChangeHandlerId, {
|
|
1127
1639
|
controlId: e,
|
|
1128
1640
|
value: n,
|
|
1129
1641
|
values: r
|
|
1130
|
-
},
|
|
1131
|
-
apply: t.applyHandlerId ? ({ values: e, resource: n }) =>
|
|
1132
|
-
reset: t.resetHandlerId ? ({ controlIds: e, resource: n }) =>
|
|
1642
|
+
}, i).then(() => void 0) : void 0,
|
|
1643
|
+
apply: t.applyHandlerId ? ({ values: e, resource: n }) => a(t.applyHandlerId, { values: e }, n).then(() => void 0) : void 0,
|
|
1644
|
+
reset: t.resetHandlerId ? ({ controlIds: e, resource: n }) => a(t.resetHandlerId, { controlIds: e }, n).then(() => void 0) : void 0
|
|
1133
1645
|
}
|
|
1134
1646
|
});
|
|
1135
|
-
},
|
|
1647
|
+
}, Un = (e, t, n = {}) => {
|
|
1136
1648
|
let r = [];
|
|
1137
|
-
for (let i of t) r.push(
|
|
1649
|
+
for (let i of t) r.push(Hn(e, i, n));
|
|
1138
1650
|
return { dispose() {
|
|
1139
1651
|
for (let e = r.length - 1; e >= 0; --e) r[e]?.dispose();
|
|
1140
1652
|
} };
|
|
1141
|
-
},
|
|
1653
|
+
}, K = (e, t, n) => {
|
|
1142
1654
|
if (e) return Object.fromEntries(Object.entries(e).map(([e, r]) => [e, {
|
|
1143
1655
|
...r,
|
|
1144
|
-
...r.options && !Array.isArray(r.options) ? { options:
|
|
1656
|
+
...r.options && !Array.isArray(r.options) ? { options: Wn(r.options, n) } : {},
|
|
1145
1657
|
label: r.label === void 0 ? void 0 : t(r.label, e),
|
|
1146
1658
|
description: r.description === void 0 ? void 0 : t(r.description)
|
|
1147
1659
|
}]));
|
|
1148
|
-
},
|
|
1660
|
+
}, Wn = (e, t) => {
|
|
1149
1661
|
let n = e;
|
|
1150
1662
|
return {
|
|
1151
1663
|
valueField: n.valueField,
|
|
1152
1664
|
labelField: n.labelField,
|
|
1153
1665
|
params: n.params,
|
|
1154
|
-
commandId:
|
|
1666
|
+
commandId: x({
|
|
1155
1667
|
id: n.command.id,
|
|
1156
1668
|
extensionId: n.command.extensionId ?? t ?? "pstdio"
|
|
1157
1669
|
})
|
|
1158
1670
|
};
|
|
1159
|
-
},
|
|
1671
|
+
}, Gn = (e) => e.toolbarActions?.map((t) => ({
|
|
1160
1672
|
id: t.id,
|
|
1161
|
-
label:
|
|
1673
|
+
label: V(t.label, t.id),
|
|
1162
1674
|
icon: t.icon,
|
|
1163
1675
|
presentation: t.presentation,
|
|
1164
1676
|
commandId: t.commandId,
|
|
1165
1677
|
args: t.params,
|
|
1166
|
-
params:
|
|
1678
|
+
params: K(t.input, V, e.extensionId),
|
|
1167
1679
|
submitLabel: t.submitLabel,
|
|
1168
1680
|
disabled: t.disabled,
|
|
1169
1681
|
when: t.when
|
|
1170
|
-
})),
|
|
1682
|
+
})), q = (e, t = "") => V(e, t), Kn = (e) => ({
|
|
1171
1683
|
...e,
|
|
1172
|
-
label:
|
|
1173
|
-
description: e.description ?
|
|
1174
|
-
icon: e.icon ?
|
|
1684
|
+
label: q(e.label, e.id),
|
|
1685
|
+
description: e.description ? q(e.description) : void 0,
|
|
1686
|
+
icon: e.icon ? D(d, {
|
|
1175
1687
|
name: e.icon,
|
|
1176
1688
|
size: 14
|
|
1177
1689
|
}) : void 0
|
|
1178
|
-
}),
|
|
1690
|
+
}), qn = (e) => !!(e && typeof e == "object" && Array.isArray(e.rows)), Jn = (e) => ({
|
|
1179
1691
|
id: e.id,
|
|
1180
1692
|
values: e.values,
|
|
1181
1693
|
resource: e.resource ? e.resource : void 0
|
|
1182
|
-
}),
|
|
1183
|
-
let r =
|
|
1694
|
+
}), Yn = (e, t, n) => {
|
|
1695
|
+
let r = nt(t), i = /* @__PURE__ */ new WeakMap(), a = U({
|
|
1184
1696
|
id: t.id,
|
|
1185
1697
|
kind: "dataTableRenderer",
|
|
1186
1698
|
projectId: e.projectId,
|
|
1187
1699
|
context: { dataTableRendererId: t.id }
|
|
1188
|
-
}),
|
|
1700
|
+
}), o = (n, r, i, o, s, c) => G(e, n, {
|
|
1189
1701
|
params: {
|
|
1190
1702
|
renderer: {
|
|
1191
1703
|
rendererId: t.id,
|
|
@@ -1204,13 +1716,13 @@ var Dt = (e) => {
|
|
|
1204
1716
|
});
|
|
1205
1717
|
return e.workbench.views.registerView({
|
|
1206
1718
|
id: t.id,
|
|
1207
|
-
title:
|
|
1719
|
+
title: q(t.title, t.id),
|
|
1208
1720
|
icon: t.icon,
|
|
1209
1721
|
body: {
|
|
1210
1722
|
kind: "dataTable",
|
|
1211
1723
|
resourceKind: t.resourceKind,
|
|
1212
|
-
toolbarActions:
|
|
1213
|
-
columns: t.columns?.map(
|
|
1724
|
+
toolbarActions: Gn(t),
|
|
1725
|
+
columns: t.columns?.map(Kn),
|
|
1214
1726
|
initialPageSize: t.initialPageSize,
|
|
1215
1727
|
pageSizeOptions: t.pageSizeOptions,
|
|
1216
1728
|
defaultSettings: r.settings,
|
|
@@ -1218,7 +1730,7 @@ var Dt = (e) => {
|
|
|
1218
1730
|
defaultSorts: t.defaultSorts,
|
|
1219
1731
|
defaultViews: r.views.map((e) => ({
|
|
1220
1732
|
...e,
|
|
1221
|
-
title:
|
|
1733
|
+
title: q(e.title, e.id)
|
|
1222
1734
|
})),
|
|
1223
1735
|
defaultActiveViewId: t.defaultActiveViewId,
|
|
1224
1736
|
viewsProvider: n.createViewsProvider?.(t),
|
|
@@ -1226,58 +1738,58 @@ var Dt = (e) => {
|
|
|
1226
1738
|
selectionActions: t.selectionActions?.map((e) => ({
|
|
1227
1739
|
id: e.id,
|
|
1228
1740
|
commandId: e.commandId,
|
|
1229
|
-
label:
|
|
1230
|
-
icon: e.icon ?
|
|
1741
|
+
label: q(e.label, e.id),
|
|
1742
|
+
icon: e.icon ? D(d, {
|
|
1231
1743
|
name: e.icon,
|
|
1232
1744
|
size: 16
|
|
1233
1745
|
}) : void 0,
|
|
1234
1746
|
destructive: e.destructive,
|
|
1235
|
-
run: (t) =>
|
|
1747
|
+
run: (t) => o(e.commandId, { rowIds: t.map((e) => e.id) }).then(() => void 0)
|
|
1236
1748
|
})),
|
|
1237
|
-
emptyTitle: t.emptyTitle ?
|
|
1238
|
-
emptyDescription: t.emptyDescription ?
|
|
1239
|
-
executeQuery: async ({ resource: e, modeId: r, filter: a, sorts:
|
|
1240
|
-
let d = await
|
|
1749
|
+
emptyTitle: t.emptyTitle ? q(t.emptyTitle) : void 0,
|
|
1750
|
+
emptyDescription: t.emptyDescription ? q(t.emptyDescription) : void 0,
|
|
1751
|
+
executeQuery: async ({ resource: e, modeId: r, filter: a, sorts: s, settings: c, pageParams: l }, u) => {
|
|
1752
|
+
let d = await o(t.queryHandlerId, {
|
|
1241
1753
|
filter: a,
|
|
1242
|
-
sorts:
|
|
1754
|
+
sorts: s,
|
|
1243
1755
|
settings: c
|
|
1244
1756
|
}, e, r, u, l);
|
|
1245
|
-
return
|
|
1757
|
+
return qn(d) ? {
|
|
1246
1758
|
rows: d.rows.map((e) => {
|
|
1247
|
-
let r =
|
|
1759
|
+
let r = Jn(e);
|
|
1248
1760
|
return n.resolveRowResource && (r.resource = n.resolveRowResource(t, e)), i.set(r, e), r;
|
|
1249
1761
|
}),
|
|
1250
|
-
columns: d.columns?.map(
|
|
1762
|
+
columns: d.columns?.map(Kn)
|
|
1251
1763
|
} : { rows: [] };
|
|
1252
1764
|
},
|
|
1253
1765
|
rowActions: t.rowActions?.map((n) => ({
|
|
1254
1766
|
id: n.id,
|
|
1255
1767
|
commandId: n.commandId,
|
|
1256
|
-
label:
|
|
1257
|
-
icon: n.icon ?
|
|
1768
|
+
label: q(n.label, n.id),
|
|
1769
|
+
icon: n.icon ? D(d, {
|
|
1258
1770
|
name: n.icon,
|
|
1259
1771
|
size: 16
|
|
1260
1772
|
}) : void 0,
|
|
1261
1773
|
destructive: n.destructive,
|
|
1262
1774
|
run: async (r) => {
|
|
1263
|
-
await
|
|
1775
|
+
await o(n.commandId, { rowId: r.id }, r.resource), e.workbench.views.refreshView(t.id);
|
|
1264
1776
|
}
|
|
1265
1777
|
})),
|
|
1266
1778
|
onRowActivate: t.rowActivationHandlerId ? async (e) => {
|
|
1267
|
-
await
|
|
1779
|
+
await o(t.rowActivationHandlerId, { row: i.get(e) ?? e }, e.resource);
|
|
1268
1780
|
} : void 0
|
|
1269
1781
|
}
|
|
1270
1782
|
});
|
|
1271
|
-
},
|
|
1272
|
-
let r = t.map((t) =>
|
|
1783
|
+
}, Xn = (e, t, n = {}) => {
|
|
1784
|
+
let r = t.map((t) => Yn(e, t, n));
|
|
1273
1785
|
return { dispose() {
|
|
1274
1786
|
for (let e = r.length - 1; e >= 0; --e) r[e]?.dispose();
|
|
1275
1787
|
} };
|
|
1276
|
-
},
|
|
1788
|
+
}, Zn = {
|
|
1277
1789
|
first: 0,
|
|
1278
1790
|
default: 1,
|
|
1279
1791
|
last: 2
|
|
1280
|
-
},
|
|
1792
|
+
}, Qn = {
|
|
1281
1793
|
commands: [],
|
|
1282
1794
|
commandPaletteContributions: [],
|
|
1283
1795
|
diagnostics: [],
|
|
@@ -1294,7 +1806,7 @@ var Dt = (e) => {
|
|
|
1294
1806
|
statusBarItems: [],
|
|
1295
1807
|
settingsPanels: [],
|
|
1296
1808
|
settingsDefinitions: []
|
|
1297
|
-
}, $
|
|
1809
|
+
}, $n = (e) => `workbench.extension.menu.${e.id}`, er = (e) => `workbench.extension.palette.${e.id}`, tr = (e, t) => Zn[e.placement ?? "default"] * 1e3 + t, nr = (e) => e === void 0 ? "" : w(e) ? e.default ?? e.$l10n : e, rr = (e) => {
|
|
1298
1810
|
let { commandId: t, contribution: n, index: r, resolveString: i, slot: a, when: o, disabledWhen: s } = e;
|
|
1299
1811
|
return {
|
|
1300
1812
|
commandId: t,
|
|
@@ -1306,12 +1818,12 @@ var Dt = (e) => {
|
|
|
1306
1818
|
resourceGroup: a.resourceGroup,
|
|
1307
1819
|
args: n.params,
|
|
1308
1820
|
overflowLabel: a.overflowLabel,
|
|
1309
|
-
order:
|
|
1821
|
+
order: tr(n, r),
|
|
1310
1822
|
when: o,
|
|
1311
1823
|
disabledWhen: s,
|
|
1312
1824
|
disabledReason: i(n.disabledReason, n.extensionId)
|
|
1313
1825
|
};
|
|
1314
|
-
},
|
|
1826
|
+
}, ir = (e) => {
|
|
1315
1827
|
let { commandId: t, contribution: n, index: r, resolveString: i } = e;
|
|
1316
1828
|
return {
|
|
1317
1829
|
commandId: t,
|
|
@@ -1320,10 +1832,10 @@ var Dt = (e) => {
|
|
|
1320
1832
|
icon: n.icon,
|
|
1321
1833
|
group: n.group,
|
|
1322
1834
|
args: n.params,
|
|
1323
|
-
order:
|
|
1835
|
+
order: tr(n, r)
|
|
1324
1836
|
};
|
|
1325
|
-
},
|
|
1326
|
-
let { createCommandId: t = $
|
|
1837
|
+
}, ar = (e) => {
|
|
1838
|
+
let { createCommandId: t = $n, createWhenExpression: n, menuSlotsById: r, menuTargetsById: i, metadata: a, resolveString: o = nr } = e, s = [], c = [];
|
|
1327
1839
|
return a.menuContributions.forEach((e, l) => {
|
|
1328
1840
|
let u = e.target ? i?.get(e.target) : r.get(e.slotId);
|
|
1329
1841
|
if (!u) {
|
|
@@ -1342,10 +1854,10 @@ var Dt = (e) => {
|
|
|
1342
1854
|
resourceMutation: f?.resourceMutation,
|
|
1343
1855
|
description: f ? o(f.description, f.extensionId) : void 0,
|
|
1344
1856
|
icon: e.icon,
|
|
1345
|
-
params:
|
|
1857
|
+
params: K(f?.params, (t) => o(t, f?.extensionId ?? e.extensionId), f?.extensionId)
|
|
1346
1858
|
},
|
|
1347
1859
|
contribution: e,
|
|
1348
|
-
menuItem:
|
|
1860
|
+
menuItem: rr({
|
|
1349
1861
|
commandId: d,
|
|
1350
1862
|
contribution: e,
|
|
1351
1863
|
index: l,
|
|
@@ -1364,8 +1876,8 @@ var Dt = (e) => {
|
|
|
1364
1876
|
registrations: s,
|
|
1365
1877
|
unresolved: c
|
|
1366
1878
|
};
|
|
1367
|
-
},
|
|
1368
|
-
let { createCommandId: t =
|
|
1879
|
+
}, or = (e) => {
|
|
1880
|
+
let { createCommandId: t = er, metadata: n, resolveString: r = nr } = e, i = [];
|
|
1369
1881
|
return (n.commandPaletteContributions ?? []).forEach((e, a) => {
|
|
1370
1882
|
let o = t(e), s = n.commands.find((t) => t.id === e.commandId);
|
|
1371
1883
|
i.push({
|
|
@@ -1375,10 +1887,10 @@ var Dt = (e) => {
|
|
|
1375
1887
|
category: e.group,
|
|
1376
1888
|
description: s ? r(s.description, s.extensionId) : void 0,
|
|
1377
1889
|
icon: e.icon,
|
|
1378
|
-
params:
|
|
1890
|
+
params: K(s?.params, (t) => r(t, s?.extensionId ?? e.extensionId), s?.extensionId)
|
|
1379
1891
|
},
|
|
1380
1892
|
contribution: e,
|
|
1381
|
-
menuItem:
|
|
1893
|
+
menuItem: ir({
|
|
1382
1894
|
commandId: o,
|
|
1383
1895
|
contribution: e,
|
|
1384
1896
|
index: a,
|
|
@@ -1387,7 +1899,7 @@ var Dt = (e) => {
|
|
|
1387
1899
|
targetCommandId: e.commandId
|
|
1388
1900
|
});
|
|
1389
1901
|
}), i;
|
|
1390
|
-
},
|
|
1902
|
+
}, sr = (e) => ({
|
|
1391
1903
|
id: e.rendererId,
|
|
1392
1904
|
kind: "renderer",
|
|
1393
1905
|
context: {
|
|
@@ -1397,9 +1909,9 @@ var Dt = (e) => {
|
|
|
1397
1909
|
resourceId: e.resource.id
|
|
1398
1910
|
} : {}
|
|
1399
1911
|
}
|
|
1400
|
-
}),
|
|
1912
|
+
}), cr = async (e, t, n, r, i = {}, a, o, s) => {
|
|
1401
1913
|
let c = r;
|
|
1402
|
-
return
|
|
1914
|
+
return W(e, n, {
|
|
1403
1915
|
params: {
|
|
1404
1916
|
renderer: {
|
|
1405
1917
|
rendererId: t,
|
|
@@ -1412,23 +1924,23 @@ var Dt = (e) => {
|
|
|
1412
1924
|
},
|
|
1413
1925
|
resource: c,
|
|
1414
1926
|
signal: o,
|
|
1415
|
-
slot:
|
|
1927
|
+
slot: sr({
|
|
1416
1928
|
projectId: e.projectId,
|
|
1417
1929
|
rendererId: t,
|
|
1418
1930
|
resource: c
|
|
1419
1931
|
}),
|
|
1420
1932
|
...a ? { metadata: a } : {}
|
|
1421
1933
|
});
|
|
1422
|
-
},
|
|
1934
|
+
}, lr = (e) => {
|
|
1423
1935
|
if (!e || typeof e != "object") return;
|
|
1424
1936
|
let t = e.revision;
|
|
1425
1937
|
return typeof t == "string" ? t : void 0;
|
|
1426
|
-
},
|
|
1938
|
+
}, ur = (e, t) => {
|
|
1427
1939
|
let n = e.metadata, r = n?.fileRendererOrigin;
|
|
1428
1940
|
if (!r || typeof r != "object") return;
|
|
1429
1941
|
let i = r;
|
|
1430
1942
|
if (typeof i.rendererId != "string" || typeof i.instanceId != "string" || typeof i.operationId != "string") return;
|
|
1431
|
-
let a = n?.fileRendererResourceKey, o = t.outcome.ok ?
|
|
1943
|
+
let a = n?.fileRendererResourceKey, o = t.outcome.ok ? lr(t.outcome.value) : void 0;
|
|
1432
1944
|
return {
|
|
1433
1945
|
origin: {
|
|
1434
1946
|
rendererId: i.rendererId,
|
|
@@ -1438,42 +1950,42 @@ var Dt = (e) => {
|
|
|
1438
1950
|
...typeof a == "string" ? { resourceKey: a } : {},
|
|
1439
1951
|
...o ? { revision: o } : {}
|
|
1440
1952
|
};
|
|
1441
|
-
},
|
|
1953
|
+
}, dr = (e, t) => e.workbench.views.registerView({
|
|
1442
1954
|
id: t.id,
|
|
1443
|
-
title:
|
|
1955
|
+
title: V(t.title, t.id),
|
|
1444
1956
|
icon: t.icon,
|
|
1445
1957
|
body: {
|
|
1446
1958
|
kind: "file",
|
|
1447
1959
|
resourceKind: t.resourceKind,
|
|
1448
1960
|
load: async (n, r, i) => {
|
|
1449
|
-
let a = await
|
|
1450
|
-
return
|
|
1961
|
+
let a = await cr(e, t.id, t.loadHandlerId, n, {}, { fileStorageVersions: {} }, r, i);
|
|
1962
|
+
return s(H(a) ?? {}, a);
|
|
1451
1963
|
},
|
|
1452
1964
|
save: t.saveHandlerId ? async (n, r, i, a) => {
|
|
1453
|
-
let o = await
|
|
1454
|
-
fileStorageVersions:
|
|
1965
|
+
let o = await cr(e, t.id, t.saveHandlerId, n, { content: r }, {
|
|
1966
|
+
fileStorageVersions: l(a),
|
|
1455
1967
|
...i ? { fileRendererOrigin: i } : {},
|
|
1456
|
-
...
|
|
1457
|
-
}),
|
|
1458
|
-
return
|
|
1968
|
+
...E(n) ? { fileRendererResourceKey: E(n) } : {}
|
|
1969
|
+
}), c = lr(H(o));
|
|
1970
|
+
return s(c ? { revision: c } : {}, o);
|
|
1459
1971
|
} : void 0
|
|
1460
1972
|
}
|
|
1461
|
-
}),
|
|
1973
|
+
}), fr = (e) => {
|
|
1462
1974
|
let t = [];
|
|
1463
|
-
for (let n of e.metadata.fileRenderers ?? []) t.push(
|
|
1975
|
+
for (let n of e.metadata.fileRenderers ?? []) t.push(dr(e, n));
|
|
1464
1976
|
return { dispose() {
|
|
1465
1977
|
for (let e = t.length - 1; e >= 0; --e) t[e]?.dispose();
|
|
1466
1978
|
} };
|
|
1467
|
-
},
|
|
1979
|
+
}, pr = (e, t, n, r, i) => {
|
|
1468
1980
|
let a = e.attributes[t]?.find((e) => e.id === n);
|
|
1469
|
-
return a?.target ?
|
|
1981
|
+
return a?.target ? B(a.target, {
|
|
1470
1982
|
extensionId: r,
|
|
1471
1983
|
projectId: i
|
|
1472
1984
|
}) : void 0;
|
|
1473
|
-
},
|
|
1985
|
+
}, mr = (e) => (t) => D(d, {
|
|
1474
1986
|
name: e ?? "MoreHorizontal",
|
|
1475
1987
|
...t
|
|
1476
|
-
}),
|
|
1988
|
+
}), hr = (e, t) => ({
|
|
1477
1989
|
color: e?.color,
|
|
1478
1990
|
canDragIn: e?.canDragIn,
|
|
1479
1991
|
canDragOut: e?.canDragOut,
|
|
@@ -1481,9 +1993,9 @@ var Dt = (e) => {
|
|
|
1481
1993
|
actions: e?.actions?.map((e) => ({
|
|
1482
1994
|
id: e.id,
|
|
1483
1995
|
label: t(e.label, e.id),
|
|
1484
|
-
icon:
|
|
1996
|
+
icon: mr(e.icon)
|
|
1485
1997
|
}))
|
|
1486
|
-
}),
|
|
1998
|
+
}), gr = (e) => typeof e == "object" && !!e && !Array.isArray(e), _r = (e, t, n, r, i) => (t ?? []).map((t) => {
|
|
1487
1999
|
let a = t.display, o = a?.kind === "badge-list" && typeof a.itemsAttributeId == "string" ? {
|
|
1488
2000
|
kind: "badge-list",
|
|
1489
2001
|
itemsAttributeId: a.itemsAttributeId
|
|
@@ -1505,8 +2017,8 @@ var Dt = (e) => {
|
|
|
1505
2017
|
type: s(),
|
|
1506
2018
|
display: o
|
|
1507
2019
|
});
|
|
1508
|
-
}),
|
|
1509
|
-
let a =
|
|
2020
|
+
}), vr = (e, t, n, r, i) => {
|
|
2021
|
+
let a = _r(e, t, n, r, i), o = /* @__PURE__ */ new Set(), s = JSON.stringify(t);
|
|
1510
2022
|
return {
|
|
1511
2023
|
source: {
|
|
1512
2024
|
getSnapshot: () => a,
|
|
@@ -1515,29 +2027,29 @@ var Dt = (e) => {
|
|
|
1515
2027
|
set(t) {
|
|
1516
2028
|
let c = JSON.stringify(t);
|
|
1517
2029
|
if (c !== s) {
|
|
1518
|
-
s = c, a =
|
|
2030
|
+
s = c, a = _r(e, t, n, r, i);
|
|
1519
2031
|
for (let e of o) e();
|
|
1520
2032
|
}
|
|
1521
2033
|
}
|
|
1522
2034
|
};
|
|
1523
|
-
},
|
|
2035
|
+
}, yr = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), br = (e, t) => {
|
|
1524
2036
|
let { resource: n } = t;
|
|
1525
|
-
if (
|
|
1526
|
-
},
|
|
1527
|
-
let n =
|
|
2037
|
+
if (yr(n)) return n;
|
|
2038
|
+
}, xr = (e, t) => {
|
|
2039
|
+
let n = br(e, t);
|
|
1528
2040
|
if (n) return n;
|
|
1529
2041
|
if (e.resourceKind) return {
|
|
1530
2042
|
type: e.resourceKind,
|
|
1531
2043
|
id: t.id,
|
|
1532
2044
|
label: t.title
|
|
1533
2045
|
};
|
|
1534
|
-
},
|
|
2046
|
+
}, Sr = (e, t) => {
|
|
1535
2047
|
let n = e, r = t(n);
|
|
1536
2048
|
return r === void 0 ? n : {
|
|
1537
2049
|
...n,
|
|
1538
2050
|
resource: r
|
|
1539
2051
|
};
|
|
1540
|
-
},
|
|
2052
|
+
}, Cr = (...e) => Object.assign({}, ...e.filter((e) => !!e)), wr = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, Tr = (e) => Object.keys(e ?? {}).length > 0, Er = /* @__PURE__ */ new Set([
|
|
1541
2053
|
"text",
|
|
1542
2054
|
"longtext",
|
|
1543
2055
|
"markdown",
|
|
@@ -1546,8 +2058,8 @@ var Dt = (e) => {
|
|
|
1546
2058
|
"select",
|
|
1547
2059
|
"multi-select",
|
|
1548
2060
|
"files"
|
|
1549
|
-
]),
|
|
1550
|
-
if (!
|
|
2061
|
+
]), Dr = (e, t, n) => {
|
|
2062
|
+
if (!Er.has(t.type)) return;
|
|
1551
2063
|
let r = "options" in t && Array.isArray(t.options) ? t.options : [], i = t;
|
|
1552
2064
|
return {
|
|
1553
2065
|
id: e,
|
|
@@ -1565,17 +2077,17 @@ var Dt = (e) => {
|
|
|
1565
2077
|
multiple: t.type === "files" ? i.multiple !== !1 : void 0,
|
|
1566
2078
|
accept: t.type === "files" && typeof i.accept == "string" ? i.accept : void 0
|
|
1567
2079
|
};
|
|
1568
|
-
},
|
|
1569
|
-
let r =
|
|
2080
|
+
}, Or = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([e, n]) => {
|
|
2081
|
+
let r = Dr(e, n, t);
|
|
1570
2082
|
return r ? [r] : [];
|
|
1571
|
-
}),
|
|
2083
|
+
}), kr = (e, t) => U({
|
|
1572
2084
|
id: t.id,
|
|
1573
2085
|
kind: "kanbanRenderer",
|
|
1574
2086
|
projectId: e.projectId,
|
|
1575
2087
|
context: { kanbanRendererId: t.id }
|
|
1576
|
-
}),
|
|
2088
|
+
}), J = (e, t, n, r, i, a, o) => {
|
|
1577
2089
|
let s = i ?? e.workbench.getPrimaryResource();
|
|
1578
|
-
return
|
|
2090
|
+
return G(e, n, {
|
|
1579
2091
|
params: {
|
|
1580
2092
|
renderer: {
|
|
1581
2093
|
rendererId: t.id,
|
|
@@ -1588,33 +2100,33 @@ var Dt = (e) => {
|
|
|
1588
2100
|
},
|
|
1589
2101
|
resource: s,
|
|
1590
2102
|
signal: a,
|
|
1591
|
-
slot:
|
|
2103
|
+
slot: kr(e, t),
|
|
1592
2104
|
metadata: { kanbanRendererId: t.id }
|
|
1593
2105
|
});
|
|
1594
|
-
},
|
|
2106
|
+
}, Ar = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, jr = (e, t, n) => (t.rowActions ?? []).map((r) => {
|
|
1595
2107
|
let i = e.workbench.commands.getCommand(r.commandId)?.command;
|
|
1596
2108
|
return e.workbench.commands.registerCommand({
|
|
1597
|
-
id:
|
|
2109
|
+
id: Ar(t, r),
|
|
1598
2110
|
label: n(r.label, r.id),
|
|
1599
2111
|
icon: r.icon,
|
|
1600
2112
|
params: i?.params
|
|
1601
|
-
}, { execute: (n, i) =>
|
|
1602
|
-
}),
|
|
1603
|
-
let o =
|
|
1604
|
-
return s &&
|
|
2113
|
+
}, { execute: (n, i) => J(e, t, r.commandId, Cr(wr(n)), i?.resource) });
|
|
2114
|
+
}), Mr = (e, t, n, r, i, a) => {
|
|
2115
|
+
let o = Ar(t, n), s = e.workbench.commands.getCommand(o), c = { rowId: r.id }, l = i ? { resource: i } : void 0, u = a(n.label, n.id);
|
|
2116
|
+
return s && Tr(s.command.params) ? (e.workbench.commandPalette.requestParams({
|
|
1605
2117
|
record: s,
|
|
1606
2118
|
label: u,
|
|
1607
2119
|
args: c,
|
|
1608
2120
|
context: l
|
|
1609
|
-
}), Promise.resolve()) : s ? e.workbench.commands.executeCommand(s.command.id, c, l).then(() => void 0) :
|
|
1610
|
-
},
|
|
2121
|
+
}), Promise.resolve()) : s ? e.workbench.commands.executeCommand(s.command.id, c, l).then(() => void 0) : J(e, t, n.commandId, c, i).then(() => void 0);
|
|
2122
|
+
}, Nr = (e) => e ? D(d, {
|
|
1611
2123
|
name: e,
|
|
1612
2124
|
size: 16
|
|
1613
|
-
}) : void 0,
|
|
2125
|
+
}) : void 0, Pr = (e, t) => {
|
|
1614
2126
|
if (e.createRow) return {
|
|
1615
2127
|
title: t(e.createRow.title, "Create row"),
|
|
1616
2128
|
submitLabel: t(e.createRow.submitLabel, "Create"),
|
|
1617
|
-
fields:
|
|
2129
|
+
fields: Or(e, t),
|
|
1618
2130
|
labels: {
|
|
1619
2131
|
cancel: t(e.createRow.labels?.cancel, "Cancel"),
|
|
1620
2132
|
properties: t(e.createRow.labels?.properties, "Properties"),
|
|
@@ -1623,20 +2135,20 @@ var Dt = (e) => {
|
|
|
1623
2135
|
submitWithoutOpening: t(void 0, "Create without opening")
|
|
1624
2136
|
}
|
|
1625
2137
|
};
|
|
1626
|
-
},
|
|
2138
|
+
}, Fr = (e, t, n, r, i) => {
|
|
1627
2139
|
if (t.rowActivationHandlerId) return async (n) => {
|
|
1628
2140
|
let a = r(t, n);
|
|
1629
|
-
await
|
|
2141
|
+
await J(e, t, t.rowActivationHandlerId, { row: i(n) }, a);
|
|
1630
2142
|
};
|
|
1631
2143
|
if (n.onRowClick) return (e) => n.onRowClick?.({
|
|
1632
2144
|
record: t,
|
|
1633
2145
|
row: e,
|
|
1634
2146
|
resource: r(t, e)
|
|
1635
2147
|
});
|
|
1636
|
-
},
|
|
2148
|
+
}, Ir = (e, t, n, r) => {
|
|
1637
2149
|
let i = e.createRow;
|
|
1638
2150
|
if (i) return async (a) => {
|
|
1639
|
-
let o =
|
|
2151
|
+
let o = Cr(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);
|
|
1640
2152
|
if (await t.onAfterCreate?.({
|
|
1641
2153
|
record: e,
|
|
1642
2154
|
created: s,
|
|
@@ -1650,15 +2162,15 @@ var Dt = (e) => {
|
|
|
1650
2162
|
attributes: c.attributes ?? {}
|
|
1651
2163
|
});
|
|
1652
2164
|
};
|
|
1653
|
-
},
|
|
2165
|
+
}, Lr = (e, t, n, r, i) => {
|
|
1654
2166
|
let a = t.rowActions;
|
|
1655
2167
|
if (a?.length) return (o) => a.map((a) => {
|
|
1656
|
-
let s = i(t, o), c = () =>
|
|
2168
|
+
let s = i(t, o), c = () => Mr(e, t, a, o, s, r);
|
|
1657
2169
|
return {
|
|
1658
2170
|
key: a.id,
|
|
1659
2171
|
label: r(a.label, a.id),
|
|
1660
2172
|
commandId: a.commandId,
|
|
1661
|
-
icon:
|
|
2173
|
+
icon: Nr(a.icon),
|
|
1662
2174
|
onClick: () => n.executeRowAction ? n.executeRowAction({
|
|
1663
2175
|
record: t,
|
|
1664
2176
|
action: a,
|
|
@@ -1668,46 +2180,46 @@ var Dt = (e) => {
|
|
|
1668
2180
|
}) : c()
|
|
1669
2181
|
};
|
|
1670
2182
|
});
|
|
1671
|
-
},
|
|
1672
|
-
let r = [], i = n.resolveLabel ?? ((e, t) =>
|
|
2183
|
+
}, Rr = (e, t, n = {}) => {
|
|
2184
|
+
let r = [], i = n.resolveLabel ?? ((e, t) => V(e, t)), a = (t, r) => {
|
|
1673
2185
|
let i = r.display?.kind === "badge-list" ? {
|
|
1674
2186
|
...r,
|
|
1675
|
-
render: (n, i) =>
|
|
2187
|
+
render: (n, i) => se(r, n, i, void 0, (n) => {
|
|
1676
2188
|
if (r.display?.kind !== "badge-list") return;
|
|
1677
|
-
let a =
|
|
2189
|
+
let a = pr(i, r.display.itemsAttributeId, n, t.extensionId, e.projectId);
|
|
1678
2190
|
return a ? () => {
|
|
1679
2191
|
e.workbench.navigation.openTarget(a);
|
|
1680
2192
|
} : void 0;
|
|
1681
2193
|
})
|
|
1682
2194
|
} : r;
|
|
1683
2195
|
return n.decorateAttribute?.(t, i) ?? i;
|
|
1684
|
-
}, o = n.resolveRowResource ??
|
|
2196
|
+
}, o = n.resolveRowResource ?? br, s = n.resolveRowActionResource ?? xr, c = n.onAfterMutation ?? (() => {}), l = (t, n, r) => J(e, t, n, r).then((e) => (c(t), e));
|
|
1685
2197
|
for (let c of t) {
|
|
1686
|
-
let t =
|
|
2198
|
+
let t = vr(c, c.attributes, i, a, (t, n) => e.workbench.notifications.show({
|
|
1687
2199
|
id: `workbench.extension.${c.extensionId}.kanban.${c.id}.display.${t}`,
|
|
1688
2200
|
level: "error",
|
|
1689
2201
|
title: "Extension display is not available",
|
|
1690
2202
|
message: `Attribute "${t}" in renderer "${c.id}" uses unknown display kind "${n}".`
|
|
1691
|
-
})),
|
|
1692
|
-
r.push(...
|
|
2203
|
+
})), u = c.attributes, d = tt(c), f = /* @__PURE__ */ new WeakMap(), p, m = 0, h = /* @__PURE__ */ new Map(), g = (e) => o(c, e), _ = Fr(e, c, n, o, (e) => f.get(e) ?? e);
|
|
2204
|
+
r.push(...jr(e, c, i)), r.push(e.workbench.views.registerView({
|
|
1693
2205
|
id: c.id,
|
|
1694
2206
|
title: i(c.title, c.id),
|
|
1695
2207
|
icon: c.icon,
|
|
1696
2208
|
body: {
|
|
1697
2209
|
kind: "kanban",
|
|
1698
2210
|
resourceKind: c.resourceKind,
|
|
1699
|
-
toolbarActions:
|
|
2211
|
+
toolbarActions: Gn(c),
|
|
1700
2212
|
listRowActions: () => (c.rowActions ?? []).map((e) => ({
|
|
1701
2213
|
commandId: e.commandId,
|
|
1702
2214
|
label: i(e.label, e.id)
|
|
1703
2215
|
})),
|
|
1704
2216
|
storageScope: e.projectId,
|
|
1705
2217
|
attributes: t.source,
|
|
1706
|
-
defaultSettings:
|
|
2218
|
+
defaultSettings: d.settings,
|
|
1707
2219
|
defaultFilter: c.defaultFilter,
|
|
1708
2220
|
defaultSorts: c.defaultSorts,
|
|
1709
2221
|
viewsProvider: n.createViewsProvider?.(c),
|
|
1710
|
-
defaultViews:
|
|
2222
|
+
defaultViews: d.views.map((e) => ({
|
|
1711
2223
|
...e,
|
|
1712
2224
|
title: i(e.title, e.id)
|
|
1713
2225
|
})),
|
|
@@ -1715,30 +2227,36 @@ var Dt = (e) => {
|
|
|
1715
2227
|
emptyTitle: i(c.emptyTitle, ""),
|
|
1716
2228
|
emptyDescription: i(c.emptyDescription, ""),
|
|
1717
2229
|
hideToolbar: c.hideToolbar,
|
|
1718
|
-
createRow:
|
|
1719
|
-
getBoardColumnConfig: (e) =>
|
|
1720
|
-
onRowActivate:
|
|
2230
|
+
createRow: Pr(c, i),
|
|
2231
|
+
getBoardColumnConfig: (e) => hr(p?.[e], i),
|
|
2232
|
+
onRowActivate: _,
|
|
1721
2233
|
executeQuery: async (n, r) => {
|
|
1722
|
-
|
|
1723
|
-
let i =
|
|
2234
|
+
m += 1;
|
|
2235
|
+
let i = m, a = await J(e, c, c.queryHandlerId, {
|
|
1724
2236
|
settings: n.settings,
|
|
1725
2237
|
filter: n.filter,
|
|
1726
2238
|
sorts: n.sorts
|
|
1727
|
-
}, void 0, r, n.pageParams), o = (
|
|
1728
|
-
let
|
|
1729
|
-
let
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
2239
|
+
}, void 0, r, n.pageParams), o = (t) => {
|
|
2240
|
+
let n = /* @__PURE__ */ new Map(), r = t.map((t) => {
|
|
2241
|
+
let r = t, i = JSON.stringify(t), a = h.get(r.id), o = t.target, s = a?.signature === i ? a.row : {
|
|
2242
|
+
...Sr(t, g),
|
|
2243
|
+
...o ? { target: B(o, {
|
|
2244
|
+
extensionId: c.extensionId,
|
|
2245
|
+
projectId: e.projectId
|
|
2246
|
+
}) } : {}
|
|
2247
|
+
};
|
|
2248
|
+
return f.set(s, r), n.set(s.id, {
|
|
2249
|
+
signature: i,
|
|
2250
|
+
row: s
|
|
2251
|
+
}), s;
|
|
1734
2252
|
});
|
|
1735
|
-
return i ===
|
|
2253
|
+
return i === m && (h = n), r;
|
|
1736
2254
|
};
|
|
1737
|
-
if (i !==
|
|
2255
|
+
if (i !== m) return Array.isArray(a) ? o(a) : gr(a) ? o(a.rows ?? []) : [];
|
|
1738
2256
|
if (Array.isArray(a)) return o(a);
|
|
1739
|
-
if (!
|
|
1740
|
-
let s = a.attributes ??
|
|
1741
|
-
return
|
|
2257
|
+
if (!gr(a)) return [];
|
|
2258
|
+
let s = a.attributes ?? u;
|
|
2259
|
+
return u = s, t.set(s), p = a.boardColumnConfigs, o(a.rows ?? []);
|
|
1742
2260
|
},
|
|
1743
2261
|
onAttributeChange: c.attributeChangeHandlerId ? (e, t, n) => l(c, c.attributeChangeHandlerId, {
|
|
1744
2262
|
rowId: e,
|
|
@@ -1746,21 +2264,21 @@ var Dt = (e) => {
|
|
|
1746
2264
|
value: n
|
|
1747
2265
|
}).then(() => void 0) : void 0,
|
|
1748
2266
|
onMove: c.moveHandlerId ? (e) => l(c, c.moveHandlerId, { ...e }).then(() => void 0) : void 0,
|
|
1749
|
-
onCreateRow:
|
|
2267
|
+
onCreateRow: Ir(c, n, l, c.rowActivationHandlerId ? _ : void 0),
|
|
1750
2268
|
onColumnAction: c.columnActionHandlerId ? async (e, t) => {
|
|
1751
2269
|
await l(c, c.columnActionHandlerId, {
|
|
1752
2270
|
columnId: e,
|
|
1753
2271
|
actionId: t
|
|
1754
2272
|
});
|
|
1755
2273
|
} : void 0,
|
|
1756
|
-
getRowContextMenuActions:
|
|
2274
|
+
getRowContextMenuActions: Lr(e, c, n, i, s)
|
|
1757
2275
|
}
|
|
1758
2276
|
}));
|
|
1759
2277
|
}
|
|
1760
2278
|
return { dispose() {
|
|
1761
2279
|
for (let e = r.length - 1; e >= 0; --e) r[e]?.dispose();
|
|
1762
2280
|
} };
|
|
1763
|
-
},
|
|
2281
|
+
}, zr = (e) => ({
|
|
1764
2282
|
id: e.treeId,
|
|
1765
2283
|
kind: "renderer",
|
|
1766
2284
|
context: {
|
|
@@ -1772,7 +2290,7 @@ var Dt = (e) => {
|
|
|
1772
2290
|
resourceId: e.resource.id
|
|
1773
2291
|
} : {}
|
|
1774
2292
|
}
|
|
1775
|
-
}),
|
|
2293
|
+
}), Y = (e, t, n, r) => {
|
|
1776
2294
|
let i = n.resource, a = e.workbench.modes.getActiveModeId();
|
|
1777
2295
|
return {
|
|
1778
2296
|
renderer: {
|
|
@@ -1787,22 +2305,22 @@ var Dt = (e) => {
|
|
|
1787
2305
|
...n.filter ? { filter: n.filter } : {},
|
|
1788
2306
|
...r ? { node: r } : {}
|
|
1789
2307
|
};
|
|
1790
|
-
},
|
|
2308
|
+
}, X = async (e, t, n, r, i) => {
|
|
1791
2309
|
let a = r.renderer, o = a?.resource;
|
|
1792
|
-
return
|
|
2310
|
+
return G(e, n, {
|
|
1793
2311
|
params: r,
|
|
1794
2312
|
signal: i,
|
|
1795
2313
|
resource: o,
|
|
1796
|
-
slot:
|
|
2314
|
+
slot: zr({
|
|
1797
2315
|
modeId: a?.modeId,
|
|
1798
2316
|
projectId: e.projectId,
|
|
1799
2317
|
resource: o,
|
|
1800
2318
|
treeId: t.id
|
|
1801
2319
|
})
|
|
1802
2320
|
});
|
|
1803
|
-
},
|
|
2321
|
+
}, Br = async (e, t, n, r, i) => {
|
|
1804
2322
|
let a = e.workbench.modes.getActiveModeId();
|
|
1805
|
-
return
|
|
2323
|
+
return G(e, n, {
|
|
1806
2324
|
params: {
|
|
1807
2325
|
...r ?? {},
|
|
1808
2326
|
renderer: {
|
|
@@ -1814,7 +2332,7 @@ var Dt = (e) => {
|
|
|
1814
2332
|
}
|
|
1815
2333
|
},
|
|
1816
2334
|
resource: i,
|
|
1817
|
-
slot:
|
|
2335
|
+
slot: zr({
|
|
1818
2336
|
modeId: a,
|
|
1819
2337
|
projectId: e.projectId,
|
|
1820
2338
|
resource: i,
|
|
@@ -1822,28 +2340,42 @@ var Dt = (e) => {
|
|
|
1822
2340
|
}),
|
|
1823
2341
|
metadata: { treeId: t.id }
|
|
1824
2342
|
});
|
|
1825
|
-
},
|
|
1826
|
-
let { ctx: t, getHostTreeHeaderNodes: n, record: r, treeViews: i } = e, a =
|
|
2343
|
+
}, Vr = (e, t) => e.panels.flatMap((e) => [e, ...e.panelMenus ?? []]).filter((e) => e.renderer?.kind === "tree" && e.renderer.id === t.id), Hr = (e, t) => t.viewId ? e.find((e) => e.id === t.viewId) : e.length === 1 ? e[0] : void 0, Ur = async (e) => {
|
|
2344
|
+
let { ctx: t, getHostTreeHeaderNodes: n, record: r, treeViews: i } = e, a = Hr(i, t);
|
|
1827
2345
|
return !a || !("hostTreeHeader" in a) || a.hostTreeHeader !== "default" ? [] : await n?.({
|
|
1828
2346
|
ctx: t,
|
|
1829
2347
|
record: r,
|
|
1830
2348
|
panel: a
|
|
1831
2349
|
}) ?? [];
|
|
1832
|
-
},
|
|
1833
|
-
let { ctx: t, getHostTreeFooterNodes: n, record: r, treeViews: i } = e, a =
|
|
2350
|
+
}, Wr = async (e) => {
|
|
2351
|
+
let { ctx: t, getHostTreeFooterNodes: n, record: r, treeViews: i } = e, a = Hr(i, t);
|
|
1834
2352
|
return !a || !("hostTreeFooter" in a) || a.hostTreeFooter !== "default" ? [] : await n?.({
|
|
1835
2353
|
ctx: t,
|
|
1836
2354
|
record: r,
|
|
1837
2355
|
panel: a
|
|
1838
2356
|
}) ?? [];
|
|
1839
|
-
},
|
|
2357
|
+
}, Gr = (e, t) => (e.structure ?? []).map((e) => ({
|
|
2358
|
+
id: e.id,
|
|
2359
|
+
label: V(e.label),
|
|
2360
|
+
collapsible: e.collapsible,
|
|
2361
|
+
hiddenByDefault: e.hiddenByDefault,
|
|
2362
|
+
canHide: e.canHide,
|
|
2363
|
+
loading: !e.resourceNode,
|
|
2364
|
+
nodes: e.resourceNode && t ? [{
|
|
2365
|
+
id: e.resourceNode.id,
|
|
2366
|
+
label: t.label ?? t.id ?? t.type,
|
|
2367
|
+
icon: e.resourceNode.icon,
|
|
2368
|
+
resource: t,
|
|
2369
|
+
selected: !0
|
|
2370
|
+
}] : []
|
|
2371
|
+
})), Kr = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, qr = (e) => e && !Array.isArray(e) ? e : void 0, Jr = (e, t) => {
|
|
1840
2372
|
let n = /* @__PURE__ */ new WeakMap(), r = `workbench.extensionTreeRenderer.${t.id}.command`, i = (t) => e.resolveNodeResource?.(t) ?? t, a = (e) => {
|
|
1841
2373
|
if (e.emptyState) return {
|
|
1842
|
-
title:
|
|
1843
|
-
description:
|
|
2374
|
+
title: V(e.emptyState.title),
|
|
2375
|
+
description: V(e.emptyState.description),
|
|
1844
2376
|
icon: e.emptyState.icon
|
|
1845
2377
|
};
|
|
1846
|
-
}, o = (n, i, a) => n ?
|
|
2378
|
+
}, o = (n, i, a) => n ? B(n, {
|
|
1847
2379
|
commandTargetOf: (e) => ({
|
|
1848
2380
|
kind: "command",
|
|
1849
2381
|
commandId: r,
|
|
@@ -1858,34 +2390,34 @@ var Dt = (e) => {
|
|
|
1858
2390
|
extensionId: t.extensionId,
|
|
1859
2391
|
projectId: e.projectId
|
|
1860
2392
|
}) : void 0, s = (n, r, i) => {
|
|
1861
|
-
let a = n.command ?
|
|
2393
|
+
let a = n.command ? x({
|
|
1862
2394
|
...n.command,
|
|
1863
2395
|
extensionId: n.command.extensionId ?? t.extensionId
|
|
1864
2396
|
}) : void 0;
|
|
1865
2397
|
return {
|
|
1866
2398
|
id: n.id,
|
|
1867
2399
|
resourceMutation: e.metadata.commands.find((e) => e.id === a)?.resourceMutation,
|
|
1868
|
-
label:
|
|
2400
|
+
label: V(n.label),
|
|
1869
2401
|
icon: n.icon,
|
|
1870
|
-
args:
|
|
1871
|
-
params:
|
|
2402
|
+
args: qr(n.params),
|
|
2403
|
+
params: K(n.input, V, t.extensionId),
|
|
1872
2404
|
submitLabel: n.submitLabel,
|
|
1873
2405
|
when: n.when,
|
|
1874
2406
|
disabled: n.disabled,
|
|
1875
2407
|
run: a ? async (o) => {
|
|
1876
|
-
let s =
|
|
2408
|
+
let s = Kr(o, qr(n.params));
|
|
1877
2409
|
if (n.command?.extensionId === "pstdio") {
|
|
1878
2410
|
await e.workbench.commands.executeCommand(a, s, { resource: r?.resource ?? i.resource });
|
|
1879
2411
|
return;
|
|
1880
2412
|
}
|
|
1881
|
-
await
|
|
2413
|
+
await Br(e, t, a, s, r?.resource ?? i.resource), i.refresh();
|
|
1882
2414
|
} : void 0
|
|
1883
2415
|
};
|
|
1884
2416
|
}, c = (e, t) => {
|
|
1885
2417
|
let r = {
|
|
1886
2418
|
id: e.id,
|
|
1887
2419
|
selected: e.selected,
|
|
1888
|
-
label:
|
|
2420
|
+
label: V(e.label),
|
|
1889
2421
|
icon: e.icon,
|
|
1890
2422
|
iconColor: e.iconColor,
|
|
1891
2423
|
badge: e.badge,
|
|
@@ -1912,7 +2444,7 @@ var Dt = (e) => {
|
|
|
1912
2444
|
mapNodes: (e, t) => e.map((e) => c(e, t)),
|
|
1913
2445
|
mapSections: (e, t) => e.map((e) => ({
|
|
1914
2446
|
id: e.id,
|
|
1915
|
-
label:
|
|
2447
|
+
label: V(e.label),
|
|
1916
2448
|
actions: e.actions?.map((e) => s(e, void 0, t)),
|
|
1917
2449
|
collapsible: e.collapsible,
|
|
1918
2450
|
emptyState: a(e),
|
|
@@ -1923,58 +2455,59 @@ var Dt = (e) => {
|
|
|
1923
2455
|
originalNodes: n,
|
|
1924
2456
|
runnerCommandId: r
|
|
1925
2457
|
};
|
|
1926
|
-
},
|
|
2458
|
+
}, Yr = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "nodes" in e), Xr = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "id" in e), Z = (e, t) => t.length > 0 ? [{
|
|
1927
2459
|
id: e,
|
|
1928
2460
|
nodes: t,
|
|
1929
2461
|
canReorder: !1
|
|
1930
|
-
}] : [],
|
|
1931
|
-
let n =
|
|
2462
|
+
}] : [], Zr = (e, t) => {
|
|
2463
|
+
let n = Jr(e, t), r = Vr(e.metadata, t), i = e.workbench.commands.registerCommand({
|
|
1932
2464
|
id: n.runnerCommandId,
|
|
1933
|
-
label: `${
|
|
2465
|
+
label: `${V(t.title, t.id)} tree command`
|
|
1934
2466
|
}, { execute: async (n) => {
|
|
1935
|
-
let r = n, i = await
|
|
2467
|
+
let r = n, i = await Br(e, t, r.commandId, r.params, r.resource);
|
|
1936
2468
|
for (let t of e.workbench.views.listViews()) t.body.kind === "file" && e.workbench.views.refreshView(t.id);
|
|
1937
2469
|
return i;
|
|
1938
2470
|
} }), a = e.workbench.views.registerView({
|
|
1939
2471
|
id: t.id,
|
|
1940
|
-
title:
|
|
2472
|
+
title: V(t.title, t.id),
|
|
1941
2473
|
icon: t.icon,
|
|
1942
2474
|
body: {
|
|
1943
2475
|
kind: "tree",
|
|
2476
|
+
getStructure: t.structure ? (e) => Gr(t, e.resource) : void 0,
|
|
1944
2477
|
searchable: t.searchable,
|
|
1945
|
-
searchPlaceholder:
|
|
2478
|
+
searchPlaceholder: V(t.searchPlaceholder, "Search files"),
|
|
1946
2479
|
defaultExpandedNodeIds: t.defaultExpandedNodeIds,
|
|
1947
2480
|
defaultExpandedSectionIds: t.defaultExpandedSectionIds,
|
|
1948
2481
|
getHeader: async (i) => {
|
|
1949
|
-
let a = await
|
|
2482
|
+
let a = await Ur({
|
|
1950
2483
|
ctx: i,
|
|
1951
2484
|
getHostTreeHeaderNodes: e.getHostTreeHeaderNodes,
|
|
1952
2485
|
record: t,
|
|
1953
2486
|
treeViews: r
|
|
1954
2487
|
});
|
|
1955
|
-
if (!t.headerHandlerId) return
|
|
1956
|
-
let o = await
|
|
1957
|
-
return [...
|
|
2488
|
+
if (!t.headerHandlerId) return Z(`${t.id}:host-header`, a);
|
|
2489
|
+
let o = await X(e, t, t.headerHandlerId, Y(e, t, i), i.signal), s = Yr(o) ? n.mapSections(o, i) : [];
|
|
2490
|
+
return [...Z(`${t.id}:host-header`, a), ...s];
|
|
1958
2491
|
},
|
|
1959
2492
|
getBody: async (r) => {
|
|
1960
|
-
let i = await
|
|
1961
|
-
return
|
|
2493
|
+
let i = await X(e, t, t.bodyHandlerId, Y(e, t, r), r.signal);
|
|
2494
|
+
return Yr(i) ? n.mapSections(i, r) : [];
|
|
1962
2495
|
},
|
|
1963
2496
|
getFooter: async (i) => {
|
|
1964
|
-
let a = await
|
|
2497
|
+
let a = await Wr({
|
|
1965
2498
|
ctx: i,
|
|
1966
2499
|
getHostTreeFooterNodes: e.getHostTreeFooterNodes,
|
|
1967
2500
|
record: t,
|
|
1968
2501
|
treeViews: r
|
|
1969
2502
|
});
|
|
1970
|
-
if (!t.footerHandlerId) return
|
|
1971
|
-
let o = await
|
|
1972
|
-
return [...
|
|
2503
|
+
if (!t.footerHandlerId) return Z(`${t.id}:host-footer`, a);
|
|
2504
|
+
let o = await X(e, t, t.footerHandlerId, Y(e, t, i), i.signal);
|
|
2505
|
+
return [...Yr(o) ? n.mapSections(o, i) : [], ...Z(`${t.id}:host-footer`, a)];
|
|
1973
2506
|
},
|
|
1974
2507
|
moveNode: t.moveHandlerId ? async (r, i, a) => {
|
|
1975
2508
|
let o = n.originalNodes.get(r), s = i ? n.originalNodes.get(i) : void 0;
|
|
1976
|
-
!o?.canDrag || i && !s?.canDrop || (await
|
|
1977
|
-
...
|
|
2509
|
+
!o?.canDrag || i && !s?.canDrop || (await X(e, t, t.moveHandlerId, {
|
|
2510
|
+
...Y(e, t, a),
|
|
1978
2511
|
source: o,
|
|
1979
2512
|
target: s,
|
|
1980
2513
|
position: a.position ?? "inside"
|
|
@@ -1984,39 +2517,39 @@ var Dt = (e) => {
|
|
|
1984
2517
|
if (!t.childrenHandlerId) return r.children ?? [];
|
|
1985
2518
|
let a = n.originalNodes.get(r);
|
|
1986
2519
|
if (!a) return r.children ?? [];
|
|
1987
|
-
let o = await
|
|
1988
|
-
return
|
|
2520
|
+
let o = await X(e, t, t.childrenHandlerId, Y(e, t, i, a), i.signal);
|
|
2521
|
+
return Xr(o) ? n.mapNodes(o, i) : [];
|
|
1989
2522
|
}
|
|
1990
2523
|
}
|
|
1991
2524
|
});
|
|
1992
2525
|
return { dispose() {
|
|
1993
2526
|
a.dispose(), i.dispose();
|
|
1994
2527
|
} };
|
|
1995
|
-
},
|
|
2528
|
+
}, Qr = (e) => {
|
|
1996
2529
|
let t = [];
|
|
1997
|
-
for (let n of e.metadata.treeRenderers ?? []) t.push(
|
|
2530
|
+
for (let n of e.metadata.treeRenderers ?? []) t.push(Zr(e, n));
|
|
1998
2531
|
return { dispose() {
|
|
1999
2532
|
for (let e = t.length - 1; e >= 0; --e) t[e]?.dispose();
|
|
2000
2533
|
} };
|
|
2001
|
-
},
|
|
2534
|
+
}, $r = (e) => ({
|
|
2002
2535
|
kind: e.kind,
|
|
2003
|
-
id:
|
|
2536
|
+
id: S(e),
|
|
2004
2537
|
extensionId: e.extensionId
|
|
2005
|
-
}),
|
|
2538
|
+
}), ei = (e, t, n) => {
|
|
2006
2539
|
let r = n?.(t.when);
|
|
2007
2540
|
return !r || e.context.matches(r);
|
|
2008
|
-
},
|
|
2541
|
+
}, ti = (e) => ({
|
|
2009
2542
|
id: e.id,
|
|
2010
|
-
label:
|
|
2543
|
+
label: V(e.label, e.id),
|
|
2011
2544
|
icon: e.icon,
|
|
2012
2545
|
canHide: !0,
|
|
2013
2546
|
canReorder: !0,
|
|
2014
|
-
target:
|
|
2015
|
-
}),
|
|
2547
|
+
target: B(e.action, { extensionId: e.extensionId })
|
|
2548
|
+
}), ni = (e, t, n) => {
|
|
2016
2549
|
let r = /* @__PURE__ */ new Map();
|
|
2017
2550
|
for (let i of t) {
|
|
2018
|
-
if (
|
|
2019
|
-
let t = i.group || void 0, a = t ? `${i.extensionId}:${t}` :
|
|
2551
|
+
if (!ei(e, i, n)) continue;
|
|
2552
|
+
let t = i.group || void 0, a = t ? `${i.extensionId}:${t}` : m(i.slot), o = r.get(a) ?? {
|
|
2020
2553
|
id: a,
|
|
2021
2554
|
label: t,
|
|
2022
2555
|
collapsible: !!t,
|
|
@@ -2024,49 +2557,49 @@ var Dt = (e) => {
|
|
|
2024
2557
|
canReorder: !0,
|
|
2025
2558
|
nodes: []
|
|
2026
2559
|
};
|
|
2027
|
-
o.nodes.push(
|
|
2560
|
+
o.nodes.push(ti(i)), r.set(a, o);
|
|
2028
2561
|
}
|
|
2029
2562
|
return [...r.values()];
|
|
2030
|
-
},
|
|
2563
|
+
}, ri = (e) => {
|
|
2031
2564
|
let t = /* @__PURE__ */ new Map();
|
|
2032
2565
|
for (let n of e) {
|
|
2033
|
-
let e =
|
|
2566
|
+
let e = $r(n.owner), r = `${n.extensionId}:${e.kind}:${e.id}:${n.slot}`;
|
|
2034
2567
|
t.set(r, [...t.get(r) ?? [], n]);
|
|
2035
2568
|
}
|
|
2036
2569
|
return [...t.values()];
|
|
2037
|
-
},
|
|
2570
|
+
}, ii = (e) => [...new Set(e.flatMap((e) => e.group ? [`${e.extensionId}:${e.group}`] : []))], ai = (e) => ri(e.metadata.navigationItems).map((t) => {
|
|
2038
2571
|
let n = t[0], r = t.some((e) => e.when?.resourceType?.length || e.when?.metadata);
|
|
2039
2572
|
return e.workbench.navigationTrees.registerContribution({
|
|
2040
|
-
id: `${n.extensionId}.navigation-items.${n.owner.kind}.${
|
|
2041
|
-
owner:
|
|
2573
|
+
id: `${n.extensionId}.navigation-items.${n.owner.kind}.${S(n.owner)}.${n.slot}`,
|
|
2574
|
+
owner: $r(n.owner),
|
|
2042
2575
|
sourceExtensionId: n.extensionId,
|
|
2043
2576
|
declarationIndex: e.metadata.navigationItems.indexOf(n),
|
|
2044
2577
|
slot: n.slot,
|
|
2045
|
-
defaultExpandedSectionIds:
|
|
2578
|
+
defaultExpandedSectionIds: ii(t),
|
|
2046
2579
|
...r ? {} : { resolveResource: () => void 0 },
|
|
2047
|
-
getSections: () =>
|
|
2580
|
+
getSections: () => ni(e.workbench, t, e.createWhenExpression),
|
|
2048
2581
|
listActions: () => t.map((e) => ({
|
|
2049
|
-
label:
|
|
2582
|
+
label: V(e.label, e.id),
|
|
2050
2583
|
category: e.group || void 0,
|
|
2051
|
-
action:
|
|
2584
|
+
action: B(e.action, { extensionId: e.extensionId })
|
|
2052
2585
|
}))
|
|
2053
2586
|
});
|
|
2054
|
-
}),
|
|
2055
|
-
let r =
|
|
2587
|
+
}), oi = (e) => e.metadata.navigationTrees.map((t, n) => {
|
|
2588
|
+
let r = S(t.view);
|
|
2056
2589
|
return e.workbench.navigationTrees.registerContribution({
|
|
2057
2590
|
id: t.id,
|
|
2058
2591
|
idScope: t.id,
|
|
2059
|
-
owner:
|
|
2592
|
+
owner: $r(t.owner),
|
|
2060
2593
|
sourceExtensionId: t.extensionId,
|
|
2061
2594
|
declarationIndex: e.metadata.navigationItems.length + n,
|
|
2062
2595
|
slot: t.slot,
|
|
2063
2596
|
viewId: r,
|
|
2064
2597
|
...t.resourceScope === "project" ? { resolveResource: () => void 0 } : {}
|
|
2065
2598
|
});
|
|
2066
|
-
}),
|
|
2599
|
+
}), si = (e) => [...ai(e), ...oi(e)], ci = (e) => e.metadata.resourceKinds.map((t) => e.workbench.resources.registerKind({
|
|
2067
2600
|
kind: t.id,
|
|
2068
2601
|
extensionId: t.extensionId,
|
|
2069
|
-
label:
|
|
2602
|
+
label: V(t.label, t.id),
|
|
2070
2603
|
icon: t.icon ?? "FileText",
|
|
2071
2604
|
relatedOpenings: t.relatedOpeningsCommand ? async (n, r) => {
|
|
2072
2605
|
let i = await e.executeCommand(t.relatedOpeningsCommand, {
|
|
@@ -2074,7 +2607,7 @@ var Dt = (e) => {
|
|
|
2074
2607
|
resource: n,
|
|
2075
2608
|
source: "dashboard"
|
|
2076
2609
|
}, r);
|
|
2077
|
-
return r.throwIfAborted(),
|
|
2610
|
+
return r.throwIfAborted(), rt.array().parse(H(i)).map((n) => ({
|
|
2078
2611
|
...n,
|
|
2079
2612
|
resource: {
|
|
2080
2613
|
...n.resource,
|
|
@@ -2083,24 +2616,24 @@ var Dt = (e) => {
|
|
|
2083
2616
|
}
|
|
2084
2617
|
}));
|
|
2085
2618
|
} : void 0
|
|
2086
|
-
})),
|
|
2619
|
+
})), li = () => {
|
|
2087
2620
|
if (typeof navigator > "u") return;
|
|
2088
2621
|
let e = `${navigator.platform} ${navigator.userAgent}`.toLowerCase();
|
|
2089
2622
|
if (e.includes("mac")) return "mac";
|
|
2090
2623
|
if (e.includes("win")) return "win";
|
|
2091
2624
|
if (e.includes("linux")) return "linux";
|
|
2092
|
-
},
|
|
2625
|
+
}, ui = (e, t = li()) => (t ? e.platformOverrides?.[t] : void 0) ?? e.key, di = (e) => e.bindings.map((t) => e.workbench.keybindings.registerKeybinding({
|
|
2093
2626
|
sourceExtensionId: t.extensionId,
|
|
2094
|
-
action:
|
|
2627
|
+
action: B(t.action, { commandIdOf: (e) => e.extensionId ? x({
|
|
2095
2628
|
extensionId: e.extensionId,
|
|
2096
2629
|
id: e.id
|
|
2097
2630
|
}) : void 0 }),
|
|
2098
|
-
keybinding:
|
|
2631
|
+
keybinding: ui(t),
|
|
2099
2632
|
when: e.createWhenExpression?.(t.when)
|
|
2100
|
-
})),
|
|
2633
|
+
})), fi = (e) => {
|
|
2101
2634
|
if (!e) return;
|
|
2102
2635
|
let t = (e) => {
|
|
2103
|
-
if (e) return Array.isArray(e) ? e.map((e) =>
|
|
2636
|
+
if (e) return Array.isArray(e) ? e.map((e) => S(e)) : S(e);
|
|
2104
2637
|
};
|
|
2105
2638
|
return {
|
|
2106
2639
|
mode: t(e.mode),
|
|
@@ -2109,21 +2642,21 @@ var Dt = (e) => {
|
|
|
2109
2642
|
resourceType: e.resourceType?.map((e) => e.id),
|
|
2110
2643
|
metadata: e.metadata
|
|
2111
2644
|
};
|
|
2112
|
-
},
|
|
2645
|
+
}, pi = (e, t) => ({
|
|
2113
2646
|
...e,
|
|
2114
2647
|
tab: e.tab && t.createTab ? t.createTab({
|
|
2115
2648
|
...e.tab,
|
|
2116
2649
|
extensionId: t.extensionId,
|
|
2117
2650
|
placementId: t.placementId
|
|
2118
2651
|
}) : void 0
|
|
2119
|
-
}),
|
|
2652
|
+
}), mi = (e, t) => e.kind === "panels" ? e : {
|
|
2120
2653
|
...e,
|
|
2121
2654
|
tab: e.tab && t.createTab ? t.createTab({
|
|
2122
2655
|
...e.tab,
|
|
2123
2656
|
extensionId: t.extensionId,
|
|
2124
2657
|
placementId: t.placementId
|
|
2125
2658
|
}) : void 0
|
|
2126
|
-
},
|
|
2659
|
+
}, hi = (e, t) => e.pages.map((e) => ({
|
|
2127
2660
|
id: e.id,
|
|
2128
2661
|
ref: {
|
|
2129
2662
|
extensionId: e.extensionId,
|
|
@@ -2134,32 +2667,32 @@ var Dt = (e) => {
|
|
|
2134
2667
|
path: e.path,
|
|
2135
2668
|
document: e.document,
|
|
2136
2669
|
params: e.params,
|
|
2137
|
-
modeId:
|
|
2670
|
+
modeId: S(e.mode),
|
|
2138
2671
|
resource: e.resource,
|
|
2139
|
-
main:
|
|
2672
|
+
main: mi(e.main, {
|
|
2140
2673
|
extensionId: e.extensionId,
|
|
2141
2674
|
placementId: `${e.id}.$main`,
|
|
2142
2675
|
createTab: t
|
|
2143
2676
|
}),
|
|
2144
|
-
slots: e.slots.map((n) =>
|
|
2677
|
+
slots: e.slots.map((n) => pi(n, {
|
|
2145
2678
|
extensionId: e.extensionId,
|
|
2146
2679
|
placementId: `${e.id}.${n.id}`,
|
|
2147
2680
|
createTab: t
|
|
2148
2681
|
})),
|
|
2149
2682
|
...e.icon ? { icon: e.icon } : {},
|
|
2150
|
-
...e.parent ? { parentId:
|
|
2151
|
-
})),
|
|
2683
|
+
...e.parent ? { parentId: S(e.parent) } : {}
|
|
2684
|
+
})), Q = (e, t) => {
|
|
2152
2685
|
let n = e.pages.flatMap((e) => [...e.main.kind === "view" && e.resource ? [{
|
|
2153
2686
|
...e.resource,
|
|
2154
2687
|
view: e.main.view
|
|
2155
2688
|
}] : [], ...e.slots.flatMap((e) => e.item.kind === "binding" ? [e.item.binding] : [])]);
|
|
2156
|
-
return n.push(...e.placements.flatMap((e) => e.item.kind === "binding" ? [e.item.binding] : [])), n.find((e) =>
|
|
2157
|
-
},
|
|
2689
|
+
return n.push(...e.placements.flatMap((e) => e.item.kind === "binding" ? [e.item.binding] : [])), n.find((e) => S(e.view) === t)?.kinds[0]?.id;
|
|
2690
|
+
}, gi = (e) => e.body.kind === "webview" ? { webview: e.body.webview } : { renderer: {
|
|
2158
2691
|
kind: e.body.kind,
|
|
2159
2692
|
id: e.id
|
|
2160
|
-
} },
|
|
2161
|
-
if (
|
|
2162
|
-
let r = e.views.find((e) => e.id ===
|
|
2693
|
+
} }, _i = (e, t) => e.viewMenus.flatMap((n) => {
|
|
2694
|
+
if (S(n.owner) !== t.id) return [];
|
|
2695
|
+
let r = e.views.find((e) => e.id === S(n.view));
|
|
2163
2696
|
return r ? [{
|
|
2164
2697
|
id: n.id,
|
|
2165
2698
|
extensionId: n.extensionId,
|
|
@@ -2171,22 +2704,22 @@ var Dt = (e) => {
|
|
|
2171
2704
|
placement: n.placement,
|
|
2172
2705
|
hostTreeHeader: n.hostTreeHeader,
|
|
2173
2706
|
hostTreeFooter: n.hostTreeFooter,
|
|
2174
|
-
...
|
|
2707
|
+
...gi(r)
|
|
2175
2708
|
}] : [];
|
|
2176
|
-
}),
|
|
2177
|
-
let n =
|
|
2709
|
+
}), vi = (e) => e.views.map((t) => {
|
|
2710
|
+
let n = _i(e, t);
|
|
2178
2711
|
return {
|
|
2179
2712
|
id: t.id,
|
|
2180
2713
|
extensionId: t.extensionId,
|
|
2181
2714
|
title: t.title,
|
|
2182
2715
|
icon: t.icon,
|
|
2183
2716
|
panelMenus: n.length > 0 ? n : void 0,
|
|
2184
|
-
...
|
|
2717
|
+
...gi(t)
|
|
2185
2718
|
};
|
|
2186
|
-
}),
|
|
2719
|
+
}), $ = (e) => e?.map(({ command: e, ...t }) => ({
|
|
2187
2720
|
...t,
|
|
2188
|
-
commandId:
|
|
2189
|
-
})),
|
|
2721
|
+
commandId: x(e)
|
|
2722
|
+
})), yi = (e) => e.views.flatMap((t) => {
|
|
2190
2723
|
let n = t.body;
|
|
2191
2724
|
return n.kind === "kanban" ? [{
|
|
2192
2725
|
...n,
|
|
@@ -2194,7 +2727,7 @@ var Dt = (e) => {
|
|
|
2194
2727
|
extensionId: t.extensionId,
|
|
2195
2728
|
title: t.title,
|
|
2196
2729
|
icon: t.icon,
|
|
2197
|
-
resourceKind: n.resourceKind ??
|
|
2730
|
+
resourceKind: n.resourceKind ?? Q(e, t.id),
|
|
2198
2731
|
createRow: n.createRow ? {
|
|
2199
2732
|
title: n.createRow.title,
|
|
2200
2733
|
submitLabel: n.createRow.submitLabel,
|
|
@@ -2202,17 +2735,17 @@ var Dt = (e) => {
|
|
|
2202
2735
|
params: n.createRow.params,
|
|
2203
2736
|
attributesParam: n.createRow.attributesParam,
|
|
2204
2737
|
labels: n.createRow.labels,
|
|
2205
|
-
commandId:
|
|
2738
|
+
commandId: x(n.createRow.command),
|
|
2206
2739
|
attachments: n.createRow.attachments ? {
|
|
2207
2740
|
resourceParam: n.createRow.attachments.resourceParam,
|
|
2208
2741
|
fileParam: n.createRow.attachments.fileParam,
|
|
2209
|
-
commandId:
|
|
2742
|
+
commandId: x(n.createRow.attachments.command)
|
|
2210
2743
|
} : void 0
|
|
2211
2744
|
} : void 0,
|
|
2212
|
-
rowActions:
|
|
2213
|
-
toolbarActions:
|
|
2745
|
+
rowActions: $(n.rowActions),
|
|
2746
|
+
toolbarActions: $(n.toolbarActions)
|
|
2214
2747
|
}] : [];
|
|
2215
|
-
}),
|
|
2748
|
+
}), bi = (e) => e.views.flatMap((t) => {
|
|
2216
2749
|
let n = t.body;
|
|
2217
2750
|
return n.kind === "dataTable" ? [{
|
|
2218
2751
|
...n,
|
|
@@ -2220,33 +2753,33 @@ var Dt = (e) => {
|
|
|
2220
2753
|
extensionId: t.extensionId,
|
|
2221
2754
|
title: t.title,
|
|
2222
2755
|
icon: t.icon,
|
|
2223
|
-
resourceKind: n.resourceKind ??
|
|
2224
|
-
selectionActions:
|
|
2225
|
-
rowActions:
|
|
2226
|
-
toolbarActions:
|
|
2756
|
+
resourceKind: n.resourceKind ?? Q(e, t.id),
|
|
2757
|
+
selectionActions: $(n.selectionActions),
|
|
2758
|
+
rowActions: $(n.rowActions),
|
|
2759
|
+
toolbarActions: $(n.toolbarActions)
|
|
2227
2760
|
}] : [];
|
|
2228
|
-
}),
|
|
2761
|
+
}), xi = (e) => e.views.flatMap((t) => t.body.kind === "tree" ? [{
|
|
2229
2762
|
...t.body,
|
|
2230
2763
|
id: t.id,
|
|
2231
2764
|
extensionId: t.extensionId,
|
|
2232
2765
|
title: t.title,
|
|
2233
2766
|
icon: t.icon,
|
|
2234
|
-
resourceKind: t.body.resourceKind ??
|
|
2235
|
-
}] : []),
|
|
2767
|
+
resourceKind: t.body.resourceKind ?? Q(e, t.id)
|
|
2768
|
+
}] : []), Si = (e) => e.views.flatMap((t) => t.body.kind === "file" ? [{
|
|
2236
2769
|
...t.body,
|
|
2237
2770
|
id: t.id,
|
|
2238
2771
|
extensionId: t.extensionId,
|
|
2239
2772
|
title: t.title,
|
|
2240
2773
|
icon: t.icon,
|
|
2241
|
-
resourceKind: t.body.resourceKind ??
|
|
2242
|
-
}] : []),
|
|
2774
|
+
resourceKind: t.body.resourceKind ?? Q(e, t.id)
|
|
2775
|
+
}] : []), Ci = (e) => e.views.flatMap((t) => t.body.kind === "controls" ? [{
|
|
2243
2776
|
...t.body,
|
|
2244
2777
|
id: t.id,
|
|
2245
2778
|
extensionId: t.extensionId,
|
|
2246
2779
|
title: t.title,
|
|
2247
2780
|
icon: t.icon,
|
|
2248
|
-
resourceKind: t.body.resourceKind ??
|
|
2249
|
-
}] : []),
|
|
2781
|
+
resourceKind: t.body.resourceKind ?? Q(e, t.id)
|
|
2782
|
+
}] : []), wi = (e) => e.modes.map((e) => ({
|
|
2250
2783
|
id: e.id,
|
|
2251
2784
|
extensionId: e.extensionId,
|
|
2252
2785
|
modeId: e.id,
|
|
@@ -2255,17 +2788,17 @@ var Dt = (e) => {
|
|
|
2255
2788
|
panelRegions: e.regions,
|
|
2256
2789
|
regionSettings: e.regionSettings,
|
|
2257
2790
|
floatingPanels: e.floatingPanels,
|
|
2258
|
-
...e.defaultTheme ? { defaultTheme:
|
|
2259
|
-
...e.chrome ? { chrome: Object.fromEntries(Object.entries(e.chrome).map(([e, t]) => [e, t !== !1 &&
|
|
2260
|
-
})),
|
|
2261
|
-
let n =
|
|
2791
|
+
...e.defaultTheme ? { defaultTheme: S(e.defaultTheme) } : {},
|
|
2792
|
+
...e.chrome ? { chrome: Object.fromEntries(Object.entries(e.chrome).map(([e, t]) => [e, t !== !1 && S(t)])) } : {}
|
|
2793
|
+
})), Ti = (e, t = {}) => {
|
|
2794
|
+
let n = vi(e);
|
|
2262
2795
|
return {
|
|
2263
2796
|
extensions: e.extensions,
|
|
2264
2797
|
commands: e.commands,
|
|
2265
2798
|
menuContributions: e.menuContributions,
|
|
2266
2799
|
commandPaletteContributions: e.commandPaletteContributions,
|
|
2267
|
-
modes:
|
|
2268
|
-
pages:
|
|
2800
|
+
modes: wi(e),
|
|
2801
|
+
pages: hi(e, t.createTab),
|
|
2269
2802
|
placements: e.placements.map((e) => ({
|
|
2270
2803
|
id: e.id,
|
|
2271
2804
|
ref: {
|
|
@@ -2273,7 +2806,7 @@ var Dt = (e) => {
|
|
|
2273
2806
|
kind: "placement",
|
|
2274
2807
|
id: e.localId
|
|
2275
2808
|
},
|
|
2276
|
-
modeId:
|
|
2809
|
+
modeId: S(e.mode),
|
|
2277
2810
|
item: e.item,
|
|
2278
2811
|
region: e.region,
|
|
2279
2812
|
order: e.order,
|
|
@@ -2308,7 +2841,7 @@ var Dt = (e) => {
|
|
|
2308
2841
|
})),
|
|
2309
2842
|
settingsSections: e.settingsSections ?? [],
|
|
2310
2843
|
settingsPanels: e.settingsPanels.flatMap((t) => {
|
|
2311
|
-
let n = e.views.find((e) => e.id ===
|
|
2844
|
+
let n = e.views.find((e) => e.id === S(t.view));
|
|
2312
2845
|
return n ? [{
|
|
2313
2846
|
id: t.id,
|
|
2314
2847
|
viewId: n.id,
|
|
@@ -2317,30 +2850,30 @@ var Dt = (e) => {
|
|
|
2317
2850
|
scope: t.slot.id.includes("global") ? "global" : "project",
|
|
2318
2851
|
title: n.title,
|
|
2319
2852
|
icon: n.icon,
|
|
2320
|
-
section: t.section ?
|
|
2853
|
+
section: t.section ? S(t.section) : void 0
|
|
2321
2854
|
}] : [];
|
|
2322
2855
|
}),
|
|
2323
|
-
kanbanRenderers:
|
|
2324
|
-
dataTableRenderers:
|
|
2856
|
+
kanbanRenderers: yi(e),
|
|
2857
|
+
dataTableRenderers: bi(e),
|
|
2325
2858
|
commandPaletteResources: e.commandPaletteResources ?? [],
|
|
2326
|
-
treeRenderers:
|
|
2327
|
-
fileRenderers:
|
|
2328
|
-
controlsRenderers:
|
|
2859
|
+
treeRenderers: xi(e),
|
|
2860
|
+
fileRenderers: Si(e),
|
|
2861
|
+
controlsRenderers: Ci(e),
|
|
2329
2862
|
keybindings: e.keybindings ?? [],
|
|
2330
2863
|
settingsDefinitions: e.settingsDefinitions ?? [],
|
|
2331
2864
|
statusBarItems: e.statusBarItems.map((e) => ({
|
|
2332
2865
|
id: e.id,
|
|
2333
2866
|
extensionId: e.extensionId,
|
|
2334
|
-
viewId:
|
|
2867
|
+
viewId: S(e.view),
|
|
2335
2868
|
slot: e.slot.id.endsWith("leading") ? "leading" : "trailing",
|
|
2336
2869
|
order: e.order,
|
|
2337
|
-
when:
|
|
2870
|
+
when: fi(e.when)
|
|
2338
2871
|
})),
|
|
2339
2872
|
diagnostics: e.diagnostics
|
|
2340
2873
|
};
|
|
2341
|
-
},
|
|
2874
|
+
}, Ei = (e, t, n = {}) => {
|
|
2342
2875
|
e.views.refreshView(t.id, t.kind === "file" ? n : void 0);
|
|
2343
|
-
},
|
|
2876
|
+
}, Di = (e) => {
|
|
2344
2877
|
let t = /* @__PURE__ */ new Map(), n = (e, n) => {
|
|
2345
2878
|
for (let r of new Set(n.refreshEventIds ?? [])) {
|
|
2346
2879
|
let i = t.get(r) ?? [];
|
|
@@ -2355,25 +2888,25 @@ var Dt = (e) => {
|
|
|
2355
2888
|
refreshEventIds: t.body.refreshEventIds
|
|
2356
2889
|
});
|
|
2357
2890
|
return t;
|
|
2358
|
-
},
|
|
2359
|
-
let t =
|
|
2891
|
+
}, Oi = (e) => {
|
|
2892
|
+
let t = Di(e.metadata);
|
|
2360
2893
|
return e.subscribe((n) => {
|
|
2361
2894
|
let { id: r, ...i } = n;
|
|
2362
|
-
for (let n of t.get(r) ?? [])
|
|
2895
|
+
for (let n of t.get(r) ?? []) Ei(e.workbench, n, i);
|
|
2363
2896
|
});
|
|
2364
|
-
},
|
|
2897
|
+
}, ki = (e, t) => {
|
|
2365
2898
|
for (let n of t.views) n.body.kind === "webview" && e.views.getView(n.id) && e.views.refreshView(n.id);
|
|
2366
|
-
},
|
|
2899
|
+
}, Ai = (e) => (t) => {
|
|
2367
2900
|
let n = t.extensionId ?? e.extensionIdForWebview(t.webviewId);
|
|
2368
2901
|
return {
|
|
2369
|
-
...
|
|
2902
|
+
...On({
|
|
2370
2903
|
...t,
|
|
2371
2904
|
extensionId: n,
|
|
2372
2905
|
projectId: e.projectId
|
|
2373
2906
|
}),
|
|
2374
2907
|
executeCommand: (n, r) => {
|
|
2375
2908
|
let i = n.resource ?? t.placement.resource;
|
|
2376
|
-
return
|
|
2909
|
+
return W({
|
|
2377
2910
|
...e,
|
|
2378
2911
|
workbench: t.workbench
|
|
2379
2912
|
}, n.commandId, {
|
|
@@ -2382,7 +2915,7 @@ var Dt = (e) => {
|
|
|
2382
2915
|
metadata: n.metadata,
|
|
2383
2916
|
resource: i,
|
|
2384
2917
|
signal: r,
|
|
2385
|
-
slot:
|
|
2918
|
+
slot: U({
|
|
2386
2919
|
id: t.webviewId,
|
|
2387
2920
|
kind: e.slotKind,
|
|
2388
2921
|
projectId: e.projectId,
|
|
@@ -2393,14 +2926,14 @@ var Dt = (e) => {
|
|
|
2393
2926
|
files: e.files,
|
|
2394
2927
|
artifacts: e.artifacts ? { read: (n) => e.artifacts.read(n, { webviewId: t.webviewId }) } : void 0
|
|
2395
2928
|
};
|
|
2396
|
-
},
|
|
2397
|
-
title:
|
|
2929
|
+
}, ji = (e) => ({
|
|
2930
|
+
title: V(e.title) || void 0,
|
|
2398
2931
|
runtimeUrl: e.runtimeUrl,
|
|
2399
2932
|
moduleUrl: e.moduleUrl,
|
|
2400
2933
|
styles: e.styles,
|
|
2401
2934
|
capabilities: e.capabilities
|
|
2402
|
-
}),
|
|
2403
|
-
let n =
|
|
2935
|
+
}), Mi = "extensions", Ni = 1e3, Pi = (e) => e === void 0 ? void 0 : e, Fi = (e) => e === "global" ? "user" : "project", Ii = (e, t) => {
|
|
2936
|
+
let n = Ai({
|
|
2404
2937
|
artifacts: e.webviewArtifacts,
|
|
2405
2938
|
executeCommand: e.executeCommand,
|
|
2406
2939
|
extensionIdForWebview: (t) => e.metadata.panels.find((e) => e.id === t)?.extensionId,
|
|
@@ -2412,49 +2945,50 @@ var Dt = (e) => {
|
|
|
2412
2945
|
...n(t),
|
|
2413
2946
|
...e.createWebviewHostAdapters?.(t)
|
|
2414
2947
|
});
|
|
2415
|
-
},
|
|
2948
|
+
}, Li = (e) => e.metadata.panels.flatMap((t) => {
|
|
2416
2949
|
if (!t.webview) return [];
|
|
2417
|
-
let n =
|
|
2950
|
+
let n = ji(t.webview);
|
|
2418
2951
|
return [e.workbench.views.registerView({
|
|
2419
2952
|
id: t.id,
|
|
2420
|
-
title:
|
|
2953
|
+
title: V(t.title, t.id),
|
|
2421
2954
|
icon: t.icon,
|
|
2422
2955
|
body: {
|
|
2423
2956
|
kind: "react",
|
|
2424
2957
|
render: (r) => {
|
|
2425
2958
|
let i = e.metadata.settingsPanels.some((e) => e.id === r.instance.panelId && e.viewId === t.id) ? "settings" : "panel";
|
|
2426
|
-
return e.renderWebview?.(r) ??
|
|
2959
|
+
return e.renderWebview?.(r) ?? Nn({
|
|
2960
|
+
sizing: r.panel.region === "status" ? "content-width" : void 0,
|
|
2427
2961
|
context: {
|
|
2428
2962
|
workbench: r.workbench,
|
|
2429
2963
|
webviewId: t.id,
|
|
2430
2964
|
placement: r.instance,
|
|
2431
|
-
hostEvents:
|
|
2965
|
+
hostEvents: Mn(r.workbench, r.instance)
|
|
2432
2966
|
},
|
|
2433
|
-
createHostAdapters:
|
|
2967
|
+
createHostAdapters: Ii(e, i),
|
|
2434
2968
|
createProps: e.createWebviewProps ?? (({ placement: e }) => ({
|
|
2435
2969
|
placement: e,
|
|
2436
2970
|
resource: e.resource
|
|
2437
2971
|
})),
|
|
2438
2972
|
createTheme: e.createWebviewTheme,
|
|
2439
2973
|
ownerId: t.extensionId,
|
|
2440
|
-
title:
|
|
2974
|
+
title: V(t.title, t.id),
|
|
2441
2975
|
webview: n
|
|
2442
2976
|
});
|
|
2443
2977
|
}
|
|
2444
2978
|
}
|
|
2445
2979
|
})];
|
|
2446
|
-
}),
|
|
2980
|
+
}), Ri = {
|
|
2447
2981
|
first: 1e6,
|
|
2448
2982
|
default: 0,
|
|
2449
2983
|
last: -1e6
|
|
2450
|
-
},
|
|
2984
|
+
}, zi = (e) => e.metadata.panels.flatMap((e) => e.panelMenus ?? []).map((t, n) => e.workbench.viewMenus.registerViewMenu({
|
|
2451
2985
|
id: t.id,
|
|
2452
2986
|
ownerViewId: t.ownerPanelId,
|
|
2453
2987
|
viewId: t.viewId,
|
|
2454
2988
|
side: t.side,
|
|
2455
|
-
priority:
|
|
2456
|
-
})),
|
|
2457
|
-
let t = [], n = e.settingsSectionId ??
|
|
2989
|
+
priority: Ri[t.placement ?? "default"] - n
|
|
2990
|
+
})), Bi = (e) => {
|
|
2991
|
+
let t = [], n = e.settingsSectionId ?? Mi;
|
|
2458
2992
|
e.workbench.settings.getSection(n) || t.push(e.workbench.settings.registerSection({
|
|
2459
2993
|
id: n,
|
|
2460
2994
|
title: e.settingsSectionTitle ?? "Extensions"
|
|
@@ -2462,7 +2996,7 @@ var Dt = (e) => {
|
|
|
2462
2996
|
let r = [...e.metadata.settingsSections].sort((e, t) => (e.order ?? 0) - (t.order ?? 0) || e.extensionId.localeCompare(t.extensionId) || e.id.localeCompare(t.id));
|
|
2463
2997
|
for (let n of r) t.push(e.workbench.settings.registerSection({
|
|
2464
2998
|
id: n.id,
|
|
2465
|
-
title:
|
|
2999
|
+
title: V(n.title, n.id),
|
|
2466
3000
|
order: n.order,
|
|
2467
3001
|
scope: n.scope
|
|
2468
3002
|
}));
|
|
@@ -2471,34 +3005,34 @@ var Dt = (e) => {
|
|
|
2471
3005
|
let t = a.get(e.extensionId) ?? Object.create(null);
|
|
2472
3006
|
t[e.key] = {
|
|
2473
3007
|
type: e.type,
|
|
2474
|
-
scope:
|
|
2475
|
-
default:
|
|
3008
|
+
scope: Fi(e.scope),
|
|
3009
|
+
default: Pi(e.default),
|
|
2476
3010
|
enum: e.enum,
|
|
2477
|
-
description:
|
|
3011
|
+
description: V(e.description)
|
|
2478
3012
|
}, a.set(e.extensionId, t);
|
|
2479
3013
|
}
|
|
2480
3014
|
for (let [n, r] of a) t.push(e.workbench.preferences.registerSchema({ properties: r }, { ownerId: n }));
|
|
2481
3015
|
let o = [...e.metadata.settingsPanels].sort((e, t) => e.extensionId.localeCompare(t.extensionId) || e.id.localeCompare(t.id));
|
|
2482
3016
|
for (let [r, i] of o.entries()) i.slotId !== "extension.settings" && t.push(e.workbench.settings.registerPanel({
|
|
2483
3017
|
id: i.id,
|
|
2484
|
-
title:
|
|
3018
|
+
title: V(i.title, i.id),
|
|
2485
3019
|
icon: i.icon,
|
|
2486
3020
|
kind: "view",
|
|
2487
|
-
order:
|
|
3021
|
+
order: Ni + r,
|
|
2488
3022
|
section: i.section ?? n,
|
|
2489
3023
|
scope: i.scope,
|
|
2490
3024
|
viewId: i.viewId
|
|
2491
3025
|
}));
|
|
2492
3026
|
return t;
|
|
2493
|
-
},
|
|
3027
|
+
}, Vi = (e) => !(!e || typeof e != "object" || Array.isArray(e)), Hi = (e, t, n) => T(e) ? B(e, {
|
|
2494
3028
|
extensionId: t,
|
|
2495
3029
|
projectId: n
|
|
2496
|
-
}) : void 0,
|
|
2497
|
-
if (
|
|
2498
|
-
let r =
|
|
3030
|
+
}) : void 0, Ui = (e, t, n) => Array.isArray(e) ? e.flatMap((e) => {
|
|
3031
|
+
if (!Vi(e) || typeof e.id != "string") return [];
|
|
3032
|
+
let r = Hi(e.action, t, n);
|
|
2499
3033
|
return [{
|
|
2500
3034
|
id: e.id,
|
|
2501
|
-
label:
|
|
3035
|
+
label: V(e.label, e.id),
|
|
2502
3036
|
icon: typeof e.icon == "string" ? e.icon : void 0,
|
|
2503
3037
|
iconColor: typeof e.iconColor == "string" ? e.iconColor : void 0,
|
|
2504
3038
|
selected: e.selected === !0,
|
|
@@ -2508,29 +3042,29 @@ var Dt = (e) => {
|
|
|
2508
3042
|
target: r
|
|
2509
3043
|
} : void 0
|
|
2510
3044
|
}];
|
|
2511
|
-
}) : [],
|
|
2512
|
-
if (
|
|
2513
|
-
let r =
|
|
3045
|
+
}) : [], Wi = (e, t, n) => {
|
|
3046
|
+
if (!Vi(e)) return {};
|
|
3047
|
+
let r = Vi(e.indicator) ? {
|
|
2514
3048
|
icon: String(e.indicator.icon ?? ""),
|
|
2515
3049
|
color: typeof e.indicator.color == "string" ? e.indicator.color : void 0,
|
|
2516
|
-
label:
|
|
2517
|
-
} : void 0, i = Array.isArray(e.menu) ? e.menu.flatMap((e) =>
|
|
3050
|
+
label: V(e.indicator.label)
|
|
3051
|
+
} : void 0, i = Array.isArray(e.menu) ? e.menu.flatMap((e) => !Vi(e) || typeof e.id != "string" || !Array.isArray(e.rows) ? [] : [{
|
|
2518
3052
|
id: e.id,
|
|
2519
|
-
label:
|
|
2520
|
-
rows:
|
|
3053
|
+
label: V(e.label),
|
|
3054
|
+
rows: Ui(e.rows, t, n)
|
|
2521
3055
|
}]) : void 0;
|
|
2522
3056
|
return {
|
|
2523
|
-
label:
|
|
3057
|
+
label: V(e.label),
|
|
2524
3058
|
icon: typeof e.icon == "string" ? e.icon : void 0,
|
|
2525
3059
|
indicator: r?.icon ? r : void 0,
|
|
2526
3060
|
menu: i
|
|
2527
3061
|
};
|
|
2528
|
-
},
|
|
3062
|
+
}, Gi = (e, t) => {
|
|
2529
3063
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), o = new Set(t.refreshEventIds ?? []), s = 0, c = (o) => {
|
|
2530
3064
|
r.set(o.instanceId, o);
|
|
2531
3065
|
let l = i.get(o.instanceId);
|
|
2532
3066
|
if (l) return l;
|
|
2533
|
-
let u = o.resource, d = s, f = Promise.resolve(
|
|
3067
|
+
let u = o.resource, d = s, f = Promise.resolve(G(e, t.queryHandlerId, {
|
|
2534
3068
|
resource: u,
|
|
2535
3069
|
params: { renderer: {
|
|
2536
3070
|
rendererId: t.placementId,
|
|
@@ -2543,7 +3077,7 @@ var Dt = (e) => {
|
|
|
2543
3077
|
i.delete(o.instanceId), await c(o);
|
|
2544
3078
|
return;
|
|
2545
3079
|
}
|
|
2546
|
-
n.set(o.instanceId,
|
|
3080
|
+
n.set(o.instanceId, Wi(r, t.extensionId, e.projectId));
|
|
2547
3081
|
for (let e of a) e();
|
|
2548
3082
|
}).finally(() => {
|
|
2549
3083
|
i.get(o.instanceId) === f && i.delete(o.instanceId);
|
|
@@ -2558,7 +3092,7 @@ var Dt = (e) => {
|
|
|
2558
3092
|
subscribe(t) {
|
|
2559
3093
|
a.add(t);
|
|
2560
3094
|
let n = e.workbench.resources.preview.subscribeRefresh(async (e) => {
|
|
2561
|
-
let t = [...r.values()].filter((t) => t.resource &&
|
|
3095
|
+
let t = [...r.values()].filter((t) => t.resource && E(t.resource) === E(e));
|
|
2562
3096
|
t.length && (s++, await Promise.all(t.map(c)));
|
|
2563
3097
|
}), i = e.subscribeRefreshEvents?.((e) => {
|
|
2564
3098
|
if (o.has(e.id)) {
|
|
@@ -2571,25 +3105,25 @@ var Dt = (e) => {
|
|
|
2571
3105
|
} };
|
|
2572
3106
|
}
|
|
2573
3107
|
};
|
|
2574
|
-
},
|
|
3108
|
+
}, Ki = (e) => {
|
|
2575
3109
|
for (let t = e.length - 1; t >= 0; --t) e[t]?.dispose();
|
|
2576
|
-
},
|
|
3110
|
+
}, qi = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, Ji = (e, t, n, r, i) => e.prepareCommandArgs?.(t, n, r, i) ?? n, Yi = (e, t) => t.commands.map((t) => e.workbench.commands.registerCommand({
|
|
2577
3111
|
id: t.id,
|
|
2578
|
-
label:
|
|
2579
|
-
description:
|
|
2580
|
-
params:
|
|
3112
|
+
label: V(t.title, t.id),
|
|
3113
|
+
description: V(t.description),
|
|
3114
|
+
params: K(t.params, V, t.extensionId),
|
|
2581
3115
|
resourceMutation: t.resourceMutation
|
|
2582
3116
|
}, {
|
|
2583
|
-
prepareArgs: (n, r, i) =>
|
|
2584
|
-
execute: (n, r) =>
|
|
2585
|
-
params:
|
|
3117
|
+
prepareArgs: (n, r, i) => Ji(e, t.id, n, r, i),
|
|
3118
|
+
execute: (n, r) => G(e, t.id, {
|
|
3119
|
+
params: qi(n),
|
|
2586
3120
|
resource: r?.resource,
|
|
2587
3121
|
signal: r?.signal,
|
|
2588
3122
|
region: r?.region
|
|
2589
3123
|
})
|
|
2590
|
-
})),
|
|
3124
|
+
})), Xi = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), Zi = (e, t) => {
|
|
2591
3125
|
if (!e.menuSlotsById) return [];
|
|
2592
|
-
let { registrations: n } =
|
|
3126
|
+
let { registrations: n } = ar({
|
|
2593
3127
|
metadata: e.metadata,
|
|
2594
3128
|
menuSlotsById: e.menuSlotsById,
|
|
2595
3129
|
menuTargetsById: e.menuTargetsById,
|
|
@@ -2602,14 +3136,14 @@ var Dt = (e) => {
|
|
|
2602
3136
|
}]
|
|
2603
3137
|
}));
|
|
2604
3138
|
return (e.menuRegistrations ?? r).flatMap((n) => [e.workbench.commands.registerCommand(n.command, {
|
|
2605
|
-
prepareArgs: (e, r, i) =>
|
|
2606
|
-
execute: (r, i) =>
|
|
3139
|
+
prepareArgs: (e, r, i) => Ji(t, n.targetCommandId, e, r, i),
|
|
3140
|
+
execute: (r, i) => G(t, n.targetCommandId, {
|
|
2607
3141
|
params: {
|
|
2608
3142
|
...n.contribution.params ?? {},
|
|
2609
|
-
...
|
|
3143
|
+
...qi(r) ?? {}
|
|
2610
3144
|
},
|
|
2611
|
-
resource:
|
|
2612
|
-
slot:
|
|
3145
|
+
resource: Xi(e, i),
|
|
3146
|
+
slot: U({
|
|
2613
3147
|
id: n.contribution.slotId,
|
|
2614
3148
|
kind: "menu",
|
|
2615
3149
|
projectId: e.projectId,
|
|
@@ -2617,71 +3151,72 @@ var Dt = (e) => {
|
|
|
2617
3151
|
})
|
|
2618
3152
|
})
|
|
2619
3153
|
}), ...n.menuItems.map(({ menuPath: t, menuItem: n }) => e.workbench.layout.registerMenuItem(t, n))]);
|
|
2620
|
-
},
|
|
2621
|
-
prepareArgs: (e,
|
|
2622
|
-
execute: (
|
|
3154
|
+
}, Qi = (e, t) => or({ metadata: e.metadata }).flatMap((n) => [e.workbench.commands.registerCommand(n.command, {
|
|
3155
|
+
prepareArgs: (e, r, i) => Ji(t, n.targetCommandId, e, r, i),
|
|
3156
|
+
execute: (r, i) => G(t, n.targetCommandId, {
|
|
2623
3157
|
params: {
|
|
2624
|
-
...
|
|
2625
|
-
...
|
|
3158
|
+
...n.contribution.params ?? {},
|
|
3159
|
+
...qi(r) ?? {}
|
|
2626
3160
|
},
|
|
2627
|
-
resource:
|
|
2628
|
-
slot:
|
|
3161
|
+
resource: Xi(e, i),
|
|
3162
|
+
slot: U({
|
|
2629
3163
|
id: "workbench.commandPalette",
|
|
2630
3164
|
kind: "menu",
|
|
2631
3165
|
projectId: e.projectId,
|
|
2632
|
-
context: { panelId:
|
|
3166
|
+
context: { panelId: n.contribution.id }
|
|
2633
3167
|
})
|
|
2634
3168
|
}),
|
|
2635
|
-
isVisible: () =>
|
|
2636
|
-
}), e.workbench.layout.registerMenuItem(
|
|
3169
|
+
isVisible: () => ee(n.contribution.when, e.workbench.getPrimaryResource()?.type)
|
|
3170
|
+
}), e.workbench.layout.registerMenuItem(g, n.menuItem)]), $i = (e, t) => {
|
|
2637
3171
|
let n = t?.mode;
|
|
2638
3172
|
if (!n) return !0;
|
|
2639
3173
|
let r = e.workbench.modes.getActiveModeId() ?? "";
|
|
2640
3174
|
return Array.isArray(n) ? n.includes(r) : n === r;
|
|
2641
|
-
},
|
|
3175
|
+
}, ea = (e) => (e.metadata.statusBarItems ?? []).map((t) => e.workbench.statusBar.registerItem({
|
|
2642
3176
|
id: t.id,
|
|
2643
3177
|
viewId: t.viewId,
|
|
2644
3178
|
slot: t.slot,
|
|
2645
3179
|
order: t.order,
|
|
2646
|
-
isVisible: () =>
|
|
2647
|
-
})),
|
|
3180
|
+
isVisible: () => $i(e, t.when)
|
|
3181
|
+
})), ta = (e) => e.metadata.pages.map((t) => e.workbench.pages.registerPage(t)), na = (e) => e.metadata.modes.map((t) => e.workbench.modes.registerMode({
|
|
2648
3182
|
id: t.modeId,
|
|
2649
|
-
label:
|
|
3183
|
+
label: V(t.label, t.modeId),
|
|
2650
3184
|
panels: t.panelRegions,
|
|
2651
3185
|
regionSettings: t.regionSettings,
|
|
3186
|
+
panelHeaders: "legacy",
|
|
2652
3187
|
floatingPanels: t.floatingPanels,
|
|
2653
3188
|
defaultTheme: t.defaultTheme,
|
|
2654
3189
|
chrome: t.chrome,
|
|
2655
3190
|
activate: () => void 0
|
|
2656
|
-
})),
|
|
3191
|
+
})), ra = (e) => e.metadata.placements.map((t) => e.workbench.modePlacements.registerPlacement(t)), ia = (e) => {
|
|
2657
3192
|
let t = {
|
|
2658
3193
|
...e,
|
|
2659
|
-
metadata:
|
|
3194
|
+
metadata: Ti(e.metadata, { createTab: (t) => Gi(e, t) })
|
|
2660
3195
|
}, n = [], r = t;
|
|
2661
3196
|
try {
|
|
2662
|
-
return n.push(...
|
|
3197
|
+
return n.push(...Yi(r, t.metadata)), n.push(...di({
|
|
2663
3198
|
bindings: t.metadata.keybindings,
|
|
2664
3199
|
createWhenExpression: t.createKeybindingWhenExpression,
|
|
2665
3200
|
workbench: t.workbench
|
|
2666
|
-
})), n.push(...
|
|
3201
|
+
})), n.push(...Zi(t, r)), n.push(...Qi(t, r)), n.push(Qr({
|
|
2667
3202
|
...t,
|
|
2668
3203
|
resolveNodeResource: t.resolveTreeNodeResource
|
|
2669
|
-
})), n.push(
|
|
3204
|
+
})), n.push(fr(t)), n.push(Un(r, t.metadata.controlsRenderers ?? [])), n.push(...Li(t)), n.push(...Bi(t)), n.push(Rr(r, t.metadata.kanbanRenderers ?? [], t.kanbanAdapter)), n.push(Xn(r, t.metadata.dataTableRenderers ?? [], t.dataTableAdapter)), n.push(...zi(t)), n.push(Bn(r, t.metadata.commandPaletteResources ?? [])), n.push(...si({
|
|
2670
3205
|
createWhenExpression: e.createNavigationWhenExpression,
|
|
2671
3206
|
metadata: e.metadata,
|
|
2672
3207
|
workbench: e.workbench
|
|
2673
|
-
})), e.subscribeRefreshEvents && n.push(
|
|
3208
|
+
})), e.subscribeRefreshEvents && n.push(Oi({
|
|
2674
3209
|
metadata: e.metadata,
|
|
2675
3210
|
subscribe: e.subscribeRefreshEvents,
|
|
2676
3211
|
workbench: e.workbench
|
|
2677
|
-
})), n.push(...
|
|
2678
|
-
|
|
3212
|
+
})), n.push(...ea(t)), n.push(...ci(t)), n.push(...ta(t)), n.push(...na(t)), n.push(...ra(t)), { dispose() {
|
|
3213
|
+
Ki(n);
|
|
2679
3214
|
} };
|
|
2680
3215
|
} catch (e) {
|
|
2681
|
-
throw
|
|
3216
|
+
throw Ki(n), e;
|
|
2682
3217
|
}
|
|
2683
3218
|
};
|
|
2684
3219
|
//#endregion
|
|
2685
|
-
export {
|
|
3220
|
+
export { L as WebviewHostCapabilityError, or as buildWorkbenchExtensionCommandPaletteRegistrations, ar as buildWorkbenchExtensionMenuRegistrations, U as createExtensionSlot, Cn as createExtensionWebviewHostCapabilities, Jt as createTerminalSessionCapability, On as createWorkbenchWebviewHostAdapters, kn as createWorkbenchWebviewHostCapabilities, Qn as emptyWorkbenchExtensionMetadata, W as executeWorkbenchExtensionCommandResponse, ur as fileRendererRefreshEnvelopeFromCommand, Mn as getBridgeWebviewHostEventPublisher, ki as refreshOpenWorkbenchExtensionWebviews, Ei as refreshWorkbenchExtensionRenderer, Bn as registerWorkbenchExtensionCommandPaletteResources, ia as registerWorkbenchExtensionContributions, Un as registerWorkbenchExtensionControlsRenderers, Xn as registerWorkbenchExtensionDataTableRenderers, fr as registerWorkbenchExtensionFileRenderers, Rr as registerWorkbenchExtensionKanbanRenderers, Oi as registerWorkbenchExtensionRendererRefreshEvents, Qr as registerWorkbenchExtensionTreeRenderers, Nn as renderBridgeWebviewFrame, B as toWorkbenchNavigationTarget, fi as toWorkbenchWhenExpression, hn as withFrameSignal };
|
|
2686
3221
|
|
|
2687
3222
|
//# sourceMappingURL=extensions.js.map
|