@atlaskit/react-ufo 3.13.22 → 3.13.23

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,13 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 3.13.23
4
+
5
+ ### Patch Changes
6
+
7
+ - [#173171](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/173171)
8
+ [`e60305b08b528`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e60305b08b528) -
9
+ Added fg to enable new interaction metrics in jsm portal
10
+
3
11
  ## 3.13.22
4
12
 
5
13
  ### Patch Changes
@@ -4,6 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
+ exports.CLEANUP_TIMEOUT = void 0;
7
8
  exports.getAwaitBM3TTIList = getAwaitBM3TTIList;
8
9
  exports.getCapabilityRate = getCapabilityRate;
9
10
  exports.getConfig = getConfig;
@@ -12,6 +13,7 @@ exports.getDoNotAbortActivePressInteractionOnTransition = getDoNotAbortActivePre
12
13
  exports.getEnabledVCRevisions = getEnabledVCRevisions;
13
14
  exports.getExperimentalInteractionRate = getExperimentalInteractionRate;
14
15
  exports.getInteractionRate = getInteractionRate;
16
+ exports.getInteractionTimeout = getInteractionTimeout;
15
17
  exports.getMostRecentVCRevision = getMostRecentVCRevision;
16
18
  exports.getPostInteractionRate = getPostInteractionRate;
17
19
  exports.getRemoveInteractionsUFOPrefixes = getRemoveInteractionsUFOPrefixes;
@@ -325,4 +327,24 @@ function getDoNotAbortActivePressInteractionOnTransition() {
325
327
  } catch (e) {
326
328
  return undefined;
327
329
  }
330
+ }
331
+ var CLEANUP_TIMEOUT = exports.CLEANUP_TIMEOUT = 60 * 1000;
332
+ function getInteractionTimeout(ufoName) {
333
+ try {
334
+ if (!config) {
335
+ return CLEANUP_TIMEOUT;
336
+ }
337
+ var _config10 = config,
338
+ interactionTimeout = _config10.interactionTimeout;
339
+ if (interactionTimeout != null && interactionTimeout[ufoName] != null) {
340
+ return interactionTimeout[ufoName];
341
+ }
342
+ if (interactionTimeout != null && interactionTimeout.__globalInteractionTimeout != null) {
343
+ return interactionTimeout.__globalInteractionTimeout;
344
+ } else {
345
+ return CLEANUP_TIMEOUT;
346
+ }
347
+ } catch (e) {
348
+ return CLEANUP_TIMEOUT;
349
+ }
328
350
  }
@@ -34,7 +34,7 @@ function _getVCMetrics() {
34
34
  }
35
35
  return _context.abrupt("return", {});
36
36
  case 3:
37
- if (!(0, _platformFeatureFlags.fg)('platform_ufo_enable_interactions_vc')) {
37
+ if (!((0, _platformFeatureFlags.fg)('platform_ufo_enable_interactions_vc') || (0, _platformFeatureFlags.fg)('platform_ufo_enable_interactivity_jsm'))) {
38
38
  _context.next = 8;
39
39
  break;
40
40
  }
@@ -758,10 +758,10 @@ function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelS
758
758
  postInteractionLog.reset();
759
759
  }
760
760
  var previousTime = startTime;
761
- var timeoutTime = CLEANUP_TIMEOUT;
761
+ var timeoutTime = (0, _platformFeatureFlags.fg)('platform_ufo_enable_timeout_config') ? (0, _config.getInteractionTimeout)(ufoName) : CLEANUP_TIMEOUT;
762
762
  var timerID = setTimeout(function () {
763
763
  abort(interactionId, 'timeout');
764
- }, CLEANUP_TIMEOUT);
764
+ }, timeoutTime);
765
765
  function changeTimeout(newTime) {
766
766
  // we compare if the time left is lower than the new time to no
767
767
  // extend the timeout beyond the initial waiting time
@@ -856,7 +856,7 @@ function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelS
856
856
  });
857
857
  }
858
858
  }
859
- if (type === 'press' && (0, _platformFeatureFlags.fg)('platform_ufo_enable_interactions_vc')) {
859
+ if (type === 'press' && ((0, _platformFeatureFlags.fg)('platform_ufo_enable_interactions_vc') || (0, _platformFeatureFlags.fg)('platform_ufo_enable_interactivity_jsm'))) {
860
860
  var _getConfig13;
861
861
  (0, _vc.getVCObserver)().start({
862
862
  startTime: startTime,
@@ -114,7 +114,7 @@ function init(analyticsWebClientAsync, config) {
114
114
  (0, _hiddenTiming.setupHiddenTimingCapture)();
115
115
  (0, _additionalPayload.startLighthouseObserver)();
116
116
  initialized = true;
117
- if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_events_observer')) {
117
+ if ((0, _platformFeatureFlags.fg)('platform_ufo_enable_events_observer') || (0, _platformFeatureFlags.fg)('platform_ufo_enable_interactivity_jsm')) {
118
118
  if (typeof PerformanceObserver !== 'undefined') {
119
119
  var observer = (0, _interactionsPerformanceObserver.getPerformanceObserver)();
120
120
  observer.observe({
@@ -313,4 +313,25 @@ export function getDoNotAbortActivePressInteractionOnTransition() {
313
313
  } catch (e) {
314
314
  return undefined;
315
315
  }
316
+ }
317
+ export const CLEANUP_TIMEOUT = 60 * 1000;
318
+ export function getInteractionTimeout(ufoName) {
319
+ try {
320
+ if (!config) {
321
+ return CLEANUP_TIMEOUT;
322
+ }
323
+ const {
324
+ interactionTimeout
325
+ } = config;
326
+ if (interactionTimeout != null && interactionTimeout[ufoName] != null) {
327
+ return interactionTimeout[ufoName];
328
+ }
329
+ if (interactionTimeout != null && interactionTimeout.__globalInteractionTimeout != null) {
330
+ return interactionTimeout.__globalInteractionTimeout;
331
+ } else {
332
+ return CLEANUP_TIMEOUT;
333
+ }
334
+ } catch (e) {
335
+ return CLEANUP_TIMEOUT;
336
+ }
316
337
  }
@@ -11,7 +11,7 @@ async function getVCMetrics(interaction) {
11
11
  if (!(config !== null && config !== void 0 && (_config$vc = config.vc) !== null && _config$vc !== void 0 && _config$vc.enabled)) {
12
12
  return {};
13
13
  }
14
- if (fg('platform_ufo_enable_interactions_vc')) {
14
+ if (fg('platform_ufo_enable_interactions_vc') || fg('platform_ufo_enable_interactivity_jsm')) {
15
15
  if (interaction.type !== 'page_load' && interaction.type !== 'transition' && interaction.type !== 'press') {
16
16
  return {};
17
17
  }
@@ -1,7 +1,7 @@
1
1
  import { v4 as createUUID } from 'uuid';
2
2
  import { fg } from '@atlaskit/platform-feature-flags';
3
3
  import coinflip from '../coinflip';
4
- import { getAwaitBM3TTIList, getCapabilityRate, getConfig } from '../config';
4
+ import { getAwaitBM3TTIList, getCapabilityRate, getConfig, getInteractionTimeout } from '../config';
5
5
  import { experimentalVC, getExperimentalVCMetrics, onExperimentalInteractionComplete } from '../create-experimental-interaction-metrics-payload';
6
6
  import { clearActiveTrace } from '../experience-trace-id-context';
7
7
  import { allFeatureFlagsAccessed, currentFeatureFlagsAccessed } from '../feature-flags-accessed';
@@ -634,10 +634,10 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
634
634
  postInteractionLog.reset();
635
635
  }
636
636
  let previousTime = startTime;
637
- let timeoutTime = CLEANUP_TIMEOUT;
637
+ let timeoutTime = fg('platform_ufo_enable_timeout_config') ? getInteractionTimeout(ufoName) : CLEANUP_TIMEOUT;
638
638
  const timerID = setTimeout(() => {
639
639
  abort(interactionId, 'timeout');
640
- }, CLEANUP_TIMEOUT);
640
+ }, timeoutTime);
641
641
  function changeTimeout(newTime) {
642
642
  // we compare if the time left is lower than the new time to no
643
643
  // extend the timeout beyond the initial waiting time
@@ -732,7 +732,7 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
732
732
  });
733
733
  }
734
734
  }
735
- if (type === 'press' && fg('platform_ufo_enable_interactions_vc')) {
735
+ if (type === 'press' && (fg('platform_ufo_enable_interactions_vc') || fg('platform_ufo_enable_interactivity_jsm'))) {
736
736
  var _getConfig13, _getConfig13$experime;
737
737
  getVCObserver().start({
738
738
  startTime,
@@ -104,7 +104,7 @@ export function init(analyticsWebClientAsync, config) {
104
104
  setupHiddenTimingCapture();
105
105
  startLighthouseObserver();
106
106
  initialized = true;
107
- if (fg('platform_ufo_enable_events_observer')) {
107
+ if (fg('platform_ufo_enable_events_observer') || fg('platform_ufo_enable_interactivity_jsm')) {
108
108
  if (typeof PerformanceObserver !== 'undefined') {
109
109
  const observer = getPerformanceObserver();
110
110
  observer.observe({
@@ -303,4 +303,24 @@ export function getDoNotAbortActivePressInteractionOnTransition() {
303
303
  } catch (e) {
304
304
  return undefined;
305
305
  }
306
+ }
307
+ export var CLEANUP_TIMEOUT = 60 * 1000;
308
+ export function getInteractionTimeout(ufoName) {
309
+ try {
310
+ if (!config) {
311
+ return CLEANUP_TIMEOUT;
312
+ }
313
+ var _config10 = config,
314
+ interactionTimeout = _config10.interactionTimeout;
315
+ if (interactionTimeout != null && interactionTimeout[ufoName] != null) {
316
+ return interactionTimeout[ufoName];
317
+ }
318
+ if (interactionTimeout != null && interactionTimeout.__globalInteractionTimeout != null) {
319
+ return interactionTimeout.__globalInteractionTimeout;
320
+ } else {
321
+ return CLEANUP_TIMEOUT;
322
+ }
323
+ } catch (e) {
324
+ return CLEANUP_TIMEOUT;
325
+ }
306
326
  }
@@ -27,7 +27,7 @@ function _getVCMetrics() {
27
27
  }
28
28
  return _context.abrupt("return", {});
29
29
  case 3:
30
- if (!fg('platform_ufo_enable_interactions_vc')) {
30
+ if (!(fg('platform_ufo_enable_interactions_vc') || fg('platform_ufo_enable_interactivity_jsm'))) {
31
31
  _context.next = 8;
32
32
  break;
33
33
  }
@@ -11,7 +11,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
11
11
  import { v4 as createUUID } from 'uuid';
12
12
  import { fg } from '@atlaskit/platform-feature-flags';
13
13
  import coinflip from '../coinflip';
14
- import { getAwaitBM3TTIList, getCapabilityRate, getConfig } from '../config';
14
+ import { getAwaitBM3TTIList, getCapabilityRate, getConfig, getInteractionTimeout } from '../config';
15
15
  import { experimentalVC, getExperimentalVCMetrics, onExperimentalInteractionComplete } from '../create-experimental-interaction-metrics-payload';
16
16
  import { clearActiveTrace } from '../experience-trace-id-context';
17
17
  import { allFeatureFlagsAccessed, currentFeatureFlagsAccessed } from '../feature-flags-accessed';
@@ -713,10 +713,10 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
713
713
  postInteractionLog.reset();
714
714
  }
715
715
  var previousTime = startTime;
716
- var timeoutTime = CLEANUP_TIMEOUT;
716
+ var timeoutTime = fg('platform_ufo_enable_timeout_config') ? getInteractionTimeout(ufoName) : CLEANUP_TIMEOUT;
717
717
  var timerID = setTimeout(function () {
718
718
  abort(interactionId, 'timeout');
719
- }, CLEANUP_TIMEOUT);
719
+ }, timeoutTime);
720
720
  function changeTimeout(newTime) {
721
721
  // we compare if the time left is lower than the new time to no
722
722
  // extend the timeout beyond the initial waiting time
@@ -811,7 +811,7 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
811
811
  });
812
812
  }
813
813
  }
814
- if (type === 'press' && fg('platform_ufo_enable_interactions_vc')) {
814
+ if (type === 'press' && (fg('platform_ufo_enable_interactions_vc') || fg('platform_ufo_enable_interactivity_jsm'))) {
815
815
  var _getConfig13;
816
816
  getVCObserver().start({
817
817
  startTime: startTime,
@@ -105,7 +105,7 @@ export function init(analyticsWebClientAsync, config) {
105
105
  setupHiddenTimingCapture();
106
106
  startLighthouseObserver();
107
107
  initialized = true;
108
- if (fg('platform_ufo_enable_events_observer')) {
108
+ if (fg('platform_ufo_enable_events_observer') || fg('platform_ufo_enable_interactivity_jsm')) {
109
109
  if (typeof PerformanceObserver !== 'undefined') {
110
110
  var observer = getPerformanceObserver();
111
111
  observer.observe({
@@ -30,6 +30,7 @@ type Rates = {
30
30
  type TTVCRevisions = 'fy25.01' | 'fy25.02' | 'fy25.03';
31
31
  export type Config = {
32
32
  readonly enabled?: boolean;
33
+ readonly interactionTimeout?: Record<string, number>;
33
34
  readonly doNotAbortActivePressInteraction?: string[];
34
35
  readonly doNotAbortActivePressInteractionOnTransition?: string[];
35
36
  readonly awaitBM3TTI?: string[];
@@ -132,4 +133,6 @@ export declare function getRemoveInteractionsUFOPrefixes(): boolean;
132
133
  export declare function getUfoNameOverrides(): UFONameOverride | undefined;
133
134
  export declare function getDoNotAbortActivePressInteraction(): string[] | undefined;
134
135
  export declare function getDoNotAbortActivePressInteractionOnTransition(): string[] | undefined;
136
+ export declare const CLEANUP_TIMEOUT: number;
137
+ export declare function getInteractionTimeout(ufoName: string): number;
135
138
  export {};
@@ -1,7 +1,7 @@
1
1
  import { type UnbindFn } from 'bind-event-listener';
2
2
  import type { ComponentsLogType, VCAbortReasonType, VCEntryType, VCIgnoreReason, VCRatioType, VCRawDataType, VCResult } from '../../common/vc/types';
3
3
  import type { GetVCResultType, VCObserverInterface, VCObserverOptions } from '../types';
4
- import { VCRevisionDebugDetails } from './getVCRevisionDebugDetails';
4
+ import { type VCRevisionDebugDetails } from './getVCRevisionDebugDetails';
5
5
  import { Observers } from './observers';
6
6
  declare global {
7
7
  interface Window {
@@ -21,7 +21,7 @@ export declare class SSRPlaceholderHandlers {
21
21
  private EQUALITY_THRESHOLD;
22
22
  private enablePageLayoutPlaceholder;
23
23
  private disableSizeAndPositionCheck;
24
- constructor({ enablePageLayoutPlaceholder, disableSizeAndPositionCheck }: SSRPlaceholderHandlersConfig);
24
+ constructor({ enablePageLayoutPlaceholder, disableSizeAndPositionCheck, }: SSRPlaceholderHandlersConfig);
25
25
  private getPlaceholderId;
26
26
  private getPlaceholderReplacementId;
27
27
  clear(): void;
@@ -1,5 +1,5 @@
1
1
  import type { RevisionPayloadEntry, VCAbortReason } from '../../../common/vc/types';
2
- import { VCRevisionDebugDetails } from '../../vc-observer/getVCRevisionDebugDetails';
2
+ import type { VCRevisionDebugDetails } from '../../vc-observer/getVCRevisionDebugDetails';
3
3
  import type { VCObserverEntry } from '../types';
4
4
  import type { VCCalculator, VCCalculatorParam } from './types';
5
5
  declare global {
@@ -30,6 +30,7 @@ type Rates = {
30
30
  type TTVCRevisions = 'fy25.01' | 'fy25.02' | 'fy25.03';
31
31
  export type Config = {
32
32
  readonly enabled?: boolean;
33
+ readonly interactionTimeout?: Record<string, number>;
33
34
  readonly doNotAbortActivePressInteraction?: string[];
34
35
  readonly doNotAbortActivePressInteractionOnTransition?: string[];
35
36
  readonly awaitBM3TTI?: string[];
@@ -136,4 +137,6 @@ export declare function getRemoveInteractionsUFOPrefixes(): boolean;
136
137
  export declare function getUfoNameOverrides(): UFONameOverride | undefined;
137
138
  export declare function getDoNotAbortActivePressInteraction(): string[] | undefined;
138
139
  export declare function getDoNotAbortActivePressInteractionOnTransition(): string[] | undefined;
140
+ export declare const CLEANUP_TIMEOUT: number;
141
+ export declare function getInteractionTimeout(ufoName: string): number;
139
142
  export {};
@@ -1,7 +1,7 @@
1
1
  import { type UnbindFn } from 'bind-event-listener';
2
2
  import type { ComponentsLogType, VCAbortReasonType, VCEntryType, VCIgnoreReason, VCRatioType, VCRawDataType, VCResult } from '../../common/vc/types';
3
3
  import type { GetVCResultType, VCObserverInterface, VCObserverOptions } from '../types';
4
- import { VCRevisionDebugDetails } from './getVCRevisionDebugDetails';
4
+ import { type VCRevisionDebugDetails } from './getVCRevisionDebugDetails';
5
5
  import { Observers } from './observers';
6
6
  declare global {
7
7
  interface Window {
@@ -21,7 +21,7 @@ export declare class SSRPlaceholderHandlers {
21
21
  private EQUALITY_THRESHOLD;
22
22
  private enablePageLayoutPlaceholder;
23
23
  private disableSizeAndPositionCheck;
24
- constructor({ enablePageLayoutPlaceholder, disableSizeAndPositionCheck }: SSRPlaceholderHandlersConfig);
24
+ constructor({ enablePageLayoutPlaceholder, disableSizeAndPositionCheck, }: SSRPlaceholderHandlersConfig);
25
25
  private getPlaceholderId;
26
26
  private getPlaceholderReplacementId;
27
27
  clear(): void;
@@ -1,5 +1,5 @@
1
1
  import type { RevisionPayloadEntry, VCAbortReason } from '../../../common/vc/types';
2
- import { VCRevisionDebugDetails } from '../../vc-observer/getVCRevisionDebugDetails';
2
+ import type { VCRevisionDebugDetails } from '../../vc-observer/getVCRevisionDebugDetails';
3
3
  import type { VCObserverEntry } from '../types';
4
4
  import type { VCCalculator, VCCalculatorParam } from './types';
5
5
  declare global {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "3.13.22",
3
+ "version": "3.13.23",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -174,6 +174,12 @@
174
174
  },
175
175
  "platform_ufo_enable_interactions_vc": {
176
176
  "type": "boolean"
177
+ },
178
+ "platform_ufo_enable_timeout_config": {
179
+ "type": "boolean"
180
+ },
181
+ "platform_ufo_enable_interactivity_jsm": {
182
+ "type": "boolean"
177
183
  }
178
184
  }
179
185
  }