@pstdio/workbench 0.3.0 → 0.5.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/{context-key-service-W4QEfVdN.js → context-key-service-B2K9LAec.js} +370 -367
- package/dist/context-key-service-B2K9LAec.js.map +1 -0
- package/dist/extensions.d.ts +30 -1
- package/dist/extensions.js +923 -837
- package/dist/extensions.js.map +1 -1
- package/dist/index.d.ts +29 -4
- package/dist/index.js +650 -590
- package/dist/index.js.map +1 -1
- package/dist/layout-types-DMoZz38-.js.map +1 -1
- package/dist/react.d.ts +26 -3
- package/dist/react.js +2592 -2605
- package/dist/react.js.map +1 -1
- package/dist/storage.d.ts +96 -2
- package/dist/storage.js +201 -120
- package/dist/storage.js.map +1 -1
- package/dist/testing.d.ts +15 -1
- package/package.json +3 -3
- package/dist/context-key-service-W4QEfVdN.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { c as L, a as
|
|
2
|
-
import { D as
|
|
3
|
-
import { w as
|
|
4
|
-
import { r as
|
|
5
|
-
import { w as
|
|
6
|
-
import { h as
|
|
7
|
-
const
|
|
1
|
+
import { c as L, a as I, g as B, m as we, f as $, b as O, n as D, d as _, r as he, e as A, h as Pe, i as j, j as ye, k as Z, l as Ie, o as Ce, p as Q, t as N, q as ee, s as te, u as re, v as We, w as ke, x as Le, y as Te, z as Ee, A as xe, B as Me, C as De } from "./context-key-service-B2K9LAec.js";
|
|
2
|
+
import { D as pr, E as Rr, F as wr, G as Pr, H as Ir, I as Cr, J as Wr, K as kr, L as Lr, M as Tr, N as Er, O as xr } from "./context-key-service-B2K9LAec.js";
|
|
3
|
+
import { w as F, m as be, c as Be, a as ne } from "./layout-types-DMoZz38-.js";
|
|
4
|
+
import { r as Oe } from "./surface-map-C1pOTUmF.js";
|
|
5
|
+
import { w as se } from "./workbench-menu-paths-B_QJzcNU.js";
|
|
6
|
+
import { h as Dr, a as Br, r as Or, b as Ar, c as $r, d as Fr, e as Nr } from "./workbench-menu-paths-B_QJzcNU.js";
|
|
7
|
+
const yr = (e, t) => {
|
|
8
8
|
const s = e.walkHierarchy(t);
|
|
9
9
|
return s.map((n, i) => ({
|
|
10
10
|
title: n.label ?? n.id ?? e.getKind(n.kind)?.label ?? n.kind,
|
|
@@ -18,7 +18,7 @@ const hr = (e, t) => {
|
|
|
18
18
|
}
|
|
19
19
|
} : {}
|
|
20
20
|
}));
|
|
21
|
-
},
|
|
21
|
+
}, Ae = () => {
|
|
22
22
|
const e = L({
|
|
23
23
|
name: "workbench.breadcrumbs",
|
|
24
24
|
initialState: {
|
|
@@ -30,7 +30,7 @@ const hr = (e, t) => {
|
|
|
30
30
|
setItems(t) {
|
|
31
31
|
return e.setState({
|
|
32
32
|
items: t
|
|
33
|
-
}, !1, "setBreadcrumbItems"),
|
|
33
|
+
}, !1, "setBreadcrumbItems"), I(() => {
|
|
34
34
|
e.getState().items === t && e.setState({
|
|
35
35
|
items: void 0
|
|
36
36
|
}, !1, "clearBreadcrumbItems");
|
|
@@ -46,10 +46,10 @@ const hr = (e, t) => {
|
|
|
46
46
|
},
|
|
47
47
|
onDidChange(t) {
|
|
48
48
|
const s = e.subscribeSelector((n) => n.items, () => t());
|
|
49
|
-
return
|
|
49
|
+
return I(s);
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
},
|
|
52
|
+
}, $e = (e = {}) => {
|
|
53
53
|
const t = L({
|
|
54
54
|
name: "workbench.commandPalette",
|
|
55
55
|
initialState: {
|
|
@@ -114,17 +114,17 @@ const hr = (e, t) => {
|
|
|
114
114
|
},
|
|
115
115
|
onDidChange(n) {
|
|
116
116
|
const i = t.subscribeSelector((r) => r.open, (r) => n(r));
|
|
117
|
-
return
|
|
117
|
+
return I(i);
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
|
-
},
|
|
120
|
+
}, Fe = ["activity", "sidenav", "main", "secondary", "side", "status"], Ne = {
|
|
121
121
|
activity: "activityFocus",
|
|
122
122
|
sidenav: "sidenavFocus",
|
|
123
123
|
main: "mainFocus",
|
|
124
124
|
secondary: "secondaryFocus",
|
|
125
125
|
side: "sideFocus",
|
|
126
126
|
status: "statusFocus"
|
|
127
|
-
},
|
|
127
|
+
}, Ke = (e) => {
|
|
128
128
|
const t = L({
|
|
129
129
|
name: "workbench.focus",
|
|
130
130
|
initialState: {
|
|
@@ -132,8 +132,8 @@ const hr = (e, t) => {
|
|
|
132
132
|
}
|
|
133
133
|
}), s = e.context.createScope("workbench.focus"), n = (i) => {
|
|
134
134
|
s.set("workbenchFocus", i !== void 0), s.set("activeWorkbenchFocusRegion", i);
|
|
135
|
-
for (const r of
|
|
136
|
-
s.set(
|
|
135
|
+
for (const r of Fe)
|
|
136
|
+
s.set(Ne[r], r === i);
|
|
137
137
|
};
|
|
138
138
|
return n(void 0), {
|
|
139
139
|
store: t,
|
|
@@ -152,46 +152,46 @@ const hr = (e, t) => {
|
|
|
152
152
|
},
|
|
153
153
|
onDidChange(i) {
|
|
154
154
|
const r = t.subscribeSelector((o) => o.activeRegion, (o) => i(o));
|
|
155
|
-
return
|
|
155
|
+
return I(r);
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
|
-
},
|
|
158
|
+
}, J = ["main", "secondary"], Y = (e, t) => t.role ?? e.getWidget(t.contributionId)?.role ?? "content", Ue = (e, t) => {
|
|
159
159
|
if (t.instanceKey) {
|
|
160
160
|
const s = $(e.getLayout(), t.instanceKey)?.placement;
|
|
161
161
|
if (s) return s;
|
|
162
162
|
}
|
|
163
|
-
for (const s of
|
|
163
|
+
for (const s of F) {
|
|
164
164
|
const n = e.getLayout().regions[s].widgets.find((i) => i.contributionId === t.contributionId && i.resourceUri === t.resourceUri);
|
|
165
165
|
if (n) return n;
|
|
166
166
|
}
|
|
167
|
-
},
|
|
167
|
+
}, je = (e) => ({
|
|
168
168
|
contributionId: e.contributionId,
|
|
169
169
|
resourceUri: e.resourceUri,
|
|
170
170
|
instanceKey: e.widgetId
|
|
171
|
-
}),
|
|
171
|
+
}), _e = (e, t) => e?.contributionId === t?.contributionId && e?.resourceUri === t?.resourceUri && e?.instanceKey === t?.instanceKey, He = (e, t) => {
|
|
172
172
|
const s = {}, n = B(e.getLayout());
|
|
173
|
-
for (const i of
|
|
173
|
+
for (const i of J) {
|
|
174
174
|
const r = e.getLayout().regions[i], o = r.widgets.find((u) => u.widgetId === r.activeWidgetId), c = o ? e.getWidget(o.contributionId) : void 0;
|
|
175
|
-
o && c && Y(e, o) === "sub-panel" &&
|
|
175
|
+
o && c && Y(e, o) === "sub-panel" && we(c, n?.resource, t, o) && (s[i] = je(o));
|
|
176
176
|
}
|
|
177
177
|
return s;
|
|
178
|
-
},
|
|
178
|
+
}, qe = (e) => B(e.getLayout()), Ve = (e, t) => ({
|
|
179
179
|
key: e.resourceUri ? `${t ?? "global"}:resource:${e.resourceUri}` : `${t ?? "global"}:widget:${e.contributionId}:${e.widgetId}`,
|
|
180
180
|
modeId: t,
|
|
181
181
|
resource: e.resource,
|
|
182
182
|
contributionId: e.contributionId,
|
|
183
183
|
instanceKey: e.widgetId,
|
|
184
184
|
title: e.title
|
|
185
|
-
}),
|
|
186
|
-
const t = e.modes?.getActiveModeId(), s =
|
|
185
|
+
}), ze = (e) => {
|
|
186
|
+
const t = e.modes?.getActiveModeId(), s = qe(e.layout), n = Date.now(), i = {
|
|
187
187
|
entryId: `history-${n}-${e.counter}`,
|
|
188
188
|
recordedAt: n,
|
|
189
|
-
selectedSubPanels:
|
|
189
|
+
selectedSubPanels: He(e.layout, t)
|
|
190
190
|
};
|
|
191
191
|
if (s)
|
|
192
192
|
return {
|
|
193
193
|
...i,
|
|
194
|
-
location:
|
|
194
|
+
location: Ve(s, t),
|
|
195
195
|
kind: s.resource ? "resource" : "widget",
|
|
196
196
|
modeId: t,
|
|
197
197
|
resource: s.resource,
|
|
@@ -211,18 +211,18 @@ const hr = (e, t) => {
|
|
|
211
211
|
modeId: t,
|
|
212
212
|
title: e.modes?.getMode(t)?.label ?? t
|
|
213
213
|
};
|
|
214
|
-
}, q = (e, t) => !e || !t || e.location.key !== t.location.key ? !1 :
|
|
214
|
+
}, q = (e, t) => !e || !t || e.location.key !== t.location.key ? !1 : J.every((s) => _e(e.selectedSubPanels[s], t.selectedSubPanels[s])), H = (e) => {
|
|
215
215
|
const t = [];
|
|
216
216
|
for (const s of e) {
|
|
217
217
|
const n = t.length - 1;
|
|
218
218
|
q(t[n], s) ? t[n] = s : t.push(s);
|
|
219
219
|
}
|
|
220
220
|
return t;
|
|
221
|
-
},
|
|
221
|
+
}, Qe = (e, t) => {
|
|
222
222
|
const s = {
|
|
223
223
|
...e.selectedSubPanels
|
|
224
224
|
};
|
|
225
|
-
for (const n of
|
|
225
|
+
for (const n of F) {
|
|
226
226
|
const i = s[n];
|
|
227
227
|
(i?.instanceKey === t.widgetId || i?.contributionId === t.contributionId && i.resourceUri === t.resourceUri) && delete s[n];
|
|
228
228
|
}
|
|
@@ -230,7 +230,7 @@ const hr = (e, t) => {
|
|
|
230
230
|
...e,
|
|
231
231
|
selectedSubPanels: s
|
|
232
232
|
};
|
|
233
|
-
},
|
|
233
|
+
}, Ye = (e) => {
|
|
234
234
|
const {
|
|
235
235
|
closedSubPanel: t,
|
|
236
236
|
counter: s,
|
|
@@ -263,28 +263,28 @@ const hr = (e, t) => {
|
|
|
263
263
|
title: r.title,
|
|
264
264
|
closedSubPanel: t
|
|
265
265
|
};
|
|
266
|
-
},
|
|
266
|
+
}, Se = 1, X = () => ({
|
|
267
267
|
entries: [],
|
|
268
268
|
cursor: -1,
|
|
269
269
|
recentlyClosed: [],
|
|
270
270
|
hydrating: !1
|
|
271
|
-
}),
|
|
272
|
-
if (e?.version !==
|
|
273
|
-
const t =
|
|
271
|
+
}), Ge = (e) => {
|
|
272
|
+
if (e?.version !== Se) return X();
|
|
273
|
+
const t = H(e.entries);
|
|
274
274
|
return {
|
|
275
275
|
entries: t,
|
|
276
276
|
cursor: Math.min(Math.max(e.cursor, t.length > 0 ? 0 : -1), t.length - 1),
|
|
277
277
|
recentlyClosed: e.recentlyClosed.slice(-20),
|
|
278
278
|
hydrating: !1
|
|
279
279
|
};
|
|
280
|
-
},
|
|
280
|
+
}, oe = (e) => {
|
|
281
281
|
const {
|
|
282
282
|
entry: t,
|
|
283
283
|
layout: s,
|
|
284
284
|
modes: n,
|
|
285
285
|
resources: i
|
|
286
286
|
} = e;
|
|
287
|
-
if (t.closedSubPanel && s.getWidget(t.closedSubPanel.reference.contributionId)?.role !== "sub-panel")
|
|
287
|
+
if (t.modeId && n && !n.getMode(t.modeId) || t.closedSubPanel && s.getWidget(t.closedSubPanel.reference.contributionId)?.role !== "sub-panel")
|
|
288
288
|
return;
|
|
289
289
|
const r = t.contributionId ? s.getWidget(t.contributionId) : void 0;
|
|
290
290
|
if (!(t.kind === "mode" ? !!(t.modeId && n?.getMode(t.modeId)) : !!(r && r.role !== "panel-menu" && r.role !== "sub-panel" || t.resource && i.listPresenters().some((u) => u.canOpen(t.resource))))) return;
|
|
@@ -293,13 +293,13 @@ const hr = (e, t) => {
|
|
|
293
293
|
...t,
|
|
294
294
|
selectedSubPanels: c
|
|
295
295
|
};
|
|
296
|
-
},
|
|
296
|
+
}, Je = (e) => {
|
|
297
297
|
const {
|
|
298
298
|
state: t
|
|
299
|
-
} = e, s = t.entries[t.cursor]?.entryId, n =
|
|
299
|
+
} = e, s = t.entries[t.cursor]?.entryId, n = H(t.entries.map((c) => oe({
|
|
300
300
|
...e,
|
|
301
301
|
entry: c
|
|
302
|
-
})).filter((c) => !!c)), i = s ? n.findIndex((c) => c.entryId === s) : -1, r = i >= 0 ? i : Math.min(t.cursor, n.length - 1), o = t.recentlyClosed.map((c) =>
|
|
302
|
+
})).filter((c) => !!c)), i = s ? n.findIndex((c) => c.entryId === s) : -1, r = i >= 0 ? i : Math.min(t.cursor, n.length - 1), o = t.recentlyClosed.map((c) => oe({
|
|
303
303
|
...e,
|
|
304
304
|
entry: c
|
|
305
305
|
})).filter((c) => !!c);
|
|
@@ -309,7 +309,7 @@ const hr = (e, t) => {
|
|
|
309
309
|
cursor: r,
|
|
310
310
|
recentlyClosed: o
|
|
311
311
|
};
|
|
312
|
-
},
|
|
312
|
+
}, Xe = 50, Ze = 50, et = (e) => {
|
|
313
313
|
let t;
|
|
314
314
|
const s = () => {
|
|
315
315
|
if (t && clearTimeout(t), t = void 0, !e.persistence) return;
|
|
@@ -319,16 +319,16 @@ const hr = (e, t) => {
|
|
|
319
319
|
} = e.store.getState();
|
|
320
320
|
e.persistence.setHistory({
|
|
321
321
|
...i,
|
|
322
|
-
version:
|
|
322
|
+
version: Se
|
|
323
323
|
}, e.getScope());
|
|
324
324
|
};
|
|
325
325
|
return {
|
|
326
326
|
flush: s,
|
|
327
327
|
schedule() {
|
|
328
|
-
!e.persistence || t || (t = setTimeout(s,
|
|
328
|
+
!e.persistence || t || (t = setTimeout(s, Ze));
|
|
329
329
|
}
|
|
330
330
|
};
|
|
331
|
-
},
|
|
331
|
+
}, tt = (e, t, s, n) => n ? s ? t?.kind === "mode" ? !0 : e?.location.resource?.uri === t?.location.resource?.uri : t?.kind !== "mode" : !1, rt = (e) => e.entries[e.cursor], ie = (e) => {
|
|
332
332
|
const t = /* @__PURE__ */ new Map();
|
|
333
333
|
for (const s of Object.values(e.getLayout().regions))
|
|
334
334
|
for (const n of s.widgets) t.set(n.widgetId, {
|
|
@@ -336,7 +336,7 @@ const hr = (e, t) => {
|
|
|
336
336
|
region: s.id
|
|
337
337
|
});
|
|
338
338
|
return t;
|
|
339
|
-
},
|
|
339
|
+
}, nt = (e) => {
|
|
340
340
|
const {
|
|
341
341
|
entry: t,
|
|
342
342
|
layout: s,
|
|
@@ -356,180 +356,206 @@ const hr = (e, t) => {
|
|
|
356
356
|
}) : n ? s.activateWidget(n.widgetId) : t.contributionId && s.getWidget(t.contributionId) && s.openWidget(t.contributionId, {
|
|
357
357
|
title: t.title
|
|
358
358
|
}), u(t);
|
|
359
|
-
},
|
|
359
|
+
}, st = (e) => {
|
|
360
360
|
const {
|
|
361
361
|
activateEntry: t,
|
|
362
362
|
controllerInput: s,
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
363
|
+
failRestore: n,
|
|
364
|
+
finishRestore: i,
|
|
365
|
+
flush: r,
|
|
366
|
+
getPersistenceScope: o,
|
|
367
|
+
moveCursor: c,
|
|
368
|
+
runSilent: u,
|
|
369
|
+
setPersistenceScope: f,
|
|
370
|
+
setState: m,
|
|
371
|
+
store: a
|
|
371
372
|
} = e;
|
|
372
373
|
return {
|
|
373
|
-
store:
|
|
374
|
-
goBack: () =>
|
|
375
|
-
goForward: () =>
|
|
374
|
+
store: a,
|
|
375
|
+
goBack: () => c(-1),
|
|
376
|
+
goForward: () => c(1),
|
|
376
377
|
goPrevious() {
|
|
377
|
-
const
|
|
378
|
-
if (
|
|
379
|
-
const
|
|
380
|
-
for (let
|
|
381
|
-
const
|
|
382
|
-
if (!q(
|
|
383
|
-
return
|
|
384
|
-
...
|
|
385
|
-
cursor:
|
|
386
|
-
}, "history.goPrevious"),
|
|
378
|
+
const d = a.getState();
|
|
379
|
+
if (d.hydrating) return;
|
|
380
|
+
const l = d.entries[d.cursor];
|
|
381
|
+
for (let y = d.entries.length - 1; y >= 0; y -= 1) {
|
|
382
|
+
const S = d.entries[y];
|
|
383
|
+
if (!q(S, l))
|
|
384
|
+
return m({
|
|
385
|
+
...d,
|
|
386
|
+
cursor: y
|
|
387
|
+
}, "history.goPrevious"), u(() => t(S)), S;
|
|
387
388
|
}
|
|
388
389
|
},
|
|
389
|
-
recentlyClosed: () =>
|
|
390
|
+
recentlyClosed: () => a.getState().recentlyClosed,
|
|
390
391
|
reopenLastClosed() {
|
|
391
|
-
const
|
|
392
|
-
if (
|
|
393
|
-
const
|
|
394
|
-
if (
|
|
395
|
-
return
|
|
396
|
-
...
|
|
397
|
-
recentlyClosed:
|
|
398
|
-
}, "history.reopenClosed"),
|
|
399
|
-
const
|
|
400
|
-
|
|
401
|
-
region:
|
|
402
|
-
resource:
|
|
403
|
-
title:
|
|
392
|
+
const d = a.getState();
|
|
393
|
+
if (d.hydrating) return;
|
|
394
|
+
const l = d.recentlyClosed.at(-1);
|
|
395
|
+
if (l)
|
|
396
|
+
return m({
|
|
397
|
+
...d,
|
|
398
|
+
recentlyClosed: d.recentlyClosed.slice(0, -1)
|
|
399
|
+
}, "history.reopenClosed"), u(() => {
|
|
400
|
+
const y = t(l), S = () => {
|
|
401
|
+
l.closedSubPanel && s.layout.openWidget(l.closedSubPanel.reference.contributionId, {
|
|
402
|
+
region: l.closedSubPanel.region,
|
|
403
|
+
resource: l.closedSubPanel.resource,
|
|
404
|
+
title: l.closedSubPanel.title,
|
|
404
405
|
closable: !0
|
|
405
406
|
});
|
|
406
407
|
};
|
|
407
|
-
|
|
408
|
-
}),
|
|
408
|
+
y instanceof Promise ? y.then(S) : S();
|
|
409
|
+
}), l;
|
|
409
410
|
},
|
|
410
|
-
setPersistenceScope:
|
|
411
|
-
getPersistenceScope:
|
|
411
|
+
setPersistenceScope: f,
|
|
412
|
+
getPersistenceScope: o,
|
|
412
413
|
restore() {
|
|
413
|
-
const
|
|
414
|
-
state:
|
|
414
|
+
const d = Je({
|
|
415
|
+
state: a.getState(),
|
|
415
416
|
layout: s.layout,
|
|
416
417
|
modes: s.modes,
|
|
417
418
|
resources: s.resources
|
|
418
419
|
});
|
|
419
|
-
|
|
420
|
-
const
|
|
421
|
-
let
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
420
|
+
m(d, "history.reconcile");
|
|
421
|
+
const l = d.entries[d.cursor], y = o();
|
|
422
|
+
let S;
|
|
423
|
+
if (l)
|
|
424
|
+
try {
|
|
425
|
+
u(() => {
|
|
426
|
+
const w = t(l, {
|
|
427
|
+
replayCurrentLocation: !0
|
|
428
|
+
});
|
|
429
|
+
w instanceof Promise && (S = w);
|
|
430
|
+
});
|
|
431
|
+
} catch {
|
|
432
|
+
return n(y, l.entryId), l;
|
|
433
|
+
}
|
|
434
|
+
return S ? S.then(() => i(y, l?.entryId), () => l ? n(y, l.entryId) : i(y)) : i(y, l?.entryId), l;
|
|
428
435
|
},
|
|
429
|
-
flush:
|
|
436
|
+
flush: r,
|
|
430
437
|
clear() {
|
|
431
|
-
|
|
438
|
+
i(), m(X(), "history.clear");
|
|
432
439
|
}
|
|
433
440
|
};
|
|
434
|
-
},
|
|
435
|
-
|
|
436
|
-
if (
|
|
437
|
-
const
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
441
|
+
}, ot = (e) => {
|
|
442
|
+
function t(n, i) {
|
|
443
|
+
if (n !== void 0 && n !== e.getScope()) return;
|
|
444
|
+
const r = e.store.getState(), o = r.entries[r.cursor]?.entryId, c = r.entries.filter((f) => f.entryId !== i), u = o ? c.findIndex((f) => f.entryId === o) : -1;
|
|
445
|
+
e.setState({
|
|
446
|
+
...r,
|
|
447
|
+
entries: c,
|
|
448
|
+
cursor: u >= 0 ? u : Math.min(r.cursor, c.length - 1),
|
|
449
|
+
recentlyClosed: r.recentlyClosed.filter((f) => f.entryId !== i)
|
|
450
|
+
}, "history.discardFailedRestore"), s(n, i);
|
|
451
|
+
}
|
|
452
|
+
function s(n, i) {
|
|
453
|
+
if (n !== void 0 && n !== e.getScope()) return;
|
|
454
|
+
const r = e.store.getState(), o = r.entries[r.cursor];
|
|
455
|
+
if (i && o && o.entryId !== i) {
|
|
456
|
+
let c;
|
|
457
|
+
try {
|
|
458
|
+
e.runSilent(() => {
|
|
459
|
+
const u = e.activateEntry(o);
|
|
460
|
+
u instanceof Promise && (c = u);
|
|
461
|
+
});
|
|
462
|
+
} catch {
|
|
463
|
+
t(n, o.entryId);
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
c ? c.then(() => s(n, o.entryId), () => t(n, o.entryId)) : s(n, o.entryId);
|
|
444
467
|
return;
|
|
445
468
|
}
|
|
446
|
-
e.onFinish(),
|
|
447
|
-
...
|
|
469
|
+
e.onFinish(), r.hydrating && e.setState({
|
|
470
|
+
...r,
|
|
448
471
|
hydrating: !1
|
|
449
472
|
}, "history.finishRestore", !1);
|
|
473
|
+
}
|
|
474
|
+
return {
|
|
475
|
+
fail: t,
|
|
476
|
+
finish: s
|
|
450
477
|
};
|
|
451
|
-
|
|
452
|
-
}, ct = (e) => (t) => {
|
|
478
|
+
}, it = (e) => (t) => {
|
|
453
479
|
const s = e.store.getState(), n = s.cursor + t, i = s.entries[n];
|
|
454
480
|
if (i)
|
|
455
481
|
return e.setState({
|
|
456
482
|
...s,
|
|
457
483
|
cursor: n
|
|
458
484
|
}, t < 0 ? "history.goBack" : "history.goForward"), e.flush(), s.hydrating || e.runSilent(() => e.activateEntry(i)), i;
|
|
459
|
-
},
|
|
485
|
+
}, at = (e) => {
|
|
460
486
|
let t = !1;
|
|
461
487
|
return e.onWillChangePersistenceScope(() => {
|
|
462
488
|
t = !0;
|
|
463
489
|
}), e.onDidChangePersistenceScope(() => {
|
|
464
490
|
t = !1;
|
|
465
491
|
}), () => t;
|
|
466
|
-
},
|
|
492
|
+
}, ct = (e) => {
|
|
467
493
|
const t = L({
|
|
468
494
|
name: "workbench.history",
|
|
469
|
-
initialState:
|
|
495
|
+
initialState: X()
|
|
470
496
|
});
|
|
471
497
|
let s = 0, n = !1, i = !1;
|
|
472
|
-
const r =
|
|
498
|
+
const r = at(e.layout);
|
|
473
499
|
let o;
|
|
474
500
|
const c = /* @__PURE__ */ new Set(), {
|
|
475
501
|
flush: u,
|
|
476
502
|
schedule: f
|
|
477
|
-
} =
|
|
503
|
+
} = et({
|
|
478
504
|
persistence: e.persistence,
|
|
479
505
|
store: t,
|
|
480
506
|
getScope: () => o
|
|
481
|
-
}), m = (g,
|
|
482
|
-
t.setState(g, !1,
|
|
507
|
+
}), m = (g, b, p = !0) => {
|
|
508
|
+
t.setState(g, !1, b), p && f();
|
|
483
509
|
}, a = (g) => {
|
|
484
510
|
if (!g) return;
|
|
485
|
-
const
|
|
511
|
+
const b = t.getState(), p = b.entries[b.cursor];
|
|
486
512
|
if (q(p, g)) return;
|
|
487
|
-
const
|
|
513
|
+
const P = b.entries.slice(0, b.cursor + 1), W = p?.kind === "mode" && g.kind !== "mode" && p.modeId === g.modeId, k = H(W ? [...P.slice(0, -1), g] : [...P, g]), x = k.slice(Math.max(0, k.length - (e.maxEntries ?? Xe)));
|
|
488
514
|
m({
|
|
489
|
-
...
|
|
515
|
+
...b,
|
|
490
516
|
entries: x,
|
|
491
517
|
cursor: x.length - 1
|
|
492
518
|
}, "history.record");
|
|
493
|
-
}, d = (g = !1,
|
|
494
|
-
if (n || i || r() || !
|
|
519
|
+
}, d = (g = !1, b = !1) => {
|
|
520
|
+
if (n || i || r() || !b && e.resources.isOpeningResource()) return;
|
|
495
521
|
s += 1;
|
|
496
|
-
const
|
|
522
|
+
const P = ze({
|
|
497
523
|
counter: s,
|
|
498
524
|
layout: e.layout,
|
|
499
525
|
modes: e.modes
|
|
500
|
-
}), W =
|
|
501
|
-
|
|
526
|
+
}), W = rt(t.getState());
|
|
527
|
+
tt(W, P, g, e.modes?.isTransitioning() ?? !1) || P?.location.resource && c.has(P.location.resource.uri) || a(P);
|
|
502
528
|
};
|
|
503
|
-
let l =
|
|
504
|
-
const
|
|
505
|
-
const
|
|
529
|
+
let l = ie(e.layout);
|
|
530
|
+
const y = (g) => {
|
|
531
|
+
const b = t.getState(), p = Y(e.layout, g);
|
|
506
532
|
if (p === "location" && e.resources.isOpeningResource()) return;
|
|
507
533
|
if (p !== "sub-panel") {
|
|
508
534
|
if (e.modes?.isTransitioning() || !e.layout.getWidget(g.contributionId)) return;
|
|
509
|
-
const x =
|
|
510
|
-
if (x.length ===
|
|
535
|
+
const x = H(b.entries.filter((V) => V.widgetId !== g.widgetId));
|
|
536
|
+
if (x.length === b.entries.length) return;
|
|
511
537
|
m({
|
|
512
|
-
...
|
|
538
|
+
...b,
|
|
513
539
|
entries: x,
|
|
514
|
-
cursor: Math.min(
|
|
540
|
+
cursor: Math.min(b.cursor, x.length - 1)
|
|
515
541
|
}, "history.prune");
|
|
516
542
|
return;
|
|
517
543
|
}
|
|
518
|
-
const
|
|
544
|
+
const P = b.entries[b.cursor]?.entryId, W = H(b.entries.map((x) => Qe(x, g))), k = P ? W.findIndex((x) => x.entryId === P) : -1;
|
|
519
545
|
m({
|
|
520
|
-
...
|
|
546
|
+
...b,
|
|
521
547
|
entries: W,
|
|
522
|
-
cursor: k >= 0 ? k : Math.min(
|
|
548
|
+
cursor: k >= 0 ? k : Math.min(b.cursor, W.length - 1)
|
|
523
549
|
}, "history.removeSubPanel");
|
|
524
|
-
},
|
|
550
|
+
}, S = (g, b) => {
|
|
525
551
|
s += 1;
|
|
526
|
-
const p = t.getState(),
|
|
552
|
+
const p = t.getState(), P = Y(e.layout, g), W = Ye({
|
|
527
553
|
placement: g,
|
|
528
554
|
counter: s,
|
|
529
|
-
current:
|
|
555
|
+
current: P === "sub-panel" ? p.entries[p.cursor] : void 0,
|
|
530
556
|
modeId: e.modes?.getActiveModeId(),
|
|
531
|
-
closedSubPanel:
|
|
532
|
-
region:
|
|
557
|
+
closedSubPanel: P === "sub-panel" && F.includes(b) ? {
|
|
558
|
+
region: b,
|
|
533
559
|
reference: {
|
|
534
560
|
contributionId: g.contributionId,
|
|
535
561
|
resourceUri: g.resourceUri,
|
|
@@ -545,55 +571,55 @@ const hr = (e, t) => {
|
|
|
545
571
|
}, "history.recordClosed");
|
|
546
572
|
};
|
|
547
573
|
e.layout.store.subscribeSelector((g) => g.layout, () => {
|
|
548
|
-
const g =
|
|
574
|
+
const g = ie(e.layout);
|
|
549
575
|
if (i || r()) {
|
|
550
576
|
l = g;
|
|
551
577
|
return;
|
|
552
578
|
}
|
|
553
|
-
for (const [
|
|
554
|
-
g.has(
|
|
579
|
+
for (const [b, p] of l)
|
|
580
|
+
g.has(b) || (p.placement.closable && S(p.placement, p.region), y(p.placement));
|
|
555
581
|
l = g, d(!0);
|
|
556
582
|
}), e.modes?.onDidChangeActive(d), e.resources.onDidOpenResource(() => d(!1, !0));
|
|
557
|
-
const
|
|
558
|
-
for (const
|
|
559
|
-
const p = g.selectedSubPanels[
|
|
560
|
-
if (
|
|
561
|
-
e.layout.activateWidget(
|
|
583
|
+
const w = (g) => {
|
|
584
|
+
for (const b of J) {
|
|
585
|
+
const p = g.selectedSubPanels[b], P = p ? Ue(e.layout, p) : void 0;
|
|
586
|
+
if (P) {
|
|
587
|
+
e.layout.activateWidget(P.widgetId);
|
|
562
588
|
continue;
|
|
563
589
|
}
|
|
564
|
-
const W =
|
|
565
|
-
e.layout.setRegionActiveWidget(
|
|
566
|
-
}
|
|
567
|
-
},
|
|
568
|
-
e.modes
|
|
569
|
-
}, h = (g,
|
|
570
|
-
const
|
|
571
|
-
return c.add(
|
|
590
|
+
const W = b === "main" ? e.layout.getLayout().activeLocationWidgetId : void 0;
|
|
591
|
+
e.layout.setRegionActiveWidget(b, W);
|
|
592
|
+
}
|
|
593
|
+
}, v = (g) => {
|
|
594
|
+
!e.modes || !g.modeId || !e.modes.getMode(g.modeId) || e.modes.getActiveModeId() !== g.modeId && e.modes.setActiveMode(g.modeId);
|
|
595
|
+
}, h = (g, b, p) => {
|
|
596
|
+
const P = g.resource;
|
|
597
|
+
return c.add(P.uri), e.resources.openResource(P, {
|
|
572
598
|
replaceActive: p
|
|
573
599
|
}).finally(() => {
|
|
574
|
-
|
|
600
|
+
b === o && w(g), c.delete(P.uri);
|
|
575
601
|
});
|
|
576
|
-
}, R = (g,
|
|
602
|
+
}, R = (g, b = {}) => {
|
|
577
603
|
const p = o;
|
|
578
|
-
if (
|
|
579
|
-
|
|
604
|
+
if (v(g), g.kind === "mode") {
|
|
605
|
+
w(g);
|
|
580
606
|
return;
|
|
581
607
|
}
|
|
582
|
-
const
|
|
608
|
+
const P = g.widgetId ? $(e.layout.getLayout(), g.widgetId)?.placement : void 0;
|
|
583
609
|
if (g.kind === "resource" && g.resource)
|
|
584
|
-
return
|
|
610
|
+
return nt({
|
|
585
611
|
entry: g,
|
|
586
612
|
resource: g.resource,
|
|
587
|
-
placement:
|
|
613
|
+
placement: P,
|
|
588
614
|
layout: e.layout,
|
|
589
615
|
resources: e.resources,
|
|
590
|
-
replayCurrentLocation:
|
|
616
|
+
replayCurrentLocation: b.replayCurrentLocation,
|
|
591
617
|
replayResource: (W, k) => h(W, p, k),
|
|
592
|
-
restoreSelections:
|
|
618
|
+
restoreSelections: w
|
|
593
619
|
});
|
|
594
|
-
|
|
620
|
+
P ? e.layout.activateWidget(P.widgetId) : g.contributionId && e.layout.getWidget(g.contributionId) && e.layout.openWidget(g.contributionId, {
|
|
595
621
|
title: g.title
|
|
596
|
-
}),
|
|
622
|
+
}), w(g);
|
|
597
623
|
}, C = (g) => {
|
|
598
624
|
n = !0;
|
|
599
625
|
try {
|
|
@@ -601,7 +627,7 @@ const hr = (e, t) => {
|
|
|
601
627
|
} finally {
|
|
602
628
|
n = !1;
|
|
603
629
|
}
|
|
604
|
-
},
|
|
630
|
+
}, E = it({
|
|
605
631
|
store: t,
|
|
606
632
|
activateEntry: R,
|
|
607
633
|
flush: u,
|
|
@@ -610,14 +636,14 @@ const hr = (e, t) => {
|
|
|
610
636
|
}), M = (g) => {
|
|
611
637
|
if (g === o) return;
|
|
612
638
|
u(), o = g;
|
|
613
|
-
const
|
|
614
|
-
i =
|
|
615
|
-
...
|
|
639
|
+
const b = Ge(e.persistence?.getHistory(g));
|
|
640
|
+
i = b.entries.length > 0, m({
|
|
641
|
+
...b,
|
|
616
642
|
hydrating: i
|
|
617
643
|
}, "history.setPersistenceScope", !1);
|
|
618
644
|
};
|
|
619
645
|
typeof window < "u" && window.addEventListener("pagehide", u);
|
|
620
|
-
const
|
|
646
|
+
const U = ot({
|
|
621
647
|
store: t,
|
|
622
648
|
activateEntry: R,
|
|
623
649
|
getScope: () => o,
|
|
@@ -627,19 +653,20 @@ const hr = (e, t) => {
|
|
|
627
653
|
runSilent: C,
|
|
628
654
|
setState: m
|
|
629
655
|
});
|
|
630
|
-
return
|
|
656
|
+
return st({
|
|
631
657
|
controllerInput: e,
|
|
632
658
|
store: t,
|
|
633
|
-
|
|
659
|
+
failRestore: U.fail,
|
|
660
|
+
finishRestore: U.finish,
|
|
634
661
|
setPersistenceScope: M,
|
|
635
662
|
getPersistenceScope: () => o,
|
|
636
663
|
activateEntry: R,
|
|
637
|
-
moveCursor:
|
|
664
|
+
moveCursor: E,
|
|
638
665
|
runSilent: C,
|
|
639
666
|
setState: m,
|
|
640
667
|
flush: u
|
|
641
668
|
});
|
|
642
|
-
},
|
|
669
|
+
}, dt = (e) => {
|
|
643
670
|
const t = () => e.persistence?.getLastResource();
|
|
644
671
|
return {
|
|
645
672
|
get: t,
|
|
@@ -654,7 +681,7 @@ const hr = (e, t) => {
|
|
|
654
681
|
}
|
|
655
682
|
}
|
|
656
683
|
};
|
|
657
|
-
},
|
|
684
|
+
}, lt = (e = {}) => {
|
|
658
685
|
let t;
|
|
659
686
|
const s = Object.fromEntries(Object.entries(e.defaultOpenByRegionId ?? {}).filter((u) => u[1] !== void 0)), n = e.persistence?.getPanelStates(t), i = (u) => ({
|
|
660
687
|
...s,
|
|
@@ -695,14 +722,15 @@ const hr = (e, t) => {
|
|
|
695
722
|
getPersistenceScope: () => t,
|
|
696
723
|
onDidChange(u) {
|
|
697
724
|
const f = r.subscribe((m) => u(m));
|
|
698
|
-
return
|
|
725
|
+
return I(f);
|
|
699
726
|
}
|
|
700
727
|
};
|
|
701
|
-
},
|
|
728
|
+
}, ut = (e = {}) => {
|
|
702
729
|
const t = L({
|
|
703
730
|
name: "workbench.sidePanel",
|
|
731
|
+
// What the user last chose outranks the app's opening default.
|
|
704
732
|
initialState: {
|
|
705
|
-
mode: e.initialMode ?? "floating"
|
|
733
|
+
mode: e.persistence?.getMode() ?? e.initialMode ?? "floating"
|
|
706
734
|
}
|
|
707
735
|
});
|
|
708
736
|
return {
|
|
@@ -711,16 +739,16 @@ const hr = (e, t) => {
|
|
|
711
739
|
return t.getState().mode;
|
|
712
740
|
},
|
|
713
741
|
setMode(s) {
|
|
714
|
-
t.getState().mode !== s && t.setState({
|
|
742
|
+
t.getState().mode !== s && (t.setState({
|
|
715
743
|
mode: s
|
|
716
|
-
}, !1, "setMode");
|
|
744
|
+
}, !1, "setMode"), e.persistence?.setMode(s));
|
|
717
745
|
},
|
|
718
746
|
onDidChange(s) {
|
|
719
747
|
const n = t.subscribeSelector((i) => i.mode, (i) => s(i));
|
|
720
|
-
return
|
|
748
|
+
return I(n);
|
|
721
749
|
}
|
|
722
750
|
};
|
|
723
|
-
},
|
|
751
|
+
}, gt = "Terminal", ft = 200, mt = () => {
|
|
724
752
|
const e = L({
|
|
725
753
|
name: "workbench.terminal",
|
|
726
754
|
initialState: {
|
|
@@ -729,12 +757,12 @@ const hr = (e, t) => {
|
|
|
729
757
|
});
|
|
730
758
|
let t = null;
|
|
731
759
|
const s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), o = (a, d, l) => {
|
|
732
|
-
const
|
|
733
|
-
|
|
760
|
+
const y = e.getState(), S = y.sessionsById[a];
|
|
761
|
+
S && e.setState({
|
|
734
762
|
sessionsById: {
|
|
735
|
-
...
|
|
763
|
+
...y.sessionsById,
|
|
736
764
|
[a]: {
|
|
737
|
-
...
|
|
765
|
+
...S,
|
|
738
766
|
...d
|
|
739
767
|
}
|
|
740
768
|
}
|
|
@@ -751,7 +779,7 @@ const hr = (e, t) => {
|
|
|
751
779
|
}, f = (a, d) => {
|
|
752
780
|
if (r.has(a)) return;
|
|
753
781
|
const l = i.get(a);
|
|
754
|
-
l && (l.push(d), l.length >
|
|
782
|
+
l && (l.push(d), l.length > ft && l.shift());
|
|
755
783
|
}, m = async (a) => {
|
|
756
784
|
await c(a.sessionId).kill(a.signal), o(a.sessionId, {
|
|
757
785
|
status: "killed"
|
|
@@ -767,22 +795,22 @@ const hr = (e, t) => {
|
|
|
767
795
|
if (!t) throw new Error("Terminal sessions are not available in this workbench host.");
|
|
768
796
|
const d = await t(a.request);
|
|
769
797
|
s.set(d.id, d), i.set(d.id, []);
|
|
770
|
-
const l = [d.onData((
|
|
771
|
-
title:
|
|
798
|
+
const l = [d.onData((w) => f(d.id, w))], y = d.onTitle?.((w) => o(d.id, {
|
|
799
|
+
title: w
|
|
772
800
|
}, "terminalSessionTitleChanged"));
|
|
773
|
-
|
|
801
|
+
y && l.push(y), l.push(d.onExit((w) => {
|
|
774
802
|
e.getState().sessionsById[d.id]?.status === "running" && o(d.id, {
|
|
775
803
|
status: "exited",
|
|
776
|
-
exit:
|
|
804
|
+
exit: w
|
|
777
805
|
}, "terminalSessionExited"), u(d.id);
|
|
778
806
|
})), n.set(d.id, l);
|
|
779
|
-
const
|
|
807
|
+
const S = e.getState();
|
|
780
808
|
return e.setState({
|
|
781
809
|
sessionsById: {
|
|
782
|
-
...
|
|
810
|
+
...S.sessionsById,
|
|
783
811
|
[d.id]: {
|
|
784
812
|
id: d.id,
|
|
785
|
-
title: a.title ??
|
|
813
|
+
title: a.title ?? gt,
|
|
786
814
|
status: "running"
|
|
787
815
|
}
|
|
788
816
|
}
|
|
@@ -798,14 +826,14 @@ const hr = (e, t) => {
|
|
|
798
826
|
},
|
|
799
827
|
kill: m,
|
|
800
828
|
subscribe(a, d) {
|
|
801
|
-
const l = c(a),
|
|
829
|
+
const l = c(a), y = [];
|
|
802
830
|
if (d.onData) {
|
|
803
|
-
const
|
|
804
|
-
i.delete(a), r.add(a),
|
|
805
|
-
for (const
|
|
831
|
+
const S = i.get(a) ?? [];
|
|
832
|
+
i.delete(a), r.add(a), y.push(l.onData(d.onData));
|
|
833
|
+
for (const w of S) d.onData(w);
|
|
806
834
|
}
|
|
807
|
-
return
|
|
808
|
-
for (const
|
|
835
|
+
return y.push(d.onExit ? l.onExit(d.onExit) : void 0, d.onError ? l.onError(d.onError) : void 0), () => {
|
|
836
|
+
for (const S of y) S?.();
|
|
809
837
|
};
|
|
810
838
|
},
|
|
811
839
|
getSession(a) {
|
|
@@ -823,7 +851,7 @@ const hr = (e, t) => {
|
|
|
823
851
|
s.clear();
|
|
824
852
|
}
|
|
825
853
|
};
|
|
826
|
-
},
|
|
854
|
+
}, ht = () => {
|
|
827
855
|
const e = L({
|
|
828
856
|
name: "workbench.commandPaletteResources",
|
|
829
857
|
initialState: {
|
|
@@ -843,7 +871,7 @@ const hr = (e, t) => {
|
|
|
843
871
|
...s.providers,
|
|
844
872
|
[t.id]: t
|
|
845
873
|
}
|
|
846
|
-
}, !1, "registerProvider"),
|
|
874
|
+
}, !1, "registerProvider"), I(() => {
|
|
847
875
|
const n = e.getState();
|
|
848
876
|
if (n.providers[t.id] !== t) return;
|
|
849
877
|
const {
|
|
@@ -886,7 +914,7 @@ const hr = (e, t) => {
|
|
|
886
914
|
}, !1, "refresh");
|
|
887
915
|
}
|
|
888
916
|
};
|
|
889
|
-
},
|
|
917
|
+
}, yt = (e = {}) => {
|
|
890
918
|
const t = L({
|
|
891
919
|
name: "workbench.commands",
|
|
892
920
|
initialState: {
|
|
@@ -914,7 +942,7 @@ const hr = (e, t) => {
|
|
|
914
942
|
...u.commands,
|
|
915
943
|
[r.id]: f
|
|
916
944
|
}
|
|
917
|
-
}, !1, "registerCommand"),
|
|
945
|
+
}, !1, "registerCommand"), I(() => {
|
|
918
946
|
const m = t.getState();
|
|
919
947
|
if (m.commands[r.id] !== f) return;
|
|
920
948
|
const {
|
|
@@ -963,12 +991,12 @@ const hr = (e, t) => {
|
|
|
963
991
|
}
|
|
964
992
|
},
|
|
965
993
|
onDidExecuteError(r) {
|
|
966
|
-
return s.add(r),
|
|
994
|
+
return s.add(r), I(() => {
|
|
967
995
|
s.delete(r);
|
|
968
996
|
});
|
|
969
997
|
}
|
|
970
998
|
};
|
|
971
|
-
},
|
|
999
|
+
}, bt = (e) => {
|
|
972
1000
|
const {
|
|
973
1001
|
getLayout: t,
|
|
974
1002
|
getWidgets: s,
|
|
@@ -976,22 +1004,22 @@ const hr = (e, t) => {
|
|
|
976
1004
|
} = e;
|
|
977
1005
|
return {
|
|
978
1006
|
getRegionSize(i) {
|
|
979
|
-
const r = t().regions[i].size, o =
|
|
1007
|
+
const r = t().regions[i].size, o = _(t().regions[i]), c = o ? s()[o.contributionId]?.regionSize : n(i)?.regionSize;
|
|
980
1008
|
return r === void 0 ? c : {
|
|
981
1009
|
...c,
|
|
982
1010
|
defaultPx: r
|
|
983
1011
|
};
|
|
984
1012
|
},
|
|
985
1013
|
getRegionCollapsible(i) {
|
|
986
|
-
const r =
|
|
1014
|
+
const r = _(t().regions[i]);
|
|
987
1015
|
return r ? s()[r.contributionId]?.regionCollapsible ?? !0 : n(i)?.regionCollapsible ?? !0;
|
|
988
1016
|
},
|
|
989
1017
|
getRegionHeaderBorderBottom(i) {
|
|
990
|
-
const r =
|
|
1018
|
+
const r = _(t().regions[i]);
|
|
991
1019
|
return r ? s()[r.contributionId]?.headerBorderBottom ?? !0 : !0;
|
|
992
1020
|
}
|
|
993
1021
|
};
|
|
994
|
-
},
|
|
1022
|
+
}, St = (e) => {
|
|
995
1023
|
const {
|
|
996
1024
|
getPlaceholders: t,
|
|
997
1025
|
getWidgets: s
|
|
@@ -1000,7 +1028,7 @@ const hr = (e, t) => {
|
|
|
1000
1028
|
listPlaceholders: () => Object.values(t()).sort(O),
|
|
1001
1029
|
listWidgets: () => Object.values(s()).sort(O)
|
|
1002
1030
|
};
|
|
1003
|
-
},
|
|
1031
|
+
}, vt = (e) => {
|
|
1004
1032
|
const {
|
|
1005
1033
|
store: t,
|
|
1006
1034
|
getPlaceholders: s,
|
|
@@ -1027,7 +1055,7 @@ const hr = (e, t) => {
|
|
|
1027
1055
|
...m.placeholders,
|
|
1028
1056
|
[r.region]: f
|
|
1029
1057
|
}
|
|
1030
|
-
}, !1, "registerPlaceholder"),
|
|
1058
|
+
}, !1, "registerPlaceholder"), I(() => {
|
|
1031
1059
|
const a = t.getState();
|
|
1032
1060
|
if (a.placeholders[r.region] !== f) return;
|
|
1033
1061
|
const {
|
|
@@ -1063,16 +1091,16 @@ const hr = (e, t) => {
|
|
|
1063
1091
|
...d.widgets,
|
|
1064
1092
|
[r.id]: a
|
|
1065
1093
|
}
|
|
1066
|
-
}, !1, "registerWidget"),
|
|
1094
|
+
}, !1, "registerWidget"), I(() => {
|
|
1067
1095
|
const l = t.getState();
|
|
1068
1096
|
if (l.widgets[r.id] !== a) return;
|
|
1069
1097
|
const {
|
|
1070
|
-
[r.id]:
|
|
1071
|
-
...
|
|
1072
|
-
} = l.widgets,
|
|
1098
|
+
[r.id]: y,
|
|
1099
|
+
...S
|
|
1100
|
+
} = l.widgets, w = he(l.layout, r.id);
|
|
1073
1101
|
t.setState({
|
|
1074
|
-
widgets:
|
|
1075
|
-
layout:
|
|
1102
|
+
widgets: S,
|
|
1103
|
+
layout: w
|
|
1076
1104
|
}, !1, "unregisterWidget"), i();
|
|
1077
1105
|
});
|
|
1078
1106
|
}
|
|
@@ -1085,41 +1113,41 @@ const hr = (e, t) => {
|
|
|
1085
1113
|
return n.push(t), n;
|
|
1086
1114
|
const i = "beforeWidgetId" in s ? s.beforeWidgetId : s.afterWidgetId, r = n.findIndex((o) => o.widgetId === i);
|
|
1087
1115
|
return r < 0 ? (n.push(t), n) : (n.splice(r + ("afterWidgetId" in s ? 1 : 0), 0, t), n);
|
|
1088
|
-
},
|
|
1116
|
+
}, K = (e, t, s) => {
|
|
1089
1117
|
if (t.tabRetention !== "preview") return G(e, t, s);
|
|
1090
1118
|
const n = e.filter((i) => i.tabRetention !== "preview" && i.widgetId !== t.widgetId);
|
|
1091
1119
|
return G(n, t, "start");
|
|
1092
|
-
},
|
|
1120
|
+
}, pt = (e, t, s) => {
|
|
1093
1121
|
const n = e.find((r) => r.widgetId === t);
|
|
1094
1122
|
if (!n) return e;
|
|
1095
1123
|
if (n.tabRetention === "preview")
|
|
1096
1124
|
throw new Error(`Preview widget cannot be reordered: ${t}`);
|
|
1097
1125
|
const i = e.filter((r) => r.widgetId !== t);
|
|
1098
1126
|
return G(i, n, s);
|
|
1099
|
-
},
|
|
1127
|
+
}, Rt = (e, t) => {
|
|
1100
1128
|
let s = e;
|
|
1101
1129
|
for (const i of Object.values(e.regions)) {
|
|
1102
1130
|
const r = i.widgets.filter(t);
|
|
1103
1131
|
if (r.length === 0) continue;
|
|
1104
|
-
const o =
|
|
1132
|
+
const o = _(i);
|
|
1105
1133
|
s = A(s, i.id, (c) => c.filter((u) => !t(u)), {
|
|
1106
1134
|
clearActiveWidget: o ? t(o) : !1
|
|
1107
1135
|
});
|
|
1108
1136
|
for (const c of r)
|
|
1109
|
-
s =
|
|
1137
|
+
s = Pe(s, c.widgetId);
|
|
1110
1138
|
}
|
|
1111
1139
|
return s.activeWidgetId && Object.values(s.regions).flatMap((i) => i.widgets).find((i) => i.widgetId === s.activeWidgetId) || (s = {
|
|
1112
1140
|
...s,
|
|
1113
1141
|
activeWidgetId: void 0,
|
|
1114
1142
|
activeResourceUri: void 0
|
|
1115
1143
|
}), s;
|
|
1116
|
-
},
|
|
1144
|
+
}, wt = (e, t) => Rt(e, (s) => s.tabRetention === "preview" && (t === void 0 || s.ownerResourceUri !== t)), Pt = (e) => ({
|
|
1117
1145
|
updateWidgetPlacement(t, s) {
|
|
1118
1146
|
const n = e.getLayout();
|
|
1119
1147
|
for (const i of Object.values(n.regions)) {
|
|
1120
1148
|
const r = i.widgets.findIndex((f) => f.widgetId === t);
|
|
1121
1149
|
if (r < 0) continue;
|
|
1122
|
-
const o = e.requireWidget(i.widgets[r].contributionId), c =
|
|
1150
|
+
const o = e.requireWidget(i.widgets[r].contributionId), c = j(i.widgets[r], o, s), u = A(n, i.id, (f) => f.map((m, a) => a === r ? c : m));
|
|
1123
1151
|
return e.setLayout(u), e.persistLayout(), c;
|
|
1124
1152
|
}
|
|
1125
1153
|
throw new Error(`Widget placement not found: ${t}`);
|
|
@@ -1128,13 +1156,13 @@ const hr = (e, t) => {
|
|
|
1128
1156
|
const n = e.getLayout();
|
|
1129
1157
|
for (const i of Object.values(n.regions))
|
|
1130
1158
|
if (i.widgets.some((r) => r.widgetId === t)) {
|
|
1131
|
-
e.setLayout(A(n, i.id, (r) =>
|
|
1159
|
+
e.setLayout(A(n, i.id, (r) => pt(r, t, s))), e.persistLayout();
|
|
1132
1160
|
return;
|
|
1133
1161
|
}
|
|
1134
1162
|
throw new Error(`Widget placement not found: ${t}`);
|
|
1135
1163
|
},
|
|
1136
1164
|
expirePreviewTabs(t) {
|
|
1137
|
-
e.setLayout(
|
|
1165
|
+
e.setLayout(wt(e.getLayout(), t)), e.persistLayout();
|
|
1138
1166
|
},
|
|
1139
1167
|
activateWidget(t) {
|
|
1140
1168
|
const s = e.getLayout();
|
|
@@ -1144,7 +1172,7 @@ const hr = (e, t) => {
|
|
|
1144
1172
|
}
|
|
1145
1173
|
throw new Error(`Widget placement not found: ${t}`);
|
|
1146
1174
|
}
|
|
1147
|
-
}),
|
|
1175
|
+
}), It = (e, t) => {
|
|
1148
1176
|
const s = {
|
|
1149
1177
|
...t.regions
|
|
1150
1178
|
};
|
|
@@ -1162,7 +1190,7 @@ const hr = (e, t) => {
|
|
|
1162
1190
|
...t,
|
|
1163
1191
|
regions: s
|
|
1164
1192
|
};
|
|
1165
|
-
},
|
|
1193
|
+
}, Ct = (e, t, s) => {
|
|
1166
1194
|
if (s.length === 0) return t;
|
|
1167
1195
|
const n = {
|
|
1168
1196
|
...t.regions
|
|
@@ -1172,17 +1200,17 @@ const hr = (e, t) => {
|
|
|
1172
1200
|
...t,
|
|
1173
1201
|
regions: n
|
|
1174
1202
|
};
|
|
1175
|
-
},
|
|
1203
|
+
}, ae = (e, t) => t ? be(t, e) : Be(e), ce = () => {
|
|
1176
1204
|
const e = /* @__PURE__ */ new Set();
|
|
1177
1205
|
return {
|
|
1178
1206
|
notify(t) {
|
|
1179
1207
|
for (const s of e) s(t);
|
|
1180
1208
|
},
|
|
1181
1209
|
subscribe(t) {
|
|
1182
|
-
return e.add(t),
|
|
1210
|
+
return e.add(t), I(() => e.delete(t));
|
|
1183
1211
|
}
|
|
1184
1212
|
};
|
|
1185
|
-
},
|
|
1213
|
+
}, Wt = (e) => {
|
|
1186
1214
|
for (const t of e.widget.ownedPanelMenuIds ?? []) {
|
|
1187
1215
|
const s = e.requireWidget(t);
|
|
1188
1216
|
e.openWidget(t, {
|
|
@@ -1191,12 +1219,14 @@ const hr = (e, t) => {
|
|
|
1191
1219
|
title: s.region === "main-left-menu" ? e.placement.resource?.label : s.title
|
|
1192
1220
|
});
|
|
1193
1221
|
}
|
|
1194
|
-
},
|
|
1222
|
+
}, kt = (e, t, s) => {
|
|
1195
1223
|
if (!(!e.singleton && e.reuse === "none")) {
|
|
1196
1224
|
if (e.role === "sub-panel" || e.role === "panel-menu") {
|
|
1197
1225
|
const n = B(t)?.resourceUri;
|
|
1198
1226
|
for (const i of Object.values(t.regions)) {
|
|
1199
|
-
const r = i.widgets.findIndex((o) => o.contributionId === e.id &&
|
|
1227
|
+
const r = i.widgets.findIndex((o) => o.contributionId === e.id && // Pinned placements are structural chrome, not per-location content, so they are
|
|
1228
|
+
// reused across location switches instead of accumulating one instance per owner.
|
|
1229
|
+
(o.pinned === !0 || o.ownerResourceUri === n) && (!s.resource || o.resourceUri === s.resource.uri));
|
|
1200
1230
|
if (r >= 0) return {
|
|
1201
1231
|
regionId: i.id,
|
|
1202
1232
|
index: r,
|
|
@@ -1205,9 +1235,9 @@ const hr = (e, t) => {
|
|
|
1205
1235
|
}
|
|
1206
1236
|
return;
|
|
1207
1237
|
}
|
|
1208
|
-
return e.singleton ?
|
|
1238
|
+
return e.singleton ? Z(t, e.id) : s.resource ? ye(t, e.id, s.resource.uri) : Z(t, e.id);
|
|
1209
1239
|
}
|
|
1210
|
-
},
|
|
1240
|
+
}, Lt = (e, t, s, n) => {
|
|
1211
1241
|
const i = e.regions[t], r = s.role === "location" ? e.activeLocationWidgetId : i.activeWidgetId;
|
|
1212
1242
|
if (n.replaceWidgetId)
|
|
1213
1243
|
return i.widgets.findIndex((c) => c.widgetId === n.replaceWidgetId);
|
|
@@ -1216,7 +1246,18 @@ const hr = (e, t) => {
|
|
|
1216
1246
|
if (!n.replaceActive) return -1;
|
|
1217
1247
|
const o = t === "main" && n.resource && e.activeLocationWidgetId ? e.activeLocationWidgetId : r;
|
|
1218
1248
|
return i.widgets.findIndex((c) => c.widgetId === o && !c.pinned);
|
|
1219
|
-
}, Tt = (e) => {
|
|
1249
|
+
}, Tt = (e, t, s) => {
|
|
1250
|
+
const n = e.find((i) => {
|
|
1251
|
+
try {
|
|
1252
|
+
return t.priority > s(i.contributionId).priority;
|
|
1253
|
+
} catch {
|
|
1254
|
+
return t.priority > 0;
|
|
1255
|
+
}
|
|
1256
|
+
});
|
|
1257
|
+
return n ? {
|
|
1258
|
+
beforeWidgetId: n.widgetId
|
|
1259
|
+
} : void 0;
|
|
1260
|
+
}, Et = (e) => {
|
|
1220
1261
|
const {
|
|
1221
1262
|
getLayout: t,
|
|
1222
1263
|
requireWidget: s,
|
|
@@ -1225,81 +1266,87 @@ const hr = (e, t) => {
|
|
|
1225
1266
|
...m,
|
|
1226
1267
|
ownerResourceUri: B(d)?.resourceUri
|
|
1227
1268
|
}, r = (m, a, d) => {
|
|
1228
|
-
const l = i(
|
|
1229
|
-
const
|
|
1230
|
-
return d.tabPosition ?
|
|
1269
|
+
const l = i(j(a.placement, m, d), m, t()), y = A(t(), a.regionId, (S) => {
|
|
1270
|
+
const w = S.map((v, h) => h === a.index ? l : v);
|
|
1271
|
+
return d.tabPosition ? K(w.filter((v) => v.widgetId !== l.widgetId), l, d.tabPosition) : w;
|
|
1231
1272
|
});
|
|
1232
|
-
return n(
|
|
1233
|
-
}, o = (m, a, d, l,
|
|
1234
|
-
const
|
|
1235
|
-
const h =
|
|
1236
|
-
return
|
|
1273
|
+
return n(y, a.regionId, l);
|
|
1274
|
+
}, o = (m, a, d, l, y) => {
|
|
1275
|
+
const S = i(j(l, m, y), m, t()), w = A(t(), a, (v) => {
|
|
1276
|
+
const h = v.map((R, C) => C === d ? S : R);
|
|
1277
|
+
return S.tabRetention !== "preview" ? h : K(h, S, "start");
|
|
1237
1278
|
});
|
|
1238
|
-
return n(
|
|
1239
|
-
}, c = (m, a, d, l,
|
|
1240
|
-
if (
|
|
1279
|
+
return n(w, a, S);
|
|
1280
|
+
}, c = (m, a, d, l, y) => {
|
|
1281
|
+
if (y.tabRetention === "preview" && a.placement.tabRetention !== "preview")
|
|
1241
1282
|
return n(t(), a.regionId, a.placement);
|
|
1242
1283
|
if (a.regionId !== d) {
|
|
1243
|
-
const
|
|
1284
|
+
const v = i(j(a.placement, m, y), m, t()), h = A(t(), a.regionId, (C) => C.filter((E, M) => M !== a.index), {
|
|
1244
1285
|
clearActiveWidget: t().regions[a.regionId].activeWidgetId === a.placement.widgetId
|
|
1245
1286
|
}), R = A(h, d, (C) => {
|
|
1246
|
-
if (l < 0) return
|
|
1247
|
-
const
|
|
1248
|
-
return
|
|
1287
|
+
if (l < 0) return K(C, v, y.tabPosition);
|
|
1288
|
+
const E = [...C];
|
|
1289
|
+
return E.splice(l, 1, v), v.tabRetention === "preview" ? K(E, v, "start") : E;
|
|
1249
1290
|
});
|
|
1250
|
-
return n(R, d,
|
|
1291
|
+
return n(R, d, v);
|
|
1251
1292
|
}
|
|
1252
1293
|
if (l < 0 || a.index === l)
|
|
1253
|
-
return r(m, a,
|
|
1254
|
-
const
|
|
1255
|
-
return n(
|
|
1294
|
+
return r(m, a, y);
|
|
1295
|
+
const S = i(j(a.placement, m, y), m, t()), w = A(t(), d, (v) => K(v.map((h, R) => R === a.index ? S : h).filter((h, R) => R !== l && R !== a.index), S, y.tabPosition));
|
|
1296
|
+
return n(w, d, S);
|
|
1256
1297
|
}, u = (m, a, d, l) => {
|
|
1257
|
-
const
|
|
1258
|
-
if (d < 0)
|
|
1259
|
-
|
|
1260
|
-
|
|
1298
|
+
const y = Ie(t(), m.id), S = i(Ce(y, m, l), m, t()), w = A(t(), a, (v) => {
|
|
1299
|
+
if (d < 0)
|
|
1300
|
+
return K(v, S, l.tabPosition ?? Tt(v, m, s));
|
|
1301
|
+
const h = [...v];
|
|
1302
|
+
return h.splice(d, 1, S), S.tabRetention === "preview" ? K(h, S, "start") : h;
|
|
1261
1303
|
});
|
|
1262
|
-
return n(
|
|
1304
|
+
return n(w, a, S);
|
|
1263
1305
|
}, f = (m, a = {}) => {
|
|
1264
|
-
const d = s(m), l = t(),
|
|
1306
|
+
const d = s(m), l = t(), y = a.region ?? d.region ?? d.fallbackRegion ?? "main", S = l.regions[y], w = Lt(l, y, d, a), v = w >= 0 ? S.widgets[w] : void 0, h = !a.replaceWidgetId && a.tabRetention === "preview" && a.resource ? ye(l, d.id, a.resource.uri) : void 0, R = a.replaceWidgetId && v ? void 0 : kt(d, l, a);
|
|
1265
1307
|
let C;
|
|
1266
|
-
return h ? C = n(l, h.regionId, h.placement) : R ? C = c(d, R,
|
|
1308
|
+
return h ? C = n(l, h.regionId, h.placement) : R ? C = c(d, R, y, w, a) : v?.contributionId === d.id ? C = o(d, y, w, v, a) : C = u(d, y, w, a), Wt({
|
|
1267
1309
|
openWidget: f,
|
|
1268
1310
|
placement: C,
|
|
1269
1311
|
requireWidget: s,
|
|
1270
1312
|
widget: d
|
|
1271
|
-
}), n(t(), h?.regionId ??
|
|
1313
|
+
}), n(t(), h?.regionId ?? y, C);
|
|
1272
1314
|
};
|
|
1273
1315
|
return {
|
|
1274
1316
|
openWidget: f
|
|
1275
1317
|
};
|
|
1276
|
-
}, xt = (e) =>
|
|
1318
|
+
}, xt = (e, t) => {
|
|
1319
|
+
if (t.pinned) return "persistent";
|
|
1320
|
+
const s = t.region ?? e.region ?? e.fallbackRegion ?? "main";
|
|
1321
|
+
return F.includes(s) ? "preview" : "persistent";
|
|
1322
|
+
}, Mt = (e) => ({
|
|
1277
1323
|
getPanel(t) {
|
|
1278
1324
|
const s = e.getWidgets()[t];
|
|
1279
|
-
return s ?
|
|
1325
|
+
return s ? te(s) : void 0;
|
|
1280
1326
|
},
|
|
1281
|
-
listPanels: () => e.listWidgets().map(
|
|
1327
|
+
listPanels: () => e.listWidgets().map(te),
|
|
1282
1328
|
listPanelInstances(t) {
|
|
1283
|
-
return (t ? e.getLayout().regions[t].widgets : Object.values(e.getLayout().regions).flatMap((n) => n.widgets)).map(
|
|
1329
|
+
return (t ? e.getLayout().regions[t].widgets : Object.values(e.getLayout().regions).flatMap((n) => n.widgets)).map(N);
|
|
1284
1330
|
},
|
|
1285
1331
|
getActivePanel(t) {
|
|
1286
1332
|
if (t) {
|
|
1287
1333
|
const i = e.getLayout().regions[t], r = i.widgets.find((o) => o.widgetId === i.activeWidgetId) ?? i.widgets[0];
|
|
1288
|
-
return r ?
|
|
1334
|
+
return r ? N(r) : void 0;
|
|
1289
1335
|
}
|
|
1290
1336
|
const s = e.getLayout().activeWidgetId;
|
|
1291
1337
|
if (!s) return;
|
|
1292
1338
|
const n = $(e.getLayout(), s);
|
|
1293
|
-
return n ?
|
|
1339
|
+
return n ? N(n.placement) : void 0;
|
|
1294
1340
|
},
|
|
1295
1341
|
openPanel(t, s = {}) {
|
|
1296
|
-
|
|
1297
|
-
|
|
1342
|
+
const n = e.getWidgets()[t];
|
|
1343
|
+
if (!n) throw new Error(`Panel not registered: ${t}`);
|
|
1344
|
+
return N(e.widgetOpeners.openWidget(t, ee(s, xt(n, s))));
|
|
1298
1345
|
},
|
|
1299
1346
|
updatePanel(t, s) {
|
|
1300
1347
|
if (!$(e.getLayout(), t))
|
|
1301
1348
|
throw new Error(`Panel instance not found: ${t}`);
|
|
1302
|
-
return
|
|
1349
|
+
return N(e.placementMethods.updateWidgetPlacement(t, ee(s)));
|
|
1303
1350
|
},
|
|
1304
1351
|
reorderPanel(t, s) {
|
|
1305
1352
|
if (!$(e.getLayout(), t))
|
|
@@ -1309,7 +1356,7 @@ const hr = (e, t) => {
|
|
|
1309
1356
|
activatePanel(t) {
|
|
1310
1357
|
if (!$(e.getLayout(), t))
|
|
1311
1358
|
throw new Error(`Panel instance not found: ${t}`);
|
|
1312
|
-
return
|
|
1359
|
+
return N(e.placementMethods.activateWidget(t));
|
|
1313
1360
|
},
|
|
1314
1361
|
closePanel(t) {
|
|
1315
1362
|
const s = $(e.getLayout(), t);
|
|
@@ -1317,17 +1364,17 @@ const hr = (e, t) => {
|
|
|
1317
1364
|
if (s.placement.closable !== !0) throw new Error(`Panel cannot be closed: ${t}`);
|
|
1318
1365
|
const n = Q(e.getLayout(), t);
|
|
1319
1366
|
if (!n) throw new Error(`Panel instance not found: ${t}`);
|
|
1320
|
-
return e.setLayout(n.layout), e.persistLayout(), n.activePlacement ?
|
|
1367
|
+
return e.setLayout(n.layout), e.persistLayout(), n.activePlacement ? N(n.activePlacement) : void 0;
|
|
1321
1368
|
}
|
|
1322
|
-
}),
|
|
1369
|
+
}), Dt = (e, t, s) => {
|
|
1323
1370
|
const {
|
|
1324
1371
|
side: n,
|
|
1325
1372
|
...i
|
|
1326
|
-
} = t, r = e.region, o =
|
|
1373
|
+
} = t, r = e.region, o = F.find((c) => c === e.fallbackRegion);
|
|
1327
1374
|
return {
|
|
1328
1375
|
...i,
|
|
1329
|
-
region:
|
|
1330
|
-
fallbackRegion: o ?
|
|
1376
|
+
region: ne[r][n],
|
|
1377
|
+
fallbackRegion: o ? ne[o][n] : void 0,
|
|
1331
1378
|
panelMenuOwner: {
|
|
1332
1379
|
level: s === "sub-panel" ? "sub-panel" : "panel",
|
|
1333
1380
|
contributionId: e.id
|
|
@@ -1345,7 +1392,7 @@ const hr = (e, t) => {
|
|
|
1345
1392
|
panelMenus: o = [],
|
|
1346
1393
|
...c
|
|
1347
1394
|
} = n, u = [];
|
|
1348
|
-
if (o.length > 0 && !
|
|
1395
|
+
if (o.length > 0 && !F.includes(n.region))
|
|
1349
1396
|
throw new Error(`Panel Menus require a Panel region: ${n.id}`);
|
|
1350
1397
|
try {
|
|
1351
1398
|
const f = {
|
|
@@ -1356,15 +1403,15 @@ const hr = (e, t) => {
|
|
|
1356
1403
|
};
|
|
1357
1404
|
u.push(i(f, s));
|
|
1358
1405
|
for (const m of o)
|
|
1359
|
-
u.push(i(
|
|
1406
|
+
u.push(i(Dt(n, m, r), s));
|
|
1360
1407
|
} catch (f) {
|
|
1361
1408
|
for (const m of u.reverse()) m.dispose();
|
|
1362
1409
|
throw f;
|
|
1363
1410
|
}
|
|
1364
|
-
return
|
|
1411
|
+
return I(() => {
|
|
1365
1412
|
for (const f of u.reverse()) f.dispose();
|
|
1366
1413
|
});
|
|
1367
|
-
},
|
|
1414
|
+
}, Bt = (e) => {
|
|
1368
1415
|
const t = (o) => o.eligibleLocations ? "sub-panel" : "content";
|
|
1369
1416
|
return {
|
|
1370
1417
|
registerPanel: (o, c) => z({
|
|
@@ -1391,10 +1438,11 @@ const hr = (e, t) => {
|
|
|
1391
1438
|
role: "panel-menu"
|
|
1392
1439
|
}, c)
|
|
1393
1440
|
};
|
|
1394
|
-
},
|
|
1441
|
+
}, Ot = (e) => (t) => {
|
|
1395
1442
|
const s = e.getLayout(), n = $(s, t);
|
|
1396
1443
|
if (!n) throw new Error(`Panel instance not found: ${t}`);
|
|
1397
|
-
if (n.regionId !== "main"
|
|
1444
|
+
if (n.regionId !== "main" || n.placement.role === "sub-panel" || n.placement.role === "panel-menu")
|
|
1445
|
+
return e.panelMethods.activatePanel(t);
|
|
1398
1446
|
const i = {
|
|
1399
1447
|
...n.placement,
|
|
1400
1448
|
role: "location"
|
|
@@ -1405,74 +1453,78 @@ const hr = (e, t) => {
|
|
|
1405
1453
|
ownerResourceUri: i.resourceUri
|
|
1406
1454
|
})
|
|
1407
1455
|
}]));
|
|
1408
|
-
|
|
1456
|
+
if (e.applyAndActivate({
|
|
1409
1457
|
...s,
|
|
1410
1458
|
regions: o
|
|
1411
|
-
}, "main", i), e.
|
|
1412
|
-
|
|
1459
|
+
}, "main", i), e.getWidget(i.contributionId)?.subPanelsOnly) {
|
|
1460
|
+
const c = e.getLayout().regions.main.widgets.find((u) => u.role === "sub-panel" && (!u.ownerResourceUri || u.ownerResourceUri === i.resourceUri));
|
|
1461
|
+
if (c) return e.panelMethods.activatePanel(c.widgetId);
|
|
1462
|
+
}
|
|
1463
|
+
return e.panelMethods.getActivePanel("main");
|
|
1464
|
+
}, At = (e, t) => {
|
|
1413
1465
|
const s = e[t];
|
|
1414
1466
|
if (!s) throw new Error(`Widget not registered: ${t}`);
|
|
1415
1467
|
return s;
|
|
1416
|
-
},
|
|
1468
|
+
}, $t = (e = {}) => {
|
|
1417
1469
|
let t;
|
|
1418
|
-
const s =
|
|
1470
|
+
const s = ce(), n = ce(), i = e.persistence?.getLayout(t), r = ae(e.defaultRegionVisibility, i), o = L({
|
|
1419
1471
|
name: "workbench.layout",
|
|
1420
1472
|
initialState: {
|
|
1421
1473
|
layout: r,
|
|
1422
1474
|
widgets: {},
|
|
1423
1475
|
placeholders: {}
|
|
1424
1476
|
}
|
|
1425
|
-
}), c = () => o.getState().layout, u = () => o.getState().placeholders, f = () => o.getState().widgets, m = (g) => u()[g], a =
|
|
1477
|
+
}), c = () => o.getState().layout, u = () => o.getState().placeholders, f = () => o.getState().widgets, m = (g) => u()[g], a = bt({
|
|
1426
1478
|
getLayout: c,
|
|
1427
1479
|
getWidgets: f,
|
|
1428
1480
|
getPlaceholder: m
|
|
1429
|
-
}), d =
|
|
1481
|
+
}), d = St({
|
|
1430
1482
|
getPlaceholders: u,
|
|
1431
1483
|
getWidgets: f
|
|
1432
|
-
}), l = () => e.persistence?.setLayout(
|
|
1433
|
-
const
|
|
1434
|
-
|
|
1435
|
-
...
|
|
1484
|
+
}), l = () => e.persistence?.setLayout(c(), t), y = (g) => At(f(), g), S = (g) => {
|
|
1485
|
+
const b = o.getState();
|
|
1486
|
+
b.layout !== g && o.setState({
|
|
1487
|
+
...b,
|
|
1436
1488
|
layout: g
|
|
1437
1489
|
}, !1, "setLayout");
|
|
1438
|
-
},
|
|
1439
|
-
const p = c(),
|
|
1440
|
-
W !==
|
|
1490
|
+
}, w = (g, b) => {
|
|
1491
|
+
const p = c(), P = p.regions[g], W = b(P);
|
|
1492
|
+
W !== P && (S({
|
|
1441
1493
|
...p,
|
|
1442
1494
|
regions: {
|
|
1443
1495
|
...p.regions,
|
|
1444
1496
|
[g]: W
|
|
1445
1497
|
}
|
|
1446
1498
|
}), l());
|
|
1447
|
-
},
|
|
1499
|
+
}, v = (g, b, p) => (S(We(g, b, p)), l(), p), h = vt({
|
|
1448
1500
|
store: o,
|
|
1449
1501
|
getPlaceholders: u,
|
|
1450
1502
|
getWidgets: f,
|
|
1451
1503
|
persistLayout: l
|
|
1452
|
-
}), R =
|
|
1504
|
+
}), R = Bt({
|
|
1453
1505
|
registerWidget: h.registerWidget
|
|
1454
|
-
}), C =
|
|
1506
|
+
}), C = Et({
|
|
1455
1507
|
getLayout: c,
|
|
1456
|
-
requireWidget:
|
|
1457
|
-
applyAndActivate:
|
|
1458
|
-
}),
|
|
1508
|
+
requireWidget: y,
|
|
1509
|
+
applyAndActivate: v
|
|
1510
|
+
}), E = Pt({
|
|
1459
1511
|
getLayout: c,
|
|
1460
|
-
requireWidget:
|
|
1461
|
-
setLayout:
|
|
1512
|
+
requireWidget: y,
|
|
1513
|
+
setLayout: S,
|
|
1462
1514
|
persistLayout: l,
|
|
1463
|
-
applyAndActivate:
|
|
1464
|
-
}), M =
|
|
1515
|
+
applyAndActivate: v
|
|
1516
|
+
}), M = Mt({
|
|
1465
1517
|
getLayout: c,
|
|
1466
1518
|
getWidgets: f,
|
|
1467
1519
|
listWidgets: d.listWidgets,
|
|
1468
1520
|
persistLayout: l,
|
|
1469
|
-
placementMethods:
|
|
1470
|
-
setLayout:
|
|
1521
|
+
placementMethods: E,
|
|
1522
|
+
setLayout: S,
|
|
1471
1523
|
widgetOpeners: C
|
|
1472
|
-
}),
|
|
1473
|
-
applyAndActivate:
|
|
1524
|
+
}), U = Ot({
|
|
1525
|
+
applyAndActivate: v,
|
|
1474
1526
|
getLayout: c,
|
|
1475
|
-
getWidget:
|
|
1527
|
+
getWidget: y,
|
|
1476
1528
|
panelMethods: M
|
|
1477
1529
|
});
|
|
1478
1530
|
return {
|
|
@@ -1480,18 +1532,18 @@ const hr = (e, t) => {
|
|
|
1480
1532
|
registerPlaceholder: h.registerPlaceholder,
|
|
1481
1533
|
registerWidget: h.registerWidget,
|
|
1482
1534
|
...R,
|
|
1483
|
-
unregisterWidget(g,
|
|
1535
|
+
unregisterWidget(g, b = {}) {
|
|
1484
1536
|
const p = o.getState();
|
|
1485
1537
|
if (!p.widgets[g]) return;
|
|
1486
1538
|
const {
|
|
1487
|
-
[g]:
|
|
1539
|
+
[g]: P,
|
|
1488
1540
|
...W
|
|
1489
|
-
} = p.widgets, k =
|
|
1541
|
+
} = p.widgets, k = b.removePlacements === !1 ? p.layout : he(p.layout, g);
|
|
1490
1542
|
o.setState({
|
|
1491
1543
|
...p,
|
|
1492
1544
|
widgets: W,
|
|
1493
1545
|
layout: k
|
|
1494
|
-
}, !1, "unregisterWidget"),
|
|
1546
|
+
}, !1, "unregisterWidget"), b.persist !== !1 && l();
|
|
1495
1547
|
},
|
|
1496
1548
|
getWidget(g) {
|
|
1497
1549
|
return f()[g];
|
|
@@ -1500,58 +1552,58 @@ const hr = (e, t) => {
|
|
|
1500
1552
|
getRegionSize: a.getRegionSize,
|
|
1501
1553
|
getRegionCollapsible: a.getRegionCollapsible,
|
|
1502
1554
|
getRegionHeaderBorderBottom: a.getRegionHeaderBorderBottom,
|
|
1503
|
-
setRegionVisible(g,
|
|
1504
|
-
|
|
1555
|
+
setRegionVisible(g, b) {
|
|
1556
|
+
w(g, (p) => p.visible === b ? p : {
|
|
1505
1557
|
...p,
|
|
1506
|
-
visible:
|
|
1558
|
+
visible: b
|
|
1507
1559
|
});
|
|
1508
1560
|
},
|
|
1509
|
-
setRegionSize(g,
|
|
1510
|
-
|
|
1561
|
+
setRegionSize(g, b) {
|
|
1562
|
+
w(g, (p) => p.size === b ? p : {
|
|
1511
1563
|
...p,
|
|
1512
|
-
size:
|
|
1564
|
+
size: b
|
|
1513
1565
|
});
|
|
1514
1566
|
},
|
|
1515
1567
|
listPlaceholders: d.listPlaceholders,
|
|
1516
1568
|
listWidgets: d.listWidgets,
|
|
1517
1569
|
...M,
|
|
1518
1570
|
openWidget: C.openWidget,
|
|
1519
|
-
...
|
|
1520
|
-
establishLocation:
|
|
1521
|
-
setRegionActiveWidget(g,
|
|
1522
|
-
const p = c(),
|
|
1523
|
-
if (
|
|
1524
|
-
if (
|
|
1571
|
+
...E,
|
|
1572
|
+
establishLocation: U,
|
|
1573
|
+
setRegionActiveWidget(g, b) {
|
|
1574
|
+
const p = c(), P = p.regions[g], W = b ? P.widgets.find((V) => V.widgetId === b) : void 0;
|
|
1575
|
+
if (b && !W) throw new Error(`Widget placement not found in ${g}: ${b}`);
|
|
1576
|
+
if (P.activeWidgetId === b) return;
|
|
1525
1577
|
const k = {
|
|
1526
1578
|
...p,
|
|
1527
|
-
activeWidgetId: p.activeWidgetId ===
|
|
1528
|
-
activeResourceUri: p.activeWidgetId ===
|
|
1579
|
+
activeWidgetId: p.activeWidgetId === P.activeWidgetId ? W?.widgetId : p.activeWidgetId,
|
|
1580
|
+
activeResourceUri: p.activeWidgetId === P.activeWidgetId ? W?.resourceUri : p.activeResourceUri,
|
|
1529
1581
|
regions: {
|
|
1530
1582
|
...p.regions,
|
|
1531
1583
|
[g]: {
|
|
1532
|
-
...
|
|
1584
|
+
...P,
|
|
1533
1585
|
activeWidgetId: W?.widgetId
|
|
1534
1586
|
}
|
|
1535
1587
|
}
|
|
1536
|
-
}, x = g !== "side" &&
|
|
1537
|
-
|
|
1588
|
+
}, x = g !== "side" && F.includes(g) ? re(k, B(k), g, W?.role === "sub-panel" ? W.widgetId : void 0) : k;
|
|
1589
|
+
S(x), l();
|
|
1538
1590
|
},
|
|
1539
1591
|
closeWidget(g) {
|
|
1540
|
-
const
|
|
1541
|
-
if (!
|
|
1542
|
-
if (
|
|
1543
|
-
return
|
|
1592
|
+
const b = Q(c(), g);
|
|
1593
|
+
if (!b) throw new Error(`Widget placement not found: ${g}`);
|
|
1594
|
+
if (b.closedPlacement.closable !== !0) throw new Error(`Widget cannot be closed: ${g}`);
|
|
1595
|
+
return S(b.layout), l(), b.activePlacement;
|
|
1544
1596
|
},
|
|
1545
1597
|
removeWidgetPlacement(g) {
|
|
1546
|
-
const
|
|
1547
|
-
if (
|
|
1548
|
-
return
|
|
1598
|
+
const b = Q(c(), g);
|
|
1599
|
+
if (b)
|
|
1600
|
+
return S(b.layout), l(), b.activePlacement;
|
|
1549
1601
|
},
|
|
1550
1602
|
clearRegion(g) {
|
|
1551
|
-
const
|
|
1552
|
-
...
|
|
1603
|
+
const b = c(), p = b.regions[g], P = p.activeWidgetId, W = {
|
|
1604
|
+
...b,
|
|
1553
1605
|
regions: {
|
|
1554
|
-
...
|
|
1606
|
+
...b.regions,
|
|
1555
1607
|
[g]: {
|
|
1556
1608
|
...p,
|
|
1557
1609
|
widgets: [],
|
|
@@ -1559,23 +1611,23 @@ const hr = (e, t) => {
|
|
|
1559
1611
|
}
|
|
1560
1612
|
}
|
|
1561
1613
|
};
|
|
1562
|
-
let k =
|
|
1614
|
+
let k = P && b.activeWidgetId === P ? {
|
|
1563
1615
|
...W,
|
|
1564
1616
|
activeWidgetId: void 0,
|
|
1565
1617
|
activeResourceUri: void 0
|
|
1566
1618
|
} : W;
|
|
1567
|
-
g !== "side" &&
|
|
1619
|
+
g !== "side" && F.includes(g) && (k = re(k, B(k), g, void 0)), S(k), l();
|
|
1568
1620
|
},
|
|
1569
1621
|
resetRegions() {
|
|
1570
|
-
const g = c(),
|
|
1571
|
-
for (const [p,
|
|
1572
|
-
|
|
1573
|
-
...
|
|
1622
|
+
const g = c(), b = {};
|
|
1623
|
+
for (const [p, P] of Object.entries(g.regions))
|
|
1624
|
+
b[p] = {
|
|
1625
|
+
...P,
|
|
1574
1626
|
widgets: [],
|
|
1575
1627
|
activeWidgetId: void 0
|
|
1576
1628
|
};
|
|
1577
|
-
|
|
1578
|
-
regions:
|
|
1629
|
+
S({
|
|
1630
|
+
regions: b,
|
|
1579
1631
|
locationSubPanelSelections: {},
|
|
1580
1632
|
activeWidgetId: void 0,
|
|
1581
1633
|
activeLocationWidgetId: void 0,
|
|
@@ -1584,12 +1636,12 @@ const hr = (e, t) => {
|
|
|
1584
1636
|
},
|
|
1585
1637
|
getLayout: c,
|
|
1586
1638
|
restoreLayout(g) {
|
|
1587
|
-
|
|
1639
|
+
S(be(g, e.defaultRegionVisibility)), l();
|
|
1588
1640
|
},
|
|
1589
|
-
setPersistenceScope(g,
|
|
1641
|
+
setPersistenceScope(g, b = {}) {
|
|
1590
1642
|
if (t === g) return;
|
|
1591
|
-
e.persistence?.setLayout(
|
|
1592
|
-
const p = e.persistence?.getLayout(t),
|
|
1643
|
+
e.persistence?.setLayout(c(), t), s.notify(g), t = g;
|
|
1644
|
+
const p = e.persistence?.getLayout(t), P = ae(e.defaultRegionVisibility, p), W = It(c(), P), k = Ct(c(), W, b.carryRegionState ?? []), x = o.getState();
|
|
1593
1645
|
o.setState({
|
|
1594
1646
|
...x,
|
|
1595
1647
|
layout: k
|
|
@@ -1599,7 +1651,7 @@ const hr = (e, t) => {
|
|
|
1599
1651
|
onWillChangePersistenceScope: s.subscribe,
|
|
1600
1652
|
onDidChangePersistenceScope: n.subscribe
|
|
1601
1653
|
};
|
|
1602
|
-
},
|
|
1654
|
+
}, de = (e) => e.join("/"), Ft = (e) => {
|
|
1603
1655
|
const t = L({
|
|
1604
1656
|
name: "workbench.menus",
|
|
1605
1657
|
initialState: {
|
|
@@ -1610,7 +1662,7 @@ const hr = (e, t) => {
|
|
|
1610
1662
|
menuStore: t,
|
|
1611
1663
|
registerMenuItem(s, n, i) {
|
|
1612
1664
|
if (!e.commands.getCommand(n.commandId)) throw new Error(`Menu command not registered: ${n.commandId}`);
|
|
1613
|
-
const r =
|
|
1665
|
+
const r = de(s), o = {
|
|
1614
1666
|
...D(i),
|
|
1615
1667
|
...n,
|
|
1616
1668
|
path: s
|
|
@@ -1620,7 +1672,7 @@ const hr = (e, t) => {
|
|
|
1620
1672
|
...c.itemsByPath,
|
|
1621
1673
|
[r]: [...u, o]
|
|
1622
1674
|
}
|
|
1623
|
-
}, !1, "registerMenuItem"),
|
|
1675
|
+
}, !1, "registerMenuItem"), I(() => {
|
|
1624
1676
|
const f = t.getState(), m = f.itemsByPath[r] ?? [], a = m.filter((d) => d !== o);
|
|
1625
1677
|
a.length !== m.length && t.setState({
|
|
1626
1678
|
itemsByPath: {
|
|
@@ -1631,23 +1683,23 @@ const hr = (e, t) => {
|
|
|
1631
1683
|
});
|
|
1632
1684
|
},
|
|
1633
1685
|
listMenuItems(s) {
|
|
1634
|
-
return [...t.getState().itemsByPath[
|
|
1686
|
+
return [...t.getState().itemsByPath[de(s)] ?? []].sort((n, i) => {
|
|
1635
1687
|
const r = n.order ?? 0, o = i.order ?? 0;
|
|
1636
1688
|
return r - o || O(n, i);
|
|
1637
1689
|
});
|
|
1638
1690
|
}
|
|
1639
1691
|
};
|
|
1640
|
-
},
|
|
1692
|
+
}, le = (e, t) => t.priority - e.priority || e.id.localeCompare(t.id), Nt = () => {
|
|
1641
1693
|
throw new Error("navigation.openTarget: no dispatcher available (configure resolveDispatcher)");
|
|
1642
|
-
},
|
|
1694
|
+
}, Kt = async (e, t) => e.kind === "resource" ? t.openResource(e.resource, e.input) : e.kind === "panel" ? t.openPanel(e.panelId, e.input) : t.executeCommand(e.commandId, e.args), Ut = (e, t) => {
|
|
1643
1695
|
if (e.kind === "resource" && t.canOpenResource?.(e.resource) === !1)
|
|
1644
1696
|
throw new Error(`Cannot open navigation resource target: ${e.resource.uri}`);
|
|
1645
1697
|
if (e.kind === "panel" && t.canOpenPanel?.(e.panelId) === !1)
|
|
1646
1698
|
throw new Error(`Cannot open navigation Panel target: ${e.panelId}`);
|
|
1647
1699
|
if (e.kind === "command" && t.canExecuteCommand?.(e.commandId) === !1)
|
|
1648
1700
|
throw new Error(`Cannot open navigation command target: ${e.commandId}`);
|
|
1649
|
-
},
|
|
1650
|
-
const t = e.resolveDispatcher ??
|
|
1701
|
+
}, jt = (e) => e.kind === "compound" ? e.targets : [e], _t = (e = {}) => {
|
|
1702
|
+
const t = e.resolveDispatcher ?? Nt, s = L({
|
|
1651
1703
|
name: "workbench.navigation",
|
|
1652
1704
|
initialState: {
|
|
1653
1705
|
parsers: {},
|
|
@@ -1680,7 +1732,7 @@ const hr = (e, t) => {
|
|
|
1680
1732
|
...c.parsers,
|
|
1681
1733
|
[r.id]: m
|
|
1682
1734
|
}
|
|
1683
|
-
}, !1, "registerParser"),
|
|
1735
|
+
}, !1, "registerParser"), I(() => {
|
|
1684
1736
|
const a = s.getState();
|
|
1685
1737
|
a.parsers[r.id] === m && s.setState({
|
|
1686
1738
|
...a,
|
|
@@ -1689,7 +1741,7 @@ const hr = (e, t) => {
|
|
|
1689
1741
|
});
|
|
1690
1742
|
},
|
|
1691
1743
|
listParsers() {
|
|
1692
|
-
return Object.values(s.getState().parsers).sort(
|
|
1744
|
+
return Object.values(s.getState().parsers).sort(le);
|
|
1693
1745
|
},
|
|
1694
1746
|
resolveLocation(r) {
|
|
1695
1747
|
const o = this.listParsers().find((c) => c.canParse(r));
|
|
@@ -1697,12 +1749,12 @@ const hr = (e, t) => {
|
|
|
1697
1749
|
return o.parse(r);
|
|
1698
1750
|
},
|
|
1699
1751
|
async openTarget(r) {
|
|
1700
|
-
const o = t(), c =
|
|
1701
|
-
for (const m of c)
|
|
1752
|
+
const o = t(), c = jt(r), u = [];
|
|
1753
|
+
for (const m of c) Ut(m, o);
|
|
1702
1754
|
const f = r.kind === "compound" ? o.createCheckpoint?.() : void 0;
|
|
1703
1755
|
try {
|
|
1704
1756
|
for (const m of c) {
|
|
1705
|
-
const a = await
|
|
1757
|
+
const a = await Kt(m, o);
|
|
1706
1758
|
u.push(a);
|
|
1707
1759
|
}
|
|
1708
1760
|
} catch (m) {
|
|
@@ -1732,7 +1784,7 @@ const hr = (e, t) => {
|
|
|
1732
1784
|
...c.navigators,
|
|
1733
1785
|
[r.id]: m
|
|
1734
1786
|
}
|
|
1735
|
-
}, !1, "registerNavigator"),
|
|
1787
|
+
}, !1, "registerNavigator"), I(() => {
|
|
1736
1788
|
const a = s.getState();
|
|
1737
1789
|
a.navigators[r.id] === m && s.setState({
|
|
1738
1790
|
...a,
|
|
@@ -1741,7 +1793,7 @@ const hr = (e, t) => {
|
|
|
1741
1793
|
});
|
|
1742
1794
|
},
|
|
1743
1795
|
listNavigators() {
|
|
1744
|
-
return Object.values(s.getState().navigators).sort(
|
|
1796
|
+
return Object.values(s.getState().navigators).sort(le);
|
|
1745
1797
|
},
|
|
1746
1798
|
createHref(r) {
|
|
1747
1799
|
const o = this.listNavigators().find((c) => c.createHref && c.canNavigate(r));
|
|
@@ -1755,7 +1807,7 @@ const hr = (e, t) => {
|
|
|
1755
1807
|
}
|
|
1756
1808
|
};
|
|
1757
1809
|
return i;
|
|
1758
|
-
},
|
|
1810
|
+
}, Ht = () => {
|
|
1759
1811
|
const e = L({
|
|
1760
1812
|
name: "workbench.notifications",
|
|
1761
1813
|
initialState: {
|
|
@@ -1816,28 +1868,28 @@ const hr = (e, t) => {
|
|
|
1816
1868
|
return Object.values(e.getState().notifications).sort((i, r) => r.createdAt.localeCompare(i.createdAt));
|
|
1817
1869
|
},
|
|
1818
1870
|
subscribe(i) {
|
|
1819
|
-
return t.add(i),
|
|
1871
|
+
return t.add(i), I(() => {
|
|
1820
1872
|
t.delete(i);
|
|
1821
1873
|
});
|
|
1822
1874
|
}
|
|
1823
1875
|
};
|
|
1824
|
-
},
|
|
1876
|
+
}, ue = (e, t) => `${e}:${t.scope}:${t.scopeId ?? ""}`, qt = () => {
|
|
1825
1877
|
const e = /* @__PURE__ */ new Map();
|
|
1826
1878
|
return {
|
|
1827
1879
|
getValue(t, s) {
|
|
1828
|
-
return e.get(
|
|
1880
|
+
return e.get(ue(t, s));
|
|
1829
1881
|
},
|
|
1830
1882
|
setValue(t, s, n) {
|
|
1831
|
-
e.set(
|
|
1883
|
+
e.set(ue(t, n), s);
|
|
1832
1884
|
}
|
|
1833
1885
|
};
|
|
1834
|
-
},
|
|
1886
|
+
}, Vt = (e = {}) => {
|
|
1835
1887
|
const t = L({
|
|
1836
1888
|
name: "workbench.preferences",
|
|
1837
1889
|
initialState: {
|
|
1838
1890
|
schemas: {}
|
|
1839
1891
|
}
|
|
1840
|
-
}), s = e.persistence ??
|
|
1892
|
+
}), s = e.persistence ?? qt();
|
|
1841
1893
|
return {
|
|
1842
1894
|
store: t,
|
|
1843
1895
|
registerSchema(n, i) {
|
|
@@ -1858,7 +1910,7 @@ const hr = (e, t) => {
|
|
|
1858
1910
|
...o.schemas,
|
|
1859
1911
|
...c
|
|
1860
1912
|
}
|
|
1861
|
-
}, !1, "registerSchema"),
|
|
1913
|
+
}, !1, "registerSchema"), I(() => {
|
|
1862
1914
|
const f = {
|
|
1863
1915
|
...t.getState().schemas
|
|
1864
1916
|
};
|
|
@@ -1886,7 +1938,7 @@ const hr = (e, t) => {
|
|
|
1886
1938
|
return r !== void 0 ? r : t.getState().schemas[n]?.default;
|
|
1887
1939
|
}
|
|
1888
1940
|
};
|
|
1889
|
-
},
|
|
1941
|
+
}, zt = (e) => {
|
|
1890
1942
|
const {
|
|
1891
1943
|
rendererRegistry: t
|
|
1892
1944
|
} = e, s = L({
|
|
@@ -1928,7 +1980,7 @@ const hr = (e, t) => {
|
|
|
1928
1980
|
controlsRendererId: o.id
|
|
1929
1981
|
})
|
|
1930
1982
|
});
|
|
1931
|
-
return
|
|
1983
|
+
return I(() => {
|
|
1932
1984
|
m.dispose();
|
|
1933
1985
|
const a = s.getState();
|
|
1934
1986
|
if (a.renderers[o.id] !== f) return;
|
|
@@ -1955,12 +2007,12 @@ const hr = (e, t) => {
|
|
|
1955
2007
|
for (const u of n) u(c);
|
|
1956
2008
|
},
|
|
1957
2009
|
onDidRefreshControlsRenderer(o) {
|
|
1958
|
-
return n.add(o),
|
|
2010
|
+
return n.add(o), I(() => {
|
|
1959
2011
|
n.delete(o);
|
|
1960
2012
|
});
|
|
1961
2013
|
}
|
|
1962
2014
|
};
|
|
1963
|
-
},
|
|
2015
|
+
}, Qt = (e) => {
|
|
1964
2016
|
const t = L({
|
|
1965
2017
|
name: "workbench.dataTableRenderers",
|
|
1966
2018
|
initialState: {
|
|
@@ -1994,7 +2046,7 @@ const hr = (e, t) => {
|
|
|
1994
2046
|
dataTableRendererId: i.id
|
|
1995
2047
|
})
|
|
1996
2048
|
});
|
|
1997
|
-
return
|
|
2049
|
+
return I(() => {
|
|
1998
2050
|
u.dispose();
|
|
1999
2051
|
const f = t.getState();
|
|
2000
2052
|
if (f.renderers[i.id] !== c) return;
|
|
@@ -2021,10 +2073,10 @@ const hr = (e, t) => {
|
|
|
2021
2073
|
for (const o of s) o(r);
|
|
2022
2074
|
},
|
|
2023
2075
|
onDidRefreshDataTableRenderer(i) {
|
|
2024
|
-
return s.add(i),
|
|
2076
|
+
return s.add(i), I(() => s.delete(i));
|
|
2025
2077
|
}
|
|
2026
2078
|
};
|
|
2027
|
-
},
|
|
2079
|
+
}, Yt = (e) => {
|
|
2028
2080
|
const {
|
|
2029
2081
|
rendererRegistry: t
|
|
2030
2082
|
} = e, s = L({
|
|
@@ -2065,7 +2117,7 @@ const hr = (e, t) => {
|
|
|
2065
2117
|
fileRendererId: o.id
|
|
2066
2118
|
})
|
|
2067
2119
|
});
|
|
2068
|
-
return
|
|
2120
|
+
return I(() => {
|
|
2069
2121
|
m.dispose();
|
|
2070
2122
|
const a = s.getState();
|
|
2071
2123
|
if (a.renderers[o.id] !== f) return;
|
|
@@ -2092,12 +2144,12 @@ const hr = (e, t) => {
|
|
|
2092
2144
|
for (const u of n) u(c);
|
|
2093
2145
|
},
|
|
2094
2146
|
onDidRefreshFileRenderer(o) {
|
|
2095
|
-
return n.add(o),
|
|
2147
|
+
return n.add(o), I(() => {
|
|
2096
2148
|
n.delete(o);
|
|
2097
2149
|
});
|
|
2098
2150
|
}
|
|
2099
2151
|
};
|
|
2100
|
-
},
|
|
2152
|
+
}, Gt = (e) => {
|
|
2101
2153
|
const {
|
|
2102
2154
|
rendererRegistry: t
|
|
2103
2155
|
} = e, s = L({
|
|
@@ -2138,7 +2190,7 @@ const hr = (e, t) => {
|
|
|
2138
2190
|
kanbanRendererId: o.id
|
|
2139
2191
|
})
|
|
2140
2192
|
});
|
|
2141
|
-
return
|
|
2193
|
+
return I(() => {
|
|
2142
2194
|
m.dispose();
|
|
2143
2195
|
const a = s.getState();
|
|
2144
2196
|
if (a.renderers[o.id] !== f) return;
|
|
@@ -2165,21 +2217,21 @@ const hr = (e, t) => {
|
|
|
2165
2217
|
for (const u of n) u(c);
|
|
2166
2218
|
},
|
|
2167
2219
|
onDidRefreshKanbanRenderer(o) {
|
|
2168
|
-
return n.add(o),
|
|
2220
|
+
return n.add(o), I(() => {
|
|
2169
2221
|
n.delete(o);
|
|
2170
2222
|
});
|
|
2171
2223
|
}
|
|
2172
2224
|
};
|
|
2173
|
-
},
|
|
2225
|
+
}, ge = (e) => ({
|
|
2174
2226
|
expandedNodeIds: [...e.defaultExpandedNodeIds ?? []],
|
|
2175
2227
|
expandedSectionIds: [...e.defaultExpandedSectionIds ?? []]
|
|
2176
|
-
}),
|
|
2228
|
+
}), Jt = (e, t) => {
|
|
2177
2229
|
const s = (t.defaultExpandedSectionIds ?? []).filter((n) => !e.expandedSectionIds.includes(n));
|
|
2178
2230
|
return s.length === 0 ? e : {
|
|
2179
2231
|
...e,
|
|
2180
2232
|
expandedSectionIds: [...e.expandedSectionIds, ...s]
|
|
2181
2233
|
};
|
|
2182
|
-
},
|
|
2234
|
+
}, fe = (e, t, s) => s ? e.includes(t) ? e : [...e, t] : e.includes(t) ? e.filter((n) => n !== t) : e, Xt = (e) => {
|
|
2183
2235
|
const {
|
|
2184
2236
|
rendererRegistry: t,
|
|
2185
2237
|
persistence: s
|
|
@@ -2199,38 +2251,38 @@ const hr = (e, t) => {
|
|
|
2199
2251
|
}, u = (a) => {
|
|
2200
2252
|
const d = i.getState(), l = d.statesByTreeId[a];
|
|
2201
2253
|
if (l) return l;
|
|
2202
|
-
const
|
|
2203
|
-
if (!
|
|
2204
|
-
const
|
|
2254
|
+
const y = d.trees[a];
|
|
2255
|
+
if (!y) throw new Error(`Tree renderer not registered: ${a}`);
|
|
2256
|
+
const S = ge(y);
|
|
2205
2257
|
return i.setState({
|
|
2206
2258
|
...d,
|
|
2207
2259
|
statesByTreeId: {
|
|
2208
2260
|
...d.statesByTreeId,
|
|
2209
|
-
[a]:
|
|
2261
|
+
[a]: S
|
|
2210
2262
|
}
|
|
2211
|
-
}, !1, "ensureTreeState"),
|
|
2263
|
+
}, !1, "ensureTreeState"), S;
|
|
2212
2264
|
}, f = () => {
|
|
2213
2265
|
if (!s) return;
|
|
2214
2266
|
const a = {};
|
|
2215
2267
|
for (const [d, l] of Object.entries(i.getState().statesByTreeId)) {
|
|
2216
2268
|
const {
|
|
2217
|
-
loading:
|
|
2218
|
-
...
|
|
2269
|
+
loading: y,
|
|
2270
|
+
...S
|
|
2219
2271
|
} = l;
|
|
2220
|
-
a[d] =
|
|
2272
|
+
a[d] = S;
|
|
2221
2273
|
}
|
|
2222
2274
|
s.setTreeStates({
|
|
2223
2275
|
statesByTreeId: a
|
|
2224
2276
|
});
|
|
2225
2277
|
}, m = (a, d, l) => {
|
|
2226
|
-
const
|
|
2227
|
-
if (
|
|
2228
|
-
const
|
|
2278
|
+
const y = u(a), S = d(y);
|
|
2279
|
+
if (S === y) return;
|
|
2280
|
+
const w = i.getState();
|
|
2229
2281
|
i.setState({
|
|
2230
|
-
...
|
|
2282
|
+
...w,
|
|
2231
2283
|
statesByTreeId: {
|
|
2232
|
-
...
|
|
2233
|
-
[a]:
|
|
2284
|
+
...w.statesByTreeId,
|
|
2285
|
+
[a]: S
|
|
2234
2286
|
}
|
|
2235
2287
|
}, !1, l), f();
|
|
2236
2288
|
};
|
|
@@ -2242,40 +2294,40 @@ const hr = (e, t) => {
|
|
|
2242
2294
|
registerTreeRenderer(a, d) {
|
|
2243
2295
|
const l = i.getState();
|
|
2244
2296
|
if (l.trees[a.id]) throw new Error(`Tree renderer already registered: ${a.id}`);
|
|
2245
|
-
const
|
|
2297
|
+
const y = {
|
|
2246
2298
|
...D(d),
|
|
2247
2299
|
...a
|
|
2248
|
-
},
|
|
2300
|
+
}, S = l.statesByTreeId[a.id], w = S ? Jt(S, a) : ge(a);
|
|
2249
2301
|
i.setState({
|
|
2250
2302
|
...l,
|
|
2251
2303
|
trees: {
|
|
2252
2304
|
...l.trees,
|
|
2253
|
-
[a.id]:
|
|
2305
|
+
[a.id]: y
|
|
2254
2306
|
},
|
|
2255
2307
|
statesByTreeId: {
|
|
2256
2308
|
...l.statesByTreeId,
|
|
2257
|
-
[a.id]:
|
|
2309
|
+
[a.id]: w
|
|
2258
2310
|
}
|
|
2259
2311
|
}, !1, "registerTreeRenderer");
|
|
2260
|
-
const
|
|
2312
|
+
const v = t.registerRenderer({
|
|
2261
2313
|
id: a.id,
|
|
2262
2314
|
render: (h) => o({
|
|
2263
2315
|
...h,
|
|
2264
2316
|
treeId: a.id
|
|
2265
2317
|
})
|
|
2266
2318
|
});
|
|
2267
|
-
return
|
|
2268
|
-
|
|
2319
|
+
return I(() => {
|
|
2320
|
+
v.dispose();
|
|
2269
2321
|
const h = i.getState();
|
|
2270
|
-
if (h.trees[a.id] !==
|
|
2322
|
+
if (h.trees[a.id] !== y) return;
|
|
2271
2323
|
const {
|
|
2272
2324
|
[a.id]: R,
|
|
2273
2325
|
...C
|
|
2274
2326
|
} = h.trees, {
|
|
2275
|
-
[a.id]:
|
|
2327
|
+
[a.id]: E,
|
|
2276
2328
|
...M
|
|
2277
2329
|
} = h.statesByTreeId, {
|
|
2278
|
-
[a.id]:
|
|
2330
|
+
[a.id]: U,
|
|
2279
2331
|
...g
|
|
2280
2332
|
} = h.refreshKeysByTreeId;
|
|
2281
2333
|
i.setState({
|
|
@@ -2315,20 +2367,20 @@ const hr = (e, t) => {
|
|
|
2315
2367
|
};
|
|
2316
2368
|
},
|
|
2317
2369
|
setNodeExpanded(a, d, l) {
|
|
2318
|
-
c(a), m(a, (
|
|
2319
|
-
const
|
|
2320
|
-
return
|
|
2321
|
-
...
|
|
2322
|
-
expandedNodeIds:
|
|
2370
|
+
c(a), m(a, (y) => {
|
|
2371
|
+
const S = fe(y.expandedNodeIds, d, l);
|
|
2372
|
+
return S === y.expandedNodeIds ? y : {
|
|
2373
|
+
...y,
|
|
2374
|
+
expandedNodeIds: S
|
|
2323
2375
|
};
|
|
2324
2376
|
}, "setNodeExpanded");
|
|
2325
2377
|
},
|
|
2326
2378
|
setSectionExpanded(a, d, l) {
|
|
2327
|
-
c(a), m(a, (
|
|
2328
|
-
const
|
|
2329
|
-
return
|
|
2330
|
-
...
|
|
2331
|
-
expandedSectionIds:
|
|
2379
|
+
c(a), m(a, (y) => {
|
|
2380
|
+
const S = fe(y.expandedSectionIds, d, l);
|
|
2381
|
+
return S === y.expandedSectionIds ? y : {
|
|
2382
|
+
...y,
|
|
2383
|
+
expandedSectionIds: S
|
|
2332
2384
|
};
|
|
2333
2385
|
}, "setSectionExpanded");
|
|
2334
2386
|
},
|
|
@@ -2342,11 +2394,11 @@ const hr = (e, t) => {
|
|
|
2342
2394
|
c(a);
|
|
2343
2395
|
const l = u(a);
|
|
2344
2396
|
if (l.loading === d) return;
|
|
2345
|
-
const
|
|
2397
|
+
const y = i.getState();
|
|
2346
2398
|
i.setState({
|
|
2347
|
-
...
|
|
2399
|
+
...y,
|
|
2348
2400
|
statesByTreeId: {
|
|
2349
|
-
...
|
|
2401
|
+
...y.statesByTreeId,
|
|
2350
2402
|
[a]: {
|
|
2351
2403
|
...l,
|
|
2352
2404
|
loading: d
|
|
@@ -2364,18 +2416,18 @@ const hr = (e, t) => {
|
|
|
2364
2416
|
[a]: l + 1
|
|
2365
2417
|
}
|
|
2366
2418
|
}, !1, "refreshTreeRenderer");
|
|
2367
|
-
const
|
|
2419
|
+
const y = {
|
|
2368
2420
|
treeId: a
|
|
2369
2421
|
};
|
|
2370
|
-
for (const
|
|
2422
|
+
for (const S of r) S(y);
|
|
2371
2423
|
},
|
|
2372
2424
|
onDidRefresh(a) {
|
|
2373
|
-
return r.add(a),
|
|
2425
|
+
return r.add(a), I(() => {
|
|
2374
2426
|
r.delete(a);
|
|
2375
2427
|
});
|
|
2376
2428
|
}
|
|
2377
2429
|
};
|
|
2378
|
-
},
|
|
2430
|
+
}, me = (e, t) => (e.order ?? 0) - (t.order ?? 0) || O(e, t), Zt = () => {
|
|
2379
2431
|
const e = L({
|
|
2380
2432
|
name: "workbench.settings",
|
|
2381
2433
|
initialState: {
|
|
@@ -2406,7 +2458,7 @@ const hr = (e, t) => {
|
|
|
2406
2458
|
...n.sections,
|
|
2407
2459
|
[t.id]: i
|
|
2408
2460
|
}
|
|
2409
|
-
}, !1, "registerSection"),
|
|
2461
|
+
}, !1, "registerSection"), I(() => {
|
|
2410
2462
|
const r = e.getState();
|
|
2411
2463
|
if (r.sections[t.id] !== i) return;
|
|
2412
2464
|
const {
|
|
@@ -2432,7 +2484,7 @@ const hr = (e, t) => {
|
|
|
2432
2484
|
...n.panels,
|
|
2433
2485
|
[t.id]: i
|
|
2434
2486
|
}
|
|
2435
|
-
}, !1, "registerPanel"),
|
|
2487
|
+
}, !1, "registerPanel"), I(() => {
|
|
2436
2488
|
const r = e.getState();
|
|
2437
2489
|
if (r.panels[t.id] !== i) return;
|
|
2438
2490
|
const {
|
|
@@ -2452,13 +2504,13 @@ const hr = (e, t) => {
|
|
|
2452
2504
|
return e.getState().panels[t];
|
|
2453
2505
|
},
|
|
2454
2506
|
listSections() {
|
|
2455
|
-
return Object.values(e.getState().sections).sort(
|
|
2507
|
+
return Object.values(e.getState().sections).sort(me);
|
|
2456
2508
|
},
|
|
2457
2509
|
listPanels() {
|
|
2458
|
-
return Object.values(e.getState().panels).sort(
|
|
2510
|
+
return Object.values(e.getState().panels).sort(me);
|
|
2459
2511
|
}
|
|
2460
2512
|
};
|
|
2461
|
-
},
|
|
2513
|
+
}, er = () => {
|
|
2462
2514
|
const e = L({
|
|
2463
2515
|
name: "workbench.fileIconThemes",
|
|
2464
2516
|
initialState: {
|
|
@@ -2472,7 +2524,7 @@ const hr = (e, t) => {
|
|
|
2472
2524
|
return {
|
|
2473
2525
|
store: e,
|
|
2474
2526
|
register(n) {
|
|
2475
|
-
return t.add(n), s(),
|
|
2527
|
+
return t.add(n), s(), I(() => {
|
|
2476
2528
|
t.delete(n) && s();
|
|
2477
2529
|
});
|
|
2478
2530
|
},
|
|
@@ -2480,7 +2532,7 @@ const hr = (e, t) => {
|
|
|
2480
2532
|
return e.getState().themes;
|
|
2481
2533
|
}
|
|
2482
2534
|
};
|
|
2483
|
-
},
|
|
2535
|
+
}, tr = () => {
|
|
2484
2536
|
const e = L({
|
|
2485
2537
|
name: "workbench.themes",
|
|
2486
2538
|
initialState: {
|
|
@@ -2494,7 +2546,7 @@ const hr = (e, t) => {
|
|
|
2494
2546
|
return {
|
|
2495
2547
|
store: e,
|
|
2496
2548
|
register(n) {
|
|
2497
|
-
return t.add(n), s(),
|
|
2549
|
+
return t.add(n), s(), I(() => {
|
|
2498
2550
|
t.delete(n) && s();
|
|
2499
2551
|
});
|
|
2500
2552
|
},
|
|
@@ -2502,21 +2554,21 @@ const hr = (e, t) => {
|
|
|
2502
2554
|
return e.getState().themes;
|
|
2503
2555
|
}
|
|
2504
2556
|
};
|
|
2505
|
-
},
|
|
2557
|
+
}, rr = (e) => (t) => e.listProviders().some((n) => n.kind === t.kind) ? e.listResources("").some((n) => n.resource.uri === t.uri) : !0, nr = ({
|
|
2506
2558
|
layout: e,
|
|
2507
2559
|
isInScope: t
|
|
2508
2560
|
}) => {
|
|
2509
|
-
const s = e.store.subscribeSelector((n) =>
|
|
2510
|
-
const n = e.getLayout(), i =
|
|
2511
|
-
for (const r of
|
|
2561
|
+
const s = e.store.subscribeSelector((n) => _(n.layout.regions[Oe("primary")])?.resourceUri, () => {
|
|
2562
|
+
const n = e.getLayout(), i = ke(n, "primary");
|
|
2563
|
+
for (const r of Le({
|
|
2512
2564
|
layout: n,
|
|
2513
2565
|
primary: i,
|
|
2514
2566
|
isInScope: t
|
|
2515
2567
|
}))
|
|
2516
2568
|
r.action === "clear" && e.clearRegion(r.region);
|
|
2517
2569
|
});
|
|
2518
|
-
return
|
|
2519
|
-
},
|
|
2570
|
+
return I(s);
|
|
2571
|
+
}, sr = /* @__PURE__ */ new Set(["sidenav", "secondary", "main-left-menu", "main-right-menu", "secondary-left-menu", "secondary-right-menu", "side-left-menu", "side-right-menu"]), or = (e) => sr.has(e), ir = (e) => ({
|
|
2520
2572
|
getRegionState(t) {
|
|
2521
2573
|
const s = e.layout.getLayout().regions[t];
|
|
2522
2574
|
return {
|
|
@@ -2534,15 +2586,15 @@ const hr = (e, t) => {
|
|
|
2534
2586
|
setSidePanelPresentation: e.sidePanel.setMode,
|
|
2535
2587
|
onDidChange(t) {
|
|
2536
2588
|
const s = e.layout.store.subscribeSelector((i) => i.layout, t), n = e.sidePanel.onDidChange(t);
|
|
2537
|
-
return
|
|
2589
|
+
return I(() => {
|
|
2538
2590
|
s(), n.dispose();
|
|
2539
2591
|
});
|
|
2540
2592
|
}
|
|
2541
|
-
}),
|
|
2593
|
+
}), ar = "sidenav", cr = (e, t, s) => {
|
|
2542
2594
|
e.panels.setOpen(t, s), e.layout.setRegionVisible(t, s);
|
|
2543
|
-
},
|
|
2544
|
-
|
|
2545
|
-
},
|
|
2595
|
+
}, dr = (e, t) => {
|
|
2596
|
+
cr(e, t, !e.panels.isOpen(t));
|
|
2597
|
+
}, lr = [{
|
|
2546
2598
|
id: "workbench.toggleCommandPalette",
|
|
2547
2599
|
label: "Toggle Command Palette",
|
|
2548
2600
|
icon: "Command",
|
|
@@ -2585,9 +2637,9 @@ const hr = (e, t) => {
|
|
|
2585
2637
|
label: "Toggle Sidenav",
|
|
2586
2638
|
icon: "PanelLeft",
|
|
2587
2639
|
keybinding: "Mod+B",
|
|
2588
|
-
execute: (e) =>
|
|
2589
|
-
}],
|
|
2590
|
-
for (const t of
|
|
2640
|
+
execute: (e) => dr(e, ar)
|
|
2641
|
+
}], ur = (e) => {
|
|
2642
|
+
for (const t of lr)
|
|
2591
2643
|
e.commands.registerCommand({
|
|
2592
2644
|
id: t.id,
|
|
2593
2645
|
label: t.label,
|
|
@@ -2600,7 +2652,7 @@ const hr = (e, t) => {
|
|
|
2600
2652
|
commandId: t.id,
|
|
2601
2653
|
keybinding: t.keybinding,
|
|
2602
2654
|
when: "!inputFocus"
|
|
2603
|
-
}), e.layout.registerMenuItem(
|
|
2655
|
+
}), e.layout.registerMenuItem(se, {
|
|
2604
2656
|
commandId: t.id,
|
|
2605
2657
|
group: "Workbench"
|
|
2606
2658
|
});
|
|
@@ -2618,21 +2670,28 @@ const hr = (e, t) => {
|
|
|
2618
2670
|
});
|
|
2619
2671
|
return;
|
|
2620
2672
|
}
|
|
2621
|
-
if (!e.modes.getMode(t.modeId))
|
|
2673
|
+
if (!e.modes.getMode(t.modeId)) {
|
|
2674
|
+
e.notifications.show({
|
|
2675
|
+
level: "error",
|
|
2676
|
+
title: "Mode unavailable",
|
|
2677
|
+
message: `Workbench mode not registered: ${t.modeId}`
|
|
2678
|
+
});
|
|
2679
|
+
return;
|
|
2680
|
+
}
|
|
2622
2681
|
e.modes.setActiveMode(t.modeId);
|
|
2623
2682
|
}
|
|
2624
|
-
}), e.layout.registerMenuItem(
|
|
2683
|
+
}), e.layout.registerMenuItem(se, {
|
|
2625
2684
|
commandId: "workbench.action.switchMode",
|
|
2626
2685
|
group: "Workbench"
|
|
2627
2686
|
});
|
|
2628
|
-
},
|
|
2687
|
+
}, T = (e, t) => ({
|
|
2629
2688
|
...t,
|
|
2630
2689
|
source: e.source,
|
|
2631
2690
|
ownerId: e.ownerId
|
|
2632
|
-
}),
|
|
2691
|
+
}), ve = (e) => e ? Array.isArray(e) ? [...e] : [e] : [], pe = (e) => {
|
|
2633
2692
|
for (let t = e.length - 1; t >= 0; t -= 1)
|
|
2634
2693
|
e[t]?.dispose();
|
|
2635
|
-
},
|
|
2694
|
+
}, Re = (e, t) => {
|
|
2636
2695
|
const s = e.context.createScope(t.ownerId);
|
|
2637
2696
|
t.track(s);
|
|
2638
2697
|
const n = (r) => (t.track(r), r);
|
|
@@ -2661,12 +2720,12 @@ const hr = (e, t) => {
|
|
|
2661
2720
|
},
|
|
2662
2721
|
commands: {
|
|
2663
2722
|
...e.commands,
|
|
2664
|
-
registerCommand: (r, o, c) => n(e.commands.registerCommand(r, o,
|
|
2723
|
+
registerCommand: (r, o, c) => n(e.commands.registerCommand(r, o, T(t, c))),
|
|
2665
2724
|
onDidExecuteError: (r) => n(e.commands.onDidExecuteError(r))
|
|
2666
2725
|
},
|
|
2667
2726
|
keybindings: {
|
|
2668
2727
|
...e.keybindings,
|
|
2669
|
-
registerKeybinding: (r, o) => n(e.keybindings.registerKeybinding(r,
|
|
2728
|
+
registerKeybinding: (r, o) => n(e.keybindings.registerKeybinding(r, T(t, o)))
|
|
2670
2729
|
},
|
|
2671
2730
|
lastResource: {
|
|
2672
2731
|
...e.lastResource
|
|
@@ -2675,7 +2734,7 @@ const hr = (e, t) => {
|
|
|
2675
2734
|
...e.layout,
|
|
2676
2735
|
openPanel: (r, o) => {
|
|
2677
2736
|
const c = e.layout.openPanel(r, o);
|
|
2678
|
-
return n(
|
|
2737
|
+
return n(I(() => e.layout.removeWidgetPlacement(c.instanceId))), c;
|
|
2679
2738
|
},
|
|
2680
2739
|
openWidget: (r, o) => {
|
|
2681
2740
|
const c = e.layout.openWidget(r, {
|
|
@@ -2683,15 +2742,15 @@ const hr = (e, t) => {
|
|
|
2683
2742
|
ownerId: t.ownerId,
|
|
2684
2743
|
source: t.source
|
|
2685
2744
|
});
|
|
2686
|
-
return n(
|
|
2745
|
+
return n(I(() => e.layout.removeWidgetPlacement(c.widgetId))), c;
|
|
2687
2746
|
},
|
|
2688
|
-
registerPlaceholder: (r, o) => n(e.layout.registerPlaceholder(r,
|
|
2689
|
-
registerPanel: (r, o) => n(e.layout.registerPanel(r,
|
|
2690
|
-
registerWidget: (r, o) => n(e.layout.registerWidget(r,
|
|
2691
|
-
registerLocation: (r, o) => n(e.layout.registerLocation(r,
|
|
2692
|
-
registerSubPanel: (r, o) => n(e.layout.registerSubPanel(r,
|
|
2693
|
-
registerPanelMenu: (r, o) => n(e.layout.registerPanelMenu(r,
|
|
2694
|
-
registerMenuItem: (r, o, c) => n(e.layout.registerMenuItem(r, o,
|
|
2747
|
+
registerPlaceholder: (r, o) => n(e.layout.registerPlaceholder(r, T(t, o))),
|
|
2748
|
+
registerPanel: (r, o) => n(e.layout.registerPanel(r, T(t, o))),
|
|
2749
|
+
registerWidget: (r, o) => n(e.layout.registerWidget(r, T(t, o))),
|
|
2750
|
+
registerLocation: (r, o) => n(e.layout.registerLocation(r, T(t, o))),
|
|
2751
|
+
registerSubPanel: (r, o) => n(e.layout.registerSubPanel(r, T(t, o))),
|
|
2752
|
+
registerPanelMenu: (r, o) => n(e.layout.registerPanelMenu(r, T(t, o))),
|
|
2753
|
+
registerMenuItem: (r, o, c) => n(e.layout.registerMenuItem(r, o, T(t, c))),
|
|
2695
2754
|
onWillChangePersistenceScope: (r) => n(e.layout.onWillChangePersistenceScope(r)),
|
|
2696
2755
|
onDidChangePersistenceScope: (r) => n(e.layout.onDidChangePersistenceScope(r))
|
|
2697
2756
|
},
|
|
@@ -2700,25 +2759,25 @@ const hr = (e, t) => {
|
|
|
2700
2759
|
registerMode: (r) => n(e.modes.registerMode({
|
|
2701
2760
|
...r,
|
|
2702
2761
|
activate: () => {
|
|
2703
|
-
const o = [], c =
|
|
2762
|
+
const o = [], c = Re(e, {
|
|
2704
2763
|
...t,
|
|
2705
2764
|
track: (f) => {
|
|
2706
2765
|
o.push(f);
|
|
2707
2766
|
}
|
|
2708
|
-
}), u =
|
|
2709
|
-
return
|
|
2767
|
+
}), u = ve(r.activate(c));
|
|
2768
|
+
return I(() => pe([...o, ...u]));
|
|
2710
2769
|
}
|
|
2711
2770
|
})),
|
|
2712
2771
|
onDidChangeActive: (r) => n(e.modes.onDidChangeActive(r))
|
|
2713
2772
|
},
|
|
2714
2773
|
navigation: {
|
|
2715
2774
|
...e.navigation,
|
|
2716
|
-
registerNavigator: (r, o) => n(e.navigation.registerNavigator(r,
|
|
2717
|
-
registerParser: (r, o) => n(e.navigation.registerParser(r,
|
|
2775
|
+
registerNavigator: (r, o) => n(e.navigation.registerNavigator(r, T(t, o))),
|
|
2776
|
+
registerParser: (r, o) => n(e.navigation.registerParser(r, T(t, o)))
|
|
2718
2777
|
},
|
|
2719
2778
|
notifications: {
|
|
2720
2779
|
...e.notifications,
|
|
2721
|
-
show: (r, o) => e.notifications.show(r,
|
|
2780
|
+
show: (r, o) => e.notifications.show(r, T(t, o))
|
|
2722
2781
|
},
|
|
2723
2782
|
panels: {
|
|
2724
2783
|
...e.panels,
|
|
@@ -2726,22 +2785,22 @@ const hr = (e, t) => {
|
|
|
2726
2785
|
},
|
|
2727
2786
|
preferences: {
|
|
2728
2787
|
...e.preferences,
|
|
2729
|
-
registerSchema: (r, o) => n(e.preferences.registerSchema(r,
|
|
2788
|
+
registerSchema: (r, o) => n(e.preferences.registerSchema(r, T(t, o)))
|
|
2730
2789
|
},
|
|
2731
2790
|
renderers: {
|
|
2732
2791
|
...e.renderers,
|
|
2733
2792
|
registerRenderer: (r) => n(e.renderers.registerRenderer(r)),
|
|
2734
|
-
registerTreeRenderer: (r, o) => n(e.renderers.registerTreeRenderer(r,
|
|
2735
|
-
registerKanbanRenderer: (r, o) => n(e.renderers.registerKanbanRenderer(r,
|
|
2736
|
-
registerDataTableRenderer: (r, o) => n(e.renderers.registerDataTableRenderer(r,
|
|
2737
|
-
registerFileRenderer: (r, o) => n(e.renderers.registerFileRenderer(r,
|
|
2738
|
-
registerControlsRenderer: (r, o) => n(e.renderers.registerControlsRenderer(r,
|
|
2793
|
+
registerTreeRenderer: (r, o) => n(e.renderers.registerTreeRenderer(r, T(t, o))),
|
|
2794
|
+
registerKanbanRenderer: (r, o) => n(e.renderers.registerKanbanRenderer(r, T(t, o))),
|
|
2795
|
+
registerDataTableRenderer: (r, o) => n(e.renderers.registerDataTableRenderer(r, T(t, o))),
|
|
2796
|
+
registerFileRenderer: (r, o) => n(e.renderers.registerFileRenderer(r, T(t, o))),
|
|
2797
|
+
registerControlsRenderer: (r, o) => n(e.renderers.registerControlsRenderer(r, T(t, o))),
|
|
2739
2798
|
onDidChange: (r) => n(e.renderers.onDidChange(r)),
|
|
2740
2799
|
onDidRefresh: (r) => n(e.renderers.onDidRefresh(r))
|
|
2741
2800
|
},
|
|
2742
2801
|
resources: {
|
|
2743
2802
|
...e.resources,
|
|
2744
|
-
registerKind: (r, o) => n(e.resources.registerKind(r,
|
|
2803
|
+
registerKind: (r, o) => n(e.resources.registerKind(r, T(t, o))),
|
|
2745
2804
|
registerHierarchyProvider: (r) => n(e.resources.registerHierarchyProvider(r)),
|
|
2746
2805
|
registerPresenter: (r) => n(e.resources.registerPresenter(r)),
|
|
2747
2806
|
registerProvider: (r) => n(e.resources.registerProvider(r)),
|
|
@@ -2749,8 +2808,8 @@ const hr = (e, t) => {
|
|
|
2749
2808
|
},
|
|
2750
2809
|
settings: {
|
|
2751
2810
|
...e.settings,
|
|
2752
|
-
registerSection: (r, o) => n(e.settings.registerSection(r,
|
|
2753
|
-
registerPanel: (r, o) => n(e.settings.registerPanel(r,
|
|
2811
|
+
registerSection: (r, o) => n(e.settings.registerSection(r, T(t, o))),
|
|
2812
|
+
registerPanel: (r, o) => n(e.settings.registerPanel(r, T(t, o)))
|
|
2754
2813
|
},
|
|
2755
2814
|
shell: {
|
|
2756
2815
|
...e.shell,
|
|
@@ -2769,21 +2828,21 @@ const hr = (e, t) => {
|
|
|
2769
2828
|
register: (r) => n(e.fileIconThemes.register(r))
|
|
2770
2829
|
}
|
|
2771
2830
|
};
|
|
2772
|
-
},
|
|
2773
|
-
const t =
|
|
2831
|
+
}, br = (e = {}) => {
|
|
2832
|
+
const t = Te(), s = yt({
|
|
2774
2833
|
context: t
|
|
2775
|
-
}), n = /* @__PURE__ */ new Map(), i =
|
|
2834
|
+
}), n = /* @__PURE__ */ new Map(), i = Ee(e.renderers), r = Xt({
|
|
2776
2835
|
rendererRegistry: i,
|
|
2777
2836
|
persistence: e.treePersistence
|
|
2778
|
-
}), o =
|
|
2837
|
+
}), o = Gt({
|
|
2779
2838
|
rendererRegistry: i
|
|
2780
|
-
}), c =
|
|
2839
|
+
}), c = Qt({
|
|
2781
2840
|
rendererRegistry: i
|
|
2782
|
-
}), u =
|
|
2841
|
+
}), u = Yt({
|
|
2783
2842
|
rendererRegistry: i
|
|
2784
|
-
}), f =
|
|
2843
|
+
}), f = zt({
|
|
2785
2844
|
rendererRegistry: i
|
|
2786
|
-
}), m =
|
|
2845
|
+
}), m = $t({
|
|
2787
2846
|
defaultRegionVisibility: e.defaultPanelOpenByRegionId,
|
|
2788
2847
|
persistence: e.persistence ? {
|
|
2789
2848
|
getLayout: (h) => e.persistence?.getSnapshot(h)?.layout,
|
|
@@ -2798,23 +2857,24 @@ const hr = (e, t) => {
|
|
|
2798
2857
|
...d
|
|
2799
2858
|
} = m, l = {
|
|
2800
2859
|
...d,
|
|
2801
|
-
|
|
2860
|
+
...Ft({
|
|
2802
2861
|
commands: s
|
|
2803
2862
|
})
|
|
2804
|
-
},
|
|
2863
|
+
}, y = Ke({
|
|
2805
2864
|
context: t,
|
|
2806
2865
|
isRegionFocusable: (h) => l.getLayout().regions[h].visible
|
|
2807
|
-
}),
|
|
2808
|
-
initialMode: e.initialSidePanelMode
|
|
2809
|
-
|
|
2866
|
+
}), S = ut({
|
|
2867
|
+
initialMode: e.initialSidePanelMode,
|
|
2868
|
+
persistence: e.sidePanelPersistence
|
|
2869
|
+
}), w = ir({
|
|
2810
2870
|
layout: l,
|
|
2811
|
-
sidePanel:
|
|
2812
|
-
}),
|
|
2813
|
-
breadcrumbs:
|
|
2814
|
-
commandPalette:
|
|
2871
|
+
sidePanel: S
|
|
2872
|
+
}), v = {
|
|
2873
|
+
breadcrumbs: Ae(),
|
|
2874
|
+
commandPalette: $e(),
|
|
2815
2875
|
commands: s,
|
|
2816
2876
|
context: t,
|
|
2817
|
-
focus:
|
|
2877
|
+
focus: y,
|
|
2818
2878
|
host: {
|
|
2819
2879
|
getSnapshot: () => ({
|
|
2820
2880
|
layout: l.getLayout()
|
|
@@ -2826,44 +2886,44 @@ const hr = (e, t) => {
|
|
|
2826
2886
|
getPersistenceScope: l.getPersistenceScope
|
|
2827
2887
|
},
|
|
2828
2888
|
history: void 0,
|
|
2829
|
-
keybindings:
|
|
2889
|
+
keybindings: Me({
|
|
2830
2890
|
commands: s,
|
|
2831
2891
|
context: t
|
|
2832
2892
|
}),
|
|
2833
|
-
lastResource:
|
|
2893
|
+
lastResource: dt({
|
|
2834
2894
|
persistence: e.lastResourcePersistence,
|
|
2835
|
-
openResource: (h) =>
|
|
2895
|
+
openResource: (h) => v.resources.openResource(h, {
|
|
2836
2896
|
replaceActive: !0
|
|
2837
2897
|
})
|
|
2838
2898
|
}),
|
|
2839
2899
|
layout: l,
|
|
2840
2900
|
modes: void 0,
|
|
2841
|
-
notifications:
|
|
2842
|
-
navigation:
|
|
2901
|
+
notifications: Ht(),
|
|
2902
|
+
navigation: _t({
|
|
2843
2903
|
resolveDispatcher: () => ({
|
|
2844
2904
|
createCheckpoint: () => {
|
|
2845
|
-
const h =
|
|
2846
|
-
return () =>
|
|
2905
|
+
const h = v.layout.getLayout();
|
|
2906
|
+
return () => v.layout.restoreLayout(h);
|
|
2847
2907
|
},
|
|
2848
2908
|
canOpenResource: (h) => {
|
|
2849
|
-
const R =
|
|
2909
|
+
const R = v.resources.store.getState();
|
|
2850
2910
|
return !!(R.kinds[h.kind] && Object.values(R.presenters).some((C) => C.canOpen(h)));
|
|
2851
2911
|
},
|
|
2852
|
-
canOpenPanel: (h) => !!
|
|
2853
|
-
canExecuteCommand: (h) => !!
|
|
2854
|
-
openResource: (h, R) =>
|
|
2912
|
+
canOpenPanel: (h) => !!v.layout.getPanel(h),
|
|
2913
|
+
canExecuteCommand: (h) => !!v.commands.getCommand(h),
|
|
2914
|
+
openResource: (h, R) => v.resources.openResource(h, R),
|
|
2855
2915
|
openPanel: (h, R) => {
|
|
2856
|
-
const C =
|
|
2857
|
-
return M && (M === "side" ?
|
|
2916
|
+
const C = v.layout.openPanel(h, R), E = v.layout.getPanel(h), M = R?.region ?? E?.region;
|
|
2917
|
+
return M && (M === "side" ? v.shell.setSidePanelPresentation("attached") : or(M) && v.shell.setRegionOpen(M, !0)), C;
|
|
2858
2918
|
},
|
|
2859
|
-
executeCommand: (h, R) =>
|
|
2919
|
+
executeCommand: (h, R) => v.commands.executeCommand(h, R)
|
|
2860
2920
|
})
|
|
2861
2921
|
}),
|
|
2862
|
-
panels:
|
|
2922
|
+
panels: lt({
|
|
2863
2923
|
defaultOpenByRegionId: e.defaultPanelOpenByRegionId,
|
|
2864
2924
|
persistence: e.panelsPersistence
|
|
2865
2925
|
}),
|
|
2866
|
-
preferences:
|
|
2926
|
+
preferences: Vt({
|
|
2867
2927
|
persistence: e.preferencePersistence
|
|
2868
2928
|
}),
|
|
2869
2929
|
renderers: {
|
|
@@ -2874,53 +2934,53 @@ const hr = (e, t) => {
|
|
|
2874
2934
|
...u,
|
|
2875
2935
|
...f
|
|
2876
2936
|
},
|
|
2877
|
-
commandPaletteResources:
|
|
2878
|
-
resources:
|
|
2879
|
-
getPrimary: () => B(
|
|
2937
|
+
commandPaletteResources: ht(),
|
|
2938
|
+
resources: xe({
|
|
2939
|
+
getPrimary: () => B(v.layout.getLayout())?.resource,
|
|
2880
2940
|
establishLocation: (h) => a(h.instanceId)
|
|
2881
2941
|
}),
|
|
2882
|
-
settings:
|
|
2883
|
-
shell:
|
|
2884
|
-
sidePanel:
|
|
2885
|
-
terminal:
|
|
2886
|
-
themes:
|
|
2887
|
-
fileIconThemes:
|
|
2942
|
+
settings: Zt(),
|
|
2943
|
+
shell: w,
|
|
2944
|
+
sidePanel: S,
|
|
2945
|
+
terminal: mt(),
|
|
2946
|
+
themes: tr(),
|
|
2947
|
+
fileIconThemes: er(),
|
|
2888
2948
|
getActiveResource() {
|
|
2889
|
-
const h =
|
|
2949
|
+
const h = v.layout.getLayout().activeWidgetId;
|
|
2890
2950
|
if (h)
|
|
2891
|
-
for (const R of Object.values(
|
|
2892
|
-
const C = R.widgets.find((
|
|
2951
|
+
for (const R of Object.values(v.layout.getLayout().regions)) {
|
|
2952
|
+
const C = R.widgets.find((E) => E.widgetId === h);
|
|
2893
2953
|
if (C) return C.resource;
|
|
2894
2954
|
}
|
|
2895
2955
|
},
|
|
2896
2956
|
onDidChangeActiveResource(h) {
|
|
2897
|
-
return
|
|
2957
|
+
return I(v.layout.store.subscribeSelector((R) => R.layout.activeResourceUri, () => h(v.getActiveResource())));
|
|
2898
2958
|
},
|
|
2899
2959
|
getPrimaryResource() {
|
|
2900
|
-
return B(
|
|
2960
|
+
return B(v.layout.getLayout())?.resource;
|
|
2901
2961
|
},
|
|
2902
2962
|
onDidChangePrimaryResource(h) {
|
|
2903
|
-
return
|
|
2963
|
+
return I(v.layout.store.subscribeSelector((R) => B(R.layout)?.resourceUri, () => h(v.getPrimaryResource())));
|
|
2904
2964
|
},
|
|
2905
2965
|
registerModule(h) {
|
|
2906
2966
|
if (n.has(h.id)) throw new Error(`Workbench module already registered: ${h.id}`);
|
|
2907
2967
|
const R = [], C = {
|
|
2908
2968
|
disposable: void 0
|
|
2909
2969
|
};
|
|
2910
|
-
C.disposable =
|
|
2911
|
-
n.get(h.id) === C && (n.delete(h.id),
|
|
2970
|
+
C.disposable = I(() => {
|
|
2971
|
+
n.get(h.id) === C && (n.delete(h.id), pe(R));
|
|
2912
2972
|
}), n.set(h.id, C);
|
|
2913
2973
|
try {
|
|
2914
|
-
const
|
|
2974
|
+
const E = Re(v, {
|
|
2915
2975
|
ownerId: h.ownerId ?? h.id,
|
|
2916
2976
|
source: h.source ?? "module",
|
|
2917
2977
|
track: (M) => {
|
|
2918
2978
|
R.push(M);
|
|
2919
2979
|
}
|
|
2920
2980
|
});
|
|
2921
|
-
R.push(...
|
|
2922
|
-
} catch (
|
|
2923
|
-
throw C.disposable.dispose(),
|
|
2981
|
+
R.push(...ve(h.activate(E)));
|
|
2982
|
+
} catch (E) {
|
|
2983
|
+
throw C.disposable.dispose(), E;
|
|
2924
2984
|
}
|
|
2925
2985
|
return C.disposable;
|
|
2926
2986
|
},
|
|
@@ -2928,51 +2988,51 @@ const hr = (e, t) => {
|
|
|
2928
2988
|
n.get(h)?.disposable.dispose();
|
|
2929
2989
|
}
|
|
2930
2990
|
};
|
|
2931
|
-
return
|
|
2991
|
+
return v.modes = De({
|
|
2932
2992
|
establishLocation: (h) => a(h),
|
|
2933
|
-
resolveContext: () =>
|
|
2934
|
-
}),
|
|
2935
|
-
layout:
|
|
2936
|
-
modes:
|
|
2937
|
-
resources:
|
|
2993
|
+
resolveContext: () => v
|
|
2994
|
+
}), v.history = ct({
|
|
2995
|
+
layout: v.layout,
|
|
2996
|
+
modes: v.modes,
|
|
2997
|
+
resources: v.resources,
|
|
2938
2998
|
persistence: e.historyPersistence
|
|
2939
|
-
}),
|
|
2940
|
-
const R =
|
|
2941
|
-
R && !h.layout.regions[R].visible &&
|
|
2942
|
-
}),
|
|
2943
|
-
const h =
|
|
2999
|
+
}), v.layout.store.subscribe((h) => {
|
|
3000
|
+
const R = v.focus.getActiveRegion();
|
|
3001
|
+
R && !h.layout.regions[R].visible && v.focus.clearFocus();
|
|
3002
|
+
}), v.layout.onDidChangePersistenceScope(() => {
|
|
3003
|
+
const h = v.layout.getLayout();
|
|
2944
3004
|
for (const R of Object.values(h.regions))
|
|
2945
|
-
|
|
2946
|
-
}),
|
|
2947
|
-
h &&
|
|
2948
|
-
}),
|
|
2949
|
-
layout:
|
|
2950
|
-
isInScope: e.isInScope ??
|
|
2951
|
-
}),
|
|
3005
|
+
v.panels.setOpen(R.id, R.visible);
|
|
3006
|
+
}), v.onDidChangePrimaryResource((h) => {
|
|
3007
|
+
h && v.lastResource.set(h);
|
|
3008
|
+
}), nr({
|
|
3009
|
+
layout: v.layout,
|
|
3010
|
+
isInScope: e.isInScope ?? rr(v.resources)
|
|
3011
|
+
}), ur(v), v;
|
|
2952
3012
|
};
|
|
2953
3013
|
export {
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
3014
|
+
yr as createResourceBreadcrumbItems,
|
|
3015
|
+
br as createWorkbenchCore,
|
|
3016
|
+
pr as createWorkbenchResourceContextValues,
|
|
3017
|
+
Rr as createWorkbenchSelectionResourceMetadata,
|
|
3018
|
+
wr as getKeybindingSteps,
|
|
3019
|
+
Pr as getWorkbenchModePanelForRegion,
|
|
3020
|
+
Ir as getWorkbenchSelectionResourceUris,
|
|
3021
|
+
Dr as headerLeadingMenuPath,
|
|
3022
|
+
Br as headerTrailingMenuPath,
|
|
3023
|
+
Cr as isWorkbenchModePanelAvailable,
|
|
3024
|
+
Wr as matchesContextExpression,
|
|
3025
|
+
Oe as resolveAnchorRegion,
|
|
3026
|
+
Or as resourceContextMenuPath,
|
|
3027
|
+
kr as standardResourceIcons,
|
|
3028
|
+
se as workbenchCommandPaletteMenuPath,
|
|
3029
|
+
Ar as workbenchRegionTabAddMenuPath,
|
|
3030
|
+
$r as workbenchRegionTabLeadingMenuPath,
|
|
3031
|
+
Lr as workbenchResourceIdContextKey,
|
|
3032
|
+
Tr as workbenchResourceKindContextKey,
|
|
2973
3033
|
Er as workbenchResourceMetadataContextKey,
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
3034
|
+
xr as workbenchSelectionResourceUriMetadataKey,
|
|
3035
|
+
Fr as workbenchTopHeaderLeadingMenuPath,
|
|
3036
|
+
Nr as workbenchTopHeaderTrailingMenuPath
|
|
2977
3037
|
};
|
|
2978
3038
|
//# sourceMappingURL=index.js.map
|