@kubesense/kubesense-browser-rum-core 1.8.0 → 2.0.0-beta.1
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 +1 -1
- package/cjs/boot/preStartRum.d.ts +4 -3
- package/cjs/boot/preStartRum.js +229 -204
- package/cjs/boot/preStartRum.js.map +1 -1
- package/cjs/boot/rumPublicApi.d.ts +190 -51
- package/cjs/boot/rumPublicApi.js +267 -164
- package/cjs/boot/rumPublicApi.js.map +1 -1
- package/cjs/boot/startRum.d.ts +42 -31
- package/cjs/boot/startRum.js +157 -150
- package/cjs/boot/startRum.js.map +1 -1
- package/cjs/browser/cookieObservable.d.ts +1 -5
- package/cjs/browser/cookieObservable.js +30 -34
- package/cjs/browser/cookieObservable.js.map +1 -1
- package/cjs/browser/domMutationObservable.d.ts +3 -3
- package/cjs/browser/domMutationObservable.js +29 -53
- package/cjs/browser/domMutationObservable.js.map +1 -1
- package/cjs/browser/htmlDomUtils.d.ts +5 -0
- package/cjs/browser/htmlDomUtils.js +38 -28
- package/cjs/browser/htmlDomUtils.js.map +1 -1
- package/cjs/browser/locationChangeObservable.d.ts +1 -2
- package/cjs/browser/locationChangeObservable.js +44 -45
- package/cjs/browser/locationChangeObservable.js.map +1 -1
- package/cjs/browser/performanceObservable.d.ts +4 -4
- package/cjs/browser/performanceObservable.js +50 -114
- package/cjs/browser/performanceObservable.js.map +1 -1
- package/cjs/browser/performanceUtils.d.ts +13 -1
- package/cjs/browser/performanceUtils.js +63 -37
- package/cjs/browser/performanceUtils.js.map +1 -1
- package/cjs/browser/scroll.js +17 -28
- package/cjs/browser/scroll.js.map +1 -1
- package/cjs/browser/viewportObservable.d.ts +2 -3
- package/cjs/browser/viewportObservable.js +29 -31
- package/cjs/browser/viewportObservable.js.map +1 -1
- package/cjs/browser/windowOpenObservable.js +11 -7
- package/cjs/browser/windowOpenObservable.js.map +1 -1
- package/cjs/domain/action/actionCollection.d.ts +11 -12
- package/cjs/domain/action/actionCollection.js +82 -89
- package/cjs/domain/action/actionCollection.js.map +1 -1
- package/cjs/domain/action/actionNameConstants.js +10 -9
- package/cjs/domain/action/actionNameConstants.js.map +1 -1
- package/cjs/domain/action/clickChain.js +51 -54
- package/cjs/domain/action/clickChain.js.map +1 -1
- package/cjs/domain/action/computeFrustration.js +30 -62
- package/cjs/domain/action/computeFrustration.js.map +1 -1
- package/cjs/domain/action/frustrationIgnore.d.ts +9 -0
- package/cjs/domain/action/frustrationIgnore.js +32 -0
- package/cjs/domain/action/frustrationIgnore.js.map +1 -0
- package/cjs/domain/action/getActionNameFromElement.js +141 -217
- package/cjs/domain/action/getActionNameFromElement.js.map +1 -1
- package/cjs/domain/action/interactionSelectorCache.d.ts +1 -1
- package/cjs/domain/action/interactionSelectorCache.js +17 -18
- package/cjs/domain/action/interactionSelectorCache.js.map +1 -1
- package/cjs/domain/action/isActionChildEvent.d.ts +2 -0
- package/cjs/domain/action/isActionChildEvent.js +8 -0
- package/cjs/domain/action/isActionChildEvent.js.map +1 -0
- package/cjs/domain/action/listenActionEvents.d.ts +2 -3
- package/cjs/domain/action/listenActionEvents.js +51 -55
- package/cjs/domain/action/listenActionEvents.js.map +1 -1
- package/cjs/domain/action/trackClickActions.d.ts +15 -21
- package/cjs/domain/action/trackClickActions.js +188 -226
- package/cjs/domain/action/trackClickActions.js.map +1 -1
- package/cjs/domain/action/trackManualActions.d.ts +45 -0
- package/cjs/domain/action/trackManualActions.js +48 -0
- package/cjs/domain/action/trackManualActions.js.map +1 -0
- package/cjs/domain/assembly.d.ts +1 -2
- package/cjs/domain/assembly.js +80 -95
- package/cjs/domain/assembly.js.map +1 -1
- package/cjs/domain/configuration/configuration.d.ts +575 -81
- package/cjs/domain/configuration/configuration.js +464 -199
- package/cjs/domain/configuration/configuration.js.map +1 -1
- package/cjs/domain/configuration/index.d.ts +1 -0
- package/cjs/domain/configuration/index.js +27 -21
- package/cjs/domain/configuration/jsonPathParser.js +125 -139
- package/cjs/domain/configuration/jsonPathParser.js.map +1 -1
- package/cjs/domain/configuration/remoteConfiguration.d.ts +18 -5
- package/cjs/domain/configuration/remoteConfiguration.js +268 -226
- package/cjs/domain/configuration/remoteConfiguration.js.map +1 -1
- package/cjs/domain/configuration/remoteConfiguration.types.d.ts +49 -0
- package/cjs/domain/configuration/remoteConfigurationCache.d.ts +42 -0
- package/cjs/domain/configuration/remoteConfigurationCache.js +95 -0
- package/cjs/domain/configuration/remoteConfigurationCache.js.map +1 -0
- package/cjs/domain/configuration/remoteSdkConfiguration.d.ts +11 -2
- package/cjs/domain/configuration/remoteSdkConfiguration.js +185 -117
- package/cjs/domain/configuration/remoteSdkConfiguration.js.map +1 -1
- package/cjs/domain/configuration/sessionReplayRoutes.d.ts +1 -6
- package/cjs/domain/configuration/sessionReplayRoutes.js +20 -63
- package/cjs/domain/configuration/sessionReplayRoutes.js.map +1 -1
- package/cjs/domain/contexts/ciVisibilityContext.d.ts +2 -4
- package/cjs/domain/contexts/ciVisibilityContext.js +36 -32
- package/cjs/domain/contexts/ciVisibilityContext.js.map +1 -1
- package/cjs/domain/contexts/connectivityContext.d.ts +2 -2
- package/cjs/domain/contexts/connectivityContext.js +10 -9
- package/cjs/domain/contexts/connectivityContext.js.map +1 -1
- package/cjs/domain/contexts/defaultContext.d.ts +3 -3
- package/cjs/domain/contexts/defaultContext.js +28 -32
- package/cjs/domain/contexts/defaultContext.js.map +1 -1
- package/cjs/domain/contexts/displayContext.d.ts +2 -3
- package/cjs/domain/contexts/displayContext.js +22 -26
- package/cjs/domain/contexts/displayContext.js.map +1 -1
- package/cjs/domain/contexts/featureFlagContext.d.ts +2 -2
- package/cjs/domain/contexts/featureFlagContext.js +38 -50
- package/cjs/domain/contexts/featureFlagContext.js.map +1 -1
- package/cjs/domain/contexts/internalContext.d.ts +2 -3
- package/cjs/domain/contexts/internalContext.js +26 -22
- package/cjs/domain/contexts/internalContext.js.map +1 -1
- package/cjs/domain/contexts/pageStateHistory.d.ts +3 -4
- package/cjs/domain/contexts/pageStateHistory.js +76 -96
- package/cjs/domain/contexts/pageStateHistory.js.map +1 -1
- package/cjs/domain/contexts/sessionContext.d.ts +9 -3
- package/cjs/domain/contexts/sessionContext.js +31 -45
- package/cjs/domain/contexts/sessionContext.js.map +1 -1
- package/cjs/domain/contexts/sourceCodeMfeContext.d.ts +10 -0
- package/cjs/domain/contexts/sourceCodeMfeContext.js +35 -0
- package/cjs/domain/contexts/sourceCodeMfeContext.js.map +1 -0
- package/cjs/domain/contexts/syntheticsContext.d.ts +2 -2
- package/cjs/domain/contexts/syntheticsContext.js +19 -23
- package/cjs/domain/contexts/syntheticsContext.js.map +1 -1
- package/cjs/domain/contexts/trackingConsentContext.d.ts +2 -2
- package/cjs/domain/contexts/trackingConsentContext.js +10 -12
- package/cjs/domain/contexts/trackingConsentContext.js.map +1 -1
- package/cjs/domain/contexts/urlContexts.d.ts +4 -3
- package/cjs/domain/contexts/urlContexts.js +65 -61
- package/cjs/domain/contexts/urlContexts.js.map +1 -1
- package/cjs/domain/contexts/userAgentDataContext.d.ts +2 -2
- package/cjs/domain/contexts/userAgentDataContext.js +20 -29
- package/cjs/domain/contexts/userAgentDataContext.js.map +1 -1
- package/cjs/domain/contexts/viewHistory.d.ts +5 -2
- package/cjs/domain/contexts/viewHistory.js +41 -45
- package/cjs/domain/contexts/viewHistory.js.map +1 -1
- package/cjs/domain/discardNegativeDuration.d.ts +1 -1
- package/cjs/domain/discardNegativeDuration.js +6 -5
- package/cjs/domain/discardNegativeDuration.js.map +1 -1
- package/cjs/domain/error/errorCollection.d.ts +3 -3
- package/cjs/domain/error/errorCollection.js +67 -68
- package/cjs/domain/error/errorCollection.js.map +1 -1
- package/cjs/domain/error/trackReportError.d.ts +1 -2
- package/cjs/domain/error/trackReportError.js +10 -14
- package/cjs/domain/error/trackReportError.js.map +1 -1
- package/cjs/domain/event/eventCollection.d.ts +2 -1
- package/cjs/domain/event/eventCollection.js +21 -22
- package/cjs/domain/event/eventCollection.js.map +1 -1
- package/cjs/domain/eventTracker.d.ts +37 -0
- package/cjs/domain/eventTracker.js +94 -0
- package/cjs/domain/eventTracker.js.map +1 -0
- package/cjs/domain/extractRegexMatch.d.ts +5 -0
- package/cjs/domain/extractRegexMatch.js +16 -0
- package/cjs/domain/extractRegexMatch.js.map +1 -0
- package/cjs/domain/getComposedPathSelector.d.ts +22 -0
- package/cjs/domain/getComposedPathSelector.js +95 -0
- package/cjs/domain/getComposedPathSelector.js.map +1 -0
- package/cjs/domain/getSelectorFromElement.d.ts +18 -6
- package/cjs/domain/getSelectorFromElement.js +199 -191
- package/cjs/domain/getSelectorFromElement.js.map +1 -1
- package/cjs/domain/getSessionReplayUrl.d.ts +2 -2
- package/cjs/domain/getSessionReplayUrl.js +17 -30
- package/cjs/domain/getSessionReplayUrl.js.map +1 -1
- package/cjs/domain/hooks.d.ts +26 -17
- package/cjs/domain/hooks.js +12 -5
- package/cjs/domain/hooks.js.map +1 -1
- package/cjs/domain/lifeCycle.d.ts +26 -12
- package/cjs/domain/lifeCycle.js +28 -5
- package/cjs/domain/lifeCycle.js.map +1 -1
- package/cjs/domain/limitModification.d.ts +5 -1
- package/cjs/domain/limitModification.js +32 -36
- package/cjs/domain/limitModification.js.map +1 -1
- package/cjs/domain/longTask/longTaskCollection.d.ts +0 -13
- package/cjs/domain/longTask/longTaskCollection.js +75 -87
- package/cjs/domain/longTask/longTaskCollection.js.map +1 -1
- package/cjs/domain/plugins.d.ts +37 -14
- package/cjs/domain/plugins.js +22 -13
- package/cjs/domain/plugins.js.map +1 -1
- package/cjs/domain/privacy.d.ts +6 -1
- package/cjs/domain/privacy.js +143 -286
- package/cjs/domain/privacy.js.map +1 -1
- package/cjs/domain/privacyConstants.js +43 -34
- package/cjs/domain/privacyConstants.js.map +1 -1
- package/cjs/domain/requestCollection.d.ts +6 -5
- package/cjs/domain/requestCollection.js +82 -105
- package/cjs/domain/requestCollection.js.map +1 -1
- package/cjs/domain/resource/graphql.d.ts +1 -1
- package/cjs/domain/resource/graphql.js +85 -86
- package/cjs/domain/resource/graphql.js.map +1 -1
- package/cjs/domain/resource/requestRegistry.js +30 -38
- package/cjs/domain/resource/requestRegistry.js.map +1 -1
- package/cjs/domain/resource/resourceCollection.d.ts +5 -3
- package/cjs/domain/resource/resourceCollection.js +241 -175
- package/cjs/domain/resource/resourceCollection.js.map +1 -1
- package/cjs/domain/resource/resourceUtils.d.ts +13 -13
- package/cjs/domain/resource/resourceUtils.js +323 -221
- package/cjs/domain/resource/resourceUtils.js.map +1 -1
- package/cjs/domain/resource/trackManualResources.d.ts +55 -0
- package/cjs/domain/resource/trackManualResources.js +53 -0
- package/cjs/domain/resource/trackManualResources.js.map +1 -0
- package/cjs/domain/resource/webSocketCollection.d.ts +46 -0
- package/cjs/domain/resource/webSocketCollection.js +163 -0
- package/cjs/domain/resource/webSocketCollection.js.map +1 -0
- package/cjs/domain/session/session.types.d.ts +4 -0
- package/cjs/domain/sessionReplayState.d.ts +8 -0
- package/cjs/domain/sessionReplayState.js +19 -0
- package/cjs/domain/sessionReplayState.js.map +1 -0
- package/cjs/domain/startCustomerDataTelemetry.js +39 -43
- package/cjs/domain/startCustomerDataTelemetry.js.map +1 -1
- package/cjs/domain/tracing/getDocumentTraceId.d.ts +1 -1
- package/cjs/domain/tracing/getDocumentTraceId.js +42 -63
- package/cjs/domain/tracing/getDocumentTraceId.js.map +1 -1
- package/cjs/domain/tracing/identifier.js +13 -46
- package/cjs/domain/tracing/identifier.js.map +1 -1
- package/cjs/domain/tracing/tracer.d.ts +2 -5
- package/cjs/domain/tracing/tracer.js +110 -150
- package/cjs/domain/tracing/tracer.js.map +1 -1
- package/cjs/domain/trackEventCounts.js +43 -48
- package/cjs/domain/trackEventCounts.js.map +1 -1
- package/cjs/domain/view/bfCacheSupport.d.ts +1 -2
- package/cjs/domain/view/bfCacheSupport.js +10 -11
- package/cjs/domain/view/bfCacheSupport.js.map +1 -1
- package/cjs/domain/view/trackViewEventCounts.js +14 -13
- package/cjs/domain/view/trackViewEventCounts.js.map +1 -1
- package/cjs/domain/view/trackViews.d.ts +8 -2
- package/cjs/domain/view/trackViews.js +221 -270
- package/cjs/domain/view/trackViews.js.map +1 -1
- package/cjs/domain/view/viewCollection.d.ts +4 -3
- package/cjs/domain/view/viewCollection.js +124 -148
- package/cjs/domain/view/viewCollection.js.map +1 -1
- package/cjs/domain/view/viewDiff.d.ts +22 -0
- package/cjs/domain/view/viewDiff.js +62 -0
- package/cjs/domain/view/viewDiff.js.map +1 -0
- package/cjs/domain/view/viewMetrics/getClsAttributionImpactedArea.js +20 -22
- package/cjs/domain/view/viewMetrics/getClsAttributionImpactedArea.js.map +1 -1
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.d.ts +1 -0
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.js +35 -33
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.d.ts +1 -1
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.js +14 -13
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.d.ts +4 -2
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.js +51 -34
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.d.ts +1 -1
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.js +106 -122
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.d.ts +2 -3
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.js +26 -34
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackFirstHidden.d.ts +2 -3
- package/cjs/domain/view/viewMetrics/trackFirstHidden.js +31 -31
- package/cjs/domain/view/viewMetrics/trackFirstHidden.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.d.ts +1 -3
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.js +33 -38
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.d.ts +10 -1
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.js +202 -144
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.d.ts +6 -1
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.js +65 -55
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackLoadingTime.d.ts +2 -1
- package/cjs/domain/view/viewMetrics/trackLoadingTime.js +42 -46
- package/cjs/domain/view/viewMetrics/trackLoadingTime.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.d.ts +2 -3
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.js +28 -36
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.d.ts +3 -4
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.js +63 -72
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.js.map +1 -1
- package/cjs/domain/vital/vitalCollection.d.ts +44 -20
- package/cjs/domain/vital/vitalCollection.js +81 -109
- package/cjs/domain/vital/vitalCollection.js.map +1 -1
- package/cjs/domain/waitPageActivityEnd.d.ts +1 -4
- package/cjs/domain/waitPageActivityEnd.js +99 -119
- package/cjs/domain/waitPageActivityEnd.js.map +1 -1
- package/cjs/domainContext.types.d.ts +21 -13
- package/cjs/index.d.ts +11 -10
- package/cjs/index.js +84 -62
- package/cjs/rawRumEvent.types.d.ts +79 -13
- package/cjs/rawRumEvent.types.js +40 -27
- package/cjs/rawRumEvent.types.js.map +1 -1
- package/cjs/rumEvent.types.d.ts +906 -669
- package/cjs/transport/formDataTransport.js +43 -41
- package/cjs/transport/formDataTransport.js.map +1 -1
- package/cjs/transport/startRumBatch.d.ts +27 -3
- package/cjs/transport/startRumBatch.js +132 -31
- package/cjs/transport/startRumBatch.js.map +1 -1
- package/cjs/transport/startRumEventBridge.js +10 -8
- package/cjs/transport/startRumEventBridge.js.map +1 -1
- package/esm/boot/preStartRum.mjs +233 -0
- package/esm/boot/preStartRum.mjs.map +1 -0
- package/esm/boot/rumPublicApi.mjs +271 -0
- package/esm/boot/rumPublicApi.mjs.map +1 -0
- package/esm/boot/startRum.mjs +159 -0
- package/esm/boot/startRum.mjs.map +1 -0
- package/esm/browser/cookieObservable.mjs +34 -0
- package/esm/browser/cookieObservable.mjs.map +1 -0
- package/esm/browser/domMutationObservable.mjs +33 -0
- package/esm/browser/domMutationObservable.mjs.map +1 -0
- package/esm/browser/htmlDomUtils.mjs +48 -0
- package/esm/browser/htmlDomUtils.mjs.map +1 -0
- package/esm/browser/locationChangeObservable.mjs +50 -0
- package/esm/browser/locationChangeObservable.mjs.map +1 -0
- package/esm/browser/performanceObservable.mjs +60 -0
- package/esm/browser/performanceObservable.mjs.map +1 -0
- package/esm/browser/performanceUtils.mjs +64 -0
- package/esm/browser/performanceUtils.mjs.map +1 -0
- package/esm/browser/scroll.mjs +21 -0
- package/esm/browser/scroll.mjs.map +1 -0
- package/esm/browser/viewportObservable.mjs +33 -0
- package/esm/browser/viewportObservable.mjs.map +1 -0
- package/esm/browser/windowOpenObservable.mjs +14 -0
- package/esm/browser/windowOpenObservable.mjs.map +1 -0
- package/esm/domain/action/actionCollection.mjs +89 -0
- package/esm/domain/action/actionCollection.mjs.map +1 -0
- package/esm/domain/action/actionNameConstants.mjs +11 -0
- package/esm/domain/action/actionNameConstants.mjs.map +1 -0
- package/esm/domain/action/clickChain.mjs +57 -0
- package/esm/domain/action/clickChain.mjs.map +1 -0
- package/esm/domain/action/computeFrustration.mjs +36 -0
- package/esm/domain/action/computeFrustration.mjs.map +1 -0
- package/esm/domain/action/frustrationIgnore.mjs +31 -0
- package/esm/domain/action/frustrationIgnore.mjs.map +1 -0
- package/esm/domain/action/getActionNameFromElement.mjs +163 -0
- package/esm/domain/action/getActionNameFromElement.mjs.map +1 -0
- package/esm/domain/action/interactionSelectorCache.mjs +19 -0
- package/esm/domain/action/interactionSelectorCache.mjs.map +1 -0
- package/esm/domain/action/isActionChildEvent.mjs +8 -0
- package/esm/domain/action/isActionChildEvent.mjs.map +1 -0
- package/esm/domain/action/listenActionEvents.mjs +57 -0
- package/esm/domain/action/listenActionEvents.mjs.map +1 -0
- package/esm/domain/action/trackClickActions.mjs +198 -0
- package/esm/domain/action/trackClickActions.mjs.map +1 -0
- package/esm/domain/action/trackManualActions.mjs +48 -0
- package/esm/domain/action/trackManualActions.mjs.map +1 -0
- package/esm/domain/assembly.mjs +87 -0
- package/esm/domain/assembly.mjs.map +1 -0
- package/esm/domain/configuration/configuration.mjs +474 -0
- package/esm/domain/configuration/configuration.mjs.map +1 -0
- package/esm/domain/configuration/index.mjs +6 -0
- package/esm/domain/configuration/jsonPathParser.mjs +145 -0
- package/esm/domain/configuration/jsonPathParser.mjs.map +1 -0
- package/esm/domain/configuration/remoteConfiguration.mjs +279 -0
- package/esm/domain/configuration/remoteConfiguration.mjs.map +1 -0
- package/esm/domain/configuration/remoteConfigurationCache.mjs +92 -0
- package/esm/domain/configuration/remoteConfigurationCache.mjs.map +1 -0
- package/esm/domain/configuration/remoteSdkConfiguration.mjs +208 -0
- package/esm/domain/configuration/remoteSdkConfiguration.mjs.map +1 -0
- package/esm/domain/configuration/sessionReplayRoutes.mjs +26 -0
- package/esm/domain/configuration/sessionReplayRoutes.mjs.map +1 -0
- package/esm/domain/contexts/ciVisibilityContext.mjs +37 -0
- package/esm/domain/contexts/ciVisibilityContext.mjs.map +1 -0
- package/esm/domain/contexts/connectivityContext.mjs +12 -0
- package/esm/domain/contexts/connectivityContext.mjs.map +1 -0
- package/esm/domain/contexts/defaultContext.mjs +30 -0
- package/esm/domain/contexts/defaultContext.mjs.map +1 -0
- package/esm/domain/contexts/displayContext.mjs +24 -0
- package/esm/domain/contexts/displayContext.mjs.map +1 -0
- package/esm/domain/contexts/featureFlagContext.mjs +40 -0
- package/esm/domain/contexts/featureFlagContext.mjs.map +1 -0
- package/esm/domain/contexts/internalContext.mjs +30 -0
- package/esm/domain/contexts/internalContext.mjs.map +1 -0
- package/esm/domain/contexts/pageStateHistory.mjs +82 -0
- package/esm/domain/contexts/pageStateHistory.mjs.map +1 -0
- package/esm/domain/contexts/sessionContext.mjs +33 -0
- package/esm/domain/contexts/sessionContext.mjs.map +1 -0
- package/esm/domain/contexts/sourceCodeMfeContext.mjs +35 -0
- package/esm/domain/contexts/sourceCodeMfeContext.mjs.map +1 -0
- package/esm/domain/contexts/syntheticsContext.mjs +21 -0
- package/esm/domain/contexts/syntheticsContext.mjs.map +1 -0
- package/esm/domain/contexts/trackingConsentContext.mjs +12 -0
- package/esm/domain/contexts/trackingConsentContext.mjs.map +1 -0
- package/esm/domain/contexts/urlContexts.mjs +67 -0
- package/esm/domain/contexts/urlContexts.mjs.map +1 -0
- package/esm/domain/contexts/userAgentDataContext.mjs +22 -0
- package/esm/domain/contexts/userAgentDataContext.mjs.map +1 -0
- package/esm/domain/contexts/viewHistory.mjs +43 -0
- package/esm/domain/contexts/viewHistory.mjs.map +1 -0
- package/esm/domain/discardNegativeDuration.mjs +9 -0
- package/esm/domain/discardNegativeDuration.mjs.map +1 -0
- package/esm/domain/error/errorCollection.mjs +72 -0
- package/esm/domain/error/errorCollection.mjs.map +1 -0
- package/esm/domain/error/trackReportError.mjs +12 -0
- package/esm/domain/error/trackReportError.mjs.map +1 -0
- package/esm/domain/event/eventCollection.mjs +26 -0
- package/esm/domain/event/eventCollection.mjs.map +1 -0
- package/esm/domain/eventTracker.mjs +93 -0
- package/esm/domain/eventTracker.mjs.map +1 -0
- package/esm/domain/extractRegexMatch.mjs +16 -0
- package/esm/domain/extractRegexMatch.mjs.map +1 -0
- package/esm/domain/getComposedPathSelector.mjs +93 -0
- package/esm/domain/getComposedPathSelector.mjs.map +1 -0
- package/esm/domain/getSelectorFromElement.mjs +218 -0
- package/esm/domain/getSelectorFromElement.mjs.map +1 -0
- package/esm/domain/getSessionReplayUrl.mjs +20 -0
- package/esm/domain/getSessionReplayUrl.mjs.map +1 -0
- package/esm/domain/hooks.mjs +13 -0
- package/esm/domain/hooks.mjs.map +1 -0
- package/esm/domain/lifeCycle.mjs +28 -0
- package/esm/domain/lifeCycle.mjs.map +1 -0
- package/esm/domain/limitModification.mjs +42 -0
- package/esm/domain/limitModification.mjs.map +1 -0
- package/esm/domain/longTask/longTaskCollection.mjs +79 -0
- package/esm/domain/longTask/longTaskCollection.mjs.map +1 -0
- package/esm/domain/plugins.mjs +23 -0
- package/esm/domain/plugins.mjs.map +1 -0
- package/esm/domain/privacy.mjs +161 -0
- package/esm/domain/privacy.mjs.map +1 -0
- package/esm/domain/privacyConstants.mjs +36 -0
- package/esm/domain/privacyConstants.mjs.map +1 -0
- package/esm/domain/requestCollection.mjs +86 -0
- package/esm/domain/requestCollection.mjs.map +1 -0
- package/esm/domain/resource/graphql.mjs +93 -0
- package/esm/domain/resource/graphql.mjs.map +1 -0
- package/esm/domain/resource/requestRegistry.mjs +32 -0
- package/esm/domain/resource/requestRegistry.mjs.map +1 -0
- package/esm/domain/resource/resourceCollection.mjs +256 -0
- package/esm/domain/resource/resourceCollection.mjs.map +1 -0
- package/esm/domain/resource/resourceUtils.mjs +349 -0
- package/esm/domain/resource/resourceUtils.mjs.map +1 -0
- package/esm/domain/resource/trackManualResources.mjs +53 -0
- package/esm/domain/resource/trackManualResources.mjs.map +1 -0
- package/esm/domain/resource/webSocketCollection.mjs +160 -0
- package/esm/domain/resource/webSocketCollection.mjs.map +1 -0
- package/esm/domain/sessionReplayState.mjs +18 -0
- package/esm/domain/sessionReplayState.mjs.map +1 -0
- package/esm/domain/startCustomerDataTelemetry.mjs +51 -0
- package/esm/domain/startCustomerDataTelemetry.mjs.map +1 -0
- package/esm/domain/tracing/getDocumentTraceId.mjs +50 -0
- package/esm/domain/tracing/getDocumentTraceId.mjs.map +1 -0
- package/esm/domain/tracing/identifier.mjs +20 -0
- package/esm/domain/tracing/identifier.mjs.map +1 -0
- package/esm/domain/tracing/tracer.mjs +120 -0
- package/esm/domain/tracing/tracer.mjs.map +1 -0
- package/esm/domain/trackEventCounts.mjs +45 -0
- package/esm/domain/trackEventCounts.mjs.map +1 -0
- package/esm/domain/view/bfCacheSupport.mjs +12 -0
- package/esm/domain/view/bfCacheSupport.mjs.map +1 -0
- package/esm/domain/view/trackViewEventCounts.mjs +17 -0
- package/esm/domain/view/trackViewEventCounts.mjs.map +1 -0
- package/esm/domain/view/trackViews.mjs +230 -0
- package/esm/domain/view/trackViews.mjs.map +1 -0
- package/esm/domain/view/viewCollection.mjs +129 -0
- package/esm/domain/view/viewCollection.mjs.map +1 -0
- package/esm/domain/view/viewDiff.mjs +61 -0
- package/esm/domain/view/viewDiff.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.mjs +30 -0
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.mjs +45 -0
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.mjs +18 -0
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.mjs +54 -0
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.mjs +117 -0
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.mjs +29 -0
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackFirstHidden.mjs +33 -0
- package/esm/domain/view/viewMetrics/trackFirstHidden.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.mjs +36 -0
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.mjs +210 -0
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.mjs +70 -0
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackLoadingTime.mjs +46 -0
- package/esm/domain/view/viewMetrics/trackLoadingTime.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackNavigationTimings.mjs +35 -0
- package/esm/domain/view/viewMetrics/trackNavigationTimings.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackScrollMetrics.mjs +66 -0
- package/esm/domain/view/viewMetrics/trackScrollMetrics.mjs.map +1 -0
- package/esm/domain/vital/vitalCollection.mjs +85 -0
- package/esm/domain/vital/vitalCollection.mjs.map +1 -0
- package/esm/domain/waitPageActivityEnd.mjs +107 -0
- package/esm/domain/waitPageActivityEnd.mjs.map +1 -0
- package/esm/index.mjs +23 -0
- package/esm/rawRumEvent.types.mjs +42 -0
- package/esm/rawRumEvent.types.mjs.map +1 -0
- package/esm/transport/formDataTransport.mjs +48 -0
- package/esm/transport/formDataTransport.mjs.map +1 -0
- package/esm/transport/startRumBatch.mjs +132 -0
- package/esm/transport/startRumBatch.mjs.map +1 -0
- package/esm/transport/startRumEventBridge.mjs +13 -0
- package/esm/transport/startRumEventBridge.mjs.map +1 -0
- package/package.json +19 -11
- package/src/boot/preStartRum.ts +216 -88
- package/src/boot/rumPublicApi.ts +358 -119
- package/src/boot/startRum.ts +88 -84
- package/src/browser/cookieObservable.ts +19 -28
- package/src/browser/domMutationObservable.ts +7 -12
- package/src/browser/htmlDomUtils.ts +15 -0
- package/src/browser/locationChangeObservable.ts +23 -12
- package/src/browser/performanceObservable.ts +23 -73
- package/src/browser/performanceUtils.ts +52 -4
- package/src/browser/viewportObservable.ts +4 -6
- package/src/domain/action/actionCollection.ts +94 -87
- package/src/domain/action/clickChain.ts +11 -10
- package/src/domain/action/computeFrustration.ts +19 -5
- package/src/domain/action/frustrationIgnore.ts +54 -0
- package/src/domain/action/getActionNameFromElement.ts +27 -61
- package/src/domain/action/interactionSelectorCache.ts +2 -2
- package/src/domain/action/isActionChildEvent.ts +6 -0
- package/src/domain/action/listenActionEvents.ts +2 -11
- package/src/domain/action/trackClickActions.ts +92 -82
- package/src/domain/action/trackManualActions.ts +104 -0
- package/src/domain/assembly.ts +57 -70
- package/src/domain/configuration/configuration.ts +587 -208
- package/src/domain/configuration/index.ts +1 -0
- package/src/domain/configuration/remoteConfiguration.ts +152 -29
- package/src/domain/configuration/remoteConfiguration.types.ts +51 -1
- package/src/domain/configuration/remoteConfigurationCache.ts +153 -0
- package/src/domain/configuration/remoteSdkConfiguration.ts +131 -13
- package/src/domain/configuration/sessionReplayRoutes.ts +2 -47
- package/src/domain/contexts/ciVisibilityContext.ts +23 -12
- package/src/domain/contexts/connectivityContext.ts +7 -10
- package/src/domain/contexts/defaultContext.ts +11 -14
- package/src/domain/contexts/displayContext.ts +8 -12
- package/src/domain/contexts/featureFlagContext.ts +5 -4
- package/src/domain/contexts/internalContext.ts +3 -3
- package/src/domain/contexts/pageStateHistory.ts +20 -31
- package/src/domain/contexts/sessionContext.ts +16 -22
- package/src/domain/contexts/sourceCodeMfeContext.ts +53 -0
- package/src/domain/contexts/syntheticsContext.ts +7 -17
- package/src/domain/contexts/trackingConsentContext.ts +7 -4
- package/src/domain/contexts/urlContexts.ts +13 -9
- package/src/domain/contexts/userAgentDataContext.ts +12 -13
- package/src/domain/contexts/viewHistory.ts +4 -3
- package/src/domain/discardNegativeDuration.ts +1 -1
- package/src/domain/error/errorCollection.ts +12 -22
- package/src/domain/error/trackReportError.ts +4 -7
- package/src/domain/event/eventCollection.ts +4 -2
- package/src/domain/eventTracker.ts +169 -0
- package/src/domain/extractRegexMatch.ts +15 -0
- package/src/domain/getComposedPathSelector.ts +130 -0
- package/src/domain/getSelectorFromElement.ts +125 -31
- package/src/domain/getSessionReplayUrl.ts +4 -13
- package/src/domain/hooks.ts +34 -21
- package/src/domain/lifeCycle.ts +21 -8
- package/src/domain/limitModification.ts +20 -4
- package/src/domain/longTask/longTaskCollection.ts +18 -47
- package/src/domain/plugins.ts +54 -25
- package/src/domain/privacy.ts +16 -24
- package/src/domain/requestCollection.ts +108 -97
- package/src/domain/resource/graphql.ts +71 -25
- package/src/domain/resource/requestRegistry.ts +1 -3
- package/src/domain/resource/resourceCollection.ts +319 -137
- package/src/domain/resource/resourceUtils.ts +24 -26
- package/src/domain/resource/trackManualResources.ts +121 -0
- package/src/domain/resource/webSocketCollection.ts +281 -0
- package/src/domain/session/session.types.ts +5 -0
- package/src/domain/sessionReplayState.ts +36 -0
- package/src/domain/startCustomerDataTelemetry.ts +2 -2
- package/src/domain/tracing/getDocumentTraceId.ts +5 -4
- package/src/domain/tracing/identifier.ts +6 -37
- package/src/domain/tracing/tracer.ts +22 -21
- package/src/domain/tracing/tracer.types.ts +3 -3
- package/src/domain/view/bfCacheSupport.ts +1 -6
- package/src/domain/view/trackViews.ts +40 -37
- package/src/domain/view/viewCollection.ts +29 -23
- package/src/domain/view/viewDiff.ts +115 -0
- package/src/domain/view/viewMetrics/interactionCountPolyfill.ts +13 -2
- package/src/domain/view/viewMetrics/trackBfcacheMetrics.ts +1 -1
- package/src/domain/view/viewMetrics/trackCommonViewMetrics.ts +27 -6
- package/src/domain/view/viewMetrics/trackCumulativeLayoutShift.ts +5 -3
- package/src/domain/view/viewMetrics/trackFirstContentfulPaint.ts +4 -9
- package/src/domain/view/viewMetrics/trackFirstHidden.ts +2 -8
- package/src/domain/view/viewMetrics/trackInitialViewMetrics.ts +4 -13
- package/src/domain/view/viewMetrics/trackInteractionToNextPaint.ts +180 -35
- package/src/domain/view/viewMetrics/trackLargestContentfulPaint.ts +47 -6
- package/src/domain/view/viewMetrics/trackLoadingTime.ts +4 -3
- package/src/domain/view/viewMetrics/trackNavigationTimings.ts +10 -18
- package/src/domain/view/viewMetrics/trackScrollMetrics.ts +23 -37
- package/src/domain/vital/vitalCollection.ts +83 -102
- package/src/domain/waitPageActivityEnd.ts +7 -11
- package/src/domainContext.types.ts +23 -15
- package/src/index.ts +17 -11
- package/src/rawRumEvent.types.ts +80 -26
- package/src/rumEvent.types.ts +730 -505
- package/src/transport/formDataTransport.ts +16 -6
- package/src/transport/startRumBatch.ts +181 -24
- package/cjs/browser/firstInputPolyfill.d.ts +0 -8
- package/cjs/browser/firstInputPolyfill.js +0 -68
- package/cjs/browser/firstInputPolyfill.js.map +0 -1
- package/cjs/domain/configuration/index.js.map +0 -1
- package/cjs/domain/configuration/remoteConfiguration.types.js +0 -7
- package/cjs/domain/configuration/remoteConfiguration.types.js.map +0 -1
- package/cjs/domain/error/trackConsoleError.d.ts +0 -4
- package/cjs/domain/error/trackConsoleError.js +0 -13
- package/cjs/domain/error/trackConsoleError.js.map +0 -1
- package/cjs/domain/resource/matchRequestResourceEntry.d.ts +0 -16
- package/cjs/domain/resource/matchRequestResourceEntry.js +0 -49
- package/cjs/domain/resource/matchRequestResourceEntry.js.map +0 -1
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.d.ts +0 -4
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.js +0 -24
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.js.map +0 -1
- package/cjs/domain/rumSessionManager.d.ts +0 -36
- package/cjs/domain/rumSessionManager.js +0 -77
- package/cjs/domain/rumSessionManager.js.map +0 -1
- package/cjs/domain/sampler/sampler.d.ts +0 -10
- package/cjs/domain/sampler/sampler.js +0 -63
- package/cjs/domain/sampler/sampler.js.map +0 -1
- package/cjs/domain/tracing/sampler.d.ts +0 -10
- package/cjs/domain/tracing/sampler.js +0 -69
- package/cjs/domain/tracing/sampler.js.map +0 -1
- package/cjs/domain/tracing/tracer.types.js +0 -3
- package/cjs/domain/tracing/tracer.types.js.map +0 -1
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.d.ts +0 -6
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js +0 -44
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js.map +0 -1
- package/cjs/domain/view/viewMetrics/trackFirstInput.d.ts +0 -19
- package/cjs/domain/view/viewMetrics/trackFirstInput.js +0 -43
- package/cjs/domain/view/viewMetrics/trackFirstInput.js.map +0 -1
- package/cjs/domainContext.types.js +0 -6
- package/cjs/domainContext.types.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/rumEvent.types.js +0 -7
- package/cjs/rumEvent.types.js.map +0 -1
- package/esm/boot/preStartRum.d.ts +0 -7
- package/esm/boot/preStartRum.js +0 -205
- package/esm/boot/preStartRum.js.map +0 -1
- package/esm/boot/rumPublicApi.d.ts +0 -409
- package/esm/boot/rumPublicApi.js +0 -165
- package/esm/boot/rumPublicApi.js.map +0 -1
- package/esm/boot/startRum.d.ts +0 -109
- package/esm/boot/startRum.js +0 -149
- package/esm/boot/startRum.js.map +0 -1
- package/esm/browser/cookieObservable.d.ts +0 -8
- package/esm/browser/cookieObservable.js +0 -35
- package/esm/browser/cookieObservable.js.map +0 -1
- package/esm/browser/domMutationObservable.d.ts +0 -27
- package/esm/browser/domMutationObservable.js +0 -54
- package/esm/browser/domMutationObservable.js.map +0 -1
- package/esm/browser/firstInputPolyfill.d.ts +0 -8
- package/esm/browser/firstInputPolyfill.js +0 -65
- package/esm/browser/firstInputPolyfill.js.map +0 -1
- package/esm/browser/htmlDomUtils.d.ts +0 -13
- package/esm/browser/htmlDomUtils.js +0 -36
- package/esm/browser/htmlDomUtils.js.map +0 -1
- package/esm/browser/locationChangeObservable.d.ts +0 -7
- package/esm/browser/locationChangeObservable.js +0 -48
- package/esm/browser/locationChangeObservable.js.map +0 -1
- package/esm/browser/performanceObservable.d.ts +0 -174
- package/esm/browser/performanceObservable.js +0 -121
- package/esm/browser/performanceObservable.js.map +0 -1
- package/esm/browser/performanceUtils.d.ts +0 -7
- package/esm/browser/performanceUtils.js +0 -38
- package/esm/browser/performanceUtils.js.map +0 -1
- package/esm/browser/scroll.d.ts +0 -2
- package/esm/browser/scroll.js +0 -29
- package/esm/browser/scroll.js.map +0 -1
- package/esm/browser/viewportObservable.d.ts +0 -10
- package/esm/browser/viewportObservable.js +0 -32
- package/esm/browser/viewportObservable.js.map +0 -1
- package/esm/browser/windowOpenObservable.d.ts +0 -5
- package/esm/browser/windowOpenObservable.js +0 -7
- package/esm/browser/windowOpenObservable.js.map +0 -1
- package/esm/domain/action/actionCollection.d.ts +0 -21
- package/esm/domain/action/actionCollection.js +0 -93
- package/esm/domain/action/actionCollection.js.map +0 -1
- package/esm/domain/action/actionNameConstants.d.ts +0 -18
- package/esm/domain/action/actionNameConstants.js +0 -8
- package/esm/domain/action/actionNameConstants.js.map +0 -1
- package/esm/domain/action/clickChain.d.ts +0 -8
- package/esm/domain/action/clickChain.js +0 -57
- package/esm/domain/action/clickChain.js.map +0 -1
- package/esm/domain/action/computeFrustration.d.ts +0 -6
- package/esm/domain/action/computeFrustration.js +0 -65
- package/esm/domain/action/computeFrustration.js.map +0 -1
- package/esm/domain/action/getActionNameFromElement.d.ts +0 -4
- package/esm/domain/action/getActionNameFromElement.js +0 -236
- package/esm/domain/action/getActionNameFromElement.js.map +0 -1
- package/esm/domain/action/interactionSelectorCache.d.ts +0 -5
- package/esm/domain/action/interactionSelectorCache.js +0 -18
- package/esm/domain/action/interactionSelectorCache.js.map +0 -1
- package/esm/domain/action/listenActionEvents.d.ts +0 -19
- package/esm/domain/action/listenActionEvents.js +0 -58
- package/esm/domain/action/listenActionEvents.js.map +0 -1
- package/esm/domain/action/trackClickActions.d.ts +0 -81
- package/esm/domain/action/trackClickActions.js +0 -232
- package/esm/domain/action/trackClickActions.js.map +0 -1
- package/esm/domain/assembly.d.ts +0 -5
- package/esm/domain/assembly.js +0 -99
- package/esm/domain/assembly.js.map +0 -1
- package/esm/domain/configuration/configuration.d.ts +0 -358
- package/esm/domain/configuration/configuration.js +0 -209
- package/esm/domain/configuration/configuration.js.map +0 -1
- package/esm/domain/configuration/index.d.ts +0 -4
- package/esm/domain/configuration/index.js +0 -5
- package/esm/domain/configuration/index.js.map +0 -1
- package/esm/domain/configuration/jsonPathParser.d.ts +0 -28
- package/esm/domain/configuration/jsonPathParser.js +0 -156
- package/esm/domain/configuration/jsonPathParser.js.map +0 -1
- package/esm/domain/configuration/remoteConfiguration.d.ts +0 -39
- package/esm/domain/configuration/remoteConfiguration.js +0 -236
- package/esm/domain/configuration/remoteConfiguration.js.map +0 -1
- package/esm/domain/configuration/remoteConfiguration.types.d.ts +0 -138
- package/esm/domain/configuration/remoteConfiguration.types.js +0 -6
- package/esm/domain/configuration/remoteConfiguration.types.js.map +0 -1
- package/esm/domain/configuration/remoteSdkConfiguration.d.ts +0 -18
- package/esm/domain/configuration/remoteSdkConfiguration.js +0 -137
- package/esm/domain/configuration/remoteSdkConfiguration.js.map +0 -1
- package/esm/domain/configuration/sessionReplayRoutes.d.ts +0 -35
- package/esm/domain/configuration/sessionReplayRoutes.js +0 -65
- package/esm/domain/configuration/sessionReplayRoutes.js.map +0 -1
- package/esm/domain/contexts/ciVisibilityContext.d.ts +0 -12
- package/esm/domain/contexts/ciVisibilityContext.js +0 -30
- package/esm/domain/contexts/ciVisibilityContext.js.map +0 -1
- package/esm/domain/contexts/connectivityContext.d.ts +0 -2
- package/esm/domain/contexts/connectivityContext.js +0 -8
- package/esm/domain/contexts/connectivityContext.js.map +0 -1
- package/esm/domain/contexts/defaultContext.d.ts +0 -4
- package/esm/domain/contexts/defaultContext.js +0 -31
- package/esm/domain/contexts/defaultContext.js.map +0 -1
- package/esm/domain/contexts/displayContext.d.ts +0 -6
- package/esm/domain/contexts/displayContext.js +0 -25
- package/esm/domain/contexts/displayContext.js.map +0 -1
- package/esm/domain/contexts/featureFlagContext.d.ts +0 -19
- package/esm/domain/contexts/featureFlagContext.js +0 -49
- package/esm/domain/contexts/featureFlagContext.js.map +0 -1
- package/esm/domain/contexts/internalContext.d.ts +0 -12
- package/esm/domain/contexts/internalContext.js +0 -23
- package/esm/domain/contexts/internalContext.js.map +0 -1
- package/esm/domain/contexts/pageStateHistory.d.ts +0 -23
- package/esm/domain/contexts/pageStateHistory.js +0 -100
- package/esm/domain/contexts/pageStateHistory.js.map +0 -1
- package/esm/domain/contexts/sessionContext.d.ts +0 -5
- package/esm/domain/contexts/sessionContext.js +0 -44
- package/esm/domain/contexts/sessionContext.js.map +0 -1
- package/esm/domain/contexts/syntheticsContext.d.ts +0 -2
- package/esm/domain/contexts/syntheticsContext.js +0 -22
- package/esm/domain/contexts/syntheticsContext.js.map +0 -1
- package/esm/domain/contexts/trackingConsentContext.d.ts +0 -3
- package/esm/domain/contexts/trackingConsentContext.js +0 -11
- package/esm/domain/contexts/trackingConsentContext.js.map +0 -1
- package/esm/domain/contexts/urlContexts.d.ts +0 -22
- package/esm/domain/contexts/urlContexts.js +0 -60
- package/esm/domain/contexts/urlContexts.js.map +0 -1
- package/esm/domain/contexts/userAgentDataContext.d.ts +0 -2
- package/esm/domain/contexts/userAgentDataContext.js +0 -28
- package/esm/domain/contexts/userAgentDataContext.js.map +0 -1
- package/esm/domain/contexts/viewHistory.d.ts +0 -17
- package/esm/domain/contexts/viewHistory.js +0 -44
- package/esm/domain/contexts/viewHistory.js.map +0 -1
- package/esm/domain/discardNegativeDuration.d.ts +0 -2
- package/esm/domain/discardNegativeDuration.js +0 -5
- package/esm/domain/discardNegativeDuration.js.map +0 -1
- package/esm/domain/error/errorCollection.d.ts +0 -17
- package/esm/domain/error/errorCollection.js +0 -70
- package/esm/domain/error/errorCollection.js.map +0 -1
- package/esm/domain/error/trackConsoleError.d.ts +0 -4
- package/esm/domain/error/trackConsoleError.js +0 -10
- package/esm/domain/error/trackConsoleError.js.map +0 -1
- package/esm/domain/error/trackReportError.d.ts +0 -5
- package/esm/domain/error/trackReportError.js +0 -13
- package/esm/domain/error/trackReportError.js.map +0 -1
- package/esm/domain/event/eventCollection.d.ts +0 -10
- package/esm/domain/event/eventCollection.js +0 -24
- package/esm/domain/event/eventCollection.js.map +0 -1
- package/esm/domain/getSelectorFromElement.d.ts +0 -64
- package/esm/domain/getSelectorFromElement.js +0 -213
- package/esm/domain/getSelectorFromElement.js.map +0 -1
- package/esm/domain/getSessionReplayUrl.d.ts +0 -9
- package/esm/domain/getSessionReplayUrl.js +0 -30
- package/esm/domain/getSessionReplayUrl.js.map +0 -1
- package/esm/domain/hooks.d.ts +0 -23
- package/esm/domain/hooks.js +0 -3
- package/esm/domain/hooks.js.map +0 -1
- package/esm/domain/lifeCycle.d.ts +0 -73
- package/esm/domain/lifeCycle.js +0 -3
- package/esm/domain/lifeCycle.js.map +0 -1
- package/esm/domain/limitModification.d.ts +0 -8
- package/esm/domain/limitModification.js +0 -43
- package/esm/domain/limitModification.js.map +0 -1
- package/esm/domain/longTask/longTaskCollection.d.ts +0 -18
- package/esm/domain/longTask/longTaskCollection.js +0 -87
- package/esm/domain/longTask/longTaskCollection.js.map +0 -1
- package/esm/domain/plugins.d.ts +0 -40
- package/esm/domain/plugins.js +0 -12
- package/esm/domain/plugins.js.map +0 -1
- package/esm/domain/privacy.d.ts +0 -44
- package/esm/domain/privacy.js +0 -302
- package/esm/domain/privacy.js.map +0 -1
- package/esm/domain/privacyConstants.d.ts +0 -23
- package/esm/domain/privacyConstants.js +0 -35
- package/esm/domain/privacyConstants.js.map +0 -1
- package/esm/domain/requestCollection.d.ts +0 -54
- package/esm/domain/requestCollection.js +0 -106
- package/esm/domain/requestCollection.js.map +0 -1
- package/esm/domain/resource/graphql.d.ts +0 -23
- package/esm/domain/resource/graphql.js +0 -91
- package/esm/domain/resource/graphql.js.map +0 -1
- package/esm/domain/resource/matchRequestResourceEntry.d.ts +0 -16
- package/esm/domain/resource/matchRequestResourceEntry.js +0 -46
- package/esm/domain/resource/matchRequestResourceEntry.js.map +0 -1
- package/esm/domain/resource/requestRegistry.d.ts +0 -9
- package/esm/domain/resource/requestRegistry.js +0 -37
- package/esm/domain/resource/requestRegistry.js.map +0 -1
- package/esm/domain/resource/resourceCollection.d.ts +0 -7
- package/esm/domain/resource/resourceCollection.js +0 -187
- package/esm/domain/resource/resourceCollection.js.map +0 -1
- package/esm/domain/resource/resourceUtils.d.ts +0 -55
- package/esm/domain/resource/resourceUtils.js +0 -244
- package/esm/domain/resource/resourceUtils.js.map +0 -1
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.d.ts +0 -4
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.js +0 -21
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.js.map +0 -1
- package/esm/domain/rumSessionManager.d.ts +0 -36
- package/esm/domain/rumSessionManager.js +0 -72
- package/esm/domain/rumSessionManager.js.map +0 -1
- package/esm/domain/sampler/sampler.d.ts +0 -10
- package/esm/domain/sampler/sampler.js +0 -58
- package/esm/domain/sampler/sampler.js.map +0 -1
- package/esm/domain/startCustomerDataTelemetry.d.ts +0 -4
- package/esm/domain/startCustomerDataTelemetry.js +0 -52
- package/esm/domain/startCustomerDataTelemetry.js.map +0 -1
- package/esm/domain/tracing/getDocumentTraceId.d.ts +0 -12
- package/esm/domain/tracing/getDocumentTraceId.js +0 -68
- package/esm/domain/tracing/getDocumentTraceId.js.map +0 -1
- package/esm/domain/tracing/identifier.d.ts +0 -13
- package/esm/domain/tracing/identifier.js +0 -50
- package/esm/domain/tracing/identifier.js.map +0 -1
- package/esm/domain/tracing/sampler.d.ts +0 -10
- package/esm/domain/tracing/sampler.js +0 -64
- package/esm/domain/tracing/sampler.js.map +0 -1
- package/esm/domain/tracing/tracer.d.ts +0 -30
- package/esm/domain/tracing/tracer.js +0 -156
- package/esm/domain/tracing/tracer.js.map +0 -1
- package/esm/domain/tracing/tracer.types.d.ts +0 -12
- package/esm/domain/tracing/tracer.types.js +0 -2
- package/esm/domain/tracing/tracer.types.js.map +0 -1
- package/esm/domain/trackEventCounts.d.ts +0 -17
- package/esm/domain/trackEventCounts.js +0 -47
- package/esm/domain/trackEventCounts.js.map +0 -1
- package/esm/domain/view/bfCacheSupport.d.ts +0 -2
- package/esm/domain/view/bfCacheSupport.js +0 -10
- package/esm/domain/view/bfCacheSupport.js.map +0 -1
- package/esm/domain/view/trackViewEventCounts.d.ts +0 -5
- package/esm/domain/view/trackViewEventCounts.js +0 -13
- package/esm/domain/view/trackViewEventCounts.js.map +0 -1
- package/esm/domain/view/trackViews.d.ts +0 -65
- package/esm/domain/view/trackViews.js +0 -278
- package/esm/domain/view/trackViews.js.map +0 -1
- package/esm/domain/view/viewCollection.d.ts +0 -18
- package/esm/domain/view/viewCollection.js +0 -150
- package/esm/domain/view/viewCollection.js.map +0 -1
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.d.ts +0 -6
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.js +0 -28
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.js.map +0 -1
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.d.ts +0 -18
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.js +0 -39
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.js.map +0 -1
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.d.ts +0 -6
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js +0 -41
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.d.ts +0 -8
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.js +0 -14
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.d.ts +0 -21
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.js +0 -34
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.d.ts +0 -37
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.js +0 -130
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.d.ts +0 -13
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.js +0 -34
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackFirstHidden.d.ts +0 -10
- package/esm/domain/view/viewMetrics/trackFirstHidden.js +0 -30
- package/esm/domain/view/viewMetrics/trackFirstHidden.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackFirstInput.d.ts +0 -19
- package/esm/domain/view/viewMetrics/trackFirstInput.js +0 -40
- package/esm/domain/view/viewMetrics/trackFirstInput.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.d.ts +0 -15
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.js +0 -38
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.d.ts +0 -25
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.js +0 -149
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.d.ts +0 -18
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.js +0 -57
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackLoadingTime.d.ts +0 -14
- package/esm/domain/view/viewMetrics/trackLoadingTime.js +0 -47
- package/esm/domain/view/viewMetrics/trackLoadingTime.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackNavigationTimings.d.ts +0 -14
- package/esm/domain/view/viewMetrics/trackNavigationTimings.js +0 -40
- package/esm/domain/view/viewMetrics/trackNavigationTimings.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackScrollMetrics.d.ts +0 -25
- package/esm/domain/view/viewMetrics/trackScrollMetrics.js +0 -72
- package/esm/domain/view/viewMetrics/trackScrollMetrics.js.map +0 -1
- package/esm/domain/vital/vitalCollection.d.ts +0 -55
- package/esm/domain/vital/vitalCollection.js +0 -107
- package/esm/domain/vital/vitalCollection.js.map +0 -1
- package/esm/domain/waitPageActivityEnd.d.ts +0 -54
- package/esm/domain/waitPageActivityEnd.js +0 -123
- package/esm/domain/waitPageActivityEnd.js.map +0 -1
- package/esm/domainContext.types.d.ts +0 -39
- package/esm/domainContext.types.js +0 -5
- package/esm/domainContext.types.js.map +0 -1
- package/esm/index.d.ts +0 -42
- package/esm/index.js +0 -22
- package/esm/index.js.map +0 -1
- package/esm/rawRumEvent.types.d.ts +0 -326
- package/esm/rawRumEvent.types.js +0 -31
- package/esm/rawRumEvent.types.js.map +0 -1
- package/esm/rumEvent.types.d.ts +0 -2038
- package/esm/rumEvent.types.js +0 -6
- package/esm/rumEvent.types.js.map +0 -1
- package/esm/transport/formDataTransport.d.ts +0 -16
- package/esm/transport/formDataTransport.js +0 -43
- package/esm/transport/formDataTransport.js.map +0 -1
- package/esm/transport/startRumBatch.d.ts +0 -5
- package/esm/transport/startRumBatch.js +0 -30
- package/esm/transport/startRumBatch.js.map +0 -1
- package/esm/transport/startRumEventBridge.d.ts +0 -2
- package/esm/transport/startRumEventBridge.js +0 -8
- package/esm/transport/startRumEventBridge.js.map +0 -1
- package/src/browser/firstInputPolyfill.ts +0 -87
- package/src/domain/error/trackConsoleError.ts +0 -14
- package/src/domain/resource/matchRequestResourceEntry.ts +0 -68
- package/src/domain/resource/retrieveInitialDocumentResourceTiming.ts +0 -27
- package/src/domain/rumSessionManager.ts +0 -134
- package/src/domain/sampler/sampler.ts +0 -63
- package/src/domain/tracing/sampler.ts +0 -69
- package/src/domain/view/viewMetrics/startInitialViewMetricsTelemetry.ts +0 -70
- package/src/domain/view/viewMetrics/trackFirstInput.ts +0 -59
|
@@ -1,153 +1,129 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var _a;
|
|
28
|
-
return ({
|
|
29
|
-
view: {
|
|
30
|
-
id: (_a = viewHistory.findView(startTime)) === null || _a === void 0 ? void 0 : _a.id,
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
return (0, trackViews_1.trackViews)(location, lifeCycle, domMutationObservable, pageOpenObservable, configuration, locationChangeObservable, !configuration.trackViewsManually, initialViewOptions);
|
|
1
|
+
const require_rawRumEvent_types = require("../../rawRumEvent.types.js");
|
|
2
|
+
require("../lifeCycle.js");
|
|
3
|
+
const require_discardNegativeDuration = require("../discardNegativeDuration.js");
|
|
4
|
+
const require_trackViews = require("./trackViews.js");
|
|
5
|
+
let _kubesense_kubesense_js_core_time = require("@kubesense/kubesense-js-core/time");
|
|
6
|
+
let _kubesense_kubesense_browser_core = require("@kubesense/kubesense-browser-core");
|
|
7
|
+
let _kubesense_kubesense_js_core_assembly = require("@kubesense/kubesense-js-core/assembly");
|
|
8
|
+
//#region src/domain/view/viewCollection.ts
|
|
9
|
+
function startViewCollection(lifeCycle, hooks, configuration, domMutationObservable, pageOpenObservable, locationChangeObservable, recorderApi, viewHistory, initialViewOptions) {
|
|
10
|
+
lifeCycle.subscribe(4, (view) => lifeCycle.notify(13, processViewUpdate(view, configuration, recorderApi)));
|
|
11
|
+
hooks.assembleEventDefaults.register(({ startTime, eventType }) => {
|
|
12
|
+
const view = viewHistory.findView(startTime);
|
|
13
|
+
if (!view) return _kubesense_kubesense_js_core_assembly.DISCARDED;
|
|
14
|
+
return {
|
|
15
|
+
type: eventType,
|
|
16
|
+
service: view.service,
|
|
17
|
+
version: view.version,
|
|
18
|
+
context: view.context,
|
|
19
|
+
view: {
|
|
20
|
+
id: view.id,
|
|
21
|
+
name: view.name
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
hooks.assembleTelemetry.register(({ startTime }) => ({ view: { id: viewHistory.findView(startTime)?.id } }));
|
|
26
|
+
return require_trackViews.trackViews(lifeCycle, domMutationObservable, pageOpenObservable, configuration, locationChangeObservable, !configuration.trackViewsManually, initialViewOptions);
|
|
35
27
|
}
|
|
36
28
|
function processViewUpdate(view, configuration, recorderApi) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
max_scroll_height_time: (0, kubesense_browser_core_1.toServerDuration)(view.commonViewMetrics.scroll.maxScrollHeightTime),
|
|
102
|
-
},
|
|
103
|
-
}
|
|
104
|
-
: undefined,
|
|
105
|
-
privacy: {
|
|
106
|
-
replay_level: configuration.defaultPrivacyLevel,
|
|
107
|
-
},
|
|
108
|
-
device: {
|
|
109
|
-
locale: navigator.language,
|
|
110
|
-
locales: navigator.languages,
|
|
111
|
-
time_zone: (0, kubesense_browser_core_1.getTimeZone)(),
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
if (!(0, kubesense_browser_core_1.isEmptyObject)(view.customTimings)) {
|
|
115
|
-
viewEvent.view.custom_timings = (0, kubesense_browser_core_1.mapValues)(view.customTimings, kubesense_browser_core_1.toServerDuration);
|
|
116
|
-
}
|
|
117
|
-
return {
|
|
118
|
-
rawRumEvent: viewEvent,
|
|
119
|
-
startTime: view.startClocks.relative,
|
|
120
|
-
duration: view.duration,
|
|
121
|
-
domainContext: {
|
|
122
|
-
location: view.location,
|
|
123
|
-
},
|
|
124
|
-
};
|
|
29
|
+
const replayStats = recorderApi.getReplayStats(view.id);
|
|
30
|
+
const clsDevicePixelRatio = view.commonViewMetrics?.cumulativeLayoutShift?.devicePixelRatio;
|
|
31
|
+
const viewEvent = {
|
|
32
|
+
_kubesense: {
|
|
33
|
+
document_version: view.documentVersion,
|
|
34
|
+
replay_stats: replayStats,
|
|
35
|
+
cls: clsDevicePixelRatio ? { device_pixel_ratio: clsDevicePixelRatio } : void 0,
|
|
36
|
+
configuration: {
|
|
37
|
+
start_session_replay_recording_manually: configuration.startSessionReplayRecordingManually,
|
|
38
|
+
remote_configuration_id: configuration.remoteConfigurationId
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
date: view.startClocks.timeStamp,
|
|
42
|
+
type: require_rawRumEvent_types.RumEventType.VIEW,
|
|
43
|
+
view: {
|
|
44
|
+
action: { count: view.eventCounts.actionCount },
|
|
45
|
+
frustration: { count: view.eventCounts.frustrationCount },
|
|
46
|
+
cumulative_layout_shift: view.commonViewMetrics.cumulativeLayoutShift?.value,
|
|
47
|
+
cumulative_layout_shift_time: (0, _kubesense_kubesense_js_core_time.toServerDuration)(view.commonViewMetrics.cumulativeLayoutShift?.time),
|
|
48
|
+
cumulative_layout_shift_target_selector: view.commonViewMetrics.cumulativeLayoutShift?.targetSelector,
|
|
49
|
+
first_byte: (0, _kubesense_kubesense_js_core_time.toServerDuration)(view.initialViewMetrics.navigationTimings?.firstByte),
|
|
50
|
+
dom_complete: (0, _kubesense_kubesense_js_core_time.toServerDuration)(view.initialViewMetrics.navigationTimings?.domComplete),
|
|
51
|
+
dom_content_loaded: (0, _kubesense_kubesense_js_core_time.toServerDuration)(view.initialViewMetrics.navigationTimings?.domContentLoaded),
|
|
52
|
+
dom_interactive: (0, _kubesense_kubesense_js_core_time.toServerDuration)(view.initialViewMetrics.navigationTimings?.domInteractive),
|
|
53
|
+
error: { count: view.eventCounts.errorCount },
|
|
54
|
+
first_contentful_paint: (0, _kubesense_kubesense_js_core_time.toServerDuration)(view.initialViewMetrics.firstContentfulPaint),
|
|
55
|
+
interaction_to_next_paint: (0, _kubesense_kubesense_js_core_time.toServerDuration)(view.commonViewMetrics.interactionToNextPaint?.value),
|
|
56
|
+
interaction_to_next_paint_time: (0, _kubesense_kubesense_js_core_time.toServerDuration)(view.commonViewMetrics.interactionToNextPaint?.time),
|
|
57
|
+
interaction_to_next_paint_target_selector: view.commonViewMetrics.interactionToNextPaint?.targetSelector,
|
|
58
|
+
is_active: view.isActive,
|
|
59
|
+
name: view.name,
|
|
60
|
+
largest_contentful_paint: (0, _kubesense_kubesense_js_core_time.toServerDuration)(view.initialViewMetrics.largestContentfulPaint?.value),
|
|
61
|
+
largest_contentful_paint_target_selector: view.initialViewMetrics.largestContentfulPaint?.targetSelector,
|
|
62
|
+
load_event: (0, _kubesense_kubesense_js_core_time.toServerDuration)(view.initialViewMetrics.navigationTimings?.loadEvent),
|
|
63
|
+
loading_time: require_discardNegativeDuration.discardNegativeDuration((0, _kubesense_kubesense_js_core_time.toServerDuration)(view.commonViewMetrics.loadingTime)),
|
|
64
|
+
loading_type: view.loadingType,
|
|
65
|
+
long_task: { count: view.eventCounts.longTaskCount },
|
|
66
|
+
performance: computeViewPerformanceData(view.commonViewMetrics, view.initialViewMetrics),
|
|
67
|
+
resource: { count: view.eventCounts.resourceCount },
|
|
68
|
+
time_spent: (0, _kubesense_kubesense_js_core_time.toServerDuration)(view.duration)
|
|
69
|
+
},
|
|
70
|
+
display: view.commonViewMetrics.scroll ? { scroll: {
|
|
71
|
+
max_depth: view.commonViewMetrics.scroll.maxDepth,
|
|
72
|
+
max_depth_scroll_top: view.commonViewMetrics.scroll.maxDepthScrollTop,
|
|
73
|
+
max_scroll_height: view.commonViewMetrics.scroll.maxScrollHeight,
|
|
74
|
+
max_scroll_height_time: (0, _kubesense_kubesense_js_core_time.toServerDuration)(view.commonViewMetrics.scroll.maxScrollHeightTime)
|
|
75
|
+
} } : void 0,
|
|
76
|
+
privacy: { replay_level: configuration.defaultPrivacyLevel },
|
|
77
|
+
device: {
|
|
78
|
+
locale: navigator.language,
|
|
79
|
+
locales: navigator.languages,
|
|
80
|
+
time_zone: (0, _kubesense_kubesense_browser_core.getTimeZone)()
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
if (!(0, _kubesense_kubesense_browser_core.isEmptyObject)(view.customTimings)) viewEvent.view.custom_timings = (0, _kubesense_kubesense_browser_core.mapValues)(view.customTimings, _kubesense_kubesense_js_core_time.toServerDuration);
|
|
84
|
+
return {
|
|
85
|
+
rawRumEvent: viewEvent,
|
|
86
|
+
startClocks: view.startClocks,
|
|
87
|
+
duration: view.duration,
|
|
88
|
+
domainContext: {
|
|
89
|
+
location: view.location,
|
|
90
|
+
handlingStack: view.handlingStack
|
|
91
|
+
}
|
|
92
|
+
};
|
|
125
93
|
}
|
|
126
|
-
function computeViewPerformanceData({ cumulativeLayoutShift, interactionToNextPaint }, { firstContentfulPaint,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
94
|
+
function computeViewPerformanceData({ cumulativeLayoutShift, interactionToNextPaint }, { firstContentfulPaint, largestContentfulPaint }) {
|
|
95
|
+
return {
|
|
96
|
+
cls: cumulativeLayoutShift && {
|
|
97
|
+
score: cumulativeLayoutShift.value,
|
|
98
|
+
timestamp: (0, _kubesense_kubesense_js_core_time.toServerDuration)(cumulativeLayoutShift.time),
|
|
99
|
+
target_selector: cumulativeLayoutShift.targetSelector,
|
|
100
|
+
previous_rect: cumulativeLayoutShift.previousRect,
|
|
101
|
+
current_rect: cumulativeLayoutShift.currentRect
|
|
102
|
+
},
|
|
103
|
+
fcp: firstContentfulPaint && { timestamp: (0, _kubesense_kubesense_js_core_time.toServerDuration)(firstContentfulPaint) },
|
|
104
|
+
inp: interactionToNextPaint && {
|
|
105
|
+
duration: (0, _kubesense_kubesense_js_core_time.toServerDuration)(interactionToNextPaint.value),
|
|
106
|
+
timestamp: (0, _kubesense_kubesense_js_core_time.toServerDuration)(interactionToNextPaint.time),
|
|
107
|
+
target_selector: interactionToNextPaint.targetSelector,
|
|
108
|
+
sub_parts: interactionToNextPaint.subParts ? {
|
|
109
|
+
input_delay: (0, _kubesense_kubesense_js_core_time.toServerDuration)(interactionToNextPaint.subParts.inputDelay),
|
|
110
|
+
processing_duration: (0, _kubesense_kubesense_js_core_time.toServerDuration)(interactionToNextPaint.subParts.processingDuration),
|
|
111
|
+
presentation_delay: (0, _kubesense_kubesense_js_core_time.toServerDuration)(interactionToNextPaint.subParts.presentationDelay)
|
|
112
|
+
} : void 0
|
|
113
|
+
},
|
|
114
|
+
lcp: largestContentfulPaint && {
|
|
115
|
+
timestamp: (0, _kubesense_kubesense_js_core_time.toServerDuration)(largestContentfulPaint.value),
|
|
116
|
+
target_selector: largestContentfulPaint.targetSelector,
|
|
117
|
+
resource_url: largestContentfulPaint.resourceUrl,
|
|
118
|
+
sub_parts: largestContentfulPaint.subParts ? {
|
|
119
|
+
load_delay: (0, _kubesense_kubesense_js_core_time.toServerDuration)(largestContentfulPaint.subParts.loadDelay),
|
|
120
|
+
load_time: (0, _kubesense_kubesense_js_core_time.toServerDuration)(largestContentfulPaint.subParts.loadTime),
|
|
121
|
+
render_delay: (0, _kubesense_kubesense_js_core_time.toServerDuration)(largestContentfulPaint.subParts.renderDelay)
|
|
122
|
+
} : void 0
|
|
123
|
+
}
|
|
124
|
+
};
|
|
152
125
|
}
|
|
126
|
+
//#endregion
|
|
127
|
+
exports.startViewCollection = startViewCollection;
|
|
128
|
+
|
|
153
129
|
//# sourceMappingURL=viewCollection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewCollection.js","sourceRoot":"","sources":["../../../src/domain/view/viewCollection.ts"],"names":[],"mappings":";;AAkBA,kDAsDC;AAvED,8EAAiI;AACjI,wEAAoE;AAGpE,+DAAsD;AAQtD,6CAAyC;AAKzC,SAAgB,mBAAmB,CACjC,SAAoB,EACpB,KAAY,EACZ,aAA+B,EAC/B,QAAkB,EAClB,qBAAsD,EACtD,kBAAoC,EACpC,wBAAoD,EACpD,WAAwB,EACxB,WAAwB,EACxB,kBAAgC;IAEhC,SAAS,CAAC,SAAS,0CAAkC,CAAC,IAAI,EAAE,EAAE,CAC5D,SAAS,CAAC,MAAM,sDAA6C,iBAAiB,C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EACpE,EAAE,oBAAoB,EAAE,UAAU,EAAE,sBAAsB,EAAsB;IAEhF,OAAO;QACL,GAAG,EAAE,qBAAqB,IAAI;YAC5B,KAAK,EAAE,qBAAqB,CAAC,KAAK;YAClC,SAAS,EAAE,IAAA,yCAAgB,EAAC,qBAAqB,CAAC,IAAI,CAAC;YACvD,eAAe,EAAE,qBAAqB,CAAC,cAAc;YACrD,aAAa,EAAE,qBAAqB,CAAC,YAAY;YACjD,YAAY,EAAE,qBAAqB,CAAC,WAAW;SAChD;QACD,GAAG,EAAE,oBAAoB,IAAI,EAAE,SAAS,EAAE,IAAA,yCAAgB,EAAC,oBAAoB,CAAC,EAAE;QAClF,GAAG,EAAE,UAAU,IAAI;YACjB,QAAQ,EAAE,IAAA,yCAAgB,EAAC,UAAU,CAAC,KAAK,CAAC;YAC5C,SAAS,EAAE,IAAA,yCAAgB,EAAC,UAAU,CAAC,IAAI,CAAC;YAC5C,eAAe,EAAE,UAAU,CAAC,cAAc;SAC3C;QACD,GAAG,EAAE,sBAAsB,IAAI;YAC7B,QAAQ,EAAE,IAAA,yCAAgB,EAAC,sBAAsB,CAAC,KAAK,CAAC;YACxD,SAAS,EAAE,IAAA,yCAAgB,EAAC,sBAAsB,CAAC,IAAI,CAAC;YACxD,eAAe,EAAE,sBAAsB,CAAC,cAAc;SACvD;QACD,GAAG,EAAE,sBAAsB,IAAI;YAC7B,SAAS,EAAE,IAAA,yCAAgB,EAAC,sBAAsB,CAAC,KAAK,CAAC;YACzD,eAAe,EAAE,sBAAsB,CAAC,cAAc;YACtD,YAAY,EAAE,sBAAsB,CAAC,WAAW;SACjD;KACF,CAAA;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"viewCollection.js","names":["DISCARDED","trackViews","RumEventType","toServerDuration","discardNegativeDuration","getTimeZone","isEmptyObject","mapValues"],"sources":["../../../src/domain/view/viewCollection.ts"],"sourcesContent":["import type { Observable } from '@kubesense/kubesense-browser-core'\nimport { toServerDuration } from '@kubesense/kubesense-js-core/time'\nimport type { Duration, ServerDuration } from '@kubesense/kubesense-js-core/time'\nimport { getTimeZone, isEmptyObject, mapValues } from '@kubesense/kubesense-browser-core'\nimport { DISCARDED } from '@kubesense/kubesense-js-core/assembly'\nimport { discardNegativeDuration } from '../discardNegativeDuration'\nimport type { RecorderApi } from '../../boot/rumPublicApi'\nimport type { RawRumViewEvent, ViewPerformanceData } from '../../rawRumEvent.types'\nimport { RumEventType } from '../../rawRumEvent.types'\nimport type { LifeCycle, RawRumEventCollectedData } from '../lifeCycle'\nimport { LifeCycleEventType } from '../lifeCycle'\nimport type { LocationChange } from '../../browser/locationChangeObservable'\nimport type { RumConfiguration } from '../configuration'\nimport type { ViewHistory } from '../contexts/viewHistory'\nimport type { DefaultRumEventAttributes, DefaultTelemetryEventAttributes, Hooks } from '../hooks'\nimport type { RumMutationRecord } from '../../browser/domMutationObservable'\nimport { trackViews } from './trackViews'\nimport type { ViewEvent, ViewOptions } from './trackViews'\nimport type { CommonViewMetrics } from './viewMetrics/trackCommonViewMetrics'\nimport type { InitialViewMetrics } from './viewMetrics/trackInitialViewMetrics'\n\nexport function startViewCollection(\n lifeCycle: LifeCycle,\n hooks: Hooks,\n configuration: RumConfiguration,\n domMutationObservable: Observable<RumMutationRecord[]>,\n pageOpenObservable: Observable<void>,\n locationChangeObservable: Observable<LocationChange>,\n recorderApi: RecorderApi,\n viewHistory: ViewHistory,\n initialViewOptions?: ViewOptions\n) {\n lifeCycle.subscribe(LifeCycleEventType.VIEW_UPDATED, (view) =>\n lifeCycle.notify(LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, processViewUpdate(view, configuration, recorderApi))\n )\n\n hooks.assembleEventDefaults.register(({ startTime, eventType }): DefaultRumEventAttributes | DISCARDED => {\n const view = viewHistory.findView(startTime)\n\n if (!view) {\n return DISCARDED\n }\n\n return {\n type: eventType,\n service: view.service,\n version: view.version,\n context: view.context,\n view: {\n id: view.id,\n name: view.name,\n },\n }\n })\n\n hooks.assembleTelemetry.register(({ startTime }): DefaultTelemetryEventAttributes => ({\n view: {\n id: viewHistory.findView(startTime)?.id,\n },\n }))\n\n return trackViews(\n lifeCycle,\n domMutationObservable,\n pageOpenObservable,\n configuration,\n locationChangeObservable,\n !configuration.trackViewsManually,\n initialViewOptions\n )\n}\n\nfunction processViewUpdate(\n view: ViewEvent,\n configuration: RumConfiguration,\n recorderApi: RecorderApi\n): RawRumEventCollectedData<RawRumViewEvent> {\n const replayStats = recorderApi.getReplayStats(view.id)\n const clsDevicePixelRatio = view.commonViewMetrics?.cumulativeLayoutShift?.devicePixelRatio\n const viewEvent: RawRumViewEvent = {\n _kubesense: {\n document_version: view.documentVersion,\n replay_stats: replayStats,\n cls: clsDevicePixelRatio\n ? {\n device_pixel_ratio: clsDevicePixelRatio,\n }\n : undefined,\n configuration: {\n start_session_replay_recording_manually: configuration.startSessionReplayRecordingManually,\n remote_configuration_id: configuration.remoteConfigurationId,\n },\n },\n date: view.startClocks.timeStamp,\n type: RumEventType.VIEW,\n view: {\n action: {\n count: view.eventCounts.actionCount,\n },\n frustration: {\n count: view.eventCounts.frustrationCount,\n },\n cumulative_layout_shift: view.commonViewMetrics.cumulativeLayoutShift?.value,\n cumulative_layout_shift_time: toServerDuration(view.commonViewMetrics.cumulativeLayoutShift?.time),\n cumulative_layout_shift_target_selector: view.commonViewMetrics.cumulativeLayoutShift?.targetSelector,\n first_byte: toServerDuration(view.initialViewMetrics.navigationTimings?.firstByte),\n dom_complete: toServerDuration(view.initialViewMetrics.navigationTimings?.domComplete),\n dom_content_loaded: toServerDuration(view.initialViewMetrics.navigationTimings?.domContentLoaded),\n dom_interactive: toServerDuration(view.initialViewMetrics.navigationTimings?.domInteractive),\n error: {\n count: view.eventCounts.errorCount,\n },\n first_contentful_paint: toServerDuration(view.initialViewMetrics.firstContentfulPaint),\n interaction_to_next_paint: toServerDuration(view.commonViewMetrics.interactionToNextPaint?.value),\n interaction_to_next_paint_time: toServerDuration(view.commonViewMetrics.interactionToNextPaint?.time),\n interaction_to_next_paint_target_selector: view.commonViewMetrics.interactionToNextPaint?.targetSelector,\n is_active: view.isActive,\n name: view.name,\n largest_contentful_paint: toServerDuration(view.initialViewMetrics.largestContentfulPaint?.value),\n largest_contentful_paint_target_selector: view.initialViewMetrics.largestContentfulPaint?.targetSelector,\n load_event: toServerDuration(view.initialViewMetrics.navigationTimings?.loadEvent),\n loading_time: discardNegativeDuration(toServerDuration(view.commonViewMetrics.loadingTime)),\n loading_type: view.loadingType,\n long_task: {\n count: view.eventCounts.longTaskCount,\n },\n performance: computeViewPerformanceData(view.commonViewMetrics, view.initialViewMetrics),\n resource: {\n count: view.eventCounts.resourceCount,\n },\n time_spent: toServerDuration(view.duration),\n },\n display: view.commonViewMetrics.scroll\n ? {\n scroll: {\n max_depth: view.commonViewMetrics.scroll.maxDepth,\n max_depth_scroll_top: view.commonViewMetrics.scroll.maxDepthScrollTop,\n max_scroll_height: view.commonViewMetrics.scroll.maxScrollHeight,\n max_scroll_height_time: toServerDuration(view.commonViewMetrics.scroll.maxScrollHeightTime),\n },\n }\n : undefined,\n privacy: {\n replay_level: configuration.defaultPrivacyLevel,\n },\n device: {\n locale: navigator.language,\n locales: navigator.languages,\n time_zone: getTimeZone(),\n },\n }\n\n if (!isEmptyObject(view.customTimings)) {\n viewEvent.view.custom_timings = mapValues(\n view.customTimings,\n toServerDuration as (duration: Duration) => ServerDuration\n )\n }\n\n return {\n rawRumEvent: viewEvent,\n startClocks: view.startClocks,\n duration: view.duration,\n domainContext: {\n location: view.location,\n handlingStack: view.handlingStack,\n },\n }\n}\n\nfunction computeViewPerformanceData(\n { cumulativeLayoutShift, interactionToNextPaint }: CommonViewMetrics,\n { firstContentfulPaint, largestContentfulPaint }: InitialViewMetrics\n): ViewPerformanceData {\n return {\n cls: cumulativeLayoutShift && {\n score: cumulativeLayoutShift.value,\n timestamp: toServerDuration(cumulativeLayoutShift.time),\n target_selector: cumulativeLayoutShift.targetSelector,\n previous_rect: cumulativeLayoutShift.previousRect,\n current_rect: cumulativeLayoutShift.currentRect,\n },\n fcp: firstContentfulPaint && { timestamp: toServerDuration(firstContentfulPaint) },\n inp: interactionToNextPaint && {\n duration: toServerDuration(interactionToNextPaint.value),\n timestamp: toServerDuration(interactionToNextPaint.time),\n target_selector: interactionToNextPaint.targetSelector,\n sub_parts: interactionToNextPaint.subParts\n ? {\n input_delay: toServerDuration(interactionToNextPaint.subParts.inputDelay),\n processing_duration: toServerDuration(interactionToNextPaint.subParts.processingDuration),\n presentation_delay: toServerDuration(interactionToNextPaint.subParts.presentationDelay),\n }\n : undefined,\n },\n lcp: largestContentfulPaint && {\n timestamp: toServerDuration(largestContentfulPaint.value),\n target_selector: largestContentfulPaint.targetSelector,\n resource_url: largestContentfulPaint.resourceUrl,\n sub_parts: largestContentfulPaint.subParts\n ? {\n load_delay: toServerDuration(largestContentfulPaint.subParts.loadDelay),\n load_time: toServerDuration(largestContentfulPaint.subParts.loadTime),\n render_delay: toServerDuration(largestContentfulPaint.subParts.renderDelay),\n }\n : undefined,\n },\n }\n}\n"],"mappings":";;;;;;;;AAqBA,SAAgB,oBACd,WACA,OACA,eACA,uBACA,oBACA,0BACA,aACA,aACA,oBACA;CACA,UAAU,UAAA,IAA4C,SACpD,UAAU,OAAA,IAAmD,kBAAkB,MAAM,eAAe,WAAW,CAAC,CAClH;CAEA,MAAM,sBAAsB,UAAU,EAAE,WAAW,gBAAuD;EACxG,MAAM,OAAO,YAAY,SAAS,SAAS;EAE3C,IAAI,CAAC,MACH,OAAOA,sCAAAA;EAGT,OAAO;GACL,MAAM;GACN,SAAS,KAAK;GACd,SAAS,KAAK;GACd,SAAS,KAAK;GACd,MAAM;IACJ,IAAI,KAAK;IACT,MAAM,KAAK;GACb;EACF;CACF,CAAC;CAED,MAAM,kBAAkB,UAAU,EAAE,iBAAkD,EACpF,MAAM,EACJ,IAAI,YAAY,SAAS,SAAS,CAAC,EAAE,GACvC,EACF,EAAE;CAEF,OAAOC,mBAAAA,WACL,WACA,uB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,OAAO;EACL,KAAK,yBAAyB;GAC5B,OAAO,sBAAsB;GAC7B,YAAA,GAAWA,kCAAAA,iBAAAA,CAAiB,sBAAsB,IAAI;GACtD,iBAAiB,sBAAsB;GACvC,eAAe,sBAAsB;GACrC,cAAc,sBAAsB;EACtC;EACA,KAAK,wBAAwB,EAAE,YAAA,GAAWA,kCAAAA,iBAAAA,CAAiB,oBAAoB,EAAE;EACjF,KAAK,0BAA0B;GAC7B,WAAA,GAAUA,kCAAAA,iBAAAA,CAAiB,uBAAuB,KAAK;GACvD,YAAA,GAAWA,kCAAAA,iBAAAA,CAAiB,uBAAuB,IAAI;GACvD,iBAAiB,uBAAuB;GACxC,WAAW,uBAAuB,WAC9B;IACE,cAAA,GAAaA,kCAAAA,iBAAAA,CAAiB,uBAAuB,SAAS,UAAU;IACxE,sBAAA,GAAqBA,kCAAAA,iBAAAA,CAAiB,uBAAuB,SAAS,kBAAkB;IACxF,qBAAA,GAAoBA,kCAAAA,iBAAAA,CAAiB,uBAAuB,SAAS,iBAAiB;GACxF,IACA,KAAA;EACN;EACA,KAAK,0BAA0B;GAC7B,YAAA,GAAWA,kCAAAA,iBAAAA,CAAiB,uBAAuB,KAAK;GACxD,iBAAiB,uBAAuB;GACxC,cAAc,uBAAuB;GACrC,WAAW,uBAAuB,WAC9B;IACE,aAAA,GAAYA,kCAAAA,iBAAAA,CAAiB,uBAAuB,SAAS,SAAS;IACtE,YAAA,GAAWA,kCAAAA,iBAAAA,CAAiB,uBAAuB,SAAS,QAAQ;IACpE,eAAA,GAAcA,kCAAAA,iBAAAA,CAAiB,uBAAuB,SAAS,WAAW;GAC5E,IACA,KAAA;EACN;CACF;AACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compare two values for deep equality
|
|
3
|
+
*/
|
|
4
|
+
export declare function isEqual(a: unknown, b: unknown): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Options for controlling diff merge behavior
|
|
7
|
+
*/
|
|
8
|
+
export interface DiffMergeOptions {
|
|
9
|
+
replaceKeys?: Set<string>;
|
|
10
|
+
appendKeys?: Set<string>;
|
|
11
|
+
ignoreKeys?: Set<string>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* MERGE strategy: compare two objects and return an object with only changed fields.
|
|
15
|
+
* Returns undefined if no changes.
|
|
16
|
+
*
|
|
17
|
+
* Default strategy is REPLACE (isEqual check). Exceptions:
|
|
18
|
+
* - Both values are plain objects and key is not in replaceKeys: recurse (MERGE), sub-paths
|
|
19
|
+
* (e.g. 'view.custom_timings') are propagated to the recursive call.
|
|
20
|
+
* - Both values are arrays and key is in appendKeys: include only new trailing elements (APPEND)
|
|
21
|
+
*/
|
|
22
|
+
export declare function diffMerge(current: Record<string, unknown>, lastSent: Record<string, unknown>, options?: DiffMergeOptions): Record<string, unknown> | undefined;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
let _kubesense_kubesense_js_core_util = require("@kubesense/kubesense-js-core/util");
|
|
2
|
+
//#region src/domain/view/viewDiff.ts
|
|
3
|
+
/**
|
|
4
|
+
* Compare two values for deep equality
|
|
5
|
+
*/
|
|
6
|
+
function isEqual(a, b) {
|
|
7
|
+
if (a === b) return true;
|
|
8
|
+
if (a === null || typeof a !== "object" || b === null || typeof b !== "object") return a === b;
|
|
9
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
10
|
+
if (a.length !== b.length) return false;
|
|
11
|
+
return a.every((val, idx) => isEqual(val, b[idx]));
|
|
12
|
+
}
|
|
13
|
+
if (Array.isArray(a) || Array.isArray(b)) return false;
|
|
14
|
+
const aObj = a;
|
|
15
|
+
const bObj = b;
|
|
16
|
+
const aKeys = Object.keys(aObj);
|
|
17
|
+
const bKeys = Object.keys(bObj);
|
|
18
|
+
if (aKeys.length !== bKeys.length) return false;
|
|
19
|
+
return aKeys.every((key) => bKeys.includes(key) && isEqual(aObj[key], bObj[key]));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* MERGE strategy: compare two objects and return an object with only changed fields.
|
|
23
|
+
* Returns undefined if no changes.
|
|
24
|
+
*
|
|
25
|
+
* Default strategy is REPLACE (isEqual check). Exceptions:
|
|
26
|
+
* - Both values are plain objects and key is not in replaceKeys: recurse (MERGE), sub-paths
|
|
27
|
+
* (e.g. 'view.custom_timings') are propagated to the recursive call.
|
|
28
|
+
* - Both values are arrays and key is in appendKeys: include only new trailing elements (APPEND)
|
|
29
|
+
*/
|
|
30
|
+
function diffMerge(current, lastSent, options) {
|
|
31
|
+
const result = {};
|
|
32
|
+
const replaceKeys = options?.replaceKeys ?? /* @__PURE__ */ new Set();
|
|
33
|
+
const appendKeys = options?.appendKeys ?? /* @__PURE__ */ new Set();
|
|
34
|
+
const ignoreKeys = options?.ignoreKeys ?? /* @__PURE__ */ new Set();
|
|
35
|
+
for (const key of Object.keys(current)) {
|
|
36
|
+
if (ignoreKeys.has(key)) continue;
|
|
37
|
+
const currentVal = current[key];
|
|
38
|
+
const lastSentVal = lastSent[key];
|
|
39
|
+
if (!replaceKeys.has(key) && (0, _kubesense_kubesense_js_core_util.isIndexableObject)(currentVal) && (0, _kubesense_kubesense_js_core_util.isIndexableObject)(lastSentVal)) {
|
|
40
|
+
const nestedDiff = diffMerge(currentVal, lastSentVal, {
|
|
41
|
+
replaceKeys: extractSubPaths(replaceKeys, key),
|
|
42
|
+
appendKeys: extractSubPaths(appendKeys, key),
|
|
43
|
+
ignoreKeys: extractSubPaths(ignoreKeys, key)
|
|
44
|
+
});
|
|
45
|
+
if (nestedDiff) result[key] = nestedDiff;
|
|
46
|
+
} else if (appendKeys.has(key) && Array.isArray(currentVal) && Array.isArray(lastSentVal)) {
|
|
47
|
+
if (currentVal.length > lastSentVal.length) result[key] = currentVal.slice(lastSentVal.length);
|
|
48
|
+
} else if (!isEqual(currentVal, lastSentVal)) result[key] = currentVal;
|
|
49
|
+
}
|
|
50
|
+
for (const key of Object.keys(lastSent)) if (!(key in current)) result[key] = null;
|
|
51
|
+
return Object.keys(result).length > 0 ? result : void 0;
|
|
52
|
+
}
|
|
53
|
+
function extractSubPaths(keys, prefix) {
|
|
54
|
+
const result = /* @__PURE__ */ new Set();
|
|
55
|
+
for (const key of keys) if (key.startsWith(`${prefix}.`)) result.add(key.slice(prefix.length + 1));
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
exports.diffMerge = diffMerge;
|
|
60
|
+
exports.isEqual = isEqual;
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=viewDiff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewDiff.js","names":["isIndexableObject"],"sources":["../../../src/domain/view/viewDiff.ts"],"sourcesContent":["import { isIndexableObject } from '@kubesense/kubesense-js-core/util'\n\n/**\n * Compare two values for deep equality\n */\nexport function isEqual(a: unknown, b: unknown): boolean {\n if (a === b) {\n return true\n }\n\n if (a === null || typeof a !== 'object' || b === null || typeof b !== 'object') {\n return a === b\n }\n\n // Arrays\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) {\n return false\n }\n return a.every((val, idx) => isEqual(val, b[idx]))\n }\n\n if (Array.isArray(a) || Array.isArray(b)) {\n return false\n }\n\n // Plain objects\n const aObj = a as Record<string, unknown>\n const bObj = b as Record<string, unknown>\n const aKeys = Object.keys(aObj)\n const bKeys = Object.keys(bObj)\n\n if (aKeys.length !== bKeys.length) {\n return false\n }\n\n return aKeys.every((key) => bKeys.includes(key) && isEqual(aObj[key], bObj[key]))\n}\n\n/**\n * Options for controlling diff merge behavior\n */\nexport interface DiffMergeOptions {\n replaceKeys?: Set<string>\n appendKeys?: Set<string>\n ignoreKeys?: Set<string>\n}\n\n/**\n * MERGE strategy: compare two objects and return an object with only changed fields.\n * Returns undefined if no changes.\n *\n * Default strategy is REPLACE (isEqual check). Exceptions:\n * - Both values are plain objects and key is not in replaceKeys: recurse (MERGE), sub-paths\n * (e.g. 'view.custom_timings') are propagated to the recursive call.\n * - Both values are arrays and key is in appendKeys: include only new trailing elements (APPEND)\n */\nexport function diffMerge(\n current: Record<string, unknown>,\n lastSent: Record<string, unknown>,\n options?: DiffMergeOptions\n): Record<string, unknown> | undefined {\n const result: Record<string, unknown> = {}\n const replaceKeys = options?.replaceKeys ?? new Set<string>()\n const appendKeys = options?.appendKeys ?? new Set<string>()\n const ignoreKeys = options?.ignoreKeys ?? new Set<string>()\n\n for (const key of Object.keys(current)) {\n if (ignoreKeys.has(key)) {\n continue\n }\n\n const currentVal = current[key]\n const lastSentVal = lastSent[key]\n\n if (!replaceKeys.has(key) && isIndexableObject(currentVal) && isIndexableObject(lastSentVal)) {\n // Both are plain objects and not marked for replace: recurse (MERGE)\n const nestedDiff = diffMerge(currentVal, lastSentVal, {\n replaceKeys: extractSubPaths(replaceKeys, key),\n appendKeys: extractSubPaths(appendKeys, key),\n ignoreKeys: extractSubPaths(ignoreKeys, key),\n })\n if (nestedDiff) {\n result[key] = nestedDiff\n }\n } else if (appendKeys.has(key) && Array.isArray(currentVal) && Array.isArray(lastSentVal)) {\n // Array in appendKeys: include only new trailing elements (APPEND)\n if (currentVal.length > lastSentVal.length) {\n result[key] = currentVal.slice(lastSentVal.length)\n }\n } else if (!isEqual(currentVal, lastSentVal)) {\n // Default: replace the whole value (REPLACE)\n result[key] = currentVal\n }\n }\n\n // Deleted keys: present in lastSent but not in current\n for (const key of Object.keys(lastSent)) {\n if (!(key in current)) {\n result[key] = null\n }\n }\n\n return Object.keys(result).length > 0 ? result : undefined\n}\n\nfunction extractSubPaths(keys: Set<string>, prefix: string): Set<string> {\n const result = new Set<string>()\n for (const key of keys) {\n if (key.startsWith(`${prefix}.`)) {\n result.add(key.slice(prefix.length + 1))\n }\n }\n return result\n}\n"],"mappings":";;;;;AAKA,SAAgB,QAAQ,GAAY,GAAqB;CACvD,IAAI,MAAM,GACR,OAAO;CAGT,IAAI,MAAM,QAAQ,OAAO,MAAM,YAAY,MAAM,QAAQ,OAAO,MAAM,UAC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M,QAAQ,WAAW,GAElF;OAAA,WAAW,SAAS,YAAY,QAClC,OAAO,OAAO,WAAW,MAAM,YAAY,MAAM;EAAA,OAE9C,IAAI,CAAC,QAAQ,YAAY,WAAW,GAEzC,OAAO,OAAO;CAElB;CAGA,KAAK,MAAM,OAAO,OAAO,KAAK,QAAQ,GACpC,IAAI,EAAE,OAAO,UACX,OAAO,OAAO;CAIlB,OAAO,OAAO,KAAK,MAAM,CAAC,CAAC,SAAS,IAAI,SAAS,KAAA;AACnD;AAEA,SAAS,gBAAgB,MAAmB,QAA6B;CACvE,MAAM,yBAAS,IAAI,IAAY;CAC/B,KAAK,MAAM,OAAO,MAChB,IAAI,IAAI,WAAW,GAAG,OAAO,EAAE,GAC7B,OAAO,IAAI,IAAI,MAAM,OAAO,SAAS,CAAC,CAAC;CAG3C,OAAO;AACT"}
|
|
@@ -1,32 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getClsAttributionImpactedArea = void 0;
|
|
1
|
+
//#region src/domain/view/viewMetrics/getClsAttributionImpactedArea.ts
|
|
4
2
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
* Calculates the area of a rectangle given its width and height
|
|
4
|
+
*/
|
|
7
5
|
const calculateArea = (width, height) => width * height;
|
|
8
6
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
* Calculates the intersection area between two rectangles
|
|
8
|
+
*/
|
|
11
9
|
const calculateIntersectionArea = (rect1, rect2) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
return calculateArea(right - left, bottom - top);
|
|
10
|
+
const left = Math.max(rect1.left, rect2.left);
|
|
11
|
+
const top = Math.max(rect1.top, rect2.top);
|
|
12
|
+
const right = Math.min(rect1.right, rect2.right);
|
|
13
|
+
const bottom = Math.min(rect1.bottom, rect2.bottom);
|
|
14
|
+
if (left >= right || top >= bottom) return 0;
|
|
15
|
+
return calculateArea(right - left, bottom - top);
|
|
20
16
|
};
|
|
21
17
|
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
* Calculates the total impacted area of a layout shift source
|
|
19
|
+
* This is the sum of the previous and current areas minus their intersection
|
|
20
|
+
*/
|
|
25
21
|
const getClsAttributionImpactedArea = (source) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
const previousArea = calculateArea(source.previousRect.width, source.previousRect.height);
|
|
23
|
+
const currentArea = calculateArea(source.currentRect.width, source.currentRect.height);
|
|
24
|
+
const intersectionArea = calculateIntersectionArea(source.previousRect, source.currentRect);
|
|
25
|
+
return previousArea + currentArea - intersectionArea;
|
|
30
26
|
};
|
|
27
|
+
//#endregion
|
|
31
28
|
exports.getClsAttributionImpactedArea = getClsAttributionImpactedArea;
|
|
29
|
+
|
|
32
30
|
//# sourceMappingURL=getClsAttributionImpactedArea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getClsAttributionImpactedArea.js","
|
|
1
|
+
{"version":3,"file":"getClsAttributionImpactedArea.js","names":[],"sources":["../../../../src/domain/view/viewMetrics/getClsAttributionImpactedArea.ts"],"sourcesContent":["import type { RumLayoutShiftAttribution } from '../../../browser/performanceObservable'\n\n/**\n * Calculates the area of a rectangle given its width and height\n */\nconst calculateArea = (width: number, height: number): number => width * height\n\n/**\n * Calculates the intersection area between two rectangles\n */\nconst calculateIntersectionArea = (rect1: DOMRectReadOnly, rect2: DOMRectReadOnly): number => {\n const left = Math.max(rect1.left, rect2.left)\n const top = Math.max(rect1.top, rect2.top)\n const right = Math.min(rect1.right, rect2.right)\n const bottom = Math.min(rect1.bottom, rect2.bottom)\n\n if (left >= right || top >= bottom) {\n return 0\n }\n\n return calculateArea(right - left, bottom - top)\n}\n\n/**\n * Calculates the total impacted area of a layout shift source\n * This is the sum of the previous and current areas minus their intersection\n */\nexport const getClsAttributionImpactedArea = (source: RumLayoutShiftAttribution): number => {\n const previousArea = calculateArea(source.previousRect.width, source.previousRect.height)\n const currentArea = calculateArea(source.currentRect.width, source.currentRect.height)\n const intersectionArea = calculateIntersectionArea(source.previousRect, source.currentRect)\n\n return previousArea + currentArea - intersectionArea\n}\n"],"mappings":";;;;AAKA,MAAM,iBAAiB,OAAe,WAA2B,QAAQ;;;;AAKzE,MAAM,6BAA6B,OAAwB,UAAmC;CAC5F,MAAM,OAAO,KAAK,IAAI,MAAM,MAAM,MAAM,IAAI;CAC5C,MAAM,MAAM,KAAK,IAAI,MAAM,KAAK,MAAM,GAAG;CACzC,MAAM,QAAQ,KAAK,IAAI,MAAM,OAAO,MAAM,KAAK;CAC/C,MAAM,SAAS,KAAK,IAAI,MAAM,QAAQ,MAAM,MAAM;CAElD,IAAI,QAAQ,SAAS,OAAO,QAC1B,OAAO;CAGT,OAAO,cAAc,QAAQ,MAAM,SAAS,GAAG;AACjD;;;;;AAMA,MAAa,iCAAiC,WAA8C;CAC1F,MAAM,eAAe,cAAc,OAAO,aAAa,OAAO,OAAO,aAAa,MAAM;CACxF,MAAM,cAAc,cAAc,OAAO,YAAY,OAAO,OAAO,YAAY,MAAM;CACrF,MAAM,mBAAmB,0BAA0B,OAAO,cAAc,OAAO,WAAW;CAE1F,OAAO,eAAe,cAAc;AACtC"}
|
|
@@ -1,44 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
let _kubesense_kubesense_js_core_monitor = require("@kubesense/kubesense-js-core/monitor");
|
|
2
|
+
//#region src/domain/view/viewMetrics/interactionCountPolyfill.ts
|
|
2
3
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getInteractionCount = void 0;
|
|
16
|
-
exports.initInteractionCountPolyfill = initInteractionCountPolyfill;
|
|
17
|
-
const kubesense_browser_core_1 = require("@kubesense/kubesense-browser-core");
|
|
4
|
+
* performance.interactionCount polyfill
|
|
5
|
+
*
|
|
6
|
+
* The interactionCount is an integer which counts the total number of distinct user interactions,
|
|
7
|
+
* for which there was a unique interactionId.
|
|
8
|
+
*
|
|
9
|
+
* The interactionCount polyfill is an estimate based on a convention specific to Chrome. Cf: https://github.com/GoogleChrome/web-vitals/pull/213
|
|
10
|
+
* This is currently not an issue as the polyfill is only used for INP which is currently only supported on Chrome.
|
|
11
|
+
* Hopefully when/if other browsers will support INP, they will also implement performance.interactionCount at the same time, so we won't need that polyfill.
|
|
12
|
+
*
|
|
13
|
+
* Reference implementation: https://github.com/GoogleChrome/web-vitals/blob/main/src/lib/polyfills/interactionCountPolyfill.ts
|
|
14
|
+
*/
|
|
18
15
|
let observer;
|
|
19
16
|
let interactionCountEstimate = 0;
|
|
20
17
|
let minKnownInteractionId = Infinity;
|
|
21
18
|
let maxKnownInteractionId = 0;
|
|
22
19
|
function initInteractionCountPolyfill() {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
if ("interactionCount" in performance || observer) return;
|
|
21
|
+
observer = new window.PerformanceObserver((0, _kubesense_kubesense_js_core_monitor.monitor)((entries) => {
|
|
22
|
+
entries.getEntries().forEach((e) => {
|
|
23
|
+
const entry = e;
|
|
24
|
+
if (entry.interactionId) {
|
|
25
|
+
minKnownInteractionId = Math.min(minKnownInteractionId, entry.interactionId);
|
|
26
|
+
maxKnownInteractionId = Math.max(maxKnownInteractionId, entry.interactionId);
|
|
27
|
+
interactionCountEstimate = (maxKnownInteractionId - minKnownInteractionId) / 7 + 1;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}));
|
|
31
|
+
observer.observe({
|
|
32
|
+
type: "event",
|
|
33
|
+
buffered: true,
|
|
34
|
+
durationThreshold: 0
|
|
35
|
+
});
|
|
37
36
|
}
|
|
38
37
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
* Returns the `interactionCount` value using the native API (if available)
|
|
39
|
+
* or the polyfill estimate in this module.
|
|
40
|
+
*/
|
|
42
41
|
const getInteractionCount = () => observer ? interactionCountEstimate : window.performance.interactionCount || 0;
|
|
42
|
+
//#endregion
|
|
43
43
|
exports.getInteractionCount = getInteractionCount;
|
|
44
|
+
exports.initInteractionCountPolyfill = initInteractionCountPolyfill;
|
|
45
|
+
|
|
44
46
|
//# sourceMappingURL=interactionCountPolyfill.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactionCountPolyfill.js","
|
|
1
|
+
{"version":3,"file":"interactionCountPolyfill.js","names":["monitor"],"sources":["../../../../src/domain/view/viewMetrics/interactionCountPolyfill.ts"],"sourcesContent":["/**\n * performance.interactionCount polyfill\n *\n * The interactionCount is an integer which counts the total number of distinct user interactions,\n * for which there was a unique interactionId.\n *\n * The interactionCount polyfill is an estimate based on a convention specific to Chrome. Cf: https://github.com/GoogleChrome/web-vitals/pull/213\n * This is currently not an issue as the polyfill is only used for INP which is currently only supported on Chrome.\n * Hopefully when/if other browsers will support INP, they will also implement performance.interactionCount at the same time, so we won't need that polyfill.\n *\n * Reference implementation: https://github.com/GoogleChrome/web-vitals/blob/main/src/lib/polyfills/interactionCountPolyfill.ts\n */\n\nimport { monitor } from '@kubesense/kubesense-js-core/monitor'\nimport type {\n BrowserWindow,\n RumPerformanceEventTiming,\n RumPerformanceObserver,\n} from '../../../browser/performanceObservable'\n\nlet observer: RumPerformanceObserver | undefined\n\nlet interactionCountEstimate = 0\nlet minKnownInteractionId = Infinity\nlet maxKnownInteractionId = 0\n\nexport function initInteractionCountPolyfill() {\n if ('interactionCount' in performance || observer) {\n return\n }\n\n observer = new (window as BrowserWindow).PerformanceObserver(\n monitor((entries: PerformanceObserverEntryList) => {\n entries.getEntries().forEach((e) => {\n const entry = e as unknown as RumPerformanceEventTiming\n\n if (entry.interactionId) {\n minKnownInteractionId = Math.min(minKnownInteractionId, entry.interactionId)\n maxKnownInteractionId = Math.max(maxKnownInteractionId, entry.interactionId)\n\n interactionCountEstimate = (maxKnownInteractionId - minKnownInteractionId) / 7 + 1\n }\n })\n })\n )\n\n observer.observe({ type: 'event', buffered: true, durationThreshold: 0 })\n}\n\n/**\n * Returns the `interactionCount` value using the native API (if available)\n * or the polyfill estimate in this module.\n */\nexport const getInteractionCount = () =>\n observer ? interactionCountEstimate : (window as BrowserWindow).performance.interactionCount || 0\n\nexport function resetInteractionCountPolyfill() {\n if (observer) {\n observer.disconnect()\n\n observer = undefined\n interactionCountEstimate = 0\n minKnownInteractionId = Infinity\n maxKnownInteractionId = 0\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,IAAI;AAEJ,IAAI,2BAA2B;AAC/B,IAAI,wBAAwB;AAC5B,IAAI,wBAAwB;AAE5B,SAAgB,+BAA+B;CAC7C,IAAI,sBAAsB,eAAe,UACvC;CAGF,WAAW,IAAK,OAAyB,qBAAA,GACvCA,qCAAAA,QAAAA,EAAS,YAA0C;EACjD,QAAQ,WAAW,CAAC,CAAC,SAAS,MAAM;GAClC,MAAM,QAAQ;GAEd,IAAI,MAAM,eAAe;IACvB,wBAAwB,KAAK,IAAI,uBAAuB,MAAM,aAAa;IAC3E,wBAAwB,KAAK,IAAI,uBAAuB,MAAM,aAAa;IAE3E,4BAA4B,wBAAwB,yBAAyB,IAAI;GACnF;EACF,CAAC;CACH,CAAC,CACH;CAEA,SAAS,QAAQ;EAAE,MAAM;EAAS,UAAU;EAAM,mBAAmB;CAAE,CAAC;AAC1E;;;;;AAMA,MAAa,4BACX,WAAW,2BAA4B,OAAyB,YAAY,oBAAoB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ClocksState } from '@kubesense/kubesense-
|
|
1
|
+
import type { ClocksState } from '@kubesense/kubesense-js-core/time';
|
|
2
2
|
import type { InitialViewMetrics } from './trackInitialViewMetrics';
|
|
3
3
|
/**
|
|
4
4
|
* BFCache keeps a full in-memory snapshot of the DOM. When the page is restored, nothing needs to be fetched, so the whole
|