@atlaskit/react-ufo 3.4.14 → 3.5.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/CHANGELOG.md +22 -0
- package/dist/cjs/additional-payload/utils/cache-hit-ratio/index.js +5 -4
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/cls/index.js +3 -2
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/index.js +6 -6
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/tbt/index.js +3 -2
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +3 -0
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +9 -7
- package/dist/cjs/assets/index.js +17 -14
- package/dist/cjs/assets/utils.js +9 -8
- package/dist/cjs/bundle-eval-timing/index.js +8 -8
- package/dist/cjs/coinflip/index.js +5 -3
- package/dist/cjs/common/constants.js +3 -2
- package/dist/cjs/common/react-ufo-payload-schema.js +5 -0
- package/dist/cjs/config/index.js +30 -42
- package/dist/cjs/create-experimental-interaction-metrics-payload/index.js +29 -39
- package/dist/cjs/create-payload/common/utils/index.js +16 -20
- package/dist/cjs/create-payload/index.js +150 -140
- package/dist/cjs/create-payload/utils/get-interaction-status.js +5 -3
- package/dist/cjs/create-payload/utils/get-page-visibility-up-to-ttai.js +5 -3
- package/dist/cjs/create-payload/utils/get-ssr-done-time-value.js +5 -3
- package/dist/cjs/create-payload/utils/get-vc-metrics.js +10 -8
- package/dist/cjs/create-post-interaction-log-payload/index.js +15 -13
- package/dist/cjs/custom-data/index.js +4 -3
- package/dist/cjs/custom-mark/index.js +4 -3
- package/dist/cjs/custom-spans/index.js +4 -3
- package/dist/cjs/custom-timings/index.js +6 -6
- package/dist/cjs/experience-trace-id-context/index.js +15 -14
- package/dist/cjs/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +3 -2
- package/dist/cjs/feature-flags-accessed/common/utils/index.js +11 -10
- package/dist/cjs/feature-flags-accessed/index.js +3 -2
- package/dist/cjs/generate-id/index.js +5 -3
- package/dist/cjs/global-error-handler/index.js +14 -13
- package/dist/cjs/initial-page-load-extra-timing/index.js +6 -6
- package/dist/cjs/interaction-metrics/index.js +110 -145
- package/dist/cjs/interaction-metrics/post-interaction-log.js +10 -0
- package/dist/cjs/interaction-metrics-init/index.js +17 -10
- package/dist/cjs/interaction-metrics-init/schedule-idle-callback.js +8 -4
- package/dist/cjs/resource-timing/common/utils/config.js +10 -10
- package/dist/cjs/resource-timing/common/utils/resource-timing-buffer.js +13 -12
- package/dist/cjs/resource-timing/main.js +27 -20
- package/dist/cjs/resource-timing/utils.js +4 -3
- package/dist/cjs/round-number/index.js +3 -2
- package/dist/cjs/route-name/index.js +5 -3
- package/dist/cjs/segment/schedule-on-paint.js +8 -5
- package/dist/cjs/segment/segment.js +9 -5
- package/dist/cjs/self-measurements/index.js +261 -0
- package/dist/cjs/set-interaction-error/index.js +4 -3
- package/dist/cjs/short-id/index.js +5 -3
- package/dist/cjs/ssr/index.js +18 -21
- package/dist/cjs/trace-interaction/index.js +7 -5
- package/dist/cjs/trace-pageload/index.js +7 -6
- package/dist/cjs/trace-press/index.js +5 -3
- package/dist/cjs/trace-redirect/index.js +5 -3
- package/dist/cjs/trace-transition/index.js +6 -4
- package/dist/cjs/trace-transition/utils/generate-span-id/index.js +3 -2
- package/dist/cjs/trace-transition/utils/set-interaction-active-trace/index.js +3 -2
- package/dist/cjs/vc/index.js +17 -6
- package/dist/cjs/vc/vc-observer/attachAbortListeners.js +3 -2
- package/dist/cjs/vc/vc-observer/getVCRevisionsData.js +41 -26
- package/dist/cjs/vc/vc-observer/getViewport.js +6 -6
- package/dist/cjs/vc/vc-observer/heatmap/heatmap.js +28 -12
- package/dist/cjs/vc/vc-observer/index.js +170 -133
- package/dist/cjs/vc/vc-observer/media-wrapper/vc-utils.js +3 -2
- package/dist/cjs/vc/vc-observer/observers/editor-lnv/index.js +17 -0
- package/dist/cjs/vc/vc-observer/observers/index.js +82 -25
- package/dist/cjs/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +5 -8
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/index.js +17 -2
- package/dist/cjs/vc/vc-observer/revisions/fy25_01.js +7 -7
- package/dist/cjs/vc/vc-observer/revisions/fy25_02.js +2 -0
- package/dist/cjs/vc/vc-observer/revisions/revisions.js +3 -2
- package/dist/cjs/vc/vc-observer-new/entries-timeline/index.js +9 -0
- package/dist/cjs/vc/vc-observer-new/get-element-name.js +5 -3
- package/dist/cjs/vc/vc-observer-new/get-unique-element-name.js +13 -11
- package/dist/cjs/vc/vc-observer-new/index.js +9 -0
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +2 -0
- package/dist/cjs/vc/vc-observer-new/metric-calculator/fy25_03/index.js +6 -1
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +20 -12
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +27 -26
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +18 -6
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +27 -14
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +10 -8
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +50 -40
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +10 -8
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +5 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +5 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +5 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/task-yield.js +10 -8
- package/dist/cjs/vc/vc-observer-new/viewport-observer/index.js +15 -7
- package/dist/cjs/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +15 -12
- package/dist/cjs/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +16 -13
- package/dist/cjs/vc/vc-observer-new/viewport-observer/performance-observer/index.js +11 -9
- package/dist/cjs/vc/vc-observer-new/window-event-observer/index.js +7 -1
- package/dist/es2019/additional-payload/utils/cache-hit-ratio/index.js +6 -5
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/cls/index.js +3 -2
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/index.js +6 -5
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/tbt/index.js +16 -13
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +3 -0
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +9 -7
- package/dist/es2019/assets/index.js +19 -14
- package/dist/es2019/assets/utils.js +11 -9
- package/dist/es2019/bundle-eval-timing/index.js +7 -6
- package/dist/es2019/coinflip/index.js +5 -2
- package/dist/es2019/common/constants.js +3 -2
- package/dist/es2019/common/react-ufo-payload-schema.js +1 -0
- package/dist/es2019/config/index.js +29 -28
- package/dist/es2019/create-experimental-interaction-metrics-payload/index.js +18 -15
- package/dist/es2019/create-payload/common/utils/index.js +15 -14
- package/dist/es2019/create-payload/index.js +87 -71
- package/dist/es2019/create-payload/utils/get-interaction-status.js +5 -2
- package/dist/es2019/create-payload/utils/get-page-visibility-up-to-ttai.js +4 -2
- package/dist/es2019/create-payload/utils/get-ssr-done-time-value.js +4 -2
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +4 -2
- package/dist/es2019/create-post-interaction-log-payload/index.js +14 -12
- package/dist/es2019/custom-data/index.js +3 -2
- package/dist/es2019/custom-mark/index.js +3 -2
- package/dist/es2019/custom-spans/index.js +3 -2
- package/dist/es2019/custom-timings/index.js +5 -4
- package/dist/es2019/experience-trace-id-context/index.js +16 -13
- package/dist/es2019/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +6 -3
- package/dist/es2019/feature-flags-accessed/common/utils/index.js +14 -7
- package/dist/es2019/feature-flags-accessed/index.js +3 -2
- package/dist/es2019/generate-id/index.js +4 -2
- package/dist/es2019/global-error-handler/index.js +15 -12
- package/dist/es2019/initial-page-load-extra-timing/index.js +5 -4
- package/dist/es2019/interaction-metrics/index.js +109 -108
- package/dist/es2019/interaction-metrics/post-interaction-log.js +10 -0
- package/dist/es2019/interaction-metrics-init/index.js +17 -10
- package/dist/es2019/interaction-metrics-init/schedule-idle-callback.js +7 -3
- package/dist/es2019/resource-timing/common/utils/config.js +10 -7
- package/dist/es2019/resource-timing/common/utils/resource-timing-buffer.js +14 -11
- package/dist/es2019/resource-timing/main.js +33 -18
- package/dist/es2019/resource-timing/utils.js +3 -2
- package/dist/es2019/round-number/index.js +3 -2
- package/dist/es2019/route-name/index.js +4 -2
- package/dist/es2019/segment/schedule-on-paint.js +7 -4
- package/dist/es2019/segment/segment.js +9 -5
- package/dist/es2019/self-measurements/index.js +213 -0
- package/dist/es2019/set-interaction-error/index.js +3 -2
- package/dist/es2019/short-id/index.js +4 -2
- package/dist/es2019/ssr/index.js +21 -16
- package/dist/es2019/trace-interaction/index.js +6 -4
- package/dist/es2019/trace-pageload/index.js +6 -4
- package/dist/es2019/trace-press/index.js +4 -2
- package/dist/es2019/trace-redirect/index.js +4 -2
- package/dist/es2019/trace-transition/index.js +5 -3
- package/dist/es2019/trace-transition/utils/generate-span-id/index.js +4 -1
- package/dist/es2019/trace-transition/utils/set-interaction-active-trace/index.js +3 -2
- package/dist/es2019/vc/index.js +16 -4
- package/dist/es2019/vc/vc-observer/attachAbortListeners.js +3 -2
- package/dist/es2019/vc/vc-observer/getVCRevisionsData.js +41 -25
- package/dist/es2019/vc/vc-observer/getViewport.js +5 -4
- package/dist/es2019/vc/vc-observer/heatmap/heatmap.js +28 -10
- package/dist/es2019/vc/vc-observer/index.js +158 -116
- package/dist/es2019/vc/vc-observer/media-wrapper/vc-utils.js +3 -2
- package/dist/es2019/vc/vc-observer/observers/editor-lnv/index.js +17 -0
- package/dist/es2019/vc/vc-observer/observers/index.js +80 -25
- package/dist/es2019/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +4 -7
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/index.js +17 -2
- package/dist/es2019/vc/vc-observer/revisions/fy25_01.js +7 -7
- package/dist/es2019/vc/vc-observer/revisions/fy25_02.js +2 -0
- package/dist/es2019/vc/vc-observer/revisions/revisions.js +3 -2
- package/dist/es2019/vc/vc-observer-new/entries-timeline/index.js +9 -0
- package/dist/es2019/vc/vc-observer-new/get-element-name.js +4 -2
- package/dist/es2019/vc/vc-observer-new/get-unique-element-name.js +12 -10
- package/dist/es2019/vc/vc-observer-new/index.js +9 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +2 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/fy25_03/index.js +3 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +14 -4
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +6 -4
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +18 -6
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +21 -8
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +10 -8
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/task-yield.js +5 -2
- package/dist/es2019/vc/vc-observer-new/viewport-observer/index.js +15 -7
- package/dist/es2019/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +15 -12
- package/dist/es2019/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +15 -13
- package/dist/es2019/vc/vc-observer-new/viewport-observer/performance-observer/index.js +11 -9
- package/dist/es2019/vc/vc-observer-new/window-event-observer/index.js +7 -1
- package/dist/esm/additional-payload/utils/cache-hit-ratio/index.js +5 -4
- package/dist/esm/additional-payload/utils/lighthouse-metrics/cls/index.js +3 -2
- package/dist/esm/additional-payload/utils/lighthouse-metrics/index.js +5 -4
- package/dist/esm/additional-payload/utils/lighthouse-metrics/tbt/index.js +3 -2
- package/dist/esm/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +3 -0
- package/dist/esm/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +9 -7
- package/dist/esm/assets/index.js +17 -14
- package/dist/esm/assets/utils.js +10 -8
- package/dist/esm/bundle-eval-timing/index.js +7 -6
- package/dist/esm/coinflip/index.js +5 -2
- package/dist/esm/common/constants.js +3 -2
- package/dist/esm/common/react-ufo-payload-schema.js +1 -0
- package/dist/esm/config/index.js +29 -28
- package/dist/esm/create-experimental-interaction-metrics-payload/index.js +28 -35
- package/dist/esm/create-payload/common/utils/index.js +15 -14
- package/dist/esm/create-payload/index.js +149 -139
- package/dist/esm/create-payload/utils/get-interaction-status.js +5 -2
- package/dist/esm/create-payload/utils/get-page-visibility-up-to-ttai.js +4 -2
- package/dist/esm/create-payload/utils/get-ssr-done-time-value.js +4 -2
- package/dist/esm/create-payload/utils/get-vc-metrics.js +9 -7
- package/dist/esm/create-post-interaction-log-payload/index.js +14 -12
- package/dist/esm/custom-data/index.js +3 -2
- package/dist/esm/custom-mark/index.js +3 -2
- package/dist/esm/custom-spans/index.js +3 -2
- package/dist/esm/custom-timings/index.js +5 -4
- package/dist/esm/experience-trace-id-context/index.js +15 -14
- package/dist/esm/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +3 -2
- package/dist/esm/feature-flags-accessed/common/utils/index.js +11 -10
- package/dist/esm/feature-flags-accessed/index.js +3 -2
- package/dist/esm/generate-id/index.js +4 -2
- package/dist/esm/global-error-handler/index.js +14 -13
- package/dist/esm/initial-page-load-extra-timing/index.js +5 -4
- package/dist/esm/interaction-metrics/index.js +109 -108
- package/dist/esm/interaction-metrics/post-interaction-log.js +10 -0
- package/dist/esm/interaction-metrics-init/index.js +17 -10
- package/dist/esm/interaction-metrics-init/schedule-idle-callback.js +7 -3
- package/dist/esm/resource-timing/common/utils/config.js +9 -8
- package/dist/esm/resource-timing/common/utils/resource-timing-buffer.js +13 -12
- package/dist/esm/resource-timing/main.js +27 -20
- package/dist/esm/resource-timing/utils.js +3 -2
- package/dist/esm/round-number/index.js +3 -2
- package/dist/esm/route-name/index.js +4 -2
- package/dist/esm/segment/schedule-on-paint.js +7 -4
- package/dist/esm/segment/segment.js +9 -5
- package/dist/esm/self-measurements/index.js +246 -0
- package/dist/esm/set-interaction-error/index.js +3 -2
- package/dist/esm/short-id/index.js +4 -2
- package/dist/esm/ssr/index.js +17 -16
- package/dist/esm/trace-interaction/index.js +6 -4
- package/dist/esm/trace-pageload/index.js +6 -4
- package/dist/esm/trace-press/index.js +4 -2
- package/dist/esm/trace-redirect/index.js +4 -2
- package/dist/esm/trace-transition/index.js +5 -3
- package/dist/esm/trace-transition/utils/generate-span-id/index.js +3 -2
- package/dist/esm/trace-transition/utils/set-interaction-active-trace/index.js +3 -2
- package/dist/esm/vc/index.js +16 -4
- package/dist/esm/vc/vc-observer/attachAbortListeners.js +3 -2
- package/dist/esm/vc/vc-observer/getVCRevisionsData.js +40 -25
- package/dist/esm/vc/vc-observer/getViewport.js +5 -4
- package/dist/esm/vc/vc-observer/heatmap/heatmap.js +28 -12
- package/dist/esm/vc/vc-observer/index.js +170 -133
- package/dist/esm/vc/vc-observer/media-wrapper/vc-utils.js +3 -2
- package/dist/esm/vc/vc-observer/observers/editor-lnv/index.js +17 -0
- package/dist/esm/vc/vc-observer/observers/index.js +82 -25
- package/dist/esm/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +4 -7
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/index.js +17 -2
- package/dist/esm/vc/vc-observer/revisions/fy25_01.js +7 -7
- package/dist/esm/vc/vc-observer/revisions/fy25_02.js +2 -0
- package/dist/esm/vc/vc-observer/revisions/revisions.js +3 -2
- package/dist/esm/vc/vc-observer-new/entries-timeline/index.js +9 -0
- package/dist/esm/vc/vc-observer-new/get-element-name.js +4 -2
- package/dist/esm/vc/vc-observer-new/get-unique-element-name.js +12 -10
- package/dist/esm/vc/vc-observer-new/index.js +9 -0
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +2 -0
- package/dist/esm/vc/vc-observer-new/metric-calculator/fy25_03/index.js +6 -1
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +19 -9
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +26 -24
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +18 -6
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +26 -13
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +9 -7
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +49 -39
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +9 -7
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +4 -2
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +4 -2
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +4 -2
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/task-yield.js +10 -7
- package/dist/esm/vc/vc-observer-new/viewport-observer/index.js +15 -7
- package/dist/esm/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +15 -12
- package/dist/esm/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +15 -12
- package/dist/esm/vc/vc-observer-new/viewport-observer/performance-observer/index.js +11 -7
- package/dist/esm/vc/vc-observer-new/window-event-observer/index.js +7 -1
- package/dist/types/additional-payload/utils/cache-hit-ratio/index.d.ts +1 -1
- package/dist/types/additional-payload/utils/lighthouse-metrics/index.d.ts +2 -2
- package/dist/types/assets/index.d.ts +3 -1
- package/dist/types/assets/utils.d.ts +1 -1
- package/dist/types/bundle-eval-timing/index.d.ts +2 -2
- package/dist/types/coinflip/index.d.ts +2 -1
- package/dist/types/common/index.d.ts +2 -1
- package/dist/types/common/react-ufo-payload-schema.d.ts +175 -0
- package/dist/types/common/vc/types.d.ts +20 -10
- package/dist/types/config/index.d.ts +14 -16
- package/dist/types/create-experimental-interaction-metrics-payload/index.d.ts +4 -3
- package/dist/types/create-payload/common/utils/index.d.ts +6 -7
- package/dist/types/create-payload/index.d.ts +1250 -1537
- package/dist/types/create-payload/utils/get-interaction-status.d.ts +2 -1
- package/dist/types/create-payload/utils/get-page-visibility-up-to-ttai.d.ts +2 -1
- package/dist/types/create-payload/utils/get-ssr-done-time-value.d.ts +2 -1
- package/dist/types/create-payload/utils/get-vc-metrics.d.ts +3 -2
- package/dist/types/create-post-interaction-log-payload/index.d.ts +3 -2
- package/dist/types/custom-data/index.d.ts +1 -1
- package/dist/types/custom-mark/index.d.ts +1 -1
- package/dist/types/custom-spans/index.d.ts +1 -1
- package/dist/types/custom-timings/index.d.ts +2 -2
- package/dist/types/generate-id/index.d.ts +2 -1
- package/dist/types/hidden-timing/index.d.ts +1 -1
- package/dist/types/initial-page-load-extra-timing/index.d.ts +2 -2
- package/dist/types/interaction-context/index.d.ts +3 -3
- package/dist/types/interaction-metrics/index.d.ts +42 -42
- package/dist/types/interaction-metrics/post-interaction-log.d.ts +1 -0
- package/dist/types/interaction-metrics-init/schedule-idle-callback.d.ts +2 -1
- package/dist/types/resource-timing/common/utils/config.d.ts +1 -1
- package/dist/types/resource-timing/utils.d.ts +1 -1
- package/dist/types/round-number/index.d.ts +1 -1
- package/dist/types/route-name/index.d.ts +4 -3
- package/dist/types/segment/schedule-on-paint.d.ts +2 -1
- package/dist/types/self-measurements/index.d.ts +57 -0
- package/dist/types/set-interaction-error/index.d.ts +1 -1
- package/dist/types/short-id/index.d.ts +2 -1
- package/dist/types/ssr/index.d.ts +5 -5
- package/dist/types/trace-interaction/index.d.ts +2 -1
- package/dist/types/trace-pageload/index.d.ts +3 -2
- package/dist/types/trace-press/index.d.ts +2 -1
- package/dist/types/trace-redirect/index.d.ts +2 -1
- package/dist/types/trace-transition/index.d.ts +2 -1
- package/dist/types/vc/index.d.ts +2 -2
- package/dist/types/vc/vc-observer/getVCRevisionsData.d.ts +7 -7
- package/dist/types/vc/vc-observer/getViewport.d.ts +2 -2
- package/dist/types/vc/vc-observer/heatmap/heatmap.d.ts +7 -4
- package/dist/types/vc/vc-observer/index.d.ts +4 -4
- package/dist/types/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.d.ts +5 -4
- package/dist/types/vc/vc-observer/observers/types.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/get-element-name.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/get-unique-element-name.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.d.ts +2 -3
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.d.ts +3 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.d.ts +3 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/index.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.d.ts +3 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/task-yield.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/index.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/mutation-observer/index.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/performance-observer/index.d.ts +3 -3
- package/dist/types-ts4.5/additional-payload/utils/cache-hit-ratio/index.d.ts +1 -1
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/index.d.ts +2 -2
- package/dist/types-ts4.5/assets/index.d.ts +3 -1
- package/dist/types-ts4.5/assets/utils.d.ts +1 -1
- package/dist/types-ts4.5/bundle-eval-timing/index.d.ts +2 -2
- package/dist/types-ts4.5/coinflip/index.d.ts +2 -1
- package/dist/types-ts4.5/common/index.d.ts +2 -1
- package/dist/types-ts4.5/common/react-ufo-payload-schema.d.ts +177 -0
- package/dist/types-ts4.5/common/vc/types.d.ts +20 -10
- package/dist/types-ts4.5/config/index.d.ts +14 -20
- package/dist/types-ts4.5/create-experimental-interaction-metrics-payload/index.d.ts +4 -3
- package/dist/types-ts4.5/create-payload/common/utils/index.d.ts +6 -7
- package/dist/types-ts4.5/create-payload/index.d.ts +1250 -1537
- package/dist/types-ts4.5/create-payload/utils/get-interaction-status.d.ts +2 -1
- package/dist/types-ts4.5/create-payload/utils/get-page-visibility-up-to-ttai.d.ts +2 -1
- package/dist/types-ts4.5/create-payload/utils/get-ssr-done-time-value.d.ts +2 -1
- package/dist/types-ts4.5/create-payload/utils/get-vc-metrics.d.ts +3 -2
- package/dist/types-ts4.5/create-post-interaction-log-payload/index.d.ts +3 -2
- package/dist/types-ts4.5/custom-data/index.d.ts +1 -1
- package/dist/types-ts4.5/custom-mark/index.d.ts +1 -1
- package/dist/types-ts4.5/custom-spans/index.d.ts +1 -1
- package/dist/types-ts4.5/custom-timings/index.d.ts +2 -2
- package/dist/types-ts4.5/generate-id/index.d.ts +2 -1
- package/dist/types-ts4.5/hidden-timing/index.d.ts +1 -1
- package/dist/types-ts4.5/initial-page-load-extra-timing/index.d.ts +2 -2
- package/dist/types-ts4.5/interaction-context/index.d.ts +3 -3
- package/dist/types-ts4.5/interaction-metrics/index.d.ts +42 -42
- package/dist/types-ts4.5/interaction-metrics/post-interaction-log.d.ts +1 -0
- package/dist/types-ts4.5/interaction-metrics-init/schedule-idle-callback.d.ts +2 -1
- package/dist/types-ts4.5/resource-timing/common/utils/config.d.ts +1 -1
- package/dist/types-ts4.5/resource-timing/utils.d.ts +1 -1
- package/dist/types-ts4.5/round-number/index.d.ts +1 -1
- package/dist/types-ts4.5/route-name/index.d.ts +4 -3
- package/dist/types-ts4.5/segment/schedule-on-paint.d.ts +2 -1
- package/dist/types-ts4.5/self-measurements/index.d.ts +57 -0
- package/dist/types-ts4.5/set-interaction-error/index.d.ts +1 -1
- package/dist/types-ts4.5/short-id/index.d.ts +2 -1
- package/dist/types-ts4.5/ssr/index.d.ts +5 -5
- package/dist/types-ts4.5/trace-interaction/index.d.ts +2 -1
- package/dist/types-ts4.5/trace-pageload/index.d.ts +3 -2
- package/dist/types-ts4.5/trace-press/index.d.ts +2 -1
- package/dist/types-ts4.5/trace-redirect/index.d.ts +2 -1
- package/dist/types-ts4.5/trace-transition/index.d.ts +2 -1
- package/dist/types-ts4.5/vc/index.d.ts +2 -2
- package/dist/types-ts4.5/vc/vc-observer/getVCRevisionsData.d.ts +7 -7
- package/dist/types-ts4.5/vc/vc-observer/getViewport.d.ts +2 -2
- package/dist/types-ts4.5/vc/vc-observer/heatmap/heatmap.d.ts +7 -4
- package/dist/types-ts4.5/vc/vc-observer/index.d.ts +4 -4
- package/dist/types-ts4.5/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.d.ts +5 -4
- package/dist/types-ts4.5/vc/vc-observer/observers/types.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/get-element-name.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/get-unique-element-name.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.d.ts +2 -3
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.d.ts +3 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.d.ts +3 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/index.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.d.ts +3 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/task-yield.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/mutation-observer/index.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/performance-observer/index.d.ts +3 -3
- package/package.json +12 -12
package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js
CHANGED
|
@@ -5,28 +5,26 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
|
|
|
5
5
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
6
6
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
7
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import { withProfiling } from '../../../../../self-measurements';
|
|
8
9
|
import { ViewportCanvas } from './canvas-pixel';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function _calculateTTVCPercentiles() {
|
|
13
|
-
_calculateTTVCPercentiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
14
|
-
var viewport, orderedEntries, percentiles, startTime, canvas, elementMap, _iterator2, _step2, entry, rect, elementName, timePixelCounts, canvasDimenstions, totalPixels;
|
|
10
|
+
var calculateTTVCPercentiles = withProfiling( /*#__PURE__*/function () {
|
|
11
|
+
var _calculateTTVCPercentiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
12
|
+
var viewport, orderedEntries, percentiles, startTime, canvas, elementMap, _iterator, _step, entry, rect, elementName, timePixelCounts, canvasDimenstions, totalPixels;
|
|
15
13
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
16
14
|
while (1) switch (_context.prev = _context.next) {
|
|
17
15
|
case 0:
|
|
18
16
|
viewport = _ref.viewport, orderedEntries = _ref.orderedEntries, percentiles = _ref.percentiles, startTime = _ref.startTime;
|
|
19
17
|
canvas = new ViewportCanvas(viewport, fg('platform_ufo_canvas_heatmap_full_precision') ? 1 : 0.25);
|
|
20
18
|
elementMap = new Map();
|
|
21
|
-
|
|
19
|
+
_iterator = _createForOfIteratorHelper(orderedEntries);
|
|
22
20
|
_context.prev = 4;
|
|
23
|
-
|
|
21
|
+
_iterator.s();
|
|
24
22
|
case 6:
|
|
25
|
-
if ((
|
|
23
|
+
if ((_step = _iterator.n()).done) {
|
|
26
24
|
_context.next = 17;
|
|
27
25
|
break;
|
|
28
26
|
}
|
|
29
|
-
entry =
|
|
27
|
+
entry = _step.value;
|
|
30
28
|
if ('rect' in entry.data) {
|
|
31
29
|
_context.next = 10;
|
|
32
30
|
break;
|
|
@@ -49,10 +47,10 @@ function _calculateTTVCPercentiles() {
|
|
|
49
47
|
case 19:
|
|
50
48
|
_context.prev = 19;
|
|
51
49
|
_context.t0 = _context["catch"](4);
|
|
52
|
-
|
|
50
|
+
_iterator.e(_context.t0);
|
|
53
51
|
case 22:
|
|
54
52
|
_context.prev = 22;
|
|
55
|
-
|
|
53
|
+
_iterator.f();
|
|
56
54
|
return _context.finish(22);
|
|
57
55
|
case 25:
|
|
58
56
|
_context.next = 27;
|
|
@@ -68,9 +66,13 @@ function _calculateTTVCPercentiles() {
|
|
|
68
66
|
}
|
|
69
67
|
}, _callee, null, [[4, 19, 22, 25]]);
|
|
70
68
|
}));
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
function calculateTTVCPercentiles(_x) {
|
|
70
|
+
return _calculateTTVCPercentiles.apply(this, arguments);
|
|
71
|
+
}
|
|
72
|
+
return calculateTTVCPercentiles;
|
|
73
|
+
}(), ['vc']);
|
|
74
|
+
export default calculateTTVCPercentiles;
|
|
75
|
+
export var calculatePercentiles = withProfiling(function calculatePercentiles(timePixelCounts, elementMap, unorderedPercentiles, totalPixels, startTime) {
|
|
74
76
|
var results = {};
|
|
75
77
|
var cumulativePixels = 0;
|
|
76
78
|
var percentiles = unorderedPercentiles.sort(function (a, b) {
|
|
@@ -87,13 +89,13 @@ export function calculatePercentiles(timePixelCounts, elementMap, unorderedPerce
|
|
|
87
89
|
});
|
|
88
90
|
var percentileIndex = 0;
|
|
89
91
|
var domElementsBuffer = new Set();
|
|
90
|
-
var
|
|
91
|
-
|
|
92
|
+
var _iterator2 = _createForOfIteratorHelper(sortedEntries),
|
|
93
|
+
_step2;
|
|
92
94
|
try {
|
|
93
|
-
for (
|
|
94
|
-
var
|
|
95
|
-
time =
|
|
96
|
-
pixelCount =
|
|
95
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
96
|
+
var _step2$value = _slicedToArray(_step2.value, 2),
|
|
97
|
+
time = _step2$value[0],
|
|
98
|
+
pixelCount = _step2$value[1];
|
|
97
99
|
cumulativePixels += pixelCount;
|
|
98
100
|
var percentCovered = cumulativePixels / totalPixels * 100;
|
|
99
101
|
var elementNames = elementMap.get(time) || new Set();
|
|
@@ -117,9 +119,9 @@ export function calculatePercentiles(timePixelCounts, elementMap, unorderedPerce
|
|
|
117
119
|
}
|
|
118
120
|
}
|
|
119
121
|
} catch (err) {
|
|
120
|
-
|
|
122
|
+
_iterator2.e(err);
|
|
121
123
|
} finally {
|
|
122
|
-
|
|
124
|
+
_iterator2.f();
|
|
123
125
|
}
|
|
124
126
|
var previousResult = {
|
|
125
127
|
t: 0,
|
|
@@ -133,4 +135,4 @@ export function calculatePercentiles(timePixelCounts, elementMap, unorderedPerce
|
|
|
133
135
|
previousResult = results["".concat(percentile)];
|
|
134
136
|
}
|
|
135
137
|
return results;
|
|
136
|
-
}
|
|
138
|
+
}, ['vc']);
|
|
@@ -6,16 +6,17 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
6
6
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
7
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
8
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
|
+
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../../../self-measurements';
|
|
9
10
|
import isViewportEntryData from '../../utils/is-viewport-entry-data';
|
|
10
11
|
import taskYield from '../../utils/task-yield';
|
|
11
12
|
var MAX_HEATMAP_SIZE = 1000;
|
|
12
|
-
function createEmptyHeatmapEntry() {
|
|
13
|
+
var createEmptyHeatmapEntry = withProfiling(function createEmptyHeatmapEntry() {
|
|
13
14
|
return {
|
|
14
15
|
head: null,
|
|
15
16
|
previousEntries: []
|
|
16
17
|
};
|
|
17
|
-
}
|
|
18
|
-
function createEmptyMap(heatmapWidth, heatmapHeight) {
|
|
18
|
+
}, ['vc']);
|
|
19
|
+
var createEmptyMap = withProfiling(function createEmptyMap(heatmapWidth, heatmapHeight) {
|
|
19
20
|
return Array.from({
|
|
20
21
|
length: heatmapHeight
|
|
21
22
|
}).map(function () {
|
|
@@ -23,15 +24,15 @@ function createEmptyMap(heatmapWidth, heatmapHeight) {
|
|
|
23
24
|
length: heatmapWidth
|
|
24
25
|
}).map(createEmptyHeatmapEntry);
|
|
25
26
|
});
|
|
26
|
-
}
|
|
27
|
-
function isRectInside(a, b) {
|
|
27
|
+
}, ['vc']);
|
|
28
|
+
var isRectInside = withProfiling(function isRectInside(a, b) {
|
|
28
29
|
if (!a || !b) {
|
|
29
30
|
return false;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
// Check if all corners of rectangle a are within the bounds of rectangle b
|
|
33
34
|
return a.left >= b.left && a.right <= b.right && a.top >= b.top && a.bottom <= b.bottom;
|
|
34
|
-
}
|
|
35
|
+
}, ['vc']);
|
|
35
36
|
var Heatmap = /*#__PURE__*/function () {
|
|
36
37
|
/**
|
|
37
38
|
* Heatmap Width
|
|
@@ -49,6 +50,8 @@ var Heatmap = /*#__PURE__*/function () {
|
|
|
49
50
|
var viewport = _ref.viewport,
|
|
50
51
|
heatmapSize = _ref.heatmapSize;
|
|
51
52
|
_classCallCheck(this, Heatmap);
|
|
53
|
+
var operationTimer = markProfilingStart('Heatmap constructor');
|
|
54
|
+
|
|
52
55
|
// TODO timeOrigin? do we need? for SSR??
|
|
53
56
|
this.viewport = viewport;
|
|
54
57
|
var safeSize = Math.min(heatmapSize, MAX_HEATMAP_SIZE);
|
|
@@ -75,6 +78,15 @@ var Heatmap = /*#__PURE__*/function () {
|
|
|
75
78
|
this.scaleY = this.height / viewport.height;
|
|
76
79
|
this.heatmapAreaSize = this.width * this.height;
|
|
77
80
|
this.map = createEmptyMap(this.width, this.height);
|
|
81
|
+
this.getHeatmap = withProfiling(this.getHeatmap.bind(this), ['vc']);
|
|
82
|
+
this.getCell = withProfiling(this.getCell.bind(this), ['vc']);
|
|
83
|
+
this.mapDOMRectToHeatmap = withProfiling(this.mapDOMRectToHeatmap.bind(this), ['vc']);
|
|
84
|
+
this.getRatio = withProfiling(this.getRatio.bind(this), ['vc']);
|
|
85
|
+
this.applyEntriesToHeatmap = withProfiling(this.applyEntriesToHeatmap.bind(this), ['vc']);
|
|
86
|
+
this.getVCPercentMetrics = withProfiling(this.getVCPercentMetrics.bind(this), ['vc']);
|
|
87
|
+
markProfilingEnd(operationTimer, {
|
|
88
|
+
tags: ['vc']
|
|
89
|
+
});
|
|
78
90
|
}
|
|
79
91
|
return _createClass(Heatmap, [{
|
|
80
92
|
key: "getHeatmap",
|
|
@@ -6,16 +6,17 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
6
6
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
7
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
8
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
|
+
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../../../self-measurements';
|
|
9
10
|
import isViewportEntryData from '../../utils/is-viewport-entry-data';
|
|
10
11
|
import taskYield from '../../utils/task-yield';
|
|
11
12
|
var MAX_HEATMAP_SIZE = 1000;
|
|
12
|
-
function createEmptyHeatmapEntry() {
|
|
13
|
+
var createEmptyHeatmapEntry = withProfiling(function createEmptyHeatmapEntry() {
|
|
13
14
|
return {
|
|
14
15
|
head: null,
|
|
15
16
|
previousEntries: []
|
|
16
17
|
};
|
|
17
|
-
}
|
|
18
|
-
function createEmptyMap(heatmapWidth, heatmapHeight) {
|
|
18
|
+
}, ['vc']);
|
|
19
|
+
var createEmptyMap = withProfiling(function createEmptyMap(heatmapWidth, heatmapHeight) {
|
|
19
20
|
return Array.from({
|
|
20
21
|
length: heatmapHeight
|
|
21
22
|
}).map(function () {
|
|
@@ -23,15 +24,15 @@ function createEmptyMap(heatmapWidth, heatmapHeight) {
|
|
|
23
24
|
length: heatmapWidth
|
|
24
25
|
}).map(createEmptyHeatmapEntry);
|
|
25
26
|
});
|
|
26
|
-
}
|
|
27
|
-
function isRectInside(a, b) {
|
|
27
|
+
}, ['vc']);
|
|
28
|
+
var isRectInside = withProfiling(function isRectInside(a, b) {
|
|
28
29
|
if (!a || !b) {
|
|
29
30
|
return false;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
// Check if all corners of rectangle a are within the bounds of rectangle b
|
|
33
34
|
return a.left >= b.left && a.right <= b.right && a.top >= b.top && a.bottom <= b.bottom;
|
|
34
|
-
}
|
|
35
|
+
}, ['vc']);
|
|
35
36
|
var Heatmap = /*#__PURE__*/function () {
|
|
36
37
|
/**
|
|
37
38
|
* Heatmap Width
|
|
@@ -49,6 +50,8 @@ var Heatmap = /*#__PURE__*/function () {
|
|
|
49
50
|
var viewport = _ref.viewport,
|
|
50
51
|
heatmapSize = _ref.heatmapSize;
|
|
51
52
|
_classCallCheck(this, Heatmap);
|
|
53
|
+
var operationTimer = markProfilingStart('Heatmap constructor');
|
|
54
|
+
|
|
52
55
|
// TODO timeOrigin? do we need? for SSR??
|
|
53
56
|
this.viewport = viewport;
|
|
54
57
|
var safeSize = Math.min(heatmapSize, MAX_HEATMAP_SIZE);
|
|
@@ -75,6 +78,15 @@ var Heatmap = /*#__PURE__*/function () {
|
|
|
75
78
|
this.scaleY = this.height / viewport.height;
|
|
76
79
|
this.heatmapAreaSize = this.width * this.height;
|
|
77
80
|
this.map = createEmptyMap(this.width, this.height);
|
|
81
|
+
this.getHeatmap = withProfiling(this.getHeatmap.bind(this), ['vc']);
|
|
82
|
+
this.getCell = withProfiling(this.getCell.bind(this), ['vc']);
|
|
83
|
+
this.mapDOMRectToHeatmap = withProfiling(this.mapDOMRectToHeatmap.bind(this), ['vc']);
|
|
84
|
+
this.getRatio = withProfiling(this.getRatio.bind(this), ['vc']);
|
|
85
|
+
this.applyEntriesToHeatmap = withProfiling(this.applyEntriesToHeatmap.bind(this), ['vc']);
|
|
86
|
+
this.getVCPercentMetrics = withProfiling(this.getVCPercentMetrics.bind(this), ['vc']);
|
|
87
|
+
markProfilingEnd(operationTimer, {
|
|
88
|
+
tags: ['vc']
|
|
89
|
+
});
|
|
78
90
|
}
|
|
79
91
|
return _createClass(Heatmap, [{
|
|
80
92
|
key: "getHeatmap",
|
|
@@ -358,11 +370,8 @@ var Heatmap = /*#__PURE__*/function () {
|
|
|
358
370
|
}()
|
|
359
371
|
}]);
|
|
360
372
|
}();
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
}
|
|
364
|
-
function _calculateTTVCPercentiles() {
|
|
365
|
-
_calculateTTVCPercentiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref2) {
|
|
373
|
+
var calculateTTVCPercentiles = withProfiling( /*#__PURE__*/function () {
|
|
374
|
+
var _calculateTTVCPercentiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref2) {
|
|
366
375
|
var orderedEntries, viewport, percentiles, startTime, heatmap, vcDetails;
|
|
367
376
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
368
377
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -386,5 +395,9 @@ function _calculateTTVCPercentiles() {
|
|
|
386
395
|
}
|
|
387
396
|
}, _callee3);
|
|
388
397
|
}));
|
|
389
|
-
|
|
390
|
-
|
|
398
|
+
function calculateTTVCPercentiles(_x4) {
|
|
399
|
+
return _calculateTTVCPercentiles.apply(this, arguments);
|
|
400
|
+
}
|
|
401
|
+
return calculateTTVCPercentiles;
|
|
402
|
+
}(), ['vc']);
|
|
403
|
+
export default calculateTTVCPercentiles;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
import { withProfiling } from '../../../../self-measurements';
|
|
3
4
|
import calcUsingCanvas from './canvas-heatmap';
|
|
4
5
|
import caclUsingOldHeatmap from './heatmap';
|
|
5
6
|
import calcUsingRectSweepingLine from './rect-sweeping-line';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
function _calculateTTVCPercentiles() {
|
|
10
|
-
_calculateTTVCPercentiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(arg) {
|
|
7
|
+
var calculateTTVCPercentiles = withProfiling( /*#__PURE__*/function () {
|
|
8
|
+
var _calculateTTVCPercentiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(arg) {
|
|
11
9
|
var algo, vcDetails, _vcDetails, _vcDetails2;
|
|
12
10
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
13
11
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -50,5 +48,9 @@ function _calculateTTVCPercentiles() {
|
|
|
50
48
|
}
|
|
51
49
|
}, _callee);
|
|
52
50
|
}));
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
function calculateTTVCPercentiles(_x) {
|
|
52
|
+
return _calculateTTVCPercentiles.apply(this, arguments);
|
|
53
|
+
}
|
|
54
|
+
return calculateTTVCPercentiles;
|
|
55
|
+
}(), ['vc']);
|
|
56
|
+
export default calculateTTVCPercentiles;
|
|
@@ -3,6 +3,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
3
3
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
4
4
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
5
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6
|
+
import { withProfiling } from '../../../../../self-measurements';
|
|
6
7
|
/**
|
|
7
8
|
* Calculate the union areas of all rectangles using Sweep Line Algorithm
|
|
8
9
|
*
|
|
@@ -13,7 +14,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
13
14
|
* @param rectangles
|
|
14
15
|
* @returns
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
+
var calculateUnionArea = withProfiling(function calculateUnionArea(rectangles) {
|
|
17
18
|
// Step 1: Create sweep line events
|
|
18
19
|
var events = createSweepLineEvents(rectangles);
|
|
19
20
|
|
|
@@ -21,26 +22,35 @@ export default function calculateUnionArea(rectangles) {
|
|
|
21
22
|
var activeIntervals = new Map();
|
|
22
23
|
var totalArea = 0;
|
|
23
24
|
var previousX = 0;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
var _iterator = _createForOfIteratorHelper(events),
|
|
26
|
+
_step;
|
|
27
|
+
try {
|
|
28
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
29
|
+
var event = _step.value;
|
|
30
|
+
// Calculate height at current x-position
|
|
31
|
+
var currentHeight = calculateActiveHeight(activeIntervals);
|
|
32
|
+
// Add area since last x-position
|
|
33
|
+
totalArea += currentHeight * (event.x - previousX);
|
|
34
|
+
// Update x-position
|
|
35
|
+
previousX = event.x;
|
|
36
|
+
// Update active intervals
|
|
37
|
+
updateActiveIntervals(activeIntervals, event);
|
|
38
|
+
}
|
|
39
|
+
} catch (err) {
|
|
40
|
+
_iterator.e(err);
|
|
41
|
+
} finally {
|
|
42
|
+
_iterator.f();
|
|
34
43
|
}
|
|
35
44
|
return totalArea;
|
|
36
|
-
}
|
|
37
|
-
|
|
45
|
+
}, ['vc']);
|
|
46
|
+
export default calculateUnionArea;
|
|
47
|
+
var createSweepLineEvents = withProfiling(function createSweepLineEvents(rectangles) {
|
|
38
48
|
var events = [];
|
|
39
|
-
var
|
|
40
|
-
|
|
49
|
+
var _iterator2 = _createForOfIteratorHelper(rectangles),
|
|
50
|
+
_step2;
|
|
41
51
|
try {
|
|
42
|
-
for (
|
|
43
|
-
var rect =
|
|
52
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
53
|
+
var rect = _step2.value;
|
|
44
54
|
// Create start and end events for each rectangle
|
|
45
55
|
events.push({
|
|
46
56
|
x: rect.left,
|
|
@@ -57,26 +67,26 @@ function createSweepLineEvents(rectangles) {
|
|
|
57
67
|
}
|
|
58
68
|
// Sort events by x-coordinate (and type as tiebreaker)
|
|
59
69
|
} catch (err) {
|
|
60
|
-
|
|
70
|
+
_iterator2.e(err);
|
|
61
71
|
} finally {
|
|
62
|
-
|
|
72
|
+
_iterator2.f();
|
|
63
73
|
}
|
|
64
74
|
return events.sort(function (a, b) {
|
|
65
75
|
return a.x === b.x ? a.type === 'end' ? 1 : -1 : a.x - b.x;
|
|
66
76
|
});
|
|
67
|
-
}
|
|
68
|
-
function calculateActiveHeight(intervals) {
|
|
77
|
+
}, ['vc']);
|
|
78
|
+
var calculateActiveHeight = withProfiling(function calculateActiveHeight(intervals) {
|
|
69
79
|
if (intervals.size === 0) {
|
|
70
80
|
return 0;
|
|
71
81
|
}
|
|
72
82
|
// Get all unique y-coordinates
|
|
73
83
|
var coordinates = [];
|
|
74
|
-
var
|
|
75
|
-
|
|
84
|
+
var _iterator3 = _createForOfIteratorHelper(intervals),
|
|
85
|
+
_step3;
|
|
76
86
|
try {
|
|
77
|
-
for (
|
|
78
|
-
var
|
|
79
|
-
_key =
|
|
87
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
88
|
+
var _step3$value = _slicedToArray(_step3.value, 1),
|
|
89
|
+
_key = _step3$value[0];
|
|
80
90
|
var _key$split$map3 = _key.split(',').map(Number),
|
|
81
91
|
_key$split$map4 = _slicedToArray(_key$split$map3, 2),
|
|
82
92
|
_start = _key$split$map4[0],
|
|
@@ -85,9 +95,9 @@ function calculateActiveHeight(intervals) {
|
|
|
85
95
|
}
|
|
86
96
|
// Sort coordinates
|
|
87
97
|
} catch (err) {
|
|
88
|
-
|
|
98
|
+
_iterator3.e(err);
|
|
89
99
|
} finally {
|
|
90
|
-
|
|
100
|
+
_iterator3.f();
|
|
91
101
|
}
|
|
92
102
|
var sortedCoords = _toConsumableArray(new Set(coordinates)).sort(function (a, b) {
|
|
93
103
|
return a - b;
|
|
@@ -99,13 +109,13 @@ function calculateActiveHeight(intervals) {
|
|
|
99
109
|
var y2 = sortedCoords[i + 1];
|
|
100
110
|
// Check if this segment is covered by any active interval
|
|
101
111
|
var covered = false;
|
|
102
|
-
var
|
|
103
|
-
|
|
112
|
+
var _iterator4 = _createForOfIteratorHelper(intervals),
|
|
113
|
+
_step4;
|
|
104
114
|
try {
|
|
105
|
-
for (
|
|
106
|
-
var
|
|
107
|
-
key =
|
|
108
|
-
count =
|
|
115
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
116
|
+
var _step4$value = _slicedToArray(_step4.value, 2),
|
|
117
|
+
key = _step4$value[0],
|
|
118
|
+
count = _step4$value[1];
|
|
109
119
|
if (count <= 0) {
|
|
110
120
|
continue;
|
|
111
121
|
}
|
|
@@ -119,17 +129,17 @@ function calculateActiveHeight(intervals) {
|
|
|
119
129
|
}
|
|
120
130
|
}
|
|
121
131
|
} catch (err) {
|
|
122
|
-
|
|
132
|
+
_iterator4.e(err);
|
|
123
133
|
} finally {
|
|
124
|
-
|
|
134
|
+
_iterator4.f();
|
|
125
135
|
}
|
|
126
136
|
if (covered) {
|
|
127
137
|
totalHeight += y2 - y1;
|
|
128
138
|
}
|
|
129
139
|
}
|
|
130
140
|
return totalHeight;
|
|
131
|
-
}
|
|
132
|
-
function updateActiveIntervals(intervals, event) {
|
|
141
|
+
}, ['vc']);
|
|
142
|
+
var updateActiveIntervals = withProfiling(function updateActiveIntervals(intervals, event) {
|
|
133
143
|
var key = "".concat(event.top, ",").concat(event.bottom);
|
|
134
144
|
if (event.type === 'start') {
|
|
135
145
|
intervals.set(key, (intervals.get(key) || 0) + 1);
|
|
@@ -141,4 +151,4 @@ function updateActiveIntervals(intervals, event) {
|
|
|
141
151
|
intervals.delete(key);
|
|
142
152
|
}
|
|
143
153
|
}
|
|
144
|
-
}
|
|
154
|
+
}, ['vc']);
|
package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
+
import { withProfiling } from '../../../../../self-measurements';
|
|
4
5
|
import isViewportEntryData from '../../utils/is-viewport-entry-data';
|
|
5
6
|
import taskYield from '../../utils/task-yield';
|
|
6
7
|
import calculateUnionArea from './calc-union-area';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
function _calculateTTVCPercentiles() {
|
|
11
|
-
_calculateTTVCPercentiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
8
|
+
var calculateTTVCPercentiles = withProfiling( /*#__PURE__*/function () {
|
|
9
|
+
var _calculateTTVCPercentiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
12
10
|
var orderedEntries, viewport, percentiles, startTime, sortedPercentiles, viewportArea, checkpoints, activeRects, removeActiveRect, domElementsBuffer, i, iEntry, iEntryData, rect, elementName, exclusionArea, currentArea, currVCPercent, matchesAnyCheckpoints, _checkpoint, domElements;
|
|
13
11
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
14
12
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -96,5 +94,9 @@ function _calculateTTVCPercentiles() {
|
|
|
96
94
|
}
|
|
97
95
|
}, _callee);
|
|
98
96
|
}));
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
function calculateTTVCPercentiles(_x) {
|
|
98
|
+
return _calculateTTVCPercentiles.apply(this, arguments);
|
|
99
|
+
}
|
|
100
|
+
return calculateTTVCPercentiles;
|
|
101
|
+
}(), ['vc']);
|
|
102
|
+
export default calculateTTVCPercentiles;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { withProfiling } from '../../../../self-measurements';
|
|
2
|
+
var getViewportHeight = withProfiling(function getViewportHeight() {
|
|
2
3
|
var document = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.document;
|
|
3
4
|
var documentHeight;
|
|
4
5
|
try {
|
|
@@ -7,4 +8,5 @@ export default function getViewportHeight() {
|
|
|
7
8
|
documentHeight = 0;
|
|
8
9
|
}
|
|
9
10
|
return Math.max(documentHeight, window.innerHeight || 0);
|
|
10
|
-
}
|
|
11
|
+
}, ['vc']);
|
|
12
|
+
export default getViewportHeight;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { withProfiling } from '../../../../self-measurements';
|
|
2
|
+
var getViewportWidth = withProfiling(function getViewportWidth() {
|
|
2
3
|
var document = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.document;
|
|
3
4
|
var documentWidth;
|
|
4
5
|
try {
|
|
@@ -7,4 +8,5 @@ export default function getViewportWidth() {
|
|
|
7
8
|
documentWidth = 0;
|
|
8
9
|
}
|
|
9
10
|
return Math.max(documentWidth, window.innerWidth || 0);
|
|
10
|
-
}
|
|
11
|
+
}, ['vc']);
|
|
12
|
+
export default getViewportWidth;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { withProfiling } from '../../../../self-measurements';
|
|
2
|
+
var isViewportEntryData = withProfiling(function isViewportEntryData(data) {
|
|
2
3
|
if (data) {
|
|
3
4
|
var hasElementName = typeof data.elementName === 'string';
|
|
4
5
|
var hasRect = typeof data.rect !== 'undefined';
|
|
@@ -7,4 +8,5 @@ export default function isViewportEntryData(data) {
|
|
|
7
8
|
}
|
|
8
9
|
}
|
|
9
10
|
return false;
|
|
10
|
-
}
|
|
11
|
+
}, ['vc']);
|
|
12
|
+
export default isViewportEntryData;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
import { withProfiling } from '../../../../self-measurements';
|
|
4
|
+
|
|
3
5
|
// See https://developer.mozilla.org/en-US/docs/Web/API/Prioritized_Task_Scheduling_API
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
function _taskYield() {
|
|
8
|
-
_taskYield = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
6
|
+
var taskYield = withProfiling( /*#__PURE__*/function () {
|
|
7
|
+
var _taskYield = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
9
8
|
var resolve, p;
|
|
10
9
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
11
10
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -34,5 +33,9 @@ function _taskYield() {
|
|
|
34
33
|
}
|
|
35
34
|
}, _callee);
|
|
36
35
|
}));
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
function taskYield() {
|
|
37
|
+
return _taskYield.apply(this, arguments);
|
|
38
|
+
}
|
|
39
|
+
return taskYield;
|
|
40
|
+
}(), ['vc']);
|
|
41
|
+
export default taskYield;
|
|
@@ -3,12 +3,13 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
3
3
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
4
4
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
5
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6
|
+
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../self-measurements';
|
|
6
7
|
import { isContainedWithinMediaWrapper } from '../../vc-observer/media-wrapper/vc-utils';
|
|
7
8
|
import isNonVisualStyleMutation from '../../vc-observer/observers/non-visual-styles/is-non-visual-style-mutation';
|
|
8
9
|
import { createIntersectionObserver } from './intersection-observer';
|
|
9
10
|
import createMutationObserver from './mutation-observer';
|
|
10
11
|
import createPerformanceObserver from './performance-observer';
|
|
11
|
-
function isElementVisible(element) {
|
|
12
|
+
var isElementVisible = withProfiling(function isElementVisible(element) {
|
|
12
13
|
if (!(element instanceof HTMLElement)) {
|
|
13
14
|
return true;
|
|
14
15
|
}
|
|
@@ -24,24 +25,26 @@ function isElementVisible(element) {
|
|
|
24
25
|
// there is no support for checkVisibility
|
|
25
26
|
return true;
|
|
26
27
|
}
|
|
27
|
-
}
|
|
28
|
-
function sameRectSize(a, b) {
|
|
28
|
+
}, ['vc']);
|
|
29
|
+
var sameRectSize = withProfiling(function sameRectSize(a, b) {
|
|
29
30
|
if (!a || !b) {
|
|
30
31
|
return false;
|
|
31
32
|
}
|
|
32
33
|
return a.width === b.width && a.height === b.height;
|
|
33
|
-
}
|
|
34
|
-
function sameRectDimensions(a, b) {
|
|
34
|
+
}, ['vc']);
|
|
35
|
+
var sameRectDimensions = withProfiling(function sameRectDimensions(a, b) {
|
|
35
36
|
if (!a || !b) {
|
|
36
37
|
return false;
|
|
37
38
|
}
|
|
38
39
|
return a.width === b.width && a.height === b.height && a.x === b.x && a.y === b.y;
|
|
39
|
-
}
|
|
40
|
+
}, ['vc']);
|
|
40
41
|
var ViewportObserver = /*#__PURE__*/function () {
|
|
41
42
|
function ViewportObserver(_ref) {
|
|
42
43
|
var _this = this;
|
|
43
|
-
var
|
|
44
|
+
var _onChange = _ref.onChange;
|
|
44
45
|
_classCallCheck(this, ViewportObserver);
|
|
46
|
+
var onChange = withProfiling(_onChange, ['vc']);
|
|
47
|
+
var operationTimer = markProfilingStart('ViewportObserver constructor');
|
|
45
48
|
this.mapVisibleNodeRects = new WeakMap();
|
|
46
49
|
this.intersectionObserver = createIntersectionObserver({
|
|
47
50
|
onEntry: function onEntry(_ref2) {
|
|
@@ -179,6 +182,11 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
179
182
|
}
|
|
180
183
|
}
|
|
181
184
|
});
|
|
185
|
+
this.start = withProfiling(this.start.bind(this), ['vc']);
|
|
186
|
+
this.stop = withProfiling(this.stop.bind(this), ['vc']);
|
|
187
|
+
markProfilingEnd(operationTimer, {
|
|
188
|
+
tags: ['vc']
|
|
189
|
+
});
|
|
182
190
|
}
|
|
183
191
|
return _createClass(ViewportObserver, [{
|
|
184
192
|
key: "start",
|