@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
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useState, useRef, useMemo, useCallback } from "react";
|
|
4
|
+
import { View, Text, StyleSheet, PanResponder, Animated, Dimensions, FlatList } from "react-native";
|
|
5
|
+
import MutationButton from "./MutationButton";
|
|
6
|
+
import MutationInformation from "./MutationInformation";
|
|
7
|
+
import useAllMutations from "../../hooks/useAllMutations";
|
|
8
|
+
import { buoyColors } from "@buoy-gg/shared-ui";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
/**
|
|
11
|
+
* Virtualized list of mutations with filtering and selection support for the mutation browser.
|
|
12
|
+
*/
|
|
13
|
+
export default function MutationsList({
|
|
14
|
+
selectedMutation,
|
|
15
|
+
setSelectedMutation,
|
|
16
|
+
activeFilter,
|
|
17
|
+
hideInfoPanel = false,
|
|
18
|
+
contentContainerStyle,
|
|
19
|
+
searchText = ""
|
|
20
|
+
}) {
|
|
21
|
+
const {
|
|
22
|
+
mutations: allmutations
|
|
23
|
+
} = useAllMutations();
|
|
24
|
+
|
|
25
|
+
// Helper function to get mutation status for filtering
|
|
26
|
+
const getMutationStatus = mutation => {
|
|
27
|
+
if (mutation.state.isPaused) return "paused";
|
|
28
|
+
const status = mutation.state.status;
|
|
29
|
+
return status; // 'idle', 'pending', 'success', 'error'
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// Filter mutations based on active filter and search text
|
|
33
|
+
const filteredMutations = useMemo(() => {
|
|
34
|
+
let filtered = allmutations;
|
|
35
|
+
|
|
36
|
+
// Apply status filter
|
|
37
|
+
if (activeFilter) {
|
|
38
|
+
filtered = filtered.filter(mutation => {
|
|
39
|
+
const status = getMutationStatus(mutation);
|
|
40
|
+
return status === activeFilter;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Apply search filter on mutation keys
|
|
45
|
+
if (searchText) {
|
|
46
|
+
const searchLower = searchText.toLowerCase();
|
|
47
|
+
filtered = filtered.filter(mutation => {
|
|
48
|
+
const mutationKey = mutation.options.mutationKey;
|
|
49
|
+
if (!mutationKey) return false;
|
|
50
|
+
const keys = Array.isArray(mutationKey) ? mutationKey : [mutationKey];
|
|
51
|
+
const keyString = keys.filter(k => k != null).map(k => String(k)).join(" ").toLowerCase();
|
|
52
|
+
return keyString.includes(searchLower);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return filtered;
|
|
56
|
+
}, [allmutations, activeFilter, searchText]);
|
|
57
|
+
|
|
58
|
+
// Height management for resizable mutation information panel
|
|
59
|
+
const screenHeight = Dimensions.get("window").height;
|
|
60
|
+
const defaultInfoHeight = screenHeight * 0.4; // 40% of screen height
|
|
61
|
+
const minInfoHeight = 150;
|
|
62
|
+
const maxInfoHeight = screenHeight * 0.7; // 70% of screen height
|
|
63
|
+
|
|
64
|
+
const infoHeightAnim = useRef(new Animated.Value(defaultInfoHeight)).current;
|
|
65
|
+
const [, setCurrentInfoHeight] = useState(defaultInfoHeight);
|
|
66
|
+
const currentInfoHeightRef = useRef(defaultInfoHeight);
|
|
67
|
+
|
|
68
|
+
// Pan responder for dragging the mutation information panel
|
|
69
|
+
const infoPanResponder = useRef(PanResponder.create({
|
|
70
|
+
onMoveShouldSetPanResponder: (evt, gestureState) => {
|
|
71
|
+
return Math.abs(gestureState.dy) > Math.abs(gestureState.dx) && Math.abs(gestureState.dy) > 10;
|
|
72
|
+
},
|
|
73
|
+
onPanResponderGrant: () => {
|
|
74
|
+
infoHeightAnim.stopAnimation(value => {
|
|
75
|
+
setCurrentInfoHeight(value);
|
|
76
|
+
currentInfoHeightRef.current = value;
|
|
77
|
+
infoHeightAnim.setValue(value);
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
onPanResponderMove: (evt, gestureState) => {
|
|
81
|
+
// Use the ref value which is always current
|
|
82
|
+
const newHeight = currentInfoHeightRef.current - gestureState.dy;
|
|
83
|
+
const clampedHeight = Math.max(minInfoHeight, Math.min(maxInfoHeight, newHeight));
|
|
84
|
+
infoHeightAnim.setValue(clampedHeight);
|
|
85
|
+
},
|
|
86
|
+
onPanResponderRelease: (evt, gestureState) => {
|
|
87
|
+
const finalHeight = Math.max(minInfoHeight, Math.min(maxInfoHeight, currentInfoHeightRef.current - gestureState.dy));
|
|
88
|
+
setCurrentInfoHeight(finalHeight);
|
|
89
|
+
currentInfoHeightRef.current = finalHeight;
|
|
90
|
+
Animated.timing(infoHeightAnim, {
|
|
91
|
+
toValue: finalHeight,
|
|
92
|
+
duration: 200,
|
|
93
|
+
useNativeDriver: false
|
|
94
|
+
}).start(() => {
|
|
95
|
+
// Ensure the animated value and state are perfectly synced after animation
|
|
96
|
+
infoHeightAnim.setValue(finalHeight);
|
|
97
|
+
setCurrentInfoHeight(finalHeight);
|
|
98
|
+
currentInfoHeightRef.current = finalHeight;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
})).current;
|
|
102
|
+
|
|
103
|
+
// Optimize FlatList performance - memoize renderItem to prevent re-renders
|
|
104
|
+
const renderMutation = useCallback(({
|
|
105
|
+
item
|
|
106
|
+
}) => /*#__PURE__*/_jsx(MutationButton, {
|
|
107
|
+
selected: selectedMutation,
|
|
108
|
+
setSelectedMutation: setSelectedMutation,
|
|
109
|
+
mutation: item
|
|
110
|
+
}), [selectedMutation, setSelectedMutation]);
|
|
111
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
112
|
+
style: styles.container,
|
|
113
|
+
children: [filteredMutations.length > 0 ? /*#__PURE__*/_jsx(View, {
|
|
114
|
+
style: styles.listWrapper,
|
|
115
|
+
children: /*#__PURE__*/_jsx(FlatList, {
|
|
116
|
+
"sentry-label": "ignore devtools mutations list",
|
|
117
|
+
data: filteredMutations,
|
|
118
|
+
renderItem: renderMutation,
|
|
119
|
+
keyExtractor: (item, index) => `${item.mutationId}-${item.state.submittedAt}-${item.state.status}-${index}`,
|
|
120
|
+
showsVerticalScrollIndicator: true,
|
|
121
|
+
removeClippedSubviews: true,
|
|
122
|
+
contentContainerStyle: contentContainerStyle || styles.listContent,
|
|
123
|
+
initialNumToRender: 10,
|
|
124
|
+
maxToRenderPerBatch: 10,
|
|
125
|
+
windowSize: 10,
|
|
126
|
+
scrollEnabled: false
|
|
127
|
+
})
|
|
128
|
+
}) : /*#__PURE__*/_jsx(View, {
|
|
129
|
+
style: styles.emptyContainer,
|
|
130
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
131
|
+
style: styles.emptyText,
|
|
132
|
+
children: activeFilter ? `No ${activeFilter} mutations found` : "No mutations found"
|
|
133
|
+
})
|
|
134
|
+
}), selectedMutation && !hideInfoPanel && /*#__PURE__*/_jsxs(Animated.View, {
|
|
135
|
+
style: [styles.mutationInfo, {
|
|
136
|
+
height: infoHeightAnim
|
|
137
|
+
}],
|
|
138
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
139
|
+
style: styles.dragHandle,
|
|
140
|
+
...infoPanResponder.panHandlers,
|
|
141
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
142
|
+
style: styles.dragIndicator
|
|
143
|
+
})
|
|
144
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
145
|
+
style: styles.mutationInfoContent,
|
|
146
|
+
children: /*#__PURE__*/_jsx(MutationInformation, {
|
|
147
|
+
selectedMutation: selectedMutation
|
|
148
|
+
})
|
|
149
|
+
})]
|
|
150
|
+
})]
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
const styles = StyleSheet.create({
|
|
154
|
+
container: {
|
|
155
|
+
flex: 1,
|
|
156
|
+
backgroundColor: buoyColors.base
|
|
157
|
+
},
|
|
158
|
+
listWrapper: {
|
|
159
|
+
flex: 1
|
|
160
|
+
},
|
|
161
|
+
listContent: {
|
|
162
|
+
backgroundColor: buoyColors.base,
|
|
163
|
+
paddingHorizontal: 8,
|
|
164
|
+
paddingTop: 8
|
|
165
|
+
},
|
|
166
|
+
mutationInfo: {
|
|
167
|
+
borderTopWidth: 1,
|
|
168
|
+
borderTopColor: buoyColors.border,
|
|
169
|
+
backgroundColor: buoyColors.base
|
|
170
|
+
},
|
|
171
|
+
dragHandle: {
|
|
172
|
+
height: 20,
|
|
173
|
+
justifyContent: "center",
|
|
174
|
+
alignItems: "center",
|
|
175
|
+
backgroundColor: buoyColors.card,
|
|
176
|
+
borderBottomWidth: 1,
|
|
177
|
+
borderBottomColor: buoyColors.border
|
|
178
|
+
},
|
|
179
|
+
dragIndicator: {
|
|
180
|
+
width: 40,
|
|
181
|
+
height: 4,
|
|
182
|
+
backgroundColor: buoyColors.border,
|
|
183
|
+
borderRadius: 2
|
|
184
|
+
},
|
|
185
|
+
mutationInfoContent: {
|
|
186
|
+
flex: 1,
|
|
187
|
+
backgroundColor: buoyColors.base
|
|
188
|
+
},
|
|
189
|
+
emptyContainer: {
|
|
190
|
+
flex: 1,
|
|
191
|
+
justifyContent: "center",
|
|
192
|
+
alignItems: "center",
|
|
193
|
+
padding: 32,
|
|
194
|
+
backgroundColor: buoyColors.card,
|
|
195
|
+
margin: 16,
|
|
196
|
+
borderRadius: 8,
|
|
197
|
+
borderWidth: 1,
|
|
198
|
+
borderColor: buoyColors.border
|
|
199
|
+
},
|
|
200
|
+
emptyText: {
|
|
201
|
+
color: buoyColors.textMuted,
|
|
202
|
+
fontSize: 14,
|
|
203
|
+
textAlign: "center",
|
|
204
|
+
fontFamily: "monospace",
|
|
205
|
+
letterSpacing: 0.5
|
|
206
|
+
}
|
|
207
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { TouchableOpacity, StyleSheet } from "react-native";
|
|
4
|
+
import { Wifi, buoyColors } from "@buoy-gg/shared-ui";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
/**
|
|
7
|
+
* Small toggle used in the query browser to mock offline/online behavior.
|
|
8
|
+
*/
|
|
9
|
+
const NetworkToggleButton = ({
|
|
10
|
+
isOffline,
|
|
11
|
+
onToggle
|
|
12
|
+
}) => {
|
|
13
|
+
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
14
|
+
"sentry-label": "ignore devtools network toggle button",
|
|
15
|
+
style: [styles.button, isOffline && styles.offlineButton],
|
|
16
|
+
onPress: onToggle,
|
|
17
|
+
activeOpacity: 0.7,
|
|
18
|
+
accessibilityLabel: isOffline ? "Unset offline mocking behavior" : "Mock offline behavior",
|
|
19
|
+
accessibilityRole: "button",
|
|
20
|
+
accessibilityState: {
|
|
21
|
+
selected: isOffline
|
|
22
|
+
},
|
|
23
|
+
children: isOffline ? /*#__PURE__*/_jsx(Wifi, {
|
|
24
|
+
size: 16,
|
|
25
|
+
color: buoyColors.error,
|
|
26
|
+
strokeWidth: 2
|
|
27
|
+
}) : /*#__PURE__*/_jsx(Wifi, {
|
|
28
|
+
size: 16,
|
|
29
|
+
color: buoyColors.success,
|
|
30
|
+
strokeWidth: 2
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
const styles = StyleSheet.create({
|
|
35
|
+
button: {
|
|
36
|
+
width: 32,
|
|
37
|
+
height: 32,
|
|
38
|
+
borderRadius: 6,
|
|
39
|
+
backgroundColor: "rgba(16, 185, 129, 0.1)",
|
|
40
|
+
justifyContent: "center",
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
borderWidth: 1,
|
|
43
|
+
borderColor: "rgba(16, 185, 129, 0.2)"
|
|
44
|
+
},
|
|
45
|
+
offlineButton: {
|
|
46
|
+
backgroundColor: "rgba(239, 68, 68, 0.1)",
|
|
47
|
+
borderColor: "rgba(239, 68, 68, 0.2)"
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
export default NetworkToggleButton;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
4
|
+
import ActionButton from "./ActionButton";
|
|
5
|
+
import { getQueryStatusLabel } from "../../utils/getQueryStatusLabel";
|
|
6
|
+
import triggerLoading from "../../utils/actions/triggerLoading";
|
|
7
|
+
import refetch from "../../utils/actions/refetch";
|
|
8
|
+
import reset from "../../utils/actions/reset";
|
|
9
|
+
import remove from "../../utils/actions/remove";
|
|
10
|
+
import invalidate from "../../utils/actions/invalidate";
|
|
11
|
+
import triggerError from "../../utils/actions/triggerError";
|
|
12
|
+
import { View, Text, StyleSheet } from "react-native";
|
|
13
|
+
import { buoyColors } from "@buoy-gg/shared-ui";
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
/**
|
|
16
|
+
* Action panel rendered in query detail views providing mutation simulation and removal controls.
|
|
17
|
+
*/
|
|
18
|
+
export default function QueryActions({
|
|
19
|
+
query,
|
|
20
|
+
setSelectedQuery
|
|
21
|
+
}) {
|
|
22
|
+
const queryClient = useQueryClient();
|
|
23
|
+
if (query === undefined) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
const queryStatus = query.state.status;
|
|
27
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
28
|
+
style: styles.container,
|
|
29
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
30
|
+
style: styles.headerText,
|
|
31
|
+
children: "Actions"
|
|
32
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
33
|
+
style: styles.buttonsContainer,
|
|
34
|
+
children: [/*#__PURE__*/_jsx(ActionButton, {
|
|
35
|
+
"sentry-label": "ignore devtools query refetch action",
|
|
36
|
+
disabled: getQueryStatusLabel(query) === "fetching",
|
|
37
|
+
onClick: () => {
|
|
38
|
+
refetch({
|
|
39
|
+
query
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
bgColorClass: "btnRefetch",
|
|
43
|
+
text: "Refetch",
|
|
44
|
+
_textColorClass: "btnRefetch"
|
|
45
|
+
}), /*#__PURE__*/_jsx(ActionButton, {
|
|
46
|
+
"sentry-label": "ignore devtools query invalidate action",
|
|
47
|
+
disabled: queryStatus === "pending",
|
|
48
|
+
onClick: () => {
|
|
49
|
+
invalidate({
|
|
50
|
+
query,
|
|
51
|
+
queryClient
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
bgColorClass: "btnInvalidate",
|
|
55
|
+
text: "Invalidate",
|
|
56
|
+
_textColorClass: "btnInvalidate"
|
|
57
|
+
}), /*#__PURE__*/_jsx(ActionButton, {
|
|
58
|
+
"sentry-label": "ignore devtools query reset action",
|
|
59
|
+
disabled: queryStatus === "pending",
|
|
60
|
+
onClick: () => {
|
|
61
|
+
reset({
|
|
62
|
+
queryClient,
|
|
63
|
+
query
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
bgColorClass: "btnReset",
|
|
67
|
+
text: "Reset",
|
|
68
|
+
_textColorClass: "btnReset"
|
|
69
|
+
}), /*#__PURE__*/_jsx(ActionButton, {
|
|
70
|
+
"sentry-label": "ignore devtools query remove action",
|
|
71
|
+
disabled: getQueryStatusLabel(query) === "fetching",
|
|
72
|
+
onClick: () => {
|
|
73
|
+
remove({
|
|
74
|
+
queryClient,
|
|
75
|
+
query
|
|
76
|
+
});
|
|
77
|
+
setSelectedQuery(undefined);
|
|
78
|
+
},
|
|
79
|
+
bgColorClass: "btnRemove",
|
|
80
|
+
text: "Remove",
|
|
81
|
+
_textColorClass: "btnRemove"
|
|
82
|
+
}), /*#__PURE__*/_jsx(ActionButton, {
|
|
83
|
+
"sentry-label": "ignore devtools query trigger loading action",
|
|
84
|
+
disabled: false,
|
|
85
|
+
onClick: () => {
|
|
86
|
+
triggerLoading({
|
|
87
|
+
query
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
bgColorClass: "btnTriggerLoading",
|
|
91
|
+
text: query.state.fetchStatus === "fetching" ? "Restore Loading" : "Trigger Loading",
|
|
92
|
+
_textColorClass: "btnTriggerLoading"
|
|
93
|
+
}), /*#__PURE__*/_jsx(ActionButton, {
|
|
94
|
+
"sentry-label": "ignore devtools query trigger error action",
|
|
95
|
+
disabled: queryStatus === "pending",
|
|
96
|
+
onClick: () => {
|
|
97
|
+
triggerError({
|
|
98
|
+
query,
|
|
99
|
+
queryClient
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
bgColorClass: "btnTriggerLoadiError",
|
|
103
|
+
text: queryStatus === "error" ? "Restore Error" : "Trigger Error",
|
|
104
|
+
_textColorClass: "btnTriggerLoadiError"
|
|
105
|
+
})]
|
|
106
|
+
})]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
const styles = StyleSheet.create({
|
|
110
|
+
container: {
|
|
111
|
+
backgroundColor: buoyColors.card,
|
|
112
|
+
borderRadius: 12,
|
|
113
|
+
borderWidth: 1,
|
|
114
|
+
borderColor: buoyColors.border,
|
|
115
|
+
padding: 16,
|
|
116
|
+
gap: 12
|
|
117
|
+
},
|
|
118
|
+
headerText: {
|
|
119
|
+
fontSize: 14,
|
|
120
|
+
fontWeight: "700",
|
|
121
|
+
color: buoyColors.primary,
|
|
122
|
+
marginBottom: 8,
|
|
123
|
+
textAlign: "left",
|
|
124
|
+
fontFamily: "monospace",
|
|
125
|
+
letterSpacing: 1,
|
|
126
|
+
textTransform: "uppercase"
|
|
127
|
+
},
|
|
128
|
+
buttonsContainer: {
|
|
129
|
+
flexDirection: "row",
|
|
130
|
+
flexWrap: "wrap",
|
|
131
|
+
gap: 8
|
|
132
|
+
}
|
|
133
|
+
});
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useMemo, useCallback } from "react";
|
|
4
|
+
import { View, StyleSheet, Text, ScrollView } from "react-native";
|
|
5
|
+
import QueryRow from "./QueryRow";
|
|
6
|
+
import useAllQueries from "../../hooks/useAllQueries";
|
|
7
|
+
import { getQueryStatusLabel } from "../../utils/getQueryStatusLabel";
|
|
8
|
+
import { buoyColors } from "@buoy-gg/shared-ui";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
/**
|
|
11
|
+
* Scrollable list view of cached queries with filtering support and selection handling.
|
|
12
|
+
*/
|
|
13
|
+
export default function QueryBrowser({
|
|
14
|
+
selectedQuery,
|
|
15
|
+
onQuerySelect,
|
|
16
|
+
activeFilter,
|
|
17
|
+
emptyStateMessage,
|
|
18
|
+
contentContainerStyle,
|
|
19
|
+
queries: externalQueries,
|
|
20
|
+
searchText = "",
|
|
21
|
+
ignoredPatterns = new Set(),
|
|
22
|
+
includedPatterns = new Set()
|
|
23
|
+
}) {
|
|
24
|
+
// Holds all queries using the working hook, or use external queries if provided
|
|
25
|
+
const internalQueries = useAllQueries();
|
|
26
|
+
const allQueries = externalQueries ?? internalQueries;
|
|
27
|
+
|
|
28
|
+
// Filter queries based on active filter, search text, and ignored patterns
|
|
29
|
+
const filteredQueries = useMemo(() => {
|
|
30
|
+
let filtered = allQueries;
|
|
31
|
+
|
|
32
|
+
// Apply status filter
|
|
33
|
+
if (activeFilter) {
|
|
34
|
+
filtered = filtered.filter(query => {
|
|
35
|
+
const status = getQueryStatusLabel(query);
|
|
36
|
+
return status === activeFilter;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Apply search filter on query keys
|
|
41
|
+
if (searchText) {
|
|
42
|
+
const searchLower = searchText.toLowerCase();
|
|
43
|
+
filtered = filtered.filter(query => {
|
|
44
|
+
if (!query?.queryKey) return false;
|
|
45
|
+
const keys = Array.isArray(query.queryKey) ? query.queryKey : [query.queryKey];
|
|
46
|
+
const keyString = keys.filter(k => k != null).map(k => String(k)).join(" ").toLowerCase();
|
|
47
|
+
return keyString.includes(searchLower);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Apply included patterns filter (show ONLY queries matching any pattern)
|
|
52
|
+
// This acts as a whitelist - if any include patterns exist, query must match at least one
|
|
53
|
+
if (includedPatterns.size > 0) {
|
|
54
|
+
filtered = filtered.filter(query => {
|
|
55
|
+
if (!query?.queryKey) return false;
|
|
56
|
+
const keys = Array.isArray(query.queryKey) ? query.queryKey : [query.queryKey];
|
|
57
|
+
const keyString = keys.filter(k => k != null).map(k => String(k)).join(" ").toLowerCase();
|
|
58
|
+
|
|
59
|
+
// Return true if query matches ANY included pattern
|
|
60
|
+
return Array.from(includedPatterns).some(pattern => keyString.includes(pattern.toLowerCase()));
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Apply ignored patterns filter (hide queries matching any pattern)
|
|
65
|
+
if (ignoredPatterns.size > 0) {
|
|
66
|
+
filtered = filtered.filter(query => {
|
|
67
|
+
if (!query?.queryKey) return true;
|
|
68
|
+
const keys = Array.isArray(query.queryKey) ? query.queryKey : [query.queryKey];
|
|
69
|
+
const keyString = keys.filter(k => k != null).map(k => String(k)).join(" ").toLowerCase();
|
|
70
|
+
|
|
71
|
+
// Return true if NO patterns match (i.e., keep the query)
|
|
72
|
+
return !Array.from(ignoredPatterns).some(pattern => keyString.includes(pattern.toLowerCase()));
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Sort by most recently updated (dataUpdatedAt descending)
|
|
77
|
+
filtered.sort((a, b) => {
|
|
78
|
+
const aTime = a.state.dataUpdatedAt || 0;
|
|
79
|
+
const bTime = b.state.dataUpdatedAt || 0;
|
|
80
|
+
return bTime - aTime; // Most recent first
|
|
81
|
+
});
|
|
82
|
+
return filtered;
|
|
83
|
+
}, [allQueries, activeFilter, searchText, includedPatterns, ignoredPatterns]);
|
|
84
|
+
|
|
85
|
+
// Function to handle query selection with stable comparison
|
|
86
|
+
const handleQuerySelect = useCallback(query => {
|
|
87
|
+
// Compare queries by their queryKey and queryHash for stable selection
|
|
88
|
+
const isCurrentlySelected = selectedQuery?.queryHash === query.queryHash;
|
|
89
|
+
if (isCurrentlySelected) {
|
|
90
|
+
onQuerySelect(undefined); // Deselect
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
onQuerySelect(query);
|
|
94
|
+
}, [selectedQuery?.queryHash, onQuerySelect]);
|
|
95
|
+
if (filteredQueries.length === 0) {
|
|
96
|
+
return /*#__PURE__*/_jsx(View, {
|
|
97
|
+
style: styles.emptyContainer,
|
|
98
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
99
|
+
style: styles.emptyText,
|
|
100
|
+
children: emptyStateMessage || (activeFilter ? `No ${activeFilter} queries found` : "No queries found")
|
|
101
|
+
})
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
return /*#__PURE__*/_jsx(ScrollView, {
|
|
105
|
+
style: styles.listWrapper,
|
|
106
|
+
contentContainerStyle: contentContainerStyle || styles.listContent,
|
|
107
|
+
showsVerticalScrollIndicator: true,
|
|
108
|
+
children: filteredQueries.map(query => /*#__PURE__*/_jsx(QueryRow, {
|
|
109
|
+
query: query,
|
|
110
|
+
isSelected: selectedQuery?.queryHash === query.queryHash,
|
|
111
|
+
onSelect: handleQuerySelect
|
|
112
|
+
}, `${query.queryHash}-${query.state.dataUpdatedAt}-${query.state.fetchStatus}`))
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
const styles = StyleSheet.create({
|
|
116
|
+
listWrapper: {
|
|
117
|
+
flexGrow: 1
|
|
118
|
+
},
|
|
119
|
+
listContent: {
|
|
120
|
+
paddingBottom: 16,
|
|
121
|
+
backgroundColor: buoyColors.base
|
|
122
|
+
},
|
|
123
|
+
emptyContainer: {
|
|
124
|
+
flex: 1,
|
|
125
|
+
justifyContent: "center",
|
|
126
|
+
alignItems: "center",
|
|
127
|
+
padding: 32,
|
|
128
|
+
backgroundColor: buoyColors.card,
|
|
129
|
+
margin: 16,
|
|
130
|
+
borderRadius: 8,
|
|
131
|
+
borderWidth: 1,
|
|
132
|
+
borderColor: buoyColors.border
|
|
133
|
+
},
|
|
134
|
+
emptyText: {
|
|
135
|
+
color: buoyColors.textMuted,
|
|
136
|
+
fontSize: 14,
|
|
137
|
+
textAlign: "center",
|
|
138
|
+
fontFamily: "monospace",
|
|
139
|
+
letterSpacing: 0.5
|
|
140
|
+
}
|
|
141
|
+
});
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import QueryDetailsChip from "./QueryDetailsChip";
|
|
4
|
+
import { View, Text, ScrollView, StyleSheet } from "react-native";
|
|
5
|
+
import { displayValue, buoyColors } from "@buoy-gg/shared-ui";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
/**
|
|
8
|
+
* Renders the primary metadata summary for a selected query, including fetch status and timings.
|
|
9
|
+
*/
|
|
10
|
+
export default function QueryDetails({
|
|
11
|
+
query
|
|
12
|
+
}) {
|
|
13
|
+
if (query === undefined) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
// Convert the timestamp to a Date object and format it
|
|
17
|
+
const lastUpdated = new Date(query.state.dataUpdatedAt).toLocaleTimeString("en-US", {
|
|
18
|
+
hour: "2-digit",
|
|
19
|
+
minute: "2-digit",
|
|
20
|
+
second: "2-digit",
|
|
21
|
+
hour12: true
|
|
22
|
+
});
|
|
23
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
24
|
+
style: styles.minWidth,
|
|
25
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
26
|
+
style: styles.headerText,
|
|
27
|
+
children: "Query Details"
|
|
28
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
29
|
+
style: styles.row,
|
|
30
|
+
children: [/*#__PURE__*/_jsx(ScrollView, {
|
|
31
|
+
"sentry-label": "ignore devtools query details scroll",
|
|
32
|
+
horizontal: true,
|
|
33
|
+
style: styles.flexOne,
|
|
34
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
35
|
+
style: styles.queryKeyText,
|
|
36
|
+
children: displayValue(query.queryKey, true)
|
|
37
|
+
})
|
|
38
|
+
}), /*#__PURE__*/_jsx(QueryDetailsChip, {
|
|
39
|
+
query: query
|
|
40
|
+
})]
|
|
41
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
42
|
+
style: styles.row,
|
|
43
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
44
|
+
style: styles.labelText,
|
|
45
|
+
children: "Observers:"
|
|
46
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
47
|
+
style: styles.valueText,
|
|
48
|
+
children: `${query.getObserversCount()}`
|
|
49
|
+
})]
|
|
50
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
51
|
+
style: styles.row,
|
|
52
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
53
|
+
style: styles.labelText,
|
|
54
|
+
children: "Last Updated:"
|
|
55
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
56
|
+
style: styles.valueText,
|
|
57
|
+
children: `${lastUpdated}`
|
|
58
|
+
})]
|
|
59
|
+
})]
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
const styles = StyleSheet.create({
|
|
63
|
+
minWidth: {
|
|
64
|
+
minWidth: 200,
|
|
65
|
+
backgroundColor: buoyColors.card,
|
|
66
|
+
borderRadius: 6,
|
|
67
|
+
borderWidth: 1,
|
|
68
|
+
borderColor: buoyColors.primary + "4D",
|
|
69
|
+
overflow: "hidden",
|
|
70
|
+
shadowColor: buoyColors.primary,
|
|
71
|
+
shadowOffset: {
|
|
72
|
+
width: 0,
|
|
73
|
+
height: 0
|
|
74
|
+
},
|
|
75
|
+
shadowOpacity: 0.1,
|
|
76
|
+
shadowRadius: 6
|
|
77
|
+
},
|
|
78
|
+
headerText: {
|
|
79
|
+
backgroundColor: buoyColors.primary + "15",
|
|
80
|
+
paddingHorizontal: 12,
|
|
81
|
+
paddingVertical: 10,
|
|
82
|
+
fontWeight: "600",
|
|
83
|
+
fontSize: 12,
|
|
84
|
+
color: buoyColors.primary,
|
|
85
|
+
borderBottomWidth: 1,
|
|
86
|
+
borderBottomColor: buoyColors.primary + "33",
|
|
87
|
+
letterSpacing: 0.5,
|
|
88
|
+
textTransform: "uppercase",
|
|
89
|
+
fontFamily: "monospace"
|
|
90
|
+
},
|
|
91
|
+
row: {
|
|
92
|
+
flexDirection: "row",
|
|
93
|
+
justifyContent: "space-between",
|
|
94
|
+
alignItems: "center",
|
|
95
|
+
paddingHorizontal: 12,
|
|
96
|
+
paddingVertical: 10,
|
|
97
|
+
borderBottomWidth: 1,
|
|
98
|
+
borderBottomColor: buoyColors.textMuted + "66"
|
|
99
|
+
},
|
|
100
|
+
flexOne: {
|
|
101
|
+
flex: 1,
|
|
102
|
+
marginRight: 8
|
|
103
|
+
},
|
|
104
|
+
queryKeyText: {
|
|
105
|
+
fontSize: 12,
|
|
106
|
+
color: buoyColors.text,
|
|
107
|
+
fontFamily: "monospace",
|
|
108
|
+
lineHeight: 18,
|
|
109
|
+
flexShrink: 1,
|
|
110
|
+
backgroundColor: buoyColors.primary + "15",
|
|
111
|
+
paddingHorizontal: 8,
|
|
112
|
+
paddingVertical: 4,
|
|
113
|
+
borderRadius: 4,
|
|
114
|
+
borderWidth: 1,
|
|
115
|
+
borderColor: buoyColors.primary + "4D"
|
|
116
|
+
},
|
|
117
|
+
labelText: {
|
|
118
|
+
fontSize: 10,
|
|
119
|
+
color: buoyColors.textSecondary,
|
|
120
|
+
fontWeight: "600",
|
|
121
|
+
letterSpacing: 0.5,
|
|
122
|
+
textTransform: "uppercase",
|
|
123
|
+
fontFamily: "monospace"
|
|
124
|
+
},
|
|
125
|
+
valueText: {
|
|
126
|
+
fontSize: 12,
|
|
127
|
+
color: buoyColors.text,
|
|
128
|
+
fontWeight: "500",
|
|
129
|
+
fontVariant: ["tabular-nums"],
|
|
130
|
+
fontFamily: "monospace"
|
|
131
|
+
}
|
|
132
|
+
});
|