@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/core-api/luigi.d.ts +12 -0
- package/luigi.js +12 -12
- package/luigi.js.map +1 -1
- package/package.json +1 -1
- package/services/i18n.service.d.ts +1 -2
- package/types/connector.d.ts +1 -0
- package/utilities/helpers/generic-helpers.d.ts +1 -1
- package/utilities/helpers/i18n-helpers.d.ts +3 -0
- package/utilities/helpers/routing-helpers.d.ts +25 -1
package/package.json
CHANGED
|
@@ -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
|
|
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
|
package/types/connector.d.ts
CHANGED
|
@@ -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
|
|
@@ -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
|
-
|
|
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.
|