@buoy-gg/storage 7.0.6 → 7.0.8
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/lib/typescript/storage/sync/storageSyncAdapter.d.ts +1 -1
- package/package.json +5 -5
- package/lib/commonjs/storage/components/GameUIStorageStats.js +0 -746
- package/lib/commonjs/storage/components/StorageActions.js +0 -178
- package/lib/commonjs/storage/components/StorageEventListener.js +0 -357
- package/lib/commonjs/storage/components/StorageFilterViewV2.js +0 -42
- package/lib/commonjs/storage/hooks/useMeasuredWidth.js +0 -74
- package/lib/commonjs/storage/hooks/useTickEverySecond.js +0 -21
- package/lib/commonjs/storage/index.js +0 -258
- package/lib/commonjs/storage/utils/index.js +0 -230
- package/lib/commonjs/storage/utils/objectDiff.js +0 -157
- package/lib/commonjs/storage/utils/safeAsyncStorage.js +0 -140
- package/lib/module/storage/components/GameUIStorageStats.js +0 -743
- package/lib/module/storage/components/StorageActions.js +0 -174
- package/lib/module/storage/components/StorageEventListener.js +0 -354
- package/lib/module/storage/components/StorageFilterViewV2.js +0 -38
- package/lib/module/storage/hooks/useMeasuredWidth.js +0 -71
- package/lib/module/storage/hooks/useTickEverySecond.js +0 -18
- package/lib/module/storage/index.js +0 -34
- package/lib/module/storage/utils/index.js +0 -28
- package/lib/module/storage/utils/objectDiff.js +0 -153
- package/lib/module/storage/utils/safeAsyncStorage.js +0 -134
- package/lib/typescript/storage/components/GameUIStorageStats.d.ts +0 -7
- package/lib/typescript/storage/components/GameUIStorageStats.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageActions.d.ts +0 -10
- package/lib/typescript/storage/components/StorageActions.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageEventListener.d.ts +0 -6
- package/lib/typescript/storage/components/StorageEventListener.d.ts.map +0 -1
- package/lib/typescript/storage/components/StorageFilterViewV2.d.ts +0 -9
- package/lib/typescript/storage/components/StorageFilterViewV2.d.ts.map +0 -1
- package/lib/typescript/storage/hooks/useMeasuredWidth.d.ts +0 -37
- package/lib/typescript/storage/hooks/useMeasuredWidth.d.ts.map +0 -1
- package/lib/typescript/storage/hooks/useTickEverySecond.d.ts +0 -6
- package/lib/typescript/storage/hooks/useTickEverySecond.d.ts.map +0 -1
- package/lib/typescript/storage/index.d.ts +0 -21
- package/lib/typescript/storage/index.d.ts.map +0 -1
- package/lib/typescript/storage/utils/index.d.ts +0 -10
- package/lib/typescript/storage/utils/index.d.ts.map +0 -1
- package/lib/typescript/storage/utils/objectDiff.d.ts +0 -35
- package/lib/typescript/storage/utils/objectDiff.d.ts.map +0 -1
- package/lib/typescript/storage/utils/safeAsyncStorage.d.ts +0 -56
- package/lib/typescript/storage/utils/safeAsyncStorage.d.ts.map +0 -1
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// Storage utilities
|
|
4
|
-
export { clearAllAppStorage } from "./clearAllStorage";
|
|
5
|
-
|
|
6
|
-
// MMKV Availability
|
|
7
|
-
export { isMMKVAvailable, getMMKVClass, getMMKVUnavailableMessage } from "./mmkvAvailability";
|
|
8
|
-
|
|
9
|
-
// AsyncStorage Event Listener
|
|
10
|
-
export { startListening, stopListening, addListener, removeAllListeners, isListening, getListenerCount, pauseCapture, resumeCapture, isPaused } from "./AsyncStorageListener";
|
|
11
|
-
|
|
12
|
-
// Re-export default listener instance
|
|
13
|
-
export { default as asyncStorageListener } from "./AsyncStorageListener";
|
|
14
|
-
|
|
15
|
-
// Storage Time-Travel Utilities
|
|
16
|
-
export { undoOperation, jumpToState, canUndo } from "./storageTimeTravelUtils";
|
|
17
|
-
|
|
18
|
-
// MMKV Instance Registry
|
|
19
|
-
export { registerMMKVInstance, unregisterMMKVInstance, mmkvInstanceRegistry } from "./MMKVInstanceRegistry";
|
|
20
|
-
|
|
21
|
-
// MMKV Listener
|
|
22
|
-
export { addMMKVInstance, removeMMKVInstance, removeAllMMKVInstances, addMMKVListener, removeAllMMKVListeners, isMMKVInstanceMonitored, getMonitoredMMKVInstances, getMMKVInstanceCount, getMMKVListenerCount, isMMKVListening, mmkvListener } from "./MMKVListener";
|
|
23
|
-
|
|
24
|
-
// Storage browser refresh signal (remote-mirror mode)
|
|
25
|
-
export { onStorageBrowserRefresh, requestStorageBrowserRefresh } from "./storageBrowserRefresh";
|
|
26
|
-
|
|
27
|
-
// MMKV Type Detection
|
|
28
|
-
export { detectMMKVType, formatMMKVValue, isTypeMatch } from "./mmkvTypeDetection";
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Type guard to check if a value is a plain object (not array or null)
|
|
5
|
-
*
|
|
6
|
-
* @param obj - Value to check
|
|
7
|
-
* @returns True if the value is a plain object
|
|
8
|
-
*/
|
|
9
|
-
function isObject(obj) {
|
|
10
|
-
return obj !== null && typeof obj === "object" && !Array.isArray(obj);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Type guard to check if a value is an array
|
|
15
|
-
*
|
|
16
|
-
* @param obj - Value to check
|
|
17
|
-
* @returns True if the value is an array
|
|
18
|
-
*/
|
|
19
|
-
function isArray(obj) {
|
|
20
|
-
return Array.isArray(obj);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Recursively compare two values and collect differences
|
|
25
|
-
*
|
|
26
|
-
* This function handles deep comparison of objects, arrays, and primitive values,
|
|
27
|
-
* building a comprehensive diff that tracks the exact path of each change.
|
|
28
|
-
*
|
|
29
|
-
* @param oldVal - The original value to compare from
|
|
30
|
-
* @param newVal - The new value to compare to
|
|
31
|
-
* @param path - Current path in the object structure (for nested properties)
|
|
32
|
-
* @param diffs - Array to collect difference items
|
|
33
|
-
*
|
|
34
|
-
* @performance Uses recursive traversal with path tracking for memory efficiency
|
|
35
|
-
* @performance Handles large nested structures without stack overflow concerns for typical use cases
|
|
36
|
-
*/
|
|
37
|
-
function compareValues(oldVal, newVal, path, diffs) {
|
|
38
|
-
// Both are objects
|
|
39
|
-
if (isObject(oldVal) && isObject(newVal)) {
|
|
40
|
-
const allKeys = new Set([...Object.keys(oldVal), ...Object.keys(newVal)]);
|
|
41
|
-
for (const key of allKeys) {
|
|
42
|
-
const newPath = [...path, key];
|
|
43
|
-
if (!(key in oldVal)) {
|
|
44
|
-
// Key was added
|
|
45
|
-
diffs.push({
|
|
46
|
-
type: "CREATE",
|
|
47
|
-
path: newPath,
|
|
48
|
-
value: newVal[key]
|
|
49
|
-
});
|
|
50
|
-
} else if (!(key in newVal)) {
|
|
51
|
-
// Key was removed
|
|
52
|
-
diffs.push({
|
|
53
|
-
type: "REMOVE",
|
|
54
|
-
path: newPath,
|
|
55
|
-
oldValue: oldVal[key]
|
|
56
|
-
});
|
|
57
|
-
} else {
|
|
58
|
-
// Key exists in both, compare values
|
|
59
|
-
compareValues(oldVal[key], newVal[key], newPath, diffs);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
// Both are arrays
|
|
64
|
-
else if (isArray(oldVal) && isArray(newVal)) {
|
|
65
|
-
const maxLength = Math.max(oldVal.length, newVal.length);
|
|
66
|
-
for (let i = 0; i < maxLength; i++) {
|
|
67
|
-
const newPath = [...path, i];
|
|
68
|
-
if (i >= oldVal.length) {
|
|
69
|
-
// Item was added
|
|
70
|
-
diffs.push({
|
|
71
|
-
type: "CREATE",
|
|
72
|
-
path: newPath,
|
|
73
|
-
value: newVal[i]
|
|
74
|
-
});
|
|
75
|
-
} else if (i >= newVal.length) {
|
|
76
|
-
// Item was removed
|
|
77
|
-
diffs.push({
|
|
78
|
-
type: "REMOVE",
|
|
79
|
-
path: newPath,
|
|
80
|
-
oldValue: oldVal[i]
|
|
81
|
-
});
|
|
82
|
-
} else {
|
|
83
|
-
// Item exists in both, compare values
|
|
84
|
-
compareValues(oldVal[i], newVal[i], newPath, diffs);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
// Values are different types or primitives
|
|
89
|
-
else if (oldVal !== newVal) {
|
|
90
|
-
diffs.push({
|
|
91
|
-
type: "CHANGE",
|
|
92
|
-
path,
|
|
93
|
-
oldValue: oldVal,
|
|
94
|
-
value: newVal
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Generate a comprehensive diff between two objects or values
|
|
101
|
-
*
|
|
102
|
-
* This function performs a deep comparison between two values and returns
|
|
103
|
-
* a detailed list of all differences, including additions, removals, and changes.
|
|
104
|
-
* Each difference includes the exact path where the change occurred.
|
|
105
|
-
*
|
|
106
|
-
* @param oldObj - The original object/value to compare from
|
|
107
|
-
* @param newObj - The new object/value to compare to
|
|
108
|
-
* @returns Array of DiffItem objects describing all differences
|
|
109
|
-
*
|
|
110
|
-
* @example
|
|
111
|
-
* ```typescript
|
|
112
|
-
* const oldData = { user: { name: "John", age: 30 }, items: [1, 2] };
|
|
113
|
-
* const newData = { user: { name: "Jane", age: 30 }, items: [1, 2, 3] };
|
|
114
|
-
*
|
|
115
|
-
* const diffs = objectDiff(oldData, newData);
|
|
116
|
-
* // Returns:
|
|
117
|
-
* // [
|
|
118
|
-
* // { type: "CHANGE", path: ["user", "name"], oldValue: "John", value: "Jane" },
|
|
119
|
-
* // { type: "CREATE", path: ["items", 2], value: 3 }
|
|
120
|
-
* // ]
|
|
121
|
-
* ```
|
|
122
|
-
*
|
|
123
|
-
* @performance Handles circular references and deep nesting efficiently
|
|
124
|
-
* @performance Uses Set for key deduplication to optimize comparison speed
|
|
125
|
-
*/
|
|
126
|
-
export function objectDiff(oldObj, newObj) {
|
|
127
|
-
const diffs = [];
|
|
128
|
-
|
|
129
|
-
// Handle null/undefined cases
|
|
130
|
-
if (oldObj === newObj) {
|
|
131
|
-
return diffs;
|
|
132
|
-
}
|
|
133
|
-
if (oldObj === null || oldObj === undefined) {
|
|
134
|
-
if (newObj !== null && newObj !== undefined) {
|
|
135
|
-
diffs.push({
|
|
136
|
-
type: "CREATE",
|
|
137
|
-
path: [],
|
|
138
|
-
value: newObj
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
return diffs;
|
|
142
|
-
}
|
|
143
|
-
if (newObj === null || newObj === undefined) {
|
|
144
|
-
diffs.push({
|
|
145
|
-
type: "REMOVE",
|
|
146
|
-
path: [],
|
|
147
|
-
oldValue: oldObj
|
|
148
|
-
});
|
|
149
|
-
return diffs;
|
|
150
|
-
}
|
|
151
|
-
compareValues(oldObj, newObj, [], diffs);
|
|
152
|
-
return diffs;
|
|
153
|
-
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Safe AsyncStorage wrapper that handles missing dependencies gracefully.
|
|
5
|
-
*
|
|
6
|
-
* This wrapper allows the storage dev tools to work even when
|
|
7
|
-
* @react-native-async-storage/async-storage is not installed in the host app.
|
|
8
|
-
*
|
|
9
|
-
* When AsyncStorage is not available:
|
|
10
|
-
* - All operations return empty results or no-ops
|
|
11
|
-
* - No errors are thrown
|
|
12
|
-
* - The dev tools can still load (but storage features will be limited)
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
let AsyncStorage = null;
|
|
16
|
-
let isAvailable = false;
|
|
17
|
-
let checkedAvailability = false;
|
|
18
|
-
let checkError = null;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Check if AsyncStorage is available in the host app
|
|
22
|
-
* This handles three cases:
|
|
23
|
-
* 1. Package not installed (module not found)
|
|
24
|
-
* 2. Package installed but native module not linked (native module null)
|
|
25
|
-
* 3. Package installed and working
|
|
26
|
-
*/
|
|
27
|
-
function checkAsyncStorageAvailability() {
|
|
28
|
-
if (checkedAvailability) {
|
|
29
|
-
return isAvailable;
|
|
30
|
-
}
|
|
31
|
-
try {
|
|
32
|
-
// Attempt to require AsyncStorage
|
|
33
|
-
// This might throw if:
|
|
34
|
-
// - Package is not installed (module not found)
|
|
35
|
-
// - Native module is not linked (RCTAsyncStorage is null)
|
|
36
|
-
const AsyncStorageModule = require("@react-native-async-storage/async-storage");
|
|
37
|
-
AsyncStorage = AsyncStorageModule?.default || AsyncStorageModule;
|
|
38
|
-
|
|
39
|
-
// Verify it's actually usable (has the methods we need)
|
|
40
|
-
if (AsyncStorage && typeof AsyncStorage.getItem === "function") {
|
|
41
|
-
isAvailable = true;
|
|
42
|
-
} else {
|
|
43
|
-
isAvailable = false;
|
|
44
|
-
AsyncStorage = null;
|
|
45
|
-
}
|
|
46
|
-
} catch (error) {
|
|
47
|
-
// Catch ALL errors:
|
|
48
|
-
// - Module not found (package not installed)
|
|
49
|
-
// - Native module errors (package installed but native not linked)
|
|
50
|
-
// - Any other initialization errors
|
|
51
|
-
checkError = error;
|
|
52
|
-
isAvailable = false;
|
|
53
|
-
AsyncStorage = null;
|
|
54
|
-
}
|
|
55
|
-
checkedAvailability = true;
|
|
56
|
-
return isAvailable;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Returns true if AsyncStorage is available in the host app
|
|
61
|
-
*/
|
|
62
|
-
export function isAsyncStorageAvailable() {
|
|
63
|
-
return checkAsyncStorageAvailability();
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* No-op AsyncStorage implementation for when the package is not installed
|
|
68
|
-
*/
|
|
69
|
-
const noOpAsyncStorage = {
|
|
70
|
-
getItem: async _key => null,
|
|
71
|
-
setItem: async (_key, _value) => {},
|
|
72
|
-
removeItem: async _key => {},
|
|
73
|
-
getAllKeys: async () => [],
|
|
74
|
-
multiGet: async _keys => [],
|
|
75
|
-
multiSet: async _keyValuePairs => {},
|
|
76
|
-
multiRemove: async _keys => {},
|
|
77
|
-
clear: async () => {},
|
|
78
|
-
mergeItem: async (_key, _value) => {},
|
|
79
|
-
multiMerge: async _keyValuePairs => {}
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Safe AsyncStorage wrapper that provides no-op fallbacks when unavailable.
|
|
84
|
-
*
|
|
85
|
-
* Usage:
|
|
86
|
-
* ```ts
|
|
87
|
-
* import { safeAsyncStorage } from './utils/safeAsyncStorage';
|
|
88
|
-
*
|
|
89
|
-
* // This will work even if AsyncStorage is not installed
|
|
90
|
-
* const value = await safeAsyncStorage.getItem('myKey');
|
|
91
|
-
* ```
|
|
92
|
-
*/
|
|
93
|
-
export const safeAsyncStorage = new Proxy(noOpAsyncStorage, {
|
|
94
|
-
get(_target, prop) {
|
|
95
|
-
// Avoid triggering check for React internal properties or symbols
|
|
96
|
-
if (typeof prop === "symbol" || prop.startsWith("_") || prop.startsWith("$$")) {
|
|
97
|
-
return noOpAsyncStorage[prop];
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Only check availability when actually accessing AsyncStorage methods
|
|
101
|
-
try {
|
|
102
|
-
checkAsyncStorageAvailability();
|
|
103
|
-
if (isAvailable && AsyncStorage) {
|
|
104
|
-
return AsyncStorage[prop];
|
|
105
|
-
}
|
|
106
|
-
} catch (error) {
|
|
107
|
-
// If check throws for any reason, fall back to no-op
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// Return no-op implementation
|
|
111
|
-
return noOpAsyncStorage[prop];
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Get the actual AsyncStorage instance if available, or null if not.
|
|
117
|
-
* Use this when you need to check if AsyncStorage is available before using it.
|
|
118
|
-
*
|
|
119
|
-
* @example
|
|
120
|
-
* ```ts
|
|
121
|
-
* const storage = getAsyncStorageInstance();
|
|
122
|
-
* if (storage) {
|
|
123
|
-
* // AsyncStorage is available
|
|
124
|
-
* await storage.setItem('key', 'value');
|
|
125
|
-
* } else {
|
|
126
|
-
* // AsyncStorage is not available, handle gracefully
|
|
127
|
-
* console.warn('AsyncStorage not available');
|
|
128
|
-
* }
|
|
129
|
-
* ```
|
|
130
|
-
*/
|
|
131
|
-
export function getAsyncStorageInstance() {
|
|
132
|
-
checkAsyncStorageAvailability();
|
|
133
|
-
return isAvailable ? AsyncStorage : null;
|
|
134
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { StorageKeyStats } from "../types";
|
|
2
|
-
interface GameUIStorageStatsProps {
|
|
3
|
-
stats: StorageKeyStats;
|
|
4
|
-
}
|
|
5
|
-
export declare function GameUIStorageStats({ stats }: GameUIStorageStatsProps): import("react").JSX.Element;
|
|
6
|
-
export {};
|
|
7
|
-
//# sourceMappingURL=GameUIStorageStats.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GameUIStorageStats.d.ts","sourceRoot":"","sources":["../../../../src/storage/components/GameUIStorageStats.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,UAAU,uBAAuB;IAC/B,KAAK,EAAE,eAAe,CAAC;CACxB;AAgFD,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,EAAE,uBAAuB,+BAwVpE"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { StorageKeyInfo } from "../types";
|
|
2
|
-
interface StorageActionsProps {
|
|
3
|
-
storageKeys: StorageKeyInfo[];
|
|
4
|
-
onClearAll: () => Promise<void>;
|
|
5
|
-
onRefresh: () => Promise<void>;
|
|
6
|
-
totalCount: number;
|
|
7
|
-
}
|
|
8
|
-
export declare function StorageActions({ storageKeys, onClearAll, onRefresh, totalCount, }: StorageActionsProps): import("react").JSX.Element;
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=StorageActions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StorageActions.d.ts","sourceRoot":"","sources":["../../../../src/storage/components/StorageActions.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAK1C,UAAU,mBAAmB;IAC3B,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,cAAc,CAAC,EAC7B,WAAW,EACX,UAAU,EACV,SAAS,EACT,UAAU,GACX,EAAE,mBAAmB,+BAwHrB"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Storage event listener component for monitoring AsyncStorage and MMKV operations
|
|
3
|
-
* Follows the Sentry component pattern for consistency
|
|
4
|
-
*/
|
|
5
|
-
export declare function StorageEventListener(): import("react").JSX.Element | null;
|
|
6
|
-
//# sourceMappingURL=StorageEventListener.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StorageEventListener.d.ts","sourceRoot":"","sources":["../../../../src/storage/components/StorageEventListener.tsx"],"names":[],"mappings":"AA2CA;;;GAGG;AACH,wBAAgB,oBAAoB,uCA2OnC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
interface StorageFilterViewV2Props {
|
|
2
|
-
ignoredPatterns: Set<string>;
|
|
3
|
-
onTogglePattern: (pattern: string) => void;
|
|
4
|
-
onAddPattern: (pattern: string) => void;
|
|
5
|
-
availableKeys?: string[];
|
|
6
|
-
}
|
|
7
|
-
export declare function StorageFilterViewV2({ ignoredPatterns, onTogglePattern, onAddPattern, availableKeys, }: StorageFilterViewV2Props): import("react").JSX.Element;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=StorageFilterViewV2.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StorageFilterViewV2.d.ts","sourceRoot":"","sources":["../../../../src/storage/components/StorageFilterViewV2.tsx"],"names":[],"mappings":"AAMA,UAAU,wBAAwB;IAChC,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,wBAAgB,mBAAmB,CAAC,EAClC,eAAe,EACf,eAAe,EACf,YAAY,EACZ,aAAkB,GACnB,EAAE,wBAAwB,+BAkC1B"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Measure a container's width, for the layouts that switch between a card list
|
|
3
|
-
* and a wide table.
|
|
4
|
-
*
|
|
5
|
-
* Three things went wrong before this landed on a callback ref; all three are
|
|
6
|
-
* worth knowing, because the same trap is waiting in any other tool that wants
|
|
7
|
-
* a width-driven layout.
|
|
8
|
-
*
|
|
9
|
-
* 1. `onLayout` ALONE IS NOT ENOUGH. On react-native-web it never delivered its
|
|
10
|
-
* first callback for these subtrees. The node carries RNW's
|
|
11
|
-
* `__reactLayoutHandler`, and a ResizeObserver attached by hand fires on that
|
|
12
|
-
* very same node — so the handler is wired and the observer works; RNW's
|
|
13
|
-
* shared observer just never calls it. `width` stayed 0 and the table never
|
|
14
|
-
* appeared, silently. `onLayout` is still wired here because it works on
|
|
15
|
-
* native.
|
|
16
|
-
*
|
|
17
|
-
* 2. RE-MEASURING EVERY RENDER DEADLOCKS THE RENDERER. Filtering a list changes
|
|
18
|
-
* whether its scrollbar is present, which changes the container width, which
|
|
19
|
-
* re-renders, which re-measures — with no fixed point. An observer only fires
|
|
20
|
-
* when the size genuinely changes, so layout settles.
|
|
21
|
-
*
|
|
22
|
-
* 3. A MOUNT-ONLY EFFECT MISSES THE NODE. These components early-return a
|
|
23
|
-
* loading state before the measured container exists, so `ref.current` is
|
|
24
|
-
* null when a `useEffect(…, [])` runs, and it never runs again. A callback
|
|
25
|
-
* ref fires whenever the node actually attaches — including the second time.
|
|
26
|
-
*/
|
|
27
|
-
import type { LayoutChangeEvent } from "react-native";
|
|
28
|
-
export interface MeasuredWidth {
|
|
29
|
-
/** Attach to the container whose width decides the layout. */
|
|
30
|
-
ref: (node: unknown) => void;
|
|
31
|
-
/** 0 until the first measurement lands. */
|
|
32
|
-
width: number;
|
|
33
|
-
/** Attach alongside `ref` — this is the native path. */
|
|
34
|
-
onLayout: (event: LayoutChangeEvent) => void;
|
|
35
|
-
}
|
|
36
|
-
export declare function useMeasuredWidth(): MeasuredWidth;
|
|
37
|
-
//# sourceMappingURL=useMeasuredWidth.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMeasuredWidth.d.ts","sourceRoot":"","sources":["../../../../src/storage/hooks/useMeasuredWidth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AA0BtD,MAAM,WAAW,aAAa;IAC5B,8DAA8D;IAC9D,GAAG,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7B,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC9C;AAED,wBAAgB,gBAAgB,IAAI,aAAa,CAuChD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTickEverySecond.d.ts","sourceRoot":"","sources":["../../../../src/storage/hooks/useTickEverySecond.tsx"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,OAAc,QAYzD"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export { StorageSection } from "./components/StorageSection";
|
|
2
|
-
export { StorageModalWithTabs } from "./components/StorageModalWithTabs";
|
|
3
|
-
export { StorageKeyCard } from "./components/StorageKeyCard";
|
|
4
|
-
export { StorageKeyStatsSection } from "./components/StorageKeyStats";
|
|
5
|
-
export { StorageKeySection } from "./components/StorageKeySection";
|
|
6
|
-
export { StorageBrowserMode } from "./components/StorageBrowserMode";
|
|
7
|
-
export type { StorageFilterType, StorageTypeFilter, } from "./components/StorageFilterCards";
|
|
8
|
-
export { StorageEventsSection } from "./components/StorageEventsSection";
|
|
9
|
-
export { STORAGE_OPS, storageOpOf, storageOpDot, isInitialScan, type StorageOp, } from "./utils/storageOps";
|
|
10
|
-
export { StorageEventCard, getValueType, type StorageEventCardData, type StorageValueType } from "./components/StorageEventCard";
|
|
11
|
-
export { StorageEventDetailContent, StorageEventDetailFooter } from "./components/StorageEventDetailContent";
|
|
12
|
-
export { useAsyncStorageKeys } from "./hooks/useAsyncStorageKeys";
|
|
13
|
-
export { useMMKVKeys, useMultiMMKVKeys } from "./hooks/useMMKVKeys";
|
|
14
|
-
export { useMMKVInstances, useMMKVInstance, useMMKVInstanceExists } from "./hooks/useMMKVInstances";
|
|
15
|
-
export { useStorageEvents, type UseStorageEventsOptions, type UseStorageEventsResult } from "./hooks/useStorageEvents";
|
|
16
|
-
export { MMKVInstanceSelector } from "./components/MMKVInstanceSelector";
|
|
17
|
-
export { MMKVInstanceInfoPanel } from "./components/MMKVInstanceInfoPanel";
|
|
18
|
-
export * from "./types";
|
|
19
|
-
export * from "./utils";
|
|
20
|
-
export { storageEventStore, subscribeToStorageEvents, onStorageEvent, getStorageEvents, clearStorageEvents, isStorageCapturing, type StorageEvent, type StorageEventListener, type StorageEventCallback, } from "./stores/storageEventStore";
|
|
21
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,YAAY,EACV,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAGzE,OAAO,EACL,WAAW,EACX,WAAW,EACX,YAAY,EACZ,aAAa,EACb,KAAK,SAAS,GACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,KAAK,oBAAoB,EAAE,KAAK,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjI,OAAO,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAG7G,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACpG,OAAO,EAAE,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,KAAK,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGvH,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAG3E,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC;AAGxB,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { clearAllAppStorage } from "./clearAllStorage";
|
|
2
|
-
export { isMMKVAvailable, getMMKVClass, getMMKVUnavailableMessage, } from "./mmkvAvailability";
|
|
3
|
-
export { startListening, stopListening, addListener, removeAllListeners, isListening, getListenerCount, pauseCapture, resumeCapture, isPaused, type AsyncStorageEvent, type AsyncStorageEventListener, } from "./AsyncStorageListener";
|
|
4
|
-
export { default as asyncStorageListener } from "./AsyncStorageListener";
|
|
5
|
-
export { undoOperation, jumpToState, canUndo, } from "./storageTimeTravelUtils";
|
|
6
|
-
export { registerMMKVInstance, unregisterMMKVInstance, mmkvInstanceRegistry, type MMKVInstanceInfo, } from "./MMKVInstanceRegistry";
|
|
7
|
-
export { addMMKVInstance, removeMMKVInstance, removeAllMMKVInstances, addMMKVListener, removeAllMMKVListeners, isMMKVInstanceMonitored, getMonitoredMMKVInstances, getMMKVInstanceCount, getMMKVListenerCount, isMMKVListening, mmkvListener, type MMKVEvent, type MMKVEventListener, } from "./MMKVListener";
|
|
8
|
-
export { onStorageBrowserRefresh, requestStorageBrowserRefresh, } from "./storageBrowserRefresh";
|
|
9
|
-
export { detectMMKVType, formatMMKVValue, isTypeMatch, type MMKVValueType, type MMKVValueInfo, } from "./mmkvTypeDetection";
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGvD,OAAO,EACL,eAAe,EACf,YAAY,EACZ,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,cAAc,EACd,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,GAC/B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGzE,OAAO,EACL,aAAa,EACb,WAAW,EACX,OAAO,GACR,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,gBAAgB,GACtB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,iBAAiB,GACvB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,cAAc,EACd,eAAe,EACf,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export interface DiffItem {
|
|
2
|
-
type: "CREATE" | "REMOVE" | "CHANGE";
|
|
3
|
-
path: (string | number)[];
|
|
4
|
-
value?: unknown;
|
|
5
|
-
oldValue?: unknown;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Generate a comprehensive diff between two objects or values
|
|
9
|
-
*
|
|
10
|
-
* This function performs a deep comparison between two values and returns
|
|
11
|
-
* a detailed list of all differences, including additions, removals, and changes.
|
|
12
|
-
* Each difference includes the exact path where the change occurred.
|
|
13
|
-
*
|
|
14
|
-
* @param oldObj - The original object/value to compare from
|
|
15
|
-
* @param newObj - The new object/value to compare to
|
|
16
|
-
* @returns Array of DiffItem objects describing all differences
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```typescript
|
|
20
|
-
* const oldData = { user: { name: "John", age: 30 }, items: [1, 2] };
|
|
21
|
-
* const newData = { user: { name: "Jane", age: 30 }, items: [1, 2, 3] };
|
|
22
|
-
*
|
|
23
|
-
* const diffs = objectDiff(oldData, newData);
|
|
24
|
-
* // Returns:
|
|
25
|
-
* // [
|
|
26
|
-
* // { type: "CHANGE", path: ["user", "name"], oldValue: "John", value: "Jane" },
|
|
27
|
-
* // { type: "CREATE", path: ["items", 2], value: 3 }
|
|
28
|
-
* // ]
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* @performance Handles circular references and deep nesting efficiently
|
|
32
|
-
* @performance Uses Set for key deduplication to optimize comparison speed
|
|
33
|
-
*/
|
|
34
|
-
export declare function objectDiff(oldObj: unknown, newObj: unknown): DiffItem[];
|
|
35
|
-
//# sourceMappingURL=objectDiff.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"objectDiff.d.ts","sourceRoot":"","sources":["../../../../src/storage/utils/objectDiff.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACrC,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA2GD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,QAAQ,EAAE,CA+BvE"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Safe AsyncStorage wrapper that handles missing dependencies gracefully.
|
|
3
|
-
*
|
|
4
|
-
* This wrapper allows the storage dev tools to work even when
|
|
5
|
-
* @react-native-async-storage/async-storage is not installed in the host app.
|
|
6
|
-
*
|
|
7
|
-
* When AsyncStorage is not available:
|
|
8
|
-
* - All operations return empty results or no-ops
|
|
9
|
-
* - No errors are thrown
|
|
10
|
-
* - The dev tools can still load (but storage features will be limited)
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Returns true if AsyncStorage is available in the host app
|
|
14
|
-
*/
|
|
15
|
-
export declare function isAsyncStorageAvailable(): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Safe AsyncStorage wrapper that provides no-op fallbacks when unavailable.
|
|
18
|
-
*
|
|
19
|
-
* Usage:
|
|
20
|
-
* ```ts
|
|
21
|
-
* import { safeAsyncStorage } from './utils/safeAsyncStorage';
|
|
22
|
-
*
|
|
23
|
-
* // This will work even if AsyncStorage is not installed
|
|
24
|
-
* const value = await safeAsyncStorage.getItem('myKey');
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export declare const safeAsyncStorage: {
|
|
28
|
-
getItem: (_key: string) => Promise<string | null>;
|
|
29
|
-
setItem: (_key: string, _value: string) => Promise<void>;
|
|
30
|
-
removeItem: (_key: string) => Promise<void>;
|
|
31
|
-
getAllKeys: () => Promise<string[]>;
|
|
32
|
-
multiGet: (_keys: string[]) => Promise<[string, string | null][]>;
|
|
33
|
-
multiSet: (_keyValuePairs: [string, string][]) => Promise<void>;
|
|
34
|
-
multiRemove: (_keys: string[]) => Promise<void>;
|
|
35
|
-
clear: () => Promise<void>;
|
|
36
|
-
mergeItem: (_key: string, _value: string) => Promise<void>;
|
|
37
|
-
multiMerge: (_keyValuePairs: [string, string][]) => Promise<void>;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Get the actual AsyncStorage instance if available, or null if not.
|
|
41
|
-
* Use this when you need to check if AsyncStorage is available before using it.
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```ts
|
|
45
|
-
* const storage = getAsyncStorageInstance();
|
|
46
|
-
* if (storage) {
|
|
47
|
-
* // AsyncStorage is available
|
|
48
|
-
* await storage.setItem('key', 'value');
|
|
49
|
-
* } else {
|
|
50
|
-
* // AsyncStorage is not available, handle gracefully
|
|
51
|
-
* console.warn('AsyncStorage not available');
|
|
52
|
-
* }
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
export declare function getAsyncStorageInstance(): any | null;
|
|
56
|
-
//# sourceMappingURL=safeAsyncStorage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"safeAsyncStorage.d.ts","sourceRoot":"","sources":["../../../../src/storage/utils/safeAsyncStorage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAgDH;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,OAAO,CAEjD;AAkBD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB;oBAvBL,MAAM,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;oBAC/B,MAAM,UAAU,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;uBACnC,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;sBACzB,OAAO,CAAC,MAAM,EAAE,CAAC;sBACf,MAAM,EAAE,KAAG,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;+BACpC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,KAAG,OAAO,CAAC,IAAI,CAAC;yBACxC,MAAM,EAAE,KAAG,OAAO,CAAC,IAAI,CAAC;iBAClC,OAAO,CAAC,IAAI,CAAC;sBACN,MAAM,UAAU,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;iCAC3B,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,KAAG,OAAO,CAAC,IAAI,CAAC;CAmCrE,CAAC;AAEH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,IAAI,GAAG,GAAG,IAAI,CAGpD"}
|