@buoy-gg/shared-ui 1.7.8 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/JsModal.js +33 -8
- package/lib/commonjs/clipboard/clipboard-impl.js +1 -1
- package/lib/commonjs/hooks/safe-area-impl.js +1 -1
- package/lib/commonjs/hooks/useSafeAreaInsets.js +1 -22
- package/lib/commonjs/index.js +0 -35
- package/lib/commonjs/settings/components/BubbleSettingsSection.js +7 -7
- package/lib/commonjs/storage/devToolsStorageKeys.js +11 -0
- package/lib/commonjs/ui/components/CopyButton.js +3 -5
- package/lib/commonjs/ui/components/DevToolsCard.js +106 -0
- package/lib/commonjs/ui/components/ExpandablePopover.js +6 -6
- package/lib/commonjs/ui/components/index.js +13 -0
- package/lib/commonjs/utils/index.js +0 -31
- package/lib/module/JsModal.js +33 -8
- package/lib/module/clipboard/clipboard-impl.js +1 -1
- package/lib/module/hooks/safe-area-impl.js +1 -1
- package/lib/module/hooks/useSafeAreaInsets.js +0 -20
- package/lib/module/index.js +1 -3
- package/lib/module/settings/components/BubbleSettingsSection.js +7 -7
- package/lib/module/storage/devToolsStorageKeys.js +11 -0
- package/lib/module/ui/components/CopyButton.js +3 -5
- package/lib/module/ui/components/DevToolsCard.js +102 -0
- package/lib/module/ui/components/ExpandablePopover.js +6 -6
- package/lib/module/ui/components/index.js +1 -0
- package/lib/module/utils/index.js +0 -1
- package/lib/typescript/commonjs/JsModal.d.ts +2 -0
- package/lib/typescript/commonjs/JsModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/clipboard/clipboard-impl.d.ts +1 -1
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/commonjs/hooks/useSafeAreaInsets.d.ts +0 -13
- package/lib/typescript/commonjs/hooks/useSafeAreaInsets.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +1 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/storage/devToolsStorageKeys.d.ts +11 -0
- package/lib/typescript/commonjs/storage/devToolsStorageKeys.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/CopyButton.d.ts +0 -2
- package/lib/typescript/commonjs/ui/components/CopyButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/DevToolsCard.d.ts +54 -0
- package/lib/typescript/commonjs/ui/components/DevToolsCard.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/index.d.ts +2 -0
- package/lib/typescript/commonjs/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/index.d.ts +0 -1
- package/lib/typescript/commonjs/utils/index.d.ts.map +1 -1
- package/lib/typescript/module/JsModal.d.ts +2 -0
- package/lib/typescript/module/JsModal.d.ts.map +1 -1
- package/lib/typescript/module/clipboard/clipboard-impl.d.ts +1 -1
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/hooks/useSafeAreaInsets.d.ts +0 -13
- package/lib/typescript/module/hooks/useSafeAreaInsets.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +1 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/storage/devToolsStorageKeys.d.ts +11 -0
- package/lib/typescript/module/storage/devToolsStorageKeys.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/CopyButton.d.ts +0 -2
- package/lib/typescript/module/ui/components/CopyButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/DevToolsCard.d.ts +54 -0
- package/lib/typescript/module/ui/components/DevToolsCard.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/index.d.ts +2 -0
- package/lib/typescript/module/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/module/utils/index.d.ts +0 -1
- package/lib/typescript/module/utils/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/lib/commonjs/utils/safeAsyncStorage.js +0 -71
- package/lib/module/utils/safeAsyncStorage.js +0 -64
- package/lib/typescript/commonjs/utils/safeAsyncStorage.d.ts +0 -35
- package/lib/typescript/commonjs/utils/safeAsyncStorage.d.ts.map +0 -1
- package/lib/typescript/module/utils/safeAsyncStorage.d.ts +0 -35
- package/lib/typescript/module/utils/safeAsyncStorage.d.ts.map +0 -1
package/lib/commonjs/JsModal.js
CHANGED
|
@@ -9,7 +9,7 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _useSafeAreaInsets = require("./hooks/useSafeAreaInsets.js");
|
|
10
10
|
var _index = require("./ui/gameUI/index.js");
|
|
11
11
|
var _index2 = require("./ui/components/index.js");
|
|
12
|
-
var
|
|
12
|
+
var _persistentStorage = require("./utils/persistentStorage.js");
|
|
13
13
|
var _devToolsStorageKeys = require("./storage/devToolsStorageKeys.js");
|
|
14
14
|
var _index3 = require("./context/index.js");
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -58,7 +58,7 @@ class ModalStorage {
|
|
|
58
58
|
static async save(key, value) {
|
|
59
59
|
try {
|
|
60
60
|
this.memoryCache[key] = value;
|
|
61
|
-
await
|
|
61
|
+
await _persistentStorage.persistentStorage.setItem(key, JSON.stringify(value));
|
|
62
62
|
} catch (error) {
|
|
63
63
|
// Failed to save modal state
|
|
64
64
|
}
|
|
@@ -78,7 +78,7 @@ class ModalStorage {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
// Load from storage (AsyncStorage or memory fallback)
|
|
81
|
-
const stored = await
|
|
81
|
+
const stored = await _persistentStorage.persistentStorage.getItem(key);
|
|
82
82
|
if (stored) {
|
|
83
83
|
const parsed = JSON.parse(stored);
|
|
84
84
|
this.memoryCache[key] = parsed;
|
|
@@ -339,7 +339,8 @@ const JsModalComponent = ({
|
|
|
339
339
|
onMinimize,
|
|
340
340
|
minimizeTargetPosition,
|
|
341
341
|
initialModalState,
|
|
342
|
-
zIndex
|
|
342
|
+
zIndex,
|
|
343
|
+
disableScrollWrapper = false
|
|
343
344
|
}) => {
|
|
344
345
|
const insets = (0, _useSafeAreaInsets.useSafeAreaInsets)();
|
|
345
346
|
const [isStateLoaded, setIsStateLoaded] = (0, _react.useState)(!enablePersistence);
|
|
@@ -429,7 +430,7 @@ const JsModalComponent = ({
|
|
|
429
430
|
const loadHintStatus = async () => {
|
|
430
431
|
try {
|
|
431
432
|
const hintKey = _devToolsStorageKeys.devToolsStorageKeys.modal.hintAcknowledged();
|
|
432
|
-
const acknowledged = await
|
|
433
|
+
const acknowledged = await _persistentStorage.persistentStorage.getItem(hintKey);
|
|
433
434
|
if (mounted) {
|
|
434
435
|
// Show hint if not acknowledged yet
|
|
435
436
|
setShowHint(acknowledged !== "true");
|
|
@@ -453,7 +454,7 @@ const JsModalComponent = ({
|
|
|
453
454
|
const handleHintAcknowledge = (0, _react.useCallback)(async () => {
|
|
454
455
|
try {
|
|
455
456
|
const hintKey = _devToolsStorageKeys.devToolsStorageKeys.modal.hintAcknowledged();
|
|
456
|
-
await
|
|
457
|
+
await _persistentStorage.persistentStorage.setItem(hintKey, "true");
|
|
457
458
|
setShowHint(false);
|
|
458
459
|
} catch (error) {
|
|
459
460
|
// Failed to save hint acknowledgment, just hide it locally
|
|
@@ -1101,7 +1102,19 @@ const JsModalComponent = ({
|
|
|
1101
1102
|
})
|
|
1102
1103
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
1103
1104
|
style: [styles.content, customStyles.content],
|
|
1104
|
-
children: [
|
|
1105
|
+
children: [disableScrollWrapper ?
|
|
1106
|
+
/*#__PURE__*/
|
|
1107
|
+
// Render children directly when they manage their own scrolling (FlatList, etc.)
|
|
1108
|
+
(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
1109
|
+
style: {
|
|
1110
|
+
flex: 1,
|
|
1111
|
+
paddingBottom: footerHeight
|
|
1112
|
+
},
|
|
1113
|
+
children: children
|
|
1114
|
+
}) :
|
|
1115
|
+
/*#__PURE__*/
|
|
1116
|
+
// Wrap in ScrollView for content that needs scrolling
|
|
1117
|
+
(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
1105
1118
|
style: {
|
|
1106
1119
|
flex: 1
|
|
1107
1120
|
},
|
|
@@ -1190,7 +1203,19 @@ const JsModalComponent = ({
|
|
|
1190
1203
|
onAcknowledge: handleHintAcknowledge
|
|
1191
1204
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
1192
1205
|
style: [styles.content, customStyles.content],
|
|
1193
|
-
children: [
|
|
1206
|
+
children: [disableScrollWrapper ?
|
|
1207
|
+
/*#__PURE__*/
|
|
1208
|
+
// Render children directly when they manage their own scrolling (FlatList, etc.)
|
|
1209
|
+
(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
1210
|
+
style: {
|
|
1211
|
+
flex: 1,
|
|
1212
|
+
paddingBottom: footerHeight
|
|
1213
|
+
},
|
|
1214
|
+
children: children
|
|
1215
|
+
}) :
|
|
1216
|
+
/*#__PURE__*/
|
|
1217
|
+
// Wrap in ScrollView for content that needs scrolling
|
|
1218
|
+
(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
1194
1219
|
style: {
|
|
1195
1220
|
flex: 1
|
|
1196
1221
|
},
|
|
@@ -7,7 +7,7 @@ exports.isClipboardAvailable = exports.clipboardType = exports.clipboardFunction
|
|
|
7
7
|
/**
|
|
8
8
|
* Auto-generated clipboard implementation
|
|
9
9
|
* Detected: none
|
|
10
|
-
* Generated at: 2026-01-
|
|
10
|
+
* Generated at: 2026-01-12T04:02:16.197Z
|
|
11
11
|
*
|
|
12
12
|
* DO NOT EDIT - This file is generated by scripts/detect-clipboard.js
|
|
13
13
|
*
|
|
@@ -7,7 +7,7 @@ exports.useNativeSafeAreaInsets = exports.safeAreaType = exports.hasSafeAreaPack
|
|
|
7
7
|
/**
|
|
8
8
|
* Auto-generated safe area implementation
|
|
9
9
|
* Detected: none
|
|
10
|
-
* Generated at: 2026-01-
|
|
10
|
+
* Generated at: 2026-01-12T04:02:16.222Z
|
|
11
11
|
*
|
|
12
12
|
* DO NOT EDIT - This file is generated by scripts/detect-safe-area.js
|
|
13
13
|
*
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useSafeAreaInsets = exports.
|
|
6
|
+
exports.useSafeAreaInsets = exports.hasNotch = exports.getSafeAreaInsets = exports.SafeAreaConfig = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _safeAreaImpl = require("./safe-area-impl.js");
|
|
@@ -221,26 +221,6 @@ const SafeAreaConfig = exports.SafeAreaConfig = {
|
|
|
221
221
|
}
|
|
222
222
|
};
|
|
223
223
|
|
|
224
|
-
/**
|
|
225
|
-
* Compatibility hook that returns the window frame dimensions
|
|
226
|
-
*
|
|
227
|
-
* @returns Frame object with x, y, width, height properties
|
|
228
|
-
*
|
|
229
|
-
* @deprecated Use Dimensions.get("window") directly instead
|
|
230
|
-
*/
|
|
231
|
-
const useSafeAreaFrame = () => {
|
|
232
|
-
const {
|
|
233
|
-
width,
|
|
234
|
-
height
|
|
235
|
-
} = _reactNative.Dimensions.get("window");
|
|
236
|
-
return {
|
|
237
|
-
x: 0,
|
|
238
|
-
y: 0,
|
|
239
|
-
width,
|
|
240
|
-
height
|
|
241
|
-
};
|
|
242
|
-
};
|
|
243
|
-
|
|
244
224
|
/**
|
|
245
225
|
* Export the pure JS implementation directly for compatibility
|
|
246
226
|
*
|
|
@@ -252,5 +232,4 @@ const useSafeAreaFrame = () => {
|
|
|
252
232
|
* console.log(`Top inset: ${insets.top}px`);
|
|
253
233
|
* ```
|
|
254
234
|
*/
|
|
255
|
-
exports.useSafeAreaFrame = useSafeAreaFrame;
|
|
256
235
|
const getSafeAreaInsets = exports.getSafeAreaInsets = getPureJSSafeAreaInsets;
|
package/lib/commonjs/index.js
CHANGED
|
@@ -7,11 +7,6 @@ var _exportNames = {
|
|
|
7
7
|
displayValue: true,
|
|
8
8
|
parseDisplayValue: true,
|
|
9
9
|
getSafeAreaInsets: true,
|
|
10
|
-
safeGetItem: true,
|
|
11
|
-
safeSetItem: true,
|
|
12
|
-
safeRemoveItem: true,
|
|
13
|
-
isPersistentStorageAvailable: true,
|
|
14
|
-
useSafeAsyncStorage: true,
|
|
15
10
|
persistentStorage: true,
|
|
16
11
|
isUsingPersistentStorage: true,
|
|
17
12
|
getStorageBackendType: true,
|
|
@@ -252,12 +247,6 @@ Object.defineProperty(exports, "isJsonSerializable", {
|
|
|
252
247
|
return _index2.isJsonSerializable;
|
|
253
248
|
}
|
|
254
249
|
});
|
|
255
|
-
Object.defineProperty(exports, "isPersistentStorageAvailable", {
|
|
256
|
-
enumerable: true,
|
|
257
|
-
get: function () {
|
|
258
|
-
return _index2.isPersistentStorageAvailable;
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
250
|
Object.defineProperty(exports, "isPlainObjectUtil", {
|
|
262
251
|
enumerable: true,
|
|
263
252
|
get: function () {
|
|
@@ -318,24 +307,6 @@ Object.defineProperty(exports, "persistentStorage", {
|
|
|
318
307
|
return _index2.persistentStorage;
|
|
319
308
|
}
|
|
320
309
|
});
|
|
321
|
-
Object.defineProperty(exports, "safeGetItem", {
|
|
322
|
-
enumerable: true,
|
|
323
|
-
get: function () {
|
|
324
|
-
return _index2.safeGetItem;
|
|
325
|
-
}
|
|
326
|
-
});
|
|
327
|
-
Object.defineProperty(exports, "safeRemoveItem", {
|
|
328
|
-
enumerable: true,
|
|
329
|
-
get: function () {
|
|
330
|
-
return _index2.safeRemoveItem;
|
|
331
|
-
}
|
|
332
|
-
});
|
|
333
|
-
Object.defineProperty(exports, "safeSetItem", {
|
|
334
|
-
enumerable: true,
|
|
335
|
-
get: function () {
|
|
336
|
-
return _index2.safeSetItem;
|
|
337
|
-
}
|
|
338
|
-
});
|
|
339
310
|
Object.defineProperty(exports, "safeStringify", {
|
|
340
311
|
enumerable: true,
|
|
341
312
|
get: function () {
|
|
@@ -384,12 +355,6 @@ Object.defineProperty(exports, "useSafeAreaInsets", {
|
|
|
384
355
|
return _index0.useSafeAreaInsets;
|
|
385
356
|
}
|
|
386
357
|
});
|
|
387
|
-
Object.defineProperty(exports, "useSafeAsyncStorage", {
|
|
388
|
-
enumerable: true,
|
|
389
|
-
get: function () {
|
|
390
|
-
return _index2.useSafeAsyncStorage;
|
|
391
|
-
}
|
|
392
|
-
});
|
|
393
358
|
var _index = require("./ui/index.js");
|
|
394
359
|
Object.keys(_index).forEach(function (key) {
|
|
395
360
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -11,7 +11,7 @@ var _index = require("../../icons/index.js");
|
|
|
11
11
|
var _react = require("react");
|
|
12
12
|
var _CyberpunkSectionButton = require("../../ui/console/CyberpunkSectionButton.js");
|
|
13
13
|
var _devToolsStorageKeys = require("../../storage/devToolsStorageKeys.js");
|
|
14
|
-
var
|
|
14
|
+
var _persistentStorage = require("../../utils/persistentStorage.js");
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
const STORAGE_KEY = _devToolsStorageKeys.devToolsStorageKeys.bubble.settings();
|
|
17
17
|
const USER_PREFERENCES_KEY = _devToolsStorageKeys.devToolsStorageKeys.bubble.userPreferences();
|
|
@@ -32,7 +32,7 @@ function BubbleSettingsSection({
|
|
|
32
32
|
}, []);
|
|
33
33
|
const loadSettings = async () => {
|
|
34
34
|
try {
|
|
35
|
-
const stored = await
|
|
35
|
+
const stored = await _persistentStorage.persistentStorage.getItem(STORAGE_KEY);
|
|
36
36
|
if (stored) {
|
|
37
37
|
setSettings(JSON.parse(stored));
|
|
38
38
|
}
|
|
@@ -64,7 +64,7 @@ function BubbleSettingsDetail({
|
|
|
64
64
|
}, []);
|
|
65
65
|
const loadSettings = async () => {
|
|
66
66
|
try {
|
|
67
|
-
const stored = await
|
|
67
|
+
const stored = await _persistentStorage.persistentStorage.getItem(STORAGE_KEY);
|
|
68
68
|
if (stored) {
|
|
69
69
|
setSettings(JSON.parse(stored));
|
|
70
70
|
}
|
|
@@ -76,7 +76,7 @@ function BubbleSettingsDetail({
|
|
|
76
76
|
};
|
|
77
77
|
const saveSettings = async newSettings => {
|
|
78
78
|
try {
|
|
79
|
-
await
|
|
79
|
+
await _persistentStorage.persistentStorage.setItem(STORAGE_KEY, JSON.stringify(newSettings));
|
|
80
80
|
setSettings(newSettings);
|
|
81
81
|
// Trigger the callback to reload settings in the parent
|
|
82
82
|
onSettingsChange?.(newSettings);
|
|
@@ -92,14 +92,14 @@ function BubbleSettingsDetail({
|
|
|
92
92
|
|
|
93
93
|
// Mark this preference as explicitly set by the user
|
|
94
94
|
try {
|
|
95
|
-
const prefsStored = await
|
|
95
|
+
const prefsStored = await _persistentStorage.persistentStorage.getItem(USER_PREFERENCES_KEY);
|
|
96
96
|
const currentPrefs = prefsStored ? JSON.parse(prefsStored) : {};
|
|
97
97
|
const prefKey = key.replace("show", "hasSet");
|
|
98
98
|
const updatedPrefs = {
|
|
99
99
|
...currentPrefs,
|
|
100
100
|
[prefKey]: true
|
|
101
101
|
};
|
|
102
|
-
await
|
|
102
|
+
await _persistentStorage.persistentStorage.setItem(USER_PREFERENCES_KEY, JSON.stringify(updatedPrefs));
|
|
103
103
|
} catch (error) {
|
|
104
104
|
console.error("Failed to save user preference marker:", error);
|
|
105
105
|
}
|
|
@@ -236,7 +236,7 @@ function BubbleSettingsDetail({
|
|
|
236
236
|
}
|
|
237
237
|
async function getBubbleVisibilitySettings() {
|
|
238
238
|
try {
|
|
239
|
-
const stored = await
|
|
239
|
+
const stored = await _persistentStorage.persistentStorage.getItem(STORAGE_KEY);
|
|
240
240
|
if (stored) {
|
|
241
241
|
return JSON.parse(stored);
|
|
242
242
|
}
|
|
@@ -162,6 +162,17 @@ const devToolsStorageKeys = exports.devToolsStorageKeys = {
|
|
|
162
162
|
activeTab: () => `${devToolsStorageKeys.benchmark.root()}_active_tab`,
|
|
163
163
|
settings: () => `${devToolsStorageKeys.benchmark.root()}_settings`,
|
|
164
164
|
selectedReports: () => `${devToolsStorageKeys.benchmark.root()}_selected_reports`
|
|
165
|
+
},
|
|
166
|
+
/**
|
|
167
|
+
* Unified events-related storage keys
|
|
168
|
+
*/
|
|
169
|
+
events: {
|
|
170
|
+
root: () => `${devToolsStorageKeys.base}_events`,
|
|
171
|
+
modal: () => `${devToolsStorageKeys.events.root()}_modal`,
|
|
172
|
+
/** Selected badge/source filters */
|
|
173
|
+
enabledSources: () => `${devToolsStorageKeys.events.root()}_enabled_sources`,
|
|
174
|
+
/** Copy/export settings */
|
|
175
|
+
copySettings: () => `${devToolsStorageKeys.events.root()}_copy_settings`
|
|
165
176
|
}
|
|
166
177
|
};
|
|
167
178
|
|
|
@@ -11,7 +11,7 @@ var _gameUIColors = require("../gameUI/constants/gameUIColors.js");
|
|
|
11
11
|
var _lucideIcons = require("../../icons/lucide-icons.js");
|
|
12
12
|
var _ClipboardHintBanner = require("./ClipboardHintBanner.js");
|
|
13
13
|
var _devToolsStorageKeys = require("../../storage/devToolsStorageKeys.js");
|
|
14
|
-
var
|
|
14
|
+
var _persistentStorage = require("../../utils/persistentStorage.js");
|
|
15
15
|
var _index = require("../../context/index.js");
|
|
16
16
|
var _index2 = require("../../license/index.js");
|
|
17
17
|
var _license = require("@buoy-gg/license");
|
|
@@ -32,7 +32,7 @@ async function loadHintAcknowledged() {
|
|
|
32
32
|
globalHintLoadPromise = (async () => {
|
|
33
33
|
try {
|
|
34
34
|
const hintKey = _devToolsStorageKeys.devToolsStorageKeys.clipboard.hintAcknowledged();
|
|
35
|
-
const acknowledged = await
|
|
35
|
+
const acknowledged = await _persistentStorage.persistentStorage.getItem(hintKey);
|
|
36
36
|
globalHintAcknowledged = acknowledged === "true";
|
|
37
37
|
return globalHintAcknowledged;
|
|
38
38
|
} catch {
|
|
@@ -46,7 +46,7 @@ async function loadHintAcknowledged() {
|
|
|
46
46
|
async function setHintAcknowledged() {
|
|
47
47
|
try {
|
|
48
48
|
const hintKey = _devToolsStorageKeys.devToolsStorageKeys.clipboard.hintAcknowledged();
|
|
49
|
-
await
|
|
49
|
+
await _persistentStorage.persistentStorage.setItem(hintKey, "true");
|
|
50
50
|
globalHintAcknowledged = true;
|
|
51
51
|
} catch {
|
|
52
52
|
// Failed to save, just update local state
|
|
@@ -62,8 +62,6 @@ const CopyButton = exports.CopyButton = /*#__PURE__*/(0, _react.memo)(function C
|
|
|
62
62
|
onCopyError,
|
|
63
63
|
feedbackDuration = 1500,
|
|
64
64
|
colors = {},
|
|
65
|
-
disabled: _deprecated,
|
|
66
|
-
// Ignored - Pro status checked internally
|
|
67
65
|
...touchableProps
|
|
68
66
|
}) {
|
|
69
67
|
const isPro = (0, _license.useIsPro)();
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DEVTOOLS_CARD_CONSTANTS = void 0;
|
|
7
|
+
exports.DevToolsCard = DevToolsCard;
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _gameUIColors = require("../gameUI/constants/gameUIColors.js");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
/**
|
|
12
|
+
* DevToolsCard
|
|
13
|
+
*
|
|
14
|
+
* A unified container component for all DevTools list items.
|
|
15
|
+
* Provides consistent sizing, spacing, and styling across all packages.
|
|
16
|
+
*
|
|
17
|
+
* Usage:
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <DevToolsCard onPress={handlePress} isSelected={selected}>
|
|
20
|
+
* <YourCustomContent />
|
|
21
|
+
* </DevToolsCard>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Standard card dimensions - adjust these to change all DevTools cards globally
|
|
27
|
+
*/
|
|
28
|
+
const DEVTOOLS_CARD_CONSTANTS = exports.DEVTOOLS_CARD_CONSTANTS = {
|
|
29
|
+
/** Horizontal padding inside the card */
|
|
30
|
+
padding: 12,
|
|
31
|
+
/** Horizontal margin between card and screen edge */
|
|
32
|
+
marginHorizontal: 12,
|
|
33
|
+
/** Vertical margin between cards */
|
|
34
|
+
marginVertical: 4,
|
|
35
|
+
/** Card corner radius */
|
|
36
|
+
borderRadius: 8,
|
|
37
|
+
/** Minimum height for touch accessibility (Apple HIG) */
|
|
38
|
+
minHeight: 44,
|
|
39
|
+
/** Border width */
|
|
40
|
+
borderWidth: 1
|
|
41
|
+
};
|
|
42
|
+
function DevToolsCard({
|
|
43
|
+
children,
|
|
44
|
+
onPress,
|
|
45
|
+
onLongPress,
|
|
46
|
+
isSelected = false,
|
|
47
|
+
disabled = false,
|
|
48
|
+
activeOpacity = 0.8,
|
|
49
|
+
style,
|
|
50
|
+
contentStyle,
|
|
51
|
+
testID
|
|
52
|
+
}) {
|
|
53
|
+
const isInteractive = !!onPress || !!onLongPress;
|
|
54
|
+
|
|
55
|
+
// Non-interactive card (just a container)
|
|
56
|
+
if (!isInteractive) {
|
|
57
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
58
|
+
style: [styles.wrapper, style],
|
|
59
|
+
testID: testID,
|
|
60
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
61
|
+
style: [styles.card, isSelected && styles.selectedCard, contentStyle],
|
|
62
|
+
children: children
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Interactive card
|
|
68
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
69
|
+
style: [styles.wrapper, style],
|
|
70
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
71
|
+
style: [styles.card, isSelected && styles.selectedCard, contentStyle],
|
|
72
|
+
onPress: onPress,
|
|
73
|
+
onLongPress: onLongPress,
|
|
74
|
+
activeOpacity: activeOpacity,
|
|
75
|
+
disabled: disabled,
|
|
76
|
+
testID: testID,
|
|
77
|
+
children: children
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
const styles = _reactNative.StyleSheet.create({
|
|
82
|
+
wrapper: {
|
|
83
|
+
marginHorizontal: DEVTOOLS_CARD_CONSTANTS.marginHorizontal,
|
|
84
|
+
marginVertical: DEVTOOLS_CARD_CONSTANTS.marginVertical
|
|
85
|
+
},
|
|
86
|
+
card: {
|
|
87
|
+
backgroundColor: _gameUIColors.buoyColors.card,
|
|
88
|
+
borderRadius: DEVTOOLS_CARD_CONSTANTS.borderRadius,
|
|
89
|
+
borderWidth: DEVTOOLS_CARD_CONSTANTS.borderWidth,
|
|
90
|
+
borderColor: _gameUIColors.buoyColors.border + "40",
|
|
91
|
+
padding: DEVTOOLS_CARD_CONSTANTS.padding,
|
|
92
|
+
minHeight: DEVTOOLS_CARD_CONSTANTS.minHeight
|
|
93
|
+
},
|
|
94
|
+
selectedCard: {
|
|
95
|
+
backgroundColor: _gameUIColors.buoyColors.primary + "15",
|
|
96
|
+
borderColor: _gameUIColors.buoyColors.primary + "50",
|
|
97
|
+
shadowColor: _gameUIColors.buoyColors.primary,
|
|
98
|
+
shadowOffset: {
|
|
99
|
+
width: 0,
|
|
100
|
+
height: 0
|
|
101
|
+
},
|
|
102
|
+
shadowOpacity: 0.1,
|
|
103
|
+
shadowRadius: 8,
|
|
104
|
+
elevation: 2
|
|
105
|
+
}
|
|
106
|
+
});
|
|
@@ -157,9 +157,9 @@ function ExpandablePopover({
|
|
|
157
157
|
try {
|
|
158
158
|
// Dynamic import to avoid circular dependency
|
|
159
159
|
const {
|
|
160
|
-
|
|
161
|
-
} = await Promise.resolve().then(() => _interopRequireWildcard(require("../../utils/
|
|
162
|
-
const saved = await
|
|
160
|
+
persistentStorage
|
|
161
|
+
} = await Promise.resolve().then(() => _interopRequireWildcard(require("../../utils/persistentStorage")));
|
|
162
|
+
const saved = await persistentStorage.getItem(storageKey);
|
|
163
163
|
if (saved === "true") {
|
|
164
164
|
setIsExpanded(true);
|
|
165
165
|
progress.setValue(1);
|
|
@@ -178,9 +178,9 @@ function ExpandablePopover({
|
|
|
178
178
|
const persistExpanded = async () => {
|
|
179
179
|
try {
|
|
180
180
|
const {
|
|
181
|
-
|
|
182
|
-
} = await Promise.resolve().then(() => _interopRequireWildcard(require("../../utils/
|
|
183
|
-
await
|
|
181
|
+
persistentStorage
|
|
182
|
+
} = await Promise.resolve().then(() => _interopRequireWildcard(require("../../utils/persistentStorage")));
|
|
183
|
+
await persistentStorage.setItem(storageKey, isExpanded ? "true" : "false");
|
|
184
184
|
} catch {
|
|
185
185
|
// Ignore errors
|
|
186
186
|
}
|
|
@@ -75,6 +75,12 @@ Object.defineProperty(exports, "CountBadge", {
|
|
|
75
75
|
return _Badge.CountBadge;
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
|
+
Object.defineProperty(exports, "DEVTOOLS_CARD_CONSTANTS", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _DevToolsCard.DEVTOOLS_CARD_CONSTANTS;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
78
84
|
Object.defineProperty(exports, "DataInspector", {
|
|
79
85
|
enumerable: true,
|
|
80
86
|
get: function () {
|
|
@@ -87,6 +93,12 @@ Object.defineProperty(exports, "DetailView", {
|
|
|
87
93
|
return _DetailView.DetailView;
|
|
88
94
|
}
|
|
89
95
|
});
|
|
96
|
+
Object.defineProperty(exports, "DevToolsCard", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _DevToolsCard.DevToolsCard;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
90
102
|
Object.defineProperty(exports, "DiffModeTabs", {
|
|
91
103
|
enumerable: true,
|
|
92
104
|
get: function () {
|
|
@@ -307,6 +319,7 @@ var _TabSelector = require("./TabSelector.js");
|
|
|
307
319
|
var _EventListItem = require("./EventListItem.js");
|
|
308
320
|
var _StatsCard = require("./StatsCard.js");
|
|
309
321
|
var _CompactRow = require("./CompactRow.js");
|
|
322
|
+
var _DevToolsCard = require("./DevToolsCard.js");
|
|
310
323
|
var _HeaderSearchButton = require("./HeaderSearchButton.js");
|
|
311
324
|
var _EmptyState = require("./EmptyState.js");
|
|
312
325
|
var _StatusIndicator = require("./StatusIndicator.js");
|
|
@@ -81,12 +81,6 @@ Object.defineProperty(exports, "isJsonSerializable", {
|
|
|
81
81
|
return _typeHelpers.isJsonSerializable;
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
|
-
Object.defineProperty(exports, "isPersistentStorageAvailable", {
|
|
85
|
-
enumerable: true,
|
|
86
|
-
get: function () {
|
|
87
|
-
return _safeAsyncStorage.isPersistentStorageAvailable;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
84
|
Object.defineProperty(exports, "isPrimitive", {
|
|
91
85
|
enumerable: true,
|
|
92
86
|
get: function () {
|
|
@@ -129,24 +123,6 @@ Object.defineProperty(exports, "persistentStorage", {
|
|
|
129
123
|
return _persistentStorage.persistentStorage;
|
|
130
124
|
}
|
|
131
125
|
});
|
|
132
|
-
Object.defineProperty(exports, "safeGetItem", {
|
|
133
|
-
enumerable: true,
|
|
134
|
-
get: function () {
|
|
135
|
-
return _safeAsyncStorage.safeGetItem;
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
Object.defineProperty(exports, "safeRemoveItem", {
|
|
139
|
-
enumerable: true,
|
|
140
|
-
get: function () {
|
|
141
|
-
return _safeAsyncStorage.safeRemoveItem;
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
Object.defineProperty(exports, "safeSetItem", {
|
|
145
|
-
enumerable: true,
|
|
146
|
-
get: function () {
|
|
147
|
-
return _safeAsyncStorage.safeSetItem;
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
126
|
Object.defineProperty(exports, "safeStringify", {
|
|
151
127
|
enumerable: true,
|
|
152
128
|
get: function () {
|
|
@@ -159,15 +135,8 @@ Object.defineProperty(exports, "truncateText", {
|
|
|
159
135
|
return _valueFormatting.truncateText;
|
|
160
136
|
}
|
|
161
137
|
});
|
|
162
|
-
Object.defineProperty(exports, "useSafeAsyncStorage", {
|
|
163
|
-
enumerable: true,
|
|
164
|
-
get: function () {
|
|
165
|
-
return _safeAsyncStorage.useSafeAsyncStorage;
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
138
|
var _displayValue = require("./displayValue.js");
|
|
169
139
|
var _getSafeAreaInsets = require("./getSafeAreaInsets.js");
|
|
170
|
-
var _safeAsyncStorage = require("./safeAsyncStorage.js");
|
|
171
140
|
var _persistentStorage = require("./persistentStorage.js");
|
|
172
141
|
var _safeStringify = require("./safeStringify.js");
|
|
173
142
|
var _typeHelpers = require("./typeHelpers.js");
|
package/lib/module/JsModal.js
CHANGED
|
@@ -17,7 +17,7 @@ import { View, StyleSheet, TouchableWithoutFeedback, Dimensions, PanResponder, A
|
|
|
17
17
|
import { useSafeAreaInsets } from "./hooks/useSafeAreaInsets.js";
|
|
18
18
|
import { gameUIColors, buoyColors } from "./ui/gameUI/index.js";
|
|
19
19
|
import { DraggableHeader, ModalHintBanner, WindowControls } from "./ui/components/index.js";
|
|
20
|
-
import {
|
|
20
|
+
import { persistentStorage } from "./utils/persistentStorage.js";
|
|
21
21
|
import { devToolsStorageKeys } from "./storage/devToolsStorageKeys.js";
|
|
22
22
|
import { useHintsDisabled } from "./context/index.js";
|
|
23
23
|
// ============================================================================
|
|
@@ -54,7 +54,7 @@ class ModalStorage {
|
|
|
54
54
|
static async save(key, value) {
|
|
55
55
|
try {
|
|
56
56
|
this.memoryCache[key] = value;
|
|
57
|
-
await
|
|
57
|
+
await persistentStorage.setItem(key, JSON.stringify(value));
|
|
58
58
|
} catch (error) {
|
|
59
59
|
// Failed to save modal state
|
|
60
60
|
}
|
|
@@ -74,7 +74,7 @@ class ModalStorage {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
// Load from storage (AsyncStorage or memory fallback)
|
|
77
|
-
const stored = await
|
|
77
|
+
const stored = await persistentStorage.getItem(key);
|
|
78
78
|
if (stored) {
|
|
79
79
|
const parsed = JSON.parse(stored);
|
|
80
80
|
this.memoryCache[key] = parsed;
|
|
@@ -335,7 +335,8 @@ const JsModalComponent = ({
|
|
|
335
335
|
onMinimize,
|
|
336
336
|
minimizeTargetPosition,
|
|
337
337
|
initialModalState,
|
|
338
|
-
zIndex
|
|
338
|
+
zIndex,
|
|
339
|
+
disableScrollWrapper = false
|
|
339
340
|
}) => {
|
|
340
341
|
const insets = useSafeAreaInsets();
|
|
341
342
|
const [isStateLoaded, setIsStateLoaded] = useState(!enablePersistence);
|
|
@@ -425,7 +426,7 @@ const JsModalComponent = ({
|
|
|
425
426
|
const loadHintStatus = async () => {
|
|
426
427
|
try {
|
|
427
428
|
const hintKey = devToolsStorageKeys.modal.hintAcknowledged();
|
|
428
|
-
const acknowledged = await
|
|
429
|
+
const acknowledged = await persistentStorage.getItem(hintKey);
|
|
429
430
|
if (mounted) {
|
|
430
431
|
// Show hint if not acknowledged yet
|
|
431
432
|
setShowHint(acknowledged !== "true");
|
|
@@ -449,7 +450,7 @@ const JsModalComponent = ({
|
|
|
449
450
|
const handleHintAcknowledge = useCallback(async () => {
|
|
450
451
|
try {
|
|
451
452
|
const hintKey = devToolsStorageKeys.modal.hintAcknowledged();
|
|
452
|
-
await
|
|
453
|
+
await persistentStorage.setItem(hintKey, "true");
|
|
453
454
|
setShowHint(false);
|
|
454
455
|
} catch (error) {
|
|
455
456
|
// Failed to save hint acknowledgment, just hide it locally
|
|
@@ -1097,7 +1098,19 @@ const JsModalComponent = ({
|
|
|
1097
1098
|
})
|
|
1098
1099
|
}), /*#__PURE__*/_jsxs(View, {
|
|
1099
1100
|
style: [styles.content, customStyles.content],
|
|
1100
|
-
children: [
|
|
1101
|
+
children: [disableScrollWrapper ?
|
|
1102
|
+
/*#__PURE__*/
|
|
1103
|
+
// Render children directly when they manage their own scrolling (FlatList, etc.)
|
|
1104
|
+
_jsx(View, {
|
|
1105
|
+
style: {
|
|
1106
|
+
flex: 1,
|
|
1107
|
+
paddingBottom: footerHeight
|
|
1108
|
+
},
|
|
1109
|
+
children: children
|
|
1110
|
+
}) :
|
|
1111
|
+
/*#__PURE__*/
|
|
1112
|
+
// Wrap in ScrollView for content that needs scrolling
|
|
1113
|
+
_jsx(ScrollView, {
|
|
1101
1114
|
style: {
|
|
1102
1115
|
flex: 1
|
|
1103
1116
|
},
|
|
@@ -1186,7 +1199,19 @@ const JsModalComponent = ({
|
|
|
1186
1199
|
onAcknowledge: handleHintAcknowledge
|
|
1187
1200
|
}), /*#__PURE__*/_jsxs(View, {
|
|
1188
1201
|
style: [styles.content, customStyles.content],
|
|
1189
|
-
children: [
|
|
1202
|
+
children: [disableScrollWrapper ?
|
|
1203
|
+
/*#__PURE__*/
|
|
1204
|
+
// Render children directly when they manage their own scrolling (FlatList, etc.)
|
|
1205
|
+
_jsx(View, {
|
|
1206
|
+
style: {
|
|
1207
|
+
flex: 1,
|
|
1208
|
+
paddingBottom: footerHeight
|
|
1209
|
+
},
|
|
1210
|
+
children: children
|
|
1211
|
+
}) :
|
|
1212
|
+
/*#__PURE__*/
|
|
1213
|
+
// Wrap in ScrollView for content that needs scrolling
|
|
1214
|
+
_jsx(ScrollView, {
|
|
1190
1215
|
style: {
|
|
1191
1216
|
flex: 1
|
|
1192
1217
|
},
|