@atlaskit/react-ufo 2.14.3 → 2.16.0
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 +20 -0
- package/dist/cjs/assets/index.js +96 -0
- package/dist/cjs/assets/utils.js +32 -0
- package/dist/cjs/common/assets/types.js +5 -0
- package/dist/cjs/create-payload/index.js +42 -5
- package/dist/cjs/experience-trace-id-context/index.js +5 -1
- package/dist/cjs/segment/segment.js +7 -1
- package/dist/cjs/vc/vc-observer/heatmap/heatmap.js +264 -0
- package/dist/cjs/vc/vc-observer/index.js +119 -26
- package/dist/cjs/vc/vc-observer/revisions/ViewportUpdateClassifier.js +60 -0
- package/dist/cjs/vc/vc-observer/revisions/fy24_01.js +71 -0
- package/dist/cjs/vc/vc-observer/revisions/fy25_01.js +39 -0
- package/dist/cjs/vc/vc-observer/revisions/revisions.js +23 -0
- package/dist/cjs/vc/vc-observer/revisions/types.js +5 -0
- package/dist/es2019/assets/index.js +82 -0
- package/dist/es2019/assets/utils.js +26 -0
- package/dist/es2019/common/assets/types.js +1 -0
- package/dist/es2019/create-payload/index.js +43 -3
- package/dist/es2019/experience-trace-id-context/index.js +4 -0
- package/dist/es2019/segment/segment.js +11 -3
- package/dist/es2019/vc/vc-observer/heatmap/heatmap.js +230 -0
- package/dist/es2019/vc/vc-observer/index.js +97 -3
- package/dist/es2019/vc/vc-observer/revisions/ViewportUpdateClassifier.js +41 -0
- package/dist/es2019/vc/vc-observer/revisions/fy24_01.js +50 -0
- package/dist/es2019/vc/vc-observer/revisions/fy25_01.js +21 -0
- package/dist/es2019/vc/vc-observer/revisions/revisions.js +19 -0
- package/dist/es2019/vc/vc-observer/revisions/types.js +1 -0
- package/dist/esm/assets/index.js +89 -0
- package/dist/esm/assets/utils.js +26 -0
- package/dist/esm/common/assets/types.js +1 -0
- package/dist/esm/create-payload/index.js +42 -5
- package/dist/esm/experience-trace-id-context/index.js +4 -0
- package/dist/esm/segment/segment.js +7 -1
- package/dist/esm/vc/vc-observer/heatmap/heatmap.js +257 -0
- package/dist/esm/vc/vc-observer/index.js +119 -26
- package/dist/esm/vc/vc-observer/revisions/ViewportUpdateClassifier.js +53 -0
- package/dist/esm/vc/vc-observer/revisions/fy24_01.js +64 -0
- package/dist/esm/vc/vc-observer/revisions/fy25_01.js +32 -0
- package/dist/esm/vc/vc-observer/revisions/revisions.js +17 -0
- package/dist/esm/vc/vc-observer/revisions/types.js +1 -0
- package/dist/types/assets/index.d.ts +25 -0
- package/dist/types/assets/utils.d.ts +6 -0
- package/dist/types/common/assets/types.d.ts +18 -0
- package/dist/types/common/index.d.ts +1 -0
- package/dist/types/common/vc/types.d.ts +27 -8
- package/dist/types/config/index.d.ts +2 -1
- package/dist/types/create-payload/index.d.ts +11616 -0
- package/dist/types/experience-trace-id-context/index.d.ts +1 -0
- package/dist/types/resource-timing/index.d.ts +1 -1
- package/dist/types/vc/vc-observer/heatmap/heatmap.d.ts +72 -0
- package/dist/types/vc/vc-observer/index.d.ts +5 -1
- package/dist/types/vc/vc-observer/revisions/ViewportUpdateClassifier.d.ts +30 -0
- package/dist/types/vc/vc-observer/revisions/fy24_01.d.ts +13 -0
- package/dist/types/vc/vc-observer/revisions/fy25_01.d.ts +13 -0
- package/dist/types/vc/vc-observer/revisions/revisions.d.ts +2 -0
- package/dist/types/vc/vc-observer/revisions/types.d.ts +23 -0
- package/dist/types-ts4.5/assets/index.d.ts +25 -0
- package/dist/types-ts4.5/assets/utils.d.ts +6 -0
- package/dist/types-ts4.5/common/assets/types.d.ts +18 -0
- package/dist/types-ts4.5/common/index.d.ts +1 -0
- package/dist/types-ts4.5/common/vc/types.d.ts +27 -8
- package/dist/types-ts4.5/config/index.d.ts +2 -1
- package/dist/types-ts4.5/create-payload/index.d.ts +11616 -0
- package/dist/types-ts4.5/experience-trace-id-context/index.d.ts +1 -0
- package/dist/types-ts4.5/resource-timing/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer/heatmap/heatmap.d.ts +72 -0
- package/dist/types-ts4.5/vc/vc-observer/index.d.ts +15 -1
- package/dist/types-ts4.5/vc/vc-observer/revisions/ViewportUpdateClassifier.d.ts +30 -0
- package/dist/types-ts4.5/vc/vc-observer/revisions/fy24_01.d.ts +13 -0
- package/dist/types-ts4.5/vc/vc-observer/revisions/fy25_01.d.ts +13 -0
- package/dist/types-ts4.5/vc/vc-observer/revisions/revisions.d.ts +2 -0
- package/dist/types-ts4.5/vc/vc-observer/revisions/types.d.ts +23 -0
- package/package.json +11 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { ResourceTimings } from './common/types';
|
|
1
|
+
export type { ResourceTiming, ResourceTimings } from './common/types';
|
|
2
2
|
export { configure } from './common/utils/config';
|
|
3
3
|
export { getResourceTimings } from './main';
|
|
4
4
|
export { startResourceTimingBuffer } from './utils';
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { ComponentsLogType, MultiHeatmapPayload, VCEntryType, VCIgnoreReason, VCRatioType } from '../../../common/vc/types';
|
|
2
|
+
import type { ObservedMutationType } from '../observers/types';
|
|
3
|
+
import type { RevisionEntry, VCCalculationMethodType } from '../revisions/types';
|
|
4
|
+
type Viewport = {
|
|
5
|
+
w: number;
|
|
6
|
+
h: number;
|
|
7
|
+
};
|
|
8
|
+
type ArraySize = {
|
|
9
|
+
w: number;
|
|
10
|
+
h: number;
|
|
11
|
+
};
|
|
12
|
+
type HeatmapAttrs = {
|
|
13
|
+
viewport: Viewport;
|
|
14
|
+
revisions: RevisionEntry[];
|
|
15
|
+
arraySize?: ArraySize;
|
|
16
|
+
devToolsEnabled?: boolean;
|
|
17
|
+
};
|
|
18
|
+
type Heatmap = Uint32Array;
|
|
19
|
+
type ProcessDataArgs = {
|
|
20
|
+
VCParts: number[];
|
|
21
|
+
VCCalculationMethods: VCCalculationMethodType[];
|
|
22
|
+
clean: boolean;
|
|
23
|
+
ssr?: number;
|
|
24
|
+
};
|
|
25
|
+
type PerRevision<T> = T[];
|
|
26
|
+
export type ApplyChangesError = {
|
|
27
|
+
error: string;
|
|
28
|
+
time: number;
|
|
29
|
+
};
|
|
30
|
+
export type HandleUpdateArgs = {
|
|
31
|
+
time: number;
|
|
32
|
+
type: ObservedMutationType;
|
|
33
|
+
classification: boolean[];
|
|
34
|
+
intersectionRect: DOMRectReadOnly;
|
|
35
|
+
element: HTMLElement;
|
|
36
|
+
targetName: string;
|
|
37
|
+
ignoreReason?: VCIgnoreReason;
|
|
38
|
+
onError: (error: ApplyChangesError) => void;
|
|
39
|
+
};
|
|
40
|
+
export declare class MultiRevisionHeatmap {
|
|
41
|
+
viewport: Viewport;
|
|
42
|
+
arraySize: ArraySize;
|
|
43
|
+
revisions: RevisionEntry[];
|
|
44
|
+
heatmaps: Heatmap[];
|
|
45
|
+
devToolsEnabled: boolean;
|
|
46
|
+
vcRatios: PerRevision<VCRatioType>;
|
|
47
|
+
componentsLogs: PerRevision<ComponentsLogType>;
|
|
48
|
+
constructor({ viewport, revisions, arraySize, devToolsEnabled }: HeatmapAttrs);
|
|
49
|
+
handleUpdate({ time, type, classification, intersectionRect, element, targetName, ignoreReason, onError, }: HandleUpdateArgs): void;
|
|
50
|
+
getData(): {
|
|
51
|
+
heatmaps: Uint32Array[];
|
|
52
|
+
};
|
|
53
|
+
getPayloadShapedData(args: ProcessDataArgs): MultiHeatmapPayload;
|
|
54
|
+
processData({ VCParts, VCCalculationMethods, ssr }: ProcessDataArgs): {
|
|
55
|
+
VC: import("../revisions/types").VCType;
|
|
56
|
+
VCBox: import("../revisions/types").VCBoxType;
|
|
57
|
+
VCEntries: {
|
|
58
|
+
abs: number[][];
|
|
59
|
+
rel: VCEntryType[];
|
|
60
|
+
};
|
|
61
|
+
totalPainted: number;
|
|
62
|
+
}[];
|
|
63
|
+
private mapPixelsToHeatmap;
|
|
64
|
+
private getElementRatio;
|
|
65
|
+
private applyChangesToHeatMap;
|
|
66
|
+
private getIndex;
|
|
67
|
+
private getCleanHeatmap;
|
|
68
|
+
static makeVCReturnObj<T>(VCParts: number[]): {
|
|
69
|
+
[key: string]: T | null;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type UnbindFn } from 'bind-event-listener';
|
|
2
2
|
import type { ComponentsLogType, VCAbortReason, VCAbortReasonType, VCEntryType, VCIgnoreReason, VCRatioType, VCRawDataType, VCResult } from '../../common/vc/types';
|
|
3
|
+
import { MultiRevisionHeatmap } from './heatmap/heatmap';
|
|
3
4
|
import { Observers, type SelectorConfig } from './observers';
|
|
4
5
|
type GetVCResultType = {
|
|
5
6
|
start: number;
|
|
@@ -20,7 +21,17 @@ export declare class VCObserver {
|
|
|
20
21
|
abortReason: VCAbortReasonType;
|
|
21
22
|
outOfBoundaryInfo: string;
|
|
22
23
|
/** config * */
|
|
23
|
-
static VCParts:
|
|
24
|
+
static VCParts: readonly [
|
|
25
|
+
"25",
|
|
26
|
+
"50",
|
|
27
|
+
"75",
|
|
28
|
+
"80",
|
|
29
|
+
"85",
|
|
30
|
+
"90",
|
|
31
|
+
"95",
|
|
32
|
+
"98",
|
|
33
|
+
"99"
|
|
34
|
+
];
|
|
24
35
|
viewport: {
|
|
25
36
|
w: number;
|
|
26
37
|
h: number;
|
|
@@ -28,6 +39,7 @@ export declare class VCObserver {
|
|
|
28
39
|
arraySize: number;
|
|
29
40
|
heatmap: number[][];
|
|
30
41
|
heatmapNext: number[][];
|
|
42
|
+
multiHeatmap: MultiRevisionHeatmap | null;
|
|
31
43
|
componentsLog: ComponentsLogType;
|
|
32
44
|
vcRatios: VCRatioType;
|
|
33
45
|
active: boolean;
|
|
@@ -80,6 +92,8 @@ export declare class VCObserver {
|
|
|
80
92
|
setReactRootRenderStart(startTime?: number): void;
|
|
81
93
|
setReactRootRenderStop(stopTime?: number): void;
|
|
82
94
|
private handleUpdate;
|
|
95
|
+
private legacyHandleUpdate;
|
|
96
|
+
private onViewportChangeDetected;
|
|
83
97
|
abortObservation(abortReason?: VCAbortReason): void;
|
|
84
98
|
private setAbortReason;
|
|
85
99
|
private resetState;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { VCCalculationMethodArgs } from './types';
|
|
2
|
+
export type FilterArgs = {
|
|
3
|
+
type: string;
|
|
4
|
+
tags?: string[];
|
|
5
|
+
ignoreReason?: string;
|
|
6
|
+
};
|
|
7
|
+
type Filter = {
|
|
8
|
+
name: string;
|
|
9
|
+
filter: (args: FilterArgs) => boolean;
|
|
10
|
+
};
|
|
11
|
+
type ClassifyUpdateArgs = {
|
|
12
|
+
element: HTMLElement;
|
|
13
|
+
type: string;
|
|
14
|
+
tags?: string[];
|
|
15
|
+
ignoreReason?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare class ViewportUpdateClassifier {
|
|
18
|
+
types: string[];
|
|
19
|
+
filters: Filter[];
|
|
20
|
+
removedFilters: string[];
|
|
21
|
+
VCCalculationMethod(_: VCCalculationMethodArgs): {
|
|
22
|
+
VC: {};
|
|
23
|
+
VCBox: {};
|
|
24
|
+
};
|
|
25
|
+
protected __combinedTypes: string[];
|
|
26
|
+
protected __combinedFilters: Filter[];
|
|
27
|
+
mergeConfig(): void;
|
|
28
|
+
classifyUpdate({ element, type, tags, ignoreReason }: ClassifyUpdateArgs): boolean;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { VCCalculationMethodArgs, VCCalculationMethodReturn } from './types';
|
|
2
|
+
import { type FilterArgs, ViewportUpdateClassifier } from './ViewportUpdateClassifier';
|
|
3
|
+
export declare class FY24_01Classifier extends ViewportUpdateClassifier {
|
|
4
|
+
revision: string;
|
|
5
|
+
types: string[];
|
|
6
|
+
filters: {
|
|
7
|
+
name: string;
|
|
8
|
+
filter: ({ type, ignoreReason }: FilterArgs) => boolean;
|
|
9
|
+
}[];
|
|
10
|
+
VCCalculationMethod({ VCParts, entries, totalPainted, componentsLog, }: VCCalculationMethodArgs): VCCalculationMethodReturn;
|
|
11
|
+
constructor();
|
|
12
|
+
}
|
|
13
|
+
export declare const revFY24_01Classifier: FY24_01Classifier;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FY24_01Classifier } from './fy24_01';
|
|
2
|
+
import { type FilterArgs } from './ViewportUpdateClassifier';
|
|
3
|
+
export declare class FY25_01Classifier extends FY24_01Classifier {
|
|
4
|
+
revision: string;
|
|
5
|
+
types: string[];
|
|
6
|
+
filters: {
|
|
7
|
+
name: string;
|
|
8
|
+
filter: ({ type, ignoreReason }: FilterArgs) => boolean;
|
|
9
|
+
}[];
|
|
10
|
+
removedFilters: never[];
|
|
11
|
+
constructor();
|
|
12
|
+
}
|
|
13
|
+
export declare const revFY25_01Classifier: FY25_01Classifier;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ComponentsLogType } from '../../../common/vc/types';
|
|
2
|
+
import { ViewportUpdateClassifier } from './ViewportUpdateClassifier';
|
|
3
|
+
export type RevisionEntry = {
|
|
4
|
+
name: string;
|
|
5
|
+
classifier: ViewportUpdateClassifier;
|
|
6
|
+
};
|
|
7
|
+
export type VCType = {
|
|
8
|
+
[key: string]: number | null;
|
|
9
|
+
};
|
|
10
|
+
export type VCBoxType = {
|
|
11
|
+
[key: string]: null | Set<string>;
|
|
12
|
+
};
|
|
13
|
+
export type VCCalculationMethodArgs = {
|
|
14
|
+
VCParts: number[];
|
|
15
|
+
entries: number[][];
|
|
16
|
+
totalPainted: number;
|
|
17
|
+
componentsLog: ComponentsLogType;
|
|
18
|
+
};
|
|
19
|
+
export type VCCalculationMethodReturn = {
|
|
20
|
+
VC: VCType;
|
|
21
|
+
VCBox: VCBoxType;
|
|
22
|
+
};
|
|
23
|
+
export type VCCalculationMethodType = (args: VCCalculationMethodArgs) => VCCalculationMethodReturn;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.0",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@atlaskit/interaction-context": "^2.6.0",
|
|
78
|
-
"@atlaskit/platform-feature-flags": "^1.
|
|
78
|
+
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
79
79
|
"@babel/runtime": "^7.0.0",
|
|
80
80
|
"bind-event-listener": "^3.0.0",
|
|
81
81
|
"bowser-ultralight": "^1.0.6",
|
|
@@ -151,8 +151,17 @@
|
|
|
151
151
|
"ufo-remove-vc-component-observations-after-ttai": {
|
|
152
152
|
"type": "boolean"
|
|
153
153
|
},
|
|
154
|
+
"ufo_vc_multiheatmap": {
|
|
155
|
+
"type": "boolean"
|
|
156
|
+
},
|
|
154
157
|
"ufo-calc-speed-index": {
|
|
155
158
|
"type": "boolean"
|
|
159
|
+
},
|
|
160
|
+
"platform-ufo-add-segment-use-effect": {
|
|
161
|
+
"type": "boolean"
|
|
162
|
+
},
|
|
163
|
+
"ufo_chr_config": {
|
|
164
|
+
"type": "boolean"
|
|
156
165
|
}
|
|
157
166
|
}
|
|
158
167
|
}
|