@buoy-gg/react-query 1.7.2
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 +389 -0
- package/lib/commonjs/index.js +107 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/preset.js +220 -0
- package/lib/commonjs/react-query/ReactQueryDevTools.js +335 -0
- package/lib/commonjs/react-query/components/DataEditorMode.js +316 -0
- package/lib/commonjs/react-query/components/FilterStatusBadge.js +51 -0
- package/lib/commonjs/react-query/components/MutationBrowserMode.js +51 -0
- package/lib/commonjs/react-query/components/MutationEditorMode.js +257 -0
- package/lib/commonjs/react-query/components/QueryBrowserMode.js +82 -0
- package/lib/commonjs/react-query/components/QueryDebugInfo.js +107 -0
- package/lib/commonjs/react-query/components/QueryFilterViewV3.js +221 -0
- package/lib/commonjs/react-query/components/QuerySelector.js +208 -0
- package/lib/commonjs/react-query/components/ReactQueryDevToolsModal.js +76 -0
- package/lib/commonjs/react-query/components/ReactQuerySection.js +47 -0
- package/lib/commonjs/react-query/components/WifiToggle.js +49 -0
- package/lib/commonjs/react-query/components/index.js +253 -0
- package/lib/commonjs/react-query/components/modals/DataEditorModal.js +70 -0
- package/lib/commonjs/react-query/components/modals/MutationBrowserFooter.js +69 -0
- package/lib/commonjs/react-query/components/modals/MutationBrowserModal.js +146 -0
- package/lib/commonjs/react-query/components/modals/MutationEditorModal.js +58 -0
- package/lib/commonjs/react-query/components/modals/QueryBrowserFooter.js +63 -0
- package/lib/commonjs/react-query/components/modals/QueryBrowserModal.js +237 -0
- package/lib/commonjs/react-query/components/modals/ReactQueryModal.js +83 -0
- package/lib/commonjs/react-query/components/modals/ReactQueryModalHeader.js +171 -0
- package/lib/commonjs/react-query/components/modals/SwipeIndicator.js +204 -0
- package/lib/commonjs/react-query/components/query-browser/ActionButton.js +127 -0
- package/lib/commonjs/react-query/components/query-browser/ClearCacheButton.js +53 -0
- package/lib/commonjs/react-query/components/query-browser/Explorer.js +985 -0
- package/lib/commonjs/react-query/components/query-browser/MutationButton.js +184 -0
- package/lib/commonjs/react-query/components/query-browser/MutationDetails.js +122 -0
- package/lib/commonjs/react-query/components/query-browser/MutationDetailsChips.js +66 -0
- package/lib/commonjs/react-query/components/query-browser/MutationInformation.js +117 -0
- package/lib/commonjs/react-query/components/query-browser/MutationStatusCount.js +111 -0
- package/lib/commonjs/react-query/components/query-browser/MutationsList.js +212 -0
- package/lib/commonjs/react-query/components/query-browser/NetworkToggleButton.js +54 -0
- package/lib/commonjs/react-query/components/query-browser/QueryActions.js +138 -0
- package/lib/commonjs/react-query/components/query-browser/QueryBrowser.js +146 -0
- package/lib/commonjs/react-query/components/query-browser/QueryDetails.js +137 -0
- package/lib/commonjs/react-query/components/query-browser/QueryDetailsChip.js +76 -0
- package/lib/commonjs/react-query/components/query-browser/QueryInformation.js +94 -0
- package/lib/commonjs/react-query/components/query-browser/QueryRow.js +93 -0
- package/lib/commonjs/react-query/components/query-browser/QueryStatus.js +125 -0
- package/lib/commonjs/react-query/components/query-browser/QueryStatusCount.js +130 -0
- package/lib/commonjs/react-query/components/query-browser/StorageStatusCount.js +106 -0
- package/lib/commonjs/react-query/components/query-browser/index.js +170 -0
- package/lib/commonjs/react-query/components/query-browser/svgs.js +74 -0
- package/lib/commonjs/react-query/hooks/index.js +96 -0
- package/lib/commonjs/react-query/hooks/useActionButtons.js +59 -0
- package/lib/commonjs/react-query/hooks/useAllMutations.js +35 -0
- package/lib/commonjs/react-query/hooks/useAllQueries.js +117 -0
- package/lib/commonjs/react-query/hooks/useModalManager.js +178 -0
- package/lib/commonjs/react-query/hooks/useModalPersistence.js +71 -0
- package/lib/commonjs/react-query/hooks/useMutationActionButtons.js +22 -0
- package/lib/commonjs/react-query/hooks/useQueryStatusCounts.js +110 -0
- package/lib/commonjs/react-query/hooks/useReactQueryState.js +24 -0
- package/lib/commonjs/react-query/hooks/useSelectedMutation.js +30 -0
- package/lib/commonjs/react-query/hooks/useSelectedQuery.js +96 -0
- package/lib/commonjs/react-query/hooks/useStorageQueryCounts.js +28 -0
- package/lib/commonjs/react-query/hooks/useWifiState.js +67 -0
- package/lib/commonjs/react-query/index.js +16 -0
- package/lib/commonjs/react-query/types/index.js +16 -0
- package/lib/commonjs/react-query/types/types.js +14 -0
- package/lib/commonjs/react-query/utils/actions/deleteItem.js +23 -0
- package/lib/commonjs/react-query/utils/actions/invalidate.js +13 -0
- package/lib/commonjs/react-query/utils/actions/refetch.js +15 -0
- package/lib/commonjs/react-query/utils/actions/remove.js +12 -0
- package/lib/commonjs/react-query/utils/actions/reset.js +15 -0
- package/lib/commonjs/react-query/utils/actions/triggerError.js +30 -0
- package/lib/commonjs/react-query/utils/actions/triggerLoading.js +51 -0
- package/lib/commonjs/react-query/utils/deleteNestedDataByPath.js +56 -0
- package/lib/commonjs/react-query/utils/formatRelativeTime.js +29 -0
- package/lib/commonjs/react-query/utils/getQueryStatusColor.js +16 -0
- package/lib/commonjs/react-query/utils/getQueryStatusLabel.js +17 -0
- package/lib/commonjs/react-query/utils/getStorageQueryCounts.js +35 -0
- package/lib/commonjs/react-query/utils/index.js +170 -0
- package/lib/commonjs/react-query/utils/modalStorageOperations.js +127 -0
- package/lib/commonjs/react-query/utils/storageQueryUtils.js +149 -0
- package/lib/commonjs/react-query/utils/updateNestedDataByPath.js +61 -0
- package/lib/module/index.js +19 -0
- package/lib/module/preset.js +216 -0
- package/lib/module/react-query/ReactQueryDevTools.js +68 -0
- package/lib/module/react-query/components/DataEditorMode.js +310 -0
- package/lib/module/react-query/components/FilterStatusBadge.js +47 -0
- package/lib/module/react-query/components/MutationBrowserMode.js +46 -0
- package/lib/module/react-query/components/MutationEditorMode.js +252 -0
- package/lib/module/react-query/components/QueryBrowserMode.js +77 -0
- package/lib/module/react-query/components/QueryDebugInfo.js +104 -0
- package/lib/module/react-query/components/QueryFilterViewV3.js +218 -0
- package/lib/module/react-query/components/QuerySelector.js +204 -0
- package/lib/module/react-query/components/ReactQueryDevToolsModal.js +72 -0
- package/lib/module/react-query/components/ReactQuerySection.js +43 -0
- package/lib/module/react-query/components/WifiToggle.js +46 -0
- package/lib/module/react-query/components/index.js +29 -0
- package/lib/module/react-query/components/modals/DataEditorModal.js +66 -0
- package/lib/module/react-query/components/modals/MutationBrowserFooter.js +64 -0
- package/lib/module/react-query/components/modals/MutationBrowserModal.js +143 -0
- package/lib/module/react-query/components/modals/MutationEditorModal.js +54 -0
- package/lib/module/react-query/components/modals/QueryBrowserFooter.js +58 -0
- package/lib/module/react-query/components/modals/QueryBrowserModal.js +233 -0
- package/lib/module/react-query/components/modals/ReactQueryModal.js +79 -0
- package/lib/module/react-query/components/modals/ReactQueryModalHeader.js +167 -0
- package/lib/module/react-query/components/modals/SwipeIndicator.js +200 -0
- package/lib/module/react-query/components/query-browser/ActionButton.js +124 -0
- package/lib/module/react-query/components/query-browser/ClearCacheButton.js +49 -0
- package/lib/module/react-query/components/query-browser/Explorer.js +983 -0
- package/lib/module/react-query/components/query-browser/MutationButton.js +180 -0
- package/lib/module/react-query/components/query-browser/MutationDetails.js +117 -0
- package/lib/module/react-query/components/query-browser/MutationDetailsChips.js +62 -0
- package/lib/module/react-query/components/query-browser/MutationInformation.js +112 -0
- package/lib/module/react-query/components/query-browser/MutationStatusCount.js +106 -0
- package/lib/module/react-query/components/query-browser/MutationsList.js +207 -0
- package/lib/module/react-query/components/query-browser/NetworkToggleButton.js +50 -0
- package/lib/module/react-query/components/query-browser/QueryActions.js +133 -0
- package/lib/module/react-query/components/query-browser/QueryBrowser.js +141 -0
- package/lib/module/react-query/components/query-browser/QueryDetails.js +132 -0
- package/lib/module/react-query/components/query-browser/QueryDetailsChip.js +72 -0
- package/lib/module/react-query/components/query-browser/QueryInformation.js +89 -0
- package/lib/module/react-query/components/query-browser/QueryRow.js +89 -0
- package/lib/module/react-query/components/query-browser/QueryStatus.js +121 -0
- package/lib/module/react-query/components/query-browser/QueryStatusCount.js +125 -0
- package/lib/module/react-query/components/query-browser/StorageStatusCount.js +101 -0
- package/lib/module/react-query/components/query-browser/index.js +22 -0
- package/lib/module/react-query/components/query-browser/svgs.js +66 -0
- package/lib/module/react-query/hooks/index.js +23 -0
- package/lib/module/react-query/hooks/useActionButtons.js +54 -0
- package/lib/module/react-query/hooks/useAllMutations.js +32 -0
- package/lib/module/react-query/hooks/useAllQueries.js +114 -0
- package/lib/module/react-query/hooks/useModalManager.js +175 -0
- package/lib/module/react-query/hooks/useModalPersistence.js +67 -0
- package/lib/module/react-query/hooks/useMutationActionButtons.js +18 -0
- package/lib/module/react-query/hooks/useQueryStatusCounts.js +108 -0
- package/lib/module/react-query/hooks/useReactQueryState.js +20 -0
- package/lib/module/react-query/hooks/useSelectedMutation.js +27 -0
- package/lib/module/react-query/hooks/useSelectedQuery.js +92 -0
- package/lib/module/react-query/hooks/useStorageQueryCounts.js +25 -0
- package/lib/module/react-query/hooks/useWifiState.js +64 -0
- package/lib/module/react-query/index.js +3 -0
- package/lib/module/react-query/types/index.js +3 -0
- package/lib/module/react-query/types/types.js +10 -0
- package/lib/module/react-query/utils/actions/deleteItem.js +19 -0
- package/lib/module/react-query/utils/actions/invalidate.js +9 -0
- package/lib/module/react-query/utils/actions/refetch.js +11 -0
- package/lib/module/react-query/utils/actions/remove.js +8 -0
- package/lib/module/react-query/utils/actions/reset.js +11 -0
- package/lib/module/react-query/utils/actions/triggerError.js +26 -0
- package/lib/module/react-query/utils/actions/triggerLoading.js +47 -0
- package/lib/module/react-query/utils/deleteNestedDataByPath.js +51 -0
- package/lib/module/react-query/utils/formatRelativeTime.js +25 -0
- package/lib/module/react-query/utils/getQueryStatusColor.js +12 -0
- package/lib/module/react-query/utils/getQueryStatusLabel.js +13 -0
- package/lib/module/react-query/utils/getStorageQueryCounts.js +31 -0
- package/lib/module/react-query/utils/index.js +27 -0
- package/lib/module/react-query/utils/modalStorageOperations.js +117 -0
- package/lib/module/react-query/utils/storageQueryUtils.js +140 -0
- package/lib/module/react-query/utils/updateNestedDataByPath.js +56 -0
- package/lib/typescript/index.d.ts +7 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/preset.d.ts +160 -0
- package/lib/typescript/preset.d.ts.map +1 -0
- package/lib/typescript/react-query/ReactQueryDevTools.d.ts +45 -0
- package/lib/typescript/react-query/ReactQueryDevTools.d.ts.map +1 -0
- package/lib/typescript/react-query/components/DataEditorMode.d.ts +25 -0
- package/lib/typescript/react-query/components/DataEditorMode.d.ts.map +1 -0
- package/lib/typescript/react-query/components/FilterStatusBadge.d.ts +12 -0
- package/lib/typescript/react-query/components/FilterStatusBadge.d.ts.map +1 -0
- package/lib/typescript/react-query/components/MutationBrowserMode.d.ts +14 -0
- package/lib/typescript/react-query/components/MutationBrowserMode.d.ts.map +1 -0
- package/lib/typescript/react-query/components/MutationEditorMode.d.ts +12 -0
- package/lib/typescript/react-query/components/MutationEditorMode.d.ts.map +1 -0
- package/lib/typescript/react-query/components/QueryBrowserMode.d.ts +14 -0
- package/lib/typescript/react-query/components/QueryBrowserMode.d.ts.map +1 -0
- package/lib/typescript/react-query/components/QueryDebugInfo.d.ts +6 -0
- package/lib/typescript/react-query/components/QueryDebugInfo.d.ts.map +1 -0
- package/lib/typescript/react-query/components/QueryFilterViewV3.d.ts +17 -0
- package/lib/typescript/react-query/components/QueryFilterViewV3.d.ts.map +1 -0
- package/lib/typescript/react-query/components/QuerySelector.d.ts +15 -0
- package/lib/typescript/react-query/components/QuerySelector.d.ts.map +1 -0
- package/lib/typescript/react-query/components/ReactQueryDevToolsModal.d.ts +19 -0
- package/lib/typescript/react-query/components/ReactQueryDevToolsModal.d.ts.map +1 -0
- package/lib/typescript/react-query/components/ReactQuerySection.d.ts +11 -0
- package/lib/typescript/react-query/components/ReactQuerySection.d.ts.map +1 -0
- package/lib/typescript/react-query/components/WifiToggle.d.ts +8 -0
- package/lib/typescript/react-query/components/WifiToggle.d.ts.map +1 -0
- package/lib/typescript/react-query/components/index.d.ts +21 -0
- package/lib/typescript/react-query/components/index.d.ts.map +1 -0
- package/lib/typescript/react-query/components/modals/DataEditorModal.d.ts +17 -0
- package/lib/typescript/react-query/components/modals/DataEditorModal.d.ts.map +1 -0
- package/lib/typescript/react-query/components/modals/MutationBrowserFooter.d.ts +17 -0
- package/lib/typescript/react-query/components/modals/MutationBrowserFooter.d.ts.map +1 -0
- package/lib/typescript/react-query/components/modals/MutationBrowserModal.d.ts +21 -0
- package/lib/typescript/react-query/components/modals/MutationBrowserModal.d.ts.map +1 -0
- package/lib/typescript/react-query/components/modals/MutationEditorModal.d.ts +17 -0
- package/lib/typescript/react-query/components/modals/MutationEditorModal.d.ts.map +1 -0
- package/lib/typescript/react-query/components/modals/QueryBrowserFooter.d.ts +16 -0
- package/lib/typescript/react-query/components/modals/QueryBrowserFooter.d.ts.map +1 -0
- package/lib/typescript/react-query/components/modals/QueryBrowserModal.d.ts +21 -0
- package/lib/typescript/react-query/components/modals/QueryBrowserModal.d.ts.map +1 -0
- package/lib/typescript/react-query/components/modals/ReactQueryModal.d.ts +29 -0
- package/lib/typescript/react-query/components/modals/ReactQueryModal.d.ts.map +1 -0
- package/lib/typescript/react-query/components/modals/ReactQueryModalHeader.d.ts +19 -0
- package/lib/typescript/react-query/components/modals/ReactQueryModalHeader.d.ts.map +1 -0
- package/lib/typescript/react-query/components/modals/SwipeIndicator.d.ts +14 -0
- package/lib/typescript/react-query/components/modals/SwipeIndicator.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/ActionButton.d.ts +49 -0
- package/lib/typescript/react-query/components/query-browser/ActionButton.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/ClearCacheButton.d.ts +12 -0
- package/lib/typescript/react-query/components/query-browser/ClearCacheButton.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/Explorer.d.ts +19 -0
- package/lib/typescript/react-query/components/query-browser/Explorer.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/MutationButton.d.ts +12 -0
- package/lib/typescript/react-query/components/query-browser/MutationButton.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/MutationDetails.d.ts +10 -0
- package/lib/typescript/react-query/components/query-browser/MutationDetails.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/MutationDetailsChips.d.ts +10 -0
- package/lib/typescript/react-query/components/query-browser/MutationDetailsChips.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/MutationInformation.d.ts +8 -0
- package/lib/typescript/react-query/components/query-browser/MutationInformation.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/MutationStatusCount.d.ts +12 -0
- package/lib/typescript/react-query/components/query-browser/MutationStatusCount.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/MutationsList.d.ts +17 -0
- package/lib/typescript/react-query/components/query-browser/MutationsList.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/NetworkToggleButton.d.ts +11 -0
- package/lib/typescript/react-query/components/query-browser/NetworkToggleButton.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/QueryActions.d.ts +12 -0
- package/lib/typescript/react-query/components/query-browser/QueryActions.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/QueryBrowser.d.ts +19 -0
- package/lib/typescript/react-query/components/query-browser/QueryBrowser.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/QueryDetails.d.ts +10 -0
- package/lib/typescript/react-query/components/query-browser/QueryDetails.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/QueryDetailsChip.d.ts +10 -0
- package/lib/typescript/react-query/components/query-browser/QueryDetailsChip.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/QueryInformation.d.ts +12 -0
- package/lib/typescript/react-query/components/query-browser/QueryInformation.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/QueryRow.d.ts +12 -0
- package/lib/typescript/react-query/components/query-browser/QueryRow.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/QueryStatus.d.ts +17 -0
- package/lib/typescript/react-query/components/query-browser/QueryStatus.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/QueryStatusCount.d.ts +11 -0
- package/lib/typescript/react-query/components/query-browser/QueryStatusCount.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/StorageStatusCount.d.ts +18 -0
- package/lib/typescript/react-query/components/query-browser/StorageStatusCount.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/index.d.ts +21 -0
- package/lib/typescript/react-query/components/query-browser/index.d.ts.map +1 -0
- package/lib/typescript/react-query/components/query-browser/svgs.d.ts +17 -0
- package/lib/typescript/react-query/components/query-browser/svgs.d.ts.map +1 -0
- package/lib/typescript/react-query/hooks/index.d.ts +13 -0
- package/lib/typescript/react-query/hooks/index.d.ts.map +1 -0
- package/lib/typescript/react-query/hooks/useActionButtons.d.ts +21 -0
- package/lib/typescript/react-query/hooks/useActionButtons.d.ts.map +1 -0
- package/lib/typescript/react-query/hooks/useAllMutations.d.ts +10 -0
- package/lib/typescript/react-query/hooks/useAllMutations.d.ts.map +1 -0
- package/lib/typescript/react-query/hooks/useAllQueries.d.ts +12 -0
- package/lib/typescript/react-query/hooks/useAllQueries.d.ts.map +1 -0
- package/lib/typescript/react-query/hooks/useModalManager.d.ts +39 -0
- package/lib/typescript/react-query/hooks/useModalManager.d.ts.map +1 -0
- package/lib/typescript/react-query/hooks/useModalPersistence.d.ts +29 -0
- package/lib/typescript/react-query/hooks/useModalPersistence.d.ts.map +1 -0
- package/lib/typescript/react-query/hooks/useMutationActionButtons.d.ts +15 -0
- package/lib/typescript/react-query/hooks/useMutationActionButtons.d.ts.map +1 -0
- package/lib/typescript/react-query/hooks/useQueryStatusCounts.d.ts +25 -0
- package/lib/typescript/react-query/hooks/useQueryStatusCounts.d.ts.map +1 -0
- package/lib/typescript/react-query/hooks/useReactQueryState.d.ts +9 -0
- package/lib/typescript/react-query/hooks/useReactQueryState.d.ts.map +1 -0
- package/lib/typescript/react-query/hooks/useSelectedMutation.d.ts +7 -0
- package/lib/typescript/react-query/hooks/useSelectedMutation.d.ts.map +1 -0
- package/lib/typescript/react-query/hooks/useSelectedQuery.d.ts +25 -0
- package/lib/typescript/react-query/hooks/useSelectedQuery.d.ts.map +1 -0
- package/lib/typescript/react-query/hooks/useStorageQueryCounts.d.ts +10 -0
- package/lib/typescript/react-query/hooks/useStorageQueryCounts.d.ts.map +1 -0
- package/lib/typescript/react-query/hooks/useWifiState.d.ts +9 -0
- package/lib/typescript/react-query/hooks/useWifiState.d.ts.map +1 -0
- package/lib/typescript/react-query/index.d.ts +2 -0
- package/lib/typescript/react-query/index.d.ts.map +1 -0
- package/lib/typescript/react-query/types/index.d.ts +2 -0
- package/lib/typescript/react-query/types/index.d.ts.map +1 -0
- package/lib/typescript/react-query/types/types.d.ts +10 -0
- package/lib/typescript/react-query/types/types.d.ts.map +1 -0
- package/lib/typescript/react-query/utils/actions/deleteItem.d.ts +9 -0
- package/lib/typescript/react-query/utils/actions/deleteItem.d.ts.map +1 -0
- package/lib/typescript/react-query/utils/actions/invalidate.d.ts +8 -0
- package/lib/typescript/react-query/utils/actions/invalidate.d.ts.map +1 -0
- package/lib/typescript/react-query/utils/actions/refetch.d.ts +7 -0
- package/lib/typescript/react-query/utils/actions/refetch.d.ts.map +1 -0
- package/lib/typescript/react-query/utils/actions/remove.d.ts +8 -0
- package/lib/typescript/react-query/utils/actions/remove.d.ts.map +1 -0
- package/lib/typescript/react-query/utils/actions/reset.d.ts +8 -0
- package/lib/typescript/react-query/utils/actions/reset.d.ts.map +1 -0
- package/lib/typescript/react-query/utils/actions/triggerError.d.ts +8 -0
- package/lib/typescript/react-query/utils/actions/triggerError.d.ts.map +1 -0
- package/lib/typescript/react-query/utils/actions/triggerLoading.d.ts +7 -0
- package/lib/typescript/react-query/utils/actions/triggerLoading.d.ts.map +1 -0
- package/lib/typescript/react-query/utils/deleteNestedDataByPath.d.ts +9 -0
- package/lib/typescript/react-query/utils/deleteNestedDataByPath.d.ts.map +1 -0
- package/lib/typescript/react-query/utils/formatRelativeTime.d.ts +7 -0
- package/lib/typescript/react-query/utils/formatRelativeTime.d.ts.map +1 -0
- package/lib/typescript/react-query/utils/getQueryStatusColor.d.ts +10 -0
- package/lib/typescript/react-query/utils/getQueryStatusColor.d.ts.map +1 -0
- package/lib/typescript/react-query/utils/getQueryStatusLabel.d.ts +9 -0
- package/lib/typescript/react-query/utils/getQueryStatusLabel.d.ts.map +1 -0
- package/lib/typescript/react-query/utils/getStorageQueryCounts.d.ts +13 -0
- package/lib/typescript/react-query/utils/getStorageQueryCounts.d.ts.map +1 -0
- package/lib/typescript/react-query/utils/index.d.ts +17 -0
- package/lib/typescript/react-query/utils/index.d.ts.map +1 -0
- package/lib/typescript/react-query/utils/modalStorageOperations.d.ts +55 -0
- package/lib/typescript/react-query/utils/modalStorageOperations.d.ts.map +1 -0
- package/lib/typescript/react-query/utils/storageQueryUtils.d.ts +69 -0
- package/lib/typescript/react-query/utils/storageQueryUtils.d.ts.map +1 -0
- package/lib/typescript/react-query/utils/updateNestedDataByPath.d.ts +10 -0
- package/lib/typescript/react-query/utils/updateNestedDataByPath.d.ts.map +1 -0
- package/package.json +68 -0
package/README.md
ADDED
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
# @buoy/react-query
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@buoy/react-query)
|
|
4
|
+
|
|
5
|
+
React Query (TanStack Query) devtools modal for React Native development.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Query Inspector**: Browse and inspect all queries in your app
|
|
10
|
+
- **Mutation Tracking**: Monitor mutations and their states
|
|
11
|
+
- **Cache Inspection**: View and manipulate the React Query cache
|
|
12
|
+
- **Query Invalidation**: Invalidate queries directly from the UI
|
|
13
|
+
- **Refetch Control**: Manually trigger query refetches
|
|
14
|
+
- **Filter & Search**: Filter queries by status, search by key
|
|
15
|
+
- **WiFi Toggle**: Simulate offline mode to test query behavior
|
|
16
|
+
- **Performance Monitoring**: Track query timings and performance
|
|
17
|
+
- **Beautiful UI**: Modern, game-themed interface matching other React Buoy tools
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
This package is part of the React Buoy monorepo and is automatically available to other packages and the example app.
|
|
22
|
+
|
|
23
|
+
For external projects:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install @buoy/react-query @tanstack/react-query
|
|
27
|
+
# or
|
|
28
|
+
pnpm add @buoy/react-query @tanstack/react-query
|
|
29
|
+
# or
|
|
30
|
+
yarn add @buoy/react-query @tanstack/react-query
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Quick Start
|
|
34
|
+
|
|
35
|
+
### Simplest Setup - Just 1 Line!
|
|
36
|
+
|
|
37
|
+
**Import the preset and add it to your tools array. Done!**
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import { reactQueryToolPreset } from '@buoy/react-query';
|
|
41
|
+
import { FloatingDevTools } from '@buoy/core';
|
|
42
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
43
|
+
|
|
44
|
+
const queryClient = new QueryClient();
|
|
45
|
+
|
|
46
|
+
const installedApps = [
|
|
47
|
+
reactQueryToolPreset, // That's it! One line.
|
|
48
|
+
// ...your other tools
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
function App() {
|
|
52
|
+
return (
|
|
53
|
+
<QueryClientProvider client={queryClient}>
|
|
54
|
+
<FloatingDevTools
|
|
55
|
+
apps={installedApps}
|
|
56
|
+
environment="local"
|
|
57
|
+
userRole="admin"
|
|
58
|
+
/>
|
|
59
|
+
<YourAppContent />
|
|
60
|
+
</QueryClientProvider>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Done!** The preset automatically:
|
|
66
|
+
- ✅ Inspects all queries and mutations
|
|
67
|
+
- ✅ Provides cache manipulation tools
|
|
68
|
+
- ✅ Includes WiFi toggle for offline testing
|
|
69
|
+
- ✅ No configuration required
|
|
70
|
+
|
|
71
|
+
### Custom Configuration
|
|
72
|
+
|
|
73
|
+
If you want to customize the appearance:
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
import { createReactQueryTool } from '@buoy/react-query';
|
|
77
|
+
|
|
78
|
+
const myQueryTool = createReactQueryTool({
|
|
79
|
+
name: "TANSTACK",
|
|
80
|
+
colorPreset: "purple",
|
|
81
|
+
enableSharedModalDimensions: true,
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const installedApps = [
|
|
85
|
+
myQueryTool,
|
|
86
|
+
// ...other tools
|
|
87
|
+
];
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Alternative: Manual Setup
|
|
91
|
+
|
|
92
|
+
If you're not using FloatingDevTools or want more control:
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
import { ReactQueryDevToolsModal } from '@buoy/react-query';
|
|
96
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
97
|
+
|
|
98
|
+
const queryClient = new QueryClient();
|
|
99
|
+
|
|
100
|
+
function App() {
|
|
101
|
+
const [showQuery, setShowQuery] = useState(false);
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<QueryClientProvider client={queryClient}>
|
|
105
|
+
<Button onPress={() => setShowQuery(true)}>
|
|
106
|
+
Open Query Inspector
|
|
107
|
+
</Button>
|
|
108
|
+
|
|
109
|
+
<ReactQueryDevToolsModal
|
|
110
|
+
visible={showQuery}
|
|
111
|
+
onClose={() => setShowQuery(false)}
|
|
112
|
+
/>
|
|
113
|
+
|
|
114
|
+
<YourAppContent />
|
|
115
|
+
</QueryClientProvider>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## API Reference
|
|
121
|
+
|
|
122
|
+
### Presets
|
|
123
|
+
|
|
124
|
+
#### `reactQueryToolPreset`
|
|
125
|
+
|
|
126
|
+
Pre-configured React Query devtools ready to use with FloatingDevTools.
|
|
127
|
+
|
|
128
|
+
**Example:**
|
|
129
|
+
```typescript
|
|
130
|
+
import { reactQueryToolPreset } from '@buoy/react-query';
|
|
131
|
+
|
|
132
|
+
const installedApps = [reactQueryToolPreset];
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
#### `createReactQueryTool(options?)`
|
|
136
|
+
|
|
137
|
+
Create a custom React Query devtools configuration.
|
|
138
|
+
|
|
139
|
+
**Options:**
|
|
140
|
+
```typescript
|
|
141
|
+
{
|
|
142
|
+
/** Tool name (default: "QUERY") */
|
|
143
|
+
name?: string;
|
|
144
|
+
/** Tool description */
|
|
145
|
+
description?: string;
|
|
146
|
+
/** Icon color preset (default: "red") */
|
|
147
|
+
colorPreset?: "orange" | "cyan" | "purple" | "pink" | "yellow" | "green" | "red";
|
|
148
|
+
/** Custom tool ID (default: "query") */
|
|
149
|
+
id?: string;
|
|
150
|
+
/** Enable shared modal dimensions (default: true) */
|
|
151
|
+
enableSharedModalDimensions?: boolean;
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Example:**
|
|
156
|
+
```typescript
|
|
157
|
+
import { createReactQueryTool } from '@buoy/react-query';
|
|
158
|
+
|
|
159
|
+
const myQueryTool = createReactQueryTool({
|
|
160
|
+
name: "RQ DEVTOOLS",
|
|
161
|
+
colorPreset: "cyan",
|
|
162
|
+
enableSharedModalDimensions: true,
|
|
163
|
+
});
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Components
|
|
167
|
+
|
|
168
|
+
#### `ReactQueryDevToolsModal`
|
|
169
|
+
|
|
170
|
+
Main modal component for React Query devtools.
|
|
171
|
+
|
|
172
|
+
**Props:**
|
|
173
|
+
```typescript
|
|
174
|
+
interface ReactQueryDevToolsModalProps {
|
|
175
|
+
/** Whether the modal is visible */
|
|
176
|
+
visible: boolean;
|
|
177
|
+
/** Callback when modal is closed */
|
|
178
|
+
onClose: () => void;
|
|
179
|
+
/** Whether to use shared modal dimensions (default: true) */
|
|
180
|
+
enableSharedModalDimensions?: boolean;
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**Example:**
|
|
185
|
+
```typescript
|
|
186
|
+
<ReactQueryDevToolsModal
|
|
187
|
+
visible={isVisible}
|
|
188
|
+
onClose={handleClose}
|
|
189
|
+
enableSharedModalDimensions={true}
|
|
190
|
+
/>
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
#### `WifiToggle`
|
|
194
|
+
|
|
195
|
+
Small WiFi toggle component for simulating offline mode.
|
|
196
|
+
|
|
197
|
+
**Props:**
|
|
198
|
+
```typescript
|
|
199
|
+
interface WifiToggleProps {
|
|
200
|
+
/** Icon size (default: 16) */
|
|
201
|
+
size?: number;
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
**Example:**
|
|
206
|
+
```typescript
|
|
207
|
+
import { WifiToggle } from '@buoy/react-query';
|
|
208
|
+
|
|
209
|
+
<WifiToggle size={20} />
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Hooks
|
|
213
|
+
|
|
214
|
+
#### `useWifiState()`
|
|
215
|
+
|
|
216
|
+
Hook to manage and access WiFi/online state.
|
|
217
|
+
|
|
218
|
+
**Returns:**
|
|
219
|
+
```typescript
|
|
220
|
+
{
|
|
221
|
+
/** Whether the app is online */
|
|
222
|
+
isOnline: boolean;
|
|
223
|
+
/** Toggle WiFi state */
|
|
224
|
+
handleWifiToggle: () => void;
|
|
225
|
+
/** Set online state directly */
|
|
226
|
+
setIsOnline: (online: boolean) => void;
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**Example:**
|
|
231
|
+
```typescript
|
|
232
|
+
import { useWifiState } from '@buoy/react-query';
|
|
233
|
+
|
|
234
|
+
function MyComponent() {
|
|
235
|
+
const { isOnline, handleWifiToggle } = useWifiState();
|
|
236
|
+
|
|
237
|
+
return (
|
|
238
|
+
<View>
|
|
239
|
+
<Text>Status: {isOnline ? 'Online' : 'Offline'}</Text>
|
|
240
|
+
<Button onPress={handleWifiToggle}>
|
|
241
|
+
Toggle WiFi
|
|
242
|
+
</Button>
|
|
243
|
+
</View>
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## Use Cases
|
|
249
|
+
|
|
250
|
+
### Query Debugging
|
|
251
|
+
|
|
252
|
+
Inspect and debug queries in real-time:
|
|
253
|
+
|
|
254
|
+
```typescript
|
|
255
|
+
import { reactQueryToolPreset } from '@buoy/react-query';
|
|
256
|
+
|
|
257
|
+
// Add to your dev tools
|
|
258
|
+
const installedApps = [reactQueryToolPreset];
|
|
259
|
+
|
|
260
|
+
// Now you can:
|
|
261
|
+
// - See all active queries
|
|
262
|
+
// - View query data and status
|
|
263
|
+
// - Inspect stale/fresh/loading states
|
|
264
|
+
// - Manually refetch queries
|
|
265
|
+
// - Invalidate queries to trigger refetch
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Offline Testing
|
|
269
|
+
|
|
270
|
+
Test your app's behavior in offline mode:
|
|
271
|
+
|
|
272
|
+
```typescript
|
|
273
|
+
import { WifiToggle } from '@buoy/react-query';
|
|
274
|
+
|
|
275
|
+
// Add WiFi toggle to your header
|
|
276
|
+
<WifiToggle size={18} />
|
|
277
|
+
|
|
278
|
+
// Or use the hook directly
|
|
279
|
+
const { isOnline, handleWifiToggle } = useWifiState();
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Cache Manipulation
|
|
283
|
+
|
|
284
|
+
Inspect and manipulate the query cache:
|
|
285
|
+
|
|
286
|
+
```typescript
|
|
287
|
+
// In the React Query devtools modal:
|
|
288
|
+
// - View all cached queries
|
|
289
|
+
// - See cache sizes and data
|
|
290
|
+
// - Manually invalidate cache entries
|
|
291
|
+
// - Trigger refetches
|
|
292
|
+
// - Remove queries from cache
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### Mutation Monitoring
|
|
296
|
+
|
|
297
|
+
Track mutations and their states:
|
|
298
|
+
|
|
299
|
+
```typescript
|
|
300
|
+
// In the React Query devtools modal:
|
|
301
|
+
// - View all active mutations
|
|
302
|
+
// - See mutation status (idle, loading, success, error)
|
|
303
|
+
// - Inspect mutation data and variables
|
|
304
|
+
// - Track mutation timing
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## Features in Detail
|
|
308
|
+
|
|
309
|
+
### Query Browser
|
|
310
|
+
|
|
311
|
+
- **View All Queries**: See all queries registered with React Query
|
|
312
|
+
- **Filter by Status**: Filter by fresh, fetching, stale, or inactive
|
|
313
|
+
- **Search**: Search queries by key
|
|
314
|
+
- **Query Details**: View full query data, status, and metadata
|
|
315
|
+
- **Refetch**: Manually trigger query refetches
|
|
316
|
+
- **Invalidate**: Invalidate queries to trigger automatic refetch
|
|
317
|
+
- **Remove**: Remove queries from cache
|
|
318
|
+
|
|
319
|
+
### Mutation Tracking
|
|
320
|
+
|
|
321
|
+
- **View Mutations**: See all registered mutations
|
|
322
|
+
- **Mutation Status**: Track mutation states (idle, loading, success, error)
|
|
323
|
+
- **Variables**: Inspect mutation variables
|
|
324
|
+
- **Results**: View mutation results and errors
|
|
325
|
+
- **Reset**: Reset mutation states
|
|
326
|
+
|
|
327
|
+
### WiFi Toggle
|
|
328
|
+
|
|
329
|
+
- **Offline Mode**: Simulate offline state
|
|
330
|
+
- **Query Behavior**: Test how queries behave without network
|
|
331
|
+
- **Retry Logic**: Verify retry and error handling
|
|
332
|
+
- **Cache Fallbacks**: Test cache-first strategies
|
|
333
|
+
|
|
334
|
+
### Performance Monitoring
|
|
335
|
+
|
|
336
|
+
- **Query Timing**: See how long queries take
|
|
337
|
+
- **Cache Hits**: Track cache hit rates
|
|
338
|
+
- **Stale Time**: Monitor query freshness
|
|
339
|
+
- **Background Updates**: See when queries update in background
|
|
340
|
+
|
|
341
|
+
## React Query Integration
|
|
342
|
+
|
|
343
|
+
This package integrates with React Query's online manager to provide WiFi toggle functionality. When you toggle WiFi off:
|
|
344
|
+
|
|
345
|
+
- React Query treats the app as offline
|
|
346
|
+
- Queries won't refetch automatically
|
|
347
|
+
- New queries will be paused
|
|
348
|
+
- Mutations will be paused until online
|
|
349
|
+
- Background refetches are disabled
|
|
350
|
+
|
|
351
|
+
This is perfect for testing offline scenarios without actually disconnecting your device.
|
|
352
|
+
|
|
353
|
+
## Dependencies
|
|
354
|
+
|
|
355
|
+
- `@buoy/shared-ui` - Common UI components and utilities
|
|
356
|
+
- `@tanstack/react-query` - React Query library (peer dependency)
|
|
357
|
+
- React and React Native (peer dependencies)
|
|
358
|
+
|
|
359
|
+
## Development
|
|
360
|
+
|
|
361
|
+
### Building
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
pnpm build
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
### Type Checking
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
pnpm typecheck
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Clean Build
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
pnpm clean
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
## License
|
|
380
|
+
|
|
381
|
+
MIT
|
|
382
|
+
|
|
383
|
+
## Contributing
|
|
384
|
+
|
|
385
|
+
See the main repository [CONTRIBUTING.md](../../CONTRIBUTING.md) for contribution guidelines.
|
|
386
|
+
|
|
387
|
+
## Support
|
|
388
|
+
|
|
389
|
+
For issues and feature requests, please visit the [GitHub repository](https://github.com/LovesWorking/react-native-buoy/issues).
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
reactQueryToolPreset: true,
|
|
8
|
+
createReactQueryTool: true,
|
|
9
|
+
wifiTogglePreset: true,
|
|
10
|
+
createWifiToggleTool: true
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "createReactQueryTool", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _preset.createReactQueryTool;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "createWifiToggleTool", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _preset.createWifiToggleTool;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "reactQueryToolPreset", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _preset.reactQueryToolPreset;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "wifiTogglePreset", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _preset.wifiTogglePreset;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
var _preset = require("./preset");
|
|
37
|
+
var _reactQuery = require("./react-query");
|
|
38
|
+
Object.keys(_reactQuery).forEach(function (key) {
|
|
39
|
+
if (key === "default" || key === "__esModule") return;
|
|
40
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
41
|
+
if (key in exports && exports[key] === _reactQuery[key]) return;
|
|
42
|
+
Object.defineProperty(exports, key, {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _reactQuery[key];
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
var _components = require("./react-query/components");
|
|
50
|
+
Object.keys(_components).forEach(function (key) {
|
|
51
|
+
if (key === "default" || key === "__esModule") return;
|
|
52
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
53
|
+
if (key in exports && exports[key] === _components[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _components[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
var _hooks = require("./react-query/hooks");
|
|
62
|
+
Object.keys(_hooks).forEach(function (key) {
|
|
63
|
+
if (key === "default" || key === "__esModule") return;
|
|
64
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
65
|
+
if (key in exports && exports[key] === _hooks[key]) return;
|
|
66
|
+
Object.defineProperty(exports, key, {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _hooks[key];
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
var _utils = require("./react-query/utils");
|
|
74
|
+
Object.keys(_utils).forEach(function (key) {
|
|
75
|
+
if (key === "default" || key === "__esModule") return;
|
|
76
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
77
|
+
if (key in exports && exports[key] === _utils[key]) return;
|
|
78
|
+
Object.defineProperty(exports, key, {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _utils[key];
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
var _types = require("./react-query/types");
|
|
86
|
+
Object.keys(_types).forEach(function (key) {
|
|
87
|
+
if (key === "default" || key === "__esModule") return;
|
|
88
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
89
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
90
|
+
Object.defineProperty(exports, key, {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _types[key];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
// Check if @tanstack/react-query is installed
|
|
98
|
+
try {
|
|
99
|
+
require("@tanstack/react-query");
|
|
100
|
+
} catch (error) {
|
|
101
|
+
throw new Error("\n\n[@buoy-gg/react-query] ERROR: Missing required peer dependency\n\n" + "This package requires @tanstack/react-query to be installed.\n\n" + "Install it with:\n" + " npm install @tanstack/react-query\n" + " or\n" + " pnpm add @tanstack/react-query\n" + " or\n" + " yarn add @tanstack/react-query\n\n" + "For more information, visit: https://tanstack.com/query/latest\n");
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Export preset configuration (easiest way to add to FloatingDevTools!)
|
|
105
|
+
|
|
106
|
+
// React Query dev tools entry point
|
|
107
|
+
// Re-export the full dev tools surface so consumers can tree-shake as needed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createReactQueryTool = createReactQueryTool;
|
|
7
|
+
exports.createWifiToggleTool = createWifiToggleTool;
|
|
8
|
+
exports.wifiTogglePreset = exports.reactQueryToolPreset = void 0;
|
|
9
|
+
var _floatingToolsCore = require("@buoy-gg/floating-tools-core");
|
|
10
|
+
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
11
|
+
var _ReactQueryDevToolsModal = require("./react-query/components/ReactQueryDevToolsModal");
|
|
12
|
+
var _reactQuery = require("@tanstack/react-query");
|
|
13
|
+
var _react = require("react");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
/**
|
|
16
|
+
* Pre-configured React Query devtools for FloatingDevTools
|
|
17
|
+
*
|
|
18
|
+
* This preset provides a zero-config way to add React Query inspection to your dev tools.
|
|
19
|
+
* Just import and add it to your apps array!
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* import { reactQueryToolPreset } from '@buoy-gg/react-query';
|
|
24
|
+
*
|
|
25
|
+
* const installedApps = [
|
|
26
|
+
* reactQueryToolPreset, // That's it!
|
|
27
|
+
* // ...other tools
|
|
28
|
+
* ];
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
// Empty component for toggle-only mode
|
|
33
|
+
const EmptyComponent = () => null;
|
|
34
|
+
|
|
35
|
+
// Save WiFi state to storage
|
|
36
|
+
const saveWifiState = async enabled => {
|
|
37
|
+
try {
|
|
38
|
+
await (0, _sharedUi.safeSetItem)(_sharedUi.devToolsStorageKeys.settings.wifiEnabled(), enabled.toString());
|
|
39
|
+
} catch (error) {
|
|
40
|
+
// Failed to save WiFi state
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* WiFi icon component - uses hooks to subscribe to onlineManager changes.
|
|
46
|
+
*
|
|
47
|
+
* ⚠️ IMPORTANT - DO NOT MODIFY THIS COMPONENT ⚠️
|
|
48
|
+
* This component MUST use useState and useEffect hooks to subscribe to onlineManager.
|
|
49
|
+
* It is rendered as a JSX component (<IconComponent />) in FloatingMenu and DialIcon,
|
|
50
|
+
* which allows hooks to work properly.
|
|
51
|
+
*
|
|
52
|
+
* If you remove the hooks or change this to read onlineManager.isOnline() directly,
|
|
53
|
+
* the icon color will NOT update when the WiFi toggle is pressed.
|
|
54
|
+
*
|
|
55
|
+
* See: FloatingMenu.tsx (renders as <IconComponent />)
|
|
56
|
+
* See: DialIcon.tsx (renders as <icon.iconComponent />)
|
|
57
|
+
*/
|
|
58
|
+
function WifiIcon({
|
|
59
|
+
size
|
|
60
|
+
}) {
|
|
61
|
+
const [isOnline, setIsOnline] = (0, _react.useState)(() => _reactQuery.onlineManager.isOnline());
|
|
62
|
+
(0, _react.useEffect)(() => {
|
|
63
|
+
const unsubscribe = _reactQuery.onlineManager.subscribe(online => {
|
|
64
|
+
setIsOnline(online);
|
|
65
|
+
});
|
|
66
|
+
return unsubscribe;
|
|
67
|
+
}, []);
|
|
68
|
+
const color = isOnline ? "#10B981" : "#DC2626";
|
|
69
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Wifi, {
|
|
70
|
+
size: size,
|
|
71
|
+
color: color
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Pre-configured React Query devtools for FloatingDevTools.
|
|
77
|
+
* Includes:
|
|
78
|
+
* - Query browser and inspector
|
|
79
|
+
* - Mutation tracking
|
|
80
|
+
* - Cache inspection
|
|
81
|
+
* - Query invalidation
|
|
82
|
+
* - Performance monitoring
|
|
83
|
+
*/
|
|
84
|
+
const reactQueryToolPreset = exports.reactQueryToolPreset = {
|
|
85
|
+
id: "query",
|
|
86
|
+
name: "QUERY",
|
|
87
|
+
description: "React Query inspector",
|
|
88
|
+
slot: "both",
|
|
89
|
+
icon: ({
|
|
90
|
+
size
|
|
91
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.QueryIcon, {
|
|
92
|
+
size: size
|
|
93
|
+
}),
|
|
94
|
+
component: _ReactQueryDevToolsModal.ReactQueryDevToolsModal,
|
|
95
|
+
props: {
|
|
96
|
+
enableSharedModalDimensions: false
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Create a custom React Query devtools configuration.
|
|
102
|
+
* Use this if you want to override default settings.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```tsx
|
|
106
|
+
* import { createReactQueryTool } from '@buoy-gg/react-query';
|
|
107
|
+
*
|
|
108
|
+
* const myQueryTool = createReactQueryTool({
|
|
109
|
+
* name: "TANSTACK",
|
|
110
|
+
* colorPreset: "purple",
|
|
111
|
+
* enableSharedModalDimensions: true,
|
|
112
|
+
* });
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
function createReactQueryTool(options) {
|
|
116
|
+
return {
|
|
117
|
+
id: options?.id || "query",
|
|
118
|
+
name: options?.name || "QUERY",
|
|
119
|
+
description: options?.description || "React Query inspector",
|
|
120
|
+
slot: "both",
|
|
121
|
+
icon: ({
|
|
122
|
+
size
|
|
123
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingToolsCore.QueryIcon, {
|
|
124
|
+
size: size
|
|
125
|
+
}),
|
|
126
|
+
component: _ReactQueryDevToolsModal.ReactQueryDevToolsModal,
|
|
127
|
+
props: {
|
|
128
|
+
enableSharedModalDimensions: options?.enableSharedModalDimensions !== undefined ? options.enableSharedModalDimensions : false
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Pre-configured WiFi toggle tool for FloatingDevTools.
|
|
135
|
+
* Allows toggling React Query's online state to simulate offline scenarios.
|
|
136
|
+
* Simple toggle - no modal needed!
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```tsx
|
|
140
|
+
* import { wifiTogglePreset } from '@buoy-gg/react-query';
|
|
141
|
+
*
|
|
142
|
+
* const installedApps = [
|
|
143
|
+
* wifiTogglePreset, // That's it!
|
|
144
|
+
* // ...other tools
|
|
145
|
+
* ];
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
const wifiTogglePreset = exports.wifiTogglePreset = {
|
|
149
|
+
id: "query-wifi-toggle",
|
|
150
|
+
name: "WIFI",
|
|
151
|
+
description: "Toggle React Query online/offline state",
|
|
152
|
+
slot: "row",
|
|
153
|
+
icon: WifiIcon,
|
|
154
|
+
component: EmptyComponent,
|
|
155
|
+
props: {},
|
|
156
|
+
launchMode: "toggle-only",
|
|
157
|
+
onPress: () => {
|
|
158
|
+
const newState = !_reactQuery.onlineManager.isOnline();
|
|
159
|
+
_reactQuery.onlineManager.setOnline(newState);
|
|
160
|
+
saveWifiState(newState);
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Create a custom WiFi toggle tool configuration.
|
|
166
|
+
* Use this if you want to override default settings.
|
|
167
|
+
*
|
|
168
|
+
* @example
|
|
169
|
+
* ```tsx
|
|
170
|
+
* import { createWifiToggleTool } from '@buoy-gg/react-query';
|
|
171
|
+
*
|
|
172
|
+
* const myWifiTool = createWifiToggleTool({
|
|
173
|
+
* name: "OFFLINE",
|
|
174
|
+
* onColor: "#10B981",
|
|
175
|
+
* offColor: "#DC2626",
|
|
176
|
+
* });
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
function createWifiToggleTool(options) {
|
|
180
|
+
const onColor = options?.onColor || "#10B981";
|
|
181
|
+
const offColor = options?.offColor || "#DC2626";
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Custom WiFi icon component with hooks - rendered as JSX component.
|
|
185
|
+
*
|
|
186
|
+
* ⚠️ IMPORTANT - DO NOT MODIFY THIS COMPONENT ⚠️
|
|
187
|
+
* This component MUST use useState and useEffect hooks to subscribe to onlineManager.
|
|
188
|
+
* See the comment on WifiIcon above for full explanation.
|
|
189
|
+
*/
|
|
190
|
+
const CustomWifiIcon = ({
|
|
191
|
+
size
|
|
192
|
+
}) => {
|
|
193
|
+
const [isOnline, setIsOnline] = (0, _react.useState)(() => _reactQuery.onlineManager.isOnline());
|
|
194
|
+
(0, _react.useEffect)(() => {
|
|
195
|
+
const unsubscribe = _reactQuery.onlineManager.subscribe(online => {
|
|
196
|
+
setIsOnline(online);
|
|
197
|
+
});
|
|
198
|
+
return unsubscribe;
|
|
199
|
+
}, []);
|
|
200
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Wifi, {
|
|
201
|
+
size: size,
|
|
202
|
+
color: isOnline ? onColor : offColor
|
|
203
|
+
});
|
|
204
|
+
};
|
|
205
|
+
return {
|
|
206
|
+
id: options?.id || "query-wifi-toggle",
|
|
207
|
+
name: options?.name || "WIFI",
|
|
208
|
+
description: options?.description || "Toggle React Query online/offline state",
|
|
209
|
+
slot: "row",
|
|
210
|
+
icon: CustomWifiIcon,
|
|
211
|
+
component: EmptyComponent,
|
|
212
|
+
props: {},
|
|
213
|
+
launchMode: "toggle-only",
|
|
214
|
+
onPress: () => {
|
|
215
|
+
const newState = !_reactQuery.onlineManager.isOnline();
|
|
216
|
+
_reactQuery.onlineManager.setOnline(newState);
|
|
217
|
+
saveWifiState(newState);
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
}
|