@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,591 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Divider = Divider;
|
|
7
|
+
exports.FloatingTool = FloatingTool;
|
|
8
|
+
exports.UserStatus = UserStatus;
|
|
9
|
+
exports.getBubbleAnchorPosition = getBubbleAnchorPosition;
|
|
10
|
+
var _nightTheme = require("../night/nightTheme.js");
|
|
11
|
+
var _react = require("react");
|
|
12
|
+
var _onboardingConstantsWeb = require("./onboardingConstants.web.js");
|
|
13
|
+
var _floating = require("@buoy-gg/floating-tools-react/floating");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
/**
|
|
16
|
+
* FloatingTools - Web renderer using shared React bindings.
|
|
17
|
+
*
|
|
18
|
+
* This file contains ONLY web-specific code (React DOM):
|
|
19
|
+
* - Pointer event handling (mouse + touch — WKWebView/Capacitor included)
|
|
20
|
+
* - requestAnimationFrame animation
|
|
21
|
+
* - Web JSX (div, span)
|
|
22
|
+
* - localStorage adapter
|
|
23
|
+
*
|
|
24
|
+
* All logic is shared via @buoy-gg/floating-tools-react
|
|
25
|
+
*
|
|
26
|
+
* @platform React DOM Web (Vite, CRA, Next.js, Electron)
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
// Re-export for consumers
|
|
30
|
+
|
|
31
|
+
// =============================
|
|
32
|
+
// Web Storage Adapter
|
|
33
|
+
// =============================
|
|
34
|
+
const webStorageAdapter = {
|
|
35
|
+
getItem: key => localStorage.getItem(key),
|
|
36
|
+
setItem: (key, value) => localStorage.setItem(key, value)
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// =============================
|
|
40
|
+
// Native color values not present in floatingToolsColors
|
|
41
|
+
// (core's `secondary` is #E0E0E0 = buoyColors.text; the native bubble uses
|
|
42
|
+
// buoyColors.textSecondary #A0A0A0 for grip dots and "User" label text.
|
|
43
|
+
// Inlined here rather than changed in core because dial.ts also consumes
|
|
44
|
+
// floatingToolsColors.secondary for other surfaces.)
|
|
45
|
+
// =============================
|
|
46
|
+
// native shared-ui gameUIColors.ts: buoyColors.textSecondary = "#A0A0A0"
|
|
47
|
+
const NATIVE_TEXT_SECONDARY = '#A0A0A0';
|
|
48
|
+
|
|
49
|
+
// =============================
|
|
50
|
+
// GripVerticalIcon (web JSX)
|
|
51
|
+
// =============================
|
|
52
|
+
function GripVerticalIcon({
|
|
53
|
+
size = 24,
|
|
54
|
+
// native shared-ui GripVerticalIcon.tsx: buoyColors.textSecondary + "CC"
|
|
55
|
+
color = (0, _floating.withAlpha)(NATIVE_TEXT_SECONDARY, 'CC')
|
|
56
|
+
}) {
|
|
57
|
+
const layout = (0, _floating.getGripIconLayout)(size);
|
|
58
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
59
|
+
style: {
|
|
60
|
+
width: size,
|
|
61
|
+
height: size,
|
|
62
|
+
display: 'flex',
|
|
63
|
+
flexDirection: 'row',
|
|
64
|
+
alignItems: 'center',
|
|
65
|
+
justifyContent: 'center'
|
|
66
|
+
},
|
|
67
|
+
children: [0, 1].map(col => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
68
|
+
style: {
|
|
69
|
+
display: 'flex',
|
|
70
|
+
flexDirection: 'column',
|
|
71
|
+
alignItems: 'center',
|
|
72
|
+
justifyContent: 'center',
|
|
73
|
+
// native GripVerticalIcon.tsx: marginHorizontal columnGap / 2
|
|
74
|
+
marginLeft: layout.columnGap / 2,
|
|
75
|
+
marginRight: layout.columnGap / 2
|
|
76
|
+
},
|
|
77
|
+
children: [0, 1, 2].map(row => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
78
|
+
style: {
|
|
79
|
+
width: layout.dotSize,
|
|
80
|
+
height: layout.dotSize,
|
|
81
|
+
borderRadius: layout.dotSize / 2,
|
|
82
|
+
backgroundColor: color,
|
|
83
|
+
// native GripVerticalIcon.tsx: marginVertical rowGap / 2
|
|
84
|
+
marginTop: layout.rowGap / 2,
|
|
85
|
+
marginBottom: layout.rowGap / 2
|
|
86
|
+
}
|
|
87
|
+
}, row))
|
|
88
|
+
}, col))
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// =============================
|
|
93
|
+
// Divider (web JSX)
|
|
94
|
+
// =============================
|
|
95
|
+
function Divider() {
|
|
96
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
97
|
+
style: {
|
|
98
|
+
width: 1,
|
|
99
|
+
height: 12,
|
|
100
|
+
backgroundColor: (0, _floating.withAlpha)(_floating.floatingToolsColors.muted, '66'),
|
|
101
|
+
flexShrink: 0
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// =============================
|
|
107
|
+
// UserStatus (web JSX)
|
|
108
|
+
// =============================
|
|
109
|
+
// Mirrors the native gameUIColorsCompat mapping in floatingTools.tsx:
|
|
110
|
+
// success/optional/muted come from the shared palette, but `secondary`
|
|
111
|
+
// (the "User" label text) is buoyColors.textSecondary, not core's secondary.
|
|
112
|
+
const userStatusColors = {
|
|
113
|
+
success: _floating.floatingToolsColors.success,
|
|
114
|
+
optional: _floating.floatingToolsColors.optional,
|
|
115
|
+
muted: _floating.floatingToolsColors.muted,
|
|
116
|
+
// native floatingTools.tsx: gameUIColorsCompat.secondary = buoyColors.textSecondary
|
|
117
|
+
secondary: NATIVE_TEXT_SECONDARY
|
|
118
|
+
};
|
|
119
|
+
function UserStatus({
|
|
120
|
+
userRole,
|
|
121
|
+
onPress
|
|
122
|
+
}) {
|
|
123
|
+
const {
|
|
124
|
+
isDragging
|
|
125
|
+
} = (0, _floating.useFloatingToolsContext)();
|
|
126
|
+
const config = (0, _floating.getUserStatusConfig)(userRole, userStatusColors);
|
|
127
|
+
const handleClick = e => {
|
|
128
|
+
if (!isDragging && onPress) {
|
|
129
|
+
e.stopPropagation();
|
|
130
|
+
onPress();
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
|
|
134
|
+
role: "button",
|
|
135
|
+
"aria-label": `User status: ${config.label}`,
|
|
136
|
+
onClick: handleClick,
|
|
137
|
+
style: {
|
|
138
|
+
display: 'flex',
|
|
139
|
+
flexDirection: 'row',
|
|
140
|
+
alignItems: 'center',
|
|
141
|
+
paddingTop: 6,
|
|
142
|
+
paddingBottom: 6,
|
|
143
|
+
paddingLeft: 8,
|
|
144
|
+
paddingRight: 8,
|
|
145
|
+
flexShrink: 0,
|
|
146
|
+
cursor: onPress && !isDragging ? 'pointer' : 'default',
|
|
147
|
+
background: 'none',
|
|
148
|
+
border: 'none',
|
|
149
|
+
margin: 0 // neutralize UA button margin (native View/Touchable has none)
|
|
150
|
+
},
|
|
151
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
152
|
+
style: {
|
|
153
|
+
width: 6,
|
|
154
|
+
height: 6,
|
|
155
|
+
borderRadius: 3,
|
|
156
|
+
backgroundColor: config.dotColor,
|
|
157
|
+
marginRight: 4
|
|
158
|
+
}
|
|
159
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
160
|
+
style: {
|
|
161
|
+
fontSize: 10,
|
|
162
|
+
fontWeight: 500,
|
|
163
|
+
color: config.textColor,
|
|
164
|
+
letterSpacing: 0.3,
|
|
165
|
+
// native RN <Text> renders in the platform system font; buttons
|
|
166
|
+
// otherwise use the UA font on web
|
|
167
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',
|
|
168
|
+
lineHeight: 'normal'
|
|
169
|
+
},
|
|
170
|
+
children: config.label
|
|
171
|
+
})]
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// =============================
|
|
176
|
+
// Web Animation Hook
|
|
177
|
+
// =============================
|
|
178
|
+
function useWebAnimation() {
|
|
179
|
+
const animationRef = (0, _react.useRef)(null);
|
|
180
|
+
const [position, setPosition] = (0, _react.useState)({
|
|
181
|
+
x: 0,
|
|
182
|
+
y: 0
|
|
183
|
+
});
|
|
184
|
+
const animateTo = (0, _react.useCallback)((from, to, onComplete) => {
|
|
185
|
+
if (animationRef.current) {
|
|
186
|
+
cancelAnimationFrame(animationRef.current);
|
|
187
|
+
}
|
|
188
|
+
const startTime = performance.now();
|
|
189
|
+
const animate = currentTime => {
|
|
190
|
+
const elapsed = currentTime - startTime;
|
|
191
|
+
const progress = Math.min(elapsed / _floating.ANIMATION_DURATION, 1);
|
|
192
|
+
const newPosition = (0, _floating.interpolatePosition)(from, to, progress, _floating.easing.easeOutCubic);
|
|
193
|
+
setPosition(newPosition);
|
|
194
|
+
if (progress < 1) {
|
|
195
|
+
animationRef.current = requestAnimationFrame(animate);
|
|
196
|
+
} else {
|
|
197
|
+
setPosition(to);
|
|
198
|
+
onComplete?.();
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
animationRef.current = requestAnimationFrame(animate);
|
|
202
|
+
}, []);
|
|
203
|
+
(0, _react.useEffect)(() => {
|
|
204
|
+
return () => {
|
|
205
|
+
if (animationRef.current) {
|
|
206
|
+
cancelAnimationFrame(animationRef.current);
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
}, []);
|
|
210
|
+
return {
|
|
211
|
+
position,
|
|
212
|
+
setPosition,
|
|
213
|
+
animateTo
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// =============================
|
|
218
|
+
// Main FloatingTools Component
|
|
219
|
+
// =============================
|
|
220
|
+
|
|
221
|
+
// Last known bubble position — the AppHost minimize animation targets this so
|
|
222
|
+
// tools shrink toward the stack instead of the old bottom-right dock.
|
|
223
|
+
let lastBubbleAnchor = null;
|
|
224
|
+
function getBubbleAnchorPosition() {
|
|
225
|
+
return lastBubbleAnchor;
|
|
226
|
+
}
|
|
227
|
+
function FloatingTool({
|
|
228
|
+
id,
|
|
229
|
+
revealToken,
|
|
230
|
+
variant = "bubble",
|
|
231
|
+
dragFromSurface = false,
|
|
232
|
+
accessibilityLabel = "Drag handle",
|
|
233
|
+
accessory,
|
|
234
|
+
handleAdornment,
|
|
235
|
+
enablePositionPersistence = true,
|
|
236
|
+
children,
|
|
237
|
+
pushToSide = false,
|
|
238
|
+
suspendPointerEvents = false,
|
|
239
|
+
centerOnboarding = false,
|
|
240
|
+
minimizedStack,
|
|
241
|
+
hasMinimizedStack = false
|
|
242
|
+
}) {
|
|
243
|
+
const bubbleRef = (0, _react.useRef)(null);
|
|
244
|
+
const storage = (0, _react.useMemo)(() => id ? {
|
|
245
|
+
getItem: key => webStorageAdapter.getItem(`@buoy/floating-tool/${id}/${key}`),
|
|
246
|
+
setItem: (key, value) => webStorageAdapter.setItem(`@buoy/floating-tool/${id}/${key}`, value)
|
|
247
|
+
} : webStorageAdapter, [id]);
|
|
248
|
+
// Use shared hook
|
|
249
|
+
const {
|
|
250
|
+
state,
|
|
251
|
+
actions,
|
|
252
|
+
isInitialized
|
|
253
|
+
} = (0, _floating.useFloatingTools)({
|
|
254
|
+
screenSize: {
|
|
255
|
+
width: window.innerWidth,
|
|
256
|
+
height: window.innerHeight
|
|
257
|
+
},
|
|
258
|
+
enablePositionPersistence,
|
|
259
|
+
storage
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
// Web-specific animation
|
|
263
|
+
const {
|
|
264
|
+
position: animatedPosition,
|
|
265
|
+
setPosition: setAnimatedPosition,
|
|
266
|
+
animateTo
|
|
267
|
+
} = useWebAnimation();
|
|
268
|
+
|
|
269
|
+
// Sync position when initialized
|
|
270
|
+
(0, _react.useEffect)(() => {
|
|
271
|
+
if (isInitialized) {
|
|
272
|
+
setAnimatedPosition(state.position);
|
|
273
|
+
}
|
|
274
|
+
}, [isInitialized, state.position, setAnimatedPosition]);
|
|
275
|
+
|
|
276
|
+
// Publish the bubble anchor for the AppHost minimize-target (stack lives
|
|
277
|
+
// fused to the bubble now, not in a fixed dock).
|
|
278
|
+
(0, _react.useEffect)(() => {
|
|
279
|
+
if (!id) lastBubbleAnchor = {
|
|
280
|
+
x: animatedPosition.x,
|
|
281
|
+
y: animatedPosition.y
|
|
282
|
+
};
|
|
283
|
+
}, [animatedPosition, id]);
|
|
284
|
+
|
|
285
|
+
// Measure the same surface for both the DevTools bubble and custom strips.
|
|
286
|
+
(0, _react.useEffect)(() => {
|
|
287
|
+
if (!isInitialized) return;
|
|
288
|
+
const measure = () => {
|
|
289
|
+
const rect = bubbleRef.current?.getBoundingClientRect();
|
|
290
|
+
if (rect && rect.width > 0 && rect.height > 0) actions.setBubbleSize({
|
|
291
|
+
width: rect.width,
|
|
292
|
+
height: rect.height
|
|
293
|
+
});
|
|
294
|
+
};
|
|
295
|
+
const handleResize = () => {
|
|
296
|
+
actions.setScreenSize(window.innerWidth, window.innerHeight);
|
|
297
|
+
measure();
|
|
298
|
+
};
|
|
299
|
+
measure();
|
|
300
|
+
const observer = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(measure) : null;
|
|
301
|
+
if (bubbleRef.current) observer?.observe(bubbleRef.current);
|
|
302
|
+
window.addEventListener('resize', handleResize);
|
|
303
|
+
return () => {
|
|
304
|
+
observer?.disconnect();
|
|
305
|
+
window.removeEventListener('resize', handleResize);
|
|
306
|
+
};
|
|
307
|
+
}, [actions, isInitialized]);
|
|
308
|
+
|
|
309
|
+
// Keep the bubble below notches/status bars (WKWebView with viewport-fit=cover).
|
|
310
|
+
(0, _react.useEffect)(() => {
|
|
311
|
+
const probe = document.createElement('div');
|
|
312
|
+
probe.style.cssText = 'position:fixed;top:env(safe-area-inset-top);left:env(safe-area-inset-left);' + 'visibility:hidden;pointer-events:none';
|
|
313
|
+
document.body.appendChild(probe);
|
|
314
|
+
const rect = probe.getBoundingClientRect();
|
|
315
|
+
document.body.removeChild(probe);
|
|
316
|
+
if (rect.top > 0 || rect.left > 0) {
|
|
317
|
+
actions.setMinPosition({
|
|
318
|
+
x: Math.max(rect.left, 10),
|
|
319
|
+
y: Math.max(rect.top, 10)
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
}, [actions]);
|
|
323
|
+
|
|
324
|
+
// Web-specific: pointer event handling (mouse + touch).
|
|
325
|
+
// preventDefault on pointerdown suppresses the compatibility mouse events,
|
|
326
|
+
// and touchAction: 'none' on the bubble stops touch-drags from scrolling.
|
|
327
|
+
const [isPointerDown, setIsPointerDown] = (0, _react.useState)(false);
|
|
328
|
+
const handlePointerDown = (0, _react.useCallback)(e => {
|
|
329
|
+
e.stopPropagation();
|
|
330
|
+
e.preventDefault();
|
|
331
|
+
setIsPointerDown(true);
|
|
332
|
+
actions.handleDragStart({
|
|
333
|
+
clientX: e.clientX,
|
|
334
|
+
clientY: e.clientY
|
|
335
|
+
});
|
|
336
|
+
}, [actions]);
|
|
337
|
+
const surfaceGesture = (0, _react.useRef)(false);
|
|
338
|
+
const handleSurfacePointerDown = event => {
|
|
339
|
+
if (event.button !== 0 || !(event.target instanceof Element)) return;
|
|
340
|
+
if (event.target.closest('button, a, input, select, textarea, [role="button"], [role="switch"], [role="slider"], [role="checkbox"], [role="radio"], [contenteditable="true"], [data-floating-accessory]')) return;
|
|
341
|
+
surfaceGesture.current = true;
|
|
342
|
+
handlePointerDown(event);
|
|
343
|
+
};
|
|
344
|
+
const handlePointerMove = (0, _react.useCallback)(e => {
|
|
345
|
+
const result = actions.handleDragMove({
|
|
346
|
+
clientX: e.clientX,
|
|
347
|
+
clientY: e.clientY
|
|
348
|
+
});
|
|
349
|
+
if (result.isDragging) {
|
|
350
|
+
setAnimatedPosition(result.position);
|
|
351
|
+
}
|
|
352
|
+
}, [actions, setAnimatedPosition]);
|
|
353
|
+
const handlePointerUp = (0, _react.useCallback)(e => {
|
|
354
|
+
setIsPointerDown(false);
|
|
355
|
+
const result = actions.handleDragEnd({
|
|
356
|
+
clientX: e.clientX,
|
|
357
|
+
clientY: e.clientY
|
|
358
|
+
});
|
|
359
|
+
const fromSurface = surfaceGesture.current;
|
|
360
|
+
surfaceGesture.current = false;
|
|
361
|
+
if (result.wasTap && !fromSurface) {
|
|
362
|
+
const toggleResult = actions.toggleHideShow();
|
|
363
|
+
animateTo(state.position, toggleResult.targetPosition, () => {
|
|
364
|
+
actions.commitPosition(toggleResult.targetPosition);
|
|
365
|
+
});
|
|
366
|
+
} else if (result.shouldHide) {
|
|
367
|
+
animateTo(state.position, result.position, () => {
|
|
368
|
+
actions.commitPosition(result.position);
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
}, [actions, animateTo, state.position]);
|
|
372
|
+
(0, _react.useEffect)(() => {
|
|
373
|
+
if (isPointerDown) {
|
|
374
|
+
window.addEventListener('pointermove', handlePointerMove);
|
|
375
|
+
window.addEventListener('pointerup', handlePointerUp);
|
|
376
|
+
window.addEventListener('pointercancel', handlePointerUp);
|
|
377
|
+
return () => {
|
|
378
|
+
window.removeEventListener('pointermove', handlePointerMove);
|
|
379
|
+
window.removeEventListener('pointerup', handlePointerUp);
|
|
380
|
+
window.removeEventListener('pointercancel', handlePointerUp);
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
}, [isPointerDown, handlePointerMove, handlePointerUp]);
|
|
384
|
+
|
|
385
|
+
// Live refs so the pushToSide effect never animates from a stale closure
|
|
386
|
+
// (the from-position jump read as a "pop" when restoring).
|
|
387
|
+
const statePositionRef = (0, _react.useRef)(state.position);
|
|
388
|
+
statePositionRef.current = state.position;
|
|
389
|
+
const isHiddenRef = (0, _react.useRef)(state.isHidden);
|
|
390
|
+
isHiddenRef.current = state.isHidden;
|
|
391
|
+
|
|
392
|
+
// pushToSide: forceHide to the edge while a dial/tool is open; forceShow
|
|
393
|
+
// restores the saved position when it closes (200ms, native parity).
|
|
394
|
+
// Native semantics ported exactly (floatingTools.tsx:537-603):
|
|
395
|
+
// - push only when the bubble isn't already hidden (a user-hidden bubble
|
|
396
|
+
// is left alone, and we don't claim it as OUR push)
|
|
397
|
+
// - restore only when the bubble is STILL hidden from OUR push — if the
|
|
398
|
+
// user tapped/dragged it back out while a tool was open
|
|
399
|
+
// (userWantsVisibleRef), it stays exactly where they put it
|
|
400
|
+
const pushedRef = (0, _react.useRef)(false);
|
|
401
|
+
(0, _react.useEffect)(() => {
|
|
402
|
+
if (!isInitialized) return;
|
|
403
|
+
if (pushToSide && !pushedRef.current) {
|
|
404
|
+
if (isHiddenRef.current) return; // user hid it themselves — not our push
|
|
405
|
+
pushedRef.current = true;
|
|
406
|
+
const {
|
|
407
|
+
targetPosition
|
|
408
|
+
} = actions.forceHide();
|
|
409
|
+
animateTo(statePositionRef.current, targetPosition, () => {});
|
|
410
|
+
} else if (!pushToSide && pushedRef.current) {
|
|
411
|
+
pushedRef.current = false;
|
|
412
|
+
// User already showed it manually while the tool was open — leave it.
|
|
413
|
+
if (!isHiddenRef.current) return;
|
|
414
|
+
const {
|
|
415
|
+
targetPosition
|
|
416
|
+
} = actions.forceShow();
|
|
417
|
+
// The bubble may have grown while hidden (row tools/env badge toggled
|
|
418
|
+
// on) — clamp the restored position so it stays fully on-screen
|
|
419
|
+
// (native handles this via its width-change auto-reposition).
|
|
420
|
+
const width = bubbleRef.current?.getBoundingClientRect().width ?? 100;
|
|
421
|
+
const clamped = {
|
|
422
|
+
x: Math.max(10, Math.min(targetPosition.x, window.innerWidth - width - 10)),
|
|
423
|
+
y: targetPosition.y
|
|
424
|
+
};
|
|
425
|
+
animateTo(statePositionRef.current, clamped, () => {
|
|
426
|
+
actions.commitPosition(clamped);
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
}, [pushToSide, isInitialized]);
|
|
430
|
+
|
|
431
|
+
// centerOnboarding: park the bubble under the tooltip arrow while the
|
|
432
|
+
// welcome tooltip is up (native calculateTargetPosition math).
|
|
433
|
+
(0, _react.useEffect)(() => {
|
|
434
|
+
if (!centerOnboarding || !isInitialized) return;
|
|
435
|
+
const bubbleWidth = bubbleRef.current?.getBoundingClientRect().width ?? 100;
|
|
436
|
+
const bubbleHeight = bubbleRef.current?.getBoundingClientRect().height ?? 32;
|
|
437
|
+
const fromBottom = (0, _onboardingConstantsWeb.calculateTargetPosition)();
|
|
438
|
+
const target = {
|
|
439
|
+
x: (window.innerWidth - bubbleWidth) / 2,
|
|
440
|
+
y: window.innerHeight - fromBottom - bubbleHeight
|
|
441
|
+
};
|
|
442
|
+
animateTo(statePositionRef.current, target, () => {});
|
|
443
|
+
}, [centerOnboarding, isInitialized]);
|
|
444
|
+
const previousReveal = (0, _react.useRef)(undefined);
|
|
445
|
+
(0, _react.useEffect)(() => {
|
|
446
|
+
if (!isInitialized || previousReveal.current === revealToken) return;
|
|
447
|
+
previousReveal.current = revealToken;
|
|
448
|
+
if (revealToken !== undefined && revealToken > 0 && state.isHidden) {
|
|
449
|
+
const {
|
|
450
|
+
targetPosition
|
|
451
|
+
} = actions.forceShow();
|
|
452
|
+
animateTo(state.position, targetPosition, () => actions.commitPosition(targetPosition));
|
|
453
|
+
}
|
|
454
|
+
}, [revealToken, isInitialized, state.isHidden, state.position, actions, animateTo]);
|
|
455
|
+
|
|
456
|
+
// Interleave children with dividers
|
|
457
|
+
const actionsContent = (0, _react.useMemo)(() => variant === "strip" ? _react.Children.toArray(children) : (0, _floating.interleaveWithDividers)(_react.Children.toArray(children), key => /*#__PURE__*/(0, _jsxRuntime.jsx)(Divider, {}, key)), [children, variant]);
|
|
458
|
+
|
|
459
|
+
// Suppress the first paint until the persisted position has loaded so the
|
|
460
|
+
// bubble doesn't flash at 0,0 (native floatingTools.tsx:935-937).
|
|
461
|
+
if (!isInitialized) {
|
|
462
|
+
return null;
|
|
463
|
+
}
|
|
464
|
+
const spaceAbove = Math.max(0, animatedPosition.y - 8);
|
|
465
|
+
const spaceBelow = Math.max(0, window.innerHeight - animatedPosition.y - state.bubbleSize.height - 8);
|
|
466
|
+
const accessoryAbove = spaceAbove > spaceBelow;
|
|
467
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
468
|
+
ref: bubbleRef,
|
|
469
|
+
"data-testid": id ?? "buoy-floating-tool",
|
|
470
|
+
role: "toolbar",
|
|
471
|
+
"aria-label": "Floating Tools",
|
|
472
|
+
onPointerDown: dragFromSurface ? handleSurfacePointerDown : undefined,
|
|
473
|
+
style: {
|
|
474
|
+
position: 'fixed',
|
|
475
|
+
left: animatedPosition.x,
|
|
476
|
+
top: animatedPosition.y,
|
|
477
|
+
zIndex: 9999,
|
|
478
|
+
display: 'flex',
|
|
479
|
+
flexDirection: 'row',
|
|
480
|
+
alignItems: 'center',
|
|
481
|
+
backgroundColor: _floating.floatingToolsColors.panel,
|
|
482
|
+
// native: top-left corner + top border flatten when the minimized
|
|
483
|
+
// stack is fused above (floatingTools.tsx containerStyle)
|
|
484
|
+
borderTopLeftRadius: hasMinimizedStack ? 0 : 6,
|
|
485
|
+
borderTopRightRadius: 6,
|
|
486
|
+
borderBottomLeftRadius: 6,
|
|
487
|
+
borderBottomRightRadius: 6,
|
|
488
|
+
borderWidth: state.isDragging ? 2 : 1,
|
|
489
|
+
borderTopWidth: state.isDragging ? 2 : hasMinimizedStack ? 0 : 1,
|
|
490
|
+
borderStyle: 'solid',
|
|
491
|
+
borderColor: state.isDragging ? _floating.floatingToolsColors.dragActive : (0, _floating.withAlpha)(_floating.floatingToolsColors.muted, '66'),
|
|
492
|
+
// native floatingTools.tsx: shadowOffset {0, 6|4}, shadowRadius 12|8,
|
|
493
|
+
// shadowOpacity 0.6|0.3, shadowColor dragActive+"99"|"#000".
|
|
494
|
+
// Dragging color = 0x99 (0.6) alpha x 0.6 shadowOpacity = ~0.36 effective.
|
|
495
|
+
boxShadow: state.isDragging ? `0 6px 12px ${(0, _floating.withAlpha)(_floating.floatingToolsColors.dragActive, 0.36)}` : '0 4px 8px rgba(0, 0, 0, 0.3)',
|
|
496
|
+
cursor: dragFromSurface ? state.isDragging ? 'grabbing' : 'grab' : undefined,
|
|
497
|
+
userSelect: 'none',
|
|
498
|
+
touchAction: 'none',
|
|
499
|
+
pointerEvents: suspendPointerEvents ? 'none' : 'auto',
|
|
500
|
+
...(variant === 'strip' ? {
|
|
501
|
+
borderRadius: _nightTheme.night.radius.card,
|
|
502
|
+
minHeight: 48,
|
|
503
|
+
backgroundColor: _nightTheme.night.color.surface,
|
|
504
|
+
borderColor: state.isDragging ? _nightTheme.night.color.accentBorderStrong : _nightTheme.night.color.separator,
|
|
505
|
+
boxShadow: "0 4px 16px rgba(0, 0, 0, 0.24)"
|
|
506
|
+
} : {})
|
|
507
|
+
},
|
|
508
|
+
children: [minimizedStack && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
509
|
+
style: {
|
|
510
|
+
position: 'absolute',
|
|
511
|
+
bottom: '100%',
|
|
512
|
+
left: -1,
|
|
513
|
+
// align with the bubble border edge
|
|
514
|
+
width: _floating.VISIBLE_HANDLE_WIDTH,
|
|
515
|
+
overflow: 'visible',
|
|
516
|
+
zIndex: 1001
|
|
517
|
+
},
|
|
518
|
+
children: minimizedStack
|
|
519
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
520
|
+
role: "button",
|
|
521
|
+
"aria-label": accessibilityLabel,
|
|
522
|
+
"data-testid": id ? `${id}-grip` : "buoy-floating-grip",
|
|
523
|
+
tabIndex: 0,
|
|
524
|
+
onPointerDown: handlePointerDown,
|
|
525
|
+
onKeyDown: event => {
|
|
526
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
527
|
+
event.preventDefault();
|
|
528
|
+
const result = actions.toggleHideShow();
|
|
529
|
+
animateTo(state.position, result.targetPosition, () => actions.commitPosition(result.targetPosition));
|
|
530
|
+
},
|
|
531
|
+
style: {
|
|
532
|
+
touchAction: 'none',
|
|
533
|
+
paddingLeft: 6,
|
|
534
|
+
paddingRight: 6,
|
|
535
|
+
paddingTop: 6,
|
|
536
|
+
paddingBottom: 6,
|
|
537
|
+
backgroundColor: (0, _floating.withAlpha)(_floating.floatingToolsColors.muted, '1A'),
|
|
538
|
+
display: 'flex',
|
|
539
|
+
alignItems: 'center',
|
|
540
|
+
justifyContent: 'center',
|
|
541
|
+
width: _floating.VISIBLE_HANDLE_WIDTH,
|
|
542
|
+
boxSizing: 'border-box',
|
|
543
|
+
// RN width includes padding/border
|
|
544
|
+
borderRight: `1px solid ${(0, _floating.withAlpha)(_floating.floatingToolsColors.muted, '66')}`,
|
|
545
|
+
// native dragHandleStyle sets NO corner radius (container overflow is
|
|
546
|
+
// visible); the 10%-alpha bg square corner matches native rendering
|
|
547
|
+
cursor: state.isDragging ? 'grabbing' : 'grab',
|
|
548
|
+
...(variant === 'strip' ? {
|
|
549
|
+
minHeight: 48,
|
|
550
|
+
backgroundColor: 'transparent',
|
|
551
|
+
borderRight: 'none',
|
|
552
|
+
flexDirection: 'column'
|
|
553
|
+
} : {})
|
|
554
|
+
},
|
|
555
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(GripVerticalIcon, {
|
|
556
|
+
size: variant === "strip" ? 20 : 12
|
|
557
|
+
}), handleAdornment]
|
|
558
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_floating.FloatingToolsProvider, {
|
|
559
|
+
value: {
|
|
560
|
+
isDragging: state.isDragging,
|
|
561
|
+
isHidden: state.isHidden
|
|
562
|
+
},
|
|
563
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
564
|
+
style: {
|
|
565
|
+
display: 'flex',
|
|
566
|
+
flexDirection: 'row',
|
|
567
|
+
alignItems: 'center',
|
|
568
|
+
gap: 6,
|
|
569
|
+
paddingRight: 8
|
|
570
|
+
},
|
|
571
|
+
children: actionsContent
|
|
572
|
+
})
|
|
573
|
+
}), !state.isHidden && accessory && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
574
|
+
"data-floating-accessory": true,
|
|
575
|
+
style: {
|
|
576
|
+
position: "absolute",
|
|
577
|
+
...(accessoryAbove ? {
|
|
578
|
+
bottom: "100%"
|
|
579
|
+
} : {
|
|
580
|
+
top: "100%"
|
|
581
|
+
}),
|
|
582
|
+
left: 0,
|
|
583
|
+
width: "100%",
|
|
584
|
+
maxHeight: Math.max(spaceAbove, spaceBelow),
|
|
585
|
+
overflowY: "auto",
|
|
586
|
+
zIndex: 1002
|
|
587
|
+
},
|
|
588
|
+
children: accessory
|
|
589
|
+
})]
|
|
590
|
+
});
|
|
591
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FloatingToolHost = FloatingToolHost;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _floatingToolStore = require("../../stores/floatingToolStore.js");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
/** Mount once above navigation. The empty space around tools passes touches to the app. */
|
|
12
|
+
function FloatingToolHost() {
|
|
13
|
+
const entries = (0, _react.useSyncExternalStore)(_floatingToolStore.subscribeFloatingTools, _floatingToolStore.getFloatingTools, _floatingToolStore.getFloatingTools);
|
|
14
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
15
|
+
pointerEvents: "box-none",
|
|
16
|
+
style: {
|
|
17
|
+
position: "absolute",
|
|
18
|
+
top: 0,
|
|
19
|
+
left: 0,
|
|
20
|
+
right: 0,
|
|
21
|
+
bottom: 0,
|
|
22
|
+
zIndex: 10000
|
|
23
|
+
},
|
|
24
|
+
children: entries.map(entry => /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {
|
|
25
|
+
children: entry.render({
|
|
26
|
+
id: entry.id,
|
|
27
|
+
revealToken: entry.revealToken,
|
|
28
|
+
dismiss: () => (0, _floatingToolStore.dismissFloatingTool)(entry.id)
|
|
29
|
+
})
|
|
30
|
+
}, entry.id))
|
|
31
|
+
});
|
|
32
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FloatingToolHost = FloatingToolHost;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _floatingToolStore = require("../../stores/floatingToolStore.js");
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
/** The strip itself handles input; the rest of the viewport stays interactive. */
|
|
11
|
+
function FloatingToolHost() {
|
|
12
|
+
const entries = (0, _react.useSyncExternalStore)(_floatingToolStore.subscribeFloatingTools, _floatingToolStore.getFloatingTools, _floatingToolStore.getFloatingTools);
|
|
13
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
14
|
+
style: {
|
|
15
|
+
position: "fixed",
|
|
16
|
+
inset: 0,
|
|
17
|
+
pointerEvents: "none",
|
|
18
|
+
zIndex: 10000
|
|
19
|
+
},
|
|
20
|
+
children: entries.map(entry => /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {
|
|
21
|
+
children: entry.render({
|
|
22
|
+
id: entry.id,
|
|
23
|
+
revealToken: entry.revealToken,
|
|
24
|
+
dismiss: () => (0, _floatingToolStore.dismissFloatingTool)(entry.id)
|
|
25
|
+
})
|
|
26
|
+
}, entry.id))
|
|
27
|
+
});
|
|
28
|
+
}
|