@o3r/application 12.3.7 → 12.3.8
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/devkit/application-devtools.message.service.d.ts.map +1 -1
- package/fesm2022/o3r-application.mjs +14 -6
- package/fesm2022/o3r-application.mjs.map +1 -1
- package/package.json +14 -7
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +22 -1
- package/schematics/ng-add/index.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
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;
|
|
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"}
|
|
@@ -5,7 +5,6 @@ import { isProductionEnvironment, sendOtterMessage, filterMessageContent } from
|
|
|
5
5
|
import { ENVIRONMENT_CONFIG_TOKEN } from '@o3r/routing';
|
|
6
6
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
7
7
|
import * as i1 from '@o3r/logger';
|
|
8
|
-
import { toggleVisualTestingRender, isVisualTestingEnabled, prepareVisualTesting } from '@o3r/testing/visual-test/utils';
|
|
9
8
|
import { fromEvent } from 'rxjs';
|
|
10
9
|
|
|
11
10
|
/**
|
|
@@ -133,7 +132,7 @@ class ApplicationDevtoolsMessageService {
|
|
|
133
132
|
* Function to handle the incoming messages from Otter Chrome DevTools extension
|
|
134
133
|
* @param message
|
|
135
134
|
*/
|
|
136
|
-
handleEvents(message) {
|
|
135
|
+
async handleEvents(message) {
|
|
137
136
|
this.logger.debug('Message handling by the application service', message);
|
|
138
137
|
switch (message.dataType) {
|
|
139
138
|
case 'connect': {
|
|
@@ -145,7 +144,7 @@ class ApplicationDevtoolsMessageService {
|
|
|
145
144
|
break;
|
|
146
145
|
}
|
|
147
146
|
case 'toggleVisualTesting': {
|
|
148
|
-
this.toggleVisualTestingRender(message.toggle);
|
|
147
|
+
await this.toggleVisualTestingRender(message.toggle);
|
|
149
148
|
break;
|
|
150
149
|
}
|
|
151
150
|
case 'stateSelection': {
|
|
@@ -194,13 +193,22 @@ class ApplicationDevtoolsMessageService {
|
|
|
194
193
|
* Toggle visual testing rendering
|
|
195
194
|
* @param enabled activate or deactivate the visual testing mode
|
|
196
195
|
*/
|
|
197
|
-
toggleVisualTestingRender(enabled) {
|
|
198
|
-
|
|
196
|
+
async toggleVisualTestingRender(enabled) {
|
|
197
|
+
try {
|
|
198
|
+
const visualTestUtils = await import('@o3r/testing/visual-test/utils');
|
|
199
|
+
const isEnabled = enabled ?? visualTestUtils.isVisualTestingEnabled();
|
|
200
|
+
visualTestUtils.toggleVisualTestingRender(isEnabled);
|
|
201
|
+
}
|
|
202
|
+
catch (err) {
|
|
203
|
+
this.logger.warn('Visual testing utilities are not available:', err);
|
|
204
|
+
}
|
|
199
205
|
}
|
|
200
206
|
/** @inheritDoc */
|
|
201
207
|
activate() {
|
|
202
208
|
fromEvent(window, 'message').pipe(takeUntilDestroyed(this.destroyRef), filterMessageContent(isApplicationMessage)).subscribe((e) => this.handleEvents(e));
|
|
203
|
-
|
|
209
|
+
import('@o3r/testing/visual-test/utils')
|
|
210
|
+
.then((visualTestUtils) => visualTestUtils.prepareVisualTesting(this.options.e2eIgnoreClass))
|
|
211
|
+
.catch((err) => this.logger.warn('Visual testing utilities are not available:', err));
|
|
204
212
|
this.sendApplicationInformation();
|
|
205
213
|
}
|
|
206
214
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: ApplicationDevtoolsMessageService, deps: [{ token: i1.LoggerService }, { token: OtterApplicationDevtools }, { token: OTTER_APPLICATION_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
@@ -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 isVisualTestingEnabled,\n prepareVisualTesting,\n toggleVisualTestingRender,\n} from '@o3r/testing/visual-test/utils';\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 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 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 toggleVisualTestingRender(enabled?: boolean) {\n toggleVisualTestingRender(enabled === undefined ? !isVisualTestingEnabled() : enabled);\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 prepareVisualTesting(this.options.e2eIgnoreClass);\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;A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,EAPzB,SAAA,EAAA;AACT,YAAA,EAAE,OAAO,EAAE,kCAAkC,EAAE,QAAQ,EAAE,0CAA0C,EAAE;YACrG,iCAAiC;YACjC,iCAAiC;YACjC;AACD,SAAA,EAAA,CAAA,CAAA;;4FAEU,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;;;;"}
|
|
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,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O,EAAE,kCAAkC,EAAE,QAAQ,EAAE,0CAA0C,EAAE;YACrG,iCAAiC;YACjC,iCAAiC;YACjC;AACD,SAAA,EAAA,CAAA,CAAA;;4FAEU,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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/application",
|
|
3
|
-
"version": "12.3.
|
|
3
|
+
"version": "12.3.8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -26,14 +26,15 @@
|
|
|
26
26
|
"@angular-devkit/schematics": "^19.0.0",
|
|
27
27
|
"@angular/common": "^19.0.0",
|
|
28
28
|
"@angular/core": "^19.0.0",
|
|
29
|
-
"@o3r/core": "^12.3.
|
|
30
|
-
"@o3r/logger": "^12.3.
|
|
31
|
-
"@o3r/routing": "^12.3.
|
|
32
|
-
"@o3r/schematics": "^12.3.
|
|
33
|
-
"@o3r/testing": "^12.3.
|
|
29
|
+
"@o3r/core": "^12.3.8",
|
|
30
|
+
"@o3r/logger": "^12.3.8",
|
|
31
|
+
"@o3r/routing": "^12.3.8",
|
|
32
|
+
"@o3r/schematics": "^12.3.8",
|
|
33
|
+
"@o3r/testing": "^12.3.8",
|
|
34
34
|
"@schematics/angular": "^19.0.0",
|
|
35
35
|
"rxjs": "^7.8.1",
|
|
36
36
|
"ts-node": "~10.9.2",
|
|
37
|
+
"type-fest": "^4.30.1",
|
|
37
38
|
"typescript": "^5.5.4"
|
|
38
39
|
},
|
|
39
40
|
"peerDependenciesMeta": {
|
|
@@ -43,12 +44,18 @@
|
|
|
43
44
|
"@o3r/schematics": {
|
|
44
45
|
"optional": true
|
|
45
46
|
},
|
|
47
|
+
"@o3r/testing": {
|
|
48
|
+
"optional": true
|
|
49
|
+
},
|
|
50
|
+
"type-fest": {
|
|
51
|
+
"optional": true
|
|
52
|
+
},
|
|
46
53
|
"typescript": {
|
|
47
54
|
"optional": true
|
|
48
55
|
}
|
|
49
56
|
},
|
|
50
57
|
"dependencies": {
|
|
51
|
-
"@o3r/schematics": "^12.3.
|
|
58
|
+
"@o3r/schematics": "^12.3.8",
|
|
52
59
|
"tslib": "^2.6.2"
|
|
53
60
|
},
|
|
54
61
|
"engines": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,IAAI,EAGL,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,IAAI,EAGL,MAAM,4BAA4B,CAAC;AAwBpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAyHlB;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,qBAAqB,SAA2C,CAAC"}
|
|
@@ -6,6 +6,18 @@ const schematics_1 = require("@angular-devkit/schematics");
|
|
|
6
6
|
const schematics_2 = require("@o3r/schematics");
|
|
7
7
|
const utility_1 = require("@schematics/angular/utility");
|
|
8
8
|
const devtools_registration_1 = require("./helpers/devtools-registration");
|
|
9
|
+
/**
|
|
10
|
+
* List of external dependencies to be added to the project as peer dependencies
|
|
11
|
+
*/
|
|
12
|
+
const dependenciesToInstall = [
|
|
13
|
+
'@angular/common',
|
|
14
|
+
'@angular/core',
|
|
15
|
+
'rxjs'
|
|
16
|
+
];
|
|
17
|
+
/**
|
|
18
|
+
* List of external dependencies to be added to the project as dev dependencies
|
|
19
|
+
*/
|
|
20
|
+
const devDependenciesToInstall = [];
|
|
9
21
|
/**
|
|
10
22
|
* Add Otter application to an Angular Project
|
|
11
23
|
* @param options The options to pass to ng-add execution
|
|
@@ -55,11 +67,20 @@ function ngAddFn(options) {
|
|
|
55
67
|
};
|
|
56
68
|
return acc;
|
|
57
69
|
}, (0, schematics_2.getPackageInstallConfig)(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion));
|
|
70
|
+
const projectDirectory = workspaceProject?.root || '.';
|
|
71
|
+
const projectPackageJson = tree.readJson(path.posix.join(projectDirectory, 'package.json'));
|
|
72
|
+
const externalDependenciesInfo = (0, schematics_2.getExternalDependenciesInfo)({
|
|
73
|
+
devDependenciesToInstall,
|
|
74
|
+
dependenciesToInstall,
|
|
75
|
+
projectType: workspaceProject?.projectType,
|
|
76
|
+
o3rPackageJsonPath: packageJsonPath,
|
|
77
|
+
projectPackageJson
|
|
78
|
+
}, context.logger);
|
|
58
79
|
const registerDevtoolRule = (0, devtools_registration_1.registerDevtools)(options);
|
|
59
80
|
return () => (0, schematics_1.chain)([
|
|
60
81
|
(0, schematics_2.setupDependencies)({
|
|
61
82
|
projectName: options.projectName,
|
|
62
|
-
dependencies,
|
|
83
|
+
dependencies: { ...dependencies, ...externalDependenciesInfo },
|
|
63
84
|
ngAddToRun: depsInfo.o3rPeerDeps
|
|
64
85
|
}),
|
|
65
86
|
addAngularAnimationPreferences,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;;AAAA,kCAAkC;AAMlC,2DAEoC;AACpC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;;AAAA,kCAAkC;AAMlC,2DAEoC;AACpC,gDAUyB;AACzB,yDAEqC;AAIrC,2EAEyC;AAKzC;;GAEG;AACH,MAAM,qBAAqB,GAAG;IAC5B,i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