From d87bbb9db43e5a4b9c6a16036653546a95211da9 Mon Sep 17 00:00:00 2001 From: Michelle Zhang <56095982+michellewzhang@users.noreply.github.com> Date: Thu, 16 May 2024 16:29:58 +0200 Subject: [PATCH] rm files --- packages/rrweb-player/src/main.js | 11 -- packages/rrweb-player/src/main.js.map | 1 - packages/rrweb-player/src/utils.js | 146 ------------------- packages/rrweb-player/src/utils.js.map | 1 - packages/rrweb-player/typings/src/main.d.ts | 13 -- packages/rrweb-player/typings/src/utils.d.ts | 30 ---- 6 files changed, 202 deletions(-) delete mode 100644 packages/rrweb-player/src/main.js delete mode 100644 packages/rrweb-player/src/main.js.map delete mode 100644 packages/rrweb-player/src/utils.js delete mode 100644 packages/rrweb-player/src/utils.js.map delete mode 100644 packages/rrweb-player/typings/src/main.d.ts delete mode 100644 packages/rrweb-player/typings/src/utils.d.ts diff --git a/packages/rrweb-player/src/main.js b/packages/rrweb-player/src/main.js deleted file mode 100644 index 071d03bc9a..0000000000 --- a/packages/rrweb-player/src/main.js +++ /dev/null @@ -1,11 +0,0 @@ -import _Player from './Player.svelte'; -class Player extends _Player { - constructor(options) { - super({ - target: options.target, - props: options.data || options.props, - }); - } -} -export default Player; -//# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/packages/rrweb-player/src/main.js.map b/packages/rrweb-player/src/main.js.map deleted file mode 100644 index cbeaff0a72..0000000000 --- a/packages/rrweb-player/src/main.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,iBAAiB,CAAC;AAMtC,MAAM,MAAO,SAAQ,OAAO;IAC1B,YAAY,OAKX;QACC,KAAK,CAAC;YACJ,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,KAAK,EAAE,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,KAAK;SACrC,CAAC,CAAC;IACL,CAAC;CACF;AAED,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/packages/rrweb-player/src/utils.js b/packages/rrweb-player/src/utils.js deleted file mode 100644 index 9f88201d92..0000000000 --- a/packages/rrweb-player/src/utils.js +++ /dev/null @@ -1,146 +0,0 @@ -import { EventType, IncrementalSource } from '@sentry-internal/rrweb'; -export function inlineCss(cssObj) { - let style = ''; - Object.keys(cssObj).forEach((key) => { - style += `${key}: ${cssObj[key]};`; - }); - return style; -} -function padZero(num, len = 2) { - let str = String(num); - const threshold = Math.pow(10, len - 1); - if (num < threshold) { - while (String(threshold).length > str.length) { - str = `0${num}`; - } - } - return str; -} -const SECOND = 1000; -const MINUTE = 60 * SECOND; -const HOUR = 60 * MINUTE; -export function formatTime(ms) { - if (ms <= 0) { - return '00:00'; - } - const hour = Math.floor(ms / HOUR); - ms = ms % HOUR; - const minute = Math.floor(ms / MINUTE); - ms = ms % MINUTE; - const second = Math.floor(ms / SECOND); - if (hour) { - return `${padZero(hour)}:${padZero(minute)}:${padZero(second)}`; - } - return `${padZero(minute)}:${padZero(second)}`; -} -export function openFullscreen(el) { - if (el.requestFullscreen) { - return el.requestFullscreen(); - } - else if (el.mozRequestFullScreen) { - /* Firefox */ - return el.mozRequestFullScreen(); - } - else if (el.webkitRequestFullscreen) { - /* Chrome, Safari and Opera */ - return el.webkitRequestFullscreen(); - } - else if (el.msRequestFullscreen) { - /* IE/Edge */ - return el.msRequestFullscreen(); - } -} -export function exitFullscreen() { - if (document.exitFullscreen) { - return document.exitFullscreen(); - } - else if (document.mozExitFullscreen) { - /* Firefox */ - return document.mozExitFullscreen(); - } - else if (document.webkitExitFullscreen) { - /* Chrome, Safari and Opera */ - return document.webkitExitFullscreen(); - } - else if (document.msExitFullscreen) { - /* IE/Edge */ - return document.msExitFullscreen(); - } -} -export function isFullscreen() { - let fullscreen = false; - [ - 'fullscreen', - 'webkitIsFullScreen', - 'mozFullScreen', - 'msFullscreenElement', - ].forEach((fullScreenAccessor) => { - if (fullScreenAccessor in document) { - fullscreen = fullscreen || Boolean(document[fullScreenAccessor]); - } - }); - return fullscreen; -} -export function onFullscreenChange(handler) { - document.addEventListener('fullscreenchange', handler); - document.addEventListener('webkitfullscreenchange', handler); - document.addEventListener('mozfullscreenchange', handler); - document.addEventListener('MSFullscreenChange', handler); - return () => { - document.removeEventListener('fullscreenchange', handler); - document.removeEventListener('webkitfullscreenchange', handler); - document.removeEventListener('mozfullscreenchange', handler); - document.removeEventListener('MSFullscreenChange', handler); - }; -} -export function typeOf(obj) { - // eslint-disable-next-line @typescript-eslint/unbound-method - const toString = Object.prototype.toString; - const map = { - '[object Boolean]': 'boolean', - '[object Number]': 'number', - '[object String]': 'string', - '[object Function]': 'function', - '[object Array]': 'array', - '[object Date]': 'date', - '[object RegExp]': 'regExp', - '[object Undefined]': 'undefined', - '[object Null]': 'null', - '[object Object]': 'object', - }; - // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access - return map[toString.call(obj)]; -} -/** - * Forked from 'rrweb' replay/index.ts. The original function is not exported. - * Determine whether the event is a user interaction event - * @param event - event to be determined - * @returns true if the event is a user interaction event - */ -function isUserInteraction(event) { - if (event.type !== EventType.IncrementalSnapshot) { - return false; - } - return (event.data.source > IncrementalSource.Mutation && - event.data.source <= IncrementalSource.Input); -} -/** - * Get periods of time when no user interaction happened from a list of events. - * @param events - all events - * @param inactivePeriodThreshold - threshold of inactive time in milliseconds - * @returns periods of time consist with [start time, end time] - */ -export function getInactivePeriods(events, inactivePeriodThreshold) { - const inactivePeriods = []; - let lastActiveTime = events[0].timestamp; - for (const event of events) { - if (!isUserInteraction(event)) - continue; - if (event.timestamp - lastActiveTime > inactivePeriodThreshold) { - inactivePeriods.push([lastActiveTime, event.timestamp]); - } - lastActiveTime = event.timestamp; - } - return inactivePeriods; -} -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/packages/rrweb-player/src/utils.js.map b/packages/rrweb-player/src/utils.js.map deleted file mode 100644 index b01d6d1ec0..0000000000 --- a/packages/rrweb-player/src/utils.js.map +++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AQ;QAC3B,mBAAmB,EAAE,UAAU;QAC/B,gBAAgB,EAAE,OAAO;QACzB,eAAe,EAAE,MAAM;QACvB,iBAAiB,EAAE,QAAQ;QAC3B,oBAAoB,EAAE,WAAW;QACjC,eAAe,EAAE,MAAM;QACvB,iBAAiB,EAAE,QAAQ;KAC5B,CAAC;IACF,2GAA2G;IAC3G,OAAO,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACjC,CAAC;AAED;;;;;GAKG;AACH,SAAS,iBAAiB,CAAC,KAAoB;IAC7C,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,mBAAmB,EAAE;QAChD,OAAO,KAAK,CAAC;KACd;IACD,OAAO,CACL,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,iBAAiB,CAAC,QAAQ;QAC9C,KAAK,CAAC,IAAI,CAAC,MAAM,IAAI,iBAAiB,CAAC,KAAK,CAC7C,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAuB,EACvB,uBAA+B;IAE/B,MAAM,eAAe,GAAuB,EAAE,CAAC;IAC/C,IAAI,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACzC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;QAC1B,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC;YAAE,SAAS;QACxC,IAAI,KAAK,CAAC,SAAS,GAAG,cAAc,GAAG,uBAAuB,EAAE;YAC9D,eAAe,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;SACzD;QACD,cAAc,GAAG,KAAK,CAAC,SAAS,CAAC;KAClC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC"} \ No newline at end of file diff --git a/packages/rrweb-player/typings/src/main.d.ts b/packages/rrweb-player/typings/src/main.d.ts deleted file mode 100644 index 220e45aefa..0000000000 --- a/packages/rrweb-player/typings/src/main.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { eventWithTime } from '@sentry-internal/rrweb-types'; -import _Player from './Player.svelte'; -type PlayerProps = { - events: eventWithTime[]; -}; -declare class Player extends _Player { - constructor(options: { - target: Element; - props: PlayerProps; - data?: PlayerProps; - }); -} -export default Player; diff --git a/packages/rrweb-player/typings/src/utils.d.ts b/packages/rrweb-player/typings/src/utils.d.ts deleted file mode 100644 index 150b588bac..0000000000 --- a/packages/rrweb-player/typings/src/utils.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -declare global { - interface Document { - mozExitFullscreen: Document['exitFullscreen']; - webkitExitFullscreen: Document['exitFullscreen']; - msExitFullscreen: Document['exitFullscreen']; - webkitIsFullScreen: Document['fullscreen']; - mozFullScreen: Document['fullscreen']; - msFullscreenElement: Document['fullscreen']; - } - interface HTMLElement { - mozRequestFullScreen: Element['requestFullscreen']; - webkitRequestFullscreen: Element['requestFullscreen']; - msRequestFullscreen: Element['requestFullscreen']; - } -} -import type { eventWithTime } from '@sentry-internal/rrweb-types'; -export declare function inlineCss(cssObj: Record): string; -export declare function formatTime(ms: number): string; -export declare function openFullscreen(el: HTMLElement): Promise; -export declare function exitFullscreen(): Promise; -export declare function isFullscreen(): boolean; -export declare function onFullscreenChange(handler: () => unknown): () => void; -export declare function typeOf(obj: unknown): 'boolean' | 'number' | 'string' | 'function' | 'array' | 'date' | 'regExp' | 'undefined' | 'null' | 'object'; -/** - * Get periods of time when no user interaction happened from a list of events. - * @param events - all events - * @param inactivePeriodThreshold - threshold of inactive time in milliseconds - * @returns periods of time consist with [start time, end time] - */ -export declare function getInactivePeriods(events: eventWithTime[], inactivePeriodThreshold: number): [number, number][];