@atlaskit/react-ufo 3.13.15 → 3.13.17

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 3.13.17
4
+
5
+ ### Patch Changes
6
+
7
+ - [#160542](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/160542)
8
+ [`eadf6fec0762d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/eadf6fec0762d) -
9
+ Added extension to VC v3 to include SSR
10
+
11
+ ## 3.13.16
12
+
13
+ ### Patch Changes
14
+
15
+ - [#164300](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/164300)
16
+ [`cd25a7f650fa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cd25a7f650fa4) -
17
+ AFO-3919 cleanup platform_ufo_hold_cross_interaction
18
+
3
19
  ## 3.13.15
4
20
 
5
21
  ### Patch Changes
@@ -22,7 +22,7 @@ function getVCMetrics(_x) {
22
22
  }
23
23
  function _getVCMetrics() {
24
24
  _getVCMetrics = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(interaction) {
25
- var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$vc2, _config$experimentalI, _result$ufoVcRev;
25
+ var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$vc2, _config$vc3, _config$experimentalI, _result$ufoVcRev;
26
26
  var config, interactionStatus, pageVisibilityUpToTTAI, shouldReportVCMetrics, isSSREnabled, ssr, tti, prefix, result, mostRecentVCRevision, mostRecentVCRevisionPayload;
27
27
  return _regenerator.default.wrap(function _callee$(_context) {
28
28
  while (1) switch (_context.prev = _context.next) {
@@ -63,11 +63,12 @@ function _getVCMetrics() {
63
63
  stop: interaction.end,
64
64
  tti: tti,
65
65
  prefix: prefix,
66
+ includeSSRInV3: (_config$vc2 = config.vc) === null || _config$vc2 === void 0 ? void 0 : _config$vc2.includeSSRInV3,
66
67
  vc: interaction.vc,
67
68
  isEventAborted: interactionStatus.originalInteractionStatus !== 'SUCCEEDED',
68
69
  experienceKey: interaction.ufoName,
69
70
  interactionId: interaction.id,
70
- includeSSRRatio: (_config$vc2 = config.vc) === null || _config$vc2 === void 0 ? void 0 : _config$vc2.includeSSRRatio
71
+ includeSSRRatio: (_config$vc3 = config.vc) === null || _config$vc3 === void 0 ? void 0 : _config$vc3.includeSSRRatio
71
72
  }, ssr));
72
73
  case 18:
73
74
  result = _context.sent;
@@ -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 and feature flag is enabled
38
- if (oldId !== newId && (0, _platformFeatureFlags.fg)('platform_ufo_hold_cross_interaction')) {
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 when feature flag is enabled, otherwise returns the current value.
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
- if ((0, _platformFeatureFlags.fg)('platform_ufo_hold_cross_interaction')) {
29
- // New subscription-based approach
30
- setCurrentId((interactionId === null || interactionId === void 0 ? void 0 : interactionId.current) || null);
31
- var unsubscribe = (0, _interactionIdContext.subscribeToInteractionIdChanges)(function (newId) {
32
- setCurrentId(newId);
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
  }
@@ -129,7 +129,8 @@ var VCObserverWrapper = exports.VCObserverWrapper = /*#__PURE__*/function () {
129
129
  return (_this$newVCObserver3 = this.newVCObserver) === null || _this$newVCObserver3 === void 0 ? void 0 : _this$newVCObserver3.getVCResult({
130
130
  start: param.start,
131
131
  stop: param.stop,
132
- interactionId: param.interactionId
132
+ interactionId: param.interactionId,
133
+ ssr: param.includeSSRInV3 ? param.ssr : undefined
133
134
  });
134
135
  case 12:
135
136
  _context.t1 = _context.sent;
@@ -16,6 +16,8 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
16
  var _entriesTimeline = _interopRequireDefault(require("./entries-timeline"));
17
17
  var _getElementName2 = _interopRequireDefault(require("./get-element-name"));
18
18
  var _fy25_ = _interopRequireDefault(require("./metric-calculator/fy25_03"));
19
+ var _getViewportHeight = _interopRequireDefault(require("./metric-calculator/utils/get-viewport-height"));
20
+ var _getViewportWidth = _interopRequireDefault(require("./metric-calculator/utils/get-viewport-width"));
19
21
  var _viewportObserver = _interopRequireDefault(require("./viewport-observer"));
20
22
  var _windowEventObserver = _interopRequireDefault(require("./window-event-observer"));
21
23
  var DEFAULT_SELECTOR_CONFIG = {
@@ -118,6 +120,31 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
118
120
  (_this$viewportObserve2 = this.viewportObserver) === null || _this$viewportObserve2 === void 0 || _this$viewportObserve2.stop();
119
121
  (_this$windowEventObse2 = this.windowEventObserver) === null || _this$windowEventObse2 === void 0 || _this$windowEventObse2.stop();
120
122
  }
123
+ }, {
124
+ key: "addSSR",
125
+ value: function addSSR(ssr) {
126
+ this.entriesTimeline.push({
127
+ time: ssr,
128
+ data: {
129
+ elementName: 'SSR',
130
+ type: 'mutation:element',
131
+ rect: {
132
+ height: (0, _getViewportHeight.default)(),
133
+ width: (0, _getViewportWidth.default)(),
134
+ left: 0,
135
+ top: 0,
136
+ x: 0,
137
+ y: 0,
138
+ bottom: (0, _getViewportHeight.default)(),
139
+ right: (0, _getViewportWidth.default)(),
140
+ toJSON: function toJSON() {
141
+ return null;
142
+ }
143
+ },
144
+ visible: true
145
+ }
146
+ });
147
+ }
121
148
  }, {
122
149
  key: "getVCResult",
123
150
  value: function () {
@@ -130,11 +157,14 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
130
157
  results = [];
131
158
  this.addStartEntry(start);
132
159
  calculator_fy25_03 = new _fy25_.default();
160
+ if (param.ssr) {
161
+ this.addSSR(param.ssr);
162
+ }
133
163
  orderedEntries = this.entriesTimeline.getOrderedEntries({
134
164
  start: start,
135
165
  stop: stop
136
166
  });
137
- _context.next = 7;
167
+ _context.next = 8;
138
168
  return calculator_fy25_03.calculate({
139
169
  orderedEntries: orderedEntries,
140
170
  startTime: start,
@@ -142,13 +172,13 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
142
172
  interactionId: interactionId,
143
173
  isPostInteraction: this.isPostInteraction
144
174
  });
145
- case 7:
175
+ case 8:
146
176
  fy25_03 = _context.sent;
147
177
  if (fy25_03) {
148
178
  results.push(fy25_03);
149
179
  }
150
180
  return _context.abrupt("return", results);
151
- case 10:
181
+ case 11:
152
182
  case "end":
153
183
  return _context.stop();
154
184
  }
@@ -6,7 +6,7 @@ import getInteractionStatus from './get-interaction-status';
6
6
  import getPageVisibilityUpToTTAI from './get-page-visibility-up-to-ttai';
7
7
  import getSSRDoneTimeValue from './get-ssr-done-time-value';
8
8
  async function getVCMetrics(interaction) {
9
- var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _interaction$apdex$, _config$vc2, _config$experimentalI, _result$ufoVcRev;
9
+ var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _interaction$apdex$, _config$vc2, _config$vc3, _config$experimentalI, _result$ufoVcRev;
10
10
  const config = getConfig();
11
11
  if (!(config !== null && config !== void 0 && (_config$vc = config.vc) !== null && _config$vc !== void 0 && _config$vc.enabled)) {
12
12
  return {};
@@ -33,11 +33,12 @@ async function getVCMetrics(interaction) {
33
33
  stop: interaction.end,
34
34
  tti,
35
35
  prefix,
36
+ includeSSRInV3: (_config$vc2 = config.vc) === null || _config$vc2 === void 0 ? void 0 : _config$vc2.includeSSRInV3,
36
37
  vc: interaction.vc,
37
38
  isEventAborted: interactionStatus.originalInteractionStatus !== 'SUCCEEDED',
38
39
  experienceKey: interaction.ufoName,
39
40
  interactionId: interaction.id,
40
- includeSSRRatio: (_config$vc2 = config.vc) === null || _config$vc2 === void 0 ? void 0 : _config$vc2.includeSSRRatio,
41
+ includeSSRRatio: (_config$vc3 = config.vc) === null || _config$vc3 === void 0 ? void 0 : _config$vc3.includeSSRRatio,
41
42
  ...ssr
42
43
  });
43
44
  if ((_config$experimentalI = config.experimentalInteractionMetrics) !== null && _config$experimentalI !== void 0 && _config$experimentalI.enabled) {
@@ -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 and feature flag is enabled
27
- if (oldId !== newId && fg('platform_ufo_hold_cross_interaction')) {
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 when feature flag is enabled, otherwise returns the current value.
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
- if (fg('platform_ufo_hold_cross_interaction')) {
16
- // New subscription-based approach
17
- setCurrentId((interactionId === null || interactionId === void 0 ? void 0 : interactionId.current) || null);
18
- const unsubscribe = subscribeToInteractionIdChanges(newId => {
19
- setCurrentId(newId);
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
  }
@@ -80,7 +80,8 @@ export class VCObserverWrapper {
80
80
  const v3Result = isVCRevisionEnabled('fy25.03', experienceKey) ? await ((_this$newVCObserver3 = this.newVCObserver) === null || _this$newVCObserver3 === void 0 ? void 0 : _this$newVCObserver3.getVCResult({
81
81
  start: param.start,
82
82
  stop: param.stop,
83
- interactionId: param.interactionId
83
+ interactionId: param.interactionId,
84
+ ssr: param.includeSSRInV3 ? param.ssr : undefined
84
85
  })) : [];
85
86
  if (!v3Result) {
86
87
  return v1v2Result !== null && v1v2Result !== void 0 ? v1v2Result : {};
@@ -3,6 +3,8 @@ import { fg } from '@atlaskit/platform-feature-flags';
3
3
  import EntriesTimeline from './entries-timeline';
4
4
  import getElementName from './get-element-name';
5
5
  import VCCalculator_FY25_03 from './metric-calculator/fy25_03';
6
+ import getViewportHeight from './metric-calculator/utils/get-viewport-height';
7
+ import getViewportWidth from './metric-calculator/utils/get-viewport-width';
6
8
  import ViewportObserver from './viewport-observer';
7
9
  import WindowEventObserver from './window-event-observer';
8
10
  const DEFAULT_SELECTOR_CONFIG = {
@@ -96,6 +98,29 @@ export default class VCObserverNew {
96
98
  (_this$viewportObserve2 = this.viewportObserver) === null || _this$viewportObserve2 === void 0 ? void 0 : _this$viewportObserve2.stop();
97
99
  (_this$windowEventObse2 = this.windowEventObserver) === null || _this$windowEventObse2 === void 0 ? void 0 : _this$windowEventObse2.stop();
98
100
  }
101
+ addSSR(ssr) {
102
+ this.entriesTimeline.push({
103
+ time: ssr,
104
+ data: {
105
+ elementName: 'SSR',
106
+ type: 'mutation:element',
107
+ rect: {
108
+ height: getViewportHeight(),
109
+ width: getViewportWidth(),
110
+ left: 0,
111
+ top: 0,
112
+ x: 0,
113
+ y: 0,
114
+ bottom: getViewportHeight(),
115
+ right: getViewportWidth(),
116
+ toJSON() {
117
+ return null;
118
+ }
119
+ },
120
+ visible: true
121
+ }
122
+ });
123
+ }
99
124
  async getVCResult(param) {
100
125
  const {
101
126
  start,
@@ -105,6 +130,9 @@ export default class VCObserverNew {
105
130
  const results = [];
106
131
  this.addStartEntry(start);
107
132
  const calculator_fy25_03 = new VCCalculator_FY25_03();
133
+ if (param.ssr) {
134
+ this.addSSR(param.ssr);
135
+ }
108
136
  const orderedEntries = this.entriesTimeline.getOrderedEntries({
109
137
  start,
110
138
  stop
@@ -15,7 +15,7 @@ function getVCMetrics(_x) {
15
15
  }
16
16
  function _getVCMetrics() {
17
17
  _getVCMetrics = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(interaction) {
18
- var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$vc2, _config$experimentalI, _result$ufoVcRev;
18
+ var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$vc2, _config$vc3, _config$experimentalI, _result$ufoVcRev;
19
19
  var config, interactionStatus, pageVisibilityUpToTTAI, shouldReportVCMetrics, isSSREnabled, ssr, tti, prefix, result, mostRecentVCRevision, mostRecentVCRevisionPayload;
20
20
  return _regeneratorRuntime.wrap(function _callee$(_context) {
21
21
  while (1) switch (_context.prev = _context.next) {
@@ -56,11 +56,12 @@ function _getVCMetrics() {
56
56
  stop: interaction.end,
57
57
  tti: tti,
58
58
  prefix: prefix,
59
+ includeSSRInV3: (_config$vc2 = config.vc) === null || _config$vc2 === void 0 ? void 0 : _config$vc2.includeSSRInV3,
59
60
  vc: interaction.vc,
60
61
  isEventAborted: interactionStatus.originalInteractionStatus !== 'SUCCEEDED',
61
62
  experienceKey: interaction.ufoName,
62
63
  interactionId: interaction.id,
63
- includeSSRRatio: (_config$vc2 = config.vc) === null || _config$vc2 === void 0 ? void 0 : _config$vc2.includeSSRRatio
64
+ includeSSRRatio: (_config$vc3 = config.vc) === null || _config$vc3 === void 0 ? void 0 : _config$vc3.includeSSRRatio
64
65
  }, ssr));
65
66
  case 18:
66
67
  result = _context.sent;
@@ -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 and feature flag is enabled
32
- if (oldId !== newId && fg('platform_ufo_hold_cross_interaction')) {
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 when feature flag is enabled, otherwise returns the current value.
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
- if (fg('platform_ufo_hold_cross_interaction')) {
20
- // New subscription-based approach
21
- setCurrentId((interactionId === null || interactionId === void 0 ? void 0 : interactionId.current) || null);
22
- var unsubscribe = subscribeToInteractionIdChanges(function (newId) {
23
- setCurrentId(newId);
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
  }
@@ -120,7 +120,8 @@ export var VCObserverWrapper = /*#__PURE__*/function () {
120
120
  return (_this$newVCObserver3 = this.newVCObserver) === null || _this$newVCObserver3 === void 0 ? void 0 : _this$newVCObserver3.getVCResult({
121
121
  start: param.start,
122
122
  stop: param.stop,
123
- interactionId: param.interactionId
123
+ interactionId: param.interactionId,
124
+ ssr: param.includeSSRInV3 ? param.ssr : undefined
124
125
  });
125
126
  case 12:
126
127
  _context.t1 = _context.sent;
@@ -9,6 +9,8 @@ import { fg } from '@atlaskit/platform-feature-flags';
9
9
  import EntriesTimeline from './entries-timeline';
10
10
  import _getElementName from './get-element-name';
11
11
  import VCCalculator_FY25_03 from './metric-calculator/fy25_03';
12
+ import getViewportHeight from './metric-calculator/utils/get-viewport-height';
13
+ import getViewportWidth from './metric-calculator/utils/get-viewport-width';
12
14
  import ViewportObserver from './viewport-observer';
13
15
  import WindowEventObserver from './window-event-observer';
14
16
  var DEFAULT_SELECTOR_CONFIG = {
@@ -111,6 +113,31 @@ var VCObserverNew = /*#__PURE__*/function () {
111
113
  (_this$viewportObserve2 = this.viewportObserver) === null || _this$viewportObserve2 === void 0 || _this$viewportObserve2.stop();
112
114
  (_this$windowEventObse2 = this.windowEventObserver) === null || _this$windowEventObse2 === void 0 || _this$windowEventObse2.stop();
113
115
  }
116
+ }, {
117
+ key: "addSSR",
118
+ value: function addSSR(ssr) {
119
+ this.entriesTimeline.push({
120
+ time: ssr,
121
+ data: {
122
+ elementName: 'SSR',
123
+ type: 'mutation:element',
124
+ rect: {
125
+ height: getViewportHeight(),
126
+ width: getViewportWidth(),
127
+ left: 0,
128
+ top: 0,
129
+ x: 0,
130
+ y: 0,
131
+ bottom: getViewportHeight(),
132
+ right: getViewportWidth(),
133
+ toJSON: function toJSON() {
134
+ return null;
135
+ }
136
+ },
137
+ visible: true
138
+ }
139
+ });
140
+ }
114
141
  }, {
115
142
  key: "getVCResult",
116
143
  value: function () {
@@ -123,11 +150,14 @@ var VCObserverNew = /*#__PURE__*/function () {
123
150
  results = [];
124
151
  this.addStartEntry(start);
125
152
  calculator_fy25_03 = new VCCalculator_FY25_03();
153
+ if (param.ssr) {
154
+ this.addSSR(param.ssr);
155
+ }
126
156
  orderedEntries = this.entriesTimeline.getOrderedEntries({
127
157
  start: start,
128
158
  stop: stop
129
159
  });
130
- _context.next = 7;
160
+ _context.next = 8;
131
161
  return calculator_fy25_03.calculate({
132
162
  orderedEntries: orderedEntries,
133
163
  startTime: start,
@@ -135,13 +165,13 @@ var VCObserverNew = /*#__PURE__*/function () {
135
165
  interactionId: interactionId,
136
166
  isPostInteraction: this.isPostInteraction
137
167
  });
138
- case 7:
168
+ case 8:
139
169
  fy25_03 = _context.sent;
140
170
  if (fy25_03) {
141
171
  results.push(fy25_03);
142
172
  }
143
173
  return _context.abrupt("return", results);
144
- case 10:
174
+ case 11:
145
175
  case "end":
146
176
  return _context.stop();
147
177
  }
@@ -74,6 +74,7 @@ export type Config = {
74
74
  readonly ssr?: boolean;
75
75
  readonly ssrWhitelist?: string[];
76
76
  readonly ssrEnablePageLayoutPlaceholder?: boolean;
77
+ readonly includeSSRInV3?: boolean;
77
78
  readonly stopVCAtInteractionFinish?: boolean;
78
79
  readonly includeSSRRatio?: boolean;
79
80
  /**
@@ -6,6 +6,7 @@ export type GetVCResultType = {
6
6
  isEventAborted: boolean;
7
7
  prefix?: string;
8
8
  ssr?: number;
9
+ includeSSRInV3?: boolean;
9
10
  vc?: VCRawDataType | null;
10
11
  experienceKey: string;
11
12
  interactionId?: string;
@@ -16,6 +16,7 @@ export default class VCObserverNew {
16
16
  startTime: DOMHighResTimeStamp;
17
17
  }): void;
18
18
  stop(): void;
19
+ addSSR(ssr: number): void;
19
20
  getVCResult(param: VCObserverGetVCResultParam): Promise<RevisionPayloadEntry[]>;
20
21
  private addStartEntry;
21
22
  private getElementName;
@@ -22,4 +22,5 @@ export type VCObserverGetVCResultParam = {
22
22
  start: number;
23
23
  stop: number;
24
24
  interactionId?: string;
25
+ ssr?: number;
25
26
  };
@@ -74,6 +74,7 @@ export type Config = {
74
74
  readonly ssr?: boolean;
75
75
  readonly ssrWhitelist?: string[];
76
76
  readonly ssrEnablePageLayoutPlaceholder?: boolean;
77
+ readonly includeSSRInV3?: boolean;
77
78
  readonly stopVCAtInteractionFinish?: boolean;
78
79
  readonly includeSSRRatio?: boolean;
79
80
  /**
@@ -6,6 +6,7 @@ export type GetVCResultType = {
6
6
  isEventAborted: boolean;
7
7
  prefix?: string;
8
8
  ssr?: number;
9
+ includeSSRInV3?: boolean;
9
10
  vc?: VCRawDataType | null;
10
11
  experienceKey: string;
11
12
  interactionId?: string;
@@ -16,6 +16,7 @@ export default class VCObserverNew {
16
16
  startTime: DOMHighResTimeStamp;
17
17
  }): void;
18
18
  stop(): void;
19
+ addSSR(ssr: number): void;
19
20
  getVCResult(param: VCObserverGetVCResultParam): Promise<RevisionPayloadEntry[]>;
20
21
  private addStartEntry;
21
22
  private getElementName;
@@ -22,4 +22,5 @@ export type VCObserverGetVCResultParam = {
22
22
  start: number;
23
23
  stop: number;
24
24
  interactionId?: string;
25
+ ssr?: number;
25
26
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "3.13.15",
3
+ "version": "3.13.17",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -157,9 +157,6 @@
157
157
  "platform_ufo_vc_observer_new_ssr_abort_listener": {
158
158
  "type": "boolean"
159
159
  },
160
- "platform_ufo_hold_cross_interaction": {
161
- "type": "boolean"
162
- },
163
160
  "platform_ufo_rev_ratios": {
164
161
  "type": "boolean"
165
162
  }