@get-bb/plugin-sdk 0.4.8 → 0.4.10

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.
@@ -7,7 +7,7 @@
7
7
 
8
8
  import { ReactNode, ComponentType } from 'react';
9
9
  import { RenderResult } from '@testing-library/react';
10
- import { PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, PluginFileOpenerRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginProviderIconRegistration, PluginContentScriptRegistration, PluginComposerScope, PluginComposerTextEffect, PluginComposerMention, PluginComposerThreadRowStatus, BbNavigate, PluginAppDefinition, PluginRpcContract, StandardSchemaV1InferInput, PluginRpcResult, PluginRealtimeConnectionState, PluginSidebarThreadsState, PluginSidebarPullRequest, PluginSidebarThreadActions } from '@get-bb/plugin-sdk';
10
+ import { PluginHomepageSectionRegistration, PluginSettingsSectionRegistration, PluginNavPanelRegistration, PluginThreadPanelActionRegistration, PluginNewThreadPanelActionRegistration, ComposerCustomization, PluginPendingInteractionRegistration, PluginSidebarFooterActionRegistration, PluginThreadListRegistration, PluginThreadHeaderActionRegistration, PluginFileOpenerRegistration, PluginSourceCodeRendererRegistration, PluginDiffRendererRegistration, PluginMessageDirectiveRegistration, PluginMessageActionRegistration, PluginProviderIconRegistration, PluginContentScriptRegistration, PluginComposerScope, PluginComposerTextEffect, PluginComposerMention, PluginComposerThreadRowStatus, ExperimentalOpenFixedTabOptions, JsonValue, BbNavigate, ExperimentalFileOpenOptions, PluginAppDefinition, PluginRpcContract, StandardSchemaV1InferInput, PluginRpcResult, PluginRealtimeConnectionState, PluginSidebarThreadsState, PluginSidebarPullRequest, PluginSidebarThreadActions } from '@get-bb/plugin-sdk';
11
11
 
12
12
  /**
13
13
  * `@get-bb/plugin-sdk/testing/app` — the frontend plugin test harness. Tests a
@@ -59,7 +59,22 @@ type NavigateCall = {
59
59
  } | {
60
60
  method: "openThreadPanel";
61
61
  options: Parameters<BbNavigate["openThreadPanel"]>[0];
62
+ } | {
63
+ method: "experimental_openUrl";
64
+ url: string;
65
+ } | {
66
+ method: "experimental_openFilePreview";
67
+ options: ExperimentalFileOpenOptions;
68
+ } | {
69
+ method: "experimental_openFileExternally";
70
+ options: ExperimentalFileOpenOptions;
62
71
  };
72
+ interface ExperimentalFixedTabOpenCall {
73
+ surface: ExperimentalOpenFixedTabOptions<JsonValue>["surface"];
74
+ panelId: string;
75
+ tabId: string;
76
+ target?: JsonValue;
77
+ }
63
78
  interface ComposerLog {
64
79
  /** Latest plain text in this isolated composer scope. */
65
80
  readonly text: string;
@@ -104,6 +119,8 @@ interface CapturedPluginApp {
104
119
  threadLists: PluginThreadListRegistration[];
105
120
  threadHeaderActions: PluginThreadHeaderActionRegistration[];
106
121
  fileOpeners: PluginFileOpenerRegistration[];
122
+ sourceCodeRenderers: PluginSourceCodeRendererRegistration[];
123
+ diffRenderers: PluginDiffRendererRegistration[];
107
124
  messageDirectives: PluginMessageDirectiveRegistration[];
108
125
  messageActions: PluginMessageActionRegistration[];
109
126
  providerIcons: PluginProviderIconRegistration[];
@@ -191,6 +208,20 @@ interface RenderSlotOptions<Contract extends PluginRpcContract = PluginRpcContra
191
208
  sidebarPullRequests?: Record<string, PluginSidebarPullRequest>;
192
209
  /** Host acceptance for `useBbNavigate().openThreadPanel`. */
193
210
  openThreadPanel?: (options: Parameters<BbNavigate["openThreadPanel"]>[0]) => boolean;
211
+ /** Host acceptance for URL intents from the hook or `experimental_UrlLink`. */
212
+ openUrl?: (url: string) => boolean;
213
+ /** Host acceptance for preview intents from the hook or file link. */
214
+ openFilePreview?: (options: ExperimentalFileOpenOptions) => boolean;
215
+ /** Host acceptance for preferred-external file intents. */
216
+ openFileExternally?: (options: ExperimentalFileOpenOptions) => boolean;
217
+ /** Host acceptance for an owner-scoped fixed-tab selection. */
218
+ experimental_openFixedTab?: (call: ExperimentalFixedTabOpenCall) => boolean;
219
+ /** Initial session target visible to `experimental_useFixedTabTarget`. */
220
+ experimental_fixedTabTarget?: {
221
+ panelId: string;
222
+ tabId: string;
223
+ target: JsonValue;
224
+ };
194
225
  }
195
226
  /** Host-originated inputs a slot test can drive deterministically. */
196
227
  interface RenderedSlotBehaviorDrivers {
@@ -212,6 +243,8 @@ interface RenderedSlotInspectionState {
212
243
  readonly rpcCalls: RpcCall[];
213
244
  /** Every `useBbNavigate()` call, in order. */
214
245
  readonly navigateCalls: NavigateCall[];
246
+ /** Every validated `experimental_useAppPanel().openFixedTab` call. */
247
+ readonly experimental_fixedTabOpenCalls: ExperimentalFixedTabOpenCall[];
215
248
  /** Every `experimental_useSidebarThreadActions()` call, in order. */
216
249
  readonly sidebarActionCalls: SidebarActionCall[];
217
250
  /** Everything written through `useComposer()`. */
@@ -236,4 +269,4 @@ declare function renderSlot<Props extends object, Contract extends PluginRpcCont
236
269
  }, props: Props, options?: RenderSlotOptions<Contract>): RenderedSlot;
237
270
 
238
271
  export { installTestPluginRuntime, loadPluginApp, mountPluginContentScripts, renderSlot };
239
- export type { CapturedPluginApp, ComposerLog, ContentScriptTestMountOptions, ContentScriptThreadRowStatusCall, MountedPluginContentScripts, NavigateCall, PluginAppSource, PluginRpcTestHandlers, RenderSlotOptions, RenderedSlot, RenderedSlotBehaviorDrivers, RenderedSlotInspectionState, RenderedSlotLifecycleControls, RpcCall, SidebarActionCall };
272
+ export type { CapturedPluginApp, ComposerLog, ContentScriptTestMountOptions, ContentScriptThreadRowStatusCall, ExperimentalFixedTabOpenCall, MountedPluginContentScripts, NavigateCall, PluginAppSource, PluginRpcTestHandlers, RenderSlotOptions, RenderedSlot, RenderedSlotBehaviorDrivers, RenderedSlotInspectionState, RenderedSlotLifecycleControls, RpcCall, SidebarActionCall };