@pstdio/workbench 0.9.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extensions.js +265 -258
- package/dist/extensions.js.map +1 -1
- package/dist/{file-renderer-view-kfJRY3yR.js → file-renderer-view-Bfmw6RxV.js} +2 -2
- package/dist/{file-renderer-view-kfJRY3yR.js.map → file-renderer-view-Bfmw6RxV.js.map} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +966 -991
- package/dist/index.js.map +1 -1
- package/dist/react.d.ts +2 -0
- package/dist/react.js +1320 -1329
- package/dist/react.js.map +1 -1
- package/dist/webview-runtime.js +1 -1
- package/dist/webview-runtime.js.map +1 -1
- package/dist/workbench-renderers-BhgHQ-Ne.js +871 -0
- package/dist/workbench-renderers-BhgHQ-Ne.js.map +1 -0
- package/package.json +3 -3
- package/dist/workbench-renderers-DmsrBGC7.js +0 -960
- package/dist/workbench-renderers-DmsrBGC7.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import {
|
|
3
|
-
import { resourceKey as
|
|
4
|
-
import { dockedWorkbenchRegions as
|
|
5
|
-
import { w as
|
|
6
|
-
import { h as
|
|
1
|
+
import { c as W, a as R, w as H, r as er, g as Y, b as B, n as x, d as wt, e as V, f as vt, h as L, i as St, j as oe, k as qe, l as tr, m as F, o as Me, t as q, p as _e, q as Ue, s as se, u as de, v as rr, x as nr, y as It, z as Ie, A as or, B as He, C as Qe, D as sr, E as ar, F as ir, G as Te, H as Ce, I as Je, J as cr, K as dr, L as lr, M as gr, N as ur } from "./workbench-renderers-BhgHQ-Ne.js";
|
|
2
|
+
import { O as ga, P as ua, Q as ma, R as fa, S as pa, T as ya, U as ha, V as wa, W as va, X as Sa, Y as Ia, Z as ba, _ as Pa } from "./workbench-renderers-BhgHQ-Ne.js";
|
|
3
|
+
import { resourceKey as T, isWorkbenchProjectUrl as bt, serializeWorkbenchPageUrl as mr, parseWorkbenchPageUrl as fr, isLocalizedString as pr, dockedWorkbenchRegions as yr, defaultPageResourceCodec as Pt, workbenchPages as hr } from "@pstdio/sdk/extensions";
|
|
4
|
+
import { defaultPageResourceCodec as Ra, dockedWorkbenchRegions as Ma } from "@pstdio/sdk/extensions";
|
|
5
|
+
import { w as wr } from "./workbench-menu-paths-B_QJzcNU.js";
|
|
6
|
+
import { h as Ea, a as Wa, r as $a, b as La, c as Ka, d as xa, e as Oa } from "./workbench-menu-paths-B_QJzcNU.js";
|
|
7
7
|
const vr = () => {
|
|
8
|
-
const e =
|
|
8
|
+
const e = W({
|
|
9
9
|
name: "workbench.breadcrumbs",
|
|
10
10
|
initialState: {
|
|
11
11
|
items: void 0
|
|
@@ -36,7 +36,7 @@ const vr = () => {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
}, Sr = (e = {}) => {
|
|
39
|
-
const t =
|
|
39
|
+
const t = W({
|
|
40
40
|
name: "workbench.commandPalette",
|
|
41
41
|
initialState: {
|
|
42
42
|
open: e.initialOpen ?? !1,
|
|
@@ -103,7 +103,93 @@ const vr = () => {
|
|
|
103
103
|
return R(o);
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
|
-
},
|
|
106
|
+
}, te = (e, t, r) => {
|
|
107
|
+
const n = {
|
|
108
|
+
...e
|
|
109
|
+
};
|
|
110
|
+
return r.viewId !== void 0 && (n.viewId = r.viewId ?? void 0), r.resource === null ? (n.resource = void 0, n.resourceKey = void 0, n.title = r.title ?? t.title) : r.resource ? (n.resource = r.resource, n.resourceKey = T(r.resource), n.title = r.title ?? r.resource.label ?? t.title) : r.title !== void 0 && (n.title = r.title), r.pinned !== void 0 && (n.pinned = r.pinned), r.closable !== void 0 && (n.closable = r.closable), r.mountStrategy !== void 0 && (n.mountStrategy = r.mountStrategy), r.hiddenByDefault !== void 0 && (n.hiddenByDefault = r.hiddenByDefault), r.tabRetention !== void 0 && (n.tabRetention = r.tabRetention), r.tab !== void 0 && (n.tab = r.tab), r.ownerId !== void 0 && (n.ownerId = r.ownerId), r.source !== void 0 && (n.source = r.source), r.role !== void 0 && (n.role = r.role), n;
|
|
111
|
+
}, pe = (e, t, r) => ({
|
|
112
|
+
widgetId: e,
|
|
113
|
+
contributionId: t.id,
|
|
114
|
+
viewId: r.viewId ?? void 0,
|
|
115
|
+
ownerId: r.ownerId ?? t.ownerId,
|
|
116
|
+
source: r.source ?? t.source,
|
|
117
|
+
resource: r.resource ?? void 0,
|
|
118
|
+
resourceKey: T(r.resource ?? void 0),
|
|
119
|
+
title: r.title ?? r.resource?.label ?? t.title,
|
|
120
|
+
pinned: r.pinned,
|
|
121
|
+
// Tabbed (non-singleton) widgets are closable unless they opt out; singleton
|
|
122
|
+
// panels stay non-closable by default.
|
|
123
|
+
closable: r.closable ?? t.closable ?? !t.singleton,
|
|
124
|
+
mountStrategy: r.mountStrategy ?? t.mountStrategy,
|
|
125
|
+
hiddenByDefault: r.hiddenByDefault ?? t.hiddenByDefault,
|
|
126
|
+
tabRetention: r.tabRetention,
|
|
127
|
+
tab: r.tab ?? t.tab,
|
|
128
|
+
role: r.role ?? "content"
|
|
129
|
+
}), Ir = (e, t) => ({
|
|
130
|
+
id: e,
|
|
131
|
+
visible: t,
|
|
132
|
+
widgets: []
|
|
133
|
+
}), kt = (e = {}) => {
|
|
134
|
+
const t = (r) => Ir(r, e[r] ?? !0);
|
|
135
|
+
return {
|
|
136
|
+
regions: {
|
|
137
|
+
nav: t("nav"),
|
|
138
|
+
activity: t("activity"),
|
|
139
|
+
sidenav: t("sidenav"),
|
|
140
|
+
"main-header": t("main-header"),
|
|
141
|
+
"main-left-menu": t("main-left-menu"),
|
|
142
|
+
main: t("main"),
|
|
143
|
+
"main-right-menu": t("main-right-menu"),
|
|
144
|
+
"secondary-header": t("secondary-header"),
|
|
145
|
+
"secondary-left-menu": t("secondary-left-menu"),
|
|
146
|
+
secondary: t("secondary"),
|
|
147
|
+
"secondary-right-menu": t("secondary-right-menu"),
|
|
148
|
+
"side-header": t("side-header"),
|
|
149
|
+
"side-left-menu": t("side-left-menu"),
|
|
150
|
+
side: t("side"),
|
|
151
|
+
"side-right-menu": t("side-right-menu"),
|
|
152
|
+
status: t("status"),
|
|
153
|
+
overlay: t("overlay")
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
}, br = (e, t) => {
|
|
157
|
+
for (let r = e.length - 1; r >= 0; r -= 1)
|
|
158
|
+
if (e[r]?.widgetId === t) return r;
|
|
159
|
+
return -1;
|
|
160
|
+
}, Pr = (e) => {
|
|
161
|
+
const t = /* @__PURE__ */ new Set(), r = {};
|
|
162
|
+
let n = e.activeWidgetId, o = e.activeResourceKey;
|
|
163
|
+
for (const [s, a] of Object.entries(e.regions)) {
|
|
164
|
+
const l = a.activeWidgetId, c = l ? br(a.widgets, l) : -1, g = a.widgets.map((i) => {
|
|
165
|
+
const d = er(t, i.contributionId, i.widgetId);
|
|
166
|
+
return t.add(d), d === i.widgetId ? i : {
|
|
167
|
+
...i,
|
|
168
|
+
widgetId: d
|
|
169
|
+
};
|
|
170
|
+
}), m = c >= 0 ? g[c]?.widgetId : l;
|
|
171
|
+
r[s] = {
|
|
172
|
+
...a,
|
|
173
|
+
widgets: g,
|
|
174
|
+
activeWidgetId: m
|
|
175
|
+
}, l && e.activeWidgetId === l && c >= 0 && (n = m, o = g[c]?.resourceKey);
|
|
176
|
+
}
|
|
177
|
+
return {
|
|
178
|
+
...e,
|
|
179
|
+
regions: r,
|
|
180
|
+
activeWidgetId: n,
|
|
181
|
+
activeResourceKey: o
|
|
182
|
+
};
|
|
183
|
+
}, Rt = (e, t = {}) => {
|
|
184
|
+
const r = kt(t), n = Object.fromEntries(H.flatMap((o) => e.regions[o] ? [[o, e.regions[o]]] : []));
|
|
185
|
+
return Pr({
|
|
186
|
+
...e,
|
|
187
|
+
regions: {
|
|
188
|
+
...r.regions,
|
|
189
|
+
...n
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}, kr = (e) => {
|
|
107
193
|
const {
|
|
108
194
|
getLayout: t,
|
|
109
195
|
getWidgets: r,
|
|
@@ -111,31 +197,31 @@ const vr = () => {
|
|
|
111
197
|
} = e;
|
|
112
198
|
return {
|
|
113
199
|
getRegionSize(o) {
|
|
114
|
-
const s = t().regions[o].size, a =
|
|
200
|
+
const s = t().regions[o].size, a = Y(t().regions[o]), c = (a ? r()[a.contributionId]?.regionSize : n(o)?.regionSize) ?? e.getRegionSettings?.(o)?.size;
|
|
115
201
|
return s === void 0 ? c : {
|
|
116
202
|
...c,
|
|
117
203
|
defaultPx: s
|
|
118
204
|
};
|
|
119
205
|
},
|
|
120
206
|
getRegionCollapsible(o) {
|
|
121
|
-
const s =
|
|
207
|
+
const s = Y(t().regions[o]);
|
|
122
208
|
return s ? r()[s.contributionId]?.regionCollapsible ?? e.getRegionSettings?.(o)?.collapsible ?? !0 : n(o)?.regionCollapsible ?? e.getRegionSettings?.(o)?.collapsible ?? !0;
|
|
123
209
|
},
|
|
124
210
|
getRegionHeaderBorderBottom(o) {
|
|
125
|
-
const s =
|
|
211
|
+
const s = Y(t().regions[o]);
|
|
126
212
|
return s ? r()[s.contributionId]?.headerBorderBottom ?? !0 : !0;
|
|
127
213
|
}
|
|
128
214
|
};
|
|
129
|
-
},
|
|
215
|
+
}, Rr = (e) => {
|
|
130
216
|
const {
|
|
131
217
|
getPlaceholders: t,
|
|
132
218
|
getWidgets: r
|
|
133
219
|
} = e;
|
|
134
220
|
return {
|
|
135
|
-
listPlaceholders: () => Object.values(t()).sort(
|
|
136
|
-
listWidgets: () => Object.values(r()).sort(
|
|
221
|
+
listPlaceholders: () => Object.values(t()).sort(B),
|
|
222
|
+
listWidgets: () => Object.values(r()).sort(B)
|
|
137
223
|
};
|
|
138
|
-
},
|
|
224
|
+
}, Mr = (e) => {
|
|
139
225
|
const {
|
|
140
226
|
store: t,
|
|
141
227
|
getPlaceholders: r,
|
|
@@ -151,7 +237,7 @@ const vr = () => {
|
|
|
151
237
|
...c
|
|
152
238
|
} = s, g = {
|
|
153
239
|
...c,
|
|
154
|
-
...
|
|
240
|
+
...x({
|
|
155
241
|
...a,
|
|
156
242
|
priority: a?.priority ?? l
|
|
157
243
|
})
|
|
@@ -186,7 +272,7 @@ const vr = () => {
|
|
|
186
272
|
...m,
|
|
187
273
|
reuse: c ?? "resource",
|
|
188
274
|
singleton: g ?? !0,
|
|
189
|
-
...
|
|
275
|
+
...x({
|
|
190
276
|
...a,
|
|
191
277
|
priority: a?.priority ?? l
|
|
192
278
|
})
|
|
@@ -202,16 +288,16 @@ const vr = () => {
|
|
|
202
288
|
if (u.widgets[s.id] !== i) return;
|
|
203
289
|
const {
|
|
204
290
|
[s.id]: p,
|
|
205
|
-
...
|
|
206
|
-
} = u.widgets, f =
|
|
291
|
+
...y
|
|
292
|
+
} = u.widgets, f = wt(u.layout, s.id);
|
|
207
293
|
t.setState({
|
|
208
|
-
widgets:
|
|
294
|
+
widgets: y,
|
|
209
295
|
layout: f
|
|
210
296
|
}, !1, "unregisterWidget"), o();
|
|
211
297
|
});
|
|
212
298
|
}
|
|
213
299
|
};
|
|
214
|
-
},
|
|
300
|
+
}, Ee = (e, t, r = "end") => {
|
|
215
301
|
const n = [...e];
|
|
216
302
|
if (r === "start")
|
|
217
303
|
return n.unshift(t), n;
|
|
@@ -219,23 +305,23 @@ const vr = () => {
|
|
|
219
305
|
return n.push(t), n;
|
|
220
306
|
const o = "beforeWidgetId" in r ? r.beforeWidgetId : r.afterWidgetId, s = n.findIndex((a) => a.widgetId === o);
|
|
221
307
|
return s < 0 ? (n.push(t), n) : (n.splice(s + ("afterWidgetId" in r ? 1 : 0), 0, t), n);
|
|
222
|
-
},
|
|
223
|
-
if (t.tabRetention !== "preview") return
|
|
308
|
+
}, _ = (e, t, r) => {
|
|
309
|
+
if (t.tabRetention !== "preview") return Ee(e, t, r);
|
|
224
310
|
const n = e.filter((o) => o.tabRetention !== "preview" && o.widgetId !== t.widgetId);
|
|
225
|
-
return
|
|
226
|
-
},
|
|
311
|
+
return Ee(n, t, "start");
|
|
312
|
+
}, Cr = (e, t, r) => {
|
|
227
313
|
const n = e.find((s) => s.widgetId === t);
|
|
228
314
|
if (!n) return e;
|
|
229
315
|
if (n.tabRetention === "preview")
|
|
230
316
|
throw new Error(`Preview widget cannot be reordered: ${t}`);
|
|
231
317
|
const o = e.filter((s) => s.widgetId !== t);
|
|
232
|
-
return
|
|
233
|
-
},
|
|
318
|
+
return Ee(o, n, r);
|
|
319
|
+
}, Er = (e, t) => {
|
|
234
320
|
let r = e;
|
|
235
321
|
for (const o of Object.values(e.regions)) {
|
|
236
322
|
const s = o.widgets.filter(t);
|
|
237
323
|
if (s.length === 0) continue;
|
|
238
|
-
const a =
|
|
324
|
+
const a = Y(o);
|
|
239
325
|
r = V(r, o.id, (l) => l.filter((c) => !t(c)), {
|
|
240
326
|
clearActiveWidget: a ? t(a) : !1
|
|
241
327
|
});
|
|
@@ -247,13 +333,13 @@ const vr = () => {
|
|
|
247
333
|
activeWidgetId: void 0,
|
|
248
334
|
activeResourceKey: void 0
|
|
249
335
|
}), r;
|
|
250
|
-
},
|
|
336
|
+
}, Wr = (e, t) => Er(e, (r) => r.tabRetention === "preview" && (t === void 0 || r.ownerResourceKey !== t)), $r = (e) => ({
|
|
251
337
|
updateWidgetPlacement(t, r) {
|
|
252
338
|
const n = e.getLayout();
|
|
253
339
|
for (const o of Object.values(n.regions)) {
|
|
254
340
|
const s = o.widgets.findIndex((g) => g.widgetId === t);
|
|
255
341
|
if (s < 0) continue;
|
|
256
|
-
const a = e.requireWidget(o.widgets[s].contributionId), l =
|
|
342
|
+
const a = e.requireWidget(o.widgets[s].contributionId), l = te(o.widgets[s], a, r), c = V(n, o.id, (g) => g.map((m, i) => i === s ? l : m));
|
|
257
343
|
return e.setLayout(c), e.persistLayout(), l;
|
|
258
344
|
}
|
|
259
345
|
throw new Error(`Widget placement not found: ${t}`);
|
|
@@ -262,13 +348,13 @@ const vr = () => {
|
|
|
262
348
|
const n = e.getLayout();
|
|
263
349
|
for (const o of Object.values(n.regions))
|
|
264
350
|
if (o.widgets.some((s) => s.widgetId === t)) {
|
|
265
|
-
e.setLayout(V(n, o.id, (s) =>
|
|
351
|
+
e.setLayout(V(n, o.id, (s) => Cr(s, t, r))), e.persistLayout();
|
|
266
352
|
return;
|
|
267
353
|
}
|
|
268
354
|
throw new Error(`Widget placement not found: ${t}`);
|
|
269
355
|
},
|
|
270
356
|
expirePreviewTabs(t) {
|
|
271
|
-
e.setLayout(
|
|
357
|
+
e.setLayout(Wr(e.getLayout(), t)), e.persistLayout();
|
|
272
358
|
},
|
|
273
359
|
activateWidget(t) {
|
|
274
360
|
const r = e.getLayout();
|
|
@@ -278,7 +364,7 @@ const vr = () => {
|
|
|
278
364
|
}
|
|
279
365
|
throw new Error(`Widget placement not found: ${t}`);
|
|
280
366
|
}
|
|
281
|
-
}),
|
|
367
|
+
}), Lr = (e, t) => {
|
|
282
368
|
const r = {
|
|
283
369
|
...t.regions
|
|
284
370
|
};
|
|
@@ -296,7 +382,7 @@ const vr = () => {
|
|
|
296
382
|
...t,
|
|
297
383
|
regions: r
|
|
298
384
|
};
|
|
299
|
-
},
|
|
385
|
+
}, Kr = (e, t, r) => {
|
|
300
386
|
if (r.length === 0) return t;
|
|
301
387
|
const n = {
|
|
302
388
|
...t.regions
|
|
@@ -306,7 +392,7 @@ const vr = () => {
|
|
|
306
392
|
...t,
|
|
307
393
|
regions: n
|
|
308
394
|
};
|
|
309
|
-
},
|
|
395
|
+
}, Mt = (e, t) => t ? Rt(t, e) : kt(e), Ge = () => {
|
|
310
396
|
const e = /* @__PURE__ */ new Set();
|
|
311
397
|
return {
|
|
312
398
|
notify(t) {
|
|
@@ -316,14 +402,14 @@ const vr = () => {
|
|
|
316
402
|
return e.add(t), R(() => e.delete(t));
|
|
317
403
|
}
|
|
318
404
|
};
|
|
319
|
-
},
|
|
405
|
+
}, xr = (e) => {
|
|
320
406
|
let t, r = L("layout cache read for unscoped", () => e.persistence?.getLayout(void 0)) !== void 0;
|
|
321
407
|
const n = Ge(), o = Ge(), s = () => L(`layout cache for ${t ?? "unscoped"}`, () => e.persistence?.setLayout(e.getLayout(), t)), a = (l, c = {}) => {
|
|
322
408
|
if (t === l) return;
|
|
323
409
|
s(), n.notify(l), t = l;
|
|
324
410
|
const g = L(`layout cache read for ${t ?? "unscoped"}`, () => e.persistence?.getLayout(t));
|
|
325
411
|
r = g !== void 0;
|
|
326
|
-
const m =
|
|
412
|
+
const m = Mt(e.defaultRegionVisibility, g), i = Lr(e.getLayout(), m), d = Kr(e.getLayout(), i, c.carryRegionState ?? []);
|
|
327
413
|
e.setLayout(d, "setPersistenceScope"), o.notify(t);
|
|
328
414
|
};
|
|
329
415
|
return {
|
|
@@ -336,7 +422,7 @@ const vr = () => {
|
|
|
336
422
|
persistLayout: s,
|
|
337
423
|
setPersistenceScope: a
|
|
338
424
|
};
|
|
339
|
-
},
|
|
425
|
+
}, Or = (e) => {
|
|
340
426
|
for (const t of e.widget.ownedPanelMenuIds ?? []) {
|
|
341
427
|
const r = e.requireWidget(t);
|
|
342
428
|
e.openWidget(t, {
|
|
@@ -347,14 +433,14 @@ const vr = () => {
|
|
|
347
433
|
title: r.region === "main-left-menu" ? e.placement.resource?.label : r.title
|
|
348
434
|
});
|
|
349
435
|
}
|
|
350
|
-
},
|
|
436
|
+
}, Tr = (e, t, r) => {
|
|
351
437
|
if (!(!e.singleton && e.reuse === "none")) {
|
|
352
438
|
if (r.role === "sub-panel" || r.role === "panel-menu") {
|
|
353
439
|
const n = oe(t)?.resourceKey;
|
|
354
440
|
for (const o of Object.values(t.regions)) {
|
|
355
441
|
const s = o.widgets.findIndex((a) => a.contributionId === e.id && // Pinned placements are structural chrome, not per-location content, so they are
|
|
356
442
|
// reused across location switches instead of accumulating one instance per owner.
|
|
357
|
-
(a.pinned === !0 || e.singleton && a.ownerResourceKey === void 0 || a.ownerResourceKey === n) && (!r.resource || e.singleton && a.resourceKey === void 0 || a.resourceKey ===
|
|
443
|
+
(a.pinned === !0 || e.singleton && a.ownerResourceKey === void 0 || a.ownerResourceKey === n) && (!r.resource || e.singleton && a.resourceKey === void 0 || a.resourceKey === T(r.resource)));
|
|
358
444
|
if (s >= 0) return {
|
|
359
445
|
regionId: o.id,
|
|
360
446
|
index: s,
|
|
@@ -363,15 +449,15 @@ const vr = () => {
|
|
|
363
449
|
}
|
|
364
450
|
return;
|
|
365
451
|
}
|
|
366
|
-
return e.singleton ?
|
|
452
|
+
return e.singleton ? qe(t, e.id) : r.resource ? St(t, e.id, T(r.resource)) : qe(t, e.id);
|
|
367
453
|
}
|
|
368
|
-
},
|
|
454
|
+
}, jr = (e, t) => t.role ? t : e.panelMenuOwner ? {
|
|
369
455
|
...t,
|
|
370
456
|
role: "panel-menu"
|
|
371
457
|
} : e.eligibleLocations !== void 0 ? {
|
|
372
458
|
...t,
|
|
373
459
|
role: "sub-panel"
|
|
374
|
-
} : t,
|
|
460
|
+
} : t, Br = (e, t, r) => {
|
|
375
461
|
const n = e.regions[t], o = r.role === "location" ? e.activeLocationWidgetId : n.activeWidgetId;
|
|
376
462
|
if (r.replaceWidgetId)
|
|
377
463
|
return n.widgets.findIndex((a) => a.widgetId === r.replaceWidgetId);
|
|
@@ -380,7 +466,7 @@ const vr = () => {
|
|
|
380
466
|
if (!r.replaceActive) return -1;
|
|
381
467
|
const s = t === "main" && r.resource && e.activeLocationWidgetId ? e.activeLocationWidgetId : o;
|
|
382
468
|
return n.widgets.findIndex((a) => a.widgetId === s && !a.pinned);
|
|
383
|
-
},
|
|
469
|
+
}, Dr = (e, t, r) => {
|
|
384
470
|
const n = e.find((o) => {
|
|
385
471
|
try {
|
|
386
472
|
return t.priority > r(o.contributionId).priority;
|
|
@@ -391,7 +477,7 @@ const vr = () => {
|
|
|
391
477
|
return n ? {
|
|
392
478
|
beforeWidgetId: n.widgetId
|
|
393
479
|
} : void 0;
|
|
394
|
-
},
|
|
480
|
+
}, Ar = (e) => {
|
|
395
481
|
const {
|
|
396
482
|
getLayout: t,
|
|
397
483
|
requireWidget: r,
|
|
@@ -400,87 +486,87 @@ const vr = () => {
|
|
|
400
486
|
...m,
|
|
401
487
|
ownerResourceKey: oe(i)?.resourceKey
|
|
402
488
|
}, s = (m, i, d) => {
|
|
403
|
-
const u = o(
|
|
404
|
-
const f =
|
|
405
|
-
return d.tabPosition ?
|
|
489
|
+
const u = o(te(i.placement, m, d), t()), p = V(t(), i.regionId, (y) => {
|
|
490
|
+
const f = y.map((v, S) => S === i.index ? u : v);
|
|
491
|
+
return d.tabPosition ? _(f.filter((v) => v.widgetId !== u.widgetId), u, d.tabPosition) : f;
|
|
406
492
|
});
|
|
407
493
|
return n(p, i.regionId, u);
|
|
408
494
|
}, a = (m, i, d, u, p) => {
|
|
409
|
-
const
|
|
410
|
-
const S = v.map((k,
|
|
411
|
-
return
|
|
495
|
+
const y = o(te(u, m, p), t()), f = V(t(), i, (v) => {
|
|
496
|
+
const S = v.map((k, w) => w === d ? y : k);
|
|
497
|
+
return y.tabRetention !== "preview" ? S : _(S, y, "start");
|
|
412
498
|
});
|
|
413
|
-
return n(f, i,
|
|
499
|
+
return n(f, i, y);
|
|
414
500
|
}, l = (m, i, d, u, p) => {
|
|
415
501
|
if (p.tabRetention === "preview" && i.placement.tabRetention !== "preview")
|
|
416
502
|
return n(t(), i.regionId, i.placement);
|
|
417
503
|
if (i.regionId !== d) {
|
|
418
|
-
const v = o(
|
|
504
|
+
const v = o(te(i.placement, m, p), t()), S = V(t(), i.regionId, (w) => w.filter((h, I) => I !== i.index), {
|
|
419
505
|
clearActiveWidget: t().regions[i.regionId].activeWidgetId === i.placement.widgetId
|
|
420
|
-
}), k = V(S, d, (
|
|
421
|
-
if (u < 0) return
|
|
422
|
-
const
|
|
423
|
-
return
|
|
506
|
+
}), k = V(S, d, (w) => {
|
|
507
|
+
if (u < 0) return _(w, v, p.tabPosition);
|
|
508
|
+
const h = [...w];
|
|
509
|
+
return h.splice(u, 1, v), v.tabRetention === "preview" ? _(h, v, "start") : h;
|
|
424
510
|
});
|
|
425
511
|
return n(k, d, v);
|
|
426
512
|
}
|
|
427
513
|
if (u < 0 || i.index === u)
|
|
428
514
|
return s(m, i, p);
|
|
429
|
-
const
|
|
430
|
-
return n(f, d,
|
|
515
|
+
const y = o(te(i.placement, m, p), t()), f = V(t(), d, (v) => _(v.map((S, k) => k === i.index ? y : S).filter((S, k) => k !== u && k !== i.index), y, p.tabPosition));
|
|
516
|
+
return n(f, d, y);
|
|
431
517
|
}, c = (m, i, d, u) => {
|
|
432
|
-
const p =
|
|
518
|
+
const p = tr(t(), m.id), y = o(pe(p, m, u), t()), f = V(t(), i, (v) => {
|
|
433
519
|
if (d < 0)
|
|
434
|
-
return
|
|
520
|
+
return _(v, y, u.tabPosition ?? Dr(v, m, r));
|
|
435
521
|
const S = [...v];
|
|
436
|
-
return S.splice(d, 1,
|
|
522
|
+
return S.splice(d, 1, y), y.tabRetention === "preview" ? _(S, y, "start") : S;
|
|
437
523
|
});
|
|
438
|
-
return n(f, i,
|
|
524
|
+
return n(f, i, y);
|
|
439
525
|
}, g = (m, i = {}) => {
|
|
440
|
-
const d = r(m), u =
|
|
441
|
-
let
|
|
442
|
-
return k ?
|
|
526
|
+
const d = r(m), u = jr(d, i), p = t(), y = u.region ?? d.region ?? d.fallbackRegion ?? "main", f = p.regions[y], v = Br(p, y, u), S = v >= 0 ? f.widgets[v] : void 0, k = !u.replaceWidgetId && u.tabRetention === "preview" && u.resource ? St(p, d.id, T(u.resource)) : void 0, w = u.replaceWidgetId && S ? void 0 : Tr(d, p, u);
|
|
527
|
+
let h;
|
|
528
|
+
return k ? h = n(p, k.regionId, k.placement) : w ? h = l(d, w, y, v, u) : S?.contributionId === d.id ? h = a(d, y, v, S, u) : h = c(d, y, v, u), Or({
|
|
443
529
|
openWidget: g,
|
|
444
|
-
placement:
|
|
530
|
+
placement: h,
|
|
445
531
|
requireWidget: r,
|
|
446
532
|
widget: d
|
|
447
|
-
}), n(t(), k?.regionId ??
|
|
533
|
+
}), n(t(), k?.regionId ?? y, h);
|
|
448
534
|
};
|
|
449
535
|
return {
|
|
450
536
|
openWidget: g
|
|
451
537
|
};
|
|
452
|
-
},
|
|
538
|
+
}, Vr = (e, t) => {
|
|
453
539
|
if (t.pinned) return "persistent";
|
|
454
540
|
const r = t.region ?? e.region ?? e.fallbackRegion ?? "main";
|
|
455
541
|
return se.includes(r) ? "preview" : "persistent";
|
|
456
|
-
},
|
|
542
|
+
}, Fr = (e) => ({
|
|
457
543
|
getPanel(t) {
|
|
458
544
|
const r = e.getWidgets()[t];
|
|
459
|
-
return r ?
|
|
545
|
+
return r ? Ue(r) : void 0;
|
|
460
546
|
},
|
|
461
|
-
listPanels: () => e.listWidgets().map(
|
|
547
|
+
listPanels: () => e.listWidgets().map(Ue),
|
|
462
548
|
listPanelInstances(t) {
|
|
463
|
-
return (t ? e.getLayout().regions[t].widgets : Object.values(e.getLayout().regions).flatMap((n) => n.widgets)).map(
|
|
549
|
+
return (t ? e.getLayout().regions[t].widgets : Object.values(e.getLayout().regions).flatMap((n) => n.widgets)).map(q);
|
|
464
550
|
},
|
|
465
551
|
getActivePanel(t) {
|
|
466
552
|
if (t) {
|
|
467
553
|
const o = e.getLayout().regions[t], s = o.widgets.find((a) => a.widgetId === o.activeWidgetId) ?? o.widgets[0];
|
|
468
|
-
return s ?
|
|
554
|
+
return s ? q(s) : void 0;
|
|
469
555
|
}
|
|
470
556
|
const r = e.getLayout().activeWidgetId;
|
|
471
557
|
if (!r) return;
|
|
472
558
|
const n = F(e.getLayout(), r);
|
|
473
|
-
return n ?
|
|
559
|
+
return n ? q(n.placement) : void 0;
|
|
474
560
|
},
|
|
475
561
|
openPanel(t, r = {}) {
|
|
476
562
|
const n = e.getWidgets()[t];
|
|
477
563
|
if (!n) throw new Error(`Panel not registered: ${t}`);
|
|
478
|
-
return
|
|
564
|
+
return q(e.widgetOpeners.openWidget(t, _e(r, Vr(n, r))));
|
|
479
565
|
},
|
|
480
566
|
updatePanel(t, r) {
|
|
481
567
|
if (!F(e.getLayout(), t))
|
|
482
568
|
throw new Error(`Panel instance not found: ${t}`);
|
|
483
|
-
return
|
|
569
|
+
return q(e.placementMethods.updateWidgetPlacement(t, _e(r)));
|
|
484
570
|
},
|
|
485
571
|
reorderPanel(t, r) {
|
|
486
572
|
if (!F(e.getLayout(), t))
|
|
@@ -490,7 +576,7 @@ const vr = () => {
|
|
|
490
576
|
activatePanel(t) {
|
|
491
577
|
if (!F(e.getLayout(), t))
|
|
492
578
|
throw new Error(`Panel instance not found: ${t}`);
|
|
493
|
-
return
|
|
579
|
+
return q(e.placementMethods.activateWidget(t));
|
|
494
580
|
},
|
|
495
581
|
closePanel(t) {
|
|
496
582
|
const r = F(e.getLayout(), t);
|
|
@@ -498,9 +584,9 @@ const vr = () => {
|
|
|
498
584
|
if (r.placement.closable !== !0) throw new Error(`Panel cannot be closed: ${t}`);
|
|
499
585
|
const n = Me(e.getLayout(), t);
|
|
500
586
|
if (!n) throw new Error(`Panel instance not found: ${t}`);
|
|
501
|
-
return e.setLayout(n.layout), e.persistLayout(), n.activePlacement ?
|
|
587
|
+
return e.setLayout(n.layout), e.persistLayout(), n.activePlacement ? q(n.activePlacement) : void 0;
|
|
502
588
|
}
|
|
503
|
-
}),
|
|
589
|
+
}), Nr = Object.values(de).flatMap((e) => Object.values(e)), zr = (e) => e.endsWith("-left-menu") ? "left" : "right", qr = (e, t) => e(t)?.panelMenuOwner?.contributionId, _r = (e, t) => {
|
|
504
590
|
for (const r of se) {
|
|
505
591
|
const n = e.regions[r].widgets.find((o) => o.contributionId === t);
|
|
506
592
|
if (n) return {
|
|
@@ -508,11 +594,11 @@ const vr = () => {
|
|
|
508
594
|
placement: n
|
|
509
595
|
};
|
|
510
596
|
}
|
|
511
|
-
},
|
|
597
|
+
}, Ur = (e, t, r) => {
|
|
512
598
|
const n = [], o = [], s = /* @__PURE__ */ new Set();
|
|
513
599
|
let a = !1;
|
|
514
600
|
for (const l of e.regions[r].widgets) {
|
|
515
|
-
const c =
|
|
601
|
+
const c = qr(t, l.contributionId);
|
|
516
602
|
if (!c) {
|
|
517
603
|
n.push(l);
|
|
518
604
|
continue;
|
|
@@ -522,7 +608,7 @@ const vr = () => {
|
|
|
522
608
|
continue;
|
|
523
609
|
}
|
|
524
610
|
s.add(l.contributionId);
|
|
525
|
-
const g =
|
|
611
|
+
const g = _r(e, c);
|
|
526
612
|
if (!g) {
|
|
527
613
|
a = !0;
|
|
528
614
|
continue;
|
|
@@ -532,7 +618,7 @@ const vr = () => {
|
|
|
532
618
|
ownerResourceKey: g.placement.resourceKey
|
|
533
619
|
};
|
|
534
620
|
m !== l && (a = !0);
|
|
535
|
-
const i = de[g.region][
|
|
621
|
+
const i = de[g.region][zr(r)];
|
|
536
622
|
if (i === r) {
|
|
537
623
|
n.push(m);
|
|
538
624
|
continue;
|
|
@@ -547,14 +633,14 @@ const vr = () => {
|
|
|
547
633
|
moves: o,
|
|
548
634
|
placements: n
|
|
549
635
|
};
|
|
550
|
-
},
|
|
636
|
+
}, Hr = (e, t) => {
|
|
551
637
|
let r = !1;
|
|
552
638
|
const n = {
|
|
553
639
|
...e.regions
|
|
554
640
|
}, o = [];
|
|
555
|
-
for (const s of
|
|
641
|
+
for (const s of Nr) {
|
|
556
642
|
if (e.regions[s].widgets.length === 0) continue;
|
|
557
|
-
const a =
|
|
643
|
+
const a = Ur(e, t, s);
|
|
558
644
|
if (o.push(...a.moves), !a.changed) continue;
|
|
559
645
|
r = !0;
|
|
560
646
|
const l = n[s];
|
|
@@ -575,9 +661,9 @@ const vr = () => {
|
|
|
575
661
|
...e,
|
|
576
662
|
regions: n
|
|
577
663
|
} : e;
|
|
578
|
-
},
|
|
664
|
+
}, Qr = (e) => {
|
|
579
665
|
const t = () => {
|
|
580
|
-
const n =
|
|
666
|
+
const n = Hr(e.getLayout(), e.getWidget);
|
|
581
667
|
n !== e.getLayout() && (e.setLayout(n), e.persistLayout());
|
|
582
668
|
};
|
|
583
669
|
return {
|
|
@@ -587,7 +673,7 @@ const vr = () => {
|
|
|
587
673
|
},
|
|
588
674
|
reconcilePanelMenus: t
|
|
589
675
|
};
|
|
590
|
-
},
|
|
676
|
+
}, Jr = (e, t, r) => {
|
|
591
677
|
const {
|
|
592
678
|
side: n,
|
|
593
679
|
...o
|
|
@@ -601,7 +687,7 @@ const vr = () => {
|
|
|
601
687
|
contributionId: e.id
|
|
602
688
|
}
|
|
603
689
|
};
|
|
604
|
-
},
|
|
690
|
+
}, Gr = (e) => {
|
|
605
691
|
const {
|
|
606
692
|
kind: t,
|
|
607
693
|
metadata: r,
|
|
@@ -620,7 +706,7 @@ const vr = () => {
|
|
|
620
706
|
};
|
|
621
707
|
l.push(o(c, r));
|
|
622
708
|
for (const g of s)
|
|
623
|
-
l.push(o(
|
|
709
|
+
l.push(o(Jr(n, g, t), r));
|
|
624
710
|
} catch (c) {
|
|
625
711
|
for (const g of l.reverse()) g.dispose();
|
|
626
712
|
throw c;
|
|
@@ -628,8 +714,8 @@ const vr = () => {
|
|
|
628
714
|
return R(() => {
|
|
629
715
|
for (const c of l.reverse()) c.dispose();
|
|
630
716
|
});
|
|
631
|
-
},
|
|
632
|
-
registerPanel: (n, o) =>
|
|
717
|
+
}, Yr = (e) => ({
|
|
718
|
+
registerPanel: (n, o) => Gr({
|
|
633
719
|
panel: n,
|
|
634
720
|
kind: n.eligibleLocations ? "sub-panel" : "panel",
|
|
635
721
|
metadata: o,
|
|
@@ -641,7 +727,7 @@ const vr = () => {
|
|
|
641
727
|
level: "panel"
|
|
642
728
|
}
|
|
643
729
|
}, o)
|
|
644
|
-
}),
|
|
730
|
+
}), Xr = (e) => (t) => {
|
|
645
731
|
const r = e.getLayout(), n = F(r, t);
|
|
646
732
|
if (!n) throw new Error(`Panel instance not found: ${t}`);
|
|
647
733
|
if (n.regionId !== "main" || n.placement.role === "sub-panel" || n.placement.role === "panel-menu")
|
|
@@ -660,27 +746,27 @@ const vr = () => {
|
|
|
660
746
|
...r,
|
|
661
747
|
regions: a
|
|
662
748
|
}, "main", o), e.panelMethods.getActivePanel("main");
|
|
663
|
-
},
|
|
749
|
+
}, Zr = (e, t) => {
|
|
664
750
|
const r = e[t];
|
|
665
751
|
if (!r) throw new Error(`Widget not registered: ${t}`);
|
|
666
752
|
return r;
|
|
667
|
-
},
|
|
668
|
-
const t = e.persistence?.getLayout(void 0), r =
|
|
753
|
+
}, en = (e = {}) => {
|
|
754
|
+
const t = e.persistence?.getLayout(void 0), r = Mt(e.defaultRegionVisibility, t), n = W({
|
|
669
755
|
name: "workbench.layout",
|
|
670
756
|
initialState: {
|
|
671
757
|
layout: r,
|
|
672
758
|
widgets: {},
|
|
673
759
|
placeholders: {}
|
|
674
760
|
}
|
|
675
|
-
}), o = () => n.getState().layout, s = () => n.getState().placeholders, a = () => n.getState().widgets, l = (b) => s()[b], c =
|
|
761
|
+
}), o = () => n.getState().layout, s = () => n.getState().placeholders, a = () => n.getState().widgets, l = (b) => s()[b], c = kr({
|
|
676
762
|
getLayout: o,
|
|
677
763
|
getWidgets: a,
|
|
678
764
|
getPlaceholder: l,
|
|
679
765
|
getRegionSettings: e.getRegionSettings
|
|
680
|
-
}), g =
|
|
766
|
+
}), g = Rr({
|
|
681
767
|
getPlaceholders: s,
|
|
682
768
|
getWidgets: a
|
|
683
|
-
}), m =
|
|
769
|
+
}), m = xr({
|
|
684
770
|
defaultRegionVisibility: e.defaultRegionVisibility,
|
|
685
771
|
getLayout: o,
|
|
686
772
|
persistence: e.persistence,
|
|
@@ -688,39 +774,39 @@ const vr = () => {
|
|
|
688
774
|
...n.getState(),
|
|
689
775
|
layout: b
|
|
690
776
|
}, !1, P)
|
|
691
|
-
}), i = () => m.persistLayout(), d = (b) =>
|
|
777
|
+
}), i = () => m.persistLayout(), d = (b) => Zr(a(), b), u = (b) => {
|
|
692
778
|
const P = n.getState();
|
|
693
779
|
P.layout !== b && n.setState({
|
|
694
780
|
...P,
|
|
695
781
|
layout: b
|
|
696
782
|
}, !1, "setLayout");
|
|
697
783
|
}, p = (b, P) => {
|
|
698
|
-
const M = o(),
|
|
699
|
-
|
|
784
|
+
const M = o(), $ = M.regions[b], K = P($);
|
|
785
|
+
K !== $ && (u({
|
|
700
786
|
...M,
|
|
701
787
|
regions: {
|
|
702
788
|
...M.regions,
|
|
703
|
-
[b]:
|
|
789
|
+
[b]: K
|
|
704
790
|
}
|
|
705
791
|
}), i());
|
|
706
|
-
},
|
|
792
|
+
}, y = (b, P, M) => (u(It(b, P, M)), i(), M), f = Mr({
|
|
707
793
|
store: n,
|
|
708
794
|
getPlaceholders: s,
|
|
709
795
|
getWidgets: a,
|
|
710
796
|
persistLayout: i
|
|
711
|
-
}), v =
|
|
797
|
+
}), v = Yr({
|
|
712
798
|
registerWidget: f.registerWidget
|
|
713
|
-
}), S =
|
|
799
|
+
}), S = Ar({
|
|
714
800
|
getLayout: o,
|
|
715
801
|
requireWidget: d,
|
|
716
|
-
applyAndActivate:
|
|
717
|
-
}), k =
|
|
802
|
+
applyAndActivate: y
|
|
803
|
+
}), k = $r({
|
|
718
804
|
getLayout: o,
|
|
719
805
|
requireWidget: d,
|
|
720
806
|
setLayout: u,
|
|
721
807
|
persistLayout: i,
|
|
722
|
-
applyAndActivate:
|
|
723
|
-
}),
|
|
808
|
+
applyAndActivate: y
|
|
809
|
+
}), w = Fr({
|
|
724
810
|
getLayout: o,
|
|
725
811
|
getWidgets: a,
|
|
726
812
|
listWidgets: g.listWidgets,
|
|
@@ -728,17 +814,17 @@ const vr = () => {
|
|
|
728
814
|
placementMethods: k,
|
|
729
815
|
setLayout: u,
|
|
730
816
|
widgetOpeners: S
|
|
731
|
-
}),
|
|
817
|
+
}), h = Qr({
|
|
732
818
|
getLayout: o,
|
|
733
819
|
getWidget: (b) => a()[b],
|
|
734
820
|
openWidget: S.openWidget,
|
|
735
821
|
persistLayout: i,
|
|
736
822
|
setLayout: u
|
|
737
|
-
}), I =
|
|
738
|
-
applyAndActivate:
|
|
823
|
+
}), I = Xr({
|
|
824
|
+
applyAndActivate: y,
|
|
739
825
|
getLayout: o,
|
|
740
826
|
getWidget: d,
|
|
741
|
-
panelMethods:
|
|
827
|
+
panelMethods: w
|
|
742
828
|
});
|
|
743
829
|
return {
|
|
744
830
|
store: n,
|
|
@@ -749,12 +835,12 @@ const vr = () => {
|
|
|
749
835
|
const M = n.getState();
|
|
750
836
|
if (!M.widgets[b]) return;
|
|
751
837
|
const {
|
|
752
|
-
[b]:
|
|
753
|
-
...
|
|
754
|
-
} = M.widgets, D = P.removePlacements === !1 ? M.layout :
|
|
838
|
+
[b]: $,
|
|
839
|
+
...K
|
|
840
|
+
} = M.widgets, D = P.removePlacements === !1 ? M.layout : wt(M.layout, b);
|
|
755
841
|
n.setState({
|
|
756
842
|
...M,
|
|
757
|
-
widgets:
|
|
843
|
+
widgets: K,
|
|
758
844
|
layout: D
|
|
759
845
|
}, !1, "unregisterWidget"), P.persist !== !1 && i();
|
|
760
846
|
},
|
|
@@ -780,13 +866,13 @@ const vr = () => {
|
|
|
780
866
|
},
|
|
781
867
|
listPlaceholders: g.listPlaceholders,
|
|
782
868
|
listWidgets: g.listWidgets,
|
|
783
|
-
...
|
|
784
|
-
openWidget:
|
|
869
|
+
...w,
|
|
870
|
+
openWidget: h.openWidget,
|
|
785
871
|
...k,
|
|
786
872
|
establishLocation: I,
|
|
787
|
-
reconcilePanelMenus:
|
|
873
|
+
reconcilePanelMenus: h.reconcilePanelMenus,
|
|
788
874
|
setRegionActiveWidget(b, P) {
|
|
789
|
-
const M =
|
|
875
|
+
const M = nr(o(), b, P);
|
|
790
876
|
M && (u(M), i());
|
|
791
877
|
},
|
|
792
878
|
closeWidget(b) {
|
|
@@ -801,7 +887,7 @@ const vr = () => {
|
|
|
801
887
|
return u(P.layout), i(), P.activePlacement;
|
|
802
888
|
},
|
|
803
889
|
clearRegion(b) {
|
|
804
|
-
const P = o(), M = P.regions[b],
|
|
890
|
+
const P = o(), M = P.regions[b], $ = M.activeWidgetId, K = {
|
|
805
891
|
...P,
|
|
806
892
|
regions: {
|
|
807
893
|
...P.regions,
|
|
@@ -812,18 +898,18 @@ const vr = () => {
|
|
|
812
898
|
}
|
|
813
899
|
}
|
|
814
900
|
};
|
|
815
|
-
let D =
|
|
816
|
-
...
|
|
901
|
+
let D = $ && P.activeWidgetId === $ ? {
|
|
902
|
+
...K,
|
|
817
903
|
activeWidgetId: void 0,
|
|
818
904
|
activeResourceKey: void 0
|
|
819
|
-
} :
|
|
820
|
-
b !== "side" && se.includes(b) && (D =
|
|
905
|
+
} : K;
|
|
906
|
+
b !== "side" && se.includes(b) && (D = rr(D, oe(D), b, void 0)), u(D), i();
|
|
821
907
|
},
|
|
822
908
|
resetRegions() {
|
|
823
909
|
const b = o(), P = {};
|
|
824
|
-
for (const [M,
|
|
910
|
+
for (const [M, $] of Object.entries(b.regions))
|
|
825
911
|
P[M] = {
|
|
826
|
-
|
|
912
|
+
...$,
|
|
827
913
|
widgets: [],
|
|
828
914
|
activeWidgetId: void 0
|
|
829
915
|
};
|
|
@@ -837,7 +923,7 @@ const vr = () => {
|
|
|
837
923
|
},
|
|
838
924
|
getLayout: o,
|
|
839
925
|
restoreLayout(b) {
|
|
840
|
-
u(
|
|
926
|
+
u(Rt(b, e.defaultRegionVisibility)), i();
|
|
841
927
|
},
|
|
842
928
|
setPersistenceScope: m.setPersistenceScope,
|
|
843
929
|
getPersistenceScope: m.getPersistenceScope,
|
|
@@ -846,14 +932,14 @@ const vr = () => {
|
|
|
846
932
|
onWillChangePersistenceScope: m.onWillChangePersistenceScope,
|
|
847
933
|
onDidChangePersistenceScope: m.onDidChangePersistenceScope
|
|
848
934
|
};
|
|
849
|
-
},
|
|
850
|
-
|
|
851
|
-
},
|
|
852
|
-
const n =
|
|
935
|
+
}, Ct = /* @__PURE__ */ new WeakMap(), tn = (e, t) => {
|
|
936
|
+
Ct.set(e, t);
|
|
937
|
+
}, rn = (e, t, r) => {
|
|
938
|
+
const n = Ct.get(e);
|
|
853
939
|
if (!n) throw new Error("Workbench mode registry internals are unavailable");
|
|
854
940
|
n.activatePageMode(t, r);
|
|
855
|
-
}, Ye = (e) => e ? Array.isArray(e) ? [...e] : [e] : [],
|
|
856
|
-
const t =
|
|
941
|
+
}, Ye = (e) => e ? Array.isArray(e) ? [...e] : [e] : [], nn = (e) => {
|
|
942
|
+
const t = W({
|
|
857
943
|
name: "workbench.modes",
|
|
858
944
|
initialState: {
|
|
859
945
|
modes: {},
|
|
@@ -861,93 +947,93 @@ const vr = () => {
|
|
|
861
947
|
}
|
|
862
948
|
}), r = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
863
949
|
let s = [], a, l, c = !1;
|
|
864
|
-
const g = (
|
|
865
|
-
if (r.has(
|
|
866
|
-
const
|
|
867
|
-
r.set(
|
|
868
|
-
}, m = (
|
|
950
|
+
const g = (w) => {
|
|
951
|
+
if (r.has(w.id)) return;
|
|
952
|
+
const h = Ye(L(`mode ${w.id}.activate`, () => w.activate(e.resolveContext())));
|
|
953
|
+
r.set(w.id, h);
|
|
954
|
+
}, m = (w, h) => {
|
|
869
955
|
let I = !1, b = () => {
|
|
870
956
|
};
|
|
871
957
|
const P = () => {
|
|
872
958
|
if (I) return;
|
|
873
|
-
const M =
|
|
959
|
+
const M = h.layout.getActivePanel("main");
|
|
874
960
|
if (!M) return;
|
|
875
|
-
const
|
|
876
|
-
|
|
961
|
+
const $ = h.layout.getLayout().regions.main.widgets.find((K) => K.widgetId === M.instanceId);
|
|
962
|
+
$ && ($.role === "sub-panel" || $.role === "panel-menu") || (I = !0, b(), e.establishLocation?.(M.instanceId));
|
|
877
963
|
};
|
|
878
|
-
b =
|
|
964
|
+
b = h.layout.store.subscribeSelector((M) => M.layout.regions.main, P);
|
|
879
965
|
try {
|
|
880
|
-
L(`mode ${
|
|
966
|
+
L(`mode ${w.id}.seed`, () => w.seed?.(h)), P();
|
|
881
967
|
} finally {
|
|
882
968
|
b();
|
|
883
969
|
}
|
|
884
|
-
}, i = (
|
|
885
|
-
const
|
|
886
|
-
|
|
887
|
-
}, d = (
|
|
888
|
-
i(
|
|
889
|
-
}, u = (
|
|
890
|
-
const
|
|
891
|
-
if (I && b && o.set(I,
|
|
970
|
+
}, i = (w) => {
|
|
971
|
+
const h = e.resolveContext(), I = `${w.id}\0${h.layout.getPersistenceScope() ?? "unscoped"}`, b = or(h.layout.getLayout(), He(w));
|
|
972
|
+
Qe(h, b), h.layout.reconcilePanelMenus(), !n.has(I) && !h.layout.enteredWithPersistedLayout() && m(w, h), n.add(I);
|
|
973
|
+
}, d = (w) => {
|
|
974
|
+
i(w), L(`mode ${w.id}.reconcile`, () => w.reconcile?.(e.resolveContext()));
|
|
975
|
+
}, u = (w) => {
|
|
976
|
+
const h = e.resolveContext(), I = t.getState().activeModeId, b = h.layout.getPersistenceScope() === void 0;
|
|
977
|
+
if (I && b && o.set(I, h.layout.getLayout()), y(), w === void 0) {
|
|
892
978
|
t.setState({
|
|
893
979
|
...t.getState(),
|
|
894
980
|
activeModeId: void 0
|
|
895
981
|
}, !1, "deactivateMode");
|
|
896
982
|
return;
|
|
897
983
|
}
|
|
898
|
-
const P = t.getState().modes[
|
|
899
|
-
if (!P) throw new Error(`Workbench mode not registered: ${
|
|
900
|
-
b &&
|
|
901
|
-
seed: l !==
|
|
984
|
+
const P = t.getState().modes[w];
|
|
985
|
+
if (!P) throw new Error(`Workbench mode not registered: ${w}`);
|
|
986
|
+
b && Qe(h, sr(h.layout.getLayout(), o.get(w), He(P))), f(w, {
|
|
987
|
+
seed: l !== w
|
|
902
988
|
});
|
|
903
|
-
}, p = (
|
|
904
|
-
if (
|
|
905
|
-
if (
|
|
906
|
-
|
|
989
|
+
}, p = (w, h) => {
|
|
990
|
+
if (w && !t.getState().modes[w]) throw new Error(`Workbench mode not registered: ${w}`);
|
|
991
|
+
if (w === t.getState().activeModeId) {
|
|
992
|
+
h();
|
|
907
993
|
return;
|
|
908
994
|
}
|
|
909
995
|
c = !0, l = void 0;
|
|
910
996
|
try {
|
|
911
|
-
if (
|
|
997
|
+
if (y(), w === void 0) {
|
|
912
998
|
t.setState({
|
|
913
999
|
...t.getState(),
|
|
914
1000
|
activeModeId: void 0
|
|
915
|
-
}, !1, "deactivatePageMode"),
|
|
1001
|
+
}, !1, "deactivatePageMode"), h();
|
|
916
1002
|
return;
|
|
917
1003
|
}
|
|
918
|
-
f(
|
|
1004
|
+
f(w, {
|
|
919
1005
|
seed: !1,
|
|
920
|
-
afterPublish:
|
|
1006
|
+
afterPublish: h
|
|
921
1007
|
});
|
|
922
1008
|
} finally {
|
|
923
1009
|
c = !1;
|
|
924
1010
|
}
|
|
925
|
-
},
|
|
1011
|
+
}, y = () => {
|
|
926
1012
|
Ie(s), s = [], a?.dispose(), a = void 0;
|
|
927
|
-
}, f = (
|
|
928
|
-
const I = e.resolveContext(), b = t.getState().modes[
|
|
929
|
-
if (!b) throw new Error(`Workbench mode not registered: ${
|
|
1013
|
+
}, f = (w, h) => {
|
|
1014
|
+
const I = e.resolveContext(), b = t.getState().modes[w];
|
|
1015
|
+
if (!b) throw new Error(`Workbench mode not registered: ${w}`);
|
|
930
1016
|
const P = I.context.createScope("workbench.mode");
|
|
931
|
-
P.set("activeWorkbenchMode",
|
|
1017
|
+
P.set("activeWorkbenchMode", w), P.set(`workbenchMode.${w}`, !0), a = P;
|
|
932
1018
|
try {
|
|
933
1019
|
g(b), t.setState({
|
|
934
1020
|
...t.getState(),
|
|
935
|
-
activeModeId:
|
|
936
|
-
}, !1, "activateMode"),
|
|
1021
|
+
activeModeId: w
|
|
1022
|
+
}, !1, "activateMode"), h.afterPublish?.(), h.seed && i(b), s = Ye(L(`mode ${b.id}.enter`, () => b.enter?.(I))), h.seed && L(`mode ${b.id}.reconcile`, () => b.reconcile?.(e.resolveContext()));
|
|
937
1023
|
} catch (M) {
|
|
938
|
-
throw
|
|
1024
|
+
throw y(), t.setState({
|
|
939
1025
|
...t.getState(),
|
|
940
1026
|
activeModeId: void 0
|
|
941
1027
|
}, !1, "deactivateMode"), M;
|
|
942
1028
|
}
|
|
943
1029
|
}, v = e.layout.onDidChangePersistenceScope(() => {
|
|
944
|
-
const
|
|
945
|
-
if (
|
|
946
|
-
const
|
|
947
|
-
|
|
1030
|
+
const w = t.getState().activeModeId;
|
|
1031
|
+
if (w === l) return;
|
|
1032
|
+
const h = w ? t.getState().modes[w] : void 0;
|
|
1033
|
+
h && d(h);
|
|
948
1034
|
}), S = R(() => {
|
|
949
|
-
v.dispose(),
|
|
950
|
-
for (const
|
|
1035
|
+
v.dispose(), y();
|
|
1036
|
+
for (const w of r.values()) Ie(w);
|
|
951
1037
|
r.clear(), n.clear(), o.clear(), t.setState({
|
|
952
1038
|
modes: {},
|
|
953
1039
|
activeModeId: void 0
|
|
@@ -957,26 +1043,26 @@ const vr = () => {
|
|
|
957
1043
|
dispose() {
|
|
958
1044
|
S.dispose();
|
|
959
1045
|
},
|
|
960
|
-
registerMode(
|
|
961
|
-
const
|
|
962
|
-
if (
|
|
1046
|
+
registerMode(w) {
|
|
1047
|
+
const h = t.getState();
|
|
1048
|
+
if (h.modes[w.id]) throw new Error(`Workbench mode already registered: ${w.id}`);
|
|
963
1049
|
return t.setState({
|
|
964
|
-
...
|
|
1050
|
+
...h,
|
|
965
1051
|
modes: {
|
|
966
|
-
...
|
|
967
|
-
[
|
|
1052
|
+
...h.modes,
|
|
1053
|
+
[w.id]: w
|
|
968
1054
|
}
|
|
969
1055
|
}, !1, "registerMode"), R(() => {
|
|
970
1056
|
const I = t.getState();
|
|
971
|
-
if (I.modes[
|
|
972
|
-
I.activeModeId ===
|
|
1057
|
+
if (I.modes[w.id] !== w) return;
|
|
1058
|
+
I.activeModeId === w.id && (y(), t.setState({
|
|
973
1059
|
...t.getState(),
|
|
974
1060
|
activeModeId: void 0
|
|
975
|
-
}, !1, "deactivateMode")), Ie(r.get(
|
|
1061
|
+
}, !1, "deactivateMode")), Ie(r.get(w.id) ?? []), r.delete(w.id), o.delete(w.id);
|
|
976
1062
|
for (const M of n)
|
|
977
|
-
M.startsWith(`${
|
|
1063
|
+
M.startsWith(`${w.id}\0`) && n.delete(M);
|
|
978
1064
|
const {
|
|
979
|
-
[
|
|
1065
|
+
[w.id]: b,
|
|
980
1066
|
...P
|
|
981
1067
|
} = I.modes;
|
|
982
1068
|
t.setState({
|
|
@@ -985,8 +1071,8 @@ const vr = () => {
|
|
|
985
1071
|
}, !1, "unregisterMode");
|
|
986
1072
|
});
|
|
987
1073
|
},
|
|
988
|
-
getMode(
|
|
989
|
-
return t.getState().modes[
|
|
1074
|
+
getMode(w) {
|
|
1075
|
+
return t.getState().modes[w];
|
|
990
1076
|
},
|
|
991
1077
|
listModes() {
|
|
992
1078
|
return Object.values(t.getState().modes);
|
|
@@ -1000,65 +1086,65 @@ const vr = () => {
|
|
|
1000
1086
|
isTransitioning() {
|
|
1001
1087
|
return c || l !== void 0;
|
|
1002
1088
|
},
|
|
1003
|
-
setActiveMode(
|
|
1004
|
-
if (
|
|
1005
|
-
const I =
|
|
1006
|
-
I &&
|
|
1089
|
+
setActiveMode(w, h = {}) {
|
|
1090
|
+
if (w === t.getState().activeModeId) {
|
|
1091
|
+
const I = w ? t.getState().modes[w] : void 0;
|
|
1092
|
+
I && w !== l && d(I);
|
|
1007
1093
|
return;
|
|
1008
1094
|
}
|
|
1009
|
-
c = !0, l =
|
|
1095
|
+
c = !0, l = h.deferSeed ? w : void 0;
|
|
1010
1096
|
try {
|
|
1011
|
-
u(
|
|
1097
|
+
u(w);
|
|
1012
1098
|
} finally {
|
|
1013
1099
|
c = !1;
|
|
1014
1100
|
}
|
|
1015
1101
|
},
|
|
1016
1102
|
seedActiveMode() {
|
|
1017
|
-
const
|
|
1103
|
+
const w = t.getState().activeModeId, h = w ? t.getState().modes[w] : void 0;
|
|
1018
1104
|
c = !0;
|
|
1019
1105
|
try {
|
|
1020
|
-
|
|
1106
|
+
h && d(h);
|
|
1021
1107
|
} finally {
|
|
1022
1108
|
l = void 0, c = !1;
|
|
1023
1109
|
}
|
|
1024
1110
|
},
|
|
1025
|
-
onDidChangeActive(
|
|
1026
|
-
const
|
|
1027
|
-
return R(
|
|
1111
|
+
onDidChangeActive(w) {
|
|
1112
|
+
const h = t.subscribeSelector((I) => I.activeModeId, () => w());
|
|
1113
|
+
return R(h);
|
|
1028
1114
|
}
|
|
1029
1115
|
};
|
|
1030
|
-
return
|
|
1116
|
+
return tn(k, {
|
|
1031
1117
|
activatePageMode: p
|
|
1032
1118
|
}), k;
|
|
1033
|
-
},
|
|
1119
|
+
}, Et = (e, t, r) => e.singleton ? t.some((n) => {
|
|
1034
1120
|
if (n.contributionId !== e.id) return !1;
|
|
1035
1121
|
const o = n.role === "location" ? n.resourceKey : n.ownerResourceKey;
|
|
1036
|
-
return !o || o ===
|
|
1037
|
-
}) : !1,
|
|
1122
|
+
return !o || o === T(r);
|
|
1123
|
+
}) : !1, on = (e) => {
|
|
1038
1124
|
for (const t of e.mode?.listAddablePanels?.({
|
|
1039
1125
|
layout: e.layout,
|
|
1040
1126
|
resource: e.resource
|
|
1041
1127
|
}) ?? []) {
|
|
1042
1128
|
if (t.region !== e.region) continue;
|
|
1043
1129
|
const r = e.widgets.find((n) => n.id === t.panelId);
|
|
1044
|
-
!r ||
|
|
1130
|
+
!r || Et(r, e.placements, e.resource) || e.addable.set(t.panelId, {
|
|
1045
1131
|
...t,
|
|
1046
1132
|
contribution: r
|
|
1047
1133
|
});
|
|
1048
1134
|
}
|
|
1049
|
-
},
|
|
1135
|
+
}, sn = (e) => {
|
|
1050
1136
|
for (const t of e.widgets)
|
|
1051
|
-
t.eligibleLocations && (t.region !== e.region && t.fallbackRegion !== e.region || e.addable.has(t.id) ||
|
|
1137
|
+
t.eligibleLocations && (t.region !== e.region && t.fallbackRegion !== e.region || e.addable.has(t.id) || Et(t, e.placements, e.resource) || ir(t, e.resource, e.modeId, void 0, {
|
|
1052
1138
|
location: e.location
|
|
1053
1139
|
}) && e.addable.set(t.id, {
|
|
1054
1140
|
panelId: t.id,
|
|
1055
1141
|
region: e.region,
|
|
1056
1142
|
contribution: t
|
|
1057
1143
|
}));
|
|
1058
|
-
},
|
|
1144
|
+
}, an = (e) => ({
|
|
1059
1145
|
panelsFor(t) {
|
|
1060
1146
|
const r = e.getLayout(), n = r.regions[t]?.widgets ?? [], o = e.getResource(), s = oe(r), a = e.getActiveMode();
|
|
1061
|
-
if (!
|
|
1147
|
+
if (!ar(a, t)) return {
|
|
1062
1148
|
open: n,
|
|
1063
1149
|
addable: [],
|
|
1064
1150
|
closable: []
|
|
@@ -1071,7 +1157,7 @@ const vr = () => {
|
|
|
1071
1157
|
resource: o
|
|
1072
1158
|
}) ?? [])
|
|
1073
1159
|
g.set(m.panelId, m);
|
|
1074
|
-
return
|
|
1160
|
+
return on({
|
|
1075
1161
|
addable: g,
|
|
1076
1162
|
layout: r,
|
|
1077
1163
|
mode: a,
|
|
@@ -1079,7 +1165,7 @@ const vr = () => {
|
|
|
1079
1165
|
region: t,
|
|
1080
1166
|
resource: o,
|
|
1081
1167
|
widgets: c
|
|
1082
|
-
}),
|
|
1168
|
+
}), sn({
|
|
1083
1169
|
addable: g,
|
|
1084
1170
|
location: s,
|
|
1085
1171
|
modeId: a?.id,
|
|
@@ -1093,23 +1179,23 @@ const vr = () => {
|
|
|
1093
1179
|
closable: n.filter((m) => m.closable === !0).map((m) => m.contributionId)
|
|
1094
1180
|
};
|
|
1095
1181
|
}
|
|
1096
|
-
}),
|
|
1182
|
+
}), cn = ["activity", "sidenav", "main", "secondary", "side", "status"], dn = {
|
|
1097
1183
|
activity: "activityFocus",
|
|
1098
1184
|
sidenav: "sidenavFocus",
|
|
1099
1185
|
main: "mainFocus",
|
|
1100
1186
|
secondary: "secondaryFocus",
|
|
1101
1187
|
side: "sideFocus",
|
|
1102
1188
|
status: "statusFocus"
|
|
1103
|
-
},
|
|
1104
|
-
const t =
|
|
1189
|
+
}, ln = (e) => {
|
|
1190
|
+
const t = W({
|
|
1105
1191
|
name: "workbench.focus",
|
|
1106
1192
|
initialState: {
|
|
1107
1193
|
activeRegion: void 0
|
|
1108
1194
|
}
|
|
1109
1195
|
}), r = e.context.createScope("workbench.focus"), n = (o) => {
|
|
1110
1196
|
r.set("workbenchFocus", o !== void 0), r.set("activeWorkbenchFocusRegion", o);
|
|
1111
|
-
for (const s of
|
|
1112
|
-
r.set(
|
|
1197
|
+
for (const s of cn)
|
|
1198
|
+
r.set(dn[s], s === o);
|
|
1113
1199
|
};
|
|
1114
1200
|
return n(void 0), {
|
|
1115
1201
|
store: t,
|
|
@@ -1131,103 +1217,19 @@ const vr = () => {
|
|
|
1131
1217
|
return R(s);
|
|
1132
1218
|
}
|
|
1133
1219
|
};
|
|
1134
|
-
},
|
|
1135
|
-
|
|
1136
|
-
},
|
|
1137
|
-
const t =
|
|
1220
|
+
}, Wt = /* @__PURE__ */ new WeakMap(), gn = (e, t) => {
|
|
1221
|
+
Wt.set(e, t);
|
|
1222
|
+
}, Z = (e) => {
|
|
1223
|
+
const t = Wt.get(e);
|
|
1138
1224
|
if (!t) throw new Error("Workbench page registry internals are unavailable");
|
|
1139
1225
|
return t;
|
|
1140
|
-
},
|
|
1141
|
-
const r = `/projects/${encodeURIComponent(e)}`, n = ln(t.path);
|
|
1142
|
-
if (t.ref.extensionId === Ct) return n ? `${r}/${n}` : r;
|
|
1143
|
-
if (!t.ref.extensionId) throw new Error(`Page "${t.id}" has no extension id`);
|
|
1144
|
-
return `${r}/extensions/${encodeURIComponent(t.ref.extensionId)}/${n}`;
|
|
1145
|
-
}, $t = (e) => {
|
|
1146
|
-
if (!e || typeof e != "object" || !Array.isArray(e.anchors)) return;
|
|
1147
|
-
const t = e.anchors;
|
|
1148
|
-
if (!t.some((r) => !r || typeof r != "object" || typeof r.id != "string" || typeof r.heading != "string" || r.occurrence !== void 0 && (!Number.isInteger(r.occurrence) || Number(r.occurrence) < 0)))
|
|
1149
|
-
return {
|
|
1150
|
-
anchors: t.map((r) => {
|
|
1151
|
-
const n = r;
|
|
1152
|
-
return {
|
|
1153
|
-
id: n.id,
|
|
1154
|
-
heading: n.heading,
|
|
1155
|
-
...n.occurrence !== void 0 ? {
|
|
1156
|
-
occurrence: n.occurrence
|
|
1157
|
-
} : {}
|
|
1158
|
-
};
|
|
1159
|
-
})
|
|
1160
|
-
};
|
|
1161
|
-
}, un = (e) => {
|
|
1162
|
-
const t = $t(e);
|
|
1163
|
-
if (!t) throw new Error("Page location has an invalid section");
|
|
1164
|
-
return JSON.stringify(t);
|
|
1165
|
-
}, mn = (e) => {
|
|
1166
|
-
try {
|
|
1167
|
-
return $t(JSON.parse(e));
|
|
1168
|
-
} catch {
|
|
1169
|
-
return;
|
|
1170
|
-
}
|
|
1171
|
-
}, fn = (e) => {
|
|
1172
|
-
const t = dn(e.pages, e.location.page);
|
|
1173
|
-
if (!t) throw new Error(`Unknown page ref: ${Ee(e.location.page)}`);
|
|
1174
|
-
const r = new URLSearchParams();
|
|
1175
|
-
e.location.resource && r.set("resource", e.resources.toUri(e.resources.normalize(e.location.resource))), e.location.section && r.set("section", un(e.location.section));
|
|
1176
|
-
const n = r.toString(), o = gn(e.projectId, t);
|
|
1177
|
-
return n ? `${o}?${n}` : o;
|
|
1178
|
-
}, Et = (e) => {
|
|
1179
|
-
try {
|
|
1180
|
-
return e.split("/").filter(Boolean).map((t) => decodeURIComponent(t));
|
|
1181
|
-
} catch {
|
|
1182
|
-
return;
|
|
1183
|
-
}
|
|
1184
|
-
}, Wt = (e, t) => {
|
|
1185
|
-
try {
|
|
1186
|
-
const r = new URL(e, "http://workbench.local"), n = Et(r.pathname);
|
|
1187
|
-
return !!(n && n[0] === "projects" && n[1] === t);
|
|
1188
|
-
} catch {
|
|
1189
|
-
return !1;
|
|
1190
|
-
}
|
|
1191
|
-
}, pn = (e, t, r) => e.find((n) => n.ref.extensionId === t && n.path === r), hn = (e, t) => {
|
|
1192
|
-
try {
|
|
1193
|
-
const r = t.fromUri(e);
|
|
1194
|
-
return r ? t.normalize(r) : void 0;
|
|
1195
|
-
} catch {
|
|
1196
|
-
return;
|
|
1197
|
-
}
|
|
1198
|
-
}, wn = (e) => {
|
|
1199
|
-
let t;
|
|
1200
|
-
try {
|
|
1201
|
-
t = new URL(e.url, "http://workbench.local");
|
|
1202
|
-
} catch {
|
|
1203
|
-
return;
|
|
1204
|
-
}
|
|
1205
|
-
const r = Et(t.pathname);
|
|
1206
|
-
if (!r || r[0] !== "projects" || r[1] !== e.projectId) return;
|
|
1207
|
-
const n = r.slice(2), o = n[0] === "extensions", s = o ? n[1] : Ct, a = (o ? n.slice(2) : n).join("/");
|
|
1208
|
-
if (!s || o && !a) return;
|
|
1209
|
-
const l = pn(e.pages, s, a);
|
|
1210
|
-
if (!l) return;
|
|
1211
|
-
const c = t.searchParams.get("resource"), g = c ? hn(c, e.resources) : void 0;
|
|
1212
|
-
if (c && !g) return;
|
|
1213
|
-
const m = t.searchParams.get("section"), i = m ? mn(m) : void 0;
|
|
1214
|
-
if (!(m && !i))
|
|
1215
|
-
return {
|
|
1216
|
-
pageId: l.id,
|
|
1217
|
-
...g ? {
|
|
1218
|
-
resource: g
|
|
1219
|
-
} : {},
|
|
1220
|
-
...i ? {
|
|
1221
|
-
section: i
|
|
1222
|
-
} : {}
|
|
1223
|
-
};
|
|
1224
|
-
}, yn = (e, t) => {
|
|
1226
|
+
}, un = (e, t) => {
|
|
1225
1227
|
try {
|
|
1226
1228
|
return !!e.resolveUrl(t, e.input.browser.current());
|
|
1227
1229
|
} catch {
|
|
1228
1230
|
return !1;
|
|
1229
1231
|
}
|
|
1230
|
-
},
|
|
1232
|
+
}, mn = (e) => {
|
|
1231
1233
|
const {
|
|
1232
1234
|
input: t
|
|
1233
1235
|
} = e;
|
|
@@ -1239,8 +1241,8 @@ const vr = () => {
|
|
|
1239
1241
|
clearProject() {
|
|
1240
1242
|
e.clearProject(void 0), e.resetHistory();
|
|
1241
1243
|
},
|
|
1242
|
-
isCurrentProjectUrl: (r) =>
|
|
1243
|
-
hasCurrentPageUrl: (r) =>
|
|
1244
|
+
isCurrentProjectUrl: (r) => bt(t.browser.current().url, r),
|
|
1245
|
+
hasCurrentPageUrl: (r) => un(e, r),
|
|
1244
1246
|
boot: (r) => e.restore(r, "boot", !0),
|
|
1245
1247
|
switchProject(r) {
|
|
1246
1248
|
return e.clearProject(r), e.restore(r, "project-switch", !1);
|
|
@@ -1283,7 +1285,7 @@ const vr = () => {
|
|
|
1283
1285
|
},
|
|
1284
1286
|
dispose: e.dispose
|
|
1285
1287
|
};
|
|
1286
|
-
},
|
|
1288
|
+
}, Q = (e) => `${e.extensionId ?? ""}:page:${e.id}`, $t = (e, t) => e.find((r) => Q(r.ref) === Q(t)), Lt = (e, t) => e.find((r) => r.id === t), fn = (e) => {
|
|
1287
1289
|
if (!e) return;
|
|
1288
1290
|
const t = e.anchors.map((r) => Object.freeze({
|
|
1289
1291
|
id: r.id,
|
|
@@ -1295,10 +1297,10 @@ const vr = () => {
|
|
|
1295
1297
|
return Object.freeze({
|
|
1296
1298
|
anchors: Object.freeze(t)
|
|
1297
1299
|
});
|
|
1298
|
-
},
|
|
1300
|
+
}, pn = (e) => {
|
|
1299
1301
|
if (e)
|
|
1300
1302
|
return JSON.parse(JSON.stringify(e));
|
|
1301
|
-
},
|
|
1303
|
+
}, yn = (e, t) => {
|
|
1302
1304
|
if (!e) return;
|
|
1303
1305
|
const r = t.normalize(e);
|
|
1304
1306
|
if (!r.type || !r.id) throw new Error("Page resource has no canonical type or id");
|
|
@@ -1318,39 +1320,39 @@ const vr = () => {
|
|
|
1318
1320
|
extensionId: r.extensionId
|
|
1319
1321
|
} : {},
|
|
1320
1322
|
...r.metadata ? {
|
|
1321
|
-
metadata:
|
|
1323
|
+
metadata: pn(r.metadata)
|
|
1322
1324
|
} : {}
|
|
1323
1325
|
};
|
|
1324
1326
|
return Object.freeze(n);
|
|
1325
|
-
},
|
|
1327
|
+
}, hn = (e) => Object.freeze({
|
|
1326
1328
|
extensionId: e.ref.extensionId,
|
|
1327
1329
|
kind: "page",
|
|
1328
1330
|
id: e.ref.id
|
|
1329
|
-
}),
|
|
1330
|
-
const r =
|
|
1331
|
+
}), wn = (e) => e ? JSON.stringify(e) : "", We = (e, t) => e.resource ? t.toUri(t.normalize(e.resource)) : "", vn = (e, t, r) => Q(e.page) === Q(t.page) && We(e, r) === We(t, r), J = (e, t) => [Q(e.page), We(e, t), wn(e.section)].join("|"), le = (e, t) => {
|
|
1332
|
+
const r = J(e, t);
|
|
1331
1333
|
return e.parent ? `${r}>${le(e.parent, t)}` : r;
|
|
1332
1334
|
}, Xe = (e, t, r) => !e || !t ? e === t : le(e, r) === le(t, r), ge = (e) => Object.freeze({
|
|
1333
|
-
page:
|
|
1335
|
+
page: hn(e.page),
|
|
1334
1336
|
...e.resource ? {
|
|
1335
|
-
resource:
|
|
1337
|
+
resource: yn(e.resource, e.resources)
|
|
1336
1338
|
} : {},
|
|
1337
1339
|
...e.section ? {
|
|
1338
|
-
section:
|
|
1340
|
+
section: fn(e.section)
|
|
1339
1341
|
} : {},
|
|
1340
1342
|
...e.parent ? {
|
|
1341
1343
|
parent: e.parent
|
|
1342
1344
|
} : {}
|
|
1343
|
-
}),
|
|
1345
|
+
}), Sn = (e) => {
|
|
1344
1346
|
if (!e.page.parentId) return;
|
|
1345
|
-
const t =
|
|
1347
|
+
const t = Lt(e.pages, e.page.parentId);
|
|
1346
1348
|
if (!t) throw new Error(`Unknown parent page: ${e.page.parentId}`);
|
|
1347
|
-
return
|
|
1349
|
+
return ye({
|
|
1348
1350
|
page: t,
|
|
1349
1351
|
pages: e.pages,
|
|
1350
1352
|
resources: e.resources,
|
|
1351
1353
|
seen: e.seen
|
|
1352
1354
|
});
|
|
1353
|
-
},
|
|
1355
|
+
}, ye = (e) => {
|
|
1354
1356
|
const t = ge({
|
|
1355
1357
|
page: e.page,
|
|
1356
1358
|
resources: e.resources,
|
|
@@ -1360,9 +1362,9 @@ const vr = () => {
|
|
|
1360
1362
|
...e.section ? {
|
|
1361
1363
|
section: e.section
|
|
1362
1364
|
} : {}
|
|
1363
|
-
}), r =
|
|
1365
|
+
}), r = J(t, e.resources);
|
|
1364
1366
|
if (e.seen.has(r)) throw new Error(`Page location parent cycle reaches ${e.page.id}`);
|
|
1365
|
-
const n = new Set(e.seen).add(r), o = e.parent ??
|
|
1367
|
+
const n = new Set(e.seen).add(r), o = e.parent ?? Sn({
|
|
1366
1368
|
page: e.page,
|
|
1367
1369
|
pages: e.pages,
|
|
1368
1370
|
resources: e.resources,
|
|
@@ -1381,9 +1383,9 @@ const vr = () => {
|
|
|
1381
1383
|
parent: o
|
|
1382
1384
|
} : {}
|
|
1383
1385
|
});
|
|
1384
|
-
}, Kt = (e) => {
|
|
1385
|
-
const t =
|
|
1386
|
-
if (!t) throw new Error(`Unknown page: ${
|
|
1386
|
+
}, In = (e, t, r) => t?.parent && vn(e, t, r) ? t.parent : void 0, Kt = (e) => {
|
|
1387
|
+
const t = $t(e.pages, e.target.page);
|
|
1388
|
+
if (!t) throw new Error(`Unknown page: ${Q(e.target.page)}`);
|
|
1387
1389
|
const r = ge({
|
|
1388
1390
|
page: t,
|
|
1389
1391
|
resources: e.resources,
|
|
@@ -1393,14 +1395,14 @@ const vr = () => {
|
|
|
1393
1395
|
...e.target.section ? {
|
|
1394
1396
|
section: e.target.section
|
|
1395
1397
|
} : {}
|
|
1396
|
-
}), n =
|
|
1398
|
+
}), n = J(r, e.resources);
|
|
1397
1399
|
if (e.seen.has(n)) throw new Error(`Page location parent cycle reaches ${t.id}`);
|
|
1398
1400
|
const o = new Set(e.seen).add(n), s = e.target.parent ? Kt({
|
|
1399
1401
|
target: e.target.parent,
|
|
1400
1402
|
pages: e.pages,
|
|
1401
1403
|
resources: e.resources,
|
|
1402
1404
|
seen: o
|
|
1403
|
-
}).location :
|
|
1405
|
+
}).location : In(r, e.active, e.resources), a = ye({
|
|
1404
1406
|
page: t,
|
|
1405
1407
|
pages: e.pages,
|
|
1406
1408
|
resources: e.resources,
|
|
@@ -1425,10 +1427,10 @@ const vr = () => {
|
|
|
1425
1427
|
}, ce = (e) => Kt({
|
|
1426
1428
|
...e,
|
|
1427
1429
|
seen: /* @__PURE__ */ new Set()
|
|
1428
|
-
}),
|
|
1430
|
+
}), bn = (e) => {
|
|
1429
1431
|
const t = (r, n) => {
|
|
1430
|
-
const o =
|
|
1431
|
-
if (!o) throw new Error(`Unknown page: ${
|
|
1432
|
+
const o = $t(e.pages, r.page);
|
|
1433
|
+
if (!o) throw new Error(`Unknown page: ${Q(r.page)}`);
|
|
1432
1434
|
const s = ge({
|
|
1433
1435
|
page: o,
|
|
1434
1436
|
resources: e.resources,
|
|
@@ -1438,12 +1440,12 @@ const vr = () => {
|
|
|
1438
1440
|
...r.section ? {
|
|
1439
1441
|
section: r.section
|
|
1440
1442
|
} : {}
|
|
1441
|
-
}), a =
|
|
1443
|
+
}), a = J(s, e.resources);
|
|
1442
1444
|
if (n.has(a)) throw new Error(`Page location parent cycle reaches ${o.id}`);
|
|
1443
1445
|
const l = new Set(n).add(a), c = r.parent ? t(r.parent, l).location : void 0;
|
|
1444
1446
|
return {
|
|
1445
1447
|
pageId: o.id,
|
|
1446
|
-
location:
|
|
1448
|
+
location: ye({
|
|
1447
1449
|
page: o,
|
|
1448
1450
|
pages: e.pages,
|
|
1449
1451
|
resources: e.resources,
|
|
@@ -1462,11 +1464,11 @@ const vr = () => {
|
|
|
1462
1464
|
};
|
|
1463
1465
|
return t(e.location, /* @__PURE__ */ new Set());
|
|
1464
1466
|
}, Ze = (e) => {
|
|
1465
|
-
const t =
|
|
1467
|
+
const t = Lt(e.pages, e.pageId);
|
|
1466
1468
|
if (!t) throw new Error(`Unknown page: ${e.pageId}`);
|
|
1467
1469
|
return {
|
|
1468
1470
|
pageId: t.id,
|
|
1469
|
-
location:
|
|
1471
|
+
location: ye({
|
|
1470
1472
|
page: t,
|
|
1471
1473
|
pages: e.pages,
|
|
1472
1474
|
resources: e.resources,
|
|
@@ -1479,8 +1481,8 @@ const vr = () => {
|
|
|
1479
1481
|
} : {}
|
|
1480
1482
|
})
|
|
1481
1483
|
};
|
|
1482
|
-
},
|
|
1483
|
-
url:
|
|
1484
|
+
}, Pn = (e) => (t, r, n) => ({
|
|
1485
|
+
url: mr({
|
|
1484
1486
|
projectId: t,
|
|
1485
1487
|
location: r,
|
|
1486
1488
|
pages: e.pages(),
|
|
@@ -1490,10 +1492,10 @@ const vr = () => {
|
|
|
1490
1492
|
kind: "pstdio.page-location",
|
|
1491
1493
|
index: n,
|
|
1492
1494
|
projectId: t,
|
|
1493
|
-
routeKey:
|
|
1495
|
+
routeKey: J(r, e.resources),
|
|
1494
1496
|
location: r
|
|
1495
1497
|
}
|
|
1496
|
-
}),
|
|
1498
|
+
}), kn = (e) => (t, r) => {
|
|
1497
1499
|
const n = {
|
|
1498
1500
|
code: "page-location-unresolved",
|
|
1499
1501
|
source: t,
|
|
@@ -1503,11 +1505,11 @@ const vr = () => {
|
|
|
1503
1505
|
ok: !1,
|
|
1504
1506
|
diagnostic: n
|
|
1505
1507
|
};
|
|
1506
|
-
},
|
|
1507
|
-
const t =
|
|
1508
|
+
}, xt = /* @__PURE__ */ new WeakMap(), Rn = (e, t) => xt.set(e, t), Mn = (e) => {
|
|
1509
|
+
const t = xt.get(e);
|
|
1508
1510
|
if (!t) throw new Error("Page location preparation is unavailable");
|
|
1509
1511
|
return t;
|
|
1510
|
-
},
|
|
1512
|
+
}, Cn = (e, t, r) => (n, o, s, a, l) => Te(() => {
|
|
1511
1513
|
const c = o.location;
|
|
1512
1514
|
if (!c) throw new Error("Prepared page navigation has no location");
|
|
1513
1515
|
const g = s === "push" ? r.getIndex() + 1 : r.getIndex();
|
|
@@ -1515,7 +1517,7 @@ const vr = () => {
|
|
|
1515
1517
|
ok: !0,
|
|
1516
1518
|
location: c
|
|
1517
1519
|
};
|
|
1518
|
-
}),
|
|
1520
|
+
}), En = (e) => {
|
|
1519
1521
|
const t = (n, o, s) => {
|
|
1520
1522
|
const a = o.parent ? e.normalizeStored(o.parent) : void 0, l = e.getPageRef(s.parentId);
|
|
1521
1523
|
if (!l) throw new Error(`Unknown parent page: ${s.parentId}`);
|
|
@@ -1563,10 +1565,10 @@ const vr = () => {
|
|
|
1563
1565
|
if (!e || typeof e != "object") return !1;
|
|
1564
1566
|
const t = e;
|
|
1565
1567
|
return t.kind === "pstdio.page-location" && typeof t.index == "number" && typeof t.projectId == "string" && typeof t.routeKey == "string" && !!(t.location && typeof t.location == "object");
|
|
1566
|
-
},
|
|
1567
|
-
const t =
|
|
1568
|
+
}, Wn = (e) => {
|
|
1569
|
+
const t = Z(e.registry), r = () => e.registry.listPages();
|
|
1568
1570
|
let n = 0, o = 0;
|
|
1569
|
-
const s =
|
|
1571
|
+
const s = W({
|
|
1570
1572
|
name: "workbench.page-location-history",
|
|
1571
1573
|
initialState: {
|
|
1572
1574
|
canGoBack: !1,
|
|
@@ -1577,20 +1579,20 @@ const vr = () => {
|
|
|
1577
1579
|
canGoForward: n < o
|
|
1578
1580
|
}, !1, "pageLocationHistory"), l = () => {
|
|
1579
1581
|
n = 0, o = 0, a();
|
|
1580
|
-
}, c =
|
|
1582
|
+
}, c = kn(e.reportDiagnostic), g = Pn({
|
|
1581
1583
|
pages: r,
|
|
1582
1584
|
resources: t.resources
|
|
1583
|
-
}), m =
|
|
1585
|
+
}), m = Cn(e, t, {
|
|
1584
1586
|
getIndex: () => n,
|
|
1585
|
-
commitIndex: (
|
|
1586
|
-
n =
|
|
1587
|
+
commitIndex: (h, I) => {
|
|
1588
|
+
n = h, I && (o = h);
|
|
1587
1589
|
},
|
|
1588
1590
|
entry: g,
|
|
1589
1591
|
publish: a
|
|
1590
|
-
}), i = (
|
|
1592
|
+
}), i = (h, I, b, P) => {
|
|
1591
1593
|
const M = t.prepare.location({
|
|
1592
1594
|
pageId: I.pageId,
|
|
1593
|
-
projectId:
|
|
1595
|
+
projectId: h,
|
|
1594
1596
|
location: I.location,
|
|
1595
1597
|
action: P,
|
|
1596
1598
|
open: I.open,
|
|
@@ -1598,9 +1600,9 @@ const vr = () => {
|
|
|
1598
1600
|
section: I.location.section,
|
|
1599
1601
|
pageStates: I.pageStates
|
|
1600
1602
|
}, e.registry.store.getState());
|
|
1601
|
-
return m(
|
|
1602
|
-
}, d = (
|
|
1603
|
-
location:
|
|
1603
|
+
return m(h, M, b, P);
|
|
1604
|
+
}, d = (h) => bn({
|
|
1605
|
+
location: h,
|
|
1604
1606
|
pages: r(),
|
|
1605
1607
|
resources: t.resources
|
|
1606
1608
|
}), u = () => ce({
|
|
@@ -1610,10 +1612,10 @@ const vr = () => {
|
|
|
1610
1612
|
},
|
|
1611
1613
|
pages: r(),
|
|
1612
1614
|
resources: t.resources
|
|
1613
|
-
}), p = (
|
|
1614
|
-
const b =
|
|
1615
|
+
}), p = (h, I) => {
|
|
1616
|
+
const b = fr({
|
|
1615
1617
|
url: I.url,
|
|
1616
|
-
projectId:
|
|
1618
|
+
projectId: h,
|
|
1617
1619
|
pages: r(),
|
|
1618
1620
|
resources: t.resources
|
|
1619
1621
|
});
|
|
@@ -1623,92 +1625,93 @@ const vr = () => {
|
|
|
1623
1625
|
pages: r(),
|
|
1624
1626
|
resources: t.resources
|
|
1625
1627
|
});
|
|
1626
|
-
if (!be(I.state) || I.state.projectId !==
|
|
1627
|
-
const M = d(I.state.location),
|
|
1628
|
-
return I.state.routeKey !==
|
|
1629
|
-
},
|
|
1628
|
+
if (!be(I.state) || I.state.projectId !== h) return P;
|
|
1629
|
+
const M = d(I.state.location), $ = J(P.location, t.resources), K = J(M.location, t.resources);
|
|
1630
|
+
return I.state.routeKey !== $ || K !== $ ? P : M;
|
|
1631
|
+
}, y = (h, I, b) => {
|
|
1630
1632
|
try {
|
|
1631
1633
|
const P = e.browser.current();
|
|
1632
|
-
be(P.state) && P.state.projectId ===
|
|
1633
|
-
const M = b &&
|
|
1634
|
-
if (M &&
|
|
1635
|
-
const
|
|
1636
|
-
return i(
|
|
1634
|
+
be(P.state) && P.state.projectId === h ? (n = P.state.index, o = Math.max(o, n)) : (n = 0, o = 0);
|
|
1635
|
+
const M = b && bt(P.url, h), $ = M ? p(h, P) : void 0;
|
|
1636
|
+
if (M && !$) throw new Error(`Cannot resolve page URL: ${P.url}`);
|
|
1637
|
+
const K = M ? void 0 : e.persistence.load(h), D = $ ?? (K ? d(K) : u());
|
|
1638
|
+
return i(h, D, "replace", I === "boot" ? "bootPageLocation" : "switchPageProject");
|
|
1637
1639
|
} catch (P) {
|
|
1638
1640
|
c(I, P);
|
|
1639
1641
|
try {
|
|
1640
|
-
return i(
|
|
1642
|
+
return i(h, u(), "replace", `${I}StartFallback`);
|
|
1641
1643
|
} catch (M) {
|
|
1642
1644
|
return c(I, M);
|
|
1643
1645
|
}
|
|
1644
1646
|
}
|
|
1645
|
-
}, f = (
|
|
1647
|
+
}, f = (h) => {
|
|
1646
1648
|
const I = e.registry.store.getState().projectId;
|
|
1647
1649
|
if (I)
|
|
1648
1650
|
try {
|
|
1649
|
-
be(
|
|
1650
|
-
const b = p(I,
|
|
1651
|
-
if (!b) throw new Error(`Cannot resolve page URL: ${
|
|
1651
|
+
be(h.state) && h.state.projectId === I && (n = h.state.index, o = Math.max(o, n), a());
|
|
1652
|
+
const b = p(I, h);
|
|
1653
|
+
if (!b) throw new Error(`Cannot resolve page URL: ${h.url}`);
|
|
1652
1654
|
i(I, b, "none", "replayPageHistory");
|
|
1653
1655
|
} catch (b) {
|
|
1654
1656
|
c("history", b);
|
|
1655
1657
|
}
|
|
1656
|
-
}, v = e.browser.onPopState(f), S = e.registry.store.subscribe((
|
|
1657
|
-
if (!(!Object.keys(I.pages).some((P) => !
|
|
1658
|
+
}, v = e.browser.onPopState(f), S = e.registry.store.subscribe((h, I) => {
|
|
1659
|
+
if (!(!Object.keys(I.pages).some((P) => !h.pages[P]) || !h.projectId)) {
|
|
1658
1660
|
try {
|
|
1659
|
-
if (
|
|
1660
|
-
d(
|
|
1661
|
+
if (h.location) {
|
|
1662
|
+
d(h.location);
|
|
1661
1663
|
return;
|
|
1662
1664
|
}
|
|
1663
1665
|
} catch (P) {
|
|
1664
1666
|
c("navigation", P);
|
|
1665
1667
|
}
|
|
1666
1668
|
try {
|
|
1667
|
-
const P =
|
|
1669
|
+
const P = h.activePageId ? h.pages[h.activePageId] : void 0, M = P && h.location ? Ze({
|
|
1668
1670
|
pageId: P.id,
|
|
1669
1671
|
pages: r(),
|
|
1670
1672
|
resources: t.resources,
|
|
1671
|
-
...
|
|
1672
|
-
resource:
|
|
1673
|
+
...h.location.resource ? {
|
|
1674
|
+
resource: h.location.resource
|
|
1673
1675
|
} : {},
|
|
1674
|
-
...
|
|
1675
|
-
section:
|
|
1676
|
+
...h.location.section ? {
|
|
1677
|
+
section: h.location.section
|
|
1676
1678
|
} : {}
|
|
1677
1679
|
}) : u();
|
|
1678
|
-
i(
|
|
1680
|
+
i(h.projectId, M, "replace", "removePageLocationOwner");
|
|
1679
1681
|
} catch (P) {
|
|
1680
1682
|
c("navigation", P);
|
|
1681
1683
|
}
|
|
1682
1684
|
}
|
|
1683
|
-
}), k =
|
|
1685
|
+
}), k = En({
|
|
1684
1686
|
commit: i,
|
|
1685
1687
|
fail: c,
|
|
1686
1688
|
getCurrent: () => e.registry.store.getState(),
|
|
1687
|
-
getPageRef: (
|
|
1688
|
-
normalizePage: (
|
|
1689
|
+
getPageRef: (h) => e.registry.getPage(h)?.ref,
|
|
1690
|
+
normalizePage: (h) => ce({
|
|
1689
1691
|
target: {
|
|
1690
1692
|
kind: "page",
|
|
1691
|
-
page:
|
|
1693
|
+
page: h
|
|
1692
1694
|
},
|
|
1693
1695
|
pages: r(),
|
|
1694
1696
|
resources: t.resources
|
|
1695
1697
|
}),
|
|
1696
1698
|
normalizeStored: d,
|
|
1697
1699
|
resolveClosePlacement: t.resolveClosePlacement
|
|
1698
|
-
}),
|
|
1700
|
+
}), w = mn({
|
|
1699
1701
|
input: e,
|
|
1700
1702
|
historyStore: s,
|
|
1701
1703
|
clearProject: t.clearProject,
|
|
1702
1704
|
resetHistory: l,
|
|
1703
|
-
restore:
|
|
1705
|
+
restore: y,
|
|
1704
1706
|
resolveUrl: p,
|
|
1705
|
-
normalizeTarget: (
|
|
1706
|
-
target:
|
|
1707
|
+
normalizeTarget: (h) => ce({
|
|
1708
|
+
target: h,
|
|
1707
1709
|
pages: r(),
|
|
1708
|
-
resources: t.resources
|
|
1710
|
+
resources: t.resources,
|
|
1711
|
+
active: e.registry.store.getState().location
|
|
1709
1712
|
}),
|
|
1710
1713
|
normalizeStored: d,
|
|
1711
|
-
locationsEqual: (
|
|
1714
|
+
locationsEqual: (h, I) => Xe(h, I, t.resources),
|
|
1712
1715
|
commit: i,
|
|
1713
1716
|
fail: c,
|
|
1714
1717
|
closePlacement: k,
|
|
@@ -1718,52 +1721,24 @@ const vr = () => {
|
|
|
1718
1721
|
v.dispose(), S();
|
|
1719
1722
|
}
|
|
1720
1723
|
});
|
|
1721
|
-
return
|
|
1722
|
-
resolve: (
|
|
1723
|
-
target:
|
|
1724
|
+
return Rn(w, {
|
|
1725
|
+
resolve: (h) => ce({
|
|
1726
|
+
target: h,
|
|
1724
1727
|
pages: r(),
|
|
1725
|
-
resources: t.resources
|
|
1728
|
+
resources: t.resources,
|
|
1729
|
+
active: e.registry.store.getState().location
|
|
1726
1730
|
}),
|
|
1727
|
-
commit: (
|
|
1728
|
-
if (!
|
|
1729
|
-
const b = Xe(e.registry.store.getState().location,
|
|
1730
|
-
return m(
|
|
1731
|
+
commit: (h, I) => {
|
|
1732
|
+
if (!h.projectId || !h.location) throw new Error("Cannot navigate before a project is active");
|
|
1733
|
+
const b = Xe(e.registry.store.getState().location, h.location, t.resources) ? "none" : "push";
|
|
1734
|
+
return m(h.projectId, h, b, "navigateCompoundTarget", I);
|
|
1731
1735
|
}
|
|
1732
|
-
}),
|
|
1733
|
-
},
|
|
1734
|
-
try {
|
|
1735
|
-
const t = new URL(e);
|
|
1736
|
-
if (t.protocol !== "pstdio:" || t.hostname !== "extension-resource") return;
|
|
1737
|
-
const [r, n, ...o] = t.pathname.slice(1).split("/");
|
|
1738
|
-
if (!r || !n || o.length > 0) return;
|
|
1739
|
-
const s = t.searchParams.get("extensionId"), a = t.searchParams.get("projectId");
|
|
1740
|
-
return {
|
|
1741
|
-
type: decodeURIComponent(r),
|
|
1742
|
-
id: decodeURIComponent(n),
|
|
1743
|
-
...s ? {
|
|
1744
|
-
extensionId: s
|
|
1745
|
-
} : {},
|
|
1746
|
-
...a ? {
|
|
1747
|
-
projectId: a
|
|
1748
|
-
} : {}
|
|
1749
|
-
};
|
|
1750
|
-
} catch {
|
|
1751
|
-
return;
|
|
1752
|
-
}
|
|
1753
|
-
}, Tt = {
|
|
1754
|
-
normalize: (e) => ({
|
|
1755
|
-
...e
|
|
1756
|
-
}),
|
|
1757
|
-
toUri: (e) => {
|
|
1758
|
-
const t = `pstdio://extension-resource/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}`, r = new URLSearchParams();
|
|
1759
|
-
return e.extensionId && r.set("extensionId", e.extensionId), e.projectId && r.set("projectId", e.projectId), r.size ? `${t}?${r}` : t;
|
|
1760
|
-
},
|
|
1761
|
-
fromUri: On
|
|
1762
|
-
}, Tn = (e = {}) => {
|
|
1736
|
+
}), w;
|
|
1737
|
+
}, $n = (e = {}) => {
|
|
1763
1738
|
let t;
|
|
1764
1739
|
const r = L(`panel menu cache read for ${t ?? "unscoped"}`, () => e.persistence?.getMenuStates(t)), n = (l) => ({
|
|
1765
1740
|
...l?.openByMenuId
|
|
1766
|
-
}), o =
|
|
1741
|
+
}), o = W({
|
|
1767
1742
|
name: "workbench.panelMenuState",
|
|
1768
1743
|
initialState: {
|
|
1769
1744
|
openByMenuId: n(r)
|
|
@@ -1802,8 +1777,8 @@ const vr = () => {
|
|
|
1802
1777
|
return R(c);
|
|
1803
1778
|
}
|
|
1804
1779
|
};
|
|
1805
|
-
},
|
|
1806
|
-
const t = () => e.getFloatingPanels?.() !== "hidden", r = (s) => !t() && s === "floating" ? "attached" : s, n =
|
|
1780
|
+
}, Ln = (e = {}) => {
|
|
1781
|
+
const t = () => e.getFloatingPanels?.() !== "hidden", r = (s) => !t() && s === "floating" ? "attached" : s, n = W({
|
|
1807
1782
|
name: "workbench.sidePanel",
|
|
1808
1783
|
// What the user last chose outranks the app's opening default.
|
|
1809
1784
|
initialState: {
|
|
@@ -1827,8 +1802,8 @@ const vr = () => {
|
|
|
1827
1802
|
return R(a);
|
|
1828
1803
|
}
|
|
1829
1804
|
};
|
|
1830
|
-
},
|
|
1831
|
-
const e =
|
|
1805
|
+
}, Kn = "Terminal", xn = 200, On = () => {
|
|
1806
|
+
const e = W({
|
|
1832
1807
|
name: "workbench.terminal",
|
|
1833
1808
|
initialState: {
|
|
1834
1809
|
sessionsById: {}
|
|
@@ -1836,12 +1811,12 @@ const vr = () => {
|
|
|
1836
1811
|
});
|
|
1837
1812
|
let t = null;
|
|
1838
1813
|
const r = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), g = (f, v, S) => {
|
|
1839
|
-
const k = e.getState(),
|
|
1840
|
-
|
|
1814
|
+
const k = e.getState(), w = k.sessionsById[f];
|
|
1815
|
+
w && e.setState({
|
|
1841
1816
|
sessionsById: {
|
|
1842
1817
|
...k.sessionsById,
|
|
1843
1818
|
[f]: {
|
|
1844
|
-
...
|
|
1819
|
+
...w,
|
|
1845
1820
|
...v
|
|
1846
1821
|
}
|
|
1847
1822
|
}
|
|
@@ -1861,8 +1836,8 @@ const vr = () => {
|
|
|
1861
1836
|
const S = o.get(f);
|
|
1862
1837
|
if (!S) return;
|
|
1863
1838
|
const k = new Uint8Array(v);
|
|
1864
|
-
S.push(k), S.length >
|
|
1865
|
-
for (const
|
|
1839
|
+
S.push(k), S.length > xn && S.shift();
|
|
1840
|
+
for (const w of s.get(f) ?? []) w(k);
|
|
1866
1841
|
}, u = async (f) => {
|
|
1867
1842
|
await m(f.sessionId).kill(f.signal), g(f.sessionId, {
|
|
1868
1843
|
status: "killed"
|
|
@@ -1887,22 +1862,22 @@ const vr = () => {
|
|
|
1887
1862
|
const v = (async () => {
|
|
1888
1863
|
const S = await t(f.request);
|
|
1889
1864
|
r.set(S.id, S), o.set(S.id, []), s.set(S.id, /* @__PURE__ */ new Set()), f.bindingId && (a.set(f.bindingId, S.id), l.set(S.id, f.bindingId));
|
|
1890
|
-
const k = [S.onData((I) => d(S.id, I))],
|
|
1865
|
+
const k = [S.onData((I) => d(S.id, I))], w = S.onTitle?.((I) => g(S.id, {
|
|
1891
1866
|
title: I
|
|
1892
1867
|
}, "terminalSessionTitleChanged"));
|
|
1893
|
-
|
|
1868
|
+
w && k.push(w), k.push(S.onExit((I) => {
|
|
1894
1869
|
e.getState().sessionsById[S.id]?.status === "running" && g(S.id, {
|
|
1895
1870
|
status: "exited",
|
|
1896
1871
|
exit: I
|
|
1897
1872
|
}, "terminalSessionExited"), i(S.id);
|
|
1898
1873
|
})), n.set(S.id, k);
|
|
1899
|
-
const
|
|
1874
|
+
const h = e.getState();
|
|
1900
1875
|
return e.setState({
|
|
1901
1876
|
sessionsById: {
|
|
1902
|
-
...
|
|
1877
|
+
...h.sessionsById,
|
|
1903
1878
|
[S.id]: {
|
|
1904
1879
|
id: S.id,
|
|
1905
|
-
title: f.title ??
|
|
1880
|
+
title: f.title ?? Kn,
|
|
1906
1881
|
status: "running"
|
|
1907
1882
|
}
|
|
1908
1883
|
}
|
|
@@ -1943,12 +1918,12 @@ const vr = () => {
|
|
|
1943
1918
|
subscribe(f, v) {
|
|
1944
1919
|
const S = m(f), k = [];
|
|
1945
1920
|
if (v.onData) {
|
|
1946
|
-
const
|
|
1947
|
-
|
|
1948
|
-
for (const I of o.get(f) ?? [])
|
|
1921
|
+
const w = v.onData, h = s.get(f);
|
|
1922
|
+
h?.add(w), k.push(() => h?.delete(w));
|
|
1923
|
+
for (const I of o.get(f) ?? []) w(I);
|
|
1949
1924
|
}
|
|
1950
1925
|
return k.push(v.onExit ? S.onExit(v.onExit) : void 0, v.onError ? S.onError(v.onError) : void 0), () => {
|
|
1951
|
-
for (const
|
|
1926
|
+
for (const w of k) w?.();
|
|
1952
1927
|
};
|
|
1953
1928
|
},
|
|
1954
1929
|
getSession(f) {
|
|
@@ -1966,8 +1941,8 @@ const vr = () => {
|
|
|
1966
1941
|
r.clear();
|
|
1967
1942
|
}
|
|
1968
1943
|
};
|
|
1969
|
-
},
|
|
1970
|
-
const e =
|
|
1944
|
+
}, Tn = () => {
|
|
1945
|
+
const e = W({
|
|
1971
1946
|
name: "workbench.commandPaletteResources",
|
|
1972
1947
|
initialState: {
|
|
1973
1948
|
providers: {},
|
|
@@ -2029,8 +2004,8 @@ const vr = () => {
|
|
|
2029
2004
|
}, !1, "refresh");
|
|
2030
2005
|
}
|
|
2031
2006
|
};
|
|
2032
|
-
},
|
|
2033
|
-
const t =
|
|
2007
|
+
}, jn = (e = {}) => {
|
|
2008
|
+
const t = W({
|
|
2034
2009
|
name: "workbench.commands",
|
|
2035
2010
|
initialState: {
|
|
2036
2011
|
commands: {}
|
|
@@ -2048,7 +2023,7 @@ const vr = () => {
|
|
|
2048
2023
|
const c = t.getState();
|
|
2049
2024
|
if (c.commands[s.id]) throw new Error(`Command already registered: ${s.id}`);
|
|
2050
2025
|
const g = {
|
|
2051
|
-
...
|
|
2026
|
+
...x(l),
|
|
2052
2027
|
command: s,
|
|
2053
2028
|
handler: a
|
|
2054
2029
|
};
|
|
@@ -2073,7 +2048,7 @@ const vr = () => {
|
|
|
2073
2048
|
return t.getState().commands[s];
|
|
2074
2049
|
},
|
|
2075
2050
|
listCommands() {
|
|
2076
|
-
return Object.values(t.getState().commands).sort(
|
|
2051
|
+
return Object.values(t.getState().commands).sort(B);
|
|
2077
2052
|
},
|
|
2078
2053
|
isCommandEnabled(s, a) {
|
|
2079
2054
|
return n(s).handler.isEnabled?.(a) ?? !0;
|
|
@@ -2115,18 +2090,18 @@ const vr = () => {
|
|
|
2115
2090
|
});
|
|
2116
2091
|
}
|
|
2117
2092
|
};
|
|
2118
|
-
}, et = (e, t) => e < t ? -1 : e > t ? 1 : 0, tt = (e) => e.kind === "shell" ? `shell\0${e.placementId}` : e.kind === "mode" ? `mode\0${e.modeId}\0${e.placementId}` : `page\0${e.pageId}\0${e.slotId}`,
|
|
2093
|
+
}, et = (e, t) => e < t ? -1 : e > t ? 1 : 0, tt = (e) => e.kind === "shell" ? `shell\0${e.placementId}` : e.kind === "mode" ? `mode\0${e.modeId}\0${e.placementId}` : `page\0${e.pageId}\0${e.slotId}`, E = (e) => e.kind === "shell" ? JSON.stringify(["shell", e.placementId, e.instanceKey]) : e.kind === "mode" ? JSON.stringify(["mode", e.modeId, e.placementId, e.instanceKey]) : JSON.stringify(["page", e.pageId, e.slotId, e.instanceKey]), U = (e, t) => {
|
|
2119
2094
|
const r = et(tt(e.identity), tt(t.identity));
|
|
2120
2095
|
return r !== 0 ? r : et(e.identity.instanceKey, t.identity.instanceKey);
|
|
2121
|
-
},
|
|
2096
|
+
}, Bn = (e, t) => e.order - t.order || U(e, t), Dn = (e, t) => {
|
|
2122
2097
|
if (t.identity.kind === e) return;
|
|
2123
2098
|
const r = `${e[0]?.toUpperCase()}${e.slice(1)}`;
|
|
2124
2099
|
throw new Error(`${r} placement must have a ${e} owner`);
|
|
2125
|
-
},
|
|
2100
|
+
}, An = (e) => {
|
|
2126
2101
|
const t = [], r = /* @__PURE__ */ new Set(), n = (a, l) => {
|
|
2127
2102
|
for (const c of l) {
|
|
2128
|
-
if (
|
|
2129
|
-
const g =
|
|
2103
|
+
if (Dn(a, c), !Number.isFinite(c.order)) throw new Error("Placement order must be a finite number");
|
|
2104
|
+
const g = E(c.identity);
|
|
2130
2105
|
if (r.has(g)) throw new Error(`Duplicate placement identity: ${g}`);
|
|
2131
2106
|
r.add(g), t.push(c);
|
|
2132
2107
|
}
|
|
@@ -2136,18 +2111,18 @@ const vr = () => {
|
|
|
2136
2111
|
if (o.size > 1) throw new Error("Mode placements must belong to one active mode");
|
|
2137
2112
|
if (s.size > 1) throw new Error("Page placements must belong to one active page");
|
|
2138
2113
|
return t;
|
|
2139
|
-
},
|
|
2140
|
-
const t =
|
|
2114
|
+
}, Vn = () => H.reduce((e, t) => (e[t] = [], e), {}), ae = (e) => {
|
|
2115
|
+
const t = An(e), r = new Set((e.closed ?? []).map(E)), n = [], o = Vn();
|
|
2141
2116
|
for (const l of t) {
|
|
2142
|
-
if (r.has(
|
|
2117
|
+
if (r.has(E(l.identity))) {
|
|
2143
2118
|
n.push(l);
|
|
2144
2119
|
continue;
|
|
2145
2120
|
}
|
|
2146
2121
|
o[l.region].push(l);
|
|
2147
2122
|
}
|
|
2148
|
-
for (const l of
|
|
2149
|
-
n.sort(
|
|
2150
|
-
const s =
|
|
2123
|
+
for (const l of H) o[l].sort(Bn);
|
|
2124
|
+
n.sort(U);
|
|
2125
|
+
const s = H.flatMap((l) => o[l]), a = new Set(H.filter((l) => o[l].length > 0));
|
|
2151
2126
|
return {
|
|
2152
2127
|
placements: s,
|
|
2153
2128
|
closed: n,
|
|
@@ -2157,35 +2132,35 @@ const vr = () => {
|
|
|
2157
2132
|
}, rt = (e) => {
|
|
2158
2133
|
const t = /* @__PURE__ */ new Map();
|
|
2159
2134
|
for (const r of e) {
|
|
2160
|
-
const n =
|
|
2135
|
+
const n = E(r.identity);
|
|
2161
2136
|
if (t.has(n)) throw new Error(`Duplicate placement identity: ${n}`);
|
|
2162
2137
|
t.set(n, r);
|
|
2163
2138
|
}
|
|
2164
2139
|
return t;
|
|
2165
|
-
},
|
|
2140
|
+
}, Fn = (e, t, r) => e.region === t.region && e.order === t.order && r(e.value, t.value), je = (e) => {
|
|
2166
2141
|
const t = rt(e.current), r = rt(e.desired), n = [], o = [], s = [], a = [];
|
|
2167
2142
|
for (const [g, m] of r) {
|
|
2168
2143
|
const i = t.get(g);
|
|
2169
|
-
i ?
|
|
2144
|
+
i ? Fn(i, m, e.valuesEqual) ? o.push(m) : s.push({
|
|
2170
2145
|
current: i,
|
|
2171
2146
|
desired: m
|
|
2172
2147
|
}) : n.push(m);
|
|
2173
2148
|
}
|
|
2174
2149
|
for (const [g, m] of t) r.has(g) || a.push(m);
|
|
2175
|
-
const l = new Set((e.activate ?? []).map(
|
|
2150
|
+
const l = new Set((e.activate ?? []).map(E)), c = Array.from(l, (g) => {
|
|
2176
2151
|
const m = r.get(g);
|
|
2177
2152
|
if (!m) throw new Error(`Cannot activate missing placement: ${g}`);
|
|
2178
2153
|
return m;
|
|
2179
2154
|
});
|
|
2180
|
-
return n.sort(
|
|
2155
|
+
return n.sort(U), o.sort(U), s.sort((g, m) => U(g.desired, m.desired)), c.sort(U), a.sort(U), {
|
|
2181
2156
|
add: n,
|
|
2182
2157
|
retain: o,
|
|
2183
2158
|
update: s,
|
|
2184
2159
|
activate: c,
|
|
2185
2160
|
remove: a
|
|
2186
2161
|
};
|
|
2187
|
-
}, nt = (e) => e.join("/"),
|
|
2188
|
-
const t =
|
|
2162
|
+
}, nt = (e) => e.join("/"), Nn = (e) => {
|
|
2163
|
+
const t = W({
|
|
2189
2164
|
name: "workbench.menus",
|
|
2190
2165
|
initialState: {
|
|
2191
2166
|
itemsByPath: {}
|
|
@@ -2196,7 +2171,7 @@ const vr = () => {
|
|
|
2196
2171
|
registerMenuItem(r, n, o) {
|
|
2197
2172
|
if (!e.commands.getCommand(n.commandId)) throw new Error(`Menu command not registered: ${n.commandId}`);
|
|
2198
2173
|
const s = nt(r), a = {
|
|
2199
|
-
...
|
|
2174
|
+
...x(o),
|
|
2200
2175
|
...n,
|
|
2201
2176
|
path: r
|
|
2202
2177
|
}, l = t.getState(), c = l.itemsByPath[s] ?? [];
|
|
@@ -2218,17 +2193,17 @@ const vr = () => {
|
|
|
2218
2193
|
listMenuItems(r) {
|
|
2219
2194
|
return [...t.getState().itemsByPath[nt(r)] ?? []].sort((n, o) => {
|
|
2220
2195
|
const s = n.order ?? 0, a = o.order ?? 0;
|
|
2221
|
-
return s - a ||
|
|
2196
|
+
return s - a || B(n, o);
|
|
2222
2197
|
});
|
|
2223
2198
|
}
|
|
2224
2199
|
};
|
|
2225
|
-
}, ie = (e) => !e.extensionId || e.extensionId === "pstdio" ? e.id : `${e.extensionId}.${e.kind}.${e.id}`, z = (e, t) => e.kinds.some((r) => r.id === t.type && (!t.extensionId || !r.extensionId || t.extensionId === r.extensionId)), A = (e) => ie(e.kind === "view" ? e.view : e.binding.view),
|
|
2200
|
+
}, ie = (e) => !e.extensionId || e.extensionId === "pstdio" ? e.id : `${e.extensionId}.${e.kind}.${e.id}`, z = (e, t) => e.kinds.some((r) => r.id === t.type && (!t.extensionId || !r.extensionId || t.extensionId === r.extensionId)), A = (e) => ie(e.kind === "view" ? e.view : e.binding.view), X = () => ({
|
|
2226
2201
|
staticOverrides: /* @__PURE__ */ new Map(),
|
|
2227
2202
|
resourceInstances: /* @__PURE__ */ new Map()
|
|
2228
|
-
}),
|
|
2203
|
+
}), Ot = (e, t, r) => e.kind !== "view" ? !1 : e.presence === "fixed" ? !0 : (t.staticOverrides.get(r) ?? e.presence) === "open", ue = (e) => e.kind !== "view" || e.presence !== "fixed", Tt = (e, t, r) => {
|
|
2229
2204
|
if (r.kind === "binding" && r.binding.kinds.length === 0)
|
|
2230
2205
|
throw new Error(`${e} "${t}" must bind at least one resource kind`);
|
|
2231
|
-
},
|
|
2206
|
+
}, zn = (e) => {
|
|
2232
2207
|
const {
|
|
2233
2208
|
id: t,
|
|
2234
2209
|
item: r,
|
|
@@ -2239,7 +2214,7 @@ const vr = () => {
|
|
|
2239
2214
|
if (e.resource) throw new Error(`${n} "${t}" does not accept a resource`);
|
|
2240
2215
|
if (e.open) throw new Error(`${n} "${t}" does not accept an open intent`);
|
|
2241
2216
|
r.presence !== "fixed" && o.staticOverrides.set(t, "open");
|
|
2242
|
-
},
|
|
2217
|
+
}, qn = (e) => {
|
|
2243
2218
|
const {
|
|
2244
2219
|
id: t,
|
|
2245
2220
|
item: r,
|
|
@@ -2249,14 +2224,14 @@ const vr = () => {
|
|
|
2249
2224
|
if (r.kind !== "view") throw new Error(`${n} "${t}" is not a static placement`);
|
|
2250
2225
|
if (r.presence === "fixed") throw new Error(`${n} "${t}" is fixed and cannot close`);
|
|
2251
2226
|
o.staticOverrides.set(t, "closed");
|
|
2252
|
-
},
|
|
2227
|
+
}, _n = (e, t, r) => {
|
|
2253
2228
|
if (e.binding.cardinality === "one") return [r];
|
|
2254
2229
|
const o = t.find((a) => a.instanceKey === r.instanceKey)?.open === "pin" || r.open === "pin" ? "pin" : "preview";
|
|
2255
2230
|
return [...t.filter((a) => a.instanceKey !== r.instanceKey && (o === "pin" || a.open === "pin")), {
|
|
2256
2231
|
...r,
|
|
2257
2232
|
open: o
|
|
2258
2233
|
}];
|
|
2259
|
-
},
|
|
2234
|
+
}, Un = (e) => {
|
|
2260
2235
|
const {
|
|
2261
2236
|
id: t,
|
|
2262
2237
|
item: r,
|
|
@@ -2270,7 +2245,7 @@ const vr = () => {
|
|
|
2270
2245
|
if (e.open && r.binding.cardinality !== "many")
|
|
2271
2246
|
throw new Error(`${n} "${t}" accepts open intent only with many cardinality`);
|
|
2272
2247
|
const s = {
|
|
2273
|
-
instanceKey:
|
|
2248
|
+
instanceKey: T(e.resource),
|
|
2274
2249
|
resource: e.resource,
|
|
2275
2250
|
...r.binding.cardinality === "many" ? {
|
|
2276
2251
|
open: e.open ?? "preview"
|
|
@@ -2279,13 +2254,13 @@ const vr = () => {
|
|
|
2279
2254
|
title: e.title
|
|
2280
2255
|
} : {}
|
|
2281
2256
|
};
|
|
2282
|
-
return o.resourceInstances.set(t,
|
|
2283
|
-
},
|
|
2257
|
+
return o.resourceInstances.set(t, _n(r, o.resourceInstances.get(t) ?? [], s)), s.instanceKey;
|
|
2258
|
+
}, jt = (e) => {
|
|
2284
2259
|
if (e.instanceKey === "default")
|
|
2285
|
-
return
|
|
2260
|
+
return qn(e), !0;
|
|
2286
2261
|
const t = e.state.resourceInstances.get(e.id) ?? [], r = t.filter((n) => n.instanceKey !== e.instanceKey);
|
|
2287
2262
|
return r.length === t.length ? !1 : (e.state.resourceInstances.set(e.id, r), !0);
|
|
2288
|
-
},
|
|
2263
|
+
}, Bt = (e) => {
|
|
2289
2264
|
const {
|
|
2290
2265
|
id: t,
|
|
2291
2266
|
item: r,
|
|
@@ -2308,13 +2283,13 @@ const vr = () => {
|
|
|
2308
2283
|
title: e.title
|
|
2309
2284
|
}
|
|
2310
2285
|
} : a));
|
|
2311
|
-
},
|
|
2286
|
+
}, $e = (e, t) => {
|
|
2312
2287
|
e.staticOverrides.delete(t), e.resourceInstances.delete(t);
|
|
2313
|
-
},
|
|
2314
|
-
const t =
|
|
2288
|
+
}, Dt = /* @__PURE__ */ new WeakMap(), At = (e, t) => Dt.set(e, t), N = (e) => {
|
|
2289
|
+
const t = Dt.get(e);
|
|
2315
2290
|
if (!t) throw new Error("Owned placement preparation is unavailable");
|
|
2316
2291
|
return t;
|
|
2317
|
-
},
|
|
2292
|
+
}, Vt = (e) => {
|
|
2318
2293
|
const t = {
|
|
2319
2294
|
staticOverrides: new Map(e.current.staticOverrides),
|
|
2320
2295
|
resourceInstances: new Map(e.current.resourceInstances)
|
|
@@ -2326,11 +2301,11 @@ const vr = () => {
|
|
|
2326
2301
|
state: t
|
|
2327
2302
|
};
|
|
2328
2303
|
let n = "default";
|
|
2329
|
-
return e.item.kind === "view" ?
|
|
2304
|
+
return e.item.kind === "view" ? zn(r) : n = Un(r), {
|
|
2330
2305
|
state: t,
|
|
2331
2306
|
identity: e.identityFor(n)
|
|
2332
2307
|
};
|
|
2333
|
-
},
|
|
2308
|
+
}, re = (e) => {
|
|
2334
2309
|
const t = {
|
|
2335
2310
|
staticOverrides: new Map(e.state.staticOverrides),
|
|
2336
2311
|
resourceInstances: new Map(e.state.resourceInstances)
|
|
@@ -2355,7 +2330,7 @@ const vr = () => {
|
|
|
2355
2330
|
t.resourceInstances.set(r.id, o.cardinality === "one" ? s.slice(-1) : s);
|
|
2356
2331
|
}
|
|
2357
2332
|
return t;
|
|
2358
|
-
},
|
|
2333
|
+
}, he = (e, t, r, n) => {
|
|
2359
2334
|
const o = t.getView(r.viewId);
|
|
2360
2335
|
if (!o) throw new Error(`Workbench placement view is not registered: ${r.viewId}`);
|
|
2361
2336
|
const {
|
|
@@ -2375,13 +2350,13 @@ const vr = () => {
|
|
|
2375
2350
|
modeId: e.modeId,
|
|
2376
2351
|
placementId: e.id,
|
|
2377
2352
|
instanceKey: t
|
|
2378
|
-
}),
|
|
2353
|
+
}), Hn = (e) => e === "pin" ? {
|
|
2379
2354
|
pinned: !0,
|
|
2380
2355
|
tabRetention: "persistent"
|
|
2381
2356
|
} : e === "preview" ? {
|
|
2382
2357
|
pinned: !1,
|
|
2383
2358
|
tabRetention: "preview"
|
|
2384
|
-
} : {},
|
|
2359
|
+
} : {}, Ke = (e) => JSON.stringify([e.extensionId, e.id]), Qn = (e) => {
|
|
2385
2360
|
const {
|
|
2386
2361
|
placement: t,
|
|
2387
2362
|
placements: r,
|
|
@@ -2391,14 +2366,14 @@ const vr = () => {
|
|
|
2391
2366
|
if (r.has(t.id)) throw new Error(`Mode placement already registered: ${t.id}`);
|
|
2392
2367
|
if (t.ref.kind !== "placement" || !t.ref.extensionId || !t.ref.id)
|
|
2393
2368
|
throw new Error(`Mode placement "${t.id}" must declare a normalized placement ref`);
|
|
2394
|
-
const s =
|
|
2369
|
+
const s = Ke(t.ref);
|
|
2395
2370
|
if (n.has(s)) throw new Error(`Mode placement ref already registered: ${s}`);
|
|
2396
2371
|
if (t.movableTo && !t.movableTo.includes(t.region))
|
|
2397
2372
|
throw new Error(`Mode placement "${t.id}" must include its initial region in movableTo`);
|
|
2398
|
-
if (
|
|
2373
|
+
if (Tt("Mode placement", t.id, t.item), !o.getView(A(t.item)))
|
|
2399
2374
|
throw new Error(`Workbench mode placement view is not registered: ${A(t.item)}`);
|
|
2400
2375
|
return s;
|
|
2401
|
-
},
|
|
2376
|
+
}, Jn = (e) => ({
|
|
2402
2377
|
...e,
|
|
2403
2378
|
ref: {
|
|
2404
2379
|
...e.ref
|
|
@@ -2409,15 +2384,15 @@ const vr = () => {
|
|
|
2409
2384
|
...e.movableTo ? {
|
|
2410
2385
|
movableTo: [...e.movableTo]
|
|
2411
2386
|
} : {}
|
|
2412
|
-
}),
|
|
2387
|
+
}), Gn = (e) => {
|
|
2413
2388
|
const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
2414
|
-
let n =
|
|
2389
|
+
let n = X();
|
|
2415
2390
|
const o = /* @__PURE__ */ new Set(), s = "Mode placement", a = (d) => [...t.values()].filter((u) => !d || u.modeId === d).sort((u, p) => u.id.localeCompare(p.id));
|
|
2416
2391
|
let l;
|
|
2417
2392
|
const c = () => {
|
|
2418
2393
|
l?.();
|
|
2419
2394
|
for (const d of o) Ce(d, () => L("mode placement subscriber", d));
|
|
2420
|
-
}, g = (d, u, p,
|
|
2395
|
+
}, g = (d, u, p, y, f) => {
|
|
2421
2396
|
if (!e.views.getView(A(d.item))) throw new Error(`Workbench mode placement view is not registered: ${A(d.item)}`);
|
|
2422
2397
|
const S = Le(d.id), k = e.getPanel(S);
|
|
2423
2398
|
if (!k) throw new Error(`Workbench mode placement is not registered: ${d.id}`);
|
|
@@ -2435,7 +2410,7 @@ const vr = () => {
|
|
|
2435
2410
|
...f ? {
|
|
2436
2411
|
title: f
|
|
2437
2412
|
} : {},
|
|
2438
|
-
...
|
|
2413
|
+
...Hn(y)
|
|
2439
2414
|
})
|
|
2440
2415
|
};
|
|
2441
2416
|
}, m = {
|
|
@@ -2446,34 +2421,34 @@ const vr = () => {
|
|
|
2446
2421
|
},
|
|
2447
2422
|
getState: () => n,
|
|
2448
2423
|
restore(d, u = n) {
|
|
2449
|
-
e.getProjectId && d.projectId !== e.getProjectId() && (u =
|
|
2424
|
+
e.getProjectId && d.projectId !== e.getProjectId() && (u = X());
|
|
2450
2425
|
const p = e.loadLayout?.(d);
|
|
2451
2426
|
if (!p) return u;
|
|
2452
|
-
const
|
|
2453
|
-
return
|
|
2427
|
+
const y = a(d.modeId).filter((f) => f.item.kind === "view" ? !u.staticOverrides.has(f.id) : !u.resourceInstances.has(f.id));
|
|
2428
|
+
return y.length ? re({
|
|
2454
2429
|
state: u,
|
|
2455
|
-
declarations:
|
|
2430
|
+
declarations: y,
|
|
2456
2431
|
saved: Object.values(p.regions).flatMap((f) => f.widgets),
|
|
2457
2432
|
owns: (f) => f.kind === "mode" && f.modeId === d.modeId
|
|
2458
2433
|
}) : u;
|
|
2459
2434
|
},
|
|
2460
2435
|
adopt(d, u, p = n) {
|
|
2461
|
-
return
|
|
2436
|
+
return re({
|
|
2462
2437
|
state: p,
|
|
2463
2438
|
declarations: a(d),
|
|
2464
2439
|
saved: u,
|
|
2465
|
-
owns: (
|
|
2440
|
+
owns: (y) => y.kind === "mode" && y.modeId === d
|
|
2466
2441
|
});
|
|
2467
2442
|
},
|
|
2468
2443
|
open(d, u = n) {
|
|
2469
2444
|
const p = t.get(d.placementId);
|
|
2470
2445
|
if (!p) throw new Error(`Unknown mode placement: ${d.placementId}`);
|
|
2471
|
-
return
|
|
2446
|
+
return Vt({
|
|
2472
2447
|
label: s,
|
|
2473
2448
|
target: d,
|
|
2474
2449
|
item: p.item,
|
|
2475
2450
|
current: u,
|
|
2476
|
-
identityFor: (
|
|
2451
|
+
identityFor: (y) => ot(p, y)
|
|
2477
2452
|
});
|
|
2478
2453
|
},
|
|
2479
2454
|
apply: (d) => {
|
|
@@ -2481,16 +2456,16 @@ const vr = () => {
|
|
|
2481
2456
|
},
|
|
2482
2457
|
publish: c,
|
|
2483
2458
|
resolve(d, u = n) {
|
|
2484
|
-
return d ? a(d).flatMap((p) => p.item.kind === "view" ?
|
|
2459
|
+
return d ? a(d).flatMap((p) => p.item.kind === "view" ? Ot(p.item, u, p.id) ? [g(p, "default")] : [] : (u.resourceInstances.get(p.id) ?? []).map((y) => g(p, y.instanceKey, y.resource, y.open, y.title))) : [];
|
|
2485
2460
|
}
|
|
2486
2461
|
}, i = {
|
|
2487
2462
|
registerPlacement(d) {
|
|
2488
|
-
const u =
|
|
2463
|
+
const u = Qn({
|
|
2489
2464
|
placement: d,
|
|
2490
2465
|
placements: t,
|
|
2491
2466
|
refs: r,
|
|
2492
2467
|
views: e.views
|
|
2493
|
-
}), p =
|
|
2468
|
+
}), p = Jn(d), y = he(e.registerPanel, e.views, {
|
|
2494
2469
|
...p,
|
|
2495
2470
|
id: Le(p.id),
|
|
2496
2471
|
viewId: A(p.item),
|
|
@@ -2499,15 +2474,15 @@ const vr = () => {
|
|
|
2499
2474
|
closable: ue(p.item)
|
|
2500
2475
|
}, e.viewMenus);
|
|
2501
2476
|
return t.set(p.id, p), r.set(u, p), c(), R(() => {
|
|
2502
|
-
t.get(p.id) === p && (t.delete(p.id), r.delete(u),
|
|
2477
|
+
t.get(p.id) === p && (t.delete(p.id), r.delete(u), $e(n, p.id), y.dispose(), c());
|
|
2503
2478
|
});
|
|
2504
2479
|
},
|
|
2505
2480
|
getPlacement(d) {
|
|
2506
|
-
return r.get(
|
|
2481
|
+
return r.get(Ke(d));
|
|
2507
2482
|
},
|
|
2508
2483
|
listPlacements: a,
|
|
2509
2484
|
openPlacement(d) {
|
|
2510
|
-
const u = r.get(
|
|
2485
|
+
const u = r.get(Ke(d.panel));
|
|
2511
2486
|
if (!u) throw new Error(`Unknown mode panel: ${d.panel.extensionId}.${d.panel.id}`);
|
|
2512
2487
|
const p = m.open({
|
|
2513
2488
|
...d,
|
|
@@ -2519,7 +2494,7 @@ const vr = () => {
|
|
|
2519
2494
|
if (d.kind !== "mode") throw new Error("Mode placement registry closes only mode-owned placements");
|
|
2520
2495
|
const u = t.get(d.placementId);
|
|
2521
2496
|
if (!u) return;
|
|
2522
|
-
|
|
2497
|
+
jt({
|
|
2523
2498
|
label: s,
|
|
2524
2499
|
id: u.id,
|
|
2525
2500
|
item: u.item,
|
|
@@ -2530,7 +2505,7 @@ const vr = () => {
|
|
|
2530
2505
|
updatePlacement(d, u) {
|
|
2531
2506
|
if (d.kind !== "mode") throw new Error("Mode placement registry updates only mode-owned placements");
|
|
2532
2507
|
const p = t.get(d.placementId);
|
|
2533
|
-
p && (
|
|
2508
|
+
p && (Bt({
|
|
2534
2509
|
label: s,
|
|
2535
2510
|
id: p.id,
|
|
2536
2511
|
item: p.item,
|
|
@@ -2544,10 +2519,10 @@ const vr = () => {
|
|
|
2544
2519
|
return o.add(d), R(() => o.delete(d));
|
|
2545
2520
|
}
|
|
2546
2521
|
};
|
|
2547
|
-
return
|
|
2548
|
-
},
|
|
2522
|
+
return At(i, m), i;
|
|
2523
|
+
}, Yn = (e, t) => t.priority - e.priority || e.id.localeCompare(t.id), Xn = () => {
|
|
2549
2524
|
throw new Error("navigation.openTarget: no dispatcher available (configure resolveDispatcher)");
|
|
2550
|
-
},
|
|
2525
|
+
}, Zn = async (e, t) => {
|
|
2551
2526
|
if (e.kind === "page") {
|
|
2552
2527
|
if (!t.openPageTarget) throw new Error("navigation.openTarget: page target dispatcher is not configured");
|
|
2553
2528
|
return t.openPageTarget(e);
|
|
@@ -2561,13 +2536,13 @@ const vr = () => {
|
|
|
2561
2536
|
return t.openHref(e.href);
|
|
2562
2537
|
}
|
|
2563
2538
|
return t.executeCommand(e.commandId, e.args);
|
|
2564
|
-
},
|
|
2539
|
+
}, eo = (e, t) => {
|
|
2565
2540
|
if (e.kind === "panel" && t.canOpenPanel?.(e) === !1)
|
|
2566
2541
|
throw new Error(`Cannot open navigation panel target: ${e.panel.id}`);
|
|
2567
2542
|
if (e.kind === "command" && t.canExecuteCommand?.(e.commandId) === !1)
|
|
2568
2543
|
throw new Error(`Cannot open navigation command target: ${e.commandId}`);
|
|
2569
|
-
},
|
|
2570
|
-
const t = e.resolveDispatcher ??
|
|
2544
|
+
}, to = (e) => e.kind === "compound" ? e.targets : [e], ro = (e = {}) => {
|
|
2545
|
+
const t = e.resolveDispatcher ?? Xn, r = W({
|
|
2571
2546
|
name: "workbench.navigation",
|
|
2572
2547
|
initialState: {
|
|
2573
2548
|
parsers: {}
|
|
@@ -2588,7 +2563,7 @@ const vr = () => {
|
|
|
2588
2563
|
...g
|
|
2589
2564
|
} = s, m = {
|
|
2590
2565
|
...g,
|
|
2591
|
-
...
|
|
2566
|
+
...x({
|
|
2592
2567
|
...a,
|
|
2593
2568
|
priority: a?.priority ?? c
|
|
2594
2569
|
})
|
|
@@ -2608,7 +2583,7 @@ const vr = () => {
|
|
|
2608
2583
|
});
|
|
2609
2584
|
},
|
|
2610
2585
|
listParsers() {
|
|
2611
|
-
return Object.values(r.getState().parsers).sort(
|
|
2586
|
+
return Object.values(r.getState().parsers).sort(Yn);
|
|
2612
2587
|
},
|
|
2613
2588
|
resolveLocation(s) {
|
|
2614
2589
|
const a = this.listParsers().find((l) => l.canParse(s));
|
|
@@ -2616,14 +2591,14 @@ const vr = () => {
|
|
|
2616
2591
|
return a.parse(s);
|
|
2617
2592
|
},
|
|
2618
2593
|
async openTarget(s) {
|
|
2619
|
-
const a = t(), l =
|
|
2620
|
-
for (const g of l)
|
|
2594
|
+
const a = t(), l = to(s), c = [];
|
|
2595
|
+
for (const g of l) eo(g, a);
|
|
2621
2596
|
if (s.kind === "compound") {
|
|
2622
2597
|
if (s.targets.some((m) => m.kind !== "page" && m.kind !== "panel")) throw new Error("Compound navigation accepts only page and panel targets");
|
|
2623
2598
|
if (!a.prepareNavigation) throw new Error("navigation.openTarget: navigation preparation is not configured");
|
|
2624
2599
|
return [a.prepareNavigation(s.targets).commit()];
|
|
2625
2600
|
}
|
|
2626
|
-
for (const g of l) c.push(await
|
|
2601
|
+
for (const g of l) c.push(await Zn(g, a));
|
|
2627
2602
|
return c;
|
|
2628
2603
|
},
|
|
2629
2604
|
async openPage(s) {
|
|
@@ -2643,7 +2618,7 @@ const vr = () => {
|
|
|
2643
2618
|
}
|
|
2644
2619
|
};
|
|
2645
2620
|
return o;
|
|
2646
|
-
}, me = (e) => `${e.kind}:${e.extensionId}:${e.id}`,
|
|
2621
|
+
}, me = (e) => `${e.kind}:${e.extensionId}:${e.id}`, no = (e, t) => me(e) === me(t), oo = (e) => (t, r) => {
|
|
2647
2622
|
const n = t.sourceExtensionId === e.extensionId, o = r.sourceExtensionId === e.extensionId;
|
|
2648
2623
|
if (n !== o) return n ? -1 : 1;
|
|
2649
2624
|
if (!n) {
|
|
@@ -2651,7 +2626,7 @@ const vr = () => {
|
|
|
2651
2626
|
if (s !== 0) return s;
|
|
2652
2627
|
}
|
|
2653
2628
|
return t.declarationIndex - r.declarationIndex || t.id.localeCompare(r.id);
|
|
2654
|
-
}, Pe = (e, t) => e ? `${e}:${t}` : t,
|
|
2629
|
+
}, Pe = (e, t) => e ? `${e}:${t}` : t, so = (e, t) => {
|
|
2655
2630
|
const r = e.findIndex((o) => o.id === t.id);
|
|
2656
2631
|
if (r < 0) {
|
|
2657
2632
|
e.push(t);
|
|
@@ -2662,10 +2637,10 @@ const vr = () => {
|
|
|
2662
2637
|
...n,
|
|
2663
2638
|
nodes: [...n.nodes, ...t.nodes]
|
|
2664
2639
|
};
|
|
2665
|
-
},
|
|
2640
|
+
}, ao = (e = {}) => {
|
|
2666
2641
|
const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new Set(), o = () => {
|
|
2667
2642
|
for (const c of n) c();
|
|
2668
|
-
}, s = (c, g) => [...t.values()].filter((m) =>
|
|
2643
|
+
}, s = (c, g) => [...t.values()].filter((m) => no(m.owner, c) && (m.slot ?? "content") === g).sort(oo(c)), a = (c, g, m) => {
|
|
2669
2644
|
const i = {
|
|
2670
2645
|
...c,
|
|
2671
2646
|
id: Pe(g.idScope, c.id),
|
|
@@ -2705,8 +2680,8 @@ const vr = () => {
|
|
|
2705
2680
|
const i = [], d = me(c);
|
|
2706
2681
|
for (const u of s(c, g)) {
|
|
2707
2682
|
const p = u.viewId ? await e.getViewSections?.(u.viewId, m) : await u.getSections?.(m);
|
|
2708
|
-
for (const
|
|
2709
|
-
|
|
2683
|
+
for (const y of p ?? [])
|
|
2684
|
+
so(i, l(y, u, d));
|
|
2710
2685
|
}
|
|
2711
2686
|
return i;
|
|
2712
2687
|
},
|
|
@@ -2723,8 +2698,8 @@ const vr = () => {
|
|
|
2723
2698
|
return n.add(c), R(() => n.delete(c));
|
|
2724
2699
|
}
|
|
2725
2700
|
};
|
|
2726
|
-
},
|
|
2727
|
-
const e =
|
|
2701
|
+
}, io = () => {
|
|
2702
|
+
const e = W({
|
|
2728
2703
|
name: "workbench.notifications",
|
|
2729
2704
|
initialState: {
|
|
2730
2705
|
notifications: {}
|
|
@@ -2740,7 +2715,7 @@ const vr = () => {
|
|
|
2740
2715
|
let a = o.id;
|
|
2741
2716
|
a || (r += 1, a = `workbench.notification.${r.toString()}`);
|
|
2742
2717
|
const l = {
|
|
2743
|
-
...
|
|
2718
|
+
...x(s),
|
|
2744
2719
|
...o,
|
|
2745
2720
|
id: a,
|
|
2746
2721
|
createdAt: o.createdAt ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -2789,14 +2764,14 @@ const vr = () => {
|
|
|
2789
2764
|
});
|
|
2790
2765
|
}
|
|
2791
2766
|
};
|
|
2792
|
-
}, st = (e) => `workbench.overlay.${encodeURIComponent(e)}`,
|
|
2767
|
+
}, st = (e) => `workbench.overlay.${encodeURIComponent(e)}`, co = (e) => {
|
|
2793
2768
|
const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
2794
2769
|
return {
|
|
2795
2770
|
registerOverlay(n) {
|
|
2796
2771
|
if (t.has(n.id)) throw new Error(`Overlay already registered: ${n.id}`);
|
|
2797
2772
|
const o = {
|
|
2798
2773
|
...n
|
|
2799
|
-
}, s =
|
|
2774
|
+
}, s = he(e.layout, e.views, {
|
|
2800
2775
|
...o,
|
|
2801
2776
|
id: st(o.id),
|
|
2802
2777
|
region: "overlay",
|
|
@@ -2828,7 +2803,7 @@ const vr = () => {
|
|
|
2828
2803
|
e.layout.removeWidgetPlacement(n);
|
|
2829
2804
|
}
|
|
2830
2805
|
};
|
|
2831
|
-
},
|
|
2806
|
+
}, we = "$main", De = (e) => {
|
|
2832
2807
|
if (e.main.kind !== "view") return;
|
|
2833
2808
|
const {
|
|
2834
2809
|
kind: t,
|
|
@@ -2842,7 +2817,7 @@ const vr = () => {
|
|
|
2842
2817
|
} : void 0;
|
|
2843
2818
|
return {
|
|
2844
2819
|
...o,
|
|
2845
|
-
id:
|
|
2820
|
+
id: we,
|
|
2846
2821
|
role: "primary",
|
|
2847
2822
|
region: "main",
|
|
2848
2823
|
item: s ? {
|
|
@@ -2860,14 +2835,14 @@ const vr = () => {
|
|
|
2860
2835
|
...r,
|
|
2861
2836
|
role: "auxiliary"
|
|
2862
2837
|
}))];
|
|
2863
|
-
},
|
|
2838
|
+
}, Ft = (e, t) => {
|
|
2864
2839
|
const r = ve(e).find((n) => n.id === t);
|
|
2865
2840
|
if (!r) throw new Error(`Unknown page slot: ${e.id}.${t}`);
|
|
2866
2841
|
return r;
|
|
2867
|
-
},
|
|
2842
|
+
}, lo = (e) => {
|
|
2868
2843
|
if (e.main.kind === "panels")
|
|
2869
2844
|
return {
|
|
2870
|
-
id:
|
|
2845
|
+
id: we,
|
|
2871
2846
|
role: "primary",
|
|
2872
2847
|
region: "main",
|
|
2873
2848
|
item: {
|
|
@@ -2876,13 +2851,13 @@ const vr = () => {
|
|
|
2876
2851
|
presence: "fixed"
|
|
2877
2852
|
}
|
|
2878
2853
|
};
|
|
2879
|
-
},
|
|
2880
|
-
const t =
|
|
2854
|
+
}, go = (e) => {
|
|
2855
|
+
const t = lo(e);
|
|
2881
2856
|
return [...ve(e), ...t ? [t] : []];
|
|
2882
|
-
},
|
|
2857
|
+
}, xe = (e) => ({
|
|
2883
2858
|
openStaticSlotIds: e.slots.filter((t) => t.item.kind === "view" && t.item.presence === "open").map((t) => t.id),
|
|
2884
2859
|
resourceInstances: {}
|
|
2885
|
-
}),
|
|
2860
|
+
}), uo = (e, t) => e.item.kind === "view" && (e.item.presence === "fixed" || t.openStaticSlotIds.includes(e.id)), mo = (e, t, r) => {
|
|
2886
2861
|
if (e.item.kind !== "binding" || e.item.binding.cardinality !== "many") return [r];
|
|
2887
2862
|
const o = t.find((s) => s.instanceKey === r.instanceKey)?.open === "pin" || r.open === "pin" ? "pin" : "preview";
|
|
2888
2863
|
return [...t.filter((s) => s.instanceKey !== r.instanceKey && (o === "pin" || s.open === "pin")), {
|
|
@@ -2914,13 +2889,13 @@ const vr = () => {
|
|
|
2914
2889
|
...r,
|
|
2915
2890
|
resourceInstances: {
|
|
2916
2891
|
...r.resourceInstances,
|
|
2917
|
-
[t.id]:
|
|
2892
|
+
[t.id]: mo(t, r.resourceInstances[t.id] ?? [], a)
|
|
2918
2893
|
},
|
|
2919
2894
|
...t.role === "primary" ? {
|
|
2920
2895
|
activePrimaryInstanceKey: s
|
|
2921
2896
|
} : {}
|
|
2922
2897
|
};
|
|
2923
|
-
},
|
|
2898
|
+
}, fo = (e) => {
|
|
2924
2899
|
const {
|
|
2925
2900
|
page: t,
|
|
2926
2901
|
target: r
|
|
@@ -2943,7 +2918,7 @@ const vr = () => {
|
|
|
2943
2918
|
...e.state,
|
|
2944
2919
|
activePrimaryInstanceKey: "default"
|
|
2945
2920
|
};
|
|
2946
|
-
},
|
|
2921
|
+
}, Nt = (e, t) => e.slots.filter((r) => r.item.kind === "binding" && r.openOn === "page-resource" && t && z(r.item.binding, t)), po = (e) => e.target.resource ? Nt(e.page, e.target.resource).reduce((t, r) => Ae({
|
|
2947
2922
|
slot: {
|
|
2948
2923
|
...r,
|
|
2949
2924
|
role: "auxiliary"
|
|
@@ -2954,26 +2929,26 @@ const vr = () => {
|
|
|
2954
2929
|
resource: e.target.resource
|
|
2955
2930
|
},
|
|
2956
2931
|
resourceKey: e.resourceKey
|
|
2957
|
-
}), e.state) : e.state,
|
|
2932
|
+
}), e.state) : e.state, zt = (e, t, r) => {
|
|
2958
2933
|
const n = new Set(e.openStaticSlotIds);
|
|
2959
2934
|
return r ? n.add(t) : n.delete(t), {
|
|
2960
2935
|
...e,
|
|
2961
2936
|
openStaticSlotIds: [...n]
|
|
2962
2937
|
};
|
|
2963
|
-
},
|
|
2938
|
+
}, yo = (e, t, r) => ({
|
|
2964
2939
|
...e,
|
|
2965
2940
|
resourceInstances: {
|
|
2966
2941
|
...e.resourceInstances,
|
|
2967
2942
|
[t]: (e.resourceInstances[t] ?? []).filter((n) => n.instanceKey !== r)
|
|
2968
2943
|
}
|
|
2969
|
-
}),
|
|
2944
|
+
}), ho = (e) => {
|
|
2970
2945
|
const {
|
|
2971
2946
|
page: t,
|
|
2972
2947
|
slot: r,
|
|
2973
2948
|
instanceKey: n
|
|
2974
2949
|
} = e;
|
|
2975
2950
|
if (r.item.kind === "view" && r.item.presence === "fixed") throw new Error(`Page slot "${r.id}" is fixed and cannot close`);
|
|
2976
|
-
const o = n === "default" ?
|
|
2951
|
+
const o = n === "default" ? zt(e.state, r.id, !1) : yo(e.state, r.id, n);
|
|
2977
2952
|
if (r.role === "auxiliary") return {
|
|
2978
2953
|
kind: "stay",
|
|
2979
2954
|
state: o
|
|
@@ -2996,7 +2971,7 @@ const vr = () => {
|
|
|
2996
2971
|
state: o,
|
|
2997
2972
|
parentId: t.parentId
|
|
2998
2973
|
};
|
|
2999
|
-
},
|
|
2974
|
+
}, wo = (e) => {
|
|
3000
2975
|
const {
|
|
3001
2976
|
identity: t,
|
|
3002
2977
|
page: r,
|
|
@@ -3004,11 +2979,11 @@ const vr = () => {
|
|
|
3004
2979
|
} = e;
|
|
3005
2980
|
if (t.kind !== "page") throw new Error("Page registry can close only page-owned placements");
|
|
3006
2981
|
if (n.activePageId !== t.pageId) throw new Error(`Page is not active: ${t.pageId}`);
|
|
3007
|
-
const o =
|
|
3008
|
-
if (!n.placements.some((d) =>
|
|
2982
|
+
const o = Ft(r, t.slotId);
|
|
2983
|
+
if (!n.placements.some((d) => E(d.identity) === E(t))) throw new Error(`Page placement is not open: ${E(t)}`);
|
|
3009
2984
|
if (o.role === "primary" && t.instanceKey === "default")
|
|
3010
2985
|
throw new Error(`Static primary placement is not closable: ${r.id}.${o.id}`);
|
|
3011
|
-
const a = n.pageStates[e.stateKey] ??
|
|
2986
|
+
const a = n.pageStates[e.stateKey] ?? xe(r), l = o.role === "primary" && a.activePrimaryInstanceKey === t.instanceKey, c = ho({
|
|
3012
2987
|
page: r,
|
|
3013
2988
|
slot: o,
|
|
3014
2989
|
state: a,
|
|
@@ -3057,9 +3032,9 @@ const vr = () => {
|
|
|
3057
3032
|
},
|
|
3058
3033
|
locationChanged: l
|
|
3059
3034
|
};
|
|
3060
|
-
},
|
|
3035
|
+
}, ne = (e, t, r) => e.main.kind === "panels" && t ? `${e.id}|${le(t, r)}` : e.id, vo = (e, t) => Object.fromEntries(Object.entries(e).filter(([r]) => r !== t && !r.startsWith(`${t}|`))), So = (e, t, r) => {
|
|
3061
3036
|
if (t.kind !== "page" || e.activePageId !== t.pageId) throw new Error("Only an active page placement can be pinned");
|
|
3062
|
-
const n = e.pages[t.pageId], o =
|
|
3037
|
+
const n = e.pages[t.pageId], o = ne(n, e.location, r), s = e.pageStates[o], a = s.resourceInstances[t.slotId] ?? [];
|
|
3063
3038
|
if (!a.some((l) => l.instanceKey === t.instanceKey)) throw new Error("Only an open resource placement can be pinned");
|
|
3064
3039
|
return {
|
|
3065
3040
|
...e,
|
|
@@ -3082,21 +3057,21 @@ const vr = () => {
|
|
|
3082
3057
|
pageId: e,
|
|
3083
3058
|
slotId: t,
|
|
3084
3059
|
instanceKey: r
|
|
3085
|
-
}),
|
|
3060
|
+
}), Io = (e, t, r) => t ? Nt(e, t).filter((n) => n.region !== "main").filter((n, o, s) => s.findIndex((a) => a.region === n.region) === o).map((n) => fe(e.id, n.id, r(t))) : [], bo = (e) => {
|
|
3086
3061
|
const t = /* @__PURE__ */ new Set();
|
|
3087
3062
|
for (const r of e.slots) {
|
|
3088
|
-
if (r.id ===
|
|
3063
|
+
if (r.id === we || t.has(r.id)) throw new Error(`Page "${e.id}" declares duplicate or reserved slot "${r.id}"`);
|
|
3089
3064
|
if (t.add(r.id), r.item.kind === "binding" && r.item.binding.kinds.length === 0) throw new Error(`Page slot "${r.id}" must bind at least one resource kind`);
|
|
3090
3065
|
if (r.openOn && r.item.kind !== "binding") throw new Error(`Page slot "${r.id}" requires a binding for openOn`);
|
|
3091
3066
|
}
|
|
3092
|
-
},
|
|
3067
|
+
}, Po = (e) => {
|
|
3093
3068
|
if (e.ref.kind !== "page" || !e.ref.extensionId || !e.ref.id) throw new Error(`Page "${e.id}" must declare a normalized page ref`);
|
|
3094
3069
|
if (e.path.startsWith("/") || e.path.endsWith("/")) throw new Error(`Page "${e.id}" must declare a normalized path`);
|
|
3095
3070
|
if (!e.main || e.main.kind !== "view" && e.main.kind !== "panels") throw new Error(`Page "${e.id}" must declare Main content or a panel collection`);
|
|
3096
3071
|
if (e.resource && e.resource.kinds.length === 0) throw new Error(`Page "${e.id}" must accept at least one resource kind`);
|
|
3097
3072
|
if (e.main.kind === "view" && e.main.cardinality === "many" && !e.resource) throw new Error(`Page "${e.id}" requires a resource for many cardinality`);
|
|
3098
3073
|
if (e.main.kind === "view" && e.resource && !e.parentId) throw new Error(`Resource page "${e.id}" must declare a parent`);
|
|
3099
|
-
|
|
3074
|
+
bo(e);
|
|
3100
3075
|
}, ke = (e) => {
|
|
3101
3076
|
const t = e.slot.item, r = t.kind === "view" ? t.view : t.binding.view, n = fe(e.page.id, e.slot.id, e.instanceKey);
|
|
3102
3077
|
return {
|
|
@@ -3121,10 +3096,10 @@ const vr = () => {
|
|
|
3121
3096
|
closable: t.kind === "binding" || t.presence !== "fixed"
|
|
3122
3097
|
})
|
|
3123
3098
|
};
|
|
3124
|
-
},
|
|
3099
|
+
}, ko = (e) => {
|
|
3125
3100
|
const t = [];
|
|
3126
3101
|
for (const r of ve(e.page)) {
|
|
3127
|
-
|
|
3102
|
+
uo(r, e.state) && t.push(ke({
|
|
3128
3103
|
...e,
|
|
3129
3104
|
slot: r,
|
|
3130
3105
|
instanceKey: "default"
|
|
@@ -3140,7 +3115,7 @@ const vr = () => {
|
|
|
3140
3115
|
...e,
|
|
3141
3116
|
instanceKey: "default",
|
|
3142
3117
|
slot: {
|
|
3143
|
-
id:
|
|
3118
|
+
id: we,
|
|
3144
3119
|
role: "primary",
|
|
3145
3120
|
region: "main",
|
|
3146
3121
|
item: {
|
|
@@ -3150,13 +3125,13 @@ const vr = () => {
|
|
|
3150
3125
|
}
|
|
3151
3126
|
}
|
|
3152
3127
|
})), t;
|
|
3153
|
-
},
|
|
3128
|
+
}, Ro = () => ({
|
|
3154
3129
|
add: [],
|
|
3155
3130
|
retain: [],
|
|
3156
3131
|
update: [],
|
|
3157
3132
|
activate: [],
|
|
3158
3133
|
remove: []
|
|
3159
|
-
}),
|
|
3134
|
+
}), Mo = (e) => W({
|
|
3160
3135
|
name: "workbench.pages",
|
|
3161
3136
|
initialState: {
|
|
3162
3137
|
pages: {},
|
|
@@ -3164,12 +3139,12 @@ const vr = () => {
|
|
|
3164
3139
|
placements: ae({
|
|
3165
3140
|
shell: e.resolveShellPlacements()
|
|
3166
3141
|
}).placements,
|
|
3167
|
-
reconciliation:
|
|
3142
|
+
reconciliation: Ro()
|
|
3168
3143
|
}
|
|
3169
|
-
}),
|
|
3144
|
+
}), Co = (e) => {
|
|
3170
3145
|
if (e.modeId)
|
|
3171
3146
|
return e.desired ? e.desired : e.modeId !== e.current.activeModeId || e.projectId !== e.current.projectId ? e.resolveModePlacements(e.modeId, e.location, e.projectId, e.pageId) : e.current.placements.filter((t) => t.identity.kind === "mode" && t.identity.modeId === e.modeId);
|
|
3172
|
-
},
|
|
3147
|
+
}, Eo = (e) => {
|
|
3173
3148
|
const t = e.state.activeModeId;
|
|
3174
3149
|
t && e.commit({
|
|
3175
3150
|
pageStates: e.state.pageStates,
|
|
@@ -3180,7 +3155,7 @@ const vr = () => {
|
|
|
3180
3155
|
modePlacements: e.registryInput.resolveModePlacements(t),
|
|
3181
3156
|
action: "refreshModePlacements"
|
|
3182
3157
|
});
|
|
3183
|
-
},
|
|
3158
|
+
}, Wo = (e) => {
|
|
3184
3159
|
e.commit({
|
|
3185
3160
|
pageStates: e.state.pageStates,
|
|
3186
3161
|
projectId: e.state.projectId,
|
|
@@ -3189,15 +3164,15 @@ const vr = () => {
|
|
|
3189
3164
|
activeModeId: e.state.activeModeId,
|
|
3190
3165
|
action: "refreshShellPlacements"
|
|
3191
3166
|
});
|
|
3192
|
-
},
|
|
3167
|
+
}, $o = (e) => {
|
|
3193
3168
|
const t = e.resources.normalize, r = (l) => e.resources.toUri(t(l)), n = (l, c) => {
|
|
3194
3169
|
const g = l.pages[c];
|
|
3195
3170
|
if (!g) throw new Error(`Unknown page: ${c}`);
|
|
3196
3171
|
return g;
|
|
3197
3172
|
}, o = (l, c, g) => {
|
|
3198
|
-
const m = c.activePageId ? l.pages[c.activePageId] : void 0, i = m ? c.pageStates[
|
|
3173
|
+
const m = c.activePageId ? l.pages[c.activePageId] : void 0, i = m ? c.pageStates[ne(m, c.location, e.resources)] : void 0;
|
|
3199
3174
|
c.activeModeId && e.validateMode?.(c.activeModeId);
|
|
3200
|
-
const d = g?.mode ??
|
|
3175
|
+
const d = g?.mode ?? Co({
|
|
3201
3176
|
current: l,
|
|
3202
3177
|
modeId: c.activeModeId,
|
|
3203
3178
|
desired: c.modePlacements,
|
|
@@ -3216,7 +3191,7 @@ const vr = () => {
|
|
|
3216
3191
|
shell: u,
|
|
3217
3192
|
mode: d,
|
|
3218
3193
|
...m && i ? {
|
|
3219
|
-
page:
|
|
3194
|
+
page: ko({
|
|
3220
3195
|
page: m,
|
|
3221
3196
|
state: i,
|
|
3222
3197
|
resource: c.location?.resource,
|
|
@@ -3224,7 +3199,7 @@ const vr = () => {
|
|
|
3224
3199
|
resolvePagePlacement: e.resolvePagePlacement
|
|
3225
3200
|
})
|
|
3226
3201
|
} : {}
|
|
3227
|
-
}),
|
|
3202
|
+
}), y = je({
|
|
3228
3203
|
current: l.placements,
|
|
3229
3204
|
desired: p.placements,
|
|
3230
3205
|
activate: c.activate,
|
|
@@ -3238,7 +3213,7 @@ const vr = () => {
|
|
|
3238
3213
|
activePageId: c.activePageId,
|
|
3239
3214
|
activeModeId: c.activeModeId,
|
|
3240
3215
|
placements: p.placements,
|
|
3241
|
-
reconciliation:
|
|
3216
|
+
reconciliation: y
|
|
3242
3217
|
};
|
|
3243
3218
|
};
|
|
3244
3219
|
return {
|
|
@@ -3249,17 +3224,17 @@ const vr = () => {
|
|
|
3249
3224
|
...l.resource ? {
|
|
3250
3225
|
resource: t(l.resource)
|
|
3251
3226
|
} : {}
|
|
3252
|
-
}, u =
|
|
3227
|
+
}, u = ne(i, l.location, e.resources), p = m[u] ?? e.restorePageState?.(i, l.location, l.projectId) ?? xe(i), y = fo({
|
|
3253
3228
|
page: i,
|
|
3254
3229
|
state: p,
|
|
3255
3230
|
target: d,
|
|
3256
3231
|
resourceKey: r
|
|
3257
|
-
}), f = !l.pageStates || c.activePageId !== i.id ||
|
|
3232
|
+
}), f = !l.pageStates || c.activePageId !== i.id || T(c.location?.resource) !== T(d.resource) || c.pageStates[u]?.activePrimaryInstanceKey !== y.activePrimaryInstanceKey, v = f ? po({
|
|
3258
3233
|
page: i,
|
|
3259
|
-
state:
|
|
3234
|
+
state: y,
|
|
3260
3235
|
target: d,
|
|
3261
3236
|
resourceKey: r
|
|
3262
|
-
}) :
|
|
3237
|
+
}) : y, S = De(i), k = v.activePrimaryInstanceKey, w = f ? Io(i, d.resource, r) : [];
|
|
3263
3238
|
return o(c, {
|
|
3264
3239
|
pageStates: {
|
|
3265
3240
|
...m,
|
|
@@ -3269,31 +3244,31 @@ const vr = () => {
|
|
|
3269
3244
|
location: l.location,
|
|
3270
3245
|
activePageId: i.id,
|
|
3271
3246
|
activeModeId: i.modeId,
|
|
3272
|
-
activate: [...S && k ? [fe(i.id, S.id, k)] : [], ...
|
|
3247
|
+
activate: [...S && k ? [fe(i.id, S.id, k)] : [], ...w],
|
|
3273
3248
|
action: l.action
|
|
3274
3249
|
}, g);
|
|
3275
3250
|
},
|
|
3276
3251
|
slot: (l, c, g) => {
|
|
3277
3252
|
if (c.activePageId !== l.pageId) throw new Error(`Page is not active: ${l.pageId}`);
|
|
3278
|
-
const m = n(c, l.pageId), i =
|
|
3253
|
+
const m = n(c, l.pageId), i = Ft(m, l.slotId);
|
|
3279
3254
|
if (i.role !== "auxiliary") throw new Error(`Page slot is not an auxiliary panel: ${m.id}.${i.id}`);
|
|
3280
|
-
const d =
|
|
3281
|
-
let u = c.pageStates[d] ??
|
|
3282
|
-
const
|
|
3283
|
-
if (
|
|
3284
|
-
p = r(
|
|
3255
|
+
const d = ne(m, c.location, e.resources);
|
|
3256
|
+
let u = c.pageStates[d] ?? xe(m), p = "default";
|
|
3257
|
+
const y = l.resource ? t(l.resource) : void 0;
|
|
3258
|
+
if (y)
|
|
3259
|
+
p = r(y), u = Ae({
|
|
3285
3260
|
slot: i,
|
|
3286
3261
|
state: u,
|
|
3287
3262
|
target: {
|
|
3288
3263
|
...l,
|
|
3289
|
-
resource:
|
|
3264
|
+
resource: y
|
|
3290
3265
|
},
|
|
3291
3266
|
resourceKey: () => p
|
|
3292
3267
|
});
|
|
3293
3268
|
else {
|
|
3294
3269
|
if (i.item.kind === "binding") throw new Error(`Page slot "${i.id}" requires a resource`);
|
|
3295
3270
|
if (l.open) throw new Error(`Page slot "${i.id}" accepts open intent only with a resource`);
|
|
3296
|
-
i.item.presence !== "fixed" && (u =
|
|
3271
|
+
i.item.presence !== "fixed" && (u = zt(u, i.id, !0));
|
|
3297
3272
|
}
|
|
3298
3273
|
return o(c, {
|
|
3299
3274
|
...c,
|
|
@@ -3311,12 +3286,12 @@ const vr = () => {
|
|
|
3311
3286
|
update: [],
|
|
3312
3287
|
activate: [],
|
|
3313
3288
|
remove: []
|
|
3314
|
-
}),
|
|
3289
|
+
}), Lo = (e) => {
|
|
3315
3290
|
const {
|
|
3316
3291
|
page: t,
|
|
3317
3292
|
store: r
|
|
3318
3293
|
} = e;
|
|
3319
|
-
|
|
3294
|
+
Po(t);
|
|
3320
3295
|
const n = r.getState();
|
|
3321
3296
|
if (n.pages[t.id]) throw new Error(`Page already registered: ${t.id}`);
|
|
3322
3297
|
if (Object.values(n.pages).some((a) => a.ref.extensionId === t.ref.extensionId && a.ref.id === t.ref.id))
|
|
@@ -3345,7 +3320,7 @@ const vr = () => {
|
|
|
3345
3320
|
const {
|
|
3346
3321
|
[t.id]: l,
|
|
3347
3322
|
...c
|
|
3348
|
-
} = a.pages, g =
|
|
3323
|
+
} = a.pages, g = vo(a.pageStates, t.id);
|
|
3349
3324
|
if (a.activePageId === t.id) {
|
|
3350
3325
|
const m = ae({
|
|
3351
3326
|
shell: e.registryInput.resolveShellPlacements()
|
|
@@ -3373,26 +3348,26 @@ const vr = () => {
|
|
|
3373
3348
|
reconciliation: at()
|
|
3374
3349
|
}, !1, "unregisterPage"), s?.dispose();
|
|
3375
3350
|
});
|
|
3376
|
-
},
|
|
3377
|
-
const t = (d) => e.resources.normalize(d), r = (d) => e.resources.toUri(t(d)), n =
|
|
3351
|
+
}, Ko = (e) => {
|
|
3352
|
+
const t = (d) => e.resources.normalize(d), r = (d) => e.resources.toUri(t(d)), n = Mo(e);
|
|
3378
3353
|
let o, s;
|
|
3379
3354
|
const a = (d, u) => Te(() => {
|
|
3380
|
-
const p = n.getState(),
|
|
3355
|
+
const p = n.getState(), y = s;
|
|
3381
3356
|
s = d;
|
|
3382
3357
|
try {
|
|
3383
3358
|
o?.(d);
|
|
3384
3359
|
} finally {
|
|
3385
|
-
s =
|
|
3360
|
+
s = y;
|
|
3386
3361
|
}
|
|
3387
3362
|
n.getState() === p && n.setState(d, !1, u);
|
|
3388
3363
|
}), l = (d) => {
|
|
3389
3364
|
const u = n.getState().pages[d];
|
|
3390
3365
|
if (!u) throw new Error(`Unknown page: ${d}`);
|
|
3391
3366
|
return u;
|
|
3392
|
-
}, c =
|
|
3367
|
+
}, c = $o(e), g = (d) => a(c.compose(s ?? n.getState(), d), d.action), m = (d) => a(c.location(d, n.getState()), d.action), i = {
|
|
3393
3368
|
store: n,
|
|
3394
3369
|
registerPage(d) {
|
|
3395
|
-
return
|
|
3370
|
+
return Lo({
|
|
3396
3371
|
page: d,
|
|
3397
3372
|
registryInput: e,
|
|
3398
3373
|
store: n,
|
|
@@ -3409,7 +3384,7 @@ const vr = () => {
|
|
|
3409
3384
|
},
|
|
3410
3385
|
pinPlacement(d) {
|
|
3411
3386
|
g({
|
|
3412
|
-
...
|
|
3387
|
+
...So(n.getState(), d, e.resources),
|
|
3413
3388
|
action: "pinPagePlacement"
|
|
3414
3389
|
});
|
|
3415
3390
|
},
|
|
@@ -3417,7 +3392,7 @@ const vr = () => {
|
|
|
3417
3392
|
a(c.slot(d, n.getState()), "openPageSlot");
|
|
3418
3393
|
}
|
|
3419
3394
|
};
|
|
3420
|
-
return
|
|
3395
|
+
return gn(i, {
|
|
3421
3396
|
resources: e.resources,
|
|
3422
3397
|
prepare: c,
|
|
3423
3398
|
publish: a,
|
|
@@ -3436,14 +3411,14 @@ const vr = () => {
|
|
|
3436
3411
|
});
|
|
3437
3412
|
},
|
|
3438
3413
|
refreshModePlacements() {
|
|
3439
|
-
|
|
3414
|
+
Eo({
|
|
3440
3415
|
state: s ?? n.getState(),
|
|
3441
3416
|
registryInput: e,
|
|
3442
3417
|
commit: g
|
|
3443
3418
|
});
|
|
3444
3419
|
},
|
|
3445
3420
|
refreshShellPlacements() {
|
|
3446
|
-
|
|
3421
|
+
Wo({
|
|
3447
3422
|
state: s ?? n.getState(),
|
|
3448
3423
|
commit: g
|
|
3449
3424
|
});
|
|
@@ -3471,15 +3446,15 @@ const vr = () => {
|
|
|
3471
3446
|
resolveClosePlacement(d) {
|
|
3472
3447
|
const u = n.getState();
|
|
3473
3448
|
if (d.kind !== "page") throw new Error("Page registry can close only page-owned placements");
|
|
3474
|
-
return
|
|
3449
|
+
return wo({
|
|
3475
3450
|
identity: d,
|
|
3476
3451
|
page: l(d.pageId),
|
|
3477
3452
|
state: u,
|
|
3478
|
-
stateKey:
|
|
3453
|
+
stateKey: ne(l(d.pageId), u.location, e.resources)
|
|
3479
3454
|
});
|
|
3480
3455
|
}
|
|
3481
3456
|
}), i;
|
|
3482
|
-
},
|
|
3457
|
+
}, xo = (e) => ({
|
|
3483
3458
|
registerPlaceholder(t, r) {
|
|
3484
3459
|
const n = e.views.getView(t.viewId);
|
|
3485
3460
|
if (!n) throw new Error(`Workbench placeholder view is not registered: ${t.viewId}`);
|
|
@@ -3493,15 +3468,15 @@ const vr = () => {
|
|
|
3493
3468
|
kind: "shell",
|
|
3494
3469
|
placementId: e,
|
|
3495
3470
|
instanceKey: t
|
|
3496
|
-
}), ct = (e) => e === "main" ? "location" : e === "secondary" || e === "side" ? "sub-panel" : "content",
|
|
3471
|
+
}), ct = (e) => e === "main" ? "location" : e === "secondary" || e === "side" ? "sub-panel" : "content", Oo = (e) => e === "pin" ? {
|
|
3497
3472
|
pinned: !0,
|
|
3498
3473
|
tabRetention: "persistent"
|
|
3499
3474
|
} : e === "preview" ? {
|
|
3500
3475
|
pinned: !1,
|
|
3501
3476
|
tabRetention: "preview"
|
|
3502
|
-
} : {},
|
|
3477
|
+
} : {}, To = (e) => {
|
|
3503
3478
|
const t = /* @__PURE__ */ new Map();
|
|
3504
|
-
let r =
|
|
3479
|
+
let r = X();
|
|
3505
3480
|
const n = /* @__PURE__ */ new Set(), o = "Shell placement";
|
|
3506
3481
|
let s;
|
|
3507
3482
|
const a = () => {
|
|
@@ -3509,10 +3484,10 @@ const vr = () => {
|
|
|
3509
3484
|
for (const i of n) Ce(i, () => L("shell placement subscriber", i));
|
|
3510
3485
|
}, l = (i) => {
|
|
3511
3486
|
if (!e.enteredWithPersistedLayout()) {
|
|
3512
|
-
|
|
3487
|
+
$e(r, i.id);
|
|
3513
3488
|
return;
|
|
3514
3489
|
}
|
|
3515
|
-
r =
|
|
3490
|
+
r = re({
|
|
3516
3491
|
state: r,
|
|
3517
3492
|
declarations: [i],
|
|
3518
3493
|
saved: Object.values(e.getLayout().regions).flatMap((d) => d.widgets),
|
|
@@ -3523,7 +3498,7 @@ const vr = () => {
|
|
|
3523
3498
|
for (const i of t.values()) l(i);
|
|
3524
3499
|
Ce(t, a);
|
|
3525
3500
|
});
|
|
3526
|
-
const c = (i, d, u, p,
|
|
3501
|
+
const c = (i, d, u, p, y) => {
|
|
3527
3502
|
const f = e.getPanel(Oe(i.id));
|
|
3528
3503
|
if (!f) throw new Error(`Workbench shell placement is not registered: ${i.id}`);
|
|
3529
3504
|
return {
|
|
@@ -3537,10 +3512,10 @@ const vr = () => {
|
|
|
3537
3512
|
...u ? {
|
|
3538
3513
|
resource: u
|
|
3539
3514
|
} : {},
|
|
3540
|
-
...
|
|
3541
|
-
title:
|
|
3515
|
+
...y ? {
|
|
3516
|
+
title: y
|
|
3542
3517
|
} : {},
|
|
3543
|
-
...
|
|
3518
|
+
...Oo(p)
|
|
3544
3519
|
})
|
|
3545
3520
|
};
|
|
3546
3521
|
}, g = {
|
|
@@ -3552,19 +3527,19 @@ const vr = () => {
|
|
|
3552
3527
|
getState: () => r,
|
|
3553
3528
|
restore(i, d = r, u) {
|
|
3554
3529
|
if (!e.resolveScope) return d;
|
|
3555
|
-
const p = e.resolveScope(i),
|
|
3556
|
-
if (p ===
|
|
3530
|
+
const p = e.resolveScope(i), y = u ? e.resolveScope(u) : e.getScope?.();
|
|
3531
|
+
if (p === y) return d;
|
|
3557
3532
|
if (p === e.getScope?.()) return r;
|
|
3558
3533
|
const f = e.loadLayout?.(i);
|
|
3559
|
-
return f ?
|
|
3560
|
-
state:
|
|
3534
|
+
return f ? re({
|
|
3535
|
+
state: X(),
|
|
3561
3536
|
declarations: [...t.values()],
|
|
3562
3537
|
saved: Object.values(f.regions).flatMap((v) => v.widgets),
|
|
3563
3538
|
owns: (v) => v.kind === "shell"
|
|
3564
|
-
}) :
|
|
3539
|
+
}) : X();
|
|
3565
3540
|
},
|
|
3566
3541
|
adopt(i, d, u = r) {
|
|
3567
|
-
return
|
|
3542
|
+
return re({
|
|
3568
3543
|
state: u,
|
|
3569
3544
|
declarations: [...t.values()],
|
|
3570
3545
|
saved: d,
|
|
@@ -3574,7 +3549,7 @@ const vr = () => {
|
|
|
3574
3549
|
open(i, d = r) {
|
|
3575
3550
|
const u = t.get(i.placementId);
|
|
3576
3551
|
if (!u) throw new Error(`Unknown shell placement: ${i.placementId}`);
|
|
3577
|
-
return
|
|
3552
|
+
return Vt({
|
|
3578
3553
|
label: o,
|
|
3579
3554
|
target: i,
|
|
3580
3555
|
item: u.item,
|
|
@@ -3587,20 +3562,20 @@ const vr = () => {
|
|
|
3587
3562
|
},
|
|
3588
3563
|
publish: a,
|
|
3589
3564
|
resolve(i, d = r) {
|
|
3590
|
-
return [...t.values()].flatMap((u) => u.item.kind === "view" ?
|
|
3565
|
+
return [...t.values()].flatMap((u) => u.item.kind === "view" ? Ot(u.item, d, u.id) ? [c(u, "default")] : [] : (d.resourceInstances.get(u.id) ?? []).map((p) => c(u, p.instanceKey, p.resource, p.open, p.title)));
|
|
3591
3566
|
}
|
|
3592
3567
|
}, m = {
|
|
3593
3568
|
registerPlacement(i) {
|
|
3594
3569
|
if (t.has(i.id)) throw new Error(`Shell placement already registered: ${i.id}`);
|
|
3595
3570
|
if (!e.views.getView(A(i.item)))
|
|
3596
3571
|
throw new Error(`Workbench shell placement view is not registered: ${A(i.item)}`);
|
|
3597
|
-
|
|
3572
|
+
Tt(o, i.id, i.item);
|
|
3598
3573
|
const d = {
|
|
3599
3574
|
...i,
|
|
3600
3575
|
item: {
|
|
3601
3576
|
...i.item
|
|
3602
3577
|
}
|
|
3603
|
-
}, u =
|
|
3578
|
+
}, u = he(e.registerPanel, e.views, {
|
|
3604
3579
|
...d,
|
|
3605
3580
|
id: Oe(d.id),
|
|
3606
3581
|
viewId: A(d.item),
|
|
@@ -3609,7 +3584,7 @@ const vr = () => {
|
|
|
3609
3584
|
closable: ue(d.item)
|
|
3610
3585
|
}, e.viewMenus);
|
|
3611
3586
|
return t.set(d.id, d), e.enteredWithPersistedLayout() && l(d), a(), R(() => {
|
|
3612
|
-
t.get(d.id) === d && (t.delete(d.id),
|
|
3587
|
+
t.get(d.id) === d && (t.delete(d.id), $e(r, d.id), u.dispose(), a());
|
|
3613
3588
|
});
|
|
3614
3589
|
},
|
|
3615
3590
|
getPlacement: (i) => t.get(i),
|
|
@@ -3622,7 +3597,7 @@ const vr = () => {
|
|
|
3622
3597
|
if (i.kind !== "shell") throw new Error("Shell placement registry closes only shell-owned placements");
|
|
3623
3598
|
const d = t.get(i.placementId);
|
|
3624
3599
|
if (!d) return;
|
|
3625
|
-
|
|
3600
|
+
jt({
|
|
3626
3601
|
label: o,
|
|
3627
3602
|
id: d.id,
|
|
3628
3603
|
item: d.item,
|
|
@@ -3633,7 +3608,7 @@ const vr = () => {
|
|
|
3633
3608
|
updatePlacement(i, d) {
|
|
3634
3609
|
if (i.kind !== "shell") throw new Error("Shell placement registry updates only shell-owned placements");
|
|
3635
3610
|
const u = t.get(i.placementId);
|
|
3636
|
-
u && (
|
|
3611
|
+
u && (Bt({
|
|
3637
3612
|
label: o,
|
|
3638
3613
|
id: u.id,
|
|
3639
3614
|
item: u.item,
|
|
@@ -3647,8 +3622,8 @@ const vr = () => {
|
|
|
3647
3622
|
return n.add(i), R(() => n.delete(i));
|
|
3648
3623
|
}
|
|
3649
3624
|
};
|
|
3650
|
-
return
|
|
3651
|
-
}, dt = (e, t) => `${e}:${t.scope}:${t.scopeId ?? ""}`,
|
|
3625
|
+
return At(m, g), m;
|
|
3626
|
+
}, dt = (e, t) => `${e}:${t.scope}:${t.scopeId ?? ""}`, jo = () => {
|
|
3652
3627
|
const e = /* @__PURE__ */ new Map();
|
|
3653
3628
|
return {
|
|
3654
3629
|
getValue(t, r) {
|
|
@@ -3658,13 +3633,13 @@ const vr = () => {
|
|
|
3658
3633
|
e.set(dt(t, n), r);
|
|
3659
3634
|
}
|
|
3660
3635
|
};
|
|
3661
|
-
},
|
|
3662
|
-
const t =
|
|
3636
|
+
}, Bo = (e = {}) => {
|
|
3637
|
+
const t = W({
|
|
3663
3638
|
name: "workbench.preferences",
|
|
3664
3639
|
initialState: {
|
|
3665
3640
|
schemas: {}
|
|
3666
3641
|
}
|
|
3667
|
-
}), r = e.persistence ??
|
|
3642
|
+
}), r = e.persistence ?? jo();
|
|
3668
3643
|
return {
|
|
3669
3644
|
store: t,
|
|
3670
3645
|
registerSchema(n, o) {
|
|
@@ -3713,10 +3688,10 @@ const vr = () => {
|
|
|
3713
3688
|
return s !== void 0 ? s : t.getState().schemas[n]?.default;
|
|
3714
3689
|
}
|
|
3715
3690
|
};
|
|
3716
|
-
},
|
|
3691
|
+
}, Do = (e) => {
|
|
3717
3692
|
const {
|
|
3718
3693
|
rendererRegistry: t
|
|
3719
|
-
} = e, r =
|
|
3694
|
+
} = e, r = W({
|
|
3720
3695
|
name: "workbench.controlsRenderers",
|
|
3721
3696
|
initialState: {
|
|
3722
3697
|
renderers: {}
|
|
@@ -3738,7 +3713,7 @@ const vr = () => {
|
|
|
3738
3713
|
if (c.renderers[a.id])
|
|
3739
3714
|
throw new Error(`Controls renderer already registered: ${a.id}`);
|
|
3740
3715
|
const g = {
|
|
3741
|
-
...
|
|
3716
|
+
...x(l),
|
|
3742
3717
|
...a
|
|
3743
3718
|
};
|
|
3744
3719
|
r.setState({
|
|
@@ -3772,7 +3747,7 @@ const vr = () => {
|
|
|
3772
3747
|
return r.getState().renderers[a];
|
|
3773
3748
|
},
|
|
3774
3749
|
listControlsRenderers() {
|
|
3775
|
-
return Object.values(r.getState().renderers).sort(
|
|
3750
|
+
return Object.values(r.getState().renderers).sort(B);
|
|
3776
3751
|
},
|
|
3777
3752
|
refreshControlsRenderer(a) {
|
|
3778
3753
|
s(a);
|
|
@@ -3787,8 +3762,8 @@ const vr = () => {
|
|
|
3787
3762
|
});
|
|
3788
3763
|
}
|
|
3789
3764
|
};
|
|
3790
|
-
},
|
|
3791
|
-
const t =
|
|
3765
|
+
}, Ao = (e) => {
|
|
3766
|
+
const t = W({
|
|
3792
3767
|
name: "workbench.dataTableRenderers",
|
|
3793
3768
|
initialState: {
|
|
3794
3769
|
renderers: {}
|
|
@@ -3805,7 +3780,7 @@ const vr = () => {
|
|
|
3805
3780
|
if (a.renderers[o.id])
|
|
3806
3781
|
throw new Error(`Data table renderer already registered: ${o.id}`);
|
|
3807
3782
|
const l = {
|
|
3808
|
-
...
|
|
3783
|
+
...x(s),
|
|
3809
3784
|
...o
|
|
3810
3785
|
};
|
|
3811
3786
|
t.setState({
|
|
@@ -3838,7 +3813,7 @@ const vr = () => {
|
|
|
3838
3813
|
return t.getState().renderers[o];
|
|
3839
3814
|
},
|
|
3840
3815
|
listDataTableRenderers() {
|
|
3841
|
-
return Object.values(t.getState().renderers).sort(
|
|
3816
|
+
return Object.values(t.getState().renderers).sort(B);
|
|
3842
3817
|
},
|
|
3843
3818
|
refreshDataTableRenderer(o) {
|
|
3844
3819
|
if (!t.getState().renderers[o]) throw new Error(`Data table renderer not registered: ${o}`);
|
|
@@ -3851,10 +3826,10 @@ const vr = () => {
|
|
|
3851
3826
|
return r.add(o), R(() => r.delete(o));
|
|
3852
3827
|
}
|
|
3853
3828
|
};
|
|
3854
|
-
},
|
|
3829
|
+
}, Vo = (e) => {
|
|
3855
3830
|
const {
|
|
3856
3831
|
rendererRegistry: t
|
|
3857
|
-
} = e, r =
|
|
3832
|
+
} = e, r = W({
|
|
3858
3833
|
name: "workbench.fileRenderers",
|
|
3859
3834
|
initialState: {
|
|
3860
3835
|
renderers: {}
|
|
@@ -3875,7 +3850,7 @@ const vr = () => {
|
|
|
3875
3850
|
const c = r.getState();
|
|
3876
3851
|
if (c.renderers[a.id]) throw new Error(`File renderer already registered: ${a.id}`);
|
|
3877
3852
|
const g = {
|
|
3878
|
-
...
|
|
3853
|
+
...x(l),
|
|
3879
3854
|
...a
|
|
3880
3855
|
};
|
|
3881
3856
|
r.setState({
|
|
@@ -3909,7 +3884,7 @@ const vr = () => {
|
|
|
3909
3884
|
return r.getState().renderers[a];
|
|
3910
3885
|
},
|
|
3911
3886
|
listFileRenderers() {
|
|
3912
|
-
return Object.values(r.getState().renderers).sort(
|
|
3887
|
+
return Object.values(r.getState().renderers).sort(B);
|
|
3913
3888
|
},
|
|
3914
3889
|
refreshFileRenderer(a, l = {}) {
|
|
3915
3890
|
s(a);
|
|
@@ -3925,10 +3900,10 @@ const vr = () => {
|
|
|
3925
3900
|
});
|
|
3926
3901
|
}
|
|
3927
3902
|
};
|
|
3928
|
-
},
|
|
3903
|
+
}, Fo = (e) => {
|
|
3929
3904
|
const {
|
|
3930
3905
|
rendererRegistry: t
|
|
3931
|
-
} = e, r =
|
|
3906
|
+
} = e, r = W({
|
|
3932
3907
|
name: "workbench.kanbanRenderers",
|
|
3933
3908
|
initialState: {
|
|
3934
3909
|
renderers: {}
|
|
@@ -3949,7 +3924,7 @@ const vr = () => {
|
|
|
3949
3924
|
const c = r.getState();
|
|
3950
3925
|
if (c.renderers[a.id]) throw new Error(`Kanban renderer already registered: ${a.id}`);
|
|
3951
3926
|
const g = {
|
|
3952
|
-
...
|
|
3927
|
+
...x(l),
|
|
3953
3928
|
...a
|
|
3954
3929
|
};
|
|
3955
3930
|
r.setState({
|
|
@@ -3983,7 +3958,7 @@ const vr = () => {
|
|
|
3983
3958
|
return r.getState().renderers[a];
|
|
3984
3959
|
},
|
|
3985
3960
|
listKanbanRenderers() {
|
|
3986
|
-
return Object.values(r.getState().renderers).sort(
|
|
3961
|
+
return Object.values(r.getState().renderers).sort(B);
|
|
3987
3962
|
},
|
|
3988
3963
|
refreshKanbanRenderer(a) {
|
|
3989
3964
|
s(a);
|
|
@@ -3998,8 +3973,8 @@ const vr = () => {
|
|
|
3998
3973
|
});
|
|
3999
3974
|
}
|
|
4000
3975
|
};
|
|
4001
|
-
},
|
|
4002
|
-
const t =
|
|
3976
|
+
}, No = (e = {}) => {
|
|
3977
|
+
const t = W({
|
|
4003
3978
|
name: "workbench.renderers",
|
|
4004
3979
|
initialState: {
|
|
4005
3980
|
renderers: {},
|
|
@@ -4054,17 +4029,17 @@ const vr = () => {
|
|
|
4054
4029
|
}, lt = (e) => ({
|
|
4055
4030
|
expandedNodeIds: [...e.defaultExpandedNodeIds ?? []],
|
|
4056
4031
|
expandedSectionIds: [...e.defaultExpandedSectionIds ?? []]
|
|
4057
|
-
}),
|
|
4032
|
+
}), zo = (e, t) => {
|
|
4058
4033
|
const r = (t.defaultExpandedSectionIds ?? []).filter((n) => !e.expandedSectionIds.includes(n));
|
|
4059
4034
|
return r.length === 0 ? e : {
|
|
4060
4035
|
...e,
|
|
4061
4036
|
expandedSectionIds: [...e.expandedSectionIds, ...r]
|
|
4062
4037
|
};
|
|
4063
|
-
}, gt = (e, t, r) => r ? e.includes(t) ? e : [...e, t] : e.includes(t) ? e.filter((n) => n !== t) : e,
|
|
4038
|
+
}, gt = (e, t, r) => r ? e.includes(t) ? e : [...e, t] : e.includes(t) ? e.filter((n) => n !== t) : e, qo = (e) => {
|
|
4064
4039
|
const {
|
|
4065
4040
|
rendererRegistry: t,
|
|
4066
4041
|
persistence: r
|
|
4067
|
-
} = e, n = r?.getTreeStates(), o =
|
|
4042
|
+
} = e, n = r?.getTreeStates(), o = W({
|
|
4068
4043
|
name: "workbench.treeRenderers",
|
|
4069
4044
|
initialState: {
|
|
4070
4045
|
trees: {},
|
|
@@ -4080,9 +4055,9 @@ const vr = () => {
|
|
|
4080
4055
|
}, c = (d) => {
|
|
4081
4056
|
const u = o.getState(), p = u.statesByTreeId[d];
|
|
4082
4057
|
if (p) return p;
|
|
4083
|
-
const
|
|
4084
|
-
if (!
|
|
4085
|
-
const f = lt(
|
|
4058
|
+
const y = u.trees[d];
|
|
4059
|
+
if (!y) throw new Error(`Tree renderer not registered: ${d}`);
|
|
4060
|
+
const f = lt(y);
|
|
4086
4061
|
return o.setState({
|
|
4087
4062
|
...u,
|
|
4088
4063
|
statesByTreeId: {
|
|
@@ -4095,7 +4070,7 @@ const vr = () => {
|
|
|
4095
4070
|
const d = {};
|
|
4096
4071
|
for (const [u, p] of Object.entries(o.getState().statesByTreeId)) {
|
|
4097
4072
|
const {
|
|
4098
|
-
loading:
|
|
4073
|
+
loading: y,
|
|
4099
4074
|
...f
|
|
4100
4075
|
} = p;
|
|
4101
4076
|
d[u] = f;
|
|
@@ -4104,8 +4079,8 @@ const vr = () => {
|
|
|
4104
4079
|
statesByTreeId: d
|
|
4105
4080
|
});
|
|
4106
4081
|
}, m = (d, u, p) => {
|
|
4107
|
-
const
|
|
4108
|
-
if (f ===
|
|
4082
|
+
const y = c(d), f = u(y);
|
|
4083
|
+
if (f === y) return;
|
|
4109
4084
|
const v = o.getState();
|
|
4110
4085
|
o.setState({
|
|
4111
4086
|
...v,
|
|
@@ -4122,15 +4097,15 @@ const vr = () => {
|
|
|
4122
4097
|
registerTreeRenderer(d, u) {
|
|
4123
4098
|
const p = o.getState();
|
|
4124
4099
|
if (p.trees[d.id]) throw new Error(`Tree renderer already registered: ${d.id}`);
|
|
4125
|
-
const
|
|
4126
|
-
...
|
|
4100
|
+
const y = {
|
|
4101
|
+
...x(u),
|
|
4127
4102
|
...d
|
|
4128
|
-
}, f = p.statesByTreeId[d.id], v = f ?
|
|
4103
|
+
}, f = p.statesByTreeId[d.id], v = f ? zo(f, d) : lt(d);
|
|
4129
4104
|
o.setState({
|
|
4130
4105
|
...p,
|
|
4131
4106
|
trees: {
|
|
4132
4107
|
...p.trees,
|
|
4133
|
-
[d.id]:
|
|
4108
|
+
[d.id]: y
|
|
4134
4109
|
},
|
|
4135
4110
|
statesByTreeId: {
|
|
4136
4111
|
...p.statesByTreeId,
|
|
@@ -4147,10 +4122,10 @@ const vr = () => {
|
|
|
4147
4122
|
return R(() => {
|
|
4148
4123
|
S.dispose();
|
|
4149
4124
|
const k = o.getState();
|
|
4150
|
-
if (k.trees[d.id] !==
|
|
4125
|
+
if (k.trees[d.id] !== y) return;
|
|
4151
4126
|
const {
|
|
4152
|
-
[d.id]:
|
|
4153
|
-
...
|
|
4127
|
+
[d.id]: w,
|
|
4128
|
+
...h
|
|
4154
4129
|
} = k.trees, {
|
|
4155
4130
|
[d.id]: I,
|
|
4156
4131
|
...b
|
|
@@ -4159,7 +4134,7 @@ const vr = () => {
|
|
|
4159
4134
|
...M
|
|
4160
4135
|
} = k.refreshKeysByTreeId;
|
|
4161
4136
|
o.setState({
|
|
4162
|
-
trees:
|
|
4137
|
+
trees: h,
|
|
4163
4138
|
statesByTreeId: b,
|
|
4164
4139
|
refreshKeysByTreeId: M
|
|
4165
4140
|
}, !1, "unregisterTreeRenderer"), g();
|
|
@@ -4169,7 +4144,7 @@ const vr = () => {
|
|
|
4169
4144
|
return o.getState().trees[d];
|
|
4170
4145
|
},
|
|
4171
4146
|
listTreeRenderers() {
|
|
4172
|
-
return Object.values(o.getState().trees).sort(
|
|
4147
|
+
return Object.values(o.getState().trees).sort(B);
|
|
4173
4148
|
},
|
|
4174
4149
|
async getBody(d, u = {}) {
|
|
4175
4150
|
return await l(d).getBody({
|
|
@@ -4185,7 +4160,7 @@ const vr = () => {
|
|
|
4185
4160
|
...u,
|
|
4186
4161
|
state: i.getTreeState(d),
|
|
4187
4162
|
refresh: () => i.refresh(d),
|
|
4188
|
-
setSelectedNode: (
|
|
4163
|
+
setSelectedNode: (y) => i.setSelectedNode(d, y)
|
|
4189
4164
|
}) : [];
|
|
4190
4165
|
},
|
|
4191
4166
|
async getFooter(d, u = {}) {
|
|
@@ -4194,7 +4169,7 @@ const vr = () => {
|
|
|
4194
4169
|
...u,
|
|
4195
4170
|
state: i.getTreeState(d),
|
|
4196
4171
|
refresh: () => i.refresh(d),
|
|
4197
|
-
setSelectedNode: (
|
|
4172
|
+
setSelectedNode: (y) => i.setSelectedNode(d, y)
|
|
4198
4173
|
}) : [];
|
|
4199
4174
|
},
|
|
4200
4175
|
async getChildren(d, u, p = {}) {
|
|
@@ -4202,7 +4177,7 @@ const vr = () => {
|
|
|
4202
4177
|
...p,
|
|
4203
4178
|
state: i.getTreeState(d),
|
|
4204
4179
|
refresh: () => i.refresh(d),
|
|
4205
|
-
setSelectedNode: (
|
|
4180
|
+
setSelectedNode: (y) => i.setSelectedNode(d, y)
|
|
4206
4181
|
});
|
|
4207
4182
|
},
|
|
4208
4183
|
getTreeState(d) {
|
|
@@ -4215,19 +4190,19 @@ const vr = () => {
|
|
|
4215
4190
|
};
|
|
4216
4191
|
},
|
|
4217
4192
|
setNodeExpanded(d, u, p) {
|
|
4218
|
-
l(d), m(d, (
|
|
4219
|
-
const f = gt(
|
|
4220
|
-
return f ===
|
|
4221
|
-
...
|
|
4193
|
+
l(d), m(d, (y) => {
|
|
4194
|
+
const f = gt(y.expandedNodeIds, u, p);
|
|
4195
|
+
return f === y.expandedNodeIds ? y : {
|
|
4196
|
+
...y,
|
|
4222
4197
|
expandedNodeIds: f
|
|
4223
4198
|
};
|
|
4224
4199
|
}, "setNodeExpanded");
|
|
4225
4200
|
},
|
|
4226
4201
|
setSectionExpanded(d, u, p) {
|
|
4227
|
-
l(d), m(d, (
|
|
4228
|
-
const f = gt(
|
|
4229
|
-
return f ===
|
|
4230
|
-
...
|
|
4202
|
+
l(d), m(d, (y) => {
|
|
4203
|
+
const f = gt(y.expandedSectionIds, u, p);
|
|
4204
|
+
return f === y.expandedSectionIds ? y : {
|
|
4205
|
+
...y,
|
|
4231
4206
|
expandedSectionIds: f
|
|
4232
4207
|
};
|
|
4233
4208
|
}, "setSectionExpanded");
|
|
@@ -4242,11 +4217,11 @@ const vr = () => {
|
|
|
4242
4217
|
l(d);
|
|
4243
4218
|
const p = c(d);
|
|
4244
4219
|
if (p.loading === u) return;
|
|
4245
|
-
const
|
|
4220
|
+
const y = o.getState();
|
|
4246
4221
|
o.setState({
|
|
4247
|
-
...
|
|
4222
|
+
...y,
|
|
4248
4223
|
statesByTreeId: {
|
|
4249
|
-
...
|
|
4224
|
+
...y.statesByTreeId,
|
|
4250
4225
|
[d]: {
|
|
4251
4226
|
...p,
|
|
4252
4227
|
loading: u
|
|
@@ -4264,10 +4239,10 @@ const vr = () => {
|
|
|
4264
4239
|
[d]: p + 1
|
|
4265
4240
|
}
|
|
4266
4241
|
}, !1, "refreshTreeRenderer");
|
|
4267
|
-
const
|
|
4242
|
+
const y = {
|
|
4268
4243
|
treeId: d
|
|
4269
4244
|
};
|
|
4270
|
-
for (const f of s) f(
|
|
4245
|
+
for (const f of s) f(y);
|
|
4271
4246
|
},
|
|
4272
4247
|
onDidRefresh(d) {
|
|
4273
4248
|
return s.add(d), R(() => {
|
|
@@ -4276,8 +4251,8 @@ const vr = () => {
|
|
|
4276
4251
|
}
|
|
4277
4252
|
};
|
|
4278
4253
|
return i;
|
|
4279
|
-
}, ut = (e, t) => (e.order ?? 0) - (t.order ?? 0) ||
|
|
4280
|
-
const t =
|
|
4254
|
+
}, ut = (e, t) => (e.order ?? 0) - (t.order ?? 0) || B(e, t), _o = (e = {}) => {
|
|
4255
|
+
const t = W({
|
|
4281
4256
|
name: "workbench.settings",
|
|
4282
4257
|
initialState: {
|
|
4283
4258
|
sections: {},
|
|
@@ -4299,7 +4274,7 @@ const vr = () => {
|
|
|
4299
4274
|
const a = t.getState();
|
|
4300
4275
|
if (a.sections[o.id]) throw new Error(`Settings section already registered: ${o.id}`);
|
|
4301
4276
|
const l = {
|
|
4302
|
-
...
|
|
4277
|
+
...x(s),
|
|
4303
4278
|
...o
|
|
4304
4279
|
};
|
|
4305
4280
|
return t.setState({
|
|
@@ -4327,7 +4302,7 @@ const vr = () => {
|
|
|
4327
4302
|
if (o.kind !== "schema" && e.hasView && !e.hasView(o.viewId))
|
|
4328
4303
|
throw new Error(`Settings panel View is not registered: ${o.viewId}`);
|
|
4329
4304
|
const l = {
|
|
4330
|
-
...
|
|
4305
|
+
...x(s),
|
|
4331
4306
|
...o
|
|
4332
4307
|
};
|
|
4333
4308
|
return t.setState({
|
|
@@ -4371,13 +4346,13 @@ const vr = () => {
|
|
|
4371
4346
|
},
|
|
4372
4347
|
getCollectionItem: (o, s) => r.get(n(o, s))
|
|
4373
4348
|
};
|
|
4374
|
-
},
|
|
4375
|
-
const t =
|
|
4349
|
+
}, Uo = (e, t) => e.slot.localeCompare(t.slot) || (e.order ?? 0) - (t.order ?? 0) || e.id.localeCompare(t.id), Ho = (e) => {
|
|
4350
|
+
const t = W({
|
|
4376
4351
|
name: "workbench.statusBar",
|
|
4377
4352
|
initialState: {
|
|
4378
4353
|
items: {}
|
|
4379
4354
|
}
|
|
4380
|
-
}), r = () => Object.values(t.getState().items).sort(
|
|
4355
|
+
}), r = () => Object.values(t.getState().items).sort(Uo);
|
|
4381
4356
|
return {
|
|
4382
4357
|
store: t,
|
|
4383
4358
|
registerItem(n) {
|
|
@@ -4411,7 +4386,7 @@ const vr = () => {
|
|
|
4411
4386
|
return r().filter((o) => (!n || o.slot === n) && (o.isVisible?.() ?? !0));
|
|
4412
4387
|
}
|
|
4413
4388
|
};
|
|
4414
|
-
},
|
|
4389
|
+
}, Qo = (e, t, r) => {
|
|
4415
4390
|
for (const n of t.actions ?? [])
|
|
4416
4391
|
if (!r.has(n))
|
|
4417
4392
|
throw new Error(`Status "${e.id}.${t.id}" references unknown action "${n}"`);
|
|
@@ -4424,12 +4399,12 @@ const vr = () => {
|
|
|
4424
4399
|
if (r.add(s.id), !s.label.trim()) throw new Error(`Status "${e.id}.${s.id}" must have a label`);
|
|
4425
4400
|
if (!s.color.trim()) throw new Error(`Status "${e.id}.${s.id}" must have a color`);
|
|
4426
4401
|
if (!Number.isFinite(s.sortOrder)) throw new Error(`Status "${e.id}.${s.id}" must have a finite order`);
|
|
4427
|
-
|
|
4402
|
+
Qo(e, s, n), s.isDefault && (o += 1);
|
|
4428
4403
|
}
|
|
4429
4404
|
if (o > 1) throw new Error(`Status set "${e.id}" has more than one default status`);
|
|
4430
4405
|
return [...t].sort((s, a) => s.sortOrder - a.sortOrder || s.id.localeCompare(a.id));
|
|
4431
|
-
},
|
|
4432
|
-
const e =
|
|
4406
|
+
}, Jo = () => {
|
|
4407
|
+
const e = W({
|
|
4433
4408
|
name: "workbench.statuses",
|
|
4434
4409
|
initialState: {
|
|
4435
4410
|
statusSets: {},
|
|
@@ -4455,7 +4430,7 @@ const vr = () => {
|
|
|
4455
4430
|
const a = e.getState();
|
|
4456
4431
|
if (a.statusSets[o.id]) throw new Error(`Status set already registered: ${o.id}`);
|
|
4457
4432
|
const l = {
|
|
4458
|
-
...
|
|
4433
|
+
...x(s),
|
|
4459
4434
|
...o
|
|
4460
4435
|
};
|
|
4461
4436
|
return e.setState({
|
|
@@ -4485,7 +4460,7 @@ const vr = () => {
|
|
|
4485
4460
|
return e.getState().statusSets[o];
|
|
4486
4461
|
},
|
|
4487
4462
|
listStatusSets() {
|
|
4488
|
-
return Object.values(e.getState().statusSets).sort((o, s) =>
|
|
4463
|
+
return Object.values(e.getState().statusSets).sort((o, s) => B(o, s) || o.id.localeCompare(s.id));
|
|
4489
4464
|
},
|
|
4490
4465
|
getStatuses(o) {
|
|
4491
4466
|
return e.getState().values[o];
|
|
@@ -4514,8 +4489,8 @@ const vr = () => {
|
|
|
4514
4489
|
}, !1, "saveStatuses"), c;
|
|
4515
4490
|
}
|
|
4516
4491
|
};
|
|
4517
|
-
},
|
|
4518
|
-
const e =
|
|
4492
|
+
}, Go = () => {
|
|
4493
|
+
const e = W({
|
|
4519
4494
|
name: "workbench.fileIconThemes",
|
|
4520
4495
|
initialState: {
|
|
4521
4496
|
themes: []
|
|
@@ -4536,8 +4511,8 @@ const vr = () => {
|
|
|
4536
4511
|
return e.getState().themes;
|
|
4537
4512
|
}
|
|
4538
4513
|
};
|
|
4539
|
-
},
|
|
4540
|
-
const e =
|
|
4514
|
+
}, Yo = () => {
|
|
4515
|
+
const e = W({
|
|
4541
4516
|
name: "workbench.themes",
|
|
4542
4517
|
initialState: {
|
|
4543
4518
|
themes: []
|
|
@@ -4558,7 +4533,7 @@ const vr = () => {
|
|
|
4558
4533
|
return e.getState().themes;
|
|
4559
4534
|
}
|
|
4560
4535
|
};
|
|
4561
|
-
},
|
|
4536
|
+
}, Xo = (e, t) => `workbench.view-menu.${encodeURIComponent(e)}.${encodeURIComponent(t)}`, Zo = (e) => e.config === void 0 ? {
|
|
4562
4537
|
viewContextId: e.id
|
|
4563
4538
|
} : !e.config || typeof e.config != "object" || Array.isArray(e.config) ? {
|
|
4564
4539
|
viewContextId: e.id,
|
|
@@ -4566,7 +4541,7 @@ const vr = () => {
|
|
|
4566
4541
|
} : {
|
|
4567
4542
|
...e.config,
|
|
4568
4543
|
viewContextId: e.id
|
|
4569
|
-
},
|
|
4544
|
+
}, es = (e) => {
|
|
4570
4545
|
const t = /* @__PURE__ */ new Map();
|
|
4571
4546
|
return {
|
|
4572
4547
|
registerViewMenu(r) {
|
|
@@ -4588,7 +4563,7 @@ const vr = () => {
|
|
|
4588
4563
|
const s = e.views.getView(o.viewId);
|
|
4589
4564
|
if (!s) throw new Error(`View menu View is not registered: ${o.viewId}`);
|
|
4590
4565
|
return {
|
|
4591
|
-
id:
|
|
4566
|
+
id: Xo(n, o.id),
|
|
4592
4567
|
title: s.title,
|
|
4593
4568
|
icon: s.icon,
|
|
4594
4569
|
side: o.side,
|
|
@@ -4599,13 +4574,13 @@ const vr = () => {
|
|
|
4599
4574
|
regionSize: o.regionSize,
|
|
4600
4575
|
regionCollapsible: o.regionCollapsible,
|
|
4601
4576
|
headerBorderBottom: o.headerBorderBottom,
|
|
4602
|
-
config:
|
|
4577
|
+
config: Zo(o)
|
|
4603
4578
|
};
|
|
4604
4579
|
});
|
|
4605
4580
|
}
|
|
4606
4581
|
};
|
|
4607
|
-
}, mt = "workbench.view.id",
|
|
4608
|
-
const t =
|
|
4582
|
+
}, mt = "workbench.view.id", ts = (e, t) => t.priority - e.priority || e.id.localeCompare(t.id), rs = (e) => {
|
|
4583
|
+
const t = W({
|
|
4609
4584
|
name: "workbench.views",
|
|
4610
4585
|
initialState: {
|
|
4611
4586
|
views: {}
|
|
@@ -4620,7 +4595,7 @@ const vr = () => {
|
|
|
4620
4595
|
r.set(n.id, a);
|
|
4621
4596
|
const l = {
|
|
4622
4597
|
...n,
|
|
4623
|
-
...
|
|
4598
|
+
...x(o)
|
|
4624
4599
|
};
|
|
4625
4600
|
return t.setState({
|
|
4626
4601
|
views: {
|
|
@@ -4643,15 +4618,15 @@ const vr = () => {
|
|
|
4643
4618
|
return t.getState().views[n];
|
|
4644
4619
|
},
|
|
4645
4620
|
listViews() {
|
|
4646
|
-
return Object.values(t.getState().views).sort(
|
|
4621
|
+
return Object.values(t.getState().views).sort(ts);
|
|
4647
4622
|
},
|
|
4648
4623
|
refreshView(n, o) {
|
|
4649
4624
|
if (!t.getState().views[n]) throw new Error(`View is not registered: ${n}`);
|
|
4650
4625
|
r.get(n)?.refresh?.(o);
|
|
4651
4626
|
}
|
|
4652
4627
|
};
|
|
4653
|
-
},
|
|
4654
|
-
const r = e(), n =
|
|
4628
|
+
}, ns = (e) => (t) => {
|
|
4629
|
+
const r = e(), n = E(t), o = Object.values(r.layout.getLayout().regions).flatMap((s) => s.widgets).find((s) => s.placementIdentity && E(s.placementIdentity) === n);
|
|
4655
4630
|
if (!o) throw new Error(`Placement is not open: ${n}`);
|
|
4656
4631
|
if (!o.closable) throw new Error(`Placement is fixed and cannot close: ${n}`);
|
|
4657
4632
|
if (t.kind === "page") {
|
|
@@ -4660,15 +4635,15 @@ const vr = () => {
|
|
|
4660
4635
|
return;
|
|
4661
4636
|
}
|
|
4662
4637
|
t.kind === "mode" ? r.modePlacements.closePlacement(t) : r.shellPlacements.closePlacement(t);
|
|
4663
|
-
},
|
|
4664
|
-
const r = e(), n =
|
|
4638
|
+
}, os = (e) => (t) => {
|
|
4639
|
+
const r = e(), n = E(t), o = Object.values(r.layout.getLayout().regions).flatMap((s) => s.widgets).find((s) => s.placementIdentity && E(s.placementIdentity) === n);
|
|
4665
4640
|
if (!o) throw new Error(`Placement is not open: ${n}`);
|
|
4666
4641
|
o.tabRetention === "preview" && (t.kind === "page" ? r.pages.pinPlacement(t) : t.kind === "mode" ? r.modePlacements.updatePlacement(t, {
|
|
4667
4642
|
open: "pin"
|
|
4668
4643
|
}) : r.shellPlacements.updatePlacement(t, {
|
|
4669
4644
|
open: "pin"
|
|
4670
4645
|
}));
|
|
4671
|
-
}, ft = (e) => `${e.extensionId ?? ""}:${e.id}`,
|
|
4646
|
+
}, ft = (e) => `${e.extensionId ?? ""}:${e.id}`, qt = (e) => e.parent ? [...qt(e.parent), e] : [e], _t = (e) => ({
|
|
4672
4647
|
kind: "page",
|
|
4673
4648
|
page: e.page,
|
|
4674
4649
|
...e.resource ? {
|
|
@@ -4678,21 +4653,21 @@ const vr = () => {
|
|
|
4678
4653
|
section: e.section
|
|
4679
4654
|
} : {},
|
|
4680
4655
|
...e.parent ? {
|
|
4681
|
-
parent:
|
|
4656
|
+
parent: _t(e.parent)
|
|
4682
4657
|
} : {}
|
|
4683
|
-
}),
|
|
4684
|
-
const t = new Map(e.pages.map((n) => [ft(n.ref), n])), r =
|
|
4658
|
+
}), ss = (e) => e.title === void 0 ? e.ref.id : pr(e.title) ? e.title.default ?? e.title.$l10n : e.title, as = (e) => {
|
|
4659
|
+
const t = new Map(e.pages.map((n) => [ft(n.ref), n])), r = qt(e.location);
|
|
4685
4660
|
return r.map((n, o) => {
|
|
4686
4661
|
const s = t.get(ft(n.page)), a = {
|
|
4687
|
-
title: n.resource?.label ?? (s ?
|
|
4662
|
+
title: n.resource?.label ?? (s ? ss(s) : n.page.id),
|
|
4688
4663
|
icon: s?.icon,
|
|
4689
4664
|
...n.resource ? {
|
|
4690
4665
|
resource: e.resources.normalize(n.resource)
|
|
4691
4666
|
} : {}
|
|
4692
4667
|
};
|
|
4693
|
-
return o < r.length - 1 && (a.onClick = () => e.navigate(
|
|
4668
|
+
return o < r.length - 1 && (a.onClick = () => e.navigate(_t(n))), a;
|
|
4694
4669
|
});
|
|
4695
|
-
},
|
|
4670
|
+
}, is = (e) => e.breadcrumbs.setItems(as(e)), cs = (e) => {
|
|
4696
4671
|
let t;
|
|
4697
4672
|
const r = () => {
|
|
4698
4673
|
const o = e.pages.store.getState();
|
|
@@ -4700,7 +4675,7 @@ const vr = () => {
|
|
|
4700
4675
|
t?.dispose(), t = void 0;
|
|
4701
4676
|
return;
|
|
4702
4677
|
}
|
|
4703
|
-
t?.dispose(), t =
|
|
4678
|
+
t?.dispose(), t = is({
|
|
4704
4679
|
breadcrumbs: e.breadcrumbs,
|
|
4705
4680
|
location: o.location,
|
|
4706
4681
|
pages: Object.values(o.pages),
|
|
@@ -4709,11 +4684,11 @@ const vr = () => {
|
|
|
4709
4684
|
e.locations.navigate(s);
|
|
4710
4685
|
}
|
|
4711
4686
|
});
|
|
4712
|
-
}, n =
|
|
4687
|
+
}, n = Z(e.pages).onDidCommit(r);
|
|
4713
4688
|
return r(), R(() => {
|
|
4714
4689
|
n.dispose(), t?.dispose();
|
|
4715
4690
|
});
|
|
4716
|
-
},
|
|
4691
|
+
}, ds = () => {
|
|
4717
4692
|
const e = [{
|
|
4718
4693
|
url: "/"
|
|
4719
4694
|
}];
|
|
@@ -4739,18 +4714,18 @@ const vr = () => {
|
|
|
4739
4714
|
dispose: () => r.delete(o)
|
|
4740
4715
|
})
|
|
4741
4716
|
};
|
|
4742
|
-
},
|
|
4717
|
+
}, ls = () => {
|
|
4743
4718
|
const e = /* @__PURE__ */ new Map();
|
|
4744
4719
|
return {
|
|
4745
4720
|
load: (t) => e.get(t),
|
|
4746
4721
|
save: (t, r) => e.set(t, r)
|
|
4747
4722
|
};
|
|
4748
|
-
},
|
|
4723
|
+
}, gs = (e) => e.value.role === "sub-panel" && (e.identity.kind === "page" || !!e.value.resourceKey), Ut = (e) => {
|
|
4749
4724
|
const t = /* @__PURE__ */ new Map();
|
|
4750
4725
|
for (const r of Object.values(e.regions))
|
|
4751
4726
|
for (const n of r.widgets) {
|
|
4752
4727
|
if (!n.placementIdentity) continue;
|
|
4753
|
-
const o =
|
|
4728
|
+
const o = E(n.placementIdentity);
|
|
4754
4729
|
if (t.has(o)) throw new Error(`Duplicate rendered placement identity: ${o}`);
|
|
4755
4730
|
t.set(o, {
|
|
4756
4731
|
region: r.id,
|
|
@@ -4758,44 +4733,44 @@ const vr = () => {
|
|
|
4758
4733
|
});
|
|
4759
4734
|
}
|
|
4760
4735
|
return t;
|
|
4761
|
-
},
|
|
4736
|
+
}, us = (e) => {
|
|
4762
4737
|
if (e.desired.identity.kind !== "mode") return;
|
|
4763
4738
|
const t = e.desired.identity;
|
|
4764
4739
|
return [...e.current.entries()].find(([r, n]) => !e.desiredKeys.has(r) && !e.transferredCurrentKeys.has(r) && n.placement.placementIdentity?.kind === "mode" && (n.placement.placementIdentity.modeId !== t.modeId || n.placement.placementIdentity.placementId !== t.placementId) && n.region === e.desired.region && n.placement.contributionId === e.desired.value.contributionId && n.placement.viewId === e.desired.value.viewId);
|
|
4765
|
-
},
|
|
4740
|
+
}, ms = (e) => {
|
|
4766
4741
|
const t = /* @__PURE__ */ new Map();
|
|
4767
4742
|
for (const r of Object.values(e.regions))
|
|
4768
4743
|
for (const n of r.widgets) {
|
|
4769
4744
|
if (t.has(n.widgetId)) throw new Error(`Duplicate rendered widget ID: ${n.widgetId}`);
|
|
4770
|
-
t.set(n.widgetId, n.placementIdentity ?
|
|
4745
|
+
t.set(n.widgetId, n.placementIdentity ? E(n.placementIdentity) : null);
|
|
4771
4746
|
}
|
|
4772
4747
|
return t;
|
|
4773
|
-
},
|
|
4748
|
+
}, fs = (e, t, r) => {
|
|
4774
4749
|
const n = new Set(e.map((o) => o.widgetId));
|
|
4775
|
-
return [...e, ...t.filter((o) => !n.has(o.widgetId) && o.placementIdentity && r.has(
|
|
4776
|
-
},
|
|
4777
|
-
const r = [], n = /* @__PURE__ */ new Set(), o =
|
|
4750
|
+
return [...e, ...t.filter((o) => !n.has(o.widgetId) && o.placementIdentity && r.has(E(o.placementIdentity)))];
|
|
4751
|
+
}, ps = (e, t) => {
|
|
4752
|
+
const r = [], n = /* @__PURE__ */ new Set(), o = ms(e.layout), s = /* @__PURE__ */ new Set(), a = ae({
|
|
4778
4753
|
shell: e.placements.filter((g) => g.identity.kind === "shell"),
|
|
4779
4754
|
mode: e.placements.filter((g) => g.identity.kind === "mode"),
|
|
4780
4755
|
page: e.placements.filter((g) => g.identity.kind === "page")
|
|
4781
|
-
}).placements, l = new Set(a.map((g) =>
|
|
4756
|
+
}).placements, l = new Set(a.map((g) => E(g.identity))), c = /* @__PURE__ */ new Set();
|
|
4782
4757
|
for (const g of a) {
|
|
4783
|
-
const m =
|
|
4758
|
+
const m = E(g.identity);
|
|
4784
4759
|
if (n.has(m)) throw new Error(`Duplicate desired placement identity: ${m}`);
|
|
4785
4760
|
n.add(m);
|
|
4786
|
-
const i = t.get(m), d = i ? void 0 :
|
|
4761
|
+
const i = t.get(m), d = i ? void 0 : us({
|
|
4787
4762
|
current: t,
|
|
4788
4763
|
desired: g,
|
|
4789
4764
|
desiredKeys: l,
|
|
4790
4765
|
transferredCurrentKeys: c
|
|
4791
4766
|
}), u = d?.[0];
|
|
4792
4767
|
u && c.add(u);
|
|
4793
|
-
const p = i?.placement.widgetId ?? d?.[1].placement.widgetId ?? g.value.widgetId,
|
|
4794
|
-
if (
|
|
4768
|
+
const p = i?.placement.widgetId ?? d?.[1].placement.widgetId ?? g.value.widgetId, y = o.get(p);
|
|
4769
|
+
if (y !== void 0 && y !== m && y !== u)
|
|
4795
4770
|
throw new Error(`Rendered widget ID belongs to another placement: ${p}`);
|
|
4796
4771
|
if (s.has(p)) throw new Error(`Duplicate desired widget ID: ${p}`);
|
|
4797
4772
|
s.add(p);
|
|
4798
|
-
const f =
|
|
4773
|
+
const f = gs(g) ? g.value.ownerResourceKey ?? i?.placement.ownerResourceKey ?? d?.[1].placement.ownerResourceKey : g.value.ownerResourceKey;
|
|
4799
4774
|
r.push({
|
|
4800
4775
|
identity: g.identity,
|
|
4801
4776
|
region: g.region,
|
|
@@ -4813,28 +4788,28 @@ const vr = () => {
|
|
|
4813
4788
|
});
|
|
4814
4789
|
}
|
|
4815
4790
|
return r;
|
|
4816
|
-
},
|
|
4817
|
-
const o = new Set(
|
|
4791
|
+
}, ys = (e, t, r, n) => {
|
|
4792
|
+
const o = new Set(yr), s = {
|
|
4818
4793
|
...e.regions
|
|
4819
|
-
}, a = new Map(t.map((c) => [
|
|
4820
|
-
for (const c of
|
|
4821
|
-
const g = e.regions[c], m = t.some((f) => f.region === c && f.identity.kind === "page" && f.placement.role === "location"), i = /* @__PURE__ */ new Set(), u =
|
|
4794
|
+
}, a = new Map(t.map((c) => [E(c.identity), c])), l = new Set(t.flatMap((c) => c.transferredFromKey ?? []));
|
|
4795
|
+
for (const c of H) {
|
|
4796
|
+
const g = e.regions[c], m = t.some((f) => f.region === c && f.identity.kind === "page" && f.placement.role === "location"), i = /* @__PURE__ */ new Set(), u = fs(g.widgets, n?.regions[c].widgets ?? [], a).flatMap((f) => {
|
|
4822
4797
|
if (!f.placementIdentity)
|
|
4823
4798
|
return c === "main" && m && f.role === "location" ? [] : [f];
|
|
4824
|
-
const v =
|
|
4799
|
+
const v = E(f.placementIdentity), S = a.get(v);
|
|
4825
4800
|
return S ? S.region !== c ? [] : (i.add(v), [S.placement]) : r.has(v) || l.has(v) ? [] : [f];
|
|
4826
4801
|
});
|
|
4827
4802
|
for (const f of t) {
|
|
4828
|
-
const v =
|
|
4803
|
+
const v = E(f.identity);
|
|
4829
4804
|
f.region === c && !i.has(v) && u.push(f.placement);
|
|
4830
4805
|
}
|
|
4831
|
-
const p = [g.activeWidgetId, n?.regions[c].activeWidgetId].find((f) => u.some((v) => v.widgetId === f)) ?? u[0]?.widgetId,
|
|
4806
|
+
const p = [g.activeWidgetId, n?.regions[c].activeWidgetId].find((f) => u.some((v) => v.widgetId === f)) ?? u[0]?.widgetId, y = g.widgets.length === 0 && u.some((f) => !f.hiddenByDefault);
|
|
4832
4807
|
s[c] = {
|
|
4833
4808
|
...g,
|
|
4834
4809
|
widgets: u,
|
|
4835
4810
|
activeWidgetId: p,
|
|
4836
4811
|
...o.has(c) ? {
|
|
4837
|
-
visible: g.visible ||
|
|
4812
|
+
visible: g.visible || y
|
|
4838
4813
|
} : {}
|
|
4839
4814
|
};
|
|
4840
4815
|
}
|
|
@@ -4842,7 +4817,7 @@ const vr = () => {
|
|
|
4842
4817
|
...e,
|
|
4843
4818
|
regions: s
|
|
4844
4819
|
};
|
|
4845
|
-
},
|
|
4820
|
+
}, hs = (e) => {
|
|
4846
4821
|
const t = new Set(e.desired.flatMap((c) => c.transferredFromKey ?? []));
|
|
4847
4822
|
let r = e.layout;
|
|
4848
4823
|
for (const [c, g] of e.current)
|
|
@@ -4854,14 +4829,14 @@ const vr = () => {
|
|
|
4854
4829
|
activeLocationWidgetId: s,
|
|
4855
4830
|
activeResourceKey: a?.resourceKey ?? l?.resourceKey
|
|
4856
4831
|
};
|
|
4857
|
-
},
|
|
4832
|
+
}, ws = (e, t) => {
|
|
4858
4833
|
const r = oe(e)?.resourceKey;
|
|
4859
4834
|
if (!r) return e;
|
|
4860
|
-
const n = new Map(t.map((s) => [
|
|
4835
|
+
const n = new Map(t.map((s) => [E(s.identity), s])), o = Object.fromEntries(Object.entries(e.regions).map(([s, a]) => [s, {
|
|
4861
4836
|
...a,
|
|
4862
4837
|
widgets: a.widgets.map((l) => {
|
|
4863
4838
|
if (l.role !== "sub-panel" || !l.placementIdentity) return l;
|
|
4864
|
-
const c = n.get(
|
|
4839
|
+
const c = n.get(E(l.placementIdentity));
|
|
4865
4840
|
return !c || c.identity.kind !== "page" && !c.placement.resourceKey ? l : {
|
|
4866
4841
|
...l,
|
|
4867
4842
|
ownerResourceKey: r
|
|
@@ -4872,27 +4847,27 @@ const vr = () => {
|
|
|
4872
4847
|
...e,
|
|
4873
4848
|
regions: o
|
|
4874
4849
|
};
|
|
4875
|
-
},
|
|
4850
|
+
}, Ht = (e, t) => {
|
|
4876
4851
|
if (e.placements.length === 0 && t.size === 0 && (e.activate?.length ?? 0) === 0)
|
|
4877
4852
|
return e.layout;
|
|
4878
|
-
const r =
|
|
4879
|
-
let o =
|
|
4853
|
+
const r = Ut(e.layout), n = ps(e, r);
|
|
4854
|
+
let o = hs({
|
|
4880
4855
|
current: r,
|
|
4881
4856
|
desired: n,
|
|
4882
4857
|
removedKeys: t,
|
|
4883
|
-
layout:
|
|
4858
|
+
layout: ys(e.layout, n, t, e.modeLayout)
|
|
4884
4859
|
});
|
|
4885
|
-
const s = new Map(n.map((a) => [
|
|
4860
|
+
const s = new Map(n.map((a) => [E(a.identity), a]));
|
|
4886
4861
|
for (const a of e.activate ?? []) {
|
|
4887
|
-
const l = s.get(
|
|
4888
|
-
if (!l) throw new Error(`Cannot activate missing rendered placement: ${
|
|
4889
|
-
o =
|
|
4862
|
+
const l = s.get(E(a));
|
|
4863
|
+
if (!l) throw new Error(`Cannot activate missing rendered placement: ${E(a)}`);
|
|
4864
|
+
o = It(o, l.region, l.placement);
|
|
4890
4865
|
}
|
|
4891
|
-
return
|
|
4892
|
-
},
|
|
4893
|
-
const t = new Set(e.placements.map((o) =>
|
|
4894
|
-
return
|
|
4895
|
-
},
|
|
4866
|
+
return ws(o, n);
|
|
4867
|
+
}, vs = (e) => {
|
|
4868
|
+
const t = new Set(e.placements.map((o) => E(o.identity))), r = Ut(e.layout), n = new Set([...r.keys()].filter((o) => !t.has(o)));
|
|
4869
|
+
return Ht(e, n);
|
|
4870
|
+
}, Ss = (e) => Ht(e, new Set(e.remove.map(E))), Is = (e) => {
|
|
4896
4871
|
const t = Object.values(e.getLayout().regions).flatMap((r) => r.widgets).filter((r) => !!r.placementIdentity);
|
|
4897
4872
|
for (const r of t) {
|
|
4898
4873
|
const n = e.getWidget(r.contributionId);
|
|
@@ -4908,8 +4883,8 @@ const vr = () => {
|
|
|
4908
4883
|
}
|
|
4909
4884
|
}
|
|
4910
4885
|
e.reconcilePanelMenus();
|
|
4911
|
-
},
|
|
4912
|
-
const t =
|
|
4886
|
+
}, bs = (e) => {
|
|
4887
|
+
const t = T(e.location?.resource);
|
|
4913
4888
|
return t ? e.placements.map((r) => r.value.role === "sub-panel" && (r.identity.kind === "page" || r.value.resourceKey) ? {
|
|
4914
4889
|
...r,
|
|
4915
4890
|
value: {
|
|
@@ -4919,24 +4894,24 @@ const vr = () => {
|
|
|
4919
4894
|
} : r) : e.placements;
|
|
4920
4895
|
}, pt = (e, t, r, n = e.registry.store.getState()) => {
|
|
4921
4896
|
const o = e.layout.getPersistenceScope();
|
|
4922
|
-
|
|
4897
|
+
rn(e.modes, t.activeModeId, () => {
|
|
4923
4898
|
r === "transition" && e.beforeApply?.(t);
|
|
4924
4899
|
const s = e.registry.store.getState(), a = s === n ? t : s, l = a.reconciliation.activate.length > 0 ? a.reconciliation.activate : t.reconciliation.activate, c = {
|
|
4925
4900
|
layout: e.layout.getLayout(),
|
|
4926
4901
|
modeLayout: a.activeModeId ? e.loadModeLayout?.(a.projectId, a.activeModeId) : void 0,
|
|
4927
|
-
placements:
|
|
4902
|
+
placements: bs(a),
|
|
4928
4903
|
activate: l.map((m) => m.identity)
|
|
4929
4904
|
};
|
|
4930
4905
|
let g;
|
|
4931
|
-
if (r === "scope-restore" || e.layout.getPersistenceScope() !== o ? g =
|
|
4906
|
+
if (r === "scope-restore" || e.layout.getPersistenceScope() !== o ? g = vs(c) : g = Ss({
|
|
4932
4907
|
...c,
|
|
4933
4908
|
remove: a.reconciliation.remove.map((m) => m.identity)
|
|
4934
|
-
}), e.layout.restoreLayout(g),
|
|
4909
|
+
}), e.layout.restoreLayout(g), Is(e.layout), r === "transition")
|
|
4935
4910
|
for (const m of l) e.revealRegion?.(m.region);
|
|
4936
4911
|
});
|
|
4937
|
-
},
|
|
4912
|
+
}, Ps = (e) => {
|
|
4938
4913
|
let t = !1;
|
|
4939
|
-
const r =
|
|
4914
|
+
const r = Z(e.registry).connectRuntime((o) => {
|
|
4940
4915
|
const s = e.registry.store.getState();
|
|
4941
4916
|
t = !0;
|
|
4942
4917
|
try {
|
|
@@ -4950,19 +4925,19 @@ const vr = () => {
|
|
|
4950
4925
|
return R(() => {
|
|
4951
4926
|
n.dispose(), r.dispose();
|
|
4952
4927
|
});
|
|
4953
|
-
},
|
|
4928
|
+
}, ks = (e) => e ? e === "pin" ? {
|
|
4954
4929
|
pinned: !0,
|
|
4955
4930
|
tabRetention: "persistent"
|
|
4956
4931
|
} : {
|
|
4957
4932
|
pinned: !1,
|
|
4958
4933
|
tabRetention: "preview"
|
|
4959
|
-
} : {},
|
|
4934
|
+
} : {}, Rs = (e, t, r) => {
|
|
4960
4935
|
const n = e.resource, o = r.getView(e.viewId);
|
|
4961
4936
|
if (!o) throw new Error(`Workbench page view is not registered: ${e.viewId}`);
|
|
4962
4937
|
const s = Be(e.pageId, e.slotId), a = t.getWidget(s);
|
|
4963
4938
|
if (!a) throw new Error(`Workbench page placement is not registered: ${e.pageId}.${e.slotId}`);
|
|
4964
4939
|
return {
|
|
4965
|
-
...pe(`workbench.page.${encodeURIComponent(
|
|
4940
|
+
...pe(`workbench.page.${encodeURIComponent(E(e.identity))}`, a, {
|
|
4966
4941
|
viewId: e.viewId,
|
|
4967
4942
|
title: n?.label ?? o.title ?? a.title,
|
|
4968
4943
|
role: e.role === "primary" ? "location" : "sub-panel",
|
|
@@ -4970,14 +4945,14 @@ const vr = () => {
|
|
|
4970
4945
|
...n ? {
|
|
4971
4946
|
resource: n
|
|
4972
4947
|
} : {},
|
|
4973
|
-
...
|
|
4948
|
+
...ks(e.open)
|
|
4974
4949
|
}),
|
|
4975
4950
|
...e.section ? {
|
|
4976
4951
|
section: e.section
|
|
4977
4952
|
} : {}
|
|
4978
4953
|
};
|
|
4979
|
-
},
|
|
4980
|
-
const t = e.resources ??
|
|
4954
|
+
}, Ms = (e) => {
|
|
4955
|
+
const t = e.resources ?? Pt, r = Ko({
|
|
4981
4956
|
restorePageState: e.restorePageState,
|
|
4982
4957
|
validateMode: (n) => {
|
|
4983
4958
|
if (!e.modes.getMode(n)) throw new Error(`Workbench mode not registered: ${n}`);
|
|
@@ -4989,15 +4964,15 @@ const vr = () => {
|
|
|
4989
4964
|
projectId: s,
|
|
4990
4965
|
pageId: a
|
|
4991
4966
|
} : void 0),
|
|
4992
|
-
resolvePagePlacement: (n) =>
|
|
4967
|
+
resolvePagePlacement: (n) => Rs(n, e.layout, e.views),
|
|
4993
4968
|
resources: t,
|
|
4994
4969
|
valuesEqual: (n, o) => JSON.stringify(n) === JSON.stringify(o),
|
|
4995
4970
|
registerPagePlacements: (n) => {
|
|
4996
|
-
const o =
|
|
4971
|
+
const o = go(n).map((s) => {
|
|
4997
4972
|
const a = ie(s.item.kind === "view" ? s.item.view : s.item.binding.view);
|
|
4998
4973
|
if (!a) throw new Error(`Workbench page slot view is not registered: ${n.id}.${s.id}`);
|
|
4999
4974
|
const l = s.item.kind === "binding" || s.item.presence !== "fixed";
|
|
5000
|
-
return
|
|
4975
|
+
return he(e.layout, e.views, {
|
|
5001
4976
|
...s,
|
|
5002
4977
|
id: Be(n.id, s.id),
|
|
5003
4978
|
viewId: a,
|
|
@@ -5011,7 +4986,7 @@ const vr = () => {
|
|
|
5011
4986
|
});
|
|
5012
4987
|
}
|
|
5013
4988
|
});
|
|
5014
|
-
return
|
|
4989
|
+
return Ps({
|
|
5015
4990
|
loadModeLayout: e.loadModeLayout,
|
|
5016
4991
|
beforeApply: (n) => {
|
|
5017
4992
|
e.beforeApply?.(n);
|
|
@@ -5021,7 +4996,7 @@ const vr = () => {
|
|
|
5021
4996
|
placementIdentity: a.identity
|
|
5022
4997
|
}))));
|
|
5023
4998
|
const s = N(e.modePlacements);
|
|
5024
|
-
n.projectId !== r.store.getState().projectId && s.apply(
|
|
4999
|
+
n.projectId !== r.store.getState().projectId && s.apply(X()), n.activeModeId && s.apply(s.adopt(n.activeModeId, n.placements.map((a) => ({
|
|
5025
5000
|
...a.value,
|
|
5026
5001
|
placementIdentity: a.identity
|
|
5027
5002
|
}))));
|
|
@@ -5030,8 +5005,8 @@ const vr = () => {
|
|
|
5030
5005
|
layout: e.layout,
|
|
5031
5006
|
modes: e.modes,
|
|
5032
5007
|
registry: r
|
|
5033
|
-
}), N(e.modePlacements).connectRuntime(() =>
|
|
5034
|
-
},
|
|
5008
|
+
}), N(e.modePlacements).connectRuntime(() => Z(r).refreshModePlacements()), N(e.shellPlacements).connectRuntime(() => Z(r).refreshShellPlacements()), r;
|
|
5009
|
+
}, Cs = (e, t) => {
|
|
5035
5010
|
const r = Object.values(t.regions).flatMap((a) => a.widgets), n = [], o = {};
|
|
5036
5011
|
let s;
|
|
5037
5012
|
for (const a of ve(e)) {
|
|
@@ -5060,23 +5035,23 @@ const vr = () => {
|
|
|
5060
5035
|
resourceInstances: o,
|
|
5061
5036
|
activePrimaryInstanceKey: s
|
|
5062
5037
|
};
|
|
5063
|
-
},
|
|
5038
|
+
}, Qt = (e, t) => {
|
|
5064
5039
|
const r = e.resolvePagePersistenceScope?.(t).scope;
|
|
5065
5040
|
return e.persistence?.getSnapshot(r)?.layout ?? e.layoutPersistence?.getLayout(r);
|
|
5066
|
-
},
|
|
5067
|
-
const o =
|
|
5041
|
+
}, Es = (e) => (t, r, n) => {
|
|
5042
|
+
const o = Qt(e, {
|
|
5068
5043
|
modeId: t.modeId,
|
|
5069
5044
|
pageId: t.id,
|
|
5070
5045
|
projectId: n,
|
|
5071
5046
|
resource: r.resource
|
|
5072
5047
|
});
|
|
5073
5048
|
if (!(!o || !Object.values(o.regions).some((s) => s.widgets.some((a) => a.placementIdentity?.kind === "page" && a.placementIdentity.pageId === t.id))))
|
|
5074
|
-
return
|
|
5075
|
-
},
|
|
5049
|
+
return Cs(t, o);
|
|
5050
|
+
}, yt = (e, t) => {
|
|
5076
5051
|
const r = {
|
|
5077
5052
|
...e.regions
|
|
5078
5053
|
};
|
|
5079
|
-
for (const n of
|
|
5054
|
+
for (const n of H) {
|
|
5080
5055
|
const o = e.regions[n], s = o.widgets.filter(t);
|
|
5081
5056
|
r[n] = {
|
|
5082
5057
|
...o,
|
|
@@ -5088,7 +5063,7 @@ const vr = () => {
|
|
|
5088
5063
|
...e,
|
|
5089
5064
|
regions: r
|
|
5090
5065
|
};
|
|
5091
|
-
},
|
|
5066
|
+
}, ht = (e, t) => `workbench-mode:${JSON.stringify([e ?? null, t])}`, Ws = (e) => {
|
|
5092
5067
|
const t = e.persistence ? {
|
|
5093
5068
|
getLayout: (o) => e.persistence?.getSnapshot(o)?.layout,
|
|
5094
5069
|
setLayout: (o, s) => e.persistence?.setSnapshot({
|
|
@@ -5101,12 +5076,12 @@ const vr = () => {
|
|
|
5101
5076
|
layout: t ? {
|
|
5102
5077
|
...t,
|
|
5103
5078
|
getLayout: r,
|
|
5104
|
-
setLayout: (o, s) => n(
|
|
5079
|
+
setLayout: (o, s) => n(yt(o, (a) => a.placementIdentity?.kind !== "mode"), s)
|
|
5105
5080
|
} : void 0,
|
|
5106
|
-
readMode: (o, s) => r(
|
|
5107
|
-
saveMode: (o, s, a) => n(
|
|
5081
|
+
readMode: (o, s) => r(ht(o, s)),
|
|
5082
|
+
saveMode: (o, s, a) => n(yt(a, (l) => l.placementIdentity?.kind === "mode" && l.placementIdentity.modeId === s), ht(o, s))
|
|
5108
5083
|
};
|
|
5109
|
-
},
|
|
5084
|
+
}, $s = (e) => ({
|
|
5110
5085
|
getRegionState(t) {
|
|
5111
5086
|
const r = e.layout.getLayout().regions[t];
|
|
5112
5087
|
return {
|
|
@@ -5132,13 +5107,13 @@ const vr = () => {
|
|
|
5132
5107
|
r(), n.dispose();
|
|
5133
5108
|
});
|
|
5134
5109
|
}
|
|
5135
|
-
}),
|
|
5110
|
+
}), G = (e, t) => ({
|
|
5136
5111
|
dispose: () => e.dispose(),
|
|
5137
5112
|
refresh: t
|
|
5138
|
-
}),
|
|
5113
|
+
}), Ls = (e) => (t, r) => {
|
|
5139
5114
|
const n = t.body;
|
|
5140
5115
|
if (n.kind === "react")
|
|
5141
|
-
return
|
|
5116
|
+
return G(e.registerRenderer({
|
|
5142
5117
|
id: t.id,
|
|
5143
5118
|
render: n.render
|
|
5144
5119
|
}), () => e.refreshRenderer(t.id));
|
|
@@ -5147,7 +5122,7 @@ const vr = () => {
|
|
|
5147
5122
|
kind: a,
|
|
5148
5123
|
...l
|
|
5149
5124
|
} = n;
|
|
5150
|
-
return
|
|
5125
|
+
return G(e.registerTreeRenderer({
|
|
5151
5126
|
...l,
|
|
5152
5127
|
id: t.id,
|
|
5153
5128
|
title: t.title,
|
|
@@ -5159,7 +5134,7 @@ const vr = () => {
|
|
|
5159
5134
|
kind: a,
|
|
5160
5135
|
...l
|
|
5161
5136
|
} = n;
|
|
5162
|
-
return
|
|
5137
|
+
return G(e.registerFileRenderer({
|
|
5163
5138
|
...l,
|
|
5164
5139
|
id: t.id,
|
|
5165
5140
|
title: t.title
|
|
@@ -5170,7 +5145,7 @@ const vr = () => {
|
|
|
5170
5145
|
kind: a,
|
|
5171
5146
|
...l
|
|
5172
5147
|
} = n;
|
|
5173
|
-
return
|
|
5148
|
+
return G(e.registerControlsRenderer({
|
|
5174
5149
|
...l,
|
|
5175
5150
|
id: t.id,
|
|
5176
5151
|
title: t.title
|
|
@@ -5181,7 +5156,7 @@ const vr = () => {
|
|
|
5181
5156
|
kind: a,
|
|
5182
5157
|
...l
|
|
5183
5158
|
} = n;
|
|
5184
|
-
return
|
|
5159
|
+
return G(e.registerKanbanRenderer({
|
|
5185
5160
|
...l,
|
|
5186
5161
|
id: t.id,
|
|
5187
5162
|
title: t.title
|
|
@@ -5191,13 +5166,13 @@ const vr = () => {
|
|
|
5191
5166
|
kind: o,
|
|
5192
5167
|
...s
|
|
5193
5168
|
} = n;
|
|
5194
|
-
return
|
|
5169
|
+
return G(e.registerDataTableRenderer({
|
|
5195
5170
|
...s,
|
|
5196
5171
|
id: t.id,
|
|
5197
5172
|
title: t.title
|
|
5198
5173
|
}, r), () => e.refreshDataTableRenderer(t.id));
|
|
5199
5174
|
}, Ve = (e, t) => Object.values(e.regions).some((r) => r.widgets.some((n) => n.placementIdentity && t(n.placementIdentity))), Fe = (e, t) => {
|
|
5200
|
-
const r = Object.values(e.layout.getLayout().regions).flatMap((n) => n.widgets).find((n) => n.placementIdentity &&
|
|
5175
|
+
const r = Object.values(e.layout.getLayout().regions).flatMap((n) => n.widgets).find((n) => n.placementIdentity && E(n.placementIdentity) === E(t));
|
|
5201
5176
|
r && e.layout.activatePanel(r.widgetId);
|
|
5202
5177
|
}, Ne = (e, t) => {
|
|
5203
5178
|
if (t.kind === "command") {
|
|
@@ -5214,7 +5189,7 @@ const vr = () => {
|
|
|
5214
5189
|
if (n.kind !== "command") return !0;
|
|
5215
5190
|
const o = ie(n.target.command);
|
|
5216
5191
|
return !!(e.commands.getCommand(o) && e.commands.isCommandVisible(o, n.target.params) && e.commands.isCommandEnabled(o, n.target.params));
|
|
5217
|
-
},
|
|
5192
|
+
}, Ks = (e, t, r) => {
|
|
5218
5193
|
for (const n of e.shellPlacements.listPlacements()) {
|
|
5219
5194
|
if (n.region !== t.region || n.item.kind === "view" && n.item.presence === "fixed") continue;
|
|
5220
5195
|
const o = n.item.kind === "binding" && n.item.binding.cardinality === "many", s = Ve(t.layout, (a) => a.kind === "shell" && a.placementId === n.id);
|
|
@@ -5232,7 +5207,7 @@ const vr = () => {
|
|
|
5232
5207
|
});
|
|
5233
5208
|
});
|
|
5234
5209
|
}
|
|
5235
|
-
},
|
|
5210
|
+
}, xs = (e, t, r) => {
|
|
5236
5211
|
for (const n of e.modePlacements.listPlacements(t.modeId)) {
|
|
5237
5212
|
if (n.region !== t.region || n.item.kind === "view" && n.item.presence === "fixed") continue;
|
|
5238
5213
|
const o = n.item.kind === "binding" && n.item.binding.cardinality === "many", s = Ve(t.layout, (a) => a.kind === "mode" && a.placementId === n.id);
|
|
@@ -5251,7 +5226,7 @@ const vr = () => {
|
|
|
5251
5226
|
Fe(e, l);
|
|
5252
5227
|
});
|
|
5253
5228
|
}
|
|
5254
|
-
},
|
|
5229
|
+
}, Os = (e, t, r) => {
|
|
5255
5230
|
const n = e.pages.store.getState(), o = n.activePageId ? e.pages.getPage(n.activePageId) : void 0;
|
|
5256
5231
|
if (o)
|
|
5257
5232
|
for (const s of o.slots) {
|
|
@@ -5274,7 +5249,7 @@ const vr = () => {
|
|
|
5274
5249
|
});
|
|
5275
5250
|
});
|
|
5276
5251
|
}
|
|
5277
|
-
},
|
|
5252
|
+
}, Ts = (e, t) => {
|
|
5278
5253
|
const r = [], n = (o, s) => {
|
|
5279
5254
|
const a = e.layout.getWidget(o);
|
|
5280
5255
|
a && r.push({
|
|
@@ -5284,8 +5259,8 @@ const vr = () => {
|
|
|
5284
5259
|
open: s
|
|
5285
5260
|
});
|
|
5286
5261
|
};
|
|
5287
|
-
return
|
|
5288
|
-
},
|
|
5262
|
+
return Ks(e, t, n), xs(e, t, n), Os(e, t, n), r;
|
|
5263
|
+
}, js = (e) => (t) => e.listProviders().some((n) => n.kind === t.type) ? e.listResources("").some((n) => T(n.resource) === T(t)) : !0, Bs = ({
|
|
5289
5264
|
layout: e,
|
|
5290
5265
|
isInScope: t
|
|
5291
5266
|
}) => {
|
|
@@ -5295,9 +5270,9 @@ const vr = () => {
|
|
|
5295
5270
|
}), o = e.onDidChangePersistenceScope(() => {
|
|
5296
5271
|
r = !1;
|
|
5297
5272
|
}), s = e.store.subscribe((a, l) => {
|
|
5298
|
-
const c =
|
|
5299
|
-
if (!(
|
|
5300
|
-
for (const m of
|
|
5273
|
+
const c = Y(a.layout.regions[Je("primary")])?.resource, g = Y(l.layout.regions[Je("primary")])?.resourceKey;
|
|
5274
|
+
if (!(T(c) === g || r)) {
|
|
5275
|
+
for (const m of cr({
|
|
5301
5276
|
layout: l.layout,
|
|
5302
5277
|
primary: c,
|
|
5303
5278
|
isInScope: t
|
|
@@ -5310,9 +5285,9 @@ const vr = () => {
|
|
|
5310
5285
|
return R(() => {
|
|
5311
5286
|
s(), n.dispose(), o.dispose();
|
|
5312
5287
|
});
|
|
5313
|
-
},
|
|
5288
|
+
}, Ds = "sidenav", As = (e, t) => {
|
|
5314
5289
|
e.shell.setRegionOpen(t, !e.shell.getRegionState(t).open);
|
|
5315
|
-
},
|
|
5290
|
+
}, Vs = [{
|
|
5316
5291
|
id: "workbench.toggleCommandPalette",
|
|
5317
5292
|
label: "Toggle Command Palette",
|
|
5318
5293
|
icon: "Command",
|
|
@@ -5355,9 +5330,9 @@ const vr = () => {
|
|
|
5355
5330
|
label: "Toggle Sidenav",
|
|
5356
5331
|
icon: "PanelLeft",
|
|
5357
5332
|
keybinding: "Mod+B",
|
|
5358
|
-
execute: (e) =>
|
|
5359
|
-
}],
|
|
5360
|
-
for (const t of
|
|
5333
|
+
execute: (e) => As(e, Ds)
|
|
5334
|
+
}], Fs = (e) => {
|
|
5335
|
+
for (const t of Vs)
|
|
5361
5336
|
e.commands.registerCommand({
|
|
5362
5337
|
id: t.id,
|
|
5363
5338
|
label: t.label,
|
|
@@ -5373,11 +5348,11 @@ const vr = () => {
|
|
|
5373
5348
|
},
|
|
5374
5349
|
keybinding: t.keybinding,
|
|
5375
5350
|
when: "!inputFocus"
|
|
5376
|
-
}), e.layout.registerMenuItem(
|
|
5351
|
+
}), e.layout.registerMenuItem(wr, {
|
|
5377
5352
|
commandId: t.id,
|
|
5378
5353
|
group: "Workbench"
|
|
5379
5354
|
});
|
|
5380
|
-
},
|
|
5355
|
+
}, Ns = (e) => an({
|
|
5381
5356
|
getActiveMode: () => {
|
|
5382
5357
|
const t = e(), r = t.modes.getActiveModeId();
|
|
5383
5358
|
return r ? t.modes.getMode(r) : void 0;
|
|
@@ -5392,14 +5367,14 @@ const vr = () => {
|
|
|
5392
5367
|
resource: o
|
|
5393
5368
|
}) => {
|
|
5394
5369
|
const s = e();
|
|
5395
|
-
return
|
|
5370
|
+
return Ts(s, {
|
|
5396
5371
|
layout: t,
|
|
5397
5372
|
modeId: r?.id,
|
|
5398
5373
|
region: n,
|
|
5399
5374
|
resource: o
|
|
5400
5375
|
});
|
|
5401
5376
|
}
|
|
5402
|
-
}),
|
|
5377
|
+
}), zs = (e, t) => {
|
|
5403
5378
|
e.layout.store.subscribe((r) => {
|
|
5404
5379
|
const n = e.focus.getActiveRegion();
|
|
5405
5380
|
n && !r.layout.regions[n].visible && e.focus.clearFocus();
|
|
@@ -5411,27 +5386,27 @@ const vr = () => {
|
|
|
5411
5386
|
r ? e.context.set(mt, r) : e.context.delete(mt);
|
|
5412
5387
|
}, {
|
|
5413
5388
|
fireImmediately: !0
|
|
5414
|
-
}),
|
|
5389
|
+
}), Bs({
|
|
5415
5390
|
layout: e.layout,
|
|
5416
|
-
isInScope: t.isInScope ??
|
|
5417
|
-
}),
|
|
5418
|
-
},
|
|
5391
|
+
isInScope: t.isInScope ?? js(e.resources)
|
|
5392
|
+
}), Fs(e);
|
|
5393
|
+
}, qs = (e) => {
|
|
5419
5394
|
const t = e.layout.getLayout().activeWidgetId;
|
|
5420
5395
|
if (t)
|
|
5421
5396
|
for (const r of Object.values(e.layout.getLayout().regions)) {
|
|
5422
5397
|
const n = r.widgets.find((o) => o.widgetId === t);
|
|
5423
5398
|
if (n) return n.resource;
|
|
5424
5399
|
}
|
|
5425
|
-
},
|
|
5400
|
+
}, _s = (e) => e.pages.store.getState().location?.resource, Us = (e) => e.activeModeId ? {
|
|
5426
5401
|
modeId: e.activeModeId,
|
|
5427
5402
|
pageId: e.activePageId,
|
|
5428
5403
|
projectId: e.projectId,
|
|
5429
5404
|
location: e.location
|
|
5430
|
-
} : void 0,
|
|
5405
|
+
} : void 0, Hs = (e, t) => {
|
|
5431
5406
|
const r = Object.values(e.pages).find((n) => n.ref.extensionId === t.page.extensionId && n.ref.id === t.page.id);
|
|
5432
5407
|
if (!r || r.id !== e.activePageId) throw new Error(`Page panel "${t.id}" is not owned by the proposed page`);
|
|
5433
5408
|
return r;
|
|
5434
|
-
},
|
|
5409
|
+
}, Qs = (e, t, r, n, o) => {
|
|
5435
5410
|
const s = t.panel;
|
|
5436
5411
|
if (s.kind === "placement") {
|
|
5437
5412
|
const l = e.modePlacements.getPlacement(s);
|
|
@@ -5460,9 +5435,9 @@ const vr = () => {
|
|
|
5460
5435
|
shellState: a.state,
|
|
5461
5436
|
identity: a.identity
|
|
5462
5437
|
};
|
|
5463
|
-
},
|
|
5438
|
+
}, Js = (e, t) => {
|
|
5464
5439
|
if (!t.length) throw new Error("Compound navigation requires at least one page or panel target");
|
|
5465
|
-
const r =
|
|
5440
|
+
const r = Z(e.pages), n = Mn(e.pageLocations), o = N(e.modePlacements), s = N(e.shellPlacements), a = e.pages.store.getState(), l = o.getState(), c = s.getState();
|
|
5466
5441
|
let g = l, m = c, i = a;
|
|
5467
5442
|
const d = /* @__PURE__ */ new Map(), u = (f = i.activeModeId) => ({
|
|
5468
5443
|
shell: s.resolve(void 0, m),
|
|
@@ -5477,7 +5452,7 @@ const vr = () => {
|
|
|
5477
5452
|
pageId: S.id,
|
|
5478
5453
|
projectId: i.projectId,
|
|
5479
5454
|
location: v.location
|
|
5480
|
-
}, m,
|
|
5455
|
+
}, m, Us(i)) ?? m, g = o.restore?.({
|
|
5481
5456
|
modeId: S.modeId,
|
|
5482
5457
|
pageId: S.id,
|
|
5483
5458
|
location: v.location,
|
|
@@ -5494,7 +5469,7 @@ const vr = () => {
|
|
|
5494
5469
|
} else if (f.kind === "panel") {
|
|
5495
5470
|
const v = f.panel;
|
|
5496
5471
|
if (v.kind === "page-slot") {
|
|
5497
|
-
const S =
|
|
5472
|
+
const S = Hs(i, v);
|
|
5498
5473
|
i = r.prepare.slot({
|
|
5499
5474
|
pageId: S.id,
|
|
5500
5475
|
slotId: v.id,
|
|
@@ -5502,13 +5477,13 @@ const vr = () => {
|
|
|
5502
5477
|
open: f.open
|
|
5503
5478
|
}, i, u());
|
|
5504
5479
|
} else {
|
|
5505
|
-
const S = i.activeModeId ?? e.modes.getActiveModeId(), k =
|
|
5480
|
+
const S = i.activeModeId ?? e.modes.getActiveModeId(), k = Qs(e, f, S, g, m);
|
|
5506
5481
|
g = k.modeState, m = k.shellState;
|
|
5507
|
-
const
|
|
5482
|
+
const w = k.identity;
|
|
5508
5483
|
i = r.prepare.compose(i, {
|
|
5509
5484
|
...i,
|
|
5510
5485
|
activeModeId: S,
|
|
5511
|
-
activate: [
|
|
5486
|
+
activate: [w],
|
|
5512
5487
|
action: "preparePanelNavigation"
|
|
5513
5488
|
}, u(S));
|
|
5514
5489
|
}
|
|
@@ -5516,26 +5491,26 @@ const vr = () => {
|
|
|
5516
5491
|
throw new Error("Compound navigation accepts only page and panel targets");
|
|
5517
5492
|
for (const v of i.reconciliation.activate) d.set(v.region, v.identity);
|
|
5518
5493
|
}
|
|
5519
|
-
const p = new Set(i.placements.map((f) =>
|
|
5494
|
+
const p = new Set(i.placements.map((f) => E(f.identity))), y = r.prepare.compose(a, {
|
|
5520
5495
|
...i,
|
|
5521
|
-
activate: [...d.values()].filter((f) => p.has(
|
|
5496
|
+
activate: [...d.values()].filter((f) => p.has(E(f))),
|
|
5522
5497
|
action: "prepareCompoundNavigation"
|
|
5523
5498
|
}, u());
|
|
5524
5499
|
return {
|
|
5525
5500
|
commit: () => Te(() => {
|
|
5526
5501
|
const f = () => {
|
|
5527
5502
|
o.apply(g), s.apply(m);
|
|
5528
|
-
}, v = () => (f(), r.publish(
|
|
5503
|
+
}, v = () => (f(), r.publish(y, "navigateCompoundTarget")), S = y.location ? n.commit(y, f) : v();
|
|
5529
5504
|
return g !== l && o.publish(), m !== c && s.publish(), S;
|
|
5530
5505
|
})
|
|
5531
5506
|
};
|
|
5532
|
-
},
|
|
5507
|
+
}, Jt = (e, t) => e.pages.listPages().find((r) => r.ref.extensionId === t.page.extensionId && r.ref.id === t.page.id), Gs = (e, t) => {
|
|
5533
5508
|
const r = t.panel;
|
|
5534
|
-
return r.kind === "shell-placement" ? !!e.shellPlacements.getPlacement(r.id) : r.kind !== "page-slot" ? !!e.modePlacements.getPlacement(r) : !!
|
|
5509
|
+
return r.kind === "shell-placement" ? !!e.shellPlacements.getPlacement(r.id) : r.kind !== "page-slot" ? !!e.modePlacements.getPlacement(r) : !!Jt(e, r)?.slots.some((n) => n.id === r.id);
|
|
5535
5510
|
}, Se = (e, t) => {
|
|
5536
5511
|
t === "secondary" && e.shell.setRegionOpen("secondary", !0), t === "side" && e.sidePanel.getMode() === "closed" && e.sidePanel.setMode("attached");
|
|
5537
|
-
},
|
|
5538
|
-
const n =
|
|
5512
|
+
}, Ys = (e, t, r) => {
|
|
5513
|
+
const n = Jt(e, r);
|
|
5539
5514
|
if (!n || e.pages.store.getState().activePageId !== n.id)
|
|
5540
5515
|
throw new Error(`Page panel "${r.id}" is not owned by the active page`);
|
|
5541
5516
|
const o = n.slots.find((s) => s.id === r.id);
|
|
@@ -5550,7 +5525,7 @@ const vr = () => {
|
|
|
5550
5525
|
open: t.open
|
|
5551
5526
|
} : {}
|
|
5552
5527
|
}), Se(e, o.region);
|
|
5553
|
-
},
|
|
5528
|
+
}, Xs = (e, t) => {
|
|
5554
5529
|
const r = t.panel;
|
|
5555
5530
|
if (r.kind !== "placement") throw new Error(`Expected a mode placement panel: ${r.id}`);
|
|
5556
5531
|
const n = e.modePlacements.getPlacement(r);
|
|
@@ -5566,7 +5541,7 @@ const vr = () => {
|
|
|
5566
5541
|
} : {}
|
|
5567
5542
|
});
|
|
5568
5543
|
Se(e, n.region), Fe(e, o);
|
|
5569
|
-
},
|
|
5544
|
+
}, Zs = (e, t) => {
|
|
5570
5545
|
const r = e.shellPlacements.getPlacement(t.panel.id);
|
|
5571
5546
|
if (!r) throw new Error(`Unknown shell placement: ${t.panel.id}`);
|
|
5572
5547
|
const n = e.shellPlacements.openPlacement({
|
|
@@ -5582,28 +5557,28 @@ const vr = () => {
|
|
|
5582
5557
|
} : {}
|
|
5583
5558
|
});
|
|
5584
5559
|
Se(e, r.region), Fe(e, n);
|
|
5585
|
-
},
|
|
5560
|
+
}, ea = (e, t) => {
|
|
5586
5561
|
const r = t.panel;
|
|
5587
5562
|
if (r.kind === "shell-placement") {
|
|
5588
|
-
|
|
5563
|
+
Zs(e, {
|
|
5589
5564
|
...t,
|
|
5590
5565
|
panel: r
|
|
5591
5566
|
});
|
|
5592
5567
|
return;
|
|
5593
5568
|
}
|
|
5594
5569
|
if (r.kind === "page-slot") {
|
|
5595
|
-
|
|
5570
|
+
Ys(e, t, r);
|
|
5596
5571
|
return;
|
|
5597
5572
|
}
|
|
5598
|
-
|
|
5599
|
-
},
|
|
5573
|
+
Xs(e, t);
|
|
5574
|
+
}, ta = (e) => ro({
|
|
5600
5575
|
resolveDispatcher: () => {
|
|
5601
5576
|
const t = e();
|
|
5602
5577
|
return {
|
|
5603
|
-
prepareNavigation: (r) =>
|
|
5604
|
-
canOpenPanel: (r) =>
|
|
5578
|
+
prepareNavigation: (r) => Js(t, r),
|
|
5579
|
+
canOpenPanel: (r) => Gs(t, r),
|
|
5605
5580
|
canExecuteCommand: (r) => !!t.commands.getCommand(r),
|
|
5606
|
-
openPanelTarget: (r) =>
|
|
5581
|
+
openPanelTarget: (r) => ea(t, r),
|
|
5607
5582
|
openPageTarget: (r) => {
|
|
5608
5583
|
const n = t.pageLocations.navigate(r);
|
|
5609
5584
|
if (!n.ok) throw new Error(n.diagnostic.message);
|
|
@@ -5613,34 +5588,34 @@ const vr = () => {
|
|
|
5613
5588
|
openHref: (r) => globalThis.open(r, "_blank", "noopener,noreferrer")
|
|
5614
5589
|
};
|
|
5615
5590
|
}
|
|
5616
|
-
}),
|
|
5617
|
-
const t =
|
|
5591
|
+
}), ra = (e) => {
|
|
5592
|
+
const t = No();
|
|
5618
5593
|
return {
|
|
5619
5594
|
...t,
|
|
5620
|
-
...
|
|
5595
|
+
...qo({
|
|
5621
5596
|
rendererRegistry: t,
|
|
5622
5597
|
persistence: e.treePersistence
|
|
5623
5598
|
}),
|
|
5624
|
-
...
|
|
5599
|
+
...Fo({
|
|
5625
5600
|
rendererRegistry: t
|
|
5626
5601
|
}),
|
|
5627
|
-
...
|
|
5602
|
+
...Ao({
|
|
5628
5603
|
rendererRegistry: t
|
|
5629
5604
|
}),
|
|
5630
|
-
...
|
|
5605
|
+
...Vo({
|
|
5631
5606
|
rendererRegistry: t
|
|
5632
5607
|
}),
|
|
5633
|
-
...
|
|
5608
|
+
...Do({
|
|
5634
5609
|
rendererRegistry: t
|
|
5635
5610
|
})
|
|
5636
5611
|
};
|
|
5637
|
-
},
|
|
5612
|
+
}, j = (e, t) => ({
|
|
5638
5613
|
...t,
|
|
5639
5614
|
source: e.source,
|
|
5640
5615
|
ownerId: e.ownerId
|
|
5641
|
-
}),
|
|
5616
|
+
}), Gt = (e) => e ? Array.isArray(e) ? [...e] : [e] : [], Yt = (e) => {
|
|
5642
5617
|
for (let t = e.length - 1; t >= 0; t -= 1) e[t]?.dispose();
|
|
5643
|
-
},
|
|
5618
|
+
}, Xt = (e, t) => {
|
|
5644
5619
|
const r = e.context.createScope(t.ownerId);
|
|
5645
5620
|
t.track(r);
|
|
5646
5621
|
const n = (i) => (t.track(i), i), {
|
|
@@ -5678,16 +5653,16 @@ const vr = () => {
|
|
|
5678
5653
|
},
|
|
5679
5654
|
commands: {
|
|
5680
5655
|
...e.commands,
|
|
5681
|
-
registerCommand: (i, d, u) => n(e.commands.registerCommand(i, d,
|
|
5656
|
+
registerCommand: (i, d, u) => n(e.commands.registerCommand(i, d, j(t, u))),
|
|
5682
5657
|
onDidExecuteError: (i) => n(e.commands.onDidExecuteError(i))
|
|
5683
5658
|
},
|
|
5684
5659
|
keybindings: {
|
|
5685
5660
|
...e.keybindings,
|
|
5686
|
-
registerKeybinding: (i, d) => n(e.keybindings.registerKeybinding(i,
|
|
5661
|
+
registerKeybinding: (i, d) => n(e.keybindings.registerKeybinding(i, j(t, d)))
|
|
5687
5662
|
},
|
|
5688
5663
|
layout: {
|
|
5689
5664
|
...m,
|
|
5690
|
-
registerMenuItem: (i, d, u) => n(e.layout.registerMenuItem(i, d,
|
|
5665
|
+
registerMenuItem: (i, d, u) => n(e.layout.registerMenuItem(i, d, j(t, u))),
|
|
5691
5666
|
onWillChangePersistenceScope: (i) => n(e.layout.onWillChangePersistenceScope(i)),
|
|
5692
5667
|
onDidChangePersistenceScope: (i) => n(e.layout.onDidChangePersistenceScope(i))
|
|
5693
5668
|
},
|
|
@@ -5696,11 +5671,11 @@ const vr = () => {
|
|
|
5696
5671
|
registerMode: (i) => n(e.modes.registerMode({
|
|
5697
5672
|
...i,
|
|
5698
5673
|
activate: () => {
|
|
5699
|
-
const d = [], u =
|
|
5674
|
+
const d = [], u = Xt(e, {
|
|
5700
5675
|
...t,
|
|
5701
|
-
track: (
|
|
5702
|
-
}), p =
|
|
5703
|
-
return R(() =>
|
|
5676
|
+
track: (y) => d.push(y)
|
|
5677
|
+
}), p = Gt(i.activate(u));
|
|
5678
|
+
return R(() => Yt([...d, ...p]));
|
|
5704
5679
|
}
|
|
5705
5680
|
})),
|
|
5706
5681
|
onDidChangeActive: (i) => n(e.modes.onDidChangeActive(i))
|
|
@@ -5717,7 +5692,7 @@ const vr = () => {
|
|
|
5717
5692
|
},
|
|
5718
5693
|
navigation: {
|
|
5719
5694
|
...e.navigation,
|
|
5720
|
-
registerParser: (i, d) => n(e.navigation.registerParser(i,
|
|
5695
|
+
registerParser: (i, d) => n(e.navigation.registerParser(i, j(t, d)))
|
|
5721
5696
|
},
|
|
5722
5697
|
navigationTrees: {
|
|
5723
5698
|
...e.navigationTrees,
|
|
@@ -5726,7 +5701,7 @@ const vr = () => {
|
|
|
5726
5701
|
},
|
|
5727
5702
|
notifications: {
|
|
5728
5703
|
...e.notifications,
|
|
5729
|
-
show: (i, d) => e.notifications.show(i,
|
|
5704
|
+
show: (i, d) => e.notifications.show(i, j(t, d))
|
|
5730
5705
|
},
|
|
5731
5706
|
overlays: {
|
|
5732
5707
|
...e.overlays,
|
|
@@ -5734,7 +5709,7 @@ const vr = () => {
|
|
|
5734
5709
|
},
|
|
5735
5710
|
placeholders: {
|
|
5736
5711
|
...e.placeholders,
|
|
5737
|
-
registerPlaceholder: (i, d) => n(e.placeholders.registerPlaceholder(i,
|
|
5712
|
+
registerPlaceholder: (i, d) => n(e.placeholders.registerPlaceholder(i, j(t, d)))
|
|
5738
5713
|
},
|
|
5739
5714
|
pages: {
|
|
5740
5715
|
...e.pages,
|
|
@@ -5746,17 +5721,17 @@ const vr = () => {
|
|
|
5746
5721
|
},
|
|
5747
5722
|
preferences: {
|
|
5748
5723
|
...e.preferences,
|
|
5749
|
-
registerSchema: (i, d) => n(e.preferences.registerSchema(i,
|
|
5724
|
+
registerSchema: (i, d) => n(e.preferences.registerSchema(i, j(t, d)))
|
|
5750
5725
|
},
|
|
5751
5726
|
resources: {
|
|
5752
5727
|
...e.resources,
|
|
5753
|
-
registerKind: (i, d) => n(e.resources.registerKind(i,
|
|
5728
|
+
registerKind: (i, d) => n(e.resources.registerKind(i, j(t, d))),
|
|
5754
5729
|
registerHierarchyProvider: (i) => n(e.resources.registerHierarchyProvider(i)),
|
|
5755
5730
|
registerProvider: (i) => n(e.resources.registerProvider(i))
|
|
5756
5731
|
},
|
|
5757
5732
|
views: {
|
|
5758
5733
|
...e.views,
|
|
5759
|
-
registerView: (i, d) => n(e.views.registerView(i,
|
|
5734
|
+
registerView: (i, d) => n(e.views.registerView(i, j(t, d)))
|
|
5760
5735
|
},
|
|
5761
5736
|
viewMenus: {
|
|
5762
5737
|
...e.viewMenus,
|
|
@@ -5764,8 +5739,8 @@ const vr = () => {
|
|
|
5764
5739
|
},
|
|
5765
5740
|
settings: {
|
|
5766
5741
|
...e.settings,
|
|
5767
|
-
registerSection: (i, d) => n(e.settings.registerSection(i,
|
|
5768
|
-
registerPanel: (i, d) => n(e.settings.registerPanel(i,
|
|
5742
|
+
registerSection: (i, d) => n(e.settings.registerSection(i, j(t, d))),
|
|
5743
|
+
registerPanel: (i, d) => n(e.settings.registerPanel(i, j(t, d)))
|
|
5769
5744
|
},
|
|
5770
5745
|
statusBar: {
|
|
5771
5746
|
...e.statusBar,
|
|
@@ -5773,7 +5748,7 @@ const vr = () => {
|
|
|
5773
5748
|
},
|
|
5774
5749
|
statuses: {
|
|
5775
5750
|
...e.statuses,
|
|
5776
|
-
registerStatusSet: (i, d) => n(e.statuses.registerStatusSet(i,
|
|
5751
|
+
registerStatusSet: (i, d) => n(e.statuses.registerStatusSet(i, j(t, d)))
|
|
5777
5752
|
},
|
|
5778
5753
|
shell: {
|
|
5779
5754
|
...e.shell,
|
|
@@ -5792,7 +5767,7 @@ const vr = () => {
|
|
|
5792
5767
|
register: (i) => n(e.fileIconThemes.register(i))
|
|
5793
5768
|
}
|
|
5794
5769
|
};
|
|
5795
|
-
},
|
|
5770
|
+
}, na = (e) => {
|
|
5796
5771
|
const t = /* @__PURE__ */ new Map();
|
|
5797
5772
|
return {
|
|
5798
5773
|
registerModule(r) {
|
|
@@ -5800,21 +5775,21 @@ const vr = () => {
|
|
|
5800
5775
|
const n = [];
|
|
5801
5776
|
let o;
|
|
5802
5777
|
o = R(() => {
|
|
5803
|
-
t.get(r.id)?.disposable === o && (t.delete(r.id),
|
|
5778
|
+
t.get(r.id)?.disposable === o && (t.delete(r.id), Yt(n));
|
|
5804
5779
|
});
|
|
5805
5780
|
const s = {
|
|
5806
5781
|
disposable: o
|
|
5807
5782
|
};
|
|
5808
5783
|
t.set(r.id, s);
|
|
5809
5784
|
try {
|
|
5810
|
-
const a =
|
|
5785
|
+
const a = Xt(e(), {
|
|
5811
5786
|
ownerId: r.ownerId ?? r.id,
|
|
5812
5787
|
source: r.source ?? "module",
|
|
5813
5788
|
track: (l) => {
|
|
5814
5789
|
n.push(l);
|
|
5815
5790
|
}
|
|
5816
5791
|
});
|
|
5817
|
-
n.push(...
|
|
5792
|
+
n.push(...Gt(r.activate(a)));
|
|
5818
5793
|
} catch (a) {
|
|
5819
5794
|
throw s.disposable.dispose(), a;
|
|
5820
5795
|
}
|
|
@@ -5824,7 +5799,7 @@ const vr = () => {
|
|
|
5824
5799
|
t.get(r)?.disposable.dispose();
|
|
5825
5800
|
}
|
|
5826
5801
|
};
|
|
5827
|
-
},
|
|
5802
|
+
}, oa = (e, t, r) => {
|
|
5828
5803
|
const n = e.resolvePagePersistenceScope;
|
|
5829
5804
|
if (n)
|
|
5830
5805
|
return (o) => {
|
|
@@ -5839,18 +5814,18 @@ const vr = () => {
|
|
|
5839
5814
|
carryRegionState: s.carryRegions
|
|
5840
5815
|
});
|
|
5841
5816
|
};
|
|
5842
|
-
},
|
|
5843
|
-
const t =
|
|
5817
|
+
}, ca = (e = {}) => {
|
|
5818
|
+
const t = dr(), r = jn({
|
|
5844
5819
|
context: t
|
|
5845
|
-
}), n =
|
|
5820
|
+
}), n = ra(e), o = Ws(e), s = en({
|
|
5846
5821
|
defaultRegionVisibility: e.defaultPanelOpenByRegionId,
|
|
5847
5822
|
// The active mode owns region policy; the host input is the fallback. Resolved
|
|
5848
5823
|
// lazily because the mode registry is created after the layout model.
|
|
5849
5824
|
getRegionSettings: (C) => {
|
|
5850
|
-
const O = I?.modes.getActiveModeId(),
|
|
5825
|
+
const O = I?.modes.getActiveModeId(), ee = O ? I?.modes.getMode(O) : void 0;
|
|
5851
5826
|
return {
|
|
5852
5827
|
...e.regionSettings?.[C],
|
|
5853
|
-
...
|
|
5828
|
+
...ee?.regionSettings?.[C]
|
|
5854
5829
|
};
|
|
5855
5830
|
},
|
|
5856
5831
|
persistence: o.layout
|
|
@@ -5859,24 +5834,24 @@ const vr = () => {
|
|
|
5859
5834
|
...l
|
|
5860
5835
|
} = s, c = {
|
|
5861
5836
|
...l,
|
|
5862
|
-
...
|
|
5837
|
+
...Nn({
|
|
5863
5838
|
commands: r
|
|
5864
5839
|
})
|
|
5865
|
-
}, g =
|
|
5840
|
+
}, g = ln({
|
|
5866
5841
|
context: t,
|
|
5867
5842
|
isRegionFocusable: (C) => c.getLayout().regions[C].visible
|
|
5868
|
-
}), m =
|
|
5869
|
-
registerBody:
|
|
5870
|
-
}), i =
|
|
5843
|
+
}), m = rs({
|
|
5844
|
+
registerBody: Ls(n)
|
|
5845
|
+
}), i = es({
|
|
5871
5846
|
views: m
|
|
5872
|
-
}), d = e.pageResources ??
|
|
5847
|
+
}), d = e.pageResources ?? Pt, u = Gn({
|
|
5873
5848
|
loadLayout: (C) => o.readMode(C.projectId, C.modeId),
|
|
5874
5849
|
getProjectId: () => I?.pages.store.getState().projectId,
|
|
5875
5850
|
views: m,
|
|
5876
5851
|
viewMenus: i,
|
|
5877
5852
|
getPanel: c.getWidget,
|
|
5878
5853
|
registerPanel: c
|
|
5879
|
-
}), p =
|
|
5854
|
+
}), p = To({
|
|
5880
5855
|
views: m,
|
|
5881
5856
|
viewMenus: i,
|
|
5882
5857
|
getPanel: c.getWidget,
|
|
@@ -5889,48 +5864,48 @@ const vr = () => {
|
|
|
5889
5864
|
currentScope: c.getPersistenceScope(),
|
|
5890
5865
|
resource: C.location?.resource
|
|
5891
5866
|
}).scope : void 0,
|
|
5892
|
-
loadLayout: (C) =>
|
|
5867
|
+
loadLayout: (C) => Qt(e, {
|
|
5893
5868
|
...C,
|
|
5894
5869
|
resource: C.location?.resource
|
|
5895
5870
|
}),
|
|
5896
5871
|
enteredWithPersistedLayout: c.enteredWithPersistedLayout,
|
|
5897
5872
|
onDidChangePersistenceScope: c.onDidChangePersistenceScope
|
|
5898
|
-
}),
|
|
5873
|
+
}), y = Ho({
|
|
5899
5874
|
hasView: (C) => !!m.getView(C)
|
|
5900
|
-
}), f =
|
|
5875
|
+
}), f = ao({
|
|
5901
5876
|
subscribeViewRefresh: (C, O) => n.onDidRefresh(({
|
|
5902
|
-
treeId:
|
|
5877
|
+
treeId: ee
|
|
5903
5878
|
}) => {
|
|
5904
|
-
|
|
5879
|
+
ee === C && O();
|
|
5905
5880
|
}),
|
|
5906
5881
|
getViewDefaultExpandedSectionIds: (C) => n.getTreeRenderer(C)?.defaultExpandedSectionIds,
|
|
5907
5882
|
getViewSections: (C, O) => n.getBody(C, {
|
|
5908
5883
|
...O,
|
|
5909
5884
|
viewId: C
|
|
5910
5885
|
}),
|
|
5911
|
-
getViewChildren: (C, O,
|
|
5912
|
-
...
|
|
5886
|
+
getViewChildren: (C, O, ee) => n.getChildren(C, O, {
|
|
5887
|
+
...ee,
|
|
5913
5888
|
viewId: C
|
|
5914
5889
|
})
|
|
5915
|
-
}), v =
|
|
5890
|
+
}), v = co({
|
|
5916
5891
|
layout: c,
|
|
5917
5892
|
views: m,
|
|
5918
5893
|
viewMenus: i
|
|
5919
|
-
}), S =
|
|
5894
|
+
}), S = xo({
|
|
5920
5895
|
layout: c,
|
|
5921
5896
|
views: m
|
|
5922
|
-
}), k = vr(),
|
|
5897
|
+
}), k = vr(), w = $n({
|
|
5923
5898
|
persistence: e.panelMenuStatePersistence
|
|
5924
|
-
}),
|
|
5899
|
+
}), h = lr({
|
|
5925
5900
|
getPrimary: () => I.getPrimaryResource(),
|
|
5926
5901
|
resolveView: m.getView
|
|
5927
5902
|
});
|
|
5928
5903
|
let I;
|
|
5929
|
-
const b =
|
|
5904
|
+
const b = nn({
|
|
5930
5905
|
establishLocation: a,
|
|
5931
5906
|
layout: c,
|
|
5932
5907
|
resolveContext: () => I
|
|
5933
|
-
}), P =
|
|
5908
|
+
}), P = Ln({
|
|
5934
5909
|
getFloatingPanels: () => {
|
|
5935
5910
|
const C = b.getActiveModeId();
|
|
5936
5911
|
return (C ? b.getMode(C)?.floatingPanels : void 0) ?? e.floatingPanels ?? "visible";
|
|
@@ -5938,13 +5913,13 @@ const vr = () => {
|
|
|
5938
5913
|
onDidChangePolicy: b.onDidChangeActive,
|
|
5939
5914
|
initialMode: e.initialSidePanelMode,
|
|
5940
5915
|
persistence: e.sidePanelPersistence
|
|
5941
|
-
}), M =
|
|
5916
|
+
}), M = $s({
|
|
5942
5917
|
layout: c,
|
|
5943
5918
|
sidePanel: P
|
|
5944
|
-
}),
|
|
5919
|
+
}), $ = Ms({
|
|
5945
5920
|
loadModeLayout: o.readMode,
|
|
5946
|
-
beforeApply:
|
|
5947
|
-
restorePageState:
|
|
5921
|
+
beforeApply: oa(e, c, w),
|
|
5922
|
+
restorePageState: Es(e),
|
|
5948
5923
|
revealRegion: (C) => Se(I, C),
|
|
5949
5924
|
layout: c,
|
|
5950
5925
|
modePlacements: u,
|
|
@@ -5953,15 +5928,15 @@ const vr = () => {
|
|
|
5953
5928
|
views: m,
|
|
5954
5929
|
viewMenus: i,
|
|
5955
5930
|
resources: d
|
|
5956
|
-
}),
|
|
5957
|
-
registry:
|
|
5958
|
-
browser: e.pageLocationBrowser ??
|
|
5959
|
-
persistence: e.pageLocationPersistence ??
|
|
5960
|
-
startPage: e.startPage ??
|
|
5961
|
-
}), D =
|
|
5931
|
+
}), K = Wn({
|
|
5932
|
+
registry: $,
|
|
5933
|
+
browser: e.pageLocationBrowser ?? ds(),
|
|
5934
|
+
persistence: e.pageLocationPersistence ?? ls(),
|
|
5935
|
+
startPage: e.startPage ?? hr.start
|
|
5936
|
+
}), D = Ns(() => I), Zt = ta(() => I);
|
|
5962
5937
|
return I = {
|
|
5963
|
-
closePlacement:
|
|
5964
|
-
pinPlacement:
|
|
5938
|
+
closePlacement: ns(() => I),
|
|
5939
|
+
pinPlacement: os(() => I),
|
|
5965
5940
|
breadcrumbs: k,
|
|
5966
5941
|
commandPalette: Sr(),
|
|
5967
5942
|
commands: r,
|
|
@@ -5978,7 +5953,7 @@ const vr = () => {
|
|
|
5978
5953
|
}),
|
|
5979
5954
|
getPersistenceScope: c.getPersistenceScope
|
|
5980
5955
|
},
|
|
5981
|
-
keybindings:
|
|
5956
|
+
keybindings: gr({
|
|
5982
5957
|
commands: r,
|
|
5983
5958
|
context: t
|
|
5984
5959
|
}),
|
|
@@ -5986,15 +5961,15 @@ const vr = () => {
|
|
|
5986
5961
|
modes: b,
|
|
5987
5962
|
modePlacements: u,
|
|
5988
5963
|
shellPlacements: p,
|
|
5989
|
-
notifications:
|
|
5964
|
+
notifications: io(),
|
|
5990
5965
|
overlays: v,
|
|
5991
5966
|
placeholders: S,
|
|
5992
|
-
pageLocations:
|
|
5993
|
-
pages:
|
|
5994
|
-
navigation:
|
|
5967
|
+
pageLocations: K,
|
|
5968
|
+
pages: $,
|
|
5969
|
+
navigation: Zt,
|
|
5995
5970
|
navigationTrees: f,
|
|
5996
|
-
panelMenuState:
|
|
5997
|
-
preferences:
|
|
5971
|
+
panelMenuState: w,
|
|
5972
|
+
preferences: Bo({
|
|
5998
5973
|
persistence: e.preferencePersistence
|
|
5999
5974
|
}),
|
|
6000
5975
|
treeViews: {
|
|
@@ -6003,28 +5978,28 @@ const vr = () => {
|
|
|
6003
5978
|
setSectionExpanded: n.setSectionExpanded,
|
|
6004
5979
|
setSelectedNode: n.setSelectedNode
|
|
6005
5980
|
},
|
|
6006
|
-
commandPaletteResources:
|
|
6007
|
-
resources:
|
|
5981
|
+
commandPaletteResources: Tn(),
|
|
5982
|
+
resources: h,
|
|
6008
5983
|
views: m,
|
|
6009
5984
|
viewMenus: i,
|
|
6010
|
-
settings:
|
|
5985
|
+
settings: _o({
|
|
6011
5986
|
hasView: (C) => !!m.getView(C)
|
|
6012
5987
|
}),
|
|
6013
|
-
statusBar:
|
|
6014
|
-
statuses:
|
|
5988
|
+
statusBar: y,
|
|
5989
|
+
statuses: Jo(),
|
|
6015
5990
|
shell: M,
|
|
6016
5991
|
sidePanel: P,
|
|
6017
|
-
terminal:
|
|
6018
|
-
themes:
|
|
6019
|
-
fileIconThemes:
|
|
5992
|
+
terminal: On(),
|
|
5993
|
+
themes: Yo(),
|
|
5994
|
+
fileIconThemes: Go(),
|
|
6020
5995
|
getActiveResource() {
|
|
6021
|
-
return
|
|
5996
|
+
return qs(I);
|
|
6022
5997
|
},
|
|
6023
5998
|
onDidChangeActiveResource(C) {
|
|
6024
5999
|
return R(I.layout.store.subscribeSelector((O) => O.layout.activeResourceKey, () => C(I.getActiveResource())));
|
|
6025
6000
|
},
|
|
6026
6001
|
getPrimaryResource() {
|
|
6027
|
-
return
|
|
6002
|
+
return _s(I);
|
|
6028
6003
|
},
|
|
6029
6004
|
onDidChangePrimaryResource(C) {
|
|
6030
6005
|
return R(I.pages.store.subscribeSelector((O) => O.location?.resource, () => C(I.getPrimaryResource())));
|
|
@@ -6032,49 +6007,49 @@ const vr = () => {
|
|
|
6032
6007
|
registerChildModule(C) {
|
|
6033
6008
|
return I.registerModule(C);
|
|
6034
6009
|
},
|
|
6035
|
-
...
|
|
6036
|
-
},
|
|
6037
|
-
const C =
|
|
6010
|
+
...na(() => I)
|
|
6011
|
+
}, ur(I, n), c.store.subscribe(() => {
|
|
6012
|
+
const C = $.store.getState();
|
|
6038
6013
|
C.activeModeId && o.saveMode(C.projectId, C.activeModeId, c.getLayout());
|
|
6039
|
-
}),
|
|
6014
|
+
}), cs({
|
|
6040
6015
|
breadcrumbs: k,
|
|
6041
|
-
locations:
|
|
6042
|
-
pages:
|
|
6016
|
+
locations: K,
|
|
6017
|
+
pages: $,
|
|
6043
6018
|
resources: d
|
|
6044
|
-
}),
|
|
6019
|
+
}), zs(I, e), I;
|
|
6045
6020
|
};
|
|
6046
6021
|
export {
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6022
|
+
Ho as createStatusBarRegistry,
|
|
6023
|
+
Jo as createStatusRegistry,
|
|
6024
|
+
rs as createViewRegistry,
|
|
6025
|
+
ca as createWorkbench,
|
|
6026
|
+
ga as createWorkbenchResourceContextValues,
|
|
6027
|
+
ua as createWorkbenchSelectionResourceMetadata,
|
|
6028
|
+
Ra as defaultPageResourceCodec,
|
|
6029
|
+
Ma as dockedWorkbenchRegions,
|
|
6030
|
+
ma as getKeybindingSteps,
|
|
6031
|
+
fa as getWorkbenchModePanelForRegion,
|
|
6032
|
+
pa as getWorkbenchSelectionResourceKeys,
|
|
6033
|
+
Ea as headerLeadingMenuPath,
|
|
6034
|
+
Wa as headerTrailingMenuPath,
|
|
6035
|
+
ar as isWorkbenchModePanelAvailable,
|
|
6036
|
+
ya as isWorkbenchViewHierarchyNode,
|
|
6037
|
+
ha as matchesContextExpression,
|
|
6038
|
+
Je as resolveAnchorRegion,
|
|
6039
|
+
$a as resourceContextMenuPath,
|
|
6040
|
+
wa as resourceHierarchyCycleCode,
|
|
6041
|
+
va as standardResourceIcons,
|
|
6042
|
+
wr as workbenchCommandPaletteMenuPath,
|
|
6068
6043
|
se as workbenchPanelRegions,
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6044
|
+
La as workbenchRegionTabAddMenuPath,
|
|
6045
|
+
Ka as workbenchRegionTabLeadingMenuPath,
|
|
6046
|
+
H as workbenchRegions,
|
|
6047
|
+
Sa as workbenchResourceIdContextKey,
|
|
6048
|
+
Ia as workbenchResourceMetadataContextKey,
|
|
6049
|
+
ba as workbenchResourceTypeContextKey,
|
|
6050
|
+
Pa as workbenchSelectionResourceKeyMetadataKey,
|
|
6051
|
+
xa as workbenchTopHeaderLeadingMenuPath,
|
|
6052
|
+
Oa as workbenchTopHeaderTrailingMenuPath,
|
|
6078
6053
|
mt as workbenchViewIdContextKey
|
|
6079
6054
|
};
|
|
6080
6055
|
//# sourceMappingURL=index.js.map
|