@luigi-project/core-modular 0.0.19 → 0.0.20-dev.202610210048
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/navigation.d.ts +14 -1
- package/luigi-engine.d.ts +3 -3
- package/luigi.js +194 -79
- package/luigi.js.map +1 -1
- package/modules/ui-module.d.ts +3 -3
- package/package.json +1 -1
- package/services/navigation.service.d.ts +13 -1
- package/services/routing.service.d.ts +2 -1
- package/types/connector.d.ts +10 -8
- package/types/navigation.d.ts +10 -10
- package/utilities/helpers/routing-helpers.d.ts +15 -1
- package/utilities/helpers/usersetting-dialog-helpers.d.ts +13 -0
package/modules/ui-module.d.ts
CHANGED
|
@@ -11,9 +11,9 @@ export declare const UIModule: {
|
|
|
11
11
|
drawerContainer: any;
|
|
12
12
|
init: (luigi: Luigi) => void;
|
|
13
13
|
update: (scopes?: string[]) => Promise<void>;
|
|
14
|
-
updateMainContent: (currentNode: Node, luigi: Luigi, luigiParams?: LuigiParams, withoutSync?: boolean, preventContextUpdate?: boolean) => Promise<void>;
|
|
14
|
+
updateMainContent: (currentNode: Node, luigi: Luigi, luigiParams?: LuigiParams, withoutSync?: boolean, preventContextUpdate?: boolean, preserveView?: boolean) => Promise<void>;
|
|
15
15
|
openModal: (luigi: Luigi, node: Node, modalSettings: ModalSettings, onCloseCallback?: (goBackValue?: any) => void, luigiParams?: LuigiParams) => Promise<void>;
|
|
16
16
|
updateModalSettings: (modalSettings: ModalSettings, addHistoryEntry: boolean, luigi: Luigi) => void;
|
|
17
|
-
openDrawer: (luigi: Luigi, node: Node, drawerSettings: DrawerSettings, onCloseCallback?: () => void, luigiParams?: LuigiParams) => Promise<void>;
|
|
18
|
-
openUserSettings: (userSettingsDialogSettings: UserSettingsDialogSettings, userSettingData: any, previousUserSettings: any, luigi: Luigi) => Promise<void>;
|
|
17
|
+
openDrawer: (luigi: Luigi, node: Node, drawerSettings: DrawerSettings, onCloseCallback?: (goBackValue?: any) => void, luigiParams?: LuigiParams) => Promise<void>;
|
|
18
|
+
openUserSettings: (userSettingsDialogSettings: UserSettingsDialogSettings, userSettingData: any, previousUserSettings: any, initialUserSettings: any, luigi: Luigi) => Promise<void>;
|
|
19
19
|
};
|
package/package.json
CHANGED
|
@@ -4,12 +4,24 @@ import { ModalService } from './modal.service';
|
|
|
4
4
|
import { NodeDataManagementService } from './node-data-management.service';
|
|
5
5
|
export declare class NavigationService {
|
|
6
6
|
private luigi;
|
|
7
|
+
_preservedViews: any[];
|
|
7
8
|
modalService?: ModalService;
|
|
8
9
|
nodeDataManagementService?: NodeDataManagementService;
|
|
10
|
+
private goBackContext;
|
|
9
11
|
private previousBreadcrumbs;
|
|
10
12
|
constructor(luigi: Luigi);
|
|
11
13
|
private getModalService;
|
|
12
14
|
private getNodeDataManagementService;
|
|
15
|
+
private handleDialogContainer;
|
|
16
|
+
private prepareGoBackContextForNavigation;
|
|
17
|
+
clearGoBackContext(): void;
|
|
18
|
+
getGoBackContext(): Record<string, any> | null;
|
|
19
|
+
clearPreservedViews(): void;
|
|
20
|
+
removeLastPreservedView(): void;
|
|
21
|
+
getPreservedViewsLength(): number;
|
|
22
|
+
isValidBackRoute(route: string): boolean;
|
|
23
|
+
processGoBackContext(goBackContext: any): void;
|
|
24
|
+
handleGoBackRequest(goBackContext?: any): void;
|
|
13
25
|
getPathData(path: string): Promise<PathData>;
|
|
14
26
|
findMatchingNode(urlPathElement: string, nodes: Node[]): Node | undefined;
|
|
15
27
|
buildNavItems(nodes: Node[], selectedNode: Node | undefined, pathData: PathData): Promise<{
|
|
@@ -73,7 +85,7 @@ export declare class NavigationService {
|
|
|
73
85
|
* Deal with route changing scenario.
|
|
74
86
|
* @param {NavigationRequestParams} params - the params to configure navigation request
|
|
75
87
|
* @param {string} params.path - the path of the view to open
|
|
76
|
-
* @param {
|
|
88
|
+
* @param {boolean} params.preserveView - preserve a view by setting it to specific value (optional)
|
|
77
89
|
* @param {any} params.modalSettings - settings to configure the modal's title and size (optional)
|
|
78
90
|
* @param {boolean} params.newTab - open a view in new tab by setting it to `true` (optional)
|
|
79
91
|
* @param {boolean} params.withoutSync - disables the navigation handling for a single navigation request (optional)
|
|
@@ -38,12 +38,13 @@ export declare class RoutingService {
|
|
|
38
38
|
* @param {Object} routeInfo - the information about path and query
|
|
39
39
|
* @param {boolean} withoutSync - disables the navigation handling for a single navigation request
|
|
40
40
|
* @param {boolean} preventContextUpdate - make no context update being triggered
|
|
41
|
+
* @param {boolean} preserveView - preserve a view by setting it to true
|
|
41
42
|
* @returns {Promise<void>} A promise that resolves when route change is complete.
|
|
42
43
|
*/
|
|
43
44
|
handleRouteChange(routeInfo: {
|
|
44
45
|
path: string;
|
|
45
46
|
query: string;
|
|
46
|
-
}, withoutSync?: boolean, preventContextUpdate?: boolean): Promise<void>;
|
|
47
|
+
}, withoutSync?: boolean, preventContextUpdate?: boolean, preserveView?: boolean): Promise<void>;
|
|
47
48
|
getCurrentRoute(): Route | undefined;
|
|
48
49
|
/**
|
|
49
50
|
* If `showModalPathInUrl` is provided, bookmarkable modal path will be triggered.
|
package/types/connector.d.ts
CHANGED
|
@@ -220,19 +220,21 @@ export interface LuigiConnector {
|
|
|
220
220
|
*
|
|
221
221
|
* Core invokes `dialogSettings.renderMicroFrontendContainer(viewUrl, groupKey)`
|
|
222
222
|
* (which it installs before calling this method) to mount per-group MFEs
|
|
223
|
-
* inside the dialog, and `dialogSettings.onCloseCallback(stored
|
|
224
|
-
*
|
|
225
|
-
*
|
|
223
|
+
* inside the dialog, and `dialogSettings.onCloseCallback(stored)` when the
|
|
224
|
+
* dialog closes — the connector is responsible for calling both at the
|
|
225
|
+
* appropriate moments.
|
|
226
226
|
*
|
|
227
|
-
* @param dialogSettings dialog header, save/dismiss button labels, plus
|
|
228
|
-
*
|
|
227
|
+
* @param dialogSettings dialog header, save/dismiss button labels, plus the
|
|
228
|
+
* two core-installed hooks (`renderMicroFrontendContainer`,
|
|
229
229
|
* `onCloseCallback`) the connector must invoke.
|
|
230
230
|
* @param userSettingData static schema describing the available
|
|
231
231
|
* user-settings groups (one entry per group).
|
|
232
|
-
* @param
|
|
233
|
-
* the dialog
|
|
232
|
+
* @param initialUserSettings the complete settings object the connector
|
|
233
|
+
* should use as the dialog's initial state — defaults for every configured
|
|
234
|
+
* setting, overlaid with the persisted values. Core builds this, so the
|
|
235
|
+
* connector never has to prefill defaults itself.
|
|
234
236
|
*/
|
|
235
|
-
openUserSettings(dialogSettings: UserSettingsDialogSettings, userSettingData: Record<string, any>[],
|
|
237
|
+
openUserSettings(dialogSettings: UserSettingsDialogSettings, userSettingData: Record<string, any>[], initialUserSettings: Record<string, any>): void;
|
|
236
238
|
/**
|
|
237
239
|
* Close a user-settings dialog opened via `openUserSettings`.
|
|
238
240
|
* Called from `Luigi.ux().closeUserSettings()` and on
|
package/types/navigation.d.ts
CHANGED
|
@@ -89,7 +89,7 @@ export interface UserSettingsDialogSettings {
|
|
|
89
89
|
saveBtn?: string;
|
|
90
90
|
dismissBtn?: string;
|
|
91
91
|
renderMicroFrontendContainer?: (viewUrl: string, groupKey: string) => Promise<any>;
|
|
92
|
-
onCloseCallback?: (storedUserSettings: any
|
|
92
|
+
onCloseCallback?: (storedUserSettings: any) => void;
|
|
93
93
|
}
|
|
94
94
|
export interface UserInfo {
|
|
95
95
|
name?: string;
|
|
@@ -298,6 +298,7 @@ export interface NavigationOptions {
|
|
|
298
298
|
nodeParams?: Record<string, any>;
|
|
299
299
|
}
|
|
300
300
|
export interface NavigationRequestBase {
|
|
301
|
+
preserveView?: boolean;
|
|
301
302
|
preventContextUpdate?: boolean;
|
|
302
303
|
preventHistoryEntry?: boolean;
|
|
303
304
|
withoutSync?: boolean;
|
|
@@ -309,27 +310,26 @@ export interface NavigationRequestParams extends NavigationRequestBase {
|
|
|
309
310
|
modalSettings?: any;
|
|
310
311
|
newTab?: boolean;
|
|
311
312
|
path: string;
|
|
312
|
-
preserveView?: string;
|
|
313
313
|
}
|
|
314
314
|
export interface NavigationRequestEvent {
|
|
315
315
|
detail: NavigationRequestBase;
|
|
316
316
|
}
|
|
317
317
|
export interface NavigationRequestDetail {
|
|
318
318
|
drawer: unknown;
|
|
319
|
-
|
|
319
|
+
fromClosestContext: boolean;
|
|
320
|
+
fromContext: string | null;
|
|
321
|
+
fromParent: boolean;
|
|
322
|
+
fromVirtualTreeRoot: boolean;
|
|
320
323
|
intent: boolean;
|
|
321
|
-
|
|
324
|
+
link: string;
|
|
322
325
|
modal: unknown;
|
|
323
326
|
newTab: boolean;
|
|
324
|
-
|
|
327
|
+
nodeParams: Record<string, string>;
|
|
328
|
+
preserveView: boolean;
|
|
325
329
|
preventContextUpdate: boolean;
|
|
326
330
|
preventHistoryEntry: boolean;
|
|
327
|
-
fromVirtualTreeRoot: boolean;
|
|
328
|
-
fromContext: string | null;
|
|
329
|
-
fromClosestContext: boolean;
|
|
330
|
-
fromParent: boolean;
|
|
331
331
|
relative: boolean;
|
|
332
|
-
|
|
332
|
+
withoutSync: boolean;
|
|
333
333
|
}
|
|
334
334
|
export type { CompoundConfig, LayoutConfig, RendererConfig } from './compound-config';
|
|
335
335
|
export interface TitleResolverCache {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FeatureToggles } from '../../core-api/feature-toggles';
|
|
2
2
|
import { Luigi } from '../../core-api/luigi';
|
|
3
|
-
import { Node, PathData } from '../../types/navigation';
|
|
3
|
+
import { Node, PathData, ModalSettings } from '../../types/navigation';
|
|
4
4
|
export declare const RoutingHelpers: {
|
|
5
5
|
defaultContentViewParamPrefix: string;
|
|
6
6
|
defaultQueryParamSeparator: string;
|
|
@@ -243,6 +243,20 @@ export declare const RoutingHelpers: {
|
|
|
243
243
|
*/
|
|
244
244
|
parseParams(paramsString: string): Record<string, string>;
|
|
245
245
|
getModalParamsFromPath(luigi: Luigi): any;
|
|
246
|
+
/**
|
|
247
|
+
* Returns only the modal settings that may be persisted in the bookmarkable
|
|
248
|
+
* `modalParams` query string. Everything else is dropped so non-bookmarkable
|
|
249
|
+
* settings never leak into the URL:
|
|
250
|
+
* - `nodeParams` are already serialized onto the modal path
|
|
251
|
+
* - `closebtn_data_testid` is a rendering-only detail
|
|
252
|
+
*
|
|
253
|
+
* `keepPrevious` is only kept when truthy (its default/false state is noise).
|
|
254
|
+
* Properties are copied by explicit name (no computed property writes) to
|
|
255
|
+
* avoid remote property injection. Returns a shallow copy; the input is left untouched.
|
|
256
|
+
* @param {ModalSettings} modalParams modal settings about to be written to the URL
|
|
257
|
+
* @returns {Partial<ModalSettings>} a copy containing only the bookmarkable properties
|
|
258
|
+
*/
|
|
259
|
+
getBookmarkableModalParams(modalParams: ModalSettings): Partial<ModalSettings>;
|
|
246
260
|
/**
|
|
247
261
|
* Get the query param separator which is used with hashRouting
|
|
248
262
|
* Default:
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
declare class UserSettingsHelperClass {
|
|
2
2
|
processUserSettingGroups(userSettings: any, storedSettings: any): any[];
|
|
3
|
+
/**
|
|
4
|
+
* Builds the complete user-settings object that should be stored.
|
|
5
|
+
*
|
|
6
|
+
* Every setting defined in the configuration is prefilled with a default
|
|
7
|
+
* (empty string), then overlaid with the persisted values. This guarantees
|
|
8
|
+
* that the stored object always contains the full set of properties, not
|
|
9
|
+
* only the ones that were changed in the dialog (mirrors Luigi core).
|
|
10
|
+
*
|
|
11
|
+
* @param userSettingData schema as returned by `processUserSettingGroups`
|
|
12
|
+
* @param previousUserSettings persisted user-settings state, or `null`/`{}`
|
|
13
|
+
* @returns a settings object keyed by group, each group prefilled with defaults
|
|
14
|
+
*/
|
|
15
|
+
prepareUserSettingsObj(userSettingData: any[], previousUserSettings: Record<string, any> | null): Record<string, any>;
|
|
3
16
|
getUserSettingsIframesInDom(): HTMLElement[];
|
|
4
17
|
hideUserSettingsIframe(): void;
|
|
5
18
|
findActiveCustomUserSettingsIframe(eventSource: any): any;
|