@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
|
@@ -4,107 +4,87 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.TIER_LIMITS = void 0;
|
|
7
|
-
exports.freeKeyRaises = freeKeyRaises;
|
|
8
7
|
exports.resolveEffectiveTier = resolveEffectiveTier;
|
|
9
8
|
exports.useLimit = useLimit;
|
|
10
9
|
var _licenseModule = require("./licenseModule.js");
|
|
11
10
|
/**
|
|
12
|
-
* Per-tier numeric limits — the ONLY thing that separates
|
|
11
|
+
* Per-tier numeric limits — the ONLY thing that separates free from pro on a
|
|
12
|
+
* count.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
* navigation)
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* The governing rule: **the free column never moves.** Anonymous is carved out
|
|
19
|
-
* BELOW today's free tier — nothing is ever added to free in exchange for an
|
|
20
|
-
* account, because that would come straight out of the Pro upgrade.
|
|
14
|
+
* Binary Pro gates (copy-to-clipboard, state editing, storage mutations,
|
|
15
|
+
* navigation) live in the tools themselves; this table is only for "how many".
|
|
16
|
+
* Whether the tools are usable at all is account admission, which is a
|
|
17
|
+
* separate question from the tier and is never expressed as a limit.
|
|
21
18
|
*/
|
|
22
19
|
|
|
23
20
|
const LIMITS = {
|
|
24
21
|
// ── network ───────────────────────────────────────────────────────────────
|
|
25
22
|
"network.requests": {
|
|
26
|
-
anonymous: 5,
|
|
27
23
|
free: 25,
|
|
28
24
|
pro: Infinity
|
|
29
25
|
},
|
|
30
26
|
"network.saved": {
|
|
31
|
-
anonymous: 1,
|
|
32
27
|
free: 5,
|
|
33
28
|
pro: 50
|
|
34
29
|
},
|
|
35
|
-
// Already 1 for free, so 25% would be 0 — which deletes the feature rather
|
|
36
|
-
// than trialling it. Raising the FREE value to make room is not an option.
|
|
37
30
|
"network.overrideRules": {
|
|
38
|
-
anonymous: 1,
|
|
39
31
|
free: 1,
|
|
40
32
|
pro: 50
|
|
41
33
|
},
|
|
42
34
|
// ── storage ───────────────────────────────────────────────────────────────
|
|
43
35
|
"storage.events": {
|
|
44
|
-
anonymous: 5,
|
|
45
36
|
free: 25,
|
|
46
37
|
pro: Infinity
|
|
47
38
|
},
|
|
48
39
|
"storage.keys": {
|
|
49
|
-
anonymous: 5,
|
|
50
40
|
free: 25,
|
|
51
41
|
pro: Infinity
|
|
52
42
|
},
|
|
53
|
-
// Same floor-at-1 reasoning as network.overrideRules.
|
|
54
43
|
"storage.mmkvInstances": {
|
|
55
|
-
anonymous: 1,
|
|
56
44
|
free: 1,
|
|
57
45
|
pro: Infinity
|
|
58
46
|
},
|
|
59
47
|
// ── state tools ───────────────────────────────────────────────────────────
|
|
60
48
|
"redux.actions": {
|
|
61
|
-
anonymous: 5,
|
|
62
49
|
free: 25,
|
|
63
50
|
pro: Infinity
|
|
64
51
|
},
|
|
65
52
|
"zustand.changes": {
|
|
66
|
-
anonymous: 5,
|
|
67
53
|
free: 25,
|
|
68
54
|
pro: Infinity
|
|
69
55
|
},
|
|
70
56
|
"jotai.changes": {
|
|
71
|
-
anonymous: 5,
|
|
72
57
|
free: 25,
|
|
73
58
|
pro: Infinity
|
|
74
59
|
},
|
|
75
60
|
"events.entries": {
|
|
76
|
-
anonymous: 5,
|
|
77
61
|
free: 25,
|
|
78
62
|
pro: Infinity
|
|
79
63
|
},
|
|
80
64
|
// ── render / navigation ───────────────────────────────────────────────────
|
|
81
65
|
"highlightUpdates.components": {
|
|
82
|
-
anonymous: 5,
|
|
83
66
|
free: 25,
|
|
84
67
|
pro: Infinity
|
|
85
68
|
},
|
|
86
69
|
"highlightUpdates.historyEvents": {
|
|
87
|
-
anonymous: 1,
|
|
88
70
|
free: 3,
|
|
89
71
|
pro: Infinity
|
|
90
72
|
},
|
|
91
73
|
"highlightUpdates.detailEvents": {
|
|
92
|
-
anonymous: 2,
|
|
93
74
|
free: 5,
|
|
94
75
|
pro: Infinity
|
|
95
76
|
},
|
|
96
77
|
"routeEvents.entries": {
|
|
97
|
-
anonymous: 1,
|
|
98
78
|
free: 3,
|
|
99
79
|
pro: Infinity
|
|
100
80
|
},
|
|
81
|
+
// One restore point at a time. The floating bar's safety slot is not one
|
|
82
|
+
// the user chose to keep, so it is not counted against this.
|
|
101
83
|
"timeMachine.snapshots": {
|
|
102
|
-
|
|
103
|
-
free: 2,
|
|
84
|
+
free: 1,
|
|
104
85
|
pro: Infinity
|
|
105
86
|
},
|
|
106
87
|
"perfMonitor.automationCases": {
|
|
107
|
-
anonymous: 1,
|
|
108
88
|
free: 3,
|
|
109
89
|
pro: Infinity
|
|
110
90
|
},
|
|
@@ -113,12 +93,10 @@ const LIMITS = {
|
|
|
113
93
|
// three-endpoint scenario either runs whole or refuses up front, and is never
|
|
114
94
|
// silently trimmed to one rule mid-run. Enforcement is atomic in pre-flight.
|
|
115
95
|
"scenarios.saved": {
|
|
116
|
-
anonymous: 1,
|
|
117
96
|
free: 3,
|
|
118
97
|
pro: Infinity
|
|
119
98
|
},
|
|
120
99
|
"scenarios.active": {
|
|
121
|
-
anonymous: 1,
|
|
122
100
|
free: 1,
|
|
123
101
|
pro: 3
|
|
124
102
|
}
|
|
@@ -129,17 +107,11 @@ const TIER_LIMITS = exports.TIER_LIMITS = LIMITS;
|
|
|
129
107
|
* The tier whose limits actually apply.
|
|
130
108
|
*
|
|
131
109
|
* `hasProAccess` is `useIsPro()`, which is true for a real Pro license OR the
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* now. When the Weekend Pass is later gated to key-holders, that change lands
|
|
135
|
-
* here for free — no limit call site has to know about it.
|
|
110
|
+
* Weekend Pass. Routing the Weekend Pass through here is what gives weekend
|
|
111
|
+
* users Pro limits without any limit call site having to know about it.
|
|
136
112
|
*/
|
|
137
113
|
function resolveEffectiveTier(tier, hasProAccess) {
|
|
138
|
-
|
|
139
|
-
// The switch lives in @buoy-gg/license so that this and the Weekend Pass
|
|
140
|
-
// change flip together — see isAnonymousTierEnabled().
|
|
141
|
-
if (!(0, _licenseModule.isAnonymousTierEnabled)() && tier === "anonymous") return "free";
|
|
142
|
-
return tier;
|
|
114
|
+
return hasProAccess ? "pro" : tier;
|
|
143
115
|
}
|
|
144
116
|
|
|
145
117
|
/**
|
|
@@ -153,27 +125,4 @@ function useLimit(key) {
|
|
|
153
125
|
const hasProAccess = (0, _licenseModule.getUseIsPro)()();
|
|
154
126
|
const tier = (0, _licenseModule.getUseTier)()();
|
|
155
127
|
return TIER_LIMITS[key][resolveEffectiveTier(tier, hasProAccess)];
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Whether claiming a FREE key would actually raise this limit right now.
|
|
160
|
-
*
|
|
161
|
-
* The anonymous upsell must never promise something a free key won't deliver.
|
|
162
|
-
* Two ways it could lie, and this closes both:
|
|
163
|
-
*
|
|
164
|
-
* - **Pro-exclusive features.** Copy-to-clipboard, state editing, storage
|
|
165
|
-
* mutations and navigation are locked for anonymous AND free alike. Telling
|
|
166
|
-
* an anonymous user a free key opens them would be false.
|
|
167
|
-
* - **Limits that are already equal.** Override rules and MMKV instances sit
|
|
168
|
-
* at 1 for both tiers, so a key changes nothing there either.
|
|
169
|
-
*
|
|
170
|
-
* It also respects `ANONYMOUS_TIER_ENABLED`: while the anonymous tier is off,
|
|
171
|
-
* an anonymous user is *already* getting the free limits, so there is nothing
|
|
172
|
-
* to claim and this correctly returns false everywhere. That falls out of
|
|
173
|
-
* asking `resolveEffectiveTier` rather than reading the table directly, so the
|
|
174
|
-
* switch and the copy can never disagree.
|
|
175
|
-
*/
|
|
176
|
-
function freeKeyRaises(key) {
|
|
177
|
-
const limits = TIER_LIMITS[key];
|
|
178
|
-
return limits[resolveEffectiveTier("anonymous", false)] < limits[resolveEffectiveTier("free", false)];
|
|
179
128
|
}
|
|
@@ -133,7 +133,14 @@ const devToolsStorageKeys = exports.devToolsStorageKeys = {
|
|
|
133
133
|
*/
|
|
134
134
|
timeMachine: {
|
|
135
135
|
root: () => `${devToolsStorageKeys.base}_time_machine`,
|
|
136
|
-
diffViewerMode: () => `${devToolsStorageKeys.timeMachine.root()}_diff_viewer_mode
|
|
136
|
+
diffViewerMode: () => `${devToolsStorageKeys.timeMachine.root()}_diff_viewer_mode`,
|
|
137
|
+
// 'split' | 'tree'
|
|
138
|
+
/** The restore point the floating restore bar restores on tap (snapshot id). */
|
|
139
|
+
armedPoint: () => `${devToolsStorageKeys.timeMachine.root()}_armed_point`,
|
|
140
|
+
/** "1" when the action bar restores in reload mode (storage, then a JS reload). */
|
|
141
|
+
barReloadMode: () => `${devToolsStorageKeys.timeMachine.root()}_bar_reload_mode`,
|
|
142
|
+
/** Source ids switched OFF in the Sources strip (JSON string array). */
|
|
143
|
+
disabledSources: () => `${devToolsStorageKeys.timeMachine.root()}_disabled_sources`
|
|
137
144
|
},
|
|
138
145
|
/**
|
|
139
146
|
* Scenarios storage keys. The library (saved + draft scenarios) and the
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.BaseEventStore = void 0;
|
|
7
|
+
var _licenseModule = require("../license/licenseModule.js");
|
|
7
8
|
var _subscribable = require("../utils/subscribable.js");
|
|
8
9
|
var _subscriberCountNotifier = require("../utils/subscriberCountNotifier.js");
|
|
9
10
|
/**
|
|
@@ -68,6 +69,20 @@ class BaseEventStore extends _subscribable.Subscribable {
|
|
|
68
69
|
super();
|
|
69
70
|
this.maxEvents = options.maxEvents ?? 500;
|
|
70
71
|
this.storeName = options.storeName;
|
|
72
|
+
// Defer until subclass fields are initialized before invoking lifecycle hooks.
|
|
73
|
+
Promise.resolve().then(() => {
|
|
74
|
+
const reconcile = () => {
|
|
75
|
+
if ((0, _licenseModule.getAccountAccess)().status === "locked") {
|
|
76
|
+
this.stopCapturing();
|
|
77
|
+
this.events = [];
|
|
78
|
+
this.notifyArrayListeners();
|
|
79
|
+
} else if (this.getTotalSubscriberCount() > 0 && !this.captureSuppressed && !this.isCapturing()) {
|
|
80
|
+
this.startCapturing();
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
(0, _licenseModule.subscribeAccountAccess)(reconcile);
|
|
84
|
+
reconcile();
|
|
85
|
+
});
|
|
71
86
|
}
|
|
72
87
|
|
|
73
88
|
// ===========================================================================
|
|
@@ -97,7 +112,7 @@ class BaseEventStore extends _subscribable.Subscribable {
|
|
|
97
112
|
* Starts capturing if no one was subscribed.
|
|
98
113
|
*/
|
|
99
114
|
onSubscribe() {
|
|
100
|
-
if (this.getTotalSubscriberCount() === 1 && !this.captureSuppressed) {
|
|
115
|
+
if (this.getTotalSubscriberCount() === 1 && !this.captureSuppressed && (0, _licenseModule.getAccountAccess)().status !== "locked") {
|
|
101
116
|
this.startCapturing();
|
|
102
117
|
}
|
|
103
118
|
(0, _subscriberCountNotifier.notifySubscriberCountChange)(this.storeName);
|
|
@@ -137,7 +152,7 @@ class BaseEventStore extends _subscribable.Subscribable {
|
|
|
137
152
|
this.arrayListeners.add(listener);
|
|
138
153
|
|
|
139
154
|
// Start capturing if this is the first subscriber
|
|
140
|
-
if (wasEmpty && !this.captureSuppressed) {
|
|
155
|
+
if (wasEmpty && !this.captureSuppressed && (0, _licenseModule.getAccountAccess)().status !== "locked") {
|
|
141
156
|
this.startCapturing();
|
|
142
157
|
}
|
|
143
158
|
|
|
@@ -184,11 +199,12 @@ class BaseEventStore extends _subscribable.Subscribable {
|
|
|
184
199
|
* @param event - The event to add
|
|
185
200
|
*/
|
|
186
201
|
addEvent(event) {
|
|
202
|
+
if ((0, _licenseModule.getAccountAccess)().status === "locked") return;
|
|
187
203
|
// Add to beginning (newest first) and limit to maxEvents
|
|
188
204
|
this.events = [event, ...this.events].slice(0, this.maxEvents);
|
|
189
205
|
|
|
190
206
|
// Notify individual event callbacks (via Subscribable)
|
|
191
|
-
this.notify(event);
|
|
207
|
+
if ((0, _licenseModule.hasAccountAccess)()) this.notify(event);
|
|
192
208
|
|
|
193
209
|
// Notify array listeners
|
|
194
210
|
this.notifyArrayListeners();
|
|
@@ -212,14 +228,14 @@ class BaseEventStore extends _subscribable.Subscribable {
|
|
|
212
228
|
* Get all events (newest first)
|
|
213
229
|
*/
|
|
214
230
|
getEvents() {
|
|
215
|
-
return this.events;
|
|
231
|
+
return (0, _licenseModule.hasAccountAccess)() ? this.events : [];
|
|
216
232
|
}
|
|
217
233
|
|
|
218
234
|
/**
|
|
219
235
|
* Get event count
|
|
220
236
|
*/
|
|
221
237
|
getEventCount() {
|
|
222
|
-
return this.events.length;
|
|
238
|
+
return (0, _licenseModule.hasAccountAccess)() ? this.events.length : 0;
|
|
223
239
|
}
|
|
224
240
|
|
|
225
241
|
/**
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createToolStore = createToolStore;
|
|
7
|
+
var _licenseModule = require("../license/licenseModule.js");
|
|
7
8
|
/**
|
|
8
9
|
* createToolStore — the one bounded, subscribable buffer every tool used to
|
|
9
10
|
* hand-roll.
|
|
@@ -53,6 +54,16 @@ function createToolStore(options) {
|
|
|
53
54
|
let nextId = options.firstId ?? 1;
|
|
54
55
|
let lastFlushAt = 0;
|
|
55
56
|
let emitScheduled = false;
|
|
57
|
+
const empty = [];
|
|
58
|
+
let observing = false;
|
|
59
|
+
function observe() {
|
|
60
|
+
if (observing) return;
|
|
61
|
+
observing = true;
|
|
62
|
+
(0, _licenseModule.subscribeAccountAccess)(() => {
|
|
63
|
+
if ((0, _licenseModule.getAccountAccess)().status === "locked") items = [];
|
|
64
|
+
emit();
|
|
65
|
+
});
|
|
66
|
+
}
|
|
56
67
|
const listeners = new Set();
|
|
57
68
|
const clearListeners = new Set();
|
|
58
69
|
function fire() {
|
|
@@ -83,19 +94,22 @@ function createToolStore(options) {
|
|
|
83
94
|
const store = {
|
|
84
95
|
id,
|
|
85
96
|
subscribe(listener) {
|
|
97
|
+
observe();
|
|
86
98
|
listeners.add(listener);
|
|
87
99
|
return () => {
|
|
88
100
|
listeners.delete(listener);
|
|
89
101
|
};
|
|
90
102
|
},
|
|
91
103
|
getSnapshot() {
|
|
92
|
-
|
|
104
|
+
observe();
|
|
105
|
+
return (0, _licenseModule.hasAccountAccess)() ? items : empty;
|
|
93
106
|
},
|
|
94
107
|
size() {
|
|
95
|
-
return items.length;
|
|
108
|
+
return (0, _licenseModule.hasAccountAccess)() ? items.length : 0;
|
|
96
109
|
},
|
|
97
110
|
add(item) {
|
|
98
|
-
|
|
111
|
+
observe();
|
|
112
|
+
if (paused || (0, _licenseModule.getAccountAccess)().status === "locked") return;
|
|
99
113
|
if (order === "append") {
|
|
100
114
|
items = items.length >= max ? [...items.slice(items.length - max + 1), item] : [...items, item];
|
|
101
115
|
} else {
|
|
@@ -104,10 +118,14 @@ function createToolStore(options) {
|
|
|
104
118
|
emit();
|
|
105
119
|
},
|
|
106
120
|
set(next) {
|
|
121
|
+
observe();
|
|
122
|
+
if (!(0, _licenseModule.hasAccountAccess)()) return;
|
|
107
123
|
items = trim(next);
|
|
108
124
|
emit();
|
|
109
125
|
},
|
|
110
126
|
update(fn) {
|
|
127
|
+
observe();
|
|
128
|
+
if ((0, _licenseModule.getAccountAccess)().status === "locked") return;
|
|
111
129
|
items = trim(fn(items));
|
|
112
130
|
emit();
|
|
113
131
|
},
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.dismissFloatingTool = dismissFloatingTool;
|
|
7
|
+
exports.getFloatingTools = void 0;
|
|
8
|
+
exports.openFloatingTool = openFloatingTool;
|
|
9
|
+
exports.registerPersistentFloatingTool = registerPersistentFloatingTool;
|
|
10
|
+
exports.subscribeFloatingTools = void 0;
|
|
11
|
+
let entries = [];
|
|
12
|
+
let revision = 0;
|
|
13
|
+
const listeners = new Set();
|
|
14
|
+
const notify = () => listeners.forEach(listener => listener());
|
|
15
|
+
const getFloatingTools = () => entries;
|
|
16
|
+
exports.getFloatingTools = getFloatingTools;
|
|
17
|
+
const subscribeFloatingTools = listener => {
|
|
18
|
+
listeners.add(listener);
|
|
19
|
+
return () => {
|
|
20
|
+
listeners.delete(listener);
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** Open or restore one tool. Mount FloatingToolHost once at the application root. */
|
|
25
|
+
exports.subscribeFloatingTools = subscribeFloatingTools;
|
|
26
|
+
function openFloatingTool(tool) {
|
|
27
|
+
if (!tool.id.trim()) throw new Error("Floating tools need a non-empty id");
|
|
28
|
+
const entry = {
|
|
29
|
+
...tool,
|
|
30
|
+
revealToken: ++revision
|
|
31
|
+
};
|
|
32
|
+
entries = entries.some(value => value.id === tool.id) ? entries.map(value => value.id === tool.id ? entry : value) : [...entries, entry];
|
|
33
|
+
notify();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Removes the UI only. Tool actions such as Stop belong to the tool's own controller. */
|
|
37
|
+
function dismissFloatingTool(id) {
|
|
38
|
+
if (!entries.some(entry => entry.id === id)) return;
|
|
39
|
+
entries = entries.filter(entry => entry.id !== id);
|
|
40
|
+
notify();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Register at app startup to restore an open tool using its existing position storage. */
|
|
44
|
+
function registerPersistentFloatingTool(tool, storage) {
|
|
45
|
+
if (!tool.id.trim()) throw new Error("Floating tools need a non-empty id");
|
|
46
|
+
const key = `@buoy/floating-tool/${tool.id}/open`;
|
|
47
|
+
let disposed = false;
|
|
48
|
+
let changed = false;
|
|
49
|
+
let wasOpen = entries.some(entry => entry.id === tool.id);
|
|
50
|
+
let writes = Promise.resolve();
|
|
51
|
+
const unsubscribe = subscribeFloatingTools(() => {
|
|
52
|
+
const isOpen = entries.some(entry => entry.id === tool.id);
|
|
53
|
+
if (isOpen === wasOpen) return;
|
|
54
|
+
wasOpen = isOpen;
|
|
55
|
+
changed = true;
|
|
56
|
+
writes = writes.then(() => storage.setItem(key, isOpen ? "1" : "0")).then(() => {}, () => {});
|
|
57
|
+
});
|
|
58
|
+
void storage.getItem(key).then(saved => {
|
|
59
|
+
if (disposed || changed || wasOpen || saved !== "1") return;
|
|
60
|
+
// Zero restores the saved hidden state; explicit opens still reveal the tool.
|
|
61
|
+
entries = [...entries, {
|
|
62
|
+
...tool,
|
|
63
|
+
revealToken: 0
|
|
64
|
+
}];
|
|
65
|
+
notify();
|
|
66
|
+
}).catch(() => {});
|
|
67
|
+
return () => {
|
|
68
|
+
disposed = true;
|
|
69
|
+
unsubscribe();
|
|
70
|
+
};
|
|
71
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _vitest = require("vitest");
|
|
4
|
+
var _floatingToolStore = require("./floatingToolStore.js");
|
|
5
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
6
|
+
(0, _vitest.afterEach)(() => (0, _floatingToolStore.getFloatingTools)().forEach(tool => (0, _floatingToolStore.dismissFloatingTool)(tool.id)));
|
|
7
|
+
(0, _vitest.describe)("floating tool registry", () => {
|
|
8
|
+
(0, _vitest.it)("restores an existing id and keeps other tools intact", () => {
|
|
9
|
+
(0, _floatingToolStore.openFloatingTool)({
|
|
10
|
+
id: "network",
|
|
11
|
+
render: () => null
|
|
12
|
+
});
|
|
13
|
+
(0, _floatingToolStore.openFloatingTool)({
|
|
14
|
+
id: "recorder",
|
|
15
|
+
render: () => null
|
|
16
|
+
});
|
|
17
|
+
const first = (0, _floatingToolStore.getFloatingTools)()[0].revealToken;
|
|
18
|
+
const other = (0, _floatingToolStore.getFloatingTools)()[1];
|
|
19
|
+
(0, _floatingToolStore.openFloatingTool)({
|
|
20
|
+
id: "network",
|
|
21
|
+
render: () => "updated"
|
|
22
|
+
});
|
|
23
|
+
(0, _vitest.expect)((0, _floatingToolStore.getFloatingTools)()).toHaveLength(2);
|
|
24
|
+
(0, _vitest.expect)((0, _floatingToolStore.getFloatingTools)()[0].revealToken).toBeGreaterThan(first);
|
|
25
|
+
(0, _vitest.expect)((0, _floatingToolStore.getFloatingTools)()[1]).toBe(other);
|
|
26
|
+
});
|
|
27
|
+
(0, _vitest.it)("publishes stable snapshots and isolates dismissal", () => {
|
|
28
|
+
const listener = _vitest.vi.fn();
|
|
29
|
+
const unsubscribe = (0, _floatingToolStore.subscribeFloatingTools)(listener);
|
|
30
|
+
(0, _floatingToolStore.openFloatingTool)({
|
|
31
|
+
id: "one",
|
|
32
|
+
render: () => null
|
|
33
|
+
});
|
|
34
|
+
const snapshot = (0, _floatingToolStore.getFloatingTools)();
|
|
35
|
+
(0, _vitest.expect)((0, _floatingToolStore.getFloatingTools)()).toBe(snapshot);
|
|
36
|
+
(0, _floatingToolStore.dismissFloatingTool)("missing");
|
|
37
|
+
(0, _vitest.expect)(listener).toHaveBeenCalledTimes(1);
|
|
38
|
+
(0, _floatingToolStore.openFloatingTool)({
|
|
39
|
+
id: "two",
|
|
40
|
+
render: () => null
|
|
41
|
+
});
|
|
42
|
+
(0, _floatingToolStore.dismissFloatingTool)("one");
|
|
43
|
+
(0, _vitest.expect)((0, _floatingToolStore.getFloatingTools)().map(tool => tool.id)).toEqual(["two"]);
|
|
44
|
+
unsubscribe();
|
|
45
|
+
(0, _floatingToolStore.dismissFloatingTool)("two");
|
|
46
|
+
(0, _vitest.expect)(listener).toHaveBeenCalledTimes(3);
|
|
47
|
+
});
|
|
48
|
+
(0, _vitest.it)("rejects missing tool identities", () => {
|
|
49
|
+
(0, _vitest.expect)(() => (0, _floatingToolStore.openFloatingTool)({
|
|
50
|
+
id: " ",
|
|
51
|
+
render: () => null
|
|
52
|
+
})).toThrow("non-empty id");
|
|
53
|
+
(0, _vitest.expect)((0, _floatingToolStore.getFloatingTools)()).toHaveLength(0);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
(0, _vitest.describe)("persistent floating tools", () => {
|
|
57
|
+
(0, _vitest.it)("restores after a fresh registry loads and remembers dismissal", async () => {
|
|
58
|
+
const values = new Map();
|
|
59
|
+
const storage = {
|
|
60
|
+
getItem: _vitest.vi.fn(async key => values.get(key) ?? null),
|
|
61
|
+
setItem: _vitest.vi.fn(async (key, value) => {
|
|
62
|
+
values.set(key, value);
|
|
63
|
+
})
|
|
64
|
+
};
|
|
65
|
+
const tool = {
|
|
66
|
+
id: "persisted",
|
|
67
|
+
render: () => null
|
|
68
|
+
};
|
|
69
|
+
_vitest.vi.resetModules();
|
|
70
|
+
const first = await Promise.resolve().then(() => _interopRequireWildcard(require("./floatingToolStore")));
|
|
71
|
+
const disposeFirst = first.registerPersistentFloatingTool(tool, storage);
|
|
72
|
+
first.openFloatingTool(tool);
|
|
73
|
+
await _vitest.vi.waitFor(() => (0, _vitest.expect)(values.get("@buoy/floating-tool/persisted/open")).toBe("1"));
|
|
74
|
+
disposeFirst();
|
|
75
|
+
_vitest.vi.resetModules();
|
|
76
|
+
const second = await Promise.resolve().then(() => _interopRequireWildcard(require("./floatingToolStore")));
|
|
77
|
+
const disposeSecond = second.registerPersistentFloatingTool(tool, storage);
|
|
78
|
+
await _vitest.vi.waitFor(() => (0, _vitest.expect)(second.getFloatingTools()).toHaveLength(1));
|
|
79
|
+
(0, _vitest.expect)(second.getFloatingTools()[0].revealToken).toBe(0);
|
|
80
|
+
second.dismissFloatingTool(tool.id);
|
|
81
|
+
await _vitest.vi.waitFor(() => (0, _vitest.expect)(values.get("@buoy/floating-tool/persisted/open")).toBe("0"));
|
|
82
|
+
disposeSecond();
|
|
83
|
+
_vitest.vi.resetModules();
|
|
84
|
+
const third = await Promise.resolve().then(() => _interopRequireWildcard(require("./floatingToolStore")));
|
|
85
|
+
const disposeThird = third.registerPersistentFloatingTool(tool, storage);
|
|
86
|
+
await Promise.resolve();
|
|
87
|
+
(0, _vitest.expect)(third.getFloatingTools()).toHaveLength(0);
|
|
88
|
+
disposeThird();
|
|
89
|
+
});
|
|
90
|
+
(0, _vitest.it)("does not reopen a tool closed while its saved state was loading", async () => {
|
|
91
|
+
_vitest.vi.resetModules();
|
|
92
|
+
const registry = await Promise.resolve().then(() => _interopRequireWildcard(require("./floatingToolStore")));
|
|
93
|
+
let resolve;
|
|
94
|
+
const storage = {
|
|
95
|
+
getItem: () => new Promise(done => {
|
|
96
|
+
resolve = done;
|
|
97
|
+
}),
|
|
98
|
+
setItem: _vitest.vi.fn(async () => {})
|
|
99
|
+
};
|
|
100
|
+
const tool = {
|
|
101
|
+
id: "race",
|
|
102
|
+
render: () => null
|
|
103
|
+
};
|
|
104
|
+
const dispose = registry.registerPersistentFloatingTool(tool, storage);
|
|
105
|
+
registry.openFloatingTool(tool);
|
|
106
|
+
registry.dismissFloatingTool(tool.id);
|
|
107
|
+
resolve("1");
|
|
108
|
+
await _vitest.vi.waitFor(() => (0, _vitest.expect)(storage.setItem).toHaveBeenLastCalledWith("@buoy/floating-tool/race/open", "0"));
|
|
109
|
+
(0, _vitest.expect)(registry.getFloatingTools()).toHaveLength(0);
|
|
110
|
+
dispose();
|
|
111
|
+
});
|
|
112
|
+
});
|