@atlaskit/react-ufo 4.15.12 → 4.15.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 +14 -0
- package/dist/cjs/vc/vc-observer/index.js +9 -0
- package/dist/cjs/vc/vc-observer-new/index.js +9 -0
- package/dist/cjs/vc/vc-observer-new/metric-calculator/fy25_03/index.js +4 -16
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/constants.js +18 -0
- package/dist/cjs/vc/vc-observer-new/metric-calculator/vcnext/index.js +9 -0
- package/dist/es2019/vc/vc-observer/index.js +9 -0
- package/dist/es2019/vc/vc-observer-new/index.js +9 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/fy25_03/index.js +2 -14
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/constants.js +12 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/vcnext/index.js +9 -0
- package/dist/esm/vc/vc-observer/index.js +9 -0
- package/dist/esm/vc/vc-observer-new/index.js +9 -0
- package/dist/esm/vc/vc-observer-new/metric-calculator/fy25_03/index.js +2 -14
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/constants.js +12 -0
- package/dist/esm/vc/vc-observer-new/metric-calculator/vcnext/index.js +9 -0
- package/dist/types/vc/vc-observer-new/metric-calculator/fy25_03/index.d.ts +0 -3
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/constants.d.ts +3 -0
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/fy25_03/index.d.ts +0 -3
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/constants.d.ts +3 -0
- package/package.json +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 4.15.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`8671d72bf688c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8671d72bf688c) -
|
|
8
|
+
add attribute exclusion list for mutation:display-contents-children-attribute
|
|
9
|
+
|
|
10
|
+
## 4.15.13
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`b7caf41846c8c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b7caf41846c8c) -
|
|
15
|
+
Prevent keypresses from aborting press interactions in react ufo
|
|
16
|
+
|
|
3
17
|
## 4.15.12
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -13,6 +13,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
17
|
var _config = require("../../config");
|
|
17
18
|
var _interactionMetrics = require("../../interaction-metrics");
|
|
18
19
|
var _attachAbortListeners = require("./attachAbortListeners");
|
|
@@ -393,6 +394,14 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
393
394
|
_this.setAbortReason(abortReason.scroll, time);
|
|
394
395
|
break;
|
|
395
396
|
case 'keydown':
|
|
397
|
+
// Don't abort press interactions on keydown events, as keydown is expected
|
|
398
|
+
// when users press Enter/Space to activate buttons or other interactive elements
|
|
399
|
+
if ((0, _platformFeatureFlags.fg)('platform_ufo_keypress_interaction_abort')) {
|
|
400
|
+
var interaction = (0, _interactionMetrics.getActiveInteraction)();
|
|
401
|
+
if ((interaction === null || interaction === void 0 ? void 0 : interaction.type) === 'press') {
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
396
405
|
_this.setAbortReason(abortReason.keypress, time);
|
|
397
406
|
break;
|
|
398
407
|
case 'resize':
|
|
@@ -13,6 +13,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
13
13
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
|
+
var _interactionMetrics = require("../../interaction-metrics");
|
|
16
17
|
var _ssrPlaceholders = require("../vc-observer/observers/ssr-placeholders");
|
|
17
18
|
var _entriesTimeline = _interopRequireDefault(require("./entries-timeline"));
|
|
18
19
|
var _getElementName2 = _interopRequireDefault(require("./get-element-name"));
|
|
@@ -113,6 +114,14 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
113
114
|
onEvent: function onEvent(_ref) {
|
|
114
115
|
var time = _ref.time,
|
|
115
116
|
type = _ref.type;
|
|
117
|
+
// Don't abort press interactions on keydown events, as keydown is expected
|
|
118
|
+
// when users press Enter/Space to activate buttons or other interactive elements
|
|
119
|
+
if (type === 'keydown' && (0, _platformFeatureFlags.fg)('platform_ufo_keypress_interaction_abort')) {
|
|
120
|
+
var interaction = (0, _interactionMetrics.getActiveInteraction)();
|
|
121
|
+
if ((interaction === null || interaction === void 0 ? void 0 : interaction.type) === 'press') {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
116
125
|
_this.entriesTimeline.push({
|
|
117
126
|
time: time,
|
|
118
127
|
data: {
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.default =
|
|
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 _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
@@ -14,6 +14,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
14
14
|
var _expVal = require("../../../expVal");
|
|
15
15
|
var _isDndStyleMutation = require("../../../vc-observer/observers/non-visual-styles/is-dnd-style-mutation");
|
|
16
16
|
var _abstractBaseVcCalculator = _interopRequireDefault(require("../abstract-base-vc-calculator"));
|
|
17
|
+
var _constants = require("../utils/constants");
|
|
17
18
|
var _isEntrySmartAnswersInSearch = require("../utils/is-entry-smart-answers-in-search");
|
|
18
19
|
var _isViewportEntryData = _interopRequireDefault(require("../utils/is-viewport-entry-data"));
|
|
19
20
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
@@ -39,19 +40,6 @@ var getConsideredEntryTypes = function getConsideredEntryTypes(include3p) {
|
|
|
39
40
|
}
|
|
40
41
|
return entryTypes;
|
|
41
42
|
};
|
|
42
|
-
|
|
43
|
-
// TODO: AFO-3523
|
|
44
|
-
// Those are the attributes we have found when testing the 'fy25.03' manually.
|
|
45
|
-
// We still need to replace this hardcoded list with a proper automation
|
|
46
|
-
var KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS = exports.KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS = ['data-drop-target-for-element', 'data-drop-target-for-external', 'draggable', 'data-is-observed'];
|
|
47
|
-
|
|
48
|
-
// Common aria attributes that don't cause visual layout shifts
|
|
49
|
-
var NON_VISUAL_ARIA_ATTRIBUTES = exports.NON_VISUAL_ARIA_ATTRIBUTES = ['aria-label', 'aria-labelledby', 'aria-describedby', 'aria-hidden', 'aria-expanded', 'aria-controls', 'aria-selected', 'aria-checked', 'aria-disabled', 'aria-required', 'aria-current', 'aria-haspopup', 'aria-pressed', 'aria-atomic', 'aria-live'];
|
|
50
|
-
|
|
51
|
-
// Common third party browser extension attributes
|
|
52
|
-
var THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES = exports.THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES = ['bis_skin_checked', 'cz-shortcut-listen', 'monica-version', 'data-gr-ext-installed', 'data-dashlane-rid', 'sapling-installed', 'data-gptw',
|
|
53
|
-
// grammarly extensions
|
|
54
|
-
'data-new-gr-c-s-loaded', 'data-gr-aaa-notch-connection-id', 'data-gr-aaa-loaded'];
|
|
55
43
|
var VCCalculator_FY25_03 = exports.default = /*#__PURE__*/function (_AbstractVCCalculator) {
|
|
56
44
|
function VCCalculator_FY25_03(revisionNo) {
|
|
57
45
|
(0, _classCallCheck2.default)(this, VCCalculator_FY25_03);
|
|
@@ -88,10 +76,10 @@ var VCCalculator_FY25_03 = exports.default = /*#__PURE__*/function (_AbstractVCC
|
|
|
88
76
|
if (entry.data.type === 'mutation:attribute') {
|
|
89
77
|
var _entryData = entry.data;
|
|
90
78
|
var _attributeName = _entryData.attributeName;
|
|
91
|
-
if (!_attributeName || KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS.includes(_attributeName)) {
|
|
79
|
+
if (!_attributeName || _constants.KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS.includes(_attributeName)) {
|
|
92
80
|
return false;
|
|
93
81
|
}
|
|
94
|
-
if (_attributeName.startsWith('data-test') ||
|
|
82
|
+
if (_attributeName.startsWith('data-test') || _constants.NON_VISUAL_ARIA_ATTRIBUTES.includes(_attributeName) || _constants.THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES.includes(_attributeName) && (0, _platformFeatureFlags.fg)('platform_ufo_exclude_3p_extensions_from_ttvc')) {
|
|
95
83
|
return false;
|
|
96
84
|
}
|
|
97
85
|
return true;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES = exports.NON_VISUAL_ARIA_ATTRIBUTES = exports.KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS = void 0;
|
|
7
|
+
// TODO: AFO-3523
|
|
8
|
+
// Those are the attributes we have found when testing the 'fy25.03' manually.
|
|
9
|
+
// We still need to replace this hardcoded list with a proper automation
|
|
10
|
+
var KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS = exports.KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS = ['data-drop-target-for-element', 'data-drop-target-for-external', 'draggable', 'data-is-observed', 'data-aui-version', 'data-testid', 'data-vc', 'data-ssr-placeholder', 'data-ssr-placeholder-replace', 'data-vc-nvs', 'data-media-vc-wrapper', 'data-renderer-start-pos', 'data-table-local-id', 'spellcheck', 'data-auto-scrollable', 'id', 'tabindex', 'data-is-ttvc-ready', 'contenteditable', 'data-has-collab-initialised', 'translate'];
|
|
11
|
+
|
|
12
|
+
// Common aria attributes that don't cause visual layout shifts
|
|
13
|
+
var NON_VISUAL_ARIA_ATTRIBUTES = exports.NON_VISUAL_ARIA_ATTRIBUTES = ['aria-label', 'aria-labelledby', 'aria-describedby', 'aria-hidden', 'aria-expanded', 'aria-controls', 'aria-selected', 'aria-checked', 'aria-disabled', 'aria-required', 'aria-current', 'aria-haspopup', 'aria-pressed', 'aria-atomic', 'aria-live'];
|
|
14
|
+
|
|
15
|
+
// Common third party browser extension attributes
|
|
16
|
+
var THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES = exports.THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES = ['bis_skin_checked', 'cz-shortcut-listen', 'monica-version', 'data-gr-ext-installed', 'data-dashlane-rid', 'sapling-installed', 'data-gptw',
|
|
17
|
+
// grammarly extensions
|
|
18
|
+
'data-new-gr-c-s-loaded', 'data-gr-aaa-notch-connection-id', 'data-gr-aaa-loaded'];
|
|
@@ -13,6 +13,7 @@ var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
|
13
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
14
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
15
|
var _fy25_ = _interopRequireDefault(require("../fy25_03"));
|
|
16
|
+
var _constants = require("../utils/constants");
|
|
16
17
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
17
18
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
18
19
|
function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
@@ -50,6 +51,14 @@ var VCNextCalculator = exports.default = /*#__PURE__*/function (_VCCalculator_FY
|
|
|
50
51
|
if (isEntryIncludedInV3 && !getExcludedEntryTypes().includes(entry.data.type)) {
|
|
51
52
|
return true;
|
|
52
53
|
}
|
|
54
|
+
if (entry.data.type === 'mutation:display-contents-children-attribute' && (0, _platformFeatureFlags.fg)('platform_ufo_fix_ttvc_v4_attribute_exclusions')) {
|
|
55
|
+
var entryData = entry.data;
|
|
56
|
+
var attributeName = entryData.attributeName;
|
|
57
|
+
if (!attributeName || attributeName.startsWith('data-test') || _constants.KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS.includes(attributeName) || _constants.NON_VISUAL_ARIA_ATTRIBUTES.includes(attributeName) || _constants.THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES.includes(attributeName)) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
53
62
|
return getConsideredEntryTypes().includes(entry.data.type);
|
|
54
63
|
}
|
|
55
64
|
}]);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import { isVCRevisionEnabled } from '../../config';
|
|
3
4
|
import { getActiveInteraction } from '../../interaction-metrics';
|
|
4
5
|
import { attachAbortListeners } from './attachAbortListeners';
|
|
@@ -432,6 +433,14 @@ export class VCObserver {
|
|
|
432
433
|
this.setAbortReason(abortReason.scroll, time);
|
|
433
434
|
break;
|
|
434
435
|
case 'keydown':
|
|
436
|
+
// Don't abort press interactions on keydown events, as keydown is expected
|
|
437
|
+
// when users press Enter/Space to activate buttons or other interactive elements
|
|
438
|
+
if (fg('platform_ufo_keypress_interaction_abort')) {
|
|
439
|
+
const interaction = getActiveInteraction();
|
|
440
|
+
if ((interaction === null || interaction === void 0 ? void 0 : interaction.type) === 'press') {
|
|
441
|
+
break;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
435
444
|
this.setAbortReason(abortReason.keypress, time);
|
|
436
445
|
break;
|
|
437
446
|
case 'resize':
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
+
import { getActiveInteraction } from '../../interaction-metrics';
|
|
3
4
|
import { SSRPlaceholderHandlers } from '../vc-observer/observers/ssr-placeholders';
|
|
4
5
|
import EntriesTimeline from './entries-timeline';
|
|
5
6
|
import getElementName from './get-element-name';
|
|
@@ -96,6 +97,14 @@ export default class VCObserverNew {
|
|
|
96
97
|
time,
|
|
97
98
|
type
|
|
98
99
|
}) => {
|
|
100
|
+
// Don't abort press interactions on keydown events, as keydown is expected
|
|
101
|
+
// when users press Enter/Space to activate buttons or other interactive elements
|
|
102
|
+
if (type === 'keydown' && fg('platform_ufo_keypress_interaction_abort')) {
|
|
103
|
+
const interaction = getActiveInteraction();
|
|
104
|
+
if ((interaction === null || interaction === void 0 ? void 0 : interaction.type) === 'press') {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
99
108
|
this.entriesTimeline.push({
|
|
100
109
|
time,
|
|
101
110
|
data: {
|
|
@@ -2,6 +2,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
2
2
|
import { expVal } from '../../../expVal';
|
|
3
3
|
import { containsDnDMutationInStyle } from '../../../vc-observer/observers/non-visual-styles/is-dnd-style-mutation';
|
|
4
4
|
import AbstractVCCalculatorBase from '../abstract-base-vc-calculator';
|
|
5
|
+
import { KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS, NON_VISUAL_ARIA_ATTRIBUTES, THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES } from '../utils/constants';
|
|
5
6
|
import { isEntrySmartAnswersInSearch } from '../utils/is-entry-smart-answers-in-search';
|
|
6
7
|
import isViewportEntryData from '../utils/is-viewport-entry-data';
|
|
7
8
|
const ABORTING_WINDOW_EVENT = ['wheel', 'scroll', 'keydown', 'resize'];
|
|
@@ -25,19 +26,6 @@ const getConsideredEntryTypes = include3p => {
|
|
|
25
26
|
}
|
|
26
27
|
return entryTypes;
|
|
27
28
|
};
|
|
28
|
-
|
|
29
|
-
// TODO: AFO-3523
|
|
30
|
-
// Those are the attributes we have found when testing the 'fy25.03' manually.
|
|
31
|
-
// We still need to replace this hardcoded list with a proper automation
|
|
32
|
-
export const KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS = ['data-drop-target-for-element', 'data-drop-target-for-external', 'draggable', 'data-is-observed'];
|
|
33
|
-
|
|
34
|
-
// Common aria attributes that don't cause visual layout shifts
|
|
35
|
-
export const NON_VISUAL_ARIA_ATTRIBUTES = ['aria-label', 'aria-labelledby', 'aria-describedby', 'aria-hidden', 'aria-expanded', 'aria-controls', 'aria-selected', 'aria-checked', 'aria-disabled', 'aria-required', 'aria-current', 'aria-haspopup', 'aria-pressed', 'aria-atomic', 'aria-live'];
|
|
36
|
-
|
|
37
|
-
// Common third party browser extension attributes
|
|
38
|
-
export const THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES = ['bis_skin_checked', 'cz-shortcut-listen', 'monica-version', 'data-gr-ext-installed', 'data-dashlane-rid', 'sapling-installed', 'data-gptw',
|
|
39
|
-
// grammarly extensions
|
|
40
|
-
'data-new-gr-c-s-loaded', 'data-gr-aaa-notch-connection-id', 'data-gr-aaa-loaded'];
|
|
41
29
|
export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
|
|
42
30
|
constructor(revisionNo) {
|
|
43
31
|
super(revisionNo !== null && revisionNo !== void 0 ? revisionNo : REVISION_NO);
|
|
@@ -73,7 +61,7 @@ export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
|
|
|
73
61
|
if (!attributeName || KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS.includes(attributeName)) {
|
|
74
62
|
return false;
|
|
75
63
|
}
|
|
76
|
-
if (attributeName.startsWith('data-test') ||
|
|
64
|
+
if (attributeName.startsWith('data-test') || NON_VISUAL_ARIA_ATTRIBUTES.includes(attributeName) || THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES.includes(attributeName) && fg('platform_ufo_exclude_3p_extensions_from_ttvc')) {
|
|
77
65
|
return false;
|
|
78
66
|
}
|
|
79
67
|
return true;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// TODO: AFO-3523
|
|
2
|
+
// Those are the attributes we have found when testing the 'fy25.03' manually.
|
|
3
|
+
// We still need to replace this hardcoded list with a proper automation
|
|
4
|
+
export const KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS = ['data-drop-target-for-element', 'data-drop-target-for-external', 'draggable', 'data-is-observed', 'data-aui-version', 'data-testid', 'data-vc', 'data-ssr-placeholder', 'data-ssr-placeholder-replace', 'data-vc-nvs', 'data-media-vc-wrapper', 'data-renderer-start-pos', 'data-table-local-id', 'spellcheck', 'data-auto-scrollable', 'id', 'tabindex', 'data-is-ttvc-ready', 'contenteditable', 'data-has-collab-initialised', 'translate'];
|
|
5
|
+
|
|
6
|
+
// Common aria attributes that don't cause visual layout shifts
|
|
7
|
+
export const NON_VISUAL_ARIA_ATTRIBUTES = ['aria-label', 'aria-labelledby', 'aria-describedby', 'aria-hidden', 'aria-expanded', 'aria-controls', 'aria-selected', 'aria-checked', 'aria-disabled', 'aria-required', 'aria-current', 'aria-haspopup', 'aria-pressed', 'aria-atomic', 'aria-live'];
|
|
8
|
+
|
|
9
|
+
// Common third party browser extension attributes
|
|
10
|
+
export const THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES = ['bis_skin_checked', 'cz-shortcut-listen', 'monica-version', 'data-gr-ext-installed', 'data-dashlane-rid', 'sapling-installed', 'data-gptw',
|
|
11
|
+
// grammarly extensions
|
|
12
|
+
'data-new-gr-c-s-loaded', 'data-gr-aaa-notch-connection-id', 'data-gr-aaa-loaded'];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
2
|
import VCCalculator_FY25_03 from '../fy25_03';
|
|
3
|
+
import { KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS, NON_VISUAL_ARIA_ATTRIBUTES, THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES } from '../utils/constants';
|
|
3
4
|
|
|
4
5
|
// NOTE: `next` to be renamed `fy26.04` once stable
|
|
5
6
|
const REVISION_NO = 'next';
|
|
@@ -31,6 +32,14 @@ export default class VCNextCalculator extends VCCalculator_FY25_03 {
|
|
|
31
32
|
if (isEntryIncludedInV3 && !getExcludedEntryTypes().includes(entry.data.type)) {
|
|
32
33
|
return true;
|
|
33
34
|
}
|
|
35
|
+
if (entry.data.type === 'mutation:display-contents-children-attribute' && fg('platform_ufo_fix_ttvc_v4_attribute_exclusions')) {
|
|
36
|
+
const entryData = entry.data;
|
|
37
|
+
const attributeName = entryData.attributeName;
|
|
38
|
+
if (!attributeName || attributeName.startsWith('data-test') || KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS.includes(attributeName) || NON_VISUAL_ARIA_ATTRIBUTES.includes(attributeName) || THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES.includes(attributeName)) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
34
43
|
return getConsideredEntryTypes().includes(entry.data.type);
|
|
35
44
|
}
|
|
36
45
|
}
|
|
@@ -9,6 +9,7 @@ var _excluded = ["__debug__element"];
|
|
|
9
9
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
10
|
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; }
|
|
11
11
|
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) { _defineProperty(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; }
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
13
|
import { isVCRevisionEnabled } from '../../config';
|
|
13
14
|
import { getActiveInteraction } from '../../interaction-metrics';
|
|
14
15
|
import { attachAbortListeners } from './attachAbortListeners';
|
|
@@ -386,6 +387,14 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
386
387
|
_this.setAbortReason(abortReason.scroll, time);
|
|
387
388
|
break;
|
|
388
389
|
case 'keydown':
|
|
390
|
+
// Don't abort press interactions on keydown events, as keydown is expected
|
|
391
|
+
// when users press Enter/Space to activate buttons or other interactive elements
|
|
392
|
+
if (fg('platform_ufo_keypress_interaction_abort')) {
|
|
393
|
+
var interaction = getActiveInteraction();
|
|
394
|
+
if ((interaction === null || interaction === void 0 ? void 0 : interaction.type) === 'press') {
|
|
395
|
+
break;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
389
398
|
_this.setAbortReason(abortReason.keypress, time);
|
|
390
399
|
break;
|
|
391
400
|
case 'resize':
|
|
@@ -6,6 +6,7 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { getActiveInteraction } from '../../interaction-metrics';
|
|
9
10
|
import { SSRPlaceholderHandlers } from '../vc-observer/observers/ssr-placeholders';
|
|
10
11
|
import EntriesTimeline from './entries-timeline';
|
|
11
12
|
import _getElementName from './get-element-name';
|
|
@@ -106,6 +107,14 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
106
107
|
onEvent: function onEvent(_ref) {
|
|
107
108
|
var time = _ref.time,
|
|
108
109
|
type = _ref.type;
|
|
110
|
+
// Don't abort press interactions on keydown events, as keydown is expected
|
|
111
|
+
// when users press Enter/Space to activate buttons or other interactive elements
|
|
112
|
+
if (type === 'keydown' && fg('platform_ufo_keypress_interaction_abort')) {
|
|
113
|
+
var interaction = getActiveInteraction();
|
|
114
|
+
if ((interaction === null || interaction === void 0 ? void 0 : interaction.type) === 'press') {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
109
118
|
_this.entriesTimeline.push({
|
|
110
119
|
time: time,
|
|
111
120
|
data: {
|
|
@@ -9,6 +9,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
9
9
|
import { expVal } from '../../../expVal';
|
|
10
10
|
import { containsDnDMutationInStyle } from '../../../vc-observer/observers/non-visual-styles/is-dnd-style-mutation';
|
|
11
11
|
import AbstractVCCalculatorBase from '../abstract-base-vc-calculator';
|
|
12
|
+
import { KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS, NON_VISUAL_ARIA_ATTRIBUTES, THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES } from '../utils/constants';
|
|
12
13
|
import { isEntrySmartAnswersInSearch } from '../utils/is-entry-smart-answers-in-search';
|
|
13
14
|
import isViewportEntryData from '../utils/is-viewport-entry-data';
|
|
14
15
|
var ABORTING_WINDOW_EVENT = ['wheel', 'scroll', 'keydown', 'resize'];
|
|
@@ -32,19 +33,6 @@ var getConsideredEntryTypes = function getConsideredEntryTypes(include3p) {
|
|
|
32
33
|
}
|
|
33
34
|
return entryTypes;
|
|
34
35
|
};
|
|
35
|
-
|
|
36
|
-
// TODO: AFO-3523
|
|
37
|
-
// Those are the attributes we have found when testing the 'fy25.03' manually.
|
|
38
|
-
// We still need to replace this hardcoded list with a proper automation
|
|
39
|
-
export var KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS = ['data-drop-target-for-element', 'data-drop-target-for-external', 'draggable', 'data-is-observed'];
|
|
40
|
-
|
|
41
|
-
// Common aria attributes that don't cause visual layout shifts
|
|
42
|
-
export var NON_VISUAL_ARIA_ATTRIBUTES = ['aria-label', 'aria-labelledby', 'aria-describedby', 'aria-hidden', 'aria-expanded', 'aria-controls', 'aria-selected', 'aria-checked', 'aria-disabled', 'aria-required', 'aria-current', 'aria-haspopup', 'aria-pressed', 'aria-atomic', 'aria-live'];
|
|
43
|
-
|
|
44
|
-
// Common third party browser extension attributes
|
|
45
|
-
export var THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES = ['bis_skin_checked', 'cz-shortcut-listen', 'monica-version', 'data-gr-ext-installed', 'data-dashlane-rid', 'sapling-installed', 'data-gptw',
|
|
46
|
-
// grammarly extensions
|
|
47
|
-
'data-new-gr-c-s-loaded', 'data-gr-aaa-notch-connection-id', 'data-gr-aaa-loaded'];
|
|
48
36
|
var VCCalculator_FY25_03 = /*#__PURE__*/function (_AbstractVCCalculator) {
|
|
49
37
|
function VCCalculator_FY25_03(revisionNo) {
|
|
50
38
|
_classCallCheck(this, VCCalculator_FY25_03);
|
|
@@ -84,7 +72,7 @@ var VCCalculator_FY25_03 = /*#__PURE__*/function (_AbstractVCCalculator) {
|
|
|
84
72
|
if (!_attributeName || KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS.includes(_attributeName)) {
|
|
85
73
|
return false;
|
|
86
74
|
}
|
|
87
|
-
if (_attributeName.startsWith('data-test') ||
|
|
75
|
+
if (_attributeName.startsWith('data-test') || NON_VISUAL_ARIA_ATTRIBUTES.includes(_attributeName) || THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES.includes(_attributeName) && fg('platform_ufo_exclude_3p_extensions_from_ttvc')) {
|
|
88
76
|
return false;
|
|
89
77
|
}
|
|
90
78
|
return true;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// TODO: AFO-3523
|
|
2
|
+
// Those are the attributes we have found when testing the 'fy25.03' manually.
|
|
3
|
+
// We still need to replace this hardcoded list with a proper automation
|
|
4
|
+
export var KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS = ['data-drop-target-for-element', 'data-drop-target-for-external', 'draggable', 'data-is-observed', 'data-aui-version', 'data-testid', 'data-vc', 'data-ssr-placeholder', 'data-ssr-placeholder-replace', 'data-vc-nvs', 'data-media-vc-wrapper', 'data-renderer-start-pos', 'data-table-local-id', 'spellcheck', 'data-auto-scrollable', 'id', 'tabindex', 'data-is-ttvc-ready', 'contenteditable', 'data-has-collab-initialised', 'translate'];
|
|
5
|
+
|
|
6
|
+
// Common aria attributes that don't cause visual layout shifts
|
|
7
|
+
export var NON_VISUAL_ARIA_ATTRIBUTES = ['aria-label', 'aria-labelledby', 'aria-describedby', 'aria-hidden', 'aria-expanded', 'aria-controls', 'aria-selected', 'aria-checked', 'aria-disabled', 'aria-required', 'aria-current', 'aria-haspopup', 'aria-pressed', 'aria-atomic', 'aria-live'];
|
|
8
|
+
|
|
9
|
+
// Common third party browser extension attributes
|
|
10
|
+
export var THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES = ['bis_skin_checked', 'cz-shortcut-listen', 'monica-version', 'data-gr-ext-installed', 'data-dashlane-rid', 'sapling-installed', 'data-gptw',
|
|
11
|
+
// grammarly extensions
|
|
12
|
+
'data-new-gr-c-s-loaded', 'data-gr-aaa-notch-connection-id', 'data-gr-aaa-loaded'];
|
|
@@ -9,6 +9,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
9
9
|
function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
10
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
11
|
import VCCalculator_FY25_03 from '../fy25_03';
|
|
12
|
+
import { KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS, NON_VISUAL_ARIA_ATTRIBUTES, THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES } from '../utils/constants';
|
|
12
13
|
|
|
13
14
|
// NOTE: `next` to be renamed `fy26.04` once stable
|
|
14
15
|
var REVISION_NO = 'next';
|
|
@@ -44,6 +45,14 @@ var VCNextCalculator = /*#__PURE__*/function (_VCCalculator_FY25_) {
|
|
|
44
45
|
if (isEntryIncludedInV3 && !getExcludedEntryTypes().includes(entry.data.type)) {
|
|
45
46
|
return true;
|
|
46
47
|
}
|
|
48
|
+
if (entry.data.type === 'mutation:display-contents-children-attribute' && fg('platform_ufo_fix_ttvc_v4_attribute_exclusions')) {
|
|
49
|
+
var entryData = entry.data;
|
|
50
|
+
var attributeName = entryData.attributeName;
|
|
51
|
+
if (!attributeName || attributeName.startsWith('data-test') || KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS.includes(attributeName) || NON_VISUAL_ARIA_ATTRIBUTES.includes(attributeName) || THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES.includes(attributeName)) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
47
56
|
return getConsideredEntryTypes().includes(entry.data.type);
|
|
48
57
|
}
|
|
49
58
|
}]);
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { VCObserverEntry } from '../../types';
|
|
2
2
|
import AbstractVCCalculatorBase from '../abstract-base-vc-calculator';
|
|
3
|
-
export declare const KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS: string[];
|
|
4
|
-
export declare const NON_VISUAL_ARIA_ATTRIBUTES: string[];
|
|
5
|
-
export declare const THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES: string[];
|
|
6
3
|
export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
|
|
7
4
|
constructor(revisionNo?: string);
|
|
8
5
|
protected isEntryIncluded(entry: VCObserverEntry, include3p?: boolean, excludeSmartAnswersInSearch?: boolean): boolean;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { VCObserverEntry } from '../../types';
|
|
2
2
|
import AbstractVCCalculatorBase from '../abstract-base-vc-calculator';
|
|
3
|
-
export declare const KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS: string[];
|
|
4
|
-
export declare const NON_VISUAL_ARIA_ATTRIBUTES: string[];
|
|
5
|
-
export declare const THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES: string[];
|
|
6
3
|
export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
|
|
7
4
|
constructor(revisionNo?: string);
|
|
8
5
|
protected isEntryIncluded(entry: VCObserverEntry, include3p?: boolean, excludeSmartAnswersInSearch?: boolean): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "4.15.
|
|
3
|
+
"version": "4.15.14",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -137,6 +137,9 @@
|
|
|
137
137
|
"platform_ufo_segment_unmount_count": {
|
|
138
138
|
"type": "boolean"
|
|
139
139
|
},
|
|
140
|
+
"platform_ufo_fix_ttvc_v4_attribute_exclusions": {
|
|
141
|
+
"type": "boolean"
|
|
142
|
+
},
|
|
140
143
|
"platform_ufo_enable_ttai_with_3p": {
|
|
141
144
|
"type": "boolean"
|
|
142
145
|
},
|
|
@@ -196,6 +199,9 @@
|
|
|
196
199
|
},
|
|
197
200
|
"platform_mark_ufo_segment_first_load": {
|
|
198
201
|
"type": "boolean"
|
|
202
|
+
},
|
|
203
|
+
"platform_ufo_keypress_interaction_abort": {
|
|
204
|
+
"type": "boolean"
|
|
199
205
|
}
|
|
200
206
|
}
|
|
201
207
|
}
|