@atlaskit/react-ufo 3.4.13 → 3.4.14

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 3.4.14
4
+
5
+ ### Patch Changes
6
+
7
+ - [#136647](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/136647)
8
+ [`9d50aee5de4c6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9d50aee5de4c6) -
9
+ Fix bug on ufo:vc:dom that would include element selector that is ignored
10
+
3
11
  ## 3.4.13
4
12
 
5
13
  ### Patch Changes
@@ -663,6 +663,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
663
663
 
664
664
  // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
665
665
  var isCalcSpeedIndexEnabled = (0, _platformFeatureFlags.fg)('ufo-calc-speed-index');
666
+ var isFilterIgnoredItemsEnabled = (0, _platformFeatureFlags.fg)('platform_ufo_vc_filter_ignored_items');
666
667
  entries.reduce(function () {
667
668
  var acc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
668
669
  var v = arguments.length > 1 ? arguments[1] : undefined;
@@ -677,9 +678,13 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
677
678
  VCObserver.VCParts.forEach(function (key) {
678
679
  var value = parseInt(key, 10);
679
680
  if ((VC[key] === null || VC[key] === undefined) && VCRatio >= value / 100) {
680
- var _componentsLog$time;
681
+ var _componentsLog$time, _componentsLog$time2;
681
682
  VC[key] = time;
682
- VCBox[key] = (0, _toConsumableArray2.default)(new Set((_componentsLog$time = componentsLog[time]) === null || _componentsLog$time === void 0 ? void 0 : _componentsLog$time.map(function (v) {
683
+ VCBox[key] = isFilterIgnoredItemsEnabled ? (0, _toConsumableArray2.default)(new Set((_componentsLog$time = componentsLog[time]) === null || _componentsLog$time === void 0 ? void 0 : _componentsLog$time.filter(function (v) {
684
+ return !v.ignoreReason;
685
+ }).map(function (v) {
686
+ return v.targetName;
687
+ }))) : (0, _toConsumableArray2.default)(new Set((_componentsLog$time2 = componentsLog[time]) === null || _componentsLog$time2 === void 0 ? void 0 : _componentsLog$time2.map(function (v) {
683
688
  return v.targetName;
684
689
  })));
685
690
  }
@@ -687,13 +692,17 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
687
692
  return VCRatio;
688
693
  }, 0);
689
694
  var VCEntries = entries.reduce(function (acc, _ref16, i) {
690
- var _acc$abs, _componentsLog$timest, _acc$rel$vc, _acc$rel;
695
+ var _acc$abs, _componentsLog$timest, _componentsLog$timest2, _acc$rel$vc, _acc$rel;
691
696
  var _ref17 = (0, _slicedToArray2.default)(_ref16, 2),
692
697
  timestamp = _ref17[0],
693
698
  entryPainted = _ref17[1];
694
699
  var currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
695
700
  var currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
696
- var logEntry = (0, _toConsumableArray2.default)(new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.map(function (v) {
701
+ var logEntry = isFilterIgnoredItemsEnabled ? (0, _toConsumableArray2.default)(new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.filter(function (v) {
702
+ return !v.ignoreReason;
703
+ }).map(function (v) {
704
+ return v.targetName;
705
+ }))) : (0, _toConsumableArray2.default)(new Set((_componentsLog$timest2 = componentsLog[timestamp]) === null || _componentsLog$timest2 === void 0 ? void 0 : _componentsLog$timest2.map(function (v) {
697
706
  return v.targetName;
698
707
  })));
699
708
  var ratioDelta = (currentlyPaintedRatio - ((_acc$rel$vc = (_acc$rel = acc.rel[i - 1]) === null || _acc$rel === void 0 ? void 0 : _acc$rel.vc) !== null && _acc$rel$vc !== void 0 ? _acc$rel$vc : 0)) / 100;
@@ -563,6 +563,7 @@ export class VCObserver {
563
563
 
564
564
  // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
565
565
  const isCalcSpeedIndexEnabled = fg('ufo-calc-speed-index');
566
+ const isFilterIgnoredItemsEnabled = fg('platform_ufo_vc_filter_ignored_items');
566
567
  entries.reduce((acc = 0, v) => {
567
568
  const currRatio = v[1] / totalPainted;
568
569
  let VCRatio = currRatio + acc;
@@ -575,18 +576,18 @@ export class VCObserver {
575
576
  VCObserver.VCParts.forEach(key => {
576
577
  const value = parseInt(key, 10);
577
578
  if ((VC[key] === null || VC[key] === undefined) && VCRatio >= value / 100) {
578
- var _componentsLog$time;
579
+ var _componentsLog$time, _componentsLog$time2;
579
580
  VC[key] = time;
580
- VCBox[key] = [...new Set((_componentsLog$time = componentsLog[time]) === null || _componentsLog$time === void 0 ? void 0 : _componentsLog$time.map(v => v.targetName))];
581
+ VCBox[key] = isFilterIgnoredItemsEnabled ? [...new Set((_componentsLog$time = componentsLog[time]) === null || _componentsLog$time === void 0 ? void 0 : _componentsLog$time.filter(v => !v.ignoreReason).map(v => v.targetName))] : [...new Set((_componentsLog$time2 = componentsLog[time]) === null || _componentsLog$time2 === void 0 ? void 0 : _componentsLog$time2.map(v => v.targetName))];
581
582
  }
582
583
  });
583
584
  return VCRatio;
584
585
  }, 0);
585
586
  const VCEntries = entries.reduce((acc, [timestamp, entryPainted], i) => {
586
- var _acc$abs, _componentsLog$timest, _acc$rel$vc, _acc$rel;
587
+ var _acc$abs, _componentsLog$timest, _componentsLog$timest2, _acc$rel$vc, _acc$rel;
587
588
  const currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
588
589
  const currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
589
- const logEntry = [...new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.map(v => v.targetName))];
590
+ const logEntry = isFilterIgnoredItemsEnabled ? [...new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.filter(v => !v.ignoreReason).map(v => v.targetName))] : [...new Set((_componentsLog$timest2 = componentsLog[timestamp]) === null || _componentsLog$timest2 === void 0 ? void 0 : _componentsLog$timest2.map(v => v.targetName))];
590
591
  const ratioDelta = (currentlyPaintedRatio - ((_acc$rel$vc = (_acc$rel = acc.rel[i - 1]) === null || _acc$rel === void 0 ? void 0 : _acc$rel.vc) !== null && _acc$rel$vc !== void 0 ? _acc$rel$vc : 0)) / 100;
591
592
  if (isCalcSpeedIndexEnabled) {
592
593
  const speedIndex = timestamp * ratioDelta;
@@ -656,6 +656,7 @@ export var VCObserver = /*#__PURE__*/function () {
656
656
 
657
657
  // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
658
658
  var isCalcSpeedIndexEnabled = fg('ufo-calc-speed-index');
659
+ var isFilterIgnoredItemsEnabled = fg('platform_ufo_vc_filter_ignored_items');
659
660
  entries.reduce(function () {
660
661
  var acc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
661
662
  var v = arguments.length > 1 ? arguments[1] : undefined;
@@ -670,9 +671,13 @@ export var VCObserver = /*#__PURE__*/function () {
670
671
  VCObserver.VCParts.forEach(function (key) {
671
672
  var value = parseInt(key, 10);
672
673
  if ((VC[key] === null || VC[key] === undefined) && VCRatio >= value / 100) {
673
- var _componentsLog$time;
674
+ var _componentsLog$time, _componentsLog$time2;
674
675
  VC[key] = time;
675
- VCBox[key] = _toConsumableArray(new Set((_componentsLog$time = componentsLog[time]) === null || _componentsLog$time === void 0 ? void 0 : _componentsLog$time.map(function (v) {
676
+ VCBox[key] = isFilterIgnoredItemsEnabled ? _toConsumableArray(new Set((_componentsLog$time = componentsLog[time]) === null || _componentsLog$time === void 0 ? void 0 : _componentsLog$time.filter(function (v) {
677
+ return !v.ignoreReason;
678
+ }).map(function (v) {
679
+ return v.targetName;
680
+ }))) : _toConsumableArray(new Set((_componentsLog$time2 = componentsLog[time]) === null || _componentsLog$time2 === void 0 ? void 0 : _componentsLog$time2.map(function (v) {
676
681
  return v.targetName;
677
682
  })));
678
683
  }
@@ -680,13 +685,17 @@ export var VCObserver = /*#__PURE__*/function () {
680
685
  return VCRatio;
681
686
  }, 0);
682
687
  var VCEntries = entries.reduce(function (acc, _ref16, i) {
683
- var _acc$abs, _componentsLog$timest, _acc$rel$vc, _acc$rel;
688
+ var _acc$abs, _componentsLog$timest, _componentsLog$timest2, _acc$rel$vc, _acc$rel;
684
689
  var _ref17 = _slicedToArray(_ref16, 2),
685
690
  timestamp = _ref17[0],
686
691
  entryPainted = _ref17[1];
687
692
  var currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
688
693
  var currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
689
- var logEntry = _toConsumableArray(new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.map(function (v) {
694
+ var logEntry = isFilterIgnoredItemsEnabled ? _toConsumableArray(new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.filter(function (v) {
695
+ return !v.ignoreReason;
696
+ }).map(function (v) {
697
+ return v.targetName;
698
+ }))) : _toConsumableArray(new Set((_componentsLog$timest2 = componentsLog[timestamp]) === null || _componentsLog$timest2 === void 0 ? void 0 : _componentsLog$timest2.map(function (v) {
690
699
  return v.targetName;
691
700
  })));
692
701
  var ratioDelta = (currentlyPaintedRatio - ((_acc$rel$vc = (_acc$rel = acc.rel[i - 1]) === null || _acc$rel === void 0 ? void 0 : _acc$rel.vc) !== null && _acc$rel$vc !== void 0 ? _acc$rel$vc : 0)) / 100;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "3.4.13",
3
+ "version": "3.4.14",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -186,6 +186,9 @@
186
186
  },
187
187
  "platform_ufo_non_visual_style_mutation": {
188
188
  "type": "boolean"
189
+ },
190
+ "platform_ufo_vc_filter_ignored_items": {
191
+ "type": "boolean"
189
192
  }
190
193
  }
191
194
  }