@atlaskit/react-ufo 3.4.11 → 3.4.13

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 (29) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/create-payload/index.js +1 -1
  3. package/dist/cjs/create-payload/utils/get-vc-metrics.js +2 -2
  4. package/dist/cjs/vc/vc-observer/getVCRevisionsData.js +1 -2
  5. package/dist/cjs/vc/vc-observer/observers/index.js +7 -0
  6. package/dist/cjs/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +35 -0
  7. package/dist/cjs/vc/vc-observer/revisions/fy25_02.js +1 -1
  8. package/dist/cjs/vc/vc-observer-new/viewport-observer/index.js +13 -0
  9. package/dist/es2019/create-payload/index.js +1 -1
  10. package/dist/es2019/create-payload/utils/get-vc-metrics.js +2 -1
  11. package/dist/es2019/vc/vc-observer/getVCRevisionsData.js +1 -2
  12. package/dist/es2019/vc/vc-observer/observers/index.js +7 -0
  13. package/dist/es2019/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +31 -0
  14. package/dist/es2019/vc/vc-observer/revisions/fy25_02.js +1 -1
  15. package/dist/es2019/vc/vc-observer-new/viewport-observer/index.js +13 -0
  16. package/dist/esm/create-payload/index.js +1 -1
  17. package/dist/esm/create-payload/utils/get-vc-metrics.js +2 -2
  18. package/dist/esm/vc/vc-observer/getVCRevisionsData.js +1 -2
  19. package/dist/esm/vc/vc-observer/observers/index.js +7 -0
  20. package/dist/esm/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +30 -0
  21. package/dist/esm/vc/vc-observer/revisions/fy25_02.js +1 -1
  22. package/dist/esm/vc/vc-observer-new/viewport-observer/index.js +13 -0
  23. package/dist/types/common/vc/types.d.ts +1 -1
  24. package/dist/types/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.d.ts +14 -0
  25. package/dist/types/vc/vc-observer-new/types.d.ts +1 -1
  26. package/dist/types-ts4.5/common/vc/types.d.ts +1 -1
  27. package/dist/types-ts4.5/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.d.ts +14 -0
  28. package/dist/types-ts4.5/vc/vc-observer-new/types.d.ts +1 -1
  29. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 3.4.13
4
+
5
+ ### Patch Changes
6
+
7
+ - [#136326](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/136326)
8
+ [`df5ce1960f52f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/df5ce1960f52f) -
9
+ add null check for vc90 result
10
+
11
+ ## 3.4.12
12
+
13
+ ### Patch Changes
14
+
15
+ - [#134926](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/134926)
16
+ [`707705f102735`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/707705f102735) -
17
+ clean up platform_ufo_fix_v2_reported_vc90 FG
18
+
3
19
  ## 3.4.11
4
20
 
5
21
  ### Patch Changes
@@ -316,7 +316,7 @@ var getAssetsMetrics = function getAssetsMetrics(interaction, SSRDoneTime) {
316
316
  try {
317
317
  var config = (0, _config.getConfig)();
318
318
  var type = interaction.type;
319
- var allowedTypes = ['page_load', 'transition'];
319
+ var allowedTypes = ['page_load'];
320
320
  var assetsConfig = config === null || config === void 0 ? void 0 : config.assetsConfig;
321
321
  if (!allowedTypes.includes(type) || !assetsConfig) {
322
322
  // Skip if: type not allowed or assetsClassification isn't configured
@@ -23,7 +23,7 @@ function getVCMetrics(_x) {
23
23
  function _getVCMetrics() {
24
24
  _getVCMetrics = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(interaction) {
25
25
  var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$experimentalI;
26
- var config, interactionStatus, pageVisibilityUpToTTAI, isSSREnabled, ssr, tti, prefix, result, ttvcV2Revision, VC;
26
+ var config, interactionStatus, pageVisibilityUpToTTAI, isSSREnabled, ssr, tti, prefix, result, _result$ufoVcRev, ttvcV2Revision, VC;
27
27
  return _regenerator.default.wrap(function _callee$(_context) {
28
28
  while (1) switch (_context.prev = _context.next) {
29
29
  case 0:
@@ -74,7 +74,7 @@ function _getVCMetrics() {
74
74
  _context.next = 26;
75
75
  break;
76
76
  }
77
- ttvcV2Revision = (result === null || result === void 0 ? void 0 : result['ufo:vc:rev']).find(function (_ref) {
77
+ ttvcV2Revision = result === null || result === void 0 || (_result$ufoVcRev = result['ufo:vc:rev']) === null || _result$ufoVcRev === void 0 ? void 0 : _result$ufoVcRev.find(function (_ref) {
78
78
  var revision = _ref.revision;
79
79
  return revision === 'fy25.02';
80
80
  });
@@ -61,11 +61,10 @@ function getVCRevisionsData(_ref) {
61
61
  }];
62
62
  })) : {}
63
63
  };
64
- var ttvcV2ReportedMetric = (0, _platformFeatureFlags.fg)('platform_ufo_fix_v2_reported_vc90') ? calculatedVCNext.VC['90'] : calculatedVC.VC['90'];
65
64
  var ttvcV2Revision = {
66
65
  revision: 'fy25.02',
67
66
  clean: isVCClean,
68
- 'metric:vc90': shouldHaveVCmetric ? ttvcV2ReportedMetric : null,
67
+ 'metric:vc90': shouldHaveVCmetric ? calculatedVCNext.VC['90'] : null,
69
68
  vcDetails: shouldHaveVCmetric ? Object.fromEntries(VCParts.map(function (key) {
70
69
  var _calculatedVCNext$VCB;
71
70
  return [key, {
@@ -12,6 +12,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
12
  var _config = require("../../../config");
13
13
  var _vcUtils = require("../media-wrapper/vc-utils");
14
14
  var _editorLnv = require("./editor-lnv");
15
+ var _isNonVisualStyleMutation = _interopRequireDefault(require("./non-visual-styles/is-non-visual-style-mutation"));
15
16
  var _ssrPlaceholders = require("./ssr-placeholders");
16
17
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
17
18
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -224,9 +225,15 @@ var Observers = exports.Observers = /*#__PURE__*/function () {
224
225
  var oldValue = (_mutation$oldValue = mutation.oldValue) !== null && _mutation$oldValue !== void 0 ? _mutation$oldValue : undefined;
225
226
  var newValue = mutation.attributeName ? mutation.target.getAttribute(mutation.attributeName) : undefined;
226
227
  if (oldValue !== newValue) {
228
+ if ((0, _isNonVisualStyleMutation.default)(mutation)) {
229
+ ignoreReason = 'non-visual-style';
230
+ }
227
231
  _this2.observeElement(mutation.target, mutation, 'attr', ignoreReason);
228
232
  }
229
233
  } else {
234
+ if ((0, _isNonVisualStyleMutation.default)(mutation)) {
235
+ ignoreReason = 'non-visual-style';
236
+ }
230
237
  _this2.observeElement(mutation.target, mutation, 'attr', ignoreReason);
231
238
  }
232
239
  }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = isNonVisualStyleMutation;
7
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
8
+ /**
9
+ * Checks if a mutation record represents a non-visual style change
10
+ * @param mutation - The mutation record to check
11
+ * @returns boolean indicating if this is a non-visual style mutation
12
+ *
13
+ * A mutation is considered non-visual if:
14
+ * - The target has data- vc-nvs="true" attribute
15
+ * - The changed attribute is either 'class' or 'style'
16
+ */
17
+
18
+ function isNonVisualStyleMutation(_ref) {
19
+ var target = _ref.target,
20
+ attributeName = _ref.attributeName;
21
+ var isNonVisualStyleMutationEnabled = (0, _platformFeatureFlags.fg)('platform_ufo_non_visual_style_mutation');
22
+ if (!isNonVisualStyleMutationEnabled) {
23
+ return false;
24
+ }
25
+ if (!(target instanceof Element)) {
26
+ return false;
27
+ }
28
+ if (attributeName !== 'class' && attributeName !== 'style') {
29
+ return false;
30
+ }
31
+ if (target.getAttribute('data-vc-nvs') !== 'true') {
32
+ return false;
33
+ }
34
+ return true;
35
+ }
@@ -27,7 +27,7 @@ var FY25_02Classifier = exports.FY25_02Classifier = /*#__PURE__*/function (_FY25
27
27
  filter: function filter(_ref) {
28
28
  var type = _ref.type,
29
29
  ignoreReason = _ref.ignoreReason;
30
- return !(ignoreReason !== null && ignoreReason !== void 0 && ignoreReason.includes('not-visible'));
30
+ return !(ignoreReason !== null && ignoreReason !== void 0 && ignoreReason.includes('not-visible')) && ignoreReason !== 'non-visual-style';
31
31
  }
32
32
  }]);
33
33
  (0, _defineProperty2.default)(_this, "removedFilters", []);
@@ -8,6 +8,7 @@ exports.default = 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 _vcUtils = require("../../vc-observer/media-wrapper/vc-utils");
11
+ var _isNonVisualStyleMutation = _interopRequireDefault(require("../../vc-observer/observers/non-visual-styles/is-non-visual-style-mutation"));
11
12
  var _intersectionObserver = require("./intersection-observer");
12
13
  var _mutationObserver = _interopRequireDefault(require("./mutation-observer"));
13
14
  var _performanceObserver = _interopRequireDefault(require("./performance-observer"));
@@ -127,6 +128,18 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
127
128
  }
128
129
  };
129
130
  }
131
+ if ((0, _isNonVisualStyleMutation.default)({
132
+ target: target,
133
+ attributeName: attributeName,
134
+ type: 'attributes'
135
+ })) {
136
+ return {
137
+ type: 'mutation:attribute:non-visual-style',
138
+ mutationData: {
139
+ attributeName: attributeName
140
+ }
141
+ };
142
+ }
130
143
  var lastElementRect = _this.mapVisibleNodeRects.get(target);
131
144
  if (lastElementRect && sameRectSize(rect, lastElementRect)) {
132
145
  return {
@@ -275,7 +275,7 @@ const getAssetsMetrics = (interaction, SSRDoneTime) => {
275
275
  const {
276
276
  type
277
277
  } = interaction;
278
- const allowedTypes = ['page_load', 'transition'];
278
+ const allowedTypes = ['page_load'];
279
279
  const assetsConfig = config === null || config === void 0 ? void 0 : config.assetsConfig;
280
280
  if (!allowedTypes.includes(type) || !assetsConfig) {
281
281
  // Skip if: type not allowed or assetsClassification isn't configured
@@ -40,7 +40,8 @@ export default async function getVCMetrics(interaction) {
40
40
  }
41
41
  postInteractionLog.setLastInteractionFinishVCResult(result);
42
42
  if (fg('platform_ufo_disable_ttvc_v1')) {
43
- const ttvcV2Revision = (result === null || result === void 0 ? void 0 : result['ufo:vc:rev']).find(({
43
+ var _result$ufoVcRev;
44
+ const ttvcV2Revision = result === null || result === void 0 ? void 0 : (_result$ufoVcRev = result['ufo:vc:rev']) === null || _result$ufoVcRev === void 0 ? void 0 : _result$ufoVcRev.find(({
44
45
  revision
45
46
  }) => revision === 'fy25.02');
46
47
  if (!(ttvcV2Revision !== null && ttvcV2Revision !== void 0 && ttvcV2Revision.clean)) {
@@ -52,11 +52,10 @@ export function getVCRevisionsData({
52
52
  }];
53
53
  })) : {}
54
54
  };
55
- const ttvcV2ReportedMetric = fg('platform_ufo_fix_v2_reported_vc90') ? calculatedVCNext.VC['90'] : calculatedVC.VC['90'];
56
55
  const ttvcV2Revision = {
57
56
  revision: 'fy25.02',
58
57
  clean: isVCClean,
59
- 'metric:vc90': shouldHaveVCmetric ? ttvcV2ReportedMetric : null,
58
+ 'metric:vc90': shouldHaveVCmetric ? calculatedVCNext.VC['90'] : null,
60
59
  vcDetails: shouldHaveVCmetric ? Object.fromEntries(VCParts.map(key => {
61
60
  var _calculatedVCNext$VCB;
62
61
  return [key, {
@@ -3,6 +3,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
3
3
  import { shouldHandleEditorLnv } from '../../../config';
4
4
  import { isContainedWithinMediaWrapper } from '../media-wrapper/vc-utils';
5
5
  import { EditorLnvHandler } from './editor-lnv';
6
+ import isNonVisualStyleMutation from './non-visual-styles/is-non-visual-style-mutation';
6
7
  import { SSRPlaceholderHandlers } from './ssr-placeholders';
7
8
  const state = {
8
9
  normal: 1,
@@ -196,9 +197,15 @@ export class Observers {
196
197
  const oldValue = (_mutation$oldValue = mutation.oldValue) !== null && _mutation$oldValue !== void 0 ? _mutation$oldValue : undefined;
197
198
  const newValue = mutation.attributeName ? mutation.target.getAttribute(mutation.attributeName) : undefined;
198
199
  if (oldValue !== newValue) {
200
+ if (isNonVisualStyleMutation(mutation)) {
201
+ ignoreReason = 'non-visual-style';
202
+ }
199
203
  this.observeElement(mutation.target, mutation, 'attr', ignoreReason);
200
204
  }
201
205
  } else {
206
+ if (isNonVisualStyleMutation(mutation)) {
207
+ ignoreReason = 'non-visual-style';
208
+ }
202
209
  this.observeElement(mutation.target, mutation, 'attr', ignoreReason);
203
210
  }
204
211
  }
@@ -0,0 +1,31 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags';
2
+
3
+ /**
4
+ * Checks if a mutation record represents a non-visual style change
5
+ * @param mutation - The mutation record to check
6
+ * @returns boolean indicating if this is a non-visual style mutation
7
+ *
8
+ * A mutation is considered non-visual if:
9
+ * - The target has data- vc-nvs="true" attribute
10
+ * - The changed attribute is either 'class' or 'style'
11
+ */
12
+
13
+ export default function isNonVisualStyleMutation({
14
+ target,
15
+ attributeName
16
+ }) {
17
+ const isNonVisualStyleMutationEnabled = fg('platform_ufo_non_visual_style_mutation');
18
+ if (!isNonVisualStyleMutationEnabled) {
19
+ return false;
20
+ }
21
+ if (!(target instanceof Element)) {
22
+ return false;
23
+ }
24
+ if (attributeName !== 'class' && attributeName !== 'style') {
25
+ return false;
26
+ }
27
+ if (target.getAttribute('data-vc-nvs') !== 'true') {
28
+ return false;
29
+ }
30
+ return true;
31
+ }
@@ -25,7 +25,7 @@ export class FY25_02Classifier extends FY25_01Classifier {
25
25
  type,
26
26
  ignoreReason
27
27
  }) => {
28
- return !(ignoreReason !== null && ignoreReason !== void 0 && ignoreReason.includes('not-visible'));
28
+ return !(ignoreReason !== null && ignoreReason !== void 0 && ignoreReason.includes('not-visible')) && ignoreReason !== 'non-visual-style';
29
29
  }
30
30
  }]);
31
31
  _defineProperty(this, "removedFilters", []);
@@ -1,4 +1,5 @@
1
1
  import { isContainedWithinMediaWrapper } from '../../vc-observer/media-wrapper/vc-utils';
2
+ import isNonVisualStyleMutation from '../../vc-observer/observers/non-visual-styles/is-non-visual-style-mutation';
2
3
  import { createIntersectionObserver } from './intersection-observer';
3
4
  import createMutationObserver from './mutation-observer';
4
5
  import createPerformanceObserver from './performance-observer';
@@ -113,6 +114,18 @@ export default class ViewportObserver {
113
114
  }
114
115
  };
115
116
  }
117
+ if (isNonVisualStyleMutation({
118
+ target,
119
+ attributeName,
120
+ type: 'attributes'
121
+ })) {
122
+ return {
123
+ type: 'mutation:attribute:non-visual-style',
124
+ mutationData: {
125
+ attributeName
126
+ }
127
+ };
128
+ }
116
129
  const lastElementRect = this.mapVisibleNodeRects.get(target);
117
130
  if (lastElementRect && sameRectSize(rect, lastElementRect)) {
118
131
  return {
@@ -305,7 +305,7 @@ var getAssetsMetrics = function getAssetsMetrics(interaction, SSRDoneTime) {
305
305
  try {
306
306
  var config = getConfig();
307
307
  var type = interaction.type;
308
- var allowedTypes = ['page_load', 'transition'];
308
+ var allowedTypes = ['page_load'];
309
309
  var assetsConfig = config === null || config === void 0 ? void 0 : config.assetsConfig;
310
310
  if (!allowedTypes.includes(type) || !assetsConfig) {
311
311
  // Skip if: type not allowed or assetsClassification isn't configured
@@ -16,7 +16,7 @@ export default function getVCMetrics(_x) {
16
16
  function _getVCMetrics() {
17
17
  _getVCMetrics = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(interaction) {
18
18
  var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$experimentalI;
19
- var config, interactionStatus, pageVisibilityUpToTTAI, isSSREnabled, ssr, tti, prefix, result, ttvcV2Revision, VC;
19
+ var config, interactionStatus, pageVisibilityUpToTTAI, isSSREnabled, ssr, tti, prefix, result, _result$ufoVcRev, ttvcV2Revision, VC;
20
20
  return _regeneratorRuntime.wrap(function _callee$(_context) {
21
21
  while (1) switch (_context.prev = _context.next) {
22
22
  case 0:
@@ -67,7 +67,7 @@ function _getVCMetrics() {
67
67
  _context.next = 26;
68
68
  break;
69
69
  }
70
- ttvcV2Revision = (result === null || result === void 0 ? void 0 : result['ufo:vc:rev']).find(function (_ref) {
70
+ ttvcV2Revision = result === null || result === void 0 || (_result$ufoVcRev = result['ufo:vc:rev']) === null || _result$ufoVcRev === void 0 ? void 0 : _result$ufoVcRev.find(function (_ref) {
71
71
  var revision = _ref.revision;
72
72
  return revision === 'fy25.02';
73
73
  });
@@ -54,11 +54,10 @@ export function getVCRevisionsData(_ref) {
54
54
  }];
55
55
  })) : {}
56
56
  };
57
- var ttvcV2ReportedMetric = fg('platform_ufo_fix_v2_reported_vc90') ? calculatedVCNext.VC['90'] : calculatedVC.VC['90'];
58
57
  var ttvcV2Revision = {
59
58
  revision: 'fy25.02',
60
59
  clean: isVCClean,
61
- 'metric:vc90': shouldHaveVCmetric ? ttvcV2ReportedMetric : null,
60
+ 'metric:vc90': shouldHaveVCmetric ? calculatedVCNext.VC['90'] : null,
62
61
  vcDetails: shouldHaveVCmetric ? Object.fromEntries(VCParts.map(function (key) {
63
62
  var _calculatedVCNext$VCB;
64
63
  return [key, {
@@ -7,6 +7,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
7
7
  import { shouldHandleEditorLnv } from '../../../config';
8
8
  import { isContainedWithinMediaWrapper } from '../media-wrapper/vc-utils';
9
9
  import { EditorLnvHandler } from './editor-lnv';
10
+ import isNonVisualStyleMutation from './non-visual-styles/is-non-visual-style-mutation';
10
11
  import { SSRPlaceholderHandlers } from './ssr-placeholders';
11
12
  var state = {
12
13
  normal: 1,
@@ -217,9 +218,15 @@ export var Observers = /*#__PURE__*/function () {
217
218
  var oldValue = (_mutation$oldValue = mutation.oldValue) !== null && _mutation$oldValue !== void 0 ? _mutation$oldValue : undefined;
218
219
  var newValue = mutation.attributeName ? mutation.target.getAttribute(mutation.attributeName) : undefined;
219
220
  if (oldValue !== newValue) {
221
+ if (isNonVisualStyleMutation(mutation)) {
222
+ ignoreReason = 'non-visual-style';
223
+ }
220
224
  _this2.observeElement(mutation.target, mutation, 'attr', ignoreReason);
221
225
  }
222
226
  } else {
227
+ if (isNonVisualStyleMutation(mutation)) {
228
+ ignoreReason = 'non-visual-style';
229
+ }
223
230
  _this2.observeElement(mutation.target, mutation, 'attr', ignoreReason);
224
231
  }
225
232
  }
@@ -0,0 +1,30 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags';
2
+
3
+ /**
4
+ * Checks if a mutation record represents a non-visual style change
5
+ * @param mutation - The mutation record to check
6
+ * @returns boolean indicating if this is a non-visual style mutation
7
+ *
8
+ * A mutation is considered non-visual if:
9
+ * - The target has data- vc-nvs="true" attribute
10
+ * - The changed attribute is either 'class' or 'style'
11
+ */
12
+
13
+ export default function isNonVisualStyleMutation(_ref) {
14
+ var target = _ref.target,
15
+ attributeName = _ref.attributeName;
16
+ var isNonVisualStyleMutationEnabled = fg('platform_ufo_non_visual_style_mutation');
17
+ if (!isNonVisualStyleMutationEnabled) {
18
+ return false;
19
+ }
20
+ if (!(target instanceof Element)) {
21
+ return false;
22
+ }
23
+ if (attributeName !== 'class' && attributeName !== 'style') {
24
+ return false;
25
+ }
26
+ if (target.getAttribute('data-vc-nvs') !== 'true') {
27
+ return false;
28
+ }
29
+ return true;
30
+ }
@@ -20,7 +20,7 @@ export var FY25_02Classifier = /*#__PURE__*/function (_FY25_01Classifier) {
20
20
  filter: function filter(_ref) {
21
21
  var type = _ref.type,
22
22
  ignoreReason = _ref.ignoreReason;
23
- return !(ignoreReason !== null && ignoreReason !== void 0 && ignoreReason.includes('not-visible'));
23
+ return !(ignoreReason !== null && ignoreReason !== void 0 && ignoreReason.includes('not-visible')) && ignoreReason !== 'non-visual-style';
24
24
  }
25
25
  }]);
26
26
  _defineProperty(_this, "removedFilters", []);
@@ -4,6 +4,7 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
4
4
  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; } }
5
5
  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; }
6
6
  import { isContainedWithinMediaWrapper } from '../../vc-observer/media-wrapper/vc-utils';
7
+ import isNonVisualStyleMutation from '../../vc-observer/observers/non-visual-styles/is-non-visual-style-mutation';
7
8
  import { createIntersectionObserver } from './intersection-observer';
8
9
  import createMutationObserver from './mutation-observer';
9
10
  import createPerformanceObserver from './performance-observer';
@@ -120,6 +121,18 @@ var ViewportObserver = /*#__PURE__*/function () {
120
121
  }
121
122
  };
122
123
  }
124
+ if (isNonVisualStyleMutation({
125
+ target: target,
126
+ attributeName: attributeName,
127
+ type: 'attributes'
128
+ })) {
129
+ return {
130
+ type: 'mutation:attribute:non-visual-style',
131
+ mutationData: {
132
+ attributeName: attributeName
133
+ }
134
+ };
135
+ }
123
136
  var lastElementRect = _this.mapVisibleNodeRects.get(target);
124
137
  if (lastElementRect && sameRectSize(rect, lastElementRect)) {
125
138
  return {
@@ -37,7 +37,7 @@ export type VCEntryType = {
37
37
  vc: number;
38
38
  elements: string[];
39
39
  };
40
- export type VCIgnoreReason = 'image' | 'ssr-hydration' | 'editor-lazy-node-view' | 'not-visible' | 'editor-container-mutation' | '';
40
+ export type VCIgnoreReason = 'image' | 'ssr-hydration' | 'editor-lazy-node-view' | 'not-visible' | 'editor-container-mutation' | 'non-visual-style' | '';
41
41
  export type ComponentsLogEntry = {
42
42
  targetName: string;
43
43
  __debug__element: WeakRef<Element> | null;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Checks if a mutation record represents a non-visual style change
3
+ * @param mutation - The mutation record to check
4
+ * @returns boolean indicating if this is a non-visual style mutation
5
+ *
6
+ * A mutation is considered non-visual if:
7
+ * - The target has data- vc-nvs="true" attribute
8
+ * - The changed attribute is either 'class' or 'style'
9
+ */
10
+ export default function isNonVisualStyleMutation({ target, attributeName, }: {
11
+ type: string;
12
+ target?: Node | null;
13
+ attributeName?: string | null;
14
+ }): boolean;
@@ -1,5 +1,5 @@
1
1
  import type { ObservedWindowEvent } from './window-event-observer';
2
- export type VCObserverEntryType = 'mutation:child-element' | 'mutation:remount' | 'mutation:element' | 'mutation:element-replacement' | 'mutation:attribute:no-layout-shift' | 'mutation:attribute' | 'mutation:media' | 'layout-shift' | 'window:event' | 'unknown';
2
+ export type VCObserverEntryType = 'mutation:child-element' | 'mutation:remount' | 'mutation:element' | 'mutation:element-replacement' | 'mutation:attribute:no-layout-shift' | 'mutation:attribute:non-visual-style' | 'mutation:attribute' | 'mutation:media' | 'layout-shift' | 'window:event' | 'unknown';
3
3
  export type ViewportEntryData = {
4
4
  readonly elementName: string;
5
5
  readonly rect: DOMRect;
@@ -37,7 +37,7 @@ export type VCEntryType = {
37
37
  vc: number;
38
38
  elements: string[];
39
39
  };
40
- export type VCIgnoreReason = 'image' | 'ssr-hydration' | 'editor-lazy-node-view' | 'not-visible' | 'editor-container-mutation' | '';
40
+ export type VCIgnoreReason = 'image' | 'ssr-hydration' | 'editor-lazy-node-view' | 'not-visible' | 'editor-container-mutation' | 'non-visual-style' | '';
41
41
  export type ComponentsLogEntry = {
42
42
  targetName: string;
43
43
  __debug__element: WeakRef<Element> | null;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Checks if a mutation record represents a non-visual style change
3
+ * @param mutation - The mutation record to check
4
+ * @returns boolean indicating if this is a non-visual style mutation
5
+ *
6
+ * A mutation is considered non-visual if:
7
+ * - The target has data- vc-nvs="true" attribute
8
+ * - The changed attribute is either 'class' or 'style'
9
+ */
10
+ export default function isNonVisualStyleMutation({ target, attributeName, }: {
11
+ type: string;
12
+ target?: Node | null;
13
+ attributeName?: string | null;
14
+ }): boolean;
@@ -1,5 +1,5 @@
1
1
  import type { ObservedWindowEvent } from './window-event-observer';
2
- export type VCObserverEntryType = 'mutation:child-element' | 'mutation:remount' | 'mutation:element' | 'mutation:element-replacement' | 'mutation:attribute:no-layout-shift' | 'mutation:attribute' | 'mutation:media' | 'layout-shift' | 'window:event' | 'unknown';
2
+ export type VCObserverEntryType = 'mutation:child-element' | 'mutation:remount' | 'mutation:element' | 'mutation:element-replacement' | 'mutation:attribute:no-layout-shift' | 'mutation:attribute:non-visual-style' | 'mutation:attribute' | 'mutation:media' | 'layout-shift' | 'window:event' | 'unknown';
3
3
  export type ViewportEntryData = {
4
4
  readonly elementName: string;
5
5
  readonly rect: DOMRect;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "3.4.11",
3
+ "version": "3.4.13",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -181,10 +181,10 @@
181
181
  "platform_ufo_vc_ignore_same_value_mutation": {
182
182
  "type": "boolean"
183
183
  },
184
- "platform_ufo_fix_v2_reported_vc90": {
184
+ "platform_ufo_disable_ttvc_v1": {
185
185
  "type": "boolean"
186
186
  },
187
- "platform_ufo_disable_ttvc_v1": {
187
+ "platform_ufo_non_visual_style_mutation": {
188
188
  "type": "boolean"
189
189
  }
190
190
  }