@atlaskit/react-ufo 1.1.0 → 2.0.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 +32 -0
- package/README.md +5 -0
- package/additional-payload/package.json +15 -0
- package/bundle-eval-timing/package.json +15 -0
- package/coinflip/package.json +15 -0
- package/common/package.json +5 -5
- package/config/package.json +15 -0
- package/create-payload/package.json +15 -0
- package/create-post-interaction-log-payload/package.json +15 -0
- package/custom-data/package.json +15 -0
- package/custom-mark/package.json +15 -0
- package/custom-spans/package.json +15 -0
- package/custom-timings/package.json +15 -0
- package/dist/cjs/additional-payload/index.js +25 -0
- package/dist/cjs/additional-payload/utils/cache-hit-ratio/index.js +69 -0
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/cls/index.js +53 -0
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/const.js +10 -0
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/index.js +29 -0
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/tbt/index.js +25 -0
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +38 -0
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +37 -0
- package/dist/cjs/bundle-eval-timing/index.js +48 -0
- package/dist/cjs/coinflip/index.js +22 -0
- package/dist/cjs/common/common/types.js +5 -0
- package/dist/cjs/common/constants.js +7 -0
- package/dist/cjs/common/index.js +1 -0
- package/dist/cjs/common/vc/types.js +11 -0
- package/dist/cjs/config/index.js +222 -0
- package/dist/cjs/create-payload/common/types.js +1 -0
- package/dist/cjs/create-payload/common/utils/index.js +15 -0
- package/dist/cjs/create-payload/index.js +784 -0
- package/dist/cjs/create-post-interaction-log-payload/index.js +207 -0
- package/dist/cjs/custom-data/index.js +31 -0
- package/dist/cjs/custom-data/types.js +5 -0
- package/dist/cjs/custom-mark/index.js +45 -0
- package/dist/cjs/custom-spans/index.js +14 -0
- package/dist/cjs/custom-timings/index.js +65 -0
- package/dist/cjs/experience-trace-id-context/index.js +40 -0
- package/dist/cjs/experience-trace-id-context/types.js +1 -0
- package/dist/cjs/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +12 -0
- package/dist/cjs/feature-flags-accessed/common/constants.js +7 -0
- package/dist/cjs/feature-flags-accessed/common/types.js +5 -0
- package/dist/cjs/feature-flags-accessed/common/utils/index.js +38 -0
- package/dist/cjs/feature-flags-accessed/index.js +32 -0
- package/dist/cjs/generate-id/index.js +12 -0
- package/dist/cjs/global-error-handler/index.js +74 -0
- package/dist/cjs/hidden-timing/index.js +94 -0
- package/dist/cjs/initial-page-load-extra-timing/index.js +49 -0
- package/dist/cjs/interaction-context/index.js +14 -0
- package/dist/cjs/interaction-id-context/index.js +27 -0
- package/dist/cjs/interaction-metrics/common/constants.js +8 -0
- package/dist/cjs/interaction-metrics/index.js +810 -1
- package/dist/cjs/interaction-metrics/post-interaction-log.js +190 -0
- package/dist/cjs/interaction-metrics-init/index.js +89 -0
- package/dist/cjs/label/UFOLabel.js +45 -0
- package/dist/cjs/label/index.js +9 -0
- package/dist/cjs/load-hold/UFOLoadHold.js +76 -0
- package/dist/cjs/load-hold/index.js +9 -0
- package/dist/cjs/placeholder/Placeholder.js +34 -0
- package/dist/cjs/placeholder/index.js +9 -0
- package/dist/cjs/placeholder/loosely-lazy/index.js +19 -0
- package/dist/cjs/placeholder/loosely-lazy/lazy-suspense.js +80 -0
- package/dist/cjs/placeholder/loosely-lazy/types.js +5 -0
- package/dist/cjs/placeholder/loosely-lazy/wait-context.js +15 -0
- package/dist/cjs/resource-timing/common/types.js +1 -0
- package/dist/cjs/resource-timing/common/utils/config.js +70 -0
- package/dist/cjs/resource-timing/common/utils/resource-timing-buffer.js +111 -0
- package/dist/cjs/resource-timing/index.js +26 -0
- package/dist/cjs/resource-timing/main.js +141 -0
- package/dist/cjs/resource-timing/utils.js +10 -0
- package/dist/cjs/round-number/index.js +11 -0
- package/dist/cjs/route-name/index.js +12 -0
- package/dist/cjs/route-name-context/index.js +11 -0
- package/dist/cjs/segment/index.js +9 -0
- package/dist/cjs/segment/segment-highlight.js +40 -0
- package/dist/cjs/segment/segment.js +247 -0
- package/dist/cjs/set-interaction-error/index.js +17 -0
- package/dist/cjs/short-id/index.js +15 -0
- package/dist/cjs/ssr/index.js +70 -0
- package/dist/cjs/trace-interaction/index.js +48 -0
- package/dist/cjs/trace-pageload/index.js +58 -0
- package/dist/cjs/trace-press/index.js +34 -0
- package/dist/cjs/trace-redirect/index.js +17 -0
- package/dist/cjs/trace-transition/index.js +60 -0
- package/dist/cjs/trace-transition/utils/generate-span-id/index.js +11 -0
- package/dist/cjs/trace-transition/utils/set-interaction-active-trace/index.js +11 -0
- package/dist/cjs/typing-performance-tracing/index.js +262 -0
- package/dist/cjs/use-press-tracing/index.js +19 -0
- package/dist/cjs/vc/index.js +15 -0
- package/dist/cjs/vc/vc-observer/attachAbortListeners.js +40 -0
- package/dist/cjs/vc/vc-observer/getViewport.js +27 -0
- package/dist/cjs/vc/vc-observer/index.js +562 -0
- package/dist/cjs/vc/vc-observer/media-wrapper/index.js +15 -0
- package/dist/cjs/vc/vc-observer/media-wrapper/vc-utils.js +16 -0
- package/dist/cjs/vc/vc-observer/observers/index.js +270 -0
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/index.js +183 -0
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/bindAbortListeners.js +22 -0
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/collectSSRPlaceholderDimensions.js +20 -0
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/index.js +19 -0
- package/dist/cjs/vc/vc-observer/observers/types.js +5 -0
- package/dist/es2019/additional-payload/index.js +2 -0
- package/dist/es2019/additional-payload/utils/cache-hit-ratio/index.js +63 -0
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/cls/index.js +33 -0
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/const.js +4 -0
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/index.js +23 -0
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/tbt/index.js +15 -0
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +23 -0
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +31 -0
- package/dist/es2019/bundle-eval-timing/index.js +43 -0
- package/dist/es2019/coinflip/index.js +16 -0
- package/dist/es2019/common/common/types.js +1 -0
- package/dist/es2019/common/constants.js +1 -0
- package/dist/es2019/common/vc/types.js +5 -0
- package/dist/es2019/config/index.js +215 -0
- package/dist/es2019/create-payload/common/types.js +0 -0
- package/dist/es2019/create-payload/common/utils/index.js +8 -0
- package/dist/es2019/create-payload/index.js +792 -0
- package/dist/es2019/create-post-interaction-log-payload/index.js +188 -0
- package/dist/es2019/custom-data/index.js +24 -0
- package/dist/es2019/custom-data/types.js +1 -0
- package/dist/es2019/custom-mark/index.js +38 -0
- package/dist/es2019/custom-spans/index.js +6 -0
- package/dist/es2019/custom-timings/index.js +57 -0
- package/dist/es2019/experience-trace-id-context/index.js +31 -0
- package/dist/es2019/experience-trace-id-context/types.js +0 -0
- package/dist/es2019/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +4 -0
- package/dist/es2019/feature-flags-accessed/common/constants.js +1 -0
- package/dist/es2019/feature-flags-accessed/common/types.js +1 -0
- package/dist/es2019/feature-flags-accessed/common/utils/index.js +24 -0
- package/dist/es2019/feature-flags-accessed/index.js +21 -0
- package/dist/es2019/generate-id/index.js +6 -0
- package/dist/es2019/global-error-handler/index.js +64 -0
- package/dist/es2019/hidden-timing/index.js +87 -0
- package/dist/es2019/initial-page-load-extra-timing/index.js +43 -0
- package/dist/es2019/interaction-context/index.js +6 -0
- package/dist/es2019/interaction-id-context/index.js +18 -0
- package/dist/es2019/interaction-metrics/common/constants.js +2 -0
- package/dist/es2019/interaction-metrics/index.js +736 -0
- package/dist/es2019/interaction-metrics/post-interaction-log.js +158 -0
- package/dist/es2019/interaction-metrics-init/index.js +72 -0
- package/dist/es2019/label/UFOLabel.js +34 -0
- package/dist/es2019/label/index.js +2 -0
- package/dist/es2019/load-hold/UFOLoadHold.js +66 -0
- package/dist/es2019/load-hold/index.js +2 -0
- package/dist/es2019/placeholder/Placeholder.js +25 -0
- package/dist/es2019/placeholder/index.js +2 -0
- package/dist/es2019/placeholder/loosely-lazy/index.js +2 -0
- package/dist/es2019/placeholder/loosely-lazy/lazy-suspense.js +63 -0
- package/dist/es2019/placeholder/loosely-lazy/types.js +1 -0
- package/dist/es2019/placeholder/loosely-lazy/wait-context.js +5 -0
- package/dist/es2019/resource-timing/common/types.js +0 -0
- package/dist/es2019/resource-timing/common/utils/config.js +44 -0
- package/dist/es2019/resource-timing/common/utils/resource-timing-buffer.js +88 -0
- package/dist/es2019/resource-timing/index.js +3 -0
- package/dist/es2019/resource-timing/main.js +130 -0
- package/dist/es2019/resource-timing/utils.js +4 -0
- package/dist/es2019/round-number/index.js +4 -0
- package/dist/es2019/route-name/index.js +6 -0
- package/dist/es2019/route-name-context/index.js +5 -0
- package/dist/es2019/segment/index.js +2 -0
- package/dist/es2019/segment/segment-highlight.js +27 -0
- package/dist/es2019/segment/segment.js +218 -0
- package/dist/es2019/set-interaction-error/index.js +11 -0
- package/dist/es2019/short-id/index.js +8 -0
- package/dist/es2019/ssr/index.js +54 -0
- package/dist/es2019/trace-interaction/index.js +41 -0
- package/dist/es2019/trace-pageload/index.js +48 -0
- package/dist/es2019/trace-press/index.js +27 -0
- package/dist/es2019/trace-redirect/index.js +10 -0
- package/dist/es2019/trace-transition/index.js +48 -0
- package/dist/es2019/trace-transition/utils/generate-span-id/index.js +1 -0
- package/dist/es2019/trace-transition/utils/set-interaction-active-trace/index.js +5 -0
- package/dist/es2019/typing-performance-tracing/index.js +255 -0
- package/dist/es2019/use-press-tracing/index.js +12 -0
- package/dist/es2019/vc/index.js +8 -0
- package/dist/es2019/vc/vc-observer/attachAbortListeners.js +34 -0
- package/dist/es2019/vc/vc-observer/getViewport.js +18 -0
- package/dist/es2019/vc/vc-observer/index.js +522 -0
- package/dist/es2019/vc/vc-observer/media-wrapper/index.js +9 -0
- package/dist/es2019/vc/vc-observer/media-wrapper/vc-utils.js +10 -0
- package/dist/es2019/vc/vc-observer/observers/index.js +231 -0
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/index.js +146 -0
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/bindAbortListeners.js +16 -0
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/collectSSRPlaceholderDimensions.js +14 -0
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/index.js +2 -0
- package/dist/es2019/vc/vc-observer/observers/types.js +1 -0
- package/dist/esm/additional-payload/index.js +2 -0
- package/dist/esm/additional-payload/utils/cache-hit-ratio/index.js +63 -0
- package/dist/esm/additional-payload/utils/lighthouse-metrics/cls/index.js +47 -0
- package/dist/esm/additional-payload/utils/lighthouse-metrics/cls/types.js +0 -0
- package/dist/esm/additional-payload/utils/lighthouse-metrics/const.js +4 -0
- package/dist/esm/additional-payload/utils/lighthouse-metrics/index.js +22 -0
- package/dist/esm/additional-payload/utils/lighthouse-metrics/tbt/index.js +19 -0
- package/dist/esm/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +31 -0
- package/dist/esm/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +31 -0
- package/dist/esm/bundle-eval-timing/index.js +41 -0
- package/dist/esm/coinflip/index.js +16 -0
- package/dist/esm/common/common/types.js +1 -0
- package/dist/esm/common/constants.js +1 -0
- package/dist/esm/common/index.js +0 -0
- package/dist/esm/common/vc/types.js +5 -0
- package/dist/esm/config/index.js +206 -0
- package/dist/esm/create-payload/common/types.js +0 -0
- package/dist/esm/create-payload/common/utils/index.js +8 -0
- package/dist/esm/create-payload/index.js +774 -0
- package/dist/esm/create-post-interaction-log-payload/index.js +200 -0
- package/dist/esm/custom-data/index.js +23 -0
- package/dist/esm/custom-data/types.js +1 -0
- package/dist/esm/custom-mark/index.js +36 -0
- package/dist/esm/custom-spans/index.js +8 -0
- package/dist/esm/custom-timings/index.js +56 -0
- package/dist/esm/experience-trace-id-context/index.js +34 -0
- package/dist/esm/experience-trace-id-context/types.js +0 -0
- package/dist/esm/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +6 -0
- package/dist/esm/feature-flags-accessed/common/constants.js +1 -0
- package/dist/esm/feature-flags-accessed/common/types.js +1 -0
- package/dist/esm/feature-flags-accessed/common/utils/index.js +31 -0
- package/dist/esm/feature-flags-accessed/index.js +21 -0
- package/dist/esm/generate-id/index.js +6 -0
- package/dist/esm/global-error-handler/index.js +67 -0
- package/dist/esm/hidden-timing/index.js +87 -0
- package/dist/esm/initial-page-load-extra-timing/index.js +42 -0
- package/dist/esm/interaction-context/index.js +6 -0
- package/dist/esm/interaction-id-context/index.js +22 -0
- package/dist/esm/interaction-metrics/common/constants.js +2 -0
- package/dist/esm/interaction-metrics/index.js +773 -0
- package/dist/esm/interaction-metrics/post-interaction-log.js +184 -0
- package/dist/esm/interaction-metrics-init/index.js +77 -0
- package/dist/esm/label/UFOLabel.js +36 -0
- package/dist/esm/label/index.js +2 -0
- package/dist/esm/load-hold/UFOLoadHold.js +66 -0
- package/dist/esm/load-hold/index.js +2 -0
- package/dist/esm/placeholder/Placeholder.js +25 -0
- package/dist/esm/placeholder/index.js +2 -0
- package/dist/esm/placeholder/loosely-lazy/index.js +2 -0
- package/dist/esm/placeholder/loosely-lazy/lazy-suspense.js +70 -0
- package/dist/esm/placeholder/loosely-lazy/types.js +1 -0
- package/dist/esm/placeholder/loosely-lazy/wait-context.js +9 -0
- package/dist/esm/resource-timing/common/types.js +0 -0
- package/dist/esm/resource-timing/common/utils/config.js +62 -0
- package/dist/esm/resource-timing/common/utils/resource-timing-buffer.js +104 -0
- package/dist/esm/resource-timing/index.js +3 -0
- package/dist/esm/resource-timing/main.js +134 -0
- package/dist/esm/resource-timing/utils.js +4 -0
- package/dist/esm/round-number/index.js +5 -0
- package/dist/esm/route-name/index.js +6 -0
- package/dist/esm/route-name-context/index.js +5 -0
- package/dist/esm/segment/index.js +2 -0
- package/dist/esm/segment/segment-highlight.js +30 -0
- package/dist/esm/segment/segment.js +235 -0
- package/dist/esm/set-interaction-error/index.js +11 -0
- package/dist/esm/short-id/index.js +9 -0
- package/dist/esm/ssr/index.js +59 -0
- package/dist/esm/trace-interaction/index.js +41 -0
- package/dist/esm/trace-pageload/index.js +50 -0
- package/dist/esm/trace-press/index.js +27 -0
- package/dist/esm/trace-redirect/index.js +10 -0
- package/dist/esm/trace-transition/index.js +49 -0
- package/dist/esm/trace-transition/utils/generate-span-id/index.js +5 -0
- package/dist/esm/trace-transition/utils/set-interaction-active-trace/index.js +5 -0
- package/dist/esm/typing-performance-tracing/index.js +255 -0
- package/dist/esm/use-press-tracing/index.js +12 -0
- package/dist/esm/vc/index.js +9 -0
- package/dist/esm/vc/vc-observer/attachAbortListeners.js +34 -0
- package/dist/esm/vc/vc-observer/getViewport.js +20 -0
- package/dist/esm/vc/vc-observer/index.js +555 -0
- package/dist/esm/vc/vc-observer/media-wrapper/index.js +7 -0
- package/dist/esm/vc/vc-observer/media-wrapper/vc-utils.js +10 -0
- package/dist/esm/vc/vc-observer/observers/index.js +263 -0
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/index.js +176 -0
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/bindAbortListeners.js +16 -0
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/collectSSRPlaceholderDimensions.js +14 -0
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/index.js +2 -0
- package/dist/esm/vc/vc-observer/observers/types.js +1 -0
- package/dist/types/additional-payload/index.d.ts +2 -0
- package/dist/types/additional-payload/utils/cache-hit-ratio/index.d.ts +8 -0
- package/dist/types/additional-payload/utils/lighthouse-metrics/cls/index.d.ts +2 -0
- package/dist/types/additional-payload/utils/lighthouse-metrics/cls/types.d.ts +3 -0
- package/dist/types/additional-payload/utils/lighthouse-metrics/const.d.ts +5 -0
- package/dist/types/additional-payload/utils/lighthouse-metrics/index.d.ts +7 -0
- package/dist/types/additional-payload/utils/lighthouse-metrics/tbt/index.d.ts +5 -0
- package/dist/types/additional-payload/utils/lighthouse-metrics/utils/buffer/index.d.ts +13 -0
- package/dist/types/additional-payload/utils/lighthouse-metrics/utils/observer/index.d.ts +2 -0
- package/dist/types/bundle-eval-timing/index.d.ts +16 -0
- package/dist/types/coinflip/index.d.ts +8 -0
- package/dist/types/common/common/types.d.ts +201 -0
- package/dist/types/common/constants.d.ts +1 -0
- package/dist/types/common/index.d.ts +5 -0
- package/dist/types/common/vc/types.d.ts +91 -0
- package/dist/types/config/index.d.ts +91 -0
- package/dist/types/create-payload/common/types.d.ts +4 -0
- package/dist/types/create-payload/common/utils/index.d.ts +3 -0
- package/dist/types/create-payload/index.d.ts +2969 -0
- package/dist/types/create-post-interaction-log-payload/index.d.ts +45 -0
- package/dist/types/custom-data/index.d.ts +5 -0
- package/dist/types/custom-data/types.d.ts +4 -0
- package/dist/types/custom-mark/index.d.ts +10 -0
- package/dist/types/custom-spans/index.d.ts +1 -0
- package/dist/types/custom-timings/index.d.ts +19 -0
- package/dist/types/experience-trace-id-context/index.d.ts +10 -0
- package/dist/types/experience-trace-id-context/types.d.ts +8 -0
- package/dist/types/experience-trace-id-context/utils/make-trace-http-request-headers/index.d.ts +4 -0
- package/dist/types/feature-flags-accessed/common/constants.d.ts +1 -0
- package/dist/types/feature-flags-accessed/common/types.d.ts +2 -0
- package/dist/types/feature-flags-accessed/common/utils/index.d.ts +3 -0
- package/dist/types/feature-flags-accessed/index.d.ts +14 -0
- package/dist/types/generate-id/index.d.ts +2 -0
- package/dist/types/global-error-handler/index.d.ts +3 -0
- package/dist/types/hidden-timing/index.d.ts +7 -0
- package/dist/types/initial-page-load-extra-timing/index.d.ts +9 -0
- package/dist/types/interaction-context/index.d.ts +33 -0
- package/dist/types/interaction-id-context/index.d.ts +9 -0
- package/dist/types/interaction-metrics/common/constants.d.ts +3 -0
- package/dist/types/interaction-metrics/index.d.ts +65 -1
- package/dist/types/interaction-metrics/post-interaction-log.d.ts +69 -0
- package/dist/types/interaction-metrics-init/index.d.ts +11 -0
- package/dist/types/label/UFOLabel.d.ts +13 -0
- package/dist/types/label/index.d.ts +2 -0
- package/dist/types/load-hold/UFOLoadHold.d.ts +53 -0
- package/dist/types/load-hold/index.d.ts +2 -0
- package/dist/types/placeholder/Placeholder.d.ts +13 -0
- package/dist/types/placeholder/index.d.ts +2 -0
- package/dist/types/placeholder/loosely-lazy/index.d.ts +3 -0
- package/dist/types/placeholder/loosely-lazy/lazy-suspense.d.ts +6 -0
- package/dist/types/placeholder/loosely-lazy/types.d.ts +20 -0
- package/dist/types/placeholder/loosely-lazy/wait-context.d.ts +3 -0
- package/dist/types/resource-timing/common/types.d.ts +41 -0
- package/dist/types/resource-timing/common/utils/config.d.ts +3 -0
- package/dist/types/resource-timing/common/utils/resource-timing-buffer.d.ts +11 -0
- package/dist/types/resource-timing/index.d.ts +4 -0
- package/dist/types/resource-timing/main.d.ts +2 -0
- package/dist/types/resource-timing/utils.d.ts +1 -0
- package/dist/types/round-number/index.d.ts +1 -0
- package/dist/types/route-name/index.d.ts +4 -0
- package/dist/types/route-name-context/index.d.ts +5 -0
- package/dist/types/segment/index.d.ts +2 -0
- package/dist/types/segment/segment-highlight.d.ts +6 -0
- package/dist/types/segment/segment.d.ts +8 -0
- package/dist/types/set-interaction-error/index.d.ts +4 -0
- package/dist/types/short-id/index.d.ts +1 -0
- package/dist/types/ssr/index.d.ts +21 -0
- package/dist/types/trace-interaction/index.d.ts +2 -0
- package/dist/types/trace-pageload/index.d.ts +2 -0
- package/dist/types/trace-press/index.d.ts +1 -0
- package/dist/types/trace-redirect/index.d.ts +1 -0
- package/dist/types/trace-transition/index.d.ts +2 -0
- package/dist/types/trace-transition/utils/generate-span-id/index.d.ts +1 -0
- package/dist/types/trace-transition/utils/set-interaction-active-trace/index.d.ts +1 -0
- package/dist/types/typing-performance-tracing/index.d.ts +2 -0
- package/dist/types/use-press-tracing/index.d.ts +1 -0
- package/dist/types/vc/index.d.ts +2 -0
- package/dist/types/vc/vc-observer/attachAbortListeners.d.ts +6 -0
- package/dist/types/vc/vc-observer/getViewport.d.ts +2 -0
- package/dist/types/vc/vc-observer/index.d.ts +98 -0
- package/dist/types/vc/vc-observer/media-wrapper/index.d.ts +7 -0
- package/dist/types/vc/vc-observer/media-wrapper/vc-utils.d.ts +1 -0
- package/dist/types/vc/vc-observer/observers/index.d.ts +39 -0
- package/dist/types/vc/vc-observer/observers/ssr-placeholders/index.d.ts +23 -0
- package/dist/types/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/bindAbortListeners.d.ts +1 -0
- package/dist/types/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/collectSSRPlaceholderDimensions.d.ts +1 -0
- package/dist/types/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/index.d.ts +2 -0
- package/dist/types/vc/vc-observer/observers/types.d.ts +11 -0
- package/dist/types-ts4.5/additional-payload/index.d.ts +2 -0
- package/dist/types-ts4.5/additional-payload/utils/cache-hit-ratio/index.d.ts +8 -0
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/cls/index.d.ts +2 -0
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/cls/types.d.ts +3 -0
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/const.d.ts +5 -0
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/index.d.ts +7 -0
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/tbt/index.d.ts +5 -0
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/utils/buffer/index.d.ts +13 -0
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/utils/observer/index.d.ts +2 -0
- package/dist/types-ts4.5/bundle-eval-timing/index.d.ts +16 -0
- package/dist/types-ts4.5/coinflip/index.d.ts +8 -0
- package/dist/types-ts4.5/common/common/types.d.ts +201 -0
- package/dist/types-ts4.5/common/constants.d.ts +1 -0
- package/dist/types-ts4.5/common/index.d.ts +5 -0
- package/dist/types-ts4.5/common/vc/types.d.ts +91 -0
- package/dist/types-ts4.5/config/index.d.ts +95 -0
- package/dist/types-ts4.5/create-payload/common/types.d.ts +4 -0
- package/dist/types-ts4.5/create-payload/common/utils/index.d.ts +3 -0
- package/dist/types-ts4.5/create-payload/index.d.ts +2969 -0
- package/dist/types-ts4.5/create-post-interaction-log-payload/index.d.ts +45 -0
- package/dist/types-ts4.5/custom-data/index.d.ts +5 -0
- package/dist/types-ts4.5/custom-data/types.d.ts +4 -0
- package/dist/types-ts4.5/custom-mark/index.d.ts +10 -0
- package/dist/types-ts4.5/custom-spans/index.d.ts +1 -0
- package/dist/types-ts4.5/custom-timings/index.d.ts +19 -0
- package/dist/types-ts4.5/experience-trace-id-context/index.d.ts +10 -0
- package/dist/types-ts4.5/experience-trace-id-context/types.d.ts +8 -0
- package/dist/types-ts4.5/experience-trace-id-context/utils/make-trace-http-request-headers/index.d.ts +4 -0
- package/dist/types-ts4.5/feature-flags-accessed/common/constants.d.ts +1 -0
- package/dist/types-ts4.5/feature-flags-accessed/common/types.d.ts +2 -0
- package/dist/types-ts4.5/feature-flags-accessed/common/utils/index.d.ts +3 -0
- package/dist/types-ts4.5/feature-flags-accessed/index.d.ts +14 -0
- package/dist/types-ts4.5/generate-id/index.d.ts +2 -0
- package/dist/types-ts4.5/global-error-handler/index.d.ts +3 -0
- package/dist/types-ts4.5/hidden-timing/index.d.ts +7 -0
- package/dist/types-ts4.5/initial-page-load-extra-timing/index.d.ts +9 -0
- package/dist/types-ts4.5/interaction-context/index.d.ts +33 -0
- package/dist/types-ts4.5/interaction-id-context/index.d.ts +9 -0
- package/dist/types-ts4.5/interaction-metrics/common/constants.d.ts +3 -0
- package/dist/types-ts4.5/interaction-metrics/index.d.ts +65 -1
- package/dist/types-ts4.5/interaction-metrics/post-interaction-log.d.ts +69 -0
- package/dist/types-ts4.5/interaction-metrics-init/index.d.ts +11 -0
- package/dist/types-ts4.5/label/UFOLabel.d.ts +13 -0
- package/dist/types-ts4.5/label/index.d.ts +2 -0
- package/dist/types-ts4.5/load-hold/UFOLoadHold.d.ts +53 -0
- package/dist/types-ts4.5/load-hold/index.d.ts +2 -0
- package/dist/types-ts4.5/placeholder/Placeholder.d.ts +13 -0
- package/dist/types-ts4.5/placeholder/index.d.ts +2 -0
- package/dist/types-ts4.5/placeholder/loosely-lazy/index.d.ts +3 -0
- package/dist/types-ts4.5/placeholder/loosely-lazy/lazy-suspense.d.ts +6 -0
- package/dist/types-ts4.5/placeholder/loosely-lazy/types.d.ts +20 -0
- package/dist/types-ts4.5/placeholder/loosely-lazy/wait-context.d.ts +3 -0
- package/dist/types-ts4.5/resource-timing/common/types.d.ts +41 -0
- package/dist/types-ts4.5/resource-timing/common/utils/config.d.ts +3 -0
- package/dist/types-ts4.5/resource-timing/common/utils/resource-timing-buffer.d.ts +11 -0
- package/dist/types-ts4.5/resource-timing/index.d.ts +4 -0
- package/dist/types-ts4.5/resource-timing/main.d.ts +2 -0
- package/dist/types-ts4.5/resource-timing/utils.d.ts +1 -0
- package/dist/types-ts4.5/round-number/index.d.ts +1 -0
- package/dist/types-ts4.5/route-name/index.d.ts +4 -0
- package/dist/types-ts4.5/route-name-context/index.d.ts +5 -0
- package/dist/types-ts4.5/segment/index.d.ts +2 -0
- package/dist/types-ts4.5/segment/segment-highlight.d.ts +6 -0
- package/dist/types-ts4.5/segment/segment.d.ts +8 -0
- package/dist/types-ts4.5/set-interaction-error/index.d.ts +4 -0
- package/dist/types-ts4.5/short-id/index.d.ts +1 -0
- package/dist/types-ts4.5/ssr/index.d.ts +21 -0
- package/dist/types-ts4.5/trace-interaction/index.d.ts +2 -0
- package/dist/types-ts4.5/trace-pageload/index.d.ts +2 -0
- package/dist/types-ts4.5/trace-press/index.d.ts +1 -0
- package/dist/types-ts4.5/trace-redirect/index.d.ts +1 -0
- package/dist/types-ts4.5/trace-transition/index.d.ts +2 -0
- package/dist/types-ts4.5/trace-transition/utils/generate-span-id/index.d.ts +1 -0
- package/dist/types-ts4.5/trace-transition/utils/set-interaction-active-trace/index.d.ts +1 -0
- package/dist/types-ts4.5/typing-performance-tracing/index.d.ts +2 -0
- package/dist/types-ts4.5/use-press-tracing/index.d.ts +1 -0
- package/dist/types-ts4.5/vc/index.d.ts +2 -0
- package/dist/types-ts4.5/vc/vc-observer/attachAbortListeners.d.ts +6 -0
- package/dist/types-ts4.5/vc/vc-observer/getViewport.d.ts +2 -0
- package/dist/types-ts4.5/vc/vc-observer/index.d.ts +98 -0
- package/dist/types-ts4.5/vc/vc-observer/media-wrapper/index.d.ts +7 -0
- package/dist/types-ts4.5/vc/vc-observer/media-wrapper/vc-utils.d.ts +1 -0
- package/dist/types-ts4.5/vc/vc-observer/observers/index.d.ts +39 -0
- package/dist/types-ts4.5/vc/vc-observer/observers/ssr-placeholders/index.d.ts +23 -0
- package/dist/types-ts4.5/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/bindAbortListeners.d.ts +1 -0
- package/dist/types-ts4.5/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/collectSSRPlaceholderDimensions.d.ts +1 -0
- package/dist/types-ts4.5/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/index.d.ts +2 -0
- package/dist/types-ts4.5/vc/vc-observer/observers/types.d.ts +11 -0
- package/experience-trace-id-context/package.json +15 -0
- package/feature-flags-accessed/package.json +15 -0
- package/generate-id/package.json +15 -0
- package/global-error-handler/package.json +15 -0
- package/hidden-timing/package.json +15 -0
- package/initial-page-load-extra-timing/package.json +15 -0
- package/interaction-context/package.json +15 -0
- package/interaction-id-context/package.json +15 -0
- package/interaction-metrics-init/package.json +15 -0
- package/label/package.json +15 -0
- package/load-hold/package.json +15 -0
- package/package.json +55 -3
- package/placeholder/package.json +15 -0
- package/resource-timing/package.json +15 -0
- package/round-number/package.json +15 -0
- package/route-name/package.json +15 -0
- package/route-name-context/package.json +15 -0
- package/segment/package.json +15 -0
- package/set-interaction-error/package.json +15 -0
- package/short-id/package.json +15 -0
- package/ssr/package.json +15 -0
- package/ssr-scripts/package.json +15 -0
- package/trace-interaction/package.json +15 -0
- package/trace-pageload/package.json +15 -0
- package/trace-press/package.json +15 -0
- package/trace-redirect/package.json +15 -0
- package/trace-transition/package.json +15 -0
- package/typing-performance-tracing/package.json +15 -0
- package/use-press-tracing/package.json +15 -0
- package/vc/media/package.json +15 -0
- package/vc/package.json +15 -0
- package/dist/types/common/types.d.ts +0 -17
- package/dist/types-ts4.5/common/types.d.ts +0 -17
- /package/dist/cjs/{common → additional-payload/utils/lighthouse-metrics/cls}/types.js +0 -0
- /package/dist/es2019/{common → additional-payload/utils/lighthouse-metrics/cls}/types.js +0 -0
- /package/dist/{esm/common/types.js → es2019/common/index.js} +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getViewportHeight = getViewportHeight;
|
|
7
|
+
exports.getViewportWidth = getViewportWidth;
|
|
8
|
+
function getViewportWidth() {
|
|
9
|
+
var document = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.document;
|
|
10
|
+
var documentWidth;
|
|
11
|
+
try {
|
|
12
|
+
documentWidth = document.documentElement.clientWidth || 0;
|
|
13
|
+
} catch (e) {
|
|
14
|
+
documentWidth = 0;
|
|
15
|
+
}
|
|
16
|
+
return Math.max(documentWidth, window.innerWidth || 0);
|
|
17
|
+
}
|
|
18
|
+
function getViewportHeight() {
|
|
19
|
+
var document = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.document;
|
|
20
|
+
var documentHeight;
|
|
21
|
+
try {
|
|
22
|
+
documentHeight = document.documentElement.clientHeight || 0;
|
|
23
|
+
} catch (e) {
|
|
24
|
+
documentHeight = 0;
|
|
25
|
+
}
|
|
26
|
+
return Math.max(documentHeight, window.innerHeight || 0);
|
|
27
|
+
}
|
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.VCObserver = void 0;
|
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
var _attachAbortListeners = require("./attachAbortListeners");
|
|
14
|
+
var _getViewport = require("./getViewport");
|
|
15
|
+
var _observers = require("./observers");
|
|
16
|
+
var _excluded = ["__debug__element"];
|
|
17
|
+
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; }
|
|
18
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
19
|
+
var abortReason = {
|
|
20
|
+
scroll: 'scroll',
|
|
21
|
+
keypress: 'keypress',
|
|
22
|
+
resize: 'resize',
|
|
23
|
+
error: 'error'
|
|
24
|
+
};
|
|
25
|
+
var UNUSED_SECTOR = 0;
|
|
26
|
+
function filterComponentsLog(log) {
|
|
27
|
+
return Object.fromEntries(Object.entries(log).map(function (_ref) {
|
|
28
|
+
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
29
|
+
timestamp = _ref2[0],
|
|
30
|
+
entries = _ref2[1];
|
|
31
|
+
return [Number(timestamp), entries.map(function (entry) {
|
|
32
|
+
var __debug__element = entry.__debug__element,
|
|
33
|
+
rest = (0, _objectWithoutProperties2.default)(entry, _excluded);
|
|
34
|
+
return rest;
|
|
35
|
+
})];
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
39
|
+
function VCObserver(options) {
|
|
40
|
+
var _this = this;
|
|
41
|
+
(0, _classCallCheck2.default)(this, VCObserver);
|
|
42
|
+
/* abort logic */
|
|
43
|
+
(0, _defineProperty2.default)(this, "abortReason", {
|
|
44
|
+
reason: null,
|
|
45
|
+
info: '',
|
|
46
|
+
timestamp: -1,
|
|
47
|
+
blocking: false
|
|
48
|
+
});
|
|
49
|
+
(0, _defineProperty2.default)(this, "outOfBoundaryInfo", '');
|
|
50
|
+
(0, _defineProperty2.default)(this, "viewport", {
|
|
51
|
+
w: 0,
|
|
52
|
+
h: 0
|
|
53
|
+
});
|
|
54
|
+
/* heatmap */
|
|
55
|
+
(0, _defineProperty2.default)(this, "arraySize", 0);
|
|
56
|
+
(0, _defineProperty2.default)(this, "componentsLog", {});
|
|
57
|
+
(0, _defineProperty2.default)(this, "vcRatios", {});
|
|
58
|
+
(0, _defineProperty2.default)(this, "active", false);
|
|
59
|
+
(0, _defineProperty2.default)(this, "totalTime", 0);
|
|
60
|
+
(0, _defineProperty2.default)(this, "startTime", 0);
|
|
61
|
+
(0, _defineProperty2.default)(this, "_startMeasureTimestamp", -1);
|
|
62
|
+
(0, _defineProperty2.default)(this, "ssr", {
|
|
63
|
+
reactRendered: -1
|
|
64
|
+
});
|
|
65
|
+
(0, _defineProperty2.default)(this, "unbind", []);
|
|
66
|
+
(0, _defineProperty2.default)(this, "getAbortReasonInfo", function () {
|
|
67
|
+
if (_this.abortReason.reason === null) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
var info = _this.abortReason.info !== '' ? " ".concat(_this.abortReason.info) : '';
|
|
71
|
+
return "".concat(_this.abortReason.reason).concat(info);
|
|
72
|
+
});
|
|
73
|
+
(0, _defineProperty2.default)(this, "getVCRawData", function () {
|
|
74
|
+
_this.measureStart();
|
|
75
|
+
if (!_this.active) {
|
|
76
|
+
_this.measureStop();
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
_this.stop();
|
|
80
|
+
var abortReasonInfo = _this.getAbortReasonInfo();
|
|
81
|
+
_this.measureStop();
|
|
82
|
+
return {
|
|
83
|
+
abortReasonInfo: abortReasonInfo,
|
|
84
|
+
abortReason: _objectSpread({}, _this.abortReason),
|
|
85
|
+
heatmap: _this.ssrInclusiveHeatmap,
|
|
86
|
+
oldHeatmap: _this.heatmap,
|
|
87
|
+
outOfBoundaryInfo: _this.outOfBoundaryInfo,
|
|
88
|
+
totalTime: Math.round(_this.totalTime + _this.observers.getTotalTime()),
|
|
89
|
+
componentsLog: _objectSpread({}, _this.componentsLog),
|
|
90
|
+
viewport: _objectSpread({}, _this.viewport),
|
|
91
|
+
oldDomUpdatesEnabled: _this.oldDomUpdatesEnabled,
|
|
92
|
+
devToolsEnabled: _this.devToolsEnabled,
|
|
93
|
+
ratios: _this.vcRatios
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
(0, _defineProperty2.default)(this, "getVCResult", function (_ref3) {
|
|
97
|
+
var _objectSpread2;
|
|
98
|
+
var start = _ref3.start,
|
|
99
|
+
stop = _ref3.stop,
|
|
100
|
+
tti = _ref3.tti,
|
|
101
|
+
prefix = _ref3.prefix,
|
|
102
|
+
ssr = _ref3.ssr,
|
|
103
|
+
vc = _ref3.vc;
|
|
104
|
+
var startTime = performance.now();
|
|
105
|
+
// add local measurement
|
|
106
|
+
var fullPrefix = prefix !== undefined && prefix !== '' ? "".concat(prefix, ":") : '';
|
|
107
|
+
var rawData = vc !== undefined ? vc : _this.getVCRawData();
|
|
108
|
+
if (rawData === null) {
|
|
109
|
+
return {};
|
|
110
|
+
}
|
|
111
|
+
var abortReason = rawData.abortReason,
|
|
112
|
+
abortReasonInfo = rawData.abortReasonInfo,
|
|
113
|
+
heatmap = rawData.heatmap,
|
|
114
|
+
oldHeatmap = rawData.oldHeatmap,
|
|
115
|
+
outOfBoundaryInfo = rawData.outOfBoundaryInfo,
|
|
116
|
+
totalTime = rawData.totalTime,
|
|
117
|
+
componentsLog = rawData.componentsLog,
|
|
118
|
+
viewport = rawData.viewport,
|
|
119
|
+
oldDomUpdatesEnabled = rawData.oldDomUpdatesEnabled,
|
|
120
|
+
devToolsEnabled = rawData.devToolsEnabled,
|
|
121
|
+
ratios = rawData.ratios;
|
|
122
|
+
if (abortReasonInfo !== null && abortReason.blocking) {
|
|
123
|
+
var _ref4;
|
|
124
|
+
// exposing data to devtools
|
|
125
|
+
try {
|
|
126
|
+
if (devToolsEnabled && !_this.isPostInteraction) {
|
|
127
|
+
window.__vcNotAvailableReason = abortReasonInfo;
|
|
128
|
+
}
|
|
129
|
+
} catch (e) {}
|
|
130
|
+
return _ref4 = {}, (0, _defineProperty2.default)(_ref4, "".concat(fullPrefix, "vc:state"), false), (0, _defineProperty2.default)(_ref4, "".concat(fullPrefix, "vc:abort:reason"), abortReasonInfo), (0, _defineProperty2.default)(_ref4, "".concat(fullPrefix, "vc:abort:timestamp"), abortReason.timestamp), _ref4;
|
|
131
|
+
}
|
|
132
|
+
var _VCObserver$calculate = VCObserver.calculateVC({
|
|
133
|
+
heatmap: heatmap,
|
|
134
|
+
ssr: ssr,
|
|
135
|
+
componentsLog: _objectSpread({}, componentsLog),
|
|
136
|
+
viewport: viewport
|
|
137
|
+
}),
|
|
138
|
+
VC = _VCObserver$calculate.VC,
|
|
139
|
+
VCBox = _VCObserver$calculate.VCBox,
|
|
140
|
+
VCEntries = _VCObserver$calculate.VCEntries,
|
|
141
|
+
totalPainted = _VCObserver$calculate.totalPainted;
|
|
142
|
+
try {
|
|
143
|
+
if (!_this.isPostInteraction) {
|
|
144
|
+
VCObserver.VCParts.forEach(function (key) {
|
|
145
|
+
var duration = VC[key];
|
|
146
|
+
if (duration !== null && duration !== undefined) {
|
|
147
|
+
performance.measure("VC".concat(key), {
|
|
148
|
+
start: start,
|
|
149
|
+
duration: duration
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
} catch (e) {
|
|
155
|
+
/* empty */
|
|
156
|
+
}
|
|
157
|
+
var ssrVC = VCObserver.calculateVC({
|
|
158
|
+
heatmap: oldHeatmap,
|
|
159
|
+
ssr: ssr,
|
|
160
|
+
componentsLog: _objectSpread({}, componentsLog),
|
|
161
|
+
viewport: viewport
|
|
162
|
+
});
|
|
163
|
+
var outOfBoundary = outOfBoundaryInfo ? (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:oob"), outOfBoundaryInfo) : {};
|
|
164
|
+
var oldDomUpdates = oldDomUpdatesEnabled ? (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:old:dom"), ssrVC.VCBox) : {};
|
|
165
|
+
var stopTime = performance.now();
|
|
166
|
+
|
|
167
|
+
// exposing data to devtools
|
|
168
|
+
try {
|
|
169
|
+
if (!_this.isPostInteraction && devToolsEnabled) {
|
|
170
|
+
window.__vc = {
|
|
171
|
+
entries: VCEntries.rel,
|
|
172
|
+
log: componentsLog,
|
|
173
|
+
metrics: {
|
|
174
|
+
'75': VC['75'],
|
|
175
|
+
'80': VC['80'],
|
|
176
|
+
'85': VC['85'],
|
|
177
|
+
'90': VC['90'],
|
|
178
|
+
'95': VC['95'],
|
|
179
|
+
'98': VC['98'],
|
|
180
|
+
'99': VC['99'],
|
|
181
|
+
tti: tti,
|
|
182
|
+
ttai: stop - start
|
|
183
|
+
},
|
|
184
|
+
heatmap: heatmap,
|
|
185
|
+
ratios: ratios
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// Emitting a custom event to make it available in the Chrome extension
|
|
189
|
+
window.dispatchEvent(new CustomEvent('vcReady', {
|
|
190
|
+
detail: {
|
|
191
|
+
log: filterComponentsLog(componentsLog),
|
|
192
|
+
entries: VCEntries.rel
|
|
193
|
+
}
|
|
194
|
+
}));
|
|
195
|
+
}
|
|
196
|
+
} catch (e) {
|
|
197
|
+
/* do nothing */
|
|
198
|
+
}
|
|
199
|
+
return _objectSpread(_objectSpread(_objectSpread((_objectSpread2 = {
|
|
200
|
+
'metrics:vc': VC
|
|
201
|
+
}, (0, _defineProperty2.default)(_objectSpread2, "".concat(fullPrefix, "vc:state"), true), (0, _defineProperty2.default)(_objectSpread2, "".concat(fullPrefix, "vc:clean"), !abortReasonInfo), (0, _defineProperty2.default)(_objectSpread2, "".concat(fullPrefix, "vc:dom"), VCBox), (0, _defineProperty2.default)(_objectSpread2, "".concat(fullPrefix, "vc:updates"), VCEntries.rel.slice(0, 50)), (0, _defineProperty2.default)(_objectSpread2, "".concat(fullPrefix, "vc:size"), viewport), (0, _defineProperty2.default)(_objectSpread2, "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), (0, _defineProperty2.default)(_objectSpread2, "".concat(fullPrefix, "vc:total"), totalPainted), (0, _defineProperty2.default)(_objectSpread2, "".concat(fullPrefix, "vc:ratios"), ratios), _objectSpread2), outOfBoundary), {}, (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:old"), ssrVC.VC), oldDomUpdates), {}, (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)));
|
|
202
|
+
});
|
|
203
|
+
(0, _defineProperty2.default)(this, "handleUpdate", function (rawTime, intersectionRect, targetName, element, ignoreReason) {
|
|
204
|
+
_this.measureStart();
|
|
205
|
+
if (_this.abortReason.reason === null || _this.abortReason.blocking === false) {
|
|
206
|
+
var time = Math.round(rawTime - _this.startTime);
|
|
207
|
+
var mappedValues = _this.mapPixelsToHeatmap(intersectionRect.left, intersectionRect.top, intersectionRect.width, intersectionRect.height);
|
|
208
|
+
_this.vcRatios[targetName] = _this.getElementRatio(mappedValues);
|
|
209
|
+
_this.applyChangesToHeatMap(mappedValues, time, _this.heatmap);
|
|
210
|
+
if (!ignoreReason) {
|
|
211
|
+
_this.applyChangesToHeatMap(mappedValues, time, _this.ssrInclusiveHeatmap);
|
|
212
|
+
}
|
|
213
|
+
if (!_this.componentsLog[time]) {
|
|
214
|
+
_this.componentsLog[time] = [];
|
|
215
|
+
}
|
|
216
|
+
_this.componentsLog[time].push({
|
|
217
|
+
__debug__element: _this.devToolsEnabled ? new WeakRef(element) : null,
|
|
218
|
+
intersectionRect: intersectionRect,
|
|
219
|
+
targetName: targetName,
|
|
220
|
+
ignoreReason: ignoreReason
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
// devtools export
|
|
224
|
+
_this.measureStop();
|
|
225
|
+
});
|
|
226
|
+
(0, _defineProperty2.default)(this, "mapPixelsToHeatmap", function (left, top, width, height) {
|
|
227
|
+
var _this$viewport = _this.viewport,
|
|
228
|
+
w = _this$viewport.w,
|
|
229
|
+
h = _this$viewport.h;
|
|
230
|
+
var l = Math.floor(left / w * _this.arraySize);
|
|
231
|
+
var t = Math.floor(top / h * _this.arraySize);
|
|
232
|
+
var r = Math.ceil((left + width) / w * _this.arraySize);
|
|
233
|
+
var b = Math.ceil((top + height) / h * _this.arraySize);
|
|
234
|
+
|
|
235
|
+
// that info is temporary to get info why it goes over boundary
|
|
236
|
+
if (_this.outOfBoundaryInfo === '') {
|
|
237
|
+
var outOfBoundaryInfo = '';
|
|
238
|
+
if (r > _this.arraySize) {
|
|
239
|
+
outOfBoundaryInfo += " r ".concat(r, " ! ").concat(left, " ").concat(width);
|
|
240
|
+
}
|
|
241
|
+
if (b > _this.arraySize) {
|
|
242
|
+
outOfBoundaryInfo += " r ".concat(r, " ! ").concat(top, " ").concat(height);
|
|
243
|
+
}
|
|
244
|
+
_this.outOfBoundaryInfo = outOfBoundaryInfo;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// correct values to min - 0, max - arraySize
|
|
248
|
+
var result = {
|
|
249
|
+
l: Math.max(0, l),
|
|
250
|
+
t: Math.max(0, t),
|
|
251
|
+
r: Math.min(_this.arraySize, r),
|
|
252
|
+
b: Math.min(_this.arraySize, b)
|
|
253
|
+
};
|
|
254
|
+
return result;
|
|
255
|
+
});
|
|
256
|
+
(0, _defineProperty2.default)(this, "getElementRatio", function (mappedValues) {
|
|
257
|
+
var r = mappedValues.r,
|
|
258
|
+
l = mappedValues.l,
|
|
259
|
+
b = mappedValues.b,
|
|
260
|
+
t = mappedValues.t;
|
|
261
|
+
return (r - l) * (b - t) / (_this.arraySize * _this.arraySize);
|
|
262
|
+
});
|
|
263
|
+
(0, _defineProperty2.default)(this, "abortReasonCallback", function (key, time) {
|
|
264
|
+
switch (key) {
|
|
265
|
+
case 'wheel':
|
|
266
|
+
_this.setAbortReason(abortReason.scroll, time);
|
|
267
|
+
break;
|
|
268
|
+
case 'keydown':
|
|
269
|
+
_this.setAbortReason(abortReason.keypress, time);
|
|
270
|
+
break;
|
|
271
|
+
case 'resize':
|
|
272
|
+
_this.setAbortReason(abortReason.resize, time);
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
(0, _defineProperty2.default)(this, "attachAbortListeners", function () {
|
|
277
|
+
var _window;
|
|
278
|
+
_this.detachAbortListeners();
|
|
279
|
+
var unbinds = (0, _attachAbortListeners.attachAbortListeners)(window, _this.viewport, _this.abortReasonCallback);
|
|
280
|
+
if ((_window = window) !== null && _window !== void 0 && _window.__SSR_ABORT_LISTENERS__) {
|
|
281
|
+
var _window2;
|
|
282
|
+
Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (_ref7) {
|
|
283
|
+
var _ref8 = (0, _slicedToArray2.default)(_ref7, 2),
|
|
284
|
+
key = _ref8[0],
|
|
285
|
+
time = _ref8[1];
|
|
286
|
+
if (time) {
|
|
287
|
+
_this.abortReasonCallback(key, time);
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
unbinds = unbinds.concat(window.__SSR_ABORT_LISTENERS__.unbinds);
|
|
291
|
+
(_window2 = window) === null || _window2 === void 0 || delete _window2.__SSR_ABORT_LISTENERS__;
|
|
292
|
+
}
|
|
293
|
+
_this.unbind = unbinds;
|
|
294
|
+
});
|
|
295
|
+
this.arraySize = options.heatmapSize || 200;
|
|
296
|
+
this.devToolsEnabled = options.devToolsEnabled || false;
|
|
297
|
+
this.oldDomUpdatesEnabled = options.oldDomUpdates || false;
|
|
298
|
+
this.observers = new _observers.Observers({
|
|
299
|
+
selectorConfig: options.selectorConfig || {
|
|
300
|
+
id: false,
|
|
301
|
+
testId: false,
|
|
302
|
+
role: false,
|
|
303
|
+
className: true,
|
|
304
|
+
dataVC: true
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
this.heatmap = this.getCleanHeatmap();
|
|
308
|
+
this.ssrInclusiveHeatmap = this.getCleanHeatmap();
|
|
309
|
+
this.isPostInteraction = options.isPostInteraction || false;
|
|
310
|
+
}
|
|
311
|
+
(0, _createClass2.default)(VCObserver, [{
|
|
312
|
+
key: "start",
|
|
313
|
+
value: function start(_ref9) {
|
|
314
|
+
var startTime = _ref9.startTime;
|
|
315
|
+
this.active = true;
|
|
316
|
+
if (this.observers.isBrowserSupported()) {
|
|
317
|
+
this.setViewportSize();
|
|
318
|
+
this.resetState();
|
|
319
|
+
this.startTime = startTime;
|
|
320
|
+
this.attachAbortListeners();
|
|
321
|
+
this.observers.subscribeResults(this.handleUpdate);
|
|
322
|
+
this.observers.observe();
|
|
323
|
+
} else {
|
|
324
|
+
this.setAbortReason('not-supported', startTime);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}, {
|
|
328
|
+
key: "stop",
|
|
329
|
+
value: function stop() {
|
|
330
|
+
this.observers.disconnect();
|
|
331
|
+
this.detachAbortListeners();
|
|
332
|
+
}
|
|
333
|
+
}, {
|
|
334
|
+
key: "getIgnoredElements",
|
|
335
|
+
value: function getIgnoredElements(componentsLog) {
|
|
336
|
+
return Object.values(componentsLog).flat().filter(function (_ref10) {
|
|
337
|
+
var ignoreReason = _ref10.ignoreReason;
|
|
338
|
+
return Boolean(ignoreReason);
|
|
339
|
+
}).map(function (_ref11) {
|
|
340
|
+
var targetName = _ref11.targetName,
|
|
341
|
+
ignoreReason = _ref11.ignoreReason;
|
|
342
|
+
return {
|
|
343
|
+
targetName: targetName,
|
|
344
|
+
ignoreReason: ignoreReason
|
|
345
|
+
};
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
}, {
|
|
349
|
+
key: "setSSRElement",
|
|
350
|
+
value: function setSSRElement(element) {
|
|
351
|
+
this.observers.setReactRootElement(element);
|
|
352
|
+
}
|
|
353
|
+
}, {
|
|
354
|
+
key: "setReactRootRenderStart",
|
|
355
|
+
value: function setReactRootRenderStart() {
|
|
356
|
+
var startTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : performance.now();
|
|
357
|
+
this.observers.setReactRootRenderStart(startTime);
|
|
358
|
+
}
|
|
359
|
+
}, {
|
|
360
|
+
key: "setReactRootRenderStop",
|
|
361
|
+
value: function setReactRootRenderStop() {
|
|
362
|
+
var stopTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : performance.now();
|
|
363
|
+
this.observers.setReactRootRenderStop(stopTime);
|
|
364
|
+
}
|
|
365
|
+
}, {
|
|
366
|
+
key: "setAbortReason",
|
|
367
|
+
value: function setAbortReason(abort, timestamp) {
|
|
368
|
+
var info = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
369
|
+
if (this.abortReason.reason === null || this.abortReason.blocking === false) {
|
|
370
|
+
this.abortReason.reason = abort;
|
|
371
|
+
this.abortReason.info = info;
|
|
372
|
+
this.abortReason.timestamp = timestamp;
|
|
373
|
+
this.abortReason.blocking = abort !== abortReason.scroll;
|
|
374
|
+
if (this.abortReason.blocking) {
|
|
375
|
+
this.detachAbortListeners();
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}, {
|
|
380
|
+
key: "resetState",
|
|
381
|
+
value: function resetState() {
|
|
382
|
+
this.abortReason = {
|
|
383
|
+
reason: null,
|
|
384
|
+
info: '',
|
|
385
|
+
timestamp: -1,
|
|
386
|
+
blocking: false
|
|
387
|
+
};
|
|
388
|
+
this.detachAbortListeners();
|
|
389
|
+
this.heatmap = this.getCleanHeatmap();
|
|
390
|
+
this.ssrInclusiveHeatmap = this.getCleanHeatmap();
|
|
391
|
+
this.totalTime = 0;
|
|
392
|
+
this.componentsLog = {};
|
|
393
|
+
this.vcRatios = {};
|
|
394
|
+
}
|
|
395
|
+
}, {
|
|
396
|
+
key: "getCleanHeatmap",
|
|
397
|
+
value: function getCleanHeatmap() {
|
|
398
|
+
var _this2 = this;
|
|
399
|
+
return Array(this.arraySize).fill('').map(function () {
|
|
400
|
+
return Array(_this2.arraySize).fill(UNUSED_SECTOR);
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
}, {
|
|
404
|
+
key: "setViewportSize",
|
|
405
|
+
value: function setViewportSize() {
|
|
406
|
+
this.viewport.w = (0, _getViewport.getViewportWidth)();
|
|
407
|
+
this.viewport.h = (0, _getViewport.getViewportHeight)();
|
|
408
|
+
}
|
|
409
|
+
}, {
|
|
410
|
+
key: "applyChangesToHeatMap",
|
|
411
|
+
value: function applyChangesToHeatMap(a, time, heatmap) {
|
|
412
|
+
var l = a.l,
|
|
413
|
+
t = a.t,
|
|
414
|
+
r = a.r,
|
|
415
|
+
b = a.b;
|
|
416
|
+
var localHeatmap = heatmap;
|
|
417
|
+
for (var row = t; row < b; row++) {
|
|
418
|
+
for (var col = l; col < r; col++) {
|
|
419
|
+
if (localHeatmap[row] === undefined) {
|
|
420
|
+
try {
|
|
421
|
+
this.setAbortReason(abortReason.error, time, "index - ".concat(row));
|
|
422
|
+
} catch (e) {
|
|
423
|
+
this.setAbortReason(abortReason.error, time, 'row error');
|
|
424
|
+
}
|
|
425
|
+
return;
|
|
426
|
+
} else {
|
|
427
|
+
localHeatmap[row][col] = time;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}, {
|
|
433
|
+
key: "detachAbortListeners",
|
|
434
|
+
value: function detachAbortListeners() {
|
|
435
|
+
this.unbind.forEach(function (fn) {
|
|
436
|
+
return fn();
|
|
437
|
+
});
|
|
438
|
+
this.unbind = [];
|
|
439
|
+
}
|
|
440
|
+
}, {
|
|
441
|
+
key: "measureStart",
|
|
442
|
+
value: function measureStart() {
|
|
443
|
+
this._startMeasureTimestamp = performance.now();
|
|
444
|
+
}
|
|
445
|
+
}, {
|
|
446
|
+
key: "measureStop",
|
|
447
|
+
value: function measureStop() {
|
|
448
|
+
if (this._startMeasureTimestamp === -1) {
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
this.totalTime += performance.now() - this._startMeasureTimestamp;
|
|
452
|
+
this._startMeasureTimestamp = -1;
|
|
453
|
+
}
|
|
454
|
+
}], [{
|
|
455
|
+
key: "calculateVC",
|
|
456
|
+
value: function calculateVC(_ref12) {
|
|
457
|
+
var heatmap = _ref12.heatmap,
|
|
458
|
+
_ref12$ssr = _ref12.ssr,
|
|
459
|
+
ssr = _ref12$ssr === void 0 ? UNUSED_SECTOR : _ref12$ssr,
|
|
460
|
+
componentsLog = _ref12.componentsLog,
|
|
461
|
+
viewport = _ref12.viewport;
|
|
462
|
+
var lastUpdate = {};
|
|
463
|
+
var totalPainted = 0;
|
|
464
|
+
if (ssr !== UNUSED_SECTOR) {
|
|
465
|
+
var _window$document;
|
|
466
|
+
var element = {
|
|
467
|
+
__debug__element: new WeakRef((_window$document = window.document) === null || _window$document === void 0 ? void 0 : _window$document.body),
|
|
468
|
+
intersectionRect: {
|
|
469
|
+
top: 0,
|
|
470
|
+
left: 0,
|
|
471
|
+
right: 0,
|
|
472
|
+
bottom: 0,
|
|
473
|
+
x: 0,
|
|
474
|
+
y: 0,
|
|
475
|
+
width: viewport.w,
|
|
476
|
+
height: viewport.h,
|
|
477
|
+
toJSON: function toJSON() {
|
|
478
|
+
return {};
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
targetName: 'SSR'
|
|
482
|
+
};
|
|
483
|
+
if (!componentsLog[ssr]) {
|
|
484
|
+
componentsLog[ssr] = [];
|
|
485
|
+
}
|
|
486
|
+
componentsLog[ssr].push(element);
|
|
487
|
+
}
|
|
488
|
+
heatmap.forEach(function (line) {
|
|
489
|
+
line.forEach(function (entry) {
|
|
490
|
+
var rounded = Math.floor(entry === UNUSED_SECTOR && ssr !== UNUSED_SECTOR ? ssr : entry);
|
|
491
|
+
totalPainted += rounded !== UNUSED_SECTOR ? 1 : 0;
|
|
492
|
+
if (rounded !== UNUSED_SECTOR) {
|
|
493
|
+
lastUpdate[rounded] = lastUpdate[rounded] ? lastUpdate[rounded] + 1 : 1;
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
});
|
|
497
|
+
var entries = Object.entries(lastUpdate).map(function (a) {
|
|
498
|
+
return [parseInt(a[0], 10), a[1]];
|
|
499
|
+
}).sort(function (a, b) {
|
|
500
|
+
return a[0] > b[0] ? 1 : -1;
|
|
501
|
+
});
|
|
502
|
+
var VC = VCObserver.makeVCReturnObj();
|
|
503
|
+
var VCBox = VCObserver.makeVCReturnObj();
|
|
504
|
+
entries.reduce(function () {
|
|
505
|
+
var acc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
506
|
+
var v = arguments.length > 1 ? arguments[1] : undefined;
|
|
507
|
+
var VCRatio = v[1] / totalPainted + acc;
|
|
508
|
+
var time = v[0];
|
|
509
|
+
VCObserver.VCParts.forEach(function (key) {
|
|
510
|
+
var value = parseInt(key, 10);
|
|
511
|
+
if ((VC[key] === null || VC[key] === undefined) && VCRatio >= value / 100) {
|
|
512
|
+
var _componentsLog$time;
|
|
513
|
+
VC[key] = time;
|
|
514
|
+
VCBox[key] = (_componentsLog$time = componentsLog[time]) === null || _componentsLog$time === void 0 ? void 0 : _componentsLog$time.map(function (v) {
|
|
515
|
+
return v.targetName;
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
return VCRatio;
|
|
520
|
+
}, 0);
|
|
521
|
+
var VCEntries = entries.reduce(function (acc, _ref13, i) {
|
|
522
|
+
var _acc$abs, _componentsLog$timest;
|
|
523
|
+
var _ref14 = (0, _slicedToArray2.default)(_ref13, 2),
|
|
524
|
+
timestamp = _ref14[0],
|
|
525
|
+
entryPainted = _ref14[1];
|
|
526
|
+
var currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
|
|
527
|
+
var currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
|
|
528
|
+
var logEntry = (_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.map(function (v) {
|
|
529
|
+
return v.targetName;
|
|
530
|
+
});
|
|
531
|
+
acc.abs.push([timestamp, currentlyPainted]);
|
|
532
|
+
acc.rel.push({
|
|
533
|
+
time: timestamp,
|
|
534
|
+
vc: currentlyPaintedRatio,
|
|
535
|
+
elements: logEntry
|
|
536
|
+
});
|
|
537
|
+
return acc;
|
|
538
|
+
}, {
|
|
539
|
+
abs: [],
|
|
540
|
+
rel: []
|
|
541
|
+
});
|
|
542
|
+
return {
|
|
543
|
+
VC: VC,
|
|
544
|
+
VCBox: VCBox,
|
|
545
|
+
VCEntries: VCEntries,
|
|
546
|
+
totalPainted: totalPainted
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
}, {
|
|
550
|
+
key: "makeVCReturnObj",
|
|
551
|
+
value: function makeVCReturnObj() {
|
|
552
|
+
var vc = {};
|
|
553
|
+
VCObserver.VCParts.forEach(function (v) {
|
|
554
|
+
vc[v] = null;
|
|
555
|
+
});
|
|
556
|
+
return vc;
|
|
557
|
+
}
|
|
558
|
+
}]);
|
|
559
|
+
return VCObserver;
|
|
560
|
+
}();
|
|
561
|
+
/** config * */
|
|
562
|
+
(0, _defineProperty2.default)(VCObserver, "VCParts", ['25', '50', '75', '80', '85', '90', '95', '98', '99']);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.MEDIA_WRAPPER_TAG = void 0;
|
|
8
|
+
exports.default = MediaWrapper;
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var MEDIA_WRAPPER_TAG = exports.MEDIA_WRAPPER_TAG = 'data-media-vc-wrapper';
|
|
12
|
+
function MediaWrapper(_ref) {
|
|
13
|
+
var children = _ref.children;
|
|
14
|
+
return /*#__PURE__*/_react.default.createElement("div", (0, _defineProperty2.default)({}, MEDIA_WRAPPER_TAG, true), children);
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isContainedWithinMediaWrapper = void 0;
|
|
7
|
+
var _index = require("./index");
|
|
8
|
+
var isContainedWithinMediaWrapper = exports.isContainedWithinMediaWrapper = function isContainedWithinMediaWrapper(node) {
|
|
9
|
+
while (node) {
|
|
10
|
+
if (node instanceof Element && node.hasAttribute(_index.MEDIA_WRAPPER_TAG)) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
node = node.parentNode;
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
};
|