@depup/datadog__browser-rum 6.31.0-depup.0
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/LICENSE +201 -0
- package/README.md +25 -0
- package/bundle/chunks/profiler-9f1c1103f1ef0aa98257-datadog-rum.js +1 -0
- package/bundle/chunks/recorder-926b641c6ef51d09a378-datadog-rum.js +1 -0
- package/bundle/datadog-rum.js +1 -0
- package/changes.json +5 -0
- package/cjs/boot/isBrowserSupported.d.ts +4 -0
- package/cjs/boot/isBrowserSupported.js +17 -0
- package/cjs/boot/isBrowserSupported.js.map +1 -0
- package/cjs/boot/lazyLoadProfiler.d.ts +3 -0
- package/cjs/boot/lazyLoadProfiler.js +56 -0
- package/cjs/boot/lazyLoadProfiler.js.map +1 -0
- package/cjs/boot/lazyLoadRecorder.d.ts +3 -0
- package/cjs/boot/lazyLoadRecorder.js +56 -0
- package/cjs/boot/lazyLoadRecorder.js.map +1 -0
- package/cjs/boot/postStartStrategy.d.ts +33 -0
- package/cjs/boot/postStartStrategy.js +98 -0
- package/cjs/boot/postStartStrategy.js.map +1 -0
- package/cjs/boot/preStartStrategy.d.ts +6 -0
- package/cjs/boot/preStartStrategy.js +24 -0
- package/cjs/boot/preStartStrategy.js.map +1 -0
- package/cjs/boot/profilerApi.d.ts +2 -0
- package/cjs/boot/profilerApi.js +52 -0
- package/cjs/boot/profilerApi.js.map +1 -0
- package/cjs/boot/recorderApi.d.ts +3 -0
- package/cjs/boot/recorderApi.js +71 -0
- package/cjs/boot/recorderApi.js.map +1 -0
- package/cjs/boot/startRecording.d.ts +6 -0
- package/cjs/boot/startRecording.js +45 -0
- package/cjs/boot/startRecording.js.map +1 -0
- package/cjs/domain/deflate/deflateEncoder.d.ts +3 -0
- package/cjs/domain/deflate/deflateEncoder.js +110 -0
- package/cjs/domain/deflate/deflateEncoder.js.map +1 -0
- package/cjs/domain/deflate/deflateWorker.d.ts +29 -0
- package/cjs/domain/deflate/deflateWorker.js +105 -0
- package/cjs/domain/deflate/deflateWorker.js.map +1 -0
- package/cjs/domain/deflate/index.d.ts +3 -0
- package/cjs/domain/deflate/index.js +11 -0
- package/cjs/domain/deflate/index.js.map +1 -0
- package/cjs/domain/getSessionReplayLink.d.ts +2 -0
- package/cjs/domain/getSessionReplayLink.js +35 -0
- package/cjs/domain/getSessionReplayLink.js.map +1 -0
- package/cjs/domain/profiling/actionHistory.d.ts +10 -0
- package/cjs/domain/profiling/actionHistory.js +49 -0
- package/cjs/domain/profiling/actionHistory.js.map +1 -0
- package/cjs/domain/profiling/longTaskHistory.d.ts +11 -0
- package/cjs/domain/profiling/longTaskHistory.js +28 -0
- package/cjs/domain/profiling/longTaskHistory.js.map +1 -0
- package/cjs/domain/profiling/profiler.d.ts +7 -0
- package/cjs/domain/profiling/profiler.js +267 -0
- package/cjs/domain/profiling/profiler.js.map +1 -0
- package/cjs/domain/profiling/profilingContext.d.ts +6 -0
- package/cjs/domain/profiling/profilingContext.js +31 -0
- package/cjs/domain/profiling/profilingContext.js.map +1 -0
- package/cjs/domain/profiling/profilingSupported.d.ts +1 -0
- package/cjs/domain/profiling/profilingSupported.js +11 -0
- package/cjs/domain/profiling/profilingSupported.js.map +1 -0
- package/cjs/domain/profiling/test-utils/mockedTrace.d.ts +3 -0
- package/cjs/domain/profiling/test-utils/mockedTrace.js +57 -0
- package/cjs/domain/profiling/test-utils/mockedTrace.js.map +1 -0
- package/cjs/domain/profiling/transport/assembly.d.ts +7 -0
- package/cjs/domain/profiling/transport/assembly.js +45 -0
- package/cjs/domain/profiling/transport/assembly.js.map +1 -0
- package/cjs/domain/profiling/transport/buildProfileEventAttributes.d.ts +33 -0
- package/cjs/domain/profiling/transport/buildProfileEventAttributes.js +63 -0
- package/cjs/domain/profiling/transport/buildProfileEventAttributes.js.map +1 -0
- package/cjs/domain/profiling/types/index.d.ts +2 -0
- package/cjs/domain/profiling/types/index.js +3 -0
- package/cjs/domain/profiling/types/index.js.map +1 -0
- package/cjs/domain/profiling/types/profilerApi.types.d.ts +58 -0
- package/cjs/domain/profiling/types/profilerApi.types.js +5 -0
- package/cjs/domain/profiling/types/profilerApi.types.js.map +1 -0
- package/cjs/domain/profiling/types/rumProfiler.types.d.ts +55 -0
- package/cjs/domain/profiling/types/rumProfiler.types.js +3 -0
- package/cjs/domain/profiling/types/rumProfiler.types.js.map +1 -0
- package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.d.ts +1 -0
- package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.js +7 -0
- package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.js.map +1 -0
- package/cjs/domain/profiling/utils/getDefaultViewName.d.ts +1 -0
- package/cjs/domain/profiling/utils/getDefaultViewName.js +14 -0
- package/cjs/domain/profiling/utils/getDefaultViewName.js.map +1 -0
- package/cjs/domain/profiling/utils/getNumberOfSamples.d.ts +8 -0
- package/cjs/domain/profiling/utils/getNumberOfSamples.js +19 -0
- package/cjs/domain/profiling/utils/getNumberOfSamples.js.map +1 -0
- package/cjs/domain/profiling/vitalHistory.d.ts +10 -0
- package/cjs/domain/profiling/vitalHistory.js +42 -0
- package/cjs/domain/profiling/vitalHistory.js.map +1 -0
- package/cjs/domain/record/assembly.d.ts +3 -0
- package/cjs/domain/record/assembly.js +16 -0
- package/cjs/domain/record/assembly.js.map +1 -0
- package/cjs/domain/record/elementsScrollPositions.d.ts +10 -0
- package/cjs/domain/record/elementsScrollPositions.js +23 -0
- package/cjs/domain/record/elementsScrollPositions.js.map +1 -0
- package/cjs/domain/record/eventsUtils.d.ts +2 -0
- package/cjs/domain/record/eventsUtils.js +15 -0
- package/cjs/domain/record/eventsUtils.js.map +1 -0
- package/cjs/domain/record/index.d.ts +6 -0
- package/cjs/domain/record/index.js +17 -0
- package/cjs/domain/record/index.js.map +1 -0
- package/cjs/domain/record/internalApi.d.ts +22 -0
- package/cjs/domain/record/internalApi.js +55 -0
- package/cjs/domain/record/internalApi.js.map +1 -0
- package/cjs/domain/record/itemIds.d.ts +40 -0
- package/cjs/domain/record/itemIds.js +58 -0
- package/cjs/domain/record/itemIds.js.map +1 -0
- package/cjs/domain/record/mutationBatch.d.ts +12 -0
- package/cjs/domain/record/mutationBatch.js +44 -0
- package/cjs/domain/record/mutationBatch.js.map +1 -0
- package/cjs/domain/record/record.d.ts +16 -0
- package/cjs/domain/record/record.js +88 -0
- package/cjs/domain/record/record.js.map +1 -0
- package/cjs/domain/record/record.types.d.ts +18 -0
- package/cjs/domain/record/record.types.js +3 -0
- package/cjs/domain/record/record.types.js.map +1 -0
- package/cjs/domain/record/recordingScope.d.ts +24 -0
- package/cjs/domain/record/recordingScope.js +29 -0
- package/cjs/domain/record/recordingScope.js.map +1 -0
- package/cjs/domain/record/serialization/changeEncoder.d.ts +22 -0
- package/cjs/domain/record/serialization/changeEncoder.js +59 -0
- package/cjs/domain/record/serialization/changeEncoder.js.map +1 -0
- package/cjs/domain/record/serialization/conversions/changeConverter.d.ts +10 -0
- package/cjs/domain/record/serialization/conversions/changeConverter.js +216 -0
- package/cjs/domain/record/serialization/conversions/changeConverter.js.map +1 -0
- package/cjs/domain/record/serialization/conversions/changeDecoder.d.ts +16 -0
- package/cjs/domain/record/serialization/conversions/changeDecoder.js +137 -0
- package/cjs/domain/record/serialization/conversions/changeDecoder.js.map +1 -0
- package/cjs/domain/record/serialization/conversions/index.d.ts +7 -0
- package/cjs/domain/record/serialization/conversions/index.js +11 -0
- package/cjs/domain/record/serialization/conversions/index.js.map +1 -0
- package/cjs/domain/record/serialization/conversions/mutationLog.d.ts +15 -0
- package/cjs/domain/record/serialization/conversions/mutationLog.js +36 -0
- package/cjs/domain/record/serialization/conversions/mutationLog.js.map +1 -0
- package/cjs/domain/record/serialization/conversions/nodeIdRemapper.d.ts +10 -0
- package/cjs/domain/record/serialization/conversions/nodeIdRemapper.js +53 -0
- package/cjs/domain/record/serialization/conversions/nodeIdRemapper.js.map +1 -0
- package/cjs/domain/record/serialization/conversions/renderOptions.d.ts +6 -0
- package/cjs/domain/record/serialization/conversions/renderOptions.js +12 -0
- package/cjs/domain/record/serialization/conversions/renderOptions.js.map +1 -0
- package/cjs/domain/record/serialization/conversions/stringTable.d.ts +5 -0
- package/cjs/domain/record/serialization/conversions/stringTable.js +22 -0
- package/cjs/domain/record/serialization/conversions/stringTable.js.map +1 -0
- package/cjs/domain/record/serialization/conversions/vDocument.d.ts +23 -0
- package/cjs/domain/record/serialization/conversions/vDocument.js +176 -0
- package/cjs/domain/record/serialization/conversions/vDocument.js.map +1 -0
- package/cjs/domain/record/serialization/conversions/vNode.d.ts +66 -0
- package/cjs/domain/record/serialization/conversions/vNode.js +285 -0
- package/cjs/domain/record/serialization/conversions/vNode.js.map +1 -0
- package/cjs/domain/record/serialization/conversions/vStyleSheet.d.ts +16 -0
- package/cjs/domain/record/serialization/conversions/vStyleSheet.js +29 -0
- package/cjs/domain/record/serialization/conversions/vStyleSheet.js.map +1 -0
- package/cjs/domain/record/serialization/experimentalFeatures.d.ts +2 -0
- package/cjs/domain/record/serialization/experimentalFeatures.js +16 -0
- package/cjs/domain/record/serialization/experimentalFeatures.js.map +1 -0
- package/cjs/domain/record/serialization/index.d.ts +17 -0
- package/cjs/domain/record/serialization/index.js +37 -0
- package/cjs/domain/record/serialization/index.js.map +1 -0
- package/cjs/domain/record/serialization/insertionCursor.d.ts +57 -0
- package/cjs/domain/record/serialization/insertionCursor.js +68 -0
- package/cjs/domain/record/serialization/insertionCursor.js.map +1 -0
- package/cjs/domain/record/serialization/serialization.types.d.ts +24 -0
- package/cjs/domain/record/serialization/serialization.types.js +3 -0
- package/cjs/domain/record/serialization/serialization.types.js.map +1 -0
- package/cjs/domain/record/serialization/serializationStats.d.ts +12 -0
- package/cjs/domain/record/serialization/serializationStats.js +32 -0
- package/cjs/domain/record/serialization/serializationStats.js.map +1 -0
- package/cjs/domain/record/serialization/serializationTransaction.d.ts +96 -0
- package/cjs/domain/record/serialization/serializationTransaction.js +103 -0
- package/cjs/domain/record/serialization/serializationTransaction.js.map +1 -0
- package/cjs/domain/record/serialization/serializationUtils.d.ts +18 -0
- package/cjs/domain/record/serialization/serializationUtils.js +88 -0
- package/cjs/domain/record/serialization/serializationUtils.js.map +1 -0
- package/cjs/domain/record/serialization/serializeAttribute.d.ts +4 -0
- package/cjs/domain/record/serialization/serializeAttribute.js +42 -0
- package/cjs/domain/record/serialization/serializeAttribute.js.map +1 -0
- package/cjs/domain/record/serialization/serializeAttributes.d.ts +7 -0
- package/cjs/domain/record/serialization/serializeAttributes.js +167 -0
- package/cjs/domain/record/serialization/serializeAttributes.js.map +1 -0
- package/cjs/domain/record/serialization/serializeFullSnapshot.d.ts +5 -0
- package/cjs/domain/record/serialization/serializeFullSnapshot.js +34 -0
- package/cjs/domain/record/serialization/serializeFullSnapshot.js.map +1 -0
- package/cjs/domain/record/serialization/serializeFullSnapshotAsChange.d.ts +5 -0
- package/cjs/domain/record/serialization/serializeFullSnapshotAsChange.js +13 -0
- package/cjs/domain/record/serialization/serializeFullSnapshotAsChange.js.map +1 -0
- package/cjs/domain/record/serialization/serializeMutations.d.ts +11 -0
- package/cjs/domain/record/serialization/serializeMutations.js +262 -0
- package/cjs/domain/record/serialization/serializeMutations.js.map +1 -0
- package/cjs/domain/record/serialization/serializeMutationsAsChange.d.ts +5 -0
- package/cjs/domain/record/serialization/serializeMutationsAsChange.js +204 -0
- package/cjs/domain/record/serialization/serializeMutationsAsChange.js.map +1 -0
- package/cjs/domain/record/serialization/serializeNode.d.ts +7 -0
- package/cjs/domain/record/serialization/serializeNode.js +154 -0
- package/cjs/domain/record/serialization/serializeNode.js.map +1 -0
- package/cjs/domain/record/serialization/serializeNodeAsChange.d.ts +4 -0
- package/cjs/domain/record/serialization/serializeNodeAsChange.js +153 -0
- package/cjs/domain/record/serialization/serializeNodeAsChange.js.map +1 -0
- package/cjs/domain/record/serialization/serializeStyleSheets.d.ts +3 -0
- package/cjs/domain/record/serialization/serializeStyleSheets.js +30 -0
- package/cjs/domain/record/serialization/serializeStyleSheets.js.map +1 -0
- package/cjs/domain/record/serializationVerifier.d.ts +18 -0
- package/cjs/domain/record/serializationVerifier.js +126 -0
- package/cjs/domain/record/serializationVerifier.js.map +1 -0
- package/cjs/domain/record/shadowRootsController.d.ts +11 -0
- package/cjs/domain/record/shadowRootsController.js +45 -0
- package/cjs/domain/record/shadowRootsController.js.map +1 -0
- package/cjs/domain/record/startFullSnapshots.d.ts +10 -0
- package/cjs/domain/record/startFullSnapshots.js +50 -0
- package/cjs/domain/record/startFullSnapshots.js.map +1 -0
- package/cjs/domain/record/trackers/index.d.ts +12 -0
- package/cjs/domain/record/trackers/index.js +27 -0
- package/cjs/domain/record/trackers/index.js.map +1 -0
- package/cjs/domain/record/trackers/trackFocus.d.ts +5 -0
- package/cjs/domain/record/trackers/trackFocus.js +15 -0
- package/cjs/domain/record/trackers/trackFocus.js.map +1 -0
- package/cjs/domain/record/trackers/trackFrustration.d.ts +6 -0
- package/cjs/domain/record/trackers/trackFrustration.js +31 -0
- package/cjs/domain/record/trackers/trackFrustration.js.map +1 -0
- package/cjs/domain/record/trackers/trackInput.d.ts +4 -0
- package/cjs/domain/record/trackers/trackInput.js +104 -0
- package/cjs/domain/record/trackers/trackInput.js.map +1 -0
- package/cjs/domain/record/trackers/trackMediaInteraction.d.ts +5 -0
- package/cjs/domain/record/trackers/trackMediaInteraction.js +29 -0
- package/cjs/domain/record/trackers/trackMediaInteraction.js.map +1 -0
- package/cjs/domain/record/trackers/trackMouseInteraction.d.ts +5 -0
- package/cjs/domain/record/trackers/trackMouseInteraction.js +59 -0
- package/cjs/domain/record/trackers/trackMouseInteraction.js.map +1 -0
- package/cjs/domain/record/trackers/trackMove.d.ts +9 -0
- package/cjs/domain/record/trackers/trackMove.js +55 -0
- package/cjs/domain/record/trackers/trackMove.js.map +1 -0
- package/cjs/domain/record/trackers/trackMutation.d.ts +13 -0
- package/cjs/domain/record/trackers/trackMutation.js +41 -0
- package/cjs/domain/record/trackers/trackMutation.js.map +1 -0
- package/cjs/domain/record/trackers/trackScroll.d.ts +5 -0
- package/cjs/domain/record/trackers/trackScroll.js +48 -0
- package/cjs/domain/record/trackers/trackScroll.js.map +1 -0
- package/cjs/domain/record/trackers/trackStyleSheet.d.ts +6 -0
- package/cjs/domain/record/trackers/trackStyleSheet.js +89 -0
- package/cjs/domain/record/trackers/trackStyleSheet.js.map +1 -0
- package/cjs/domain/record/trackers/trackViewEnd.d.ts +5 -0
- package/cjs/domain/record/trackers/trackViewEnd.js +20 -0
- package/cjs/domain/record/trackers/trackViewEnd.js.map +1 -0
- package/cjs/domain/record/trackers/trackViewportResize.d.ts +6 -0
- package/cjs/domain/record/trackers/trackViewportResize.js +46 -0
- package/cjs/domain/record/trackers/trackViewportResize.js.map +1 -0
- package/cjs/domain/record/trackers/tracker.types.d.ts +3 -0
- package/cjs/domain/record/trackers/tracker.types.js +3 -0
- package/cjs/domain/record/trackers/tracker.types.js.map +1 -0
- package/cjs/domain/record/viewports.d.ts +20 -0
- package/cjs/domain/record/viewports.js +60 -0
- package/cjs/domain/record/viewports.js.map +1 -0
- package/cjs/domain/replayStats.d.ts +8 -0
- package/cjs/domain/replayStats.js +60 -0
- package/cjs/domain/replayStats.js.map +1 -0
- package/cjs/domain/scriptLoadingError.d.ts +6 -0
- package/cjs/domain/scriptLoadingError.js +26 -0
- package/cjs/domain/scriptLoadingError.js.map +1 -0
- package/cjs/domain/segmentCollection/buildReplayPayload.d.ts +15 -0
- package/cjs/domain/segmentCollection/buildReplayPayload.js +26 -0
- package/cjs/domain/segmentCollection/buildReplayPayload.js.map +1 -0
- package/cjs/domain/segmentCollection/index.d.ts +4 -0
- package/cjs/domain/segmentCollection/index.js +11 -0
- package/cjs/domain/segmentCollection/index.js.map +1 -0
- package/cjs/domain/segmentCollection/segment.d.ts +16 -0
- package/cjs/domain/segmentCollection/segment.js +82 -0
- package/cjs/domain/segmentCollection/segment.js.map +1 -0
- package/cjs/domain/segmentCollection/segmentCollection.d.ts +31 -0
- package/cjs/domain/segmentCollection/segmentCollection.js +113 -0
- package/cjs/domain/segmentCollection/segmentCollection.js.map +1 -0
- package/cjs/domain/segmentCollection/startSegmentTelemetry.d.ts +6 -0
- package/cjs/domain/segmentCollection/startSegmentTelemetry.js +52 -0
- package/cjs/domain/segmentCollection/startSegmentTelemetry.js.map +1 -0
- package/cjs/domain/startRecordBridge.d.ts +5 -0
- package/cjs/domain/startRecordBridge.js +17 -0
- package/cjs/domain/startRecordBridge.js.map +1 -0
- package/cjs/domain/startRecorderInitTelemetry.d.ts +15 -0
- package/cjs/domain/startRecorderInitTelemetry.js +55 -0
- package/cjs/domain/startRecorderInitTelemetry.js.map +1 -0
- package/cjs/entries/internal.d.ts +11 -0
- package/cjs/entries/internal.js +28 -0
- package/cjs/entries/internal.js.map +1 -0
- package/cjs/entries/internalSynthetics.d.ts +2 -0
- package/cjs/entries/internalSynthetics.js +27 -0
- package/cjs/entries/internalSynthetics.js.map +1 -0
- package/cjs/entries/main.d.ts +23 -0
- package/cjs/entries/main.js +35 -0
- package/cjs/entries/main.js.map +1 -0
- package/cjs/types/index.d.ts +3 -0
- package/cjs/types/index.js +18 -0
- package/cjs/types/index.js.map +1 -0
- package/cjs/types/profiling.d.ts +296 -0
- package/cjs/types/profiling.js +6 -0
- package/cjs/types/profiling.js.map +1 -0
- package/cjs/types/sessionReplay.d.ts +934 -0
- package/cjs/types/sessionReplay.js +6 -0
- package/cjs/types/sessionReplay.js.map +1 -0
- package/cjs/types/sessionReplayConstants.d.ts +71 -0
- package/cjs/types/sessionReplayConstants.js +67 -0
- package/cjs/types/sessionReplayConstants.js.map +1 -0
- package/esm/boot/isBrowserSupported.d.ts +4 -0
- package/esm/boot/isBrowserSupported.js +14 -0
- package/esm/boot/isBrowserSupported.js.map +1 -0
- package/esm/boot/lazyLoadProfiler.d.ts +3 -0
- package/esm/boot/lazyLoadProfiler.js +19 -0
- package/esm/boot/lazyLoadProfiler.js.map +1 -0
- package/esm/boot/lazyLoadRecorder.d.ts +3 -0
- package/esm/boot/lazyLoadRecorder.js +19 -0
- package/esm/boot/lazyLoadRecorder.js.map +1 -0
- package/esm/boot/postStartStrategy.d.ts +33 -0
- package/esm/boot/postStartStrategy.js +95 -0
- package/esm/boot/postStartStrategy.js.map +1 -0
- package/esm/boot/preStartStrategy.d.ts +6 -0
- package/esm/boot/preStartStrategy.js +21 -0
- package/esm/boot/preStartStrategy.js.map +1 -0
- package/esm/boot/profilerApi.d.ts +2 -0
- package/esm/boot/profilerApi.js +49 -0
- package/esm/boot/profilerApi.js.map +1 -0
- package/esm/boot/recorderApi.d.ts +3 -0
- package/esm/boot/recorderApi.js +68 -0
- package/esm/boot/recorderApi.js.map +1 -0
- package/esm/boot/startRecording.d.ts +6 -0
- package/esm/boot/startRecording.js +42 -0
- package/esm/boot/startRecording.js.map +1 -0
- package/esm/domain/deflate/deflateEncoder.d.ts +3 -0
- package/esm/domain/deflate/deflateEncoder.js +107 -0
- package/esm/domain/deflate/deflateEncoder.js.map +1 -0
- package/esm/domain/deflate/deflateWorker.d.ts +29 -0
- package/esm/domain/deflate/deflateWorker.js +97 -0
- package/esm/domain/deflate/deflateWorker.js.map +1 -0
- package/esm/domain/deflate/index.d.ts +3 -0
- package/esm/domain/deflate/index.js +3 -0
- package/esm/domain/deflate/index.js.map +1 -0
- package/esm/domain/getSessionReplayLink.d.ts +2 -0
- package/esm/domain/getSessionReplayLink.js +32 -0
- package/esm/domain/getSessionReplayLink.js.map +1 -0
- package/esm/domain/profiling/actionHistory.d.ts +10 -0
- package/esm/domain/profiling/actionHistory.js +45 -0
- package/esm/domain/profiling/actionHistory.js.map +1 -0
- package/esm/domain/profiling/longTaskHistory.d.ts +11 -0
- package/esm/domain/profiling/longTaskHistory.js +24 -0
- package/esm/domain/profiling/longTaskHistory.js.map +1 -0
- package/esm/domain/profiling/profiler.d.ts +7 -0
- package/esm/domain/profiling/profiler.js +263 -0
- package/esm/domain/profiling/profiler.js.map +1 -0
- package/esm/domain/profiling/profilingContext.d.ts +6 -0
- package/esm/domain/profiling/profilingContext.js +28 -0
- package/esm/domain/profiling/profilingContext.js.map +1 -0
- package/esm/domain/profiling/profilingSupported.d.ts +1 -0
- package/esm/domain/profiling/profilingSupported.js +8 -0
- package/esm/domain/profiling/profilingSupported.js.map +1 -0
- package/esm/domain/profiling/test-utils/mockedTrace.d.ts +3 -0
- package/esm/domain/profiling/test-utils/mockedTrace.js +54 -0
- package/esm/domain/profiling/test-utils/mockedTrace.js.map +1 -0
- package/esm/domain/profiling/transport/assembly.d.ts +7 -0
- package/esm/domain/profiling/transport/assembly.js +42 -0
- package/esm/domain/profiling/transport/assembly.js.map +1 -0
- package/esm/domain/profiling/transport/buildProfileEventAttributes.d.ts +33 -0
- package/esm/domain/profiling/transport/buildProfileEventAttributes.js +60 -0
- package/esm/domain/profiling/transport/buildProfileEventAttributes.js.map +1 -0
- package/esm/domain/profiling/types/index.d.ts +2 -0
- package/esm/domain/profiling/types/index.js +2 -0
- package/esm/domain/profiling/types/index.js.map +1 -0
- package/esm/domain/profiling/types/profilerApi.types.d.ts +58 -0
- package/esm/domain/profiling/types/profilerApi.types.js +4 -0
- package/esm/domain/profiling/types/profilerApi.types.js.map +1 -0
- package/esm/domain/profiling/types/rumProfiler.types.d.ts +55 -0
- package/esm/domain/profiling/types/rumProfiler.types.js +2 -0
- package/esm/domain/profiling/types/rumProfiler.types.js.map +1 -0
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.d.ts +1 -0
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.js +3 -0
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.js.map +1 -0
- package/esm/domain/profiling/utils/getDefaultViewName.d.ts +1 -0
- package/esm/domain/profiling/utils/getDefaultViewName.js +11 -0
- package/esm/domain/profiling/utils/getDefaultViewName.js.map +1 -0
- package/esm/domain/profiling/utils/getNumberOfSamples.d.ts +8 -0
- package/esm/domain/profiling/utils/getNumberOfSamples.js +16 -0
- package/esm/domain/profiling/utils/getNumberOfSamples.js.map +1 -0
- package/esm/domain/profiling/vitalHistory.d.ts +10 -0
- package/esm/domain/profiling/vitalHistory.js +38 -0
- package/esm/domain/profiling/vitalHistory.js.map +1 -0
- package/esm/domain/record/assembly.d.ts +3 -0
- package/esm/domain/record/assembly.js +13 -0
- package/esm/domain/record/assembly.js.map +1 -0
- package/esm/domain/record/elementsScrollPositions.d.ts +10 -0
- package/esm/domain/record/elementsScrollPositions.js +20 -0
- package/esm/domain/record/elementsScrollPositions.js.map +1 -0
- package/esm/domain/record/eventsUtils.d.ts +2 -0
- package/esm/domain/record/eventsUtils.js +11 -0
- package/esm/domain/record/eventsUtils.js.map +1 -0
- package/esm/domain/record/index.d.ts +6 -0
- package/esm/domain/record/index.js +5 -0
- package/esm/domain/record/index.js.map +1 -0
- package/esm/domain/record/internalApi.d.ts +22 -0
- package/esm/domain/record/internalApi.js +51 -0
- package/esm/domain/record/internalApi.js.map +1 -0
- package/esm/domain/record/itemIds.d.ts +40 -0
- package/esm/domain/record/itemIds.js +52 -0
- package/esm/domain/record/itemIds.js.map +1 -0
- package/esm/domain/record/mutationBatch.d.ts +12 -0
- package/esm/domain/record/mutationBatch.js +40 -0
- package/esm/domain/record/mutationBatch.js.map +1 -0
- package/esm/domain/record/record.d.ts +16 -0
- package/esm/domain/record/record.js +52 -0
- package/esm/domain/record/record.js.map +1 -0
- package/esm/domain/record/record.types.d.ts +18 -0
- package/esm/domain/record/record.types.js +2 -0
- package/esm/domain/record/record.types.js.map +1 -0
- package/esm/domain/record/recordingScope.d.ts +24 -0
- package/esm/domain/record/recordingScope.js +26 -0
- package/esm/domain/record/recordingScope.js.map +1 -0
- package/esm/domain/record/serialization/changeEncoder.d.ts +22 -0
- package/esm/domain/record/serialization/changeEncoder.js +56 -0
- package/esm/domain/record/serialization/changeEncoder.js.map +1 -0
- package/esm/domain/record/serialization/conversions/changeConverter.d.ts +10 -0
- package/esm/domain/record/serialization/conversions/changeConverter.js +213 -0
- package/esm/domain/record/serialization/conversions/changeConverter.js.map +1 -0
- package/esm/domain/record/serialization/conversions/changeDecoder.d.ts +16 -0
- package/esm/domain/record/serialization/conversions/changeDecoder.js +134 -0
- package/esm/domain/record/serialization/conversions/changeDecoder.js.map +1 -0
- package/esm/domain/record/serialization/conversions/index.d.ts +7 -0
- package/esm/domain/record/serialization/conversions/index.js +4 -0
- package/esm/domain/record/serialization/conversions/index.js.map +1 -0
- package/esm/domain/record/serialization/conversions/mutationLog.d.ts +15 -0
- package/esm/domain/record/serialization/conversions/mutationLog.js +33 -0
- package/esm/domain/record/serialization/conversions/mutationLog.js.map +1 -0
- package/esm/domain/record/serialization/conversions/nodeIdRemapper.d.ts +10 -0
- package/esm/domain/record/serialization/conversions/nodeIdRemapper.js +49 -0
- package/esm/domain/record/serialization/conversions/nodeIdRemapper.js.map +1 -0
- package/esm/domain/record/serialization/conversions/renderOptions.d.ts +6 -0
- package/esm/domain/record/serialization/conversions/renderOptions.js +9 -0
- package/esm/domain/record/serialization/conversions/renderOptions.js.map +1 -0
- package/esm/domain/record/serialization/conversions/stringTable.d.ts +5 -0
- package/esm/domain/record/serialization/conversions/stringTable.js +19 -0
- package/esm/domain/record/serialization/conversions/stringTable.js.map +1 -0
- package/esm/domain/record/serialization/conversions/vDocument.d.ts +23 -0
- package/esm/domain/record/serialization/conversions/vDocument.js +173 -0
- package/esm/domain/record/serialization/conversions/vDocument.js.map +1 -0
- package/esm/domain/record/serialization/conversions/vNode.d.ts +66 -0
- package/esm/domain/record/serialization/conversions/vNode.js +282 -0
- package/esm/domain/record/serialization/conversions/vNode.js.map +1 -0
- package/esm/domain/record/serialization/conversions/vStyleSheet.d.ts +16 -0
- package/esm/domain/record/serialization/conversions/vStyleSheet.js +26 -0
- package/esm/domain/record/serialization/conversions/vStyleSheet.js.map +1 -0
- package/esm/domain/record/serialization/experimentalFeatures.d.ts +2 -0
- package/esm/domain/record/serialization/experimentalFeatures.js +12 -0
- package/esm/domain/record/serialization/experimentalFeatures.js.map +1 -0
- package/esm/domain/record/serialization/index.d.ts +17 -0
- package/esm/domain/record/serialization/index.js +14 -0
- package/esm/domain/record/serialization/index.js.map +1 -0
- package/esm/domain/record/serialization/insertionCursor.d.ts +57 -0
- package/esm/domain/record/serialization/insertionCursor.js +64 -0
- package/esm/domain/record/serialization/insertionCursor.js.map +1 -0
- package/esm/domain/record/serialization/serialization.types.d.ts +24 -0
- package/esm/domain/record/serialization/serialization.types.js +2 -0
- package/esm/domain/record/serialization/serialization.types.js.map +1 -0
- package/esm/domain/record/serialization/serializationStats.d.ts +12 -0
- package/esm/domain/record/serialization/serializationStats.js +27 -0
- package/esm/domain/record/serialization/serializationStats.js.map +1 -0
- package/esm/domain/record/serialization/serializationTransaction.d.ts +96 -0
- package/esm/domain/record/serialization/serializationTransaction.js +99 -0
- package/esm/domain/record/serialization/serializationTransaction.js.map +1 -0
- package/esm/domain/record/serialization/serializationUtils.d.ts +18 -0
- package/esm/domain/record/serialization/serializationUtils.js +80 -0
- package/esm/domain/record/serialization/serializationUtils.js.map +1 -0
- package/esm/domain/record/serialization/serializeAttribute.d.ts +4 -0
- package/esm/domain/record/serialization/serializeAttribute.js +38 -0
- package/esm/domain/record/serialization/serializeAttribute.js.map +1 -0
- package/esm/domain/record/serialization/serializeAttributes.d.ts +7 -0
- package/esm/domain/record/serialization/serializeAttributes.js +161 -0
- package/esm/domain/record/serialization/serializeAttributes.js.map +1 -0
- package/esm/domain/record/serialization/serializeFullSnapshot.d.ts +5 -0
- package/esm/domain/record/serialization/serializeFullSnapshot.js +31 -0
- package/esm/domain/record/serialization/serializeFullSnapshot.js.map +1 -0
- package/esm/domain/record/serialization/serializeFullSnapshotAsChange.d.ts +5 -0
- package/esm/domain/record/serialization/serializeFullSnapshotAsChange.js +10 -0
- package/esm/domain/record/serialization/serializeFullSnapshotAsChange.js.map +1 -0
- package/esm/domain/record/serialization/serializeMutations.d.ts +11 -0
- package/esm/domain/record/serialization/serializeMutations.js +257 -0
- package/esm/domain/record/serialization/serializeMutations.js.map +1 -0
- package/esm/domain/record/serialization/serializeMutationsAsChange.d.ts +5 -0
- package/esm/domain/record/serialization/serializeMutationsAsChange.js +201 -0
- package/esm/domain/record/serialization/serializeMutationsAsChange.js.map +1 -0
- package/esm/domain/record/serialization/serializeNode.d.ts +7 -0
- package/esm/domain/record/serialization/serializeNode.js +149 -0
- package/esm/domain/record/serialization/serializeNode.js.map +1 -0
- package/esm/domain/record/serialization/serializeNodeAsChange.d.ts +4 -0
- package/esm/domain/record/serialization/serializeNodeAsChange.js +150 -0
- package/esm/domain/record/serialization/serializeNodeAsChange.js.map +1 -0
- package/esm/domain/record/serialization/serializeStyleSheets.d.ts +3 -0
- package/esm/domain/record/serialization/serializeStyleSheets.js +27 -0
- package/esm/domain/record/serialization/serializeStyleSheets.js.map +1 -0
- package/esm/domain/record/serializationVerifier.d.ts +18 -0
- package/esm/domain/record/serializationVerifier.js +123 -0
- package/esm/domain/record/serializationVerifier.js.map +1 -0
- package/esm/domain/record/shadowRootsController.d.ts +11 -0
- package/esm/domain/record/shadowRootsController.js +41 -0
- package/esm/domain/record/shadowRootsController.js.map +1 -0
- package/esm/domain/record/startFullSnapshots.d.ts +10 -0
- package/esm/domain/record/startFullSnapshots.js +46 -0
- package/esm/domain/record/startFullSnapshots.js.map +1 -0
- package/esm/domain/record/trackers/index.d.ts +12 -0
- package/esm/domain/record/trackers/index.js +12 -0
- package/esm/domain/record/trackers/index.js.map +1 -0
- package/esm/domain/record/trackers/trackFocus.d.ts +5 -0
- package/esm/domain/record/trackers/trackFocus.js +12 -0
- package/esm/domain/record/trackers/trackFocus.js.map +1 -0
- package/esm/domain/record/trackers/trackFrustration.d.ts +6 -0
- package/esm/domain/record/trackers/trackFrustration.js +28 -0
- package/esm/domain/record/trackers/trackFrustration.js.map +1 -0
- package/esm/domain/record/trackers/trackInput.d.ts +4 -0
- package/esm/domain/record/trackers/trackInput.js +101 -0
- package/esm/domain/record/trackers/trackInput.js.map +1 -0
- package/esm/domain/record/trackers/trackMediaInteraction.d.ts +5 -0
- package/esm/domain/record/trackers/trackMediaInteraction.js +26 -0
- package/esm/domain/record/trackers/trackMediaInteraction.js.map +1 -0
- package/esm/domain/record/trackers/trackMouseInteraction.d.ts +5 -0
- package/esm/domain/record/trackers/trackMouseInteraction.js +56 -0
- package/esm/domain/record/trackers/trackMouseInteraction.js.map +1 -0
- package/esm/domain/record/trackers/trackMove.d.ts +9 -0
- package/esm/domain/record/trackers/trackMove.js +51 -0
- package/esm/domain/record/trackers/trackMove.js.map +1 -0
- package/esm/domain/record/trackers/trackMutation.d.ts +13 -0
- package/esm/domain/record/trackers/trackMutation.js +38 -0
- package/esm/domain/record/trackers/trackMutation.js.map +1 -0
- package/esm/domain/record/trackers/trackScroll.d.ts +5 -0
- package/esm/domain/record/trackers/trackScroll.js +45 -0
- package/esm/domain/record/trackers/trackScroll.js.map +1 -0
- package/esm/domain/record/trackers/trackStyleSheet.d.ts +6 -0
- package/esm/domain/record/trackers/trackStyleSheet.js +85 -0
- package/esm/domain/record/trackers/trackStyleSheet.js.map +1 -0
- package/esm/domain/record/trackers/trackViewEnd.d.ts +5 -0
- package/esm/domain/record/trackers/trackViewEnd.js +17 -0
- package/esm/domain/record/trackers/trackViewEnd.js.map +1 -0
- package/esm/domain/record/trackers/trackViewportResize.d.ts +6 -0
- package/esm/domain/record/trackers/trackViewportResize.js +42 -0
- package/esm/domain/record/trackers/trackViewportResize.js.map +1 -0
- package/esm/domain/record/trackers/tracker.types.d.ts +3 -0
- package/esm/domain/record/trackers/tracker.types.js +2 -0
- package/esm/domain/record/trackers/tracker.types.js.map +1 -0
- package/esm/domain/record/viewports.d.ts +20 -0
- package/esm/domain/record/viewports.js +55 -0
- package/esm/domain/record/viewports.js.map +1 -0
- package/esm/domain/replayStats.d.ts +8 -0
- package/esm/domain/replayStats.js +51 -0
- package/esm/domain/replayStats.js.map +1 -0
- package/esm/domain/scriptLoadingError.d.ts +6 -0
- package/esm/domain/scriptLoadingError.js +23 -0
- package/esm/domain/scriptLoadingError.js.map +1 -0
- package/esm/domain/segmentCollection/buildReplayPayload.d.ts +15 -0
- package/esm/domain/segmentCollection/buildReplayPayload.js +23 -0
- package/esm/domain/segmentCollection/buildReplayPayload.js.map +1 -0
- package/esm/domain/segmentCollection/index.d.ts +4 -0
- package/esm/domain/segmentCollection/index.js +4 -0
- package/esm/domain/segmentCollection/index.js.map +1 -0
- package/esm/domain/segmentCollection/segment.d.ts +16 -0
- package/esm/domain/segmentCollection/segment.js +46 -0
- package/esm/domain/segmentCollection/segment.js.map +1 -0
- package/esm/domain/segmentCollection/segmentCollection.d.ts +31 -0
- package/esm/domain/segmentCollection/segmentCollection.js +106 -0
- package/esm/domain/segmentCollection/segmentCollection.js.map +1 -0
- package/esm/domain/segmentCollection/startSegmentTelemetry.d.ts +6 -0
- package/esm/domain/segmentCollection/startSegmentTelemetry.js +49 -0
- package/esm/domain/segmentCollection/startSegmentTelemetry.js.map +1 -0
- package/esm/domain/startRecordBridge.d.ts +5 -0
- package/esm/domain/startRecordBridge.js +14 -0
- package/esm/domain/startRecordBridge.js.map +1 -0
- package/esm/domain/startRecorderInitTelemetry.d.ts +15 -0
- package/esm/domain/startRecorderInitTelemetry.js +52 -0
- package/esm/domain/startRecorderInitTelemetry.js.map +1 -0
- package/esm/entries/internal.d.ts +11 -0
- package/esm/entries/internal.js +4 -0
- package/esm/entries/internal.js.map +1 -0
- package/esm/entries/internalSynthetics.d.ts +2 -0
- package/esm/entries/internalSynthetics.js +23 -0
- package/esm/entries/internalSynthetics.js.map +1 -0
- package/esm/entries/main.d.ts +23 -0
- package/esm/entries/main.js +31 -0
- package/esm/entries/main.js.map +1 -0
- package/esm/types/index.d.ts +3 -0
- package/esm/types/index.js +2 -0
- package/esm/types/index.js.map +1 -0
- package/esm/types/profiling.d.ts +296 -0
- package/esm/types/profiling.js +5 -0
- package/esm/types/profiling.js.map +1 -0
- package/esm/types/sessionReplay.d.ts +934 -0
- package/esm/types/sessionReplay.js +5 -0
- package/esm/types/sessionReplay.js.map +1 -0
- package/esm/types/sessionReplayConstants.d.ts +71 -0
- package/esm/types/sessionReplayConstants.js +64 -0
- package/esm/types/sessionReplayConstants.js.map +1 -0
- package/internal/package.json +6 -0
- package/internal-synthetics/package.json +6 -0
- package/package.json +52 -0
- package/src/boot/isBrowserSupported.ts +14 -0
- package/src/boot/lazyLoadProfiler.ts +20 -0
- package/src/boot/lazyLoadRecorder.ts +20 -0
- package/src/boot/postStartStrategy.ts +176 -0
- package/src/boot/preStartStrategy.ts +34 -0
- package/src/boot/profilerApi.ts +82 -0
- package/src/boot/recorderApi.ts +113 -0
- package/src/boot/startRecording.ts +70 -0
- package/src/domain/deflate/deflateEncoder.ts +144 -0
- package/src/domain/deflate/deflateWorker.ts +152 -0
- package/src/domain/deflate/index.ts +9 -0
- package/src/domain/getSessionReplayLink.ts +40 -0
- package/src/domain/profiling/actionHistory.ts +65 -0
- package/src/domain/profiling/longTaskHistory.ts +40 -0
- package/src/domain/profiling/profiler.ts +366 -0
- package/src/domain/profiling/profilingContext.ts +39 -0
- package/src/domain/profiling/profilingSupported.ts +10 -0
- package/src/domain/profiling/test-utils/mockedTrace.ts +58 -0
- package/src/domain/profiling/transport/assembly.ts +63 -0
- package/src/domain/profiling/transport/buildProfileEventAttributes.ts +106 -0
- package/src/domain/profiling/types/index.ts +2 -0
- package/src/domain/profiling/types/profilerApi.types.ts +87 -0
- package/src/domain/profiling/types/rumProfiler.types.ts +62 -0
- package/src/domain/profiling/utils/getCustomOrDefaultViewName.ts +4 -0
- package/src/domain/profiling/utils/getDefaultViewName.ts +12 -0
- package/src/domain/profiling/utils/getNumberOfSamples.ts +17 -0
- package/src/domain/profiling/vitalHistory.ts +58 -0
- package/src/domain/record/assembly.ts +19 -0
- package/src/domain/record/elementsScrollPositions.ts +28 -0
- package/src/domain/record/eventsUtils.ts +12 -0
- package/src/domain/record/index.ts +12 -0
- package/src/domain/record/internalApi.ts +84 -0
- package/src/domain/record/itemIds.ts +97 -0
- package/src/domain/record/mutationBatch.ts +47 -0
- package/src/domain/record/record.ts +90 -0
- package/src/domain/record/record.types.ts +22 -0
- package/src/domain/record/recordingScope.ts +58 -0
- package/src/domain/record/serialization/changeEncoder.ts +89 -0
- package/src/domain/record/serialization/conversions/changeConverter.ts +277 -0
- package/src/domain/record/serialization/conversions/changeDecoder.ts +192 -0
- package/src/domain/record/serialization/conversions/index.ts +7 -0
- package/src/domain/record/serialization/conversions/mutationLog.ts +56 -0
- package/src/domain/record/serialization/conversions/nodeIdRemapper.ts +69 -0
- package/src/domain/record/serialization/conversions/renderOptions.ts +14 -0
- package/src/domain/record/serialization/conversions/stringTable.ts +25 -0
- package/src/domain/record/serialization/conversions/vDocument.ts +239 -0
- package/src/domain/record/serialization/conversions/vNode.ts +417 -0
- package/src/domain/record/serialization/conversions/vStyleSheet.ts +47 -0
- package/src/domain/record/serialization/experimentalFeatures.ts +15 -0
- package/src/domain/record/serialization/index.ts +21 -0
- package/src/domain/record/serialization/insertionCursor.ts +131 -0
- package/src/domain/record/serialization/serialization.types.ts +38 -0
- package/src/domain/record/serialization/serializationStats.ts +43 -0
- package/src/domain/record/serialization/serializationTransaction.ts +255 -0
- package/src/domain/record/serialization/serializationUtils.ts +103 -0
- package/src/domain/record/serialization/serializeAttribute.ts +55 -0
- package/src/domain/record/serialization/serializeAttributes.ts +194 -0
- package/src/domain/record/serialization/serializeFullSnapshot.ts +46 -0
- package/src/domain/record/serialization/serializeFullSnapshotAsChange.ts +33 -0
- package/src/domain/record/serialization/serializeMutations.ts +395 -0
- package/src/domain/record/serialization/serializeMutationsAsChange.ts +298 -0
- package/src/domain/record/serialization/serializeNode.ts +229 -0
- package/src/domain/record/serialization/serializeNodeAsChange.ts +237 -0
- package/src/domain/record/serialization/serializeStyleSheets.ts +36 -0
- package/src/domain/record/serializationVerifier.ts +208 -0
- package/src/domain/record/shadowRootsController.ts +62 -0
- package/src/domain/record/startFullSnapshots.ts +92 -0
- package/src/domain/record/trackers/index.ts +12 -0
- package/src/domain/record/trackers/trackFocus.ts +16 -0
- package/src/domain/record/trackers/trackFrustration.ts +39 -0
- package/src/domain/record/trackers/trackInput.ts +128 -0
- package/src/domain/record/trackers/trackMediaInteraction.ts +43 -0
- package/src/domain/record/trackers/trackMouseInteraction.ts +74 -0
- package/src/domain/record/trackers/trackMove.ts +78 -0
- package/src/domain/record/trackers/trackMutation.ts +74 -0
- package/src/domain/record/trackers/trackScroll.ts +61 -0
- package/src/domain/record/trackers/trackStyleSheet.ts +117 -0
- package/src/domain/record/trackers/trackViewEnd.ts +27 -0
- package/src/domain/record/trackers/trackViewportResize.ts +69 -0
- package/src/domain/record/trackers/tracker.types.ts +3 -0
- package/src/domain/record/viewports.ts +68 -0
- package/src/domain/replayStats.ts +61 -0
- package/src/domain/scriptLoadingError.ts +36 -0
- package/src/domain/segmentCollection/buildReplayPayload.ts +52 -0
- package/src/domain/segmentCollection/index.ts +4 -0
- package/src/domain/segmentCollection/segment.ts +79 -0
- package/src/domain/segmentCollection/segmentCollection.ts +200 -0
- package/src/domain/segmentCollection/startSegmentTelemetry.ts +91 -0
- package/src/domain/startRecordBridge.ts +17 -0
- package/src/domain/startRecorderInitTelemetry.ts +90 -0
- package/src/entries/internal.ts +18 -0
- package/src/entries/internalSynthetics.ts +24 -0
- package/src/entries/main.ts +96 -0
- package/src/types/index.ts +3 -0
- package/src/types/profiling.ts +298 -0
- package/src/types/sessionReplay.ts +990 -0
- package/src/types/sessionReplayConstants.ts +130 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { noop } from '@datadog/browser-core';
|
|
2
|
+
import { IncrementalSource, RecordType } from '../../types';
|
|
3
|
+
import { createRecordingScope } from './recordingScope';
|
|
4
|
+
import { createChangeConverter, createCopyingNodeIdRemapper, serializeFullSnapshotAsChange, serializeMutationsAsChange, } from './serialization';
|
|
5
|
+
export function createSerializationVerifier(scope, onError) {
|
|
6
|
+
// Node id numbering differs between the V1 and Change serialization
|
|
7
|
+
// algorithms, so if we want to be able to compare their output, we need to replace the
|
|
8
|
+
// 'input' node ids in each Change record with the 'output' node ids produced by the V1
|
|
9
|
+
// serialization algorithm. This NodeIdRemapper will handle that task.
|
|
10
|
+
const nodeIdRemapper = createCopyingNodeIdRemapper();
|
|
11
|
+
scope.nodeIds = nodeIdRemapper.outputNodeIds;
|
|
12
|
+
// Create a separate recording scope to use for Change serialization.
|
|
13
|
+
const changeScope = createRecordingScope(scope.configuration, scope.elementsScrollPositions, {
|
|
14
|
+
addShadowRoot: noop,
|
|
15
|
+
removeShadowRoot: noop,
|
|
16
|
+
flush: noop,
|
|
17
|
+
stop: noop,
|
|
18
|
+
});
|
|
19
|
+
changeScope.nodeIds = nodeIdRemapper.inputNodeIds;
|
|
20
|
+
// Create the converter that we'll use to transform the records generated by Change
|
|
21
|
+
// serialization into the V1 format.
|
|
22
|
+
let converter = createChangeConverter();
|
|
23
|
+
const { unsubscribe } = scope.serializeObservable.subscribe((event) => {
|
|
24
|
+
let changeRecord;
|
|
25
|
+
const emitRecord = (record) => {
|
|
26
|
+
changeRecord = record;
|
|
27
|
+
};
|
|
28
|
+
switch (event.type) {
|
|
29
|
+
case 'full':
|
|
30
|
+
// Create a new converter since we've transitioned to a new view.
|
|
31
|
+
converter = createChangeConverter();
|
|
32
|
+
serializeFullSnapshotAsChange(event.timestamp, event.kind, event.target, emitRecord, noop, changeScope);
|
|
33
|
+
break;
|
|
34
|
+
case 'incremental':
|
|
35
|
+
serializeMutationsAsChange(event.timestamp, event.target, emitRecord, noop, changeScope);
|
|
36
|
+
break;
|
|
37
|
+
default:
|
|
38
|
+
event;
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (!changeRecord) {
|
|
42
|
+
onError('No change record serialized', event);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
try {
|
|
46
|
+
const v1Record = event.v1;
|
|
47
|
+
const convertedChangeRecord = converter.convert(changeRecord, {
|
|
48
|
+
nodeIdRemapper,
|
|
49
|
+
timestamp: v1Record.timestamp,
|
|
50
|
+
});
|
|
51
|
+
verifySnapshotsMatch(v1Record, convertedChangeRecord, onError);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
onError('Error verifying change record', error);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
return {
|
|
58
|
+
stop: unsubscribe,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function verifySnapshotsMatch(expectedRecord, actualRecord, onError) {
|
|
62
|
+
if (expectedRecord.type !== RecordType.IncrementalSnapshot ||
|
|
63
|
+
expectedRecord.data.source !== IncrementalSource.Mutation ||
|
|
64
|
+
actualRecord.type !== RecordType.IncrementalSnapshot ||
|
|
65
|
+
actualRecord.data.source !== IncrementalSource.Mutation) {
|
|
66
|
+
// We expect full snapshots to be byte-for-byte equivalent, full stop.
|
|
67
|
+
verifyByteForByteEquivalence('full snapshot', expectedRecord, actualRecord, onError);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
// Verify that everything but the data is byte-for-byte equivalent.
|
|
71
|
+
verifyByteForByteEquivalence('incremental snapshot wrapper', { ...expectedRecord, data: null }, { ...actualRecord, data: null }, onError);
|
|
72
|
+
// Within the data, verify that everything but attribute mutations and node remove
|
|
73
|
+
// mutations are byte-for-byte equivalent.
|
|
74
|
+
verifyByteForByteEquivalence('incremental snapshot data (without attributes and removes)', { ...expectedRecord.data, attributes: null, removes: null }, { ...actualRecord.data, attributes: null, removes: null }, onError);
|
|
75
|
+
// Verify that the attribute mutations are byte-for-byte equivalent except for order.
|
|
76
|
+
const orderAttributeMutations = (a, b) => a.id - b.id;
|
|
77
|
+
verifyByteForByteEquivalence('incremental snapshot attribute mutations', expectedRecord.data.attributes.sort(orderAttributeMutations), actualRecord.data.attributes.sort(orderAttributeMutations), onError);
|
|
78
|
+
// Gather the set of removes performed by V1 serialization.
|
|
79
|
+
const expectedRemoves = expectedRecord.data.removes;
|
|
80
|
+
const expectedRemovedNodes = new Set();
|
|
81
|
+
for (const remove of expectedRemoves) {
|
|
82
|
+
expectedRemovedNodes.add(remove.id);
|
|
83
|
+
}
|
|
84
|
+
// Gather the set of removes performed by Change serialization. Change serialization is
|
|
85
|
+
// more conservative about remove reporting, so it will report some removes that V1
|
|
86
|
+
// serialization deliberately skips. To paper over that difference, we filter out
|
|
87
|
+
// removes that V1 serialization didn't also report.
|
|
88
|
+
const actualRemoves = actualRecord.data.removes.filter((remove) => expectedRemovedNodes.has(remove.id));
|
|
89
|
+
// Verify that the removes that remain are byte-for-byte equivalent.
|
|
90
|
+
verifyByteForByteEquivalence('incremental snapshot removes', expectedRemoves, actualRemoves, onError);
|
|
91
|
+
}
|
|
92
|
+
function verifyByteForByteEquivalence(context, expected, actual, onError) {
|
|
93
|
+
const expectedString = JSON.stringify(expected);
|
|
94
|
+
const actualString = JSON.stringify(actual);
|
|
95
|
+
if (actualString !== expectedString) {
|
|
96
|
+
onError('Serialization mismatch', {
|
|
97
|
+
context,
|
|
98
|
+
mismatch: createSerializationMismatchContext(expectedString, actualString),
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function createSerializationMismatchContext(expected, actual) {
|
|
103
|
+
const length = Math.min(expected.length, actual.length);
|
|
104
|
+
try {
|
|
105
|
+
let firstDifferenceIndex = 0;
|
|
106
|
+
while (firstDifferenceIndex < length && expected[firstDifferenceIndex] === actual[firstDifferenceIndex]) {
|
|
107
|
+
firstDifferenceIndex++;
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
expected: getStringNearPosition(expected, firstDifferenceIndex),
|
|
111
|
+
actual: getStringNearPosition(actual, firstDifferenceIndex),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
catch (e) {
|
|
115
|
+
return { firstDifferenceError: JSON.stringify(e) };
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
function getStringNearPosition(str, index) {
|
|
119
|
+
const leftContextStart = Math.max(index - 50, 0);
|
|
120
|
+
const rightContextEnd = Math.min(index + 150, str.length);
|
|
121
|
+
return `${str.substring(leftContextStart, index)}(!)${str.substring(index, rightContextEnd)}`;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=serializationVerifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializationVerifier.js","sourceRoot":"","sources":["../../../src/domain/record/serializationVerifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAU3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAGvD,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,6BAA6B,EAC7B,0BAA0B,GAC3B,MAAM,iBAAiB,CAAA;AAqBxB,MAAM,UAAU,2BAA2B,CACzC,KAAqB,EACrB,OAA4B;IAE5B,oEAAoE;IACpE,uFAAuF;IACvF,uFAAuF;IACvF,sEAAsE;IACtE,MAAM,cAAc,GAAG,2BAA2B,EAAE,CAAA;IACpD,KAAK,CAAC,OAAO,GAAG,cAAc,CAAC,aAAa,CAAA;IAE5C,qEAAqE;IACrE,MAAM,WAAW,GAAG,oBAAoB,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,uBAAuB,EAAE;QAC3F,aAAa,EAAE,IAAI;QACnB,gBAAgB,EAAE,IAAI;QACtB,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,IAAI;KACc,CAAC,CAAA;IAC3B,WAAW,CAAC,OAAO,GAAG,cAAc,CAAC,YAAY,CAAA;IAEjD,mFAAmF;IACnF,oCAAoC;IACpC,IAAI,SAAS,GAAG,qBAAqB,EAAE,CAAA;IAEvC,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,KAAqB,EAAE,EAAE;QACpF,IAAI,YAAuC,CAAA;QAC3C,MAAM,UAAU,GAAuB,CAAC,MAAqB,EAAQ,EAAE;YACrE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C;SAC5D,CAAA;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,EAAE,oBAAoB,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAA;IACpD,CAAC;AACH,CAAC;AAED,SAAS,qBAAqB,CAAC,GAAW,EAAE,KAAa;IACvD,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE,EAAE,CAAC,CAAC,CAAA;IAChD,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACzD,OAAO,GAAG,GAAG,CAAC,SAAS,CAAC,gBAAgB,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE,eAAe,CAAC,EAAE,CAAA;AAC/F,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RecordingScope } from './recordingScope.ts';
|
|
2
|
+
import type { EmitRecordCallback, EmitStatsCallback } from './record.types';
|
|
3
|
+
export type AddShadowRootCallBack = (shadowRoot: ShadowRoot, scope: RecordingScope) => void;
|
|
4
|
+
export type RemoveShadowRootCallBack = (shadowRoot: ShadowRoot) => void;
|
|
5
|
+
export interface ShadowRootsController {
|
|
6
|
+
addShadowRoot: AddShadowRootCallBack;
|
|
7
|
+
removeShadowRoot: RemoveShadowRootCallBack;
|
|
8
|
+
stop: () => void;
|
|
9
|
+
flush: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const initShadowRootsController: (emitRecord: EmitRecordCallback, emitStats: EmitStatsCallback) => ShadowRootsController;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { trackInput, trackMutation, trackScroll } from './trackers';
|
|
2
|
+
export const initShadowRootsController = (emitRecord, emitStats) => {
|
|
3
|
+
const controllerByShadowRoot = new Map();
|
|
4
|
+
const shadowRootsController = {
|
|
5
|
+
addShadowRoot: (shadowRoot, scope) => {
|
|
6
|
+
if (controllerByShadowRoot.has(shadowRoot)) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const mutationTracker = trackMutation(shadowRoot, emitRecord, emitStats, scope);
|
|
10
|
+
// The change event does not bubble up across the shadow root, we have to listen on the shadow root
|
|
11
|
+
const inputTracker = trackInput(shadowRoot, emitRecord, scope);
|
|
12
|
+
// The scroll event does not bubble up across the shadow root, we have to listen on the shadow root
|
|
13
|
+
const scrollTracker = trackScroll(shadowRoot, emitRecord, scope);
|
|
14
|
+
controllerByShadowRoot.set(shadowRoot, {
|
|
15
|
+
flush: () => mutationTracker.flush(),
|
|
16
|
+
stop: () => {
|
|
17
|
+
mutationTracker.stop();
|
|
18
|
+
inputTracker.stop();
|
|
19
|
+
scrollTracker.stop();
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
removeShadowRoot: (shadowRoot) => {
|
|
24
|
+
const entry = controllerByShadowRoot.get(shadowRoot);
|
|
25
|
+
if (!entry) {
|
|
26
|
+
// unidentified root cause: observed in some cases with shadow DOM added by browser extensions
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
entry.stop();
|
|
30
|
+
controllerByShadowRoot.delete(shadowRoot);
|
|
31
|
+
},
|
|
32
|
+
stop: () => {
|
|
33
|
+
controllerByShadowRoot.forEach(({ stop }) => stop());
|
|
34
|
+
},
|
|
35
|
+
flush: () => {
|
|
36
|
+
controllerByShadowRoot.forEach(({ flush }) => flush());
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
return shadowRootsController;
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=shadowRootsController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shadowRootsController.js","sourceRoot":"","sources":["../../../src/domain/record/shadowRootsController.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAiBnE,MAAM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EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,CAAA;QACtD,CAAC;QACD,KAAK,EAAE,GAAG,EAAE;YACV,sBAAsB,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAA;QACxD,CAAC;KACF,CAAA;IACD,OAAO,qBAAqB,CAAA;AAC9B,CAAC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LifeCycle } from '@datadog/browser-rum-core';
|
|
2
|
+
import type { TimeStamp } from '@datadog/browser-core';
|
|
3
|
+
import { SerializationKind } from './serialization';
|
|
4
|
+
import type { RecordingScope } from './recordingScope';
|
|
5
|
+
import type { EmitRecordCallback, EmitStatsCallback } from './record.types';
|
|
6
|
+
export type SerializeFullSnapshotCallback = (timestamp: TimeStamp, kind: SerializationKind, document: Document, emitRecord: EmitRecordCallback, emitStats: EmitStatsCallback, scope: RecordingScope) => void;
|
|
7
|
+
export declare function startFullSnapshots(lifeCycle: LifeCycle, emitRecord: EmitRecordCallback, emitStats: EmitStatsCallback, flushMutations: () => void, scope: RecordingScope, serialize?: SerializeFullSnapshotCallback): {
|
|
8
|
+
stop: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare function takeFullSnapshot(timestamp: TimeStamp, kind: SerializationKind, emitRecord: EmitRecordCallback, emitStats: EmitStatsCallback, scope: RecordingScope, serialize?: SerializeFullSnapshotCallback): void;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { getViewportDimension } from '@datadog/browser-rum-core';
|
|
2
|
+
import { timeStampNow } from '@datadog/browser-core';
|
|
3
|
+
import { RecordType } from '../../types';
|
|
4
|
+
import { isFullSnapshotChangeRecordsEnabled, serializeFullSnapshotAsChange, serializeFullSnapshot, } from './serialization';
|
|
5
|
+
import { getVisualViewport } from './viewports';
|
|
6
|
+
export function startFullSnapshots(lifeCycle, emitRecord, emitStats, flushMutations, scope, serialize = defaultSerializeFullSnapshotCallback()) {
|
|
7
|
+
takeFullSnapshot(timeStampNow(), 0 /* SerializationKind.INITIAL_FULL_SNAPSHOT */, emitRecord, emitStats, scope, serialize);
|
|
8
|
+
const { unsubscribe } = lifeCycle.subscribe(2 /* LifeCycleEventType.VIEW_CREATED */, (view) => {
|
|
9
|
+
flushMutations();
|
|
10
|
+
takeFullSnapshot(view.startClocks.timeStamp, 1 /* SerializationKind.SUBSEQUENT_FULL_SNAPSHOT */, emitRecord, emitStats, scope, serialize);
|
|
11
|
+
});
|
|
12
|
+
return {
|
|
13
|
+
stop: unsubscribe,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function takeFullSnapshot(timestamp, kind, emitRecord, emitStats, scope, serialize = defaultSerializeFullSnapshotCallback()) {
|
|
17
|
+
const { width, height } = getViewportDimension();
|
|
18
|
+
emitRecord({
|
|
19
|
+
data: {
|
|
20
|
+
height,
|
|
21
|
+
href: window.location.href,
|
|
22
|
+
width,
|
|
23
|
+
},
|
|
24
|
+
type: RecordType.Meta,
|
|
25
|
+
timestamp,
|
|
26
|
+
});
|
|
27
|
+
emitRecord({
|
|
28
|
+
data: {
|
|
29
|
+
has_focus: document.hasFocus(),
|
|
30
|
+
},
|
|
31
|
+
type: RecordType.Focus,
|
|
32
|
+
timestamp,
|
|
33
|
+
});
|
|
34
|
+
serialize(timestamp, kind, document, emitRecord, emitStats, scope);
|
|
35
|
+
if (window.visualViewport) {
|
|
36
|
+
emitRecord({
|
|
37
|
+
data: getVisualViewport(window.visualViewport),
|
|
38
|
+
type: RecordType.VisualViewport,
|
|
39
|
+
timestamp,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function defaultSerializeFullSnapshotCallback() {
|
|
44
|
+
return isFullSnapshotChangeRecordsEnabled() ? serializeFullSnapshotAsChange : serializeFullSnapshot;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=startFullSnapshots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3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AS;KACV,CAAC,CAAA;IAEF,UAAU,CAAC;QACT,IAAI,EAAE;YACJ,SAAS,EAAE,QAAQ,CAAC,QAAQ,EAAE;SAC/B;QACD,IAAI,EAAE,UAAU,CAAC,KAAK;QACtB,SAAS;KACV,CAAC,CAAA;IAEF,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,CAAC,CAAA;IAElE,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;QAC1B,UAAU,CAAC;YACT,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,cAAc,CAAC;YAC9C,IAAI,EAAE,UAAU,CAAC,cAAc;YAC/B,SAAS;SACV,CAAC,CAAA;IACJ,CAAC;AACH,CAAC;AAED,SAAS,oCAAoC;IAC3C,OAAO,kCAAkC,EAAE,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,qBAAqB,CAAA;AACrG,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { trackMove } from './trackMove';
|
|
2
|
+
export { trackMouseInteraction } from './trackMouseInteraction';
|
|
3
|
+
export { trackScroll } from './trackScroll';
|
|
4
|
+
export { trackViewportResize, trackVisualViewportResize } from './trackViewportResize';
|
|
5
|
+
export { trackMediaInteraction } from './trackMediaInteraction';
|
|
6
|
+
export { trackStyleSheet } from './trackStyleSheet';
|
|
7
|
+
export { trackFocus } from './trackFocus';
|
|
8
|
+
export { trackFrustration } from './trackFrustration';
|
|
9
|
+
export { trackViewEnd } from './trackViewEnd';
|
|
10
|
+
export { trackInput } from './trackInput';
|
|
11
|
+
export { trackMutation } from './trackMutation';
|
|
12
|
+
export type { Tracker } from './tracker.types';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { trackMove } from './trackMove';
|
|
2
|
+
export { trackMouseInteraction } from './trackMouseInteraction';
|
|
3
|
+
export { trackScroll } from './trackScroll';
|
|
4
|
+
export { trackViewportResize, trackVisualViewportResize } from './trackViewportResize';
|
|
5
|
+
export { trackMediaInteraction } from './trackMediaInteraction';
|
|
6
|
+
export { trackStyleSheet } from './trackStyleSheet';
|
|
7
|
+
export { trackFocus } from './trackFocus';
|
|
8
|
+
export { trackFrustration } from './trackFrustration';
|
|
9
|
+
export { trackViewEnd } from './trackViewEnd';
|
|
10
|
+
export { trackInput } from './trackInput';
|
|
11
|
+
export { trackMutation } from './trackMutation';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domain/record/trackers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FocusRecord } from '../../../types';
|
|
2
|
+
import type { RecordingScope } from '../recordingScope';
|
|
3
|
+
import type { EmitRecordCallback } from '../record.types';
|
|
4
|
+
import type { Tracker } from './tracker.types';
|
|
5
|
+
export declare function trackFocus(emitRecord: EmitRecordCallback<FocusRecord>, scope: RecordingScope): Tracker;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { addEventListeners, timeStampNow } from '@datadog/browser-core';
|
|
2
|
+
import { RecordType } from '../../../types';
|
|
3
|
+
export function trackFocus(emitRecord, scope) {
|
|
4
|
+
return addEventListeners(scope.configuration, window, ["focus" /* DOM_EVENT.FOCUS */, "blur" /* DOM_EVENT.BLUR */], () => {
|
|
5
|
+
emitRecord({
|
|
6
|
+
data: { has_focus: document.hasFocus() },
|
|
7
|
+
type: RecordType.Focus,
|
|
8
|
+
timestamp: timeStampNow(),
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=trackFocus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trackFocus.js","sourceRoot":"","sources":["../../../../src/domain/record/trackers/trackFocus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,iBAAiB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAElF,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAK3C,MAAM,UAAU,UAAU,CAAC,UAA2C,EAAE,KAAqB;IAC3F,OAAO,iBAAiB,CAAC,KAAK,CAAC,aAAa,EAAE,MAAM,EAAE,4DAAiC,EAAE,GAAG,EAAE;QAC5F,UAAU,CAAC;YACT,IAAI,EAAE,EAAE,SAAS,EAAE,QAAQ,CAAC,QAAQ,EAAE,EAAE;YACxC,IAAI,EAAE,UAAU,CAAC,KAAK;YACtB,SAAS,EAAE,YAAY,EAAE;SAC1B,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LifeCycle } from '@datadog/browser-rum-core';
|
|
2
|
+
import type { FrustrationRecord } from '../../../types';
|
|
3
|
+
import type { EmitRecordCallback } from '../record.types';
|
|
4
|
+
import type { RecordingScope } from '../recordingScope';
|
|
5
|
+
import type { Tracker } from './tracker.types';
|
|
6
|
+
export declare function trackFrustration(lifeCycle: LifeCycle, emitRecord: EmitRecordCallback<FrustrationRecord>, scope: RecordingScope): Tracker;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ActionType, RumEventType } from '@datadog/browser-rum-core';
|
|
2
|
+
import { RecordType } from '../../../types';
|
|
3
|
+
export function trackFrustration(lifeCycle, emitRecord, scope) {
|
|
4
|
+
const frustrationSubscription = lifeCycle.subscribe(12 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, (data) => {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
if (data.rawRumEvent.type === RumEventType.ACTION &&
|
|
7
|
+
data.rawRumEvent.action.type === ActionType.CLICK &&
|
|
8
|
+
((_b = (_a = data.rawRumEvent.action.frustration) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.length) &&
|
|
9
|
+
'events' in data.domainContext &&
|
|
10
|
+
data.domainContext.events &&
|
|
11
|
+
data.domainContext.events.length) {
|
|
12
|
+
emitRecord({
|
|
13
|
+
timestamp: data.rawRumEvent.date,
|
|
14
|
+
type: RecordType.FrustrationRecord,
|
|
15
|
+
data: {
|
|
16
|
+
frustrationTypes: data.rawRumEvent.action.frustration.type,
|
|
17
|
+
recordIds: data.domainContext.events.map((e) => scope.eventIds.getOrInsert(e)),
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return {
|
|
23
|
+
stop: () => {
|
|
24
|
+
frustrationSubscription.unsubscribe();
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=trackFrustration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trackFrustration.js","sourceRoot":"","sources":["../../../../src/domain/record/trackers/trackFrustration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAsB,MAAM,2BAA2B,CAAA;AAExF,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAK3C,MAAM,UAAU,gBAAgB,CAC9B,SAAoB,EACpB,UAAiD,EACjD,KAAqB;IAErB,MAAM,uBAAuB,GAAG,SAAS,CAAC,SAAS,sDAA6C,CAAC,IAAI,EAAE,EAAE;;QACvG,IACE,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,YAAY,CAAC,MAAM;YAC7C,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,KAAK;aACjD,MAAA,MAAA,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,WAAW,0CAAE,IAAI,0CAAE,MAAM,CAAA;YACjD,QAAQ,IAAI,IAAI,CAAC,aAAa;YAC9B,IAAI,CAAC,aAAa,CAAC,MAAM;YACzB,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAChC,CAAC;YACD,UAAU,CAAC;gBACT,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI;gBAChC,IAAI,EAAE,UAAU,CAAC,iBAAiB;gBAClC,IAAI,EAAE;oBACJ,gBAAgB,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI;oBAC1D,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;iBAC/E;aACF,CAAC,CAAA;QACJ,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO;QACL,IAAI,EAAE,GAAG,EAAE;YACT,uBAAuB,CAAC,WAAW,EAAE,CAAA;QACvC,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RecordingScope } from '../recordingScope';
|
|
2
|
+
import type { EmitRecordCallback } from '../record.types';
|
|
3
|
+
import type { Tracker } from './tracker.types';
|
|
4
|
+
export declare function trackInput(target: Document | ShadowRoot, emitRecord: EmitRecordCallback, scope: RecordingScope): Tracker;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { instrumentSetter, addEventListeners, noop } from '@datadog/browser-core';
|
|
2
|
+
import { NodePrivacyLevel, getNodePrivacyLevel, shouldMaskNode } from '@datadog/browser-rum-core';
|
|
3
|
+
import { IncrementalSource } from '../../../types';
|
|
4
|
+
import { getEventTarget } from '../eventsUtils';
|
|
5
|
+
import { getElementInputValue } from '../serialization';
|
|
6
|
+
import { assembleIncrementalSnapshot } from '../assembly';
|
|
7
|
+
export function trackInput(target, emitRecord, scope) {
|
|
8
|
+
const defaultPrivacyLevel = scope.configuration.defaultPrivacyLevel;
|
|
9
|
+
const lastInputStateMap = new WeakMap();
|
|
10
|
+
const isShadowRoot = target !== document;
|
|
11
|
+
const { stop: stopEventListeners } = addEventListeners(scope.configuration, target,
|
|
12
|
+
// The 'input' event bubbles across shadow roots, so we don't have to listen for it on shadow
|
|
13
|
+
// roots since it will be handled by the event listener that we did add to the document. Only
|
|
14
|
+
// the 'change' event is blocked and needs to be handled on shadow roots.
|
|
15
|
+
isShadowRoot ? ["change" /* DOM_EVENT.CHANGE */] : ["input" /* DOM_EVENT.INPUT */, "change" /* DOM_EVENT.CHANGE */], (event) => {
|
|
16
|
+
const target = getEventTarget(event);
|
|
17
|
+
if (target instanceof HTMLInputElement ||
|
|
18
|
+
target instanceof HTMLTextAreaElement ||
|
|
19
|
+
target instanceof HTMLSelectElement) {
|
|
20
|
+
onElementChange(target);
|
|
21
|
+
}
|
|
22
|
+
}, {
|
|
23
|
+
capture: true,
|
|
24
|
+
passive: true,
|
|
25
|
+
});
|
|
26
|
+
let stopPropertySetterInstrumentation;
|
|
27
|
+
if (!isShadowRoot) {
|
|
28
|
+
const instrumentationStoppers = [
|
|
29
|
+
instrumentSetter(HTMLInputElement.prototype, 'value', onElementChange),
|
|
30
|
+
instrumentSetter(HTMLInputElement.prototype, 'checked', onElementChange),
|
|
31
|
+
instrumentSetter(HTMLSelectElement.prototype, 'value', onElementChange),
|
|
32
|
+
instrumentSetter(HTMLTextAreaElement.prototype, 'value', onElementChange),
|
|
33
|
+
instrumentSetter(HTMLSelectElement.prototype, 'selectedIndex', onElementChange),
|
|
34
|
+
];
|
|
35
|
+
stopPropertySetterInstrumentation = () => {
|
|
36
|
+
instrumentationStoppers.forEach((stopper) => stopper.stop());
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
stopPropertySetterInstrumentation = noop;
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
stop: () => {
|
|
44
|
+
stopPropertySetterInstrumentation();
|
|
45
|
+
stopEventListeners();
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
function onElementChange(target) {
|
|
49
|
+
const nodePrivacyLevel = getNodePrivacyLevel(target, defaultPrivacyLevel);
|
|
50
|
+
if (nodePrivacyLevel === NodePrivacyLevel.HIDDEN) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const type = target.type;
|
|
54
|
+
let inputState;
|
|
55
|
+
if (type === 'radio' || type === 'checkbox') {
|
|
56
|
+
if (shouldMaskNode(target, nodePrivacyLevel)) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
inputState = { isChecked: target.checked };
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
const value = getElementInputValue(target, nodePrivacyLevel);
|
|
63
|
+
if (value === undefined) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
inputState = { text: value };
|
|
67
|
+
}
|
|
68
|
+
// Can be multiple changes on the same node within the same batched mutation observation.
|
|
69
|
+
createRecordIfStateChanged(target, inputState);
|
|
70
|
+
// If a radio was checked, other radios with the same name attribute will be unchecked.
|
|
71
|
+
const name = target.name;
|
|
72
|
+
if (type === 'radio' && name && target.checked) {
|
|
73
|
+
document.querySelectorAll(`input[type="radio"][name="${CSS.escape(name)}"]`).forEach((el) => {
|
|
74
|
+
if (el !== target) {
|
|
75
|
+
// TODO: Consider the privacy implications for various differing input privacy levels
|
|
76
|
+
createRecordIfStateChanged(el, { isChecked: false });
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* There can be multiple changes on the same node within the same batched mutation observation.
|
|
83
|
+
*/
|
|
84
|
+
function createRecordIfStateChanged(target, inputState) {
|
|
85
|
+
const id = scope.nodeIds.get(target);
|
|
86
|
+
if (id === undefined) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const lastInputState = lastInputStateMap.get(target);
|
|
90
|
+
if (!lastInputState ||
|
|
91
|
+
lastInputState.text !== inputState.text ||
|
|
92
|
+
lastInputState.isChecked !== inputState.isChecked) {
|
|
93
|
+
lastInputStateMap.set(target, inputState);
|
|
94
|
+
emitRecord(assembleIncrementalSnapshot(IncrementalSource.Input, {
|
|
95
|
+
id,
|
|
96
|
+
...inputState,
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=trackInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trackInput.js","sourceRoot":"","sources":["../../../../src/domain/record/trackers/trackInput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAa,iBAAiB,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC5F,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AACjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAIzD,MAAM,UAAU,UAAU,CACxB,MAA6B,EAC7B,UAA8B,EAC9B,KAAqB;IAErB,MAAM,mBAAmB,GAAG,K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AW,EAAE,EAAE;gBACnG,IAAI,EAAE,KAAK,MAAM,EAAE,CAAC;oBAClB,qFAAqF;oBACrF,0BAA0B,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAA;gBACtD,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IAED;;OAEG;IACH,SAAS,0BAA0B,CAAC,MAAY,EAAE,UAAsB;QACtE,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACpC,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;YACrB,OAAM;QACR,CAAC;QACD,MAAM,cAAc,GAAG,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACpD,IACE,CAAC,cAAc;YACd,cAAoC,CAAC,IAAI,KAAM,UAAgC,CAAC,IAAI;YACpF,cAA0C,CAAC,SAAS,KAAM,UAAsC,CAAC,SAAS,EAC3G,CAAC;YACD,iBAAiB,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;YACzC,UAAU,CACR,2BAA2B,CAAY,iBAAiB,CAAC,KAAK,EAAE;gBAC9D,EAAE;gBACF,GAAG,UAAU;aACd,CAAC,CACH,CAAA;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BrowserIncrementalSnapshotRecord } from '../../../types';
|
|
2
|
+
import type { EmitRecordCallback } from '../record.types';
|
|
3
|
+
import type { RecordingScope } from '../recordingScope';
|
|
4
|
+
import type { Tracker } from './tracker.types';
|
|
5
|
+
export declare function trackMediaInteraction(emitRecord: EmitRecordCallback<BrowserIncrementalSnapshotRecord>, scope: RecordingScope): Tracker;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { addEventListeners } from '@datadog/browser-core';
|
|
2
|
+
import { NodePrivacyLevel, getNodePrivacyLevel } from '@datadog/browser-rum-core';
|
|
3
|
+
import { IncrementalSource, MediaInteractionType } from '../../../types';
|
|
4
|
+
import { getEventTarget } from '../eventsUtils';
|
|
5
|
+
import { assembleIncrementalSnapshot } from '../assembly';
|
|
6
|
+
export function trackMediaInteraction(emitRecord, scope) {
|
|
7
|
+
return addEventListeners(scope.configuration, document, ["play" /* DOM_EVENT.PLAY */, "pause" /* DOM_EVENT.PAUSE */], (event) => {
|
|
8
|
+
const target = getEventTarget(event);
|
|
9
|
+
if (!target) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const id = scope.nodeIds.get(target);
|
|
13
|
+
if (id === undefined ||
|
|
14
|
+
getNodePrivacyLevel(target, scope.configuration.defaultPrivacyLevel) === NodePrivacyLevel.HIDDEN) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
emitRecord(assembleIncrementalSnapshot(IncrementalSource.MediaInteraction, {
|
|
18
|
+
id,
|
|
19
|
+
type: event.type === "play" /* DOM_EVENT.PLAY */ ? MediaInteractionType.Play : MediaInteractionType.Pause,
|
|
20
|
+
}));
|
|
21
|
+
}, {
|
|
22
|
+
capture: true,
|
|
23
|
+
passive: true,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=trackMediaInteraction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trackMediaInteraction.js","sourceRoot":"","sources":["../../../../src/domain/record/trackers/trackMediaInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAEjF,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAKzD,MAAM,UAAU,qBAAqB,CACnC,UAAgE,EAChE,KAAqB;IAErB,OAAO,iBAAiB,CACtB,KAAK,CAAC,aAAa,EACnB,QAAQ,EACR,4DAAiC,EACjC,CAAC,KAAK,EAAE,EAAE;QACR,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,CAAA;QACpC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAM;QACR,CAAC;QACD,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACpC,IACE,EAAE,KAAK,SAAS;YAChB,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC,KAAK,gBAAgB,CAAC,MAAM,EAChG,CAAC;YACD,OAAM;QACR,CAAC;QACD,UAAU,CACR,2BAA2B,CAAuB,iBAAiB,CAAC,gBAAgB,EAAE;YACpF,EAAE;YACF,IAAI,EAAE,KAAK,CAAC,IAAI,gCAAmB,CAAC,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,KAAK;SAC7F,CAAC,CACH,CAAA;IACH,CAAC,EACD;QACE,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,IAAI;KACd,CACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BrowserIncrementalSnapshotRecord } from '../../../types';
|
|
2
|
+
import type { RecordingScope } from '../recordingScope';
|
|
3
|
+
import type { EmitRecordCallback } from '../record.types';
|
|
4
|
+
import type { Tracker } from './tracker.types';
|
|
5
|
+
export declare function trackMouseInteraction(emitRecord: EmitRecordCallback<BrowserIncrementalSnapshotRecord>, scope: RecordingScope): Tracker;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { addEventListeners } from '@datadog/browser-core';
|
|
2
|
+
import { getNodePrivacyLevel, NodePrivacyLevel } from '@datadog/browser-rum-core';
|
|
3
|
+
import { IncrementalSource, MouseInteractionType } from '../../../types';
|
|
4
|
+
import { assembleIncrementalSnapshot } from '../assembly';
|
|
5
|
+
import { getEventTarget } from '../eventsUtils';
|
|
6
|
+
import { tryToComputeCoordinates } from './trackMove';
|
|
7
|
+
const eventTypeToMouseInteraction = {
|
|
8
|
+
// Listen for pointerup DOM events instead of mouseup for MouseInteraction/MouseUp records. This
|
|
9
|
+
// allows to reference such records from Frustration records.
|
|
10
|
+
//
|
|
11
|
+
// In the context of supporting Mobile Session Replay, we introduced `PointerInteraction` records
|
|
12
|
+
// used by the Mobile SDKs in place of `MouseInteraction`. In the future, we should replace
|
|
13
|
+
// `MouseInteraction` by `PointerInteraction` in the Browser SDK so we have an uniform way to
|
|
14
|
+
// convey such interaction. This would cleanly solve the issue since we would have
|
|
15
|
+
// `PointerInteraction/Up` records that we could reference from `Frustration` records.
|
|
16
|
+
["pointerup" /* DOM_EVENT.POINTER_UP */]: MouseInteractionType.MouseUp,
|
|
17
|
+
["mousedown" /* DOM_EVENT.MOUSE_DOWN */]: MouseInteractionType.MouseDown,
|
|
18
|
+
["click" /* DOM_EVENT.CLICK */]: MouseInteractionType.Click,
|
|
19
|
+
["contextmenu" /* DOM_EVENT.CONTEXT_MENU */]: MouseInteractionType.ContextMenu,
|
|
20
|
+
["dblclick" /* DOM_EVENT.DBL_CLICK */]: MouseInteractionType.DblClick,
|
|
21
|
+
["focus" /* DOM_EVENT.FOCUS */]: MouseInteractionType.Focus,
|
|
22
|
+
["blur" /* DOM_EVENT.BLUR */]: MouseInteractionType.Blur,
|
|
23
|
+
["touchstart" /* DOM_EVENT.TOUCH_START */]: MouseInteractionType.TouchStart,
|
|
24
|
+
["touchend" /* DOM_EVENT.TOUCH_END */]: MouseInteractionType.TouchEnd,
|
|
25
|
+
};
|
|
26
|
+
export function trackMouseInteraction(emitRecord, scope) {
|
|
27
|
+
const handler = (event) => {
|
|
28
|
+
const target = getEventTarget(event);
|
|
29
|
+
const id = scope.nodeIds.get(target);
|
|
30
|
+
if (id === undefined ||
|
|
31
|
+
getNodePrivacyLevel(target, scope.configuration.defaultPrivacyLevel) === NodePrivacyLevel.HIDDEN) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const type = eventTypeToMouseInteraction[event.type];
|
|
35
|
+
let interaction;
|
|
36
|
+
if (type !== MouseInteractionType.Blur && type !== MouseInteractionType.Focus) {
|
|
37
|
+
const coordinates = tryToComputeCoordinates(event);
|
|
38
|
+
if (!coordinates) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
interaction = { id, type, x: coordinates.x, y: coordinates.y };
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
interaction = { id, type };
|
|
45
|
+
}
|
|
46
|
+
emitRecord({
|
|
47
|
+
id: scope.eventIds.getOrInsert(event),
|
|
48
|
+
...assembleIncrementalSnapshot(IncrementalSource.MouseInteraction, interaction),
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
return addEventListeners(scope.configuration, document, Object.keys(eventTypeToMouseInteraction), handler, {
|
|
52
|
+
capture: true,
|
|
53
|
+
passive: true,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=trackMouseInteraction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trackMouseInteraction.js","sourceRoot":"","sources":["../../../../src/domain/record/trackers/trackMouseInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAa,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAEjF,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AACxE,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAG/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAGrD,MAAM,2BAA2B,GAAG;IAClC,gGAAgG;IAChG,6DAA6D;IAC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AE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,CAAA;QAChE,CAAC;aAAM,CAAC;YACN,WAAW,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,CAAA;QAC5B,CAAC;QAED,UAAU,CAAC;YACT,EAAE,EAAE,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC;YACrC,GAAG,2BAA2B,CAAuB,iBAAiB,CAAC,gBAAgB,EAAE,WAAW,CAAC;SACtG,CAAC,CAAA;IACJ,CAAC,CAAA;IACD,OAAO,iBAAiB,CACtB,KAAK,CAAC,aAAa,EACnB,QAAQ,EACR,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAoD,EAC3F,OAAO,EACP;QACE,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,IAAI;KACd,CACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BrowserIncrementalSnapshotRecord } from '../../../types';
|
|
2
|
+
import type { RecordingScope } from '../recordingScope';
|
|
3
|
+
import type { EmitRecordCallback } from '../record.types';
|
|
4
|
+
import type { Tracker } from './tracker.types';
|
|
5
|
+
export declare function trackMove(emitRecord: EmitRecordCallback<BrowserIncrementalSnapshotRecord>, scope: RecordingScope): Tracker;
|
|
6
|
+
export declare function tryToComputeCoordinates(event: MouseEvent | TouchEvent): {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
} | undefined;
|