@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,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createVDocument = createVDocument;
|
|
4
|
+
const types_1 = require("../../../../types");
|
|
5
|
+
const mutationLog_1 = require("./mutationLog");
|
|
6
|
+
const renderOptions_1 = require("./renderOptions");
|
|
7
|
+
const vNode_1 = require("./vNode");
|
|
8
|
+
const vStyleSheet_1 = require("./vStyleSheet");
|
|
9
|
+
function createVDocument() {
|
|
10
|
+
const mutations = (0, mutationLog_1.createMutationLog)();
|
|
11
|
+
let nextNodeId = 0;
|
|
12
|
+
const nodesById = new Map();
|
|
13
|
+
let rootId;
|
|
14
|
+
let nextStyleSheetId = 0;
|
|
15
|
+
const styleSheetsById = new Map();
|
|
16
|
+
const self = {
|
|
17
|
+
createNode(data) {
|
|
18
|
+
const id = nextNodeId++;
|
|
19
|
+
const node = (0, vNode_1.createVNode)(self, id, data);
|
|
20
|
+
nodesById.set(id, node);
|
|
21
|
+
return node;
|
|
22
|
+
},
|
|
23
|
+
getNodeById(id) {
|
|
24
|
+
const node = nodesById.get(id);
|
|
25
|
+
if (!node) {
|
|
26
|
+
throw new Error(`Reference to unknown node: ${id}`);
|
|
27
|
+
}
|
|
28
|
+
return node;
|
|
29
|
+
},
|
|
30
|
+
createStyleSheet(data) {
|
|
31
|
+
const id = nextStyleSheetId++;
|
|
32
|
+
const sheet = (0, vStyleSheet_1.createVStyleSheet)(self, id, data);
|
|
33
|
+
styleSheetsById.set(id, sheet);
|
|
34
|
+
return sheet;
|
|
35
|
+
},
|
|
36
|
+
getStyleSheetById(id) {
|
|
37
|
+
const sheet = styleSheetsById.get(id);
|
|
38
|
+
if (!sheet) {
|
|
39
|
+
throw new Error(`Reference to unknown stylesheet: ${id}`);
|
|
40
|
+
}
|
|
41
|
+
return sheet;
|
|
42
|
+
},
|
|
43
|
+
onAttributeChanged(node, name) {
|
|
44
|
+
mutations.onAttributeChanged(node.id, name);
|
|
45
|
+
},
|
|
46
|
+
onNodeConnected(node, parent) {
|
|
47
|
+
if (node.state !== 'new') {
|
|
48
|
+
throw new Error(`Moving connected node: ${node.id}`);
|
|
49
|
+
}
|
|
50
|
+
if (parent === undefined) {
|
|
51
|
+
if (rootId !== undefined) {
|
|
52
|
+
throw new Error('Replacing existing root node');
|
|
53
|
+
}
|
|
54
|
+
rootId = node.id;
|
|
55
|
+
}
|
|
56
|
+
node.state = 'connected';
|
|
57
|
+
mutations.onNodeConnected(node.id);
|
|
58
|
+
},
|
|
59
|
+
onNodeDisconnected(node, parent) {
|
|
60
|
+
node.forSelfAndEachDescendant((descendant) => {
|
|
61
|
+
if (descendant.state === 'disconnected') {
|
|
62
|
+
throw new Error(`Disconnecting node which isn't connected: ${descendant.id}`);
|
|
63
|
+
}
|
|
64
|
+
descendant.state = 'disconnected';
|
|
65
|
+
});
|
|
66
|
+
if (!parent) {
|
|
67
|
+
throw new Error('Disconnecting the root node');
|
|
68
|
+
}
|
|
69
|
+
mutations.onNodeDisconnected(node.id, parent.id);
|
|
70
|
+
},
|
|
71
|
+
onTextChanged(node) {
|
|
72
|
+
mutations.onTextChanged(node.id);
|
|
73
|
+
},
|
|
74
|
+
get mutations() {
|
|
75
|
+
return mutations;
|
|
76
|
+
},
|
|
77
|
+
naturalRendering() {
|
|
78
|
+
if (rootId !== undefined && mutations.nodeAdds.has(rootId)) {
|
|
79
|
+
return types_1.RecordType.FullSnapshot;
|
|
80
|
+
}
|
|
81
|
+
return types_1.RecordType.IncrementalSnapshot;
|
|
82
|
+
},
|
|
83
|
+
render(options) {
|
|
84
|
+
if (self.naturalRendering() === types_1.RecordType.FullSnapshot) {
|
|
85
|
+
return self.renderAsFullSnapshot(options);
|
|
86
|
+
}
|
|
87
|
+
return self.renderAsIncrementalSnapshot(options);
|
|
88
|
+
},
|
|
89
|
+
renderAsFullSnapshot(renderOptions = {}) {
|
|
90
|
+
var _a, _b;
|
|
91
|
+
const options = (0, renderOptions_1.createV1RenderOptions)(renderOptions);
|
|
92
|
+
const root = self.root;
|
|
93
|
+
if (!root) {
|
|
94
|
+
throw new Error('No root node found');
|
|
95
|
+
}
|
|
96
|
+
let scrollLeft = 0;
|
|
97
|
+
let scrollTop = 0;
|
|
98
|
+
if (root.data.kind === '#document' || root.data.kind === '#element') {
|
|
99
|
+
scrollLeft = (_a = root.data.scrollLeft) !== null && _a !== void 0 ? _a : 0;
|
|
100
|
+
scrollTop = (_b = root.data.scrollTop) !== null && _b !== void 0 ? _b : 0;
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
data: {
|
|
104
|
+
node: root.render(options),
|
|
105
|
+
initialOffset: { left: scrollLeft, top: scrollTop },
|
|
106
|
+
},
|
|
107
|
+
type: types_1.RecordType.FullSnapshot,
|
|
108
|
+
timestamp: options.timestamp,
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
renderAsIncrementalSnapshot(renderOptions = {}) {
|
|
112
|
+
var _a;
|
|
113
|
+
const options = (0, renderOptions_1.createV1RenderOptions)(renderOptions);
|
|
114
|
+
const root = self.root;
|
|
115
|
+
if (!root) {
|
|
116
|
+
throw new Error('No root node found');
|
|
117
|
+
}
|
|
118
|
+
const remappedId = (id) => options.nodeIdRemapper.remap(id);
|
|
119
|
+
const addMutations = [];
|
|
120
|
+
root.forEachAddedNodeRoot(mutations.nodeAdds, (node) => {
|
|
121
|
+
var _a;
|
|
122
|
+
if (!node.parent) {
|
|
123
|
+
throw new Error(`Can't render incremental add of root node ${node.id}`);
|
|
124
|
+
}
|
|
125
|
+
addMutations.push({
|
|
126
|
+
nextId: ((_a = node.nextSibling) === null || _a === void 0 ? void 0 : _a.id) !== undefined ? remappedId(node.nextSibling.id) : null,
|
|
127
|
+
parentId: remappedId(node.parent.id),
|
|
128
|
+
node: node.render(options),
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
const removeMutations = [];
|
|
132
|
+
for (const [id, parentId] of mutations.nodeRemoves) {
|
|
133
|
+
removeMutations.push({ parentId: remappedId(parentId), id: remappedId(id) });
|
|
134
|
+
}
|
|
135
|
+
const textMutations = [];
|
|
136
|
+
for (const id of mutations.textChanges) {
|
|
137
|
+
const node = self.getNodeById(id);
|
|
138
|
+
if (node.data.kind !== '#text') {
|
|
139
|
+
throw new Error(`Can't render incremental text mutation of ${node.data.kind} node ${id}`);
|
|
140
|
+
}
|
|
141
|
+
textMutations.push({ id: remappedId(id), value: node.data.textContent });
|
|
142
|
+
}
|
|
143
|
+
const attributeMutations = [];
|
|
144
|
+
for (const [id, attrNames] of mutations.attributeChanges) {
|
|
145
|
+
const node = self.getNodeById(id);
|
|
146
|
+
if (node.data.kind !== '#element') {
|
|
147
|
+
throw new Error(`Can't render incremental attribute mutation of ${node.data.kind} node ${id}`);
|
|
148
|
+
}
|
|
149
|
+
const attributes = {};
|
|
150
|
+
for (const attrName of attrNames) {
|
|
151
|
+
attributes[attrName] = (_a = node.data.attributes[attrName]) !== null && _a !== void 0 ? _a : null;
|
|
152
|
+
}
|
|
153
|
+
attributeMutations.push({ id: remappedId(id), attributes });
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
data: {
|
|
157
|
+
source: types_1.IncrementalSource.Mutation,
|
|
158
|
+
adds: addMutations,
|
|
159
|
+
removes: removeMutations,
|
|
160
|
+
texts: textMutations,
|
|
161
|
+
attributes: attributeMutations,
|
|
162
|
+
},
|
|
163
|
+
type: types_1.RecordType.IncrementalSnapshot,
|
|
164
|
+
timestamp: options.timestamp,
|
|
165
|
+
};
|
|
166
|
+
},
|
|
167
|
+
get root() {
|
|
168
|
+
return rootId === undefined ? undefined : self.getNodeById(rootId);
|
|
169
|
+
},
|
|
170
|
+
set root(node) {
|
|
171
|
+
self.onNodeConnected(node, undefined);
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
return self;
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=vDocument.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vDocument.js","sourceRoot":"","sources":["../../../../../src/domain/record/serialization/conversions/vDocument.ts"],"names":[],"mappings":";;AAyCA,0CAqMC;AAtOD,6CAAiE;AAGjE,+CAAiD;AACjD,mDAAuD;AAEvD,mCAAqC;AAErC,+CAAiD;AAyBjD,SAAgB,eAAe;IAC7B,MAAM,SAAS,GAAG,IAAA,+BAAiB,GAAE,CAAA;IAErC,IAAI,UAAU,GAAG,CAAW,CAAA;IAC5B,MAAM,SAAS,GAAG,IAAI,GAAG,EAAiB,CAAA;IAC1C,IAAI,MAA0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EAAE;oBACJ,MAAM,EAAE,yBAAiB,CAAC,QAAQ;oBAClC,IAAI,EAAE,YAAY;oBAClB,OAAO,EAAE,eAAe;oBACxB,KAAK,EAAE,aAAa;oBACpB,UAAU,EAAE,kBAAkB;iBAC/B;gBACD,IAAI,EAAE,kBAAU,CAAC,mBAAmB;gBACpC,SAAS,EAAE,OAAO,CAAC,SAAS;aAC7B,CAAA;QACH,CAAC;QAED,IAAI,IAAI;YACN,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;QACpE,CAAC;QACD,IAAI,IAAI,CAAC,IAAW;YAClB,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QACvC,CAAC;KACF,CAAA;IAED,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { SerializedNodeWithId } from '../../../../types';
|
|
2
|
+
import { PlaybackState } from '../../../../types';
|
|
3
|
+
import type { NodeId } from '../../itemIds';
|
|
4
|
+
import type { V1RenderOptions } from './renderOptions';
|
|
5
|
+
import type { VDocument } from './vDocument';
|
|
6
|
+
import type { VStyleSheet } from './vStyleSheet';
|
|
7
|
+
export interface VNode {
|
|
8
|
+
after(node: VNode): void;
|
|
9
|
+
appendChild(node: VNode): void;
|
|
10
|
+
before(node: VNode): void;
|
|
11
|
+
remove(): void;
|
|
12
|
+
setAttachedStyleSheets(sheets: VStyleSheet[]): void;
|
|
13
|
+
setAttribute(name: string, value: string | null): void;
|
|
14
|
+
setPlaybackState(state: PlaybackState): void;
|
|
15
|
+
setScrollPosition(left: number, top: number): void;
|
|
16
|
+
setSize(width: number, height: number): void;
|
|
17
|
+
setTextContent(value: string): void;
|
|
18
|
+
forEachAddedNodeRoot(nodeAdds: Set<NodeId>, action: (node: VNode) => void): void;
|
|
19
|
+
forSelfAndEachDescendant(action: (node: VNode) => void): void;
|
|
20
|
+
mapChildren<Result>(action: (node: VNode) => Result): Result[];
|
|
21
|
+
render(options: V1RenderOptions): SerializedNodeWithId;
|
|
22
|
+
get data(): VNodeData;
|
|
23
|
+
get id(): NodeId;
|
|
24
|
+
get ownerDocument(): VDocument;
|
|
25
|
+
state: VNodeState;
|
|
26
|
+
firstChild: VNode | undefined;
|
|
27
|
+
lastChild: VNode | undefined;
|
|
28
|
+
previousSibling: VNode | undefined;
|
|
29
|
+
nextSibling: VNode | undefined;
|
|
30
|
+
parent: VNode | undefined;
|
|
31
|
+
}
|
|
32
|
+
export type VNodeState = 'new' | 'connected' | 'disconnected';
|
|
33
|
+
export type VNodeData = {
|
|
34
|
+
kind: '#cdata-section';
|
|
35
|
+
} | {
|
|
36
|
+
kind: '#document';
|
|
37
|
+
attachedStyleSheets?: VStyleSheet[] | undefined;
|
|
38
|
+
scrollLeft?: number;
|
|
39
|
+
scrollTop?: number;
|
|
40
|
+
} | {
|
|
41
|
+
kind: '#doctype';
|
|
42
|
+
name: string;
|
|
43
|
+
publicId: string;
|
|
44
|
+
systemId: string;
|
|
45
|
+
} | {
|
|
46
|
+
kind: '#document-fragment';
|
|
47
|
+
attachedStyleSheets?: VStyleSheet[] | undefined;
|
|
48
|
+
} | {
|
|
49
|
+
kind: '#element';
|
|
50
|
+
tag: string;
|
|
51
|
+
attachedStyleSheets?: VStyleSheet[] | undefined;
|
|
52
|
+
attributes: Record<string, string>;
|
|
53
|
+
isSVG?: boolean;
|
|
54
|
+
playbackState?: PlaybackState;
|
|
55
|
+
scrollLeft?: number;
|
|
56
|
+
scrollTop?: number;
|
|
57
|
+
width?: number;
|
|
58
|
+
height?: number;
|
|
59
|
+
} | {
|
|
60
|
+
kind: '#shadow-root';
|
|
61
|
+
attachedStyleSheets?: VStyleSheet[] | undefined;
|
|
62
|
+
} | {
|
|
63
|
+
kind: '#text';
|
|
64
|
+
textContent: string;
|
|
65
|
+
};
|
|
66
|
+
export declare function createVNode(document: VDocument, id: NodeId, data: VNodeData): VNode;
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createVNode = createVNode;
|
|
4
|
+
const types_1 = require("../../../../types");
|
|
5
|
+
function createVNode(document, id, data) {
|
|
6
|
+
let state = 'new';
|
|
7
|
+
const assertConnectedCorrectly = () => {
|
|
8
|
+
if (self.state !== 'connected') {
|
|
9
|
+
throw new Error(`Expected node ${self.id} to be connected, not ${self.state}`);
|
|
10
|
+
}
|
|
11
|
+
for (const connection of ['firstChild', 'lastChild', 'previousSibling', 'nextSibling', 'parent']) {
|
|
12
|
+
const connectedNode = self[connection];
|
|
13
|
+
if (connectedNode && connectedNode.state !== 'connected') {
|
|
14
|
+
throw new Error(`Expected node ${self.id}'s ${connection} to be connected, not ${connectedNode.state}`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const self = {
|
|
19
|
+
after(node) {
|
|
20
|
+
var _a;
|
|
21
|
+
node.parent = self.parent;
|
|
22
|
+
node.previousSibling = self;
|
|
23
|
+
if (self.nextSibling) {
|
|
24
|
+
self.nextSibling.previousSibling = node;
|
|
25
|
+
}
|
|
26
|
+
node.nextSibling = self.nextSibling;
|
|
27
|
+
self.nextSibling = node;
|
|
28
|
+
if (((_a = self.parent) === null || _a === void 0 ? void 0 : _a.lastChild) === self) {
|
|
29
|
+
self.parent.lastChild = node;
|
|
30
|
+
}
|
|
31
|
+
document.onNodeConnected(node, self.parent);
|
|
32
|
+
assertConnectedCorrectly();
|
|
33
|
+
},
|
|
34
|
+
appendChild(node) {
|
|
35
|
+
if (self.lastChild) {
|
|
36
|
+
self.lastChild.after(node);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
node.parent = self;
|
|
40
|
+
self.firstChild = node;
|
|
41
|
+
self.lastChild = node;
|
|
42
|
+
document.onNodeConnected(node, self);
|
|
43
|
+
assertConnectedCorrectly();
|
|
44
|
+
},
|
|
45
|
+
before(node) {
|
|
46
|
+
var _a;
|
|
47
|
+
node.parent = self.parent;
|
|
48
|
+
node.nextSibling = self;
|
|
49
|
+
if (self.previousSibling) {
|
|
50
|
+
self.previousSibling.nextSibling = node;
|
|
51
|
+
}
|
|
52
|
+
node.previousSibling = self.previousSibling;
|
|
53
|
+
self.previousSibling = node;
|
|
54
|
+
if (((_a = self.parent) === null || _a === void 0 ? void 0 : _a.firstChild) === self) {
|
|
55
|
+
self.parent.firstChild = node;
|
|
56
|
+
}
|
|
57
|
+
document.onNodeConnected(node, self.parent);
|
|
58
|
+
assertConnectedCorrectly();
|
|
59
|
+
},
|
|
60
|
+
remove() {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
if (self.state === 'disconnected') {
|
|
63
|
+
return; // This is a redundant remove.
|
|
64
|
+
}
|
|
65
|
+
if (((_a = self.parent) === null || _a === void 0 ? void 0 : _a.firstChild) === self) {
|
|
66
|
+
self.parent.firstChild = self.nextSibling;
|
|
67
|
+
}
|
|
68
|
+
if (((_b = self.parent) === null || _b === void 0 ? void 0 : _b.lastChild) === self) {
|
|
69
|
+
self.parent.lastChild = self.previousSibling;
|
|
70
|
+
}
|
|
71
|
+
if (self.previousSibling) {
|
|
72
|
+
self.previousSibling.nextSibling = self.nextSibling;
|
|
73
|
+
}
|
|
74
|
+
if (self.nextSibling) {
|
|
75
|
+
self.nextSibling.previousSibling = self.previousSibling;
|
|
76
|
+
}
|
|
77
|
+
const parent = self.parent;
|
|
78
|
+
self.parent = undefined;
|
|
79
|
+
self.previousSibling = undefined;
|
|
80
|
+
self.nextSibling = undefined;
|
|
81
|
+
document.onNodeDisconnected(self, parent);
|
|
82
|
+
},
|
|
83
|
+
setAttachedStyleSheets(sheets) {
|
|
84
|
+
assertConnectedCorrectly();
|
|
85
|
+
switch (data.kind) {
|
|
86
|
+
case '#document':
|
|
87
|
+
case '#document-fragment':
|
|
88
|
+
case '#element':
|
|
89
|
+
case '#shadow-root':
|
|
90
|
+
data.attachedStyleSheets = sheets;
|
|
91
|
+
break;
|
|
92
|
+
default:
|
|
93
|
+
throw new Error(`Cannot attach stylesheets to ${data.kind} node ${id}`);
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
setAttribute(name, value) {
|
|
97
|
+
assertConnectedCorrectly();
|
|
98
|
+
if (data.kind !== '#element') {
|
|
99
|
+
throw new Error(`Cannot set attribute ${name} on ${data.kind} node ${id}`);
|
|
100
|
+
}
|
|
101
|
+
if (value === null) {
|
|
102
|
+
delete data.attributes[name];
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
data.attributes[name] = value;
|
|
106
|
+
}
|
|
107
|
+
document.onAttributeChanged(self, name);
|
|
108
|
+
},
|
|
109
|
+
setPlaybackState(state) {
|
|
110
|
+
assertConnectedCorrectly();
|
|
111
|
+
if (data.kind !== '#element') {
|
|
112
|
+
throw new Error(`Cannot set media playback state of ${data.kind} node ${id}`);
|
|
113
|
+
}
|
|
114
|
+
data.playbackState = state;
|
|
115
|
+
},
|
|
116
|
+
setScrollPosition(left, top) {
|
|
117
|
+
assertConnectedCorrectly();
|
|
118
|
+
if (data.kind !== '#document' && data.kind !== '#element') {
|
|
119
|
+
throw new Error(`Cannot set scroll position on ${data.kind} node ${id}`);
|
|
120
|
+
}
|
|
121
|
+
// Treat zero coordinates as 'not scrolled' unless this element has scrolled in the past.
|
|
122
|
+
if (left !== 0 || data.scrollLeft !== undefined) {
|
|
123
|
+
data.scrollLeft = left;
|
|
124
|
+
}
|
|
125
|
+
if (top !== 0 || data.scrollTop !== undefined) {
|
|
126
|
+
data.scrollTop = top;
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
setSize(width, height) {
|
|
130
|
+
assertConnectedCorrectly();
|
|
131
|
+
if (data.kind !== '#element') {
|
|
132
|
+
throw new Error(`Cannot set size of ${data.kind} node ${id}`);
|
|
133
|
+
}
|
|
134
|
+
data.width = width;
|
|
135
|
+
data.height = height;
|
|
136
|
+
},
|
|
137
|
+
setTextContent(value) {
|
|
138
|
+
assertConnectedCorrectly();
|
|
139
|
+
if (data.kind !== '#text') {
|
|
140
|
+
throw new Error(`Cannot set text on ${data.kind} node ${id}`);
|
|
141
|
+
}
|
|
142
|
+
data.textContent = value;
|
|
143
|
+
document.onTextChanged(self);
|
|
144
|
+
},
|
|
145
|
+
forEachAddedNodeRoot(nodeAdds, action) {
|
|
146
|
+
if (nodeAdds.has(id)) {
|
|
147
|
+
// This is the root of a newly-added subtree.
|
|
148
|
+
action(self);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
// This is an existing node, but there may be new nodes among our descendants. Visit
|
|
152
|
+
// children in reverse order to match the ordering that the V1 serialization
|
|
153
|
+
// algorithm would use.
|
|
154
|
+
for (let child = self.lastChild; child; child = child.previousSibling) {
|
|
155
|
+
child.forEachAddedNodeRoot(nodeAdds, action);
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
forSelfAndEachDescendant(action) {
|
|
159
|
+
action(self);
|
|
160
|
+
for (let child = self.firstChild; child; child = child.nextSibling) {
|
|
161
|
+
child.forSelfAndEachDescendant(action);
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
mapChildren(action) {
|
|
165
|
+
const results = [];
|
|
166
|
+
for (let child = self.firstChild; child; child = child.nextSibling) {
|
|
167
|
+
results.push(action(child));
|
|
168
|
+
}
|
|
169
|
+
return results;
|
|
170
|
+
},
|
|
171
|
+
render(options) {
|
|
172
|
+
var _a, _b, _c, _d, _e;
|
|
173
|
+
assertConnectedCorrectly();
|
|
174
|
+
const id = (_b = (_a = options.nodeIdRemapper) === null || _a === void 0 ? void 0 : _a.remap(self.id)) !== null && _b !== void 0 ? _b : self.id;
|
|
175
|
+
switch (data.kind) {
|
|
176
|
+
case '#cdata-section':
|
|
177
|
+
return {
|
|
178
|
+
type: types_1.NodeType.CDATA,
|
|
179
|
+
id,
|
|
180
|
+
textContent: '',
|
|
181
|
+
};
|
|
182
|
+
case '#doctype':
|
|
183
|
+
return {
|
|
184
|
+
type: types_1.NodeType.DocumentType,
|
|
185
|
+
id,
|
|
186
|
+
name: data.name,
|
|
187
|
+
publicId: data.publicId,
|
|
188
|
+
systemId: data.systemId,
|
|
189
|
+
};
|
|
190
|
+
case '#document':
|
|
191
|
+
return {
|
|
192
|
+
type: types_1.NodeType.Document,
|
|
193
|
+
id,
|
|
194
|
+
childNodes: self.mapChildren((node) => node.render(options)),
|
|
195
|
+
adoptedStyleSheets: (_c = data.attachedStyleSheets) === null || _c === void 0 ? void 0 : _c.map((sheet) => sheet.renderAsAdoptedStyleSheet()),
|
|
196
|
+
};
|
|
197
|
+
case '#document-fragment':
|
|
198
|
+
return {
|
|
199
|
+
type: types_1.NodeType.DocumentFragment,
|
|
200
|
+
id,
|
|
201
|
+
childNodes: self.mapChildren((node) => node.render(options)),
|
|
202
|
+
adoptedStyleSheets: (_d = data.attachedStyleSheets) === null || _d === void 0 ? void 0 : _d.map((sheet) => sheet.renderAsAdoptedStyleSheet()),
|
|
203
|
+
isShadowRoot: false,
|
|
204
|
+
};
|
|
205
|
+
case '#element': {
|
|
206
|
+
const attributes = {};
|
|
207
|
+
// Add size-related virtual attributes before the real DOM attributes, to match
|
|
208
|
+
// the ordering used in the V1 format.
|
|
209
|
+
if (data.width !== undefined && data.height !== undefined) {
|
|
210
|
+
attributes.rr_width = `${data.width}px`;
|
|
211
|
+
attributes.rr_height = `${data.height}px`;
|
|
212
|
+
}
|
|
213
|
+
// Add DOM attributes.
|
|
214
|
+
Object.assign(attributes, data.attributes);
|
|
215
|
+
// Add other virtual attributes after the real DOM attributes, to match the
|
|
216
|
+
// ordering used in the V1 format.
|
|
217
|
+
if (data.attachedStyleSheets !== undefined) {
|
|
218
|
+
attributes._cssText = data.attachedStyleSheets.map((sheet) => sheet.renderAsCssText()).join('');
|
|
219
|
+
}
|
|
220
|
+
if (data.playbackState !== undefined) {
|
|
221
|
+
attributes.rr_mediaState = data.playbackState === types_1.PlaybackState.Paused ? 'paused' : 'played';
|
|
222
|
+
}
|
|
223
|
+
if (data.scrollLeft) {
|
|
224
|
+
attributes.rr_scrollLeft = data.scrollLeft;
|
|
225
|
+
}
|
|
226
|
+
if (data.scrollTop) {
|
|
227
|
+
attributes.rr_scrollTop = data.scrollTop;
|
|
228
|
+
}
|
|
229
|
+
return {
|
|
230
|
+
type: types_1.NodeType.Element,
|
|
231
|
+
id,
|
|
232
|
+
tagName: data.tag,
|
|
233
|
+
attributes,
|
|
234
|
+
childNodes: self.mapChildren((node) => node.render(options)),
|
|
235
|
+
isSVG: data.isSVG === true ? true : undefined,
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
case '#shadow-root':
|
|
239
|
+
return {
|
|
240
|
+
type: types_1.NodeType.DocumentFragment,
|
|
241
|
+
id,
|
|
242
|
+
childNodes: self.mapChildren((node) => node.render(options)),
|
|
243
|
+
adoptedStyleSheets: (_e = data.attachedStyleSheets) === null || _e === void 0 ? void 0 : _e.map((sheet) => sheet.renderAsAdoptedStyleSheet()),
|
|
244
|
+
isShadowRoot: true,
|
|
245
|
+
};
|
|
246
|
+
case '#text':
|
|
247
|
+
return {
|
|
248
|
+
type: types_1.NodeType.Text,
|
|
249
|
+
id,
|
|
250
|
+
textContent: data.textContent,
|
|
251
|
+
};
|
|
252
|
+
default:
|
|
253
|
+
data;
|
|
254
|
+
throw new Error(`Rendering not implemented for ${self.data.kind} node ${id}`);
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
get data() {
|
|
258
|
+
return data;
|
|
259
|
+
},
|
|
260
|
+
get ownerDocument() {
|
|
261
|
+
return document;
|
|
262
|
+
},
|
|
263
|
+
get id() {
|
|
264
|
+
return id;
|
|
265
|
+
},
|
|
266
|
+
get state() {
|
|
267
|
+
return state;
|
|
268
|
+
},
|
|
269
|
+
set state(value) {
|
|
270
|
+
if ((state === 'new' && value !== 'connected') ||
|
|
271
|
+
(state === 'connected' && value !== 'disconnected') ||
|
|
272
|
+
state === 'disconnected') {
|
|
273
|
+
throw new Error(`Invalid state transition from ${state} to ${value}`);
|
|
274
|
+
}
|
|
275
|
+
state = value;
|
|
276
|
+
},
|
|
277
|
+
firstChild: undefined,
|
|
278
|
+
lastChild: undefined,
|
|
279
|
+
previousSibling: undefined,
|
|
280
|
+
nextSibling: undefined,
|
|
281
|
+
parent: undefined,
|
|
282
|
+
};
|
|
283
|
+
return self;
|
|
284
|
+
}
|
|
285
|
+
//# sourceMappingURL=vNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vNode.js","sourceRoot":"","sources":["../../../../../src/domain/record/serialization/conversions/vNode.ts"],"names":[],"mappings":";;AAiFA,kCA+UC;AA/ZD,6CAA2D;AAgF3D,SAAgB,WAAW,CAAC,QAAmB,EAAE,EAAU,EAAE,IAAe;IAC1E,IAAI,KAAK,GAAe,KAAK,CAAA;IAE7B,MAAM,wBAAwB,GAAG,GAAS,EAAE;QAC1C,IAAI,IAAI,CAAC,KAAK,KAAK,WAAW,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,CAAC,EAAE,yBAAyB,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;QAChF,CAAC;QAED,KAAK,MAAM,UAAU,IAAI,CAAC,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,QAAQ,CAAU,EAAE,CAAC;YAC1G,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,CAAA;YACtC,IAAI,aAAa,IAAI,aAAa,CAAC,KAAK,KAAK,WAAW,EAAE,CAAC;gBACzD,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,CAAC,EAAE,MAAM,UAAU,yBAAyB,aAAa,CAAC,KAAK,EAAE,CAAC,CAAA;YACzG,CAAC;QACH,CAAC;IACH,CAAC,CAAA;IAED,MAAM,IAAI,GAAU;QAClB,KAAK,CAAC,IAAW;;YACf,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MA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|
2
|
+
import type { StyleSheetId } from '../../itemIds';
|
|
3
|
+
import type { VDocument } from './vDocument';
|
|
4
|
+
export interface VStyleSheet {
|
|
5
|
+
renderAsAdoptedStyleSheet(): StyleSheet;
|
|
6
|
+
renderAsCssText(): string;
|
|
7
|
+
get data(): VStyleSheetData;
|
|
8
|
+
get id(): StyleSheetId;
|
|
9
|
+
get ownerDocument(): VDocument;
|
|
10
|
+
}
|
|
11
|
+
export interface VStyleSheetData {
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
mediaList: string[];
|
|
14
|
+
rules: string | string[];
|
|
15
|
+
}
|
|
16
|
+
export declare function createVStyleSheet(document: VDocument, id: StyleSheetId, data: VStyleSheetData): VStyleSheet;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createVStyleSheet = createVStyleSheet;
|
|
4
|
+
function createVStyleSheet(document, id, data) {
|
|
5
|
+
const self = {
|
|
6
|
+
renderAsAdoptedStyleSheet() {
|
|
7
|
+
const cssRules = typeof data.rules === 'string' ? [data.rules] : data.rules;
|
|
8
|
+
return {
|
|
9
|
+
cssRules,
|
|
10
|
+
disabled: data.disabled ? true : undefined,
|
|
11
|
+
media: data.mediaList.length > 0 ? data.mediaList : undefined,
|
|
12
|
+
};
|
|
13
|
+
},
|
|
14
|
+
renderAsCssText() {
|
|
15
|
+
return typeof data.rules === 'string' ? data.rules : data.rules.join('');
|
|
16
|
+
},
|
|
17
|
+
get data() {
|
|
18
|
+
return data;
|
|
19
|
+
},
|
|
20
|
+
get id() {
|
|
21
|
+
return id;
|
|
22
|
+
},
|
|
23
|
+
get ownerDocument() {
|
|
24
|
+
return document;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
return self;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=vStyleSheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vStyleSheet.js","sourceRoot":"","sources":["../../../../../src/domain/record/serialization/conversions/vStyleSheet.ts"],"names":[],"mappings":";;AAmBA,8CA2BC;AA3BD,SAAgB,iBAAiB,CAAC,QAAmB,EAAE,EAAgB,EAAE,IAAqB;IAC5F,MAAM,IAAI,GAAgB;QACxB,yBAAyB;YACvB,MAAM,QAAQ,GAAG,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAA;YAC3E,OAAO;gBACL,QAAQ;gBACR,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;gBAC1C,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;aAC9D,CAAA;QACH,CAAC;QAED,eAAe;YACb,OAAO,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAC1E,CAAC;QAED,IAAI,IAAI;YACN,OAAO,IAAI,CAAA;QACb,CAAC;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,CAAA;QACX,CAAC;QACD,IAAI,aAAa;YACf,OAAO,QAAQ,CAAA;QACjB,CAAC;KACF,CAAA;IAED,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isFullSnapshotChangeRecordsEnabled = isFullSnapshotChangeRecordsEnabled;
|
|
4
|
+
exports.isIncrementalSnapshotChangeRecordsEnabled = isIncrementalSnapshotChangeRecordsEnabled;
|
|
5
|
+
const browser_core_1 = require("@datadog/browser-core");
|
|
6
|
+
function isFullSnapshotChangeRecordsEnabled() {
|
|
7
|
+
// We don't want to have to support the case where full snapshots use the old format and
|
|
8
|
+
// incremental snapshots use the new one, so we should generate full snapshot Change
|
|
9
|
+
// records if either feature flag is enabled.
|
|
10
|
+
return ((0, browser_core_1.isExperimentalFeatureEnabled)(browser_core_1.ExperimentalFeature.USE_CHANGE_RECORDS) ||
|
|
11
|
+
(0, browser_core_1.isExperimentalFeatureEnabled)(browser_core_1.ExperimentalFeature.USE_INCREMENTAL_CHANGE_RECORDS));
|
|
12
|
+
}
|
|
13
|
+
function isIncrementalSnapshotChangeRecordsEnabled() {
|
|
14
|
+
return (0, browser_core_1.isExperimentalFeatureEnabled)(browser_core_1.ExperimentalFeature.USE_INCREMENTAL_CHANGE_RECORDS);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=experimentalFeatures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experimentalFeatures.js","sourceRoot":"","sources":["../../../../src/domain/record/serialization/experimentalFeatures.ts"],"names":[],"mappings":";;AAEA,gFAQC;AAED,8FAEC;AAdD,wDAAyF;AAEzF,SAAgB,kCAAkC;IAChD,wFAAwF;IACxF,oFAAoF;IACpF,6CAA6C;IAC7C,OAAO,CACL,IAAA,2CAA4B,EAAC,kCAAmB,CAAC,kBAAkB,CAAC;QACpE,IAAA,2CAA4B,EAAC,kCAAmB,CAAC,8BAA8B,CAAC,CACjF,CAAA;AACH,CAAC;AAED,SAAgB,yCAAyC;IACvD,OAAO,IAAA,2CAA4B,EAAC,kCAAmB,CAAC,8BAA8B,CAAC,CAAA;AACzF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type { ChangeConverter, MutationLog, NodeIdRemapper } from './conversions';
|
|
2
|
+
export { createChangeConverter, createCopyingNodeIdRemapper, createIdentityNodeIdRemapper } from './conversions';
|
|
3
|
+
export { isFullSnapshotChangeRecordsEnabled, isIncrementalSnapshotChangeRecordsEnabled } from './experimentalFeatures';
|
|
4
|
+
export { createChildInsertionCursor, createRootInsertionCursor } from './insertionCursor';
|
|
5
|
+
export { getElementInputValue } from './serializationUtils';
|
|
6
|
+
export { serializeFullSnapshot } from './serializeFullSnapshot';
|
|
7
|
+
export { serializeFullSnapshotAsChange } from './serializeFullSnapshotAsChange';
|
|
8
|
+
export { serializeMutations } from './serializeMutations';
|
|
9
|
+
export { serializeMutationsAsChange } from './serializeMutationsAsChange';
|
|
10
|
+
export { serializeNode } from './serializeNode';
|
|
11
|
+
export { serializeNodeAsChange } from './serializeNodeAsChange';
|
|
12
|
+
export { serializeAttribute } from './serializeAttribute';
|
|
13
|
+
export { createSerializationStats, updateSerializationStats, aggregateSerializationStats } from './serializationStats';
|
|
14
|
+
export type { SerializationMetric, SerializationStats } from './serializationStats';
|
|
15
|
+
export { serializeChangesInTransaction, serializeInTransaction, SerializationKind } from './serializationTransaction';
|
|
16
|
+
export type { ChangeSerializationTransaction, SerializationTransaction, SerializationTransactionCallback, } from './serializationTransaction';
|
|
17
|
+
export type { ParentNodePrivacyLevel } from './serialization.types';
|