@atlaskit/react-ufo 4.2.3 → 4.2.5
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 +16 -0
- package/dist/cjs/ignore-holds/index.js +1 -2
- package/dist/cjs/interaction-metrics-init/index.js +7 -9
- package/dist/cjs/resource-timing/main.js +1 -1
- package/dist/cjs/vc/no-op-vc-observer.js +5 -5
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/index.js +11 -0
- package/dist/cjs/vc/vc-observer-new/index.js +5 -6
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +1 -1
- package/dist/cjs/vc/vc-observer-new/viewport-observer/index.js +45 -30
- package/dist/cjs/vc/vc-observer-new/viewport-observer/utils/check-within-component.js +1 -0
- package/dist/es2019/ignore-holds/index.js +1 -2
- package/dist/es2019/interaction-metrics-init/index.js +7 -9
- package/dist/es2019/resource-timing/main.js +1 -1
- package/dist/es2019/vc/no-op-vc-observer.js +5 -5
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/index.js +9 -0
- package/dist/es2019/vc/vc-observer-new/index.js +1 -3
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +1 -1
- package/dist/es2019/vc/vc-observer-new/viewport-observer/index.js +28 -19
- package/dist/es2019/vc/vc-observer-new/viewport-observer/utils/check-within-component.js +1 -0
- package/dist/esm/ignore-holds/index.js +1 -2
- package/dist/esm/interaction-metrics-init/index.js +7 -9
- package/dist/esm/resource-timing/main.js +1 -1
- package/dist/esm/vc/no-op-vc-observer.js +5 -5
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/index.js +11 -0
- package/dist/esm/vc/vc-observer-new/index.js +5 -6
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +1 -1
- package/dist/esm/vc/vc-observer-new/viewport-observer/index.js +45 -30
- package/dist/esm/vc/vc-observer-new/viewport-observer/utils/check-within-component.js +1 -0
- package/dist/types/ignore-holds/index.d.ts +1 -1
- package/dist/types/vc/no-op-vc-observer.d.ts +5 -5
- package/dist/types/vc/vc-observer/observers/ssr-placeholders/index.d.ts +1 -0
- package/dist/types/vc/vc-observer-new/index.d.ts +1 -3
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/utils/check-within-component.d.ts +1 -1
- package/dist/types-ts4.5/ignore-holds/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/no-op-vc-observer.d.ts +5 -5
- package/dist/types-ts4.5/vc/vc-observer/observers/ssr-placeholders/index.d.ts +1 -0
- package/dist/types-ts4.5/vc/vc-observer-new/index.d.ts +1 -3
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/utils/check-within-component.d.ts +1 -1
- package/package.json +4 -4
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/test-with-debug-info.js +0 -108
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/test-with-debug-info.js +0 -75
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/test-with-debug-info.js +0 -106
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/test-with-debug-info.d.ts +0 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/test-with-debug-info.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 4.2.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#200712](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/200712)
|
|
8
|
+
[`018d190fdbed5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/018d190fdbed5) -
|
|
9
|
+
FG clean up React UFO
|
|
10
|
+
|
|
11
|
+
## 4.2.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#199942](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/199942)
|
|
16
|
+
[`260cb0fb9e934`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/260cb0fb9e934) -
|
|
17
|
+
Fix ssr placeholder size/dimension check resolution in TTVC v3
|
|
18
|
+
|
|
3
19
|
## 4.2.3
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -34,8 +34,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
34
34
|
function UFOIgnoreHolds(_ref) {
|
|
35
35
|
var children = _ref.children,
|
|
36
36
|
_ref$ignore = _ref.ignore,
|
|
37
|
-
ignore = _ref$ignore === void 0 ? true : _ref$ignore
|
|
38
|
-
reason = _ref.reason;
|
|
37
|
+
ignore = _ref$ignore === void 0 ? true : _ref$ignore;
|
|
39
38
|
var parentContext = (0, _react.useContext)(_interactionContext.default);
|
|
40
39
|
var ignoredInteractionContext = (0, _react.useMemo)(function () {
|
|
41
40
|
if (!parentContext) {
|
|
@@ -107,15 +107,13 @@ function init(analyticsWebClientAsync, config) {
|
|
|
107
107
|
(0, _hiddenTiming.setupHiddenTimingCapture)();
|
|
108
108
|
(0, _additionalPayload.startLighthouseObserver)();
|
|
109
109
|
initialized = true;
|
|
110
|
-
if (
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
});
|
|
118
|
-
}
|
|
110
|
+
if (typeof PerformanceObserver !== 'undefined') {
|
|
111
|
+
var observer = (0, _interactionsPerformanceObserver.getPerformanceObserver)();
|
|
112
|
+
observer.observe({
|
|
113
|
+
type: 'event',
|
|
114
|
+
buffered: true,
|
|
115
|
+
durationThreshold: 16
|
|
116
|
+
});
|
|
119
117
|
}
|
|
120
118
|
Promise.all([analyticsWebClientAsync, Promise.resolve().then(function () {
|
|
121
119
|
return _interopRequireWildcard(require( /* webpackChunkName: "create-payloads" */'../create-payload'));
|
|
@@ -60,7 +60,7 @@ function getReportedInitiatorTypes(xhrEnabled) {
|
|
|
60
60
|
}
|
|
61
61
|
return ufoConfig.allowedResources;
|
|
62
62
|
}
|
|
63
|
-
function evaluateAccessToResourceTimings(
|
|
63
|
+
function evaluateAccessToResourceTimings(_, entry) {
|
|
64
64
|
return !(entry.responseStart === 0 && entry.startTime > entry.responseStart);
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -15,7 +15,7 @@ var VCObserverNOOP = exports.VCObserverNOOP = /*#__PURE__*/function () {
|
|
|
15
15
|
}
|
|
16
16
|
return (0, _createClass2.default)(VCObserverNOOP, [{
|
|
17
17
|
key: "start",
|
|
18
|
-
value: function start(
|
|
18
|
+
value: function start(_) {}
|
|
19
19
|
}, {
|
|
20
20
|
key: "stop",
|
|
21
21
|
value: function stop() {}
|
|
@@ -26,19 +26,19 @@ var VCObserverNOOP = exports.VCObserverNOOP = /*#__PURE__*/function () {
|
|
|
26
26
|
}
|
|
27
27
|
}, {
|
|
28
28
|
key: "getVCResult",
|
|
29
|
-
value: function getVCResult(
|
|
29
|
+
value: function getVCResult(_) {
|
|
30
30
|
return Promise.resolve({
|
|
31
31
|
'ufo:vc:noop': true
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
}, {
|
|
35
35
|
key: "setSSRElement",
|
|
36
|
-
value: function setSSRElement(
|
|
36
|
+
value: function setSSRElement(_) {}
|
|
37
37
|
}, {
|
|
38
38
|
key: "setReactRootRenderStart",
|
|
39
|
-
value: function setReactRootRenderStart(
|
|
39
|
+
value: function setReactRootRenderStart(_) {}
|
|
40
40
|
}, {
|
|
41
41
|
key: "setReactRootRenderStop",
|
|
42
|
-
value: function setReactRootRenderStop(
|
|
42
|
+
value: function setReactRootRenderStop(_) {}
|
|
43
43
|
}]);
|
|
44
44
|
}();
|
|
@@ -213,6 +213,8 @@ var SSRPlaceholderHandlers = exports.SSRPlaceholderHandlers = /*#__PURE__*/funct
|
|
|
213
213
|
}
|
|
214
214
|
return element;
|
|
215
215
|
}
|
|
216
|
+
|
|
217
|
+
// NOTE - for use when the FG `platform_ufo_ssr_placeholder_resolution_ttvc_v3` is disabled
|
|
216
218
|
}, {
|
|
217
219
|
key: "checkIfExistedAndSizeMatching",
|
|
218
220
|
value: function checkIfExistedAndSizeMatching(el) {
|
|
@@ -230,6 +232,15 @@ var SSRPlaceholderHandlers = exports.SSRPlaceholderHandlers = /*#__PURE__*/funct
|
|
|
230
232
|
}
|
|
231
233
|
});
|
|
232
234
|
}
|
|
235
|
+
|
|
236
|
+
// NOTE - for use when the FG `platform_ufo_ssr_placeholder_resolution_ttvc_v3` is enabled
|
|
237
|
+
}, {
|
|
238
|
+
key: "checkIfExistedAndSizeMatchingV3",
|
|
239
|
+
value: function checkIfExistedAndSizeMatchingV3(el) {
|
|
240
|
+
el = this.findNearestPlaceholderContainerIfIgnored(el);
|
|
241
|
+
var id = this.getPlaceholderId(el);
|
|
242
|
+
return this.staticPlaceholders.has(id);
|
|
243
|
+
}
|
|
233
244
|
}, {
|
|
234
245
|
key: "getSize",
|
|
235
246
|
value: function getSize(el) {
|
|
@@ -113,12 +113,11 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
113
113
|
}
|
|
114
114
|
return (0, _createClass2.default)(VCObserverNew, [{
|
|
115
115
|
key: "start",
|
|
116
|
-
value: function start(
|
|
116
|
+
value: function start(_) {
|
|
117
117
|
var _this$viewportObserve,
|
|
118
118
|
_window,
|
|
119
119
|
_this2 = this,
|
|
120
120
|
_this$windowEventObse;
|
|
121
|
-
var startTime = _ref2.startTime;
|
|
122
121
|
// Reset SSR state on start (matches old VCObserver behavior)
|
|
123
122
|
this.ssr = {
|
|
124
123
|
state: SSRState.normal,
|
|
@@ -132,10 +131,10 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
132
131
|
var abortListeners = window.__SSR_ABORT_LISTENERS__;
|
|
133
132
|
var aborts = abortListeners.aborts;
|
|
134
133
|
if (aborts && (0, _typeof2.default)(aborts) === 'object') {
|
|
135
|
-
Object.entries(aborts).forEach(function (
|
|
136
|
-
var
|
|
137
|
-
key =
|
|
138
|
-
time =
|
|
134
|
+
Object.entries(aborts).forEach(function (_ref2) {
|
|
135
|
+
var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
|
|
136
|
+
key = _ref3[0],
|
|
137
|
+
time = _ref3[1];
|
|
139
138
|
if (typeof time === 'number') {
|
|
140
139
|
_this2.entriesTimeline.push({
|
|
141
140
|
time: time,
|
package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js
CHANGED
|
@@ -244,7 +244,7 @@ function calculateDrawnPixelsRaw(_x, _x2, _x3) {
|
|
|
244
244
|
return _calculateDrawnPixelsRaw.apply(this, arguments);
|
|
245
245
|
}
|
|
246
246
|
function _calculateDrawnPixelsRaw() {
|
|
247
|
-
_calculateDrawnPixelsRaw = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(imageData,
|
|
247
|
+
_calculateDrawnPixelsRaw = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(imageData, _, arraySize) {
|
|
248
248
|
var data, arr, i, color, colorIndex;
|
|
249
249
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
250
250
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -11,6 +11,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
11
11
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
15
|
var _vcUtils = require("../../vc-observer/media-wrapper/vc-utils");
|
|
15
16
|
var _isNonVisualStyleMutation = _interopRequireDefault(require("../../vc-observer/observers/non-visual-styles/is-non-visual-style-mutation"));
|
|
16
17
|
var _rllPlaceholders = require("../../vc-observer/observers/rll-placeholders");
|
|
@@ -122,8 +123,8 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
122
123
|
_iterator = _createForOfIteratorHelper(addedNodes);
|
|
123
124
|
_context2.prev = 4;
|
|
124
125
|
_loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
|
|
125
|
-
var _this$
|
|
126
|
-
var addedNodeRef, addedNode, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, result, _this$
|
|
126
|
+
var _this$intersectionObs9;
|
|
127
|
+
var addedNodeRef, addedNode, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, _this$intersectionObs3, result, _this$intersectionObs4, _result, _this$intersectionObs5, sameDeletedNode, isInIgnoreLsMarker, _this$intersectionObs6, _this$intersectionObs7, _checkWithinComponent, isWithinThirdPartySegment, _this$intersectionObs8;
|
|
127
128
|
return _regenerator.default.wrap(function _loop$(_context) {
|
|
128
129
|
while (1) switch (_context.prev = _context.next) {
|
|
129
130
|
case 0:
|
|
@@ -171,44 +172,58 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
171
172
|
ssrState.state = SSRStateEnum.normal;
|
|
172
173
|
case 19:
|
|
173
174
|
if (!_this.getSSRPlaceholderHandler) {
|
|
174
|
-
_context.next =
|
|
175
|
+
_context.next = 42;
|
|
175
176
|
break;
|
|
176
177
|
}
|
|
177
178
|
ssrPlaceholderHandler = _this.getSSRPlaceholderHandler();
|
|
178
179
|
if (!ssrPlaceholderHandler) {
|
|
179
|
-
_context.next =
|
|
180
|
+
_context.next = 42;
|
|
180
181
|
break;
|
|
181
182
|
}
|
|
182
183
|
if (!(ssrPlaceholderHandler.isPlaceholder(addedNode) || ssrPlaceholderHandler.isPlaceholderIgnored(addedNode))) {
|
|
184
|
+
_context.next = 35;
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
if (!(0, _platformFeatureFlags.fg)('platform_ufo_ssr_placeholder_resolution_ttvc_v3')) {
|
|
183
188
|
_context.next = 29;
|
|
184
189
|
break;
|
|
185
190
|
}
|
|
186
|
-
|
|
191
|
+
if (!ssrPlaceholderHandler.checkIfExistedAndSizeMatchingV3(addedNode)) {
|
|
192
|
+
_context.next = 27;
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
(_this$intersectionObs3 = _this.intersectionObserver) === null || _this$intersectionObs3 === void 0 || _this$intersectionObs3.watchAndTag(addedNode, 'mutation:ssr-placeholder');
|
|
196
|
+
return _context.abrupt("return", 0);
|
|
197
|
+
case 27:
|
|
198
|
+
_context.next = 35;
|
|
199
|
+
break;
|
|
200
|
+
case 29:
|
|
201
|
+
_context.next = 31;
|
|
187
202
|
return ssrPlaceholderHandler.checkIfExistedAndSizeMatching(addedNode);
|
|
188
|
-
case
|
|
203
|
+
case 31:
|
|
189
204
|
result = _context.sent;
|
|
190
205
|
if (!(result !== false)) {
|
|
191
|
-
_context.next =
|
|
206
|
+
_context.next = 35;
|
|
192
207
|
break;
|
|
193
208
|
}
|
|
194
|
-
(_this$
|
|
209
|
+
(_this$intersectionObs4 = _this.intersectionObserver) === null || _this$intersectionObs4 === void 0 || _this$intersectionObs4.watchAndTag(addedNode, 'mutation:ssr-placeholder');
|
|
195
210
|
return _context.abrupt("return", 0);
|
|
196
|
-
case
|
|
211
|
+
case 35:
|
|
197
212
|
if (!(ssrPlaceholderHandler.isPlaceholderReplacement(addedNode) || ssrPlaceholderHandler.isPlaceholderIgnored(addedNode))) {
|
|
198
|
-
_context.next =
|
|
213
|
+
_context.next = 42;
|
|
199
214
|
break;
|
|
200
215
|
}
|
|
201
|
-
_context.next =
|
|
216
|
+
_context.next = 38;
|
|
202
217
|
return ssrPlaceholderHandler.validateReactComponentMatchToPlaceholder(addedNode);
|
|
203
|
-
case
|
|
218
|
+
case 38:
|
|
204
219
|
_result = _context.sent;
|
|
205
220
|
if (!(_result !== false)) {
|
|
206
|
-
_context.next =
|
|
221
|
+
_context.next = 42;
|
|
207
222
|
break;
|
|
208
223
|
}
|
|
209
|
-
(_this$
|
|
224
|
+
(_this$intersectionObs5 = _this.intersectionObserver) === null || _this$intersectionObs5 === void 0 || _this$intersectionObs5.watchAndTag(addedNode, 'mutation:ssr-placeholder');
|
|
210
225
|
return _context.abrupt("return", 0);
|
|
211
|
-
case
|
|
226
|
+
case 42:
|
|
212
227
|
sameDeletedNode = removedNodes.find(function (ref) {
|
|
213
228
|
var n = ref.deref();
|
|
214
229
|
if (!n || !addedNode) {
|
|
@@ -218,29 +233,29 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
218
233
|
});
|
|
219
234
|
isInIgnoreLsMarker = (0, _isInVcIgnoreIfNoLayoutShiftMarker.default)(addedNode);
|
|
220
235
|
if (!(sameDeletedNode && isInIgnoreLsMarker)) {
|
|
221
|
-
_context.next =
|
|
236
|
+
_context.next = 47;
|
|
222
237
|
break;
|
|
223
238
|
}
|
|
224
|
-
(_this$
|
|
239
|
+
(_this$intersectionObs6 = _this.intersectionObserver) === null || _this$intersectionObs6 === void 0 || _this$intersectionObs6.watchAndTag(addedNode, 'mutation:remount');
|
|
225
240
|
return _context.abrupt("return", 0);
|
|
226
|
-
case
|
|
241
|
+
case 47:
|
|
227
242
|
if (!(0, _vcUtils.isContainedWithinMediaWrapper)(addedNode)) {
|
|
228
|
-
_context.next =
|
|
243
|
+
_context.next = 50;
|
|
229
244
|
break;
|
|
230
245
|
}
|
|
231
|
-
(_this$
|
|
246
|
+
(_this$intersectionObs7 = _this.intersectionObserver) === null || _this$intersectionObs7 === void 0 || _this$intersectionObs7.watchAndTag(addedNode, 'mutation:media');
|
|
232
247
|
return _context.abrupt("return", 0);
|
|
233
|
-
case
|
|
248
|
+
case 50:
|
|
234
249
|
_checkWithinComponent = (0, _checkWithinComponent2.default)(addedNode, 'UFOThirdPartySegment', _this.mapIs3pResult), isWithinThirdPartySegment = _checkWithinComponent.isWithin;
|
|
235
250
|
if (!isWithinThirdPartySegment) {
|
|
236
|
-
_context.next =
|
|
251
|
+
_context.next = 54;
|
|
237
252
|
break;
|
|
238
253
|
}
|
|
239
|
-
(_this$
|
|
254
|
+
(_this$intersectionObs8 = _this.intersectionObserver) === null || _this$intersectionObs8 === void 0 || _this$intersectionObs8.watchAndTag(addedNode, 'mutation:third-party-element');
|
|
240
255
|
return _context.abrupt("return", 0);
|
|
241
|
-
case
|
|
242
|
-
(_this$
|
|
243
|
-
case
|
|
256
|
+
case 54:
|
|
257
|
+
(_this$intersectionObs9 = _this.intersectionObserver) === null || _this$intersectionObs9 === void 0 || _this$intersectionObs9.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
|
|
258
|
+
case 55:
|
|
244
259
|
case "end":
|
|
245
260
|
return _context.stop();
|
|
246
261
|
}
|
|
@@ -285,12 +300,12 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
285
300
|
};
|
|
286
301
|
}());
|
|
287
302
|
(0, _defineProperty2.default)(this, "handleAttributeMutation", function (_ref6) {
|
|
288
|
-
var _this$
|
|
303
|
+
var _this$intersectionObs0;
|
|
289
304
|
var target = _ref6.target,
|
|
290
305
|
attributeName = _ref6.attributeName,
|
|
291
306
|
oldValue = _ref6.oldValue,
|
|
292
307
|
newValue = _ref6.newValue;
|
|
293
|
-
(_this$
|
|
308
|
+
(_this$intersectionObs0 = _this.intersectionObserver) === null || _this$intersectionObs0 === void 0 || _this$intersectionObs0.watchAndTag(target, function (_ref7) {
|
|
294
309
|
var target = _ref7.target,
|
|
295
310
|
rect = _ref7.rect;
|
|
296
311
|
if ((0, _vcUtils.isContainedWithinMediaWrapper)(target)) {
|
|
@@ -430,12 +445,12 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
430
445
|
}, {
|
|
431
446
|
key: "stop",
|
|
432
447
|
value: function stop() {
|
|
433
|
-
var _this$mutationObserve2, _this$
|
|
448
|
+
var _this$mutationObserve2, _this$intersectionObs1, _this$performanceObse2;
|
|
434
449
|
if (!this.isStarted) {
|
|
435
450
|
return;
|
|
436
451
|
}
|
|
437
452
|
(_this$mutationObserve2 = this.mutationObserver) === null || _this$mutationObserve2 === void 0 || _this$mutationObserve2.disconnect();
|
|
438
|
-
(_this$
|
|
453
|
+
(_this$intersectionObs1 = this.intersectionObserver) === null || _this$intersectionObs1 === void 0 || _this$intersectionObs1.disconnect();
|
|
439
454
|
(_this$performanceObse2 = this.performanceObserver) === null || _this$performanceObse2 === void 0 || _this$performanceObse2.disconnect();
|
|
440
455
|
this.isStarted = false;
|
|
441
456
|
// Clean up caches when stopping
|
|
@@ -21,8 +21,7 @@ import InteractionContext from '@atlaskit/interaction-context';
|
|
|
21
21
|
*/
|
|
22
22
|
export default function UFOIgnoreHolds({
|
|
23
23
|
children,
|
|
24
|
-
ignore = true
|
|
25
|
-
reason
|
|
24
|
+
ignore = true
|
|
26
25
|
}) {
|
|
27
26
|
const parentContext = useContext(InteractionContext);
|
|
28
27
|
const ignoredInteractionContext = useMemo(() => {
|
|
@@ -97,15 +97,13 @@ export function init(analyticsWebClientAsync, config) {
|
|
|
97
97
|
setupHiddenTimingCapture();
|
|
98
98
|
startLighthouseObserver();
|
|
99
99
|
initialized = true;
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
});
|
|
108
|
-
}
|
|
100
|
+
if (typeof PerformanceObserver !== 'undefined') {
|
|
101
|
+
const observer = getPerformanceObserver();
|
|
102
|
+
observer.observe({
|
|
103
|
+
type: 'event',
|
|
104
|
+
buffered: true,
|
|
105
|
+
durationThreshold: 16
|
|
106
|
+
});
|
|
109
107
|
}
|
|
110
108
|
Promise.all([analyticsWebClientAsync, import( /* webpackChunkName: "create-payloads" */'../create-payload'), import( /* webpackChunkName: "create-post-interaction-log-payload" */'../create-post-interaction-log-payload')]).then(([awc, payloadPackage, createPostInteractionLogPayloadPackage]) => {
|
|
111
109
|
if (awc.getAnalyticsWebClientPromise) {
|
|
@@ -50,7 +50,7 @@ function getReportedInitiatorTypes(xhrEnabled) {
|
|
|
50
50
|
}
|
|
51
51
|
return ufoConfig.allowedResources;
|
|
52
52
|
}
|
|
53
|
-
function evaluateAccessToResourceTimings(
|
|
53
|
+
function evaluateAccessToResourceTimings(_, entry) {
|
|
54
54
|
return !(entry.responseStart === 0 && entry.startTime > entry.responseStart);
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// This class should be used on scenarios where VC can not be calculate
|
|
2
2
|
// such as: SSR environment and legacy browsers
|
|
3
3
|
export class VCObserverNOOP {
|
|
4
|
-
start(
|
|
4
|
+
start(_) {}
|
|
5
5
|
stop() {}
|
|
6
6
|
getVCRawData() {
|
|
7
7
|
return null;
|
|
8
8
|
}
|
|
9
|
-
getVCResult(
|
|
9
|
+
getVCResult(_) {
|
|
10
10
|
return Promise.resolve({
|
|
11
11
|
'ufo:vc:noop': true
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
setSSRElement(
|
|
15
|
-
setReactRootRenderStart(
|
|
16
|
-
setReactRootRenderStop(
|
|
14
|
+
setSSRElement(_) {}
|
|
15
|
+
setReactRootRenderStart(_) {}
|
|
16
|
+
setReactRootRenderStop(_) {}
|
|
17
17
|
}
|
|
@@ -184,6 +184,8 @@ export class SSRPlaceholderHandlers {
|
|
|
184
184
|
}
|
|
185
185
|
return element;
|
|
186
186
|
}
|
|
187
|
+
|
|
188
|
+
// NOTE - for use when the FG `platform_ufo_ssr_placeholder_resolution_ttvc_v3` is disabled
|
|
187
189
|
checkIfExistedAndSizeMatching(el) {
|
|
188
190
|
el = this.findNearestPlaceholderContainerIfIgnored(el);
|
|
189
191
|
const id = this.getPlaceholderId(el);
|
|
@@ -198,6 +200,13 @@ export class SSRPlaceholderHandlers {
|
|
|
198
200
|
}
|
|
199
201
|
});
|
|
200
202
|
}
|
|
203
|
+
|
|
204
|
+
// NOTE - for use when the FG `platform_ufo_ssr_placeholder_resolution_ttvc_v3` is enabled
|
|
205
|
+
checkIfExistedAndSizeMatchingV3(el) {
|
|
206
|
+
el = this.findNearestPlaceholderContainerIfIgnored(el);
|
|
207
|
+
const id = this.getPlaceholderId(el);
|
|
208
|
+
return this.staticPlaceholders.has(id);
|
|
209
|
+
}
|
|
201
210
|
getSize(el) {
|
|
202
211
|
return new Promise(resolve => {
|
|
203
212
|
var _this$intersectionObs4;
|
|
@@ -185,7 +185,7 @@ export function getRGBComponents(n) {
|
|
|
185
185
|
* @param arraySize - The amount of timestamps that were drawn in the viewport
|
|
186
186
|
* @returns A Map containing color to pixel count mappings.
|
|
187
187
|
*/
|
|
188
|
-
export async function calculateDrawnPixelsRaw(imageData,
|
|
188
|
+
export async function calculateDrawnPixelsRaw(imageData, _, arraySize) {
|
|
189
189
|
const data = imageData.data;
|
|
190
190
|
const arr = new Uint32Array(arraySize);
|
|
191
191
|
for (let i = 0; i < data.length; i += 4) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import { isContainedWithinMediaWrapper } from '../../vc-observer/media-wrapper/vc-utils';
|
|
3
4
|
import isNonVisualStyleMutation from '../../vc-observer/observers/non-visual-styles/is-non-visual-style-mutation';
|
|
4
5
|
import { RLLPlaceholderHandlers } from '../../vc-observer/observers/rll-placeholders';
|
|
@@ -100,7 +101,7 @@ export default class ViewportObserver {
|
|
|
100
101
|
});
|
|
101
102
|
const targetNode = target.deref();
|
|
102
103
|
for (const addedNodeRef of addedNodes) {
|
|
103
|
-
var _this$
|
|
104
|
+
var _this$intersectionObs9;
|
|
104
105
|
const addedNode = addedNodeRef.deref();
|
|
105
106
|
if (!addedNode) {
|
|
106
107
|
continue;
|
|
@@ -140,19 +141,27 @@ export default class ViewportObserver {
|
|
|
140
141
|
const ssrPlaceholderHandler = this.getSSRPlaceholderHandler();
|
|
141
142
|
if (ssrPlaceholderHandler) {
|
|
142
143
|
if (ssrPlaceholderHandler.isPlaceholder(addedNode) || ssrPlaceholderHandler.isPlaceholderIgnored(addedNode)) {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
144
|
+
if (fg('platform_ufo_ssr_placeholder_resolution_ttvc_v3')) {
|
|
145
|
+
if (ssrPlaceholderHandler.checkIfExistedAndSizeMatchingV3(addedNode)) {
|
|
146
|
+
var _this$intersectionObs3;
|
|
147
|
+
(_this$intersectionObs3 = this.intersectionObserver) === null || _this$intersectionObs3 === void 0 ? void 0 : _this$intersectionObs3.watchAndTag(addedNode, 'mutation:ssr-placeholder');
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
} else {
|
|
151
|
+
const result = await ssrPlaceholderHandler.checkIfExistedAndSizeMatching(addedNode);
|
|
152
|
+
if (result !== false) {
|
|
153
|
+
var _this$intersectionObs4;
|
|
154
|
+
(_this$intersectionObs4 = this.intersectionObserver) === null || _this$intersectionObs4 === void 0 ? void 0 : _this$intersectionObs4.watchAndTag(addedNode, 'mutation:ssr-placeholder');
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
148
157
|
}
|
|
149
158
|
// If result is false, continue to normal mutation logic below
|
|
150
159
|
}
|
|
151
160
|
if (ssrPlaceholderHandler.isPlaceholderReplacement(addedNode) || ssrPlaceholderHandler.isPlaceholderIgnored(addedNode)) {
|
|
152
161
|
const result = await ssrPlaceholderHandler.validateReactComponentMatchToPlaceholder(addedNode);
|
|
153
162
|
if (result !== false) {
|
|
154
|
-
var _this$
|
|
155
|
-
(_this$
|
|
163
|
+
var _this$intersectionObs5;
|
|
164
|
+
(_this$intersectionObs5 = this.intersectionObserver) === null || _this$intersectionObs5 === void 0 ? void 0 : _this$intersectionObs5.watchAndTag(addedNode, 'mutation:ssr-placeholder');
|
|
156
165
|
continue;
|
|
157
166
|
}
|
|
158
167
|
// If result is false, continue to normal mutation logic below
|
|
@@ -168,24 +177,24 @@ export default class ViewportObserver {
|
|
|
168
177
|
});
|
|
169
178
|
const isInIgnoreLsMarker = isInVCIgnoreIfNoLayoutShiftMarker(addedNode);
|
|
170
179
|
if (sameDeletedNode && isInIgnoreLsMarker) {
|
|
171
|
-
var _this$
|
|
172
|
-
(_this$
|
|
180
|
+
var _this$intersectionObs6;
|
|
181
|
+
(_this$intersectionObs6 = this.intersectionObserver) === null || _this$intersectionObs6 === void 0 ? void 0 : _this$intersectionObs6.watchAndTag(addedNode, 'mutation:remount');
|
|
173
182
|
continue;
|
|
174
183
|
}
|
|
175
184
|
if (isContainedWithinMediaWrapper(addedNode)) {
|
|
176
|
-
var _this$
|
|
177
|
-
(_this$
|
|
185
|
+
var _this$intersectionObs7;
|
|
186
|
+
(_this$intersectionObs7 = this.intersectionObserver) === null || _this$intersectionObs7 === void 0 ? void 0 : _this$intersectionObs7.watchAndTag(addedNode, 'mutation:media');
|
|
178
187
|
continue;
|
|
179
188
|
}
|
|
180
189
|
const {
|
|
181
190
|
isWithin: isWithinThirdPartySegment
|
|
182
191
|
} = checkWithinComponent(addedNode, 'UFOThirdPartySegment', this.mapIs3pResult);
|
|
183
192
|
if (isWithinThirdPartySegment) {
|
|
184
|
-
var _this$
|
|
185
|
-
(_this$
|
|
193
|
+
var _this$intersectionObs8;
|
|
194
|
+
(_this$intersectionObs8 = this.intersectionObserver) === null || _this$intersectionObs8 === void 0 ? void 0 : _this$intersectionObs8.watchAndTag(addedNode, 'mutation:third-party-element');
|
|
186
195
|
continue;
|
|
187
196
|
}
|
|
188
|
-
(_this$
|
|
197
|
+
(_this$intersectionObs9 = this.intersectionObserver) === null || _this$intersectionObs9 === void 0 ? void 0 : _this$intersectionObs9.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
|
|
189
198
|
}
|
|
190
199
|
});
|
|
191
200
|
_defineProperty(this, "handleAttributeMutation", ({
|
|
@@ -194,8 +203,8 @@ export default class ViewportObserver {
|
|
|
194
203
|
oldValue,
|
|
195
204
|
newValue
|
|
196
205
|
}) => {
|
|
197
|
-
var _this$
|
|
198
|
-
(_this$
|
|
206
|
+
var _this$intersectionObs0;
|
|
207
|
+
(_this$intersectionObs0 = this.intersectionObserver) === null || _this$intersectionObs0 === void 0 ? void 0 : _this$intersectionObs0.watchAndTag(target, ({
|
|
199
208
|
target,
|
|
200
209
|
rect
|
|
201
210
|
}) => {
|
|
@@ -322,12 +331,12 @@ export default class ViewportObserver {
|
|
|
322
331
|
this.isStarted = true;
|
|
323
332
|
}
|
|
324
333
|
stop() {
|
|
325
|
-
var _this$mutationObserve2, _this$
|
|
334
|
+
var _this$mutationObserve2, _this$intersectionObs1, _this$performanceObse2;
|
|
326
335
|
if (!this.isStarted) {
|
|
327
336
|
return;
|
|
328
337
|
}
|
|
329
338
|
(_this$mutationObserve2 = this.mutationObserver) === null || _this$mutationObserve2 === void 0 ? void 0 : _this$mutationObserve2.disconnect();
|
|
330
|
-
(_this$
|
|
339
|
+
(_this$intersectionObs1 = this.intersectionObserver) === null || _this$intersectionObs1 === void 0 ? void 0 : _this$intersectionObs1.disconnect();
|
|
331
340
|
(_this$performanceObse2 = this.performanceObserver) === null || _this$performanceObse2 === void 0 ? void 0 : _this$performanceObse2.disconnect();
|
|
332
341
|
this.isStarted = false;
|
|
333
342
|
// Clean up caches when stopping
|
|
@@ -17,6 +17,7 @@ function maybeCleanup(resultCache) {
|
|
|
17
17
|
export function cleanupCaches(resultCache) {
|
|
18
18
|
resultCache = new WeakMap();
|
|
19
19
|
callCount = 0;
|
|
20
|
+
return resultCache;
|
|
20
21
|
}
|
|
21
22
|
export default function checkWithinComponent(node, targetComponentName, resultCache) {
|
|
22
23
|
maybeCleanup(resultCache);
|
|
@@ -25,8 +25,7 @@ import InteractionContext from '@atlaskit/interaction-context';
|
|
|
25
25
|
export default function UFOIgnoreHolds(_ref) {
|
|
26
26
|
var children = _ref.children,
|
|
27
27
|
_ref$ignore = _ref.ignore,
|
|
28
|
-
ignore = _ref$ignore === void 0 ? true : _ref$ignore
|
|
29
|
-
reason = _ref.reason;
|
|
28
|
+
ignore = _ref$ignore === void 0 ? true : _ref$ignore;
|
|
30
29
|
var parentContext = useContext(InteractionContext);
|
|
31
30
|
var ignoredInteractionContext = useMemo(function () {
|
|
32
31
|
if (!parentContext) {
|
|
@@ -98,15 +98,13 @@ export function init(analyticsWebClientAsync, config) {
|
|
|
98
98
|
setupHiddenTimingCapture();
|
|
99
99
|
startLighthouseObserver();
|
|
100
100
|
initialized = true;
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
});
|
|
109
|
-
}
|
|
101
|
+
if (typeof PerformanceObserver !== 'undefined') {
|
|
102
|
+
var observer = getPerformanceObserver();
|
|
103
|
+
observer.observe({
|
|
104
|
+
type: 'event',
|
|
105
|
+
buffered: true,
|
|
106
|
+
durationThreshold: 16
|
|
107
|
+
});
|
|
110
108
|
}
|
|
111
109
|
Promise.all([analyticsWebClientAsync, import( /* webpackChunkName: "create-payloads" */'../create-payload'), import( /* webpackChunkName: "create-post-interaction-log-payload" */'../create-post-interaction-log-payload')]).then(function (_ref) {
|
|
112
110
|
var _ref2 = _slicedToArray(_ref, 3),
|
|
@@ -53,7 +53,7 @@ function getReportedInitiatorTypes(xhrEnabled) {
|
|
|
53
53
|
}
|
|
54
54
|
return ufoConfig.allowedResources;
|
|
55
55
|
}
|
|
56
|
-
function evaluateAccessToResourceTimings(
|
|
56
|
+
function evaluateAccessToResourceTimings(_, entry) {
|
|
57
57
|
return !(entry.responseStart === 0 && entry.startTime > entry.responseStart);
|
|
58
58
|
}
|
|
59
59
|
|