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