@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.
Files changed (43) hide show
  1. package/cjs/app/canvas.js +1 -2
  2. package/cjs/app/index.js +66 -48
  3. package/cjs/app/observer/iframe_offsets.js +2 -4
  4. package/cjs/app/observer/observer.js +1 -1
  5. package/cjs/index.js +8 -15
  6. package/cjs/modules/Network/beaconProxy.js +1 -2
  7. package/cjs/modules/Network/fetchProxy.js +5 -5
  8. package/cjs/modules/Network/index.js +1 -2
  9. package/cjs/modules/Network/xhrProxy.js +3 -3
  10. package/cjs/modules/axiosSpy.js +2 -3
  11. package/cjs/modules/conditionsManager.js +1 -1
  12. package/cjs/modules/constructedStyleSheets.js +5 -2
  13. package/cjs/modules/featureFlags.js +2 -3
  14. package/cjs/modules/mouse.js +4 -4
  15. package/cjs/modules/network.js +2 -2
  16. package/cjs/modules/tagWatcher.js +1 -2
  17. package/cjs/modules/timing.js +1 -2
  18. package/cjs/modules/userTesting/index.js +18 -23
  19. package/cjs/modules/userTesting/recorder.js +3 -4
  20. package/cjs/modules/userTesting/styles.js +17 -2
  21. package/lib/app/canvas.js +1 -2
  22. package/lib/app/index.js +66 -48
  23. package/lib/app/observer/iframe_offsets.js +2 -4
  24. package/lib/app/observer/observer.js +1 -1
  25. package/lib/common/tsconfig.tsbuildinfo +1 -1
  26. package/lib/index.js +8 -15
  27. package/lib/modules/Network/beaconProxy.js +1 -2
  28. package/lib/modules/Network/fetchProxy.js +5 -5
  29. package/lib/modules/Network/index.js +1 -2
  30. package/lib/modules/Network/xhrProxy.js +3 -3
  31. package/lib/modules/axiosSpy.js +2 -3
  32. package/lib/modules/conditionsManager.js +1 -1
  33. package/lib/modules/constructedStyleSheets.js +5 -2
  34. package/lib/modules/featureFlags.js +2 -3
  35. package/lib/modules/mouse.js +4 -4
  36. package/lib/modules/network.js +2 -2
  37. package/lib/modules/tagWatcher.js +1 -2
  38. package/lib/modules/timing.js +1 -2
  39. package/lib/modules/userTesting/index.js +18 -23
  40. package/lib/modules/userTesting/recorder.js +3 -4
  41. package/lib/modules/userTesting/styles.js +17 -2
  42. package/package.json +1 -1
  43. 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 = (_a = this.signalManager) === null || _a === void 0 ? void 0 : _a.getDurations();
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 ((_b = this.signalManager) === null || _b === void 0 ? void 0 : _b.signalTest('begin'));
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(((_c = this.test) === null || _c === void 0 ? void 0 : _c.guidelines) || '', ((_d = this.test) === null || _d === void 0 ? void 0 : _d.tasks) || []);
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 ((_a = this.signalManager) === null || _a === void 0 ? void 0 : _a.signalTest('skipped'));
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
- }, (_a = this.test) === null || _a === void 0 ? void 0 : _a.title);
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 = (_a = this.signalManager) === null || _a === void 0 ? void 0 : _a.getDurations();
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
- (_b = this.signalManager) === null || _b === void 0 ? void 0 : _b.setDurations(durations);
244
+ this.signalManager?.setDurations(durations);
249
245
  }
250
- void ((_c = this.signalManager) === null || _c === void 0 ? void 0 : _c.signalTask(this.test.tasks[0].task_id, 'begin'));
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 ((_a = this.signalManager) === null || _a === void 0 ? void 0 : _a.signalTask(tasks[this.currentTaskIndex].task_id, 'done', textAnswer));
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 = (_b = this.signalManager) === null || _b === void 0 ? void 0 : _b.getDurations();
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
- (_c = this.signalManager) === null || _c === void 0 ? void 0 : _c.setDurations(durations);
361
+ this.signalManager?.setDurations(durations);
367
362
  }
368
- void ((_d = this.signalManager) === null || _d === void 0 ? void 0 : _d.signalTask(tasks[this.currentTaskIndex].task_id, 'begin'));
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 ((_a = this.signalManager) === null || _a === void 0 ? void 0 : _a.signalTest('done'));
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', {}, (_c = (_b = this.test) === null || _b === void 0 ? void 0 : _b.conclusion) !== null && _c !== void 0 ? _c : 'Thank you for participating in our usability test. Your feedback has been captured and will be used to enhance our website. \n' +
396
- '\n' +
397
- 'We appreciate your time and valuable input.');
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 (((_d = this.test) === null || _d === void 0 ? void 0 : _d.reqMic) || ((_e = this.test) === null || _e === void 0 ? void 0 : _e.reqCamera)) {
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 ? Object.assign(Object.assign({}, videoConstraints), { frameRate: { ideal: fps } }) : false,
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
- var _a, _b;
95
- (_a = this.mediaRecorder) === null || _a === void 0 ? void 0 : _a.stop();
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 = Object.assign(Object.assign({}, descriptionWidgetStyle), { display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '0.625rem' });
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 = Object.assign(Object.assign({}, taskButtonStyle), { display: 'flex', padding: '0.25rem 0.9375rem', justifyContent: 'center', alignItems: 'center', gap: '0.5rem', borderRadius: '0.25rem', border: '1px solid #394EFF' });
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openreplay/tracker",
3
3
  "description": "The OpenReplay tracker main package",
4
- "version": "12.0.6",
4
+ "version": "12.0.7-beta.1",
5
5
  "keywords": [
6
6
  "logging",
7
7
  "replay"
@@ -7,7 +7,7 @@
7
7
  "noImplicitThis": true,
8
8
  "strictNullChecks": true,
9
9
  "alwaysStrict": true,
10
- "target": "es2017",
10
+ "target": "es2020",
11
11
  "module": "es6",
12
12
  "moduleResolution": "nodenext",
13
13
  "esModuleInterop": true