@atlaskit/react-ufo 4.11.4 → 4.11.6

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.
Files changed (23) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/interaction-metrics/index.js +2 -6
  3. package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +1 -5
  4. package/dist/cjs/vc/vc-observer-new/viewport-observer/index.js +12 -33
  5. package/dist/es2019/interaction-metrics/index.js +2 -6
  6. package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +0 -4
  7. package/dist/es2019/vc/vc-observer-new/viewport-observer/index.js +6 -20
  8. package/dist/esm/interaction-metrics/index.js +2 -6
  9. package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +1 -5
  10. package/dist/esm/vc/vc-observer-new/viewport-observer/index.js +12 -33
  11. package/dist/types/common/vc/types.d.ts +0 -1
  12. package/dist/types-ts4.5/common/vc/types.d.ts +0 -1
  13. package/package.json +4 -7
  14. package/dist/cjs/vc/vc-observer-new/viewport-observer/utils/check-display-content.js +0 -32
  15. package/dist/cjs/vc/vc-observer-new/viewport-observer/utils/track-display-content-occurrence.js +0 -19
  16. package/dist/es2019/vc/vc-observer-new/viewport-observer/utils/check-display-content.js +0 -14
  17. package/dist/es2019/vc/vc-observer-new/viewport-observer/utils/track-display-content-occurrence.js +0 -10
  18. package/dist/esm/vc/vc-observer-new/viewport-observer/utils/check-display-content.js +0 -26
  19. package/dist/esm/vc/vc-observer-new/viewport-observer/utils/track-display-content-occurrence.js +0 -10
  20. package/dist/types/vc/vc-observer-new/viewport-observer/utils/check-display-content.d.ts +0 -1
  21. package/dist/types/vc/vc-observer-new/viewport-observer/utils/track-display-content-occurrence.d.ts +0 -3
  22. package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/utils/check-display-content.d.ts +0 -1
  23. package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/utils/track-display-content-occurrence.d.ts +0 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 4.11.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b629e44ac5c35`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b629e44ac5c35) -
8
+ Do not send prior fg for press interactions
9
+
10
+ ## 4.11.5
11
+
12
+ ### Patch Changes
13
+
14
+ - [`c7f300b3eed72`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c7f300b3eed72) -
15
+ FG cleanup of display contents tracking flags
16
+
3
17
  ## 4.11.4
4
18
 
5
19
  ### Patch Changes
@@ -60,7 +60,6 @@ var _experienceTraceIdContext = require("../experience-trace-id-context");
60
60
  var _featureFlagsAccessed = require("../feature-flags-accessed");
61
61
  var _interactionIdContext = require("../interaction-id-context");
62
62
  var _vc = require("../vc");
63
- var _trackDisplayContentOccurrence = require("../vc/vc-observer-new/viewport-observer/utils/track-display-content-occurrence");
64
63
  var _constants = require("./common/constants");
65
64
  var _interactionExtraMetrics = _interopRequireDefault(require("./interaction-extra-metrics"));
66
65
  var _postInteractionLog = _interopRequireDefault(require("./post-interaction-log"));
@@ -1010,7 +1009,6 @@ function addOnCancelCallback(id, cancelCallback) {
1010
1009
  }
1011
1010
  function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelStack, routeName) {
1012
1011
  var trace = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
1013
- (0, _trackDisplayContentOccurrence.resetCssIssueOccurrence)();
1014
1012
  interactionExtraMetrics.reset();
1015
1013
  postInteractionLog.reset();
1016
1014
  var vcObserver;
@@ -1047,9 +1045,7 @@ function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelS
1047
1045
  };
1048
1046
  vcObserver = (0, _vc.newVCObserver)(vcOptions);
1049
1047
  }
1050
-
1051
- // Create per-interaction VC observer when feature flag is enabled
1052
-
1048
+ var priorAccessedFg = type === 'press' && (0, _platformFeatureFlags.fg)('platform_ufo_drop_prior_fg_interactions') ? {} : Object.fromEntries(_featureFlagsAccessed.allFeatureFlagsAccessed);
1053
1049
  var metrics = {
1054
1050
  id: interactionId,
1055
1051
  start: startTime,
@@ -1081,7 +1077,7 @@ function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelS
1081
1077
  labelStack: labelStack,
1082
1078
  routeName: routeName !== null && routeName !== void 0 ? routeName : ufoName,
1083
1079
  featureFlags: addFeatureFlagsToInteraction ? {
1084
- prior: Object.fromEntries(_featureFlagsAccessed.allFeatureFlagsAccessed),
1080
+ prior: priorAccessedFg,
1085
1081
  during: {}
1086
1082
  } : undefined,
1087
1083
  knownSegments: [],
@@ -13,7 +13,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
13
13
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
14
14
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
15
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
- var _trackDisplayContentOccurrence = require("../viewport-observer/utils/track-display-content-occurrence");
17
16
  var _percentileCalc = require("./percentile-calc");
18
17
  var _getViewportHeight = _interopRequireDefault(require("./utils/get-viewport-height"));
19
18
  var _getViewportWidth = _interopRequireDefault(require("./utils/get-viewport-width"));
@@ -419,11 +418,8 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
419
418
  if (isPostInteraction) {
420
419
  result.labelStacks = this.getLabelStacks(filteredEntries);
421
420
  }
422
- if ((0, _platformFeatureFlags.fg)('platform_ufo_display_content_track_occurrence')) {
423
- result.displayContentsOccurrence = _trackDisplayContentOccurrence.cssIssueOccurrence;
424
- }
425
421
  return _context2.abrupt("return", result);
426
- case 18:
422
+ case 17:
427
423
  case "end":
428
424
  return _context2.stop();
429
425
  }
@@ -19,14 +19,12 @@ var _rllPlaceholders = require("../../vc-observer/observers/rll-placeholders");
19
19
  var _intersectionObserver = require("./intersection-observer");
20
20
  var _mutationObserver = _interopRequireDefault(require("./mutation-observer"));
21
21
  var _performanceObserver = _interopRequireDefault(require("./performance-observer"));
22
- var _checkDisplayContent = _interopRequireDefault(require("./utils/check-display-content"));
23
22
  var _checkWithinComponent2 = _interopRequireWildcard(require("./utils/check-within-component"));
24
23
  var _getMutatedElements = require("./utils/get-mutated-elements");
25
24
  var _isElementVisible = require("./utils/is-element-visible");
26
25
  var _isInVcIgnoreIfNoLayoutShiftMarker = _interopRequireDefault(require("./utils/is-in-vc-ignore-if-no-layout-shift-marker"));
27
26
  var _isSameRectDimensions = require("./utils/is-same-rect-dimensions");
28
27
  var _isSameRectSize = require("./utils/is-same-rect-size");
29
- var _trackDisplayContentOccurrence = _interopRequireDefault(require("./utils/track-display-content-occurrence"));
30
28
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
31
29
  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; } } }; }
32
30
  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; } }
@@ -101,7 +99,7 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
101
99
  _iterator = _createForOfIteratorHelper(addedNodes);
102
100
  _context2.prev = 4;
103
101
  _loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
104
- var addedNodeRef, addedNode, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, _this$intersectionObs3, result, _this$intersectionObs4, sameDeletedNode, isInIgnoreLsMarker, _this$intersectionObs5, _this$intersectionObs6, _checkWithinComponent, isWithinThirdPartySegment, _this$intersectionObs7, _iterator2, _step2, _step2$value, isDisplayContentsElementChildren, element, _this$intersectionObs8, _this$intersectionObs9, validTargets, _iterator3, _step3, _this$intersectionObs0, validTarget, _this$intersectionObs1;
102
+ var addedNodeRef, addedNode, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, _this$intersectionObs3, result, _this$intersectionObs4, sameDeletedNode, isInIgnoreLsMarker, _this$intersectionObs5, _this$intersectionObs6, _checkWithinComponent, isWithinThirdPartySegment, _this$intersectionObs7, _iterator2, _step2, _step2$value, isDisplayContentsElementChildren, element, _this$intersectionObs8, _this$intersectionObs9, _this$intersectionObs0;
105
103
  return _regenerator.default.wrap(function _loop$(_context) {
106
104
  while (1) switch (_context.prev = _context.next) {
107
105
  case 0:
@@ -230,26 +228,7 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
230
228
  _iterator2.f();
231
229
  }
232
230
  } else {
233
- if ((0, _platformFeatureFlags.fg)('platform_ufo_display_content_resolution_ttvc_v3')) {
234
- // Check if the target has display:content css property, return array of valid targets
235
- validTargets = (0, _checkDisplayContent.default)(addedNode);
236
- _iterator3 = _createForOfIteratorHelper(validTargets);
237
- try {
238
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
239
- validTarget = _step3.value;
240
- (_this$intersectionObs0 = _this.intersectionObserver) === null || _this$intersectionObs0 === void 0 || _this$intersectionObs0.watchAndTag(validTarget, createElementMutationsWatcher(removedNodeRects));
241
- }
242
- } catch (err) {
243
- _iterator3.e(err);
244
- } finally {
245
- _iterator3.f();
246
- }
247
- } else {
248
- if ((0, _platformFeatureFlags.fg)('platform_ufo_display_content_track_occurrence')) {
249
- (0, _trackDisplayContentOccurrence.default)(addedNode);
250
- }
251
- (_this$intersectionObs1 = _this.intersectionObserver) === null || _this$intersectionObs1 === void 0 || _this$intersectionObs1.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
252
- }
231
+ (_this$intersectionObs0 = _this.intersectionObserver) === null || _this$intersectionObs0 === void 0 || _this$intersectionObs0.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
253
232
  }
254
233
  case 46:
255
234
  case "end":
@@ -296,12 +275,12 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
296
275
  };
297
276
  }());
298
277
  (0, _defineProperty2.default)(this, "handleAttributeMutation", function (_ref6) {
299
- var _this$intersectionObs10;
278
+ var _this$intersectionObs1;
300
279
  var target = _ref6.target,
301
280
  attributeName = _ref6.attributeName,
302
281
  oldValue = _ref6.oldValue,
303
282
  newValue = _ref6.newValue;
304
- (_this$intersectionObs10 = _this.intersectionObserver) === null || _this$intersectionObs10 === void 0 || _this$intersectionObs10.watchAndTag(target, function (_ref7) {
283
+ (_this$intersectionObs1 = _this.intersectionObserver) === null || _this$intersectionObs1 === void 0 || _this$intersectionObs1.watchAndTag(target, function (_ref7) {
305
284
  var target = _ref7.target,
306
285
  rect = _ref7.rect;
307
286
  if ((0, _vcUtils.isContainedWithinMediaWrapper)(target)) {
@@ -378,11 +357,11 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
378
357
  (0, _defineProperty2.default)(this, "handleLayoutShift", function (_ref8) {
379
358
  var time = _ref8.time,
380
359
  changedRects = _ref8.changedRects;
381
- var _iterator4 = _createForOfIteratorHelper(changedRects),
382
- _step4;
360
+ var _iterator3 = _createForOfIteratorHelper(changedRects),
361
+ _step3;
383
362
  try {
384
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
385
- var changedRect = _step4.value;
363
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
364
+ var changedRect = _step3.value;
386
365
  var target = changedRect.node;
387
366
  if (target) {
388
367
  if ((0, _platformFeatureFlags.fg)('platform_ufo_vc_next_filter_ls_entries_same_rect')) {
@@ -408,9 +387,9 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
408
387
  }
409
388
  }
410
389
  } catch (err) {
411
- _iterator4.e(err);
390
+ _iterator3.e(err);
412
391
  } finally {
413
- _iterator4.f();
392
+ _iterator3.f();
414
393
  }
415
394
  });
416
395
  this.mapVisibleNodeRects = new WeakMap();
@@ -467,12 +446,12 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
467
446
  }, {
468
447
  key: "stop",
469
448
  value: function stop() {
470
- var _this$mutationObserve2, _this$intersectionObs11, _this$performanceObse2;
449
+ var _this$mutationObserve2, _this$intersectionObs10, _this$performanceObse2;
471
450
  if (!this.isStarted) {
472
451
  return;
473
452
  }
474
453
  (_this$mutationObserve2 = this.mutationObserver) === null || _this$mutationObserve2 === void 0 || _this$mutationObserve2.disconnect();
475
- (_this$intersectionObs11 = this.intersectionObserver) === null || _this$intersectionObs11 === void 0 || _this$intersectionObs11.disconnect();
454
+ (_this$intersectionObs10 = this.intersectionObserver) === null || _this$intersectionObs10 === void 0 || _this$intersectionObs10.disconnect();
476
455
  (_this$performanceObse2 = this.performanceObserver) === null || _this$performanceObse2 === void 0 || _this$performanceObse2.disconnect();
477
456
  this.isStarted = false;
478
457
  // Clean up caches when stopping
@@ -9,7 +9,6 @@ import { clearActiveTrace } from '../experience-trace-id-context';
9
9
  import { allFeatureFlagsAccessed, currentFeatureFlagsAccessed } from '../feature-flags-accessed';
10
10
  import { getInteractionId } from '../interaction-id-context';
11
11
  import { newVCObserver } from '../vc';
12
- import { resetCssIssueOccurrence } from '../vc/vc-observer-new/viewport-observer/utils/track-display-content-occurrence';
13
12
  import { interactions } from './common/constants';
14
13
  import InteractionExtraMetrics from './interaction-extra-metrics';
15
14
  import PostInteractionLog from './post-interaction-log';
@@ -889,7 +888,6 @@ export function addOnCancelCallback(id, cancelCallback) {
889
888
  interaction === null || interaction === void 0 ? void 0 : interaction.cancelCallbacks.push(cancelCallback);
890
889
  }
891
890
  export function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelStack, routeName, trace = null) {
892
- resetCssIssueOccurrence();
893
891
  interactionExtraMetrics.reset();
894
892
  postInteractionLog.reset();
895
893
  let vcObserver;
@@ -926,9 +924,7 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
926
924
  };
927
925
  vcObserver = newVCObserver(vcOptions);
928
926
  }
929
-
930
- // Create per-interaction VC observer when feature flag is enabled
931
-
927
+ const priorAccessedFg = type === 'press' && fg('platform_ufo_drop_prior_fg_interactions') ? {} : Object.fromEntries(allFeatureFlagsAccessed);
932
928
  const metrics = {
933
929
  id: interactionId,
934
930
  start: startTime,
@@ -960,7 +956,7 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
960
956
  labelStack,
961
957
  routeName: routeName !== null && routeName !== void 0 ? routeName : ufoName,
962
958
  featureFlags: addFeatureFlagsToInteraction ? {
963
- prior: Object.fromEntries(allFeatureFlagsAccessed),
959
+ prior: priorAccessedFg,
964
960
  during: {}
965
961
  } : undefined,
966
962
  knownSegments: [],
@@ -1,5 +1,4 @@
1
1
  import { fg } from '@atlaskit/platform-feature-flags';
2
- import { cssIssueOccurrence } from '../viewport-observer/utils/track-display-content-occurrence';
3
2
  import { calculateTTVCPercentilesWithDebugInfo } from './percentile-calc';
4
3
  import getViewportHeight from './utils/get-viewport-height';
5
4
  import getViewportWidth from './utils/get-viewport-width';
@@ -304,9 +303,6 @@ export default class AbstractVCCalculatorBase {
304
303
  if (isPostInteraction) {
305
304
  result.labelStacks = this.getLabelStacks(filteredEntries);
306
305
  }
307
- if (fg('platform_ufo_display_content_track_occurrence')) {
308
- result.displayContentsOccurrence = cssIssueOccurrence;
309
- }
310
306
  return result;
311
307
  }
312
308
  }
@@ -7,14 +7,12 @@ import { RLLPlaceholderHandlers } from '../../vc-observer/observers/rll-placehol
7
7
  import { createIntersectionObserver } from './intersection-observer';
8
8
  import createMutationObserver from './mutation-observer';
9
9
  import createPerformanceObserver from './performance-observer';
10
- import checkCssProperty from './utils/check-display-content';
11
10
  import checkWithinComponent, { cleanupCaches } from './utils/check-within-component';
12
11
  import { getMutatedElements } from './utils/get-mutated-elements';
13
12
  import { isElementVisible } from './utils/is-element-visible';
14
13
  import isInVCIgnoreIfNoLayoutShiftMarker from './utils/is-in-vc-ignore-if-no-layout-shift-marker';
15
14
  import { isSameRectDimensions } from './utils/is-same-rect-dimensions';
16
15
  import { isSameRectSize } from './utils/is-same-rect-size';
17
- import trackDisplayContentsOccurrence from './utils/track-display-content-occurrence';
18
16
  const createElementMutationsWatcher = removedNodeRects => ({
19
17
  target,
20
18
  rect
@@ -176,20 +174,8 @@ export default class ViewportObserver {
176
174
  }
177
175
  }
178
176
  } else {
179
- if (fg('platform_ufo_display_content_resolution_ttvc_v3')) {
180
- // Check if the target has display:content css property, return array of valid targets
181
- const validTargets = checkCssProperty(addedNode);
182
- for (const validTarget of validTargets) {
183
- var _this$intersectionObs0;
184
- (_this$intersectionObs0 = this.intersectionObserver) === null || _this$intersectionObs0 === void 0 ? void 0 : _this$intersectionObs0.watchAndTag(validTarget, createElementMutationsWatcher(removedNodeRects));
185
- }
186
- } else {
187
- var _this$intersectionObs1;
188
- if (fg('platform_ufo_display_content_track_occurrence')) {
189
- trackDisplayContentsOccurrence(addedNode);
190
- }
191
- (_this$intersectionObs1 = this.intersectionObserver) === null || _this$intersectionObs1 === void 0 ? void 0 : _this$intersectionObs1.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
192
- }
177
+ var _this$intersectionObs0;
178
+ (_this$intersectionObs0 = this.intersectionObserver) === null || _this$intersectionObs0 === void 0 ? void 0 : _this$intersectionObs0.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
193
179
  }
194
180
  }
195
181
  });
@@ -199,8 +185,8 @@ export default class ViewportObserver {
199
185
  oldValue,
200
186
  newValue
201
187
  }) => {
202
- var _this$intersectionObs10;
203
- (_this$intersectionObs10 = this.intersectionObserver) === null || _this$intersectionObs10 === void 0 ? void 0 : _this$intersectionObs10.watchAndTag(target, ({
188
+ var _this$intersectionObs1;
189
+ (_this$intersectionObs1 = this.intersectionObserver) === null || _this$intersectionObs1 === void 0 ? void 0 : _this$intersectionObs1.watchAndTag(target, ({
204
190
  target,
205
191
  rect
206
192
  }) => {
@@ -353,12 +339,12 @@ export default class ViewportObserver {
353
339
  this.isStarted = true;
354
340
  }
355
341
  stop() {
356
- var _this$mutationObserve2, _this$intersectionObs11, _this$performanceObse2;
342
+ var _this$mutationObserve2, _this$intersectionObs10, _this$performanceObse2;
357
343
  if (!this.isStarted) {
358
344
  return;
359
345
  }
360
346
  (_this$mutationObserve2 = this.mutationObserver) === null || _this$mutationObserve2 === void 0 ? void 0 : _this$mutationObserve2.disconnect();
361
- (_this$intersectionObs11 = this.intersectionObserver) === null || _this$intersectionObs11 === void 0 ? void 0 : _this$intersectionObs11.disconnect();
347
+ (_this$intersectionObs10 = this.intersectionObserver) === null || _this$intersectionObs10 === void 0 ? void 0 : _this$intersectionObs10.disconnect();
362
348
  (_this$performanceObse2 = this.performanceObserver) === null || _this$performanceObse2 === void 0 ? void 0 : _this$performanceObse2.disconnect();
363
349
  this.isStarted = false;
364
350
  // Clean up caches when stopping
@@ -19,7 +19,6 @@ import { clearActiveTrace } from '../experience-trace-id-context';
19
19
  import { allFeatureFlagsAccessed, currentFeatureFlagsAccessed } from '../feature-flags-accessed';
20
20
  import { getInteractionId } from '../interaction-id-context';
21
21
  import { newVCObserver } from '../vc';
22
- import { resetCssIssueOccurrence } from '../vc/vc-observer-new/viewport-observer/utils/track-display-content-occurrence';
23
22
  import { interactions } from './common/constants';
24
23
  import InteractionExtraMetrics from './interaction-extra-metrics';
25
24
  import PostInteractionLog from './post-interaction-log';
@@ -964,7 +963,6 @@ export function addOnCancelCallback(id, cancelCallback) {
964
963
  }
965
964
  export function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelStack, routeName) {
966
965
  var trace = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
967
- resetCssIssueOccurrence();
968
966
  interactionExtraMetrics.reset();
969
967
  postInteractionLog.reset();
970
968
  var vcObserver;
@@ -1001,9 +999,7 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
1001
999
  };
1002
1000
  vcObserver = newVCObserver(vcOptions);
1003
1001
  }
1004
-
1005
- // Create per-interaction VC observer when feature flag is enabled
1006
-
1002
+ var priorAccessedFg = type === 'press' && fg('platform_ufo_drop_prior_fg_interactions') ? {} : Object.fromEntries(allFeatureFlagsAccessed);
1007
1003
  var metrics = {
1008
1004
  id: interactionId,
1009
1005
  start: startTime,
@@ -1035,7 +1031,7 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
1035
1031
  labelStack: labelStack,
1036
1032
  routeName: routeName !== null && routeName !== void 0 ? routeName : ufoName,
1037
1033
  featureFlags: addFeatureFlagsToInteraction ? {
1038
- prior: Object.fromEntries(allFeatureFlagsAccessed),
1034
+ prior: priorAccessedFg,
1039
1035
  during: {}
1040
1036
  } : undefined,
1041
1037
  knownSegments: [],
@@ -11,7 +11,6 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
11
11
  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; } }
12
12
  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; }
13
13
  import { fg } from '@atlaskit/platform-feature-flags';
14
- import { cssIssueOccurrence } from '../viewport-observer/utils/track-display-content-occurrence';
15
14
  import { calculateTTVCPercentilesWithDebugInfo } from './percentile-calc';
16
15
  import getViewportHeight from './utils/get-viewport-height';
17
16
  import getViewportWidth from './utils/get-viewport-width';
@@ -413,11 +412,8 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
413
412
  if (isPostInteraction) {
414
413
  result.labelStacks = this.getLabelStacks(filteredEntries);
415
414
  }
416
- if (fg('platform_ufo_display_content_track_occurrence')) {
417
- result.displayContentsOccurrence = cssIssueOccurrence;
418
- }
419
415
  return _context2.abrupt("return", result);
420
- case 18:
416
+ case 17:
421
417
  case "end":
422
418
  return _context2.stop();
423
419
  }
@@ -14,14 +14,12 @@ import { RLLPlaceholderHandlers } from '../../vc-observer/observers/rll-placehol
14
14
  import { createIntersectionObserver } from './intersection-observer';
15
15
  import createMutationObserver from './mutation-observer';
16
16
  import createPerformanceObserver from './performance-observer';
17
- import checkCssProperty from './utils/check-display-content';
18
17
  import checkWithinComponent, { cleanupCaches } from './utils/check-within-component';
19
18
  import { getMutatedElements } from './utils/get-mutated-elements';
20
19
  import { isElementVisible } from './utils/is-element-visible';
21
20
  import isInVCIgnoreIfNoLayoutShiftMarker from './utils/is-in-vc-ignore-if-no-layout-shift-marker';
22
21
  import { isSameRectDimensions } from './utils/is-same-rect-dimensions';
23
22
  import { isSameRectSize } from './utils/is-same-rect-size';
24
- import trackDisplayContentsOccurrence from './utils/track-display-content-occurrence';
25
23
  var createElementMutationsWatcher = function createElementMutationsWatcher(removedNodeRects) {
26
24
  return function (_ref) {
27
25
  var target = _ref.target,
@@ -92,7 +90,7 @@ var ViewportObserver = /*#__PURE__*/function () {
92
90
  _iterator = _createForOfIteratorHelper(addedNodes);
93
91
  _context2.prev = 4;
94
92
  _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
95
- var addedNodeRef, addedNode, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, _this$intersectionObs3, result, _this$intersectionObs4, sameDeletedNode, isInIgnoreLsMarker, _this$intersectionObs5, _this$intersectionObs6, _checkWithinComponent, isWithinThirdPartySegment, _this$intersectionObs7, _iterator2, _step2, _step2$value, isDisplayContentsElementChildren, element, _this$intersectionObs8, _this$intersectionObs9, validTargets, _iterator3, _step3, _this$intersectionObs0, validTarget, _this$intersectionObs1;
93
+ var addedNodeRef, addedNode, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, _this$intersectionObs3, result, _this$intersectionObs4, sameDeletedNode, isInIgnoreLsMarker, _this$intersectionObs5, _this$intersectionObs6, _checkWithinComponent, isWithinThirdPartySegment, _this$intersectionObs7, _iterator2, _step2, _step2$value, isDisplayContentsElementChildren, element, _this$intersectionObs8, _this$intersectionObs9, _this$intersectionObs0;
96
94
  return _regeneratorRuntime.wrap(function _loop$(_context) {
97
95
  while (1) switch (_context.prev = _context.next) {
98
96
  case 0:
@@ -221,26 +219,7 @@ var ViewportObserver = /*#__PURE__*/function () {
221
219
  _iterator2.f();
222
220
  }
223
221
  } else {
224
- if (fg('platform_ufo_display_content_resolution_ttvc_v3')) {
225
- // Check if the target has display:content css property, return array of valid targets
226
- validTargets = checkCssProperty(addedNode);
227
- _iterator3 = _createForOfIteratorHelper(validTargets);
228
- try {
229
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
230
- validTarget = _step3.value;
231
- (_this$intersectionObs0 = _this.intersectionObserver) === null || _this$intersectionObs0 === void 0 || _this$intersectionObs0.watchAndTag(validTarget, createElementMutationsWatcher(removedNodeRects));
232
- }
233
- } catch (err) {
234
- _iterator3.e(err);
235
- } finally {
236
- _iterator3.f();
237
- }
238
- } else {
239
- if (fg('platform_ufo_display_content_track_occurrence')) {
240
- trackDisplayContentsOccurrence(addedNode);
241
- }
242
- (_this$intersectionObs1 = _this.intersectionObserver) === null || _this$intersectionObs1 === void 0 || _this$intersectionObs1.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
243
- }
222
+ (_this$intersectionObs0 = _this.intersectionObserver) === null || _this$intersectionObs0 === void 0 || _this$intersectionObs0.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
244
223
  }
245
224
  case 46:
246
225
  case "end":
@@ -287,12 +266,12 @@ var ViewportObserver = /*#__PURE__*/function () {
287
266
  };
288
267
  }());
289
268
  _defineProperty(this, "handleAttributeMutation", function (_ref6) {
290
- var _this$intersectionObs10;
269
+ var _this$intersectionObs1;
291
270
  var target = _ref6.target,
292
271
  attributeName = _ref6.attributeName,
293
272
  oldValue = _ref6.oldValue,
294
273
  newValue = _ref6.newValue;
295
- (_this$intersectionObs10 = _this.intersectionObserver) === null || _this$intersectionObs10 === void 0 || _this$intersectionObs10.watchAndTag(target, function (_ref7) {
274
+ (_this$intersectionObs1 = _this.intersectionObserver) === null || _this$intersectionObs1 === void 0 || _this$intersectionObs1.watchAndTag(target, function (_ref7) {
296
275
  var target = _ref7.target,
297
276
  rect = _ref7.rect;
298
277
  if (isContainedWithinMediaWrapper(target)) {
@@ -369,11 +348,11 @@ var ViewportObserver = /*#__PURE__*/function () {
369
348
  _defineProperty(this, "handleLayoutShift", function (_ref8) {
370
349
  var time = _ref8.time,
371
350
  changedRects = _ref8.changedRects;
372
- var _iterator4 = _createForOfIteratorHelper(changedRects),
373
- _step4;
351
+ var _iterator3 = _createForOfIteratorHelper(changedRects),
352
+ _step3;
374
353
  try {
375
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
376
- var changedRect = _step4.value;
354
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
355
+ var changedRect = _step3.value;
377
356
  var target = changedRect.node;
378
357
  if (target) {
379
358
  if (fg('platform_ufo_vc_next_filter_ls_entries_same_rect')) {
@@ -399,9 +378,9 @@ var ViewportObserver = /*#__PURE__*/function () {
399
378
  }
400
379
  }
401
380
  } catch (err) {
402
- _iterator4.e(err);
381
+ _iterator3.e(err);
403
382
  } finally {
404
- _iterator4.f();
383
+ _iterator3.f();
405
384
  }
406
385
  });
407
386
  this.mapVisibleNodeRects = new WeakMap();
@@ -458,12 +437,12 @@ var ViewportObserver = /*#__PURE__*/function () {
458
437
  }, {
459
438
  key: "stop",
460
439
  value: function stop() {
461
- var _this$mutationObserve2, _this$intersectionObs11, _this$performanceObse2;
440
+ var _this$mutationObserve2, _this$intersectionObs10, _this$performanceObse2;
462
441
  if (!this.isStarted) {
463
442
  return;
464
443
  }
465
444
  (_this$mutationObserve2 = this.mutationObserver) === null || _this$mutationObserve2 === void 0 || _this$mutationObserve2.disconnect();
466
- (_this$intersectionObs11 = this.intersectionObserver) === null || _this$intersectionObs11 === void 0 || _this$intersectionObs11.disconnect();
445
+ (_this$intersectionObs10 = this.intersectionObserver) === null || _this$intersectionObs10 === void 0 || _this$intersectionObs10.disconnect();
467
446
  (_this$performanceObse2 = this.performanceObserver) === null || _this$performanceObse2 === void 0 || _this$performanceObse2.disconnect();
468
447
  this.isStarted = false;
469
448
  // Clean up caches when stopping
@@ -128,7 +128,6 @@ export type RevisionPayloadEntry = {
128
128
  labelStacks?: VCLabelStacks;
129
129
  abortReason?: VCAbortReason | null;
130
130
  abortTimestamp?: number;
131
- displayContentsOccurrence?: number;
132
131
  };
133
132
  export type RevisionPayload = RevisionPayloadEntry[];
134
133
  export {};
@@ -128,7 +128,6 @@ export type RevisionPayloadEntry = {
128
128
  labelStacks?: VCLabelStacks;
129
129
  abortReason?: VCAbortReason | null;
130
130
  abortTimestamp?: number;
131
- displayContentsOccurrence?: number;
132
131
  };
133
132
  export type RevisionPayload = RevisionPayloadEntry[];
134
133
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "4.11.4",
3
+ "version": "4.11.6",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -136,9 +136,6 @@
136
136
  "platform_ufo_add_segments_count_threshold": {
137
137
  "type": "boolean"
138
138
  },
139
- "platform_ufo_display_content_resolution_ttvc_v3": {
140
- "type": "boolean"
141
- },
142
139
  "platform_ufo_segment_unmount_count": {
143
140
  "type": "boolean"
144
141
  },
@@ -151,9 +148,6 @@
151
148
  "platform_ufo_enable_late_holds_post_interaction": {
152
149
  "type": "boolean"
153
150
  },
154
- "platform_ufo_display_content_track_occurrence": {
155
- "type": "boolean"
156
- },
157
151
  "platform_ufo_enable_late_mutation_label_stacks": {
158
152
  "type": "boolean"
159
153
  },
@@ -174,6 +168,9 @@
174
168
  },
175
169
  "platform_report_ssr_ratio_in_v3": {
176
170
  "type": "boolean"
171
+ },
172
+ "platform_ufo_drop_prior_fg_interactions": {
173
+ "type": "boolean"
177
174
  }
178
175
  }
179
176
  }
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = checkCssProperty;
7
- 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; } } }; }
8
- 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; } }
9
- 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; }
10
- function checkCssProperty(element) {
11
- var computedStyle = window.getComputedStyle(element);
12
- if (computedStyle.display === 'contents') {
13
- // If display is 'contents', we return the direct children of the element
14
- var result = [];
15
- var _iterator = _createForOfIteratorHelper(element.children),
16
- _step;
17
- try {
18
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
19
- var child = _step.value;
20
- if (child instanceof HTMLElement) {
21
- result.push(child);
22
- }
23
- }
24
- } catch (err) {
25
- _iterator.e(err);
26
- } finally {
27
- _iterator.f();
28
- }
29
- return result;
30
- }
31
- return [element];
32
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.cssIssueOccurrence = void 0;
7
- exports.default = trackDisplayContentsOccurrence;
8
- exports.resetCssIssueOccurrence = resetCssIssueOccurrence;
9
- var _cssIssueOccurrence;
10
- var cssIssueOccurrence = exports.cssIssueOccurrence = 0;
11
- function trackDisplayContentsOccurrence(element) {
12
- var computedStyle = window.getComputedStyle(element);
13
- if (computedStyle.display === 'contents') {
14
- _cssIssueOccurrence = cssIssueOccurrence++, exports.cssIssueOccurrence = cssIssueOccurrence, _cssIssueOccurrence;
15
- }
16
- }
17
- function resetCssIssueOccurrence() {
18
- exports.cssIssueOccurrence = cssIssueOccurrence = 0;
19
- }
@@ -1,14 +0,0 @@
1
- export default function checkCssProperty(element) {
2
- const computedStyle = window.getComputedStyle(element);
3
- if (computedStyle.display === 'contents') {
4
- // If display is 'contents', we return the direct children of the element
5
- const result = [];
6
- for (const child of element.children) {
7
- if (child instanceof HTMLElement) {
8
- result.push(child);
9
- }
10
- }
11
- return result;
12
- }
13
- return [element];
14
- }
@@ -1,10 +0,0 @@
1
- export let cssIssueOccurrence = 0;
2
- export default function trackDisplayContentsOccurrence(element) {
3
- const computedStyle = window.getComputedStyle(element);
4
- if (computedStyle.display === 'contents') {
5
- cssIssueOccurrence++;
6
- }
7
- }
8
- export function resetCssIssueOccurrence() {
9
- cssIssueOccurrence = 0;
10
- }
@@ -1,26 +0,0 @@
1
- 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; } } }; }
2
- 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; } }
3
- 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; }
4
- export default function checkCssProperty(element) {
5
- var computedStyle = window.getComputedStyle(element);
6
- if (computedStyle.display === 'contents') {
7
- // If display is 'contents', we return the direct children of the element
8
- var result = [];
9
- var _iterator = _createForOfIteratorHelper(element.children),
10
- _step;
11
- try {
12
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
13
- var child = _step.value;
14
- if (child instanceof HTMLElement) {
15
- result.push(child);
16
- }
17
- }
18
- } catch (err) {
19
- _iterator.e(err);
20
- } finally {
21
- _iterator.f();
22
- }
23
- return result;
24
- }
25
- return [element];
26
- }
@@ -1,10 +0,0 @@
1
- export var cssIssueOccurrence = 0;
2
- export default function trackDisplayContentsOccurrence(element) {
3
- var computedStyle = window.getComputedStyle(element);
4
- if (computedStyle.display === 'contents') {
5
- cssIssueOccurrence++;
6
- }
7
- }
8
- export function resetCssIssueOccurrence() {
9
- cssIssueOccurrence = 0;
10
- }
@@ -1 +0,0 @@
1
- export default function checkCssProperty(element: HTMLElement): Element[];
@@ -1,3 +0,0 @@
1
- export declare let cssIssueOccurrence: number;
2
- export default function trackDisplayContentsOccurrence(element: HTMLElement): void;
3
- export declare function resetCssIssueOccurrence(): void;
@@ -1 +0,0 @@
1
- export default function checkCssProperty(element: HTMLElement): Element[];
@@ -1,3 +0,0 @@
1
- export declare let cssIssueOccurrence: number;
2
- export default function trackDisplayContentsOccurrence(element: HTMLElement): void;
3
- export declare function resetCssIssueOccurrence(): void;