@pstdio/workbench 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extensions.d.ts +36 -1
- package/dist/extensions.js +4 -0
- package/dist/extensions.js.map +1 -1
- package/dist/file-renderer-view-B6_iR4EN.js +496 -0
- package/dist/file-renderer-view-B6_iR4EN.js.map +1 -0
- package/dist/index.d.ts +37 -2
- package/dist/index.js +267 -259
- package/dist/index.js.map +1 -1
- package/dist/react.d.ts +49 -3
- package/dist/react.js +2267 -2143
- package/dist/react.js.map +1 -1
- package/dist/testing.d.ts +36 -1
- package/dist/{workbench-built-ins-BtgeB274.js → workbench-built-ins-BncLJfQA.js} +382 -378
- package/dist/workbench-built-ins-BncLJfQA.js.map +1 -0
- package/package.json +4 -4
- package/dist/file-renderer-view-zpunbE4I.js +0 -432
- package/dist/file-renderer-view-zpunbE4I.js.map +0 -1
- package/dist/workbench-built-ins-BtgeB274.js.map +0 -1
|
@@ -1,62 +1,62 @@
|
|
|
1
1
|
import { c as m, w as $ } from "./workbench-menu-paths-Bb0ICxeG.js";
|
|
2
2
|
import { w as p, r as Y } from "./layout-types-DMoZz38-.js";
|
|
3
|
-
import { r as ee, l as te, g as
|
|
4
|
-
import { devtools as
|
|
3
|
+
import { r as ee, l as te, g as ie } from "./surface-map-C1pOTUmF.js";
|
|
4
|
+
import { devtools as ne } from "zustand/middleware";
|
|
5
5
|
import { createStore as oe } from "zustand/vanilla";
|
|
6
|
-
const re = (e,
|
|
7
|
-
const
|
|
6
|
+
const re = (e, i) => Object.is(e, i), W = (e) => {
|
|
7
|
+
const i = oe()(ne(() => e.initialState, {
|
|
8
8
|
name: e.name ?? "workbench.store"
|
|
9
|
-
})), t = (r, s,
|
|
10
|
-
const o =
|
|
11
|
-
let a = r(
|
|
12
|
-
return
|
|
13
|
-
const
|
|
14
|
-
if (o(a,
|
|
9
|
+
})), t = (r, s, n = {}) => {
|
|
10
|
+
const o = n.equalityFn ?? re;
|
|
11
|
+
let a = r(i.getState());
|
|
12
|
+
return n.fireImmediately && s(a, a), i.subscribe((c) => {
|
|
13
|
+
const d = r(c);
|
|
14
|
+
if (o(a, d)) return;
|
|
15
15
|
const g = a;
|
|
16
|
-
a =
|
|
16
|
+
a = d, s(d, g);
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
19
|
return {
|
|
20
|
-
getState:
|
|
21
|
-
getInitialState:
|
|
22
|
-
subscribe:
|
|
20
|
+
getState: i.getState,
|
|
21
|
+
getInitialState: i.getInitialState,
|
|
22
|
+
subscribe: i.subscribe,
|
|
23
23
|
subscribeSelector: t,
|
|
24
|
-
setState:
|
|
25
|
-
api:
|
|
24
|
+
setState: i.setState,
|
|
25
|
+
api: i
|
|
26
26
|
};
|
|
27
|
-
},
|
|
27
|
+
}, je = (e, i) => {
|
|
28
28
|
for (const t of Object.values(e.regions)) {
|
|
29
|
-
const r = t.widgets.findIndex((s) => s.contributionId ===
|
|
29
|
+
const r = t.widgets.findIndex((s) => s.contributionId === i);
|
|
30
30
|
if (r >= 0) return {
|
|
31
31
|
regionId: t.id,
|
|
32
32
|
index: r,
|
|
33
33
|
placement: t.widgets[r]
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
},
|
|
36
|
+
}, Ke = (e, i, t) => {
|
|
37
37
|
for (const r of Object.values(e.regions)) {
|
|
38
|
-
const s = r.widgets.findIndex((
|
|
38
|
+
const s = r.widgets.findIndex((n) => n.contributionId === i && n.resourceUri === t);
|
|
39
39
|
if (s >= 0) return {
|
|
40
40
|
regionId: r.id,
|
|
41
41
|
index: s,
|
|
42
42
|
placement: r.widgets[s]
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
}, se = (e,
|
|
45
|
+
}, se = (e, i) => {
|
|
46
46
|
for (const t of Object.values(e.regions)) {
|
|
47
|
-
const r = t.widgets.findIndex((s) => s.widgetId ===
|
|
47
|
+
const r = t.widgets.findIndex((s) => s.widgetId === i);
|
|
48
48
|
if (r >= 0) return {
|
|
49
49
|
regionId: t.id,
|
|
50
50
|
index: r,
|
|
51
51
|
placement: t.widgets[r]
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
}, Ee = (e,
|
|
54
|
+
}, Ee = (e, i) => {
|
|
55
55
|
const t = new Set(Object.values(e.regions).flatMap((r) => r.widgets.map((s) => s.widgetId)));
|
|
56
|
-
return Y(t,
|
|
57
|
-
},
|
|
58
|
-
if (!
|
|
59
|
-
const s = _(
|
|
56
|
+
return Y(t, i);
|
|
57
|
+
}, K = (e) => e.widgets.find((i) => i.widgetId === e.activeWidgetId) ?? e.widgets[0], P = (e) => e.role === "location", _ = (e) => e.resourceUri ?? `${e.contributionId}:${e.widgetId}`, E = (e, i, t, r) => {
|
|
58
|
+
if (!i) return e;
|
|
59
|
+
const s = _(i), o = {
|
|
60
60
|
...e.locationSubPanelSelections?.[s] ?? {}
|
|
61
61
|
};
|
|
62
62
|
return r ? o[t] = r : delete o[t], {
|
|
@@ -66,56 +66,56 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
66
66
|
[s]: o
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
}, F = (e,
|
|
69
|
+
}, F = (e, i) => {
|
|
70
70
|
if (!e.locationSubPanelSelections) return e;
|
|
71
|
-
const t = Object.fromEntries(Object.entries(e.locationSubPanelSelections).map(([r, s]) => [r, Object.fromEntries(Object.entries(s).filter(([,
|
|
71
|
+
const t = Object.fromEntries(Object.entries(e.locationSubPanelSelections).map(([r, s]) => [r, Object.fromEntries(Object.entries(s).filter(([, n]) => n !== i))]));
|
|
72
72
|
return {
|
|
73
73
|
...e,
|
|
74
74
|
locationSubPanelSelections: t
|
|
75
75
|
};
|
|
76
76
|
}, k = (e) => {
|
|
77
|
-
const
|
|
78
|
-
return
|
|
79
|
-
}, $e = (e,
|
|
77
|
+
const i = e.regions.main.widgets.filter(P);
|
|
78
|
+
return i.find((t) => t.widgetId === e.activeLocationWidgetId) ?? i.at(-1);
|
|
79
|
+
}, $e = (e, i, t) => {
|
|
80
80
|
const r = {
|
|
81
81
|
...e
|
|
82
82
|
};
|
|
83
|
-
return t.resource ? (r.resource = t.resource, r.resourceUri = t.resource.uri, r.title = t.title ?? t.resource.label ??
|
|
84
|
-
}, De = (e,
|
|
83
|
+
return t.resource ? (r.resource = t.resource, r.resourceUri = t.resource.uri, r.title = t.title ?? t.resource.label ?? i.title) : t.title !== void 0 && (r.title = t.title), t.pinned !== void 0 && (r.pinned = t.pinned), t.closable !== void 0 && (r.closable = t.closable), t.mountStrategy !== void 0 && (r.mountStrategy = t.mountStrategy), t.hiddenByDefault !== void 0 && (r.hiddenByDefault = t.hiddenByDefault), t.tabRetention !== void 0 && (r.tabRetention = t.tabRetention), t.tab !== void 0 && (r.tab = t.tab), t.ownerId !== void 0 && (r.ownerId = t.ownerId), t.source !== void 0 && (r.source = t.source), t.role !== void 0 && (r.role = t.role), r;
|
|
84
|
+
}, De = (e, i, t) => ({
|
|
85
85
|
widgetId: e,
|
|
86
|
-
contributionId:
|
|
87
|
-
ownerId: t.ownerId ??
|
|
88
|
-
source: t.source ??
|
|
86
|
+
contributionId: i.id,
|
|
87
|
+
ownerId: t.ownerId ?? i.ownerId,
|
|
88
|
+
source: t.source ?? i.source,
|
|
89
89
|
resource: t.resource,
|
|
90
90
|
resourceUri: t.resource?.uri,
|
|
91
|
-
title: t.title ?? t.resource?.label ??
|
|
91
|
+
title: t.title ?? t.resource?.label ?? i.title,
|
|
92
92
|
pinned: t.pinned,
|
|
93
93
|
// Tabbed (non-singleton) widgets are closable unless they opt out; singleton
|
|
94
94
|
// panels stay non-closable by default.
|
|
95
|
-
closable: t.closable ??
|
|
96
|
-
mountStrategy: t.mountStrategy ??
|
|
97
|
-
hiddenByDefault: t.hiddenByDefault ??
|
|
95
|
+
closable: t.closable ?? i.closable ?? !i.singleton,
|
|
96
|
+
mountStrategy: t.mountStrategy ?? i.mountStrategy,
|
|
97
|
+
hiddenByDefault: t.hiddenByDefault ?? i.hiddenByDefault,
|
|
98
98
|
tabRetention: t.tabRetention,
|
|
99
|
-
tab: t.tab ??
|
|
99
|
+
tab: t.tab ?? i.tab,
|
|
100
100
|
role: t.role ?? "content"
|
|
101
|
-
}), He = (e,
|
|
102
|
-
const s = e.regions[
|
|
101
|
+
}), He = (e, i, t, r = {}) => {
|
|
102
|
+
const s = e.regions[i], n = t(s.widgets), o = r.activeWidgetId !== void 0 ? r.activeWidgetId : r.clearActiveWidget ? void 0 : s.activeWidgetId;
|
|
103
103
|
return {
|
|
104
104
|
...e,
|
|
105
|
-
activeLocationWidgetId:
|
|
105
|
+
activeLocationWidgetId: i === "main" && !n.some((a) => a.widgetId === e.activeLocationWidgetId) ? n.filter(P).at(-1)?.widgetId : e.activeLocationWidgetId,
|
|
106
106
|
regions: {
|
|
107
107
|
...e.regions,
|
|
108
|
-
[
|
|
108
|
+
[i]: {
|
|
109
109
|
...s,
|
|
110
|
-
widgets:
|
|
110
|
+
widgets: n,
|
|
111
111
|
activeWidgetId: o
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
|
-
}, Be = (e,
|
|
115
|
+
}, Be = (e, i) => {
|
|
116
116
|
let t = e;
|
|
117
117
|
for (const s of Object.values(e.regions)) {
|
|
118
|
-
const
|
|
118
|
+
const n = s.widgets.filter((c) => c.contributionId === i), o = s.widgets.filter((c) => c.contributionId !== i);
|
|
119
119
|
if (o.length === s.widgets.length) continue;
|
|
120
120
|
const a = s.activeWidgetId && !o.some((c) => c.widgetId === s.activeWidgetId) ? void 0 : s.activeWidgetId;
|
|
121
121
|
t = {
|
|
@@ -129,11 +129,11 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
|
-
for (const c of
|
|
132
|
+
for (const c of n)
|
|
133
133
|
t = F(t, c.widgetId);
|
|
134
134
|
}
|
|
135
|
-
const r = Object.values(t.regions).some((s) => s.widgets.some((
|
|
136
|
-
return t.activeWidgetId && (!r || t.activeWidgetId.startsWith(`${
|
|
135
|
+
const r = Object.values(t.regions).some((s) => s.widgets.some((n) => n.widgetId === t.activeWidgetId));
|
|
136
|
+
return t.activeWidgetId && (!r || t.activeWidgetId.startsWith(`${i}:`) || t.activeWidgetId === i) && (t = {
|
|
137
137
|
...t,
|
|
138
138
|
activeWidgetId: void 0,
|
|
139
139
|
activeResourceUri: void 0
|
|
@@ -141,40 +141,44 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
141
141
|
...t,
|
|
142
142
|
activeLocationWidgetId: t.regions.main.widgets.filter(P).at(-1)?.widgetId
|
|
143
143
|
}), t;
|
|
144
|
-
}, Te = (e,
|
|
145
|
-
const t = se(e,
|
|
144
|
+
}, Te = (e, i) => {
|
|
145
|
+
const t = se(e, i);
|
|
146
146
|
if (!t) return;
|
|
147
|
-
const r = e.regions[t.regionId], s = r.widgets.filter((u) => u.widgetId !==
|
|
147
|
+
const r = e.regions[t.regionId], s = r.widgets.filter((u) => u.widgetId !== i), n = r.activeWidgetId === i || !r.activeWidgetId && t.index === 0, a = (t.placement.role === "sub-panel" ? s.find((u) => u.role === "sub-panel" && u.ownerResourceUri === t.placement.ownerResourceUri) : void 0) ?? (t.placement.role === "sub-panel" && t.regionId === "main" ? k(e) : s[t.index] ?? s[t.index - 1]), c = n ? a?.widgetId : r.activeWidgetId, d = {
|
|
148
148
|
...r,
|
|
149
149
|
widgets: s,
|
|
150
150
|
activeWidgetId: c
|
|
151
151
|
};
|
|
152
152
|
let g = F({
|
|
153
153
|
...e,
|
|
154
|
-
activeLocationWidgetId: e.activeLocationWidgetId ===
|
|
154
|
+
activeLocationWidgetId: e.activeLocationWidgetId === i ? e.regions.main.widgets.filter((u) => u.widgetId !== i && P(u)).at(-1)?.widgetId : e.activeLocationWidgetId,
|
|
155
155
|
regions: {
|
|
156
156
|
...e.regions,
|
|
157
|
-
[r.id]:
|
|
157
|
+
[r.id]: d
|
|
158
158
|
}
|
|
159
|
-
},
|
|
160
|
-
return
|
|
159
|
+
}, i);
|
|
160
|
+
return n && t.regionId !== "side" && p.includes(t.regionId) && (g = E(g, k(g), t.regionId, a?.role === "sub-panel" ? a.widgetId : void 0)), e.activeWidgetId === i && (g = {
|
|
161
161
|
...g,
|
|
162
162
|
activeWidgetId: a?.widgetId,
|
|
163
163
|
activeResourceUri: a?.resourceUri
|
|
164
164
|
}), {
|
|
165
165
|
regionId: t.regionId,
|
|
166
166
|
closedPlacement: t.placement,
|
|
167
|
-
activePlacement:
|
|
167
|
+
activePlacement: K(d),
|
|
168
168
|
layout: g
|
|
169
169
|
};
|
|
170
|
-
}, _e = (e,
|
|
171
|
-
const r = e.regions[
|
|
172
|
-
if (
|
|
173
|
-
const
|
|
174
|
-
...
|
|
175
|
-
|
|
170
|
+
}, _e = (e, i, t) => {
|
|
171
|
+
const r = e.regions[i];
|
|
172
|
+
if (i === "main" && P(t)) {
|
|
173
|
+
const n = e.locationSubPanelSelections?.[_(t)] ?? {}, o = Object.fromEntries(Object.entries(e.regions).map(([a, c]) => [a, {
|
|
174
|
+
...c,
|
|
175
|
+
widgets: c.widgets.map((d) => !t.resource || d.widgetId === t.widgetId || d.ownerResourceUri !== t.resourceUri || d.resourceUri !== t.resourceUri ? d : {
|
|
176
|
+
...d,
|
|
177
|
+
resource: t.resource
|
|
178
|
+
})
|
|
179
|
+
}]));
|
|
176
180
|
for (const a of p) {
|
|
177
|
-
const c = o[a],
|
|
181
|
+
const c = o[a], d = n[a], g = c.widgets.find((u) => u.widgetId === d && u.role === "sub-panel" && (!u.ownerResourceUri || u.ownerResourceUri === t.resourceUri));
|
|
178
182
|
o[a] = {
|
|
179
183
|
...c,
|
|
180
184
|
activeWidgetId: a === "side" ? c.activeWidgetId : g?.widgetId ?? (a === "main" ? t.widgetId : void 0)
|
|
@@ -188,7 +192,7 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
188
192
|
regions: o
|
|
189
193
|
};
|
|
190
194
|
}
|
|
191
|
-
const s = t.role === "sub-panel" &&
|
|
195
|
+
const s = t.role === "sub-panel" && i !== "side" && p.includes(i) ? E(e, k(e), i, t.widgetId) : e;
|
|
192
196
|
return {
|
|
193
197
|
...s,
|
|
194
198
|
activeWidgetId: t.widgetId,
|
|
@@ -196,52 +200,52 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
196
200
|
activeResourceUri: t.resourceUri,
|
|
197
201
|
regions: {
|
|
198
202
|
...s.regions,
|
|
199
|
-
[
|
|
203
|
+
[i]: {
|
|
200
204
|
...r,
|
|
201
205
|
activeWidgetId: t.widgetId
|
|
202
206
|
}
|
|
203
207
|
}
|
|
204
208
|
};
|
|
205
|
-
}, Fe = (e,
|
|
206
|
-
const r = e.regions[
|
|
207
|
-
if (t && !s) throw new Error(`Widget placement not found in ${
|
|
209
|
+
}, Fe = (e, i, t) => {
|
|
210
|
+
const r = e.regions[i], s = t ? r.widgets.find((a) => a.widgetId === t) : void 0;
|
|
211
|
+
if (t && !s) throw new Error(`Widget placement not found in ${i}: ${t}`);
|
|
208
212
|
if (r.activeWidgetId === t) return;
|
|
209
|
-
const
|
|
213
|
+
const n = e.activeWidgetId === r.activeWidgetId, o = {
|
|
210
214
|
...e,
|
|
211
|
-
activeWidgetId:
|
|
212
|
-
activeResourceUri:
|
|
213
|
-
activeLocationWidgetId:
|
|
215
|
+
activeWidgetId: n ? s?.widgetId : e.activeWidgetId,
|
|
216
|
+
activeResourceUri: n ? s?.resourceUri : e.activeResourceUri,
|
|
217
|
+
activeLocationWidgetId: i === "main" && s?.role === "location" ? s.widgetId : e.activeLocationWidgetId,
|
|
214
218
|
regions: {
|
|
215
219
|
...e.regions,
|
|
216
|
-
[
|
|
220
|
+
[i]: {
|
|
217
221
|
...r,
|
|
218
222
|
activeWidgetId: s?.widgetId
|
|
219
223
|
}
|
|
220
224
|
}
|
|
221
225
|
};
|
|
222
|
-
return
|
|
223
|
-
}, ce = (e,
|
|
224
|
-
const s = e.regions[
|
|
225
|
-
return s.widgets.find((
|
|
226
|
-
}, Ne = (e) => k(e), ae = (e,
|
|
226
|
+
return i === "side" || !p.includes(i) ? o : E(o, k(o), i, s?.role === "sub-panel" ? s.widgetId : void 0);
|
|
227
|
+
}, ce = (e, i) => !(e.resourceKinds?.length && (!i || !e.resourceKinds.includes(i.kind)) || e.canOpen && (!i || !e.canOpen(i))), Ve = (e, i, t, r = {}) => {
|
|
228
|
+
const s = e.regions[i];
|
|
229
|
+
return s.widgets.find((n) => n.widgetId === s.activeWidgetId && n.role === "sub-panel" && (r.ignoreOwnerResourceUri || !n.ownerResourceUri || n.ownerResourceUri === t?.uri));
|
|
230
|
+
}, Ne = (e) => k(e), ae = (e, i, t, r) => {
|
|
227
231
|
const s = e.eligibleLocations;
|
|
228
|
-
return !(!V(e, t) || s?.resourceKinds?.length && (!
|
|
229
|
-
}, V = (e,
|
|
232
|
+
return !(!V(e, t) || s?.resourceKinds?.length && (!i || !s.resourceKinds.includes(i.kind)) || s?.resourceIds?.length && (!i?.id || !s.resourceIds.includes(i.id)) || s?.canOpen && (!i || !s.canOpen(i)) || r?.ownerResourceUri && r.ownerResourceUri !== i?.uri);
|
|
233
|
+
}, V = (e, i) => {
|
|
230
234
|
const t = e.eligibleLocations?.modeIds;
|
|
231
|
-
return !t?.length ||
|
|
232
|
-
}, qe = (e,
|
|
235
|
+
return !t?.length || i !== void 0 && t.includes(i);
|
|
236
|
+
}, qe = (e, i, t, r, s = {}) => ce(e, r?.resource ?? i) ? s.ignoreResourceLocation ? V(e, t) : ae(e, i, t, r) : !1, ze = (e, i) => {
|
|
233
237
|
const t = e.regions.main.widgets.find((r) => r.widgetId === e.regions.main.activeWidgetId) ?? k(e);
|
|
234
|
-
return t ?
|
|
235
|
-
}, Qe = (e,
|
|
238
|
+
return t ? i.find((r) => r.id === t.contributionId)?.floatingPanels !== "hidden" : !0;
|
|
239
|
+
}, Qe = (e, i) => {
|
|
236
240
|
const t = e.panelMenuOwner ?? {
|
|
237
241
|
level: "panel"
|
|
238
242
|
};
|
|
239
|
-
return t.contributionId ? (
|
|
243
|
+
return t.contributionId ? (i.subPanel ?? i.locationPanel)?.contributionId === t.contributionId : i.subPanel ? t.level === "sub-panel" : t.level === "panel";
|
|
240
244
|
}, de = "workbench.core", N = (e = {}) => ({
|
|
241
245
|
source: e.source ?? "module",
|
|
242
246
|
ownerId: e.ownerId ?? de,
|
|
243
247
|
priority: e.priority ?? 0
|
|
244
|
-
}),
|
|
248
|
+
}), O = (e, i) => i.priority - e.priority || e.ownerId.localeCompare(i.ownerId), Ge = (e = {}, i) => {
|
|
245
249
|
const {
|
|
246
250
|
strategy: t,
|
|
247
251
|
...r
|
|
@@ -263,7 +267,7 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
263
267
|
tabPosition: t.position
|
|
264
268
|
} : {
|
|
265
269
|
...r,
|
|
266
|
-
tabRetention:
|
|
270
|
+
tabRetention: i
|
|
267
271
|
};
|
|
268
272
|
}, Je = (e) => ({
|
|
269
273
|
instanceId: e.widgetId,
|
|
@@ -282,7 +286,7 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
282
286
|
tab: e.tab
|
|
283
287
|
}), Xe = (e) => {
|
|
284
288
|
const {
|
|
285
|
-
closable:
|
|
289
|
+
closable: i,
|
|
286
290
|
ownedPanelMenuIds: t,
|
|
287
291
|
...r
|
|
288
292
|
} = e;
|
|
@@ -291,53 +295,53 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
291
295
|
main: ["main-header", "main-left-menu", "main", "main-right-menu"],
|
|
292
296
|
secondary: ["secondary-header", "secondary-left-menu", "secondary", "secondary-right-menu"],
|
|
293
297
|
side: ["side-header", "side-left-menu", "side", "side-right-menu"]
|
|
294
|
-
}, H = Object.values(y).flat(),
|
|
295
|
-
if (
|
|
296
|
-
return Object.values(e.regions).flatMap((t) => t.widgets).find((t) => t.widgetId ===
|
|
297
|
-
}, A = (e,
|
|
298
|
-
const t =
|
|
298
|
+
}, H = Object.values(y).flat(), x = (e) => e.panels ?? p, Ze = (e) => Object.keys(y).find((i) => y[i].some((t) => t === e)), Ye = (e, i) => !e || x(e).includes(i), I = (e, i) => {
|
|
299
|
+
if (i)
|
|
300
|
+
return Object.values(e.regions).flatMap((t) => t.widgets).find((t) => t.widgetId === i);
|
|
301
|
+
}, A = (e, i) => {
|
|
302
|
+
const t = i.find((r) => r && I(e, r.widgetId));
|
|
299
303
|
return {
|
|
300
304
|
...e,
|
|
301
305
|
activeWidgetId: t?.widgetId,
|
|
302
306
|
activeResourceUri: t?.resourceUri
|
|
303
307
|
};
|
|
304
|
-
}, le = (e,
|
|
305
|
-
if (
|
|
306
|
-
const t = new Set(Object.keys(y).filter((c) => y[c].some((
|
|
307
|
-
const
|
|
308
|
-
return
|
|
309
|
-
}), s = Object.values(e.locationSubPanelSelections ?? {}).some((c) => Object.keys(c).some((
|
|
308
|
+
}, le = (e, i) => {
|
|
309
|
+
if (i.length === 0) return e;
|
|
310
|
+
const t = new Set(Object.keys(y).filter((c) => y[c].some((d) => i.includes(d)))), r = i.some((c) => {
|
|
311
|
+
const d = e.regions[c];
|
|
312
|
+
return d.widgets.length > 0 || d.activeWidgetId !== void 0 || d.visible;
|
|
313
|
+
}), s = Object.values(e.locationSubPanelSelections ?? {}).some((c) => Object.keys(c).some((d) => t.has(d)));
|
|
310
314
|
if (!r && !s) return e;
|
|
311
|
-
const
|
|
315
|
+
const n = {
|
|
312
316
|
...e.regions
|
|
313
317
|
};
|
|
314
|
-
for (const c of
|
|
315
|
-
|
|
316
|
-
...
|
|
318
|
+
for (const c of i)
|
|
319
|
+
n[c] = {
|
|
320
|
+
...n[c],
|
|
317
321
|
widgets: [],
|
|
318
322
|
activeWidgetId: void 0,
|
|
319
323
|
visible: !1
|
|
320
324
|
};
|
|
321
|
-
const o = Object.fromEntries(Object.entries(e.locationSubPanelSelections ?? {}).map(([c,
|
|
325
|
+
const o = Object.fromEntries(Object.entries(e.locationSubPanelSelections ?? {}).map(([c, d]) => [c, Object.fromEntries(Object.entries(d).filter(([g]) => !t.has(g)))])), a = {
|
|
322
326
|
...e,
|
|
323
|
-
regions:
|
|
327
|
+
regions: n
|
|
324
328
|
};
|
|
325
329
|
return {
|
|
326
330
|
...A(a, [I(a, e.activeWidgetId)]),
|
|
327
331
|
activeLocationWidgetId: I(a, e.activeLocationWidgetId)?.widgetId,
|
|
328
332
|
locationSubPanelSelections: o
|
|
329
333
|
};
|
|
330
|
-
}, U = (e,
|
|
331
|
-
const t = new Set(
|
|
334
|
+
}, U = (e, i) => {
|
|
335
|
+
const t = new Set(i), r = Object.keys(y).filter((s) => !t.has(s)).flatMap((s) => y[s]);
|
|
332
336
|
return le(e, r);
|
|
333
|
-
}, ge = (e,
|
|
334
|
-
if (!
|
|
337
|
+
}, ge = (e, i, t) => {
|
|
338
|
+
if (!i) {
|
|
335
339
|
const a = {
|
|
336
340
|
...e.regions
|
|
337
341
|
};
|
|
338
|
-
for (const
|
|
339
|
-
const g = a[
|
|
340
|
-
a[
|
|
342
|
+
for (const d of H) {
|
|
343
|
+
const g = a[d], u = g.widgets.filter((b) => b.role !== "content");
|
|
344
|
+
a[d] = {
|
|
341
345
|
...g,
|
|
342
346
|
widgets: u,
|
|
343
347
|
activeWidgetId: u.some((b) => b.widgetId === g.activeWidgetId) ? g.activeWidgetId : void 0
|
|
@@ -355,36 +359,36 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
355
359
|
const r = {
|
|
356
360
|
...e.regions
|
|
357
361
|
};
|
|
358
|
-
for (const a of H) r[a] =
|
|
362
|
+
for (const a of H) r[a] = i.regions[a];
|
|
359
363
|
const s = U({
|
|
360
364
|
...e,
|
|
361
365
|
regions: r
|
|
362
|
-
}, t),
|
|
366
|
+
}, t), n = I(s, i.activeWidgetId), o = I(s, e.activeWidgetId);
|
|
363
367
|
return {
|
|
364
|
-
...A(s, [
|
|
365
|
-
activeLocationWidgetId: I(s,
|
|
366
|
-
locationSubPanelSelections:
|
|
368
|
+
...A(s, [n, o]),
|
|
369
|
+
activeLocationWidgetId: I(s, i.activeLocationWidgetId)?.widgetId ?? I(s, e.activeLocationWidgetId)?.widgetId,
|
|
370
|
+
locationSubPanelSelections: i.locationSubPanelSelections
|
|
367
371
|
};
|
|
368
372
|
}, C = (e) => {
|
|
369
|
-
for (let
|
|
370
|
-
e[
|
|
371
|
-
}, B = (e,
|
|
372
|
-
|
|
373
|
-
for (const t of p) e.panels.setOpen(t,
|
|
373
|
+
for (let i = e.length - 1; i >= 0; i -= 1)
|
|
374
|
+
e[i]?.dispose();
|
|
375
|
+
}, B = (e, i) => {
|
|
376
|
+
i !== e.layout.getLayout() && e.layout.restoreLayout(i);
|
|
377
|
+
for (const t of p) e.panels.setOpen(t, i.regions[t].visible);
|
|
374
378
|
}, et = (e) => {
|
|
375
|
-
const
|
|
379
|
+
const i = W({
|
|
376
380
|
name: "workbench.modes",
|
|
377
381
|
initialState: {
|
|
378
382
|
modes: {},
|
|
379
383
|
activeModeId: void 0
|
|
380
384
|
}
|
|
381
385
|
}), t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Map();
|
|
382
|
-
let
|
|
383
|
-
const
|
|
384
|
-
if (t.has(
|
|
385
|
-
const f = D(
|
|
386
|
-
t.set(
|
|
387
|
-
}, g = (
|
|
386
|
+
let n = [], o, a, c = !1;
|
|
387
|
+
const d = (l) => {
|
|
388
|
+
if (t.has(l.id)) return;
|
|
389
|
+
const f = D(l.activate(e.resolveContext()));
|
|
390
|
+
t.set(l.id, f);
|
|
391
|
+
}, g = (l, f) => {
|
|
388
392
|
let v = !1, h = () => {
|
|
389
393
|
};
|
|
390
394
|
const S = () => {
|
|
@@ -396,101 +400,101 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
396
400
|
};
|
|
397
401
|
h = f.layout.store.subscribeSelector((w) => w.layout.regions.main, S);
|
|
398
402
|
try {
|
|
399
|
-
|
|
403
|
+
l.seed?.(f), S();
|
|
400
404
|
} finally {
|
|
401
405
|
h();
|
|
402
406
|
}
|
|
403
|
-
}, u = (
|
|
404
|
-
const f = e.resolveContext(), v = `${
|
|
405
|
-
B(f, h), f.layout.reconcilePanelMenus(), !r.has(v) && !f.layout.enteredWithPersistedLayout() && g(
|
|
406
|
-
}, b = (
|
|
407
|
-
u(
|
|
408
|
-
}, Q = (
|
|
409
|
-
const f = e.resolveContext(), v =
|
|
410
|
-
if (v && h && s.set(v, f.layout.getLayout()), R(),
|
|
411
|
-
|
|
412
|
-
...
|
|
407
|
+
}, u = (l) => {
|
|
408
|
+
const f = e.resolveContext(), v = `${l.id}\0${f.layout.getPersistenceScope() ?? "unscoped"}`, h = U(f.layout.getLayout(), x(l));
|
|
409
|
+
B(f, h), f.layout.reconcilePanelMenus(), !r.has(v) && !f.layout.enteredWithPersistedLayout() && g(l, f), r.add(v);
|
|
410
|
+
}, b = (l) => {
|
|
411
|
+
u(l), l.reconcile?.(e.resolveContext());
|
|
412
|
+
}, Q = (l) => {
|
|
413
|
+
const f = e.resolveContext(), v = i.getState().activeModeId, h = f.layout.getPersistenceScope() === void 0;
|
|
414
|
+
if (v && h && s.set(v, f.layout.getLayout()), R(), l === void 0) {
|
|
415
|
+
i.setState({
|
|
416
|
+
...i.getState(),
|
|
413
417
|
activeModeId: void 0
|
|
414
418
|
}, !1, "deactivateMode");
|
|
415
419
|
return;
|
|
416
420
|
}
|
|
417
|
-
const S =
|
|
418
|
-
if (!S) throw new Error(`Workbench mode not registered: ${
|
|
419
|
-
h && B(f, ge(f.layout.getLayout(), s.get(
|
|
420
|
-
seed: a !==
|
|
421
|
+
const S = i.getState().modes[l];
|
|
422
|
+
if (!S) throw new Error(`Workbench mode not registered: ${l}`);
|
|
423
|
+
h && B(f, ge(f.layout.getLayout(), s.get(l), x(S))), G(l, {
|
|
424
|
+
seed: a !== l
|
|
421
425
|
});
|
|
422
426
|
}, R = () => {
|
|
423
|
-
C(
|
|
424
|
-
}, G = (
|
|
425
|
-
const v = e.resolveContext(), h =
|
|
426
|
-
if (!h) throw new Error(`Workbench mode not registered: ${
|
|
427
|
+
C(n), n = [], o?.dispose(), o = void 0;
|
|
428
|
+
}, G = (l, f) => {
|
|
429
|
+
const v = e.resolveContext(), h = i.getState().modes[l];
|
|
430
|
+
if (!h) throw new Error(`Workbench mode not registered: ${l}`);
|
|
427
431
|
const S = v.context.createScope("workbench.mode");
|
|
428
|
-
S.set("activeWorkbenchMode",
|
|
432
|
+
S.set("activeWorkbenchMode", l), S.set(`workbenchMode.${l}`, !0), o = S;
|
|
429
433
|
try {
|
|
430
|
-
|
|
431
|
-
...
|
|
432
|
-
activeModeId:
|
|
433
|
-
}, !1, "activateMode"), f.seed && u(h),
|
|
434
|
+
d(h), i.setState({
|
|
435
|
+
...i.getState(),
|
|
436
|
+
activeModeId: l
|
|
437
|
+
}, !1, "activateMode"), f.seed && u(h), n = D(h.enter?.(v)), f.seed && h.reconcile?.(e.resolveContext());
|
|
434
438
|
} catch (w) {
|
|
435
|
-
throw R(),
|
|
436
|
-
...
|
|
439
|
+
throw R(), i.setState({
|
|
440
|
+
...i.getState(),
|
|
437
441
|
activeModeId: void 0
|
|
438
442
|
}, !1, "deactivateMode"), w;
|
|
439
443
|
}
|
|
440
444
|
}, J = e.resolveContext().layout.onDidChangePersistenceScope(() => {
|
|
441
|
-
const
|
|
442
|
-
if (
|
|
443
|
-
const f =
|
|
445
|
+
const l = i.getState().activeModeId;
|
|
446
|
+
if (l === a) return;
|
|
447
|
+
const f = l ? i.getState().modes[l] : void 0;
|
|
444
448
|
f && b(f);
|
|
445
449
|
}), X = m(() => {
|
|
446
450
|
J.dispose(), R();
|
|
447
|
-
for (const
|
|
448
|
-
t.clear(), r.clear(), s.clear(),
|
|
451
|
+
for (const l of t.values()) C(l);
|
|
452
|
+
t.clear(), r.clear(), s.clear(), i.setState({
|
|
449
453
|
modes: {},
|
|
450
454
|
activeModeId: void 0
|
|
451
455
|
}, !1, "disposeModes");
|
|
452
456
|
});
|
|
453
457
|
return {
|
|
454
|
-
store:
|
|
458
|
+
store: i,
|
|
455
459
|
dispose() {
|
|
456
460
|
X.dispose();
|
|
457
461
|
},
|
|
458
|
-
registerMode(
|
|
459
|
-
const f =
|
|
460
|
-
if (f.modes[
|
|
461
|
-
return
|
|
462
|
+
registerMode(l) {
|
|
463
|
+
const f = i.getState();
|
|
464
|
+
if (f.modes[l.id]) throw new Error(`Workbench mode already registered: ${l.id}`);
|
|
465
|
+
return i.setState({
|
|
462
466
|
...f,
|
|
463
467
|
modes: {
|
|
464
468
|
...f.modes,
|
|
465
|
-
[
|
|
469
|
+
[l.id]: l
|
|
466
470
|
}
|
|
467
471
|
}, !1, "registerMode"), m(() => {
|
|
468
|
-
const v =
|
|
469
|
-
if (v.modes[
|
|
470
|
-
v.activeModeId ===
|
|
471
|
-
...
|
|
472
|
+
const v = i.getState();
|
|
473
|
+
if (v.modes[l.id] !== l) return;
|
|
474
|
+
v.activeModeId === l.id && (R(), i.setState({
|
|
475
|
+
...i.getState(),
|
|
472
476
|
activeModeId: void 0
|
|
473
|
-
}, !1, "deactivateMode")), C(t.get(
|
|
477
|
+
}, !1, "deactivateMode")), C(t.get(l.id) ?? []), t.delete(l.id), s.delete(l.id);
|
|
474
478
|
for (const w of r)
|
|
475
|
-
w.startsWith(`${
|
|
479
|
+
w.startsWith(`${l.id}\0`) && r.delete(w);
|
|
476
480
|
const {
|
|
477
|
-
[
|
|
481
|
+
[l.id]: h,
|
|
478
482
|
...S
|
|
479
483
|
} = v.modes;
|
|
480
|
-
|
|
481
|
-
...
|
|
484
|
+
i.setState({
|
|
485
|
+
...i.getState(),
|
|
482
486
|
modes: S
|
|
483
487
|
}, !1, "unregisterMode");
|
|
484
488
|
});
|
|
485
489
|
},
|
|
486
|
-
getMode(
|
|
487
|
-
return
|
|
490
|
+
getMode(l) {
|
|
491
|
+
return i.getState().modes[l];
|
|
488
492
|
},
|
|
489
493
|
listModes() {
|
|
490
|
-
return Object.values(
|
|
494
|
+
return Object.values(i.getState().modes);
|
|
491
495
|
},
|
|
492
496
|
getActiveModeId() {
|
|
493
|
-
return
|
|
497
|
+
return i.getState().activeModeId;
|
|
494
498
|
},
|
|
495
499
|
// A deferred seed is the second half of one transition: the caller rotates the
|
|
496
500
|
// layout persistence scope between the two halves. Observers must not treat the
|
|
@@ -498,21 +502,21 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
498
502
|
isTransitioning() {
|
|
499
503
|
return c || a !== void 0;
|
|
500
504
|
},
|
|
501
|
-
setActiveMode(
|
|
502
|
-
if (
|
|
503
|
-
const v =
|
|
504
|
-
v &&
|
|
505
|
+
setActiveMode(l, f = {}) {
|
|
506
|
+
if (l === i.getState().activeModeId) {
|
|
507
|
+
const v = l ? i.getState().modes[l] : void 0;
|
|
508
|
+
v && l !== a && b(v);
|
|
505
509
|
return;
|
|
506
510
|
}
|
|
507
|
-
c = !0, a = f.deferSeed ?
|
|
511
|
+
c = !0, a = f.deferSeed ? l : void 0;
|
|
508
512
|
try {
|
|
509
|
-
Q(
|
|
513
|
+
Q(l);
|
|
510
514
|
} finally {
|
|
511
515
|
c = !1;
|
|
512
516
|
}
|
|
513
517
|
},
|
|
514
518
|
seedActiveMode() {
|
|
515
|
-
const
|
|
519
|
+
const l = i.getState().activeModeId, f = l ? i.getState().modes[l] : void 0;
|
|
516
520
|
c = !0;
|
|
517
521
|
try {
|
|
518
522
|
f && b(f);
|
|
@@ -520,56 +524,56 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
520
524
|
a = void 0, c = !1;
|
|
521
525
|
}
|
|
522
526
|
},
|
|
523
|
-
onDidChangeActive(
|
|
524
|
-
const f =
|
|
527
|
+
onDidChangeActive(l) {
|
|
528
|
+
const f = i.subscribeSelector((v) => v.activeModeId, () => l());
|
|
525
529
|
return m(f);
|
|
526
530
|
}
|
|
527
531
|
};
|
|
528
532
|
}, ue = (e) => Array.isArray(e) ? e : e.trim().split(/\s+/).filter(Boolean), fe = (e) => {
|
|
529
|
-
const
|
|
530
|
-
return
|
|
533
|
+
const i = ue(e);
|
|
534
|
+
return i.length === 1 ? i[0] ?? "" : i;
|
|
531
535
|
}, tt = (e) => {
|
|
532
|
-
const
|
|
536
|
+
const i = W({
|
|
533
537
|
name: "workbench.keybindings",
|
|
534
538
|
initialState: {
|
|
535
539
|
keybindings: []
|
|
536
540
|
}
|
|
537
541
|
});
|
|
538
542
|
return {
|
|
539
|
-
store:
|
|
543
|
+
store: i,
|
|
540
544
|
registerKeybinding(t, r) {
|
|
541
545
|
if (!e.commands.getCommand(t.commandId)) throw new Error(`Keybinding command not registered: ${t.commandId}`);
|
|
542
546
|
const s = {
|
|
543
547
|
...N(r),
|
|
544
548
|
...t,
|
|
545
549
|
keybinding: fe(t.keybinding)
|
|
546
|
-
},
|
|
547
|
-
return
|
|
548
|
-
keybindings: [...
|
|
550
|
+
}, n = i.getState();
|
|
551
|
+
return i.setState({
|
|
552
|
+
keybindings: [...n.keybindings, s]
|
|
549
553
|
}, !1, "registerKeybinding"), m(() => {
|
|
550
|
-
const o =
|
|
551
|
-
a.length !== o.keybindings.length &&
|
|
554
|
+
const o = i.getState(), a = o.keybindings.filter((c) => c !== s);
|
|
555
|
+
a.length !== o.keybindings.length && i.setState({
|
|
552
556
|
keybindings: a
|
|
553
557
|
}, !1, "unregisterKeybinding");
|
|
554
558
|
});
|
|
555
559
|
},
|
|
556
560
|
listKeybindings() {
|
|
557
|
-
return [...
|
|
561
|
+
return [...i.getState().keybindings].sort(O);
|
|
558
562
|
},
|
|
559
563
|
listActiveKeybindings() {
|
|
560
|
-
return
|
|
564
|
+
return i.getState().keybindings.filter((t) => e.context.matches(t.when)).sort(O);
|
|
561
565
|
}
|
|
562
566
|
};
|
|
563
|
-
},
|
|
567
|
+
}, it = (e, i) => K(e.regions[ee(i)])?.resource, nt = ({
|
|
564
568
|
layout: e,
|
|
565
|
-
primary:
|
|
569
|
+
primary: i,
|
|
566
570
|
isInScope: t
|
|
567
571
|
}) => {
|
|
568
572
|
const r = [];
|
|
569
573
|
for (const s of te()) {
|
|
570
|
-
const
|
|
571
|
-
if (
|
|
572
|
-
const o =
|
|
574
|
+
const n = ie(s);
|
|
575
|
+
if (n.role !== "anchor" || n.persistence === "primary") continue;
|
|
576
|
+
const o = K(e.regions[s]);
|
|
573
577
|
if (o?.resource) {
|
|
574
578
|
if (o.role === "sub-panel" && o.ownerResourceUri) {
|
|
575
579
|
r.push({
|
|
@@ -578,7 +582,7 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
578
582
|
});
|
|
579
583
|
continue;
|
|
580
584
|
}
|
|
581
|
-
if (
|
|
585
|
+
if (n.persistence === "derived") {
|
|
582
586
|
r.push({
|
|
583
587
|
region: s,
|
|
584
588
|
action: "clear"
|
|
@@ -587,14 +591,14 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
587
591
|
}
|
|
588
592
|
r.push({
|
|
589
593
|
region: s,
|
|
590
|
-
action: t(o.resource,
|
|
594
|
+
action: t(o.resource, i) ? "keep" : "clear"
|
|
591
595
|
});
|
|
592
596
|
}
|
|
593
597
|
}
|
|
594
598
|
return r;
|
|
595
|
-
}, M = (e,
|
|
599
|
+
}, M = (e, i) => {
|
|
596
600
|
const {
|
|
597
|
-
[
|
|
601
|
+
[i]: t,
|
|
598
602
|
...r
|
|
599
603
|
} = e;
|
|
600
604
|
return r;
|
|
@@ -604,35 +608,35 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
604
608
|
const e = document.createElement("div");
|
|
605
609
|
return e.style.display = "contents", e.dataset.workbenchKeepAliveHost = "", e;
|
|
606
610
|
}, ot = (e = {}) => {
|
|
607
|
-
const
|
|
611
|
+
const i = e.createHost ?? ve, t = W({
|
|
608
612
|
name: "workbench.renderers",
|
|
609
613
|
initialState: {
|
|
610
614
|
renderers: {},
|
|
611
615
|
hosts: {},
|
|
612
616
|
claims: {}
|
|
613
617
|
}
|
|
614
|
-
}), r = (
|
|
615
|
-
const o = t.getState(), a = o.hosts[
|
|
618
|
+
}), r = (n) => {
|
|
619
|
+
const o = t.getState(), a = o.hosts[n], c = a?.attachedTo;
|
|
616
620
|
!a || !c || (c.contains(a.host) && c.removeChild(a.host), t.setState({
|
|
617
621
|
...o,
|
|
618
622
|
hosts: {
|
|
619
623
|
...o.hosts,
|
|
620
|
-
[
|
|
624
|
+
[n]: {
|
|
621
625
|
...a,
|
|
622
626
|
attachedTo: void 0
|
|
623
627
|
}
|
|
624
628
|
},
|
|
625
|
-
claims: M(o.claims,
|
|
629
|
+
claims: M(o.claims, n)
|
|
626
630
|
}, !1, "renderers.detach"));
|
|
627
631
|
}, s = {
|
|
628
632
|
store: t,
|
|
629
|
-
registerRenderer(
|
|
633
|
+
registerRenderer(n) {
|
|
630
634
|
const o = t.getState();
|
|
631
|
-
if (o.renderers[
|
|
632
|
-
const a =
|
|
635
|
+
if (o.renderers[n.id]) throw new Error(`Renderer already registered: ${n.id}`);
|
|
636
|
+
const a = n.keepAlive ? i() : void 0, c = a ? {
|
|
633
637
|
...o.hosts,
|
|
634
|
-
[
|
|
635
|
-
rendererId:
|
|
638
|
+
[n.id]: {
|
|
639
|
+
rendererId: n.id,
|
|
636
640
|
host: a
|
|
637
641
|
}
|
|
638
642
|
} : o.hosts;
|
|
@@ -640,76 +644,76 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
640
644
|
...o,
|
|
641
645
|
renderers: {
|
|
642
646
|
...o.renderers,
|
|
643
|
-
[
|
|
647
|
+
[n.id]: n
|
|
644
648
|
},
|
|
645
649
|
hosts: c
|
|
646
650
|
}, !1, "registerRenderer"), m(() => {
|
|
647
|
-
if (t.getState().renderers[
|
|
648
|
-
|
|
651
|
+
if (t.getState().renderers[n.id] !== n) return;
|
|
652
|
+
n.keepAlive && r(n.id);
|
|
649
653
|
const g = t.getState();
|
|
650
654
|
t.setState({
|
|
651
655
|
...g,
|
|
652
|
-
renderers: M(g.renderers,
|
|
653
|
-
hosts: M(g.hosts,
|
|
654
|
-
claims: M(g.claims,
|
|
656
|
+
renderers: M(g.renderers, n.id),
|
|
657
|
+
hosts: M(g.hosts, n.id),
|
|
658
|
+
claims: M(g.claims, n.id)
|
|
655
659
|
}, !1, "unregisterRenderer");
|
|
656
660
|
});
|
|
657
661
|
},
|
|
658
|
-
getRenderer(
|
|
659
|
-
return t.getState().renderers[
|
|
662
|
+
getRenderer(n) {
|
|
663
|
+
return t.getState().renderers[n];
|
|
660
664
|
},
|
|
661
665
|
listRenderers() {
|
|
662
666
|
return Object.values(t.getState().renderers);
|
|
663
667
|
},
|
|
664
|
-
onDidChange(
|
|
665
|
-
const o = t.subscribeSelector((a) => a.renderers, () =>
|
|
668
|
+
onDidChange(n) {
|
|
669
|
+
const o = t.subscribeSelector((a) => a.renderers, () => n());
|
|
666
670
|
return m(o);
|
|
667
671
|
},
|
|
668
|
-
claim(
|
|
669
|
-
const c = t.getState(),
|
|
670
|
-
if (!
|
|
671
|
-
if (!
|
|
672
|
-
const g = c.hosts[
|
|
673
|
-
if (!g) throw new Error(`Renderer ${
|
|
672
|
+
claim(n, o, a) {
|
|
673
|
+
const c = t.getState(), d = c.renderers[n];
|
|
674
|
+
if (!d) throw new Error(`Renderer is not registered: ${n}`);
|
|
675
|
+
if (!d.keepAlive) throw new Error(`Renderer ${n} is not keep-alive; cannot claim`);
|
|
676
|
+
const g = c.hosts[n];
|
|
677
|
+
if (!g) throw new Error(`Renderer ${n} has no host`);
|
|
674
678
|
if (g.attachedTo === o)
|
|
675
679
|
t.setState({
|
|
676
680
|
...c,
|
|
677
681
|
claims: {
|
|
678
682
|
...c.claims,
|
|
679
|
-
[
|
|
683
|
+
[n]: a
|
|
680
684
|
}
|
|
681
685
|
}, !1, "renderers.updateClaim");
|
|
682
686
|
else {
|
|
683
|
-
r(
|
|
684
|
-
const u = t.getState(), b = u.hosts[
|
|
687
|
+
r(n);
|
|
688
|
+
const u = t.getState(), b = u.hosts[n];
|
|
685
689
|
o.appendChild(b.host), t.setState({
|
|
686
690
|
...u,
|
|
687
691
|
hosts: {
|
|
688
692
|
...u.hosts,
|
|
689
|
-
[
|
|
693
|
+
[n]: {
|
|
690
694
|
...b,
|
|
691
695
|
attachedTo: o
|
|
692
696
|
}
|
|
693
697
|
},
|
|
694
698
|
claims: {
|
|
695
699
|
...u.claims,
|
|
696
|
-
[
|
|
700
|
+
[n]: a
|
|
697
701
|
}
|
|
698
702
|
}, !1, "renderers.attach");
|
|
699
703
|
}
|
|
700
704
|
return m(() => {
|
|
701
|
-
const b = t.getState().hosts[
|
|
702
|
-
!b || b.attachedTo !== o || r(
|
|
705
|
+
const b = t.getState().hosts[n];
|
|
706
|
+
!b || b.attachedTo !== o || r(n);
|
|
703
707
|
});
|
|
704
708
|
},
|
|
705
|
-
getHost(
|
|
706
|
-
return t.getState().hosts[
|
|
709
|
+
getHost(n) {
|
|
710
|
+
return t.getState().hosts[n]?.host;
|
|
707
711
|
},
|
|
708
|
-
getClaim(
|
|
709
|
-
return t.getState().claims[
|
|
712
|
+
getClaim(n) {
|
|
713
|
+
return t.getState().claims[n];
|
|
710
714
|
}
|
|
711
715
|
};
|
|
712
|
-
for (const
|
|
716
|
+
for (const n of e.initialRenderers ?? []) s.registerRenderer(n);
|
|
713
717
|
return s;
|
|
714
718
|
}, rt = {
|
|
715
719
|
project: "folder-root",
|
|
@@ -717,13 +721,13 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
717
721
|
worktree: "git-pull-request-draft",
|
|
718
722
|
settings: "settings",
|
|
719
723
|
kanbanRenderer: "table-properties"
|
|
720
|
-
}, be = "resource_hierarchy_cycle", q = (e) => [...e].sort((
|
|
721
|
-
const r = q(e), s = [
|
|
722
|
-
let o =
|
|
724
|
+
}, be = "resource_hierarchy_cycle", q = (e) => [...e].sort((i, t) => t.priority - i.priority || i.id.localeCompare(t.id)), he = (e, i, t) => {
|
|
725
|
+
const r = q(e), s = [i], n = /* @__PURE__ */ new Set([i.uri]);
|
|
726
|
+
let o = i;
|
|
723
727
|
for (; ; ) {
|
|
724
|
-
const c = r.find((
|
|
728
|
+
const c = r.find((d) => d.canResolve(o))?.getParent(o);
|
|
725
729
|
if (!c) break;
|
|
726
|
-
if (
|
|
730
|
+
if (n.has(c.uri)) {
|
|
727
731
|
t({
|
|
728
732
|
code: be,
|
|
729
733
|
path: [...s],
|
|
@@ -731,28 +735,28 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
731
735
|
});
|
|
732
736
|
break;
|
|
733
737
|
}
|
|
734
|
-
s.unshift(c),
|
|
738
|
+
s.unshift(c), n.add(c.uri), o = c;
|
|
735
739
|
}
|
|
736
740
|
return s;
|
|
737
741
|
}, me = "workbench.resource.kind", Se = "workbench.resource.id", we = (e) => `workbench.resource.metadata.${e}`, z = "workbench.selectionResourceUri", Ie = (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean", st = (e) => {
|
|
738
742
|
if (!e) return {};
|
|
739
|
-
const
|
|
743
|
+
const i = {
|
|
740
744
|
[me]: e.kind,
|
|
741
745
|
[Se]: e.id ?? e.uri
|
|
742
746
|
};
|
|
743
747
|
for (const [t, r] of Object.entries(e.metadata ?? {}))
|
|
744
|
-
Ie(r) && (
|
|
745
|
-
return
|
|
748
|
+
Ie(r) && (i[we(t)] = r);
|
|
749
|
+
return i;
|
|
746
750
|
}, ct = (e) => ({
|
|
747
751
|
[z]: e.uri
|
|
748
752
|
}), at = (e) => {
|
|
749
753
|
if (!e) return [];
|
|
750
|
-
const
|
|
751
|
-
return typeof
|
|
752
|
-
}, T = (e) => [...e].sort((
|
|
753
|
-
const
|
|
754
|
+
const i = e.metadata?.[z];
|
|
755
|
+
return typeof i != "string" || i === e.uri ? [e.uri] : [e.uri, i];
|
|
756
|
+
}, T = (e) => [...e].sort((i, t) => t.priority - i.priority || i.id.localeCompare(t.id)), ye = (e) => (typeof e == "object" || typeof e == "function") && e !== null && "then" in e && typeof e.then == "function", dt = (e = {}) => {
|
|
757
|
+
const i = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set(), r = e.establishLocation;
|
|
754
758
|
let s = 0;
|
|
755
|
-
const
|
|
759
|
+
const n = W({
|
|
756
760
|
name: "workbench.resources",
|
|
757
761
|
initialState: {
|
|
758
762
|
kinds: {},
|
|
@@ -762,136 +766,136 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
762
766
|
}
|
|
763
767
|
});
|
|
764
768
|
return {
|
|
765
|
-
store:
|
|
769
|
+
store: n,
|
|
766
770
|
registerKind(o, a) {
|
|
767
|
-
const c =
|
|
771
|
+
const c = n.getState();
|
|
768
772
|
if (c.kinds[o.kind]) throw new Error(`Resource kind already registered: ${o.kind}`);
|
|
769
|
-
const
|
|
773
|
+
const d = {
|
|
770
774
|
...N(a),
|
|
771
775
|
...o
|
|
772
776
|
};
|
|
773
|
-
return
|
|
777
|
+
return n.setState({
|
|
774
778
|
...c,
|
|
775
779
|
kinds: {
|
|
776
780
|
...c.kinds,
|
|
777
|
-
[o.kind]:
|
|
781
|
+
[o.kind]: d
|
|
778
782
|
}
|
|
779
783
|
}, !1, "registerKind"), m(() => {
|
|
780
|
-
const g =
|
|
781
|
-
if (g.kinds[o.kind] !==
|
|
784
|
+
const g = n.getState();
|
|
785
|
+
if (g.kinds[o.kind] !== d) return;
|
|
782
786
|
const {
|
|
783
787
|
[o.kind]: u,
|
|
784
788
|
...b
|
|
785
789
|
} = g.kinds;
|
|
786
|
-
|
|
790
|
+
n.setState({
|
|
787
791
|
...g,
|
|
788
792
|
kinds: b
|
|
789
793
|
}, !1, "unregisterKind");
|
|
790
794
|
});
|
|
791
795
|
},
|
|
792
796
|
getKind(o) {
|
|
793
|
-
return
|
|
797
|
+
return n.getState().kinds[o];
|
|
794
798
|
},
|
|
795
799
|
getSurface(o) {
|
|
796
|
-
return
|
|
800
|
+
return n.getState().kinds[o.kind]?.surface;
|
|
797
801
|
},
|
|
798
802
|
listKinds() {
|
|
799
|
-
return Object.values(
|
|
803
|
+
return Object.values(n.getState().kinds).sort(O);
|
|
800
804
|
},
|
|
801
805
|
registerPresenter(o) {
|
|
802
|
-
const a =
|
|
806
|
+
const a = n.getState();
|
|
803
807
|
if (a.presenters[o.id]) throw new Error(`Resource presenter already registered: ${o.id}`);
|
|
804
808
|
const c = {
|
|
805
809
|
...o,
|
|
806
810
|
priority: o.priority ?? 0
|
|
807
811
|
};
|
|
808
|
-
return
|
|
812
|
+
return n.setState({
|
|
809
813
|
...a,
|
|
810
814
|
presenters: {
|
|
811
815
|
...a.presenters,
|
|
812
816
|
[o.id]: c
|
|
813
817
|
}
|
|
814
818
|
}, !1, "registerPresenter"), m(() => {
|
|
815
|
-
const
|
|
816
|
-
if (
|
|
819
|
+
const d = n.getState();
|
|
820
|
+
if (d.presenters[o.id] !== c) return;
|
|
817
821
|
const {
|
|
818
822
|
[o.id]: g,
|
|
819
823
|
...u
|
|
820
|
-
} =
|
|
821
|
-
|
|
822
|
-
...
|
|
824
|
+
} = d.presenters;
|
|
825
|
+
n.setState({
|
|
826
|
+
...d,
|
|
823
827
|
presenters: u
|
|
824
828
|
}, !1, "unregisterPresenter");
|
|
825
829
|
});
|
|
826
830
|
},
|
|
827
831
|
listPresenters() {
|
|
828
|
-
return T(Object.values(
|
|
832
|
+
return T(Object.values(n.getState().presenters));
|
|
829
833
|
},
|
|
830
834
|
registerProvider(o) {
|
|
831
|
-
const a =
|
|
835
|
+
const a = n.getState();
|
|
832
836
|
if (a.providers[o.id]) throw new Error(`Resource provider already registered: ${o.id}`);
|
|
833
|
-
return
|
|
837
|
+
return n.setState({
|
|
834
838
|
...a,
|
|
835
839
|
providers: {
|
|
836
840
|
...a.providers,
|
|
837
841
|
[o.id]: o
|
|
838
842
|
}
|
|
839
843
|
}, !1, "registerProvider"), m(() => {
|
|
840
|
-
const c =
|
|
844
|
+
const c = n.getState();
|
|
841
845
|
if (c.providers[o.id] !== o) return;
|
|
842
846
|
const {
|
|
843
|
-
[o.id]:
|
|
847
|
+
[o.id]: d,
|
|
844
848
|
...g
|
|
845
849
|
} = c.providers;
|
|
846
|
-
|
|
850
|
+
n.setState({
|
|
847
851
|
...c,
|
|
848
852
|
providers: g
|
|
849
853
|
}, !1, "unregisterProvider");
|
|
850
854
|
});
|
|
851
855
|
},
|
|
852
856
|
listProviders() {
|
|
853
|
-
return Object.values(
|
|
857
|
+
return Object.values(n.getState().providers);
|
|
854
858
|
},
|
|
855
859
|
listResources(o) {
|
|
856
860
|
const a = {
|
|
857
861
|
primary: e.getPrimary?.()
|
|
858
862
|
}, c = [];
|
|
859
|
-
for (const
|
|
860
|
-
c.push(...
|
|
863
|
+
for (const d of Object.values(n.getState().providers))
|
|
864
|
+
c.push(...d.list(o, a));
|
|
861
865
|
return c;
|
|
862
866
|
},
|
|
863
867
|
registerHierarchyProvider(o) {
|
|
864
|
-
const a =
|
|
868
|
+
const a = n.getState();
|
|
865
869
|
if (a.hierarchyProviders[o.id])
|
|
866
870
|
throw new Error(`Resource hierarchy provider already registered: ${o.id}`);
|
|
867
871
|
const c = {
|
|
868
872
|
...o,
|
|
869
873
|
priority: o.priority ?? 0
|
|
870
874
|
};
|
|
871
|
-
return
|
|
875
|
+
return n.setState({
|
|
872
876
|
...a,
|
|
873
877
|
hierarchyProviders: {
|
|
874
878
|
...a.hierarchyProviders,
|
|
875
879
|
[o.id]: c
|
|
876
880
|
}
|
|
877
881
|
}, !1, "registerHierarchyProvider"), m(() => {
|
|
878
|
-
const
|
|
879
|
-
if (
|
|
882
|
+
const d = n.getState();
|
|
883
|
+
if (d.hierarchyProviders[o.id] !== c) return;
|
|
880
884
|
const {
|
|
881
885
|
[o.id]: g,
|
|
882
886
|
...u
|
|
883
|
-
} =
|
|
884
|
-
|
|
885
|
-
...
|
|
887
|
+
} = d.hierarchyProviders;
|
|
888
|
+
n.setState({
|
|
889
|
+
...d,
|
|
886
890
|
hierarchyProviders: u
|
|
887
891
|
}, !1, "unregisterHierarchyProvider");
|
|
888
892
|
});
|
|
889
893
|
},
|
|
890
894
|
listHierarchyProviders() {
|
|
891
|
-
return q(Object.values(
|
|
895
|
+
return q(Object.values(n.getState().hierarchyProviders));
|
|
892
896
|
},
|
|
893
897
|
walkHierarchy(o) {
|
|
894
|
-
return o ? he(Object.values(
|
|
898
|
+
return o ? he(Object.values(n.getState().hierarchyProviders), o, (a) => {
|
|
895
899
|
for (const c of t) c(a);
|
|
896
900
|
}) : [];
|
|
897
901
|
},
|
|
@@ -904,124 +908,124 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
904
908
|
return s > 0;
|
|
905
909
|
},
|
|
906
910
|
async openResource(o, a = {}) {
|
|
907
|
-
const c =
|
|
911
|
+
const c = n.getState();
|
|
908
912
|
if (!c.kinds[o.kind]) throw new Error(`Unknown resource kind: ${o.kind}`);
|
|
909
|
-
const
|
|
910
|
-
if (!
|
|
913
|
+
const d = T(Object.values(c.presenters)).find((u) => u.canOpen(o));
|
|
914
|
+
if (!d) throw new Error(`No presenter registered for resource kind: ${o.kind}`);
|
|
911
915
|
s += 1;
|
|
912
916
|
let g;
|
|
913
917
|
try {
|
|
914
|
-
const u =
|
|
915
|
-
g = ye(u) ? await u : u, g = r?.(g) ?? g;
|
|
918
|
+
const u = d.open(o, a);
|
|
919
|
+
g = ye(u) ? await u : u, g = r?.(g) ?? g, d.afterOpen?.(o, g, a);
|
|
916
920
|
} finally {
|
|
917
921
|
s -= 1;
|
|
918
922
|
}
|
|
919
|
-
for (const u of
|
|
923
|
+
for (const u of i) u(o);
|
|
920
924
|
return g;
|
|
921
925
|
},
|
|
922
926
|
onDidOpenResource(o) {
|
|
923
|
-
return
|
|
924
|
-
|
|
927
|
+
return i.add(o), m(() => {
|
|
928
|
+
i.delete(o);
|
|
925
929
|
});
|
|
926
930
|
}
|
|
927
931
|
};
|
|
928
|
-
}, pe = (e) => e.replace(/^['"]|['"]$/g, ""), ke = (e,
|
|
929
|
-
const t =
|
|
932
|
+
}, pe = (e) => e.replace(/^['"]|['"]$/g, ""), ke = (e, i) => {
|
|
933
|
+
const t = i.trim();
|
|
930
934
|
if (t.length === 0) return !0;
|
|
931
935
|
const r = t.match(/^([A-Za-z0-9_.-]+)\s*(==|!=)\s*(.+)$/);
|
|
932
936
|
if (r) {
|
|
933
|
-
const [, s,
|
|
934
|
-
return
|
|
937
|
+
const [, s, n, o] = r, a = e[s ?? ""], c = pe(o ?? "");
|
|
938
|
+
return n === "==" ? String(a) === c : String(a) !== c;
|
|
935
939
|
}
|
|
936
940
|
return t.startsWith("!") ? !e[t.slice(1)] : !!e[t];
|
|
937
|
-
}, We = (e,
|
|
941
|
+
}, We = (e, i) => i ? i.split("||").some((t) => t.split("&&").every((r) => ke(e, r))) : !0, lt = () => {
|
|
938
942
|
const e = W({
|
|
939
943
|
name: "workbench.context",
|
|
940
944
|
initialState: {
|
|
941
945
|
values: {}
|
|
942
946
|
}
|
|
943
947
|
});
|
|
944
|
-
let
|
|
948
|
+
let i = {};
|
|
945
949
|
const t = /* @__PURE__ */ new Map(), r = () => {
|
|
946
|
-
const
|
|
947
|
-
...
|
|
950
|
+
const n = {
|
|
951
|
+
...i
|
|
948
952
|
};
|
|
949
|
-
for (const o of t.values()) Object.assign(
|
|
950
|
-
return
|
|
951
|
-
}, s = (
|
|
953
|
+
for (const o of t.values()) Object.assign(n, o);
|
|
954
|
+
return n;
|
|
955
|
+
}, s = (n) => {
|
|
952
956
|
e.setState({
|
|
953
957
|
values: r()
|
|
954
|
-
}, !1,
|
|
958
|
+
}, !1, n);
|
|
955
959
|
};
|
|
956
960
|
return {
|
|
957
961
|
store: e,
|
|
958
|
-
set(
|
|
959
|
-
n
|
|
960
|
-
...
|
|
961
|
-
[
|
|
962
|
+
set(n, o) {
|
|
963
|
+
i[n] !== o && (i = {
|
|
964
|
+
...i,
|
|
965
|
+
[n]: o
|
|
962
966
|
}, s("setContextKey"));
|
|
963
967
|
},
|
|
964
|
-
get(
|
|
965
|
-
return e.getState().values[
|
|
968
|
+
get(n) {
|
|
969
|
+
return e.getState().values[n];
|
|
966
970
|
},
|
|
967
|
-
delete(
|
|
968
|
-
if (!(
|
|
971
|
+
delete(n) {
|
|
972
|
+
if (!(n in i)) return;
|
|
969
973
|
const {
|
|
970
|
-
[
|
|
974
|
+
[n]: o,
|
|
971
975
|
...a
|
|
972
|
-
} =
|
|
973
|
-
|
|
976
|
+
} = i;
|
|
977
|
+
i = a, s("deleteContextKey");
|
|
974
978
|
},
|
|
975
|
-
createScope(
|
|
976
|
-
t.set(
|
|
979
|
+
createScope(n) {
|
|
980
|
+
t.set(n, t.get(n) ?? {});
|
|
977
981
|
let o = !1;
|
|
978
982
|
const a = () => {
|
|
979
|
-
if (o) throw new Error(`Context key scope disposed: ${
|
|
983
|
+
if (o) throw new Error(`Context key scope disposed: ${n}`);
|
|
980
984
|
};
|
|
981
985
|
return {
|
|
982
|
-
ownerId:
|
|
983
|
-
set(c,
|
|
986
|
+
ownerId: n,
|
|
987
|
+
set(c, d) {
|
|
984
988
|
a();
|
|
985
|
-
const g = t.get(
|
|
986
|
-
g[c] !==
|
|
989
|
+
const g = t.get(n) ?? {};
|
|
990
|
+
g[c] !== d && (t.set(n, {
|
|
987
991
|
...g,
|
|
988
|
-
[c]:
|
|
992
|
+
[c]: d
|
|
989
993
|
}), s("setScopedContextKey"));
|
|
990
994
|
},
|
|
991
995
|
get(c) {
|
|
992
|
-
return a(), t.get(
|
|
996
|
+
return a(), t.get(n)?.[c];
|
|
993
997
|
},
|
|
994
998
|
delete(c) {
|
|
995
999
|
a();
|
|
996
|
-
const
|
|
997
|
-
if (!
|
|
1000
|
+
const d = t.get(n);
|
|
1001
|
+
if (!d || !(c in d)) return;
|
|
998
1002
|
const {
|
|
999
1003
|
[c]: g,
|
|
1000
1004
|
...u
|
|
1001
|
-
} =
|
|
1002
|
-
t.set(
|
|
1005
|
+
} = d;
|
|
1006
|
+
t.set(n, u), s("deleteScopedContextKey");
|
|
1003
1007
|
},
|
|
1004
1008
|
dispose() {
|
|
1005
|
-
o || (o = !0, t.delete(
|
|
1009
|
+
o || (o = !0, t.delete(n) && s("disposeContextKeyScope"));
|
|
1006
1010
|
}
|
|
1007
1011
|
};
|
|
1008
1012
|
},
|
|
1009
|
-
deleteOwner(
|
|
1010
|
-
t.delete(
|
|
1013
|
+
deleteOwner(n) {
|
|
1014
|
+
t.delete(n) && s("deleteContextKeyOwner");
|
|
1011
1015
|
},
|
|
1012
1016
|
snapshot() {
|
|
1013
1017
|
return {
|
|
1014
1018
|
...e.getState().values
|
|
1015
1019
|
};
|
|
1016
1020
|
},
|
|
1017
|
-
matches(
|
|
1018
|
-
return We(e.getState().values,
|
|
1021
|
+
matches(n) {
|
|
1022
|
+
return We(e.getState().values, n);
|
|
1019
1023
|
}
|
|
1020
1024
|
};
|
|
1021
|
-
}, Pe = "sidenav", Re = (e,
|
|
1022
|
-
e.panels.setOpen(
|
|
1023
|
-
}, Me = (e,
|
|
1024
|
-
Re(e,
|
|
1025
|
+
}, Pe = "sidenav", Re = (e, i, t) => {
|
|
1026
|
+
e.panels.setOpen(i, t), e.layout.setRegionVisible(i, t);
|
|
1027
|
+
}, Me = (e, i) => {
|
|
1028
|
+
Re(e, i, !e.panels.isOpen(i));
|
|
1025
1029
|
}, Le = [{
|
|
1026
1030
|
id: "workbench.toggleCommandPalette",
|
|
1027
1031
|
label: "Toggle Command Palette",
|
|
@@ -1066,44 +1070,44 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
1066
1070
|
icon: "PanelLeft",
|
|
1067
1071
|
keybinding: "Mod+B",
|
|
1068
1072
|
execute: (e) => Me(e, Pe)
|
|
1069
|
-
}],
|
|
1070
|
-
if (e.kind !== "command" || e.commandId !==
|
|
1071
|
-
const
|
|
1072
|
-
return typeof
|
|
1073
|
+
}], j = "workbench.action.switchMode", gt = (e) => {
|
|
1074
|
+
if (e.kind !== "command" || e.commandId !== j || !e.args || typeof e.args != "object") return;
|
|
1075
|
+
const i = "modeId" in e.args ? e.args.modeId : void 0;
|
|
1076
|
+
return typeof i == "string" && i.trim().length > 0 ? i : void 0;
|
|
1073
1077
|
}, ut = (e) => {
|
|
1074
|
-
for (const
|
|
1078
|
+
for (const i of Le)
|
|
1075
1079
|
e.commands.registerCommand({
|
|
1076
|
-
id:
|
|
1077
|
-
label:
|
|
1080
|
+
id: i.id,
|
|
1081
|
+
label: i.label,
|
|
1078
1082
|
category: "Workbench",
|
|
1079
|
-
icon:
|
|
1083
|
+
icon: i.icon,
|
|
1080
1084
|
when: "!inputFocus"
|
|
1081
1085
|
}, {
|
|
1082
|
-
execute: () =>
|
|
1086
|
+
execute: () => i.execute(e)
|
|
1083
1087
|
}), e.keybindings.registerKeybinding({
|
|
1084
|
-
commandId:
|
|
1085
|
-
keybinding:
|
|
1088
|
+
commandId: i.id,
|
|
1089
|
+
keybinding: i.keybinding,
|
|
1086
1090
|
when: "!inputFocus"
|
|
1087
1091
|
}), e.layout.registerMenuItem($, {
|
|
1088
|
-
commandId:
|
|
1092
|
+
commandId: i.id,
|
|
1089
1093
|
group: "Workbench"
|
|
1090
1094
|
});
|
|
1091
1095
|
e.commands.registerCommand({
|
|
1092
|
-
id:
|
|
1096
|
+
id: j,
|
|
1093
1097
|
label: "Switch Mode",
|
|
1094
1098
|
category: "Workbench",
|
|
1095
1099
|
icon: "PanelTop",
|
|
1096
1100
|
when: "!inputFocus"
|
|
1097
1101
|
}, {
|
|
1098
|
-
execute: async (
|
|
1099
|
-
if (!
|
|
1102
|
+
execute: async (i) => {
|
|
1103
|
+
if (!i?.modeId) {
|
|
1100
1104
|
e.commandPalette.open({
|
|
1101
1105
|
view: "mode"
|
|
1102
1106
|
});
|
|
1103
1107
|
return;
|
|
1104
1108
|
}
|
|
1105
1109
|
const t = await e.navigator.open({
|
|
1106
|
-
modeId:
|
|
1110
|
+
modeId: i.modeId
|
|
1107
1111
|
});
|
|
1108
1112
|
!t.ok && t.code === "navigation_mode_missing" && e.notifications.show({
|
|
1109
1113
|
level: "error",
|
|
@@ -1112,7 +1116,7 @@ const re = (e, n) => Object.is(e, n), W = (e) => {
|
|
|
1112
1116
|
});
|
|
1113
1117
|
}
|
|
1114
1118
|
}), e.layout.registerMenuItem($, {
|
|
1115
|
-
commandId:
|
|
1119
|
+
commandId: j,
|
|
1116
1120
|
group: "Workbench"
|
|
1117
1121
|
});
|
|
1118
1122
|
};
|
|
@@ -1135,21 +1139,21 @@ export {
|
|
|
1135
1139
|
me as P,
|
|
1136
1140
|
we as Q,
|
|
1137
1141
|
z as R,
|
|
1138
|
-
|
|
1142
|
+
j as S,
|
|
1139
1143
|
Ve as T,
|
|
1140
1144
|
Ne as U,
|
|
1141
1145
|
V,
|
|
1142
1146
|
Qe as W,
|
|
1143
1147
|
ze as X,
|
|
1144
1148
|
He as a,
|
|
1145
|
-
|
|
1149
|
+
O as b,
|
|
1146
1150
|
W as c,
|
|
1147
1151
|
F as d,
|
|
1148
1152
|
$e as e,
|
|
1149
|
-
|
|
1150
|
-
|
|
1153
|
+
Ke as f,
|
|
1154
|
+
K as g,
|
|
1151
1155
|
k as h,
|
|
1152
|
-
|
|
1156
|
+
je as i,
|
|
1153
1157
|
Ee as j,
|
|
1154
1158
|
De as k,
|
|
1155
1159
|
se as l,
|
|
@@ -1164,8 +1168,8 @@ export {
|
|
|
1164
1168
|
_e as u,
|
|
1165
1169
|
Ye as v,
|
|
1166
1170
|
qe as w,
|
|
1167
|
-
|
|
1168
|
-
|
|
1171
|
+
it as x,
|
|
1172
|
+
nt as y,
|
|
1169
1173
|
lt as z
|
|
1170
1174
|
};
|
|
1171
|
-
//# sourceMappingURL=workbench-built-ins-
|
|
1175
|
+
//# sourceMappingURL=workbench-built-ins-BncLJfQA.js.map
|