@atlaskit/react-ufo 4.11.8 → 4.12.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,20 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 4.12.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`eec573b4a7a6a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/eec573b4a7a6a) -
8
+ Excluded data-test* data-file* and data-context\* attributes from media fy25_03 as they are non
9
+ visual change required internally for testing and supporting copy and paste functionality
10
+
11
+ ## 4.12.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`1c7d57038910d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1c7d57038910d) -
16
+ Adds react-ufo out of band concept, and prevents flags from impacting visual complete calculations
17
+
3
18
  ## 4.11.8
4
19
 
5
20
  ### Patch Changes
@@ -47,7 +47,6 @@ function sinkExperimentalInteractionMetrics(instance, payloadPackage) {
47
47
  var payloadPromise = payloadPackage.createExperimentalMetricsPayload(interactionId, interaction);
48
48
  payloadPromise.then(function (payload) {
49
49
  if (payload) {
50
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
51
50
  if ((0, _platformFeatureFlags.fg)('enable_ufo_devtools_api_for_extra_events')) {
52
51
  // NOTE: This API is used by the UFO DevTool Chrome Extension and Criterion
53
52
  var devToolObserver = globalThis.__ufo_devtool_onUfoPayload;
@@ -69,7 +68,6 @@ function sinkPostInteractionLog(instance, createPostInteractionLogPayload) {
69
68
  var payload = createPostInteractionLogPayload(logOutput);
70
69
  if (payload) {
71
70
  // NOTE: This API is used by the UFO DevTool Chrome Extension and also by Criterion
72
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
73
71
  if ((0, _platformFeatureFlags.fg)('enable_ufo_devtools_api_for_extra_events')) {
74
72
  var devToolObserver = globalThis.__ufo_devtool_onUfoPayload;
75
73
  if (typeof devToolObserver === 'function') {
@@ -94,7 +92,6 @@ function sinkInteractionExtraMetrics(instance, createInteractionExtraLogPayload)
94
92
  payload = _context.sent;
95
93
  if (payload) {
96
94
  // NOTE: This API is used by the UFO DevTool Chrome Extension and also by Criterion
97
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
98
95
  if ((0, _platformFeatureFlags.fg)('enable_ufo_devtools_api_for_extra_events')) {
99
96
  devToolObserver = globalThis.__ufo_devtool_onUfoPayload;
100
97
  if (typeof devToolObserver === 'function') {
@@ -7,9 +7,7 @@ exports.default = void 0;
7
7
  var _scheduler = require("scheduler");
8
8
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
9
9
  function scheduleIdleCallback(work) {
10
- if (typeof window !== 'undefined' && typeof window.requestIdleCallback === 'function' &&
11
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
12
- (0, _platformFeatureFlags.fg)('ufo_payload_use_idle_callback')) {
10
+ if (typeof window !== 'undefined' && typeof window.requestIdleCallback === 'function' && (0, _platformFeatureFlags.fg)('ufo_payload_use_idle_callback')) {
13
11
  window.requestIdleCallback(work);
14
12
  } else {
15
13
  (0, _scheduler.unstable_scheduleCallback)(_scheduler.unstable_IdlePriority, work);
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.expVal = void 0;
8
+ var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
9
+ var _featureFlagsAccessed = require("../feature-flags-accessed");
10
+ // copied from '@atlaskit/tmp-editor-statsig/expVal' to avoid circular dependency
11
+ var expVal = exports.expVal = function expVal(experimentName, experimentParam, defaultValue) {
12
+ // If client is not initialized, we return the default value
13
+ if (!_featureGateJsClient.default.initializeCompleted()) {
14
+ return defaultValue;
15
+ }
16
+
17
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
18
+ var experimentValue = _featureGateJsClient.default.getExperimentValue(experimentName, experimentParam, defaultValue);
19
+ (0, _featureFlagsAccessed.addFeatureFlagAccessed)("".concat(experimentName, ":").concat(experimentParam), experimentValue);
20
+ return experimentValue;
21
+ };
@@ -1,28 +1,14 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = void 0;
8
- var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
9
7
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
- var _featureFlagsAccessed = require("../../../../feature-flags-accessed");
8
+ var _expVal = require("../../../expVal");
11
9
  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; } } }; }
12
10
  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; } }
13
11
  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; }
14
- // copied from '@atlaskit/tmp-editor-statsig/expVal' to avoid circular dependency
15
- var expVal = function expVal(experimentName, experimentParam, defaultValue) {
16
- // If client is not initialized, we return the default value
17
- if (!_featureGateJsClient.default.initializeCompleted()) {
18
- return defaultValue;
19
- }
20
-
21
- // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
22
- var experimentValue = _featureGateJsClient.default.getExperimentValue(experimentName, experimentParam, defaultValue);
23
- (0, _featureFlagsAccessed.addFeatureFlagAccessed)("".concat(experimentName, ":").concat(experimentParam), experimentValue);
24
- return experimentValue;
25
- };
26
12
  var isDnDStyleChange = function isDnDStyleChange(style) {
27
13
  return style.startsWith('anchor-name: --node-anchor');
28
14
  };
@@ -64,7 +50,7 @@ function isDnDStyleMutation(_ref) {
64
50
  if (!(0, _platformFeatureFlags.fg)('platform_editor_exclude_dnd_anchor_name_from_ttvc')) {
65
51
  return false;
66
52
  }
67
- if (!expVal('platform_editor_tables_scaling_css', 'excludeDnD', false)) {
53
+ if (!(0, _expVal.expVal)('platform_editor_tables_scaling_css', 'excludeDnD', false)) {
68
54
  return false;
69
55
  }
70
56
  if (!(target instanceof Element)) {
@@ -64,13 +64,20 @@ var VCCalculator_FY25_03 = exports.default = /*#__PURE__*/function (_AbstractVCC
64
64
  if (excludeSmartAnswersInSearch && (0, _isEntrySmartAnswersInSearch.isEntrySmartAnswersInSearch)(entry)) {
65
65
  return false;
66
66
  }
67
- if (entry.data.type === 'mutation:attribute') {
67
+ if (entry.data.type === 'mutation:media' && (0, _platformFeatureFlags.fg)('media-perf-uplift-mutation-fix')) {
68
68
  var entryData = entry.data;
69
69
  var attributeName = entryData.attributeName;
70
- if (!attributeName || KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS.includes(attributeName)) {
70
+ if (attributeName && (/data-(test|file|context)-\S+/g.test(attributeName) || attributeName === 'alt')) {
71
+ return false;
72
+ }
73
+ }
74
+ if (entry.data.type === 'mutation:attribute') {
75
+ var _entryData = entry.data;
76
+ var _attributeName = _entryData.attributeName;
77
+ if (!_attributeName || KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS.includes(_attributeName)) {
71
78
  return false;
72
79
  }
73
- if (attributeName.startsWith('data-test') || attributeName === 'data-aui-version' || attributeName === 'data-testid' || attributeName === 'data-vc' || attributeName === 'data-ssr-placeholder' || attributeName === 'data-ssr-placeholder-replace' || attributeName === 'data-vc-nvs' || attributeName === 'data-media-vc-wrapper' || attributeName === 'data-renderer-start-pos' || attributeName === 'data-table-local-id' || attributeName === 'spellcheck' || attributeName === 'data-auto-scrollable' || attributeName === 'id' || attributeName === 'tabindex' || attributeName === 'data-is-ttvc-ready' || attributeName === 'contenteditable' || attributeName === 'data-has-collab-initialised' || attributeName === 'translate' || NON_VISUAL_ARIA_ATTRIBUTES.includes(attributeName) || THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES.includes(attributeName) && (0, _platformFeatureFlags.fg)('platform_ufo_exclude_3p_extensions_from_ttvc')) {
80
+ if (_attributeName.startsWith('data-test') || _attributeName === 'data-aui-version' || _attributeName === 'data-testid' || _attributeName === 'data-vc' || _attributeName === 'data-ssr-placeholder' || _attributeName === 'data-ssr-placeholder-replace' || _attributeName === 'data-vc-nvs' || _attributeName === 'data-media-vc-wrapper' || _attributeName === 'data-renderer-start-pos' || _attributeName === 'data-table-local-id' || _attributeName === 'spellcheck' || _attributeName === 'data-auto-scrollable' || _attributeName === 'id' || _attributeName === 'tabindex' || _attributeName === 'data-is-ttvc-ready' || _attributeName === 'contenteditable' || _attributeName === 'data-has-collab-initialised' || _attributeName === 'translate' || NON_VISUAL_ARIA_ATTRIBUTES.includes(_attributeName) || THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES.includes(_attributeName) && (0, _platformFeatureFlags.fg)('platform_ufo_exclude_3p_extensions_from_ttvc')) {
74
81
  return false;
75
82
  }
76
83
  return true;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+ var _expVal = require("../../../expVal");
7
8
  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
9
  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
10
  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; }
@@ -29,6 +30,16 @@ function createMutationObserver(_ref) {
29
30
  if (!(mut.target instanceof HTMLElement)) {
30
31
  return 0; // continue
31
32
  }
33
+ if ((0, _expVal.expVal)('cc_editor_vc_exclude_flags', 'isEnabled', false)) {
34
+ // Intended for excluding out of band mutations such as tooltips on hover, and page flags
35
+ // Currently being tested in Confluence
36
+ // Skip elements with data-vc-oob attribute
37
+ if (mut.target.dataset.vcOob) {
38
+ return {
39
+ v: void 0
40
+ };
41
+ }
42
+ }
32
43
  if (mut.type === 'attributes') {
33
44
  var _mut$oldValue;
34
45
  /*
@@ -95,6 +106,7 @@ function createMutationObserver(_ref) {
95
106
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
96
107
  _ret = _loop();
97
108
  if (_ret === 0) continue;
109
+ if (_ret) return _ret.v;
98
110
  }
99
111
 
100
112
  // Process all batched childList mutations
@@ -35,7 +35,6 @@ function sinkExperimentalInteractionMetrics(instance, payloadPackage) {
35
35
  const payloadPromise = payloadPackage.createExperimentalMetricsPayload(interactionId, interaction);
36
36
  payloadPromise.then(payload => {
37
37
  if (payload) {
38
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
39
38
  if (fg('enable_ufo_devtools_api_for_extra_events')) {
40
39
  // NOTE: This API is used by the UFO DevTool Chrome Extension and Criterion
41
40
  const devToolObserver = globalThis.__ufo_devtool_onUfoPayload;
@@ -57,7 +56,6 @@ function sinkPostInteractionLog(instance, createPostInteractionLogPayload) {
57
56
  const payload = createPostInteractionLogPayload(logOutput);
58
57
  if (payload) {
59
58
  // NOTE: This API is used by the UFO DevTool Chrome Extension and also by Criterion
60
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
61
59
  if (fg('enable_ufo_devtools_api_for_extra_events')) {
62
60
  const devToolObserver = globalThis.__ufo_devtool_onUfoPayload;
63
61
  if (typeof devToolObserver === 'function') {
@@ -75,7 +73,6 @@ function sinkInteractionExtraMetrics(instance, createInteractionExtraLogPayload)
75
73
  const payload = await createInteractionExtraLogPayload(interactionId, interaction, lastInteractionFinish, lastInteractionFinishVCResult);
76
74
  if (payload) {
77
75
  // NOTE: This API is used by the UFO DevTool Chrome Extension and also by Criterion
78
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
79
76
  if (fg('enable_ufo_devtools_api_for_extra_events')) {
80
77
  const devToolObserver = globalThis.__ufo_devtool_onUfoPayload;
81
78
  if (typeof devToolObserver === 'function') {
@@ -1,9 +1,7 @@
1
1
  import { unstable_IdlePriority as idlePriority, unstable_scheduleCallback as scheduleCallback } from 'scheduler';
2
2
  import { fg } from '@atlaskit/platform-feature-flags';
3
3
  function scheduleIdleCallback(work) {
4
- if (typeof window !== 'undefined' && typeof window.requestIdleCallback === 'function' &&
5
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
6
- fg('ufo_payload_use_idle_callback')) {
4
+ if (typeof window !== 'undefined' && typeof window.requestIdleCallback === 'function' && fg('ufo_payload_use_idle_callback')) {
7
5
  window.requestIdleCallback(work);
8
6
  } else {
9
7
  scheduleCallback(idlePriority, work);
@@ -0,0 +1,15 @@
1
+ import FeatureGates from '@atlaskit/feature-gate-js-client';
2
+ import { addFeatureFlagAccessed } from '../feature-flags-accessed';
3
+
4
+ // copied from '@atlaskit/tmp-editor-statsig/expVal' to avoid circular dependency
5
+ export const expVal = (experimentName, experimentParam, defaultValue) => {
6
+ // If client is not initialized, we return the default value
7
+ if (!FeatureGates.initializeCompleted()) {
8
+ return defaultValue;
9
+ }
10
+
11
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
12
+ const experimentValue = FeatureGates.getExperimentValue(experimentName, experimentParam, defaultValue);
13
+ addFeatureFlagAccessed(`${experimentName}:${experimentParam}`, experimentValue);
14
+ return experimentValue;
15
+ };
@@ -1,19 +1,5 @@
1
- import FeatureGates from '@atlaskit/feature-gate-js-client';
2
1
  import { fg } from '@atlaskit/platform-feature-flags';
3
- import { addFeatureFlagAccessed } from '../../../../feature-flags-accessed';
4
-
5
- // copied from '@atlaskit/tmp-editor-statsig/expVal' to avoid circular dependency
6
- const expVal = (experimentName, experimentParam, defaultValue) => {
7
- // If client is not initialized, we return the default value
8
- if (!FeatureGates.initializeCompleted()) {
9
- return defaultValue;
10
- }
11
-
12
- // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
13
- const experimentValue = FeatureGates.getExperimentValue(experimentName, experimentParam, defaultValue);
14
- addFeatureFlagAccessed(`${experimentName}:${experimentParam}`, experimentValue);
15
- return experimentValue;
16
- };
2
+ import { expVal } from '../../../expVal';
17
3
  const isDnDStyleChange = style => {
18
4
  return style.startsWith('anchor-name: --node-anchor');
19
5
  };
@@ -46,6 +46,13 @@ export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
46
46
  if (excludeSmartAnswersInSearch && isEntrySmartAnswersInSearch(entry)) {
47
47
  return false;
48
48
  }
49
+ if (entry.data.type === 'mutation:media' && fg('media-perf-uplift-mutation-fix')) {
50
+ const entryData = entry.data;
51
+ const attributeName = entryData.attributeName;
52
+ if (attributeName && (/data-(test|file|context)-\S+/g.test(attributeName) || attributeName === 'alt')) {
53
+ return false;
54
+ }
55
+ }
49
56
  if (entry.data.type === 'mutation:attribute') {
50
57
  const entryData = entry.data;
51
58
  const attributeName = entryData.attributeName;
@@ -1,3 +1,5 @@
1
+ import { expVal } from '../../../expVal';
2
+
1
3
  // Batched mutation data for performance optimization
2
4
 
3
5
  function createMutationObserver({
@@ -17,6 +19,14 @@ function createMutationObserver({
17
19
  if (!(mut.target instanceof HTMLElement)) {
18
20
  continue;
19
21
  }
22
+ if (expVal('cc_editor_vc_exclude_flags', 'isEnabled', false)) {
23
+ // Intended for excluding out of band mutations such as tooltips on hover, and page flags
24
+ // Currently being tested in Confluence
25
+ // Skip elements with data-vc-oob attribute
26
+ if (mut.target.dataset.vcOob) {
27
+ return;
28
+ }
29
+ }
20
30
  if (mut.type === 'attributes') {
21
31
  var _mut$oldValue;
22
32
  /*
@@ -38,7 +38,6 @@ function sinkExperimentalInteractionMetrics(instance, payloadPackage) {
38
38
  var payloadPromise = payloadPackage.createExperimentalMetricsPayload(interactionId, interaction);
39
39
  payloadPromise.then(function (payload) {
40
40
  if (payload) {
41
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
42
41
  if (fg('enable_ufo_devtools_api_for_extra_events')) {
43
42
  // NOTE: This API is used by the UFO DevTool Chrome Extension and Criterion
44
43
  var devToolObserver = globalThis.__ufo_devtool_onUfoPayload;
@@ -60,7 +59,6 @@ function sinkPostInteractionLog(instance, createPostInteractionLogPayload) {
60
59
  var payload = createPostInteractionLogPayload(logOutput);
61
60
  if (payload) {
62
61
  // NOTE: This API is used by the UFO DevTool Chrome Extension and also by Criterion
63
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
64
62
  if (fg('enable_ufo_devtools_api_for_extra_events')) {
65
63
  var devToolObserver = globalThis.__ufo_devtool_onUfoPayload;
66
64
  if (typeof devToolObserver === 'function') {
@@ -85,7 +83,6 @@ function sinkInteractionExtraMetrics(instance, createInteractionExtraLogPayload)
85
83
  payload = _context.sent;
86
84
  if (payload) {
87
85
  // NOTE: This API is used by the UFO DevTool Chrome Extension and also by Criterion
88
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
89
86
  if (fg('enable_ufo_devtools_api_for_extra_events')) {
90
87
  devToolObserver = globalThis.__ufo_devtool_onUfoPayload;
91
88
  if (typeof devToolObserver === 'function') {
@@ -1,9 +1,7 @@
1
1
  import { unstable_IdlePriority as idlePriority, unstable_scheduleCallback as scheduleCallback } from 'scheduler';
2
2
  import { fg } from '@atlaskit/platform-feature-flags';
3
3
  function scheduleIdleCallback(work) {
4
- if (typeof window !== 'undefined' && typeof window.requestIdleCallback === 'function' &&
5
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
6
- fg('ufo_payload_use_idle_callback')) {
4
+ if (typeof window !== 'undefined' && typeof window.requestIdleCallback === 'function' && fg('ufo_payload_use_idle_callback')) {
7
5
  window.requestIdleCallback(work);
8
6
  } else {
9
7
  scheduleCallback(idlePriority, work);
@@ -0,0 +1,15 @@
1
+ import FeatureGates from '@atlaskit/feature-gate-js-client';
2
+ import { addFeatureFlagAccessed } from '../feature-flags-accessed';
3
+
4
+ // copied from '@atlaskit/tmp-editor-statsig/expVal' to avoid circular dependency
5
+ export var expVal = function expVal(experimentName, experimentParam, defaultValue) {
6
+ // If client is not initialized, we return the default value
7
+ if (!FeatureGates.initializeCompleted()) {
8
+ return defaultValue;
9
+ }
10
+
11
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
12
+ var experimentValue = FeatureGates.getExperimentValue(experimentName, experimentParam, defaultValue);
13
+ addFeatureFlagAccessed("".concat(experimentName, ":").concat(experimentParam), experimentValue);
14
+ return experimentValue;
15
+ };
@@ -1,22 +1,8 @@
1
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
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
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
- import FeatureGates from '@atlaskit/feature-gate-js-client';
5
4
  import { fg } from '@atlaskit/platform-feature-flags';
6
- import { addFeatureFlagAccessed } from '../../../../feature-flags-accessed';
7
-
8
- // copied from '@atlaskit/tmp-editor-statsig/expVal' to avoid circular dependency
9
- var expVal = function expVal(experimentName, experimentParam, defaultValue) {
10
- // If client is not initialized, we return the default value
11
- if (!FeatureGates.initializeCompleted()) {
12
- return defaultValue;
13
- }
14
-
15
- // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
16
- var experimentValue = FeatureGates.getExperimentValue(experimentName, experimentParam, defaultValue);
17
- addFeatureFlagAccessed("".concat(experimentName, ":").concat(experimentParam), experimentValue);
18
- return experimentValue;
19
- };
5
+ import { expVal } from '../../../expVal';
20
6
  var isDnDStyleChange = function isDnDStyleChange(style) {
21
7
  return style.startsWith('anchor-name: --node-anchor');
22
8
  };
@@ -57,13 +57,20 @@ var VCCalculator_FY25_03 = /*#__PURE__*/function (_AbstractVCCalculator) {
57
57
  if (excludeSmartAnswersInSearch && isEntrySmartAnswersInSearch(entry)) {
58
58
  return false;
59
59
  }
60
- if (entry.data.type === 'mutation:attribute') {
60
+ if (entry.data.type === 'mutation:media' && fg('media-perf-uplift-mutation-fix')) {
61
61
  var entryData = entry.data;
62
62
  var attributeName = entryData.attributeName;
63
- if (!attributeName || KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS.includes(attributeName)) {
63
+ if (attributeName && (/data-(test|file|context)-\S+/g.test(attributeName) || attributeName === 'alt')) {
64
+ return false;
65
+ }
66
+ }
67
+ if (entry.data.type === 'mutation:attribute') {
68
+ var _entryData = entry.data;
69
+ var _attributeName = _entryData.attributeName;
70
+ if (!_attributeName || KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS.includes(_attributeName)) {
64
71
  return false;
65
72
  }
66
- if (attributeName.startsWith('data-test') || attributeName === 'data-aui-version' || attributeName === 'data-testid' || attributeName === 'data-vc' || attributeName === 'data-ssr-placeholder' || attributeName === 'data-ssr-placeholder-replace' || attributeName === 'data-vc-nvs' || attributeName === 'data-media-vc-wrapper' || attributeName === 'data-renderer-start-pos' || attributeName === 'data-table-local-id' || attributeName === 'spellcheck' || attributeName === 'data-auto-scrollable' || attributeName === 'id' || attributeName === 'tabindex' || attributeName === 'data-is-ttvc-ready' || attributeName === 'contenteditable' || attributeName === 'data-has-collab-initialised' || attributeName === 'translate' || NON_VISUAL_ARIA_ATTRIBUTES.includes(attributeName) || THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES.includes(attributeName) && fg('platform_ufo_exclude_3p_extensions_from_ttvc')) {
73
+ if (_attributeName.startsWith('data-test') || _attributeName === 'data-aui-version' || _attributeName === 'data-testid' || _attributeName === 'data-vc' || _attributeName === 'data-ssr-placeholder' || _attributeName === 'data-ssr-placeholder-replace' || _attributeName === 'data-vc-nvs' || _attributeName === 'data-media-vc-wrapper' || _attributeName === 'data-renderer-start-pos' || _attributeName === 'data-table-local-id' || _attributeName === 'spellcheck' || _attributeName === 'data-auto-scrollable' || _attributeName === 'id' || _attributeName === 'tabindex' || _attributeName === 'data-is-ttvc-ready' || _attributeName === 'contenteditable' || _attributeName === 'data-has-collab-initialised' || _attributeName === 'translate' || NON_VISUAL_ARIA_ATTRIBUTES.includes(_attributeName) || THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES.includes(_attributeName) && fg('platform_ufo_exclude_3p_extensions_from_ttvc')) {
67
74
  return false;
68
75
  }
69
76
  return true;
@@ -1,6 +1,8 @@
1
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
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
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
+ import { expVal } from '../../../expVal';
5
+
4
6
  // Batched mutation data for performance optimization
5
7
 
6
8
  function createMutationObserver(_ref) {
@@ -23,6 +25,16 @@ function createMutationObserver(_ref) {
23
25
  if (!(mut.target instanceof HTMLElement)) {
24
26
  return 0; // continue
25
27
  }
28
+ if (expVal('cc_editor_vc_exclude_flags', 'isEnabled', false)) {
29
+ // Intended for excluding out of band mutations such as tooltips on hover, and page flags
30
+ // Currently being tested in Confluence
31
+ // Skip elements with data-vc-oob attribute
32
+ if (mut.target.dataset.vcOob) {
33
+ return {
34
+ v: void 0
35
+ };
36
+ }
37
+ }
26
38
  if (mut.type === 'attributes') {
27
39
  var _mut$oldValue;
28
40
  /*
@@ -89,6 +101,7 @@ function createMutationObserver(_ref) {
89
101
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
90
102
  _ret = _loop();
91
103
  if (_ret === 0) continue;
104
+ if (_ret) return _ret.v;
92
105
  }
93
106
 
94
107
  // Process all batched childList mutations
@@ -0,0 +1 @@
1
+ export declare const expVal: (experimentName: string, experimentParam: string, defaultValue: boolean) => boolean;
@@ -0,0 +1 @@
1
+ export declare const expVal: (experimentName: string, experimentParam: string, defaultValue: boolean) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "4.11.8",
3
+ "version": "4.12.1",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -162,6 +162,9 @@
162
162
  },
163
163
  "platform_ufo_drop_prior_fg_interactions": {
164
164
  "type": "boolean"
165
+ },
166
+ "media-perf-uplift-mutation-fix": {
167
+ "type": "boolean"
165
168
  }
166
169
  }
167
170
  }