@atlaskit/react-ufo 4.14.7 → 4.14.8
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 +8 -0
- package/dist/cjs/vc/vc-observer/observers/non-visual-styles/is-dnd-style-mutation.js +12 -0
- package/dist/cjs/vc/vc-observer-new/metric-calculator/fy25_03/index.js +14 -1
- package/dist/es2019/vc/vc-observer/observers/non-visual-styles/is-dnd-style-mutation.js +13 -1
- package/dist/es2019/vc/vc-observer-new/metric-calculator/fy25_03/index.js +14 -1
- package/dist/esm/vc/vc-observer/observers/non-visual-styles/is-dnd-style-mutation.js +12 -1
- package/dist/esm/vc/vc-observer-new/metric-calculator/fy25_03/index.js +14 -1
- package/dist/types/vc/vc-observer/observers/non-visual-styles/is-dnd-style-mutation.d.ts +6 -0
- package/dist/types-ts4.5/vc/vc-observer/observers/non-visual-styles/is-dnd-style-mutation.d.ts +6 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 4.14.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`60636efa6fba9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/60636efa6fba9) -
|
|
8
|
+
exclude media mutation from ttvc if matching DnD style change, localId and contenteditable
|
|
9
|
+
attribute change, as they are non-visual changes
|
|
10
|
+
|
|
3
11
|
## 4.14.7
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.containsDnDMutationInStyle = containsDnDMutationInStyle;
|
|
6
7
|
exports.default = void 0;
|
|
8
|
+
exports.isDnDStyleMutation = isDnDStyleMutation;
|
|
7
9
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
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; } } }; }
|
|
9
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; } }
|
|
@@ -52,6 +54,16 @@ function isDnDStyleMutation(_ref) {
|
|
|
52
54
|
if (!(target instanceof Element)) {
|
|
53
55
|
return false;
|
|
54
56
|
}
|
|
57
|
+
return containsDnDMutationInStyle({
|
|
58
|
+
attributeName: attributeName,
|
|
59
|
+
oldValue: oldValue,
|
|
60
|
+
newValue: newValue
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function containsDnDMutationInStyle(_ref2) {
|
|
64
|
+
var attributeName = _ref2.attributeName,
|
|
65
|
+
oldValue = _ref2.oldValue,
|
|
66
|
+
newValue = _ref2.newValue;
|
|
55
67
|
if (attributeName !== 'style') {
|
|
56
68
|
return false;
|
|
57
69
|
}
|
|
@@ -11,6 +11,8 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
11
11
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
12
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
13
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
|
+
var _expVal = require("../../../expVal");
|
|
15
|
+
var _isDndStyleMutation = require("../../../vc-observer/observers/non-visual-styles/is-dnd-style-mutation");
|
|
14
16
|
var _abstractBaseVcCalculator = _interopRequireDefault(require("../abstract-base-vc-calculator"));
|
|
15
17
|
var _isEntrySmartAnswersInSearch = require("../utils/is-entry-smart-answers-in-search");
|
|
16
18
|
var _isViewportEntryData = _interopRequireDefault(require("../utils/is-viewport-entry-data"));
|
|
@@ -63,9 +65,20 @@ var VCCalculator_FY25_03 = exports.default = /*#__PURE__*/function (_AbstractVCC
|
|
|
63
65
|
if (entry.data.type === 'mutation:media' && (0, _platformFeatureFlags.fg)('media-perf-uplift-mutation-fix')) {
|
|
64
66
|
var entryData = entry.data;
|
|
65
67
|
var attributeName = entryData.attributeName;
|
|
66
|
-
if (attributeName && (/data-(test|file|context)-\S+/g.test(attributeName) || attributeName === 'alt')) {
|
|
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))) {
|
|
67
69
|
return false;
|
|
68
70
|
}
|
|
71
|
+
|
|
72
|
+
// special case for style attribute to ignore only anchor-name changes
|
|
73
|
+
if ((0, _expVal.expVal)('platform_editor_media_vc_fixes', 'isEnabled', false)) {
|
|
74
|
+
if ((0, _isDndStyleMutation.containsDnDMutationInStyle)({
|
|
75
|
+
attributeName: entryData.attributeName,
|
|
76
|
+
oldValue: entryData.oldValue,
|
|
77
|
+
newValue: entryData.newValue
|
|
78
|
+
})) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
69
82
|
}
|
|
70
83
|
if (entry.data.type === 'mutation:attribute') {
|
|
71
84
|
var _entryData = entry.data;
|
|
@@ -35,6 +35,17 @@ function isDnDStyleMutation({
|
|
|
35
35
|
if (!(target instanceof Element)) {
|
|
36
36
|
return false;
|
|
37
37
|
}
|
|
38
|
+
return containsDnDMutationInStyle({
|
|
39
|
+
attributeName,
|
|
40
|
+
oldValue,
|
|
41
|
+
newValue
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function containsDnDMutationInStyle({
|
|
45
|
+
attributeName,
|
|
46
|
+
oldValue,
|
|
47
|
+
newValue
|
|
48
|
+
}) {
|
|
38
49
|
if (attributeName !== 'style') {
|
|
39
50
|
return false;
|
|
40
51
|
}
|
|
@@ -59,4 +70,5 @@ function isDnDStyleMutation({
|
|
|
59
70
|
}
|
|
60
71
|
return isDnDMutation;
|
|
61
72
|
}
|
|
62
|
-
export default isDnDStyleMutation;
|
|
73
|
+
export default isDnDStyleMutation;
|
|
74
|
+
export { isDnDStyleMutation, containsDnDMutationInStyle };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
+
import { expVal } from '../../../expVal';
|
|
3
|
+
import { containsDnDMutationInStyle } from '../../../vc-observer/observers/non-visual-styles/is-dnd-style-mutation';
|
|
2
4
|
import AbstractVCCalculatorBase from '../abstract-base-vc-calculator';
|
|
3
5
|
import { isEntrySmartAnswersInSearch } from '../utils/is-entry-smart-answers-in-search';
|
|
4
6
|
import isViewportEntryData from '../utils/is-viewport-entry-data';
|
|
@@ -45,9 +47,20 @@ export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
|
|
|
45
47
|
if (entry.data.type === 'mutation:media' && fg('media-perf-uplift-mutation-fix')) {
|
|
46
48
|
const entryData = entry.data;
|
|
47
49
|
const attributeName = entryData.attributeName;
|
|
48
|
-
if (attributeName && (/data-(test|file|context)-\S+/g.test(attributeName) || attributeName === 'alt')) {
|
|
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))) {
|
|
49
51
|
return false;
|
|
50
52
|
}
|
|
53
|
+
|
|
54
|
+
// special case for style attribute to ignore only anchor-name changes
|
|
55
|
+
if (expVal('platform_editor_media_vc_fixes', 'isEnabled', false)) {
|
|
56
|
+
if (containsDnDMutationInStyle({
|
|
57
|
+
attributeName: entryData.attributeName,
|
|
58
|
+
oldValue: entryData.oldValue,
|
|
59
|
+
newValue: entryData.newValue
|
|
60
|
+
})) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
51
64
|
}
|
|
52
65
|
if (entry.data.type === 'mutation:attribute') {
|
|
53
66
|
const entryData = entry.data;
|
|
@@ -46,6 +46,16 @@ function isDnDStyleMutation(_ref) {
|
|
|
46
46
|
if (!(target instanceof Element)) {
|
|
47
47
|
return false;
|
|
48
48
|
}
|
|
49
|
+
return containsDnDMutationInStyle({
|
|
50
|
+
attributeName: attributeName,
|
|
51
|
+
oldValue: oldValue,
|
|
52
|
+
newValue: newValue
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function containsDnDMutationInStyle(_ref2) {
|
|
56
|
+
var attributeName = _ref2.attributeName,
|
|
57
|
+
oldValue = _ref2.oldValue,
|
|
58
|
+
newValue = _ref2.newValue;
|
|
49
59
|
if (attributeName !== 'style') {
|
|
50
60
|
return false;
|
|
51
61
|
}
|
|
@@ -88,4 +98,5 @@ function isDnDStyleMutation(_ref) {
|
|
|
88
98
|
}
|
|
89
99
|
return isDnDMutation;
|
|
90
100
|
}
|
|
91
|
-
export default isDnDStyleMutation;
|
|
101
|
+
export default isDnDStyleMutation;
|
|
102
|
+
export { isDnDStyleMutation, containsDnDMutationInStyle };
|
|
@@ -6,6 +6,8 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
6
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
7
7
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { expVal } from '../../../expVal';
|
|
10
|
+
import { containsDnDMutationInStyle } from '../../../vc-observer/observers/non-visual-styles/is-dnd-style-mutation';
|
|
9
11
|
import AbstractVCCalculatorBase from '../abstract-base-vc-calculator';
|
|
10
12
|
import { isEntrySmartAnswersInSearch } from '../utils/is-entry-smart-answers-in-search';
|
|
11
13
|
import isViewportEntryData from '../utils/is-viewport-entry-data';
|
|
@@ -56,9 +58,20 @@ var VCCalculator_FY25_03 = /*#__PURE__*/function (_AbstractVCCalculator) {
|
|
|
56
58
|
if (entry.data.type === 'mutation:media' && fg('media-perf-uplift-mutation-fix')) {
|
|
57
59
|
var entryData = entry.data;
|
|
58
60
|
var attributeName = entryData.attributeName;
|
|
59
|
-
if (attributeName && (/data-(test|file|context)-\S+/g.test(attributeName) || attributeName === 'alt')) {
|
|
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))) {
|
|
60
62
|
return false;
|
|
61
63
|
}
|
|
64
|
+
|
|
65
|
+
// special case for style attribute to ignore only anchor-name changes
|
|
66
|
+
if (expVal('platform_editor_media_vc_fixes', 'isEnabled', false)) {
|
|
67
|
+
if (containsDnDMutationInStyle({
|
|
68
|
+
attributeName: entryData.attributeName,
|
|
69
|
+
oldValue: entryData.oldValue,
|
|
70
|
+
newValue: entryData.newValue
|
|
71
|
+
})) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
62
75
|
}
|
|
63
76
|
if (entry.data.type === 'mutation:attribute') {
|
|
64
77
|
var _entryData = entry.data;
|
|
@@ -11,4 +11,10 @@ declare function isDnDStyleMutation({ target, attributeName, oldValue, newValue,
|
|
|
11
11
|
oldValue?: string | undefined | null;
|
|
12
12
|
newValue?: string | undefined | null;
|
|
13
13
|
}): boolean;
|
|
14
|
+
declare function containsDnDMutationInStyle({ attributeName, oldValue, newValue, }: {
|
|
15
|
+
attributeName?: string | null;
|
|
16
|
+
oldValue?: string | undefined | null;
|
|
17
|
+
newValue?: string | undefined | null;
|
|
18
|
+
}): boolean;
|
|
14
19
|
export default isDnDStyleMutation;
|
|
20
|
+
export { isDnDStyleMutation, containsDnDMutationInStyle };
|
package/dist/types-ts4.5/vc/vc-observer/observers/non-visual-styles/is-dnd-style-mutation.d.ts
CHANGED
|
@@ -11,4 +11,10 @@ declare function isDnDStyleMutation({ target, attributeName, oldValue, newValue,
|
|
|
11
11
|
oldValue?: string | undefined | null;
|
|
12
12
|
newValue?: string | undefined | null;
|
|
13
13
|
}): boolean;
|
|
14
|
+
declare function containsDnDMutationInStyle({ attributeName, oldValue, newValue, }: {
|
|
15
|
+
attributeName?: string | null;
|
|
16
|
+
oldValue?: string | undefined | null;
|
|
17
|
+
newValue?: string | undefined | null;
|
|
18
|
+
}): boolean;
|
|
14
19
|
export default isDnDStyleMutation;
|
|
20
|
+
export { isDnDStyleMutation, containsDnDMutationInStyle };
|