@luigi-project/client-support-angular 22.1.0-dev.20261090057 → 22.1.0-dev.202611100031

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,376 +1,401 @@
1
- import * as i0 from '@angular/core';
2
- import { ChangeDetectionStrategy, Component, APP_INITIALIZER, NgModule, signal, inject, NgZone, Injectable, makeEnvironmentProviders, provideEnvironmentInitializer } from '@angular/core';
3
- import { LuigiMockEngine } from '@luigi-project/testing-utilities';
4
- import * as i1 from '@angular/router';
5
- import { BaseRouteReuseStrategy, NavigationEnd, convertToParamMap, RouterModule, RouteReuseStrategy } from '@angular/router';
6
- import { addInitListener, addContextUpdateListener, uxManager, linkManager, isLuigiClientInitialized } from '@luigi-project/client';
7
- import { ReplaySubject } from 'rxjs';
8
- import { first, filter } from 'rxjs/operators';
9
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
10
-
11
- class LuigiPreloadComponent {
12
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: LuigiPreloadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
13
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.2.0", type: LuigiPreloadComponent, isStandalone: true, selector: "lib-client-support-angular", ngImport: i0, template: "<p luigipreload=\"luigipreload\"></p>\n", changeDetection: i0.ChangeDetectionStrategy.Eager }); }
14
- }
15
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: LuigiPreloadComponent, decorators: [{
16
- type: Component,
17
- args: [{ selector: 'lib-client-support-angular', changeDetection: ChangeDetectionStrategy.Eager, template: "<p luigipreload=\"luigipreload\"></p>\n" }]
18
- }] });
19
-
20
- // @dynamic
21
- /*
22
- * This class mocks Luigi Core related functionality.
23
- *
24
- * Micro Frontends that use Luigi Client would usually communicate with Luigi Core
25
- * back and forth. When testing Luigi Client based components, Luigi Core might
26
- * not be present which leads into limitations on integration/e2e testing for standalone
27
- * microfrontends.
28
- *
29
- * This module adds a hook to the window postMessage API by adding an event listener to the
30
- * global message event of the window object and mocking the callback.
31
- * In the normal workflow this message would picked up by Luigi Core which then sends the response back.
32
- */
33
- class LuigiMockModule {
34
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: LuigiMockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
35
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.2.0", ngImport: i0, type: LuigiMockModule }); }
36
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: LuigiMockModule, providers: [
37
- {
38
- provide: APP_INITIALIZER,
39
- useFactory: LuigiMockEngine.initPostMessageHook,
40
- multi: true
41
- }
42
- ] }); }
43
- }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: LuigiMockModule, decorators: [{
45
- type: NgModule,
46
- args: [{
47
- providers: [
48
- {
49
- provide: APP_INITIALIZER,
50
- useFactory: LuigiMockEngine.initPostMessageHook,
51
- multi: true
52
- }
53
- ]
54
- }]
55
- }] });
56
-
57
- class LuigiActivatedRouteSnapshotHelper {
58
- static { this._current = null; }
59
- static getCurrent() {
60
- return LuigiActivatedRouteSnapshotHelper._current;
61
- }
62
- static setCurrent(current) {
63
- LuigiActivatedRouteSnapshotHelper._current = current;
64
- }
65
- }
66
-
67
- class LuigiRouteStrategy extends BaseRouteReuseStrategy {
68
- retrieve(route) {
69
- LuigiActivatedRouteSnapshotHelper.setCurrent(route);
70
- return super.retrieve(route);
71
- }
72
- }
73
-
74
- class LuigiContextService {
75
- }
76
-
1
+ import * as i0 from "@angular/core";
2
+ import { APP_INITIALIZER, ChangeDetectionStrategy, Component, Injectable, NgModule, NgZone, inject, makeEnvironmentProviders, provideEnvironmentInitializer, signal } from "@angular/core";
3
+ import { LuigiMockEngine } from "@luigi-project/testing-utilities";
4
+ import * as i1 from "@angular/router";
5
+ import { BaseRouteReuseStrategy, NavigationEnd, RouteReuseStrategy, RouterModule, convertToParamMap } from "@angular/router";
6
+ import { addContextUpdateListener, addInitListener, isLuigiClientInitialized, linkManager, uxManager } from "@luigi-project/client";
7
+ import { ReplaySubject } from "rxjs";
8
+ import { filter, first } from "rxjs/operators";
9
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
10
+ var LuigiPreloadComponent = class LuigiPreloadComponent {
11
+ static {
12
+ this.ɵfac = i0.ɵɵngDeclareFactory({
13
+ minVersion: "12.0.0",
14
+ version: "22.2.3",
15
+ ngImport: i0,
16
+ type: LuigiPreloadComponent,
17
+ deps: [],
18
+ target: i0.ɵɵFactoryTarget.Component
19
+ });
20
+ }
21
+ static {
22
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
23
+ minVersion: "14.0.0",
24
+ version: "22.2.3",
25
+ type: LuigiPreloadComponent,
26
+ isStandalone: true,
27
+ selector: "lib-client-support-angular",
28
+ ngImport: i0,
29
+ template: "<p luigipreload=\"luigipreload\"></p>\n",
30
+ changeDetection: i0.ChangeDetectionStrategy.Eager
31
+ });
32
+ }
33
+ };
34
+ i0.ɵɵngDeclareClassMetadata({
35
+ minVersion: "12.0.0",
36
+ version: "22.2.3",
37
+ ngImport: i0,
38
+ type: LuigiPreloadComponent,
39
+ decorators: [{
40
+ type: Component,
41
+ args: [{
42
+ selector: "lib-client-support-angular",
43
+ changeDetection: ChangeDetectionStrategy.Eager,
44
+ template: "<p luigipreload=\"luigipreload\"></p>\n"
45
+ }]
46
+ }]
47
+ });
48
+ var LuigiMockModule = class LuigiMockModule {
49
+ static {
50
+ this.ɵfac = i0.ɵɵngDeclareFactory({
51
+ minVersion: "12.0.0",
52
+ version: "22.2.3",
53
+ ngImport: i0,
54
+ type: LuigiMockModule,
55
+ deps: [],
56
+ target: i0.ɵɵFactoryTarget.NgModule
57
+ });
58
+ }
59
+ static {
60
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
61
+ minVersion: "14.0.0",
62
+ version: "22.2.3",
63
+ ngImport: i0,
64
+ type: LuigiMockModule
65
+ });
66
+ }
67
+ static {
68
+ this.ɵinj = i0.ɵɵngDeclareInjector({
69
+ minVersion: "12.0.0",
70
+ version: "22.2.3",
71
+ ngImport: i0,
72
+ type: LuigiMockModule,
73
+ providers: [{
74
+ provide: APP_INITIALIZER,
75
+ useFactory: LuigiMockEngine.initPostMessageHook,
76
+ multi: true
77
+ }]
78
+ });
79
+ }
80
+ };
81
+ i0.ɵɵngDeclareClassMetadata({
82
+ minVersion: "12.0.0",
83
+ version: "22.2.3",
84
+ ngImport: i0,
85
+ type: LuigiMockModule,
86
+ decorators: [{
87
+ type: NgModule,
88
+ args: [{ providers: [{
89
+ provide: APP_INITIALIZER,
90
+ useFactory: LuigiMockEngine.initPostMessageHook,
91
+ multi: true
92
+ }] }]
93
+ }]
94
+ });
95
+ var LuigiActivatedRouteSnapshotHelper = class LuigiActivatedRouteSnapshotHelper {
96
+ static {
97
+ this._current = null;
98
+ }
99
+ static getCurrent() {
100
+ return LuigiActivatedRouteSnapshotHelper._current;
101
+ }
102
+ static setCurrent(current) {
103
+ LuigiActivatedRouteSnapshotHelper._current = current;
104
+ }
105
+ };
106
+ var LuigiRouteStrategy = class extends BaseRouteReuseStrategy {
107
+ retrieve(route) {
108
+ LuigiActivatedRouteSnapshotHelper.setCurrent(route);
109
+ return super.retrieve(route);
110
+ }
111
+ };
112
+ var LuigiContextService = class {};
77
113
  var ILuigiContextTypes;
78
- (function (ILuigiContextTypes) {
79
- ILuigiContextTypes[ILuigiContextTypes["INIT"] = 0] = "INIT";
80
- ILuigiContextTypes[ILuigiContextTypes["UPDATE"] = 1] = "UPDATE";
114
+ (function(ILuigiContextTypes) {
115
+ ILuigiContextTypes[ILuigiContextTypes["INIT"] = 0] = "INIT";
116
+ ILuigiContextTypes[ILuigiContextTypes["UPDATE"] = 1] = "UPDATE";
81
117
  })(ILuigiContextTypes || (ILuigiContextTypes = {}));
82
-
83
- class LuigiContextServiceImpl {
84
- constructor() {
85
- this.signalContext = signal(undefined, /* @ts-ignore */
86
- ...(ngDevMode ? [{ debugName: "signalContext" }] : /* istanbul ignore next */ []));
87
- this.subject = new ReplaySubject(1);
88
- this.ngZone = inject(NgZone);
89
- /**
90
- * Get a signal that emits when context is set.
91
- */
92
- this.contextSignal = this.signalContext.asReadonly();
93
- addInitListener((initContext) => {
94
- this.addListener(ILuigiContextTypes.INIT, initContext);
95
- });
96
- addContextUpdateListener((updateContext) => {
97
- this.addListener(ILuigiContextTypes.UPDATE, updateContext);
98
- });
99
- }
100
- addListener(contextType, context) {
101
- this.setContext({
102
- contextType,
103
- context
104
- });
105
- }
106
- /**
107
- * Get an observable that emits when context is set.
108
- */
109
- contextObservable() {
110
- return this.subject.asObservable();
111
- }
112
- /**
113
- * Get latest context object retrieved from luigi core application or empty object, if not yet set.
114
- */
115
- getContext() {
116
- return this.currentContext?.context || {};
117
- }
118
- /**
119
- * Get a promise that resolves when context is set.
120
- */
121
- getContextAsync() {
122
- return new Promise((resolve, reject) => {
123
- const context = this.getContext();
124
- if (this.isObject(context) && Object.keys(context)?.length) {
125
- resolve(this.getContext());
126
- }
127
- else {
128
- this.contextObservable()
129
- .pipe(first())
130
- .subscribe((ctx) => resolve(ctx.context));
131
- }
132
- });
133
- }
134
- /**
135
- * Checks if input is an object.
136
- * @param objectToCheck mixed
137
- * @returns {boolean}
138
- */
139
- isObject(objectToCheck) {
140
- return !!(objectToCheck && typeof objectToCheck === 'object' && !Array.isArray(objectToCheck));
141
- }
142
- /**
143
- * Set current context
144
- */
145
- setContext(obj) {
146
- this.ngZone.run(() => {
147
- this.currentContext = obj;
148
- this.signalContext.set(obj);
149
- this.subject.next(obj);
150
- });
151
- }
152
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: LuigiContextServiceImpl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
153
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: LuigiContextServiceImpl, providedIn: 'root' }); }
154
- }
155
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: LuigiContextServiceImpl, decorators: [{
156
- type: Injectable,
157
- args: [{
158
- providedIn: 'root'
159
- }]
160
- }], ctorParameters: () => [] });
161
-
162
- class LuigiAutoRoutingService {
163
- constructor(router, luigiContextService) {
164
- this.router = router;
165
- this.luigiContextService = luigiContextService;
166
- this.router.events
167
- .pipe(this.doFilter(), takeUntilDestroyed())
168
- .subscribe((event) => this.doSubscription(event));
169
- }
170
- doFilter() {
171
- return filter((event) => !!(event instanceof NavigationEnd && event?.url?.length && !history?.state?.luigiInduced));
172
- }
173
- /**
174
- * This method will be take in consideration angular route that having in data object the paramter
175
- * fromVirtualTreeRoot: true, here an example:
176
- * {path: 'demo', component: DemoComponent, data:{fromVirtualTreeRoot: true}}
177
- * Another option is to specify the LuigiPath: if you add in route data luigiRoute:'/xxxx/xxx';
178
- * in the case we will update the path in LuigiCore navigation, here an example
179
- * {path: 'demo', component: DemoComponent, data:{luigiRoute: '/home/demo''}}
180
- * If updateModalPathParam is specified, than modalPathParam will be updated upon internal navigation:
181
- * {path: 'demo', component: DemoComponent, data:{updateModalPathParam: true}}
182
- * @param event the NavigationEnd event
183
- */
184
- doSubscription(event) {
185
- let current = LuigiActivatedRouteSnapshotHelper.getCurrent();
186
- if (!current) {
187
- current = this.router.routerState.root.snapshot;
188
- while (current?.children?.length) {
189
- // handle multiple children
190
- let primary = null;
191
- current.children.forEach((childSnapshot) => {
192
- if (childSnapshot?.outlet === 'primary') {
193
- primary = childSnapshot;
194
- }
195
- });
196
- if (primary) {
197
- current = primary;
198
- }
199
- else if (current.firstChild) {
200
- current = current.firstChild;
201
- }
202
- else {
203
- break;
204
- }
205
- }
206
- }
207
- if (current?.data && this.isClientInitialized()) {
208
- const ux = uxManager();
209
- let lm = linkManager().withoutSync();
210
- let route;
211
- if (current.data.luigiRoute) {
212
- route = this.getResolvedLuigiRoute(current);
213
- if (current.data.fromContext) {
214
- if (!this.luigiContextService.getContext()) {
215
- console.debug('Ignoring auto navigation request, luigi context not set');
216
- return;
217
- }
218
- if (current.data.fromContext === true) {
219
- lm = lm.fromClosestContext();
220
- }
221
- else {
222
- lm = lm.fromContext(current.data.fromContext);
223
- }
224
- }
225
- }
226
- else if (current.data.fromVirtualTreeRoot) {
227
- let url = event.url;
228
- const truncate = current.data.fromVirtualTreeRoot.truncate;
229
- if (truncate) {
230
- if (truncate.indexOf('*') === 0) {
231
- const index = url.indexOf(truncate.substring(1));
232
- url = url.substring(index + truncate.length - 1);
233
- }
234
- else if (url.indexOf(truncate) === 0) {
235
- url = url.substring(truncate.length);
236
- }
237
- }
238
- route = url;
239
- console.debug('Calling fromVirtualTreeRoot for url ==> ' + route);
240
- lm = lm.fromVirtualTreeRoot();
241
- }
242
- if (ux.isModal()) {
243
- if (current.data.updateModalDataPath) {
244
- lm.updateModalPathInternalNavigation(route, {}, current.data.addHistoryEntry);
245
- }
246
- }
247
- else if (route) {
248
- lm.navigate(route);
249
- }
250
- }
251
- }
252
- getResolvedLuigiRoute(current) {
253
- let route = current.data.luigiRoute;
254
- const allParams = this.getAllParamsFromParents(current);
255
- if (!route || !allParams) {
256
- return route;
257
- }
258
- const pmap = convertToParamMap(allParams);
259
- pmap.keys.forEach((key) => {
260
- pmap.getAll(key).forEach((param) => {
261
- route = route?.replace(':' + key, param);
262
- });
263
- });
264
- return route;
265
- }
266
- getAllParamsFromParents(current) {
267
- let allParams = {};
268
- let currentToCheck = current;
269
- while (currentToCheck) {
270
- if (currentToCheck.params) {
271
- allParams = { ...allParams, ...currentToCheck.params };
272
- }
273
- currentToCheck = currentToCheck.parent;
274
- }
275
- return allParams;
276
- }
277
- isClientInitialized() {
278
- return isLuigiClientInitialized();
279
- }
280
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", 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.2.0", ngImport: i0, type: LuigiAutoRoutingService, providedIn: 'root' }); }
282
- }
283
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: LuigiAutoRoutingService, decorators: [{
284
- type: Injectable,
285
- args: [{
286
- providedIn: 'root'
287
- }]
288
- }], ctorParameters: () => [{ type: i1.Router }, { type: LuigiContextService }] });
289
-
118
+ var LuigiContextServiceImpl = class LuigiContextServiceImpl {
119
+ constructor() {
120
+ this.signalContext = signal(void 0, ...ngDevMode ? [{ debugName: "signalContext" }] : /* istanbul ignore next */ []);
121
+ this.subject = new ReplaySubject(1);
122
+ this.ngZone = inject(NgZone);
123
+ this.contextSignal = this.signalContext.asReadonly();
124
+ addInitListener((initContext) => {
125
+ this.addListener(ILuigiContextTypes.INIT, initContext);
126
+ });
127
+ addContextUpdateListener((updateContext) => {
128
+ this.addListener(ILuigiContextTypes.UPDATE, updateContext);
129
+ });
130
+ }
131
+ addListener(contextType, context) {
132
+ this.setContext({
133
+ contextType,
134
+ context
135
+ });
136
+ }
137
+ contextObservable() {
138
+ return this.subject.asObservable();
139
+ }
140
+ getContext() {
141
+ return this.currentContext?.context || {};
142
+ }
143
+ getContextAsync() {
144
+ return new Promise((resolve, reject) => {
145
+ const context = this.getContext();
146
+ if (this.isObject(context) && Object.keys(context)?.length) resolve(this.getContext());
147
+ else this.contextObservable().pipe(first()).subscribe((ctx) => resolve(ctx.context));
148
+ });
149
+ }
150
+ isObject(objectToCheck) {
151
+ return !!(objectToCheck && typeof objectToCheck === "object" && !Array.isArray(objectToCheck));
152
+ }
153
+ setContext(obj) {
154
+ this.ngZone.run(() => {
155
+ this.currentContext = obj;
156
+ this.signalContext.set(obj);
157
+ this.subject.next(obj);
158
+ });
159
+ }
160
+ static {
161
+ this.ɵfac = i0.ɵɵngDeclareFactory({
162
+ minVersion: "12.0.0",
163
+ version: "22.2.3",
164
+ ngImport: i0,
165
+ type: LuigiContextServiceImpl,
166
+ deps: [],
167
+ target: i0.ɵɵFactoryTarget.Injectable
168
+ });
169
+ }
170
+ static {
171
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
172
+ minVersion: "12.0.0",
173
+ version: "22.2.3",
174
+ ngImport: i0,
175
+ type: LuigiContextServiceImpl,
176
+ providedIn: "root"
177
+ });
178
+ }
179
+ };
180
+ i0.ɵɵngDeclareClassMetadata({
181
+ minVersion: "12.0.0",
182
+ version: "22.2.3",
183
+ ngImport: i0,
184
+ type: LuigiContextServiceImpl,
185
+ decorators: [{
186
+ type: Injectable,
187
+ args: [{ providedIn: "root" }]
188
+ }],
189
+ ctorParameters: () => []
190
+ });
191
+ var LuigiAutoRoutingService = class LuigiAutoRoutingService {
192
+ constructor(router, luigiContextService) {
193
+ this.router = router;
194
+ this.luigiContextService = luigiContextService;
195
+ this.router.events.pipe(this.doFilter(), takeUntilDestroyed()).subscribe((event) => this.doSubscription(event));
196
+ }
197
+ doFilter() {
198
+ return filter((event) => !!(event instanceof NavigationEnd && event?.url?.length && !history?.state?.luigiInduced));
199
+ }
200
+ doSubscription(event) {
201
+ let current = LuigiActivatedRouteSnapshotHelper.getCurrent();
202
+ if (!current) {
203
+ current = this.router.routerState.root.snapshot;
204
+ while (current?.children?.length) {
205
+ let primary = null;
206
+ current.children.forEach((childSnapshot) => {
207
+ if (childSnapshot?.outlet === "primary") primary = childSnapshot;
208
+ });
209
+ if (primary) current = primary;
210
+ else if (current.firstChild) current = current.firstChild;
211
+ else break;
212
+ }
213
+ }
214
+ if (current?.data && this.isClientInitialized()) {
215
+ const ux = uxManager();
216
+ let lm = linkManager().withoutSync();
217
+ let route;
218
+ if (current.data.luigiRoute) {
219
+ route = this.getResolvedLuigiRoute(current);
220
+ if (current.data.fromContext) {
221
+ if (!this.luigiContextService.getContext()) {
222
+ console.debug("Ignoring auto navigation request, luigi context not set");
223
+ return;
224
+ }
225
+ if (current.data.fromContext === true) lm = lm.fromClosestContext();
226
+ else lm = lm.fromContext(current.data.fromContext);
227
+ }
228
+ } else if (current.data.fromVirtualTreeRoot) {
229
+ let url = event.url;
230
+ const truncate = current.data.fromVirtualTreeRoot.truncate;
231
+ if (truncate) {
232
+ if (truncate.indexOf("*") === 0) {
233
+ const index = url.indexOf(truncate.substring(1));
234
+ url = url.substring(index + truncate.length - 1);
235
+ } else if (url.indexOf(truncate) === 0) url = url.substring(truncate.length);
236
+ }
237
+ route = url;
238
+ console.debug("Calling fromVirtualTreeRoot for url ==> " + route);
239
+ lm = lm.fromVirtualTreeRoot();
240
+ }
241
+ if (ux.isModal()) {
242
+ if (current.data.updateModalDataPath) lm.updateModalPathInternalNavigation(route, {}, current.data.addHistoryEntry);
243
+ } else if (route) lm.navigate(route);
244
+ }
245
+ }
246
+ getResolvedLuigiRoute(current) {
247
+ let route = current.data.luigiRoute;
248
+ const allParams = this.getAllParamsFromParents(current);
249
+ if (!route || !allParams) return route;
250
+ const pmap = convertToParamMap(allParams);
251
+ pmap.keys.forEach((key) => {
252
+ pmap.getAll(key).forEach((param) => {
253
+ route = route?.replace(":" + key, param);
254
+ });
255
+ });
256
+ return route;
257
+ }
258
+ getAllParamsFromParents(current) {
259
+ let allParams = {};
260
+ let currentToCheck = current;
261
+ while (currentToCheck) {
262
+ if (currentToCheck.params) allParams = {
263
+ ...allParams,
264
+ ...currentToCheck.params
265
+ };
266
+ currentToCheck = currentToCheck.parent;
267
+ }
268
+ return allParams;
269
+ }
270
+ isClientInitialized() {
271
+ return isLuigiClientInitialized();
272
+ }
273
+ static {
274
+ this.ɵfac = i0.ɵɵngDeclareFactory({
275
+ minVersion: "12.0.0",
276
+ version: "22.2.3",
277
+ ngImport: i0,
278
+ type: LuigiAutoRoutingService,
279
+ deps: [{ token: i1.Router }, { token: LuigiContextService }],
280
+ target: i0.ɵɵFactoryTarget.Injectable
281
+ });
282
+ }
283
+ static {
284
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
285
+ minVersion: "12.0.0",
286
+ version: "22.2.3",
287
+ ngImport: i0,
288
+ type: LuigiAutoRoutingService,
289
+ providedIn: "root"
290
+ });
291
+ }
292
+ };
293
+ i0.ɵɵngDeclareClassMetadata({
294
+ minVersion: "12.0.0",
295
+ version: "22.2.3",
296
+ ngImport: i0,
297
+ type: LuigiAutoRoutingService,
298
+ decorators: [{
299
+ type: Injectable,
300
+ args: [{ providedIn: "root" }]
301
+ }],
302
+ ctorParameters: () => [{ type: i1.Router }, { type: LuigiContextService }]
303
+ });
290
304
  const staticRoutes = [
291
- /** here an example if you want to specify that this component is a virtualTree element in Luigi Core navigation*/
292
- {
293
- path: 'luigi-client-support-preload',
294
- component: LuigiPreloadComponent,
295
- data: { fromVirtualTreeRoot: true }
296
- },
297
- /** 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*/
298
- {
299
- path: 'luigi-client-support-preload',
300
- component: LuigiPreloadComponent,
301
- data: { luigiRoute: '/home/reload' }
302
- },
303
- /** 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 */
304
- {
305
- path: 'luigi-client-support-preload=component',
306
- component: LuigiPreloadComponent,
307
- data: { reuse: true }
308
- },
309
- /** here an example if you want to update modalPathParam on internal navigation */
310
- {
311
- path: 'luigi-client-support-preload',
312
- component: LuigiPreloadComponent,
313
- data: { updateModalPathParam: true }
314
- }
305
+ {
306
+ path: "luigi-client-support-preload",
307
+ component: LuigiPreloadComponent,
308
+ data: { fromVirtualTreeRoot: true }
309
+ },
310
+ {
311
+ path: "luigi-client-support-preload",
312
+ component: LuigiPreloadComponent,
313
+ data: { luigiRoute: "/home/reload" }
314
+ },
315
+ {
316
+ path: "luigi-client-support-preload=component",
317
+ component: LuigiPreloadComponent,
318
+ data: { reuse: true }
319
+ },
320
+ {
321
+ path: "luigi-client-support-preload",
322
+ component: LuigiPreloadComponent,
323
+ data: { updateModalPathParam: true }
324
+ }
315
325
  ];
316
- /**
317
- * @deprecated use provideLuigiAngular instead
318
- */
319
- class LuigiAngularSupportModule {
320
- constructor(navigation, context) { }
321
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", 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.2.0", ngImport: i0, type: LuigiAngularSupportModule, imports: [i1.RouterModule] }); }
323
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: LuigiAngularSupportModule, providers: [
324
- {
325
- provide: LuigiContextService,
326
- useClass: LuigiContextServiceImpl
327
- },
328
- {
329
- provide: RouteReuseStrategy,
330
- useClass: LuigiRouteStrategy
331
- }
332
- ], imports: [RouterModule.forChild(staticRoutes)] }); }
333
- }
334
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: LuigiAngularSupportModule, decorators: [{
335
- type: NgModule,
336
- args: [{
337
- imports: [RouterModule.forChild(staticRoutes)],
338
- providers: [
339
- {
340
- provide: LuigiContextService,
341
- useClass: LuigiContextServiceImpl
342
- },
343
- {
344
- provide: RouteReuseStrategy,
345
- useClass: LuigiRouteStrategy
346
- }
347
- ]
348
- }]
349
- }], ctorParameters: () => [{ type: LuigiAutoRoutingService }, { type: LuigiContextService }] });
350
-
326
+ var LuigiAngularSupportModule = class LuigiAngularSupportModule {
327
+ constructor(navigation, context) {}
328
+ static {
329
+ this.ɵfac = i0.ɵɵngDeclareFactory({
330
+ minVersion: "12.0.0",
331
+ version: "22.2.3",
332
+ ngImport: i0,
333
+ type: LuigiAngularSupportModule,
334
+ deps: [{ token: LuigiAutoRoutingService }, { token: LuigiContextService }],
335
+ target: i0.ɵɵFactoryTarget.NgModule
336
+ });
337
+ }
338
+ static {
339
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
340
+ minVersion: "14.0.0",
341
+ version: "22.2.3",
342
+ ngImport: i0,
343
+ type: LuigiAngularSupportModule,
344
+ imports: [i1.RouterModule]
345
+ });
346
+ }
347
+ static {
348
+ this.ɵinj = i0.ɵɵngDeclareInjector({
349
+ minVersion: "12.0.0",
350
+ version: "22.2.3",
351
+ ngImport: i0,
352
+ type: LuigiAngularSupportModule,
353
+ providers: [{
354
+ provide: LuigiContextService,
355
+ useClass: LuigiContextServiceImpl
356
+ }, {
357
+ provide: RouteReuseStrategy,
358
+ useClass: LuigiRouteStrategy
359
+ }],
360
+ imports: [RouterModule.forChild(staticRoutes)]
361
+ });
362
+ }
363
+ };
364
+ i0.ɵɵngDeclareClassMetadata({
365
+ minVersion: "12.0.0",
366
+ version: "22.2.3",
367
+ ngImport: i0,
368
+ type: LuigiAngularSupportModule,
369
+ decorators: [{
370
+ type: NgModule,
371
+ args: [{
372
+ imports: [RouterModule.forChild(staticRoutes)],
373
+ providers: [{
374
+ provide: LuigiContextService,
375
+ useClass: LuigiContextServiceImpl
376
+ }, {
377
+ provide: RouteReuseStrategy,
378
+ useClass: LuigiRouteStrategy
379
+ }]
380
+ }]
381
+ }],
382
+ ctorParameters: () => [{ type: LuigiAutoRoutingService }, { type: LuigiContextService }]
383
+ });
351
384
  function provideLuigiAngular() {
352
- return makeEnvironmentProviders([
353
- {
354
- provide: LuigiContextService,
355
- useClass: LuigiContextServiceImpl
356
- },
357
- {
358
- provide: RouteReuseStrategy,
359
- useClass: LuigiRouteStrategy
360
- },
361
- provideEnvironmentInitializer(() => {
362
- inject(LuigiAutoRoutingService);
363
- })
364
- ]);
385
+ return makeEnvironmentProviders([
386
+ {
387
+ provide: LuigiContextService,
388
+ useClass: LuigiContextServiceImpl
389
+ },
390
+ {
391
+ provide: RouteReuseStrategy,
392
+ useClass: LuigiRouteStrategy
393
+ },
394
+ provideEnvironmentInitializer(() => {
395
+ inject(LuigiAutoRoutingService);
396
+ })
397
+ ]);
365
398
  }
366
-
367
- /*
368
- * Public API Surface of client-support-angular
369
- */
370
-
371
- /**
372
- * Generated bundle index. Do not edit.
373
- */
374
-
375
399
  export { ILuigiContextTypes, LuigiAngularSupportModule, LuigiAutoRoutingService, LuigiContextService, LuigiContextServiceImpl, LuigiMockModule, LuigiPreloadComponent, provideLuigiAngular, staticRoutes };
376
- //# sourceMappingURL=luigi-project-client-support-angular.mjs.map
400
+
401
+ //# 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/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 { inject, makeEnvironmentProviders, provideEnvironmentInitializer } from '@angular/core';\nimport { RouteReuseStrategy } from '@angular/router';\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 function provideLuigiAngular() {\n return makeEnvironmentProviders([\n {\n provide: LuigiContextService,\n useClass: LuigiContextServiceImpl\n },\n {\n provide: RouteReuseStrategy,\n useClass: LuigiRouteStrategy\n },\n provideEnvironmentInitializer(() => {\n inject(LuigiAutoRoutingService);\n })\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,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,sFCRlC,yCACA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,KAAA,EAAA,CAAA,CAAA;;2FDOa,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBANjC,SAAS;+BACE,4BAA4B,EAAA,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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,6BAA6B,CAAC,MAAK;YACjC,MAAM,CAAC,uBAAuB,CAAC;AACjC,QAAA,CAAC;AACF,KAAA,CAAC;AACJ;;ACrBA;;AAEG;;ACFH;;AAEG;;"}
1
+ {"version":3,"file":"luigi-project-client-support-angular.mjs","names":[],"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"],"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 { inject, makeEnvironmentProviders, provideEnvironmentInitializer } from '@angular/core';\nimport { RouteReuseStrategy } from '@angular/router';\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 function provideLuigiAngular() {\n return makeEnvironmentProviders([\n {\n provide: LuigiContextService,\n useClass: LuigiContextServiceImpl\n },\n {\n provide: RouteReuseStrategy,\n useClass: LuigiRouteStrategy\n },\n provideEnvironmentInitializer(() => {\n inject(LuigiAutoRoutingService);\n })\n ]);\n}\n"],"mappings":";;;;;;;;;AAQA,IAAa,wBAAb,MAAa,sBAAqB;CAArB;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAqB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAArB;EAAA,KAAA,OAAA,GAAA,qBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,MAAA;GAAqB,cAAA;GAAA,UAAA;GAAA,UAAA;GAAA,UCRlC;GACA,iBAAA,GAAA,wBAAA;EAAA,CAAA;CAAA;;ADOa,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAqB,YAAA,CAAA;EANjC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAA4B,iBAErB,wBAAwB;GAAK,UAAA;EAAA,CAAA;;;AEoBhD,IAAa,kBAAb,MAAa,gBAAe;CAAf;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAe,MAAA,CAAA;GAAA,QAAA,GAA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lC,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAyB,YAAA,CAAA;EAbrC,MAAA;EAAS,MAAA,CAAA;GACR,SAAS,CAAC,aAAa,SAAS,YAAY,CAAC;GAC7C,WAAW,CACT;IACE,SAAS;IACT,UAAU;GACX,GACD;IACE,SAAS;IACT,UAAU;GACX,CACF;EACF,CAAA;;;;AC3CD,SAAgB,sBAAmB;CACjC,OAAO,yBAAyB;EAC9B;GACE,SAAS;GACT,UAAU;EACX;EACD;GACE,SAAS;GACT,UAAU;EACX;EACD,oCAAmC;GACjC,OAAO,uBAAuB;EAChC,CAAC;CACF,CAAA;AACH"}
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "publishConfig": {
19
19
  "tag": "client-support-angular"
20
20
  },
21
- "version": "22.1.0-dev.20261090057",
21
+ "version": "22.1.0-dev.202611100031",
22
22
  "module": "fesm2022/luigi-project-client-support-angular.mjs",
23
23
  "typings": "types/luigi-project-client-support-angular.d.ts",
24
24
  "exports": {
@@ -1,125 +1,114 @@
1
- import * as i0 from '@angular/core';
2
- import { Signal } from '@angular/core';
3
- import * as i1 from '@angular/router';
4
- import { Router, Event, NavigationEnd, ActivatedRouteSnapshot, Routes } from '@angular/router';
5
- import { Observable, OperatorFunction } from 'rxjs';
6
- import { Context } from '@luigi-project/client';
7
-
8
- declare class LuigiPreloadComponent {
9
- static ɵfac: i0.ɵɵFactoryDeclaration<LuigiPreloadComponent, never>;
10
- static ɵcmp: i0.ɵɵComponentDeclaration<LuigiPreloadComponent, "lib-client-support-angular", never, {}, {}, never, never, true, never>;
1
+ import * as i0 from "@angular/core";
2
+ import { Signal } from "@angular/core";
3
+ import * as i1 from "@angular/router";
4
+ import { ActivatedRouteSnapshot, Event, NavigationEnd, Router, Routes } from "@angular/router";
5
+ import { Observable, OperatorFunction } from "rxjs";
6
+ import { Context } from "@luigi-project/client";
7
+ export declare class LuigiPreloadComponent {
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuigiPreloadComponent, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<LuigiPreloadComponent, "lib-client-support-angular", never, {}, {}, never, never, true, never>;
11
10
  }
12
-
13
- declare class LuigiMockModule {
14
- static ɵfac: i0.ɵɵFactoryDeclaration<LuigiMockModule, never>;
15
- static ɵmod: i0.ɵɵNgModuleDeclaration<LuigiMockModule, never, never, never>;
16
- static ɵinj: i0.ɵɵInjectorDeclaration<LuigiMockModule>;
11
+ export declare class LuigiMockModule {
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuigiMockModule, never>;
13
+ static ɵmod: i0.ɵɵNgModuleDeclaration<LuigiMockModule, never, never, never>;
14
+ static ɵinj: i0.ɵɵInjectorDeclaration<LuigiMockModule>;
17
15
  }
18
-
19
- declare enum ILuigiContextTypes {
20
- INIT = 0,
21
- UPDATE = 1
16
+ export declare enum ILuigiContextTypes {
17
+ INIT = 0,
18
+ UPDATE = 1
22
19
  }
23
- interface IContextMessage {
24
- context: Context;
25
- contextType: ILuigiContextTypes;
20
+ export interface IContextMessage {
21
+ context: Context;
22
+ contextType: ILuigiContextTypes;
26
23
  }
27
-
28
- declare abstract class LuigiContextService {
29
- /**
30
- * Get a signal that emits when context is set.
31
- */
32
- abstract contextSignal: Signal<IContextMessage | undefined>;
33
- /**
34
- * Listen to context changes
35
- * Receives current value, even if the event was already dispatched earlier.
36
- */
37
- abstract contextObservable(): Observable<IContextMessage>;
38
- /**
39
- * Get latest set context object
40
- */
41
- abstract getContext(): Context;
42
- /**
43
- * Get a promise that resolves when context is set.
44
- */
45
- abstract getContextAsync(): Promise<Context>;
24
+ export declare abstract class LuigiContextService {
25
+ /**
26
+ * Get a signal that emits when context is set.
27
+ */
28
+ abstract contextSignal: Signal<IContextMessage | undefined>;
29
+ /**
30
+ * Listen to context changes
31
+ * Receives current value, even if the event was already dispatched earlier.
32
+ */
33
+ abstract contextObservable(): Observable<IContextMessage>;
34
+ /**
35
+ * Get latest set context object
36
+ */
37
+ abstract getContext(): Context;
38
+ /**
39
+ * Get a promise that resolves when context is set.
40
+ */
41
+ abstract getContextAsync(): Promise<Context>;
46
42
  }
47
-
48
- declare class LuigiAutoRoutingService {
49
- private router;
50
- private luigiContextService;
51
- constructor(router: Router, luigiContextService: LuigiContextService);
52
- doFilter(): OperatorFunction<Event, NavigationEnd>;
53
- /**
54
- * This method will be take in consideration angular route that having in data object the paramter
55
- * fromVirtualTreeRoot: true, here an example:
56
- * {path: 'demo', component: DemoComponent, data:{fromVirtualTreeRoot: true}}
57
- * Another option is to specify the LuigiPath: if you add in route data luigiRoute:'/xxxx/xxx';
58
- * in the case we will update the path in LuigiCore navigation, here an example
59
- * {path: 'demo', component: DemoComponent, data:{luigiRoute: '/home/demo''}}
60
- * If updateModalPathParam is specified, than modalPathParam will be updated upon internal navigation:
61
- * {path: 'demo', component: DemoComponent, data:{updateModalPathParam: true}}
62
- * @param event the NavigationEnd event
63
- */
64
- doSubscription(event: NavigationEnd): void;
65
- getResolvedLuigiRoute(current: ActivatedRouteSnapshot): string | undefined;
66
- getAllParamsFromParents(current: ActivatedRouteSnapshot): {
67
- [key: string]: string;
68
- } | undefined;
69
- private isClientInitialized;
70
- static ɵfac: i0.ɵɵFactoryDeclaration<LuigiAutoRoutingService, never>;
71
- static ɵprov: i0.ɵɵInjectableDeclaration<any>;
43
+ export declare class LuigiAutoRoutingService {
44
+ private router;
45
+ private luigiContextService;
46
+ constructor(router: Router, luigiContextService: LuigiContextService);
47
+ doFilter(): OperatorFunction<Event, NavigationEnd>;
48
+ /**
49
+ * This method will be take in consideration angular route that having in data object the paramter
50
+ * fromVirtualTreeRoot: true, here an example:
51
+ * {path: 'demo', component: DemoComponent, data:{fromVirtualTreeRoot: true}}
52
+ * Another option is to specify the LuigiPath: if you add in route data luigiRoute:'/xxxx/xxx';
53
+ * in the case we will update the path in LuigiCore navigation, here an example
54
+ * {path: 'demo', component: DemoComponent, data:{luigiRoute: '/home/demo''}}
55
+ * If updateModalPathParam is specified, than modalPathParam will be updated upon internal navigation:
56
+ * {path: 'demo', component: DemoComponent, data:{updateModalPathParam: true}}
57
+ * @param event the NavigationEnd event
58
+ */
59
+ doSubscription(event: NavigationEnd): void;
60
+ getResolvedLuigiRoute(current: ActivatedRouteSnapshot): string | undefined;
61
+ getAllParamsFromParents(current: ActivatedRouteSnapshot): {
62
+ [key: string]: string;
63
+ } | undefined;
64
+ private isClientInitialized;
65
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuigiAutoRoutingService, never>;
66
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
72
67
  }
73
-
74
- declare const staticRoutes: Routes;
68
+ export declare const staticRoutes: Routes;
75
69
  /**
76
70
  * @deprecated use provideLuigiAngular instead
77
71
  */
78
- declare class LuigiAngularSupportModule {
79
- constructor(navigation: LuigiAutoRoutingService, context: LuigiContextService);
80
- static ɵfac: i0.ɵɵFactoryDeclaration<LuigiAngularSupportModule, never>;
81
- static ɵmod: i0.ɵɵNgModuleDeclaration<LuigiAngularSupportModule, never, [typeof i1.RouterModule], never>;
82
- static ɵinj: i0.ɵɵInjectorDeclaration<LuigiAngularSupportModule>;
72
+ export declare class LuigiAngularSupportModule {
73
+ constructor(navigation: LuigiAutoRoutingService, context: LuigiContextService);
74
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuigiAngularSupportModule, never>;
75
+ static ɵmod: i0.ɵɵNgModuleDeclaration<LuigiAngularSupportModule, never, [typeof i1.RouterModule], never>;
76
+ static ɵinj: i0.ɵɵInjectorDeclaration<LuigiAngularSupportModule>;
83
77
  }
84
-
85
- declare function provideLuigiAngular(): i0.EnvironmentProviders;
86
-
87
- declare class LuigiContextServiceImpl implements LuigiContextService {
88
- private signalContext;
89
- private subject;
90
- private currentContext;
91
- private ngZone;
92
- /**
93
- * Get a signal that emits when context is set.
94
- */
95
- contextSignal: Signal<IContextMessage | undefined>;
96
- constructor();
97
- addListener(contextType: ILuigiContextTypes, context: Context): void;
98
- /**
99
- * Get an observable that emits when context is set.
100
- */
101
- contextObservable(): Observable<IContextMessage>;
102
- /**
103
- * Get latest context object retrieved from luigi core application or empty object, if not yet set.
104
- */
105
- getContext(): Context;
106
- /**
107
- * Get a promise that resolves when context is set.
108
- */
109
- getContextAsync(): Promise<Context>;
110
- /**
111
- * Checks if input is an object.
112
- * @param objectToCheck mixed
113
- * @returns {boolean}
114
- */
115
- private isObject;
116
- /**
117
- * Set current context
118
- */
119
- protected setContext(obj: IContextMessage): void;
120
- static ɵfac: i0.ɵɵFactoryDeclaration<LuigiContextServiceImpl, never>;
121
- static ɵprov: i0.ɵɵInjectableDeclaration<any>;
122
- }
123
-
124
- export { ILuigiContextTypes, LuigiAngularSupportModule, LuigiAutoRoutingService, LuigiContextService, LuigiContextServiceImpl, LuigiMockModule, LuigiPreloadComponent, provideLuigiAngular, staticRoutes };
125
- export type { IContextMessage };
78
+ export declare function provideLuigiAngular(): import("@angular/core").EnvironmentProviders;
79
+ export declare class LuigiContextServiceImpl implements LuigiContextService {
80
+ private signalContext;
81
+ private subject;
82
+ private currentContext;
83
+ private ngZone;
84
+ /**
85
+ * Get a signal that emits when context is set.
86
+ */
87
+ contextSignal: Signal<IContextMessage | undefined>;
88
+ constructor();
89
+ addListener(contextType: ILuigiContextTypes, context: Context): void;
90
+ /**
91
+ * Get an observable that emits when context is set.
92
+ */
93
+ contextObservable(): Observable<IContextMessage>;
94
+ /**
95
+ * Get latest context object retrieved from luigi core application or empty object, if not yet set.
96
+ */
97
+ getContext(): Context;
98
+ /**
99
+ * Get a promise that resolves when context is set.
100
+ */
101
+ getContextAsync(): Promise<Context>;
102
+ /**
103
+ * Checks if input is an object.
104
+ * @param objectToCheck mixed
105
+ * @returns {boolean}
106
+ */
107
+ private isObject;
108
+ /**
109
+ * Set current context
110
+ */
111
+ protected setContext(obj: IContextMessage): void;
112
+ static ɵfac: i0.ɵɵFactoryDeclaration<LuigiContextServiceImpl, never>;
113
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
114
+ }