@atlaskit/react-ufo 4.7.1 → 4.7.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.
Files changed (27) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/create-interaction-extra-metrics-payload/index.js +21 -10
  3. package/dist/cjs/interaction-metrics/index.js +0 -31
  4. package/dist/cjs/vc/vc-observer/index.js +6 -27
  5. package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/index.js +2 -2
  6. package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +7 -10
  7. package/dist/cjs/vc/vc-observer-new/metric-calculator/fy25_03/index.js +4 -10
  8. package/dist/cjs/vc/vc-observer-new/viewport-observer/index.js +30 -48
  9. package/dist/es2019/create-interaction-extra-metrics-payload/index.js +12 -4
  10. package/dist/es2019/interaction-metrics/index.js +0 -31
  11. package/dist/es2019/vc/vc-observer/index.js +18 -42
  12. package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/index.js +2 -2
  13. package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +10 -16
  14. package/dist/es2019/vc/vc-observer-new/metric-calculator/fy25_03/index.js +2 -6
  15. package/dist/es2019/vc/vc-observer-new/viewport-observer/index.js +20 -29
  16. package/dist/esm/create-interaction-extra-metrics-payload/index.js +22 -11
  17. package/dist/esm/interaction-metrics/index.js +0 -31
  18. package/dist/esm/vc/vc-observer/index.js +6 -27
  19. package/dist/esm/vc/vc-observer/observers/ssr-placeholders/index.js +2 -2
  20. package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +7 -10
  21. package/dist/esm/vc/vc-observer-new/metric-calculator/fy25_03/index.js +4 -10
  22. package/dist/esm/vc/vc-observer-new/viewport-observer/index.js +30 -48
  23. package/dist/types/create-interaction-extra-metrics-payload/index.d.ts +1 -1
  24. package/dist/types/vc/vc-observer-new/metric-calculator/fy25_03/index.d.ts +3 -1
  25. package/dist/types-ts4.5/create-interaction-extra-metrics-payload/index.d.ts +1 -1
  26. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/fy25_03/index.d.ts +3 -1
  27. package/package.json +1 -11
@@ -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';
@@ -124,48 +123,25 @@ export class VCObserver {
124
123
  window.__vcNotAvailableReason = abortReasonInfo;
125
124
  }
126
125
  } catch (e) {}
127
- if (fg('platform_ufo_abort_timestamp_by_revision')) {
128
- const vcAbortedResultWithRevisions = {
129
- [`${fullPrefix}vc:rev`]: [{
130
- revision: 'fy25.02',
131
- clean: false,
132
- 'metric:vc90': null,
133
- abortReason: abortReason.reason,
134
- abortTimestamp: Math.round(abortReason.timestamp)
135
- }]
136
- };
137
- if (!isTTVCv1Disabled) {
138
- vcAbortedResultWithRevisions[`${fullPrefix}vc:rev`].push({
139
- revision: 'fy25.01',
140
- clean: false,
141
- 'metric:vc90': null,
142
- abortReason: abortReason.reason,
143
- abortTimestamp: Math.round(abortReason.timestamp)
144
- });
145
- }
146
- return vcAbortedResultWithRevisions;
147
- } else {
148
- const vcAbortedResultWithRevisions = {
149
- [`${fullPrefix}vc:state`]: false,
150
- [`${fullPrefix}vc:abort:reason`]: abortReason.reason,
151
- [`${fullPrefix}vc:abort:timestamp`]: abortReason.timestamp,
152
- [`${fullPrefix}vc:rev`]: [{
153
- revision: 'fy25.02',
154
- clean: false,
155
- 'metric:vc90': null,
156
- abortReason: abortReason.reason
157
- }]
158
- };
159
- if (!isTTVCv1Disabled) {
160
- vcAbortedResultWithRevisions[`${fullPrefix}vc:rev`].push({
161
- revision: 'fy25.01',
162
- clean: false,
163
- 'metric:vc90': null,
164
- abortReason: abortReason.reason
165
- });
166
- }
167
- return vcAbortedResultWithRevisions;
126
+ const vcAbortedResultWithRevisions = {
127
+ [`${fullPrefix}vc:rev`]: [{
128
+ revision: 'fy25.02',
129
+ clean: false,
130
+ 'metric:vc90': null,
131
+ abortReason: abortReason.reason,
132
+ abortTimestamp: Math.round(abortReason.timestamp)
133
+ }]
134
+ };
135
+ if (!isTTVCv1Disabled) {
136
+ vcAbortedResultWithRevisions[`${fullPrefix}vc:rev`].push({
137
+ revision: 'fy25.01',
138
+ clean: false,
139
+ 'metric:vc90': null,
140
+ abortReason: abortReason.reason,
141
+ abortTimestamp: Math.round(abortReason.timestamp)
142
+ });
168
143
  }
144
+ return vcAbortedResultWithRevisions;
169
145
  }
170
146
  const ttvcV1Result = isTTVCv1Disabled ? {
171
147
  VC: {},
@@ -185,7 +185,7 @@ export class SSRPlaceholderHandlers {
185
185
  return element;
186
186
  }
187
187
 
188
- // NOTE - for use when the FG `platform_ufo_ssr_placeholder_resolution_ttvc_v3` is disabled
188
+ // Validates placeholder match using asynchronous observation and resolves with the result
189
189
  checkIfExistedAndSizeMatching(el) {
190
190
  el = this.findNearestPlaceholderContainerIfIgnored(el);
191
191
  const id = this.getPlaceholderId(el);
@@ -201,7 +201,7 @@ export class SSRPlaceholderHandlers {
201
201
  });
202
202
  }
203
203
 
204
- // NOTE - for use when the FG `platform_ufo_ssr_placeholder_resolution_ttvc_v3` is enabled
204
+ // Validates placeholder match synchronously using stored SSR dimensions and current bounds
205
205
  checkIfExistedAndSizeMatchingV3(el) {
206
206
  el = this.findNearestPlaceholderContainerIfIgnored(el);
207
207
  const id = this.getPlaceholderId(el);
@@ -121,15 +121,13 @@ export default class AbstractVCCalculatorBase {
121
121
  }
122
122
  let enhancedVcLogs = vcLogs ? vcLogs.map(log => ({
123
123
  ...log,
124
- ...(fg('platform_ufo_serialise_ttvc_v3_debug_data') && {
125
- entries: log.entries.map(entry => {
126
- var _entry$rect, _entry$previousRect;
127
- return {
128
- ...entry,
129
- rect: (_entry$rect = entry.rect) === null || _entry$rect === void 0 ? void 0 : _entry$rect.toJSON(),
130
- previousRect: (_entry$previousRect = entry.previousRect) === null || _entry$previousRect === void 0 ? void 0 : _entry$previousRect.toJSON()
131
- };
132
- })
124
+ entries: log.entries.map(entry => {
125
+ var _entry$rect, _entry$previousRect;
126
+ return {
127
+ ...entry,
128
+ rect: (_entry$rect = entry.rect) === null || _entry$rect === void 0 ? void 0 : _entry$rect.toJSON(),
129
+ previousRect: (_entry$previousRect = entry.previousRect) === null || _entry$previousRect === void 0 ? void 0 : _entry$previousRect.toJSON()
130
+ };
133
131
  }),
134
132
  viewportPercentage: log.viewportPercentage
135
133
  })) : [];
@@ -182,10 +180,8 @@ export default class AbstractVCCalculatorBase {
182
180
  }
183
181
  (_ignoredEntriesByTime = ignoredEntriesByTime.get(timestamp)) === null || _ignoredEntriesByTime === void 0 ? void 0 : _ignoredEntriesByTime.push({
184
182
  ...viewportData,
185
- ...(fg('platform_ufo_serialise_ttvc_v3_debug_data') && {
186
- rect: (_viewportData$rect = viewportData.rect) === null || _viewportData$rect === void 0 ? void 0 : _viewportData$rect.toJSON(),
187
- previousRect: (_viewportData$previou = viewportData.previousRect) === null || _viewportData$previou === void 0 ? void 0 : _viewportData$previou.toJSON()
188
- }),
183
+ rect: (_viewportData$rect = viewportData.rect) === null || _viewportData$rect === void 0 ? void 0 : _viewportData$rect.toJSON(),
184
+ previousRect: (_viewportData$previou = viewportData.previousRect) === null || _viewportData$previou === void 0 ? void 0 : _viewportData$previou.toJSON(),
189
185
  ignoreReason: viewportData.visible ? viewportData.type : 'not-visible'
190
186
  });
191
187
  }
@@ -290,9 +286,7 @@ export default class AbstractVCCalculatorBase {
290
286
  'metric:vc90': null,
291
287
  clean: false,
292
288
  abortReason: dirtyReason,
293
- ...(fg('platform_ufo_abort_timestamp_by_revision') ? {
294
- abortTimestamp: getVCCleanStatusResult.abortTimestamp
295
- } : {})
289
+ abortTimestamp: getVCCleanStatusResult.abortTimestamp
296
290
  };
297
291
  }
298
292
  const vcDetails = await this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, orderedEntries, include3p);
@@ -61,9 +61,7 @@ export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
61
61
  const data = entry.data;
62
62
  if (ABORTING_WINDOW_EVENT.includes(data.eventType)) {
63
63
  dirtyReason = data.eventType === 'keydown' ? 'keypress' : data.eventType;
64
- if (fg('platform_ufo_abort_timestamp_by_revision')) {
65
- abortTimestamp = Math.round(entry.time);
66
- }
64
+ abortTimestamp = Math.round(entry.time);
67
65
  return true;
68
66
  }
69
67
  }
@@ -73,9 +71,7 @@ export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
73
71
  return {
74
72
  isVCClean: false,
75
73
  dirtyReason,
76
- ...(fg('platform_ufo_abort_timestamp_by_revision') ? {
77
- abortTimestamp
78
- } : {})
74
+ abortTimestamp
79
75
  };
80
76
  }
81
77
  return {
@@ -142,27 +142,18 @@ export default class ViewportObserver {
142
142
  const ssrPlaceholderHandler = this.getSSRPlaceholderHandler();
143
143
  if (ssrPlaceholderHandler) {
144
144
  if (ssrPlaceholderHandler.isPlaceholder(addedNode) || ssrPlaceholderHandler.isPlaceholderIgnored(addedNode)) {
145
- if (fg('platform_ufo_ssr_placeholder_resolution_ttvc_v3')) {
146
- if (ssrPlaceholderHandler.checkIfExistedAndSizeMatchingV3(addedNode)) {
147
- var _this$intersectionObs3;
148
- (_this$intersectionObs3 = this.intersectionObserver) === null || _this$intersectionObs3 === void 0 ? void 0 : _this$intersectionObs3.watchAndTag(addedNode, 'mutation:ssr-placeholder');
149
- continue;
150
- }
151
- } else {
152
- const result = await ssrPlaceholderHandler.checkIfExistedAndSizeMatching(addedNode);
153
- if (result !== false) {
154
- var _this$intersectionObs4;
155
- (_this$intersectionObs4 = this.intersectionObserver) === null || _this$intersectionObs4 === void 0 ? void 0 : _this$intersectionObs4.watchAndTag(addedNode, 'mutation:ssr-placeholder');
156
- continue;
157
- }
145
+ if (ssrPlaceholderHandler.checkIfExistedAndSizeMatchingV3(addedNode)) {
146
+ var _this$intersectionObs3;
147
+ (_this$intersectionObs3 = this.intersectionObserver) === null || _this$intersectionObs3 === void 0 ? void 0 : _this$intersectionObs3.watchAndTag(addedNode, 'mutation:ssr-placeholder');
148
+ continue;
158
149
  }
159
150
  // If result is false, continue to normal mutation logic below
160
151
  }
161
152
  if (ssrPlaceholderHandler.isPlaceholderReplacement(addedNode) || ssrPlaceholderHandler.isPlaceholderIgnored(addedNode)) {
162
153
  const result = await ssrPlaceholderHandler.validateReactComponentMatchToPlaceholder(addedNode);
163
154
  if (result !== false) {
164
- var _this$intersectionObs5;
165
- (_this$intersectionObs5 = this.intersectionObserver) === null || _this$intersectionObs5 === void 0 ? void 0 : _this$intersectionObs5.watchAndTag(addedNode, 'mutation:ssr-placeholder');
155
+ var _this$intersectionObs4;
156
+ (_this$intersectionObs4 = this.intersectionObserver) === null || _this$intersectionObs4 === void 0 ? void 0 : _this$intersectionObs4.watchAndTag(addedNode, 'mutation:ssr-placeholder');
166
157
  continue;
167
158
  }
168
159
  // If result is false, continue to normal mutation logic below
@@ -178,36 +169,36 @@ export default class ViewportObserver {
178
169
  });
179
170
  const isInIgnoreLsMarker = isInVCIgnoreIfNoLayoutShiftMarker(addedNode);
180
171
  if (sameDeletedNode && isInIgnoreLsMarker) {
181
- var _this$intersectionObs6;
182
- (_this$intersectionObs6 = this.intersectionObserver) === null || _this$intersectionObs6 === void 0 ? void 0 : _this$intersectionObs6.watchAndTag(addedNode, 'mutation:remount');
172
+ var _this$intersectionObs5;
173
+ (_this$intersectionObs5 = this.intersectionObserver) === null || _this$intersectionObs5 === void 0 ? void 0 : _this$intersectionObs5.watchAndTag(addedNode, 'mutation:remount');
183
174
  continue;
184
175
  }
185
176
  if (isContainedWithinMediaWrapper(addedNode)) {
186
- var _this$intersectionObs7;
187
- (_this$intersectionObs7 = this.intersectionObserver) === null || _this$intersectionObs7 === void 0 ? void 0 : _this$intersectionObs7.watchAndTag(addedNode, 'mutation:media');
177
+ var _this$intersectionObs6;
178
+ (_this$intersectionObs6 = this.intersectionObserver) === null || _this$intersectionObs6 === void 0 ? void 0 : _this$intersectionObs6.watchAndTag(addedNode, 'mutation:media');
188
179
  continue;
189
180
  }
190
181
  const {
191
182
  isWithin: isWithinThirdPartySegment
192
183
  } = checkWithinComponent(addedNode, 'UFOThirdPartySegment', this.mapIs3pResult);
193
184
  if (isWithinThirdPartySegment) {
194
- var _this$intersectionObs8;
195
- (_this$intersectionObs8 = this.intersectionObserver) === null || _this$intersectionObs8 === void 0 ? void 0 : _this$intersectionObs8.watchAndTag(addedNode, 'mutation:third-party-element');
185
+ var _this$intersectionObs7;
186
+ (_this$intersectionObs7 = this.intersectionObserver) === null || _this$intersectionObs7 === void 0 ? void 0 : _this$intersectionObs7.watchAndTag(addedNode, 'mutation:third-party-element');
196
187
  continue;
197
188
  }
198
189
  if (fg('platform_ufo_display_content_resolution_ttvc_v3')) {
199
190
  // Check if the target has display:content css property, return array of valid targets
200
191
  const validTargets = checkCssProperty(addedNode);
201
192
  for (const validTarget of validTargets) {
202
- var _this$intersectionObs9;
203
- (_this$intersectionObs9 = this.intersectionObserver) === null || _this$intersectionObs9 === void 0 ? void 0 : _this$intersectionObs9.watchAndTag(validTarget, createElementMutationsWatcher(removedNodeRects));
193
+ var _this$intersectionObs8;
194
+ (_this$intersectionObs8 = this.intersectionObserver) === null || _this$intersectionObs8 === void 0 ? void 0 : _this$intersectionObs8.watchAndTag(validTarget, createElementMutationsWatcher(removedNodeRects));
204
195
  }
205
196
  } else {
206
- var _this$intersectionObs0;
197
+ var _this$intersectionObs9;
207
198
  if (fg('platform_ufo_display_content_track_occurrence')) {
208
199
  trackDisplayContentsOccurrence(addedNode);
209
200
  }
210
- (_this$intersectionObs0 = this.intersectionObserver) === null || _this$intersectionObs0 === void 0 ? void 0 : _this$intersectionObs0.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
201
+ (_this$intersectionObs9 = this.intersectionObserver) === null || _this$intersectionObs9 === void 0 ? void 0 : _this$intersectionObs9.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
211
202
  }
212
203
  }
213
204
  });
@@ -217,8 +208,8 @@ export default class ViewportObserver {
217
208
  oldValue,
218
209
  newValue
219
210
  }) => {
220
- var _this$intersectionObs1;
221
- (_this$intersectionObs1 = this.intersectionObserver) === null || _this$intersectionObs1 === void 0 ? void 0 : _this$intersectionObs1.watchAndTag(target, ({
211
+ var _this$intersectionObs0;
212
+ (_this$intersectionObs0 = this.intersectionObserver) === null || _this$intersectionObs0 === void 0 ? void 0 : _this$intersectionObs0.watchAndTag(target, ({
222
213
  target,
223
214
  rect
224
215
  }) => {
@@ -345,12 +336,12 @@ export default class ViewportObserver {
345
336
  this.isStarted = true;
346
337
  }
347
338
  stop() {
348
- var _this$mutationObserve2, _this$intersectionObs10, _this$performanceObse2;
339
+ var _this$mutationObserve2, _this$intersectionObs1, _this$performanceObse2;
349
340
  if (!this.isStarted) {
350
341
  return;
351
342
  }
352
343
  (_this$mutationObserve2 = this.mutationObserver) === null || _this$mutationObserve2 === void 0 ? void 0 : _this$mutationObserve2.disconnect();
353
- (_this$intersectionObs10 = this.intersectionObserver) === null || _this$intersectionObs10 === void 0 ? void 0 : _this$intersectionObs10.disconnect();
344
+ (_this$intersectionObs1 = this.intersectionObserver) === null || _this$intersectionObs1 === void 0 ? void 0 : _this$intersectionObs1.disconnect();
354
345
  (_this$performanceObse2 = this.performanceObserver) === null || _this$performanceObse2 === void 0 ? void 0 : _this$performanceObse2.disconnect();
355
346
  this.isStarted = false;
356
347
  // Clean up caches when stopping
@@ -8,7 +8,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
8
8
  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; }
9
9
  import { fg } from '@atlaskit/platform-feature-flags';
10
10
  import coinflip from '../coinflip';
11
- import { DEFAULT_TTVC_REVISION, getConfig, getExtraInteractionRate, getMostRecentVCRevision } from '../config';
11
+ import { DEFAULT_TTVC_REVISION, getConfig, getExtraInteractionRate } from '../config';
12
12
  import { buildSegmentTree, getOldSegmentsLabelStack, optimizeLabelStack, sanitizeUfoName } from '../create-payload/common/utils';
13
13
  import { getMoreAccuratePageVisibilityUpToTTAI } from '../create-payload/utils/get-more-accurate-page-visibility-up-to-ttai';
14
14
  import getPageVisibilityUpToTTAI from '../create-payload/utils/get-page-visibility-up-to-ttai';
@@ -29,8 +29,8 @@ function createInteractionExtraLogPayload(_x, _x2) {
29
29
  }
30
30
  function _createInteractionExtraLogPayload() {
31
31
  _createInteractionExtraLogPayload = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(interactionId, interaction) {
32
- var _getTTAI, _getMostRecentVCRevis, _window$location;
33
- var config, end, start, ufoName, rate, type, abortReason, routeName, previousInteractionName, isPreviousInteractionAborted, abortedByInteractionName, knownSegments, sanitisedUfoName, configRate, pageVisibilityAtTTAI, isPageLoad, calculatePageVisibilityFromTheStartOfPageLoad, moreAccuratePageVisibilityAtTTAI, extraTTAI, newUFOName, mostRecentVCRevision, finalVCMetrics, isThirdParty, filteredData, getDetailedInteractionMetrics, segments3p, segmentTree, payload;
32
+ var _getTTAI, _window$location;
33
+ var config, end, start, ufoName, rate, type, abortReason, routeName, previousInteractionName, isPreviousInteractionAborted, abortedByInteractionName, knownSegments, sanitisedUfoName, configRate, pageVisibilityAtTTAI, isPageLoad, calculatePageVisibilityFromTheStartOfPageLoad, moreAccuratePageVisibilityAtTTAI, extraTTAI, newUFOName, finalVCMetrics, vcRevisionPayload, effectiveVCRevisionPayload, isThirdParty, filteredData, getDetailedInteractionMetrics, segments3p, segmentTree, payload;
34
34
  return _regeneratorRuntime.wrap(function _callee$(_context) {
35
35
  while (1) switch (_context.prev = _context.next) {
36
36
  case 0:
@@ -62,11 +62,22 @@ function _createInteractionExtraLogPayload() {
62
62
  moreAccuratePageVisibilityAtTTAI = calculatePageVisibilityFromTheStartOfPageLoad ? getMoreAccuratePageVisibilityUpToTTAI(interaction) : null;
63
63
  extraTTAI = (_getTTAI = getTTAI(interaction)) !== null && _getTTAI !== void 0 ? _getTTAI : undefined;
64
64
  newUFOName = sanitizeUfoName(ufoName);
65
- mostRecentVCRevision = (_getMostRecentVCRevis = getMostRecentVCRevision(newUFOName)) !== null && _getMostRecentVCRevis !== void 0 ? _getMostRecentVCRevis : DEFAULT_TTVC_REVISION;
66
- _context.next = 19;
65
+ _context.next = 18;
67
66
  return getVCMetrics(interaction, true);
68
- case 19:
67
+ case 18:
69
68
  finalVCMetrics = _context.sent;
69
+ // Check if VC is clean and has valid metric
70
+ vcRevisionPayload = finalVCMetrics === null || finalVCMetrics === void 0 ? void 0 : finalVCMetrics['ufo:vc:rev'];
71
+ effectiveVCRevisionPayload = vcRevisionPayload === null || vcRevisionPayload === void 0 ? void 0 : vcRevisionPayload.find(function (_ref) {
72
+ var revision = _ref.revision;
73
+ return revision === DEFAULT_TTVC_REVISION;
74
+ });
75
+ if (!(!(effectiveVCRevisionPayload !== null && effectiveVCRevisionPayload !== void 0 && effectiveVCRevisionPayload.clean) || (effectiveVCRevisionPayload === null || effectiveVCRevisionPayload === void 0 ? void 0 : effectiveVCRevisionPayload['metric:vc90']) === undefined)) {
76
+ _context.next = 23;
77
+ break;
78
+ }
79
+ return _context.abrupt("return", null);
80
+ case 23:
70
81
  // Helper function to check if labelStack contains third-party type
71
82
  isThirdParty = function isThirdParty(labelStack) {
72
83
  var _labelStack$some;
@@ -109,9 +120,9 @@ function _createInteractionExtraLogPayload() {
109
120
  getDetailedInteractionMetrics = function getDetailedInteractionMetrics() {
110
121
  var _interaction$hold3pIn;
111
122
  return {
112
- errors: filteredData.errors.map(function (_ref) {
113
- var labelStack = _ref.labelStack,
114
- others = _objectWithoutProperties(_ref, _excluded);
123
+ errors: filteredData.errors.map(function (_ref2) {
124
+ var labelStack = _ref2.labelStack,
125
+ others = _objectWithoutProperties(_ref2, _excluded);
115
126
  return _objectSpread(_objectSpread({}, others), {}, {
116
127
  labelStack: labelStack && optimizeLabelStack(labelStack, getReactUFOPayloadVersion(interaction.type))
117
128
  });
@@ -172,13 +183,13 @@ function _createInteractionExtraLogPayload() {
172
183
  reactProfilerTimings: optimizeReactProfilerTimings(filteredData.reactProfilerTimings, start, getReactUFOPayloadVersion(interaction.type)),
173
184
  customData: filteredData.customData
174
185
  }, getDetailedInteractionMetrics()),
175
- 'vc:effective:revision': mostRecentVCRevision
186
+ 'vc:effective:revision': DEFAULT_TTVC_REVISION
176
187
  }
177
188
  }
178
189
  };
179
190
  payload.attributes.properties['event:sizeInKb'] = getPayloadSize(payload.attributes.properties);
180
191
  return _context.abrupt("return", payload);
181
- case 29:
192
+ case 32:
182
193
  case "end":
183
194
  return _context.stop();
184
195
  }
@@ -9,7 +9,6 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
9
9
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
10
10
  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; }
11
11
  import { v4 as createUUID } from 'uuid';
12
- import FeatureGates from '@atlaskit/feature-gate-js-client';
13
12
  import { fg } from '@atlaskit/platform-feature-flags';
14
13
  import coinflip from '../coinflip';
15
14
  import { getAwaitBM3TTIList, getCapabilityRate, getConfig, getExperimentalInteractionRate, getExtraInteractionRate, getInteractionTimeout, getPostInteractionRate, getReactHydrationStats } from '../config';
@@ -880,16 +879,6 @@ function callCancelCallbacks(interaction) {
880
879
  });
881
880
  }
882
881
  export function abort(interactionId, abortReason) {
883
- var _FeatureGates$getExpe;
884
- var activeInteraction = getActiveInteraction();
885
- if (
886
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
887
- abortReason === 'new_interaction' && fg('ufo_targeting_confluence_hello') && // list of enabled experiences managed in switcheroo/statsig
888
- // ignoring as per https://atlassian.slack.com/archives/C026LTWFZ47/p1752798490250649
889
- // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
890
- (_FeatureGates$getExpe = FeatureGates.getExperimentValue('ufo_disable_aborted_new_interaction_on_confluence', 'enabledExperiences', [])) !== null && _FeatureGates$getExpe !== void 0 && _FeatureGates$getExpe.includes((activeInteraction === null || activeInteraction === void 0 ? void 0 : activeInteraction.ufoName) || '')) {
891
- return;
892
- }
893
882
  var interaction = interactions.get(interactionId);
894
883
  if (interaction != null) {
895
884
  callCancelCallbacks(interaction);
@@ -907,16 +896,6 @@ export function abort(interactionId, abortReason) {
907
896
  }
908
897
  }
909
898
  export function abortByNewInteraction(interactionId, interactionName) {
910
- var _FeatureGates$getExpe2;
911
- var activeInteraction = getActiveInteraction();
912
- if (
913
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
914
- fg('ufo_targeting_confluence_hello') && // list of enabled experiences managed in switcheroo/statsig
915
- // ignoring as per https://atlassian.slack.com/archives/C026LTWFZ47/p1752798490250649
916
- // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
917
- (_FeatureGates$getExpe2 = FeatureGates.getExperimentValue('ufo_disable_aborted_new_interaction_on_confluence', 'enabledExperiences', [])) !== null && _FeatureGates$getExpe2 !== void 0 && _FeatureGates$getExpe2.includes((activeInteraction === null || activeInteraction === void 0 ? void 0 : activeInteraction.ufoName) || '')) {
918
- return;
919
- }
920
899
  var interaction = interactions.get(interactionId);
921
900
  if (interaction != null) {
922
901
  callCancelCallbacks(interaction);
@@ -935,16 +914,6 @@ export function abortByNewInteraction(interactionId, interactionName) {
935
914
  }
936
915
  }
937
916
  export function abortAll(abortReason, abortedByInteractionName) {
938
- var _FeatureGates$getExpe3;
939
- var activeInteraction = getActiveInteraction();
940
- if (
941
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
942
- abortReason === 'new_interaction' && fg('ufo_targeting_confluence_hello') && // list of enabled experiences managed in switcheroo/statsig
943
- // ignoring as per https://atlassian.slack.com/archives/C026LTWFZ47/p1752798490250649
944
- // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
945
- (_FeatureGates$getExpe3 = FeatureGates.getExperimentValue('ufo_disable_aborted_new_interaction_on_confluence', 'enabledExperiences', [])) !== null && _FeatureGates$getExpe3 !== void 0 && _FeatureGates$getExpe3.includes((activeInteraction === null || activeInteraction === void 0 ? void 0 : activeInteraction.ufoName) || '')) {
946
- return;
947
- }
948
917
  interactions.forEach(function (interaction, interactionId) {
949
918
  var noMoreHolds = interaction.holdActive.size === 0;
950
919
  if (!noMoreHolds) {
@@ -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';
@@ -96,7 +95,7 @@ export var VCObserver = /*#__PURE__*/function () {
96
95
  });
97
96
  _defineProperty(this, "getVCResult", /*#__PURE__*/function () {
98
97
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref3) {
99
- var start, stop, tti, prefix, ssr, vc, isEventAborted, experienceKey, interactionId, includeSSRRatio, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, isTTVCv1Disabled, vcAbortedResultWithRevisions, _vcAbortedResultWithRevisions, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, shouldCreateDebugDetails, v1RevisionDebugDetails, v2RevisionDebugDetails, _window$__ufo_devtool2, _window2, _window$__ufo_devtool, _window, _window$__on_ufo_vc_d2, _window4, _window$__on_ufo_vc_d, _window3, isVCClean, revisionsData, speedIndex, SSRRatio, SSRRatioNext, SSRRatioPayload, isTTVCv3Enabled;
98
+ var start, stop, tti, prefix, ssr, vc, isEventAborted, experienceKey, interactionId, includeSSRRatio, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, isTTVCv1Disabled, vcAbortedResultWithRevisions, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, shouldCreateDebugDetails, v1RevisionDebugDetails, v2RevisionDebugDetails, _window$__ufo_devtool2, _window2, _window$__ufo_devtool, _window, _window$__on_ufo_vc_d2, _window4, _window$__on_ufo_vc_d, _window3, isVCClean, revisionsData, speedIndex, SSRRatio, SSRRatioNext, SSRRatioPayload, isTTVCv3Enabled;
100
99
  return _regeneratorRuntime.wrap(function _callee$(_context) {
101
100
  while (1) switch (_context.prev = _context.next) {
102
101
  case 0:
@@ -113,7 +112,7 @@ export var VCObserver = /*#__PURE__*/function () {
113
112
  abortReason = rawData.abortReason, abortReasonInfo = rawData.abortReasonInfo, heatmap = rawData.heatmap, heatmapNext = rawData.heatmapNext, outOfBoundaryInfo = rawData.outOfBoundaryInfo, totalTime = rawData.totalTime, componentsLog = rawData.componentsLog, viewport = rawData.viewport, devToolsEnabled = rawData.devToolsEnabled, ratios = rawData.ratios;
114
113
  isTTVCv1Disabled = !isVCRevisionEnabled('fy25.01', experienceKey);
115
114
  if (!(abortReasonInfo !== null)) {
116
- _context.next = 19;
115
+ _context.next = 13;
117
116
  break;
118
117
  }
119
118
  // exposing data to devtools
@@ -122,10 +121,6 @@ export var VCObserver = /*#__PURE__*/function () {
122
121
  window.__vcNotAvailableReason = abortReasonInfo;
123
122
  }
124
123
  } catch (e) {}
125
- if (!fg('platform_ufo_abort_timestamp_by_revision')) {
126
- _context.next = 16;
127
- break;
128
- }
129
124
  vcAbortedResultWithRevisions = _defineProperty({}, "".concat(fullPrefix, "vc:rev"), [{
130
125
  revision: 'fy25.02',
131
126
  clean: false,
@@ -143,23 +138,7 @@ export var VCObserver = /*#__PURE__*/function () {
143
138
  });
144
139
  }
145
140
  return _context.abrupt("return", vcAbortedResultWithRevisions);
146
- case 16:
147
- _vcAbortedResultWithRevisions = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:state"), false), "".concat(fullPrefix, "vc:abort:reason"), abortReason.reason), "".concat(fullPrefix, "vc:abort:timestamp"), abortReason.timestamp), "".concat(fullPrefix, "vc:rev"), [{
148
- revision: 'fy25.02',
149
- clean: false,
150
- 'metric:vc90': null,
151
- abortReason: abortReason.reason
152
- }]);
153
- if (!isTTVCv1Disabled) {
154
- _vcAbortedResultWithRevisions["".concat(fullPrefix, "vc:rev")].push({
155
- revision: 'fy25.01',
156
- clean: false,
157
- 'metric:vc90': null,
158
- abortReason: abortReason.reason
159
- });
160
- }
161
- return _context.abrupt("return", _vcAbortedResultWithRevisions);
162
- case 19:
141
+ case 13:
163
142
  ttvcV1Result = isTTVCv1Disabled ? {
164
143
  VC: {},
165
144
  VCBox: {},
@@ -317,16 +296,16 @@ export var VCObserver = /*#__PURE__*/function () {
317
296
  SSRRatioNext = VCObserver.getSSRRatio(vcNext.VCEntries.rel, ssr);
318
297
  SSRRatioPayload = includeSSRRatio ? _defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:ssrRatio"), isTTVCv1Disabled ? SSRRatioNext : SSRRatio), "".concat(fullPrefix, "vc:next:ssrRatio"), SSRRatioNext) : {};
319
298
  if (!isTTVCv1Disabled) {
320
- _context.next = 35;
299
+ _context.next = 29;
321
300
  break;
322
301
  }
323
302
  return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, _defineProperty({}, "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), SSRRatioPayload), {}, _defineProperty({}, "".concat(fullPrefix, "vc:ssrRatio"), SSRRatioNext), revisionsData), speedIndex));
324
- case 35:
303
+ case 29:
325
304
  isTTVCv3Enabled = isVCRevisionEnabled('fy25.03', experienceKey);
326
305
  return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
327
306
  'metrics:vc': VC
328
307
  }, "".concat(fullPrefix, "vc:state"), true), "".concat(fullPrefix, "vc:clean"), isVCClean), "".concat(fullPrefix, "vc:dom"), VCBox), "".concat(fullPrefix, "vc:updates"), isTTVCv3Enabled ? undefined : VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:total"), totalPainted), "".concat(fullPrefix, "vc:ratios"), ratios), "".concat(fullPrefix, "vc:ssrRatio"), SSRRatio), outOfBoundary), {}, _defineProperty(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:next"), vcNext.VC), "".concat(fullPrefix, "vc:next:updates"), isTTVCv3Enabled ? undefined : vcNext.VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:next:dom"), vcNext.VCBox), SSRRatioPayload), {}, _defineProperty({}, "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), speedIndex));
329
- case 37:
308
+ case 31:
330
309
  case "end":
331
310
  return _context.stop();
332
311
  }
@@ -207,7 +207,7 @@ export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
207
207
  return element;
208
208
  }
209
209
 
210
- // NOTE - for use when the FG `platform_ufo_ssr_placeholder_resolution_ttvc_v3` is disabled
210
+ // Validates placeholder match using asynchronous observation and resolves with the result
211
211
  }, {
212
212
  key: "checkIfExistedAndSizeMatching",
213
213
  value: function checkIfExistedAndSizeMatching(el) {
@@ -226,7 +226,7 @@ export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
226
226
  });
227
227
  }
228
228
 
229
- // NOTE - for use when the FG `platform_ufo_ssr_placeholder_resolution_ttvc_v3` is enabled
229
+ // Validates placeholder match synchronously using stored SSR dimensions and current bounds
230
230
  }, {
231
231
  key: "checkIfExistedAndSizeMatchingV3",
232
232
  value: function checkIfExistedAndSizeMatchingV3(el) {
@@ -198,15 +198,14 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
198
198
  }
199
199
  }
200
200
  enhancedVcLogs = vcLogs ? vcLogs.map(function (log) {
201
- return _objectSpread(_objectSpread(_objectSpread({}, log), fg('platform_ufo_serialise_ttvc_v3_debug_data') && {
201
+ return _objectSpread(_objectSpread({}, log), {}, {
202
202
  entries: log.entries.map(function (entry) {
203
203
  var _entry$rect, _entry$previousRect;
204
204
  return _objectSpread(_objectSpread({}, entry), {}, {
205
205
  rect: (_entry$rect = entry.rect) === null || _entry$rect === void 0 ? void 0 : _entry$rect.toJSON(),
206
206
  previousRect: (_entry$previousRect = entry.previousRect) === null || _entry$previousRect === void 0 ? void 0 : _entry$previousRect.toJSON()
207
207
  });
208
- })
209
- }), {}, {
208
+ }),
210
209
  viewportPercentage: log.viewportPercentage
211
210
  });
212
211
  }) : []; // If 3p metric enabled - calculate the debug details
@@ -262,10 +261,9 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
262
261
  if (!ignoredEntriesByTime.has(timestamp)) {
263
262
  ignoredEntriesByTime.set(timestamp, []);
264
263
  }
265
- (_ignoredEntriesByTime = ignoredEntriesByTime.get(timestamp)) === null || _ignoredEntriesByTime === void 0 || _ignoredEntriesByTime.push(_objectSpread(_objectSpread(_objectSpread({}, viewportData), fg('platform_ufo_serialise_ttvc_v3_debug_data') && {
264
+ (_ignoredEntriesByTime = ignoredEntriesByTime.get(timestamp)) === null || _ignoredEntriesByTime === void 0 || _ignoredEntriesByTime.push(_objectSpread(_objectSpread({}, viewportData), {}, {
266
265
  rect: (_viewportData$rect = viewportData.rect) === null || _viewportData$rect === void 0 ? void 0 : _viewportData$rect.toJSON(),
267
- previousRect: (_viewportData$previou = viewportData.previousRect) === null || _viewportData$previou === void 0 ? void 0 : _viewportData$previou.toJSON()
268
- }), {}, {
266
+ previousRect: (_viewportData$previou = viewportData.previousRect) === null || _viewportData$previou === void 0 ? void 0 : _viewportData$previou.toJSON(),
269
267
  ignoreReason: viewportData.visible ? viewportData.type : 'not-visible'
270
268
  }));
271
269
  }
@@ -391,14 +389,13 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
391
389
  _context2.next = 7;
392
390
  break;
393
391
  }
394
- return _context2.abrupt("return", _objectSpread({
392
+ return _context2.abrupt("return", {
395
393
  revision: this.revisionNo,
396
394
  'metric:vc90': null,
397
395
  clean: false,
398
- abortReason: dirtyReason
399
- }, fg('platform_ufo_abort_timestamp_by_revision') ? {
396
+ abortReason: dirtyReason,
400
397
  abortTimestamp: getVCCleanStatusResult.abortTimestamp
401
- } : {}));
398
+ });
402
399
  case 7:
403
400
  _context2.next = 9;
404
401
  return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, orderedEntries, include3p);
@@ -1,11 +1,8 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
2
  import _createClass from "@babel/runtime/helpers/createClass";
4
3
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
4
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
5
  import _inherits from "@babel/runtime/helpers/inherits";
7
- 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; }
8
- 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; }
9
6
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
7
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
8
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -77,21 +74,18 @@ var VCCalculator_FY25_03 = /*#__PURE__*/function (_AbstractVCCalculator) {
77
74
  var data = entry.data;
78
75
  if (ABORTING_WINDOW_EVENT.includes(data.eventType)) {
79
76
  dirtyReason = data.eventType === 'keydown' ? 'keypress' : data.eventType;
80
- if (fg('platform_ufo_abort_timestamp_by_revision')) {
81
- abortTimestamp = Math.round(entry.time);
82
- }
77
+ abortTimestamp = Math.round(entry.time);
83
78
  return true;
84
79
  }
85
80
  }
86
81
  return false;
87
82
  });
88
83
  if (hasAbortEvent && dirtyReason) {
89
- return _objectSpread({
84
+ return {
90
85
  isVCClean: false,
91
- dirtyReason: dirtyReason
92
- }, fg('platform_ufo_abort_timestamp_by_revision') ? {
86
+ dirtyReason: dirtyReason,
93
87
  abortTimestamp: abortTimestamp
94
- } : {});
88
+ };
95
89
  }
96
90
  return {
97
91
  isVCClean: true