@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,233 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { JsModal, ModalHeader, TabSelector } from "@buoy-gg/shared-ui";
|
|
4
|
+
import { useGetQueryByQueryKey } from "../../hooks/useSelectedQuery";
|
|
5
|
+
import { ReactQueryModalHeader } from "./ReactQueryModalHeader";
|
|
6
|
+
import { QueryBrowserMode } from "../QueryBrowserMode";
|
|
7
|
+
import { QueryBrowserFooter } from "./QueryBrowserFooter";
|
|
8
|
+
import { QueryFilterViewV3 } from "../QueryFilterViewV3";
|
|
9
|
+
import { useState, useCallback, useEffect } from "react";
|
|
10
|
+
import { View, StyleSheet } from "react-native";
|
|
11
|
+
import { devToolsStorageKeys, useSafeAsyncStorage, buoyColors } from "@buoy-gg/shared-ui";
|
|
12
|
+
import useAllQueries from "../../hooks/useAllQueries";
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
/**
|
|
15
|
+
* Specialized modal for query browsing following "Decompose by Responsibility"
|
|
16
|
+
* Single purpose: Display query browser when no query is selected
|
|
17
|
+
*/
|
|
18
|
+
export function QueryBrowserModal({
|
|
19
|
+
visible,
|
|
20
|
+
selectedQueryKey,
|
|
21
|
+
onQuerySelect,
|
|
22
|
+
onClose,
|
|
23
|
+
onMinimize,
|
|
24
|
+
activeFilter: externalActiveFilter,
|
|
25
|
+
onFilterChange: externalOnFilterChange,
|
|
26
|
+
enableSharedModalDimensions = false,
|
|
27
|
+
onTabChange,
|
|
28
|
+
searchText = "",
|
|
29
|
+
onSearchChange
|
|
30
|
+
}) {
|
|
31
|
+
const selectedQuery = useGetQueryByQueryKey(selectedQueryKey);
|
|
32
|
+
const allQueries = useAllQueries();
|
|
33
|
+
|
|
34
|
+
// Use external filter state if provided (for persistence), otherwise use internal state
|
|
35
|
+
const [internalActiveFilter, setInternalActiveFilter] = useState(null);
|
|
36
|
+
const activeFilter = externalActiveFilter ?? internalActiveFilter;
|
|
37
|
+
const setActiveFilter = externalOnFilterChange ?? setInternalActiveFilter;
|
|
38
|
+
|
|
39
|
+
// Filter modal state
|
|
40
|
+
const [showFilterView, setShowFilterView] = useState(false);
|
|
41
|
+
const [ignoredPatterns, setIgnoredPatterns] = useState(new Set());
|
|
42
|
+
const [includedPatterns, setIncludedPatterns] = useState(new Set());
|
|
43
|
+
|
|
44
|
+
// AsyncStorage for persisting ignored patterns
|
|
45
|
+
const {
|
|
46
|
+
getItem: safeGetItem,
|
|
47
|
+
setItem: safeSetItem
|
|
48
|
+
} = useSafeAsyncStorage();
|
|
49
|
+
|
|
50
|
+
// Load ignored patterns from storage on mount
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
const loadFilters = async () => {
|
|
53
|
+
try {
|
|
54
|
+
const stored = await safeGetItem(devToolsStorageKeys.reactQuery.ignoredPatterns());
|
|
55
|
+
if (stored) {
|
|
56
|
+
const patterns = JSON.parse(stored);
|
|
57
|
+
if (Array.isArray(patterns)) {
|
|
58
|
+
setIgnoredPatterns(new Set(patterns));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
} catch (error) {
|
|
62
|
+
console.error("Failed to load ignored patterns:", error);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
loadFilters();
|
|
66
|
+
}, [safeGetItem]);
|
|
67
|
+
|
|
68
|
+
// Load included patterns from storage on mount
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
const loadFilters = async () => {
|
|
71
|
+
try {
|
|
72
|
+
const stored = await safeGetItem(devToolsStorageKeys.reactQuery.includedPatterns());
|
|
73
|
+
if (stored) {
|
|
74
|
+
const patterns = JSON.parse(stored);
|
|
75
|
+
if (Array.isArray(patterns)) {
|
|
76
|
+
setIncludedPatterns(new Set(patterns));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
} catch (error) {
|
|
80
|
+
console.error("Failed to load included patterns:", error);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
loadFilters();
|
|
84
|
+
}, [safeGetItem]);
|
|
85
|
+
|
|
86
|
+
// Save ignored patterns to storage when they change
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
const saveFilters = async () => {
|
|
89
|
+
try {
|
|
90
|
+
const patterns = Array.from(ignoredPatterns);
|
|
91
|
+
await safeSetItem(devToolsStorageKeys.reactQuery.ignoredPatterns(), JSON.stringify(patterns));
|
|
92
|
+
} catch (error) {
|
|
93
|
+
console.error("Failed to save ignored patterns:", error);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
saveFilters();
|
|
97
|
+
}, [ignoredPatterns, safeSetItem]);
|
|
98
|
+
|
|
99
|
+
// Save included patterns to storage when they change
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
const saveFilters = async () => {
|
|
102
|
+
try {
|
|
103
|
+
const patterns = Array.from(includedPatterns);
|
|
104
|
+
await safeSetItem(devToolsStorageKeys.reactQuery.includedPatterns(), JSON.stringify(patterns));
|
|
105
|
+
} catch (error) {
|
|
106
|
+
console.error("Failed to save included patterns:", error);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
saveFilters();
|
|
110
|
+
}, [includedPatterns, safeSetItem]);
|
|
111
|
+
|
|
112
|
+
// Toggle pattern in ignored set
|
|
113
|
+
const handlePatternToggle = useCallback(pattern => {
|
|
114
|
+
setIgnoredPatterns(prev => {
|
|
115
|
+
const newSet = new Set(prev);
|
|
116
|
+
if (newSet.has(pattern)) {
|
|
117
|
+
newSet.delete(pattern);
|
|
118
|
+
} else {
|
|
119
|
+
newSet.add(pattern);
|
|
120
|
+
}
|
|
121
|
+
return newSet;
|
|
122
|
+
});
|
|
123
|
+
}, []);
|
|
124
|
+
|
|
125
|
+
// Toggle pattern in included set
|
|
126
|
+
const handleIncludedPatternToggle = useCallback(pattern => {
|
|
127
|
+
setIncludedPatterns(prev => {
|
|
128
|
+
const newSet = new Set(prev);
|
|
129
|
+
if (newSet.has(pattern)) {
|
|
130
|
+
newSet.delete(pattern);
|
|
131
|
+
} else {
|
|
132
|
+
newSet.add(pattern);
|
|
133
|
+
}
|
|
134
|
+
return newSet;
|
|
135
|
+
});
|
|
136
|
+
}, []);
|
|
137
|
+
|
|
138
|
+
// Track modal mode for conditional styling
|
|
139
|
+
const [modalMode, setModalMode] = useState("bottomSheet");
|
|
140
|
+
const storagePrefix = enableSharedModalDimensions ? devToolsStorageKeys.reactQuery.modal() : devToolsStorageKeys.reactQuery.browserModal();
|
|
141
|
+
const handleModeChange = useCallback(mode => {
|
|
142
|
+
setModalMode(mode);
|
|
143
|
+
}, []);
|
|
144
|
+
if (!visible) return null;
|
|
145
|
+
const renderHeaderContent = () => {
|
|
146
|
+
// Filter view header with back button
|
|
147
|
+
if (showFilterView) {
|
|
148
|
+
const tabs = [{
|
|
149
|
+
key: "filters",
|
|
150
|
+
label: "Filters"
|
|
151
|
+
}];
|
|
152
|
+
return /*#__PURE__*/_jsxs(ModalHeader, {
|
|
153
|
+
children: [/*#__PURE__*/_jsx(ModalHeader.Navigation, {
|
|
154
|
+
onBack: () => setShowFilterView(false)
|
|
155
|
+
}), /*#__PURE__*/_jsx(ModalHeader.Content, {
|
|
156
|
+
title: "",
|
|
157
|
+
noMargin: true,
|
|
158
|
+
children: /*#__PURE__*/_jsx(TabSelector, {
|
|
159
|
+
tabs: tabs,
|
|
160
|
+
activeTab: "filters",
|
|
161
|
+
onTabChange: () => {}
|
|
162
|
+
})
|
|
163
|
+
})]
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Normal query browser header
|
|
168
|
+
return /*#__PURE__*/_jsx(ReactQueryModalHeader, {
|
|
169
|
+
selectedQuery: selectedQuery,
|
|
170
|
+
activeTab: "queries",
|
|
171
|
+
onTabChange: onTabChange,
|
|
172
|
+
onBack: () => onQuerySelect(undefined),
|
|
173
|
+
searchText: searchText,
|
|
174
|
+
onSearchChange: onSearchChange,
|
|
175
|
+
onFilterPress: () => setShowFilterView(true),
|
|
176
|
+
hasActiveFilters: activeFilter !== null || ignoredPatterns.size > 0 || includedPatterns.size > 0
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
const footerNode = /*#__PURE__*/_jsx(QueryBrowserFooter, {
|
|
180
|
+
activeFilter: activeFilter,
|
|
181
|
+
onFilterChange: setActiveFilter,
|
|
182
|
+
isFloatingMode: modalMode === "floating"
|
|
183
|
+
});
|
|
184
|
+
return /*#__PURE__*/_jsx(JsModal, {
|
|
185
|
+
visible: visible,
|
|
186
|
+
onClose: onClose,
|
|
187
|
+
onMinimize: onMinimize,
|
|
188
|
+
persistenceKey: storagePrefix,
|
|
189
|
+
header: {
|
|
190
|
+
customContent: renderHeaderContent(),
|
|
191
|
+
showToggleButton: true
|
|
192
|
+
},
|
|
193
|
+
onModeChange: handleModeChange,
|
|
194
|
+
enablePersistence: true,
|
|
195
|
+
initialMode: "bottomSheet",
|
|
196
|
+
enableGlitchEffects: true,
|
|
197
|
+
styles: {},
|
|
198
|
+
footer: !showFilterView ? footerNode : undefined,
|
|
199
|
+
footerHeight: !showFilterView ? 56 : undefined,
|
|
200
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
201
|
+
style: styles.container,
|
|
202
|
+
children: showFilterView ?
|
|
203
|
+
/*#__PURE__*/
|
|
204
|
+
/* Show filter view */
|
|
205
|
+
_jsx(QueryFilterViewV3, {
|
|
206
|
+
queries: allQueries,
|
|
207
|
+
activeFilter: activeFilter,
|
|
208
|
+
onFilterChange: setActiveFilter,
|
|
209
|
+
ignoredPatterns: ignoredPatterns,
|
|
210
|
+
onPatternToggle: handlePatternToggle,
|
|
211
|
+
includedPatterns: includedPatterns,
|
|
212
|
+
onIncludedPatternToggle: handleIncludedPatternToggle
|
|
213
|
+
}) :
|
|
214
|
+
/*#__PURE__*/
|
|
215
|
+
/* Show query browser */
|
|
216
|
+
_jsx(QueryBrowserMode, {
|
|
217
|
+
selectedQuery: selectedQuery,
|
|
218
|
+
onQuerySelect: onQuerySelect,
|
|
219
|
+
activeFilter: activeFilter,
|
|
220
|
+
searchText: searchText,
|
|
221
|
+
ignoredPatterns: ignoredPatterns,
|
|
222
|
+
includedPatterns: includedPatterns,
|
|
223
|
+
onFilterPress: () => setShowFilterView(true)
|
|
224
|
+
})
|
|
225
|
+
})
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
const styles = StyleSheet.create({
|
|
229
|
+
container: {
|
|
230
|
+
flex: 1,
|
|
231
|
+
backgroundColor: buoyColors.base
|
|
232
|
+
}
|
|
233
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { QueryBrowserModal } from "./QueryBrowserModal";
|
|
4
|
+
import { DataEditorModal } from "./DataEditorModal";
|
|
5
|
+
import { MutationBrowserModal } from "./MutationBrowserModal";
|
|
6
|
+
import { MutationEditorModal } from "./MutationEditorModal";
|
|
7
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
/**
|
|
9
|
+
* Refactored ReactQueryModal following composition principles
|
|
10
|
+
*
|
|
11
|
+
* Applied principles:
|
|
12
|
+
* - Decompose by Responsibility: Separated query browser and data editor modals
|
|
13
|
+
* - Prefer Composition over Configuration: Uses specialized modal components
|
|
14
|
+
* - Extract Reusable Logic: Modal routing logic based on query selection
|
|
15
|
+
* - Utilize Render Props: Each modal handles its own rendering responsibility
|
|
16
|
+
*/
|
|
17
|
+
export function ReactQueryModal({
|
|
18
|
+
visible,
|
|
19
|
+
selectedQueryKey,
|
|
20
|
+
selectedMutationId,
|
|
21
|
+
onQuerySelect,
|
|
22
|
+
onMutationSelect,
|
|
23
|
+
onClose,
|
|
24
|
+
onMinimize,
|
|
25
|
+
activeFilter,
|
|
26
|
+
onFilterChange,
|
|
27
|
+
activeTab,
|
|
28
|
+
onTabChange,
|
|
29
|
+
enableSharedModalDimensions = false,
|
|
30
|
+
searchText = "",
|
|
31
|
+
onSearchChange
|
|
32
|
+
}) {
|
|
33
|
+
// Check if we have a key/id even if the query/mutation hasn't been found yet
|
|
34
|
+
const inDetail = !!selectedQueryKey || !!selectedMutationId;
|
|
35
|
+
const isQueryMode = activeTab === "queries";
|
|
36
|
+
const isMutationMode = activeTab === "mutations";
|
|
37
|
+
const commonProps = {
|
|
38
|
+
onClose,
|
|
39
|
+
onMinimize,
|
|
40
|
+
activeFilter,
|
|
41
|
+
onFilterChange,
|
|
42
|
+
enableSharedModalDimensions
|
|
43
|
+
};
|
|
44
|
+
const showQueryBrowserModal = visible && !inDetail && isQueryMode;
|
|
45
|
+
const showMutationBrowserModal = visible && !inDetail && isMutationMode;
|
|
46
|
+
const showDataEditorModal = visible && inDetail && isQueryMode && !!selectedQueryKey;
|
|
47
|
+
const showMutationEditorModal = visible && inDetail && isMutationMode && !!selectedMutationId;
|
|
48
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
49
|
+
children: [/*#__PURE__*/_jsx(QueryBrowserModal, {
|
|
50
|
+
visible: showQueryBrowserModal,
|
|
51
|
+
selectedQueryKey: selectedQueryKey,
|
|
52
|
+
onQuerySelect: onQuerySelect,
|
|
53
|
+
onTabChange: onTabChange,
|
|
54
|
+
searchText: searchText,
|
|
55
|
+
onSearchChange: onSearchChange,
|
|
56
|
+
...commonProps
|
|
57
|
+
}), /*#__PURE__*/_jsx(MutationBrowserModal, {
|
|
58
|
+
visible: showMutationBrowserModal,
|
|
59
|
+
selectedMutationId: selectedMutationId,
|
|
60
|
+
onMutationSelect: onMutationSelect,
|
|
61
|
+
onTabChange: onTabChange,
|
|
62
|
+
searchText: searchText,
|
|
63
|
+
onSearchChange: onSearchChange,
|
|
64
|
+
...commonProps
|
|
65
|
+
}), /*#__PURE__*/_jsx(DataEditorModal, {
|
|
66
|
+
visible: showDataEditorModal,
|
|
67
|
+
selectedQueryKey: selectedQueryKey,
|
|
68
|
+
onQuerySelect: onQuerySelect,
|
|
69
|
+
onTabChange: onTabChange,
|
|
70
|
+
...commonProps
|
|
71
|
+
}), /*#__PURE__*/_jsx(MutationEditorModal, {
|
|
72
|
+
visible: showMutationEditorModal,
|
|
73
|
+
selectedMutationId: selectedMutationId,
|
|
74
|
+
onMutationSelect: onMutationSelect,
|
|
75
|
+
onTabChange: onTabChange,
|
|
76
|
+
...commonProps
|
|
77
|
+
})]
|
|
78
|
+
});
|
|
79
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { ModalHeader, TabSelector, Search, X, Filter, buoyColors } from "@buoy-gg/shared-ui";
|
|
4
|
+
import { useState, useRef, useEffect } from "react";
|
|
5
|
+
import { View, TextInput, TouchableOpacity, StyleSheet } from "react-native";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
/**
|
|
8
|
+
* Shared header for all React Query modals. Handles tab switching when browsing and presents
|
|
9
|
+
* breadcrumbs when a specific query or mutation is selected.
|
|
10
|
+
*/
|
|
11
|
+
export function ReactQueryModalHeader({
|
|
12
|
+
selectedQuery,
|
|
13
|
+
selectedMutation,
|
|
14
|
+
activeTab,
|
|
15
|
+
onTabChange,
|
|
16
|
+
onBack,
|
|
17
|
+
searchText = "",
|
|
18
|
+
onSearchChange,
|
|
19
|
+
onFilterPress,
|
|
20
|
+
hasActiveFilters = false
|
|
21
|
+
}) {
|
|
22
|
+
const [isSearchActive, setIsSearchActive] = useState(false);
|
|
23
|
+
const searchInputRef = useRef(null);
|
|
24
|
+
|
|
25
|
+
// Auto-focus search input when search becomes active
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (isSearchActive && searchInputRef.current) {
|
|
28
|
+
searchInputRef.current.focus();
|
|
29
|
+
}
|
|
30
|
+
}, [isSearchActive]);
|
|
31
|
+
const handleSearchToggle = () => {
|
|
32
|
+
setIsSearchActive(!isSearchActive);
|
|
33
|
+
if (isSearchActive && onSearchChange) {
|
|
34
|
+
onSearchChange("");
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const handleSearch = text => {
|
|
38
|
+
if (onSearchChange) {
|
|
39
|
+
onSearchChange(text);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
// Simple function to get query display text
|
|
43
|
+
const getQueryText = query => {
|
|
44
|
+
if (!query?.queryKey) return "Unknown Query";
|
|
45
|
+
const keys = Array.isArray(query.queryKey) ? query.queryKey : [query.queryKey];
|
|
46
|
+
return keys.filter(k => k != null).map(k => String(k)).join(" › ") || "Unknown Query";
|
|
47
|
+
};
|
|
48
|
+
const getItemText = item => {
|
|
49
|
+
if ("queryKey" in item) {
|
|
50
|
+
return getQueryText(item);
|
|
51
|
+
} else {
|
|
52
|
+
return item.options.mutationKey ? (Array.isArray(item.options.mutationKey) ? item.options.mutationKey : [item.options.mutationKey]).filter(k => k != null).map(k => String(k)).join(" › ") || `Mutation #${item.mutationId}` : `Mutation #${item.mutationId}`;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const tabs = [{
|
|
56
|
+
key: "queries",
|
|
57
|
+
label: "Queries"
|
|
58
|
+
}, {
|
|
59
|
+
key: "mutations",
|
|
60
|
+
label: "Mutations"
|
|
61
|
+
}];
|
|
62
|
+
|
|
63
|
+
// Show details view when an item is selected
|
|
64
|
+
if (selectedQuery || selectedMutation) {
|
|
65
|
+
return /*#__PURE__*/_jsxs(ModalHeader, {
|
|
66
|
+
children: [/*#__PURE__*/_jsx(ModalHeader.Navigation, {
|
|
67
|
+
onBack: onBack
|
|
68
|
+
}), /*#__PURE__*/_jsx(ModalHeader.Content, {
|
|
69
|
+
title: getItemText(selectedQuery ?? selectedMutation)
|
|
70
|
+
})]
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Show browser view with tabs when no item is selected
|
|
75
|
+
return /*#__PURE__*/_jsxs(ModalHeader, {
|
|
76
|
+
children: [/*#__PURE__*/_jsx(ModalHeader.Content, {
|
|
77
|
+
title: "",
|
|
78
|
+
noMargin: true,
|
|
79
|
+
children: isSearchActive ? /*#__PURE__*/_jsxs(View, {
|
|
80
|
+
style: styles.headerSearchContainer,
|
|
81
|
+
children: [/*#__PURE__*/_jsx(Search, {
|
|
82
|
+
size: 14,
|
|
83
|
+
color: buoyColors.textSecondary
|
|
84
|
+
}), /*#__PURE__*/_jsx(TextInput, {
|
|
85
|
+
ref: searchInputRef,
|
|
86
|
+
style: styles.headerSearchInput,
|
|
87
|
+
placeholder: "Search query keys...",
|
|
88
|
+
placeholderTextColor: buoyColors.textMuted,
|
|
89
|
+
value: searchText,
|
|
90
|
+
onChangeText: handleSearch,
|
|
91
|
+
onSubmitEditing: () => setIsSearchActive(false),
|
|
92
|
+
onBlur: () => setIsSearchActive(false),
|
|
93
|
+
"sentry-label": "ignore react query search header",
|
|
94
|
+
accessibilityLabel: "Search queries and mutations",
|
|
95
|
+
autoCapitalize: "none",
|
|
96
|
+
autoCorrect: false,
|
|
97
|
+
returnKeyType: "search"
|
|
98
|
+
}), searchText.length > 0 ? /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
99
|
+
onPress: () => {
|
|
100
|
+
handleSearch("");
|
|
101
|
+
setIsSearchActive(false);
|
|
102
|
+
},
|
|
103
|
+
"sentry-label": "ignore clear search header",
|
|
104
|
+
style: styles.headerSearchClear,
|
|
105
|
+
children: /*#__PURE__*/_jsx(X, {
|
|
106
|
+
size: 14,
|
|
107
|
+
color: buoyColors.textSecondary
|
|
108
|
+
})
|
|
109
|
+
}) : null]
|
|
110
|
+
}) : /*#__PURE__*/_jsx(TabSelector, {
|
|
111
|
+
tabs: tabs,
|
|
112
|
+
activeTab: activeTab,
|
|
113
|
+
onTabChange: tab => onTabChange(tab)
|
|
114
|
+
})
|
|
115
|
+
}), /*#__PURE__*/_jsxs(ModalHeader.Actions, {
|
|
116
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
117
|
+
"sentry-label": "ignore open search",
|
|
118
|
+
onPress: handleSearchToggle,
|
|
119
|
+
style: styles.headerActionButton,
|
|
120
|
+
children: /*#__PURE__*/_jsx(Search, {
|
|
121
|
+
size: 14,
|
|
122
|
+
color: buoyColors.textSecondary
|
|
123
|
+
})
|
|
124
|
+
}), onFilterPress && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
125
|
+
"sentry-label": "ignore open filter",
|
|
126
|
+
onPress: onFilterPress,
|
|
127
|
+
style: [styles.headerActionButton, hasActiveFilters && styles.activeFilterButton],
|
|
128
|
+
children: /*#__PURE__*/_jsx(Filter, {
|
|
129
|
+
size: 14,
|
|
130
|
+
color: hasActiveFilters ? buoyColors.primary : buoyColors.textSecondary
|
|
131
|
+
})
|
|
132
|
+
})]
|
|
133
|
+
})]
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
const styles = StyleSheet.create({
|
|
137
|
+
headerSearchContainer: {
|
|
138
|
+
flexDirection: "row",
|
|
139
|
+
alignItems: "center",
|
|
140
|
+
backgroundColor: buoyColors.input,
|
|
141
|
+
borderRadius: 6,
|
|
142
|
+
paddingHorizontal: 8,
|
|
143
|
+
paddingVertical: 4,
|
|
144
|
+
gap: 6,
|
|
145
|
+
marginHorizontal: 12,
|
|
146
|
+
marginVertical: 8
|
|
147
|
+
},
|
|
148
|
+
headerSearchInput: {
|
|
149
|
+
flex: 1,
|
|
150
|
+
color: buoyColors.text,
|
|
151
|
+
fontSize: 13,
|
|
152
|
+
fontFamily: "monospace",
|
|
153
|
+
padding: 0,
|
|
154
|
+
margin: 0,
|
|
155
|
+
minHeight: 18
|
|
156
|
+
},
|
|
157
|
+
headerSearchClear: {
|
|
158
|
+
padding: 2
|
|
159
|
+
},
|
|
160
|
+
headerActionButton: {
|
|
161
|
+
padding: 6,
|
|
162
|
+
borderRadius: 4
|
|
163
|
+
},
|
|
164
|
+
activeFilterButton: {
|
|
165
|
+
backgroundColor: buoyColors.primary + "33"
|
|
166
|
+
}
|
|
167
|
+
});
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { View, StyleSheet, Animated } from "react-native";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
import { ChevronLeft, ChevronRight, buoyColors } from "@buoy-gg/shared-ui";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Morphing swipe indicator – thin line ➜ pill ➜ circle with a pop-out cue at
|
|
9
|
+
* full commit. Visual-only; gesture logic lives upstream.
|
|
10
|
+
*/
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
/* -------------------------------------------------------------------------- */
|
|
13
|
+
// VISUAL CONSTANTS – tuned for typical back-gesture UX
|
|
14
|
+
/* -------------------------------------------------------------------------- */
|
|
15
|
+
const INDICATOR_HEIGHT = 32; // ⬆️ bigger circle (line height)
|
|
16
|
+
const MIN_WIDTH = 6; // hairline start
|
|
17
|
+
const MAX_WIDTH = INDICATOR_HEIGHT; // circle when width == height
|
|
18
|
+
const DEFAULT_MAX_TRANSLATION = 120;
|
|
19
|
+
const POP_OUT_START = 0.95; // progress at which pop-out begins
|
|
20
|
+
const POP_OUT_SCALE = 1.15; // final scale factor when fully committed
|
|
21
|
+
|
|
22
|
+
export function SwipeIndicator({
|
|
23
|
+
translationX,
|
|
24
|
+
maxTranslation = DEFAULT_MAX_TRANSLATION,
|
|
25
|
+
canSwipeLeft = true,
|
|
26
|
+
canSwipeRight = true
|
|
27
|
+
}) {
|
|
28
|
+
/* ---------------- LEFT EDGE (Back) ---------------- */
|
|
29
|
+
const leftProgress = useMemo(() => {
|
|
30
|
+
return translationX.interpolate({
|
|
31
|
+
inputRange: [0, maxTranslation],
|
|
32
|
+
outputRange: [0, 1],
|
|
33
|
+
extrapolate: "clamp"
|
|
34
|
+
});
|
|
35
|
+
}, [translationX, maxTranslation]);
|
|
36
|
+
const leftIndicatorWidth = useMemo(() => {
|
|
37
|
+
return leftProgress.interpolate({
|
|
38
|
+
inputRange: [0, 1],
|
|
39
|
+
outputRange: [MIN_WIDTH, MAX_WIDTH]
|
|
40
|
+
});
|
|
41
|
+
}, [leftProgress]);
|
|
42
|
+
const leftIndicatorScale = useMemo(() => {
|
|
43
|
+
return leftProgress.interpolate({
|
|
44
|
+
inputRange: [0, POP_OUT_START, 1],
|
|
45
|
+
outputRange: [1, 1, POP_OUT_SCALE]
|
|
46
|
+
});
|
|
47
|
+
}, [leftProgress]);
|
|
48
|
+
const leftIndicatorTranslateX = useMemo(() => {
|
|
49
|
+
return leftProgress.interpolate({
|
|
50
|
+
inputRange: [0, 0.99, 1],
|
|
51
|
+
outputRange: [0, 0, 16]
|
|
52
|
+
});
|
|
53
|
+
}, [leftProgress]);
|
|
54
|
+
const leftIndicatorOpacity = useMemo(() => {
|
|
55
|
+
return leftProgress.interpolate({
|
|
56
|
+
inputRange: [0, 0.01],
|
|
57
|
+
outputRange: [0, 1],
|
|
58
|
+
extrapolate: "clamp"
|
|
59
|
+
});
|
|
60
|
+
}, [leftProgress]);
|
|
61
|
+
const leftArrowOpacity = useMemo(() => {
|
|
62
|
+
return leftProgress.interpolate({
|
|
63
|
+
inputRange: [0, 0.5, 1],
|
|
64
|
+
outputRange: [0, 0, 1],
|
|
65
|
+
extrapolate: "clamp"
|
|
66
|
+
});
|
|
67
|
+
}, [leftProgress]);
|
|
68
|
+
const leftArrowScale = useMemo(() => {
|
|
69
|
+
return leftProgress.interpolate({
|
|
70
|
+
inputRange: [0, 0.5, POP_OUT_START, 1],
|
|
71
|
+
outputRange: [0.8, 0.8, 1, 1.2]
|
|
72
|
+
});
|
|
73
|
+
}, [leftProgress]);
|
|
74
|
+
|
|
75
|
+
/* ---------------- RIGHT EDGE ---------------- */
|
|
76
|
+
const rightProgress = useMemo(() => {
|
|
77
|
+
return translationX.interpolate({
|
|
78
|
+
inputRange: [-maxTranslation, 0],
|
|
79
|
+
outputRange: [1, 0],
|
|
80
|
+
extrapolate: "clamp"
|
|
81
|
+
});
|
|
82
|
+
}, [translationX, maxTranslation]);
|
|
83
|
+
const rightIndicatorWidth = useMemo(() => {
|
|
84
|
+
return rightProgress.interpolate({
|
|
85
|
+
inputRange: [0, 1],
|
|
86
|
+
outputRange: [MIN_WIDTH, MAX_WIDTH]
|
|
87
|
+
});
|
|
88
|
+
}, [rightProgress]);
|
|
89
|
+
const rightIndicatorScale = useMemo(() => {
|
|
90
|
+
return rightProgress.interpolate({
|
|
91
|
+
inputRange: [0, POP_OUT_START, 1],
|
|
92
|
+
outputRange: [1, 1, POP_OUT_SCALE]
|
|
93
|
+
});
|
|
94
|
+
}, [rightProgress]);
|
|
95
|
+
const rightIndicatorTranslateX = useMemo(() => {
|
|
96
|
+
return rightProgress.interpolate({
|
|
97
|
+
inputRange: [0, 0.99, 1],
|
|
98
|
+
outputRange: [0, 0, -16]
|
|
99
|
+
});
|
|
100
|
+
}, [rightProgress]);
|
|
101
|
+
const rightIndicatorOpacity = useMemo(() => {
|
|
102
|
+
return rightProgress.interpolate({
|
|
103
|
+
inputRange: [0, 0.01],
|
|
104
|
+
outputRange: [0, 1],
|
|
105
|
+
extrapolate: "clamp"
|
|
106
|
+
});
|
|
107
|
+
}, [rightProgress]);
|
|
108
|
+
const rightArrowOpacity = useMemo(() => {
|
|
109
|
+
return rightProgress.interpolate({
|
|
110
|
+
inputRange: [0, 0.5, 1],
|
|
111
|
+
outputRange: [0, 0, 1],
|
|
112
|
+
extrapolate: "clamp"
|
|
113
|
+
});
|
|
114
|
+
}, [rightProgress]);
|
|
115
|
+
const rightArrowScale = useMemo(() => {
|
|
116
|
+
return rightProgress.interpolate({
|
|
117
|
+
inputRange: [0, 0.5, POP_OUT_START, 1],
|
|
118
|
+
outputRange: [0.8, 0.8, 1, 1.2]
|
|
119
|
+
});
|
|
120
|
+
}, [rightProgress]);
|
|
121
|
+
|
|
122
|
+
/* ---------------- Render ---------------- */
|
|
123
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
124
|
+
style: styles.container,
|
|
125
|
+
pointerEvents: "none",
|
|
126
|
+
children: [canSwipeRight && /*#__PURE__*/_jsx(Animated.View, {
|
|
127
|
+
style: [styles.leftWrapper, {
|
|
128
|
+
width: leftIndicatorWidth,
|
|
129
|
+
height: INDICATOR_HEIGHT,
|
|
130
|
+
borderRadius: INDICATOR_HEIGHT / 2,
|
|
131
|
+
backgroundColor: buoyColors.text + "E6",
|
|
132
|
+
justifyContent: "center",
|
|
133
|
+
alignItems: "center",
|
|
134
|
+
opacity: leftIndicatorOpacity,
|
|
135
|
+
transform: [{
|
|
136
|
+
scale: leftIndicatorScale
|
|
137
|
+
}, {
|
|
138
|
+
translateX: leftIndicatorTranslateX
|
|
139
|
+
}]
|
|
140
|
+
}],
|
|
141
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
142
|
+
style: {
|
|
143
|
+
opacity: leftArrowOpacity,
|
|
144
|
+
transform: [{
|
|
145
|
+
scale: leftArrowScale
|
|
146
|
+
}]
|
|
147
|
+
},
|
|
148
|
+
children: /*#__PURE__*/_jsx(ChevronLeft, {
|
|
149
|
+
size: INDICATOR_HEIGHT * 0.6,
|
|
150
|
+
color: buoyColors.primary,
|
|
151
|
+
strokeWidth: 3
|
|
152
|
+
})
|
|
153
|
+
})
|
|
154
|
+
}), canSwipeLeft && /*#__PURE__*/_jsx(Animated.View, {
|
|
155
|
+
style: [styles.rightWrapper, {
|
|
156
|
+
width: rightIndicatorWidth,
|
|
157
|
+
height: INDICATOR_HEIGHT,
|
|
158
|
+
borderRadius: INDICATOR_HEIGHT / 2,
|
|
159
|
+
backgroundColor: buoyColors.text + "E6",
|
|
160
|
+
justifyContent: "center",
|
|
161
|
+
alignItems: "center",
|
|
162
|
+
opacity: rightIndicatorOpacity,
|
|
163
|
+
transform: [{
|
|
164
|
+
scale: rightIndicatorScale
|
|
165
|
+
}, {
|
|
166
|
+
translateX: rightIndicatorTranslateX
|
|
167
|
+
}]
|
|
168
|
+
}],
|
|
169
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
170
|
+
style: {
|
|
171
|
+
opacity: rightArrowOpacity,
|
|
172
|
+
transform: [{
|
|
173
|
+
scale: rightArrowScale
|
|
174
|
+
}]
|
|
175
|
+
},
|
|
176
|
+
children: /*#__PURE__*/_jsx(ChevronRight, {
|
|
177
|
+
size: INDICATOR_HEIGHT * 0.6,
|
|
178
|
+
color: buoyColors.primary,
|
|
179
|
+
strokeWidth: 3
|
|
180
|
+
})
|
|
181
|
+
})
|
|
182
|
+
})]
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
const styles = StyleSheet.create({
|
|
186
|
+
container: {
|
|
187
|
+
...StyleSheet.absoluteFillObject,
|
|
188
|
+
zIndex: 1000,
|
|
189
|
+
justifyContent: "center",
|
|
190
|
+
alignItems: "center"
|
|
191
|
+
},
|
|
192
|
+
leftWrapper: {
|
|
193
|
+
position: "absolute",
|
|
194
|
+
left: 16
|
|
195
|
+
},
|
|
196
|
+
rightWrapper: {
|
|
197
|
+
position: "absolute",
|
|
198
|
+
right: 16
|
|
199
|
+
}
|
|
200
|
+
});
|