@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.
- package/{cjs → dist/cjs}/index.js +27 -49
- package/dist/cjs/index.js.map +1 -0
- package/{cjs → dist/cjs/main}/app/index.d.ts +38 -6
- package/{lib → dist/cjs/main}/app/messages.gen.d.ts +2 -2
- package/{lib/app/nodes.d.ts → dist/cjs/main/app/nodes/index.d.ts} +15 -7
- package/dist/cjs/main/app/nodes/maintainer.d.ts +28 -0
- package/{cjs → dist/cjs/main}/app/observer/iframe_observer.d.ts +1 -1
- package/{lib → dist/cjs/main}/app/observer/iframe_offsets.d.ts +1 -1
- package/{lib → dist/cjs/main}/app/observer/observer.d.ts +6 -0
- package/{lib → dist/cjs/main}/app/observer/top_observer.d.ts +6 -2
- package/{cjs → dist/cjs/main}/app/sanitizer.d.ts +5 -2
- package/{cjs → dist/cjs/main}/app/session.d.ts +6 -3
- package/{lib → dist/cjs/main}/index.d.ts +2 -2
- package/{lib → dist/cjs/main}/modules/attributeSender.d.ts +5 -2
- package/{cjs → dist/cjs/main}/modules/conditionsManager.d.ts +1 -1
- package/{cjs → dist/cjs/main}/modules/tagWatcher.d.ts +8 -4
- package/{lib → dist/cjs/main}/modules/userTesting/SignalManager.d.ts +2 -2
- package/{lib → dist/cjs/main}/utils.d.ts +4 -3
- package/dist/lib/index.js +9323 -0
- package/dist/lib/index.js.map +1 -0
- package/{lib → dist/lib/main}/app/index.d.ts +38 -6
- package/{cjs → dist/lib/main}/app/messages.gen.d.ts +2 -2
- package/{cjs/app/nodes.d.ts → dist/lib/main/app/nodes/index.d.ts} +15 -7
- package/dist/lib/main/app/nodes/maintainer.d.ts +28 -0
- package/{lib → dist/lib/main}/app/observer/iframe_observer.d.ts +1 -1
- package/{cjs → dist/lib/main}/app/observer/iframe_offsets.d.ts +1 -1
- package/{cjs → dist/lib/main}/app/observer/observer.d.ts +6 -0
- package/{cjs → dist/lib/main}/app/observer/top_observer.d.ts +6 -2
- package/{lib → dist/lib/main}/app/sanitizer.d.ts +5 -2
- package/{lib → dist/lib/main}/app/session.d.ts +6 -3
- package/{cjs → dist/lib/main}/index.d.ts +2 -2
- package/{cjs → dist/lib/main}/modules/attributeSender.d.ts +5 -2
- package/{lib → dist/lib/main}/modules/conditionsManager.d.ts +1 -1
- package/{lib → dist/lib/main}/modules/tagWatcher.d.ts +8 -4
- package/{cjs → dist/lib/main}/modules/userTesting/SignalManager.d.ts +2 -2
- package/{cjs → dist/lib/main}/utils.d.ts +4 -3
- package/package.json +29 -10
- package/.eslintignore +0 -11
- package/.nvmrc +0 -1
- package/.prettierignore +0 -1
- package/CHANGELOG.md +0 -297
- package/bun.lockb +0 -0
- package/cjs/app/canvas.js +0 -204
- package/cjs/app/guards.js +0 -37
- package/cjs/app/index.js +0 -1366
- package/cjs/app/logger.js +0 -37
- package/cjs/app/messages.gen.js +0 -702
- package/cjs/app/nodes.js +0 -110
- package/cjs/app/observer/iframe_observer.js +0 -35
- package/cjs/app/observer/iframe_offsets.js +0 -56
- package/cjs/app/observer/observer.js +0 -352
- package/cjs/app/observer/shadow_root_observer.js +0 -24
- package/cjs/app/observer/top_observer.js +0 -134
- package/cjs/app/sanitizer.js +0 -82
- package/cjs/app/session.js +0 -140
- package/cjs/app/ticker.js +0 -48
- package/cjs/common/interaction.js +0 -2
- package/cjs/common/messages.gen.js +0 -4
- package/cjs/modules/attributeSender.js +0 -51
- package/cjs/modules/axiosSpy.js +0 -122
- package/cjs/modules/conditionsManager.js +0 -343
- package/cjs/modules/connection.js +0 -15
- package/cjs/modules/console.js +0 -127
- package/cjs/modules/constructedStyleSheets.js +0 -138
- package/cjs/modules/cssrules.js +0 -99
- package/cjs/modules/exception.js +0 -85
- package/cjs/modules/featureFlags.js +0 -89
- package/cjs/modules/focus.js +0 -45
- package/cjs/modules/fonts.js +0 -57
- package/cjs/modules/img.js +0 -110
- package/cjs/modules/input.js +0 -203
- package/cjs/modules/mouse.js +0 -195
- package/cjs/modules/network.js +0 -244
- package/cjs/modules/performance.js +0 -53
- package/cjs/modules/scroll.js +0 -84
- package/cjs/modules/selection.js +0 -37
- package/cjs/modules/tabs.js +0 -13
- package/cjs/modules/tagWatcher.js +0 -76
- package/cjs/modules/timing.js +0 -173
- package/cjs/modules/userTesting/SignalManager.js +0 -83
- package/cjs/modules/userTesting/dnd.js +0 -40
- package/cjs/modules/userTesting/index.js +0 -464
- package/cjs/modules/userTesting/recorder.js +0 -101
- package/cjs/modules/userTesting/styles.js +0 -266
- package/cjs/modules/userTesting/utils.js +0 -87
- package/cjs/modules/viewport.js +0 -43
- package/cjs/package.json +0 -1
- package/cjs/utils.js +0 -230
- package/coverage/clover.xml +0 -4304
- package/coverage/coverage-final.json +0 -55
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -206
- package/coverage/lcov-report/main/app/canvas.ts.html +0 -712
- package/coverage/lcov-report/main/app/guards.ts.html +0 -232
- package/coverage/lcov-report/main/app/index.html +0 -236
- package/coverage/lcov-report/main/app/index.ts.html +0 -3955
- package/coverage/lcov-report/main/app/logger.ts.html +0 -211
- package/coverage/lcov-report/main/app/messages.gen.ts.html +0 -3034
- package/coverage/lcov-report/main/app/nodes.ts.html +0 -406
- package/coverage/lcov-report/main/app/observer/iframe_observer.ts.html +0 -148
- package/coverage/lcov-report/main/app/observer/iframe_offsets.ts.html +0 -289
- package/coverage/lcov-report/main/app/observer/index.html +0 -161
- package/coverage/lcov-report/main/app/observer/shadow_root_observer.ts.html +0 -142
- package/coverage/lcov-report/main/app/observer/top_observer.ts.html +0 -541
- package/coverage/lcov-report/main/app/sanitizer.ts.html +0 -403
- package/coverage/lcov-report/main/app/session.ts.html +0 -622
- package/coverage/lcov-report/main/app/ticker.ts.html +0 -250
- package/coverage/lcov-report/main/index.html +0 -131
- package/coverage/lcov-report/main/index.ts.html +0 -1597
- package/coverage/lcov-report/main/modules/Network/beaconProxy.ts.html +0 -400
- package/coverage/lcov-report/main/modules/Network/fetchProxy.ts.html +0 -1075
- package/coverage/lcov-report/main/modules/Network/index.html +0 -191
- package/coverage/lcov-report/main/modules/Network/index.ts.html +0 -244
- package/coverage/lcov-report/main/modules/Network/networkMessage.ts.html +0 -400
- package/coverage/lcov-report/main/modules/Network/utils.ts.html +0 -709
- package/coverage/lcov-report/main/modules/Network/xhrProxy.ts.html +0 -877
- package/coverage/lcov-report/main/modules/attributeSender.ts.html +0 -241
- package/coverage/lcov-report/main/modules/axiosSpy.ts.html +0 -709
- package/coverage/lcov-report/main/modules/conditionsManager.ts.html +0 -1381
- package/coverage/lcov-report/main/modules/connection.ts.html +0 -160
- package/coverage/lcov-report/main/modules/console.ts.html +0 -541
- package/coverage/lcov-report/main/modules/constructedStyleSheets.ts.html +0 -571
- package/coverage/lcov-report/main/modules/cssrules.ts.html +0 -418
- package/coverage/lcov-report/main/modules/exception.ts.html +0 -385
- package/coverage/lcov-report/main/modules/featureFlags.ts.html +0 -415
- package/coverage/lcov-report/main/modules/focus.ts.html +0 -220
- package/coverage/lcov-report/main/modules/fonts.ts.html +0 -289
- package/coverage/lcov-report/main/modules/img.ts.html +0 -436
- package/coverage/lcov-report/main/modules/index.html +0 -431
- package/coverage/lcov-report/main/modules/input.ts.html +0 -826
- package/coverage/lcov-report/main/modules/mouse.ts.html +0 -826
- package/coverage/lcov-report/main/modules/network.ts.html +0 -1123
- package/coverage/lcov-report/main/modules/performance.ts.html +0 -367
- package/coverage/lcov-report/main/modules/scroll.ts.html +0 -364
- package/coverage/lcov-report/main/modules/selection.ts.html +0 -202
- package/coverage/lcov-report/main/modules/tabs.ts.html +0 -124
- package/coverage/lcov-report/main/modules/tagWatcher.ts.html +0 -337
- package/coverage/lcov-report/main/modules/timing.ts.html +0 -877
- package/coverage/lcov-report/main/modules/userTesting/SignalManager.ts.html +0 -370
- package/coverage/lcov-report/main/modules/userTesting/dnd.ts.html +0 -220
- package/coverage/lcov-report/main/modules/userTesting/index.html +0 -191
- package/coverage/lcov-report/main/modules/userTesting/index.ts.html +0 -1909
- package/coverage/lcov-report/main/modules/userTesting/recorder.ts.html +0 -430
- package/coverage/lcov-report/main/modules/userTesting/styles.ts.html +0 -937
- package/coverage/lcov-report/main/modules/userTesting/utils.ts.html +0 -364
- package/coverage/lcov-report/main/modules/viewport.ts.html +0 -250
- package/coverage/lcov-report/main/utils.ts.html +0 -814
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov-report/webworker/BatchWriter.ts.html +0 -499
- package/coverage/lcov-report/webworker/MessageEncoder.gen.ts.html +0 -1021
- package/coverage/lcov-report/webworker/PrimitiveEncoder.ts.html +0 -436
- package/coverage/lcov-report/webworker/QueueSender.ts.html +0 -547
- package/coverage/lcov-report/webworker/index.html +0 -176
- package/coverage/lcov-report/webworker/index.ts.html +0 -667
- package/coverage/lcov.info +0 -8425
- package/jest.config.js +0 -13
- package/lib/app/canvas.js +0 -202
- package/lib/app/guards.js +0 -26
- package/lib/app/index.js +0 -1336
- package/lib/app/logger.js +0 -33
- package/lib/app/messages.gen.js +0 -622
- package/lib/app/nodes.js +0 -107
- package/lib/app/observer/iframe_observer.js +0 -29
- package/lib/app/observer/iframe_offsets.js +0 -53
- package/lib/app/observer/observer.js +0 -349
- package/lib/app/observer/shadow_root_observer.js +0 -18
- package/lib/app/observer/top_observer.js +0 -128
- package/lib/app/sanitizer.js +0 -77
- package/lib/app/session.js +0 -137
- package/lib/app/ticker.js +0 -45
- package/lib/common/interaction.js +0 -1
- package/lib/common/messages.gen.js +0 -3
- package/lib/common/tsconfig.tsbuildinfo +0 -1
- package/lib/index.js +0 -423
- package/lib/modules/attributeSender.js +0 -46
- package/lib/modules/axiosSpy.js +0 -119
- package/lib/modules/conditionsManager.js +0 -340
- package/lib/modules/connection.js +0 -12
- package/lib/modules/console.js +0 -124
- package/lib/modules/constructedStyleSheets.js +0 -133
- package/lib/modules/cssrules.js +0 -97
- package/lib/modules/exception.js +0 -76
- package/lib/modules/featureFlags.js +0 -86
- package/lib/modules/focus.js +0 -42
- package/lib/modules/fonts.js +0 -54
- package/lib/modules/img.js +0 -107
- package/lib/modules/input.js +0 -198
- package/lib/modules/mouse.js +0 -192
- package/lib/modules/network.js +0 -238
- package/lib/modules/performance.js +0 -49
- package/lib/modules/scroll.js +0 -81
- package/lib/modules/selection.js +0 -35
- package/lib/modules/tabs.js +0 -10
- package/lib/modules/tagWatcher.js +0 -73
- package/lib/modules/timing.js +0 -170
- package/lib/modules/userTesting/SignalManager.js +0 -80
- package/lib/modules/userTesting/dnd.js +0 -37
- package/lib/modules/userTesting/index.js +0 -435
- package/lib/modules/userTesting/recorder.js +0 -97
- package/lib/modules/userTesting/styles.js +0 -263
- package/lib/modules/userTesting/utils.js +0 -79
- package/lib/modules/viewport.js +0 -40
- package/lib/utils.js +0 -211
- package/rollup.config.js +0 -12
- package/scripts/checkver.cjs +0 -7
- package/tsconfig-base.json +0 -16
- /package/{cjs → dist/cjs}/common/interaction.d.ts +0 -0
- /package/{cjs → dist/cjs}/common/messages.gen.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/app/canvas.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/app/guards.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/app/logger.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/app/observer/shadow_root_observer.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/app/ticker.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/axiosSpy.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/connection.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/console.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/constructedStyleSheets.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/cssrules.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/exception.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/featureFlags.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/focus.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/fonts.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/img.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/input.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/mouse.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/network.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/performance.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/scroll.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/selection.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/tabs.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/timing.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/userTesting/dnd.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/userTesting/index.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/userTesting/recorder.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/userTesting/styles.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/userTesting/utils.d.ts +0 -0
- /package/{cjs → dist/cjs/main}/modules/viewport.d.ts +0 -0
- /package/{lib → dist/lib}/common/interaction.d.ts +0 -0
- /package/{lib → dist/lib}/common/messages.gen.d.ts +0 -0
- /package/{lib → dist/lib/main}/app/canvas.d.ts +0 -0
- /package/{lib → dist/lib/main}/app/guards.d.ts +0 -0
- /package/{lib → dist/lib/main}/app/logger.d.ts +0 -0
- /package/{lib → dist/lib/main}/app/observer/shadow_root_observer.d.ts +0 -0
- /package/{lib → dist/lib/main}/app/ticker.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/axiosSpy.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/connection.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/console.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/constructedStyleSheets.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/cssrules.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/exception.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/featureFlags.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/focus.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/fonts.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/img.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/input.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/mouse.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/network.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/performance.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/scroll.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/selection.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/tabs.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/timing.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/userTesting/dnd.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/userTesting/index.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/userTesting/recorder.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/userTesting/styles.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/userTesting/utils.d.ts +0 -0
- /package/{lib → dist/lib/main}/modules/viewport.d.ts +0 -0
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.spinnerStyles = exports.taskButtonsRow = exports.taskButtonBorderedStyle = exports.taskButtonStyle = exports.taskDescriptionStyle = exports.taskTextStyle = exports.taskDescriptionCard = exports.taskNumberDone = exports.taskNumberActive = exports.paginationStyle = exports.stopWidgetStyle = exports.buttonWidgetStyle = exports.symbolIcon = exports.endSectionStyle = exports.descriptionWidgetStyle = exports.titleWidgetStyle = exports.contentStyle = exports.sectionTitleStyle = exports.buttonStyle = exports.noticeStyle = exports.descriptionStyle = exports.titleStyle = exports.containerWidgetStyle = exports.containerStyle = exports.bgStyle = void 0;
|
|
4
|
-
exports.bgStyle = {
|
|
5
|
-
position: 'fixed',
|
|
6
|
-
top: 0,
|
|
7
|
-
left: 0,
|
|
8
|
-
width: '100vw',
|
|
9
|
-
height: '100vh',
|
|
10
|
-
background: 'rgba(0, 0, 0, 0.40)',
|
|
11
|
-
display: 'flex',
|
|
12
|
-
alignItems: 'center',
|
|
13
|
-
justifyContent: 'center',
|
|
14
|
-
zIndex: 999999,
|
|
15
|
-
fontFamily: `-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"`,
|
|
16
|
-
};
|
|
17
|
-
exports.containerStyle = {
|
|
18
|
-
display: 'flex',
|
|
19
|
-
flexDirection: 'column',
|
|
20
|
-
gap: '2rem',
|
|
21
|
-
alignItems: 'center',
|
|
22
|
-
padding: '1.5rem',
|
|
23
|
-
borderRadius: '2px',
|
|
24
|
-
border: '1px solid #D9D9D9',
|
|
25
|
-
background: '#FFF',
|
|
26
|
-
width: '22rem',
|
|
27
|
-
};
|
|
28
|
-
exports.containerWidgetStyle = {
|
|
29
|
-
display: 'flex',
|
|
30
|
-
'flex-direction': 'column',
|
|
31
|
-
gap: 'unset',
|
|
32
|
-
'align-items': 'center',
|
|
33
|
-
padding: 'unset',
|
|
34
|
-
fontFamily: `-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"`,
|
|
35
|
-
'border-radius': '2px',
|
|
36
|
-
border: '1px solid #D9D9D9',
|
|
37
|
-
background: 'rgba(255, 255, 255, 0.75)',
|
|
38
|
-
width: '22rem',
|
|
39
|
-
};
|
|
40
|
-
exports.titleStyle = {
|
|
41
|
-
fontFamily: 'Verdana, sans-serif',
|
|
42
|
-
fontSize: '1.25rem',
|
|
43
|
-
fontStyle: 'normal',
|
|
44
|
-
fontWeight: '500',
|
|
45
|
-
lineHeight: '1.75rem',
|
|
46
|
-
color: 'rgba(0, 0, 0, 0.85)',
|
|
47
|
-
};
|
|
48
|
-
exports.descriptionStyle = {
|
|
49
|
-
borderTop: '1px solid rgba(0, 0, 0, 0.06)',
|
|
50
|
-
borderBottom: '1px solid rgba(0, 0, 0, 0.06)',
|
|
51
|
-
padding: '1.25rem 0rem',
|
|
52
|
-
color: 'rgba(0, 0, 0, 0.85)',
|
|
53
|
-
fontFamily: 'Verdana, sans-serif',
|
|
54
|
-
fontSize: '13px',
|
|
55
|
-
fontStyle: 'normal',
|
|
56
|
-
fontWeight: '400',
|
|
57
|
-
lineHeight: 'auto',
|
|
58
|
-
whiteSpace: 'pre-wrap',
|
|
59
|
-
};
|
|
60
|
-
exports.noticeStyle = {
|
|
61
|
-
color: 'rgba(0, 0, 0, 0.85)',
|
|
62
|
-
fontFamily: 'Verdana, sans-serif',
|
|
63
|
-
fontSize: '0.875rem',
|
|
64
|
-
fontStyle: 'normal',
|
|
65
|
-
fontWeight: '400',
|
|
66
|
-
lineHeight: '1.375rem',
|
|
67
|
-
};
|
|
68
|
-
exports.buttonStyle = {
|
|
69
|
-
display: 'flex',
|
|
70
|
-
padding: '0.4rem 0.9375rem',
|
|
71
|
-
justifyContent: 'center',
|
|
72
|
-
alignItems: 'center',
|
|
73
|
-
gap: '0.625rem',
|
|
74
|
-
borderRadius: '0.25rem',
|
|
75
|
-
border: '1px solid #394EFF',
|
|
76
|
-
background: '#394EFF',
|
|
77
|
-
boxShadow: '0px 2px 0px 0px rgba(0, 0, 0, 0.04)',
|
|
78
|
-
color: '#FFF',
|
|
79
|
-
textAlign: 'center',
|
|
80
|
-
fontFamily: 'Verdana, sans-serif',
|
|
81
|
-
fontSize: '1rem',
|
|
82
|
-
fontStyle: 'normal',
|
|
83
|
-
fontWeight: '500',
|
|
84
|
-
lineHeight: '1.5rem',
|
|
85
|
-
cursor: 'pointer',
|
|
86
|
-
};
|
|
87
|
-
exports.sectionTitleStyle = {
|
|
88
|
-
fontFamily: 'Verdana, sans-serif',
|
|
89
|
-
fontSize: '13px',
|
|
90
|
-
fontWeight: '500',
|
|
91
|
-
lineHeight: 'auto',
|
|
92
|
-
display: 'flex',
|
|
93
|
-
justifyContent: 'space-between',
|
|
94
|
-
width: '100%',
|
|
95
|
-
cursor: 'pointer',
|
|
96
|
-
};
|
|
97
|
-
exports.contentStyle = {
|
|
98
|
-
display: 'flex',
|
|
99
|
-
flexDirection: 'column',
|
|
100
|
-
alignItems: 'flex-start',
|
|
101
|
-
gap: '0.625rem',
|
|
102
|
-
fontSize: '13px',
|
|
103
|
-
lineHeight: 'auto',
|
|
104
|
-
};
|
|
105
|
-
// New widget styles
|
|
106
|
-
exports.titleWidgetStyle = {
|
|
107
|
-
padding: '0.5rem',
|
|
108
|
-
gap: '0.5rem',
|
|
109
|
-
fontFamily: 'Verdana, sans-serif',
|
|
110
|
-
fontSize: '16px',
|
|
111
|
-
fontStyle: 'normal',
|
|
112
|
-
fontWeight: '500',
|
|
113
|
-
lineHeight: 'auto',
|
|
114
|
-
color: 'white',
|
|
115
|
-
display: 'flex',
|
|
116
|
-
alignItems: 'center',
|
|
117
|
-
width: '100%',
|
|
118
|
-
borderRadius: '2px',
|
|
119
|
-
background: 'rgba(0, 0, 0, 0.75)',
|
|
120
|
-
boxSizing: 'border-box',
|
|
121
|
-
};
|
|
122
|
-
exports.descriptionWidgetStyle = {
|
|
123
|
-
boxSizing: 'border-box',
|
|
124
|
-
display: 'block',
|
|
125
|
-
width: '100%',
|
|
126
|
-
borderBottom: '1px solid #D9D9D9',
|
|
127
|
-
background: '#FFF',
|
|
128
|
-
padding: '0.65rem',
|
|
129
|
-
alignSelf: 'stretch',
|
|
130
|
-
color: '#000',
|
|
131
|
-
fontFamily: 'Verdana, sans-serif',
|
|
132
|
-
// fontSize: '0.875rem',
|
|
133
|
-
fontStyle: 'normal',
|
|
134
|
-
fontWeight: '400',
|
|
135
|
-
// lineHeight: '1.375rem',
|
|
136
|
-
};
|
|
137
|
-
exports.endSectionStyle = {
|
|
138
|
-
...exports.descriptionWidgetStyle,
|
|
139
|
-
display: 'flex',
|
|
140
|
-
flexDirection: 'column',
|
|
141
|
-
alignItems: 'center',
|
|
142
|
-
gap: '0.625rem',
|
|
143
|
-
};
|
|
144
|
-
exports.symbolIcon = {
|
|
145
|
-
fontSize: '1.25rem',
|
|
146
|
-
fontWeight: '500',
|
|
147
|
-
cursor: 'pointer',
|
|
148
|
-
color: '#394EFF',
|
|
149
|
-
};
|
|
150
|
-
exports.buttonWidgetStyle = {
|
|
151
|
-
display: 'flex',
|
|
152
|
-
padding: '0.4rem 0.9375rem',
|
|
153
|
-
justifyContent: 'center',
|
|
154
|
-
alignItems: 'center',
|
|
155
|
-
gap: '0.625rem',
|
|
156
|
-
borderRadius: '0.25rem',
|
|
157
|
-
border: '1px solid #394EFF',
|
|
158
|
-
background: '#394EFF',
|
|
159
|
-
boxShadow: '0px 2px 0px 0px rgba(0, 0, 0, 0.04)',
|
|
160
|
-
color: '#FFF',
|
|
161
|
-
textAlign: 'center',
|
|
162
|
-
fontFamily: 'Verdana, sans-serif',
|
|
163
|
-
fontSize: '1rem',
|
|
164
|
-
fontStyle: 'normal',
|
|
165
|
-
fontWeight: '500',
|
|
166
|
-
lineHeight: '1.5rem',
|
|
167
|
-
width: '100%',
|
|
168
|
-
boxSizing: 'border-box',
|
|
169
|
-
cursor: 'pointer',
|
|
170
|
-
};
|
|
171
|
-
exports.stopWidgetStyle = {
|
|
172
|
-
marginTop: '1rem',
|
|
173
|
-
marginBottom: '1rem',
|
|
174
|
-
cursor: 'pointer',
|
|
175
|
-
display: 'block',
|
|
176
|
-
fontWeight: '500',
|
|
177
|
-
fontSize: '13px!important',
|
|
178
|
-
lineHeight: 'auto',
|
|
179
|
-
};
|
|
180
|
-
exports.paginationStyle = {
|
|
181
|
-
display: 'flex',
|
|
182
|
-
justifyContent: 'space-between',
|
|
183
|
-
alignItems: 'center',
|
|
184
|
-
gap: '1rem',
|
|
185
|
-
padding: '0.5rem',
|
|
186
|
-
width: '100%',
|
|
187
|
-
boxSizing: 'border-box',
|
|
188
|
-
};
|
|
189
|
-
exports.taskNumberActive = {
|
|
190
|
-
display: 'flex',
|
|
191
|
-
flexDirection: 'column',
|
|
192
|
-
alignItems: 'center',
|
|
193
|
-
justifyContent: 'center',
|
|
194
|
-
borderRadius: '6.25em',
|
|
195
|
-
outline: '1px solid #394EFF',
|
|
196
|
-
fontSize: '13px',
|
|
197
|
-
height: '24px',
|
|
198
|
-
width: '24px',
|
|
199
|
-
};
|
|
200
|
-
exports.taskNumberDone = {
|
|
201
|
-
display: 'flex',
|
|
202
|
-
flexDirection: 'column',
|
|
203
|
-
alignItems: 'center',
|
|
204
|
-
justifyContent: 'center',
|
|
205
|
-
borderRadius: '6.25em',
|
|
206
|
-
outline: '1px solid #D2DFFF',
|
|
207
|
-
boxShadow: '0px 2px 0px 0px rgba(0, 0, 0, 0.04)',
|
|
208
|
-
background: '#D2DFFF',
|
|
209
|
-
fontSize: '13px',
|
|
210
|
-
height: '24px',
|
|
211
|
-
width: '24px',
|
|
212
|
-
};
|
|
213
|
-
exports.taskDescriptionCard = {
|
|
214
|
-
borderRadius: '0.375rem',
|
|
215
|
-
border: '1px solid rgba(0, 0, 0, 0.06)',
|
|
216
|
-
background: '#F5F7FF',
|
|
217
|
-
boxShadow: '0px 2px 0px 0px rgba(0, 0, 0, 0.04)',
|
|
218
|
-
display: 'flex',
|
|
219
|
-
flexDirection: 'column',
|
|
220
|
-
padding: '0.625rem 0.9375rem',
|
|
221
|
-
gap: '0.5rem',
|
|
222
|
-
alignSelf: 'stretch',
|
|
223
|
-
};
|
|
224
|
-
exports.taskTextStyle = {
|
|
225
|
-
fontWeight: 'bold',
|
|
226
|
-
};
|
|
227
|
-
exports.taskDescriptionStyle = {
|
|
228
|
-
fontSize: '13px',
|
|
229
|
-
lineHeight: 'auto',
|
|
230
|
-
};
|
|
231
|
-
exports.taskButtonStyle = {
|
|
232
|
-
marginRight: '0.5rem',
|
|
233
|
-
cursor: 'pointer',
|
|
234
|
-
color: '#394EFF',
|
|
235
|
-
textAlign: 'center',
|
|
236
|
-
fontFamily: 'Verdana, sans-serif',
|
|
237
|
-
fontSize: '13px',
|
|
238
|
-
fontStyle: 'normal',
|
|
239
|
-
fontWeight: '500',
|
|
240
|
-
lineHeight: 'auto',
|
|
241
|
-
};
|
|
242
|
-
exports.taskButtonBorderedStyle = {
|
|
243
|
-
...exports.taskButtonStyle,
|
|
244
|
-
display: 'flex',
|
|
245
|
-
padding: '0.25rem 0.9375rem',
|
|
246
|
-
justifyContent: 'center',
|
|
247
|
-
alignItems: 'center',
|
|
248
|
-
gap: '0.5rem',
|
|
249
|
-
borderRadius: '0.25rem',
|
|
250
|
-
border: '1px solid #394EFF',
|
|
251
|
-
};
|
|
252
|
-
exports.taskButtonsRow = {
|
|
253
|
-
display: 'flex',
|
|
254
|
-
justifyContent: 'space-between',
|
|
255
|
-
alignItems: 'center',
|
|
256
|
-
width: '100%',
|
|
257
|
-
boxSizing: 'border-box',
|
|
258
|
-
};
|
|
259
|
-
exports.spinnerStyles = {
|
|
260
|
-
border: '4px solid rgba(255, 255, 255, 0.4)',
|
|
261
|
-
width: '16px',
|
|
262
|
-
height: '16px',
|
|
263
|
-
borderRadius: '50%',
|
|
264
|
-
borderLeftColor: '#fff',
|
|
265
|
-
animation: 'spin 0.5s linear infinite',
|
|
266
|
-
};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TEST_ID = exports.SESSION_ID = exports.TASK_IND = exports.TEST_START = exports.createElement = exports.createSpinner = exports.addKeyframes = exports.generateChevron = exports.generateGrid = void 0;
|
|
4
|
-
const styles_js_1 = require("./styles.js");
|
|
5
|
-
function generateGrid() {
|
|
6
|
-
const grid = document.createElement('div');
|
|
7
|
-
grid.className = 'grid';
|
|
8
|
-
for (let i = 0; i < 16; i++) {
|
|
9
|
-
const cell = document.createElement('div');
|
|
10
|
-
Object.assign(cell.style, {
|
|
11
|
-
width: '2px',
|
|
12
|
-
height: '2px',
|
|
13
|
-
borderRadius: '10px',
|
|
14
|
-
background: 'white',
|
|
15
|
-
});
|
|
16
|
-
cell.className = 'cell';
|
|
17
|
-
grid.appendChild(cell);
|
|
18
|
-
}
|
|
19
|
-
Object.assign(grid.style, {
|
|
20
|
-
display: 'grid',
|
|
21
|
-
gridTemplateColumns: 'repeat(4, 1fr)',
|
|
22
|
-
gridTemplateRows: 'repeat(4, 1fr)',
|
|
23
|
-
gap: '2px',
|
|
24
|
-
cursor: 'grab',
|
|
25
|
-
});
|
|
26
|
-
return grid;
|
|
27
|
-
}
|
|
28
|
-
exports.generateGrid = generateGrid;
|
|
29
|
-
function generateChevron() {
|
|
30
|
-
const triangle = document.createElement('div');
|
|
31
|
-
Object.assign(triangle.style, {
|
|
32
|
-
width: '0',
|
|
33
|
-
height: '0',
|
|
34
|
-
borderLeft: '7px solid transparent',
|
|
35
|
-
borderRight: '7px solid transparent',
|
|
36
|
-
borderBottom: '7px solid white',
|
|
37
|
-
});
|
|
38
|
-
const container = document.createElement('div');
|
|
39
|
-
container.appendChild(triangle);
|
|
40
|
-
Object.assign(container.style, {
|
|
41
|
-
display: 'flex',
|
|
42
|
-
alignItems: 'center',
|
|
43
|
-
justifyContent: 'center',
|
|
44
|
-
width: '16px',
|
|
45
|
-
height: '16px',
|
|
46
|
-
cursor: 'pointer',
|
|
47
|
-
marginLeft: 'auto',
|
|
48
|
-
transform: 'rotate(180deg)',
|
|
49
|
-
});
|
|
50
|
-
return container;
|
|
51
|
-
}
|
|
52
|
-
exports.generateChevron = generateChevron;
|
|
53
|
-
function addKeyframes() {
|
|
54
|
-
const styleSheet = document.createElement('style');
|
|
55
|
-
styleSheet.type = 'text/css';
|
|
56
|
-
styleSheet.innerText = `@keyframes spin {
|
|
57
|
-
0% { transform: rotate(0deg); }
|
|
58
|
-
100% { transform: rotate(360deg); }
|
|
59
|
-
}`;
|
|
60
|
-
document.head.appendChild(styleSheet);
|
|
61
|
-
}
|
|
62
|
-
exports.addKeyframes = addKeyframes;
|
|
63
|
-
function createSpinner() {
|
|
64
|
-
addKeyframes();
|
|
65
|
-
const spinner = document.createElement('div');
|
|
66
|
-
spinner.classList.add('spinner');
|
|
67
|
-
Object.assign(spinner.style, styles_js_1.spinnerStyles);
|
|
68
|
-
return spinner;
|
|
69
|
-
}
|
|
70
|
-
exports.createSpinner = createSpinner;
|
|
71
|
-
function createElement(tag, className, styles, textContent, id) {
|
|
72
|
-
const element = document.createElement(tag);
|
|
73
|
-
element.className = className;
|
|
74
|
-
Object.assign(element.style, styles);
|
|
75
|
-
if (textContent) {
|
|
76
|
-
element.textContent = textContent;
|
|
77
|
-
}
|
|
78
|
-
if (id) {
|
|
79
|
-
element.id = id;
|
|
80
|
-
}
|
|
81
|
-
return element;
|
|
82
|
-
}
|
|
83
|
-
exports.createElement = createElement;
|
|
84
|
-
exports.TEST_START = 'or_uxt_test_start';
|
|
85
|
-
exports.TASK_IND = 'or_uxt_task_index';
|
|
86
|
-
exports.SESSION_ID = 'or_uxt_session_id';
|
|
87
|
-
exports.TEST_ID = 'or_uxt_test_id';
|
package/cjs/modules/viewport.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const utils_js_1 = require("../utils.js");
|
|
4
|
-
const messages_gen_js_1 = require("../app/messages.gen.js");
|
|
5
|
-
function default_1(app) {
|
|
6
|
-
let url, width, height;
|
|
7
|
-
let navigationStart;
|
|
8
|
-
let referrer = document.referrer;
|
|
9
|
-
const sendSetPageLocation = app.safe(() => {
|
|
10
|
-
const { URL } = document;
|
|
11
|
-
if (URL !== url) {
|
|
12
|
-
url = URL;
|
|
13
|
-
app.send((0, messages_gen_js_1.SetPageLocation)(url, referrer, navigationStart, document.title));
|
|
14
|
-
navigationStart = 0;
|
|
15
|
-
referrer = url;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
const sendSetViewportSize = app.safe(() => {
|
|
19
|
-
const { innerWidth, innerHeight } = window;
|
|
20
|
-
if (innerWidth !== width || innerHeight !== height) {
|
|
21
|
-
width = innerWidth;
|
|
22
|
-
height = innerHeight;
|
|
23
|
-
app.send((0, messages_gen_js_1.SetViewportSize)(width, height));
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
const sendSetPageVisibility = document.hidden === undefined
|
|
27
|
-
? Function.prototype
|
|
28
|
-
: app.safe(() => app.send((0, messages_gen_js_1.SetPageVisibility)(document.hidden)));
|
|
29
|
-
app.attachStartCallback(() => {
|
|
30
|
-
url = null;
|
|
31
|
-
navigationStart = (0, utils_js_1.getTimeOrigin)();
|
|
32
|
-
width = height = -1;
|
|
33
|
-
sendSetPageLocation();
|
|
34
|
-
sendSetViewportSize();
|
|
35
|
-
sendSetPageVisibility();
|
|
36
|
-
});
|
|
37
|
-
if (document.hidden !== undefined) {
|
|
38
|
-
app.attachEventListener(document, 'visibilitychange', sendSetPageVisibility, false, false);
|
|
39
|
-
}
|
|
40
|
-
app.ticker.attach(sendSetPageLocation, 1, false);
|
|
41
|
-
app.ticker.attach(sendSetViewportSize, 5, false);
|
|
42
|
-
}
|
|
43
|
-
exports.default = default_1;
|
package/cjs/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "type": "commonjs" }
|
package/cjs/utils.js
DELETED
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.simpleMerge = exports.requestIdleCb = exports.deleteEventListener = exports.createEventListener = exports.createMutationObserver = exports.ngSafeBrowserMethod = exports.inIframe = exports.generateRandomId = exports.canAccessIframe = exports.hasOpenreplayAttribute = exports.getLabelAttribute = exports.deprecationWarn = exports.DOCS_HOST = exports.isURL = exports.normSpaces = exports.stars = exports.now = exports.getTimeOrigin = exports.adjustTimeOrigin = exports.MAX_STR_LEN = exports.IS_FIREFOX = exports.IN_BROWSER = void 0;
|
|
4
|
-
const DEPRECATED_ATTRS = { htmlmasked: 'hidden', masked: 'obscured' };
|
|
5
|
-
exports.IN_BROWSER = !(typeof window === 'undefined');
|
|
6
|
-
exports.IS_FIREFOX = exports.IN_BROWSER && navigator.userAgent.match(/firefox|fxios/i);
|
|
7
|
-
exports.MAX_STR_LEN = 1e5;
|
|
8
|
-
// Buggy to use `performance.timeOrigin || performance.timing.navigationStart`
|
|
9
|
-
// https://github.com/mdn/content/issues/4713
|
|
10
|
-
// Maybe move to timer/ticker
|
|
11
|
-
let timeOrigin = exports.IN_BROWSER ? Date.now() - performance.now() : 0;
|
|
12
|
-
function adjustTimeOrigin() {
|
|
13
|
-
timeOrigin = Date.now() - performance.now();
|
|
14
|
-
}
|
|
15
|
-
exports.adjustTimeOrigin = adjustTimeOrigin;
|
|
16
|
-
function getTimeOrigin() {
|
|
17
|
-
return timeOrigin;
|
|
18
|
-
}
|
|
19
|
-
exports.getTimeOrigin = getTimeOrigin;
|
|
20
|
-
exports.now = exports.IN_BROWSER && !!performance.now
|
|
21
|
-
? () => Math.round(performance.now() + timeOrigin)
|
|
22
|
-
: () => Date.now();
|
|
23
|
-
exports.stars = 'repeat' in String.prototype
|
|
24
|
-
? (str) => '*'.repeat(str.length)
|
|
25
|
-
: (str) => str.replace(/./g, '*');
|
|
26
|
-
function normSpaces(str) {
|
|
27
|
-
return str.trim().replace(/\s+/g, ' ');
|
|
28
|
-
}
|
|
29
|
-
exports.normSpaces = normSpaces;
|
|
30
|
-
// isAbsoluteUrl regexp: /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url)
|
|
31
|
-
function isURL(s) {
|
|
32
|
-
return s.startsWith('https://') || s.startsWith('http://');
|
|
33
|
-
}
|
|
34
|
-
exports.isURL = isURL;
|
|
35
|
-
// TODO: JOIN IT WITH LOGGER somehow (use logging decorators?); Don't forget about index.js loggin when there is no logger instance.
|
|
36
|
-
exports.DOCS_HOST = 'https://docs.openreplay.com';
|
|
37
|
-
const warnedFeatures = {};
|
|
38
|
-
function deprecationWarn(nameOfFeature, useInstead, docsPath = '/') {
|
|
39
|
-
if (warnedFeatures[nameOfFeature]) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
console.warn(`OpenReplay: ${nameOfFeature} is deprecated. ${useInstead ? `Please, use ${useInstead} instead.` : ''} Visit ${exports.DOCS_HOST}${docsPath} for more information.`);
|
|
43
|
-
warnedFeatures[nameOfFeature] = true;
|
|
44
|
-
}
|
|
45
|
-
exports.deprecationWarn = deprecationWarn;
|
|
46
|
-
function getLabelAttribute(e) {
|
|
47
|
-
let value = e.getAttribute('data-openreplay-label');
|
|
48
|
-
if (value !== null) {
|
|
49
|
-
return value;
|
|
50
|
-
}
|
|
51
|
-
value = e.getAttribute('data-asayer-label');
|
|
52
|
-
if (value !== null) {
|
|
53
|
-
deprecationWarn('"data-asayer-label" attribute', '"data-openreplay-label" attribute', '/');
|
|
54
|
-
}
|
|
55
|
-
return value;
|
|
56
|
-
}
|
|
57
|
-
exports.getLabelAttribute = getLabelAttribute;
|
|
58
|
-
function hasOpenreplayAttribute(e, attr) {
|
|
59
|
-
const newName = `data-openreplay-${attr}`;
|
|
60
|
-
if (e.hasAttribute(newName)) {
|
|
61
|
-
// @ts-ignore
|
|
62
|
-
if (DEPRECATED_ATTRS[attr]) {
|
|
63
|
-
deprecationWarn(`"${newName}" attribute`,
|
|
64
|
-
// @ts-ignore
|
|
65
|
-
`"${DEPRECATED_ATTRS[attr]}" attribute`, '/installation/sanitize-data');
|
|
66
|
-
}
|
|
67
|
-
return true;
|
|
68
|
-
}
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
exports.hasOpenreplayAttribute = hasOpenreplayAttribute;
|
|
72
|
-
/**
|
|
73
|
-
* checks if iframe is accessible
|
|
74
|
-
**/
|
|
75
|
-
function canAccessIframe(iframe) {
|
|
76
|
-
try {
|
|
77
|
-
return Boolean(iframe.contentDocument);
|
|
78
|
-
}
|
|
79
|
-
catch (e) {
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
exports.canAccessIframe = canAccessIframe;
|
|
84
|
-
function dec2hex(dec) {
|
|
85
|
-
return dec.toString(16).padStart(2, '0');
|
|
86
|
-
}
|
|
87
|
-
function generateRandomId(len) {
|
|
88
|
-
const arr = new Uint8Array((len || 40) / 2);
|
|
89
|
-
// msCrypto = IE11
|
|
90
|
-
// @ts-ignore
|
|
91
|
-
const safeCrypto = window.crypto || window.msCrypto;
|
|
92
|
-
if (safeCrypto) {
|
|
93
|
-
safeCrypto.getRandomValues(arr);
|
|
94
|
-
return Array.from(arr, dec2hex).join('');
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
return Array.from({ length: len || 40 }, () => dec2hex(Math.floor(Math.random() * 16))).join('');
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
exports.generateRandomId = generateRandomId;
|
|
101
|
-
function inIframe() {
|
|
102
|
-
try {
|
|
103
|
-
return window.self && window.top && window.self !== window.top;
|
|
104
|
-
}
|
|
105
|
-
catch (e) {
|
|
106
|
-
return true;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
exports.inIframe = inIframe;
|
|
110
|
-
/**
|
|
111
|
-
* Because angular devs decided that its a good idea to override a browser apis
|
|
112
|
-
* we need to use this to achieve safe behavior
|
|
113
|
-
* */
|
|
114
|
-
function ngSafeBrowserMethod(method) {
|
|
115
|
-
// @ts-ignore
|
|
116
|
-
return window.Zone && '__symbol__' in window.Zone
|
|
117
|
-
? // @ts-ignore
|
|
118
|
-
window['Zone']['__symbol__'](method)
|
|
119
|
-
: method;
|
|
120
|
-
}
|
|
121
|
-
exports.ngSafeBrowserMethod = ngSafeBrowserMethod;
|
|
122
|
-
function createMutationObserver(cb) {
|
|
123
|
-
const mObserver = ngSafeBrowserMethod('MutationObserver');
|
|
124
|
-
return new window[mObserver](cb);
|
|
125
|
-
}
|
|
126
|
-
exports.createMutationObserver = createMutationObserver;
|
|
127
|
-
function createEventListener(target, event, cb, capture) {
|
|
128
|
-
const safeAddEventListener = ngSafeBrowserMethod('addEventListener');
|
|
129
|
-
try {
|
|
130
|
-
target[safeAddEventListener](event, cb, capture);
|
|
131
|
-
}
|
|
132
|
-
catch (e) {
|
|
133
|
-
const msg = e.message;
|
|
134
|
-
console.error(
|
|
135
|
-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
136
|
-
`Openreplay: ${msg}; if this error is caused by an IframeObserver, ignore it`, event);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
exports.createEventListener = createEventListener;
|
|
140
|
-
function deleteEventListener(target, event, cb, capture) {
|
|
141
|
-
const safeRemoveEventListener = ngSafeBrowserMethod('removeEventListener');
|
|
142
|
-
try {
|
|
143
|
-
target[safeRemoveEventListener](event, cb, capture);
|
|
144
|
-
}
|
|
145
|
-
catch (e) {
|
|
146
|
-
const msg = e.message;
|
|
147
|
-
console.error(
|
|
148
|
-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
149
|
-
`Openreplay: ${msg}; if this error is caused by an IframeObserver, ignore it`, event);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
exports.deleteEventListener = deleteEventListener;
|
|
153
|
-
class FIFOTaskScheduler {
|
|
154
|
-
constructor() {
|
|
155
|
-
this.taskQueue = [];
|
|
156
|
-
this.isRunning = false;
|
|
157
|
-
}
|
|
158
|
-
// Adds a task to the queue
|
|
159
|
-
addTask(task) {
|
|
160
|
-
this.taskQueue.push(task);
|
|
161
|
-
this.runTasks();
|
|
162
|
-
}
|
|
163
|
-
// Runs tasks from the queue
|
|
164
|
-
runTasks() {
|
|
165
|
-
if (this.isRunning || this.taskQueue.length === 0) {
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
this.isRunning = true;
|
|
169
|
-
const executeNextTask = () => {
|
|
170
|
-
if (this.taskQueue.length === 0) {
|
|
171
|
-
this.isRunning = false;
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
// Get the next task and execute it
|
|
175
|
-
const nextTask = this.taskQueue.shift();
|
|
176
|
-
Promise.resolve(nextTask()).then(() => {
|
|
177
|
-
requestAnimationFrame(() => executeNextTask());
|
|
178
|
-
});
|
|
179
|
-
};
|
|
180
|
-
executeNextTask();
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
const scheduler = new FIFOTaskScheduler();
|
|
184
|
-
function requestIdleCb(callback) {
|
|
185
|
-
// performance improvement experiment;
|
|
186
|
-
scheduler.addTask(callback);
|
|
187
|
-
/**
|
|
188
|
-
* This is a brief polyfill that suits our needs
|
|
189
|
-
* I took inspiration from Microsoft Clarity polyfill on this one
|
|
190
|
-
* then adapted it a little bit
|
|
191
|
-
*
|
|
192
|
-
* I'm very grateful for their bright idea
|
|
193
|
-
* */
|
|
194
|
-
// const taskTimeout = 3000
|
|
195
|
-
// if (window.requestIdleCallback) {
|
|
196
|
-
// return window.requestIdleCallback(callback, { timeout: taskTimeout })
|
|
197
|
-
// } else {
|
|
198
|
-
// const channel = new MessageChannel()
|
|
199
|
-
// const incoming = channel.port1
|
|
200
|
-
// const outgoing = channel.port2
|
|
201
|
-
//
|
|
202
|
-
// incoming.onmessage = (): void => {
|
|
203
|
-
// callback()
|
|
204
|
-
// }
|
|
205
|
-
// requestAnimationFrame((): void => {
|
|
206
|
-
// outgoing.postMessage(1)
|
|
207
|
-
// })
|
|
208
|
-
// }
|
|
209
|
-
}
|
|
210
|
-
exports.requestIdleCb = requestIdleCb;
|
|
211
|
-
function simpleMerge(defaultObj, givenObj) {
|
|
212
|
-
const result = { ...defaultObj };
|
|
213
|
-
for (const key in givenObj) {
|
|
214
|
-
// eslint-disable-next-line no-prototype-builtins
|
|
215
|
-
if (givenObj.hasOwnProperty(key)) {
|
|
216
|
-
const userOptionValue = givenObj[key];
|
|
217
|
-
const defaultOptionValue = defaultObj[key];
|
|
218
|
-
if (typeof userOptionValue === 'object' &&
|
|
219
|
-
!Array.isArray(userOptionValue) &&
|
|
220
|
-
userOptionValue !== null) {
|
|
221
|
-
result[key] = simpleMerge(defaultOptionValue || {}, userOptionValue);
|
|
222
|
-
}
|
|
223
|
-
else {
|
|
224
|
-
result[key] = userOptionValue;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
return result;
|
|
229
|
-
}
|
|
230
|
-
exports.simpleMerge = simpleMerge;
|