@openreplay/tracker 12.0.6 → 12.0.7-beta.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.
- package/cjs/app/canvas.js +1 -2
- package/cjs/app/index.js +66 -48
- package/cjs/app/observer/iframe_offsets.js +2 -4
- package/cjs/app/observer/observer.js +1 -1
- package/cjs/index.js +8 -15
- package/cjs/modules/Network/beaconProxy.js +1 -2
- package/cjs/modules/Network/fetchProxy.js +5 -5
- package/cjs/modules/Network/index.js +1 -2
- package/cjs/modules/Network/xhrProxy.js +3 -3
- package/cjs/modules/axiosSpy.js +2 -3
- package/cjs/modules/conditionsManager.js +1 -1
- package/cjs/modules/constructedStyleSheets.js +5 -2
- package/cjs/modules/featureFlags.js +2 -3
- package/cjs/modules/mouse.js +4 -4
- package/cjs/modules/network.js +2 -2
- package/cjs/modules/tagWatcher.js +1 -2
- package/cjs/modules/timing.js +1 -2
- package/cjs/modules/userTesting/index.js +18 -23
- package/cjs/modules/userTesting/recorder.js +3 -4
- package/cjs/modules/userTesting/styles.js +17 -2
- package/lib/app/canvas.js +1 -2
- package/lib/app/index.js +66 -48
- package/lib/app/observer/iframe_offsets.js +2 -4
- package/lib/app/observer/observer.js +1 -1
- package/lib/common/tsconfig.tsbuildinfo +1 -1
- package/lib/index.js +8 -15
- package/lib/modules/Network/beaconProxy.js +1 -2
- package/lib/modules/Network/fetchProxy.js +5 -5
- package/lib/modules/Network/index.js +1 -2
- package/lib/modules/Network/xhrProxy.js +3 -3
- package/lib/modules/axiosSpy.js +2 -3
- package/lib/modules/conditionsManager.js +1 -1
- package/lib/modules/constructedStyleSheets.js +5 -2
- package/lib/modules/featureFlags.js +2 -3
- package/lib/modules/mouse.js +4 -4
- package/lib/modules/network.js +2 -2
- package/lib/modules/tagWatcher.js +1 -2
- package/lib/modules/timing.js +1 -2
- package/lib/modules/userTesting/index.js +18 -23
- package/lib/modules/userTesting/recorder.js +3 -4
- package/lib/modules/userTesting/styles.js +17 -2
- package/package.json +1 -1
- package/tsconfig-base.json +1 -1
|
@@ -90,17 +90,16 @@ export default class UserTestManager {
|
|
|
90
90
|
return false;
|
|
91
91
|
};
|
|
92
92
|
buttonElement.onclick = () => {
|
|
93
|
-
var _a, _b, _c, _d;
|
|
94
93
|
this.removeGreeting();
|
|
95
|
-
const durations =
|
|
94
|
+
const durations = this.signalManager?.getDurations();
|
|
96
95
|
if (durations && this.signalManager) {
|
|
97
96
|
durations.testStart = this.app.timestamp();
|
|
98
97
|
this.signalManager.setDurations(durations);
|
|
99
98
|
}
|
|
100
|
-
void
|
|
99
|
+
void this.signalManager?.signalTest('begin');
|
|
101
100
|
this.container.style.fontFamily = `-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"`;
|
|
102
101
|
Object.assign(this.container.style, styles.containerWidgetStyle);
|
|
103
|
-
this.showWidget(
|
|
102
|
+
this.showWidget(this.test?.guidelines || '', this.test?.tasks || []);
|
|
104
103
|
};
|
|
105
104
|
this.container.append(titleElement, descriptionElement, buttonElement);
|
|
106
105
|
this.bg.appendChild(this.container);
|
|
@@ -137,9 +136,8 @@ export default class UserTestManager {
|
|
|
137
136
|
this.stopButton = stopButton;
|
|
138
137
|
this.stopButtonContainer = stopContainer;
|
|
139
138
|
stopButton.onclick = () => {
|
|
140
|
-
var _a;
|
|
141
139
|
this.userRecorder.discard();
|
|
142
|
-
void
|
|
140
|
+
void this.signalManager?.signalTest('skipped');
|
|
143
141
|
document.body.removeChild(this.bg);
|
|
144
142
|
window.close();
|
|
145
143
|
};
|
|
@@ -151,7 +149,6 @@ export default class UserTestManager {
|
|
|
151
149
|
}
|
|
152
150
|
}
|
|
153
151
|
createTitleSection() {
|
|
154
|
-
var _a;
|
|
155
152
|
const title = createElement('div', 'title', styles.titleWidgetStyle);
|
|
156
153
|
const leftIcon = generateGrid();
|
|
157
154
|
const titleText = createElement('div', 'title_text', {
|
|
@@ -162,7 +159,7 @@ export default class UserTestManager {
|
|
|
162
159
|
fontSize: 16,
|
|
163
160
|
lineHeight: 'auto',
|
|
164
161
|
cursor: 'pointer',
|
|
165
|
-
},
|
|
162
|
+
}, this.test?.title);
|
|
166
163
|
const rightIcon = generateChevron();
|
|
167
164
|
title.append(leftIcon, titleText, rightIcon);
|
|
168
165
|
const toggleWidget = (isVisible) => {
|
|
@@ -233,10 +230,9 @@ export default class UserTestManager {
|
|
|
233
230
|
content.removeChild(button);
|
|
234
231
|
};
|
|
235
232
|
button.onclick = () => {
|
|
236
|
-
var _a, _b, _c;
|
|
237
233
|
toggleDescriptionVisibility();
|
|
238
234
|
if (this.test) {
|
|
239
|
-
const durations =
|
|
235
|
+
const durations = this.signalManager?.getDurations();
|
|
240
236
|
const taskDurationInd = durations
|
|
241
237
|
? durations.tasks.findIndex((t) => this.test && t.taskId === this.test.tasks[0].task_id)
|
|
242
238
|
: null;
|
|
@@ -245,9 +241,9 @@ export default class UserTestManager {
|
|
|
245
241
|
taskId: this.test.tasks[0].task_id,
|
|
246
242
|
started: this.app.timestamp(),
|
|
247
243
|
});
|
|
248
|
-
|
|
244
|
+
this.signalManager?.setDurations(durations);
|
|
249
245
|
}
|
|
250
|
-
void
|
|
246
|
+
void this.signalManager?.signalTask(this.test.tasks[0].task_id, 'begin');
|
|
251
247
|
}
|
|
252
248
|
this.showTaskSection();
|
|
253
249
|
content.removeChild(button);
|
|
@@ -349,23 +345,22 @@ export default class UserTestManager {
|
|
|
349
345
|
titleContainer.onclick = toggleTasksVisibility;
|
|
350
346
|
closePanelButton.onclick = this.collapseWidget;
|
|
351
347
|
nextButton.onclick = () => {
|
|
352
|
-
var _a, _b, _c, _d;
|
|
353
348
|
const textAnswer = tasks[this.currentTaskIndex].allow_typing ? inputArea.value : undefined;
|
|
354
349
|
inputArea.value = '';
|
|
355
|
-
void
|
|
350
|
+
void this.signalManager?.signalTask(tasks[this.currentTaskIndex].task_id, 'done', textAnswer);
|
|
356
351
|
if (this.currentTaskIndex < tasks.length - 1) {
|
|
357
352
|
this.currentTaskIndex++;
|
|
358
353
|
updateTaskContent();
|
|
359
|
-
const durations =
|
|
354
|
+
const durations = this.signalManager?.getDurations();
|
|
360
355
|
if (durations &&
|
|
361
356
|
durations.tasks.findIndex((t) => t.taskId === tasks[this.currentTaskIndex].task_id) === -1) {
|
|
362
357
|
durations.tasks.push({
|
|
363
358
|
taskId: tasks[this.currentTaskIndex].task_id,
|
|
364
359
|
started: this.app.timestamp(),
|
|
365
360
|
});
|
|
366
|
-
|
|
361
|
+
this.signalManager?.setDurations(durations);
|
|
367
362
|
}
|
|
368
|
-
void
|
|
363
|
+
void this.signalManager?.signalTask(tasks[this.currentTaskIndex].task_id, 'begin');
|
|
369
364
|
highlightActive();
|
|
370
365
|
}
|
|
371
366
|
else {
|
|
@@ -384,21 +379,21 @@ export default class UserTestManager {
|
|
|
384
379
|
return section;
|
|
385
380
|
}
|
|
386
381
|
showEndSection() {
|
|
387
|
-
var _a, _b, _c, _d, _e;
|
|
388
382
|
let isLoading = true;
|
|
389
|
-
void
|
|
383
|
+
void this.signalManager?.signalTest('done');
|
|
390
384
|
const section = createElement('div', 'end_section_or', styles.endSectionStyle);
|
|
391
385
|
const title = createElement('div', 'end_title_or', {
|
|
392
386
|
fontSize: '1.25rem',
|
|
393
387
|
fontWeight: '500',
|
|
394
388
|
}, 'Thank you! 👍');
|
|
395
|
-
const description = createElement('div', 'end_description_or', {},
|
|
396
|
-
'\n' +
|
|
397
|
-
|
|
389
|
+
const description = createElement('div', 'end_description_or', {}, this.test?.conclusion ??
|
|
390
|
+
'Thank you for participating in our usability test. Your feedback has been captured and will be used to enhance our website. \n' +
|
|
391
|
+
'\n' +
|
|
392
|
+
'We appreciate your time and valuable input.');
|
|
398
393
|
const button = createElement('div', 'end_button_or', styles.buttonWidgetStyle, 'Submitting Feedback');
|
|
399
394
|
const spinner = createSpinner();
|
|
400
395
|
button.appendChild(spinner);
|
|
401
|
-
if (
|
|
396
|
+
if (this.test?.reqMic || this.test?.reqCamera) {
|
|
402
397
|
void this.userRecorder
|
|
403
398
|
.sendToAPI()
|
|
404
399
|
.then(() => {
|
|
@@ -15,7 +15,7 @@ export default class Recorder {
|
|
|
15
15
|
const videoConstraints = quality;
|
|
16
16
|
try {
|
|
17
17
|
this.stream = await navigator.mediaDevices.getUserMedia({
|
|
18
|
-
video: camReq ?
|
|
18
|
+
video: camReq ? { ...videoConstraints, frameRate: { ideal: fps } } : false,
|
|
19
19
|
audio: micReq,
|
|
20
20
|
});
|
|
21
21
|
this.mediaRecorder = new MediaRecorder(this.stream, {
|
|
@@ -91,8 +91,7 @@ export default class Recorder {
|
|
|
91
91
|
document.body.removeChild(a);
|
|
92
92
|
}
|
|
93
93
|
discard() {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
(_b = this.stream) === null || _b === void 0 ? void 0 : _b.getTracks().forEach((track) => track.stop());
|
|
94
|
+
this.mediaRecorder?.stop();
|
|
95
|
+
this.stream?.getTracks().forEach((track) => track.stop());
|
|
97
96
|
}
|
|
98
97
|
}
|
|
@@ -131,7 +131,13 @@ export const descriptionWidgetStyle = {
|
|
|
131
131
|
fontWeight: '400',
|
|
132
132
|
// lineHeight: '1.375rem',
|
|
133
133
|
};
|
|
134
|
-
export const endSectionStyle =
|
|
134
|
+
export const endSectionStyle = {
|
|
135
|
+
...descriptionWidgetStyle,
|
|
136
|
+
display: 'flex',
|
|
137
|
+
flexDirection: 'column',
|
|
138
|
+
alignItems: 'center',
|
|
139
|
+
gap: '0.625rem',
|
|
140
|
+
};
|
|
135
141
|
export const symbolIcon = {
|
|
136
142
|
fontSize: '1.25rem',
|
|
137
143
|
fontWeight: '500',
|
|
@@ -230,7 +236,16 @@ export const taskButtonStyle = {
|
|
|
230
236
|
fontWeight: '500',
|
|
231
237
|
lineHeight: 'auto',
|
|
232
238
|
};
|
|
233
|
-
export const taskButtonBorderedStyle =
|
|
239
|
+
export const taskButtonBorderedStyle = {
|
|
240
|
+
...taskButtonStyle,
|
|
241
|
+
display: 'flex',
|
|
242
|
+
padding: '0.25rem 0.9375rem',
|
|
243
|
+
justifyContent: 'center',
|
|
244
|
+
alignItems: 'center',
|
|
245
|
+
gap: '0.5rem',
|
|
246
|
+
borderRadius: '0.25rem',
|
|
247
|
+
border: '1px solid #394EFF',
|
|
248
|
+
};
|
|
234
249
|
export const taskButtonsRow = {
|
|
235
250
|
display: 'flex',
|
|
236
251
|
justifyContent: 'space-between',
|
package/package.json
CHANGED