@buoy-gg/shared-ui 2.1.1 → 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/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/index.js +0 -7
- 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/ui/components/PowerToggleButton.js +73 -0
- package/lib/commonjs/ui/components/index.js +7 -0
- package/lib/module/JsModal.js +1 -1
- 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/index.js +1 -1
- 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/ui/components/PowerToggleButton.js +69 -0
- package/lib/module/ui/components/index.js +1 -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/index.d.ts +2 -2
- 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/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 +2 -0
- package/lib/typescript/commonjs/ui/components/index.d.ts.map +1 -1
- 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/index.d.ts +2 -2
- 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/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 +2 -0
- package/lib/typescript/module/ui/components/index.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -7,7 +7,7 @@ exports.isClipboardAvailable = exports.clipboardType = exports.clipboardFunction
|
|
|
7
7
|
/**
|
|
8
8
|
* Auto-generated clipboard implementation
|
|
9
9
|
* Detected: none
|
|
10
|
-
* Generated at: 2026-01-
|
|
10
|
+
* Generated at: 2026-01-29T01:02:34.738Z
|
|
11
11
|
*
|
|
12
12
|
* DO NOT EDIT - This file is generated by scripts/detect-clipboard.js
|
|
13
13
|
*
|
|
@@ -730,8 +730,7 @@ const VirtualizedItemComponent = ({
|
|
|
730
730
|
data,
|
|
731
731
|
index,
|
|
732
732
|
onSelect,
|
|
733
|
-
isSelected
|
|
734
|
-
disableCopy = false
|
|
733
|
+
isSelected
|
|
735
734
|
}) => {
|
|
736
735
|
const [isPressed, setIsPressed] = (0, _react.useState)(false);
|
|
737
736
|
const [showFullKey, setShowFullKey] = (0, _react.useState)(false);
|
|
@@ -754,9 +753,9 @@ const VirtualizedItemComponent = ({
|
|
|
754
753
|
|
|
755
754
|
// Always show full key for better identification
|
|
756
755
|
const displayKey = item.key;
|
|
757
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
756
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
758
757
|
style: [STABLE_STYLES.itemContainer, indentStyle],
|
|
759
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
758
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
760
759
|
"sentry-label": "ignore devtools data explorer item",
|
|
761
760
|
style: [STABLE_STYLES.itemTouchable, isPressed && STABLE_STYLES.itemTouchablePressed, isSelected && STABLE_STYLES.itemSelected, isLongKey && {
|
|
762
761
|
minHeight: LONG_ITEM_HEIGHT,
|
|
@@ -778,21 +777,12 @@ const VirtualizedItemComponent = ({
|
|
|
778
777
|
style: STABLE_STYLES.labelText,
|
|
779
778
|
numberOfLines: 1,
|
|
780
779
|
children: [item.key, ":"]
|
|
781
|
-
}), item.isExpandable ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
children: [item.valueType, " (", item.childCount, " ", item.childCount === 1 ? "item" : "items", ")"]
|
|
788
|
-
}), item.id === "root" && data && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CopyButton.CopyButton, {
|
|
789
|
-
value: data,
|
|
790
|
-
size: 16,
|
|
791
|
-
buttonStyle: {
|
|
792
|
-
marginLeft: 8
|
|
793
|
-
},
|
|
794
|
-
disabled: disableCopy
|
|
795
|
-
})]
|
|
780
|
+
}), item.isExpandable ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
781
|
+
style: [STABLE_STYLES.valueText, {
|
|
782
|
+
color: _index.gameUIColors.secondary
|
|
783
|
+
}],
|
|
784
|
+
numberOfLines: 1,
|
|
785
|
+
children: [item.valueType, " (", item.childCount, " ", item.childCount === 1 ? "item" : "items", ")"]
|
|
796
786
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
797
787
|
style: [STABLE_STYLES.valueText, {
|
|
798
788
|
color
|
|
@@ -801,7 +791,14 @@ const VirtualizedItemComponent = ({
|
|
|
801
791
|
children: formatValue(item.value, item.valueType)
|
|
802
792
|
})]
|
|
803
793
|
})]
|
|
804
|
-
})
|
|
794
|
+
}), item.id === "root" && data !== undefined && data !== null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_CopyButton.CopyButton, {
|
|
795
|
+
value: data,
|
|
796
|
+
size: 16,
|
|
797
|
+
buttonStyle: {
|
|
798
|
+
marginLeft: 8,
|
|
799
|
+
marginRight: 8
|
|
800
|
+
}
|
|
801
|
+
}) : null]
|
|
805
802
|
});
|
|
806
803
|
};
|
|
807
804
|
VirtualizedItemComponent.displayName = "VirtualizedItem";
|
|
@@ -816,7 +813,8 @@ const VirtualizedDataExplorer = ({
|
|
|
816
813
|
maxDepth = 10,
|
|
817
814
|
rawMode = false,
|
|
818
815
|
initialExpanded = false,
|
|
819
|
-
disableCopy
|
|
816
|
+
// disableCopy is accepted for API compatibility but CopyButton handles Pro gating internally
|
|
817
|
+
disableCopy: _disableCopy = false
|
|
820
818
|
}) => {
|
|
821
819
|
const [isExpanded, setIsExpanded] = (0, _react.useState)(rawMode); // Auto-expand in raw mode
|
|
822
820
|
const {
|
|
@@ -882,8 +880,7 @@ const VirtualizedDataExplorer = ({
|
|
|
882
880
|
onToggleExpanded: toggleExpanded,
|
|
883
881
|
data: data,
|
|
884
882
|
onSelect: setSelectedIndex,
|
|
885
|
-
isSelected: selectedIndex === index
|
|
886
|
-
disableCopy: disableCopy
|
|
883
|
+
isSelected: selectedIndex === index
|
|
887
884
|
});
|
|
888
885
|
|
|
889
886
|
// Uniform row height for crisp guide geometry
|
|
@@ -7,7 +7,7 @@ exports.useNativeSafeAreaInsets = exports.safeAreaType = exports.hasSafeAreaPack
|
|
|
7
7
|
/**
|
|
8
8
|
* Auto-generated safe area implementation
|
|
9
9
|
* Detected: none
|
|
10
|
-
* Generated at: 2026-01-
|
|
10
|
+
* Generated at: 2026-01-29T01:02:34.764Z
|
|
11
11
|
*
|
|
12
12
|
* DO NOT EDIT - This file is generated by scripts/detect-safe-area.js
|
|
13
13
|
*
|
package/lib/commonjs/index.js
CHANGED
|
@@ -49,7 +49,6 @@ var _exportNames = {
|
|
|
49
49
|
ProFeatureBanner: true,
|
|
50
50
|
UpgradeModal: true,
|
|
51
51
|
LicenseEntryModal: true,
|
|
52
|
-
ManageDevicesModal: true,
|
|
53
52
|
ProBadge: true,
|
|
54
53
|
ProUpgradeModal: true,
|
|
55
54
|
getUseIsPro: true,
|
|
@@ -97,12 +96,6 @@ Object.defineProperty(exports, "LicenseEntryModal", {
|
|
|
97
96
|
return _index11.LicenseEntryModal;
|
|
98
97
|
}
|
|
99
98
|
});
|
|
100
|
-
Object.defineProperty(exports, "ManageDevicesModal", {
|
|
101
|
-
enumerable: true,
|
|
102
|
-
get: function () {
|
|
103
|
-
return _index11.ManageDevicesModal;
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
99
|
Object.defineProperty(exports, "ProBadge", {
|
|
107
100
|
enumerable: true,
|
|
108
101
|
get: function () {
|
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DeviceLimitModal = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _macOSDesignSystemColors = require("../ui/gameUI/constants/macOSDesignSystemColors.js");
|
|
10
|
+
var _lucideIcons = require("../icons/lucide-icons.js");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
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); }
|
|
13
|
+
/**
|
|
14
|
+
* DeviceLimitModal - Shown when device limit is exceeded
|
|
15
|
+
*
|
|
16
|
+
* Displays registered devices and allows removing one to free up a slot.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
// Lazy load LicenseManager
|
|
20
|
+
let _LicenseManager = null;
|
|
21
|
+
function getLicenseManager() {
|
|
22
|
+
if (!_LicenseManager) {
|
|
23
|
+
try {
|
|
24
|
+
const mod = require("@buoy-gg/license");
|
|
25
|
+
_LicenseManager = mod.LicenseManager;
|
|
26
|
+
} catch {
|
|
27
|
+
// Not available
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return _LicenseManager;
|
|
31
|
+
}
|
|
32
|
+
const DeviceLimitModal = ({
|
|
33
|
+
visible,
|
|
34
|
+
onClose,
|
|
35
|
+
onRetry,
|
|
36
|
+
maxDevices
|
|
37
|
+
}) => {
|
|
38
|
+
const [devices, setDevices] = (0, _react.useState)([]);
|
|
39
|
+
const [isLoading, setIsLoading] = (0, _react.useState)(true);
|
|
40
|
+
const [isRemoving, setIsRemoving] = (0, _react.useState)(null);
|
|
41
|
+
const [error, setError] = (0, _react.useState)(null);
|
|
42
|
+
|
|
43
|
+
// Only allow device removal on web (admin dashboard)
|
|
44
|
+
const canRemoveDevices = _reactNative.Platform.OS === "web";
|
|
45
|
+
const fetchDevices = (0, _react.useCallback)(async () => {
|
|
46
|
+
setIsLoading(true);
|
|
47
|
+
setError(null);
|
|
48
|
+
try {
|
|
49
|
+
const LicenseManager = getLicenseManager();
|
|
50
|
+
if (LicenseManager?.getRegisteredDevices) {
|
|
51
|
+
const registeredDevices = await LicenseManager.getRegisteredDevices();
|
|
52
|
+
setDevices(registeredDevices);
|
|
53
|
+
}
|
|
54
|
+
} catch (err) {
|
|
55
|
+
setError("Failed to load devices");
|
|
56
|
+
console.warn("[DeviceLimitModal] Failed to fetch devices:", err);
|
|
57
|
+
} finally {
|
|
58
|
+
setIsLoading(false);
|
|
59
|
+
}
|
|
60
|
+
}, []);
|
|
61
|
+
(0, _react.useEffect)(() => {
|
|
62
|
+
if (visible) {
|
|
63
|
+
fetchDevices();
|
|
64
|
+
}
|
|
65
|
+
}, [visible, fetchDevices]);
|
|
66
|
+
const handleRemoveDevice = (0, _react.useCallback)(async device => {
|
|
67
|
+
const confirmRemove = () => {
|
|
68
|
+
return new Promise(resolve => {
|
|
69
|
+
if (_reactNative.Platform.OS === "web") {
|
|
70
|
+
// Use globalThis for cross-platform window access
|
|
71
|
+
const win = globalThis;
|
|
72
|
+
resolve(win.confirm?.(`Remove "${device.name}" from your license?`) ?? true);
|
|
73
|
+
} else {
|
|
74
|
+
_reactNative.Alert.alert("Remove Device", `Remove "${device.name}" from your license? You can re-register it later.`, [{
|
|
75
|
+
text: "Cancel",
|
|
76
|
+
style: "cancel",
|
|
77
|
+
onPress: () => resolve(false)
|
|
78
|
+
}, {
|
|
79
|
+
text: "Remove",
|
|
80
|
+
style: "destructive",
|
|
81
|
+
onPress: () => resolve(true)
|
|
82
|
+
}]);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
const confirmed = await confirmRemove();
|
|
87
|
+
if (!confirmed) return;
|
|
88
|
+
setIsRemoving(device.id);
|
|
89
|
+
try {
|
|
90
|
+
const LicenseManager = getLicenseManager();
|
|
91
|
+
if (LicenseManager?.deactivateDevice) {
|
|
92
|
+
const success = await LicenseManager.deactivateDevice(device.id);
|
|
93
|
+
if (success) {
|
|
94
|
+
// Refresh the list
|
|
95
|
+
await fetchDevices();
|
|
96
|
+
// If we now have room, let user know they can retry
|
|
97
|
+
if (devices.length <= maxDevices) {
|
|
98
|
+
setError(null);
|
|
99
|
+
}
|
|
100
|
+
} else {
|
|
101
|
+
setError("Failed to remove device");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
} catch (err) {
|
|
105
|
+
setError("Failed to remove device");
|
|
106
|
+
console.warn("[DeviceLimitModal] Failed to remove device:", err);
|
|
107
|
+
} finally {
|
|
108
|
+
setIsRemoving(null);
|
|
109
|
+
}
|
|
110
|
+
}, [fetchDevices, devices.length, maxDevices]);
|
|
111
|
+
const formatDate = date => {
|
|
112
|
+
const now = new Date();
|
|
113
|
+
const diffMs = now.getTime() - date.getTime();
|
|
114
|
+
const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
|
|
115
|
+
if (diffDays === 0) return "Today";
|
|
116
|
+
if (diffDays === 1) return "Yesterday";
|
|
117
|
+
if (diffDays < 7) return `${diffDays} days ago`;
|
|
118
|
+
if (diffDays < 30) return `${Math.floor(diffDays / 7)} weeks ago`;
|
|
119
|
+
return `${Math.floor(diffDays / 30)} months ago`;
|
|
120
|
+
};
|
|
121
|
+
const canRetry = devices.length < maxDevices;
|
|
122
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Modal, {
|
|
123
|
+
visible: visible,
|
|
124
|
+
transparent: true,
|
|
125
|
+
animationType: "fade",
|
|
126
|
+
onRequestClose: onClose,
|
|
127
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
128
|
+
style: styles.overlay,
|
|
129
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
130
|
+
style: styles.backdrop,
|
|
131
|
+
activeOpacity: 1,
|
|
132
|
+
onPress: onClose
|
|
133
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
134
|
+
style: styles.modal,
|
|
135
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
136
|
+
style: styles.closeButton,
|
|
137
|
+
onPress: onClose,
|
|
138
|
+
activeOpacity: 0.7,
|
|
139
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideIcons.X, {
|
|
140
|
+
size: 18,
|
|
141
|
+
color: _macOSDesignSystemColors.macOSColors.text.muted
|
|
142
|
+
})
|
|
143
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
144
|
+
style: styles.header,
|
|
145
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
146
|
+
style: styles.iconContainer,
|
|
147
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideIcons.AlertTriangle, {
|
|
148
|
+
size: 20,
|
|
149
|
+
color: _macOSDesignSystemColors.macOSColors.semantic.warning
|
|
150
|
+
})
|
|
151
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
152
|
+
style: styles.title,
|
|
153
|
+
children: "Device Limit Reached"
|
|
154
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
155
|
+
style: styles.subtitle,
|
|
156
|
+
children: ["Your license allows ", maxDevices, " device", maxDevices !== 1 ? "s" : "", ". Remove one to continue."]
|
|
157
|
+
})]
|
|
158
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
159
|
+
style: styles.countBadge,
|
|
160
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
161
|
+
style: styles.countText,
|
|
162
|
+
children: [devices.length, " / ", maxDevices, " devices registered"]
|
|
163
|
+
})
|
|
164
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
165
|
+
style: styles.devicesContainer,
|
|
166
|
+
children: isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
167
|
+
style: styles.loadingContainer,
|
|
168
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
169
|
+
size: "small",
|
|
170
|
+
color: _macOSDesignSystemColors.macOSColors.text.muted
|
|
171
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
172
|
+
style: styles.loadingText,
|
|
173
|
+
children: "Loading devices..."
|
|
174
|
+
})]
|
|
175
|
+
}) : error && devices.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
176
|
+
style: styles.errorContainer,
|
|
177
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
178
|
+
style: styles.errorText,
|
|
179
|
+
children: error
|
|
180
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
181
|
+
style: styles.retryButton,
|
|
182
|
+
onPress: fetchDevices,
|
|
183
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideIcons.RefreshCw, {
|
|
184
|
+
size: 14,
|
|
185
|
+
color: _macOSDesignSystemColors.macOSColors.text.secondary
|
|
186
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
187
|
+
style: styles.retryButtonText,
|
|
188
|
+
children: "Retry"
|
|
189
|
+
})]
|
|
190
|
+
})]
|
|
191
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
192
|
+
style: styles.devicesList,
|
|
193
|
+
showsVerticalScrollIndicator: false,
|
|
194
|
+
children: devices.map(device => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
195
|
+
style: styles.deviceItem,
|
|
196
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
197
|
+
style: styles.deviceIcon,
|
|
198
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideIcons.Smartphone, {
|
|
199
|
+
size: 16,
|
|
200
|
+
color: _macOSDesignSystemColors.macOSColors.text.secondary
|
|
201
|
+
})
|
|
202
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
203
|
+
style: styles.deviceInfo,
|
|
204
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
205
|
+
style: styles.deviceName,
|
|
206
|
+
numberOfLines: 1,
|
|
207
|
+
children: [device.name, device.isCurrentDevice && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
208
|
+
style: styles.currentBadge,
|
|
209
|
+
children: " (this device)"
|
|
210
|
+
})]
|
|
211
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
212
|
+
style: styles.deviceMeta,
|
|
213
|
+
children: [device.platform, " \u2022 Last seen ", formatDate(device.lastSeenAt)]
|
|
214
|
+
})]
|
|
215
|
+
}), canRemoveDevices && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
216
|
+
style: [styles.removeButton, isRemoving === device.id && styles.removeButtonDisabled],
|
|
217
|
+
onPress: () => handleRemoveDevice(device),
|
|
218
|
+
disabled: isRemoving !== null,
|
|
219
|
+
activeOpacity: 0.7,
|
|
220
|
+
children: isRemoving === device.id ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
221
|
+
size: "small",
|
|
222
|
+
color: _macOSDesignSystemColors.macOSColors.semantic.error
|
|
223
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideIcons.Trash2, {
|
|
224
|
+
size: 14,
|
|
225
|
+
color: _macOSDesignSystemColors.macOSColors.semantic.error
|
|
226
|
+
})
|
|
227
|
+
})]
|
|
228
|
+
}, device.id))
|
|
229
|
+
})
|
|
230
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
231
|
+
style: styles.actions,
|
|
232
|
+
children: canRemoveDevices ?
|
|
233
|
+
// Web: Show retry button or hint to remove
|
|
234
|
+
canRetry ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
235
|
+
style: styles.primaryButton,
|
|
236
|
+
onPress: onRetry,
|
|
237
|
+
activeOpacity: 0.8,
|
|
238
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
239
|
+
style: styles.primaryButtonText,
|
|
240
|
+
children: "Try Again"
|
|
241
|
+
})
|
|
242
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
243
|
+
style: styles.hintText,
|
|
244
|
+
children: "Remove a device above to free up a slot"
|
|
245
|
+
}) :
|
|
246
|
+
/*#__PURE__*/
|
|
247
|
+
// Mobile: Show instructions to use web dashboard
|
|
248
|
+
(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
249
|
+
style: styles.mobileInstructions,
|
|
250
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
251
|
+
style: styles.mobileInstructionsText,
|
|
252
|
+
children: "To remove a device, visit your account dashboard at"
|
|
253
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
254
|
+
onPress: () => _reactNative.Linking.openURL("https://buoy.gg/account"),
|
|
255
|
+
activeOpacity: 0.7,
|
|
256
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
257
|
+
style: styles.mobileInstructionsLink,
|
|
258
|
+
children: "buoy.gg/account"
|
|
259
|
+
})
|
|
260
|
+
})]
|
|
261
|
+
})
|
|
262
|
+
})]
|
|
263
|
+
})]
|
|
264
|
+
})
|
|
265
|
+
});
|
|
266
|
+
};
|
|
267
|
+
exports.DeviceLimitModal = DeviceLimitModal;
|
|
268
|
+
const styles = _reactNative.StyleSheet.create({
|
|
269
|
+
overlay: {
|
|
270
|
+
flex: 1,
|
|
271
|
+
justifyContent: "center",
|
|
272
|
+
alignItems: "center"
|
|
273
|
+
},
|
|
274
|
+
backdrop: {
|
|
275
|
+
..._reactNative.StyleSheet.absoluteFillObject,
|
|
276
|
+
backgroundColor: "rgba(0, 0, 0, 0.8)"
|
|
277
|
+
},
|
|
278
|
+
modal: {
|
|
279
|
+
backgroundColor: _macOSDesignSystemColors.macOSColors.background.card,
|
|
280
|
+
borderRadius: 12,
|
|
281
|
+
padding: 24,
|
|
282
|
+
width: "90%",
|
|
283
|
+
maxWidth: 400,
|
|
284
|
+
maxHeight: "80%",
|
|
285
|
+
borderWidth: 1,
|
|
286
|
+
borderColor: _macOSDesignSystemColors.macOSColors.semantic.warning + "50",
|
|
287
|
+
shadowColor: _macOSDesignSystemColors.macOSColors.semantic.warning,
|
|
288
|
+
shadowOffset: {
|
|
289
|
+
width: 0,
|
|
290
|
+
height: 0
|
|
291
|
+
},
|
|
292
|
+
shadowOpacity: 0.5,
|
|
293
|
+
shadowRadius: 24,
|
|
294
|
+
elevation: 24
|
|
295
|
+
},
|
|
296
|
+
closeButton: {
|
|
297
|
+
position: "absolute",
|
|
298
|
+
top: 12,
|
|
299
|
+
right: 12,
|
|
300
|
+
width: 28,
|
|
301
|
+
height: 28,
|
|
302
|
+
borderRadius: 6,
|
|
303
|
+
backgroundColor: _macOSDesignSystemColors.macOSColors.background.hover,
|
|
304
|
+
alignItems: "center",
|
|
305
|
+
justifyContent: "center",
|
|
306
|
+
zIndex: 1
|
|
307
|
+
},
|
|
308
|
+
header: {
|
|
309
|
+
alignItems: "center",
|
|
310
|
+
marginBottom: 16,
|
|
311
|
+
paddingTop: 8
|
|
312
|
+
},
|
|
313
|
+
iconContainer: {
|
|
314
|
+
width: 48,
|
|
315
|
+
height: 48,
|
|
316
|
+
borderRadius: 12,
|
|
317
|
+
backgroundColor: _macOSDesignSystemColors.macOSColors.semantic.warning + "15",
|
|
318
|
+
borderWidth: 1,
|
|
319
|
+
borderColor: _macOSDesignSystemColors.macOSColors.semantic.warning + "30",
|
|
320
|
+
alignItems: "center",
|
|
321
|
+
justifyContent: "center",
|
|
322
|
+
marginBottom: 16
|
|
323
|
+
},
|
|
324
|
+
title: {
|
|
325
|
+
fontSize: 18,
|
|
326
|
+
fontWeight: "600",
|
|
327
|
+
color: _macOSDesignSystemColors.macOSColors.text.primary,
|
|
328
|
+
marginBottom: 6
|
|
329
|
+
},
|
|
330
|
+
subtitle: {
|
|
331
|
+
fontSize: 13,
|
|
332
|
+
color: _macOSDesignSystemColors.macOSColors.text.secondary,
|
|
333
|
+
textAlign: "center",
|
|
334
|
+
lineHeight: 18
|
|
335
|
+
},
|
|
336
|
+
countBadge: {
|
|
337
|
+
alignSelf: "center",
|
|
338
|
+
backgroundColor: _macOSDesignSystemColors.macOSColors.semantic.warning + "20",
|
|
339
|
+
paddingHorizontal: 12,
|
|
340
|
+
paddingVertical: 6,
|
|
341
|
+
borderRadius: 12,
|
|
342
|
+
marginBottom: 16
|
|
343
|
+
},
|
|
344
|
+
countText: {
|
|
345
|
+
fontSize: 12,
|
|
346
|
+
fontWeight: "600",
|
|
347
|
+
color: _macOSDesignSystemColors.macOSColors.semantic.warning
|
|
348
|
+
},
|
|
349
|
+
devicesContainer: {
|
|
350
|
+
backgroundColor: _macOSDesignSystemColors.macOSColors.background.hover,
|
|
351
|
+
borderRadius: 8,
|
|
352
|
+
borderWidth: 1,
|
|
353
|
+
borderColor: _macOSDesignSystemColors.macOSColors.border.default,
|
|
354
|
+
minHeight: 120,
|
|
355
|
+
maxHeight: 200
|
|
356
|
+
},
|
|
357
|
+
loadingContainer: {
|
|
358
|
+
flex: 1,
|
|
359
|
+
alignItems: "center",
|
|
360
|
+
justifyContent: "center",
|
|
361
|
+
padding: 24,
|
|
362
|
+
gap: 8
|
|
363
|
+
},
|
|
364
|
+
loadingText: {
|
|
365
|
+
fontSize: 12,
|
|
366
|
+
color: _macOSDesignSystemColors.macOSColors.text.muted
|
|
367
|
+
},
|
|
368
|
+
errorContainer: {
|
|
369
|
+
flex: 1,
|
|
370
|
+
alignItems: "center",
|
|
371
|
+
justifyContent: "center",
|
|
372
|
+
padding: 24,
|
|
373
|
+
gap: 12
|
|
374
|
+
},
|
|
375
|
+
errorText: {
|
|
376
|
+
fontSize: 12,
|
|
377
|
+
color: _macOSDesignSystemColors.macOSColors.semantic.error
|
|
378
|
+
},
|
|
379
|
+
retryButton: {
|
|
380
|
+
flexDirection: "row",
|
|
381
|
+
alignItems: "center",
|
|
382
|
+
gap: 6,
|
|
383
|
+
paddingVertical: 8,
|
|
384
|
+
paddingHorizontal: 12,
|
|
385
|
+
borderRadius: 6,
|
|
386
|
+
backgroundColor: _macOSDesignSystemColors.macOSColors.background.input
|
|
387
|
+
},
|
|
388
|
+
retryButtonText: {
|
|
389
|
+
fontSize: 12,
|
|
390
|
+
color: _macOSDesignSystemColors.macOSColors.text.secondary
|
|
391
|
+
},
|
|
392
|
+
devicesList: {
|
|
393
|
+
padding: 8
|
|
394
|
+
},
|
|
395
|
+
deviceItem: {
|
|
396
|
+
flexDirection: "row",
|
|
397
|
+
alignItems: "center",
|
|
398
|
+
padding: 10,
|
|
399
|
+
borderRadius: 6,
|
|
400
|
+
backgroundColor: _macOSDesignSystemColors.macOSColors.background.input,
|
|
401
|
+
marginBottom: 6
|
|
402
|
+
},
|
|
403
|
+
deviceIcon: {
|
|
404
|
+
width: 32,
|
|
405
|
+
height: 32,
|
|
406
|
+
borderRadius: 8,
|
|
407
|
+
backgroundColor: _macOSDesignSystemColors.macOSColors.background.hover,
|
|
408
|
+
alignItems: "center",
|
|
409
|
+
justifyContent: "center",
|
|
410
|
+
marginRight: 10
|
|
411
|
+
},
|
|
412
|
+
deviceInfo: {
|
|
413
|
+
flex: 1,
|
|
414
|
+
marginRight: 8
|
|
415
|
+
},
|
|
416
|
+
deviceName: {
|
|
417
|
+
fontSize: 13,
|
|
418
|
+
fontWeight: "500",
|
|
419
|
+
color: _macOSDesignSystemColors.macOSColors.text.primary
|
|
420
|
+
},
|
|
421
|
+
currentBadge: {
|
|
422
|
+
fontSize: 11,
|
|
423
|
+
fontWeight: "400",
|
|
424
|
+
color: _macOSDesignSystemColors.macOSColors.semantic.info
|
|
425
|
+
},
|
|
426
|
+
deviceMeta: {
|
|
427
|
+
fontSize: 11,
|
|
428
|
+
color: _macOSDesignSystemColors.macOSColors.text.muted,
|
|
429
|
+
marginTop: 2
|
|
430
|
+
},
|
|
431
|
+
removeButton: {
|
|
432
|
+
width: 32,
|
|
433
|
+
height: 32,
|
|
434
|
+
borderRadius: 6,
|
|
435
|
+
backgroundColor: _macOSDesignSystemColors.macOSColors.semantic.error + "15",
|
|
436
|
+
alignItems: "center",
|
|
437
|
+
justifyContent: "center"
|
|
438
|
+
},
|
|
439
|
+
removeButtonDisabled: {
|
|
440
|
+
opacity: 0.5
|
|
441
|
+
},
|
|
442
|
+
actions: {
|
|
443
|
+
marginTop: 16,
|
|
444
|
+
alignItems: "center"
|
|
445
|
+
},
|
|
446
|
+
primaryButton: {
|
|
447
|
+
width: "100%",
|
|
448
|
+
backgroundColor: _macOSDesignSystemColors.macOSColors.semantic.info,
|
|
449
|
+
borderRadius: 8,
|
|
450
|
+
paddingVertical: 12,
|
|
451
|
+
alignItems: "center"
|
|
452
|
+
},
|
|
453
|
+
primaryButtonText: {
|
|
454
|
+
fontSize: 14,
|
|
455
|
+
fontWeight: "600",
|
|
456
|
+
color: "#000"
|
|
457
|
+
},
|
|
458
|
+
hintText: {
|
|
459
|
+
fontSize: 12,
|
|
460
|
+
color: _macOSDesignSystemColors.macOSColors.text.muted,
|
|
461
|
+
fontStyle: "italic"
|
|
462
|
+
},
|
|
463
|
+
mobileInstructions: {
|
|
464
|
+
alignItems: "center",
|
|
465
|
+
paddingVertical: 8
|
|
466
|
+
},
|
|
467
|
+
mobileInstructionsText: {
|
|
468
|
+
fontSize: 12,
|
|
469
|
+
color: _macOSDesignSystemColors.macOSColors.text.secondary,
|
|
470
|
+
textAlign: "center",
|
|
471
|
+
lineHeight: 18
|
|
472
|
+
},
|
|
473
|
+
mobileInstructionsLink: {
|
|
474
|
+
fontSize: 13,
|
|
475
|
+
fontWeight: "600",
|
|
476
|
+
color: _macOSDesignSystemColors.macOSColors.semantic.info,
|
|
477
|
+
marginTop: 4
|
|
478
|
+
}
|
|
479
|
+
});
|
|
@@ -60,7 +60,6 @@ const UpgradePrompt = ({
|
|
|
60
60
|
compact = false
|
|
61
61
|
}) => {
|
|
62
62
|
const [showLicenseModal, setShowLicenseModal] = (0, _react.useState)(false);
|
|
63
|
-
const license = (0, _license.useLicense)();
|
|
64
63
|
const handlePress = (0, _react.useCallback)(() => {
|
|
65
64
|
if (onUpgradePress) {
|
|
66
65
|
onUpgradePress();
|
|
@@ -86,8 +85,7 @@ const UpgradePrompt = ({
|
|
|
86
85
|
})]
|
|
87
86
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LicenseEntryModal.LicenseEntryModal, {
|
|
88
87
|
visible: showLicenseModal,
|
|
89
|
-
onClose: handleCloseModal
|
|
90
|
-
license: license
|
|
88
|
+
onClose: handleCloseModal
|
|
91
89
|
})]
|
|
92
90
|
});
|
|
93
91
|
}
|
|
@@ -120,8 +118,7 @@ const UpgradePrompt = ({
|
|
|
120
118
|
})]
|
|
121
119
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LicenseEntryModal.LicenseEntryModal, {
|
|
122
120
|
visible: showLicenseModal,
|
|
123
|
-
onClose: handleCloseModal
|
|
124
|
-
license: license
|
|
121
|
+
onClose: handleCloseModal
|
|
125
122
|
})]
|
|
126
123
|
});
|
|
127
124
|
};
|
|
@@ -271,8 +268,7 @@ const ProFeatureBanner = ({
|
|
|
271
268
|
})]
|
|
272
269
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LicenseEntryModal.LicenseEntryModal, {
|
|
273
270
|
visible: showLicenseModal,
|
|
274
|
-
onClose: handleCloseModal
|
|
275
|
-
license: license
|
|
271
|
+
onClose: handleCloseModal
|
|
276
272
|
})]
|
|
277
273
|
});
|
|
278
274
|
};
|
|
@@ -407,8 +403,7 @@ const UpgradeModal = ({
|
|
|
407
403
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LicenseEntryModal.LicenseEntryModal, {
|
|
408
404
|
visible: showLicenseModal,
|
|
409
405
|
onClose: handleCloseLicenseModal,
|
|
410
|
-
onSuccess: handleLicenseSuccess
|
|
411
|
-
license: license
|
|
406
|
+
onSuccess: handleLicenseSuccess
|
|
412
407
|
})]
|
|
413
408
|
});
|
|
414
409
|
};
|