@buoy-gg/storage 1.7.2
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/README.md +607 -0
- package/lib/commonjs/index.js +34 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/preset.js +94 -0
- package/lib/commonjs/storage/components/DiffViewer/DiffOptionsPanel.js +356 -0
- package/lib/commonjs/storage/components/DiffViewer/TreeDiffViewer.js +29 -0
- package/lib/commonjs/storage/components/DiffViewer/components/DiffSummary.js +121 -0
- package/lib/commonjs/storage/components/DiffViewer/modes/ThemedSplitView.js +419 -0
- package/lib/commonjs/storage/components/DiffViewer/themes/diffThemes.js +122 -0
- package/lib/commonjs/storage/components/GameUIStorageBrowser.js +924 -0
- package/lib/commonjs/storage/components/GameUIStorageStats.js +746 -0
- package/lib/commonjs/storage/components/MMKVInstanceInfoPanel.js +257 -0
- package/lib/commonjs/storage/components/MMKVInstanceSelector.js +418 -0
- package/lib/commonjs/storage/components/SelectionActionBar.js +224 -0
- package/lib/commonjs/storage/components/StorageActionButtons.js +239 -0
- package/lib/commonjs/storage/components/StorageActions.js +192 -0
- package/lib/commonjs/storage/components/StorageBrowserMode.js +31 -0
- package/lib/commonjs/storage/components/StorageEventDetailContent.js +1025 -0
- package/lib/commonjs/storage/components/StorageEventFilterView.js +141 -0
- package/lib/commonjs/storage/components/StorageEventListener.js +357 -0
- package/lib/commonjs/storage/components/StorageEventsSection.js +24 -0
- package/lib/commonjs/storage/components/StorageFilterCards.js +345 -0
- package/lib/commonjs/storage/components/StorageFilterViewV2.js +42 -0
- package/lib/commonjs/storage/components/StorageKeyCard.js +516 -0
- package/lib/commonjs/storage/components/StorageKeyRow.js +356 -0
- package/lib/commonjs/storage/components/StorageKeySection.js +105 -0
- package/lib/commonjs/storage/components/StorageKeyStats.js +344 -0
- package/lib/commonjs/storage/components/StorageModalWithTabs.js +871 -0
- package/lib/commonjs/storage/components/StorageSection.js +43 -0
- package/lib/commonjs/storage/hooks/useAsyncStorageKeys.js +126 -0
- package/lib/commonjs/storage/hooks/useMMKVInstances.js +221 -0
- package/lib/commonjs/storage/hooks/useMMKVKeys.js +362 -0
- package/lib/commonjs/storage/hooks/useTickEverySecond.js +21 -0
- package/lib/commonjs/storage/index.js +148 -0
- package/lib/commonjs/storage/types.js +5 -0
- package/lib/commonjs/storage/utils/AsyncStorageListener.js +510 -0
- package/lib/commonjs/storage/utils/MMKVInstanceRegistry.js +202 -0
- package/lib/commonjs/storage/utils/MMKVListener.js +380 -0
- package/lib/commonjs/storage/utils/clearAllStorage.js +47 -0
- package/lib/commonjs/storage/utils/index.js +180 -0
- package/lib/commonjs/storage/utils/lineDiff.js +363 -0
- package/lib/commonjs/storage/utils/mmkvAvailability.js +62 -0
- package/lib/commonjs/storage/utils/mmkvTypeDetection.js +139 -0
- package/lib/commonjs/storage/utils/objectDiff.js +157 -0
- package/lib/commonjs/storage/utils/safeAsyncStorage.js +140 -0
- package/lib/commonjs/storage/utils/storageActionHelpers.js +46 -0
- package/lib/commonjs/storage/utils/storageQueryUtils.js +35 -0
- package/lib/commonjs/storage/utils/valueType.js +18 -0
- package/lib/module/index.js +7 -0
- package/lib/module/preset.js +89 -0
- package/lib/module/storage/components/DiffViewer/DiffOptionsPanel.js +352 -0
- package/lib/module/storage/components/DiffViewer/TreeDiffViewer.js +25 -0
- package/lib/module/storage/components/DiffViewer/components/DiffSummary.js +117 -0
- package/lib/module/storage/components/DiffViewer/modes/ThemedSplitView.js +415 -0
- package/lib/module/storage/components/DiffViewer/themes/diffThemes.js +118 -0
- package/lib/module/storage/components/GameUIStorageBrowser.js +922 -0
- package/lib/module/storage/components/GameUIStorageStats.js +742 -0
- package/lib/module/storage/components/MMKVInstanceInfoPanel.js +253 -0
- package/lib/module/storage/components/MMKVInstanceSelector.js +414 -0
- package/lib/module/storage/components/SelectionActionBar.js +221 -0
- package/lib/module/storage/components/StorageActionButtons.js +236 -0
- package/lib/module/storage/components/StorageActions.js +189 -0
- package/lib/module/storage/components/StorageBrowserMode.js +27 -0
- package/lib/module/storage/components/StorageEventDetailContent.js +1020 -0
- package/lib/module/storage/components/StorageEventFilterView.js +137 -0
- package/lib/module/storage/components/StorageEventListener.js +354 -0
- package/lib/module/storage/components/StorageEventsSection.js +20 -0
- package/lib/module/storage/components/StorageFilterCards.js +341 -0
- package/lib/module/storage/components/StorageFilterViewV2.js +38 -0
- package/lib/module/storage/components/StorageKeyCard.js +513 -0
- package/lib/module/storage/components/StorageKeyRow.js +353 -0
- package/lib/module/storage/components/StorageKeySection.js +101 -0
- package/lib/module/storage/components/StorageKeyStats.js +340 -0
- package/lib/module/storage/components/StorageModalWithTabs.js +867 -0
- package/lib/module/storage/components/StorageSection.js +40 -0
- package/lib/module/storage/hooks/useAsyncStorageKeys.js +121 -0
- package/lib/module/storage/hooks/useMMKVInstances.js +216 -0
- package/lib/module/storage/hooks/useMMKVKeys.js +359 -0
- package/lib/module/storage/hooks/useTickEverySecond.js +18 -0
- package/lib/module/storage/index.js +25 -0
- package/lib/module/storage/types.js +3 -0
- package/lib/module/storage/utils/AsyncStorageListener.js +500 -0
- package/lib/module/storage/utils/MMKVInstanceRegistry.js +196 -0
- package/lib/module/storage/utils/MMKVListener.js +367 -0
- package/lib/module/storage/utils/clearAllStorage.js +42 -0
- package/lib/module/storage/utils/index.js +22 -0
- package/lib/module/storage/utils/lineDiff.js +359 -0
- package/lib/module/storage/utils/mmkvAvailability.js +56 -0
- package/lib/module/storage/utils/mmkvTypeDetection.js +133 -0
- package/lib/module/storage/utils/objectDiff.js +153 -0
- package/lib/module/storage/utils/safeAsyncStorage.js +134 -0
- package/lib/module/storage/utils/storageActionHelpers.js +42 -0
- package/lib/module/storage/utils/storageQueryUtils.js +30 -0
- package/lib/module/storage/utils/valueType.js +14 -0
- package/lib/typescript/index.d.ts +3 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/preset.d.ts +90 -0
- package/lib/typescript/preset.d.ts.map +1 -0
- package/lib/typescript/storage/components/DiffViewer/DiffOptionsPanel.d.ts +18 -0
- package/lib/typescript/storage/components/DiffViewer/DiffOptionsPanel.d.ts.map +1 -0
- package/lib/typescript/storage/components/DiffViewer/TreeDiffViewer.d.ts +7 -0
- package/lib/typescript/storage/components/DiffViewer/TreeDiffViewer.d.ts.map +1 -0
- package/lib/typescript/storage/components/DiffViewer/components/DiffSummary.d.ts +12 -0
- package/lib/typescript/storage/components/DiffViewer/components/DiffSummary.d.ts.map +1 -0
- package/lib/typescript/storage/components/DiffViewer/modes/ThemedSplitView.d.ts +13 -0
- package/lib/typescript/storage/components/DiffViewer/modes/ThemedSplitView.d.ts.map +1 -0
- package/lib/typescript/storage/components/DiffViewer/themes/diffThemes.d.ts +64 -0
- package/lib/typescript/storage/components/DiffViewer/themes/diffThemes.d.ts.map +1 -0
- package/lib/typescript/storage/components/GameUIStorageBrowser.d.ts +16 -0
- package/lib/typescript/storage/components/GameUIStorageBrowser.d.ts.map +1 -0
- package/lib/typescript/storage/components/GameUIStorageStats.d.ts +7 -0
- package/lib/typescript/storage/components/GameUIStorageStats.d.ts.map +1 -0
- package/lib/typescript/storage/components/MMKVInstanceInfoPanel.d.ts +42 -0
- package/lib/typescript/storage/components/MMKVInstanceInfoPanel.d.ts.map +1 -0
- package/lib/typescript/storage/components/MMKVInstanceSelector.d.ts +35 -0
- package/lib/typescript/storage/components/MMKVInstanceSelector.d.ts.map +1 -0
- package/lib/typescript/storage/components/SelectionActionBar.d.ts +21 -0
- package/lib/typescript/storage/components/SelectionActionBar.d.ts.map +1 -0
- package/lib/typescript/storage/components/StorageActionButtons.d.ts +21 -0
- package/lib/typescript/storage/components/StorageActionButtons.d.ts.map +1 -0
- package/lib/typescript/storage/components/StorageActions.d.ts +10 -0
- package/lib/typescript/storage/components/StorageActions.d.ts.map +1 -0
- package/lib/typescript/storage/components/StorageBrowserMode.d.ts +18 -0
- package/lib/typescript/storage/components/StorageBrowserMode.d.ts.map +1 -0
- package/lib/typescript/storage/components/StorageEventDetailContent.d.ts +40 -0
- package/lib/typescript/storage/components/StorageEventDetailContent.d.ts.map +1 -0
- package/lib/typescript/storage/components/StorageEventFilterView.d.ts +11 -0
- package/lib/typescript/storage/components/StorageEventFilterView.d.ts.map +1 -0
- package/lib/typescript/storage/components/StorageEventListener.d.ts +6 -0
- package/lib/typescript/storage/components/StorageEventListener.d.ts.map +1 -0
- package/lib/typescript/storage/components/StorageEventsSection.d.ts +7 -0
- package/lib/typescript/storage/components/StorageEventsSection.d.ts.map +1 -0
- package/lib/typescript/storage/components/StorageFilterCards.d.ts +36 -0
- package/lib/typescript/storage/components/StorageFilterCards.d.ts.map +1 -0
- package/lib/typescript/storage/components/StorageFilterViewV2.d.ts +9 -0
- package/lib/typescript/storage/components/StorageFilterViewV2.d.ts.map +1 -0
- package/lib/typescript/storage/components/StorageKeyCard.d.ts +17 -0
- package/lib/typescript/storage/components/StorageKeyCard.d.ts.map +1 -0
- package/lib/typescript/storage/components/StorageKeyRow.d.ts +15 -0
- package/lib/typescript/storage/components/StorageKeyRow.d.ts.map +1 -0
- package/lib/typescript/storage/components/StorageKeySection.d.ts +25 -0
- package/lib/typescript/storage/components/StorageKeySection.d.ts.map +1 -0
- package/lib/typescript/storage/components/StorageKeyStats.d.ts +15 -0
- package/lib/typescript/storage/components/StorageKeyStats.d.ts.map +1 -0
- package/lib/typescript/storage/components/StorageModalWithTabs.d.ts +13 -0
- package/lib/typescript/storage/components/StorageModalWithTabs.d.ts.map +1 -0
- package/lib/typescript/storage/components/StorageSection.d.ts +10 -0
- package/lib/typescript/storage/components/StorageSection.d.ts.map +1 -0
- package/lib/typescript/storage/hooks/useAsyncStorageKeys.d.ts +10 -0
- package/lib/typescript/storage/hooks/useAsyncStorageKeys.d.ts.map +1 -0
- package/lib/typescript/storage/hooks/useMMKVInstances.d.ts +114 -0
- package/lib/typescript/storage/hooks/useMMKVInstances.d.ts.map +1 -0
- package/lib/typescript/storage/hooks/useMMKVKeys.d.ts +94 -0
- package/lib/typescript/storage/hooks/useMMKVKeys.d.ts.map +1 -0
- package/lib/typescript/storage/hooks/useTickEverySecond.d.ts +6 -0
- package/lib/typescript/storage/hooks/useTickEverySecond.d.ts.map +1 -0
- package/lib/typescript/storage/index.d.ts +15 -0
- package/lib/typescript/storage/index.d.ts.map +1 -0
- package/lib/typescript/storage/types.d.ts +41 -0
- package/lib/typescript/storage/types.d.ts.map +1 -0
- package/lib/typescript/storage/utils/AsyncStorageListener.d.ts +195 -0
- package/lib/typescript/storage/utils/AsyncStorageListener.d.ts.map +1 -0
- package/lib/typescript/storage/utils/MMKVInstanceRegistry.d.ts +224 -0
- package/lib/typescript/storage/utils/MMKVInstanceRegistry.d.ts.map +1 -0
- package/lib/typescript/storage/utils/MMKVListener.d.ts +218 -0
- package/lib/typescript/storage/utils/MMKVListener.d.ts.map +1 -0
- package/lib/typescript/storage/utils/clearAllStorage.d.ts +11 -0
- package/lib/typescript/storage/utils/clearAllStorage.d.ts.map +1 -0
- package/lib/typescript/storage/utils/index.d.ts +8 -0
- package/lib/typescript/storage/utils/index.d.ts.map +1 -0
- package/lib/typescript/storage/utils/lineDiff.d.ts +34 -0
- package/lib/typescript/storage/utils/lineDiff.d.ts.map +1 -0
- package/lib/typescript/storage/utils/mmkvAvailability.d.ts +23 -0
- package/lib/typescript/storage/utils/mmkvAvailability.d.ts.map +1 -0
- package/lib/typescript/storage/utils/mmkvTypeDetection.d.ts +71 -0
- package/lib/typescript/storage/utils/mmkvTypeDetection.d.ts.map +1 -0
- package/lib/typescript/storage/utils/objectDiff.d.ts +35 -0
- package/lib/typescript/storage/utils/objectDiff.d.ts.map +1 -0
- package/lib/typescript/storage/utils/safeAsyncStorage.d.ts +56 -0
- package/lib/typescript/storage/utils/safeAsyncStorage.d.ts.map +1 -0
- package/lib/typescript/storage/utils/storageActionHelpers.d.ts +5 -0
- package/lib/typescript/storage/utils/storageActionHelpers.d.ts.map +1 -0
- package/lib/typescript/storage/utils/storageQueryUtils.d.ts +6 -0
- package/lib/typescript/storage/utils/storageQueryUtils.d.ts.map +1 -0
- package/lib/typescript/storage/utils/valueType.d.ts +3 -0
- package/lib/typescript/storage/utils/valueType.d.ts.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { View, Text, StyleSheet } from "react-native";
|
|
4
|
+
import { AlertCircle, CheckCircle2, XCircle, Eye, Database, Shield } from "@buoy-gg/shared-ui";
|
|
5
|
+
import { getStorageTypeHexColor } from "../utils/storageQueryUtils";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
// Variable type configurations matching env vars design
|
|
8
|
+
const variableTypeData = [{
|
|
9
|
+
key: "valid",
|
|
10
|
+
label: "Valid Keys",
|
|
11
|
+
description: "Correctly stored and accessible",
|
|
12
|
+
icon: CheckCircle2,
|
|
13
|
+
color: "#10B981",
|
|
14
|
+
textColor: "#10B981",
|
|
15
|
+
bgColor: "rgba(16, 185, 129, 0.1)"
|
|
16
|
+
}, {
|
|
17
|
+
key: "missing",
|
|
18
|
+
label: "Missing Keys",
|
|
19
|
+
description: "Required but not found",
|
|
20
|
+
icon: AlertCircle,
|
|
21
|
+
color: "#EF4444",
|
|
22
|
+
textColor: "#EF4444",
|
|
23
|
+
bgColor: "rgba(239, 68, 68, 0.1)"
|
|
24
|
+
}, {
|
|
25
|
+
key: "wrongValue",
|
|
26
|
+
label: "Wrong Values",
|
|
27
|
+
description: "Stored but incorrect value",
|
|
28
|
+
icon: XCircle,
|
|
29
|
+
color: "#F97316",
|
|
30
|
+
textColor: "#F97316",
|
|
31
|
+
bgColor: "rgba(249, 115, 22, 0.1)"
|
|
32
|
+
}, {
|
|
33
|
+
key: "wrongType",
|
|
34
|
+
label: "Wrong Types",
|
|
35
|
+
description: "Value has incorrect data type",
|
|
36
|
+
icon: XCircle,
|
|
37
|
+
color: "#0891B2",
|
|
38
|
+
textColor: "#0891B2",
|
|
39
|
+
bgColor: "rgba(8, 145, 178, 0.1)"
|
|
40
|
+
}, {
|
|
41
|
+
key: "optional",
|
|
42
|
+
label: "Optional Keys",
|
|
43
|
+
description: "Available but not required",
|
|
44
|
+
icon: Eye,
|
|
45
|
+
color: "#8B5CF6",
|
|
46
|
+
textColor: "#8B5CF6",
|
|
47
|
+
bgColor: "rgba(139, 92, 246, 0.1)"
|
|
48
|
+
}];
|
|
49
|
+
|
|
50
|
+
// Storage type breakdown data
|
|
51
|
+
const storageTypeData = [{
|
|
52
|
+
key: "mmkv",
|
|
53
|
+
label: "MMKV",
|
|
54
|
+
description: "High-performance key-value storage",
|
|
55
|
+
icon: Database
|
|
56
|
+
}, {
|
|
57
|
+
key: "async",
|
|
58
|
+
label: "AsyncStorage",
|
|
59
|
+
description: "React Native async storage",
|
|
60
|
+
icon: Database
|
|
61
|
+
}, {
|
|
62
|
+
key: "secure",
|
|
63
|
+
label: "SecureStorage",
|
|
64
|
+
description: "Encrypted secure storage",
|
|
65
|
+
icon: Shield
|
|
66
|
+
}];
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Storage key stats component following composition principles [[rule3]]
|
|
70
|
+
*
|
|
71
|
+
* Applied principles:
|
|
72
|
+
* - Decompose by Responsibility: Single purpose component for storage stats display
|
|
73
|
+
* - Prefer Composition over Configuration: Reuses patterns from EnvVarStats
|
|
74
|
+
* - Extract Reusable Logic: Shares visualization patterns with env vars
|
|
75
|
+
*/
|
|
76
|
+
export function StorageKeyStatsSection({
|
|
77
|
+
stats
|
|
78
|
+
}) {
|
|
79
|
+
const {
|
|
80
|
+
totalCount,
|
|
81
|
+
missingCount,
|
|
82
|
+
wrongValueCount,
|
|
83
|
+
wrongTypeCount,
|
|
84
|
+
presentRequiredCount,
|
|
85
|
+
optionalCount,
|
|
86
|
+
mmkvCount,
|
|
87
|
+
asyncCount,
|
|
88
|
+
secureCount
|
|
89
|
+
} = stats;
|
|
90
|
+
|
|
91
|
+
// If no storage keys at all, show minimal stats
|
|
92
|
+
if (totalCount === 0) {
|
|
93
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
94
|
+
style: styles.statsContainer,
|
|
95
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
96
|
+
style: styles.sectionTitle,
|
|
97
|
+
children: "STORAGE BREAKDOWN"
|
|
98
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
99
|
+
style: styles.emptyState,
|
|
100
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
101
|
+
style: styles.emptyStateText,
|
|
102
|
+
children: "No storage keys detected"
|
|
103
|
+
})
|
|
104
|
+
})]
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
108
|
+
style: styles.statsContainer,
|
|
109
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
110
|
+
style: styles.breakdownSection,
|
|
111
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
112
|
+
style: styles.sectionTitle,
|
|
113
|
+
children: "KEY STATUS BREAKDOWN"
|
|
114
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
115
|
+
style: styles.breakdownList,
|
|
116
|
+
children: variableTypeData.map(item => {
|
|
117
|
+
let count = 0;
|
|
118
|
+
let shouldShow = false;
|
|
119
|
+
switch (item.key) {
|
|
120
|
+
case "valid":
|
|
121
|
+
count = presentRequiredCount;
|
|
122
|
+
shouldShow = count > 0;
|
|
123
|
+
break;
|
|
124
|
+
case "missing":
|
|
125
|
+
count = missingCount;
|
|
126
|
+
shouldShow = count > 0;
|
|
127
|
+
break;
|
|
128
|
+
case "wrongValue":
|
|
129
|
+
count = wrongValueCount;
|
|
130
|
+
shouldShow = count > 0;
|
|
131
|
+
break;
|
|
132
|
+
case "wrongType":
|
|
133
|
+
count = wrongTypeCount;
|
|
134
|
+
shouldShow = count > 0;
|
|
135
|
+
break;
|
|
136
|
+
case "optional":
|
|
137
|
+
count = optionalCount;
|
|
138
|
+
shouldShow = count > 0;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
if (!shouldShow) return null;
|
|
142
|
+
const percentage = totalCount > 0 ? (count / totalCount * 100).toFixed(1) : "0";
|
|
143
|
+
const IconComponent = item.icon;
|
|
144
|
+
return /*#__PURE__*/_jsx(View, {
|
|
145
|
+
style: styles.breakdownItem,
|
|
146
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
147
|
+
style: styles.breakdownItemRow,
|
|
148
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
149
|
+
style: styles.breakdownItemLeft,
|
|
150
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
151
|
+
style: [styles.breakdownIcon, {
|
|
152
|
+
backgroundColor: item.bgColor
|
|
153
|
+
}],
|
|
154
|
+
children: /*#__PURE__*/_jsx(IconComponent, {
|
|
155
|
+
size: 14,
|
|
156
|
+
color: item.color
|
|
157
|
+
})
|
|
158
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
159
|
+
style: styles.breakdownItemInfo,
|
|
160
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
161
|
+
style: styles.breakdownItemLabel,
|
|
162
|
+
children: item.label
|
|
163
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
164
|
+
style: styles.breakdownItemDesc,
|
|
165
|
+
children: item.description
|
|
166
|
+
})]
|
|
167
|
+
})]
|
|
168
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
169
|
+
style: styles.breakdownItemRight,
|
|
170
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
171
|
+
style: [styles.breakdownCount, {
|
|
172
|
+
color: item.textColor
|
|
173
|
+
}],
|
|
174
|
+
children: count
|
|
175
|
+
}), /*#__PURE__*/_jsxs(Text, {
|
|
176
|
+
style: styles.breakdownPercentage,
|
|
177
|
+
children: [percentage, "%"]
|
|
178
|
+
})]
|
|
179
|
+
})]
|
|
180
|
+
})
|
|
181
|
+
}, item.key);
|
|
182
|
+
})
|
|
183
|
+
})]
|
|
184
|
+
}), (mmkvCount > 0 || asyncCount > 0 || secureCount > 0) && /*#__PURE__*/_jsxs(View, {
|
|
185
|
+
style: styles.breakdownSection,
|
|
186
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
187
|
+
style: styles.sectionTitle,
|
|
188
|
+
children: "STORAGE TYPE BREAKDOWN"
|
|
189
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
190
|
+
style: styles.breakdownList,
|
|
191
|
+
children: storageTypeData.map(item => {
|
|
192
|
+
let count = 0;
|
|
193
|
+
let shouldShow = false;
|
|
194
|
+
switch (item.key) {
|
|
195
|
+
case "mmkv":
|
|
196
|
+
count = mmkvCount;
|
|
197
|
+
shouldShow = count > 0;
|
|
198
|
+
break;
|
|
199
|
+
case "async":
|
|
200
|
+
count = asyncCount;
|
|
201
|
+
shouldShow = count > 0;
|
|
202
|
+
break;
|
|
203
|
+
case "secure":
|
|
204
|
+
count = secureCount;
|
|
205
|
+
shouldShow = count > 0;
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
if (!shouldShow) return null;
|
|
209
|
+
const percentage = totalCount > 0 ? (count / totalCount * 100).toFixed(1) : "0";
|
|
210
|
+
const IconComponent = item.icon;
|
|
211
|
+
const storageColor = getStorageTypeHexColor(item.key);
|
|
212
|
+
return /*#__PURE__*/_jsx(View, {
|
|
213
|
+
style: styles.breakdownItem,
|
|
214
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
215
|
+
style: styles.breakdownItemRow,
|
|
216
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
217
|
+
style: styles.breakdownItemLeft,
|
|
218
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
219
|
+
style: [styles.breakdownIcon, {
|
|
220
|
+
backgroundColor: `${storageColor}15`
|
|
221
|
+
}],
|
|
222
|
+
children: /*#__PURE__*/_jsx(IconComponent, {
|
|
223
|
+
size: 14,
|
|
224
|
+
color: storageColor
|
|
225
|
+
})
|
|
226
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
227
|
+
style: styles.breakdownItemInfo,
|
|
228
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
229
|
+
style: styles.breakdownItemLabel,
|
|
230
|
+
children: item.label
|
|
231
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
232
|
+
style: styles.breakdownItemDesc,
|
|
233
|
+
children: item.description
|
|
234
|
+
})]
|
|
235
|
+
})]
|
|
236
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
237
|
+
style: styles.breakdownItemRight,
|
|
238
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
239
|
+
style: [styles.breakdownCount, {
|
|
240
|
+
color: storageColor
|
|
241
|
+
}],
|
|
242
|
+
children: count
|
|
243
|
+
}), /*#__PURE__*/_jsxs(Text, {
|
|
244
|
+
style: styles.breakdownPercentage,
|
|
245
|
+
children: [percentage, "%"]
|
|
246
|
+
})]
|
|
247
|
+
})]
|
|
248
|
+
})
|
|
249
|
+
}, item.key);
|
|
250
|
+
})
|
|
251
|
+
})]
|
|
252
|
+
})]
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
const styles = StyleSheet.create({
|
|
256
|
+
statsContainer: {
|
|
257
|
+
marginBottom: 24,
|
|
258
|
+
backgroundColor: "rgba(255, 255, 255, 0.03)",
|
|
259
|
+
borderRadius: 8,
|
|
260
|
+
padding: 16,
|
|
261
|
+
borderWidth: 1,
|
|
262
|
+
borderColor: "rgba(255, 255, 255, 0.08)"
|
|
263
|
+
},
|
|
264
|
+
// Section titles
|
|
265
|
+
sectionTitle: {
|
|
266
|
+
color: "#9CA3AF",
|
|
267
|
+
fontSize: 12,
|
|
268
|
+
fontWeight: "500",
|
|
269
|
+
marginBottom: 16,
|
|
270
|
+
textTransform: "uppercase",
|
|
271
|
+
letterSpacing: 0.5
|
|
272
|
+
},
|
|
273
|
+
// Breakdown section
|
|
274
|
+
breakdownSection: {
|
|
275
|
+
gap: 12,
|
|
276
|
+
marginBottom: 20
|
|
277
|
+
},
|
|
278
|
+
breakdownList: {
|
|
279
|
+
gap: 12
|
|
280
|
+
},
|
|
281
|
+
breakdownItem: {
|
|
282
|
+
backgroundColor: "rgba(255, 255, 255, 0.02)",
|
|
283
|
+
padding: 12,
|
|
284
|
+
borderRadius: 8,
|
|
285
|
+
borderWidth: 1,
|
|
286
|
+
borderColor: "rgba(255, 255, 255, 0.05)"
|
|
287
|
+
},
|
|
288
|
+
breakdownItemRow: {
|
|
289
|
+
flexDirection: "row",
|
|
290
|
+
alignItems: "center",
|
|
291
|
+
justifyContent: "space-between"
|
|
292
|
+
},
|
|
293
|
+
breakdownItemLeft: {
|
|
294
|
+
flexDirection: "row",
|
|
295
|
+
alignItems: "center",
|
|
296
|
+
gap: 12,
|
|
297
|
+
flex: 1,
|
|
298
|
+
minWidth: 0
|
|
299
|
+
},
|
|
300
|
+
breakdownIcon: {
|
|
301
|
+
padding: 8,
|
|
302
|
+
borderRadius: 8
|
|
303
|
+
},
|
|
304
|
+
breakdownItemInfo: {
|
|
305
|
+
flex: 1,
|
|
306
|
+
minWidth: 0
|
|
307
|
+
},
|
|
308
|
+
breakdownItemLabel: {
|
|
309
|
+
color: "#FFFFFF",
|
|
310
|
+
fontSize: 14,
|
|
311
|
+
fontWeight: "500"
|
|
312
|
+
},
|
|
313
|
+
breakdownItemDesc: {
|
|
314
|
+
color: "#9CA3AF",
|
|
315
|
+
fontSize: 12
|
|
316
|
+
},
|
|
317
|
+
breakdownItemRight: {
|
|
318
|
+
alignItems: "flex-end"
|
|
319
|
+
},
|
|
320
|
+
breakdownCount: {
|
|
321
|
+
fontSize: 16,
|
|
322
|
+
fontWeight: "600"
|
|
323
|
+
},
|
|
324
|
+
breakdownPercentage: {
|
|
325
|
+
color: "#6B7280",
|
|
326
|
+
fontSize: 10
|
|
327
|
+
},
|
|
328
|
+
// Empty state
|
|
329
|
+
emptyState: {
|
|
330
|
+
padding: 16,
|
|
331
|
+
backgroundColor: "rgba(255, 255, 255, 0.02)",
|
|
332
|
+
borderRadius: 6,
|
|
333
|
+
alignItems: "center"
|
|
334
|
+
},
|
|
335
|
+
emptyStateText: {
|
|
336
|
+
color: "#6B7280",
|
|
337
|
+
fontSize: 11,
|
|
338
|
+
textAlign: "center"
|
|
339
|
+
}
|
|
340
|
+
});
|