@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,513 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { View, Text, StyleSheet, TouchableOpacity } from "react-native";
|
|
4
|
+
import { AlertCircle, CheckCircle2, Eye, XCircle, HardDrive, Database, Shield, gameUIColors, macOSColors } from "@buoy-gg/shared-ui";
|
|
5
|
+
import { getStorageTypeLabel, getStorageTypeHexColor } from "../utils/storageQueryUtils";
|
|
6
|
+
import { getValueTypeLabel } from "../utils/valueType";
|
|
7
|
+
import { DataViewer } from "@buoy-gg/shared-ui/dataViewer";
|
|
8
|
+
|
|
9
|
+
// Stable constants moved to module scope to prevent re-renders [[memory:4875251]]
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const HIT_SLOP = {
|
|
12
|
+
top: 6,
|
|
13
|
+
bottom: 6,
|
|
14
|
+
left: 6,
|
|
15
|
+
right: 6
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// MMKV Instance color palette - consistent colors per instance
|
|
19
|
+
const INSTANCE_COLORS = [macOSColors.semantic.info,
|
|
20
|
+
// Blue
|
|
21
|
+
macOSColors.semantic.success,
|
|
22
|
+
// Green
|
|
23
|
+
macOSColors.semantic.warning,
|
|
24
|
+
// Orange
|
|
25
|
+
macOSColors.semantic.debug,
|
|
26
|
+
// Purple
|
|
27
|
+
'#FF6B9D',
|
|
28
|
+
// Pink
|
|
29
|
+
'#00D9FF' // Cyan
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Get consistent color for an MMKV instance based on its ID
|
|
34
|
+
* Uses simple hash to ensure same instance always gets same color
|
|
35
|
+
*/
|
|
36
|
+
function getInstanceColor(instanceId) {
|
|
37
|
+
const hash = instanceId.split('').reduce((acc, char) => acc + char.charCodeAt(0), 0);
|
|
38
|
+
return INSTANCE_COLORS[hash % INSTANCE_COLORS.length];
|
|
39
|
+
}
|
|
40
|
+
const getStatusConfig = status => {
|
|
41
|
+
switch (status) {
|
|
42
|
+
case "required_present":
|
|
43
|
+
return {
|
|
44
|
+
icon: CheckCircle2,
|
|
45
|
+
color: macOSColors.semantic.success,
|
|
46
|
+
bgColor: macOSColors.semantic.successBackground,
|
|
47
|
+
borderColor: macOSColors.semantic.success + "40",
|
|
48
|
+
label: "REQUIRED",
|
|
49
|
+
labelColor: macOSColors.semantic.success
|
|
50
|
+
};
|
|
51
|
+
case "required_missing":
|
|
52
|
+
return {
|
|
53
|
+
icon: AlertCircle,
|
|
54
|
+
color: macOSColors.semantic.error,
|
|
55
|
+
bgColor: macOSColors.semantic.errorBackground,
|
|
56
|
+
borderColor: macOSColors.semantic.error + "50",
|
|
57
|
+
label: "MISSING",
|
|
58
|
+
labelColor: macOSColors.semantic.error
|
|
59
|
+
};
|
|
60
|
+
case "required_wrong_value":
|
|
61
|
+
return {
|
|
62
|
+
icon: XCircle,
|
|
63
|
+
color: macOSColors.semantic.warning,
|
|
64
|
+
bgColor: macOSColors.semantic.warningBackground,
|
|
65
|
+
borderColor: macOSColors.semantic.warning + "50",
|
|
66
|
+
label: "WRONG S",
|
|
67
|
+
labelColor: macOSColors.semantic.warning
|
|
68
|
+
};
|
|
69
|
+
case "required_wrong_type":
|
|
70
|
+
return {
|
|
71
|
+
icon: XCircle,
|
|
72
|
+
color: macOSColors.semantic.info,
|
|
73
|
+
bgColor: macOSColors.semantic.infoBackground,
|
|
74
|
+
borderColor: macOSColors.semantic.info + "50",
|
|
75
|
+
label: "WRONG TYPE",
|
|
76
|
+
labelColor: macOSColors.semantic.info
|
|
77
|
+
};
|
|
78
|
+
case "optional_present":
|
|
79
|
+
return {
|
|
80
|
+
icon: Eye,
|
|
81
|
+
color: macOSColors.semantic.debug,
|
|
82
|
+
bgColor: macOSColors.semantic.infoBackground,
|
|
83
|
+
borderColor: macOSColors.semantic.debug + "40",
|
|
84
|
+
label: "OPTIONAL",
|
|
85
|
+
labelColor: macOSColors.semantic.debug
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const getStorageIcon = storageType => {
|
|
90
|
+
switch (storageType) {
|
|
91
|
+
case "mmkv":
|
|
92
|
+
return HardDrive;
|
|
93
|
+
case "async":
|
|
94
|
+
return Database;
|
|
95
|
+
case "secure":
|
|
96
|
+
return Shield;
|
|
97
|
+
default:
|
|
98
|
+
return Database;
|
|
99
|
+
// Default fallback
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Storage key card component following composition principles [[rule3]]
|
|
105
|
+
*
|
|
106
|
+
* Applied principles:
|
|
107
|
+
* - Decompose by Responsibility: Single purpose component for storage key display
|
|
108
|
+
* - Prefer Composition over Configuration: Reuses existing patterns from EnvVarCard
|
|
109
|
+
* - Extract Reusable Logic: Shares formatValue and status config patterns
|
|
110
|
+
*/
|
|
111
|
+
export function StorageKeyCard({
|
|
112
|
+
storageKey,
|
|
113
|
+
isExpanded,
|
|
114
|
+
onToggle
|
|
115
|
+
}) {
|
|
116
|
+
const config = getStatusConfig(storageKey.status);
|
|
117
|
+
const StatusIcon = config.icon;
|
|
118
|
+
const StorageIcon = getStorageIcon(storageKey.storageType);
|
|
119
|
+
const hasValue = storageKey.value !== undefined && storageKey.value !== null;
|
|
120
|
+
const hasExpectedValue = storageKey.expectedValue !== undefined;
|
|
121
|
+
const hasExpectedType = storageKey.expectedType !== undefined;
|
|
122
|
+
const storageTypeColor = getStorageTypeHexColor(storageKey.storageType);
|
|
123
|
+
const storageTypeLabel = getStorageTypeLabel(storageKey.storageType);
|
|
124
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
125
|
+
style: [styles.storageKeyCard, {
|
|
126
|
+
borderColor: config.borderColor
|
|
127
|
+
}],
|
|
128
|
+
children: [/*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
129
|
+
accessibilityLabel: "Storage key card",
|
|
130
|
+
accessibilityHint: "View storage key card",
|
|
131
|
+
"sentry-label": `ignore storage key card ${storageKey.key}`,
|
|
132
|
+
accessibilityRole: "button",
|
|
133
|
+
style: styles.cardHeader,
|
|
134
|
+
onPress: onToggle,
|
|
135
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
136
|
+
style: styles.cardHeaderLeft,
|
|
137
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
138
|
+
style: [styles.iconContainer, {
|
|
139
|
+
backgroundColor: config.bgColor
|
|
140
|
+
}],
|
|
141
|
+
children: /*#__PURE__*/_jsx(StatusIcon, {
|
|
142
|
+
size: 14,
|
|
143
|
+
color: config.color
|
|
144
|
+
})
|
|
145
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
146
|
+
style: styles.cardHeaderInfo,
|
|
147
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
148
|
+
style: styles.storageKeyText,
|
|
149
|
+
children: storageKey.key
|
|
150
|
+
}), storageKey.description && /*#__PURE__*/_jsx(Text, {
|
|
151
|
+
style: styles.descriptionText,
|
|
152
|
+
children: storageKey.description
|
|
153
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
154
|
+
style: styles.cardHeaderMeta,
|
|
155
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
156
|
+
style: [styles.statusBadge, {
|
|
157
|
+
backgroundColor: config.bgColor
|
|
158
|
+
}],
|
|
159
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
160
|
+
style: [styles.statusText, {
|
|
161
|
+
color: config.labelColor
|
|
162
|
+
}],
|
|
163
|
+
children: config.label
|
|
164
|
+
})
|
|
165
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
166
|
+
style: [styles.storageBadge, {
|
|
167
|
+
backgroundColor: `${storageTypeColor}15`
|
|
168
|
+
}],
|
|
169
|
+
children: [/*#__PURE__*/_jsx(StorageIcon, {
|
|
170
|
+
size: 10,
|
|
171
|
+
color: storageTypeColor
|
|
172
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
173
|
+
style: [styles.storageText, {
|
|
174
|
+
color: storageTypeColor
|
|
175
|
+
}],
|
|
176
|
+
children: storageTypeLabel
|
|
177
|
+
})]
|
|
178
|
+
}), storageKey.storageType === 'mmkv' && storageKey.instanceId && /*#__PURE__*/_jsxs(View, {
|
|
179
|
+
style: [styles.instanceBadge, {
|
|
180
|
+
backgroundColor: getInstanceColor(storageKey.instanceId) + '20',
|
|
181
|
+
borderColor: getInstanceColor(storageKey.instanceId) + '40'
|
|
182
|
+
}],
|
|
183
|
+
children: [/*#__PURE__*/_jsx(HardDrive, {
|
|
184
|
+
size: 9,
|
|
185
|
+
color: getInstanceColor(storageKey.instanceId)
|
|
186
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
187
|
+
style: [styles.instanceText, {
|
|
188
|
+
color: getInstanceColor(storageKey.instanceId)
|
|
189
|
+
}],
|
|
190
|
+
children: storageKey.instanceId
|
|
191
|
+
})]
|
|
192
|
+
}), hasValue && /*#__PURE__*/_jsx(View, {
|
|
193
|
+
style: styles.valueBadge,
|
|
194
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
195
|
+
style: styles.valueText,
|
|
196
|
+
children: storageKey.valueType ? storageKey.valueType.toUpperCase() : getValueTypeLabel(storageKey.value)
|
|
197
|
+
})
|
|
198
|
+
})]
|
|
199
|
+
})]
|
|
200
|
+
})]
|
|
201
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
202
|
+
style: styles.cardHeaderRight,
|
|
203
|
+
children: /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
204
|
+
accessibilityLabel: "Expand",
|
|
205
|
+
accessibilityHint: "Expand storage key card",
|
|
206
|
+
"sentry-label": `ignore storage key card ${storageKey.key} expand`,
|
|
207
|
+
accessibilityRole: "button",
|
|
208
|
+
style: styles.actionButton,
|
|
209
|
+
onPress: onToggle,
|
|
210
|
+
hitSlop: HIT_SLOP,
|
|
211
|
+
children: /*#__PURE__*/_jsx(Eye, {
|
|
212
|
+
size: 12,
|
|
213
|
+
color: macOSColors.text.secondary
|
|
214
|
+
})
|
|
215
|
+
})
|
|
216
|
+
})]
|
|
217
|
+
}), isExpanded && hasValue && /*#__PURE__*/_jsxs(View, {
|
|
218
|
+
style: styles.cardBody,
|
|
219
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
220
|
+
style: styles.dataViewerContainer,
|
|
221
|
+
children: typeof storageKey.value === "string" || typeof storageKey.value === "number" || typeof storageKey.value === "boolean" ? /*#__PURE__*/_jsxs(View, {
|
|
222
|
+
style: styles.simpleValueContainer,
|
|
223
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
224
|
+
style: styles.simpleValueLabel,
|
|
225
|
+
children: "Current Value:"
|
|
226
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
227
|
+
style: styles.simpleValueBox,
|
|
228
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
229
|
+
style: styles.simpleValueContent,
|
|
230
|
+
selectable: true,
|
|
231
|
+
children: String(storageKey.value)
|
|
232
|
+
})
|
|
233
|
+
}), /*#__PURE__*/_jsxs(Text, {
|
|
234
|
+
style: styles.valueTypeText,
|
|
235
|
+
children: ["Type: ", getValueTypeLabel(storageKey.value)]
|
|
236
|
+
})]
|
|
237
|
+
}) : /*#__PURE__*/_jsx(DataViewer, {
|
|
238
|
+
title: "Current Value",
|
|
239
|
+
data: storageKey.value,
|
|
240
|
+
showTypeFilter: false,
|
|
241
|
+
rawMode: true
|
|
242
|
+
})
|
|
243
|
+
}), hasExpectedValue && /*#__PURE__*/_jsxs(View, {
|
|
244
|
+
style: styles.valueContainer,
|
|
245
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
246
|
+
style: styles.valueLabel,
|
|
247
|
+
children: "Expected Value:"
|
|
248
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
249
|
+
style: styles.expectedValueBox,
|
|
250
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
251
|
+
style: styles.expectedValueContent,
|
|
252
|
+
selectable: true,
|
|
253
|
+
children: storageKey.expectedValue
|
|
254
|
+
})
|
|
255
|
+
})]
|
|
256
|
+
}), hasExpectedType && storageKey.expectedType && /*#__PURE__*/_jsxs(View, {
|
|
257
|
+
style: styles.valueContainer,
|
|
258
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
259
|
+
style: styles.valueLabel,
|
|
260
|
+
children: "Expected Type:"
|
|
261
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
262
|
+
style: styles.expectedValueBox,
|
|
263
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
264
|
+
style: styles.expectedValueContent,
|
|
265
|
+
selectable: true,
|
|
266
|
+
children: storageKey.expectedType.toUpperCase()
|
|
267
|
+
})
|
|
268
|
+
}), /*#__PURE__*/_jsxs(Text, {
|
|
269
|
+
style: styles.typeHelperText,
|
|
270
|
+
children: ["Current type: ", getValueTypeLabel(storageKey.value)]
|
|
271
|
+
})]
|
|
272
|
+
}), storageKey.lastUpdated && /*#__PURE__*/_jsx(View, {
|
|
273
|
+
style: styles.metaInfo,
|
|
274
|
+
children: /*#__PURE__*/_jsxs(Text, {
|
|
275
|
+
style: styles.metaLabel,
|
|
276
|
+
children: ["Last updated123: ", storageKey.lastUpdated.toLocaleString()]
|
|
277
|
+
})
|
|
278
|
+
})]
|
|
279
|
+
}), isExpanded && !hasValue && /*#__PURE__*/_jsxs(View, {
|
|
280
|
+
style: styles.cardBody,
|
|
281
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
282
|
+
style: styles.emptyValueContainer,
|
|
283
|
+
children: [/*#__PURE__*/_jsx(AlertCircle, {
|
|
284
|
+
size: 16,
|
|
285
|
+
color: macOSColors.semantic.warning
|
|
286
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
287
|
+
style: styles.emptyValueText,
|
|
288
|
+
children: "Storage key not found or empty"
|
|
289
|
+
})]
|
|
290
|
+
}), hasExpectedValue && /*#__PURE__*/_jsxs(View, {
|
|
291
|
+
style: styles.valueContainer,
|
|
292
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
293
|
+
style: styles.valueLabel,
|
|
294
|
+
children: "Expected Value:"
|
|
295
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
296
|
+
style: styles.expectedValueBox,
|
|
297
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
298
|
+
style: styles.expectedValueContent,
|
|
299
|
+
selectable: true,
|
|
300
|
+
children: storageKey.expectedValue
|
|
301
|
+
})
|
|
302
|
+
})]
|
|
303
|
+
})]
|
|
304
|
+
})]
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
const styles = StyleSheet.create({
|
|
308
|
+
storageKeyCard: {
|
|
309
|
+
backgroundColor: macOSColors.background.card,
|
|
310
|
+
borderRadius: 8,
|
|
311
|
+
borderWidth: 1,
|
|
312
|
+
overflow: "hidden"
|
|
313
|
+
},
|
|
314
|
+
cardHeader: {
|
|
315
|
+
padding: 12,
|
|
316
|
+
flexDirection: "row",
|
|
317
|
+
alignItems: "center",
|
|
318
|
+
justifyContent: "space-between"
|
|
319
|
+
},
|
|
320
|
+
cardHeaderLeft: {
|
|
321
|
+
flexDirection: "row",
|
|
322
|
+
alignItems: "center",
|
|
323
|
+
flex: 1,
|
|
324
|
+
minWidth: 0
|
|
325
|
+
},
|
|
326
|
+
iconContainer: {
|
|
327
|
+
padding: 6,
|
|
328
|
+
borderRadius: 6,
|
|
329
|
+
marginRight: 10
|
|
330
|
+
},
|
|
331
|
+
cardHeaderInfo: {
|
|
332
|
+
flex: 1,
|
|
333
|
+
minWidth: 0,
|
|
334
|
+
gap: 4
|
|
335
|
+
},
|
|
336
|
+
storageKeyText: {
|
|
337
|
+
color: "#FFFFFF",
|
|
338
|
+
fontWeight: "500",
|
|
339
|
+
fontSize: 12,
|
|
340
|
+
flexWrap: "wrap",
|
|
341
|
+
flex: 1
|
|
342
|
+
},
|
|
343
|
+
descriptionText: {
|
|
344
|
+
color: macOSColors.text.secondary,
|
|
345
|
+
fontSize: 10,
|
|
346
|
+
marginTop: 2,
|
|
347
|
+
flexWrap: "wrap"
|
|
348
|
+
},
|
|
349
|
+
cardHeaderMeta: {
|
|
350
|
+
flexDirection: "row",
|
|
351
|
+
alignItems: "center",
|
|
352
|
+
gap: 6,
|
|
353
|
+
flexWrap: "wrap"
|
|
354
|
+
},
|
|
355
|
+
statusBadge: {
|
|
356
|
+
paddingHorizontal: 6,
|
|
357
|
+
paddingVertical: 2,
|
|
358
|
+
borderRadius: 4
|
|
359
|
+
},
|
|
360
|
+
statusText: {
|
|
361
|
+
fontSize: 9,
|
|
362
|
+
fontWeight: "600",
|
|
363
|
+
letterSpacing: 0.5
|
|
364
|
+
},
|
|
365
|
+
storageBadge: {
|
|
366
|
+
paddingHorizontal: 6,
|
|
367
|
+
paddingVertical: 2,
|
|
368
|
+
borderRadius: 4,
|
|
369
|
+
flexDirection: "row",
|
|
370
|
+
alignItems: "center",
|
|
371
|
+
gap: 4
|
|
372
|
+
},
|
|
373
|
+
storageText: {
|
|
374
|
+
fontSize: 9,
|
|
375
|
+
fontWeight: "600"
|
|
376
|
+
},
|
|
377
|
+
instanceBadge: {
|
|
378
|
+
paddingHorizontal: 6,
|
|
379
|
+
paddingVertical: 3,
|
|
380
|
+
borderRadius: 4,
|
|
381
|
+
borderWidth: 1,
|
|
382
|
+
flexDirection: 'row',
|
|
383
|
+
alignItems: 'center',
|
|
384
|
+
gap: 4
|
|
385
|
+
},
|
|
386
|
+
instanceText: {
|
|
387
|
+
fontSize: 9,
|
|
388
|
+
fontWeight: "700",
|
|
389
|
+
fontFamily: "monospace",
|
|
390
|
+
letterSpacing: 0.3
|
|
391
|
+
},
|
|
392
|
+
valueBadge: {
|
|
393
|
+
paddingHorizontal: 4,
|
|
394
|
+
paddingVertical: 2,
|
|
395
|
+
backgroundColor: macOSColors.background.input,
|
|
396
|
+
borderRadius: 3
|
|
397
|
+
},
|
|
398
|
+
valueText: {
|
|
399
|
+
fontSize: 8,
|
|
400
|
+
color: macOSColors.text.secondary,
|
|
401
|
+
fontWeight: "500"
|
|
402
|
+
},
|
|
403
|
+
cardHeaderRight: {
|
|
404
|
+
marginLeft: 8
|
|
405
|
+
},
|
|
406
|
+
actionButton: {
|
|
407
|
+
padding: 4,
|
|
408
|
+
borderRadius: 4,
|
|
409
|
+
backgroundColor: macOSColors.background.input
|
|
410
|
+
},
|
|
411
|
+
cardBody: {
|
|
412
|
+
borderTopWidth: 1,
|
|
413
|
+
borderTopColor: macOSColors.border.default,
|
|
414
|
+
padding: 12,
|
|
415
|
+
gap: 12
|
|
416
|
+
},
|
|
417
|
+
dataViewerContainer: {
|
|
418
|
+
marginTop: 8
|
|
419
|
+
},
|
|
420
|
+
simpleValueContainer: {
|
|
421
|
+
gap: 8
|
|
422
|
+
},
|
|
423
|
+
simpleValueLabel: {
|
|
424
|
+
color: macOSColors.text.secondary,
|
|
425
|
+
fontSize: 10,
|
|
426
|
+
fontWeight: "500",
|
|
427
|
+
textTransform: "uppercase",
|
|
428
|
+
letterSpacing: 0.5
|
|
429
|
+
},
|
|
430
|
+
simpleValueBox: {
|
|
431
|
+
backgroundColor: gameUIColors.background + "4D",
|
|
432
|
+
borderRadius: 4,
|
|
433
|
+
padding: 10,
|
|
434
|
+
borderWidth: 1,
|
|
435
|
+
borderColor: gameUIColors.primary + "0D"
|
|
436
|
+
},
|
|
437
|
+
simpleValueContent: {
|
|
438
|
+
color: gameUIColors.success,
|
|
439
|
+
fontSize: 12,
|
|
440
|
+
fontFamily: "monospace",
|
|
441
|
+
lineHeight: 16
|
|
442
|
+
},
|
|
443
|
+
valueTypeText: {
|
|
444
|
+
color: gameUIColors.muted,
|
|
445
|
+
fontSize: 9,
|
|
446
|
+
fontStyle: "italic"
|
|
447
|
+
},
|
|
448
|
+
valueContainer: {
|
|
449
|
+
gap: 6
|
|
450
|
+
},
|
|
451
|
+
valueLabel: {
|
|
452
|
+
color: macOSColors.text.secondary,
|
|
453
|
+
fontSize: 10,
|
|
454
|
+
fontWeight: "500",
|
|
455
|
+
textTransform: "uppercase",
|
|
456
|
+
letterSpacing: 0.5
|
|
457
|
+
},
|
|
458
|
+
valueBox: {
|
|
459
|
+
backgroundColor: gameUIColors.background + "4D",
|
|
460
|
+
borderRadius: 4,
|
|
461
|
+
padding: 8,
|
|
462
|
+
borderWidth: 1,
|
|
463
|
+
borderColor: gameUIColors.primary + "0D"
|
|
464
|
+
},
|
|
465
|
+
valueContent: {
|
|
466
|
+
color: gameUIColors.primaryLight,
|
|
467
|
+
fontSize: 10,
|
|
468
|
+
fontFamily: "monospace",
|
|
469
|
+
lineHeight: 14
|
|
470
|
+
},
|
|
471
|
+
expectedValueBox: {
|
|
472
|
+
backgroundColor: gameUIColors.background + "4D",
|
|
473
|
+
borderRadius: 4,
|
|
474
|
+
padding: 8,
|
|
475
|
+
borderWidth: 1,
|
|
476
|
+
borderColor: gameUIColors.primary + "0D"
|
|
477
|
+
},
|
|
478
|
+
expectedValueContent: {
|
|
479
|
+
color: gameUIColors.primaryLight,
|
|
480
|
+
fontSize: 10,
|
|
481
|
+
fontFamily: "monospace",
|
|
482
|
+
lineHeight: 14
|
|
483
|
+
},
|
|
484
|
+
emptyValueContainer: {
|
|
485
|
+
flexDirection: "row",
|
|
486
|
+
alignItems: "center",
|
|
487
|
+
gap: 6,
|
|
488
|
+
padding: 8,
|
|
489
|
+
backgroundColor: gameUIColors.warning + "0D",
|
|
490
|
+
borderRadius: 4,
|
|
491
|
+
borderWidth: 1,
|
|
492
|
+
borderColor: gameUIColors.warning + "1A"
|
|
493
|
+
},
|
|
494
|
+
emptyValueText: {
|
|
495
|
+
color: gameUIColors.warning,
|
|
496
|
+
fontSize: 10,
|
|
497
|
+
fontStyle: "italic"
|
|
498
|
+
},
|
|
499
|
+
typeHelperText: {
|
|
500
|
+
color: macOSColors.text.secondary,
|
|
501
|
+
fontSize: 9,
|
|
502
|
+
marginTop: 4,
|
|
503
|
+
textAlign: "center"
|
|
504
|
+
},
|
|
505
|
+
metaInfo: {
|
|
506
|
+
marginTop: 8
|
|
507
|
+
},
|
|
508
|
+
metaLabel: {
|
|
509
|
+
color: gameUIColors.muted,
|
|
510
|
+
fontSize: 9,
|
|
511
|
+
fontStyle: "italic"
|
|
512
|
+
}
|
|
513
|
+
});
|