@petrarca/sonnet-shell 0.7.0 → 0.9.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/README.md +2 -1
- package/dist/auth/index.d.ts +2 -1
- package/dist/index.d.ts +235 -22
- package/dist/index.js +562 -235
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -7,7 +7,8 @@ command menu and a set of surfaces any module can reach imperatively.
|
|
|
7
7
|
## What it provides
|
|
8
8
|
|
|
9
9
|
**A module system.** A `ShellModule` declares its routes, navigation, command
|
|
10
|
-
menu entries, side pane and contributions to other modules
|
|
10
|
+
menu entries, side pane and contributions to other modules -- links, routed
|
|
11
|
+
pages, and components another module renders with its own props.
|
|
11
12
|
`createModuleRegistry` aggregates them and derives the navigation zones and the
|
|
12
13
|
flattened route list once.
|
|
13
14
|
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -168,4 +168,5 @@ interface ProtectedRouteProps {
|
|
|
168
168
|
}
|
|
169
169
|
declare function ProtectedRoute({ children, authEnabled, authConfigLoading, isAuthenticated, accessToken, activeTenantId, initializeAuth, requiresOrgSelection, }: ProtectedRouteProps): React.ReactElement;
|
|
170
170
|
|
|
171
|
-
export {
|
|
171
|
+
export { Login, OrgSelection, ProtectedRoute };
|
|
172
|
+
export type { AuthConfig, LoginProps, LoginProvider, OrgOption, ProtectedRouteProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as React from 'react';
|
|
3
|
-
import React__default, { ReactNode } from 'react';
|
|
2
|
+
import React__default, { ReactNode, ComponentType } from 'react';
|
|
4
3
|
import { RouteObject } from 'react-router-dom';
|
|
5
4
|
import { LucideIcon } from 'lucide-react';
|
|
6
5
|
|
|
@@ -98,12 +97,38 @@ interface Contribution {
|
|
|
98
97
|
extensionPoint: string;
|
|
99
98
|
/** Display label for the contributed item */
|
|
100
99
|
label: string;
|
|
101
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* Route path (can include params like :orgId, filled by the host with
|
|
102
|
+
* `contributionPath`). For a contribution with an `element`, the path of its
|
|
103
|
+
* child route, relative to the host route.
|
|
104
|
+
*/
|
|
102
105
|
path: string;
|
|
103
106
|
/** Sort order within the extension point (lower = earlier) */
|
|
104
107
|
order: number;
|
|
105
108
|
/** Optional icon */
|
|
106
109
|
icon?: LucideIcon;
|
|
110
|
+
/**
|
|
111
|
+
* Optional one-line description, for hosts that show their contributions as
|
|
112
|
+
* cards or with an explanation (an overview page, say). Links ignore it.
|
|
113
|
+
*/
|
|
114
|
+
description?: string;
|
|
115
|
+
/**
|
|
116
|
+
* A page this module contributes into another module's page -- a tab, say.
|
|
117
|
+
* It becomes a child route at `path` under the route whose `id` is this
|
|
118
|
+
* contribution's `extensionPoint`, so it renders in that route's `<Outlet>`
|
|
119
|
+
* and reads what the host passes through the outlet context. Without it the
|
|
120
|
+
* contribution is a link only.
|
|
121
|
+
*/
|
|
122
|
+
element?: React__default.ReactNode;
|
|
123
|
+
/**
|
|
124
|
+
* A component this module offers another module to render where it wants --
|
|
125
|
+
* in a pane, a side panel, a dialog -- with the props the extension point
|
|
126
|
+
* defines (callbacks included). Not routed: the host reads it with
|
|
127
|
+
* `useContributedComponent` and renders it; `path` names it among the
|
|
128
|
+
* extension point's contributions. The props type is the contract between
|
|
129
|
+
* the two modules -- define it somewhere both can import.
|
|
130
|
+
*/
|
|
131
|
+
component?: React__default.ComponentType<never>;
|
|
107
132
|
}
|
|
108
133
|
/**
|
|
109
134
|
* Map of known shell event keys to their payload types.
|
|
@@ -161,6 +186,13 @@ interface ShellModule {
|
|
|
161
186
|
topNav?: NavLink[];
|
|
162
187
|
/** Navigation groups for the sub-nav panel and sidebar grouped sections */
|
|
163
188
|
navigation: NavGroup[];
|
|
189
|
+
/**
|
|
190
|
+
* Navigation known only at runtime (e.g. one link per item a server lists),
|
|
191
|
+
* appended after `navigation`. A React hook: it may use queries, and must
|
|
192
|
+
* return a stable array between renders when nothing changed. Other modules
|
|
193
|
+
* plug links in through the `<moduleId>.nav` extension point instead.
|
|
194
|
+
*/
|
|
195
|
+
useNavigation?: () => NavGroup[];
|
|
164
196
|
/** React Router route definitions owned by this module */
|
|
165
197
|
routes: RouteObject[];
|
|
166
198
|
/** Pin to bottom of icon rail (e.g. Settings, Playground) */
|
|
@@ -279,7 +311,11 @@ interface ModuleRegistry {
|
|
|
279
311
|
mainModules: ShellModule[];
|
|
280
312
|
/** Modules pinned to the bottom of the icon rail. */
|
|
281
313
|
bottomModules: ShellModule[];
|
|
282
|
-
/**
|
|
314
|
+
/**
|
|
315
|
+
* All routes from all modules, flattened -- with each contribution that
|
|
316
|
+
* carries an `element` nested as a child of the route whose `id` is its
|
|
317
|
+
* extension point.
|
|
318
|
+
*/
|
|
283
319
|
allRoutes: RouteObject[];
|
|
284
320
|
/** Get contributions for a named extension point, sorted by order. */
|
|
285
321
|
getExtensionPoint: (name: string) => Contribution[];
|
|
@@ -296,7 +332,7 @@ interface AppShellProps {
|
|
|
296
332
|
*/
|
|
297
333
|
sidebar?: React__default.ReactNode;
|
|
298
334
|
}
|
|
299
|
-
declare function AppShell({ registry, sidebar }: AppShellProps):
|
|
335
|
+
declare function AppShell({ registry, sidebar }: AppShellProps): React__default.JSX.Element;
|
|
300
336
|
|
|
301
337
|
interface ShellConfig {
|
|
302
338
|
/**
|
|
@@ -347,7 +383,7 @@ interface RootLayoutProps {
|
|
|
347
383
|
/** Optional custom sidebar replacing the default IconRail + SubNavPanel. */
|
|
348
384
|
sidebar?: React__default.ReactNode;
|
|
349
385
|
}
|
|
350
|
-
declare function RootLayout({ config, registry, sidebar, }: RootLayoutProps):
|
|
386
|
+
declare function RootLayout({ config, registry, sidebar, }: RootLayoutProps): React__default.JSX.Element;
|
|
351
387
|
|
|
352
388
|
/**
|
|
353
389
|
* TopBar -- persistent header across the entire application.
|
|
@@ -359,7 +395,7 @@ declare function RootLayout({ config, registry, sidebar, }: RootLayoutProps): re
|
|
|
359
395
|
interface TopBarProps {
|
|
360
396
|
children?: ReactNode;
|
|
361
397
|
}
|
|
362
|
-
declare function TopBar({ children }: TopBarProps):
|
|
398
|
+
declare function TopBar({ children }: TopBarProps): React.JSX.Element;
|
|
363
399
|
|
|
364
400
|
/**
|
|
365
401
|
* IconRail primitives — composable building blocks for the narrow
|
|
@@ -398,14 +434,14 @@ interface SubNavPanelProps {
|
|
|
398
434
|
collapsed: boolean;
|
|
399
435
|
onToggleCollapse: () => void;
|
|
400
436
|
}
|
|
401
|
-
declare function SubNavPanel(
|
|
437
|
+
declare function SubNavPanel(props: SubNavPanelProps): React.JSX.Element;
|
|
402
438
|
|
|
403
439
|
/**
|
|
404
440
|
* SidePane renders nothing when no pane is open.
|
|
405
441
|
* When open it renders a bordered panel with a drag handle on its right edge.
|
|
406
442
|
* Double-clicking the handle resets to defaultWidth.
|
|
407
443
|
*/
|
|
408
|
-
declare function SidePane():
|
|
444
|
+
declare function SidePane(): React.JSX.Element | null;
|
|
409
445
|
|
|
410
446
|
interface CommandMenuProps {
|
|
411
447
|
open: boolean;
|
|
@@ -417,13 +453,68 @@ interface CommandMenuProps {
|
|
|
417
453
|
* Indexes all navigation items from the service domains so users can
|
|
418
454
|
* quickly jump to any page by typing.
|
|
419
455
|
*/
|
|
420
|
-
declare function CommandMenu({ open, onOpenChange }: CommandMenuProps):
|
|
456
|
+
declare function CommandMenu({ open, onOpenChange }: CommandMenuProps): React__default.JSX.Element;
|
|
421
457
|
|
|
422
458
|
/**
|
|
423
459
|
* PlaceholderPage — generic wireframe page for routes not yet implemented.
|
|
424
460
|
* Shows the current path and a placeholder content area.
|
|
425
461
|
*/
|
|
426
|
-
declare function PlaceholderPage():
|
|
462
|
+
declare function PlaceholderPage(): React.JSX.Element;
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Breadcrumbs -- where a drill-down page sits: module root, then the page's own steps.
|
|
466
|
+
*
|
|
467
|
+
* A page states its drill-down trail (`items`); the shell prepends the active
|
|
468
|
+
* module (its label, linking to its base path), so a page lists only what it
|
|
469
|
+
* drilled into: `Sources > my-source > Origins` is `items` of two plus the
|
|
470
|
+
* module root. Every crumb but the last links back; the last is the current
|
|
471
|
+
* page. Long labels truncate with the full text as a tooltip, and a deep trail
|
|
472
|
+
* collapses its middle into an ellipsis.
|
|
473
|
+
*/
|
|
474
|
+
|
|
475
|
+
/** One step of a trail: a label, and where it leads (omit for the current page). */
|
|
476
|
+
interface BreadcrumbItem {
|
|
477
|
+
label: React__default.ReactNode;
|
|
478
|
+
to?: string;
|
|
479
|
+
}
|
|
480
|
+
interface BreadcrumbsProps {
|
|
481
|
+
/** The page's drill-down steps, after the module root; the last is the current page. */
|
|
482
|
+
items: BreadcrumbItem[];
|
|
483
|
+
/** Leave out the module root (a page outside any module, or one that states it itself). */
|
|
484
|
+
omitModule?: boolean;
|
|
485
|
+
/** Collapse the middle of a longer trail into an ellipsis (first and last two stay). */
|
|
486
|
+
maxItems?: number;
|
|
487
|
+
className?: string;
|
|
488
|
+
}
|
|
489
|
+
/** The trail of a drill-down page, module root first. */
|
|
490
|
+
declare function Breadcrumbs({ items, omitModule, maxItems, className, }: BreadcrumbsProps): React__default.ReactElement;
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* DrillDownHeader -- the header of a drill-down page: trail, title, actions.
|
|
494
|
+
*
|
|
495
|
+
* A detail or drill-down page (an entity, then a facet of it, then a step
|
|
496
|
+
* within that) starts with where it sits (Breadcrumbs), its title -- with an
|
|
497
|
+
* optional adornment beside it, such as a status badge or a copyable id -- the
|
|
498
|
+
* actions that apply to it, and a short subtitle. The actions slot is where
|
|
499
|
+
* operations on the page's subject live as they are added; deeper views are
|
|
500
|
+
* reached by actions here, each with a trail of its own.
|
|
501
|
+
*/
|
|
502
|
+
|
|
503
|
+
interface DrillDownHeaderProps {
|
|
504
|
+
/** The page's drill-down steps after the module root; the last is this page. */
|
|
505
|
+
breadcrumbs: BreadcrumbItem[];
|
|
506
|
+
/** The page title. */
|
|
507
|
+
title: React__default.ReactNode;
|
|
508
|
+
/** Shown beside the title: a status badge, a copyable id. */
|
|
509
|
+
adornment?: React__default.ReactNode;
|
|
510
|
+
/** Operations on the page's subject, right-aligned with the title. */
|
|
511
|
+
actions?: React__default.ReactNode;
|
|
512
|
+
/** A short line under the title: kind, dates. */
|
|
513
|
+
subtitle?: React__default.ReactNode;
|
|
514
|
+
className?: string;
|
|
515
|
+
}
|
|
516
|
+
/** Trail, title row (title, adornment, actions), subtitle. */
|
|
517
|
+
declare function DrillDownHeader({ breadcrumbs, title, adornment, actions, subtitle, className, }: DrillDownHeaderProps): React__default.ReactElement;
|
|
427
518
|
|
|
428
519
|
/**
|
|
429
520
|
* Confirm Dialog
|
|
@@ -453,6 +544,11 @@ interface ConfirmDialogProps {
|
|
|
453
544
|
* "destructive" for irreversible actions (delete, revoke, etc.)
|
|
454
545
|
*/
|
|
455
546
|
variant?: "default" | "destructive";
|
|
547
|
+
/**
|
|
548
|
+
* A text the user must type to confirm (the item's name, for a delete that
|
|
549
|
+
* cascades); Confirm stays disabled until it matches exactly.
|
|
550
|
+
*/
|
|
551
|
+
confirmText?: string;
|
|
456
552
|
/** Callback when user confirms */
|
|
457
553
|
onConfirm: () => void;
|
|
458
554
|
/** Callback when user cancels or closes dialog */
|
|
@@ -463,7 +559,7 @@ interface ConfirmDialogProps {
|
|
|
463
559
|
*
|
|
464
560
|
* A reusable confirmation dialog backed by shadcn Dialog primitives.
|
|
465
561
|
*/
|
|
466
|
-
declare function ConfirmDialog({ open, title, description, confirmLabel, cancelLabel, variant, onConfirm, onCancel, }: ConfirmDialogProps): React__default.ReactElement;
|
|
562
|
+
declare function ConfirmDialog({ open, title, description, confirmLabel, cancelLabel, variant, confirmText, onConfirm, onCancel, }: ConfirmDialogProps): React__default.ReactElement;
|
|
467
563
|
|
|
468
564
|
/**
|
|
469
565
|
* Sidebar — single-column navigation layout.
|
|
@@ -547,7 +643,7 @@ declare function ShellSidebar({ bottomGroupLabel, ...sidebarProps }: ShellSideba
|
|
|
547
643
|
interface ShellFooterProps {
|
|
548
644
|
children?: ReactNode;
|
|
549
645
|
}
|
|
550
|
-
declare function ShellFooter({ children }: ShellFooterProps):
|
|
646
|
+
declare function ShellFooter({ children }: ShellFooterProps): React.JSX.Element;
|
|
551
647
|
|
|
552
648
|
/**
|
|
553
649
|
* ShellVersion — displays the app name and optional version in the footer.
|
|
@@ -568,7 +664,7 @@ interface ShellConfigProviderProps {
|
|
|
568
664
|
config: ShellConfig;
|
|
569
665
|
children: ReactNode;
|
|
570
666
|
}
|
|
571
|
-
declare function ShellConfigProvider({ config, children, }: ShellConfigProviderProps):
|
|
667
|
+
declare function ShellConfigProvider({ config, children, }: ShellConfigProviderProps): React.JSX.Element;
|
|
572
668
|
|
|
573
669
|
/**
|
|
574
670
|
* SearchTrigger -- Cmd+K search button for the TopBar.
|
|
@@ -576,7 +672,16 @@ declare function ShellConfigProvider({ config, children, }: ShellConfigProviderP
|
|
|
576
672
|
* Opens the shell CommandMenu via the imperative navigation API.
|
|
577
673
|
* Generic building block, no app-specific dependencies.
|
|
578
674
|
*/
|
|
579
|
-
declare function SearchTrigger():
|
|
675
|
+
declare function SearchTrigger(): React.JSX.Element;
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* ThemeToggle -- switches between the light and the dark theme, for the
|
|
679
|
+
* TopBar. The choice is remembered (sonnet-core's useTheme); call initTheme()
|
|
680
|
+
* before the app renders so a visit starts in it.
|
|
681
|
+
*
|
|
682
|
+
* Generic building block, no app-specific dependencies.
|
|
683
|
+
*/
|
|
684
|
+
declare function ThemeToggle(): React.JSX.Element;
|
|
580
685
|
|
|
581
686
|
/**
|
|
582
687
|
* UserMenu -- avatar dropdown for the TopBar.
|
|
@@ -594,7 +699,7 @@ interface UserMenuProps {
|
|
|
594
699
|
user: UserMenuUser;
|
|
595
700
|
onSignOut?: () => void;
|
|
596
701
|
}
|
|
597
|
-
declare function UserMenu({ user, onSignOut }: UserMenuProps):
|
|
702
|
+
declare function UserMenu({ user, onSignOut }: UserMenuProps): React.JSX.Element;
|
|
598
703
|
|
|
599
704
|
/**
|
|
600
705
|
* Default (kind, surface) → effect matrix. App overrides are merged over this.
|
|
@@ -637,11 +742,23 @@ interface PromiseOptions<T> {
|
|
|
637
742
|
success: string | ((data: T) => string);
|
|
638
743
|
error: string | ((err: unknown) => string);
|
|
639
744
|
}
|
|
745
|
+
/** A step a toast offers -- "Undo", "Open it" --; the toast closes when it is taken. */
|
|
746
|
+
interface NotificationAction {
|
|
747
|
+
label: string;
|
|
748
|
+
onClick: () => void;
|
|
749
|
+
}
|
|
750
|
+
/** What a toast may carry beside its message. */
|
|
751
|
+
interface NotificationOptions {
|
|
752
|
+
/** A second line under the message. */
|
|
753
|
+
description?: string;
|
|
754
|
+
/** A button on the toast, for the step that follows from it. */
|
|
755
|
+
action?: NotificationAction;
|
|
756
|
+
}
|
|
640
757
|
declare const notification: {
|
|
641
|
-
success(message: string): void;
|
|
642
|
-
error(message: string): void;
|
|
643
|
-
warning(message: string): void;
|
|
644
|
-
info(message: string): void;
|
|
758
|
+
success(message: string, options?: NotificationOptions): void;
|
|
759
|
+
error(message: string, options?: NotificationOptions): void;
|
|
760
|
+
warning(message: string, options?: NotificationOptions): void;
|
|
761
|
+
info(message: string, options?: NotificationOptions): void;
|
|
645
762
|
promise<T>(promise: Promise<T>, opts: PromiseOptions<T>): (string & {
|
|
646
763
|
unwrap: () => Promise<T>;
|
|
647
764
|
}) | (number & {
|
|
@@ -657,6 +774,11 @@ interface ConfirmOptions {
|
|
|
657
774
|
confirmLabel?: string;
|
|
658
775
|
cancelLabel?: string;
|
|
659
776
|
variant?: "default" | "destructive";
|
|
777
|
+
/**
|
|
778
|
+
* A text the user must type to confirm -- the item's name, for a delete that
|
|
779
|
+
* cascades. Confirm stays disabled until it matches exactly.
|
|
780
|
+
*/
|
|
781
|
+
confirmText?: string;
|
|
660
782
|
}
|
|
661
783
|
type DialogConfirmFn = (opts: ConfirmOptions) => Promise<boolean>;
|
|
662
784
|
/**
|
|
@@ -836,9 +958,45 @@ interface ShellNavigationState {
|
|
|
836
958
|
subNavCollapsed: boolean;
|
|
837
959
|
onToggleSubNav: () => void;
|
|
838
960
|
onServiceSelect: (id: string) => void;
|
|
961
|
+
/**
|
|
962
|
+
* Ask for the sub-navigation to collapse until the returned release is
|
|
963
|
+
* called. Optional so custom providers need not implement it; pages use
|
|
964
|
+
* useCollapsedSubNav rather than calling it.
|
|
965
|
+
*/
|
|
966
|
+
requestSubNavCollapse?: () => () => void;
|
|
839
967
|
}
|
|
840
968
|
/** Read shell navigation state. Must be used within AppShell. */
|
|
841
969
|
declare function useShellNavigation(): ShellNavigationState;
|
|
970
|
+
/**
|
|
971
|
+
* Collapse the sub-navigation while the calling page is shown, so the content
|
|
972
|
+
* area gets its full width (a canvas, an editor). On unmount the panel returns
|
|
973
|
+
* to the user's own setting; the user can still expand it meanwhile. Outside
|
|
974
|
+
* AppShell, or with `active` false, it does nothing.
|
|
975
|
+
*
|
|
976
|
+
* @example
|
|
977
|
+
* ```tsx
|
|
978
|
+
* function GraphWorkspacePage() {
|
|
979
|
+
* useCollapsedSubNav();
|
|
980
|
+
* return <Canvas />;
|
|
981
|
+
* }
|
|
982
|
+
* ```
|
|
983
|
+
*/
|
|
984
|
+
declare function useCollapsedSubNav(active?: boolean): void;
|
|
985
|
+
|
|
986
|
+
/**
|
|
987
|
+
* A contribution's path with its `:params` filled in by the host.
|
|
988
|
+
*
|
|
989
|
+
* A contribution names what it needs from the place it is shown in --
|
|
990
|
+
* `/files?scope=:name`, `/orgs/:orgId/report` -- and the host that renders the
|
|
991
|
+
* extension point supplies the values. Each `:param` is replaced wherever it
|
|
992
|
+
* stands, the query included, its value URL-encoded; a param the host does not
|
|
993
|
+
* supply is left as written.
|
|
994
|
+
*
|
|
995
|
+
* @example
|
|
996
|
+
* contributionPath("/files?scope=:name", { name: "billing api" })
|
|
997
|
+
* // "/files?scope=billing%20api"
|
|
998
|
+
*/
|
|
999
|
+
declare function contributionPath(path: string, params: Record<string, string>): string;
|
|
842
1000
|
|
|
843
1001
|
/**
|
|
844
1002
|
* OverviewCard and FeatureLink -- building blocks for module overview pages.
|
|
@@ -849,6 +1007,9 @@ declare function useShellNavigation(): ShellNavigationState;
|
|
|
849
1007
|
* FeatureLink is an inline text link for use in descriptions or prose,
|
|
850
1008
|
* also navigating via stable feature id.
|
|
851
1009
|
*
|
|
1010
|
+
* OverviewGroupHeading heads a group of cards, with one line saying what the
|
|
1011
|
+
* group is.
|
|
1012
|
+
*
|
|
852
1013
|
* Part of the shell -- extracts to @petrarca/sonnet-shell.
|
|
853
1014
|
*/
|
|
854
1015
|
|
|
@@ -867,6 +1028,11 @@ interface OverviewCardProps {
|
|
|
867
1028
|
* Omit for non-navigable cards.
|
|
868
1029
|
*/
|
|
869
1030
|
feature?: string;
|
|
1031
|
+
/**
|
|
1032
|
+
* A path to navigate to instead -- for a card whose target is known only at
|
|
1033
|
+
* runtime (no stable feature id). `feature` wins when both are given.
|
|
1034
|
+
*/
|
|
1035
|
+
path?: string;
|
|
870
1036
|
/** Additional CSS class names. */
|
|
871
1037
|
className?: string;
|
|
872
1038
|
}
|
|
@@ -884,7 +1050,29 @@ declare function FeatureLink({ feature, children, }: {
|
|
|
884
1050
|
children: React__default.ReactNode;
|
|
885
1051
|
}): React__default.ReactElement;
|
|
886
1052
|
/** Feature card for module overview pages. Navigates via the shell API. */
|
|
887
|
-
declare function OverviewCard({ icon: Icon, title, description, feature, className, }: OverviewCardProps): React__default.ReactElement;
|
|
1053
|
+
declare function OverviewCard({ icon: Icon, title, description, feature, path, className, }: OverviewCardProps): React__default.ReactElement;
|
|
1054
|
+
/**
|
|
1055
|
+
* OverviewGroupHeading -- a group's heading on an overview page, and the one
|
|
1056
|
+
* line saying what the group is. "Capabilities" -- the cards of an area
|
|
1057
|
+
* without groups -- needs no line.
|
|
1058
|
+
*
|
|
1059
|
+
* Its size (`text-sm font-semibold`) is not a heading role: an overview is a
|
|
1060
|
+
* dense list of cards, and a section-sized heading would outweigh them.
|
|
1061
|
+
*
|
|
1062
|
+
* @example
|
|
1063
|
+
* <OverviewGroupHeading heading="Capabilities" />
|
|
1064
|
+
* <OverviewGroupHeading heading="Runtime" description="What this server runs." />
|
|
1065
|
+
*/
|
|
1066
|
+
declare function OverviewGroupHeading({ heading, description, }: {
|
|
1067
|
+
heading: string;
|
|
1068
|
+
description?: string;
|
|
1069
|
+
}): React__default.ReactElement;
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* Shell hooks -- reactive APIs for modules.
|
|
1073
|
+
*
|
|
1074
|
+
* Import path: @/shell/hooks
|
|
1075
|
+
*/
|
|
888
1076
|
|
|
889
1077
|
/**
|
|
890
1078
|
* Get sorted contributions for a named extension point.
|
|
@@ -898,6 +1086,30 @@ declare function OverviewCard({ icon: Icon, title, description, feature, classNa
|
|
|
898
1086
|
* ```
|
|
899
1087
|
*/
|
|
900
1088
|
declare function useExtensionPoint(name: string): Contribution[];
|
|
1089
|
+
/**
|
|
1090
|
+
* The component a module contributes to an extension point under `path`, typed
|
|
1091
|
+
* with the props the extension point defines -- or undefined when no module
|
|
1092
|
+
* contributes one. The host renders it where it wants, with those props.
|
|
1093
|
+
*
|
|
1094
|
+
* @example
|
|
1095
|
+
* ```tsx
|
|
1096
|
+
* const FlowSelector = useContributedComponent<SelectorProps>("selectors", "flows");
|
|
1097
|
+
* return FlowSelector ? <FlowSelector onPick={assign} /> : null;
|
|
1098
|
+
* ```
|
|
1099
|
+
*/
|
|
1100
|
+
declare function useContributedComponent<P>(extensionPoint: string, path: string): ComponentType<P> | undefined;
|
|
1101
|
+
/**
|
|
1102
|
+
* A module's complete navigation, as every surface shows it: its static
|
|
1103
|
+
* `navigation`, then the groups its `useNavigation` hook supplies at runtime
|
|
1104
|
+
* (e.g. loaded from a server), then the links other modules contribute to its
|
|
1105
|
+
* `<moduleId>.nav` extension point (sorted by `order`).
|
|
1106
|
+
*
|
|
1107
|
+
* Call it once per rendered module -- the module's `useNavigation` is a hook,
|
|
1108
|
+
* and modules' hooks differ. A component calling it must therefore render one
|
|
1109
|
+
* module for its whole life: key it by the module's id, so a switch to another
|
|
1110
|
+
* module mounts a new instance instead of changing the hooks of a mounted one.
|
|
1111
|
+
*/
|
|
1112
|
+
declare function useModuleNavigation(module: ShellModule): NavGroup[];
|
|
901
1113
|
/**
|
|
902
1114
|
* Get the list of visible service modules (excludes hidden and bottom-pinned).
|
|
903
1115
|
*
|
|
@@ -919,4 +1131,5 @@ declare function useMainModules(): ShellModule[];
|
|
|
919
1131
|
*/
|
|
920
1132
|
declare function useShellEvent<K extends keyof ShellEventMap>(key: K, handler: (payload: ShellEventMap[K]) => void): void;
|
|
921
1133
|
|
|
922
|
-
export { AppShell,
|
|
1134
|
+
export { AppShell, Breadcrumbs, CommandMenu, ConfirmDialog, DEFAULT_CAPABILITY_POLICY, DrillDownHeader, FeatureLink, IconRail, OverviewCard, OverviewGroupHeading, PlaceholderPage, RailIcon, RailSeparator, RootLayout, SearchTrigger, ShellConfigProvider, ShellFooter, ShellRail, ShellSidebar, ShellVersion, SidePane, SidePaneContext, Sidebar, SidebarGroup, SidebarItem, SubNavPanel, ThemeToggle, TopBar, UserMenu, contributionPath, createModuleRegistry, dialog, evaluateModule, events, fullscreen, initDialog, initFeatureNav, initFullscreen, initNavigation, initPanel, initSidePane, navigation, notification, panel, resolveCapabilityPolicy, sidePane, useCollapsedSubNav, useContributedComponent, useExtensionPoint, useMainModules, useModuleNavigation, useShellConfig, useShellEvent, useShellModules, useShellNavigation, useSidePaneState };
|
|
1135
|
+
export type { BreadcrumbItem, BreadcrumbsProps, CapabilityPolicy, CapabilityResolver, CapabilityResult, ConfirmDialogProps, ConfirmOptions, Contribution, DrillDownHeaderProps, Effect, FullscreenOptions, IconRailProps, ModuleCommand, ModuleEffect, ModuleRegistry, NavGroup, NavLink, NotificationAction, NotificationOptions, PanelOptions, RailIconProps, ShellConfig, ShellEventMap, ShellFooterProps, ShellModule, ShellNavigationState, ShellSidebarProps, ShellVersionProps, SidePaneOptions as SidePaneApiOptions, SidePaneOptions, SidePaneState, SidebarGroupProps, SidebarItemProps, SidebarProps, SubNavPanelProps, Surface, UnmetKind, UserMenuUser };
|