@luigi-project/core-modular 0.0.10 → 0.0.11-dev.20260720111
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/core-api/custom-messages.d.ts +26 -0
- package/core-api/global-search.d.ts +61 -0
- package/core-api/luigi.d.ts +3 -0
- package/core-api/navigation.d.ts +6 -0
- package/core-api/ux.d.ts +94 -1
- package/luigi-engine.d.ts +2 -2
- package/luigi.js +2942 -2775
- package/luigi.js.map +1 -1
- package/modules/ux-module.d.ts +2 -30
- package/package.json +1 -1
- package/services/global-search.service.d.ts +21 -0
- package/services/navigation.service.d.ts +5 -2
- package/services/routing.service.d.ts +1 -1
- package/types/compound-config.d.ts +204 -0
- package/types/connector.d.ts +272 -12
- package/types/dom-elements.d.ts +13 -0
- package/types/global-search.d.ts +64 -0
- package/types/navigation.d.ts +23 -215
- package/types/ux.d.ts +43 -0
- package/utilities/helpers/global-search-helpers.d.ts +7 -0
package/modules/ux-module.d.ts
CHANGED
|
@@ -1,42 +1,14 @@
|
|
|
1
1
|
import { LuigiCompoundContainer, LuigiContainer } from '@luigi-project/container';
|
|
2
2
|
import { Luigi } from '../core-api/luigi';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
id?: string;
|
|
6
|
-
links?: Record<string, Link>;
|
|
7
|
-
text?: string;
|
|
8
|
-
ttl?: number;
|
|
9
|
-
type?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface AlertHandler {
|
|
12
|
-
openFromClient: boolean;
|
|
13
|
-
close(): void;
|
|
14
|
-
link(linkKey: string): boolean;
|
|
15
|
-
}
|
|
3
|
+
import { AlertSettings, ConfirmationModalSettings, Link } from '../types/ux';
|
|
4
|
+
export type { AlertHandler, AlertSettings, ConfirmationModalHandler, ConfirmationModalSettings, Link } from '../types/ux';
|
|
16
5
|
export interface ProcessedAlertSettings {
|
|
17
6
|
settings: AlertSettings;
|
|
18
7
|
}
|
|
19
|
-
export interface Link {
|
|
20
|
-
elemId: string;
|
|
21
|
-
url?: string;
|
|
22
|
-
dismissKey?: string;
|
|
23
|
-
}
|
|
24
8
|
export interface ProcessedTextAndLinks {
|
|
25
9
|
sanitizedText: string;
|
|
26
10
|
links: Link[];
|
|
27
11
|
}
|
|
28
|
-
export interface ConfirmationModalSettings {
|
|
29
|
-
icon?: string;
|
|
30
|
-
type?: string;
|
|
31
|
-
header?: string;
|
|
32
|
-
body?: string;
|
|
33
|
-
buttonConfirm?: string;
|
|
34
|
-
buttonDismiss?: string;
|
|
35
|
-
}
|
|
36
|
-
export interface ConfirmationModalHandler {
|
|
37
|
-
confirm(): void;
|
|
38
|
-
dismiss(): void;
|
|
39
|
-
}
|
|
40
12
|
export interface UserSettings {
|
|
41
13
|
[key: string]: number | string | boolean;
|
|
42
14
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { GlobalSearchProvider, SearchResultItem } from '../types/global-search';
|
|
2
|
+
import { Luigi } from '../core-api/luigi';
|
|
3
|
+
export declare class GlobalSearchService {
|
|
4
|
+
private luigi;
|
|
5
|
+
isSearchFieldVisible: boolean;
|
|
6
|
+
isSearchResultVisible: boolean;
|
|
7
|
+
searchQuery: string;
|
|
8
|
+
searchResult: SearchResultItem[];
|
|
9
|
+
constructor(luigi: Luigi);
|
|
10
|
+
get searchProvider(): GlobalSearchProvider;
|
|
11
|
+
private getHandler;
|
|
12
|
+
hasSearchProvider(): boolean;
|
|
13
|
+
getFieldVisibility(): boolean;
|
|
14
|
+
setFieldVisibility(value: boolean): void;
|
|
15
|
+
showSearchResult(searchResultItems: SearchResultItem[]): void;
|
|
16
|
+
closeSearchResult(): void;
|
|
17
|
+
getSearchQuery(): string;
|
|
18
|
+
setSearchQuery(value: string): void;
|
|
19
|
+
setSearchInputPlaceholder(placeholder?: string): void;
|
|
20
|
+
toggleSearch(): void;
|
|
21
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Luigi } from '../core-api/luigi';
|
|
2
|
-
import { AppSwitcher, BreadcrumbData, LeftNavData, NavigationOptions, NavigationRequestParams, NavItem, Node, PathData, TabNavData, TopNavData } from '../types/navigation';
|
|
2
|
+
import { AppSwitcher, BadgeCounter, BreadcrumbData, LeftNavData, NavigationOptions, NavigationRequestParams, NavItem, Node, PathData, TabNavData, TopNavData } from '../types/navigation';
|
|
3
3
|
import { ModalService } from './modal.service';
|
|
4
4
|
import { NodeDataManagementService } from './node-data-management.service';
|
|
5
5
|
export declare class NavigationService {
|
|
@@ -12,7 +12,10 @@ export declare class NavigationService {
|
|
|
12
12
|
private getNodeDataManagementService;
|
|
13
13
|
getPathData(path: string): Promise<PathData>;
|
|
14
14
|
findMatchingNode(urlPathElement: string, nodes: Node[]): Node | undefined;
|
|
15
|
-
buildNavItems(nodes: Node[], selectedNode: Node | undefined, pathData: PathData):
|
|
15
|
+
buildNavItems(nodes: Node[], selectedNode: Node | undefined, pathData: PathData): Promise<{
|
|
16
|
+
items: NavItem[];
|
|
17
|
+
totalBadgeNode: BadgeCounter | undefined;
|
|
18
|
+
}>;
|
|
16
19
|
getCurrentNode(path: string): Promise<Node | undefined>;
|
|
17
20
|
getPathParams(path: string): Promise<Record<string, any>>;
|
|
18
21
|
/**
|
|
@@ -134,5 +134,5 @@ export declare class RoutingService {
|
|
|
134
134
|
* @param pathUrlRaw - path url without hash
|
|
135
135
|
* @returns true if misconfiguration was detected and handled
|
|
136
136
|
*/
|
|
137
|
-
handleViewUrlMisconfigured(node: Node, viewUrl: string, previousPathData: PathData, pathUrlRaw: string): Promise<boolean>;
|
|
137
|
+
handleViewUrlMisconfigured(node: Node, viewUrl: string, previousPathData: PathData | undefined, pathUrlRaw: string): Promise<boolean>;
|
|
138
138
|
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for compound web components in Luigi.
|
|
3
|
+
* Compound allows you to layout multiple web components in one micro frontend.
|
|
4
|
+
*/
|
|
5
|
+
export interface CompoundConfig {
|
|
6
|
+
/**
|
|
7
|
+
* Renderer configuration for the compound layout
|
|
8
|
+
*/
|
|
9
|
+
renderer?: {
|
|
10
|
+
/**
|
|
11
|
+
* The renderer to use - can be 'grid', a custom renderer object, or undefined for default
|
|
12
|
+
*/
|
|
13
|
+
use?: 'grid' | string | {
|
|
14
|
+
/**
|
|
15
|
+
* Base renderer to extend (e.g., 'grid')
|
|
16
|
+
*/
|
|
17
|
+
extends?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Custom function to create the compound container
|
|
20
|
+
* @param config - The renderer configuration
|
|
21
|
+
* @param renderer - The parent/super renderer (if extending)
|
|
22
|
+
*/
|
|
23
|
+
createCompoundContainer?: (config: RendererConfig, renderer?: any) => HTMLDivElement;
|
|
24
|
+
/**
|
|
25
|
+
* Custom function to create individual compound item containers
|
|
26
|
+
* @param layoutConfig - Layout configuration for the item
|
|
27
|
+
* @param config - The overall renderer configuration
|
|
28
|
+
* @param renderer - The parent/super renderer (if extending)
|
|
29
|
+
*/
|
|
30
|
+
createCompoundItemContainer?: (layoutConfig?: LayoutConfig, config?: RendererConfig, renderer?: any) => HTMLDivElement;
|
|
31
|
+
/**
|
|
32
|
+
* Custom function to attach an item to the compound container
|
|
33
|
+
* @param compoundCnt - The compound container element
|
|
34
|
+
* @param compoundItemCnt - The item container to attach
|
|
35
|
+
* @param renderer - The parent/super renderer (if extending)
|
|
36
|
+
*/
|
|
37
|
+
attachCompoundItem?: (compoundCnt: HTMLElement, compoundItemCnt: HTMLElement, renderer?: any) => void;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Configuration for the grid layout
|
|
41
|
+
*/
|
|
42
|
+
config?: {
|
|
43
|
+
/**
|
|
44
|
+
* CSS grid-template-columns value (e.g., '1fr 2fr')
|
|
45
|
+
*/
|
|
46
|
+
columns?: string;
|
|
47
|
+
/**
|
|
48
|
+
* CSS grid-template-rows value (e.g., '150px 150px')
|
|
49
|
+
*/
|
|
50
|
+
rows?: string;
|
|
51
|
+
/**
|
|
52
|
+
* CSS grid-gap value (e.g., 'auto', '10px')
|
|
53
|
+
*/
|
|
54
|
+
gap?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Minimum height for the grid container
|
|
57
|
+
*/
|
|
58
|
+
minHeight?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Responsive layout configurations for different viewport sizes
|
|
61
|
+
*/
|
|
62
|
+
layouts?: Array<{
|
|
63
|
+
/**
|
|
64
|
+
* CSS grid-template-columns for this breakpoint
|
|
65
|
+
*/
|
|
66
|
+
columns?: string | number;
|
|
67
|
+
/**
|
|
68
|
+
* CSS grid-template-rows for this breakpoint
|
|
69
|
+
*/
|
|
70
|
+
rows?: string | number;
|
|
71
|
+
/**
|
|
72
|
+
* CSS grid-gap for this breakpoint
|
|
73
|
+
*/
|
|
74
|
+
gap?: string | number;
|
|
75
|
+
/**
|
|
76
|
+
* Minimum viewport width for this layout (in pixels)
|
|
77
|
+
*/
|
|
78
|
+
minWidth?: number;
|
|
79
|
+
/**
|
|
80
|
+
* Maximum viewport width for this layout (in pixels)
|
|
81
|
+
*/
|
|
82
|
+
maxWidth?: number;
|
|
83
|
+
}>;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Lazy loading configuration for compound children
|
|
88
|
+
*/
|
|
89
|
+
lazyLoadingOptions?: {
|
|
90
|
+
/**
|
|
91
|
+
* Enable lazy loading using IntersectionObserver
|
|
92
|
+
* @default false
|
|
93
|
+
*/
|
|
94
|
+
enabled?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* IntersectionObserver rootMargin option
|
|
97
|
+
* Controls when children are loaded relative to viewport visibility
|
|
98
|
+
* @default "0px"
|
|
99
|
+
*/
|
|
100
|
+
intersectionRootMargin?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Default temporary height for child containers before they load
|
|
103
|
+
* @default "500px"
|
|
104
|
+
*/
|
|
105
|
+
temporaryContainerHeight?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Disable automatic temporary container heights
|
|
108
|
+
* Useful for custom renderers that manage heights themselves
|
|
109
|
+
* @default false
|
|
110
|
+
*/
|
|
111
|
+
noTemporaryContainerHeight?: boolean;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Array of child web component configurations
|
|
115
|
+
*/
|
|
116
|
+
children?: Array<{
|
|
117
|
+
/**
|
|
118
|
+
* Unique identifier for this child web component
|
|
119
|
+
*/
|
|
120
|
+
id: string;
|
|
121
|
+
/**
|
|
122
|
+
* URL pointing to the web component JavaScript file
|
|
123
|
+
* Supports {i18n.currentLocale} placeholder for localization
|
|
124
|
+
*/
|
|
125
|
+
viewUrl: string;
|
|
126
|
+
/**
|
|
127
|
+
* Context object passed to the web component
|
|
128
|
+
*/
|
|
129
|
+
context?: Record<string, any>;
|
|
130
|
+
/**
|
|
131
|
+
* Layout configuration for positioning this child
|
|
132
|
+
*/
|
|
133
|
+
layoutConfig?: {
|
|
134
|
+
/**
|
|
135
|
+
* CSS grid-row value (e.g., '1 / 3', 'auto')
|
|
136
|
+
* @default "auto"
|
|
137
|
+
*/
|
|
138
|
+
row?: string;
|
|
139
|
+
/**
|
|
140
|
+
* CSS grid-column value (e.g., '1 / -1', 'auto')
|
|
141
|
+
* @default "auto"
|
|
142
|
+
*/
|
|
143
|
+
column?: string;
|
|
144
|
+
/**
|
|
145
|
+
* Slot name for nested web components
|
|
146
|
+
* Use this instead of row/column to plug into a parent's slot
|
|
147
|
+
*/
|
|
148
|
+
slot?: string;
|
|
149
|
+
/**
|
|
150
|
+
* Override the default temporary container height for this specific child
|
|
151
|
+
* Only used when lazy loading is enabled
|
|
152
|
+
* * @default undefined
|
|
153
|
+
*/
|
|
154
|
+
temporaryContainerHeight?: string;
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Event listeners for cross-component communication via event bus
|
|
158
|
+
*/
|
|
159
|
+
eventListeners?: Array<{
|
|
160
|
+
/**
|
|
161
|
+
* ID of the source web component (use '*' for any source)
|
|
162
|
+
*/
|
|
163
|
+
source: string;
|
|
164
|
+
/**
|
|
165
|
+
* Name of the event to listen for
|
|
166
|
+
*/
|
|
167
|
+
name: string;
|
|
168
|
+
/**
|
|
169
|
+
* Type of action to perform (e.g., 'update')
|
|
170
|
+
*/
|
|
171
|
+
action: string;
|
|
172
|
+
/**
|
|
173
|
+
* Optional function to convert event data before passing to listener
|
|
174
|
+
* @param data - The event data
|
|
175
|
+
*/
|
|
176
|
+
dataConverter?: (data: any) => any;
|
|
177
|
+
}>;
|
|
178
|
+
}>;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Supporting type for layout configuration
|
|
182
|
+
*/
|
|
183
|
+
export interface LayoutConfig {
|
|
184
|
+
column?: string;
|
|
185
|
+
row?: string;
|
|
186
|
+
slot?: string;
|
|
187
|
+
temporaryContainerHeight?: string;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Supporting type for renderer configuration
|
|
191
|
+
*/
|
|
192
|
+
export interface RendererConfig {
|
|
193
|
+
columns?: string;
|
|
194
|
+
rows?: string;
|
|
195
|
+
gap?: string;
|
|
196
|
+
minHeight?: string;
|
|
197
|
+
layouts?: Array<{
|
|
198
|
+
columns?: string;
|
|
199
|
+
rows?: string;
|
|
200
|
+
gap?: string | number;
|
|
201
|
+
minWidth?: number;
|
|
202
|
+
maxWidth?: number;
|
|
203
|
+
}>;
|
|
204
|
+
}
|
package/types/connector.d.ts
CHANGED
|
@@ -1,34 +1,294 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CoreAPISupportedElements } from './dom-elements';
|
|
2
|
+
import { GlobalSearchHandler } from './global-search';
|
|
3
|
+
import { AlertHandler, AlertSettings, ConfirmationModalHandler, ConfirmationModalSettings } from './ux';
|
|
2
4
|
import { ModalSettings, LeftNavData, Node, TopNavData, TabNavData, BreadcrumbData, DrawerSettings, UserSettingsDialogSettings } from './navigation';
|
|
5
|
+
/**
|
|
6
|
+
* Integration contract between Luigi's core and a head (shell) implementation.
|
|
7
|
+
*
|
|
8
|
+
* A connector adapts Luigi's framework-agnostic core to a concrete UI technology
|
|
9
|
+
* (UI5 Web Components, Fiori, a custom design system, …). The head implements
|
|
10
|
+
* this interface and hands an instance to `LuigiEngine.bootstrap(connector)`.
|
|
11
|
+
*
|
|
12
|
+
* Core never queries the DOM directly: it asks the connector to render shell
|
|
13
|
+
* regions, mount micro-frontend containers, and surface alerts/modals/drawers.
|
|
14
|
+
* In return, core hands the connector either callbacks to invoke (for modal /
|
|
15
|
+
* drawer lifecycle) or handler objects (for alerts / confirmation modals) so
|
|
16
|
+
* the connector can report user-driven outcomes back.
|
|
17
|
+
*/
|
|
3
18
|
export interface LuigiConnector {
|
|
19
|
+
/**
|
|
20
|
+
* Build the shell chrome (header / side nav / content area / overlays).
|
|
21
|
+
*
|
|
22
|
+
* Called once during `UIModule.init`, before any other `render*` method.
|
|
23
|
+
* The connector should create the DOM slots that subsequent calls will
|
|
24
|
+
* populate (top nav, left nav, tab nav, breadcrumbs, container wrapper,
|
|
25
|
+
* alert and confirmation overlays) and should be idempotent — re-invoking
|
|
26
|
+
* it must not duplicate the layout.
|
|
27
|
+
*/
|
|
4
28
|
renderMainLayout(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Render the top navigation (shellbar) from the supplied data.
|
|
31
|
+
*
|
|
32
|
+
* Called on initial route resolution and again whenever core's UI update
|
|
33
|
+
* touches scopes affecting the header (`settings`, `settings.header`,
|
|
34
|
+
* `navigation`, `navigation.profile`, `navigation.contextSwitcher`,
|
|
35
|
+
* `navigation.productSwitcher`). Treat the call as a full replace, not an
|
|
36
|
+
* append — the data describes the complete desired state.
|
|
37
|
+
*
|
|
38
|
+
* @param data complete top-nav state to render — title, logo, top-level
|
|
39
|
+
* nodes, profile, context/app/product switchers, optional global-search
|
|
40
|
+
* config. Any region present should be (re)rendered; absent fields mean
|
|
41
|
+
* "hide / remove that region".
|
|
42
|
+
*/
|
|
5
43
|
renderTopNav(data: TopNavData): void;
|
|
44
|
+
/**
|
|
45
|
+
* Render the left (side) navigation from the supplied data.
|
|
46
|
+
*
|
|
47
|
+
* Called on initial route resolution and on updates touching `navigation`,
|
|
48
|
+
* `navigation.nodes`, `navigation.viewgroupdata`, `settings`, or
|
|
49
|
+
* `settings.footer`. Full replace semantics — render `data.items` and
|
|
50
|
+
* highlight `data.selectedNode`; do not merge with previously rendered
|
|
51
|
+
* state.
|
|
52
|
+
*
|
|
53
|
+
* @param data items to render, the currently selected node to highlight,
|
|
54
|
+
* the base path for relative links, an optional footer text, and an
|
|
55
|
+
* optional `navClick` handler the connector may invoke on item click in
|
|
56
|
+
* place of native navigation.
|
|
57
|
+
*/
|
|
6
58
|
renderLeftNav(data: LeftNavData): void;
|
|
59
|
+
/**
|
|
60
|
+
* Return the element into which core appends micro-frontend containers
|
|
61
|
+
* (`luigi-container` / `luigi-compound-container`).
|
|
62
|
+
*
|
|
63
|
+
* Called frequently — on every navigation, by the auth layer, by the
|
|
64
|
+
* preloading service, and by container helpers. The element should already
|
|
65
|
+
* exist after `renderMainLayout()`; returning `null`/`undefined` will
|
|
66
|
+
* suppress mounting and is treated as "no container area available".
|
|
67
|
+
*
|
|
68
|
+
* @returns the content-area host element, or `null`/`undefined` if the
|
|
69
|
+
* shell has no mount point available yet.
|
|
70
|
+
*/
|
|
7
71
|
getContainerWrapper(): HTMLElement;
|
|
8
|
-
|
|
9
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Render `content` (a `luigi-container` / `luigi-compound-container`) inside
|
|
74
|
+
* a modal dialog.
|
|
75
|
+
*
|
|
76
|
+
* `updateModalSettings` may be called between this method and close to
|
|
77
|
+
* mutate title / size in place.
|
|
78
|
+
*
|
|
79
|
+
* @param content the micro-frontend container element to mount inside the
|
|
80
|
+
* dialog. Already constructed by core; the connector only needs to
|
|
81
|
+
* append it to its modal DOM.
|
|
82
|
+
* @param modalSettings dialog presentation — size preset, explicit width /
|
|
83
|
+
* height, title, optional `keepPrevious` flag, test-id for the close
|
|
84
|
+
* button.
|
|
85
|
+
* @param onCloseCallback invoked by the connector **once the modal is fully
|
|
86
|
+
* closed** (after any dirty-state confirmation has resolved). Drives
|
|
87
|
+
* core's modal-stack cleanup and URL bookkeeping.
|
|
88
|
+
* @param onCloseRequest invoked by the connector **when the user requests
|
|
89
|
+
* close** (e.g. clicks the close button). Returns a `Promise<void>` that
|
|
90
|
+
* resolves once core has approved the close (dirty-state check passed,
|
|
91
|
+
* no unsaved-changes prompt outstanding). The connector should `await`
|
|
92
|
+
* this before tearing the modal down.
|
|
93
|
+
*/
|
|
94
|
+
renderModal(content: HTMLElement, modalSettings: ModalSettings, onCloseCallback?: () => void, onCloseRequest?: () => void): void;
|
|
95
|
+
/**
|
|
96
|
+
* Render `content` inside a drawer (slide-in panel).
|
|
97
|
+
*
|
|
98
|
+
* @param content the micro-frontend container element to mount inside the
|
|
99
|
+
* drawer.
|
|
100
|
+
* @param drawerSettings drawer presentation — size, overlap mode, optional
|
|
101
|
+
* header, whether a backdrop is shown.
|
|
102
|
+
* @param onCloseCallback invoked by the connector once the drawer has
|
|
103
|
+
* closed. See {@link LuigiConnector.renderModal} for the lifecycle
|
|
104
|
+
* contract — drawer mirrors modal exactly.
|
|
105
|
+
* @param onCloseRequest invoked by the connector on user-driven close;
|
|
106
|
+
* awaiting the returned promise yields core's approval (dirty-status
|
|
107
|
+
* check).
|
|
108
|
+
*/
|
|
109
|
+
renderDrawer(content: HTMLElement, drawerSettings: DrawerSettings, onCloseCallback?: () => void, onCloseRequest?: () => void): void;
|
|
110
|
+
/**
|
|
111
|
+
* Render the tab navigation row for the current node.
|
|
112
|
+
*
|
|
113
|
+
* Called alongside `renderLeftNav` whenever the relevant navigation scopes
|
|
114
|
+
* change. Full replace semantics.
|
|
115
|
+
*
|
|
116
|
+
* @param data tab items, the currently selected one, base path for
|
|
117
|
+
* relative links, and optional `navClick` handler.
|
|
118
|
+
*/
|
|
10
119
|
renderTabNav(data: TabNavData): void;
|
|
120
|
+
/**
|
|
121
|
+
* Render the breadcrumb trail for the current path.
|
|
122
|
+
*
|
|
123
|
+
* Called on navigation updates. The `BreadcrumbData` passed in may contain
|
|
124
|
+
* pending entries whose labels resolve asynchronously — in that case core
|
|
125
|
+
* calls `renderBreadcrumbs` a second time with the resolved data, so the
|
|
126
|
+
* connector should accept repeated invocations as a full replace.
|
|
127
|
+
*
|
|
128
|
+
* @param data breadcrumb items (each with optional `pending: true` until
|
|
129
|
+
* resolved), base path, selected node, and an optional custom renderer.
|
|
130
|
+
* `clearBeforeRender` indicates whether the connector should wipe
|
|
131
|
+
* existing breadcrumbs before rendering.
|
|
132
|
+
*/
|
|
11
133
|
renderBreadcrumbs(data: BreadcrumbData): void;
|
|
134
|
+
/**
|
|
135
|
+
* Surface an alert (toast / message strip) to the user.
|
|
136
|
+
*
|
|
137
|
+
* @param alertSettings what to display — text (may contain link tokens
|
|
138
|
+
* resolved via `links`), severity `type`, optional auto-close timeout,
|
|
139
|
+
* id, and link map.
|
|
140
|
+
* @param alertHandler connector → core channel for reporting the
|
|
141
|
+
* alert's outcome. Invoke `alertHandler.close()` when the alert is
|
|
142
|
+
* dismissed (auto-timeout or user action) and
|
|
143
|
+
* `alertHandler.link(linkKey)` when the user activates a link embedded
|
|
144
|
+
* in the text. `alertHandler.openFromClient` indicates whether the alert
|
|
145
|
+
* originated from a micro-frontend (used by core for routing of the
|
|
146
|
+
* outcome).
|
|
147
|
+
*/
|
|
12
148
|
renderAlert(alertSettings: AlertSettings, alertHandler: AlertHandler): void;
|
|
149
|
+
/**
|
|
150
|
+
* Surface a confirmation modal (yes/no dialog).
|
|
151
|
+
*
|
|
152
|
+
* Used both for app-level confirmations (`Luigi.ux().showConfirmationModal`)
|
|
153
|
+
* and for the dirty-state unsaved-changes flow — the connector does not
|
|
154
|
+
* need to distinguish.
|
|
155
|
+
*
|
|
156
|
+
* @param confirmationModalSettings header, body text, button labels,
|
|
157
|
+
* optional icon and semantic `type`.
|
|
158
|
+
* @param containerHandler connector → core channel. Invoke
|
|
159
|
+
* `containerHandler.confirm()` or `containerHandler.dismiss()` based on
|
|
160
|
+
* the user's choice; core handles the rest.
|
|
161
|
+
*/
|
|
13
162
|
renderConfirmationModal(confirmationModalSettings: ConfirmationModalSettings, containerHandler: ConfirmationModalHandler): void;
|
|
163
|
+
/**
|
|
164
|
+
* Set the browser document title.
|
|
165
|
+
*
|
|
166
|
+
* Called from `Luigi.ux().setDocumentTitle()` and on `SET_DOCUMENT_TITLE_REQUEST`
|
|
167
|
+
* from a micro-frontend. The connector typically forwards to
|
|
168
|
+
* `document.title`; it may additionally reflect the title in UI (e.g. an
|
|
169
|
+
* acknowledgement toast).
|
|
170
|
+
*
|
|
171
|
+
* @param documentTitle new title string.
|
|
172
|
+
*/
|
|
14
173
|
setDocumentTitle(documentTitle: string): void;
|
|
15
|
-
|
|
174
|
+
/**
|
|
175
|
+
* Show a loading indicator. Called during navigation, on
|
|
176
|
+
* `SHOW_LOADING_INDICATOR_REQUEST` from a client, and around modal/drawer
|
|
177
|
+
* open.
|
|
178
|
+
*
|
|
179
|
+
* @param container when provided, scope the indicator to this subtree
|
|
180
|
+
* (typically the parent of a micro-frontend container that is still
|
|
181
|
+
* handshaking). When omitted, fall back to a shell-wide busy indicator.
|
|
182
|
+
*/
|
|
16
183
|
showLoadingIndicator(container?: HTMLElement): void;
|
|
184
|
+
/**
|
|
185
|
+
* Hide a previously shown loading indicator. Called once a micro-frontend
|
|
186
|
+
* reports `INITIALIZED`, when navigation completes, and on
|
|
187
|
+
* `HIDE_LOADING_INDICATOR_REQUEST` from a client.
|
|
188
|
+
*
|
|
189
|
+
* @param container scoping rules match {@link LuigiConnector.showLoadingIndicator}.
|
|
190
|
+
*/
|
|
17
191
|
hideLoadingIndicator(container?: HTMLElement): void;
|
|
192
|
+
/**
|
|
193
|
+
* Show a page-level backdrop, typically dimming the main content while a
|
|
194
|
+
* micro-frontend displays its own overlay.
|
|
195
|
+
*
|
|
196
|
+
* Core does not refcount calls — it mirrors client `ADD_BACKDROP_REQUEST`
|
|
197
|
+
* events one-to-one. If a connector needs nesting semantics it must
|
|
198
|
+
* implement them itself.
|
|
199
|
+
*/
|
|
18
200
|
addBackdrop(): void;
|
|
201
|
+
/**
|
|
202
|
+
* Hide the page-level backdrop. Counterpart to `addBackdrop`; same
|
|
203
|
+
* no-refcount caveat applies.
|
|
204
|
+
*/
|
|
19
205
|
removeBackdrop(): void;
|
|
20
|
-
|
|
206
|
+
/**
|
|
207
|
+
* Open the user-settings dialog.
|
|
208
|
+
*
|
|
209
|
+
* Core invokes `dialogSettings.renderMicroFrontendContainer(viewUrl, groupKey)`
|
|
210
|
+
* (which it installs before calling this method) to mount per-group MFEs
|
|
211
|
+
* inside the dialog, and `dialogSettings.onCloseCallback(stored, previous)`
|
|
212
|
+
* when the dialog closes — the connector is responsible for calling both
|
|
213
|
+
* at the appropriate moments.
|
|
214
|
+
*
|
|
215
|
+
* @param dialogSettings dialog header, save/dismiss button labels, plus
|
|
216
|
+
* the two core-installed hooks (`renderMicroFrontendContainer`,
|
|
217
|
+
* `onCloseCallback`) the connector must invoke.
|
|
218
|
+
* @param userSettingData static schema describing the available
|
|
219
|
+
* user-settings groups (one entry per group).
|
|
220
|
+
* @param previousUserSettings persisted user-settings state to prefill
|
|
221
|
+
* the dialog with, or `null` on first open.
|
|
222
|
+
*/
|
|
223
|
+
openUserSettings(dialogSettings: UserSettingsDialogSettings, userSettingData: Record<string, any>[], previousUserSettings: Record<string, any> | null): void;
|
|
224
|
+
/**
|
|
225
|
+
* Close a user-settings dialog opened via `openUserSettings`.
|
|
226
|
+
* Called from `Luigi.ux().closeUserSettings()` and on
|
|
227
|
+
* `CLOSE_USER_SETTINGS_REQUEST` from a client.
|
|
228
|
+
*/
|
|
21
229
|
closeUserSettings(): void;
|
|
230
|
+
/**
|
|
231
|
+
* Notify the connector that Luigi's current locale changed.
|
|
232
|
+
*
|
|
233
|
+
* Push-only — heads typically use this to re-translate shell chrome or to
|
|
234
|
+
* reflect the change in their own UI.
|
|
235
|
+
*
|
|
236
|
+
* @param locale BCP-47 locale tag (e.g. `'en'`, `'de-DE'`).
|
|
237
|
+
*/
|
|
22
238
|
setCurrentLocale(locale: string): void;
|
|
23
|
-
|
|
239
|
+
/**
|
|
240
|
+
* Apply updated settings to the currently open modal (title, size, …).
|
|
241
|
+
*
|
|
242
|
+
* Called from `Luigi.ux().updateModalSettings()`, from client
|
|
243
|
+
* `UPDATE_MODAL_SETTINGS_REQUEST`, and from the routing service when
|
|
244
|
+
* modal-in-URL state changes. No-op if no modal is open (core guards
|
|
245
|
+
* before forwarding).
|
|
246
|
+
*
|
|
247
|
+
* @param modalSettings the **merged** result (existing settings ⊕
|
|
248
|
+
* updates) — apply as-is, do not attempt to diff against previous
|
|
249
|
+
* state.
|
|
250
|
+
*/
|
|
24
251
|
updateModalSettings(modalSettings: ModalSettings): void;
|
|
252
|
+
/**
|
|
253
|
+
* Display an unrecoverable error and halt further interaction.
|
|
254
|
+
*
|
|
255
|
+
* Currently invoked only for fatal config-loading failures
|
|
256
|
+
* (`config-helpers.ts → setErrorMessage`). Not a general runtime-error
|
|
257
|
+
* channel — those flow through `runTimeErrorHandler` on nodes.
|
|
258
|
+
*
|
|
259
|
+
* @param error human-readable error message to display.
|
|
260
|
+
*/
|
|
25
261
|
showFatalError(error: string): void;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
262
|
+
/**
|
|
263
|
+
* Return a bag of getters for shell-owned DOM regions that micro-frontends
|
|
264
|
+
* can reach via `Luigi.elements()` (shellbar, shellbar actions, the Luigi
|
|
265
|
+
* container, the side-nav footer area).
|
|
266
|
+
*
|
|
267
|
+
* Each getter is invoked lazily on access, so the connector may resolve
|
|
268
|
+
* elements at call time rather than caching them at construction.
|
|
269
|
+
*
|
|
270
|
+
* @returns an object exposing one getter per supported shell region; each
|
|
271
|
+
* returns the element if present, or `null` if the region is not part
|
|
272
|
+
* of this head's layout.
|
|
273
|
+
*/
|
|
274
|
+
getCoreAPISupportedElements(): CoreAPISupportedElements;
|
|
275
|
+
/**
|
|
276
|
+
* Tear down all shell DOM and listeners created by the connector.
|
|
277
|
+
*
|
|
278
|
+
* Called from `Luigi.unload()`. After this, core may later call
|
|
279
|
+
* `renderMainLayout()` again on a fresh `Luigi.setConfig()` cycle, so the
|
|
280
|
+
* connector must leave itself in a state where re-bootstrapping works.
|
|
281
|
+
*/
|
|
32
282
|
unload(): void;
|
|
283
|
+
/**
|
|
284
|
+
* Return an imperative handle for driving the global-search UI, or omit
|
|
285
|
+
* this method entirely if the head does not surface global search. Core
|
|
286
|
+
* calls the returned handler in response to `Luigi.globalSearch().*` API
|
|
287
|
+
* calls and search-related navigation.
|
|
288
|
+
*
|
|
289
|
+
* @returns the global-search handler, or `undefined` if the head exposes
|
|
290
|
+
* no search UI at this moment.
|
|
291
|
+
*/
|
|
292
|
+
getGlobalSearchHandler?(): GlobalSearchHandler;
|
|
33
293
|
}
|
|
34
294
|
export type { Node };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM elements the connector exposes to Luigi's core API.
|
|
3
|
+
*
|
|
4
|
+
* Returned from `LuigiConnector.getCoreAPISupportedElements()` and consumed by
|
|
5
|
+
* `Luigi.elements()` to give micro-frontend authors access to shell-owned
|
|
6
|
+
* regions of the page.
|
|
7
|
+
*/
|
|
8
|
+
export interface CoreAPISupportedElements {
|
|
9
|
+
getShellbarElement(): HTMLElement | null;
|
|
10
|
+
getShellbarActions(): HTMLElement | null;
|
|
11
|
+
getLuigiContainer(): HTMLElement | null;
|
|
12
|
+
getNavFooterContainer(): HTMLElement | null;
|
|
13
|
+
}
|