@pstdio/workbench 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +66 -72
  2. package/dist/composition-resolver-types-CWykPyEK.js +241 -0
  3. package/dist/composition-resolver-types-CWykPyEK.js.map +1 -0
  4. package/dist/extensions.d.ts +380 -29
  5. package/dist/extensions.js +1366 -883
  6. package/dist/extensions.js.map +1 -1
  7. package/dist/file-renderer-view-B6_iR4EN.js +496 -0
  8. package/dist/file-renderer-view-B6_iR4EN.js.map +1 -0
  9. package/dist/file-section-navigation-CfYqVObc.js +30 -0
  10. package/dist/file-section-navigation-CfYqVObc.js.map +1 -0
  11. package/dist/index.d.ts +305 -17
  12. package/dist/index.js +2343 -2083
  13. package/dist/index.js.map +1 -1
  14. package/dist/layout-types-DMoZz38-.js.map +1 -1
  15. package/dist/react.d.ts +190 -16
  16. package/dist/react.js +2473 -2374
  17. package/dist/react.js.map +1 -1
  18. package/dist/storage.js +132 -155
  19. package/dist/storage.js.map +1 -1
  20. package/dist/testing.d.ts +177 -14
  21. package/dist/webview-runtime.js +1 -1
  22. package/dist/webview-runtime.js.map +1 -1
  23. package/dist/workbench-built-ins-BncLJfQA.js +1175 -0
  24. package/dist/workbench-built-ins-BncLJfQA.js.map +1 -0
  25. package/dist/workbench-menu-paths-Bb0ICxeG.js +20 -0
  26. package/dist/workbench-menu-paths-Bb0ICxeG.js.map +1 -0
  27. package/package.json +4 -4
  28. package/dist/context-key-service-B2K9LAec.js +0 -1034
  29. package/dist/context-key-service-B2K9LAec.js.map +0 -1
  30. package/dist/file-renderer-view-DrrhYnb_.js +0 -171
  31. package/dist/file-renderer-view-DrrhYnb_.js.map +0 -1
  32. package/dist/workbench-menu-paths-B_QJzcNU.js +0 -12
  33. package/dist/workbench-menu-paths-B_QJzcNU.js.map +0 -1
@@ -1,47 +1,50 @@
1
- import { jsxs as be, jsx as S } from "react/jsx-runtime";
2
- import { useRef as I, useState as fe, useEffect as T, createElement as W } from "react";
3
- import { host as _e } from "rimless";
4
- import { W as j } from "./icon-B9XolQG8.js";
5
- import { isLocalizedString as qe, matchesResourceWhen as ze } from "@pstdio/sdk/extensions";
6
- import { w as Qe } from "./workbench-menu-paths-B_QJzcNU.js";
7
- const te = 1, Ge = ["commands.execute", "resource.open", "notification.show", "notification.action", "notification.resolve", "notification.dismiss", "preferences.get", "preferences.set", "extension.settings.all", "extension.settings.get", "extension.settings.set", "extension.settings.delete", "terminal.session", "files.upload", "files.list", "files.delete"], Ee = ["host.dispatchKeyboardEvent"], Ye = [...Ge, ...Ee], Xe = new Set(Ye), xe = (e) => Xe.has(e), Je = (e) => {
8
- const [t, r] = e.split("@"), n = r === void 0 ? te : Number(r);
1
+ import { jsxs as pe, jsx as N } from "react/jsx-runtime";
2
+ import { useRef as v, useState as be, useEffect as B, createElement as U } from "react";
3
+ import { host as ot } from "rimless";
4
+ import { F as ae } from "./file-section-navigation-CfYqVObc.js";
5
+ import { r as je, d as de } from "./composition-resolver-types-CWykPyEK.js";
6
+ import { c as he, w as st } from "./workbench-menu-paths-Bb0ICxeG.js";
7
+ import { W as V } from "./icon-B9XolQG8.js";
8
+ import { isLocalizedString as it, matchesResourceWhen as at } from "@pstdio/sdk/extensions";
9
+ import { w as dt } from "./layout-types-DMoZz38-.js";
10
+ const ce = 1, ct = ["commands.execute", "resource.open", "notification.show", "notification.action", "notification.resolve", "notification.dismiss", "preferences.get", "preferences.set", "extension.settings.all", "extension.settings.get", "extension.settings.set", "extension.settings.delete", "terminal.session", "files.upload", "files.list", "files.delete"], Se = ["host.dispatchKeyboardEvent"], lt = [...ct, ...Se], mt = new Set(lt), He = (e) => mt.has(e), ut = (e) => {
11
+ const [t, r] = e.split("@"), n = r === void 0 ? ce : Number(r);
9
12
  return {
10
13
  capability: e,
11
14
  name: t ?? "",
12
15
  version: n
13
16
  };
14
- }, V = (e) => ({
17
+ }, Y = (e) => ({
15
18
  capability: e,
16
19
  code: "unsupported_webview_capability",
17
20
  message: `Unsupported webview capability: ${e}`,
18
21
  severity: "error"
19
- }), Ze = (e, t, r) => ({
22
+ }), ft = (e, t, r) => ({
20
23
  capability: e,
21
24
  code: "unsupported_webview_capability_version",
22
- message: `Unsupported webview capability version: ${t}@${r.toString()} (supported: ${te.toString()})`,
25
+ message: `Unsupported webview capability version: ${t}@${r.toString()} (supported: ${ce.toString()})`,
23
26
  severity: "error"
24
- }), et = (e) => ({
27
+ }), pt = (e) => ({
25
28
  capability: e,
26
29
  code: "undeclared_webview_capability",
27
30
  message: `Webview did not declare host capability: ${e}`,
28
31
  severity: "error"
29
- }), tt = (e, t = {}) => {
32
+ }), bt = (e, t = {}) => {
30
33
  const r = [], n = /* @__PURE__ */ new Set();
31
- for (const o of Ee)
34
+ for (const o of Se)
32
35
  t[o] && n.add(o);
33
36
  for (const o of e ?? []) {
34
- const s = Je(o);
35
- if (!xe(s.name)) {
36
- r.push(V(o));
37
+ const s = ut(o);
38
+ if (!He(s.name)) {
39
+ r.push(Y(o));
37
40
  continue;
38
41
  }
39
- if (s.version !== te) {
40
- r.push(Ze(o, s.name, s.version));
42
+ if (s.version !== ce) {
43
+ r.push(ft(o, s.name, s.version));
41
44
  continue;
42
45
  }
43
46
  if (!t[s.name]) {
44
- r.push(V(o));
47
+ r.push(Y(o));
45
48
  continue;
46
49
  }
47
50
  n.add(s.name);
@@ -50,33 +53,33 @@ const te = 1, Ge = ["commands.execute", "resource.open", "notification.show", "n
50
53
  allowed: n,
51
54
  diagnostics: r
52
55
  };
53
- }, rt = (e) => {
56
+ }, ht = (e) => {
54
57
  const {
55
58
  allowed: t,
56
59
  diagnostics: r
57
- } = tt(e.declaredCapabilities, e.capabilities), n = (o) => {
60
+ } = bt(e.declaredCapabilities, e.capabilities), n = (o) => {
58
61
  e.onDiagnostic?.(o);
59
62
  };
60
63
  return {
61
64
  diagnostics: r,
62
65
  async call(o) {
63
- if (!xe(o.method)) {
64
- const i = V(o.method);
66
+ if (!He(o.method)) {
67
+ const i = Y(o.method);
65
68
  throw n(i), new Error(i.message);
66
69
  }
67
70
  if (!t.has(o.method)) {
68
- const i = et(o.method);
71
+ const i = pt(o.method);
69
72
  throw n(i), new Error(i.message);
70
73
  }
71
74
  const s = e.capabilities[o.method];
72
75
  if (!s) {
73
- const i = V(o.method);
76
+ const i = Y(o.method);
74
77
  throw n(i), new Error(i.message);
75
78
  }
76
79
  return await s(o.params);
77
80
  }
78
81
  };
79
- }, nt = (e) => typeof e == "object" && e !== null, pe = (e) => {
82
+ }, gt = (e) => typeof e == "object" && e !== null, ge = (e) => {
80
83
  try {
81
84
  const t = JSON.stringify(e);
82
85
  if (typeof t == "string" && t.length > 0) return t;
@@ -87,7 +90,7 @@ const te = 1, Ge = ["commands.execute", "resource.open", "notification.show", "n
87
90
  } catch {
88
91
  return "Unknown error";
89
92
  }
90
- }, ot = (e) => {
93
+ }, wt = (e) => {
91
94
  if (e instanceof Error) return {
92
95
  message: e.message,
93
96
  stack: e.stack
@@ -95,7 +98,7 @@ const te = 1, Ge = ["commands.execute", "resource.open", "notification.show", "n
95
98
  if (typeof e == "string") return {
96
99
  message: e
97
100
  };
98
- if (nt(e)) {
101
+ if (gt(e)) {
99
102
  const t = typeof e.message == "string" ? e.message : null, r = typeof e.stack == "string" ? e.stack : void 0;
100
103
  return t ? r ? {
101
104
  message: t,
@@ -103,15 +106,15 @@ const te = 1, Ge = ["commands.execute", "resource.open", "notification.show", "n
103
106
  } : {
104
107
  message: t
105
108
  } : {
106
- message: pe(e)
109
+ message: ge(e)
107
110
  };
108
111
  }
109
112
  return e == null ? {
110
113
  message: "Unknown error"
111
114
  } : {
112
- message: pe(e)
115
+ message: ge(e)
113
116
  };
114
- }, Q = () => {
117
+ }, te = () => {
115
118
  if (typeof document > "u") return {};
116
119
  const e = getComputedStyle(document.documentElement), t = {};
117
120
  for (let r = 0; r < e.length; r += 1) {
@@ -119,26 +122,26 @@ const te = 1, Ge = ["commands.execute", "resource.open", "notification.show", "n
119
122
  n.startsWith("--chakra-") && (t[n] = e.getPropertyValue(n).trim());
120
123
  }
121
124
  return t;
122
- }, G = (e) => {
125
+ }, re = (e) => {
123
126
  if (typeof document > "u") return e;
124
127
  const t = document.documentElement.getAttribute("data-theme");
125
128
  if (t === "dark" || t === "light") return t;
126
129
  const r = document.documentElement.getAttribute("data-color-mode");
127
130
  return r === "dark" || r === "light" ? r : e;
128
- }, st = {
131
+ }, It = {
129
132
  border: 0,
130
133
  display: "block",
131
134
  flex: "1 1 0%",
132
135
  height: "100%",
133
136
  minHeight: 0,
134
137
  width: "100%"
135
- }, it = {
138
+ }, yt = {
136
139
  display: "flex",
137
140
  height: "100%",
138
141
  minHeight: 0,
139
142
  position: "relative",
140
143
  width: "100%"
141
- }, at = {
144
+ }, vt = {
142
145
  alignItems: "center",
143
146
  background: "rgba(255, 255, 255, 0.92)",
144
147
  color: "#7a1f12",
@@ -149,7 +152,7 @@ const te = 1, Ge = ["commands.execute", "resource.open", "notification.show", "n
149
152
  position: "absolute",
150
153
  textAlign: "center",
151
154
  zIndex: 1
152
- }, dt = "allow-scripts allow-forms allow-popups", ct = (e) => {
155
+ }, kt = "allow-scripts allow-forms allow-popups", Rt = (e) => {
153
156
  const {
154
157
  view: t,
155
158
  props: r,
@@ -157,116 +160,116 @@ const te = 1, Ge = ["commands.execute", "resource.open", "notification.show", "n
157
160
  capabilities: o,
158
161
  hostEvents: s,
159
162
  onReady: i,
160
- onError: d,
161
- onDiagnostics: c,
162
- title: b
163
- } = e, a = I(null), l = I(null), m = I(!1), f = I(null), p = I(r), w = I(n), v = I(o), se = I(s), ie = I(t.webview.capabilities), ae = I(i), L = I(d), de = I(c), [ce, O] = fe(null), [q, le] = fe(0);
164
- return p.current = r, w.current = n, v.current = o, se.current = s, ie.current = t.webview.capabilities, ae.current = i, L.current = d, de.current = c, T(() => {
165
- const h = a.current;
166
- if (!h) return;
167
- const C = () => {
168
- m.current && le((g) => g + 1);
163
+ onError: a,
164
+ onDiagnostics: d,
165
+ title: m
166
+ } = e, w = v(null), l = v(null), u = v(!1), c = v(null), p = v(r), h = v(n), k = v(o), $ = v(s), Q = v(t.webview.capabilities), b = v(i), I = v(a), R = v(d), [E, G] = be(null), [Z, me] = be(0);
167
+ return p.current = r, h.current = n, k.current = o, $.current = s, Q.current = t.webview.capabilities, b.current = i, I.current = a, R.current = d, B(() => {
168
+ const g = w.current;
169
+ if (!g) return;
170
+ const T = () => {
171
+ u.current && me((y) => y + 1);
169
172
  };
170
- h.addEventListener("load", C);
171
- const E = () => h.removeEventListener("load", C), P = `${q}
173
+ g.addEventListener("load", T);
174
+ const W = () => g.removeEventListener("load", T), F = `${Z}
172
175
  ${t.webview.runtimeUrl}
173
176
  ${t.webview.moduleUrl}`;
174
- if (f.current === P) return E;
175
- f.current = P;
176
- const Ve = t.webview.styles, Fe = t.webview.moduleUrl, me = (g) => {
177
- g.length > 0 && de.current?.(g);
178
- }, ue = () => rt({
179
- capabilities: v.current ?? {},
180
- declaredCapabilities: ie.current,
181
- onDiagnostic: (g) => me([g])
177
+ if (c.current === F) return W;
178
+ c.current = F;
179
+ const et = t.webview.styles, tt = t.webview.moduleUrl, ue = (y) => {
180
+ y.length > 0 && R.current?.(y);
181
+ }, fe = () => ht({
182
+ capabilities: k.current ?? {},
183
+ declaredCapabilities: Q.current,
184
+ onDiagnostic: (y) => ue([y])
182
185
  });
183
- me(ue().diagnostics);
184
- const Ne = {
186
+ ue(fe().diagnostics);
187
+ const rt = {
185
188
  ready: () => {
186
189
  },
187
- runtimeError: (g) => {
188
- O(g.message), L.current?.(g);
190
+ runtimeError: (y) => {
191
+ G(y.message), I.current?.(y);
189
192
  },
190
- call: async (g) => await ue().call(g)
193
+ call: async (y) => await fe().call(y)
191
194
  };
192
195
  return (() => {
193
- m.current = !1, l.current = null;
194
- const g = _e.connect(h, Ne);
195
- h.contentWindow?.location.replace(t.webview.runtimeUrl), g.then(async (z) => {
196
- const x = z.remote;
197
- l.current = x, se.current?.bind((Ue) => x.hostEvent?.(Ue)), await x.init({
198
- moduleUrl: Fe,
199
- styles: Ve,
196
+ u.current = !1, l.current = null;
197
+ const y = ot.connect(g, rt);
198
+ g.contentWindow?.location.replace(t.webview.runtimeUrl), y.then(async (ee) => {
199
+ const j = ee.remote;
200
+ l.current = j, $.current?.bind((nt) => j.hostEvent?.(nt)), await j.init({
201
+ moduleUrl: tt,
202
+ styles: et,
200
203
  props: p.current,
201
- theme: G(w.current),
202
- themeVariables: Q()
203
- }), m.current = !0, O(null), ae.current?.();
204
- }).catch((z) => {
205
- const x = ot(z);
206
- O(x.message), L.current?.(x);
204
+ theme: re(h.current),
205
+ themeVariables: te()
206
+ }), u.current = !0, G(null), b.current?.();
207
+ }).catch((ee) => {
208
+ const j = wt(ee);
209
+ G(j.message), I.current?.(j);
207
210
  });
208
- })(), E;
209
- }, [q, t.webview.runtimeUrl, t.webview.moduleUrl, t.webview.styles]), T(() => {
210
- const h = l.current;
211
- if (!(!h || !s))
212
- return s.bind((C) => h.hostEvent?.(C)), () => s.unbind();
213
- }, [s]), T(() => {
214
- m.current && l.current?.propsUpdate({
211
+ })(), W;
212
+ }, [Z, t.webview.runtimeUrl, t.webview.moduleUrl, t.webview.styles]), B(() => {
213
+ const g = l.current;
214
+ if (!(!g || !s))
215
+ return s.bind((T) => g.hostEvent?.(T)), () => s.unbind();
216
+ }, [s]), B(() => {
217
+ u.current && l.current?.propsUpdate({
215
218
  props: r
216
219
  });
217
- }, [r]), T(() => {
218
- m.current && l.current?.themeUpdate({
219
- theme: G(n),
220
- variables: Q()
220
+ }, [r]), B(() => {
221
+ u.current && l.current?.themeUpdate({
222
+ theme: re(n),
223
+ variables: te()
221
224
  });
222
- }, [n]), T(() => {
225
+ }, [n]), B(() => {
223
226
  if (typeof window > "u" || typeof MutationObserver > "u") return;
224
- let h = null;
225
- const C = () => {
226
- h !== null && cancelAnimationFrame(h), h = requestAnimationFrame(() => {
227
- h = null, m.current && l.current?.themeUpdate({
228
- theme: G(w.current),
229
- variables: Q()
227
+ let g = null;
228
+ const T = () => {
229
+ g !== null && cancelAnimationFrame(g), g = requestAnimationFrame(() => {
230
+ g = null, u.current && l.current?.themeUpdate({
231
+ theme: re(h.current),
232
+ variables: te()
230
233
  });
231
234
  });
232
- }, E = new MutationObserver(C), P = {
235
+ }, W = new MutationObserver(T), F = {
233
236
  attributeFilter: ["class", "data-color-mode", "data-theme", "style"],
234
237
  attributes: !0
235
238
  };
236
- return E.observe(document.documentElement, P), E.observe(document.body, P), () => {
237
- E.disconnect(), h !== null && cancelAnimationFrame(h);
239
+ return W.observe(document.documentElement, F), W.observe(document.body, F), () => {
240
+ W.disconnect(), g !== null && cancelAnimationFrame(g);
238
241
  };
239
- }, []), /* @__PURE__ */ be("div", { style: it, children: [
240
- ce ? /* @__PURE__ */ S("div", { role: "alert", style: at, children: /* @__PURE__ */ be("div", { children: [
241
- /* @__PURE__ */ S("strong", { children: "Extension view failed to load." }),
242
- /* @__PURE__ */ S("div", { children: ce })
242
+ }, []), /* @__PURE__ */ pe("div", { style: yt, children: [
243
+ E ? /* @__PURE__ */ N("div", { role: "alert", style: vt, children: /* @__PURE__ */ pe("div", { children: [
244
+ /* @__PURE__ */ N("strong", { children: "Extension view failed to load." }),
245
+ /* @__PURE__ */ N("div", { children: E })
243
246
  ] }) }) : null,
244
- /* @__PURE__ */ S(
247
+ /* @__PURE__ */ N(
245
248
  "iframe",
246
249
  {
247
- ref: a,
248
- title: b ?? t.label,
250
+ ref: w,
251
+ title: m ?? t.label,
249
252
  allow: "fullscreen",
250
253
  allowFullScreen: !0,
251
- sandbox: dt,
254
+ sandbox: kt,
252
255
  style: {
253
- ...st,
256
+ ...It,
254
257
  colorScheme: n
255
258
  },
256
259
  onLoad: () => {
257
- m.current && le((h) => h + 1);
260
+ u.current && me((g) => g + 1);
258
261
  },
259
262
  onError: () => {
260
- const h = `Failed to load extension runtime at ${t.webview.runtimeUrl}`;
261
- O(h), L.current?.({
262
- message: h
263
+ const g = `Failed to load extension runtime at ${t.webview.runtimeUrl}`;
264
+ G(g), I.current?.({
265
+ message: g
263
266
  });
264
267
  }
265
268
  },
266
- q
269
+ Z
267
270
  )
268
271
  ] });
269
- }, lt = () => {
272
+ }, Ct = () => {
270
273
  let e = null;
271
274
  const t = [], r = /* @__PURE__ */ new Set();
272
275
  return {
@@ -284,13 +287,13 @@ ${t.webview.moduleUrl}`;
284
287
  for (const n of r) n();
285
288
  }
286
289
  };
287
- }, mt = "terminal.session", ut = (e) => {
290
+ }, Et = "terminal.session", Pt = (e) => {
288
291
  const {
289
292
  terminal: t,
290
293
  hostEvents: r
291
294
  } = e, n = (o) => {
292
295
  r.emit({
293
- scope: mt,
296
+ scope: Et,
294
297
  payload: o
295
298
  });
296
299
  };
@@ -337,13 +340,13 @@ ${t.webview.moduleUrl}`;
337
340
  const {
338
341
  sessionId: i
339
342
  } = s;
340
- let d = () => {
341
- }, c = () => {
342
- }, b = !1;
343
- const a = () => {
344
- b || (b = !0, d(), c());
343
+ let a = () => {
344
+ }, d = () => {
345
+ }, m = !1;
346
+ const w = () => {
347
+ m || (m = !0, a(), d());
345
348
  };
346
- return d = t.subscribe(i, {
349
+ return a = t.subscribe(i, {
347
350
  onData: (l) => n({
348
351
  sessionId: i,
349
352
  kind: "data",
@@ -355,16 +358,16 @@ ${t.webview.moduleUrl}`;
355
358
  kind: "exit",
356
359
  code: l.code,
357
360
  signal: l.signal
358
- }), a();
361
+ }), w();
359
362
  }
360
- }), c = r.onDisconnect(a), {
363
+ }), d = r.onDisconnect(w), {
361
364
  operation: "subscribe",
362
365
  accepted: !0
363
366
  };
364
367
  }
365
368
  }
366
369
  };
367
- }, bt = (e) => {
370
+ }, At = (e) => {
368
371
  if (typeof document > "u") return;
369
372
  const t = new KeyboardEvent("keydown", {
370
373
  ...e,
@@ -372,7 +375,9 @@ ${t.webview.moduleUrl}`;
372
375
  cancelable: !0
373
376
  });
374
377
  document.dispatchEvent(t);
375
- }, Ae = (e) => ({
378
+ }, Me = (e) => !e?.strategy || e.strategy === "persistent" ? {} : {
379
+ replaceActive: !0
380
+ }, Oe = (e) => ({
376
381
  "commands.execute": (t) => {
377
382
  const r = t;
378
383
  return e.workbench.commands.executeCommand(r.commandId, r.params);
@@ -380,7 +385,7 @@ ${t.webview.moduleUrl}`;
380
385
  "resource.open": (t) => {
381
386
  const r = t;
382
387
  if (!r.resource) throw new Error("resource.open requires a resource.");
383
- return e.workbench.resources.openResource(r.resource, r.input);
388
+ return e.workbench.resources.openResource(r.resource, Me(r.input));
384
389
  },
385
390
  "notification.show": (t) => {
386
391
  const r = t;
@@ -403,116 +408,116 @@ ${t.webview.moduleUrl}`;
403
408
  value: r.value
404
409
  };
405
410
  },
406
- "host.dispatchKeyboardEvent": (t) => (e.dispatchKeyboardEvent ?? bt)(t),
411
+ "host.dispatchKeyboardEvent": (t) => (e.dispatchKeyboardEvent ?? At)(t),
407
412
  ...e.hostEvents ? {
408
- "terminal.session": ut({
413
+ "terminal.session": Pt({
409
414
  terminal: e.workbench.terminal,
410
415
  hostEvents: e.hostEvents
411
416
  })
412
417
  } : {}
413
- }), ft = (e, t) => {
418
+ }), xt = (e, t) => {
414
419
  for (const r of t)
415
420
  console.warn(`[workbench.webview:${e}] ${r.code}/${r.capability}: ${r.message}`);
416
- }, pt = (e, t) => {
421
+ }, Tt = (e, t) => {
417
422
  console.error(`[workbench.webview:${e}] runtime error: ${t}`);
418
- }, K = "webview:bridge", ht = (e) => {
423
+ }, S = "webview:bridge", Wt = (e) => {
419
424
  if (typeof e != "object" || e === null || Array.isArray(e)) return !1;
420
425
  const t = e;
421
426
  return typeof t.runtimeUrl == "string" && typeof t.moduleUrl == "string";
422
- }, wt = ({
427
+ }, jt = ({
423
428
  placement: e
424
429
  }) => ({
425
430
  placement: e,
426
431
  resource: e.resource
427
- }), Pe = () => "light", he = /* @__PURE__ */ new WeakMap(), Te = (e, t) => {
428
- let r = he.get(e);
429
- r || (r = /* @__PURE__ */ new Map(), he.set(e, r));
432
+ }), Ke = () => "light", we = /* @__PURE__ */ new WeakMap(), De = (e, t) => {
433
+ let r = we.get(e);
434
+ r || (r = /* @__PURE__ */ new Map(), we.set(e, r));
430
435
  const n = t.instanceId;
431
436
  let o = r.get(n);
432
- return o || (o = lt(), r.set(n, o)), o;
433
- }, Se = (e) => {
437
+ return o || (o = Ct(), r.set(n, o)), o;
438
+ }, $e = (e) => {
434
439
  const {
435
440
  context: t,
436
441
  createHostCapabilities: r,
437
442
  createProps: n,
438
- createTheme: o = Pe,
443
+ createTheme: o = Ke,
439
444
  ownerId: s,
440
445
  title: i,
441
- webview: d
446
+ webview: a
442
447
  } = e;
443
- return /* @__PURE__ */ S(ct, { view: {
448
+ return /* @__PURE__ */ N(Rt, { view: {
444
449
  extensionId: s ?? "workbench",
445
450
  id: t.webviewId,
446
- label: d.title ?? i,
451
+ label: a.title ?? i,
447
452
  webview: {
448
- capabilities: d.capabilities,
449
- moduleUrl: d.moduleUrl,
450
- runtimeUrl: d.runtimeUrl,
451
- styles: d.styles ?? []
453
+ capabilities: a.capabilities,
454
+ moduleUrl: a.moduleUrl,
455
+ runtimeUrl: a.runtimeUrl,
456
+ styles: a.styles ?? []
452
457
  }
453
- }, props: n(t), theme: o(t), capabilities: r(t), hostEvents: t.hostEvents, onDiagnostics: (c) => ft(t.webviewId, c), onError: (c) => pt(t.webviewId, c.message) });
454
- }, gt = (e, t, r, n) => {
458
+ }, props: n(t), theme: o(t), capabilities: r(t), hostEvents: t.hostEvents, onDiagnostics: (d) => xt(t.webviewId, d), onError: (d) => Tt(t.webviewId, d.message) });
459
+ }, St = (e, t, r, n) => {
455
460
  const {
456
461
  workbench: o,
457
462
  panel: s,
458
463
  instance: i
459
- } = e, d = ht(s.config) ? s.config : null;
460
- return d ? Se({
464
+ } = e, a = Wt(s.config) ? s.config : null;
465
+ return a ? $e({
461
466
  context: {
462
467
  workbench: o,
463
468
  webviewId: i.panelId,
464
469
  placement: i,
465
- hostEvents: Te(o, i)
470
+ hostEvents: De(o, i)
466
471
  },
467
472
  createHostCapabilities: t,
468
473
  createProps: r,
469
474
  createTheme: n,
470
475
  ownerId: "ownerId" in s ? s.ownerId : void 0,
471
476
  title: s.title,
472
- webview: d
477
+ webview: a
473
478
  }) : null;
474
- }, It = (e = {}) => {
475
- const t = e.createHostCapabilities ?? Ae, r = e.createProps ?? wt, n = e.createTheme ?? Pe;
479
+ }, Ht = (e = {}) => {
480
+ const t = e.createHostCapabilities ?? Oe, r = e.createProps ?? jt, n = e.createTheme ?? Ke;
476
481
  return {
477
- id: K,
478
- render: (o) => gt(o, t, r, n)
482
+ id: S,
483
+ render: (o) => St(o, t, r, n)
479
484
  };
480
- }, y = (e, t) => ({
485
+ }, C = (e, t) => ({
481
486
  id: e,
482
487
  kind: t.kind,
483
488
  label: t.label,
484
489
  description: t.description,
485
490
  metadata: t.metadata
486
491
  });
487
- y("project.sidenav", {
492
+ C("project.sidenav", {
488
493
  kind: "panel"
489
- }), y("project.headerPrimary", {
494
+ }), C("project.headerPrimary", {
490
495
  kind: "menu"
491
- }), y("project.headerOverflow", {
496
+ }), C("project.headerOverflow", {
492
497
  kind: "menu"
493
- }), y("project.settingsPanels", {
498
+ }), C("project.settingsPanels", {
494
499
  kind: "settings"
495
500
  });
496
- y("session.headerPrimary", {
501
+ C("session.headerPrimary", {
497
502
  kind: "menu"
498
- }), y("session.headerOverflow", {
503
+ }), C("session.headerOverflow", {
499
504
  kind: "menu"
500
- }), y("session.transcriptActions", {
505
+ }), C("session.transcriptActions", {
501
506
  kind: "menu"
502
507
  });
503
- y("workspace.headerPrimary", {
508
+ C("workspace.headerPrimary", {
504
509
  kind: "menu"
505
- }), y("workspace.headerOverflow", {
510
+ }), C("workspace.headerOverflow", {
506
511
  kind: "menu"
507
- }), y("workspace.sidenav", {
512
+ }), C("workspace.sidenav", {
508
513
  kind: "panel"
509
514
  });
510
- const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e.$l10n == "string", u = (e, t = "") => e === void 0 ? t : yt(e) ? e.default ?? e.$l10n : e, N = (e) => {
515
+ const Mt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e.$l10n == "string", f = (e, t = "") => e === void 0 ? t : Mt(e) ? e.default ?? e.$l10n : e, X = (e) => {
511
516
  const t = e;
512
517
  if (!t?.outcome) return e;
513
518
  if (t.outcome.status === "success") return t.outcome.value;
514
519
  throw new Error(t.outcome.reason ?? t.outcome.error?.message ?? "Extension command failed.");
515
- }, re = (e) => {
520
+ }, H = (e) => {
516
521
  if (e)
517
522
  return {
518
523
  type: e.kind,
@@ -520,21 +525,28 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
520
525
  label: e.label,
521
526
  metadata: e.metadata
522
527
  };
523
- }, U = (e) => ({
524
- kind: e.type,
525
- uri: `pstdio://extension-resource/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}`,
526
- id: e.id,
527
- label: e.label,
528
- metadata: e.metadata
529
- }), M = (e) => ({
528
+ }, _ = (e) => {
529
+ const t = e.icon, r = e.projectId ? {
530
+ ...e.metadata,
531
+ projectId: e.projectId
532
+ } : e.metadata;
533
+ return {
534
+ kind: e.type,
535
+ uri: `pstdio://extension-resource/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}`,
536
+ id: e.id,
537
+ label: e.label,
538
+ icon: typeof t == "string" ? t : void 0,
539
+ metadata: r
540
+ };
541
+ }, M = (e) => ({
530
542
  id: e.id,
531
543
  kind: e.kind,
532
544
  context: {
533
545
  projectId: e.projectId,
534
546
  ...e.context ?? {}
535
547
  }
536
- }), k = async (e, t, r = {}) => {
537
- const n = re(r.resource), o = await e.executeCommand(t, {
548
+ }), P = async (e, t, r = {}) => {
549
+ const n = H(r.resource), o = await e.executeCommand(t, {
538
550
  projectId: e.projectId,
539
551
  ...r.params ? {
540
552
  params: r.params
@@ -550,31 +562,109 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
550
562
  metadata: r.metadata
551
563
  } : {}
552
564
  });
553
- return N(o);
554
- }, vt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), kt = (e) => typeof e == "string" ? e : e?.id, Rt = async (e, t) => {
555
- if (t.kind === "resource" && t.resource) {
556
- await e.workbench.resources.openResource(U(t.resource), {
557
- replaceActive: !0
558
- }).catch(() => {
559
- });
565
+ return X(o);
566
+ }, x = (e) => !!(e && typeof e == "object" && !Array.isArray(e)), Ot = (e) => typeof e == "string" || x(e) && typeof e.id == "string", Kt = (e) => x(e) && typeof e.type == "string" && typeof e.id == "string", Dt = (e) => {
567
+ if (!Kt(e.resource)) return !1;
568
+ if (e.input === void 0) return !0;
569
+ if (!x(e.input)) return !1;
570
+ const t = e.input.strategy;
571
+ return t === void 0 || t === "persistent" || t === "replace-active";
572
+ }, $t = (e) => {
573
+ if (typeof e.panel != "string") return !1;
574
+ if (e.input === void 0) return !0;
575
+ if (!x(e.input)) return !1;
576
+ const t = e.input.strategy, r = e.input.region;
577
+ return (r === void 0 || typeof r == "string") && (t === void 0 || t === "persistent" || t === "preview" || t === "replace-active" || t === "replace-invoking");
578
+ }, Ie = (e) => x(e) ? e.kind === "resource" ? Dt(e) : e.kind === "panel" ? $t(e) : e.kind === "command" && Ot(e.command) && (e.params === void 0 || x(e.params)) : !1, Ft = (e) => Ie(e) ? !0 : x(e) && e.kind === "compound" && Array.isArray(e.targets) && e.targets.length > 0 && e.targets.every(Ie), Bt = (e, t) => !e || e === "persistent" ? {} : {
579
+ replaceActive: !0
580
+ }, Nt = (e, t) => {
581
+ const r = e?.strategy, n = e?.region ? {
582
+ region: e.region
583
+ } : {};
584
+ if (!r) return n;
585
+ if (r === "persistent" || r === "preview" || r === "replace-active")
586
+ return {
587
+ ...n,
588
+ strategy: {
589
+ kind: r
590
+ }
591
+ };
592
+ if (!t) throw new Error("replace-invoking requires a live source placement.");
593
+ return {
594
+ ...n,
595
+ strategy: {
596
+ kind: "replace-panel",
597
+ instanceId: t.instanceId
598
+ }
599
+ };
600
+ }, Ut = (e, t) => {
601
+ const r = t.commandTargetOf?.(e);
602
+ return r || {
603
+ kind: "command",
604
+ commandId: t.commandIdOf?.(e.command) ?? (typeof e.command == "string" ? e.command : e.command.id),
605
+ args: e.params
606
+ };
607
+ }, J = (e, t = {}) => {
608
+ if (e.kind === "resource") {
609
+ if (e.section && !t.resourceOf)
610
+ throw new Error("Resource targets with a section need a resourceOf translator that encodes the section.");
611
+ return {
612
+ kind: "resource",
613
+ resource: t.resourceOf ? t.resourceOf(e.resource, e) : _(e.resource),
614
+ input: Bt(e.input?.strategy, t.sourcePlacement)
615
+ };
616
+ }
617
+ return e.kind === "panel" ? {
618
+ kind: "panel",
619
+ panelId: e.panel,
620
+ input: Nt(e.input, t.sourcePlacement)
621
+ } : e.kind === "command" ? Ut(e, t) : {
622
+ kind: "compound",
623
+ targets: e.targets.map((r) => J(r, t))
624
+ };
625
+ }, Fe = (e, t = {}) => {
626
+ if (e != null) {
627
+ if (!Ft(e)) throw new Error("Renderer callback returned an invalid navigation target.");
628
+ return J(e, t);
629
+ }
630
+ }, Vt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Lt = (e) => typeof e == "string" ? e : e.id, _t = async (e, t, r) => {
631
+ const {
632
+ target: n
633
+ } = r;
634
+ if (n.kind === "command") {
635
+ await P(e, Lt(n.command), {
636
+ params: n.params
637
+ }), e.workbench.commandPaletteResources.refresh();
560
638
  return;
561
639
  }
562
- const r = kt(t.command);
563
- r && (await k(e, r, {
564
- params: t.params
565
- }), e.workbench.commandPaletteResources.refresh());
566
- }, Ct = (e, t, r, n) => ({
640
+ await e.workbench.navigation.openTarget(J(n, {
641
+ resourceOf: (o, s) => {
642
+ const i = _(o);
643
+ return s.section ? {
644
+ ...i,
645
+ metadata: {
646
+ ...i.metadata,
647
+ [ae]: {
648
+ treeId: t.id,
649
+ targetNodeId: r.id,
650
+ anchors: s.section.anchors
651
+ }
652
+ }
653
+ } : i;
654
+ }
655
+ }));
656
+ }, qt = (e, t, r, n) => ({
567
657
  id: `${t.id}:${n.id}`,
568
658
  label: n.label,
569
659
  description: n.description,
570
660
  icon: n.icon,
571
661
  keywords: n.keywords,
572
662
  group: r,
573
- activate: () => Rt(e, n.target)
574
- }), Et = (e, t) => {
663
+ activate: () => _t(e, t, n)
664
+ }), zt = (e, t) => {
575
665
  const r = [];
576
666
  for (const n of t) {
577
- const o = u(n.title, n.id);
667
+ const o = f(n.title, n.id);
578
668
  r.push(e.workbench.commandPaletteResources.registerProvider({
579
669
  id: n.id,
580
670
  title: o,
@@ -583,17 +673,17 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
583
673
  query: s,
584
674
  limit: i
585
675
  }) => {
586
- const d = e.workbench.getActiveResource(), c = await k(e, n.queryCommandId, {
676
+ const a = e.workbench.getActiveResource(), d = await P(e, n.queryCommandId, {
587
677
  params: {
588
678
  projectId: e.projectId,
589
679
  modeId: e.workbench.modes.getActiveModeId(),
590
- activeResource: re(d),
680
+ activeResource: H(a),
591
681
  providerId: n.id,
592
682
  query: s,
593
683
  limit: i
594
684
  }
595
685
  });
596
- return vt(c) ? (c.items ?? []).map((b) => Ct(e, n, o, b)) : [];
686
+ return Vt(d) ? (d.items ?? []).map((m) => qt(e, n, o, m)) : [];
597
687
  }
598
688
  }));
599
689
  }
@@ -602,245 +692,394 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
602
692
  for (let n = r.length - 1; n >= 0; n -= 1) r[n]?.dispose();
603
693
  }
604
694
  };
605
- }, _ = (e) => ({
606
- title: u(e.title),
695
+ }, Qt = (e) => e ? (Array.isArray(e) ? e : [e]).map(({
696
+ for: r,
697
+ ...n
698
+ }) => ({
699
+ ...n,
700
+ resourceKind: r
701
+ })) : [], Gt = () => {
702
+ const e = [], t = [], r = [], n = /* @__PURE__ */ new Map(), o = (s, i) => he(() => {
703
+ const a = s.indexOf(i);
704
+ a >= 0 && s.splice(a, 1);
705
+ });
706
+ return {
707
+ registerResourceKind(s) {
708
+ return e.push(s), o(e, s);
709
+ },
710
+ registerPanelCapability(s) {
711
+ return t.push(s), o(t, s);
712
+ },
713
+ registerResourcePanel(s) {
714
+ return r.push(s), o(r, s);
715
+ },
716
+ registerModeComposition(s) {
717
+ return n.set(s.id, s), he(() => {
718
+ n.get(s.id) === s && n.delete(s.id);
719
+ });
720
+ },
721
+ getComposition: () => ({
722
+ resourceKinds: [...e],
723
+ panels: [...t],
724
+ resourcePanels: [...r]
725
+ }),
726
+ getModeComposition: (s) => n.get(s)
727
+ };
728
+ }, Be = (e, t) => {
729
+ const r = {};
730
+ for (const n of de) {
731
+ const o = e.regions[n], s = o.widgets.filter((a) => t.has(a.contributionId)).map((a) => a.contributionId), i = o.widgets.find((a) => a.widgetId === o.activeWidgetId);
732
+ r[n] = {
733
+ order: s,
734
+ activePanelId: i && t.has(i.contributionId) ? i.contributionId : void 0
735
+ };
736
+ }
737
+ return {
738
+ regions: r
739
+ };
740
+ }, Yt = (e) => {
741
+ const t = e.registry.getModeComposition(e.modeId);
742
+ if (!t) return [];
743
+ const r = e.registry.getComposition(), n = new Set(r.panels.map((o) => o.id));
744
+ return je({
745
+ context: {
746
+ modeId: e.modeId,
747
+ resourceKind: e.resourceKind
748
+ },
749
+ mode: t,
750
+ composition: r,
751
+ persisted: Be(e.layout, n)
752
+ }).addablePanels;
753
+ }, ye = (e) => e === "main" ? "location" : "sub-panel", Xt = (e, t) => {
754
+ const r = e.layout.getLayout(), n = de.find((d) => r.regions[d].widgets.some((m) => m.contributionId === t.panelId)), o = () => e.layout.openWidget(t.panelId, {
755
+ region: t.region,
756
+ closable: !t.required,
757
+ pinned: t.pinned,
758
+ role: ye(t.region)
759
+ });
760
+ if (!n) {
761
+ (t.origin === "persisted" || t.origin === "default" || t.required) && o();
762
+ return;
763
+ }
764
+ if (!t.allowedRegions.includes(n)) {
765
+ o();
766
+ return;
767
+ }
768
+ const s = r.regions[n].widgets.find((d) => d.contributionId === t.panelId);
769
+ if (!s) return;
770
+ const i = ye(n), a = !t.required;
771
+ ((s.closable ?? !0) !== a || s.pinned !== t.pinned || s.role !== i) && e.layout.updateWidgetPlacement(s.widgetId, {
772
+ closable: a,
773
+ pinned: t.pinned,
774
+ role: i
775
+ });
776
+ }, Jt = (e, t) => {
777
+ for (const [r, n] of t) {
778
+ if (!n) continue;
779
+ const o = e.layout.getLayout().regions[r];
780
+ o.activeWidgetId !== n && o.widgets.some((s) => s.widgetId === n) && e.layout.setRegionActiveWidget(r, n);
781
+ }
782
+ }, Zt = (e, t, r) => {
783
+ const n = er(t);
784
+ if (!r.requiredFallback) {
785
+ e.notifications.dismiss(n);
786
+ return;
787
+ }
788
+ const o = r.requiredFallback.panelId;
789
+ e.layout.getLayout().regions.main.widgets.some((i) => i.contributionId === o) || e.layout.openWidget(o, {
790
+ region: "main",
791
+ pinned: !0,
792
+ role: "location"
793
+ }), e.notifications.show({
794
+ id: n,
795
+ level: "error",
796
+ title: "A required panel could not be placed",
797
+ message: r.diagnostics.map((i) => i.message).join(" ")
798
+ });
799
+ }, er = (e) => `workbench.composition.required.${e}`, tr = (e, t) => {
800
+ const r = t.registry.getModeComposition(t.modeId);
801
+ if (!r) return;
802
+ const n = t.registry.getComposition(), o = new Set(n.panels.map((m) => m.id)), s = e.layout.getLayout(), i = t.seeding ? void 0 : Be(s, o), a = je({
803
+ context: {
804
+ modeId: t.modeId,
805
+ resourceKind: t.resourceKind
806
+ },
807
+ mode: r,
808
+ composition: n,
809
+ persisted: i
810
+ }), d = new Map(de.map((m) => [m, e.layout.getLayout().regions[m].activeWidgetId]));
811
+ for (const m of a.placements) Xt(e, m);
812
+ return Jt(e, d), e.layout.reconcilePanelMenus(), Zt(e, t.modeId, a), a;
813
+ }, q = (e) => ({
814
+ title: f(e.title),
607
815
  runtimeUrl: e.runtimeUrl,
608
816
  moduleUrl: e.moduleUrl,
609
817
  styles: e.styles,
610
818
  capabilities: e.capabilities
611
- }), D = (e) => e ? {
612
- resourceKinds: e.resourceKinds ? [...e.resourceKinds] : void 0
613
- } : void 0, xt = {
614
- first: 1e6,
615
- default: 0,
616
- last: -1e6
617
- }, A = (e) => ({
618
- priority: xt[e.placement ?? "default"] - (e.declarationIndex ?? 0)
619
- }), $ = (e) => {
819
+ }), rr = (e = 0) => ({
820
+ priority: -e
821
+ }), nr = (e, t) => {
822
+ const r = e.show ? Array.isArray(e.show) ? e.show : [e.show] : [];
823
+ if (r.some((o) => o.for === void 0)) return;
824
+ const n = [...r.flatMap((o) => o.for ? [o.for] : []), ...(t ?? []).filter((o) => o.panel === e.id).map((o) => o.resourceKind)].filter((o, s, i) => i.indexOf(o) === s);
825
+ return n.length > 0 ? n : void 0;
826
+ }, or = (e) => (e.show ? Array.isArray(e.show) ? e.show : [e.show] : [])[0]?.region ?? "main", O = (e) => ({
827
+ id: e.panel.id,
828
+ title: f(e.panel.title, e.panel.id),
829
+ icon: e.panel.icon,
830
+ region: or(e.panel),
831
+ rendererId: e.rendererId,
832
+ singleton: !0,
833
+ resourceKinds: nr(e.panel, e.resourcePanels),
834
+ panelMenus: ar(e.panel.panelMenus, e.menuDeclarationOffset),
835
+ config: e.config,
836
+ ...rr(e.declarationIndex)
837
+ }), K = (e) => {
620
838
  const t = [];
621
839
  let r = 0;
622
840
  for (const n of e)
623
841
  t.push(r), r += n.panelMenus?.length ?? 0;
624
842
  return t;
625
- }, At = (e) => {
626
- const t = e.treeRendererId ?? e.fileRendererId ?? e.controlsRendererId ?? e.dataTableRendererId ?? (e.webview ? K : void 0);
843
+ }, sr = (e) => {
844
+ const t = e.renderer?.id ?? (e.webview ? S : void 0);
627
845
  if (!t) throw new Error(`Panel Menu has no renderer: ${e.id}`);
628
846
  return t;
629
- }, B = (e, t = 0) => e?.map((r, n) => ({
847
+ }, ir = {
848
+ first: 1e6,
849
+ default: 0,
850
+ last: -1e6
851
+ }, ar = (e, t = 0) => e?.map((r, n) => ({
630
852
  id: r.id,
631
- title: u(r.title, r.id),
853
+ title: f(r.title, r.id),
632
854
  side: r.side,
633
- rendererId: At(r),
634
- config: r.webview ? _(r.webview) : void 0,
635
- ...A({
636
- placement: r.placement,
637
- declarationIndex: t + n
638
- })
639
- })), H = (e) => e.workbench.layout.registerPanel(e.contribution), Y = (e, t = "") => u(e, t), Pt = (e) => !!e && typeof e == "object" && !Array.isArray(e), Tt = (e, t, r) => {
640
- const n = (o, s, i) => o ? k(e, o, {
641
- params: s,
642
- resource: i
855
+ rendererId: sr(r),
856
+ config: r.webview ? q(r.webview) : void 0,
857
+ priority: ir[r.placement ?? "default"] - (t + n)
858
+ })), D = (e) => e.workbench.layout.registerPanel(e.contribution), z = (e, t) => e.renderer?.kind === t ? e.renderer.id : void 0, ne = (e, t = "") => f(e, t), dr = (e) => !!e && typeof e == "object" && !Array.isArray(e), cr = (e, t, r) => {
859
+ const n = M({
860
+ id: t.id,
861
+ kind: "renderer",
862
+ projectId: e.projectId,
863
+ context: {
864
+ controlsRendererId: t.id
865
+ }
866
+ }), o = (s, i, a) => s ? P(e, s, {
867
+ params: {
868
+ renderer: {
869
+ rendererId: t.id,
870
+ projectId: e.projectId,
871
+ ...a ? {
872
+ resource: H(a)
873
+ } : {},
874
+ invocation: {
875
+ placement: "visible"
876
+ }
877
+ },
878
+ ...i
879
+ },
880
+ resource: a,
881
+ slot: n,
882
+ metadata: {
883
+ controlsRendererId: t.id
884
+ }
643
885
  }) : Promise.resolve(void 0);
644
886
  return e.workbench.renderers.registerControlsRenderer({
645
887
  id: t.id,
646
- title: Y(t.title, t.id),
647
- emptyTitle: Y(t.emptyTitle, ""),
648
- emptyDescription: Y(t.emptyDescription, ""),
888
+ title: ne(t.title, t.id),
889
+ emptyTitle: ne(t.emptyTitle, ""),
890
+ emptyDescription: ne(t.emptyDescription, ""),
649
891
  defaultValues: t.defaultValues,
650
- executeQuery: async (o) => {
651
- const s = await n(t.queryCommandId, {}, o ?? r.resolveResource?.(t));
652
- return Pt(s) ? s : {};
892
+ executeQuery: async (s) => {
893
+ const i = await o(t.queryHandlerId, {}, s ?? r.resolveResource?.(t));
894
+ return dr(i) ? i : {};
653
895
  },
654
- updateValue: t.updateValueCommandId ? ({
655
- controlId: o,
656
- value: s,
657
- values: i,
896
+ updateValue: t.valueChangeHandlerId ? ({
897
+ controlId: s,
898
+ value: i,
899
+ values: a,
658
900
  resource: d
659
- }) => n(t.updateValueCommandId, {
660
- controlId: o,
661
- value: s,
662
- values: i
901
+ }) => o(t.valueChangeHandlerId, {
902
+ controlId: s,
903
+ value: i,
904
+ values: a
663
905
  }, d).then(() => {
664
906
  }) : void 0,
665
- apply: t.applyCommandId ? ({
666
- values: o,
667
- resource: s
668
- }) => n(t.applyCommandId, {
669
- values: o
670
- }, s).then(() => {
907
+ apply: t.applyHandlerId ? ({
908
+ values: s,
909
+ resource: i
910
+ }) => o(t.applyHandlerId, {
911
+ values: s
912
+ }, i).then(() => {
671
913
  }) : void 0,
672
- reset: t.resetCommandId ? ({
673
- controlIds: o,
674
- resource: s
675
- }) => n(t.resetCommandId, {
676
- controlIds: o
677
- }, s).then(() => {
914
+ reset: t.resetHandlerId ? ({
915
+ controlIds: s,
916
+ resource: i
917
+ }) => o(t.resetHandlerId, {
918
+ controlIds: s
919
+ }, i).then(() => {
678
920
  }) : void 0
679
921
  });
680
- }, St = (e, t, r, n) => {
681
- if (t.controlsRendererId)
682
- return H({
922
+ }, lr = (e, t, r, n, o) => {
923
+ const s = z(t, "controls");
924
+ if (s)
925
+ return D({
683
926
  workbench: e.workbench,
684
- contribution: {
685
- id: t.id,
686
- title: u(t.title, t.id),
687
- icon: t.icon,
688
- region: t.region,
689
- closable: t.closable,
690
- rendererId: t.controlsRendererId,
691
- singleton: !0,
692
- resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
693
- eligibleLocations: D(t.eligibleLocations),
694
- panelMenus: B(t.panelMenus, n),
695
- ...A({
696
- placement: t.placement,
697
- declarationIndex: r
698
- })
699
- }
927
+ contribution: O({
928
+ panel: t,
929
+ rendererId: s,
930
+ declarationIndex: r,
931
+ menuDeclarationOffset: n,
932
+ resourcePanels: o
933
+ })
700
934
  });
701
- }, un = (e, t, r, n = {}) => {
702
- const o = [];
703
- for (const i of t) o.push(Tt(e, i, n));
704
- const s = $(r);
705
- return r.forEach((i, d) => {
706
- const c = St(e, i, d, s[d]);
707
- c && o.push(c);
935
+ }, Xn = (e, t, r, n = {}, o = []) => {
936
+ const s = [];
937
+ for (const a of t) s.push(cr(e, a, n));
938
+ const i = K(r);
939
+ return r.forEach((a, d) => {
940
+ const m = lr(e, a, d, i[d], o);
941
+ m && s.push(m);
708
942
  }), {
709
943
  dispose() {
710
- for (let i = o.length - 1; i >= 0; i -= 1) o[i]?.dispose();
944
+ for (let a = s.length - 1; a >= 0; a -= 1) s[a]?.dispose();
711
945
  }
712
946
  };
713
- }, R = (e, t = "") => u(e, t), we = (e) => ({
947
+ }, A = (e, t = "") => f(e, t), ve = (e) => ({
714
948
  ...e,
715
- label: R(e.label, e.id),
716
- description: e.description ? R(e.description) : void 0,
717
- icon: e.icon ? W(j, {
949
+ label: A(e.label, e.id),
950
+ description: e.description ? A(e.description) : void 0,
951
+ icon: e.icon ? U(V, {
718
952
  name: e.icon,
719
953
  size: 14
720
954
  }) : void 0
721
- }), Wt = (e) => !!(e && typeof e == "object" && Array.isArray(e.rows)), jt = (e) => ({
955
+ }), mr = (e) => !!(e && typeof e == "object" && Array.isArray(e.rows)), ur = (e) => ({
722
956
  id: e.id,
723
957
  values: e.values,
724
- resource: e.resource ? U(e.resource) : void 0
725
- }), Kt = (e, t) => {
726
- const r = M({
958
+ resource: e.resource ? _(e.resource) : void 0
959
+ }), fr = (e, t) => {
960
+ const r = /* @__PURE__ */ new WeakMap(), n = M({
727
961
  id: t.id,
728
962
  kind: "dataTableRenderer",
729
963
  projectId: e.projectId,
730
964
  context: {
731
965
  dataTableRendererId: t.id
732
966
  }
733
- }), n = (o, s, i) => k(e, o, {
734
- params: s,
735
- resource: i,
736
- slot: r,
967
+ }), o = (s, i, a, d) => P(e, s, {
968
+ params: {
969
+ renderer: {
970
+ rendererId: t.id,
971
+ projectId: e.projectId,
972
+ ...d ? {
973
+ modeId: d
974
+ } : {},
975
+ ...a ? {
976
+ resource: H(a)
977
+ } : {},
978
+ invocation: {
979
+ placement: "visible"
980
+ }
981
+ },
982
+ ...i
983
+ },
984
+ resource: a,
985
+ slot: n,
737
986
  metadata: {
738
987
  dataTableRendererId: t.id
739
988
  }
740
989
  });
741
990
  return e.workbench.renderers.registerDataTableRenderer({
742
991
  id: t.id,
743
- title: R(t.title, t.id),
992
+ title: A(t.title, t.id),
744
993
  resourceKind: t.resourceKind,
745
- columns: t.columns?.map(we),
994
+ columns: t.columns?.map(ve),
746
995
  initialPageSize: t.initialPageSize,
747
996
  pageSizeOptions: t.pageSizeOptions,
748
997
  selectionMode: t.selectionMode,
749
- selectionActions: t.selectionActions?.map((o) => ({
750
- id: o.id,
751
- label: R(o.label, o.id),
752
- icon: o.icon ? W(j, {
753
- name: o.icon,
998
+ selectionActions: t.selectionActions?.map((s) => ({
999
+ id: s.id,
1000
+ label: A(s.label, s.id),
1001
+ icon: s.icon ? U(V, {
1002
+ name: s.icon,
754
1003
  size: 16
755
1004
  }) : void 0,
756
- destructive: o.destructive,
757
- run: (s) => n(o.commandId, {
758
- rowIds: s.map((i) => i.id)
1005
+ destructive: s.destructive,
1006
+ run: (i) => o(s.commandId, {
1007
+ rowIds: i.map((a) => a.id)
759
1008
  }).then(() => {
760
1009
  })
761
1010
  })),
762
- emptyTitle: t.emptyTitle ? R(t.emptyTitle) : void 0,
763
- emptyDescription: t.emptyDescription ? R(t.emptyDescription) : void 0,
1011
+ emptyTitle: t.emptyTitle ? A(t.emptyTitle) : void 0,
1012
+ emptyDescription: t.emptyDescription ? A(t.emptyDescription) : void 0,
764
1013
  executeQuery: async ({
765
- resource: o,
766
- modeId: s
1014
+ resource: s,
1015
+ modeId: i
767
1016
  }) => {
768
- const i = await n(t.queryCommandId, {
769
- rendererId: t.id,
770
- projectId: e.projectId,
771
- modeId: s,
772
- resource: o ? {
773
- type: o.kind,
774
- id: o.id ?? o.uri,
775
- label: o.label,
776
- metadata: o.metadata
777
- } : void 0
778
- }, o);
779
- return Wt(i) ? {
780
- rows: i.rows.map(jt),
781
- columns: i.columns?.map(we)
1017
+ const a = await o(t.queryHandlerId, {}, s, i);
1018
+ return mr(a) ? {
1019
+ rows: a.rows.map((m) => {
1020
+ const w = ur(m);
1021
+ return r.set(w, m), w;
1022
+ }),
1023
+ columns: a.columns?.map(ve)
782
1024
  } : {
783
1025
  rows: []
784
1026
  };
785
1027
  },
786
- rowActions: t.rowActions?.map((o) => ({
787
- id: o.id,
788
- label: R(o.label, o.id),
789
- icon: o.icon ? W(j, {
790
- name: o.icon,
1028
+ rowActions: t.rowActions?.map((s) => ({
1029
+ id: s.id,
1030
+ label: A(s.label, s.id),
1031
+ icon: s.icon ? U(V, {
1032
+ name: s.icon,
791
1033
  size: 16
792
1034
  }) : void 0,
793
- destructive: o.destructive,
794
- run: async (s) => {
795
- await n(o.commandId, {
796
- rowId: s.id
797
- }, s.resource), e.workbench.renderers.refreshDataTableRenderer(t.id);
1035
+ destructive: s.destructive,
1036
+ run: async (i) => {
1037
+ await o(s.commandId, {
1038
+ rowId: i.id
1039
+ }, i.resource), e.workbench.renderers.refreshDataTableRenderer(t.id);
798
1040
  }
799
- }))
1041
+ })),
1042
+ onRowActivate: t.rowActivationHandlerId ? async (s) => {
1043
+ const i = await o(t.rowActivationHandlerId, {
1044
+ row: r.get(s) ?? s
1045
+ }, s.resource), a = Fe(i);
1046
+ a && await e.workbench.navigation.openTarget(a);
1047
+ } : void 0
800
1048
  });
801
- }, Mt = (e, t, r, n) => {
802
- if (t.dataTableRendererId)
803
- return H({
1049
+ }, pr = (e, t, r, n, o) => {
1050
+ const s = z(t, "dataTable");
1051
+ if (s)
1052
+ return D({
804
1053
  workbench: e.workbench,
805
- contribution: {
806
- id: t.id,
807
- title: u(t.title, t.id),
808
- icon: t.icon,
809
- region: t.region,
810
- closable: t.closable,
811
- rendererId: t.dataTableRendererId,
812
- singleton: !0,
813
- resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
814
- eligibleLocations: D(t.eligibleLocations),
815
- panelMenus: B(t.panelMenus, n),
816
- ...A({
817
- placement: t.placement,
818
- declarationIndex: r
819
- })
820
- }
1054
+ contribution: O({
1055
+ panel: t,
1056
+ rendererId: s,
1057
+ declarationIndex: r,
1058
+ menuDeclarationOffset: n,
1059
+ resourcePanels: o
1060
+ })
821
1061
  });
822
- }, Dt = (e, t, r) => {
823
- const n = t.map((s) => Kt(e, s)), o = $(r);
824
- return r.forEach((s, i) => {
825
- const d = Mt(e, s, i, o[i]);
826
- d && n.push(d);
1062
+ }, br = (e, t, r, n = []) => {
1063
+ const o = t.map((i) => fr(e, i)), s = K(r);
1064
+ return r.forEach((i, a) => {
1065
+ const d = pr(e, i, a, s[a], n);
1066
+ d && o.push(d);
827
1067
  }), {
828
1068
  dispose() {
829
- for (let s = n.length - 1; s >= 0; s -= 1) n[s]?.dispose();
1069
+ for (let i = o.length - 1; i >= 0; i -= 1) o[i]?.dispose();
830
1070
  }
831
1071
  };
832
- }, $t = {
1072
+ }, hr = {
833
1073
  first: 0,
834
1074
  default: 1,
835
1075
  last: 2
836
- }, bn = {
1076
+ }, Jn = {
837
1077
  commands: [],
838
1078
  commandPaletteContributions: [],
839
1079
  diagnostics: [],
840
1080
  extensions: [],
841
1081
  menuContributions: [],
842
1082
  modes: [],
843
- navigation: [],
844
1083
  routes: [],
845
1084
  kanbanRenderers: [],
846
1085
  dataTableRenderers: [],
@@ -850,7 +1089,7 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
850
1089
  settingsDefinitions: [],
851
1090
  treeItems: [],
852
1091
  panels: []
853
- }, Bt = (e) => `workbench.extension.menu.${e.id}`, Ht = (e) => `workbench.extension.palette.${e.id}`, We = (e, t) => $t[e.placement ?? "default"] * 1e3 + t, je = (e) => e === void 0 ? "" : qe(e) ? e.default ?? e.$l10n : e, Lt = (e) => {
1092
+ }, gr = (e) => `workbench.extension.menu.${e.id}`, wr = (e) => `workbench.extension.palette.${e.id}`, Ne = (e, t) => hr[e.placement ?? "default"] * 1e3 + t, Ue = (e) => e === void 0 ? "" : it(e) ? e.default ?? e.$l10n : e, Ir = (e) => {
854
1093
  const {
855
1094
  commandId: t,
856
1095
  contribution: r,
@@ -865,11 +1104,12 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
865
1104
  label: o(r.label, r.extensionId),
866
1105
  icon: r.icon,
867
1106
  group: s.group ?? r.group,
1107
+ args: r.params,
868
1108
  overflowLabel: s.overflowLabel,
869
- order: We(r, n),
1109
+ order: Ne(r, n),
870
1110
  when: i
871
1111
  };
872
- }, Ot = (e) => {
1112
+ }, yr = (e) => {
873
1113
  const {
874
1114
  commandId: t,
875
1115
  contribution: r,
@@ -881,63 +1121,64 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
881
1121
  label: o(r.label, r.extensionId),
882
1122
  icon: r.icon,
883
1123
  group: r.group,
884
- order: We(r, n)
1124
+ args: r.params,
1125
+ order: Ne(r, n)
885
1126
  };
886
- }, Vt = (e) => {
1127
+ }, vr = (e) => {
887
1128
  const {
888
- createCommandId: t = Bt,
1129
+ createCommandId: t = gr,
889
1130
  createWhenExpression: r,
890
1131
  menuSlotsById: n,
891
1132
  menuTargetsById: o,
892
1133
  metadata: s,
893
- resolveString: i = je
894
- } = e, d = [];
895
- return s.menuContributions.forEach((c, b) => {
896
- const a = c.target ? o?.get(c.target) : n.get(c.slotId);
897
- if (!a) return;
898
- const l = t(c), m = s.commands.find((f) => f.id === c.commandId);
899
- d.push({
1134
+ resolveString: i = Ue
1135
+ } = e, a = [];
1136
+ return s.menuContributions.forEach((d, m) => {
1137
+ const w = d.target ? o?.get(d.target) : n.get(d.slotId);
1138
+ if (!w) return;
1139
+ const l = t(d), u = s.commands.find((c) => c.id === d.commandId);
1140
+ a.push({
900
1141
  command: {
901
1142
  id: l,
902
- label: i(c.label, c.extensionId),
903
- category: c.group,
904
- description: m ? i(m.description, m.extensionId) : void 0,
905
- icon: c.icon,
906
- params: m?.params
1143
+ label: i(d.label, d.extensionId),
1144
+ category: d.group,
1145
+ description: u ? i(u.description, u.extensionId) : void 0,
1146
+ icon: d.icon,
1147
+ params: u?.params
907
1148
  },
908
- contribution: c,
909
- menuItem: Lt({
1149
+ contribution: d,
1150
+ menuItem: Ir({
910
1151
  commandId: l,
911
- contribution: c,
912
- index: b,
1152
+ contribution: d,
1153
+ index: m,
913
1154
  resolveString: i,
914
- slot: a,
915
- when: r?.(c)
1155
+ slot: w,
1156
+ when: r?.(d)
916
1157
  }),
917
- menuPath: a.menuPath,
918
- targetCommandId: c.commandId
1158
+ menuPath: w.menuPath,
1159
+ targetCommandId: d.commandId
919
1160
  });
920
- }), d;
921
- }, Ft = (e) => {
1161
+ }), a;
1162
+ }, kr = (e) => {
922
1163
  const {
923
- createCommandId: t = Ht,
1164
+ createCommandId: t = wr,
924
1165
  metadata: r,
925
- resolveString: n = je
1166
+ resolveString: n = Ue
926
1167
  } = e, o = [];
927
1168
  return (r.commandPaletteContributions ?? []).forEach((s, i) => {
928
- const d = t(s), c = r.commands.find((b) => b.id === s.commandId);
1169
+ const a = t(s), d = r.commands.find((m) => m.id === s.commandId);
929
1170
  o.push({
930
1171
  command: {
931
- id: d,
1172
+ id: a,
932
1173
  label: n(s.label, s.extensionId),
933
1174
  category: s.group,
934
- description: c ? n(c.description, c.extensionId) : void 0,
1175
+ description: d ? n(d.description, d.extensionId) : void 0,
935
1176
  icon: s.icon,
936
- params: c?.params
1177
+ params: d?.params
937
1178
  },
938
1179
  contribution: s,
939
- menuItem: Ot({
940
- commandId: d,
1180
+ menuItem: yr({
1181
+ commandId: a,
941
1182
  contribution: s,
942
1183
  index: i,
943
1184
  resolveString: n
@@ -945,7 +1186,7 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
945
1186
  targetCommandId: s.commandId
946
1187
  });
947
1188
  }), o;
948
- }, fn = (e) => {
1189
+ }, Zn = (e) => {
949
1190
  const {
950
1191
  createResource: t,
951
1192
  metadata: r
@@ -955,7 +1196,7 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
955
1196
  route: n
956
1197
  })
957
1198
  })) : [];
958
- }, Nt = (e) => {
1199
+ }, Rr = (e) => {
959
1200
  if (e)
960
1201
  return {
961
1202
  type: e.kind,
@@ -963,7 +1204,7 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
963
1204
  label: e.label,
964
1205
  metadata: e.metadata
965
1206
  };
966
- }, Ut = (e) => ({
1207
+ }, Cr = (e) => ({
967
1208
  id: e.rendererId,
968
1209
  kind: "renderer",
969
1210
  context: {
@@ -973,68 +1214,105 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
973
1214
  resourceId: e.resource.id
974
1215
  } : {}
975
1216
  }
976
- }), ge = async (e, t, r, n, o = {}) => {
977
- const s = Nt(n), i = await e.executeCommand(r, {
1217
+ }), ke = async (e, t, r, n, o = {}, s) => {
1218
+ const i = Rr(n), a = await e.executeCommand(r, {
978
1219
  projectId: e.projectId,
979
1220
  params: {
980
- projectId: e.projectId,
981
- resource: s,
1221
+ renderer: {
1222
+ rendererId: t,
1223
+ projectId: e.projectId,
1224
+ ...i ? {
1225
+ resource: i
1226
+ } : {},
1227
+ invocation: {
1228
+ placement: "visible"
1229
+ }
1230
+ },
982
1231
  ...o
983
1232
  },
984
- resource: s,
985
- slot: Ut({
1233
+ resource: i,
1234
+ slot: Cr({
986
1235
  projectId: e.projectId,
987
1236
  rendererId: t,
988
- resource: s
1237
+ resource: i
989
1238
  }),
990
- source: "dashboard"
1239
+ source: "dashboard",
1240
+ ...s ? {
1241
+ metadata: s
1242
+ } : {}
991
1243
  });
992
- return N(i);
993
- }, _t = (e, t) => e.workbench.renderers.registerFileRenderer({
1244
+ return X(a);
1245
+ }, Ve = (e) => {
1246
+ if (!e || typeof e != "object") return;
1247
+ const t = e.revision;
1248
+ return typeof t == "string" ? t : void 0;
1249
+ }, eo = (e, t) => {
1250
+ const r = e.metadata, n = r?.fileRendererOrigin;
1251
+ if (!n || typeof n != "object") return;
1252
+ const o = n;
1253
+ if (typeof o.rendererId != "string" || typeof o.instanceId != "string" || typeof o.operationId != "string")
1254
+ return;
1255
+ const s = r?.fileRendererResourceUri, i = Ve(t.outcome.value);
1256
+ return {
1257
+ origin: {
1258
+ rendererId: o.rendererId,
1259
+ instanceId: o.instanceId,
1260
+ operationId: o.operationId
1261
+ },
1262
+ ...typeof s == "string" ? {
1263
+ resourceUri: s
1264
+ } : {},
1265
+ ...i ? {
1266
+ revision: i
1267
+ } : {}
1268
+ };
1269
+ }, Er = (e, t) => e.workbench.renderers.registerFileRenderer({
994
1270
  id: t.id,
995
- title: u(t.title, t.id),
1271
+ title: f(t.title, t.id),
996
1272
  resourceKind: t.resourceKind,
997
- load: async (r) => await ge(e, t.id, t.loadCommandId, r) ?? {},
998
- save: t.saveCommandId ? async (r, n) => {
999
- await ge(e, t.id, t.saveCommandId, r, {
1273
+ load: async (r) => await ke(e, t.id, t.loadHandlerId, r) ?? {},
1274
+ save: t.saveHandlerId ? async (r, n, o) => {
1275
+ const s = await ke(e, t.id, t.saveHandlerId, r, {
1000
1276
  content: n
1001
- });
1277
+ }, {
1278
+ ...o ? {
1279
+ fileRendererOrigin: o
1280
+ } : {},
1281
+ ...r?.uri ? {
1282
+ fileRendererResourceUri: r.uri
1283
+ } : {}
1284
+ }), i = Ve(s);
1285
+ return i ? {
1286
+ revision: i
1287
+ } : void 0;
1002
1288
  } : void 0
1003
- }), qt = (e, t, r, n) => {
1004
- if (t.fileRendererId)
1005
- return H({
1289
+ }), Pr = (e, t, r, n) => {
1290
+ const o = z(t, "file");
1291
+ if (o)
1292
+ return D({
1006
1293
  workbench: e.workbench,
1007
- contribution: {
1008
- id: t.id,
1009
- title: u(t.title, t.id),
1010
- icon: t.icon,
1011
- region: t.region,
1012
- closable: t.closable,
1013
- rendererId: t.fileRendererId,
1014
- singleton: !0,
1015
- resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
1016
- eligibleLocations: D(t.eligibleLocations),
1017
- panelMenus: B(t.panelMenus, n),
1018
- ...A({
1019
- placement: t.placement,
1020
- declarationIndex: r
1021
- })
1022
- }
1294
+ contribution: O({
1295
+ panel: t,
1296
+ rendererId: o,
1297
+ declarationIndex: r,
1298
+ menuDeclarationOffset: n,
1299
+ resourcePanels: e.metadata.resourcePanels
1300
+ })
1023
1301
  });
1024
- }, zt = (e) => {
1302
+ }, Ar = (e) => {
1025
1303
  const t = [];
1026
1304
  for (const n of e.metadata.fileRenderers ?? [])
1027
- t.push(_t(e, n));
1028
- const r = $(e.metadata.panels);
1305
+ t.push(Er(e, n));
1306
+ const r = K(e.metadata.panels);
1029
1307
  return e.metadata.panels.forEach((n, o) => {
1030
- const s = qt(e, n, o, r[o]);
1308
+ const s = Pr(e, n, o, r[o]);
1031
1309
  s && t.push(s);
1032
1310
  }), {
1033
1311
  dispose() {
1034
1312
  for (let n = t.length - 1; n >= 0; n -= 1) t[n]?.dispose();
1035
1313
  }
1036
1314
  };
1037
- }, Qt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Ie = (e, t, r, n) => (t ?? []).map((o) => {
1315
+ }, xr = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Re = (e, t, r, n) => (t ?? []).map((o) => {
1038
1316
  const s = {
1039
1317
  ...o,
1040
1318
  label: r(o.label, o.id),
@@ -1047,8 +1325,8 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1047
1325
  } : o.type
1048
1326
  };
1049
1327
  return n(e, s);
1050
- }), Gt = (e, t, r, n) => {
1051
- let o = Ie(e, t, r, n);
1328
+ }), Tr = (e, t, r, n) => {
1329
+ let o = Re(e, t, r, n);
1052
1330
  const s = /* @__PURE__ */ new Set();
1053
1331
  return {
1054
1332
  source: {
@@ -1056,34 +1334,34 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1056
1334
  subscribe: (i) => (s.add(i), () => s.delete(i))
1057
1335
  },
1058
1336
  set(i) {
1059
- o = Ie(e, i, r, n);
1060
- for (const d of s) d();
1337
+ o = Re(e, i, r, n);
1338
+ for (const a of s) a();
1061
1339
  }
1062
1340
  };
1063
- }, Yt = (e) => !!(e && typeof e == "object" && typeof e.kind == "string"), Xt = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), Jt = (e, t) => `pstdio://extension-resource/${encodeURIComponent(e)}/${encodeURIComponent(t)}`, Ke = (e, t) => {
1341
+ }, Wr = (e) => !!(e && typeof e == "object" && typeof e.kind == "string"), jr = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), Sr = (e, t) => `pstdio://extension-resource/${encodeURIComponent(e)}/${encodeURIComponent(t)}`, Le = (e, t) => {
1064
1342
  const {
1065
1343
  resource: r
1066
1344
  } = t;
1067
- if (Yt(r)) return r;
1068
- if (Xt(r)) return U(r);
1069
- }, Zt = (e, t) => {
1070
- const r = Ke(e, t);
1345
+ if (Wr(r)) return r;
1346
+ if (jr(r)) return _(r);
1347
+ }, Hr = (e, t) => {
1348
+ const r = Le(e, t);
1071
1349
  if (r) return r;
1072
1350
  if (e.resourceKind)
1073
1351
  return {
1074
1352
  kind: e.resourceKind,
1075
- uri: Jt(e.resourceKind, t.id),
1353
+ uri: Sr(e.resourceKind, t.id),
1076
1354
  id: t.id,
1077
1355
  label: t.title
1078
1356
  };
1079
- }, ye = (e, t) => {
1357
+ }, Ce = (e, t) => {
1080
1358
  const r = e, n = t(r);
1081
1359
  return n === void 0 ? r : {
1082
1360
  ...r,
1083
1361
  resource: n
1084
1362
  };
1085
- }, Me = (...e) => Object.assign({}, ...e.filter((t) => !!t)), er = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, tr = (e) => Object.keys(e ?? {}).length > 0, rr = /* @__PURE__ */ new Set(["text", "longtext", "markdown", "number", "boolean", "select", "multi-select", "files"]), nr = (e, t, r) => {
1086
- if (!rr.has(t.type)) return;
1363
+ }, _e = (...e) => Object.assign({}, ...e.filter((t) => !!t)), Mr = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, Or = (e) => Object.keys(e ?? {}).length > 0, Kr = /* @__PURE__ */ new Set(["text", "longtext", "markdown", "number", "boolean", "select", "multi-select", "files"]), Dr = (e, t, r) => {
1364
+ if (!Kr.has(t.type)) return;
1087
1365
  const n = "options" in t && Array.isArray(t.options) ? t.options : [], o = t;
1088
1366
  return {
1089
1367
  id: e,
@@ -1101,51 +1379,66 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1101
1379
  multiple: t.type === "files" ? o.multiple !== !1 : void 0,
1102
1380
  accept: t.type === "files" && typeof o.accept == "string" ? o.accept : void 0
1103
1381
  };
1104
- }, or = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([r, n]) => {
1105
- const o = nr(r, n, t);
1382
+ }, $r = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([r, n]) => {
1383
+ const o = Dr(r, n, t);
1106
1384
  return o ? [o] : [];
1107
- }), sr = (e, t) => M({
1385
+ }), Fr = (e, t) => M({
1108
1386
  id: t.id,
1109
1387
  kind: "kanbanRenderer",
1110
1388
  projectId: e.projectId,
1111
1389
  context: {
1112
1390
  kanbanRendererId: t.id
1113
1391
  }
1114
- }), F = (e, t, r, n, o) => k(e, r, {
1115
- params: n,
1116
- resource: o ?? e.workbench.getPrimaryResource(),
1117
- slot: sr(e, t),
1118
- metadata: {
1119
- kanbanRendererId: t.id
1120
- }
1121
- }), De = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, ir = (e, t, r) => (t.rowActions ?? []).map((n) => {
1392
+ }), L = (e, t, r, n, o) => {
1393
+ const s = o ?? e.workbench.getPrimaryResource();
1394
+ return P(e, r, {
1395
+ params: {
1396
+ renderer: {
1397
+ rendererId: t.id,
1398
+ projectId: e.projectId,
1399
+ ...s ? {
1400
+ resource: H(s)
1401
+ } : {},
1402
+ invocation: {
1403
+ placement: "visible"
1404
+ }
1405
+ },
1406
+ ...n
1407
+ },
1408
+ resource: s,
1409
+ slot: Fr(e, t),
1410
+ metadata: {
1411
+ kanbanRendererId: t.id
1412
+ }
1413
+ });
1414
+ }, qe = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, Br = (e, t, r) => (t.rowActions ?? []).map((n) => {
1122
1415
  const o = e.workbench.commands.getCommand(n.commandId)?.command;
1123
1416
  return e.workbench.commands.registerCommand({
1124
- id: De(t, n),
1417
+ id: qe(t, n),
1125
1418
  label: r(n.label, n.id),
1126
1419
  icon: n.icon,
1127
1420
  params: o?.params
1128
1421
  }, {
1129
- execute: (s, i) => F(e, t, n.commandId, Me(er(s)), i?.resource)
1422
+ execute: (s, i) => L(e, t, n.commandId, _e(Mr(s)), i?.resource)
1130
1423
  });
1131
- }), ar = (e, t, r, n, o, s) => {
1132
- const i = De(t, r), d = e.workbench.commands.getCommand(i), c = {
1424
+ }), Nr = (e, t, r, n, o, s) => {
1425
+ const i = qe(t, r), a = e.workbench.commands.getCommand(i), d = {
1133
1426
  rowId: n.id
1134
- }, b = o ? {
1427
+ }, m = o ? {
1135
1428
  resource: o
1136
- } : void 0, a = s(r.label, r.id);
1137
- return d && tr(d.command.params) ? (e.workbench.commandPalette.requestParams({
1138
- record: d,
1139
- label: a,
1140
- args: c,
1141
- context: b
1142
- }), Promise.resolve()) : d ? e.workbench.commands.executeCommand(d.command.id, c, b).then(() => {
1143
- }) : F(e, t, r.commandId, c, o).then(() => {
1429
+ } : void 0, w = s(r.label, r.id);
1430
+ return a && Or(a.command.params) ? (e.workbench.commandPalette.requestParams({
1431
+ record: a,
1432
+ label: w,
1433
+ args: d,
1434
+ context: m
1435
+ }), Promise.resolve()) : a ? e.workbench.commands.executeCommand(a.command.id, d, m).then(() => {
1436
+ }) : L(e, t, r.commandId, d, o).then(() => {
1144
1437
  });
1145
- }, dr = (e) => (r) => W(j, {
1438
+ }, Ur = (e) => (r) => U(V, {
1146
1439
  name: e ?? "MoreHorizontal",
1147
1440
  ...r
1148
- }), cr = (e, t) => ({
1441
+ }), Vr = (e, t) => ({
1149
1442
  color: e?.color,
1150
1443
  canDragIn: e?.canDragIn,
1151
1444
  canDragOut: e?.canDragOut,
@@ -1153,17 +1446,17 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1153
1446
  actions: e?.actions?.map((r) => ({
1154
1447
  id: r.id,
1155
1448
  label: t(r.label, r.id),
1156
- icon: dr(r.icon)
1449
+ icon: Ur(r.icon)
1157
1450
  }))
1158
- }), lr = (e) => e ? W(j, {
1451
+ }), Lr = (e) => e ? U(V, {
1159
1452
  name: e,
1160
1453
  size: 16
1161
- }) : void 0, mr = (e, t) => {
1454
+ }) : void 0, _r = (e, t) => {
1162
1455
  if (e.createRow)
1163
1456
  return {
1164
1457
  title: t(e.createRow.title, "Create row"),
1165
1458
  submitLabel: t(e.createRow.submitLabel, "Create"),
1166
- fields: or(e, t),
1459
+ fields: $r(e, t),
1167
1460
  labels: {
1168
1461
  cancel: t(e.createRow.labels?.cancel, "Cancel"),
1169
1462
  properties: t(e.createRow.labels?.properties, "Properties"),
@@ -1171,18 +1464,27 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1171
1464
  removeFile: t(e.createRow.labels?.removeFile, "Remove file")
1172
1465
  }
1173
1466
  };
1174
- }, ur = (e, t, r) => {
1175
- if (t.onRowClick)
1176
- return (n) => t.onRowClick?.({
1177
- record: e,
1178
- row: n,
1179
- resource: r(e, n)
1467
+ }, qr = (e, t, r, n, o) => {
1468
+ if (t.rowActivationHandlerId)
1469
+ return async (s) => {
1470
+ const i = n(t, s), a = await L(e, t, t.rowActivationHandlerId, {
1471
+ row: o(s)
1472
+ }, i), d = Fe(a, {
1473
+ resourceOf: r.resolveNavigationResource ? (m) => r.resolveNavigationResource(t, m) : void 0
1474
+ });
1475
+ d && await e.workbench.navigation.openTarget(d);
1476
+ };
1477
+ if (r.onRowClick)
1478
+ return (s) => r.onRowClick?.({
1479
+ record: t,
1480
+ row: s,
1481
+ resource: n(t, s)
1180
1482
  });
1181
- }, br = (e, t, r) => {
1483
+ }, zr = (e, t, r) => {
1182
1484
  const n = e.createRow;
1183
1485
  if (n)
1184
1486
  return async (o) => {
1185
- const s = Me(o.values, n.columnParam ? {
1487
+ const s = _e(o.values, n.columnParam ? {
1186
1488
  [n.columnParam]: o.columnId
1187
1489
  } : void 0, n.attributesParam ? {
1188
1490
  [n.attributesParam]: o.attributeValues
@@ -1193,144 +1495,148 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1193
1495
  submission: o
1194
1496
  });
1195
1497
  };
1196
- }, fr = (e, t, r, n, o) => {
1498
+ }, Qr = (e, t, r, n, o) => {
1197
1499
  const s = t.rowActions;
1198
1500
  if (s?.length)
1199
- return (i) => s.map((d) => {
1200
- const c = o(t, i), b = () => ar(e, t, d, i, c, n);
1501
+ return (i) => s.map((a) => {
1502
+ const d = o(t, i), m = () => Nr(e, t, a, i, d, n);
1201
1503
  return {
1202
- key: d.id,
1203
- label: n(d.label, d.id),
1204
- commandId: d.commandId,
1205
- icon: lr(d.icon),
1504
+ key: a.id,
1505
+ label: n(a.label, a.id),
1506
+ commandId: a.commandId,
1507
+ icon: Lr(a.icon),
1206
1508
  onClick: () => r.executeRowAction ? r.executeRowAction({
1207
1509
  record: t,
1208
- action: d,
1510
+ action: a,
1209
1511
  row: i,
1210
- resource: c,
1211
- runDefault: b
1212
- }) : b()
1512
+ resource: d,
1513
+ runDefault: m
1514
+ }) : m()
1213
1515
  };
1214
1516
  });
1215
- }, pr = (e, t, r = {}) => {
1216
- const n = [], o = r.resolveLabel ?? ((a, l) => u(a, l)), s = r.decorateAttribute ?? ((a, l) => l), i = r.resolveRowResource ?? Ke, d = r.resolveRowActionResource ?? Zt, c = r.onAfterMutation ?? (() => {
1217
- }), b = (a, l, m) => F(e, a, l, m).then((f) => (c(a), f));
1218
- for (const a of t) {
1219
- const l = Gt(a, a.attributes, o, s);
1220
- let m;
1221
- const f = (p) => i(a, p);
1222
- n.push(...ir(e, a, o)), n.push(e.workbench.renderers.registerKanbanRenderer({
1223
- id: a.id,
1224
- title: o(a.title, a.id),
1225
- resourceKind: a.resourceKind,
1226
- attributes: l.source,
1227
- defaultSettings: a.defaultSettings,
1228
- defaultFilters: a.defaultFilters,
1229
- defaultViews: a.defaultViews?.map((p) => ({
1230
- ...p,
1231
- title: o(p.title, p.id)
1517
+ }, Gr = (e, t, r = {}, n = [], o = []) => {
1518
+ const s = [], i = r.resolveLabel ?? ((c, p) => f(c, p)), a = r.decorateAttribute ?? ((c, p) => p), d = r.resolveRowResource ?? Le, m = r.resolveRowActionResource ?? Hr, w = r.onAfterMutation ?? (() => {
1519
+ }), l = (c, p, h) => L(e, c, p, h).then((k) => (w(c), k));
1520
+ for (const c of t) {
1521
+ const p = Tr(c, c.attributes, i, a), h = /* @__PURE__ */ new WeakMap();
1522
+ let k;
1523
+ const $ = (b) => d(c, b), Q = (b) => h.get(b) ?? b;
1524
+ s.push(...Br(e, c, i)), s.push(e.workbench.renderers.registerKanbanRenderer({
1525
+ id: c.id,
1526
+ title: i(c.title, c.id),
1527
+ resourceKind: c.resourceKind,
1528
+ storageScope: e.projectId,
1529
+ attributes: p.source,
1530
+ defaultSettings: c.defaultSettings,
1531
+ defaultFilters: c.defaultFilters,
1532
+ defaultViews: c.defaultViews?.map((b) => ({
1533
+ ...b,
1534
+ title: i(b.title, b.id)
1232
1535
  })),
1233
- defaultActiveViewId: a.defaultActiveViewId,
1234
- emptyTitle: o(a.emptyTitle, ""),
1235
- emptyDescription: o(a.emptyDescription, ""),
1236
- hideToolbar: a.hideToolbar,
1237
- createRow: mr(a, o),
1238
- getBoardColumnConfig: (p) => cr(m?.[p], o),
1239
- onRowClick: ur(a, r, i),
1240
- executeQuery: async (p) => {
1241
- const w = await F(e, a, a.queryCommandId, {
1242
- settings: p.settings,
1243
- filters: p.filters
1536
+ defaultActiveViewId: c.defaultActiveViewId,
1537
+ emptyTitle: i(c.emptyTitle, ""),
1538
+ emptyDescription: i(c.emptyDescription, ""),
1539
+ hideToolbar: c.hideToolbar,
1540
+ createRow: _r(c, i),
1541
+ getBoardColumnConfig: (b) => Vr(k?.[b], i),
1542
+ onRowActivate: qr(e, c, r, d, Q),
1543
+ executeQuery: async (b) => {
1544
+ const I = await L(e, c, c.queryHandlerId, {
1545
+ settings: b.settings,
1546
+ filters: b.filters
1244
1547
  });
1245
- return Array.isArray(w) ? w.map((v) => ye(v, f)) : Qt(w) ? (l.set(w.attributes), m = w.boardColumnConfigs, (w.rows ?? []).map((v) => ye(v, f))) : [];
1548
+ return Array.isArray(I) ? I.map((R) => {
1549
+ const E = Ce(R, $);
1550
+ return h.set(E, R), E;
1551
+ }) : xr(I) ? (p.set(I.attributes), k = I.boardColumnConfigs, (I.rows ?? []).map((R) => {
1552
+ const E = Ce(R, $);
1553
+ return h.set(E, R), E;
1554
+ })) : [];
1246
1555
  },
1247
- onAttributeChange: a.updateAttributeCommandId ? (p, w, v) => b(a, a.updateAttributeCommandId, {
1248
- rowId: p,
1249
- attributeId: w,
1250
- value: v
1556
+ onAttributeChange: c.attributeChangeHandlerId ? (b, I, R) => l(c, c.attributeChangeHandlerId, {
1557
+ rowId: b,
1558
+ attributeId: I,
1559
+ value: R
1251
1560
  }).then(() => {
1252
1561
  }) : void 0,
1253
- onReorder: a.reorderCommandId ? (p, w) => b(a, a.reorderCommandId, {
1254
- rowId: p,
1255
- beforeRowId: w
1562
+ onReorder: c.reorderHandlerId ? (b, I) => l(c, c.reorderHandlerId, {
1563
+ rowId: b,
1564
+ beforeRowId: I
1256
1565
  }).then(() => {
1257
1566
  }) : void 0,
1258
- onCreateRow: br(a, r, b),
1259
- onColumnAction: a.columnActionCommandId ? async (p, w) => {
1260
- await b(a, a.columnActionCommandId, {
1261
- columnId: p,
1262
- actionId: w
1567
+ onCreateRow: zr(c, r, l),
1568
+ onColumnAction: c.columnActionHandlerId ? async (b, I) => {
1569
+ await l(c, c.columnActionHandlerId, {
1570
+ columnId: b,
1571
+ actionId: I
1263
1572
  });
1264
1573
  } : void 0,
1265
- getRowContextMenuActions: fr(e, a, r, o, d)
1266
- })), n.push(e.workbench.layout.registerPanel({
1267
- closable: !1,
1268
- id: a.id,
1269
- title: o(a.title, a.id),
1270
- region: "main",
1271
- rendererId: a.id,
1272
- singleton: !0,
1273
- resourceKinds: a.resourceKind ? [a.resourceKind] : void 0
1574
+ getRowContextMenuActions: Qr(e, c, r, i, m)
1274
1575
  }));
1275
1576
  }
1276
- return {
1577
+ const u = K(n);
1578
+ return n.forEach((c, p) => {
1579
+ const h = z(c, "kanban");
1580
+ h && s.push(D({
1581
+ workbench: e.workbench,
1582
+ contribution: O({
1583
+ panel: c,
1584
+ rendererId: h,
1585
+ declarationIndex: p,
1586
+ menuDeclarationOffset: u[p],
1587
+ resourcePanels: o
1588
+ })
1589
+ }));
1590
+ }), {
1277
1591
  dispose() {
1278
- for (let a = n.length - 1; a >= 0; a -= 1) n[a]?.dispose();
1592
+ for (let c = s.length - 1; c >= 0; c -= 1) s[c]?.dispose();
1279
1593
  }
1280
1594
  };
1281
- }, hr = (e, t) => {
1595
+ }, Yr = (e, t) => {
1282
1596
  if (e)
1283
1597
  return Object.fromEntries(Object.entries(e).map(([r, n]) => [r, {
1284
1598
  ...n,
1285
1599
  label: n.label === void 0 ? void 0 : t(n.label, r),
1286
1600
  description: n.description === void 0 ? void 0 : t(n.description)
1287
1601
  }]));
1288
- }, wr = (e, t) => e.panels.flatMap((r) => [r, ...r.panelMenus ?? []]).filter((r) => r.treeRendererId === t.id), $e = (e, t) => t.viewId ? e.find((r) => r.id === t.viewId) : e.length === 1 ? e[0] : void 0, gr = async (e) => {
1602
+ }, Xr = (e, t) => e.panels.flatMap((r) => [r, ...r.panelMenus ?? []]).filter((r) => r.renderer?.kind === "tree" && r.renderer.id === t.id), ze = (e, t) => t.viewId ? e.find((r) => r.id === t.viewId) : e.length === 1 ? e[0] : void 0, Jr = async (e) => {
1289
1603
  const {
1290
1604
  ctx: t,
1291
1605
  getHostTreeHeaderNodes: r,
1292
1606
  record: n,
1293
1607
  treeViews: o
1294
- } = e, s = $e(o, t);
1608
+ } = e, s = ze(o, t);
1295
1609
  return !s || !("hostTreeHeader" in s) || s.hostTreeHeader !== "default" ? [] : await r?.({
1296
1610
  ctx: t,
1297
1611
  record: n,
1298
1612
  panel: s
1299
1613
  }) ?? [];
1300
- }, Ir = async (e) => {
1614
+ }, Zr = async (e) => {
1301
1615
  const {
1302
1616
  ctx: t,
1303
1617
  getHostTreeFooterNodes: r,
1304
1618
  record: n,
1305
1619
  treeViews: o
1306
- } = e, s = $e(o, t);
1620
+ } = e, s = ze(o, t);
1307
1621
  return !s || !("hostTreeFooter" in s) || s.hostTreeFooter !== "default" ? [] : await r?.({
1308
1622
  ctx: t,
1309
1623
  record: n,
1310
1624
  panel: s
1311
1625
  }) ?? [];
1312
- }, yr = (e, t, r, n) => {
1313
- if (t.treeRendererId)
1314
- return H({
1626
+ }, en = (e, t, r, n) => {
1627
+ const o = z(t, "tree");
1628
+ if (o)
1629
+ return D({
1315
1630
  workbench: e.workbench,
1316
- contribution: {
1317
- id: t.id,
1318
- title: u(t.title, t.id),
1319
- icon: t.icon,
1320
- region: t.region,
1321
- closable: t.closable,
1322
- rendererId: t.treeRendererId,
1323
- singleton: !0,
1324
- resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
1325
- eligibleLocations: D(t.eligibleLocations),
1326
- panelMenus: B(t.panelMenus, n),
1327
- ...A({
1328
- placement: t.placement,
1329
- declarationIndex: r
1330
- })
1331
- }
1631
+ contribution: O({
1632
+ panel: t,
1633
+ rendererId: o,
1634
+ declarationIndex: r,
1635
+ menuDeclarationOffset: n,
1636
+ resourcePanels: e.resourcePanels
1637
+ })
1332
1638
  });
1333
- }, Z = (e) => {
1639
+ }, ie = (e) => {
1334
1640
  if (e)
1335
1641
  return {
1336
1642
  type: e.kind,
@@ -1338,13 +1644,16 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1338
1644
  label: e.label,
1339
1645
  metadata: e.metadata
1340
1646
  };
1341
- }, ve = (e) => ({
1647
+ }, tn = (e) => typeof e == "string" ? e : e?.id, rn = (e, t) => ({
1342
1648
  kind: e.type,
1343
1649
  uri: `pstdio://extension-resource/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}`,
1344
1650
  id: e.id,
1345
1651
  label: e.label,
1346
- metadata: e.metadata
1347
- }), Be = (e) => ({
1652
+ metadata: t ? {
1653
+ ...e.metadata,
1654
+ [ae]: t
1655
+ } : e.metadata
1656
+ }), Qe = (e) => ({
1348
1657
  id: e.treeId,
1349
1658
  kind: "renderer",
1350
1659
  context: {
@@ -1358,13 +1667,22 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1358
1667
  resourceId: e.resource.id
1359
1668
  } : {}
1360
1669
  }
1361
- }), X = (e, t, r, n) => {
1362
- const o = Z(r.resource);
1670
+ }), oe = (e, t, r, n) => {
1671
+ const o = ie(r.resource), s = e.workbench.modes.getActiveModeId();
1363
1672
  return {
1364
- projectId: e.projectId,
1365
- modeId: e.workbench.modes.getActiveModeId(),
1366
- resource: o,
1367
- treeId: t.id,
1673
+ renderer: {
1674
+ rendererId: t.id,
1675
+ projectId: e.projectId,
1676
+ ...s ? {
1677
+ modeId: s
1678
+ } : {},
1679
+ ...o ? {
1680
+ resource: o
1681
+ } : {},
1682
+ invocation: {
1683
+ placement: "visible"
1684
+ }
1685
+ },
1368
1686
  state: e.workbench.renderers.getTreeState(t.id),
1369
1687
  ...r.filter ? {
1370
1688
  filter: r.filter
@@ -1373,28 +1691,41 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1373
1691
  node: n
1374
1692
  } : {}
1375
1693
  };
1376
- }, J = async (e, t, r) => {
1377
- const n = r.resource, o = await e.executeCommand(t, {
1694
+ }, se = async (e, t, r, n) => {
1695
+ const o = n.renderer, s = o?.resource, i = await e.executeCommand(r, {
1378
1696
  projectId: e.projectId,
1379
- params: r,
1380
- resource: n,
1381
- slot: Be({
1382
- modeId: r.modeId,
1697
+ params: n,
1698
+ resource: s,
1699
+ slot: Qe({
1700
+ modeId: o?.modeId,
1383
1701
  projectId: e.projectId,
1384
- resource: n,
1385
- treeId: r.treeId
1702
+ resource: s,
1703
+ treeId: t.id
1386
1704
  }),
1387
1705
  source: "dashboard"
1388
1706
  });
1389
- return N(o);
1390
- }, He = async (e, t, r, n, o) => {
1391
- const s = e.workbench.modes.getActiveModeId(), i = await e.executeCommand(r, {
1707
+ return X(i);
1708
+ }, Ge = async (e, t, r, n, o) => {
1709
+ const s = e.workbench.modes.getActiveModeId(), i = {
1710
+ ...n ?? {},
1711
+ renderer: {
1712
+ rendererId: t.id,
1713
+ projectId: e.projectId,
1714
+ ...s ? {
1715
+ modeId: s
1716
+ } : {},
1717
+ ...o ? {
1718
+ resource: o
1719
+ } : {},
1720
+ invocation: {
1721
+ placement: "visible"
1722
+ }
1723
+ }
1724
+ }, a = await e.executeCommand(r, {
1392
1725
  projectId: e.projectId,
1393
- ...n ? {
1394
- params: n
1395
- } : {},
1726
+ params: i,
1396
1727
  resource: o,
1397
- slot: Be({
1728
+ slot: Qe({
1398
1729
  modeId: s,
1399
1730
  projectId: e.projectId,
1400
1731
  resource: o,
@@ -1405,146 +1736,154 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1405
1736
  treeId: t.id
1406
1737
  }
1407
1738
  });
1408
- return N(i);
1409
- }, vr = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, kr = (e, t) => {
1410
- const r = /* @__PURE__ */ new WeakMap(), n = `workbench.extensionTreeRenderer.${t.id}.command`, o = (a) => {
1411
- if (a.emptyState)
1739
+ return X(a);
1740
+ }, nn = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, Ee = (e) => e && !Array.isArray(e) ? e : void 0, on = (e, t) => {
1741
+ const r = /* @__PURE__ */ new WeakMap(), n = `workbench.extensionTreeRenderer.${t.id}.command`, o = (l, u) => {
1742
+ const c = e.resolveNodeResource?.(l);
1743
+ return c ? u ? {
1744
+ ...c,
1745
+ metadata: {
1746
+ ...c.metadata,
1747
+ [ae]: u
1748
+ }
1749
+ } : c : rn(l, u);
1750
+ }, s = (l) => {
1751
+ if (l.emptyState)
1412
1752
  return {
1413
- title: u(a.emptyState.title),
1414
- description: u(a.emptyState.description),
1415
- icon: a.emptyState.icon
1416
- };
1417
- }, s = (a, l, m) => {
1418
- if (a) {
1419
- if (a.kind === "resource" && a.resource)
1420
- return {
1421
- kind: "resource",
1422
- resource: ve(a.resource),
1423
- input: {
1424
- replaceActive: !0
1425
- }
1426
- };
1427
- if (a.kind === "panel" && a.panelId) return {
1428
- kind: "panel",
1429
- panelId: a.panelId
1753
+ title: f(l.emptyState.title),
1754
+ description: f(l.emptyState.description),
1755
+ icon: l.emptyState.icon
1430
1756
  };
1431
- if (!(a.kind !== "command" || !a.commandId))
1432
- return {
1433
- kind: "command",
1434
- commandId: n,
1435
- args: {
1436
- commandId: a.commandId,
1437
- nodeId: l.id,
1438
- params: a.args,
1439
- resource: l.resource ?? Z(m.resource),
1440
- treeId: t.id
1441
- }
1442
- };
1443
- }
1444
- }, i = (a, l, m) => {
1445
- const f = a.commandId;
1757
+ }, i = (l, u, c) => l ? J(l, {
1758
+ commandTargetOf: (h) => ({
1759
+ kind: "command",
1760
+ commandId: n,
1761
+ args: {
1762
+ commandId: typeof h.command == "string" ? h.command : h.command.id,
1763
+ nodeId: u.id,
1764
+ params: h.params,
1765
+ resource: u.resource ?? ie(c.resource),
1766
+ treeId: t.id
1767
+ }
1768
+ }),
1769
+ resourceOf: (h, k) => o(h, k.section ? {
1770
+ treeId: t.id,
1771
+ targetNodeId: u.id,
1772
+ anchors: k.section.anchors
1773
+ } : void 0)
1774
+ }) : void 0, a = (l, u, c) => {
1775
+ const p = tn(l.command);
1446
1776
  return {
1447
- id: a.id,
1448
- label: u(a.label),
1449
- icon: a.icon,
1450
- args: a.args,
1451
- params: hr(a.params, u),
1452
- submitLabel: a.submitLabel,
1453
- when: a.when,
1454
- disabled: a.disabled,
1777
+ id: l.id,
1778
+ label: f(l.label),
1779
+ icon: l.icon,
1780
+ args: Ee(l.params),
1781
+ params: Yr(l.input, f),
1782
+ submitLabel: l.submitLabel,
1783
+ when: l.when,
1784
+ disabled: l.disabled,
1455
1785
  // Actions mutate tree data (create/delete/...), so refresh afterwards. Plain
1456
1786
  // node-target navigation runs through the runner command and must not refetch.
1457
- run: f ? async (p) => {
1458
- await He(e, t, f, vr(p, a.args), l?.resource ?? Z(m.resource)), e.workbench.renderers.refresh(t.id);
1787
+ run: p ? async (h) => {
1788
+ await Ge(e, t, p, nn(h, Ee(l.params)), u?.resource ?? ie(c.resource)), e.workbench.renderers.refresh(t.id);
1459
1789
  } : void 0
1460
1790
  };
1461
- }, d = (a, l) => {
1462
- const m = {
1463
- id: a.id,
1464
- label: u(a.label),
1465
- icon: a.icon,
1466
- iconColor: a.iconColor,
1467
- iconTooltip: a.iconTooltip,
1468
- resource: a.resource ? ve(a.resource) : void 0,
1469
- target: s(a.target, a, l),
1470
- rowVariant: a.rowVariant,
1471
- actions: a.actions?.map((f) => i(f, a, l)),
1472
- contextMenuActions: a.contextMenuActions?.map((f) => i(f, a, l)),
1473
- collapsible: a.collapsible,
1474
- disabled: a.disabled,
1475
- children: a.children?.map((f) => d(f, l)),
1476
- description: a.description,
1477
- contextValue: a.contextValue,
1478
- hiddenByDefault: a.hiddenByDefault,
1479
- canHide: a.canHide
1791
+ }, d = (l, u) => {
1792
+ const c = {
1793
+ id: l.id,
1794
+ label: f(l.label),
1795
+ icon: l.icon,
1796
+ iconColor: l.iconColor,
1797
+ iconTooltip: l.iconTooltip,
1798
+ resource: l.resource ? o(l.resource) : void 0,
1799
+ target: i(l.target, l, u),
1800
+ rowVariant: l.rowVariant,
1801
+ actions: l.actions?.map((p) => a(p, l, u)),
1802
+ contextMenuActions: l.contextMenuActions?.map((p) => a(p, l, u)),
1803
+ collapsible: l.collapsible,
1804
+ disabled: l.disabled,
1805
+ children: l.children?.map((p) => d(p, u)),
1806
+ description: l.description,
1807
+ contextValue: l.contextValue,
1808
+ hiddenByDefault: l.hiddenByDefault,
1809
+ canHide: l.canHide
1480
1810
  };
1481
- return r.set(m, a), m;
1811
+ return r.set(c, l), c;
1482
1812
  };
1483
1813
  return {
1484
- mapNodes: (a, l) => a.map((m) => d(m, l)),
1485
- mapSections: (a, l) => a.map((m) => ({
1486
- id: m.id,
1487
- label: u(m.label),
1488
- actions: m.actions?.map((f) => i(f, void 0, l)),
1489
- collapsible: m.collapsible,
1490
- emptyState: o(m),
1491
- nodes: m.nodes.map((f) => d(f, l)),
1492
- hiddenByDefault: m.hiddenByDefault,
1493
- canHide: m.canHide
1814
+ mapNodes: (l, u) => l.map((c) => d(c, u)),
1815
+ mapSections: (l, u) => l.map((c) => ({
1816
+ id: c.id,
1817
+ label: f(c.label),
1818
+ actions: c.actions?.map((p) => a(p, void 0, u)),
1819
+ collapsible: c.collapsible,
1820
+ emptyState: s(c),
1821
+ nodes: c.nodes.map((p) => d(p, u)),
1822
+ hiddenByDefault: c.hiddenByDefault,
1823
+ canHide: c.canHide
1494
1824
  })),
1495
1825
  originalNodes: r,
1496
1826
  runnerCommandId: n
1497
1827
  };
1498
- }, Rr = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "nodes" in t), ke = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "id" in t), Cr = (e) => {
1499
- for (const t of e)
1500
- for (const r of t.nodes)
1501
- if (r.selected) return r.id;
1502
- }, Er = (e, t) => {
1503
- const r = kr(e, t), n = wr(e.metadata, t), o = e.workbench.commands.registerCommand({
1828
+ }, sn = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "nodes" in t), Pe = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "id" in t), Ye = (e) => {
1829
+ for (const t of e) {
1830
+ if (t.selected) return t.id;
1831
+ const r = Ye(t.children ?? []);
1832
+ if (r) return r;
1833
+ }
1834
+ }, an = (e) => {
1835
+ for (const t of e) {
1836
+ const r = Ye(t.nodes);
1837
+ if (r) return r;
1838
+ }
1839
+ }, dn = (e, t) => {
1840
+ const r = on(e, t), n = Xr(e.metadata, t), o = e.workbench.commands.registerCommand({
1504
1841
  id: r.runnerCommandId,
1505
- label: `${u(t.title, t.id)} tree command`
1842
+ label: `${f(t.title, t.id)} tree command`
1506
1843
  }, {
1507
1844
  execute: async (i) => {
1508
- const d = i;
1509
- d.nodeId && e.workbench.renderers.setSelectedNode(t.id, d.nodeId);
1510
- const c = await He(e, t, d.commandId, d.params, d.resource);
1511
- for (const b of e.workbench.renderers.listFileRenderers())
1512
- e.workbench.renderers.refreshFileRenderer(b.id);
1513
- return c;
1845
+ const a = i;
1846
+ a.nodeId && e.workbench.renderers.setSelectedNode(t.id, a.nodeId);
1847
+ const d = await Ge(e, t, a.commandId, a.params, a.resource);
1848
+ for (const m of e.workbench.renderers.listFileRenderers())
1849
+ e.workbench.renderers.refreshFileRenderer(m.id);
1850
+ return d;
1514
1851
  }
1515
1852
  }), s = e.workbench.renderers.registerTreeRenderer({
1516
1853
  id: t.id,
1517
- title: u(t.title, t.id),
1854
+ title: f(t.title, t.id),
1518
1855
  icon: t.icon,
1856
+ searchable: t.searchable,
1857
+ searchPlaceholder: f(t.searchPlaceholder, "Search files"),
1519
1858
  defaultExpandedNodeIds: t.defaultExpandedNodeIds,
1520
1859
  defaultExpandedSectionIds: t.defaultExpandedSectionIds,
1521
- getHeader: (i) => gr({
1860
+ getHeader: (i) => Jr({
1522
1861
  ctx: i,
1523
1862
  getHostTreeHeaderNodes: e.getHostTreeHeaderNodes,
1524
1863
  record: t,
1525
1864
  treeViews: n
1526
1865
  }),
1527
1866
  getBody: async (i) => {
1528
- const d = await J(e, t.bodyCommandId, X(e, t, i));
1529
- if (!Rr(d)) return [];
1530
- const c = Cr(d);
1531
- return c && e.workbench.renderers.setSelectedNode(t.id, c), r.mapSections(d, i);
1867
+ const a = await se(e, t, t.bodyHandlerId, oe(e, t, i));
1868
+ if (!sn(a)) return [];
1869
+ const d = an(a);
1870
+ return d && e.workbench.renderers.setSelectedNode(t.id, d), r.mapSections(a, i);
1532
1871
  },
1533
1872
  getFooter: async (i) => {
1534
- const d = await Ir({
1873
+ const a = await Zr({
1535
1874
  ctx: i,
1536
1875
  getHostTreeFooterNodes: e.getHostTreeFooterNodes,
1537
1876
  record: t,
1538
1877
  treeViews: n
1539
1878
  });
1540
- if (!t.footerCommandId) return d;
1541
- const c = await J(e, t.footerCommandId, X(e, t, i));
1542
- return [...ke(c) ? r.mapNodes(c, i) : [], ...d];
1879
+ if (!t.footerHandlerId) return a;
1880
+ const d = await se(e, t, t.footerHandlerId, oe(e, t, i));
1881
+ return [...Pe(d) ? r.mapNodes(d, i) : [], ...a];
1543
1882
  },
1544
- getChildren: async (i, d) => {
1545
- if (!t.childrenCommandId) return i.children ?? [];
1546
- const c = r.originalNodes.get(i) ?? i, b = await J(e, t.childrenCommandId, X(e, t, d, c));
1547
- return ke(b) ? r.mapNodes(b, d) : [];
1883
+ getChildren: async (i, a) => {
1884
+ if (!t.childrenHandlerId) return i.children ?? [];
1885
+ const d = r.originalNodes.get(i) ?? i, m = await se(e, t, t.childrenHandlerId, oe(e, t, a, d));
1886
+ return Pe(m) ? r.mapNodes(m, a) : [];
1548
1887
  }
1549
1888
  });
1550
1889
  return {
@@ -1552,21 +1891,24 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1552
1891
  s.dispose(), o.dispose();
1553
1892
  }
1554
1893
  };
1555
- }, xr = (e) => {
1894
+ }, cn = (e) => {
1556
1895
  const t = [];
1557
1896
  for (const n of e.metadata.treeRenderers ?? [])
1558
- t.push(Er(e, n));
1559
- const r = $(e.metadata.panels);
1897
+ t.push(dn(e, n));
1898
+ const r = K(e.metadata.panels);
1560
1899
  return e.metadata.panels.forEach((n, o) => {
1561
- const s = yr(e, n, o, r[o]);
1900
+ const s = en({
1901
+ workbench: e.workbench,
1902
+ resourcePanels: e.metadata.resourcePanels
1903
+ }, n, o, r[o]);
1562
1904
  s && t.push(s);
1563
1905
  }), {
1564
1906
  dispose() {
1565
1907
  for (let n = t.length - 1; n >= 0; n -= 1) t[n]?.dispose();
1566
1908
  }
1567
1909
  };
1568
- }, Ar = (e) => (t) => ({
1569
- ...Ae({
1910
+ }, ln = (e) => (t) => ({
1911
+ ...Oe({
1570
1912
  workbench: t.workbench,
1571
1913
  hostEvents: t.hostEvents
1572
1914
  }),
@@ -1576,10 +1918,10 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1576
1918
  "resource.open": (n) => {
1577
1919
  const o = n;
1578
1920
  if (!o.resource) throw new Error("resource.open requires a resource.");
1579
- return t.workbench.resources.openResource(U(o.resource), o.input);
1921
+ return t.workbench.resources.openResource(_(o.resource), Me(o.input));
1580
1922
  },
1581
1923
  "commands.execute": async (n) => {
1582
- const o = n, s = o.resource ?? re(t.placement.resource);
1924
+ const o = n, s = o.resource ?? H(t.placement.resource);
1583
1925
  return e.executeCommand(o.commandId, {
1584
1926
  projectId: e.projectId,
1585
1927
  ...o.params ? {
@@ -1604,17 +1946,17 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1604
1946
  "files.list": e.files.list,
1605
1947
  "files.delete": e.files.delete
1606
1948
  } : {}
1607
- }), ne = (e, t) => ({
1949
+ }), Xe = (e, t) => ({
1608
1950
  kind: t,
1609
1951
  uri: `workbench://extension-route/${encodeURIComponent(e.id)}`,
1610
1952
  id: e.id,
1611
- label: u(e.label, e.id),
1953
+ label: f(e.label, e.id),
1612
1954
  metadata: {
1613
1955
  extensionId: e.extensionId,
1614
1956
  extensionRouteId: e.id,
1615
1957
  path: e.path
1616
1958
  }
1617
- }), Re = (e, t) => e.routes.find((r) => t.id === r.id || t.metadata?.extensionRouteId === r.id), Pr = (e) => {
1959
+ }), Ae = (e, t) => e.routes.find((r) => t.id === r.id || t.metadata?.extensionRouteId === r.id), mn = (e) => {
1618
1960
  if (e.metadata.routes.length === 0) return [];
1619
1961
  const t = [];
1620
1962
  e.workbench.resources.getKind(e.routeResourceKind) || t.push(e.workbench.resources.registerKind({
@@ -1624,56 +1966,65 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1624
1966
  }));
1625
1967
  for (const r of e.metadata.routes)
1626
1968
  t.push(e.workbench.layout.registerPanel({
1627
- closable: !1,
1628
1969
  id: r.id,
1629
- title: u(r.label, r.id),
1970
+ title: f(r.label, r.id),
1630
1971
  region: "main",
1631
- rendererId: K,
1972
+ rendererId: S,
1632
1973
  singleton: !0,
1633
- config: _(r.webview)
1974
+ config: q(r.webview)
1634
1975
  }));
1635
1976
  return t.push(e.workbench.resources.registerProvider({
1636
1977
  id: "workbench.extension.routes",
1637
1978
  kind: e.routeResourceKind,
1638
1979
  list: () => e.metadata.routes.map((r) => ({
1639
- resource: ne(r, e.routeResourceKind)
1980
+ resource: Xe(r, e.routeResourceKind)
1640
1981
  }))
1641
1982
  }), e.workbench.resources.registerPresenter({
1642
1983
  id: "workbench.extension.routes",
1643
- canOpen: (r) => r.kind === e.routeResourceKind && !!Re(e.metadata, r),
1984
+ canOpen: (r) => r.kind === e.routeResourceKind && !!Ae(e.metadata, r),
1644
1985
  open: (r, n) => {
1645
- const o = Re(e.metadata, r);
1986
+ const o = Ae(e.metadata, r);
1646
1987
  return e.workbench.layout.openPanel(o.id, {
1647
1988
  strategy: n.replaceActive ? {
1648
1989
  kind: "replace-active"
1649
1990
  } : {
1650
1991
  kind: "persistent"
1651
1992
  },
1652
- title: u(o.label, o.id)
1993
+ title: f(o.label, o.id)
1653
1994
  });
1654
1995
  }
1655
1996
  })), t;
1656
- }, Tr = {
1997
+ }, un = {
1657
1998
  "workbench.left.tree": "sidenav",
1658
1999
  "workbench.main.left.tree": "main-left-menu",
1659
2000
  "workbench.main.right.tree": "main-right-menu"
1660
- }, Sr = (e) => e ? Tr[e] ?? "sidenav" : "sidenav", Wr = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, jr = (e, t) => {
1661
- if (t.action.kind === "kanbanRenderer") return {
2001
+ }, fn = (e) => e ? un[e] ?? "sidenav" : "sidenav", pn = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, bn = (e, t) => {
2002
+ if (t.action.kind === "panel") return {
1662
2003
  kind: "panel",
1663
- panelId: t.action.kanbanRendererId
2004
+ panelId: t.action.panelId
1664
2005
  };
1665
2006
  const r = t.action;
1666
2007
  if (r.kind === "route") {
1667
2008
  const n = e.metadata.routes.find((o) => o.id === r.route);
1668
2009
  return n ? {
1669
2010
  kind: "resource",
1670
- resource: ne(n, e.routeResourceKind)
2011
+ resource: Xe(n, e.routeResourceKind)
1671
2012
  } : void 0;
1672
2013
  }
1673
2014
  return r.kind === "command" ? {
1674
2015
  kind: "command",
1675
2016
  commandId: r.commandId,
1676
2017
  args: r.args
2018
+ } : r.kind === "resource" ? {
2019
+ kind: "resource",
2020
+ resource: {
2021
+ kind: r.resource.type,
2022
+ uri: `pstdio://extension-resource/${encodeURIComponent(r.resource.type)}/${encodeURIComponent(r.resource.id)}`,
2023
+ id: r.resource.id,
2024
+ label: r.resource.label ?? f(t.label, t.id),
2025
+ icon: t.icon,
2026
+ metadata: r.resource.metadata
2027
+ }
1677
2028
  } : {
1678
2029
  kind: "command",
1679
2030
  commandId: `workbench.extension.href.${t.id}`,
@@ -1681,7 +2032,7 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1681
2032
  href: r.href
1682
2033
  }
1683
2034
  };
1684
- }, Kr = (e) => {
2035
+ }, hn = (e) => {
1685
2036
  const t = e.metadata.treeItems ?? [];
1686
2037
  if (t.length === 0) return [];
1687
2038
  const r = [], n = /* @__PURE__ */ new Map();
@@ -1691,22 +2042,21 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1691
2042
  r.push(e.workbench.renderers.registerTreeRenderer({
1692
2043
  id: i,
1693
2044
  title: "Extensions",
1694
- getChildren: (d) => d.children ?? [],
2045
+ getChildren: (a) => a.children ?? [],
1695
2046
  getBody: () => [{
1696
2047
  id: "extensions",
1697
2048
  label: "Extensions",
1698
- nodes: s.map((d) => ({
1699
- id: d.id,
1700
- label: u(d.label, d.id),
1701
- icon: d.icon,
1702
- target: jr(e, d)
2049
+ nodes: s.map((a) => ({
2050
+ id: a.id,
2051
+ label: f(a.label, a.id),
2052
+ icon: a.icon,
2053
+ target: bn(e, a)
1703
2054
  }))
1704
2055
  }]
1705
2056
  }), e.workbench.layout.registerPanel({
1706
- closable: !1,
1707
2057
  id: i,
1708
2058
  title: "Extensions",
1709
- region: Sr(o),
2059
+ region: fn(o),
1710
2060
  rendererId: i,
1711
2061
  singleton: !0
1712
2062
  }));
@@ -1715,53 +2065,53 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1715
2065
  const s = o.action;
1716
2066
  s.kind === "href" && r.push(e.workbench.commands.registerCommand({
1717
2067
  id: `workbench.extension.href.${o.id}`,
1718
- label: u(o.label, o.id)
2068
+ label: f(o.label, o.id)
1719
2069
  }, {
1720
- execute: (i) => e.openHref?.(Wr(i)?.href ?? s.href)
2070
+ execute: (i) => e.openHref?.(pn(i)?.href ?? s.href)
1721
2071
  }));
1722
2072
  }
1723
2073
  return r;
1724
- }, ee = "extension-route", Mr = "extensions", Dr = (e) => {
2074
+ }, xe = "extension-route", gn = "extensions", wn = (e) => {
1725
2075
  for (let t = e.length - 1; t >= 0; t -= 1) e[t]?.dispose();
1726
- }, oe = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, $r = (e) => e === void 0 ? void 0 : e, Br = (e) => e === "global" ? "user" : "project", Hr = (e, t) => t ? (r) => ({
2076
+ }, le = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, In = (e) => e === void 0 ? void 0 : e, yn = (e) => e === "global" ? "user" : "project", vn = (e, t) => t ? (r) => ({
1727
2077
  ...e(r),
1728
2078
  ...t(r)
1729
- }) : e, Le = (e, t) => {
1730
- const r = e.createWebviewHostCapabilities ?? Ar({
2079
+ }) : e, Je = (e, t) => {
2080
+ const r = e.createWebviewHostCapabilities ?? ln({
1731
2081
  executeCommand: e.executeCommand,
1732
2082
  files: e.webviewFiles,
1733
2083
  projectId: e.projectId,
1734
2084
  slotKind: t
1735
2085
  });
1736
- return Hr(r, e.createWebviewHostCapabilityOverrides);
1737
- }, Lr = (e, t) => {
1738
- e.workbench.renderers.getRenderer(K) || t.push(e.workbench.renderers.registerRenderer(It({
1739
- createHostCapabilities: Le(e, "panel"),
2086
+ return vn(r, e.createWebviewHostCapabilityOverrides);
2087
+ }, kn = (e, t) => {
2088
+ e.workbench.renderers.getRenderer(S) || t.push(e.workbench.renderers.registerRenderer(Ht({
2089
+ createHostCapabilities: Je(e, "panel"),
1740
2090
  createProps: e.createWebviewProps,
1741
2091
  createTheme: e.createWebviewTheme
1742
2092
  })));
1743
- }, Or = (e, t) => t.commands.map((r) => e.workbench.commands.registerCommand({
2093
+ }, Rn = (e, t) => t.commands.map((r) => e.workbench.commands.registerCommand({
1744
2094
  id: r.id,
1745
- label: u(r.title, r.id),
1746
- description: u(r.description),
2095
+ label: f(r.title, r.id),
2096
+ description: f(r.description),
1747
2097
  params: r.params
1748
2098
  }, {
1749
- execute: (n, o) => k(e, r.id, {
1750
- params: oe(n),
2099
+ execute: (n, o) => P(e, r.id, {
2100
+ params: le(n),
1751
2101
  resource: o?.resource
1752
2102
  })
1753
- })), Oe = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), Vr = (e, t) => e.menuSlotsById ? Vt({
2103
+ })), Ze = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), Cn = (e, t) => e.menuSlotsById ? vr({
1754
2104
  metadata: e.metadata,
1755
2105
  menuSlotsById: e.menuSlotsById,
1756
2106
  menuTargetsById: e.menuTargetsById,
1757
2107
  createWhenExpression: e.createMenuWhenExpression
1758
2108
  }).flatMap((n) => [e.workbench.commands.registerCommand(n.command, {
1759
- execute: (o, s) => k(t, n.targetCommandId, {
2109
+ execute: (o, s) => P(t, n.targetCommandId, {
1760
2110
  params: {
1761
2111
  ...n.contribution.params ?? {},
1762
- ...oe(o) ?? {}
2112
+ ...le(o) ?? {}
1763
2113
  },
1764
- resource: Oe(e, s),
2114
+ resource: Ze(e, s),
1765
2115
  slot: M({
1766
2116
  id: n.contribution.slotId,
1767
2117
  kind: "menu",
@@ -1771,15 +2121,15 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1771
2121
  }
1772
2122
  })
1773
2123
  })
1774
- }), e.workbench.layout.registerMenuItem(n.menuPath, n.menuItem)]) : [], Fr = (e, t) => Ft({
2124
+ }), e.workbench.layout.registerMenuItem(n.menuPath, n.menuItem)]) : [], En = (e, t) => kr({
1775
2125
  metadata: e.metadata
1776
2126
  }).flatMap((n) => [e.workbench.commands.registerCommand(n.command, {
1777
- execute: (o, s) => k(t, n.targetCommandId, {
2127
+ execute: (o, s) => P(t, n.targetCommandId, {
1778
2128
  params: {
1779
2129
  ...n.contribution.params ?? {},
1780
- ...oe(o) ?? {}
2130
+ ...le(o) ?? {}
1781
2131
  },
1782
- resource: Oe(e, s),
2132
+ resource: Ze(e, s),
1783
2133
  slot: M({
1784
2134
  id: "workbench.commandPalette",
1785
2135
  kind: "menu",
@@ -1789,47 +2139,59 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1789
2139
  }
1790
2140
  })
1791
2141
  }),
1792
- isVisible: () => ze(n.contribution.when, e.workbench.getPrimaryResource()?.kind)
1793
- }), e.workbench.layout.registerMenuItem(Qe, n.menuItem)]), Nr = (e) => {
1794
- const t = $(e.metadata.panels);
1795
- return e.metadata.panels.flatMap((r, n) => r.webview ? [H({
2142
+ isVisible: () => at(n.contribution.when, e.workbench.getPrimaryResource()?.kind)
2143
+ }), e.workbench.layout.registerMenuItem(st, n.menuItem)]), Pn = (e) => {
2144
+ const t = K(e.metadata.panels);
2145
+ return e.metadata.panels.flatMap((r, n) => r.webview ? [D({
1796
2146
  workbench: e.workbench,
1797
- contribution: {
1798
- id: r.id,
1799
- title: u(r.title, r.id),
1800
- region: r.region,
1801
- closable: r.closable,
1802
- rendererId: K,
1803
- singleton: !0,
1804
- resourceKinds: r.resourceKind ? [r.resourceKind] : void 0,
1805
- eligibleLocations: D(r.eligibleLocations),
1806
- panelMenus: B(r.panelMenus, t[n]),
1807
- ...A({
1808
- placement: r.placement,
1809
- declarationIndex: n
1810
- }),
1811
- config: {
1812
- ..._(r.webview),
1813
- ...r.region === "overlay" ? {
1814
- size: "lg",
1815
- scrollBehavior: "inside",
1816
- contentHeight: "min(560px, calc(100dvh - 48px))"
1817
- } : {}
1818
- }
1819
- }
2147
+ contribution: O({
2148
+ panel: r,
2149
+ rendererId: S,
2150
+ declarationIndex: n,
2151
+ menuDeclarationOffset: t[n],
2152
+ resourcePanels: e.metadata.resourcePanels,
2153
+ config: q(r.webview)
2154
+ })
1820
2155
  })] : []);
1821
- }, Ur = (e) => {
1822
- const t = [], r = e.settingsSectionId ?? Mr;
2156
+ }, An = (e) => {
2157
+ const t = [];
2158
+ for (const [r, n] of (e.metadata.statusItems ?? []).entries()) {
2159
+ if (!n.webview) continue;
2160
+ t.push(e.workbench.layout.registerWidget({
2161
+ id: n.id,
2162
+ title: f(n.title, n.id),
2163
+ region: "status",
2164
+ rendererId: S,
2165
+ closable: !1,
2166
+ priority: -r,
2167
+ config: q(n.webview)
2168
+ }));
2169
+ const o = () => {
2170
+ const i = n.when?.mode;
2171
+ if (!i) return !0;
2172
+ const a = e.workbench.modes.getActiveModeId() ?? "";
2173
+ return Array.isArray(i) ? i.includes(a) : i === a;
2174
+ }, s = () => {
2175
+ const i = e.workbench.layout.getLayout().regions.status.widgets.find((a) => a.contributionId === n.id);
2176
+ o() && !i ? e.workbench.layout.openWidget(n.id, {
2177
+ region: "status"
2178
+ }) : !o() && i && e.workbench.layout.removeWidgetPlacement(i.widgetId);
2179
+ };
2180
+ s(), t.push(e.workbench.modes.onDidChangeActive(s));
2181
+ }
2182
+ return t;
2183
+ }, xn = (e) => {
2184
+ const t = [], r = e.settingsSectionId ?? gn;
1823
2185
  e.workbench.settings.getSection(r) || t.push(e.workbench.settings.registerSection({
1824
2186
  id: r,
1825
2187
  title: e.settingsSectionTitle ?? "Extensions"
1826
2188
  }));
1827
2189
  const n = Object.fromEntries((e.metadata.settingsDefinitions ?? []).map((o) => [o.key, {
1828
2190
  type: o.type,
1829
- scope: Br(o.scope),
1830
- default: $r(o.default),
2191
+ scope: yn(o.scope),
2192
+ default: In(o.default),
1831
2193
  enum: o.enum,
1832
- description: u(o.description)
2194
+ description: f(o.description)
1833
2195
  }]));
1834
2196
  Object.keys(n).length > 0 && t.push(e.workbench.preferences.registerSchema({
1835
2197
  properties: n
@@ -1837,11 +2199,11 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1837
2199
  for (const o of e.metadata.settingsPanels)
1838
2200
  t.push(e.workbench.settings.registerPanel({
1839
2201
  id: o.id,
1840
- title: u(o.title, o.id),
2202
+ title: f(o.title, o.id),
1841
2203
  kind: "custom",
1842
2204
  section: r,
1843
2205
  scope: o.scope,
1844
- render: (s) => Se({
2206
+ render: (s) => $e({
1845
2207
  context: {
1846
2208
  workbench: s.workbench,
1847
2209
  webviewId: o.id,
@@ -1849,9 +2211,9 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1849
2211
  ...s.instance,
1850
2212
  panelId: o.id
1851
2213
  },
1852
- hostEvents: Te(s.workbench, s.instance)
2214
+ hostEvents: De(s.workbench, s.instance)
1853
2215
  },
1854
- createHostCapabilities: Le(e, "settings"),
2216
+ createHostCapabilities: Je(e, "settings"),
1855
2217
  createProps: e.createWebviewProps ?? (({
1856
2218
  placement: i
1857
2219
  }) => ({
@@ -1860,96 +2222,220 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1860
2222
  })),
1861
2223
  createTheme: e.createWebviewTheme,
1862
2224
  ownerId: o.extensionId,
1863
- title: u(o.title, o.id),
1864
- webview: _(o.webview)
2225
+ title: f(o.title, o.id),
2226
+ webview: q(o.webview)
1865
2227
  })
1866
2228
  }));
1867
2229
  return t;
1868
- }, _r = (e) => {
1869
- const t = /* @__PURE__ */ new Set();
1870
- for (const n of e.metadata.panels) n.resourceKind && t.add(n.resourceKind);
1871
- for (const n of e.metadata.kanbanRenderers ?? []) n.resourceKind && t.add(n.resourceKind);
1872
- const r = [];
1873
- for (const n of t) {
1874
- e.workbench.resources.getKind(n) || r.push(e.workbench.resources.registerKind({
1875
- kind: n,
1876
- label: n,
1877
- icon: "FileText",
2230
+ }, Tn = (e) => {
2231
+ const t = /* @__PURE__ */ new Map();
2232
+ for (const r of e.resourceKinds ?? [])
2233
+ t.set(r.id, {
2234
+ surface: r.surface,
2235
+ extensionId: r.extensionId,
2236
+ label: r.label ? f(r.label, r.id) : void 0,
2237
+ icon: r.icon
2238
+ });
2239
+ for (const r of e.kanbanRenderers ?? [])
2240
+ r.resourceKind && !t.has(r.resourceKind) && t.set(r.resourceKind, {
1878
2241
  surface: "primary"
1879
- }));
1880
- const o = e.metadata.panels.filter((s) => s.resourceKind === n && s.region !== "overlay");
1881
- o.length > 0 && r.push(e.workbench.resources.registerPresenter({
1882
- id: `workbench.extension.resource.${n}`,
1883
- canOpen: (s) => s.kind === n,
1884
- open: (s) => {
1885
- const i = o.map((d) => e.workbench.layout.openPanel(d.id, {
1886
- resource: s,
1887
- title: s.label ?? s.id ?? s.uri,
1888
- strategy: {
1889
- kind: "persistent"
1890
- }
1891
- }));
1892
- return i.find((d, c) => o[c]?.region === "main") ?? i[0];
1893
- }
1894
- }));
2242
+ });
2243
+ return t;
2244
+ }, Wn = (e, t, r) => {
2245
+ const o = (e.resourcePanels ?? []).filter((i) => i.resourceKind === t).flatMap((i) => {
2246
+ const a = e.panels.find((d) => d.id === i.panel);
2247
+ return a ? [{
2248
+ edge: i,
2249
+ panel: a
2250
+ }] : [];
2251
+ }), s = new Set(o.map(({
2252
+ panel: i
2253
+ }) => i.id));
2254
+ for (const i of e.panels) {
2255
+ if (s.has(i.id) || i.extensionId !== r) continue;
2256
+ const d = (i.show ? Array.isArray(i.show) ? i.show : [i.show] : []).find((m) => m.for === t);
2257
+ d && o.push({
2258
+ panel: i,
2259
+ placement: d
2260
+ });
1895
2261
  }
1896
- return r;
1897
- }, qr = (e, t) => {
1898
- if (!t.panel) return;
1899
- e.layout.openPanel(t.panel, {
1900
- region: t.region,
1901
- pinned: t.pinned,
1902
- title: u(t.title),
2262
+ return o;
2263
+ }, jn = (e, t) => {
2264
+ const r = e.workbench.layout.getLayout();
2265
+ return ["sidenav", "main", "secondary", "side"].find((o) => r.regions[o].widgets.some((s) => s.contributionId === t));
2266
+ }, Sn = (e, t, r) => {
2267
+ const n = t.map(({
2268
+ panel: s
2269
+ }) => e.workbench.layout.openPanel(s.id, {
2270
+ region: jn(e, s.id),
2271
+ resource: r,
2272
+ title: r.label ?? r.id ?? r.uri,
1903
2273
  strategy: {
1904
2274
  kind: "persistent"
1905
2275
  }
1906
- }), (t.region ?? e.layout.getPanel(t.panel)?.region) === "side" && e.shell.setSidePanelPresentation("attached");
1907
- }, zr = (e, t, r) => {
1908
- if (!r.resource) return;
1909
- const n = e.metadata.routes.find((o) => o.id === r.resource || o.path === r.resource);
1910
- n && t.resources.openResource(ne(n, e.routeResourceKind ?? ee));
1911
- }, Qr = (e, t, r) => {
1912
- for (const n of r.layout?.open ?? [])
1913
- qr(t, n), zr(e, t, n);
1914
- }, Gr = (e) => e.metadata.modes.map((t) => e.workbench.modes.registerMode({
1915
- id: t.modeId,
1916
- label: u(t.label, t.modeId),
1917
- panels: t.layout?.panels,
1918
- activate: () => {
1919
- },
1920
- seed: (r) => {
1921
- Qr(e, r, t);
1922
- }
1923
- })), pn = (e) => {
2276
+ })), o = t.findIndex((s) => s.edge?.slot === "primary" || s.placement?.region === "main");
2277
+ return n[o >= 0 ? o : 0];
2278
+ }, Hn = (e, t, r) => {
2279
+ const n = [];
2280
+ e.workbench.resources.getKind(t) || n.push(e.workbench.resources.registerKind({
2281
+ kind: t,
2282
+ label: r.label ?? t,
2283
+ icon: r.icon ?? "FileText",
2284
+ surface: r.surface
2285
+ }));
2286
+ const o = Wn(e.metadata, t, r.extensionId);
2287
+ return o.length === 0 || n.push(e.workbench.resources.registerPresenter({
2288
+ id: `workbench.extension.resource.${t}`,
2289
+ canOpen: (s) => s.kind === t,
2290
+ // Reuse a placement where the composition resolver or the user put it.
2291
+ open: (s) => Sn(e, o, s)
2292
+ })), n;
2293
+ }, Mn = (e) => [...Tn(e.metadata)].flatMap(([t, r]) => Hn(e, t, r)), On = (e) => {
2294
+ const t = Gt(), r = [];
2295
+ for (const n of e.metadata.resourceKinds ?? [])
2296
+ r.push(t.registerResourceKind({
2297
+ id: n.id,
2298
+ extensionId: n.extensionId,
2299
+ surface: n.surface,
2300
+ slots: n.slots
2301
+ }));
2302
+ for (const n of e.metadata.panels)
2303
+ r.push(t.registerPanelCapability({
2304
+ id: n.id,
2305
+ extensionId: n.extensionId,
2306
+ title: f(n.title, n.id),
2307
+ icon: n.icon,
2308
+ show: Qt(n.show)
2309
+ }));
2310
+ for (const n of e.metadata.resourcePanels ?? [])
2311
+ r.push(t.registerResourcePanel({
2312
+ id: n.id,
2313
+ extensionId: n.extensionId,
2314
+ resourceKind: n.resourceKind,
2315
+ panel: n.panel,
2316
+ slot: n.slot
2317
+ }));
2318
+ for (const n of e.metadata.modes)
2319
+ r.push(t.registerModeComposition({
2320
+ id: n.modeId,
2321
+ extensionId: n.extensionId,
2322
+ resources: n.resources,
2323
+ modePanels: n.modePanels
2324
+ }));
2325
+ return {
2326
+ registry: t,
2327
+ disposables: r
2328
+ };
2329
+ }, Te = (e, t) => `pstdio://extension-resource/${encodeURIComponent(e)}/${encodeURIComponent(t)}`, Kn = (e, t) => {
2330
+ if (t)
2331
+ return "commandId" in t ? async () => {
2332
+ const r = await e.executeCommand(t.commandId, {
2333
+ projectId: e.projectId
2334
+ });
2335
+ if (!(!r || typeof r.type != "string" || typeof r.id != "string"))
2336
+ return {
2337
+ kind: r.type,
2338
+ uri: Te(r.type, r.id),
2339
+ id: r.id,
2340
+ label: r.label
2341
+ };
2342
+ } : {
2343
+ kind: t.type,
2344
+ uri: Te(t.type, t.id),
2345
+ id: t.id,
2346
+ label: t.label
2347
+ };
2348
+ }, Dn = (e, t) => e.metadata.modes.map((r) => {
2349
+ const n = (o, s) => {
2350
+ tr({
2351
+ layout: o.layout,
2352
+ notifications: o.notifications
2353
+ }, {
2354
+ registry: t,
2355
+ modeId: r.modeId,
2356
+ resourceKind: o.navigator.getSelectedResource()?.kind,
2357
+ seeding: s
2358
+ }), o.layout.getLayout().regions.side.widgets.length > 0 && o.shell.setSidePanelPresentation("attached");
2359
+ };
2360
+ return e.workbench.modes.registerMode({
2361
+ id: r.modeId,
2362
+ label: f(r.label, r.modeId),
2363
+ panels: r.panelRegions,
2364
+ resourceKinds: Object.keys(r.resources ?? {}),
2365
+ defaultResource: Kn(e, r.defaultResource),
2366
+ listAddablePanels: ({
2367
+ layout: o,
2368
+ resource: s
2369
+ }) => Yt({
2370
+ registry: t,
2371
+ modeId: r.modeId,
2372
+ layout: o,
2373
+ resourceKind: s?.kind
2374
+ }).filter((i) => dt.includes(i.region)),
2375
+ activate: () => {
2376
+ },
2377
+ seed: (o) => n(o, !0),
2378
+ reconcile: (o) => n(o, !1)
2379
+ });
2380
+ }), to = (e) => {
1924
2381
  const t = [], r = e;
1925
- return Lr(e, t), t.push(...Or(r, e.metadata)), t.push(...Vr(e, r)), t.push(...Fr(e, r)), t.push(xr(e)), t.push(zt(e)), t.push(...Nr(e)), t.push(pr(r, e.metadata.kanbanRenderers ?? [])), t.push(Dt(r, e.metadata.dataTableRenderers ?? [], e.metadata.panels)), t.push(Et(r, e.metadata.commandPaletteResources ?? [])), t.push(...Ur(e)), t.push(...Pr({
2382
+ kn(e, t), t.push(...Rn(r, e.metadata)), t.push(...Cn(e, r)), t.push(...En(e, r)), t.push(cn(e)), t.push(Ar(e)), t.push(...Pn(e)), t.push(Gr(r, e.metadata.kanbanRenderers ?? [], void 0, e.metadata.panels, e.metadata.resourcePanels)), t.push(br(r, e.metadata.dataTableRenderers ?? [], e.metadata.panels, e.metadata.resourcePanels)), t.push(zt(r, e.metadata.commandPaletteResources ?? [])), t.push(...xn(e)), t.push(...mn({
1926
2383
  metadata: e.metadata,
1927
- routeResourceKind: e.routeResourceKind ?? ee,
2384
+ routeResourceKind: e.routeResourceKind ?? xe,
1928
2385
  workbench: e.workbench
1929
- })), t.push(...Kr({
2386
+ })), t.push(...hn({
1930
2387
  metadata: e.metadata,
1931
2388
  openHref: e.openHref,
1932
- routeResourceKind: e.routeResourceKind ?? ee,
2389
+ routeResourceKind: e.routeResourceKind ?? xe,
1933
2390
  workbench: e.workbench
1934
- })), t.push(..._r(e)), t.push(...Gr(e)), {
2391
+ })), t.push(...An(e)), t.push(...Mn(e));
2392
+ const n = On(e);
2393
+ return t.push(...n.disposables), t.push(...Dn(e, n.registry)), {
1935
2394
  dispose() {
1936
- Dr(t);
2395
+ wn(t);
2396
+ }
2397
+ };
2398
+ }, $n = (e, t, r = {}) => {
2399
+ t.kind === "tree" && e.renderers.refresh(t.id), t.kind === "file" && e.renderers.refreshFileRenderer(t.id, r), t.kind === "controls" && e.renderers.refreshControlsRenderer(t.id), t.kind === "dataTable" && e.renderers.refreshDataTableRenderer(t.id), t.kind === "kanban" && e.renderers.refreshKanbanRenderer(t.id);
2400
+ }, Fn = (e) => {
2401
+ const t = /* @__PURE__ */ new Map(), r = (n, o) => {
2402
+ for (const s of new Set(o.refreshEventIds ?? [])) {
2403
+ const i = t.get(s) ?? [];
2404
+ i.some((a) => a.kind === n && a.id === o.id) || i.push({
2405
+ id: o.id,
2406
+ kind: n
2407
+ }), t.set(s, i);
1937
2408
  }
1938
2409
  };
1939
- }, Yr = (e) => new Set((e.treeRenderers ?? []).flatMap((t) => [t.bodyCommandId, t.childrenCommandId, t.footerCommandId].filter((r) => r))), Xr = (e) => new Set((e.kanbanRenderers ?? []).map((t) => t.queryCommandId)), Jr = (e) => new Set((e.dataTableRenderers ?? []).map((t) => t.queryCommandId)), Ce = (e, t) => e.layout.listPanelInstances().find((r) => r.panelId === t), Zr = (e, t) => {
2410
+ for (const n of e.treeRenderers ?? []) r("tree", n);
2411
+ for (const n of e.fileRenderers ?? []) r("file", n);
2412
+ for (const n of e.controlsRenderers ?? []) r("controls", n);
2413
+ for (const n of e.dataTableRenderers ?? []) r("dataTable", n);
2414
+ for (const n of e.kanbanRenderers ?? []) r("kanban", n);
2415
+ return t;
2416
+ }, ro = (e) => {
2417
+ const t = Fn(e.metadata);
2418
+ return e.subscribe((r) => {
2419
+ const {
2420
+ id: n,
2421
+ ...o
2422
+ } = r;
2423
+ for (const s of t.get(n) ?? []) $n(e.workbench, s, o);
2424
+ });
2425
+ }, We = (e, t) => e.layout.listPanelInstances().find((r) => r.panelId === t), Bn = (e, t) => {
1940
2426
  if (t)
1941
2427
  try {
1942
2428
  e.layout.activatePanel(t);
1943
2429
  } catch {
1944
2430
  }
1945
- }, en = (e, t) => !Yr(e).has(t), tn = (e, t) => !Xr(e).has(t), rn = (e, t) => !Jr(e).has(t), nn = (e, t) => {
2431
+ }, no = (e, t) => {
1946
2432
  const r = e.layout.getLayout().activeWidgetId;
1947
2433
  for (const n of t.panels) {
1948
- if (!n.webview || n.region === "overlay") continue;
1949
- const o = Ce(e, n.id);
2434
+ if (!n.webview) continue;
2435
+ const o = We(e, n.id);
1950
2436
  o && e.layout.openPanel(n.id, {
1951
2437
  resource: o.resource,
1952
- title: u(n.title, o.title),
2438
+ title: f(n.title, o.title),
1953
2439
  strategy: {
1954
2440
  kind: "replace-panel",
1955
2441
  instanceId: o.instanceId
@@ -1958,49 +2444,46 @@ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1958
2444
  }
1959
2445
  for (const n of t.routes) {
1960
2446
  if (!n.webview) continue;
1961
- const o = Ce(e, n.id);
2447
+ const o = We(e, n.id);
1962
2448
  o && e.layout.openPanel(n.id, {
1963
2449
  resource: o.resource,
1964
- title: u(n.label, o.title),
2450
+ title: f(n.label, o.title),
1965
2451
  strategy: {
1966
2452
  kind: "replace-panel",
1967
2453
  instanceId: o.instanceId
1968
2454
  }
1969
2455
  });
1970
2456
  }
1971
- Zr(e, r);
1972
- }, hn = (e, t, r) => {
1973
- if (nn(e, t), en(t, r))
1974
- for (const n of t.treeRenderers ?? []) e.renderers.refresh(n.id);
1975
- if (tn(t, r))
1976
- for (const n of t.kanbanRenderers ?? []) e.renderers.refreshKanbanRenderer(n.id);
1977
- if (rn(t, r))
1978
- for (const n of t.dataTableRenderers ?? [])
1979
- e.renderers.refreshDataTableRenderer(n.id);
2457
+ Bn(e, r);
1980
2458
  };
1981
2459
  export {
1982
- K as BRIDGE_WEBVIEW_RENDERER_ID,
1983
- Ft as buildWorkbenchExtensionCommandPaletteRegistrations,
1984
- Vt as buildWorkbenchExtensionMenuRegistrations,
1985
- fn as buildWorkbenchExtensionRouteEntries,
1986
- It as createBridgeWebviewRenderer,
1987
- ut as createTerminalSessionCapability,
1988
- Ae as createWorkbenchWebviewHostCapabilities,
1989
- bn as emptyWorkbenchExtensionMetadata,
1990
- $ as panelMenuDeclarationOffsets,
1991
- nn as refreshOpenWorkbenchExtensionWebviews,
1992
- hn as refreshWorkbenchExtensionContributions,
1993
- Et as registerWorkbenchExtensionCommandPaletteResources,
1994
- pn as registerWorkbenchExtensionContributions,
1995
- un as registerWorkbenchExtensionControlsRenderers,
1996
- Dt as registerWorkbenchExtensionDataTableRenderers,
1997
- zt as registerWorkbenchExtensionFileRenderers,
1998
- pr as registerWorkbenchExtensionKanbanRenderers,
1999
- H as registerWorkbenchExtensionPanel,
2000
- xr as registerWorkbenchExtensionTreeRenderers,
2001
- Se as renderBridgeWebviewFrame,
2002
- rn as shouldRefreshWorkbenchExtensionDataTableRenderers,
2003
- en as shouldRefreshWorkbenchExtensionTrees,
2004
- A as toWorkbenchExtensionPlacementMetadata
2460
+ S as BRIDGE_WEBVIEW_RENDERER_ID,
2461
+ kr as buildWorkbenchExtensionCommandPaletteRegistrations,
2462
+ vr as buildWorkbenchExtensionMenuRegistrations,
2463
+ Zn as buildWorkbenchExtensionRouteEntries,
2464
+ er as compositionRequiredNotificationId,
2465
+ Ht as createBridgeWebviewRenderer,
2466
+ Pt as createTerminalSessionCapability,
2467
+ Gt as createWorkbenchCompositionRegistry,
2468
+ Oe as createWorkbenchWebviewHostCapabilities,
2469
+ Jn as emptyWorkbenchExtensionMetadata,
2470
+ eo as fileRendererRefreshEnvelopeFromCommand,
2471
+ Yt as listCompositionAddablePanels,
2472
+ K as panelMenuDeclarationOffsets,
2473
+ tr as reconcileCompositionLayout,
2474
+ no as refreshOpenWorkbenchExtensionWebviews,
2475
+ $n as refreshWorkbenchExtensionRenderer,
2476
+ zt as registerWorkbenchExtensionCommandPaletteResources,
2477
+ to as registerWorkbenchExtensionContributions,
2478
+ Xn as registerWorkbenchExtensionControlsRenderers,
2479
+ br as registerWorkbenchExtensionDataTableRenderers,
2480
+ Ar as registerWorkbenchExtensionFileRenderers,
2481
+ Gr as registerWorkbenchExtensionKanbanRenderers,
2482
+ D as registerWorkbenchExtensionPanel,
2483
+ ro as registerWorkbenchExtensionRendererRefreshEvents,
2484
+ cn as registerWorkbenchExtensionTreeRenderers,
2485
+ $e as renderBridgeWebviewFrame,
2486
+ Qt as toPanelPlacements,
2487
+ O as toWorkbenchCompositionPanelContribution
2005
2488
  };
2006
2489
  //# sourceMappingURL=extensions.js.map