@buoy-gg/storage 7.0.40 → 7.0.42
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 +11 -86
- package/lib/commonjs/index.js +1 -346
- package/lib/commonjs/preset.js +1 -80
- package/lib/commonjs/storage/components/DiffViewer/TreeDiffViewer.js +1 -36
- package/lib/commonjs/storage/components/DiffViewer/modes/ThemedSplitView.js +1 -12
- package/lib/commonjs/storage/components/DiffViewer/themes/diffThemes.js +1 -24
- package/lib/commonjs/storage/components/GameUIStorageBrowser.js +3 -1258
- package/lib/commonjs/storage/components/MMKVInstanceInfoPanel.js +1 -257
- package/lib/commonjs/storage/components/MMKVInstanceSelector.js +1 -418
- package/lib/commonjs/storage/components/SelectionActionBar.js +1 -207
- package/lib/commonjs/storage/components/StorageActionButtons.js +1 -241
- package/lib/commonjs/storage/components/StorageBrowserMode.js +1 -61
- package/lib/commonjs/storage/components/StorageEventActionButton.js +1 -121
- package/lib/commonjs/storage/components/StorageEventCard.js +1 -117
- package/lib/commonjs/storage/components/StorageEventDetailContent.js +1 -494
- package/lib/commonjs/storage/components/StorageEventFilterView.js +1 -159
- package/lib/commonjs/storage/components/StorageEventsSection.js +1 -24
- package/lib/commonjs/storage/components/StorageFilterCards.js +1 -231
- package/lib/commonjs/storage/components/StorageKeyCard.js +1 -520
- package/lib/commonjs/storage/components/StorageKeyDetailScreen.js +1 -579
- package/lib/commonjs/storage/components/StorageKeyRow.js +1 -559
- package/lib/commonjs/storage/components/StorageKeySection.js +1 -160
- package/lib/commonjs/storage/components/StorageKeyStats.js +1 -344
- package/lib/commonjs/storage/components/StorageModalWithTabs.js +1 -954
- package/lib/commonjs/storage/components/StorageSaveNotice.js +1 -171
- package/lib/commonjs/storage/components/StorageSection.js +1 -43
- package/lib/commonjs/storage/components/StorageTypeFilterBar.js +1 -143
- package/lib/commonjs/storage/hooks/useAsyncStorageKeys.js +1 -141
- package/lib/commonjs/storage/hooks/useMMKVInstances.js +1 -210
- package/lib/commonjs/storage/hooks/useMMKVKeys.js +1 -376
- package/lib/commonjs/storage/hooks/useSecureStoreKeys.js +1 -159
- package/lib/commonjs/storage/hooks/useStorageEvents.js +1 -61
- package/lib/commonjs/storage/stores/storageEventStore.js +1 -312
- package/lib/commonjs/storage/sync/storageSyncAdapter.js +1 -478
- package/lib/commonjs/storage/types.js +1 -5
- package/lib/commonjs/storage/utils/AsyncStorageListener.js +1 -691
- package/lib/commonjs/storage/utils/AsyncStorageListener.web.js +1 -0
- package/lib/commonjs/storage/utils/MMKVInstanceRegistry.js +1 -203
- package/lib/commonjs/storage/utils/MMKVListener.js +1 -416
- package/lib/commonjs/storage/utils/SecureStoreRegistry.js +1 -200
- package/lib/commonjs/storage/utils/asyncStorageCompat.js +1 -89
- package/lib/commonjs/storage/utils/browserStorageLifecycle.js +1 -0
- package/lib/commonjs/storage/utils/browserStorageLifecycle.web.js +1 -0
- package/lib/commonjs/storage/utils/clearAllStorage.js +1 -48
- package/lib/commonjs/storage/utils/deleteStorageKeys.js +1 -82
- package/lib/commonjs/storage/utils/lineDiff.js +1 -30
- package/lib/commonjs/storage/utils/mmkvAvailability.js +1 -62
- package/lib/commonjs/storage/utils/mmkvAvailability.web.js +1 -0
- package/lib/commonjs/storage/utils/mmkvTypeDetection.js +1 -154
- package/lib/commonjs/storage/utils/requiredStorageKeyScope.js +1 -17
- package/lib/commonjs/storage/utils/setStorageValue.js +1 -218
- package/lib/commonjs/storage/utils/snapshotProvider.js +1 -382
- package/lib/commonjs/storage/utils/storageActionHelpers.js +1 -46
- package/lib/commonjs/storage/utils/storageBrowserRefresh.js +1 -49
- package/lib/commonjs/storage/utils/storageLabels.js +1 -0
- package/lib/commonjs/storage/utils/storageLabels.web.js +1 -0
- package/lib/commonjs/storage/utils/storageOps.js +1 -53
- package/lib/commonjs/storage/utils/storageQueryUtils.js +1 -35
- package/lib/commonjs/storage/utils/storageTimeTravelUtils.js +1 -288
- package/lib/commonjs/storage/utils/valueType.js +1 -83
- package/lib/module/index.js +1 -112
- package/lib/module/preset.js +1 -76
- package/lib/module/storage/components/DiffViewer/TreeDiffViewer.js +1 -32
- package/lib/module/storage/components/DiffViewer/modes/ThemedSplitView.js +1 -9
- package/lib/module/storage/components/DiffViewer/themes/diffThemes.js +1 -10
- package/lib/module/storage/components/GameUIStorageBrowser.js +3 -1256
- package/lib/module/storage/components/MMKVInstanceInfoPanel.js +1 -253
- package/lib/module/storage/components/MMKVInstanceSelector.js +1 -414
- package/lib/module/storage/components/SelectionActionBar.js +1 -204
- package/lib/module/storage/components/StorageActionButtons.js +1 -237
- package/lib/module/storage/components/StorageBrowserMode.js +1 -57
- package/lib/module/storage/components/StorageEventActionButton.js +1 -118
- package/lib/module/storage/components/StorageEventCard.js +1 -112
- package/lib/module/storage/components/StorageEventDetailContent.js +1 -490
- package/lib/module/storage/components/StorageEventFilterView.js +1 -155
- package/lib/module/storage/components/StorageEventsSection.js +1 -20
- package/lib/module/storage/components/StorageFilterCards.js +1 -227
- package/lib/module/storage/components/StorageKeyCard.js +1 -517
- package/lib/module/storage/components/StorageKeyDetailScreen.js +1 -577
- package/lib/module/storage/components/StorageKeyRow.js +1 -554
- package/lib/module/storage/components/StorageKeySection.js +1 -155
- package/lib/module/storage/components/StorageKeyStats.js +1 -341
- package/lib/module/storage/components/StorageModalWithTabs.js +1 -949
- package/lib/module/storage/components/StorageSaveNotice.js +1 -168
- package/lib/module/storage/components/StorageSection.js +1 -40
- package/lib/module/storage/components/StorageTypeFilterBar.js +1 -138
- package/lib/module/storage/hooks/useAsyncStorageKeys.js +1 -136
- package/lib/module/storage/hooks/useMMKVInstances.js +1 -204
- package/lib/module/storage/hooks/useMMKVKeys.js +1 -371
- package/lib/module/storage/hooks/useSecureStoreKeys.js +1 -156
- package/lib/module/storage/hooks/useStorageEvents.js +1 -58
- package/lib/module/storage/stores/storageEventStore.js +1 -301
- package/lib/module/storage/sync/storageSyncAdapter.js +1 -474
- package/lib/module/storage/types.js +1 -3
- package/lib/module/storage/utils/AsyncStorageListener.js +1 -679
- package/lib/module/storage/utils/AsyncStorageListener.web.js +1 -0
- package/lib/module/storage/utils/MMKVInstanceRegistry.js +1 -197
- package/lib/module/storage/utils/MMKVListener.js +1 -403
- package/lib/module/storage/utils/SecureStoreRegistry.js +1 -194
- package/lib/module/storage/utils/asyncStorageCompat.js +1 -81
- package/lib/module/storage/utils/browserStorageLifecycle.js +1 -0
- package/lib/module/storage/utils/browserStorageLifecycle.web.js +1 -0
- package/lib/module/storage/utils/clearAllStorage.js +1 -43
- package/lib/module/storage/utils/deleteStorageKeys.js +1 -78
- package/lib/module/storage/utils/lineDiff.js +1 -12
- package/lib/module/storage/utils/mmkvAvailability.js +1 -56
- package/lib/module/storage/utils/mmkvAvailability.web.js +1 -0
- package/lib/module/storage/utils/mmkvTypeDetection.js +1 -148
- package/lib/module/storage/utils/requiredStorageKeyScope.js +1 -13
- package/lib/module/storage/utils/setStorageValue.js +1 -209
- package/lib/module/storage/utils/snapshotProvider.js +1 -380
- package/lib/module/storage/utils/storageActionHelpers.js +1 -42
- package/lib/module/storage/utils/storageBrowserRefresh.js +1 -44
- package/lib/module/storage/utils/storageLabels.js +1 -0
- package/lib/module/storage/utils/storageLabels.web.js +1 -0
- package/lib/module/storage/utils/storageOps.js +1 -46
- package/lib/module/storage/utils/storageQueryUtils.js +1 -30
- package/lib/module/storage/utils/storageTimeTravelUtils.js +1 -281
- package/lib/module/storage/utils/valueType.js +1 -76
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/storage/components/MMKVInstanceSelector.d.ts +0 -8
- package/lib/typescript/storage/components/StorageEventCard.d.ts +0 -7
- package/lib/typescript/storage/components/StorageKeyRow.d.ts +2 -6
- package/lib/typescript/storage/components/StorageTypeFilterBar.d.ts +0 -15
- package/lib/typescript/storage/hooks/useSecureStoreKeys.d.ts +2 -2
- package/lib/typescript/storage/sync/storageSyncAdapter.d.ts +7 -13
- package/lib/typescript/storage/utils/AsyncStorageListener.web.d.ts +24 -0
- package/lib/typescript/storage/utils/browserStorageLifecycle.d.ts +3 -0
- package/lib/typescript/storage/utils/browserStorageLifecycle.web.d.ts +2 -0
- package/lib/typescript/storage/utils/mmkvAvailability.web.d.ts +4 -0
- package/lib/typescript/storage/utils/storageLabels.d.ts +8 -0
- package/lib/typescript/storage/utils/storageLabels.web.d.ts +8 -0
- package/lib/web/index.mjs +4 -0
- package/package.json +40 -14
- package/lib/commonjs/storage/components/DiffViewer/DiffOptionsPanel.js +0 -356
- package/lib/commonjs/storage/components/DiffViewer/components/DiffSummary.js +0 -122
- package/lib/commonjs/storage/components/StorageKeyEditorScreen.js +0 -414
- package/lib/commonjs/storage/components/StorageScalarKeyEditor.js +0 -61
- package/lib/commonjs/storage/components/StorageValueEditModal.js +0 -24
- package/lib/commonjs/storage/hooks/useKeyEditor.js +0 -31
- package/lib/commonjs/storage/hooks/useTreeDraft.js +0 -25
- package/lib/module/storage/components/DiffViewer/DiffOptionsPanel.js +0 -352
- package/lib/module/storage/components/DiffViewer/components/DiffSummary.js +0 -118
- package/lib/module/storage/components/StorageKeyEditorScreen.js +0 -410
- package/lib/module/storage/components/StorageScalarKeyEditor.js +0 -57
- package/lib/module/storage/components/StorageValueEditModal.js +0 -20
- package/lib/module/storage/hooks/useKeyEditor.js +0 -27
- package/lib/module/storage/hooks/useTreeDraft.js +0 -21
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/preset.d.ts.map +0 -1
- package/lib/typescript/storage/components/DiffViewer/DiffOptionsPanel.d.ts +0 -18
- package/lib/typescript/storage/components/DiffViewer/DiffOptionsPanel.d.ts.map +0 -1
- package/lib/typescript/storage/components/DiffViewer/TreeDiffViewer.d.ts.map +0 -1
- package/lib/typescript/storage/components/DiffViewer/components/DiffSummary.d.ts +0 -12
- package/lib/typescript/storage/components/DiffViewer/components/DiffSummary.d.ts.map +0 -1
- package/lib/typescript/storage/components/DiffViewer/modes/ThemedSplitView.d.ts.map +0 -1
- package/lib/typescript/storage/components/DiffViewer/themes/diffThemes.d.ts.map +0 -1
- package/lib/typescript/storage/components/GameUIStorageBrowser.d.ts.map +0 -1
- package/lib/typescript/storage/components/MMKVInstanceInfoPanel.d.ts.map +0 -1
- package/lib/typescript/storage/components/MMKVInstanceSelector.d.ts.map +0 -1
- package/lib/typescript/storage/components/SelectionActionBar.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageActionButtons.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageBrowserMode.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageEventActionButton.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageEventCard.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageEventDetailContent.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageEventFilterView.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageEventsSection.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageFilterCards.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageKeyCard.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageKeyDetailScreen.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageKeyEditorScreen.d.ts +0 -42
- package/lib/typescript/storage/components/StorageKeyEditorScreen.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageKeyRow.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageKeySection.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageKeyStats.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageModalWithTabs.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageSaveNotice.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageScalarKeyEditor.d.ts +0 -24
- package/lib/typescript/storage/components/StorageScalarKeyEditor.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageSection.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageTypeFilterBar.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageValueEditModal.d.ts +0 -14
- package/lib/typescript/storage/components/StorageValueEditModal.d.ts.map +0 -1
- package/lib/typescript/storage/hooks/useAsyncStorageKeys.d.ts.map +0 -1
- package/lib/typescript/storage/hooks/useKeyEditor.d.ts +0 -27
- package/lib/typescript/storage/hooks/useKeyEditor.d.ts.map +0 -1
- package/lib/typescript/storage/hooks/useMMKVInstances.d.ts.map +0 -1
- package/lib/typescript/storage/hooks/useMMKVKeys.d.ts.map +0 -1
- package/lib/typescript/storage/hooks/useSecureStoreKeys.d.ts.map +0 -1
- package/lib/typescript/storage/hooks/useStorageEvents.d.ts.map +0 -1
- package/lib/typescript/storage/hooks/useTreeDraft.d.ts +0 -16
- package/lib/typescript/storage/hooks/useTreeDraft.d.ts.map +0 -1
- package/lib/typescript/storage/stores/storageEventStore.d.ts.map +0 -1
- package/lib/typescript/storage/sync/storageSyncAdapter.d.ts.map +0 -1
- package/lib/typescript/storage/types.d.ts.map +0 -1
- package/lib/typescript/storage/utils/AsyncStorageListener.d.ts.map +0 -1
- package/lib/typescript/storage/utils/MMKVInstanceRegistry.d.ts.map +0 -1
- package/lib/typescript/storage/utils/MMKVListener.d.ts.map +0 -1
- package/lib/typescript/storage/utils/SecureStoreRegistry.d.ts.map +0 -1
- package/lib/typescript/storage/utils/asyncStorageCompat.d.ts.map +0 -1
- package/lib/typescript/storage/utils/clearAllStorage.d.ts.map +0 -1
- package/lib/typescript/storage/utils/deleteStorageKeys.d.ts.map +0 -1
- package/lib/typescript/storage/utils/lineDiff.d.ts.map +0 -1
- package/lib/typescript/storage/utils/mmkvAvailability.d.ts.map +0 -1
- package/lib/typescript/storage/utils/mmkvTypeDetection.d.ts.map +0 -1
- package/lib/typescript/storage/utils/requiredStorageKeyScope.d.ts.map +0 -1
- package/lib/typescript/storage/utils/setStorageValue.d.ts.map +0 -1
- package/lib/typescript/storage/utils/snapshotProvider.d.ts.map +0 -1
- package/lib/typescript/storage/utils/storageActionHelpers.d.ts.map +0 -1
- package/lib/typescript/storage/utils/storageBrowserRefresh.d.ts.map +0 -1
- package/lib/typescript/storage/utils/storageOps.d.ts.map +0 -1
- package/lib/typescript/storage/utils/storageQueryUtils.d.ts.map +0 -1
- package/lib/typescript/storage/utils/storageTimeTravelUtils.d.ts.map +0 -1
- package/lib/typescript/storage/utils/valueType.d.ts.map +0 -1
|
@@ -1,155 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { useCallback, useState } from "react";
|
|
4
|
-
import { View, Text, StyleSheet } from "react-native";
|
|
5
|
-
import { StorageKeyRow } from "./StorageKeyRow";
|
|
6
|
-
import { SectionHeader, night } from "@buoy-gg/shared-ui";
|
|
7
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
-
/**
|
|
9
|
-
* Identifies a ROW, not a key name — the same name routinely exists in more
|
|
10
|
-
* than one backend. Shared with the browser so both sides agree on the id.
|
|
11
|
-
*/
|
|
12
|
-
export function storageRowId(storageKey) {
|
|
13
|
-
return storageKey.instanceId ? `${storageKey.storageType}-${storageKey.instanceId}-${storageKey.key}` : `${storageKey.storageType}-${storageKey.key}`;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Storage key section component following composition principles [[rule3]]
|
|
17
|
-
*
|
|
18
|
-
* Applied principles:
|
|
19
|
-
* - Decompose by Responsibility: Single purpose component for grouped storage keys
|
|
20
|
-
* - Prefer Composition over Configuration: Reuses patterns from EnvVarSection
|
|
21
|
-
* - Extract Reusable Logic: Shares expansion state management pattern
|
|
22
|
-
*/
|
|
23
|
-
export function StorageKeySection({
|
|
24
|
-
title,
|
|
25
|
-
count,
|
|
26
|
-
keys,
|
|
27
|
-
emptyMessage,
|
|
28
|
-
headerColor,
|
|
29
|
-
isSelectMode = false,
|
|
30
|
-
selectedKeys = new Set(),
|
|
31
|
-
onSelectionChange,
|
|
32
|
-
eventCountByKey,
|
|
33
|
-
onViewHistory,
|
|
34
|
-
onHideKey,
|
|
35
|
-
pinnedKeys,
|
|
36
|
-
onTogglePin,
|
|
37
|
-
onEditKey,
|
|
38
|
-
onToggleKey,
|
|
39
|
-
onDeleteKey,
|
|
40
|
-
editBlockedFor,
|
|
41
|
-
onRowRef,
|
|
42
|
-
onOpenKey
|
|
43
|
-
}) {
|
|
44
|
-
/**
|
|
45
|
-
* Identifies a ROW, not a key name.
|
|
46
|
-
*
|
|
47
|
-
* The same name routinely exists in more than one place — an app that keeps
|
|
48
|
-
* `auth.refreshToken` in both MMKV and the keychain has two rows called
|
|
49
|
-
* that, and they are different values in different stores.
|
|
50
|
-
*/
|
|
51
|
-
const getKeyIdentifier = useCallback(storageKey => storageRowId(storageKey), []);
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Which ROW is expanded — by identifier, not by key name.
|
|
55
|
-
*
|
|
56
|
-
* Keyed by name, tapping one of a pair of same-named rows opened BOTH of
|
|
57
|
-
* them: two cards, two value trees, and two Edit buttons, one of which
|
|
58
|
-
* writes to a store you weren't looking at.
|
|
59
|
-
*/
|
|
60
|
-
const [expandedKey, setExpandedKey] = useState(null);
|
|
61
|
-
const handleKeyPress = useCallback(storageKey => {
|
|
62
|
-
// Fiber-driven automation can invoke the ROW's onPress prop directly,
|
|
63
|
-
// handing this a GestureResponderEvent instead of the key the row's own
|
|
64
|
-
// touchable wrapper binds. Rendering an event as a key produced a
|
|
65
|
-
// convincing all-"undefined" detail screen; refuse anything that isn't
|
|
66
|
-
// a key.
|
|
67
|
-
if (!storageKey || typeof storageKey.key !== "string") return;
|
|
68
|
-
if (onOpenKey) {
|
|
69
|
-
// Navigate-to-detail hosts: the card is a door, not a drawer.
|
|
70
|
-
onOpenKey(storageKey);
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
const id = getKeyIdentifier(storageKey);
|
|
74
|
-
setExpandedKey(prev => prev === id ? null : id);
|
|
75
|
-
}, [getKeyIdentifier, onOpenKey]);
|
|
76
|
-
if (keys.length === 0 && title === "Required Keys") {
|
|
77
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
78
|
-
style: styles.sectionContainer,
|
|
79
|
-
children: [/*#__PURE__*/_jsxs(SectionHeader, {
|
|
80
|
-
children: [/*#__PURE__*/_jsx(SectionHeader.Title, {
|
|
81
|
-
children: title
|
|
82
|
-
}), /*#__PURE__*/_jsx(SectionHeader.Badge, {
|
|
83
|
-
count: 0,
|
|
84
|
-
color: headerColor
|
|
85
|
-
})]
|
|
86
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
87
|
-
style: styles.emptySection,
|
|
88
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
89
|
-
style: styles.emptySectionText,
|
|
90
|
-
children: emptyMessage
|
|
91
|
-
})
|
|
92
|
-
})]
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
if (keys.length === 0) return null;
|
|
96
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
97
|
-
style: styles.sectionContainer,
|
|
98
|
-
children: [title ? /*#__PURE__*/_jsxs(SectionHeader, {
|
|
99
|
-
children: [/*#__PURE__*/_jsx(SectionHeader.Title, {
|
|
100
|
-
children: title
|
|
101
|
-
}), count >= 0 && /*#__PURE__*/_jsx(SectionHeader.Badge, {
|
|
102
|
-
count: count,
|
|
103
|
-
color: headerColor
|
|
104
|
-
})]
|
|
105
|
-
}) : null, /*#__PURE__*/_jsx(View, {
|
|
106
|
-
style: styles.sectionContent,
|
|
107
|
-
children: keys.map(storageKey => {
|
|
108
|
-
// Create unique key by combining storage type, instance ID (if present), and key name
|
|
109
|
-
const uniqueKey = getKeyIdentifier(storageKey);
|
|
110
|
-
return /*#__PURE__*/_jsx(View, {
|
|
111
|
-
ref: onRowRef ? node => onRowRef(uniqueKey, node) : undefined,
|
|
112
|
-
collapsable: false,
|
|
113
|
-
children: /*#__PURE__*/_jsx(StorageKeyRow, {
|
|
114
|
-
storageKey: storageKey,
|
|
115
|
-
isExpanded: !isSelectMode && expandedKey === uniqueKey,
|
|
116
|
-
onPress: handleKeyPress,
|
|
117
|
-
isSelectMode: isSelectMode,
|
|
118
|
-
isSelected: selectedKeys.has(uniqueKey),
|
|
119
|
-
onSelectionChange: onSelectionChange,
|
|
120
|
-
eventCount: eventCountByKey?.[storageKey.key],
|
|
121
|
-
onViewHistory: onViewHistory ? () => onViewHistory(storageKey.key) : undefined,
|
|
122
|
-
onHideKey: onHideKey,
|
|
123
|
-
onEditKey: onEditKey,
|
|
124
|
-
onToggleKey: onToggleKey,
|
|
125
|
-
onDeleteKey: onDeleteKey,
|
|
126
|
-
editBlockedReason: editBlockedFor?.(storageKey),
|
|
127
|
-
isPinned: pinnedKeys?.has(storageKey.key),
|
|
128
|
-
onTogglePin: onTogglePin
|
|
129
|
-
})
|
|
130
|
-
}, uniqueKey);
|
|
131
|
-
})
|
|
132
|
-
})]
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
const styles = StyleSheet.create({
|
|
136
|
-
sectionContainer: {
|
|
137
|
-
gap: 8
|
|
138
|
-
},
|
|
139
|
-
sectionContent: {
|
|
140
|
-
// No gap needed, StorageKeyRow has its own margins
|
|
141
|
-
},
|
|
142
|
-
emptySection: {
|
|
143
|
-
backgroundColor: night.color.surface,
|
|
144
|
-
borderRadius: 6,
|
|
145
|
-
padding: 16,
|
|
146
|
-
borderWidth: 1,
|
|
147
|
-
borderColor: night.color.border,
|
|
148
|
-
alignItems: "center"
|
|
149
|
-
},
|
|
150
|
-
emptySectionText: {
|
|
151
|
-
color: night.color.textTertiary,
|
|
152
|
-
fontSize: 11,
|
|
153
|
-
textAlign: "center"
|
|
154
|
-
}
|
|
155
|
-
});
|
|
1
|
+
"use strict";import{useCallback as x,useState as H}from"react";import{View as r,Text as _,StyleSheet as v}from"react-native";import{StorageKeyRow as z}from"./StorageKeyRow";import{SectionHeader as o,night as f}from"@buoy-gg/shared-ui";import{jsx as t,jsxs as l}from"react/jsx-runtime";export function storageRowId(n){return n.instanceId?`${n.storageType}-${n.instanceId}-${n.key}`:`${n.storageType}-${n.key}`}export function StorageKeySection({title:n,count:p,keys:d,emptyMessage:g,headerColor:h,isSelectMode:y=false,selectedKeys:T=new Set,onSelectionChange:C,eventCountByKey:b,onViewHistory:m,onHideKey:k,pinnedKeys:I,onTogglePin:$,onEditKey:j,onToggleKey:P,onDeleteKey:w,editBlockedFor:B,onRowRef:S,onOpenKey:s}){const a=x(e=>storageRowId(e),[]);const[E,R]=H(null);const q=x(e=>{if(!e||typeof e.key!=="string")return;if(s){s(e);return}const i=a(e);R(u=>u===i?null:i)},[a,s]);if(d.length===0&&n==="Required Keys"){return l(r,{style:c.sectionContainer,children:[l(o,{children:[t(o.Title,{children:n}),t(o.Badge,{count:0,color:h})]}),t(r,{style:c.emptySection,children:t(_,{style:c.emptySectionText,children:g})})]})}if(d.length===0)return null;return l(r,{style:c.sectionContainer,children:[n?l(o,{children:[t(o.Title,{children:n}),p>=0&&t(o.Badge,{count:p,color:h})]}):null,t(r,{style:c.sectionContent,children:d.map(e=>{const i=a(e);return t(r,{ref:S?u=>S(i,u):void 0,collapsable:false,children:t(z,{storageKey:e,isExpanded:!y&&E===i,onPress:q,isSelectMode:y,isSelected:T.has(i),onSelectionChange:C,eventCount:b?.[e.key],onViewHistory:m?()=>m(e.key):void 0,onHideKey:k,onEditKey:j,onToggleKey:P,onDeleteKey:w,editBlockedReason:B?.(e),isPinned:I?.has(e.key),onTogglePin:$})},i)})})]})}const c=v.create({sectionContainer:{gap:8},sectionContent:{},emptySection:{backgroundColor:f.color.surface,borderRadius:6,padding:16,borderWidth:1,borderColor:f.color.border,alignItems:"center"},emptySectionText:{color:f.color.textTertiary,fontSize:11,textAlign:"center"}});
|
|
@@ -1,341 +1 @@
|
|
|
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 { night } from "@buoy-gg/shared-ui";
|
|
6
|
-
import { getStorageTypeHexColor } from "../utils/storageQueryUtils";
|
|
7
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
-
// Variable type configurations matching env vars design
|
|
9
|
-
const variableTypeData = [{
|
|
10
|
-
key: "valid",
|
|
11
|
-
label: "Valid Keys",
|
|
12
|
-
description: "Correctly stored and accessible",
|
|
13
|
-
icon: CheckCircle2,
|
|
14
|
-
color: "#10B981",
|
|
15
|
-
textColor: "#10B981",
|
|
16
|
-
bgColor: "rgba(16, 185, 129, 0.1)"
|
|
17
|
-
}, {
|
|
18
|
-
key: "missing",
|
|
19
|
-
label: "Missing Keys",
|
|
20
|
-
description: "Required but not found",
|
|
21
|
-
icon: AlertCircle,
|
|
22
|
-
color: "#EF4444",
|
|
23
|
-
textColor: "#EF4444",
|
|
24
|
-
bgColor: "rgba(239, 68, 68, 0.1)"
|
|
25
|
-
}, {
|
|
26
|
-
key: "wrongValue",
|
|
27
|
-
label: "Wrong Values",
|
|
28
|
-
description: "Stored but incorrect value",
|
|
29
|
-
icon: XCircle,
|
|
30
|
-
color: "#F97316",
|
|
31
|
-
textColor: "#F97316",
|
|
32
|
-
bgColor: "rgba(249, 115, 22, 0.1)"
|
|
33
|
-
}, {
|
|
34
|
-
key: "wrongType",
|
|
35
|
-
label: "Wrong Types",
|
|
36
|
-
description: "Value has incorrect data type",
|
|
37
|
-
icon: XCircle,
|
|
38
|
-
color: "#0891B2",
|
|
39
|
-
textColor: "#0891B2",
|
|
40
|
-
bgColor: "rgba(8, 145, 178, 0.1)"
|
|
41
|
-
}, {
|
|
42
|
-
key: "optional",
|
|
43
|
-
label: "Optional Keys",
|
|
44
|
-
description: "Available but not required",
|
|
45
|
-
icon: Eye,
|
|
46
|
-
color: "#8B5CF6",
|
|
47
|
-
textColor: "#8B5CF6",
|
|
48
|
-
bgColor: "rgba(139, 92, 246, 0.1)"
|
|
49
|
-
}];
|
|
50
|
-
|
|
51
|
-
// Storage type breakdown data
|
|
52
|
-
const storageTypeData = [{
|
|
53
|
-
key: "mmkv",
|
|
54
|
-
label: "MMKV",
|
|
55
|
-
description: "High-performance key-value storage",
|
|
56
|
-
icon: Database
|
|
57
|
-
}, {
|
|
58
|
-
key: "async",
|
|
59
|
-
label: "AsyncStorage",
|
|
60
|
-
description: "React Native async storage",
|
|
61
|
-
icon: Database
|
|
62
|
-
}, {
|
|
63
|
-
key: "secure",
|
|
64
|
-
label: "SecureStorage",
|
|
65
|
-
description: "Encrypted secure storage",
|
|
66
|
-
icon: Shield
|
|
67
|
-
}];
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Storage key stats component following composition principles [[rule3]]
|
|
71
|
-
*
|
|
72
|
-
* Applied principles:
|
|
73
|
-
* - Decompose by Responsibility: Single purpose component for storage stats display
|
|
74
|
-
* - Prefer Composition over Configuration: Reuses patterns from EnvVarStats
|
|
75
|
-
* - Extract Reusable Logic: Shares visualization patterns with env vars
|
|
76
|
-
*/
|
|
77
|
-
export function StorageKeyStatsSection({
|
|
78
|
-
stats
|
|
79
|
-
}) {
|
|
80
|
-
const {
|
|
81
|
-
totalCount,
|
|
82
|
-
missingCount,
|
|
83
|
-
wrongValueCount,
|
|
84
|
-
wrongTypeCount,
|
|
85
|
-
presentRequiredCount,
|
|
86
|
-
optionalCount,
|
|
87
|
-
mmkvCount,
|
|
88
|
-
asyncCount,
|
|
89
|
-
secureCount
|
|
90
|
-
} = stats;
|
|
91
|
-
|
|
92
|
-
// If no storage keys at all, show minimal stats
|
|
93
|
-
if (totalCount === 0) {
|
|
94
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
95
|
-
style: styles.statsContainer,
|
|
96
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
97
|
-
style: styles.sectionTitle,
|
|
98
|
-
children: "STORAGE BREAKDOWN"
|
|
99
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
100
|
-
style: styles.emptyState,
|
|
101
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
102
|
-
style: styles.emptyStateText,
|
|
103
|
-
children: "No storage keys detected"
|
|
104
|
-
})
|
|
105
|
-
})]
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
109
|
-
style: styles.statsContainer,
|
|
110
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
111
|
-
style: styles.breakdownSection,
|
|
112
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
113
|
-
style: styles.sectionTitle,
|
|
114
|
-
children: "KEY STATUS BREAKDOWN"
|
|
115
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
116
|
-
style: styles.breakdownList,
|
|
117
|
-
children: variableTypeData.map(item => {
|
|
118
|
-
let count = 0;
|
|
119
|
-
let shouldShow = false;
|
|
120
|
-
switch (item.key) {
|
|
121
|
-
case "valid":
|
|
122
|
-
count = presentRequiredCount;
|
|
123
|
-
shouldShow = count > 0;
|
|
124
|
-
break;
|
|
125
|
-
case "missing":
|
|
126
|
-
count = missingCount;
|
|
127
|
-
shouldShow = count > 0;
|
|
128
|
-
break;
|
|
129
|
-
case "wrongValue":
|
|
130
|
-
count = wrongValueCount;
|
|
131
|
-
shouldShow = count > 0;
|
|
132
|
-
break;
|
|
133
|
-
case "wrongType":
|
|
134
|
-
count = wrongTypeCount;
|
|
135
|
-
shouldShow = count > 0;
|
|
136
|
-
break;
|
|
137
|
-
case "optional":
|
|
138
|
-
count = optionalCount;
|
|
139
|
-
shouldShow = count > 0;
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
if (!shouldShow) return null;
|
|
143
|
-
const percentage = totalCount > 0 ? (count / totalCount * 100).toFixed(1) : "0";
|
|
144
|
-
const IconComponent = item.icon;
|
|
145
|
-
return /*#__PURE__*/_jsx(View, {
|
|
146
|
-
style: styles.breakdownItem,
|
|
147
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
148
|
-
style: styles.breakdownItemRow,
|
|
149
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
150
|
-
style: styles.breakdownItemLeft,
|
|
151
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
152
|
-
style: [styles.breakdownIcon, {
|
|
153
|
-
backgroundColor: item.bgColor
|
|
154
|
-
}],
|
|
155
|
-
children: /*#__PURE__*/_jsx(IconComponent, {
|
|
156
|
-
size: 14,
|
|
157
|
-
color: item.color
|
|
158
|
-
})
|
|
159
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
160
|
-
style: styles.breakdownItemInfo,
|
|
161
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
162
|
-
style: styles.breakdownItemLabel,
|
|
163
|
-
children: item.label
|
|
164
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
165
|
-
style: styles.breakdownItemDesc,
|
|
166
|
-
children: item.description
|
|
167
|
-
})]
|
|
168
|
-
})]
|
|
169
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
170
|
-
style: styles.breakdownItemRight,
|
|
171
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
172
|
-
style: [styles.breakdownCount, {
|
|
173
|
-
color: item.textColor
|
|
174
|
-
}],
|
|
175
|
-
children: count
|
|
176
|
-
}), /*#__PURE__*/_jsxs(Text, {
|
|
177
|
-
style: styles.breakdownPercentage,
|
|
178
|
-
children: [percentage, "%"]
|
|
179
|
-
})]
|
|
180
|
-
})]
|
|
181
|
-
})
|
|
182
|
-
}, item.key);
|
|
183
|
-
})
|
|
184
|
-
})]
|
|
185
|
-
}), (mmkvCount > 0 || asyncCount > 0 || secureCount > 0) && /*#__PURE__*/_jsxs(View, {
|
|
186
|
-
style: styles.breakdownSection,
|
|
187
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
188
|
-
style: styles.sectionTitle,
|
|
189
|
-
children: "STORAGE TYPE BREAKDOWN"
|
|
190
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
191
|
-
style: styles.breakdownList,
|
|
192
|
-
children: storageTypeData.map(item => {
|
|
193
|
-
let count = 0;
|
|
194
|
-
let shouldShow = false;
|
|
195
|
-
switch (item.key) {
|
|
196
|
-
case "mmkv":
|
|
197
|
-
count = mmkvCount;
|
|
198
|
-
shouldShow = count > 0;
|
|
199
|
-
break;
|
|
200
|
-
case "async":
|
|
201
|
-
count = asyncCount;
|
|
202
|
-
shouldShow = count > 0;
|
|
203
|
-
break;
|
|
204
|
-
case "secure":
|
|
205
|
-
count = secureCount;
|
|
206
|
-
shouldShow = count > 0;
|
|
207
|
-
break;
|
|
208
|
-
}
|
|
209
|
-
if (!shouldShow) return null;
|
|
210
|
-
const percentage = totalCount > 0 ? (count / totalCount * 100).toFixed(1) : "0";
|
|
211
|
-
const IconComponent = item.icon;
|
|
212
|
-
const storageColor = getStorageTypeHexColor(item.key);
|
|
213
|
-
return /*#__PURE__*/_jsx(View, {
|
|
214
|
-
style: styles.breakdownItem,
|
|
215
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
216
|
-
style: styles.breakdownItemRow,
|
|
217
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
218
|
-
style: styles.breakdownItemLeft,
|
|
219
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
220
|
-
style: [styles.breakdownIcon, {
|
|
221
|
-
backgroundColor: `${storageColor}15`
|
|
222
|
-
}],
|
|
223
|
-
children: /*#__PURE__*/_jsx(IconComponent, {
|
|
224
|
-
size: 14,
|
|
225
|
-
color: storageColor
|
|
226
|
-
})
|
|
227
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
228
|
-
style: styles.breakdownItemInfo,
|
|
229
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
230
|
-
style: styles.breakdownItemLabel,
|
|
231
|
-
children: item.label
|
|
232
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
233
|
-
style: styles.breakdownItemDesc,
|
|
234
|
-
children: item.description
|
|
235
|
-
})]
|
|
236
|
-
})]
|
|
237
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
238
|
-
style: styles.breakdownItemRight,
|
|
239
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
240
|
-
style: [styles.breakdownCount, {
|
|
241
|
-
color: storageColor
|
|
242
|
-
}],
|
|
243
|
-
children: count
|
|
244
|
-
}), /*#__PURE__*/_jsxs(Text, {
|
|
245
|
-
style: styles.breakdownPercentage,
|
|
246
|
-
children: [percentage, "%"]
|
|
247
|
-
})]
|
|
248
|
-
})]
|
|
249
|
-
})
|
|
250
|
-
}, item.key);
|
|
251
|
-
})
|
|
252
|
-
})]
|
|
253
|
-
})]
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
const styles = StyleSheet.create({
|
|
257
|
-
statsContainer: {
|
|
258
|
-
marginBottom: 24,
|
|
259
|
-
backgroundColor: night.color.surface,
|
|
260
|
-
borderRadius: 8,
|
|
261
|
-
padding: 16,
|
|
262
|
-
borderWidth: 1,
|
|
263
|
-
borderColor: night.color.border
|
|
264
|
-
},
|
|
265
|
-
// Section titles
|
|
266
|
-
sectionTitle: {
|
|
267
|
-
color: night.color.textSecondary,
|
|
268
|
-
fontSize: 12,
|
|
269
|
-
fontWeight: "500",
|
|
270
|
-
marginBottom: 16,
|
|
271
|
-
textTransform: "uppercase",
|
|
272
|
-
letterSpacing: 0.5
|
|
273
|
-
},
|
|
274
|
-
// Breakdown section
|
|
275
|
-
breakdownSection: {
|
|
276
|
-
gap: 12,
|
|
277
|
-
marginBottom: 20
|
|
278
|
-
},
|
|
279
|
-
breakdownList: {
|
|
280
|
-
gap: 12
|
|
281
|
-
},
|
|
282
|
-
breakdownItem: {
|
|
283
|
-
backgroundColor: night.color.surfaceElevated,
|
|
284
|
-
padding: 12,
|
|
285
|
-
borderRadius: 8,
|
|
286
|
-
borderWidth: 1,
|
|
287
|
-
borderColor: night.color.border
|
|
288
|
-
},
|
|
289
|
-
breakdownItemRow: {
|
|
290
|
-
flexDirection: "row",
|
|
291
|
-
alignItems: "center",
|
|
292
|
-
justifyContent: "space-between"
|
|
293
|
-
},
|
|
294
|
-
breakdownItemLeft: {
|
|
295
|
-
flexDirection: "row",
|
|
296
|
-
alignItems: "center",
|
|
297
|
-
gap: 12,
|
|
298
|
-
flex: 1,
|
|
299
|
-
minWidth: 0
|
|
300
|
-
},
|
|
301
|
-
breakdownIcon: {
|
|
302
|
-
padding: 8,
|
|
303
|
-
borderRadius: 8
|
|
304
|
-
},
|
|
305
|
-
breakdownItemInfo: {
|
|
306
|
-
flex: 1,
|
|
307
|
-
minWidth: 0
|
|
308
|
-
},
|
|
309
|
-
breakdownItemLabel: {
|
|
310
|
-
color: night.color.text,
|
|
311
|
-
fontSize: 14,
|
|
312
|
-
fontWeight: "500"
|
|
313
|
-
},
|
|
314
|
-
breakdownItemDesc: {
|
|
315
|
-
color: night.color.textSecondary,
|
|
316
|
-
fontSize: 12
|
|
317
|
-
},
|
|
318
|
-
breakdownItemRight: {
|
|
319
|
-
alignItems: "flex-end"
|
|
320
|
-
},
|
|
321
|
-
breakdownCount: {
|
|
322
|
-
fontSize: 16,
|
|
323
|
-
fontWeight: "600"
|
|
324
|
-
},
|
|
325
|
-
breakdownPercentage: {
|
|
326
|
-
color: night.color.textTertiary,
|
|
327
|
-
fontSize: 10
|
|
328
|
-
},
|
|
329
|
-
// Empty state
|
|
330
|
-
emptyState: {
|
|
331
|
-
padding: 16,
|
|
332
|
-
backgroundColor: night.color.surfaceElevated,
|
|
333
|
-
borderRadius: 6,
|
|
334
|
-
alignItems: "center"
|
|
335
|
-
},
|
|
336
|
-
emptyStateText: {
|
|
337
|
-
color: night.color.textTertiary,
|
|
338
|
-
fontSize: 11,
|
|
339
|
-
textAlign: "center"
|
|
340
|
-
}
|
|
341
|
-
});
|
|
1
|
+
"use strict";import{storageLabels as d}from"../utils/storageLabels";import{View as r,Text as a,StyleSheet as T}from"react-native";import{AlertCircle as R,CheckCircle2 as v,XCircle as w,Eye as E,Database as m,Shield as B}from"@buoy-gg/shared-ui";import{night as i}from"@buoy-gg/shared-ui";import{getStorageTypeHexColor as W}from"../utils/storageQueryUtils";import{jsx as t,jsxs as l}from"react/jsx-runtime";const D=[{key:"valid",label:"Valid Keys",description:"Correctly stored and accessible",icon:v,color:"#10B981",textColor:"#10B981",bgColor:"rgba(16, 185, 129, 0.1)"},{key:"missing",label:"Missing Keys",description:"Required but not found",icon:R,color:"#EF4444",textColor:"#EF4444",bgColor:"rgba(239, 68, 68, 0.1)"},{key:"wrongValue",label:"Wrong Values",description:"Stored but incorrect value",icon:w,color:"#F97316",textColor:"#F97316",bgColor:"rgba(249, 115, 22, 0.1)"},{key:"wrongType",label:"Wrong Types",description:"Value has incorrect data type",icon:w,color:"#0891B2",textColor:"#0891B2",bgColor:"rgba(8, 145, 178, 0.1)"},{key:"optional",label:"Optional Keys",description:"Available but not required",icon:E,color:"#8B5CF6",textColor:"#8B5CF6",bgColor:"rgba(139, 92, 246, 0.1)"}];const L=[{key:"mmkv",label:d.mmkv,description:d.hasSecure?"Synchronous key-value storage":"Storage for this browser tab",icon:m},{key:"async",label:d.asyncFull,description:d.hasSecure?"React Native async storage":"Persistent storage for this origin",icon:m},{key:"secure",label:"SecureStorage",description:"Encrypted secure storage",icon:B}];export function StorageKeyStatsSection({stats:p}){const{totalCount:s,missingCount:C,wrongValueCount:f,wrongTypeCount:S,presentRequiredCount:I,optionalCount:x,mmkvCount:k,asyncCount:u,secureCount:h}=p;if(s===0){return l(r,{style:e.statsContainer,children:[t(a,{style:e.sectionTitle,children:"STORAGE BREAKDOWN"}),t(r,{style:e.emptyState,children:t(a,{style:e.emptyStateText,children:"No storage keys detected"})})]})}return l(r,{style:e.statsContainer,children:[l(r,{style:e.breakdownSection,children:[t(a,{style:e.sectionTitle,children:"KEY STATUS BREAKDOWN"}),t(r,{style:e.breakdownList,children:D.map(n=>{let o=0;let c=false;switch(n.key){case"valid":o=I;c=o>0;break;case"missing":o=C;c=o>0;break;case"wrongValue":o=f;c=o>0;break;case"wrongType":o=S;c=o>0;break;case"optional":o=x;c=o>0;break}if(!c)return null;const b=s>0?(o/s*100).toFixed(1):"0";const y=n.icon;return t(r,{style:e.breakdownItem,children:l(r,{style:e.breakdownItemRow,children:[l(r,{style:e.breakdownItemLeft,children:[t(r,{style:[e.breakdownIcon,{backgroundColor:n.bgColor}],children:t(y,{size:14,color:n.color})}),l(r,{style:e.breakdownItemInfo,children:[t(a,{style:e.breakdownItemLabel,children:n.label}),t(a,{style:e.breakdownItemDesc,children:n.description})]})]}),l(r,{style:e.breakdownItemRight,children:[t(a,{style:[e.breakdownCount,{color:n.textColor}],children:o}),l(a,{style:e.breakdownPercentage,children:[b,"%"]})]})]})},n.key)})})]}),(k>0||u>0||h>0)&&l(r,{style:e.breakdownSection,children:[t(a,{style:e.sectionTitle,children:"STORAGE TYPE BREAKDOWN"}),t(r,{style:e.breakdownList,children:L.map(n=>{let o=0;let c=false;switch(n.key){case"mmkv":o=k;c=o>0;break;case"async":o=u;c=o>0;break;case"secure":o=h;c=o>0;break}if(!c)return null;const b=s>0?(o/s*100).toFixed(1):"0";const y=n.icon;const g=W(n.key);return t(r,{style:e.breakdownItem,children:l(r,{style:e.breakdownItemRow,children:[l(r,{style:e.breakdownItemLeft,children:[t(r,{style:[e.breakdownIcon,{backgroundColor:`${g}15`}],children:t(y,{size:14,color:g})}),l(r,{style:e.breakdownItemInfo,children:[t(a,{style:e.breakdownItemLabel,children:n.label}),t(a,{style:e.breakdownItemDesc,children:n.description})]})]}),l(r,{style:e.breakdownItemRight,children:[t(a,{style:[e.breakdownCount,{color:g}],children:o}),l(a,{style:e.breakdownPercentage,children:[b,"%"]})]})]})},n.key)})})]})]})}const e=T.create({statsContainer:{marginBottom:24,backgroundColor:i.color.surface,borderRadius:8,padding:16,borderWidth:1,borderColor:i.color.border},sectionTitle:{color:i.color.textSecondary,fontSize:12,fontWeight:"500",marginBottom:16,textTransform:"uppercase",letterSpacing:.5},breakdownSection:{gap:12,marginBottom:20},breakdownList:{gap:12},breakdownItem:{backgroundColor:i.color.surfaceElevated,padding:12,borderRadius:8,borderWidth:1,borderColor:i.color.border},breakdownItemRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},breakdownItemLeft:{flexDirection:"row",alignItems:"center",gap:12,flex:1,minWidth:0},breakdownIcon:{padding:8,borderRadius:8},breakdownItemInfo:{flex:1,minWidth:0},breakdownItemLabel:{color:i.color.text,fontSize:14,fontWeight:"500"},breakdownItemDesc:{color:i.color.textSecondary,fontSize:12},breakdownItemRight:{alignItems:"flex-end"},breakdownCount:{fontSize:16,fontWeight:"600"},breakdownPercentage:{color:i.color.textTertiary,fontSize:10},emptyState:{padding:16,backgroundColor:i.color.surfaceElevated,borderRadius:6,alignItems:"center"},emptyStateText:{color:i.color.textTertiary,fontSize:11,textAlign:"center"}});
|