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