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