@buoy-gg/storage 1.7.7 → 2.1.1

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 (61) hide show
  1. package/lib/commonjs/index.js +219 -16
  2. package/lib/commonjs/storage/components/DiffViewer/themes/diffThemes.js +35 -44
  3. package/lib/commonjs/storage/components/GameUIStorageBrowser.js +9 -23
  4. package/lib/commonjs/storage/components/SelectionActionBar.js +8 -22
  5. package/lib/commonjs/storage/components/StorageActionButtons.js +8 -22
  6. package/lib/commonjs/storage/components/StorageActions.js +8 -22
  7. package/lib/commonjs/storage/components/StorageEventActionButton.js +120 -0
  8. package/lib/commonjs/storage/components/StorageEventCard.js +112 -0
  9. package/lib/commonjs/storage/components/StorageEventDetailContent.js +331 -822
  10. package/lib/commonjs/storage/components/StorageModalWithTabs.js +43 -200
  11. package/lib/commonjs/storage/hooks/useStorageEvents.js +98 -0
  12. package/lib/commonjs/storage/index.js +111 -2
  13. package/lib/commonjs/storage/stores/storageEventStore.js +243 -0
  14. package/lib/commonjs/storage/utils/AsyncStorageListener.js +164 -35
  15. package/lib/commonjs/storage/utils/index.js +37 -0
  16. package/lib/commonjs/storage/utils/storageTimeTravelUtils.js +251 -0
  17. package/lib/module/index.js +74 -3
  18. package/lib/module/storage/components/DiffViewer/themes/diffThemes.js +35 -44
  19. package/lib/module/storage/components/GameUIStorageBrowser.js +9 -23
  20. package/lib/module/storage/components/SelectionActionBar.js +9 -24
  21. package/lib/module/storage/components/StorageActionButtons.js +9 -24
  22. package/lib/module/storage/components/StorageActions.js +9 -24
  23. package/lib/module/storage/components/StorageEventActionButton.js +117 -0
  24. package/lib/module/storage/components/StorageEventCard.js +107 -0
  25. package/lib/module/storage/components/StorageEventDetailContent.js +332 -824
  26. package/lib/module/storage/components/StorageModalWithTabs.js +45 -202
  27. package/lib/module/storage/hooks/useStorageEvents.js +95 -0
  28. package/lib/module/storage/index.js +7 -1
  29. package/lib/module/storage/stores/storageEventStore.js +231 -0
  30. package/lib/module/storage/utils/AsyncStorageListener.js +159 -33
  31. package/lib/module/storage/utils/index.js +4 -1
  32. package/lib/module/storage/utils/storageTimeTravelUtils.js +245 -0
  33. package/lib/typescript/index.d.ts +36 -1
  34. package/lib/typescript/index.d.ts.map +1 -1
  35. package/lib/typescript/storage/components/DiffViewer/themes/diffThemes.d.ts +1 -1
  36. package/lib/typescript/storage/components/DiffViewer/themes/diffThemes.d.ts.map +1 -1
  37. package/lib/typescript/storage/components/GameUIStorageBrowser.d.ts.map +1 -1
  38. package/lib/typescript/storage/components/SelectionActionBar.d.ts.map +1 -1
  39. package/lib/typescript/storage/components/StorageActionButtons.d.ts +0 -2
  40. package/lib/typescript/storage/components/StorageActionButtons.d.ts.map +1 -1
  41. package/lib/typescript/storage/components/StorageActions.d.ts.map +1 -1
  42. package/lib/typescript/storage/components/StorageEventActionButton.d.ts +37 -0
  43. package/lib/typescript/storage/components/StorageEventActionButton.d.ts.map +1 -0
  44. package/lib/typescript/storage/components/StorageEventCard.d.ts +40 -0
  45. package/lib/typescript/storage/components/StorageEventCard.d.ts.map +1 -0
  46. package/lib/typescript/storage/components/StorageEventDetailContent.d.ts +11 -3
  47. package/lib/typescript/storage/components/StorageEventDetailContent.d.ts.map +1 -1
  48. package/lib/typescript/storage/components/StorageModalWithTabs.d.ts.map +1 -1
  49. package/lib/typescript/storage/hooks/useStorageEvents.d.ts +51 -0
  50. package/lib/typescript/storage/hooks/useStorageEvents.d.ts.map +1 -0
  51. package/lib/typescript/storage/index.d.ts +4 -0
  52. package/lib/typescript/storage/index.d.ts.map +1 -1
  53. package/lib/typescript/storage/stores/storageEventStore.d.ts +113 -0
  54. package/lib/typescript/storage/stores/storageEventStore.d.ts.map +1 -0
  55. package/lib/typescript/storage/utils/AsyncStorageListener.d.ts +38 -1
  56. package/lib/typescript/storage/utils/AsyncStorageListener.d.ts.map +1 -1
  57. package/lib/typescript/storage/utils/index.d.ts +2 -1
  58. package/lib/typescript/storage/utils/index.d.ts.map +1 -1
  59. package/lib/typescript/storage/utils/storageTimeTravelUtils.d.ts +35 -0
  60. package/lib/typescript/storage/utils/storageTimeTravelUtils.d.ts.map +1 -0
  61. package/package.json +20 -4
@@ -3,32 +3,235 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- var _exportNames = {
7
- storageToolPreset: true,
8
- createStorageTool: true
9
- };
6
+ Object.defineProperty(exports, "MMKVInstanceInfoPanel", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _MMKVInstanceInfoPanel.MMKVInstanceInfoPanel;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "MMKVInstanceSelector", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _MMKVInstanceSelector.MMKVInstanceSelector;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "StorageBrowserMode", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _StorageBrowserMode.StorageBrowserMode;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "StorageEventCard", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _StorageEventCard.StorageEventCard;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "StorageEventDetailContent", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _StorageEventDetailContent.StorageEventDetailContent;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "StorageEventDetailFooter", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _StorageEventDetailContent.StorageEventDetailFooter;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "StorageEventsSection", {
43
+ enumerable: true,
44
+ get: function () {
45
+ return _StorageEventsSection.StorageEventsSection;
46
+ }
47
+ });
48
+ Object.defineProperty(exports, "StorageKeyCard", {
49
+ enumerable: true,
50
+ get: function () {
51
+ return _StorageKeyCard.StorageKeyCard;
52
+ }
53
+ });
54
+ Object.defineProperty(exports, "StorageKeySection", {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _StorageKeySection.StorageKeySection;
58
+ }
59
+ });
60
+ Object.defineProperty(exports, "StorageKeyStatsSection", {
61
+ enumerable: true,
62
+ get: function () {
63
+ return _StorageKeyStats.StorageKeyStatsSection;
64
+ }
65
+ });
66
+ Object.defineProperty(exports, "StorageModalWithTabs", {
67
+ enumerable: true,
68
+ get: function () {
69
+ return _StorageModalWithTabs.StorageModalWithTabs;
70
+ }
71
+ });
72
+ Object.defineProperty(exports, "StorageSection", {
73
+ enumerable: true,
74
+ get: function () {
75
+ return _StorageSection.StorageSection;
76
+ }
77
+ });
78
+ Object.defineProperty(exports, "canUndo", {
79
+ enumerable: true,
80
+ get: function () {
81
+ return _storageTimeTravelUtils.canUndo;
82
+ }
83
+ });
84
+ Object.defineProperty(exports, "clearAllAppStorage", {
85
+ enumerable: true,
86
+ get: function () {
87
+ return _clearAllStorage.clearAllAppStorage;
88
+ }
89
+ });
10
90
  Object.defineProperty(exports, "createStorageTool", {
11
91
  enumerable: true,
12
92
  get: function () {
13
93
  return _preset.createStorageTool;
14
94
  }
15
95
  });
96
+ Object.defineProperty(exports, "detectMMKVType", {
97
+ enumerable: true,
98
+ get: function () {
99
+ return _mmkvTypeDetection.detectMMKVType;
100
+ }
101
+ });
102
+ Object.defineProperty(exports, "formatMMKVValue", {
103
+ enumerable: true,
104
+ get: function () {
105
+ return _mmkvTypeDetection.formatMMKVValue;
106
+ }
107
+ });
108
+ Object.defineProperty(exports, "getMMKVClass", {
109
+ enumerable: true,
110
+ get: function () {
111
+ return _mmkvAvailability.getMMKVClass;
112
+ }
113
+ });
114
+ Object.defineProperty(exports, "getMMKVUnavailableMessage", {
115
+ enumerable: true,
116
+ get: function () {
117
+ return _mmkvAvailability.getMMKVUnavailableMessage;
118
+ }
119
+ });
120
+ Object.defineProperty(exports, "getValueType", {
121
+ enumerable: true,
122
+ get: function () {
123
+ return _StorageEventCard.getValueType;
124
+ }
125
+ });
126
+ Object.defineProperty(exports, "isMMKVAvailable", {
127
+ enumerable: true,
128
+ get: function () {
129
+ return _mmkvAvailability.isMMKVAvailable;
130
+ }
131
+ });
132
+ Object.defineProperty(exports, "isTypeMatch", {
133
+ enumerable: true,
134
+ get: function () {
135
+ return _mmkvTypeDetection.isTypeMatch;
136
+ }
137
+ });
138
+ Object.defineProperty(exports, "jumpToState", {
139
+ enumerable: true,
140
+ get: function () {
141
+ return _storageTimeTravelUtils.jumpToState;
142
+ }
143
+ });
144
+ Object.defineProperty(exports, "registerMMKVInstance", {
145
+ enumerable: true,
146
+ get: function () {
147
+ return _MMKVInstanceRegistry.registerMMKVInstance;
148
+ }
149
+ });
150
+ Object.defineProperty(exports, "storageEventStore", {
151
+ enumerable: true,
152
+ get: function () {
153
+ return _storageEventStore.storageEventStore;
154
+ }
155
+ });
16
156
  Object.defineProperty(exports, "storageToolPreset", {
17
157
  enumerable: true,
18
158
  get: function () {
19
159
  return _preset.storageToolPreset;
20
160
  }
21
161
  });
162
+ Object.defineProperty(exports, "undoOperation", {
163
+ enumerable: true,
164
+ get: function () {
165
+ return _storageTimeTravelUtils.undoOperation;
166
+ }
167
+ });
168
+ Object.defineProperty(exports, "unregisterMMKVInstance", {
169
+ enumerable: true,
170
+ get: function () {
171
+ return _MMKVInstanceRegistry.unregisterMMKVInstance;
172
+ }
173
+ });
174
+ Object.defineProperty(exports, "useAsyncStorageKeys", {
175
+ enumerable: true,
176
+ get: function () {
177
+ return _useAsyncStorageKeys.useAsyncStorageKeys;
178
+ }
179
+ });
180
+ Object.defineProperty(exports, "useMMKVInstance", {
181
+ enumerable: true,
182
+ get: function () {
183
+ return _useMMKVInstances.useMMKVInstance;
184
+ }
185
+ });
186
+ Object.defineProperty(exports, "useMMKVInstanceExists", {
187
+ enumerable: true,
188
+ get: function () {
189
+ return _useMMKVInstances.useMMKVInstanceExists;
190
+ }
191
+ });
192
+ Object.defineProperty(exports, "useMMKVInstances", {
193
+ enumerable: true,
194
+ get: function () {
195
+ return _useMMKVInstances.useMMKVInstances;
196
+ }
197
+ });
198
+ Object.defineProperty(exports, "useMMKVKeys", {
199
+ enumerable: true,
200
+ get: function () {
201
+ return _useMMKVKeys.useMMKVKeys;
202
+ }
203
+ });
204
+ Object.defineProperty(exports, "useMultiMMKVKeys", {
205
+ enumerable: true,
206
+ get: function () {
207
+ return _useMMKVKeys.useMultiMMKVKeys;
208
+ }
209
+ });
210
+ Object.defineProperty(exports, "useStorageEvents", {
211
+ enumerable: true,
212
+ get: function () {
213
+ return _useStorageEvents.useStorageEvents;
214
+ }
215
+ });
22
216
  var _preset = require("./preset");
23
- var _storage = require("./storage");
24
- Object.keys(_storage).forEach(function (key) {
25
- if (key === "default" || key === "__esModule") return;
26
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
27
- if (key in exports && exports[key] === _storage[key]) return;
28
- Object.defineProperty(exports, key, {
29
- enumerable: true,
30
- get: function () {
31
- return _storage[key];
32
- }
33
- });
34
- });
217
+ var _StorageSection = require("./storage/components/StorageSection");
218
+ var _StorageModalWithTabs = require("./storage/components/StorageModalWithTabs");
219
+ var _StorageKeyCard = require("./storage/components/StorageKeyCard");
220
+ var _StorageKeyStats = require("./storage/components/StorageKeyStats");
221
+ var _StorageKeySection = require("./storage/components/StorageKeySection");
222
+ var _StorageBrowserMode = require("./storage/components/StorageBrowserMode");
223
+ var _StorageEventsSection = require("./storage/components/StorageEventsSection");
224
+ var _StorageEventCard = require("./storage/components/StorageEventCard");
225
+ var _StorageEventDetailContent = require("./storage/components/StorageEventDetailContent");
226
+ var _MMKVInstanceSelector = require("./storage/components/MMKVInstanceSelector");
227
+ var _MMKVInstanceInfoPanel = require("./storage/components/MMKVInstanceInfoPanel");
228
+ var _useAsyncStorageKeys = require("./storage/hooks/useAsyncStorageKeys");
229
+ var _useMMKVKeys = require("./storage/hooks/useMMKVKeys");
230
+ var _useMMKVInstances = require("./storage/hooks/useMMKVInstances");
231
+ var _useStorageEvents = require("./storage/hooks/useStorageEvents");
232
+ var _clearAllStorage = require("./storage/utils/clearAllStorage");
233
+ var _mmkvAvailability = require("./storage/utils/mmkvAvailability");
234
+ var _mmkvTypeDetection = require("./storage/utils/mmkvTypeDetection");
235
+ var _storageTimeTravelUtils = require("./storage/utils/storageTimeTravelUtils");
236
+ var _MMKVInstanceRegistry = require("./storage/utils/MMKVInstanceRegistry");
237
+ var _storageEventStore = require("./storage/stores/storageEventStore");
@@ -54,63 +54,54 @@ const gitClassicTheme = exports.gitClassicTheme = {
54
54
 
55
55
  /**
56
56
  * Dev Tools Default Theme
57
- * Clean dark theme using our gameUIColors
57
+ * Clean dark theme matching Buoy website brand colors
58
58
  */
59
59
  const devToolsDefaultTheme = exports.devToolsDefaultTheme = {
60
60
  name: "Dev Tools Default",
61
- description: "Clean dark theme with our game UI colors",
62
- // Use our gameUIColors-inspired dark theme
63
- background: "#0A0E1A",
64
- // Dark background
65
- panelBackground: "#0F1420",
66
- // Slightly lighter panel
67
- headerBackground: "#141925",
68
- // Header background
69
-
70
- // Diff colors with our cyan/yellow/red scheme
71
- addedBackground: "rgba(74, 255, 159, 0.1)",
72
- // Green-cyan for additions
73
- removedBackground: "rgba(255, 82, 82, 0.1)",
74
- // Red for removals
75
- modifiedBackground: "rgba(0, 184, 230, 0.1)",
76
- // Cyan for modifications
61
+ description: "Clean dark theme with Buoy brand colors",
62
+ // Surface colors (matching website dark theme)
63
+ background: "#121212",
64
+ panelBackground: "#1A1A1A",
65
+ headerBackground: "#1A1A1A",
66
+ // Diff colors using website's semantic colors
67
+ // Added: Primary teal (#20C997)
68
+ // Removed: Error red (#EF4444)
69
+ // Modified: Secondary purple (#9B70E0)
70
+ addedBackground: "rgba(32, 201, 151, 0.12)",
71
+ removedBackground: "rgba(239, 68, 68, 0.12)",
72
+ modifiedBackground: "rgba(155, 112, 224, 0.12)",
77
73
  unchangedBackground: "transparent",
78
74
  contextBackground: "rgba(255, 255, 255, 0.02)",
79
75
  // Text colors
80
- addedText: "#4AFF9F",
81
- // Bright green-cyan
82
- removedText: "#FF5252",
83
- // Bright red
84
- modifiedText: "#00B8E6",
85
- // Bright cyan
86
- unchangedText: "#B8BFC9",
87
- // Muted text
88
-
76
+ addedText: "#20C997",
77
+ removedText: "#EF4444",
78
+ modifiedText: "#9B70E0",
79
+ unchangedText: "#E0E0E0",
89
80
  // Word-level highlights
90
- addedWordHighlight: "rgba(74, 255, 159, 0.3)",
91
- removedWordHighlight: "rgba(255, 82, 82, 0.3)",
81
+ addedWordHighlight: "rgba(32, 201, 151, 0.3)",
82
+ removedWordHighlight: "rgba(239, 68, 68, 0.3)",
92
83
  // UI elements
93
- lineNumberBackground: "#0A0E1A",
94
- lineNumberText: "#7A8599",
95
- lineNumberBorder: "#1F2937",
84
+ lineNumberBackground: "#121212",
85
+ lineNumberText: "#A0A0A0",
86
+ lineNumberBorder: "#333333",
96
87
  // Markers
97
- markerAddedBackground: "rgba(74, 255, 159, 0.2)",
98
- markerRemovedBackground: "rgba(255, 82, 82, 0.2)",
99
- markerModifiedBackground: "rgba(0, 184, 230, 0.2)",
100
- markerText: "#7A8599",
88
+ markerAddedBackground: "rgba(32, 201, 151, 0.2)",
89
+ markerRemovedBackground: "rgba(239, 68, 68, 0.2)",
90
+ markerModifiedBackground: "rgba(155, 112, 224, 0.2)",
91
+ markerText: "#A0A0A0",
101
92
  // Borders and dividers
102
- borderColor: "#1F2937",
103
- dividerColor: "#1F2937",
93
+ borderColor: "#333333",
94
+ dividerColor: "#333333",
104
95
  // Summary bar
105
- summaryBackground: "#0F1420",
106
- summaryAddedText: "#4AFF9F",
107
- summaryRemovedText: "#FF5252",
108
- summaryModifiedText: "#00B8E6",
96
+ summaryBackground: "#1A1A1A",
97
+ summaryAddedText: "#20C997",
98
+ summaryRemovedText: "#EF4444",
99
+ summaryModifiedText: "#9B70E0",
109
100
  // Empty state
110
- emptyStateText: "#7A8599",
101
+ emptyStateText: "#888888",
111
102
  // Separator
112
- separatorBackground: "#141925",
113
- separatorText: "#7A8599"
103
+ separatorBackground: "#1A1A1A",
104
+ separatorText: "#A0A0A0"
114
105
  };
115
106
 
116
107
  /**
@@ -17,6 +17,7 @@ var _useMMKVInstances = require("../hooks/useMMKVInstances");
17
17
  var _mmkvAvailability = require("../utils/mmkvAvailability");
18
18
  var _StorageActionButtons = require("./StorageActionButtons");
19
19
  var _SelectionActionBar = require("./SelectionActionBar");
20
+ var _license = require("@buoy-gg/license");
20
21
  var _jsxRuntime = require("react/jsx-runtime");
21
22
  // Conditionally import MMKV listener
22
23
  let addMMKVListener;
@@ -27,26 +28,6 @@ if ((0, _mmkvAvailability.isMMKVAvailable)()) {
27
28
 
28
29
  // Import shared Game UI components
29
30
 
30
- // Lazy load the license hooks to avoid circular dependencies
31
- let _useIsPro = null;
32
- let _licenseLoadAttempted = false;
33
- function loadLicenseModule() {
34
- if (_licenseLoadAttempted) return;
35
- _licenseLoadAttempted = true;
36
- try {
37
- const mod = require("@buoy-gg/license");
38
- if (mod) {
39
- _useIsPro = mod.useIsPro ?? null;
40
- }
41
- } catch {
42
- // License package not available
43
- }
44
- }
45
- function getUseIsPro() {
46
- loadLicenseModule();
47
- return _useIsPro ?? (() => false);
48
- }
49
-
50
31
  // MMKV Instance color palette - consistent colors per instance
51
32
  const INSTANCE_COLORS = [_sharedUi.macOSColors.semantic.info,
52
33
  // Blue
@@ -81,10 +62,15 @@ function GameUIStorageBrowser({
81
62
  searchQuery = "",
82
63
  storageDataRef
83
64
  }) {
84
- // Check Pro status internally
85
- const useIsPro = getUseIsPro();
86
- const isPro = useIsPro();
65
+ const isPro = (0, _license.useIsPro)();
87
66
  const [showUpgradeModal, setShowUpgradeModal] = (0, _react.useState)(false);
67
+
68
+ // Auto-close upgrade modal when user becomes Pro
69
+ (0, _react.useEffect)(() => {
70
+ if (showUpgradeModal && isPro) {
71
+ setShowUpgradeModal(false);
72
+ }
73
+ }, [showUpgradeModal, isPro]);
88
74
  const [activeFilter, setActiveFilter] = (0, _react.useState)("all");
89
75
  const [activeStorageType, setActiveStorageType] = (0, _react.useState)("all");
90
76
  const [selectedMMKVInstance, setSelectedMMKVInstance] = (0, _react.useState)(null);
@@ -7,28 +7,10 @@ exports.SelectionActionBar = SelectionActionBar;
7
7
  var _react = require("react");
8
8
  var _reactNative = require("react-native");
9
9
  var _sharedUi = require("@buoy-gg/shared-ui");
10
+ var _license = require("@buoy-gg/license");
10
11
  var _asyncStorage = _interopRequireDefault(require("@react-native-async-storage/async-storage"));
11
12
  var _jsxRuntime = require("react/jsx-runtime");
12
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
- // Lazy load the license hooks to avoid circular dependencies
14
- let _useIsPro = null;
15
- let _licenseLoadAttempted = false;
16
- function loadLicenseModule() {
17
- if (_licenseLoadAttempted) return;
18
- _licenseLoadAttempted = true;
19
- try {
20
- const mod = require("@buoy-gg/license");
21
- if (mod) {
22
- _useIsPro = mod.useIsPro ?? null;
23
- }
24
- } catch {
25
- // License package not available
26
- }
27
- }
28
- function getUseIsPro() {
29
- loadLicenseModule();
30
- return _useIsPro ?? (() => false);
31
- }
32
14
  function SelectionActionBar({
33
15
  selectedKeys,
34
16
  mmkvInstances,
@@ -38,10 +20,14 @@ function SelectionActionBar({
38
20
  totalVisibleKeys
39
21
  }) {
40
22
  const [showUpgradeModal, setShowUpgradeModal] = (0, _react.useState)(false);
23
+ const isPro = (0, _license.useIsPro)();
41
24
 
42
- // Check Pro status internally
43
- const useIsPro = getUseIsPro();
44
- const isPro = useIsPro();
25
+ // Auto-close upgrade modal when user becomes Pro
26
+ (0, _react.useEffect)(() => {
27
+ if (showUpgradeModal && isPro) {
28
+ setShowUpgradeModal(false);
29
+ }
30
+ }, [showUpgradeModal, isPro]);
45
31
  const selectedCount = selectedKeys.length;
46
32
  const allSelected = selectedCount === totalVisibleKeys && totalVisibleKeys > 0;
47
33
 
@@ -7,28 +7,10 @@ exports.StorageActionButtons = StorageActionButtons;
7
7
  var _react = require("react");
8
8
  var _reactNative = require("react-native");
9
9
  var _sharedUi = require("@buoy-gg/shared-ui");
10
+ var _license = require("@buoy-gg/license");
10
11
  var _asyncStorage = _interopRequireDefault(require("@react-native-async-storage/async-storage"));
11
12
  var _jsxRuntime = require("react/jsx-runtime");
12
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
- // Lazy load the license hooks to avoid circular dependencies
14
- let _useIsPro = null;
15
- let _licenseLoadAttempted = false;
16
- function loadLicenseModule() {
17
- if (_licenseLoadAttempted) return;
18
- _licenseLoadAttempted = true;
19
- try {
20
- const mod = require("@buoy-gg/license");
21
- if (mod) {
22
- _useIsPro = mod.useIsPro ?? null;
23
- }
24
- } catch {
25
- // License package not available
26
- }
27
- }
28
- function getUseIsPro() {
29
- loadLicenseModule();
30
- return _useIsPro ?? (() => false);
31
- }
32
14
  function StorageActionButtons({
33
15
  copyValue,
34
16
  mmkvInstances = [],
@@ -39,10 +21,14 @@ function StorageActionButtons({
39
21
  selectedCount = 0
40
22
  }) {
41
23
  const [showUpgradeModal, setShowUpgradeModal] = (0, _react.useState)(false);
24
+ const isPro = (0, _license.useIsPro)();
42
25
 
43
- // Check Pro status internally
44
- const useIsPro = getUseIsPro();
45
- const isPro = useIsPro();
26
+ // Auto-close upgrade modal when user becomes Pro
27
+ (0, _react.useEffect)(() => {
28
+ if (showUpgradeModal && isPro) {
29
+ setShowUpgradeModal(false);
30
+ }
31
+ }, [showUpgradeModal, isPro]);
46
32
  const handleClearAsyncStorage = () => {
47
33
  // Gate clear behind Pro
48
34
  if (!isPro) {
@@ -8,26 +8,8 @@ var _reactNative = require("react-native");
8
8
  var _react = require("react");
9
9
  var _clearAllStorage = require("../utils/clearAllStorage");
10
10
  var _sharedUi = require("@buoy-gg/shared-ui");
11
+ var _license = require("@buoy-gg/license");
11
12
  var _jsxRuntime = require("react/jsx-runtime");
12
- // Lazy load the license hooks to avoid circular dependencies
13
- let _useIsPro = null;
14
- let _licenseLoadAttempted = false;
15
- function loadLicenseModule() {
16
- if (_licenseLoadAttempted) return;
17
- _licenseLoadAttempted = true;
18
- try {
19
- const mod = require("@buoy-gg/license");
20
- if (mod) {
21
- _useIsPro = mod.useIsPro ?? null;
22
- }
23
- } catch {
24
- // License package not available
25
- }
26
- }
27
- function getUseIsPro() {
28
- loadLicenseModule();
29
- return _useIsPro ?? (() => false);
30
- }
31
13
  function StorageActions({
32
14
  storageKeys,
33
15
  onClearAll,
@@ -36,10 +18,14 @@ function StorageActions({
36
18
  }) {
37
19
  const [isRefreshing, setIsRefreshing] = (0, _react.useState)(false);
38
20
  const [showUpgradeModal, setShowUpgradeModal] = (0, _react.useState)(false);
21
+ const isPro = (0, _license.useIsPro)();
39
22
 
40
- // Check Pro status internally
41
- const useIsPro = getUseIsPro();
42
- const isPro = useIsPro();
23
+ // Auto-close upgrade modal when user becomes Pro
24
+ (0, _react.useEffect)(() => {
25
+ if (showUpgradeModal && isPro) {
26
+ setShowUpgradeModal(false);
27
+ }
28
+ }, [showUpgradeModal, isPro]);
43
29
  const handleRefresh = (0, _react.useCallback)(async () => {
44
30
  setIsRefreshing(true);
45
31
  try {
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StorageEventActionButton = StorageEventActionButton;
7
+ var _reactNative = require("react-native");
8
+ var _sharedUi = require("@buoy-gg/shared-ui");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ /**
11
+ * StorageEventActionButton
12
+ *
13
+ * Action button for Storage DevTools detail view
14
+ * Matches Redux DevTools ActionButton styling
15
+ */
16
+
17
+ // Button color configurations matching Redux/React Query pattern
18
+ const buttonConfigs = {
19
+ copy: {
20
+ color: _sharedUi.buoyColors.primary,
21
+ backgroundColor: _sharedUi.buoyColors.primary + "15",
22
+ borderColor: _sharedUi.buoyColors.primary + "40",
23
+ textColor: _sharedUi.buoyColors.primary
24
+ },
25
+ jump: {
26
+ color: _sharedUi.buoyColors.warning,
27
+ backgroundColor: _sharedUi.buoyColors.warning + "15",
28
+ borderColor: _sharedUi.buoyColors.warning + "40",
29
+ textColor: _sharedUi.buoyColors.warning
30
+ },
31
+ undo: {
32
+ color: _sharedUi.buoyColors.info,
33
+ backgroundColor: _sharedUi.buoyColors.info + "15",
34
+ borderColor: _sharedUi.buoyColors.info + "40",
35
+ textColor: _sharedUi.buoyColors.info
36
+ }
37
+ };
38
+ function StorageEventActionButton({
39
+ onPress,
40
+ text,
41
+ type,
42
+ disabled = false,
43
+ locked = false
44
+ }) {
45
+ const config = buttonConfigs[type];
46
+ const isDisabledOrLocked = disabled || locked;
47
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
48
+ disabled: isDisabledOrLocked,
49
+ onPress: onPress,
50
+ style: [styles.button, {
51
+ backgroundColor: isDisabledOrLocked ? _sharedUi.buoyColors.textMuted + "1A" : config.backgroundColor,
52
+ borderColor: isDisabledOrLocked ? _sharedUi.buoyColors.textMuted + "33" : config.borderColor,
53
+ opacity: disabled ? 0.5 : 1
54
+ }],
55
+ activeOpacity: 0.7,
56
+ accessibilityRole: "button",
57
+ accessibilityLabel: text,
58
+ accessibilityState: {
59
+ disabled: isDisabledOrLocked
60
+ },
61
+ children: [locked ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Lock, {
62
+ size: 10,
63
+ color: _sharedUi.buoyColors.textMuted,
64
+ style: styles.lockIcon
65
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
66
+ style: [styles.dot, {
67
+ backgroundColor: isDisabledOrLocked ? _sharedUi.buoyColors.textMuted : config.color
68
+ }]
69
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
70
+ style: [styles.text, {
71
+ color: isDisabledOrLocked ? _sharedUi.buoyColors.textMuted : config.textColor
72
+ }],
73
+ children: text
74
+ })]
75
+ });
76
+ }
77
+ const styles = _reactNative.StyleSheet.create({
78
+ button: {
79
+ flexDirection: "row",
80
+ alignItems: "center",
81
+ justifyContent: "center",
82
+ borderRadius: 6,
83
+ borderWidth: 1,
84
+ paddingHorizontal: 12,
85
+ paddingVertical: 6,
86
+ height: 25,
87
+ minWidth: 70,
88
+ shadowOffset: {
89
+ width: 0,
90
+ height: 1
91
+ },
92
+ shadowOpacity: 0.2,
93
+ shadowRadius: 2,
94
+ elevation: 2
95
+ },
96
+ dot: {
97
+ width: 5,
98
+ height: 5,
99
+ borderRadius: 3,
100
+ marginRight: 6,
101
+ shadowColor: _sharedUi.buoyColors.text,
102
+ shadowOffset: {
103
+ width: 0,
104
+ height: 0
105
+ },
106
+ shadowOpacity: 0.6,
107
+ shadowRadius: 2
108
+ },
109
+ lockIcon: {
110
+ marginRight: 4
111
+ },
112
+ text: {
113
+ fontSize: 10,
114
+ fontWeight: "600",
115
+ letterSpacing: 0.5,
116
+ textTransform: "uppercase",
117
+ fontFamily: "monospace",
118
+ height: 12
119
+ }
120
+ });