chore:little fixes and formating and linting and patches

This commit is contained in:
2026-03-31 15:50:54 +02:00
parent a1ce71ffb6
commit 9b197abcfa
815 changed files with 22960 additions and 8982 deletions

View File

@@ -1,2 +1,2 @@
export { startReplayRecorder, stopReplayRecorder } from './recorder';
export type { ReplayChunkPayload, ReplayRecorderConfig } from './recorder';
export { startReplayRecorder, stopReplayRecorder } from './recorder';

View File

@@ -26,7 +26,7 @@ let stopRecording: (() => void) | null = null;
export function startReplayRecorder(
config: ReplayRecorderConfig,
sendChunk: (payload: ReplayChunkPayload) => void,
sendChunk: (payload: ReplayChunkPayload) => void
): void {
if (typeof document === 'undefined' || typeof window === 'undefined') {
return;
@@ -46,7 +46,9 @@ export function startReplayRecorder(
let flushTimer: ReturnType<typeof setInterval> | null = null;
function flush(isFullSnapshot: boolean): void {
if (buffer.length === 0) return;
if (buffer.length === 0) {
return;
}
const payloadJson = JSON.stringify(buffer);
const payloadBytes = new TextEncoder().encode(payloadJson).length;
@@ -111,12 +113,15 @@ export function startReplayRecorder(
checkoutEveryNms: flushIntervalMs,
maskAllInputs: config.maskAllInputs ?? true,
maskTextSelector: maskAllText ? '*' : '[data-openpanel-replay-mask]',
maskTextFn: maskAllText && unmaskTextSelector
? (text, element) => {
if (element?.closest(unmaskTextSelector)) return text;
return text.replace(/\S/g, '*');
}
: undefined,
maskTextFn:
maskAllText && unmaskTextSelector
? (text, element) => {
if (element?.closest(unmaskTextSelector)) {
return text;
}
return text.replace(/\S/g, '*');
}
: undefined,
blockSelector: config.blockSelector ?? '[data-openpanel-replay-block]',
blockClass: config.blockClass,
ignoreSelector: config.ignoreSelector,

View File

@@ -38,7 +38,7 @@ import { OpenPanel } from './index';
// Otherwise return the property from op (for things like options, etc.)
return value;
},
},
}
);
window.op = opCallable;