@luigi-project/core-modular 0.0.7-dev.202605150106 → 0.0.7-dev.202605170109

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.7-dev.202605150106"
21
+ "version": "0.0.7-dev.202605170109"
22
22
  }
@@ -1,4 +1,3 @@
1
- import { LuigiContainer, LuigiCompoundContainer } from '@luigi-project/container';
2
1
  import { Luigi } from '../core-api/luigi';
3
2
  /**
4
3
  * Localization-related functions
@@ -21,7 +20,7 @@ export declare class i18nService {
21
20
  * Sets current locale to the specified one.
22
21
  * @param {string} locale locale to be set as the current locale
23
22
  */
24
- setCurrentLocale(locale: string, containerElement?: LuigiContainer | LuigiCompoundContainer): void;
23
+ setCurrentLocale(locale: string): void;
25
24
  /**
26
25
  * Registers a listener for locale changes.
27
26
  * @param {Function} listener function called on every locale change with the new locale as argument
@@ -29,5 +29,6 @@ export interface LuigiConnector {
29
29
  getLuigiContainer(): HTMLElement | null;
30
30
  getNavFooterContainer(): HTMLElement | null;
31
31
  };
32
+ unload(): void;
32
33
  }
33
34
  export type { Node };
@@ -124,7 +124,7 @@ export declare const GenericHelpers: {
124
124
  * @param parenthesis
125
125
  * @returns
126
126
  */
127
- replaceVars(inputString: string, params: Record<string, any>, prefix: string, parenthesis?: boolean): string;
127
+ replaceVars(inputString: string, params: Record<string, any>, prefix: string, parenthesis?: boolean, slashStop?: boolean): string;
128
128
  /**
129
129
  * Escapes special characters in a string for use in a regular expression.
130
130
  * @param string
@@ -0,0 +1,3 @@
1
+ export declare class I18nHelpers {
2
+ static hasLocaleChangePermission(containerElement: any): boolean;
3
+ }
@@ -323,7 +323,31 @@ export declare const RoutingHelpers: {
323
323
  * @returns a string representing the full route from the root to the given node, including query parameters if provided.
324
324
  */
325
325
  buildRoute(node: Node, path: string, params?: string): string;
326
- substituteViewUrl(node: Node, pathParams: Record<string, string>, luigi: Luigi): string;
326
+ /**
327
+ * Resolves the final view URL for a given node by substituting dynamic placeholders with actual values.
328
+ *
329
+ * Performs the following substitutions in order:
330
+ * 1. Removes `{virtualTreePath}` if the node is a virtual tree.
331
+ * 2. Replaces path parameters (e.g. `:id`) with their concrete values from `pathParams`.
332
+ * 3. Replaces context variables (e.g. `{context.myVar}`) with values from `node.context`.
333
+ * 4. Replaces node parameter variables (e.g. `{nodeParams.myParam}`) with values from `nodeParams`.
334
+ * 5. Replaces `{i18n.currentLocale}` with the current locale.
335
+ * 6. Replaces `{routing.queryParams.<key>}` with the corresponding search parameter value,
336
+ * or removes the query parameter from the URL if the value is not present.
337
+ *
338
+ * @param node - The navigation node containing the `viewUrl` template and optional `context`/`virtualTree` properties.
339
+ * @param pathParams - A map of path parameter names to their resolved values (e.g. `{ id: '42' }`).
340
+ * @param nodeParams - A map of node-specific parameters passed to the micro frontend.
341
+ * @param luigi - The Luigi instance used to access i18n, routing, and configuration.
342
+ * @returns The fully resolved view URL string, or an empty string if `node.viewUrl` is not defined.
343
+ */
344
+ substituteViewUrl(node: Node, pathParams: Record<string, string>, nodeParams: Record<string, any>, luigi: Luigi): string;
345
+ /**
346
+ * Returns the viewUrl with current locale, e.g. luigi/{i18n.currentLocale}/ -> luigi/en
347
+ * if viewUrl contains {i18n.currentLocale} term, it will be replaced by current locale
348
+ * @param viewUrl
349
+ */
350
+ getI18nViewUrl(viewUrl: string, luigi: Luigi): string;
327
351
  /**
328
352
  * Generates a sub-path for a given node by replacing dynamic parameters in the node's path with actual values from pathParams.
329
353
  * @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.