@buoy-gg/shared-ui 7.0.6 → 7.0.8

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