@buoy-gg/storage 7.0.41 → 7.0.43
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 +6 -10
- 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,207 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SelectionActionBar = SelectionActionBar;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
10
|
-
var _license = require("@buoy-gg/license");
|
|
11
|
-
var _deleteStorageKeys = require("../utils/deleteStorageKeys");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function SelectionActionBar({
|
|
14
|
-
selectedKeys,
|
|
15
|
-
mmkvInstances,
|
|
16
|
-
onDeleteComplete,
|
|
17
|
-
onHideKeys,
|
|
18
|
-
onSelectAll,
|
|
19
|
-
onClearSelection,
|
|
20
|
-
totalVisibleKeys
|
|
21
|
-
}) {
|
|
22
|
-
const [showUpgradeModal, setShowUpgradeModal] = (0, _react.useState)(false);
|
|
23
|
-
const isPro = (0, _license.useIsPro)();
|
|
24
|
-
|
|
25
|
-
// Auto-close upgrade modal when user becomes Pro
|
|
26
|
-
(0, _react.useEffect)(() => {
|
|
27
|
-
if (showUpgradeModal && isPro) {
|
|
28
|
-
setShowUpgradeModal(false);
|
|
29
|
-
}
|
|
30
|
-
}, [showUpgradeModal, isPro]);
|
|
31
|
-
const selectedCount = selectedKeys.length;
|
|
32
|
-
const allSelected = selectedCount === totalVisibleKeys && totalVisibleKeys > 0;
|
|
33
|
-
|
|
34
|
-
// Generate copy data for selected keys
|
|
35
|
-
const getCopyData = () => {
|
|
36
|
-
const data = {};
|
|
37
|
-
selectedKeys.forEach(key => {
|
|
38
|
-
const prefix = key.instanceId ? `[${key.storageType}:${key.instanceId}]` : `[${key.storageType}]`;
|
|
39
|
-
data[`${prefix} ${key.key}`] = key.value;
|
|
40
|
-
});
|
|
41
|
-
return {
|
|
42
|
-
selectedCount,
|
|
43
|
-
keys: data,
|
|
44
|
-
timestamp: new Date().toISOString()
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// Hide selected keys (adds them to the filter store; non-destructive)
|
|
49
|
-
const handleHideSelected = () => {
|
|
50
|
-
if (selectedCount === 0) return;
|
|
51
|
-
onHideKeys?.(selectedKeys);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
// Handle delete selected keys
|
|
55
|
-
const handleDeleteSelected = () => {
|
|
56
|
-
if (selectedCount === 0) return;
|
|
57
|
-
|
|
58
|
-
// Gate delete behind Pro
|
|
59
|
-
if (!isPro) {
|
|
60
|
-
setShowUpgradeModal(true);
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
_reactNative.Alert.alert("Delete Selected Keys", `Delete ${selectedCount} selected key${selectedCount > 1 ? "s" : ""}? This cannot be undone.`, [{
|
|
64
|
-
text: "Cancel",
|
|
65
|
-
style: "cancel"
|
|
66
|
-
}, {
|
|
67
|
-
text: "Delete",
|
|
68
|
-
style: "destructive",
|
|
69
|
-
onPress: async () => {
|
|
70
|
-
try {
|
|
71
|
-
await (0, _deleteStorageKeys.deleteStorageKeys)(selectedKeys, mmkvInstances);
|
|
72
|
-
onDeleteComplete?.();
|
|
73
|
-
} catch (error) {
|
|
74
|
-
_reactNative.Alert.alert("Error", `Failed to delete keys: ${error}`);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}]);
|
|
78
|
-
};
|
|
79
|
-
if (selectedCount === 0) {
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
83
|
-
style: styles.container,
|
|
84
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
85
|
-
style: styles.leftSection,
|
|
86
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
87
|
-
style: styles.selectAllButton,
|
|
88
|
-
onPress: allSelected ? onClearSelection : onSelectAll,
|
|
89
|
-
testID: "buoy-storage-select-all",
|
|
90
|
-
accessibilityLabel: allSelected ? "Deselect all keys" : "Select all keys",
|
|
91
|
-
accessibilityRole: "button",
|
|
92
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.CheckSquare, {
|
|
93
|
-
size: 14,
|
|
94
|
-
color: allSelected ? _sharedUi.night.color.accent : _sharedUi.night.color.textSecondary
|
|
95
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
96
|
-
style: styles.selectAllText,
|
|
97
|
-
children: allSelected ? "Deselect All" : "Select All"
|
|
98
|
-
})]
|
|
99
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
100
|
-
style: styles.countBadge,
|
|
101
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
102
|
-
style: styles.countText,
|
|
103
|
-
children: [selectedCount, " selected"]
|
|
104
|
-
})
|
|
105
|
-
})]
|
|
106
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
107
|
-
style: styles.actionsSection,
|
|
108
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.CopyButton, {
|
|
109
|
-
value: getCopyData(),
|
|
110
|
-
size: 14,
|
|
111
|
-
testID: "buoy-storage-selection-copy",
|
|
112
|
-
buttonStyle: styles.actionButton,
|
|
113
|
-
colors: {
|
|
114
|
-
idle: _sharedUi.night.color.accent,
|
|
115
|
-
success: _sharedUi.macOSColors.semantic.success,
|
|
116
|
-
error: _sharedUi.macOSColors.semantic.error
|
|
117
|
-
}
|
|
118
|
-
}), onHideKeys && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
119
|
-
style: styles.actionButton,
|
|
120
|
-
onPress: handleHideSelected,
|
|
121
|
-
testID: "buoy-storage-selection-hide",
|
|
122
|
-
accessibilityLabel: "Hide selected keys",
|
|
123
|
-
accessibilityRole: "button",
|
|
124
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.EyeOff, {
|
|
125
|
-
size: 14,
|
|
126
|
-
color: _sharedUi.night.color.warning
|
|
127
|
-
})
|
|
128
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
129
|
-
style: styles.actionButton,
|
|
130
|
-
onPress: handleDeleteSelected,
|
|
131
|
-
testID: "buoy-storage-selection-delete",
|
|
132
|
-
accessibilityLabel: "Delete selected keys",
|
|
133
|
-
accessibilityRole: "button",
|
|
134
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Trash2, {
|
|
135
|
-
size: 14,
|
|
136
|
-
color: _sharedUi.night.color.danger
|
|
137
|
-
})
|
|
138
|
-
})]
|
|
139
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ProUpgradeModal, {
|
|
140
|
-
visible: showUpgradeModal,
|
|
141
|
-
onClose: () => setShowUpgradeModal(false),
|
|
142
|
-
featureName: "Storage Editing"
|
|
143
|
-
})]
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
const styles = _reactNative.StyleSheet.create({
|
|
147
|
-
container: {
|
|
148
|
-
flexDirection: "row",
|
|
149
|
-
alignItems: "center",
|
|
150
|
-
justifyContent: "space-between",
|
|
151
|
-
backgroundColor: _sharedUi.night.color.accentSoft,
|
|
152
|
-
borderRadius: 8,
|
|
153
|
-
borderWidth: 1,
|
|
154
|
-
borderColor: _sharedUi.night.color.accentBorderStrong,
|
|
155
|
-
paddingHorizontal: 12,
|
|
156
|
-
paddingVertical: 8,
|
|
157
|
-
marginBottom: 10
|
|
158
|
-
},
|
|
159
|
-
leftSection: {
|
|
160
|
-
flexDirection: "row",
|
|
161
|
-
alignItems: "center",
|
|
162
|
-
gap: 12
|
|
163
|
-
},
|
|
164
|
-
selectAllButton: {
|
|
165
|
-
flexDirection: "row",
|
|
166
|
-
alignItems: "center",
|
|
167
|
-
gap: 6,
|
|
168
|
-
paddingVertical: 4,
|
|
169
|
-
paddingHorizontal: 8,
|
|
170
|
-
backgroundColor: _sharedUi.night.color.surface,
|
|
171
|
-
borderRadius: 6,
|
|
172
|
-
borderWidth: 1,
|
|
173
|
-
borderColor: _sharedUi.night.color.border
|
|
174
|
-
},
|
|
175
|
-
selectAllText: {
|
|
176
|
-
fontSize: 11,
|
|
177
|
-
fontWeight: "600",
|
|
178
|
-
color: _sharedUi.night.color.textSecondary
|
|
179
|
-
},
|
|
180
|
-
countBadge: {
|
|
181
|
-
backgroundColor: _sharedUi.night.color.accentFill,
|
|
182
|
-
paddingHorizontal: 8,
|
|
183
|
-
paddingVertical: 4,
|
|
184
|
-
borderRadius: 6
|
|
185
|
-
},
|
|
186
|
-
countText: {
|
|
187
|
-
fontSize: 11,
|
|
188
|
-
fontWeight: "700",
|
|
189
|
-
color: _sharedUi.night.color.accent,
|
|
190
|
-
fontFamily: _sharedUi.monoFont
|
|
191
|
-
},
|
|
192
|
-
actionsSection: {
|
|
193
|
-
flexDirection: "row",
|
|
194
|
-
alignItems: "center",
|
|
195
|
-
gap: 8
|
|
196
|
-
},
|
|
197
|
-
actionButton: {
|
|
198
|
-
width: 28,
|
|
199
|
-
height: 28,
|
|
200
|
-
alignItems: "center",
|
|
201
|
-
justifyContent: "center",
|
|
202
|
-
borderRadius: 6,
|
|
203
|
-
backgroundColor: _sharedUi.night.color.surface,
|
|
204
|
-
borderWidth: 1,
|
|
205
|
-
borderColor: _sharedUi.night.color.border
|
|
206
|
-
}
|
|
207
|
-
});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SelectionActionBar=SelectionActionBar;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _license=require("@buoy-gg/license");var _deleteStorageKeys=require("../utils/deleteStorageKeys");var _jsxRuntime=require("react/jsx-runtime");function SelectionActionBar({selectedKeys:o,mmkvInstances:d,onDeleteComplete:u,onHideKeys:s,onSelectAll:g,onClearSelection:h,totalVisibleKeys:a}){const[c,n]=(0,_react.useState)(false);const i=(0,_license.useIsPro)();(0,_react.useEffect)(()=>{if(c&&i){n(false)}},[c,i]);const e=o.length;const r=e===a&&a>0;const y=()=>{const l={};o.forEach(t=>{const x=t.instanceId?`[${t.storageType}:${t.instanceId}]`:`[${t.storageType}]`;l[`${x} ${t.key}`]=t.value});return{selectedCount:e,keys:l,timestamp:new Date().toISOString()}};const b=()=>{if(e===0)return;s?.(o)};const f=()=>{if(e===0)return;if(!i){n(true);return}_reactNative.Alert.alert("Delete Selected Keys",`Delete ${e} selected key${e>1?"s":""}? This cannot be undone.`,[{text:"Cancel",style:"cancel"},{text:"Delete",style:"destructive",onPress:async()=>{try{await(0,_deleteStorageKeys.deleteStorageKeys)(o,d);u?.()}catch(l){_reactNative.Alert.alert("Error",`Failed to delete keys: ${l}`)}}}])};if(e===0){return null}return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.container,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.leftSection,children:[(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:styles.selectAllButton,onPress:r?h:g,testID:"buoy-storage-select-all",accessibilityLabel:r?"Deselect all keys":"Select all keys",accessibilityRole:"button",children:[(0,_jsxRuntime.jsx)(_sharedUi.CheckSquare,{size:14,color:r?_sharedUi.night.color.accent:_sharedUi.night.color.textSecondary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.selectAllText,children:r?"Deselect All":"Select All"})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.countBadge,children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.countText,children:[e," selected"]})})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.actionsSection,children:[(0,_jsxRuntime.jsx)(_sharedUi.CopyButton,{value:y(),size:14,testID:"buoy-storage-selection-copy",buttonStyle:styles.actionButton,colors:{idle:_sharedUi.night.color.accent,success:_sharedUi.macOSColors.semantic.success,error:_sharedUi.macOSColors.semantic.error}}),s&&(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.actionButton,onPress:b,testID:"buoy-storage-selection-hide",accessibilityLabel:"Hide selected keys",accessibilityRole:"button",children:(0,_jsxRuntime.jsx)(_sharedUi.EyeOff,{size:14,color:_sharedUi.night.color.warning})}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:styles.actionButton,onPress:f,testID:"buoy-storage-selection-delete",accessibilityLabel:"Delete selected keys",accessibilityRole:"button",children:(0,_jsxRuntime.jsx)(_sharedUi.Trash2,{size:14,color:_sharedUi.night.color.danger})})]}),(0,_jsxRuntime.jsx)(_sharedUi.ProUpgradeModal,{visible:c,onClose:()=>n(false),featureName:"Storage Editing"})]})}const styles=_reactNative.StyleSheet.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:_sharedUi.night.color.accentSoft,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.accentBorderStrong,paddingHorizontal:12,paddingVertical:8,marginBottom:10},leftSection:{flexDirection:"row",alignItems:"center",gap:12},selectAllButton:{flexDirection:"row",alignItems:"center",gap:6,paddingVertical:4,paddingHorizontal:8,backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.border},selectAllText:{fontSize:11,fontWeight:"600",color:_sharedUi.night.color.textSecondary},countBadge:{backgroundColor:_sharedUi.night.color.accentFill,paddingHorizontal:8,paddingVertical:4,borderRadius:6},countText:{fontSize:11,fontWeight:"700",color:_sharedUi.night.color.accent,fontFamily:_sharedUi.monoFont},actionsSection:{flexDirection:"row",alignItems:"center",gap:8},actionButton:{width:28,height:28,alignItems:"center",justifyContent:"center",borderRadius:6,backgroundColor:_sharedUi.night.color.surface,borderWidth:1,borderColor:_sharedUi.night.color.border}});
|
|
@@ -1,242 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.StorageActionButtons = StorageActionButtons;
|
|
7
|
-
var _storageLabels = require("../utils/storageLabels");
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _reactNative = require("react-native");
|
|
10
|
-
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
11
|
-
var _license = require("@buoy-gg/license");
|
|
12
|
-
var _asyncStorage = _interopRequireDefault(require("@react-native-async-storage/async-storage"));
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
-
function StorageActionButtons({
|
|
16
|
-
copyValue,
|
|
17
|
-
mmkvInstances = [],
|
|
18
|
-
activeStorageType = "all",
|
|
19
|
-
onClearComplete,
|
|
20
|
-
isSelectMode = false,
|
|
21
|
-
onToggleSelectMode,
|
|
22
|
-
selectedCount = 0
|
|
23
|
-
}) {
|
|
24
|
-
const [showUpgradeModal, setShowUpgradeModal] = (0, _react.useState)(false);
|
|
25
|
-
const isPro = (0, _license.useIsPro)();
|
|
26
|
-
|
|
27
|
-
// Auto-close upgrade modal when user becomes Pro
|
|
28
|
-
(0, _react.useEffect)(() => {
|
|
29
|
-
if (showUpgradeModal && isPro) {
|
|
30
|
-
setShowUpgradeModal(false);
|
|
31
|
-
}
|
|
32
|
-
}, [showUpgradeModal, isPro]);
|
|
33
|
-
const handleClearAsyncStorage = () => {
|
|
34
|
-
// Gate clear behind Pro
|
|
35
|
-
if (!isPro) {
|
|
36
|
-
setShowUpgradeModal(true);
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
_reactNative.Alert.alert(`Clear ${_storageLabels.storageLabels.asyncFull}`, `Delete all ${_storageLabels.storageLabels.asyncFull} keys? This cannot be undone.`, [{
|
|
40
|
-
text: "Cancel",
|
|
41
|
-
style: "cancel"
|
|
42
|
-
}, {
|
|
43
|
-
text: "Clear",
|
|
44
|
-
style: "destructive",
|
|
45
|
-
onPress: async () => {
|
|
46
|
-
try {
|
|
47
|
-
await _asyncStorage.default.clear();
|
|
48
|
-
onClearComplete?.();
|
|
49
|
-
} catch (error) {
|
|
50
|
-
_reactNative.Alert.alert("Error", `Failed: ${error}`);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}]);
|
|
54
|
-
};
|
|
55
|
-
const handleClearMMKV = (instanceId, instanceName) => {
|
|
56
|
-
// Gate clear behind Pro
|
|
57
|
-
if (!isPro) {
|
|
58
|
-
setShowUpgradeModal(true);
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
_reactNative.Alert.alert(`Clear ${instanceName}`, `Delete all keys from ${instanceName}? This cannot be undone.`, [{
|
|
62
|
-
text: "Cancel",
|
|
63
|
-
style: "cancel"
|
|
64
|
-
}, {
|
|
65
|
-
text: "Clear",
|
|
66
|
-
style: "destructive",
|
|
67
|
-
onPress: () => {
|
|
68
|
-
try {
|
|
69
|
-
const inst = mmkvInstances.find(i => i.id === instanceId);
|
|
70
|
-
if (inst) {
|
|
71
|
-
inst.instance.clearAll();
|
|
72
|
-
onClearComplete?.();
|
|
73
|
-
}
|
|
74
|
-
} catch (error) {
|
|
75
|
-
_reactNative.Alert.alert("Error", `Failed: ${error}`);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}]);
|
|
79
|
-
};
|
|
80
|
-
const handleClearAllMMKV = () => {
|
|
81
|
-
// Gate clear behind Pro
|
|
82
|
-
if (!isPro) {
|
|
83
|
-
setShowUpgradeModal(true);
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
_reactNative.Alert.alert(`Clear All ${_storageLabels.storageLabels.mmkv}`, `Delete all keys from ${mmkvInstances.length} instances? This cannot be undone.`, [{
|
|
87
|
-
text: "Cancel",
|
|
88
|
-
style: "cancel"
|
|
89
|
-
}, {
|
|
90
|
-
text: "Clear All",
|
|
91
|
-
style: "destructive",
|
|
92
|
-
onPress: () => {
|
|
93
|
-
try {
|
|
94
|
-
mmkvInstances.forEach(inst => inst.instance.clearAll());
|
|
95
|
-
onClearComplete?.();
|
|
96
|
-
} catch (error) {
|
|
97
|
-
_reactNative.Alert.alert("Error", `Failed: ${error}`);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}]);
|
|
101
|
-
};
|
|
102
|
-
const handleClearAll = () => {
|
|
103
|
-
// Gate clear behind Pro
|
|
104
|
-
if (!isPro) {
|
|
105
|
-
setShowUpgradeModal(true);
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
_reactNative.Alert.alert("Clear All Storage", "Delete all storage data? This cannot be undone.", [{
|
|
109
|
-
text: "Cancel",
|
|
110
|
-
style: "cancel"
|
|
111
|
-
}, {
|
|
112
|
-
text: "Clear All",
|
|
113
|
-
style: "destructive",
|
|
114
|
-
onPress: async () => {
|
|
115
|
-
try {
|
|
116
|
-
await _asyncStorage.default.clear();
|
|
117
|
-
mmkvInstances.forEach(inst => inst.instance.clearAll());
|
|
118
|
-
onClearComplete?.();
|
|
119
|
-
} catch (error) {
|
|
120
|
-
_reactNative.Alert.alert("Error", `Failed: ${error}`);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}]);
|
|
124
|
-
};
|
|
125
|
-
const showAsyncActions = activeStorageType === "all" || activeStorageType === "async";
|
|
126
|
-
const showMMKVActions = activeStorageType === "all" || activeStorageType === "mmkv";
|
|
127
|
-
|
|
128
|
-
// Determine which clear actions to show based on active filter
|
|
129
|
-
const showClearAll = activeStorageType === "all";
|
|
130
|
-
const showClearAsync = showAsyncActions && !showClearAll;
|
|
131
|
-
const showClearMMKVIndividual = showMMKVActions && !showClearAll;
|
|
132
|
-
const showClearAllMMKV = showMMKVActions && mmkvInstances.length > 1 && !showClearAll;
|
|
133
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
134
|
-
style: styles.container,
|
|
135
|
-
children: [onToggleSelectMode && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
136
|
-
onPress: onToggleSelectMode,
|
|
137
|
-
testID: "buoy-storage-select-mode",
|
|
138
|
-
accessibilityLabel: isSelectMode ? "Exit selection mode" : "Select keys",
|
|
139
|
-
accessibilityRole: "button",
|
|
140
|
-
style: [styles.actionButton, isSelectMode && styles.actionButtonActive],
|
|
141
|
-
children: isSelectMode ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
142
|
-
style: styles.selectModeActiveContainer,
|
|
143
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.X, {
|
|
144
|
-
size: 14,
|
|
145
|
-
color: _sharedUi.night.color.accent
|
|
146
|
-
}), selectedCount > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
147
|
-
style: styles.selectedCountText,
|
|
148
|
-
children: selectedCount
|
|
149
|
-
})]
|
|
150
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.SquareDashed, {
|
|
151
|
-
size: 16,
|
|
152
|
-
color: _sharedUi.night.color.textSecondary
|
|
153
|
-
})
|
|
154
|
-
}), !isSelectMode && /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.CopyButton, {
|
|
155
|
-
value: copyValue,
|
|
156
|
-
size: 16,
|
|
157
|
-
testID: "buoy-storage-export-copy",
|
|
158
|
-
buttonStyle: styles.actionButton,
|
|
159
|
-
colors: {
|
|
160
|
-
idle: _sharedUi.night.color.textSecondary,
|
|
161
|
-
success: _sharedUi.macOSColors.semantic.success,
|
|
162
|
-
error: _sharedUi.macOSColors.semantic.error
|
|
163
|
-
}
|
|
164
|
-
}), !isSelectMode && showClearAll && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
165
|
-
onPress: handleClearAll,
|
|
166
|
-
testID: "buoy-storage-clear-all",
|
|
167
|
-
accessibilityLabel: "Clear all storage",
|
|
168
|
-
accessibilityRole: "button",
|
|
169
|
-
style: styles.actionButton,
|
|
170
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Trash2, {
|
|
171
|
-
size: 16,
|
|
172
|
-
color: _sharedUi.night.color.danger
|
|
173
|
-
})
|
|
174
|
-
}), !isSelectMode && showClearAsync && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
175
|
-
onPress: handleClearAsyncStorage,
|
|
176
|
-
testID: "buoy-storage-clear-async",
|
|
177
|
-
accessibilityLabel: `Clear ${_storageLabels.storageLabels.asyncFull}`,
|
|
178
|
-
accessibilityRole: "button",
|
|
179
|
-
style: styles.actionButton,
|
|
180
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Trash2, {
|
|
181
|
-
size: 16,
|
|
182
|
-
color: _sharedUi.night.color.danger
|
|
183
|
-
})
|
|
184
|
-
}), !isSelectMode && showClearAllMMKV && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
185
|
-
onPress: handleClearAllMMKV,
|
|
186
|
-
testID: "buoy-storage-clear-mmkv-all",
|
|
187
|
-
accessibilityLabel: `Clear all ${_storageLabels.storageLabels.mmkv} instances`,
|
|
188
|
-
accessibilityRole: "button",
|
|
189
|
-
style: styles.actionButton,
|
|
190
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Trash2, {
|
|
191
|
-
size: 16,
|
|
192
|
-
color: _sharedUi.night.color.danger
|
|
193
|
-
})
|
|
194
|
-
}), !isSelectMode && showClearMMKVIndividual && mmkvInstances.length === 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
195
|
-
onPress: () => handleClearMMKV(mmkvInstances[0].id, mmkvInstances[0].id),
|
|
196
|
-
testID: "buoy-storage-clear-mmkv",
|
|
197
|
-
accessibilityLabel: `Clear ${_storageLabels.storageLabels.mmkv} instance`,
|
|
198
|
-
accessibilityRole: "button",
|
|
199
|
-
style: styles.actionButton,
|
|
200
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Trash2, {
|
|
201
|
-
size: 16,
|
|
202
|
-
color: _sharedUi.night.color.danger
|
|
203
|
-
})
|
|
204
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ProUpgradeModal, {
|
|
205
|
-
visible: showUpgradeModal,
|
|
206
|
-
onClose: () => setShowUpgradeModal(false),
|
|
207
|
-
featureName: "Storage Editing"
|
|
208
|
-
})]
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
const styles = _reactNative.StyleSheet.create({
|
|
212
|
-
container: {
|
|
213
|
-
flexDirection: "row",
|
|
214
|
-
alignItems: "center",
|
|
215
|
-
gap: 8
|
|
216
|
-
},
|
|
217
|
-
actionButton: {
|
|
218
|
-
width: 32,
|
|
219
|
-
height: 32,
|
|
220
|
-
alignItems: "center",
|
|
221
|
-
justifyContent: "center",
|
|
222
|
-
borderRadius: 6,
|
|
223
|
-
backgroundColor: _sharedUi.night.color.buttonSurface,
|
|
224
|
-
borderWidth: 1,
|
|
225
|
-
borderColor: _sharedUi.night.color.border
|
|
226
|
-
},
|
|
227
|
-
actionButtonActive: {
|
|
228
|
-
backgroundColor: _sharedUi.night.color.accentSoft,
|
|
229
|
-
borderColor: _sharedUi.night.color.accentBorderStrong
|
|
230
|
-
},
|
|
231
|
-
selectModeActiveContainer: {
|
|
232
|
-
flexDirection: "row",
|
|
233
|
-
alignItems: "center",
|
|
234
|
-
gap: 2
|
|
235
|
-
},
|
|
236
|
-
selectedCountText: {
|
|
237
|
-
fontSize: 10,
|
|
238
|
-
fontWeight: "700",
|
|
239
|
-
color: _sharedUi.night.color.accent,
|
|
240
|
-
fontFamily: _sharedUi.monoFont
|
|
241
|
-
}
|
|
242
|
-
});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.StorageActionButtons=StorageActionButtons;var _storageLabels=require("../utils/storageLabels");var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _license=require("@buoy-gg/license");var _asyncStorage=_interopRequireDefault(require("@react-native-async-storage/async-storage"));var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(l){return l&&l.__esModule?l:{default:l}}function StorageActionButtons({copyValue:l,mmkvInstances:t=[],activeStorageType:s="all",onClearComplete:c,isSelectMode:r=false,onToggleSelectMode:y,selectedCount:h=0}){const[u,a]=(0,_react.useState)(false);const o=(0,_license.useIsPro)();(0,_react.useEffect)(()=>{if(u&&o){a(false)}},[u,o]);const g=()=>{if(!o){a(true);return}_reactNative.Alert.alert(`Clear ${_storageLabels.storageLabels.asyncFull}`,`Delete all ${_storageLabels.storageLabels.asyncFull} keys? This cannot be undone.`,[{text:"Cancel",style:"cancel"},{text:"Clear",style:"destructive",onPress:async()=>{try{await _asyncStorage.default.clear();c?.()}catch(e){_reactNative.Alert.alert("Error",`Failed: ${e}`)}}}])};const x=(e,b)=>{if(!o){a(true);return}_reactNative.Alert.alert(`Clear ${b}`,`Delete all keys from ${b}? This cannot be undone.`,[{text:"Cancel",style:"cancel"},{text:"Clear",style:"destructive",onPress:()=>{try{const i=t.find(D=>D.id===e);if(i){i.instance.clearAll();c?.()}}catch(i){_reactNative.Alert.alert("Error",`Failed: ${i}`)}}}])};const f=()=>{if(!o){a(true);return}_reactNative.Alert.alert(`Clear All ${_storageLabels.storageLabels.mmkv}`,`Delete all keys from ${t.length} instances? This cannot be undone.`,[{text:"Cancel",style:"cancel"},{text:"Clear All",style:"destructive",onPress:()=>{try{t.forEach(e=>e.instance.clearAll());c?.()}catch(e){_reactNative.Alert.alert("Error",`Failed: ${e}`)}}}])};const A=()=>{if(!o){a(true);return}_reactNative.Alert.alert("Clear All Storage","Delete all storage data? This cannot be undone.",[{text:"Cancel",style:"cancel"},{text:"Clear All",style:"destructive",onPress:async()=>{try{await _asyncStorage.default.clear();t.forEach(e=>e.instance.clearAll());c?.()}catch(e){_reactNative.Alert.alert("Error",`Failed: ${e}`)}}}])};const C=s==="all"||s==="async";const d=s==="all"||s==="mmkv";const n=s==="all";const j=C&&!n;const v=d&&!n;const w=d&&t.length>1&&!n;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.container,children:[y&&(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:y,testID:"buoy-storage-select-mode",accessibilityLabel:r?"Exit selection mode":"Select keys",accessibilityRole:"button",style:[styles.actionButton,r&&styles.actionButtonActive],children:r?(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.selectModeActiveContainer,children:[(0,_jsxRuntime.jsx)(_sharedUi.X,{size:14,color:_sharedUi.night.color.accent}),h>0&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.selectedCountText,children:h})]}):(0,_jsxRuntime.jsx)(_sharedUi.SquareDashed,{size:16,color:_sharedUi.night.color.textSecondary})}),!r&&(0,_jsxRuntime.jsx)(_sharedUi.CopyButton,{value:l,size:16,testID:"buoy-storage-export-copy",buttonStyle:styles.actionButton,colors:{idle:_sharedUi.night.color.textSecondary,success:_sharedUi.macOSColors.semantic.success,error:_sharedUi.macOSColors.semantic.error}}),!r&&n&&(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:A,testID:"buoy-storage-clear-all",accessibilityLabel:"Clear all storage",accessibilityRole:"button",style:styles.actionButton,children:(0,_jsxRuntime.jsx)(_sharedUi.Trash2,{size:16,color:_sharedUi.night.color.danger})}),!r&&j&&(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:g,testID:"buoy-storage-clear-async",accessibilityLabel:`Clear ${_storageLabels.storageLabels.asyncFull}`,accessibilityRole:"button",style:styles.actionButton,children:(0,_jsxRuntime.jsx)(_sharedUi.Trash2,{size:16,color:_sharedUi.night.color.danger})}),!r&&w&&(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:f,testID:"buoy-storage-clear-mmkv-all",accessibilityLabel:`Clear all ${_storageLabels.storageLabels.mmkv} instances`,accessibilityRole:"button",style:styles.actionButton,children:(0,_jsxRuntime.jsx)(_sharedUi.Trash2,{size:16,color:_sharedUi.night.color.danger})}),!r&&v&&t.length===1&&(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:()=>x(t[0].id,t[0].id),testID:"buoy-storage-clear-mmkv",accessibilityLabel:`Clear ${_storageLabels.storageLabels.mmkv} instance`,accessibilityRole:"button",style:styles.actionButton,children:(0,_jsxRuntime.jsx)(_sharedUi.Trash2,{size:16,color:_sharedUi.night.color.danger})}),(0,_jsxRuntime.jsx)(_sharedUi.ProUpgradeModal,{visible:u,onClose:()=>a(false),featureName:"Storage Editing"})]})}const styles=_reactNative.StyleSheet.create({container:{flexDirection:"row",alignItems:"center",gap:8},actionButton:{width:32,height:32,alignItems:"center",justifyContent:"center",borderRadius:6,backgroundColor:_sharedUi.night.color.buttonSurface,borderWidth:1,borderColor:_sharedUi.night.color.border},actionButtonActive:{backgroundColor:_sharedUi.night.color.accentSoft,borderColor:_sharedUi.night.color.accentBorderStrong},selectModeActiveContainer:{flexDirection:"row",alignItems:"center",gap:2},selectedCountText:{fontSize:10,fontWeight:"700",color:_sharedUi.night.color.accent,fontFamily:_sharedUi.monoFont}});
|
|
@@ -1,61 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.StorageBrowserMode = StorageBrowserMode;
|
|
7
|
-
var _GameUIStorageBrowser = require("./GameUIStorageBrowser");
|
|
8
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
-
/**
|
|
10
|
-
* Storage browser mode component
|
|
11
|
-
* Displays storage keys with game UI styled interface
|
|
12
|
-
*/
|
|
13
|
-
function StorageBrowserMode({
|
|
14
|
-
requiredStorageKeys = [],
|
|
15
|
-
showFilters = false,
|
|
16
|
-
ignoredPatterns = new Set(),
|
|
17
|
-
onTogglePattern,
|
|
18
|
-
onAddPattern,
|
|
19
|
-
searchQuery = "",
|
|
20
|
-
storageDataRef,
|
|
21
|
-
eventCountByKey,
|
|
22
|
-
lastWriteByKey,
|
|
23
|
-
onViewHistory,
|
|
24
|
-
enabledStorageTypes,
|
|
25
|
-
statusFilter,
|
|
26
|
-
onStatusFilterChange,
|
|
27
|
-
onStatusCountsChange,
|
|
28
|
-
pinnedKeys,
|
|
29
|
-
onTogglePin,
|
|
30
|
-
applySafeAreaInset,
|
|
31
|
-
storageTypeFilter,
|
|
32
|
-
onStorageTypeFilterChange,
|
|
33
|
-
detailKey,
|
|
34
|
-
onOpenKey,
|
|
35
|
-
onCloseDetail
|
|
36
|
-
}) {
|
|
37
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GameUIStorageBrowser.GameUIStorageBrowser, {
|
|
38
|
-
requiredStorageKeys: requiredStorageKeys,
|
|
39
|
-
showFilters: showFilters,
|
|
40
|
-
ignoredPatterns: ignoredPatterns,
|
|
41
|
-
onTogglePattern: onTogglePattern,
|
|
42
|
-
onAddPattern: onAddPattern,
|
|
43
|
-
searchQuery: searchQuery,
|
|
44
|
-
storageDataRef: storageDataRef,
|
|
45
|
-
eventCountByKey: eventCountByKey,
|
|
46
|
-
lastWriteByKey: lastWriteByKey,
|
|
47
|
-
onViewHistory: onViewHistory,
|
|
48
|
-
enabledStorageTypes: enabledStorageTypes,
|
|
49
|
-
statusFilter: statusFilter,
|
|
50
|
-
onStatusFilterChange: onStatusFilterChange,
|
|
51
|
-
onStatusCountsChange: onStatusCountsChange,
|
|
52
|
-
pinnedKeys: pinnedKeys,
|
|
53
|
-
onTogglePin: onTogglePin,
|
|
54
|
-
applySafeAreaInset: applySafeAreaInset,
|
|
55
|
-
storageTypeFilter: storageTypeFilter,
|
|
56
|
-
onStorageTypeFilterChange: onStorageTypeFilterChange,
|
|
57
|
-
detailKey: detailKey,
|
|
58
|
-
onOpenKey: onOpenKey,
|
|
59
|
-
onCloseDetail: onCloseDetail
|
|
60
|
-
});
|
|
61
|
-
}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.StorageBrowserMode=StorageBrowserMode;var _GameUIStorageBrowser=require("./GameUIStorageBrowser");var _jsxRuntime=require("react/jsx-runtime");function StorageBrowserMode({requiredStorageKeys:e=[],showFilters:r=false,ignoredPatterns:t=new Set,onTogglePattern:o,onAddPattern:a,searchQuery:n="",storageDataRef:s,eventCountByKey:i,lastWriteByKey:g,onViewHistory:u,enabledStorageTypes:l,statusFilter:y,onStatusFilterChange:S,onStatusCountsChange:d,pinnedKeys:p,onTogglePin:w,applySafeAreaInset:B,storageTypeFilter:C,onStorageTypeFilterChange:K,detailKey:c,onOpenKey:f,onCloseDetail:h}){return(0,_jsxRuntime.jsx)(_GameUIStorageBrowser.GameUIStorageBrowser,{requiredStorageKeys:e,showFilters:r,ignoredPatterns:t,onTogglePattern:o,onAddPattern:a,searchQuery:n,storageDataRef:s,eventCountByKey:i,lastWriteByKey:g,onViewHistory:u,enabledStorageTypes:l,statusFilter:y,onStatusFilterChange:S,onStatusCountsChange:d,pinnedKeys:p,onTogglePin:w,applySafeAreaInset:B,storageTypeFilter:C,onStorageTypeFilterChange:K,detailKey:c,onOpenKey:f,onCloseDetail:h})}
|
|
@@ -1,121 +1 @@
|
|
|
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.night.color.accent,
|
|
21
|
-
backgroundColor: _sharedUi.night.color.accentSoft,
|
|
22
|
-
borderColor: _sharedUi.night.color.accentBorderStrong,
|
|
23
|
-
textColor: _sharedUi.night.color.accent
|
|
24
|
-
},
|
|
25
|
-
jump: {
|
|
26
|
-
color: _sharedUi.night.color.warning,
|
|
27
|
-
backgroundColor: _sharedUi.night.color.warningSoft,
|
|
28
|
-
borderColor: _sharedUi.night.color.warning + "40",
|
|
29
|
-
textColor: _sharedUi.night.color.warning
|
|
30
|
-
},
|
|
31
|
-
undo: {
|
|
32
|
-
color: _sharedUi.night.color.info,
|
|
33
|
-
backgroundColor: _sharedUi.night.color.infoSoft,
|
|
34
|
-
borderColor: _sharedUi.night.color.info + "40",
|
|
35
|
-
textColor: _sharedUi.night.color.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.night.color.fill : config.backgroundColor,
|
|
52
|
-
borderColor: isDisabledOrLocked ? _sharedUi.night.color.fillTertiary : config.borderColor,
|
|
53
|
-
opacity: disabled ? 0.5 : 1
|
|
54
|
-
}],
|
|
55
|
-
activeOpacity: 0.7,
|
|
56
|
-
testID: `buoy-storage-action-${type}`,
|
|
57
|
-
accessibilityRole: "button",
|
|
58
|
-
accessibilityLabel: text,
|
|
59
|
-
accessibilityState: {
|
|
60
|
-
disabled: isDisabledOrLocked
|
|
61
|
-
},
|
|
62
|
-
children: [locked ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Lock, {
|
|
63
|
-
size: 10,
|
|
64
|
-
color: _sharedUi.night.color.textTertiary,
|
|
65
|
-
style: styles.lockIcon
|
|
66
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
67
|
-
style: [styles.dot, {
|
|
68
|
-
backgroundColor: isDisabledOrLocked ? _sharedUi.night.color.textTertiary : config.color
|
|
69
|
-
}]
|
|
70
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
71
|
-
style: [styles.text, {
|
|
72
|
-
color: isDisabledOrLocked ? _sharedUi.night.color.textTertiary : config.textColor
|
|
73
|
-
}],
|
|
74
|
-
children: text
|
|
75
|
-
})]
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
const styles = _reactNative.StyleSheet.create({
|
|
79
|
-
button: {
|
|
80
|
-
flexDirection: "row",
|
|
81
|
-
alignItems: "center",
|
|
82
|
-
justifyContent: "center",
|
|
83
|
-
borderRadius: 6,
|
|
84
|
-
borderWidth: 1,
|
|
85
|
-
paddingHorizontal: 12,
|
|
86
|
-
paddingVertical: 6,
|
|
87
|
-
height: 25,
|
|
88
|
-
minWidth: 70,
|
|
89
|
-
shadowOffset: {
|
|
90
|
-
width: 0,
|
|
91
|
-
height: 1
|
|
92
|
-
},
|
|
93
|
-
shadowOpacity: 0.2,
|
|
94
|
-
shadowRadius: 2,
|
|
95
|
-
elevation: 2
|
|
96
|
-
},
|
|
97
|
-
dot: {
|
|
98
|
-
width: 5,
|
|
99
|
-
height: 5,
|
|
100
|
-
borderRadius: 3,
|
|
101
|
-
marginRight: 6,
|
|
102
|
-
shadowColor: _sharedUi.night.color.text,
|
|
103
|
-
shadowOffset: {
|
|
104
|
-
width: 0,
|
|
105
|
-
height: 0
|
|
106
|
-
},
|
|
107
|
-
shadowOpacity: 0.6,
|
|
108
|
-
shadowRadius: 2
|
|
109
|
-
},
|
|
110
|
-
lockIcon: {
|
|
111
|
-
marginRight: 4
|
|
112
|
-
},
|
|
113
|
-
text: {
|
|
114
|
-
fontSize: 10,
|
|
115
|
-
fontWeight: "600",
|
|
116
|
-
letterSpacing: 0.5,
|
|
117
|
-
textTransform: "uppercase",
|
|
118
|
-
fontFamily: _sharedUi.monoFont,
|
|
119
|
-
height: 12
|
|
120
|
-
}
|
|
121
|
-
});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.StorageEventActionButton=StorageEventActionButton;var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _jsxRuntime=require("react/jsx-runtime");const buttonConfigs={copy:{color:_sharedUi.night.color.accent,backgroundColor:_sharedUi.night.color.accentSoft,borderColor:_sharedUi.night.color.accentBorderStrong,textColor:_sharedUi.night.color.accent},jump:{color:_sharedUi.night.color.warning,backgroundColor:_sharedUi.night.color.warningSoft,borderColor:_sharedUi.night.color.warning+"40",textColor:_sharedUi.night.color.warning},undo:{color:_sharedUi.night.color.info,backgroundColor:_sharedUi.night.color.infoSoft,borderColor:_sharedUi.night.color.info+"40",textColor:_sharedUi.night.color.info}};function StorageEventActionButton({onPress:c,text:r,type:e,disabled:i=false,locked:n=false}){const t=buttonConfigs[e];const o=i||n;return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{disabled:o,onPress:c,style:[styles.button,{backgroundColor:o?_sharedUi.night.color.fill:t.backgroundColor,borderColor:o?_sharedUi.night.color.fillTertiary:t.borderColor,opacity:i?.5:1}],activeOpacity:.7,testID:`buoy-storage-action-${e}`,accessibilityRole:"button",accessibilityLabel:r,accessibilityState:{disabled:o},children:[n?(0,_jsxRuntime.jsx)(_sharedUi.Lock,{size:10,color:_sharedUi.night.color.textTertiary,style:styles.lockIcon}):(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.dot,{backgroundColor:o?_sharedUi.night.color.textTertiary:t.color}]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.text,{color:o?_sharedUi.night.color.textTertiary:t.textColor}],children:r})]})}const styles=_reactNative.StyleSheet.create({button:{flexDirection:"row",alignItems:"center",justifyContent:"center",borderRadius:6,borderWidth:1,paddingHorizontal:12,paddingVertical:6,height:25,minWidth:70,shadowOffset:{width:0,height:1},shadowOpacity:.2,shadowRadius:2,elevation:2},dot:{width:5,height:5,borderRadius:3,marginRight:6,shadowColor:_sharedUi.night.color.text,shadowOffset:{width:0,height:0},shadowOpacity:.6,shadowRadius:2},lockIcon:{marginRight:4},text:{fontSize:10,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont,height:12}});
|