@pstdio/workbench 0.10.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  import { jsxs as ge, jsx as N } from "react/jsx-runtime";
2
- import { useRef as v, useState as we, useEffect as K, createElement as V } from "react";
3
- import { host as Ze } from "rimless";
4
- import { ALWAYS_AVAILABLE_WEBVIEW_CAPABILITIES as et, WEBVIEW_HOST_CAPABILITY_VERSION as ce, WEBVIEW_HOST_CAPABILITIES as tt, WEBVIEW_SCOPED_DECLARABLE_CAPABILITIES as nt, resourceKey as B, isLocalizedString as ot, matchesResourceWhen as st } from "@pstdio/sdk/extensions";
5
- import { b as rt, W as _, a as it } from "./workspaces-DJwFj8uq.js";
6
- import { renderBadgeListDisplay as at } from "@pstdio/ui/kanban-renderer";
7
- import { w as dt } from "./workbench-menu-paths-B_QJzcNU.js";
8
- const ct = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e.$l10n == "string", lt = new Set(tt), mt = new Set(nt), Te = (e) => lt.has(e), Pe = (e) => mt.has(e), ut = (e) => {
2
+ import { useRef as v, useState as we, useEffect as K, createElement as D } from "react";
3
+ import { host as et } from "rimless";
4
+ import { ALWAYS_AVAILABLE_WEBVIEW_CAPABILITIES as tt, WEBVIEW_HOST_CAPABILITY_VERSION as ce, WEBVIEW_HOST_CAPABILITIES as nt, WEBVIEW_SCOPED_DECLARABLE_CAPABILITIES as ot, resourceKey as V, isLocalizedString as st, matchesResourceWhen as rt } from "@pstdio/sdk/extensions";
5
+ import { b as it, W as _, a as at } from "./workspaces-DJwFj8uq.js";
6
+ import { renderBadgeListDisplay as dt } from "@pstdio/ui/kanban-renderer";
7
+ import { w as ct } from "./workbench-menu-paths-B_QJzcNU.js";
8
+ const lt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e.$l10n == "string", mt = new Set(nt), ut = new Set(ot), Te = (e) => mt.has(e), Pe = (e) => ut.has(e), pt = (e) => {
9
9
  const [t = "", n] = e.split("@"), o = t.indexOf(":"), r = o === -1 ? t : t.slice(0, o), s = o === -1 ? void 0 : t.slice(o + 1), i = n === void 0 ? ce : Number(n);
10
10
  return {
11
11
  capability: e,
@@ -13,12 +13,12 @@ const ct = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
13
13
  scope: s,
14
14
  version: i
15
15
  };
16
- }, pt = (e) => Pe(e.name) ? !!e.scope : e.scope === void 0, L = (e) => ({
16
+ }, bt = (e) => Pe(e.name) ? !!e.scope : e.scope === void 0, L = (e) => ({
17
17
  capability: e,
18
18
  code: "unsupported_webview_capability",
19
19
  message: `Unsupported webview capability: ${e}`,
20
20
  severity: "error"
21
- }), bt = (e, t, n) => ({
21
+ }), ft = (e, t, n) => ({
22
22
  capability: e,
23
23
  code: "unsupported_webview_capability_version",
24
24
  message: `Unsupported webview capability version: ${t}@${n.toString()} (supported: ${ce.toString()})`,
@@ -28,18 +28,18 @@ const ct = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
28
28
  code: "undeclared_webview_capability",
29
29
  message: `Webview did not declare host capability: ${e}`,
30
30
  severity: "error"
31
- }), ft = (e, t = {}) => {
31
+ }), ht = (e, t = {}) => {
32
32
  const n = [], o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map();
33
- for (const s of et)
33
+ for (const s of tt)
34
34
  t[s] && o.add(s);
35
35
  for (const s of e ?? []) {
36
- const i = ut(s);
37
- if (!Te(i.name) || !pt(i)) {
36
+ const i = pt(s);
37
+ if (!Te(i.name) || !bt(i)) {
38
38
  n.push(L(s));
39
39
  continue;
40
40
  }
41
41
  if (i.version !== ce) {
42
- n.push(bt(s, i.name, i.version));
42
+ n.push(ft(s, i.name, i.version));
43
43
  continue;
44
44
  }
45
45
  if (!t[i.name]) {
@@ -58,15 +58,15 @@ const ct = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
58
58
  allowedScopes: r,
59
59
  diagnostics: n
60
60
  };
61
- }, ht = (e) => {
61
+ }, gt = (e) => {
62
62
  const t = e.params;
63
63
  return typeof t?.mount == "string" && t.mount.length > 0 ? t.mount : void 0;
64
- }, gt = (e) => {
64
+ }, wt = (e) => {
65
65
  const {
66
66
  allowed: t,
67
67
  allowedScopes: n,
68
68
  diagnostics: o
69
- } = ft(e.declaredCapabilities, e.capabilities), r = (i) => {
69
+ } = ht(e.declaredCapabilities, e.capabilities), r = (i) => {
70
70
  e.onDiagnostic?.(i);
71
71
  }, s = (i) => (r(i), new Error(i.message));
72
72
  return {
@@ -74,7 +74,7 @@ const ct = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
74
74
  async call(i) {
75
75
  if (!Te(i.method)) throw s(L(i.method));
76
76
  if (Pe(i.method)) {
77
- const d = ht(i);
77
+ const d = gt(i);
78
78
  if (!d) throw s(L(i.method));
79
79
  if (!n.get(i.method)?.has(d))
80
80
  throw s(Ie(`${i.method}:${d}`));
@@ -85,7 +85,7 @@ const ct = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
85
85
  return await a(i.params);
86
86
  }
87
87
  };
88
- }, wt = (e) => typeof e == "object" && e !== null, ye = (e) => {
88
+ }, It = (e) => typeof e == "object" && e !== null, ye = (e) => {
89
89
  try {
90
90
  const t = JSON.stringify(e);
91
91
  if (typeof t == "string" && t.length > 0) return t;
@@ -96,7 +96,7 @@ const ct = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
96
96
  } catch {
97
97
  return "Unknown error";
98
98
  }
99
- }, It = (e) => {
99
+ }, yt = (e) => {
100
100
  if (e instanceof Error) return {
101
101
  message: e.message,
102
102
  stack: e.stack
@@ -104,7 +104,7 @@ const ct = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
104
104
  if (typeof e == "string") return {
105
105
  message: e
106
106
  };
107
- if (wt(e)) {
107
+ if (It(e)) {
108
108
  const t = typeof e.message == "string" ? e.message : null, n = typeof e.stack == "string" ? e.stack : void 0;
109
109
  return t ? n ? {
110
110
  message: t,
@@ -134,20 +134,20 @@ const ct = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
134
134
  if (t === "dark" || t === "light") return t;
135
135
  const n = document.documentElement.getAttribute("data-color-mode");
136
136
  return n === "dark" || n === "light" ? n : e;
137
- }, yt = {
137
+ }, vt = {
138
138
  border: 0,
139
139
  display: "block",
140
140
  flex: "1 1 0%",
141
141
  height: "100%",
142
142
  minHeight: 0,
143
143
  width: "100%"
144
- }, vt = {
144
+ }, kt = {
145
145
  display: "flex",
146
146
  height: "100%",
147
147
  minHeight: 0,
148
148
  position: "relative",
149
149
  width: "100%"
150
- }, kt = {
150
+ }, xt = {
151
151
  alignItems: "center",
152
152
  background: "rgba(255, 255, 255, 0.92)",
153
153
  color: "#7a1f12",
@@ -158,7 +158,7 @@ const ct = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
158
158
  position: "absolute",
159
159
  textAlign: "center",
160
160
  zIndex: 1
161
- }, xt = "allow-scripts allow-forms allow-popups", Rt = (e) => {
161
+ }, Rt = "allow-scripts allow-forms allow-popups", Et = (e) => {
162
162
  const {
163
163
  view: t,
164
164
  props: n,
@@ -169,59 +169,59 @@ const ct = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
169
169
  onError: a,
170
170
  onDiagnostics: d,
171
171
  title: m
172
- } = e, l = v(null), c = v(null), p = v(null), u = v(!1), g = v(null), x = v(n), $ = v(o), O = v(r), H = v(s), z = v(t.webview.capabilities), te = v(i), T = v(a), f = v(d), [k, w] = we(null), [S, Q] = we(0);
173
- return x.current = n, $.current = o, O.current = r, H.current = s, z.current = t.webview.capabilities, te.current = i, T.current = a, f.current = d, K(() => {
172
+ } = e, l = v(null), c = v(null), p = v(null), u = v(!1), g = v(null), x = v(n), A = v(o), T = v(r), W = v(s), z = v(t.webview.capabilities), te = v(i), j = v(a), f = v(d), [k, w] = we(null), [P, Q] = we(0);
173
+ return x.current = n, A.current = o, T.current = r, W.current = s, z.current = t.webview.capabilities, te.current = i, j.current = a, f.current = d, K(() => {
174
174
  const h = l.current;
175
175
  if (!h) return;
176
- const A = () => {
176
+ const C = () => {
177
177
  c.current === h ? Q((y) => y + 1) : c.current = h;
178
178
  };
179
- h.addEventListener("load", A);
180
- const C = () => h.removeEventListener("load", A), F = `${S}
179
+ h.addEventListener("load", C);
180
+ const S = () => h.removeEventListener("load", C), F = `${P}
181
181
  ${t.webview.runtimeUrl}
182
182
  ${t.webview.moduleUrl}`;
183
- if (g.current === F) return C;
183
+ if (g.current === F) return S;
184
184
  g.current = F;
185
- const Ge = t.webview.styles, Ye = t.webview.moduleUrl, fe = (y) => {
185
+ const Ye = t.webview.styles, Xe = t.webview.moduleUrl, fe = (y) => {
186
186
  y.length > 0 && f.current?.(y);
187
- }, he = () => gt({
188
- capabilities: O.current ?? {},
187
+ }, he = () => wt({
188
+ capabilities: T.current ?? {},
189
189
  declaredCapabilities: z.current,
190
190
  onDiagnostic: (y) => fe([y])
191
191
  });
192
192
  fe(he().diagnostics);
193
- const Xe = {
193
+ const Je = {
194
194
  ready: () => {
195
195
  },
196
196
  runtimeError: (y) => {
197
- w(y.message), T.current?.(y);
197
+ w(y.message), j.current?.(y);
198
198
  },
199
199
  call: async (y) => await he().call(y)
200
200
  };
201
201
  return (() => {
202
202
  u.current = !1, p.current = null;
203
- const y = Ze.connect(h, Xe);
203
+ const y = et.connect(h, Je);
204
204
  h.contentWindow?.location.replace(t.webview.runtimeUrl), y.then(async (ne) => {
205
205
  if (l.current !== h) return;
206
- const W = ne.remote;
207
- p.current = W, H.current?.bind((Je) => W.hostEvent?.(Je)), await W.init({
208
- moduleUrl: Ye,
209
- styles: Ge,
206
+ const M = ne.remote;
207
+ p.current = M, W.current?.bind((Ze) => M.hostEvent?.(Ze)), await M.init({
208
+ moduleUrl: Xe,
209
+ styles: Ye,
210
210
  props: x.current,
211
- theme: se($.current),
211
+ theme: se(A.current),
212
212
  themeVariables: oe(),
213
213
  extensionId: t.extensionId
214
214
  }), l.current === h && (u.current = !0, w(null), te.current?.());
215
215
  }).catch((ne) => {
216
216
  if (l.current !== h) return;
217
- const W = It(ne);
218
- w(W.message), T.current?.(W);
217
+ const M = yt(ne);
218
+ w(M.message), j.current?.(M);
219
219
  });
220
- })(), C;
221
- }, [S, t.extensionId, t.webview.runtimeUrl, t.webview.moduleUrl, t.webview.styles]), K(() => {
220
+ })(), S;
221
+ }, [P, t.extensionId, t.webview.runtimeUrl, t.webview.moduleUrl, t.webview.styles]), K(() => {
222
222
  const h = p.current;
223
223
  if (!(!h || !s))
224
- return s.bind((A) => h.hostEvent?.(A)), () => s.unbind();
224
+ return s.bind((C) => h.hostEvent?.(C)), () => s.unbind();
225
225
  }, [s]), K(() => {
226
226
  u.current && p.current?.propsUpdate({
227
227
  props: n
@@ -234,22 +234,22 @@ ${t.webview.moduleUrl}`;
234
234
  }, [o]), K(() => {
235
235
  if (typeof window > "u" || typeof MutationObserver > "u") return;
236
236
  let h = null;
237
- const A = () => {
237
+ const C = () => {
238
238
  h !== null && cancelAnimationFrame(h), h = requestAnimationFrame(() => {
239
239
  h = null, u.current && p.current?.themeUpdate({
240
- theme: se($.current),
240
+ theme: se(A.current),
241
241
  variables: oe()
242
242
  });
243
243
  });
244
- }, C = new MutationObserver(A), F = {
244
+ }, S = new MutationObserver(C), F = {
245
245
  attributeFilter: ["class", "data-color-mode", "data-theme", "style"],
246
246
  attributes: !0
247
247
  };
248
- return C.observe(document.documentElement, F), C.observe(document.body, F), () => {
249
- C.disconnect(), h !== null && cancelAnimationFrame(h);
248
+ return S.observe(document.documentElement, F), S.observe(document.body, F), () => {
249
+ S.disconnect(), h !== null && cancelAnimationFrame(h);
250
250
  };
251
- }, []), /* @__PURE__ */ ge("div", { style: vt, children: [
252
- k ? /* @__PURE__ */ N("div", { role: "alert", style: kt, children: /* @__PURE__ */ ge("div", { children: [
251
+ }, []), /* @__PURE__ */ ge("div", { style: kt, children: [
252
+ k ? /* @__PURE__ */ N("div", { role: "alert", style: xt, children: /* @__PURE__ */ ge("div", { children: [
253
253
  /* @__PURE__ */ N("strong", { children: "Extension view failed to load." }),
254
254
  /* @__PURE__ */ N("div", { children: k })
255
255
  ] }) }) : null,
@@ -260,22 +260,24 @@ ${t.webview.moduleUrl}`;
260
260
  title: m ?? t.label,
261
261
  allow: "fullscreen",
262
262
  allowFullScreen: !0,
263
- sandbox: xt,
263
+ sandbox: Rt,
264
264
  style: {
265
- ...yt,
265
+ ...vt,
266
266
  colorScheme: o
267
267
  },
268
268
  onError: () => {
269
269
  const h = `Failed to load extension runtime at ${t.webview.runtimeUrl}`;
270
- w(h), T.current?.({
270
+ w(h), j.current?.({
271
271
  message: h
272
272
  });
273
273
  }
274
274
  },
275
- S
275
+ `${P}
276
+ ${t.webview.runtimeUrl}
277
+ ${t.webview.moduleUrl}`
276
278
  )
277
279
  ] });
278
- }, Et = () => {
280
+ }, At = () => {
279
281
  let e = null;
280
282
  const t = [], n = /* @__PURE__ */ new Set();
281
283
  return {
@@ -293,13 +295,13 @@ ${t.webview.moduleUrl}`;
293
295
  for (const o of n) o();
294
296
  }
295
297
  };
296
- }, At = "terminal.session", Ct = (e) => {
298
+ }, Ct = "terminal.session", St = (e) => {
297
299
  const {
298
300
  terminal: t,
299
301
  hostEvents: n
300
302
  } = e, o = (r) => {
301
303
  n.emit({
302
- scope: At,
304
+ scope: Ct,
303
305
  payload: r
304
306
  });
305
307
  };
@@ -373,7 +375,7 @@ ${t.webview.moduleUrl}`;
373
375
  }
374
376
  }
375
377
  };
376
- }, St = (e) => {
378
+ }, Tt = (e) => {
377
379
  if (typeof document > "u") return;
378
380
  const t = new KeyboardEvent("keydown", {
379
381
  ...e,
@@ -381,7 +383,7 @@ ${t.webview.moduleUrl}`;
381
383
  cancelable: !0
382
384
  });
383
385
  document.dispatchEvent(t);
384
- }, Tt = (e) => ({
386
+ }, Pt = (e) => ({
385
387
  ...e.placement?.placementIdentity ? {
386
388
  "placement.close": (t) => {
387
389
  if (t !== void 0 && (typeof t != "object" || t === null || Array.isArray(t) || Object.keys(t).length > 0))
@@ -419,35 +421,35 @@ ${t.webview.moduleUrl}`;
419
421
  value: n.value
420
422
  };
421
423
  },
422
- "host.dispatchKeyboardEvent": (t) => (e.dispatchKeyboardEvent ?? St)(t),
424
+ "host.dispatchKeyboardEvent": (t) => (e.dispatchKeyboardEvent ?? Tt)(t),
423
425
  ...e.hostEvents ? {
424
- "terminal.session": Ct({
426
+ "terminal.session": St({
425
427
  terminal: e.workbench.terminal,
426
428
  hostEvents: e.hostEvents
427
429
  })
428
430
  } : {}
429
- }), Pt = (e, t) => {
431
+ }), jt = (e, t) => {
430
432
  for (const n of t)
431
433
  console.warn(`[workbench.webview:${e}] ${n.code}/${n.capability}: ${n.message}`);
432
- }, jt = (e, t) => {
434
+ }, $t = (e, t) => {
433
435
  console.error(`[workbench.webview:${e}] runtime error: ${t}`);
434
- }, $t = () => "light", ve = /* @__PURE__ */ new WeakMap(), Ht = (e, t) => {
436
+ }, Ht = () => "light", ve = /* @__PURE__ */ new WeakMap(), Wt = (e, t) => {
435
437
  let n = ve.get(e);
436
438
  n || (n = /* @__PURE__ */ new Map(), ve.set(e, n));
437
439
  const o = t.instanceId;
438
440
  let r = n.get(o);
439
- return r || (r = Et(), n.set(o, r)), r;
440
- }, Wt = (e) => {
441
+ return r || (r = At(), n.set(o, r)), r;
442
+ }, Mt = (e) => {
441
443
  const {
442
444
  context: t,
443
445
  createHostCapabilities: n,
444
446
  createProps: o,
445
- createTheme: r = $t,
447
+ createTheme: r = Ht,
446
448
  ownerId: s,
447
449
  title: i,
448
450
  webview: a
449
451
  } = e;
450
- return /* @__PURE__ */ N(Rt, { view: {
452
+ return /* @__PURE__ */ N(Et, { view: {
451
453
  extensionId: s ?? "workbench",
452
454
  id: t.webviewId,
453
455
  label: a.title ?? i,
@@ -457,8 +459,8 @@ ${t.webview.moduleUrl}`;
457
459
  runtimeUrl: a.runtimeUrl,
458
460
  styles: a.styles ?? []
459
461
  }
460
- }, props: o(t), theme: r(t), capabilities: n(t), hostEvents: t.hostEvents, onDiagnostics: (d) => Pt(t.webviewId, d), onError: (d) => jt(t.webviewId, d.message) });
461
- }, b = (e, t = "") => e === void 0 ? t : ct(e) ? e.default ?? e.$l10n : e, R = (e) => !!(e && typeof e == "object" && !Array.isArray(e)), J = (e, t) => R(e) && e.kind === t && typeof e.id == "string", je = (e) => R(e) && typeof e.type == "string" && typeof e.id == "string", $e = (e) => e === void 0 || e === "preview" || e === "pin", le = (e, t = /* @__PURE__ */ new Set()) => {
462
+ }, props: o(t), theme: r(t), capabilities: n(t), hostEvents: t.hostEvents, onDiagnostics: (d) => jt(t.webviewId, d), onError: (d) => $t(t.webviewId, d.message) });
463
+ }, b = (e, t = "") => e === void 0 ? t : lt(e) ? e.default ?? e.$l10n : e, R = (e) => !!(e && typeof e == "object" && !Array.isArray(e)), J = (e, t) => R(e) && e.kind === t && typeof e.id == "string", je = (e) => R(e) && typeof e.type == "string" && typeof e.id == "string", $e = (e) => e === void 0 || e === "preview" || e === "pin", le = (e, t = /* @__PURE__ */ new Set()) => {
462
464
  if (!R(e) || e.kind !== "page" || !J(e.page, "page") || t.has(e) || e.resource !== void 0 && !je(e.resource) || e.section !== void 0 && !R(e.section) || !$e(e.open)) return !1;
463
465
  if (e.parent === void 0) return !0;
464
466
  const n = new Set(t);
@@ -467,7 +469,7 @@ ${t.webview.moduleUrl}`;
467
469
  if (!R(e) || e.kind !== "panel" || !R(e.panel)) return !1;
468
470
  const t = e.panel;
469
471
  return (J(t, "placement") || t.kind === "page-slot" && J(t.page, "page") && typeof t.id == "string") && (e.resource === void 0 || je(e.resource)) && $e(e.open);
470
- }, Mt = (e) => R(e) ? e.kind === "page" ? le(e) : e.kind === "panel" ? He(e) : e.kind === "href" ? typeof e.href == "string" : e.kind === "command" && R(e.target) && J(e.target.command, "command") && (e.target.params === void 0 || R(e.target.params)) : !1, Bt = (e) => Mt(e) ? !0 : !R(e) || e.kind !== "compound" || !Array.isArray(e.targets) || e.targets.length === 0 ? !1 : e.targets.every((t) => le(t) || He(t)), Vt = (e, t) => {
472
+ }, Bt = (e) => R(e) ? e.kind === "page" ? le(e) : e.kind === "panel" ? He(e) : e.kind === "href" ? typeof e.href == "string" : e.kind === "command" && R(e.target) && J(e.target.command, "command") && (e.target.params === void 0 || R(e.target.params)) : !1, We = (e) => Bt(e) ? !0 : !R(e) || e.kind !== "compound" || !Array.isArray(e.targets) || e.targets.length === 0 ? !1 : e.targets.every((t) => le(t) || He(t)), Vt = (e, t) => {
471
473
  const n = t.commandTargetOf?.(e);
472
474
  if (n) return n;
473
475
  const o = e.target.command, r = o.extensionId ?? t.extensionId;
@@ -479,15 +481,15 @@ ${t.webview.moduleUrl}`;
479
481
  }, ae = (e, t) => e.extensionId !== void 0 || t === void 0 ? e : {
480
482
  ...e,
481
483
  extensionId: t
482
- }, We = (e, t) => ({
484
+ }, Me = (e, t) => ({
483
485
  ...e,
484
486
  page: ae(e.page, t),
485
487
  ...e.parent ? {
486
- parent: We(e.parent, t)
488
+ parent: Me(e.parent, t)
487
489
  } : {}
488
490
  });
489
- function j(e, t = {}) {
490
- return e.kind === "command" ? Vt(e, t) : e.kind === "href" ? e : e.kind === "page" ? We(e, t.extensionId) : e.kind === "panel" ? {
491
+ function H(e, t = {}) {
492
+ return e.kind === "command" ? Vt(e, t) : e.kind === "href" ? e : e.kind === "page" ? Me(e, t.extensionId) : e.kind === "panel" ? {
491
493
  ...e,
492
494
  panel: e.panel.kind === "page-slot" ? {
493
495
  ...e.panel,
@@ -495,20 +497,20 @@ function j(e, t = {}) {
495
497
  } : ae(e.panel, t.extensionId)
496
498
  } : {
497
499
  kind: "compound",
498
- targets: e.targets.map((n) => j(n, t))
500
+ targets: e.targets.map((n) => H(n, t))
499
501
  };
500
502
  }
501
503
  const me = (e, t = {}) => {
502
504
  if (e != null) {
503
- if (!Bt(e)) throw new Error("Renderer callback returned an invalid navigation target.");
504
- return j(e, t);
505
+ if (!We(e)) throw new Error("Renderer callback returned an invalid navigation target.");
506
+ return H(e, t);
505
507
  }
506
508
  }, ee = (e) => {
507
509
  const t = e;
508
510
  if (!t?.outcome) return e;
509
511
  if (t.outcome.status === "success") return t.outcome.value;
510
512
  throw new Error(t.outcome.reason ?? t.outcome.error?.message ?? "Extension command failed.");
511
- }, D = (e) => ({
513
+ }, O = (e) => ({
512
514
  id: e.id,
513
515
  kind: e.kind,
514
516
  context: {
@@ -519,7 +521,7 @@ const me = (e, t = {}) => {
519
521
  if (!(!Dt(e) || e.deleted !== !0))
520
522
  return typeof e.id == "string" ? e.id : void 0;
521
523
  }, Ft = async (e, t, n) => {
522
- if (!t || Ot(n) !== (t.id ?? B(t)) || B(e.workbench.getPrimaryResource()) !== B(t)) return;
524
+ if (!t || Ot(n) !== (t.id ?? V(t)) || V(e.workbench.getPrimaryResource()) !== V(t)) return;
523
525
  const o = e.workbench.pageLocations.navigateToParent();
524
526
  if (!o.ok) throw new Error(o.diagnostic.message);
525
527
  }, E = async (e, t, n = {}) => {
@@ -550,7 +552,7 @@ const me = (e, t = {}) => {
550
552
  }), e.workbench.commandPaletteResources.refresh();
551
553
  return;
552
554
  }
553
- await e.workbench.navigation.openTarget(j(o, {
555
+ await e.workbench.navigation.openTarget(H(o, {
554
556
  extensionId: t.extensionId
555
557
  }));
556
558
  }, _t = (e, t, n, o) => ({
@@ -593,7 +595,7 @@ const me = (e, t = {}) => {
593
595
  }
594
596
  };
595
597
  }, re = (e, t = "") => b(e, t), qt = (e, t, n) => {
596
- const o = D({
598
+ const o = O({
597
599
  id: t.id,
598
600
  kind: "renderer",
599
601
  projectId: e.projectId,
@@ -630,7 +632,7 @@ const me = (e, t = {}) => {
630
632
  emptyDescription: re(t.emptyDescription, ""),
631
633
  defaultValues: t.defaultValues,
632
634
  executeQuery: async (s) => {
633
- const i = await r(t.queryHandlerId, {}, s ?? n.resolveResource?.(t)), a = rt.safeParse(i);
635
+ const i = await r(t.queryHandlerId, {}, s ?? n.resolveResource?.(t)), a = it.safeParse(i);
634
636
  if (!a.success) {
635
637
  const d = a.error.issues.map((m) => `body.query.${m.path.join(".")}: ${m.message}`).join("; ");
636
638
  throw new Error(`Extension "${t.extensionId}" view "${t.id}" has invalid controls. Expected serializable control declarations. ${d}`);
@@ -672,11 +674,11 @@ const me = (e, t = {}) => {
672
674
  for (let r = o.length - 1; r >= 0; r -= 1) o[r]?.dispose();
673
675
  }
674
676
  };
675
- }, P = (e, t = "") => b(e, t), ke = (e) => ({
677
+ }, $ = (e, t = "") => b(e, t), ke = (e) => ({
676
678
  ...e,
677
- label: P(e.label, e.id),
678
- description: e.description ? P(e.description) : void 0,
679
- icon: e.icon ? V(_, {
679
+ label: $(e.label, e.id),
680
+ description: e.description ? $(e.description) : void 0,
681
+ icon: e.icon ? D(_, {
680
682
  name: e.icon,
681
683
  size: 14
682
684
  }) : void 0
@@ -685,7 +687,7 @@ const me = (e, t = {}) => {
685
687
  values: e.values,
686
688
  resource: e.resource ? e.resource : void 0
687
689
  }), Yt = (e, t) => {
688
- const n = /* @__PURE__ */ new WeakMap(), o = D({
690
+ const n = /* @__PURE__ */ new WeakMap(), o = O({
689
691
  id: t.id,
690
692
  kind: "dataTableRenderer",
691
693
  projectId: e.projectId,
@@ -717,7 +719,7 @@ const me = (e, t = {}) => {
717
719
  });
718
720
  return e.workbench.views.registerView({
719
721
  id: t.id,
720
- title: P(t.title, t.id),
722
+ title: $(t.title, t.id),
721
723
  icon: t.icon,
722
724
  body: {
723
725
  kind: "dataTable",
@@ -728,8 +730,8 @@ const me = (e, t = {}) => {
728
730
  selectionMode: t.selectionMode,
729
731
  selectionActions: t.selectionActions?.map((s) => ({
730
732
  id: s.id,
731
- label: P(s.label, s.id),
732
- icon: s.icon ? V(_, {
733
+ label: $(s.label, s.id),
734
+ icon: s.icon ? D(_, {
733
735
  name: s.icon,
734
736
  size: 16
735
737
  }) : void 0,
@@ -739,8 +741,8 @@ const me = (e, t = {}) => {
739
741
  }).then(() => {
740
742
  })
741
743
  })),
742
- emptyTitle: t.emptyTitle ? P(t.emptyTitle) : void 0,
743
- emptyDescription: t.emptyDescription ? P(t.emptyDescription) : void 0,
744
+ emptyTitle: t.emptyTitle ? $(t.emptyTitle) : void 0,
745
+ emptyDescription: t.emptyDescription ? $(t.emptyDescription) : void 0,
744
746
  executeQuery: async ({
745
747
  resource: s,
746
748
  modeId: i
@@ -758,8 +760,8 @@ const me = (e, t = {}) => {
758
760
  },
759
761
  rowActions: t.rowActions?.map((s) => ({
760
762
  id: s.id,
761
- label: P(s.label, s.id),
762
- icon: s.icon ? V(_, {
763
+ label: $(s.label, s.id),
764
+ icon: s.icon ? D(_, {
763
765
  name: s.icon,
764
766
  size: 16
765
767
  }) : void 0,
@@ -809,7 +811,7 @@ const me = (e, t = {}) => {
809
811
  statuses: [],
810
812
  settingsPanels: [],
811
813
  settingsDefinitions: []
812
- }, Zt = (e) => `workbench.extension.menu.${e.id}`, en = (e) => `workbench.extension.palette.${e.id}`, Me = (e, t) => Jt[e.placement ?? "default"] * 1e3 + t, Be = (e) => e === void 0 ? "" : ot(e) ? e.default ?? e.$l10n : e, tn = (e) => {
814
+ }, Zt = (e) => `workbench.extension.menu.${e.id}`, en = (e) => `workbench.extension.palette.${e.id}`, Be = (e, t) => Jt[e.placement ?? "default"] * 1e3 + t, Ve = (e) => e === void 0 ? "" : st(e) ? e.default ?? e.$l10n : e, tn = (e) => {
813
815
  const {
814
816
  commandId: t,
815
817
  contribution: n,
@@ -826,7 +828,7 @@ const me = (e, t = {}) => {
826
828
  group: s.group ?? n.group,
827
829
  args: n.params,
828
830
  overflowLabel: s.overflowLabel,
829
- order: Me(n, o),
831
+ order: Be(n, o),
830
832
  when: i
831
833
  };
832
834
  }, nn = (e) => {
@@ -842,7 +844,7 @@ const me = (e, t = {}) => {
842
844
  icon: n.icon,
843
845
  group: n.group,
844
846
  args: n.params,
845
- order: Me(n, o)
847
+ order: Be(n, o)
846
848
  };
847
849
  }, on = (e) => {
848
850
  const {
@@ -851,7 +853,7 @@ const me = (e, t = {}) => {
851
853
  menuSlotsById: o,
852
854
  menuTargetsById: r,
853
855
  metadata: s,
854
- resolveString: i = Be
856
+ resolveString: i = Ve
855
857
  } = e, a = [], d = [];
856
858
  return s.menuContributions.forEach((m, l) => {
857
859
  const c = m.target ? r?.get(m.target) : o.get(m.slotId);
@@ -892,7 +894,7 @@ const me = (e, t = {}) => {
892
894
  const {
893
895
  createCommandId: t = en,
894
896
  metadata: n,
895
- resolveString: o = Be
897
+ resolveString: o = Ve
896
898
  } = e, r = [];
897
899
  return (n.commandPaletteContributions ?? []).forEach((s, i) => {
898
900
  const a = t(s), d = n.commands.find((m) => m.id === s.commandId);
@@ -953,7 +955,7 @@ const me = (e, t = {}) => {
953
955
  } : {}
954
956
  });
955
957
  return ee(a);
956
- }, Ve = (e) => {
958
+ }, De = (e) => {
957
959
  if (!e || typeof e != "object") return;
958
960
  const t = e.revision;
959
961
  return typeof t == "string" ? t : void 0;
@@ -963,7 +965,7 @@ const me = (e, t = {}) => {
963
965
  const r = o;
964
966
  if (typeof r.rendererId != "string" || typeof r.instanceId != "string" || typeof r.operationId != "string")
965
967
  return;
966
- const s = n?.fileRendererResourceKey, i = Ve(t.outcome.value);
968
+ const s = n?.fileRendererResourceKey, i = De(t.outcome.value);
967
969
  return {
968
970
  origin: {
969
971
  rendererId: r.rendererId,
@@ -992,10 +994,10 @@ const me = (e, t = {}) => {
992
994
  ...r ? {
993
995
  fileRendererOrigin: r
994
996
  } : {},
995
- ...B(n) ? {
996
- fileRendererResourceKey: B(n)
997
+ ...V(n) ? {
998
+ fileRendererResourceKey: V(n)
997
999
  } : {}
998
- }), i = Ve(s);
1000
+ }), i = De(s);
999
1001
  return i ? {
1000
1002
  revision: i
1001
1003
  } : void 0;
@@ -1010,6 +1012,47 @@ const me = (e, t = {}) => {
1010
1012
  for (let n = t.length - 1; n >= 0; n -= 1) t[n]?.dispose();
1011
1013
  }
1012
1014
  };
1015
+ }, cn = (e) => (n) => D(_, {
1016
+ name: e ?? "MoreHorizontal",
1017
+ ...n
1018
+ }), ln = (e, t) => ({
1019
+ color: e?.color,
1020
+ canDragIn: e?.canDragIn,
1021
+ canDragOut: e?.canDragOut,
1022
+ canCreate: e?.canCreate,
1023
+ actions: e?.actions?.map((n) => ({
1024
+ id: n.id,
1025
+ label: t(n.label, n.id),
1026
+ icon: cn(n.icon)
1027
+ }))
1028
+ }), Oe = (e, t) => `${t.extensionId ?? e.extensionId}.status.${t.id}`, mn = (e, t) => {
1029
+ const n = /* @__PURE__ */ new Map();
1030
+ return (o) => {
1031
+ const r = Oe(t, o), s = n.get(r);
1032
+ if (s) return s;
1033
+ const i = {
1034
+ getSnapshot: () => (e.workbench.statuses.getStatuses(r) ?? []).map((a) => ({
1035
+ value: a.id,
1036
+ label: a.label,
1037
+ color: a.color,
1038
+ icon: a.icon
1039
+ })),
1040
+ subscribe: (a) => e.workbench.statuses.store.subscribeSelector((d) => d.values[r], a)
1041
+ };
1042
+ return n.set(r, i), e.workbench.statuses.load(r).catch(() => {
1043
+ }), i;
1044
+ };
1045
+ }, un = (e, t, n, o, r) => {
1046
+ const s = n?.find((d) => d.id === o);
1047
+ if (s?.type.kind !== "status") return;
1048
+ const i = Oe(t, s.type.statuses), a = e.workbench.statuses.getStatuses(i)?.find((d) => d.id === r);
1049
+ return a ? {
1050
+ color: a.color
1051
+ } : void 0;
1052
+ }, pn = (e) => {
1053
+ if (e.defaultSettings?.columnGrouping) return e.defaultSettings.columnGrouping;
1054
+ const t = e.attributes?.filter((n) => n.type.kind === "status") ?? [];
1055
+ return t.length === 1 ? t[0]?.id : void 0;
1013
1056
  }, Re = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Ee = (e, t, n, o, r, s) => (t ?? []).map((i) => {
1014
1057
  const a = i.display, d = a?.kind === "badge-list" && typeof a.itemsAttributeId == "string" ? {
1015
1058
  kind: "badge-list",
@@ -1032,7 +1075,7 @@ const me = (e, t = {}) => {
1032
1075
  display: d
1033
1076
  };
1034
1077
  return o(e, m);
1035
- }), cn = (e, t, n, o, r = () => [], s) => {
1078
+ }), bn = (e, t, n, o, r = () => [], s) => {
1036
1079
  let i = Ee(e, t, n, o, r, s);
1037
1080
  const a = /* @__PURE__ */ new Set();
1038
1081
  return {
@@ -1045,13 +1088,13 @@ const me = (e, t = {}) => {
1045
1088
  for (const m of a) m();
1046
1089
  }
1047
1090
  };
1048
- }, ln = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), De = (e, t) => {
1091
+ }, fn = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), Fe = (e, t) => {
1049
1092
  const {
1050
1093
  resource: n
1051
1094
  } = t;
1052
- if (ln(n)) return n;
1053
- }, mn = (e, t) => {
1054
- const n = De(e, t);
1095
+ if (fn(n)) return n;
1096
+ }, hn = (e, t) => {
1097
+ const n = Fe(e, t);
1055
1098
  if (n) return n;
1056
1099
  if (e.resourceKind)
1057
1100
  return {
@@ -1059,14 +1102,14 @@ const me = (e, t = {}) => {
1059
1102
  id: t.id,
1060
1103
  label: t.title
1061
1104
  };
1062
- }, un = (e, t) => {
1105
+ }, gn = (e, t) => {
1063
1106
  const n = e, o = t(n);
1064
1107
  return o === void 0 ? n : {
1065
1108
  ...n,
1066
1109
  resource: o
1067
1110
  };
1068
- }, Oe = (...e) => Object.assign({}, ...e.filter((t) => !!t)), pn = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, bn = (e) => Object.keys(e ?? {}).length > 0, fn = /* @__PURE__ */ new Set(["text", "longtext", "markdown", "number", "boolean", "select", "multi-select", "files"]), hn = (e, t, n) => {
1069
- if (!fn.has(t.type)) return;
1111
+ }, Ke = (...e) => Object.assign({}, ...e.filter((t) => !!t)), wn = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, In = (e) => Object.keys(e ?? {}).length > 0, yn = /* @__PURE__ */ new Set(["text", "longtext", "markdown", "number", "boolean", "select", "multi-select", "files"]), vn = (e, t, n) => {
1112
+ if (!yn.has(t.type)) return;
1070
1113
  const o = "options" in t && Array.isArray(t.options) ? t.options : [], r = t;
1071
1114
  return {
1072
1115
  id: e,
@@ -1084,10 +1127,10 @@ const me = (e, t = {}) => {
1084
1127
  multiple: t.type === "files" ? r.multiple !== !1 : void 0,
1085
1128
  accept: t.type === "files" && typeof r.accept == "string" ? r.accept : void 0
1086
1129
  };
1087
- }, gn = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([n, o]) => {
1088
- const r = hn(n, o, t);
1130
+ }, kn = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([n, o]) => {
1131
+ const r = vn(n, o, t);
1089
1132
  return r ? [r] : [];
1090
- }), wn = (e, t) => D({
1133
+ }), xn = (e, t) => O({
1091
1134
  id: t.id,
1092
1135
  kind: "kanbanRenderer",
1093
1136
  projectId: e.projectId,
@@ -1111,28 +1154,28 @@ const me = (e, t = {}) => {
1111
1154
  ...o
1112
1155
  },
1113
1156
  resource: s,
1114
- slot: wn(e, t),
1157
+ slot: xn(e, t),
1115
1158
  metadata: {
1116
1159
  kanbanRendererId: t.id
1117
1160
  }
1118
1161
  });
1119
- }, Fe = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, In = (e, t, n) => (t.rowActions ?? []).map((o) => {
1162
+ }, Ne = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, Rn = (e, t, n) => (t.rowActions ?? []).map((o) => {
1120
1163
  const r = e.workbench.commands.getCommand(o.commandId)?.command;
1121
1164
  return e.workbench.commands.registerCommand({
1122
- id: Fe(t, o),
1165
+ id: Ne(t, o),
1123
1166
  label: n(o.label, o.id),
1124
1167
  icon: o.icon,
1125
1168
  params: r?.params
1126
1169
  }, {
1127
- execute: (s, i) => U(e, t, o.commandId, Oe(pn(s)), i?.resource)
1170
+ execute: (s, i) => U(e, t, o.commandId, Ke(wn(s)), i?.resource)
1128
1171
  });
1129
- }), yn = (e, t, n, o, r, s) => {
1130
- const i = Fe(t, n), a = e.workbench.commands.getCommand(i), d = {
1172
+ }), En = (e, t, n, o, r, s) => {
1173
+ const i = Ne(t, n), a = e.workbench.commands.getCommand(i), d = {
1131
1174
  rowId: o.id
1132
1175
  }, m = r ? {
1133
1176
  resource: r
1134
1177
  } : void 0, l = s(n.label, n.id);
1135
- return a && bn(a.command.params) ? (e.workbench.commandPalette.requestParams({
1178
+ return a && In(a.command.params) ? (e.workbench.commandPalette.requestParams({
1136
1179
  record: a,
1137
1180
  label: l,
1138
1181
  args: d,
@@ -1140,48 +1183,7 @@ const me = (e, t = {}) => {
1140
1183
  }), Promise.resolve()) : a ? e.workbench.commands.executeCommand(a.command.id, d, m).then(() => {
1141
1184
  }) : U(e, t, n.commandId, d, r).then(() => {
1142
1185
  });
1143
- }, vn = (e) => (n) => V(_, {
1144
- name: e ?? "MoreHorizontal",
1145
- ...n
1146
- }), kn = (e, t) => ({
1147
- color: e?.color,
1148
- canDragIn: e?.canDragIn,
1149
- canDragOut: e?.canDragOut,
1150
- canCreate: e?.canCreate,
1151
- actions: e?.actions?.map((n) => ({
1152
- id: n.id,
1153
- label: t(n.label, n.id),
1154
- icon: vn(n.icon)
1155
- }))
1156
- }), Ke = (e, t) => `${t.extensionId ?? e.extensionId}.status.${t.id}`, xn = (e, t) => {
1157
- const n = /* @__PURE__ */ new Map();
1158
- return (o) => {
1159
- const r = Ke(t, o), s = n.get(r);
1160
- if (s) return s;
1161
- const i = {
1162
- getSnapshot: () => (e.workbench.statuses.getStatuses(r) ?? []).map((a) => ({
1163
- value: a.id,
1164
- label: a.label,
1165
- color: a.color,
1166
- icon: a.icon
1167
- })),
1168
- subscribe: (a) => e.workbench.statuses.store.subscribeSelector((d) => d.values[r], a)
1169
- };
1170
- return n.set(r, i), e.workbench.statuses.load(r).catch(() => {
1171
- }), i;
1172
- };
1173
- }, Rn = (e, t, n, o, r) => {
1174
- const s = n?.find((d) => d.id === o);
1175
- if (s?.type.kind !== "status") return;
1176
- const i = Ke(t, s.type.statuses), a = e.workbench.statuses.getStatuses(i)?.find((d) => d.id === r);
1177
- return a ? {
1178
- color: a.color
1179
- } : void 0;
1180
- }, En = (e) => {
1181
- if (e.defaultSettings?.columnGrouping) return e.defaultSettings.columnGrouping;
1182
- const t = e.attributes?.filter((n) => n.type.kind === "status") ?? [];
1183
- return t.length === 1 ? t[0]?.id : void 0;
1184
- }, An = (e) => e ? V(_, {
1186
+ }, An = (e) => e ? D(_, {
1185
1187
  name: e,
1186
1188
  size: 16
1187
1189
  }) : void 0, Cn = (e, t) => {
@@ -1189,7 +1191,7 @@ const me = (e, t = {}) => {
1189
1191
  return {
1190
1192
  title: t(e.createRow.title, "Create row"),
1191
1193
  submitLabel: t(e.createRow.submitLabel, "Create"),
1192
- fields: gn(e, t),
1194
+ fields: kn(e, t),
1193
1195
  labels: {
1194
1196
  cancel: t(e.createRow.labels?.cancel, "Cancel"),
1195
1197
  properties: t(e.createRow.labels?.properties, "Properties"),
@@ -1217,7 +1219,7 @@ const me = (e, t = {}) => {
1217
1219
  const r = e.createRow;
1218
1220
  if (r)
1219
1221
  return async (s) => {
1220
- const i = Oe(s.values, r.columnParam ? {
1222
+ const i = Ke(s.values, r.columnParam ? {
1221
1223
  [r.columnParam]: s.columnId
1222
1224
  } : void 0, r.attributesParam ? {
1223
1225
  [r.attributesParam]: s.attributeValues
@@ -1239,7 +1241,7 @@ const me = (e, t = {}) => {
1239
1241
  const s = t.rowActions;
1240
1242
  if (s?.length)
1241
1243
  return (i) => s.map((a) => {
1242
- const d = r(t, i), m = () => yn(e, t, a, i, d, o);
1244
+ const d = r(t, i), m = () => En(e, t, a, i, d, o);
1243
1245
  return {
1244
1246
  key: a.id,
1245
1247
  label: o(a.label, a.id),
@@ -1258,23 +1260,23 @@ const me = (e, t = {}) => {
1258
1260
  const o = [], r = n.resolveLabel ?? ((l, c) => b(l, c)), s = (l, c) => {
1259
1261
  const p = c.display?.kind === "badge-list" ? {
1260
1262
  ...c,
1261
- render: (u, g) => at(c, u, g)
1263
+ render: (u, g) => dt(c, u, g)
1262
1264
  } : c;
1263
1265
  return n.decorateAttribute?.(l, p) ?? p;
1264
- }, i = n.resolveRowResource ?? De, a = n.resolveRowActionResource ?? mn, d = n.onAfterMutation ?? (() => {
1266
+ }, i = n.resolveRowResource ?? Fe, a = n.resolveRowActionResource ?? hn, d = n.onAfterMutation ?? (() => {
1265
1267
  }), m = (l, c, p) => U(e, l, c, p).then((u) => (d(l), u));
1266
1268
  for (const l of t) {
1267
- const c = xn(e, l), p = (f, k) => e.workbench.notifications.show({
1269
+ const c = mn(e, l), p = (f, k) => e.workbench.notifications.show({
1268
1270
  id: `workbench.extension.${l.extensionId}.kanban.${l.id}.display.${f}`,
1269
1271
  level: "error",
1270
1272
  title: "Extension display is not available",
1271
1273
  message: `Attribute "${f}" in renderer "${l.id}" uses unknown display kind "${k}".`
1272
- }), u = cn(l, l.attributes, r, s, c, p);
1273
- let g = l.attributes, x = En(l);
1274
- const $ = /* @__PURE__ */ new WeakMap();
1275
- let O, H = 0;
1276
- const z = (f) => i(l, f), T = Sn(e, l, n, i, (f) => $.get(f) ?? f);
1277
- o.push(...In(e, l, r)), o.push(e.workbench.views.registerView({
1274
+ }), u = bn(l, l.attributes, r, s, c, p);
1275
+ let g = l.attributes, x = pn(l);
1276
+ const A = /* @__PURE__ */ new WeakMap();
1277
+ let T, W = 0;
1278
+ const z = (f) => i(l, f), j = Sn(e, l, n, i, (f) => A.get(f) ?? f);
1279
+ o.push(...Rn(e, l, r)), o.push(e.workbench.views.registerView({
1278
1280
  id: l.id,
1279
1281
  title: r(l.title, l.id),
1280
1282
  icon: l.icon,
@@ -1294,23 +1296,23 @@ const me = (e, t = {}) => {
1294
1296
  emptyDescription: r(l.emptyDescription, ""),
1295
1297
  hideToolbar: l.hideToolbar,
1296
1298
  createRow: Cn(l, r),
1297
- getBoardColumnConfig: (f) => kn(O?.[f] ?? Rn(e, l, g, x, f), r),
1298
- onRowActivate: T,
1299
+ getBoardColumnConfig: (f) => ln(T?.[f] ?? un(e, l, g, x, f), r),
1300
+ onRowActivate: j,
1299
1301
  executeQuery: async (f) => {
1300
- H += 1;
1301
- const k = H, w = await U(e, l, l.queryHandlerId, {
1302
+ W += 1;
1303
+ const k = W, w = await U(e, l, l.queryHandlerId, {
1302
1304
  settings: f.settings,
1303
1305
  filters: f.filters
1304
- }), S = (h) => h.map((A) => {
1305
- const C = un(A, z);
1306
- return $.set(C, A), C;
1306
+ }), P = (h) => h.map((C) => {
1307
+ const S = gn(C, z);
1308
+ return A.set(S, C), S;
1307
1309
  });
1308
- if (k !== H)
1309
- return Array.isArray(w) ? S(w) : Re(w) ? S(w.rows ?? []) : [];
1310
- if (x = f.settings.columnGrouping, Array.isArray(w)) return S(w);
1310
+ if (k !== W)
1311
+ return Array.isArray(w) ? P(w) : Re(w) ? P(w.rows ?? []) : [];
1312
+ if (x = f.settings.columnGrouping, Array.isArray(w)) return P(w);
1311
1313
  if (!Re(w)) return [];
1312
1314
  const Q = w.attributes ?? g;
1313
- return g = Q, u.set(Q), O = w.boardColumnConfigs, S(w.rows ?? []);
1315
+ return g = Q, u.set(Q), T = w.boardColumnConfigs, P(w.rows ?? []);
1314
1316
  },
1315
1317
  onAttributeChange: l.attributeChangeHandlerId ? (f, k, w) => m(l, l.attributeChangeHandlerId, {
1316
1318
  rowId: f,
@@ -1323,7 +1325,7 @@ const me = (e, t = {}) => {
1323
1325
  beforeRowId: k
1324
1326
  }).then(() => {
1325
1327
  }) : void 0,
1326
- onCreateRow: Tn(l, n, m, l.rowActivationHandlerId ? T : void 0),
1328
+ onCreateRow: Tn(l, n, m, l.rowActivationHandlerId ? j : void 0),
1327
1329
  onColumnAction: l.columnActionHandlerId ? async (f, k) => {
1328
1330
  await m(l, l.columnActionHandlerId, {
1329
1331
  columnId: f,
@@ -1346,30 +1348,6 @@ const me = (e, t = {}) => {
1346
1348
  label: o.label === void 0 ? void 0 : t(o.label, n),
1347
1349
  description: o.description === void 0 ? void 0 : t(o.description)
1348
1350
  }]));
1349
- }, Hn = (e, t) => e.panels.flatMap((n) => [n, ...n.panelMenus ?? []]).filter((n) => n.renderer?.kind === "tree" && n.renderer.id === t.id), Ne = (e, t) => t.viewId ? e.find((n) => n.id === t.viewId) : e.length === 1 ? e[0] : void 0, Wn = async (e) => {
1350
- const {
1351
- ctx: t,
1352
- getHostTreeHeaderNodes: n,
1353
- record: o,
1354
- treeViews: r
1355
- } = e, s = Ne(r, t);
1356
- return !s || !("hostTreeHeader" in s) || s.hostTreeHeader !== "default" ? [] : await n?.({
1357
- ctx: t,
1358
- record: o,
1359
- panel: s
1360
- }) ?? [];
1361
- }, Mn = async (e) => {
1362
- const {
1363
- ctx: t,
1364
- getHostTreeFooterNodes: n,
1365
- record: o,
1366
- treeViews: r
1367
- } = e, s = Ne(r, t);
1368
- return !s || !("hostTreeFooter" in s) || s.hostTreeFooter !== "default" ? [] : await n?.({
1369
- ctx: t,
1370
- record: o,
1371
- panel: s
1372
- }) ?? [];
1373
1351
  }, Le = (e) => ({
1374
1352
  id: e.treeId,
1375
1353
  kind: "renderer",
@@ -1454,6 +1432,30 @@ const me = (e, t = {}) => {
1454
1432
  }
1455
1433
  });
1456
1434
  return ee(a);
1435
+ }, Hn = (e, t) => e.panels.flatMap((n) => [n, ...n.panelMenus ?? []]).filter((n) => n.renderer?.kind === "tree" && n.renderer.id === t.id), Ue = (e, t) => t.viewId ? e.find((n) => n.id === t.viewId) : e.length === 1 ? e[0] : void 0, Wn = async (e) => {
1436
+ const {
1437
+ ctx: t,
1438
+ getHostTreeHeaderNodes: n,
1439
+ record: o,
1440
+ treeViews: r
1441
+ } = e, s = Ue(r, t);
1442
+ return !s || !("hostTreeHeader" in s) || s.hostTreeHeader !== "default" ? [] : await n?.({
1443
+ ctx: t,
1444
+ record: o,
1445
+ panel: s
1446
+ }) ?? [];
1447
+ }, Mn = async (e) => {
1448
+ const {
1449
+ ctx: t,
1450
+ getHostTreeFooterNodes: n,
1451
+ record: o,
1452
+ treeViews: r
1453
+ } = e, s = Ue(r, t);
1454
+ return !s || !("hostTreeFooter" in s) || s.hostTreeFooter !== "default" ? [] : await n?.({
1455
+ ctx: t,
1456
+ record: o,
1457
+ panel: s
1458
+ }) ?? [];
1457
1459
  }, Bn = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, Ae = (e) => e && !Array.isArray(e) ? e : void 0, Vn = (e, t) => {
1458
1460
  const n = /* @__PURE__ */ new WeakMap(), o = `workbench.extensionTreeRenderer.${t.id}.command`, r = (c) => e.resolveNodeResource?.(c) ?? c, s = (c) => {
1459
1461
  if (c.emptyState)
@@ -1462,15 +1464,17 @@ const me = (e, t = {}) => {
1462
1464
  description: b(c.emptyState.description),
1463
1465
  icon: c.emptyState.icon
1464
1466
  };
1465
- }, i = (c, p, u) => c ? j(c, {
1467
+ }, i = (c, p, u) => c ? H(c, {
1466
1468
  commandTargetOf: (x) => ({
1467
1469
  kind: "command",
1468
1470
  commandId: o,
1469
1471
  args: {
1470
1472
  commandId: `${x.target.command.extensionId ?? t.extensionId}.command.${x.target.command.id}`,
1471
- nodeId: p.id,
1473
+ ...p ? {
1474
+ nodeId: p.id
1475
+ } : {},
1472
1476
  params: x.target.params,
1473
- resource: p.resource ?? u.resource,
1477
+ resource: p?.resource ?? u.resource,
1474
1478
  treeId: t.id
1475
1479
  }
1476
1480
  }),
@@ -1489,7 +1493,10 @@ const me = (e, t = {}) => {
1489
1493
  // Actions mutate tree data (create/delete/...), so refresh afterwards. Plain
1490
1494
  // node-target navigation runs through the runner command and must not refetch.
1491
1495
  run: g ? async (x) => {
1492
- await _e(e, t, g, Bn(x, Ae(c.params)), p?.resource ?? u.resource), u.refresh();
1496
+ const A = await _e(e, t, g, Bn(x, Ae(c.params)), p?.resource ?? u.resource);
1497
+ u.refresh();
1498
+ const T = We(A) ? i(A, p, u) : void 0;
1499
+ T && await e.workbench.navigation.openTarget(T);
1493
1500
  } : void 0
1494
1501
  };
1495
1502
  }, d = (c, p) => {
@@ -1604,7 +1611,7 @@ const me = (e, t = {}) => {
1604
1611
  for (let n = t.length - 1; n >= 0; n -= 1) t[n]?.dispose();
1605
1612
  }
1606
1613
  };
1607
- }, I = (e) => e.extensionId === "pstdio" ? e.id : `${e.extensionId}.${e.kind}.${e.id}`, Z = (e) => e.extensionId === "pstdio" ? e.id : `${e.extensionId}.command.${e.id}`, Ue = (e) => {
1614
+ }, I = (e) => e.extensionId === "pstdio" ? e.id : `${e.extensionId}.${e.kind}.${e.id}`, Z = (e) => e.extensionId === "pstdio" ? e.id : `${e.extensionId}.command.${e.id}`, qe = (e) => {
1608
1615
  if (!e) return;
1609
1616
  const t = (n) => {
1610
1617
  if (n)
@@ -1617,7 +1624,7 @@ const me = (e, t = {}) => {
1617
1624
  resourceType: e.resourceType?.map((n) => n.id),
1618
1625
  metadata: e.metadata
1619
1626
  };
1620
- }, Qo = Ue, ue = (e) => ({
1627
+ }, Qo = qe, ue = (e) => ({
1621
1628
  kind: e.kind,
1622
1629
  id: I(e),
1623
1630
  extensionId: e.extensionId
@@ -1630,7 +1637,7 @@ const me = (e, t = {}) => {
1630
1637
  icon: e.icon,
1631
1638
  canHide: !0,
1632
1639
  canReorder: !0,
1633
- target: j(e.action, {
1640
+ target: H(e.action, {
1634
1641
  extensionId: e.extensionId
1635
1642
  })
1636
1643
  }), Ln = (e, t, n) => {
@@ -1684,7 +1691,7 @@ const me = (e, t = {}) => {
1684
1691
  if (e.includes("win")) return "win";
1685
1692
  if (e.includes("linux")) return "linux";
1686
1693
  }, Yn = (e, t = Gn()) => (t ? e.platformOverrides?.[t] : void 0) ?? e.key, Xn = (e) => e.bindings.map((t) => e.workbench.keybindings.registerKeybinding({
1687
- action: j(t.action, {
1694
+ action: H(t.action, {
1688
1695
  commandIdOf: (n) => n.extensionId ? Z({
1689
1696
  extensionId: n.extensionId,
1690
1697
  id: n.id
@@ -1739,7 +1746,7 @@ const me = (e, t = {}) => {
1739
1746
  view: o.main.view
1740
1747
  }] : [], ...o.slots.flatMap((r) => r.item.kind === "binding" ? [r.item.binding] : [])]);
1741
1748
  return n.push(...e.placements.flatMap((o) => o.item.kind === "binding" ? [o.item.binding] : [])), n.find((o) => I(o.view) === t)?.kinds[0]?.id;
1742
- }, qe = (e) => e.body.kind === "webview" ? {
1749
+ }, ze = (e) => e.body.kind === "webview" ? {
1743
1750
  webview: e.body.webview
1744
1751
  } : {
1745
1752
  renderer: {
@@ -1760,7 +1767,7 @@ const me = (e, t = {}) => {
1760
1767
  placement: n.placement,
1761
1768
  hostTreeHeader: n.hostTreeHeader,
1762
1769
  hostTreeFooter: n.hostTreeFooter,
1763
- ...qe(o)
1770
+ ...ze(o)
1764
1771
  }] : [];
1765
1772
  }), no = (e) => e.views.map((t) => {
1766
1773
  const n = to(e, t);
@@ -1770,7 +1777,7 @@ const me = (e, t = {}) => {
1770
1777
  title: t.title,
1771
1778
  icon: t.icon,
1772
1779
  panelMenus: n.length > 0 ? n : void 0,
1773
- ...qe(t)
1780
+ ...ze(t)
1774
1781
  };
1775
1782
  }), de = (e) => e?.map(({
1776
1783
  command: t,
@@ -1928,7 +1935,7 @@ const me = (e, t = {}) => {
1928
1935
  viewId: I(o.view),
1929
1936
  slot: o.slot.id.endsWith("leading") ? "leading" : "trailing",
1930
1937
  order: o.order,
1931
- when: Ue(o.when)
1938
+ when: qe(o.when)
1932
1939
  })),
1933
1940
  diagnostics: e.diagnostics
1934
1941
  };
@@ -1963,7 +1970,7 @@ const me = (e, t = {}) => {
1963
1970
  for (const n of t.views)
1964
1971
  n.body.kind === "webview" && e.views.getView(n.id) && e.views.refreshView(n.id);
1965
1972
  }, bo = (e) => (t) => ({
1966
- ...Tt({
1973
+ ...Pt({
1967
1974
  workbench: t.workbench,
1968
1975
  placement: t.placement,
1969
1976
  hostEvents: t.hostEvents
@@ -1971,7 +1978,7 @@ const me = (e, t = {}) => {
1971
1978
  "navigation.open": (o) => {
1972
1979
  const r = o;
1973
1980
  if (!r.target) throw new Error("navigation.open requires a target.");
1974
- return t.workbench.navigation.openTarget(j(r.target, {
1981
+ return t.workbench.navigation.openTarget(H(r.target, {
1975
1982
  extensionId: e.extensionIdForWebview(t.webviewId)
1976
1983
  }));
1977
1984
  },
@@ -1985,7 +1992,7 @@ const me = (e, t = {}) => {
1985
1992
  ...s ? {
1986
1993
  resource: s
1987
1994
  } : {},
1988
- slot: D({
1995
+ slot: O({
1989
1996
  id: t.webviewId,
1990
1997
  kind: e.slotKind,
1991
1998
  projectId: e.projectId,
@@ -2014,7 +2021,7 @@ const me = (e, t = {}) => {
2014
2021
  moduleUrl: e.moduleUrl,
2015
2022
  styles: e.styles,
2016
2023
  capabilities: e.capabilities
2017
- }), ze = "extensions", ho = 1e3, go = 25, wo = (e) => e === void 0 ? void 0 : e, Io = (e) => e === "global" ? "user" : "project", yo = (e, t) => t ? (n) => ({
2024
+ }), Qe = "extensions", ho = 1e3, go = 25, wo = (e) => e === void 0 ? void 0 : e, Io = (e) => e === "global" ? "user" : "project", yo = (e, t) => t ? (n) => ({
2018
2025
  ...e(n),
2019
2026
  ...t(n)
2020
2027
  }) : e, vo = (e, t) => {
@@ -2038,12 +2045,12 @@ const me = (e, t = {}) => {
2038
2045
  kind: "react",
2039
2046
  render: (o) => {
2040
2047
  const r = e.metadata.settingsPanels.some((s) => s.id === o.instance.panelId && s.viewId === t.id) ? "settings" : "panel";
2041
- return e.renderWebview?.(o) ?? Wt({
2048
+ return e.renderWebview?.(o) ?? Mt({
2042
2049
  context: {
2043
2050
  workbench: o.workbench,
2044
2051
  webviewId: t.id,
2045
2052
  placement: o.instance,
2046
- hostEvents: Ht(o.workbench, o.instance)
2053
+ hostEvents: Wt(o.workbench, o.instance)
2047
2054
  },
2048
2055
  createHostCapabilities: vo(e, r),
2049
2056
  createProps: e.createWebviewProps ?? (({
@@ -2102,7 +2109,7 @@ const me = (e, t = {}) => {
2102
2109
  title: "Statuses",
2103
2110
  body: {
2104
2111
  kind: "react",
2105
- render: () => V(it, {
2112
+ render: () => D(at, {
2106
2113
  workbench: e.workbench
2107
2114
  })
2108
2115
  }
@@ -2112,12 +2119,12 @@ const me = (e, t = {}) => {
2112
2119
  icon: "list-checks",
2113
2120
  kind: "view",
2114
2121
  order: go,
2115
- section: e.settingsSectionId ?? ze,
2122
+ section: e.settingsSectionId ?? Qe,
2116
2123
  scope: "project",
2117
2124
  viewId: o
2118
2125
  })), r;
2119
2126
  }, Ao = (e) => {
2120
- const t = [], n = e.settingsSectionId ?? ze;
2127
+ const t = [], n = e.settingsSectionId ?? Qe;
2121
2128
  e.workbench.settings.getSection(n) || t.push(e.workbench.settings.registerSection({
2122
2129
  id: n,
2123
2130
  title: e.settingsSectionTitle ?? "Extensions"
@@ -2153,16 +2160,16 @@ const me = (e, t = {}) => {
2153
2160
  viewId: a.viewId
2154
2161
  }));
2155
2162
  return t;
2156
- }, M = (e) => !!(e && typeof e == "object" && !Array.isArray(e)), Co = (e, t) => {
2157
- if (!M(e)) return {};
2158
- const n = M(e.indicator) ? {
2163
+ }, B = (e) => !!(e && typeof e == "object" && !Array.isArray(e)), Co = (e, t) => {
2164
+ if (!B(e)) return {};
2165
+ const n = B(e.indicator) ? {
2159
2166
  icon: String(e.indicator.icon ?? ""),
2160
2167
  color: typeof e.indicator.color == "string" ? e.indicator.color : void 0,
2161
2168
  label: b(e.indicator.label)
2162
- } : void 0, o = Array.isArray(e.menu) ? e.menu.flatMap((r) => !M(r) || typeof r.id != "string" || !Array.isArray(r.rows) ? [] : [{
2169
+ } : void 0, o = Array.isArray(e.menu) ? e.menu.flatMap((r) => !B(r) || typeof r.id != "string" || !Array.isArray(r.rows) ? [] : [{
2163
2170
  id: r.id,
2164
2171
  rows: r.rows.flatMap((s) => {
2165
- if (!M(s) || typeof s.id != "string") return [];
2172
+ if (!B(s) || typeof s.id != "string") return [];
2166
2173
  const i = me(s.action, {
2167
2174
  extensionId: t
2168
2175
  });
@@ -2192,7 +2199,7 @@ const me = (e, t = {}) => {
2192
2199
  o.add(a.instanceId);
2193
2200
  const d = a.resource ? {
2194
2201
  type: a.resource.type,
2195
- id: a.resource.id ?? B(a.resource),
2202
+ id: a.resource.id ?? V(a.resource),
2196
2203
  label: a.resource.label,
2197
2204
  metadata: a.resource.metadata
2198
2205
  } : void 0;
@@ -2213,7 +2220,7 @@ const me = (e, t = {}) => {
2213
2220
  }
2214
2221
  }
2215
2222
  })).then((m) => {
2216
- const l = M(m) && M(m.outcome) ? m.outcome.value : m;
2223
+ const l = B(m) && B(m.outcome) ? m.outcome.value : m;
2217
2224
  n.set(a.instanceId, Co(l, t.extensionId));
2218
2225
  for (const c of r) c();
2219
2226
  }).finally(() => o.delete(a.instanceId));
@@ -2248,7 +2255,7 @@ const me = (e, t = {}) => {
2248
2255
  params: pe(o),
2249
2256
  resource: r?.resource
2250
2257
  })
2251
- })), Qe = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), Po = (e, t) => {
2258
+ })), Ge = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), Po = (e, t) => {
2252
2259
  if (!e.menuSlotsById) return [];
2253
2260
  const {
2254
2261
  registrations: n
@@ -2275,8 +2282,8 @@ const me = (e, t = {}) => {
2275
2282
  ...s.contribution.params ?? {},
2276
2283
  ...pe(i) ?? {}
2277
2284
  },
2278
- resource: Qe(e, a),
2279
- slot: D({
2285
+ resource: Ge(e, a),
2286
+ slot: O({
2280
2287
  id: s.contribution.slotId,
2281
2288
  kind: "menu",
2282
2289
  projectId: e.projectId,
@@ -2298,8 +2305,8 @@ const me = (e, t = {}) => {
2298
2305
  ...o.contribution.params ?? {},
2299
2306
  ...pe(r) ?? {}
2300
2307
  },
2301
- resource: Qe(e, s),
2302
- slot: D({
2308
+ resource: Ge(e, s),
2309
+ slot: O({
2303
2310
  id: "workbench.commandPalette",
2304
2311
  kind: "menu",
2305
2312
  projectId: e.projectId,
@@ -2308,8 +2315,8 @@ const me = (e, t = {}) => {
2308
2315
  }
2309
2316
  })
2310
2317
  }),
2311
- isVisible: () => st(o.contribution.when, e.workbench.getPrimaryResource()?.type)
2312
- }), e.workbench.layout.registerMenuItem(dt, o.menuItem)]), $o = (e, t) => {
2318
+ isVisible: () => rt(o.contribution.when, e.workbench.getPrimaryResource()?.type)
2319
+ }), e.workbench.layout.registerMenuItem(ct, o.menuItem)]), $o = (e, t) => {
2313
2320
  const n = t?.mode;
2314
2321
  if (!n) return !0;
2315
2322
  const o = e.workbench.modes.getActiveModeId() ?? "";
@@ -2369,12 +2376,12 @@ const me = (e, t = {}) => {
2369
2376
  export {
2370
2377
  sn as buildWorkbenchExtensionCommandPaletteRegistrations,
2371
2378
  on as buildWorkbenchExtensionMenuRegistrations,
2372
- Ct as createTerminalSessionCapability,
2373
- Tt as createWorkbenchWebviewHostCapabilities,
2379
+ St as createTerminalSessionCapability,
2380
+ Pt as createWorkbenchWebviewHostCapabilities,
2374
2381
  qo as emptyWorkbenchExtensionMetadata,
2375
2382
  zo as fileRendererRefreshEnvelopeFromCommand,
2376
- Ht as getBridgeWebviewHostEventPublisher,
2377
- Bt as isExtensionNavigationTarget,
2383
+ Wt as getBridgeWebviewHostEventPublisher,
2384
+ We as isExtensionNavigationTarget,
2378
2385
  Go as refreshOpenWorkbenchExtensionWebviews,
2379
2386
  mo as refreshWorkbenchExtensionRenderer,
2380
2387
  Ut as registerWorkbenchExtensionCommandPaletteResources,
@@ -2385,8 +2392,8 @@ export {
2385
2392
  jn as registerWorkbenchExtensionKanbanRenderers,
2386
2393
  po as registerWorkbenchExtensionRendererRefreshEvents,
2387
2394
  Fn as registerWorkbenchExtensionTreeRenderers,
2388
- Wt as renderBridgeWebviewFrame,
2389
- j as toWorkbenchNavigationTarget,
2395
+ Mt as renderBridgeWebviewFrame,
2396
+ H as toWorkbenchNavigationTarget,
2390
2397
  me as toWorkbenchNavigationTargetResult,
2391
2398
  Qo as toWorkbenchWhenExpression
2392
2399
  };