@multiplayer-app/session-recorder-browser 1.2.22 → 1.2.24
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/dist/browser/index.js +48 -104
- package/dist/browser/index.js.map +1 -1
- package/dist/config/constants.d.ts +19 -0
- package/dist/config/constants.js +35 -0
- package/dist/config/constants.js.map +1 -0
- package/dist/config/defaults.d.ts +5 -0
- package/dist/config/defaults.js +60 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/index.d.ts +6 -0
- package/dist/config/index.js +7 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/masking.d.ts +3 -0
- package/dist/config/masking.js +30 -0
- package/dist/config/masking.js.map +1 -0
- package/dist/config/session-recorder.d.ts +3 -0
- package/dist/config/session-recorder.js +60 -0
- package/dist/config/session-recorder.js.map +1 -0
- package/dist/config/validators.d.ts +11 -0
- package/dist/config/validators.js +25 -0
- package/dist/config/validators.js.map +1 -0
- package/dist/eventBus.d.ts +3 -0
- package/dist/eventBus.js +3 -0
- package/dist/eventBus.js.map +1 -0
- package/dist/exporters/index.js +1 -1
- package/dist/exporters.d.ts +4 -0
- package/dist/exporters.js +8 -0
- package/dist/exporters.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +52 -104
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +48 -103
- package/dist/index.umd.js.map +1 -1
- package/dist/listeners.d.ts +3 -0
- package/dist/listeners.js +39 -0
- package/dist/listeners.js.map +1 -0
- package/dist/navigation/index.d.ts +3 -0
- package/dist/navigation/index.js +3 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/navigation/navigationRecorder.d.ts +22 -0
- package/dist/navigation/navigationRecorder.js +195 -0
- package/dist/navigation/navigationRecorder.js.map +1 -0
- package/dist/navigation/types.d.ts +32 -0
- package/dist/navigation/types.js +2 -0
- package/dist/navigation/types.js.map +1 -0
- package/dist/otel/helpers.d.ts +46 -0
- package/dist/otel/helpers.js +201 -0
- package/dist/otel/helpers.js.map +1 -0
- package/dist/otel/index.d.ts +18 -0
- package/dist/otel/index.js +186 -0
- package/dist/otel/index.js.map +1 -0
- package/dist/otel/types.d.ts +10 -0
- package/dist/otel/types.js +2 -0
- package/dist/otel/types.js.map +1 -0
- package/dist/patch/configs.d.ts +9 -0
- package/dist/patch/configs.js +16 -0
- package/dist/patch/configs.js.map +1 -0
- package/dist/patch/fetch.d.ts +2 -0
- package/dist/patch/fetch.js +123 -0
- package/dist/patch/fetch.js.map +1 -0
- package/dist/patch/index.d.ts +4 -0
- package/dist/patch/index.js +4 -0
- package/dist/patch/index.js.map +1 -0
- package/dist/patch/xhr.d.ts +2 -0
- package/dist/patch/xhr.js +85 -0
- package/dist/patch/xhr.js.map +1 -0
- package/dist/rrweb/exporter.d.ts +25 -0
- package/dist/rrweb/exporter.js +146 -0
- package/dist/rrweb/exporter.js.map +1 -0
- package/dist/rrweb/index.d.ts +39 -0
- package/dist/rrweb/index.js +139 -0
- package/dist/rrweb/index.js.map +1 -0
- package/dist/rrweb/indexedDbService.d.ts +9 -0
- package/dist/rrweb/indexedDbService.js +54 -0
- package/dist/rrweb/indexedDbService.js.map +1 -0
- package/dist/services/api.service.d.ts +81 -0
- package/dist/services/api.service.js +133 -0
- package/dist/services/api.service.js.map +1 -0
- package/dist/services/messaging.service.d.ts +16 -0
- package/dist/services/messaging.service.js +94 -0
- package/dist/services/messaging.service.js.map +1 -0
- package/dist/sessionRecorder.d.ts +148 -0
- package/dist/sessionRecorder.js +555 -0
- package/dist/sessionRecorder.js.map +1 -0
- package/dist/sessionWidget/UIManager.d.ts +76 -0
- package/dist/sessionWidget/UIManager.js +135 -0
- package/dist/sessionWidget/UIManager.js.map +1 -0
- package/dist/sessionWidget/buttonStateConfigs.d.ts +83 -0
- package/dist/sessionWidget/buttonStateConfigs.js +86 -0
- package/dist/sessionWidget/buttonStateConfigs.js.map +1 -0
- package/dist/sessionWidget/constants.d.ts +5 -0
- package/dist/sessionWidget/constants.js +5 -0
- package/dist/sessionWidget/constants.js.map +1 -0
- package/dist/sessionWidget/dragManager.d.ts +16 -0
- package/dist/sessionWidget/dragManager.js +114 -0
- package/dist/sessionWidget/dragManager.js.map +1 -0
- package/dist/sessionWidget/index.d.ts +86 -0
- package/dist/sessionWidget/index.js +564 -0
- package/dist/sessionWidget/index.js.map +1 -0
- package/dist/sessionWidget/templates/finalPopover.d.ts +3 -0
- package/dist/sessionWidget/templates/finalPopover.js +21 -0
- package/dist/sessionWidget/templates/finalPopover.js.map +1 -0
- package/dist/sessionWidget/templates/icons.d.ts +14 -0
- package/dist/sessionWidget/templates/icons.js +50 -0
- package/dist/sessionWidget/templates/icons.js.map +1 -0
- package/dist/sessionWidget/templates/initialPopover.d.ts +3 -0
- package/dist/sessionWidget/templates/initialPopover.js +41 -0
- package/dist/sessionWidget/templates/initialPopover.js.map +1 -0
- package/dist/sessionWidget/templates/recordingOverlay.d.ts +2 -0
- package/dist/sessionWidget/templates/recordingOverlay.js +16 -0
- package/dist/sessionWidget/templates/recordingOverlay.js.map +1 -0
- package/dist/sessionWidget/templates/submitSessionDialog.d.ts +3 -0
- package/dist/sessionWidget/templates/submitSessionDialog.js +17 -0
- package/dist/sessionWidget/templates/submitSessionDialog.js.map +1 -0
- package/dist/sessionWidget/templates/toast.d.ts +3 -0
- package/dist/sessionWidget/templates/toast.js +25 -0
- package/dist/sessionWidget/templates/toast.js.map +1 -0
- package/dist/types/client-type.enum.d.ts +6 -0
- package/dist/types/client-type.enum.js +7 -0
- package/dist/types/client-type.enum.js.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.js +4 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/session.d.ts +72 -0
- package/dist/types/session.js +7 -0
- package/dist/types/session.js.map +1 -0
- package/dist/types/sessionRecorder.d.ts +369 -0
- package/dist/types/sessionRecorder.js +14 -0
- package/dist/types/sessionRecorder.js.map +1 -0
- package/dist/types/widget.d.ts +11 -0
- package/dist/types/widget.js +2 -0
- package/dist/types/widget.js.map +1 -0
- package/dist/utils/array.d.ts +4 -0
- package/dist/utils/array.js +50 -0
- package/dist/utils/array.js.map +1 -0
- package/dist/utils/dom.d.ts +5 -0
- package/dist/utils/dom.js +9 -0
- package/dist/utils/dom.js.map +1 -0
- package/dist/utils/globals.d.ts +24 -0
- package/dist/utils/globals.js +14 -0
- package/dist/utils/globals.js.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.js +10 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/navigator.d.ts +3 -0
- package/dist/utils/navigator.js +83 -0
- package/dist/utils/navigator.js.map +1 -0
- package/dist/utils/request-utils.d.ts +10 -0
- package/dist/utils/request-utils.js +70 -0
- package/dist/utils/request-utils.js.map +1 -0
- package/dist/utils/session.d.ts +8 -0
- package/dist/utils/session.js +21 -0
- package/dist/utils/session.js.map +1 -0
- package/dist/utils/storage.d.ts +7 -0
- package/dist/utils/storage.js +19 -0
- package/dist/utils/storage.js.map +1 -0
- package/dist/utils/time.d.ts +7 -0
- package/dist/utils/time.js +25 -0
- package/dist/utils/time.js.map +1 -0
- package/dist/utils/type-utils.d.ts +18 -0
- package/dist/utils/type-utils.js +71 -0
- package/dist/utils/type-utils.js.map +1 -0
- package/package.json +8 -3
- package/dist/exports.d.ts.map +0 -1
- package/docs/img/header-js.png +0 -0
- package/src/index.scss +0 -913
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { insertTrustedHTML } from '../utils';
|
|
2
|
+
import { RecordIcon } from './templates/icons';
|
|
3
|
+
import { finalPopoverTemplate } from './templates/finalPopover';
|
|
4
|
+
import { initialPopoverTemplate } from './templates/initialPopover';
|
|
5
|
+
import { recordingOverlayTemplate } from './templates/recordingOverlay';
|
|
6
|
+
import { submitSessionDialogTemplate } from './templates/submitSessionDialog';
|
|
7
|
+
import { toastTemplate } from './templates/toast';
|
|
8
|
+
export class UIManager {
|
|
9
|
+
/**
|
|
10
|
+
* Constructor initializes the UIManager with necessary DOM elements
|
|
11
|
+
* @param recorderButton - The main button to start recording
|
|
12
|
+
* @param initialPopover - Popover shown when starting the session
|
|
13
|
+
* @param finalPopover - Popover shown when the session ends
|
|
14
|
+
* @param previewModal - Modal to preview the recorded session
|
|
15
|
+
* @param recordingOverlay - Overlay element for recording indication in extension
|
|
16
|
+
* @param submitSessionDialog - Dialog that opens when recording is stopped from extension
|
|
17
|
+
* @param toast - Toast element for showing success messages
|
|
18
|
+
* @param widgetTextOverrides - Configuration for customizable text
|
|
19
|
+
* @param showContinuousRecording - Whether continuous recording is enabled
|
|
20
|
+
*/
|
|
21
|
+
constructor(recorderButton, initialPopover, finalPopover, recordingOverlay, submitSessionDialog, toast, widgetTextOverrides, showContinuousRecording) {
|
|
22
|
+
this.toastTimeout = null;
|
|
23
|
+
this.recorderButton = recorderButton;
|
|
24
|
+
this.initialPopover = initialPopover;
|
|
25
|
+
this.finalPopover = finalPopover;
|
|
26
|
+
this.recordingOverlay = recordingOverlay;
|
|
27
|
+
this.submitSessionDialog = submitSessionDialog;
|
|
28
|
+
this.toast = toast;
|
|
29
|
+
this.widgetTextOverrides = widgetTextOverrides;
|
|
30
|
+
this.showContinuousRecording = showContinuousRecording;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Sets the properties for the recorder button, including its class,
|
|
34
|
+
* tooltip, and inner HTML content (Record icon)
|
|
35
|
+
*/
|
|
36
|
+
setRecorderButtonProps() {
|
|
37
|
+
this.recorderButton.className = 'mp-session-debugger-button';
|
|
38
|
+
this.recorderButton.dataset.tooltip = 'Record an issue';
|
|
39
|
+
insertTrustedHTML(this.recorderButton, `${RecordIcon}`);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Sets the properties for the recording overlay, including its classes,
|
|
43
|
+
* tooltip, and inner HTML content
|
|
44
|
+
*/
|
|
45
|
+
setOverlayProps() {
|
|
46
|
+
this.recordingOverlay.className = 'mp-recording-overlay hidden';
|
|
47
|
+
insertTrustedHTML(this.recordingOverlay, recordingOverlayTemplate);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Sets the properties for the session submission dialog, including its classes,
|
|
51
|
+
* tooltip, and inner HTML content
|
|
52
|
+
*/
|
|
53
|
+
setSubmitSessionDialogProps() {
|
|
54
|
+
this.submitSessionDialog.id = 'mp-submission-dialog';
|
|
55
|
+
this.submitSessionDialog.className = 'hidden';
|
|
56
|
+
insertTrustedHTML(this.submitSessionDialog, submitSessionDialogTemplate(this.widgetTextOverrides));
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Sets up the initial popover with its class and inner HTML structure.
|
|
60
|
+
* The popover includes a logo, heading, and start recording button.
|
|
61
|
+
*/
|
|
62
|
+
setInitialPopoverProps() {
|
|
63
|
+
this.initialPopover.className =
|
|
64
|
+
'mp-session-debugger-popover mp-initial-popover hidden';
|
|
65
|
+
insertTrustedHTML(this.initialPopover, initialPopoverTemplate(this.widgetTextOverrides, this.showContinuousRecording));
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Sets up the final popover with its class and inner HTML structure.
|
|
69
|
+
* The popover allows the user to preview or send the bug report after recording.
|
|
70
|
+
*/
|
|
71
|
+
setFinalPopoverProps() {
|
|
72
|
+
this.finalPopover.className = 'mp-session-debugger-popover hidden';
|
|
73
|
+
insertTrustedHTML(this.finalPopover, finalPopoverTemplate(this.widgetTextOverrides));
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Updates the popover button to reflect a loading state.
|
|
77
|
+
*
|
|
78
|
+
* When `isLoading` is true, the button is disabled and shows a loading message.
|
|
79
|
+
* When `isLoading` is false, the button is enabled and resets to its default label.
|
|
80
|
+
*
|
|
81
|
+
* @param isLoading - Whether the popover button should show a loading state.
|
|
82
|
+
*/
|
|
83
|
+
setPopoverLoadingState(isLoading) {
|
|
84
|
+
const button = this.initialPopover.querySelector('.mp-session-debugger-popover-button');
|
|
85
|
+
if (!button) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
button.classList.toggle('disabled', isLoading);
|
|
89
|
+
button.textContent = isLoading ? 'Starting to record...' : 'Start recording';
|
|
90
|
+
}
|
|
91
|
+
setTimerValue(time) {
|
|
92
|
+
const timerElement = this.recordingOverlay.querySelector('.timer');
|
|
93
|
+
if (!timerElement) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
insertTrustedHTML(timerElement, time);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Sets the properties for the toast element, including its classes
|
|
100
|
+
*/
|
|
101
|
+
setToastProps() {
|
|
102
|
+
this.toast.className = 'mp-toast hidden';
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Shows a toast message with optional session URL
|
|
106
|
+
* @param message - The message to display
|
|
107
|
+
* @param sessionUrl - Optional URL to open when clicking the button
|
|
108
|
+
* @param duration - Duration in milliseconds to show the toast (default: 10000ms)
|
|
109
|
+
*/
|
|
110
|
+
showToast(config, duration = 10000) {
|
|
111
|
+
var _a;
|
|
112
|
+
insertTrustedHTML(this.toast, toastTemplate(config));
|
|
113
|
+
this.toast.className = `mp-toast mp-toast-${config.type}`;
|
|
114
|
+
if ((_a = config.button) === null || _a === void 0 ? void 0 : _a.onClick) {
|
|
115
|
+
const button = this.toast.querySelector('.mp-toast-button');
|
|
116
|
+
button === null || button === void 0 ? void 0 : button.addEventListener('click', config.button.onClick);
|
|
117
|
+
}
|
|
118
|
+
if (this.toastTimeout) {
|
|
119
|
+
clearTimeout(this.toastTimeout);
|
|
120
|
+
}
|
|
121
|
+
this.toastTimeout = setTimeout(() => {
|
|
122
|
+
this.hideToast();
|
|
123
|
+
}, duration);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Hides the toast message
|
|
127
|
+
*/
|
|
128
|
+
hideToast() {
|
|
129
|
+
this.toast.classList.add('hidden');
|
|
130
|
+
if (this.toastTimeout) {
|
|
131
|
+
clearTimeout(this.toastTimeout);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=UIManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UIManager.js","sourceRoot":"","sources":["../../src/sessionWidget/UIManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAA;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGjD,MAAM,OAAO,SAAS;IAWpB;;;;;;;;;;;OAWG;IACH,YACE,cAAiC,EACjC,cAA2B,EAC3B,YAAyB,EACzB,gBAA6B,EAC7B,mBAAgC,EAChC,KAAkB,EAClB,mBAA8C,EAC9C,uBAAgC;QAxB1B,iBAAY,GAA0B,IAAI,CAAA;QA0BhD,IAAI,CAAC,cAAc,GAAG,cAAc,CAAA;QACpC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAA;QACpC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;QAChC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAA;QACxC,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAA;QAC9C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAA;QAC9C,IAAI,CAAC,uBAAuB,GAAG,uBAAuB,CAAA;IACxD,CAAC;IAED;;;OAGG;IACI,sBAAsB;QAC3B,IAAI,CAAC,cAAc,CAAC,SAAS,GAAG,4BAA4B,CAAA;QAC5D,I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C,GAAG,CAAC,QAAQ,CAAC,CAAA;QAClC,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QACjC,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ButtonState defines the possible states of the recorder button.
|
|
3
|
+
* It includes IDLE, RECORDING, CANCEL, SENT and LOADING states.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum ButtonState {
|
|
6
|
+
IDLE = "IDLE",
|
|
7
|
+
RECORDING = "RECORDING",
|
|
8
|
+
CANCEL = "CANCEL",
|
|
9
|
+
SENT = "SENT",
|
|
10
|
+
LOADING = "LOADING",
|
|
11
|
+
CONTINUOUS_DEBUGGING = "CONTINUOUS_DEBUGGING"
|
|
12
|
+
}
|
|
13
|
+
export declare enum ContinuousRecordingSaveButtonState {
|
|
14
|
+
IDLE = "IDLE",
|
|
15
|
+
SAVING = "SAVING",
|
|
16
|
+
SAVED = "SAVED",
|
|
17
|
+
ERROR = "ERROR"
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* buttonStates object provides properties for each button state:
|
|
21
|
+
* IDLE, RECORDING, CANCEL, and SENT.
|
|
22
|
+
*/
|
|
23
|
+
export declare const buttonStates: {
|
|
24
|
+
IDLE: {
|
|
25
|
+
icon: string;
|
|
26
|
+
tooltip: string;
|
|
27
|
+
classes: never[];
|
|
28
|
+
excludeClasses: string[];
|
|
29
|
+
};
|
|
30
|
+
RECORDING: {
|
|
31
|
+
icon: string;
|
|
32
|
+
tooltip: string;
|
|
33
|
+
classes: never[];
|
|
34
|
+
excludeClasses: string[];
|
|
35
|
+
};
|
|
36
|
+
CANCEL: {
|
|
37
|
+
icon: string;
|
|
38
|
+
tooltip: string;
|
|
39
|
+
classes: never[];
|
|
40
|
+
excludeClasses: string[];
|
|
41
|
+
};
|
|
42
|
+
SENT: {
|
|
43
|
+
icon: string;
|
|
44
|
+
tooltip: string;
|
|
45
|
+
classes: string[];
|
|
46
|
+
excludeClasses: string[];
|
|
47
|
+
};
|
|
48
|
+
LOADING: {
|
|
49
|
+
icon: string;
|
|
50
|
+
tooltip: string;
|
|
51
|
+
classes: never[];
|
|
52
|
+
excludeClasses: string[];
|
|
53
|
+
};
|
|
54
|
+
CONTINUOUS_DEBUGGING: {
|
|
55
|
+
icon: string;
|
|
56
|
+
tooltip: string;
|
|
57
|
+
classes: never[];
|
|
58
|
+
excludeClasses: string[];
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
export declare const continuousRecordingSaveButtonStates: {
|
|
62
|
+
IDLE: {
|
|
63
|
+
textContent: string;
|
|
64
|
+
disabled: boolean;
|
|
65
|
+
classes: never[];
|
|
66
|
+
};
|
|
67
|
+
SAVING: {
|
|
68
|
+
disabled: boolean;
|
|
69
|
+
textContent: string;
|
|
70
|
+
classes: never[];
|
|
71
|
+
};
|
|
72
|
+
SAVED: {
|
|
73
|
+
disabled: boolean;
|
|
74
|
+
textContent: string;
|
|
75
|
+
classes: never[];
|
|
76
|
+
};
|
|
77
|
+
ERROR: {
|
|
78
|
+
disabled: boolean;
|
|
79
|
+
textContent: string;
|
|
80
|
+
classes: never[];
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=buttonStateConfigs.d.ts.map
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { CapturingIcon, CheckmarkIcon, CloseIcon, RecordIcon } from './templates/icons';
|
|
2
|
+
/**
|
|
3
|
+
* ButtonState defines the possible states of the recorder button.
|
|
4
|
+
* It includes IDLE, RECORDING, CANCEL, SENT and LOADING states.
|
|
5
|
+
*/
|
|
6
|
+
export var ButtonState;
|
|
7
|
+
(function (ButtonState) {
|
|
8
|
+
ButtonState["IDLE"] = "IDLE";
|
|
9
|
+
ButtonState["RECORDING"] = "RECORDING";
|
|
10
|
+
ButtonState["CANCEL"] = "CANCEL";
|
|
11
|
+
ButtonState["SENT"] = "SENT";
|
|
12
|
+
ButtonState["LOADING"] = "LOADING";
|
|
13
|
+
ButtonState["CONTINUOUS_DEBUGGING"] = "CONTINUOUS_DEBUGGING";
|
|
14
|
+
})(ButtonState || (ButtonState = {}));
|
|
15
|
+
export var ContinuousRecordingSaveButtonState;
|
|
16
|
+
(function (ContinuousRecordingSaveButtonState) {
|
|
17
|
+
ContinuousRecordingSaveButtonState["IDLE"] = "IDLE";
|
|
18
|
+
ContinuousRecordingSaveButtonState["SAVING"] = "SAVING";
|
|
19
|
+
ContinuousRecordingSaveButtonState["SAVED"] = "SAVED";
|
|
20
|
+
ContinuousRecordingSaveButtonState["ERROR"] = "ERROR";
|
|
21
|
+
})(ContinuousRecordingSaveButtonState || (ContinuousRecordingSaveButtonState = {}));
|
|
22
|
+
/**
|
|
23
|
+
* buttonStates object provides properties for each button state:
|
|
24
|
+
* IDLE, RECORDING, CANCEL, and SENT.
|
|
25
|
+
*/
|
|
26
|
+
export const buttonStates = {
|
|
27
|
+
[ButtonState.IDLE]: {
|
|
28
|
+
icon: RecordIcon,
|
|
29
|
+
tooltip: 'Record an issue',
|
|
30
|
+
classes: [],
|
|
31
|
+
excludeClasses: ['animate-rotate', 'mp-button-blue'],
|
|
32
|
+
},
|
|
33
|
+
[ButtonState.RECORDING]: {
|
|
34
|
+
icon: CapturingIcon,
|
|
35
|
+
tooltip: 'The session is recording. Click to end.',
|
|
36
|
+
classes: [],
|
|
37
|
+
excludeClasses: ['mp-button-blue', 'animate-rotate'],
|
|
38
|
+
},
|
|
39
|
+
[ButtonState.CANCEL]: {
|
|
40
|
+
icon: CloseIcon,
|
|
41
|
+
tooltip: 'Click to cancel',
|
|
42
|
+
classes: [],
|
|
43
|
+
excludeClasses: ['animate-rotate', 'mp-button-blue'],
|
|
44
|
+
},
|
|
45
|
+
[ButtonState.SENT]: {
|
|
46
|
+
icon: CheckmarkIcon,
|
|
47
|
+
tooltip: 'We\'ve sent it over! Thanks!',
|
|
48
|
+
classes: ['mp-button-blue'],
|
|
49
|
+
excludeClasses: ['animate-rotate'],
|
|
50
|
+
},
|
|
51
|
+
[ButtonState.LOADING]: {
|
|
52
|
+
icon: RecordIcon,
|
|
53
|
+
tooltip: 'Starting to record...',
|
|
54
|
+
classes: [],
|
|
55
|
+
excludeClasses: ['animate-rotate', 'mp-button-blue'],
|
|
56
|
+
},
|
|
57
|
+
[ButtonState.CONTINUOUS_DEBUGGING]: {
|
|
58
|
+
icon: CapturingIcon,
|
|
59
|
+
tooltip: 'You’re continuously recording.',
|
|
60
|
+
classes: [],
|
|
61
|
+
excludeClasses: ['mp-button-blue', 'animate-rotate'],
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
export const continuousRecordingSaveButtonStates = {
|
|
65
|
+
[ContinuousRecordingSaveButtonState.IDLE]: {
|
|
66
|
+
textContent: 'Save recording',
|
|
67
|
+
disabled: false,
|
|
68
|
+
classes: [],
|
|
69
|
+
},
|
|
70
|
+
[ContinuousRecordingSaveButtonState.SAVING]: {
|
|
71
|
+
disabled: true,
|
|
72
|
+
textContent: 'Saving recording...',
|
|
73
|
+
classes: [],
|
|
74
|
+
},
|
|
75
|
+
[ContinuousRecordingSaveButtonState.SAVED]: {
|
|
76
|
+
disabled: true,
|
|
77
|
+
textContent: 'Saved',
|
|
78
|
+
classes: [],
|
|
79
|
+
},
|
|
80
|
+
[ContinuousRecordingSaveButtonState.ERROR]: {
|
|
81
|
+
disabled: true,
|
|
82
|
+
textContent: 'Error saving the recording',
|
|
83
|
+
classes: [],
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=buttonStateConfigs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buttonStateConfigs.js","sourceRoot":"","sources":["../../src/sessionWidget/buttonStateConfigs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEvF;;;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C,OAAO,EAAE,EAAE;QACX,cAAc,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;KACrD;IACD,CAAC,WAAW,CAAC,oBAAoB,CAAC,EAAE;QAClC,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,gCAAgC;QACzC,OAAO,EAAE,EAAE;QACX,cAAc,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;KACrD;CACF,CAAA;AAED,MAAM,CAAC,MAAM,mCAAmC,GAAG;IACjD,CAAC,kCAAkC,CAAC,IAAI,CAAC,EAAE;QACzC,WAAW,EAAE,gBAAgB;QAC7B,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,EAAE;KACZ;IACD,CAAC,kCAAkC,CAAC,MAAM,CAAC,EAAE;QAC3C,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,qBAAqB;QAClC,OAAO,EAAE,EAAE;KACZ;IACD,CAAC,kCAAkC,CAAC,KAAK,CAAC,EAAE;QAC1C,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,OAAO;QACpB,OAAO,EAAE,EAAE;KACZ;IACD,CAAC,kCAAkC,CAAC,KAAK,CAAC,EAAE;QAC1C,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,4BAA4B;QACzC,OAAO,EAAE,EAAE;KACZ;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/sessionWidget/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAA;AAChC,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAA;AACtC,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAA;AAC9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,6BAA6B,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class DragManager {
|
|
2
|
+
private isDragging;
|
|
3
|
+
private dragStarted;
|
|
4
|
+
private isOnLeftHalfOfScreen;
|
|
5
|
+
private recorderButton;
|
|
6
|
+
private recorderPlacement;
|
|
7
|
+
private onDragEnd;
|
|
8
|
+
private updatePopoverPosition;
|
|
9
|
+
private onRecordingButtonClick;
|
|
10
|
+
constructor(recorderButton: HTMLButtonElement, recorderPlacement: string, onDragEnd?: (isDragging: boolean, isDragStarted: boolean, isOnLeftHalfOfScreen: boolean) => void, updatePopoverPosition?: () => void, onRecordingButtonClick?: (e: MouseEvent) => void);
|
|
11
|
+
init(): void;
|
|
12
|
+
private loadStoredPosition;
|
|
13
|
+
private savePosition;
|
|
14
|
+
private setupDragListeners;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=dragManager.d.ts.map
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { POSITION_STATE_KEY } from './constants';
|
|
2
|
+
export class DragManager {
|
|
3
|
+
constructor(recorderButton, recorderPlacement, onDragEnd = () => { }, updatePopoverPosition = () => { }, onRecordingButtonClick = () => { }) {
|
|
4
|
+
this.isDragging = false;
|
|
5
|
+
this.dragStarted = false;
|
|
6
|
+
this.isOnLeftHalfOfScreen = false;
|
|
7
|
+
this.recorderButton = recorderButton;
|
|
8
|
+
this.recorderPlacement = recorderPlacement;
|
|
9
|
+
this.onDragEnd = onDragEnd;
|
|
10
|
+
this.updatePopoverPosition = updatePopoverPosition;
|
|
11
|
+
this.onRecordingButtonClick = onRecordingButtonClick;
|
|
12
|
+
}
|
|
13
|
+
init() {
|
|
14
|
+
this.loadStoredPosition();
|
|
15
|
+
this.setupDragListeners();
|
|
16
|
+
}
|
|
17
|
+
loadStoredPosition() {
|
|
18
|
+
const savedPosition = localStorage.getItem(POSITION_STATE_KEY);
|
|
19
|
+
if (!savedPosition) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
let { right, bottom } = JSON.parse(savedPosition);
|
|
23
|
+
if (right == null || bottom == null) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
// Check for old stored values (decimals) from localStorage
|
|
27
|
+
const isStoredAsDecimal = right > 0 && right <= 1 && bottom > 0 && bottom <= 1;
|
|
28
|
+
if (isStoredAsDecimal) {
|
|
29
|
+
right = right * window.innerWidth;
|
|
30
|
+
bottom = bottom * window.innerHeight;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
right = (right / 100) * window.innerWidth;
|
|
34
|
+
bottom = (bottom / 100) * window.innerHeight;
|
|
35
|
+
}
|
|
36
|
+
right = Math.min(Math.max(right, 0), window.innerWidth);
|
|
37
|
+
bottom = Math.min(Math.max(bottom, 0), window.innerHeight);
|
|
38
|
+
requestAnimationFrame(() => {
|
|
39
|
+
this.recorderButton.classList.remove(this.recorderPlacement);
|
|
40
|
+
this.recorderButton.style.right = `${right}px`;
|
|
41
|
+
this.recorderButton.style.bottom = `${bottom}px`;
|
|
42
|
+
this.isOnLeftHalfOfScreen = right > window.innerWidth / 2;
|
|
43
|
+
this.recorderButton.classList.toggle('button-leftside', this.isOnLeftHalfOfScreen);
|
|
44
|
+
this.updatePopoverPosition();
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
savePosition(r, b) {
|
|
48
|
+
const right = (r / window.innerWidth) * 100;
|
|
49
|
+
const bottom = (b / window.innerHeight) * 100;
|
|
50
|
+
localStorage.setItem(POSITION_STATE_KEY, JSON.stringify({ right, bottom }));
|
|
51
|
+
}
|
|
52
|
+
setupDragListeners() {
|
|
53
|
+
this.recorderButton.addEventListener('mousedown', (e) => {
|
|
54
|
+
const onMouseUp = () => {
|
|
55
|
+
const isDraggable = !this.recorderButton.classList.contains('no-draggable');
|
|
56
|
+
if (this.isDragging || !isDraggable) {
|
|
57
|
+
this.recorderButton.classList.toggle('button-leftside', this.isOnLeftHalfOfScreen);
|
|
58
|
+
this.isDragging = false;
|
|
59
|
+
document.body.style.userSelect = '';
|
|
60
|
+
if (isDraggable) {
|
|
61
|
+
const finalRight = parseFloat(this.recorderButton.style.right);
|
|
62
|
+
const finalBottom = parseFloat(this.recorderButton.style.bottom);
|
|
63
|
+
this.savePosition(finalRight, finalBottom);
|
|
64
|
+
document.removeEventListener('mousemove', onMouseMove);
|
|
65
|
+
}
|
|
66
|
+
if (!this.dragStarted) {
|
|
67
|
+
this.updatePopoverPosition();
|
|
68
|
+
this.onRecordingButtonClick(e);
|
|
69
|
+
}
|
|
70
|
+
this.onDragEnd(this.isDragging, this.dragStarted, this.isOnLeftHalfOfScreen);
|
|
71
|
+
}
|
|
72
|
+
this.recorderButton.classList.remove('no-hover');
|
|
73
|
+
document.removeEventListener('mouseup', onMouseUp);
|
|
74
|
+
};
|
|
75
|
+
if (this.recorderButton.classList.contains('no-draggable')) {
|
|
76
|
+
this.isDragging = false;
|
|
77
|
+
this.dragStarted = false;
|
|
78
|
+
document.addEventListener('mouseup', onMouseUp);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
this.recorderButton.classList.add('no-hover');
|
|
82
|
+
this.isDragging = true;
|
|
83
|
+
this.dragStarted = false;
|
|
84
|
+
const startX = e.clientX;
|
|
85
|
+
const startY = e.clientY;
|
|
86
|
+
const buttonRect = this.recorderButton.getBoundingClientRect();
|
|
87
|
+
const viewportWidth = window.innerWidth;
|
|
88
|
+
const viewportHeight = window.innerHeight;
|
|
89
|
+
const onMouseMove = (moveEvent) => {
|
|
90
|
+
const deltaX = moveEvent.clientX - startX;
|
|
91
|
+
const deltaY = moveEvent.clientY - startY;
|
|
92
|
+
// If mouse moved significantly, consider it a drag
|
|
93
|
+
if (Math.abs(deltaX) > 3 || Math.abs(deltaY) > 3) {
|
|
94
|
+
this.dragStarted = true;
|
|
95
|
+
this.recorderButton.classList.remove(this.recorderPlacement);
|
|
96
|
+
const newLeft = Math.max(0, Math.min(viewportWidth - buttonRect.width, buttonRect.left + deltaX));
|
|
97
|
+
const newTop = Math.max(0, Math.min(viewportHeight - buttonRect.height, buttonRect.top + deltaY));
|
|
98
|
+
const newRight = viewportWidth - newLeft - buttonRect.width;
|
|
99
|
+
const newBottom = viewportHeight - newTop - buttonRect.height;
|
|
100
|
+
this.isOnLeftHalfOfScreen = newRight > viewportWidth / 2;
|
|
101
|
+
requestAnimationFrame(() => {
|
|
102
|
+
this.recorderButton.style.right = `${newRight}px`;
|
|
103
|
+
this.recorderButton.style.bottom = `${newBottom}px`;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
document.addEventListener('mousemove', onMouseMove);
|
|
108
|
+
document.addEventListener('mouseup', onMouseUp);
|
|
109
|
+
document.body.style.userSelect = 'none';
|
|
110
|
+
e.preventDefault();
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=dragManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dragManager.js","sourceRoot":"","sources":["../../src/sessionWidget/dragManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEhD,MAAM,OAAO,WAAW;IAUtB,YACE,cAAiC,EACjC,iBAAyB,EACzB,YAAkG,GAAG,EAAE,GAAG,CAAC,EAC3G,wBAAoC,GAAG,EAAE,GAAG,CAAC,EAC7C,yBAAkD,GAAG,EAAE,GAAG,CAAC;QAdrD,eAAU,GAAY,KAAK,CAAA;QAC3B,gBAAW,GAAY,KAAK,CAAA;QAC5B,yBAAoB,GAAY,KAAK,CAAA;QAc3C,IAAI,CAAC,cAAc,GAAG,cAAc,CAAA;QACpC,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAA;QAC1C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAA;QAClD,IAAI,CAAC,sBAAsB,GAAG,sBAAsB,CAAA;IACtD,CAAC;IAEM,IAAI;QACT,IAAI,CAAC,kBAAkB,EAAE,CAAA;QACzB,IAAI,CAAC,kBAAkB,EAAE,CAAA;IAC3B,CAAC;IAEO,kBAAkB;QACxB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BACzB,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,QAAQ,IAAI,CAAA;wBACjD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,SAAS,IAAI,CAAA;oBACrD,CAAC,CAAC,CAAA;gBACJ,CAAC;YACH,CAAC,CAAA;YAED,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAA;YACnD,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;YAE/C,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,MAAM,CAAA;YACvC,CAAC,CAAC,cAAc,EAAE,CAAA;QACpB,CAAC,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import 'rrweb-player/dist/style.css';
|
|
2
|
+
import { Observable } from 'lib0/observable';
|
|
3
|
+
import { SessionWidgetConfig, SessionState, ToastConfig } from '../types';
|
|
4
|
+
import { ButtonState, ContinuousRecordingSaveButtonState } from './buttonStateConfigs';
|
|
5
|
+
type SessionWidgetEvents = 'toggle' | 'pause' | 'resume' | 'cancel' | 'continuous-debugging' | 'save';
|
|
6
|
+
export declare class SessionWidget extends Observable<SessionWidgetEvents> {
|
|
7
|
+
readonly recorderButton: HTMLButtonElement;
|
|
8
|
+
private readonly initialPopover;
|
|
9
|
+
private readonly finalPopover;
|
|
10
|
+
private readonly overlay;
|
|
11
|
+
private readonly submitSessionDialog;
|
|
12
|
+
private readonly toast;
|
|
13
|
+
private _isStarted;
|
|
14
|
+
private _isPaused;
|
|
15
|
+
private _isInitialized;
|
|
16
|
+
private _recorderPlacement;
|
|
17
|
+
private _error;
|
|
18
|
+
private _initialPopoverVisible;
|
|
19
|
+
private _finalPopoverVisible;
|
|
20
|
+
private _buttonState;
|
|
21
|
+
private _continuousRecording;
|
|
22
|
+
private _showContinuousRecording;
|
|
23
|
+
private _widgetTextOverrides;
|
|
24
|
+
private uiManager;
|
|
25
|
+
private readonly commentTextarea;
|
|
26
|
+
private buttonDraggabilityObserver;
|
|
27
|
+
private dragManager;
|
|
28
|
+
buttonClickExternalHandler: (() => boolean | void) | null;
|
|
29
|
+
showRecorderButton: boolean;
|
|
30
|
+
timerInterval: any;
|
|
31
|
+
seconds: number;
|
|
32
|
+
set buttonState(newState: ButtonState);
|
|
33
|
+
private set initialPopoverVisible(value);
|
|
34
|
+
private set finalPopoverVisible(value);
|
|
35
|
+
get error(): string;
|
|
36
|
+
set error(v: string);
|
|
37
|
+
set isStarted(v: boolean);
|
|
38
|
+
set isPaused(v: boolean);
|
|
39
|
+
constructor();
|
|
40
|
+
updateState(state: SessionState | null, continuousRecording: boolean): void;
|
|
41
|
+
updateContinuousRecordingState(checked: boolean, disabled?: boolean): void;
|
|
42
|
+
updateSaveContinuousDebugSessionState(state: ContinuousRecordingSaveButtonState): void;
|
|
43
|
+
/**
|
|
44
|
+
* Shows a toast message with optional action button
|
|
45
|
+
* @param config - The toast configuration including message, type, and optional button
|
|
46
|
+
* @param duration - Duration in milliseconds to show the toast (default: 10000ms)
|
|
47
|
+
*/
|
|
48
|
+
showToast(config: ToastConfig, duration?: number): void;
|
|
49
|
+
/**
|
|
50
|
+
* Hides the currently displayed toast message
|
|
51
|
+
*/
|
|
52
|
+
hideToast(): void;
|
|
53
|
+
private handleClickOutside;
|
|
54
|
+
private observeButtonDraggableMode;
|
|
55
|
+
init(options: SessionWidgetConfig): void;
|
|
56
|
+
private appendElements;
|
|
57
|
+
private addRecorderDragFunctionality;
|
|
58
|
+
private updatePopoverPosition;
|
|
59
|
+
private addEventListeners;
|
|
60
|
+
private handleStopRecording;
|
|
61
|
+
handleUIReseting(): void;
|
|
62
|
+
private handleCloseInitialPopover;
|
|
63
|
+
private handleCloseFinalPopover;
|
|
64
|
+
onRequestError(): void;
|
|
65
|
+
private handleDismissRecording;
|
|
66
|
+
private resetRecordingButton;
|
|
67
|
+
private addListener;
|
|
68
|
+
private onRecordingButtonClick;
|
|
69
|
+
private updateButton;
|
|
70
|
+
private handleContinuousRecordingChange;
|
|
71
|
+
private handleSaveContinuousDebugSession;
|
|
72
|
+
private startRecording;
|
|
73
|
+
private onStart;
|
|
74
|
+
private onStop;
|
|
75
|
+
private onPause;
|
|
76
|
+
private onResume;
|
|
77
|
+
private onCancel;
|
|
78
|
+
enable(): void;
|
|
79
|
+
disable(): void;
|
|
80
|
+
destroy(): void;
|
|
81
|
+
startTimer(): void;
|
|
82
|
+
stopTimer(): void;
|
|
83
|
+
makeOverlayDraggable(): void;
|
|
84
|
+
}
|
|
85
|
+
export {};
|
|
86
|
+
//# sourceMappingURL=index.d.ts.map
|