@luigi-project/client-support-angular 21.1.0 → 22.0.0-dev.202606130119

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/README.md CHANGED
@@ -12,11 +12,11 @@ If you want to know more about Luigi, please have a look at the [Luigi homepage]
12
12
  npm install @luigi-project/client-support-angular -s
13
13
  ```
14
14
 
15
- 2. Once the library is imported and saved in your Angular project, provide the module `LuigiAngularSupportModule` in your app configuration:
15
+ 2. Once the library is imported and saved in your Angular project, add necessary providers in your app configuration:
16
16
 
17
17
  ```javascript
18
18
  providers: [
19
- importProvidersFrom(LuigiAngularSupportModule)
19
+ provideLuigiAngular()
20
20
  ]
21
21
  ```
22
22
 
@@ -60,7 +60,7 @@ constructor(private luigiContextService: LuigiContextService) {
60
60
 
61
61
  // check context data via Signal
62
62
  effect(() => {
63
- const data: IContextMessage = luigiContextService.contextSignal()();
63
+ const data: IContextMessage = luigiContextService.contextSignal();
64
64
 
65
65
  if (data) {
66
66
  this.contextSignal.set(data.context || {});
@@ -92,23 +92,46 @@ providers: [
92
92
  ]
93
93
  ```
94
94
 
95
+ ### Preload component
96
+ This library offers a preload component which allows Luigi to preload Angular micro frontends in the background and improving navigation performance when switching between view groups.
97
+
98
+ #### Add the preload route
99
+ ```javascript
100
+ import { LuigiPreloadComponent } from '@luigi-project/client-support-angular';
101
+ ...
102
+ { path: 'luigi-client-support-preload', component: LuigiPreloadComponent }
103
+ ```
104
+ #### Example Luigi config
105
+ To enable it in luigi config it needs to be set like this:
106
+ ```javascript
107
+ Luigi.setConfig({
108
+ navigation: {
109
+ preloadViewGroups: true,
110
+ viewGroupSettings: {
111
+ vg1: {
112
+ preloadUrl: 'https://path.to.angular.app#/luigi-client-support-preload'
113
+ }
114
+ },
115
+ nodes: () => [...]
116
+ }
117
+ })
118
+ ```
119
+ Detailed information can be found [here](https://docs.luigi-project.io/docs/navigation-parameters-reference?section=preloadviewgroups) and in the [advanced section](https://docs.luigi-project.io/docs/navigation-advanced?section=view-groups)
120
+
95
121
  ### LuigiAutoRoutingService
96
122
 
97
123
  This service cannot be used directly, but it provides useful features on how to synchronize your Angular application with Luigi navigation.
98
124
 
99
125
  For example, when the user navigates through different pages within a micro frontend, you can use this feature to update Luigi accordingly. (You can also find more information about this process in the [micro frontend routing](https://docs.luigi-project.io/docs/microfrontend-routing) document.)
100
126
 
101
- ### Preload component
102
-
103
- In your Angular route configuration, you can add in any of the following preload components:
104
-
127
+ #### Examples
105
128
  ```javascript
106
- {path: 'luigi-client-support-preload',component: Sample1Component,data: { fromVirtualTreeRoot: true }}
107
- {path: 'luigi-client-support-preload',component: Sample1Component,data: { fromVirtualTreeRoot: : {"truncate": "*/projects"} }}
108
- {path: 'luigi-client-support-preload',component: Sample1Component,data: { fromVirtualTreeRoot: : {"truncate": "/projects"} }}
109
- {path: 'luigi-client-support-preload',component: Sample2Component,data: { luigiRoute: '/home/sample2' }}
110
- {path: 'luigi-client-support-preload',component: Sample2Component,data: { luigiRoute: '/home/sample2', fromContext: true}}
111
- {path: 'luigi-client-support-preload',component: Sample2Component,data: { luigiRoute: '/home/sample2', fromContext: 'localContext'}}
129
+ {path: 'sample1',component: Sample1Component, data: { fromVirtualTreeRoot: true }}
130
+ {path: 'sample2',component: Sample2Component, data: { fromVirtualTreeRoot: : {"truncate": "*/projects"} }}
131
+ {path: 'sample3',component: Sample3Component, data: { fromVirtualTreeRoot: : {"truncate": "/projects"} }}
132
+ {path: 'sample4',component: Sample4Component, data: { luigiRoute: '/home/sample4' }}
133
+ {path: 'sample5',component: Sample5Component, data: { luigiRoute: '/home/sample5', fromContext: true}}
134
+ {path: 'sample6',component: Sample6Component, data: { luigiRoute: '/home/sample6', fromContext: 'localContext'}}
112
135
  ```
113
136
 
114
137
  Under the hood, these components make use of Luigi's [linkManager](https://docs.luigi-project.io/docs/luigi-client-api?section=linkmanager) in the following way:
@@ -124,22 +147,21 @@ For `data: { fromVirtualTreeRoot: true }`, once we load Sample1Component, this L
124
147
  ```
125
148
  In the above case, the specified string (e.g. `projects`) will be cut off from the beginning of the current micro frontend route before being sent to Luigi Core. This can be useful when the micro frontend is not served under the webroot, but under a subfolder. If the truncate string starts with `*`, the route will be truncated after the first occurrence of the string following `*`.
126
149
 
127
- For `data: { luigiRoute: '/home/sample2' }`, this Luigi Client API method is called:
150
+ For `data: { luigiRoute: '/home/sample4' }`, this Luigi Client API method is called:
128
151
  ```javascript
129
152
  luigiClient.linkManager().withoutSync().navigate(data.luigiRoute);
130
153
  ```
131
154
 
132
- For `data: { luigiRoute: '/home/sample2', fromContext: true }`, this Luigi Client API method is called:
155
+ For `data: { luigiRoute: '/home/sample5', fromContext: true }`, this Luigi Client API method is called:
133
156
  ```javascript
134
157
  luigiClient.linkManager().fromClosestContext().withoutSync().navigate(data.luigiRoute);
135
158
  ```
136
159
 
137
- For `data: { luigiRoute: '/home/sample2', fromContext: 'localContext' }`, this Luigi Client API method is called:
160
+ For `data: { luigiRoute: '/home/sample6', fromContext: 'localContext' }`, this Luigi Client API method is called:
138
161
  ```javascript
139
162
  luigiClient.linkManager().fromContext('localContext').withoutSync().navigate(data.luigiRoute);
140
163
  ```
141
164
 
142
-
143
165
  ### LuigiRouteStrategy
144
166
 
145
167
  To use **LuigiAutoRoutingService**, this library defines a new **RouteReuseStrategy** named **LuigiRouteStrategy**.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, APP_INITIALIZER, NgModule, signal, inject, NgZone, Injectable, provideZonelessChangeDetection } from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component, APP_INITIALIZER, NgModule, signal, inject, NgZone, Injectable, makeEnvironmentProviders } from '@angular/core';
3
3
  import { LuigiMockEngine } from '@luigi-project/testing-utilities';
4
4
  import * as i1 from '@angular/router';
5
5
  import { BaseRouteReuseStrategy, NavigationEnd, convertToParamMap, RouterModule, RouteReuseStrategy } from '@angular/router';
@@ -9,12 +9,12 @@ import { first, filter } from 'rxjs/operators';
9
9
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
10
10
 
11
11
  class LuigiPreloadComponent {
12
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LuigiPreloadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
13
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.8", type: LuigiPreloadComponent, isStandalone: true, selector: "lib-client-support-angular", ngImport: i0, template: "<p luigipreload=\"luigipreload\"></p>\n" }); }
12
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: LuigiPreloadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
13
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.1", type: LuigiPreloadComponent, isStandalone: true, selector: "lib-client-support-angular", ngImport: i0, template: "<p luigipreload=\"luigipreload\"></p>\n", changeDetection: i0.ChangeDetectionStrategy.Eager }); }
14
14
  }
15
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LuigiPreloadComponent, decorators: [{
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: LuigiPreloadComponent, decorators: [{
16
16
  type: Component,
17
- args: [{ selector: 'lib-client-support-angular', template: "<p luigipreload=\"luigipreload\"></p>\n" }]
17
+ args: [{ selector: 'lib-client-support-angular', changeDetection: ChangeDetectionStrategy.Eager, template: "<p luigipreload=\"luigipreload\"></p>\n" }]
18
18
  }] });
19
19
 
20
20
  // @dynamic
@@ -31,9 +31,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
31
31
  * In the normal workflow this message would picked up by Luigi Core which then sends the response back.
32
32
  */
33
33
  class LuigiMockModule {
34
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LuigiMockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
35
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.8", ngImport: i0, type: LuigiMockModule }); }
36
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LuigiMockModule, providers: [
34
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: LuigiMockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
35
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.1", ngImport: i0, type: LuigiMockModule }); }
36
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: LuigiMockModule, providers: [
37
37
  {
38
38
  provide: APP_INITIALIZER,
39
39
  useFactory: LuigiMockEngine.initPostMessageHook,
@@ -41,7 +41,7 @@ class LuigiMockModule {
41
41
  }
42
42
  ] }); }
43
43
  }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LuigiMockModule, decorators: [{
44
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: LuigiMockModule, decorators: [{
45
45
  type: NgModule,
46
46
  args: [{
47
47
  providers: [
@@ -82,9 +82,14 @@ var ILuigiContextTypes;
82
82
 
83
83
  class LuigiContextServiceImpl {
84
84
  constructor() {
85
- this.signalContext = signal(undefined, ...(ngDevMode ? [{ debugName: "signalContext" }] : []));
85
+ this.signalContext = signal(undefined, /* @ts-ignore */
86
+ ...(ngDevMode ? [{ debugName: "signalContext" }] : /* istanbul ignore next */ []));
86
87
  this.subject = new ReplaySubject(1);
87
88
  this.ngZone = inject(NgZone);
89
+ /**
90
+ * Get a signal that emits when context is set.
91
+ */
92
+ this.contextSignal = this.signalContext.asReadonly();
88
93
  addInitListener((initContext) => {
89
94
  this.addListener(ILuigiContextTypes.INIT, initContext);
90
95
  });
@@ -98,12 +103,6 @@ class LuigiContextServiceImpl {
98
103
  context
99
104
  });
100
105
  }
101
- /**
102
- * Get a signal that emits when context is set.
103
- */
104
- contextSignal() {
105
- return this.signalContext.asReadonly();
106
- }
107
106
  /**
108
107
  * Get an observable that emits when context is set.
109
108
  */
@@ -150,10 +149,10 @@ class LuigiContextServiceImpl {
150
149
  this.subject.next(obj);
151
150
  });
152
151
  }
153
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LuigiContextServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
154
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LuigiContextServiceImpl, providedIn: 'root' }); }
152
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: LuigiContextServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
153
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: LuigiContextServiceImpl, providedIn: 'root' }); }
155
154
  }
156
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LuigiContextServiceImpl, decorators: [{
155
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: LuigiContextServiceImpl, decorators: [{
157
156
  type: Injectable,
158
157
  args: [{
159
158
  providedIn: 'root'
@@ -278,10 +277,10 @@ class LuigiAutoRoutingService {
278
277
  isClientInitialized() {
279
278
  return isLuigiClientInitialized();
280
279
  }
281
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LuigiAutoRoutingService, deps: [{ token: i1.Router }, { token: LuigiContextService }], target: i0.ɵɵFactoryTarget.Injectable }); }
282
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LuigiAutoRoutingService, providedIn: 'root' }); }
280
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: LuigiAutoRoutingService, deps: [{ token: i1.Router }, { token: LuigiContextService }], target: i0.ɵɵFactoryTarget.Injectable }); }
281
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: LuigiAutoRoutingService, providedIn: 'root' }); }
283
282
  }
284
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LuigiAutoRoutingService, decorators: [{
283
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: LuigiAutoRoutingService, decorators: [{
285
284
  type: Injectable,
286
285
  args: [{
287
286
  providedIn: 'root'
@@ -314,12 +313,14 @@ const staticRoutes = [
314
313
  data: { updateModalPathParam: true }
315
314
  }
316
315
  ];
316
+ /**
317
+ * @deprecated use provideLuigiAngular instead
318
+ */
317
319
  class LuigiAngularSupportModule {
318
320
  constructor(navigation, context) { }
319
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LuigiAngularSupportModule, deps: [{ token: LuigiAutoRoutingService }, { token: LuigiContextService }], target: i0.ɵɵFactoryTarget.NgModule }); }
320
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.8", ngImport: i0, type: LuigiAngularSupportModule, imports: [i1.RouterModule] }); }
321
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LuigiAngularSupportModule, providers: [
322
- provideZonelessChangeDetection(),
321
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: LuigiAngularSupportModule, deps: [{ token: LuigiAutoRoutingService }, { token: LuigiContextService }], target: i0.ɵɵFactoryTarget.NgModule }); }
322
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.1", ngImport: i0, type: LuigiAngularSupportModule, imports: [i1.RouterModule] }); }
323
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: LuigiAngularSupportModule, providers: [
323
324
  {
324
325
  provide: LuigiContextService,
325
326
  useClass: LuigiContextServiceImpl
@@ -330,12 +331,11 @@ class LuigiAngularSupportModule {
330
331
  }
331
332
  ], imports: [RouterModule.forChild(staticRoutes)] }); }
332
333
  }
333
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LuigiAngularSupportModule, decorators: [{
334
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: LuigiAngularSupportModule, decorators: [{
334
335
  type: NgModule,
335
336
  args: [{
336
337
  imports: [RouterModule.forChild(staticRoutes)],
337
338
  providers: [
338
- provideZonelessChangeDetection(),
339
339
  {
340
340
  provide: LuigiContextService,
341
341
  useClass: LuigiContextServiceImpl
@@ -348,6 +348,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
348
348
  }]
349
349
  }], ctorParameters: () => [{ type: LuigiAutoRoutingService }, { type: LuigiContextService }] });
350
350
 
351
+ function provideLuigiAngular() {
352
+ return makeEnvironmentProviders([
353
+ {
354
+ provide: LuigiContextService,
355
+ useClass: LuigiContextServiceImpl
356
+ },
357
+ {
358
+ provide: RouteReuseStrategy,
359
+ useClass: LuigiRouteStrategy
360
+ },
361
+ LuigiAutoRoutingService
362
+ ]);
363
+ }
364
+
351
365
  /*
352
366
  * Public API Surface of client-support-angular
353
367
  */
@@ -356,5 +370,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
356
370
  * Generated bundle index. Do not edit.
357
371
  */
358
372
 
359
- export { ILuigiContextTypes, LuigiAngularSupportModule, LuigiAutoRoutingService, LuigiContextService, LuigiContextServiceImpl, LuigiMockModule, LuigiPreloadComponent, staticRoutes };
373
+ export { ILuigiContextTypes, LuigiAngularSupportModule, LuigiAutoRoutingService, LuigiContextService, LuigiContextServiceImpl, LuigiMockModule, LuigiPreloadComponent, provideLuigiAngular, staticRoutes };
360
374
  //# sourceMappingURL=luigi-project-client-support-angular.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"luigi-project-client-support-angular.mjs","sources":["../../../projects/client-support-angular/src/lib/component/luigi.preload.component.ts","../../../projects/client-support-angular/src/lib/component/luigi.preload.component.html","../../../projects/client-support-angular/src/lib/luigi-mock/luigi-mock.module.ts","../../../projects/client-support-angular/src/lib/route/luigi-activated-route-snapshot-helper.ts","../../../projects/client-support-angular/src/lib/route/luigi-route-strategy.ts","../../../projects/client-support-angular/src/lib/service/luigi-context.service.ts","../../../projects/client-support-angular/src/lib/service/luigi-context.model.ts","../../../projects/client-support-angular/src/lib/service/luigi-context.service.impl.ts","../../../projects/client-support-angular/src/lib/service/luigi-auto-routing.service.ts","../../../projects/client-support-angular/src/lib/luigi.angular.support.module.ts","../../../projects/client-support-angular/src/public-api.ts","../../../projects/client-support-angular/src/luigi-project-client-support-angular.ts"],"sourcesContent":["import { Component } from '@angular/core';\n\n@Component({\n selector: 'lib-client-support-angular',\n templateUrl: './luigi.preload.component.html',\n styles: []\n})\nexport class LuigiPreloadComponent {}\n","<p luigipreload=\"luigipreload\"></p>\n","import { APP_INITIALIZER, NgModule } from '@angular/core';\nimport { LuigiMockEngine } from '@luigi-project/testing-utilities';\n\n// @dynamic\n@NgModule({\n providers: [\n {\n provide: APP_INITIALIZER,\n useFactory: LuigiMockEngine.initPostMessageHook,\n multi: true\n }\n ]\n})\n/*\n * This class mocks Luigi Core related functionality.\n *\n * Micro Frontends that use Luigi Client would usually communicate with Luigi Core\n * back and forth. When testing Luigi Client based components, Luigi Core might\n * not be present which leads into limitations on integration/e2e testing for standalone\n * microfrontends.\n *\n * This module adds a hook to the window postMessage API by adding an event listener to the\n * global message event of the window object and mocking the callback.\n * In the normal workflow this message would picked up by Luigi Core which then sends the response back.\n */\nexport class LuigiMockModule {}\n","import { ActivatedRouteSnapshot } from '@angular/router';\n\nexport class LuigiActivatedRouteSnapshotHelper {\n private static _current: ActivatedRouteSnapshot = null as unknown as ActivatedRouteSnapshot;\n\n static getCurrent(): ActivatedRouteSnapshot {\n return LuigiActivatedRouteSnapshotHelper._current;\n }\n\n static setCurrent(current: ActivatedRouteSnapshot): void {\n LuigiActivatedRouteSnapshotHelper._current = current;\n }\n}\n","import { BaseRouteReuseStrategy } from '@angular/router';\nimport { ActivatedRouteSnapshot, DetachedRouteHandle } from '@angular/router';\nimport { LuigiActivatedRouteSnapshotHelper } from './luigi-activated-route-snapshot-helper';\n\nexport class LuigiRouteStrategy extends BaseRouteReuseStrategy {\n retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle | null {\n LuigiActivatedRouteSnapshotHelper.setCurrent(route);\n return super.retrieve(route);\n }\n}\n","import { Signal } from '@angular/core';\nimport { Context } from '@luigi-project/client';\nimport { Observable } from 'rxjs';\nimport { IContextMessage } from './luigi-context.model';\n\nexport abstract class LuigiContextService {\n /**\n * Get a signal that emits when context is set.\n */\n abstract contextSignal(): Signal<IContextMessage | undefined>;\n\n /**\n * Listen to context changes\n * Receives current value, even if the event was already dispatched earlier.\n */\n abstract contextObservable(): Observable<IContextMessage>;\n\n /**\n * Get latest set context object\n */\n abstract getContext(): Context;\n\n /**\n * Get a promise that resolves when context is set.\n */\n abstract getContextAsync(): Promise<Context>;\n}\n","import { Context } from '@luigi-project/client';\n\nexport enum ILuigiContextTypes {\n INIT,\n UPDATE\n}\n\nexport interface IContextMessage {\n context: Context;\n contextType: ILuigiContextTypes;\n}\n","import { inject, Injectable, NgZone, Signal, signal, WritableSignal } from '@angular/core';\nimport { Context, addInitListener, addContextUpdateListener } from '@luigi-project/client';\nimport { ReplaySubject, Observable } from 'rxjs';\nimport { first } from 'rxjs/operators';\nimport { IContextMessage, ILuigiContextTypes } from './luigi-context.model';\nimport { LuigiContextService } from './luigi-context.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LuigiContextServiceImpl implements LuigiContextService {\n private signalContext: WritableSignal<IContextMessage | undefined> = signal<IContextMessage | undefined>(undefined);\n private subject: ReplaySubject<IContextMessage> = new ReplaySubject<IContextMessage>(1);\n private currentContext!: IContextMessage;\n private ngZone = inject(NgZone);\n\n constructor() {\n addInitListener((initContext: Context) => {\n this.addListener(ILuigiContextTypes.INIT, initContext);\n });\n addContextUpdateListener((updateContext: Context) => {\n this.addListener(ILuigiContextTypes.UPDATE, updateContext);\n });\n }\n\n public addListener(contextType: ILuigiContextTypes, context: Context): void {\n this.setContext({\n contextType,\n context\n } as IContextMessage);\n }\n\n /**\n * Get a signal that emits when context is set.\n */\n public contextSignal(): Signal<IContextMessage | undefined> {\n return this.signalContext.asReadonly();\n }\n\n /**\n * Get an observable that emits when context is set.\n */\n public contextObservable(): Observable<IContextMessage> {\n return this.subject.asObservable();\n }\n\n /**\n * Get latest context object retrieved from luigi core application or empty object, if not yet set.\n */\n public getContext(): Context {\n return this.currentContext?.context || {};\n }\n\n /**\n * Get a promise that resolves when context is set.\n */\n public getContextAsync(): Promise<Context> {\n return new Promise<Context>((resolve, reject) => {\n const context: Context = this.getContext();\n\n if (this.isObject(context) && Object.keys(context)?.length) {\n resolve(this.getContext());\n } else {\n this.contextObservable()\n .pipe(first())\n .subscribe((ctx: IContextMessage) => resolve(ctx.context));\n }\n });\n }\n\n /**\n * Checks if input is an object.\n * @param objectToCheck mixed\n * @returns {boolean}\n */\n private isObject(objectToCheck: any): boolean {\n return !!(objectToCheck && typeof objectToCheck === 'object' && !Array.isArray(objectToCheck));\n }\n\n /**\n * Set current context\n */\n protected setContext(obj: IContextMessage): void {\n this.ngZone.run(() => {\n this.currentContext = obj;\n this.signalContext.set(obj);\n this.subject.next(obj);\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ActivatedRouteSnapshot, Event, NavigationEnd, ParamMap, Router, convertToParamMap } from '@angular/router';\nimport { linkManager, uxManager, isLuigiClientInitialized } from '@luigi-project/client';\nimport { OperatorFunction } from 'rxjs';\nimport { filter } from 'rxjs/operators';\nimport { LuigiActivatedRouteSnapshotHelper } from '../route/luigi-activated-route-snapshot-helper';\nimport { LuigiContextService } from './luigi-context.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LuigiAutoRoutingService {\n constructor(\n private router: Router,\n private luigiContextService: LuigiContextService\n ) {\n this.router.events\n .pipe(this.doFilter(), takeUntilDestroyed())\n .subscribe((event: NavigationEnd) => this.doSubscription(event));\n }\n\n doFilter(): OperatorFunction<Event, NavigationEnd> {\n return filter(\n (event: Event): event is NavigationEnd =>\n !!(event instanceof NavigationEnd && event?.url?.length && !history?.state?.luigiInduced)\n );\n }\n\n /**\n * This method will be take in consideration angular route that having in data object the paramter\n * fromVirtualTreeRoot: true, here an example:\n * {path: 'demo', component: DemoComponent, data:{fromVirtualTreeRoot: true}}\n * Another option is to specify the LuigiPath: if you add in route data luigiRoute:'/xxxx/xxx';\n * in the case we will update the path in LuigiCore navigation, here an example\n * {path: 'demo', component: DemoComponent, data:{luigiRoute: '/home/demo''}}\n * If updateModalPathParam is specified, than modalPathParam will be updated upon internal navigation:\n * {path: 'demo', component: DemoComponent, data:{updateModalPathParam: true}}\n * @param event the NavigationEnd event\n */\n doSubscription(event: NavigationEnd): void {\n let current: ActivatedRouteSnapshot | null = LuigiActivatedRouteSnapshotHelper.getCurrent();\n\n if (!current) {\n current = this.router.routerState.root.snapshot;\n\n while (current?.children?.length) {\n // handle multiple children\n let primary: ActivatedRouteSnapshot | null = null;\n\n current.children.forEach((childSnapshot: ActivatedRouteSnapshot) => {\n if (childSnapshot?.outlet === 'primary') {\n primary = childSnapshot;\n }\n });\n\n if (primary) {\n current = primary;\n } else if (current.firstChild) {\n current = current.firstChild;\n } else {\n break;\n }\n }\n }\n\n if (current?.data && this.isClientInitialized()) {\n const ux = uxManager();\n let lm = linkManager().withoutSync();\n let route: string | undefined;\n\n if (current.data.luigiRoute) {\n route = this.getResolvedLuigiRoute(current);\n\n if (current.data.fromContext) {\n if (!this.luigiContextService.getContext()) {\n console.debug('Ignoring auto navigation request, luigi context not set');\n return;\n }\n\n if (current.data.fromContext === true) {\n lm = lm.fromClosestContext();\n } else {\n lm = lm.fromContext(current.data.fromContext);\n }\n }\n } else if (current.data.fromVirtualTreeRoot) {\n let url = event.url;\n const truncate = current.data.fromVirtualTreeRoot.truncate;\n\n if (truncate) {\n if (truncate.indexOf('*') === 0) {\n const index = url.indexOf(truncate.substring(1));\n\n url = url.substring(index + truncate.length - 1);\n } else if (url.indexOf(truncate) === 0) {\n url = url.substring(truncate.length);\n }\n }\n\n route = url;\n console.debug('Calling fromVirtualTreeRoot for url ==> ' + route);\n lm = lm.fromVirtualTreeRoot();\n }\n\n if (ux.isModal()) {\n if (current.data.updateModalDataPath) {\n lm.updateModalPathInternalNavigation(route as string, {}, current.data.addHistoryEntry);\n }\n } else if (route) {\n lm.navigate(route);\n }\n }\n }\n\n getResolvedLuigiRoute(current: ActivatedRouteSnapshot): string | undefined {\n let route: string | undefined = current.data.luigiRoute;\n const allParams = this.getAllParamsFromParents(current);\n\n if (!route || !allParams) {\n return route;\n }\n\n const pmap: ParamMap = convertToParamMap(allParams);\n\n pmap.keys.forEach((key: string) => {\n pmap.getAll(key).forEach((param: string) => {\n route = route?.replace(':' + key, param);\n });\n });\n\n return route;\n }\n\n getAllParamsFromParents(current: ActivatedRouteSnapshot): { [key: string]: string } | undefined {\n let allParams: { [key: string]: string } = {};\n let currentToCheck: ActivatedRouteSnapshot | null = current;\n\n while (currentToCheck) {\n if (currentToCheck.params) {\n allParams = { ...allParams, ...currentToCheck.params };\n }\n\n currentToCheck = currentToCheck.parent;\n }\n\n return allParams;\n }\n\n private isClientInitialized(): boolean {\n return isLuigiClientInitialized();\n }\n}\n","import { NgModule, provideZonelessChangeDetection } from '@angular/core';\nimport { RouteReuseStrategy, RouterModule, Routes } from '@angular/router';\nimport { LuigiPreloadComponent } from './component/luigi.preload.component';\nimport { LuigiRouteStrategy } from './route/luigi-route-strategy';\nimport { LuigiAutoRoutingService } from './service/luigi-auto-routing.service';\nimport { LuigiContextService } from './service/luigi-context.service';\nimport { LuigiContextServiceImpl } from './service/luigi-context.service.impl';\n\nexport const staticRoutes: Routes = [\n /** here an example if you want to specify that this component is a virtualTree element in Luigi Core navigation*/\n {\n path: 'luigi-client-support-preload',\n component: LuigiPreloadComponent,\n data: { fromVirtualTreeRoot: true }\n },\n /** here an example if you want to specify that this component it is a luigi component and u want to change the navigation in Luigi core*/\n {\n path: 'luigi-client-support-preload',\n component: LuigiPreloadComponent,\n data: { luigiRoute: '/home/reload' }\n },\n /** here an example if you want to reuse the component and not recreating every time you navigate to it (a singleton Component) It requires in your module to redefine */\n {\n path: 'luigi-client-support-preload=component',\n component: LuigiPreloadComponent,\n data: { reuse: true }\n },\n /** here an example if you want to update modalPathParam on internal navigation */\n {\n path: 'luigi-client-support-preload',\n component: LuigiPreloadComponent,\n data: { updateModalPathParam: true }\n }\n];\n\n@NgModule({\n imports: [RouterModule.forChild(staticRoutes)],\n providers: [\n provideZonelessChangeDetection(),\n {\n provide: LuigiContextService,\n useClass: LuigiContextServiceImpl\n },\n {\n provide: RouteReuseStrategy,\n useClass: LuigiRouteStrategy\n }\n ]\n})\nexport class LuigiAngularSupportModule {\n constructor(navigation: LuigiAutoRoutingService, context: LuigiContextService) {}\n}\n","/*\n * Public API Surface of client-support-angular\n */\n\nexport * from './lib/component/luigi.preload.component';\nexport * from './lib/luigi-mock/luigi-mock.module';\nexport * from './lib/luigi.angular.support.module';\nexport * from './lib/service/luigi-auto-routing.service';\nexport * from './lib/service/luigi-context.model';\nexport * from './lib/service/luigi-context.service';\nexport * from './lib/service/luigi-context.service.impl';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2.LuigiContextService","i1.LuigiAutoRoutingService","i3"],"mappings":";;;;;;;;;;MAOa,qBAAqB,CAAA;8GAArB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,sFCPlC,yCACA,EAAA,CAAA,CAAA;;2FDMa,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBALjC,SAAS;+BACE,4BAA4B,EAAA,QAAA,EAAA,yCAAA,EAAA;;;AEAxC;AAUA;;;;;;;;;;;AAWG;MACU,eAAe,CAAA;8GAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAf,eAAe,EAAA,CAAA,CAAA;AAAf,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,EAAA,SAAA,EApBf;AACT,YAAA;AACE,gBAAA,OAAO,EAAE,eAAe;gBACxB,UAAU,EAAE,eAAe,CAAC,mBAAmB;AAC/C,gBAAA,KAAK,EAAE;AACR;AACF,SAAA,EAAA,CAAA,CAAA;;2FAcU,eAAe,EAAA,UAAA,EAAA,CAAA;kBArB3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAA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AAA,CAAA,EAAA,CAAA,CAAA;AAAzB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,EAAA,SAAA,EAZzB;AACT,YAAA,8BAA8B,EAAE;AAChC,YAAA;AACE,gBAAA,OAAO,EAAE,mBAAmB;AAC5B,gBAAA,QAAQ,EAAE;AACX,aAAA;AACD,YAAA;AACE,gBAAA,OAAO,EAAE,kBAAkB;AAC3B,gBAAA,QAAQ,EAAE;AACX;AACF,SAAA,EAAA,OAAA,EAAA,CAXS,YAAY,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAA,EAAA,CAAA,CAAA;;2FAalC,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAdrC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AAC9C,oBAAA,SAAS,EAAE;AACT,wBAAA,8BAA8B,EAAE;AAChC,wBAAA;AACE,4BAAA,OAAO,EAAE,mBAAmB;AAC5B,4BAAA,QAAQ,EAAE;AACX,yBAAA;AACD,wBAAA;AACE,4BAAA,OAAO,EAAE,kBAAkB;AAC3B,4BAAA,QAAQ,EAAE;AACX;AACF;AACF,iBAAA;;;AChDD;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"luigi-project-client-support-angular.mjs","sources":["../../../projects/client-support-angular/src/lib/component/luigi.preload.component.ts","../../../projects/client-support-angular/src/lib/component/luigi.preload.component.html","../../../projects/client-support-angular/src/lib/luigi-mock/luigi-mock.module.ts","../../../projects/client-support-angular/src/lib/route/luigi-activated-route-snapshot-helper.ts","../../../projects/client-support-angular/src/lib/route/luigi-route-strategy.ts","../../../projects/client-support-angular/src/lib/service/luigi-context.service.ts","../../../projects/client-support-angular/src/lib/service/luigi-context.model.ts","../../../projects/client-support-angular/src/lib/service/luigi-context.service.impl.ts","../../../projects/client-support-angular/src/lib/service/luigi-auto-routing.service.ts","../../../projects/client-support-angular/src/lib/luigi.angular.support.module.ts","../../../projects/client-support-angular/src/lib/provide-luigi-angular.ts","../../../projects/client-support-angular/src/public-api.ts","../../../projects/client-support-angular/src/luigi-project-client-support-angular.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy } from '@angular/core';\n\n@Component({\n selector: 'lib-client-support-angular',\n templateUrl: './luigi.preload.component.html',\n changeDetection: ChangeDetectionStrategy.Eager,\n styles: []\n})\nexport class LuigiPreloadComponent {}\n","<p luigipreload=\"luigipreload\"></p>\n","import { APP_INITIALIZER, NgModule } from '@angular/core';\nimport { LuigiMockEngine } from '@luigi-project/testing-utilities';\n\n// @dynamic\n@NgModule({\n providers: [\n {\n provide: APP_INITIALIZER,\n useFactory: LuigiMockEngine.initPostMessageHook,\n multi: true\n }\n ]\n})\n/*\n * This class mocks Luigi Core related functionality.\n *\n * Micro Frontends that use Luigi Client would usually communicate with Luigi Core\n * back and forth. When testing Luigi Client based components, Luigi Core might\n * not be present which leads into limitations on integration/e2e testing for standalone\n * microfrontends.\n *\n * This module adds a hook to the window postMessage API by adding an event listener to the\n * global message event of the window object and mocking the callback.\n * In the normal workflow this message would picked up by Luigi Core which then sends the response back.\n */\nexport class LuigiMockModule {}\n","import { ActivatedRouteSnapshot } from '@angular/router';\n\nexport class LuigiActivatedRouteSnapshotHelper {\n private static _current: ActivatedRouteSnapshot = null as unknown as ActivatedRouteSnapshot;\n\n static getCurrent(): ActivatedRouteSnapshot {\n return LuigiActivatedRouteSnapshotHelper._current;\n }\n\n static setCurrent(current: ActivatedRouteSnapshot): void {\n LuigiActivatedRouteSnapshotHelper._current = current;\n }\n}\n","import { BaseRouteReuseStrategy } from '@angular/router';\nimport { ActivatedRouteSnapshot, DetachedRouteHandle } from '@angular/router';\nimport { LuigiActivatedRouteSnapshotHelper } from './luigi-activated-route-snapshot-helper';\n\nexport class LuigiRouteStrategy extends BaseRouteReuseStrategy {\n retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle | null {\n LuigiActivatedRouteSnapshotHelper.setCurrent(route);\n return super.retrieve(route);\n }\n}\n","import { Signal } from '@angular/core';\nimport { Context } from '@luigi-project/client';\nimport { Observable } from 'rxjs';\nimport { IContextMessage } from './luigi-context.model';\n\nexport abstract class LuigiContextService {\n /**\n * Get a signal that emits when context is set.\n */\n abstract contextSignal: Signal<IContextMessage | undefined>;\n\n /**\n * Listen to context changes\n * Receives current value, even if the event was already dispatched earlier.\n */\n abstract contextObservable(): Observable<IContextMessage>;\n\n /**\n * Get latest set context object\n */\n abstract getContext(): Context;\n\n /**\n * Get a promise that resolves when context is set.\n */\n abstract getContextAsync(): Promise<Context>;\n}\n","import { Context } from '@luigi-project/client';\n\nexport enum ILuigiContextTypes {\n INIT,\n UPDATE\n}\n\nexport interface IContextMessage {\n context: Context;\n contextType: ILuigiContextTypes;\n}\n","import { inject, Injectable, NgZone, Signal, signal, WritableSignal } from '@angular/core';\nimport { Context, addInitListener, addContextUpdateListener } from '@luigi-project/client';\nimport { ReplaySubject, Observable } from 'rxjs';\nimport { first } from 'rxjs/operators';\nimport { IContextMessage, ILuigiContextTypes } from './luigi-context.model';\nimport { LuigiContextService } from './luigi-context.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LuigiContextServiceImpl implements LuigiContextService {\n private signalContext: WritableSignal<IContextMessage | undefined> = signal<IContextMessage | undefined>(undefined);\n private subject: ReplaySubject<IContextMessage> = new ReplaySubject<IContextMessage>(1);\n private currentContext!: IContextMessage;\n private ngZone = inject(NgZone);\n\n /**\n * Get a signal that emits when context is set.\n */\n public contextSignal: Signal<IContextMessage | undefined> = this.signalContext.asReadonly();\n\n constructor() {\n addInitListener((initContext: Context) => {\n this.addListener(ILuigiContextTypes.INIT, initContext);\n });\n addContextUpdateListener((updateContext: Context) => {\n this.addListener(ILuigiContextTypes.UPDATE, updateContext);\n });\n }\n\n public addListener(contextType: ILuigiContextTypes, context: Context): void {\n this.setContext({\n contextType,\n context\n } as IContextMessage);\n }\n\n /**\n * Get an observable that emits when context is set.\n */\n public contextObservable(): Observable<IContextMessage> {\n return this.subject.asObservable();\n }\n\n /**\n * Get latest context object retrieved from luigi core application or empty object, if not yet set.\n */\n public getContext(): Context {\n return this.currentContext?.context || {};\n }\n\n /**\n * Get a promise that resolves when context is set.\n */\n public getContextAsync(): Promise<Context> {\n return new Promise<Context>((resolve, reject) => {\n const context: Context = this.getContext();\n\n if (this.isObject(context) && Object.keys(context)?.length) {\n resolve(this.getContext());\n } else {\n this.contextObservable()\n .pipe(first())\n .subscribe((ctx: IContextMessage) => resolve(ctx.context));\n }\n });\n }\n\n /**\n * Checks if input is an object.\n * @param objectToCheck mixed\n * @returns {boolean}\n */\n private isObject(objectToCheck: any): boolean {\n return !!(objectToCheck && typeof objectToCheck === 'object' && !Array.isArray(objectToCheck));\n }\n\n /**\n * Set current context\n */\n protected setContext(obj: IContextMessage): void {\n this.ngZone.run(() => {\n this.currentContext = obj;\n this.signalContext.set(obj);\n this.subject.next(obj);\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ActivatedRouteSnapshot, Event, NavigationEnd, ParamMap, Router, convertToParamMap } from '@angular/router';\nimport { linkManager, uxManager, isLuigiClientInitialized } from '@luigi-project/client';\nimport { OperatorFunction } from 'rxjs';\nimport { filter } from 'rxjs/operators';\nimport { LuigiActivatedRouteSnapshotHelper } from '../route/luigi-activated-route-snapshot-helper';\nimport { LuigiContextService } from './luigi-context.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LuigiAutoRoutingService {\n constructor(\n private router: Router,\n private luigiContextService: LuigiContextService\n ) {\n this.router.events\n .pipe(this.doFilter(), takeUntilDestroyed())\n .subscribe((event: NavigationEnd) => this.doSubscription(event));\n }\n\n doFilter(): OperatorFunction<Event, NavigationEnd> {\n return filter(\n (event: Event): event is NavigationEnd =>\n !!(event instanceof NavigationEnd && event?.url?.length && !history?.state?.luigiInduced)\n );\n }\n\n /**\n * This method will be take in consideration angular route that having in data object the paramter\n * fromVirtualTreeRoot: true, here an example:\n * {path: 'demo', component: DemoComponent, data:{fromVirtualTreeRoot: true}}\n * Another option is to specify the LuigiPath: if you add in route data luigiRoute:'/xxxx/xxx';\n * in the case we will update the path in LuigiCore navigation, here an example\n * {path: 'demo', component: DemoComponent, data:{luigiRoute: '/home/demo''}}\n * If updateModalPathParam is specified, than modalPathParam will be updated upon internal navigation:\n * {path: 'demo', component: DemoComponent, data:{updateModalPathParam: true}}\n * @param event the NavigationEnd event\n */\n doSubscription(event: NavigationEnd): void {\n let current: ActivatedRouteSnapshot | null = LuigiActivatedRouteSnapshotHelper.getCurrent();\n\n if (!current) {\n current = this.router.routerState.root.snapshot;\n\n while (current?.children?.length) {\n // handle multiple children\n let primary: ActivatedRouteSnapshot | null = null;\n\n current.children.forEach((childSnapshot: ActivatedRouteSnapshot) => {\n if (childSnapshot?.outlet === 'primary') {\n primary = childSnapshot;\n }\n });\n\n if (primary) {\n current = primary;\n } else if (current.firstChild) {\n current = current.firstChild;\n } else {\n break;\n }\n }\n }\n\n if (current?.data && this.isClientInitialized()) {\n const ux = uxManager();\n let lm = linkManager().withoutSync();\n let route: string | undefined;\n\n if (current.data.luigiRoute) {\n route = this.getResolvedLuigiRoute(current);\n\n if (current.data.fromContext) {\n if (!this.luigiContextService.getContext()) {\n console.debug('Ignoring auto navigation request, luigi context not set');\n return;\n }\n\n if (current.data.fromContext === true) {\n lm = lm.fromClosestContext();\n } else {\n lm = lm.fromContext(current.data.fromContext);\n }\n }\n } else if (current.data.fromVirtualTreeRoot) {\n let url = event.url;\n const truncate = current.data.fromVirtualTreeRoot.truncate;\n\n if (truncate) {\n if (truncate.indexOf('*') === 0) {\n const index = url.indexOf(truncate.substring(1));\n\n url = url.substring(index + truncate.length - 1);\n } else if (url.indexOf(truncate) === 0) {\n url = url.substring(truncate.length);\n }\n }\n\n route = url;\n console.debug('Calling fromVirtualTreeRoot for url ==> ' + route);\n lm = lm.fromVirtualTreeRoot();\n }\n\n if (ux.isModal()) {\n if (current.data.updateModalDataPath) {\n lm.updateModalPathInternalNavigation(route as string, {}, current.data.addHistoryEntry);\n }\n } else if (route) {\n lm.navigate(route);\n }\n }\n }\n\n getResolvedLuigiRoute(current: ActivatedRouteSnapshot): string | undefined {\n let route: string | undefined = current.data.luigiRoute;\n const allParams = this.getAllParamsFromParents(current);\n\n if (!route || !allParams) {\n return route;\n }\n\n const pmap: ParamMap = convertToParamMap(allParams);\n\n pmap.keys.forEach((key: string) => {\n pmap.getAll(key).forEach((param: string) => {\n route = route?.replace(':' + key, param);\n });\n });\n\n return route;\n }\n\n getAllParamsFromParents(current: ActivatedRouteSnapshot): { [key: string]: string } | undefined {\n let allParams: { [key: string]: string } = {};\n let currentToCheck: ActivatedRouteSnapshot | null = current;\n\n while (currentToCheck) {\n if (currentToCheck.params) {\n allParams = { ...allParams, ...currentToCheck.params };\n }\n\n currentToCheck = currentToCheck.parent;\n }\n\n return allParams;\n }\n\n private isClientInitialized(): boolean {\n return isLuigiClientInitialized();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RouteReuseStrategy, RouterModule, Routes } from '@angular/router';\nimport { LuigiPreloadComponent } from './component/luigi.preload.component';\nimport { LuigiRouteStrategy } from './route/luigi-route-strategy';\nimport { LuigiAutoRoutingService } from './service/luigi-auto-routing.service';\nimport { LuigiContextService } from './service/luigi-context.service';\nimport { LuigiContextServiceImpl } from './service/luigi-context.service.impl';\n\nexport const staticRoutes: Routes = [\n /** here an example if you want to specify that this component is a virtualTree element in Luigi Core navigation*/\n {\n path: 'luigi-client-support-preload',\n component: LuigiPreloadComponent,\n data: { fromVirtualTreeRoot: true }\n },\n /** here an example if you want to specify that this component it is a luigi component and u want to change the navigation in Luigi core*/\n {\n path: 'luigi-client-support-preload',\n component: LuigiPreloadComponent,\n data: { luigiRoute: '/home/reload' }\n },\n /** here an example if you want to reuse the component and not recreating every time you navigate to it (a singleton Component) It requires in your module to redefine */\n {\n path: 'luigi-client-support-preload=component',\n component: LuigiPreloadComponent,\n data: { reuse: true }\n },\n /** here an example if you want to update modalPathParam on internal navigation */\n {\n path: 'luigi-client-support-preload',\n component: LuigiPreloadComponent,\n data: { updateModalPathParam: true }\n }\n];\n\n/**\n * @deprecated use provideLuigiAngular instead\n */\n@NgModule({\n imports: [RouterModule.forChild(staticRoutes)],\n providers: [\n {\n provide: LuigiContextService,\n useClass: LuigiContextServiceImpl\n },\n {\n provide: RouteReuseStrategy,\n useClass: LuigiRouteStrategy\n }\n ]\n})\nexport class LuigiAngularSupportModule {\n constructor(navigation: LuigiAutoRoutingService, context: LuigiContextService) {}\n}\n","import { makeEnvironmentProviders } from '@angular/core';\nimport { LuigiContextService } from './service/luigi-context.service';\nimport { LuigiContextServiceImpl } from './service/luigi-context.service.impl';\nimport { RouteReuseStrategy } from '@angular/router';\nimport { LuigiRouteStrategy } from './route/luigi-route-strategy';\nimport { LuigiAutoRoutingService } from './service/luigi-auto-routing.service';\n\nexport function provideLuigiAngular() {\n return makeEnvironmentProviders([\n {\n provide: LuigiContextService,\n useClass: LuigiContextServiceImpl\n },\n {\n provide: RouteReuseStrategy,\n useClass: LuigiRouteStrategy\n },\n LuigiAutoRoutingService\n ]);\n}\n","/*\n * Public API Surface of client-support-angular\n */\n\nexport * from './lib/component/luigi.preload.component';\nexport * from './lib/luigi-mock/luigi-mock.module';\nexport * from './lib/luigi.angular.support.module';\nexport * from './lib/provide-luigi-angular';\nexport * from './lib/service/luigi-auto-routing.service';\nexport * from './lib/service/luigi-context.model';\nexport * from './lib/service/luigi-context.service';\nexport * from './lib/service/luigi-context.service.impl';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2.LuigiContextService","i1.LuigiAutoRoutingService","i3"],"mappings":";;;;;;;;;;MAQa,qBAAqB,CAAA;8GAArB,q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A,EAAA,yBAAyB,EAAA,SAAA,EAXzB;AACT,YAAA;AACE,gBAAA,OAAO,EAAE,mBAAmB;AAC5B,gBAAA,QAAQ,EAAE;AACX,aAAA;AACD,YAAA;AACE,gBAAA,OAAO,EAAE,kBAAkB;AAC3B,gBAAA,QAAQ,EAAE;AACX;AACF,SAAA,EAAA,OAAA,EAAA,CAVS,YAAY,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAA,EAAA,CAAA,CAAA;;2FAYlC,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAbrC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AAC9C,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,mBAAmB;AAC5B,4BAAA,QAAQ,EAAE;AACX,yBAAA;AACD,wBAAA;AACE,4BAAA,OAAO,EAAE,kBAAkB;AAC3B,4BAAA,QAAQ,EAAE;AACX;AACF;AACF,iBAAA;;;SC3Ce,mBAAmB,GAAA;AACjC,IAAA,OAAO,wBAAwB,CAAC;AAC9B,QAAA;AACE,YAAA,OAAO,EAAE,mBAAmB;AAC5B,YAAA,QAAQ,EAAE;AACX,SAAA;AACD,QAAA;AACE,YAAA,OAAO,EAAE,kBAAkB;AAC3B,YAAA,QAAQ,EAAE;AACX,SAAA;QACD;AACD,KAAA,CAAC;AACJ;;ACnBA;;AAEG;;ACFH;;AAEG;;;;"}
package/package.json CHANGED
@@ -7,8 +7,8 @@
7
7
  "url": "ssh://github.com/luigi-project/luigi.git"
8
8
  },
9
9
  "peerDependencies": {
10
- "@angular/common": "^21.0.0",
11
- "@angular/core": "^21.0.0",
10
+ "@angular/common": "^22.0.0",
11
+ "@angular/core": "^22.0.0",
12
12
  "@luigi-project/testing-utilities": "^2.0.0",
13
13
  "@luigi-project/client": "^2.0.0"
14
14
  },
@@ -18,7 +18,7 @@
18
18
  "publishConfig": {
19
19
  "tag": "client-support-angular"
20
20
  },
21
- "version": "21.1.0",
21
+ "version": "22.0.0-dev.202606130119",
22
22
  "module": "fesm2022/luigi-project-client-support-angular.mjs",
23
23
  "typings": "types/luigi-project-client-support-angular.d.ts",
24
24
  "exports": {
@@ -30,5 +30,6 @@
30
30
  "default": "./fesm2022/luigi-project-client-support-angular.mjs"
31
31
  }
32
32
  },
33
- "sideEffects": false
33
+ "sideEffects": false,
34
+ "type": "module"
34
35
  }
@@ -29,7 +29,7 @@ declare abstract class LuigiContextService {
29
29
  /**
30
30
  * Get a signal that emits when context is set.
31
31
  */
32
- abstract contextSignal(): Signal<IContextMessage | undefined>;
32
+ abstract contextSignal: Signal<IContextMessage | undefined>;
33
33
  /**
34
34
  * Listen to context changes
35
35
  * Receives current value, even if the event was already dispatched earlier.
@@ -72,6 +72,9 @@ declare class LuigiAutoRoutingService {
72
72
  }
73
73
 
74
74
  declare const staticRoutes: Routes;
75
+ /**
76
+ * @deprecated use provideLuigiAngular instead
77
+ */
75
78
  declare class LuigiAngularSupportModule {
76
79
  constructor(navigation: LuigiAutoRoutingService, context: LuigiContextService);
77
80
  static ɵfac: i0.ɵɵFactoryDeclaration<LuigiAngularSupportModule, never>;
@@ -79,17 +82,19 @@ declare class LuigiAngularSupportModule {
79
82
  static ɵinj: i0.ɵɵInjectorDeclaration<LuigiAngularSupportModule>;
80
83
  }
81
84
 
85
+ declare function provideLuigiAngular(): i0.EnvironmentProviders;
86
+
82
87
  declare class LuigiContextServiceImpl implements LuigiContextService {
83
88
  private signalContext;
84
89
  private subject;
85
90
  private currentContext;
86
91
  private ngZone;
87
- constructor();
88
- addListener(contextType: ILuigiContextTypes, context: Context): void;
89
92
  /**
90
93
  * Get a signal that emits when context is set.
91
94
  */
92
- contextSignal(): Signal<IContextMessage | undefined>;
95
+ contextSignal: Signal<IContextMessage | undefined>;
96
+ constructor();
97
+ addListener(contextType: ILuigiContextTypes, context: Context): void;
93
98
  /**
94
99
  * Get an observable that emits when context is set.
95
100
  */
@@ -116,5 +121,5 @@ declare class LuigiContextServiceImpl implements LuigiContextService {
116
121
  static ɵprov: i0.ɵɵInjectableDeclaration<LuigiContextServiceImpl>;
117
122
  }
118
123
 
119
- export { ILuigiContextTypes, LuigiAngularSupportModule, LuigiAutoRoutingService, LuigiContextService, LuigiContextServiceImpl, LuigiMockModule, LuigiPreloadComponent, staticRoutes };
124
+ export { ILuigiContextTypes, LuigiAngularSupportModule, LuigiAutoRoutingService, LuigiContextService, LuigiContextServiceImpl, LuigiMockModule, LuigiPreloadComponent, provideLuigiAngular, staticRoutes };
120
125
  export type { IContextMessage };