@atlaskit/react-ufo 2.5.1 → 2.5.3
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 +17 -0
- package/dist/cjs/interaction-metrics/index.js +1 -1
- package/dist/cjs/vc/vc-observer/index.js +25 -25
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/index.js +21 -4
- package/dist/es2019/interaction-metrics/index.js +1 -1
- package/dist/es2019/vc/vc-observer/index.js +19 -19
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/index.js +21 -4
- package/dist/esm/interaction-metrics/index.js +1 -1
- package/dist/esm/vc/vc-observer/index.js +25 -25
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/index.js +21 -4
- package/dist/types/vc/vc-observer/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer/index.d.ts +1 -1
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 2.5.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#179859](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/179859)
|
|
8
|
+
[`3685feff446c1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3685feff446c1) -
|
|
9
|
+
Use getBoundingClientRect instead of value from intersectionObserver for the purpose of checking
|
|
10
|
+
layout shift for SSR placeholders.
|
|
11
|
+
|
|
12
|
+
## 2.5.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#179378](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/179378)
|
|
17
|
+
[`0c54148687bda`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0c54148687bda) -
|
|
18
|
+
move filtering of components log to allow for ufo:vc:next observation
|
|
19
|
+
|
|
3
20
|
## 2.5.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -482,7 +482,7 @@ var finishInteraction = function finishInteraction(id, data) {
|
|
|
482
482
|
(0, _experienceTraceIdContext.clearActiveTrace)();
|
|
483
483
|
callCleanUpCallbacks(data);
|
|
484
484
|
if ((_getConfig3 = (0, _config.getConfig)()) !== null && _getConfig3 !== void 0 && (_getConfig3 = _getConfig3.vc) !== null && _getConfig3 !== void 0 && _getConfig3.stopVCAtInteractionFinish) {
|
|
485
|
-
data.vc = (0, _vc.getVCObserver)().getVCRawData(
|
|
485
|
+
data.vc = (0, _vc.getVCObserver)().getVCRawData();
|
|
486
486
|
}
|
|
487
487
|
remove(id);
|
|
488
488
|
PreviousInteractionLog.name = data.ufoName || 'unknown';
|
|
@@ -71,7 +71,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
71
71
|
var info = _this.abortReason.info !== '' ? " ".concat(_this.abortReason.info) : '';
|
|
72
72
|
return "".concat(_this.abortReason.reason).concat(info);
|
|
73
73
|
});
|
|
74
|
-
(0, _defineProperty2.default)(this, "getVCRawData", function (
|
|
74
|
+
(0, _defineProperty2.default)(this, "getVCRawData", function () {
|
|
75
75
|
_this.measureStart();
|
|
76
76
|
if (!_this.active) {
|
|
77
77
|
_this.measureStop();
|
|
@@ -80,20 +80,6 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
80
80
|
_this.stop();
|
|
81
81
|
var abortReasonInfo = _this.getAbortReasonInfo();
|
|
82
82
|
_this.measureStop();
|
|
83
|
-
var componentsLog = {};
|
|
84
|
-
if (stopTime && (0, _platformFeatureFlags.fg)('ufo-remove-vc-component-observations-after-ttai')) {
|
|
85
|
-
Object.entries(_this.componentsLog).forEach(function (_ref3) {
|
|
86
|
-
var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
|
|
87
|
-
_timestamp = _ref4[0],
|
|
88
|
-
value = _ref4[1];
|
|
89
|
-
var timestamp = Number(_timestamp);
|
|
90
|
-
if (stopTime > timestamp) {
|
|
91
|
-
componentsLog[timestamp] = value;
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
} else {
|
|
95
|
-
componentsLog = _objectSpread({}, _this.componentsLog);
|
|
96
|
-
}
|
|
97
83
|
return {
|
|
98
84
|
abortReasonInfo: abortReasonInfo,
|
|
99
85
|
abortReason: _objectSpread({}, _this.abortReason),
|
|
@@ -101,24 +87,24 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
101
87
|
heatmapNext: _this.heatmapNext,
|
|
102
88
|
outOfBoundaryInfo: _this.outOfBoundaryInfo,
|
|
103
89
|
totalTime: Math.round(_this.totalTime + _this.observers.getTotalTime()),
|
|
104
|
-
componentsLog: componentsLog,
|
|
90
|
+
componentsLog: _objectSpread({}, _this.componentsLog),
|
|
105
91
|
viewport: _objectSpread({}, _this.viewport),
|
|
106
92
|
oldDomUpdatesEnabled: _this.oldDomUpdatesEnabled,
|
|
107
93
|
devToolsEnabled: _this.devToolsEnabled,
|
|
108
94
|
ratios: _this.vcRatios
|
|
109
95
|
};
|
|
110
96
|
});
|
|
111
|
-
(0, _defineProperty2.default)(this, "getVCResult", function (
|
|
112
|
-
var start =
|
|
113
|
-
stop =
|
|
114
|
-
tti =
|
|
115
|
-
prefix =
|
|
116
|
-
ssr =
|
|
117
|
-
vc =
|
|
97
|
+
(0, _defineProperty2.default)(this, "getVCResult", function (_ref3) {
|
|
98
|
+
var start = _ref3.start,
|
|
99
|
+
stop = _ref3.stop,
|
|
100
|
+
tti = _ref3.tti,
|
|
101
|
+
prefix = _ref3.prefix,
|
|
102
|
+
ssr = _ref3.ssr,
|
|
103
|
+
vc = _ref3.vc;
|
|
118
104
|
var startTime = performance.now();
|
|
119
105
|
// add local measurement
|
|
120
106
|
var fullPrefix = prefix !== undefined && prefix !== '' ? "".concat(prefix, ":") : '';
|
|
121
|
-
var rawData = vc !== undefined ? vc : _this.getVCRawData(
|
|
107
|
+
var rawData = vc !== undefined ? vc : _this.getVCRawData();
|
|
122
108
|
if (rawData === null) {
|
|
123
109
|
return {};
|
|
124
110
|
}
|
|
@@ -166,10 +152,24 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
166
152
|
} catch (e) {
|
|
167
153
|
/* empty */
|
|
168
154
|
}
|
|
155
|
+
var _componentsLog = {};
|
|
156
|
+
if ((0, _platformFeatureFlags.fg)('ufo-remove-vc-component-observations-after-ttai')) {
|
|
157
|
+
Object.entries(_this.componentsLog).forEach(function (_ref5) {
|
|
158
|
+
var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
|
|
159
|
+
_timestamp = _ref6[0],
|
|
160
|
+
value = _ref6[1];
|
|
161
|
+
var timestamp = Number(_timestamp);
|
|
162
|
+
if (stop > timestamp) {
|
|
163
|
+
_componentsLog[timestamp] = value;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
} else {
|
|
167
|
+
_componentsLog = _objectSpread({}, componentsLog);
|
|
168
|
+
}
|
|
169
169
|
var vcNext = VCObserver.calculateVC({
|
|
170
170
|
heatmap: heatmapNext,
|
|
171
171
|
ssr: ssr,
|
|
172
|
-
componentsLog:
|
|
172
|
+
componentsLog: _componentsLog,
|
|
173
173
|
viewport: viewport
|
|
174
174
|
});
|
|
175
175
|
var outOfBoundary = outOfBoundaryInfo ? (0, _defineProperty2.default)({}, "".concat(fullPrefix, "vc:oob"), outOfBoundaryInfo) : {};
|
|
@@ -8,6 +8,7 @@ exports.SSRPlaceholderHandlers = 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 _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var EQUALITY_THRESHOLD = 0.1;
|
|
12
13
|
var ANCESTOR_LOOKUP_LIMIT = 10;
|
|
13
14
|
var SSRPlaceholderHandlers = exports.SSRPlaceholderHandlers = /*#__PURE__*/function () {
|
|
@@ -35,8 +36,16 @@ var SSRPlaceholderHandlers = exports.SSRPlaceholderHandlers = /*#__PURE__*/funct
|
|
|
35
36
|
return;
|
|
36
37
|
}
|
|
37
38
|
var rect = _this.staticPlaceholders.get(staticKey);
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
if ((0, _platformFeatureFlags.fg)('platform_ufo_ssr_ttvc_use_target_rect')) {
|
|
40
|
+
requestAnimationFrame(function () {
|
|
41
|
+
var targetRect = target.getBoundingClientRect();
|
|
42
|
+
var hasSameSizePosition = _this.hasSameSizePosition(rect, targetRect);
|
|
43
|
+
_resolve(hasSameSizePosition);
|
|
44
|
+
});
|
|
45
|
+
} else {
|
|
46
|
+
var hasSameSizePosition = _this.hasSameSizePosition(rect, boundingClientRect);
|
|
47
|
+
_resolve(hasSameSizePosition);
|
|
48
|
+
}
|
|
40
49
|
_this.callbacks.delete(staticKey);
|
|
41
50
|
}
|
|
42
51
|
} else {
|
|
@@ -46,8 +55,16 @@ var SSRPlaceholderHandlers = exports.SSRPlaceholderHandlers = /*#__PURE__*/funct
|
|
|
46
55
|
return;
|
|
47
56
|
}
|
|
48
57
|
var _rect = _this.staticPlaceholders.get(key);
|
|
49
|
-
|
|
50
|
-
|
|
58
|
+
if ((0, _platformFeatureFlags.fg)('platform_ufo_ssr_ttvc_use_target_rect')) {
|
|
59
|
+
requestAnimationFrame(function () {
|
|
60
|
+
var targetRect = target.getBoundingClientRect();
|
|
61
|
+
var hasSameSizePosition = _this.hasSameSizePosition(_rect, targetRect);
|
|
62
|
+
_resolve2(hasSameSizePosition);
|
|
63
|
+
});
|
|
64
|
+
} else {
|
|
65
|
+
var _hasSameSizePosition = _this.hasSameSizePosition(_rect, boundingClientRect);
|
|
66
|
+
_resolve2(_hasSameSizePosition);
|
|
67
|
+
}
|
|
51
68
|
_this.staticPlaceholders.delete(staticKey);
|
|
52
69
|
_this.reactValidateCallbacks.delete(staticKey);
|
|
53
70
|
}
|
|
@@ -411,7 +411,7 @@ const finishInteraction = (id, data, endTime = performance.now()) => {
|
|
|
411
411
|
clearActiveTrace();
|
|
412
412
|
callCleanUpCallbacks(data);
|
|
413
413
|
if ((_getConfig3 = getConfig()) !== null && _getConfig3 !== void 0 && (_getConfig3$vc = _getConfig3.vc) !== null && _getConfig3$vc !== void 0 && _getConfig3$vc.stopVCAtInteractionFinish) {
|
|
414
|
-
data.vc = getVCObserver().getVCRawData(
|
|
414
|
+
data.vc = getVCObserver().getVCRawData();
|
|
415
415
|
}
|
|
416
416
|
remove(id);
|
|
417
417
|
PreviousInteractionLog.name = data.ufoName || 'unknown';
|
|
@@ -52,7 +52,7 @@ export class VCObserver {
|
|
|
52
52
|
const info = this.abortReason.info !== '' ? ` ${this.abortReason.info}` : '';
|
|
53
53
|
return `${this.abortReason.reason}${info}`;
|
|
54
54
|
});
|
|
55
|
-
_defineProperty(this, "getVCRawData",
|
|
55
|
+
_defineProperty(this, "getVCRawData", () => {
|
|
56
56
|
this.measureStart();
|
|
57
57
|
if (!this.active) {
|
|
58
58
|
this.measureStop();
|
|
@@ -61,19 +61,6 @@ export class VCObserver {
|
|
|
61
61
|
this.stop();
|
|
62
62
|
const abortReasonInfo = this.getAbortReasonInfo();
|
|
63
63
|
this.measureStop();
|
|
64
|
-
let componentsLog = {};
|
|
65
|
-
if (stopTime && fg('ufo-remove-vc-component-observations-after-ttai')) {
|
|
66
|
-
Object.entries(this.componentsLog).forEach(([_timestamp, value]) => {
|
|
67
|
-
const timestamp = Number(_timestamp);
|
|
68
|
-
if (stopTime > timestamp) {
|
|
69
|
-
componentsLog[timestamp] = value;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
} else {
|
|
73
|
-
componentsLog = {
|
|
74
|
-
...this.componentsLog
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
64
|
return {
|
|
78
65
|
abortReasonInfo,
|
|
79
66
|
abortReason: {
|
|
@@ -83,7 +70,9 @@ export class VCObserver {
|
|
|
83
70
|
heatmapNext: this.heatmapNext,
|
|
84
71
|
outOfBoundaryInfo: this.outOfBoundaryInfo,
|
|
85
72
|
totalTime: Math.round(this.totalTime + this.observers.getTotalTime()),
|
|
86
|
-
componentsLog
|
|
73
|
+
componentsLog: {
|
|
74
|
+
...this.componentsLog
|
|
75
|
+
},
|
|
87
76
|
viewport: {
|
|
88
77
|
...this.viewport
|
|
89
78
|
},
|
|
@@ -103,7 +92,7 @@ export class VCObserver {
|
|
|
103
92
|
const startTime = performance.now();
|
|
104
93
|
// add local measurement
|
|
105
94
|
const fullPrefix = prefix !== undefined && prefix !== '' ? `${prefix}:` : '';
|
|
106
|
-
const rawData = vc !== undefined ? vc : this.getVCRawData(
|
|
95
|
+
const rawData = vc !== undefined ? vc : this.getVCRawData();
|
|
107
96
|
if (rawData === null) {
|
|
108
97
|
return {};
|
|
109
98
|
}
|
|
@@ -160,12 +149,23 @@ export class VCObserver {
|
|
|
160
149
|
} catch (e) {
|
|
161
150
|
/* empty */
|
|
162
151
|
}
|
|
152
|
+
let _componentsLog = {};
|
|
153
|
+
if (fg('ufo-remove-vc-component-observations-after-ttai')) {
|
|
154
|
+
Object.entries(this.componentsLog).forEach(([_timestamp, value]) => {
|
|
155
|
+
const timestamp = Number(_timestamp);
|
|
156
|
+
if (stop > timestamp) {
|
|
157
|
+
_componentsLog[timestamp] = value;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
} else {
|
|
161
|
+
_componentsLog = {
|
|
162
|
+
...componentsLog
|
|
163
|
+
};
|
|
164
|
+
}
|
|
163
165
|
const vcNext = VCObserver.calculateVC({
|
|
164
166
|
heatmap: heatmapNext,
|
|
165
167
|
ssr,
|
|
166
|
-
componentsLog:
|
|
167
|
-
...componentsLog
|
|
168
|
-
},
|
|
168
|
+
componentsLog: _componentsLog,
|
|
169
169
|
viewport
|
|
170
170
|
});
|
|
171
171
|
const outOfBoundary = outOfBoundaryInfo ? {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
const EQUALITY_THRESHOLD = 0.1;
|
|
3
4
|
const ANCESTOR_LOOKUP_LIMIT = 10;
|
|
4
5
|
export class SSRPlaceholderHandlers {
|
|
@@ -25,8 +26,16 @@ export class SSRPlaceholderHandlers {
|
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
27
28
|
const rect = this.staticPlaceholders.get(staticKey);
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
if (fg('platform_ufo_ssr_ttvc_use_target_rect')) {
|
|
30
|
+
requestAnimationFrame(() => {
|
|
31
|
+
const targetRect = target.getBoundingClientRect();
|
|
32
|
+
const hasSameSizePosition = this.hasSameSizePosition(rect, targetRect);
|
|
33
|
+
resolve(hasSameSizePosition);
|
|
34
|
+
});
|
|
35
|
+
} else {
|
|
36
|
+
const hasSameSizePosition = this.hasSameSizePosition(rect, boundingClientRect);
|
|
37
|
+
resolve(hasSameSizePosition);
|
|
38
|
+
}
|
|
30
39
|
this.callbacks.delete(staticKey);
|
|
31
40
|
}
|
|
32
41
|
} else {
|
|
@@ -36,8 +45,16 @@ export class SSRPlaceholderHandlers {
|
|
|
36
45
|
return;
|
|
37
46
|
}
|
|
38
47
|
const rect = this.staticPlaceholders.get(key);
|
|
39
|
-
|
|
40
|
-
|
|
48
|
+
if (fg('platform_ufo_ssr_ttvc_use_target_rect')) {
|
|
49
|
+
requestAnimationFrame(() => {
|
|
50
|
+
const targetRect = target.getBoundingClientRect();
|
|
51
|
+
const hasSameSizePosition = this.hasSameSizePosition(rect, targetRect);
|
|
52
|
+
resolve(hasSameSizePosition);
|
|
53
|
+
});
|
|
54
|
+
} else {
|
|
55
|
+
const hasSameSizePosition = this.hasSameSizePosition(rect, boundingClientRect);
|
|
56
|
+
resolve(hasSameSizePosition);
|
|
57
|
+
}
|
|
41
58
|
this.staticPlaceholders.delete(staticKey);
|
|
42
59
|
this.reactValidateCallbacks.delete(staticKey);
|
|
43
60
|
}
|
|
@@ -439,7 +439,7 @@ var finishInteraction = function finishInteraction(id, data) {
|
|
|
439
439
|
clearActiveTrace();
|
|
440
440
|
callCleanUpCallbacks(data);
|
|
441
441
|
if ((_getConfig3 = getConfig()) !== null && _getConfig3 !== void 0 && (_getConfig3 = _getConfig3.vc) !== null && _getConfig3 !== void 0 && _getConfig3.stopVCAtInteractionFinish) {
|
|
442
|
-
data.vc = getVCObserver().getVCRawData(
|
|
442
|
+
data.vc = getVCObserver().getVCRawData();
|
|
443
443
|
}
|
|
444
444
|
remove(id);
|
|
445
445
|
PreviousInteractionLog.name = data.ufoName || 'unknown';
|
|
@@ -64,7 +64,7 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
64
64
|
var info = _this.abortReason.info !== '' ? " ".concat(_this.abortReason.info) : '';
|
|
65
65
|
return "".concat(_this.abortReason.reason).concat(info);
|
|
66
66
|
});
|
|
67
|
-
_defineProperty(this, "getVCRawData", function (
|
|
67
|
+
_defineProperty(this, "getVCRawData", function () {
|
|
68
68
|
_this.measureStart();
|
|
69
69
|
if (!_this.active) {
|
|
70
70
|
_this.measureStop();
|
|
@@ -73,20 +73,6 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
73
73
|
_this.stop();
|
|
74
74
|
var abortReasonInfo = _this.getAbortReasonInfo();
|
|
75
75
|
_this.measureStop();
|
|
76
|
-
var componentsLog = {};
|
|
77
|
-
if (stopTime && fg('ufo-remove-vc-component-observations-after-ttai')) {
|
|
78
|
-
Object.entries(_this.componentsLog).forEach(function (_ref3) {
|
|
79
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
|
80
|
-
_timestamp = _ref4[0],
|
|
81
|
-
value = _ref4[1];
|
|
82
|
-
var timestamp = Number(_timestamp);
|
|
83
|
-
if (stopTime > timestamp) {
|
|
84
|
-
componentsLog[timestamp] = value;
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
} else {
|
|
88
|
-
componentsLog = _objectSpread({}, _this.componentsLog);
|
|
89
|
-
}
|
|
90
76
|
return {
|
|
91
77
|
abortReasonInfo: abortReasonInfo,
|
|
92
78
|
abortReason: _objectSpread({}, _this.abortReason),
|
|
@@ -94,24 +80,24 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
94
80
|
heatmapNext: _this.heatmapNext,
|
|
95
81
|
outOfBoundaryInfo: _this.outOfBoundaryInfo,
|
|
96
82
|
totalTime: Math.round(_this.totalTime + _this.observers.getTotalTime()),
|
|
97
|
-
componentsLog: componentsLog,
|
|
83
|
+
componentsLog: _objectSpread({}, _this.componentsLog),
|
|
98
84
|
viewport: _objectSpread({}, _this.viewport),
|
|
99
85
|
oldDomUpdatesEnabled: _this.oldDomUpdatesEnabled,
|
|
100
86
|
devToolsEnabled: _this.devToolsEnabled,
|
|
101
87
|
ratios: _this.vcRatios
|
|
102
88
|
};
|
|
103
89
|
});
|
|
104
|
-
_defineProperty(this, "getVCResult", function (
|
|
105
|
-
var start =
|
|
106
|
-
stop =
|
|
107
|
-
tti =
|
|
108
|
-
prefix =
|
|
109
|
-
ssr =
|
|
110
|
-
vc =
|
|
90
|
+
_defineProperty(this, "getVCResult", function (_ref3) {
|
|
91
|
+
var start = _ref3.start,
|
|
92
|
+
stop = _ref3.stop,
|
|
93
|
+
tti = _ref3.tti,
|
|
94
|
+
prefix = _ref3.prefix,
|
|
95
|
+
ssr = _ref3.ssr,
|
|
96
|
+
vc = _ref3.vc;
|
|
111
97
|
var startTime = performance.now();
|
|
112
98
|
// add local measurement
|
|
113
99
|
var fullPrefix = prefix !== undefined && prefix !== '' ? "".concat(prefix, ":") : '';
|
|
114
|
-
var rawData = vc !== undefined ? vc : _this.getVCRawData(
|
|
100
|
+
var rawData = vc !== undefined ? vc : _this.getVCRawData();
|
|
115
101
|
if (rawData === null) {
|
|
116
102
|
return {};
|
|
117
103
|
}
|
|
@@ -159,10 +145,24 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
159
145
|
} catch (e) {
|
|
160
146
|
/* empty */
|
|
161
147
|
}
|
|
148
|
+
var _componentsLog = {};
|
|
149
|
+
if (fg('ufo-remove-vc-component-observations-after-ttai')) {
|
|
150
|
+
Object.entries(_this.componentsLog).forEach(function (_ref5) {
|
|
151
|
+
var _ref6 = _slicedToArray(_ref5, 2),
|
|
152
|
+
_timestamp = _ref6[0],
|
|
153
|
+
value = _ref6[1];
|
|
154
|
+
var timestamp = Number(_timestamp);
|
|
155
|
+
if (stop > timestamp) {
|
|
156
|
+
_componentsLog[timestamp] = value;
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
} else {
|
|
160
|
+
_componentsLog = _objectSpread({}, componentsLog);
|
|
161
|
+
}
|
|
162
162
|
var vcNext = VCObserver.calculateVC({
|
|
163
163
|
heatmap: heatmapNext,
|
|
164
164
|
ssr: ssr,
|
|
165
|
-
componentsLog:
|
|
165
|
+
componentsLog: _componentsLog,
|
|
166
166
|
viewport: viewport
|
|
167
167
|
});
|
|
168
168
|
var outOfBoundary = outOfBoundaryInfo ? _defineProperty({}, "".concat(fullPrefix, "vc:oob"), outOfBoundaryInfo) : {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
var EQUALITY_THRESHOLD = 0.1;
|
|
5
6
|
var ANCESTOR_LOOKUP_LIMIT = 10;
|
|
6
7
|
export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
|
|
@@ -28,8 +29,16 @@ export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
|
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
30
31
|
var rect = _this.staticPlaceholders.get(staticKey);
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
if (fg('platform_ufo_ssr_ttvc_use_target_rect')) {
|
|
33
|
+
requestAnimationFrame(function () {
|
|
34
|
+
var targetRect = target.getBoundingClientRect();
|
|
35
|
+
var hasSameSizePosition = _this.hasSameSizePosition(rect, targetRect);
|
|
36
|
+
_resolve(hasSameSizePosition);
|
|
37
|
+
});
|
|
38
|
+
} else {
|
|
39
|
+
var hasSameSizePosition = _this.hasSameSizePosition(rect, boundingClientRect);
|
|
40
|
+
_resolve(hasSameSizePosition);
|
|
41
|
+
}
|
|
33
42
|
_this.callbacks.delete(staticKey);
|
|
34
43
|
}
|
|
35
44
|
} else {
|
|
@@ -39,8 +48,16 @@ export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
|
|
|
39
48
|
return;
|
|
40
49
|
}
|
|
41
50
|
var _rect = _this.staticPlaceholders.get(key);
|
|
42
|
-
|
|
43
|
-
|
|
51
|
+
if (fg('platform_ufo_ssr_ttvc_use_target_rect')) {
|
|
52
|
+
requestAnimationFrame(function () {
|
|
53
|
+
var targetRect = target.getBoundingClientRect();
|
|
54
|
+
var hasSameSizePosition = _this.hasSameSizePosition(_rect, targetRect);
|
|
55
|
+
_resolve2(hasSameSizePosition);
|
|
56
|
+
});
|
|
57
|
+
} else {
|
|
58
|
+
var _hasSameSizePosition = _this.hasSameSizePosition(_rect, boundingClientRect);
|
|
59
|
+
_resolve2(_hasSameSizePosition);
|
|
60
|
+
}
|
|
44
61
|
_this.staticPlaceholders.delete(staticKey);
|
|
45
62
|
_this.reactValidateCallbacks.delete(staticKey);
|
|
46
63
|
}
|
|
@@ -48,7 +48,7 @@ export declare class VCObserver {
|
|
|
48
48
|
}): void;
|
|
49
49
|
stop(): void;
|
|
50
50
|
getAbortReasonInfo: () => string | null;
|
|
51
|
-
getVCRawData: (
|
|
51
|
+
getVCRawData: () => VCRawDataType | null;
|
|
52
52
|
getIgnoredElements(componentsLog: ComponentsLogType): {
|
|
53
53
|
targetName: string;
|
|
54
54
|
ignoreReason: VCIgnoreReason | undefined;
|
|
@@ -48,7 +48,7 @@ export declare class VCObserver {
|
|
|
48
48
|
}): void;
|
|
49
49
|
stop(): void;
|
|
50
50
|
getAbortReasonInfo: () => string | null;
|
|
51
|
-
getVCRawData: (
|
|
51
|
+
getVCRawData: () => VCRawDataType | null;
|
|
52
52
|
getIgnoredElements(componentsLog: ComponentsLogType): {
|
|
53
53
|
targetName: string;
|
|
54
54
|
ignoreReason: VCIgnoreReason | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.3",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -129,6 +129,9 @@
|
|
|
129
129
|
"platform_editor_ed-25937_ignore_mutations_for_ttvc": {
|
|
130
130
|
"type": "boolean"
|
|
131
131
|
},
|
|
132
|
+
"platform_ufo_ssr_ttvc_use_target_rect": {
|
|
133
|
+
"type": "boolean"
|
|
134
|
+
},
|
|
132
135
|
"platform-ufo-invisible-element-vc-calculations": {
|
|
133
136
|
"type": "boolean"
|
|
134
137
|
},
|