@buoy-gg/shared-ui 7.0.36 → 7.0.38
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/README.md +33 -26
- package/floating.d.ts +1 -0
- package/floating.js +2 -0
- package/lib/commonjs/JsModal.js +16 -1
- package/lib/commonjs/JsModal.web.js +16 -1
- package/lib/commonjs/dataViewer/CyberpunkInput.js +6 -1
- package/lib/commonjs/dataViewer/LiveExplorer.js +28 -16
- package/lib/commonjs/hooks/safe-area-impl.js +1 -1
- package/lib/commonjs/icons/ReactQueryIcon.js +9 -161
- package/lib/commonjs/icons/SentryBugIcon.js +9 -171
- package/lib/commonjs/index.js +57 -6
- package/lib/commonjs/license/AccountSetup.js +56 -0
- package/lib/commonjs/license/AccountSetup.web.js +81 -0
- package/lib/commonjs/license/FeatureGate.js +10 -43
- package/lib/commonjs/license/FreeAccountPrompt.js +35 -12
- package/lib/commonjs/license/index.js +0 -6
- package/lib/commonjs/license/licenseModule.js +56 -36
- package/lib/commonjs/license/tierLimits.js +12 -63
- package/lib/commonjs/storage/devToolsStorageKeys.js +8 -1
- package/lib/commonjs/stores/BaseEventStore.js +21 -5
- package/lib/commonjs/stores/createToolStore.js +21 -3
- package/lib/commonjs/stores/floatingToolStore.js +71 -0
- package/lib/commonjs/stores/floatingToolStore.test.js +112 -0
- package/lib/commonjs/sync/toolActionRegistry.js +85 -2
- package/lib/commonjs/ui/backgrounds/README.md +52 -0
- package/lib/commonjs/ui/backgrounds/ToolBackground.js +4 -2
- package/lib/commonjs/ui/backgrounds/index.js +8 -1
- package/lib/commonjs/ui/backgrounds/registry.js +8 -0
- package/lib/commonjs/ui/backgrounds/variants/wormhole/motion.js +48 -0
- package/lib/commonjs/ui/backgrounds/variants/wormhole/textures.js +3 -0
- package/lib/commonjs/ui/backgrounds/variants/wormhole.js +133 -0
- package/lib/commonjs/ui/components/ClipboardHintBanner.js +5 -6
- package/lib/commonjs/ui/components/CompactRow.js +94 -74
- package/lib/commonjs/ui/components/DraggableHeader.js +16 -1
- package/lib/commonjs/ui/components/HeaderSearchButton.js +17 -4
- package/lib/commonjs/ui/floating/FloatingTool.js +1010 -0
- package/lib/commonjs/ui/floating/FloatingTool.web.js +591 -0
- package/lib/commonjs/ui/floating/FloatingToolHost.js +32 -0
- package/lib/commonjs/ui/floating/FloatingToolHost.web.js +28 -0
- package/lib/commonjs/ui/floating/index.js +105 -0
- package/lib/commonjs/ui/floating/index.web.js +105 -0
- package/lib/commonjs/ui/floating/onboardingConstants.js +70 -0
- package/lib/commonjs/ui/floating/onboardingConstants.web.js +34 -0
- package/lib/commonjs/ui/gameUI/constants/gameUIColors.js +3 -1
- package/lib/commonjs/ui/index.js +118 -2
- package/lib/commonjs/ui/night/nightTheme.js +10 -0
- package/lib/commonjs/ui/night/primitives.js +22 -5
- package/lib/commonjs/ui/otto/OttoSceneView.js +69 -0
- package/lib/commonjs/ui/otto/index.js +22 -0
- package/lib/commonjs/ui/otto/ottoEngine.js +10 -7
- package/lib/commonjs/ui/otto/ottoScenes.js +949 -0
- package/lib/commonjs/utils/minimalSuperJSON.js +13 -3
- package/lib/module/JsModal.js +16 -1
- package/lib/module/JsModal.web.js +16 -1
- package/lib/module/dataViewer/CyberpunkInput.js +6 -1
- package/lib/module/dataViewer/LiveExplorer.js +28 -16
- package/lib/module/hooks/safe-area-impl.js +1 -1
- package/lib/module/icons/ReactQueryIcon.js +9 -161
- package/lib/module/icons/SentryBugIcon.js +9 -171
- package/lib/module/index.js +4 -1
- package/lib/module/license/AccountSetup.js +52 -0
- package/lib/module/license/AccountSetup.web.js +77 -0
- package/lib/module/license/FeatureGate.js +10 -43
- package/lib/module/license/FreeAccountPrompt.js +35 -12
- package/lib/module/license/index.js +1 -1
- package/lib/module/license/licenseModule.js +50 -35
- package/lib/module/license/tierLimits.js +13 -63
- package/lib/module/storage/devToolsStorageKeys.js +8 -1
- package/lib/module/stores/BaseEventStore.js +21 -5
- package/lib/module/stores/createToolStore.js +21 -3
- package/lib/module/stores/floatingToolStore.js +61 -0
- package/lib/module/stores/floatingToolStore.test.js +111 -0
- package/lib/module/sync/toolActionRegistry.js +84 -2
- package/lib/module/ui/backgrounds/README.md +52 -0
- package/lib/module/ui/backgrounds/ToolBackground.js +4 -2
- package/lib/module/ui/backgrounds/index.js +2 -1
- package/lib/module/ui/backgrounds/registry.js +8 -0
- package/lib/module/ui/backgrounds/variants/wormhole/motion.js +44 -0
- package/lib/module/ui/backgrounds/variants/wormhole/textures.js +3 -0
- package/lib/module/ui/backgrounds/variants/wormhole.js +129 -0
- package/lib/module/ui/components/ClipboardHintBanner.js +5 -6
- package/lib/module/ui/components/CompactRow.js +94 -74
- package/lib/module/ui/components/DraggableHeader.js +16 -1
- package/lib/module/ui/components/HeaderSearchButton.js +17 -4
- package/lib/module/ui/floating/FloatingTool.js +1003 -0
- package/lib/module/ui/floating/FloatingTool.web.js +590 -0
- package/lib/module/ui/floating/FloatingToolHost.js +29 -0
- package/lib/module/ui/floating/FloatingToolHost.web.js +25 -0
- package/lib/module/ui/floating/index.js +6 -0
- package/lib/module/ui/floating/index.web.js +6 -0
- package/lib/module/ui/floating/onboardingConstants.js +64 -0
- package/lib/module/ui/floating/onboardingConstants.web.js +27 -0
- package/lib/module/ui/gameUI/constants/gameUIColors.js +3 -1
- package/lib/module/ui/index.js +5 -1
- package/lib/module/ui/night/nightTheme.js +10 -0
- package/lib/module/ui/night/primitives.js +22 -5
- package/lib/module/ui/otto/OttoSceneView.js +64 -0
- package/lib/module/ui/otto/index.js +3 -1
- package/lib/module/ui/otto/ottoEngine.js +10 -7
- package/lib/module/ui/otto/ottoScenes.js +942 -0
- package/lib/module/utils/minimalSuperJSON.js +13 -3
- package/lib/typescript/commonjs/JsModal.d.ts +43 -2
- package/lib/typescript/commonjs/JsModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/JsModal.web.d.ts +5 -2
- package/lib/typescript/commonjs/JsModal.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/CyberpunkInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/LiveExplorer.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/commonjs/icons/ReactQueryIcon.d.ts +1 -2
- package/lib/typescript/commonjs/icons/ReactQueryIcon.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/SentryBugIcon.d.ts +1 -2
- package/lib/typescript/commonjs/icons/SentryBugIcon.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +4 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/AccountSetup.d.ts +4 -0
- package/lib/typescript/commonjs/license/AccountSetup.d.ts.map +1 -0
- package/lib/typescript/commonjs/license/AccountSetup.web.d.ts +2 -0
- package/lib/typescript/commonjs/license/AccountSetup.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/license/FeatureGate.d.ts +3 -19
- package/lib/typescript/commonjs/license/FeatureGate.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/FreeAccountPrompt.d.ts +8 -11
- package/lib/typescript/commonjs/license/FreeAccountPrompt.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/index.d.ts +1 -1
- package/lib/typescript/commonjs/license/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/licenseModule.d.ts +18 -31
- package/lib/typescript/commonjs/license/licenseModule.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/tierLimits.d.ts +9 -52
- package/lib/typescript/commonjs/license/tierLimits.d.ts.map +1 -1
- package/lib/typescript/commonjs/storage/devToolsStorageKeys.d.ts +6 -0
- package/lib/typescript/commonjs/storage/devToolsStorageKeys.d.ts.map +1 -1
- package/lib/typescript/commonjs/stores/BaseEventStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/stores/createToolStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/stores/floatingToolStore.d.ts +27 -0
- package/lib/typescript/commonjs/stores/floatingToolStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/stores/floatingToolStore.test.d.ts +2 -0
- package/lib/typescript/commonjs/stores/floatingToolStore.test.d.ts.map +1 -0
- package/lib/typescript/commonjs/sync/toolActionRegistry.d.ts +4 -32
- package/lib/typescript/commonjs/sync/toolActionRegistry.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/ToolBackground.d.ts +7 -1
- package/lib/typescript/commonjs/ui/backgrounds/ToolBackground.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/index.d.ts +2 -1
- package/lib/typescript/commonjs/ui/backgrounds/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/registry.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/types.d.ts +11 -1
- package/lib/typescript/commonjs/ui/backgrounds/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/variants/wormhole/motion.d.ts +24 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/wormhole/motion.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/wormhole/textures.d.ts +13 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/wormhole/textures.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/wormhole.d.ts +3 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/wormhole.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/ClipboardHintBanner.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/CompactRow.d.ts +8 -1
- package/lib/typescript/commonjs/ui/components/CompactRow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/DraggableHeader.d.ts +4 -1
- package/lib/typescript/commonjs/ui/components/DraggableHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/HeaderSearchButton.d.ts +7 -1
- package/lib/typescript/commonjs/ui/components/HeaderSearchButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/floating/FloatingTool.d.ts +79 -0
- package/lib/typescript/commonjs/ui/floating/FloatingTool.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/floating/FloatingTool.web.d.ts +64 -0
- package/lib/typescript/commonjs/ui/floating/FloatingTool.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/floating/FloatingToolHost.d.ts +3 -0
- package/lib/typescript/commonjs/ui/floating/FloatingToolHost.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/floating/FloatingToolHost.web.d.ts +3 -0
- package/lib/typescript/commonjs/ui/floating/FloatingToolHost.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/floating/index.d.ts +7 -0
- package/lib/typescript/commonjs/ui/floating/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/floating/index.web.d.ts +7 -0
- package/lib/typescript/commonjs/ui/floating/index.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/floating/onboardingConstants.d.ts +30 -0
- package/lib/typescript/commonjs/ui/floating/onboardingConstants.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/floating/onboardingConstants.web.d.ts +13 -0
- package/lib/typescript/commonjs/ui/floating/onboardingConstants.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/gameUI/constants/gameUIColors.d.ts +2 -0
- package/lib/typescript/commonjs/ui/gameUI/constants/gameUIColors.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +6 -0
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/night/nightTheme.d.ts +10 -0
- package/lib/typescript/commonjs/ui/night/nightTheme.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/night/primitives.d.ts +10 -3
- package/lib/typescript/commonjs/ui/night/primitives.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/otto/OttoSceneView.d.ts +30 -0
- package/lib/typescript/commonjs/ui/otto/OttoSceneView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/otto/index.d.ts +2 -0
- package/lib/typescript/commonjs/ui/otto/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/otto/ottoEngine.d.ts +1 -1
- package/lib/typescript/commonjs/ui/otto/ottoEngine.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/otto/ottoScenes.d.ts +75 -0
- package/lib/typescript/commonjs/ui/otto/ottoScenes.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/minimalSuperJSON.d.ts.map +1 -1
- package/lib/typescript/module/JsModal.d.ts +43 -2
- package/lib/typescript/module/JsModal.d.ts.map +1 -1
- package/lib/typescript/module/JsModal.web.d.ts +5 -2
- package/lib/typescript/module/JsModal.web.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/CyberpunkInput.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/LiveExplorer.d.ts.map +1 -1
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/icons/ReactQueryIcon.d.ts +1 -2
- package/lib/typescript/module/icons/ReactQueryIcon.d.ts.map +1 -1
- package/lib/typescript/module/icons/SentryBugIcon.d.ts +1 -2
- package/lib/typescript/module/icons/SentryBugIcon.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +4 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/license/AccountSetup.d.ts +4 -0
- package/lib/typescript/module/license/AccountSetup.d.ts.map +1 -0
- package/lib/typescript/module/license/AccountSetup.web.d.ts +2 -0
- package/lib/typescript/module/license/AccountSetup.web.d.ts.map +1 -0
- package/lib/typescript/module/license/FeatureGate.d.ts +3 -19
- package/lib/typescript/module/license/FeatureGate.d.ts.map +1 -1
- package/lib/typescript/module/license/FreeAccountPrompt.d.ts +8 -11
- package/lib/typescript/module/license/FreeAccountPrompt.d.ts.map +1 -1
- package/lib/typescript/module/license/index.d.ts +1 -1
- package/lib/typescript/module/license/index.d.ts.map +1 -1
- package/lib/typescript/module/license/licenseModule.d.ts +18 -31
- package/lib/typescript/module/license/licenseModule.d.ts.map +1 -1
- package/lib/typescript/module/license/tierLimits.d.ts +9 -52
- package/lib/typescript/module/license/tierLimits.d.ts.map +1 -1
- package/lib/typescript/module/storage/devToolsStorageKeys.d.ts +6 -0
- package/lib/typescript/module/storage/devToolsStorageKeys.d.ts.map +1 -1
- package/lib/typescript/module/stores/BaseEventStore.d.ts.map +1 -1
- package/lib/typescript/module/stores/createToolStore.d.ts.map +1 -1
- package/lib/typescript/module/stores/floatingToolStore.d.ts +27 -0
- package/lib/typescript/module/stores/floatingToolStore.d.ts.map +1 -0
- package/lib/typescript/module/stores/floatingToolStore.test.d.ts +2 -0
- package/lib/typescript/module/stores/floatingToolStore.test.d.ts.map +1 -0
- package/lib/typescript/module/sync/toolActionRegistry.d.ts +4 -32
- package/lib/typescript/module/sync/toolActionRegistry.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/ToolBackground.d.ts +7 -1
- package/lib/typescript/module/ui/backgrounds/ToolBackground.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/index.d.ts +2 -1
- package/lib/typescript/module/ui/backgrounds/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/registry.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/types.d.ts +11 -1
- package/lib/typescript/module/ui/backgrounds/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/variants/wormhole/motion.d.ts +24 -0
- package/lib/typescript/module/ui/backgrounds/variants/wormhole/motion.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/variants/wormhole/textures.d.ts +13 -0
- package/lib/typescript/module/ui/backgrounds/variants/wormhole/textures.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/variants/wormhole.d.ts +3 -0
- package/lib/typescript/module/ui/backgrounds/variants/wormhole.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/ClipboardHintBanner.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/CompactRow.d.ts +8 -1
- package/lib/typescript/module/ui/components/CompactRow.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/DraggableHeader.d.ts +4 -1
- package/lib/typescript/module/ui/components/DraggableHeader.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/HeaderSearchButton.d.ts +7 -1
- package/lib/typescript/module/ui/components/HeaderSearchButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/floating/FloatingTool.d.ts +79 -0
- package/lib/typescript/module/ui/floating/FloatingTool.d.ts.map +1 -0
- package/lib/typescript/module/ui/floating/FloatingTool.web.d.ts +64 -0
- package/lib/typescript/module/ui/floating/FloatingTool.web.d.ts.map +1 -0
- package/lib/typescript/module/ui/floating/FloatingToolHost.d.ts +3 -0
- package/lib/typescript/module/ui/floating/FloatingToolHost.d.ts.map +1 -0
- package/lib/typescript/module/ui/floating/FloatingToolHost.web.d.ts +3 -0
- package/lib/typescript/module/ui/floating/FloatingToolHost.web.d.ts.map +1 -0
- package/lib/typescript/module/ui/floating/index.d.ts +7 -0
- package/lib/typescript/module/ui/floating/index.d.ts.map +1 -0
- package/lib/typescript/module/ui/floating/index.web.d.ts +7 -0
- package/lib/typescript/module/ui/floating/index.web.d.ts.map +1 -0
- package/lib/typescript/module/ui/floating/onboardingConstants.d.ts +30 -0
- package/lib/typescript/module/ui/floating/onboardingConstants.d.ts.map +1 -0
- package/lib/typescript/module/ui/floating/onboardingConstants.web.d.ts +13 -0
- package/lib/typescript/module/ui/floating/onboardingConstants.web.d.ts.map +1 -0
- package/lib/typescript/module/ui/gameUI/constants/gameUIColors.d.ts +2 -0
- package/lib/typescript/module/ui/gameUI/constants/gameUIColors.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +6 -0
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/night/nightTheme.d.ts +10 -0
- package/lib/typescript/module/ui/night/nightTheme.d.ts.map +1 -1
- package/lib/typescript/module/ui/night/primitives.d.ts +10 -3
- package/lib/typescript/module/ui/night/primitives.d.ts.map +1 -1
- package/lib/typescript/module/ui/otto/OttoSceneView.d.ts +30 -0
- package/lib/typescript/module/ui/otto/OttoSceneView.d.ts.map +1 -0
- package/lib/typescript/module/ui/otto/index.d.ts +2 -0
- package/lib/typescript/module/ui/otto/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/otto/ottoEngine.d.ts +1 -1
- package/lib/typescript/module/ui/otto/ottoEngine.d.ts.map +1 -1
- package/lib/typescript/module/ui/otto/ottoScenes.d.ts +75 -0
- package/lib/typescript/module/ui/otto/ottoScenes.d.ts.map +1 -0
- package/lib/typescript/module/utils/minimalSuperJSON.d.ts.map +1 -1
- package/package.json +25 -5
- package/scripts/generate-wormhole-textures.cjs +261 -0
- package/scripts/test-wormhole-motion.cjs +59 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { useAccountAccess, LicenseManager } from "@buoy-gg/license";
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
export function AccountSetup() {
|
|
7
|
+
const access = useAccountAccess();
|
|
8
|
+
const [open, setOpen] = useState(false);
|
|
9
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
10
|
+
style: {
|
|
11
|
+
position: "fixed",
|
|
12
|
+
right: 16,
|
|
13
|
+
bottom: 30,
|
|
14
|
+
zIndex: 99999,
|
|
15
|
+
color: "#e2e8f0",
|
|
16
|
+
fontFamily: "system-ui"
|
|
17
|
+
},
|
|
18
|
+
children: [/*#__PURE__*/_jsx("button", {
|
|
19
|
+
onClick: () => setOpen(!open),
|
|
20
|
+
style: {
|
|
21
|
+
background: "#080a0b",
|
|
22
|
+
color: "#20C997",
|
|
23
|
+
border: "1px solid #20C997",
|
|
24
|
+
borderRadius: 24,
|
|
25
|
+
padding: "12px 16px"
|
|
26
|
+
},
|
|
27
|
+
children: access.status === "initializing" ? "BUOY · Checking…" : "BUOY · Sign in"
|
|
28
|
+
}), open && /*#__PURE__*/_jsxs("section", {
|
|
29
|
+
"aria-label": "Buoy account setup",
|
|
30
|
+
style: {
|
|
31
|
+
position: "absolute",
|
|
32
|
+
right: 0,
|
|
33
|
+
bottom: 55,
|
|
34
|
+
width: 300,
|
|
35
|
+
maxWidth: "85vw",
|
|
36
|
+
background: "#080a0b",
|
|
37
|
+
border: "1px solid #20C997",
|
|
38
|
+
borderRadius: 12,
|
|
39
|
+
padding: 20
|
|
40
|
+
},
|
|
41
|
+
children: [/*#__PURE__*/_jsx("h3", {
|
|
42
|
+
children: "Sign in to use Buoy"
|
|
43
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
44
|
+
children: "A Free or Pro account is required. Run this command in your project, then reload the app."
|
|
45
|
+
}), /*#__PURE__*/_jsx("pre", {
|
|
46
|
+
children: "npx buoy login"
|
|
47
|
+
}), LicenseManager.getState().error && /*#__PURE__*/_jsx("p", {
|
|
48
|
+
role: "status",
|
|
49
|
+
children: LicenseManager.getState().error
|
|
50
|
+
}), /*#__PURE__*/_jsx("button", {
|
|
51
|
+
onClick: () => {
|
|
52
|
+
const key = LicenseManager.getState().licenseKey;
|
|
53
|
+
if (key) void LicenseManager.setLicenseKey(key, {
|
|
54
|
+
force: true
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
children: "Retry verification"
|
|
58
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
59
|
+
children: /*#__PURE__*/_jsx("a", {
|
|
60
|
+
style: {
|
|
61
|
+
color: "#20C997"
|
|
62
|
+
},
|
|
63
|
+
href: "https://github.com/Buoy-gg/buoy/issues/new/choose",
|
|
64
|
+
target: "_blank",
|
|
65
|
+
rel: "noreferrer",
|
|
66
|
+
children: "Contact support on GitHub"
|
|
67
|
+
})
|
|
68
|
+
}), /*#__PURE__*/_jsx("a", {
|
|
69
|
+
style: {
|
|
70
|
+
color: "#20C997"
|
|
71
|
+
},
|
|
72
|
+
href: "mailto:support@buoy.gg",
|
|
73
|
+
children: "support@buoy.gg"
|
|
74
|
+
})]
|
|
75
|
+
})]
|
|
76
|
+
});
|
|
77
|
+
}
|
|
@@ -12,9 +12,6 @@ import { gameUIColors, buoyColors } from "../ui/gameUI/constants/gameUIColors.js
|
|
|
12
12
|
import { LockIcon, X, Zap, Shield, Clock, Check } from "../icons/lucide-icons.js";
|
|
13
13
|
import { LicenseEntryModal } from "./LicenseEntryModal.js";
|
|
14
14
|
import { openPricing, isWeb } from "./openPricing.js";
|
|
15
|
-
import { FreeAccountPrompt } from "./FreeAccountPrompt.js";
|
|
16
|
-
import { getUseTier } from "./licenseModule.js";
|
|
17
|
-
import { freeKeyRaises } from "./tierLimits.js";
|
|
18
15
|
import { useIsPro, useLicense, useProAccess } from "@buoy-gg/license";
|
|
19
16
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
20
17
|
// Weekend Pass branding — a distinct violet so it never reads as the gold PRO.
|
|
@@ -52,19 +49,14 @@ export const ProBadge = ({
|
|
|
52
49
|
export const ProUpgradeModal = ({
|
|
53
50
|
visible,
|
|
54
51
|
onClose,
|
|
55
|
-
featureName = "This feature"
|
|
56
|
-
limitKey
|
|
52
|
+
featureName = "This feature"
|
|
57
53
|
}) => {
|
|
58
54
|
// Simple wrapper around UpgradeModal with minimal description and no benefits
|
|
59
55
|
return /*#__PURE__*/_jsx(UpgradeModal, {
|
|
60
56
|
visible: visible,
|
|
61
57
|
onClose: onClose,
|
|
62
|
-
featureName: featureName
|
|
63
|
-
|
|
64
|
-
// description below (which promises Pro) is the accurate message.
|
|
65
|
-
,
|
|
66
|
-
limitKey: limitKey,
|
|
67
|
-
description: limitKey ? undefined : `${featureName} requires a Pro subscription.`
|
|
58
|
+
featureName: featureName,
|
|
59
|
+
description: `${featureName} requires a Pro subscription.`
|
|
68
60
|
});
|
|
69
61
|
};
|
|
70
62
|
/**
|
|
@@ -74,13 +66,9 @@ export const ProUpgradeModal = ({
|
|
|
74
66
|
export const UpgradePrompt = ({
|
|
75
67
|
featureName,
|
|
76
68
|
onUpgradePress,
|
|
77
|
-
compact = false
|
|
78
|
-
limitKey
|
|
69
|
+
compact = false
|
|
79
70
|
}) => {
|
|
80
71
|
const [showLicenseModal, setShowLicenseModal] = useState(false);
|
|
81
|
-
// Only offer the free key when it would actually raise this limit — see
|
|
82
|
-
// UpgradeModalProps.limitKey.
|
|
83
|
-
const isAnonymous = getUseTier()() === "anonymous" && limitKey != null && freeKeyRaises(limitKey);
|
|
84
72
|
const handlePress = useCallback(() => {
|
|
85
73
|
if (onUpgradePress) {
|
|
86
74
|
onUpgradePress();
|
|
@@ -108,11 +96,7 @@ export const UpgradePrompt = ({
|
|
|
108
96
|
style: styles.compactText,
|
|
109
97
|
children: "PRO"
|
|
110
98
|
})]
|
|
111
|
-
}),
|
|
112
|
-
visible: showLicenseModal,
|
|
113
|
-
onClose: handleCloseModal,
|
|
114
|
-
featureName: featureName
|
|
115
|
-
}) : /*#__PURE__*/_jsx(LicenseEntryModal, {
|
|
99
|
+
}), /*#__PURE__*/_jsx(LicenseEntryModal, {
|
|
116
100
|
visible: showLicenseModal,
|
|
117
101
|
onClose: handleCloseModal
|
|
118
102
|
})]
|
|
@@ -129,27 +113,23 @@ export const UpgradePrompt = ({
|
|
|
129
113
|
})
|
|
130
114
|
}), /*#__PURE__*/_jsx(Text, {
|
|
131
115
|
style: styles.title,
|
|
132
|
-
children:
|
|
116
|
+
children: "Pro Feature"
|
|
133
117
|
}), featureName && /*#__PURE__*/_jsx(Text, {
|
|
134
118
|
style: styles.featureName,
|
|
135
119
|
children: featureName
|
|
136
120
|
}), /*#__PURE__*/_jsx(Text, {
|
|
137
121
|
style: styles.description,
|
|
138
|
-
children:
|
|
122
|
+
children: "Upgrade to React Buoy Pro to unlock this feature and more."
|
|
139
123
|
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
140
124
|
style: styles.upgradeButton,
|
|
141
125
|
onPress: handlePress,
|
|
142
126
|
activeOpacity: 0.8,
|
|
143
127
|
children: /*#__PURE__*/_jsx(Text, {
|
|
144
128
|
style: styles.upgradeButtonText,
|
|
145
|
-
children:
|
|
129
|
+
children: "Upgrade to Pro"
|
|
146
130
|
})
|
|
147
131
|
})]
|
|
148
|
-
}),
|
|
149
|
-
visible: showLicenseModal,
|
|
150
|
-
onClose: handleCloseModal,
|
|
151
|
-
featureName: featureName
|
|
152
|
-
}) : /*#__PURE__*/_jsx(LicenseEntryModal, {
|
|
132
|
+
}), /*#__PURE__*/_jsx(LicenseEntryModal, {
|
|
153
133
|
visible: showLicenseModal,
|
|
154
134
|
onClose: handleCloseModal
|
|
155
135
|
})]
|
|
@@ -328,14 +308,8 @@ export const UpgradeModal = ({
|
|
|
328
308
|
onClose,
|
|
329
309
|
featureName = "This Feature",
|
|
330
310
|
description,
|
|
331
|
-
benefits
|
|
332
|
-
limitKey
|
|
311
|
+
benefits
|
|
333
312
|
}) => {
|
|
334
|
-
// Anonymous users get a different ask — but ONLY when a free key would
|
|
335
|
-
// actually fix what they just hit. Everything else here is Pro-exclusive,
|
|
336
|
-
// where a free key changes nothing and offering one would be dishonest.
|
|
337
|
-
const tier = getUseTier()();
|
|
338
|
-
const offerFreeKey = tier === "anonymous" && limitKey != null && freeKeyRaises(limitKey);
|
|
339
313
|
const hasBenefits = benefits && benefits.length > 0;
|
|
340
314
|
const [showLicenseModal, setShowLicenseModal] = useState(false);
|
|
341
315
|
const license = useLicense();
|
|
@@ -358,13 +332,6 @@ export const UpgradeModal = ({
|
|
|
358
332
|
onClose();
|
|
359
333
|
}, [onClose]);
|
|
360
334
|
if (!visible) return null;
|
|
361
|
-
if (offerFreeKey) {
|
|
362
|
-
return /*#__PURE__*/_jsx(FreeAccountPrompt, {
|
|
363
|
-
visible: visible,
|
|
364
|
-
onClose: onClose,
|
|
365
|
-
featureName: featureName === "This Feature" ? undefined : featureName
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
335
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
369
336
|
children: [/*#__PURE__*/_jsx(Modal, {
|
|
370
337
|
visible: visible && !showLicenseModal,
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* The
|
|
4
|
+
* The account setup sheet — what a locked manager shows instead of the tools.
|
|
5
5
|
*
|
|
6
|
-
* Deliberately not the Pro modal.
|
|
7
|
-
* thirty seconds, so asking
|
|
8
|
-
* at the wrong moment
|
|
9
|
-
* produce. Pro is still offered, as a secondary action.
|
|
6
|
+
* Deliberately not the Pro modal. The next step is a free account and takes
|
|
7
|
+
* about thirty seconds, so asking for money here would be asking the wrong
|
|
8
|
+
* question at the wrong moment. Pro is still offered, as a secondary action.
|
|
10
9
|
*
|
|
11
|
-
* The command is shown inline and copyable rather than linked, because
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* The command is shown inline and copyable rather than linked, because
|
|
11
|
+
* someone who cannot open the tools needs the fix in front of them, not a link
|
|
12
|
+
* to a page that has a link to a command.
|
|
14
13
|
*/
|
|
15
14
|
|
|
16
15
|
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
@@ -19,15 +18,16 @@ import { buoyColors } from "../ui/gameUI/constants/gameUIColors.js";
|
|
|
19
18
|
import { Check, Copy, X } from "../icons/lucide-icons.js";
|
|
20
19
|
import { copyToClipboard } from "../clipboard/index.js";
|
|
21
20
|
import { openPricing } from "./openPricing.js";
|
|
21
|
+
import { getUseAccountAccess, retryAccountAccess } from "./licenseModule.js";
|
|
22
22
|
import { monoFont } from "../ui/fonts.js";
|
|
23
23
|
/** The one thing a reader has to be able to act on. */
|
|
24
24
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
25
|
export const LOGIN_COMMAND = "npx buoy login";
|
|
26
26
|
export const FreeAccountPrompt = ({
|
|
27
27
|
visible,
|
|
28
|
-
onClose
|
|
29
|
-
featureName
|
|
28
|
+
onClose
|
|
30
29
|
}) => {
|
|
30
|
+
const access = getUseAccountAccess()();
|
|
31
31
|
const [copied, setCopied] = useState(false);
|
|
32
32
|
const resetTimer = useRef(null);
|
|
33
33
|
useEffect(() => () => {
|
|
@@ -65,10 +65,10 @@ export const FreeAccountPrompt = ({
|
|
|
65
65
|
})
|
|
66
66
|
}), /*#__PURE__*/_jsx(Text, {
|
|
67
67
|
style: styles.title,
|
|
68
|
-
children:
|
|
68
|
+
children: access.status === "initializing" ? "Checking your account…" : "Sign in to use Buoy"
|
|
69
69
|
}), /*#__PURE__*/_jsx(Text, {
|
|
70
70
|
style: styles.subtitle,
|
|
71
|
-
children: "
|
|
71
|
+
children: "A Free or Pro account is required. Run this command in your project, then reload the app to use your account key."
|
|
72
72
|
}), /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
73
73
|
style: styles.command,
|
|
74
74
|
onPress: handleCopy,
|
|
@@ -84,9 +84,32 @@ export const FreeAccountPrompt = ({
|
|
|
84
84
|
size: 14,
|
|
85
85
|
color: buoyColors.textMuted
|
|
86
86
|
})]
|
|
87
|
+
}), access.status !== "admitted" && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
88
|
+
style: styles.secondary,
|
|
89
|
+
onPress: () => {
|
|
90
|
+
void retryAccountAccess();
|
|
91
|
+
},
|
|
92
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
93
|
+
style: styles.secondaryText,
|
|
94
|
+
children: "Retry verification"
|
|
95
|
+
})
|
|
87
96
|
}), /*#__PURE__*/_jsx(Text, {
|
|
88
97
|
style: styles.reassure,
|
|
89
98
|
children: "Free forever. No card. About thirty seconds."
|
|
99
|
+
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
100
|
+
style: styles.secondary,
|
|
101
|
+
onPress: () => openPricing("https://github.com/Buoy-gg/buoy/issues/new/choose"),
|
|
102
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
103
|
+
style: styles.secondaryText,
|
|
104
|
+
children: "Contact support on GitHub"
|
|
105
|
+
})
|
|
106
|
+
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
107
|
+
style: styles.secondary,
|
|
108
|
+
onPress: () => openPricing("mailto:support@buoy.gg"),
|
|
109
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
110
|
+
style: styles.secondaryText,
|
|
111
|
+
children: "Email support@buoy.gg"
|
|
112
|
+
})
|
|
90
113
|
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
91
114
|
style: styles.secondary,
|
|
92
115
|
onPress: () => openPricing(),
|
|
@@ -6,4 +6,4 @@ export { FreeAccountPrompt, LOGIN_COMMAND } from "./FreeAccountPrompt.js";
|
|
|
6
6
|
// Lazy license-module access lives in ./licenseModule so tierLimits can use it
|
|
7
7
|
// without an import cycle. Re-exported here to keep the existing surface.
|
|
8
8
|
export { getUseIsPro, getUseLicense, getUseTier } from "./licenseModule.js";
|
|
9
|
-
export { TIER_LIMITS, useLimit, resolveEffectiveTier
|
|
9
|
+
export { TIER_LIMITS, useLimit, resolveEffectiveTier } from "./tierLimits.js";
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Centralized
|
|
4
|
+
* Centralized access of `@buoy-gg/license`.
|
|
5
5
|
*
|
|
6
6
|
* This is the SINGLE place any package resolves license hooks — tools must not
|
|
7
|
-
*
|
|
7
|
+
* resolve the license module themselves. Lives in its own module (rather
|
|
8
8
|
* than `./index`) so `tierLimits` can consume it without an import cycle.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
import * as licenseModule from "@buoy-gg/license";
|
|
12
|
+
|
|
13
|
+
/** Tier. Mirrors BuoyTier in @buoy-gg/license. */
|
|
12
14
|
|
|
13
15
|
let _useIsPro = null;
|
|
14
16
|
let _useLicense = null;
|
|
15
17
|
let _useTier = null;
|
|
16
|
-
let _anonymousTierEnabled = null;
|
|
17
18
|
let _licenseLoadAttempted = false;
|
|
18
19
|
function loadLicenseModuleCentral() {
|
|
19
20
|
if (_licenseLoadAttempted) return;
|
|
20
21
|
_licenseLoadAttempted = true;
|
|
21
22
|
try {
|
|
22
|
-
const mod =
|
|
23
|
+
const mod = licenseModule;
|
|
23
24
|
if (mod) {
|
|
24
25
|
_useIsPro = mod.useIsPro ?? null;
|
|
25
26
|
_useLicense = mod.useLicense ?? null;
|
|
26
27
|
_useTier = mod.useTier ?? null;
|
|
27
|
-
_anonymousTierEnabled = typeof mod.ANONYMOUS_TIER_ENABLED === "boolean" ? mod.ANONYMOUS_TIER_ENABLED : null;
|
|
28
28
|
}
|
|
29
29
|
} catch {
|
|
30
30
|
// License package not available - will use fallback
|
|
@@ -54,39 +54,54 @@ export function getUseLicense() {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* be resolved. That deliberately matches the existing `getUseIsPro()` fallback,
|
|
61
|
-
* which yields free-tier behavior today, and it picks the safer failure:
|
|
62
|
-
*
|
|
63
|
-
* - falling back to "anonymous" would let one bundler quirk silently cut every
|
|
64
|
-
* legitimate user's limits by ~80%;
|
|
65
|
-
* - falling back to "free" costs no revenue, because Pro still requires a key
|
|
66
|
-
* that a live license server validated — this path can never grant Pro.
|
|
67
|
-
*
|
|
68
|
-
* Reaching it at all requires `@buoy-gg/license` to be missing, and it is a
|
|
69
|
-
* hard dependency of `@buoy-gg/core`.
|
|
57
|
+
* Falls back to "free" without the license package. That grants nothing: a
|
|
58
|
+
* missing license module also means no account admission, and nothing is
|
|
59
|
+
* exposed without it.
|
|
70
60
|
*/
|
|
71
61
|
export function getUseTier() {
|
|
72
62
|
loadLicenseModuleCentral();
|
|
73
63
|
return _useTier ?? (() => "free");
|
|
74
64
|
}
|
|
65
|
+
const LOCKED = {
|
|
66
|
+
status: "locked",
|
|
67
|
+
reason: "account_required",
|
|
68
|
+
validUntil: null
|
|
69
|
+
};
|
|
75
70
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return
|
|
71
|
+
// Resolve at the boundary, after module initialization. Do not cache an absent
|
|
72
|
+
// manager during a circular import or grant access for older package versions.
|
|
73
|
+
function accountManager() {
|
|
74
|
+
try {
|
|
75
|
+
const manager = licenseModule.LicenseManager;
|
|
76
|
+
void manager?.initialize?.();
|
|
77
|
+
return manager;
|
|
78
|
+
} catch {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export function getAccountAccess() {
|
|
83
|
+
return accountManager()?.getAccountAccess?.() ?? LOCKED;
|
|
84
|
+
}
|
|
85
|
+
export function hasAccountAccess() {
|
|
86
|
+
return getAccountAccess().status === "admitted";
|
|
87
|
+
}
|
|
88
|
+
export function assertAccountAccess() {
|
|
89
|
+
if (!hasAccountAccess()) throw new Error("A verified Buoy account is required. Run npx buoy login, then reload your app.");
|
|
90
|
+
}
|
|
91
|
+
export function subscribeAccountAccess(listener) {
|
|
92
|
+
return accountManager()?.subscribe?.(listener) ?? (() => {});
|
|
93
|
+
}
|
|
94
|
+
export function getUseAccountAccess() {
|
|
95
|
+
try {
|
|
96
|
+
return licenseModule.useAccountAccess ?? (() => LOCKED);
|
|
97
|
+
} catch {
|
|
98
|
+
return () => LOCKED;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
export async function retryAccountAccess() {
|
|
102
|
+
const manager = accountManager();
|
|
103
|
+
const key = manager?.getState?.().licenseKey;
|
|
104
|
+
if (key) await manager.setLicenseKey(key, {
|
|
105
|
+
force: true
|
|
106
|
+
});else await manager?.initialize?.();
|
|
92
107
|
}
|
|
@@ -1,103 +1,84 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Per-tier numeric limits — the ONLY thing that separates
|
|
4
|
+
* Per-tier numeric limits — the ONLY thing that separates free from pro on a
|
|
5
|
+
* count.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
* navigation)
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* The governing rule: **the free column never moves.** Anonymous is carved out
|
|
11
|
-
* BELOW today's free tier — nothing is ever added to free in exchange for an
|
|
12
|
-
* account, because that would come straight out of the Pro upgrade.
|
|
7
|
+
* Binary Pro gates (copy-to-clipboard, state editing, storage mutations,
|
|
8
|
+
* navigation) live in the tools themselves; this table is only for "how many".
|
|
9
|
+
* Whether the tools are usable at all is account admission, which is a
|
|
10
|
+
* separate question from the tier and is never expressed as a limit.
|
|
13
11
|
*/
|
|
14
12
|
|
|
15
|
-
import { getUseIsPro, getUseTier
|
|
13
|
+
import { getUseIsPro, getUseTier } from "./licenseModule.js";
|
|
16
14
|
const LIMITS = {
|
|
17
15
|
// ── network ───────────────────────────────────────────────────────────────
|
|
18
16
|
"network.requests": {
|
|
19
|
-
anonymous: 5,
|
|
20
17
|
free: 25,
|
|
21
18
|
pro: Infinity
|
|
22
19
|
},
|
|
23
20
|
"network.saved": {
|
|
24
|
-
anonymous: 1,
|
|
25
21
|
free: 5,
|
|
26
22
|
pro: 50
|
|
27
23
|
},
|
|
28
|
-
// Already 1 for free, so 25% would be 0 — which deletes the feature rather
|
|
29
|
-
// than trialling it. Raising the FREE value to make room is not an option.
|
|
30
24
|
"network.overrideRules": {
|
|
31
|
-
anonymous: 1,
|
|
32
25
|
free: 1,
|
|
33
26
|
pro: 50
|
|
34
27
|
},
|
|
35
28
|
// ── storage ───────────────────────────────────────────────────────────────
|
|
36
29
|
"storage.events": {
|
|
37
|
-
anonymous: 5,
|
|
38
30
|
free: 25,
|
|
39
31
|
pro: Infinity
|
|
40
32
|
},
|
|
41
33
|
"storage.keys": {
|
|
42
|
-
anonymous: 5,
|
|
43
34
|
free: 25,
|
|
44
35
|
pro: Infinity
|
|
45
36
|
},
|
|
46
|
-
// Same floor-at-1 reasoning as network.overrideRules.
|
|
47
37
|
"storage.mmkvInstances": {
|
|
48
|
-
anonymous: 1,
|
|
49
38
|
free: 1,
|
|
50
39
|
pro: Infinity
|
|
51
40
|
},
|
|
52
41
|
// ── state tools ───────────────────────────────────────────────────────────
|
|
53
42
|
"redux.actions": {
|
|
54
|
-
anonymous: 5,
|
|
55
43
|
free: 25,
|
|
56
44
|
pro: Infinity
|
|
57
45
|
},
|
|
58
46
|
"zustand.changes": {
|
|
59
|
-
anonymous: 5,
|
|
60
47
|
free: 25,
|
|
61
48
|
pro: Infinity
|
|
62
49
|
},
|
|
63
50
|
"jotai.changes": {
|
|
64
|
-
anonymous: 5,
|
|
65
51
|
free: 25,
|
|
66
52
|
pro: Infinity
|
|
67
53
|
},
|
|
68
54
|
"events.entries": {
|
|
69
|
-
anonymous: 5,
|
|
70
55
|
free: 25,
|
|
71
56
|
pro: Infinity
|
|
72
57
|
},
|
|
73
58
|
// ── render / navigation ───────────────────────────────────────────────────
|
|
74
59
|
"highlightUpdates.components": {
|
|
75
|
-
anonymous: 5,
|
|
76
60
|
free: 25,
|
|
77
61
|
pro: Infinity
|
|
78
62
|
},
|
|
79
63
|
"highlightUpdates.historyEvents": {
|
|
80
|
-
anonymous: 1,
|
|
81
64
|
free: 3,
|
|
82
65
|
pro: Infinity
|
|
83
66
|
},
|
|
84
67
|
"highlightUpdates.detailEvents": {
|
|
85
|
-
anonymous: 2,
|
|
86
68
|
free: 5,
|
|
87
69
|
pro: Infinity
|
|
88
70
|
},
|
|
89
71
|
"routeEvents.entries": {
|
|
90
|
-
anonymous: 1,
|
|
91
72
|
free: 3,
|
|
92
73
|
pro: Infinity
|
|
93
74
|
},
|
|
75
|
+
// One restore point at a time. The floating bar's safety slot is not one
|
|
76
|
+
// the user chose to keep, so it is not counted against this.
|
|
94
77
|
"timeMachine.snapshots": {
|
|
95
|
-
|
|
96
|
-
free: 2,
|
|
78
|
+
free: 1,
|
|
97
79
|
pro: Infinity
|
|
98
80
|
},
|
|
99
81
|
"perfMonitor.automationCases": {
|
|
100
|
-
anonymous: 1,
|
|
101
82
|
free: 3,
|
|
102
83
|
pro: Infinity
|
|
103
84
|
},
|
|
@@ -106,12 +87,10 @@ const LIMITS = {
|
|
|
106
87
|
// three-endpoint scenario either runs whole or refuses up front, and is never
|
|
107
88
|
// silently trimmed to one rule mid-run. Enforcement is atomic in pre-flight.
|
|
108
89
|
"scenarios.saved": {
|
|
109
|
-
anonymous: 1,
|
|
110
90
|
free: 3,
|
|
111
91
|
pro: Infinity
|
|
112
92
|
},
|
|
113
93
|
"scenarios.active": {
|
|
114
|
-
anonymous: 1,
|
|
115
94
|
free: 1,
|
|
116
95
|
pro: 3
|
|
117
96
|
}
|
|
@@ -122,17 +101,11 @@ export const TIER_LIMITS = LIMITS;
|
|
|
122
101
|
* The tier whose limits actually apply.
|
|
123
102
|
*
|
|
124
103
|
* `hasProAccess` is `useIsPro()`, which is true for a real Pro license OR the
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* now. When the Weekend Pass is later gated to key-holders, that change lands
|
|
128
|
-
* here for free — no limit call site has to know about it.
|
|
104
|
+
* Weekend Pass. Routing the Weekend Pass through here is what gives weekend
|
|
105
|
+
* users Pro limits without any limit call site having to know about it.
|
|
129
106
|
*/
|
|
130
107
|
export function resolveEffectiveTier(tier, hasProAccess) {
|
|
131
|
-
|
|
132
|
-
// The switch lives in @buoy-gg/license so that this and the Weekend Pass
|
|
133
|
-
// change flip together — see isAnonymousTierEnabled().
|
|
134
|
-
if (!isAnonymousTierEnabled() && tier === "anonymous") return "free";
|
|
135
|
-
return tier;
|
|
108
|
+
return hasProAccess ? "pro" : tier;
|
|
136
109
|
}
|
|
137
110
|
|
|
138
111
|
/**
|
|
@@ -146,27 +119,4 @@ export function useLimit(key) {
|
|
|
146
119
|
const hasProAccess = getUseIsPro()();
|
|
147
120
|
const tier = getUseTier()();
|
|
148
121
|
return TIER_LIMITS[key][resolveEffectiveTier(tier, hasProAccess)];
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Whether claiming a FREE key would actually raise this limit right now.
|
|
153
|
-
*
|
|
154
|
-
* The anonymous upsell must never promise something a free key won't deliver.
|
|
155
|
-
* Two ways it could lie, and this closes both:
|
|
156
|
-
*
|
|
157
|
-
* - **Pro-exclusive features.** Copy-to-clipboard, state editing, storage
|
|
158
|
-
* mutations and navigation are locked for anonymous AND free alike. Telling
|
|
159
|
-
* an anonymous user a free key opens them would be false.
|
|
160
|
-
* - **Limits that are already equal.** Override rules and MMKV instances sit
|
|
161
|
-
* at 1 for both tiers, so a key changes nothing there either.
|
|
162
|
-
*
|
|
163
|
-
* It also respects `ANONYMOUS_TIER_ENABLED`: while the anonymous tier is off,
|
|
164
|
-
* an anonymous user is *already* getting the free limits, so there is nothing
|
|
165
|
-
* to claim and this correctly returns false everywhere. That falls out of
|
|
166
|
-
* asking `resolveEffectiveTier` rather than reading the table directly, so the
|
|
167
|
-
* switch and the copy can never disagree.
|
|
168
|
-
*/
|
|
169
|
-
export function freeKeyRaises(key) {
|
|
170
|
-
const limits = TIER_LIMITS[key];
|
|
171
|
-
return limits[resolveEffectiveTier("anonymous", false)] < limits[resolveEffectiveTier("free", false)];
|
|
172
122
|
}
|
|
@@ -126,7 +126,14 @@ export const devToolsStorageKeys = {
|
|
|
126
126
|
*/
|
|
127
127
|
timeMachine: {
|
|
128
128
|
root: () => `${devToolsStorageKeys.base}_time_machine`,
|
|
129
|
-
diffViewerMode: () => `${devToolsStorageKeys.timeMachine.root()}_diff_viewer_mode
|
|
129
|
+
diffViewerMode: () => `${devToolsStorageKeys.timeMachine.root()}_diff_viewer_mode`,
|
|
130
|
+
// 'split' | 'tree'
|
|
131
|
+
/** The restore point the floating restore bar restores on tap (snapshot id). */
|
|
132
|
+
armedPoint: () => `${devToolsStorageKeys.timeMachine.root()}_armed_point`,
|
|
133
|
+
/** "1" when the action bar restores in reload mode (storage, then a JS reload). */
|
|
134
|
+
barReloadMode: () => `${devToolsStorageKeys.timeMachine.root()}_bar_reload_mode`,
|
|
135
|
+
/** Source ids switched OFF in the Sources strip (JSON string array). */
|
|
136
|
+
disabledSources: () => `${devToolsStorageKeys.timeMachine.root()}_disabled_sources`
|
|
130
137
|
},
|
|
131
138
|
/**
|
|
132
139
|
* Scenarios storage keys. The library (saved + draft scenarios) and the
|