@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
|
@@ -375,6 +375,39 @@ var sidebarFooterItemsByRegistrationSet = /* @__PURE__ */ new WeakMap();
|
|
|
375
375
|
function getCollectedSidebarFooterItems(registrations) {
|
|
376
376
|
return sidebarFooterItemsByRegistrationSet.get(registrations) ?? null;
|
|
377
377
|
}
|
|
378
|
+
function collectTitledComponent(kind, seen, registration) {
|
|
379
|
+
const id = requireSlotId(kind, registration?.id);
|
|
380
|
+
requireUniqueId(kind, seen, id);
|
|
381
|
+
const description = requireOptionalString(
|
|
382
|
+
kind,
|
|
383
|
+
"description",
|
|
384
|
+
registration.description
|
|
385
|
+
);
|
|
386
|
+
return {
|
|
387
|
+
id,
|
|
388
|
+
title: requireNonEmptyString(kind, "title", registration.title),
|
|
389
|
+
...description !== void 0 ? { description } : {},
|
|
390
|
+
component: requireComponent(kind, registration.component)
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
function collectPanelAction(kind, seen, registration) {
|
|
394
|
+
const id = requireSlotId(kind, registration?.id);
|
|
395
|
+
requireUniqueId(kind, seen, id);
|
|
396
|
+
if (registration.run !== void 0 && typeof registration.run !== "function") {
|
|
397
|
+
throw new Error(`${kind}: "run" must be a function when set`);
|
|
398
|
+
}
|
|
399
|
+
if (registration.layout !== void 0 && registration.layout !== "padded" && registration.layout !== "flush") {
|
|
400
|
+
throw new Error(`${kind}: "layout" must be "padded" or "flush"`);
|
|
401
|
+
}
|
|
402
|
+
return {
|
|
403
|
+
id,
|
|
404
|
+
title: requireNonEmptyString(kind, "title", registration.title),
|
|
405
|
+
...registration.icon !== void 0 ? { icon: requireNonEmptyString(kind, "icon", registration.icon) } : {},
|
|
406
|
+
component: requireComponent(kind, registration.component),
|
|
407
|
+
...registration.layout !== void 0 ? { layout: registration.layout } : {},
|
|
408
|
+
...registration.run !== void 0 ? { run: registration.run } : {}
|
|
409
|
+
};
|
|
410
|
+
}
|
|
378
411
|
function collectPluginAppRegistrations(definition, onComposerCustomizationRejected = (reason) => console.warn(reason)) {
|
|
379
412
|
const sidebarFooterItems = [];
|
|
380
413
|
const collected = {
|
|
@@ -554,46 +587,22 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
554
587
|
});
|
|
555
588
|
},
|
|
556
589
|
threadPanelAction(registration) {
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
throw new Error(`${kind}: "layout" must be "padded" or "flush"`);
|
|
565
|
-
}
|
|
566
|
-
collected.threadPanelActions.push({
|
|
567
|
-
id,
|
|
568
|
-
title: requireNonEmptyString(kind, "title", registration.title),
|
|
569
|
-
...registration.icon !== void 0 ? {
|
|
570
|
-
icon: requireNonEmptyString(kind, "icon", registration.icon)
|
|
571
|
-
} : {},
|
|
572
|
-
component: requireComponent(kind, registration.component),
|
|
573
|
-
...registration.layout !== void 0 ? { layout: registration.layout } : {},
|
|
574
|
-
...registration.run !== void 0 ? { run: registration.run } : {}
|
|
575
|
-
});
|
|
590
|
+
collected.threadPanelActions.push(
|
|
591
|
+
collectPanelAction(
|
|
592
|
+
"slots.threadPanelAction",
|
|
593
|
+
seenIds.threadPanelAction,
|
|
594
|
+
registration
|
|
595
|
+
)
|
|
596
|
+
);
|
|
576
597
|
},
|
|
577
598
|
experimental_newThreadPanelAction(registration) {
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
throw new Error(`${kind}: "layout" must be "padded" or "flush"`);
|
|
586
|
-
}
|
|
587
|
-
collected.newThreadPanelActions.push({
|
|
588
|
-
id,
|
|
589
|
-
title: requireNonEmptyString(kind, "title", registration.title),
|
|
590
|
-
...registration.icon !== void 0 ? {
|
|
591
|
-
icon: requireNonEmptyString(kind, "icon", registration.icon)
|
|
592
|
-
} : {},
|
|
593
|
-
component: requireComponent(kind, registration.component),
|
|
594
|
-
...registration.layout !== void 0 ? { layout: registration.layout } : {},
|
|
595
|
-
...registration.run !== void 0 ? { run: registration.run } : {}
|
|
596
|
-
});
|
|
599
|
+
collected.newThreadPanelActions.push(
|
|
600
|
+
collectPanelAction(
|
|
601
|
+
"slots.experimental_newThreadPanelAction",
|
|
602
|
+
seenIds.newThreadPanelAction,
|
|
603
|
+
registration
|
|
604
|
+
)
|
|
605
|
+
);
|
|
597
606
|
},
|
|
598
607
|
pendingInteraction(registration) {
|
|
599
608
|
const kind = "slots.pendingInteraction";
|
|
@@ -621,36 +630,22 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
621
630
|
sidebarFooterItems.push(adaptSidebarFooterAction(legacyRegistration));
|
|
622
631
|
},
|
|
623
632
|
experimental_sidebarNavigation(registration) {
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
registration.description
|
|
633
|
+
collected.experimentalSidebarNavigations.push(
|
|
634
|
+
collectTitledComponent(
|
|
635
|
+
"slots.experimental_sidebarNavigation",
|
|
636
|
+
seenIds.sidebarNavigation,
|
|
637
|
+
registration
|
|
638
|
+
)
|
|
631
639
|
);
|
|
632
|
-
collected.experimentalSidebarNavigations.push({
|
|
633
|
-
id,
|
|
634
|
-
title: requireNonEmptyString(kind, "title", registration.title),
|
|
635
|
-
...description !== void 0 ? { description } : {},
|
|
636
|
-
component: requireComponent(kind, registration.component)
|
|
637
|
-
});
|
|
638
640
|
},
|
|
639
641
|
experimental_threadList(registration) {
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
registration.description
|
|
642
|
+
collected.threadLists.push(
|
|
643
|
+
collectTitledComponent(
|
|
644
|
+
"slots.experimental_threadList",
|
|
645
|
+
seenIds.threadList,
|
|
646
|
+
registration
|
|
647
|
+
)
|
|
647
648
|
);
|
|
648
|
-
collected.threadLists.push({
|
|
649
|
-
id,
|
|
650
|
-
title: requireNonEmptyString(kind, "title", registration.title),
|
|
651
|
-
...description !== void 0 ? { description } : {},
|
|
652
|
-
component: requireComponent(kind, registration.component)
|
|
653
|
-
});
|
|
654
649
|
},
|
|
655
650
|
experimental_threadHeaderAction(registration) {
|
|
656
651
|
const kind = "slots.experimental_threadHeaderAction";
|
|
@@ -688,36 +683,22 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
688
683
|
});
|
|
689
684
|
},
|
|
690
685
|
experimental_sourceCodeRenderer(registration) {
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
registration.description
|
|
686
|
+
collected.sourceCodeRenderers.push(
|
|
687
|
+
collectTitledComponent(
|
|
688
|
+
"slots.experimental_sourceCodeRenderer",
|
|
689
|
+
seenIds.sourceCodeRenderer,
|
|
690
|
+
registration
|
|
691
|
+
)
|
|
698
692
|
);
|
|
699
|
-
collected.sourceCodeRenderers.push({
|
|
700
|
-
id,
|
|
701
|
-
title: requireNonEmptyString(kind, "title", registration.title),
|
|
702
|
-
...description !== void 0 ? { description } : {},
|
|
703
|
-
component: requireComponent(kind, registration.component)
|
|
704
|
-
});
|
|
705
693
|
},
|
|
706
694
|
experimental_diffRenderer(registration) {
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
registration.description
|
|
695
|
+
collected.diffRenderers.push(
|
|
696
|
+
collectTitledComponent(
|
|
697
|
+
"slots.experimental_diffRenderer",
|
|
698
|
+
seenIds.diffRenderer,
|
|
699
|
+
registration
|
|
700
|
+
)
|
|
714
701
|
);
|
|
715
|
-
collected.diffRenderers.push({
|
|
716
|
-
id,
|
|
717
|
-
title: requireNonEmptyString(kind, "title", registration.title),
|
|
718
|
-
...description !== void 0 ? { description } : {},
|
|
719
|
-
component: requireComponent(kind, registration.component)
|
|
720
|
-
});
|
|
721
702
|
},
|
|
722
703
|
messageDirective(registration) {
|
|
723
704
|
const kind = "slots.messageDirective";
|