@openreplay/tracker 11.0.0-beta.1 → 11.0.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.
- package/cjs/app/index.d.ts +1 -0
- package/cjs/app/index.js +2 -1
- package/cjs/index.js +1 -1
- package/cjs/modules/userTesting/index.d.ts +2 -2
- package/cjs/modules/userTesting/index.js +17 -10
- package/lib/app/index.d.ts +1 -0
- package/lib/app/index.js +2 -1
- package/lib/index.js +1 -1
- package/lib/modules/userTesting/index.d.ts +2 -2
- package/lib/modules/userTesting/index.js +17 -10
- package/package.json +1 -1
package/cjs/app/index.d.ts
CHANGED
package/cjs/app/index.js
CHANGED
|
@@ -42,7 +42,7 @@ class App {
|
|
|
42
42
|
this.stopCallbacks = [];
|
|
43
43
|
this.commitCallbacks = [];
|
|
44
44
|
this.activityState = ActivityState.NotActive;
|
|
45
|
-
this.version = '11.0.0
|
|
45
|
+
this.version = '11.0.0'; // TODO: version compatability check inside each plugin.
|
|
46
46
|
this.compressionThreshold = 24 * 1000;
|
|
47
47
|
this.restartAttempts = 0;
|
|
48
48
|
this.bc = null;
|
|
@@ -72,6 +72,7 @@ class App {
|
|
|
72
72
|
sessionStorage: null,
|
|
73
73
|
disableStringDict: false,
|
|
74
74
|
forceSingleTab: false,
|
|
75
|
+
assistSocketHost: '',
|
|
75
76
|
}, options);
|
|
76
77
|
if (!this.options.forceSingleTab && globalThis && 'BroadcastChannel' in globalThis) {
|
|
77
78
|
const host = location.hostname.split('.').slice(-2).join('_');
|
package/cjs/index.js
CHANGED
|
@@ -162,7 +162,7 @@ class API {
|
|
|
162
162
|
// no-cors issue only with text/plain or not-set Content-Type
|
|
163
163
|
// req.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
|
|
164
164
|
req.send(JSON.stringify({
|
|
165
|
-
trackerVersion: '11.0.0
|
|
165
|
+
trackerVersion: '11.0.0',
|
|
166
166
|
projectKey: options.projectKey,
|
|
167
167
|
doNotTrack,
|
|
168
168
|
// TODO: add precise reason (an exact API missing)
|
|
@@ -25,7 +25,7 @@ export default class UserTestManager {
|
|
|
25
25
|
collapseWidget: () => boolean;
|
|
26
26
|
removeGreeting: () => boolean;
|
|
27
27
|
createGreeting(title: string, micRequired: boolean, cameraRequired: boolean): void;
|
|
28
|
-
showWidget(
|
|
28
|
+
showWidget(guidelines: string, tasks: {
|
|
29
29
|
title: string;
|
|
30
30
|
description: string;
|
|
31
31
|
task_id: number;
|
|
@@ -33,7 +33,7 @@ export default class UserTestManager {
|
|
|
33
33
|
}[], inProgress?: boolean): void;
|
|
34
34
|
createTitleSection(): HTMLElement;
|
|
35
35
|
toggleDescriptionVisibility: () => void;
|
|
36
|
-
createDescriptionSection(
|
|
36
|
+
createDescriptionSection(guidelines: string): HTMLElement;
|
|
37
37
|
currentTaskIndex: number;
|
|
38
38
|
createTasksSection(tasks: {
|
|
39
39
|
title: string;
|
|
@@ -140,7 +140,7 @@ class UserTestManager {
|
|
|
140
140
|
const noticeElement = createElement('div', 'notice', styles.noticeStyle, `Please note that your ${micRequired ? 'audio,' : ''} ${cameraRequired ? 'video,' : ''} ${micRequired || cameraRequired ? 'and' : ''} screen will be recorded for research purposes during this test.`);
|
|
141
141
|
const buttonElement = createElement('div', 'button', styles.buttonStyle, 'Read guidelines to begin');
|
|
142
142
|
this.removeGreeting = () => {
|
|
143
|
-
this.container.innerHTML = ''
|
|
143
|
+
// this.container.innerHTML = ''
|
|
144
144
|
if (micRequired || cameraRequired) {
|
|
145
145
|
void this.userRecorder.startRecording(30, recorder_js_1.Quality.Standard, micRequired, cameraRequired);
|
|
146
146
|
}
|
|
@@ -155,13 +155,13 @@ class UserTestManager {
|
|
|
155
155
|
this.removeGreeting();
|
|
156
156
|
this.durations.testStart = this.app.timestamp();
|
|
157
157
|
void this.signalTest('begin');
|
|
158
|
-
this.showWidget(((_a = this.test) === null || _a === void 0 ? void 0 : _a.
|
|
158
|
+
this.showWidget(((_a = this.test) === null || _a === void 0 ? void 0 : _a.guidelines) || '', ((_b = this.test) === null || _b === void 0 ? void 0 : _b.tasks) || []);
|
|
159
159
|
};
|
|
160
160
|
this.container.append(titleElement, descriptionElement, noticeElement, buttonElement);
|
|
161
161
|
this.bg.appendChild(this.container);
|
|
162
162
|
document.body.appendChild(this.bg);
|
|
163
163
|
}
|
|
164
|
-
showWidget(
|
|
164
|
+
showWidget(guidelines, tasks, inProgress) {
|
|
165
165
|
this.container.innerHTML = '';
|
|
166
166
|
Object.assign(this.bg.style, {
|
|
167
167
|
position: 'fixed',
|
|
@@ -179,7 +179,7 @@ class UserTestManager {
|
|
|
179
179
|
// Create title section
|
|
180
180
|
const titleSection = this.createTitleSection();
|
|
181
181
|
Object.assign(this.container.style, styles.containerWidgetStyle);
|
|
182
|
-
const descriptionSection = this.createDescriptionSection(
|
|
182
|
+
const descriptionSection = this.createDescriptionSection(guidelines);
|
|
183
183
|
const tasksSection = this.createTasksSection(tasks);
|
|
184
184
|
const stopButton = createElement('div', 'stop_bn_or', styles.stopWidgetStyle, 'Abort Session');
|
|
185
185
|
this.container.append(titleSection, descriptionSection, tasksSection, stopButton);
|
|
@@ -234,7 +234,7 @@ class UserTestManager {
|
|
|
234
234
|
this.collapseWidget = () => toggleWidget(false);
|
|
235
235
|
return title;
|
|
236
236
|
}
|
|
237
|
-
createDescriptionSection(
|
|
237
|
+
createDescriptionSection(guidelines) {
|
|
238
238
|
const section = createElement('div', 'description_section_or', styles.descriptionWidgetStyle);
|
|
239
239
|
const titleContainer = createElement('div', 'description_s_title_or', styles.sectionTitleStyle);
|
|
240
240
|
const title = createElement('div', 'title', {}, 'Introduction & Guidelines');
|
|
@@ -242,9 +242,10 @@ class UserTestManager {
|
|
|
242
242
|
const content = createElement('div', 'content', styles.contentStyle);
|
|
243
243
|
const descriptionC = createElement('div', 'text_description', {
|
|
244
244
|
maxHeight: '250px',
|
|
245
|
-
|
|
245
|
+
overflowY: 'auto',
|
|
246
|
+
whiteSpace: 'pre-wrap',
|
|
246
247
|
});
|
|
247
|
-
descriptionC.innerHTML =
|
|
248
|
+
descriptionC.innerHTML = guidelines;
|
|
248
249
|
const button = createElement('div', 'button_begin_or', styles.buttonWidgetStyle, 'Begin Test');
|
|
249
250
|
titleContainer.append(title, icon);
|
|
250
251
|
content.append(descriptionC, button);
|
|
@@ -388,21 +389,24 @@ class UserTestManager {
|
|
|
388
389
|
}
|
|
389
390
|
showEndSection() {
|
|
390
391
|
var _a, _b, _c, _d, _e, _f;
|
|
392
|
+
let isLoading = true;
|
|
391
393
|
void this.signalTest('done');
|
|
392
394
|
const section = createElement('div', 'end_section_or', styles.endSectionStyle);
|
|
393
395
|
const title = createElement('div', 'end_title_or', {
|
|
394
396
|
fontSize: '1.25rem',
|
|
395
397
|
fontWeight: '500',
|
|
396
398
|
}, ((_a = this.test) === null || _a === void 0 ? void 0 : _a.reqMic) || ((_b = this.test) === null || _b === void 0 ? void 0 : _b.reqCamera) ? 'Uploading test recording...' : 'Thank you! 👍');
|
|
397
|
-
const description = createElement('div', 'end_description_or', {}, (_d = (_c = this.test) === null || _c === void 0 ? void 0 : _c.conclusion) !== null && _d !== void 0 ? _d : 'Thank you for participating in our
|
|
399
|
+
const description = createElement('div', 'end_description_or', {}, (_d = (_c = this.test) === null || _c === void 0 ? void 0 : _c.conclusion) !== null && _d !== void 0 ? _d : 'Thank you for participating in our usability test. Your feedback has been captured and will be used to enhance our website. \n' +
|
|
398
400
|
'\n' +
|
|
399
401
|
'We appreciate your time and valuable input.');
|
|
402
|
+
const button = createElement('div', 'end_button_or', styles.buttonWidgetStyle, 'Uploading session...');
|
|
400
403
|
if (((_e = this.test) === null || _e === void 0 ? void 0 : _e.reqMic) || ((_f = this.test) === null || _f === void 0 ? void 0 : _f.reqCamera)) {
|
|
401
|
-
this.userRecorder.sendToAPI().then(() => {
|
|
404
|
+
void this.userRecorder.sendToAPI().then(() => {
|
|
402
405
|
title.textContent = 'Thank you! 👍';
|
|
406
|
+
button.textContent = 'End Session';
|
|
407
|
+
isLoading = false;
|
|
403
408
|
});
|
|
404
409
|
}
|
|
405
|
-
const button = createElement('div', 'end_button_or', styles.buttonWidgetStyle, 'End Session');
|
|
406
410
|
if (this.taskSection) {
|
|
407
411
|
this.container.removeChild(this.taskSection);
|
|
408
412
|
}
|
|
@@ -413,6 +417,9 @@ class UserTestManager {
|
|
|
413
417
|
this.container.removeChild(this.stopButton);
|
|
414
418
|
}
|
|
415
419
|
button.onclick = () => {
|
|
420
|
+
if (isLoading)
|
|
421
|
+
return;
|
|
422
|
+
window.close();
|
|
416
423
|
document.body.removeChild(this.bg);
|
|
417
424
|
};
|
|
418
425
|
section.append(title, description, button);
|
package/lib/app/index.d.ts
CHANGED
package/lib/app/index.js
CHANGED
|
@@ -39,7 +39,7 @@ export default class App {
|
|
|
39
39
|
this.stopCallbacks = [];
|
|
40
40
|
this.commitCallbacks = [];
|
|
41
41
|
this.activityState = ActivityState.NotActive;
|
|
42
|
-
this.version = '11.0.0
|
|
42
|
+
this.version = '11.0.0'; // TODO: version compatability check inside each plugin.
|
|
43
43
|
this.compressionThreshold = 24 * 1000;
|
|
44
44
|
this.restartAttempts = 0;
|
|
45
45
|
this.bc = null;
|
|
@@ -69,6 +69,7 @@ export default class App {
|
|
|
69
69
|
sessionStorage: null,
|
|
70
70
|
disableStringDict: false,
|
|
71
71
|
forceSingleTab: false,
|
|
72
|
+
assistSocketHost: '',
|
|
72
73
|
}, options);
|
|
73
74
|
if (!this.options.forceSingleTab && globalThis && 'BroadcastChannel' in globalThis) {
|
|
74
75
|
const host = location.hostname.split('.').slice(-2).join('_');
|
package/lib/index.js
CHANGED
|
@@ -157,7 +157,7 @@ export default class API {
|
|
|
157
157
|
// no-cors issue only with text/plain or not-set Content-Type
|
|
158
158
|
// req.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
|
|
159
159
|
req.send(JSON.stringify({
|
|
160
|
-
trackerVersion: '11.0.0
|
|
160
|
+
trackerVersion: '11.0.0',
|
|
161
161
|
projectKey: options.projectKey,
|
|
162
162
|
doNotTrack,
|
|
163
163
|
// TODO: add precise reason (an exact API missing)
|
|
@@ -25,7 +25,7 @@ export default class UserTestManager {
|
|
|
25
25
|
collapseWidget: () => boolean;
|
|
26
26
|
removeGreeting: () => boolean;
|
|
27
27
|
createGreeting(title: string, micRequired: boolean, cameraRequired: boolean): void;
|
|
28
|
-
showWidget(
|
|
28
|
+
showWidget(guidelines: string, tasks: {
|
|
29
29
|
title: string;
|
|
30
30
|
description: string;
|
|
31
31
|
task_id: number;
|
|
@@ -33,7 +33,7 @@ export default class UserTestManager {
|
|
|
33
33
|
}[], inProgress?: boolean): void;
|
|
34
34
|
createTitleSection(): HTMLElement;
|
|
35
35
|
toggleDescriptionVisibility: () => void;
|
|
36
|
-
createDescriptionSection(
|
|
36
|
+
createDescriptionSection(guidelines: string): HTMLElement;
|
|
37
37
|
currentTaskIndex: number;
|
|
38
38
|
createTasksSection(tasks: {
|
|
39
39
|
title: string;
|
|
@@ -138,7 +138,7 @@ export default class UserTestManager {
|
|
|
138
138
|
const noticeElement = createElement('div', 'notice', styles.noticeStyle, `Please note that your ${micRequired ? 'audio,' : ''} ${cameraRequired ? 'video,' : ''} ${micRequired || cameraRequired ? 'and' : ''} screen will be recorded for research purposes during this test.`);
|
|
139
139
|
const buttonElement = createElement('div', 'button', styles.buttonStyle, 'Read guidelines to begin');
|
|
140
140
|
this.removeGreeting = () => {
|
|
141
|
-
this.container.innerHTML = ''
|
|
141
|
+
// this.container.innerHTML = ''
|
|
142
142
|
if (micRequired || cameraRequired) {
|
|
143
143
|
void this.userRecorder.startRecording(30, Quality.Standard, micRequired, cameraRequired);
|
|
144
144
|
}
|
|
@@ -153,13 +153,13 @@ export default class UserTestManager {
|
|
|
153
153
|
this.removeGreeting();
|
|
154
154
|
this.durations.testStart = this.app.timestamp();
|
|
155
155
|
void this.signalTest('begin');
|
|
156
|
-
this.showWidget(((_a = this.test) === null || _a === void 0 ? void 0 : _a.
|
|
156
|
+
this.showWidget(((_a = this.test) === null || _a === void 0 ? void 0 : _a.guidelines) || '', ((_b = this.test) === null || _b === void 0 ? void 0 : _b.tasks) || []);
|
|
157
157
|
};
|
|
158
158
|
this.container.append(titleElement, descriptionElement, noticeElement, buttonElement);
|
|
159
159
|
this.bg.appendChild(this.container);
|
|
160
160
|
document.body.appendChild(this.bg);
|
|
161
161
|
}
|
|
162
|
-
showWidget(
|
|
162
|
+
showWidget(guidelines, tasks, inProgress) {
|
|
163
163
|
this.container.innerHTML = '';
|
|
164
164
|
Object.assign(this.bg.style, {
|
|
165
165
|
position: 'fixed',
|
|
@@ -177,7 +177,7 @@ export default class UserTestManager {
|
|
|
177
177
|
// Create title section
|
|
178
178
|
const titleSection = this.createTitleSection();
|
|
179
179
|
Object.assign(this.container.style, styles.containerWidgetStyle);
|
|
180
|
-
const descriptionSection = this.createDescriptionSection(
|
|
180
|
+
const descriptionSection = this.createDescriptionSection(guidelines);
|
|
181
181
|
const tasksSection = this.createTasksSection(tasks);
|
|
182
182
|
const stopButton = createElement('div', 'stop_bn_or', styles.stopWidgetStyle, 'Abort Session');
|
|
183
183
|
this.container.append(titleSection, descriptionSection, tasksSection, stopButton);
|
|
@@ -232,7 +232,7 @@ export default class UserTestManager {
|
|
|
232
232
|
this.collapseWidget = () => toggleWidget(false);
|
|
233
233
|
return title;
|
|
234
234
|
}
|
|
235
|
-
createDescriptionSection(
|
|
235
|
+
createDescriptionSection(guidelines) {
|
|
236
236
|
const section = createElement('div', 'description_section_or', styles.descriptionWidgetStyle);
|
|
237
237
|
const titleContainer = createElement('div', 'description_s_title_or', styles.sectionTitleStyle);
|
|
238
238
|
const title = createElement('div', 'title', {}, 'Introduction & Guidelines');
|
|
@@ -240,9 +240,10 @@ export default class UserTestManager {
|
|
|
240
240
|
const content = createElement('div', 'content', styles.contentStyle);
|
|
241
241
|
const descriptionC = createElement('div', 'text_description', {
|
|
242
242
|
maxHeight: '250px',
|
|
243
|
-
|
|
243
|
+
overflowY: 'auto',
|
|
244
|
+
whiteSpace: 'pre-wrap',
|
|
244
245
|
});
|
|
245
|
-
descriptionC.innerHTML =
|
|
246
|
+
descriptionC.innerHTML = guidelines;
|
|
246
247
|
const button = createElement('div', 'button_begin_or', styles.buttonWidgetStyle, 'Begin Test');
|
|
247
248
|
titleContainer.append(title, icon);
|
|
248
249
|
content.append(descriptionC, button);
|
|
@@ -386,21 +387,24 @@ export default class UserTestManager {
|
|
|
386
387
|
}
|
|
387
388
|
showEndSection() {
|
|
388
389
|
var _a, _b, _c, _d, _e, _f;
|
|
390
|
+
let isLoading = true;
|
|
389
391
|
void this.signalTest('done');
|
|
390
392
|
const section = createElement('div', 'end_section_or', styles.endSectionStyle);
|
|
391
393
|
const title = createElement('div', 'end_title_or', {
|
|
392
394
|
fontSize: '1.25rem',
|
|
393
395
|
fontWeight: '500',
|
|
394
396
|
}, ((_a = this.test) === null || _a === void 0 ? void 0 : _a.reqMic) || ((_b = this.test) === null || _b === void 0 ? void 0 : _b.reqCamera) ? 'Uploading test recording...' : 'Thank you! 👍');
|
|
395
|
-
const description = createElement('div', 'end_description_or', {}, (_d = (_c = this.test) === null || _c === void 0 ? void 0 : _c.conclusion) !== null && _d !== void 0 ? _d : 'Thank you for participating in our
|
|
397
|
+
const description = createElement('div', 'end_description_or', {}, (_d = (_c = this.test) === null || _c === void 0 ? void 0 : _c.conclusion) !== null && _d !== void 0 ? _d : 'Thank you for participating in our usability test. Your feedback has been captured and will be used to enhance our website. \n' +
|
|
396
398
|
'\n' +
|
|
397
399
|
'We appreciate your time and valuable input.');
|
|
400
|
+
const button = createElement('div', 'end_button_or', styles.buttonWidgetStyle, 'Uploading session...');
|
|
398
401
|
if (((_e = this.test) === null || _e === void 0 ? void 0 : _e.reqMic) || ((_f = this.test) === null || _f === void 0 ? void 0 : _f.reqCamera)) {
|
|
399
|
-
this.userRecorder.sendToAPI().then(() => {
|
|
402
|
+
void this.userRecorder.sendToAPI().then(() => {
|
|
400
403
|
title.textContent = 'Thank you! 👍';
|
|
404
|
+
button.textContent = 'End Session';
|
|
405
|
+
isLoading = false;
|
|
401
406
|
});
|
|
402
407
|
}
|
|
403
|
-
const button = createElement('div', 'end_button_or', styles.buttonWidgetStyle, 'End Session');
|
|
404
408
|
if (this.taskSection) {
|
|
405
409
|
this.container.removeChild(this.taskSection);
|
|
406
410
|
}
|
|
@@ -411,6 +415,9 @@ export default class UserTestManager {
|
|
|
411
415
|
this.container.removeChild(this.stopButton);
|
|
412
416
|
}
|
|
413
417
|
button.onclick = () => {
|
|
418
|
+
if (isLoading)
|
|
419
|
+
return;
|
|
420
|
+
window.close();
|
|
414
421
|
document.body.removeChild(this.bg);
|
|
415
422
|
};
|
|
416
423
|
section.append(title, description, button);
|