@buoy-gg/storage 7.0.40 → 7.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -86
- package/lib/commonjs/index.js +1 -346
- package/lib/commonjs/preset.js +1 -80
- 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 -1258
- package/lib/commonjs/storage/components/MMKVInstanceInfoPanel.js +1 -257
- package/lib/commonjs/storage/components/MMKVInstanceSelector.js +1 -418
- package/lib/commonjs/storage/components/SelectionActionBar.js +1 -207
- package/lib/commonjs/storage/components/StorageActionButtons.js +1 -241
- 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 -117
- package/lib/commonjs/storage/components/StorageEventDetailContent.js +1 -494
- package/lib/commonjs/storage/components/StorageEventFilterView.js +1 -159
- 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 -344
- 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 -143
- 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 -159
- 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 -478
- 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 -0
- 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 -0
- package/lib/commonjs/storage/utils/browserStorageLifecycle.web.js +1 -0
- 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 -0
- 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 -0
- package/lib/commonjs/storage/utils/storageLabels.web.js +1 -0
- 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 -112
- package/lib/module/preset.js +1 -76
- 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 -1256
- package/lib/module/storage/components/MMKVInstanceInfoPanel.js +1 -253
- package/lib/module/storage/components/MMKVInstanceSelector.js +1 -414
- package/lib/module/storage/components/SelectionActionBar.js +1 -204
- package/lib/module/storage/components/StorageActionButtons.js +1 -237
- 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 -112
- package/lib/module/storage/components/StorageEventDetailContent.js +1 -490
- package/lib/module/storage/components/StorageEventFilterView.js +1 -155
- 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 -341
- 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 -138
- 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 -156
- 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 -474
- 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 -0
- 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 -0
- package/lib/module/storage/utils/browserStorageLifecycle.web.js +1 -0
- 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 -0
- 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 -0
- package/lib/module/storage/utils/storageLabels.web.js +1 -0
- 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/typescript/index.d.ts +1 -0
- package/lib/typescript/storage/components/MMKVInstanceSelector.d.ts +0 -8
- package/lib/typescript/storage/components/StorageEventCard.d.ts +0 -7
- package/lib/typescript/storage/components/StorageKeyRow.d.ts +2 -6
- package/lib/typescript/storage/components/StorageTypeFilterBar.d.ts +0 -15
- package/lib/typescript/storage/hooks/useSecureStoreKeys.d.ts +2 -2
- package/lib/typescript/storage/sync/storageSyncAdapter.d.ts +7 -13
- package/lib/typescript/storage/utils/AsyncStorageListener.web.d.ts +24 -0
- package/lib/typescript/storage/utils/browserStorageLifecycle.d.ts +3 -0
- package/lib/typescript/storage/utils/browserStorageLifecycle.web.d.ts +2 -0
- package/lib/typescript/storage/utils/mmkvAvailability.web.d.ts +4 -0
- package/lib/typescript/storage/utils/storageLabels.d.ts +8 -0
- package/lib/typescript/storage/utils/storageLabels.web.d.ts +8 -0
- package/lib/web/index.mjs +4 -0
- package/package.json +40 -14
- package/lib/commonjs/storage/components/DiffViewer/DiffOptionsPanel.js +0 -356
- package/lib/commonjs/storage/components/DiffViewer/components/DiffSummary.js +0 -122
- package/lib/commonjs/storage/components/StorageKeyEditorScreen.js +0 -414
- package/lib/commonjs/storage/components/StorageScalarKeyEditor.js +0 -61
- package/lib/commonjs/storage/components/StorageValueEditModal.js +0 -24
- package/lib/commonjs/storage/hooks/useKeyEditor.js +0 -31
- package/lib/commonjs/storage/hooks/useTreeDraft.js +0 -25
- package/lib/module/storage/components/DiffViewer/DiffOptionsPanel.js +0 -352
- package/lib/module/storage/components/DiffViewer/components/DiffSummary.js +0 -118
- package/lib/module/storage/components/StorageKeyEditorScreen.js +0 -410
- package/lib/module/storage/components/StorageScalarKeyEditor.js +0 -57
- package/lib/module/storage/components/StorageValueEditModal.js +0 -20
- package/lib/module/storage/hooks/useKeyEditor.js +0 -27
- package/lib/module/storage/hooks/useTreeDraft.js +0 -21
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/preset.d.ts.map +0 -1
- package/lib/typescript/storage/components/DiffViewer/DiffOptionsPanel.d.ts +0 -18
- package/lib/typescript/storage/components/DiffViewer/DiffOptionsPanel.d.ts.map +0 -1
- package/lib/typescript/storage/components/DiffViewer/TreeDiffViewer.d.ts.map +0 -1
- package/lib/typescript/storage/components/DiffViewer/components/DiffSummary.d.ts +0 -12
- package/lib/typescript/storage/components/DiffViewer/components/DiffSummary.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/StorageKeyEditorScreen.d.ts +0 -42
- package/lib/typescript/storage/components/StorageKeyEditorScreen.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/StorageScalarKeyEditor.d.ts +0 -24
- package/lib/typescript/storage/components/StorageScalarKeyEditor.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/components/StorageValueEditModal.d.ts +0 -14
- package/lib/typescript/storage/components/StorageValueEditModal.d.ts.map +0 -1
- package/lib/typescript/storage/hooks/useAsyncStorageKeys.d.ts.map +0 -1
- package/lib/typescript/storage/hooks/useKeyEditor.d.ts +0 -27
- package/lib/typescript/storage/hooks/useKeyEditor.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/hooks/useTreeDraft.d.ts +0 -16
- package/lib/typescript/storage/hooks/useTreeDraft.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/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/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/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/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,204 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { useState, useEffect } from "react";
|
|
4
|
-
import { View, Text, StyleSheet, TouchableOpacity, Alert } from "react-native";
|
|
5
|
-
import { Trash2, CopyButton, CheckSquare, EyeOff, ProUpgradeModal, monoFont } from "@buoy-gg/shared-ui";
|
|
6
|
-
import { macOSColors, night } from "@buoy-gg/shared-ui";
|
|
7
|
-
import { useIsPro } from "@buoy-gg/license";
|
|
8
|
-
import { deleteStorageKeys } from "../utils/deleteStorageKeys";
|
|
9
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
export function SelectionActionBar({
|
|
11
|
-
selectedKeys,
|
|
12
|
-
mmkvInstances,
|
|
13
|
-
onDeleteComplete,
|
|
14
|
-
onHideKeys,
|
|
15
|
-
onSelectAll,
|
|
16
|
-
onClearSelection,
|
|
17
|
-
totalVisibleKeys
|
|
18
|
-
}) {
|
|
19
|
-
const [showUpgradeModal, setShowUpgradeModal] = useState(false);
|
|
20
|
-
const isPro = useIsPro();
|
|
21
|
-
|
|
22
|
-
// Auto-close upgrade modal when user becomes Pro
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
if (showUpgradeModal && isPro) {
|
|
25
|
-
setShowUpgradeModal(false);
|
|
26
|
-
}
|
|
27
|
-
}, [showUpgradeModal, isPro]);
|
|
28
|
-
const selectedCount = selectedKeys.length;
|
|
29
|
-
const allSelected = selectedCount === totalVisibleKeys && totalVisibleKeys > 0;
|
|
30
|
-
|
|
31
|
-
// Generate copy data for selected keys
|
|
32
|
-
const getCopyData = () => {
|
|
33
|
-
const data = {};
|
|
34
|
-
selectedKeys.forEach(key => {
|
|
35
|
-
const prefix = key.instanceId ? `[${key.storageType}:${key.instanceId}]` : `[${key.storageType}]`;
|
|
36
|
-
data[`${prefix} ${key.key}`] = key.value;
|
|
37
|
-
});
|
|
38
|
-
return {
|
|
39
|
-
selectedCount,
|
|
40
|
-
keys: data,
|
|
41
|
-
timestamp: new Date().toISOString()
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
// Hide selected keys (adds them to the filter store; non-destructive)
|
|
46
|
-
const handleHideSelected = () => {
|
|
47
|
-
if (selectedCount === 0) return;
|
|
48
|
-
onHideKeys?.(selectedKeys);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
// Handle delete selected keys
|
|
52
|
-
const handleDeleteSelected = () => {
|
|
53
|
-
if (selectedCount === 0) return;
|
|
54
|
-
|
|
55
|
-
// Gate delete behind Pro
|
|
56
|
-
if (!isPro) {
|
|
57
|
-
setShowUpgradeModal(true);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
Alert.alert("Delete Selected Keys", `Delete ${selectedCount} selected key${selectedCount > 1 ? "s" : ""}? This cannot be undone.`, [{
|
|
61
|
-
text: "Cancel",
|
|
62
|
-
style: "cancel"
|
|
63
|
-
}, {
|
|
64
|
-
text: "Delete",
|
|
65
|
-
style: "destructive",
|
|
66
|
-
onPress: async () => {
|
|
67
|
-
try {
|
|
68
|
-
await deleteStorageKeys(selectedKeys, mmkvInstances);
|
|
69
|
-
onDeleteComplete?.();
|
|
70
|
-
} catch (error) {
|
|
71
|
-
Alert.alert("Error", `Failed to delete keys: ${error}`);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}]);
|
|
75
|
-
};
|
|
76
|
-
if (selectedCount === 0) {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
80
|
-
style: styles.container,
|
|
81
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
82
|
-
style: styles.leftSection,
|
|
83
|
-
children: [/*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
84
|
-
style: styles.selectAllButton,
|
|
85
|
-
onPress: allSelected ? onClearSelection : onSelectAll,
|
|
86
|
-
testID: "buoy-storage-select-all",
|
|
87
|
-
accessibilityLabel: allSelected ? "Deselect all keys" : "Select all keys",
|
|
88
|
-
accessibilityRole: "button",
|
|
89
|
-
children: [/*#__PURE__*/_jsx(CheckSquare, {
|
|
90
|
-
size: 14,
|
|
91
|
-
color: allSelected ? night.color.accent : night.color.textSecondary
|
|
92
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
93
|
-
style: styles.selectAllText,
|
|
94
|
-
children: allSelected ? "Deselect All" : "Select All"
|
|
95
|
-
})]
|
|
96
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
97
|
-
style: styles.countBadge,
|
|
98
|
-
children: /*#__PURE__*/_jsxs(Text, {
|
|
99
|
-
style: styles.countText,
|
|
100
|
-
children: [selectedCount, " selected"]
|
|
101
|
-
})
|
|
102
|
-
})]
|
|
103
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
104
|
-
style: styles.actionsSection,
|
|
105
|
-
children: [/*#__PURE__*/_jsx(CopyButton, {
|
|
106
|
-
value: getCopyData(),
|
|
107
|
-
size: 14,
|
|
108
|
-
testID: "buoy-storage-selection-copy",
|
|
109
|
-
buttonStyle: styles.actionButton,
|
|
110
|
-
colors: {
|
|
111
|
-
idle: night.color.accent,
|
|
112
|
-
success: macOSColors.semantic.success,
|
|
113
|
-
error: macOSColors.semantic.error
|
|
114
|
-
}
|
|
115
|
-
}), onHideKeys && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
116
|
-
style: styles.actionButton,
|
|
117
|
-
onPress: handleHideSelected,
|
|
118
|
-
testID: "buoy-storage-selection-hide",
|
|
119
|
-
accessibilityLabel: "Hide selected keys",
|
|
120
|
-
accessibilityRole: "button",
|
|
121
|
-
children: /*#__PURE__*/_jsx(EyeOff, {
|
|
122
|
-
size: 14,
|
|
123
|
-
color: night.color.warning
|
|
124
|
-
})
|
|
125
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
126
|
-
style: styles.actionButton,
|
|
127
|
-
onPress: handleDeleteSelected,
|
|
128
|
-
testID: "buoy-storage-selection-delete",
|
|
129
|
-
accessibilityLabel: "Delete selected keys",
|
|
130
|
-
accessibilityRole: "button",
|
|
131
|
-
children: /*#__PURE__*/_jsx(Trash2, {
|
|
132
|
-
size: 14,
|
|
133
|
-
color: night.color.danger
|
|
134
|
-
})
|
|
135
|
-
})]
|
|
136
|
-
}), /*#__PURE__*/_jsx(ProUpgradeModal, {
|
|
137
|
-
visible: showUpgradeModal,
|
|
138
|
-
onClose: () => setShowUpgradeModal(false),
|
|
139
|
-
featureName: "Storage Editing"
|
|
140
|
-
})]
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
const styles = StyleSheet.create({
|
|
144
|
-
container: {
|
|
145
|
-
flexDirection: "row",
|
|
146
|
-
alignItems: "center",
|
|
147
|
-
justifyContent: "space-between",
|
|
148
|
-
backgroundColor: night.color.accentSoft,
|
|
149
|
-
borderRadius: 8,
|
|
150
|
-
borderWidth: 1,
|
|
151
|
-
borderColor: night.color.accentBorderStrong,
|
|
152
|
-
paddingHorizontal: 12,
|
|
153
|
-
paddingVertical: 8,
|
|
154
|
-
marginBottom: 10
|
|
155
|
-
},
|
|
156
|
-
leftSection: {
|
|
157
|
-
flexDirection: "row",
|
|
158
|
-
alignItems: "center",
|
|
159
|
-
gap: 12
|
|
160
|
-
},
|
|
161
|
-
selectAllButton: {
|
|
162
|
-
flexDirection: "row",
|
|
163
|
-
alignItems: "center",
|
|
164
|
-
gap: 6,
|
|
165
|
-
paddingVertical: 4,
|
|
166
|
-
paddingHorizontal: 8,
|
|
167
|
-
backgroundColor: night.color.surface,
|
|
168
|
-
borderRadius: 6,
|
|
169
|
-
borderWidth: 1,
|
|
170
|
-
borderColor: night.color.border
|
|
171
|
-
},
|
|
172
|
-
selectAllText: {
|
|
173
|
-
fontSize: 11,
|
|
174
|
-
fontWeight: "600",
|
|
175
|
-
color: night.color.textSecondary
|
|
176
|
-
},
|
|
177
|
-
countBadge: {
|
|
178
|
-
backgroundColor: night.color.accentFill,
|
|
179
|
-
paddingHorizontal: 8,
|
|
180
|
-
paddingVertical: 4,
|
|
181
|
-
borderRadius: 6
|
|
182
|
-
},
|
|
183
|
-
countText: {
|
|
184
|
-
fontSize: 11,
|
|
185
|
-
fontWeight: "700",
|
|
186
|
-
color: night.color.accent,
|
|
187
|
-
fontFamily: monoFont
|
|
188
|
-
},
|
|
189
|
-
actionsSection: {
|
|
190
|
-
flexDirection: "row",
|
|
191
|
-
alignItems: "center",
|
|
192
|
-
gap: 8
|
|
193
|
-
},
|
|
194
|
-
actionButton: {
|
|
195
|
-
width: 28,
|
|
196
|
-
height: 28,
|
|
197
|
-
alignItems: "center",
|
|
198
|
-
justifyContent: "center",
|
|
199
|
-
borderRadius: 6,
|
|
200
|
-
backgroundColor: night.color.surface,
|
|
201
|
-
borderWidth: 1,
|
|
202
|
-
borderColor: night.color.border
|
|
203
|
-
}
|
|
204
|
-
});
|
|
1
|
+
"use strict";import{useState as z,useEffect as k}from"react";import{View as a,Text as h,StyleSheet as A,TouchableOpacity as f,Alert as m}from"react-native";import{Trash2 as $,CopyButton as P,CheckSquare as R,EyeOff as j,ProUpgradeModal as E,monoFont as W}from"@buoy-gg/shared-ui";import{macOSColors as p,night as e}from"@buoy-gg/shared-ui";import{useIsPro as v}from"@buoy-gg/license";import{deleteStorageKeys as F}from"../utils/deleteStorageKeys";import{jsx as o,jsxs as c}from"react/jsx-runtime";export function SelectionActionBar({selectedKeys:n,mmkvInstances:S,onDeleteComplete:x,onHideKeys:y,onSelectAll:D,onClearSelection:C,totalVisibleKeys:b}){const[d,u]=z(false);const g=v();k(()=>{if(d&&g){u(false)}},[d,g]);const r=n.length;const s=r===b&&b>0;const I=()=>{const i={};n.forEach(l=>{const T=l.instanceId?`[${l.storageType}:${l.instanceId}]`:`[${l.storageType}]`;i[`${T} ${l.key}`]=l.value});return{selectedCount:r,keys:i,timestamp:new Date().toISOString()}};const w=()=>{if(r===0)return;y?.(n)};const B=()=>{if(r===0)return;if(!g){u(true);return}m.alert("Delete Selected Keys",`Delete ${r} selected key${r>1?"s":""}? This cannot be undone.`,[{text:"Cancel",style:"cancel"},{text:"Delete",style:"destructive",onPress:async()=>{try{await F(n,S);x?.()}catch(i){m.alert("Error",`Failed to delete keys: ${i}`)}}}])};if(r===0){return null}return c(a,{style:t.container,children:[c(a,{style:t.leftSection,children:[c(f,{style:t.selectAllButton,onPress:s?C:D,testID:"buoy-storage-select-all",accessibilityLabel:s?"Deselect all keys":"Select all keys",accessibilityRole:"button",children:[o(R,{size:14,color:s?e.color.accent:e.color.textSecondary}),o(h,{style:t.selectAllText,children:s?"Deselect All":"Select All"})]}),o(a,{style:t.countBadge,children:c(h,{style:t.countText,children:[r," selected"]})})]}),c(a,{style:t.actionsSection,children:[o(P,{value:I(),size:14,testID:"buoy-storage-selection-copy",buttonStyle:t.actionButton,colors:{idle:e.color.accent,success:p.semantic.success,error:p.semantic.error}}),y&&o(f,{style:t.actionButton,onPress:w,testID:"buoy-storage-selection-hide",accessibilityLabel:"Hide selected keys",accessibilityRole:"button",children:o(j,{size:14,color:e.color.warning})}),o(f,{style:t.actionButton,onPress:B,testID:"buoy-storage-selection-delete",accessibilityLabel:"Delete selected keys",accessibilityRole:"button",children:o($,{size:14,color:e.color.danger})})]}),o(E,{visible:d,onClose:()=>u(false),featureName:"Storage Editing"})]})}const t=A.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:e.color.accentSoft,borderRadius:8,borderWidth:1,borderColor:e.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:e.color.surface,borderRadius:6,borderWidth:1,borderColor:e.color.border},selectAllText:{fontSize:11,fontWeight:"600",color:e.color.textSecondary},countBadge:{backgroundColor:e.color.accentFill,paddingHorizontal:8,paddingVertical:4,borderRadius:6},countText:{fontSize:11,fontWeight:"700",color:e.color.accent,fontFamily:W},actionsSection:{flexDirection:"row",alignItems:"center",gap:8},actionButton:{width:28,height:28,alignItems:"center",justifyContent:"center",borderRadius:6,backgroundColor:e.color.surface,borderWidth:1,borderColor:e.color.border}});
|
|
@@ -1,237 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { useState, useEffect } from "react";
|
|
4
|
-
import { View, Text, StyleSheet, TouchableOpacity, Alert } from "react-native";
|
|
5
|
-
import { Trash2, CopyButton, SquareDashed, X, ProUpgradeModal, monoFont } from "@buoy-gg/shared-ui";
|
|
6
|
-
import { macOSColors, night } from "@buoy-gg/shared-ui";
|
|
7
|
-
import { useIsPro } from "@buoy-gg/license";
|
|
8
|
-
import AsyncStorage from "@react-native-async-storage/async-storage";
|
|
9
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
export function StorageActionButtons({
|
|
11
|
-
copyValue,
|
|
12
|
-
mmkvInstances = [],
|
|
13
|
-
activeStorageType = "all",
|
|
14
|
-
onClearComplete,
|
|
15
|
-
isSelectMode = false,
|
|
16
|
-
onToggleSelectMode,
|
|
17
|
-
selectedCount = 0
|
|
18
|
-
}) {
|
|
19
|
-
const [showUpgradeModal, setShowUpgradeModal] = useState(false);
|
|
20
|
-
const isPro = useIsPro();
|
|
21
|
-
|
|
22
|
-
// Auto-close upgrade modal when user becomes Pro
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
if (showUpgradeModal && isPro) {
|
|
25
|
-
setShowUpgradeModal(false);
|
|
26
|
-
}
|
|
27
|
-
}, [showUpgradeModal, isPro]);
|
|
28
|
-
const handleClearAsyncStorage = () => {
|
|
29
|
-
// Gate clear behind Pro
|
|
30
|
-
if (!isPro) {
|
|
31
|
-
setShowUpgradeModal(true);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
Alert.alert("Clear AsyncStorage", "Delete all AsyncStorage keys? This cannot be undone.", [{
|
|
35
|
-
text: "Cancel",
|
|
36
|
-
style: "cancel"
|
|
37
|
-
}, {
|
|
38
|
-
text: "Clear",
|
|
39
|
-
style: "destructive",
|
|
40
|
-
onPress: async () => {
|
|
41
|
-
try {
|
|
42
|
-
await AsyncStorage.clear();
|
|
43
|
-
onClearComplete?.();
|
|
44
|
-
} catch (error) {
|
|
45
|
-
Alert.alert("Error", `Failed: ${error}`);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}]);
|
|
49
|
-
};
|
|
50
|
-
const handleClearMMKV = (instanceId, instanceName) => {
|
|
51
|
-
// Gate clear behind Pro
|
|
52
|
-
if (!isPro) {
|
|
53
|
-
setShowUpgradeModal(true);
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
Alert.alert(`Clear ${instanceName}`, `Delete all keys from ${instanceName}? This cannot be undone.`, [{
|
|
57
|
-
text: "Cancel",
|
|
58
|
-
style: "cancel"
|
|
59
|
-
}, {
|
|
60
|
-
text: "Clear",
|
|
61
|
-
style: "destructive",
|
|
62
|
-
onPress: () => {
|
|
63
|
-
try {
|
|
64
|
-
const inst = mmkvInstances.find(i => i.id === instanceId);
|
|
65
|
-
if (inst) {
|
|
66
|
-
inst.instance.clearAll();
|
|
67
|
-
onClearComplete?.();
|
|
68
|
-
}
|
|
69
|
-
} catch (error) {
|
|
70
|
-
Alert.alert("Error", `Failed: ${error}`);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}]);
|
|
74
|
-
};
|
|
75
|
-
const handleClearAllMMKV = () => {
|
|
76
|
-
// Gate clear behind Pro
|
|
77
|
-
if (!isPro) {
|
|
78
|
-
setShowUpgradeModal(true);
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
Alert.alert("Clear All MMKV", `Delete all keys from ${mmkvInstances.length} instances? This cannot be undone.`, [{
|
|
82
|
-
text: "Cancel",
|
|
83
|
-
style: "cancel"
|
|
84
|
-
}, {
|
|
85
|
-
text: "Clear All",
|
|
86
|
-
style: "destructive",
|
|
87
|
-
onPress: () => {
|
|
88
|
-
try {
|
|
89
|
-
mmkvInstances.forEach(inst => inst.instance.clearAll());
|
|
90
|
-
onClearComplete?.();
|
|
91
|
-
} catch (error) {
|
|
92
|
-
Alert.alert("Error", `Failed: ${error}`);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}]);
|
|
96
|
-
};
|
|
97
|
-
const handleClearAll = () => {
|
|
98
|
-
// Gate clear behind Pro
|
|
99
|
-
if (!isPro) {
|
|
100
|
-
setShowUpgradeModal(true);
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
Alert.alert("Clear All Storage", "Delete all storage data? This cannot be undone.", [{
|
|
104
|
-
text: "Cancel",
|
|
105
|
-
style: "cancel"
|
|
106
|
-
}, {
|
|
107
|
-
text: "Clear All",
|
|
108
|
-
style: "destructive",
|
|
109
|
-
onPress: async () => {
|
|
110
|
-
try {
|
|
111
|
-
await AsyncStorage.clear();
|
|
112
|
-
mmkvInstances.forEach(inst => inst.instance.clearAll());
|
|
113
|
-
onClearComplete?.();
|
|
114
|
-
} catch (error) {
|
|
115
|
-
Alert.alert("Error", `Failed: ${error}`);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}]);
|
|
119
|
-
};
|
|
120
|
-
const showAsyncActions = activeStorageType === "all" || activeStorageType === "async";
|
|
121
|
-
const showMMKVActions = activeStorageType === "all" || activeStorageType === "mmkv";
|
|
122
|
-
|
|
123
|
-
// Determine which clear actions to show based on active filter
|
|
124
|
-
const showClearAll = activeStorageType === "all";
|
|
125
|
-
const showClearAsync = showAsyncActions && !showClearAll;
|
|
126
|
-
const showClearMMKVIndividual = showMMKVActions && !showClearAll;
|
|
127
|
-
const showClearAllMMKV = showMMKVActions && mmkvInstances.length > 1 && !showClearAll;
|
|
128
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
129
|
-
style: styles.container,
|
|
130
|
-
children: [onToggleSelectMode && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
131
|
-
onPress: onToggleSelectMode,
|
|
132
|
-
testID: "buoy-storage-select-mode",
|
|
133
|
-
accessibilityLabel: isSelectMode ? "Exit selection mode" : "Select keys",
|
|
134
|
-
accessibilityRole: "button",
|
|
135
|
-
style: [styles.actionButton, isSelectMode && styles.actionButtonActive],
|
|
136
|
-
children: isSelectMode ? /*#__PURE__*/_jsxs(View, {
|
|
137
|
-
style: styles.selectModeActiveContainer,
|
|
138
|
-
children: [/*#__PURE__*/_jsx(X, {
|
|
139
|
-
size: 14,
|
|
140
|
-
color: night.color.accent
|
|
141
|
-
}), selectedCount > 0 && /*#__PURE__*/_jsx(Text, {
|
|
142
|
-
style: styles.selectedCountText,
|
|
143
|
-
children: selectedCount
|
|
144
|
-
})]
|
|
145
|
-
}) : /*#__PURE__*/_jsx(SquareDashed, {
|
|
146
|
-
size: 16,
|
|
147
|
-
color: night.color.textSecondary
|
|
148
|
-
})
|
|
149
|
-
}), !isSelectMode && /*#__PURE__*/_jsx(CopyButton, {
|
|
150
|
-
value: copyValue,
|
|
151
|
-
size: 16,
|
|
152
|
-
testID: "buoy-storage-export-copy",
|
|
153
|
-
buttonStyle: styles.actionButton,
|
|
154
|
-
colors: {
|
|
155
|
-
idle: night.color.textSecondary,
|
|
156
|
-
success: macOSColors.semantic.success,
|
|
157
|
-
error: macOSColors.semantic.error
|
|
158
|
-
}
|
|
159
|
-
}), !isSelectMode && showClearAll && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
160
|
-
onPress: handleClearAll,
|
|
161
|
-
testID: "buoy-storage-clear-all",
|
|
162
|
-
accessibilityLabel: "Clear all storage",
|
|
163
|
-
accessibilityRole: "button",
|
|
164
|
-
style: styles.actionButton,
|
|
165
|
-
children: /*#__PURE__*/_jsx(Trash2, {
|
|
166
|
-
size: 16,
|
|
167
|
-
color: night.color.danger
|
|
168
|
-
})
|
|
169
|
-
}), !isSelectMode && showClearAsync && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
170
|
-
onPress: handleClearAsyncStorage,
|
|
171
|
-
testID: "buoy-storage-clear-async",
|
|
172
|
-
accessibilityLabel: "Clear AsyncStorage",
|
|
173
|
-
accessibilityRole: "button",
|
|
174
|
-
style: styles.actionButton,
|
|
175
|
-
children: /*#__PURE__*/_jsx(Trash2, {
|
|
176
|
-
size: 16,
|
|
177
|
-
color: night.color.danger
|
|
178
|
-
})
|
|
179
|
-
}), !isSelectMode && showClearAllMMKV && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
180
|
-
onPress: handleClearAllMMKV,
|
|
181
|
-
testID: "buoy-storage-clear-mmkv-all",
|
|
182
|
-
accessibilityLabel: "Clear all MMKV instances",
|
|
183
|
-
accessibilityRole: "button",
|
|
184
|
-
style: styles.actionButton,
|
|
185
|
-
children: /*#__PURE__*/_jsx(Trash2, {
|
|
186
|
-
size: 16,
|
|
187
|
-
color: night.color.danger
|
|
188
|
-
})
|
|
189
|
-
}), !isSelectMode && showClearMMKVIndividual && mmkvInstances.length === 1 && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
190
|
-
onPress: () => handleClearMMKV(mmkvInstances[0].id, mmkvInstances[0].id),
|
|
191
|
-
testID: "buoy-storage-clear-mmkv",
|
|
192
|
-
accessibilityLabel: "Clear MMKV instance",
|
|
193
|
-
accessibilityRole: "button",
|
|
194
|
-
style: styles.actionButton,
|
|
195
|
-
children: /*#__PURE__*/_jsx(Trash2, {
|
|
196
|
-
size: 16,
|
|
197
|
-
color: night.color.danger
|
|
198
|
-
})
|
|
199
|
-
}), /*#__PURE__*/_jsx(ProUpgradeModal, {
|
|
200
|
-
visible: showUpgradeModal,
|
|
201
|
-
onClose: () => setShowUpgradeModal(false),
|
|
202
|
-
featureName: "Storage Editing"
|
|
203
|
-
})]
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
const styles = StyleSheet.create({
|
|
207
|
-
container: {
|
|
208
|
-
flexDirection: "row",
|
|
209
|
-
alignItems: "center",
|
|
210
|
-
gap: 8
|
|
211
|
-
},
|
|
212
|
-
actionButton: {
|
|
213
|
-
width: 32,
|
|
214
|
-
height: 32,
|
|
215
|
-
alignItems: "center",
|
|
216
|
-
justifyContent: "center",
|
|
217
|
-
borderRadius: 6,
|
|
218
|
-
backgroundColor: night.color.buttonSurface,
|
|
219
|
-
borderWidth: 1,
|
|
220
|
-
borderColor: night.color.border
|
|
221
|
-
},
|
|
222
|
-
actionButtonActive: {
|
|
223
|
-
backgroundColor: night.color.accentSoft,
|
|
224
|
-
borderColor: night.color.accentBorderStrong
|
|
225
|
-
},
|
|
226
|
-
selectModeActiveContainer: {
|
|
227
|
-
flexDirection: "row",
|
|
228
|
-
alignItems: "center",
|
|
229
|
-
gap: 2
|
|
230
|
-
},
|
|
231
|
-
selectedCountText: {
|
|
232
|
-
fontSize: 10,
|
|
233
|
-
fontWeight: "700",
|
|
234
|
-
color: night.color.accent,
|
|
235
|
-
fontFamily: monoFont
|
|
236
|
-
}
|
|
237
|
-
});
|
|
1
|
+
"use strict";import{storageLabels as i}from"../utils/storageLabels";import{useState as V,useEffect as j}from"react";import{View as w,Text as k,StyleSheet as K,TouchableOpacity as y,Alert as s}from"react-native";import{Trash2 as f,CopyButton as I,SquareDashed as T,X as U,ProUpgradeModal as O,monoFont as W}from"@buoy-gg/shared-ui";import{macOSColors as D,night as t}from"@buoy-gg/shared-ui";import{useIsPro as _}from"@buoy-gg/license";import $ from"@react-native-async-storage/async-storage";import{jsx as e,jsxs as B}from"react/jsx-runtime";export function StorageActionButtons({copyValue:P,mmkvInstances:l=[],activeStorageType:u="all",onClearComplete:d,isSelectMode:a=false,onToggleSelectMode:C,selectedCount:m=0}){const[g,c]=V(false);const n=_();j(()=>{if(g&&n){c(false)}},[g,n]);const p=()=>{if(!n){c(true);return}s.alert(`Clear ${i.asyncFull}`,`Delete all ${i.asyncFull} keys? This cannot be undone.`,[{text:"Cancel",style:"cancel"},{text:"Clear",style:"destructive",onPress:async()=>{try{await $.clear();d?.()}catch(r){s.alert("Error",`Failed: ${r}`)}}}])};const E=(r,x)=>{if(!n){c(true);return}s.alert(`Clear ${x}`,`Delete all keys from ${x}? This cannot be undone.`,[{text:"Cancel",style:"cancel"},{text:"Clear",style:"destructive",onPress:()=>{try{const b=l.find(R=>R.id===r);if(b){b.instance.clearAll();d?.()}}catch(b){s.alert("Error",`Failed: ${b}`)}}}])};const F=()=>{if(!n){c(true);return}s.alert(`Clear All ${i.mmkv}`,`Delete all keys from ${l.length} instances? This cannot be undone.`,[{text:"Cancel",style:"cancel"},{text:"Clear All",style:"destructive",onPress:()=>{try{l.forEach(r=>r.instance.clearAll());d?.()}catch(r){s.alert("Error",`Failed: ${r}`)}}}])};const z=()=>{if(!n){c(true);return}s.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 $.clear();l.forEach(r=>r.instance.clearAll());d?.()}catch(r){s.alert("Error",`Failed: ${r}`)}}}])};const M=u==="all"||u==="async";const A=u==="all"||u==="mmkv";const h=u==="all";const S=M&&!h;const v=A&&!h;const L=A&&l.length>1&&!h;return B(w,{style:o.container,children:[C&&e(y,{onPress:C,testID:"buoy-storage-select-mode",accessibilityLabel:a?"Exit selection mode":"Select keys",accessibilityRole:"button",style:[o.actionButton,a&&o.actionButtonActive],children:a?B(w,{style:o.selectModeActiveContainer,children:[e(U,{size:14,color:t.color.accent}),m>0&&e(k,{style:o.selectedCountText,children:m})]}):e(T,{size:16,color:t.color.textSecondary})}),!a&&e(I,{value:P,size:16,testID:"buoy-storage-export-copy",buttonStyle:o.actionButton,colors:{idle:t.color.textSecondary,success:D.semantic.success,error:D.semantic.error}}),!a&&h&&e(y,{onPress:z,testID:"buoy-storage-clear-all",accessibilityLabel:"Clear all storage",accessibilityRole:"button",style:o.actionButton,children:e(f,{size:16,color:t.color.danger})}),!a&&S&&e(y,{onPress:p,testID:"buoy-storage-clear-async",accessibilityLabel:`Clear ${i.asyncFull}`,accessibilityRole:"button",style:o.actionButton,children:e(f,{size:16,color:t.color.danger})}),!a&&L&&e(y,{onPress:F,testID:"buoy-storage-clear-mmkv-all",accessibilityLabel:`Clear all ${i.mmkv} instances`,accessibilityRole:"button",style:o.actionButton,children:e(f,{size:16,color:t.color.danger})}),!a&&v&&l.length===1&&e(y,{onPress:()=>E(l[0].id,l[0].id),testID:"buoy-storage-clear-mmkv",accessibilityLabel:`Clear ${i.mmkv} instance`,accessibilityRole:"button",style:o.actionButton,children:e(f,{size:16,color:t.color.danger})}),e(O,{visible:g,onClose:()=>c(false),featureName:"Storage Editing"})]})}const o=K.create({container:{flexDirection:"row",alignItems:"center",gap:8},actionButton:{width:32,height:32,alignItems:"center",justifyContent:"center",borderRadius:6,backgroundColor:t.color.buttonSurface,borderWidth:1,borderColor:t.color.border},actionButtonActive:{backgroundColor:t.color.accentSoft,borderColor:t.color.accentBorderStrong},selectModeActiveContainer:{flexDirection:"row",alignItems:"center",gap:2},selectedCountText:{fontSize:10,fontWeight:"700",color:t.color.accent,fontFamily:W}});
|
|
@@ -1,57 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { GameUIStorageBrowser } from "./GameUIStorageBrowser";
|
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
/**
|
|
6
|
-
* Storage browser mode component
|
|
7
|
-
* Displays storage keys with game UI styled interface
|
|
8
|
-
*/
|
|
9
|
-
export function StorageBrowserMode({
|
|
10
|
-
requiredStorageKeys = [],
|
|
11
|
-
showFilters = false,
|
|
12
|
-
ignoredPatterns = new Set(),
|
|
13
|
-
onTogglePattern,
|
|
14
|
-
onAddPattern,
|
|
15
|
-
searchQuery = "",
|
|
16
|
-
storageDataRef,
|
|
17
|
-
eventCountByKey,
|
|
18
|
-
lastWriteByKey,
|
|
19
|
-
onViewHistory,
|
|
20
|
-
enabledStorageTypes,
|
|
21
|
-
statusFilter,
|
|
22
|
-
onStatusFilterChange,
|
|
23
|
-
onStatusCountsChange,
|
|
24
|
-
pinnedKeys,
|
|
25
|
-
onTogglePin,
|
|
26
|
-
applySafeAreaInset,
|
|
27
|
-
storageTypeFilter,
|
|
28
|
-
onStorageTypeFilterChange,
|
|
29
|
-
detailKey,
|
|
30
|
-
onOpenKey,
|
|
31
|
-
onCloseDetail
|
|
32
|
-
}) {
|
|
33
|
-
return /*#__PURE__*/_jsx(GameUIStorageBrowser, {
|
|
34
|
-
requiredStorageKeys: requiredStorageKeys,
|
|
35
|
-
showFilters: showFilters,
|
|
36
|
-
ignoredPatterns: ignoredPatterns,
|
|
37
|
-
onTogglePattern: onTogglePattern,
|
|
38
|
-
onAddPattern: onAddPattern,
|
|
39
|
-
searchQuery: searchQuery,
|
|
40
|
-
storageDataRef: storageDataRef,
|
|
41
|
-
eventCountByKey: eventCountByKey,
|
|
42
|
-
lastWriteByKey: lastWriteByKey,
|
|
43
|
-
onViewHistory: onViewHistory,
|
|
44
|
-
enabledStorageTypes: enabledStorageTypes,
|
|
45
|
-
statusFilter: statusFilter,
|
|
46
|
-
onStatusFilterChange: onStatusFilterChange,
|
|
47
|
-
onStatusCountsChange: onStatusCountsChange,
|
|
48
|
-
pinnedKeys: pinnedKeys,
|
|
49
|
-
onTogglePin: onTogglePin,
|
|
50
|
-
applySafeAreaInset: applySafeAreaInset,
|
|
51
|
-
storageTypeFilter: storageTypeFilter,
|
|
52
|
-
onStorageTypeFilterChange: onStorageTypeFilterChange,
|
|
53
|
-
detailKey: detailKey,
|
|
54
|
-
onOpenKey: onOpenKey,
|
|
55
|
-
onCloseDetail: onCloseDetail
|
|
56
|
-
});
|
|
57
|
-
}
|
|
1
|
+
"use strict";import{GameUIStorageBrowser as T}from"./GameUIStorageBrowser";import{jsx as B}from"react/jsx-runtime";export function StorageBrowserMode({requiredStorageKeys:e=[],showFilters:t=false,ignoredPatterns:r=new Set,onTogglePattern:o,onAddPattern:a,searchQuery:n="",storageDataRef:s,eventCountByKey:i,lastWriteByKey:g,onViewHistory:l,enabledStorageTypes:y,statusFilter:p,onStatusFilterChange:u,onStatusCountsChange:S,pinnedKeys:d,onTogglePin:f,applySafeAreaInset:C,storageTypeFilter:K,onStorageTypeFilterChange:h,detailKey:m,onOpenKey:w,onCloseDetail:F}){return B(T,{requiredStorageKeys:e,showFilters:t,ignoredPatterns:r,onTogglePattern:o,onAddPattern:a,searchQuery:n,storageDataRef:s,eventCountByKey:i,lastWriteByKey:g,onViewHistory:l,enabledStorageTypes:y,statusFilter:p,onStatusFilterChange:u,onStatusCountsChange:S,pinnedKeys:d,onTogglePin:f,applySafeAreaInset:C,storageTypeFilter:K,onStorageTypeFilterChange:h,detailKey:m,onOpenKey:w,onCloseDetail:F})}
|
|
@@ -1,118 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* StorageEventActionButton
|
|
5
|
-
*
|
|
6
|
-
* Action button for Storage DevTools detail view
|
|
7
|
-
* Matches Redux DevTools ActionButton styling
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { TouchableOpacity, Text, View, StyleSheet } from "react-native";
|
|
11
|
-
import { night, Lock, monoFont } from "@buoy-gg/shared-ui";
|
|
12
|
-
|
|
13
|
-
// Button color configurations matching Redux/React Query pattern
|
|
14
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
-
const buttonConfigs = {
|
|
16
|
-
copy: {
|
|
17
|
-
color: night.color.accent,
|
|
18
|
-
backgroundColor: night.color.accentSoft,
|
|
19
|
-
borderColor: night.color.accentBorderStrong,
|
|
20
|
-
textColor: night.color.accent
|
|
21
|
-
},
|
|
22
|
-
jump: {
|
|
23
|
-
color: night.color.warning,
|
|
24
|
-
backgroundColor: night.color.warningSoft,
|
|
25
|
-
borderColor: night.color.warning + "40",
|
|
26
|
-
textColor: night.color.warning
|
|
27
|
-
},
|
|
28
|
-
undo: {
|
|
29
|
-
color: night.color.info,
|
|
30
|
-
backgroundColor: night.color.infoSoft,
|
|
31
|
-
borderColor: night.color.info + "40",
|
|
32
|
-
textColor: night.color.info
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
export function StorageEventActionButton({
|
|
36
|
-
onPress,
|
|
37
|
-
text,
|
|
38
|
-
type,
|
|
39
|
-
disabled = false,
|
|
40
|
-
locked = false
|
|
41
|
-
}) {
|
|
42
|
-
const config = buttonConfigs[type];
|
|
43
|
-
const isDisabledOrLocked = disabled || locked;
|
|
44
|
-
return /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
45
|
-
disabled: isDisabledOrLocked,
|
|
46
|
-
onPress: onPress,
|
|
47
|
-
style: [styles.button, {
|
|
48
|
-
backgroundColor: isDisabledOrLocked ? night.color.fill : config.backgroundColor,
|
|
49
|
-
borderColor: isDisabledOrLocked ? night.color.fillTertiary : config.borderColor,
|
|
50
|
-
opacity: disabled ? 0.5 : 1
|
|
51
|
-
}],
|
|
52
|
-
activeOpacity: 0.7,
|
|
53
|
-
testID: `buoy-storage-action-${type}`,
|
|
54
|
-
accessibilityRole: "button",
|
|
55
|
-
accessibilityLabel: text,
|
|
56
|
-
accessibilityState: {
|
|
57
|
-
disabled: isDisabledOrLocked
|
|
58
|
-
},
|
|
59
|
-
children: [locked ? /*#__PURE__*/_jsx(Lock, {
|
|
60
|
-
size: 10,
|
|
61
|
-
color: night.color.textTertiary,
|
|
62
|
-
style: styles.lockIcon
|
|
63
|
-
}) : /*#__PURE__*/_jsx(View, {
|
|
64
|
-
style: [styles.dot, {
|
|
65
|
-
backgroundColor: isDisabledOrLocked ? night.color.textTertiary : config.color
|
|
66
|
-
}]
|
|
67
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
68
|
-
style: [styles.text, {
|
|
69
|
-
color: isDisabledOrLocked ? night.color.textTertiary : config.textColor
|
|
70
|
-
}],
|
|
71
|
-
children: text
|
|
72
|
-
})]
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
const styles = StyleSheet.create({
|
|
76
|
-
button: {
|
|
77
|
-
flexDirection: "row",
|
|
78
|
-
alignItems: "center",
|
|
79
|
-
justifyContent: "center",
|
|
80
|
-
borderRadius: 6,
|
|
81
|
-
borderWidth: 1,
|
|
82
|
-
paddingHorizontal: 12,
|
|
83
|
-
paddingVertical: 6,
|
|
84
|
-
height: 25,
|
|
85
|
-
minWidth: 70,
|
|
86
|
-
shadowOffset: {
|
|
87
|
-
width: 0,
|
|
88
|
-
height: 1
|
|
89
|
-
},
|
|
90
|
-
shadowOpacity: 0.2,
|
|
91
|
-
shadowRadius: 2,
|
|
92
|
-
elevation: 2
|
|
93
|
-
},
|
|
94
|
-
dot: {
|
|
95
|
-
width: 5,
|
|
96
|
-
height: 5,
|
|
97
|
-
borderRadius: 3,
|
|
98
|
-
marginRight: 6,
|
|
99
|
-
shadowColor: night.color.text,
|
|
100
|
-
shadowOffset: {
|
|
101
|
-
width: 0,
|
|
102
|
-
height: 0
|
|
103
|
-
},
|
|
104
|
-
shadowOpacity: 0.6,
|
|
105
|
-
shadowRadius: 2
|
|
106
|
-
},
|
|
107
|
-
lockIcon: {
|
|
108
|
-
marginRight: 4
|
|
109
|
-
},
|
|
110
|
-
text: {
|
|
111
|
-
fontSize: 10,
|
|
112
|
-
fontWeight: "600",
|
|
113
|
-
letterSpacing: 0.5,
|
|
114
|
-
textTransform: "uppercase",
|
|
115
|
-
fontFamily: monoFont,
|
|
116
|
-
height: 12
|
|
117
|
-
}
|
|
118
|
-
});
|
|
1
|
+
"use strict";import{TouchableOpacity as d,Text as g,View as h,StyleSheet as f}from"react-native";import{night as o,Lock as b,monoFont as u}from"@buoy-gg/shared-ui";import{jsx as i,jsxs as y}from"react/jsx-runtime";const C={copy:{color:o.color.accent,backgroundColor:o.color.accentSoft,borderColor:o.color.accentBorderStrong,textColor:o.color.accent},jump:{color:o.color.warning,backgroundColor:o.color.warningSoft,borderColor:o.color.warning+"40",textColor:o.color.warning},undo:{color:o.color.info,backgroundColor:o.color.infoSoft,borderColor:o.color.info+"40",textColor:o.color.info}};export function StorageEventActionButton({onPress:s,text:c,type:l,disabled:n=false,locked:a=false}){const r=C[l];const t=n||a;return y(d,{disabled:t,onPress:s,style:[e.button,{backgroundColor:t?o.color.fill:r.backgroundColor,borderColor:t?o.color.fillTertiary:r.borderColor,opacity:n?.5:1}],activeOpacity:.7,testID:`buoy-storage-action-${l}`,accessibilityRole:"button",accessibilityLabel:c,accessibilityState:{disabled:t},children:[a?i(b,{size:10,color:o.color.textTertiary,style:e.lockIcon}):i(h,{style:[e.dot,{backgroundColor:t?o.color.textTertiary:r.color}]}),i(g,{style:[e.text,{color:t?o.color.textTertiary:r.textColor}],children:c})]})}const e=f.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:o.color.text,shadowOffset:{width:0,height:0},shadowOpacity:.6,shadowRadius:2},lockIcon:{marginRight:4},text:{fontSize:10,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:u,height:12}});
|