@atlaskit/react-ufo 4.7.3 → 4.7.4
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 +7 -0
- package/dist/cjs/config/index.js +17 -2
- package/dist/cjs/interaction-metrics/index.js +8 -2
- package/dist/es2019/config/index.js +15 -0
- package/dist/es2019/interaction-metrics/index.js +9 -3
- package/dist/esm/config/index.js +16 -2
- package/dist/esm/interaction-metrics/index.js +9 -3
- package/dist/types/config/index.d.ts +2 -0
- package/dist/types-ts4.5/config/index.d.ts +2 -0
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 4.7.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`5c0461336c286`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5c0461336c286) -
|
|
8
|
+
Add config to set finish on transition
|
|
9
|
+
|
|
3
10
|
## 4.7.3
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/dist/cjs/config/index.js
CHANGED
|
@@ -13,6 +13,7 @@ exports.getDoNotAbortActivePressInteractionOnTransition = getDoNotAbortActivePre
|
|
|
13
13
|
exports.getEnabledVCRevisions = getEnabledVCRevisions;
|
|
14
14
|
exports.getExperimentalInteractionRate = getExperimentalInteractionRate;
|
|
15
15
|
exports.getExtraInteractionRate = getExtraInteractionRate;
|
|
16
|
+
exports.getFinishInteractionOnTransition = getFinishInteractionOnTransition;
|
|
16
17
|
exports.getInteractionRate = getInteractionRate;
|
|
17
18
|
exports.getInteractionTimeout = getInteractionTimeout;
|
|
18
19
|
exports.getMinorInteractions = getMinorInteractions;
|
|
@@ -340,14 +341,28 @@ function getDoNotAbortActivePressInteractionOnTransition() {
|
|
|
340
341
|
return undefined;
|
|
341
342
|
}
|
|
342
343
|
}
|
|
344
|
+
|
|
345
|
+
// Contains the list of interactions that do not abort on transitions
|
|
346
|
+
function getFinishInteractionOnTransition() {
|
|
347
|
+
try {
|
|
348
|
+
if (!config) {
|
|
349
|
+
return undefined;
|
|
350
|
+
}
|
|
351
|
+
var _config1 = config,
|
|
352
|
+
finishInteractionOnTransition = _config1.finishInteractionOnTransition;
|
|
353
|
+
return finishInteractionOnTransition;
|
|
354
|
+
} catch (e) {
|
|
355
|
+
return undefined;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
343
358
|
var CLEANUP_TIMEOUT = exports.CLEANUP_TIMEOUT = 60 * 1000;
|
|
344
359
|
function getInteractionTimeout(ufoName) {
|
|
345
360
|
try {
|
|
346
361
|
if (!config) {
|
|
347
362
|
return CLEANUP_TIMEOUT;
|
|
348
363
|
}
|
|
349
|
-
var
|
|
350
|
-
interactionTimeout =
|
|
364
|
+
var _config10 = config,
|
|
365
|
+
interactionTimeout = _config10.interactionTimeout;
|
|
351
366
|
if (interactionTimeout != null && interactionTimeout[ufoName] != null) {
|
|
352
367
|
return interactionTimeout[ufoName];
|
|
353
368
|
}
|
|
@@ -960,9 +960,15 @@ function abortByNewInteraction(interactionId, interactionName) {
|
|
|
960
960
|
}
|
|
961
961
|
}
|
|
962
962
|
function abortAll(abortReason, abortedByInteractionName) {
|
|
963
|
+
var activeInteraction = getActiveInteraction();
|
|
964
|
+
var finishInteractions = (0, _config.getFinishInteractionOnTransition)();
|
|
963
965
|
_constants.interactions.forEach(function (interaction, interactionId) {
|
|
964
|
-
var
|
|
965
|
-
|
|
966
|
+
var isActiveInteraction = activeInteraction === interaction;
|
|
967
|
+
var hasFinished = interaction.holdActive.size === 0;
|
|
968
|
+
if (isActiveInteraction && abortReason === 'transition' && interaction.type === 'press' && finishInteractions !== null && finishInteractions !== void 0 && finishInteractions.includes(interaction.ufoName) && (0, _platformFeatureFlags.fg)('platform_ufo_enable_finish_interaction_transition')) {
|
|
969
|
+
hasFinished = true;
|
|
970
|
+
}
|
|
971
|
+
if (!hasFinished) {
|
|
966
972
|
callCancelCallbacks(interaction);
|
|
967
973
|
interaction.abortReason = abortReason;
|
|
968
974
|
if (abortedByInteractionName != null) {
|
|
@@ -323,6 +323,21 @@ export function getDoNotAbortActivePressInteractionOnTransition() {
|
|
|
323
323
|
return undefined;
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
|
+
|
|
327
|
+
// Contains the list of interactions that do not abort on transitions
|
|
328
|
+
export function getFinishInteractionOnTransition() {
|
|
329
|
+
try {
|
|
330
|
+
if (!config) {
|
|
331
|
+
return undefined;
|
|
332
|
+
}
|
|
333
|
+
const {
|
|
334
|
+
finishInteractionOnTransition
|
|
335
|
+
} = config;
|
|
336
|
+
return finishInteractionOnTransition;
|
|
337
|
+
} catch (e) {
|
|
338
|
+
return undefined;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
326
341
|
export const CLEANUP_TIMEOUT = 60 * 1000;
|
|
327
342
|
export function getInteractionTimeout(ufoName) {
|
|
328
343
|
try {
|
|
@@ -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, getExperimentalInteractionRate, getExtraInteractionRate, getInteractionTimeout, getPostInteractionRate, getReactHydrationStats } from '../config';
|
|
4
|
+
import { getAwaitBM3TTIList, getCapabilityRate, getConfig, getExperimentalInteractionRate, getExtraInteractionRate, getFinishInteractionOnTransition, getInteractionTimeout, getPostInteractionRate, getReactHydrationStats } from '../config';
|
|
5
5
|
import { experimentalVC, getExperimentalVCMetrics, onExperimentalInteractionComplete } from '../create-experimental-interaction-metrics-payload';
|
|
6
6
|
import { sanitizeUfoName, stringifyLabelStackFully } from '../create-payload/common/utils';
|
|
7
7
|
import { clearActiveTrace } from '../experience-trace-id-context';
|
|
@@ -839,9 +839,15 @@ export function abortByNewInteraction(interactionId, interactionName) {
|
|
|
839
839
|
}
|
|
840
840
|
}
|
|
841
841
|
export function abortAll(abortReason, abortedByInteractionName) {
|
|
842
|
+
const activeInteraction = getActiveInteraction();
|
|
843
|
+
const finishInteractions = getFinishInteractionOnTransition();
|
|
842
844
|
interactions.forEach((interaction, interactionId) => {
|
|
843
|
-
const
|
|
844
|
-
|
|
845
|
+
const isActiveInteraction = activeInteraction === interaction;
|
|
846
|
+
let hasFinished = interaction.holdActive.size === 0;
|
|
847
|
+
if (isActiveInteraction && abortReason === 'transition' && interaction.type === 'press' && finishInteractions !== null && finishInteractions !== void 0 && finishInteractions.includes(interaction.ufoName) && fg('platform_ufo_enable_finish_interaction_transition')) {
|
|
848
|
+
hasFinished = true;
|
|
849
|
+
}
|
|
850
|
+
if (!hasFinished) {
|
|
845
851
|
callCancelCallbacks(interaction);
|
|
846
852
|
interaction.abortReason = abortReason;
|
|
847
853
|
if (abortedByInteractionName != null) {
|
package/dist/esm/config/index.js
CHANGED
|
@@ -315,14 +315,28 @@ export function getDoNotAbortActivePressInteractionOnTransition() {
|
|
|
315
315
|
return undefined;
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
+
|
|
319
|
+
// Contains the list of interactions that do not abort on transitions
|
|
320
|
+
export function getFinishInteractionOnTransition() {
|
|
321
|
+
try {
|
|
322
|
+
if (!config) {
|
|
323
|
+
return undefined;
|
|
324
|
+
}
|
|
325
|
+
var _config1 = config,
|
|
326
|
+
finishInteractionOnTransition = _config1.finishInteractionOnTransition;
|
|
327
|
+
return finishInteractionOnTransition;
|
|
328
|
+
} catch (e) {
|
|
329
|
+
return undefined;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
318
332
|
export var CLEANUP_TIMEOUT = 60 * 1000;
|
|
319
333
|
export function getInteractionTimeout(ufoName) {
|
|
320
334
|
try {
|
|
321
335
|
if (!config) {
|
|
322
336
|
return CLEANUP_TIMEOUT;
|
|
323
337
|
}
|
|
324
|
-
var
|
|
325
|
-
interactionTimeout =
|
|
338
|
+
var _config10 = config,
|
|
339
|
+
interactionTimeout = _config10.interactionTimeout;
|
|
326
340
|
if (interactionTimeout != null && interactionTimeout[ufoName] != null) {
|
|
327
341
|
return interactionTimeout[ufoName];
|
|
328
342
|
}
|
|
@@ -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, getExperimentalInteractionRate, getExtraInteractionRate, getInteractionTimeout, getPostInteractionRate, getReactHydrationStats } from '../config';
|
|
14
|
+
import { getAwaitBM3TTIList, getCapabilityRate, getConfig, getExperimentalInteractionRate, getExtraInteractionRate, getFinishInteractionOnTransition, getInteractionTimeout, getPostInteractionRate, getReactHydrationStats } from '../config';
|
|
15
15
|
import { experimentalVC, getExperimentalVCMetrics, onExperimentalInteractionComplete } from '../create-experimental-interaction-metrics-payload';
|
|
16
16
|
import { sanitizeUfoName, stringifyLabelStackFully } from '../create-payload/common/utils';
|
|
17
17
|
import { clearActiveTrace } from '../experience-trace-id-context';
|
|
@@ -914,9 +914,15 @@ export function abortByNewInteraction(interactionId, interactionName) {
|
|
|
914
914
|
}
|
|
915
915
|
}
|
|
916
916
|
export function abortAll(abortReason, abortedByInteractionName) {
|
|
917
|
+
var activeInteraction = getActiveInteraction();
|
|
918
|
+
var finishInteractions = getFinishInteractionOnTransition();
|
|
917
919
|
interactions.forEach(function (interaction, interactionId) {
|
|
918
|
-
var
|
|
919
|
-
|
|
920
|
+
var isActiveInteraction = activeInteraction === interaction;
|
|
921
|
+
var hasFinished = interaction.holdActive.size === 0;
|
|
922
|
+
if (isActiveInteraction && abortReason === 'transition' && interaction.type === 'press' && finishInteractions !== null && finishInteractions !== void 0 && finishInteractions.includes(interaction.ufoName) && fg('platform_ufo_enable_finish_interaction_transition')) {
|
|
923
|
+
hasFinished = true;
|
|
924
|
+
}
|
|
925
|
+
if (!hasFinished) {
|
|
920
926
|
callCancelCallbacks(interaction);
|
|
921
927
|
interaction.abortReason = abortReason;
|
|
922
928
|
if (abortedByInteractionName != null) {
|
|
@@ -62,6 +62,7 @@ export type Config = {
|
|
|
62
62
|
readonly minorInteractions?: string[];
|
|
63
63
|
readonly doNotAbortActivePressInteraction?: string[];
|
|
64
64
|
readonly doNotAbortActivePressInteractionOnTransition?: string[];
|
|
65
|
+
readonly finishInteractionOnTransition?: string[];
|
|
65
66
|
readonly awaitBM3TTI?: string[];
|
|
66
67
|
readonly ufoNameOverrides?: UFONameOverride;
|
|
67
68
|
readonly namePrefix?: string;
|
|
@@ -169,6 +170,7 @@ export declare function getUfoNameOverrides(): UFONameOverride | undefined;
|
|
|
169
170
|
export declare function getMinorInteractions(): string[] | undefined;
|
|
170
171
|
export declare function getDoNotAbortActivePressInteraction(): string[] | undefined;
|
|
171
172
|
export declare function getDoNotAbortActivePressInteractionOnTransition(): string[] | undefined;
|
|
173
|
+
export declare function getFinishInteractionOnTransition(): string[] | undefined;
|
|
172
174
|
export declare const CLEANUP_TIMEOUT: number;
|
|
173
175
|
export declare function getInteractionTimeout(ufoName: string): number;
|
|
174
176
|
export {};
|
|
@@ -62,6 +62,7 @@ export type Config = {
|
|
|
62
62
|
readonly minorInteractions?: string[];
|
|
63
63
|
readonly doNotAbortActivePressInteraction?: string[];
|
|
64
64
|
readonly doNotAbortActivePressInteractionOnTransition?: string[];
|
|
65
|
+
readonly finishInteractionOnTransition?: string[];
|
|
65
66
|
readonly awaitBM3TTI?: string[];
|
|
66
67
|
readonly ufoNameOverrides?: UFONameOverride;
|
|
67
68
|
readonly namePrefix?: string;
|
|
@@ -173,6 +174,7 @@ export declare function getUfoNameOverrides(): UFONameOverride | undefined;
|
|
|
173
174
|
export declare function getMinorInteractions(): string[] | undefined;
|
|
174
175
|
export declare function getDoNotAbortActivePressInteraction(): string[] | undefined;
|
|
175
176
|
export declare function getDoNotAbortActivePressInteractionOnTransition(): string[] | undefined;
|
|
177
|
+
export declare function getFinishInteractionOnTransition(): string[] | undefined;
|
|
176
178
|
export declare const CLEANUP_TIMEOUT: number;
|
|
177
179
|
export declare function getInteractionTimeout(ufoName: string): number;
|
|
178
180
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.4",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -148,6 +148,9 @@
|
|
|
148
148
|
},
|
|
149
149
|
"platform_ufo_enable_late_mutation_label_stacks": {
|
|
150
150
|
"type": "boolean"
|
|
151
|
+
},
|
|
152
|
+
"platform_ufo_enable_finish_interaction_transition": {
|
|
153
|
+
"type": "boolean"
|
|
151
154
|
}
|
|
152
155
|
}
|
|
153
156
|
}
|