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