@buoy-gg/shared-ui 7.0.22 → 7.0.24
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 +39 -16
- package/lib/commonjs/dataViewer/JsonStringNotice.js +59 -0
- package/lib/commonjs/dataViewer/ThemedSplitView.js +20 -1
- package/lib/commonjs/dataViewer/TimestampDeltaBar.js +96 -0
- package/lib/commonjs/dataViewer/index.js +52 -0
- package/lib/commonjs/dataViewer/jsonStringValue.js +94 -0
- package/lib/commonjs/dataViewer/timestampDiff.js +146 -0
- package/lib/commonjs/hooks/safe-area-impl.js +1 -1
- package/lib/commonjs/index.js +50 -1
- package/lib/commonjs/license/FeatureGate.js +43 -10
- package/lib/commonjs/license/FreeAccountPrompt.js +181 -0
- package/lib/commonjs/license/index.js +57 -42
- package/lib/commonjs/license/licenseModule.js +99 -0
- package/lib/commonjs/license/tierLimits.js +165 -0
- package/lib/commonjs/ui/backgrounds/BackgroundSwitcher.js +180 -0
- package/lib/commonjs/ui/backgrounds/README.md +115 -0
- package/lib/commonjs/ui/backgrounds/ToolBackground.js +74 -0
- package/lib/commonjs/ui/backgrounds/backgroundStore.js +116 -0
- package/lib/commonjs/ui/backgrounds/index.js +70 -0
- package/lib/commonjs/ui/backgrounds/primitives.js +333 -0
- package/lib/commonjs/ui/backgrounds/registry.js +112 -0
- package/lib/commonjs/ui/backgrounds/rng.js +72 -0
- package/lib/commonjs/ui/backgrounds/types.js +1 -0
- package/lib/commonjs/ui/backgrounds/variants/deepField.js +351 -0
- package/lib/commonjs/ui/backgrounds/variants/lattice.js +579 -0
- package/lib/commonjs/ui/backgrounds/variants/starfield.js +210 -0
- package/lib/commonjs/ui/index.js +15 -3
- package/lib/module/JsModal.js +39 -16
- package/lib/module/dataViewer/JsonStringNotice.js +54 -0
- package/lib/module/dataViewer/ThemedSplitView.js +20 -1
- package/lib/module/dataViewer/TimestampDeltaBar.js +91 -0
- package/lib/module/dataViewer/index.js +4 -0
- package/lib/module/dataViewer/jsonStringValue.js +89 -0
- package/lib/module/dataViewer/timestampDiff.js +139 -0
- package/lib/module/hooks/safe-area-impl.js +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/license/FeatureGate.js +43 -10
- package/lib/module/license/FreeAccountPrompt.js +176 -0
- package/lib/module/license/index.js +5 -40
- package/lib/module/license/licenseModule.js +92 -0
- package/lib/module/license/tierLimits.js +158 -0
- package/lib/module/ui/backgrounds/BackgroundSwitcher.js +176 -0
- package/lib/module/ui/backgrounds/README.md +115 -0
- package/lib/module/ui/backgrounds/ToolBackground.js +70 -0
- package/lib/module/ui/backgrounds/backgroundStore.js +111 -0
- package/lib/module/ui/backgrounds/index.js +9 -0
- package/lib/module/ui/backgrounds/primitives.js +328 -0
- package/lib/module/ui/backgrounds/registry.js +105 -0
- package/lib/module/ui/backgrounds/rng.js +65 -0
- package/lib/module/ui/backgrounds/types.js +1 -0
- package/lib/module/ui/backgrounds/variants/deepField.js +347 -0
- package/lib/module/ui/backgrounds/variants/lattice.js +575 -0
- package/lib/module/ui/backgrounds/variants/starfield.js +206 -0
- package/lib/module/ui/index.js +3 -0
- package/lib/typescript/commonjs/JsModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/JsonStringNotice.d.ts +6 -0
- package/lib/typescript/commonjs/dataViewer/JsonStringNotice.d.ts.map +1 -0
- package/lib/typescript/commonjs/dataViewer/ThemedSplitView.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/TimestampDeltaBar.d.ts +7 -0
- package/lib/typescript/commonjs/dataViewer/TimestampDeltaBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/dataViewer/index.d.ts +6 -0
- package/lib/typescript/commonjs/dataViewer/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/jsonStringValue.d.ts +25 -0
- package/lib/typescript/commonjs/dataViewer/jsonStringValue.d.ts.map +1 -0
- package/lib/typescript/commonjs/dataViewer/timestampDiff.d.ts +55 -0
- package/lib/typescript/commonjs/dataViewer/timestampDiff.d.ts.map +1 -0
- 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/FeatureGate.d.ts +19 -3
- package/lib/typescript/commonjs/license/FeatureGate.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/FreeAccountPrompt.d.ts +23 -0
- package/lib/typescript/commonjs/license/FreeAccountPrompt.d.ts.map +1 -0
- package/lib/typescript/commonjs/license/index.d.ts +6 -15
- package/lib/typescript/commonjs/license/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/licenseModule.d.ts +55 -0
- package/lib/typescript/commonjs/license/licenseModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/license/tierLimits.d.ts +143 -0
- package/lib/typescript/commonjs/license/tierLimits.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/BackgroundSwitcher.d.ts +13 -0
- package/lib/typescript/commonjs/ui/backgrounds/BackgroundSwitcher.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/ToolBackground.d.ts +30 -0
- package/lib/typescript/commonjs/ui/backgrounds/ToolBackground.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/backgroundStore.d.ts +43 -0
- package/lib/typescript/commonjs/ui/backgrounds/backgroundStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/index.d.ts +7 -0
- package/lib/typescript/commonjs/ui/backgrounds/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/primitives.d.ts +106 -0
- package/lib/typescript/commonjs/ui/backgrounds/primitives.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/registry.d.ts +28 -0
- package/lib/typescript/commonjs/ui/backgrounds/registry.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/rng.d.ts +27 -0
- package/lib/typescript/commonjs/ui/backgrounds/rng.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/types.d.ts +14 -0
- package/lib/typescript/commonjs/ui/backgrounds/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/deepField.d.ts +65 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/deepField.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/lattice.d.ts +33 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/lattice.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/starfield.d.ts +12 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/starfield.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/index.d.ts +1 -0
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/JsModal.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/JsonStringNotice.d.ts +6 -0
- package/lib/typescript/module/dataViewer/JsonStringNotice.d.ts.map +1 -0
- package/lib/typescript/module/dataViewer/ThemedSplitView.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/TimestampDeltaBar.d.ts +7 -0
- package/lib/typescript/module/dataViewer/TimestampDeltaBar.d.ts.map +1 -0
- package/lib/typescript/module/dataViewer/index.d.ts +6 -0
- package/lib/typescript/module/dataViewer/index.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/jsonStringValue.d.ts +25 -0
- package/lib/typescript/module/dataViewer/jsonStringValue.d.ts.map +1 -0
- package/lib/typescript/module/dataViewer/timestampDiff.d.ts +55 -0
- package/lib/typescript/module/dataViewer/timestampDiff.d.ts.map +1 -0
- 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/FeatureGate.d.ts +19 -3
- package/lib/typescript/module/license/FeatureGate.d.ts.map +1 -1
- package/lib/typescript/module/license/FreeAccountPrompt.d.ts +23 -0
- package/lib/typescript/module/license/FreeAccountPrompt.d.ts.map +1 -0
- package/lib/typescript/module/license/index.d.ts +6 -15
- package/lib/typescript/module/license/index.d.ts.map +1 -1
- package/lib/typescript/module/license/licenseModule.d.ts +55 -0
- package/lib/typescript/module/license/licenseModule.d.ts.map +1 -0
- package/lib/typescript/module/license/tierLimits.d.ts +143 -0
- package/lib/typescript/module/license/tierLimits.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/BackgroundSwitcher.d.ts +13 -0
- package/lib/typescript/module/ui/backgrounds/BackgroundSwitcher.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/ToolBackground.d.ts +30 -0
- package/lib/typescript/module/ui/backgrounds/ToolBackground.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/backgroundStore.d.ts +43 -0
- package/lib/typescript/module/ui/backgrounds/backgroundStore.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/index.d.ts +7 -0
- package/lib/typescript/module/ui/backgrounds/index.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/primitives.d.ts +106 -0
- package/lib/typescript/module/ui/backgrounds/primitives.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/registry.d.ts +28 -0
- package/lib/typescript/module/ui/backgrounds/registry.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/rng.d.ts +27 -0
- package/lib/typescript/module/ui/backgrounds/rng.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/types.d.ts +14 -0
- package/lib/typescript/module/ui/backgrounds/types.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/variants/deepField.d.ts +65 -0
- package/lib/typescript/module/ui/backgrounds/variants/deepField.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/variants/lattice.d.ts +33 -0
- package/lib/typescript/module/ui/backgrounds/variants/lattice.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/variants/starfield.d.ts +12 -0
- package/lib/typescript/module/ui/backgrounds/variants/starfield.d.ts.map +1 -0
- package/lib/typescript/module/ui/index.d.ts +1 -0
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/scripts/detect-safe-area.js +0 -20
package/lib/commonjs/index.js
CHANGED
|
@@ -80,8 +80,15 @@ var _exportNames = {
|
|
|
80
80
|
LicenseEntryModal: true,
|
|
81
81
|
ProBadge: true,
|
|
82
82
|
ProUpgradeModal: true,
|
|
83
|
+
FreeAccountPrompt: true,
|
|
84
|
+
LOGIN_COMMAND: true,
|
|
83
85
|
getUseIsPro: true,
|
|
84
|
-
getUseLicense: true
|
|
86
|
+
getUseLicense: true,
|
|
87
|
+
getUseTier: true,
|
|
88
|
+
TIER_LIMITS: true,
|
|
89
|
+
useLimit: true,
|
|
90
|
+
resolveEffectiveTier: true,
|
|
91
|
+
freeKeyRaises: true
|
|
85
92
|
};
|
|
86
93
|
Object.defineProperty(exports, "EnvironmentIndicator", {
|
|
87
94
|
enumerable: true,
|
|
@@ -107,6 +114,12 @@ Object.defineProperty(exports, "FeatureGate", {
|
|
|
107
114
|
return _index12.FeatureGate;
|
|
108
115
|
}
|
|
109
116
|
});
|
|
117
|
+
Object.defineProperty(exports, "FreeAccountPrompt", {
|
|
118
|
+
enumerable: true,
|
|
119
|
+
get: function () {
|
|
120
|
+
return _index12.FreeAccountPrompt;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
110
123
|
Object.defineProperty(exports, "HintsProvider", {
|
|
111
124
|
enumerable: true,
|
|
112
125
|
get: function () {
|
|
@@ -119,6 +132,12 @@ Object.defineProperty(exports, "JsModal", {
|
|
|
119
132
|
return _JsModal.JsModal;
|
|
120
133
|
}
|
|
121
134
|
});
|
|
135
|
+
Object.defineProperty(exports, "LOGIN_COMMAND", {
|
|
136
|
+
enumerable: true,
|
|
137
|
+
get: function () {
|
|
138
|
+
return _index12.LOGIN_COMMAND;
|
|
139
|
+
}
|
|
140
|
+
});
|
|
122
141
|
Object.defineProperty(exports, "LicenseEntryModal", {
|
|
123
142
|
enumerable: true,
|
|
124
143
|
get: function () {
|
|
@@ -155,6 +174,12 @@ Object.defineProperty(exports, "Subscribable", {
|
|
|
155
174
|
return _index3.Subscribable;
|
|
156
175
|
}
|
|
157
176
|
});
|
|
177
|
+
Object.defineProperty(exports, "TIER_LIMITS", {
|
|
178
|
+
enumerable: true,
|
|
179
|
+
get: function () {
|
|
180
|
+
return _index12.TIER_LIMITS;
|
|
181
|
+
}
|
|
182
|
+
});
|
|
158
183
|
Object.defineProperty(exports, "UpgradeModal", {
|
|
159
184
|
enumerable: true,
|
|
160
185
|
get: function () {
|
|
@@ -209,6 +234,12 @@ Object.defineProperty(exports, "formatValue", {
|
|
|
209
234
|
return _index3.formatValue;
|
|
210
235
|
}
|
|
211
236
|
});
|
|
237
|
+
Object.defineProperty(exports, "freeKeyRaises", {
|
|
238
|
+
enumerable: true,
|
|
239
|
+
get: function () {
|
|
240
|
+
return _index12.freeKeyRaises;
|
|
241
|
+
}
|
|
242
|
+
});
|
|
212
243
|
Object.defineProperty(exports, "gameUIColors", {
|
|
213
244
|
enumerable: true,
|
|
214
245
|
get: function () {
|
|
@@ -305,6 +336,12 @@ Object.defineProperty(exports, "getUseLicense", {
|
|
|
305
336
|
return _index12.getUseLicense;
|
|
306
337
|
}
|
|
307
338
|
});
|
|
339
|
+
Object.defineProperty(exports, "getUseTier", {
|
|
340
|
+
enumerable: true,
|
|
341
|
+
get: function () {
|
|
342
|
+
return _index12.getUseTier;
|
|
343
|
+
}
|
|
344
|
+
});
|
|
308
345
|
Object.defineProperty(exports, "getValueSize", {
|
|
309
346
|
enumerable: true,
|
|
310
347
|
get: function () {
|
|
@@ -425,6 +462,12 @@ Object.defineProperty(exports, "reloadApp", {
|
|
|
425
462
|
return _index3.reloadApp;
|
|
426
463
|
}
|
|
427
464
|
});
|
|
465
|
+
Object.defineProperty(exports, "resolveEffectiveTier", {
|
|
466
|
+
enumerable: true,
|
|
467
|
+
get: function () {
|
|
468
|
+
return _index12.resolveEffectiveTier;
|
|
469
|
+
}
|
|
470
|
+
});
|
|
428
471
|
Object.defineProperty(exports, "resolveReloadStrategy", {
|
|
429
472
|
enumerable: true,
|
|
430
473
|
get: function () {
|
|
@@ -515,6 +558,12 @@ Object.defineProperty(exports, "useHintsDisabled", {
|
|
|
515
558
|
return _index10.useHintsDisabled;
|
|
516
559
|
}
|
|
517
560
|
});
|
|
561
|
+
Object.defineProperty(exports, "useLimit", {
|
|
562
|
+
enumerable: true,
|
|
563
|
+
get: function () {
|
|
564
|
+
return _index12.useLimit;
|
|
565
|
+
}
|
|
566
|
+
});
|
|
518
567
|
Object.defineProperty(exports, "usePersistedState", {
|
|
519
568
|
enumerable: true,
|
|
520
569
|
get: function () {
|
|
@@ -11,6 +11,9 @@ var _gameUIColors = require("../ui/gameUI/constants/gameUIColors.js");
|
|
|
11
11
|
var _lucideIcons = require("../icons/lucide-icons.js");
|
|
12
12
|
var _LicenseEntryModal = require("./LicenseEntryModal.js");
|
|
13
13
|
var _openPricing = require("./openPricing.js");
|
|
14
|
+
var _FreeAccountPrompt = require("./FreeAccountPrompt.js");
|
|
15
|
+
var _licenseModule = require("./licenseModule.js");
|
|
16
|
+
var _tierLimits = require("./tierLimits.js");
|
|
14
17
|
var _license = require("@buoy-gg/license");
|
|
15
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
19
|
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); }
|
|
@@ -55,14 +58,19 @@ exports.ProBadge = ProBadge;
|
|
|
55
58
|
const ProUpgradeModal = ({
|
|
56
59
|
visible,
|
|
57
60
|
onClose,
|
|
58
|
-
featureName = "This feature"
|
|
61
|
+
featureName = "This feature",
|
|
62
|
+
limitKey
|
|
59
63
|
}) => {
|
|
60
64
|
// Simple wrapper around UpgradeModal with minimal description and no benefits
|
|
61
65
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(UpgradeModal, {
|
|
62
66
|
visible: visible,
|
|
63
67
|
onClose: onClose,
|
|
64
|
-
featureName: featureName
|
|
65
|
-
|
|
68
|
+
featureName: featureName
|
|
69
|
+
// Only meaningful when this upsell is about a LIMIT; without it the
|
|
70
|
+
// description below (which promises Pro) is the accurate message.
|
|
71
|
+
,
|
|
72
|
+
limitKey: limitKey,
|
|
73
|
+
description: limitKey ? undefined : `${featureName} requires a Pro subscription.`
|
|
66
74
|
});
|
|
67
75
|
};
|
|
68
76
|
exports.ProUpgradeModal = ProUpgradeModal;
|
|
@@ -73,9 +81,13 @@ exports.ProUpgradeModal = ProUpgradeModal;
|
|
|
73
81
|
const UpgradePrompt = ({
|
|
74
82
|
featureName,
|
|
75
83
|
onUpgradePress,
|
|
76
|
-
compact = false
|
|
84
|
+
compact = false,
|
|
85
|
+
limitKey
|
|
77
86
|
}) => {
|
|
78
87
|
const [showLicenseModal, setShowLicenseModal] = (0, _react.useState)(false);
|
|
88
|
+
// Only offer the free key when it would actually raise this limit — see
|
|
89
|
+
// UpgradeModalProps.limitKey.
|
|
90
|
+
const isAnonymous = (0, _licenseModule.getUseTier)()() === "anonymous" && limitKey != null && (0, _tierLimits.freeKeyRaises)(limitKey);
|
|
79
91
|
const handlePress = (0, _react.useCallback)(() => {
|
|
80
92
|
if (onUpgradePress) {
|
|
81
93
|
onUpgradePress();
|
|
@@ -103,7 +115,11 @@ const UpgradePrompt = ({
|
|
|
103
115
|
style: styles.compactText,
|
|
104
116
|
children: "PRO"
|
|
105
117
|
})]
|
|
106
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
118
|
+
}), isAnonymous ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_FreeAccountPrompt.FreeAccountPrompt, {
|
|
119
|
+
visible: showLicenseModal,
|
|
120
|
+
onClose: handleCloseModal,
|
|
121
|
+
featureName: featureName
|
|
122
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_LicenseEntryModal.LicenseEntryModal, {
|
|
107
123
|
visible: showLicenseModal,
|
|
108
124
|
onClose: handleCloseModal
|
|
109
125
|
})]
|
|
@@ -120,23 +136,27 @@ const UpgradePrompt = ({
|
|
|
120
136
|
})
|
|
121
137
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
122
138
|
style: styles.title,
|
|
123
|
-
children: "Pro Feature"
|
|
139
|
+
children: isAnonymous ? "Get a free key" : "Pro Feature"
|
|
124
140
|
}), featureName && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
125
141
|
style: styles.featureName,
|
|
126
142
|
children: featureName
|
|
127
143
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
128
144
|
style: styles.description,
|
|
129
|
-
children: "Upgrade to React Buoy Pro to unlock this feature and more."
|
|
145
|
+
children: isAnonymous ? "Buoy works without an account, with a small slice of each tool. A free key opens it up." : "Upgrade to React Buoy Pro to unlock this feature and more."
|
|
130
146
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
131
147
|
style: styles.upgradeButton,
|
|
132
148
|
onPress: handlePress,
|
|
133
149
|
activeOpacity: 0.8,
|
|
134
150
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
135
151
|
style: styles.upgradeButtonText,
|
|
136
|
-
children: "Upgrade to Pro"
|
|
152
|
+
children: isAnonymous ? "Get a free key" : "Upgrade to Pro"
|
|
137
153
|
})
|
|
138
154
|
})]
|
|
139
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
155
|
+
}), isAnonymous ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_FreeAccountPrompt.FreeAccountPrompt, {
|
|
156
|
+
visible: showLicenseModal,
|
|
157
|
+
onClose: handleCloseModal,
|
|
158
|
+
featureName: featureName
|
|
159
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_LicenseEntryModal.LicenseEntryModal, {
|
|
140
160
|
visible: showLicenseModal,
|
|
141
161
|
onClose: handleCloseModal
|
|
142
162
|
})]
|
|
@@ -317,8 +337,14 @@ const UpgradeModal = ({
|
|
|
317
337
|
onClose,
|
|
318
338
|
featureName = "This Feature",
|
|
319
339
|
description,
|
|
320
|
-
benefits
|
|
340
|
+
benefits,
|
|
341
|
+
limitKey
|
|
321
342
|
}) => {
|
|
343
|
+
// Anonymous users get a different ask — but ONLY when a free key would
|
|
344
|
+
// actually fix what they just hit. Everything else here is Pro-exclusive,
|
|
345
|
+
// where a free key changes nothing and offering one would be dishonest.
|
|
346
|
+
const tier = (0, _licenseModule.getUseTier)()();
|
|
347
|
+
const offerFreeKey = tier === "anonymous" && limitKey != null && (0, _tierLimits.freeKeyRaises)(limitKey);
|
|
322
348
|
const hasBenefits = benefits && benefits.length > 0;
|
|
323
349
|
const [showLicenseModal, setShowLicenseModal] = (0, _react.useState)(false);
|
|
324
350
|
const license = (0, _license.useLicense)();
|
|
@@ -341,6 +367,13 @@ const UpgradeModal = ({
|
|
|
341
367
|
onClose();
|
|
342
368
|
}, [onClose]);
|
|
343
369
|
if (!visible) return null;
|
|
370
|
+
if (offerFreeKey) {
|
|
371
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_FreeAccountPrompt.FreeAccountPrompt, {
|
|
372
|
+
visible: visible,
|
|
373
|
+
onClose: onClose,
|
|
374
|
+
featureName: featureName === "This Feature" ? undefined : featureName
|
|
375
|
+
});
|
|
376
|
+
}
|
|
344
377
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
345
378
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Modal, {
|
|
346
379
|
visible: visible && !showLicenseModal,
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.LOGIN_COMMAND = exports.FreeAccountPrompt = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _gameUIColors = require("../ui/gameUI/constants/gameUIColors.js");
|
|
10
|
+
var _lucideIcons = require("../icons/lucide-icons.js");
|
|
11
|
+
var _index = require("../clipboard/index.js");
|
|
12
|
+
var _openPricing = require("./openPricing.js");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
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); }
|
|
15
|
+
/**
|
|
16
|
+
* The upsell an ANONYMOUS user sees — someone with no key at all.
|
|
17
|
+
*
|
|
18
|
+
* Deliberately not the Pro modal. Their next step is free and takes about
|
|
19
|
+
* thirty seconds, so asking them for money would be asking the wrong question
|
|
20
|
+
* at the wrong moment, and would suppress exactly the signup this exists to
|
|
21
|
+
* produce. Pro is still offered, as a secondary action.
|
|
22
|
+
*
|
|
23
|
+
* The command is shown inline and copyable rather than linked, because there is
|
|
24
|
+
* no grace period: someone who just watched their limits shrink needs the fix
|
|
25
|
+
* in front of them, not a link to a page that has a link to a command.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/** The one thing a reader has to be able to act on. */
|
|
29
|
+
const LOGIN_COMMAND = exports.LOGIN_COMMAND = "npx buoy login";
|
|
30
|
+
const FreeAccountPrompt = ({
|
|
31
|
+
visible,
|
|
32
|
+
onClose,
|
|
33
|
+
featureName
|
|
34
|
+
}) => {
|
|
35
|
+
const [copied, setCopied] = (0, _react.useState)(false);
|
|
36
|
+
const resetTimer = (0, _react.useRef)(null);
|
|
37
|
+
(0, _react.useEffect)(() => () => {
|
|
38
|
+
if (resetTimer.current) clearTimeout(resetTimer.current);
|
|
39
|
+
}, []);
|
|
40
|
+
const handleCopy = (0, _react.useCallback)(() => {
|
|
41
|
+
void (0, _index.copyToClipboard)(LOGIN_COMMAND).then(ok => {
|
|
42
|
+
if (!ok) return;
|
|
43
|
+
setCopied(true);
|
|
44
|
+
if (resetTimer.current) clearTimeout(resetTimer.current);
|
|
45
|
+
resetTimer.current = setTimeout(() => setCopied(false), 1500);
|
|
46
|
+
});
|
|
47
|
+
}, []);
|
|
48
|
+
if (!visible) return null;
|
|
49
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Modal, {
|
|
50
|
+
visible: visible,
|
|
51
|
+
transparent: true,
|
|
52
|
+
animationType: "fade",
|
|
53
|
+
onRequestClose: onClose,
|
|
54
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
55
|
+
style: styles.overlay,
|
|
56
|
+
onPress: onClose,
|
|
57
|
+
activeOpacity: 1,
|
|
58
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
59
|
+
style: styles.card,
|
|
60
|
+
activeOpacity: 1,
|
|
61
|
+
onPress: () => {},
|
|
62
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
63
|
+
style: styles.close,
|
|
64
|
+
onPress: onClose,
|
|
65
|
+
activeOpacity: 0.7,
|
|
66
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideIcons.X, {
|
|
67
|
+
size: 18,
|
|
68
|
+
color: _gameUIColors.buoyColors.textMuted
|
|
69
|
+
})
|
|
70
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
71
|
+
style: styles.title,
|
|
72
|
+
children: featureName ? `More ${featureName}` : "See more"
|
|
73
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
74
|
+
style: styles.subtitle,
|
|
75
|
+
children: "Buoy runs without an account \u2014 you just get a small slice of each tool. A free key opens it up."
|
|
76
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
77
|
+
style: styles.command,
|
|
78
|
+
onPress: handleCopy,
|
|
79
|
+
activeOpacity: 0.7,
|
|
80
|
+
accessibilityLabel: `Copy ${LOGIN_COMMAND}`,
|
|
81
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
82
|
+
style: styles.commandText,
|
|
83
|
+
children: LOGIN_COMMAND
|
|
84
|
+
}), copied ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideIcons.Check, {
|
|
85
|
+
size: 14,
|
|
86
|
+
color: _gameUIColors.buoyColors.success
|
|
87
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideIcons.Copy, {
|
|
88
|
+
size: 14,
|
|
89
|
+
color: _gameUIColors.buoyColors.textMuted
|
|
90
|
+
})]
|
|
91
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
92
|
+
style: styles.reassure,
|
|
93
|
+
children: "Free forever. No card. About thirty seconds."
|
|
94
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
95
|
+
style: styles.secondary,
|
|
96
|
+
onPress: () => (0, _openPricing.openPricing)(),
|
|
97
|
+
activeOpacity: 0.8,
|
|
98
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
99
|
+
style: styles.secondaryText,
|
|
100
|
+
children: "Or see Pro"
|
|
101
|
+
})
|
|
102
|
+
})]
|
|
103
|
+
})
|
|
104
|
+
})
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
exports.FreeAccountPrompt = FreeAccountPrompt;
|
|
108
|
+
const styles = _reactNative.StyleSheet.create({
|
|
109
|
+
overlay: {
|
|
110
|
+
flex: 1,
|
|
111
|
+
backgroundColor: "rgba(0, 0, 0, 0.75)",
|
|
112
|
+
alignItems: "center",
|
|
113
|
+
justifyContent: "center",
|
|
114
|
+
padding: 20
|
|
115
|
+
},
|
|
116
|
+
card: {
|
|
117
|
+
backgroundColor: _gameUIColors.buoyColors.card,
|
|
118
|
+
borderRadius: 16,
|
|
119
|
+
borderWidth: 1,
|
|
120
|
+
borderColor: _gameUIColors.buoyColors.primary + "60",
|
|
121
|
+
padding: 24,
|
|
122
|
+
maxWidth: 340,
|
|
123
|
+
width: "100%",
|
|
124
|
+
position: "relative"
|
|
125
|
+
},
|
|
126
|
+
close: {
|
|
127
|
+
position: "absolute",
|
|
128
|
+
top: 12,
|
|
129
|
+
right: 12,
|
|
130
|
+
padding: 6,
|
|
131
|
+
zIndex: 1
|
|
132
|
+
},
|
|
133
|
+
title: {
|
|
134
|
+
fontSize: 20,
|
|
135
|
+
fontWeight: "700",
|
|
136
|
+
color: _gameUIColors.buoyColors.text,
|
|
137
|
+
textAlign: "center",
|
|
138
|
+
marginBottom: 8
|
|
139
|
+
},
|
|
140
|
+
subtitle: {
|
|
141
|
+
fontSize: 13,
|
|
142
|
+
lineHeight: 19,
|
|
143
|
+
color: _gameUIColors.buoyColors.textMuted,
|
|
144
|
+
textAlign: "center",
|
|
145
|
+
marginBottom: 20
|
|
146
|
+
},
|
|
147
|
+
command: {
|
|
148
|
+
flexDirection: "row",
|
|
149
|
+
alignItems: "center",
|
|
150
|
+
justifyContent: "space-between",
|
|
151
|
+
backgroundColor: _gameUIColors.buoyColors.base,
|
|
152
|
+
borderRadius: 8,
|
|
153
|
+
borderWidth: 1,
|
|
154
|
+
borderColor: _gameUIColors.buoyColors.border,
|
|
155
|
+
paddingHorizontal: 14,
|
|
156
|
+
paddingVertical: 12,
|
|
157
|
+
gap: 10
|
|
158
|
+
},
|
|
159
|
+
commandText: {
|
|
160
|
+
fontSize: 14,
|
|
161
|
+
fontWeight: "600",
|
|
162
|
+
color: _gameUIColors.buoyColors.text,
|
|
163
|
+
fontFamily: "monospace"
|
|
164
|
+
},
|
|
165
|
+
reassure: {
|
|
166
|
+
fontSize: 12,
|
|
167
|
+
color: _gameUIColors.buoyColors.textMuted,
|
|
168
|
+
textAlign: "center",
|
|
169
|
+
marginTop: 10
|
|
170
|
+
},
|
|
171
|
+
secondary: {
|
|
172
|
+
marginTop: 18,
|
|
173
|
+
paddingVertical: 10,
|
|
174
|
+
alignItems: "center"
|
|
175
|
+
},
|
|
176
|
+
secondaryText: {
|
|
177
|
+
fontSize: 13,
|
|
178
|
+
fontWeight: "600",
|
|
179
|
+
color: _gameUIColors.buoyColors.textMuted
|
|
180
|
+
}
|
|
181
|
+
});
|
|
@@ -9,6 +9,18 @@ Object.defineProperty(exports, "FeatureGate", {
|
|
|
9
9
|
return _FeatureGate.FeatureGate;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "FreeAccountPrompt", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _FreeAccountPrompt.FreeAccountPrompt;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "LOGIN_COMMAND", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _FreeAccountPrompt.LOGIN_COMMAND;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
12
24
|
Object.defineProperty(exports, "LicenseEntryModal", {
|
|
13
25
|
enumerable: true,
|
|
14
26
|
get: function () {
|
|
@@ -33,6 +45,12 @@ Object.defineProperty(exports, "ProUpgradeModal", {
|
|
|
33
45
|
return _FeatureGate.ProUpgradeModal;
|
|
34
46
|
}
|
|
35
47
|
});
|
|
48
|
+
Object.defineProperty(exports, "TIER_LIMITS", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _tierLimits.TIER_LIMITS;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
36
54
|
Object.defineProperty(exports, "UpgradeModal", {
|
|
37
55
|
enumerable: true,
|
|
38
56
|
get: function () {
|
|
@@ -45,53 +63,50 @@ Object.defineProperty(exports, "UpgradePrompt", {
|
|
|
45
63
|
return _FeatureGate.UpgradePrompt;
|
|
46
64
|
}
|
|
47
65
|
});
|
|
48
|
-
exports
|
|
49
|
-
|
|
66
|
+
Object.defineProperty(exports, "freeKeyRaises", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _tierLimits.freeKeyRaises;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "getUseIsPro", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _licenseModule.getUseIsPro;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "getUseLicense", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _licenseModule.getUseLicense;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "getUseTier", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _licenseModule.getUseTier;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "resolveEffectiveTier", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _tierLimits.resolveEffectiveTier;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
50
96
|
Object.defineProperty(exports, "useFeatureGate", {
|
|
51
97
|
enumerable: true,
|
|
52
98
|
get: function () {
|
|
53
99
|
return _FeatureGate.useFeatureGate;
|
|
54
100
|
}
|
|
55
101
|
});
|
|
102
|
+
Object.defineProperty(exports, "useLimit", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _tierLimits.useLimit;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
56
108
|
var _FeatureGate = require("./FeatureGate.js");
|
|
57
109
|
var _LicenseEntryModal = require("./LicenseEntryModal.js");
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
let _useLicense = null;
|
|
62
|
-
let _licenseLoadAttempted = false;
|
|
63
|
-
function loadLicenseModuleCentral() {
|
|
64
|
-
if (_licenseLoadAttempted) return;
|
|
65
|
-
_licenseLoadAttempted = true;
|
|
66
|
-
try {
|
|
67
|
-
const mod = require("@buoy-gg/license");
|
|
68
|
-
if (mod) {
|
|
69
|
-
_useIsPro = mod.useIsPro ?? null;
|
|
70
|
-
_useLicense = mod.useLicense ?? null;
|
|
71
|
-
}
|
|
72
|
-
} catch {
|
|
73
|
-
// License package not available - will use fallback
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Get the useIsPro hook from @buoy-gg/license
|
|
79
|
-
* Falls back to () => false if license package is not available
|
|
80
|
-
*
|
|
81
|
-
* IMPORTANT: Use this instead of doing your own lazy loading in other packages
|
|
82
|
-
*/
|
|
83
|
-
function getUseIsPro() {
|
|
84
|
-
loadLicenseModuleCentral();
|
|
85
|
-
return _useIsPro ?? (() => false);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Get the useLicense hook from @buoy-gg/license
|
|
90
|
-
* Returns null if license package is not available
|
|
91
|
-
*
|
|
92
|
-
* IMPORTANT: Use this instead of doing your own lazy loading in other packages
|
|
93
|
-
*/
|
|
94
|
-
function getUseLicense() {
|
|
95
|
-
loadLicenseModuleCentral();
|
|
96
|
-
return _useLicense;
|
|
97
|
-
}
|
|
110
|
+
var _FreeAccountPrompt = require("./FreeAccountPrompt.js");
|
|
111
|
+
var _licenseModule = require("./licenseModule.js");
|
|
112
|
+
var _tierLimits = require("./tierLimits.js");
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getUseIsPro = getUseIsPro;
|
|
7
|
+
exports.getUseLicense = getUseLicense;
|
|
8
|
+
exports.getUseTier = getUseTier;
|
|
9
|
+
exports.isAnonymousTierEnabled = isAnonymousTierEnabled;
|
|
10
|
+
/**
|
|
11
|
+
* Centralized lazy loading of `@buoy-gg/license`.
|
|
12
|
+
*
|
|
13
|
+
* This is the SINGLE place any package resolves license hooks — tools must not
|
|
14
|
+
* `require("@buoy-gg/license")` themselves. Lives in its own module (rather
|
|
15
|
+
* than `./index`) so `tierLimits` can consume it without an import cycle.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/** Access tier. Mirrors BuoyTier in @buoy-gg/license. */
|
|
19
|
+
|
|
20
|
+
let _useIsPro = null;
|
|
21
|
+
let _useLicense = null;
|
|
22
|
+
let _useTier = null;
|
|
23
|
+
let _anonymousTierEnabled = null;
|
|
24
|
+
let _licenseLoadAttempted = false;
|
|
25
|
+
function loadLicenseModuleCentral() {
|
|
26
|
+
if (_licenseLoadAttempted) return;
|
|
27
|
+
_licenseLoadAttempted = true;
|
|
28
|
+
try {
|
|
29
|
+
const mod = require("@buoy-gg/license");
|
|
30
|
+
if (mod) {
|
|
31
|
+
_useIsPro = mod.useIsPro ?? null;
|
|
32
|
+
_useLicense = mod.useLicense ?? null;
|
|
33
|
+
_useTier = mod.useTier ?? null;
|
|
34
|
+
_anonymousTierEnabled = typeof mod.ANONYMOUS_TIER_ENABLED === "boolean" ? mod.ANONYMOUS_TIER_ENABLED : null;
|
|
35
|
+
}
|
|
36
|
+
} catch {
|
|
37
|
+
// License package not available - will use fallback
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Get the useIsPro hook from @buoy-gg/license.
|
|
43
|
+
* Falls back to () => false if the license package is not available.
|
|
44
|
+
*
|
|
45
|
+
* IMPORTANT: Use this instead of doing your own lazy loading in other packages
|
|
46
|
+
*/
|
|
47
|
+
function getUseIsPro() {
|
|
48
|
+
loadLicenseModuleCentral();
|
|
49
|
+
return _useIsPro ?? (() => false);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Get the useLicense hook from @buoy-gg/license.
|
|
54
|
+
* Returns null if the license package is not available.
|
|
55
|
+
*
|
|
56
|
+
* IMPORTANT: Use this instead of doing your own lazy loading in other packages
|
|
57
|
+
*/
|
|
58
|
+
function getUseLicense() {
|
|
59
|
+
loadLicenseModuleCentral();
|
|
60
|
+
return _useLicense;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Get the useTier hook from @buoy-gg/license.
|
|
65
|
+
*
|
|
66
|
+
* Falls back to `"free"` — NOT `"anonymous"` — when the license package can't
|
|
67
|
+
* be resolved. That deliberately matches the existing `getUseIsPro()` fallback,
|
|
68
|
+
* which yields free-tier behavior today, and it picks the safer failure:
|
|
69
|
+
*
|
|
70
|
+
* - falling back to "anonymous" would let one bundler quirk silently cut every
|
|
71
|
+
* legitimate user's limits by ~80%;
|
|
72
|
+
* - falling back to "free" costs no revenue, because Pro still requires a key
|
|
73
|
+
* that a live license server validated — this path can never grant Pro.
|
|
74
|
+
*
|
|
75
|
+
* Reaching it at all requires `@buoy-gg/license` to be missing, and it is a
|
|
76
|
+
* hard dependency of `@buoy-gg/core`.
|
|
77
|
+
*/
|
|
78
|
+
function getUseTier() {
|
|
79
|
+
loadLicenseModuleCentral();
|
|
80
|
+
return _useTier ?? (() => "free");
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Whether the anonymous tier is switched on.
|
|
85
|
+
*
|
|
86
|
+
* The switch itself lives in @buoy-gg/license (see its config.ts) because the
|
|
87
|
+
* Weekend Pass change has to flip at the same moment as the reduced limits, and
|
|
88
|
+
* those live in different packages. Read through the same lazy loader as the
|
|
89
|
+
* hooks so a missing license package degrades gracefully rather than throwing
|
|
90
|
+
* at module load.
|
|
91
|
+
*
|
|
92
|
+
* Falls back to `false` — the anonymous tier off, everyone on free limits —
|
|
93
|
+
* which matches the `getUseTier()` fallback of "free". A build that cannot
|
|
94
|
+
* resolve the license package must never take limits AWAY from someone.
|
|
95
|
+
*/
|
|
96
|
+
function isAnonymousTierEnabled() {
|
|
97
|
+
loadLicenseModuleCentral();
|
|
98
|
+
return _anonymousTierEnabled ?? false;
|
|
99
|
+
}
|