@atlaskit/react-ufo 4.14.8 → 4.15.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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 4.15.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`30a6e92ff3dda`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/30a6e92ff3dda) -
8
+ disable usage of getComputedStyle in VC observer
9
+
10
+ ## 4.15.0
11
+
12
+ ### Minor Changes
13
+
14
+ - [`5bd9159b5173c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5bd9159b5173c) -
15
+ Change fy25_03 media measurement to correctly exclude cursor styles
16
+
3
17
  ## 4.14.8
4
18
 
5
19
  ### Patch Changes
@@ -8,6 +8,7 @@ exports.SSRPlaceholderHandlers = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
12
  var ANCESTOR_LOOKUP_LIMIT = 10;
12
13
  var PAGE_LAYOUT_ID = 'page-layout.root';
13
14
  var SSRPlaceholderHandlers = exports.SSRPlaceholderHandlers = /*#__PURE__*/function () {
@@ -290,6 +291,9 @@ var SSRPlaceholderHandlers = exports.SSRPlaceholderHandlers = /*#__PURE__*/funct
290
291
  }, {
291
292
  key: "getEffectiveBoundingRect",
292
293
  value: function getEffectiveBoundingRect(el) {
294
+ if ((0, _platformFeatureFlags.fg)('platform_ufo_disable_vcnext_observations')) {
295
+ return el.getBoundingClientRect();
296
+ }
293
297
  var computedStyle = window.getComputedStyle(el);
294
298
 
295
299
  // If element has display: contents, collect bounding rect from children
@@ -65,7 +65,7 @@ var VCCalculator_FY25_03 = exports.default = /*#__PURE__*/function (_AbstractVCC
65
65
  if (entry.data.type === 'mutation:media' && (0, _platformFeatureFlags.fg)('media-perf-uplift-mutation-fix')) {
66
66
  var entryData = entry.data;
67
67
  var attributeName = entryData.attributeName;
68
- if (attributeName && (/data-(test|file|context)-\S+/g.test(attributeName) || attributeName === 'alt' || (attributeName === 'localid' || attributeName === 'contenteditable' || attributeName === 'anchor-name') && (0, _expVal.expVal)('platform_editor_media_vc_fixes', 'isEnabled', false))) {
68
+ if (attributeName && (/data-(test|file|context|cursor)-\S+/g.test(attributeName) || attributeName === 'alt' || (attributeName === 'localid' || attributeName === 'contenteditable' || attributeName === 'anchor-name') && (0, _expVal.expVal)('platform_editor_media_vc_fixes', 'isEnabled', false))) {
69
69
  return false;
70
70
  }
71
71
 
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.getMutatedElements = getMutatedElements;
8
8
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
9
10
  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; } } }; }
10
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; } }
11
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,6 +14,12 @@ var MAX_NESTED_LEVELS_OF_DISPLAY_CONTENT_ELEMENTS_HANDLED = 3;
13
14
  function getMutatedElements(element) {
14
15
  var _window;
15
16
  var depthLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
17
+ if ((0, _platformFeatureFlags.fg)('platform_ufo_disable_vcnext_observations')) {
18
+ return [{
19
+ element: element,
20
+ isDisplayContentsElementChildren: false
21
+ }];
22
+ }
16
23
  if (((_window = window) === null || _window === void 0 || (_window = _window.getComputedStyle(element)) === null || _window === void 0 ? void 0 : _window.display) === 'contents') {
17
24
  var mutatedElements = [];
18
25
  var nestedDisplayContentsElementChildren = [];
@@ -1,4 +1,5 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import { fg } from '@atlaskit/platform-feature-flags';
2
3
  const ANCESTOR_LOOKUP_LIMIT = 10;
3
4
  const PAGE_LAYOUT_ID = 'page-layout.root';
4
5
  export class SSRPlaceholderHandlers {
@@ -246,6 +247,9 @@ export class SSRPlaceholderHandlers {
246
247
  * by collecting dimensions from their children instead
247
248
  */
248
249
  getEffectiveBoundingRect(el) {
250
+ if (fg('platform_ufo_disable_vcnext_observations')) {
251
+ return el.getBoundingClientRect();
252
+ }
249
253
  const computedStyle = window.getComputedStyle(el);
250
254
 
251
255
  // If element has display: contents, collect bounding rect from children
@@ -47,7 +47,7 @@ export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
47
47
  if (entry.data.type === 'mutation:media' && fg('media-perf-uplift-mutation-fix')) {
48
48
  const entryData = entry.data;
49
49
  const attributeName = entryData.attributeName;
50
- if (attributeName && (/data-(test|file|context)-\S+/g.test(attributeName) || attributeName === 'alt' || (attributeName === 'localid' || attributeName === 'contenteditable' || attributeName === 'anchor-name') && expVal('platform_editor_media_vc_fixes', 'isEnabled', false))) {
50
+ if (attributeName && (/data-(test|file|context|cursor)-\S+/g.test(attributeName) || attributeName === 'alt' || (attributeName === 'localid' || attributeName === 'contenteditable' || attributeName === 'anchor-name') && expVal('platform_editor_media_vc_fixes', 'isEnabled', false))) {
51
51
  return false;
52
52
  }
53
53
 
@@ -1,6 +1,13 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags';
1
2
  const MAX_NESTED_LEVELS_OF_DISPLAY_CONTENT_ELEMENTS_HANDLED = 3;
2
3
  export function getMutatedElements(element, depthLevel = 0) {
3
4
  var _window, _window$getComputedSt;
5
+ if (fg('platform_ufo_disable_vcnext_observations')) {
6
+ return [{
7
+ element,
8
+ isDisplayContentsElementChildren: false
9
+ }];
10
+ }
4
11
  if (((_window = window) === null || _window === void 0 ? void 0 : (_window$getComputedSt = _window.getComputedStyle(element)) === null || _window$getComputedSt === void 0 ? void 0 : _window$getComputedSt.display) === 'contents') {
5
12
  const mutatedElements = [];
6
13
  const nestedDisplayContentsElementChildren = [];
@@ -1,6 +1,7 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  var ANCESTOR_LOOKUP_LIMIT = 10;
5
6
  var PAGE_LAYOUT_ID = 'page-layout.root';
6
7
  export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
@@ -283,6 +284,9 @@ export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
283
284
  }, {
284
285
  key: "getEffectiveBoundingRect",
285
286
  value: function getEffectiveBoundingRect(el) {
287
+ if (fg('platform_ufo_disable_vcnext_observations')) {
288
+ return el.getBoundingClientRect();
289
+ }
286
290
  var computedStyle = window.getComputedStyle(el);
287
291
 
288
292
  // If element has display: contents, collect bounding rect from children
@@ -58,7 +58,7 @@ var VCCalculator_FY25_03 = /*#__PURE__*/function (_AbstractVCCalculator) {
58
58
  if (entry.data.type === 'mutation:media' && fg('media-perf-uplift-mutation-fix')) {
59
59
  var entryData = entry.data;
60
60
  var attributeName = entryData.attributeName;
61
- if (attributeName && (/data-(test|file|context)-\S+/g.test(attributeName) || attributeName === 'alt' || (attributeName === 'localid' || attributeName === 'contenteditable' || attributeName === 'anchor-name') && expVal('platform_editor_media_vc_fixes', 'isEnabled', false))) {
61
+ if (attributeName && (/data-(test|file|context|cursor)-\S+/g.test(attributeName) || attributeName === 'alt' || (attributeName === 'localid' || attributeName === 'contenteditable' || attributeName === 'anchor-name') && expVal('platform_editor_media_vc_fixes', 'isEnabled', false))) {
62
62
  return false;
63
63
  }
64
64
 
@@ -2,10 +2,17 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  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; } } }; }
3
3
  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; } }
4
4
  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; }
5
+ import { fg } from '@atlaskit/platform-feature-flags';
5
6
  var MAX_NESTED_LEVELS_OF_DISPLAY_CONTENT_ELEMENTS_HANDLED = 3;
6
7
  export function getMutatedElements(element) {
7
8
  var _window;
8
9
  var depthLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
10
+ if (fg('platform_ufo_disable_vcnext_observations')) {
11
+ return [{
12
+ element: element,
13
+ isDisplayContentsElementChildren: false
14
+ }];
15
+ }
9
16
  if (((_window = window) === null || _window === void 0 || (_window = _window.getComputedStyle(element)) === null || _window === void 0 ? void 0 : _window.display) === 'contents') {
10
17
  var mutatedElements = [];
11
18
  var nestedDisplayContentsElementChildren = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "4.14.8",
3
+ "version": "4.15.1",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -107,6 +107,9 @@
107
107
  "platform_ufo_critical_metrics_payload": {
108
108
  "type": "boolean"
109
109
  },
110
+ "platform_ufo_disable_vcnext_observations": {
111
+ "type": "boolean"
112
+ },
110
113
  "platform_ufo_remove_ssr_placeholder_in_ttvc_v4": {
111
114
  "type": "boolean"
112
115
  },