@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,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Dimensions } from "react-native";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Shared constants for onboarding tooltip positioning
|
|
7
|
+
* These ensure the floating menu aligns perfectly under the tooltip arrow
|
|
8
|
+
* All positions are calculated dynamically based on screen size
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// Arrow dimensions (relative positioning)
|
|
12
|
+
export const ARROW_BOTTOM_OFFSET = -40; // Arrow extends below tooltip
|
|
13
|
+
export const ARROW_HEIGHT = 20; // borderTopWidth of arrow
|
|
14
|
+
export const SPACING_GAP = 10; // Gap between arrow tip and target element
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Calculate the center Y position of the screen
|
|
18
|
+
* This is used to vertically center the onboarding UI
|
|
19
|
+
*
|
|
20
|
+
* @returns Y coordinate at the center of the screen
|
|
21
|
+
*/
|
|
22
|
+
export function getScreenCenterY() {
|
|
23
|
+
const {
|
|
24
|
+
height: screenHeight
|
|
25
|
+
} = Dimensions.get("window");
|
|
26
|
+
return screenHeight / 2;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Calculate the tooltip position to center it vertically on screen
|
|
31
|
+
* Uses flexbox-style centering - tooltip will center itself with its actual size
|
|
32
|
+
*
|
|
33
|
+
* @returns Distance from screen bottom for tooltip positioning
|
|
34
|
+
*/
|
|
35
|
+
export function calculateTooltipPosition() {
|
|
36
|
+
// Position from center - tooltip will be centered with transform or flex
|
|
37
|
+
// We return a value that's slightly above center to account for the arrow below
|
|
38
|
+
const centerY = getScreenCenterY();
|
|
39
|
+
|
|
40
|
+
// Approximate offset to center the tooltip+arrow combo
|
|
41
|
+
// This is a reasonable estimate that works for most tooltip sizes
|
|
42
|
+
const estimatedHalfHeight = 130; // ~half of (tooltip + arrow)
|
|
43
|
+
|
|
44
|
+
return centerY - estimatedHalfHeight;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Calculate the position where a target element should be placed
|
|
49
|
+
* to align directly under the tooltip arrow
|
|
50
|
+
*
|
|
51
|
+
* @returns Distance from screen bottom where element should be positioned
|
|
52
|
+
*/
|
|
53
|
+
export function calculateTargetPosition() {
|
|
54
|
+
const tooltipBottom = calculateTooltipPosition();
|
|
55
|
+
|
|
56
|
+
// Arrow tip position = tooltip bottom + arrow offset (arrow extends below, so negative)
|
|
57
|
+
const arrowTipFromBottom = tooltipBottom + ARROW_BOTTOM_OFFSET;
|
|
58
|
+
|
|
59
|
+
// Subtract arrow height to get to the actual tip
|
|
60
|
+
const actualArrowTip = arrowTipFromBottom - ARROW_HEIGHT;
|
|
61
|
+
|
|
62
|
+
// Subtract spacing gap to position element below arrow
|
|
63
|
+
return actualArrowTip - SPACING_GAP;
|
|
64
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Web twin of onboardingConstants.ts — same math, window.innerHeight instead
|
|
5
|
+
* of RN Dimensions.
|
|
6
|
+
*/
|
|
7
|
+
export const ARROW_BOTTOM_OFFSET = -40; // Arrow extends below tooltip
|
|
8
|
+
export const ARROW_HEIGHT = 20; // borderTopWidth of arrow
|
|
9
|
+
export const SPACING_GAP = 10; // Gap between arrow tip and target element
|
|
10
|
+
|
|
11
|
+
export function getScreenCenterY() {
|
|
12
|
+
return window.innerHeight / 2;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Distance from screen bottom for tooltip positioning (centered-ish). */
|
|
16
|
+
export function calculateTooltipPosition() {
|
|
17
|
+
const estimatedHalfHeight = 130; // ~half of (tooltip + arrow)
|
|
18
|
+
return getScreenCenterY() - estimatedHalfHeight;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Distance from screen bottom where the bubble should sit (under the arrow). */
|
|
22
|
+
export function calculateTargetPosition() {
|
|
23
|
+
const tooltipBottom = calculateTooltipPosition();
|
|
24
|
+
const arrowTipFromBottom = tooltipBottom + ARROW_BOTTOM_OFFSET;
|
|
25
|
+
const actualArrowTip = arrowTipFromBottom - ARROW_HEIGHT;
|
|
26
|
+
return actualArrowTip - SPACING_GAP;
|
|
27
|
+
}
|
|
@@ -214,5 +214,7 @@ export const dialColors = {
|
|
|
214
214
|
dialGradient3: "rgba(255, 255, 255, 0.06)",
|
|
215
215
|
dialBorder: "rgba(255, 255, 255, 0.12)",
|
|
216
216
|
dialShadow: "#000000",
|
|
217
|
-
dialGridLine: "rgba(255, 255, 255, 0.08)"
|
|
217
|
+
dialGridLine: "rgba(255, 255, 255, 0.08)",
|
|
218
|
+
hubFill: "rgba(5, 5, 5, 0.34)",
|
|
219
|
+
hubHalo: "rgba(5, 5, 5, 0.12)"
|
|
218
220
|
};
|
package/lib/module/ui/index.js
CHANGED
|
@@ -24,4 +24,8 @@ export * from "./gameUI/index.js";
|
|
|
24
24
|
export * from "./otto/index.js";
|
|
25
25
|
|
|
26
26
|
// FlatList presets (tuned window/batch values + the E2E clipping guard)
|
|
27
|
-
export { EVENT_LIST_PRESET, LOG_LIST_PRESET, CLIP_OFFSCREEN_CELLS } from "./listPresets.js";
|
|
27
|
+
export { EVENT_LIST_PRESET, LOG_LIST_PRESET, CLIP_OFFSCREEN_CELLS } from "./listPresets.js";
|
|
28
|
+
export { FloatingTool, getBubbleAnchorPosition, Divider as FloatingToolDivider, UserStatus as FloatingToolUserStatus } from "./floating/FloatingTool";
|
|
29
|
+
export { ARROW_BOTTOM_OFFSET, ARROW_HEIGHT, SPACING_GAP, getScreenCenterY, calculateTooltipPosition, calculateTargetPosition } from "./floating/onboardingConstants";
|
|
30
|
+
export { FloatingToolHost } from "./floating/FloatingToolHost";
|
|
31
|
+
export { openFloatingTool, dismissFloatingTool, registerPersistentFloatingTool, getFloatingTools, subscribeFloatingTools } from "../stores/floatingToolStore.js";
|
|
@@ -35,6 +35,16 @@ export const night = {
|
|
|
35
35
|
border: "#1A1A1C",
|
|
36
36
|
/** Hairline between rows inside a card. */
|
|
37
37
|
separator: "rgba(255, 255, 255, 0.08)",
|
|
38
|
+
/**
|
|
39
|
+
* Glass variants of the surfaces above, for screens that sit on a living
|
|
40
|
+
* ToolBackground and want it to leak through (the dial settings). Same
|
|
41
|
+
* family as the dial hub's `hubFill` — black at a fraction, never a tint —
|
|
42
|
+
* with a white-alpha lift for rows and a white-alpha hairline so no dark
|
|
43
|
+
* ring appears when the field behind is bright.
|
|
44
|
+
*/
|
|
45
|
+
glass: "rgba(5, 5, 5, 0.50)",
|
|
46
|
+
glassElevated: "rgba(255, 255, 255, 0.06)",
|
|
47
|
+
glassBorder: "rgba(255, 255, 255, 0.07)",
|
|
38
48
|
/** Neutral fills, lightest → strongest. */
|
|
39
49
|
fill: "rgba(255, 255, 255, 0.06)",
|
|
40
50
|
fillSecondary: "rgba(255, 255, 255, 0.08)",
|
|
@@ -48,14 +48,19 @@ export function NightFootnote({
|
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* A card: `#0C0C0C`, radius 14, hairline border. `padded` = interior 14.
|
|
53
|
+
* `glass` swaps the opaque fill for `night.color.glass` so the ToolBackground
|
|
54
|
+
* behind the sheet shows through the card.
|
|
55
|
+
*/
|
|
52
56
|
export function NightCard({
|
|
53
57
|
children,
|
|
54
58
|
padded,
|
|
59
|
+
glass,
|
|
55
60
|
style
|
|
56
61
|
}) {
|
|
57
62
|
return /*#__PURE__*/_jsx(View, {
|
|
58
|
-
style: [styles.card, padded ? styles.cardPadded : null, style],
|
|
63
|
+
style: [styles.card, glass ? styles.cardGlass : null, padded ? styles.cardPadded : null, style],
|
|
59
64
|
children: children
|
|
60
65
|
});
|
|
61
66
|
}
|
|
@@ -209,11 +214,12 @@ export function NightSegmented({
|
|
|
209
214
|
tabs,
|
|
210
215
|
activeKey,
|
|
211
216
|
onChange,
|
|
212
|
-
size = "md"
|
|
217
|
+
size = "md",
|
|
218
|
+
glass
|
|
213
219
|
}) {
|
|
214
220
|
const small = size === "sm";
|
|
215
221
|
return /*#__PURE__*/_jsx(View, {
|
|
216
|
-
style: styles.segmentTrack,
|
|
222
|
+
style: [styles.segmentTrack, glass ? styles.segmentTrackGlass : null],
|
|
217
223
|
children: tabs.map(tab => {
|
|
218
224
|
const active = tab.key === activeKey;
|
|
219
225
|
return /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
@@ -224,7 +230,7 @@ export function NightSegmented({
|
|
|
224
230
|
},
|
|
225
231
|
accessibilityLabel: tab.label,
|
|
226
232
|
onPress: () => onChange(tab.key),
|
|
227
|
-
style: [styles.segment, small ? styles.segmentSm : null, active ? styles.segmentActive : null],
|
|
233
|
+
style: [styles.segment, small ? styles.segmentSm : null, active ? glass ? styles.segmentActiveGlass : styles.segmentActive : null],
|
|
228
234
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
229
235
|
style: [styles.segmentText, small ? styles.segmentTextSm : null, active ? styles.segmentTextActive : null],
|
|
230
236
|
children: tab.label
|
|
@@ -288,6 +294,10 @@ const styles = StyleSheet.create({
|
|
|
288
294
|
borderColor: night.color.border,
|
|
289
295
|
overflow: "hidden"
|
|
290
296
|
},
|
|
297
|
+
cardGlass: {
|
|
298
|
+
backgroundColor: night.color.glass,
|
|
299
|
+
borderColor: night.color.glassBorder
|
|
300
|
+
},
|
|
291
301
|
cardPadded: {
|
|
292
302
|
padding: night.cardPad,
|
|
293
303
|
gap: 10
|
|
@@ -403,9 +413,16 @@ const styles = StyleSheet.create({
|
|
|
403
413
|
justifyContent: "center",
|
|
404
414
|
borderRadius: night.radius.segment
|
|
405
415
|
},
|
|
416
|
+
segmentTrackGlass: {
|
|
417
|
+
backgroundColor: night.color.glass,
|
|
418
|
+
borderColor: night.color.glassBorder
|
|
419
|
+
},
|
|
406
420
|
segmentActive: {
|
|
407
421
|
backgroundColor: night.color.surfaceElevated
|
|
408
422
|
},
|
|
423
|
+
segmentActiveGlass: {
|
|
424
|
+
backgroundColor: night.color.glassElevated
|
|
425
|
+
},
|
|
409
426
|
segmentText: {
|
|
410
427
|
fontSize: night.font.caption,
|
|
411
428
|
fontWeight: "500",
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Otto × tool scenes in React Native (core APIs only, so it also runs through
|
|
5
|
+
* react-native-web).
|
|
6
|
+
*
|
|
7
|
+
* <OttoSceneFrame scene={…} t={tick} pixelSize={4} /> one frame, caller's clock
|
|
8
|
+
* <OttoSceneStill scene={…} pixelSize={2} /> frame 0, no clock
|
|
9
|
+
*
|
|
10
|
+
* A frame is ~150–250 run Views, so this is a still/hero renderer: drive `t`
|
|
11
|
+
* from a shared clock on a review page, not per list row. `crop` trims the
|
|
12
|
+
* canvas to the rows that carry pixels (the bottom rows are spare headroom).
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { View } from "react-native";
|
|
16
|
+
import { OTTO_SCENE_H, OTTO_SCENE_W, ottoSceneRuns, renderOttoScene } from "./ottoScenes.js";
|
|
17
|
+
|
|
18
|
+
/** Rows 0–20 carry the art; 21–23 are headroom for hops. */
|
|
19
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
+
export const OTTO_SCENE_CROP_H = 21;
|
|
21
|
+
export function OttoSceneFrame({
|
|
22
|
+
scene,
|
|
23
|
+
t = 0,
|
|
24
|
+
pixelSize,
|
|
25
|
+
crop = true,
|
|
26
|
+
style
|
|
27
|
+
}) {
|
|
28
|
+
const rows = crop ? OTTO_SCENE_CROP_H : OTTO_SCENE_H;
|
|
29
|
+
const runs = ottoSceneRuns(renderOttoScene(scene, t)).filter(r => r.y < rows);
|
|
30
|
+
const spans = [];
|
|
31
|
+
let rowY = -1;
|
|
32
|
+
let rowIndex = 0;
|
|
33
|
+
for (const r of runs) {
|
|
34
|
+
if (r.y !== rowY) {
|
|
35
|
+
rowY = r.y;
|
|
36
|
+
rowIndex = 0;
|
|
37
|
+
}
|
|
38
|
+
spans.push(/*#__PURE__*/_jsx(View, {
|
|
39
|
+
style: {
|
|
40
|
+
position: "absolute",
|
|
41
|
+
left: r.x * pixelSize,
|
|
42
|
+
top: r.y * pixelSize,
|
|
43
|
+
width: r.w * pixelSize,
|
|
44
|
+
height: pixelSize,
|
|
45
|
+
backgroundColor: r.color
|
|
46
|
+
}
|
|
47
|
+
}, `${r.y}:${rowIndex++}`));
|
|
48
|
+
}
|
|
49
|
+
return /*#__PURE__*/_jsx(View, {
|
|
50
|
+
pointerEvents: "none",
|
|
51
|
+
style: [{
|
|
52
|
+
width: OTTO_SCENE_W * pixelSize,
|
|
53
|
+
height: rows * pixelSize
|
|
54
|
+
}, style],
|
|
55
|
+
children: spans
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/** Frame 0 of a scene — safe anywhere a still image would be. */
|
|
59
|
+
export function OttoSceneStill(props) {
|
|
60
|
+
return /*#__PURE__*/_jsx(OttoSceneFrame, {
|
|
61
|
+
...props,
|
|
62
|
+
t: 0
|
|
63
|
+
});
|
|
64
|
+
}
|
|
@@ -60,6 +60,13 @@ const BASE = {
|
|
|
60
60
|
legs: [0, 0, 0]
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* A keyboard, rows 10–12 from x=3: light top edge, a row of white key caps
|
|
65
|
+
* on grey, grey base. Three rows, so the body stays readable at 16px — a
|
|
66
|
+
* laptop screen at this size is a dark blob. See `typing`.
|
|
67
|
+
*/
|
|
68
|
+
const TYPING_KEYBOARD = ["nnnnnnnnnn", "lmlmlmlmlm", "mmmmmmmmmm"];
|
|
69
|
+
|
|
63
70
|
// Keys that count as "body" for the keyline pass. Props (n/m/l/p/1) get none.
|
|
64
71
|
const BODY_KEYS = "gsdhaArRk";
|
|
65
72
|
function walk(t) {
|
|
@@ -293,13 +300,9 @@ export const OTTO_STATES = {
|
|
|
293
300
|
}),
|
|
294
301
|
typing: t => {
|
|
295
302
|
const e = [];
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
rect(12, 9, 12, 10, "n", e);
|
|
300
|
-
rect(4, 9, 11, 10, "1", e);
|
|
301
|
-
rect(7, 9, 8, 10, "g", e);
|
|
302
|
-
rect(2, 12, 13, 12, "m", e);
|
|
303
|
+
TYPING_KEYBOARD.forEach((row, dy) => {
|
|
304
|
+
for (let dx = 0; dx < row.length; dx++) e.push([3 + dx, 10 + dy, row[dx]]);
|
|
305
|
+
});
|
|
303
306
|
const tap = t % 2;
|
|
304
307
|
e.push([2, 10 + tap, "g"], [13, 11 - tap, "g"]);
|
|
305
308
|
return {
|