@luigi-project/core-modular 0.0.6 → 0.0.7-dev.202604290103

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.
@@ -1,7 +1,7 @@
1
1
  import { Luigi } from '../core-api/luigi';
2
2
  import { NavigationService } from '../services/navigation.service';
3
3
  import { RoutingService } from '../services/routing.service';
4
- import { ModalSettings, Node } from '../types/navigation';
4
+ import { DrawerSettings, ModalSettings, Node } from '../types/navigation';
5
5
  import { LuigiParams } from '../types/routing';
6
6
  export declare const UIModule: {
7
7
  navService: NavigationService;
@@ -14,5 +14,5 @@ export declare const UIModule: {
14
14
  updateMainContent: (currentNode: Node, luigi: Luigi, luigiParams?: LuigiParams, withoutSync?: boolean, preventContextUpdate?: boolean) => Promise<void>;
15
15
  openModal: (luigi: Luigi, node: Node, modalSettings: ModalSettings, onCloseCallback?: () => void) => Promise<void>;
16
16
  updateModalSettings: (modalSettings: ModalSettings, addHistoryEntry: boolean, luigi: Luigi) => void;
17
- openDrawer: (luigi: Luigi, node: Node, drawerSettings: ModalSettings, onCloseCallback?: () => void) => Promise<void>;
17
+ openDrawer: (luigi: Luigi, node: Node, drawerSettings: DrawerSettings, onCloseCallback?: () => void) => Promise<void>;
18
18
  };
package/package.json CHANGED
@@ -18,5 +18,5 @@
18
18
  "micro-frontends",
19
19
  "microfrontends"
20
20
  ],
21
- "version": "0.0.6"
21
+ "version": "0.0.7-dev.202604290103"
22
22
  }
@@ -31,7 +31,8 @@ export declare class NavigationService {
31
31
  getParentNode(node: Node | undefined, pathData: PathData): Node | undefined;
32
32
  getAppSwitcherData(appSwitcherData: AppSwitcher, headerSettings: any): AppSwitcher | undefined;
33
33
  getTabNavData(path: string, pData?: PathData): Promise<TabNavData>;
34
- getBreadcrumbData(path: string, pData?: PathData): Promise<BreadcrumbData>;
34
+ getBreadcrumbData(path: string, pData?: PathData, onResolve?: (data: BreadcrumbData) => void): Promise<BreadcrumbData>;
35
+ private resolveBreadcrumbTitles;
35
36
  /**
36
37
  * Handles changes between navigation nodes by invoking a configured hook function.
37
38
  *
@@ -1,12 +1,12 @@
1
1
  import { AlertHandler, AlertSettings, ConfirmationModalHandler, ConfirmationModalSettings, UserSettings } from '../modules/ux-module';
2
- import { ModalSettings, LeftNavData, Node, TopNavData, TabNavData, BreadcrumbData } from './navigation';
2
+ import { ModalSettings, LeftNavData, Node, TopNavData, TabNavData, BreadcrumbData, DrawerSettings } from './navigation';
3
3
  export interface LuigiConnector {
4
4
  renderMainLayout(): void;
5
5
  renderTopNav(data: TopNavData): void;
6
6
  renderLeftNav(data: LeftNavData): void;
7
7
  getContainerWrapper(): HTMLElement;
8
8
  renderModal(content: HTMLElement, modalSettings: ModalSettings, onCloseCallback?: () => void, onCloseRequest?: () => void): any;
9
- renderDrawer(content: HTMLElement, modalSettings: ModalSettings, onCloseCallback?: () => void): any;
9
+ renderDrawer(content: HTMLElement, modalSettings: DrawerSettings, onCloseCallback?: () => void): any;
10
10
  renderTabNav(data: TabNavData): void;
11
11
  renderBreadcrumbs(data: BreadcrumbData): void;
12
12
  renderAlert(alertSettings: AlertSettings, alertHandler: AlertHandler): void;
@@ -92,7 +92,7 @@ export interface Node {
92
92
  };
93
93
  compound?: CompoundConfig;
94
94
  context?: Record<string, any>;
95
- drawer?: ModalSettings;
95
+ drawer?: DrawerSettings;
96
96
  decodeViewUrl?: boolean;
97
97
  externalLink?: ExternalLink;
98
98
  hideFromNav?: boolean;
@@ -113,6 +113,7 @@ export interface Node {
113
113
  runTimeErrorHandler?: RunTimeErrorHandler;
114
114
  showBreadcrumbs?: boolean;
115
115
  tabNav?: boolean;
116
+ titleResolver?: TitleResolver;
116
117
  tooltipText?: string;
117
118
  userSettingsGroup?: string;
118
119
  viewUrl?: string;
@@ -176,6 +177,12 @@ export interface BreadcrumbData {
176
177
  renderer?: any;
177
178
  selectedNode?: Node;
178
179
  }
180
+ export interface DrawerSettings {
181
+ backdrop?: boolean;
182
+ header?: any;
183
+ overlap?: boolean;
184
+ size?: 'l' | 'm' | 's' | 'xs';
185
+ }
179
186
  export interface ModalSettings {
180
187
  size?: 'fullscreen' | 'l' | 'm' | 's';
181
188
  width?: string;
@@ -434,4 +441,28 @@ export interface RendererConfig {
434
441
  maxWidth?: number;
435
442
  }>;
436
443
  }
444
+ export interface TitleResolverCache {
445
+ key: string;
446
+ value: {
447
+ label: string;
448
+ icon?: string;
449
+ };
450
+ }
451
+ export interface TitleResolver {
452
+ request: {
453
+ method: string;
454
+ url: string;
455
+ headers?: Record<string, string>;
456
+ body?: any;
457
+ };
458
+ titlePropertyChain: string;
459
+ titleDecorator?: string;
460
+ iconPropertyChain?: string;
461
+ prerenderFallback?: boolean;
462
+ responsePath?: string;
463
+ fallbackTitle?: string;
464
+ fallbackIcon?: string;
465
+ /** @internal runtime cache – not user-configured */
466
+ _cache?: TitleResolverCache;
467
+ }
437
468
  export type HistoryMethod = 'pushState' | 'replaceState';
@@ -0,0 +1,8 @@
1
+ declare class CustomMessagesHelpersClass {
2
+ filterIdFromMessageObject(message: Record<string, any>): {
3
+ id: string | undefined;
4
+ messageWithoutId: Record<string, any>;
5
+ };
6
+ }
7
+ export declare const CustomMessagesHelpers: CustomMessagesHelpersClass;
8
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { Luigi } from '../../core-api/luigi';
2
+ import { default as LuigiContainer } from '@luigi-project/container/LuigiContainer.svelte';
2
3
  export type MicrofrontendEntry = {
3
4
  iframe: HTMLElement;
4
5
  id: string;
@@ -15,4 +16,5 @@ export declare const LuigiContainerHelpers: {
15
16
  getMainMicrofrontends(luigi: Luigi): MicrofrontendEntry[];
16
17
  getModalMicrofrontends(): MicrofrontendEntry[];
17
18
  getDrawerMicrofrontends(): MicrofrontendEntry;
19
+ getAllLuigiContainerIframe(luigi: Luigi): LuigiContainer[] | undefined;
18
20
  };
@@ -1,6 +1,6 @@
1
1
  import { FeatureToggles } from '../../core-api/feature-toggles';
2
2
  import { Luigi } from '../../core-api/luigi';
3
- import { AppSwitcher, Node, PathData } from '../../types/navigation';
3
+ import { AppSwitcher, Node, PathData, TitleResolver } from '../../types/navigation';
4
4
  export declare const NavigationHelpers: {
5
5
  normalizePath: (raw: string) => string;
6
6
  segmentMatches: (linkSegment: string, pathSegment: string, pathParams: Record<string, any>) => boolean;
@@ -27,4 +27,22 @@ export declare const NavigationHelpers: {
27
27
  * @returns The redirect path if valid, undefined otherwise
28
28
  */
29
29
  validatePathAndGetRedirect: (path: string, luigi: Luigi) => Promise<string | undefined>;
30
+ fetchNodeTitleData(node: Node, context: any): Promise<{
31
+ label: string;
32
+ icon?: string;
33
+ }>;
34
+ /**
35
+ * Returns a nested property value defined by a chain string
36
+ * @param {*} obj - the object
37
+ * @param {*} propChain - a string defining the property chain
38
+ * @param {*} fallback - fallback value if resolution fails
39
+ * @returns the value or fallback
40
+ */
41
+ getPropertyChainValue(obj: Record<string, unknown>, propChain?: string, fallback?: any): any;
42
+ substituteVars(resolver: TitleResolver, context: Record<string, unknown>): TitleResolver;
43
+ _fetch(url: string, options: RequestInit): Promise<Response>;
44
+ processTitleData(data: Record<string, unknown>, resolver: TitleResolver): {
45
+ label: string;
46
+ icon?: string;
47
+ };
30
48
  };