@buoy-gg/shared-ui 7.0.39 → 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/ignoredPatternsCore.js +8 -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/ignoredPatternsCore.js +8 -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/ignoredPatternsCore.d.ts +5 -1
- package/lib/typescript/commonjs/stores/ignoredPatternsCore.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/ignoredPatternsCore.d.ts +5 -1
- package/lib/typescript/module/stores/ignoredPatternsCore.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,662 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
persistentStorage
|
|
4
|
+
} from "./chunk-JR7BJW6B.mjs";
|
|
5
|
+
|
|
6
|
+
// src/hooks/usePersistedState.ts
|
|
7
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
8
|
+
var hydratedCache = /* @__PURE__ */ new Map();
|
|
9
|
+
function defaultParse(raw) {
|
|
10
|
+
try {
|
|
11
|
+
return JSON.parse(raw);
|
|
12
|
+
} catch {
|
|
13
|
+
return void 0;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function usePersistedState(key, defaultValue, options = {}) {
|
|
17
|
+
const [value, setValue] = useState(
|
|
18
|
+
() => hydratedCache.has(key) ? hydratedCache.get(key) : defaultValue
|
|
19
|
+
);
|
|
20
|
+
const [hydrated, setHydrated] = useState(() => hydratedCache.has(key));
|
|
21
|
+
const keyRef = useRef(key);
|
|
22
|
+
keyRef.current = key;
|
|
23
|
+
const optionsRef = useRef(options);
|
|
24
|
+
optionsRef.current = options;
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (hydratedCache.has(key)) {
|
|
27
|
+
setValue(hydratedCache.get(key));
|
|
28
|
+
setHydrated(true);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
let cancelled = false;
|
|
32
|
+
const storage = optionsRef.current.storage ?? persistentStorage;
|
|
33
|
+
const parse = optionsRef.current.parse ?? defaultParse;
|
|
34
|
+
storage.getItem(key).then((raw) => {
|
|
35
|
+
if (cancelled) return;
|
|
36
|
+
if (raw != null) {
|
|
37
|
+
let parsed;
|
|
38
|
+
try {
|
|
39
|
+
parsed = parse(raw);
|
|
40
|
+
} catch {
|
|
41
|
+
}
|
|
42
|
+
if (parsed !== void 0) {
|
|
43
|
+
hydratedCache.set(key, parsed);
|
|
44
|
+
setValue(parsed);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
setHydrated(true);
|
|
48
|
+
}).catch(() => {
|
|
49
|
+
if (!cancelled) setHydrated(true);
|
|
50
|
+
});
|
|
51
|
+
return () => {
|
|
52
|
+
cancelled = true;
|
|
53
|
+
};
|
|
54
|
+
}, [key]);
|
|
55
|
+
const set = useCallback((next) => {
|
|
56
|
+
setValue((prev) => {
|
|
57
|
+
const resolved = typeof next === "function" ? next(prev) : next;
|
|
58
|
+
hydratedCache.set(keyRef.current, resolved);
|
|
59
|
+
const storage = optionsRef.current.storage ?? persistentStorage;
|
|
60
|
+
const serialize = optionsRef.current.serialize ?? JSON.stringify;
|
|
61
|
+
try {
|
|
62
|
+
storage.setItem(keyRef.current, serialize(resolved)).catch(() => {
|
|
63
|
+
});
|
|
64
|
+
} catch {
|
|
65
|
+
}
|
|
66
|
+
return resolved;
|
|
67
|
+
});
|
|
68
|
+
}, []);
|
|
69
|
+
return [value, set, hydrated];
|
|
70
|
+
}
|
|
71
|
+
function resetPersistedStateCache() {
|
|
72
|
+
hydratedCache.clear();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// src/hooks/useChangeLog.ts
|
|
76
|
+
import { useCallback as useCallback2, useEffect as useEffect2, useMemo, useState as useState2 } from "react";
|
|
77
|
+
function useChangeLog(log, options = {}) {
|
|
78
|
+
const [items, setItems] = useState2(() => log.getAll());
|
|
79
|
+
const [filter, setFilter] = useState2(() => options.initialFilter ?? {});
|
|
80
|
+
const [isEnabled, setIsEnabled] = useState2(() => log.getEnabled());
|
|
81
|
+
useEffect2(() => log.subscribe(setItems), [log]);
|
|
82
|
+
const filterItems = options.filterItems;
|
|
83
|
+
const filteredItems = useMemo(
|
|
84
|
+
() => filterItems ? filterItems(items, filter) : items,
|
|
85
|
+
[items, filter, filterItems]
|
|
86
|
+
);
|
|
87
|
+
const clear = useCallback2(() => {
|
|
88
|
+
log.clear();
|
|
89
|
+
}, [log]);
|
|
90
|
+
const toggleCapture = useCallback2(() => {
|
|
91
|
+
const next = !isEnabled;
|
|
92
|
+
log.setEnabled(next);
|
|
93
|
+
setIsEnabled(next);
|
|
94
|
+
}, [log, isEnabled]);
|
|
95
|
+
const getById = useCallback2((id) => log.getById(id), [log]);
|
|
96
|
+
return { items, filteredItems, filter, setFilter, isEnabled, toggleCapture, clear, getById };
|
|
97
|
+
}
|
|
98
|
+
function useSubscribedValue(read, subscribe) {
|
|
99
|
+
const [value, setValue] = useState2(read);
|
|
100
|
+
useEffect2(() => subscribe(setValue), [subscribe]);
|
|
101
|
+
return value;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// src/hooks/useEventStoreEvents.ts
|
|
105
|
+
import { useCallback as useCallback3, useEffect as useEffect3, useState as useState3 } from "react";
|
|
106
|
+
function useEventStoreEvents(store, options = {}) {
|
|
107
|
+
const { enabled = true, maxEvents = 500, select } = options;
|
|
108
|
+
const [events, setEvents] = useState3([]);
|
|
109
|
+
const [isActive, setIsActive] = useState3(enabled);
|
|
110
|
+
useEffect3(() => {
|
|
111
|
+
if (!enabled) {
|
|
112
|
+
setIsActive(false);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
let rafId = null;
|
|
116
|
+
let pending = null;
|
|
117
|
+
const unsubscribe = store.subscribeToEvents((all) => {
|
|
118
|
+
pending = all;
|
|
119
|
+
if (rafId != null) return;
|
|
120
|
+
rafId = requestAnimationFrame(() => {
|
|
121
|
+
rafId = null;
|
|
122
|
+
if (!pending) return;
|
|
123
|
+
let next = pending;
|
|
124
|
+
pending = null;
|
|
125
|
+
if (select) next = select(next);
|
|
126
|
+
if (next.length > maxEvents) next = next.slice(0, maxEvents);
|
|
127
|
+
setEvents(next);
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
setIsActive(true);
|
|
131
|
+
return () => {
|
|
132
|
+
unsubscribe();
|
|
133
|
+
if (rafId != null) cancelAnimationFrame(rafId);
|
|
134
|
+
};
|
|
135
|
+
}, [store, enabled, maxEvents, select]);
|
|
136
|
+
const clearEvents = useCallback3(() => {
|
|
137
|
+
store.clearEvents();
|
|
138
|
+
}, [store]);
|
|
139
|
+
return { events, clearEvents, isActive };
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// src/hooks/useDeviceInfo.ts
|
|
143
|
+
import { useState as useState4, useEffect as useEffect4, useCallback as useCallback4 } from "react";
|
|
144
|
+
import {
|
|
145
|
+
Platform,
|
|
146
|
+
Dimensions,
|
|
147
|
+
PixelRatio,
|
|
148
|
+
AccessibilityInfo,
|
|
149
|
+
Appearance,
|
|
150
|
+
I18nManager,
|
|
151
|
+
NativeModules,
|
|
152
|
+
Keyboard,
|
|
153
|
+
AppState,
|
|
154
|
+
StatusBar
|
|
155
|
+
} from "react-native-web";
|
|
156
|
+
async function getAccessibilitySettings() {
|
|
157
|
+
const [
|
|
158
|
+
isScreenReaderEnabled,
|
|
159
|
+
isReduceMotionEnabled,
|
|
160
|
+
isReduceTransparencyEnabled
|
|
161
|
+
] = await Promise.all([
|
|
162
|
+
AccessibilityInfo.isScreenReaderEnabled(),
|
|
163
|
+
AccessibilityInfo.isReduceMotionEnabled(),
|
|
164
|
+
AccessibilityInfo.isReduceTransparencyEnabled()
|
|
165
|
+
]);
|
|
166
|
+
const settings = {
|
|
167
|
+
isScreenReaderEnabled,
|
|
168
|
+
isReduceMotionEnabled,
|
|
169
|
+
isReduceTransparencyEnabled
|
|
170
|
+
};
|
|
171
|
+
if (Platform.OS === "ios") {
|
|
172
|
+
const [
|
|
173
|
+
isBoldTextEnabled,
|
|
174
|
+
isGrayscaleEnabled,
|
|
175
|
+
isInvertColorsEnabled,
|
|
176
|
+
isDarkerSystemColorsEnabled,
|
|
177
|
+
prefersCrossFadeTransitions
|
|
178
|
+
] = await Promise.all([
|
|
179
|
+
AccessibilityInfo.isBoldTextEnabled?.() ?? Promise.resolve(false),
|
|
180
|
+
AccessibilityInfo.isGrayscaleEnabled?.() ?? Promise.resolve(false),
|
|
181
|
+
AccessibilityInfo.isInvertColorsEnabled?.() ?? Promise.resolve(false),
|
|
182
|
+
// @ts-ignore - may not be typed
|
|
183
|
+
AccessibilityInfo.isDarkerSystemColorsEnabled?.() ?? Promise.resolve(false),
|
|
184
|
+
// @ts-ignore - may not be typed
|
|
185
|
+
AccessibilityInfo.prefersCrossFadeTransitions?.() ?? Promise.resolve(false)
|
|
186
|
+
]);
|
|
187
|
+
settings.isBoldTextEnabled = isBoldTextEnabled;
|
|
188
|
+
settings.isGrayscaleEnabled = isGrayscaleEnabled;
|
|
189
|
+
settings.isInvertColorsEnabled = isInvertColorsEnabled;
|
|
190
|
+
settings.isDarkerSystemColorsEnabled = isDarkerSystemColorsEnabled;
|
|
191
|
+
settings.prefersCrossFadeTransitions = prefersCrossFadeTransitions;
|
|
192
|
+
}
|
|
193
|
+
if (Platform.OS === "android") {
|
|
194
|
+
const isHighTextContrastEnabled = await AccessibilityInfo.isHighTextContrastEnabled?.() ?? false;
|
|
195
|
+
settings.isHighTextContrastEnabled = isHighTextContrastEnabled;
|
|
196
|
+
}
|
|
197
|
+
return settings;
|
|
198
|
+
}
|
|
199
|
+
function getPlatformInfo() {
|
|
200
|
+
const constants = Platform.constants;
|
|
201
|
+
const base = {
|
|
202
|
+
os: Platform.OS,
|
|
203
|
+
version: Platform.Version,
|
|
204
|
+
reactNativeVersion: constants.reactNativeVersion,
|
|
205
|
+
isTesting: Platform.isTesting ?? false,
|
|
206
|
+
isDisableAnimations: constants.isDisableAnimations ?? false
|
|
207
|
+
};
|
|
208
|
+
if (Platform.OS === "ios") {
|
|
209
|
+
return {
|
|
210
|
+
...base,
|
|
211
|
+
osVersion: constants.osVersion,
|
|
212
|
+
systemName: constants.systemName,
|
|
213
|
+
interfaceIdiom: constants.interfaceIdiom,
|
|
214
|
+
isPad: Platform.isPad,
|
|
215
|
+
isTV: Platform.isTV,
|
|
216
|
+
isVision: Platform.isVision ?? false,
|
|
217
|
+
isMacCatalyst: Platform.isMacCatalyst ?? false,
|
|
218
|
+
forceTouchAvailable: constants.forceTouchAvailable
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
if (Platform.OS === "android") {
|
|
222
|
+
return {
|
|
223
|
+
...base,
|
|
224
|
+
apiLevel: constants.Version,
|
|
225
|
+
release: constants.Release,
|
|
226
|
+
brand: constants.Brand,
|
|
227
|
+
manufacturer: constants.Manufacturer,
|
|
228
|
+
model: constants.Model,
|
|
229
|
+
fingerprint: constants.Fingerprint,
|
|
230
|
+
serial: constants.Serial,
|
|
231
|
+
uiMode: constants.uiMode
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
return base;
|
|
235
|
+
}
|
|
236
|
+
function getDisplayInfo() {
|
|
237
|
+
const window = Dimensions.get("window");
|
|
238
|
+
const screen = Dimensions.get("screen");
|
|
239
|
+
const info = {
|
|
240
|
+
window: {
|
|
241
|
+
width: window.width,
|
|
242
|
+
height: window.height,
|
|
243
|
+
scale: window.scale,
|
|
244
|
+
fontScale: window.fontScale
|
|
245
|
+
},
|
|
246
|
+
screen: {
|
|
247
|
+
width: screen.width,
|
|
248
|
+
height: screen.height,
|
|
249
|
+
scale: screen.scale,
|
|
250
|
+
fontScale: screen.fontScale
|
|
251
|
+
},
|
|
252
|
+
pixelRatio: PixelRatio.get(),
|
|
253
|
+
fontScale: PixelRatio.getFontScale(),
|
|
254
|
+
isLandscape: window.width > window.height,
|
|
255
|
+
isPortrait: window.height > window.width
|
|
256
|
+
};
|
|
257
|
+
if (Platform.OS === "ios") {
|
|
258
|
+
try {
|
|
259
|
+
const deviceInfo = NativeModules.DeviceInfo?.getConstants?.();
|
|
260
|
+
info.isIPhoneNotched = deviceInfo?.isIPhoneX_deprecated ?? false;
|
|
261
|
+
} catch {
|
|
262
|
+
info.isIPhoneNotched = false;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
if (Platform.OS === "android") {
|
|
266
|
+
try {
|
|
267
|
+
const deviceInfo = NativeModules.DeviceInfo?.getConstants?.();
|
|
268
|
+
info.isEdgeToEdge = deviceInfo?.isEdgeToEdge ?? false;
|
|
269
|
+
info.densityDpi = Math.round(window.scale * 160);
|
|
270
|
+
} catch {
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return info;
|
|
274
|
+
}
|
|
275
|
+
async function getStatusBarHeight() {
|
|
276
|
+
return new Promise((resolve) => {
|
|
277
|
+
let resolved = false;
|
|
278
|
+
if (Platform.OS === "ios") {
|
|
279
|
+
NativeModules.StatusBarManager?.getHeight?.(
|
|
280
|
+
(result) => {
|
|
281
|
+
if (!resolved) {
|
|
282
|
+
resolved = true;
|
|
283
|
+
resolve(result?.height ?? null);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
) ?? resolve(null);
|
|
287
|
+
} else if (Platform.OS === "android") {
|
|
288
|
+
resolved = true;
|
|
289
|
+
resolve(StatusBar.currentHeight ?? null);
|
|
290
|
+
} else {
|
|
291
|
+
resolved = true;
|
|
292
|
+
resolve(null);
|
|
293
|
+
}
|
|
294
|
+
setTimeout(() => {
|
|
295
|
+
if (!resolved) {
|
|
296
|
+
resolved = true;
|
|
297
|
+
resolve(null);
|
|
298
|
+
}
|
|
299
|
+
}, 100);
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
function getLocaleInfo() {
|
|
303
|
+
const info = {
|
|
304
|
+
isRTL: I18nManager.isRTL,
|
|
305
|
+
doLeftAndRightSwapInRTL: I18nManager.doLeftAndRightSwapInRTL
|
|
306
|
+
};
|
|
307
|
+
if (Platform.OS === "android") {
|
|
308
|
+
info.localeIdentifier = I18nManager.localeIdentifier;
|
|
309
|
+
}
|
|
310
|
+
return info;
|
|
311
|
+
}
|
|
312
|
+
function getSettingsInfo() {
|
|
313
|
+
if (Platform.OS === "ios") {
|
|
314
|
+
try {
|
|
315
|
+
const constants = NativeModules.SettingsManager?.getConstants?.();
|
|
316
|
+
return {
|
|
317
|
+
userDefaults: constants?.settings ?? {}
|
|
318
|
+
};
|
|
319
|
+
} catch {
|
|
320
|
+
return {};
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
return {};
|
|
324
|
+
}
|
|
325
|
+
function getUniqueIdentifiers() {
|
|
326
|
+
const identifiers = {};
|
|
327
|
+
if (Platform.OS === "android") {
|
|
328
|
+
const constants = Platform.constants;
|
|
329
|
+
identifiers.serial = constants.Serial;
|
|
330
|
+
identifiers.fingerprint = constants.Fingerprint;
|
|
331
|
+
try {
|
|
332
|
+
const PlatformConstants = NativeModules.PlatformConstants;
|
|
333
|
+
if (PlatformConstants?.getAndroidID) {
|
|
334
|
+
identifiers.androidId = PlatformConstants.getAndroidID();
|
|
335
|
+
}
|
|
336
|
+
} catch {
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
return identifiers;
|
|
340
|
+
}
|
|
341
|
+
function generateFingerprint(info) {
|
|
342
|
+
const components = [
|
|
343
|
+
// Platform
|
|
344
|
+
info.platform.os,
|
|
345
|
+
info.platform.version,
|
|
346
|
+
// Display (most stable - identifies device model)
|
|
347
|
+
info.display.window.width,
|
|
348
|
+
info.display.window.height,
|
|
349
|
+
info.display.pixelRatio,
|
|
350
|
+
// iOS specific
|
|
351
|
+
info.platform.interfaceIdiom ?? "",
|
|
352
|
+
info.platform.forceTouchAvailable ?? false,
|
|
353
|
+
info.display.isIPhoneNotched ?? false,
|
|
354
|
+
// Android specific
|
|
355
|
+
info.platform.model ?? "",
|
|
356
|
+
info.platform.brand ?? "",
|
|
357
|
+
info.platform.manufacturer ?? "",
|
|
358
|
+
info.platform.uiMode ?? ""
|
|
359
|
+
];
|
|
360
|
+
const str = components.join("|");
|
|
361
|
+
let hash = 0;
|
|
362
|
+
for (let i = 0; i < str.length; i++) {
|
|
363
|
+
const char = str.charCodeAt(i);
|
|
364
|
+
hash = (hash << 5) - hash + char;
|
|
365
|
+
hash = hash & hash;
|
|
366
|
+
}
|
|
367
|
+
return Math.abs(hash).toString(16).padStart(8, "0");
|
|
368
|
+
}
|
|
369
|
+
function useDeviceInfo() {
|
|
370
|
+
const [isLoading, setIsLoading] = useState4(true);
|
|
371
|
+
const [platform, setPlatform] = useState4(getPlatformInfo());
|
|
372
|
+
const [display, setDisplay] = useState4(getDisplayInfo());
|
|
373
|
+
const [accessibility, setAccessibility] = useState4({
|
|
374
|
+
isScreenReaderEnabled: false,
|
|
375
|
+
isReduceMotionEnabled: false,
|
|
376
|
+
isReduceTransparencyEnabled: false
|
|
377
|
+
});
|
|
378
|
+
const [appearance, setAppearance] = useState4(() => {
|
|
379
|
+
const colorScheme = Appearance.getColorScheme() ?? null;
|
|
380
|
+
return {
|
|
381
|
+
colorScheme,
|
|
382
|
+
prefersDarkMode: colorScheme === "dark"
|
|
383
|
+
};
|
|
384
|
+
});
|
|
385
|
+
const [locale, setLocale] = useState4(getLocaleInfo());
|
|
386
|
+
const [statusBar, setStatusBar] = useState4({
|
|
387
|
+
height: null,
|
|
388
|
+
isVisible: true
|
|
389
|
+
});
|
|
390
|
+
const [keyboard, setKeyboard] = useState4({
|
|
391
|
+
isVisible: false,
|
|
392
|
+
height: 0,
|
|
393
|
+
animationDuration: 0
|
|
394
|
+
});
|
|
395
|
+
const [appStateInfo, setAppStateInfo] = useState4({
|
|
396
|
+
currentState: AppState.currentState,
|
|
397
|
+
isActive: AppState.currentState === "active"
|
|
398
|
+
});
|
|
399
|
+
const [identifiers, setIdentifiers] = useState4(
|
|
400
|
+
getUniqueIdentifiers()
|
|
401
|
+
);
|
|
402
|
+
const [settings, setSettings] = useState4(getSettingsInfo());
|
|
403
|
+
const [timestamp, setTimestamp] = useState4(Date.now());
|
|
404
|
+
const refresh = useCallback4(async () => {
|
|
405
|
+
setIsLoading(true);
|
|
406
|
+
const [accessibilitySettings, statusBarHeight] = await Promise.all([
|
|
407
|
+
getAccessibilitySettings(),
|
|
408
|
+
getStatusBarHeight()
|
|
409
|
+
]);
|
|
410
|
+
setPlatform(getPlatformInfo());
|
|
411
|
+
setDisplay(getDisplayInfo());
|
|
412
|
+
setAccessibility(accessibilitySettings);
|
|
413
|
+
const currentColorScheme = Appearance.getColorScheme() ?? null;
|
|
414
|
+
setAppearance({
|
|
415
|
+
colorScheme: currentColorScheme,
|
|
416
|
+
prefersDarkMode: currentColorScheme === "dark"
|
|
417
|
+
});
|
|
418
|
+
setLocale(getLocaleInfo());
|
|
419
|
+
setStatusBar((prev) => ({
|
|
420
|
+
...prev,
|
|
421
|
+
height: statusBarHeight
|
|
422
|
+
}));
|
|
423
|
+
setIdentifiers(getUniqueIdentifiers());
|
|
424
|
+
setSettings(getSettingsInfo());
|
|
425
|
+
setTimestamp(Date.now());
|
|
426
|
+
setIsLoading(false);
|
|
427
|
+
}, []);
|
|
428
|
+
useEffect4(() => {
|
|
429
|
+
refresh();
|
|
430
|
+
}, [refresh]);
|
|
431
|
+
useEffect4(() => {
|
|
432
|
+
const subscription = Dimensions.addEventListener(
|
|
433
|
+
"change",
|
|
434
|
+
({ window, screen }) => {
|
|
435
|
+
setDisplay((prev) => ({
|
|
436
|
+
...prev,
|
|
437
|
+
window: {
|
|
438
|
+
width: window.width,
|
|
439
|
+
height: window.height,
|
|
440
|
+
scale: window.scale,
|
|
441
|
+
fontScale: window.fontScale
|
|
442
|
+
},
|
|
443
|
+
screen: {
|
|
444
|
+
width: screen.width,
|
|
445
|
+
height: screen.height,
|
|
446
|
+
scale: screen.scale,
|
|
447
|
+
fontScale: screen.fontScale
|
|
448
|
+
},
|
|
449
|
+
isLandscape: window.width > window.height,
|
|
450
|
+
isPortrait: window.height > window.width
|
|
451
|
+
}));
|
|
452
|
+
}
|
|
453
|
+
);
|
|
454
|
+
return () => subscription.remove();
|
|
455
|
+
}, []);
|
|
456
|
+
useEffect4(() => {
|
|
457
|
+
const subscription = Appearance.addChangeListener(({ colorScheme }) => {
|
|
458
|
+
const scheme = colorScheme ?? null;
|
|
459
|
+
setAppearance({
|
|
460
|
+
colorScheme: scheme,
|
|
461
|
+
prefersDarkMode: scheme === "dark"
|
|
462
|
+
});
|
|
463
|
+
});
|
|
464
|
+
return () => subscription.remove();
|
|
465
|
+
}, []);
|
|
466
|
+
useEffect4(() => {
|
|
467
|
+
const showListener = Keyboard.addListener(
|
|
468
|
+
Platform.OS === "ios" ? "keyboardWillShow" : "keyboardDidShow",
|
|
469
|
+
(event) => {
|
|
470
|
+
setKeyboard({
|
|
471
|
+
isVisible: true,
|
|
472
|
+
height: event.endCoordinates.height,
|
|
473
|
+
animationDuration: event.duration ?? 0
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
);
|
|
477
|
+
const hideListener = Keyboard.addListener(
|
|
478
|
+
Platform.OS === "ios" ? "keyboardWillHide" : "keyboardDidHide",
|
|
479
|
+
(event) => {
|
|
480
|
+
setKeyboard({
|
|
481
|
+
isVisible: false,
|
|
482
|
+
height: 0,
|
|
483
|
+
animationDuration: event.duration ?? 0
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
);
|
|
487
|
+
return () => {
|
|
488
|
+
showListener.remove();
|
|
489
|
+
hideListener.remove();
|
|
490
|
+
};
|
|
491
|
+
}, []);
|
|
492
|
+
useEffect4(() => {
|
|
493
|
+
const subscription = AppState.addEventListener("change", (nextState) => {
|
|
494
|
+
setAppStateInfo({
|
|
495
|
+
currentState: nextState,
|
|
496
|
+
isActive: nextState === "active"
|
|
497
|
+
});
|
|
498
|
+
});
|
|
499
|
+
return () => subscription.remove();
|
|
500
|
+
}, []);
|
|
501
|
+
useEffect4(() => {
|
|
502
|
+
const listeners = [
|
|
503
|
+
AccessibilityInfo.addEventListener("screenReaderChanged", (isEnabled) => {
|
|
504
|
+
setAccessibility((prev) => ({
|
|
505
|
+
...prev,
|
|
506
|
+
isScreenReaderEnabled: isEnabled
|
|
507
|
+
}));
|
|
508
|
+
}),
|
|
509
|
+
AccessibilityInfo.addEventListener("reduceMotionChanged", (isEnabled) => {
|
|
510
|
+
setAccessibility((prev) => ({
|
|
511
|
+
...prev,
|
|
512
|
+
isReduceMotionEnabled: isEnabled
|
|
513
|
+
}));
|
|
514
|
+
}),
|
|
515
|
+
AccessibilityInfo.addEventListener(
|
|
516
|
+
"reduceTransparencyChanged",
|
|
517
|
+
(isEnabled) => {
|
|
518
|
+
setAccessibility((prev) => ({
|
|
519
|
+
...prev,
|
|
520
|
+
isReduceTransparencyEnabled: isEnabled
|
|
521
|
+
}));
|
|
522
|
+
}
|
|
523
|
+
)
|
|
524
|
+
];
|
|
525
|
+
if (Platform.OS === "ios") {
|
|
526
|
+
const addIOSListener = (eventName, handler) => {
|
|
527
|
+
return AccessibilityInfo.addEventListener(eventName, handler);
|
|
528
|
+
};
|
|
529
|
+
listeners.push(
|
|
530
|
+
addIOSListener("boldTextChanged", (isEnabled) => {
|
|
531
|
+
setAccessibility((prev) => ({
|
|
532
|
+
...prev,
|
|
533
|
+
isBoldTextEnabled: isEnabled
|
|
534
|
+
}));
|
|
535
|
+
}),
|
|
536
|
+
addIOSListener("grayscaleChanged", (isEnabled) => {
|
|
537
|
+
setAccessibility((prev) => ({
|
|
538
|
+
...prev,
|
|
539
|
+
isGrayscaleEnabled: isEnabled
|
|
540
|
+
}));
|
|
541
|
+
}),
|
|
542
|
+
addIOSListener("invertColorsChanged", (isEnabled) => {
|
|
543
|
+
setAccessibility((prev) => ({
|
|
544
|
+
...prev,
|
|
545
|
+
isInvertColorsEnabled: isEnabled
|
|
546
|
+
}));
|
|
547
|
+
})
|
|
548
|
+
);
|
|
549
|
+
}
|
|
550
|
+
return () => {
|
|
551
|
+
listeners.forEach((listener) => listener.remove());
|
|
552
|
+
};
|
|
553
|
+
}, []);
|
|
554
|
+
const deviceInfo = {
|
|
555
|
+
platform,
|
|
556
|
+
display,
|
|
557
|
+
accessibility,
|
|
558
|
+
appearance,
|
|
559
|
+
locale,
|
|
560
|
+
statusBar,
|
|
561
|
+
keyboard,
|
|
562
|
+
appState: appStateInfo,
|
|
563
|
+
identifiers,
|
|
564
|
+
settings,
|
|
565
|
+
timestamp,
|
|
566
|
+
isLoading,
|
|
567
|
+
refresh,
|
|
568
|
+
generateFingerprint: () => generateFingerprint({
|
|
569
|
+
platform,
|
|
570
|
+
display,
|
|
571
|
+
accessibility,
|
|
572
|
+
appearance,
|
|
573
|
+
locale,
|
|
574
|
+
statusBar,
|
|
575
|
+
keyboard,
|
|
576
|
+
appState: appStateInfo,
|
|
577
|
+
identifiers,
|
|
578
|
+
settings,
|
|
579
|
+
timestamp,
|
|
580
|
+
isLoading
|
|
581
|
+
})
|
|
582
|
+
};
|
|
583
|
+
return deviceInfo;
|
|
584
|
+
}
|
|
585
|
+
async function getDeviceInfo() {
|
|
586
|
+
const [accessibilitySettings, statusBarHeight] = await Promise.all([
|
|
587
|
+
getAccessibilitySettings(),
|
|
588
|
+
getStatusBarHeight()
|
|
589
|
+
]);
|
|
590
|
+
const colorScheme = Appearance.getColorScheme() ?? null;
|
|
591
|
+
return {
|
|
592
|
+
platform: getPlatformInfo(),
|
|
593
|
+
display: getDisplayInfo(),
|
|
594
|
+
accessibility: accessibilitySettings,
|
|
595
|
+
appearance: {
|
|
596
|
+
colorScheme,
|
|
597
|
+
prefersDarkMode: colorScheme === "dark"
|
|
598
|
+
},
|
|
599
|
+
locale: getLocaleInfo(),
|
|
600
|
+
statusBar: {
|
|
601
|
+
height: statusBarHeight,
|
|
602
|
+
isVisible: true
|
|
603
|
+
},
|
|
604
|
+
keyboard: {
|
|
605
|
+
isVisible: false,
|
|
606
|
+
height: 0,
|
|
607
|
+
animationDuration: 0
|
|
608
|
+
},
|
|
609
|
+
appState: {
|
|
610
|
+
currentState: AppState.currentState,
|
|
611
|
+
isActive: AppState.currentState === "active"
|
|
612
|
+
},
|
|
613
|
+
identifiers: getUniqueIdentifiers(),
|
|
614
|
+
settings: getSettingsInfo(),
|
|
615
|
+
timestamp: Date.now(),
|
|
616
|
+
isLoading: false
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
function logDeviceInfo(info) {
|
|
620
|
+
console.log("\n========================================");
|
|
621
|
+
console.log(" DEVICE INFO REPORT");
|
|
622
|
+
console.log("========================================\n");
|
|
623
|
+
console.log("--- PLATFORM ---");
|
|
624
|
+
console.log(JSON.stringify(info.platform, null, 2));
|
|
625
|
+
console.log("\n--- DISPLAY ---");
|
|
626
|
+
console.log(JSON.stringify(info.display, null, 2));
|
|
627
|
+
console.log("\n--- ACCESSIBILITY ---");
|
|
628
|
+
console.log(JSON.stringify(info.accessibility, null, 2));
|
|
629
|
+
console.log("\n--- APPEARANCE ---");
|
|
630
|
+
console.log(JSON.stringify(info.appearance, null, 2));
|
|
631
|
+
console.log("\n--- LOCALE ---");
|
|
632
|
+
console.log(JSON.stringify(info.locale, null, 2));
|
|
633
|
+
console.log("\n--- STATUS BAR ---");
|
|
634
|
+
console.log(JSON.stringify(info.statusBar, null, 2));
|
|
635
|
+
console.log("\n--- KEYBOARD ---");
|
|
636
|
+
console.log(JSON.stringify(info.keyboard, null, 2));
|
|
637
|
+
console.log("\n--- APP STATE ---");
|
|
638
|
+
console.log(JSON.stringify(info.appState, null, 2));
|
|
639
|
+
console.log("\n--- IDENTIFIERS ---");
|
|
640
|
+
console.log(JSON.stringify(info.identifiers, null, 2));
|
|
641
|
+
console.log("\n--- SETTINGS ---");
|
|
642
|
+
const settingsKeys = Object.keys(info.settings.userDefaults ?? {});
|
|
643
|
+
console.log(`userDefaults: ${settingsKeys.length} keys`);
|
|
644
|
+
if (settingsKeys.length > 0 && settingsKeys.length <= 20) {
|
|
645
|
+
console.log(JSON.stringify(info.settings, null, 2));
|
|
646
|
+
}
|
|
647
|
+
console.log("\n--- METADATA ---");
|
|
648
|
+
console.log(`timestamp: ${info.timestamp}`);
|
|
649
|
+
console.log(`isLoading: ${info.isLoading}`);
|
|
650
|
+
console.log("\n========================================\n");
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
export {
|
|
654
|
+
usePersistedState,
|
|
655
|
+
resetPersistedStateCache,
|
|
656
|
+
useChangeLog,
|
|
657
|
+
useSubscribedValue,
|
|
658
|
+
useEventStoreEvents,
|
|
659
|
+
useDeviceInfo,
|
|
660
|
+
getDeviceInfo,
|
|
661
|
+
logDeviceInfo
|
|
662
|
+
};
|