@buoy-gg/shared-ui 7.0.7 → 7.0.9
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/hooks/safe-area-impl.js +1 -1
- package/lib/module/hooks/safe-area-impl.js +1 -1
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/package.json +4 -4
- package/lib/commonjs/license/DeviceLimitModal.js +0 -480
- package/lib/commonjs/license/ManageDevicesModal.js +0 -546
- package/lib/commonjs/types/index.js +0 -16
- package/lib/commonjs/ui/components/Divider.js +0 -18
- package/lib/commonjs/ui/components/ErrorBoundary.js +0 -113
- package/lib/commonjs/ui/components/ExpandableSection.js +0 -72
- package/lib/commonjs/ui/components/ExpandableSectionHeader.js +0 -87
- package/lib/commonjs/ui/components/ExpandableSectionWithModal.js +0 -183
- package/lib/commonjs/ui/components/FilterViewPattern.js +0 -175
- package/lib/commonjs/ui/components/TypeBadge.js +0 -100
- package/lib/commonjs/ui/components/types.js +0 -5
- package/lib/commonjs/ui/console/BubbleSettingsModal.js +0 -50
- package/lib/commonjs/ui/console/ConsoleSection.js +0 -50
- package/lib/commonjs/ui/console/CyberpunkConsoleSection.js +0 -650
- package/lib/commonjs/ui/console/GalaxyButton.js +0 -100
- package/lib/commonjs/ui/console/index.js +0 -12
- package/lib/module/license/DeviceLimitModal.js +0 -474
- package/lib/module/license/ManageDevicesModal.js +0 -540
- package/lib/module/types/index.js +0 -3
- package/lib/module/ui/components/Divider.js +0 -14
- package/lib/module/ui/components/ErrorBoundary.js +0 -108
- package/lib/module/ui/components/ExpandableSection.js +0 -68
- package/lib/module/ui/components/ExpandableSectionHeader.js +0 -83
- package/lib/module/ui/components/ExpandableSectionWithModal.js +0 -179
- package/lib/module/ui/components/FilterViewPattern.js +0 -172
- package/lib/module/ui/components/TypeBadge.js +0 -96
- package/lib/module/ui/components/types.js +0 -3
- package/lib/module/ui/console/BubbleSettingsModal.js +0 -46
- package/lib/module/ui/console/ConsoleSection.js +0 -46
- package/lib/module/ui/console/CyberpunkConsoleSection.js +0 -647
- package/lib/module/ui/console/GalaxyButton.js +0 -96
- package/lib/module/ui/console/index.js +0 -5
- package/lib/typescript/commonjs/license/DeviceLimitModal.d.ts +0 -23
- package/lib/typescript/commonjs/license/DeviceLimitModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/license/ManageDevicesModal.d.ts +0 -23
- package/lib/typescript/commonjs/license/ManageDevicesModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/types/index.d.ts +0 -2
- package/lib/typescript/commonjs/types/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/Divider.d.ts +0 -2
- package/lib/typescript/commonjs/ui/components/Divider.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/ErrorBoundary.d.ts +0 -18
- package/lib/typescript/commonjs/ui/components/ErrorBoundary.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/ExpandableSection.d.ts +0 -15
- package/lib/typescript/commonjs/ui/components/ExpandableSection.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/ExpandableSectionHeader.d.ts +0 -13
- package/lib/typescript/commonjs/ui/components/ExpandableSectionHeader.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/ExpandableSectionWithModal.d.ts +0 -18
- package/lib/typescript/commonjs/ui/components/ExpandableSectionWithModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/FilterViewPattern.d.ts +0 -15
- package/lib/typescript/commonjs/ui/components/FilterViewPattern.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/TypeBadge.d.ts +0 -6
- package/lib/typescript/commonjs/ui/components/TypeBadge.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/types.d.ts +0 -3
- package/lib/typescript/commonjs/ui/components/types.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/console/BubbleSettingsModal.d.ts +0 -11
- package/lib/typescript/commonjs/ui/console/BubbleSettingsModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/console/ConsoleSection.d.ts +0 -19
- package/lib/typescript/commonjs/ui/console/ConsoleSection.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/console/CyberpunkConsoleSection.d.ts +0 -17
- package/lib/typescript/commonjs/ui/console/CyberpunkConsoleSection.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/console/GalaxyButton.d.ts +0 -10
- package/lib/typescript/commonjs/ui/console/GalaxyButton.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/console/index.d.ts +0 -2
- package/lib/typescript/commonjs/ui/console/index.d.ts.map +0 -1
- package/lib/typescript/module/license/DeviceLimitModal.d.ts +0 -23
- package/lib/typescript/module/license/DeviceLimitModal.d.ts.map +0 -1
- package/lib/typescript/module/license/ManageDevicesModal.d.ts +0 -23
- package/lib/typescript/module/license/ManageDevicesModal.d.ts.map +0 -1
- package/lib/typescript/module/types/index.d.ts +0 -2
- package/lib/typescript/module/types/index.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/Divider.d.ts +0 -2
- package/lib/typescript/module/ui/components/Divider.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/ErrorBoundary.d.ts +0 -18
- package/lib/typescript/module/ui/components/ErrorBoundary.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/ExpandableSection.d.ts +0 -15
- package/lib/typescript/module/ui/components/ExpandableSection.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/ExpandableSectionHeader.d.ts +0 -13
- package/lib/typescript/module/ui/components/ExpandableSectionHeader.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/ExpandableSectionWithModal.d.ts +0 -18
- package/lib/typescript/module/ui/components/ExpandableSectionWithModal.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/FilterViewPattern.d.ts +0 -15
- package/lib/typescript/module/ui/components/FilterViewPattern.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/TypeBadge.d.ts +0 -6
- package/lib/typescript/module/ui/components/TypeBadge.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/types.d.ts +0 -3
- package/lib/typescript/module/ui/components/types.d.ts.map +0 -1
- package/lib/typescript/module/ui/console/BubbleSettingsModal.d.ts +0 -11
- package/lib/typescript/module/ui/console/BubbleSettingsModal.d.ts.map +0 -1
- package/lib/typescript/module/ui/console/ConsoleSection.d.ts +0 -19
- package/lib/typescript/module/ui/console/ConsoleSection.d.ts.map +0 -1
- package/lib/typescript/module/ui/console/CyberpunkConsoleSection.d.ts +0 -17
- package/lib/typescript/module/ui/console/CyberpunkConsoleSection.d.ts.map +0 -1
- package/lib/typescript/module/ui/console/GalaxyButton.d.ts +0 -10
- package/lib/typescript/module/ui/console/GalaxyButton.d.ts.map +0 -1
- package/lib/typescript/module/ui/console/index.d.ts +0 -2
- package/lib/typescript/module/ui/console/index.d.ts.map +0 -1
|
@@ -1,546 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ManageDevicesModal = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _absoluteFill = require("../utils/absoluteFill.js");
|
|
10
|
-
var _gameUIColors = require("../ui/gameUI/constants/gameUIColors.js");
|
|
11
|
-
var _lucideIcons = require("../icons/lucide-icons.js");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
-
/**
|
|
15
|
-
* ManageDevicesModal - Modal for viewing and managing registered devices
|
|
16
|
-
*
|
|
17
|
-
* Shows all devices registered to the license with details and allows
|
|
18
|
-
* deactivating devices to free up slots.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
// Types
|
|
22
|
-
|
|
23
|
-
// Lazy load license hooks to avoid circular dependencies
|
|
24
|
-
let _useDevices = null;
|
|
25
|
-
let _useSeats = null;
|
|
26
|
-
function getUseDevices() {
|
|
27
|
-
if (!_useDevices) {
|
|
28
|
-
try {
|
|
29
|
-
const mod = require("@buoy-gg/license");
|
|
30
|
-
_useDevices = mod.useDevices;
|
|
31
|
-
} catch {
|
|
32
|
-
// License package not available
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return _useDevices;
|
|
36
|
-
}
|
|
37
|
-
function getUseSeats() {
|
|
38
|
-
if (!_useSeats) {
|
|
39
|
-
try {
|
|
40
|
-
const mod = require("@buoy-gg/license");
|
|
41
|
-
_useSeats = mod.useSeats;
|
|
42
|
-
} catch {
|
|
43
|
-
// License package not available
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return _useSeats;
|
|
47
|
-
}
|
|
48
|
-
const DeviceIcon = ({
|
|
49
|
-
platform
|
|
50
|
-
}) => {
|
|
51
|
-
// Use Smartphone icon for all device types since we don't have Tablet/Monitor icons
|
|
52
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideIcons.Smartphone, {
|
|
53
|
-
size: 20,
|
|
54
|
-
color: _gameUIColors.gameUIColors.text
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
const formatDate = date => {
|
|
58
|
-
const now = new Date();
|
|
59
|
-
const diffMs = now.getTime() - date.getTime();
|
|
60
|
-
const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
|
|
61
|
-
if (diffDays === 0) {
|
|
62
|
-
return "Today";
|
|
63
|
-
} else if (diffDays === 1) {
|
|
64
|
-
return "Yesterday";
|
|
65
|
-
} else if (diffDays < 7) {
|
|
66
|
-
return `${diffDays} days ago`;
|
|
67
|
-
} else {
|
|
68
|
-
return date.toLocaleDateString(undefined, {
|
|
69
|
-
month: "short",
|
|
70
|
-
day: "numeric",
|
|
71
|
-
year: date.getFullYear() !== now.getFullYear() ? "numeric" : undefined
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
const DeviceRow = ({
|
|
76
|
-
device,
|
|
77
|
-
onDeactivate,
|
|
78
|
-
isDeactivating
|
|
79
|
-
}) => {
|
|
80
|
-
const handleDeactivate = () => {
|
|
81
|
-
const message = device.isCurrentDevice ? "This will deactivate your current device. You'll need to enter your license key again to use Pro features." : `Deactivate "${device.name}" from your license?`;
|
|
82
|
-
_reactNative.Alert.alert("Deactivate Device", message, [{
|
|
83
|
-
text: "Cancel",
|
|
84
|
-
style: "cancel"
|
|
85
|
-
}, {
|
|
86
|
-
text: "Deactivate",
|
|
87
|
-
style: "destructive",
|
|
88
|
-
onPress: onDeactivate
|
|
89
|
-
}]);
|
|
90
|
-
};
|
|
91
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
92
|
-
style: [styles.deviceRow, device.isCurrentDevice && styles.currentDeviceRow],
|
|
93
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
94
|
-
style: styles.deviceIcon,
|
|
95
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(DeviceIcon, {
|
|
96
|
-
platform: device.platform
|
|
97
|
-
})
|
|
98
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
99
|
-
style: styles.deviceInfo,
|
|
100
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
101
|
-
style: styles.deviceNameRow,
|
|
102
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
103
|
-
style: styles.deviceName,
|
|
104
|
-
numberOfLines: 1,
|
|
105
|
-
children: device.name
|
|
106
|
-
}), device.isCurrentDevice && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
107
|
-
style: styles.currentBadge,
|
|
108
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideIcons.CheckCircle, {
|
|
109
|
-
size: 10,
|
|
110
|
-
color: _gameUIColors.gameUIColors.success
|
|
111
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
112
|
-
style: styles.currentBadgeText,
|
|
113
|
-
children: "This device"
|
|
114
|
-
})]
|
|
115
|
-
})]
|
|
116
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
117
|
-
style: styles.deviceDetails,
|
|
118
|
-
children: [device.platform, device.osVersion ? ` ${device.osVersion}` : "", device.model ? ` • ${device.model}` : ""]
|
|
119
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
120
|
-
style: styles.deviceDate,
|
|
121
|
-
children: ["Registered ", formatDate(device.registeredAt)]
|
|
122
|
-
})]
|
|
123
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
124
|
-
style: styles.deactivateButton,
|
|
125
|
-
onPress: handleDeactivate,
|
|
126
|
-
disabled: isDeactivating,
|
|
127
|
-
children: isDeactivating ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
128
|
-
size: "small",
|
|
129
|
-
color: _gameUIColors.gameUIColors.error
|
|
130
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideIcons.Trash2, {
|
|
131
|
-
size: 18,
|
|
132
|
-
color: _gameUIColors.gameUIColors.error
|
|
133
|
-
})
|
|
134
|
-
})]
|
|
135
|
-
});
|
|
136
|
-
};
|
|
137
|
-
const ManageDevicesModal = ({
|
|
138
|
-
visible,
|
|
139
|
-
onClose,
|
|
140
|
-
onDeviceChange
|
|
141
|
-
}) => {
|
|
142
|
-
const [deactivatingId, setDeactivatingId] = (0, _react.useState)(null);
|
|
143
|
-
const useDevicesHook = getUseDevices();
|
|
144
|
-
const useSeatsHook = getUseSeats();
|
|
145
|
-
const devicesData = useDevicesHook?.();
|
|
146
|
-
const seatsData = useSeatsHook?.();
|
|
147
|
-
const devices = devicesData?.devices || [];
|
|
148
|
-
const isLoading = devicesData?.isLoading || false;
|
|
149
|
-
const error = devicesData?.error || null;
|
|
150
|
-
const refreshDevices = devicesData?.refreshDevices;
|
|
151
|
-
const deactivateDevice = devicesData?.deactivateDevice;
|
|
152
|
-
const registerDevice = devicesData?.registerDevice;
|
|
153
|
-
const isCurrentDeviceRegistered = devicesData?.isCurrentDeviceRegistered || false;
|
|
154
|
-
const used = seatsData?.used || 0;
|
|
155
|
-
const total = seatsData?.total || null;
|
|
156
|
-
|
|
157
|
-
// Refresh when modal opens
|
|
158
|
-
(0, _react.useEffect)(() => {
|
|
159
|
-
if (visible && refreshDevices) {
|
|
160
|
-
refreshDevices();
|
|
161
|
-
}
|
|
162
|
-
}, [visible, refreshDevices]);
|
|
163
|
-
const handleDeactivate = (0, _react.useCallback)(async machineId => {
|
|
164
|
-
if (!deactivateDevice) return;
|
|
165
|
-
setDeactivatingId(machineId);
|
|
166
|
-
const success = await deactivateDevice(machineId);
|
|
167
|
-
setDeactivatingId(null);
|
|
168
|
-
if (success) {
|
|
169
|
-
onDeviceChange?.();
|
|
170
|
-
}
|
|
171
|
-
}, [deactivateDevice, onDeviceChange]);
|
|
172
|
-
const handleRegisterCurrentDevice = (0, _react.useCallback)(async () => {
|
|
173
|
-
if (!registerDevice) return;
|
|
174
|
-
|
|
175
|
-
// Generate a default device name
|
|
176
|
-
const platformName = _reactNative.Platform.OS === "ios" ? "iOS" : _reactNative.Platform.OS === "android" ? "Android" : _reactNative.Platform.OS;
|
|
177
|
-
const defaultName = `My ${platformName} Device`;
|
|
178
|
-
const result = await registerDevice(defaultName);
|
|
179
|
-
if (result.success) {
|
|
180
|
-
onDeviceChange?.();
|
|
181
|
-
}
|
|
182
|
-
}, [registerDevice, onDeviceChange]);
|
|
183
|
-
const handleRefresh = (0, _react.useCallback)(() => {
|
|
184
|
-
refreshDevices?.();
|
|
185
|
-
}, [refreshDevices]);
|
|
186
|
-
const renderContent = () => {
|
|
187
|
-
if (isLoading && devices.length === 0) {
|
|
188
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
189
|
-
style: styles.loadingContainer,
|
|
190
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
191
|
-
size: "large",
|
|
192
|
-
color: _gameUIColors.gameUIColors.primary
|
|
193
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
194
|
-
style: styles.loadingText,
|
|
195
|
-
children: "Loading devices..."
|
|
196
|
-
})]
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
if (error) {
|
|
200
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
201
|
-
style: styles.errorContainer,
|
|
202
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideIcons.AlertTriangle, {
|
|
203
|
-
size: 32,
|
|
204
|
-
color: _gameUIColors.gameUIColors.error
|
|
205
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
206
|
-
style: styles.errorText,
|
|
207
|
-
children: error
|
|
208
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
209
|
-
style: styles.retryButton,
|
|
210
|
-
onPress: handleRefresh,
|
|
211
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
212
|
-
style: styles.retryButtonText,
|
|
213
|
-
children: "Try Again"
|
|
214
|
-
})
|
|
215
|
-
})]
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
219
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
220
|
-
style: styles.statsContainer,
|
|
221
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
222
|
-
style: styles.statItem,
|
|
223
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
224
|
-
style: styles.statValue,
|
|
225
|
-
children: used
|
|
226
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
227
|
-
style: styles.statLabel,
|
|
228
|
-
children: "Devices"
|
|
229
|
-
})]
|
|
230
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
231
|
-
style: styles.statDivider
|
|
232
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
233
|
-
style: styles.statItem,
|
|
234
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
235
|
-
style: styles.statValue,
|
|
236
|
-
children: total || "∞"
|
|
237
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
238
|
-
style: styles.statLabel,
|
|
239
|
-
children: "Limit"
|
|
240
|
-
})]
|
|
241
|
-
}), total !== null && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
242
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
243
|
-
style: styles.statDivider
|
|
244
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
245
|
-
style: styles.statItem,
|
|
246
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
247
|
-
style: [styles.statValue, total - used <= 0 && styles.statValueDanger],
|
|
248
|
-
children: Math.max(0, total - used)
|
|
249
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
250
|
-
style: styles.statLabel,
|
|
251
|
-
children: "Available"
|
|
252
|
-
})]
|
|
253
|
-
})]
|
|
254
|
-
})]
|
|
255
|
-
}), !isCurrentDeviceRegistered && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
256
|
-
style: styles.registerButton,
|
|
257
|
-
onPress: handleRegisterCurrentDevice,
|
|
258
|
-
disabled: isLoading,
|
|
259
|
-
children: isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
260
|
-
size: "small",
|
|
261
|
-
color: "#fff"
|
|
262
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
263
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideIcons.Smartphone, {
|
|
264
|
-
size: 16,
|
|
265
|
-
color: "#fff"
|
|
266
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
267
|
-
style: styles.registerButtonText,
|
|
268
|
-
children: "Register This Device"
|
|
269
|
-
})]
|
|
270
|
-
})
|
|
271
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
272
|
-
style: styles.deviceList,
|
|
273
|
-
showsVerticalScrollIndicator: false,
|
|
274
|
-
children: devices.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
275
|
-
style: styles.emptyContainer,
|
|
276
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideIcons.Smartphone, {
|
|
277
|
-
size: 40,
|
|
278
|
-
color: _gameUIColors.gameUIColors.muted
|
|
279
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
280
|
-
style: styles.emptyText,
|
|
281
|
-
children: "No devices registered"
|
|
282
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
283
|
-
style: styles.emptySubtext,
|
|
284
|
-
children: "Register this device to start using Pro features"
|
|
285
|
-
})]
|
|
286
|
-
}) : devices.map(device => /*#__PURE__*/(0, _jsxRuntime.jsx)(DeviceRow, {
|
|
287
|
-
device: device,
|
|
288
|
-
onDeactivate: () => handleDeactivate(device.id),
|
|
289
|
-
isDeactivating: deactivatingId === device.id
|
|
290
|
-
}, device.id))
|
|
291
|
-
})]
|
|
292
|
-
});
|
|
293
|
-
};
|
|
294
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Modal, {
|
|
295
|
-
visible: visible,
|
|
296
|
-
transparent: true,
|
|
297
|
-
animationType: "fade",
|
|
298
|
-
onRequestClose: onClose,
|
|
299
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
300
|
-
style: styles.overlay,
|
|
301
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
302
|
-
style: styles.backdrop,
|
|
303
|
-
activeOpacity: 1,
|
|
304
|
-
onPress: onClose
|
|
305
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
306
|
-
style: styles.modal,
|
|
307
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
308
|
-
style: styles.header,
|
|
309
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
310
|
-
style: styles.title,
|
|
311
|
-
children: "Manage Devices"
|
|
312
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
313
|
-
style: styles.headerActions,
|
|
314
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
315
|
-
style: styles.refreshButton,
|
|
316
|
-
onPress: handleRefresh,
|
|
317
|
-
disabled: isLoading,
|
|
318
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideIcons.RefreshCw, {
|
|
319
|
-
size: 18,
|
|
320
|
-
color: _gameUIColors.gameUIColors.muted,
|
|
321
|
-
style: isLoading ? {
|
|
322
|
-
opacity: 0.5
|
|
323
|
-
} : undefined
|
|
324
|
-
})
|
|
325
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
326
|
-
style: styles.closeButton,
|
|
327
|
-
onPress: onClose,
|
|
328
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideIcons.X, {
|
|
329
|
-
size: 20,
|
|
330
|
-
color: _gameUIColors.gameUIColors.muted
|
|
331
|
-
})
|
|
332
|
-
})]
|
|
333
|
-
})]
|
|
334
|
-
}), renderContent()]
|
|
335
|
-
})]
|
|
336
|
-
})
|
|
337
|
-
});
|
|
338
|
-
};
|
|
339
|
-
exports.ManageDevicesModal = ManageDevicesModal;
|
|
340
|
-
const styles = _reactNative.StyleSheet.create({
|
|
341
|
-
overlay: {
|
|
342
|
-
flex: 1,
|
|
343
|
-
justifyContent: "center",
|
|
344
|
-
alignItems: "center"
|
|
345
|
-
},
|
|
346
|
-
backdrop: {
|
|
347
|
-
..._absoluteFill.absoluteFill,
|
|
348
|
-
backgroundColor: "rgba(0, 0, 0, 0.7)"
|
|
349
|
-
},
|
|
350
|
-
modal: {
|
|
351
|
-
backgroundColor: _gameUIColors.gameUIColors.panel,
|
|
352
|
-
borderRadius: 16,
|
|
353
|
-
width: "90%",
|
|
354
|
-
maxWidth: 420,
|
|
355
|
-
maxHeight: "80%",
|
|
356
|
-
borderWidth: 1,
|
|
357
|
-
borderColor: _gameUIColors.gameUIColors.border
|
|
358
|
-
},
|
|
359
|
-
header: {
|
|
360
|
-
flexDirection: "row",
|
|
361
|
-
justifyContent: "space-between",
|
|
362
|
-
alignItems: "center",
|
|
363
|
-
padding: 16,
|
|
364
|
-
borderBottomWidth: 1,
|
|
365
|
-
borderBottomColor: _gameUIColors.gameUIColors.border
|
|
366
|
-
},
|
|
367
|
-
title: {
|
|
368
|
-
fontSize: 18,
|
|
369
|
-
fontWeight: "700",
|
|
370
|
-
color: _gameUIColors.gameUIColors.text
|
|
371
|
-
},
|
|
372
|
-
headerActions: {
|
|
373
|
-
flexDirection: "row",
|
|
374
|
-
alignItems: "center",
|
|
375
|
-
gap: 8
|
|
376
|
-
},
|
|
377
|
-
refreshButton: {
|
|
378
|
-
padding: 4
|
|
379
|
-
},
|
|
380
|
-
closeButton: {
|
|
381
|
-
padding: 4
|
|
382
|
-
},
|
|
383
|
-
statsContainer: {
|
|
384
|
-
flexDirection: "row",
|
|
385
|
-
justifyContent: "center",
|
|
386
|
-
alignItems: "center",
|
|
387
|
-
paddingVertical: 16,
|
|
388
|
-
paddingHorizontal: 20,
|
|
389
|
-
backgroundColor: _gameUIColors.gameUIColors.background
|
|
390
|
-
},
|
|
391
|
-
statItem: {
|
|
392
|
-
alignItems: "center",
|
|
393
|
-
paddingHorizontal: 20
|
|
394
|
-
},
|
|
395
|
-
statValue: {
|
|
396
|
-
fontSize: 24,
|
|
397
|
-
fontWeight: "700",
|
|
398
|
-
color: _gameUIColors.gameUIColors.text
|
|
399
|
-
},
|
|
400
|
-
statValueDanger: {
|
|
401
|
-
color: _gameUIColors.gameUIColors.error
|
|
402
|
-
},
|
|
403
|
-
statLabel: {
|
|
404
|
-
fontSize: 12,
|
|
405
|
-
color: _gameUIColors.gameUIColors.muted,
|
|
406
|
-
marginTop: 2
|
|
407
|
-
},
|
|
408
|
-
statDivider: {
|
|
409
|
-
width: 1,
|
|
410
|
-
height: 30,
|
|
411
|
-
backgroundColor: _gameUIColors.gameUIColors.border
|
|
412
|
-
},
|
|
413
|
-
registerButton: {
|
|
414
|
-
flexDirection: "row",
|
|
415
|
-
alignItems: "center",
|
|
416
|
-
justifyContent: "center",
|
|
417
|
-
gap: 8,
|
|
418
|
-
backgroundColor: _gameUIColors.gameUIColors.success,
|
|
419
|
-
marginHorizontal: 16,
|
|
420
|
-
marginTop: 16,
|
|
421
|
-
paddingVertical: 12,
|
|
422
|
-
borderRadius: 8
|
|
423
|
-
},
|
|
424
|
-
registerButtonText: {
|
|
425
|
-
fontSize: 14,
|
|
426
|
-
fontWeight: "600",
|
|
427
|
-
color: "#fff"
|
|
428
|
-
},
|
|
429
|
-
deviceList: {
|
|
430
|
-
flex: 1,
|
|
431
|
-
padding: 16
|
|
432
|
-
},
|
|
433
|
-
deviceRow: {
|
|
434
|
-
flexDirection: "row",
|
|
435
|
-
alignItems: "center",
|
|
436
|
-
padding: 12,
|
|
437
|
-
backgroundColor: _gameUIColors.gameUIColors.background,
|
|
438
|
-
borderRadius: 8,
|
|
439
|
-
marginBottom: 8,
|
|
440
|
-
borderWidth: 1,
|
|
441
|
-
borderColor: _gameUIColors.gameUIColors.border
|
|
442
|
-
},
|
|
443
|
-
currentDeviceRow: {
|
|
444
|
-
borderColor: _gameUIColors.gameUIColors.success + "60",
|
|
445
|
-
backgroundColor: _gameUIColors.gameUIColors.success + "10"
|
|
446
|
-
},
|
|
447
|
-
deviceIcon: {
|
|
448
|
-
width: 40,
|
|
449
|
-
height: 40,
|
|
450
|
-
borderRadius: 20,
|
|
451
|
-
backgroundColor: _gameUIColors.gameUIColors.panel,
|
|
452
|
-
alignItems: "center",
|
|
453
|
-
justifyContent: "center"
|
|
454
|
-
},
|
|
455
|
-
deviceInfo: {
|
|
456
|
-
flex: 1,
|
|
457
|
-
marginLeft: 12
|
|
458
|
-
},
|
|
459
|
-
deviceNameRow: {
|
|
460
|
-
flexDirection: "row",
|
|
461
|
-
alignItems: "center",
|
|
462
|
-
gap: 8
|
|
463
|
-
},
|
|
464
|
-
deviceName: {
|
|
465
|
-
fontSize: 14,
|
|
466
|
-
fontWeight: "600",
|
|
467
|
-
color: _gameUIColors.gameUIColors.text,
|
|
468
|
-
flexShrink: 1
|
|
469
|
-
},
|
|
470
|
-
currentBadge: {
|
|
471
|
-
flexDirection: "row",
|
|
472
|
-
alignItems: "center",
|
|
473
|
-
gap: 4,
|
|
474
|
-
backgroundColor: _gameUIColors.gameUIColors.success + "20",
|
|
475
|
-
paddingHorizontal: 6,
|
|
476
|
-
paddingVertical: 2,
|
|
477
|
-
borderRadius: 4
|
|
478
|
-
},
|
|
479
|
-
currentBadgeText: {
|
|
480
|
-
fontSize: 10,
|
|
481
|
-
fontWeight: "600",
|
|
482
|
-
color: _gameUIColors.gameUIColors.success
|
|
483
|
-
},
|
|
484
|
-
deviceDetails: {
|
|
485
|
-
fontSize: 12,
|
|
486
|
-
color: _gameUIColors.gameUIColors.muted,
|
|
487
|
-
marginTop: 2
|
|
488
|
-
},
|
|
489
|
-
deviceDate: {
|
|
490
|
-
fontSize: 11,
|
|
491
|
-
color: _gameUIColors.gameUIColors.muted,
|
|
492
|
-
marginTop: 4
|
|
493
|
-
},
|
|
494
|
-
deactivateButton: {
|
|
495
|
-
padding: 8,
|
|
496
|
-
marginLeft: 8
|
|
497
|
-
},
|
|
498
|
-
loadingContainer: {
|
|
499
|
-
alignItems: "center",
|
|
500
|
-
justifyContent: "center",
|
|
501
|
-
padding: 40
|
|
502
|
-
},
|
|
503
|
-
loadingText: {
|
|
504
|
-
fontSize: 14,
|
|
505
|
-
color: _gameUIColors.gameUIColors.muted,
|
|
506
|
-
marginTop: 12
|
|
507
|
-
},
|
|
508
|
-
errorContainer: {
|
|
509
|
-
alignItems: "center",
|
|
510
|
-
justifyContent: "center",
|
|
511
|
-
padding: 40
|
|
512
|
-
},
|
|
513
|
-
errorText: {
|
|
514
|
-
fontSize: 14,
|
|
515
|
-
color: _gameUIColors.gameUIColors.error,
|
|
516
|
-
marginTop: 12,
|
|
517
|
-
textAlign: "center"
|
|
518
|
-
},
|
|
519
|
-
retryButton: {
|
|
520
|
-
marginTop: 16,
|
|
521
|
-
paddingVertical: 8,
|
|
522
|
-
paddingHorizontal: 16
|
|
523
|
-
},
|
|
524
|
-
retryButtonText: {
|
|
525
|
-
fontSize: 14,
|
|
526
|
-
fontWeight: "600",
|
|
527
|
-
color: _gameUIColors.gameUIColors.primary
|
|
528
|
-
},
|
|
529
|
-
emptyContainer: {
|
|
530
|
-
alignItems: "center",
|
|
531
|
-
justifyContent: "center",
|
|
532
|
-
paddingVertical: 40
|
|
533
|
-
},
|
|
534
|
-
emptyText: {
|
|
535
|
-
fontSize: 16,
|
|
536
|
-
fontWeight: "600",
|
|
537
|
-
color: _gameUIColors.gameUIColors.text,
|
|
538
|
-
marginTop: 16
|
|
539
|
-
},
|
|
540
|
-
emptySubtext: {
|
|
541
|
-
fontSize: 13,
|
|
542
|
-
color: _gameUIColors.gameUIColors.muted,
|
|
543
|
-
marginTop: 4,
|
|
544
|
-
textAlign: "center"
|
|
545
|
-
}
|
|
546
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _types = require("./types.js");
|
|
7
|
-
Object.keys(_types).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _types[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _types[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Divider = Divider;
|
|
7
|
-
var _reactNative = require("react-native");
|
|
8
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
-
function Divider() {
|
|
10
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
11
|
-
style: {
|
|
12
|
-
width: 1,
|
|
13
|
-
height: 12,
|
|
14
|
-
backgroundColor: "rgba(107, 114, 128, 0.4)",
|
|
15
|
-
flexShrink: 0
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ErrorBoundary = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _index = require("../../icons/index.js");
|
|
10
|
-
var _gameUIColors = require("../gameUI/constants/gameUIColors.js");
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
class ErrorBoundary extends _react.Component {
|
|
13
|
-
constructor(props) {
|
|
14
|
-
super(props);
|
|
15
|
-
this.state = {
|
|
16
|
-
hasError: false
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
static getDerivedStateFromError(error) {
|
|
20
|
-
return {
|
|
21
|
-
hasError: true,
|
|
22
|
-
error
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
componentDidCatch(error, errorInfo) {
|
|
26
|
-
console.error("RnBetterDevToolsBubble Error:", error, errorInfo);
|
|
27
|
-
}
|
|
28
|
-
handleRetry = () => {
|
|
29
|
-
this.setState({
|
|
30
|
-
hasError: false,
|
|
31
|
-
error: undefined
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
render() {
|
|
35
|
-
if (this.state.hasError) {
|
|
36
|
-
if (this.props.fallback) {
|
|
37
|
-
return this.props.fallback;
|
|
38
|
-
}
|
|
39
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
40
|
-
style: styles.errorContainer,
|
|
41
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
42
|
-
style: styles.errorContent,
|
|
43
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.AlertTriangle, {
|
|
44
|
-
color: "#EF4444",
|
|
45
|
-
size: 20
|
|
46
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
47
|
-
style: styles.errorTitle,
|
|
48
|
-
children: "Dev Tools Error"
|
|
49
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
50
|
-
style: styles.errorMessage,
|
|
51
|
-
children: this.state.error?.message || "Something went wrong"
|
|
52
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
53
|
-
"sentry-label": "ignore devtools error boundary retry",
|
|
54
|
-
style: styles.retryButton,
|
|
55
|
-
onPress: this.handleRetry,
|
|
56
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.RefreshCw, {
|
|
57
|
-
color: "#60A5FA",
|
|
58
|
-
size: 16
|
|
59
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
60
|
-
style: styles.retryText,
|
|
61
|
-
children: "Retry"
|
|
62
|
-
})]
|
|
63
|
-
})]
|
|
64
|
-
})
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
return this.props.children;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
exports.ErrorBoundary = ErrorBoundary;
|
|
71
|
-
const styles = _reactNative.StyleSheet.create({
|
|
72
|
-
errorContainer: {
|
|
73
|
-
backgroundColor: _gameUIColors.buoyColors.card,
|
|
74
|
-
borderRadius: 6,
|
|
75
|
-
borderWidth: 1,
|
|
76
|
-
borderColor: "#EF4444",
|
|
77
|
-
padding: 12,
|
|
78
|
-
minWidth: 200,
|
|
79
|
-
maxWidth: 300
|
|
80
|
-
},
|
|
81
|
-
errorContent: {
|
|
82
|
-
alignItems: "center",
|
|
83
|
-
gap: 8
|
|
84
|
-
},
|
|
85
|
-
errorTitle: {
|
|
86
|
-
color: "#EF4444",
|
|
87
|
-
fontSize: 14,
|
|
88
|
-
fontWeight: "600"
|
|
89
|
-
},
|
|
90
|
-
errorMessage: {
|
|
91
|
-
color: _gameUIColors.buoyColors.textSecondary,
|
|
92
|
-
fontSize: 12,
|
|
93
|
-
textAlign: "center",
|
|
94
|
-
lineHeight: 16
|
|
95
|
-
},
|
|
96
|
-
retryButton: {
|
|
97
|
-
flexDirection: "row",
|
|
98
|
-
alignItems: "center",
|
|
99
|
-
gap: 6,
|
|
100
|
-
backgroundColor: "rgba(96, 165, 250, 0.1)",
|
|
101
|
-
borderWidth: 1,
|
|
102
|
-
borderColor: "#60A5FA",
|
|
103
|
-
borderRadius: 4,
|
|
104
|
-
paddingHorizontal: 12,
|
|
105
|
-
paddingVertical: 6,
|
|
106
|
-
marginTop: 4
|
|
107
|
-
},
|
|
108
|
-
retryText: {
|
|
109
|
-
color: "#60A5FA",
|
|
110
|
-
fontSize: 12,
|
|
111
|
-
fontWeight: "500"
|
|
112
|
-
}
|
|
113
|
-
});
|