@pstdio/workbench 0.41.0 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extensions.d.ts +11 -9
- package/dist/extensions.js +318 -246
- package/dist/extensions.js.map +1 -1
- package/dist/{file-renderer-view-CiuJ_aMB.js → file-renderer-view-DA77lgiT.js} +26 -26
- package/dist/{file-renderer-view-CiuJ_aMB.js.map → file-renderer-view-DA77lgiT.js.map} +1 -1
- package/dist/{index-Dh0tRr9k.d.ts → index-BUtrxfUl.d.ts} +75 -8
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1728 -1691
- package/dist/index.js.map +1 -1
- package/dist/{kanban-presentation-C21WIlnn.d.ts → kanban-presentation-Wc433DQF.d.ts} +1 -1
- package/dist/navigation-tree-registry-DbTv4Kv7.js +120 -0
- package/dist/navigation-tree-registry-DbTv4Kv7.js.map +1 -0
- package/dist/react-Buqbh5XD.js +10568 -0
- package/dist/react-Buqbh5XD.js.map +1 -0
- package/dist/react.d.ts +48 -11
- 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-BGXfLY9a.js} +89 -35
- package/dist/workbench-renderers-BGXfLY9a.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 { k as e } from "./workbench-renderers-BGXfLY9a.js";
|
|
2
|
+
import { n as t } from "./navigation-tree-registry-DbTv4Kv7.js";
|
|
3
|
+
import { S as n, c as r, dt as i, l as a, u as o } from "./react-Buqbh5XD.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) {
|
|
@@ -809,7 +850,7 @@ var Le = (e) => {
|
|
|
809
850
|
params: f?.params
|
|
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({
|
|
@@ -838,7 +879,7 @@ var Le = (e) => {
|
|
|
838
879
|
params: s?.params
|
|
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,33 +1098,33 @@ 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"),
|
|
@@ -1091,7 +1132,7 @@ var Le = (e) => {
|
|
|
1091
1132
|
removeFile: t(e.createRow.labels?.removeFile, "Remove file")
|
|
1092
1133
|
}
|
|
1093
1134
|
};
|
|
1094
|
-
},
|
|
1135
|
+
}, Bt = (e, t, n, r, i) => {
|
|
1095
1136
|
if (t.rowActivationHandlerId) return async (n) => {
|
|
1096
1137
|
let a = r(t, n);
|
|
1097
1138
|
await H(e, t, t.rowActivationHandlerId, { row: i(n) }, a);
|
|
@@ -1101,10 +1142,10 @@ var Le = (e) => {
|
|
|
1101
1142
|
row: e,
|
|
1102
1143
|
resource: r(t, e)
|
|
1103
1144
|
});
|
|
1104
|
-
},
|
|
1145
|
+
}, Vt = (e, t, n, r) => {
|
|
1105
1146
|
let i = e.createRow;
|
|
1106
1147
|
if (i) return async (a) => {
|
|
1107
|
-
let o =
|
|
1148
|
+
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
1149
|
if (await t.onAfterCreate?.({
|
|
1109
1150
|
record: e,
|
|
1110
1151
|
created: s,
|
|
@@ -1118,15 +1159,15 @@ var Le = (e) => {
|
|
|
1118
1159
|
attributes: c.attributes ?? {}
|
|
1119
1160
|
});
|
|
1120
1161
|
};
|
|
1121
|
-
},
|
|
1162
|
+
}, Ht = (e, t, n, r, i) => {
|
|
1122
1163
|
let a = t.rowActions;
|
|
1123
1164
|
if (a?.length) return (o) => a.map((a) => {
|
|
1124
|
-
let s = i(t, o), c = () =>
|
|
1165
|
+
let s = i(t, o), c = () => Lt(e, t, a, o, s, r);
|
|
1125
1166
|
return {
|
|
1126
1167
|
key: a.id,
|
|
1127
1168
|
label: r(a.label, a.id),
|
|
1128
1169
|
commandId: a.commandId,
|
|
1129
|
-
icon:
|
|
1170
|
+
icon: Rt(a.icon),
|
|
1130
1171
|
onClick: () => n.executeRowAction ? n.executeRowAction({
|
|
1131
1172
|
record: t,
|
|
1132
1173
|
action: a,
|
|
@@ -1136,29 +1177,33 @@ var Le = (e) => {
|
|
|
1136
1177
|
}) : c()
|
|
1137
1178
|
};
|
|
1138
1179
|
});
|
|
1139
|
-
},
|
|
1180
|
+
}, Ut = (e, t, n = {}) => {
|
|
1140
1181
|
let r = [], i = n.resolveLabel ?? ((e, t) => P(e, t)), o = (e, t) => {
|
|
1141
1182
|
let r = t.display?.kind === "badge-list" ? {
|
|
1142
1183
|
...t,
|
|
1143
1184
|
render: (e, n) => ne(t, e, n)
|
|
1144
1185
|
} : t;
|
|
1145
1186
|
return n.decorateAttribute?.(e, r) ?? r;
|
|
1146
|
-
}, s = n.resolveRowResource ??
|
|
1187
|
+
}, 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
1188
|
for (let l of t) {
|
|
1148
|
-
let t =
|
|
1189
|
+
let t = yt(e, l), d = Ct(l, l.attributes, i, o, t, (t, n) => e.workbench.notifications.show({
|
|
1149
1190
|
id: `workbench.extension.${l.extensionId}.kanban.${l.id}.display.${t}`,
|
|
1150
1191
|
level: "error",
|
|
1151
1192
|
title: "Extension display is not available",
|
|
1152
1193
|
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(...
|
|
1194
|
+
})), 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);
|
|
1195
|
+
r.push(...It(e, l, i)), r.push(e.workbench.views.registerView({
|
|
1155
1196
|
id: l.id,
|
|
1156
1197
|
title: i(l.title, l.id),
|
|
1157
1198
|
icon: l.icon,
|
|
1158
1199
|
body: {
|
|
1159
1200
|
kind: "kanban",
|
|
1160
1201
|
resourceKind: l.resourceKind,
|
|
1161
|
-
toolbarActions:
|
|
1202
|
+
toolbarActions: Je(l),
|
|
1203
|
+
listRowActions: () => (l.rowActions ?? []).map((e) => ({
|
|
1204
|
+
commandId: e.commandId,
|
|
1205
|
+
label: i(e.label, e.id)
|
|
1206
|
+
})),
|
|
1162
1207
|
storageScope: e.projectId,
|
|
1163
1208
|
attributes: d.source,
|
|
1164
1209
|
defaultSettings: p.settings,
|
|
@@ -1173,8 +1218,8 @@ var Le = (e) => {
|
|
|
1173
1218
|
emptyTitle: i(l.emptyTitle, ""),
|
|
1174
1219
|
emptyDescription: i(l.emptyDescription, ""),
|
|
1175
1220
|
hideToolbar: l.hideToolbar,
|
|
1176
|
-
createRow:
|
|
1177
|
-
getBoardColumnConfig: (t) =>
|
|
1221
|
+
createRow: zt(l, i),
|
|
1222
|
+
getBoardColumnConfig: (t) => _t(g?.[t] ?? bt(e, l, f, m, t), i),
|
|
1178
1223
|
onRowActivate: y,
|
|
1179
1224
|
executeQuery: async (t, n) => {
|
|
1180
1225
|
_ += 1;
|
|
@@ -1187,12 +1232,12 @@ var Le = (e) => {
|
|
|
1187
1232
|
sorts: t.sorts,
|
|
1188
1233
|
filters: ie(t.filter)
|
|
1189
1234
|
}, void 0, n), a = (e) => e.map((e) => {
|
|
1190
|
-
let t =
|
|
1235
|
+
let t = Dt(e, v);
|
|
1191
1236
|
return h.set(t, e), t;
|
|
1192
1237
|
});
|
|
1193
|
-
if (r !== _) return Array.isArray(i) ? a(i) :
|
|
1238
|
+
if (r !== _) return Array.isArray(i) ? a(i) : xt(i) ? a(i.rows ?? []) : [];
|
|
1194
1239
|
if (m = t.settings.columnGrouping, Array.isArray(i)) return a(i);
|
|
1195
|
-
if (!
|
|
1240
|
+
if (!xt(i)) return [];
|
|
1196
1241
|
let o = i.attributes ?? f;
|
|
1197
1242
|
return f = o, d.set(o), g = i.boardColumnConfigs, a(i.rows ?? []);
|
|
1198
1243
|
},
|
|
@@ -1205,21 +1250,21 @@ var Le = (e) => {
|
|
|
1205
1250
|
rowId: e,
|
|
1206
1251
|
beforeRowId: t
|
|
1207
1252
|
}).then(() => void 0) : void 0,
|
|
1208
|
-
onCreateRow:
|
|
1253
|
+
onCreateRow: Vt(l, n, u, l.rowActivationHandlerId ? y : void 0),
|
|
1209
1254
|
onColumnAction: l.columnActionHandlerId ? async (e, t) => {
|
|
1210
1255
|
await u(l, l.columnActionHandlerId, {
|
|
1211
1256
|
columnId: e,
|
|
1212
1257
|
actionId: t
|
|
1213
1258
|
});
|
|
1214
1259
|
} : void 0,
|
|
1215
|
-
getRowContextMenuActions:
|
|
1260
|
+
getRowContextMenuActions: Ht(e, l, n, i, c)
|
|
1216
1261
|
}
|
|
1217
1262
|
}));
|
|
1218
1263
|
}
|
|
1219
1264
|
return { dispose() {
|
|
1220
1265
|
for (let e = r.length - 1; e >= 0; --e) r[e]?.dispose();
|
|
1221
1266
|
} };
|
|
1222
|
-
},
|
|
1267
|
+
}, Wt = (e) => ({
|
|
1223
1268
|
id: e.treeId,
|
|
1224
1269
|
kind: "renderer",
|
|
1225
1270
|
context: {
|
|
@@ -1251,14 +1296,14 @@ var Le = (e) => {
|
|
|
1251
1296
|
params: r,
|
|
1252
1297
|
signal: i,
|
|
1253
1298
|
resource: o,
|
|
1254
|
-
slot:
|
|
1299
|
+
slot: Wt({
|
|
1255
1300
|
modeId: a?.modeId,
|
|
1256
1301
|
projectId: e.projectId,
|
|
1257
1302
|
resource: o,
|
|
1258
1303
|
treeId: t.id
|
|
1259
1304
|
})
|
|
1260
1305
|
});
|
|
1261
|
-
},
|
|
1306
|
+
}, Gt = async (e, t, n, r, i) => {
|
|
1262
1307
|
let a = e.workbench.modes.getActiveModeId();
|
|
1263
1308
|
return R(e, n, {
|
|
1264
1309
|
params: {
|
|
@@ -1272,7 +1317,7 @@ var Le = (e) => {
|
|
|
1272
1317
|
}
|
|
1273
1318
|
},
|
|
1274
1319
|
resource: i,
|
|
1275
|
-
slot:
|
|
1320
|
+
slot: Wt({
|
|
1276
1321
|
modeId: a,
|
|
1277
1322
|
projectId: e.projectId,
|
|
1278
1323
|
resource: i,
|
|
@@ -1280,21 +1325,21 @@ var Le = (e) => {
|
|
|
1280
1325
|
}),
|
|
1281
1326
|
metadata: { treeId: t.id }
|
|
1282
1327
|
});
|
|
1283
|
-
},
|
|
1284
|
-
let { ctx: t, getHostTreeHeaderNodes: n, record: r, treeViews: i } = e, a =
|
|
1328
|
+
}, 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) => {
|
|
1329
|
+
let { ctx: t, getHostTreeHeaderNodes: n, record: r, treeViews: i } = e, a = qt(i, t);
|
|
1285
1330
|
return !a || !("hostTreeHeader" in a) || a.hostTreeHeader !== "default" ? [] : await n?.({
|
|
1286
1331
|
ctx: t,
|
|
1287
1332
|
record: r,
|
|
1288
1333
|
panel: a
|
|
1289
1334
|
}) ?? [];
|
|
1290
|
-
},
|
|
1291
|
-
let { ctx: t, getHostTreeFooterNodes: n, record: r, treeViews: i } = e, a =
|
|
1335
|
+
}, Yt = async (e) => {
|
|
1336
|
+
let { ctx: t, getHostTreeFooterNodes: n, record: r, treeViews: i } = e, a = qt(i, t);
|
|
1292
1337
|
return !a || !("hostTreeFooter" in a) || a.hostTreeFooter !== "default" ? [] : await n?.({
|
|
1293
1338
|
ctx: t,
|
|
1294
1339
|
record: r,
|
|
1295
1340
|
panel: a
|
|
1296
1341
|
}) ?? [];
|
|
1297
|
-
},
|
|
1342
|
+
}, 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
1343
|
let n = /* @__PURE__ */ new WeakMap(), r = `workbench.extensionTreeRenderer.${t.id}.command`, i = (t) => e.resolveNodeResource?.(t) ?? t, a = (e) => {
|
|
1299
1344
|
if (e.emptyState) return {
|
|
1300
1345
|
title: P(e.emptyState.title),
|
|
@@ -1322,20 +1367,21 @@ var Le = (e) => {
|
|
|
1322
1367
|
}) : void 0;
|
|
1323
1368
|
return {
|
|
1324
1369
|
id: n.id,
|
|
1370
|
+
resourceMutation: e.metadata.commands.find((e) => e.id === a)?.resourceMutation,
|
|
1325
1371
|
label: P(n.label),
|
|
1326
1372
|
icon: n.icon,
|
|
1327
|
-
args:
|
|
1373
|
+
args: Zt(n.params),
|
|
1328
1374
|
params: B(n.input, P, t.extensionId),
|
|
1329
1375
|
submitLabel: n.submitLabel,
|
|
1330
1376
|
when: n.when,
|
|
1331
1377
|
disabled: n.disabled,
|
|
1332
1378
|
run: a ? async (o) => {
|
|
1333
|
-
let s =
|
|
1379
|
+
let s = Xt(o, Zt(n.params));
|
|
1334
1380
|
if (n.command?.extensionId === "pstdio") {
|
|
1335
1381
|
await e.workbench.commands.executeCommand(a, s, { resource: r?.resource ?? i.resource });
|
|
1336
1382
|
return;
|
|
1337
1383
|
}
|
|
1338
|
-
await
|
|
1384
|
+
await Gt(e, t, a, s, r?.resource ?? i.resource), i.refresh();
|
|
1339
1385
|
} : void 0
|
|
1340
1386
|
};
|
|
1341
1387
|
}, c = (e, t) => {
|
|
@@ -1357,7 +1403,9 @@ var Le = (e) => {
|
|
|
1357
1403
|
description: e.description,
|
|
1358
1404
|
contextValue: e.contextValue,
|
|
1359
1405
|
hiddenByDefault: e.hiddenByDefault,
|
|
1360
|
-
canHide: e.canHide
|
|
1406
|
+
canHide: e.canHide,
|
|
1407
|
+
canDrag: e.canDrag,
|
|
1408
|
+
canDrop: e.canDrop
|
|
1361
1409
|
};
|
|
1362
1410
|
return n.set(r, e), r;
|
|
1363
1411
|
};
|
|
@@ -1376,16 +1424,16 @@ var Le = (e) => {
|
|
|
1376
1424
|
originalNodes: n,
|
|
1377
1425
|
runnerCommandId: r
|
|
1378
1426
|
};
|
|
1379
|
-
}, G = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "nodes" in e),
|
|
1427
|
+
}, 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
1428
|
id: e,
|
|
1381
1429
|
nodes: t,
|
|
1382
1430
|
canReorder: !1
|
|
1383
|
-
}] : [],
|
|
1384
|
-
let n =
|
|
1431
|
+
}] : [], en = (e, t) => {
|
|
1432
|
+
let n = Qt(e, t), r = Kt(e.metadata, t), i = e.workbench.commands.registerCommand({
|
|
1385
1433
|
id: n.runnerCommandId,
|
|
1386
1434
|
label: `${P(t.title, t.id)} tree command`
|
|
1387
1435
|
}, { execute: async (n) => {
|
|
1388
|
-
let r = n, i = await
|
|
1436
|
+
let r = n, i = await Gt(e, t, r.commandId, r.params, r.resource);
|
|
1389
1437
|
for (let t of e.workbench.views.listViews()) t.body.kind === "file" && e.workbench.views.refreshView(t.id);
|
|
1390
1438
|
return i;
|
|
1391
1439
|
} }), a = e.workbench.views.registerView({
|
|
@@ -1399,7 +1447,7 @@ var Le = (e) => {
|
|
|
1399
1447
|
defaultExpandedNodeIds: t.defaultExpandedNodeIds,
|
|
1400
1448
|
defaultExpandedSectionIds: t.defaultExpandedSectionIds,
|
|
1401
1449
|
getHeader: async (i) => {
|
|
1402
|
-
let a = await
|
|
1450
|
+
let a = await Jt({
|
|
1403
1451
|
ctx: i,
|
|
1404
1452
|
getHostTreeHeaderNodes: e.getHostTreeHeaderNodes,
|
|
1405
1453
|
record: t,
|
|
@@ -1414,7 +1462,7 @@ var Le = (e) => {
|
|
|
1414
1462
|
return G(i) ? n.mapSections(i, r) : [];
|
|
1415
1463
|
},
|
|
1416
1464
|
getFooter: async (i) => {
|
|
1417
|
-
let a = await
|
|
1465
|
+
let a = await Yt({
|
|
1418
1466
|
ctx: i,
|
|
1419
1467
|
getHostTreeFooterNodes: e.getHostTreeFooterNodes,
|
|
1420
1468
|
record: t,
|
|
@@ -1424,21 +1472,30 @@ var Le = (e) => {
|
|
|
1424
1472
|
let o = await W(e, t, t.footerHandlerId, U(e, t, i), i.signal);
|
|
1425
1473
|
return [...G(o) ? n.mapSections(o, i) : [], ...K(`${t.id}:host-footer`, a)];
|
|
1426
1474
|
},
|
|
1475
|
+
moveNode: t.moveHandlerId ? async (r, i, a) => {
|
|
1476
|
+
let o = n.originalNodes.get(r), s = i ? n.originalNodes.get(i) : void 0;
|
|
1477
|
+
!o?.canDrag || i && !s?.canDrop || (await W(e, t, t.moveHandlerId, {
|
|
1478
|
+
...U(e, t, a),
|
|
1479
|
+
source: o,
|
|
1480
|
+
target: s,
|
|
1481
|
+
position: a.position ?? "inside"
|
|
1482
|
+
}), a.refresh());
|
|
1483
|
+
} : void 0,
|
|
1427
1484
|
getChildren: async (r, i) => {
|
|
1428
1485
|
if (!t.childrenHandlerId) return r.children ?? [];
|
|
1429
1486
|
let a = n.originalNodes.get(r);
|
|
1430
1487
|
if (!a) return r.children ?? [];
|
|
1431
1488
|
let o = await W(e, t, t.childrenHandlerId, U(e, t, i, a), i.signal);
|
|
1432
|
-
return
|
|
1489
|
+
return $t(o) ? n.mapNodes(o, i) : [];
|
|
1433
1490
|
}
|
|
1434
1491
|
}
|
|
1435
1492
|
});
|
|
1436
1493
|
return { dispose() {
|
|
1437
1494
|
a.dispose(), i.dispose();
|
|
1438
1495
|
} };
|
|
1439
|
-
},
|
|
1496
|
+
}, tn = (e) => {
|
|
1440
1497
|
let t = [];
|
|
1441
|
-
for (let n of e.metadata.treeRenderers ?? []) t.push(
|
|
1498
|
+
for (let n of e.metadata.treeRenderers ?? []) t.push(en(e, n));
|
|
1442
1499
|
return { dispose() {
|
|
1443
1500
|
for (let e = t.length - 1; e >= 0; --e) t[e]?.dispose();
|
|
1444
1501
|
} };
|
|
@@ -1446,20 +1503,20 @@ var Le = (e) => {
|
|
|
1446
1503
|
kind: e.kind,
|
|
1447
1504
|
id: p(e),
|
|
1448
1505
|
extensionId: e.extensionId
|
|
1449
|
-
}),
|
|
1506
|
+
}), nn = (e, t, n) => {
|
|
1450
1507
|
let r = n?.(t.when);
|
|
1451
1508
|
return !r || e.context.matches(r);
|
|
1452
|
-
},
|
|
1509
|
+
}, rn = (e) => ({
|
|
1453
1510
|
id: e.id,
|
|
1454
1511
|
label: P(e.label, e.id),
|
|
1455
1512
|
icon: e.icon,
|
|
1456
1513
|
canHide: !0,
|
|
1457
1514
|
canReorder: !0,
|
|
1458
1515
|
target: F(e.action, { extensionId: e.extensionId })
|
|
1459
|
-
}),
|
|
1516
|
+
}), an = (e, n, r) => {
|
|
1460
1517
|
let i = /* @__PURE__ */ new Map();
|
|
1461
1518
|
for (let a of n) {
|
|
1462
|
-
if (!
|
|
1519
|
+
if (!nn(e, a, r)) continue;
|
|
1463
1520
|
let n = a.group || void 0, o = n ? `${a.extensionId}:${n}` : t(a.slot), s = i.get(o) ?? {
|
|
1464
1521
|
id: o,
|
|
1465
1522
|
label: n,
|
|
@@ -1468,17 +1525,17 @@ var Le = (e) => {
|
|
|
1468
1525
|
canReorder: !0,
|
|
1469
1526
|
nodes: []
|
|
1470
1527
|
};
|
|
1471
|
-
s.nodes.push(
|
|
1528
|
+
s.nodes.push(rn(a)), i.set(o, s);
|
|
1472
1529
|
}
|
|
1473
1530
|
return [...i.values()];
|
|
1474
|
-
},
|
|
1531
|
+
}, on = (e) => {
|
|
1475
1532
|
let t = /* @__PURE__ */ new Map();
|
|
1476
1533
|
for (let n of e) {
|
|
1477
1534
|
let e = q(n.owner), r = `${n.extensionId}:${e.kind}:${e.id}:${n.slot}`;
|
|
1478
1535
|
t.set(r, [...t.get(r) ?? [], n]);
|
|
1479
1536
|
}
|
|
1480
1537
|
return [...t.values()];
|
|
1481
|
-
},
|
|
1538
|
+
}, sn = (e) => [...new Set(e.flatMap((e) => e.group ? [`${e.extensionId}:${e.group}`] : []))], cn = (e) => on(e.metadata.navigationItems).map((t) => {
|
|
1482
1539
|
let n = t[0], r = t.some((e) => e.when?.resourceType?.length || e.when?.metadata);
|
|
1483
1540
|
return e.workbench.navigationTrees.registerContribution({
|
|
1484
1541
|
id: `${n.extensionId}.navigation-items.${n.owner.kind}.${p(n.owner)}.${n.slot}`,
|
|
@@ -1486,11 +1543,16 @@ var Le = (e) => {
|
|
|
1486
1543
|
sourceExtensionId: n.extensionId,
|
|
1487
1544
|
declarationIndex: e.metadata.navigationItems.indexOf(n),
|
|
1488
1545
|
slot: n.slot,
|
|
1489
|
-
defaultExpandedSectionIds:
|
|
1546
|
+
defaultExpandedSectionIds: sn(t),
|
|
1490
1547
|
...r ? {} : { resolveResource: () => void 0 },
|
|
1491
|
-
getSections: () =>
|
|
1548
|
+
getSections: () => an(e.workbench, t, e.createWhenExpression),
|
|
1549
|
+
listActions: () => t.map((e) => ({
|
|
1550
|
+
label: P(e.label, e.id),
|
|
1551
|
+
category: e.group || void 0,
|
|
1552
|
+
action: F(e.action, { extensionId: e.extensionId })
|
|
1553
|
+
}))
|
|
1492
1554
|
});
|
|
1493
|
-
}),
|
|
1555
|
+
}), ln = (e) => e.metadata.navigationTrees.map((t, n) => {
|
|
1494
1556
|
let r = p(t.view);
|
|
1495
1557
|
return e.workbench.navigationTrees.registerContribution({
|
|
1496
1558
|
id: t.id,
|
|
@@ -1502,20 +1564,21 @@ var Le = (e) => {
|
|
|
1502
1564
|
viewId: r,
|
|
1503
1565
|
...t.resourceScope === "project" ? { resolveResource: () => void 0 } : {}
|
|
1504
1566
|
});
|
|
1505
|
-
}),
|
|
1567
|
+
}), un = (e) => [...cn(e), ...ln(e)], dn = () => {
|
|
1506
1568
|
if (typeof navigator > "u") return;
|
|
1507
1569
|
let e = `${navigator.platform} ${navigator.userAgent}`.toLowerCase();
|
|
1508
1570
|
if (e.includes("mac")) return "mac";
|
|
1509
1571
|
if (e.includes("win")) return "win";
|
|
1510
1572
|
if (e.includes("linux")) return "linux";
|
|
1511
|
-
},
|
|
1573
|
+
}, fn = (e, t = dn()) => (t ? e.platformOverrides?.[t] : void 0) ?? e.key, pn = (e) => e.bindings.map((t) => e.workbench.keybindings.registerKeybinding({
|
|
1574
|
+
sourceExtensionId: t.extensionId,
|
|
1512
1575
|
action: F(t.action, { commandIdOf: (e) => e.extensionId ? f({
|
|
1513
1576
|
extensionId: e.extensionId,
|
|
1514
1577
|
id: e.id
|
|
1515
1578
|
}) : void 0 }),
|
|
1516
|
-
keybinding:
|
|
1579
|
+
keybinding: fn(t),
|
|
1517
1580
|
when: e.createWhenExpression?.(t.when)
|
|
1518
|
-
})),
|
|
1581
|
+
})), mn = (e) => {
|
|
1519
1582
|
if (!e) return;
|
|
1520
1583
|
let t = (e) => {
|
|
1521
1584
|
if (e) return Array.isArray(e) ? e.map((e) => p(e)) : p(e);
|
|
@@ -1527,21 +1590,21 @@ var Le = (e) => {
|
|
|
1527
1590
|
resourceType: e.resourceType?.map((e) => e.id),
|
|
1528
1591
|
metadata: e.metadata
|
|
1529
1592
|
};
|
|
1530
|
-
},
|
|
1593
|
+
}, hn = (e, t) => ({
|
|
1531
1594
|
...e,
|
|
1532
1595
|
tab: e.tab && t.createTab ? t.createTab({
|
|
1533
1596
|
...e.tab,
|
|
1534
1597
|
extensionId: t.extensionId,
|
|
1535
1598
|
placementId: t.placementId
|
|
1536
1599
|
}) : void 0
|
|
1537
|
-
}),
|
|
1600
|
+
}), gn = (e, t) => e.kind === "panels" ? e : {
|
|
1538
1601
|
...e,
|
|
1539
1602
|
tab: e.tab && t.createTab ? t.createTab({
|
|
1540
1603
|
...e.tab,
|
|
1541
1604
|
extensionId: t.extensionId,
|
|
1542
1605
|
placementId: t.placementId
|
|
1543
1606
|
}) : void 0
|
|
1544
|
-
},
|
|
1607
|
+
}, _n = (e, t) => e.pages.map((e) => ({
|
|
1545
1608
|
id: e.id,
|
|
1546
1609
|
ref: {
|
|
1547
1610
|
extensionId: e.extensionId,
|
|
@@ -1553,12 +1616,12 @@ var Le = (e) => {
|
|
|
1553
1616
|
document: e.document,
|
|
1554
1617
|
modeId: p(e.mode),
|
|
1555
1618
|
resource: e.resource,
|
|
1556
|
-
main:
|
|
1619
|
+
main: gn(e.main, {
|
|
1557
1620
|
extensionId: e.extensionId,
|
|
1558
1621
|
placementId: `${e.id}.$main`,
|
|
1559
1622
|
createTab: t
|
|
1560
1623
|
}),
|
|
1561
|
-
slots: e.slots.map((n) =>
|
|
1624
|
+
slots: e.slots.map((n) => hn(n, {
|
|
1562
1625
|
extensionId: e.extensionId,
|
|
1563
1626
|
placementId: `${e.id}.${n.id}`,
|
|
1564
1627
|
createTab: t
|
|
@@ -1571,10 +1634,10 @@ var Le = (e) => {
|
|
|
1571
1634
|
view: e.main.view
|
|
1572
1635
|
}] : [], ...e.slots.flatMap((e) => e.item.kind === "binding" ? [e.item.binding] : [])]);
|
|
1573
1636
|
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
|
-
},
|
|
1637
|
+
}, vn = (e) => e.body.kind === "webview" ? { webview: e.body.webview } : { renderer: {
|
|
1575
1638
|
kind: e.body.kind,
|
|
1576
1639
|
id: e.id
|
|
1577
|
-
} },
|
|
1640
|
+
} }, yn = (e, t) => e.viewMenus.flatMap((n) => {
|
|
1578
1641
|
if (p(n.owner) !== t.id) return [];
|
|
1579
1642
|
let r = e.views.find((e) => e.id === p(n.view));
|
|
1580
1643
|
return r ? [{
|
|
@@ -1588,22 +1651,22 @@ var Le = (e) => {
|
|
|
1588
1651
|
placement: n.placement,
|
|
1589
1652
|
hostTreeHeader: n.hostTreeHeader,
|
|
1590
1653
|
hostTreeFooter: n.hostTreeFooter,
|
|
1591
|
-
...
|
|
1654
|
+
...vn(r)
|
|
1592
1655
|
}] : [];
|
|
1593
|
-
}),
|
|
1594
|
-
let n =
|
|
1656
|
+
}), bn = (e) => e.views.map((t) => {
|
|
1657
|
+
let n = yn(e, t);
|
|
1595
1658
|
return {
|
|
1596
1659
|
id: t.id,
|
|
1597
1660
|
extensionId: t.extensionId,
|
|
1598
1661
|
title: t.title,
|
|
1599
1662
|
icon: t.icon,
|
|
1600
1663
|
panelMenus: n.length > 0 ? n : void 0,
|
|
1601
|
-
...
|
|
1664
|
+
...vn(t)
|
|
1602
1665
|
};
|
|
1603
1666
|
}), Y = (e) => e?.map(({ command: e, ...t }) => ({
|
|
1604
1667
|
...t,
|
|
1605
1668
|
commandId: f(e)
|
|
1606
|
-
})),
|
|
1669
|
+
})), xn = (e) => e.views.flatMap((t) => {
|
|
1607
1670
|
let n = t.body;
|
|
1608
1671
|
return n.kind === "kanban" ? [{
|
|
1609
1672
|
...n,
|
|
@@ -1629,7 +1692,7 @@ var Le = (e) => {
|
|
|
1629
1692
|
rowActions: Y(n.rowActions),
|
|
1630
1693
|
toolbarActions: Y(n.toolbarActions)
|
|
1631
1694
|
}] : [];
|
|
1632
|
-
}),
|
|
1695
|
+
}), Sn = (e) => e.views.flatMap((t) => {
|
|
1633
1696
|
let n = t.body;
|
|
1634
1697
|
return n.kind === "dataTable" ? [{
|
|
1635
1698
|
...n,
|
|
@@ -1642,28 +1705,28 @@ var Le = (e) => {
|
|
|
1642
1705
|
rowActions: Y(n.rowActions),
|
|
1643
1706
|
toolbarActions: Y(n.toolbarActions)
|
|
1644
1707
|
}] : [];
|
|
1645
|
-
}),
|
|
1708
|
+
}), Cn = (e) => e.views.flatMap((t) => t.body.kind === "tree" ? [{
|
|
1646
1709
|
...t.body,
|
|
1647
1710
|
id: t.id,
|
|
1648
1711
|
extensionId: t.extensionId,
|
|
1649
1712
|
title: t.title,
|
|
1650
1713
|
icon: t.icon,
|
|
1651
1714
|
resourceKind: t.body.resourceKind ?? J(e, t.id)
|
|
1652
|
-
}] : []),
|
|
1715
|
+
}] : []), wn = (e) => e.views.flatMap((t) => t.body.kind === "file" ? [{
|
|
1653
1716
|
...t.body,
|
|
1654
1717
|
id: t.id,
|
|
1655
1718
|
extensionId: t.extensionId,
|
|
1656
1719
|
title: t.title,
|
|
1657
1720
|
icon: t.icon,
|
|
1658
1721
|
resourceKind: t.body.resourceKind ?? J(e, t.id)
|
|
1659
|
-
}] : []),
|
|
1722
|
+
}] : []), Tn = (e) => e.views.flatMap((t) => t.body.kind === "controls" ? [{
|
|
1660
1723
|
...t.body,
|
|
1661
1724
|
id: t.id,
|
|
1662
1725
|
extensionId: t.extensionId,
|
|
1663
1726
|
title: t.title,
|
|
1664
1727
|
icon: t.icon,
|
|
1665
1728
|
resourceKind: t.body.resourceKind ?? J(e, t.id)
|
|
1666
|
-
}] : []),
|
|
1729
|
+
}] : []), En = (e) => e.modes.map((e) => ({
|
|
1667
1730
|
id: e.id,
|
|
1668
1731
|
extensionId: e.extensionId,
|
|
1669
1732
|
modeId: e.id,
|
|
@@ -1674,15 +1737,15 @@ var Le = (e) => {
|
|
|
1674
1737
|
floatingPanels: e.floatingPanels,
|
|
1675
1738
|
...e.defaultTheme ? { defaultTheme: p(e.defaultTheme) } : {},
|
|
1676
1739
|
...e.chrome ? { chrome: Object.fromEntries(Object.entries(e.chrome).map(([e, t]) => [e, t !== !1 && p(t)])) } : {}
|
|
1677
|
-
})),
|
|
1678
|
-
let n =
|
|
1740
|
+
})), Dn = (e, t = {}) => {
|
|
1741
|
+
let n = bn(e);
|
|
1679
1742
|
return {
|
|
1680
1743
|
extensions: e.extensions,
|
|
1681
1744
|
commands: e.commands,
|
|
1682
1745
|
menuContributions: e.menuContributions,
|
|
1683
1746
|
commandPaletteContributions: e.commandPaletteContributions,
|
|
1684
|
-
modes:
|
|
1685
|
-
pages:
|
|
1747
|
+
modes: En(e),
|
|
1748
|
+
pages: _n(e, t.createTab),
|
|
1686
1749
|
placements: e.placements.map((e) => ({
|
|
1687
1750
|
id: e.id,
|
|
1688
1751
|
ref: {
|
|
@@ -1736,12 +1799,12 @@ var Le = (e) => {
|
|
|
1736
1799
|
section: t.section ? p(t.section) : void 0
|
|
1737
1800
|
}] : [];
|
|
1738
1801
|
}),
|
|
1739
|
-
kanbanRenderers:
|
|
1740
|
-
dataTableRenderers:
|
|
1802
|
+
kanbanRenderers: xn(e),
|
|
1803
|
+
dataTableRenderers: Sn(e),
|
|
1741
1804
|
commandPaletteResources: e.commandPaletteResources ?? [],
|
|
1742
|
-
treeRenderers:
|
|
1743
|
-
fileRenderers:
|
|
1744
|
-
controlsRenderers:
|
|
1805
|
+
treeRenderers: Cn(e),
|
|
1806
|
+
fileRenderers: wn(e),
|
|
1807
|
+
controlsRenderers: Tn(e),
|
|
1745
1808
|
keybindings: e.keybindings ?? [],
|
|
1746
1809
|
settingsDefinitions: e.settingsDefinitions ?? [],
|
|
1747
1810
|
statuses: e.statuses,
|
|
@@ -1751,13 +1814,13 @@ var Le = (e) => {
|
|
|
1751
1814
|
viewId: p(e.view),
|
|
1752
1815
|
slot: e.slot.id.endsWith("leading") ? "leading" : "trailing",
|
|
1753
1816
|
order: e.order,
|
|
1754
|
-
when:
|
|
1817
|
+
when: mn(e.when)
|
|
1755
1818
|
})),
|
|
1756
1819
|
diagnostics: e.diagnostics
|
|
1757
1820
|
};
|
|
1758
|
-
},
|
|
1821
|
+
}, On = (e, t, n = {}) => {
|
|
1759
1822
|
e.views.refreshView(t.id, t.kind === "file" ? n : void 0);
|
|
1760
|
-
},
|
|
1823
|
+
}, kn = (e) => {
|
|
1761
1824
|
let t = /* @__PURE__ */ new Map(), n = (e, n) => {
|
|
1762
1825
|
for (let r of new Set(n.refreshEventIds ?? [])) {
|
|
1763
1826
|
let i = t.get(r) ?? [];
|
|
@@ -1772,15 +1835,15 @@ var Le = (e) => {
|
|
|
1772
1835
|
refreshEventIds: t.body.refreshEventIds
|
|
1773
1836
|
});
|
|
1774
1837
|
return t;
|
|
1775
|
-
},
|
|
1776
|
-
let t =
|
|
1838
|
+
}, An = (e) => {
|
|
1839
|
+
let t = kn(e.metadata);
|
|
1777
1840
|
return e.subscribe((n) => {
|
|
1778
1841
|
let { id: r, ...i } = n;
|
|
1779
|
-
for (let n of t.get(r) ?? [])
|
|
1842
|
+
for (let n of t.get(r) ?? []) On(e.workbench, n, i);
|
|
1780
1843
|
});
|
|
1781
|
-
},
|
|
1844
|
+
}, jn = (e, t) => {
|
|
1782
1845
|
for (let n of t.views) n.body.kind === "webview" && e.views.getView(n.id) && e.views.refreshView(n.id);
|
|
1783
|
-
},
|
|
1846
|
+
}, Mn = (e) => (t) => ({
|
|
1784
1847
|
...M({
|
|
1785
1848
|
workbench: t.workbench,
|
|
1786
1849
|
placement: t.placement,
|
|
@@ -1818,25 +1881,25 @@ var Le = (e) => {
|
|
|
1818
1881
|
"files.delete": e.files.delete
|
|
1819
1882
|
} : {},
|
|
1820
1883
|
...e.artifacts ? { "artifacts.read": (n) => e.artifacts.read(n, { webviewId: t.webviewId }) } : {}
|
|
1821
|
-
}),
|
|
1884
|
+
}), Nn = (e) => ({
|
|
1822
1885
|
title: P(e.title) || void 0,
|
|
1823
1886
|
runtimeUrl: e.runtimeUrl,
|
|
1824
1887
|
moduleUrl: e.moduleUrl,
|
|
1825
1888
|
styles: e.styles,
|
|
1826
1889
|
capabilities: e.capabilities
|
|
1827
|
-
}),
|
|
1890
|
+
}), 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
1891
|
...e(n),
|
|
1829
1892
|
...t(n)
|
|
1830
|
-
}) : e,
|
|
1893
|
+
}) : e, Bn = (e, t) => zn(e.createWebviewHostCapabilities ?? Mn({
|
|
1831
1894
|
artifacts: e.webviewArtifacts,
|
|
1832
1895
|
executeCommand: e.executeCommand,
|
|
1833
1896
|
extensionIdForWebview: (t) => e.metadata.panels.find((e) => e.id === t)?.extensionId,
|
|
1834
1897
|
files: e.webviewFiles,
|
|
1835
1898
|
projectId: e.projectId,
|
|
1836
1899
|
slotKind: t
|
|
1837
|
-
}), e.createWebviewHostCapabilityOverrides),
|
|
1900
|
+
}), e.createWebviewHostCapabilityOverrides), Vn = (e) => e.metadata.panels.flatMap((t) => {
|
|
1838
1901
|
if (!t.webview) return [];
|
|
1839
|
-
let n =
|
|
1902
|
+
let n = Nn(t.webview);
|
|
1840
1903
|
return [e.workbench.views.registerView({
|
|
1841
1904
|
id: t.id,
|
|
1842
1905
|
title: P(t.title, t.id),
|
|
@@ -1852,7 +1915,7 @@ var Le = (e) => {
|
|
|
1852
1915
|
placement: r.instance,
|
|
1853
1916
|
hostEvents: Pe(r.workbench, r.instance)
|
|
1854
1917
|
},
|
|
1855
|
-
createHostCapabilities:
|
|
1918
|
+
createHostCapabilities: Bn(e, i),
|
|
1856
1919
|
createProps: e.createWebviewProps ?? (({ placement: e }) => ({
|
|
1857
1920
|
placement: e,
|
|
1858
1921
|
resource: e.resource
|
|
@@ -1865,20 +1928,20 @@ var Le = (e) => {
|
|
|
1865
1928
|
}
|
|
1866
1929
|
}
|
|
1867
1930
|
})];
|
|
1868
|
-
}),
|
|
1931
|
+
}), Hn = {
|
|
1869
1932
|
first: 1e6,
|
|
1870
1933
|
default: 0,
|
|
1871
1934
|
last: -1e6
|
|
1872
|
-
},
|
|
1935
|
+
}, Un = (e) => e.metadata.panels.flatMap((e) => e.panelMenus ?? []).map((t, n) => e.workbench.viewMenus.registerViewMenu({
|
|
1873
1936
|
id: t.id,
|
|
1874
1937
|
ownerViewId: t.ownerPanelId,
|
|
1875
1938
|
viewId: t.viewId,
|
|
1876
1939
|
side: t.side,
|
|
1877
|
-
priority:
|
|
1878
|
-
})),
|
|
1940
|
+
priority: Hn[t.placement ?? "default"] - n
|
|
1941
|
+
})), X = (e) => {
|
|
1879
1942
|
if (!e || typeof e != "object" || !("statuses" in e) || !Array.isArray(e.statuses)) throw Error("Status provider returned an invalid response");
|
|
1880
1943
|
return e.statuses;
|
|
1881
|
-
},
|
|
1944
|
+
}, Wn = (e, t) => {
|
|
1882
1945
|
let r = e.metadata.statuses ?? [];
|
|
1883
1946
|
if (r.length === 0) return [];
|
|
1884
1947
|
let i = "workbench.extension-statuses.settings", a = r.map((n, r) => e.workbench.statuses.registerStatusSet({
|
|
@@ -1889,8 +1952,8 @@ var Le = (e) => {
|
|
|
1889
1952
|
label: P(e.label, e.id),
|
|
1890
1953
|
icon: e.icon
|
|
1891
1954
|
})),
|
|
1892
|
-
query: async () =>
|
|
1893
|
-
save: n.saveHandlerId ? async (e) =>
|
|
1955
|
+
query: async () => X(await R(t, n.queryHandlerId, { params: {} })),
|
|
1956
|
+
save: n.saveHandlerId ? async (e) => X(await R(t, n.saveHandlerId, { params: { statuses: e } })) : void 0
|
|
1894
1957
|
}, {
|
|
1895
1958
|
ownerId: n.extensionId,
|
|
1896
1959
|
priority: -r
|
|
@@ -1907,13 +1970,13 @@ var Le = (e) => {
|
|
|
1907
1970
|
title: "Statuses",
|
|
1908
1971
|
icon: "list-checks",
|
|
1909
1972
|
kind: "view",
|
|
1910
|
-
order:
|
|
1911
|
-
section: e.settingsSectionId ??
|
|
1973
|
+
order: In,
|
|
1974
|
+
section: e.settingsSectionId ?? Pn,
|
|
1912
1975
|
scope: "project",
|
|
1913
1976
|
viewId: i
|
|
1914
1977
|
})), a;
|
|
1915
|
-
},
|
|
1916
|
-
let t = [], n = e.settingsSectionId ??
|
|
1978
|
+
}, Gn = (e) => {
|
|
1979
|
+
let t = [], n = e.settingsSectionId ?? Pn;
|
|
1917
1980
|
e.workbench.settings.getSection(n) || t.push(e.workbench.settings.registerSection({
|
|
1918
1981
|
id: n,
|
|
1919
1982
|
title: e.settingsSectionTitle ?? "Extensions"
|
|
@@ -1927,8 +1990,8 @@ var Le = (e) => {
|
|
|
1927
1990
|
}));
|
|
1928
1991
|
let i = Object.fromEntries((e.metadata.settingsDefinitions ?? []).map((e) => [e.key, {
|
|
1929
1992
|
type: e.type,
|
|
1930
|
-
scope:
|
|
1931
|
-
default:
|
|
1993
|
+
scope: Rn(e.scope),
|
|
1994
|
+
default: Ln(e.default),
|
|
1932
1995
|
enum: e.enum,
|
|
1933
1996
|
description: P(e.description)
|
|
1934
1997
|
}]));
|
|
@@ -1939,16 +2002,16 @@ var Le = (e) => {
|
|
|
1939
2002
|
title: P(i.title, i.id),
|
|
1940
2003
|
icon: i.icon,
|
|
1941
2004
|
kind: "view",
|
|
1942
|
-
order:
|
|
2005
|
+
order: Fn + r,
|
|
1943
2006
|
section: i.section ?? n,
|
|
1944
2007
|
scope: i.scope,
|
|
1945
2008
|
viewId: i.viewId
|
|
1946
2009
|
}));
|
|
1947
2010
|
return t;
|
|
1948
|
-
}, Z = (e) => !(!e || typeof e != "object" || Array.isArray(e)),
|
|
2011
|
+
}, Z = (e) => !(!e || typeof e != "object" || Array.isArray(e)), Kn = (e, t, n) => h(e) ? F(e, {
|
|
1949
2012
|
extensionId: t,
|
|
1950
2013
|
projectId: n
|
|
1951
|
-
}) : void 0,
|
|
2014
|
+
}) : void 0, qn = (e, t, n) => {
|
|
1952
2015
|
if (!Z(e)) return {};
|
|
1953
2016
|
let r = Z(e.indicator) ? {
|
|
1954
2017
|
icon: String(e.indicator.icon ?? ""),
|
|
@@ -1958,7 +2021,7 @@ var Le = (e) => {
|
|
|
1958
2021
|
id: e.id,
|
|
1959
2022
|
rows: e.rows.flatMap((e) => {
|
|
1960
2023
|
if (!Z(e) || typeof e.id != "string") return [];
|
|
1961
|
-
let r =
|
|
2024
|
+
let r = Kn(e.action, t, n);
|
|
1962
2025
|
return [{
|
|
1963
2026
|
id: e.id,
|
|
1964
2027
|
label: P(e.label, e.id),
|
|
@@ -1979,51 +2042,60 @@ var Le = (e) => {
|
|
|
1979
2042
|
indicator: r?.icon ? r : void 0,
|
|
1980
2043
|
menu: i
|
|
1981
2044
|
};
|
|
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,
|
|
2045
|
+
}, Jn = (e, t) => {
|
|
2046
|
+
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) => {
|
|
2047
|
+
r.set(o.instanceId, o);
|
|
2048
|
+
let l = i.get(o.instanceId);
|
|
2049
|
+
if (l) return l;
|
|
2050
|
+
let u = o.resource, d = s, f = Promise.resolve(R(e, t.queryHandlerId, {
|
|
2051
|
+
resource: u,
|
|
1994
2052
|
params: { renderer: {
|
|
1995
2053
|
rendererId: t.placementId,
|
|
1996
2054
|
projectId: e.projectId,
|
|
1997
|
-
...
|
|
2055
|
+
...u ? { resource: u } : {},
|
|
1998
2056
|
invocation: { placement: "visible" }
|
|
1999
2057
|
} }
|
|
2000
|
-
})).then((r) => {
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2058
|
+
})).then(async (r) => {
|
|
2059
|
+
if (d !== s) {
|
|
2060
|
+
i.delete(o.instanceId), await c(o);
|
|
2061
|
+
return;
|
|
2062
|
+
}
|
|
2063
|
+
n.set(o.instanceId, qn(r, t.extensionId, e.projectId));
|
|
2064
|
+
for (let e of a) e();
|
|
2065
|
+
}).finally(() => {
|
|
2066
|
+
i.get(o.instanceId) === f && i.delete(o.instanceId);
|
|
2067
|
+
});
|
|
2068
|
+
return i.set(o.instanceId, f), f;
|
|
2004
2069
|
};
|
|
2005
2070
|
return {
|
|
2006
2071
|
refreshEvents: t.refreshEventIds,
|
|
2007
2072
|
getSnapshot(e) {
|
|
2008
|
-
return
|
|
2073
|
+
return n.has(e.instanceId) || c(e).catch(() => void 0), n.get(e.instanceId) ?? {};
|
|
2009
2074
|
},
|
|
2010
2075
|
subscribe(t) {
|
|
2011
|
-
|
|
2012
|
-
let
|
|
2013
|
-
|
|
2076
|
+
a.add(t);
|
|
2077
|
+
let n = e.workbench.resources.preview.subscribeRefresh(async (e) => {
|
|
2078
|
+
let t = [...r.values()].filter((t) => t.resource && v(t.resource) === v(e));
|
|
2079
|
+
t.length && (s++, await Promise.all(t.map(c)));
|
|
2080
|
+
}), i = e.subscribeRefreshEvents?.((e) => {
|
|
2081
|
+
if (o.has(e.id)) {
|
|
2082
|
+
s++;
|
|
2083
|
+
for (let e of r.values()) c(e).catch(() => void 0);
|
|
2084
|
+
}
|
|
2014
2085
|
});
|
|
2015
2086
|
return { dispose() {
|
|
2016
|
-
|
|
2087
|
+
a.delete(t), i?.dispose(), n.dispose();
|
|
2017
2088
|
} };
|
|
2018
2089
|
}
|
|
2019
2090
|
};
|
|
2020
|
-
},
|
|
2091
|
+
}, Yn = (e) => {
|
|
2021
2092
|
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,
|
|
2093
|
+
}, 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
2094
|
id: t.id,
|
|
2024
2095
|
label: P(t.title, t.id),
|
|
2025
2096
|
description: P(t.description),
|
|
2026
|
-
params: B(t.params, P, t.extensionId)
|
|
2097
|
+
params: B(t.params, P, t.extensionId),
|
|
2098
|
+
resourceMutation: t.resourceMutation
|
|
2027
2099
|
}, {
|
|
2028
2100
|
prepareArgs: (n, r, i) => $(e, t.id, n, r, i),
|
|
2029
2101
|
execute: (n, r) => R(e, t.id, {
|
|
@@ -2031,9 +2103,9 @@ var Le = (e) => {
|
|
|
2031
2103
|
resource: r?.resource,
|
|
2032
2104
|
signal: r?.signal
|
|
2033
2105
|
})
|
|
2034
|
-
})),
|
|
2106
|
+
})), Zn = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), Qn = (e, t) => {
|
|
2035
2107
|
if (!e.menuSlotsById) return [];
|
|
2036
|
-
let { registrations: n } =
|
|
2108
|
+
let { registrations: n } = ct({
|
|
2037
2109
|
metadata: e.metadata,
|
|
2038
2110
|
menuSlotsById: e.menuSlotsById,
|
|
2039
2111
|
menuTargetsById: e.menuTargetsById,
|
|
@@ -2052,7 +2124,7 @@ var Le = (e) => {
|
|
|
2052
2124
|
...n.contribution.params ?? {},
|
|
2053
2125
|
...Q(r) ?? {}
|
|
2054
2126
|
},
|
|
2055
|
-
resource:
|
|
2127
|
+
resource: Zn(e, i),
|
|
2056
2128
|
slot: I({
|
|
2057
2129
|
id: n.contribution.slotId,
|
|
2058
2130
|
kind: "menu",
|
|
@@ -2061,14 +2133,14 @@ var Le = (e) => {
|
|
|
2061
2133
|
})
|
|
2062
2134
|
})
|
|
2063
2135
|
}), ...n.menuItems.map(({ menuPath: t, menuItem: n }) => e.workbench.layout.registerMenuItem(t, n))]);
|
|
2064
|
-
},
|
|
2136
|
+
}, $n = (t, n) => lt({ metadata: t.metadata }).flatMap((r) => [t.workbench.commands.registerCommand(r.command, {
|
|
2065
2137
|
prepareArgs: (e, t, i) => $(n, r.targetCommandId, e, t, i),
|
|
2066
2138
|
execute: (e, i) => R(n, r.targetCommandId, {
|
|
2067
2139
|
params: {
|
|
2068
2140
|
...r.contribution.params ?? {},
|
|
2069
2141
|
...Q(e) ?? {}
|
|
2070
2142
|
},
|
|
2071
|
-
resource:
|
|
2143
|
+
resource: Zn(t, i),
|
|
2072
2144
|
slot: I({
|
|
2073
2145
|
id: "workbench.commandPalette",
|
|
2074
2146
|
kind: "menu",
|
|
@@ -2077,22 +2149,22 @@ var Le = (e) => {
|
|
|
2077
2149
|
})
|
|
2078
2150
|
}),
|
|
2079
2151
|
isVisible: () => g(r.contribution.when, t.workbench.getPrimaryResource()?.type)
|
|
2080
|
-
}), t.workbench.layout.registerMenuItem(e, r.menuItem)]),
|
|
2152
|
+
}), t.workbench.layout.registerMenuItem(e, r.menuItem)]), er = (e, t) => {
|
|
2081
2153
|
let n = t?.mode;
|
|
2082
2154
|
if (!n) return !0;
|
|
2083
2155
|
let r = e.workbench.modes.getActiveModeId() ?? "";
|
|
2084
2156
|
return Array.isArray(n) ? n.includes(r) : n === r;
|
|
2085
|
-
},
|
|
2157
|
+
}, tr = (e) => (e.metadata.statusBarItems ?? []).map((t) => e.workbench.statusBar.registerItem({
|
|
2086
2158
|
id: t.id,
|
|
2087
2159
|
viewId: t.viewId,
|
|
2088
2160
|
slot: t.slot,
|
|
2089
2161
|
order: t.order,
|
|
2090
|
-
isVisible: () =>
|
|
2091
|
-
})),
|
|
2162
|
+
isVisible: () => er(e, t.when)
|
|
2163
|
+
})), nr = (e) => e.metadata.pages.map((t) => e.workbench.pages.registerPage(t)), rr = (e) => e.metadata.resourceKinds.map((t) => e.workbench.resources.registerKind({
|
|
2092
2164
|
kind: t.id,
|
|
2093
2165
|
label: P(t.label, t.id),
|
|
2094
2166
|
icon: t.icon ?? "FileText"
|
|
2095
|
-
})),
|
|
2167
|
+
})), ir = (e) => e.metadata.modes.map((t) => e.workbench.modes.registerMode({
|
|
2096
2168
|
id: t.modeId,
|
|
2097
2169
|
label: P(t.label, t.modeId),
|
|
2098
2170
|
panels: t.panelRegions,
|
|
@@ -2101,35 +2173,35 @@ var Le = (e) => {
|
|
|
2101
2173
|
defaultTheme: t.defaultTheme,
|
|
2102
2174
|
chrome: t.chrome,
|
|
2103
2175
|
activate: () => void 0
|
|
2104
|
-
})),
|
|
2176
|
+
})), ar = (e) => e.metadata.placements.map((t) => e.workbench.modePlacements.registerPlacement(t)), or = (e) => {
|
|
2105
2177
|
let t = {
|
|
2106
2178
|
...e,
|
|
2107
|
-
metadata:
|
|
2179
|
+
metadata: Dn(e.metadata, { createTab: (t) => Jn(e, t) })
|
|
2108
2180
|
}, n = [], r = t;
|
|
2109
2181
|
try {
|
|
2110
|
-
return n.push(...
|
|
2182
|
+
return n.push(...Xn(r, t.metadata)), n.push(...pn({
|
|
2111
2183
|
bindings: t.metadata.keybindings,
|
|
2112
2184
|
createWhenExpression: t.createKeybindingWhenExpression,
|
|
2113
2185
|
workbench: t.workbench
|
|
2114
|
-
})), n.push(...
|
|
2186
|
+
})), n.push(...Qn(t, r)), n.push(...$n(t, r)), n.push(tn({
|
|
2115
2187
|
...t,
|
|
2116
2188
|
resolveNodeResource: t.resolveTreeNodeResource
|
|
2117
|
-
})), n.push(
|
|
2189
|
+
})), 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
2190
|
createWhenExpression: e.createNavigationWhenExpression,
|
|
2119
2191
|
metadata: e.metadata,
|
|
2120
2192
|
workbench: e.workbench
|
|
2121
|
-
})), e.subscribeRefreshEvents && n.push(
|
|
2193
|
+
})), e.subscribeRefreshEvents && n.push(An({
|
|
2122
2194
|
metadata: e.metadata,
|
|
2123
2195
|
subscribe: e.subscribeRefreshEvents,
|
|
2124
2196
|
workbench: e.workbench
|
|
2125
|
-
})), n.push(
|
|
2126
|
-
|
|
2197
|
+
})), n.push(...tr(t)), n.push(...rr(t)), n.push(...nr(t)), n.push(...ir(t)), n.push(...ar(t)), { dispose() {
|
|
2198
|
+
Yn(n);
|
|
2127
2199
|
} };
|
|
2128
2200
|
} catch (e) {
|
|
2129
|
-
throw
|
|
2201
|
+
throw Yn(n), e;
|
|
2130
2202
|
}
|
|
2131
2203
|
};
|
|
2132
2204
|
//#endregion
|
|
2133
|
-
export {
|
|
2205
|
+
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
2206
|
|
|
2135
2207
|
//# sourceMappingURL=extensions.js.map
|