@o3r/application 15.3.0-prerelease.8 → 15.3.0-rc.1
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
|
|
2
|
-
import {
|
|
3
|
-
import { isProductionEnvironment, sendOtterMessage
|
|
4
|
-
import { ENVIRONMENT_CONFIG_TOKEN } from
|
|
5
|
-
import { takeUntilDestroyed } from
|
|
6
|
-
import { LoggerService } from
|
|
7
|
-
import { fromEvent } from
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
33
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
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
|
-
|
|
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":";;;;;;;;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,IAAI,EAAE,CAAC;AAS5E,IAAA;IAPQ,yBAAyB,GAAA;QAC9B,OAAO;AACL,YAAA,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,IAAI,SAAS;AAC3C,YAAA,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,WAAW,IAAI,SAAS;YAC9C,YAAY,EAAE,uBAAuB,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;"}
|
|
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,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"15.3.0-rc.1",
|
|
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-
|
|
30
|
-
"@o3r/logger": "~15.3.0-
|
|
31
|
-
"@o3r/routing": "~15.3.0-
|
|
32
|
-
"@o3r/schematics": "~15.3.0-
|
|
33
|
-
"@o3r/testing": "~15.3.0-
|
|
29
|
+
"@o3r/core": "~15.3.0-rc.1",
|
|
30
|
+
"@o3r/logger": "~15.3.0-rc.1",
|
|
31
|
+
"@o3r/routing": "~15.3.0-rc.1",
|
|
32
|
+
"@o3r/schematics": "~15.3.0-rc.1",
|
|
33
|
+
"@o3r/testing": "~15.3.0-rc.1",
|
|
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-
|
|
57
|
+
"@o3r/schematics": "~15.3.0-rc.1",
|
|
58
58
|
"tslib": "^2.6.2"
|
|
59
59
|
},
|
|
60
60
|
"engines": {
|
|
@@ -1,170 +1,159 @@
|
|
|
1
|
-
import { DevtoolsCommonOptions,
|
|
2
|
-
import * as i0 from
|
|
3
|
-
import {
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
59
|
-
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
|
166
|
-
|
|
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":";;;;
|
|
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"}
|