@buoy-gg/shared-ui 1.7.8 → 2.1.2
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/dataViewer/VirtualizedDataExplorer.js +20 -23
- package/lib/commonjs/hooks/safe-area-impl.js +1 -1
- package/lib/commonjs/hooks/useSafeAreaInsets.js +1 -22
- package/lib/commonjs/index.js +0 -42
- package/lib/commonjs/license/DeviceLimitModal.js +479 -0
- package/lib/commonjs/license/FeatureGate.js +4 -9
- package/lib/commonjs/license/LicenseEntryModal.js +205 -770
- package/lib/commonjs/license/index.js +0 -7
- 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/PowerToggleButton.js +73 -0
- package/lib/commonjs/ui/components/index.js +20 -0
- package/lib/commonjs/utils/index.js +0 -31
- package/lib/module/JsModal.js +34 -9
- package/lib/module/clipboard/clipboard-impl.js +1 -1
- package/lib/module/dataViewer/VirtualizedDataExplorer.js +20 -23
- package/lib/module/hooks/safe-area-impl.js +1 -1
- package/lib/module/hooks/useSafeAreaInsets.js +0 -20
- package/lib/module/index.js +2 -4
- package/lib/module/license/DeviceLimitModal.js +473 -0
- package/lib/module/license/FeatureGate.js +4 -9
- package/lib/module/license/LicenseEntryModal.js +209 -773
- package/lib/module/license/index.js +0 -1
- 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/PowerToggleButton.js +69 -0
- package/lib/module/ui/components/index.js +2 -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/dataViewer/VirtualizedDataExplorer.d.ts.map +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 +3 -3
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/DeviceLimitModal.d.ts +23 -0
- package/lib/typescript/commonjs/license/DeviceLimitModal.d.ts.map +1 -0
- package/lib/typescript/commonjs/license/FeatureGate.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/LicenseEntryModal.d.ts +10 -62
- package/lib/typescript/commonjs/license/LicenseEntryModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/index.d.ts +0 -2
- package/lib/typescript/commonjs/license/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/PowerToggleButton.d.ts +32 -0
- package/lib/typescript/commonjs/ui/components/PowerToggleButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/index.d.ts +4 -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/dataViewer/VirtualizedDataExplorer.d.ts.map +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 +3 -3
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/license/DeviceLimitModal.d.ts +23 -0
- package/lib/typescript/module/license/DeviceLimitModal.d.ts.map +1 -0
- package/lib/typescript/module/license/FeatureGate.d.ts.map +1 -1
- package/lib/typescript/module/license/LicenseEntryModal.d.ts +10 -62
- package/lib/typescript/module/license/LicenseEntryModal.d.ts.map +1 -1
- package/lib/typescript/module/license/index.d.ts +0 -2
- package/lib/typescript/module/license/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/PowerToggleButton.d.ts +32 -0
- package/lib/typescript/module/ui/components/PowerToggleButton.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/index.d.ts +4 -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
|
@@ -15,12 +15,6 @@ Object.defineProperty(exports, "LicenseEntryModal", {
|
|
|
15
15
|
return _LicenseEntryModal.LicenseEntryModal;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
Object.defineProperty(exports, "ManageDevicesModal", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _ManageDevicesModal.ManageDevicesModal;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
18
|
Object.defineProperty(exports, "ProBadge", {
|
|
25
19
|
enumerable: true,
|
|
26
20
|
get: function () {
|
|
@@ -61,7 +55,6 @@ Object.defineProperty(exports, "useFeatureGate", {
|
|
|
61
55
|
});
|
|
62
56
|
var _FeatureGate = require("./FeatureGate.js");
|
|
63
57
|
var _LicenseEntryModal = require("./LicenseEntryModal.js");
|
|
64
|
-
var _ManageDevicesModal = require("./ManageDevicesModal.js");
|
|
65
58
|
// Centralized lazy loading for license hooks to avoid duplication across packages
|
|
66
59
|
// This is the SINGLE source of truth - all packages should import from here
|
|
67
60
|
let _useIsPro = null;
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PowerToggleButton = PowerToggleButton;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _index = require("../../icons/index.js");
|
|
9
|
+
var _macOSDesignSystemColors = require("../gameUI/constants/macOSDesignSystemColors.js");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
/**
|
|
12
|
+
* PowerToggleButton Component
|
|
13
|
+
*
|
|
14
|
+
* A reusable power button for toggling capture/recording state across dev tools.
|
|
15
|
+
* Displays green when enabled, red when disabled.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Power toggle button used across dev tools for start/stop functionality.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <PowerToggleButton
|
|
24
|
+
* isEnabled={isRecording}
|
|
25
|
+
* onToggle={() => setIsRecording(!isRecording)}
|
|
26
|
+
* accessibilityLabel="Toggle network recording"
|
|
27
|
+
* />
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
function PowerToggleButton({
|
|
31
|
+
isEnabled,
|
|
32
|
+
onToggle,
|
|
33
|
+
size = "medium",
|
|
34
|
+
accessibilityLabel,
|
|
35
|
+
disabled = false
|
|
36
|
+
}) {
|
|
37
|
+
const buttonSize = size === "small" ? 28 : 32;
|
|
38
|
+
const iconSize = size === "small" ? 12 : 14;
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
40
|
+
onPress: onToggle,
|
|
41
|
+
disabled: disabled,
|
|
42
|
+
accessibilityLabel: accessibilityLabel,
|
|
43
|
+
accessibilityRole: "button",
|
|
44
|
+
style: [styles.button, {
|
|
45
|
+
width: buttonSize,
|
|
46
|
+
height: buttonSize
|
|
47
|
+
}, isEnabled ? styles.enabledButton : styles.disabledButton, disabled && styles.buttonDisabled],
|
|
48
|
+
activeOpacity: 0.7,
|
|
49
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Power, {
|
|
50
|
+
size: iconSize,
|
|
51
|
+
color: isEnabled ? _macOSDesignSystemColors.macOSColors.semantic.success : _macOSDesignSystemColors.macOSColors.semantic.error
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
const styles = _reactNative.StyleSheet.create({
|
|
56
|
+
button: {
|
|
57
|
+
borderRadius: 8,
|
|
58
|
+
borderWidth: 1,
|
|
59
|
+
alignItems: "center",
|
|
60
|
+
justifyContent: "center"
|
|
61
|
+
},
|
|
62
|
+
enabledButton: {
|
|
63
|
+
backgroundColor: _macOSDesignSystemColors.macOSColors.semantic.successBackground,
|
|
64
|
+
borderColor: _macOSDesignSystemColors.macOSColors.semantic.success + "40"
|
|
65
|
+
},
|
|
66
|
+
disabledButton: {
|
|
67
|
+
backgroundColor: _macOSDesignSystemColors.macOSColors.semantic.errorBackground,
|
|
68
|
+
borderColor: _macOSDesignSystemColors.macOSColors.semantic.error + "40"
|
|
69
|
+
},
|
|
70
|
+
buttonDisabled: {
|
|
71
|
+
opacity: 0.55
|
|
72
|
+
}
|
|
73
|
+
});
|
|
@@ -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 () {
|
|
@@ -213,6 +225,12 @@ Object.defineProperty(exports, "NoSearchResultsEmptyState", {
|
|
|
213
225
|
return _EmptyState.NoSearchResultsEmptyState;
|
|
214
226
|
}
|
|
215
227
|
});
|
|
228
|
+
Object.defineProperty(exports, "PowerToggleButton", {
|
|
229
|
+
enumerable: true,
|
|
230
|
+
get: function () {
|
|
231
|
+
return _PowerToggleButton.PowerToggleButton;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
216
234
|
Object.defineProperty(exports, "SearchBar", {
|
|
217
235
|
enumerable: true,
|
|
218
236
|
get: function () {
|
|
@@ -307,6 +325,7 @@ var _TabSelector = require("./TabSelector.js");
|
|
|
307
325
|
var _EventListItem = require("./EventListItem.js");
|
|
308
326
|
var _StatsCard = require("./StatsCard.js");
|
|
309
327
|
var _CompactRow = require("./CompactRow.js");
|
|
328
|
+
var _DevToolsCard = require("./DevToolsCard.js");
|
|
310
329
|
var _HeaderSearchButton = require("./HeaderSearchButton.js");
|
|
311
330
|
var _EmptyState = require("./EmptyState.js");
|
|
312
331
|
var _StatusIndicator = require("./StatusIndicator.js");
|
|
@@ -320,4 +339,5 @@ var _DynamicFilterView = require("./DynamicFilterView.js");
|
|
|
320
339
|
var _WindowControls = require("./WindowControls.js");
|
|
321
340
|
var _EventStepperFooter = require("./EventStepperFooter.js");
|
|
322
341
|
var _ExpandablePopover = require("./ExpandablePopover.js");
|
|
342
|
+
var _PowerToggleButton = require("./PowerToggleButton.js");
|
|
323
343
|
var _index = require("./EventHistoryViewer/index.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,13 +17,13 @@ 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
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
24
|
// ============================================================================
|
|
24
25
|
// CONSTANTS - Modal dimensions and configuration
|
|
25
26
|
// ============================================================================
|
|
26
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
27
|
const SCREEN = Dimensions.get("window");
|
|
28
28
|
const MIN_HEIGHT = 100;
|
|
29
29
|
const DEFAULT_HEIGHT = 400;
|
|
@@ -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
|
},
|
|
@@ -727,8 +727,7 @@ const VirtualizedItemComponent = ({
|
|
|
727
727
|
data,
|
|
728
728
|
index,
|
|
729
729
|
onSelect,
|
|
730
|
-
isSelected
|
|
731
|
-
disableCopy = false
|
|
730
|
+
isSelected
|
|
732
731
|
}) => {
|
|
733
732
|
const [isPressed, setIsPressed] = useState(false);
|
|
734
733
|
const [showFullKey, setShowFullKey] = useState(false);
|
|
@@ -751,9 +750,9 @@ const VirtualizedItemComponent = ({
|
|
|
751
750
|
|
|
752
751
|
// Always show full key for better identification
|
|
753
752
|
const displayKey = item.key;
|
|
754
|
-
return /*#__PURE__*/
|
|
753
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
755
754
|
style: [STABLE_STYLES.itemContainer, indentStyle],
|
|
756
|
-
children: /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
755
|
+
children: [/*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
757
756
|
"sentry-label": "ignore devtools data explorer item",
|
|
758
757
|
style: [STABLE_STYLES.itemTouchable, isPressed && STABLE_STYLES.itemTouchablePressed, isSelected && STABLE_STYLES.itemSelected, isLongKey && {
|
|
759
758
|
minHeight: LONG_ITEM_HEIGHT,
|
|
@@ -775,21 +774,12 @@ const VirtualizedItemComponent = ({
|
|
|
775
774
|
style: STABLE_STYLES.labelText,
|
|
776
775
|
numberOfLines: 1,
|
|
777
776
|
children: [item.key, ":"]
|
|
778
|
-
}), item.isExpandable ? /*#__PURE__*/_jsxs(
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
children: [item.valueType, " (", item.childCount, " ", item.childCount === 1 ? "item" : "items", ")"]
|
|
785
|
-
}), item.id === "root" && data && /*#__PURE__*/_jsx(CopyButton, {
|
|
786
|
-
value: data,
|
|
787
|
-
size: 16,
|
|
788
|
-
buttonStyle: {
|
|
789
|
-
marginLeft: 8
|
|
790
|
-
},
|
|
791
|
-
disabled: disableCopy
|
|
792
|
-
})]
|
|
777
|
+
}), item.isExpandable ? /*#__PURE__*/_jsxs(Text, {
|
|
778
|
+
style: [STABLE_STYLES.valueText, {
|
|
779
|
+
color: gameUIColors.secondary
|
|
780
|
+
}],
|
|
781
|
+
numberOfLines: 1,
|
|
782
|
+
children: [item.valueType, " (", item.childCount, " ", item.childCount === 1 ? "item" : "items", ")"]
|
|
793
783
|
}) : /*#__PURE__*/_jsx(Text, {
|
|
794
784
|
style: [STABLE_STYLES.valueText, {
|
|
795
785
|
color
|
|
@@ -798,7 +788,14 @@ const VirtualizedItemComponent = ({
|
|
|
798
788
|
children: formatValue(item.value, item.valueType)
|
|
799
789
|
})]
|
|
800
790
|
})]
|
|
801
|
-
})
|
|
791
|
+
}), item.id === "root" && data !== undefined && data !== null ? /*#__PURE__*/_jsx(CopyButton, {
|
|
792
|
+
value: data,
|
|
793
|
+
size: 16,
|
|
794
|
+
buttonStyle: {
|
|
795
|
+
marginLeft: 8,
|
|
796
|
+
marginRight: 8
|
|
797
|
+
}
|
|
798
|
+
}) : null]
|
|
802
799
|
});
|
|
803
800
|
};
|
|
804
801
|
VirtualizedItemComponent.displayName = "VirtualizedItem";
|
|
@@ -813,7 +810,8 @@ export const VirtualizedDataExplorer = ({
|
|
|
813
810
|
maxDepth = 10,
|
|
814
811
|
rawMode = false,
|
|
815
812
|
initialExpanded = false,
|
|
816
|
-
disableCopy
|
|
813
|
+
// disableCopy is accepted for API compatibility but CopyButton handles Pro gating internally
|
|
814
|
+
disableCopy: _disableCopy = false
|
|
817
815
|
}) => {
|
|
818
816
|
const [isExpanded, setIsExpanded] = useState(rawMode); // Auto-expand in raw mode
|
|
819
817
|
const {
|
|
@@ -879,8 +877,7 @@ export const VirtualizedDataExplorer = ({
|
|
|
879
877
|
onToggleExpanded: toggleExpanded,
|
|
880
878
|
data: data,
|
|
881
879
|
onSelect: setSelectedIndex,
|
|
882
|
-
isSelected: selectedIndex === index
|
|
883
|
-
disableCopy: disableCopy
|
|
880
|
+
isSelected: selectedIndex === index
|
|
884
881
|
});
|
|
885
882
|
|
|
886
883
|
// Uniform row height for crisp guide geometry
|