@atlaskit/react-ufo 3.6.0 → 3.6.2
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 +19 -0
- package/dist/cjs/segment/segment.js +1 -7
- package/dist/cjs/vc/vc-observer/observers/index.js +13 -36
- package/dist/cjs/vc/vc-observer/revisions/fy25_01.js +1 -1
- package/dist/cjs/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +14 -23
- package/dist/es2019/segment/segment.js +1 -7
- package/dist/es2019/vc/vc-observer/observers/index.js +13 -36
- package/dist/es2019/vc/vc-observer/revisions/fy25_01.js +1 -1
- package/dist/es2019/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +14 -23
- package/dist/esm/segment/segment.js +1 -7
- package/dist/esm/vc/vc-observer/observers/index.js +13 -36
- package/dist/esm/vc/vc-observer/revisions/fy25_01.js +1 -1
- package/dist/esm/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +14 -23
- package/dist/types/common/vc/types.d.ts +1 -1
- package/dist/types-ts4.5/common/vc/types.d.ts +1 -1
- package/package.json +1 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 3.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#143078](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/143078)
|
|
8
|
+
[`194c184c53045`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/194c184c53045) -
|
|
9
|
+
FF cleanup - platform-ufo-add-segment-use-effect and ufo_chr_config
|
|
10
|
+
|
|
11
|
+
## 3.6.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#142398](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/142398)
|
|
16
|
+
[`0f2c78fab5f90`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0f2c78fab5f90) -
|
|
17
|
+
FF cleanup - platform_editor_ed-25937_ignore_mutations_for_ttvc
|
|
18
|
+
- [#142273](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/142273)
|
|
19
|
+
[`21456ac374d24`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/21456ac374d24) -
|
|
20
|
+
AFO-3610 cleanup ff platform_ufo_vc_ignore_same_value_mutation
|
|
21
|
+
|
|
3
22
|
## 3.6.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
|
@@ -82,10 +82,6 @@ function UFOSegment(_ref) {
|
|
|
82
82
|
}, [parentContext, segmentName, segmentId]);
|
|
83
83
|
var interactionId = (0, _react.useContext)(_interactionIdContext.default);
|
|
84
84
|
var interactionContext = (0, _react.useMemo)(function () {
|
|
85
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
86
|
-
if (!(0, _platformFeatureFlags.fg)('platform-ufo-add-segment-use-effect')) {
|
|
87
|
-
(0, _interactionMetrics.addSegment)(labelStack);
|
|
88
|
-
}
|
|
89
85
|
var lastCompleteEndTime = 0;
|
|
90
86
|
var complete = (0, _selfMeasurements.withProfiling)(function complete() {
|
|
91
87
|
var endTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : performance.now();
|
|
@@ -274,9 +270,7 @@ function UFOSegment(_ref) {
|
|
|
274
270
|
}
|
|
275
271
|
}, [interactionContext]);
|
|
276
272
|
(0, _react.useEffect)(function () {
|
|
277
|
-
|
|
278
|
-
(0, _interactionMetrics.addSegment)(labelStack);
|
|
279
|
-
}
|
|
273
|
+
(0, _interactionMetrics.addSegment)(labelStack);
|
|
280
274
|
return function () {
|
|
281
275
|
(0, _interactionMetrics.removeSegment)(labelStack);
|
|
282
276
|
};
|
|
@@ -33,12 +33,6 @@ var isElementVisible = (0, _selfMeasurements.withProfiling)(function isElementVi
|
|
|
33
33
|
});
|
|
34
34
|
return isVisible;
|
|
35
35
|
}, ['vc']);
|
|
36
|
-
var isInsideEditorContainer = (0, _selfMeasurements.withProfiling)(function isInsideEditorContainer(target) {
|
|
37
|
-
if (!target || typeof target.closest !== 'function') {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
return Boolean(target.closest('.ProseMirror'));
|
|
41
|
-
}, ['vc']);
|
|
42
36
|
var Observers = exports.Observers = /*#__PURE__*/function () {
|
|
43
37
|
function Observers(opts) {
|
|
44
38
|
var _this = this;
|
|
@@ -248,31 +242,19 @@ var Observers = exports.Observers = /*#__PURE__*/function () {
|
|
|
248
242
|
});
|
|
249
243
|
} else if (mutation.type === 'attributes') {
|
|
250
244
|
if (mutation.target instanceof HTMLElement) {
|
|
245
|
+
var _mutation$oldValue;
|
|
251
246
|
var attributeName = mutation.attributeName;
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
var newValue = attributeName ? mutation.target.getAttribute(attributeName) : undefined;
|
|
264
|
-
if (oldValue !== newValue) {
|
|
265
|
-
if ((0, _isNonVisualStyleMutation.default)(mutation)) {
|
|
266
|
-
ignoreReason = 'non-visual-style';
|
|
267
|
-
}
|
|
268
|
-
if ((0, _platformFeatureFlags.fg)('platform_ufo_vc_fix_ignore_image_mutation')) {
|
|
269
|
-
if ((0, _vcUtils.isContainedWithinMediaWrapper)(mutation.target)) {
|
|
270
|
-
ignoreReason = 'image';
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
_this2.observeElement(mutation.target, mutation, 'attr', ignoreReason, attributeName, oldValue, newValue);
|
|
274
|
-
}
|
|
275
|
-
} else {
|
|
247
|
+
/*
|
|
248
|
+
"MutationObserver was explicitly designed to work that way, but I can't now recall the reasoning.
|
|
249
|
+
I think it might have been something along the lines that for consistency every setAttribute call should create a record.
|
|
250
|
+
Conceptually there is after all a mutation: there is an old value replaced with a new one,
|
|
251
|
+
and whether or not they are the same doesn't really matter.
|
|
252
|
+
And Custom elements should work the same way as MutationObserver."
|
|
253
|
+
https://github.com/whatwg/dom/issues/520#issuecomment-336574796
|
|
254
|
+
*/
|
|
255
|
+
var oldValue = (_mutation$oldValue = mutation.oldValue) !== null && _mutation$oldValue !== void 0 ? _mutation$oldValue : undefined;
|
|
256
|
+
var newValue = attributeName ? mutation.target.getAttribute(attributeName) : undefined;
|
|
257
|
+
if (oldValue !== newValue) {
|
|
276
258
|
if ((0, _isNonVisualStyleMutation.default)(mutation)) {
|
|
277
259
|
ignoreReason = 'non-visual-style';
|
|
278
260
|
}
|
|
@@ -281,7 +263,7 @@ var Observers = exports.Observers = /*#__PURE__*/function () {
|
|
|
281
263
|
ignoreReason = 'image';
|
|
282
264
|
}
|
|
283
265
|
}
|
|
284
|
-
_this2.observeElement(mutation.target, mutation, 'attr', ignoreReason, attributeName);
|
|
266
|
+
_this2.observeElement(mutation.target, mutation, 'attr', ignoreReason, attributeName, oldValue, newValue);
|
|
285
267
|
}
|
|
286
268
|
}
|
|
287
269
|
}
|
|
@@ -345,11 +327,6 @@ var Observers = exports.Observers = /*#__PURE__*/function () {
|
|
|
345
327
|
if (!isElementVisible(target)) {
|
|
346
328
|
data.ignoreReason = 'not-visible';
|
|
347
329
|
}
|
|
348
|
-
if ((0, _platformFeatureFlags.fg)('platform_editor_ed-25937_ignore_mutations_for_ttvc')) {
|
|
349
|
-
if (isInsideEditorContainer(target)) {
|
|
350
|
-
data.ignoreReason = 'editor-container-mutation';
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
330
|
_this3.callbacks.forEach(function (callback) {
|
|
354
331
|
var elementName;
|
|
355
332
|
try {
|
|
@@ -15,7 +15,7 @@ var _selfMeasurements = require("../../../self-measurements");
|
|
|
15
15
|
var _ViewportUpdateClassifier = require("./ViewportUpdateClassifier");
|
|
16
16
|
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
17
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
18
|
-
var legacyIgnoreReasons = ['image', 'ssr-hydration', 'editor-lazy-node-view'
|
|
18
|
+
var legacyIgnoreReasons = ['image', 'ssr-hydration', 'editor-lazy-node-view'];
|
|
19
19
|
var FY25_01Classifier = exports.FY25_01Classifier = /*#__PURE__*/function (_ViewportUpdateClassi) {
|
|
20
20
|
function FY25_01Classifier() {
|
|
21
21
|
var _this;
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
7
|
var _selfMeasurements = require("../../../../self-measurements");
|
|
9
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; } } }; }
|
|
10
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; } }
|
|
@@ -29,30 +28,22 @@ var createMutationObserver = (0, _selfMeasurements.withProfiling)(function creat
|
|
|
29
28
|
continue;
|
|
30
29
|
}
|
|
31
30
|
if (mut.type === 'attributes') {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var _mut$attributeName;
|
|
46
|
-
onAttributeMutation({
|
|
47
|
-
target: mut.target,
|
|
48
|
-
attributeName: (_mut$attributeName = mut.attributeName) !== null && _mut$attributeName !== void 0 ? _mut$attributeName : 'unknown'
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
} else {
|
|
52
|
-
var _mut$attributeName2;
|
|
31
|
+
var _mut$oldValue;
|
|
32
|
+
/*
|
|
33
|
+
"MutationObserver was explicitly designed to work that way, but I can't now recall the reasoning.
|
|
34
|
+
I think it might have been something along the lines that for consistency every setAttribute call should create a record.
|
|
35
|
+
Conceptually there is after all a mutation: there is an old value replaced with a new one,
|
|
36
|
+
and whether or not they are the same doesn't really matter.
|
|
37
|
+
And Custom elements should work the same way as MutationObserver."
|
|
38
|
+
https://github.com/whatwg/dom/issues/520#issuecomment-336574796
|
|
39
|
+
*/
|
|
40
|
+
var oldValue = (_mut$oldValue = mut.oldValue) !== null && _mut$oldValue !== void 0 ? _mut$oldValue : undefined;
|
|
41
|
+
var newValue = mut.attributeName ? mut.target.getAttribute(mut.attributeName) : undefined;
|
|
42
|
+
if (oldValue !== newValue) {
|
|
43
|
+
var _mut$attributeName;
|
|
53
44
|
onAttributeMutation({
|
|
54
45
|
target: mut.target,
|
|
55
|
-
attributeName: (_mut$
|
|
46
|
+
attributeName: (_mut$attributeName = mut.attributeName) !== null && _mut$attributeName !== void 0 ? _mut$attributeName : 'unknown'
|
|
56
47
|
});
|
|
57
48
|
}
|
|
58
49
|
continue;
|
|
@@ -60,10 +60,6 @@ export default function UFOSegment({
|
|
|
60
60
|
}], [parentContext, segmentName, segmentId]);
|
|
61
61
|
const interactionId = useContext(UFOInteractionIDContext);
|
|
62
62
|
const interactionContext = useMemo(() => {
|
|
63
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
64
|
-
if (!fg('platform-ufo-add-segment-use-effect')) {
|
|
65
|
-
addSegment(labelStack);
|
|
66
|
-
}
|
|
67
63
|
let lastCompleteEndTime = 0;
|
|
68
64
|
const complete = withProfiling(function complete(endTime = performance.now()) {
|
|
69
65
|
if (interactionId.current) {
|
|
@@ -247,9 +243,7 @@ export default function UFOSegment({
|
|
|
247
243
|
}
|
|
248
244
|
}, [interactionContext]);
|
|
249
245
|
useEffect(() => {
|
|
250
|
-
|
|
251
|
-
addSegment(labelStack);
|
|
252
|
-
}
|
|
246
|
+
addSegment(labelStack);
|
|
253
247
|
return () => {
|
|
254
248
|
removeSegment(labelStack);
|
|
255
249
|
};
|
|
@@ -22,12 +22,6 @@ const isElementVisible = withProfiling(function isElementVisible(target) {
|
|
|
22
22
|
});
|
|
23
23
|
return isVisible;
|
|
24
24
|
}, ['vc']);
|
|
25
|
-
const isInsideEditorContainer = withProfiling(function isInsideEditorContainer(target) {
|
|
26
|
-
if (!target || typeof target.closest !== 'function') {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
return Boolean(target.closest('.ProseMirror'));
|
|
30
|
-
}, ['vc']);
|
|
31
25
|
export class Observers {
|
|
32
26
|
constructor(opts) {
|
|
33
27
|
_defineProperty(this, "observedMutations", new WeakMap());
|
|
@@ -218,31 +212,19 @@ export class Observers {
|
|
|
218
212
|
});
|
|
219
213
|
} else if (mutation.type === 'attributes') {
|
|
220
214
|
if (mutation.target instanceof HTMLElement) {
|
|
215
|
+
var _mutation$oldValue;
|
|
221
216
|
const attributeName = mutation.attributeName;
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
const newValue = attributeName ? mutation.target.getAttribute(attributeName) : undefined;
|
|
234
|
-
if (oldValue !== newValue) {
|
|
235
|
-
if (isNonVisualStyleMutation(mutation)) {
|
|
236
|
-
ignoreReason = 'non-visual-style';
|
|
237
|
-
}
|
|
238
|
-
if (fg('platform_ufo_vc_fix_ignore_image_mutation')) {
|
|
239
|
-
if (isContainedWithinMediaWrapper(mutation.target)) {
|
|
240
|
-
ignoreReason = 'image';
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
this.observeElement(mutation.target, mutation, 'attr', ignoreReason, attributeName, oldValue, newValue);
|
|
244
|
-
}
|
|
245
|
-
} else {
|
|
217
|
+
/*
|
|
218
|
+
"MutationObserver was explicitly designed to work that way, but I can't now recall the reasoning.
|
|
219
|
+
I think it might have been something along the lines that for consistency every setAttribute call should create a record.
|
|
220
|
+
Conceptually there is after all a mutation: there is an old value replaced with a new one,
|
|
221
|
+
and whether or not they are the same doesn't really matter.
|
|
222
|
+
And Custom elements should work the same way as MutationObserver."
|
|
223
|
+
https://github.com/whatwg/dom/issues/520#issuecomment-336574796
|
|
224
|
+
*/
|
|
225
|
+
const oldValue = (_mutation$oldValue = mutation.oldValue) !== null && _mutation$oldValue !== void 0 ? _mutation$oldValue : undefined;
|
|
226
|
+
const newValue = attributeName ? mutation.target.getAttribute(attributeName) : undefined;
|
|
227
|
+
if (oldValue !== newValue) {
|
|
246
228
|
if (isNonVisualStyleMutation(mutation)) {
|
|
247
229
|
ignoreReason = 'non-visual-style';
|
|
248
230
|
}
|
|
@@ -251,7 +233,7 @@ export class Observers {
|
|
|
251
233
|
ignoreReason = 'image';
|
|
252
234
|
}
|
|
253
235
|
}
|
|
254
|
-
this.observeElement(mutation.target, mutation, 'attr', ignoreReason, attributeName);
|
|
236
|
+
this.observeElement(mutation.target, mutation, 'attr', ignoreReason, attributeName, oldValue, newValue);
|
|
255
237
|
}
|
|
256
238
|
}
|
|
257
239
|
}
|
|
@@ -311,11 +293,6 @@ export class Observers {
|
|
|
311
293
|
if (!isElementVisible(target)) {
|
|
312
294
|
data.ignoreReason = 'not-visible';
|
|
313
295
|
}
|
|
314
|
-
if (fg('platform_editor_ed-25937_ignore_mutations_for_ttvc')) {
|
|
315
|
-
if (isInsideEditorContainer(target)) {
|
|
316
|
-
data.ignoreReason = 'editor-container-mutation';
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
296
|
this.callbacks.forEach(callback => {
|
|
320
297
|
let elementName;
|
|
321
298
|
try {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { withProfiling } from '../../../self-measurements';
|
|
3
3
|
import { ViewportUpdateClassifier } from './ViewportUpdateClassifier';
|
|
4
|
-
const legacyIgnoreReasons = ['image', 'ssr-hydration', 'editor-lazy-node-view'
|
|
4
|
+
const legacyIgnoreReasons = ['image', 'ssr-hydration', 'editor-lazy-node-view'];
|
|
5
5
|
export class FY25_01Classifier extends ViewportUpdateClassifier {
|
|
6
6
|
VCCalculationMethod({
|
|
7
7
|
VCParts,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
1
|
import { withProfiling } from '../../../../self-measurements';
|
|
3
2
|
const createMutationObserver = withProfiling(function createMutationObserver(props) {
|
|
4
3
|
if (!window || typeof window.IntersectionObserver !== 'function') {
|
|
@@ -16,30 +15,22 @@ const createMutationObserver = withProfiling(function createMutationObserver(pro
|
|
|
16
15
|
continue;
|
|
17
16
|
}
|
|
18
17
|
if (mut.type === 'attributes') {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var _mut$attributeName;
|
|
33
|
-
onAttributeMutation({
|
|
34
|
-
target: mut.target,
|
|
35
|
-
attributeName: (_mut$attributeName = mut.attributeName) !== null && _mut$attributeName !== void 0 ? _mut$attributeName : 'unknown'
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
} else {
|
|
39
|
-
var _mut$attributeName2;
|
|
18
|
+
var _mut$oldValue;
|
|
19
|
+
/*
|
|
20
|
+
"MutationObserver was explicitly designed to work that way, but I can't now recall the reasoning.
|
|
21
|
+
I think it might have been something along the lines that for consistency every setAttribute call should create a record.
|
|
22
|
+
Conceptually there is after all a mutation: there is an old value replaced with a new one,
|
|
23
|
+
and whether or not they are the same doesn't really matter.
|
|
24
|
+
And Custom elements should work the same way as MutationObserver."
|
|
25
|
+
https://github.com/whatwg/dom/issues/520#issuecomment-336574796
|
|
26
|
+
*/
|
|
27
|
+
const oldValue = (_mut$oldValue = mut.oldValue) !== null && _mut$oldValue !== void 0 ? _mut$oldValue : undefined;
|
|
28
|
+
const newValue = mut.attributeName ? mut.target.getAttribute(mut.attributeName) : undefined;
|
|
29
|
+
if (oldValue !== newValue) {
|
|
30
|
+
var _mut$attributeName;
|
|
40
31
|
onAttributeMutation({
|
|
41
32
|
target: mut.target,
|
|
42
|
-
attributeName: (_mut$
|
|
33
|
+
attributeName: (_mut$attributeName = mut.attributeName) !== null && _mut$attributeName !== void 0 ? _mut$attributeName : 'unknown'
|
|
43
34
|
});
|
|
44
35
|
}
|
|
45
36
|
continue;
|
|
@@ -70,10 +70,6 @@ export default function UFOSegment(_ref) {
|
|
|
70
70
|
}, [parentContext, segmentName, segmentId]);
|
|
71
71
|
var interactionId = useContext(UFOInteractionIDContext);
|
|
72
72
|
var interactionContext = useMemo(function () {
|
|
73
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
74
|
-
if (!fg('platform-ufo-add-segment-use-effect')) {
|
|
75
|
-
addSegment(labelStack);
|
|
76
|
-
}
|
|
77
73
|
var lastCompleteEndTime = 0;
|
|
78
74
|
var complete = withProfiling(function complete() {
|
|
79
75
|
var endTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : performance.now();
|
|
@@ -262,9 +258,7 @@ export default function UFOSegment(_ref) {
|
|
|
262
258
|
}
|
|
263
259
|
}, [interactionContext]);
|
|
264
260
|
useEffect(function () {
|
|
265
|
-
|
|
266
|
-
addSegment(labelStack);
|
|
267
|
-
}
|
|
261
|
+
addSegment(labelStack);
|
|
268
262
|
return function () {
|
|
269
263
|
removeSegment(labelStack);
|
|
270
264
|
};
|
|
@@ -26,12 +26,6 @@ var isElementVisible = withProfiling(function isElementVisible(target) {
|
|
|
26
26
|
});
|
|
27
27
|
return isVisible;
|
|
28
28
|
}, ['vc']);
|
|
29
|
-
var isInsideEditorContainer = withProfiling(function isInsideEditorContainer(target) {
|
|
30
|
-
if (!target || typeof target.closest !== 'function') {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
return Boolean(target.closest('.ProseMirror'));
|
|
34
|
-
}, ['vc']);
|
|
35
29
|
export var Observers = /*#__PURE__*/function () {
|
|
36
30
|
function Observers(opts) {
|
|
37
31
|
var _this = this;
|
|
@@ -241,31 +235,19 @@ export var Observers = /*#__PURE__*/function () {
|
|
|
241
235
|
});
|
|
242
236
|
} else if (mutation.type === 'attributes') {
|
|
243
237
|
if (mutation.target instanceof HTMLElement) {
|
|
238
|
+
var _mutation$oldValue;
|
|
244
239
|
var attributeName = mutation.attributeName;
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
var newValue = attributeName ? mutation.target.getAttribute(attributeName) : undefined;
|
|
257
|
-
if (oldValue !== newValue) {
|
|
258
|
-
if (isNonVisualStyleMutation(mutation)) {
|
|
259
|
-
ignoreReason = 'non-visual-style';
|
|
260
|
-
}
|
|
261
|
-
if (fg('platform_ufo_vc_fix_ignore_image_mutation')) {
|
|
262
|
-
if (isContainedWithinMediaWrapper(mutation.target)) {
|
|
263
|
-
ignoreReason = 'image';
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
_this2.observeElement(mutation.target, mutation, 'attr', ignoreReason, attributeName, oldValue, newValue);
|
|
267
|
-
}
|
|
268
|
-
} else {
|
|
240
|
+
/*
|
|
241
|
+
"MutationObserver was explicitly designed to work that way, but I can't now recall the reasoning.
|
|
242
|
+
I think it might have been something along the lines that for consistency every setAttribute call should create a record.
|
|
243
|
+
Conceptually there is after all a mutation: there is an old value replaced with a new one,
|
|
244
|
+
and whether or not they are the same doesn't really matter.
|
|
245
|
+
And Custom elements should work the same way as MutationObserver."
|
|
246
|
+
https://github.com/whatwg/dom/issues/520#issuecomment-336574796
|
|
247
|
+
*/
|
|
248
|
+
var oldValue = (_mutation$oldValue = mutation.oldValue) !== null && _mutation$oldValue !== void 0 ? _mutation$oldValue : undefined;
|
|
249
|
+
var newValue = attributeName ? mutation.target.getAttribute(attributeName) : undefined;
|
|
250
|
+
if (oldValue !== newValue) {
|
|
269
251
|
if (isNonVisualStyleMutation(mutation)) {
|
|
270
252
|
ignoreReason = 'non-visual-style';
|
|
271
253
|
}
|
|
@@ -274,7 +256,7 @@ export var Observers = /*#__PURE__*/function () {
|
|
|
274
256
|
ignoreReason = 'image';
|
|
275
257
|
}
|
|
276
258
|
}
|
|
277
|
-
_this2.observeElement(mutation.target, mutation, 'attr', ignoreReason, attributeName);
|
|
259
|
+
_this2.observeElement(mutation.target, mutation, 'attr', ignoreReason, attributeName, oldValue, newValue);
|
|
278
260
|
}
|
|
279
261
|
}
|
|
280
262
|
}
|
|
@@ -338,11 +320,6 @@ export var Observers = /*#__PURE__*/function () {
|
|
|
338
320
|
if (!isElementVisible(target)) {
|
|
339
321
|
data.ignoreReason = 'not-visible';
|
|
340
322
|
}
|
|
341
|
-
if (fg('platform_editor_ed-25937_ignore_mutations_for_ttvc')) {
|
|
342
|
-
if (isInsideEditorContainer(target)) {
|
|
343
|
-
data.ignoreReason = 'editor-container-mutation';
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
323
|
_this3.callbacks.forEach(function (callback) {
|
|
347
324
|
var elementName;
|
|
348
325
|
try {
|
|
@@ -8,7 +8,7 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
|
|
|
8
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
import { withProfiling } from '../../../self-measurements';
|
|
10
10
|
import { ViewportUpdateClassifier } from './ViewportUpdateClassifier';
|
|
11
|
-
var legacyIgnoreReasons = ['image', 'ssr-hydration', 'editor-lazy-node-view'
|
|
11
|
+
var legacyIgnoreReasons = ['image', 'ssr-hydration', 'editor-lazy-node-view'];
|
|
12
12
|
export var FY25_01Classifier = /*#__PURE__*/function (_ViewportUpdateClassi) {
|
|
13
13
|
function FY25_01Classifier() {
|
|
14
14
|
var _this;
|
|
@@ -1,7 +1,6 @@
|
|
|
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 { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { withProfiling } from '../../../../self-measurements';
|
|
6
5
|
var createMutationObserver = withProfiling(function createMutationObserver(props) {
|
|
7
6
|
if (!window || typeof window.IntersectionObserver !== 'function') {
|
|
@@ -23,30 +22,22 @@ var createMutationObserver = withProfiling(function createMutationObserver(props
|
|
|
23
22
|
continue;
|
|
24
23
|
}
|
|
25
24
|
if (mut.type === 'attributes') {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var _mut$attributeName;
|
|
40
|
-
onAttributeMutation({
|
|
41
|
-
target: mut.target,
|
|
42
|
-
attributeName: (_mut$attributeName = mut.attributeName) !== null && _mut$attributeName !== void 0 ? _mut$attributeName : 'unknown'
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
} else {
|
|
46
|
-
var _mut$attributeName2;
|
|
25
|
+
var _mut$oldValue;
|
|
26
|
+
/*
|
|
27
|
+
"MutationObserver was explicitly designed to work that way, but I can't now recall the reasoning.
|
|
28
|
+
I think it might have been something along the lines that for consistency every setAttribute call should create a record.
|
|
29
|
+
Conceptually there is after all a mutation: there is an old value replaced with a new one,
|
|
30
|
+
and whether or not they are the same doesn't really matter.
|
|
31
|
+
And Custom elements should work the same way as MutationObserver."
|
|
32
|
+
https://github.com/whatwg/dom/issues/520#issuecomment-336574796
|
|
33
|
+
*/
|
|
34
|
+
var oldValue = (_mut$oldValue = mut.oldValue) !== null && _mut$oldValue !== void 0 ? _mut$oldValue : undefined;
|
|
35
|
+
var newValue = mut.attributeName ? mut.target.getAttribute(mut.attributeName) : undefined;
|
|
36
|
+
if (oldValue !== newValue) {
|
|
37
|
+
var _mut$attributeName;
|
|
47
38
|
onAttributeMutation({
|
|
48
39
|
target: mut.target,
|
|
49
|
-
attributeName: (_mut$
|
|
40
|
+
attributeName: (_mut$attributeName = mut.attributeName) !== null && _mut$attributeName !== void 0 ? _mut$attributeName : 'unknown'
|
|
50
41
|
});
|
|
51
42
|
}
|
|
52
43
|
continue;
|
|
@@ -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' | '
|
|
40
|
+
export type VCIgnoreReason = 'image' | 'ssr-hydration' | 'editor-lazy-node-view' | 'not-visible' | 'non-visual-style' | '';
|
|
41
41
|
export type ComponentsLogEntry = {
|
|
42
42
|
type?: string;
|
|
43
43
|
targetName: string;
|
|
@@ -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' | '
|
|
40
|
+
export type VCIgnoreReason = 'image' | 'ssr-hydration' | 'editor-lazy-node-view' | 'not-visible' | 'non-visual-style' | '';
|
|
41
41
|
export type ComponentsLogEntry = {
|
|
42
42
|
type?: string;
|
|
43
43
|
targetName: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.2",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -130,9 +130,6 @@
|
|
|
130
130
|
"platform_ufo_canvas_heatmap_full_precision": {
|
|
131
131
|
"type": "boolean"
|
|
132
132
|
},
|
|
133
|
-
"platform_editor_ed-25937_ignore_mutations_for_ttvc": {
|
|
134
|
-
"type": "boolean"
|
|
135
|
-
},
|
|
136
133
|
"enable-react-ufo-payload-segment-compressed": {
|
|
137
134
|
"type": "boolean"
|
|
138
135
|
},
|
|
@@ -142,12 +139,6 @@
|
|
|
142
139
|
"ufo-calc-speed-index": {
|
|
143
140
|
"type": "boolean"
|
|
144
141
|
},
|
|
145
|
-
"platform-ufo-add-segment-use-effect": {
|
|
146
|
-
"type": "boolean"
|
|
147
|
-
},
|
|
148
|
-
"ufo_chr_config": {
|
|
149
|
-
"type": "boolean"
|
|
150
|
-
},
|
|
151
142
|
"ufo_support_other_resource_type_js": {
|
|
152
143
|
"type": "boolean"
|
|
153
144
|
},
|
|
@@ -172,9 +163,6 @@
|
|
|
172
163
|
"ufo_payload_use_idle_callback": {
|
|
173
164
|
"type": "boolean"
|
|
174
165
|
},
|
|
175
|
-
"platform_ufo_vc_ignore_same_value_mutation": {
|
|
176
|
-
"type": "boolean"
|
|
177
|
-
},
|
|
178
166
|
"platform_ufo_disable_ttvc_v1": {
|
|
179
167
|
"type": "boolean"
|
|
180
168
|
},
|