@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
|
@@ -1,199 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* Deliberately not the Pro modal. The next step is a free account and takes
|
|
7
|
-
* about thirty seconds, so asking for money here would be asking the wrong
|
|
8
|
-
* question at the wrong moment. Pro is still offered, as a secondary action.
|
|
9
|
-
*
|
|
10
|
-
* The command is shown inline and copyable rather than linked, because
|
|
11
|
-
* someone who cannot open the tools needs the fix in front of them, not a link
|
|
12
|
-
* to a page that has a link to a command.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
16
|
-
import { Modal, StyleSheet, Text, TouchableOpacity } from "react-native";
|
|
17
|
-
import { buoyColors } from "../ui/gameUI/constants/gameUIColors.js";
|
|
18
|
-
import { Check, Copy, X } from "../icons/lucide-icons.js";
|
|
19
|
-
import { copyToClipboard } from "../clipboard/index.js";
|
|
20
|
-
import { openPricing } from "./openPricing.js";
|
|
21
|
-
import { getUseAccountAccess, retryAccountAccess } from "./licenseModule.js";
|
|
22
|
-
import { monoFont } from "../ui/fonts.js";
|
|
23
|
-
/** The one thing a reader has to be able to act on. */
|
|
3
|
+
import { Modal, Pressable, ScrollView, StyleSheet, View } from "react-native";
|
|
4
|
+
import { AccountSetupCard } from "./AccountSetupContent.js";
|
|
24
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
-
export
|
|
26
|
-
|
|
6
|
+
export { LOGIN_COMMAND } from "./AccountSetupContent.js";
|
|
7
|
+
/** Native presentation of the shared account card. */
|
|
8
|
+
export function FreeAccountPrompt({
|
|
27
9
|
visible,
|
|
28
10
|
onClose
|
|
29
|
-
})
|
|
30
|
-
const access = getUseAccountAccess()();
|
|
31
|
-
const [copied, setCopied] = useState(false);
|
|
32
|
-
const resetTimer = useRef(null);
|
|
33
|
-
useEffect(() => () => {
|
|
34
|
-
if (resetTimer.current) clearTimeout(resetTimer.current);
|
|
35
|
-
}, []);
|
|
36
|
-
const handleCopy = useCallback(() => {
|
|
37
|
-
void copyToClipboard(LOGIN_COMMAND).then(ok => {
|
|
38
|
-
if (!ok) return;
|
|
39
|
-
setCopied(true);
|
|
40
|
-
if (resetTimer.current) clearTimeout(resetTimer.current);
|
|
41
|
-
resetTimer.current = setTimeout(() => setCopied(false), 1500);
|
|
42
|
-
});
|
|
43
|
-
}, []);
|
|
11
|
+
}) {
|
|
44
12
|
if (!visible) return null;
|
|
45
13
|
return /*#__PURE__*/_jsx(Modal, {
|
|
46
|
-
visible:
|
|
14
|
+
visible: true,
|
|
47
15
|
transparent: true,
|
|
48
16
|
animationType: "fade",
|
|
49
17
|
onRequestClose: onClose,
|
|
50
|
-
children: /*#__PURE__*/
|
|
18
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
51
19
|
style: styles.overlay,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
color: buoyColors.textMuted
|
|
65
|
-
})
|
|
66
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
67
|
-
style: styles.title,
|
|
68
|
-
children: access.status === "initializing" ? "Checking your account…" : "Sign in to use Buoy"
|
|
69
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
70
|
-
style: styles.subtitle,
|
|
71
|
-
children: "A Free or Pro account is required. Run this command in your project, then reload the app to use your account key."
|
|
72
|
-
}), /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
73
|
-
style: styles.command,
|
|
74
|
-
onPress: handleCopy,
|
|
75
|
-
activeOpacity: 0.7,
|
|
76
|
-
accessibilityLabel: `Copy ${LOGIN_COMMAND}`,
|
|
77
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
78
|
-
style: styles.commandText,
|
|
79
|
-
children: LOGIN_COMMAND
|
|
80
|
-
}), copied ? /*#__PURE__*/_jsx(Check, {
|
|
81
|
-
size: 14,
|
|
82
|
-
color: buoyColors.success
|
|
83
|
-
}) : /*#__PURE__*/_jsx(Copy, {
|
|
84
|
-
size: 14,
|
|
85
|
-
color: buoyColors.textMuted
|
|
86
|
-
})]
|
|
87
|
-
}), access.status !== "admitted" && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
88
|
-
style: styles.secondary,
|
|
89
|
-
onPress: () => {
|
|
90
|
-
void retryAccountAccess();
|
|
91
|
-
},
|
|
92
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
93
|
-
style: styles.secondaryText,
|
|
94
|
-
children: "Retry verification"
|
|
95
|
-
})
|
|
96
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
97
|
-
style: styles.reassure,
|
|
98
|
-
children: "Free forever. No card. About thirty seconds."
|
|
99
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
100
|
-
style: styles.secondary,
|
|
101
|
-
onPress: () => openPricing("https://github.com/Buoy-gg/buoy/issues/new/choose"),
|
|
102
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
103
|
-
style: styles.secondaryText,
|
|
104
|
-
children: "Contact support on GitHub"
|
|
105
|
-
})
|
|
106
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
107
|
-
style: styles.secondary,
|
|
108
|
-
onPress: () => openPricing("mailto:support@buoy.gg"),
|
|
109
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
110
|
-
style: styles.secondaryText,
|
|
111
|
-
children: "Email support@buoy.gg"
|
|
112
|
-
})
|
|
113
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
114
|
-
style: styles.secondary,
|
|
115
|
-
onPress: () => openPricing(),
|
|
116
|
-
activeOpacity: 0.8,
|
|
117
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
118
|
-
style: styles.secondaryText,
|
|
119
|
-
children: "Or see Pro"
|
|
120
|
-
})
|
|
121
|
-
})]
|
|
122
|
-
})
|
|
20
|
+
accessibilityViewIsModal: true,
|
|
21
|
+
children: [/*#__PURE__*/_jsx(Pressable, {
|
|
22
|
+
style: StyleSheet.absoluteFill,
|
|
23
|
+
onPress: onClose,
|
|
24
|
+
accessible: false
|
|
25
|
+
}), /*#__PURE__*/_jsx(ScrollView, {
|
|
26
|
+
style: styles.frame,
|
|
27
|
+
bounces: false,
|
|
28
|
+
children: /*#__PURE__*/_jsx(AccountSetupCard, {
|
|
29
|
+
onClose: onClose
|
|
30
|
+
})
|
|
31
|
+
})]
|
|
123
32
|
})
|
|
124
33
|
});
|
|
125
|
-
}
|
|
34
|
+
}
|
|
126
35
|
const styles = StyleSheet.create({
|
|
127
36
|
overlay: {
|
|
128
37
|
flex: 1,
|
|
129
|
-
backgroundColor: "rgba(0, 0, 0, 0.
|
|
38
|
+
backgroundColor: "rgba(0, 0, 0, 0.65)",
|
|
130
39
|
alignItems: "center",
|
|
131
40
|
justifyContent: "center",
|
|
132
41
|
padding: 20
|
|
133
42
|
},
|
|
134
|
-
|
|
135
|
-
backgroundColor: buoyColors.card,
|
|
136
|
-
borderRadius: 16,
|
|
137
|
-
borderWidth: 1,
|
|
138
|
-
borderColor: buoyColors.primary + "60",
|
|
139
|
-
padding: 24,
|
|
140
|
-
maxWidth: 340,
|
|
43
|
+
frame: {
|
|
141
44
|
width: "100%",
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
top: 12,
|
|
147
|
-
right: 12,
|
|
148
|
-
padding: 6,
|
|
149
|
-
zIndex: 1
|
|
150
|
-
},
|
|
151
|
-
title: {
|
|
152
|
-
fontSize: 20,
|
|
153
|
-
fontWeight: "700",
|
|
154
|
-
color: buoyColors.text,
|
|
155
|
-
textAlign: "center",
|
|
156
|
-
marginBottom: 8
|
|
157
|
-
},
|
|
158
|
-
subtitle: {
|
|
159
|
-
fontSize: 13,
|
|
160
|
-
lineHeight: 19,
|
|
161
|
-
color: buoyColors.textMuted,
|
|
162
|
-
textAlign: "center",
|
|
163
|
-
marginBottom: 20
|
|
164
|
-
},
|
|
165
|
-
command: {
|
|
166
|
-
flexDirection: "row",
|
|
167
|
-
alignItems: "center",
|
|
168
|
-
justifyContent: "space-between",
|
|
169
|
-
backgroundColor: buoyColors.base,
|
|
170
|
-
borderRadius: 8,
|
|
171
|
-
borderWidth: 1,
|
|
172
|
-
borderColor: buoyColors.border,
|
|
173
|
-
paddingHorizontal: 14,
|
|
174
|
-
paddingVertical: 12,
|
|
175
|
-
gap: 10
|
|
176
|
-
},
|
|
177
|
-
commandText: {
|
|
178
|
-
fontSize: 14,
|
|
179
|
-
fontWeight: "600",
|
|
180
|
-
color: buoyColors.text,
|
|
181
|
-
fontFamily: monoFont
|
|
182
|
-
},
|
|
183
|
-
reassure: {
|
|
184
|
-
fontSize: 12,
|
|
185
|
-
color: buoyColors.textMuted,
|
|
186
|
-
textAlign: "center",
|
|
187
|
-
marginTop: 10
|
|
188
|
-
},
|
|
189
|
-
secondary: {
|
|
190
|
-
marginTop: 18,
|
|
191
|
-
paddingVertical: 10,
|
|
192
|
-
alignItems: "center"
|
|
193
|
-
},
|
|
194
|
-
secondaryText: {
|
|
195
|
-
fontSize: 13,
|
|
196
|
-
fontWeight: "600",
|
|
197
|
-
color: buoyColors.textMuted
|
|
45
|
+
maxWidth: 368,
|
|
46
|
+
maxHeight: "90%",
|
|
47
|
+
flexGrow: 0,
|
|
48
|
+
borderRadius: 20
|
|
198
49
|
}
|
|
199
50
|
});
|
|
@@ -15,17 +15,11 @@ import { macOSColors } from "../ui/gameUI/constants/macOSDesignSystemColors.js";
|
|
|
15
15
|
import { openPricing, isWeb } from "./openPricing.js";
|
|
16
16
|
import { X, Key, Link, FileCode, Copy } from "../icons/lucide-icons.js";
|
|
17
17
|
import { monoFont } from "../ui/fonts.js";
|
|
18
|
-
|
|
19
|
-
import {
|
|
20
|
-
let Clipboard = null;
|
|
21
|
-
try {
|
|
22
|
-
Clipboard = require("@react-native-clipboard/clipboard").default;
|
|
23
|
-
} catch {
|
|
24
|
-
// Clipboard not available
|
|
25
|
-
}
|
|
18
|
+
import { copyToClipboard } from "../clipboard/index.js";
|
|
19
|
+
import { isClipboardAvailable } from "../clipboard/autoDetectClipboard.js";
|
|
26
20
|
|
|
27
21
|
// Keep these for backwards compatibility but they're no longer used
|
|
28
|
-
|
|
22
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
23
|
const CODE_SNIPPET = `import { Buoy } from '@buoy-gg/core';
|
|
30
24
|
|
|
31
25
|
Buoy.init({
|
|
@@ -40,9 +34,8 @@ export const LicenseEntryModal = ({
|
|
|
40
34
|
const handleGetLicense = useCallback(() => {
|
|
41
35
|
openPricing(purchaseUrl);
|
|
42
36
|
}, [purchaseUrl]);
|
|
43
|
-
const handleCopyCode = useCallback(() => {
|
|
44
|
-
if (
|
|
45
|
-
Clipboard.setString(CODE_SNIPPET);
|
|
37
|
+
const handleCopyCode = useCallback(async () => {
|
|
38
|
+
if (await copyToClipboard(CODE_SNIPPET)) {
|
|
46
39
|
setCopied(true);
|
|
47
40
|
setTimeout(() => setCopied(false), 2000);
|
|
48
41
|
}
|
|
@@ -177,7 +170,7 @@ export const LicenseEntryModal = ({
|
|
|
177
170
|
style: styles.codePunctuation,
|
|
178
171
|
children: "});"
|
|
179
172
|
})]
|
|
180
|
-
}),
|
|
173
|
+
}), isClipboardAvailable() && /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
181
174
|
style: styles.copyButton,
|
|
182
175
|
onPress: handleCopyCode,
|
|
183
176
|
activeOpacity: 0.7,
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import * as licenseModule from "@buoy-gg/license";
|
|
12
|
+
import { canInitializeAccount } from "./accountRuntime";
|
|
12
13
|
|
|
13
14
|
/** Tier. Mirrors BuoyTier in @buoy-gg/license. */
|
|
14
15
|
|
|
@@ -71,6 +72,7 @@ const LOCKED = {
|
|
|
71
72
|
// Resolve at the boundary, after module initialization. Do not cache an absent
|
|
72
73
|
// manager during a circular import or grant access for older package versions.
|
|
73
74
|
function accountManager() {
|
|
75
|
+
if (!canInitializeAccount()) return null;
|
|
74
76
|
try {
|
|
75
77
|
const manager = licenseModule.LicenseManager;
|
|
76
78
|
void manager?.initialize?.();
|
|
@@ -5,7 +5,7 @@ import { Settings, EyeOff, Database } from "../../icons/index.js";
|
|
|
5
5
|
import { useState, useEffect } from "react";
|
|
6
6
|
import { CyberpunkSectionButton } from "../../ui/console/CyberpunkSectionButton.js";
|
|
7
7
|
import { devToolsStorageKeys } from "../../storage/devToolsStorageKeys.js";
|
|
8
|
-
import { persistentStorage } from "../../utils/persistentStorage
|
|
8
|
+
import { persistentStorage } from "../../utils/persistentStorage";
|
|
9
9
|
import { macOSColors } from "../../ui/gameUI/constants/macOSDesignSystemColors.js";
|
|
10
10
|
import { buoyColors } from "../../ui/gameUI/constants/gameUIColors.js";
|
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* callers that treat first launch differently.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { persistentStorage } from "../utils/persistentStorage
|
|
17
|
+
import { persistentStorage } from "../utils/persistentStorage";
|
|
18
18
|
function isPlainObject(value) {
|
|
19
19
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
20
20
|
}
|
|
@@ -1,189 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
* Shared "ignored patterns" store for network-style URL filtering.
|
|
5
|
-
*
|
|
6
|
-
* This is the SINGLE source of truth for the domains/URL patterns that the
|
|
7
|
-
* Network tool (and now the Events tool) hide from their lists. Both tools read
|
|
8
|
-
* and mutate this one singleton, so an ignore toggled in either place is shared
|
|
9
|
-
* everywhere and persisted to the same storage key.
|
|
10
|
-
*
|
|
11
|
-
* Lives in @buoy-gg/shared-ui (a hard dependency of both @buoy-gg/network and
|
|
12
|
-
* @buoy-gg/events) so the filter logic can be shared without @buoy-gg/events
|
|
13
|
-
* having to take a hard dependency on @buoy-gg/network (which is optional).
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
import { useEffect, useMemo, useState } from "react";
|
|
17
|
-
import { persistentStorage } from "../utils/persistentStorage.js";
|
|
18
|
-
import { devToolsStorageKeys } from "../storage/devToolsStorageKeys.js";
|
|
19
|
-
|
|
20
|
-
// Pure matching types/helpers live in ignoredPatternsCore.ts (web-shim-safe);
|
|
21
|
-
// re-exported here so the shared-ui barrel surface is unchanged.
|
|
22
|
-
import { DEFAULT_IGNORED_PATTERNS } from "./ignoredPatternsCore.js";
|
|
23
|
-
export { urlMatchesIgnoredPattern, isUrlIgnored } from "./ignoredPatternsCore.js";
|
|
24
|
-
const DEFAULT_PATTERNS = DEFAULT_IGNORED_PATTERNS;
|
|
25
|
-
|
|
26
|
-
/** Tolerate the legacy `string[]` persisted format and stray junk. */
|
|
27
|
-
function migratePatterns(raw) {
|
|
28
|
-
if (!Array.isArray(raw)) return [];
|
|
29
|
-
const migrated = [];
|
|
30
|
-
for (const entry of raw) {
|
|
31
|
-
if (typeof entry === "string" && entry.trim()) {
|
|
32
|
-
migrated.push({
|
|
33
|
-
value: entry,
|
|
34
|
-
mode: "contains"
|
|
35
|
-
});
|
|
36
|
-
} else if (entry && typeof entry === "object" && typeof entry.value === "string") {
|
|
37
|
-
const e = entry;
|
|
38
|
-
migrated.push({
|
|
39
|
-
value: e.value,
|
|
40
|
-
mode: e.mode === "exact" ? "exact" : "contains"
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return migrated;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/** Always keep the default patterns present (e.g. Buoy's license API). */
|
|
48
|
-
function ensureDefaults(patterns) {
|
|
49
|
-
const result = [...patterns];
|
|
50
|
-
for (const def of DEFAULT_PATTERNS) {
|
|
51
|
-
if (!result.some(p => p.value === def.value)) {
|
|
52
|
-
result.push({
|
|
53
|
-
...def
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return result;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Singleton store. One instance per JS runtime, so every consumer (Network tool,
|
|
61
|
-
* Events tool, on mobile or on the desktop dashboard) shares the same patterns.
|
|
62
|
-
*/
|
|
63
|
-
class IgnoredPatternsStore {
|
|
64
|
-
patterns = ensureDefaults(DEFAULT_PATTERNS.map(p => ({
|
|
65
|
-
...p
|
|
66
|
-
})));
|
|
67
|
-
listeners = new Set();
|
|
68
|
-
loaded = false;
|
|
69
|
-
loadPromise = null;
|
|
70
|
-
/** Set once a mutation happens so a slow initial load can't clobber it. */
|
|
71
|
-
dirty = false;
|
|
72
|
-
|
|
73
|
-
/** Current patterns (stable reference until a mutation occurs). */
|
|
74
|
-
getPatterns() {
|
|
75
|
-
return this.patterns;
|
|
76
|
-
}
|
|
77
|
-
subscribe(listener) {
|
|
78
|
-
this.listeners.add(listener);
|
|
79
|
-
// Lazily hydrate from storage the first time anyone cares.
|
|
80
|
-
void this.ensureLoaded();
|
|
81
|
-
return () => {
|
|
82
|
-
this.listeners.delete(listener);
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
emit() {
|
|
86
|
-
this.listeners.forEach(l => l());
|
|
87
|
-
}
|
|
88
|
-
ensureLoaded() {
|
|
89
|
-
if (this.loaded) return Promise.resolve();
|
|
90
|
-
if (this.loadPromise) return this.loadPromise;
|
|
91
|
-
this.loadPromise = (async () => {
|
|
92
|
-
try {
|
|
93
|
-
const stored = await persistentStorage.getItem(devToolsStorageKeys.network.ignoredDomains());
|
|
94
|
-
// A mutation may have raced this read — never overwrite user intent.
|
|
95
|
-
if (stored && !this.dirty) {
|
|
96
|
-
const migrated = ensureDefaults(migratePatterns(JSON.parse(stored)));
|
|
97
|
-
this.patterns = migrated;
|
|
98
|
-
}
|
|
99
|
-
} catch {
|
|
100
|
-
// Silently fall back to defaults.
|
|
101
|
-
} finally {
|
|
102
|
-
this.loaded = true;
|
|
103
|
-
this.emit();
|
|
104
|
-
}
|
|
105
|
-
})();
|
|
106
|
-
return this.loadPromise;
|
|
107
|
-
}
|
|
108
|
-
persist() {
|
|
109
|
-
persistentStorage.setItem(devToolsStorageKeys.network.ignoredDomains(), JSON.stringify(this.patterns)).catch(() => {
|
|
110
|
-
// Silently fail — patterns remain in memory.
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
commit(next) {
|
|
114
|
-
this.dirty = true;
|
|
115
|
-
this.patterns = next;
|
|
116
|
-
this.emit();
|
|
117
|
-
this.persist();
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/** Add a pattern (no-op if its value already exists). */
|
|
121
|
-
add(pattern) {
|
|
122
|
-
const value = pattern.value.trim();
|
|
123
|
-
if (!value) return;
|
|
124
|
-
if (this.patterns.some(p => p.value === value)) return;
|
|
125
|
-
this.commit([...this.patterns, {
|
|
126
|
-
value,
|
|
127
|
-
mode: pattern.mode
|
|
128
|
-
}]);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/** Remove a pattern by value. */
|
|
132
|
-
remove(value) {
|
|
133
|
-
if (!this.patterns.some(p => p.value === value)) return;
|
|
134
|
-
this.commit(this.patterns.filter(p => p.value !== value));
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/** Add as `contains` if absent, otherwise remove (used by detail-view chips). */
|
|
138
|
-
toggle(value) {
|
|
139
|
-
const trimmed = value.trim();
|
|
140
|
-
if (!trimmed) return;
|
|
141
|
-
this.commit(this.patterns.some(p => p.value === trimmed) ? this.patterns.filter(p => p.value !== trimmed) : [...this.patterns, {
|
|
142
|
-
value: trimmed,
|
|
143
|
-
mode: "contains"
|
|
144
|
-
}]);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/** Flip an existing pattern between `contains` and `exact`. */
|
|
148
|
-
toggleMode(value) {
|
|
149
|
-
if (!this.patterns.some(p => p.value === value)) return;
|
|
150
|
-
this.commit(this.patterns.map(p => p.value === value ? {
|
|
151
|
-
...p,
|
|
152
|
-
mode: p.mode === "contains" ? "exact" : "contains"
|
|
153
|
-
} : p));
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
export const ignoredPatternsStore = new IgnoredPatternsStore();
|
|
157
|
-
/**
|
|
158
|
-
* Mutations live at module scope so they keep a STABLE identity across
|
|
159
|
-
* renders. They used to be inline arrows in the return object, which handed
|
|
160
|
-
* every consumer a fresh `toggle` on each render and defeated `memo` on
|
|
161
|
-
* anything they were passed down to — measured on the network detail view,
|
|
162
|
-
* where it forced a full re-render of the inspector per step.
|
|
163
|
-
*/
|
|
164
|
-
const addPattern = pattern => ignoredPatternsStore.add(pattern);
|
|
165
|
-
const removePattern = value => ignoredPatternsStore.remove(value);
|
|
166
|
-
const togglePattern = value => ignoredPatternsStore.toggle(value);
|
|
167
|
-
const togglePatternMode = value => ignoredPatternsStore.toggleMode(value);
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Subscribe to the shared ignored-patterns store. All consumers in a runtime
|
|
171
|
-
* see the same patterns and the same mutations.
|
|
172
|
-
*/
|
|
173
|
-
export function useIgnoredPatterns() {
|
|
174
|
-
const [patterns, setPatterns] = useState(() => ignoredPatternsStore.getPatterns());
|
|
175
|
-
useEffect(() => {
|
|
176
|
-
return ignoredPatternsStore.subscribe(() => {
|
|
177
|
-
setPatterns(ignoredPatternsStore.getPatterns());
|
|
178
|
-
});
|
|
179
|
-
}, []);
|
|
180
|
-
const values = useMemo(() => new Set(patterns.map(p => p.value)), [patterns]);
|
|
181
|
-
return {
|
|
182
|
-
patterns,
|
|
183
|
-
values,
|
|
184
|
-
add: addPattern,
|
|
185
|
-
remove: removePattern,
|
|
186
|
-
toggle: togglePattern,
|
|
187
|
-
toggleMode: togglePatternMode
|
|
188
|
-
};
|
|
189
|
-
}
|
|
3
|
+
export * from "./ignoredPatternsStore.shared.js";
|