@o3r/application 13.0.0-next.0 → 13.0.0-next.10
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/fesm2022/o3r-application.mjs +24 -34
- package/fesm2022/o3r-application.mjs.map +1 -1
- package/index.d.ts +160 -4
- package/index.d.ts.map +1 -0
- package/package.json +14 -14
- package/schemas/functional-content.metadata.schema.json +24 -18
- package/browser-preference/helper.d.ts +0 -7
- package/browser-preference/helper.d.ts.map +0 -1
- package/browser-preference/index.d.ts +0 -2
- package/browser-preference/index.d.ts.map +0 -1
- package/devkit/application-devkit.interface.d.ts +0 -77
- package/devkit/application-devkit.interface.d.ts.map +0 -1
- package/devkit/application-devtools.console.service.d.ts +0 -18
- package/devkit/application-devtools.console.service.d.ts.map +0 -1
- package/devkit/application-devtools.message.service.d.ts +0 -41
- package/devkit/application-devtools.message.service.d.ts.map +0 -1
- package/devkit/application-devtools.module.d.ts +0 -14
- package/devkit/application-devtools.module.d.ts.map +0 -1
- package/devkit/application-devtools.service.d.ts +0 -11
- package/devkit/application-devtools.service.d.ts.map +0 -1
- package/devkit/application-devtools.token.d.ts +0 -5
- package/devkit/application-devtools.token.d.ts.map +0 -1
- package/devkit/index.d.ts +0 -7
- package/devkit/index.d.ts.map +0 -1
- package/o3r-application.d.ts.map +0 -1
- package/public_api.d.ts +0 -3
- package/public_api.d.ts.map +0 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject,
|
|
3
|
-
import { DOCUMENT } from '@angular/common';
|
|
2
|
+
import { InjectionToken, inject, DOCUMENT, Injectable, DestroyRef, NgModule } from '@angular/core';
|
|
4
3
|
import { isProductionEnvironment, sendOtterMessage, filterMessageContent } from '@o3r/core';
|
|
5
4
|
import { ENVIRONMENT_CONFIG_TOKEN } from '@o3r/routing';
|
|
6
5
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
7
|
-
import
|
|
6
|
+
import { LoggerService } from '@o3r/logger';
|
|
8
7
|
import { fromEvent } from 'rxjs';
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -48,10 +47,10 @@ class OtterApplicationDevtools {
|
|
|
48
47
|
isProduction: isProductionEnvironment(this.document?.body.dataset)
|
|
49
48
|
};
|
|
50
49
|
}
|
|
51
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
52
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
50
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: OtterApplicationDevtools, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
51
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: OtterApplicationDevtools, providedIn: 'root' }); }
|
|
53
52
|
}
|
|
54
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: OtterApplicationDevtools, decorators: [{
|
|
55
54
|
type: Injectable,
|
|
56
55
|
args: [{ providedIn: 'root' }]
|
|
57
56
|
}] });
|
|
@@ -60,8 +59,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
60
59
|
class ApplicationDevtoolsConsoleService {
|
|
61
60
|
/** Name of the Window property to access to the devtools */
|
|
62
61
|
static { this.windowModuleName = 'application'; }
|
|
63
|
-
constructor(
|
|
64
|
-
this.applicationDevtools =
|
|
62
|
+
constructor() {
|
|
63
|
+
this.applicationDevtools = inject(OtterApplicationDevtools);
|
|
64
|
+
const options = inject(OTTER_APPLICATION_DEVTOOLS_OPTIONS, { optional: true });
|
|
65
65
|
this.options = { ...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS, ...options };
|
|
66
66
|
if (this.options.isActivatedOnBootstrap) {
|
|
67
67
|
this.activate();
|
|
@@ -78,32 +78,27 @@ class ApplicationDevtoolsConsoleService {
|
|
|
78
78
|
displayApplicationInfo() {
|
|
79
79
|
console.info('Application info', this.applicationDevtools.getApplicationInformation());
|
|
80
80
|
}
|
|
81
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
82
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
81
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ApplicationDevtoolsConsoleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
82
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ApplicationDevtoolsConsoleService, providedIn: 'root' }); }
|
|
83
83
|
}
|
|
84
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
84
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ApplicationDevtoolsConsoleService, decorators: [{
|
|
85
85
|
type: Injectable,
|
|
86
86
|
args: [{
|
|
87
87
|
providedIn: 'root'
|
|
88
88
|
}]
|
|
89
|
-
}], ctorParameters: () => [
|
|
90
|
-
type: Optional
|
|
91
|
-
}, {
|
|
92
|
-
type: Inject,
|
|
93
|
-
args: [OTTER_APPLICATION_DEVTOOLS_OPTIONS]
|
|
94
|
-
}] }] });
|
|
89
|
+
}], ctorParameters: () => [] });
|
|
95
90
|
|
|
96
91
|
const OTTER_STATE_RIBBON_ID = 'otter-devtools-state-ribbon';
|
|
97
92
|
class ApplicationDevtoolsMessageService {
|
|
98
|
-
constructor(
|
|
99
|
-
this.logger = logger;
|
|
100
|
-
this.applicationDevtools = applicationDevtools;
|
|
93
|
+
constructor() {
|
|
101
94
|
this.document = inject(DOCUMENT);
|
|
102
95
|
this.sendMessage = (sendOtterMessage);
|
|
103
96
|
this.destroyRef = inject(DestroyRef);
|
|
97
|
+
this.logger = inject(LoggerService);
|
|
98
|
+
this.applicationDevtools = inject(OtterApplicationDevtools);
|
|
104
99
|
this.options = {
|
|
105
100
|
...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS,
|
|
106
|
-
...
|
|
101
|
+
...inject(OTTER_APPLICATION_DEVTOOLS_OPTIONS, { optional: true })
|
|
107
102
|
};
|
|
108
103
|
if (this.options.isActivatedOnBootstrap) {
|
|
109
104
|
this.activate();
|
|
@@ -211,20 +206,15 @@ class ApplicationDevtoolsMessageService {
|
|
|
211
206
|
.catch((err) => this.logger.warn('Visual testing utilities are not available:', err));
|
|
212
207
|
this.sendApplicationInformation();
|
|
213
208
|
}
|
|
214
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
215
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
209
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ApplicationDevtoolsMessageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
210
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ApplicationDevtoolsMessageService, providedIn: 'root' }); }
|
|
216
211
|
}
|
|
217
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
212
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ApplicationDevtoolsMessageService, decorators: [{
|
|
218
213
|
type: Injectable,
|
|
219
214
|
args: [{
|
|
220
215
|
providedIn: 'root'
|
|
221
216
|
}]
|
|
222
|
-
}], ctorParameters: () => [
|
|
223
|
-
type: Optional
|
|
224
|
-
}, {
|
|
225
|
-
type: Inject,
|
|
226
|
-
args: [OTTER_APPLICATION_DEVTOOLS_OPTIONS]
|
|
227
|
-
}] }] });
|
|
217
|
+
}], ctorParameters: () => [] });
|
|
228
218
|
|
|
229
219
|
class ApplicationDevtoolsModule {
|
|
230
220
|
/**
|
|
@@ -242,16 +232,16 @@ class ApplicationDevtoolsModule {
|
|
|
242
232
|
]
|
|
243
233
|
};
|
|
244
234
|
}
|
|
245
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
246
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
247
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
235
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ApplicationDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
236
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.4", ngImport: i0, type: ApplicationDevtoolsModule }); }
|
|
237
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ApplicationDevtoolsModule, providers: [
|
|
248
238
|
{ provide: OTTER_APPLICATION_DEVTOOLS_OPTIONS, useValue: OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS },
|
|
249
239
|
ApplicationDevtoolsMessageService,
|
|
250
240
|
ApplicationDevtoolsConsoleService,
|
|
251
241
|
OtterApplicationDevtools
|
|
252
242
|
] }); }
|
|
253
243
|
}
|
|
254
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
244
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ApplicationDevtoolsModule, decorators: [{
|
|
255
245
|
type: NgModule,
|
|
256
246
|
args: [{
|
|
257
247
|
providers: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"o3r-application.mjs","sources":["../../src/browser-preference/helper.ts","../../src/devkit/application-devkit.interface.ts","../../src/devkit/application-devtools.token.ts","../../src/devkit/application-devtools.service.ts","../../src/devkit/application-devtools.console.service.ts","../../src/devkit/application-devtools.message.service.ts","../../src/devkit/application-devtools.module.ts","../../src/o3r-application.ts"],"sourcesContent":["/**\n * Method that returns the setting of the user regarding animations.\n * This setting is generally set in the Operating System settings, and it is used by browsers.\n * Refer to: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion\n */\nexport function prefersReducedMotion(): boolean {\n const mediaQueryList = window.matchMedia('(prefers-reduced-motion)');\n\n return mediaQueryList.matches;\n}\n","import type {\n ConnectContentMessage,\n DevtoolsCommonOptions,\n MessageDataTypes,\n OtterMessageContent,\n RequestMessagesContentMessage,\n} from '@o3r/core';\n\nexport interface ApplicationDevtoolsServiceOptions extends DevtoolsCommonOptions {\n /**\n * Application name\n */\n appName?: string;\n /**\n * CSS classname applied to an HTML tag to hide it, ignore it, in the e2e visual testing process\n */\n e2eIgnoreClass?: string;\n}\n\n/**\n * Session information used to track all the calls done by one or several APIs of the SDK.\n */\nexport interface SessionInformation {\n /**\n * The session ID\n */\n id: string;\n /**\n * The generated time\n */\n generatedTime: Date;\n}\n\n/** Information relative loaded application */\nexport interface ApplicationInformation {\n /**\n * Application name\n */\n appName: string;\n /** Application Version */\n appVersion: string;\n /**\n * Session Information\n * @note This is a session ID will be provided only with the Amadeus Otter implementation of the application package.\n */\n session?: SessionInformation;\n /**\n * Log Link\n * @note This a link to Alf logs, it will be provided only with the Amadeus Otter implementation of the application package.\n */\n logLink?: string;\n /** Is Production Environment */\n isProduction: boolean;\n}\n\n/** Toggle Visual Testing */\nexport interface ToggleVisualTestingMessage extends OtterMessageContent<'toggleVisualTesting'> {\n /** Toggle the visual testing mode */\n toggle?: boolean;\n}\n\n/** Application Information Message Content */\nexport interface ApplicationInformationContentMessage extends ApplicationInformation, OtterMessageContent<'applicationInformation'> {\n}\n\n/** State selection message */\nexport interface StateSelectionContentMessage extends OtterMessageContent<'stateSelection'> {\n /** Name of the state */\n stateName: string;\n /** Color of the state */\n stateColor: string;\n /** Contrast color of the state */\n stateColorContrast: string;\n}\n\n/** Unselect state message */\nexport interface UnselectStateContentMessage extends OtterMessageContent<'unselectState'> {}\n\ntype ApplicationMessageContents =\n | ApplicationInformationContentMessage\n | StateSelectionContentMessage\n | UnselectStateContentMessage\n | ToggleVisualTestingMessage;\n\n/** List of possible DataTypes for Application messages */\nexport type ApplicationMessageDataTypes = MessageDataTypes<ApplicationMessageContents>;\n\n/** List of all messages for application purpose */\nexport type AvailableApplicationMessageContents =\n | ApplicationMessageContents\n | ConnectContentMessage\n | RequestMessagesContentMessage<ApplicationMessageDataTypes>;\n\n/**\n * Determine if the given message is a Application message\n * @param message message to check\n */\nexport const isApplicationMessage = (message: any): message is AvailableApplicationMessageContents => {\n return message && (\n message.dataType === 'toggleVisualTesting'\n || message.dataType === 'stateSelection'\n || message.dataType === 'applicationInformation'\n || message.dataType === 'unselectState'\n || message.dataType === 'requestMessages'\n || message.dataType === 'connect');\n};\n","import {\n InjectionToken,\n} from '@angular/core';\nimport {\n ApplicationDevtoolsServiceOptions,\n} from './application-devkit.interface';\n\nexport const OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS: Readonly<ApplicationDevtoolsServiceOptions> = {\n isActivatedOnBootstrap: false\n} as const;\n\nexport const OTTER_APPLICATION_DEVTOOLS_OPTIONS = new InjectionToken<ApplicationDevtoolsServiceOptions>('Otter Application Devtools options');\n","import {\n DOCUMENT,\n} from '@angular/common';\nimport {\n inject,\n Injectable,\n} from '@angular/core';\nimport {\n type Dataset,\n isProductionEnvironment,\n} from '@o3r/core';\nimport {\n ENVIRONMENT_CONFIG_TOKEN,\n} from '@o3r/routing';\nimport type {\n ApplicationInformation,\n} from './application-devkit.interface';\nimport {\n OTTER_APPLICATION_DEVTOOLS_OPTIONS,\n} from './application-devtools.token';\n\n@Injectable({ providedIn: 'root' })\nexport class OtterApplicationDevtools {\n private readonly options = inject(OTTER_APPLICATION_DEVTOOLS_OPTIONS, { optional: true });\n private readonly document = inject(DOCUMENT, { optional: true });\n private readonly env = inject(ENVIRONMENT_CONFIG_TOKEN, { optional: true });\n\n public getApplicationInformation(): ApplicationInformation {\n return {\n appName: this.options?.appName || 'unknown',\n appVersion: this.env?.APP_VERSION || 'unknown',\n isProduction: isProductionEnvironment(this.document?.body.dataset as Dataset)\n };\n }\n}\n","/* eslint-disable no-console -- purpose of the service is to log in the console */\nimport {\n Inject,\n Injectable,\n Optional,\n} from '@angular/core';\nimport type {\n DevtoolsServiceInterface,\n WindowWithDevtools,\n} from '@o3r/core';\nimport {\n ApplicationDevtoolsServiceOptions,\n} from './application-devkit.interface';\nimport {\n OtterApplicationDevtools,\n} from './application-devtools.service';\nimport {\n OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS,\n OTTER_APPLICATION_DEVTOOLS_OPTIONS,\n} from './application-devtools.token';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApplicationDevtoolsConsoleService implements DevtoolsServiceInterface {\n /** Name of the Window property to access to the devtools */\n public static readonly windowModuleName = 'application';\n\n private readonly options: ApplicationDevtoolsServiceOptions;\n\n constructor(\n private readonly applicationDevtools: OtterApplicationDevtools,\n @Optional() @Inject(OTTER_APPLICATION_DEVTOOLS_OPTIONS) options?: ApplicationDevtoolsServiceOptions\n ) {\n this.options = { ...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS, ...options };\n\n if (this.options.isActivatedOnBootstrap) {\n this.activate();\n }\n }\n\n /** @inheritDoc */\n public activate() {\n const windowWithDevtools: WindowWithDevtools = window;\n windowWithDevtools._OTTER_DEVTOOLS_ ||= {};\n windowWithDevtools._OTTER_DEVTOOLS_[ApplicationDevtoolsConsoleService.windowModuleName] = this;\n\n console.info(`Otter Application Devtools is now accessible via the _OTTER_DEVTOOLS_.${ApplicationDevtoolsConsoleService.windowModuleName} variable`);\n }\n\n /** Display the information relative to the running application */\n public displayApplicationInfo() {\n console.info('Application info', this.applicationDevtools.getApplicationInformation());\n }\n}\n","import {\n DOCUMENT,\n} from '@angular/common';\nimport {\n DestroyRef,\n inject,\n Inject,\n Injectable,\n Optional,\n} from '@angular/core';\nimport {\n takeUntilDestroyed,\n} from '@angular/core/rxjs-interop';\nimport {\n DevtoolsServiceInterface,\n filterMessageContent,\n sendOtterMessage,\n} from '@o3r/core';\nimport {\n LoggerService,\n} from '@o3r/logger';\nimport {\n fromEvent,\n} from 'rxjs';\nimport {\n type ApplicationDevtoolsServiceOptions,\n type ApplicationMessageDataTypes,\n type AvailableApplicationMessageContents,\n isApplicationMessage,\n type StateSelectionContentMessage,\n} from './application-devkit.interface';\nimport {\n OtterApplicationDevtools,\n} from './application-devtools.service';\nimport {\n OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS,\n OTTER_APPLICATION_DEVTOOLS_OPTIONS,\n} from './application-devtools.token';\n\nconst OTTER_STATE_RIBBON_ID = 'otter-devtools-state-ribbon';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApplicationDevtoolsMessageService implements DevtoolsServiceInterface {\n private readonly document = inject(DOCUMENT);\n private readonly options: ApplicationDevtoolsServiceOptions;\n private readonly sendMessage = sendOtterMessage<AvailableApplicationMessageContents>;\n private readonly destroyRef = inject(DestroyRef);\n\n constructor(\n private readonly logger: LoggerService,\n private readonly applicationDevtools: OtterApplicationDevtools,\n @Optional() @Inject(OTTER_APPLICATION_DEVTOOLS_OPTIONS) options?: ApplicationDevtoolsServiceOptions) {\n this.options = {\n ...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS,\n ...options\n };\n\n if (this.options.isActivatedOnBootstrap) {\n this.activate();\n }\n }\n\n private sendApplicationInformation() {\n this.sendMessage('applicationInformation', this.applicationDevtools.getApplicationInformation());\n }\n\n /**\n * Function to connect the plugin to the Otter DevTools extension\n */\n private connectPlugin() {\n this.logger.debug('Otter DevTools is plugged to application service of the application');\n void this.sendApplicationInformation();\n }\n\n /**\n * Function to trigger a re-send a requested messages to the Otter Chrome DevTools extension\n * @param only restricted list of messages to re-send\n */\n private handleReEmitRequest(only?: ApplicationMessageDataTypes[]) {\n if (!only || only.includes('applicationInformation')) {\n this.sendApplicationInformation();\n }\n }\n\n /**\n * Function to handle the incoming messages from Otter Chrome DevTools extension\n * @param message\n */\n private async handleEvents(message: AvailableApplicationMessageContents) {\n this.logger.debug('Message handling by the application service', message);\n\n switch (message.dataType) {\n case 'connect': {\n this.connectPlugin();\n break;\n }\n case 'requestMessages': {\n this.handleReEmitRequest(message.only);\n break;\n }\n case 'toggleVisualTesting': {\n await this.toggleVisualTestingRender(message.toggle);\n break;\n }\n case 'stateSelection': {\n this.onStateSelection(message);\n break;\n }\n case 'unselectState': {\n this.unselectState();\n break;\n }\n default: {\n this.logger.warn('Message ignored by the application service', message);\n }\n }\n }\n\n private unselectState() {\n const ribbonElement = this.document.body.querySelector<HTMLDivElement>(`#${OTTER_STATE_RIBBON_ID}`);\n if (ribbonElement) {\n ribbonElement.remove();\n }\n }\n\n private onStateSelection(message: StateSelectionContentMessage) {\n let ribbonElement = this.document.body.querySelector<HTMLDivElement>(`#${OTTER_STATE_RIBBON_ID}`);\n if (!ribbonElement) {\n ribbonElement = this.document.createElement('div');\n ribbonElement.id = OTTER_STATE_RIBBON_ID;\n this.document.body.append(ribbonElement);\n }\n if (message.stateName) {\n ribbonElement.innerHTML = message.stateName;\n ribbonElement.style.background = message.stateColor;\n ribbonElement.style.color = message.stateColorContrast;\n ribbonElement.style.position = 'fixed';\n ribbonElement.style.bottom = '0';\n ribbonElement.style.right = '0';\n ribbonElement.style.transform = 'translate(calc(100% * (1 - cos(45deg)))) rotate(-45deg)';\n ribbonElement.style.transformOrigin = 'bottom left';\n ribbonElement.style.clipPath = 'inset(0 -100%)';\n ribbonElement.style.boxShadow = `0px 0px 0px 999px ${message.stateColor}`;\n } else {\n ribbonElement.style.display = 'none';\n }\n }\n\n /**\n * Toggle visual testing rendering\n * @param enabled activate or deactivate the visual testing mode\n */\n private async toggleVisualTestingRender(enabled?: boolean) {\n try {\n const visualTestUtils = await import('@o3r/testing/visual-test/utils');\n const isEnabled = enabled ?? visualTestUtils.isVisualTestingEnabled();\n visualTestUtils.toggleVisualTestingRender(isEnabled);\n } catch (err) {\n this.logger.warn('Visual testing utilities are not available:', err);\n }\n }\n\n /** @inheritDoc */\n public activate() {\n fromEvent(window, 'message').pipe(\n takeUntilDestroyed(this.destroyRef),\n filterMessageContent(isApplicationMessage)\n ).subscribe((e) => this.handleEvents(e));\n import('@o3r/testing/visual-test/utils')\n .then((visualTestUtils) => visualTestUtils.prepareVisualTesting(this.options.e2eIgnoreClass))\n .catch((err) => this.logger.warn('Visual testing utilities are not available:', err));\n this.sendApplicationInformation();\n }\n}\n","import {\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\nimport type {\n ApplicationDevtoolsServiceOptions,\n} from './application-devkit.interface';\nimport {\n ApplicationDevtoolsConsoleService,\n} from './application-devtools.console.service';\nimport {\n ApplicationDevtoolsMessageService,\n} from './application-devtools.message.service';\nimport {\n OtterApplicationDevtools,\n} from './application-devtools.service';\nimport {\n OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS,\n OTTER_APPLICATION_DEVTOOLS_OPTIONS,\n} from './application-devtools.token';\n\n@NgModule({\n providers: [\n { provide: OTTER_APPLICATION_DEVTOOLS_OPTIONS, useValue: OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS },\n ApplicationDevtoolsMessageService,\n ApplicationDevtoolsConsoleService,\n OtterApplicationDevtools\n ]\n})\nexport class ApplicationDevtoolsModule {\n /**\n * Initialize Otter Devtools\n * @param options\n */\n public static instrument(options: Partial<ApplicationDevtoolsServiceOptions>): ModuleWithProviders<ApplicationDevtoolsModule> {\n return {\n ngModule: ApplicationDevtoolsModule,\n providers: [\n { provide: OTTER_APPLICATION_DEVTOOLS_OPTIONS, useValue: { ...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS, ...options }, multi: false },\n ApplicationDevtoolsMessageService,\n ApplicationDevtoolsConsoleService,\n OtterApplicationDevtools\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;AAIG;SACa,oBAAoB,GAAA;IAClC,MAAM,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,0BAA0B,CAAC;IAEpE,OAAO,cAAc,CAAC,OAAO;AAC/B;;ACoFA;;;AAGG;AACU,MAAA,oBAAoB,GAAG,CAAC,OAAY,KAAoD;AACnG,IAAA,OAAO,OAAO,KACZ,OAAO,CAAC,QAAQ,KAAK;WAClB,OAAO,CAAC,QAAQ,KAAK;WACrB,OAAO,CAAC,QAAQ,KAAK;WACrB,OAAO,CAAC,QAAQ,KAAK;WACrB,OAAO,CAAC,QAAQ,KAAK;AACrB,WAAA,OAAO,CAAC,QAAQ,KAAK,SAAS,CAAC;AACtC;;AClGa,MAAA,0CAA0C,GAAgD;AACrG,IAAA,sBAAsB,EAAE;;MAGb,kCAAkC,GAAG,IAAI,cAAc,CAAoC,oCAAoC;;MCW/H,wBAAwB,CAAA;AADrC,IAAA,WAAA,GAAA;QAEmB,IAAO,CAAA,OAAA,GAAG,MAAM,CAAC,kCAAkC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACxE,IAAQ,CAAA,QAAA,GAAG,MAAM,CAAC,QAAQ,EAAE,EAAE,Q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AA,EAAA,CAAA;kBARrC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,kCAAkC,EAAE,QAAQ,EAAE,0CAA0C,EAAE;wBACrG,iCAAiC;wBACjC,iCAAiC;wBACjC;AACD;AACF,iBAAA;;;AC5BD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"o3r-application.mjs","sources":["../../src/browser-preference/helper.ts","../../src/devkit/application-devkit.interface.ts","../../src/devkit/application-devtools.token.ts","../../src/devkit/application-devtools.service.ts","../../src/devkit/application-devtools.console.service.ts","../../src/devkit/application-devtools.message.service.ts","../../src/devkit/application-devtools.module.ts","../../src/o3r-application.ts"],"sourcesContent":["/**\n * Method that returns the setting of the user regarding animations.\n * This setting is generally set in the Operating System settings, and it is used by browsers.\n * Refer to: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion\n */\nexport function prefersReducedMotion(): boolean {\n const mediaQueryList = window.matchMedia('(prefers-reduced-motion)');\n\n return mediaQueryList.matches;\n}\n","import type {\n ConnectContentMessage,\n DevtoolsCommonOptions,\n MessageDataTypes,\n OtterMessageContent,\n RequestMessagesContentMessage,\n} from '@o3r/core';\n\nexport interface ApplicationDevtoolsServiceOptions extends DevtoolsCommonOptions {\n /**\n * Application name\n */\n appName?: string;\n /**\n * CSS classname applied to an HTML tag to hide it, ignore it, in the e2e visual testing process\n */\n e2eIgnoreClass?: string;\n}\n\n/**\n * Session information used to track all the calls done by one or several APIs of the SDK.\n */\nexport interface SessionInformation {\n /**\n * The session ID\n */\n id: string;\n /**\n * The generated time\n */\n generatedTime: Date;\n}\n\n/** Information relative loaded application */\nexport interface ApplicationInformation {\n /**\n * Application name\n */\n appName: string;\n /** Application Version */\n appVersion: string;\n /**\n * Session Information\n * @note This is a session ID will be provided only with the Amadeus Otter implementation of the application package.\n */\n session?: SessionInformation;\n /**\n * Log Link\n * @note This a link to Alf logs, it will be provided only with the Amadeus Otter implementation of the application package.\n */\n logLink?: string;\n /** Is Production Environment */\n isProduction: boolean;\n}\n\n/** Toggle Visual Testing */\nexport interface ToggleVisualTestingMessage extends OtterMessageContent<'toggleVisualTesting'> {\n /** Toggle the visual testing mode */\n toggle?: boolean;\n}\n\n/** Application Information Message Content */\nexport interface ApplicationInformationContentMessage extends ApplicationInformation, OtterMessageContent<'applicationInformation'> {\n}\n\n/** State selection message */\nexport interface StateSelectionContentMessage extends OtterMessageContent<'stateSelection'> {\n /** Name of the state */\n stateName: string;\n /** Color of the state */\n stateColor: string;\n /** Contrast color of the state */\n stateColorContrast: string;\n}\n\n/** Unselect state message */\nexport interface UnselectStateContentMessage extends OtterMessageContent<'unselectState'> {}\n\ntype ApplicationMessageContents =\n | ApplicationInformationContentMessage\n | StateSelectionContentMessage\n | UnselectStateContentMessage\n | ToggleVisualTestingMessage;\n\n/** List of possible DataTypes for Application messages */\nexport type ApplicationMessageDataTypes = MessageDataTypes<ApplicationMessageContents>;\n\n/** List of all messages for application purpose */\nexport type AvailableApplicationMessageContents =\n | ApplicationMessageContents\n | ConnectContentMessage\n | RequestMessagesContentMessage<ApplicationMessageDataTypes>;\n\n/**\n * Determine if the given message is a Application message\n * @param message message to check\n */\nexport const isApplicationMessage = (message: any): message is AvailableApplicationMessageContents => {\n return message && (\n message.dataType === 'toggleVisualTesting'\n || message.dataType === 'stateSelection'\n || message.dataType === 'applicationInformation'\n || message.dataType === 'unselectState'\n || message.dataType === 'requestMessages'\n || message.dataType === 'connect');\n};\n","import {\n InjectionToken,\n} from '@angular/core';\nimport {\n ApplicationDevtoolsServiceOptions,\n} from './application-devkit.interface';\n\nexport const OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS: Readonly<ApplicationDevtoolsServiceOptions> = {\n isActivatedOnBootstrap: false\n} as const;\n\nexport const OTTER_APPLICATION_DEVTOOLS_OPTIONS = new InjectionToken<ApplicationDevtoolsServiceOptions>('Otter Application Devtools options');\n","import {\n DOCUMENT,\n inject,\n Injectable,\n} from '@angular/core';\nimport {\n type Dataset,\n isProductionEnvironment,\n} from '@o3r/core';\nimport {\n ENVIRONMENT_CONFIG_TOKEN,\n} from '@o3r/routing';\nimport type {\n ApplicationInformation,\n} from './application-devkit.interface';\nimport {\n OTTER_APPLICATION_DEVTOOLS_OPTIONS,\n} from './application-devtools.token';\n\n@Injectable({ providedIn: 'root' })\nexport class OtterApplicationDevtools {\n private readonly options = inject(OTTER_APPLICATION_DEVTOOLS_OPTIONS, { optional: true });\n private readonly document = inject(DOCUMENT, { optional: true });\n private readonly env = inject(ENVIRONMENT_CONFIG_TOKEN, { optional: true });\n\n public getApplicationInformation(): ApplicationInformation {\n return {\n appName: this.options?.appName || 'unknown',\n appVersion: this.env?.APP_VERSION || 'unknown',\n isProduction: isProductionEnvironment(this.document?.body.dataset as Dataset)\n };\n }\n}\n","/* eslint-disable no-console -- purpose of the service is to log in the console */\nimport {\n inject,\n Injectable,\n} from '@angular/core';\nimport type {\n DevtoolsServiceInterface,\n WindowWithDevtools,\n} from '@o3r/core';\nimport {\n ApplicationDevtoolsServiceOptions,\n} from './application-devkit.interface';\nimport {\n OtterApplicationDevtools,\n} from './application-devtools.service';\nimport {\n OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS,\n OTTER_APPLICATION_DEVTOOLS_OPTIONS,\n} from './application-devtools.token';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApplicationDevtoolsConsoleService implements DevtoolsServiceInterface {\n /** Name of the Window property to access to the devtools */\n public static readonly windowModuleName = 'application';\n\n private readonly applicationDevtools = inject(OtterApplicationDevtools);\n private readonly options: ApplicationDevtoolsServiceOptions;\n\n constructor() {\n const options = inject<ApplicationDevtoolsServiceOptions>(OTTER_APPLICATION_DEVTOOLS_OPTIONS, { optional: true });\n\n this.options = { ...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS, ...options };\n\n if (this.options.isActivatedOnBootstrap) {\n this.activate();\n }\n }\n\n /** @inheritDoc */\n public activate() {\n const windowWithDevtools: WindowWithDevtools = window;\n windowWithDevtools._OTTER_DEVTOOLS_ ||= {};\n windowWithDevtools._OTTER_DEVTOOLS_[ApplicationDevtoolsConsoleService.windowModuleName] = this;\n\n console.info(`Otter Application Devtools is now accessible via the _OTTER_DEVTOOLS_.${ApplicationDevtoolsConsoleService.windowModuleName} variable`);\n }\n\n /** Display the information relative to the running application */\n public displayApplicationInfo() {\n console.info('Application info', this.applicationDevtools.getApplicationInformation());\n }\n}\n","import {\n DestroyRef,\n DOCUMENT,\n inject,\n Injectable,\n} from '@angular/core';\nimport {\n takeUntilDestroyed,\n} from '@angular/core/rxjs-interop';\nimport {\n DevtoolsServiceInterface,\n filterMessageContent,\n sendOtterMessage,\n} from '@o3r/core';\nimport {\n LoggerService,\n} from '@o3r/logger';\nimport {\n fromEvent,\n} from 'rxjs';\nimport {\n type ApplicationDevtoolsServiceOptions,\n type ApplicationMessageDataTypes,\n type AvailableApplicationMessageContents,\n isApplicationMessage,\n type StateSelectionContentMessage,\n} from './application-devkit.interface';\nimport {\n OtterApplicationDevtools,\n} from './application-devtools.service';\nimport {\n OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS,\n OTTER_APPLICATION_DEVTOOLS_OPTIONS,\n} from './application-devtools.token';\n\nconst OTTER_STATE_RIBBON_ID = 'otter-devtools-state-ribbon';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApplicationDevtoolsMessageService implements DevtoolsServiceInterface {\n private readonly document = inject(DOCUMENT);\n private readonly options: ApplicationDevtoolsServiceOptions;\n private readonly sendMessage = sendOtterMessage<AvailableApplicationMessageContents>;\n private readonly destroyRef = inject(DestroyRef);\n private readonly logger = inject(LoggerService);\n private readonly applicationDevtools = inject(OtterApplicationDevtools);\n\n constructor() {\n this.options = {\n ...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS,\n ...inject(OTTER_APPLICATION_DEVTOOLS_OPTIONS, { optional: true })\n };\n\n if (this.options.isActivatedOnBootstrap) {\n this.activate();\n }\n }\n\n private sendApplicationInformation() {\n this.sendMessage('applicationInformation', this.applicationDevtools.getApplicationInformation());\n }\n\n /**\n * Function to connect the plugin to the Otter DevTools extension\n */\n private connectPlugin() {\n this.logger.debug('Otter DevTools is plugged to application service of the application');\n void this.sendApplicationInformation();\n }\n\n /**\n * Function to trigger a re-send a requested messages to the Otter Chrome DevTools extension\n * @param only restricted list of messages to re-send\n */\n private handleReEmitRequest(only?: ApplicationMessageDataTypes[]) {\n if (!only || only.includes('applicationInformation')) {\n this.sendApplicationInformation();\n }\n }\n\n /**\n * Function to handle the incoming messages from Otter Chrome DevTools extension\n * @param message\n */\n private async handleEvents(message: AvailableApplicationMessageContents) {\n this.logger.debug('Message handling by the application service', message);\n\n switch (message.dataType) {\n case 'connect': {\n this.connectPlugin();\n break;\n }\n case 'requestMessages': {\n this.handleReEmitRequest(message.only);\n break;\n }\n case 'toggleVisualTesting': {\n await this.toggleVisualTestingRender(message.toggle);\n break;\n }\n case 'stateSelection': {\n this.onStateSelection(message);\n break;\n }\n case 'unselectState': {\n this.unselectState();\n break;\n }\n default: {\n this.logger.warn('Message ignored by the application service', message);\n }\n }\n }\n\n private unselectState() {\n const ribbonElement = this.document.body.querySelector<HTMLDivElement>(`#${OTTER_STATE_RIBBON_ID}`);\n if (ribbonElement) {\n ribbonElement.remove();\n }\n }\n\n private onStateSelection(message: StateSelectionContentMessage) {\n let ribbonElement = this.document.body.querySelector<HTMLDivElement>(`#${OTTER_STATE_RIBBON_ID}`);\n if (!ribbonElement) {\n ribbonElement = this.document.createElement('div');\n ribbonElement.id = OTTER_STATE_RIBBON_ID;\n this.document.body.append(ribbonElement);\n }\n if (message.stateName) {\n ribbonElement.innerHTML = message.stateName;\n ribbonElement.style.background = message.stateColor;\n ribbonElement.style.color = message.stateColorContrast;\n ribbonElement.style.position = 'fixed';\n ribbonElement.style.bottom = '0';\n ribbonElement.style.right = '0';\n ribbonElement.style.transform = 'translate(calc(100% * (1 - cos(45deg)))) rotate(-45deg)';\n ribbonElement.style.transformOrigin = 'bottom left';\n ribbonElement.style.clipPath = 'inset(0 -100%)';\n ribbonElement.style.boxShadow = `0px 0px 0px 999px ${message.stateColor}`;\n } else {\n ribbonElement.style.display = 'none';\n }\n }\n\n /**\n * Toggle visual testing rendering\n * @param enabled activate or deactivate the visual testing mode\n */\n private async toggleVisualTestingRender(enabled?: boolean) {\n try {\n const visualTestUtils = await import('@o3r/testing/visual-test/utils');\n const isEnabled = enabled ?? visualTestUtils.isVisualTestingEnabled();\n visualTestUtils.toggleVisualTestingRender(isEnabled);\n } catch (err) {\n this.logger.warn('Visual testing utilities are not available:', err);\n }\n }\n\n /** @inheritDoc */\n public activate() {\n fromEvent(window, 'message').pipe(\n takeUntilDestroyed(this.destroyRef),\n filterMessageContent(isApplicationMessage)\n ).subscribe((e) => this.handleEvents(e));\n import('@o3r/testing/visual-test/utils')\n .then((visualTestUtils) => visualTestUtils.prepareVisualTesting(this.options.e2eIgnoreClass))\n .catch((err) => this.logger.warn('Visual testing utilities are not available:', err));\n this.sendApplicationInformation();\n }\n}\n","import {\n ModuleWithProviders,\n NgModule,\n} from '@angular/core';\nimport type {\n ApplicationDevtoolsServiceOptions,\n} from './application-devkit.interface';\nimport {\n ApplicationDevtoolsConsoleService,\n} from './application-devtools.console.service';\nimport {\n ApplicationDevtoolsMessageService,\n} from './application-devtools.message.service';\nimport {\n OtterApplicationDevtools,\n} from './application-devtools.service';\nimport {\n OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS,\n OTTER_APPLICATION_DEVTOOLS_OPTIONS,\n} from './application-devtools.token';\n\n@NgModule({\n providers: [\n { provide: OTTER_APPLICATION_DEVTOOLS_OPTIONS, useValue: OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS },\n ApplicationDevtoolsMessageService,\n ApplicationDevtoolsConsoleService,\n OtterApplicationDevtools\n ]\n})\nexport class ApplicationDevtoolsModule {\n /**\n * Initialize Otter Devtools\n * @param options\n */\n public static instrument(options: Partial<ApplicationDevtoolsServiceOptions>): ModuleWithProviders<ApplicationDevtoolsModule> {\n return {\n ngModule: ApplicationDevtoolsModule,\n providers: [\n { provide: OTTER_APPLICATION_DEVTOOLS_OPTIONS, useValue: { ...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS, ...options }, multi: false },\n ApplicationDevtoolsMessageService,\n ApplicationDevtoolsConsoleService,\n OtterApplicationDevtools\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;AAIG;SACa,oBAAoB,GAAA;IAClC,MAAM,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,0BAA0B,CAAC;IAEpE,OAAO,cAAc,CAAC,OAAO;AAC/B;;ACoFA;;;AAGG;AACI,MAAM,oBAAoB,GAAG,CAAC,OAAY,KAAoD;AACnG,IAAA,OAAO,OAAO,KACZ,OAAO,CAAC,QAAQ,KAAK;WAClB,OAAO,CAAC,QAAQ,KAAK;WACrB,OAAO,CAAC,QAAQ,KAAK;WACrB,OAAO,CAAC,QAAQ,KAAK;WACrB,OAAO,CAAC,QAAQ,KAAK;AACrB,WAAA,OAAO,CAAC,QAAQ,KAAK,SAAS,CAAC;AACtC;;AClGO,MAAM,0CAA0C,GAAgD;AACrG,IAAA,sBAAsB,EAAE;;MAGb,kCAAkC,GAAG,IAAI,cAAc,CAAoC,oCAAoC;;MCS/H,wBAAwB,CAAA;AADrC,IAAA,WAAA,GAAA;QAEmB,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,kCAAkC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACxE,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC/C,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,wBAAwB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC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AAE;AACb,iBAAA;;;MCVY,yBAAyB,CAAA;AACpC;;;AAGG;IACI,OAAO,UAAU,CAAC,OAAmD,EAAA;QAC1E,OAAO;AACL,YAAA,QAAQ,EAAE,yBAAyB;AACnC,YAAA,SAAS,EAAE;AACT,gBAAA,EAAE,OAAO,EAAE,kCAAkC,EAAE,QAAQ,EAAE,EAAE,GAAG,0CAA0C,EAAE,GAAG,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;gBACtI,iCAAiC;gBACjC,iCAAiC;gBACjC;AACD;SACF;;iIAdQ,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;kIAAzB,yBAAyB,EAAA,CAAA,CAAA;AAAzB,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,EAAA,SAAA,EAPzB;AACT,YAAA,EAAE,OAAO,EAAE,kCAAkC,EAAE,QAAQ,EAAE,0CAA0C,EAAE;YACrG,iCAAiC;YACjC,iCAAiC;YACjC;AACD,SAAA,EAAA,CAAA,CAAA;;2FAEU,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBARrC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,kCAAkC,EAAE,QAAQ,EAAE,0CAA0C,EAAE;wBACrG,iCAAiC;wBACjC,iCAAiC;wBACjC;AACD;AACF,iBAAA;;;AC5BD;;AAEG;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,162 @@
|
|
|
1
|
+
import { DevtoolsCommonOptions, OtterMessageContent, MessageDataTypes, ConnectContentMessage, RequestMessagesContentMessage, DevtoolsServiceInterface } from '@o3r/core';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { ModuleWithProviders, InjectionToken } from '@angular/core';
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
|
-
*
|
|
6
|
+
* Method that returns the setting of the user regarding animations.
|
|
7
|
+
* This setting is generally set in the Operating System settings, and it is used by browsers.
|
|
8
|
+
* Refer to: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
|
|
3
9
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
10
|
+
declare function prefersReducedMotion(): boolean;
|
|
11
|
+
|
|
12
|
+
interface ApplicationDevtoolsServiceOptions extends DevtoolsCommonOptions {
|
|
13
|
+
/**
|
|
14
|
+
* Application name
|
|
15
|
+
*/
|
|
16
|
+
appName?: string;
|
|
17
|
+
/**
|
|
18
|
+
* CSS classname applied to an HTML tag to hide it, ignore it, in the e2e visual testing process
|
|
19
|
+
*/
|
|
20
|
+
e2eIgnoreClass?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Session information used to track all the calls done by one or several APIs of the SDK.
|
|
24
|
+
*/
|
|
25
|
+
interface SessionInformation {
|
|
26
|
+
/**
|
|
27
|
+
* The session ID
|
|
28
|
+
*/
|
|
29
|
+
id: string;
|
|
30
|
+
/**
|
|
31
|
+
* The generated time
|
|
32
|
+
*/
|
|
33
|
+
generatedTime: Date;
|
|
34
|
+
}
|
|
35
|
+
/** Information relative loaded application */
|
|
36
|
+
interface ApplicationInformation {
|
|
37
|
+
/**
|
|
38
|
+
* Application name
|
|
39
|
+
*/
|
|
40
|
+
appName: string;
|
|
41
|
+
/** Application Version */
|
|
42
|
+
appVersion: string;
|
|
43
|
+
/**
|
|
44
|
+
* Session Information
|
|
45
|
+
* @note This is a session ID will be provided only with the Amadeus Otter implementation of the application package.
|
|
46
|
+
*/
|
|
47
|
+
session?: SessionInformation;
|
|
48
|
+
/**
|
|
49
|
+
* Log Link
|
|
50
|
+
* @note This a link to Alf logs, it will be provided only with the Amadeus Otter implementation of the application package.
|
|
51
|
+
*/
|
|
52
|
+
logLink?: string;
|
|
53
|
+
/** Is Production Environment */
|
|
54
|
+
isProduction: boolean;
|
|
55
|
+
}
|
|
56
|
+
/** Toggle Visual Testing */
|
|
57
|
+
interface ToggleVisualTestingMessage extends OtterMessageContent<'toggleVisualTesting'> {
|
|
58
|
+
/** Toggle the visual testing mode */
|
|
59
|
+
toggle?: boolean;
|
|
60
|
+
}
|
|
61
|
+
/** Application Information Message Content */
|
|
62
|
+
interface ApplicationInformationContentMessage extends ApplicationInformation, OtterMessageContent<'applicationInformation'> {
|
|
63
|
+
}
|
|
64
|
+
/** State selection message */
|
|
65
|
+
interface StateSelectionContentMessage extends OtterMessageContent<'stateSelection'> {
|
|
66
|
+
/** Name of the state */
|
|
67
|
+
stateName: string;
|
|
68
|
+
/** Color of the state */
|
|
69
|
+
stateColor: string;
|
|
70
|
+
/** Contrast color of the state */
|
|
71
|
+
stateColorContrast: string;
|
|
72
|
+
}
|
|
73
|
+
/** Unselect state message */
|
|
74
|
+
interface UnselectStateContentMessage extends OtterMessageContent<'unselectState'> {
|
|
75
|
+
}
|
|
76
|
+
type ApplicationMessageContents = ApplicationInformationContentMessage | StateSelectionContentMessage | UnselectStateContentMessage | ToggleVisualTestingMessage;
|
|
77
|
+
/** List of possible DataTypes for Application messages */
|
|
78
|
+
type ApplicationMessageDataTypes = MessageDataTypes<ApplicationMessageContents>;
|
|
79
|
+
/** List of all messages for application purpose */
|
|
80
|
+
type AvailableApplicationMessageContents = ApplicationMessageContents | ConnectContentMessage | RequestMessagesContentMessage<ApplicationMessageDataTypes>;
|
|
81
|
+
/**
|
|
82
|
+
* Determine if the given message is a Application message
|
|
83
|
+
* @param message message to check
|
|
84
|
+
*/
|
|
85
|
+
declare const isApplicationMessage: (message: any) => message is AvailableApplicationMessageContents;
|
|
86
|
+
|
|
87
|
+
declare class ApplicationDevtoolsConsoleService implements DevtoolsServiceInterface {
|
|
88
|
+
/** Name of the Window property to access to the devtools */
|
|
89
|
+
static readonly windowModuleName = "application";
|
|
90
|
+
private readonly applicationDevtools;
|
|
91
|
+
private readonly options;
|
|
92
|
+
constructor();
|
|
93
|
+
/** @inheritDoc */
|
|
94
|
+
activate(): void;
|
|
95
|
+
/** Display the information relative to the running application */
|
|
96
|
+
displayApplicationInfo(): void;
|
|
97
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationDevtoolsConsoleService, never>;
|
|
98
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ApplicationDevtoolsConsoleService>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
declare class ApplicationDevtoolsMessageService implements DevtoolsServiceInterface {
|
|
102
|
+
private readonly document;
|
|
103
|
+
private readonly options;
|
|
104
|
+
private readonly sendMessage;
|
|
105
|
+
private readonly destroyRef;
|
|
106
|
+
private readonly logger;
|
|
107
|
+
private readonly applicationDevtools;
|
|
108
|
+
constructor();
|
|
109
|
+
private sendApplicationInformation;
|
|
110
|
+
/**
|
|
111
|
+
* Function to connect the plugin to the Otter DevTools extension
|
|
112
|
+
*/
|
|
113
|
+
private connectPlugin;
|
|
114
|
+
/**
|
|
115
|
+
* Function to trigger a re-send a requested messages to the Otter Chrome DevTools extension
|
|
116
|
+
* @param only restricted list of messages to re-send
|
|
117
|
+
*/
|
|
118
|
+
private handleReEmitRequest;
|
|
119
|
+
/**
|
|
120
|
+
* Function to handle the incoming messages from Otter Chrome DevTools extension
|
|
121
|
+
* @param message
|
|
122
|
+
*/
|
|
123
|
+
private handleEvents;
|
|
124
|
+
private unselectState;
|
|
125
|
+
private onStateSelection;
|
|
126
|
+
/**
|
|
127
|
+
* Toggle visual testing rendering
|
|
128
|
+
* @param enabled activate or deactivate the visual testing mode
|
|
129
|
+
*/
|
|
130
|
+
private toggleVisualTestingRender;
|
|
131
|
+
/** @inheritDoc */
|
|
132
|
+
activate(): void;
|
|
133
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationDevtoolsMessageService, never>;
|
|
134
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ApplicationDevtoolsMessageService>;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
declare class ApplicationDevtoolsModule {
|
|
138
|
+
/**
|
|
139
|
+
* Initialize Otter Devtools
|
|
140
|
+
* @param options
|
|
141
|
+
*/
|
|
142
|
+
static instrument(options: Partial<ApplicationDevtoolsServiceOptions>): ModuleWithProviders<ApplicationDevtoolsModule>;
|
|
143
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationDevtoolsModule, never>;
|
|
144
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<ApplicationDevtoolsModule, never, never, never>;
|
|
145
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<ApplicationDevtoolsModule>;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
declare class OtterApplicationDevtools {
|
|
149
|
+
private readonly options;
|
|
150
|
+
private readonly document;
|
|
151
|
+
private readonly env;
|
|
152
|
+
getApplicationInformation(): ApplicationInformation;
|
|
153
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OtterApplicationDevtools, never>;
|
|
154
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<OtterApplicationDevtools>;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
declare const OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS: Readonly<ApplicationDevtoolsServiceOptions>;
|
|
158
|
+
declare const OTTER_APPLICATION_DEVTOOLS_OPTIONS: InjectionToken<ApplicationDevtoolsServiceOptions>;
|
|
159
|
+
|
|
160
|
+
export { ApplicationDevtoolsConsoleService, ApplicationDevtoolsMessageService, ApplicationDevtoolsModule, OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_APPLICATION_DEVTOOLS_OPTIONS, OtterApplicationDevtools, isApplicationMessage, prefersReducedMotion };
|
|
161
|
+
export type { ApplicationDevtoolsServiceOptions, ApplicationInformation, ApplicationInformationContentMessage, ApplicationMessageDataTypes, AvailableApplicationMessageContents, SessionInformation, StateSelectionContentMessage, ToggleVisualTestingMessage, UnselectStateContentMessage };
|
|
162
|
+
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../src/browser-preference/helper.ts","../src/devkit/application-devkit.interface.ts","../src/devkit/application-devtools.console.service.ts","../src/devkit/application-devtools.message.service.ts","../src/devkit/application-devtools.module.ts","../src/devkit/application-devtools.service.ts","../src/devkit/application-devtools.token.ts"],"sourcesContent":[null,null,null,null,null,null,null],"names":[],"mappings":";;;;AAAA;;;;AAIG;AACH;;ACGM;AACJ;;AAEG;;AAEH;;AAEG;;AAEJ;AAED;;AAEG;;AAED;;AAEG;;AAEH;;AAEG;;AAEJ;AAED;;AAEE;;AAEG;;;;AAIH;;;AAGG;;AAEH;;;AAGG;;;;AAIJ;AAED;;;;AAIC;AAED;AACM;AACL;AAED;;;;;;;;AAQC;AAED;;AAC4F;AAE5F;AAMA;;AAGA;AACM;AAKN;;;AAGG;AACH;;AC7EA;;AAKE;AAEA;AACA;;;;;;;;AAyBD;;AChBD;AAIE;AACA;AACA;AACA;AACA;AACA;;AAaA;AAIA;;AAEG;AACH;AAKA;;;AAGG;AACH;AAMA;;;AAGG;;AA+BH;AAOA;AAuBA;;;AAGG;;;;;;AAsBJ;;ACrJD;AASE;;;AAGG;;;;;AAYJ;;AC1BD;AAEE;AACA;AACA;AAEO;;;AAOR;;ACzBD;AAIA;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/application",
|
|
3
|
-
"version": "13.0.0-next.
|
|
3
|
+
"version": "13.0.0-next.10",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -23,19 +23,19 @@
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@angular-devkit/schematics": "^
|
|
27
|
-
"@angular/common": "^
|
|
28
|
-
"@angular/core": "^
|
|
29
|
-
"@o3r/core": "^13.0.0-next.
|
|
30
|
-
"@o3r/logger": "^13.0.0-next.
|
|
31
|
-
"@o3r/routing": "^13.0.0-next.
|
|
32
|
-
"@o3r/schematics": "^13.0.0-next.
|
|
33
|
-
"@o3r/testing": "^13.0.0-next.
|
|
34
|
-
"@schematics/angular": "^
|
|
26
|
+
"@angular-devkit/schematics": "^20.0.0",
|
|
27
|
+
"@angular/common": "^20.0.0",
|
|
28
|
+
"@angular/core": "^20.0.0",
|
|
29
|
+
"@o3r/core": "^13.0.0-next.10",
|
|
30
|
+
"@o3r/logger": "^13.0.0-next.10",
|
|
31
|
+
"@o3r/routing": "^13.0.0-next.10",
|
|
32
|
+
"@o3r/schematics": "^13.0.0-next.10",
|
|
33
|
+
"@o3r/testing": "^13.0.0-next.10",
|
|
34
|
+
"@schematics/angular": "^20.0.0",
|
|
35
35
|
"rxjs": "^7.8.1",
|
|
36
36
|
"ts-node": "~10.9.2",
|
|
37
|
-
"type-fest": "^4.
|
|
38
|
-
"typescript": "^5.
|
|
37
|
+
"type-fest": "^4.30.1",
|
|
38
|
+
"typescript": "^5.8.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependenciesMeta": {
|
|
41
41
|
"@angular-devkit/schematics": {
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@o3r/schematics": "^13.0.0-next.
|
|
58
|
+
"@o3r/schematics": "^13.0.0-next.10",
|
|
59
59
|
"tslib": "^2.6.2"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
|
-
"node": "^20.
|
|
62
|
+
"node": "^20.19.0 || ^22.12.0 || ^24.0.0"
|
|
63
63
|
},
|
|
64
64
|
"schematics": "./collection.json",
|
|
65
65
|
"ng-update": {
|
|
@@ -164,6 +164,26 @@
|
|
|
164
164
|
],
|
|
165
165
|
"description": "Enum collection type of the value type"
|
|
166
166
|
},
|
|
167
|
+
"choices": {
|
|
168
|
+
"type": "array",
|
|
169
|
+
"description": "Array of object to define the choices for a property",
|
|
170
|
+
"minItems": 1,
|
|
171
|
+
"items": {
|
|
172
|
+
"type": "object",
|
|
173
|
+
"required": [
|
|
174
|
+
"key",
|
|
175
|
+
"title"
|
|
176
|
+
],
|
|
177
|
+
"properties": {
|
|
178
|
+
"key": {
|
|
179
|
+
"type": "string"
|
|
180
|
+
},
|
|
181
|
+
"title": {
|
|
182
|
+
"type": "string"
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
},
|
|
167
187
|
"enumProperty": {
|
|
168
188
|
"type": "object",
|
|
169
189
|
"description": "Type of the property (enum)",
|
|
@@ -182,24 +202,7 @@
|
|
|
182
202
|
"$ref": "#/definitions/propertyCollectionType"
|
|
183
203
|
},
|
|
184
204
|
"choices": {
|
|
185
|
-
"
|
|
186
|
-
"description": "Array of object to define the choices for an ENUM valueType",
|
|
187
|
-
"minItems": 1,
|
|
188
|
-
"items": {
|
|
189
|
-
"type": "object",
|
|
190
|
-
"required": [
|
|
191
|
-
"key",
|
|
192
|
-
"title"
|
|
193
|
-
],
|
|
194
|
-
"properties": {
|
|
195
|
-
"key": {
|
|
196
|
-
"type": "string"
|
|
197
|
-
},
|
|
198
|
-
"title": {
|
|
199
|
-
"type": "string"
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
205
|
+
"$ref": "#/definitions/choices"
|
|
203
206
|
},
|
|
204
207
|
"defaultValue": {
|
|
205
208
|
"type": [
|
|
@@ -269,6 +272,9 @@
|
|
|
269
272
|
"collectionType": {
|
|
270
273
|
"$ref": "#/definitions/propertyCollectionType"
|
|
271
274
|
},
|
|
275
|
+
"choices": {
|
|
276
|
+
"$ref": "#/definitions/choices"
|
|
277
|
+
},
|
|
272
278
|
"defaultValue": {
|
|
273
279
|
"type": [
|
|
274
280
|
"string",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Method that returns the setting of the user regarding animations.
|
|
3
|
-
* This setting is generally set in the Operating System settings, and it is used by browsers.
|
|
4
|
-
* Refer to: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
|
|
5
|
-
*/
|
|
6
|
-
export declare function prefersReducedMotion(): boolean;
|
|
7
|
-
//# sourceMappingURL=helper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../src/browser-preference/helper.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAI9C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser-preference/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import type { ConnectContentMessage, DevtoolsCommonOptions, MessageDataTypes, OtterMessageContent, RequestMessagesContentMessage } from '@o3r/core';
|
|
2
|
-
export interface ApplicationDevtoolsServiceOptions extends DevtoolsCommonOptions {
|
|
3
|
-
/**
|
|
4
|
-
* Application name
|
|
5
|
-
*/
|
|
6
|
-
appName?: string;
|
|
7
|
-
/**
|
|
8
|
-
* CSS classname applied to an HTML tag to hide it, ignore it, in the e2e visual testing process
|
|
9
|
-
*/
|
|
10
|
-
e2eIgnoreClass?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Session information used to track all the calls done by one or several APIs of the SDK.
|
|
14
|
-
*/
|
|
15
|
-
export interface SessionInformation {
|
|
16
|
-
/**
|
|
17
|
-
* The session ID
|
|
18
|
-
*/
|
|
19
|
-
id: string;
|
|
20
|
-
/**
|
|
21
|
-
* The generated time
|
|
22
|
-
*/
|
|
23
|
-
generatedTime: Date;
|
|
24
|
-
}
|
|
25
|
-
/** Information relative loaded application */
|
|
26
|
-
export interface ApplicationInformation {
|
|
27
|
-
/**
|
|
28
|
-
* Application name
|
|
29
|
-
*/
|
|
30
|
-
appName: string;
|
|
31
|
-
/** Application Version */
|
|
32
|
-
appVersion: string;
|
|
33
|
-
/**
|
|
34
|
-
* Session Information
|
|
35
|
-
* @note This is a session ID will be provided only with the Amadeus Otter implementation of the application package.
|
|
36
|
-
*/
|
|
37
|
-
session?: SessionInformation;
|
|
38
|
-
/**
|
|
39
|
-
* Log Link
|
|
40
|
-
* @note This a link to Alf logs, it will be provided only with the Amadeus Otter implementation of the application package.
|
|
41
|
-
*/
|
|
42
|
-
logLink?: string;
|
|
43
|
-
/** Is Production Environment */
|
|
44
|
-
isProduction: boolean;
|
|
45
|
-
}
|
|
46
|
-
/** Toggle Visual Testing */
|
|
47
|
-
export interface ToggleVisualTestingMessage extends OtterMessageContent<'toggleVisualTesting'> {
|
|
48
|
-
/** Toggle the visual testing mode */
|
|
49
|
-
toggle?: boolean;
|
|
50
|
-
}
|
|
51
|
-
/** Application Information Message Content */
|
|
52
|
-
export interface ApplicationInformationContentMessage extends ApplicationInformation, OtterMessageContent<'applicationInformation'> {
|
|
53
|
-
}
|
|
54
|
-
/** State selection message */
|
|
55
|
-
export interface StateSelectionContentMessage extends OtterMessageContent<'stateSelection'> {
|
|
56
|
-
/** Name of the state */
|
|
57
|
-
stateName: string;
|
|
58
|
-
/** Color of the state */
|
|
59
|
-
stateColor: string;
|
|
60
|
-
/** Contrast color of the state */
|
|
61
|
-
stateColorContrast: string;
|
|
62
|
-
}
|
|
63
|
-
/** Unselect state message */
|
|
64
|
-
export interface UnselectStateContentMessage extends OtterMessageContent<'unselectState'> {
|
|
65
|
-
}
|
|
66
|
-
type ApplicationMessageContents = ApplicationInformationContentMessage | StateSelectionContentMessage | UnselectStateContentMessage | ToggleVisualTestingMessage;
|
|
67
|
-
/** List of possible DataTypes for Application messages */
|
|
68
|
-
export type ApplicationMessageDataTypes = MessageDataTypes<ApplicationMessageContents>;
|
|
69
|
-
/** List of all messages for application purpose */
|
|
70
|
-
export type AvailableApplicationMessageContents = ApplicationMessageContents | ConnectContentMessage | RequestMessagesContentMessage<ApplicationMessageDataTypes>;
|
|
71
|
-
/**
|
|
72
|
-
* Determine if the given message is a Application message
|
|
73
|
-
* @param message message to check
|
|
74
|
-
*/
|
|
75
|
-
export declare const isApplicationMessage: (message: any) => message is AvailableApplicationMessageContents;
|
|
76
|
-
export {};
|
|
77
|
-
//# sourceMappingURL=application-devkit.interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"application-devkit.interface.d.ts","sourceRoot":"","sources":["../../src/devkit/application-devkit.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,6BAA6B,EAC9B,MAAM,WAAW,CAAC;AAEnB,MAAM,WAAW,iCAAkC,SAAQ,qBAAqB;IAC9E;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,aAAa,EAAE,IAAI,CAAC;CACrB;AAED,8CAA8C;AAC9C,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,4BAA4B;AAC5B,MAAM,WAAW,0BAA2B,SAAQ,mBAAmB,CAAC,qBAAqB,CAAC;IAC5F,qCAAqC;IACrC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,8CAA8C;AAC9C,MAAM,WAAW,oCAAqC,SAAQ,sBAAsB,EAAE,mBAAmB,CAAC,wBAAwB,CAAC;CAClI;AAED,8BAA8B;AAC9B,MAAM,WAAW,4BAA6B,SAAQ,mBAAmB,CAAC,gBAAgB,CAAC;IACzF,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,6BAA6B;AAC7B,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB,CAAC,eAAe,CAAC;CAAG;AAE5F,KAAK,0BAA0B,GAC3B,oCAAoC,GACpC,4BAA4B,GAC5B,2BAA2B,GAC3B,0BAA0B,CAAC;AAE/B,0DAA0D;AAC1D,MAAM,MAAM,2BAA2B,GAAG,gBAAgB,CAAC,0BAA0B,CAAC,CAAC;AAEvF,mDAAmD;AACnD,MAAM,MAAM,mCAAmC,GAC3C,0BAA0B,GAC1B,qBAAqB,GACrB,6BAA6B,CAAC,2BAA2B,CAAC,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,GAAG,KAAG,OAAO,IAAI,mCAQ9D,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { DevtoolsServiceInterface } from '@o3r/core';
|
|
2
|
-
import { ApplicationDevtoolsServiceOptions } from './application-devkit.interface';
|
|
3
|
-
import { OtterApplicationDevtools } from './application-devtools.service';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class ApplicationDevtoolsConsoleService implements DevtoolsServiceInterface {
|
|
6
|
-
private readonly applicationDevtools;
|
|
7
|
-
/** Name of the Window property to access to the devtools */
|
|
8
|
-
static readonly windowModuleName = "application";
|
|
9
|
-
private readonly options;
|
|
10
|
-
constructor(applicationDevtools: OtterApplicationDevtools, options?: ApplicationDevtoolsServiceOptions);
|
|
11
|
-
/** @inheritDoc */
|
|
12
|
-
activate(): void;
|
|
13
|
-
/** Display the information relative to the running application */
|
|
14
|
-
displayApplicationInfo(): void;
|
|
15
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationDevtoolsConsoleService, [null, { optional: true; }]>;
|
|
16
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ApplicationDevtoolsConsoleService>;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=application-devtools.console.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"application-devtools.console.service.d.ts","sourceRoot":"","sources":["../../src/devkit/application-devtools.console.service.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,wBAAwB,EAEzB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,iCAAiC,EAClC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,wBAAwB,EACzB,MAAM,gCAAgC,CAAC;;AAMxC,qBAGa,iCAAkC,YAAW,wBAAwB;IAO9E,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IANtC,4DAA4D;IAC5D,gBAAuB,gBAAgB,iBAAiB;IAExD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoC;gBAGzC,mBAAmB,EAAE,wBAAwB,EACN,OAAO,CAAC,EAAE,iCAAiC;IASrG,kBAAkB;IACX,QAAQ;IAQf,kEAAkE;IAC3D,sBAAsB;yCA3BlB,iCAAiC;6CAAjC,iCAAiC;CA8B7C"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { DevtoolsServiceInterface } from '@o3r/core';
|
|
2
|
-
import { LoggerService } from '@o3r/logger';
|
|
3
|
-
import { type ApplicationDevtoolsServiceOptions } from './application-devkit.interface';
|
|
4
|
-
import { OtterApplicationDevtools } from './application-devtools.service';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class ApplicationDevtoolsMessageService implements DevtoolsServiceInterface {
|
|
7
|
-
private readonly logger;
|
|
8
|
-
private readonly applicationDevtools;
|
|
9
|
-
private readonly document;
|
|
10
|
-
private readonly options;
|
|
11
|
-
private readonly sendMessage;
|
|
12
|
-
private readonly destroyRef;
|
|
13
|
-
constructor(logger: LoggerService, applicationDevtools: OtterApplicationDevtools, options?: ApplicationDevtoolsServiceOptions);
|
|
14
|
-
private sendApplicationInformation;
|
|
15
|
-
/**
|
|
16
|
-
* Function to connect the plugin to the Otter DevTools extension
|
|
17
|
-
*/
|
|
18
|
-
private connectPlugin;
|
|
19
|
-
/**
|
|
20
|
-
* Function to trigger a re-send a requested messages to the Otter Chrome DevTools extension
|
|
21
|
-
* @param only restricted list of messages to re-send
|
|
22
|
-
*/
|
|
23
|
-
private handleReEmitRequest;
|
|
24
|
-
/**
|
|
25
|
-
* Function to handle the incoming messages from Otter Chrome DevTools extension
|
|
26
|
-
* @param message
|
|
27
|
-
*/
|
|
28
|
-
private handleEvents;
|
|
29
|
-
private unselectState;
|
|
30
|
-
private onStateSelection;
|
|
31
|
-
/**
|
|
32
|
-
* Toggle visual testing rendering
|
|
33
|
-
* @param enabled activate or deactivate the visual testing mode
|
|
34
|
-
*/
|
|
35
|
-
private toggleVisualTestingRender;
|
|
36
|
-
/** @inheritDoc */
|
|
37
|
-
activate(): void;
|
|
38
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationDevtoolsMessageService, [null, null, { optional: true; }]>;
|
|
39
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ApplicationDevtoolsMessageService>;
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=application-devtools.message.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"application-devtools.message.service.d.ts","sourceRoot":"","sources":["../../src/devkit/application-devtools.message.service.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,wBAAwB,EAGzB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,aAAa,EACd,MAAM,aAAa,CAAC;AAIrB,OAAO,EACL,KAAK,iCAAiC,EAKvC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,wBAAwB,EACzB,MAAM,gCAAgC,CAAC;;AAQxC,qBAGa,iCAAkC,YAAW,wBAAwB;IAO9E,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IAPtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoB;IAC7C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoC;IAC5D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAyD;IACrF,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsB;gBAG9B,MAAM,EAAE,aAAa,EACrB,mBAAmB,EAAE,wBAAwB,EACN,OAAO,CAAC,EAAE,iCAAiC;IAWrG,OAAO,CAAC,0BAA0B;IAIlC;;OAEG;IACH,OAAO,CAAC,aAAa;IAKrB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAM3B;;;OAGG;YACW,YAAY;IA8B1B,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,gBAAgB;IAuBxB;;;OAGG;YACW,yBAAyB;IAUvC,kBAAkB;IACX,QAAQ;yCAzHJ,iCAAiC;6CAAjC,iCAAiC;CAmI7C"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
-
import type { ApplicationDevtoolsServiceOptions } from './application-devkit.interface';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class ApplicationDevtoolsModule {
|
|
5
|
-
/**
|
|
6
|
-
* Initialize Otter Devtools
|
|
7
|
-
* @param options
|
|
8
|
-
*/
|
|
9
|
-
static instrument(options: Partial<ApplicationDevtoolsServiceOptions>): ModuleWithProviders<ApplicationDevtoolsModule>;
|
|
10
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationDevtoolsModule, never>;
|
|
11
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<ApplicationDevtoolsModule, never, never, never>;
|
|
12
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<ApplicationDevtoolsModule>;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=application-devtools.module.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"application-devtools.module.d.ts","sourceRoot":"","sources":["../../src/devkit/application-devtools.module.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAEpB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,iCAAiC,EAClC,MAAM,gCAAgC,CAAC;;AAexC,qBAQa,yBAAyB;IACpC;;;OAGG;WACW,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,iCAAiC,CAAC,GAAG,mBAAmB,CAAC,yBAAyB,CAAC;yCALlH,yBAAyB;0CAAzB,yBAAyB;0CAAzB,yBAAyB;CAgBrC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ApplicationInformation } from './application-devkit.interface';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class OtterApplicationDevtools {
|
|
4
|
-
private readonly options;
|
|
5
|
-
private readonly document;
|
|
6
|
-
private readonly env;
|
|
7
|
-
getApplicationInformation(): ApplicationInformation;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<OtterApplicationDevtools, never>;
|
|
9
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<OtterApplicationDevtools>;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=application-devtools.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"application-devtools.service.d.ts","sourceRoot":"","sources":["../../src/devkit/application-devtools.service.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,sBAAsB,EACvB,MAAM,gCAAgC,CAAC;;AAKxC,qBACa,wBAAwB;IACnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkE;IAC1F,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwC;IACjE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAwD;IAErE,yBAAyB,IAAI,sBAAsB;yCAL/C,wBAAwB;6CAAxB,wBAAwB;CAYpC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import { ApplicationDevtoolsServiceOptions } from './application-devkit.interface';
|
|
3
|
-
export declare const OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS: Readonly<ApplicationDevtoolsServiceOptions>;
|
|
4
|
-
export declare const OTTER_APPLICATION_DEVTOOLS_OPTIONS: InjectionToken<ApplicationDevtoolsServiceOptions>;
|
|
5
|
-
//# sourceMappingURL=application-devtools.token.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"application-devtools.token.d.ts","sourceRoot":"","sources":["../../src/devkit/application-devtools.token.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,iCAAiC,EAClC,MAAM,gCAAgC,CAAC;AAExC,eAAO,MAAM,0CAA0C,EAAE,QAAQ,CAAC,iCAAiC,CAEzF,CAAC;AAEX,eAAO,MAAM,kCAAkC,mDAA8F,CAAC"}
|
package/devkit/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * from './application-devkit.interface';
|
|
2
|
-
export * from './application-devtools.console.service';
|
|
3
|
-
export * from './application-devtools.message.service';
|
|
4
|
-
export * from './application-devtools.module';
|
|
5
|
-
export * from './application-devtools.service';
|
|
6
|
-
export * from './application-devtools.token';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
package/devkit/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/devkit/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC"}
|
package/o3r-application.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"o3r-application.d.ts","sourceRoot":"","sources":["../src/o3r-application.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,cAAc,cAAc,CAAC"}
|
package/public_api.d.ts
DELETED
package/public_api.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"public_api.d.ts","sourceRoot":"","sources":["../src/public_api.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC"}
|