@openreplay/tracker 14.0.10-beta.1 → 14.0.10

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 (273) hide show
  1. package/{cjs → dist/cjs}/index.js +27 -49
  2. package/dist/cjs/index.js.map +1 -0
  3. package/{cjs → dist/cjs/main}/app/index.d.ts +38 -6
  4. package/{lib → dist/cjs/main}/app/messages.gen.d.ts +2 -2
  5. package/{lib/app/nodes.d.ts → dist/cjs/main/app/nodes/index.d.ts} +15 -7
  6. package/dist/cjs/main/app/nodes/maintainer.d.ts +28 -0
  7. package/{cjs → dist/cjs/main}/app/observer/iframe_observer.d.ts +1 -1
  8. package/{lib → dist/cjs/main}/app/observer/iframe_offsets.d.ts +1 -1
  9. package/{lib → dist/cjs/main}/app/observer/observer.d.ts +6 -0
  10. package/{lib → dist/cjs/main}/app/observer/top_observer.d.ts +6 -2
  11. package/{cjs → dist/cjs/main}/app/sanitizer.d.ts +5 -2
  12. package/{cjs → dist/cjs/main}/app/session.d.ts +6 -3
  13. package/{lib → dist/cjs/main}/index.d.ts +2 -2
  14. package/{lib → dist/cjs/main}/modules/attributeSender.d.ts +5 -2
  15. package/{cjs → dist/cjs/main}/modules/conditionsManager.d.ts +1 -1
  16. package/{cjs → dist/cjs/main}/modules/tagWatcher.d.ts +8 -4
  17. package/{lib → dist/cjs/main}/modules/userTesting/SignalManager.d.ts +2 -2
  18. package/{lib → dist/cjs/main}/utils.d.ts +4 -3
  19. package/dist/lib/index.js +9323 -0
  20. package/dist/lib/index.js.map +1 -0
  21. package/{lib → dist/lib/main}/app/index.d.ts +38 -6
  22. package/{cjs → dist/lib/main}/app/messages.gen.d.ts +2 -2
  23. package/{cjs/app/nodes.d.ts → dist/lib/main/app/nodes/index.d.ts} +15 -7
  24. package/dist/lib/main/app/nodes/maintainer.d.ts +28 -0
  25. package/{lib → dist/lib/main}/app/observer/iframe_observer.d.ts +1 -1
  26. package/{cjs → dist/lib/main}/app/observer/iframe_offsets.d.ts +1 -1
  27. package/{cjs → dist/lib/main}/app/observer/observer.d.ts +6 -0
  28. package/{cjs → dist/lib/main}/app/observer/top_observer.d.ts +6 -2
  29. package/{lib → dist/lib/main}/app/sanitizer.d.ts +5 -2
  30. package/{lib → dist/lib/main}/app/session.d.ts +6 -3
  31. package/{cjs → dist/lib/main}/index.d.ts +2 -2
  32. package/{cjs → dist/lib/main}/modules/attributeSender.d.ts +5 -2
  33. package/{lib → dist/lib/main}/modules/conditionsManager.d.ts +1 -1
  34. package/{lib → dist/lib/main}/modules/tagWatcher.d.ts +8 -4
  35. package/{cjs → dist/lib/main}/modules/userTesting/SignalManager.d.ts +2 -2
  36. package/{cjs → dist/lib/main}/utils.d.ts +4 -3
  37. package/package.json +29 -10
  38. package/.eslintignore +0 -11
  39. package/.nvmrc +0 -1
  40. package/.prettierignore +0 -1
  41. package/CHANGELOG.md +0 -297
  42. package/bun.lockb +0 -0
  43. package/cjs/app/canvas.js +0 -204
  44. package/cjs/app/guards.js +0 -37
  45. package/cjs/app/index.js +0 -1366
  46. package/cjs/app/logger.js +0 -37
  47. package/cjs/app/messages.gen.js +0 -702
  48. package/cjs/app/nodes.js +0 -110
  49. package/cjs/app/observer/iframe_observer.js +0 -35
  50. package/cjs/app/observer/iframe_offsets.js +0 -56
  51. package/cjs/app/observer/observer.js +0 -352
  52. package/cjs/app/observer/shadow_root_observer.js +0 -24
  53. package/cjs/app/observer/top_observer.js +0 -134
  54. package/cjs/app/sanitizer.js +0 -82
  55. package/cjs/app/session.js +0 -140
  56. package/cjs/app/ticker.js +0 -48
  57. package/cjs/common/interaction.js +0 -2
  58. package/cjs/common/messages.gen.js +0 -4
  59. package/cjs/modules/attributeSender.js +0 -51
  60. package/cjs/modules/axiosSpy.js +0 -122
  61. package/cjs/modules/conditionsManager.js +0 -343
  62. package/cjs/modules/connection.js +0 -15
  63. package/cjs/modules/console.js +0 -127
  64. package/cjs/modules/constructedStyleSheets.js +0 -138
  65. package/cjs/modules/cssrules.js +0 -99
  66. package/cjs/modules/exception.js +0 -85
  67. package/cjs/modules/featureFlags.js +0 -89
  68. package/cjs/modules/focus.js +0 -45
  69. package/cjs/modules/fonts.js +0 -57
  70. package/cjs/modules/img.js +0 -110
  71. package/cjs/modules/input.js +0 -203
  72. package/cjs/modules/mouse.js +0 -195
  73. package/cjs/modules/network.js +0 -244
  74. package/cjs/modules/performance.js +0 -53
  75. package/cjs/modules/scroll.js +0 -84
  76. package/cjs/modules/selection.js +0 -37
  77. package/cjs/modules/tabs.js +0 -13
  78. package/cjs/modules/tagWatcher.js +0 -76
  79. package/cjs/modules/timing.js +0 -173
  80. package/cjs/modules/userTesting/SignalManager.js +0 -83
  81. package/cjs/modules/userTesting/dnd.js +0 -40
  82. package/cjs/modules/userTesting/index.js +0 -464
  83. package/cjs/modules/userTesting/recorder.js +0 -101
  84. package/cjs/modules/userTesting/styles.js +0 -266
  85. package/cjs/modules/userTesting/utils.js +0 -87
  86. package/cjs/modules/viewport.js +0 -43
  87. package/cjs/package.json +0 -1
  88. package/cjs/utils.js +0 -230
  89. package/coverage/clover.xml +0 -4304
  90. package/coverage/coverage-final.json +0 -55
  91. package/coverage/lcov-report/base.css +0 -224
  92. package/coverage/lcov-report/block-navigation.js +0 -87
  93. package/coverage/lcov-report/favicon.png +0 -0
  94. package/coverage/lcov-report/index.html +0 -206
  95. package/coverage/lcov-report/main/app/canvas.ts.html +0 -712
  96. package/coverage/lcov-report/main/app/guards.ts.html +0 -232
  97. package/coverage/lcov-report/main/app/index.html +0 -236
  98. package/coverage/lcov-report/main/app/index.ts.html +0 -3955
  99. package/coverage/lcov-report/main/app/logger.ts.html +0 -211
  100. package/coverage/lcov-report/main/app/messages.gen.ts.html +0 -3034
  101. package/coverage/lcov-report/main/app/nodes.ts.html +0 -406
  102. package/coverage/lcov-report/main/app/observer/iframe_observer.ts.html +0 -148
  103. package/coverage/lcov-report/main/app/observer/iframe_offsets.ts.html +0 -289
  104. package/coverage/lcov-report/main/app/observer/index.html +0 -161
  105. package/coverage/lcov-report/main/app/observer/shadow_root_observer.ts.html +0 -142
  106. package/coverage/lcov-report/main/app/observer/top_observer.ts.html +0 -541
  107. package/coverage/lcov-report/main/app/sanitizer.ts.html +0 -403
  108. package/coverage/lcov-report/main/app/session.ts.html +0 -622
  109. package/coverage/lcov-report/main/app/ticker.ts.html +0 -250
  110. package/coverage/lcov-report/main/index.html +0 -131
  111. package/coverage/lcov-report/main/index.ts.html +0 -1597
  112. package/coverage/lcov-report/main/modules/Network/beaconProxy.ts.html +0 -400
  113. package/coverage/lcov-report/main/modules/Network/fetchProxy.ts.html +0 -1075
  114. package/coverage/lcov-report/main/modules/Network/index.html +0 -191
  115. package/coverage/lcov-report/main/modules/Network/index.ts.html +0 -244
  116. package/coverage/lcov-report/main/modules/Network/networkMessage.ts.html +0 -400
  117. package/coverage/lcov-report/main/modules/Network/utils.ts.html +0 -709
  118. package/coverage/lcov-report/main/modules/Network/xhrProxy.ts.html +0 -877
  119. package/coverage/lcov-report/main/modules/attributeSender.ts.html +0 -241
  120. package/coverage/lcov-report/main/modules/axiosSpy.ts.html +0 -709
  121. package/coverage/lcov-report/main/modules/conditionsManager.ts.html +0 -1381
  122. package/coverage/lcov-report/main/modules/connection.ts.html +0 -160
  123. package/coverage/lcov-report/main/modules/console.ts.html +0 -541
  124. package/coverage/lcov-report/main/modules/constructedStyleSheets.ts.html +0 -571
  125. package/coverage/lcov-report/main/modules/cssrules.ts.html +0 -418
  126. package/coverage/lcov-report/main/modules/exception.ts.html +0 -385
  127. package/coverage/lcov-report/main/modules/featureFlags.ts.html +0 -415
  128. package/coverage/lcov-report/main/modules/focus.ts.html +0 -220
  129. package/coverage/lcov-report/main/modules/fonts.ts.html +0 -289
  130. package/coverage/lcov-report/main/modules/img.ts.html +0 -436
  131. package/coverage/lcov-report/main/modules/index.html +0 -431
  132. package/coverage/lcov-report/main/modules/input.ts.html +0 -826
  133. package/coverage/lcov-report/main/modules/mouse.ts.html +0 -826
  134. package/coverage/lcov-report/main/modules/network.ts.html +0 -1123
  135. package/coverage/lcov-report/main/modules/performance.ts.html +0 -367
  136. package/coverage/lcov-report/main/modules/scroll.ts.html +0 -364
  137. package/coverage/lcov-report/main/modules/selection.ts.html +0 -202
  138. package/coverage/lcov-report/main/modules/tabs.ts.html +0 -124
  139. package/coverage/lcov-report/main/modules/tagWatcher.ts.html +0 -337
  140. package/coverage/lcov-report/main/modules/timing.ts.html +0 -877
  141. package/coverage/lcov-report/main/modules/userTesting/SignalManager.ts.html +0 -370
  142. package/coverage/lcov-report/main/modules/userTesting/dnd.ts.html +0 -220
  143. package/coverage/lcov-report/main/modules/userTesting/index.html +0 -191
  144. package/coverage/lcov-report/main/modules/userTesting/index.ts.html +0 -1909
  145. package/coverage/lcov-report/main/modules/userTesting/recorder.ts.html +0 -430
  146. package/coverage/lcov-report/main/modules/userTesting/styles.ts.html +0 -937
  147. package/coverage/lcov-report/main/modules/userTesting/utils.ts.html +0 -364
  148. package/coverage/lcov-report/main/modules/viewport.ts.html +0 -250
  149. package/coverage/lcov-report/main/utils.ts.html +0 -814
  150. package/coverage/lcov-report/prettify.css +0 -1
  151. package/coverage/lcov-report/prettify.js +0 -2
  152. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  153. package/coverage/lcov-report/sorter.js +0 -196
  154. package/coverage/lcov-report/webworker/BatchWriter.ts.html +0 -499
  155. package/coverage/lcov-report/webworker/MessageEncoder.gen.ts.html +0 -1021
  156. package/coverage/lcov-report/webworker/PrimitiveEncoder.ts.html +0 -436
  157. package/coverage/lcov-report/webworker/QueueSender.ts.html +0 -547
  158. package/coverage/lcov-report/webworker/index.html +0 -176
  159. package/coverage/lcov-report/webworker/index.ts.html +0 -667
  160. package/coverage/lcov.info +0 -8425
  161. package/jest.config.js +0 -13
  162. package/lib/app/canvas.js +0 -202
  163. package/lib/app/guards.js +0 -26
  164. package/lib/app/index.js +0 -1336
  165. package/lib/app/logger.js +0 -33
  166. package/lib/app/messages.gen.js +0 -622
  167. package/lib/app/nodes.js +0 -107
  168. package/lib/app/observer/iframe_observer.js +0 -29
  169. package/lib/app/observer/iframe_offsets.js +0 -53
  170. package/lib/app/observer/observer.js +0 -349
  171. package/lib/app/observer/shadow_root_observer.js +0 -18
  172. package/lib/app/observer/top_observer.js +0 -128
  173. package/lib/app/sanitizer.js +0 -77
  174. package/lib/app/session.js +0 -137
  175. package/lib/app/ticker.js +0 -45
  176. package/lib/common/interaction.js +0 -1
  177. package/lib/common/messages.gen.js +0 -3
  178. package/lib/common/tsconfig.tsbuildinfo +0 -1
  179. package/lib/index.js +0 -423
  180. package/lib/modules/attributeSender.js +0 -46
  181. package/lib/modules/axiosSpy.js +0 -119
  182. package/lib/modules/conditionsManager.js +0 -340
  183. package/lib/modules/connection.js +0 -12
  184. package/lib/modules/console.js +0 -124
  185. package/lib/modules/constructedStyleSheets.js +0 -133
  186. package/lib/modules/cssrules.js +0 -97
  187. package/lib/modules/exception.js +0 -76
  188. package/lib/modules/featureFlags.js +0 -86
  189. package/lib/modules/focus.js +0 -42
  190. package/lib/modules/fonts.js +0 -54
  191. package/lib/modules/img.js +0 -107
  192. package/lib/modules/input.js +0 -198
  193. package/lib/modules/mouse.js +0 -192
  194. package/lib/modules/network.js +0 -238
  195. package/lib/modules/performance.js +0 -49
  196. package/lib/modules/scroll.js +0 -81
  197. package/lib/modules/selection.js +0 -35
  198. package/lib/modules/tabs.js +0 -10
  199. package/lib/modules/tagWatcher.js +0 -73
  200. package/lib/modules/timing.js +0 -170
  201. package/lib/modules/userTesting/SignalManager.js +0 -80
  202. package/lib/modules/userTesting/dnd.js +0 -37
  203. package/lib/modules/userTesting/index.js +0 -435
  204. package/lib/modules/userTesting/recorder.js +0 -97
  205. package/lib/modules/userTesting/styles.js +0 -263
  206. package/lib/modules/userTesting/utils.js +0 -79
  207. package/lib/modules/viewport.js +0 -40
  208. package/lib/utils.js +0 -211
  209. package/rollup.config.js +0 -12
  210. package/scripts/checkver.cjs +0 -7
  211. package/tsconfig-base.json +0 -16
  212. /package/{cjs → dist/cjs}/common/interaction.d.ts +0 -0
  213. /package/{cjs → dist/cjs}/common/messages.gen.d.ts +0 -0
  214. /package/{cjs → dist/cjs/main}/app/canvas.d.ts +0 -0
  215. /package/{cjs → dist/cjs/main}/app/guards.d.ts +0 -0
  216. /package/{cjs → dist/cjs/main}/app/logger.d.ts +0 -0
  217. /package/{cjs → dist/cjs/main}/app/observer/shadow_root_observer.d.ts +0 -0
  218. /package/{cjs → dist/cjs/main}/app/ticker.d.ts +0 -0
  219. /package/{cjs → dist/cjs/main}/modules/axiosSpy.d.ts +0 -0
  220. /package/{cjs → dist/cjs/main}/modules/connection.d.ts +0 -0
  221. /package/{cjs → dist/cjs/main}/modules/console.d.ts +0 -0
  222. /package/{cjs → dist/cjs/main}/modules/constructedStyleSheets.d.ts +0 -0
  223. /package/{cjs → dist/cjs/main}/modules/cssrules.d.ts +0 -0
  224. /package/{cjs → dist/cjs/main}/modules/exception.d.ts +0 -0
  225. /package/{cjs → dist/cjs/main}/modules/featureFlags.d.ts +0 -0
  226. /package/{cjs → dist/cjs/main}/modules/focus.d.ts +0 -0
  227. /package/{cjs → dist/cjs/main}/modules/fonts.d.ts +0 -0
  228. /package/{cjs → dist/cjs/main}/modules/img.d.ts +0 -0
  229. /package/{cjs → dist/cjs/main}/modules/input.d.ts +0 -0
  230. /package/{cjs → dist/cjs/main}/modules/mouse.d.ts +0 -0
  231. /package/{cjs → dist/cjs/main}/modules/network.d.ts +0 -0
  232. /package/{cjs → dist/cjs/main}/modules/performance.d.ts +0 -0
  233. /package/{cjs → dist/cjs/main}/modules/scroll.d.ts +0 -0
  234. /package/{cjs → dist/cjs/main}/modules/selection.d.ts +0 -0
  235. /package/{cjs → dist/cjs/main}/modules/tabs.d.ts +0 -0
  236. /package/{cjs → dist/cjs/main}/modules/timing.d.ts +0 -0
  237. /package/{cjs → dist/cjs/main}/modules/userTesting/dnd.d.ts +0 -0
  238. /package/{cjs → dist/cjs/main}/modules/userTesting/index.d.ts +0 -0
  239. /package/{cjs → dist/cjs/main}/modules/userTesting/recorder.d.ts +0 -0
  240. /package/{cjs → dist/cjs/main}/modules/userTesting/styles.d.ts +0 -0
  241. /package/{cjs → dist/cjs/main}/modules/userTesting/utils.d.ts +0 -0
  242. /package/{cjs → dist/cjs/main}/modules/viewport.d.ts +0 -0
  243. /package/{lib → dist/lib}/common/interaction.d.ts +0 -0
  244. /package/{lib → dist/lib}/common/messages.gen.d.ts +0 -0
  245. /package/{lib → dist/lib/main}/app/canvas.d.ts +0 -0
  246. /package/{lib → dist/lib/main}/app/guards.d.ts +0 -0
  247. /package/{lib → dist/lib/main}/app/logger.d.ts +0 -0
  248. /package/{lib → dist/lib/main}/app/observer/shadow_root_observer.d.ts +0 -0
  249. /package/{lib → dist/lib/main}/app/ticker.d.ts +0 -0
  250. /package/{lib → dist/lib/main}/modules/axiosSpy.d.ts +0 -0
  251. /package/{lib → dist/lib/main}/modules/connection.d.ts +0 -0
  252. /package/{lib → dist/lib/main}/modules/console.d.ts +0 -0
  253. /package/{lib → dist/lib/main}/modules/constructedStyleSheets.d.ts +0 -0
  254. /package/{lib → dist/lib/main}/modules/cssrules.d.ts +0 -0
  255. /package/{lib → dist/lib/main}/modules/exception.d.ts +0 -0
  256. /package/{lib → dist/lib/main}/modules/featureFlags.d.ts +0 -0
  257. /package/{lib → dist/lib/main}/modules/focus.d.ts +0 -0
  258. /package/{lib → dist/lib/main}/modules/fonts.d.ts +0 -0
  259. /package/{lib → dist/lib/main}/modules/img.d.ts +0 -0
  260. /package/{lib → dist/lib/main}/modules/input.d.ts +0 -0
  261. /package/{lib → dist/lib/main}/modules/mouse.d.ts +0 -0
  262. /package/{lib → dist/lib/main}/modules/network.d.ts +0 -0
  263. /package/{lib → dist/lib/main}/modules/performance.d.ts +0 -0
  264. /package/{lib → dist/lib/main}/modules/scroll.d.ts +0 -0
  265. /package/{lib → dist/lib/main}/modules/selection.d.ts +0 -0
  266. /package/{lib → dist/lib/main}/modules/tabs.d.ts +0 -0
  267. /package/{lib → dist/lib/main}/modules/timing.d.ts +0 -0
  268. /package/{lib → dist/lib/main}/modules/userTesting/dnd.d.ts +0 -0
  269. /package/{lib → dist/lib/main}/modules/userTesting/index.d.ts +0 -0
  270. /package/{lib → dist/lib/main}/modules/userTesting/recorder.d.ts +0 -0
  271. /package/{lib → dist/lib/main}/modules/userTesting/styles.d.ts +0 -0
  272. /package/{lib → dist/lib/main}/modules/userTesting/utils.d.ts +0 -0
  273. /package/{lib → dist/lib/main}/modules/viewport.d.ts +0 -0
@@ -1,464 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- const styles = __importStar(require("./styles.js"));
30
- const recorder_js_1 = __importStar(require("./recorder.js"));
31
- const dnd_js_1 = __importDefault(require("./dnd.js"));
32
- const utils_js_1 = require("./utils.js");
33
- const SignalManager_js_1 = __importDefault(require("./SignalManager.js"));
34
- class UserTestManager {
35
- constructor(app, storageKey) {
36
- this.app = app;
37
- this.storageKey = storageKey;
38
- this.bg = (0, utils_js_1.createElement)('div', 'bg', styles.bgStyle, undefined, '__or_ut_bg');
39
- this.container = (0, utils_js_1.createElement)('div', 'container', styles.containerStyle, undefined, '__or_ut_ct');
40
- this.widgetGuidelinesVisible = true;
41
- this.widgetTasksVisible = false;
42
- this.widgetVisible = true;
43
- this.isActive = false;
44
- this.descriptionSection = null;
45
- this.taskSection = null;
46
- this.endSection = null;
47
- this.stopButton = null;
48
- this.stopButtonContainer = null;
49
- this.test = null;
50
- this.testId = null;
51
- this.signalManager = null;
52
- this.getTest = (id, token, inProgress) => {
53
- this.testId = id;
54
- const ingest = this.app.options.ingestPoint;
55
- return fetch(`${ingest}/v1/web/uxt/test/${id}`, {
56
- headers: {
57
- Authorization: `Bearer ${token}`,
58
- },
59
- })
60
- .then((res) => res.json())
61
- .then(({ test }) => {
62
- this.isActive = true;
63
- this.test = test;
64
- this.signalManager = new SignalManager_js_1.default(this.app.options.ingestPoint, () => this.app.timestamp(), token, id, this.storageKey, (k, v) => this.app.localStorage.setItem(k, v), (k) => this.app.localStorage.removeItem(k), (k) => this.app.localStorage.getItem(k), () => this.app.getSessionID());
65
- this.createGreeting(test.title, test.reqMic, test.reqCamera);
66
- if (inProgress) {
67
- if (test.reqMic || test.reqCamera) {
68
- void this.userRecorder.startRecording(30, recorder_js_1.Quality.Standard, test.reqMic, test.reqCamera);
69
- }
70
- this.showWidget(test.description, test.tasks, true);
71
- this.showTaskSection();
72
- }
73
- })
74
- .then(() => id)
75
- .catch((err) => {
76
- console.log('OR: Error fetching test', err);
77
- });
78
- };
79
- this.hideTaskSection = () => false;
80
- this.showTaskSection = () => true;
81
- this.collapseWidget = () => false;
82
- this.removeGreeting = () => false;
83
- // eslint-disable-next-line @typescript-eslint/no-empty-function
84
- this.toggleDescriptionVisibility = () => { };
85
- this.currentTaskIndex = 0;
86
- this.userRecorder = new recorder_js_1.default(app);
87
- const sessionId = this.app.getSessionID();
88
- const savedSessionId = this.app.localStorage.getItem(utils_js_1.SESSION_ID);
89
- if (sessionId !== savedSessionId) {
90
- this.app.localStorage.removeItem(this.storageKey);
91
- this.app.localStorage.removeItem(utils_js_1.SESSION_ID);
92
- this.app.localStorage.removeItem(utils_js_1.TEST_ID);
93
- this.app.localStorage.removeItem(utils_js_1.TASK_IND);
94
- this.app.localStorage.removeItem(utils_js_1.TEST_START);
95
- }
96
- const taskIndex = this.app.localStorage.getItem(utils_js_1.TASK_IND);
97
- if (taskIndex) {
98
- this.currentTaskIndex = parseInt(taskIndex, 10);
99
- }
100
- }
101
- getTestId() {
102
- return this.testId;
103
- }
104
- createGreeting(title, micRequired, cameraRequired) {
105
- const titleElement = (0, utils_js_1.createElement)('div', 'title', styles.titleStyle, title);
106
- const descriptionElement = (0, utils_js_1.createElement)('div', 'description', styles.descriptionStyle, `Welcome, you're here to help us improve, not to be judged. Your insights matter!\n
107
- 📹 We're recording this browser tab to learn from your experience.
108
- 🎤 Please enable mic and camera if asked, to give us a complete picture.`);
109
- const buttonElement = (0, utils_js_1.createElement)('div', 'button', styles.buttonStyle, 'Read guidelines to begin');
110
- this.removeGreeting = () => {
111
- // this.container.innerHTML = ''
112
- if (micRequired || cameraRequired) {
113
- void this.userRecorder.startRecording(30, recorder_js_1.Quality.Standard, micRequired, cameraRequired);
114
- }
115
- this.container.removeChild(buttonElement);
116
- this.container.removeChild(descriptionElement);
117
- this.container.removeChild(titleElement);
118
- return false;
119
- };
120
- buttonElement.onclick = () => {
121
- this.removeGreeting();
122
- const durations = this.signalManager?.getDurations();
123
- if (durations && this.signalManager) {
124
- durations.testStart = this.app.timestamp();
125
- this.signalManager.setDurations(durations);
126
- }
127
- void this.signalManager?.signalTest('begin');
128
- this.container.style.fontFamily = `-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"`;
129
- Object.assign(this.container.style, styles.containerWidgetStyle);
130
- this.showWidget(this.test?.guidelines || '', this.test?.tasks || []);
131
- };
132
- this.container.append(titleElement, descriptionElement, buttonElement);
133
- this.bg.appendChild(this.container);
134
- document.body.appendChild(this.bg);
135
- }
136
- showWidget(guidelines, tasks, inProgress) {
137
- this.container.innerHTML = '';
138
- Object.assign(this.bg.style, {
139
- position: 'fixed',
140
- zIndex: 99999999999999,
141
- right: '8px',
142
- left: 'unset',
143
- width: 'fit-content',
144
- top: '8px',
145
- height: 'fit-content',
146
- background: 'unset',
147
- display: 'unset',
148
- alignItems: 'unset',
149
- justifyContent: 'unset',
150
- });
151
- // Create title section
152
- const titleSection = this.createTitleSection();
153
- this.container.style.fontFamily = `-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"`;
154
- Object.assign(this.container.style, styles.containerWidgetStyle);
155
- const descriptionSection = this.createDescriptionSection(guidelines);
156
- const tasksSection = this.createTasksSection(tasks);
157
- const stopButton = (0, utils_js_1.createElement)('div', 'stop_bn_or', styles.stopWidgetStyle, 'Abort Session');
158
- const stopContainer = (0, utils_js_1.createElement)('div', 'stop_ct_or', { fontSize: '13px!important' });
159
- stopContainer.style.fontSize = '13px';
160
- stopContainer.append(stopButton);
161
- this.container.append(titleSection, descriptionSection, tasksSection, stopContainer);
162
- this.taskSection = tasksSection;
163
- this.descriptionSection = descriptionSection;
164
- this.stopButton = stopButton;
165
- this.stopButtonContainer = stopContainer;
166
- stopButton.onclick = () => {
167
- this.userRecorder.discard();
168
- void this.signalManager?.signalTest('skipped');
169
- document.body.removeChild(this.bg);
170
- window.close();
171
- };
172
- if (!inProgress) {
173
- this.hideTaskSection();
174
- }
175
- else {
176
- this.toggleDescriptionVisibility();
177
- }
178
- }
179
- createTitleSection() {
180
- const title = (0, utils_js_1.createElement)('div', 'title', styles.titleWidgetStyle);
181
- const leftIcon = (0, utils_js_1.generateGrid)();
182
- const titleText = (0, utils_js_1.createElement)('div', 'title_text', {
183
- maxWidth: '19rem',
184
- overflow: 'hidden',
185
- textOverflow: 'ellipsis',
186
- width: '100%',
187
- fontSize: 16,
188
- lineHeight: 'auto',
189
- cursor: 'pointer',
190
- }, this.test?.title);
191
- const rightIcon = (0, utils_js_1.generateChevron)();
192
- title.append(leftIcon, titleText, rightIcon);
193
- const toggleWidget = (isVisible) => {
194
- this.widgetVisible = isVisible;
195
- this.container.style.fontFamily = `-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"`;
196
- Object.assign(this.container.style, this.widgetVisible
197
- ? styles.containerWidgetStyle
198
- : { border: 'none', background: 'none', padding: 0 });
199
- if (this.taskSection) {
200
- Object.assign(this.taskSection.style, this.widgetVisible ? styles.descriptionWidgetStyle : { display: 'none' });
201
- }
202
- if (this.descriptionSection) {
203
- Object.assign(this.descriptionSection.style, this.widgetVisible ? styles.descriptionWidgetStyle : { display: 'none' });
204
- }
205
- if (this.endSection) {
206
- Object.assign(this.endSection.style, this.widgetVisible ? styles.descriptionWidgetStyle : { display: 'none' });
207
- }
208
- if (this.stopButton) {
209
- Object.assign(this.stopButton.style, this.widgetVisible ? styles.stopWidgetStyle : { display: 'none' });
210
- }
211
- return isVisible;
212
- };
213
- const collapseWidget = () => {
214
- Object.assign(rightIcon.style, {
215
- transform: this.widgetVisible ? 'rotate(0deg)' : 'rotate(180deg)',
216
- });
217
- toggleWidget(!this.widgetVisible);
218
- };
219
- titleText.onclick = collapseWidget;
220
- rightIcon.onclick = collapseWidget;
221
- (0, dnd_js_1.default)(this.bg, leftIcon);
222
- this.collapseWidget = () => toggleWidget(false);
223
- return title;
224
- }
225
- createDescriptionSection(guidelines) {
226
- const section = (0, utils_js_1.createElement)('div', 'description_section_or', styles.descriptionWidgetStyle);
227
- const titleContainer = (0, utils_js_1.createElement)('div', 'description_s_title_or', styles.sectionTitleStyle);
228
- const title = (0, utils_js_1.createElement)('div', 'title', {
229
- fontSize: 13,
230
- fontWeight: 500,
231
- lineHeight: 'auto',
232
- }, 'Introduction & Guidelines');
233
- const icon = (0, utils_js_1.createElement)('div', 'icon', styles.symbolIcon, '-');
234
- const content = (0, utils_js_1.createElement)('div', 'content', styles.contentStyle);
235
- const descriptionC = (0, utils_js_1.createElement)('div', 'text_description', {
236
- maxHeight: '250px',
237
- overflowY: 'auto',
238
- whiteSpace: 'pre-wrap',
239
- fontSize: 13,
240
- color: '#454545',
241
- lineHeight: 'auto',
242
- });
243
- descriptionC.innerHTML = guidelines;
244
- const button = (0, utils_js_1.createElement)('div', 'button_begin_or', styles.buttonWidgetStyle, 'Begin Test');
245
- titleContainer.append(title, icon);
246
- content.append(descriptionC, button);
247
- section.append(titleContainer, content);
248
- const toggleDescriptionVisibility = () => {
249
- this.widgetGuidelinesVisible = !this.widgetGuidelinesVisible;
250
- icon.textContent = this.widgetGuidelinesVisible ? '-' : '+';
251
- Object.assign(content.style, this.widgetGuidelinesVisible ? styles.contentStyle : { display: 'none' });
252
- };
253
- titleContainer.onclick = toggleDescriptionVisibility;
254
- this.toggleDescriptionVisibility = () => {
255
- this.widgetGuidelinesVisible = false;
256
- icon.textContent = this.widgetGuidelinesVisible ? '-' : '+';
257
- Object.assign(content.style, this.widgetGuidelinesVisible ? styles.contentStyle : { display: 'none' });
258
- content.removeChild(button);
259
- };
260
- button.onclick = () => {
261
- toggleDescriptionVisibility();
262
- if (this.test) {
263
- const durations = this.signalManager?.getDurations();
264
- const taskDurationInd = durations
265
- ? durations.tasks.findIndex((t) => this.test && t.taskId === this.test.tasks[0].task_id)
266
- : null;
267
- if (durations && taskDurationInd === -1) {
268
- durations.tasks.push({
269
- taskId: this.test.tasks[0].task_id,
270
- started: this.app.timestamp(),
271
- });
272
- this.signalManager?.setDurations(durations);
273
- }
274
- void this.signalManager?.signalTask(this.test.tasks[0].task_id, 'begin');
275
- }
276
- this.showTaskSection();
277
- content.removeChild(button);
278
- };
279
- return section;
280
- }
281
- createTasksSection(tasks) {
282
- this.container.style.fontFamily = `-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"`;
283
- Object.assign(this.container.style, styles.containerWidgetStyle);
284
- const section = (0, utils_js_1.createElement)('div', 'task_section_or', styles.descriptionWidgetStyle);
285
- const titleContainer = (0, utils_js_1.createElement)('div', 'description_t_title_or', styles.sectionTitleStyle);
286
- const title = (0, utils_js_1.createElement)('div', 'title', {
287
- fontSize: '13px',
288
- fontWeight: '500',
289
- lineHeight: 'auto',
290
- }, 'Tasks');
291
- const icon = (0, utils_js_1.createElement)('div', 'icon', styles.symbolIcon, '-');
292
- const content = (0, utils_js_1.createElement)('div', 'content', styles.contentStyle);
293
- const pagination = (0, utils_js_1.createElement)('div', 'pagination', styles.paginationStyle);
294
- // const leftArrow = createElement('span', 'leftArrow', {}, '<')
295
- // const rightArrow = createElement('span', 'rightArrow', {}, '>')
296
- const taskCard = (0, utils_js_1.createElement)('div', 'taskCard', styles.taskDescriptionCard);
297
- const taskText = (0, utils_js_1.createElement)('div', 'taskText', styles.taskTextStyle);
298
- const taskDescription = (0, utils_js_1.createElement)('div', 'taskDescription', styles.taskDescriptionStyle);
299
- const taskButtons = (0, utils_js_1.createElement)('div', 'taskButtons', styles.taskButtonsRow);
300
- const inputTitle = (0, utils_js_1.createElement)('div', 'taskText', styles.taskTextStyle);
301
- inputTitle.textContent = 'Your answer';
302
- const inputArea = (0, utils_js_1.createElement)('textarea', 'taskDescription', {
303
- resize: 'vertical',
304
- });
305
- const inputContainer = (0, utils_js_1.createElement)('div', 'inputArea', styles.taskDescriptionCard);
306
- inputContainer.append(inputTitle, inputArea);
307
- const closePanelButton = (0, utils_js_1.createElement)('div', 'closePanelButton', styles.taskButtonStyle, 'Collapse Panel');
308
- const nextButton = (0, utils_js_1.createElement)('div', 'nextButton', styles.taskButtonBorderedStyle, 'Done, Next');
309
- titleContainer.append(title, icon);
310
- taskCard.append(taskText, taskDescription);
311
- taskButtons.append(closePanelButton, nextButton);
312
- content.append(pagination, taskCard, inputContainer, taskButtons);
313
- section.append(titleContainer, content);
314
- const updateTaskContent = () => {
315
- const task = tasks[this.currentTaskIndex];
316
- taskText.textContent = task.title;
317
- taskDescription.textContent = task.description;
318
- if (task.allow_typing) {
319
- inputContainer.style.display = 'flex';
320
- }
321
- else {
322
- inputContainer.style.display = 'none';
323
- }
324
- };
325
- // pagination.appendChild(leftArrow)
326
- tasks.forEach((_, index) => {
327
- const pageNumber = (0, utils_js_1.createElement)('span', `or_task_${index}`, {
328
- outline: '1px solid #efefef',
329
- fontSize: '13px',
330
- height: '24px',
331
- width: '24px',
332
- display: 'flex',
333
- flexDirection: 'column',
334
- alignItems: 'center',
335
- justifyContent: 'center',
336
- borderRadius: '6.25em',
337
- }, (index + 1).toString());
338
- pageNumber.id = `or_task_${index}`;
339
- pagination.append(pageNumber);
340
- });
341
- // pagination.appendChild(rightArrow)
342
- const toggleTasksVisibility = () => {
343
- this.widgetTasksVisible = !this.widgetTasksVisible;
344
- icon.textContent = this.widgetTasksVisible ? '-' : '+';
345
- Object.assign(content.style, this.widgetTasksVisible ? styles.contentStyle : { display: 'none' });
346
- };
347
- this.hideTaskSection = () => {
348
- icon.textContent = '+';
349
- Object.assign(content.style, {
350
- display: 'none',
351
- });
352
- this.widgetTasksVisible = false;
353
- return false;
354
- };
355
- this.showTaskSection = () => {
356
- icon.textContent = '-';
357
- Object.assign(content.style, styles.contentStyle);
358
- this.widgetTasksVisible = true;
359
- return true;
360
- };
361
- const highlightActive = () => {
362
- const activeTaskEl = document.getElementById(`or_task_${this.currentTaskIndex}`);
363
- if (activeTaskEl) {
364
- Object.assign(activeTaskEl.style, styles.taskNumberActive);
365
- }
366
- for (let i = 0; i < this.currentTaskIndex; i++) {
367
- const taskEl = document.getElementById(`or_task_${i}`);
368
- if (taskEl) {
369
- Object.assign(taskEl.style, styles.taskNumberDone);
370
- }
371
- }
372
- };
373
- titleContainer.onclick = toggleTasksVisibility;
374
- closePanelButton.onclick = this.collapseWidget;
375
- nextButton.onclick = () => {
376
- const textAnswer = tasks[this.currentTaskIndex].allow_typing ? inputArea.value : undefined;
377
- inputArea.value = '';
378
- void this.signalManager?.signalTask(tasks[this.currentTaskIndex].task_id, 'done', textAnswer);
379
- if (this.currentTaskIndex < tasks.length - 1) {
380
- this.currentTaskIndex++;
381
- updateTaskContent();
382
- const durations = this.signalManager?.getDurations();
383
- if (durations &&
384
- durations.tasks.findIndex((t) => t.taskId === tasks[this.currentTaskIndex].task_id) === -1) {
385
- durations.tasks.push({
386
- taskId: tasks[this.currentTaskIndex].task_id,
387
- started: this.app.timestamp(),
388
- });
389
- this.signalManager?.setDurations(durations);
390
- }
391
- void this.signalManager?.signalTask(tasks[this.currentTaskIndex].task_id, 'begin');
392
- highlightActive();
393
- }
394
- else {
395
- this.showEndSection();
396
- }
397
- this.app.localStorage.setItem('or_uxt_task_index', this.currentTaskIndex.toString());
398
- };
399
- setTimeout(() => {
400
- const firstTaskEl = document.getElementById('or_task_0');
401
- if (firstTaskEl) {
402
- Object.assign(firstTaskEl.style, styles.taskNumberActive);
403
- }
404
- updateTaskContent();
405
- highlightActive();
406
- }, 1);
407
- return section;
408
- }
409
- showEndSection() {
410
- let isLoading = true;
411
- void this.signalManager?.signalTest('done');
412
- const section = (0, utils_js_1.createElement)('div', 'end_section_or', styles.endSectionStyle);
413
- const title = (0, utils_js_1.createElement)('div', 'end_title_or', {
414
- fontSize: '1.25rem',
415
- fontWeight: '500',
416
- }, 'Thank you! 👍');
417
- const description = (0, utils_js_1.createElement)('div', 'end_description_or', {}, this.test?.conclusion ??
418
- 'Thank you for participating in our usability test. Your feedback has been captured and will be used to enhance our website. \n' +
419
- '\n' +
420
- 'We appreciate your time and valuable input.');
421
- const button = (0, utils_js_1.createElement)('div', 'end_button_or', styles.buttonWidgetStyle, 'Submitting Feedback');
422
- const spinner = (0, utils_js_1.createSpinner)();
423
- button.appendChild(spinner);
424
- if (this.test?.reqMic || this.test?.reqCamera) {
425
- void this.userRecorder
426
- .sendToAPI()
427
- .then(() => {
428
- button.removeChild(spinner);
429
- button.textContent = 'End Session';
430
- isLoading = false;
431
- })
432
- .catch((err) => {
433
- console.error(err);
434
- button.removeChild(spinner);
435
- button.textContent = 'End Session';
436
- isLoading = false;
437
- });
438
- }
439
- else {
440
- button.removeChild(spinner);
441
- button.textContent = 'End Session';
442
- isLoading = false;
443
- }
444
- if (this.taskSection) {
445
- this.container.removeChild(this.taskSection);
446
- }
447
- if (this.descriptionSection) {
448
- this.container.removeChild(this.descriptionSection);
449
- }
450
- if (this.stopButton && this.stopButtonContainer) {
451
- this.container.removeChild(this.stopButtonContainer);
452
- }
453
- button.onclick = () => {
454
- if (isLoading)
455
- return;
456
- window.close();
457
- document.body.removeChild(this.bg);
458
- };
459
- section.append(title, description, button);
460
- this.endSection = section;
461
- this.container.append(section);
462
- }
463
- }
464
- exports.default = UserTestManager;
@@ -1,101 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Quality = void 0;
4
- exports.Quality = {
5
- Standard: { width: 1280, height: 720 },
6
- High: { width: 1920, height: 1080 },
7
- };
8
- class Recorder {
9
- constructor(app) {
10
- this.app = app;
11
- this.mediaRecorder = null;
12
- this.recordedChunks = [];
13
- this.stream = null;
14
- this.recStartTs = null;
15
- }
16
- async startRecording(fps, quality, micReq, camReq) {
17
- this.recStartTs = this.app.timestamp();
18
- const videoConstraints = quality;
19
- try {
20
- this.stream = await navigator.mediaDevices.getUserMedia({
21
- video: camReq ? { ...videoConstraints, frameRate: { ideal: fps } } : false,
22
- audio: micReq,
23
- });
24
- this.mediaRecorder = new MediaRecorder(this.stream, {
25
- mimeType: 'video/webm;codecs=vp9',
26
- });
27
- this.recordedChunks = [];
28
- this.mediaRecorder.ondataavailable = (event) => {
29
- if (event.data.size > 0) {
30
- this.recordedChunks.push(event.data);
31
- }
32
- };
33
- this.mediaRecorder.start();
34
- }
35
- catch (error) {
36
- console.error(error);
37
- }
38
- }
39
- async stopRecording() {
40
- return new Promise((resolve) => {
41
- if (!this.mediaRecorder)
42
- return;
43
- this.mediaRecorder.onstop = () => {
44
- const blob = new Blob(this.recordedChunks, {
45
- type: 'video/webm',
46
- });
47
- resolve(blob);
48
- };
49
- this.mediaRecorder.stop();
50
- });
51
- }
52
- async sendToAPI() {
53
- const blob = await this.stopRecording();
54
- // const formData = new FormData()
55
- // formData.append('file', blob, 'record.webm')
56
- // formData.append('start', this.recStartTs?.toString() ?? '')
57
- return fetch(`${this.app.options.ingestPoint}/v1/web/uxt/upload-url`, {
58
- headers: {
59
- Authorization: `Bearer ${this.app.session.getSessionToken()}`,
60
- },
61
- })
62
- .then((r) => {
63
- if (r.ok) {
64
- return r.json();
65
- }
66
- else {
67
- throw new Error('Failed to get upload url');
68
- }
69
- })
70
- .then(({ url }) => {
71
- return fetch(url, {
72
- method: 'PUT',
73
- headers: {
74
- 'Content-Type': 'video/webm',
75
- },
76
- body: blob,
77
- });
78
- })
79
- .catch(console.error)
80
- .finally(() => {
81
- this.discard();
82
- });
83
- }
84
- async saveToFile(fileName = 'recorded-video.webm') {
85
- const blob = await this.stopRecording();
86
- const url = URL.createObjectURL(blob);
87
- const a = document.createElement('a');
88
- a.style.display = 'none';
89
- a.href = url;
90
- a.download = fileName;
91
- document.body.appendChild(a);
92
- a.click();
93
- window.URL.revokeObjectURL(url);
94
- document.body.removeChild(a);
95
- }
96
- discard() {
97
- this.mediaRecorder?.stop();
98
- this.stream?.getTracks().forEach((track) => track.stop());
99
- }
100
- }
101
- exports.default = Recorder;