@buoy-gg/shared-ui 7.0.40 → 7.0.41
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 +6 -0
- package/lib/commonjs/JsModal.js +13 -61
- package/lib/commonjs/JsModal.web.js +32 -95
- package/lib/commonjs/clipboard/autoDetectClipboard.js +1 -1
- package/lib/commonjs/clipboard/clipboard-impl.web.js +21 -0
- package/lib/commonjs/dataViewer/tree/TreeDiffViewer.js +4 -2
- package/lib/commonjs/hooks/index.js +1 -1
- package/lib/commonjs/hooks/safe-area-impl.js +1 -1
- package/lib/commonjs/hooks/usePersistedState.js +1 -1
- package/lib/commonjs/hooks/useSafeAreaInsets.web.js +41 -0
- package/lib/commonjs/icons/index.js +14 -0
- package/lib/commonjs/index.js +34 -0
- package/lib/commonjs/license/AccountSetup.js +4 -25
- package/lib/commonjs/license/AccountSetup.web.js +78 -64
- package/lib/commonjs/license/AccountSetupContent.js +482 -0
- package/lib/commonjs/license/FreeAccountPrompt.js +32 -178
- package/lib/commonjs/license/LicenseEntryModal.js +5 -12
- package/lib/commonjs/license/accountRuntime.js +8 -0
- package/lib/commonjs/license/accountRuntime.web.js +9 -0
- package/lib/commonjs/license/licenseModule.js +2 -0
- package/lib/commonjs/settings/components/BubbleSettingsSection.js +1 -1
- package/lib/commonjs/storage/definePersistedSetting.js +1 -1
- package/lib/commonjs/stores/ignoredPatternsStore.js +10 -199
- package/lib/commonjs/stores/ignoredPatternsStore.shared.js +205 -0
- package/lib/commonjs/stores/ignoredPatternsStore.web.js +10 -230
- package/lib/commonjs/ui/backgrounds/backgroundStore.js +1 -1
- package/lib/commonjs/ui/backgrounds/variants/wormhole.js +3 -0
- package/lib/commonjs/ui/components/CopyButton.js +1 -1
- package/lib/commonjs/ui/components/EventStepperFooter.js +1 -1
- package/lib/commonjs/ui/components/ToolFooter.js +1 -1
- package/lib/commonjs/ui/floating/FloatingTool.web.js +12 -2
- package/lib/commonjs/ui/night/primitives.js +10 -3
- package/lib/commonjs/ui/otto/OttoSprite.js +1 -1
- package/lib/commonjs/utils/browserAsyncStorage.js +157 -0
- package/lib/commonjs/utils/browserNavigation.js +116 -0
- package/lib/commonjs/utils/devServer.js +8 -4
- package/lib/commonjs/utils/devServer.web.js +10 -0
- package/lib/commonjs/utils/domRuntime.js +143 -0
- package/lib/commonjs/utils/expoRouterModule.js +51 -0
- package/lib/commonjs/utils/expoRouterModule.web.js +14 -0
- package/lib/commonjs/utils/getSafeAreaInsets.web.js +35 -0
- package/lib/commonjs/utils/index.js +111 -4
- package/lib/commonjs/utils/loadToolModule.js +46 -0
- package/lib/commonjs/utils/loadToolModule.web.js +12 -0
- package/lib/commonjs/utils/modalStorage.js +42 -0
- package/lib/commonjs/utils/nativeWeb.js +454 -0
- package/lib/commonjs/utils/persistentStorage.web.js +78 -0
- package/lib/commonjs/utils/reloadApp.js +18 -57
- package/lib/commonjs/utils/reloadPlatform.js +37 -0
- package/lib/commonjs/utils/reloadPlatform.web.js +17 -0
- package/lib/commonjs/utils/safeExpoRouter.js +3 -53
- package/lib/commonjs/utils/safeExpoRouter.web.js +48 -0
- package/lib/commonjs/utils/toolModules.js +25 -0
- package/lib/module/JsModal.js +11 -59
- package/lib/module/JsModal.web.js +28 -91
- package/lib/module/clipboard/autoDetectClipboard.js +2 -2
- package/lib/module/clipboard/clipboard-impl.web.js +14 -0
- package/lib/module/dataViewer/tree/TreeDiffViewer.js +4 -2
- package/lib/module/hooks/index.js +2 -2
- package/lib/module/hooks/safe-area-impl.js +1 -1
- package/lib/module/hooks/usePersistedState.js +1 -1
- package/lib/module/hooks/useSafeAreaInsets.web.js +30 -0
- package/lib/module/icons/index.js +2 -1
- package/lib/module/index.js +3 -0
- package/lib/module/license/AccountSetup.js +5 -26
- package/lib/module/license/AccountSetup.web.js +79 -65
- package/lib/module/license/AccountSetupContent.js +476 -0
- package/lib/module/license/FreeAccountPrompt.js +27 -176
- package/lib/module/license/LicenseEntryModal.js +6 -13
- package/lib/module/license/accountRuntime.js +3 -0
- package/lib/module/license/accountRuntime.web.js +4 -0
- package/lib/module/license/licenseModule.js +2 -0
- package/lib/module/settings/components/BubbleSettingsSection.js +1 -1
- package/lib/module/storage/definePersistedSetting.js +1 -1
- package/lib/module/stores/ignoredPatternsStore.js +1 -187
- package/lib/module/stores/ignoredPatternsStore.shared.js +189 -0
- package/lib/module/stores/ignoredPatternsStore.web.js +1 -219
- package/lib/module/ui/backgrounds/backgroundStore.js +1 -1
- package/lib/module/ui/backgrounds/variants/wormhole.js +3 -0
- package/lib/module/ui/components/CopyButton.js +1 -1
- package/lib/module/ui/components/EventStepperFooter.js +1 -1
- package/lib/module/ui/components/ToolFooter.js +1 -1
- package/lib/module/ui/floating/FloatingTool.web.js +12 -2
- package/lib/module/ui/night/primitives.js +11 -4
- package/lib/module/ui/otto/OttoSprite.js +1 -1
- package/lib/module/utils/browserAsyncStorage.js +151 -0
- package/lib/module/utils/browserNavigation.js +108 -0
- package/lib/module/utils/devServer.js +8 -4
- package/lib/module/utils/devServer.web.js +6 -0
- package/lib/module/utils/domRuntime.js +134 -0
- package/lib/module/utils/expoRouterModule.js +46 -0
- package/lib/module/utils/expoRouterModule.web.js +9 -0
- package/lib/module/utils/getSafeAreaInsets.web.js +31 -0
- package/lib/module/utils/index.js +9 -4
- package/lib/module/utils/loadToolModule.js +42 -0
- package/lib/module/utils/loadToolModule.web.js +8 -0
- package/lib/module/utils/modalStorage.js +37 -0
- package/lib/module/utils/nativeWeb.js +107 -0
- package/lib/module/utils/persistentStorage.web.js +72 -0
- package/lib/module/utils/reloadApp.js +13 -51
- package/lib/module/utils/reloadPlatform.js +31 -0
- package/lib/module/utils/reloadPlatform.web.js +11 -0
- package/lib/module/utils/safeExpoRouter.js +3 -53
- package/lib/module/utils/safeExpoRouter.web.js +37 -0
- package/lib/module/utils/toolModules.js +19 -0
- package/lib/typescript/commonjs/JsModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/JsModal.web.d.ts +7 -18
- package/lib/typescript/commonjs/JsModal.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/clipboard/clipboard-impl.web.d.ts +5 -0
- package/lib/typescript/commonjs/clipboard/clipboard-impl.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/dataViewer/tree/TreeDiffViewer.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/commonjs/hooks/useSafeAreaInsets.web.d.ts +6 -0
- package/lib/typescript/commonjs/hooks/useSafeAreaInsets.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/icons/index.d.ts +1 -0
- package/lib/typescript/commonjs/icons/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/AccountSetup.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/AccountSetup.web.d.ts +1 -1
- package/lib/typescript/commonjs/license/AccountSetup.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/AccountSetupContent.d.ts +11 -0
- package/lib/typescript/commonjs/license/AccountSetupContent.d.ts.map +1 -0
- package/lib/typescript/commonjs/license/FreeAccountPrompt.d.ts +3 -15
- package/lib/typescript/commonjs/license/FreeAccountPrompt.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/LicenseEntryModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/accountRuntime.d.ts +2 -0
- package/lib/typescript/commonjs/license/accountRuntime.d.ts.map +1 -0
- package/lib/typescript/commonjs/license/accountRuntime.web.d.ts +2 -0
- package/lib/typescript/commonjs/license/accountRuntime.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/license/licenseModule.d.ts +3 -1
- package/lib/typescript/commonjs/license/licenseModule.d.ts.map +1 -1
- package/lib/typescript/commonjs/stores/ignoredPatternsStore.d.ts +1 -59
- package/lib/typescript/commonjs/stores/ignoredPatternsStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/stores/ignoredPatternsStore.shared.d.ts +60 -0
- package/lib/typescript/commonjs/stores/ignoredPatternsStore.shared.d.ts.map +1 -0
- package/lib/typescript/commonjs/stores/ignoredPatternsStore.web.d.ts +1 -71
- package/lib/typescript/commonjs/stores/ignoredPatternsStore.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/floating/FloatingTool.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/night/primitives.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/otto/ottoEngine.d.ts +1 -1
- package/lib/typescript/commonjs/utils/browserAsyncStorage.d.ts +25 -0
- package/lib/typescript/commonjs/utils/browserAsyncStorage.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/browserNavigation.d.ts +31 -0
- package/lib/typescript/commonjs/utils/browserNavigation.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/devServer.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/devServer.web.d.ts +2 -0
- package/lib/typescript/commonjs/utils/devServer.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/domRuntime.d.ts +27 -0
- package/lib/typescript/commonjs/utils/domRuntime.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/expoRouterModule.d.ts +3 -0
- package/lib/typescript/commonjs/utils/expoRouterModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/expoRouterModule.web.d.ts +3 -0
- package/lib/typescript/commonjs/utils/expoRouterModule.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/getSafeAreaInsets.web.d.ts +8 -0
- package/lib/typescript/commonjs/utils/getSafeAreaInsets.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/index.d.ts +5 -0
- package/lib/typescript/commonjs/utils/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/loadToolModule.d.ts +3 -0
- package/lib/typescript/commonjs/utils/loadToolModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/loadToolModule.web.d.ts +2 -0
- package/lib/typescript/commonjs/utils/loadToolModule.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/modalStorage.d.ts +21 -0
- package/lib/typescript/commonjs/utils/modalStorage.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/nativeWeb.d.ts +22 -0
- package/lib/typescript/commonjs/utils/nativeWeb.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/persistentStorage.web.d.ts +6 -0
- package/lib/typescript/commonjs/utils/persistentStorage.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/reloadApp.d.ts +7 -25
- package/lib/typescript/commonjs/utils/reloadApp.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/reloadPlatform.d.ts +8 -0
- package/lib/typescript/commonjs/utils/reloadPlatform.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/reloadPlatform.web.d.ts +4 -0
- package/lib/typescript/commonjs/utils/reloadPlatform.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/safeExpoRouter.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/safeExpoRouter.web.d.ts +43 -0
- package/lib/typescript/commonjs/utils/safeExpoRouter.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/toolModules.d.ts +5 -0
- package/lib/typescript/commonjs/utils/toolModules.d.ts.map +1 -0
- package/lib/typescript/module/JsModal.d.ts.map +1 -1
- package/lib/typescript/module/JsModal.web.d.ts +7 -18
- package/lib/typescript/module/JsModal.web.d.ts.map +1 -1
- package/lib/typescript/module/clipboard/clipboard-impl.web.d.ts +5 -0
- package/lib/typescript/module/clipboard/clipboard-impl.web.d.ts.map +1 -0
- package/lib/typescript/module/dataViewer/tree/TreeDiffViewer.d.ts.map +1 -1
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/hooks/useSafeAreaInsets.web.d.ts +6 -0
- package/lib/typescript/module/hooks/useSafeAreaInsets.web.d.ts.map +1 -0
- package/lib/typescript/module/icons/index.d.ts +1 -0
- package/lib/typescript/module/icons/index.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +2 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/license/AccountSetup.d.ts.map +1 -1
- package/lib/typescript/module/license/AccountSetup.web.d.ts +1 -1
- package/lib/typescript/module/license/AccountSetup.web.d.ts.map +1 -1
- package/lib/typescript/module/license/AccountSetupContent.d.ts +11 -0
- package/lib/typescript/module/license/AccountSetupContent.d.ts.map +1 -0
- package/lib/typescript/module/license/FreeAccountPrompt.d.ts +3 -15
- package/lib/typescript/module/license/FreeAccountPrompt.d.ts.map +1 -1
- package/lib/typescript/module/license/LicenseEntryModal.d.ts.map +1 -1
- package/lib/typescript/module/license/accountRuntime.d.ts +2 -0
- package/lib/typescript/module/license/accountRuntime.d.ts.map +1 -0
- package/lib/typescript/module/license/accountRuntime.web.d.ts +2 -0
- package/lib/typescript/module/license/accountRuntime.web.d.ts.map +1 -0
- package/lib/typescript/module/license/licenseModule.d.ts +3 -1
- package/lib/typescript/module/license/licenseModule.d.ts.map +1 -1
- package/lib/typescript/module/stores/ignoredPatternsStore.d.ts +1 -59
- package/lib/typescript/module/stores/ignoredPatternsStore.d.ts.map +1 -1
- package/lib/typescript/module/stores/ignoredPatternsStore.shared.d.ts +60 -0
- package/lib/typescript/module/stores/ignoredPatternsStore.shared.d.ts.map +1 -0
- package/lib/typescript/module/stores/ignoredPatternsStore.web.d.ts +1 -71
- package/lib/typescript/module/stores/ignoredPatternsStore.web.d.ts.map +1 -1
- package/lib/typescript/module/ui/floating/FloatingTool.web.d.ts.map +1 -1
- package/lib/typescript/module/ui/night/primitives.d.ts.map +1 -1
- package/lib/typescript/module/ui/otto/ottoEngine.d.ts +1 -1
- package/lib/typescript/module/utils/browserAsyncStorage.d.ts +25 -0
- package/lib/typescript/module/utils/browserAsyncStorage.d.ts.map +1 -0
- package/lib/typescript/module/utils/browserNavigation.d.ts +31 -0
- package/lib/typescript/module/utils/browserNavigation.d.ts.map +1 -0
- package/lib/typescript/module/utils/devServer.d.ts.map +1 -1
- package/lib/typescript/module/utils/devServer.web.d.ts +2 -0
- package/lib/typescript/module/utils/devServer.web.d.ts.map +1 -0
- package/lib/typescript/module/utils/domRuntime.d.ts +27 -0
- package/lib/typescript/module/utils/domRuntime.d.ts.map +1 -0
- package/lib/typescript/module/utils/expoRouterModule.d.ts +3 -0
- package/lib/typescript/module/utils/expoRouterModule.d.ts.map +1 -0
- package/lib/typescript/module/utils/expoRouterModule.web.d.ts +3 -0
- package/lib/typescript/module/utils/expoRouterModule.web.d.ts.map +1 -0
- package/lib/typescript/module/utils/getSafeAreaInsets.web.d.ts +8 -0
- package/lib/typescript/module/utils/getSafeAreaInsets.web.d.ts.map +1 -0
- package/lib/typescript/module/utils/index.d.ts +5 -0
- package/lib/typescript/module/utils/index.d.ts.map +1 -1
- package/lib/typescript/module/utils/loadToolModule.d.ts +3 -0
- package/lib/typescript/module/utils/loadToolModule.d.ts.map +1 -0
- package/lib/typescript/module/utils/loadToolModule.web.d.ts +2 -0
- package/lib/typescript/module/utils/loadToolModule.web.d.ts.map +1 -0
- package/lib/typescript/module/utils/modalStorage.d.ts +21 -0
- package/lib/typescript/module/utils/modalStorage.d.ts.map +1 -0
- package/lib/typescript/module/utils/nativeWeb.d.ts +22 -0
- package/lib/typescript/module/utils/nativeWeb.d.ts.map +1 -0
- package/lib/typescript/module/utils/persistentStorage.web.d.ts +6 -0
- package/lib/typescript/module/utils/persistentStorage.web.d.ts.map +1 -0
- package/lib/typescript/module/utils/reloadApp.d.ts +7 -25
- package/lib/typescript/module/utils/reloadApp.d.ts.map +1 -1
- package/lib/typescript/module/utils/reloadPlatform.d.ts +8 -0
- package/lib/typescript/module/utils/reloadPlatform.d.ts.map +1 -0
- package/lib/typescript/module/utils/reloadPlatform.web.d.ts +4 -0
- package/lib/typescript/module/utils/reloadPlatform.web.d.ts.map +1 -0
- package/lib/typescript/module/utils/safeExpoRouter.d.ts.map +1 -1
- package/lib/typescript/module/utils/safeExpoRouter.web.d.ts +43 -0
- package/lib/typescript/module/utils/safeExpoRouter.web.d.ts.map +1 -0
- package/lib/typescript/module/utils/toolModules.d.ts +5 -0
- package/lib/typescript/module/utils/toolModules.d.ts.map +1 -0
- package/lib/web/asyncStorage.mjs +2 -0
- package/lib/web/chunks/chunk-2MHKRRQW.mjs +8 -0
- package/lib/web/chunks/chunk-2Q3SDPH2.mjs +14 -0
- package/lib/web/chunks/chunk-34YQ42KI.mjs +2 -0
- package/lib/web/chunks/chunk-3NNNCQYP.mjs +14 -0
- package/lib/web/chunks/chunk-3UTMGIUG.mjs +2 -0
- package/lib/web/chunks/chunk-46CXXOQB.mjs +2 -0
- package/lib/web/chunks/chunk-475BSDCB.mjs +2 -0
- package/lib/web/chunks/chunk-53J2FMUD.mjs +2 -0
- package/lib/web/chunks/chunk-552W4COI.mjs +2 -0
- package/lib/web/chunks/chunk-56TTTMX4.mjs +6145 -0
- package/lib/web/chunks/chunk-5LOQZINQ.mjs +14 -0
- package/lib/web/chunks/chunk-5NOIO6ZM.mjs +16 -0
- package/lib/web/chunks/chunk-5NZOQR6Q.mjs +2 -0
- package/lib/web/chunks/chunk-6CCRCSA2.mjs +2 -0
- package/lib/web/chunks/chunk-6Q52HRBL.mjs +2 -0
- package/lib/web/chunks/chunk-6TEDFSNM.mjs +655 -0
- package/lib/web/chunks/chunk-7BMRSMHN.mjs +2 -0
- package/lib/web/chunks/chunk-A2SOFE47.mjs +24 -0
- package/lib/web/chunks/chunk-A7KJCK4R.mjs +14 -0
- package/lib/web/chunks/chunk-AEXGGXS7.mjs +2 -0
- package/lib/web/chunks/chunk-AGD7ZT6O.mjs +15 -0
- package/lib/web/chunks/chunk-AIEOQWNG.mjs +2 -0
- package/lib/web/chunks/chunk-ASTM35HG.mjs +16 -0
- package/lib/web/chunks/chunk-AZBMFPMX.mjs +1421 -0
- package/lib/web/chunks/chunk-B2V2UDCU.mjs +16 -0
- package/lib/web/chunks/chunk-BFGKGTAC.mjs +2 -0
- package/lib/web/chunks/chunk-BHW6AFO6.mjs +2 -0
- package/lib/web/chunks/chunk-BWRW3NJ2.mjs +16 -0
- package/lib/web/chunks/chunk-CBM2IZAK.mjs +2 -0
- package/lib/web/chunks/chunk-CDLCFF44.mjs +2 -0
- package/lib/web/chunks/chunk-CE5U3CSQ.mjs +2 -0
- package/lib/web/chunks/chunk-CI5CO7FQ.mjs +2 -0
- package/lib/web/chunks/chunk-CIB4U2YK.mjs +2 -0
- package/lib/web/chunks/chunk-CLLTZQGD.mjs +596 -0
- package/lib/web/chunks/chunk-D5HQLRFW.mjs +655 -0
- package/lib/web/chunks/chunk-DZDTNXXK.mjs +2 -0
- package/lib/web/chunks/chunk-FDOZ6YSS.mjs +2 -0
- package/lib/web/chunks/chunk-FMEWNGQO.mjs +2 -0
- package/lib/web/chunks/chunk-G4DH7GMT.mjs +2 -0
- package/lib/web/chunks/chunk-GBUZCZE4.mjs +2 -0
- package/lib/web/chunks/chunk-GF5C5DVX.mjs +2 -0
- package/lib/web/chunks/chunk-GLMS5ZLJ.mjs +445 -0
- package/lib/web/chunks/chunk-GNGMIA7V.mjs +2 -0
- package/lib/web/chunks/chunk-GTYIS7H7.mjs +15 -0
- package/lib/web/chunks/chunk-HJ36IONA.mjs +15 -0
- package/lib/web/chunks/chunk-HXPTZMAZ.mjs +2 -0
- package/lib/web/chunks/chunk-I27M4JCS.mjs +2 -0
- package/lib/web/chunks/chunk-IVCT27JB.mjs +2 -0
- package/lib/web/chunks/chunk-JG4QSK5B.mjs +2 -0
- package/lib/web/chunks/chunk-JR7BJW6B.mjs +389 -0
- package/lib/web/chunks/chunk-K46ZJUXJ.mjs +90 -0
- package/lib/web/chunks/chunk-K4LXMO4D.mjs +2 -0
- package/lib/web/chunks/chunk-K7CGIEFU.mjs +2 -0
- package/lib/web/chunks/chunk-KBTYK5YE.mjs +662 -0
- package/lib/web/chunks/chunk-KHP6CSSM.mjs +2 -0
- package/lib/web/chunks/chunk-KRDRIW7T.mjs +14 -0
- package/lib/web/chunks/chunk-L2DTKDER.mjs +2 -0
- package/lib/web/chunks/chunk-LFDFDGHY.mjs +655 -0
- package/lib/web/chunks/chunk-LZ7FZZ7R.mjs +2 -0
- package/lib/web/chunks/chunk-MAIUUK4E.mjs +2 -0
- package/lib/web/chunks/chunk-MKJKS3IG.mjs +275 -0
- package/lib/web/chunks/chunk-MRQKVLXG.mjs +2 -0
- package/lib/web/chunks/chunk-NK3OISOL.mjs +14 -0
- package/lib/web/chunks/chunk-NLJDDIXW.mjs +2 -0
- package/lib/web/chunks/chunk-OENR3XFI.mjs +11 -0
- package/lib/web/chunks/chunk-OZB3VKZE.mjs +2 -0
- package/lib/web/chunks/chunk-P64PFJT3.mjs +17618 -0
- package/lib/web/chunks/chunk-PACPGYH7.mjs +2 -0
- package/lib/web/chunks/chunk-PART6HOE.mjs +14 -0
- package/lib/web/chunks/chunk-PMRXUQRH.mjs +2 -0
- package/lib/web/chunks/chunk-PTK5FO6C.mjs +2 -0
- package/lib/web/chunks/chunk-PZ45TQ55.mjs +14 -0
- package/lib/web/chunks/chunk-Q5LN7GET.mjs +17624 -0
- package/lib/web/chunks/chunk-QCD6T6L4.mjs +297 -0
- package/lib/web/chunks/chunk-QD5EUANU.mjs +2 -0
- package/lib/web/chunks/chunk-QJTECJCO.mjs +2 -0
- package/lib/web/chunks/chunk-QPIZURPZ.mjs +2 -0
- package/lib/web/chunks/chunk-QPY45R5F.mjs +274 -0
- package/lib/web/chunks/chunk-R2SGZIG5.mjs +2 -0
- package/lib/web/chunks/chunk-S3GYQYVJ.mjs +16 -0
- package/lib/web/chunks/chunk-SCCXVTDM.mjs +2 -0
- package/lib/web/chunks/chunk-SHJHD646.mjs +2 -0
- package/lib/web/chunks/chunk-TCRVZ55E.mjs +2 -0
- package/lib/web/chunks/chunk-TJ6ZVV2L.mjs +15 -0
- package/lib/web/chunks/chunk-TPSY4RC3.mjs +14 -0
- package/lib/web/chunks/chunk-U5KNX5O6.mjs +17624 -0
- package/lib/web/chunks/chunk-UCKELQSM.mjs +2 -0
- package/lib/web/chunks/chunk-UGGCYHRH.mjs +15 -0
- package/lib/web/chunks/chunk-UNYQJZET.mjs +16 -0
- package/lib/web/chunks/chunk-VE72SWLV.mjs +15 -0
- package/lib/web/chunks/chunk-VKONO6MI.mjs +2 -0
- package/lib/web/chunks/chunk-W4BGMPJO.mjs +2 -0
- package/lib/web/chunks/chunk-WHNEEKLR.mjs +2 -0
- package/lib/web/chunks/chunk-WLGUP3KY.mjs +16 -0
- package/lib/web/chunks/chunk-WY7D4WBZ.mjs +2 -0
- package/lib/web/chunks/chunk-XRNB2MHO.mjs +107 -0
- package/lib/web/chunks/chunk-XXTIAXQY.mjs +2 -0
- package/lib/web/chunks/chunk-XYUAUO57.mjs +2 -0
- package/lib/web/chunks/chunk-YG6DIKQD.mjs +2 -0
- package/lib/web/chunks/chunk-YIZFMU66.mjs +2 -0
- package/lib/web/chunks/chunk-YOGAPOGC.mjs +2 -0
- package/lib/web/chunks/chunk-Z7373DS5.mjs +2 -0
- package/lib/web/chunks/chunk-Z76GRN66.mjs +17627 -0
- package/lib/web/chunks/persistentStorage.web-4FBAOYJ4.mjs +12 -0
- package/lib/web/chunks/persistentStorage.web-7W3Y6Q24.mjs +12 -0
- package/lib/web/chunks/persistentStorage.web-GOWNFMVT.mjs +2 -0
- package/lib/web/chunks/persistentStorage.web-RF47FXIK.mjs +12 -0
- package/lib/web/colors.mjs +2 -0
- package/lib/web/dataViewer.mjs +3 -0
- package/lib/web/floating.mjs +2 -0
- package/lib/web/history.mjs +2 -0
- package/lib/web/hooks.mjs +2 -0
- package/lib/web/index.mjs +15 -0
- package/lib/web/native.mjs +2 -0
- package/lib/web/ui.mjs +2 -0
- package/lib/web/utils.mjs +2 -0
- package/package.json +118 -36
|
@@ -0,0 +1,596 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
night
|
|
4
|
+
} from "./chunk-XRNB2MHO.mjs";
|
|
5
|
+
|
|
6
|
+
// src/ui/floating/onboardingConstants.web.ts
|
|
7
|
+
var ARROW_BOTTOM_OFFSET = -40;
|
|
8
|
+
var ARROW_HEIGHT = 20;
|
|
9
|
+
var SPACING_GAP = 10;
|
|
10
|
+
function getScreenCenterY() {
|
|
11
|
+
return window.innerHeight / 2;
|
|
12
|
+
}
|
|
13
|
+
function calculateTooltipPosition() {
|
|
14
|
+
const estimatedHalfHeight = 130;
|
|
15
|
+
return getScreenCenterY() - estimatedHalfHeight;
|
|
16
|
+
}
|
|
17
|
+
function calculateTargetPosition() {
|
|
18
|
+
const tooltipBottom = calculateTooltipPosition();
|
|
19
|
+
const arrowTipFromBottom = tooltipBottom + ARROW_BOTTOM_OFFSET;
|
|
20
|
+
const actualArrowTip = arrowTipFromBottom - ARROW_HEIGHT;
|
|
21
|
+
return actualArrowTip - SPACING_GAP;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// src/ui/floating/FloatingTool.web.tsx
|
|
25
|
+
import {
|
|
26
|
+
useState,
|
|
27
|
+
useRef,
|
|
28
|
+
useCallback,
|
|
29
|
+
useEffect,
|
|
30
|
+
useMemo,
|
|
31
|
+
Children
|
|
32
|
+
} from "react";
|
|
33
|
+
import {
|
|
34
|
+
useFloatingTools,
|
|
35
|
+
FloatingToolsProvider,
|
|
36
|
+
useFloatingToolsContext,
|
|
37
|
+
interleaveWithDividers,
|
|
38
|
+
floatingToolsColors,
|
|
39
|
+
withAlpha,
|
|
40
|
+
getUserStatusConfig,
|
|
41
|
+
getGripIconLayout,
|
|
42
|
+
interpolatePosition,
|
|
43
|
+
easing,
|
|
44
|
+
VISIBLE_HANDLE_WIDTH,
|
|
45
|
+
ANIMATION_DURATION
|
|
46
|
+
} from "@buoy-gg/floating-tools-react/web/floating";
|
|
47
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
48
|
+
var webStorageAdapter = {
|
|
49
|
+
getItem: (key) => localStorage.getItem(key),
|
|
50
|
+
setItem: (key, value) => localStorage.setItem(key, value)
|
|
51
|
+
};
|
|
52
|
+
var NATIVE_TEXT_SECONDARY = "#A0A0A0";
|
|
53
|
+
function GripVerticalIcon({
|
|
54
|
+
size = 24,
|
|
55
|
+
// native shared-ui GripVerticalIcon.tsx: buoyColors.textSecondary + "CC"
|
|
56
|
+
color = withAlpha(NATIVE_TEXT_SECONDARY, "CC")
|
|
57
|
+
}) {
|
|
58
|
+
const layout = getGripIconLayout(size);
|
|
59
|
+
return /* @__PURE__ */ jsx(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
style: {
|
|
63
|
+
width: size,
|
|
64
|
+
height: size,
|
|
65
|
+
display: "flex",
|
|
66
|
+
flexDirection: "row",
|
|
67
|
+
alignItems: "center",
|
|
68
|
+
justifyContent: "center"
|
|
69
|
+
},
|
|
70
|
+
children: [0, 1].map((col) => /* @__PURE__ */ jsx(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
style: {
|
|
74
|
+
display: "flex",
|
|
75
|
+
flexDirection: "column",
|
|
76
|
+
alignItems: "center",
|
|
77
|
+
justifyContent: "center",
|
|
78
|
+
// native GripVerticalIcon.tsx: marginHorizontal columnGap / 2
|
|
79
|
+
marginLeft: layout.columnGap / 2,
|
|
80
|
+
marginRight: layout.columnGap / 2
|
|
81
|
+
},
|
|
82
|
+
children: [0, 1, 2].map((row) => /* @__PURE__ */ jsx(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
style: {
|
|
86
|
+
width: layout.dotSize,
|
|
87
|
+
height: layout.dotSize,
|
|
88
|
+
borderRadius: layout.dotSize / 2,
|
|
89
|
+
backgroundColor: color,
|
|
90
|
+
// native GripVerticalIcon.tsx: marginVertical rowGap / 2
|
|
91
|
+
marginTop: layout.rowGap / 2,
|
|
92
|
+
marginBottom: layout.rowGap / 2
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
row
|
|
96
|
+
))
|
|
97
|
+
},
|
|
98
|
+
col
|
|
99
|
+
))
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
function Divider() {
|
|
104
|
+
return /* @__PURE__ */ jsx(
|
|
105
|
+
"div",
|
|
106
|
+
{
|
|
107
|
+
style: {
|
|
108
|
+
width: 1,
|
|
109
|
+
height: 12,
|
|
110
|
+
backgroundColor: withAlpha(floatingToolsColors.muted, "66"),
|
|
111
|
+
flexShrink: 0
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
var userStatusColors = {
|
|
117
|
+
success: floatingToolsColors.success,
|
|
118
|
+
optional: floatingToolsColors.optional,
|
|
119
|
+
muted: floatingToolsColors.muted,
|
|
120
|
+
// native floatingTools.tsx: gameUIColorsCompat.secondary = buoyColors.textSecondary
|
|
121
|
+
secondary: NATIVE_TEXT_SECONDARY
|
|
122
|
+
};
|
|
123
|
+
function UserStatus({
|
|
124
|
+
userRole,
|
|
125
|
+
onPress
|
|
126
|
+
}) {
|
|
127
|
+
const { isDragging } = useFloatingToolsContext();
|
|
128
|
+
const config = getUserStatusConfig(userRole, userStatusColors);
|
|
129
|
+
const handleClick = (e) => {
|
|
130
|
+
if (!isDragging && onPress) {
|
|
131
|
+
e.stopPropagation();
|
|
132
|
+
onPress();
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
return /* @__PURE__ */ jsxs(
|
|
136
|
+
"button",
|
|
137
|
+
{
|
|
138
|
+
role: "button",
|
|
139
|
+
"aria-label": `User status: ${config.label}`,
|
|
140
|
+
onClick: handleClick,
|
|
141
|
+
style: {
|
|
142
|
+
display: "flex",
|
|
143
|
+
flexDirection: "row",
|
|
144
|
+
alignItems: "center",
|
|
145
|
+
paddingTop: 6,
|
|
146
|
+
paddingBottom: 6,
|
|
147
|
+
paddingLeft: 8,
|
|
148
|
+
paddingRight: 8,
|
|
149
|
+
flexShrink: 0,
|
|
150
|
+
cursor: onPress && !isDragging ? "pointer" : "default",
|
|
151
|
+
background: "none",
|
|
152
|
+
border: "none",
|
|
153
|
+
margin: 0
|
|
154
|
+
// neutralize UA button margin (native View/Touchable has none)
|
|
155
|
+
},
|
|
156
|
+
children: [
|
|
157
|
+
/* @__PURE__ */ jsx(
|
|
158
|
+
"div",
|
|
159
|
+
{
|
|
160
|
+
style: {
|
|
161
|
+
width: 6,
|
|
162
|
+
height: 6,
|
|
163
|
+
borderRadius: 3,
|
|
164
|
+
backgroundColor: config.dotColor,
|
|
165
|
+
marginRight: 4
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
),
|
|
169
|
+
/* @__PURE__ */ jsx(
|
|
170
|
+
"span",
|
|
171
|
+
{
|
|
172
|
+
style: {
|
|
173
|
+
fontSize: 10,
|
|
174
|
+
fontWeight: 500,
|
|
175
|
+
color: config.textColor,
|
|
176
|
+
letterSpacing: 0.3,
|
|
177
|
+
// native RN <Text> renders in the platform system font; buttons
|
|
178
|
+
// otherwise use the UA font on web
|
|
179
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',
|
|
180
|
+
lineHeight: "normal"
|
|
181
|
+
},
|
|
182
|
+
children: config.label
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
function useWebAnimation() {
|
|
190
|
+
const animationRef = useRef(null);
|
|
191
|
+
const [position, setPosition] = useState({ x: 0, y: 0 });
|
|
192
|
+
const animateTo = useCallback(
|
|
193
|
+
(from, to, onComplete) => {
|
|
194
|
+
if (animationRef.current) {
|
|
195
|
+
cancelAnimationFrame(animationRef.current);
|
|
196
|
+
}
|
|
197
|
+
const startTime = performance.now();
|
|
198
|
+
const animate = (currentTime) => {
|
|
199
|
+
const elapsed = currentTime - startTime;
|
|
200
|
+
const progress = Math.min(elapsed / ANIMATION_DURATION, 1);
|
|
201
|
+
const newPosition = interpolatePosition(from, to, progress, easing.easeOutCubic);
|
|
202
|
+
setPosition(newPosition);
|
|
203
|
+
if (progress < 1) {
|
|
204
|
+
animationRef.current = requestAnimationFrame(animate);
|
|
205
|
+
} else {
|
|
206
|
+
setPosition(to);
|
|
207
|
+
onComplete?.();
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
animationRef.current = requestAnimationFrame(animate);
|
|
211
|
+
},
|
|
212
|
+
[]
|
|
213
|
+
);
|
|
214
|
+
useEffect(() => {
|
|
215
|
+
return () => {
|
|
216
|
+
if (animationRef.current) {
|
|
217
|
+
cancelAnimationFrame(animationRef.current);
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
}, []);
|
|
221
|
+
return { position, setPosition, animateTo };
|
|
222
|
+
}
|
|
223
|
+
var lastBubbleAnchor = null;
|
|
224
|
+
function getBubbleAnchorPosition() {
|
|
225
|
+
return lastBubbleAnchor;
|
|
226
|
+
}
|
|
227
|
+
function FloatingTool({
|
|
228
|
+
id,
|
|
229
|
+
revealToken,
|
|
230
|
+
variant = "bubble",
|
|
231
|
+
dragFromSurface = false,
|
|
232
|
+
accessibilityLabel = "Drag handle",
|
|
233
|
+
accessory,
|
|
234
|
+
handleAdornment,
|
|
235
|
+
enablePositionPersistence = true,
|
|
236
|
+
children,
|
|
237
|
+
pushToSide = false,
|
|
238
|
+
suspendPointerEvents = false,
|
|
239
|
+
centerOnboarding = false,
|
|
240
|
+
minimizedStack,
|
|
241
|
+
hasMinimizedStack = false
|
|
242
|
+
}) {
|
|
243
|
+
const bubbleRef = useRef(null);
|
|
244
|
+
const storage = useMemo(() => id ? {
|
|
245
|
+
getItem: (key) => webStorageAdapter.getItem(`@buoy/floating-tool/${id}/${key}`),
|
|
246
|
+
setItem: (key, value) => webStorageAdapter.setItem(`@buoy/floating-tool/${id}/${key}`, value)
|
|
247
|
+
} : webStorageAdapter, [id]);
|
|
248
|
+
const { state, actions, isInitialized } = useFloatingTools({
|
|
249
|
+
screenSize: { width: window.innerWidth, height: window.innerHeight },
|
|
250
|
+
enablePositionPersistence,
|
|
251
|
+
storage
|
|
252
|
+
});
|
|
253
|
+
const { position: animatedPosition, setPosition: setAnimatedPosition, animateTo } = useWebAnimation();
|
|
254
|
+
useEffect(() => {
|
|
255
|
+
if (isInitialized) {
|
|
256
|
+
setAnimatedPosition(state.position);
|
|
257
|
+
}
|
|
258
|
+
}, [isInitialized, state.position, setAnimatedPosition]);
|
|
259
|
+
useEffect(() => {
|
|
260
|
+
if (!id) lastBubbleAnchor = { x: animatedPosition.x, y: animatedPosition.y };
|
|
261
|
+
}, [animatedPosition, id]);
|
|
262
|
+
useEffect(() => {
|
|
263
|
+
if (!isInitialized) return;
|
|
264
|
+
const measure = () => {
|
|
265
|
+
const rect = bubbleRef.current?.getBoundingClientRect();
|
|
266
|
+
if (rect && rect.width > 0 && rect.height > 0) actions.setBubbleSize({ width: rect.width, height: rect.height });
|
|
267
|
+
};
|
|
268
|
+
const handleResize = () => {
|
|
269
|
+
actions.setScreenSize(window.innerWidth, window.innerHeight);
|
|
270
|
+
measure();
|
|
271
|
+
};
|
|
272
|
+
measure();
|
|
273
|
+
const observer = typeof ResizeObserver !== "undefined" ? new ResizeObserver(measure) : null;
|
|
274
|
+
if (bubbleRef.current) observer?.observe(bubbleRef.current);
|
|
275
|
+
window.addEventListener("resize", handleResize);
|
|
276
|
+
return () => {
|
|
277
|
+
observer?.disconnect();
|
|
278
|
+
window.removeEventListener("resize", handleResize);
|
|
279
|
+
};
|
|
280
|
+
}, [actions, isInitialized]);
|
|
281
|
+
useEffect(() => {
|
|
282
|
+
const probe = document.createElement("div");
|
|
283
|
+
probe.style.cssText = "position:fixed;top:env(safe-area-inset-top);left:env(safe-area-inset-left);visibility:hidden;pointer-events:none";
|
|
284
|
+
document.body.appendChild(probe);
|
|
285
|
+
const rect = probe.getBoundingClientRect();
|
|
286
|
+
document.body.removeChild(probe);
|
|
287
|
+
if (rect.top > 0 || rect.left > 0) {
|
|
288
|
+
actions.setMinPosition({
|
|
289
|
+
x: Math.max(rect.left, 10),
|
|
290
|
+
y: Math.max(rect.top, 10)
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
}, [actions]);
|
|
294
|
+
const [isPointerDown, setIsPointerDown] = useState(false);
|
|
295
|
+
const handlePointerDown = useCallback(
|
|
296
|
+
(e) => {
|
|
297
|
+
e.stopPropagation();
|
|
298
|
+
e.preventDefault();
|
|
299
|
+
setIsPointerDown(true);
|
|
300
|
+
actions.handleDragStart({ clientX: e.clientX, clientY: e.clientY });
|
|
301
|
+
},
|
|
302
|
+
[actions]
|
|
303
|
+
);
|
|
304
|
+
const surfaceGesture = useRef(false);
|
|
305
|
+
const handleSurfacePointerDown = (event) => {
|
|
306
|
+
if (event.button !== 0 || !(event.target instanceof Element)) return;
|
|
307
|
+
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;
|
|
308
|
+
surfaceGesture.current = true;
|
|
309
|
+
handlePointerDown(event);
|
|
310
|
+
};
|
|
311
|
+
const handlePointerMove = useCallback(
|
|
312
|
+
(e) => {
|
|
313
|
+
const result = actions.handleDragMove({ clientX: e.clientX, clientY: e.clientY });
|
|
314
|
+
if (result.isDragging) {
|
|
315
|
+
setAnimatedPosition(result.position);
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
[actions, setAnimatedPosition]
|
|
319
|
+
);
|
|
320
|
+
const handlePointerUp = useCallback(
|
|
321
|
+
(e) => {
|
|
322
|
+
setIsPointerDown(false);
|
|
323
|
+
const result = actions.handleDragEnd({ clientX: e.clientX, clientY: e.clientY });
|
|
324
|
+
const fromSurface = surfaceGesture.current;
|
|
325
|
+
surfaceGesture.current = false;
|
|
326
|
+
if (result.wasTap && !fromSurface) {
|
|
327
|
+
const toggleResult = actions.toggleHideShow();
|
|
328
|
+
animateTo(state.position, toggleResult.targetPosition, () => {
|
|
329
|
+
actions.commitPosition(toggleResult.targetPosition);
|
|
330
|
+
});
|
|
331
|
+
} else if (result.shouldHide) {
|
|
332
|
+
animateTo(state.position, result.position, () => {
|
|
333
|
+
actions.commitPosition(result.position);
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
[actions, animateTo, state.position]
|
|
338
|
+
);
|
|
339
|
+
useEffect(() => {
|
|
340
|
+
if (isPointerDown) {
|
|
341
|
+
window.addEventListener("pointermove", handlePointerMove);
|
|
342
|
+
window.addEventListener("pointerup", handlePointerUp);
|
|
343
|
+
window.addEventListener("pointercancel", handlePointerUp);
|
|
344
|
+
return () => {
|
|
345
|
+
window.removeEventListener("pointermove", handlePointerMove);
|
|
346
|
+
window.removeEventListener("pointerup", handlePointerUp);
|
|
347
|
+
window.removeEventListener("pointercancel", handlePointerUp);
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
}, [isPointerDown, handlePointerMove, handlePointerUp]);
|
|
351
|
+
const statePositionRef = useRef(state.position);
|
|
352
|
+
statePositionRef.current = state.position;
|
|
353
|
+
const isHiddenRef = useRef(state.isHidden);
|
|
354
|
+
isHiddenRef.current = state.isHidden;
|
|
355
|
+
const pushedRef = useRef(false);
|
|
356
|
+
useEffect(() => {
|
|
357
|
+
if (!isInitialized) return;
|
|
358
|
+
if (pushToSide && !pushedRef.current) {
|
|
359
|
+
if (isHiddenRef.current) return;
|
|
360
|
+
pushedRef.current = true;
|
|
361
|
+
const { targetPosition } = actions.forceHide();
|
|
362
|
+
animateTo(statePositionRef.current, targetPosition, () => {
|
|
363
|
+
});
|
|
364
|
+
} else if (!pushToSide && pushedRef.current) {
|
|
365
|
+
pushedRef.current = false;
|
|
366
|
+
if (!isHiddenRef.current) return;
|
|
367
|
+
const { targetPosition } = actions.forceShow();
|
|
368
|
+
const width = bubbleRef.current?.getBoundingClientRect().width ?? 100;
|
|
369
|
+
const clamped = {
|
|
370
|
+
x: Math.max(10, Math.min(targetPosition.x, window.innerWidth - width - 10)),
|
|
371
|
+
y: targetPosition.y
|
|
372
|
+
};
|
|
373
|
+
animateTo(statePositionRef.current, clamped, () => {
|
|
374
|
+
actions.commitPosition(clamped);
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
}, [pushToSide, isInitialized]);
|
|
378
|
+
useEffect(() => {
|
|
379
|
+
if (!centerOnboarding || !isInitialized) return;
|
|
380
|
+
const bubbleWidth = bubbleRef.current?.getBoundingClientRect().width ?? 100;
|
|
381
|
+
const bubbleHeight = bubbleRef.current?.getBoundingClientRect().height ?? 32;
|
|
382
|
+
const fromBottom = calculateTargetPosition();
|
|
383
|
+
const target = {
|
|
384
|
+
x: (window.innerWidth - bubbleWidth) / 2,
|
|
385
|
+
y: window.innerHeight - fromBottom - bubbleHeight
|
|
386
|
+
};
|
|
387
|
+
animateTo(statePositionRef.current, target, () => {
|
|
388
|
+
});
|
|
389
|
+
}, [centerOnboarding, isInitialized]);
|
|
390
|
+
const previousReveal = useRef(void 0);
|
|
391
|
+
useEffect(() => {
|
|
392
|
+
if (!isInitialized || previousReveal.current === revealToken) return;
|
|
393
|
+
previousReveal.current = revealToken;
|
|
394
|
+
if (revealToken !== void 0 && revealToken > 0 && state.isHidden) {
|
|
395
|
+
const { targetPosition } = actions.forceShow();
|
|
396
|
+
animateTo(state.position, targetPosition, () => actions.commitPosition(targetPosition));
|
|
397
|
+
}
|
|
398
|
+
}, [revealToken, isInitialized, state.isHidden, state.position, actions, animateTo]);
|
|
399
|
+
const actionsContent = useMemo(
|
|
400
|
+
() => variant === "strip" ? Children.toArray(children) : interleaveWithDividers(Children.toArray(children), (key) => /* @__PURE__ */ jsx(Divider, {}, key)),
|
|
401
|
+
[children, variant]
|
|
402
|
+
);
|
|
403
|
+
if (!isInitialized) {
|
|
404
|
+
return null;
|
|
405
|
+
}
|
|
406
|
+
const spaceAbove = Math.max(0, animatedPosition.y - 8);
|
|
407
|
+
const spaceBelow = Math.max(0, window.innerHeight - animatedPosition.y - state.bubbleSize.height - 8);
|
|
408
|
+
const accessoryAbove = spaceAbove > spaceBelow;
|
|
409
|
+
return /* @__PURE__ */ jsxs(
|
|
410
|
+
"div",
|
|
411
|
+
{
|
|
412
|
+
ref: bubbleRef,
|
|
413
|
+
"data-testid": id ?? "buoy-floating-tool",
|
|
414
|
+
role: "toolbar",
|
|
415
|
+
"aria-label": "Floating Tools",
|
|
416
|
+
onPointerDown: dragFromSurface ? handleSurfacePointerDown : void 0,
|
|
417
|
+
style: {
|
|
418
|
+
position: "fixed",
|
|
419
|
+
left: animatedPosition.x,
|
|
420
|
+
top: animatedPosition.y,
|
|
421
|
+
zIndex: 9999,
|
|
422
|
+
display: "flex",
|
|
423
|
+
flexDirection: "row",
|
|
424
|
+
alignItems: "center",
|
|
425
|
+
backgroundColor: floatingToolsColors.panel,
|
|
426
|
+
// native: top-left corner + top border flatten when the minimized
|
|
427
|
+
// stack is fused above (floatingTools.tsx containerStyle)
|
|
428
|
+
borderTopLeftRadius: hasMinimizedStack ? 0 : 6,
|
|
429
|
+
borderTopRightRadius: 6,
|
|
430
|
+
borderBottomLeftRadius: 6,
|
|
431
|
+
borderBottomRightRadius: 6,
|
|
432
|
+
borderWidth: state.isDragging ? 2 : 1,
|
|
433
|
+
borderTopWidth: state.isDragging ? 2 : hasMinimizedStack ? 0 : 1,
|
|
434
|
+
borderStyle: "solid",
|
|
435
|
+
borderColor: state.isDragging ? floatingToolsColors.dragActive : withAlpha(floatingToolsColors.muted, "66"),
|
|
436
|
+
// native floatingTools.tsx: shadowOffset {0, 6|4}, shadowRadius 12|8,
|
|
437
|
+
// shadowOpacity 0.6|0.3, shadowColor dragActive+"99"|"#000".
|
|
438
|
+
// Dragging color = 0x99 (0.6) alpha x 0.6 shadowOpacity = ~0.36 effective.
|
|
439
|
+
boxShadow: state.isDragging ? `0 6px 12px ${withAlpha(floatingToolsColors.dragActive, 0.36)}` : "0 4px 8px rgba(0, 0, 0, 0.3)",
|
|
440
|
+
cursor: dragFromSurface ? state.isDragging ? "grabbing" : "grab" : void 0,
|
|
441
|
+
userSelect: "none",
|
|
442
|
+
touchAction: "none",
|
|
443
|
+
pointerEvents: suspendPointerEvents ? "none" : "auto",
|
|
444
|
+
...variant === "strip" ? { borderRadius: night.radius.card, minHeight: 48, backgroundColor: night.color.surface, borderColor: state.isDragging ? night.color.accentBorderStrong : night.color.separator, boxShadow: "0 4px 16px rgba(0, 0, 0, 0.24)" } : {}
|
|
445
|
+
},
|
|
446
|
+
children: [
|
|
447
|
+
minimizedStack && /* @__PURE__ */ jsx(
|
|
448
|
+
"div",
|
|
449
|
+
{
|
|
450
|
+
style: {
|
|
451
|
+
position: "absolute",
|
|
452
|
+
bottom: "100%",
|
|
453
|
+
left: -1,
|
|
454
|
+
// align with the bubble border edge
|
|
455
|
+
width: VISIBLE_HANDLE_WIDTH,
|
|
456
|
+
overflow: "visible",
|
|
457
|
+
zIndex: 1001
|
|
458
|
+
},
|
|
459
|
+
children: minimizedStack
|
|
460
|
+
}
|
|
461
|
+
),
|
|
462
|
+
/* @__PURE__ */ jsxs(
|
|
463
|
+
"div",
|
|
464
|
+
{
|
|
465
|
+
role: "button",
|
|
466
|
+
"aria-label": accessibilityLabel,
|
|
467
|
+
"data-testid": id ? `${id}-grip` : "buoy-floating-grip",
|
|
468
|
+
tabIndex: 0,
|
|
469
|
+
onPointerDown: handlePointerDown,
|
|
470
|
+
onKeyDown: (event) => {
|
|
471
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
472
|
+
event.preventDefault();
|
|
473
|
+
const result = actions.toggleHideShow();
|
|
474
|
+
animateTo(state.position, result.targetPosition, () => actions.commitPosition(result.targetPosition));
|
|
475
|
+
},
|
|
476
|
+
style: {
|
|
477
|
+
touchAction: "none",
|
|
478
|
+
paddingLeft: 6,
|
|
479
|
+
paddingRight: 6,
|
|
480
|
+
paddingTop: 6,
|
|
481
|
+
paddingBottom: 6,
|
|
482
|
+
backgroundColor: withAlpha(floatingToolsColors.muted, "1A"),
|
|
483
|
+
display: "flex",
|
|
484
|
+
alignItems: "center",
|
|
485
|
+
justifyContent: "center",
|
|
486
|
+
width: VISIBLE_HANDLE_WIDTH,
|
|
487
|
+
boxSizing: "border-box",
|
|
488
|
+
// RN width includes padding/border
|
|
489
|
+
borderRight: `1px solid ${withAlpha(floatingToolsColors.muted, "66")}`,
|
|
490
|
+
// native dragHandleStyle sets NO corner radius (container overflow is
|
|
491
|
+
// visible); the 10%-alpha bg square corner matches native rendering
|
|
492
|
+
cursor: state.isDragging ? "grabbing" : "grab",
|
|
493
|
+
...variant === "strip" ? { minHeight: 48, backgroundColor: "transparent", borderRight: "none", flexDirection: "column" } : {}
|
|
494
|
+
},
|
|
495
|
+
children: [
|
|
496
|
+
/* @__PURE__ */ jsx(GripVerticalIcon, { size: variant === "strip" ? 20 : 12 }),
|
|
497
|
+
handleAdornment
|
|
498
|
+
]
|
|
499
|
+
}
|
|
500
|
+
),
|
|
501
|
+
/* @__PURE__ */ jsx(FloatingToolsProvider, { value: { isDragging: state.isDragging, isHidden: state.isHidden }, children: /* @__PURE__ */ jsx(
|
|
502
|
+
"div",
|
|
503
|
+
{
|
|
504
|
+
style: {
|
|
505
|
+
display: "flex",
|
|
506
|
+
flexDirection: "row",
|
|
507
|
+
alignItems: "center",
|
|
508
|
+
gap: 6,
|
|
509
|
+
paddingRight: 8
|
|
510
|
+
},
|
|
511
|
+
children: actionsContent
|
|
512
|
+
}
|
|
513
|
+
) }),
|
|
514
|
+
!state.isHidden && accessory && /* @__PURE__ */ jsx("div", { "data-floating-accessory": true, style: { position: "absolute", ...accessoryAbove ? { bottom: "100%" } : { top: "100%" }, left: 0, width: "100%", maxHeight: Math.max(spaceAbove, spaceBelow), overflowY: "auto", zIndex: 1002 }, children: accessory })
|
|
515
|
+
]
|
|
516
|
+
}
|
|
517
|
+
);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
// src/stores/floatingToolStore.ts
|
|
521
|
+
var entries = [];
|
|
522
|
+
var revision = 0;
|
|
523
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
524
|
+
var notify = () => listeners.forEach((listener) => listener());
|
|
525
|
+
var getFloatingTools = () => entries;
|
|
526
|
+
var subscribeFloatingTools = (listener) => {
|
|
527
|
+
listeners.add(listener);
|
|
528
|
+
return () => {
|
|
529
|
+
listeners.delete(listener);
|
|
530
|
+
};
|
|
531
|
+
};
|
|
532
|
+
function openFloatingTool(tool) {
|
|
533
|
+
if (!tool.id.trim()) throw new Error("Floating tools need a non-empty id");
|
|
534
|
+
const entry = { ...tool, revealToken: ++revision };
|
|
535
|
+
entries = entries.some((value) => value.id === tool.id) ? entries.map((value) => value.id === tool.id ? entry : value) : [...entries, entry];
|
|
536
|
+
notify();
|
|
537
|
+
}
|
|
538
|
+
function dismissFloatingTool(id) {
|
|
539
|
+
if (!entries.some((entry) => entry.id === id)) return;
|
|
540
|
+
entries = entries.filter((entry) => entry.id !== id);
|
|
541
|
+
notify();
|
|
542
|
+
}
|
|
543
|
+
function registerPersistentFloatingTool(tool, storage) {
|
|
544
|
+
if (!tool.id.trim()) throw new Error("Floating tools need a non-empty id");
|
|
545
|
+
const key = `@buoy/floating-tool/${tool.id}/open`;
|
|
546
|
+
let disposed = false;
|
|
547
|
+
let changed = false;
|
|
548
|
+
let wasOpen = entries.some((entry) => entry.id === tool.id);
|
|
549
|
+
let writes = Promise.resolve();
|
|
550
|
+
const unsubscribe = subscribeFloatingTools(() => {
|
|
551
|
+
const isOpen = entries.some((entry) => entry.id === tool.id);
|
|
552
|
+
if (isOpen === wasOpen) return;
|
|
553
|
+
wasOpen = isOpen;
|
|
554
|
+
changed = true;
|
|
555
|
+
writes = writes.then(() => storage.setItem(key, isOpen ? "1" : "0")).then(() => {
|
|
556
|
+
}, () => {
|
|
557
|
+
});
|
|
558
|
+
});
|
|
559
|
+
void storage.getItem(key).then((saved) => {
|
|
560
|
+
if (disposed || changed || wasOpen || saved !== "1") return;
|
|
561
|
+
entries = [...entries, { ...tool, revealToken: 0 }];
|
|
562
|
+
notify();
|
|
563
|
+
}).catch(() => {
|
|
564
|
+
});
|
|
565
|
+
return () => {
|
|
566
|
+
disposed = true;
|
|
567
|
+
unsubscribe();
|
|
568
|
+
};
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
// src/ui/floating/FloatingToolHost.web.tsx
|
|
572
|
+
import { Fragment, useSyncExternalStore } from "react";
|
|
573
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
574
|
+
function FloatingToolHost() {
|
|
575
|
+
const entries2 = useSyncExternalStore(subscribeFloatingTools, getFloatingTools, getFloatingTools);
|
|
576
|
+
return /* @__PURE__ */ jsx2("div", { style: { position: "fixed", inset: 0, pointerEvents: "none", zIndex: 1e4 }, children: entries2.map((entry) => /* @__PURE__ */ jsx2(Fragment, { children: entry.render({ id: entry.id, revealToken: entry.revealToken, dismiss: () => dismissFloatingTool(entry.id) }) }, entry.id)) });
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
export {
|
|
580
|
+
ARROW_BOTTOM_OFFSET,
|
|
581
|
+
ARROW_HEIGHT,
|
|
582
|
+
SPACING_GAP,
|
|
583
|
+
getScreenCenterY,
|
|
584
|
+
calculateTooltipPosition,
|
|
585
|
+
calculateTargetPosition,
|
|
586
|
+
Divider,
|
|
587
|
+
UserStatus,
|
|
588
|
+
getBubbleAnchorPosition,
|
|
589
|
+
FloatingTool,
|
|
590
|
+
getFloatingTools,
|
|
591
|
+
subscribeFloatingTools,
|
|
592
|
+
openFloatingTool,
|
|
593
|
+
dismissFloatingTool,
|
|
594
|
+
registerPersistentFloatingTool,
|
|
595
|
+
FloatingToolHost
|
|
596
|
+
};
|