@atlaskit/react-ufo 4.5.7 → 4.5.9

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,19 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 4.5.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7cd8d49ea4953`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7cd8d49ea4953) -
8
+ update parameters for useUFOReportError callback
9
+
10
+ ## 4.5.8
11
+
12
+ ### Patch Changes
13
+
14
+ - [`9b558aefd6806`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9b558aefd6806) -
15
+ Reset extra interaction metrics when adding new interaction
16
+
3
17
  ## 4.5.7
4
18
 
5
19
  ### Patch Changes
@@ -1019,6 +1019,7 @@ function addOnCancelCallback(id, cancelCallback) {
1019
1019
  function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelStack, routeName) {
1020
1020
  var trace = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
1021
1021
  (0, _trackDisplayContentOccurrence.resetCssIssueOccurrence)();
1022
+ interactionExtraMetrics.reset();
1022
1023
  postInteractionLog.reset();
1023
1024
  var vcObserver;
1024
1025
  var previousTime = startTime;
@@ -83,12 +83,15 @@ var InteractionExtraMetrics = exports.default = /*#__PURE__*/function () {
83
83
  }, {
84
84
  key: "reset",
85
85
  value: function reset() {
86
+ this.stopVCObserver();
87
+ if (this.finishedInteractionId) {
88
+ (0, _index.remove)(this.finishedInteractionId);
89
+ }
86
90
  this.finishedInteractionId = null;
87
91
  }
88
92
  }, {
89
93
  key: "stopAll",
90
94
  value: function stopAll(id) {
91
- this.stopVCObserver();
92
95
  (0, _index.remove)(id);
93
96
  this.reset();
94
97
  }
@@ -22,9 +22,9 @@ var _interactionMetrics = require("../interaction-metrics");
22
22
  * @returns `reportError` function
23
23
  */
24
24
  function useUFOReportError() {
25
- var interaction = (0, _interactionMetrics.getActiveInteraction)();
26
25
  var ufoContext = (0, _interactionContext.useInteractionContext)();
27
26
  var reportError = function reportError(error) {
27
+ var interaction = (0, _interactionMetrics.getActiveInteraction)();
28
28
  if (interaction !== null && interaction !== void 0 && interaction.id) {
29
29
  (0, _interactionMetrics.addError)(interaction.id, error.name, (ufoContext === null || ufoContext === void 0 ? void 0 : ufoContext.labelStack) || null, error.name, error.errorMessage, error.errorStack, error.forcedError);
30
30
  } else {
@@ -897,6 +897,7 @@ export function addOnCancelCallback(id, cancelCallback) {
897
897
  }
898
898
  export function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelStack, routeName, trace = null) {
899
899
  resetCssIssueOccurrence();
900
+ interactionExtraMetrics.reset();
900
901
  postInteractionLog.reset();
901
902
  let vcObserver;
902
903
  let previousTime = startTime;
@@ -58,10 +58,13 @@ export default class InteractionExtraMetrics {
58
58
  this.reset();
59
59
  }
60
60
  reset() {
61
+ this.stopVCObserver();
62
+ if (this.finishedInteractionId) {
63
+ remove(this.finishedInteractionId);
64
+ }
61
65
  this.finishedInteractionId = null;
62
66
  }
63
67
  stopAll(id) {
64
- this.stopVCObserver();
65
68
  remove(id);
66
69
  this.reset();
67
70
  }
@@ -17,9 +17,9 @@ import { addError, addErrorToAll, getActiveInteraction } from '../interaction-me
17
17
  * @returns `reportError` function
18
18
  */
19
19
  export function useUFOReportError() {
20
- const interaction = getActiveInteraction();
21
20
  const ufoContext = useInteractionContext();
22
21
  const reportError = error => {
22
+ const interaction = getActiveInteraction();
23
23
  if (interaction !== null && interaction !== void 0 && interaction.id) {
24
24
  addError(interaction.id, error.name, (ufoContext === null || ufoContext === void 0 ? void 0 : ufoContext.labelStack) || null, error.name, error.errorMessage, error.errorStack, error.forcedError);
25
25
  } else {
@@ -973,6 +973,7 @@ export function addOnCancelCallback(id, cancelCallback) {
973
973
  export function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelStack, routeName) {
974
974
  var trace = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
975
975
  resetCssIssueOccurrence();
976
+ interactionExtraMetrics.reset();
976
977
  postInteractionLog.reset();
977
978
  var vcObserver;
978
979
  var previousTime = startTime;
@@ -76,12 +76,15 @@ var InteractionExtraMetrics = /*#__PURE__*/function () {
76
76
  }, {
77
77
  key: "reset",
78
78
  value: function reset() {
79
+ this.stopVCObserver();
80
+ if (this.finishedInteractionId) {
81
+ remove(this.finishedInteractionId);
82
+ }
79
83
  this.finishedInteractionId = null;
80
84
  }
81
85
  }, {
82
86
  key: "stopAll",
83
87
  value: function stopAll(id) {
84
- this.stopVCObserver();
85
88
  remove(id);
86
89
  this.reset();
87
90
  }
@@ -17,9 +17,9 @@ import { addError, addErrorToAll, getActiveInteraction } from '../interaction-me
17
17
  * @returns `reportError` function
18
18
  */
19
19
  export function useUFOReportError() {
20
- var interaction = getActiveInteraction();
21
20
  var ufoContext = useInteractionContext();
22
21
  var reportError = function reportError(error) {
22
+ var interaction = getActiveInteraction();
23
23
  if (interaction !== null && interaction !== void 0 && interaction.id) {
24
24
  addError(interaction.id, error.name, (ufoContext === null || ufoContext === void 0 ? void 0 : ufoContext.labelStack) || null, error.name, error.errorMessage, error.errorStack, error.forcedError);
25
25
  } else {
@@ -14,4 +14,4 @@ import { type InteractionError } from '../interaction-metrics';
14
14
  * ```
15
15
  * @returns `reportError` function
16
16
  */
17
- export declare function useUFOReportError(): (error: InteractionError) => void;
17
+ export declare function useUFOReportError(): (error: Omit<InteractionError, "labelStack" | "errorType">) => void;
@@ -14,4 +14,4 @@ import { type InteractionError } from '../interaction-metrics';
14
14
  * ```
15
15
  * @returns `reportError` function
16
16
  */
17
- export declare function useUFOReportError(): (error: InteractionError) => void;
17
+ export declare function useUFOReportError(): (error: Omit<InteractionError, "labelStack" | "errorType">) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "4.5.7",
3
+ "version": "4.5.9",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",