@atlaskit/react-ufo 3.10.2 → 3.10.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 +8 -0
- package/dist/cjs/create-payload/utils/get-react-ufo-payload-version.js +4 -1
- package/dist/cjs/create-post-interaction-log-payload/get-late-mutations.js +46 -0
- package/dist/cjs/create-post-interaction-log-payload/index.js +64 -29
- package/dist/cjs/create-post-interaction-log-payload/types.js +1 -0
- package/dist/cjs/vc/vc-observer/heatmap/heatmap.js +2 -2
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +2 -2
- package/dist/es2019/create-payload/utils/get-react-ufo-payload-version.js +4 -1
- package/dist/es2019/create-post-interaction-log-payload/get-late-mutations.js +28 -0
- package/dist/es2019/create-post-interaction-log-payload/index.js +57 -24
- package/dist/es2019/create-post-interaction-log-payload/types.js +0 -0
- package/dist/es2019/vc/vc-observer/heatmap/heatmap.js +2 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +2 -2
- package/dist/esm/create-payload/utils/get-react-ufo-payload-version.js +4 -1
- package/dist/esm/create-post-interaction-log-payload/get-late-mutations.js +40 -0
- package/dist/esm/create-post-interaction-log-payload/index.js +64 -29
- package/dist/esm/create-post-interaction-log-payload/types.js +0 -0
- package/dist/esm/vc/vc-observer/heatmap/heatmap.js +2 -2
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +2 -2
- package/dist/types/create-payload/utils/get-react-ufo-payload-version.d.ts +1 -1
- package/dist/types/create-post-interaction-log-payload/get-late-mutations.d.ts +5 -0
- package/dist/types/create-post-interaction-log-payload/index.d.ts +2 -5
- package/dist/types/create-post-interaction-log-payload/types.d.ts +5 -0
- package/dist/types-ts4.5/create-payload/utils/get-react-ufo-payload-version.d.ts +1 -1
- package/dist/types-ts4.5/create-post-interaction-log-payload/get-late-mutations.d.ts +5 -0
- package/dist/types-ts4.5/create-post-interaction-log-payload/index.d.ts +2 -5
- package/dist/types-ts4.5/create-post-interaction-log-payload/types.d.ts +5 -0
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 3.10.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#148578](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/148578)
|
|
8
|
+
[`d0ee548642b3e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d0ee548642b3e) -
|
|
9
|
+
Use `ufo:vc:rev` for late mutations post interaction log
|
|
10
|
+
|
|
3
11
|
## 3.10.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -4,7 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getReactUFOPayloadVersion = getReactUFOPayloadVersion;
|
|
7
|
-
function getReactUFOPayloadVersion(interactionType) {
|
|
7
|
+
function getReactUFOPayloadVersion(interactionType, isPostInteractionLog) {
|
|
8
|
+
if (isPostInteractionLog) {
|
|
9
|
+
return '1.0.1';
|
|
10
|
+
}
|
|
8
11
|
if (interactionType !== 'page_load' && interactionType !== 'transition') {
|
|
9
12
|
return '1.0.1';
|
|
10
13
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
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; } } }; }
|
|
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; } }
|
|
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; }
|
|
10
|
+
function getLateMutations(vcDetails, lastInteractionFinish, postInteractionFinishVCRatios) {
|
|
11
|
+
// Map to track which elements are already seen for each timestamp
|
|
12
|
+
var seen = new Map();
|
|
13
|
+
var result = [];
|
|
14
|
+
for (var part in vcDetails) {
|
|
15
|
+
var details = vcDetails[part];
|
|
16
|
+
if (!(details !== null && details !== void 0 && details.t) || details.t <= lastInteractionFinish.end || !details.e) {
|
|
17
|
+
continue; // Skip if not late or no elements
|
|
18
|
+
}
|
|
19
|
+
if (!seen.has(details.t)) {
|
|
20
|
+
seen.set(details.t, new Set());
|
|
21
|
+
}
|
|
22
|
+
var seenElements = seen.get(details.t);
|
|
23
|
+
var _iterator = _createForOfIteratorHelper(details.e),
|
|
24
|
+
_step;
|
|
25
|
+
try {
|
|
26
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
27
|
+
var element = _step.value;
|
|
28
|
+
if (seenElements.has(element)) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
seenElements.add(element);
|
|
32
|
+
result.push({
|
|
33
|
+
time: details.t,
|
|
34
|
+
element: element,
|
|
35
|
+
viewportHeatmapPercentage: postInteractionFinishVCRatios[element] || 0
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
} catch (err) {
|
|
39
|
+
_iterator.e(err);
|
|
40
|
+
} finally {
|
|
41
|
+
_iterator.f();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
var _default = exports.default = getLateMutations;
|
|
@@ -7,11 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
11
|
var _coinflip = _interopRequireDefault(require("../coinflip"));
|
|
11
12
|
var _config = require("../config");
|
|
12
13
|
var _utils = require("../create-payload/common/utils");
|
|
13
14
|
var _getReactUfoPayloadVersion = require("../create-payload/utils/get-react-ufo-payload-version");
|
|
14
15
|
var _hiddenTiming = require("../hidden-timing");
|
|
16
|
+
var _getLateMutations = _interopRequireDefault(require("./get-late-mutations"));
|
|
15
17
|
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; }
|
|
16
18
|
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) { (0, _defineProperty2.default)(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; }
|
|
17
19
|
function getParentStack(labelStack) {
|
|
@@ -141,39 +143,72 @@ function createPostInteractionLogPayload(_ref2) {
|
|
|
141
143
|
var lastInteractionFinishTTAI = Math.round(lastInteractionFinish.end - lastInteractionFinish.start);
|
|
142
144
|
var lastInteractionFinishVC90 = null;
|
|
143
145
|
var lastInteractionFinishVCClean = false;
|
|
144
|
-
if (
|
|
145
|
-
var
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
if ((0, _platformFeatureFlags.fg)('platform_ufo_post_interaction_use_vc_rev')) {
|
|
147
|
+
var lastInteractionFinishVCRev = lastInteractionFinishVCResult === null || lastInteractionFinishVCResult === void 0 ? void 0 : lastInteractionFinishVCResult['ufo:vc:rev'];
|
|
148
|
+
var lastInteractionFinishRevision = lastInteractionFinishVCRev === null || lastInteractionFinishVCRev === void 0 ? void 0 : lastInteractionFinishVCRev.find(function (_ref3) {
|
|
149
|
+
var revision = _ref3.revision;
|
|
150
|
+
return revision === 'fy25.02';
|
|
151
|
+
});
|
|
152
|
+
if (lastInteractionFinishRevision !== null && lastInteractionFinishRevision !== void 0 && lastInteractionFinishRevision.clean) {
|
|
153
|
+
var _lastInteractionFinis;
|
|
154
|
+
lastInteractionFinishVCClean = true;
|
|
155
|
+
lastInteractionFinishVC90 = (_lastInteractionFinis = lastInteractionFinishRevision['metric:vc90']) !== null && _lastInteractionFinis !== void 0 ? _lastInteractionFinis : null;
|
|
156
|
+
}
|
|
157
|
+
} else {
|
|
158
|
+
if (lastInteractionFinishVCResult !== null && lastInteractionFinishVCResult !== void 0 && lastInteractionFinishVCResult['ufo:vc:state']) {
|
|
159
|
+
var _lastInteractionFinis2;
|
|
160
|
+
lastInteractionFinishVCClean = true;
|
|
161
|
+
var lastInteractionFinishVCMetrics = lastInteractionFinishVCResult === null || lastInteractionFinishVCResult === void 0 ? void 0 : lastInteractionFinishVCResult['metrics:vc'];
|
|
162
|
+
lastInteractionFinishVC90 = (_lastInteractionFinis2 = lastInteractionFinishVCMetrics[90]) !== null && _lastInteractionFinis2 !== void 0 ? _lastInteractionFinis2 : null;
|
|
163
|
+
}
|
|
149
164
|
}
|
|
150
165
|
var postInteractionFinishVCRatios = {};
|
|
151
|
-
var revisedVC90 = null;
|
|
152
|
-
var postInteractionFinishVCUpdates = [];
|
|
153
166
|
var postInteractionFinishVCClean = false;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
var
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
167
|
+
var revisedVC90 = null;
|
|
168
|
+
var lateMutations = [];
|
|
169
|
+
if ((0, _platformFeatureFlags.fg)('platform_ufo_post_interaction_use_vc_rev')) {
|
|
170
|
+
var postInteractionFinishVCRev = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['ufo:vc:rev'];
|
|
171
|
+
var postInteractionFinishRevision = postInteractionFinishVCRev === null || postInteractionFinishVCRev === void 0 ? void 0 : postInteractionFinishVCRev.find(function (_ref4) {
|
|
172
|
+
var revision = _ref4.revision;
|
|
173
|
+
return revision === 'fy25.02';
|
|
174
|
+
});
|
|
175
|
+
if (postInteractionFinishRevision !== null && postInteractionFinishRevision !== void 0 && postInteractionFinishRevision.clean) {
|
|
176
|
+
postInteractionFinishVCClean = true;
|
|
177
|
+
postInteractionFinishVCRatios = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['ufo:vc:ratios'];
|
|
178
|
+
if (typeof lastInteractionFinishVC90 === 'number') {
|
|
179
|
+
var _postInteractionFinis;
|
|
180
|
+
revisedVC90 = (_postInteractionFinis = postInteractionFinishRevision['metric:vc90']) !== null && _postInteractionFinis !== void 0 ? _postInteractionFinis : null;
|
|
181
|
+
}
|
|
182
|
+
var vcDetails = postInteractionFinishRevision.vcDetails;
|
|
183
|
+
if (vcDetails) {
|
|
184
|
+
lateMutations = (0, _getLateMutations.default)(vcDetails, lastInteractionFinish, postInteractionFinishVCRatios);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
} else {
|
|
188
|
+
if (postInteractionFinishVCResult !== null && postInteractionFinishVCResult !== void 0 && postInteractionFinishVCResult['ufo:vc:state']) {
|
|
189
|
+
postInteractionFinishVCClean = true;
|
|
190
|
+
postInteractionFinishVCRatios = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['ufo:vc:ratios'];
|
|
191
|
+
var postInteractionFinishVCUpdates = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['ufo:vc:updates'];
|
|
192
|
+
var postInteractionFinishVCMetrics = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['metrics:vc'];
|
|
193
|
+
if (typeof lastInteractionFinishVC90 === 'number') {
|
|
194
|
+
var _postInteractionFinis2;
|
|
195
|
+
revisedVC90 = (_postInteractionFinis2 = postInteractionFinishVCMetrics[90]) !== null && _postInteractionFinis2 !== void 0 ? _postInteractionFinis2 : null;
|
|
196
|
+
}
|
|
197
|
+
lateMutations = postInteractionFinishVCUpdates ? postInteractionFinishVCUpdates.filter(function (entry) {
|
|
198
|
+
return entry.time > lastInteractionFinish.end;
|
|
199
|
+
}).flatMap(function (_ref5) {
|
|
200
|
+
var time = _ref5.time,
|
|
201
|
+
elements = _ref5.elements;
|
|
202
|
+
return Array.from(new Set(elements)).map(function (element) {
|
|
203
|
+
return {
|
|
204
|
+
time: time,
|
|
205
|
+
element: element,
|
|
206
|
+
viewportHeatmapPercentage: postInteractionFinishVCRatios[element]
|
|
207
|
+
};
|
|
208
|
+
});
|
|
209
|
+
}) : [];
|
|
162
210
|
}
|
|
163
211
|
}
|
|
164
|
-
var lateMutations = postInteractionFinishVCUpdates ? postInteractionFinishVCUpdates.filter(function (entry) {
|
|
165
|
-
return entry.time > lastInteractionFinish.end;
|
|
166
|
-
}).flatMap(function (_ref3) {
|
|
167
|
-
var time = _ref3.time,
|
|
168
|
-
elements = _ref3.elements;
|
|
169
|
-
return Array.from(new Set(elements)).map(function (element) {
|
|
170
|
-
return {
|
|
171
|
-
time: time,
|
|
172
|
-
element: element,
|
|
173
|
-
viewportHeatmapPercentage: postInteractionFinishVCRatios[element]
|
|
174
|
-
};
|
|
175
|
-
});
|
|
176
|
-
}) : [];
|
|
177
212
|
return {
|
|
178
213
|
actionSubject: 'experience',
|
|
179
214
|
action: 'measured',
|
|
@@ -188,7 +223,7 @@ function createPostInteractionLogPayload(_ref2) {
|
|
|
188
223
|
'event:schema': '1.0.0',
|
|
189
224
|
'event:source': {
|
|
190
225
|
name: 'react-ufo/web',
|
|
191
|
-
version: (0, _getReactUfoPayloadVersion.getReactUFOPayloadVersion)(lastInteractionFinish.type)
|
|
226
|
+
version: (0, _getReactUfoPayloadVersion.getReactUFOPayloadVersion)(lastInteractionFinish.type, true) // always 1.0.1 as `reactProfileTimings` has `labelStack` as an array
|
|
192
227
|
},
|
|
193
228
|
'event:region': config.region || 'unknown',
|
|
194
229
|
'experience:key': 'custom.post-interaction-logs',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -127,9 +127,9 @@ var MultiRevisionHeatmap = exports.MultiRevisionHeatmap = /*#__PURE__*/function
|
|
|
127
127
|
});
|
|
128
128
|
return {
|
|
129
129
|
revision: rev.name,
|
|
130
|
-
vcDetails: vcDetails,
|
|
131
130
|
clean: args.clean,
|
|
132
|
-
'metric:vc90': args.clean && !args.isEventAborted && pageVisibilityUpToTTAI === 'visible' ? vcDetails === null || vcDetails === void 0 || (_vcDetails$ = vcDetails['90']) === null || _vcDetails$ === void 0 ? void 0 : _vcDetails$.t : null
|
|
131
|
+
'metric:vc90': args.clean && !args.isEventAborted && pageVisibilityUpToTTAI === 'visible' ? vcDetails === null || vcDetails === void 0 || (_vcDetails$ = vcDetails['90']) === null || _vcDetails$ === void 0 ? void 0 : _vcDetails$.t : null,
|
|
132
|
+
vcDetails: vcDetails
|
|
133
133
|
};
|
|
134
134
|
});
|
|
135
135
|
return payload;
|
|
@@ -78,9 +78,9 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
78
78
|
vcDetails = _context.sent;
|
|
79
79
|
return _context.abrupt("return", {
|
|
80
80
|
revision: this.revisionNo,
|
|
81
|
-
vcDetails: vcDetails !== null && vcDetails !== void 0 ? vcDetails : undefined,
|
|
82
81
|
clean: true,
|
|
83
|
-
'metric:vc90': (_vcDetails$90$t = vcDetails === null || vcDetails === void 0 || (_vcDetails$ = vcDetails['90']) === null || _vcDetails$ === void 0 ? void 0 : _vcDetails$.t) !== null && _vcDetails$90$t !== void 0 ? _vcDetails$90$t : null
|
|
82
|
+
'metric:vc90': (_vcDetails$90$t = vcDetails === null || vcDetails === void 0 || (_vcDetails$ = vcDetails['90']) === null || _vcDetails$ === void 0 ? void 0 : _vcDetails$.t) !== null && _vcDetails$90$t !== void 0 ? _vcDetails$90$t : null,
|
|
83
|
+
vcDetails: vcDetails !== null && vcDetails !== void 0 ? vcDetails : undefined
|
|
84
84
|
});
|
|
85
85
|
case 15:
|
|
86
86
|
case "end":
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export function getReactUFOPayloadVersion(interactionType) {
|
|
1
|
+
export function getReactUFOPayloadVersion(interactionType, isPostInteractionLog) {
|
|
2
|
+
if (isPostInteractionLog) {
|
|
3
|
+
return '1.0.1';
|
|
4
|
+
}
|
|
2
5
|
if (interactionType !== 'page_load' && interactionType !== 'transition') {
|
|
3
6
|
return '1.0.1';
|
|
4
7
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function getLateMutations(vcDetails, lastInteractionFinish, postInteractionFinishVCRatios) {
|
|
2
|
+
// Map to track which elements are already seen for each timestamp
|
|
3
|
+
const seen = new Map();
|
|
4
|
+
const result = [];
|
|
5
|
+
for (const part in vcDetails) {
|
|
6
|
+
const details = vcDetails[part];
|
|
7
|
+
if (!(details !== null && details !== void 0 && details.t) || details.t <= lastInteractionFinish.end || !details.e) {
|
|
8
|
+
continue; // Skip if not late or no elements
|
|
9
|
+
}
|
|
10
|
+
if (!seen.has(details.t)) {
|
|
11
|
+
seen.set(details.t, new Set());
|
|
12
|
+
}
|
|
13
|
+
const seenElements = seen.get(details.t);
|
|
14
|
+
for (const element of details.e) {
|
|
15
|
+
if (seenElements.has(element)) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
seenElements.add(element);
|
|
19
|
+
result.push({
|
|
20
|
+
time: details.t,
|
|
21
|
+
element,
|
|
22
|
+
viewportHeatmapPercentage: postInteractionFinishVCRatios[element] || 0
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
export default getLateMutations;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
import coinflip from '../coinflip';
|
|
2
3
|
import { getConfig, getPostInteractionRate } from '../config';
|
|
3
4
|
import { isSegmentLabel, sanitizeUfoName } from '../create-payload/common/utils';
|
|
4
5
|
import { getReactUFOPayloadVersion } from '../create-payload/utils/get-react-ufo-payload-version';
|
|
5
6
|
import { getPageVisibilityState } from '../hidden-timing';
|
|
7
|
+
import getLateMutations from './get-late-mutations';
|
|
6
8
|
function getParentStack(labelStack) {
|
|
7
9
|
if (!labelStack || labelStack.length <= 1) {
|
|
8
10
|
return null;
|
|
@@ -126,34 +128,65 @@ function createPostInteractionLogPayload({
|
|
|
126
128
|
const lastInteractionFinishTTAI = Math.round(lastInteractionFinish.end - lastInteractionFinish.start);
|
|
127
129
|
let lastInteractionFinishVC90 = null;
|
|
128
130
|
let lastInteractionFinishVCClean = false;
|
|
129
|
-
if (
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
if (fg('platform_ufo_post_interaction_use_vc_rev')) {
|
|
132
|
+
const lastInteractionFinishVCRev = lastInteractionFinishVCResult === null || lastInteractionFinishVCResult === void 0 ? void 0 : lastInteractionFinishVCResult['ufo:vc:rev'];
|
|
133
|
+
const lastInteractionFinishRevision = lastInteractionFinishVCRev === null || lastInteractionFinishVCRev === void 0 ? void 0 : lastInteractionFinishVCRev.find(({
|
|
134
|
+
revision
|
|
135
|
+
}) => revision === 'fy25.02');
|
|
136
|
+
if (lastInteractionFinishRevision !== null && lastInteractionFinishRevision !== void 0 && lastInteractionFinishRevision.clean) {
|
|
137
|
+
var _lastInteractionFinis;
|
|
138
|
+
lastInteractionFinishVCClean = true;
|
|
139
|
+
lastInteractionFinishVC90 = (_lastInteractionFinis = lastInteractionFinishRevision['metric:vc90']) !== null && _lastInteractionFinis !== void 0 ? _lastInteractionFinis : null;
|
|
140
|
+
}
|
|
141
|
+
} else {
|
|
142
|
+
if (lastInteractionFinishVCResult !== null && lastInteractionFinishVCResult !== void 0 && lastInteractionFinishVCResult['ufo:vc:state']) {
|
|
143
|
+
var _lastInteractionFinis2;
|
|
144
|
+
lastInteractionFinishVCClean = true;
|
|
145
|
+
const lastInteractionFinishVCMetrics = lastInteractionFinishVCResult === null || lastInteractionFinishVCResult === void 0 ? void 0 : lastInteractionFinishVCResult['metrics:vc'];
|
|
146
|
+
lastInteractionFinishVC90 = (_lastInteractionFinis2 = lastInteractionFinishVCMetrics[90]) !== null && _lastInteractionFinis2 !== void 0 ? _lastInteractionFinis2 : null;
|
|
147
|
+
}
|
|
134
148
|
}
|
|
135
149
|
let postInteractionFinishVCRatios = {};
|
|
136
|
-
let revisedVC90 = null;
|
|
137
|
-
let postInteractionFinishVCUpdates = [];
|
|
138
150
|
let postInteractionFinishVCClean = false;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
151
|
+
let revisedVC90 = null;
|
|
152
|
+
let lateMutations = [];
|
|
153
|
+
if (fg('platform_ufo_post_interaction_use_vc_rev')) {
|
|
154
|
+
const postInteractionFinishVCRev = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['ufo:vc:rev'];
|
|
155
|
+
const postInteractionFinishRevision = postInteractionFinishVCRev === null || postInteractionFinishVCRev === void 0 ? void 0 : postInteractionFinishVCRev.find(({
|
|
156
|
+
revision
|
|
157
|
+
}) => revision === 'fy25.02');
|
|
158
|
+
if (postInteractionFinishRevision !== null && postInteractionFinishRevision !== void 0 && postInteractionFinishRevision.clean) {
|
|
159
|
+
postInteractionFinishVCClean = true;
|
|
160
|
+
postInteractionFinishVCRatios = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['ufo:vc:ratios'];
|
|
161
|
+
if (typeof lastInteractionFinishVC90 === 'number') {
|
|
162
|
+
var _postInteractionFinis;
|
|
163
|
+
revisedVC90 = (_postInteractionFinis = postInteractionFinishRevision['metric:vc90']) !== null && _postInteractionFinis !== void 0 ? _postInteractionFinis : null;
|
|
164
|
+
}
|
|
165
|
+
const vcDetails = postInteractionFinishRevision.vcDetails;
|
|
166
|
+
if (vcDetails) {
|
|
167
|
+
lateMutations = getLateMutations(vcDetails, lastInteractionFinish, postInteractionFinishVCRatios);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
} else {
|
|
171
|
+
if (postInteractionFinishVCResult !== null && postInteractionFinishVCResult !== void 0 && postInteractionFinishVCResult['ufo:vc:state']) {
|
|
172
|
+
postInteractionFinishVCClean = true;
|
|
173
|
+
postInteractionFinishVCRatios = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['ufo:vc:ratios'];
|
|
174
|
+
const postInteractionFinishVCUpdates = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['ufo:vc:updates'];
|
|
175
|
+
const postInteractionFinishVCMetrics = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['metrics:vc'];
|
|
176
|
+
if (typeof lastInteractionFinishVC90 === 'number') {
|
|
177
|
+
var _postInteractionFinis2;
|
|
178
|
+
revisedVC90 = (_postInteractionFinis2 = postInteractionFinishVCMetrics[90]) !== null && _postInteractionFinis2 !== void 0 ? _postInteractionFinis2 : null;
|
|
179
|
+
}
|
|
180
|
+
lateMutations = postInteractionFinishVCUpdates ? postInteractionFinishVCUpdates.filter(entry => entry.time > lastInteractionFinish.end).flatMap(({
|
|
181
|
+
time,
|
|
182
|
+
elements
|
|
183
|
+
}) => Array.from(new Set(elements)).map(element => ({
|
|
184
|
+
time,
|
|
185
|
+
element,
|
|
186
|
+
viewportHeatmapPercentage: postInteractionFinishVCRatios[element]
|
|
187
|
+
}))) : [];
|
|
147
188
|
}
|
|
148
189
|
}
|
|
149
|
-
const lateMutations = postInteractionFinishVCUpdates ? postInteractionFinishVCUpdates.filter(entry => entry.time > lastInteractionFinish.end).flatMap(({
|
|
150
|
-
time,
|
|
151
|
-
elements
|
|
152
|
-
}) => Array.from(new Set(elements)).map(element => ({
|
|
153
|
-
time,
|
|
154
|
-
element,
|
|
155
|
-
viewportHeatmapPercentage: postInteractionFinishVCRatios[element]
|
|
156
|
-
}))) : [];
|
|
157
190
|
return {
|
|
158
191
|
actionSubject: 'experience',
|
|
159
192
|
action: 'measured',
|
|
@@ -168,7 +201,7 @@ function createPostInteractionLogPayload({
|
|
|
168
201
|
'event:schema': '1.0.0',
|
|
169
202
|
'event:source': {
|
|
170
203
|
name: 'react-ufo/web',
|
|
171
|
-
version: getReactUFOPayloadVersion(lastInteractionFinish.type)
|
|
204
|
+
version: getReactUFOPayloadVersion(lastInteractionFinish.type, true) // always 1.0.1 as `reactProfileTimings` has `labelStack` as an array
|
|
172
205
|
},
|
|
173
206
|
'event:region': config.region || 'unknown',
|
|
174
207
|
'experience:key': 'custom.post-interaction-logs',
|
|
File without changes
|
|
@@ -111,9 +111,9 @@ export class MultiRevisionHeatmap {
|
|
|
111
111
|
});
|
|
112
112
|
return {
|
|
113
113
|
revision: rev.name,
|
|
114
|
-
vcDetails,
|
|
115
114
|
clean: args.clean,
|
|
116
|
-
'metric:vc90': args.clean && !args.isEventAborted && pageVisibilityUpToTTAI === 'visible' ? vcDetails === null || vcDetails === void 0 ? void 0 : (_vcDetails$ = vcDetails['90']) === null || _vcDetails$ === void 0 ? void 0 : _vcDetails$.t : null
|
|
115
|
+
'metric:vc90': args.clean && !args.isEventAborted && pageVisibilityUpToTTAI === 'visible' ? vcDetails === null || vcDetails === void 0 ? void 0 : (_vcDetails$ = vcDetails['90']) === null || _vcDetails$ === void 0 ? void 0 : _vcDetails$.t : null,
|
|
116
|
+
vcDetails
|
|
117
117
|
};
|
|
118
118
|
});
|
|
119
119
|
return payload;
|
|
@@ -50,9 +50,9 @@ export default class AbstractVCCalculatorBase {
|
|
|
50
50
|
});
|
|
51
51
|
return {
|
|
52
52
|
revision: this.revisionNo,
|
|
53
|
-
vcDetails: vcDetails !== null && vcDetails !== void 0 ? vcDetails : undefined,
|
|
54
53
|
clean: true,
|
|
55
|
-
'metric:vc90': (_vcDetails$90$t = vcDetails === null || vcDetails === void 0 ? void 0 : (_vcDetails$ = vcDetails['90']) === null || _vcDetails$ === void 0 ? void 0 : _vcDetails$.t) !== null && _vcDetails$90$t !== void 0 ? _vcDetails$90$t : null
|
|
54
|
+
'metric:vc90': (_vcDetails$90$t = vcDetails === null || vcDetails === void 0 ? void 0 : (_vcDetails$ = vcDetails['90']) === null || _vcDetails$ === void 0 ? void 0 : _vcDetails$.t) !== null && _vcDetails$90$t !== void 0 ? _vcDetails$90$t : null,
|
|
55
|
+
vcDetails: vcDetails !== null && vcDetails !== void 0 ? vcDetails : undefined
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export function getReactUFOPayloadVersion(interactionType) {
|
|
1
|
+
export function getReactUFOPayloadVersion(interactionType, isPostInteractionLog) {
|
|
2
|
+
if (isPostInteractionLog) {
|
|
3
|
+
return '1.0.1';
|
|
4
|
+
}
|
|
2
5
|
if (interactionType !== 'page_load' && interactionType !== 'transition') {
|
|
3
6
|
return '1.0.1';
|
|
4
7
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
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
|
+
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
|
+
function getLateMutations(vcDetails, lastInteractionFinish, postInteractionFinishVCRatios) {
|
|
5
|
+
// Map to track which elements are already seen for each timestamp
|
|
6
|
+
var seen = new Map();
|
|
7
|
+
var result = [];
|
|
8
|
+
for (var part in vcDetails) {
|
|
9
|
+
var details = vcDetails[part];
|
|
10
|
+
if (!(details !== null && details !== void 0 && details.t) || details.t <= lastInteractionFinish.end || !details.e) {
|
|
11
|
+
continue; // Skip if not late or no elements
|
|
12
|
+
}
|
|
13
|
+
if (!seen.has(details.t)) {
|
|
14
|
+
seen.set(details.t, new Set());
|
|
15
|
+
}
|
|
16
|
+
var seenElements = seen.get(details.t);
|
|
17
|
+
var _iterator = _createForOfIteratorHelper(details.e),
|
|
18
|
+
_step;
|
|
19
|
+
try {
|
|
20
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
21
|
+
var element = _step.value;
|
|
22
|
+
if (seenElements.has(element)) {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
seenElements.add(element);
|
|
26
|
+
result.push({
|
|
27
|
+
time: details.t,
|
|
28
|
+
element: element,
|
|
29
|
+
viewportHeatmapPercentage: postInteractionFinishVCRatios[element] || 0
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
} catch (err) {
|
|
33
|
+
_iterator.e(err);
|
|
34
|
+
} finally {
|
|
35
|
+
_iterator.f();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
export default getLateMutations;
|
|
@@ -2,11 +2,13 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
3
|
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; }
|
|
4
4
|
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; }
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import coinflip from '../coinflip';
|
|
6
7
|
import { getConfig, getPostInteractionRate } from '../config';
|
|
7
8
|
import { isSegmentLabel, sanitizeUfoName } from '../create-payload/common/utils';
|
|
8
9
|
import { getReactUFOPayloadVersion } from '../create-payload/utils/get-react-ufo-payload-version';
|
|
9
10
|
import { getPageVisibilityState } from '../hidden-timing';
|
|
11
|
+
import getLateMutations from './get-late-mutations';
|
|
10
12
|
function getParentStack(labelStack) {
|
|
11
13
|
if (!labelStack || labelStack.length <= 1) {
|
|
12
14
|
return null;
|
|
@@ -134,39 +136,72 @@ function createPostInteractionLogPayload(_ref2) {
|
|
|
134
136
|
var lastInteractionFinishTTAI = Math.round(lastInteractionFinish.end - lastInteractionFinish.start);
|
|
135
137
|
var lastInteractionFinishVC90 = null;
|
|
136
138
|
var lastInteractionFinishVCClean = false;
|
|
137
|
-
if (
|
|
138
|
-
var
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
if (fg('platform_ufo_post_interaction_use_vc_rev')) {
|
|
140
|
+
var lastInteractionFinishVCRev = lastInteractionFinishVCResult === null || lastInteractionFinishVCResult === void 0 ? void 0 : lastInteractionFinishVCResult['ufo:vc:rev'];
|
|
141
|
+
var lastInteractionFinishRevision = lastInteractionFinishVCRev === null || lastInteractionFinishVCRev === void 0 ? void 0 : lastInteractionFinishVCRev.find(function (_ref3) {
|
|
142
|
+
var revision = _ref3.revision;
|
|
143
|
+
return revision === 'fy25.02';
|
|
144
|
+
});
|
|
145
|
+
if (lastInteractionFinishRevision !== null && lastInteractionFinishRevision !== void 0 && lastInteractionFinishRevision.clean) {
|
|
146
|
+
var _lastInteractionFinis;
|
|
147
|
+
lastInteractionFinishVCClean = true;
|
|
148
|
+
lastInteractionFinishVC90 = (_lastInteractionFinis = lastInteractionFinishRevision['metric:vc90']) !== null && _lastInteractionFinis !== void 0 ? _lastInteractionFinis : null;
|
|
149
|
+
}
|
|
150
|
+
} else {
|
|
151
|
+
if (lastInteractionFinishVCResult !== null && lastInteractionFinishVCResult !== void 0 && lastInteractionFinishVCResult['ufo:vc:state']) {
|
|
152
|
+
var _lastInteractionFinis2;
|
|
153
|
+
lastInteractionFinishVCClean = true;
|
|
154
|
+
var lastInteractionFinishVCMetrics = lastInteractionFinishVCResult === null || lastInteractionFinishVCResult === void 0 ? void 0 : lastInteractionFinishVCResult['metrics:vc'];
|
|
155
|
+
lastInteractionFinishVC90 = (_lastInteractionFinis2 = lastInteractionFinishVCMetrics[90]) !== null && _lastInteractionFinis2 !== void 0 ? _lastInteractionFinis2 : null;
|
|
156
|
+
}
|
|
142
157
|
}
|
|
143
158
|
var postInteractionFinishVCRatios = {};
|
|
144
|
-
var revisedVC90 = null;
|
|
145
|
-
var postInteractionFinishVCUpdates = [];
|
|
146
159
|
var postInteractionFinishVCClean = false;
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
var
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
160
|
+
var revisedVC90 = null;
|
|
161
|
+
var lateMutations = [];
|
|
162
|
+
if (fg('platform_ufo_post_interaction_use_vc_rev')) {
|
|
163
|
+
var postInteractionFinishVCRev = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['ufo:vc:rev'];
|
|
164
|
+
var postInteractionFinishRevision = postInteractionFinishVCRev === null || postInteractionFinishVCRev === void 0 ? void 0 : postInteractionFinishVCRev.find(function (_ref4) {
|
|
165
|
+
var revision = _ref4.revision;
|
|
166
|
+
return revision === 'fy25.02';
|
|
167
|
+
});
|
|
168
|
+
if (postInteractionFinishRevision !== null && postInteractionFinishRevision !== void 0 && postInteractionFinishRevision.clean) {
|
|
169
|
+
postInteractionFinishVCClean = true;
|
|
170
|
+
postInteractionFinishVCRatios = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['ufo:vc:ratios'];
|
|
171
|
+
if (typeof lastInteractionFinishVC90 === 'number') {
|
|
172
|
+
var _postInteractionFinis;
|
|
173
|
+
revisedVC90 = (_postInteractionFinis = postInteractionFinishRevision['metric:vc90']) !== null && _postInteractionFinis !== void 0 ? _postInteractionFinis : null;
|
|
174
|
+
}
|
|
175
|
+
var vcDetails = postInteractionFinishRevision.vcDetails;
|
|
176
|
+
if (vcDetails) {
|
|
177
|
+
lateMutations = getLateMutations(vcDetails, lastInteractionFinish, postInteractionFinishVCRatios);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
} else {
|
|
181
|
+
if (postInteractionFinishVCResult !== null && postInteractionFinishVCResult !== void 0 && postInteractionFinishVCResult['ufo:vc:state']) {
|
|
182
|
+
postInteractionFinishVCClean = true;
|
|
183
|
+
postInteractionFinishVCRatios = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['ufo:vc:ratios'];
|
|
184
|
+
var postInteractionFinishVCUpdates = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['ufo:vc:updates'];
|
|
185
|
+
var postInteractionFinishVCMetrics = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['metrics:vc'];
|
|
186
|
+
if (typeof lastInteractionFinishVC90 === 'number') {
|
|
187
|
+
var _postInteractionFinis2;
|
|
188
|
+
revisedVC90 = (_postInteractionFinis2 = postInteractionFinishVCMetrics[90]) !== null && _postInteractionFinis2 !== void 0 ? _postInteractionFinis2 : null;
|
|
189
|
+
}
|
|
190
|
+
lateMutations = postInteractionFinishVCUpdates ? postInteractionFinishVCUpdates.filter(function (entry) {
|
|
191
|
+
return entry.time > lastInteractionFinish.end;
|
|
192
|
+
}).flatMap(function (_ref5) {
|
|
193
|
+
var time = _ref5.time,
|
|
194
|
+
elements = _ref5.elements;
|
|
195
|
+
return Array.from(new Set(elements)).map(function (element) {
|
|
196
|
+
return {
|
|
197
|
+
time: time,
|
|
198
|
+
element: element,
|
|
199
|
+
viewportHeatmapPercentage: postInteractionFinishVCRatios[element]
|
|
200
|
+
};
|
|
201
|
+
});
|
|
202
|
+
}) : [];
|
|
155
203
|
}
|
|
156
204
|
}
|
|
157
|
-
var lateMutations = postInteractionFinishVCUpdates ? postInteractionFinishVCUpdates.filter(function (entry) {
|
|
158
|
-
return entry.time > lastInteractionFinish.end;
|
|
159
|
-
}).flatMap(function (_ref3) {
|
|
160
|
-
var time = _ref3.time,
|
|
161
|
-
elements = _ref3.elements;
|
|
162
|
-
return Array.from(new Set(elements)).map(function (element) {
|
|
163
|
-
return {
|
|
164
|
-
time: time,
|
|
165
|
-
element: element,
|
|
166
|
-
viewportHeatmapPercentage: postInteractionFinishVCRatios[element]
|
|
167
|
-
};
|
|
168
|
-
});
|
|
169
|
-
}) : [];
|
|
170
205
|
return {
|
|
171
206
|
actionSubject: 'experience',
|
|
172
207
|
action: 'measured',
|
|
@@ -181,7 +216,7 @@ function createPostInteractionLogPayload(_ref2) {
|
|
|
181
216
|
'event:schema': '1.0.0',
|
|
182
217
|
'event:source': {
|
|
183
218
|
name: 'react-ufo/web',
|
|
184
|
-
version: getReactUFOPayloadVersion(lastInteractionFinish.type)
|
|
219
|
+
version: getReactUFOPayloadVersion(lastInteractionFinish.type, true) // always 1.0.1 as `reactProfileTimings` has `labelStack` as an array
|
|
185
220
|
},
|
|
186
221
|
'event:region': config.region || 'unknown',
|
|
187
222
|
'experience:key': 'custom.post-interaction-logs',
|
|
File without changes
|
|
@@ -120,9 +120,9 @@ export var MultiRevisionHeatmap = /*#__PURE__*/function () {
|
|
|
120
120
|
});
|
|
121
121
|
return {
|
|
122
122
|
revision: rev.name,
|
|
123
|
-
vcDetails: vcDetails,
|
|
124
123
|
clean: args.clean,
|
|
125
|
-
'metric:vc90': args.clean && !args.isEventAborted && pageVisibilityUpToTTAI === 'visible' ? vcDetails === null || vcDetails === void 0 || (_vcDetails$ = vcDetails['90']) === null || _vcDetails$ === void 0 ? void 0 : _vcDetails$.t : null
|
|
124
|
+
'metric:vc90': args.clean && !args.isEventAborted && pageVisibilityUpToTTAI === 'visible' ? vcDetails === null || vcDetails === void 0 || (_vcDetails$ = vcDetails['90']) === null || _vcDetails$ === void 0 ? void 0 : _vcDetails$.t : null,
|
|
125
|
+
vcDetails: vcDetails
|
|
126
126
|
};
|
|
127
127
|
});
|
|
128
128
|
return payload;
|
|
@@ -71,9 +71,9 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
71
71
|
vcDetails = _context.sent;
|
|
72
72
|
return _context.abrupt("return", {
|
|
73
73
|
revision: this.revisionNo,
|
|
74
|
-
vcDetails: vcDetails !== null && vcDetails !== void 0 ? vcDetails : undefined,
|
|
75
74
|
clean: true,
|
|
76
|
-
'metric:vc90': (_vcDetails$90$t = vcDetails === null || vcDetails === void 0 || (_vcDetails$ = vcDetails['90']) === null || _vcDetails$ === void 0 ? void 0 : _vcDetails$.t) !== null && _vcDetails$90$t !== void 0 ? _vcDetails$90$t : null
|
|
75
|
+
'metric:vc90': (_vcDetails$90$t = vcDetails === null || vcDetails === void 0 || (_vcDetails$ = vcDetails['90']) === null || _vcDetails$ === void 0 ? void 0 : _vcDetails$.t) !== null && _vcDetails$90$t !== void 0 ? _vcDetails$90$t : null,
|
|
76
|
+
vcDetails: vcDetails !== null && vcDetails !== void 0 ? vcDetails : undefined
|
|
77
77
|
});
|
|
78
78
|
case 15:
|
|
79
79
|
case "end":
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { InteractionType } from '../../interaction-metrics';
|
|
2
|
-
export declare function getReactUFOPayloadVersion(interactionType: InteractionType): "1.0.1" | "2.0.0";
|
|
2
|
+
export declare function getReactUFOPayloadVersion(interactionType: InteractionType, isPostInteractionLog?: boolean): "1.0.1" | "2.0.0";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { LastInteractionFinishInfo } from '../common';
|
|
2
|
+
import { RevisionPayloadVCDetails } from '../common/vc/types';
|
|
3
|
+
import { LateMutation } from './types';
|
|
4
|
+
declare function getLateMutations(vcDetails: RevisionPayloadVCDetails, lastInteractionFinish: LastInteractionFinishInfo, postInteractionFinishVCRatios: Record<string, number>): LateMutation[];
|
|
5
|
+
export default getLateMutations;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type PostInteractionLogOutput } from '../common';
|
|
2
|
+
import { LateMutation } from './types';
|
|
2
3
|
declare function createPostInteractionLogPayload({ lastInteractionFinish, reactProfilerTimings, lastInteractionFinishVCResult, postInteractionFinishVCResult, }: PostInteractionLogOutput): {
|
|
3
4
|
actionSubject: string;
|
|
4
5
|
action: string;
|
|
@@ -36,11 +37,7 @@ declare function createPostInteractionLogPayload({ lastInteractionFinish, reactP
|
|
|
36
37
|
revisedTtai: number;
|
|
37
38
|
revisedVC90: number | null;
|
|
38
39
|
vcClean: boolean;
|
|
39
|
-
lateMutations:
|
|
40
|
-
time: number;
|
|
41
|
-
element: string;
|
|
42
|
-
viewportHeatmapPercentage: number;
|
|
43
|
-
}[];
|
|
40
|
+
lateMutations: LateMutation[];
|
|
44
41
|
reactProfilerTimings: any[];
|
|
45
42
|
};
|
|
46
43
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { InteractionType } from '../../interaction-metrics';
|
|
2
|
-
export declare function getReactUFOPayloadVersion(interactionType: InteractionType): "1.0.1" | "2.0.0";
|
|
2
|
+
export declare function getReactUFOPayloadVersion(interactionType: InteractionType, isPostInteractionLog?: boolean): "1.0.1" | "2.0.0";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { LastInteractionFinishInfo } from '../common';
|
|
2
|
+
import { RevisionPayloadVCDetails } from '../common/vc/types';
|
|
3
|
+
import { LateMutation } from './types';
|
|
4
|
+
declare function getLateMutations(vcDetails: RevisionPayloadVCDetails, lastInteractionFinish: LastInteractionFinishInfo, postInteractionFinishVCRatios: Record<string, number>): LateMutation[];
|
|
5
|
+
export default getLateMutations;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type PostInteractionLogOutput } from '../common';
|
|
2
|
+
import { LateMutation } from './types';
|
|
2
3
|
declare function createPostInteractionLogPayload({ lastInteractionFinish, reactProfilerTimings, lastInteractionFinishVCResult, postInteractionFinishVCResult, }: PostInteractionLogOutput): {
|
|
3
4
|
actionSubject: string;
|
|
4
5
|
action: string;
|
|
@@ -36,11 +37,7 @@ declare function createPostInteractionLogPayload({ lastInteractionFinish, reactP
|
|
|
36
37
|
revisedTtai: number;
|
|
37
38
|
revisedVC90: number | null;
|
|
38
39
|
vcClean: boolean;
|
|
39
|
-
lateMutations:
|
|
40
|
-
time: number;
|
|
41
|
-
element: string;
|
|
42
|
-
viewportHeatmapPercentage: number;
|
|
43
|
-
}[];
|
|
40
|
+
lateMutations: LateMutation[];
|
|
44
41
|
reactProfilerTimings: any[];
|
|
45
42
|
};
|
|
46
43
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.3",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -156,6 +156,9 @@
|
|
|
156
156
|
},
|
|
157
157
|
"platform_ufo_enable_events_observer": {
|
|
158
158
|
"type": "boolean"
|
|
159
|
+
},
|
|
160
|
+
"platform_ufo_post_interaction_use_vc_rev": {
|
|
161
|
+
"type": "boolean"
|
|
159
162
|
}
|
|
160
163
|
}
|
|
161
164
|
}
|