@atlaskit/react-ufo 4.15.6 → 4.15.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 +16 -0
- package/api-reference.md +1188 -0
- package/dist/cjs/create-post-interaction-log-payload/get-late-mutations.js +2 -3
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/index.js +28 -0
- package/dist/cjs/vc/vc-observer-new/index.js +1 -1
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +11 -7
- package/dist/cjs/vc/vc-observer-new/raw-data-handler/index.js +1 -1
- package/dist/cjs/vc/vc-observer-new/viewport-observer/index.js +2 -2
- package/dist/es2019/create-post-interaction-log-payload/get-late-mutations.js +2 -3
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/index.js +24 -0
- package/dist/es2019/vc/vc-observer-new/index.js +1 -1
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +11 -7
- package/dist/es2019/vc/vc-observer-new/raw-data-handler/index.js +1 -1
- package/dist/es2019/vc/vc-observer-new/viewport-observer/index.js +2 -2
- package/dist/esm/create-post-interaction-log-payload/get-late-mutations.js +2 -3
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/index.js +28 -0
- package/dist/esm/vc/vc-observer-new/index.js +1 -1
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +11 -7
- package/dist/esm/vc/vc-observer-new/raw-data-handler/index.js +1 -1
- package/dist/esm/vc/vc-observer-new/viewport-observer/index.js +2 -2
- package/dist/types/common/vc/types.d.ts +1 -1
- package/dist/types/vc/vc-observer/observers/ssr-placeholders/index.d.ts +2 -0
- package/dist/types-ts4.5/common/vc/types.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer/observers/ssr-placeholders/index.d.ts +2 -0
- package/package.json +2 -2
|
@@ -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
|
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
8
|
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; } }
|
|
10
9
|
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; }
|
|
@@ -38,9 +37,9 @@ function getLateMutations(vcDetails) {
|
|
|
38
37
|
element: element,
|
|
39
38
|
viewportHeatmapPercentage: (postInteractionFinishVCRatios === null || postInteractionFinishVCRatios === void 0 ? void 0 : postInteractionFinishVCRatios[element]) || 0
|
|
40
39
|
};
|
|
41
|
-
if (labelStacks
|
|
40
|
+
if (labelStacks) {
|
|
42
41
|
var labels = labelStacks[element];
|
|
43
|
-
if (labels) {
|
|
42
|
+
if (labels && typeof labels !== 'string') {
|
|
44
43
|
lateMutation.segment = labels.segment;
|
|
45
44
|
lateMutation.labelStack = labels.labelStack;
|
|
46
45
|
}
|
|
@@ -197,6 +197,34 @@ var SSRPlaceholderHandlers = exports.SSRPlaceholderHandlers = /*#__PURE__*/funct
|
|
|
197
197
|
// data-ssr-placeholder-ignored doesn't have a value.
|
|
198
198
|
return 'ssrPlaceholderIgnored' in element.dataset;
|
|
199
199
|
}
|
|
200
|
+
}, {
|
|
201
|
+
key: "isPlaceholderV4",
|
|
202
|
+
value: function isPlaceholderV4(element) {
|
|
203
|
+
var currentElement = element;
|
|
204
|
+
var i = 0;
|
|
205
|
+
while (currentElement && i < ANCESTOR_LOOKUP_LIMIT) {
|
|
206
|
+
if (Boolean(this.getPlaceholderId(currentElement))) {
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
currentElement = currentElement.parentElement;
|
|
210
|
+
i++;
|
|
211
|
+
}
|
|
212
|
+
return false;
|
|
213
|
+
}
|
|
214
|
+
}, {
|
|
215
|
+
key: "isPlaceholderReplacementV4",
|
|
216
|
+
value: function isPlaceholderReplacementV4(element) {
|
|
217
|
+
var currentElement = element;
|
|
218
|
+
var i = 0;
|
|
219
|
+
while (currentElement && i < ANCESTOR_LOOKUP_LIMIT) {
|
|
220
|
+
if (Boolean(this.getPlaceholderReplacementId(currentElement))) {
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
currentElement = currentElement.parentElement;
|
|
224
|
+
i++;
|
|
225
|
+
}
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
200
228
|
}, {
|
|
201
229
|
key: "findNearestPlaceholderContainerIfIgnored",
|
|
202
230
|
value: function findNearestPlaceholderContainerIfIgnored(element) {
|
|
@@ -88,7 +88,7 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
88
88
|
oldValue: mutationData === null || mutationData === void 0 ? void 0 : mutationData.oldValue,
|
|
89
89
|
newValue: mutationData === null || mutationData === void 0 ? void 0 : mutationData.newValue
|
|
90
90
|
};
|
|
91
|
-
if (element && _this.isPostInteraction
|
|
91
|
+
if (element && (_this.isPostInteraction || (0, _platformFeatureFlags.fg)('platform_ufo_add_segment_names_to_dom_offenders'))) {
|
|
92
92
|
var labelStacks = getLabelStacks(element);
|
|
93
93
|
if (labelStacks) {
|
|
94
94
|
Object.assign(data, {
|
|
@@ -83,7 +83,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
83
83
|
}
|
|
84
84
|
}, {
|
|
85
85
|
key: "getLabelStacks",
|
|
86
|
-
value: function getLabelStacks(filteredEntries) {
|
|
86
|
+
value: function getLabelStacks(filteredEntries, isPostInteraction) {
|
|
87
87
|
var labelStacks = {};
|
|
88
88
|
var _iterator3 = _createForOfIteratorHelper(filteredEntries),
|
|
89
89
|
_step3;
|
|
@@ -91,10 +91,14 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
91
91
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
92
92
|
var _entry2 = _step3.value;
|
|
93
93
|
if ('elementName' in _entry2.data && _entry2.data.labelStacks) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
if (isPostInteraction) {
|
|
95
|
+
labelStacks[_entry2.data.elementName] = {
|
|
96
|
+
segment: _entry2.data.labelStacks.segment,
|
|
97
|
+
labelStack: _entry2.data.labelStacks.labelStack
|
|
98
|
+
};
|
|
99
|
+
} else if ((0, _platformFeatureFlags.fg)('platform_ufo_add_segment_names_to_dom_offenders')) {
|
|
100
|
+
labelStacks[_entry2.data.elementName] = _entry2.data.labelStacks.labelStack;
|
|
101
|
+
}
|
|
98
102
|
}
|
|
99
103
|
}
|
|
100
104
|
} catch (err) {
|
|
@@ -415,8 +419,8 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
415
419
|
if (ssrRatio !== -1) {
|
|
416
420
|
result.ssrRatio = ssrRatio;
|
|
417
421
|
}
|
|
418
|
-
if (isPostInteraction) {
|
|
419
|
-
result.labelStacks = this.getLabelStacks(filteredEntries);
|
|
422
|
+
if (isPostInteraction || (0, _platformFeatureFlags.fg)('platform_ufo_add_segment_names_to_dom_offenders')) {
|
|
423
|
+
result.labelStacks = this.getLabelStacks(filteredEntries, isPostInteraction);
|
|
420
424
|
}
|
|
421
425
|
return _context2.abrupt("return", result);
|
|
422
426
|
case 17:
|
|
@@ -123,7 +123,7 @@ var RawDataHandler = exports.default = /*#__PURE__*/function () {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
var observation = _objectSpread({
|
|
126
|
-
t: Math.round(entry.time),
|
|
126
|
+
t: Math.round(entry.time - startTime),
|
|
127
127
|
r: [Math.round(rect.left * 10) / 10, Math.round(rect.top * 10) / 10, Math.round(rect.right * 10) / 10, Math.round(rect.bottom * 10) / 10],
|
|
128
128
|
chg: chg,
|
|
129
129
|
eid: eid || 0
|
|
@@ -80,10 +80,10 @@ var createElementMutationsWatcherV4 = function createElementMutationsWatcherV4(r
|
|
|
80
80
|
if (getSSRPlaceholderHandler) {
|
|
81
81
|
var ssrPlaceholderHandler = getSSRPlaceholderHandler();
|
|
82
82
|
if (ssrPlaceholderHandler) {
|
|
83
|
-
if ((ssrPlaceholderHandler.
|
|
83
|
+
if ((ssrPlaceholderHandler.isPlaceholderV4(target) || ssrPlaceholderHandler.isPlaceholderIgnored(target)) && ssrPlaceholderHandler.checkIfExistedAndSizeMatchingV3(target)) {
|
|
84
84
|
return 'mutation:ssr-placeholder';
|
|
85
85
|
}
|
|
86
|
-
if ((ssrPlaceholderHandler.
|
|
86
|
+
if ((ssrPlaceholderHandler.isPlaceholderReplacementV4(target) || ssrPlaceholderHandler.isPlaceholderIgnored(target)) && ssrPlaceholderHandler.validateReactComponentMatchToPlaceholderV4(target)) {
|
|
87
87
|
return 'mutation:ssr-placeholder';
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
1
|
function getLateMutations(vcDetails, labelStacks = {}, lastInteractionFinish, postInteractionFinishVCRatios) {
|
|
3
2
|
// Map to track which elements are already seen for each timestamp
|
|
4
3
|
const seen = new Map();
|
|
@@ -22,9 +21,9 @@ function getLateMutations(vcDetails, labelStacks = {}, lastInteractionFinish, po
|
|
|
22
21
|
element,
|
|
23
22
|
viewportHeatmapPercentage: (postInteractionFinishVCRatios === null || postInteractionFinishVCRatios === void 0 ? void 0 : postInteractionFinishVCRatios[element]) || 0
|
|
24
23
|
};
|
|
25
|
-
if (labelStacks
|
|
24
|
+
if (labelStacks) {
|
|
26
25
|
const labels = labelStacks[element];
|
|
27
|
-
if (labels) {
|
|
26
|
+
if (labels && typeof labels !== 'string') {
|
|
28
27
|
lateMutation.segment = labels.segment;
|
|
29
28
|
lateMutation.labelStack = labels.labelStack;
|
|
30
29
|
}
|
|
@@ -170,6 +170,30 @@ export class SSRPlaceholderHandlers {
|
|
|
170
170
|
// data-ssr-placeholder-ignored doesn't have a value.
|
|
171
171
|
return 'ssrPlaceholderIgnored' in element.dataset;
|
|
172
172
|
}
|
|
173
|
+
isPlaceholderV4(element) {
|
|
174
|
+
let currentElement = element;
|
|
175
|
+
let i = 0;
|
|
176
|
+
while (currentElement && i < ANCESTOR_LOOKUP_LIMIT) {
|
|
177
|
+
if (Boolean(this.getPlaceholderId(currentElement))) {
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
currentElement = currentElement.parentElement;
|
|
181
|
+
i++;
|
|
182
|
+
}
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
isPlaceholderReplacementV4(element) {
|
|
186
|
+
let currentElement = element;
|
|
187
|
+
let i = 0;
|
|
188
|
+
while (currentElement && i < ANCESTOR_LOOKUP_LIMIT) {
|
|
189
|
+
if (Boolean(this.getPlaceholderReplacementId(currentElement))) {
|
|
190
|
+
return true;
|
|
191
|
+
}
|
|
192
|
+
currentElement = currentElement.parentElement;
|
|
193
|
+
i++;
|
|
194
|
+
}
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
173
197
|
findNearestPlaceholderContainerIfIgnored(element) {
|
|
174
198
|
if (!this.isPlaceholderIgnored(element)) {
|
|
175
199
|
return element;
|
|
@@ -74,7 +74,7 @@ export default class VCObserverNew {
|
|
|
74
74
|
oldValue: mutationData === null || mutationData === void 0 ? void 0 : mutationData.oldValue,
|
|
75
75
|
newValue: mutationData === null || mutationData === void 0 ? void 0 : mutationData.newValue
|
|
76
76
|
};
|
|
77
|
-
if (element && this.isPostInteraction
|
|
77
|
+
if (element && (this.isPostInteraction || fg('platform_ufo_add_segment_names_to_dom_offenders'))) {
|
|
78
78
|
const labelStacks = getLabelStacks(element);
|
|
79
79
|
if (labelStacks) {
|
|
80
80
|
Object.assign(data, {
|
|
@@ -39,14 +39,18 @@ export default class AbstractVCCalculatorBase {
|
|
|
39
39
|
}
|
|
40
40
|
return ratios;
|
|
41
41
|
}
|
|
42
|
-
getLabelStacks(filteredEntries) {
|
|
42
|
+
getLabelStacks(filteredEntries, isPostInteraction) {
|
|
43
43
|
const labelStacks = {};
|
|
44
44
|
for (const entry of filteredEntries) {
|
|
45
45
|
if ('elementName' in entry.data && entry.data.labelStacks) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
if (isPostInteraction) {
|
|
47
|
+
labelStacks[entry.data.elementName] = {
|
|
48
|
+
segment: entry.data.labelStacks.segment,
|
|
49
|
+
labelStack: entry.data.labelStacks.labelStack
|
|
50
|
+
};
|
|
51
|
+
} else if (fg('platform_ufo_add_segment_names_to_dom_offenders')) {
|
|
52
|
+
labelStacks[entry.data.elementName] = entry.data.labelStacks.labelStack;
|
|
53
|
+
}
|
|
50
54
|
}
|
|
51
55
|
}
|
|
52
56
|
return labelStacks;
|
|
@@ -300,8 +304,8 @@ export default class AbstractVCCalculatorBase {
|
|
|
300
304
|
if (ssrRatio !== -1) {
|
|
301
305
|
result.ssrRatio = ssrRatio;
|
|
302
306
|
}
|
|
303
|
-
if (isPostInteraction) {
|
|
304
|
-
result.labelStacks = this.getLabelStacks(filteredEntries);
|
|
307
|
+
if (isPostInteraction || fg('platform_ufo_add_segment_names_to_dom_offenders')) {
|
|
308
|
+
result.labelStacks = this.getLabelStacks(filteredEntries, isPostInteraction);
|
|
305
309
|
}
|
|
306
310
|
return result;
|
|
307
311
|
}
|
|
@@ -100,7 +100,7 @@ export default class RawDataHandler {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
const observation = {
|
|
103
|
-
t: Math.round(entry.time),
|
|
103
|
+
t: Math.round(entry.time - startTime),
|
|
104
104
|
r: [Math.round(rect.left * 10) / 10, Math.round(rect.top * 10) / 10, Math.round(rect.right * 10) / 10, Math.round(rect.bottom * 10) / 10],
|
|
105
105
|
chg,
|
|
106
106
|
eid: eid || 0,
|
|
@@ -61,10 +61,10 @@ const createElementMutationsWatcherV4 = (removedNodeRects, isWithinThirdPartySeg
|
|
|
61
61
|
if (getSSRPlaceholderHandler) {
|
|
62
62
|
const ssrPlaceholderHandler = getSSRPlaceholderHandler();
|
|
63
63
|
if (ssrPlaceholderHandler) {
|
|
64
|
-
if ((ssrPlaceholderHandler.
|
|
64
|
+
if ((ssrPlaceholderHandler.isPlaceholderV4(target) || ssrPlaceholderHandler.isPlaceholderIgnored(target)) && ssrPlaceholderHandler.checkIfExistedAndSizeMatchingV3(target)) {
|
|
65
65
|
return 'mutation:ssr-placeholder';
|
|
66
66
|
}
|
|
67
|
-
if ((ssrPlaceholderHandler.
|
|
67
|
+
if ((ssrPlaceholderHandler.isPlaceholderReplacementV4(target) || ssrPlaceholderHandler.isPlaceholderIgnored(target)) && ssrPlaceholderHandler.validateReactComponentMatchToPlaceholderV4(target)) {
|
|
68
68
|
return 'mutation:ssr-placeholder';
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -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
|
function getLateMutations(vcDetails) {
|
|
6
5
|
var labelStacks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
7
6
|
var lastInteractionFinish = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -32,9 +31,9 @@ function getLateMutations(vcDetails) {
|
|
|
32
31
|
element: element,
|
|
33
32
|
viewportHeatmapPercentage: (postInteractionFinishVCRatios === null || postInteractionFinishVCRatios === void 0 ? void 0 : postInteractionFinishVCRatios[element]) || 0
|
|
34
33
|
};
|
|
35
|
-
if (labelStacks
|
|
34
|
+
if (labelStacks) {
|
|
36
35
|
var labels = labelStacks[element];
|
|
37
|
-
if (labels) {
|
|
36
|
+
if (labels && typeof labels !== 'string') {
|
|
38
37
|
lateMutation.segment = labels.segment;
|
|
39
38
|
lateMutation.labelStack = labels.labelStack;
|
|
40
39
|
}
|
|
@@ -190,6 +190,34 @@ export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
|
|
|
190
190
|
// data-ssr-placeholder-ignored doesn't have a value.
|
|
191
191
|
return 'ssrPlaceholderIgnored' in element.dataset;
|
|
192
192
|
}
|
|
193
|
+
}, {
|
|
194
|
+
key: "isPlaceholderV4",
|
|
195
|
+
value: function isPlaceholderV4(element) {
|
|
196
|
+
var currentElement = element;
|
|
197
|
+
var i = 0;
|
|
198
|
+
while (currentElement && i < ANCESTOR_LOOKUP_LIMIT) {
|
|
199
|
+
if (Boolean(this.getPlaceholderId(currentElement))) {
|
|
200
|
+
return true;
|
|
201
|
+
}
|
|
202
|
+
currentElement = currentElement.parentElement;
|
|
203
|
+
i++;
|
|
204
|
+
}
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
}, {
|
|
208
|
+
key: "isPlaceholderReplacementV4",
|
|
209
|
+
value: function isPlaceholderReplacementV4(element) {
|
|
210
|
+
var currentElement = element;
|
|
211
|
+
var i = 0;
|
|
212
|
+
while (currentElement && i < ANCESTOR_LOOKUP_LIMIT) {
|
|
213
|
+
if (Boolean(this.getPlaceholderReplacementId(currentElement))) {
|
|
214
|
+
return true;
|
|
215
|
+
}
|
|
216
|
+
currentElement = currentElement.parentElement;
|
|
217
|
+
i++;
|
|
218
|
+
}
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
193
221
|
}, {
|
|
194
222
|
key: "findNearestPlaceholderContainerIfIgnored",
|
|
195
223
|
value: function findNearestPlaceholderContainerIfIgnored(element) {
|
|
@@ -81,7 +81,7 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
81
81
|
oldValue: mutationData === null || mutationData === void 0 ? void 0 : mutationData.oldValue,
|
|
82
82
|
newValue: mutationData === null || mutationData === void 0 ? void 0 : mutationData.newValue
|
|
83
83
|
};
|
|
84
|
-
if (element && _this.isPostInteraction
|
|
84
|
+
if (element && (_this.isPostInteraction || fg('platform_ufo_add_segment_names_to_dom_offenders'))) {
|
|
85
85
|
var labelStacks = getLabelStacks(element);
|
|
86
86
|
if (labelStacks) {
|
|
87
87
|
Object.assign(data, {
|
|
@@ -77,7 +77,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
77
77
|
}
|
|
78
78
|
}, {
|
|
79
79
|
key: "getLabelStacks",
|
|
80
|
-
value: function getLabelStacks(filteredEntries) {
|
|
80
|
+
value: function getLabelStacks(filteredEntries, isPostInteraction) {
|
|
81
81
|
var labelStacks = {};
|
|
82
82
|
var _iterator3 = _createForOfIteratorHelper(filteredEntries),
|
|
83
83
|
_step3;
|
|
@@ -85,10 +85,14 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
85
85
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
86
86
|
var _entry2 = _step3.value;
|
|
87
87
|
if ('elementName' in _entry2.data && _entry2.data.labelStacks) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
if (isPostInteraction) {
|
|
89
|
+
labelStacks[_entry2.data.elementName] = {
|
|
90
|
+
segment: _entry2.data.labelStacks.segment,
|
|
91
|
+
labelStack: _entry2.data.labelStacks.labelStack
|
|
92
|
+
};
|
|
93
|
+
} else if (fg('platform_ufo_add_segment_names_to_dom_offenders')) {
|
|
94
|
+
labelStacks[_entry2.data.elementName] = _entry2.data.labelStacks.labelStack;
|
|
95
|
+
}
|
|
92
96
|
}
|
|
93
97
|
}
|
|
94
98
|
} catch (err) {
|
|
@@ -409,8 +413,8 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
409
413
|
if (ssrRatio !== -1) {
|
|
410
414
|
result.ssrRatio = ssrRatio;
|
|
411
415
|
}
|
|
412
|
-
if (isPostInteraction) {
|
|
413
|
-
result.labelStacks = this.getLabelStacks(filteredEntries);
|
|
416
|
+
if (isPostInteraction || fg('platform_ufo_add_segment_names_to_dom_offenders')) {
|
|
417
|
+
result.labelStacks = this.getLabelStacks(filteredEntries, isPostInteraction);
|
|
414
418
|
}
|
|
415
419
|
return _context2.abrupt("return", result);
|
|
416
420
|
case 17:
|
|
@@ -116,7 +116,7 @@ var RawDataHandler = /*#__PURE__*/function () {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
var observation = _objectSpread({
|
|
119
|
-
t: Math.round(entry.time),
|
|
119
|
+
t: Math.round(entry.time - startTime),
|
|
120
120
|
r: [Math.round(rect.left * 10) / 10, Math.round(rect.top * 10) / 10, Math.round(rect.right * 10) / 10, Math.round(rect.bottom * 10) / 10],
|
|
121
121
|
chg: chg,
|
|
122
122
|
eid: eid || 0
|
|
@@ -71,10 +71,10 @@ var createElementMutationsWatcherV4 = function createElementMutationsWatcherV4(r
|
|
|
71
71
|
if (getSSRPlaceholderHandler) {
|
|
72
72
|
var ssrPlaceholderHandler = getSSRPlaceholderHandler();
|
|
73
73
|
if (ssrPlaceholderHandler) {
|
|
74
|
-
if ((ssrPlaceholderHandler.
|
|
74
|
+
if ((ssrPlaceholderHandler.isPlaceholderV4(target) || ssrPlaceholderHandler.isPlaceholderIgnored(target)) && ssrPlaceholderHandler.checkIfExistedAndSizeMatchingV3(target)) {
|
|
75
75
|
return 'mutation:ssr-placeholder';
|
|
76
76
|
}
|
|
77
|
-
if ((ssrPlaceholderHandler.
|
|
77
|
+
if ((ssrPlaceholderHandler.isPlaceholderReplacementV4(target) || ssrPlaceholderHandler.isPlaceholderIgnored(target)) && ssrPlaceholderHandler.validateReactComponentMatchToPlaceholderV4(target)) {
|
|
78
78
|
return 'mutation:ssr-placeholder';
|
|
79
79
|
}
|
|
80
80
|
}
|
|
@@ -28,6 +28,8 @@ export declare class SSRPlaceholderHandlers {
|
|
|
28
28
|
isPlaceholder(element: HTMLElement): boolean;
|
|
29
29
|
isPlaceholderReplacement(element: HTMLElement): boolean;
|
|
30
30
|
isPlaceholderIgnored(element: HTMLElement): boolean;
|
|
31
|
+
isPlaceholderV4(element: HTMLElement): boolean;
|
|
32
|
+
isPlaceholderReplacementV4(element: HTMLElement): boolean;
|
|
31
33
|
findNearestPlaceholderContainerIfIgnored(element: HTMLElement): HTMLElement;
|
|
32
34
|
checkIfExistedAndSizeMatching(el: HTMLElement): Promise<boolean>;
|
|
33
35
|
checkIfExistedAndSizeMatchingV3(el: HTMLElement): boolean;
|
|
@@ -28,6 +28,8 @@ export declare class SSRPlaceholderHandlers {
|
|
|
28
28
|
isPlaceholder(element: HTMLElement): boolean;
|
|
29
29
|
isPlaceholderReplacement(element: HTMLElement): boolean;
|
|
30
30
|
isPlaceholderIgnored(element: HTMLElement): boolean;
|
|
31
|
+
isPlaceholderV4(element: HTMLElement): boolean;
|
|
32
|
+
isPlaceholderReplacementV4(element: HTMLElement): boolean;
|
|
31
33
|
findNearestPlaceholderContainerIfIgnored(element: HTMLElement): HTMLElement;
|
|
32
34
|
checkIfExistedAndSizeMatching(el: HTMLElement): Promise<boolean>;
|
|
33
35
|
checkIfExistedAndSizeMatchingV3(el: HTMLElement): 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.8",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"platform_ufo_enable_late_holds_post_interaction": {
|
|
144
144
|
"type": "boolean"
|
|
145
145
|
},
|
|
146
|
-
"
|
|
146
|
+
"platform_ufo_add_segment_names_to_dom_offenders": {
|
|
147
147
|
"type": "boolean"
|
|
148
148
|
},
|
|
149
149
|
"platform_ufo_filter_cls_logs_same_rects_positions": {
|