From eba5473770ad1b02ab2ca1e0a51cbaaa58dac3c2 Mon Sep 17 00:00:00 2001 From: Eoghan Murray Date: Wed, 17 Apr 2024 14:20:20 +0100 Subject: [PATCH] I forgot to pay attention to `yarn format` during merge of #1408 (#1452) --- guide.md | 42 +++++++++++++++--------------- packages/rrweb-player/src/utils.ts | 5 +++- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/guide.md b/guide.md index 6298cdf772..5693b26d29 100644 --- a/guide.md +++ b/guide.md @@ -295,27 +295,27 @@ replayer.destroy(); The replayer accepts options as its constructor's second parameter, and it has the following options: -| key | default | description | -| ------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| speed | 1 | replay speed ratio | -| root | document.body | the root element of replayer | -| loadTimeout | 0 | timeout of loading remote style sheet | -| skipInactive | false | whether to skip inactive time | -| inactivePeriodThreshold | 10000 | the threshold in milliseconds for what should be considered an inactive period | -| showWarning | true | whether to print warning messages during replay | -| showDebug | false | whether to print debug messages during replay | -| blockClass | 'rr-block' | element with the class name will display as a blocked area | -| liveMode | false | whether to enable live mode | -| insertStyleRules | [] | accepts multiple CSS rule string, which will be injected into the replay iframe | -| triggerFocus | true | whether to trigger focus during replay | -| UNSAFE_replayCanvas | false | whether to replay the canvas element. **Enable this will remove the sandbox, which is unsafe.** | -| pauseAnimation | true | whether to pause CSS animation when the replayer is paused | -| mouseTail | true | whether to show mouse tail during replay. Set to false to disable mouse tail. A complete config can be found in this [type](https://github.com/rrweb-io/rrweb/blob/9488deb6d54a5f04350c063d942da5e96ab74075/src/types.ts#L407) | -| unpackFn | - | refer to the [storage optimization recipe](./docs/recipes/optimize-storage.md) | -| logConfig | - | configuration of console output playback, refer to the [console recipe](./docs/recipes/console.md) | -| plugins | [] | load plugins to provide extended replay functions. [What is plugins?](./docs/recipes/plugin.md) | -| useVirtualDom | true | whether to use Virtual Dom optimization in the process of skipping to a new point of time | -| logger | console | The logger object used by the replayer to print warnings or errors | +| key | default | description | +| ----------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| speed | 1 | replay speed ratio | +| root | document.body | the root element of replayer | +| loadTimeout | 0 | timeout of loading remote style sheet | +| skipInactive | false | whether to skip inactive time | +| inactivePeriodThreshold | 10000 | the threshold in milliseconds for what should be considered an inactive period | +| showWarning | true | whether to print warning messages during replay | +| showDebug | false | whether to print debug messages during replay | +| blockClass | 'rr-block' | element with the class name will display as a blocked area | +| liveMode | false | whether to enable live mode | +| insertStyleRules | [] | accepts multiple CSS rule string, which will be injected into the replay iframe | +| triggerFocus | true | whether to trigger focus during replay | +| UNSAFE_replayCanvas | false | whether to replay the canvas element. **Enable this will remove the sandbox, which is unsafe.** | +| pauseAnimation | true | whether to pause CSS animation when the replayer is paused | +| mouseTail | true | whether to show mouse tail during replay. Set to false to disable mouse tail. A complete config can be found in this [type](https://github.com/rrweb-io/rrweb/blob/9488deb6d54a5f04350c063d942da5e96ab74075/src/types.ts#L407) | +| unpackFn | - | refer to the [storage optimization recipe](./docs/recipes/optimize-storage.md) | +| logConfig | - | configuration of console output playback, refer to the [console recipe](./docs/recipes/console.md) | +| plugins | [] | load plugins to provide extended replay functions. [What is plugins?](./docs/recipes/plugin.md) | +| useVirtualDom | true | whether to use Virtual Dom optimization in the process of skipping to a new point of time | +| logger | console | The logger object used by the replayer to print warnings or errors | #### Use rrweb-player diff --git a/packages/rrweb-player/src/utils.ts b/packages/rrweb-player/src/utils.ts index 405dffa901..08146bd253 100644 --- a/packages/rrweb-player/src/utils.ts +++ b/packages/rrweb-player/src/utils.ts @@ -167,7 +167,10 @@ function isUserInteraction(event: eventWithTime): boolean { * @param inactivePeriodThreshold - threshold of inactive time in milliseconds * @returns periods of time consist with [start time, end time] */ -export function getInactivePeriods(events: eventWithTime[], inactivePeriodThreshold: number) { +export function getInactivePeriods( + events: eventWithTime[], + inactivePeriodThreshold: number, +) { const inactivePeriods: [number, number][] = []; let lastActiveTime = events[0].timestamp; for (const event of events) {