@atlaskit/react-ufo 3.13.14 → 3.13.16
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/interaction-id-context/index.js +2 -7
- package/dist/cjs/load-hold/UFOLoadHold.js +6 -13
- package/dist/cjs/vc/vc-observer/index.js +1 -2
- package/dist/cjs/vc/vc-observer-new/index.js +1 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +35 -84
- package/dist/es2019/interaction-id-context/index.js +2 -7
- package/dist/es2019/load-hold/UFOLoadHold.js +6 -13
- package/dist/es2019/vc/vc-observer/index.js +1 -2
- package/dist/es2019/vc/vc-observer-new/index.js +1 -3
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +3 -19
- package/dist/esm/interaction-id-context/index.js +2 -7
- package/dist/esm/load-hold/UFOLoadHold.js +6 -13
- package/dist/esm/vc/vc-observer/index.js +1 -2
- package/dist/esm/vc/vc-observer-new/index.js +1 -3
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +36 -85
- package/dist/types/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +0 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +0 -1
- package/package.json +1 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 3.13.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#164300](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/164300)
|
|
8
|
+
[`cd25a7f650fa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cd25a7f650fa4) -
|
|
9
|
+
AFO-3919 cleanup platform_ufo_hold_cross_interaction
|
|
10
|
+
|
|
11
|
+
## 3.13.15
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#164015](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/164015)
|
|
16
|
+
[`80c4ba68b4085`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/80c4ba68b4085) -
|
|
17
|
+
AFO-3362 cleanup platform_ufo_ttvc_v3_devtool fg
|
|
18
|
+
- [#164070](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/164070)
|
|
19
|
+
[`a5066408a954b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a5066408a954b) -
|
|
20
|
+
AFO-3913 clean up platform_ufo_v3_add_start_entry
|
|
21
|
+
|
|
3
22
|
## 3.13.14
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -9,7 +9,6 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _react = require("react");
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
12
|
// Same structure as react's useRef.
|
|
14
13
|
// This allows modals to use a ref to scope their value
|
|
15
14
|
// const id = useRef(null);
|
|
@@ -34,8 +33,8 @@ var ObservableInteractionID = /*#__PURE__*/function () {
|
|
|
34
33
|
var oldId = this._current;
|
|
35
34
|
this._current = newId;
|
|
36
35
|
|
|
37
|
-
// Notify all listeners if the ID actually changed
|
|
38
|
-
if (oldId !== newId
|
|
36
|
+
// Notify all listeners if the ID actually changed
|
|
37
|
+
if (oldId !== newId) {
|
|
39
38
|
listeners.forEach(function (listener) {
|
|
40
39
|
return listener(newId);
|
|
41
40
|
});
|
|
@@ -63,10 +62,6 @@ var DefaultInteractionID = exports.DefaultInteractionID = initializeGlobalDefaul
|
|
|
63
62
|
|
|
64
63
|
// Subscription functions
|
|
65
64
|
var subscribeToInteractionIdChanges = exports.subscribeToInteractionIdChanges = function subscribeToInteractionIdChanges(listener) {
|
|
66
|
-
if (!(0, _platformFeatureFlags.fg)('platform_ufo_hold_cross_interaction')) {
|
|
67
|
-
// Return a no-op unsubscribe function when feature flag is disabled
|
|
68
|
-
return function () {};
|
|
69
|
-
}
|
|
70
65
|
listeners.add(listener);
|
|
71
66
|
return function () {
|
|
72
67
|
listeners.delete(listener);
|
|
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = UFOLoadHold;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var _interactionContext = _interopRequireDefault(require("../interaction-context"));
|
|
13
12
|
var _interactionIdContext = _interopRequireWildcard(require("../interaction-id-context"));
|
|
14
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -16,7 +15,7 @@ var useLayoutEffectSAFE = typeof window === 'undefined' ? _react.useEffect : _re
|
|
|
16
15
|
|
|
17
16
|
/**
|
|
18
17
|
* Custom hook to track changes to the interaction ID.
|
|
19
|
-
* Uses a subscription system
|
|
18
|
+
* Uses a subscription system to automatically update when the interaction ID changes.
|
|
20
19
|
*/
|
|
21
20
|
function useInteractionIdValue() {
|
|
22
21
|
var interactionId = (0, _react.useContext)(_interactionIdContext.default);
|
|
@@ -25,17 +24,11 @@ function useInteractionIdValue() {
|
|
|
25
24
|
currentId = _useState2[0],
|
|
26
25
|
setCurrentId = _useState2[1];
|
|
27
26
|
useLayoutEffectSAFE(function () {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
setCurrentId(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
});
|
|
34
|
-
return unsubscribe;
|
|
35
|
-
} else {
|
|
36
|
-
// Legacy behavior - just return the current value without subscription
|
|
37
|
-
setCurrentId((interactionId === null || interactionId === void 0 ? void 0 : interactionId.current) || null);
|
|
38
|
-
}
|
|
27
|
+
setCurrentId((interactionId === null || interactionId === void 0 ? void 0 : interactionId.current) || null);
|
|
28
|
+
var unsubscribe = (0, _interactionIdContext.subscribeToInteractionIdChanges)(function (newId) {
|
|
29
|
+
setCurrentId(newId);
|
|
30
|
+
});
|
|
31
|
+
return unsubscribe;
|
|
39
32
|
}, [interactionId]);
|
|
40
33
|
return currentId;
|
|
41
34
|
}
|
|
@@ -13,7 +13,6 @@ 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");
|
|
17
16
|
var _config = require("../../config");
|
|
18
17
|
var _interactionMetrics = require("../../interaction-metrics");
|
|
19
18
|
var _attachAbortListeners = require("./attachAbortListeners");
|
|
@@ -274,7 +273,7 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
274
273
|
}));
|
|
275
274
|
|
|
276
275
|
// Add devtool callback for both v1 and v2
|
|
277
|
-
if (typeof window.__ufo_devtool_onVCRevisionReady__ === 'function'
|
|
276
|
+
if (typeof window.__ufo_devtool_onVCRevisionReady__ === 'function') {
|
|
278
277
|
// Handle v1 if not disabled
|
|
279
278
|
if (!isTTVCv1Disabled) {
|
|
280
279
|
(_ufo_devtool_onVCRev = (_ref8 = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev === void 0 || _ufo_devtool_onVCRev.call(_ref8, (0, _getVCRevisionDebugDetails.getVCRevisionDebugDetails)({
|
|
@@ -128,9 +128,7 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
128
128
|
case 0:
|
|
129
129
|
start = param.start, stop = param.stop, interactionId = param.interactionId;
|
|
130
130
|
results = [];
|
|
131
|
-
|
|
132
|
-
this.addStartEntry(start);
|
|
133
|
-
}
|
|
131
|
+
this.addStartEntry(start);
|
|
134
132
|
calculator_fy25_03 = new _fy25_.default();
|
|
135
133
|
orderedEntries = this.entriesTimeline.getOrderedEntries({
|
|
136
134
|
start: start,
|
|
@@ -77,51 +77,16 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
77
77
|
return ratios;
|
|
78
78
|
}
|
|
79
79
|
}, {
|
|
80
|
-
key: "
|
|
80
|
+
key: "calculateWithDebugInfo",
|
|
81
81
|
value: function () {
|
|
82
|
-
var
|
|
83
|
-
var percentiles, viewportEntries, vcLogs;
|
|
82
|
+
var _calculateWithDebugInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason) {
|
|
83
|
+
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator3, _step3, _entry2, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, _ufo_devtool_onVCRev, _ref;
|
|
84
84
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
85
85
|
while (1) switch (_context.prev = _context.next) {
|
|
86
86
|
case 0:
|
|
87
87
|
percentiles = [25, 50, 75, 80, 85, 90, 95, 98, 99];
|
|
88
88
|
viewportEntries = this.filterViewportEntries(filteredEntries);
|
|
89
89
|
_context.next = 4;
|
|
90
|
-
return (0, _percentileCalc.calculateTTVCPercentiles)({
|
|
91
|
-
viewport: {
|
|
92
|
-
width: (0, _getViewportWidth.default)(),
|
|
93
|
-
height: (0, _getViewportHeight.default)()
|
|
94
|
-
},
|
|
95
|
-
startTime: startTime,
|
|
96
|
-
stopTime: stopTime,
|
|
97
|
-
orderedEntries: viewportEntries,
|
|
98
|
-
percentiles: percentiles
|
|
99
|
-
});
|
|
100
|
-
case 4:
|
|
101
|
-
vcLogs = _context.sent;
|
|
102
|
-
return _context.abrupt("return", vcLogs);
|
|
103
|
-
case 6:
|
|
104
|
-
case "end":
|
|
105
|
-
return _context.stop();
|
|
106
|
-
}
|
|
107
|
-
}, _callee, this);
|
|
108
|
-
}));
|
|
109
|
-
function calculateBasic(_x, _x2, _x3) {
|
|
110
|
-
return _calculateBasic.apply(this, arguments);
|
|
111
|
-
}
|
|
112
|
-
return calculateBasic;
|
|
113
|
-
}()
|
|
114
|
-
}, {
|
|
115
|
-
key: "calculateWithDebugInfo",
|
|
116
|
-
value: function () {
|
|
117
|
-
var _calculateWithDebugInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason) {
|
|
118
|
-
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator3, _step3, _entry2, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, _ufo_devtool_onVCRev, _ref;
|
|
119
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
120
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
121
|
-
case 0:
|
|
122
|
-
percentiles = [25, 50, 75, 80, 85, 90, 95, 98, 99];
|
|
123
|
-
viewportEntries = this.filterViewportEntries(filteredEntries);
|
|
124
|
-
_context2.next = 4;
|
|
125
90
|
return (0, _percentileCalc.calculateTTVCPercentilesWithDebugInfo)({
|
|
126
91
|
viewport: {
|
|
127
92
|
width: (0, _getViewportWidth.default)(),
|
|
@@ -132,29 +97,29 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
132
97
|
orderedEntries: viewportEntries
|
|
133
98
|
});
|
|
134
99
|
case 4:
|
|
135
|
-
vcLogs =
|
|
100
|
+
vcLogs = _context.sent;
|
|
136
101
|
vcDetails = {};
|
|
137
102
|
percentileIndex = 0;
|
|
138
103
|
entryDataBuffer = new Set();
|
|
139
104
|
if (!vcLogs) {
|
|
140
|
-
|
|
105
|
+
_context.next = 28;
|
|
141
106
|
break;
|
|
142
107
|
}
|
|
143
108
|
_iterator3 = _createForOfIteratorHelper(vcLogs);
|
|
144
|
-
|
|
109
|
+
_context.prev = 10;
|
|
145
110
|
_iterator3.s();
|
|
146
111
|
case 12:
|
|
147
112
|
if ((_step3 = _iterator3.n()).done) {
|
|
148
|
-
|
|
113
|
+
_context.next = 20;
|
|
149
114
|
break;
|
|
150
115
|
}
|
|
151
116
|
_entry2 = _step3.value;
|
|
152
117
|
time = _entry2.time, viewportPercentage = _entry2.viewportPercentage, entries = _entry2.entries; // Only process entries if we haven't reached all percentiles
|
|
153
118
|
if (!(percentileIndex >= percentiles.length)) {
|
|
154
|
-
|
|
119
|
+
_context.next = 17;
|
|
155
120
|
break;
|
|
156
121
|
}
|
|
157
|
-
return
|
|
122
|
+
return _context.abrupt("break", 20);
|
|
158
123
|
case 17:
|
|
159
124
|
// Check if this entry matches any checkpoint percentiles
|
|
160
125
|
if (viewportPercentage >= percentiles[percentileIndex]) {
|
|
@@ -178,19 +143,19 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
178
143
|
});
|
|
179
144
|
}
|
|
180
145
|
case 18:
|
|
181
|
-
|
|
146
|
+
_context.next = 12;
|
|
182
147
|
break;
|
|
183
148
|
case 20:
|
|
184
|
-
|
|
149
|
+
_context.next = 25;
|
|
185
150
|
break;
|
|
186
151
|
case 22:
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
_iterator3.e(
|
|
152
|
+
_context.prev = 22;
|
|
153
|
+
_context.t0 = _context["catch"](10);
|
|
154
|
+
_iterator3.e(_context.t0);
|
|
190
155
|
case 25:
|
|
191
|
-
|
|
156
|
+
_context.prev = 25;
|
|
192
157
|
_iterator3.f();
|
|
193
|
-
return
|
|
158
|
+
return _context.finish(25);
|
|
194
159
|
case 28:
|
|
195
160
|
// Fill in any missing percentiles with the last known values
|
|
196
161
|
previousResult = {
|
|
@@ -207,7 +172,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
207
172
|
}
|
|
208
173
|
|
|
209
174
|
// Handle devtool callback
|
|
210
|
-
if (!isPostInteraction && typeof window !== 'undefined' && typeof window.__ufo_devtool_onVCRevisionReady__ === 'function'
|
|
175
|
+
if (!isPostInteraction && typeof window !== 'undefined' && typeof window.__ufo_devtool_onVCRevisionReady__ === 'function') {
|
|
211
176
|
try {
|
|
212
177
|
(_ufo_devtool_onVCRev = (_ref = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev === void 0 || _ufo_devtool_onVCRev.call(_ref, {
|
|
213
178
|
revision: this.revisionNo,
|
|
@@ -222,14 +187,14 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
222
187
|
console.error('Error in onVCRevisionReady', e);
|
|
223
188
|
}
|
|
224
189
|
}
|
|
225
|
-
return
|
|
190
|
+
return _context.abrupt("return", vcDetails);
|
|
226
191
|
case 32:
|
|
227
192
|
case "end":
|
|
228
|
-
return
|
|
193
|
+
return _context.stop();
|
|
229
194
|
}
|
|
230
|
-
},
|
|
195
|
+
}, _callee, this, [[10, 22, 25, 28]]);
|
|
231
196
|
}));
|
|
232
|
-
function calculateWithDebugInfo(
|
|
197
|
+
function calculateWithDebugInfo(_x, _x2, _x3, _x4, _x5, _x6, _x7) {
|
|
233
198
|
return _calculateWithDebugInfo.apply(this, arguments);
|
|
234
199
|
}
|
|
235
200
|
return calculateWithDebugInfo;
|
|
@@ -237,13 +202,13 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
237
202
|
}, {
|
|
238
203
|
key: "calculate",
|
|
239
204
|
value: function () {
|
|
240
|
-
var _calculate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
205
|
+
var _calculate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref2) {
|
|
241
206
|
var _this = this,
|
|
242
207
|
_vcDetails$90$t,
|
|
243
208
|
_vcDetails$;
|
|
244
|
-
var startTime, stopTime, orderedEntries, interactionId, isPostInteraction, filteredEntries, isVCClean, dirtyReason, getVCCleanStatusResult,
|
|
245
|
-
return _regenerator.default.wrap(function
|
|
246
|
-
while (1) switch (
|
|
209
|
+
var startTime, stopTime, orderedEntries, interactionId, isPostInteraction, filteredEntries, isVCClean, dirtyReason, getVCCleanStatusResult, vcDetails, result;
|
|
210
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
211
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
247
212
|
case 0:
|
|
248
213
|
startTime = _ref2.startTime, stopTime = _ref2.stopTime, orderedEntries = _ref2.orderedEntries, interactionId = _ref2.interactionId, isPostInteraction = _ref2.isPostInteraction;
|
|
249
214
|
filteredEntries = orderedEntries.filter(function (entry) {
|
|
@@ -253,34 +218,20 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
253
218
|
isVCClean = getVCCleanStatusResult.isVCClean;
|
|
254
219
|
dirtyReason = getVCCleanStatusResult.dirtyReason;
|
|
255
220
|
if (isVCClean) {
|
|
256
|
-
|
|
221
|
+
_context2.next = 7;
|
|
257
222
|
break;
|
|
258
223
|
}
|
|
259
|
-
return
|
|
224
|
+
return _context2.abrupt("return", {
|
|
260
225
|
revision: this.revisionNo,
|
|
261
226
|
'metric:vc90': null,
|
|
262
227
|
clean: false,
|
|
263
228
|
abortReason: dirtyReason
|
|
264
229
|
});
|
|
265
230
|
case 7:
|
|
266
|
-
|
|
267
|
-
if (!useDebugInfo) {
|
|
268
|
-
_context3.next = 14;
|
|
269
|
-
break;
|
|
270
|
-
}
|
|
271
|
-
_context3.next = 11;
|
|
231
|
+
_context2.next = 9;
|
|
272
232
|
return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason);
|
|
273
|
-
case
|
|
274
|
-
|
|
275
|
-
_context3.next = 17;
|
|
276
|
-
break;
|
|
277
|
-
case 14:
|
|
278
|
-
_context3.next = 16;
|
|
279
|
-
return this.calculateBasic(filteredEntries, startTime, stopTime);
|
|
280
|
-
case 16:
|
|
281
|
-
_context3.t0 = _context3.sent;
|
|
282
|
-
case 17:
|
|
283
|
-
vcDetails = _context3.t0;
|
|
233
|
+
case 9:
|
|
234
|
+
vcDetails = _context2.sent;
|
|
284
235
|
result = {
|
|
285
236
|
revision: this.revisionNo,
|
|
286
237
|
clean: true,
|
|
@@ -290,14 +241,14 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
290
241
|
if ((0, _platformFeatureFlags.fg)('platform_ufo_rev_ratios')) {
|
|
291
242
|
result.ratios = this.calculateRatios(filteredEntries);
|
|
292
243
|
}
|
|
293
|
-
return
|
|
294
|
-
case
|
|
244
|
+
return _context2.abrupt("return", result);
|
|
245
|
+
case 13:
|
|
295
246
|
case "end":
|
|
296
|
-
return
|
|
247
|
+
return _context2.stop();
|
|
297
248
|
}
|
|
298
|
-
},
|
|
249
|
+
}, _callee2, this);
|
|
299
250
|
}));
|
|
300
|
-
function calculate(
|
|
251
|
+
function calculate(_x8) {
|
|
301
252
|
return _calculate.apply(this, arguments);
|
|
302
253
|
}
|
|
303
254
|
return calculate;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { createContext } from 'react';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
|
|
5
4
|
// Same structure as react's useRef.
|
|
6
5
|
// This allows modals to use a ref to scope their value
|
|
@@ -23,8 +22,8 @@ class ObservableInteractionID {
|
|
|
23
22
|
const oldId = this._current;
|
|
24
23
|
this._current = newId;
|
|
25
24
|
|
|
26
|
-
// Notify all listeners if the ID actually changed
|
|
27
|
-
if (oldId !== newId
|
|
25
|
+
// Notify all listeners if the ID actually changed
|
|
26
|
+
if (oldId !== newId) {
|
|
28
27
|
listeners.forEach(listener => listener(newId));
|
|
29
28
|
}
|
|
30
29
|
}
|
|
@@ -52,10 +51,6 @@ export const DefaultInteractionID = initializeGlobalDefaultInteractionID();
|
|
|
52
51
|
|
|
53
52
|
// Subscription functions
|
|
54
53
|
export const subscribeToInteractionIdChanges = listener => {
|
|
55
|
-
if (!fg('platform_ufo_hold_cross_interaction')) {
|
|
56
|
-
// Return a no-op unsubscribe function when feature flag is disabled
|
|
57
|
-
return () => {};
|
|
58
|
-
}
|
|
59
54
|
listeners.add(listener);
|
|
60
55
|
return () => {
|
|
61
56
|
listeners.delete(listener);
|
|
@@ -1,28 +1,21 @@
|
|
|
1
1
|
import React, { useContext, useEffect, useLayoutEffect, useState } from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import UFOInteractionContext from '../interaction-context';
|
|
4
3
|
import UFOInteractionIDContext, { subscribeToInteractionIdChanges } from '../interaction-id-context';
|
|
5
4
|
const useLayoutEffectSAFE = typeof window === 'undefined' ? useEffect : useLayoutEffect;
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* Custom hook to track changes to the interaction ID.
|
|
9
|
-
* Uses a subscription system
|
|
8
|
+
* Uses a subscription system to automatically update when the interaction ID changes.
|
|
10
9
|
*/
|
|
11
10
|
function useInteractionIdValue() {
|
|
12
11
|
const interactionId = useContext(UFOInteractionIDContext);
|
|
13
12
|
const [currentId, setCurrentId] = useState((interactionId === null || interactionId === void 0 ? void 0 : interactionId.current) || null);
|
|
14
13
|
useLayoutEffectSAFE(() => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
setCurrentId(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
21
|
-
return unsubscribe;
|
|
22
|
-
} else {
|
|
23
|
-
// Legacy behavior - just return the current value without subscription
|
|
24
|
-
setCurrentId((interactionId === null || interactionId === void 0 ? void 0 : interactionId.current) || null);
|
|
25
|
-
}
|
|
14
|
+
setCurrentId((interactionId === null || interactionId === void 0 ? void 0 : interactionId.current) || null);
|
|
15
|
+
const unsubscribe = subscribeToInteractionIdChanges(newId => {
|
|
16
|
+
setCurrentId(newId);
|
|
17
|
+
});
|
|
18
|
+
return unsubscribe;
|
|
26
19
|
}, [interactionId]);
|
|
27
20
|
return currentId;
|
|
28
21
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { isVCRevisionEnabled } from '../../config';
|
|
4
3
|
import { getActiveInteraction } from '../../interaction-metrics';
|
|
5
4
|
import { attachAbortListeners } from './attachAbortListeners';
|
|
@@ -284,7 +283,7 @@ export class VCObserver {
|
|
|
284
283
|
}));
|
|
285
284
|
|
|
286
285
|
// Add devtool callback for both v1 and v2
|
|
287
|
-
if (typeof window.__ufo_devtool_onVCRevisionReady__ === 'function'
|
|
286
|
+
if (typeof window.__ufo_devtool_onVCRevisionReady__ === 'function') {
|
|
288
287
|
var _ufo_devtool_onVCRev2, _ref2;
|
|
289
288
|
// Handle v1 if not disabled
|
|
290
289
|
if (!isTTVCv1Disabled) {
|
|
@@ -103,9 +103,7 @@ export default class VCObserverNew {
|
|
|
103
103
|
interactionId
|
|
104
104
|
} = param;
|
|
105
105
|
const results = [];
|
|
106
|
-
|
|
107
|
-
this.addStartEntry(start);
|
|
108
|
-
}
|
|
106
|
+
this.addStartEntry(start);
|
|
109
107
|
const calculator_fy25_03 = new VCCalculator_FY25_03();
|
|
110
108
|
const orderedEntries = this.entriesTimeline.getOrderedEntries({
|
|
111
109
|
start,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
-
import {
|
|
2
|
+
import { calculateTTVCPercentilesWithDebugInfo } from './percentile-calc';
|
|
3
3
|
import getViewportHeight from './utils/get-viewport-height';
|
|
4
4
|
import getViewportWidth from './utils/get-viewport-width';
|
|
5
5
|
export default class AbstractVCCalculatorBase {
|
|
@@ -36,21 +36,6 @@ export default class AbstractVCCalculatorBase {
|
|
|
36
36
|
}
|
|
37
37
|
return ratios;
|
|
38
38
|
}
|
|
39
|
-
async calculateBasic(filteredEntries, startTime, stopTime) {
|
|
40
|
-
const percentiles = [25, 50, 75, 80, 85, 90, 95, 98, 99];
|
|
41
|
-
const viewportEntries = this.filterViewportEntries(filteredEntries);
|
|
42
|
-
const vcLogs = await calculateTTVCPercentiles({
|
|
43
|
-
viewport: {
|
|
44
|
-
width: getViewportWidth(),
|
|
45
|
-
height: getViewportHeight()
|
|
46
|
-
},
|
|
47
|
-
startTime,
|
|
48
|
-
stopTime,
|
|
49
|
-
orderedEntries: viewportEntries,
|
|
50
|
-
percentiles
|
|
51
|
-
});
|
|
52
|
-
return vcLogs;
|
|
53
|
-
}
|
|
54
39
|
async calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason) {
|
|
55
40
|
const percentiles = [25, 50, 75, 80, 85, 90, 95, 98, 99];
|
|
56
41
|
const viewportEntries = this.filterViewportEntries(filteredEntries);
|
|
@@ -116,7 +101,7 @@ export default class AbstractVCCalculatorBase {
|
|
|
116
101
|
}
|
|
117
102
|
|
|
118
103
|
// Handle devtool callback
|
|
119
|
-
if (!isPostInteraction && typeof window !== 'undefined' && typeof window.__ufo_devtool_onVCRevisionReady__ === 'function'
|
|
104
|
+
if (!isPostInteraction && typeof window !== 'undefined' && typeof window.__ufo_devtool_onVCRevisionReady__ === 'function') {
|
|
120
105
|
try {
|
|
121
106
|
var _ufo_devtool_onVCRev, _ref;
|
|
122
107
|
(_ufo_devtool_onVCRev = (_ref = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev === void 0 ? void 0 : _ufo_devtool_onVCRev.call(_ref, {
|
|
@@ -158,8 +143,7 @@ export default class AbstractVCCalculatorBase {
|
|
|
158
143
|
abortReason: dirtyReason
|
|
159
144
|
};
|
|
160
145
|
}
|
|
161
|
-
const
|
|
162
|
-
const vcDetails = useDebugInfo ? await this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason) : await this.calculateBasic(filteredEntries, startTime, stopTime);
|
|
146
|
+
const vcDetails = await this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason);
|
|
163
147
|
const result = {
|
|
164
148
|
revision: this.revisionNo,
|
|
165
149
|
clean: true,
|
|
@@ -2,7 +2,6 @@ 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
4
|
import { createContext } from 'react';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
|
|
7
6
|
// Same structure as react's useRef.
|
|
8
7
|
// This allows modals to use a ref to scope their value
|
|
@@ -28,8 +27,8 @@ var ObservableInteractionID = /*#__PURE__*/function () {
|
|
|
28
27
|
var oldId = this._current;
|
|
29
28
|
this._current = newId;
|
|
30
29
|
|
|
31
|
-
// Notify all listeners if the ID actually changed
|
|
32
|
-
if (oldId !== newId
|
|
30
|
+
// Notify all listeners if the ID actually changed
|
|
31
|
+
if (oldId !== newId) {
|
|
33
32
|
listeners.forEach(function (listener) {
|
|
34
33
|
return listener(newId);
|
|
35
34
|
});
|
|
@@ -57,10 +56,6 @@ export var DefaultInteractionID = initializeGlobalDefaultInteractionID();
|
|
|
57
56
|
|
|
58
57
|
// Subscription functions
|
|
59
58
|
export var subscribeToInteractionIdChanges = function subscribeToInteractionIdChanges(listener) {
|
|
60
|
-
if (!fg('platform_ufo_hold_cross_interaction')) {
|
|
61
|
-
// Return a no-op unsubscribe function when feature flag is disabled
|
|
62
|
-
return function () {};
|
|
63
|
-
}
|
|
64
59
|
listeners.add(listener);
|
|
65
60
|
return function () {
|
|
66
61
|
listeners.delete(listener);
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import React, { useContext, useEffect, useLayoutEffect, useState } from 'react';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import UFOInteractionContext from '../interaction-context';
|
|
5
4
|
import UFOInteractionIDContext, { subscribeToInteractionIdChanges } from '../interaction-id-context';
|
|
6
5
|
var useLayoutEffectSAFE = typeof window === 'undefined' ? useEffect : useLayoutEffect;
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* Custom hook to track changes to the interaction ID.
|
|
10
|
-
* Uses a subscription system
|
|
9
|
+
* Uses a subscription system to automatically update when the interaction ID changes.
|
|
11
10
|
*/
|
|
12
11
|
function useInteractionIdValue() {
|
|
13
12
|
var interactionId = useContext(UFOInteractionIDContext);
|
|
@@ -16,17 +15,11 @@ function useInteractionIdValue() {
|
|
|
16
15
|
currentId = _useState2[0],
|
|
17
16
|
setCurrentId = _useState2[1];
|
|
18
17
|
useLayoutEffectSAFE(function () {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
setCurrentId(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
return unsubscribe;
|
|
26
|
-
} else {
|
|
27
|
-
// Legacy behavior - just return the current value without subscription
|
|
28
|
-
setCurrentId((interactionId === null || interactionId === void 0 ? void 0 : interactionId.current) || null);
|
|
29
|
-
}
|
|
18
|
+
setCurrentId((interactionId === null || interactionId === void 0 ? void 0 : interactionId.current) || null);
|
|
19
|
+
var unsubscribe = subscribeToInteractionIdChanges(function (newId) {
|
|
20
|
+
setCurrentId(newId);
|
|
21
|
+
});
|
|
22
|
+
return unsubscribe;
|
|
30
23
|
}, [interactionId]);
|
|
31
24
|
return currentId;
|
|
32
25
|
}
|
|
@@ -9,7 +9,6 @@ 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';
|
|
13
12
|
import { isVCRevisionEnabled } from '../../config';
|
|
14
13
|
import { getActiveInteraction } from '../../interaction-metrics';
|
|
15
14
|
import { attachAbortListeners } from './attachAbortListeners';
|
|
@@ -267,7 +266,7 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
267
266
|
}));
|
|
268
267
|
|
|
269
268
|
// Add devtool callback for both v1 and v2
|
|
270
|
-
if (typeof window.__ufo_devtool_onVCRevisionReady__ === 'function'
|
|
269
|
+
if (typeof window.__ufo_devtool_onVCRevisionReady__ === 'function') {
|
|
271
270
|
// Handle v1 if not disabled
|
|
272
271
|
if (!isTTVCv1Disabled) {
|
|
273
272
|
(_ufo_devtool_onVCRev = (_ref8 = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev === void 0 || _ufo_devtool_onVCRev.call(_ref8, getVCRevisionDebugDetails({
|
|
@@ -121,9 +121,7 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
121
121
|
case 0:
|
|
122
122
|
start = param.start, stop = param.stop, interactionId = param.interactionId;
|
|
123
123
|
results = [];
|
|
124
|
-
|
|
125
|
-
this.addStartEntry(start);
|
|
126
|
-
}
|
|
124
|
+
this.addStartEntry(start);
|
|
127
125
|
calculator_fy25_03 = new VCCalculator_FY25_03();
|
|
128
126
|
orderedEntries = this.entriesTimeline.getOrderedEntries({
|
|
129
127
|
start: start,
|
|
@@ -7,7 +7,7 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
|
|
|
7
7
|
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; } }
|
|
8
8
|
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; }
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
-
import {
|
|
10
|
+
import { calculateTTVCPercentilesWithDebugInfo } from './percentile-calc';
|
|
11
11
|
import getViewportHeight from './utils/get-viewport-height';
|
|
12
12
|
import getViewportWidth from './utils/get-viewport-width';
|
|
13
13
|
var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
@@ -70,51 +70,16 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
70
70
|
return ratios;
|
|
71
71
|
}
|
|
72
72
|
}, {
|
|
73
|
-
key: "
|
|
73
|
+
key: "calculateWithDebugInfo",
|
|
74
74
|
value: function () {
|
|
75
|
-
var
|
|
76
|
-
var percentiles, viewportEntries, vcLogs;
|
|
75
|
+
var _calculateWithDebugInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason) {
|
|
76
|
+
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator3, _step3, _entry2, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, _ufo_devtool_onVCRev, _ref;
|
|
77
77
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
78
78
|
while (1) switch (_context.prev = _context.next) {
|
|
79
79
|
case 0:
|
|
80
80
|
percentiles = [25, 50, 75, 80, 85, 90, 95, 98, 99];
|
|
81
81
|
viewportEntries = this.filterViewportEntries(filteredEntries);
|
|
82
82
|
_context.next = 4;
|
|
83
|
-
return calculateTTVCPercentiles({
|
|
84
|
-
viewport: {
|
|
85
|
-
width: getViewportWidth(),
|
|
86
|
-
height: getViewportHeight()
|
|
87
|
-
},
|
|
88
|
-
startTime: startTime,
|
|
89
|
-
stopTime: stopTime,
|
|
90
|
-
orderedEntries: viewportEntries,
|
|
91
|
-
percentiles: percentiles
|
|
92
|
-
});
|
|
93
|
-
case 4:
|
|
94
|
-
vcLogs = _context.sent;
|
|
95
|
-
return _context.abrupt("return", vcLogs);
|
|
96
|
-
case 6:
|
|
97
|
-
case "end":
|
|
98
|
-
return _context.stop();
|
|
99
|
-
}
|
|
100
|
-
}, _callee, this);
|
|
101
|
-
}));
|
|
102
|
-
function calculateBasic(_x, _x2, _x3) {
|
|
103
|
-
return _calculateBasic.apply(this, arguments);
|
|
104
|
-
}
|
|
105
|
-
return calculateBasic;
|
|
106
|
-
}()
|
|
107
|
-
}, {
|
|
108
|
-
key: "calculateWithDebugInfo",
|
|
109
|
-
value: function () {
|
|
110
|
-
var _calculateWithDebugInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason) {
|
|
111
|
-
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator3, _step3, _entry2, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, _ufo_devtool_onVCRev, _ref;
|
|
112
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
113
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
114
|
-
case 0:
|
|
115
|
-
percentiles = [25, 50, 75, 80, 85, 90, 95, 98, 99];
|
|
116
|
-
viewportEntries = this.filterViewportEntries(filteredEntries);
|
|
117
|
-
_context2.next = 4;
|
|
118
83
|
return calculateTTVCPercentilesWithDebugInfo({
|
|
119
84
|
viewport: {
|
|
120
85
|
width: getViewportWidth(),
|
|
@@ -125,29 +90,29 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
125
90
|
orderedEntries: viewportEntries
|
|
126
91
|
});
|
|
127
92
|
case 4:
|
|
128
|
-
vcLogs =
|
|
93
|
+
vcLogs = _context.sent;
|
|
129
94
|
vcDetails = {};
|
|
130
95
|
percentileIndex = 0;
|
|
131
96
|
entryDataBuffer = new Set();
|
|
132
97
|
if (!vcLogs) {
|
|
133
|
-
|
|
98
|
+
_context.next = 28;
|
|
134
99
|
break;
|
|
135
100
|
}
|
|
136
101
|
_iterator3 = _createForOfIteratorHelper(vcLogs);
|
|
137
|
-
|
|
102
|
+
_context.prev = 10;
|
|
138
103
|
_iterator3.s();
|
|
139
104
|
case 12:
|
|
140
105
|
if ((_step3 = _iterator3.n()).done) {
|
|
141
|
-
|
|
106
|
+
_context.next = 20;
|
|
142
107
|
break;
|
|
143
108
|
}
|
|
144
109
|
_entry2 = _step3.value;
|
|
145
110
|
time = _entry2.time, viewportPercentage = _entry2.viewportPercentage, entries = _entry2.entries; // Only process entries if we haven't reached all percentiles
|
|
146
111
|
if (!(percentileIndex >= percentiles.length)) {
|
|
147
|
-
|
|
112
|
+
_context.next = 17;
|
|
148
113
|
break;
|
|
149
114
|
}
|
|
150
|
-
return
|
|
115
|
+
return _context.abrupt("break", 20);
|
|
151
116
|
case 17:
|
|
152
117
|
// Check if this entry matches any checkpoint percentiles
|
|
153
118
|
if (viewportPercentage >= percentiles[percentileIndex]) {
|
|
@@ -171,19 +136,19 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
171
136
|
});
|
|
172
137
|
}
|
|
173
138
|
case 18:
|
|
174
|
-
|
|
139
|
+
_context.next = 12;
|
|
175
140
|
break;
|
|
176
141
|
case 20:
|
|
177
|
-
|
|
142
|
+
_context.next = 25;
|
|
178
143
|
break;
|
|
179
144
|
case 22:
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
_iterator3.e(
|
|
145
|
+
_context.prev = 22;
|
|
146
|
+
_context.t0 = _context["catch"](10);
|
|
147
|
+
_iterator3.e(_context.t0);
|
|
183
148
|
case 25:
|
|
184
|
-
|
|
149
|
+
_context.prev = 25;
|
|
185
150
|
_iterator3.f();
|
|
186
|
-
return
|
|
151
|
+
return _context.finish(25);
|
|
187
152
|
case 28:
|
|
188
153
|
// Fill in any missing percentiles with the last known values
|
|
189
154
|
previousResult = {
|
|
@@ -200,7 +165,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
200
165
|
}
|
|
201
166
|
|
|
202
167
|
// Handle devtool callback
|
|
203
|
-
if (!isPostInteraction && typeof window !== 'undefined' && typeof window.__ufo_devtool_onVCRevisionReady__ === 'function'
|
|
168
|
+
if (!isPostInteraction && typeof window !== 'undefined' && typeof window.__ufo_devtool_onVCRevisionReady__ === 'function') {
|
|
204
169
|
try {
|
|
205
170
|
(_ufo_devtool_onVCRev = (_ref = window).__ufo_devtool_onVCRevisionReady__) === null || _ufo_devtool_onVCRev === void 0 || _ufo_devtool_onVCRev.call(_ref, {
|
|
206
171
|
revision: this.revisionNo,
|
|
@@ -215,14 +180,14 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
215
180
|
console.error('Error in onVCRevisionReady', e);
|
|
216
181
|
}
|
|
217
182
|
}
|
|
218
|
-
return
|
|
183
|
+
return _context.abrupt("return", vcDetails);
|
|
219
184
|
case 32:
|
|
220
185
|
case "end":
|
|
221
|
-
return
|
|
186
|
+
return _context.stop();
|
|
222
187
|
}
|
|
223
|
-
},
|
|
188
|
+
}, _callee, this, [[10, 22, 25, 28]]);
|
|
224
189
|
}));
|
|
225
|
-
function calculateWithDebugInfo(
|
|
190
|
+
function calculateWithDebugInfo(_x, _x2, _x3, _x4, _x5, _x6, _x7) {
|
|
226
191
|
return _calculateWithDebugInfo.apply(this, arguments);
|
|
227
192
|
}
|
|
228
193
|
return calculateWithDebugInfo;
|
|
@@ -230,13 +195,13 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
230
195
|
}, {
|
|
231
196
|
key: "calculate",
|
|
232
197
|
value: function () {
|
|
233
|
-
var _calculate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
198
|
+
var _calculate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
234
199
|
var _this = this,
|
|
235
200
|
_vcDetails$90$t,
|
|
236
201
|
_vcDetails$;
|
|
237
|
-
var startTime, stopTime, orderedEntries, interactionId, isPostInteraction, filteredEntries, isVCClean, dirtyReason, getVCCleanStatusResult,
|
|
238
|
-
return _regeneratorRuntime.wrap(function
|
|
239
|
-
while (1) switch (
|
|
202
|
+
var startTime, stopTime, orderedEntries, interactionId, isPostInteraction, filteredEntries, isVCClean, dirtyReason, getVCCleanStatusResult, vcDetails, result;
|
|
203
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
204
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
240
205
|
case 0:
|
|
241
206
|
startTime = _ref2.startTime, stopTime = _ref2.stopTime, orderedEntries = _ref2.orderedEntries, interactionId = _ref2.interactionId, isPostInteraction = _ref2.isPostInteraction;
|
|
242
207
|
filteredEntries = orderedEntries.filter(function (entry) {
|
|
@@ -246,34 +211,20 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
246
211
|
isVCClean = getVCCleanStatusResult.isVCClean;
|
|
247
212
|
dirtyReason = getVCCleanStatusResult.dirtyReason;
|
|
248
213
|
if (isVCClean) {
|
|
249
|
-
|
|
214
|
+
_context2.next = 7;
|
|
250
215
|
break;
|
|
251
216
|
}
|
|
252
|
-
return
|
|
217
|
+
return _context2.abrupt("return", {
|
|
253
218
|
revision: this.revisionNo,
|
|
254
219
|
'metric:vc90': null,
|
|
255
220
|
clean: false,
|
|
256
221
|
abortReason: dirtyReason
|
|
257
222
|
});
|
|
258
223
|
case 7:
|
|
259
|
-
|
|
260
|
-
if (!useDebugInfo) {
|
|
261
|
-
_context3.next = 14;
|
|
262
|
-
break;
|
|
263
|
-
}
|
|
264
|
-
_context3.next = 11;
|
|
224
|
+
_context2.next = 9;
|
|
265
225
|
return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason);
|
|
266
|
-
case
|
|
267
|
-
|
|
268
|
-
_context3.next = 17;
|
|
269
|
-
break;
|
|
270
|
-
case 14:
|
|
271
|
-
_context3.next = 16;
|
|
272
|
-
return this.calculateBasic(filteredEntries, startTime, stopTime);
|
|
273
|
-
case 16:
|
|
274
|
-
_context3.t0 = _context3.sent;
|
|
275
|
-
case 17:
|
|
276
|
-
vcDetails = _context3.t0;
|
|
226
|
+
case 9:
|
|
227
|
+
vcDetails = _context2.sent;
|
|
277
228
|
result = {
|
|
278
229
|
revision: this.revisionNo,
|
|
279
230
|
clean: true,
|
|
@@ -283,14 +234,14 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
283
234
|
if (fg('platform_ufo_rev_ratios')) {
|
|
284
235
|
result.ratios = this.calculateRatios(filteredEntries);
|
|
285
236
|
}
|
|
286
|
-
return
|
|
287
|
-
case
|
|
237
|
+
return _context2.abrupt("return", result);
|
|
238
|
+
case 13:
|
|
288
239
|
case "end":
|
|
289
|
-
return
|
|
240
|
+
return _context2.stop();
|
|
290
241
|
}
|
|
291
|
-
},
|
|
242
|
+
}, _callee2, this);
|
|
292
243
|
}));
|
|
293
|
-
function calculate(
|
|
244
|
+
function calculate(_x8) {
|
|
294
245
|
return _calculate.apply(this, arguments);
|
|
295
246
|
}
|
|
296
247
|
return calculate;
|
|
@@ -14,7 +14,6 @@ export default abstract class AbstractVCCalculatorBase implements VCCalculator {
|
|
|
14
14
|
* Calculate ratios for each element based on their viewport coverage.
|
|
15
15
|
*/
|
|
16
16
|
private calculateRatios;
|
|
17
|
-
private calculateBasic;
|
|
18
17
|
private calculateWithDebugInfo;
|
|
19
18
|
calculate({ startTime, stopTime, orderedEntries, interactionId, isPostInteraction, }: VCCalculatorParam): Promise<RevisionPayloadEntry | undefined>;
|
|
20
19
|
}
|
package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export default abstract class AbstractVCCalculatorBase implements VCCalculator {
|
|
|
14
14
|
* Calculate ratios for each element based on their viewport coverage.
|
|
15
15
|
*/
|
|
16
16
|
private calculateRatios;
|
|
17
|
-
private calculateBasic;
|
|
18
17
|
private calculateWithDebugInfo;
|
|
19
18
|
calculate({ startTime, stopTime, orderedEntries, interactionId, isPostInteraction, }: VCCalculatorParam): Promise<RevisionPayloadEntry | undefined>;
|
|
20
19
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "3.13.
|
|
3
|
+
"version": "3.13.16",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -151,21 +151,12 @@
|
|
|
151
151
|
"platform_ufo_enable_events_observer": {
|
|
152
152
|
"type": "boolean"
|
|
153
153
|
},
|
|
154
|
-
"platform_ufo_ttvc_v3_devtool": {
|
|
155
|
-
"type": "boolean"
|
|
156
|
-
},
|
|
157
154
|
"platform_ufo_filter_out_aui_attribute_changes": {
|
|
158
155
|
"type": "boolean"
|
|
159
156
|
},
|
|
160
157
|
"platform_ufo_vc_observer_new_ssr_abort_listener": {
|
|
161
158
|
"type": "boolean"
|
|
162
159
|
},
|
|
163
|
-
"platform_ufo_v3_add_start_entry": {
|
|
164
|
-
"type": "boolean"
|
|
165
|
-
},
|
|
166
|
-
"platform_ufo_hold_cross_interaction": {
|
|
167
|
-
"type": "boolean"
|
|
168
|
-
},
|
|
169
160
|
"platform_ufo_rev_ratios": {
|
|
170
161
|
"type": "boolean"
|
|
171
162
|
}
|