@luigi-project/core-modular 0.0.3-dev.20260360050 → 0.0.3-dev.20260380047

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/package.json CHANGED
@@ -18,5 +18,5 @@
18
18
  "micro-frontends",
19
19
  "microfrontends"
20
20
  ],
21
- "version": "0.0.3-dev.20260360050"
21
+ "version": "0.0.3-dev.20260380047"
22
22
  }
@@ -1,5 +1,5 @@
1
1
  import { Luigi } from '../core-api/luigi';
2
- import { AppSwitcher, LeftNavData, NavigationRequestParams, NavItem, Node, PathData, TabNavData, TopNavData } from '../types/navigation';
2
+ import { AppSwitcher, LeftNavData, NavigationOptions, NavigationRequestParams, NavItem, Node, PathData, TabNavData, TopNavData } from '../types/navigation';
3
3
  import { NodeDataManagementService } from './node-data-management.service';
4
4
  import { ModalService } from './modal.service';
5
5
  export declare class NavigationService {
@@ -87,7 +87,7 @@ export declare class NavigationService {
87
87
  * @param nodesInPath - An array of nodes representing the path in the virtual tree.
88
88
  * @param pathParams - An object containing path parameters for the virtual tree.
89
89
  */
90
- buildVirtualTree(node: Node, nodesInPath: any, pathParams: Record<string, any>): void;
90
+ buildVirtualTree(node: Node, segment: any, pathParams: Record<string, any>): Node[] | undefined;
91
91
  /**
92
92
  * Requires str to include :virtualPath
93
93
  * and pathParams consist of :virtualSegment_N
@@ -106,5 +106,5 @@ export declare class NavigationService {
106
106
  * @param fromVirtualTreeRoot - A boolean indicating whether to build the path from the virtual tree root.
107
107
  * @returns The constructed path string.
108
108
  */
109
- buildPath(incomingPath: string, fromVirtualTreeRoot?: boolean): Promise<string>;
109
+ buildPath(incomingPath: string, options: NavigationOptions): Promise<string>;
110
110
  }
@@ -97,6 +97,7 @@ export interface Node {
97
97
  isRootNode?: boolean;
98
98
  keepSelectedForChildren?: boolean;
99
99
  label?: string;
100
+ navigationContext?: string;
100
101
  onNodeActivation?: (node: Node) => boolean | void;
101
102
  openNodeInModal?: boolean;
102
103
  pageErrorHandler?: PageErrorHandler;
@@ -107,4 +107,16 @@ export declare const GenericHelpers: {
107
107
  * @returns
108
108
  */
109
109
  escapeRegExp(string: string): string;
110
+ /**
111
+ * Checks if a given input string begins with a hash or a slash
112
+ * @param {string} path
113
+ * @returns {boolean}
114
+ */
115
+ hasHashOrSlash: (path: string) => boolean;
116
+ /**
117
+ * Removes leading hash or slash of a string
118
+ * @param {string} path
119
+ * @returns {string}
120
+ */
121
+ getPathWithoutHashOrSlash: (path: string) => string;
110
122
  };
@@ -262,6 +262,14 @@ export declare const RoutingHelpers: {
262
262
  * @param {*} pathParams
263
263
  */
264
264
  getDynamicNodeValue(node: Node, pathParams: Record<string, string>): string | undefined;
265
+ /**
266
+ * Recursively constructs the full path for a given node by concatenating its path segment with those of its ancestors.
267
+ * If `params` are provided, they are appended as query parameters to the final path.
268
+ * @param node - The node for which to construct the path. It is expected to have a `pathSegment` property and optionally a `parent` property pointing to its parent node.
269
+ * @param params - Optional query parameters to append to the path. If provided, it should be a string in the format of URL query parameters (e.g., "key=value&anotherKey=anotherValue").
270
+ * @returns The constructed path as a string, including any query parameters if provided.
271
+ */
272
+ getNodePath(node: Node, params?: string): string;
265
273
  /**
266
274
  * Builds a route string by recursively traversing up the node hierarchy and concatenating path segments.
267
275
  * @param node - The current node from which to start building the route.
@@ -269,6 +277,25 @@ export declare const RoutingHelpers: {
269
277
  * @param params - Optional query parameters to append to the final route.
270
278
  * @returns a string representing the full route from the root to the given node, including query parameters if provided.
271
279
  */
272
- buildRoute(node: Node, path?: string, params?: string): string;
273
- substituteViewUrl(viewUrl: string, pathData: PathData, luigi: Luigi): string;
280
+ buildRoute(node: Node, path: string, params?: string): string;
281
+ substituteViewUrl(viewUrl: string, pathParams: Record<string, string>, luigi: Luigi): string;
282
+ /**
283
+ * Generates a sub-path for a given node by replacing dynamic parameters in the node's path with actual values from pathParams.
284
+ * @param node - The node for which to generate the sub-path. It is expected to have a `pathSegment` property and optionally a `parent` property pointing to its parent node.
285
+ * @param nodePathParams - An object containing the values for dynamic parameters in the node's path. The keys should match the parameter names in the path segments.
286
+ * @returns A string representing the sub-path with dynamic parameters replaced by their corresponding values from pathParams.
287
+ */
288
+ getSubPath(node: any, nodePathParams: any): string;
289
+ /**
290
+ * Concatenates a base path and a relative path
291
+ *
292
+ * The function performs the following steps:
293
+ * 1. Removes any trailing '/' from the base path.
294
+ * 2. If the relative path does not start with '/', it adds a '/' between the base and relative paths.
295
+ * 3. Concatenates the base path and the relative path.
296
+ * @param basePath The base path to which the relative path will be appended. It may or may not end with a '/' character.
297
+ * @param relativePath The relative path to append to the base path. It may or may not start with a '/' character.
298
+ * @returns A string representing the concatenated path, with exactly one '/' character between the base and relative paths.
299
+ */
300
+ concatenatePath(basePath: any, relativePath?: any): string;
274
301
  };