@multiplayer-app/session-recorder-browser 2.0.85 → 2.0.88
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/config/constants.d.ts +2 -1
- package/dist/config/constants.js +3 -1
- package/dist/config/defaults.js +9 -0
- package/dist/config/session-recorder.js +10 -1
- package/dist/index.js +167 -57
- package/dist/index.umd.js +167 -57
- package/dist/session-recorder.js +83 -38
- package/dist/sessionWidget/UIManager.js +7 -4
- package/dist/sessionWidget/buttonStateConfigs.d.ts +15 -0
- package/dist/sessionWidget/buttonStateConfigs.js +40 -0
- package/dist/sessionWidget/index.js +17 -18
- package/dist/types/session-recorder.d.ts +18 -0
- package/package.json +6 -4
|
@@ -11,9 +11,10 @@ export declare const SESSION_UNSUBSCRIBE_EVENT = "debug-session:unsubscribe";
|
|
|
11
11
|
export declare const SESSION_AUTO_CREATED = "debug-session:auto-created";
|
|
12
12
|
export declare const SESSION_ADD_EVENT = "debug-session:rrweb:add-event";
|
|
13
13
|
export declare const SESSION_SAVE_BUFFER_EVENT = "debug-session:save-buffer";
|
|
14
|
+
export declare const SESSION_READY_EVENT = "debug-session:ready";
|
|
15
|
+
export declare const SESSION_READY_EVENT_LEGACY = "debug-session-ready";
|
|
14
16
|
export declare const SOCKET_SET_USER_EVENT = "socket:set-user";
|
|
15
17
|
export declare const DEFAULT_MAX_HTTP_CAPTURING_PAYLOAD_SIZE = 100000;
|
|
16
|
-
export declare const SESSION_READY_EVENT = "debug-session-ready";
|
|
17
18
|
export declare const CONTINUOUS_DEBUGGING_TIMEOUT = 60000;
|
|
18
19
|
export declare const DEBUG_SESSION_MAX_DURATION_SECONDS: number;
|
|
19
20
|
export declare const REMOTE_SESSION_RECORDING_START = "remote-session-recording:start";
|
package/dist/config/constants.js
CHANGED
|
@@ -12,9 +12,11 @@ export const SESSION_AUTO_CREATED = 'debug-session:auto-created';
|
|
|
12
12
|
export const SESSION_ADD_EVENT = 'debug-session:rrweb:add-event';
|
|
13
13
|
// Backend-triggered flush of client-side crash buffer
|
|
14
14
|
export const SESSION_SAVE_BUFFER_EVENT = 'debug-session:save-buffer';
|
|
15
|
+
export const SESSION_READY_EVENT = 'debug-session:ready';
|
|
16
|
+
// Deprecated event name for backwards compatibility
|
|
17
|
+
export const SESSION_READY_EVENT_LEGACY = 'debug-session-ready';
|
|
15
18
|
export const SOCKET_SET_USER_EVENT = 'socket:set-user';
|
|
16
19
|
export const DEFAULT_MAX_HTTP_CAPTURING_PAYLOAD_SIZE = 100000;
|
|
17
|
-
export const SESSION_READY_EVENT = 'debug-session-ready';
|
|
18
20
|
export const CONTINUOUS_DEBUGGING_TIMEOUT = 60000; // 1 minutes
|
|
19
21
|
export const DEBUG_SESSION_MAX_DURATION_SECONDS = 10 * 60 + 30; // TODO: move to shared config otel core
|
|
20
22
|
export const REMOTE_SESSION_RECORDING_START = 'remote-session-recording:start';
|
package/dist/config/defaults.js
CHANGED
|
@@ -33,6 +33,15 @@ export const DEFAULT_WIDGET_TEXT_CONFIG = {
|
|
|
33
33
|
submitDialogCommentPlaceholder: 'Add a message...',
|
|
34
34
|
submitDialogSubmitText: 'Save',
|
|
35
35
|
submitDialogCancelText: 'Cancel',
|
|
36
|
+
buttonTooltipIdle: 'Record an issue',
|
|
37
|
+
buttonTooltipRecording: 'The session is recording. Click to end.',
|
|
38
|
+
buttonTooltipCancel: 'Click to cancel',
|
|
39
|
+
buttonTooltipSent: 'We\'ve sent it over! Thanks!',
|
|
40
|
+
buttonTooltipLoading: 'Starting to record...',
|
|
41
|
+
buttonTooltipContinuousDebugging: 'You’re continuously recording.',
|
|
42
|
+
saveContinuousRecordingSavingText: 'Saving recording...',
|
|
43
|
+
saveContinuousRecordingSavedText: 'Saved',
|
|
44
|
+
saveContinuousRecordingErrorText: 'Error saving the recording',
|
|
36
45
|
};
|
|
37
46
|
export const BASE_CONFIG = {
|
|
38
47
|
apiKey: '',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WidgetButtonPlacement } from '../types';
|
|
2
2
|
import { BASE_CONFIG } from './defaults';
|
|
3
3
|
import { getMaskingConfig } from './masking';
|
|
4
|
-
import { isValidString, isValidNumber, isValidBoolean, isValidArray, isValidEnum
|
|
4
|
+
import { isValidString, isValidNumber, isValidBoolean, isValidArray, isValidEnum } from './validators';
|
|
5
5
|
const getWidgetTextOverridesConfig = (config, defaultConfig) => {
|
|
6
6
|
if (!config || typeof config !== 'object') {
|
|
7
7
|
return defaultConfig;
|
|
@@ -27,6 +27,15 @@ const getWidgetTextOverridesConfig = (config, defaultConfig) => {
|
|
|
27
27
|
submitDialogCommentPlaceholder: isValidString(config.submitDialogCommentPlaceholder, defaultConfig.submitDialogCommentPlaceholder),
|
|
28
28
|
submitDialogSubmitText: isValidString(config.submitDialogSubmitText, defaultConfig.submitDialogSubmitText),
|
|
29
29
|
submitDialogCancelText: isValidString(config.submitDialogCancelText, defaultConfig.submitDialogCancelText),
|
|
30
|
+
buttonTooltipIdle: isValidString(config.buttonTooltipIdle, defaultConfig.buttonTooltipIdle),
|
|
31
|
+
buttonTooltipRecording: isValidString(config.buttonTooltipRecording, defaultConfig.buttonTooltipRecording),
|
|
32
|
+
buttonTooltipCancel: isValidString(config.buttonTooltipCancel, defaultConfig.buttonTooltipCancel),
|
|
33
|
+
buttonTooltipSent: isValidString(config.buttonTooltipSent, defaultConfig.buttonTooltipSent),
|
|
34
|
+
buttonTooltipLoading: isValidString(config.buttonTooltipLoading, defaultConfig.buttonTooltipLoading),
|
|
35
|
+
buttonTooltipContinuousDebugging: isValidString(config.buttonTooltipContinuousDebugging, defaultConfig.buttonTooltipContinuousDebugging),
|
|
36
|
+
saveContinuousRecordingSavingText: isValidString(config.saveContinuousRecordingSavingText, defaultConfig.saveContinuousRecordingSavingText),
|
|
37
|
+
saveContinuousRecordingSavedText: isValidString(config.saveContinuousRecordingSavedText, defaultConfig.saveContinuousRecordingSavedText),
|
|
38
|
+
saveContinuousRecordingErrorText: isValidString(config.saveContinuousRecordingErrorText, defaultConfig.saveContinuousRecordingErrorText),
|
|
30
39
|
};
|
|
31
40
|
};
|
|
32
41
|
export const getSessionRecorderConfig = (c) => {
|
package/dist/index.js
CHANGED
|
@@ -7030,6 +7030,7 @@ module.exports = {
|
|
|
7030
7030
|
/* harmony export */ SESSION_ID_PROP_NAME: () => (/* binding */ SESSION_ID_PROP_NAME),
|
|
7031
7031
|
/* harmony export */ SESSION_PROP_NAME: () => (/* binding */ SESSION_PROP_NAME),
|
|
7032
7032
|
/* harmony export */ SESSION_READY_EVENT: () => (/* binding */ SESSION_READY_EVENT),
|
|
7033
|
+
/* harmony export */ SESSION_READY_EVENT_LEGACY: () => (/* binding */ SESSION_READY_EVENT_LEGACY),
|
|
7033
7034
|
/* harmony export */ SESSION_SAVE_BUFFER_EVENT: () => (/* binding */ SESSION_SAVE_BUFFER_EVENT),
|
|
7034
7035
|
/* harmony export */ SESSION_STARTED_EVENT: () => (/* binding */ SESSION_STARTED_EVENT),
|
|
7035
7036
|
/* harmony export */ SESSION_STATE_PROP_NAME: () => (/* binding */ SESSION_STATE_PROP_NAME),
|
|
@@ -7054,14 +7055,16 @@ const SESSION_AUTO_CREATED = 'debug-session:auto-created';
|
|
|
7054
7055
|
const SESSION_ADD_EVENT = 'debug-session:rrweb:add-event';
|
|
7055
7056
|
// Backend-triggered flush of client-side crash buffer
|
|
7056
7057
|
const SESSION_SAVE_BUFFER_EVENT = 'debug-session:save-buffer';
|
|
7058
|
+
const SESSION_READY_EVENT = 'debug-session:ready';
|
|
7059
|
+
// Deprecated event name for backwards compatibility
|
|
7060
|
+
const SESSION_READY_EVENT_LEGACY = 'debug-session-ready';
|
|
7057
7061
|
const SOCKET_SET_USER_EVENT = 'socket:set-user';
|
|
7058
7062
|
const DEFAULT_MAX_HTTP_CAPTURING_PAYLOAD_SIZE = 100000;
|
|
7059
|
-
const SESSION_READY_EVENT = 'debug-session-ready';
|
|
7060
7063
|
const CONTINUOUS_DEBUGGING_TIMEOUT = 60000; // 1 minutes
|
|
7061
7064
|
const DEBUG_SESSION_MAX_DURATION_SECONDS = 10 * 60 + 30; // TODO: move to shared config otel core
|
|
7062
7065
|
const REMOTE_SESSION_RECORDING_START = 'remote-session-recording:start';
|
|
7063
7066
|
const REMOTE_SESSION_RECORDING_STOP = 'remote-session-recording:stop';
|
|
7064
|
-
const PACKAGE_VERSION_EXPORT = "2.0.
|
|
7067
|
+
const PACKAGE_VERSION_EXPORT = "2.0.88" || 0;
|
|
7065
7068
|
// Regex patterns for OpenTelemetry ignore URLs
|
|
7066
7069
|
const OTEL_IGNORE_URLS = [
|
|
7067
7070
|
// Traces endpoint
|
|
@@ -7132,6 +7135,15 @@ const DEFAULT_WIDGET_TEXT_CONFIG = {
|
|
|
7132
7135
|
submitDialogCommentPlaceholder: 'Add a message...',
|
|
7133
7136
|
submitDialogSubmitText: 'Save',
|
|
7134
7137
|
submitDialogCancelText: 'Cancel',
|
|
7138
|
+
buttonTooltipIdle: 'Record an issue',
|
|
7139
|
+
buttonTooltipRecording: 'The session is recording. Click to end.',
|
|
7140
|
+
buttonTooltipCancel: 'Click to cancel',
|
|
7141
|
+
buttonTooltipSent: 'We\'ve sent it over! Thanks!',
|
|
7142
|
+
buttonTooltipLoading: 'Starting to record...',
|
|
7143
|
+
buttonTooltipContinuousDebugging: 'You’re continuously recording.',
|
|
7144
|
+
saveContinuousRecordingSavingText: 'Saving recording...',
|
|
7145
|
+
saveContinuousRecordingSavedText: 'Saved',
|
|
7146
|
+
saveContinuousRecordingErrorText: 'Error saving the recording',
|
|
7135
7147
|
};
|
|
7136
7148
|
const BASE_CONFIG = {
|
|
7137
7149
|
apiKey: '',
|
|
@@ -7190,6 +7202,7 @@ const BASE_CONFIG = {
|
|
|
7190
7202
|
/* harmony export */ SESSION_ID_PROP_NAME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.SESSION_ID_PROP_NAME),
|
|
7191
7203
|
/* harmony export */ SESSION_PROP_NAME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.SESSION_PROP_NAME),
|
|
7192
7204
|
/* harmony export */ SESSION_READY_EVENT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.SESSION_READY_EVENT),
|
|
7205
|
+
/* harmony export */ SESSION_READY_EVENT_LEGACY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.SESSION_READY_EVENT_LEGACY),
|
|
7193
7206
|
/* harmony export */ SESSION_SAVE_BUFFER_EVENT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.SESSION_SAVE_BUFFER_EVENT),
|
|
7194
7207
|
/* harmony export */ SESSION_STARTED_EVENT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.SESSION_STARTED_EVENT),
|
|
7195
7208
|
/* harmony export */ SESSION_STATE_PROP_NAME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.SESSION_STATE_PROP_NAME),
|
|
@@ -7302,6 +7315,15 @@ const getWidgetTextOverridesConfig = (config, defaultConfig) => {
|
|
|
7302
7315
|
submitDialogCommentPlaceholder: (0,_validators__WEBPACK_IMPORTED_MODULE_3__.isValidString)(config.submitDialogCommentPlaceholder, defaultConfig.submitDialogCommentPlaceholder),
|
|
7303
7316
|
submitDialogSubmitText: (0,_validators__WEBPACK_IMPORTED_MODULE_3__.isValidString)(config.submitDialogSubmitText, defaultConfig.submitDialogSubmitText),
|
|
7304
7317
|
submitDialogCancelText: (0,_validators__WEBPACK_IMPORTED_MODULE_3__.isValidString)(config.submitDialogCancelText, defaultConfig.submitDialogCancelText),
|
|
7318
|
+
buttonTooltipIdle: (0,_validators__WEBPACK_IMPORTED_MODULE_3__.isValidString)(config.buttonTooltipIdle, defaultConfig.buttonTooltipIdle),
|
|
7319
|
+
buttonTooltipRecording: (0,_validators__WEBPACK_IMPORTED_MODULE_3__.isValidString)(config.buttonTooltipRecording, defaultConfig.buttonTooltipRecording),
|
|
7320
|
+
buttonTooltipCancel: (0,_validators__WEBPACK_IMPORTED_MODULE_3__.isValidString)(config.buttonTooltipCancel, defaultConfig.buttonTooltipCancel),
|
|
7321
|
+
buttonTooltipSent: (0,_validators__WEBPACK_IMPORTED_MODULE_3__.isValidString)(config.buttonTooltipSent, defaultConfig.buttonTooltipSent),
|
|
7322
|
+
buttonTooltipLoading: (0,_validators__WEBPACK_IMPORTED_MODULE_3__.isValidString)(config.buttonTooltipLoading, defaultConfig.buttonTooltipLoading),
|
|
7323
|
+
buttonTooltipContinuousDebugging: (0,_validators__WEBPACK_IMPORTED_MODULE_3__.isValidString)(config.buttonTooltipContinuousDebugging, defaultConfig.buttonTooltipContinuousDebugging),
|
|
7324
|
+
saveContinuousRecordingSavingText: (0,_validators__WEBPACK_IMPORTED_MODULE_3__.isValidString)(config.saveContinuousRecordingSavingText, defaultConfig.saveContinuousRecordingSavingText),
|
|
7325
|
+
saveContinuousRecordingSavedText: (0,_validators__WEBPACK_IMPORTED_MODULE_3__.isValidString)(config.saveContinuousRecordingSavedText, defaultConfig.saveContinuousRecordingSavedText),
|
|
7326
|
+
saveContinuousRecordingErrorText: (0,_validators__WEBPACK_IMPORTED_MODULE_3__.isValidString)(config.saveContinuousRecordingErrorText, defaultConfig.saveContinuousRecordingErrorText),
|
|
7305
7327
|
};
|
|
7306
7328
|
};
|
|
7307
7329
|
const getSessionRecorderConfig = (c) => {
|
|
@@ -10260,7 +10282,10 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10260
10282
|
_services_messaging_service__WEBPACK_IMPORTED_MODULE_10__["default"].sendMessage('state-change', this._sessionState);
|
|
10261
10283
|
(0,_utils__WEBPACK_IMPORTED_MODULE_4__.setStoredItem)(_config__WEBPACK_IMPORTED_MODULE_6__.SESSION_STATE_PROP_NAME, state);
|
|
10262
10284
|
// Emit observable event to support React wrapper
|
|
10263
|
-
this.emit('state-change', [
|
|
10285
|
+
this.emit('state-change', [
|
|
10286
|
+
this._sessionState || _types__WEBPACK_IMPORTED_MODULE_5__.SessionState.stopped,
|
|
10287
|
+
this.sessionType,
|
|
10288
|
+
]);
|
|
10264
10289
|
}
|
|
10265
10290
|
get session() {
|
|
10266
10291
|
return this._session;
|
|
@@ -10331,10 +10356,18 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10331
10356
|
this._error = '';
|
|
10332
10357
|
// Safety: avoid accessing storage in SSR/non-browser environments
|
|
10333
10358
|
const isBrowser = typeof window !== 'undefined';
|
|
10334
|
-
const sessionLocal = isBrowser
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
const
|
|
10359
|
+
const sessionLocal = isBrowser
|
|
10360
|
+
? (0,_utils__WEBPACK_IMPORTED_MODULE_4__.getStoredItem)(_config__WEBPACK_IMPORTED_MODULE_6__.SESSION_PROP_NAME, true)
|
|
10361
|
+
: null;
|
|
10362
|
+
const sessionIdLocal = isBrowser
|
|
10363
|
+
? (0,_utils__WEBPACK_IMPORTED_MODULE_4__.getStoredItem)(_config__WEBPACK_IMPORTED_MODULE_6__.SESSION_ID_PROP_NAME)
|
|
10364
|
+
: null;
|
|
10365
|
+
const sessionStateLocal = isBrowser
|
|
10366
|
+
? (0,_utils__WEBPACK_IMPORTED_MODULE_4__.getStoredItem)(_config__WEBPACK_IMPORTED_MODULE_6__.SESSION_STATE_PROP_NAME)
|
|
10367
|
+
: null;
|
|
10368
|
+
const sessionTypeLocal = isBrowser
|
|
10369
|
+
? (0,_utils__WEBPACK_IMPORTED_MODULE_4__.getStoredItem)(_config__WEBPACK_IMPORTED_MODULE_6__.SESSION_TYPE_PROP_NAME)
|
|
10370
|
+
: null;
|
|
10338
10371
|
if ((0,_utils__WEBPACK_IMPORTED_MODULE_4__.isSessionActive)(sessionLocal, sessionTypeLocal)) {
|
|
10339
10372
|
this.session = sessionLocal;
|
|
10340
10373
|
this.sessionId = sessionIdLocal;
|
|
@@ -10366,7 +10399,8 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10366
10399
|
// GC: remove orphaned crash buffers from old tabs.
|
|
10367
10400
|
// Keep TTL large to avoid any accidental data loss.
|
|
10368
10401
|
void this._bufferDb.sweepStaleTabs(10 * 60 * 60 * 1000);
|
|
10369
|
-
(0,_patch__WEBPACK_IMPORTED_MODULE_7__.setMaxCapturingHttpPayloadSize)(this._configs.maxCapturingHttpPayloadSize ||
|
|
10402
|
+
(0,_patch__WEBPACK_IMPORTED_MODULE_7__.setMaxCapturingHttpPayloadSize)(this._configs.maxCapturingHttpPayloadSize ||
|
|
10403
|
+
_config__WEBPACK_IMPORTED_MODULE_6__.DEFAULT_MAX_HTTP_CAPTURING_PAYLOAD_SIZE);
|
|
10370
10404
|
(0,_patch__WEBPACK_IMPORTED_MODULE_7__.setShouldRecordHttpData)(this._configs.captureBody, this._configs.captureHeaders);
|
|
10371
10405
|
this._setupCrashBuffer();
|
|
10372
10406
|
this._tracer.init(this._configs);
|
|
@@ -10388,7 +10422,9 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10388
10422
|
if (this._configs.apiKey) {
|
|
10389
10423
|
this._recorder.init(this._configs, this._socketService);
|
|
10390
10424
|
}
|
|
10391
|
-
if (this.sessionId &&
|
|
10425
|
+
if (this.sessionId &&
|
|
10426
|
+
(this.sessionState === _types__WEBPACK_IMPORTED_MODULE_5__.SessionState.started ||
|
|
10427
|
+
this.sessionState === _types__WEBPACK_IMPORTED_MODULE_5__.SessionState.paused)) {
|
|
10392
10428
|
this._start();
|
|
10393
10429
|
}
|
|
10394
10430
|
else {
|
|
@@ -10442,7 +10478,8 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10442
10478
|
return;
|
|
10443
10479
|
let hasFocus = true;
|
|
10444
10480
|
try {
|
|
10445
|
-
hasFocus =
|
|
10481
|
+
hasFocus =
|
|
10482
|
+
typeof document.hasFocus === 'function' ? document.hasFocus() : true;
|
|
10446
10483
|
}
|
|
10447
10484
|
catch (_e) {
|
|
10448
10485
|
hasFocus = true;
|
|
@@ -10464,7 +10501,9 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10464
10501
|
// stop, leaving the buffer with no FullSnapshot and silently breaking
|
|
10465
10502
|
// exception-triggered flushBuffer. `_recorder.restart(null, ...)` passes
|
|
10466
10503
|
// null explicitly, so it's safe regardless of `this.sessionId`.
|
|
10467
|
-
if (!this._crashBuffer ||
|
|
10504
|
+
if (!this._crashBuffer ||
|
|
10505
|
+
!((_b = (_a = this._configs) === null || _a === void 0 ? void 0 : _a.buffering) === null || _b === void 0 ? void 0 : _b.enabled) ||
|
|
10506
|
+
this.sessionState !== _types__WEBPACK_IMPORTED_MODULE_5__.SessionState.stopped) {
|
|
10468
10507
|
return;
|
|
10469
10508
|
}
|
|
10470
10509
|
void this._recorder.restart(null, _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.MANUAL);
|
|
@@ -10515,7 +10554,8 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10515
10554
|
start(type = _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.MANUAL, session) {
|
|
10516
10555
|
this._checkOperation('start');
|
|
10517
10556
|
// If continuous recording is disabled, force plain mode
|
|
10518
|
-
if (type === _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.CONTINUOUS &&
|
|
10557
|
+
if (type === _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.CONTINUOUS &&
|
|
10558
|
+
!this._configs.showContinuousRecording) {
|
|
10519
10559
|
type = _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.MANUAL;
|
|
10520
10560
|
}
|
|
10521
10561
|
this.sessionType = type;
|
|
@@ -10546,7 +10586,8 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10546
10586
|
stoppedAt: this._recorder.stoppedAt,
|
|
10547
10587
|
};
|
|
10548
10588
|
const response = await this._apiService.stopSession(sid, request);
|
|
10549
|
-
_eventBus__WEBPACK_IMPORTED_MODULE_8__.recorderEventBus.emit(_config__WEBPACK_IMPORTED_MODULE_6__.
|
|
10589
|
+
_eventBus__WEBPACK_IMPORTED_MODULE_8__.recorderEventBus.emit(_config__WEBPACK_IMPORTED_MODULE_6__.SESSION_READY_EVENT_LEGACY, response._id);
|
|
10590
|
+
_eventBus__WEBPACK_IMPORTED_MODULE_8__.recorderEventBus.emit(_config__WEBPACK_IMPORTED_MODULE_6__.SESSION_READY_EVENT, response);
|
|
10550
10591
|
}
|
|
10551
10592
|
}
|
|
10552
10593
|
catch (error) {
|
|
@@ -10642,8 +10683,8 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10642
10683
|
this.error = (e === null || e === void 0 ? void 0 : e.message) || 'Failed to capture exception';
|
|
10643
10684
|
}
|
|
10644
10685
|
}
|
|
10645
|
-
async _flushBuffer(
|
|
10646
|
-
if (!
|
|
10686
|
+
async _flushBuffer(session, force = false) {
|
|
10687
|
+
if (!session || !this._crashBuffer || this._isFlushingBuffer) {
|
|
10647
10688
|
return null;
|
|
10648
10689
|
}
|
|
10649
10690
|
this._isFlushingBuffer = true;
|
|
@@ -10654,8 +10695,10 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10654
10695
|
}
|
|
10655
10696
|
await Promise.all([
|
|
10656
10697
|
this._tracer.exportTraces(spans.map((s) => s.span)),
|
|
10657
|
-
this._apiService.exportEvents(
|
|
10658
|
-
|
|
10698
|
+
this._apiService.exportEvents(session._id, {
|
|
10699
|
+
events: events.map((e) => e.event),
|
|
10700
|
+
}),
|
|
10701
|
+
this._apiService.updateSessionAttributes(session._id, {
|
|
10659
10702
|
startedAt: this._toCrashBufferSessionIso(startedAt),
|
|
10660
10703
|
stoppedAt: this._toCrashBufferSessionIso(stoppedAt),
|
|
10661
10704
|
sessionAttributes: this.sessionAttributes,
|
|
@@ -10670,7 +10713,8 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10670
10713
|
finally {
|
|
10671
10714
|
await this._crashBuffer.clear();
|
|
10672
10715
|
this._isFlushingBuffer = false;
|
|
10673
|
-
_eventBus__WEBPACK_IMPORTED_MODULE_8__.recorderEventBus.emit(_config__WEBPACK_IMPORTED_MODULE_6__.
|
|
10716
|
+
_eventBus__WEBPACK_IMPORTED_MODULE_8__.recorderEventBus.emit(_config__WEBPACK_IMPORTED_MODULE_6__.SESSION_READY_EVENT_LEGACY, session._id);
|
|
10717
|
+
_eventBus__WEBPACK_IMPORTED_MODULE_8__.recorderEventBus.emit(_config__WEBPACK_IMPORTED_MODULE_6__.SESSION_READY_EVENT, session);
|
|
10674
10718
|
}
|
|
10675
10719
|
}
|
|
10676
10720
|
_toCrashBufferSessionIso(ts) {
|
|
@@ -10759,7 +10803,8 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10759
10803
|
* Handle the safe stop event
|
|
10760
10804
|
*/
|
|
10761
10805
|
_handleStop(comment) {
|
|
10762
|
-
if (this.sessionState === _types__WEBPACK_IMPORTED_MODULE_5__.SessionState.started ||
|
|
10806
|
+
if (this.sessionState === _types__WEBPACK_IMPORTED_MODULE_5__.SessionState.started ||
|
|
10807
|
+
this.sessionState === _types__WEBPACK_IMPORTED_MODULE_5__.SessionState.paused) {
|
|
10763
10808
|
this.stop(comment);
|
|
10764
10809
|
}
|
|
10765
10810
|
}
|
|
@@ -10783,7 +10828,8 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10783
10828
|
* Handle the safe cancel event
|
|
10784
10829
|
*/
|
|
10785
10830
|
_handleCancel() {
|
|
10786
|
-
if (this.sessionState === _types__WEBPACK_IMPORTED_MODULE_5__.SessionState.started ||
|
|
10831
|
+
if (this.sessionState === _types__WEBPACK_IMPORTED_MODULE_5__.SessionState.started ||
|
|
10832
|
+
this.sessionState === _types__WEBPACK_IMPORTED_MODULE_5__.SessionState.paused) {
|
|
10787
10833
|
this.cancel();
|
|
10788
10834
|
}
|
|
10789
10835
|
}
|
|
@@ -10791,7 +10837,8 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10791
10837
|
* Handle the safe save event
|
|
10792
10838
|
*/
|
|
10793
10839
|
_handleSave() {
|
|
10794
|
-
if (this.sessionState === _types__WEBPACK_IMPORTED_MODULE_5__.SessionState.started &&
|
|
10840
|
+
if (this.sessionState === _types__WEBPACK_IMPORTED_MODULE_5__.SessionState.started &&
|
|
10841
|
+
this.continuousRecording) {
|
|
10795
10842
|
this.save();
|
|
10796
10843
|
}
|
|
10797
10844
|
}
|
|
@@ -10836,12 +10883,12 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10836
10883
|
}
|
|
10837
10884
|
});
|
|
10838
10885
|
this._socketService.on(_config__WEBPACK_IMPORTED_MODULE_6__.SESSION_SAVE_BUFFER_EVENT, (payload) => {
|
|
10839
|
-
var _a, _b
|
|
10886
|
+
var _a, _b;
|
|
10840
10887
|
if (this.sessionState !== _types__WEBPACK_IMPORTED_MODULE_5__.SessionState.stopped)
|
|
10841
10888
|
return;
|
|
10842
|
-
this._flushBuffer(
|
|
10843
|
-
if ((
|
|
10844
|
-
_eventBus__WEBPACK_IMPORTED_MODULE_8__.recorderEventBus.emit(_config__WEBPACK_IMPORTED_MODULE_6__.SESSION_AUTO_CREATED, (
|
|
10889
|
+
this._flushBuffer(payload === null || payload === void 0 ? void 0 : payload.debugSession, true);
|
|
10890
|
+
if ((_a = payload === null || payload === void 0 ? void 0 : payload.debugSession) === null || _a === void 0 ? void 0 : _a.url) {
|
|
10891
|
+
_eventBus__WEBPACK_IMPORTED_MODULE_8__.recorderEventBus.emit(_config__WEBPACK_IMPORTED_MODULE_6__.SESSION_AUTO_CREATED, (_b = payload === null || payload === void 0 ? void 0 : payload.debugSession) === null || _b === void 0 ? void 0 : _b.url);
|
|
10845
10892
|
}
|
|
10846
10893
|
});
|
|
10847
10894
|
}
|
|
@@ -10849,7 +10896,7 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10849
10896
|
try {
|
|
10850
10897
|
const session = await this._apiService.createErrorSession({ span });
|
|
10851
10898
|
if (session === null || session === void 0 ? void 0 : session._id) {
|
|
10852
|
-
this._flushBuffer(session
|
|
10899
|
+
this._flushBuffer(session);
|
|
10853
10900
|
}
|
|
10854
10901
|
if (session === null || session === void 0 ? void 0 : session.url) {
|
|
10855
10902
|
_eventBus__WEBPACK_IMPORTED_MODULE_8__.recorderEventBus.emit(_config__WEBPACK_IMPORTED_MODULE_6__.SESSION_AUTO_CREATED, session.url);
|
|
@@ -10869,14 +10916,20 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10869
10916
|
sessionAttributes: this.sessionAttributes,
|
|
10870
10917
|
resourceAttributes: (0,_utils__WEBPACK_IMPORTED_MODULE_4__.getNavigatorInfo)(),
|
|
10871
10918
|
name: this._getSessionName(),
|
|
10872
|
-
...(this._userAttributes
|
|
10919
|
+
...(this._userAttributes
|
|
10920
|
+
? { userAttributes: this._userAttributes }
|
|
10921
|
+
: {}),
|
|
10873
10922
|
};
|
|
10874
|
-
const request = !this.continuousRecording
|
|
10923
|
+
const request = !this.continuousRecording
|
|
10924
|
+
? payload
|
|
10925
|
+
: { debugSessionData: payload };
|
|
10875
10926
|
const session = this.continuousRecording
|
|
10876
10927
|
? await this._apiService.startContinuousDebugSession(request, signal)
|
|
10877
10928
|
: await this._apiService.startSession(request, signal);
|
|
10878
10929
|
if (session) {
|
|
10879
|
-
session.sessionType = this.continuousRecording
|
|
10930
|
+
session.sessionType = this.continuousRecording
|
|
10931
|
+
? _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.CONTINUOUS
|
|
10932
|
+
: _multiplayer_app_session_recorder_common__WEBPACK_IMPORTED_MODULE_1__.SessionType.MANUAL;
|
|
10880
10933
|
this._setupSessionAndStart(session, false);
|
|
10881
10934
|
}
|
|
10882
10935
|
}
|
|
@@ -10899,7 +10952,10 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10899
10952
|
this._tracer.start(this.sessionId, this.sessionType);
|
|
10900
10953
|
// Ensure we switch from buffer-only recording to session recording cleanly.
|
|
10901
10954
|
void this._recorder.restart(this.sessionId, this.sessionType);
|
|
10902
|
-
this._navigationRecorder.start({
|
|
10955
|
+
this._navigationRecorder.start({
|
|
10956
|
+
sessionId: this.sessionId,
|
|
10957
|
+
sessionType: this.sessionType,
|
|
10958
|
+
});
|
|
10903
10959
|
if (this.session) {
|
|
10904
10960
|
this._socketService.subscribeToSession(this.session);
|
|
10905
10961
|
this._sessionWidget.seconds = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.getTimeDifferenceInSeconds)((_a = this.session) === null || _a === void 0 ? void 0 : _a.startedAt);
|
|
@@ -10927,8 +10983,12 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10927
10983
|
// rrweb assigns new node IDs on each record() call, so the next buffer
|
|
10928
10984
|
// segment must not carry events from the previous generation. Await the
|
|
10929
10985
|
// clear so its IDB tx can't race past the fresh FullSnapshot.
|
|
10930
|
-
const cleared = this._crashBuffer
|
|
10931
|
-
|
|
10986
|
+
const cleared = this._crashBuffer
|
|
10987
|
+
? this._crashBuffer.clear()
|
|
10988
|
+
: Promise.resolve();
|
|
10989
|
+
void cleared
|
|
10990
|
+
.catch(() => undefined)
|
|
10991
|
+
.then(() => this._startBufferOnlyRecording());
|
|
10932
10992
|
}
|
|
10933
10993
|
/**
|
|
10934
10994
|
* Pause the session tracing and recording
|
|
@@ -10964,7 +11024,10 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10964
11024
|
* @param sessionId - the session ID to set or clear
|
|
10965
11025
|
*/
|
|
10966
11026
|
_setSession(session) {
|
|
10967
|
-
this.session = {
|
|
11027
|
+
this.session = {
|
|
11028
|
+
...session,
|
|
11029
|
+
startedAt: session.startedAt || new Date().toISOString(),
|
|
11030
|
+
};
|
|
10968
11031
|
this.sessionId = (session === null || session === void 0 ? void 0 : session.shortId) || (session === null || session === void 0 ? void 0 : session._id);
|
|
10969
11032
|
}
|
|
10970
11033
|
_clearSession() {
|
|
@@ -10987,7 +11050,8 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
10987
11050
|
}
|
|
10988
11051
|
break;
|
|
10989
11052
|
case 'stop':
|
|
10990
|
-
if (this.sessionState !== _types__WEBPACK_IMPORTED_MODULE_5__.SessionState.paused &&
|
|
11053
|
+
if (this.sessionState !== _types__WEBPACK_IMPORTED_MODULE_5__.SessionState.paused &&
|
|
11054
|
+
this.sessionState !== _types__WEBPACK_IMPORTED_MODULE_5__.SessionState.started) {
|
|
10991
11055
|
throw new Error('Cannot stop. Session is not currently started.');
|
|
10992
11056
|
}
|
|
10993
11057
|
break;
|
|
@@ -11065,7 +11129,10 @@ class SessionRecorder extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observabl
|
|
|
11065
11129
|
*/
|
|
11066
11130
|
_getSessionName(date = new Date()) {
|
|
11067
11131
|
var _a, _b, _c;
|
|
11068
|
-
const userName = ((_a = this.sessionAttributes) === null || _a === void 0 ? void 0 : _a.userName) ||
|
|
11132
|
+
const userName = ((_a = this.sessionAttributes) === null || _a === void 0 ? void 0 : _a.userName) ||
|
|
11133
|
+
((_b = this._userAttributes) === null || _b === void 0 ? void 0 : _b.userName) ||
|
|
11134
|
+
((_c = this._userAttributes) === null || _c === void 0 ? void 0 : _c.name) ||
|
|
11135
|
+
'';
|
|
11069
11136
|
return userName
|
|
11070
11137
|
? `${userName}'s session on ${(0,_utils__WEBPACK_IMPORTED_MODULE_4__.getFormattedDate)(date, { month: 'short', day: 'numeric' })}`
|
|
11071
11138
|
: `Session on ${(0,_utils__WEBPACK_IMPORTED_MODULE_4__.getFormattedDate)(date)}`;
|
|
@@ -11127,8 +11194,9 @@ class UIManager {
|
|
|
11127
11194
|
* tooltip, and inner HTML content (Record icon)
|
|
11128
11195
|
*/
|
|
11129
11196
|
setRecorderButtonProps() {
|
|
11197
|
+
var _a;
|
|
11130
11198
|
this.recorderButton.className = 'mp-session-debugger-button';
|
|
11131
|
-
this.recorderButton.dataset.tooltip = 'Record an issue';
|
|
11199
|
+
this.recorderButton.dataset.tooltip = (_a = this.widgetTextOverrides.buttonTooltipIdle) !== null && _a !== void 0 ? _a : 'Record an issue';
|
|
11132
11200
|
(0,_utils__WEBPACK_IMPORTED_MODULE_0__.insertTrustedHTML)(this.recorderButton, `${_templates_icons__WEBPACK_IMPORTED_MODULE_1__.RecordIcon}`);
|
|
11133
11201
|
}
|
|
11134
11202
|
/**
|
|
@@ -11153,8 +11221,7 @@ class UIManager {
|
|
|
11153
11221
|
* The popover includes a logo, heading, and start recording button.
|
|
11154
11222
|
*/
|
|
11155
11223
|
setInitialPopoverProps() {
|
|
11156
|
-
this.initialPopover.className =
|
|
11157
|
-
'mp-session-debugger-popover mp-initial-popover hidden';
|
|
11224
|
+
this.initialPopover.className = 'mp-session-debugger-popover mp-initial-popover hidden';
|
|
11158
11225
|
(0,_utils__WEBPACK_IMPORTED_MODULE_0__.insertTrustedHTML)(this.initialPopover, (0,_templates_initialPopover__WEBPACK_IMPORTED_MODULE_3__.initialPopoverTemplate)(this.widgetTextOverrides, this.showContinuousRecording));
|
|
11159
11226
|
}
|
|
11160
11227
|
/**
|
|
@@ -11174,12 +11241,15 @@ class UIManager {
|
|
|
11174
11241
|
* @param isLoading - Whether the popover button should show a loading state.
|
|
11175
11242
|
*/
|
|
11176
11243
|
setPopoverLoadingState(isLoading) {
|
|
11244
|
+
var _a, _b;
|
|
11177
11245
|
const button = this.initialPopover.querySelector('.mp-session-debugger-popover-button');
|
|
11178
11246
|
if (!button) {
|
|
11179
11247
|
return;
|
|
11180
11248
|
}
|
|
11181
11249
|
button.classList.toggle('disabled', isLoading);
|
|
11182
|
-
button.textContent = isLoading
|
|
11250
|
+
button.textContent = isLoading
|
|
11251
|
+
? ((_a = this.widgetTextOverrides.buttonTooltipLoading) !== null && _a !== void 0 ? _a : 'Starting to record...')
|
|
11252
|
+
: ((_b = this.widgetTextOverrides.startRecordingButtonText) !== null && _b !== void 0 ? _b : 'Start recording');
|
|
11183
11253
|
}
|
|
11184
11254
|
setTimerValue(time) {
|
|
11185
11255
|
const timerElement = this.recordingOverlay.querySelector('.timer');
|
|
@@ -11238,9 +11308,10 @@ class UIManager {
|
|
|
11238
11308
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11239
11309
|
/* harmony export */ ButtonState: () => (/* binding */ ButtonState),
|
|
11240
11310
|
/* harmony export */ ContinuousRecordingSaveButtonState: () => (/* binding */ ContinuousRecordingSaveButtonState),
|
|
11241
|
-
/* harmony export */
|
|
11242
|
-
/* harmony export */
|
|
11311
|
+
/* harmony export */ getButtonStates: () => (/* binding */ getButtonStates),
|
|
11312
|
+
/* harmony export */ getContinuousRecordingSaveButtonStates: () => (/* binding */ getContinuousRecordingSaveButtonStates)
|
|
11243
11313
|
/* harmony export */ });
|
|
11314
|
+
/* unused harmony exports buttonStates, continuousRecordingSaveButtonStates */
|
|
11244
11315
|
/* harmony import */ var _templates_icons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./templates/icons */ "./src/sessionWidget/templates/icons.ts");
|
|
11245
11316
|
|
|
11246
11317
|
/**
|
|
@@ -11327,6 +11398,46 @@ const continuousRecordingSaveButtonStates = {
|
|
|
11327
11398
|
classes: [],
|
|
11328
11399
|
},
|
|
11329
11400
|
};
|
|
11401
|
+
const buttonTooltipOverrideKeys = {
|
|
11402
|
+
[ButtonState.IDLE]: 'buttonTooltipIdle',
|
|
11403
|
+
[ButtonState.RECORDING]: 'buttonTooltipRecording',
|
|
11404
|
+
[ButtonState.CANCEL]: 'buttonTooltipCancel',
|
|
11405
|
+
[ButtonState.SENT]: 'buttonTooltipSent',
|
|
11406
|
+
[ButtonState.LOADING]: 'buttonTooltipLoading',
|
|
11407
|
+
[ButtonState.CONTINUOUS_DEBUGGING]: 'buttonTooltipContinuousDebugging',
|
|
11408
|
+
};
|
|
11409
|
+
const continuousSaveTextOverrideKeys = {
|
|
11410
|
+
[ContinuousRecordingSaveButtonState.IDLE]: 'saveLastSnapshotButtonText',
|
|
11411
|
+
[ContinuousRecordingSaveButtonState.SAVING]: 'saveContinuousRecordingSavingText',
|
|
11412
|
+
[ContinuousRecordingSaveButtonState.SAVED]: 'saveContinuousRecordingSavedText',
|
|
11413
|
+
[ContinuousRecordingSaveButtonState.ERROR]: 'saveContinuousRecordingErrorText',
|
|
11414
|
+
};
|
|
11415
|
+
function getButtonStates(overrides) {
|
|
11416
|
+
var _a;
|
|
11417
|
+
const resolved = { ...buttonStates };
|
|
11418
|
+
for (const state of Object.keys(buttonStates)) {
|
|
11419
|
+
const overrideKey = buttonTooltipOverrideKeys[state];
|
|
11420
|
+
resolved[state] = {
|
|
11421
|
+
...buttonStates[state],
|
|
11422
|
+
tooltip: (_a = overrides[overrideKey]) !== null && _a !== void 0 ? _a : buttonStates[state].tooltip,
|
|
11423
|
+
};
|
|
11424
|
+
}
|
|
11425
|
+
return resolved;
|
|
11426
|
+
}
|
|
11427
|
+
function getContinuousRecordingSaveButtonStates(overrides) {
|
|
11428
|
+
var _a;
|
|
11429
|
+
const resolved = {
|
|
11430
|
+
...continuousRecordingSaveButtonStates,
|
|
11431
|
+
};
|
|
11432
|
+
for (const state of Object.keys(continuousRecordingSaveButtonStates)) {
|
|
11433
|
+
const overrideKey = continuousSaveTextOverrideKeys[state];
|
|
11434
|
+
resolved[state] = {
|
|
11435
|
+
...continuousRecordingSaveButtonStates[state],
|
|
11436
|
+
textContent: (_a = overrides[overrideKey]) !== null && _a !== void 0 ? _a : continuousRecordingSaveButtonStates[state].textContent,
|
|
11437
|
+
};
|
|
11438
|
+
}
|
|
11439
|
+
return resolved;
|
|
11440
|
+
}
|
|
11330
11441
|
|
|
11331
11442
|
|
|
11332
11443
|
/***/ },
|
|
@@ -11525,7 +11636,7 @@ class SessionWidget extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observable
|
|
|
11525
11636
|
this._buttonState = newState;
|
|
11526
11637
|
if (!this.isBrowser)
|
|
11527
11638
|
return;
|
|
11528
|
-
const { icon, tooltip, classes, excludeClasses } = _buttonStateConfigs__WEBPACK_IMPORTED_MODULE_8__.
|
|
11639
|
+
const { icon, tooltip, classes, excludeClasses } = (0,_buttonStateConfigs__WEBPACK_IMPORTED_MODULE_8__.getButtonStates)(this._widgetTextOverrides)[newState];
|
|
11529
11640
|
if (newState === _buttonStateConfigs__WEBPACK_IMPORTED_MODULE_8__.ButtonState.CANCEL) {
|
|
11530
11641
|
(_a = this.buttonDraggabilityObserver) === null || _a === void 0 ? void 0 : _a.observe(this.recorderButton, {
|
|
11531
11642
|
attributes: true,
|
|
@@ -11563,7 +11674,8 @@ class SessionWidget extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observable
|
|
|
11563
11674
|
type: 'error',
|
|
11564
11675
|
message: this._error,
|
|
11565
11676
|
button: {
|
|
11566
|
-
text: 'Close',
|
|
11677
|
+
text: 'Close',
|
|
11678
|
+
onClick: () => this.hideToast(),
|
|
11567
11679
|
},
|
|
11568
11680
|
});
|
|
11569
11681
|
}
|
|
@@ -11710,7 +11822,7 @@ class SessionWidget extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observable
|
|
|
11710
11822
|
return;
|
|
11711
11823
|
const saveButton = this.initialPopover.querySelector('#mp-save-continuous-debug-session');
|
|
11712
11824
|
if (saveButton) {
|
|
11713
|
-
const { textContent, disabled } = _buttonStateConfigs__WEBPACK_IMPORTED_MODULE_8__.
|
|
11825
|
+
const { textContent, disabled } = (0,_buttonStateConfigs__WEBPACK_IMPORTED_MODULE_8__.getContinuousRecordingSaveButtonStates)(this._widgetTextOverrides)[state];
|
|
11714
11826
|
saveButton.disabled = disabled;
|
|
11715
11827
|
saveButton.textContent = textContent;
|
|
11716
11828
|
}
|
|
@@ -11738,14 +11850,11 @@ class SessionWidget extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observable
|
|
|
11738
11850
|
return;
|
|
11739
11851
|
this.buttonDraggabilityObserver = new MutationObserver((mutationsList) => {
|
|
11740
11852
|
for (const mutation of mutationsList) {
|
|
11741
|
-
if (mutation.type === 'attributes' &&
|
|
11742
|
-
mutation.attributeName === 'class') {
|
|
11853
|
+
if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
|
|
11743
11854
|
const oldClassName = mutation.oldValue;
|
|
11744
11855
|
const newClassName = mutation.target['className'];
|
|
11745
|
-
if (((oldClassName === null || oldClassName === void 0 ? void 0 : oldClassName.includes('no-draggable')) &&
|
|
11746
|
-
|
|
11747
|
-
((newClassName === null || newClassName === void 0 ? void 0 : newClassName.includes('no-draggable')) &&
|
|
11748
|
-
!(oldClassName === null || oldClassName === void 0 ? void 0 : oldClassName.includes('no-draggable')))) {
|
|
11856
|
+
if (((oldClassName === null || oldClassName === void 0 ? void 0 : oldClassName.includes('no-draggable')) && !newClassName.includes('no-draggable')) ||
|
|
11857
|
+
((newClassName === null || newClassName === void 0 ? void 0 : newClassName.includes('no-draggable')) && !(oldClassName === null || oldClassName === void 0 ? void 0 : oldClassName.includes('no-draggable')))) {
|
|
11749
11858
|
// draggable mode was changed
|
|
11750
11859
|
this.initialPopoverVisible = false;
|
|
11751
11860
|
this.finalPopoverVisible = false;
|
|
@@ -11839,7 +11948,12 @@ class SessionWidget extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observable
|
|
|
11839
11948
|
popoverBottom = VIEWPORT_HEIGHT - top + _constants__WEBPACK_IMPORTED_MODULE_3__.POPOVER_DISTANCE_FROM_BUTTON + (isDraggable ? 0 : _constants__WEBPACK_IMPORTED_MODULE_3__.NON_DRAGGABLE_OFFSET);
|
|
11840
11949
|
popoverRight = VIEWPORT_WIDTH - right;
|
|
11841
11950
|
if (popoverBottom + POPOVER_HEIGHT > VIEWPORT_HEIGHT) {
|
|
11842
|
-
popoverBottom =
|
|
11951
|
+
popoverBottom =
|
|
11952
|
+
VIEWPORT_HEIGHT -
|
|
11953
|
+
bottom -
|
|
11954
|
+
POPOVER_HEIGHT -
|
|
11955
|
+
_constants__WEBPACK_IMPORTED_MODULE_3__.POPOVER_DISTANCE_FROM_BUTTON -
|
|
11956
|
+
(isDraggable ? 0 : _constants__WEBPACK_IMPORTED_MODULE_3__.NON_DRAGGABLE_OFFSET);
|
|
11843
11957
|
}
|
|
11844
11958
|
if (popoverRight + _constants__WEBPACK_IMPORTED_MODULE_3__.POPOVER_WIDTH > VIEWPORT_WIDTH) {
|
|
11845
11959
|
popoverRight = VIEWPORT_WIDTH - left - _constants__WEBPACK_IMPORTED_MODULE_3__.POPOVER_WIDTH;
|
|
@@ -11942,9 +12056,7 @@ class SessionWidget extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observable
|
|
|
11942
12056
|
this.onCancel();
|
|
11943
12057
|
}
|
|
11944
12058
|
this.initialPopoverVisible = false;
|
|
11945
|
-
this.buttonState = this._continuousRecording
|
|
11946
|
-
? _buttonStateConfigs__WEBPACK_IMPORTED_MODULE_8__.ButtonState.CONTINUOUS_DEBUGGING
|
|
11947
|
-
: _buttonStateConfigs__WEBPACK_IMPORTED_MODULE_8__.ButtonState.IDLE;
|
|
12059
|
+
this.buttonState = this._continuousRecording ? _buttonStateConfigs__WEBPACK_IMPORTED_MODULE_8__.ButtonState.CONTINUOUS_DEBUGGING : _buttonStateConfigs__WEBPACK_IMPORTED_MODULE_8__.ButtonState.IDLE;
|
|
11948
12060
|
if (typeof document !== 'undefined') {
|
|
11949
12061
|
document.removeEventListener('click', this.handleClickOutside);
|
|
11950
12062
|
}
|
|
@@ -12011,9 +12123,7 @@ class SessionWidget extends _observable__WEBPACK_IMPORTED_MODULE_0__.Observable
|
|
|
12011
12123
|
}
|
|
12012
12124
|
}
|
|
12013
12125
|
else {
|
|
12014
|
-
this.buttonState = this._initialPopoverVisible
|
|
12015
|
-
? _buttonStateConfigs__WEBPACK_IMPORTED_MODULE_8__.ButtonState.IDLE
|
|
12016
|
-
: _buttonStateConfigs__WEBPACK_IMPORTED_MODULE_8__.ButtonState.CANCEL;
|
|
12126
|
+
this.buttonState = this._initialPopoverVisible ? _buttonStateConfigs__WEBPACK_IMPORTED_MODULE_8__.ButtonState.IDLE : _buttonStateConfigs__WEBPACK_IMPORTED_MODULE_8__.ButtonState.CANCEL;
|
|
12017
12127
|
this.initialPopoverVisible = !this._initialPopoverVisible;
|
|
12018
12128
|
}
|
|
12019
12129
|
if (typeof document !== 'undefined') {
|