@tamagui/react-native-web-lite 1.116.2 → 1.116.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/dist/cjs/Batchinator/index.cjs +68 -0
- package/dist/cjs/Batchinator/index.js +57 -0
- package/dist/cjs/Batchinator/index.js.map +6 -0
- package/dist/cjs/Batchinator/index.native.js +92 -0
- package/dist/cjs/Batchinator/index.native.js.map +6 -0
- package/dist/cjs/FlatList.cjs +196 -0
- package/dist/cjs/FlatList.js +193 -0
- package/dist/cjs/FlatList.js.map +6 -0
- package/dist/cjs/FlatList.native.js +256 -0
- package/dist/cjs/FlatList.native.js.map +6 -0
- package/dist/cjs/InteractionManager/TaskQueue.cjs +88 -0
- package/dist/cjs/InteractionManager/TaskQueue.js +76 -0
- package/dist/cjs/InteractionManager/TaskQueue.js.map +6 -0
- package/dist/cjs/InteractionManager/TaskQueue.native.js +134 -0
- package/dist/cjs/InteractionManager/TaskQueue.native.js.map +6 -0
- package/dist/cjs/InteractionManager/index.cjs +114 -0
- package/dist/cjs/InteractionManager/index.js +95 -0
- package/dist/cjs/InteractionManager/index.js.map +6 -0
- package/dist/cjs/InteractionManager/index.native.js +99 -0
- package/dist/cjs/InteractionManager/index.native.js.map +6 -0
- package/dist/cjs/index.cjs +7 -7
- package/dist/cjs/index.js +6 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +6 -6
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/vendor/react-native/FillRateHelper/index.cjs +138 -0
- package/dist/cjs/vendor/react-native/FillRateHelper/index.js +124 -0
- package/dist/cjs/vendor/react-native/FillRateHelper/index.js.map +6 -0
- package/dist/cjs/vendor/react-native/FillRateHelper/index.native.js +158 -0
- package/dist/cjs/vendor/react-native/FillRateHelper/index.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/Utilities/clamp.cjs +29 -0
- package/dist/cjs/vendor/react-native/Utilities/clamp.js +24 -0
- package/dist/cjs/vendor/react-native/Utilities/clamp.js.map +6 -0
- package/dist/cjs/vendor/react-native/Utilities/clamp.native.js +25 -0
- package/dist/cjs/vendor/react-native/Utilities/clamp.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/ViewabilityHelper.cjs +133 -0
- package/dist/cjs/vendor/react-native/ViewabilityHelper.js +144 -0
- package/dist/cjs/vendor/react-native/ViewabilityHelper.js.map +6 -0
- package/dist/cjs/vendor/react-native/ViewabilityHelper.native.js +199 -0
- package/dist/cjs/vendor/react-native/ViewabilityHelper.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizeUtils/index.cjs +106 -0
- package/dist/cjs/vendor/react-native/VirtualizeUtils/index.js +86 -0
- package/dist/cjs/vendor/react-native/VirtualizeUtils/index.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizeUtils/index.native.js +95 -0
- package/dist/cjs/vendor/react-native/VirtualizeUtils/index.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/CellRenderMask.cjs +81 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/CellRenderMask.js +84 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/CellRenderMask.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/CellRenderMask.native.js +125 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/CellRenderMask.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/ChildListCollection.cjs +56 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/ChildListCollection.js +59 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/ChildListCollection.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/ChildListCollection.native.js +153 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/ChildListCollection.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/StateSafePureComponent.cjs +80 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/StateSafePureComponent.js +74 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/StateSafePureComponent.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/StateSafePureComponent.native.js +163 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/StateSafePureComponent.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.cjs +164 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.js +149 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.native.js +245 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListContext.cjs +84 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListContext.js +72 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListContext.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListContext.native.js +85 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListContext.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListProps.cjs +16 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListProps.js +14 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListProps.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListProps.native.js +15 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListProps.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/index.cjs +1003 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/index.js +1021 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/index.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/index.native.js +1075 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/index.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/deepDiffer/index.cjs +41 -0
- package/dist/cjs/vendor/react-native/deepDiffer/index.js +47 -0
- package/dist/cjs/vendor/react-native/deepDiffer/index.js.map +6 -0
- package/dist/cjs/vendor/react-native/deepDiffer/index.native.js +48 -0
- package/dist/cjs/vendor/react-native/deepDiffer/index.native.js.map +6 -0
- package/dist/esm/Batchinator/index.js +33 -0
- package/dist/esm/Batchinator/index.js.map +6 -0
- package/dist/esm/Batchinator/index.mjs +34 -0
- package/dist/esm/Batchinator/index.mjs.map +1 -0
- package/dist/esm/Batchinator/index.native.js +67 -0
- package/dist/esm/Batchinator/index.native.js.map +6 -0
- package/dist/esm/FlatList.js +176 -0
- package/dist/esm/FlatList.js.map +6 -0
- package/dist/esm/FlatList.mjs +162 -0
- package/dist/esm/FlatList.mjs.map +1 -0
- package/dist/esm/FlatList.native.js +238 -0
- package/dist/esm/FlatList.native.js.map +6 -0
- package/dist/esm/InteractionManager/TaskQueue.js +60 -0
- package/dist/esm/InteractionManager/TaskQueue.js.map +6 -0
- package/dist/esm/InteractionManager/TaskQueue.mjs +65 -0
- package/dist/esm/InteractionManager/TaskQueue.mjs.map +1 -0
- package/dist/esm/InteractionManager/TaskQueue.native.js +117 -0
- package/dist/esm/InteractionManager/TaskQueue.native.js.map +6 -0
- package/dist/esm/InteractionManager/index.js +73 -0
- package/dist/esm/InteractionManager/index.js.map +6 -0
- package/dist/esm/InteractionManager/index.mjs +80 -0
- package/dist/esm/InteractionManager/index.mjs.map +1 -0
- package/dist/esm/InteractionManager/index.native.js +77 -0
- package/dist/esm/InteractionManager/index.native.js.map +6 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/index.native.js +2 -2
- package/dist/esm/vendor/react-native/FillRateHelper/index.js +108 -0
- package/dist/esm/vendor/react-native/FillRateHelper/index.js.map +6 -0
- package/dist/esm/vendor/react-native/FillRateHelper/index.mjs +115 -0
- package/dist/esm/vendor/react-native/FillRateHelper/index.mjs.map +1 -0
- package/dist/esm/vendor/react-native/FillRateHelper/index.native.js +141 -0
- package/dist/esm/vendor/react-native/FillRateHelper/index.native.js.map +6 -0
- package/dist/esm/vendor/react-native/Utilities/clamp.js +8 -0
- package/dist/esm/vendor/react-native/Utilities/clamp.js.map +6 -0
- package/dist/esm/vendor/react-native/Utilities/clamp.mjs +6 -0
- package/dist/esm/vendor/react-native/Utilities/clamp.mjs.map +1 -0
- package/dist/esm/vendor/react-native/Utilities/clamp.native.js +8 -0
- package/dist/esm/vendor/react-native/Utilities/clamp.native.js.map +6 -0
- package/dist/esm/vendor/react-native/ViewabilityHelper.js +128 -0
- package/dist/esm/vendor/react-native/ViewabilityHelper.js.map +6 -0
- package/dist/esm/vendor/react-native/ViewabilityHelper.mjs +110 -0
- package/dist/esm/vendor/react-native/ViewabilityHelper.mjs.map +1 -0
- package/dist/esm/vendor/react-native/ViewabilityHelper.native.js +182 -0
- package/dist/esm/vendor/react-native/ViewabilityHelper.native.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizeUtils/index.js +70 -0
- package/dist/esm/vendor/react-native/VirtualizeUtils/index.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizeUtils/index.mjs +80 -0
- package/dist/esm/vendor/react-native/VirtualizeUtils/index.mjs.map +1 -0
- package/dist/esm/vendor/react-native/VirtualizeUtils/index.native.js +71 -0
- package/dist/esm/vendor/react-native/VirtualizeUtils/index.native.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/CellRenderMask.js +68 -0
- package/dist/esm/vendor/react-native/VirtualizedList/CellRenderMask.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/CellRenderMask.mjs +58 -0
- package/dist/esm/vendor/react-native/VirtualizedList/CellRenderMask.mjs.map +1 -0
- package/dist/esm/vendor/react-native/VirtualizedList/CellRenderMask.native.js +104 -0
- package/dist/esm/vendor/react-native/VirtualizedList/CellRenderMask.native.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/ChildListCollection.js +43 -0
- package/dist/esm/vendor/react-native/VirtualizedList/ChildListCollection.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/ChildListCollection.mjs +33 -0
- package/dist/esm/vendor/react-native/VirtualizedList/ChildListCollection.mjs.map +1 -0
- package/dist/esm/vendor/react-native/VirtualizedList/ChildListCollection.native.js +136 -0
- package/dist/esm/vendor/react-native/VirtualizedList/ChildListCollection.native.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/StateSafePureComponent.js +51 -0
- package/dist/esm/vendor/react-native/VirtualizedList/StateSafePureComponent.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/StateSafePureComponent.mjs +46 -0
- package/dist/esm/vendor/react-native/VirtualizedList/StateSafePureComponent.mjs.map +1 -0
- package/dist/esm/vendor/react-native/VirtualizedList/StateSafePureComponent.native.js +139 -0
- package/dist/esm/vendor/react-native/VirtualizedList/StateSafePureComponent.native.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.js +132 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.mjs +130 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.mjs.map +1 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.native.js +224 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.native.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListContext.js +50 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListContext.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListContext.mjs +47 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListContext.mjs.map +1 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListContext.native.js +56 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListContext.native.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListProps.js +1 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListProps.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListProps.mjs +2 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListProps.mjs.map +1 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListProps.native.js +1 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListProps.native.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/index.js +1016 -0
- package/dist/esm/vendor/react-native/VirtualizedList/index.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/index.mjs +969 -0
- package/dist/esm/vendor/react-native/VirtualizedList/index.mjs.map +1 -0
- package/dist/esm/vendor/react-native/VirtualizedList/index.native.js +1065 -0
- package/dist/esm/vendor/react-native/VirtualizedList/index.native.js.map +6 -0
- package/dist/esm/vendor/react-native/deepDiffer/index.js +31 -0
- package/dist/esm/vendor/react-native/deepDiffer/index.js.map +6 -0
- package/dist/esm/vendor/react-native/deepDiffer/index.mjs +18 -0
- package/dist/esm/vendor/react-native/deepDiffer/index.mjs.map +1 -0
- package/dist/esm/vendor/react-native/deepDiffer/index.native.js +31 -0
- package/dist/esm/vendor/react-native/deepDiffer/index.native.js.map +6 -0
- package/package.json +6 -6
- package/src/Batchinator/index.tsx +78 -0
- package/src/FlatList.tsx +330 -0
- package/src/InteractionManager/TaskQueue.tsx +114 -0
- package/src/InteractionManager/index.tsx +139 -0
- package/src/index.tsx +2 -2
- package/src/vendor/react-native/FillRateHelper/index.tsx +218 -0
- package/src/vendor/react-native/Utilities/clamp.ts +21 -0
- package/src/vendor/react-native/ViewabilityHelper.ts +291 -0
- package/src/vendor/react-native/VirtualizeUtils/index.tsx +212 -0
- package/src/vendor/react-native/VirtualizedList/CellRenderMask.ts +147 -0
- package/src/vendor/react-native/VirtualizedList/ChildListCollection.tsx +73 -0
- package/src/vendor/react-native/VirtualizedList/StateSafePureComponent.tsx +79 -0
- package/src/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.tsx +210 -0
- package/src/vendor/react-native/VirtualizedList/VirtualizedListContext.tsx +116 -0
- package/src/vendor/react-native/VirtualizedList/VirtualizedListProps.ts +130 -0
- package/src/vendor/react-native/VirtualizedList/index.tsx +1797 -0
- package/src/vendor/react-native/deepDiffer/index.tsx +56 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var FillRateHelper_exports = {};
|
|
22
|
+
__export(FillRateHelper_exports, {
|
|
23
|
+
default: () => FillRateHelper_default
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(FillRateHelper_exports);
|
|
26
|
+
class Info {
|
|
27
|
+
any_blank_count = 0;
|
|
28
|
+
any_blank_ms = 0;
|
|
29
|
+
any_blank_speed_sum = 0;
|
|
30
|
+
mostly_blank_count = 0;
|
|
31
|
+
mostly_blank_ms = 0;
|
|
32
|
+
pixels_blank = 0;
|
|
33
|
+
pixels_sampled = 0;
|
|
34
|
+
pixels_scrolled = 0;
|
|
35
|
+
total_time_spent = 0;
|
|
36
|
+
sample_count = 0;
|
|
37
|
+
}
|
|
38
|
+
const DEBUG = !1;
|
|
39
|
+
let _listeners = [],
|
|
40
|
+
_minSampleCount = 10,
|
|
41
|
+
_sampleRate = DEBUG ? 1 : null;
|
|
42
|
+
class FillRateHelper {
|
|
43
|
+
_anyBlankStartTime = null;
|
|
44
|
+
_enabled = !1;
|
|
45
|
+
_getFrameMetrics;
|
|
46
|
+
_info = new Info();
|
|
47
|
+
_mostlyBlankStartTime = null;
|
|
48
|
+
_samplesStartTime = null;
|
|
49
|
+
static addListener(callback) {
|
|
50
|
+
return _sampleRate === null && console.warn("Call `FillRateHelper.setSampleRate` before `addListener`."), _listeners.push(callback), {
|
|
51
|
+
remove: () => {
|
|
52
|
+
_listeners = _listeners.filter(listener => callback !== listener);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
static setSampleRate(sampleRate) {
|
|
57
|
+
_sampleRate = sampleRate;
|
|
58
|
+
}
|
|
59
|
+
static setMinSampleCount(minSampleCount) {
|
|
60
|
+
_minSampleCount = minSampleCount;
|
|
61
|
+
}
|
|
62
|
+
constructor(getFrameMetrics) {
|
|
63
|
+
this._getFrameMetrics = getFrameMetrics, this._enabled = (_sampleRate || 0) > Math.random(), this._resetData();
|
|
64
|
+
}
|
|
65
|
+
activate() {
|
|
66
|
+
this._enabled && this._samplesStartTime == null && (DEBUG && console.debug("FillRateHelper: activate"), this._samplesStartTime = globalThis.performance.now());
|
|
67
|
+
}
|
|
68
|
+
deactivateAndFlush() {
|
|
69
|
+
if (!this._enabled) return;
|
|
70
|
+
const start = this._samplesStartTime;
|
|
71
|
+
if (start == null) {
|
|
72
|
+
DEBUG && console.debug("FillRateHelper: bail on deactivate with no start time");
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (this._info.sample_count < _minSampleCount) {
|
|
76
|
+
this._resetData();
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const total_time_spent = globalThis.performance.now() - start,
|
|
80
|
+
info = {
|
|
81
|
+
...this._info,
|
|
82
|
+
total_time_spent
|
|
83
|
+
};
|
|
84
|
+
if (DEBUG) {
|
|
85
|
+
const derived = {
|
|
86
|
+
avg_blankness: this._info.pixels_blank / this._info.pixels_sampled,
|
|
87
|
+
avg_speed: this._info.pixels_scrolled / (total_time_spent / 1e3),
|
|
88
|
+
avg_speed_when_any_blank: this._info.any_blank_speed_sum / this._info.any_blank_count,
|
|
89
|
+
any_blank_per_min: this._info.any_blank_count / (total_time_spent / 1e3 / 60),
|
|
90
|
+
any_blank_time_frac: this._info.any_blank_ms / total_time_spent,
|
|
91
|
+
mostly_blank_per_min: this._info.mostly_blank_count / (total_time_spent / 1e3 / 60),
|
|
92
|
+
mostly_blank_time_frac: this._info.mostly_blank_ms / total_time_spent
|
|
93
|
+
};
|
|
94
|
+
for (const key in derived) derived[key] = Math.round(1e3 * derived[key]) / 1e3;
|
|
95
|
+
console.debug("FillRateHelper deactivateAndFlush: ", {
|
|
96
|
+
derived,
|
|
97
|
+
info
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
_listeners.forEach(listener => listener(info)), this._resetData();
|
|
101
|
+
}
|
|
102
|
+
computeBlankness(props, cellsAroundViewport, scrollMetrics) {
|
|
103
|
+
if (!this._enabled || props.getItemCount(props.data) === 0 || cellsAroundViewport.last < cellsAroundViewport.first || this._samplesStartTime == null) return 0;
|
|
104
|
+
const {
|
|
105
|
+
dOffset,
|
|
106
|
+
offset,
|
|
107
|
+
velocity,
|
|
108
|
+
visibleLength
|
|
109
|
+
} = scrollMetrics;
|
|
110
|
+
this._info.sample_count++, this._info.pixels_sampled += Math.round(visibleLength), this._info.pixels_scrolled += Math.round(Math.abs(dOffset));
|
|
111
|
+
const scrollSpeed = Math.round(Math.abs(velocity) * 1e3),
|
|
112
|
+
now = globalThis.performance.now();
|
|
113
|
+
this._anyBlankStartTime != null && (this._info.any_blank_ms += now - this._anyBlankStartTime), this._anyBlankStartTime = null, this._mostlyBlankStartTime != null && (this._info.mostly_blank_ms += now - this._mostlyBlankStartTime), this._mostlyBlankStartTime = null;
|
|
114
|
+
let blankTop = 0,
|
|
115
|
+
first = cellsAroundViewport.first,
|
|
116
|
+
firstFrame = this._getFrameMetrics(first, props);
|
|
117
|
+
for (; first <= cellsAroundViewport.last && (!firstFrame || !firstFrame.inLayout);) firstFrame = this._getFrameMetrics(first, props), first++;
|
|
118
|
+
firstFrame && first > 0 && (blankTop = Math.min(visibleLength, Math.max(0, firstFrame.offset - offset)));
|
|
119
|
+
let blankBottom = 0,
|
|
120
|
+
last = cellsAroundViewport.last,
|
|
121
|
+
lastFrame = this._getFrameMetrics(last, props);
|
|
122
|
+
for (; last >= cellsAroundViewport.first && (!lastFrame || !lastFrame.inLayout);) lastFrame = this._getFrameMetrics(last, props), last--;
|
|
123
|
+
if (lastFrame && last < props.getItemCount(props.data) - 1) {
|
|
124
|
+
const bottomEdge = lastFrame.offset + lastFrame.length;
|
|
125
|
+
blankBottom = Math.min(visibleLength, Math.max(0, offset + visibleLength - bottomEdge));
|
|
126
|
+
}
|
|
127
|
+
const pixels_blank = Math.round(blankTop + blankBottom),
|
|
128
|
+
blankness = pixels_blank / visibleLength;
|
|
129
|
+
return blankness > 0 ? (this._anyBlankStartTime = now, this._info.any_blank_speed_sum += scrollSpeed, this._info.any_blank_count++, this._info.pixels_blank += pixels_blank, blankness > 0.5 && (this._mostlyBlankStartTime = now, this._info.mostly_blank_count++)) : (scrollSpeed < 0.01 || Math.abs(dOffset) < 1) && this.deactivateAndFlush(), blankness;
|
|
130
|
+
}
|
|
131
|
+
enabled() {
|
|
132
|
+
return this._enabled;
|
|
133
|
+
}
|
|
134
|
+
_resetData() {
|
|
135
|
+
this._anyBlankStartTime = null, this._info = new Info(), this._mostlyBlankStartTime = null, this._samplesStartTime = null;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
var FillRateHelper_default = FillRateHelper;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
+
var FillRateHelper_exports = {};
|
|
16
|
+
__export(FillRateHelper_exports, {
|
|
17
|
+
default: () => FillRateHelper_default
|
|
18
|
+
});
|
|
19
|
+
module.exports = __toCommonJS(FillRateHelper_exports);
|
|
20
|
+
class Info {
|
|
21
|
+
any_blank_count = 0;
|
|
22
|
+
any_blank_ms = 0;
|
|
23
|
+
any_blank_speed_sum = 0;
|
|
24
|
+
mostly_blank_count = 0;
|
|
25
|
+
mostly_blank_ms = 0;
|
|
26
|
+
pixels_blank = 0;
|
|
27
|
+
pixels_sampled = 0;
|
|
28
|
+
pixels_scrolled = 0;
|
|
29
|
+
total_time_spent = 0;
|
|
30
|
+
sample_count = 0;
|
|
31
|
+
}
|
|
32
|
+
const DEBUG = !1;
|
|
33
|
+
let _listeners = [], _minSampleCount = 10, _sampleRate = DEBUG ? 1 : null;
|
|
34
|
+
class FillRateHelper {
|
|
35
|
+
_anyBlankStartTime = null;
|
|
36
|
+
_enabled = !1;
|
|
37
|
+
_getFrameMetrics;
|
|
38
|
+
_info = new Info();
|
|
39
|
+
_mostlyBlankStartTime = null;
|
|
40
|
+
_samplesStartTime = null;
|
|
41
|
+
static addListener(callback) {
|
|
42
|
+
return _sampleRate === null && console.warn("Call `FillRateHelper.setSampleRate` before `addListener`."), _listeners.push(callback), {
|
|
43
|
+
remove: () => {
|
|
44
|
+
_listeners = _listeners.filter((listener) => callback !== listener);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
static setSampleRate(sampleRate) {
|
|
49
|
+
_sampleRate = sampleRate;
|
|
50
|
+
}
|
|
51
|
+
static setMinSampleCount(minSampleCount) {
|
|
52
|
+
_minSampleCount = minSampleCount;
|
|
53
|
+
}
|
|
54
|
+
constructor(getFrameMetrics) {
|
|
55
|
+
this._getFrameMetrics = getFrameMetrics, this._enabled = (_sampleRate || 0) > Math.random(), this._resetData();
|
|
56
|
+
}
|
|
57
|
+
activate() {
|
|
58
|
+
this._enabled && this._samplesStartTime == null && (DEBUG && console.debug("FillRateHelper: activate"), this._samplesStartTime = globalThis.performance.now());
|
|
59
|
+
}
|
|
60
|
+
deactivateAndFlush() {
|
|
61
|
+
if (!this._enabled)
|
|
62
|
+
return;
|
|
63
|
+
const start = this._samplesStartTime;
|
|
64
|
+
if (start == null) {
|
|
65
|
+
DEBUG && console.debug("FillRateHelper: bail on deactivate with no start time");
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (this._info.sample_count < _minSampleCount) {
|
|
69
|
+
this._resetData();
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const total_time_spent = globalThis.performance.now() - start, info = {
|
|
73
|
+
...this._info,
|
|
74
|
+
total_time_spent
|
|
75
|
+
};
|
|
76
|
+
if (DEBUG) {
|
|
77
|
+
const derived = {
|
|
78
|
+
avg_blankness: this._info.pixels_blank / this._info.pixels_sampled,
|
|
79
|
+
avg_speed: this._info.pixels_scrolled / (total_time_spent / 1e3),
|
|
80
|
+
avg_speed_when_any_blank: this._info.any_blank_speed_sum / this._info.any_blank_count,
|
|
81
|
+
any_blank_per_min: this._info.any_blank_count / (total_time_spent / 1e3 / 60),
|
|
82
|
+
any_blank_time_frac: this._info.any_blank_ms / total_time_spent,
|
|
83
|
+
mostly_blank_per_min: this._info.mostly_blank_count / (total_time_spent / 1e3 / 60),
|
|
84
|
+
mostly_blank_time_frac: this._info.mostly_blank_ms / total_time_spent
|
|
85
|
+
};
|
|
86
|
+
for (const key in derived)
|
|
87
|
+
derived[key] = Math.round(1e3 * derived[key]) / 1e3;
|
|
88
|
+
console.debug("FillRateHelper deactivateAndFlush: ", { derived, info });
|
|
89
|
+
}
|
|
90
|
+
_listeners.forEach((listener) => listener(info)), this._resetData();
|
|
91
|
+
}
|
|
92
|
+
computeBlankness(props, cellsAroundViewport, scrollMetrics) {
|
|
93
|
+
if (!this._enabled || props.getItemCount(props.data) === 0 || cellsAroundViewport.last < cellsAroundViewport.first || this._samplesStartTime == null)
|
|
94
|
+
return 0;
|
|
95
|
+
const { dOffset, offset, velocity, visibleLength } = scrollMetrics;
|
|
96
|
+
this._info.sample_count++, this._info.pixels_sampled += Math.round(visibleLength), this._info.pixels_scrolled += Math.round(Math.abs(dOffset));
|
|
97
|
+
const scrollSpeed = Math.round(Math.abs(velocity) * 1e3), now = globalThis.performance.now();
|
|
98
|
+
this._anyBlankStartTime != null && (this._info.any_blank_ms += now - this._anyBlankStartTime), this._anyBlankStartTime = null, this._mostlyBlankStartTime != null && (this._info.mostly_blank_ms += now - this._mostlyBlankStartTime), this._mostlyBlankStartTime = null;
|
|
99
|
+
let blankTop = 0, first = cellsAroundViewport.first, firstFrame = this._getFrameMetrics(first, props);
|
|
100
|
+
for (; first <= cellsAroundViewport.last && (!firstFrame || !firstFrame.inLayout); )
|
|
101
|
+
firstFrame = this._getFrameMetrics(first, props), first++;
|
|
102
|
+
firstFrame && first > 0 && (blankTop = Math.min(visibleLength, Math.max(0, firstFrame.offset - offset)));
|
|
103
|
+
let blankBottom = 0, last = cellsAroundViewport.last, lastFrame = this._getFrameMetrics(last, props);
|
|
104
|
+
for (; last >= cellsAroundViewport.first && (!lastFrame || !lastFrame.inLayout); )
|
|
105
|
+
lastFrame = this._getFrameMetrics(last, props), last--;
|
|
106
|
+
if (lastFrame && last < props.getItemCount(props.data) - 1) {
|
|
107
|
+
const bottomEdge = lastFrame.offset + lastFrame.length;
|
|
108
|
+
blankBottom = Math.min(
|
|
109
|
+
visibleLength,
|
|
110
|
+
Math.max(0, offset + visibleLength - bottomEdge)
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
const pixels_blank = Math.round(blankTop + blankBottom), blankness = pixels_blank / visibleLength;
|
|
114
|
+
return blankness > 0 ? (this._anyBlankStartTime = now, this._info.any_blank_speed_sum += scrollSpeed, this._info.any_blank_count++, this._info.pixels_blank += pixels_blank, blankness > 0.5 && (this._mostlyBlankStartTime = now, this._info.mostly_blank_count++)) : (scrollSpeed < 0.01 || Math.abs(dOffset) < 1) && this.deactivateAndFlush(), blankness;
|
|
115
|
+
}
|
|
116
|
+
enabled() {
|
|
117
|
+
return this._enabled;
|
|
118
|
+
}
|
|
119
|
+
_resetData() {
|
|
120
|
+
this._anyBlankStartTime = null, this._info = new Info(), this._mostlyBlankStartTime = null, this._samplesStartTime = null;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
var FillRateHelper_default = FillRateHelper;
|
|
124
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/vendor/react-native/FillRateHelper/index.tsx"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,MAAM,KAAK;AAAA,EACT,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,sBAAsB;AAA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|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
+
var FillRateHelper_exports = {};
|
|
17
|
+
__export(FillRateHelper_exports, {
|
|
18
|
+
default: () => FillRateHelper_default
|
|
19
|
+
});
|
|
20
|
+
module.exports = __toCommonJS(FillRateHelper_exports);
|
|
21
|
+
function _class_call_check(instance, Constructor) {
|
|
22
|
+
if (!(instance instanceof Constructor))
|
|
23
|
+
throw new TypeError("Cannot call a class as a function");
|
|
24
|
+
}
|
|
25
|
+
function _defineProperties(target, props) {
|
|
26
|
+
for (var i = 0; i < props.length; i++) {
|
|
27
|
+
var descriptor = props[i];
|
|
28
|
+
descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
32
|
+
return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;
|
|
33
|
+
}
|
|
34
|
+
function _define_property(obj, key, value) {
|
|
35
|
+
return key in obj ? Object.defineProperty(obj, key, {
|
|
36
|
+
value,
|
|
37
|
+
enumerable: !0,
|
|
38
|
+
configurable: !0,
|
|
39
|
+
writable: !0
|
|
40
|
+
}) : obj[key] = value, obj;
|
|
41
|
+
}
|
|
42
|
+
var Info = function Info2() {
|
|
43
|
+
"use strict";
|
|
44
|
+
_class_call_check(this, Info2), _define_property(this, "any_blank_count", 0), _define_property(this, "any_blank_ms", 0), _define_property(this, "any_blank_speed_sum", 0), _define_property(this, "mostly_blank_count", 0), _define_property(this, "mostly_blank_ms", 0), _define_property(this, "pixels_blank", 0), _define_property(this, "pixels_sampled", 0), _define_property(this, "pixels_scrolled", 0), _define_property(this, "total_time_spent", 0), _define_property(this, "sample_count", 0);
|
|
45
|
+
}, DEBUG = !1, _listeners = [], _minSampleCount = 10, _sampleRate = DEBUG ? 1 : null, FillRateHelper = /* @__PURE__ */ function() {
|
|
46
|
+
"use strict";
|
|
47
|
+
function FillRateHelper2(getFrameMetrics) {
|
|
48
|
+
_class_call_check(this, FillRateHelper2), _define_property(this, "_anyBlankStartTime", null), _define_property(this, "_enabled", !1), _define_property(this, "_getFrameMetrics", void 0), _define_property(this, "_info", new Info()), _define_property(this, "_mostlyBlankStartTime", null), _define_property(this, "_samplesStartTime", null), this._getFrameMetrics = getFrameMetrics, this._enabled = (_sampleRate || 0) > Math.random(), this._resetData();
|
|
49
|
+
}
|
|
50
|
+
return _create_class(FillRateHelper2, [
|
|
51
|
+
{
|
|
52
|
+
key: "activate",
|
|
53
|
+
value: function() {
|
|
54
|
+
this._enabled && this._samplesStartTime == null && (DEBUG && console.debug("FillRateHelper: activate"), this._samplesStartTime = globalThis.performance.now());
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
key: "deactivateAndFlush",
|
|
59
|
+
value: function() {
|
|
60
|
+
if (this._enabled) {
|
|
61
|
+
var start = this._samplesStartTime;
|
|
62
|
+
if (start == null) {
|
|
63
|
+
DEBUG && console.debug("FillRateHelper: bail on deactivate with no start time");
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (this._info.sample_count < _minSampleCount) {
|
|
67
|
+
this._resetData();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
var total_time_spent = globalThis.performance.now() - start, info = {
|
|
71
|
+
...this._info,
|
|
72
|
+
total_time_spent
|
|
73
|
+
};
|
|
74
|
+
if (DEBUG) {
|
|
75
|
+
var derived = {
|
|
76
|
+
avg_blankness: this._info.pixels_blank / this._info.pixels_sampled,
|
|
77
|
+
avg_speed: this._info.pixels_scrolled / (total_time_spent / 1e3),
|
|
78
|
+
avg_speed_when_any_blank: this._info.any_blank_speed_sum / this._info.any_blank_count,
|
|
79
|
+
any_blank_per_min: this._info.any_blank_count / (total_time_spent / 1e3 / 60),
|
|
80
|
+
any_blank_time_frac: this._info.any_blank_ms / total_time_spent,
|
|
81
|
+
mostly_blank_per_min: this._info.mostly_blank_count / (total_time_spent / 1e3 / 60),
|
|
82
|
+
mostly_blank_time_frac: this._info.mostly_blank_ms / total_time_spent
|
|
83
|
+
};
|
|
84
|
+
for (var key in derived)
|
|
85
|
+
derived[key] = Math.round(1e3 * derived[key]) / 1e3;
|
|
86
|
+
console.debug("FillRateHelper deactivateAndFlush: ", {
|
|
87
|
+
derived,
|
|
88
|
+
info
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
_listeners.forEach(function(listener) {
|
|
92
|
+
return listener(info);
|
|
93
|
+
}), this._resetData();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
key: "computeBlankness",
|
|
99
|
+
value: function(props, cellsAroundViewport, scrollMetrics) {
|
|
100
|
+
if (!this._enabled || props.getItemCount(props.data) === 0 || cellsAroundViewport.last < cellsAroundViewport.first || this._samplesStartTime == null)
|
|
101
|
+
return 0;
|
|
102
|
+
var { dOffset, offset, velocity, visibleLength } = scrollMetrics;
|
|
103
|
+
this._info.sample_count++, this._info.pixels_sampled += Math.round(visibleLength), this._info.pixels_scrolled += Math.round(Math.abs(dOffset));
|
|
104
|
+
var scrollSpeed = Math.round(Math.abs(velocity) * 1e3), now = globalThis.performance.now();
|
|
105
|
+
this._anyBlankStartTime != null && (this._info.any_blank_ms += now - this._anyBlankStartTime), this._anyBlankStartTime = null, this._mostlyBlankStartTime != null && (this._info.mostly_blank_ms += now - this._mostlyBlankStartTime), this._mostlyBlankStartTime = null;
|
|
106
|
+
for (var blankTop = 0, first = cellsAroundViewport.first, firstFrame = this._getFrameMetrics(first, props); first <= cellsAroundViewport.last && (!firstFrame || !firstFrame.inLayout); )
|
|
107
|
+
firstFrame = this._getFrameMetrics(first, props), first++;
|
|
108
|
+
firstFrame && first > 0 && (blankTop = Math.min(visibleLength, Math.max(0, firstFrame.offset - offset)));
|
|
109
|
+
for (var blankBottom = 0, last = cellsAroundViewport.last, lastFrame = this._getFrameMetrics(last, props); last >= cellsAroundViewport.first && (!lastFrame || !lastFrame.inLayout); )
|
|
110
|
+
lastFrame = this._getFrameMetrics(last, props), last--;
|
|
111
|
+
if (lastFrame && last < props.getItemCount(props.data) - 1) {
|
|
112
|
+
var bottomEdge = lastFrame.offset + lastFrame.length;
|
|
113
|
+
blankBottom = Math.min(visibleLength, Math.max(0, offset + visibleLength - bottomEdge));
|
|
114
|
+
}
|
|
115
|
+
var pixels_blank = Math.round(blankTop + blankBottom), blankness = pixels_blank / visibleLength;
|
|
116
|
+
return blankness > 0 ? (this._anyBlankStartTime = now, this._info.any_blank_speed_sum += scrollSpeed, this._info.any_blank_count++, this._info.pixels_blank += pixels_blank, blankness > 0.5 && (this._mostlyBlankStartTime = now, this._info.mostly_blank_count++)) : (scrollSpeed < 0.01 || Math.abs(dOffset) < 1) && this.deactivateAndFlush(), blankness;
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
key: "enabled",
|
|
121
|
+
value: function() {
|
|
122
|
+
return this._enabled;
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
key: "_resetData",
|
|
127
|
+
value: function() {
|
|
128
|
+
this._anyBlankStartTime = null, this._info = new Info(), this._mostlyBlankStartTime = null, this._samplesStartTime = null;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
], [
|
|
132
|
+
{
|
|
133
|
+
key: "addListener",
|
|
134
|
+
value: function(callback) {
|
|
135
|
+
return _sampleRate === null && console.warn("Call `FillRateHelper.setSampleRate` before `addListener`."), _listeners.push(callback), {
|
|
136
|
+
remove: function() {
|
|
137
|
+
_listeners = _listeners.filter(function(listener) {
|
|
138
|
+
return callback !== listener;
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
key: "setSampleRate",
|
|
146
|
+
value: function(sampleRate) {
|
|
147
|
+
_sampleRate = sampleRate;
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
key: "setMinSampleCount",
|
|
152
|
+
value: function(minSampleCount) {
|
|
153
|
+
_minSampleCount = minSampleCount;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
]), FillRateHelper2;
|
|
157
|
+
}(), FillRateHelper_default = FillRateHelper;
|
|
158
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/vendor/react-native/FillRateHelper/Users/n8/tamagui/code/packages/react-native-web-lite/src/vendor/react-native/FillRateHelper/index.tsx"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,IAAMA,OAAN,SAAMA,QAAAA;;0BAAAA,KAAAA,GACJC,iBAAAA,MAAAA,mBAAkB,CAAA,GAClBC,iBAAAA,MAAAA,gBAAe,CAAA,G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;;;MAEAC,KAAAA;aAAAA,WAAAA;AACE,eAAO,KAAKrD;MACd;;;MAEQO,KAAAA;aAAR,WAAQA;AACN,aAAKR,qBAAqB,MAC1B,KAAKG,QAAQ,IAAIpB,KAAAA,GACjB,KAAKqB,wBAAwB,MAC7B,KAAKC,oBAAoB;MAC3B;;;;MA/JOkD,KAAAA;aAAP,SAAmBC,UAAsC;AACvD,eAAI3D,gBAAgB,QAClBa,QAAQ+C,KAAK,2DAAA,GAEf9D,WAAW+D,KAAKF,QAAAA,GACT;UACLG,QAAQ,WAAA;AACNhE,yBAAaA,WAAWiE,OAAO,SAAC/B,UAAAA;qBAAa2B,aAAa3B;;UAC5D;QACF;MACF;;;MAEOgC,KAAAA;aAAP,SAAqBC,YAAkB;AACrCjE,sBAAciE;MAChB;;;MAEOC,KAAAA;aAAP,SAAyBC,gBAAsB;AAC7CpE,0BAAkBoE;MACpB;;MA7BIlE;KA6KN,yBAAeA;",
|
|
5
|
+
"names": ["Info", "any_blank_count", "any_blank_ms", "any_blank_speed_sum", "mostly_blank_count", "mostly_blank_ms", "pixels_blank", "pixels_sampled", "pixels_scrolled", "total_time_spent", "sample_count", "DEBUG", "_listeners", "_minSampleCount", "_sampleRate", "FillRateHelper", "getFrameMetrics", "_anyBlankStartTime", "_enabled", "_getFrameMetrics", "_info", "_mostlyBlankStartTime", "_samplesStartTime", "Math", "random", "_resetData", "activate", "console", "debug", "globalThis", "performance", "now", "deactivateAndFlush", "start", "info", "derived", "avg_blankness", "avg_speed", "avg_speed_when_any_blank", "any_blank_per_min", "any_blank_time_frac", "mostly_blank_per_min", "mostly_blank_time_frac", "key", "round", "forEach", "listener", "computeBlankness", "props", "cellsAroundViewport", "scrollMetrics", "getItemCount", "data", "last", "first", "dOffset", "offset", "velocity", "visibleLength", "abs", "scrollSpeed", "blankTop", "firstFrame", "inLayout", "min", "max", "blankBottom", "lastFrame", "bottomEdge", "length", "blankness", "enabled", "addListener", "callback", "warn", "push", "remove", "filter", "setSampleRate", "sampleRate", "setMinSampleCount", "minSampleCount"]
|
|
6
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var clamp_exports = {};
|
|
22
|
+
__export(clamp_exports, {
|
|
23
|
+
default: () => clamp_default
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(clamp_exports);
|
|
26
|
+
function clamp(min, value, max) {
|
|
27
|
+
return value < min ? min : value > max ? max : value;
|
|
28
|
+
}
|
|
29
|
+
var clamp_default = clamp;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
+
var clamp_exports = {};
|
|
16
|
+
__export(clamp_exports, {
|
|
17
|
+
default: () => clamp_default
|
|
18
|
+
});
|
|
19
|
+
module.exports = __toCommonJS(clamp_exports);
|
|
20
|
+
function clamp(min, value, max) {
|
|
21
|
+
return value < min ? min : value > max ? max : value;
|
|
22
|
+
}
|
|
23
|
+
var clamp_default = clamp;
|
|
24
|
+
//# sourceMappingURL=clamp.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
+
var clamp_exports = {};
|
|
17
|
+
__export(clamp_exports, {
|
|
18
|
+
default: () => clamp_default
|
|
19
|
+
});
|
|
20
|
+
module.exports = __toCommonJS(clamp_exports);
|
|
21
|
+
function clamp(min, value, max) {
|
|
22
|
+
return value < min ? min : value > max ? max : value;
|
|
23
|
+
}
|
|
24
|
+
var clamp_default = clamp;
|
|
25
|
+
//# sourceMappingURL=clamp.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/vendor/react-native/Utilities/Users/n8/tamagui/code/packages/react-native-web-lite/src/vendor/react-native/Utilities/clamp.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;;;;;AAUA,SAASA,MAAMC,KAAaC,OAAeC,KAAW;AACpD,SAAID,QAAQD,MACHA,MAELC,QAAQC,MACHA,MAEFD;AACT;AAEA,IAAA,gBAAeF;",
|
|
5
|
+
"names": ["clamp", "min", "value", "max"]
|
|
6
|
+
}
|