@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.
Files changed (187) hide show
  1. package/README.md +607 -0
  2. package/lib/commonjs/index.js +34 -0
  3. package/lib/commonjs/package.json +1 -0
  4. package/lib/commonjs/preset.js +94 -0
  5. package/lib/commonjs/storage/components/DiffViewer/DiffOptionsPanel.js +356 -0
  6. package/lib/commonjs/storage/components/DiffViewer/TreeDiffViewer.js +29 -0
  7. package/lib/commonjs/storage/components/DiffViewer/components/DiffSummary.js +121 -0
  8. package/lib/commonjs/storage/components/DiffViewer/modes/ThemedSplitView.js +419 -0
  9. package/lib/commonjs/storage/components/DiffViewer/themes/diffThemes.js +122 -0
  10. package/lib/commonjs/storage/components/GameUIStorageBrowser.js +924 -0
  11. package/lib/commonjs/storage/components/GameUIStorageStats.js +746 -0
  12. package/lib/commonjs/storage/components/MMKVInstanceInfoPanel.js +257 -0
  13. package/lib/commonjs/storage/components/MMKVInstanceSelector.js +418 -0
  14. package/lib/commonjs/storage/components/SelectionActionBar.js +224 -0
  15. package/lib/commonjs/storage/components/StorageActionButtons.js +239 -0
  16. package/lib/commonjs/storage/components/StorageActions.js +192 -0
  17. package/lib/commonjs/storage/components/StorageBrowserMode.js +31 -0
  18. package/lib/commonjs/storage/components/StorageEventDetailContent.js +1025 -0
  19. package/lib/commonjs/storage/components/StorageEventFilterView.js +141 -0
  20. package/lib/commonjs/storage/components/StorageEventListener.js +357 -0
  21. package/lib/commonjs/storage/components/StorageEventsSection.js +24 -0
  22. package/lib/commonjs/storage/components/StorageFilterCards.js +345 -0
  23. package/lib/commonjs/storage/components/StorageFilterViewV2.js +42 -0
  24. package/lib/commonjs/storage/components/StorageKeyCard.js +516 -0
  25. package/lib/commonjs/storage/components/StorageKeyRow.js +356 -0
  26. package/lib/commonjs/storage/components/StorageKeySection.js +105 -0
  27. package/lib/commonjs/storage/components/StorageKeyStats.js +344 -0
  28. package/lib/commonjs/storage/components/StorageModalWithTabs.js +871 -0
  29. package/lib/commonjs/storage/components/StorageSection.js +43 -0
  30. package/lib/commonjs/storage/hooks/useAsyncStorageKeys.js +126 -0
  31. package/lib/commonjs/storage/hooks/useMMKVInstances.js +221 -0
  32. package/lib/commonjs/storage/hooks/useMMKVKeys.js +362 -0
  33. package/lib/commonjs/storage/hooks/useTickEverySecond.js +21 -0
  34. package/lib/commonjs/storage/index.js +148 -0
  35. package/lib/commonjs/storage/types.js +5 -0
  36. package/lib/commonjs/storage/utils/AsyncStorageListener.js +510 -0
  37. package/lib/commonjs/storage/utils/MMKVInstanceRegistry.js +202 -0
  38. package/lib/commonjs/storage/utils/MMKVListener.js +380 -0
  39. package/lib/commonjs/storage/utils/clearAllStorage.js +47 -0
  40. package/lib/commonjs/storage/utils/index.js +180 -0
  41. package/lib/commonjs/storage/utils/lineDiff.js +363 -0
  42. package/lib/commonjs/storage/utils/mmkvAvailability.js +62 -0
  43. package/lib/commonjs/storage/utils/mmkvTypeDetection.js +139 -0
  44. package/lib/commonjs/storage/utils/objectDiff.js +157 -0
  45. package/lib/commonjs/storage/utils/safeAsyncStorage.js +140 -0
  46. package/lib/commonjs/storage/utils/storageActionHelpers.js +46 -0
  47. package/lib/commonjs/storage/utils/storageQueryUtils.js +35 -0
  48. package/lib/commonjs/storage/utils/valueType.js +18 -0
  49. package/lib/module/index.js +7 -0
  50. package/lib/module/preset.js +89 -0
  51. package/lib/module/storage/components/DiffViewer/DiffOptionsPanel.js +352 -0
  52. package/lib/module/storage/components/DiffViewer/TreeDiffViewer.js +25 -0
  53. package/lib/module/storage/components/DiffViewer/components/DiffSummary.js +117 -0
  54. package/lib/module/storage/components/DiffViewer/modes/ThemedSplitView.js +415 -0
  55. package/lib/module/storage/components/DiffViewer/themes/diffThemes.js +118 -0
  56. package/lib/module/storage/components/GameUIStorageBrowser.js +922 -0
  57. package/lib/module/storage/components/GameUIStorageStats.js +742 -0
  58. package/lib/module/storage/components/MMKVInstanceInfoPanel.js +253 -0
  59. package/lib/module/storage/components/MMKVInstanceSelector.js +414 -0
  60. package/lib/module/storage/components/SelectionActionBar.js +221 -0
  61. package/lib/module/storage/components/StorageActionButtons.js +236 -0
  62. package/lib/module/storage/components/StorageActions.js +189 -0
  63. package/lib/module/storage/components/StorageBrowserMode.js +27 -0
  64. package/lib/module/storage/components/StorageEventDetailContent.js +1020 -0
  65. package/lib/module/storage/components/StorageEventFilterView.js +137 -0
  66. package/lib/module/storage/components/StorageEventListener.js +354 -0
  67. package/lib/module/storage/components/StorageEventsSection.js +20 -0
  68. package/lib/module/storage/components/StorageFilterCards.js +341 -0
  69. package/lib/module/storage/components/StorageFilterViewV2.js +38 -0
  70. package/lib/module/storage/components/StorageKeyCard.js +513 -0
  71. package/lib/module/storage/components/StorageKeyRow.js +353 -0
  72. package/lib/module/storage/components/StorageKeySection.js +101 -0
  73. package/lib/module/storage/components/StorageKeyStats.js +340 -0
  74. package/lib/module/storage/components/StorageModalWithTabs.js +867 -0
  75. package/lib/module/storage/components/StorageSection.js +40 -0
  76. package/lib/module/storage/hooks/useAsyncStorageKeys.js +121 -0
  77. package/lib/module/storage/hooks/useMMKVInstances.js +216 -0
  78. package/lib/module/storage/hooks/useMMKVKeys.js +359 -0
  79. package/lib/module/storage/hooks/useTickEverySecond.js +18 -0
  80. package/lib/module/storage/index.js +25 -0
  81. package/lib/module/storage/types.js +3 -0
  82. package/lib/module/storage/utils/AsyncStorageListener.js +500 -0
  83. package/lib/module/storage/utils/MMKVInstanceRegistry.js +196 -0
  84. package/lib/module/storage/utils/MMKVListener.js +367 -0
  85. package/lib/module/storage/utils/clearAllStorage.js +42 -0
  86. package/lib/module/storage/utils/index.js +22 -0
  87. package/lib/module/storage/utils/lineDiff.js +359 -0
  88. package/lib/module/storage/utils/mmkvAvailability.js +56 -0
  89. package/lib/module/storage/utils/mmkvTypeDetection.js +133 -0
  90. package/lib/module/storage/utils/objectDiff.js +153 -0
  91. package/lib/module/storage/utils/safeAsyncStorage.js +134 -0
  92. package/lib/module/storage/utils/storageActionHelpers.js +42 -0
  93. package/lib/module/storage/utils/storageQueryUtils.js +30 -0
  94. package/lib/module/storage/utils/valueType.js +14 -0
  95. package/lib/typescript/index.d.ts +3 -0
  96. package/lib/typescript/index.d.ts.map +1 -0
  97. package/lib/typescript/preset.d.ts +90 -0
  98. package/lib/typescript/preset.d.ts.map +1 -0
  99. package/lib/typescript/storage/components/DiffViewer/DiffOptionsPanel.d.ts +18 -0
  100. package/lib/typescript/storage/components/DiffViewer/DiffOptionsPanel.d.ts.map +1 -0
  101. package/lib/typescript/storage/components/DiffViewer/TreeDiffViewer.d.ts +7 -0
  102. package/lib/typescript/storage/components/DiffViewer/TreeDiffViewer.d.ts.map +1 -0
  103. package/lib/typescript/storage/components/DiffViewer/components/DiffSummary.d.ts +12 -0
  104. package/lib/typescript/storage/components/DiffViewer/components/DiffSummary.d.ts.map +1 -0
  105. package/lib/typescript/storage/components/DiffViewer/modes/ThemedSplitView.d.ts +13 -0
  106. package/lib/typescript/storage/components/DiffViewer/modes/ThemedSplitView.d.ts.map +1 -0
  107. package/lib/typescript/storage/components/DiffViewer/themes/diffThemes.d.ts +64 -0
  108. package/lib/typescript/storage/components/DiffViewer/themes/diffThemes.d.ts.map +1 -0
  109. package/lib/typescript/storage/components/GameUIStorageBrowser.d.ts +16 -0
  110. package/lib/typescript/storage/components/GameUIStorageBrowser.d.ts.map +1 -0
  111. package/lib/typescript/storage/components/GameUIStorageStats.d.ts +7 -0
  112. package/lib/typescript/storage/components/GameUIStorageStats.d.ts.map +1 -0
  113. package/lib/typescript/storage/components/MMKVInstanceInfoPanel.d.ts +42 -0
  114. package/lib/typescript/storage/components/MMKVInstanceInfoPanel.d.ts.map +1 -0
  115. package/lib/typescript/storage/components/MMKVInstanceSelector.d.ts +35 -0
  116. package/lib/typescript/storage/components/MMKVInstanceSelector.d.ts.map +1 -0
  117. package/lib/typescript/storage/components/SelectionActionBar.d.ts +21 -0
  118. package/lib/typescript/storage/components/SelectionActionBar.d.ts.map +1 -0
  119. package/lib/typescript/storage/components/StorageActionButtons.d.ts +21 -0
  120. package/lib/typescript/storage/components/StorageActionButtons.d.ts.map +1 -0
  121. package/lib/typescript/storage/components/StorageActions.d.ts +10 -0
  122. package/lib/typescript/storage/components/StorageActions.d.ts.map +1 -0
  123. package/lib/typescript/storage/components/StorageBrowserMode.d.ts +18 -0
  124. package/lib/typescript/storage/components/StorageBrowserMode.d.ts.map +1 -0
  125. package/lib/typescript/storage/components/StorageEventDetailContent.d.ts +40 -0
  126. package/lib/typescript/storage/components/StorageEventDetailContent.d.ts.map +1 -0
  127. package/lib/typescript/storage/components/StorageEventFilterView.d.ts +11 -0
  128. package/lib/typescript/storage/components/StorageEventFilterView.d.ts.map +1 -0
  129. package/lib/typescript/storage/components/StorageEventListener.d.ts +6 -0
  130. package/lib/typescript/storage/components/StorageEventListener.d.ts.map +1 -0
  131. package/lib/typescript/storage/components/StorageEventsSection.d.ts +7 -0
  132. package/lib/typescript/storage/components/StorageEventsSection.d.ts.map +1 -0
  133. package/lib/typescript/storage/components/StorageFilterCards.d.ts +36 -0
  134. package/lib/typescript/storage/components/StorageFilterCards.d.ts.map +1 -0
  135. package/lib/typescript/storage/components/StorageFilterViewV2.d.ts +9 -0
  136. package/lib/typescript/storage/components/StorageFilterViewV2.d.ts.map +1 -0
  137. package/lib/typescript/storage/components/StorageKeyCard.d.ts +17 -0
  138. package/lib/typescript/storage/components/StorageKeyCard.d.ts.map +1 -0
  139. package/lib/typescript/storage/components/StorageKeyRow.d.ts +15 -0
  140. package/lib/typescript/storage/components/StorageKeyRow.d.ts.map +1 -0
  141. package/lib/typescript/storage/components/StorageKeySection.d.ts +25 -0
  142. package/lib/typescript/storage/components/StorageKeySection.d.ts.map +1 -0
  143. package/lib/typescript/storage/components/StorageKeyStats.d.ts +15 -0
  144. package/lib/typescript/storage/components/StorageKeyStats.d.ts.map +1 -0
  145. package/lib/typescript/storage/components/StorageModalWithTabs.d.ts +13 -0
  146. package/lib/typescript/storage/components/StorageModalWithTabs.d.ts.map +1 -0
  147. package/lib/typescript/storage/components/StorageSection.d.ts +10 -0
  148. package/lib/typescript/storage/components/StorageSection.d.ts.map +1 -0
  149. package/lib/typescript/storage/hooks/useAsyncStorageKeys.d.ts +10 -0
  150. package/lib/typescript/storage/hooks/useAsyncStorageKeys.d.ts.map +1 -0
  151. package/lib/typescript/storage/hooks/useMMKVInstances.d.ts +114 -0
  152. package/lib/typescript/storage/hooks/useMMKVInstances.d.ts.map +1 -0
  153. package/lib/typescript/storage/hooks/useMMKVKeys.d.ts +94 -0
  154. package/lib/typescript/storage/hooks/useMMKVKeys.d.ts.map +1 -0
  155. package/lib/typescript/storage/hooks/useTickEverySecond.d.ts +6 -0
  156. package/lib/typescript/storage/hooks/useTickEverySecond.d.ts.map +1 -0
  157. package/lib/typescript/storage/index.d.ts +15 -0
  158. package/lib/typescript/storage/index.d.ts.map +1 -0
  159. package/lib/typescript/storage/types.d.ts +41 -0
  160. package/lib/typescript/storage/types.d.ts.map +1 -0
  161. package/lib/typescript/storage/utils/AsyncStorageListener.d.ts +195 -0
  162. package/lib/typescript/storage/utils/AsyncStorageListener.d.ts.map +1 -0
  163. package/lib/typescript/storage/utils/MMKVInstanceRegistry.d.ts +224 -0
  164. package/lib/typescript/storage/utils/MMKVInstanceRegistry.d.ts.map +1 -0
  165. package/lib/typescript/storage/utils/MMKVListener.d.ts +218 -0
  166. package/lib/typescript/storage/utils/MMKVListener.d.ts.map +1 -0
  167. package/lib/typescript/storage/utils/clearAllStorage.d.ts +11 -0
  168. package/lib/typescript/storage/utils/clearAllStorage.d.ts.map +1 -0
  169. package/lib/typescript/storage/utils/index.d.ts +8 -0
  170. package/lib/typescript/storage/utils/index.d.ts.map +1 -0
  171. package/lib/typescript/storage/utils/lineDiff.d.ts +34 -0
  172. package/lib/typescript/storage/utils/lineDiff.d.ts.map +1 -0
  173. package/lib/typescript/storage/utils/mmkvAvailability.d.ts +23 -0
  174. package/lib/typescript/storage/utils/mmkvAvailability.d.ts.map +1 -0
  175. package/lib/typescript/storage/utils/mmkvTypeDetection.d.ts +71 -0
  176. package/lib/typescript/storage/utils/mmkvTypeDetection.d.ts.map +1 -0
  177. package/lib/typescript/storage/utils/objectDiff.d.ts +35 -0
  178. package/lib/typescript/storage/utils/objectDiff.d.ts.map +1 -0
  179. package/lib/typescript/storage/utils/safeAsyncStorage.d.ts +56 -0
  180. package/lib/typescript/storage/utils/safeAsyncStorage.d.ts.map +1 -0
  181. package/lib/typescript/storage/utils/storageActionHelpers.d.ts +5 -0
  182. package/lib/typescript/storage/utils/storageActionHelpers.d.ts.map +1 -0
  183. package/lib/typescript/storage/utils/storageQueryUtils.d.ts +6 -0
  184. package/lib/typescript/storage/utils/storageQueryUtils.d.ts.map +1 -0
  185. package/lib/typescript/storage/utils/valueType.d.ts +3 -0
  186. package/lib/typescript/storage/utils/valueType.d.ts.map +1 -0
  187. package/package.json +68 -0
@@ -0,0 +1,516 @@
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
+ }), /*#__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.TouchableOpacity, {
207
+ accessibilityLabel: "Expand",
208
+ accessibilityHint: "Expand storage key card",
209
+ "sentry-label": `ignore storage key card ${storageKey.key} expand`,
210
+ accessibilityRole: "button",
211
+ style: styles.actionButton,
212
+ onPress: onToggle,
213
+ hitSlop: HIT_SLOP,
214
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Eye, {
215
+ size: 12,
216
+ color: _sharedUi.macOSColors.text.secondary
217
+ })
218
+ })
219
+ })]
220
+ }), isExpanded && hasValue && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
221
+ style: styles.cardBody,
222
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
223
+ style: styles.dataViewerContainer,
224
+ children: typeof storageKey.value === "string" || typeof storageKey.value === "number" || typeof storageKey.value === "boolean" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
225
+ style: styles.simpleValueContainer,
226
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
227
+ style: styles.simpleValueLabel,
228
+ children: "Current Value:"
229
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
230
+ style: styles.simpleValueBox,
231
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
232
+ style: styles.simpleValueContent,
233
+ selectable: true,
234
+ children: String(storageKey.value)
235
+ })
236
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
237
+ style: styles.valueTypeText,
238
+ children: ["Type: ", (0, _valueType.getValueTypeLabel)(storageKey.value)]
239
+ })]
240
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_dataViewer.DataViewer, {
241
+ title: "Current Value",
242
+ data: storageKey.value,
243
+ showTypeFilter: false,
244
+ rawMode: true
245
+ })
246
+ }), hasExpectedValue && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
247
+ style: styles.valueContainer,
248
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
249
+ style: styles.valueLabel,
250
+ children: "Expected Value:"
251
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
252
+ style: styles.expectedValueBox,
253
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
254
+ style: styles.expectedValueContent,
255
+ selectable: true,
256
+ children: storageKey.expectedValue
257
+ })
258
+ })]
259
+ }), hasExpectedType && storageKey.expectedType && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
260
+ style: styles.valueContainer,
261
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
262
+ style: styles.valueLabel,
263
+ children: "Expected Type:"
264
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
265
+ style: styles.expectedValueBox,
266
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
267
+ style: styles.expectedValueContent,
268
+ selectable: true,
269
+ children: storageKey.expectedType.toUpperCase()
270
+ })
271
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
272
+ style: styles.typeHelperText,
273
+ children: ["Current type: ", (0, _valueType.getValueTypeLabel)(storageKey.value)]
274
+ })]
275
+ }), storageKey.lastUpdated && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
276
+ style: styles.metaInfo,
277
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
278
+ style: styles.metaLabel,
279
+ children: ["Last updated123: ", storageKey.lastUpdated.toLocaleString()]
280
+ })
281
+ })]
282
+ }), isExpanded && !hasValue && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
283
+ style: styles.cardBody,
284
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
285
+ style: styles.emptyValueContainer,
286
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.AlertCircle, {
287
+ size: 16,
288
+ color: _sharedUi.macOSColors.semantic.warning
289
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
290
+ style: styles.emptyValueText,
291
+ children: "Storage key not found or empty"
292
+ })]
293
+ }), hasExpectedValue && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
294
+ style: styles.valueContainer,
295
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
296
+ style: styles.valueLabel,
297
+ children: "Expected Value:"
298
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
299
+ style: styles.expectedValueBox,
300
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
301
+ style: styles.expectedValueContent,
302
+ selectable: true,
303
+ children: storageKey.expectedValue
304
+ })
305
+ })]
306
+ })]
307
+ })]
308
+ });
309
+ }
310
+ const styles = _reactNative.StyleSheet.create({
311
+ storageKeyCard: {
312
+ backgroundColor: _sharedUi.macOSColors.background.card,
313
+ borderRadius: 8,
314
+ borderWidth: 1,
315
+ overflow: "hidden"
316
+ },
317
+ cardHeader: {
318
+ padding: 12,
319
+ flexDirection: "row",
320
+ alignItems: "center",
321
+ justifyContent: "space-between"
322
+ },
323
+ cardHeaderLeft: {
324
+ flexDirection: "row",
325
+ alignItems: "center",
326
+ flex: 1,
327
+ minWidth: 0
328
+ },
329
+ iconContainer: {
330
+ padding: 6,
331
+ borderRadius: 6,
332
+ marginRight: 10
333
+ },
334
+ cardHeaderInfo: {
335
+ flex: 1,
336
+ minWidth: 0,
337
+ gap: 4
338
+ },
339
+ storageKeyText: {
340
+ color: "#FFFFFF",
341
+ fontWeight: "500",
342
+ fontSize: 12,
343
+ flexWrap: "wrap",
344
+ flex: 1
345
+ },
346
+ descriptionText: {
347
+ color: _sharedUi.macOSColors.text.secondary,
348
+ fontSize: 10,
349
+ marginTop: 2,
350
+ flexWrap: "wrap"
351
+ },
352
+ cardHeaderMeta: {
353
+ flexDirection: "row",
354
+ alignItems: "center",
355
+ gap: 6,
356
+ flexWrap: "wrap"
357
+ },
358
+ statusBadge: {
359
+ paddingHorizontal: 6,
360
+ paddingVertical: 2,
361
+ borderRadius: 4
362
+ },
363
+ statusText: {
364
+ fontSize: 9,
365
+ fontWeight: "600",
366
+ letterSpacing: 0.5
367
+ },
368
+ storageBadge: {
369
+ paddingHorizontal: 6,
370
+ paddingVertical: 2,
371
+ borderRadius: 4,
372
+ flexDirection: "row",
373
+ alignItems: "center",
374
+ gap: 4
375
+ },
376
+ storageText: {
377
+ fontSize: 9,
378
+ fontWeight: "600"
379
+ },
380
+ instanceBadge: {
381
+ paddingHorizontal: 6,
382
+ paddingVertical: 3,
383
+ borderRadius: 4,
384
+ borderWidth: 1,
385
+ flexDirection: 'row',
386
+ alignItems: 'center',
387
+ gap: 4
388
+ },
389
+ instanceText: {
390
+ fontSize: 9,
391
+ fontWeight: "700",
392
+ fontFamily: "monospace",
393
+ letterSpacing: 0.3
394
+ },
395
+ valueBadge: {
396
+ paddingHorizontal: 4,
397
+ paddingVertical: 2,
398
+ backgroundColor: _sharedUi.macOSColors.background.input,
399
+ borderRadius: 3
400
+ },
401
+ valueText: {
402
+ fontSize: 8,
403
+ color: _sharedUi.macOSColors.text.secondary,
404
+ fontWeight: "500"
405
+ },
406
+ cardHeaderRight: {
407
+ marginLeft: 8
408
+ },
409
+ actionButton: {
410
+ padding: 4,
411
+ borderRadius: 4,
412
+ backgroundColor: _sharedUi.macOSColors.background.input
413
+ },
414
+ cardBody: {
415
+ borderTopWidth: 1,
416
+ borderTopColor: _sharedUi.macOSColors.border.default,
417
+ padding: 12,
418
+ gap: 12
419
+ },
420
+ dataViewerContainer: {
421
+ marginTop: 8
422
+ },
423
+ simpleValueContainer: {
424
+ gap: 8
425
+ },
426
+ simpleValueLabel: {
427
+ color: _sharedUi.macOSColors.text.secondary,
428
+ fontSize: 10,
429
+ fontWeight: "500",
430
+ textTransform: "uppercase",
431
+ letterSpacing: 0.5
432
+ },
433
+ simpleValueBox: {
434
+ backgroundColor: _sharedUi.gameUIColors.background + "4D",
435
+ borderRadius: 4,
436
+ padding: 10,
437
+ borderWidth: 1,
438
+ borderColor: _sharedUi.gameUIColors.primary + "0D"
439
+ },
440
+ simpleValueContent: {
441
+ color: _sharedUi.gameUIColors.success,
442
+ fontSize: 12,
443
+ fontFamily: "monospace",
444
+ lineHeight: 16
445
+ },
446
+ valueTypeText: {
447
+ color: _sharedUi.gameUIColors.muted,
448
+ fontSize: 9,
449
+ fontStyle: "italic"
450
+ },
451
+ valueContainer: {
452
+ gap: 6
453
+ },
454
+ valueLabel: {
455
+ color: _sharedUi.macOSColors.text.secondary,
456
+ fontSize: 10,
457
+ fontWeight: "500",
458
+ textTransform: "uppercase",
459
+ letterSpacing: 0.5
460
+ },
461
+ valueBox: {
462
+ backgroundColor: _sharedUi.gameUIColors.background + "4D",
463
+ borderRadius: 4,
464
+ padding: 8,
465
+ borderWidth: 1,
466
+ borderColor: _sharedUi.gameUIColors.primary + "0D"
467
+ },
468
+ valueContent: {
469
+ color: _sharedUi.gameUIColors.primaryLight,
470
+ fontSize: 10,
471
+ fontFamily: "monospace",
472
+ lineHeight: 14
473
+ },
474
+ expectedValueBox: {
475
+ backgroundColor: _sharedUi.gameUIColors.background + "4D",
476
+ borderRadius: 4,
477
+ padding: 8,
478
+ borderWidth: 1,
479
+ borderColor: _sharedUi.gameUIColors.primary + "0D"
480
+ },
481
+ expectedValueContent: {
482
+ color: _sharedUi.gameUIColors.primaryLight,
483
+ fontSize: 10,
484
+ fontFamily: "monospace",
485
+ lineHeight: 14
486
+ },
487
+ emptyValueContainer: {
488
+ flexDirection: "row",
489
+ alignItems: "center",
490
+ gap: 6,
491
+ padding: 8,
492
+ backgroundColor: _sharedUi.gameUIColors.warning + "0D",
493
+ borderRadius: 4,
494
+ borderWidth: 1,
495
+ borderColor: _sharedUi.gameUIColors.warning + "1A"
496
+ },
497
+ emptyValueText: {
498
+ color: _sharedUi.gameUIColors.warning,
499
+ fontSize: 10,
500
+ fontStyle: "italic"
501
+ },
502
+ typeHelperText: {
503
+ color: _sharedUi.macOSColors.text.secondary,
504
+ fontSize: 9,
505
+ marginTop: 4,
506
+ textAlign: "center"
507
+ },
508
+ metaInfo: {
509
+ marginTop: 8
510
+ },
511
+ metaLabel: {
512
+ color: _sharedUi.gameUIColors.muted,
513
+ fontSize: 9,
514
+ fontStyle: "italic"
515
+ }
516
+ });