@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,216 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createChangeConverter = createChangeConverter;
|
|
4
|
+
const types_1 = require("../../../../types");
|
|
5
|
+
const stringTable_1 = require("./stringTable");
|
|
6
|
+
const vDocument_1 = require("./vDocument");
|
|
7
|
+
function createChangeConverter() {
|
|
8
|
+
const self = {
|
|
9
|
+
convert(record, options = {}) {
|
|
10
|
+
applyChangeToVDOM(record, self.document, self.stringTable);
|
|
11
|
+
return self.document.render({ timestamp: record.timestamp, ...options });
|
|
12
|
+
},
|
|
13
|
+
document: (0, vDocument_1.createVDocument)(),
|
|
14
|
+
stringTable: (0, stringTable_1.createStringTable)(),
|
|
15
|
+
};
|
|
16
|
+
return self;
|
|
17
|
+
}
|
|
18
|
+
function applyChangeToVDOM(record, document, stringTable) {
|
|
19
|
+
document.mutations.clear();
|
|
20
|
+
for (const change of record.data) {
|
|
21
|
+
switch (change[0]) {
|
|
22
|
+
case types_1.ChangeType.AddString: {
|
|
23
|
+
for (let i = 1; i < change.length; i++) {
|
|
24
|
+
stringTable.add(change[i]);
|
|
25
|
+
}
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
case types_1.ChangeType.AddNode: {
|
|
29
|
+
for (let i = 1; i < change.length; i++) {
|
|
30
|
+
applyAddNodeChange(change[i], document, stringTable);
|
|
31
|
+
}
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
case types_1.ChangeType.RemoveNode: {
|
|
35
|
+
for (let i = 1; i < change.length; i++) {
|
|
36
|
+
applyRemoveNodeChange(change[i], document);
|
|
37
|
+
}
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
case types_1.ChangeType.Attribute: {
|
|
41
|
+
for (let i = 1; i < change.length; i++) {
|
|
42
|
+
applyAttributeChange(change[i], document, stringTable);
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
case types_1.ChangeType.Text: {
|
|
47
|
+
for (let i = 1; i < change.length; i++) {
|
|
48
|
+
applyTextChange(change[i], document, stringTable);
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
case types_1.ChangeType.ScrollPosition: {
|
|
53
|
+
for (let i = 1; i < change.length; i++) {
|
|
54
|
+
applyScrollPositionChange(change[i], document);
|
|
55
|
+
}
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
case types_1.ChangeType.Size: {
|
|
59
|
+
for (let i = 1; i < change.length; i++) {
|
|
60
|
+
applySizeChange(change[i], document);
|
|
61
|
+
}
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
case types_1.ChangeType.AddStyleSheet: {
|
|
65
|
+
for (let i = 1; i < change.length; i++) {
|
|
66
|
+
applyAddStyleSheetChange(change[i], document, stringTable);
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
case types_1.ChangeType.AttachedStyleSheets: {
|
|
71
|
+
for (let i = 1; i < change.length; i++) {
|
|
72
|
+
applyAttachedStyleSheetsChange(change[i], document);
|
|
73
|
+
}
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
case types_1.ChangeType.MediaPlaybackState: {
|
|
77
|
+
for (let i = 1; i < change.length; i++) {
|
|
78
|
+
applyMediaPlaybackStateChange(change[i], document);
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
case types_1.ChangeType.VisualViewport:
|
|
83
|
+
// Not yet supported.
|
|
84
|
+
break;
|
|
85
|
+
default:
|
|
86
|
+
change;
|
|
87
|
+
throw new Error(`Unsupported BrowserChangeType: ${change[0]}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function applyAddNodeChange(addedNode, document, stringTable) {
|
|
92
|
+
const nodeName = stringTable.decode(addedNode[1]);
|
|
93
|
+
let node;
|
|
94
|
+
switch (nodeName) {
|
|
95
|
+
case '#cdata-section':
|
|
96
|
+
node = document.createNode({ kind: '#cdata-section' });
|
|
97
|
+
break;
|
|
98
|
+
case '#doctype': {
|
|
99
|
+
const [, , name, publicId, systemId] = addedNode;
|
|
100
|
+
node = document.createNode({
|
|
101
|
+
kind: '#doctype',
|
|
102
|
+
name: stringTable.decode(name),
|
|
103
|
+
publicId: stringTable.decode(publicId),
|
|
104
|
+
systemId: stringTable.decode(systemId),
|
|
105
|
+
});
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
case '#document':
|
|
109
|
+
node = document.createNode({ kind: '#document' });
|
|
110
|
+
break;
|
|
111
|
+
case '#document-fragment':
|
|
112
|
+
node = document.createNode({ kind: '#document-fragment' });
|
|
113
|
+
break;
|
|
114
|
+
case '#shadow-root':
|
|
115
|
+
node = document.createNode({ kind: '#shadow-root' });
|
|
116
|
+
break;
|
|
117
|
+
case '#text': {
|
|
118
|
+
const [, , textContent] = addedNode;
|
|
119
|
+
node = document.createNode({
|
|
120
|
+
kind: '#text',
|
|
121
|
+
textContent: stringTable.decode(textContent),
|
|
122
|
+
});
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
default: {
|
|
126
|
+
let tagName;
|
|
127
|
+
let isSVG = false;
|
|
128
|
+
if (nodeName.startsWith('svg>')) {
|
|
129
|
+
tagName = nodeName.substring(4).toLowerCase();
|
|
130
|
+
isSVG = true;
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
tagName = nodeName.toLowerCase();
|
|
134
|
+
}
|
|
135
|
+
const [, , ...attributeAssignments] = addedNode;
|
|
136
|
+
const attributes = {};
|
|
137
|
+
for (const [name, value] of attributeAssignments) {
|
|
138
|
+
attributes[stringTable.decode(name)] = stringTable.decode(value);
|
|
139
|
+
}
|
|
140
|
+
node = document.createNode({ kind: '#element', tag: tagName, attributes, isSVG });
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
const insertionPoint = addedNode[0];
|
|
145
|
+
if (insertionPoint === null) {
|
|
146
|
+
document.root = node;
|
|
147
|
+
}
|
|
148
|
+
else if (insertionPoint === 0) {
|
|
149
|
+
const previousSiblingId = (node.id - 1);
|
|
150
|
+
const previousSibling = document.getNodeById(previousSiblingId);
|
|
151
|
+
previousSibling.after(node);
|
|
152
|
+
}
|
|
153
|
+
else if (insertionPoint > 0) {
|
|
154
|
+
const parentId = (node.id - insertionPoint);
|
|
155
|
+
const parent = document.getNodeById(parentId);
|
|
156
|
+
parent.appendChild(node);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
const nextSiblingId = (node.id + insertionPoint);
|
|
160
|
+
const nextSibling = document.getNodeById(nextSiblingId);
|
|
161
|
+
nextSibling.before(node);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
function applyAddStyleSheetChange(change, document, stringTable) {
|
|
165
|
+
const [encodedRules, encodedMediaList = [], disabled = false] = change;
|
|
166
|
+
const rules = Array.isArray(encodedRules)
|
|
167
|
+
? encodedRules.map((rule) => stringTable.decode(rule))
|
|
168
|
+
: stringTable.decode(encodedRules);
|
|
169
|
+
const mediaList = encodedMediaList.map((item) => stringTable.decode(item));
|
|
170
|
+
document.createStyleSheet({ rules, mediaList, disabled });
|
|
171
|
+
}
|
|
172
|
+
function applyAttachedStyleSheetsChange(change, document) {
|
|
173
|
+
const [nodeId, ...sheetIds] = change;
|
|
174
|
+
const node = document.getNodeById(nodeId);
|
|
175
|
+
node.setAttachedStyleSheets(sheetIds.map((sheetId) => document.getStyleSheetById(sheetId)));
|
|
176
|
+
}
|
|
177
|
+
function applyAttributeChange(change, document, stringTable) {
|
|
178
|
+
const [nodeId, ...attributeMutations] = change;
|
|
179
|
+
const node = document.getNodeById(nodeId);
|
|
180
|
+
for (const [nameOrId, valueOrId = null] of attributeMutations) {
|
|
181
|
+
const name = stringTable.decode(nameOrId);
|
|
182
|
+
if (valueOrId === null) {
|
|
183
|
+
node.setAttribute(name, null);
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
const value = stringTable.decode(valueOrId);
|
|
187
|
+
node.setAttribute(name, value);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
function applyMediaPlaybackStateChange(change, document) {
|
|
192
|
+
const [nodeId, playbackState] = change;
|
|
193
|
+
const node = document.getNodeById(nodeId);
|
|
194
|
+
node.setPlaybackState(playbackState);
|
|
195
|
+
}
|
|
196
|
+
function applyRemoveNodeChange(change, document) {
|
|
197
|
+
const nodeId = change;
|
|
198
|
+
const node = document.getNodeById(nodeId);
|
|
199
|
+
node.remove();
|
|
200
|
+
}
|
|
201
|
+
function applyScrollPositionChange(change, document) {
|
|
202
|
+
const [nodeId, left, top] = change;
|
|
203
|
+
const node = document.getNodeById(nodeId);
|
|
204
|
+
node.setScrollPosition(left, top);
|
|
205
|
+
}
|
|
206
|
+
function applySizeChange(change, document) {
|
|
207
|
+
const [nodeId, width, height] = change;
|
|
208
|
+
const node = document.getNodeById(nodeId);
|
|
209
|
+
node.setSize(width, height);
|
|
210
|
+
}
|
|
211
|
+
function applyTextChange(change, document, stringTable) {
|
|
212
|
+
const [nodeId, textContent] = change;
|
|
213
|
+
const node = document.getNodeById(nodeId);
|
|
214
|
+
node.setTextContent(stringTable.decode(textContent));
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=changeConverter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changeConverter.js","sourceRoot":"","sources":["../../../../../src/domain/record/serialization/conversions/changeConverter.ts"],"names":[],"mappings":";;AAoCA,sDAeC;AAlCD,6CAA8C;AAI9C,+CAAiD;AAEjD,2CAA6C;AAa7C,SAAgB,qBAAqB;IACnC,MAAM,IAAI,GAAoB;QAC5B,OAAO,CACL,MAA2B,EAC3B,UAAoC,EAAE;YAEtC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;YAC1D,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,GAAG,OAAO,EAAE,CAAC,CAAA;QAC1E,CAAC;QAED,QAAQ,EAAE,IAAA,2BAAe,GAAE;QAC3B,WAAW,EAAE,IAAA,+BAAiB,GAAE;KACjC,CAAA;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AAED,SAAS,iBAAiB,CAAC,MAA2B,EAAE,QAAmB,EAAE,WAAwB;IACnG,QAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,CAAA;IA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AwB;IACxF,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,MAAM,CAAA;IACpC,MAAM,IAAI,GAAG,QAAQ,CAAC,WAAW,CAAC,MAAgB,CAAC,CAAA;IACnD,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAA;AACtD,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { BrowserChangeRecord } from '../../../../types';
|
|
2
|
+
import type { StringTable } from './stringTable';
|
|
3
|
+
/**
|
|
4
|
+
* ChangeDecoder converts a BrowserChangeRecord, or a stream of BrowserChangeRecords, into
|
|
5
|
+
* a more human-readable form by:
|
|
6
|
+
* - Removing AddString changes (string table definitions).
|
|
7
|
+
* - Replacing string table references in all other changes with their literal values.
|
|
8
|
+
*
|
|
9
|
+
* This makes it easier to visualize the contents of BrowserChangeRecords or to write test
|
|
10
|
+
* expectations against the record's content.
|
|
11
|
+
*/
|
|
12
|
+
export interface ChangeDecoder {
|
|
13
|
+
decode(record: BrowserChangeRecord): BrowserChangeRecord;
|
|
14
|
+
stringTable: StringTable;
|
|
15
|
+
}
|
|
16
|
+
export declare function createChangeDecoder(): ChangeDecoder;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createChangeDecoder = createChangeDecoder;
|
|
4
|
+
const types_1 = require("../../../../types");
|
|
5
|
+
const stringTable_1 = require("./stringTable");
|
|
6
|
+
function createChangeDecoder() {
|
|
7
|
+
const self = {
|
|
8
|
+
decode(record) {
|
|
9
|
+
return decodeChangeRecord(record, self.stringTable);
|
|
10
|
+
},
|
|
11
|
+
stringTable: (0, stringTable_1.createStringTable)(),
|
|
12
|
+
};
|
|
13
|
+
return self;
|
|
14
|
+
}
|
|
15
|
+
function decodeChangeRecord(record, stringTable) {
|
|
16
|
+
const decodedData = [];
|
|
17
|
+
for (const change of record.data) {
|
|
18
|
+
switch (change[0]) {
|
|
19
|
+
case types_1.ChangeType.AddString:
|
|
20
|
+
// Update the string table.
|
|
21
|
+
for (let i = 1; i < change.length; i++) {
|
|
22
|
+
stringTable.add(change[i]);
|
|
23
|
+
}
|
|
24
|
+
// Deliberately don't include this change in the decoded record.
|
|
25
|
+
break;
|
|
26
|
+
case types_1.ChangeType.AddNode: {
|
|
27
|
+
const decoded = [types_1.ChangeType.AddNode];
|
|
28
|
+
for (let i = 1; i < change.length; i++) {
|
|
29
|
+
decoded.push(decodeAddNodeChange(change[i], stringTable));
|
|
30
|
+
}
|
|
31
|
+
decodedData.push(decoded);
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
case types_1.ChangeType.RemoveNode:
|
|
35
|
+
decodedData.push(change);
|
|
36
|
+
break;
|
|
37
|
+
case types_1.ChangeType.Attribute: {
|
|
38
|
+
const decoded = [types_1.ChangeType.Attribute];
|
|
39
|
+
for (let i = 1; i < change.length; i++) {
|
|
40
|
+
decoded.push(decodeAttributeChange(change[i], stringTable));
|
|
41
|
+
}
|
|
42
|
+
decodedData.push(decoded);
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
case types_1.ChangeType.Text: {
|
|
46
|
+
const decoded = [types_1.ChangeType.Text];
|
|
47
|
+
for (let i = 1; i < change.length; i++) {
|
|
48
|
+
decoded.push(decodeTextChange(change[i], stringTable));
|
|
49
|
+
}
|
|
50
|
+
decodedData.push(decoded);
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
case types_1.ChangeType.Size:
|
|
54
|
+
case types_1.ChangeType.ScrollPosition:
|
|
55
|
+
case types_1.ChangeType.AttachedStyleSheets:
|
|
56
|
+
case types_1.ChangeType.MediaPlaybackState:
|
|
57
|
+
case types_1.ChangeType.VisualViewport:
|
|
58
|
+
decodedData.push(change);
|
|
59
|
+
break;
|
|
60
|
+
case types_1.ChangeType.AddStyleSheet: {
|
|
61
|
+
const decoded = [types_1.ChangeType.AddStyleSheet];
|
|
62
|
+
for (let i = 1; i < change.length; i++) {
|
|
63
|
+
decoded.push(decodeAddStyleSheetChange(change[i], stringTable));
|
|
64
|
+
}
|
|
65
|
+
decodedData.push(decoded);
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
default:
|
|
69
|
+
change;
|
|
70
|
+
throw new Error(`Unsupported ChangeType: ${change[0]}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return { ...record, data: decodedData };
|
|
74
|
+
}
|
|
75
|
+
function decodeAddNodeChange(change, stringTable) {
|
|
76
|
+
const insertionPoint = change[0];
|
|
77
|
+
const nodeName = stringTable.decode(change[1]);
|
|
78
|
+
switch (nodeName) {
|
|
79
|
+
case '#cdata-section':
|
|
80
|
+
case '#document':
|
|
81
|
+
case '#document-fragment':
|
|
82
|
+
case '#shadow-root':
|
|
83
|
+
return [insertionPoint, nodeName];
|
|
84
|
+
case '#doctype': {
|
|
85
|
+
const [, , name, publicId, systemId] = change;
|
|
86
|
+
return [
|
|
87
|
+
insertionPoint,
|
|
88
|
+
'#doctype',
|
|
89
|
+
stringTable.decode(name),
|
|
90
|
+
stringTable.decode(publicId),
|
|
91
|
+
stringTable.decode(systemId),
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
case '#text': {
|
|
95
|
+
const [, , textContent] = change;
|
|
96
|
+
return [insertionPoint, '#text', stringTable.decode(textContent)];
|
|
97
|
+
}
|
|
98
|
+
default: {
|
|
99
|
+
const decodedChange = [insertionPoint, nodeName];
|
|
100
|
+
const [, , ...attrs] = change;
|
|
101
|
+
for (const [name, value] of attrs) {
|
|
102
|
+
decodedChange.push([stringTable.decode(name), stringTable.decode(value)]);
|
|
103
|
+
}
|
|
104
|
+
return decodedChange;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function decodeAttributeChange(change, stringTable) {
|
|
109
|
+
const [nodeId, ...mutations] = change;
|
|
110
|
+
const decodedMutations = mutations.map((mutation) => {
|
|
111
|
+
if (mutation.length === 1) {
|
|
112
|
+
return [stringTable.decode(mutation[0])];
|
|
113
|
+
}
|
|
114
|
+
return [stringTable.decode(mutation[0]), stringTable.decode(mutation[1])];
|
|
115
|
+
});
|
|
116
|
+
const decodedChange = [nodeId];
|
|
117
|
+
decodedChange.push(...decodedMutations);
|
|
118
|
+
return decodedChange;
|
|
119
|
+
}
|
|
120
|
+
function decodeTextChange(change, stringTable) {
|
|
121
|
+
return [change[0], stringTable.decode(change[1])];
|
|
122
|
+
}
|
|
123
|
+
function decodeAddStyleSheetChange(change, stringTable) {
|
|
124
|
+
const rules = change[0];
|
|
125
|
+
const decodedRules = Array.isArray(rules)
|
|
126
|
+
? rules.map((rule) => stringTable.decode(rule))
|
|
127
|
+
: stringTable.decode(rules);
|
|
128
|
+
if (change.length === 1) {
|
|
129
|
+
return [decodedRules];
|
|
130
|
+
}
|
|
131
|
+
const decodedMediaList = change[1].map((item) => stringTable.decode(item));
|
|
132
|
+
if (change.length === 2) {
|
|
133
|
+
return [decodedRules, decodedMediaList];
|
|
134
|
+
}
|
|
135
|
+
return [decodedRules, decodedMediaList, change[2]];
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=changeDecoder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changeDecoder.js","sourceRoot":"","sources":["../../../../../src/domain/record/serialization/conversions/changeDecoder.ts"],"names":[],"mappings":";;AAgCA,kDAUC;AA1CD,6CAA8C;AAe9C,+CAAiD;AAiBjD,SAAgB,mBAAmB;IACjC,MAAM,IAAI,GAAkB;QAC1B,MAAM,CAAC,MAA2B;YAChC,OAAO,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;QACrD,CAAC;QAED,WAAW,EAAE,IAAA,+BAAiB,GAAE;KACjC,CAAA;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AAED,SAAS,kBAAkB,CAAC,MAA2B,EAAE,WAAwB;IAC/E,MAAM,W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AC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC/C,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAE7B,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,CAAC,YAAY,CAAC,CAAA;IACvB,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;IAE1E,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAA;IACzC,CAAC;IAED,OAAO,CAAC,YAAY,EAAE,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AACpD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { ChangeConverter } from './changeConverter';
|
|
2
|
+
export { createChangeConverter } from './changeConverter';
|
|
3
|
+
export type { ChangeDecoder } from './changeDecoder';
|
|
4
|
+
export { createChangeDecoder } from './changeDecoder';
|
|
5
|
+
export type { MutationLog } from './mutationLog';
|
|
6
|
+
export type { NodeIdRemapper } from './nodeIdRemapper';
|
|
7
|
+
export { createCopyingNodeIdRemapper, createIdentityNodeIdRemapper } from './nodeIdRemapper';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createIdentityNodeIdRemapper = exports.createCopyingNodeIdRemapper = exports.createChangeDecoder = exports.createChangeConverter = void 0;
|
|
4
|
+
var changeConverter_1 = require("./changeConverter");
|
|
5
|
+
Object.defineProperty(exports, "createChangeConverter", { enumerable: true, get: function () { return changeConverter_1.createChangeConverter; } });
|
|
6
|
+
var changeDecoder_1 = require("./changeDecoder");
|
|
7
|
+
Object.defineProperty(exports, "createChangeDecoder", { enumerable: true, get: function () { return changeDecoder_1.createChangeDecoder; } });
|
|
8
|
+
var nodeIdRemapper_1 = require("./nodeIdRemapper");
|
|
9
|
+
Object.defineProperty(exports, "createCopyingNodeIdRemapper", { enumerable: true, get: function () { return nodeIdRemapper_1.createCopyingNodeIdRemapper; } });
|
|
10
|
+
Object.defineProperty(exports, "createIdentityNodeIdRemapper", { enumerable: true, get: function () { return nodeIdRemapper_1.createIdentityNodeIdRemapper; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/domain/record/serialization/conversions/index.ts"],"names":[],"mappings":";;;AACA,qDAAyD;AAAhD,wHAAA,qBAAqB,OAAA;AAE9B,iDAAqD;AAA5C,oHAAA,mBAAmB,OAAA;AAG5B,mDAA4F;AAAnF,6HAAA,2BAA2B,OAAA;AAAE,8HAAA,4BAA4B,OAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { NodeId } from '../../itemIds';
|
|
2
|
+
type ParentNodeId = NodeId;
|
|
3
|
+
export interface MutationLog {
|
|
4
|
+
onAttributeChanged(nodeId: NodeId, name: string): void;
|
|
5
|
+
onNodeConnected(nodeId: NodeId): void;
|
|
6
|
+
onNodeDisconnected(nodeId: NodeId, parentId: ParentNodeId): void;
|
|
7
|
+
onTextChanged(nodeId: NodeId): void;
|
|
8
|
+
clear(): void;
|
|
9
|
+
attributeChanges: Map<NodeId, Set<string>>;
|
|
10
|
+
nodeAdds: Set<NodeId>;
|
|
11
|
+
nodeRemoves: Map<NodeId, ParentNodeId>;
|
|
12
|
+
textChanges: Set<NodeId>;
|
|
13
|
+
}
|
|
14
|
+
export declare function createMutationLog(): MutationLog;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createMutationLog = createMutationLog;
|
|
4
|
+
function createMutationLog() {
|
|
5
|
+
const self = {
|
|
6
|
+
onAttributeChanged(nodeId, name) {
|
|
7
|
+
let changedAttributes = self.attributeChanges.get(nodeId);
|
|
8
|
+
if (!changedAttributes) {
|
|
9
|
+
changedAttributes = new Set();
|
|
10
|
+
self.attributeChanges.set(nodeId, changedAttributes);
|
|
11
|
+
}
|
|
12
|
+
changedAttributes.add(name);
|
|
13
|
+
},
|
|
14
|
+
onNodeConnected(nodeId) {
|
|
15
|
+
self.nodeAdds.add(nodeId);
|
|
16
|
+
},
|
|
17
|
+
onNodeDisconnected(nodeId, parentId) {
|
|
18
|
+
self.nodeRemoves.set(nodeId, parentId);
|
|
19
|
+
},
|
|
20
|
+
onTextChanged(nodeId) {
|
|
21
|
+
self.textChanges.add(nodeId);
|
|
22
|
+
},
|
|
23
|
+
clear() {
|
|
24
|
+
self.attributeChanges.clear();
|
|
25
|
+
self.nodeAdds.clear();
|
|
26
|
+
self.nodeRemoves.clear();
|
|
27
|
+
self.textChanges.clear();
|
|
28
|
+
},
|
|
29
|
+
attributeChanges: new Map(),
|
|
30
|
+
nodeAdds: new Set(),
|
|
31
|
+
nodeRemoves: new Map(),
|
|
32
|
+
textChanges: new Set(),
|
|
33
|
+
};
|
|
34
|
+
return self;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=mutationLog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutationLog.js","sourceRoot":"","sources":["../../../../../src/domain/record/serialization/conversions/mutationLog.ts"],"names":[],"mappings":";;AAkBA,8CAqCC;AArCD,SAAgB,iBAAiB;IAC/B,MAAM,IAAI,GAAgB;QACxB,kBAAkB,CAAC,MAAc,EAAE,IAAY;YAC7C,IAAI,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;YACzD,IAAI,CAAC,iBAAiB,EAAE,CAAC;gBACvB,iBAAiB,GAAG,IAAI,GAAG,EAAU,CAAA;gBACrC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;YACtD,CAAC;YACD,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC7B,CAAC;QAED,eAAe,CAAC,MAAc;YAC5B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAC3B,CAAC;QAED,kBAAkB,CAAC,MAAc,EAAE,QAAsB;YACvD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;QACxC,CAAC;QAED,aAAa,CAAC,MAAc;YAC1B,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAC9B,CAAC;QAED,KAAK;YACH,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAA;YAC7B,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAA;YACrB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAA;YACxB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAA;QAC1B,CAAC;QAED,gBAAgB,EAAE,IAAI,GAAG,EAAuB;QAChD,QAAQ,EAAE,IAAI,GAAG,EAAU;QAC3B,WAAW,EAAE,IAAI,GAAG,EAAwB;QAC5C,WAAW,EAAE,IAAI,GAAG,EAAU;KAC/B,CAAA;IAED,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NodeId, NodeIds } from '../../itemIds';
|
|
2
|
+
export interface NodeIdRemapper {
|
|
3
|
+
remap(inputNodeId: NodeId): NodeId;
|
|
4
|
+
}
|
|
5
|
+
export declare function createIdentityNodeIdRemapper(): NodeIdRemapper;
|
|
6
|
+
export interface CopyingNodeIdRemapper extends NodeIdRemapper {
|
|
7
|
+
inputNodeIds: NodeIds;
|
|
8
|
+
outputNodeIds: NodeIds;
|
|
9
|
+
}
|
|
10
|
+
export declare function createCopyingNodeIdRemapper(): CopyingNodeIdRemapper;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createIdentityNodeIdRemapper = createIdentityNodeIdRemapper;
|
|
4
|
+
exports.createCopyingNodeIdRemapper = createCopyingNodeIdRemapper;
|
|
5
|
+
const itemIds_1 = require("../../itemIds");
|
|
6
|
+
function createIdentityNodeIdRemapper() {
|
|
7
|
+
return {
|
|
8
|
+
remap(inputNodeId) {
|
|
9
|
+
return inputNodeId;
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function createCopyingNodeIdRemapper() {
|
|
14
|
+
const { nodeIds: inputNodeIds, nodesByNodeId: inputNodesByNodeId } = createTrackedNodeIds();
|
|
15
|
+
const { nodeIds: outputNodeIds, nodeIdsByNode: outputNodeIdsByNode } = createTrackedNodeIds();
|
|
16
|
+
const self = {
|
|
17
|
+
remap(inputNodeId) {
|
|
18
|
+
var _a;
|
|
19
|
+
const node = inputNodesByNodeId.get(inputNodeId);
|
|
20
|
+
if (!node) {
|
|
21
|
+
throw new Error(`Input node id ${inputNodeId} not found`);
|
|
22
|
+
}
|
|
23
|
+
return (_a = outputNodeIdsByNode.get(node)) !== null && _a !== void 0 ? _a : outputNodeIds.getOrInsert(node);
|
|
24
|
+
},
|
|
25
|
+
inputNodeIds,
|
|
26
|
+
outputNodeIds,
|
|
27
|
+
};
|
|
28
|
+
return self;
|
|
29
|
+
}
|
|
30
|
+
function createTrackedNodeIds() {
|
|
31
|
+
const wrappedNodeIds = (0, itemIds_1.createNodeIds)();
|
|
32
|
+
const nodeIdsByNode = new Map();
|
|
33
|
+
const nodesByNodeId = new Map();
|
|
34
|
+
const nodeIds = {
|
|
35
|
+
clear: wrappedNodeIds.clear,
|
|
36
|
+
delete: wrappedNodeIds.delete,
|
|
37
|
+
get: wrappedNodeIds.get,
|
|
38
|
+
getOrInsert(node) {
|
|
39
|
+
const nodeId = wrappedNodeIds.getOrInsert(node);
|
|
40
|
+
nodeIdsByNode.set(node, nodeId);
|
|
41
|
+
nodesByNodeId.set(nodeId, node);
|
|
42
|
+
return nodeId;
|
|
43
|
+
},
|
|
44
|
+
get nextId() {
|
|
45
|
+
return wrappedNodeIds.nextId;
|
|
46
|
+
},
|
|
47
|
+
get size() {
|
|
48
|
+
return wrappedNodeIds.size;
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
return { nodeIds, nodeIdsByNode, nodesByNodeId };
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=nodeIdRemapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeIdRemapper.js","sourceRoot":"","sources":["../../../../../src/domain/record/serialization/conversions/nodeIdRemapper.ts"],"names":[],"mappings":";;AAOA,oEAMC;AAOD,kEAkBC;AArCD,2CAA6C;AAM7C,SAAgB,4BAA4B;IAC1C,OAAO;QACL,KAAK,CAAC,WAAmB;YACvB,OAAO,WAAW,CAAA;QACpB,CAAC;KACF,CAAA;AACH,CAAC;AAOD,SAAgB,2BAA2B;IACzC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,GAAG,oBAAoB,EAAE,CAAA;IAC3F,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAE,GAAG,oBAAoB,EAAE,CAAA;IAE7F,MAAM,IAAI,GAA0B;QAClC,KAAK,CAAC,WAAmB;;YACvB,MAAM,IAAI,GAAG,kBAAkB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;YAChD,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,MAAM,IAAI,KAAK,CAAC,iBAAiB,WAAW,YAAY,CAAC,CAAA;YAC3D,CAAC;YACD,OAAO,MAAA,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,mCAAI,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;QACzE,CAAC;QAED,YAAY;QACZ,aAAa;KACd,CAAA;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AAED,SAAS,oBAAoB;IAK3B,MAAM,cAAc,GAAG,IAAA,uBAAa,GAAE,CAAA;IACtC,MAAM,aAAa,GAAG,IAAI,GAAG,EAAgB,CAAA;IAC7C,MAAM,aAAa,GAAG,IAAI,GAAG,EAAgB,CAAA;IAE7C,MAAM,OAAO,GAAY;QACvB,KAAK,EAAE,cAAc,CAAC,KAAK;QAC3B,MAAM,EAAE,cAAc,CAAC,MAAM;QAC7B,GAAG,EAAE,cAAc,CAAC,GAAG;QACvB,WAAW,CAAC,IAAU;YACpB,MAAM,MAAM,GAAG,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;YAC/C,aAAa,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;YAC/B,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YAC/B,OAAO,MAAM,CAAA;QACf,CAAC;QACD,IAAI,MAAM;YACR,OAAO,cAAc,CAAC,MAAM,CAAA;QAC9B,CAAC;QACD,IAAI,IAAI;YACN,OAAO,cAAc,CAAC,IAAI,CAAA;QAC5B,CAAC;KACF,CAAA;IAED,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,CAAA;AAClD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createV1RenderOptions = createV1RenderOptions;
|
|
4
|
+
const nodeIdRemapper_1 = require("./nodeIdRemapper");
|
|
5
|
+
function createV1RenderOptions(options = {}) {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
return {
|
|
8
|
+
nodeIdRemapper: (_a = options.nodeIdRemapper) !== null && _a !== void 0 ? _a : (0, nodeIdRemapper_1.createIdentityNodeIdRemapper)(),
|
|
9
|
+
timestamp: (_b = options.timestamp) !== null && _b !== void 0 ? _b : 0,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=renderOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderOptions.js","sourceRoot":"","sources":["../../../../../src/domain/record/serialization/conversions/renderOptions.ts"],"names":[],"mappings":";;AAQA,sDAKC;AAZD,qDAA+D;AAO/D,SAAgB,qBAAqB,CAAC,UAAoC,EAAE;;IAC1E,OAAO;QACL,cAAc,EAAE,MAAA,OAAO,CAAC,cAAc,mCAAI,IAAA,6CAA4B,GAAE;QACxE,SAAS,EAAE,MAAA,OAAO,CAAC,SAAS,mCAAI,CAAC;KAClC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createStringTable = createStringTable;
|
|
4
|
+
function createStringTable() {
|
|
5
|
+
const strings = new Map();
|
|
6
|
+
return {
|
|
7
|
+
add(newString) {
|
|
8
|
+
strings.set(strings.size, newString);
|
|
9
|
+
},
|
|
10
|
+
decode(stringOrStringId) {
|
|
11
|
+
if (typeof stringOrStringId === 'string') {
|
|
12
|
+
return stringOrStringId;
|
|
13
|
+
}
|
|
14
|
+
const referencedString = strings.get(stringOrStringId);
|
|
15
|
+
if (referencedString === undefined) {
|
|
16
|
+
throw new Error(`Reference to unknown string: ${stringOrStringId}`);
|
|
17
|
+
}
|
|
18
|
+
return referencedString;
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=stringTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stringTable.js","sourceRoot":"","sources":["../../../../../src/domain/record/serialization/conversions/stringTable.ts"],"names":[],"mappings":";;AAOA,8CAiBC;AAjBD,SAAgB,iBAAiB;IAC/B,MAAM,OAAO,GAAG,IAAI,GAAG,EAAoB,CAAA;IAC3C,OAAO;QACL,GAAG,CAAC,SAAiB;YACnB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAgB,EAAE,SAAS,CAAC,CAAA;QAClD,CAAC;QACD,MAAM,CAAC,gBAAiC;YACtC,IAAI,OAAO,gBAAgB,KAAK,QAAQ,EAAE,CAAC;gBACzC,OAAO,gBAAgB,CAAA;YACzB,CAAC;YACD,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,gBAA4B,CAAC,CAAA;YAClE,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;gBACnC,MAAM,IAAI,KAAK,CAAC,gCAAgC,gBAAgB,EAAE,CAAC,CAAA;YACrE,CAAC;YACD,OAAO,gBAAgB,CAAA;QACzB,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { BrowserFullSnapshotRecord, BrowserIncrementalSnapshotRecord } from '../../../../types';
|
|
2
|
+
import type { NodeId, StyleSheetId } from '../../itemIds';
|
|
3
|
+
import type { MutationLog } from './mutationLog';
|
|
4
|
+
import type { V1RenderOptions } from './renderOptions';
|
|
5
|
+
import type { VNode, VNodeData } from './vNode';
|
|
6
|
+
import type { VStyleSheet, VStyleSheetData } from './vStyleSheet';
|
|
7
|
+
export interface VDocument {
|
|
8
|
+
createNode(data: VNodeData): VNode;
|
|
9
|
+
getNodeById(id: NodeId): VNode;
|
|
10
|
+
createStyleSheet(data: VStyleSheetData): VStyleSheet;
|
|
11
|
+
getStyleSheetById(id: StyleSheetId): VStyleSheet;
|
|
12
|
+
onAttributeChanged(node: VNode, name: string): void;
|
|
13
|
+
onNodeConnected(node: VNode, parent: VNode | undefined): void;
|
|
14
|
+
onNodeDisconnected(node: VNode, parent: VNode | undefined): void;
|
|
15
|
+
onTextChanged(node: VNode): void;
|
|
16
|
+
get mutations(): MutationLog;
|
|
17
|
+
naturalRendering(): BrowserFullSnapshotRecord['type'] | BrowserIncrementalSnapshotRecord['type'];
|
|
18
|
+
render(options?: Partial<V1RenderOptions>): BrowserFullSnapshotRecord | BrowserIncrementalSnapshotRecord;
|
|
19
|
+
renderAsFullSnapshot(options?: Partial<V1RenderOptions>): BrowserFullSnapshotRecord;
|
|
20
|
+
renderAsIncrementalSnapshot(options?: Partial<V1RenderOptions>): BrowserIncrementalSnapshotRecord;
|
|
21
|
+
root: VNode | undefined;
|
|
22
|
+
}
|
|
23
|
+
export declare function createVDocument(): VDocument;
|