@atlaskit/react-ufo 2.3.1 → 2.3.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.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/interaction-metrics-init/index.js +6 -2
- package/dist/cjs/vc/index.js +3 -4
- package/dist/cjs/vc/vc-observer/index.js +6 -0
- package/dist/es2019/interaction-metrics-init/index.js +6 -2
- package/dist/es2019/vc/index.js +3 -4
- package/dist/es2019/vc/vc-observer/index.js +3 -0
- package/dist/esm/interaction-metrics-init/index.js +6 -2
- package/dist/esm/vc/index.js +3 -4
- package/dist/esm/vc/vc-observer/index.js +6 -0
- package/dist/types/common/vc/types.d.ts +1 -1
- package/dist/types/vc/index.d.ts +3 -0
- package/dist/types/vc/vc-observer/index.d.ts +2 -1
- package/dist/types-ts4.5/common/vc/types.d.ts +1 -1
- package/dist/types-ts4.5/vc/index.d.ts +3 -0
- package/dist/types-ts4.5/vc/vc-observer/index.d.ts +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 2.3.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#169231](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/169231)
|
|
8
|
+
[`bf7c1455e4d57`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bf7c1455e4d57) -
|
|
9
|
+
allow for custom VC abort reasons
|
|
10
|
+
|
|
11
|
+
## 2.3.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#167556](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/167556)
|
|
16
|
+
[`63da6ebbd7549`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/63da6ebbd7549) -
|
|
17
|
+
add try catch to sessionStorage access within ufo init script
|
|
18
|
+
|
|
3
19
|
## 2.3.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -41,8 +41,12 @@ var init = exports.init = function init(analyticsWebClientAsync, config) {
|
|
|
41
41
|
if (initialized) {
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
window
|
|
44
|
+
try {
|
|
45
|
+
if (window !== undefined) {
|
|
46
|
+
window.__REACT_UFO_ENABLE_PERF_TRACING = Boolean(sessionStorage.getItem('additionalPerfMarks') === 'true');
|
|
47
|
+
}
|
|
48
|
+
} catch (err) {
|
|
49
|
+
/* do nothing */
|
|
46
50
|
}
|
|
47
51
|
(0, _config.setUFOConfig)(config);
|
|
48
52
|
if ((_config$vc = config.vc) !== null && _config$vc !== void 0 && _config$vc.enabled) {
|
package/dist/cjs/vc/index.js
CHANGED
|
@@ -5,11 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getVCObserver = void 0;
|
|
7
7
|
var _vcObserver = require("./vc-observer");
|
|
8
|
-
var instance = null;
|
|
9
8
|
var getVCObserver = exports.getVCObserver = function getVCObserver() {
|
|
10
9
|
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
11
|
-
if (
|
|
12
|
-
|
|
10
|
+
if (!globalThis.__vcObserver) {
|
|
11
|
+
globalThis.__vcObserver = new _vcObserver.VCObserver(opts);
|
|
13
12
|
}
|
|
14
|
-
return
|
|
13
|
+
return globalThis.__vcObserver;
|
|
15
14
|
};
|
|
@@ -364,6 +364,12 @@ var VCObserver = exports.VCObserver = /*#__PURE__*/function () {
|
|
|
364
364
|
var stopTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : performance.now();
|
|
365
365
|
this.observers.setReactRootRenderStop(stopTime);
|
|
366
366
|
}
|
|
367
|
+
}, {
|
|
368
|
+
key: "abortObservation",
|
|
369
|
+
value: function abortObservation() {
|
|
370
|
+
var abortReason = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'custom';
|
|
371
|
+
this.setAbortReason(abortReason, performance.now());
|
|
372
|
+
}
|
|
367
373
|
}, {
|
|
368
374
|
key: "setAbortReason",
|
|
369
375
|
value: function setAbortReason(abort, timestamp) {
|
|
@@ -30,8 +30,12 @@ export const init = (analyticsWebClientAsync, config) => {
|
|
|
30
30
|
if (initialized) {
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
window
|
|
33
|
+
try {
|
|
34
|
+
if (window !== undefined) {
|
|
35
|
+
window.__REACT_UFO_ENABLE_PERF_TRACING = Boolean(sessionStorage.getItem('additionalPerfMarks') === 'true');
|
|
36
|
+
}
|
|
37
|
+
} catch (err) {
|
|
38
|
+
/* do nothing */
|
|
35
39
|
}
|
|
36
40
|
setUFOConfig(config);
|
|
37
41
|
if ((_config$vc = config.vc) !== null && _config$vc !== void 0 && _config$vc.enabled) {
|
package/dist/es2019/vc/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { VCObserver } from './vc-observer';
|
|
2
|
-
let instance = null;
|
|
3
2
|
export const getVCObserver = (opts = {}) => {
|
|
4
|
-
if (
|
|
5
|
-
|
|
3
|
+
if (!globalThis.__vcObserver) {
|
|
4
|
+
globalThis.__vcObserver = new VCObserver(opts);
|
|
6
5
|
}
|
|
7
|
-
return
|
|
6
|
+
return globalThis.__vcObserver;
|
|
8
7
|
};
|
|
@@ -441,6 +441,9 @@ export class VCObserver {
|
|
|
441
441
|
setReactRootRenderStop(stopTime = performance.now()) {
|
|
442
442
|
this.observers.setReactRootRenderStop(stopTime);
|
|
443
443
|
}
|
|
444
|
+
abortObservation(abortReason = 'custom') {
|
|
445
|
+
this.setAbortReason(abortReason, performance.now());
|
|
446
|
+
}
|
|
444
447
|
setAbortReason(abort, timestamp, info = '') {
|
|
445
448
|
if (this.abortReason.reason === null || this.abortReason.blocking === false) {
|
|
446
449
|
this.abortReason.reason = abort;
|
|
@@ -31,8 +31,12 @@ export var init = function init(analyticsWebClientAsync, config) {
|
|
|
31
31
|
if (initialized) {
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
window
|
|
34
|
+
try {
|
|
35
|
+
if (window !== undefined) {
|
|
36
|
+
window.__REACT_UFO_ENABLE_PERF_TRACING = Boolean(sessionStorage.getItem('additionalPerfMarks') === 'true');
|
|
37
|
+
}
|
|
38
|
+
} catch (err) {
|
|
39
|
+
/* do nothing */
|
|
36
40
|
}
|
|
37
41
|
setUFOConfig(config);
|
|
38
42
|
if ((_config$vc = config.vc) !== null && _config$vc !== void 0 && _config$vc.enabled) {
|
package/dist/esm/vc/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { VCObserver } from './vc-observer';
|
|
2
|
-
var instance = null;
|
|
3
2
|
export var getVCObserver = function getVCObserver() {
|
|
4
3
|
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
5
|
-
if (
|
|
6
|
-
|
|
4
|
+
if (!globalThis.__vcObserver) {
|
|
5
|
+
globalThis.__vcObserver = new VCObserver(opts);
|
|
7
6
|
}
|
|
8
|
-
return
|
|
7
|
+
return globalThis.__vcObserver;
|
|
9
8
|
};
|
|
@@ -357,6 +357,12 @@ export var VCObserver = /*#__PURE__*/function () {
|
|
|
357
357
|
var stopTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : performance.now();
|
|
358
358
|
this.observers.setReactRootRenderStop(stopTime);
|
|
359
359
|
}
|
|
360
|
+
}, {
|
|
361
|
+
key: "abortObservation",
|
|
362
|
+
value: function abortObservation() {
|
|
363
|
+
var abortReason = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'custom';
|
|
364
|
+
this.setAbortReason(abortReason, performance.now());
|
|
365
|
+
}
|
|
360
366
|
}, {
|
|
361
367
|
key: "setAbortReason",
|
|
362
368
|
value: function setAbortReason(abort, timestamp) {
|
|
@@ -4,7 +4,7 @@ export declare const AbortEvent: {
|
|
|
4
4
|
readonly keydown: "keydown";
|
|
5
5
|
readonly resize: "resize";
|
|
6
6
|
};
|
|
7
|
-
export type VCAbortReason = 'scroll' | 'keypress' | 'resize' | 'error' | 'not-supported';
|
|
7
|
+
export type VCAbortReason = 'custom' | 'scroll' | 'keypress' | 'resize' | 'error' | 'not-supported';
|
|
8
8
|
export type VCAbortReasonType = {
|
|
9
9
|
reason: null | VCAbortReason;
|
|
10
10
|
info: string;
|
package/dist/types/vc/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type UnbindFn } from 'bind-event-listener';
|
|
2
|
-
import type { ComponentsLogType, VCAbortReasonType, VCEntryType, VCIgnoreReason, VCRatioType, VCRawDataType, VCResult } from '../../common/vc/types';
|
|
2
|
+
import type { ComponentsLogType, VCAbortReason, VCAbortReasonType, VCEntryType, VCIgnoreReason, VCRatioType, VCRawDataType, VCResult } from '../../common/vc/types';
|
|
3
3
|
import { Observers, type SelectorConfig } from './observers';
|
|
4
4
|
type GetVCResultType = {
|
|
5
5
|
start: number;
|
|
@@ -79,6 +79,7 @@ export declare class VCObserver {
|
|
|
79
79
|
setReactRootRenderStart(startTime?: number): void;
|
|
80
80
|
setReactRootRenderStop(stopTime?: number): void;
|
|
81
81
|
private handleUpdate;
|
|
82
|
+
abortObservation(abortReason?: VCAbortReason): void;
|
|
82
83
|
private setAbortReason;
|
|
83
84
|
private resetState;
|
|
84
85
|
private getCleanHeatmap;
|
|
@@ -4,7 +4,7 @@ export declare const AbortEvent: {
|
|
|
4
4
|
readonly keydown: "keydown";
|
|
5
5
|
readonly resize: "resize";
|
|
6
6
|
};
|
|
7
|
-
export type VCAbortReason = 'scroll' | 'keypress' | 'resize' | 'error' | 'not-supported';
|
|
7
|
+
export type VCAbortReason = 'custom' | 'scroll' | 'keypress' | 'resize' | 'error' | 'not-supported';
|
|
8
8
|
export type VCAbortReasonType = {
|
|
9
9
|
reason: null | VCAbortReason;
|
|
10
10
|
info: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type UnbindFn } from 'bind-event-listener';
|
|
2
|
-
import type { ComponentsLogType, VCAbortReasonType, VCEntryType, VCIgnoreReason, VCRatioType, VCRawDataType, VCResult } from '../../common/vc/types';
|
|
2
|
+
import type { ComponentsLogType, VCAbortReason, VCAbortReasonType, VCEntryType, VCIgnoreReason, VCRatioType, VCRawDataType, VCResult } from '../../common/vc/types';
|
|
3
3
|
import { Observers, type SelectorConfig } from './observers';
|
|
4
4
|
type GetVCResultType = {
|
|
5
5
|
start: number;
|
|
@@ -79,6 +79,7 @@ export declare class VCObserver {
|
|
|
79
79
|
setReactRootRenderStart(startTime?: number): void;
|
|
80
80
|
setReactRootRenderStop(stopTime?: number): void;
|
|
81
81
|
private handleUpdate;
|
|
82
|
+
abortObservation(abortReason?: VCAbortReason): void;
|
|
82
83
|
private setAbortReason;
|
|
83
84
|
private resetState;
|
|
84
85
|
private getCleanHeatmap;
|