@get-bb/plugin-sdk 0.4.84 → 0.4.88
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/bundled-types/bb-plugin-sdk-app.d.ts +9 -1
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +229 -43
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +52 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +131 -2
- package/bundled-types/bb-plugin-sdk-testing.d.ts +17 -8
- package/bundled-types/bb-plugin-sdk.d.ts +172 -5
- package/dist/host.js +1 -1
- package/dist/internal/host-policy.js +790 -114
- package/dist/internal/plugin-app-collector.js +71 -90
- package/dist/provider-bridge-acp.js +1967 -2047
- package/dist/provider-bridge-testing.js +1378 -1405
- package/dist/provider-bridge-worker-entry.mjs +0 -1
- package/dist/provider-bridge.js +1458 -1500
- package/dist/testing/app.js +71 -90
- package/dist/testing/index.js +954 -791
- package/package.json +1 -2
package/dist/testing/app.js
CHANGED
|
@@ -551,6 +551,39 @@ function rejectStaleNavPanelKeys(kind, registration) {
|
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
var sidebarFooterItemsByRegistrationSet = /* @__PURE__ */ new WeakMap();
|
|
554
|
+
function collectTitledComponent(kind, seen, registration) {
|
|
555
|
+
const id = requireSlotId(kind, registration?.id);
|
|
556
|
+
requireUniqueId(kind, seen, id);
|
|
557
|
+
const description = requireOptionalString(
|
|
558
|
+
kind,
|
|
559
|
+
"description",
|
|
560
|
+
registration.description
|
|
561
|
+
);
|
|
562
|
+
return {
|
|
563
|
+
id,
|
|
564
|
+
title: requireNonEmptyString(kind, "title", registration.title),
|
|
565
|
+
...description !== void 0 ? { description } : {},
|
|
566
|
+
component: requireComponent(kind, registration.component)
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
function collectPanelAction(kind, seen, registration) {
|
|
570
|
+
const id = requireSlotId(kind, registration?.id);
|
|
571
|
+
requireUniqueId(kind, seen, id);
|
|
572
|
+
if (registration.run !== void 0 && typeof registration.run !== "function") {
|
|
573
|
+
throw new Error(`${kind}: "run" must be a function when set`);
|
|
574
|
+
}
|
|
575
|
+
if (registration.layout !== void 0 && registration.layout !== "padded" && registration.layout !== "flush") {
|
|
576
|
+
throw new Error(`${kind}: "layout" must be "padded" or "flush"`);
|
|
577
|
+
}
|
|
578
|
+
return {
|
|
579
|
+
id,
|
|
580
|
+
title: requireNonEmptyString(kind, "title", registration.title),
|
|
581
|
+
...registration.icon !== void 0 ? { icon: requireNonEmptyString(kind, "icon", registration.icon) } : {},
|
|
582
|
+
component: requireComponent(kind, registration.component),
|
|
583
|
+
...registration.layout !== void 0 ? { layout: registration.layout } : {},
|
|
584
|
+
...registration.run !== void 0 ? { run: registration.run } : {}
|
|
585
|
+
};
|
|
586
|
+
}
|
|
554
587
|
function collectPluginAppRegistrations(definition, onComposerCustomizationRejected = (reason) => console.warn(reason)) {
|
|
555
588
|
const sidebarFooterItems = [];
|
|
556
589
|
const collected = {
|
|
@@ -730,46 +763,22 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
730
763
|
});
|
|
731
764
|
},
|
|
732
765
|
threadPanelAction(registration) {
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
throw new Error(`${kind}: "layout" must be "padded" or "flush"`);
|
|
741
|
-
}
|
|
742
|
-
collected.threadPanelActions.push({
|
|
743
|
-
id,
|
|
744
|
-
title: requireNonEmptyString(kind, "title", registration.title),
|
|
745
|
-
...registration.icon !== void 0 ? {
|
|
746
|
-
icon: requireNonEmptyString(kind, "icon", registration.icon)
|
|
747
|
-
} : {},
|
|
748
|
-
component: requireComponent(kind, registration.component),
|
|
749
|
-
...registration.layout !== void 0 ? { layout: registration.layout } : {},
|
|
750
|
-
...registration.run !== void 0 ? { run: registration.run } : {}
|
|
751
|
-
});
|
|
766
|
+
collected.threadPanelActions.push(
|
|
767
|
+
collectPanelAction(
|
|
768
|
+
"slots.threadPanelAction",
|
|
769
|
+
seenIds.threadPanelAction,
|
|
770
|
+
registration
|
|
771
|
+
)
|
|
772
|
+
);
|
|
752
773
|
},
|
|
753
774
|
experimental_newThreadPanelAction(registration) {
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
throw new Error(`${kind}: "layout" must be "padded" or "flush"`);
|
|
762
|
-
}
|
|
763
|
-
collected.newThreadPanelActions.push({
|
|
764
|
-
id,
|
|
765
|
-
title: requireNonEmptyString(kind, "title", registration.title),
|
|
766
|
-
...registration.icon !== void 0 ? {
|
|
767
|
-
icon: requireNonEmptyString(kind, "icon", registration.icon)
|
|
768
|
-
} : {},
|
|
769
|
-
component: requireComponent(kind, registration.component),
|
|
770
|
-
...registration.layout !== void 0 ? { layout: registration.layout } : {},
|
|
771
|
-
...registration.run !== void 0 ? { run: registration.run } : {}
|
|
772
|
-
});
|
|
775
|
+
collected.newThreadPanelActions.push(
|
|
776
|
+
collectPanelAction(
|
|
777
|
+
"slots.experimental_newThreadPanelAction",
|
|
778
|
+
seenIds.newThreadPanelAction,
|
|
779
|
+
registration
|
|
780
|
+
)
|
|
781
|
+
);
|
|
773
782
|
},
|
|
774
783
|
pendingInteraction(registration) {
|
|
775
784
|
const kind = "slots.pendingInteraction";
|
|
@@ -797,36 +806,22 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
797
806
|
sidebarFooterItems.push(adaptSidebarFooterAction(legacyRegistration));
|
|
798
807
|
},
|
|
799
808
|
experimental_sidebarNavigation(registration) {
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
registration.description
|
|
809
|
+
collected.experimentalSidebarNavigations.push(
|
|
810
|
+
collectTitledComponent(
|
|
811
|
+
"slots.experimental_sidebarNavigation",
|
|
812
|
+
seenIds.sidebarNavigation,
|
|
813
|
+
registration
|
|
814
|
+
)
|
|
807
815
|
);
|
|
808
|
-
collected.experimentalSidebarNavigations.push({
|
|
809
|
-
id,
|
|
810
|
-
title: requireNonEmptyString(kind, "title", registration.title),
|
|
811
|
-
...description !== void 0 ? { description } : {},
|
|
812
|
-
component: requireComponent(kind, registration.component)
|
|
813
|
-
});
|
|
814
816
|
},
|
|
815
817
|
experimental_threadList(registration) {
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
registration.description
|
|
818
|
+
collected.threadLists.push(
|
|
819
|
+
collectTitledComponent(
|
|
820
|
+
"slots.experimental_threadList",
|
|
821
|
+
seenIds.threadList,
|
|
822
|
+
registration
|
|
823
|
+
)
|
|
823
824
|
);
|
|
824
|
-
collected.threadLists.push({
|
|
825
|
-
id,
|
|
826
|
-
title: requireNonEmptyString(kind, "title", registration.title),
|
|
827
|
-
...description !== void 0 ? { description } : {},
|
|
828
|
-
component: requireComponent(kind, registration.component)
|
|
829
|
-
});
|
|
830
825
|
},
|
|
831
826
|
experimental_threadHeaderAction(registration) {
|
|
832
827
|
const kind = "slots.experimental_threadHeaderAction";
|
|
@@ -864,36 +859,22 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
864
859
|
});
|
|
865
860
|
},
|
|
866
861
|
experimental_sourceCodeRenderer(registration) {
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
registration.description
|
|
862
|
+
collected.sourceCodeRenderers.push(
|
|
863
|
+
collectTitledComponent(
|
|
864
|
+
"slots.experimental_sourceCodeRenderer",
|
|
865
|
+
seenIds.sourceCodeRenderer,
|
|
866
|
+
registration
|
|
867
|
+
)
|
|
874
868
|
);
|
|
875
|
-
collected.sourceCodeRenderers.push({
|
|
876
|
-
id,
|
|
877
|
-
title: requireNonEmptyString(kind, "title", registration.title),
|
|
878
|
-
...description !== void 0 ? { description } : {},
|
|
879
|
-
component: requireComponent(kind, registration.component)
|
|
880
|
-
});
|
|
881
869
|
},
|
|
882
870
|
experimental_diffRenderer(registration) {
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
registration.description
|
|
871
|
+
collected.diffRenderers.push(
|
|
872
|
+
collectTitledComponent(
|
|
873
|
+
"slots.experimental_diffRenderer",
|
|
874
|
+
seenIds.diffRenderer,
|
|
875
|
+
registration
|
|
876
|
+
)
|
|
890
877
|
);
|
|
891
|
-
collected.diffRenderers.push({
|
|
892
|
-
id,
|
|
893
|
-
title: requireNonEmptyString(kind, "title", registration.title),
|
|
894
|
-
...description !== void 0 ? { description } : {},
|
|
895
|
-
component: requireComponent(kind, registration.component)
|
|
896
|
-
});
|
|
897
878
|
},
|
|
898
879
|
messageDirective(registration) {
|
|
899
880
|
const kind = "slots.messageDirective";
|