@o3r/application 15.3.0-prerelease.9 → 15.4.0-prerelease.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,276 +1,315 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, DOCUMENT, Injectable, DestroyRef, NgModule, makeEnvironmentProviders } from '@angular/core';
3
- import { isProductionEnvironment, sendOtterMessage, filterMessageContent } from '@o3r/core';
4
- import { ENVIRONMENT_CONFIG_TOKEN } from '@o3r/routing';
5
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
- import { LoggerService } from '@o3r/logger';
7
- import { fromEvent } from 'rxjs';
8
-
9
- /**
10
- * Method that returns the setting of the user regarding animations.
11
- * This setting is generally set in the Operating System settings, and it is used by browsers.
12
- * Refer to: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
13
- */
1
+ import * as i0 from "@angular/core";
2
+ import { DOCUMENT, DestroyRef, Injectable, InjectionToken, NgModule, inject, makeEnvironmentProviders } from "@angular/core";
3
+ import { filterMessageContent, isProductionEnvironment, sendOtterMessage } from "@o3r/core";
4
+ import { ENVIRONMENT_CONFIG_TOKEN } from "@o3r/routing";
5
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
6
+ import { LoggerService } from "@o3r/logger";
7
+ import { fromEvent } from "rxjs";
14
8
  function prefersReducedMotion() {
15
- const mediaQueryList = window.matchMedia('(prefers-reduced-motion)');
16
- return mediaQueryList.matches;
9
+ return window.matchMedia("(prefers-reduced-motion)").matches;
17
10
  }
18
-
19
- /**
20
- * Determine if the given message is a Application message
21
- * @param message message to check
22
- */
23
11
  const isApplicationMessage = (message) => {
24
- return message && (message.dataType === 'toggleVisualTesting'
25
- || message.dataType === 'stateSelection'
26
- || message.dataType === 'applicationInformation'
27
- || message.dataType === 'unselectState'
28
- || message.dataType === 'requestMessages'
29
- || message.dataType === 'connect');
12
+ return message && (message.dataType === "toggleVisualTesting" || message.dataType === "stateSelection" || message.dataType === "applicationInformation" || message.dataType === "unselectState" || message.dataType === "requestMessages" || message.dataType === "connect");
30
13
  };
31
-
32
- const OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS = {
33
- isActivatedOnBootstrap: false
14
+ const OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS = { isActivatedOnBootstrap: false };
15
+ const OTTER_APPLICATION_DEVTOOLS_OPTIONS = new InjectionToken("Otter Application Devtools options");
16
+ var OtterApplicationDevtools = class OtterApplicationDevtools {
17
+ constructor() {
18
+ this.options = inject(OTTER_APPLICATION_DEVTOOLS_OPTIONS, { optional: true });
19
+ this.document = inject(DOCUMENT, { optional: true });
20
+ this.env = inject(ENVIRONMENT_CONFIG_TOKEN, { optional: true });
21
+ }
22
+ getApplicationInformation() {
23
+ return {
24
+ appName: this.options?.appName || "unknown",
25
+ appVersion: this.env?.APP_VERSION || "unknown",
26
+ isProduction: isProductionEnvironment(this.document?.body.dataset)
27
+ };
28
+ }
29
+ static {
30
+ this.ɵfac = i0.ɵɵngDeclareFactory({
31
+ minVersion: "12.0.0",
32
+ version: "22.2.3",
33
+ ngImport: i0,
34
+ type: OtterApplicationDevtools,
35
+ deps: [],
36
+ target: i0.ɵɵFactoryTarget.Injectable
37
+ });
38
+ }
39
+ static {
40
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
41
+ minVersion: "12.0.0",
42
+ version: "22.2.3",
43
+ ngImport: i0,
44
+ type: OtterApplicationDevtools,
45
+ providedIn: "root"
46
+ });
47
+ }
34
48
  };
35
- const OTTER_APPLICATION_DEVTOOLS_OPTIONS = new InjectionToken('Otter Application Devtools options');
36
-
37
- class OtterApplicationDevtools {
38
- constructor() {
39
- this.options = inject(OTTER_APPLICATION_DEVTOOLS_OPTIONS, { optional: true });
40
- this.document = inject(DOCUMENT, { optional: true });
41
- this.env = inject(ENVIRONMENT_CONFIG_TOKEN, { optional: true });
42
- }
43
- getApplicationInformation() {
44
- return {
45
- appName: this.options?.appName || 'unknown',
46
- appVersion: this.env?.APP_VERSION || 'unknown',
47
- isProduction: isProductionEnvironment(this.document?.body.dataset)
48
- };
49
- }
50
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: OtterApplicationDevtools, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
51
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: OtterApplicationDevtools, providedIn: 'root' }); }
52
- }
53
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: OtterApplicationDevtools, decorators: [{
54
- type: Injectable,
55
- args: [{ providedIn: 'root' }]
56
- }] });
57
-
58
- /* eslint-disable no-console -- purpose of the service is to log in the console */
59
- class ApplicationDevtoolsConsoleService {
60
- /** Name of the Window property to access to the devtools */
61
- static { this.windowModuleName = 'application'; }
62
- constructor() {
63
- this.applicationDevtools = inject(OtterApplicationDevtools);
64
- const options = inject(OTTER_APPLICATION_DEVTOOLS_OPTIONS, { optional: true });
65
- this.options = { ...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS, ...options };
66
- if (this.options.isActivatedOnBootstrap) {
67
- this.activate();
68
- }
69
- }
70
- /** @inheritDoc */
71
- activate() {
72
- const windowWithDevtools = window;
73
- windowWithDevtools._OTTER_DEVTOOLS_ ||= {};
74
- windowWithDevtools._OTTER_DEVTOOLS_[ApplicationDevtoolsConsoleService.windowModuleName] = this;
75
- console.info(`Otter Application Devtools is now accessible via the _OTTER_DEVTOOLS_.${ApplicationDevtoolsConsoleService.windowModuleName} variable`);
76
- }
77
- /** Display the information relative to the running application */
78
- displayApplicationInfo() {
79
- console.info('Application info', this.applicationDevtools.getApplicationInformation());
80
- }
81
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: ApplicationDevtoolsConsoleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
82
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: ApplicationDevtoolsConsoleService, providedIn: 'root' }); }
83
- }
84
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: ApplicationDevtoolsConsoleService, decorators: [{
85
- type: Injectable,
86
- args: [{
87
- providedIn: 'root'
88
- }]
89
- }], ctorParameters: () => [] });
90
-
91
- const OTTER_STATE_RIBBON_ID = 'otter-devtools-state-ribbon';
92
- class ApplicationDevtoolsMessageService {
93
- constructor() {
94
- this.document = inject(DOCUMENT);
95
- this.sendMessage = (sendOtterMessage);
96
- this.destroyRef = inject(DestroyRef);
97
- this.logger = inject(LoggerService);
98
- this.applicationDevtools = inject(OtterApplicationDevtools);
99
- this.options = {
100
- ...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS,
101
- ...inject(OTTER_APPLICATION_DEVTOOLS_OPTIONS, { optional: true })
102
- };
103
- if (this.options.isActivatedOnBootstrap) {
104
- this.activate();
105
- }
106
- }
107
- sendApplicationInformation() {
108
- this.sendMessage('applicationInformation', this.applicationDevtools.getApplicationInformation());
109
- }
110
- /**
111
- * Function to connect the plugin to the Otter DevTools extension
112
- */
113
- connectPlugin() {
114
- this.logger.debug('Otter DevTools is plugged to application service of the application');
115
- void this.sendApplicationInformation();
116
- }
117
- /**
118
- * Function to trigger a re-send a requested messages to the Otter Chrome DevTools extension
119
- * @param only restricted list of messages to re-send
120
- */
121
- handleReEmitRequest(only) {
122
- if (!only || only.includes('applicationInformation')) {
123
- this.sendApplicationInformation();
124
- }
125
- }
126
- /**
127
- * Function to handle the incoming messages from Otter Chrome DevTools extension
128
- * @param message
129
- */
130
- async handleEvents(message) {
131
- this.logger.debug('Message handling by the application service', message);
132
- switch (message.dataType) {
133
- case 'connect': {
134
- this.connectPlugin();
135
- break;
136
- }
137
- case 'requestMessages': {
138
- this.handleReEmitRequest(message.only);
139
- break;
140
- }
141
- case 'toggleVisualTesting': {
142
- await this.toggleVisualTestingRender(message.toggle);
143
- break;
144
- }
145
- case 'stateSelection': {
146
- this.onStateSelection(message);
147
- break;
148
- }
149
- case 'unselectState': {
150
- this.unselectState();
151
- break;
152
- }
153
- default: {
154
- this.logger.warn('Message ignored by the application service', message);
155
- }
156
- }
157
- }
158
- unselectState() {
159
- const ribbonElement = this.document.body.querySelector(`#${OTTER_STATE_RIBBON_ID}`);
160
- if (ribbonElement) {
161
- ribbonElement.remove();
162
- }
163
- }
164
- onStateSelection(message) {
165
- let ribbonElement = this.document.body.querySelector(`#${OTTER_STATE_RIBBON_ID}`);
166
- if (!ribbonElement) {
167
- ribbonElement = this.document.createElement('div');
168
- ribbonElement.id = OTTER_STATE_RIBBON_ID;
169
- this.document.body.append(ribbonElement);
170
- }
171
- if (message.stateName) {
172
- ribbonElement.innerHTML = message.stateName;
173
- ribbonElement.style.background = message.stateColor;
174
- ribbonElement.style.color = message.stateColorContrast;
175
- ribbonElement.style.position = 'fixed';
176
- ribbonElement.style.bottom = '0';
177
- ribbonElement.style.right = '0';
178
- ribbonElement.style.transform = 'translate(calc(100% * (1 - cos(45deg)))) rotate(-45deg)';
179
- ribbonElement.style.transformOrigin = 'bottom left';
180
- ribbonElement.style.clipPath = 'inset(0 -100%)';
181
- ribbonElement.style.boxShadow = `0px 0px 0px 999px ${message.stateColor}`;
182
- }
183
- else {
184
- ribbonElement.style.display = 'none';
185
- }
186
- }
187
- /**
188
- * Toggle visual testing rendering
189
- * @param enabled activate or deactivate the visual testing mode
190
- */
191
- async toggleVisualTestingRender(enabled) {
192
- try {
193
- const visualTestUtils = await import('@o3r/testing/visual-test/utils');
194
- const isEnabled = enabled ?? visualTestUtils.isVisualTestingEnabled();
195
- visualTestUtils.toggleVisualTestingRender(isEnabled);
196
- }
197
- catch (err) {
198
- this.logger.warn('Visual testing utilities are not available:', err);
199
- }
200
- }
201
- /** @inheritDoc */
202
- activate() {
203
- fromEvent(window, 'message').pipe(takeUntilDestroyed(this.destroyRef), filterMessageContent(isApplicationMessage)).subscribe((e) => this.handleEvents(e));
204
- import('@o3r/testing/visual-test/utils')
205
- .then((visualTestUtils) => visualTestUtils.prepareVisualTesting(this.options.e2eIgnoreClass))
206
- .catch((err) => this.logger.warn('Visual testing utilities are not available:', err));
207
- this.sendApplicationInformation();
208
- }
209
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: ApplicationDevtoolsMessageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
210
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: ApplicationDevtoolsMessageService, providedIn: 'root' }); }
211
- }
212
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: ApplicationDevtoolsMessageService, decorators: [{
213
- type: Injectable,
214
- args: [{
215
- providedIn: 'root'
216
- }]
217
- }], ctorParameters: () => [] });
218
-
219
- /**
220
- * @deprecated Will be removed in v16. Use {@link provideApplicationDevtools} instead.
221
- */
222
- class ApplicationDevtoolsModule {
223
- /**
224
- * Initialize Otter Devtools
225
- * @param options
226
- */
227
- static instrument(options) {
228
- return {
229
- ngModule: ApplicationDevtoolsModule,
230
- providers: [
231
- { provide: OTTER_APPLICATION_DEVTOOLS_OPTIONS, useValue: { ...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS, ...options }, multi: false },
232
- ApplicationDevtoolsMessageService,
233
- ApplicationDevtoolsConsoleService,
234
- OtterApplicationDevtools
235
- ]
236
- };
237
- }
238
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: ApplicationDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
239
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.2.0", ngImport: i0, type: ApplicationDevtoolsModule }); }
240
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: ApplicationDevtoolsModule, providers: [
241
- { provide: OTTER_APPLICATION_DEVTOOLS_OPTIONS, useValue: OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS },
242
- ApplicationDevtoolsMessageService,
243
- ApplicationDevtoolsConsoleService,
244
- OtterApplicationDevtools
245
- ] }); }
246
- }
247
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: ApplicationDevtoolsModule, decorators: [{
248
- type: NgModule,
249
- args: [{
250
- providers: [
251
- { provide: OTTER_APPLICATION_DEVTOOLS_OPTIONS, useValue: OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS },
252
- ApplicationDevtoolsMessageService,
253
- ApplicationDevtoolsConsoleService,
254
- OtterApplicationDevtools
255
- ]
256
- }]
257
- }] });
258
- /**
259
- * Provide application devtools functionality.
260
- * @param options Application devtools options
261
- */
49
+ i0.ɵɵngDeclareClassMetadata({
50
+ minVersion: "12.0.0",
51
+ version: "22.2.3",
52
+ ngImport: i0,
53
+ type: OtterApplicationDevtools,
54
+ decorators: [{
55
+ type: Injectable,
56
+ args: [{ providedIn: "root" }]
57
+ }]
58
+ });
59
+ var ApplicationDevtoolsConsoleService = class ApplicationDevtoolsConsoleService {
60
+ static {
61
+ this.windowModuleName = "application";
62
+ }
63
+ constructor() {
64
+ this.applicationDevtools = inject(OtterApplicationDevtools);
65
+ const options = inject(OTTER_APPLICATION_DEVTOOLS_OPTIONS, { optional: true });
66
+ this.options = {
67
+ ...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS,
68
+ ...options
69
+ };
70
+ if (this.options.isActivatedOnBootstrap) this.activate();
71
+ }
72
+ activate() {
73
+ const windowWithDevtools = window;
74
+ windowWithDevtools._OTTER_DEVTOOLS_ ||= {};
75
+ windowWithDevtools._OTTER_DEVTOOLS_[ApplicationDevtoolsConsoleService.windowModuleName] = this;
76
+ console.info(`Otter Application Devtools is now accessible via the _OTTER_DEVTOOLS_.${ApplicationDevtoolsConsoleService.windowModuleName} variable`);
77
+ }
78
+ displayApplicationInfo() {
79
+ console.info("Application info", this.applicationDevtools.getApplicationInformation());
80
+ }
81
+ static {
82
+ this.ɵfac = i0.ɵɵngDeclareFactory({
83
+ minVersion: "12.0.0",
84
+ version: "22.2.3",
85
+ ngImport: i0,
86
+ type: ApplicationDevtoolsConsoleService,
87
+ deps: [],
88
+ target: i0.ɵɵFactoryTarget.Injectable
89
+ });
90
+ }
91
+ static {
92
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
93
+ minVersion: "12.0.0",
94
+ version: "22.2.3",
95
+ ngImport: i0,
96
+ type: ApplicationDevtoolsConsoleService,
97
+ providedIn: "root"
98
+ });
99
+ }
100
+ };
101
+ i0.ɵɵngDeclareClassMetadata({
102
+ minVersion: "12.0.0",
103
+ version: "22.2.3",
104
+ ngImport: i0,
105
+ type: ApplicationDevtoolsConsoleService,
106
+ decorators: [{
107
+ type: Injectable,
108
+ args: [{ providedIn: "root" }]
109
+ }],
110
+ ctorParameters: () => []
111
+ });
112
+ const OTTER_STATE_RIBBON_ID = "otter-devtools-state-ribbon";
113
+ var ApplicationDevtoolsMessageService = class ApplicationDevtoolsMessageService {
114
+ constructor() {
115
+ this.document = inject(DOCUMENT);
116
+ this.sendMessage = sendOtterMessage;
117
+ this.destroyRef = inject(DestroyRef);
118
+ this.logger = inject(LoggerService);
119
+ this.applicationDevtools = inject(OtterApplicationDevtools);
120
+ this.options = {
121
+ ...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS,
122
+ ...inject(OTTER_APPLICATION_DEVTOOLS_OPTIONS, { optional: true })
123
+ };
124
+ if (this.options.isActivatedOnBootstrap) this.activate();
125
+ }
126
+ sendApplicationInformation() {
127
+ this.sendMessage("applicationInformation", this.applicationDevtools.getApplicationInformation());
128
+ }
129
+ connectPlugin() {
130
+ this.logger.debug("Otter DevTools is plugged to application service of the application");
131
+ this.sendApplicationInformation();
132
+ }
133
+ handleReEmitRequest(only) {
134
+ if (!only || only.includes("applicationInformation")) this.sendApplicationInformation();
135
+ }
136
+ async handleEvents(message) {
137
+ this.logger.debug("Message handling by the application service", message);
138
+ switch (message.dataType) {
139
+ case "connect":
140
+ this.connectPlugin();
141
+ break;
142
+ case "requestMessages":
143
+ this.handleReEmitRequest(message.only);
144
+ break;
145
+ case "toggleVisualTesting":
146
+ await this.toggleVisualTestingRender(message.toggle);
147
+ break;
148
+ case "stateSelection":
149
+ this.onStateSelection(message);
150
+ break;
151
+ case "unselectState":
152
+ this.unselectState();
153
+ break;
154
+ default: this.logger.warn("Message ignored by the application service", message);
155
+ }
156
+ }
157
+ unselectState() {
158
+ const ribbonElement = this.document.body.querySelector(`#${OTTER_STATE_RIBBON_ID}`);
159
+ if (ribbonElement) ribbonElement.remove();
160
+ }
161
+ onStateSelection(message) {
162
+ let ribbonElement = this.document.body.querySelector(`#${OTTER_STATE_RIBBON_ID}`);
163
+ if (!ribbonElement) {
164
+ ribbonElement = this.document.createElement("div");
165
+ ribbonElement.id = OTTER_STATE_RIBBON_ID;
166
+ this.document.body.append(ribbonElement);
167
+ }
168
+ if (message.stateName) {
169
+ ribbonElement.innerHTML = message.stateName;
170
+ ribbonElement.style.background = message.stateColor;
171
+ ribbonElement.style.color = message.stateColorContrast;
172
+ ribbonElement.style.position = "fixed";
173
+ ribbonElement.style.bottom = "0";
174
+ ribbonElement.style.right = "0";
175
+ ribbonElement.style.transform = "translate(calc(100% * (1 - cos(45deg)))) rotate(-45deg)";
176
+ ribbonElement.style.transformOrigin = "bottom left";
177
+ ribbonElement.style.clipPath = "inset(0 -100%)";
178
+ ribbonElement.style.boxShadow = `0px 0px 0px 999px ${message.stateColor}`;
179
+ } else ribbonElement.style.display = "none";
180
+ }
181
+ async toggleVisualTestingRender(enabled) {
182
+ try {
183
+ const visualTestUtils = await import("@o3r/testing/visual-test/utils");
184
+ const isEnabled = enabled ?? visualTestUtils.isVisualTestingEnabled();
185
+ visualTestUtils.toggleVisualTestingRender(isEnabled);
186
+ } catch (err) {
187
+ this.logger.warn("Visual testing utilities are not available:", err);
188
+ }
189
+ }
190
+ activate() {
191
+ fromEvent(window, "message").pipe(takeUntilDestroyed(this.destroyRef), filterMessageContent(isApplicationMessage)).subscribe((e) => this.handleEvents(e));
192
+ import("@o3r/testing/visual-test/utils").then((visualTestUtils) => visualTestUtils.prepareVisualTesting(this.options.e2eIgnoreClass)).catch((err) => this.logger.warn("Visual testing utilities are not available:", err));
193
+ this.sendApplicationInformation();
194
+ }
195
+ static {
196
+ this.ɵfac = i0.ɵɵngDeclareFactory({
197
+ minVersion: "12.0.0",
198
+ version: "22.2.3",
199
+ ngImport: i0,
200
+ type: ApplicationDevtoolsMessageService,
201
+ deps: [],
202
+ target: i0.ɵɵFactoryTarget.Injectable
203
+ });
204
+ }
205
+ static {
206
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
207
+ minVersion: "12.0.0",
208
+ version: "22.2.3",
209
+ ngImport: i0,
210
+ type: ApplicationDevtoolsMessageService,
211
+ providedIn: "root"
212
+ });
213
+ }
214
+ };
215
+ i0.ɵɵngDeclareClassMetadata({
216
+ minVersion: "12.0.0",
217
+ version: "22.2.3",
218
+ ngImport: i0,
219
+ type: ApplicationDevtoolsMessageService,
220
+ decorators: [{
221
+ type: Injectable,
222
+ args: [{ providedIn: "root" }]
223
+ }],
224
+ ctorParameters: () => []
225
+ });
226
+ var ApplicationDevtoolsModule = class ApplicationDevtoolsModule {
227
+ static instrument(options) {
228
+ return {
229
+ ngModule: ApplicationDevtoolsModule,
230
+ providers: [
231
+ {
232
+ provide: OTTER_APPLICATION_DEVTOOLS_OPTIONS,
233
+ useValue: {
234
+ ...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS,
235
+ ...options
236
+ },
237
+ multi: false
238
+ },
239
+ ApplicationDevtoolsMessageService,
240
+ ApplicationDevtoolsConsoleService,
241
+ OtterApplicationDevtools
242
+ ]
243
+ };
244
+ }
245
+ static {
246
+ this.ɵfac = i0.ɵɵngDeclareFactory({
247
+ minVersion: "12.0.0",
248
+ version: "22.2.3",
249
+ ngImport: i0,
250
+ type: ApplicationDevtoolsModule,
251
+ deps: [],
252
+ target: i0.ɵɵFactoryTarget.NgModule
253
+ });
254
+ }
255
+ static {
256
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
257
+ minVersion: "14.0.0",
258
+ version: "22.2.3",
259
+ ngImport: i0,
260
+ type: ApplicationDevtoolsModule
261
+ });
262
+ }
263
+ static {
264
+ this.ɵinj = i0.ɵɵngDeclareInjector({
265
+ minVersion: "12.0.0",
266
+ version: "22.2.3",
267
+ ngImport: i0,
268
+ type: ApplicationDevtoolsModule,
269
+ providers: [
270
+ {
271
+ provide: OTTER_APPLICATION_DEVTOOLS_OPTIONS,
272
+ useValue: OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS
273
+ },
274
+ ApplicationDevtoolsMessageService,
275
+ ApplicationDevtoolsConsoleService,
276
+ OtterApplicationDevtools
277
+ ]
278
+ });
279
+ }
280
+ };
281
+ i0.ɵɵngDeclareClassMetadata({
282
+ minVersion: "12.0.0",
283
+ version: "22.2.3",
284
+ ngImport: i0,
285
+ type: ApplicationDevtoolsModule,
286
+ decorators: [{
287
+ type: NgModule,
288
+ args: [{ providers: [
289
+ {
290
+ provide: OTTER_APPLICATION_DEVTOOLS_OPTIONS,
291
+ useValue: OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS
292
+ },
293
+ ApplicationDevtoolsMessageService,
294
+ ApplicationDevtoolsConsoleService,
295
+ OtterApplicationDevtools
296
+ ] }]
297
+ }]
298
+ });
262
299
  function provideApplicationDevtools(options) {
263
- return makeEnvironmentProviders([
264
- { provide: OTTER_APPLICATION_DEVTOOLS_OPTIONS, useValue: { ...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS, ...options } },
265
- ApplicationDevtoolsMessageService,
266
- ApplicationDevtoolsConsoleService,
267
- OtterApplicationDevtools
268
- ]);
300
+ return makeEnvironmentProviders([
301
+ {
302
+ provide: OTTER_APPLICATION_DEVTOOLS_OPTIONS,
303
+ useValue: {
304
+ ...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS,
305
+ ...options
306
+ }
307
+ },
308
+ ApplicationDevtoolsMessageService,
309
+ ApplicationDevtoolsConsoleService,
310
+ OtterApplicationDevtools
311
+ ]);
269
312
  }
270
-
271
- /**
272
- * Generated bundle index. Do not edit.
273
- */
274
-
275
313
  export { ApplicationDevtoolsConsoleService, ApplicationDevtoolsMessageService, ApplicationDevtoolsModule, OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_APPLICATION_DEVTOOLS_OPTIONS, OtterApplicationDevtools, isApplicationMessage, prefersReducedMotion, provideApplicationDevtools };
276
- //# sourceMappingURL=o3r-application.mjs.map
314
+
315
+ //# sourceMappingURL=o3r-application.mjs.map
@@ -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.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 EnvironmentProviders,\n makeEnvironmentProviders,\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/**\n * @deprecated Will be removed in v16. Use {@link provideApplicationDevtools} instead.\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/**\n * Provide application devtools functionality.\n * @param options Application devtools options\n */\nexport function provideApplicationDevtools(options?: Partial<ApplicationDevtoolsServiceOptions>): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: OTTER_APPLICATION_DEVTOOLS_OPTIONS, useValue: { ...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS, ...options } },\n ApplicationDevtoolsMessageService,\n ApplicationDevtoolsConsoleService,\n OtterApplicationDevtools\n ]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;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AAE,GAAG,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;gBACtI,iCAAiC;gBACjC,iCAAiC;gBACjC;AACD;SACF;IACH;iIAfW,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;;AAmBD;;;AAGG;AACG,SAAU,0BAA0B,CAAC,OAAoD,EAAA;AAC7F,IAAA,OAAO,wBAAwB,CAAC;AAC9B,QAAA,EAAE,OAAO,EAAE,kCAAkC,EAAE,QAAQ,EAAE,EAAE,GAAG,0CAA0C,EAAE,GAAG,OAAO,EAAE,EAAE;QACxH,iCAAiC;QACjC,iCAAiC;QACjC;AACD,KAAA,CAAC;AACJ;;AC/DA;;AAEG;;"}
1
+ {"version":3,"file":"o3r-application.mjs","names":[],"sources":["../../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"],"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 EnvironmentProviders,\n makeEnvironmentProviders,\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/**\n * @deprecated Will be removed in v16. Use {@link provideApplicationDevtools} instead.\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/**\n * Provide application devtools functionality.\n * @param options Application devtools options\n */\nexport function provideApplicationDevtools(options?: Partial<ApplicationDevtoolsServiceOptions>): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: OTTER_APPLICATION_DEVTOOLS_OPTIONS, useValue: { ...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS, ...options } },\n ApplicationDevtoolsMessageService,\n ApplicationDevtoolsConsoleService,\n OtterApplicationDevtools\n ]);\n}\n"],"mappings":";;;;;;;AAKA,SAAgB,uBAAoB;CAGlC,OAFuB,OAAO,WAAW,0BAElC,CAAA,CAAe;AACxB;ACsFA,MAAa,wBAAwB,YAAgE;CACnG,OAAO,YACL,QAAQ,aAAa,yBAClB,QAAQ,aAAa,oBACrB,QAAQ,aAAa,4BACrB,QAAQ,aAAa,mBACrB,QAAQ,aAAa,qBACrB,QAAQ,aAAa;AAC5B;AChGA,MAAa,6CAA0F,EACrG,wBAAwB,MAChB;AAEV,MAAa,qCAAqC,IAAI,eAAkD,oCAAoC;ACS5I,IAAa,2BAAb,MAAa,yBAAwB;CADrC,cAAA;EAEmB,KAAA,UAAU,OAAO,oCAAoC,EAAE,UAAU,KAAI,CAAE;EACvE,KAAA,WAAW,OAAO,UAAU,EAAE,UAAU,KAAI,CAAE;EAC9C,KAAA,MAAM,OAAO,0BAA0B,EAAE,UAAU,KAAI,CAAE;CAS3E;CAPQ,4BAAyB;EAC9B,OAAO;GACL,SAAS,KAAK,SAAS,WAAW;GAClC,YAAY,KAAK,KAAK,eAAe;GACrC,cAAc,wBAAwB,KAAK,UAAU,KAAK,OAAkB;EAC7E;CACH;CAXW;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAwB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAxB;EAAA,KAAA,QAAA,GAAA,sBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAwB,YADX;EAAM,CAAA;CAAA;;AACnB,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AAO,WAAW,SAAmD;EAC1E,OAAO;GACL,UAAU;GACV,WAAW;IACT;KAAE,SAAS;KAAoC,UAAU;MAAE,GAAG;MAA4C,GAAG;KAAO;KAAI,OAAO;IAAK;IACpI;IACA;IACA;GACD;EACF;CACH;CAfW;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAyB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAzB;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;EAAyB,CAAA;CAAA;CAAzB;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAyB,WAPzB;IACT;KAAE,SAAS;KAAoC,UAAU;IAA0C;IACnG;IACA;IACA;GACD;EAAA,CAAA;CAAA;;AAEU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAyB,YAAA,CAAA;EARrC,MAAA;EAAS,MAAA,CAAA,EACR,WAAW;GACT;IAAE,SAAS;IAAoC,UAAU;GAA0C;GACnG;GACA;GACA;EACD,EACF,CAAA;;;AAuBD,SAAgB,2BAA2B,SAAoD;CAC7F,OAAO,yBAAyB;EAC9B;GAAE,SAAS;GAAoC,UAAU;IAAE,GAAG;IAA4C,GAAG;GAAO;EAAE;EACtH;EACA;EACA;CACD,CAAA;AACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3r/application",
3
- "version": "15.3.0-prerelease.9",
3
+ "version": "15.4.0-prerelease.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -26,11 +26,11 @@
26
26
  "@angular-devkit/schematics": "^22.0.0",
27
27
  "@angular/common": "^22.0.0",
28
28
  "@angular/core": "^22.0.0",
29
- "@o3r/core": "~15.3.0-prerelease.9",
30
- "@o3r/logger": "~15.3.0-prerelease.9",
31
- "@o3r/routing": "~15.3.0-prerelease.9",
32
- "@o3r/schematics": "~15.3.0-prerelease.9",
33
- "@o3r/testing": "~15.3.0-prerelease.9",
29
+ "@o3r/core": "~15.4.0-prerelease.0",
30
+ "@o3r/logger": "~15.4.0-prerelease.0",
31
+ "@o3r/routing": "~15.4.0-prerelease.0",
32
+ "@o3r/schematics": "~15.4.0-prerelease.0",
33
+ "@o3r/testing": "~15.4.0-prerelease.0",
34
34
  "@schematics/angular": "^22.0.0",
35
35
  "rxjs": "^7.8.1",
36
36
  "type-fest": "^5.3.1",
@@ -54,7 +54,7 @@
54
54
  }
55
55
  },
56
56
  "dependencies": {
57
- "@o3r/schematics": "~15.3.0-prerelease.9",
57
+ "@o3r/schematics": "~15.4.0-prerelease.0",
58
58
  "tslib": "^2.6.2"
59
59
  },
60
60
  "engines": {
@@ -7,9 +7,6 @@
7
7
  "projectName": {
8
8
  "type": "string",
9
9
  "description": "Project name",
10
- "$default": {
11
- "$source": "projectName"
12
- },
13
10
  "alias": "project"
14
11
  },
15
12
  "exactO3rVersion": {
@@ -1,170 +1,159 @@
1
- import { DevtoolsCommonOptions, OtterMessageContent, MessageDataTypes, ConnectContentMessage, RequestMessagesContentMessage, DevtoolsServiceInterface } from '@o3r/core';
2
- import * as i0 from '@angular/core';
3
- import { ModuleWithProviders, EnvironmentProviders, InjectionToken } from '@angular/core';
4
-
1
+ import { ConnectContentMessage, DevtoolsCommonOptions, DevtoolsServiceInterface, MessageDataTypes, OtterMessageContent, RequestMessagesContentMessage } from "@o3r/core";
2
+ import * as i0 from "@angular/core";
3
+ import { EnvironmentProviders, InjectionToken, ModuleWithProviders } from "@angular/core";
5
4
  /**
6
5
  * Method that returns the setting of the user regarding animations.
7
6
  * This setting is generally set in the Operating System settings, and it is used by browsers.
8
7
  * Refer to: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
9
8
  */
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;
9
+ export declare function prefersReducedMotion(): boolean;
10
+ export interface ApplicationDevtoolsServiceOptions extends DevtoolsCommonOptions {
11
+ /**
12
+ * Application name
13
+ */
14
+ appName?: string;
15
+ /**
16
+ * CSS classname applied to an HTML tag to hide it, ignore it, in the e2e visual testing process
17
+ */
18
+ e2eIgnoreClass?: string;
21
19
  }
22
20
  /**
23
21
  * Session information used to track all the calls done by one or several APIs of the SDK.
24
22
  */
25
- interface SessionInformation {
26
- /**
27
- * The session ID
28
- */
29
- id: string;
30
- /**
31
- * The generated time
32
- */
33
- generatedTime: Date;
23
+ export interface SessionInformation {
24
+ /**
25
+ * The session ID
26
+ */
27
+ id: string;
28
+ /**
29
+ * The generated time
30
+ */
31
+ generatedTime: Date;
34
32
  }
35
33
  /** 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;
34
+ export interface ApplicationInformation {
35
+ /**
36
+ * Application name
37
+ */
38
+ appName: string;
39
+ /** Application Version */
40
+ appVersion: string;
41
+ /**
42
+ * Session Information
43
+ * @note This is a session ID will be provided only with the Amadeus Otter implementation of the application package.
44
+ */
45
+ session?: SessionInformation;
46
+ /**
47
+ * Log Link
48
+ * @note This a link to Alf logs, it will be provided only with the Amadeus Otter implementation of the application package.
49
+ */
50
+ logLink?: string;
51
+ /** Is Production Environment */
52
+ isProduction: boolean;
55
53
  }
56
54
  /** Toggle Visual Testing */
57
- interface ToggleVisualTestingMessage extends OtterMessageContent<'toggleVisualTesting'> {
58
- /** Toggle the visual testing mode */
59
- toggle?: boolean;
55
+ export interface ToggleVisualTestingMessage extends OtterMessageContent<'toggleVisualTesting'> {
56
+ /** Toggle the visual testing mode */
57
+ toggle?: boolean;
60
58
  }
61
59
  /** Application Information Message Content */
62
- interface ApplicationInformationContentMessage extends ApplicationInformation, OtterMessageContent<'applicationInformation'> {
63
- }
60
+ export interface ApplicationInformationContentMessage extends ApplicationInformation, OtterMessageContent<'applicationInformation'> {}
64
61
  /** 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;
62
+ export interface StateSelectionContentMessage extends OtterMessageContent<'stateSelection'> {
63
+ /** Name of the state */
64
+ stateName: string;
65
+ /** Color of the state */
66
+ stateColor: string;
67
+ /** Contrast color of the state */
68
+ stateColorContrast: string;
72
69
  }
73
70
  /** Unselect state message */
74
- interface UnselectStateContentMessage extends OtterMessageContent<'unselectState'> {
75
- }
71
+ export interface UnselectStateContentMessage extends OtterMessageContent<'unselectState'> {}
76
72
  type ApplicationMessageContents = ApplicationInformationContentMessage | StateSelectionContentMessage | UnselectStateContentMessage | ToggleVisualTestingMessage;
77
73
  /** List of possible DataTypes for Application messages */
78
- type ApplicationMessageDataTypes = MessageDataTypes<ApplicationMessageContents>;
74
+ export type ApplicationMessageDataTypes = MessageDataTypes<ApplicationMessageContents>;
79
75
  /** List of all messages for application purpose */
80
- type AvailableApplicationMessageContents = ApplicationMessageContents | ConnectContentMessage | RequestMessagesContentMessage<ApplicationMessageDataTypes>;
76
+ export type AvailableApplicationMessageContents = ApplicationMessageContents | ConnectContentMessage | RequestMessagesContentMessage<ApplicationMessageDataTypes>;
81
77
  /**
82
78
  * Determine if the given message is a Application message
83
79
  * @param message message to check
84
80
  */
85
- declare const isApplicationMessage: (message: any) => message is AvailableApplicationMessageContents;
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<any>;
81
+ export declare const isApplicationMessage: (message: any) => message is AvailableApplicationMessageContents;
82
+ export declare class OtterApplicationDevtools {
83
+ private readonly options;
84
+ private readonly document;
85
+ private readonly env;
86
+ getApplicationInformation(): ApplicationInformation;
87
+ static ɵfac: i0.ɵɵFactoryDeclaration<OtterApplicationDevtools, never>;
88
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
94
89
  }
95
-
96
- declare class ApplicationDevtoolsConsoleService implements DevtoolsServiceInterface {
97
- /** Name of the Window property to access to the devtools */
98
- static readonly windowModuleName = "application";
99
- private readonly applicationDevtools;
100
- private readonly options;
101
- constructor();
102
- /** @inheritDoc */
103
- activate(): void;
104
- /** Display the information relative to the running application */
105
- displayApplicationInfo(): void;
106
- static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationDevtoolsConsoleService, never>;
107
- static ɵprov: i0.ɵɵInjectableDeclaration<any>;
90
+ export declare class ApplicationDevtoolsConsoleService implements DevtoolsServiceInterface {
91
+ /** Name of the Window property to access to the devtools */
92
+ static readonly windowModuleName = "application";
93
+ private readonly applicationDevtools;
94
+ private readonly options;
95
+ constructor();
96
+ /** @inheritDoc */
97
+ activate(): void;
98
+ /** Display the information relative to the running application */
99
+ displayApplicationInfo(): void;
100
+ static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationDevtoolsConsoleService, never>;
101
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
108
102
  }
109
-
110
- declare class ApplicationDevtoolsMessageService implements DevtoolsServiceInterface {
111
- private readonly document;
112
- private readonly options;
113
- private readonly sendMessage;
114
- private readonly destroyRef;
115
- private readonly logger;
116
- private readonly applicationDevtools;
117
- constructor();
118
- private sendApplicationInformation;
119
- /**
120
- * Function to connect the plugin to the Otter DevTools extension
121
- */
122
- private connectPlugin;
123
- /**
124
- * Function to trigger a re-send a requested messages to the Otter Chrome DevTools extension
125
- * @param only restricted list of messages to re-send
126
- */
127
- private handleReEmitRequest;
128
- /**
129
- * Function to handle the incoming messages from Otter Chrome DevTools extension
130
- * @param message
131
- */
132
- private handleEvents;
133
- private unselectState;
134
- private onStateSelection;
135
- /**
136
- * Toggle visual testing rendering
137
- * @param enabled activate or deactivate the visual testing mode
138
- */
139
- private toggleVisualTestingRender;
140
- /** @inheritDoc */
141
- activate(): void;
142
- static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationDevtoolsMessageService, never>;
143
- static ɵprov: i0.ɵɵInjectableDeclaration<any>;
103
+ export declare class ApplicationDevtoolsMessageService implements DevtoolsServiceInterface {
104
+ private readonly document;
105
+ private readonly options;
106
+ private readonly sendMessage;
107
+ private readonly destroyRef;
108
+ private readonly logger;
109
+ private readonly applicationDevtools;
110
+ constructor();
111
+ private sendApplicationInformation;
112
+ /**
113
+ * Function to connect the plugin to the Otter DevTools extension
114
+ */
115
+ private connectPlugin;
116
+ /**
117
+ * Function to trigger a re-send a requested messages to the Otter Chrome DevTools extension
118
+ * @param only restricted list of messages to re-send
119
+ */
120
+ private handleReEmitRequest;
121
+ /**
122
+ * Function to handle the incoming messages from Otter Chrome DevTools extension
123
+ * @param message
124
+ */
125
+ private handleEvents;
126
+ private unselectState;
127
+ private onStateSelection;
128
+ /**
129
+ * Toggle visual testing rendering
130
+ * @param enabled activate or deactivate the visual testing mode
131
+ */
132
+ private toggleVisualTestingRender;
133
+ /** @inheritDoc */
134
+ activate(): void;
135
+ static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationDevtoolsMessageService, never>;
136
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
144
137
  }
145
-
146
138
  /**
147
139
  * @deprecated Will be removed in v16. Use {@link provideApplicationDevtools} instead.
148
140
  */
149
- declare class ApplicationDevtoolsModule {
150
- /**
151
- * Initialize Otter Devtools
152
- * @param options
153
- */
154
- static instrument(options: Partial<ApplicationDevtoolsServiceOptions>): ModuleWithProviders<ApplicationDevtoolsModule>;
155
- static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationDevtoolsModule, never>;
156
- static ɵmod: i0.ɵɵNgModuleDeclaration<ApplicationDevtoolsModule, never, never, never>;
157
- static ɵinj: i0.ɵɵInjectorDeclaration<ApplicationDevtoolsModule>;
141
+ export declare class ApplicationDevtoolsModule {
142
+ /**
143
+ * Initialize Otter Devtools
144
+ * @param options
145
+ */
146
+ static instrument(options: Partial<ApplicationDevtoolsServiceOptions>): ModuleWithProviders<ApplicationDevtoolsModule>;
147
+ static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationDevtoolsModule, never>;
148
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ApplicationDevtoolsModule, never, never, never>;
149
+ static ɵinj: i0.ɵɵInjectorDeclaration<ApplicationDevtoolsModule>;
158
150
  }
159
151
  /**
160
152
  * Provide application devtools functionality.
161
153
  * @param options Application devtools options
162
154
  */
163
- declare function provideApplicationDevtools(options?: Partial<ApplicationDevtoolsServiceOptions>): EnvironmentProviders;
164
-
165
- declare const OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS: Readonly<ApplicationDevtoolsServiceOptions>;
166
- declare const OTTER_APPLICATION_DEVTOOLS_OPTIONS: InjectionToken<ApplicationDevtoolsServiceOptions>;
167
-
168
- export { ApplicationDevtoolsConsoleService, ApplicationDevtoolsMessageService, ApplicationDevtoolsModule, OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_APPLICATION_DEVTOOLS_OPTIONS, OtterApplicationDevtools, isApplicationMessage, prefersReducedMotion, provideApplicationDevtools };
169
- export type { ApplicationDevtoolsServiceOptions, ApplicationInformation, ApplicationInformationContentMessage, ApplicationMessageDataTypes, AvailableApplicationMessageContents, SessionInformation, StateSelectionContentMessage, ToggleVisualTestingMessage, UnselectStateContentMessage };
170
- //# sourceMappingURL=o3r-application.d.ts.map
155
+ export declare function provideApplicationDevtools(options?: Partial<ApplicationDevtoolsServiceOptions>): EnvironmentProviders;
156
+ export declare const OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS: Readonly<ApplicationDevtoolsServiceOptions>;
157
+ export declare const OTTER_APPLICATION_DEVTOOLS_OPTIONS: InjectionToken<ApplicationDevtoolsServiceOptions>;
158
+ export {};
159
+ //# sourceMappingURL=o3r-application.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"o3r-application.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"],"mappings":";;;;AAAA;;;;AAIG;AACH,iBAAgB,oBAAoB;;ACG9B,UAAW,iCAAkC,SAAQ,qBAAqB;AAC9E;;AAEG;;AAEH;;AAEG;;AAEJ;AAED;;AAEG;UACc,kBAAkB;AACjC;;AAEG;;AAEH;;AAEG;mBACY,IAAI;AACpB;AAED;UACiB,sBAAsB;AACrC;;AAEG;;;;AAIH;;;AAGG;cACO,kBAAkB;AAC5B;;;AAGG;;;;AAIJ;AAED;UACiB,0BAA2B,SAAQ,mBAAmB;;;AAGtE;AAED;AACM,UAAW,oCAAqC,SAAQ,sBAAsB,EAAE,mBAAmB;AACxG;AAED;UACiB,4BAA6B,SAAQ,mBAAmB;;;;;;;AAOxE;AAED;UACiB,2BAA4B,SAAQ,mBAAmB;AAAoB;AAE5F,KAAK,0BAA0B,GAAG,oCAAoC,GAClE,4BAA4B,GAC5B,2BAA2B,GAC3B,0BAA0B;AAE9B;KACY,2BAA2B,GAAG,gBAAgB,CAAC,0BAA0B;AAErF;AACM,KAAM,mCAAmC,GAAG,0BAA0B,GACxE,qBAAqB,GACrB,6BAA6B,CAAC,2BAA2B;AAE7D;;;AAGG;AACH,cAAa,oBAAoB,+BAA8B,mCAQ9D;;ACpFD,cACa,wBAAwB;AACnC;AACA;AACA;AAEO,iCAA6B,sBAAsB;yCAL/C,wBAAwB;;AAYpC;;ACZD,cAGa,iCAAkC,YAAW,wBAAwB;;AAEhF;AAEA;AACA;;;;;;yCALW,iCAAiC;;AA8B7C;;AChBD,cAGa,iCAAkC,YAAW,wBAAwB;AAChF;AACA;AACA;AACA;AACA;AACA;;AAaA;AAIA;;AAEG;AACH;AAKA;;;AAGG;AACH;AAMA;;;AAGG;;AA+BH;AAOA;AAuBA;;;AAGG;;;;yCA5GQ,iCAAiC;;AAkI7C;;ACnJD;;AAEG;AACH,cAQa,yBAAyB;AACpC;;;AAGG;+BAC+B,OAAO,CAAC,iCAAiC,IAAI,mBAAmB,CAAC,yBAAyB;yCALjH,yBAAyB;0CAAzB,yBAAyB;0CAAzB,yBAAyB;AAgBrC;AAED;;;AAGG;AACH,iBAAgB,0BAA0B,WAAW,OAAO,CAAC,iCAAiC,IAAI,oBAAoB;;ACjDtH,cAAa,0CAA0C,EAAE,QAAQ,CAAC,iCAAiC;AAInG,cAAa,kCAAkC,EAAA,cAAA,CAAA,iCAAA;;","names":[]}
1
+ {"version":3,"file":"o3r-application.d.ts","names":[],"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"],"mappings":";;;;;;;;wBAKgB;iBCGC,0CAA0C;;;;EAIzD;;;;EAIA;;;;;iBAMe;;;;EAIf;;;;EAIA,eAAe;;;iBAIA;;;;EAIf;;EAEA;;;;;EAKA,UAAU;;;;;EAKV;;EAEA;;;iBAIe,mCAAmC;;EAElD;;;iBAIe,6CAA6C,wBAAwB;;iBAIrE,qCAAqC;;EAEpD;;EAEA;;EAEA;;;iBAIe,oCAAoC;KAEhD,6BAA6B,uCAC9B,+BACA,8BACA;;YAGQ,8BAA8B,iBAAiB;;YAG/C,sCAAsC,6BAC9C,wBACA,8BAA8B;;;;;qBAMrB,uBAAwB,iBAAe,WAAW;qBC3ElD;mBACM;mBACA;mBACA;EAEV,6BAA6B;SALzB,MAAA,GAAA,qBAAA;;;qBCGA,6CAA6C;;kBAEjC;mBAEN;mBACA;;;EAaV;;EASA;SA3BI,MAAA,GAAA,qBAAA;;;qBCiBA,6CAA6C;mBACvC;mBACA;mBACA;mBACA;mBACA;mBACA;;UAaT;;;;UAOA;;;;;UASA;;;;;UAUM;UA8BN;UAOA;;;;;UA2BM;;EAWP;SAxHI,MAAA,GAAA,qBAAA;;;;;;qBCNA;;;;;SAKG,WAAW,SAAS,QAAQ,qCAAqC,oBAAoB;SALxF,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,sBAAA;SAAA,MAAA,GAAA,sBAAA;;;;;;wBAsBG,2BAA2B,UAAU,QAAQ,qCAAqC;qBCjDrF,4CAA4C,SAAS;qBAIrD,oCAAkC,eAAA"}