@ama-mfe/ng-utils 14.0.0-next.1 → 14.0.0-next.3
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 +4 -4
- package/fesm2022/ama-mfe-ng-utils.mjs +424 -346
- package/fesm2022/ama-mfe-ng-utils.mjs.map +1 -1
- package/index.d.ts +256 -210
- package/index.d.ts.map +1 -1
- package/package.json +6 -6
- package/schematics/ng-add/index.js.map +0 -1
- package/schematics/ng-add/schema.js.map +0 -1
package/index.d.ts
CHANGED
|
@@ -1,12 +1,61 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { PipeTransform } from '@angular/core';
|
|
3
|
-
import { VersionedMessage, RoutedMessage, PeerConnectionOptions } from '@amadeus-it-group/microfrontends';
|
|
4
|
-
import { MessagePeerServiceType, MessagePeerConfig } from '@amadeus-it-group/microfrontends-angular';
|
|
5
|
-
export { MessagePeerConfig as ConnectionConfig, MessagePeerService as ConnectionService } from '@amadeus-it-group/microfrontends-angular';
|
|
6
|
-
import { ResizeMessage, ResizeV1_0, NavigationMessage, NavigationV1_0, ThemeMessage, ThemeV1_0, ThemeStructure } from '@ama-mfe/messages';
|
|
7
|
-
import * as rxjs from 'rxjs';
|
|
8
3
|
import { SafeResourceUrl } from '@angular/platform-browser';
|
|
9
4
|
import { Logger } from '@o3r/logger';
|
|
5
|
+
import { MessagePeerConfig, MessagePeerServiceType } from '@amadeus-it-group/microfrontends-angular';
|
|
6
|
+
export { MessagePeerConfig as ConnectionConfig, MessagePeerService as ConnectionService } from '@amadeus-it-group/microfrontends-angular';
|
|
7
|
+
import { HistoryMessage, HistoryV1_0, NavigationMessage, NavigationV1_0, ResizeMessage, ResizeV1_0, ThemeMessage, ThemeV1_0, ThemeStructure } from '@ama-mfe/messages';
|
|
8
|
+
import { VersionedMessage, RoutedMessage, PeerConnectionOptions } from '@amadeus-it-group/microfrontends';
|
|
9
|
+
import * as rxjs from 'rxjs';
|
|
10
|
+
|
|
11
|
+
declare class ConnectDirective {
|
|
12
|
+
/**
|
|
13
|
+
* The connection ID required for the message peer service.
|
|
14
|
+
*/
|
|
15
|
+
connect: i0.InputSignal<string>;
|
|
16
|
+
/**
|
|
17
|
+
* The sanitized source URL for the iframe.
|
|
18
|
+
*/
|
|
19
|
+
src: i0.InputSignal<SafeResourceUrl | undefined>;
|
|
20
|
+
/**
|
|
21
|
+
* Binds the `src` attribute of the iframe to the sanitized source URL.
|
|
22
|
+
*/
|
|
23
|
+
get srcAttr(): SafeResourceUrl | undefined;
|
|
24
|
+
private readonly messageService;
|
|
25
|
+
private readonly domSanitizer;
|
|
26
|
+
private readonly iframeElement;
|
|
27
|
+
private readonly clientOrigin;
|
|
28
|
+
constructor();
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ConnectDirective, never>;
|
|
30
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ConnectDirective, "iframe[connect]", never, { "connect": { "alias": "connect"; "required": true; "isSignal": true; }; "src": { "alias": "src"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Options to configure the connection inside the communication protocol */
|
|
34
|
+
interface ConnectionConfigOptions extends Omit<MessagePeerConfig, 'id'> {
|
|
35
|
+
/** @inheritdoc */
|
|
36
|
+
id?: string;
|
|
37
|
+
/** Logger used to gather information */
|
|
38
|
+
logger?: Logger;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Provide the communication protocol connection configuration
|
|
42
|
+
* @param connectionConfigOptions The identifier of the application in the communication protocol ecosystem plus the types of messages able to exchange and a logger object
|
|
43
|
+
*/
|
|
44
|
+
declare function provideConnection(connectionConfigOptions?: ConnectionConfigOptions): i0.EnvironmentProviders;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Gets the available consumers and formats them into a {@see DeclareMessages} object.
|
|
48
|
+
* @param consumers - The list of registered message consumers.
|
|
49
|
+
* @returns The formatted DeclareMessages object.
|
|
50
|
+
*/
|
|
51
|
+
declare const getAvailableConsumers: (consumers: BasicMessageConsumer[]) => {
|
|
52
|
+
type: "declare_messages";
|
|
53
|
+
version: "1.0";
|
|
54
|
+
messages: {
|
|
55
|
+
type: string;
|
|
56
|
+
version: string;
|
|
57
|
+
}[];
|
|
58
|
+
};
|
|
10
59
|
|
|
11
60
|
/** the error message type */
|
|
12
61
|
declare const ERROR_MESSAGE_TYPE = "error";
|
|
@@ -50,20 +99,6 @@ declare const isErrorMessage: (message: any) => message is VersionedMessage & {
|
|
|
50
99
|
type: typeof ERROR_MESSAGE_TYPE;
|
|
51
100
|
} & ErrorContent;
|
|
52
101
|
|
|
53
|
-
/**
|
|
54
|
-
* Gets the available consumers and formats them into a {@see DeclareMessages} object.
|
|
55
|
-
* @param consumers - The list of registered message consumers.
|
|
56
|
-
* @returns The formatted DeclareMessages object.
|
|
57
|
-
*/
|
|
58
|
-
declare const getAvailableConsumers: (consumers: BasicMessageConsumer[]) => {
|
|
59
|
-
type: "declare_messages";
|
|
60
|
-
version: "1.0";
|
|
61
|
-
messages: {
|
|
62
|
-
type: string;
|
|
63
|
-
version: string;
|
|
64
|
-
}[];
|
|
65
|
-
};
|
|
66
|
-
|
|
67
102
|
/**
|
|
68
103
|
* Use the message payload to execute an action based on message type
|
|
69
104
|
* @param message message to consume
|
|
@@ -183,92 +218,120 @@ declare const registerProducer: (producer: MessageProducer) => void;
|
|
|
183
218
|
declare const registerConsumer: (consumer: MessageConsumer) => void;
|
|
184
219
|
|
|
185
220
|
/**
|
|
186
|
-
*
|
|
221
|
+
* A service that handles history messages.
|
|
222
|
+
*
|
|
223
|
+
* This service listens for history messages and navigates accordingly.
|
|
187
224
|
*/
|
|
188
|
-
declare class
|
|
189
|
-
private readonly newHeight;
|
|
190
|
-
/**
|
|
191
|
-
* A readonly signal that provides the new height information from the channel.
|
|
192
|
-
*/
|
|
193
|
-
readonly newHeightFromChannel: i0.Signal<{
|
|
194
|
-
height: number;
|
|
195
|
-
channelId: string;
|
|
196
|
-
} | undefined>;
|
|
225
|
+
declare class HistoryConsumerService implements MessageConsumer<HistoryMessage> {
|
|
197
226
|
/**
|
|
198
|
-
* The type of messages this service handles
|
|
227
|
+
* The type of messages this service handles.
|
|
199
228
|
*/
|
|
200
|
-
readonly type = "
|
|
229
|
+
readonly type = "history";
|
|
201
230
|
/**
|
|
202
|
-
*
|
|
231
|
+
* @inheritdoc
|
|
203
232
|
*/
|
|
204
|
-
supportedVersions: {
|
|
233
|
+
readonly supportedVersions: {
|
|
205
234
|
/**
|
|
206
|
-
* Use the message
|
|
235
|
+
* Use the message payload to navigate in the history
|
|
207
236
|
* @param message message to consume
|
|
208
237
|
*/
|
|
209
|
-
'1.0': (message: RoutedMessage<
|
|
238
|
+
'1.0': (message: RoutedMessage<HistoryV1_0>) => void;
|
|
210
239
|
};
|
|
211
240
|
private readonly consumerManagerService;
|
|
212
241
|
constructor();
|
|
213
242
|
/**
|
|
214
|
-
*
|
|
243
|
+
* @inheritdoc
|
|
215
244
|
*/
|
|
216
245
|
start(): void;
|
|
217
246
|
/**
|
|
218
|
-
*
|
|
247
|
+
* @inheritdoc
|
|
219
248
|
*/
|
|
220
249
|
stop(): void;
|
|
221
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
222
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<
|
|
250
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HistoryConsumerService, never>;
|
|
251
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<HistoryConsumerService>;
|
|
223
252
|
}
|
|
224
253
|
|
|
225
254
|
/**
|
|
226
|
-
*
|
|
227
|
-
*
|
|
255
|
+
* Provides necessary overrides to make the module navigation in history work in an embedded context :
|
|
256
|
+
* - Prevent pushing states to history, replace state instead
|
|
257
|
+
* - Handle history navigation via History messages to let the host manage the states
|
|
228
258
|
*/
|
|
229
|
-
declare
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
259
|
+
declare function provideHistoryOverrides(): i0.EnvironmentProviders;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Search parameter to add to the URL when embedding an iframe containing the URL of the host.
|
|
263
|
+
* This is needed to support Firefox (on which {@link https://developer.mozilla.org/docs/Web/API/Location/ancestorOrigins | location.ancestorOrigins} is not currently supported)
|
|
264
|
+
* in case of redirection inside the iframe.
|
|
265
|
+
*/
|
|
266
|
+
declare const MFE_HOST_URL_PARAM = "ama-mfe-host-url";
|
|
267
|
+
/**
|
|
268
|
+
* Search parameter to add to the URL to let a module know on which application it's embedded
|
|
269
|
+
*/
|
|
270
|
+
declare const MFE_HOST_APPLICATION_ID_PARAM = "ama-mfe-host-app-id";
|
|
271
|
+
/**
|
|
272
|
+
* Search parameter to add to the URL to identify the application in the network of peers in the communication protocol
|
|
273
|
+
*/
|
|
274
|
+
declare const MFE_MODULE_APPLICATION_ID_PARAM = "ama-mfe-module-app-id";
|
|
275
|
+
/** The list of query parameters which can be set by the host */
|
|
276
|
+
declare const hostQueryParams: string[];
|
|
277
|
+
/**
|
|
278
|
+
* Information set up at host level to use in embedded context
|
|
279
|
+
*/
|
|
280
|
+
interface MFEHostInformation {
|
|
233
281
|
/**
|
|
234
|
-
*
|
|
282
|
+
* URL of the host application
|
|
235
283
|
*/
|
|
236
|
-
|
|
237
|
-
constructor();
|
|
284
|
+
hostURL?: string;
|
|
238
285
|
/**
|
|
239
|
-
*
|
|
286
|
+
* ID of the host application
|
|
240
287
|
*/
|
|
241
|
-
|
|
288
|
+
hostApplicationId?: string;
|
|
242
289
|
/**
|
|
243
|
-
*
|
|
244
|
-
* When the height changes, it sends a resize message with the new height, to the connected peers
|
|
290
|
+
* ID of the module to embed defined at host level
|
|
245
291
|
*/
|
|
246
|
-
|
|
247
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ResizeService, never>;
|
|
248
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ResizeService>;
|
|
292
|
+
moduleApplicationId?: string;
|
|
249
293
|
}
|
|
294
|
+
/**
|
|
295
|
+
* Gather the host information from the url parameters
|
|
296
|
+
* The host url will use the first found among:
|
|
297
|
+
* - look for the search parameter {@link MFE_HOST_URL_PARAM} in the URL of the iframe
|
|
298
|
+
* - use the first item in `location.ancestorOrigins` (currently not supported on Firefox)
|
|
299
|
+
* - use `document.referrer` (will only work if called before any redirection in the iframe)
|
|
300
|
+
* The host application ID is taken from the search parameter {@link MFE_HOST_APPLICATION_ID_PARAM} in the URL of the iframe
|
|
301
|
+
* The module application ID is taken from the search parameter {@link MFE_APPLICATION_ID_PARAM} in the URL of the iframe
|
|
302
|
+
* @param locationParam - A {@link Location} object with information about the current location of the document. Defaults to global {@link location}.
|
|
303
|
+
*/
|
|
304
|
+
declare function getHostInfo(locationParam?: Location): MFEHostInformation;
|
|
305
|
+
/**
|
|
306
|
+
* Gather the host information from the url parameters and handle the persistence in session storage.
|
|
307
|
+
*/
|
|
308
|
+
declare function persistHostInfo(): void;
|
|
250
309
|
|
|
251
310
|
/**
|
|
252
|
-
* A
|
|
311
|
+
* A pipe that adds the host information in the URL of an iframe,
|
|
253
312
|
*/
|
|
254
|
-
declare class
|
|
255
|
-
|
|
256
|
-
* The connection ID for the element, used as channel id backup
|
|
257
|
-
*/
|
|
258
|
-
connect: i0.InputSignal<string | undefined>;
|
|
259
|
-
/**
|
|
260
|
-
* The channel id
|
|
261
|
-
*/
|
|
262
|
-
scalable: i0.InputSignal<string | undefined>;
|
|
263
|
-
private readonly resizeHandler;
|
|
313
|
+
declare class HostInfoPipe implements PipeTransform {
|
|
314
|
+
private readonly domSanitizer;
|
|
264
315
|
/**
|
|
265
|
-
*
|
|
266
|
-
*
|
|
316
|
+
* Transforms the given URL or SafeResourceUrl by appending query parameters.
|
|
317
|
+
* @param url - The URL or SafeResourceUrl to be transformed.
|
|
318
|
+
* @param options - hostId and moduleId
|
|
319
|
+
* @returns - The transformed SafeResourceUrl or undefined if the input URL is invalid.
|
|
267
320
|
*/
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
321
|
+
transform(url: string, options: {
|
|
322
|
+
hostId: string;
|
|
323
|
+
moduleId?: string;
|
|
324
|
+
}): string;
|
|
325
|
+
transform(url: SafeResourceUrl, options: {
|
|
326
|
+
hostId: string;
|
|
327
|
+
moduleId?: string;
|
|
328
|
+
}): SafeResourceUrl;
|
|
329
|
+
transform(url: undefined, options: {
|
|
330
|
+
hostId: string;
|
|
331
|
+
moduleId?: string;
|
|
332
|
+
}): undefined;
|
|
333
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HostInfoPipe, never>;
|
|
334
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<HostInfoPipe, "hostInfo", true>;
|
|
272
335
|
}
|
|
273
336
|
|
|
274
337
|
/**
|
|
@@ -327,6 +390,48 @@ declare class NavigationConsumerService implements MessageConsumer<NavigationMes
|
|
|
327
390
|
static ɵprov: i0.ɵɵInjectableDeclaration<NavigationConsumerService>;
|
|
328
391
|
}
|
|
329
392
|
|
|
393
|
+
/**
|
|
394
|
+
* Options for restoring a route with optional query parameters and memory channel ID.
|
|
395
|
+
*/
|
|
396
|
+
interface RestoreRouteOptions {
|
|
397
|
+
/**
|
|
398
|
+
* Whether to propagate query parameters from the top window to the module URL.
|
|
399
|
+
*/
|
|
400
|
+
propagateQueryParams?: boolean;
|
|
401
|
+
/**
|
|
402
|
+
* Whether to override existing query parameters in the module URL with those from the top window.
|
|
403
|
+
*/
|
|
404
|
+
overrideQueryParams?: boolean;
|
|
405
|
+
/**
|
|
406
|
+
* The memory channel ID used to retrieve the memorized route.
|
|
407
|
+
* If provided, the memorized route associated with this ID will be used.
|
|
408
|
+
*/
|
|
409
|
+
memoryChannelId?: string;
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* A pipe that restores a route with optional query parameters and memory channel ID.
|
|
413
|
+
*
|
|
414
|
+
* This pipe is used to transform a URL or SafeResourceUrl by appending query parameters
|
|
415
|
+
* and adjusting the pathname based on the current active route and memorized route.
|
|
416
|
+
*/
|
|
417
|
+
declare class RestoreRoute implements PipeTransform {
|
|
418
|
+
private readonly activeRoute;
|
|
419
|
+
private readonly domSanitizer;
|
|
420
|
+
private readonly routeMemorizeService;
|
|
421
|
+
private readonly window;
|
|
422
|
+
/**
|
|
423
|
+
* Transforms the given URL or SafeResourceUrl by appending query parameters and adjusting the pathname.
|
|
424
|
+
* @param url - The URL or SafeResourceUrl to be transformed.
|
|
425
|
+
* @param options - Optional parameters to control the transformation. {@see RestoreRouteOptions}
|
|
426
|
+
* @returns - The transformed SafeResourceUrl or undefined if the input URL is invalid.
|
|
427
|
+
*/
|
|
428
|
+
transform(url: string, options?: Partial<RestoreRouteOptions>): string;
|
|
429
|
+
transform(url: SafeResourceUrl, options?: Partial<RestoreRouteOptions>): SafeResourceUrl;
|
|
430
|
+
transform(url: undefined, options?: Partial<RestoreRouteOptions>): undefined;
|
|
431
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RestoreRoute, never>;
|
|
432
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<RestoreRoute, "restoreRoute", true>;
|
|
433
|
+
}
|
|
434
|
+
|
|
330
435
|
declare class RouteMemorizeDirective {
|
|
331
436
|
/**
|
|
332
437
|
* Whether to memorize the route.
|
|
@@ -403,6 +508,7 @@ declare class RoutingService implements MessageProducer<NavigationMessage>, Mess
|
|
|
403
508
|
private readonly activatedRoute;
|
|
404
509
|
private readonly messageService;
|
|
405
510
|
private readonly logger;
|
|
511
|
+
private readonly window;
|
|
406
512
|
/**
|
|
407
513
|
* @inheritdoc
|
|
408
514
|
*/
|
|
@@ -443,44 +549,92 @@ declare class RoutingService implements MessageProducer<NavigationMessage>, Mess
|
|
|
443
549
|
}
|
|
444
550
|
|
|
445
551
|
/**
|
|
446
|
-
*
|
|
552
|
+
* This service listens for resize messages and updates the height of elements based on the received messages.
|
|
447
553
|
*/
|
|
448
|
-
|
|
554
|
+
declare class ResizeConsumerService implements MessageConsumer<ResizeMessage> {
|
|
555
|
+
private readonly newHeight;
|
|
449
556
|
/**
|
|
450
|
-
*
|
|
557
|
+
* A readonly signal that provides the new height information from the channel.
|
|
451
558
|
*/
|
|
452
|
-
|
|
559
|
+
readonly newHeightFromChannel: i0.Signal<{
|
|
560
|
+
height: number;
|
|
561
|
+
channelId: string;
|
|
562
|
+
} | undefined>;
|
|
453
563
|
/**
|
|
454
|
-
*
|
|
564
|
+
* The type of messages this service handles ('resize').
|
|
455
565
|
*/
|
|
456
|
-
|
|
566
|
+
readonly type = "resize";
|
|
457
567
|
/**
|
|
458
|
-
* The
|
|
459
|
-
* If provided, the memorized route associated with this ID will be used.
|
|
568
|
+
* The supported versions of resize messages and their handlers.
|
|
460
569
|
*/
|
|
461
|
-
|
|
570
|
+
supportedVersions: {
|
|
571
|
+
/**
|
|
572
|
+
* Use the message paylod to compute a new height and emit it via the public signal
|
|
573
|
+
* @param message message to consume
|
|
574
|
+
*/
|
|
575
|
+
'1.0': (message: RoutedMessage<ResizeV1_0>) => void;
|
|
576
|
+
};
|
|
577
|
+
private readonly consumerManagerService;
|
|
578
|
+
constructor();
|
|
579
|
+
/**
|
|
580
|
+
* Starts the resize handler service by registering it into the consumer manager service.
|
|
581
|
+
*/
|
|
582
|
+
start(): void;
|
|
583
|
+
/**
|
|
584
|
+
* Stops the resize handler service by unregistering it from the consumer manager service.
|
|
585
|
+
*/
|
|
586
|
+
stop(): void;
|
|
587
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ResizeConsumerService, never>;
|
|
588
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ResizeConsumerService>;
|
|
462
589
|
}
|
|
590
|
+
|
|
463
591
|
/**
|
|
464
|
-
*
|
|
465
|
-
*
|
|
466
|
-
* This pipe is used to transform a URL or SafeResourceUrl by appending query parameters
|
|
467
|
-
* and adjusting the pathname based on the current active route and memorized route.
|
|
592
|
+
* This service observe changes in the document's body height.
|
|
593
|
+
* When the height changes, it sends a resize message with the new height, to the connected peers
|
|
468
594
|
*/
|
|
469
|
-
declare class
|
|
470
|
-
private
|
|
471
|
-
private readonly
|
|
472
|
-
private
|
|
595
|
+
declare class ResizeService implements MessageProducer<ResizeMessage> {
|
|
596
|
+
private actualHeight?;
|
|
597
|
+
private readonly messageService;
|
|
598
|
+
private resizeObserver?;
|
|
473
599
|
/**
|
|
474
|
-
*
|
|
475
|
-
* @param url - The URL or SafeResourceUrl to be transformed.
|
|
476
|
-
* @param options - Optional parameters to control the transformation. {@see RestoreRouteOptions}
|
|
477
|
-
* @returns - The transformed SafeResourceUrl or undefined if the input URL is invalid.
|
|
600
|
+
* @inheritdoc
|
|
478
601
|
*/
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
602
|
+
readonly types = "resize";
|
|
603
|
+
constructor();
|
|
604
|
+
/**
|
|
605
|
+
* @inheritdoc
|
|
606
|
+
*/
|
|
607
|
+
handleError(message: ErrorContent<ResizeMessage>): void;
|
|
608
|
+
/**
|
|
609
|
+
* This method sets up a `ResizeObserver` to observe changes in the document's body height.
|
|
610
|
+
* When the height changes, it sends a resize message with the new height, to the connected peers
|
|
611
|
+
*/
|
|
612
|
+
startResizeObserver(): void;
|
|
613
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ResizeService, never>;
|
|
614
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ResizeService>;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* A directive that adjusts the height of an element based on resize messages from a specified channel.
|
|
619
|
+
*/
|
|
620
|
+
declare class ScalableDirective {
|
|
621
|
+
/**
|
|
622
|
+
* The connection ID for the element, used as channel id backup
|
|
623
|
+
*/
|
|
624
|
+
connect: i0.InputSignal<string | undefined>;
|
|
625
|
+
/**
|
|
626
|
+
* The channel id
|
|
627
|
+
*/
|
|
628
|
+
scalable: i0.InputSignal<string | undefined>;
|
|
629
|
+
private readonly resizeHandler;
|
|
630
|
+
/**
|
|
631
|
+
* This signal checks if the current channel requesting the resize matches the channel ID from the resize handler.
|
|
632
|
+
* If they match, it returns the new height information; otherwise, it returns undefined.
|
|
633
|
+
*/
|
|
634
|
+
private readonly newHeightFromChannel;
|
|
635
|
+
constructor();
|
|
636
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ScalableDirective, never>;
|
|
637
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ScalableDirective, "[scalable]", never, { "connect": { "alias": "connect"; "required": false; "isSignal": true; }; "scalable": { "alias": "scalable"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
484
638
|
}
|
|
485
639
|
|
|
486
640
|
/**
|
|
@@ -581,6 +735,7 @@ declare class ThemeProducerService implements MessageProducer<ThemeMessage> {
|
|
|
581
735
|
private readonly messageService;
|
|
582
736
|
private readonly logger;
|
|
583
737
|
private previousTheme;
|
|
738
|
+
private readonly window;
|
|
584
739
|
private readonly currentThemeSelection;
|
|
585
740
|
/** Current selected theme signal */
|
|
586
741
|
readonly currentTheme: i0.Signal<ThemeStructure | undefined>;
|
|
@@ -606,41 +761,6 @@ declare class ThemeProducerService implements MessageProducer<ThemeMessage> {
|
|
|
606
761
|
static ɵprov: i0.ɵɵInjectableDeclaration<ThemeProducerService>;
|
|
607
762
|
}
|
|
608
763
|
|
|
609
|
-
declare class ConnectDirective {
|
|
610
|
-
/**
|
|
611
|
-
* The connection ID required for the message peer service.
|
|
612
|
-
*/
|
|
613
|
-
connect: i0.InputSignal<string>;
|
|
614
|
-
/**
|
|
615
|
-
* The sanitized source URL for the iframe.
|
|
616
|
-
*/
|
|
617
|
-
src: i0.InputSignal<SafeResourceUrl | undefined>;
|
|
618
|
-
/**
|
|
619
|
-
* Binds the `src` attribute of the iframe to the sanitized source URL.
|
|
620
|
-
*/
|
|
621
|
-
get srcAttr(): SafeResourceUrl | undefined;
|
|
622
|
-
private readonly messageService;
|
|
623
|
-
private readonly domSanitizer;
|
|
624
|
-
private readonly iframeElement;
|
|
625
|
-
private readonly clientOrigin;
|
|
626
|
-
constructor();
|
|
627
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ConnectDirective, never>;
|
|
628
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ConnectDirective, "iframe[connect]", never, { "connect": { "alias": "connect"; "required": true; "isSignal": true; }; "src": { "alias": "src"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
/** Options to configure the connection inside the communication protocol */
|
|
632
|
-
interface ConnectionConfigOptions extends Omit<MessagePeerConfig, 'id'> {
|
|
633
|
-
/** @inheritdoc */
|
|
634
|
-
id?: string;
|
|
635
|
-
/** Logger used to gather information */
|
|
636
|
-
logger?: Logger;
|
|
637
|
-
}
|
|
638
|
-
/**
|
|
639
|
-
* Provide the communication protocol connection configuration
|
|
640
|
-
* @param connectionConfigOptions The identifier of the application in the communication protocol ecosystem plus the types of messages able to exchange and a logger object
|
|
641
|
-
*/
|
|
642
|
-
declare function provideConnection(connectionConfigOptions?: ConnectionConfigOptions): i0.EnvironmentProviders;
|
|
643
|
-
|
|
644
764
|
/**
|
|
645
765
|
* A constant array of known message types and their versions.
|
|
646
766
|
*/
|
|
@@ -655,84 +775,10 @@ declare const KNOWN_MESSAGES: [{
|
|
|
655
775
|
declare function getDefaultClientEndpointStartOptions(): PeerConnectionOptions;
|
|
656
776
|
/**
|
|
657
777
|
* Return `true` if embedded inside an iframe, `false` otherwise
|
|
778
|
+
* @param windowParam - A {@link window} object with information about the current window of the document. Defaults to global {@link window}.
|
|
658
779
|
*/
|
|
659
|
-
declare function isEmbedded(): boolean;
|
|
660
|
-
|
|
661
|
-
/**
|
|
662
|
-
* Search parameter to add to the URL when embedding an iframe containing the URL of the host.
|
|
663
|
-
* This is needed to support Firefox (on which {@link https://developer.mozilla.org/docs/Web/API/Location/ancestorOrigins | location.ancestorOrigins} is not currently supported)
|
|
664
|
-
* in case of redirection inside the iframe.
|
|
665
|
-
*/
|
|
666
|
-
declare const MFE_HOST_URL_PARAM = "ama-mfe-host-url";
|
|
667
|
-
/**
|
|
668
|
-
* Search parameter to add to the URL to let a module know on which application it's embedded
|
|
669
|
-
*/
|
|
670
|
-
declare const MFE_HOST_APPLICATION_ID_PARAM = "ama-mfe-host-app-id";
|
|
671
|
-
/**
|
|
672
|
-
* Search parameter to add to the URL to identify the application in the network of peers in the communication protocol
|
|
673
|
-
*/
|
|
674
|
-
declare const MFE_MODULE_APPLICATION_ID_PARAM = "ama-mfe-module-app-id";
|
|
675
|
-
/** The list of query parameters which can be set by the host */
|
|
676
|
-
declare const hostQueryParams: string[];
|
|
677
|
-
/**
|
|
678
|
-
* Information set up at host level to use in embedded context
|
|
679
|
-
*/
|
|
680
|
-
interface MFEHostInformation {
|
|
681
|
-
/**
|
|
682
|
-
* URL of the host application
|
|
683
|
-
*/
|
|
684
|
-
hostURL?: string;
|
|
685
|
-
/**
|
|
686
|
-
* ID of the host application
|
|
687
|
-
*/
|
|
688
|
-
hostApplicationId?: string;
|
|
689
|
-
/**
|
|
690
|
-
* ID of the module to embed defined at host level
|
|
691
|
-
*/
|
|
692
|
-
moduleApplicationId?: string;
|
|
693
|
-
}
|
|
694
|
-
/**
|
|
695
|
-
* Gather the host information from the url parameters
|
|
696
|
-
* The host url will use the first found among:
|
|
697
|
-
* - look for the search parameter {@link MFE_HOST_URL_PARAM} in the URL of the iframe
|
|
698
|
-
* - use the first item in `location.ancestorOrigins` (currently not supported on Firefox)
|
|
699
|
-
* - use `document.referrer` (will only work if called before any redirection in the iframe)
|
|
700
|
-
* The host application ID is taken from the search parameter {@link MFE_HOST_APPLICATION_ID_PARAM} in the URL of the iframe
|
|
701
|
-
* The module application ID is taken from the search parameter {@link MFE_APPLICATION_ID_PARAM} in the URL of the iframe
|
|
702
|
-
*/
|
|
703
|
-
declare function getHostInfo(): MFEHostInformation;
|
|
704
|
-
/**
|
|
705
|
-
* Gather the host information from the url parameters and handle the persistence in session storage.
|
|
706
|
-
*/
|
|
707
|
-
declare function persistHostInfo(): void;
|
|
708
|
-
|
|
709
|
-
/**
|
|
710
|
-
* A pipe that adds the host information in the URL of an iframe,
|
|
711
|
-
*/
|
|
712
|
-
declare class HostInfoPipe implements PipeTransform {
|
|
713
|
-
private readonly domSanitizer;
|
|
714
|
-
/**
|
|
715
|
-
* Transforms the given URL or SafeResourceUrl by appending query parameters.
|
|
716
|
-
* @param url - The URL or SafeResourceUrl to be transformed.
|
|
717
|
-
* @param options - hostId and moduleId
|
|
718
|
-
* @returns - The transformed SafeResourceUrl or undefined if the input URL is invalid.
|
|
719
|
-
*/
|
|
720
|
-
transform(url: string, options: {
|
|
721
|
-
hostId: string;
|
|
722
|
-
moduleId?: string;
|
|
723
|
-
}): string;
|
|
724
|
-
transform(url: SafeResourceUrl, options: {
|
|
725
|
-
hostId: string;
|
|
726
|
-
moduleId?: string;
|
|
727
|
-
}): SafeResourceUrl;
|
|
728
|
-
transform(url: undefined, options: {
|
|
729
|
-
hostId: string;
|
|
730
|
-
moduleId?: string;
|
|
731
|
-
}): undefined;
|
|
732
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<HostInfoPipe, never>;
|
|
733
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<HostInfoPipe, "hostInfo", true>;
|
|
734
|
-
}
|
|
780
|
+
declare function isEmbedded(windowParam?: Window): boolean;
|
|
735
781
|
|
|
736
|
-
export { ApplyTheme, ConnectDirective, ConsumerManagerService, ERROR_MESSAGE_TYPE, HostInfoPipe, KNOWN_MESSAGES, MFE_HOST_APPLICATION_ID_PARAM, MFE_HOST_URL_PARAM, MFE_MODULE_APPLICATION_ID_PARAM, NavigationConsumerService, ProducerManagerService, ResizeConsumerService, ResizeService, RestoreRoute, RouteMemorizeDirective, RouteMemorizeService, RoutingService, ScalableDirective, THEME_QUERY_PARAM_NAME, THEME_URL_SUFFIX, ThemeConsumerService, ThemeProducerService, applyInitialTheme, applyTheme, downloadApplicationThemeCss, getAvailableConsumers, getDefaultClientEndpointStartOptions, getHostInfo, getStyle, hostQueryParams, isEmbedded, isErrorMessage, persistHostInfo, provideConnection, registerConsumer, registerProducer, sendError };
|
|
782
|
+
export { ApplyTheme, ConnectDirective, ConsumerManagerService, ERROR_MESSAGE_TYPE, HistoryConsumerService, HostInfoPipe, KNOWN_MESSAGES, MFE_HOST_APPLICATION_ID_PARAM, MFE_HOST_URL_PARAM, MFE_MODULE_APPLICATION_ID_PARAM, NavigationConsumerService, ProducerManagerService, ResizeConsumerService, ResizeService, RestoreRoute, RouteMemorizeDirective, RouteMemorizeService, RoutingService, ScalableDirective, THEME_QUERY_PARAM_NAME, THEME_URL_SUFFIX, ThemeConsumerService, ThemeProducerService, applyInitialTheme, applyTheme, downloadApplicationThemeCss, getAvailableConsumers, getDefaultClientEndpointStartOptions, getHostInfo, getStyle, hostQueryParams, isEmbedded, isErrorMessage, persistHostInfo, provideConnection, provideHistoryOverrides, registerConsumer, registerProducer, sendError };
|
|
737
783
|
export type { BasicMessageConsumer, ConnectionConfigOptions, ErrorContent, ErrorMessage, ErrorMessageV1_0, ErrorReason, MFEHostInformation, MessageCallback, MessageConsumer, MessageProducer, MessageVersions, RestoreRouteOptions, RoutingServiceOptions, StyleHelperOptions };
|
|
738
784
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sources":["../src/
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../src/connect/connect-directive.ts","../src/connect/connect-providers.ts","../src/messages/available-sender.ts","../src/messages/error/base.ts","../src/messages/error/error-versions.ts","../src/messages/error/index.ts","../src/messages/error-sender.ts","../src/managers/interfaces.ts","../src/managers/consumer-manager-service.ts","../src/managers/producer-manager-service.ts","../src/managers/utils.ts","../src/history/history-consumer-service.ts","../src/history/history-providers.ts","../src/host-info/host-info.ts","../src/host-info/host-info-pipe.ts","../src/navigation/navigation-consumer-service.ts","../src/navigation/restore-route-pipe.ts","../src/navigation/route-memorize/route-memorize-directive.ts","../src/navigation/route-memorize/route-memorize-service.ts","../src/navigation/routing-service.ts","../src/resize/resize-consumer-service.ts","../src/resize/resize-producer-service.ts","../src/resize/scalable-directive.ts","../src/theme/apply-theme-pipe.ts","../src/theme/theme-consumer-service.ts","../src/theme/theme-helpers.ts","../src/theme/theme-producer-service.ts","../src/utils.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ama-mfe/ng-utils",
|
|
3
|
-
"version": "14.0.0-next.
|
|
3
|
+
"version": "14.0.0-next.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
7
|
"peerDependencies": {
|
|
8
|
-
"@ama-mfe/messages": "
|
|
8
|
+
"@ama-mfe/messages": "~14.0.0-next.3",
|
|
9
9
|
"@amadeus-it-group/microfrontends": "0.0.9",
|
|
10
10
|
"@amadeus-it-group/microfrontends-angular": "0.0.9",
|
|
11
11
|
"@angular-devkit/core": "^20.0.0",
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
"@angular/core": "^20.0.0",
|
|
15
15
|
"@angular/platform-browser": "^20.0.0",
|
|
16
16
|
"@angular/router": "^20.0.0",
|
|
17
|
-
"@o3r/logger": "
|
|
18
|
-
"@o3r/schematics": "
|
|
17
|
+
"@o3r/logger": "~14.0.0-next.3",
|
|
18
|
+
"@o3r/schematics": "~14.0.0-next.3",
|
|
19
19
|
"rxjs": "^7.8.1",
|
|
20
20
|
"type-fest": "^4.30.1"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@amadeus-it-group/microfrontends": "0.0.9",
|
|
24
24
|
"@amadeus-it-group/microfrontends-angular": "0.0.9",
|
|
25
|
-
"@o3r/logger": "
|
|
26
|
-
"@o3r/schematics": "
|
|
25
|
+
"@o3r/logger": "~14.0.0-next.3",
|
|
26
|
+
"@o3r/schematics": "~14.0.0-next.3",
|
|
27
27
|
"tslib": "^2.6.2"
|
|
28
28
|
},
|
|
29
29
|
"sideEffects": false,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;;AAAA,kCAAkC;AAClC,2DAIoC;AACpC,gDAIyB;AAKzB,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;AAE5E,MAAM,cAAc,GAAG,CAAC,QAA+B,EAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE;IACzE,wBAAwB;IACxB,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,wBAAwB,GAAa,EAAE,CAAC;AAE9C;;GAEG;AACH,MAAM,qBAAqB,GAAa;IACtC,iBAAiB;IACjB,eAAe;IACf,iBAAiB;CAClB,CAAC;AAEF;;;GAGG;AACH,SAAS,OAAO,CAAC,OAA8B;IAC7C,OAAO,IAAA,kBAAK,EAAC;QACX,cAAc,CAAC,OAAO,CAAC;QACvB,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,iBAAI,GAAE,CAAC,CAAC,CAAC,IAAA,2BAAc,GAAE;QAC9C,IAAA,kCAAqB,EAAC,OAAO,EAAE,eAAe,EAAE,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,CAAC;KACrG,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACI,MAAM,KAAK,GAAG,CAAC,OAA8B,EAAE,EAAE,CAAC,IAAA,iCAAoB,EAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;AAAnF,QAAA,KAAK,SAA8E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../schematics/ng-add/schema.ts"],"names":[],"mappings":""}
|