@pstdio/workbench 0.41.0 → 0.43.0-nightly.20261011183426
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extensions.d.ts +15 -9
- package/dist/extensions.js +323 -250
- package/dist/extensions.js.map +1 -1
- package/dist/{file-renderer-view-CiuJ_aMB.js → file-renderer-view-CTVhwDGe.js} +26 -26
- package/dist/{file-renderer-view-CiuJ_aMB.js.map → file-renderer-view-CTVhwDGe.js.map} +1 -1
- package/dist/{index-Dh0tRr9k.d.ts → index-dbYXNnIr.d.ts} +79 -8
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1668 -1625
- package/dist/index.js.map +1 -1
- package/dist/{kanban-presentation-C21WIlnn.d.ts → kanban-presentation-DnZgAsZo.d.ts} +1 -1
- package/dist/navigation-tree-registry-CIwRvLFJ.js +120 -0
- package/dist/navigation-tree-registry-CIwRvLFJ.js.map +1 -0
- package/dist/react-vsxj0hQ2.js +10718 -0
- package/dist/react-vsxj0hQ2.js.map +1 -0
- package/dist/react.d.ts +53 -12
- package/dist/react.js +2 -2
- package/dist/storage.d.ts +1 -1
- package/dist/webview-runtime.js +1 -1
- package/dist/{workbench-renderers-CUHzLWMx.js → workbench-renderers-Bj4sazP5.js} +94 -36
- package/dist/workbench-renderers-Bj4sazP5.js.map +1 -0
- package/package.json +4 -4
- package/dist/navigation-tree-registry-DkJ3i8ym.js +0 -106
- package/dist/navigation-tree-registry-DkJ3i8ym.js.map +0 -1
- package/dist/react-B-rd34kK.js +0 -9750
- package/dist/react-B-rd34kK.js.map +0 -1
- package/dist/workbench-renderers-CUHzLWMx.js.map +0 -1
package/dist/extensions.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as t } from "./navigation-tree-registry-
|
|
3
|
-
import { S as n, c as r,
|
|
1
|
+
import { A as e } from "./workbench-renderers-Bj4sazP5.js";
|
|
2
|
+
import { n as t } from "./navigation-tree-registry-CIwRvLFJ.js";
|
|
3
|
+
import { S as n, c as r, dt as i, l as a, u as o } from "./react-vsxj0hQ2.js";
|
|
4
4
|
import { ALWAYS_AVAILABLE_WEBVIEW_CAPABILITIES as s, WEBVIEW_DECLARABLE_CAPABILITIES as c, WEBVIEW_HOST_CAPABILITIES as l, WEBVIEW_HOST_CAPABILITY_VERSION as u, WEBVIEW_SCOPED_DECLARABLE_CAPABILITIES as d, commandRefId as f, contributionRefId as p, isLocalizedString as m, isNavigationTarget as h, matchesResourceWhen as g, qualifyNavigationTarget as _, resourceKey as v } from "@pstdio/sdk/extensions";
|
|
5
5
|
import { c as y } from "react/compiler-runtime";
|
|
6
6
|
import { Box as b, Center as x, Stack as S, Text as C } from "@chakra-ui/react";
|
|
@@ -489,6 +489,27 @@ var Le = (e) => {
|
|
|
489
489
|
if (!t?.outcome) return e;
|
|
490
490
|
if (t.outcome.status === "success") return t.outcome.value;
|
|
491
491
|
throw Error(t.outcome.reason ?? t.outcome.error?.message ?? "Extension command failed.");
|
|
492
|
+
}, Re = async (e, t, n, r, i) => {
|
|
493
|
+
let a = t.resourceMutation;
|
|
494
|
+
if (!a) return i();
|
|
495
|
+
let o = n?.[a.idParam] ?? r?.resource?.id;
|
|
496
|
+
if (typeof o != "string") return i();
|
|
497
|
+
let s = {
|
|
498
|
+
type: a.resourceType,
|
|
499
|
+
id: o,
|
|
500
|
+
extensionId: t.extensionId,
|
|
501
|
+
projectId: e.projectId
|
|
502
|
+
};
|
|
503
|
+
if (a.kind === "remove" && !await e.workbench.commandPalette.requestConfirmation(P(t.title, "Delete"))) return;
|
|
504
|
+
let c = a.kind === "rename" ? n?.[a.labelParam] : void 0;
|
|
505
|
+
if (a.kind === "rename" && (typeof c != "string" || !c.trim())) return i();
|
|
506
|
+
let l = e.workbench.resources.preview.begin(s, a.kind === "remove" ? { removed: !0 } : { label: c.trim() });
|
|
507
|
+
try {
|
|
508
|
+
let t = await e.workbench.resources.preview.persist(s, i);
|
|
509
|
+
return await l.commit(), t;
|
|
510
|
+
} catch (e) {
|
|
511
|
+
throw l.rollback(), e;
|
|
512
|
+
}
|
|
492
513
|
}, I = (e) => ({
|
|
493
514
|
id: e.id,
|
|
494
515
|
kind: e.kind,
|
|
@@ -518,22 +539,36 @@ var Le = (e) => {
|
|
|
518
539
|
});
|
|
519
540
|
}
|
|
520
541
|
return i;
|
|
521
|
-
}, R = async (e, t, n = {}) =>
|
|
542
|
+
}, R = async (e, t, n = {}) => {
|
|
543
|
+
let r = async () => Le(await L(e, t, n)), i = e.metadata?.commands.find((e) => e.id === t);
|
|
544
|
+
return i ? Re(e, i, n.params, { resource: n.resource }, r) : r();
|
|
545
|
+
}, ze = (e) => typeof e == "object" && !!e && !Array.isArray(e), Be = (e, t) => `${e.extensionId ?? t}.command.${e.id}`, Ve = async (e, t, n) => {
|
|
522
546
|
let { target: r } = n;
|
|
523
547
|
if (r.kind === "command") {
|
|
524
|
-
await R(e,
|
|
548
|
+
await R(e, Be(r.target.command, t.extensionId), { params: r.target.params }), e.workbench.commandPaletteResources.refresh();
|
|
525
549
|
return;
|
|
526
550
|
}
|
|
527
551
|
await e.workbench.navigation.openTarget(F(r, { extensionId: t.extensionId }));
|
|
528
|
-
},
|
|
552
|
+
}, He = (e) => {
|
|
553
|
+
if (e.kind === "page" || e.kind === "panel") return e.resource;
|
|
554
|
+
if (e.kind === "compound") return e.targets.find((e) => e.resource)?.resource;
|
|
555
|
+
}, Ue = (e, t, n, r) => ({
|
|
529
556
|
id: `${t.id}:${r.id}`,
|
|
557
|
+
resource: (() => {
|
|
558
|
+
let n = He(r.target);
|
|
559
|
+
return n ? {
|
|
560
|
+
...n,
|
|
561
|
+
projectId: n.projectId ?? e.projectId,
|
|
562
|
+
extensionId: n.extensionId ?? t.extensionId
|
|
563
|
+
} : void 0;
|
|
564
|
+
})(),
|
|
530
565
|
label: r.label,
|
|
531
566
|
description: r.description,
|
|
532
567
|
icon: r.icon,
|
|
533
568
|
keywords: r.keywords,
|
|
534
569
|
group: n,
|
|
535
|
-
activate: () =>
|
|
536
|
-
}),
|
|
570
|
+
activate: () => Ve(e, t, r)
|
|
571
|
+
}), We = (e, t) => {
|
|
537
572
|
let n = [];
|
|
538
573
|
for (let r of t) {
|
|
539
574
|
let t = P(r.title, r.id);
|
|
@@ -541,23 +576,26 @@ var Le = (e) => {
|
|
|
541
576
|
id: r.id,
|
|
542
577
|
title: t,
|
|
543
578
|
refreshEventIds: r.refreshEventIds,
|
|
544
|
-
query: async ({ query: n, limit: i }) => {
|
|
545
|
-
let
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
579
|
+
query: async ({ query: n, limit: i, signal: a }) => {
|
|
580
|
+
let o = e.workbench.getActiveResource(), s = await R(e, r.queryHandlerId, {
|
|
581
|
+
signal: a,
|
|
582
|
+
params: {
|
|
583
|
+
projectId: e.projectId,
|
|
584
|
+
modeId: e.workbench.modes.getActiveModeId(),
|
|
585
|
+
activeResource: o,
|
|
586
|
+
providerId: r.id,
|
|
587
|
+
query: n,
|
|
588
|
+
limit: i
|
|
589
|
+
}
|
|
590
|
+
});
|
|
591
|
+
return ze(s) ? (s.items ?? []).map((n) => Ue(e, r, t, n)) : [];
|
|
554
592
|
}
|
|
555
593
|
}));
|
|
556
594
|
}
|
|
557
595
|
return { dispose() {
|
|
558
596
|
for (let e = n.length - 1; e >= 0; --e) n[e]?.dispose();
|
|
559
597
|
} };
|
|
560
|
-
}, z = (e, t = "") => P(e, t),
|
|
598
|
+
}, z = (e, t = "") => P(e, t), Ge = (e, t, n) => {
|
|
561
599
|
let r = I({
|
|
562
600
|
id: t.id,
|
|
563
601
|
kind: "renderer",
|
|
@@ -604,20 +642,20 @@ var Le = (e) => {
|
|
|
604
642
|
reset: t.resetHandlerId ? ({ controlIds: e, resource: n }) => i(t.resetHandlerId, { controlIds: e }, n).then(() => void 0) : void 0
|
|
605
643
|
}
|
|
606
644
|
});
|
|
607
|
-
},
|
|
645
|
+
}, Ke = (e, t, n = {}) => {
|
|
608
646
|
let r = [];
|
|
609
|
-
for (let i of t) r.push(
|
|
647
|
+
for (let i of t) r.push(Ge(e, i, n));
|
|
610
648
|
return { dispose() {
|
|
611
649
|
for (let e = r.length - 1; e >= 0; --e) r[e]?.dispose();
|
|
612
650
|
} };
|
|
613
651
|
}, B = (e, t, n) => {
|
|
614
652
|
if (e) return Object.fromEntries(Object.entries(e).map(([e, r]) => [e, {
|
|
615
653
|
...r,
|
|
616
|
-
...r.options && !Array.isArray(r.options) ? { options:
|
|
654
|
+
...r.options && !Array.isArray(r.options) ? { options: qe(r.options, n) } : {},
|
|
617
655
|
label: r.label === void 0 ? void 0 : t(r.label, e),
|
|
618
656
|
description: r.description === void 0 ? void 0 : t(r.description)
|
|
619
657
|
}]));
|
|
620
|
-
},
|
|
658
|
+
}, qe = (e, t) => {
|
|
621
659
|
let n = e;
|
|
622
660
|
return {
|
|
623
661
|
valueField: n.valueField,
|
|
@@ -628,7 +666,7 @@ var Le = (e) => {
|
|
|
628
666
|
extensionId: n.command.extensionId ?? t ?? "pstdio"
|
|
629
667
|
})
|
|
630
668
|
};
|
|
631
|
-
},
|
|
669
|
+
}, Je = (e) => e.toolbarActions?.map((t) => ({
|
|
632
670
|
id: t.id,
|
|
633
671
|
label: P(t.label, t.id),
|
|
634
672
|
icon: t.icon,
|
|
@@ -639,7 +677,7 @@ var Le = (e) => {
|
|
|
639
677
|
submitLabel: t.submitLabel,
|
|
640
678
|
disabled: t.disabled,
|
|
641
679
|
when: t.when
|
|
642
|
-
})), V = (e, t = "") => P(e, t),
|
|
680
|
+
})), V = (e, t = "") => P(e, t), Ye = (e) => ({
|
|
643
681
|
...e,
|
|
644
682
|
label: V(e.label, e.id),
|
|
645
683
|
description: e.description ? V(e.description) : void 0,
|
|
@@ -647,11 +685,11 @@ var Le = (e) => {
|
|
|
647
685
|
name: e.icon,
|
|
648
686
|
size: 14
|
|
649
687
|
}) : void 0
|
|
650
|
-
}),
|
|
688
|
+
}), Xe = (e) => !!(e && typeof e == "object" && Array.isArray(e.rows)), Ze = (e) => ({
|
|
651
689
|
id: e.id,
|
|
652
690
|
values: e.values,
|
|
653
691
|
resource: e.resource ? e.resource : void 0
|
|
654
|
-
}),
|
|
692
|
+
}), Qe = (e, t, n) => {
|
|
655
693
|
let a = r(t), o = /* @__PURE__ */ new WeakMap(), s = I({
|
|
656
694
|
id: t.id,
|
|
657
695
|
kind: "dataTableRenderer",
|
|
@@ -680,8 +718,8 @@ var Le = (e) => {
|
|
|
680
718
|
body: {
|
|
681
719
|
kind: "dataTable",
|
|
682
720
|
resourceKind: t.resourceKind,
|
|
683
|
-
toolbarActions:
|
|
684
|
-
columns: t.columns?.map(
|
|
721
|
+
toolbarActions: Je(t),
|
|
722
|
+
columns: t.columns?.map(Ye),
|
|
685
723
|
initialPageSize: t.initialPageSize,
|
|
686
724
|
pageSizeOptions: t.pageSizeOptions,
|
|
687
725
|
defaultSettings: a.settings,
|
|
@@ -696,6 +734,7 @@ var Le = (e) => {
|
|
|
696
734
|
selectionMode: t.selectionMode,
|
|
697
735
|
selectionActions: t.selectionActions?.map((e) => ({
|
|
698
736
|
id: e.id,
|
|
737
|
+
commandId: e.commandId,
|
|
699
738
|
label: V(e.label, e.id),
|
|
700
739
|
icon: e.icon ? T(i, {
|
|
701
740
|
name: e.icon,
|
|
@@ -712,16 +751,17 @@ var Le = (e) => {
|
|
|
712
751
|
sorts: a,
|
|
713
752
|
settings: s
|
|
714
753
|
}, e, r, l);
|
|
715
|
-
return
|
|
754
|
+
return Xe(u) ? {
|
|
716
755
|
rows: u.rows.map((e) => {
|
|
717
|
-
let r =
|
|
756
|
+
let r = Ze(e);
|
|
718
757
|
return n.resolveRowResource && (r.resource = n.resolveRowResource(t, e)), o.set(r, e), r;
|
|
719
758
|
}),
|
|
720
|
-
columns: u.columns?.map(
|
|
759
|
+
columns: u.columns?.map(Ye)
|
|
721
760
|
} : { rows: [] };
|
|
722
761
|
},
|
|
723
762
|
rowActions: t.rowActions?.map((n) => ({
|
|
724
763
|
id: n.id,
|
|
764
|
+
commandId: n.commandId,
|
|
725
765
|
label: V(n.label, n.id),
|
|
726
766
|
icon: n.icon ? T(i, {
|
|
727
767
|
name: n.icon,
|
|
@@ -737,16 +777,16 @@ var Le = (e) => {
|
|
|
737
777
|
} : void 0
|
|
738
778
|
}
|
|
739
779
|
});
|
|
740
|
-
},
|
|
741
|
-
let r = t.map((t) =>
|
|
780
|
+
}, $e = (e, t, n = {}) => {
|
|
781
|
+
let r = t.map((t) => Qe(e, t, n));
|
|
742
782
|
return { dispose() {
|
|
743
783
|
for (let e = r.length - 1; e >= 0; --e) r[e]?.dispose();
|
|
744
784
|
} };
|
|
745
|
-
},
|
|
785
|
+
}, et = {
|
|
746
786
|
first: 0,
|
|
747
787
|
default: 1,
|
|
748
788
|
last: 2
|
|
749
|
-
},
|
|
789
|
+
}, tt = {
|
|
750
790
|
commands: [],
|
|
751
791
|
commandPaletteContributions: [],
|
|
752
792
|
diagnostics: [],
|
|
@@ -764,7 +804,7 @@ var Le = (e) => {
|
|
|
764
804
|
statuses: [],
|
|
765
805
|
settingsPanels: [],
|
|
766
806
|
settingsDefinitions: []
|
|
767
|
-
},
|
|
807
|
+
}, nt = (e) => `workbench.extension.menu.${e.id}`, rt = (e) => `workbench.extension.palette.${e.id}`, it = (e, t) => et[e.placement ?? "default"] * 1e3 + t, at = (e) => e === void 0 ? "" : m(e) ? e.default ?? e.$l10n : e, ot = (e) => {
|
|
768
808
|
let { commandId: t, contribution: n, index: r, resolveString: i, slot: a, when: o } = e;
|
|
769
809
|
return {
|
|
770
810
|
commandId: t,
|
|
@@ -774,21 +814,22 @@ var Le = (e) => {
|
|
|
774
814
|
group: a.group ?? n.group,
|
|
775
815
|
args: n.params,
|
|
776
816
|
overflowLabel: a.overflowLabel,
|
|
777
|
-
order:
|
|
817
|
+
order: it(n, r),
|
|
778
818
|
when: o
|
|
779
819
|
};
|
|
780
|
-
},
|
|
820
|
+
}, st = (e) => {
|
|
781
821
|
let { commandId: t, contribution: n, index: r, resolveString: i } = e;
|
|
782
822
|
return {
|
|
783
823
|
commandId: t,
|
|
824
|
+
sourceCommandId: n.commandId,
|
|
784
825
|
label: i(n.label, n.extensionId),
|
|
785
826
|
icon: n.icon,
|
|
786
827
|
group: n.group,
|
|
787
828
|
args: n.params,
|
|
788
|
-
order:
|
|
829
|
+
order: it(n, r)
|
|
789
830
|
};
|
|
790
|
-
},
|
|
791
|
-
let { createCommandId: t =
|
|
831
|
+
}, ct = (e) => {
|
|
832
|
+
let { createCommandId: t = nt, createWhenExpression: n, menuSlotsById: r, menuTargetsById: i, metadata: a, resolveString: o = at } = e, s = [], c = [];
|
|
792
833
|
return a.menuContributions.forEach((e, l) => {
|
|
793
834
|
let u = e.target ? i?.get(e.target) : r.get(e.slotId);
|
|
794
835
|
if (!u) {
|
|
@@ -806,10 +847,10 @@ var Le = (e) => {
|
|
|
806
847
|
category: e.group,
|
|
807
848
|
description: f ? o(f.description, f.extensionId) : void 0,
|
|
808
849
|
icon: e.icon,
|
|
809
|
-
params: f?.params
|
|
850
|
+
params: B(f?.params, (t) => o(t, f?.extensionId ?? e.extensionId), f?.extensionId)
|
|
810
851
|
},
|
|
811
852
|
contribution: e,
|
|
812
|
-
menuItem:
|
|
853
|
+
menuItem: ot({
|
|
813
854
|
commandId: d,
|
|
814
855
|
contribution: e,
|
|
815
856
|
index: l,
|
|
@@ -824,8 +865,8 @@ var Le = (e) => {
|
|
|
824
865
|
registrations: s,
|
|
825
866
|
unresolved: c
|
|
826
867
|
};
|
|
827
|
-
},
|
|
828
|
-
let { createCommandId: t =
|
|
868
|
+
}, lt = (e) => {
|
|
869
|
+
let { createCommandId: t = rt, metadata: n, resolveString: r = at } = e, i = [];
|
|
829
870
|
return (n.commandPaletteContributions ?? []).forEach((e, a) => {
|
|
830
871
|
let o = t(e), s = n.commands.find((t) => t.id === e.commandId);
|
|
831
872
|
i.push({
|
|
@@ -835,10 +876,10 @@ var Le = (e) => {
|
|
|
835
876
|
category: e.group,
|
|
836
877
|
description: s ? r(s.description, s.extensionId) : void 0,
|
|
837
878
|
icon: e.icon,
|
|
838
|
-
params: s?.params
|
|
879
|
+
params: B(s?.params, (t) => r(t, s?.extensionId ?? e.extensionId), s?.extensionId)
|
|
839
880
|
},
|
|
840
881
|
contribution: e,
|
|
841
|
-
menuItem:
|
|
882
|
+
menuItem: st({
|
|
842
883
|
commandId: o,
|
|
843
884
|
contribution: e,
|
|
844
885
|
index: a,
|
|
@@ -847,7 +888,7 @@ var Le = (e) => {
|
|
|
847
888
|
targetCommandId: e.commandId
|
|
848
889
|
});
|
|
849
890
|
}), i;
|
|
850
|
-
},
|
|
891
|
+
}, ut = (e) => ({
|
|
851
892
|
id: e.rendererId,
|
|
852
893
|
kind: "renderer",
|
|
853
894
|
context: {
|
|
@@ -857,7 +898,7 @@ var Le = (e) => {
|
|
|
857
898
|
resourceId: e.resource.id
|
|
858
899
|
} : {}
|
|
859
900
|
}
|
|
860
|
-
}),
|
|
901
|
+
}), dt = async (e, t, n, r, i = {}, a, o) => {
|
|
861
902
|
let s = r;
|
|
862
903
|
return R(e, n, {
|
|
863
904
|
params: {
|
|
@@ -871,23 +912,23 @@ var Le = (e) => {
|
|
|
871
912
|
},
|
|
872
913
|
resource: s,
|
|
873
914
|
signal: o,
|
|
874
|
-
slot:
|
|
915
|
+
slot: ut({
|
|
875
916
|
projectId: e.projectId,
|
|
876
917
|
rendererId: t,
|
|
877
918
|
resource: s
|
|
878
919
|
}),
|
|
879
920
|
...a ? { metadata: a } : {}
|
|
880
921
|
});
|
|
881
|
-
},
|
|
922
|
+
}, ft = (e) => {
|
|
882
923
|
if (!e || typeof e != "object") return;
|
|
883
924
|
let t = e.revision;
|
|
884
925
|
return typeof t == "string" ? t : void 0;
|
|
885
|
-
},
|
|
926
|
+
}, pt = (e, t) => {
|
|
886
927
|
let n = e.metadata, r = n?.fileRendererOrigin;
|
|
887
928
|
if (!r || typeof r != "object") return;
|
|
888
929
|
let i = r;
|
|
889
930
|
if (typeof i.rendererId != "string" || typeof i.instanceId != "string" || typeof i.operationId != "string") return;
|
|
890
|
-
let a = n?.fileRendererResourceKey, o =
|
|
931
|
+
let a = n?.fileRendererResourceKey, o = ft(t.outcome.value);
|
|
891
932
|
return {
|
|
892
933
|
origin: {
|
|
893
934
|
rendererId: i.rendererId,
|
|
@@ -897,32 +938,32 @@ var Le = (e) => {
|
|
|
897
938
|
...typeof a == "string" ? { resourceKey: a } : {},
|
|
898
939
|
...o ? { revision: o } : {}
|
|
899
940
|
};
|
|
900
|
-
},
|
|
941
|
+
}, mt = (e, t) => e.workbench.views.registerView({
|
|
901
942
|
id: t.id,
|
|
902
943
|
title: P(t.title, t.id),
|
|
903
944
|
icon: t.icon,
|
|
904
945
|
body: {
|
|
905
946
|
kind: "file",
|
|
906
947
|
resourceKind: t.resourceKind,
|
|
907
|
-
load: async (n, r) => await
|
|
948
|
+
load: async (n, r) => await dt(e, t.id, t.loadHandlerId, n, {}, void 0, r) ?? {},
|
|
908
949
|
save: t.saveHandlerId ? async (n, r, i) => {
|
|
909
|
-
let a =
|
|
950
|
+
let a = ft(await dt(e, t.id, t.saveHandlerId, n, { content: r }, {
|
|
910
951
|
...i ? { fileRendererOrigin: i } : {},
|
|
911
952
|
...v(n) ? { fileRendererResourceKey: v(n) } : {}
|
|
912
953
|
}));
|
|
913
954
|
return a ? { revision: a } : void 0;
|
|
914
955
|
} : void 0
|
|
915
956
|
}
|
|
916
|
-
}),
|
|
957
|
+
}), ht = (e) => {
|
|
917
958
|
let t = [];
|
|
918
|
-
for (let n of e.metadata.fileRenderers ?? []) t.push(
|
|
959
|
+
for (let n of e.metadata.fileRenderers ?? []) t.push(mt(e, n));
|
|
919
960
|
return { dispose() {
|
|
920
961
|
for (let e = t.length - 1; e >= 0; --e) t[e]?.dispose();
|
|
921
962
|
} };
|
|
922
|
-
},
|
|
963
|
+
}, gt = (e) => (t) => T(i, {
|
|
923
964
|
name: e ?? "MoreHorizontal",
|
|
924
965
|
...t
|
|
925
|
-
}),
|
|
966
|
+
}), _t = (e, t) => ({
|
|
926
967
|
color: e?.color,
|
|
927
968
|
canDragIn: e?.canDragIn,
|
|
928
969
|
canDragOut: e?.canDragOut,
|
|
@@ -930,12 +971,12 @@ var Le = (e) => {
|
|
|
930
971
|
actions: e?.actions?.map((e) => ({
|
|
931
972
|
id: e.id,
|
|
932
973
|
label: t(e.label, e.id),
|
|
933
|
-
icon:
|
|
974
|
+
icon: gt(e.icon)
|
|
934
975
|
}))
|
|
935
|
-
}),
|
|
976
|
+
}), vt = (e, t) => `${t.extensionId ?? e.extensionId}.status.${t.id}`, yt = (e, t) => {
|
|
936
977
|
let n = /* @__PURE__ */ new Map();
|
|
937
978
|
return (r) => {
|
|
938
|
-
let i =
|
|
979
|
+
let i = vt(t, r), a = n.get(i);
|
|
939
980
|
if (a) return a;
|
|
940
981
|
let o = {
|
|
941
982
|
getSnapshot: () => (e.workbench.statuses.getStatuses(i) ?? []).map((e) => ({
|
|
@@ -948,12 +989,12 @@ var Le = (e) => {
|
|
|
948
989
|
};
|
|
949
990
|
return n.set(i, o), e.workbench.statuses.load(i).catch(() => void 0), o;
|
|
950
991
|
};
|
|
951
|
-
},
|
|
992
|
+
}, bt = (e, t, n, r, i) => {
|
|
952
993
|
let a = n?.find((e) => e.id === r);
|
|
953
994
|
if (a?.type.kind !== "status") return;
|
|
954
|
-
let o =
|
|
995
|
+
let o = vt(t, a.type.statuses), s = e.workbench.statuses.getStatuses(o)?.find((e) => e.id === i);
|
|
955
996
|
return s ? { color: s.color } : void 0;
|
|
956
|
-
},
|
|
997
|
+
}, xt = (e) => typeof e == "object" && !!e && !Array.isArray(e), St = (e, t, n, r, i, a) => (t ?? []).map((t) => {
|
|
957
998
|
let o = t.display, s = o?.kind === "badge-list" && typeof o.itemsAttributeId == "string" ? {
|
|
958
999
|
kind: "badge-list",
|
|
959
1000
|
itemsAttributeId: o.itemsAttributeId
|
|
@@ -978,36 +1019,36 @@ var Le = (e) => {
|
|
|
978
1019
|
type: c(),
|
|
979
1020
|
display: s
|
|
980
1021
|
});
|
|
981
|
-
}),
|
|
982
|
-
let o =
|
|
1022
|
+
}), Ct = (e, t, n, r, i = () => [], a) => {
|
|
1023
|
+
let o = St(e, t, n, r, i, a), s = /* @__PURE__ */ new Set();
|
|
983
1024
|
return {
|
|
984
1025
|
source: {
|
|
985
1026
|
getSnapshot: () => o,
|
|
986
1027
|
subscribe: (e) => (s.add(e), () => s.delete(e))
|
|
987
1028
|
},
|
|
988
1029
|
set(t) {
|
|
989
|
-
o =
|
|
1030
|
+
o = St(e, t, n, r, i, a);
|
|
990
1031
|
for (let e of s) e();
|
|
991
1032
|
}
|
|
992
1033
|
};
|
|
993
|
-
},
|
|
1034
|
+
}, wt = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), Tt = (e, t) => {
|
|
994
1035
|
let { resource: n } = t;
|
|
995
|
-
if (
|
|
996
|
-
},
|
|
997
|
-
let n =
|
|
1036
|
+
if (wt(n)) return n;
|
|
1037
|
+
}, Et = (e, t) => {
|
|
1038
|
+
let n = Tt(e, t);
|
|
998
1039
|
if (n) return n;
|
|
999
1040
|
if (e.resourceKind) return {
|
|
1000
1041
|
type: e.resourceKind,
|
|
1001
1042
|
id: t.id,
|
|
1002
1043
|
label: t.title
|
|
1003
1044
|
};
|
|
1004
|
-
},
|
|
1045
|
+
}, Dt = (e, t) => {
|
|
1005
1046
|
let n = e, r = t(n);
|
|
1006
1047
|
return r === void 0 ? n : {
|
|
1007
1048
|
...n,
|
|
1008
1049
|
resource: r
|
|
1009
1050
|
};
|
|
1010
|
-
},
|
|
1051
|
+
}, Ot = (...e) => Object.assign({}, ...e.filter((e) => !!e)), kt = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, At = (e) => Object.keys(e ?? {}).length > 0, jt = /* @__PURE__ */ new Set([
|
|
1011
1052
|
"text",
|
|
1012
1053
|
"longtext",
|
|
1013
1054
|
"markdown",
|
|
@@ -1016,8 +1057,8 @@ var Le = (e) => {
|
|
|
1016
1057
|
"select",
|
|
1017
1058
|
"multi-select",
|
|
1018
1059
|
"files"
|
|
1019
|
-
]),
|
|
1020
|
-
if (!
|
|
1060
|
+
]), Mt = (e, t, n) => {
|
|
1061
|
+
if (!jt.has(t.type)) return;
|
|
1021
1062
|
let r = "options" in t && Array.isArray(t.options) ? t.options : [], i = t;
|
|
1022
1063
|
return {
|
|
1023
1064
|
id: e,
|
|
@@ -1035,10 +1076,10 @@ var Le = (e) => {
|
|
|
1035
1076
|
multiple: t.type === "files" ? i.multiple !== !1 : void 0,
|
|
1036
1077
|
accept: t.type === "files" && typeof i.accept == "string" ? i.accept : void 0
|
|
1037
1078
|
};
|
|
1038
|
-
},
|
|
1039
|
-
let r =
|
|
1079
|
+
}, Nt = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([e, n]) => {
|
|
1080
|
+
let r = Mt(e, n, t);
|
|
1040
1081
|
return r ? [r] : [];
|
|
1041
|
-
}),
|
|
1082
|
+
}), Pt = (e, t) => I({
|
|
1042
1083
|
id: t.id,
|
|
1043
1084
|
kind: "kanbanRenderer",
|
|
1044
1085
|
projectId: e.projectId,
|
|
@@ -1057,41 +1098,42 @@ var Le = (e) => {
|
|
|
1057
1098
|
},
|
|
1058
1099
|
resource: o,
|
|
1059
1100
|
signal: a,
|
|
1060
|
-
slot:
|
|
1101
|
+
slot: Pt(e, t),
|
|
1061
1102
|
metadata: { kanbanRendererId: t.id }
|
|
1062
1103
|
});
|
|
1063
|
-
},
|
|
1104
|
+
}, Ft = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, It = (e, t, n) => (t.rowActions ?? []).map((r) => {
|
|
1064
1105
|
let i = e.workbench.commands.getCommand(r.commandId)?.command;
|
|
1065
1106
|
return e.workbench.commands.registerCommand({
|
|
1066
|
-
id:
|
|
1107
|
+
id: Ft(t, r),
|
|
1067
1108
|
label: n(r.label, r.id),
|
|
1068
1109
|
icon: r.icon,
|
|
1069
1110
|
params: i?.params
|
|
1070
|
-
}, { execute: (n, i) => H(e, t, r.commandId,
|
|
1071
|
-
}),
|
|
1072
|
-
let o =
|
|
1073
|
-
return s &&
|
|
1111
|
+
}, { execute: (n, i) => H(e, t, r.commandId, Ot(kt(n)), i?.resource) });
|
|
1112
|
+
}), Lt = (e, t, n, r, i, a) => {
|
|
1113
|
+
let o = Ft(t, n), s = e.workbench.commands.getCommand(o), c = { rowId: r.id }, l = i ? { resource: i } : void 0, u = a(n.label, n.id);
|
|
1114
|
+
return s && At(s.command.params) ? (e.workbench.commandPalette.requestParams({
|
|
1074
1115
|
record: s,
|
|
1075
1116
|
label: u,
|
|
1076
1117
|
args: c,
|
|
1077
1118
|
context: l
|
|
1078
1119
|
}), Promise.resolve()) : s ? e.workbench.commands.executeCommand(s.command.id, c, l).then(() => void 0) : H(e, t, n.commandId, c, i).then(() => void 0);
|
|
1079
|
-
},
|
|
1120
|
+
}, Rt = (e) => e ? T(i, {
|
|
1080
1121
|
name: e,
|
|
1081
1122
|
size: 16
|
|
1082
|
-
}) : void 0,
|
|
1123
|
+
}) : void 0, zt = (e, t) => {
|
|
1083
1124
|
if (e.createRow) return {
|
|
1084
1125
|
title: t(e.createRow.title, "Create row"),
|
|
1085
1126
|
submitLabel: t(e.createRow.submitLabel, "Create"),
|
|
1086
|
-
fields:
|
|
1127
|
+
fields: Nt(e, t),
|
|
1087
1128
|
labels: {
|
|
1088
1129
|
cancel: t(e.createRow.labels?.cancel, "Cancel"),
|
|
1089
1130
|
properties: t(e.createRow.labels?.properties, "Properties"),
|
|
1090
1131
|
submitError: t(e.createRow.labels?.submitError, "Could not create resource."),
|
|
1091
|
-
removeFile: t(e.createRow.labels?.removeFile, "Remove file")
|
|
1132
|
+
removeFile: t(e.createRow.labels?.removeFile, "Remove file"),
|
|
1133
|
+
submitWithoutOpening: t(void 0, "Create without opening")
|
|
1092
1134
|
}
|
|
1093
1135
|
};
|
|
1094
|
-
},
|
|
1136
|
+
}, Bt = (e, t, n, r, i) => {
|
|
1095
1137
|
if (t.rowActivationHandlerId) return async (n) => {
|
|
1096
1138
|
let a = r(t, n);
|
|
1097
1139
|
await H(e, t, t.rowActivationHandlerId, { row: i(n) }, a);
|
|
@@ -1101,15 +1143,15 @@ var Le = (e) => {
|
|
|
1101
1143
|
row: e,
|
|
1102
1144
|
resource: r(t, e)
|
|
1103
1145
|
});
|
|
1104
|
-
},
|
|
1146
|
+
}, Vt = (e, t, n, r) => {
|
|
1105
1147
|
let i = e.createRow;
|
|
1106
1148
|
if (i) return async (a) => {
|
|
1107
|
-
let o =
|
|
1149
|
+
let o = Ot(a.values, i.columnParam ? { [i.columnParam]: a.columnId } : void 0, i.attributesParam ? { [i.attributesParam]: a.attributeValues } : void 0), s = await n(e, i.commandId, o);
|
|
1108
1150
|
if (await t.onAfterCreate?.({
|
|
1109
1151
|
record: e,
|
|
1110
1152
|
created: s,
|
|
1111
1153
|
submission: a
|
|
1112
|
-
}), !r || typeof s != "object" || !s) return;
|
|
1154
|
+
}), a.openCreatedRow === !1 || !r || typeof s != "object" || !s) return;
|
|
1113
1155
|
let c = s;
|
|
1114
1156
|
typeof c.id == "string" && typeof c.title == "string" && await r({
|
|
1115
1157
|
...c,
|
|
@@ -1118,15 +1160,15 @@ var Le = (e) => {
|
|
|
1118
1160
|
attributes: c.attributes ?? {}
|
|
1119
1161
|
});
|
|
1120
1162
|
};
|
|
1121
|
-
},
|
|
1163
|
+
}, Ht = (e, t, n, r, i) => {
|
|
1122
1164
|
let a = t.rowActions;
|
|
1123
1165
|
if (a?.length) return (o) => a.map((a) => {
|
|
1124
|
-
let s = i(t, o), c = () =>
|
|
1166
|
+
let s = i(t, o), c = () => Lt(e, t, a, o, s, r);
|
|
1125
1167
|
return {
|
|
1126
1168
|
key: a.id,
|
|
1127
1169
|
label: r(a.label, a.id),
|
|
1128
1170
|
commandId: a.commandId,
|
|
1129
|
-
icon:
|
|
1171
|
+
icon: Rt(a.icon),
|
|
1130
1172
|
onClick: () => n.executeRowAction ? n.executeRowAction({
|
|
1131
1173
|
record: t,
|
|
1132
1174
|
action: a,
|
|
@@ -1136,29 +1178,33 @@ var Le = (e) => {
|
|
|
1136
1178
|
}) : c()
|
|
1137
1179
|
};
|
|
1138
1180
|
});
|
|
1139
|
-
},
|
|
1181
|
+
}, Ut = (e, t, n = {}) => {
|
|
1140
1182
|
let r = [], i = n.resolveLabel ?? ((e, t) => P(e, t)), o = (e, t) => {
|
|
1141
1183
|
let r = t.display?.kind === "badge-list" ? {
|
|
1142
1184
|
...t,
|
|
1143
1185
|
render: (e, n) => ne(t, e, n)
|
|
1144
1186
|
} : t;
|
|
1145
1187
|
return n.decorateAttribute?.(e, r) ?? r;
|
|
1146
|
-
}, s = n.resolveRowResource ??
|
|
1188
|
+
}, s = n.resolveRowResource ?? Tt, c = n.resolveRowActionResource ?? Et, l = n.onAfterMutation ?? (() => {}), u = (t, n, r) => H(e, t, n, r).then((e) => (l(t), e));
|
|
1147
1189
|
for (let l of t) {
|
|
1148
|
-
let t =
|
|
1190
|
+
let t = yt(e, l), d = Ct(l, l.attributes, i, o, t, (t, n) => e.workbench.notifications.show({
|
|
1149
1191
|
id: `workbench.extension.${l.extensionId}.kanban.${l.id}.display.${t}`,
|
|
1150
1192
|
level: "error",
|
|
1151
1193
|
title: "Extension display is not available",
|
|
1152
1194
|
message: `Attribute "${t}" in renderer "${l.id}" uses unknown display kind "${n}".`
|
|
1153
|
-
})), f = l.attributes, p = a(l), m = p.settings.columnGrouping, h = /* @__PURE__ */ new WeakMap(), g, _ = 0, v = (e) => s(l, e), y =
|
|
1154
|
-
r.push(...
|
|
1195
|
+
})), f = l.attributes, p = a(l), m = p.settings.columnGrouping, h = /* @__PURE__ */ new WeakMap(), g, _ = 0, v = (e) => s(l, e), y = Bt(e, l, n, s, (e) => h.get(e) ?? e);
|
|
1196
|
+
r.push(...It(e, l, i)), r.push(e.workbench.views.registerView({
|
|
1155
1197
|
id: l.id,
|
|
1156
1198
|
title: i(l.title, l.id),
|
|
1157
1199
|
icon: l.icon,
|
|
1158
1200
|
body: {
|
|
1159
1201
|
kind: "kanban",
|
|
1160
1202
|
resourceKind: l.resourceKind,
|
|
1161
|
-
toolbarActions:
|
|
1203
|
+
toolbarActions: Je(l),
|
|
1204
|
+
listRowActions: () => (l.rowActions ?? []).map((e) => ({
|
|
1205
|
+
commandId: e.commandId,
|
|
1206
|
+
label: i(e.label, e.id)
|
|
1207
|
+
})),
|
|
1162
1208
|
storageScope: e.projectId,
|
|
1163
1209
|
attributes: d.source,
|
|
1164
1210
|
defaultSettings: p.settings,
|
|
@@ -1173,8 +1219,8 @@ var Le = (e) => {
|
|
|
1173
1219
|
emptyTitle: i(l.emptyTitle, ""),
|
|
1174
1220
|
emptyDescription: i(l.emptyDescription, ""),
|
|
1175
1221
|
hideToolbar: l.hideToolbar,
|
|
1176
|
-
createRow:
|
|
1177
|
-
getBoardColumnConfig: (t) =>
|
|
1222
|
+
createRow: zt(l, i),
|
|
1223
|
+
getBoardColumnConfig: (t) => _t(g?.[t] ?? bt(e, l, f, m, t), i),
|
|
1178
1224
|
onRowActivate: y,
|
|
1179
1225
|
executeQuery: async (t, n) => {
|
|
1180
1226
|
_ += 1;
|
|
@@ -1187,12 +1233,12 @@ var Le = (e) => {
|
|
|
1187
1233
|
sorts: t.sorts,
|
|
1188
1234
|
filters: ie(t.filter)
|
|
1189
1235
|
}, void 0, n), a = (e) => e.map((e) => {
|
|
1190
|
-
let t =
|
|
1236
|
+
let t = Dt(e, v);
|
|
1191
1237
|
return h.set(t, e), t;
|
|
1192
1238
|
});
|
|
1193
|
-
if (r !== _) return Array.isArray(i) ? a(i) :
|
|
1239
|
+
if (r !== _) return Array.isArray(i) ? a(i) : xt(i) ? a(i.rows ?? []) : [];
|
|
1194
1240
|
if (m = t.settings.columnGrouping, Array.isArray(i)) return a(i);
|
|
1195
|
-
if (!
|
|
1241
|
+
if (!xt(i)) return [];
|
|
1196
1242
|
let o = i.attributes ?? f;
|
|
1197
1243
|
return f = o, d.set(o), g = i.boardColumnConfigs, a(i.rows ?? []);
|
|
1198
1244
|
},
|
|
@@ -1205,21 +1251,21 @@ var Le = (e) => {
|
|
|
1205
1251
|
rowId: e,
|
|
1206
1252
|
beforeRowId: t
|
|
1207
1253
|
}).then(() => void 0) : void 0,
|
|
1208
|
-
onCreateRow:
|
|
1254
|
+
onCreateRow: Vt(l, n, u, l.rowActivationHandlerId ? y : void 0),
|
|
1209
1255
|
onColumnAction: l.columnActionHandlerId ? async (e, t) => {
|
|
1210
1256
|
await u(l, l.columnActionHandlerId, {
|
|
1211
1257
|
columnId: e,
|
|
1212
1258
|
actionId: t
|
|
1213
1259
|
});
|
|
1214
1260
|
} : void 0,
|
|
1215
|
-
getRowContextMenuActions:
|
|
1261
|
+
getRowContextMenuActions: Ht(e, l, n, i, c)
|
|
1216
1262
|
}
|
|
1217
1263
|
}));
|
|
1218
1264
|
}
|
|
1219
1265
|
return { dispose() {
|
|
1220
1266
|
for (let e = r.length - 1; e >= 0; --e) r[e]?.dispose();
|
|
1221
1267
|
} };
|
|
1222
|
-
},
|
|
1268
|
+
}, Wt = (e) => ({
|
|
1223
1269
|
id: e.treeId,
|
|
1224
1270
|
kind: "renderer",
|
|
1225
1271
|
context: {
|
|
@@ -1251,14 +1297,14 @@ var Le = (e) => {
|
|
|
1251
1297
|
params: r,
|
|
1252
1298
|
signal: i,
|
|
1253
1299
|
resource: o,
|
|
1254
|
-
slot:
|
|
1300
|
+
slot: Wt({
|
|
1255
1301
|
modeId: a?.modeId,
|
|
1256
1302
|
projectId: e.projectId,
|
|
1257
1303
|
resource: o,
|
|
1258
1304
|
treeId: t.id
|
|
1259
1305
|
})
|
|
1260
1306
|
});
|
|
1261
|
-
},
|
|
1307
|
+
}, Gt = async (e, t, n, r, i) => {
|
|
1262
1308
|
let a = e.workbench.modes.getActiveModeId();
|
|
1263
1309
|
return R(e, n, {
|
|
1264
1310
|
params: {
|
|
@@ -1272,7 +1318,7 @@ var Le = (e) => {
|
|
|
1272
1318
|
}
|
|
1273
1319
|
},
|
|
1274
1320
|
resource: i,
|
|
1275
|
-
slot:
|
|
1321
|
+
slot: Wt({
|
|
1276
1322
|
modeId: a,
|
|
1277
1323
|
projectId: e.projectId,
|
|
1278
1324
|
resource: i,
|
|
@@ -1280,21 +1326,21 @@ var Le = (e) => {
|
|
|
1280
1326
|
}),
|
|
1281
1327
|
metadata: { treeId: t.id }
|
|
1282
1328
|
});
|
|
1283
|
-
},
|
|
1284
|
-
let { ctx: t, getHostTreeHeaderNodes: n, record: r, treeViews: i } = e, a =
|
|
1329
|
+
}, Kt = (e, t) => e.panels.flatMap((e) => [e, ...e.panelMenus ?? []]).filter((e) => e.renderer?.kind === "tree" && e.renderer.id === t.id), qt = (e, t) => t.viewId ? e.find((e) => e.id === t.viewId) : e.length === 1 ? e[0] : void 0, Jt = async (e) => {
|
|
1330
|
+
let { ctx: t, getHostTreeHeaderNodes: n, record: r, treeViews: i } = e, a = qt(i, t);
|
|
1285
1331
|
return !a || !("hostTreeHeader" in a) || a.hostTreeHeader !== "default" ? [] : await n?.({
|
|
1286
1332
|
ctx: t,
|
|
1287
1333
|
record: r,
|
|
1288
1334
|
panel: a
|
|
1289
1335
|
}) ?? [];
|
|
1290
|
-
},
|
|
1291
|
-
let { ctx: t, getHostTreeFooterNodes: n, record: r, treeViews: i } = e, a =
|
|
1336
|
+
}, Yt = async (e) => {
|
|
1337
|
+
let { ctx: t, getHostTreeFooterNodes: n, record: r, treeViews: i } = e, a = qt(i, t);
|
|
1292
1338
|
return !a || !("hostTreeFooter" in a) || a.hostTreeFooter !== "default" ? [] : await n?.({
|
|
1293
1339
|
ctx: t,
|
|
1294
1340
|
record: r,
|
|
1295
1341
|
panel: a
|
|
1296
1342
|
}) ?? [];
|
|
1297
|
-
},
|
|
1343
|
+
}, Xt = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, Zt = (e) => e && !Array.isArray(e) ? e : void 0, Qt = (e, t) => {
|
|
1298
1344
|
let n = /* @__PURE__ */ new WeakMap(), r = `workbench.extensionTreeRenderer.${t.id}.command`, i = (t) => e.resolveNodeResource?.(t) ?? t, a = (e) => {
|
|
1299
1345
|
if (e.emptyState) return {
|
|
1300
1346
|
title: P(e.emptyState.title),
|
|
@@ -1322,20 +1368,21 @@ var Le = (e) => {
|
|
|
1322
1368
|
}) : void 0;
|
|
1323
1369
|
return {
|
|
1324
1370
|
id: n.id,
|
|
1371
|
+
resourceMutation: e.metadata.commands.find((e) => e.id === a)?.resourceMutation,
|
|
1325
1372
|
label: P(n.label),
|
|
1326
1373
|
icon: n.icon,
|
|
1327
|
-
args:
|
|
1374
|
+
args: Zt(n.params),
|
|
1328
1375
|
params: B(n.input, P, t.extensionId),
|
|
1329
1376
|
submitLabel: n.submitLabel,
|
|
1330
1377
|
when: n.when,
|
|
1331
1378
|
disabled: n.disabled,
|
|
1332
1379
|
run: a ? async (o) => {
|
|
1333
|
-
let s =
|
|
1380
|
+
let s = Xt(o, Zt(n.params));
|
|
1334
1381
|
if (n.command?.extensionId === "pstdio") {
|
|
1335
1382
|
await e.workbench.commands.executeCommand(a, s, { resource: r?.resource ?? i.resource });
|
|
1336
1383
|
return;
|
|
1337
1384
|
}
|
|
1338
|
-
await
|
|
1385
|
+
await Gt(e, t, a, s, r?.resource ?? i.resource), i.refresh();
|
|
1339
1386
|
} : void 0
|
|
1340
1387
|
};
|
|
1341
1388
|
}, c = (e, t) => {
|
|
@@ -1357,7 +1404,9 @@ var Le = (e) => {
|
|
|
1357
1404
|
description: e.description,
|
|
1358
1405
|
contextValue: e.contextValue,
|
|
1359
1406
|
hiddenByDefault: e.hiddenByDefault,
|
|
1360
|
-
canHide: e.canHide
|
|
1407
|
+
canHide: e.canHide,
|
|
1408
|
+
canDrag: e.canDrag,
|
|
1409
|
+
canDrop: e.canDrop
|
|
1361
1410
|
};
|
|
1362
1411
|
return n.set(r, e), r;
|
|
1363
1412
|
};
|
|
@@ -1376,16 +1425,16 @@ var Le = (e) => {
|
|
|
1376
1425
|
originalNodes: n,
|
|
1377
1426
|
runnerCommandId: r
|
|
1378
1427
|
};
|
|
1379
|
-
}, G = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "nodes" in e),
|
|
1428
|
+
}, G = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "nodes" in e), $t = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "id" in e), K = (e, t) => t.length > 0 ? [{
|
|
1380
1429
|
id: e,
|
|
1381
1430
|
nodes: t,
|
|
1382
1431
|
canReorder: !1
|
|
1383
|
-
}] : [],
|
|
1384
|
-
let n =
|
|
1432
|
+
}] : [], en = (e, t) => {
|
|
1433
|
+
let n = Qt(e, t), r = Kt(e.metadata, t), i = e.workbench.commands.registerCommand({
|
|
1385
1434
|
id: n.runnerCommandId,
|
|
1386
1435
|
label: `${P(t.title, t.id)} tree command`
|
|
1387
1436
|
}, { execute: async (n) => {
|
|
1388
|
-
let r = n, i = await
|
|
1437
|
+
let r = n, i = await Gt(e, t, r.commandId, r.params, r.resource);
|
|
1389
1438
|
for (let t of e.workbench.views.listViews()) t.body.kind === "file" && e.workbench.views.refreshView(t.id);
|
|
1390
1439
|
return i;
|
|
1391
1440
|
} }), a = e.workbench.views.registerView({
|
|
@@ -1399,7 +1448,7 @@ var Le = (e) => {
|
|
|
1399
1448
|
defaultExpandedNodeIds: t.defaultExpandedNodeIds,
|
|
1400
1449
|
defaultExpandedSectionIds: t.defaultExpandedSectionIds,
|
|
1401
1450
|
getHeader: async (i) => {
|
|
1402
|
-
let a = await
|
|
1451
|
+
let a = await Jt({
|
|
1403
1452
|
ctx: i,
|
|
1404
1453
|
getHostTreeHeaderNodes: e.getHostTreeHeaderNodes,
|
|
1405
1454
|
record: t,
|
|
@@ -1414,7 +1463,7 @@ var Le = (e) => {
|
|
|
1414
1463
|
return G(i) ? n.mapSections(i, r) : [];
|
|
1415
1464
|
},
|
|
1416
1465
|
getFooter: async (i) => {
|
|
1417
|
-
let a = await
|
|
1466
|
+
let a = await Yt({
|
|
1418
1467
|
ctx: i,
|
|
1419
1468
|
getHostTreeFooterNodes: e.getHostTreeFooterNodes,
|
|
1420
1469
|
record: t,
|
|
@@ -1424,21 +1473,30 @@ var Le = (e) => {
|
|
|
1424
1473
|
let o = await W(e, t, t.footerHandlerId, U(e, t, i), i.signal);
|
|
1425
1474
|
return [...G(o) ? n.mapSections(o, i) : [], ...K(`${t.id}:host-footer`, a)];
|
|
1426
1475
|
},
|
|
1476
|
+
moveNode: t.moveHandlerId ? async (r, i, a) => {
|
|
1477
|
+
let o = n.originalNodes.get(r), s = i ? n.originalNodes.get(i) : void 0;
|
|
1478
|
+
!o?.canDrag || i && !s?.canDrop || (await W(e, t, t.moveHandlerId, {
|
|
1479
|
+
...U(e, t, a),
|
|
1480
|
+
source: o,
|
|
1481
|
+
target: s,
|
|
1482
|
+
position: a.position ?? "inside"
|
|
1483
|
+
}), a.refresh());
|
|
1484
|
+
} : void 0,
|
|
1427
1485
|
getChildren: async (r, i) => {
|
|
1428
1486
|
if (!t.childrenHandlerId) return r.children ?? [];
|
|
1429
1487
|
let a = n.originalNodes.get(r);
|
|
1430
1488
|
if (!a) return r.children ?? [];
|
|
1431
1489
|
let o = await W(e, t, t.childrenHandlerId, U(e, t, i, a), i.signal);
|
|
1432
|
-
return
|
|
1490
|
+
return $t(o) ? n.mapNodes(o, i) : [];
|
|
1433
1491
|
}
|
|
1434
1492
|
}
|
|
1435
1493
|
});
|
|
1436
1494
|
return { dispose() {
|
|
1437
1495
|
a.dispose(), i.dispose();
|
|
1438
1496
|
} };
|
|
1439
|
-
},
|
|
1497
|
+
}, tn = (e) => {
|
|
1440
1498
|
let t = [];
|
|
1441
|
-
for (let n of e.metadata.treeRenderers ?? []) t.push(
|
|
1499
|
+
for (let n of e.metadata.treeRenderers ?? []) t.push(en(e, n));
|
|
1442
1500
|
return { dispose() {
|
|
1443
1501
|
for (let e = t.length - 1; e >= 0; --e) t[e]?.dispose();
|
|
1444
1502
|
} };
|
|
@@ -1446,20 +1504,20 @@ var Le = (e) => {
|
|
|
1446
1504
|
kind: e.kind,
|
|
1447
1505
|
id: p(e),
|
|
1448
1506
|
extensionId: e.extensionId
|
|
1449
|
-
}),
|
|
1507
|
+
}), nn = (e, t, n) => {
|
|
1450
1508
|
let r = n?.(t.when);
|
|
1451
1509
|
return !r || e.context.matches(r);
|
|
1452
|
-
},
|
|
1510
|
+
}, rn = (e) => ({
|
|
1453
1511
|
id: e.id,
|
|
1454
1512
|
label: P(e.label, e.id),
|
|
1455
1513
|
icon: e.icon,
|
|
1456
1514
|
canHide: !0,
|
|
1457
1515
|
canReorder: !0,
|
|
1458
1516
|
target: F(e.action, { extensionId: e.extensionId })
|
|
1459
|
-
}),
|
|
1517
|
+
}), an = (e, n, r) => {
|
|
1460
1518
|
let i = /* @__PURE__ */ new Map();
|
|
1461
1519
|
for (let a of n) {
|
|
1462
|
-
if (!
|
|
1520
|
+
if (!nn(e, a, r)) continue;
|
|
1463
1521
|
let n = a.group || void 0, o = n ? `${a.extensionId}:${n}` : t(a.slot), s = i.get(o) ?? {
|
|
1464
1522
|
id: o,
|
|
1465
1523
|
label: n,
|
|
@@ -1468,17 +1526,17 @@ var Le = (e) => {
|
|
|
1468
1526
|
canReorder: !0,
|
|
1469
1527
|
nodes: []
|
|
1470
1528
|
};
|
|
1471
|
-
s.nodes.push(
|
|
1529
|
+
s.nodes.push(rn(a)), i.set(o, s);
|
|
1472
1530
|
}
|
|
1473
1531
|
return [...i.values()];
|
|
1474
|
-
},
|
|
1532
|
+
}, on = (e) => {
|
|
1475
1533
|
let t = /* @__PURE__ */ new Map();
|
|
1476
1534
|
for (let n of e) {
|
|
1477
1535
|
let e = q(n.owner), r = `${n.extensionId}:${e.kind}:${e.id}:${n.slot}`;
|
|
1478
1536
|
t.set(r, [...t.get(r) ?? [], n]);
|
|
1479
1537
|
}
|
|
1480
1538
|
return [...t.values()];
|
|
1481
|
-
},
|
|
1539
|
+
}, sn = (e) => [...new Set(e.flatMap((e) => e.group ? [`${e.extensionId}:${e.group}`] : []))], cn = (e) => on(e.metadata.navigationItems).map((t) => {
|
|
1482
1540
|
let n = t[0], r = t.some((e) => e.when?.resourceType?.length || e.when?.metadata);
|
|
1483
1541
|
return e.workbench.navigationTrees.registerContribution({
|
|
1484
1542
|
id: `${n.extensionId}.navigation-items.${n.owner.kind}.${p(n.owner)}.${n.slot}`,
|
|
@@ -1486,11 +1544,16 @@ var Le = (e) => {
|
|
|
1486
1544
|
sourceExtensionId: n.extensionId,
|
|
1487
1545
|
declarationIndex: e.metadata.navigationItems.indexOf(n),
|
|
1488
1546
|
slot: n.slot,
|
|
1489
|
-
defaultExpandedSectionIds:
|
|
1547
|
+
defaultExpandedSectionIds: sn(t),
|
|
1490
1548
|
...r ? {} : { resolveResource: () => void 0 },
|
|
1491
|
-
getSections: () =>
|
|
1549
|
+
getSections: () => an(e.workbench, t, e.createWhenExpression),
|
|
1550
|
+
listActions: () => t.map((e) => ({
|
|
1551
|
+
label: P(e.label, e.id),
|
|
1552
|
+
category: e.group || void 0,
|
|
1553
|
+
action: F(e.action, { extensionId: e.extensionId })
|
|
1554
|
+
}))
|
|
1492
1555
|
});
|
|
1493
|
-
}),
|
|
1556
|
+
}), ln = (e) => e.metadata.navigationTrees.map((t, n) => {
|
|
1494
1557
|
let r = p(t.view);
|
|
1495
1558
|
return e.workbench.navigationTrees.registerContribution({
|
|
1496
1559
|
id: t.id,
|
|
@@ -1502,20 +1565,21 @@ var Le = (e) => {
|
|
|
1502
1565
|
viewId: r,
|
|
1503
1566
|
...t.resourceScope === "project" ? { resolveResource: () => void 0 } : {}
|
|
1504
1567
|
});
|
|
1505
|
-
}),
|
|
1568
|
+
}), un = (e) => [...cn(e), ...ln(e)], dn = () => {
|
|
1506
1569
|
if (typeof navigator > "u") return;
|
|
1507
1570
|
let e = `${navigator.platform} ${navigator.userAgent}`.toLowerCase();
|
|
1508
1571
|
if (e.includes("mac")) return "mac";
|
|
1509
1572
|
if (e.includes("win")) return "win";
|
|
1510
1573
|
if (e.includes("linux")) return "linux";
|
|
1511
|
-
},
|
|
1574
|
+
}, fn = (e, t = dn()) => (t ? e.platformOverrides?.[t] : void 0) ?? e.key, pn = (e) => e.bindings.map((t) => e.workbench.keybindings.registerKeybinding({
|
|
1575
|
+
sourceExtensionId: t.extensionId,
|
|
1512
1576
|
action: F(t.action, { commandIdOf: (e) => e.extensionId ? f({
|
|
1513
1577
|
extensionId: e.extensionId,
|
|
1514
1578
|
id: e.id
|
|
1515
1579
|
}) : void 0 }),
|
|
1516
|
-
keybinding:
|
|
1580
|
+
keybinding: fn(t),
|
|
1517
1581
|
when: e.createWhenExpression?.(t.when)
|
|
1518
|
-
})),
|
|
1582
|
+
})), mn = (e) => {
|
|
1519
1583
|
if (!e) return;
|
|
1520
1584
|
let t = (e) => {
|
|
1521
1585
|
if (e) return Array.isArray(e) ? e.map((e) => p(e)) : p(e);
|
|
@@ -1527,21 +1591,21 @@ var Le = (e) => {
|
|
|
1527
1591
|
resourceType: e.resourceType?.map((e) => e.id),
|
|
1528
1592
|
metadata: e.metadata
|
|
1529
1593
|
};
|
|
1530
|
-
},
|
|
1594
|
+
}, hn = (e, t) => ({
|
|
1531
1595
|
...e,
|
|
1532
1596
|
tab: e.tab && t.createTab ? t.createTab({
|
|
1533
1597
|
...e.tab,
|
|
1534
1598
|
extensionId: t.extensionId,
|
|
1535
1599
|
placementId: t.placementId
|
|
1536
1600
|
}) : void 0
|
|
1537
|
-
}),
|
|
1601
|
+
}), gn = (e, t) => e.kind === "panels" ? e : {
|
|
1538
1602
|
...e,
|
|
1539
1603
|
tab: e.tab && t.createTab ? t.createTab({
|
|
1540
1604
|
...e.tab,
|
|
1541
1605
|
extensionId: t.extensionId,
|
|
1542
1606
|
placementId: t.placementId
|
|
1543
1607
|
}) : void 0
|
|
1544
|
-
},
|
|
1608
|
+
}, _n = (e, t) => e.pages.map((e) => ({
|
|
1545
1609
|
id: e.id,
|
|
1546
1610
|
ref: {
|
|
1547
1611
|
extensionId: e.extensionId,
|
|
@@ -1553,12 +1617,12 @@ var Le = (e) => {
|
|
|
1553
1617
|
document: e.document,
|
|
1554
1618
|
modeId: p(e.mode),
|
|
1555
1619
|
resource: e.resource,
|
|
1556
|
-
main:
|
|
1620
|
+
main: gn(e.main, {
|
|
1557
1621
|
extensionId: e.extensionId,
|
|
1558
1622
|
placementId: `${e.id}.$main`,
|
|
1559
1623
|
createTab: t
|
|
1560
1624
|
}),
|
|
1561
|
-
slots: e.slots.map((n) =>
|
|
1625
|
+
slots: e.slots.map((n) => hn(n, {
|
|
1562
1626
|
extensionId: e.extensionId,
|
|
1563
1627
|
placementId: `${e.id}.${n.id}`,
|
|
1564
1628
|
createTab: t
|
|
@@ -1571,10 +1635,10 @@ var Le = (e) => {
|
|
|
1571
1635
|
view: e.main.view
|
|
1572
1636
|
}] : [], ...e.slots.flatMap((e) => e.item.kind === "binding" ? [e.item.binding] : [])]);
|
|
1573
1637
|
return n.push(...e.placements.flatMap((e) => e.item.kind === "binding" ? [e.item.binding] : [])), n.find((e) => p(e.view) === t)?.kinds[0]?.id;
|
|
1574
|
-
},
|
|
1638
|
+
}, vn = (e) => e.body.kind === "webview" ? { webview: e.body.webview } : { renderer: {
|
|
1575
1639
|
kind: e.body.kind,
|
|
1576
1640
|
id: e.id
|
|
1577
|
-
} },
|
|
1641
|
+
} }, yn = (e, t) => e.viewMenus.flatMap((n) => {
|
|
1578
1642
|
if (p(n.owner) !== t.id) return [];
|
|
1579
1643
|
let r = e.views.find((e) => e.id === p(n.view));
|
|
1580
1644
|
return r ? [{
|
|
@@ -1588,22 +1652,22 @@ var Le = (e) => {
|
|
|
1588
1652
|
placement: n.placement,
|
|
1589
1653
|
hostTreeHeader: n.hostTreeHeader,
|
|
1590
1654
|
hostTreeFooter: n.hostTreeFooter,
|
|
1591
|
-
...
|
|
1655
|
+
...vn(r)
|
|
1592
1656
|
}] : [];
|
|
1593
|
-
}),
|
|
1594
|
-
let n =
|
|
1657
|
+
}), bn = (e) => e.views.map((t) => {
|
|
1658
|
+
let n = yn(e, t);
|
|
1595
1659
|
return {
|
|
1596
1660
|
id: t.id,
|
|
1597
1661
|
extensionId: t.extensionId,
|
|
1598
1662
|
title: t.title,
|
|
1599
1663
|
icon: t.icon,
|
|
1600
1664
|
panelMenus: n.length > 0 ? n : void 0,
|
|
1601
|
-
...
|
|
1665
|
+
...vn(t)
|
|
1602
1666
|
};
|
|
1603
1667
|
}), Y = (e) => e?.map(({ command: e, ...t }) => ({
|
|
1604
1668
|
...t,
|
|
1605
1669
|
commandId: f(e)
|
|
1606
|
-
})),
|
|
1670
|
+
})), xn = (e) => e.views.flatMap((t) => {
|
|
1607
1671
|
let n = t.body;
|
|
1608
1672
|
return n.kind === "kanban" ? [{
|
|
1609
1673
|
...n,
|
|
@@ -1629,7 +1693,7 @@ var Le = (e) => {
|
|
|
1629
1693
|
rowActions: Y(n.rowActions),
|
|
1630
1694
|
toolbarActions: Y(n.toolbarActions)
|
|
1631
1695
|
}] : [];
|
|
1632
|
-
}),
|
|
1696
|
+
}), Sn = (e) => e.views.flatMap((t) => {
|
|
1633
1697
|
let n = t.body;
|
|
1634
1698
|
return n.kind === "dataTable" ? [{
|
|
1635
1699
|
...n,
|
|
@@ -1642,28 +1706,28 @@ var Le = (e) => {
|
|
|
1642
1706
|
rowActions: Y(n.rowActions),
|
|
1643
1707
|
toolbarActions: Y(n.toolbarActions)
|
|
1644
1708
|
}] : [];
|
|
1645
|
-
}),
|
|
1709
|
+
}), Cn = (e) => e.views.flatMap((t) => t.body.kind === "tree" ? [{
|
|
1646
1710
|
...t.body,
|
|
1647
1711
|
id: t.id,
|
|
1648
1712
|
extensionId: t.extensionId,
|
|
1649
1713
|
title: t.title,
|
|
1650
1714
|
icon: t.icon,
|
|
1651
1715
|
resourceKind: t.body.resourceKind ?? J(e, t.id)
|
|
1652
|
-
}] : []),
|
|
1716
|
+
}] : []), wn = (e) => e.views.flatMap((t) => t.body.kind === "file" ? [{
|
|
1653
1717
|
...t.body,
|
|
1654
1718
|
id: t.id,
|
|
1655
1719
|
extensionId: t.extensionId,
|
|
1656
1720
|
title: t.title,
|
|
1657
1721
|
icon: t.icon,
|
|
1658
1722
|
resourceKind: t.body.resourceKind ?? J(e, t.id)
|
|
1659
|
-
}] : []),
|
|
1723
|
+
}] : []), Tn = (e) => e.views.flatMap((t) => t.body.kind === "controls" ? [{
|
|
1660
1724
|
...t.body,
|
|
1661
1725
|
id: t.id,
|
|
1662
1726
|
extensionId: t.extensionId,
|
|
1663
1727
|
title: t.title,
|
|
1664
1728
|
icon: t.icon,
|
|
1665
1729
|
resourceKind: t.body.resourceKind ?? J(e, t.id)
|
|
1666
|
-
}] : []),
|
|
1730
|
+
}] : []), En = (e) => e.modes.map((e) => ({
|
|
1667
1731
|
id: e.id,
|
|
1668
1732
|
extensionId: e.extensionId,
|
|
1669
1733
|
modeId: e.id,
|
|
@@ -1674,15 +1738,15 @@ var Le = (e) => {
|
|
|
1674
1738
|
floatingPanels: e.floatingPanels,
|
|
1675
1739
|
...e.defaultTheme ? { defaultTheme: p(e.defaultTheme) } : {},
|
|
1676
1740
|
...e.chrome ? { chrome: Object.fromEntries(Object.entries(e.chrome).map(([e, t]) => [e, t !== !1 && p(t)])) } : {}
|
|
1677
|
-
})),
|
|
1678
|
-
let n =
|
|
1741
|
+
})), Dn = (e, t = {}) => {
|
|
1742
|
+
let n = bn(e);
|
|
1679
1743
|
return {
|
|
1680
1744
|
extensions: e.extensions,
|
|
1681
1745
|
commands: e.commands,
|
|
1682
1746
|
menuContributions: e.menuContributions,
|
|
1683
1747
|
commandPaletteContributions: e.commandPaletteContributions,
|
|
1684
|
-
modes:
|
|
1685
|
-
pages:
|
|
1748
|
+
modes: En(e),
|
|
1749
|
+
pages: _n(e, t.createTab),
|
|
1686
1750
|
placements: e.placements.map((e) => ({
|
|
1687
1751
|
id: e.id,
|
|
1688
1752
|
ref: {
|
|
@@ -1736,12 +1800,12 @@ var Le = (e) => {
|
|
|
1736
1800
|
section: t.section ? p(t.section) : void 0
|
|
1737
1801
|
}] : [];
|
|
1738
1802
|
}),
|
|
1739
|
-
kanbanRenderers:
|
|
1740
|
-
dataTableRenderers:
|
|
1803
|
+
kanbanRenderers: xn(e),
|
|
1804
|
+
dataTableRenderers: Sn(e),
|
|
1741
1805
|
commandPaletteResources: e.commandPaletteResources ?? [],
|
|
1742
|
-
treeRenderers:
|
|
1743
|
-
fileRenderers:
|
|
1744
|
-
controlsRenderers:
|
|
1806
|
+
treeRenderers: Cn(e),
|
|
1807
|
+
fileRenderers: wn(e),
|
|
1808
|
+
controlsRenderers: Tn(e),
|
|
1745
1809
|
keybindings: e.keybindings ?? [],
|
|
1746
1810
|
settingsDefinitions: e.settingsDefinitions ?? [],
|
|
1747
1811
|
statuses: e.statuses,
|
|
@@ -1751,13 +1815,13 @@ var Le = (e) => {
|
|
|
1751
1815
|
viewId: p(e.view),
|
|
1752
1816
|
slot: e.slot.id.endsWith("leading") ? "leading" : "trailing",
|
|
1753
1817
|
order: e.order,
|
|
1754
|
-
when:
|
|
1818
|
+
when: mn(e.when)
|
|
1755
1819
|
})),
|
|
1756
1820
|
diagnostics: e.diagnostics
|
|
1757
1821
|
};
|
|
1758
|
-
},
|
|
1822
|
+
}, On = (e, t, n = {}) => {
|
|
1759
1823
|
e.views.refreshView(t.id, t.kind === "file" ? n : void 0);
|
|
1760
|
-
},
|
|
1824
|
+
}, kn = (e) => {
|
|
1761
1825
|
let t = /* @__PURE__ */ new Map(), n = (e, n) => {
|
|
1762
1826
|
for (let r of new Set(n.refreshEventIds ?? [])) {
|
|
1763
1827
|
let i = t.get(r) ?? [];
|
|
@@ -1772,15 +1836,15 @@ var Le = (e) => {
|
|
|
1772
1836
|
refreshEventIds: t.body.refreshEventIds
|
|
1773
1837
|
});
|
|
1774
1838
|
return t;
|
|
1775
|
-
},
|
|
1776
|
-
let t =
|
|
1839
|
+
}, An = (e) => {
|
|
1840
|
+
let t = kn(e.metadata);
|
|
1777
1841
|
return e.subscribe((n) => {
|
|
1778
1842
|
let { id: r, ...i } = n;
|
|
1779
|
-
for (let n of t.get(r) ?? [])
|
|
1843
|
+
for (let n of t.get(r) ?? []) On(e.workbench, n, i);
|
|
1780
1844
|
});
|
|
1781
|
-
},
|
|
1845
|
+
}, jn = (e, t) => {
|
|
1782
1846
|
for (let n of t.views) n.body.kind === "webview" && e.views.getView(n.id) && e.views.refreshView(n.id);
|
|
1783
|
-
},
|
|
1847
|
+
}, Mn = (e) => (t) => ({
|
|
1784
1848
|
...M({
|
|
1785
1849
|
workbench: t.workbench,
|
|
1786
1850
|
placement: t.placement,
|
|
@@ -1818,25 +1882,25 @@ var Le = (e) => {
|
|
|
1818
1882
|
"files.delete": e.files.delete
|
|
1819
1883
|
} : {},
|
|
1820
1884
|
...e.artifacts ? { "artifacts.read": (n) => e.artifacts.read(n, { webviewId: t.webviewId }) } : {}
|
|
1821
|
-
}),
|
|
1885
|
+
}), Nn = (e) => ({
|
|
1822
1886
|
title: P(e.title) || void 0,
|
|
1823
1887
|
runtimeUrl: e.runtimeUrl,
|
|
1824
1888
|
moduleUrl: e.moduleUrl,
|
|
1825
1889
|
styles: e.styles,
|
|
1826
1890
|
capabilities: e.capabilities
|
|
1827
|
-
}),
|
|
1891
|
+
}), Pn = "extensions", Fn = 1e3, In = 25, Ln = (e) => e === void 0 ? void 0 : e, Rn = (e) => e === "global" ? "user" : "project", zn = (e, t) => t ? (n) => ({
|
|
1828
1892
|
...e(n),
|
|
1829
1893
|
...t(n)
|
|
1830
|
-
}) : e,
|
|
1894
|
+
}) : e, Bn = (e, t) => zn(e.createWebviewHostCapabilities ?? Mn({
|
|
1831
1895
|
artifacts: e.webviewArtifacts,
|
|
1832
1896
|
executeCommand: e.executeCommand,
|
|
1833
1897
|
extensionIdForWebview: (t) => e.metadata.panels.find((e) => e.id === t)?.extensionId,
|
|
1834
1898
|
files: e.webviewFiles,
|
|
1835
1899
|
projectId: e.projectId,
|
|
1836
1900
|
slotKind: t
|
|
1837
|
-
}), e.createWebviewHostCapabilityOverrides),
|
|
1901
|
+
}), e.createWebviewHostCapabilityOverrides), Vn = (e) => e.metadata.panels.flatMap((t) => {
|
|
1838
1902
|
if (!t.webview) return [];
|
|
1839
|
-
let n =
|
|
1903
|
+
let n = Nn(t.webview);
|
|
1840
1904
|
return [e.workbench.views.registerView({
|
|
1841
1905
|
id: t.id,
|
|
1842
1906
|
title: P(t.title, t.id),
|
|
@@ -1852,7 +1916,7 @@ var Le = (e) => {
|
|
|
1852
1916
|
placement: r.instance,
|
|
1853
1917
|
hostEvents: Pe(r.workbench, r.instance)
|
|
1854
1918
|
},
|
|
1855
|
-
createHostCapabilities:
|
|
1919
|
+
createHostCapabilities: Bn(e, i),
|
|
1856
1920
|
createProps: e.createWebviewProps ?? (({ placement: e }) => ({
|
|
1857
1921
|
placement: e,
|
|
1858
1922
|
resource: e.resource
|
|
@@ -1865,20 +1929,20 @@ var Le = (e) => {
|
|
|
1865
1929
|
}
|
|
1866
1930
|
}
|
|
1867
1931
|
})];
|
|
1868
|
-
}),
|
|
1932
|
+
}), Hn = {
|
|
1869
1933
|
first: 1e6,
|
|
1870
1934
|
default: 0,
|
|
1871
1935
|
last: -1e6
|
|
1872
|
-
},
|
|
1936
|
+
}, Un = (e) => e.metadata.panels.flatMap((e) => e.panelMenus ?? []).map((t, n) => e.workbench.viewMenus.registerViewMenu({
|
|
1873
1937
|
id: t.id,
|
|
1874
1938
|
ownerViewId: t.ownerPanelId,
|
|
1875
1939
|
viewId: t.viewId,
|
|
1876
1940
|
side: t.side,
|
|
1877
|
-
priority:
|
|
1878
|
-
})),
|
|
1941
|
+
priority: Hn[t.placement ?? "default"] - n
|
|
1942
|
+
})), X = (e) => {
|
|
1879
1943
|
if (!e || typeof e != "object" || !("statuses" in e) || !Array.isArray(e.statuses)) throw Error("Status provider returned an invalid response");
|
|
1880
1944
|
return e.statuses;
|
|
1881
|
-
},
|
|
1945
|
+
}, Wn = (e, t) => {
|
|
1882
1946
|
let r = e.metadata.statuses ?? [];
|
|
1883
1947
|
if (r.length === 0) return [];
|
|
1884
1948
|
let i = "workbench.extension-statuses.settings", a = r.map((n, r) => e.workbench.statuses.registerStatusSet({
|
|
@@ -1889,8 +1953,8 @@ var Le = (e) => {
|
|
|
1889
1953
|
label: P(e.label, e.id),
|
|
1890
1954
|
icon: e.icon
|
|
1891
1955
|
})),
|
|
1892
|
-
query: async () =>
|
|
1893
|
-
save: n.saveHandlerId ? async (e) =>
|
|
1956
|
+
query: async () => X(await R(t, n.queryHandlerId, { params: {} })),
|
|
1957
|
+
save: n.saveHandlerId ? async (e) => X(await R(t, n.saveHandlerId, { params: { statuses: e } })) : void 0
|
|
1894
1958
|
}, {
|
|
1895
1959
|
ownerId: n.extensionId,
|
|
1896
1960
|
priority: -r
|
|
@@ -1907,13 +1971,13 @@ var Le = (e) => {
|
|
|
1907
1971
|
title: "Statuses",
|
|
1908
1972
|
icon: "list-checks",
|
|
1909
1973
|
kind: "view",
|
|
1910
|
-
order:
|
|
1911
|
-
section: e.settingsSectionId ??
|
|
1974
|
+
order: In,
|
|
1975
|
+
section: e.settingsSectionId ?? Pn,
|
|
1912
1976
|
scope: "project",
|
|
1913
1977
|
viewId: i
|
|
1914
1978
|
})), a;
|
|
1915
|
-
},
|
|
1916
|
-
let t = [], n = e.settingsSectionId ??
|
|
1979
|
+
}, Gn = (e) => {
|
|
1980
|
+
let t = [], n = e.settingsSectionId ?? Pn;
|
|
1917
1981
|
e.workbench.settings.getSection(n) || t.push(e.workbench.settings.registerSection({
|
|
1918
1982
|
id: n,
|
|
1919
1983
|
title: e.settingsSectionTitle ?? "Extensions"
|
|
@@ -1927,8 +1991,8 @@ var Le = (e) => {
|
|
|
1927
1991
|
}));
|
|
1928
1992
|
let i = Object.fromEntries((e.metadata.settingsDefinitions ?? []).map((e) => [e.key, {
|
|
1929
1993
|
type: e.type,
|
|
1930
|
-
scope:
|
|
1931
|
-
default:
|
|
1994
|
+
scope: Rn(e.scope),
|
|
1995
|
+
default: Ln(e.default),
|
|
1932
1996
|
enum: e.enum,
|
|
1933
1997
|
description: P(e.description)
|
|
1934
1998
|
}]));
|
|
@@ -1939,16 +2003,16 @@ var Le = (e) => {
|
|
|
1939
2003
|
title: P(i.title, i.id),
|
|
1940
2004
|
icon: i.icon,
|
|
1941
2005
|
kind: "view",
|
|
1942
|
-
order:
|
|
2006
|
+
order: Fn + r,
|
|
1943
2007
|
section: i.section ?? n,
|
|
1944
2008
|
scope: i.scope,
|
|
1945
2009
|
viewId: i.viewId
|
|
1946
2010
|
}));
|
|
1947
2011
|
return t;
|
|
1948
|
-
}, Z = (e) => !(!e || typeof e != "object" || Array.isArray(e)),
|
|
2012
|
+
}, Z = (e) => !(!e || typeof e != "object" || Array.isArray(e)), Kn = (e, t, n) => h(e) ? F(e, {
|
|
1949
2013
|
extensionId: t,
|
|
1950
2014
|
projectId: n
|
|
1951
|
-
}) : void 0,
|
|
2015
|
+
}) : void 0, qn = (e, t, n) => {
|
|
1952
2016
|
if (!Z(e)) return {};
|
|
1953
2017
|
let r = Z(e.indicator) ? {
|
|
1954
2018
|
icon: String(e.indicator.icon ?? ""),
|
|
@@ -1958,7 +2022,7 @@ var Le = (e) => {
|
|
|
1958
2022
|
id: e.id,
|
|
1959
2023
|
rows: e.rows.flatMap((e) => {
|
|
1960
2024
|
if (!Z(e) || typeof e.id != "string") return [];
|
|
1961
|
-
let r =
|
|
2025
|
+
let r = Kn(e.action, t, n);
|
|
1962
2026
|
return [{
|
|
1963
2027
|
id: e.id,
|
|
1964
2028
|
label: P(e.label, e.id),
|
|
@@ -1979,51 +2043,60 @@ var Le = (e) => {
|
|
|
1979
2043
|
indicator: r?.icon ? r : void 0,
|
|
1980
2044
|
menu: i
|
|
1981
2045
|
};
|
|
1982
|
-
},
|
|
1983
|
-
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
label: a.resource.label,
|
|
1990
|
-
metadata: a.resource.metadata
|
|
1991
|
-
} : void 0;
|
|
1992
|
-
Promise.resolve(R(e, t.queryHandlerId, {
|
|
1993
|
-
resource: o,
|
|
2046
|
+
}, Jn = (e, t) => {
|
|
2047
|
+
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), o = new Set(t.refreshEventIds ?? []), s = 0, c = (o) => {
|
|
2048
|
+
r.set(o.instanceId, o);
|
|
2049
|
+
let l = i.get(o.instanceId);
|
|
2050
|
+
if (l) return l;
|
|
2051
|
+
let u = o.resource, d = s, f = Promise.resolve(R(e, t.queryHandlerId, {
|
|
2052
|
+
resource: u,
|
|
1994
2053
|
params: { renderer: {
|
|
1995
2054
|
rendererId: t.placementId,
|
|
1996
2055
|
projectId: e.projectId,
|
|
1997
|
-
...
|
|
2056
|
+
...u ? { resource: u } : {},
|
|
1998
2057
|
invocation: { placement: "visible" }
|
|
1999
2058
|
} }
|
|
2000
|
-
})).then((r) => {
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2059
|
+
})).then(async (r) => {
|
|
2060
|
+
if (d !== s) {
|
|
2061
|
+
i.delete(o.instanceId), await c(o);
|
|
2062
|
+
return;
|
|
2063
|
+
}
|
|
2064
|
+
n.set(o.instanceId, qn(r, t.extensionId, e.projectId));
|
|
2065
|
+
for (let e of a) e();
|
|
2066
|
+
}).finally(() => {
|
|
2067
|
+
i.get(o.instanceId) === f && i.delete(o.instanceId);
|
|
2068
|
+
});
|
|
2069
|
+
return i.set(o.instanceId, f), f;
|
|
2004
2070
|
};
|
|
2005
2071
|
return {
|
|
2006
2072
|
refreshEvents: t.refreshEventIds,
|
|
2007
2073
|
getSnapshot(e) {
|
|
2008
|
-
return
|
|
2074
|
+
return n.has(e.instanceId) || c(e).catch(() => void 0), n.get(e.instanceId) ?? {};
|
|
2009
2075
|
},
|
|
2010
2076
|
subscribe(t) {
|
|
2011
|
-
|
|
2012
|
-
let
|
|
2013
|
-
|
|
2077
|
+
a.add(t);
|
|
2078
|
+
let n = e.workbench.resources.preview.subscribeRefresh(async (e) => {
|
|
2079
|
+
let t = [...r.values()].filter((t) => t.resource && v(t.resource) === v(e));
|
|
2080
|
+
t.length && (s++, await Promise.all(t.map(c)));
|
|
2081
|
+
}), i = e.subscribeRefreshEvents?.((e) => {
|
|
2082
|
+
if (o.has(e.id)) {
|
|
2083
|
+
s++;
|
|
2084
|
+
for (let e of r.values()) c(e).catch(() => void 0);
|
|
2085
|
+
}
|
|
2014
2086
|
});
|
|
2015
2087
|
return { dispose() {
|
|
2016
|
-
|
|
2088
|
+
a.delete(t), i?.dispose(), n.dispose();
|
|
2017
2089
|
} };
|
|
2018
2090
|
}
|
|
2019
2091
|
};
|
|
2020
|
-
},
|
|
2092
|
+
}, Yn = (e) => {
|
|
2021
2093
|
for (let t = e.length - 1; t >= 0; --t) e[t]?.dispose();
|
|
2022
|
-
}, Q = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, $ = (e, t, n, r, i) => e.prepareCommandArgs?.(t, n, r, i) ?? n,
|
|
2094
|
+
}, Q = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, $ = (e, t, n, r, i) => e.prepareCommandArgs?.(t, n, r, i) ?? n, Xn = (e, t) => t.commands.map((t) => e.workbench.commands.registerCommand({
|
|
2023
2095
|
id: t.id,
|
|
2024
2096
|
label: P(t.title, t.id),
|
|
2025
2097
|
description: P(t.description),
|
|
2026
|
-
params: B(t.params, P, t.extensionId)
|
|
2098
|
+
params: B(t.params, P, t.extensionId),
|
|
2099
|
+
resourceMutation: t.resourceMutation
|
|
2027
2100
|
}, {
|
|
2028
2101
|
prepareArgs: (n, r, i) => $(e, t.id, n, r, i),
|
|
2029
2102
|
execute: (n, r) => R(e, t.id, {
|
|
@@ -2031,9 +2104,9 @@ var Le = (e) => {
|
|
|
2031
2104
|
resource: r?.resource,
|
|
2032
2105
|
signal: r?.signal
|
|
2033
2106
|
})
|
|
2034
|
-
})),
|
|
2107
|
+
})), Zn = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), Qn = (e, t) => {
|
|
2035
2108
|
if (!e.menuSlotsById) return [];
|
|
2036
|
-
let { registrations: n } =
|
|
2109
|
+
let { registrations: n } = ct({
|
|
2037
2110
|
metadata: e.metadata,
|
|
2038
2111
|
menuSlotsById: e.menuSlotsById,
|
|
2039
2112
|
menuTargetsById: e.menuTargetsById,
|
|
@@ -2052,7 +2125,7 @@ var Le = (e) => {
|
|
|
2052
2125
|
...n.contribution.params ?? {},
|
|
2053
2126
|
...Q(r) ?? {}
|
|
2054
2127
|
},
|
|
2055
|
-
resource:
|
|
2128
|
+
resource: Zn(e, i),
|
|
2056
2129
|
slot: I({
|
|
2057
2130
|
id: n.contribution.slotId,
|
|
2058
2131
|
kind: "menu",
|
|
@@ -2061,14 +2134,14 @@ var Le = (e) => {
|
|
|
2061
2134
|
})
|
|
2062
2135
|
})
|
|
2063
2136
|
}), ...n.menuItems.map(({ menuPath: t, menuItem: n }) => e.workbench.layout.registerMenuItem(t, n))]);
|
|
2064
|
-
},
|
|
2137
|
+
}, $n = (t, n) => lt({ metadata: t.metadata }).flatMap((r) => [t.workbench.commands.registerCommand(r.command, {
|
|
2065
2138
|
prepareArgs: (e, t, i) => $(n, r.targetCommandId, e, t, i),
|
|
2066
2139
|
execute: (e, i) => R(n, r.targetCommandId, {
|
|
2067
2140
|
params: {
|
|
2068
2141
|
...r.contribution.params ?? {},
|
|
2069
2142
|
...Q(e) ?? {}
|
|
2070
2143
|
},
|
|
2071
|
-
resource:
|
|
2144
|
+
resource: Zn(t, i),
|
|
2072
2145
|
slot: I({
|
|
2073
2146
|
id: "workbench.commandPalette",
|
|
2074
2147
|
kind: "menu",
|
|
@@ -2077,22 +2150,22 @@ var Le = (e) => {
|
|
|
2077
2150
|
})
|
|
2078
2151
|
}),
|
|
2079
2152
|
isVisible: () => g(r.contribution.when, t.workbench.getPrimaryResource()?.type)
|
|
2080
|
-
}), t.workbench.layout.registerMenuItem(e, r.menuItem)]),
|
|
2153
|
+
}), t.workbench.layout.registerMenuItem(e, r.menuItem)]), er = (e, t) => {
|
|
2081
2154
|
let n = t?.mode;
|
|
2082
2155
|
if (!n) return !0;
|
|
2083
2156
|
let r = e.workbench.modes.getActiveModeId() ?? "";
|
|
2084
2157
|
return Array.isArray(n) ? n.includes(r) : n === r;
|
|
2085
|
-
},
|
|
2158
|
+
}, tr = (e) => (e.metadata.statusBarItems ?? []).map((t) => e.workbench.statusBar.registerItem({
|
|
2086
2159
|
id: t.id,
|
|
2087
2160
|
viewId: t.viewId,
|
|
2088
2161
|
slot: t.slot,
|
|
2089
2162
|
order: t.order,
|
|
2090
|
-
isVisible: () =>
|
|
2091
|
-
})),
|
|
2163
|
+
isVisible: () => er(e, t.when)
|
|
2164
|
+
})), nr = (e) => e.metadata.pages.map((t) => e.workbench.pages.registerPage(t)), rr = (e) => e.metadata.resourceKinds.map((t) => e.workbench.resources.registerKind({
|
|
2092
2165
|
kind: t.id,
|
|
2093
2166
|
label: P(t.label, t.id),
|
|
2094
2167
|
icon: t.icon ?? "FileText"
|
|
2095
|
-
})),
|
|
2168
|
+
})), ir = (e) => e.metadata.modes.map((t) => e.workbench.modes.registerMode({
|
|
2096
2169
|
id: t.modeId,
|
|
2097
2170
|
label: P(t.label, t.modeId),
|
|
2098
2171
|
panels: t.panelRegions,
|
|
@@ -2101,35 +2174,35 @@ var Le = (e) => {
|
|
|
2101
2174
|
defaultTheme: t.defaultTheme,
|
|
2102
2175
|
chrome: t.chrome,
|
|
2103
2176
|
activate: () => void 0
|
|
2104
|
-
})),
|
|
2177
|
+
})), ar = (e) => e.metadata.placements.map((t) => e.workbench.modePlacements.registerPlacement(t)), or = (e) => {
|
|
2105
2178
|
let t = {
|
|
2106
2179
|
...e,
|
|
2107
|
-
metadata:
|
|
2180
|
+
metadata: Dn(e.metadata, { createTab: (t) => Jn(e, t) })
|
|
2108
2181
|
}, n = [], r = t;
|
|
2109
2182
|
try {
|
|
2110
|
-
return n.push(...
|
|
2183
|
+
return n.push(...Xn(r, t.metadata)), n.push(...pn({
|
|
2111
2184
|
bindings: t.metadata.keybindings,
|
|
2112
2185
|
createWhenExpression: t.createKeybindingWhenExpression,
|
|
2113
2186
|
workbench: t.workbench
|
|
2114
|
-
})), n.push(...
|
|
2187
|
+
})), n.push(...Qn(t, r)), n.push(...$n(t, r)), n.push(tn({
|
|
2115
2188
|
...t,
|
|
2116
2189
|
resolveNodeResource: t.resolveTreeNodeResource
|
|
2117
|
-
})), n.push(
|
|
2190
|
+
})), n.push(ht(t)), n.push(Ke(r, t.metadata.controlsRenderers ?? [])), n.push(...Vn(t)), n.push(...Gn(t)), n.push(...Wn(t, r)), n.push(Ut(r, t.metadata.kanbanRenderers ?? [], t.kanbanAdapter)), n.push($e(r, t.metadata.dataTableRenderers ?? [], t.dataTableAdapter)), n.push(...Un(t)), n.push(We(r, t.metadata.commandPaletteResources ?? [])), n.push(...un({
|
|
2118
2191
|
createWhenExpression: e.createNavigationWhenExpression,
|
|
2119
2192
|
metadata: e.metadata,
|
|
2120
2193
|
workbench: e.workbench
|
|
2121
|
-
})), e.subscribeRefreshEvents && n.push(
|
|
2194
|
+
})), e.subscribeRefreshEvents && n.push(An({
|
|
2122
2195
|
metadata: e.metadata,
|
|
2123
2196
|
subscribe: e.subscribeRefreshEvents,
|
|
2124
2197
|
workbench: e.workbench
|
|
2125
|
-
})), n.push(
|
|
2126
|
-
|
|
2198
|
+
})), n.push(...tr(t)), n.push(...rr(t)), n.push(...nr(t)), n.push(...ir(t)), n.push(...ar(t)), { dispose() {
|
|
2199
|
+
Yn(n);
|
|
2127
2200
|
} };
|
|
2128
2201
|
} catch (e) {
|
|
2129
|
-
throw
|
|
2202
|
+
throw Yn(n), e;
|
|
2130
2203
|
}
|
|
2131
2204
|
};
|
|
2132
2205
|
//#endregion
|
|
2133
|
-
export {
|
|
2206
|
+
export { lt as buildWorkbenchExtensionCommandPaletteRegistrations, ct as buildWorkbenchExtensionMenuRegistrations, j as createTerminalSessionCapability, M as createWorkbenchWebviewHostCapabilities, tt as emptyWorkbenchExtensionMetadata, L as executeWorkbenchExtensionCommandResponse, pt as fileRendererRefreshEnvelopeFromCommand, Pe as getBridgeWebviewHostEventPublisher, jn as refreshOpenWorkbenchExtensionWebviews, On as refreshWorkbenchExtensionRenderer, We as registerWorkbenchExtensionCommandPaletteResources, or as registerWorkbenchExtensionContributions, Ke as registerWorkbenchExtensionControlsRenderers, $e as registerWorkbenchExtensionDataTableRenderers, ht as registerWorkbenchExtensionFileRenderers, Ut as registerWorkbenchExtensionKanbanRenderers, An as registerWorkbenchExtensionRendererRefreshEvents, tn as registerWorkbenchExtensionTreeRenderers, Fe as renderBridgeWebviewFrame, F as toWorkbenchNavigationTarget, mn as toWorkbenchWhenExpression };
|
|
2134
2207
|
|
|
2135
2208
|
//# sourceMappingURL=extensions.js.map
|