@o3r/application 14.0.0-next.1 → 14.0.0-next.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47,10 +47,10 @@ class OtterApplicationDevtools {
47
47
  isProduction: isProductionEnvironment(this.document?.body.dataset)
48
48
  };
49
49
  }
50
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: OtterApplicationDevtools, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
51
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: OtterApplicationDevtools, providedIn: 'root' }); }
50
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.13", ngImport: i0, type: OtterApplicationDevtools, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
51
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.13", ngImport: i0, type: OtterApplicationDevtools, providedIn: 'root' }); }
52
52
  }
53
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: OtterApplicationDevtools, decorators: [{
53
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.13", ngImport: i0, type: OtterApplicationDevtools, decorators: [{
54
54
  type: Injectable,
55
55
  args: [{ providedIn: 'root' }]
56
56
  }] });
@@ -78,10 +78,10 @@ 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: "20.2.4", ngImport: i0, type: ApplicationDevtoolsConsoleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
82
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApplicationDevtoolsConsoleService, providedIn: 'root' }); }
81
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.13", ngImport: i0, type: ApplicationDevtoolsConsoleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
82
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.13", ngImport: i0, type: ApplicationDevtoolsConsoleService, providedIn: 'root' }); }
83
83
  }
84
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApplicationDevtoolsConsoleService, decorators: [{
84
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.13", ngImport: i0, type: ApplicationDevtoolsConsoleService, decorators: [{
85
85
  type: Injectable,
86
86
  args: [{
87
87
  providedIn: 'root'
@@ -206,10 +206,10 @@ class ApplicationDevtoolsMessageService {
206
206
  .catch((err) => this.logger.warn('Visual testing utilities are not available:', err));
207
207
  this.sendApplicationInformation();
208
208
  }
209
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApplicationDevtoolsMessageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
210
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApplicationDevtoolsMessageService, providedIn: 'root' }); }
209
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.13", ngImport: i0, type: ApplicationDevtoolsMessageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
210
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.13", ngImport: i0, type: ApplicationDevtoolsMessageService, providedIn: 'root' }); }
211
211
  }
212
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApplicationDevtoolsMessageService, decorators: [{
212
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.13", ngImport: i0, type: ApplicationDevtoolsMessageService, decorators: [{
213
213
  type: Injectable,
214
214
  args: [{
215
215
  providedIn: 'root'
@@ -232,16 +232,16 @@ class ApplicationDevtoolsModule {
232
232
  ]
233
233
  };
234
234
  }
235
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApplicationDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
236
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.4", ngImport: i0, type: ApplicationDevtoolsModule }); }
237
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApplicationDevtoolsModule, providers: [
235
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.13", ngImport: i0, type: ApplicationDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
236
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.13", ngImport: i0, type: ApplicationDevtoolsModule }); }
237
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.13", ngImport: i0, type: ApplicationDevtoolsModule, providers: [
238
238
  { provide: OTTER_APPLICATION_DEVTOOLS_OPTIONS, useValue: OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS },
239
239
  ApplicationDevtoolsMessageService,
240
240
  ApplicationDevtoolsConsoleService,
241
241
  OtterApplicationDevtools
242
242
  ] }); }
243
243
  }
244
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ApplicationDevtoolsModule, decorators: [{
244
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.13", ngImport: i0, type: ApplicationDevtoolsModule, decorators: [{
245
245
  type: NgModule,
246
246
  args: [{
247
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 = 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 = 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;;ACkFA;;;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;;AChGO,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,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../../src/browser-preference/helper.ts","../../src/devkit/application-devkit-interface.ts","../../src/devkit/application-devtools-token.ts","../../src/devkit/application-devtools.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 = 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 = 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';\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';\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 OtterApplicationDevtools,\n} from './application-devtools';\nimport {\n ApplicationDevtoolsConsoleService,\n} from './application-devtools-console-service';\nimport {\n ApplicationDevtoolsMessageService,\n} from './application-devtools-message-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}\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O,EAAE,kCAAkC,EAAE,QAAQ,EAAE,EAAE,GAAG,0CAA0C,EAAE,GAAG,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;gBACtI,iCAAiC;gBACjC,iCAAiC;gBACjC;AACD;SACF;IACH;kIAfW,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;mIAAzB,yBAAyB,EAAA,CAAA,CAAA;AAAzB,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,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;;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/index.d.ts CHANGED
@@ -84,6 +84,15 @@ type AvailableApplicationMessageContents = ApplicationMessageContents | ConnectC
84
84
  */
85
85
  declare const isApplicationMessage: (message: any) => message is AvailableApplicationMessageContents;
86
86
 
87
+ declare class OtterApplicationDevtools {
88
+ private readonly options;
89
+ private readonly document;
90
+ private readonly env;
91
+ getApplicationInformation(): ApplicationInformation;
92
+ static ɵfac: i0.ɵɵFactoryDeclaration<OtterApplicationDevtools, never>;
93
+ static ɵprov: i0.ɵɵInjectableDeclaration<OtterApplicationDevtools>;
94
+ }
95
+
87
96
  declare class ApplicationDevtoolsConsoleService implements DevtoolsServiceInterface {
88
97
  /** Name of the Window property to access to the devtools */
89
98
  static readonly windowModuleName = "application";
@@ -145,15 +154,6 @@ declare class ApplicationDevtoolsModule {
145
154
  static ɵinj: i0.ɵɵInjectorDeclaration<ApplicationDevtoolsModule>;
146
155
  }
147
156
 
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
157
  declare const OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS: Readonly<ApplicationDevtoolsServiceOptions>;
158
158
  declare const OTTER_APPLICATION_DEVTOOLS_OPTIONS: InjectionToken<ApplicationDevtoolsServiceOptions>;
159
159
 
package/index.d.ts.map CHANGED
@@ -1 +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;AAKA;;AAGA;AACM;AAIN;;;AAGG;AACH;;AC3EA;;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;;;"}
1
+ {"version":3,"file":"index.d.ts","sources":["../src/browser-preference/helper.ts","../src/devkit/application-devkit-interface.ts","../src/devkit/application-devtools.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-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;AAKA;;AAGA;AACM;AAIN;;;AAGG;AACH;;AC5EA;AAEE;AACA;AACA;AAEO;;;AAOR;;ACZD;;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;;ACtCD;AAIA;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3r/application",
3
- "version": "14.0.0-next.1",
3
+ "version": "14.0.0-next.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -26,14 +26,13 @@
26
26
  "@angular-devkit/schematics": "^20.0.0",
27
27
  "@angular/common": "^20.0.0",
28
28
  "@angular/core": "^20.0.0",
29
- "@o3r/core": "^14.0.0-next.1",
30
- "@o3r/logger": "^14.0.0-next.1",
31
- "@o3r/routing": "^14.0.0-next.1",
32
- "@o3r/schematics": "^14.0.0-next.1",
33
- "@o3r/testing": "^14.0.0-next.1",
29
+ "@o3r/core": "~14.0.0-next.3",
30
+ "@o3r/logger": "~14.0.0-next.3",
31
+ "@o3r/routing": "~14.0.0-next.3",
32
+ "@o3r/schematics": "~14.0.0-next.3",
33
+ "@o3r/testing": "~14.0.0-next.3",
34
34
  "@schematics/angular": "^20.0.0",
35
35
  "rxjs": "^7.8.1",
36
- "ts-node": "~10.9.2",
37
36
  "type-fest": "^4.30.1",
38
37
  "typescript": "^5.9.0"
39
38
  },
@@ -55,7 +54,7 @@
55
54
  }
56
55
  },
57
56
  "dependencies": {
58
- "@o3r/schematics": "^14.0.0-next.1",
57
+ "@o3r/schematics": "~14.0.0-next.3",
59
58
  "tslib": "^2.6.2"
60
59
  },
61
60
  "engines": {
@@ -91,6 +91,10 @@
91
91
  "type": "string",
92
92
  "description": "Unique name of the definition in the section (which can be referenced by the rootReference property)"
93
93
  },
94
+ "title": {
95
+ "type": "string",
96
+ "description": "Title to display to the CMS user"
97
+ },
94
98
  "properties": {
95
99
  "type": "array",
96
100
  "description": "Array of properties of this definition",
@@ -152,6 +156,17 @@
152
156
  }
153
157
  }
154
158
  }
159
+ },
160
+ "dataSources": {
161
+ "type": "object",
162
+ "description": "Map of data sources that can be used to populate the choices of enum/string properties",
163
+ "additionalProperties": {
164
+ "type": "array",
165
+ "description": "Array of object to define the data source items",
166
+ "items": {
167
+ "$ref": "#/definitions/choiceItem"
168
+ }
169
+ }
155
170
  }
156
171
  },
157
172
  "definitions": {
@@ -169,28 +184,15 @@
169
184
  "description": "Array of object to define the choices for a property",
170
185
  "minItems": 1,
171
186
  "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
- }
187
+ "$ref": "#/definitions/choiceItem"
185
188
  }
186
189
  },
187
190
  "enumProperty": {
188
191
  "type": "object",
189
- "description": "Type of the property (enum)",
192
+ "description": "Type of the property (enum). The enum values can be defined in the choices array or can be fetched from a data source specified in the widget parameter 'dataSource'",
190
193
  "required": [
191
194
  "valueType",
192
- "collectionType",
193
- "choices"
195
+ "collectionType"
194
196
  ],
195
197
  "additionalProperties": false,
196
198
  "properties": {
@@ -322,6 +324,24 @@
322
324
  }
323
325
  }
324
326
  }
327
+ },
328
+ "choiceItem": {
329
+ "type": "object",
330
+ "description": "A choice item",
331
+ "properties": {
332
+ "key": {
333
+ "type": "string",
334
+ "description": "The key of the choice item"
335
+ },
336
+ "title": {
337
+ "type": "string",
338
+ "description": "The title of the choice item"
339
+ }
340
+ },
341
+ "required": [
342
+ "key",
343
+ "title"
344
+ ]
325
345
  }
326
346
  }
327
- }
347
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"devtools-registration.js","sourceRoot":"","sources":["../../../../schematics/ng-add/helpers/devtools-registration.ts"],"names":[],"mappings":";;;AAAA,qCAEiB;AACjB,kCAAkC;AAClC,2DAEoC;AACpC,gDAEyB;AAKzB,MAAM,mBAAmB,GAAG,2BAA2B,CAAC;AACxD,MAAM,4BAA4B,GAAG,mCAAmC,CAAC;AACzE,MAAM,4BAA4B,GAAG,mCAAmC,CAAC;AACzE,MAAM,YAAY,GAAW,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAE5I;;;GAGG;AACI,MAAM,gBAAgB,GAAG,CAAC,OAA8B,EAAE,EAAE;IACjE,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,0CAA6B,EAAC;YAC5B,UAAU,EAAE,mBAAmB;YAC/B,WAAW,EAAE,YAAY;YACzB,WAAW,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