@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,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = deleteItem;
|
|
7
|
+
var _deleteNestedDataByPath = require("../deleteNestedDataByPath");
|
|
8
|
+
function deleteItem({
|
|
9
|
+
activeQuery,
|
|
10
|
+
dataPath,
|
|
11
|
+
queryClient
|
|
12
|
+
}) {
|
|
13
|
+
if (!dataPath) {
|
|
14
|
+
// Early return if path is missing
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const oldData = activeQuery.state.data;
|
|
18
|
+
const newData = (0, _deleteNestedDataByPath.deleteNestedDataByPath)(oldData, dataPath);
|
|
19
|
+
|
|
20
|
+
// Force a new object reference to ensure React detects the change
|
|
21
|
+
const forceNewReference = JSON.parse(JSON.stringify(newData));
|
|
22
|
+
queryClient.setQueryData(activeQuery.queryKey, forceNewReference);
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = invalidate;
|
|
7
|
+
function invalidate({
|
|
8
|
+
query,
|
|
9
|
+
queryClient
|
|
10
|
+
}) {
|
|
11
|
+
// This matches the ACTION-INVALIDATE case from the external sync system
|
|
12
|
+
queryClient.invalidateQueries(query);
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = refetch;
|
|
7
|
+
function refetch({
|
|
8
|
+
query
|
|
9
|
+
}) {
|
|
10
|
+
// This matches the ACTION-REFETCH case from the external sync system
|
|
11
|
+
const promise = query.fetch();
|
|
12
|
+
promise.catch(() => {
|
|
13
|
+
// Silently handle fetch errors
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = triggerError;
|
|
7
|
+
function triggerError({
|
|
8
|
+
query,
|
|
9
|
+
queryClient
|
|
10
|
+
}) {
|
|
11
|
+
if (query.state.status !== "error") {
|
|
12
|
+
// --ACTION-TRIGGER-ERROR logic--
|
|
13
|
+
// This matches the ACTION-TRIGGER-ERROR case from the external sync system
|
|
14
|
+
const error = new Error("Unknown error from devtools");
|
|
15
|
+
const __previousQueryOptions = query.options;
|
|
16
|
+
query.setState({
|
|
17
|
+
status: "error",
|
|
18
|
+
error,
|
|
19
|
+
fetchMeta: {
|
|
20
|
+
...query.state.fetchMeta,
|
|
21
|
+
// @ts-expect-error This does exist
|
|
22
|
+
__previousQueryOptions
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
} else {
|
|
26
|
+
// --ACTION-RESTORE-ERROR logic--
|
|
27
|
+
// This matches the ACTION-RESTORE-ERROR case from the external sync system
|
|
28
|
+
queryClient.resetQueries(query);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = triggerLoading;
|
|
7
|
+
function triggerLoading({
|
|
8
|
+
query
|
|
9
|
+
}) {
|
|
10
|
+
if (query.state.data === undefined) {
|
|
11
|
+
// --ACTION-RESTORE-LOADING logic--
|
|
12
|
+
// This matches the ACTION-RESTORE-LOADING case from the external sync system
|
|
13
|
+
const previousState = query.state;
|
|
14
|
+
const previousOptions = query.state.fetchMeta ? query.state.fetchMeta.__previousQueryOptions : null;
|
|
15
|
+
query.cancel({
|
|
16
|
+
silent: true
|
|
17
|
+
});
|
|
18
|
+
query.setState({
|
|
19
|
+
...previousState,
|
|
20
|
+
fetchStatus: "idle",
|
|
21
|
+
fetchMeta: null
|
|
22
|
+
});
|
|
23
|
+
if (previousOptions) {
|
|
24
|
+
query.fetch(previousOptions);
|
|
25
|
+
}
|
|
26
|
+
} else {
|
|
27
|
+
// --ACTION-TRIGGER-LOADING logic--
|
|
28
|
+
// This matches the ACTION-TRIGGER-LOADING case from the external sync system
|
|
29
|
+
const __previousQueryOptions = query.options;
|
|
30
|
+
|
|
31
|
+
// Trigger a fetch in order to trigger suspense as well.
|
|
32
|
+
query.fetch({
|
|
33
|
+
...__previousQueryOptions,
|
|
34
|
+
queryFn: () => {
|
|
35
|
+
return new Promise(() => {
|
|
36
|
+
// Never resolve - simulates perpetual loading
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
gcTime: -1
|
|
40
|
+
});
|
|
41
|
+
query.setState({
|
|
42
|
+
data: undefined,
|
|
43
|
+
status: "pending",
|
|
44
|
+
fetchMeta: {
|
|
45
|
+
...query.state.fetchMeta,
|
|
46
|
+
// @ts-expect-error This does exist
|
|
47
|
+
__previousQueryOptions
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.deleteNestedDataByPath = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Deletes nested data by path
|
|
9
|
+
*
|
|
10
|
+
* @param {unknown} oldData Data to be updated
|
|
11
|
+
* @param {Array<string>} deletePath Path to the data to be deleted
|
|
12
|
+
* @returns newData without the deleted items by path
|
|
13
|
+
*/
|
|
14
|
+
const deleteNestedDataByPath = (oldData, deletePath) => {
|
|
15
|
+
if (oldData instanceof Map) {
|
|
16
|
+
const newData = new Map(oldData);
|
|
17
|
+
if (deletePath.length === 1) {
|
|
18
|
+
newData.delete(deletePath[0]);
|
|
19
|
+
return newData;
|
|
20
|
+
}
|
|
21
|
+
const [head, ...tail] = deletePath;
|
|
22
|
+
newData.set(head, deleteNestedDataByPath(newData.get(head), tail));
|
|
23
|
+
return newData;
|
|
24
|
+
}
|
|
25
|
+
if (oldData instanceof Set) {
|
|
26
|
+
const setAsArray = deleteNestedDataByPath(Array.from(oldData), deletePath);
|
|
27
|
+
return new Set(setAsArray);
|
|
28
|
+
}
|
|
29
|
+
if (Array.isArray(oldData)) {
|
|
30
|
+
const newData = [...oldData];
|
|
31
|
+
if (deletePath.length === 1) {
|
|
32
|
+
return newData.filter((_, idx) => idx.toString() !== deletePath[0]);
|
|
33
|
+
}
|
|
34
|
+
const [head, ...tail] = deletePath;
|
|
35
|
+
|
|
36
|
+
// @ts-expect-error NAS
|
|
37
|
+
newData[head] = deleteNestedDataByPath(newData[head], tail);
|
|
38
|
+
return newData;
|
|
39
|
+
}
|
|
40
|
+
if (oldData instanceof Object) {
|
|
41
|
+
const newData = {
|
|
42
|
+
...oldData
|
|
43
|
+
};
|
|
44
|
+
if (deletePath.length === 1) {
|
|
45
|
+
// @ts-expect-error NAS
|
|
46
|
+
delete newData[deletePath[0]];
|
|
47
|
+
return newData;
|
|
48
|
+
}
|
|
49
|
+
const [head, ...tail] = deletePath;
|
|
50
|
+
// @ts-expect-error NAS
|
|
51
|
+
newData[head] = deleteNestedDataByPath(newData[head], tail);
|
|
52
|
+
return newData;
|
|
53
|
+
}
|
|
54
|
+
return oldData;
|
|
55
|
+
};
|
|
56
|
+
exports.deleteNestedDataByPath = deleteNestedDataByPath;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.formatRelativeTime = formatRelativeTime;
|
|
7
|
+
/**
|
|
8
|
+
* Formats a timestamp as a relative time string (e.g., "10s ago", "5m ago", "2h ago")
|
|
9
|
+
* @param timestamp - Unix timestamp in milliseconds
|
|
10
|
+
* @returns Formatted relative time string
|
|
11
|
+
*/
|
|
12
|
+
function formatRelativeTime(timestamp) {
|
|
13
|
+
const now = Date.now();
|
|
14
|
+
const diff = now - timestamp;
|
|
15
|
+
const seconds = Math.floor(diff / 1000);
|
|
16
|
+
if (seconds < 60) {
|
|
17
|
+
return `${seconds}s ago`;
|
|
18
|
+
}
|
|
19
|
+
const minutes = Math.floor(seconds / 60);
|
|
20
|
+
if (minutes < 60) {
|
|
21
|
+
return `${minutes}m ago`;
|
|
22
|
+
}
|
|
23
|
+
const hours = Math.floor(minutes / 60);
|
|
24
|
+
if (hours < 24) {
|
|
25
|
+
return `${hours}h ago`;
|
|
26
|
+
}
|
|
27
|
+
const days = Math.floor(hours / 24);
|
|
28
|
+
return `${days}d ago`;
|
|
29
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getQueryStatusColor = getQueryStatusColor;
|
|
7
|
+
/**
|
|
8
|
+
* Maps a query’s runtime state to one of the predefined status color tokens used in the UI.
|
|
9
|
+
*/
|
|
10
|
+
function getQueryStatusColor({
|
|
11
|
+
queryState,
|
|
12
|
+
observerCount,
|
|
13
|
+
isStale
|
|
14
|
+
}) {
|
|
15
|
+
return queryState.fetchStatus === "fetching" ? "blue" : !observerCount ? "gray" : queryState.fetchStatus === "paused" ? "purple" : isStale ? "yellow" : "green";
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getQueryStatusLabel = getQueryStatusLabel;
|
|
7
|
+
/**
|
|
8
|
+
* Converts a query object into a human-friendly status string for badge rendering.
|
|
9
|
+
* Priority order: disabled > fetching > inactive > paused > stale > fresh
|
|
10
|
+
*/
|
|
11
|
+
function getQueryStatusLabel(query) {
|
|
12
|
+
// Check disabled first - disabled queries won't automatically fetch
|
|
13
|
+
if (query.isDisabled()) {
|
|
14
|
+
return "disabled";
|
|
15
|
+
}
|
|
16
|
+
return query.state.fetchStatus === "fetching" ? "fetching" : !query.getObserversCount() ? "inactive" : query.state.fetchStatus === "paused" ? "paused" : query.isStale() ? "stale" : "fresh";
|
|
17
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getStorageQueryCounts = getStorageQueryCounts;
|
|
7
|
+
var _storageQueryUtils = require("./storageQueryUtils");
|
|
8
|
+
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
9
|
+
/**
|
|
10
|
+
* Calculate counts for each storage type from storage queries
|
|
11
|
+
* Following performance principles: no unnecessary memoization [[memory:4875074]]
|
|
12
|
+
*/
|
|
13
|
+
function getStorageQueryCounts(queries) {
|
|
14
|
+
const counts = {
|
|
15
|
+
mmkv: 0,
|
|
16
|
+
async: 0,
|
|
17
|
+
secure: 0,
|
|
18
|
+
total: 0
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// Filter to storage queries only, then count by type
|
|
22
|
+
const storageQueries = queries.filter(query => (0, _storageQueryUtils.isStorageQuery)(query.queryKey));
|
|
23
|
+
storageQueries.forEach(query => {
|
|
24
|
+
const storageType = (0, _storageQueryUtils.getStorageType)(query.queryKey);
|
|
25
|
+
if (storageType) {
|
|
26
|
+
// Filter out dev tool keys from the counts
|
|
27
|
+
const cleanKey = (0, _storageQueryUtils.getCleanStorageKey)(query.queryKey);
|
|
28
|
+
if (!(0, _sharedUi.isDevToolsStorageKey)(cleanKey)) {
|
|
29
|
+
counts[storageType]++;
|
|
30
|
+
counts.total++;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return counts;
|
|
35
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
invalidate: true,
|
|
8
|
+
refetch: true,
|
|
9
|
+
reset: true,
|
|
10
|
+
remove: true,
|
|
11
|
+
deleteItem: true,
|
|
12
|
+
triggerError: true,
|
|
13
|
+
triggerLoading: true,
|
|
14
|
+
safeStringify: true,
|
|
15
|
+
displayValue: true,
|
|
16
|
+
parseDisplayValue: true
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "deleteItem", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _deleteItem.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "displayValue", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _sharedUi.displayValue;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "invalidate", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _invalidate.default;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "parseDisplayValue", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _sharedUi.parseDisplayValue;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "refetch", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _refetch.default;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "remove", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _remove.default;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "reset", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _reset.default;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "safeStringify", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _sharedUi.safeStringify;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "triggerError", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _triggerError.default;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "triggerLoading", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _triggerLoading.default;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
var _invalidate = _interopRequireDefault(require("./actions/invalidate"));
|
|
79
|
+
var _refetch = _interopRequireDefault(require("./actions/refetch"));
|
|
80
|
+
var _reset = _interopRequireDefault(require("./actions/reset"));
|
|
81
|
+
var _remove = _interopRequireDefault(require("./actions/remove"));
|
|
82
|
+
var _deleteItem = _interopRequireDefault(require("./actions/deleteItem"));
|
|
83
|
+
var _triggerError = _interopRequireDefault(require("./actions/triggerError"));
|
|
84
|
+
var _triggerLoading = _interopRequireDefault(require("./actions/triggerLoading"));
|
|
85
|
+
var _getQueryStatusLabel = require("./getQueryStatusLabel");
|
|
86
|
+
Object.keys(_getQueryStatusLabel).forEach(function (key) {
|
|
87
|
+
if (key === "default" || key === "__esModule") return;
|
|
88
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
89
|
+
if (key in exports && exports[key] === _getQueryStatusLabel[key]) return;
|
|
90
|
+
Object.defineProperty(exports, key, {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _getQueryStatusLabel[key];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
var _getQueryStatusColor = require("./getQueryStatusColor");
|
|
98
|
+
Object.keys(_getQueryStatusColor).forEach(function (key) {
|
|
99
|
+
if (key === "default" || key === "__esModule") return;
|
|
100
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
101
|
+
if (key in exports && exports[key] === _getQueryStatusColor[key]) return;
|
|
102
|
+
Object.defineProperty(exports, key, {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _getQueryStatusColor[key];
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
var _getStorageQueryCounts = require("./getStorageQueryCounts");
|
|
110
|
+
Object.keys(_getStorageQueryCounts).forEach(function (key) {
|
|
111
|
+
if (key === "default" || key === "__esModule") return;
|
|
112
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
113
|
+
if (key in exports && exports[key] === _getStorageQueryCounts[key]) return;
|
|
114
|
+
Object.defineProperty(exports, key, {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return _getStorageQueryCounts[key];
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
var _storageQueryUtils = require("./storageQueryUtils");
|
|
122
|
+
Object.keys(_storageQueryUtils).forEach(function (key) {
|
|
123
|
+
if (key === "default" || key === "__esModule") return;
|
|
124
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
125
|
+
if (key in exports && exports[key] === _storageQueryUtils[key]) return;
|
|
126
|
+
Object.defineProperty(exports, key, {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () {
|
|
129
|
+
return _storageQueryUtils[key];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
var _modalStorageOperations = require("./modalStorageOperations");
|
|
134
|
+
Object.keys(_modalStorageOperations).forEach(function (key) {
|
|
135
|
+
if (key === "default" || key === "__esModule") return;
|
|
136
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
137
|
+
if (key in exports && exports[key] === _modalStorageOperations[key]) return;
|
|
138
|
+
Object.defineProperty(exports, key, {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function () {
|
|
141
|
+
return _modalStorageOperations[key];
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
var _updateNestedDataByPath = require("./updateNestedDataByPath");
|
|
146
|
+
Object.keys(_updateNestedDataByPath).forEach(function (key) {
|
|
147
|
+
if (key === "default" || key === "__esModule") return;
|
|
148
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
149
|
+
if (key in exports && exports[key] === _updateNestedDataByPath[key]) return;
|
|
150
|
+
Object.defineProperty(exports, key, {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function () {
|
|
153
|
+
return _updateNestedDataByPath[key];
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
var _deleteNestedDataByPath = require("./deleteNestedDataByPath");
|
|
158
|
+
Object.keys(_deleteNestedDataByPath).forEach(function (key) {
|
|
159
|
+
if (key === "default" || key === "__esModule") return;
|
|
160
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
161
|
+
if (key in exports && exports[key] === _deleteNestedDataByPath[key]) return;
|
|
162
|
+
Object.defineProperty(exports, key, {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function () {
|
|
165
|
+
return _deleteNestedDataByPath[key];
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
170
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.savePanelHeight = exports.savePanelDimensions = exports.saveModalVisibilityState = exports.saveFloatingMode = exports.loadPanelState = exports.loadModalVisibilityState = exports.clearModalVisibilityState = void 0;
|
|
7
|
+
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
8
|
+
// Helper functions for persisting panel state using shared storage wrapper
|
|
9
|
+
const setItem = async (key, value) => {
|
|
10
|
+
await (0, _sharedUi.safeSetItem)(key, value);
|
|
11
|
+
};
|
|
12
|
+
const getItem = async key => {
|
|
13
|
+
return (0, _sharedUi.safeGetItem)(key);
|
|
14
|
+
};
|
|
15
|
+
// Storage operations
|
|
16
|
+
/**
|
|
17
|
+
* Persist the draggable panel dimensions so future sessions can restore the last window size.
|
|
18
|
+
*/
|
|
19
|
+
const savePanelDimensions = async (storagePrefix, dimensions) => {
|
|
20
|
+
try {
|
|
21
|
+
await setItem(`${storagePrefix}_panel_dimensions`, JSON.stringify(dimensions));
|
|
22
|
+
} catch {
|
|
23
|
+
// Silently fail - persistence is optional
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** Remember the last snap height of the panel for bottom-sheet style layouts. */
|
|
28
|
+
exports.savePanelDimensions = savePanelDimensions;
|
|
29
|
+
const savePanelHeight = async (storagePrefix, height) => {
|
|
30
|
+
try {
|
|
31
|
+
await setItem(`${storagePrefix}_panel_height`, height.toString());
|
|
32
|
+
} catch {
|
|
33
|
+
// Silently fail - persistence is optional
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Persist whether the panel was in floating mode so we can reopen at the same presentation style.
|
|
39
|
+
*/
|
|
40
|
+
exports.savePanelHeight = savePanelHeight;
|
|
41
|
+
const saveFloatingMode = async (storagePrefix, isFloating) => {
|
|
42
|
+
try {
|
|
43
|
+
await setItem(`${storagePrefix}_is_floating_mode`, isFloating.toString());
|
|
44
|
+
} catch {
|
|
45
|
+
// Silently fail - persistence is optional
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Retrieve persisted panel geometry and presentation mode. Returns null values when nothing was
|
|
51
|
+
* previously stored so callers can fall back to defaults.
|
|
52
|
+
*/
|
|
53
|
+
exports.saveFloatingMode = saveFloatingMode;
|
|
54
|
+
const loadPanelState = async storagePrefix => {
|
|
55
|
+
try {
|
|
56
|
+
const [dimensionsStr, heightStr, floatingModeStr] = await Promise.all([getItem(`${storagePrefix}_panel_dimensions`), getItem(`${storagePrefix}_panel_height`), getItem(`${storagePrefix}_is_floating_mode`)]);
|
|
57
|
+
const dimensions = dimensionsStr ? JSON.parse(dimensionsStr) : null;
|
|
58
|
+
const height = heightStr ? parseInt(heightStr, 10) : null;
|
|
59
|
+
const isFloating = floatingModeStr ? floatingModeStr === "true" : null;
|
|
60
|
+
return {
|
|
61
|
+
dimensions,
|
|
62
|
+
height,
|
|
63
|
+
isFloating
|
|
64
|
+
};
|
|
65
|
+
} catch {
|
|
66
|
+
// Return defaults on error
|
|
67
|
+
return {
|
|
68
|
+
dimensions: null,
|
|
69
|
+
height: null,
|
|
70
|
+
isFloating: null
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// Modal visibility state operations
|
|
76
|
+
/**
|
|
77
|
+
* Persist the comprehensive modal visibility state (open flags, selected query, etc.). Stored as a
|
|
78
|
+
* single JSON blob keyed by the provided prefix.
|
|
79
|
+
*/
|
|
80
|
+
exports.loadPanelState = loadPanelState;
|
|
81
|
+
const saveModalVisibilityState = async (storagePrefix, state) => {
|
|
82
|
+
try {
|
|
83
|
+
const stateJson = JSON.stringify(state);
|
|
84
|
+
// storagePrefix already contains the full key, don't append _modal_state
|
|
85
|
+
const key = storagePrefix;
|
|
86
|
+
await setItem(key, stateJson);
|
|
87
|
+
} catch {
|
|
88
|
+
// Silently fail - persistence is a nice-to-have feature
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Read previously persisted modal visibility state. Returns null when no entry is stored or the
|
|
94
|
+
* payload cannot be parsed.
|
|
95
|
+
*/
|
|
96
|
+
exports.saveModalVisibilityState = saveModalVisibilityState;
|
|
97
|
+
const loadModalVisibilityState = async storagePrefix => {
|
|
98
|
+
try {
|
|
99
|
+
// storagePrefix already contains the full key, don't append _modal_state
|
|
100
|
+
const key = storagePrefix;
|
|
101
|
+
const stateStr = await getItem(key);
|
|
102
|
+
if (stateStr && stateStr !== "") {
|
|
103
|
+
const parsed = JSON.parse(stateStr);
|
|
104
|
+
return parsed;
|
|
105
|
+
}
|
|
106
|
+
return null;
|
|
107
|
+
} catch {
|
|
108
|
+
// Silently fail - persistence is a nice-to-have feature
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Clear the cached modal visibility state. Useful when all modals close so we avoid reopening
|
|
115
|
+
* unintentionally on the next session.
|
|
116
|
+
*/
|
|
117
|
+
exports.loadModalVisibilityState = loadModalVisibilityState;
|
|
118
|
+
const clearModalVisibilityState = async storagePrefix => {
|
|
119
|
+
try {
|
|
120
|
+
// storagePrefix already contains the full key, don't append _modal_state
|
|
121
|
+
const key = storagePrefix;
|
|
122
|
+
await setItem(key, "");
|
|
123
|
+
} catch {
|
|
124
|
+
// Silently fail - persistence is a nice-to-have feature
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
exports.clearModalVisibilityState = clearModalVisibilityState;
|