@get-bb/plugin-sdk 0.6.68 → 0.6.75
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/README.md +2 -2
- package/bundled-types/bb-plugin-sdk-app.d.ts +1138 -348
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +31 -4
- package/bundled-types/bb-plugin-sdk-internal-rpc-query-host.d.ts +6 -1
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +40 -11
- package/bundled-types/bb-plugin-sdk-testing.d.ts +1 -0
- package/bundled-types/bb-plugin-sdk.d.ts +6425 -5651
- package/dist/app.js +103 -4
- package/dist/index.js +21 -0
- package/dist/internal/composer-handle.js +1 -1
- package/dist/internal/plugin-app-collector.js +188 -63
- package/dist/internal/rpc-query-host.js +1169 -27
- package/dist/testing/app.js +1717 -185
- package/dist/testing/index.js +14 -0
- package/package.json +1 -1
package/dist/app.js
CHANGED
|
@@ -88,6 +88,24 @@ var experimental_THREAD_ACTION_GROUPS = {
|
|
|
88
88
|
lifecycle: "4_lifecycle"
|
|
89
89
|
};
|
|
90
90
|
|
|
91
|
+
// src/thread-info-groups.ts
|
|
92
|
+
var experimental_THREAD_CONTEXT_SEGMENT_GROUPS = {
|
|
93
|
+
thread: "1_thread",
|
|
94
|
+
git: "3_git"
|
|
95
|
+
};
|
|
96
|
+
var experimental_THREAD_INFO_ROW_GROUPS = {
|
|
97
|
+
thread: "1_thread",
|
|
98
|
+
environment: "2_environment",
|
|
99
|
+
git: "3_git",
|
|
100
|
+
pullRequest: "4_pullRequest",
|
|
101
|
+
lifecycle: "5_lifecycle"
|
|
102
|
+
};
|
|
103
|
+
var experimental_THREAD_INFO_SECTION_GROUPS = {
|
|
104
|
+
related: "1_related",
|
|
105
|
+
changes: "2_changes",
|
|
106
|
+
storage: "3_storage"
|
|
107
|
+
};
|
|
108
|
+
|
|
91
109
|
// src/app.ts
|
|
92
110
|
function runtimeHost() {
|
|
93
111
|
return globalThis.__bbPluginRuntime;
|
|
@@ -162,6 +180,16 @@ var experimental_SourceCode = runtimeComponent(
|
|
|
162
180
|
"experimental_SourceCode"
|
|
163
181
|
);
|
|
164
182
|
var experimental_Diff = runtimeComponent("experimental_Diff");
|
|
183
|
+
var experimental_InfoSection = runtimeComponent(
|
|
184
|
+
"experimental_InfoSection"
|
|
185
|
+
);
|
|
186
|
+
var experimental_DetailRow = runtimeComponent(
|
|
187
|
+
"experimental_DetailRow"
|
|
188
|
+
);
|
|
189
|
+
var experimental_InfoList = runtimeComponent("experimental_InfoList");
|
|
190
|
+
var experimental_InfoListRow = runtimeComponent(
|
|
191
|
+
"experimental_InfoListRow"
|
|
192
|
+
);
|
|
165
193
|
var experimental_useRpcQuery = runtimeFunction(
|
|
166
194
|
"experimental_useRpcQuery"
|
|
167
195
|
);
|
|
@@ -196,6 +224,57 @@ var experimental_useFixedTabTarget = runtimeFunction(
|
|
|
196
224
|
);
|
|
197
225
|
var useComposer = runtimeFunction("useComposer");
|
|
198
226
|
var useComposers = runtimeFunction("useComposers");
|
|
227
|
+
var experimental_useComposerRenderer = runtimeFunction(
|
|
228
|
+
"experimental_useComposerRenderer"
|
|
229
|
+
);
|
|
230
|
+
var experimental_useThreadTitleDisplayText = runtimeFunction(
|
|
231
|
+
"experimental_useThreadTitleDisplayText"
|
|
232
|
+
);
|
|
233
|
+
var experimental_useComposerContributions = runtimeFunction(
|
|
234
|
+
"experimental_useComposerContributions"
|
|
235
|
+
);
|
|
236
|
+
var experimental_useComposerMentionSearch = runtimeFunction(
|
|
237
|
+
"experimental_useComposerMentionSearch"
|
|
238
|
+
);
|
|
239
|
+
var experimental_useComposerCommandSearch = runtimeFunction(
|
|
240
|
+
"experimental_useComposerCommandSearch"
|
|
241
|
+
);
|
|
242
|
+
var experimental_ComposerRoot = runtimeComponent(
|
|
243
|
+
"experimental_ComposerRoot"
|
|
244
|
+
);
|
|
245
|
+
var experimental_VoiceInputButton = runtimeComponent(
|
|
246
|
+
"experimental_VoiceInputButton"
|
|
247
|
+
);
|
|
248
|
+
var experimental_VoiceRecordingBar = runtimeComponent(
|
|
249
|
+
"experimental_VoiceRecordingBar"
|
|
250
|
+
);
|
|
251
|
+
var experimental_FailedVoiceRecordings = runtimeComponent(
|
|
252
|
+
"experimental_FailedVoiceRecordings"
|
|
253
|
+
);
|
|
254
|
+
var experimental_ShortcutHint = runtimeComponent(
|
|
255
|
+
"experimental_ShortcutHint"
|
|
256
|
+
);
|
|
257
|
+
var experimental_ImageLightbox = runtimeComponent(
|
|
258
|
+
"experimental_ImageLightbox"
|
|
259
|
+
);
|
|
260
|
+
var experimental_PromptMentionIcon = runtimeComponent(
|
|
261
|
+
"experimental_PromptMentionIcon"
|
|
262
|
+
);
|
|
263
|
+
var experimental_describePromptMention = runtimeFunction(
|
|
264
|
+
"experimental_describePromptMention"
|
|
265
|
+
);
|
|
266
|
+
var experimental_promptMentionClipboardAttributes = runtimeFunction(
|
|
267
|
+
"experimental_promptMentionClipboardAttributes"
|
|
268
|
+
);
|
|
269
|
+
var experimental_readPromptMentionClipboard = runtimeFunction(
|
|
270
|
+
"experimental_readPromptMentionClipboard"
|
|
271
|
+
);
|
|
272
|
+
var experimental_PluginIcon = runtimeComponent(
|
|
273
|
+
"experimental_PluginIcon"
|
|
274
|
+
);
|
|
275
|
+
var experimental_ThreadTitleText = runtimeComponent(
|
|
276
|
+
"experimental_ThreadTitleText"
|
|
277
|
+
);
|
|
199
278
|
var useComposerView = runtimeFunction("useComposerView");
|
|
200
279
|
var experimental_useSidebarThreads = runtimeFunction(
|
|
201
280
|
"experimental_useSidebarThreads"
|
|
@@ -218,9 +297,6 @@ var experimental_ThreadActionsMenu = runtimeComponent(
|
|
|
218
297
|
var experimental_ThreadActionsContextMenu = runtimeComponent(
|
|
219
298
|
"experimental_ThreadActionsContextMenu"
|
|
220
299
|
);
|
|
221
|
-
var experimental_useSidebarThreadPullRequest = runtimeFunction(
|
|
222
|
-
"experimental_useSidebarThreadPullRequest"
|
|
223
|
-
);
|
|
224
300
|
var experimental_useSidebarThreadSplit = runtimeFunction(
|
|
225
301
|
"experimental_useSidebarThreadSplit"
|
|
226
302
|
);
|
|
@@ -272,28 +348,51 @@ export {
|
|
|
272
348
|
UrlLink,
|
|
273
349
|
definePluginApp,
|
|
274
350
|
experimental_BranchPicker,
|
|
351
|
+
experimental_ComposerRoot,
|
|
352
|
+
experimental_DetailRow,
|
|
275
353
|
experimental_Diff,
|
|
354
|
+
experimental_FailedVoiceRecordings,
|
|
276
355
|
experimental_FileLink,
|
|
277
356
|
experimental_Icon,
|
|
357
|
+
experimental_ImageLightbox,
|
|
358
|
+
experimental_InfoList,
|
|
359
|
+
experimental_InfoListRow,
|
|
360
|
+
experimental_InfoSection,
|
|
278
361
|
experimental_NewThreadComposer,
|
|
279
362
|
experimental_PermissionModePicker,
|
|
363
|
+
experimental_PluginIcon,
|
|
280
364
|
experimental_PluginRpcCallError,
|
|
365
|
+
experimental_PromptMentionIcon,
|
|
281
366
|
experimental_ProviderIcon,
|
|
282
367
|
experimental_ProviderModelPicker,
|
|
368
|
+
experimental_ShortcutHint,
|
|
283
369
|
experimental_SidebarNavigationIcon,
|
|
284
370
|
experimental_SourceCode,
|
|
285
371
|
experimental_THREAD_ACTION_GROUPS,
|
|
372
|
+
experimental_THREAD_CONTEXT_SEGMENT_GROUPS,
|
|
373
|
+
experimental_THREAD_INFO_ROW_GROUPS,
|
|
374
|
+
experimental_THREAD_INFO_SECTION_GROUPS,
|
|
286
375
|
experimental_ThreadActionsContextMenu,
|
|
287
376
|
experimental_ThreadActionsMenu,
|
|
288
377
|
experimental_ThreadStatusGlyph,
|
|
378
|
+
experimental_ThreadTitleText,
|
|
379
|
+
experimental_VoiceInputButton,
|
|
289
380
|
experimental_VoiceInputTextarea,
|
|
381
|
+
experimental_VoiceRecordingBar,
|
|
290
382
|
experimental_copyToClipboard,
|
|
383
|
+
experimental_describePromptMention,
|
|
384
|
+
experimental_promptMentionClipboardAttributes,
|
|
385
|
+
experimental_readPromptMentionClipboard,
|
|
291
386
|
experimental_saveFile,
|
|
292
387
|
experimental_useAppPanel,
|
|
293
388
|
experimental_useArchiveEnvironmentThreads,
|
|
294
389
|
experimental_useBranches,
|
|
295
390
|
experimental_useCheckoutState,
|
|
296
391
|
experimental_useCodeTheme,
|
|
392
|
+
experimental_useComposerCommandSearch,
|
|
393
|
+
experimental_useComposerContributions,
|
|
394
|
+
experimental_useComposerMentionSearch,
|
|
395
|
+
experimental_useComposerRenderer,
|
|
297
396
|
experimental_useFixedTabTarget,
|
|
298
397
|
experimental_usePluginId,
|
|
299
398
|
experimental_useProviders,
|
|
@@ -305,11 +404,11 @@ export {
|
|
|
305
404
|
experimental_useSidebarNavigation,
|
|
306
405
|
experimental_useSidebarNavigationSplit,
|
|
307
406
|
experimental_useSidebarThreadActions,
|
|
308
|
-
experimental_useSidebarThreadPullRequest,
|
|
309
407
|
experimental_useSidebarThreadSplit,
|
|
310
408
|
experimental_useSidebarThreads,
|
|
311
409
|
experimental_useThreadActionRegistrations,
|
|
312
410
|
experimental_useThreadActions,
|
|
411
|
+
experimental_useThreadTitleDisplayText,
|
|
313
412
|
useBbContext,
|
|
314
413
|
useBbNavigate,
|
|
315
414
|
useComposer,
|
package/dist/index.js
CHANGED
|
@@ -900,6 +900,24 @@ var experimental_THREAD_ACTION_GROUPS = {
|
|
|
900
900
|
settings: "3_settings",
|
|
901
901
|
lifecycle: "4_lifecycle"
|
|
902
902
|
};
|
|
903
|
+
|
|
904
|
+
// src/thread-info-groups.ts
|
|
905
|
+
var experimental_THREAD_CONTEXT_SEGMENT_GROUPS = {
|
|
906
|
+
thread: "1_thread",
|
|
907
|
+
git: "3_git"
|
|
908
|
+
};
|
|
909
|
+
var experimental_THREAD_INFO_ROW_GROUPS = {
|
|
910
|
+
thread: "1_thread",
|
|
911
|
+
environment: "2_environment",
|
|
912
|
+
git: "3_git",
|
|
913
|
+
pullRequest: "4_pullRequest",
|
|
914
|
+
lifecycle: "5_lifecycle"
|
|
915
|
+
};
|
|
916
|
+
var experimental_THREAD_INFO_SECTION_GROUPS = {
|
|
917
|
+
related: "1_related",
|
|
918
|
+
changes: "2_changes",
|
|
919
|
+
storage: "3_storage"
|
|
920
|
+
};
|
|
903
921
|
export {
|
|
904
922
|
PLUGIN_CLI_OUTPUT_MAX_BYTES,
|
|
905
923
|
PluginCliError,
|
|
@@ -909,5 +927,8 @@ export {
|
|
|
909
927
|
experimental_PluginRpcCallError,
|
|
910
928
|
experimental_PluginRpcRefusal,
|
|
911
929
|
experimental_THREAD_ACTION_GROUPS,
|
|
930
|
+
experimental_THREAD_CONTEXT_SEGMENT_GROUPS,
|
|
931
|
+
experimental_THREAD_INFO_ROW_GROUPS,
|
|
932
|
+
experimental_THREAD_INFO_SECTION_GROUPS,
|
|
912
933
|
experimental_defineHostEntry
|
|
913
934
|
};
|
|
@@ -371,7 +371,7 @@ function createComposerHandleBinding(key, initial) {
|
|
|
371
371
|
throw new Error("Pick a time in the future.");
|
|
372
372
|
}
|
|
373
373
|
const errorBefore = editorState().attachmentError;
|
|
374
|
-
await waitForUploads(target());
|
|
374
|
+
if (editorState().isAttaching) await waitForUploads(target());
|
|
375
375
|
const state = editorState();
|
|
376
376
|
if (state.attachmentError !== null && state.attachmentError !== errorBefore) {
|
|
377
377
|
throw new Error(state.attachmentError);
|
|
@@ -437,6 +437,13 @@ function createCommandShortcutSchema() {
|
|
|
437
437
|
"Use Command, Control, or Alt with a key, or a function key"
|
|
438
438
|
);
|
|
439
439
|
}
|
|
440
|
+
function requireOptionalOrder(kind, order) {
|
|
441
|
+
if (order === void 0) return {};
|
|
442
|
+
if (!Number.isFinite(order)) {
|
|
443
|
+
throw new Error(`${kind}: "order" must be a finite number`);
|
|
444
|
+
}
|
|
445
|
+
return { order };
|
|
446
|
+
}
|
|
440
447
|
function collectTitledComponent(kind, seen, registration) {
|
|
441
448
|
const id = requireSlotId(kind, registration?.id);
|
|
442
449
|
requireUniqueId(kind, seen, id);
|
|
@@ -478,7 +485,12 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
478
485
|
settingsSections: [],
|
|
479
486
|
appOverlays: [],
|
|
480
487
|
navPanels: [],
|
|
481
|
-
|
|
488
|
+
tabs: [],
|
|
489
|
+
get threadPanelActions() {
|
|
490
|
+
return this.tabs.filter(
|
|
491
|
+
(tab) => tab.context.kind === "thread" && tab.availability === "action"
|
|
492
|
+
);
|
|
493
|
+
},
|
|
482
494
|
newThreadPanelActions: [],
|
|
483
495
|
composerCustomizations: [],
|
|
484
496
|
pendingInteractions: [],
|
|
@@ -487,11 +499,15 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
487
499
|
threadLists: [],
|
|
488
500
|
experimentalSidebarNavigations: [],
|
|
489
501
|
threadHeaderActions: [],
|
|
502
|
+
threadContextSegments: [],
|
|
503
|
+
threadInfoRows: [],
|
|
504
|
+
threadInfoSections: [],
|
|
490
505
|
threadActions: [],
|
|
491
506
|
browserToolbarActions: [],
|
|
492
507
|
fileOpeners: [],
|
|
493
508
|
sourceCodeRenderers: [],
|
|
494
509
|
diffRenderers: [],
|
|
510
|
+
composers: [],
|
|
495
511
|
messageDirectives: [],
|
|
496
512
|
codeFenceRenderers: [],
|
|
497
513
|
messageActions: [],
|
|
@@ -509,7 +525,7 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
509
525
|
settingsSection: /* @__PURE__ */ new Set(),
|
|
510
526
|
appOverlay: /* @__PURE__ */ new Set(),
|
|
511
527
|
navPanel: /* @__PURE__ */ new Set(),
|
|
512
|
-
|
|
528
|
+
tab: /* @__PURE__ */ new Set(),
|
|
513
529
|
newThreadPanelAction: /* @__PURE__ */ new Set(),
|
|
514
530
|
composerCustomization: /* @__PURE__ */ new Set(),
|
|
515
531
|
composerPopup: /* @__PURE__ */ new Set(),
|
|
@@ -519,11 +535,15 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
519
535
|
sidebarNavigation: /* @__PURE__ */ new Set(),
|
|
520
536
|
sidebarHeader: /* @__PURE__ */ new Set(),
|
|
521
537
|
threadHeaderAction: /* @__PURE__ */ new Set(),
|
|
538
|
+
threadContextSegment: /* @__PURE__ */ new Set(),
|
|
539
|
+
threadInfoRow: /* @__PURE__ */ new Set(),
|
|
540
|
+
threadInfoSection: /* @__PURE__ */ new Set(),
|
|
522
541
|
threadAction: /* @__PURE__ */ new Set(),
|
|
523
542
|
browserToolbarAction: /* @__PURE__ */ new Set(),
|
|
524
543
|
fileOpener: /* @__PURE__ */ new Set(),
|
|
525
544
|
sourceCodeRenderer: /* @__PURE__ */ new Set(),
|
|
526
545
|
diffRenderer: /* @__PURE__ */ new Set(),
|
|
546
|
+
composer: /* @__PURE__ */ new Set(),
|
|
527
547
|
messageDirective: /* @__PURE__ */ new Set(),
|
|
528
548
|
codeFenceRenderer: /* @__PURE__ */ new Set(),
|
|
529
549
|
codeFenceLanguage: /* @__PURE__ */ new Set(),
|
|
@@ -535,6 +555,54 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
535
555
|
machineProviderInputs: /* @__PURE__ */ new Set(),
|
|
536
556
|
contentScript: /* @__PURE__ */ new Set()
|
|
537
557
|
};
|
|
558
|
+
function collectTab(value, legacy = false) {
|
|
559
|
+
const registration = value;
|
|
560
|
+
const kind = "slots.experimental_tab";
|
|
561
|
+
const id = requireSlotId(kind, registration?.id);
|
|
562
|
+
const context = registration.context;
|
|
563
|
+
if (context?.kind !== "thread" && context?.kind !== "nav-panel") {
|
|
564
|
+
throw new Error(`${kind}: context must be thread or nav-panel`);
|
|
565
|
+
}
|
|
566
|
+
if (context.kind === "nav-panel") requireSlotId(kind, context.panelId);
|
|
567
|
+
const availability = registration.availability;
|
|
568
|
+
if (availability !== "fixed" && availability !== "action") {
|
|
569
|
+
throw new Error(`${kind}: availability must be fixed or action`);
|
|
570
|
+
}
|
|
571
|
+
requireUniqueId(
|
|
572
|
+
kind,
|
|
573
|
+
seenIds.tab,
|
|
574
|
+
`${context.kind}/${context.kind === "nav-panel" ? context.panelId : ""}/${id}`
|
|
575
|
+
);
|
|
576
|
+
if (registration.useVisible !== void 0 && typeof registration.useVisible !== "function") {
|
|
577
|
+
throw new Error(`${kind}: useVisible must be a function`);
|
|
578
|
+
}
|
|
579
|
+
if (availability === "fixed" && (registration.run !== void 0 || registration.params !== void 0)) {
|
|
580
|
+
throw new Error(`${kind}: run and params require action availability`);
|
|
581
|
+
}
|
|
582
|
+
const target = registration.experimental_target;
|
|
583
|
+
if (target !== void 0 && (context.kind !== "nav-panel" || availability !== "fixed" || typeof target?.validate !== "function")) {
|
|
584
|
+
throw new Error(
|
|
585
|
+
`${kind}: experimental_target requires a nav-panel fixed tab and a validate function`
|
|
586
|
+
);
|
|
587
|
+
}
|
|
588
|
+
const validated = {
|
|
589
|
+
...registration,
|
|
590
|
+
...collectPanelAction(kind, /* @__PURE__ */ new Set(), {
|
|
591
|
+
...registration,
|
|
592
|
+
icon: legacy && registration.icon === "" ? void 0 : registration.icon
|
|
593
|
+
}),
|
|
594
|
+
icon: legacy && registration.icon === "" ? "" : requireNonEmptyString(kind, "icon", registration.icon),
|
|
595
|
+
...registration.tooltip === void 0 ? {} : {
|
|
596
|
+
tooltip: requireNonEmptyString(
|
|
597
|
+
kind,
|
|
598
|
+
"tooltip",
|
|
599
|
+
registration.tooltip
|
|
600
|
+
)
|
|
601
|
+
},
|
|
602
|
+
...availability === "action" && registration.params !== void 0 ? { params: z.json().parse(registration.params) } : {}
|
|
603
|
+
};
|
|
604
|
+
collected.tabs.push(validated);
|
|
605
|
+
}
|
|
538
606
|
function collectCommand(kind, registration) {
|
|
539
607
|
const id = requireSlotId(kind, registration?.id);
|
|
540
608
|
requireUniqueId(kind, seenIds.command, id);
|
|
@@ -569,6 +637,26 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
569
637
|
}
|
|
570
638
|
const legacySidebarHeaders = [];
|
|
571
639
|
const legacySlotAliases = {
|
|
640
|
+
threadPanelAction(registration) {
|
|
641
|
+
try {
|
|
642
|
+
const action = collectPanelAction(
|
|
643
|
+
"slots.threadPanelAction",
|
|
644
|
+
/* @__PURE__ */ new Set(),
|
|
645
|
+
registration
|
|
646
|
+
);
|
|
647
|
+
collectTab(
|
|
648
|
+
{
|
|
649
|
+
...action,
|
|
650
|
+
icon: action.icon ?? "",
|
|
651
|
+
context: { kind: "thread" },
|
|
652
|
+
availability: "action"
|
|
653
|
+
},
|
|
654
|
+
true
|
|
655
|
+
);
|
|
656
|
+
} catch (error) {
|
|
657
|
+
onWarning(`Legacy threadPanelAction ignored: ${String(error)}`);
|
|
658
|
+
}
|
|
659
|
+
},
|
|
572
660
|
experimental_sidebarHeader(registration) {
|
|
573
661
|
legacySidebarHeaders.push(
|
|
574
662
|
collectTitledComponent(
|
|
@@ -656,63 +744,45 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
656
744
|
`${kind}: "experimental_usePageTitle" must be a React hook function when set`
|
|
657
745
|
);
|
|
658
746
|
}
|
|
659
|
-
const
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
const
|
|
667
|
-
const
|
|
668
|
-
const id2 = requireSlotId(fixedTabKind, fixedTab?.id);
|
|
669
|
-
requireUniqueId(fixedTabKind, seenFixedTabIds, id2);
|
|
670
|
-
const layout = fixedTab?.layout;
|
|
671
|
-
if (layout !== void 0 && layout !== "padded" && layout !== "flush") {
|
|
672
|
-
throw new Error(
|
|
673
|
-
`${fixedTabKind}: "layout" must be "padded" or "flush" when set`
|
|
674
|
-
);
|
|
675
|
-
}
|
|
676
|
-
const fixedTabPanelId = requireNonEmptyString(
|
|
677
|
-
fixedTabKind,
|
|
678
|
-
"panelId",
|
|
679
|
-
fixedTab?.panelId
|
|
680
|
-
);
|
|
681
|
-
if (fixedTabPanelId !== panelId) {
|
|
682
|
-
throw new Error(
|
|
683
|
-
`${fixedTabKind}: "panelId" must match its containing navPanel id ${JSON.stringify(panelId)}`
|
|
684
|
-
);
|
|
685
|
-
}
|
|
686
|
-
const experimentalTarget = fixedTab?.experimental_target;
|
|
687
|
-
if (experimentalTarget !== void 0 && (typeof experimentalTarget !== "object" || experimentalTarget === null || typeof Reflect.get(experimentalTarget, "validate") !== "function")) {
|
|
688
|
-
throw new Error(
|
|
689
|
-
`${fixedTabKind}: "experimental_target.validate" must be a function when set`
|
|
690
|
-
);
|
|
691
|
-
}
|
|
692
|
-
return {
|
|
747
|
+
const legacy = registration;
|
|
748
|
+
const fixedTabs = [];
|
|
749
|
+
if (legacy.fixedTabs !== void 0 && !Array.isArray(legacy.fixedTabs)) {
|
|
750
|
+
onWarning("Legacy navPanel.fixedTabs ignored: expected an array");
|
|
751
|
+
}
|
|
752
|
+
for (const value of Array.isArray(legacy.fixedTabs) ? legacy.fixedTabs : []) {
|
|
753
|
+
try {
|
|
754
|
+
const id2 = requireSlotId(kind, value?.id);
|
|
755
|
+
const tab = {
|
|
693
756
|
id: id2,
|
|
694
|
-
panelId
|
|
695
|
-
title: requireNonEmptyString(
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
icon: requireNonEmptyString(fixedTabKind, "icon", fixedTab?.icon),
|
|
701
|
-
component: requireComponent(fixedTabKind, fixedTab?.component),
|
|
702
|
-
...layout === void 0 ? {} : { layout },
|
|
703
|
-
...experimentalTarget === void 0 ? {} : {
|
|
704
|
-
experimental_target: experimentalTarget
|
|
705
|
-
}
|
|
757
|
+
panelId,
|
|
758
|
+
title: requireNonEmptyString(kind, "title", value.title ?? id2),
|
|
759
|
+
icon: typeof value.icon === "string" ? value.icon : "",
|
|
760
|
+
component: requireComponent(kind, value.component),
|
|
761
|
+
...value.layout === "flush" ? { layout: "flush" } : {},
|
|
762
|
+
...typeof value.experimental_target?.validate === "function" ? { experimental_target: value.experimental_target } : {}
|
|
706
763
|
};
|
|
707
|
-
|
|
708
|
-
|
|
764
|
+
collectTab(
|
|
765
|
+
{
|
|
766
|
+
...tab,
|
|
767
|
+
context: { kind: "nav-panel", panelId },
|
|
768
|
+
availability: "fixed"
|
|
769
|
+
},
|
|
770
|
+
true
|
|
771
|
+
);
|
|
772
|
+
fixedTabs.push(tab);
|
|
773
|
+
} catch (error) {
|
|
774
|
+
onWarning(
|
|
775
|
+
`Legacy navPanel.fixedTabs entry ignored: ${String(error)}`
|
|
776
|
+
);
|
|
777
|
+
}
|
|
778
|
+
}
|
|
709
779
|
collected.navPanels.push({
|
|
710
780
|
id,
|
|
711
781
|
title: requireNonEmptyString(kind, "title", registration.title),
|
|
712
782
|
icon: requireNonEmptyString(kind, "icon", registration.icon),
|
|
713
783
|
path,
|
|
784
|
+
...fixedTabs.length === 0 ? {} : { fixedTabs },
|
|
714
785
|
component: requireComponent(kind, registration.component),
|
|
715
|
-
...fixedTabs.length > 0 ? { fixedTabs } : {},
|
|
716
786
|
...registration.experimental_useBadge !== void 0 ? {
|
|
717
787
|
experimental_useBadge: registration.experimental_useBadge
|
|
718
788
|
} : {},
|
|
@@ -723,14 +793,8 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
723
793
|
...registration.headerContent !== void 0 ? { headerContent: registration.headerContent } : {}
|
|
724
794
|
});
|
|
725
795
|
},
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
collectPanelAction(
|
|
729
|
-
"slots.threadPanelAction",
|
|
730
|
-
seenIds.threadPanelAction,
|
|
731
|
-
registration
|
|
732
|
-
)
|
|
733
|
-
);
|
|
796
|
+
experimental_tab(registration) {
|
|
797
|
+
collectTab(registration);
|
|
734
798
|
},
|
|
735
799
|
experimental_newThreadPanelAction(registration) {
|
|
736
800
|
collected.newThreadPanelActions.push(
|
|
@@ -808,6 +872,61 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
808
872
|
component: requireComponent(kind, registration.component)
|
|
809
873
|
});
|
|
810
874
|
},
|
|
875
|
+
experimental_threadContextSegment(registration) {
|
|
876
|
+
const kind = "slots.experimental_threadContextSegment";
|
|
877
|
+
const id = requireSlotId(kind, registration?.id);
|
|
878
|
+
requireUniqueId(kind, seenIds.threadContextSegment, id);
|
|
879
|
+
const optionalComponent = (field) => {
|
|
880
|
+
const value = registration[field];
|
|
881
|
+
if (value === void 0) return {};
|
|
882
|
+
if (typeof value !== "function") {
|
|
883
|
+
throw new Error(
|
|
884
|
+
`${kind}: "${field}" must be a React component function`
|
|
885
|
+
);
|
|
886
|
+
}
|
|
887
|
+
return { [field]: value };
|
|
888
|
+
};
|
|
889
|
+
if (typeof registration.summary !== "function") {
|
|
890
|
+
throw new Error(
|
|
891
|
+
`${kind}: "summary" must be a React component function`
|
|
892
|
+
);
|
|
893
|
+
}
|
|
894
|
+
if (registration.useVisible !== void 0 && typeof registration.useVisible !== "function") {
|
|
895
|
+
throw new Error(`${kind}: "useVisible" must be a function`);
|
|
896
|
+
}
|
|
897
|
+
collected.threadContextSegments.push({
|
|
898
|
+
id,
|
|
899
|
+
title: requireNonEmptyString(kind, "title", registration.title),
|
|
900
|
+
group: requireNonEmptyString(kind, "group", registration.group),
|
|
901
|
+
...requireOptionalOrder(kind, registration.order),
|
|
902
|
+
summary: registration.summary,
|
|
903
|
+
...optionalComponent("action"),
|
|
904
|
+
...optionalComponent("details"),
|
|
905
|
+
...registration.useVisible !== void 0 ? { useVisible: registration.useVisible } : {}
|
|
906
|
+
});
|
|
907
|
+
},
|
|
908
|
+
experimental_threadInfoRow(registration) {
|
|
909
|
+
const kind = "slots.experimental_threadInfoRow";
|
|
910
|
+
const id = requireSlotId(kind, registration?.id);
|
|
911
|
+
requireUniqueId(kind, seenIds.threadInfoRow, id);
|
|
912
|
+
collected.threadInfoRows.push({
|
|
913
|
+
id,
|
|
914
|
+
group: requireNonEmptyString(kind, "group", registration.group),
|
|
915
|
+
...requireOptionalOrder(kind, registration.order),
|
|
916
|
+
component: requireComponent(kind, registration.component)
|
|
917
|
+
});
|
|
918
|
+
},
|
|
919
|
+
experimental_threadInfoSection(registration) {
|
|
920
|
+
const kind = "slots.experimental_threadInfoSection";
|
|
921
|
+
const id = requireSlotId(kind, registration?.id);
|
|
922
|
+
requireUniqueId(kind, seenIds.threadInfoSection, id);
|
|
923
|
+
collected.threadInfoSections.push({
|
|
924
|
+
id,
|
|
925
|
+
group: requireNonEmptyString(kind, "group", registration.group),
|
|
926
|
+
...requireOptionalOrder(kind, registration.order),
|
|
927
|
+
component: requireComponent(kind, registration.component)
|
|
928
|
+
});
|
|
929
|
+
},
|
|
811
930
|
experimental_threadAction(registration) {
|
|
812
931
|
const kind = "slots.experimental_threadAction";
|
|
813
932
|
const id = requireSlotId(kind, registration?.id);
|
|
@@ -818,15 +937,12 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
818
937
|
if (registration.useData !== void 0 && typeof registration.useData !== "function") {
|
|
819
938
|
throw new Error(`${kind}: "useData" must be a function`);
|
|
820
939
|
}
|
|
821
|
-
if (registration.order !== void 0 && !Number.isFinite(registration.order)) {
|
|
822
|
-
throw new Error(`${kind}: "order" must be a finite number`);
|
|
823
|
-
}
|
|
824
940
|
collected.threadActions.push({
|
|
825
941
|
id,
|
|
826
942
|
title: requireNonEmptyString(kind, "title", registration.title),
|
|
827
943
|
icon: requireNonEmptyString(kind, "icon", registration.icon),
|
|
828
944
|
group: requireNonEmptyString(kind, "group", registration.group),
|
|
829
|
-
...
|
|
945
|
+
...requireOptionalOrder(kind, registration.order),
|
|
830
946
|
...registration.useData !== void 0 ? { useData: registration.useData } : {},
|
|
831
947
|
item: registration.item
|
|
832
948
|
});
|
|
@@ -884,6 +1000,15 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
|
|
|
884
1000
|
)
|
|
885
1001
|
);
|
|
886
1002
|
},
|
|
1003
|
+
experimental_composer(registration) {
|
|
1004
|
+
collected.composers.push(
|
|
1005
|
+
collectTitledComponent(
|
|
1006
|
+
"slots.experimental_composer",
|
|
1007
|
+
seenIds.composer,
|
|
1008
|
+
registration
|
|
1009
|
+
)
|
|
1010
|
+
);
|
|
1011
|
+
},
|
|
887
1012
|
messageDirective(registration) {
|
|
888
1013
|
const kind = "slots.messageDirective";
|
|
889
1014
|
const id = requireMessageDirectiveId(kind, registration?.id);
|