@buoy-gg/react-query 7.0.41 → 7.0.42
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 +11 -73
- package/lib/commonjs/checkPeer.js +1 -8
- package/lib/commonjs/checkPeer.web.js +1 -3
- package/lib/commonjs/index.js +1 -657
- package/lib/commonjs/preset.js +1 -243
- package/lib/commonjs/react-query/components/DataEditorMode.js +1 -317
- package/lib/commonjs/react-query/components/FilterStatusBadge.js +1 -55
- package/lib/commonjs/react-query/components/MutationBrowserMode.js +1 -52
- package/lib/commonjs/react-query/components/MutationEditorMode.js +1 -276
- package/lib/commonjs/react-query/components/QueryBrowserMode.js +1 -99
- package/lib/commonjs/react-query/components/QueryDebugInfo.js +1 -107
- package/lib/commonjs/react-query/components/QueryFilterViewV3.js +1 -224
- package/lib/commonjs/react-query/components/QuerySelector.js +1 -209
- package/lib/commonjs/react-query/components/ReactQueryDevToolsModal.js +1 -91
- package/lib/commonjs/react-query/components/ReactQuerySection.js +1 -47
- package/lib/commonjs/react-query/components/ReactQueryTracker.js +1 -38
- package/lib/commonjs/react-query/components/WifiToggle.js +1 -51
- package/lib/commonjs/react-query/components/modals/DataEditorModal.js +1 -103
- package/lib/commonjs/react-query/components/modals/MutationBrowserFooter.js +1 -61
- package/lib/commonjs/react-query/components/modals/MutationBrowserModal.js +1 -164
- package/lib/commonjs/react-query/components/modals/MutationEditorModal.js +1 -106
- package/lib/commonjs/react-query/components/modals/QueryBrowserFooter.js +1 -56
- package/lib/commonjs/react-query/components/modals/QueryBrowserModal.js +1 -254
- package/lib/commonjs/react-query/components/modals/ReactQueryModal.js +1 -83
- package/lib/commonjs/react-query/components/modals/ReactQueryModalHeader.js +1 -194
- package/lib/commonjs/react-query/components/modals/SwipeIndicator.js +1 -204
- package/lib/commonjs/react-query/components/query-browser/ActionButton.js +1 -100
- package/lib/commonjs/react-query/components/query-browser/ClearCacheButton.js +1 -53
- package/lib/commonjs/react-query/components/query-browser/Explorer.js +1 -75
- package/lib/commonjs/react-query/components/query-browser/MutationButton.js +1 -190
- package/lib/commonjs/react-query/components/query-browser/MutationDetails.js +1 -124
- package/lib/commonjs/react-query/components/query-browser/MutationDetailsChips.js +1 -68
- package/lib/commonjs/react-query/components/query-browser/MutationInformation.js +1 -118
- package/lib/commonjs/react-query/components/query-browser/MutationStatusCount.js +1 -84
- package/lib/commonjs/react-query/components/query-browser/MutationsList.js +1 -220
- package/lib/commonjs/react-query/components/query-browser/NetworkToggleButton.js +1 -54
- package/lib/commonjs/react-query/components/query-browser/QueryActions.js +1 -124
- package/lib/commonjs/react-query/components/query-browser/QueryBrowser.js +1 -181
- package/lib/commonjs/react-query/components/query-browser/QueryDetails.js +1 -141
- package/lib/commonjs/react-query/components/query-browser/QueryDetailsChip.js +1 -78
- package/lib/commonjs/react-query/components/query-browser/QueryInformation.js +1 -95
- package/lib/commonjs/react-query/components/query-browser/QueryRow.js +1 -96
- package/lib/commonjs/react-query/components/query-browser/QueryStatus.js +1 -167
- package/lib/commonjs/react-query/components/query-browser/QueryStatusCount.js +1 -100
- package/lib/commonjs/react-query/components/query-browser/StorageStatusCount.js +1 -61
- package/lib/commonjs/react-query/components/query-browser/index.js +1 -170
- package/lib/commonjs/react-query/components/query-browser/svgs.js +1 -72
- package/lib/commonjs/react-query/hooks/useActionButtons.js +1 -51
- package/lib/commonjs/react-query/hooks/useAllMutations.js +1 -85
- package/lib/commonjs/react-query/hooks/useAllQueries.js +1 -117
- package/lib/commonjs/react-query/hooks/useModalManager.js +1 -178
- package/lib/commonjs/react-query/hooks/useModalPersistence.js +1 -71
- package/lib/commonjs/react-query/hooks/useMutationActionButtons.js +1 -21
- package/lib/commonjs/react-query/hooks/useQueryStatusCounts.js +1 -114
- package/lib/commonjs/react-query/hooks/useReactQueryState.js +1 -24
- package/lib/commonjs/react-query/hooks/useSelectedMutation.js +1 -30
- package/lib/commonjs/react-query/hooks/useSelectedQuery.js +1 -96
- package/lib/commonjs/react-query/hooks/useStorageQueryCounts.js +1 -28
- package/lib/commonjs/react-query/hooks/useWifiState.js +1 -67
- package/lib/commonjs/react-query/stores/reactQueryEventStore.js +1 -302
- package/lib/commonjs/react-query/sync/dehydrate.js +1 -166
- package/lib/commonjs/react-query/sync/reactQuerySyncAdapter.js +1 -593
- package/lib/commonjs/react-query/sync/snapshotProvider.js +1 -289
- package/lib/commonjs/react-query/sync/useReactQuerySyncAdapter.js +1 -34
- package/lib/commonjs/react-query/types/types.js +1 -14
- package/lib/commonjs/react-query/utils/actions/deleteItem.js +1 -23
- package/lib/commonjs/react-query/utils/actions/emitDevToolsEvent.js +1 -40
- package/lib/commonjs/react-query/utils/actions/invalidate.js +1 -15
- package/lib/commonjs/react-query/utils/actions/refetch.js +1 -17
- package/lib/commonjs/react-query/utils/actions/remove.js +1 -15
- package/lib/commonjs/react-query/utils/actions/reset.js +1 -17
- package/lib/commonjs/react-query/utils/actions/triggerError.js +1 -33
- package/lib/commonjs/react-query/utils/actions/triggerLoading.js +1 -54
- package/lib/commonjs/react-query/utils/deleteNestedDataByPath.js +1 -56
- package/lib/commonjs/react-query/utils/getQueryStatusColor.js +1 -16
- package/lib/commonjs/react-query/utils/getQueryStatusLabel.js +1 -23
- package/lib/commonjs/react-query/utils/getStorageQueryCounts.js +1 -35
- package/lib/commonjs/react-query/utils/modalStorageOperations.js +1 -127
- package/lib/commonjs/react-query/utils/storageQueryUtils.js +1 -149
- package/lib/commonjs/react-query/utils/testIDs.js +1 -61
- package/lib/commonjs/react-query/utils/updateNestedDataByPath.js +1 -61
- package/lib/module/checkPeer.js +1 -8
- package/lib/module/checkPeer.web.js +1 -3
- package/lib/module/index.js +1 -130
- package/lib/module/preset.js +1 -239
- package/lib/module/react-query/components/DataEditorMode.js +1 -311
- package/lib/module/react-query/components/FilterStatusBadge.js +1 -51
- package/lib/module/react-query/components/MutationBrowserMode.js +1 -47
- package/lib/module/react-query/components/MutationEditorMode.js +1 -270
- package/lib/module/react-query/components/QueryBrowserMode.js +1 -94
- package/lib/module/react-query/components/QueryDebugInfo.js +1 -104
- package/lib/module/react-query/components/QueryFilterViewV3.js +1 -221
- package/lib/module/react-query/components/QuerySelector.js +1 -205
- package/lib/module/react-query/components/ReactQueryDevToolsModal.js +1 -87
- package/lib/module/react-query/components/ReactQuerySection.js +1 -43
- package/lib/module/react-query/components/ReactQueryTracker.js +1 -35
- package/lib/module/react-query/components/WifiToggle.js +1 -48
- package/lib/module/react-query/components/modals/DataEditorModal.js +1 -99
- package/lib/module/react-query/components/modals/MutationBrowserFooter.js +1 -56
- package/lib/module/react-query/components/modals/MutationBrowserModal.js +1 -161
- package/lib/module/react-query/components/modals/MutationEditorModal.js +1 -102
- package/lib/module/react-query/components/modals/QueryBrowserFooter.js +1 -51
- package/lib/module/react-query/components/modals/QueryBrowserModal.js +1 -250
- package/lib/module/react-query/components/modals/ReactQueryModal.js +1 -79
- package/lib/module/react-query/components/modals/ReactQueryModalHeader.js +1 -190
- package/lib/module/react-query/components/modals/SwipeIndicator.js +1 -201
- package/lib/module/react-query/components/query-browser/ActionButton.js +1 -96
- package/lib/module/react-query/components/query-browser/ClearCacheButton.js +1 -49
- package/lib/module/react-query/components/query-browser/Explorer.js +1 -70
- package/lib/module/react-query/components/query-browser/MutationButton.js +1 -186
- package/lib/module/react-query/components/query-browser/MutationDetails.js +1 -119
- package/lib/module/react-query/components/query-browser/MutationDetailsChips.js +1 -64
- package/lib/module/react-query/components/query-browser/MutationInformation.js +1 -113
- package/lib/module/react-query/components/query-browser/MutationStatusCount.js +1 -79
- package/lib/module/react-query/components/query-browser/MutationsList.js +1 -215
- package/lib/module/react-query/components/query-browser/NetworkToggleButton.js +1 -50
- package/lib/module/react-query/components/query-browser/QueryActions.js +1 -119
- package/lib/module/react-query/components/query-browser/QueryBrowser.js +1 -176
- package/lib/module/react-query/components/query-browser/QueryDetails.js +1 -136
- package/lib/module/react-query/components/query-browser/QueryDetailsChip.js +1 -74
- package/lib/module/react-query/components/query-browser/QueryInformation.js +1 -90
- package/lib/module/react-query/components/query-browser/QueryRow.js +1 -92
- package/lib/module/react-query/components/query-browser/QueryStatus.js +1 -163
- package/lib/module/react-query/components/query-browser/QueryStatusCount.js +1 -95
- package/lib/module/react-query/components/query-browser/StorageStatusCount.js +1 -56
- package/lib/module/react-query/components/query-browser/index.js +1 -22
- package/lib/module/react-query/components/query-browser/svgs.js +1 -64
- package/lib/module/react-query/hooks/useActionButtons.js +1 -46
- package/lib/module/react-query/hooks/useAllMutations.js +1 -82
- package/lib/module/react-query/hooks/useAllQueries.js +1 -114
- package/lib/module/react-query/hooks/useModalManager.js +1 -175
- package/lib/module/react-query/hooks/useModalPersistence.js +1 -67
- package/lib/module/react-query/hooks/useMutationActionButtons.js +1 -17
- package/lib/module/react-query/hooks/useQueryStatusCounts.js +1 -112
- package/lib/module/react-query/hooks/useReactQueryState.js +1 -20
- package/lib/module/react-query/hooks/useSelectedMutation.js +1 -27
- package/lib/module/react-query/hooks/useSelectedQuery.js +1 -92
- package/lib/module/react-query/hooks/useStorageQueryCounts.js +1 -25
- package/lib/module/react-query/hooks/useWifiState.js +1 -64
- package/lib/module/react-query/stores/reactQueryEventStore.js +1 -293
- package/lib/module/react-query/sync/dehydrate.js +1 -156
- package/lib/module/react-query/sync/reactQuerySyncAdapter.js +1 -589
- package/lib/module/react-query/sync/snapshotProvider.js +1 -284
- package/lib/module/react-query/sync/useReactQuerySyncAdapter.js +1 -31
- package/lib/module/react-query/types/types.js +1 -10
- package/lib/module/react-query/utils/actions/deleteItem.js +1 -19
- package/lib/module/react-query/utils/actions/emitDevToolsEvent.js +1 -36
- package/lib/module/react-query/utils/actions/invalidate.js +1 -11
- package/lib/module/react-query/utils/actions/refetch.js +1 -13
- package/lib/module/react-query/utils/actions/remove.js +1 -11
- package/lib/module/react-query/utils/actions/reset.js +1 -13
- package/lib/module/react-query/utils/actions/triggerError.js +1 -29
- package/lib/module/react-query/utils/actions/triggerLoading.js +1 -50
- package/lib/module/react-query/utils/deleteNestedDataByPath.js +1 -51
- package/lib/module/react-query/utils/getQueryStatusColor.js +1 -12
- package/lib/module/react-query/utils/getQueryStatusLabel.js +1 -19
- package/lib/module/react-query/utils/getStorageQueryCounts.js +1 -31
- package/lib/module/react-query/utils/modalStorageOperations.js +1 -117
- package/lib/module/react-query/utils/storageQueryUtils.js +1 -140
- package/lib/module/react-query/utils/testIDs.js +1 -54
- package/lib/module/react-query/utils/updateNestedDataByPath.js +1 -56
- package/lib/web/index.mjs +3 -4
- package/package.json +3 -3
- package/lib/typescript/checkPeer.d.ts.map +0 -1
- package/lib/typescript/checkPeer.web.d.ts.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/preset.d.ts.map +0 -1
- package/lib/typescript/react-query/components/DataEditorMode.d.ts.map +0 -1
- package/lib/typescript/react-query/components/FilterStatusBadge.d.ts.map +0 -1
- package/lib/typescript/react-query/components/MutationBrowserMode.d.ts.map +0 -1
- package/lib/typescript/react-query/components/MutationEditorMode.d.ts.map +0 -1
- package/lib/typescript/react-query/components/QueryBrowserMode.d.ts.map +0 -1
- package/lib/typescript/react-query/components/QueryDebugInfo.d.ts.map +0 -1
- package/lib/typescript/react-query/components/QueryFilterViewV3.d.ts.map +0 -1
- package/lib/typescript/react-query/components/QuerySelector.d.ts.map +0 -1
- package/lib/typescript/react-query/components/ReactQueryDevToolsModal.d.ts.map +0 -1
- package/lib/typescript/react-query/components/ReactQuerySection.d.ts.map +0 -1
- package/lib/typescript/react-query/components/ReactQueryTracker.d.ts.map +0 -1
- package/lib/typescript/react-query/components/WifiToggle.d.ts.map +0 -1
- package/lib/typescript/react-query/components/modals/DataEditorModal.d.ts.map +0 -1
- package/lib/typescript/react-query/components/modals/MutationBrowserFooter.d.ts.map +0 -1
- package/lib/typescript/react-query/components/modals/MutationBrowserModal.d.ts.map +0 -1
- package/lib/typescript/react-query/components/modals/MutationEditorModal.d.ts.map +0 -1
- package/lib/typescript/react-query/components/modals/QueryBrowserFooter.d.ts.map +0 -1
- package/lib/typescript/react-query/components/modals/QueryBrowserModal.d.ts.map +0 -1
- package/lib/typescript/react-query/components/modals/ReactQueryModal.d.ts.map +0 -1
- package/lib/typescript/react-query/components/modals/ReactQueryModalHeader.d.ts.map +0 -1
- package/lib/typescript/react-query/components/modals/SwipeIndicator.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/ActionButton.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/ClearCacheButton.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/Explorer.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/MutationButton.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/MutationDetails.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/MutationDetailsChips.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/MutationInformation.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/MutationStatusCount.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/MutationsList.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/NetworkToggleButton.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/QueryActions.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/QueryBrowser.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/QueryDetails.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/QueryDetailsChip.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/QueryInformation.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/QueryRow.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/QueryStatus.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/QueryStatusCount.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/StorageStatusCount.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/index.d.ts.map +0 -1
- package/lib/typescript/react-query/components/query-browser/svgs.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useActionButtons.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useAllMutations.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useAllQueries.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useModalManager.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useModalPersistence.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useMutationActionButtons.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useQueryStatusCounts.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useReactQueryState.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useSelectedMutation.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useSelectedQuery.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useStorageQueryCounts.d.ts.map +0 -1
- package/lib/typescript/react-query/hooks/useWifiState.d.ts.map +0 -1
- package/lib/typescript/react-query/stores/reactQueryEventStore.d.ts.map +0 -1
- package/lib/typescript/react-query/sync/dehydrate.d.ts.map +0 -1
- package/lib/typescript/react-query/sync/reactQuerySyncAdapter.d.ts.map +0 -1
- package/lib/typescript/react-query/sync/snapshotProvider.d.ts.map +0 -1
- package/lib/typescript/react-query/sync/useReactQuerySyncAdapter.d.ts.map +0 -1
- package/lib/typescript/react-query/types/types.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/actions/deleteItem.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/actions/emitDevToolsEvent.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/actions/invalidate.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/actions/refetch.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/actions/remove.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/actions/reset.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/actions/triggerError.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/actions/triggerLoading.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/deleteNestedDataByPath.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/getQueryStatusColor.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/getQueryStatusLabel.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/getStorageQueryCounts.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/modalStorageOperations.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/storageQueryUtils.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/testIDs.d.ts.map +0 -1
- package/lib/typescript/react-query/utils/updateNestedDataByPath.d.ts.map +0 -1
|
@@ -1,92 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { memo } from "react";
|
|
4
|
-
import { getQueryStatusLabel } from "../../utils/getQueryStatusLabel";
|
|
5
|
-
import { CompactRow, buoyColors, useRelativeTime } from "@buoy-gg/shared-ui";
|
|
6
|
-
import { queryRowTestID } from "../../utils/testIDs";
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
const getQueryText = query => {
|
|
9
|
-
if (!query?.queryKey) return "Unknown Query";
|
|
10
|
-
const keys = Array.isArray(query.queryKey) ? query.queryKey : [query.queryKey];
|
|
11
|
-
return keys.filter(k => k != null).map(k => String(k)).join(" › ") || "Unknown Query";
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Single row representation of a query for the list view, showing status and observer count.
|
|
15
|
-
*/
|
|
16
|
-
// Memo justified by profiling (tool-bench 2026-07-06): 546 row renders in
|
|
17
|
-
// a 5s idle dwell at 300 queries. `stateSig` exists ONLY for this memo —
|
|
18
|
-
// Query objects are mutable with stable identity, so shallow-comparing
|
|
19
|
-
// `query` alone would never re-render (see QueryBrowser).
|
|
20
|
-
const QueryRow = /*#__PURE__*/memo(function QueryRow({
|
|
21
|
-
query,
|
|
22
|
-
isSelected,
|
|
23
|
-
onSelect
|
|
24
|
-
}) {
|
|
25
|
-
// Buoy theme status color mapping
|
|
26
|
-
const getStatusHexColor = status => {
|
|
27
|
-
switch (status) {
|
|
28
|
-
case "disabled":
|
|
29
|
-
return buoyColors.textMuted + "80";
|
|
30
|
-
// More muted for disabled
|
|
31
|
-
case "error":
|
|
32
|
-
return buoyColors.error;
|
|
33
|
-
// red — failed with no cached data
|
|
34
|
-
case "fresh":
|
|
35
|
-
return buoyColors.success;
|
|
36
|
-
case "stale":
|
|
37
|
-
return buoyColors.warning;
|
|
38
|
-
case "inactive":
|
|
39
|
-
return buoyColors.textMuted;
|
|
40
|
-
case "fetching":
|
|
41
|
-
return buoyColors.primary;
|
|
42
|
-
// teal instead of blue
|
|
43
|
-
case "paused":
|
|
44
|
-
return buoyColors.textMuted;
|
|
45
|
-
// muted instead of purple
|
|
46
|
-
default:
|
|
47
|
-
return buoyColors.textSecondary;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
const status = getQueryStatusLabel(query);
|
|
51
|
-
const observerCount = query.getObserversCount();
|
|
52
|
-
const isDisabled = query.isDisabled();
|
|
53
|
-
const queryHash = getQueryText(query);
|
|
54
|
-
|
|
55
|
-
// Get the best available timestamp for this query
|
|
56
|
-
const bestTimestamp = (() => {
|
|
57
|
-
if (isDisabled) return null;
|
|
58
|
-
if (query.state.dataUpdatedAt && query.state.dataUpdatedAt > 0) {
|
|
59
|
-
return query.state.dataUpdatedAt;
|
|
60
|
-
}
|
|
61
|
-
// @ts-ignore - exploring state fields for debugging
|
|
62
|
-
const stateAny = query.state;
|
|
63
|
-
if (stateAny.fetchedAt && stateAny.fetchedAt > 0) {
|
|
64
|
-
return stateAny.fetchedAt;
|
|
65
|
-
}
|
|
66
|
-
return null;
|
|
67
|
-
})();
|
|
68
|
-
const relativeTime = useRelativeTime(bestTimestamp);
|
|
69
|
-
const lastUpdated = isDisabled ? "Disabled" : relativeTime || (query.state.dataUpdatedAt === 0 ? "Not fetched" : `N/A (${query.state.dataUpdatedAt || 0})`);
|
|
70
|
-
const testID = queryRowTestID(query.queryKey);
|
|
71
|
-
const observerText = `${observerCount} observer${observerCount !== 1 ? "s" : ""}`;
|
|
72
|
-
return /*#__PURE__*/_jsx(CompactRow, {
|
|
73
|
-
testID: testID,
|
|
74
|
-
statusTestID: `${testID}-status`,
|
|
75
|
-
statusSublabelTestID: `${testID}-observers`
|
|
76
|
-
// Spelled out for assistive tech: on Fabric the dot + two words merge
|
|
77
|
-
// into the row's own accessibility container, so without this the row
|
|
78
|
-
// announces as a control VoiceOver cannot name.
|
|
79
|
-
,
|
|
80
|
-
accessibilityLabel: `${queryHash}, ${status}, ${observerText}`,
|
|
81
|
-
statusDotColor: getStatusHexColor(status),
|
|
82
|
-
statusLabel: status.charAt(0).toUpperCase() + status.slice(1),
|
|
83
|
-
statusSublabel: observerText,
|
|
84
|
-
primaryText: queryHash,
|
|
85
|
-
bottomRightText: lastUpdated,
|
|
86
|
-
badgeText: observerCount,
|
|
87
|
-
badgeColor: getStatusHexColor(status),
|
|
88
|
-
isSelected: isSelected,
|
|
89
|
-
onPress: () => onSelect(query)
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
export default QueryRow;
|
|
1
|
+
"use strict";import{memo as x}from"react";import{getQueryStatusLabel as y}from"../../utils/getQueryStatusLabel";import{CompactRow as A,buoyColors as e,useRelativeTime as T}from"@buoy-gg/shared-ui";import{queryRowTestID as g}from"../../utils/testIDs";import{jsx as h}from"react/jsx-runtime";const D=s=>{if(!s?.queryKey)return"Unknown Query";const t=Array.isArray(s.queryKey)?s.queryKey:[s.queryKey];return t.filter(r=>r!=null).map(r=>String(r)).join(" \u203A ")||"Unknown Query"};const U=x(function s({query:t,isSelected:r,onSelect:b}){const c=o=>{switch(o){case"disabled":return e.textMuted+"80";case"error":return e.error;case"fresh":return e.success;case"stale":return e.warning;case"inactive":return e.textMuted;case"fetching":return e.primary;case"paused":return e.textMuted;default:return e.textSecondary}};const a=y(t);const n=t.getObserversCount();const i=t.isDisabled();const d=D(t);const m=(()=>{if(i)return null;if(t.state.dataUpdatedAt&&t.state.dataUpdatedAt>0){return t.state.dataUpdatedAt}const o=t.state;if(o.fetchedAt&&o.fetchedAt>0){return o.fetchedAt}return null})();const p=T(m);const f=i?"Disabled":p||(t.state.dataUpdatedAt===0?"Not fetched":`N/A (${t.state.dataUpdatedAt||0})`);const u=g(t.queryKey);const l=`${n} observer${n!==1?"s":""}`;return h(A,{testID:u,statusTestID:`${u}-status`,statusSublabelTestID:`${u}-observers`,accessibilityLabel:`${d}, ${a}, ${l}`,statusDotColor:c(a),statusLabel:a.charAt(0).toUpperCase()+a.slice(1),statusSublabel:l,primaryText:d,bottomRightText:f,badgeText:n,badgeColor:c(a),isSelected:r,onPress:()=>b(t)})});export default U;
|
|
@@ -1,163 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { View, Text, TouchableOpacity, StyleSheet } from "react-native";
|
|
4
|
-
import { buoyColors, night } from "@buoy-gg/shared-ui";
|
|
5
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
-
/**
|
|
7
|
-
* Pill-like status badge used within status filter rows. Displays label, dot, and count.
|
|
8
|
-
*/
|
|
9
|
-
const QueryStatus = ({
|
|
10
|
-
label,
|
|
11
|
-
color,
|
|
12
|
-
count,
|
|
13
|
-
showLabel = true,
|
|
14
|
-
isActive = false,
|
|
15
|
-
onPress,
|
|
16
|
-
onTouchStart,
|
|
17
|
-
size = "default",
|
|
18
|
-
testID
|
|
19
|
-
}) => {
|
|
20
|
-
const isLarge = size === "large";
|
|
21
|
-
// Buoy theme color mapping for status indicators
|
|
22
|
-
const getStatusColors = colorName => {
|
|
23
|
-
const colorMap = {
|
|
24
|
-
green: {
|
|
25
|
-
bg: buoyColors.success + "15",
|
|
26
|
-
border: buoyColors.success + "40",
|
|
27
|
-
dot: buoyColors.success,
|
|
28
|
-
text: buoyColors.success
|
|
29
|
-
},
|
|
30
|
-
yellow: {
|
|
31
|
-
bg: buoyColors.warning + "15",
|
|
32
|
-
border: buoyColors.warning + "40",
|
|
33
|
-
dot: buoyColors.warning,
|
|
34
|
-
text: buoyColors.warning
|
|
35
|
-
},
|
|
36
|
-
blue: {
|
|
37
|
-
bg: buoyColors.primary + "15",
|
|
38
|
-
border: buoyColors.primary + "40",
|
|
39
|
-
dot: buoyColors.primary,
|
|
40
|
-
text: buoyColors.primary
|
|
41
|
-
},
|
|
42
|
-
purple: {
|
|
43
|
-
bg: night.color.fillSecondary,
|
|
44
|
-
border: night.color.fillTertiary,
|
|
45
|
-
dot: night.color.textTertiary,
|
|
46
|
-
text: night.color.textTertiary
|
|
47
|
-
},
|
|
48
|
-
red: {
|
|
49
|
-
bg: buoyColors.error + "15",
|
|
50
|
-
border: buoyColors.error + "40",
|
|
51
|
-
dot: buoyColors.error,
|
|
52
|
-
text: buoyColors.error
|
|
53
|
-
},
|
|
54
|
-
gray: {
|
|
55
|
-
bg: night.color.fillSecondary,
|
|
56
|
-
border: night.color.fillTertiary,
|
|
57
|
-
dot: night.color.textTertiary,
|
|
58
|
-
text: night.color.textTertiary
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
return colorMap[colorName] || colorMap.gray;
|
|
62
|
-
};
|
|
63
|
-
const statusColors = getStatusColors(color);
|
|
64
|
-
return /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
65
|
-
"sentry-label": "ignore devtools query status",
|
|
66
|
-
testID: testID,
|
|
67
|
-
accessibilityRole: "button"
|
|
68
|
-
// The dot, the word and the number merge into one container on Fabric,
|
|
69
|
-
// so the chip is announced without any of them unless it is spelled out.
|
|
70
|
-
,
|
|
71
|
-
accessibilityLabel: `${label}, ${count}${isActive ? ", selected" : ""}`,
|
|
72
|
-
accessibilityState: {
|
|
73
|
-
selected: isActive
|
|
74
|
-
},
|
|
75
|
-
style: [styles.queryStatusTag, isLarge && styles.queryStatusTagLarge,
|
|
76
|
-
// The night chip contract (see NightChip): resting fill never changes;
|
|
77
|
-
// selection is signaled by the tinted border and label.
|
|
78
|
-
isActive && {
|
|
79
|
-
backgroundColor: statusColors.bg,
|
|
80
|
-
borderColor: statusColors.border
|
|
81
|
-
}],
|
|
82
|
-
disabled: !onPress,
|
|
83
|
-
onPress: onPress,
|
|
84
|
-
onPressIn: onTouchStart,
|
|
85
|
-
activeOpacity: 0.7,
|
|
86
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
87
|
-
style: [styles.dot, isLarge && styles.dotLarge, {
|
|
88
|
-
backgroundColor: statusColors.dot
|
|
89
|
-
}]
|
|
90
|
-
}), showLabel && /*#__PURE__*/_jsx(Text, {
|
|
91
|
-
style: [styles.label, isLarge && styles.labelLarge, isActive && {
|
|
92
|
-
color: statusColors.text
|
|
93
|
-
}],
|
|
94
|
-
numberOfLines: 1,
|
|
95
|
-
ellipsizeMode: "tail",
|
|
96
|
-
children: label
|
|
97
|
-
}), count > 0 && /*#__PURE__*/_jsx(Text, {
|
|
98
|
-
testID: testID ? `${testID}-count` : undefined,
|
|
99
|
-
style: [styles.count, isLarge && styles.countLarge, {
|
|
100
|
-
color: statusColors.dot
|
|
101
|
-
}],
|
|
102
|
-
numberOfLines: 1,
|
|
103
|
-
children: count
|
|
104
|
-
})]
|
|
105
|
-
});
|
|
106
|
-
};
|
|
107
|
-
const styles = StyleSheet.create({
|
|
108
|
-
queryStatusTag: {
|
|
109
|
-
flexDirection: "row",
|
|
110
|
-
alignItems: "center",
|
|
111
|
-
// Night chip: dark-glass fill, fully-rounded pill, hairline border.
|
|
112
|
-
backgroundColor: night.color.buttonSurface,
|
|
113
|
-
borderRadius: 13,
|
|
114
|
-
paddingHorizontal: 10,
|
|
115
|
-
paddingVertical: 5,
|
|
116
|
-
height: 26,
|
|
117
|
-
gap: 6,
|
|
118
|
-
borderWidth: 1,
|
|
119
|
-
borderColor: night.color.border
|
|
120
|
-
},
|
|
121
|
-
queryStatusTagLarge: {
|
|
122
|
-
borderRadius: 16,
|
|
123
|
-
paddingHorizontal: 13,
|
|
124
|
-
paddingVertical: 6,
|
|
125
|
-
height: 32,
|
|
126
|
-
gap: 7
|
|
127
|
-
},
|
|
128
|
-
dot: {
|
|
129
|
-
width: 6,
|
|
130
|
-
height: 6,
|
|
131
|
-
borderRadius: 3
|
|
132
|
-
},
|
|
133
|
-
dotLarge: {
|
|
134
|
-
width: 8,
|
|
135
|
-
height: 8,
|
|
136
|
-
borderRadius: 4
|
|
137
|
-
},
|
|
138
|
-
label: {
|
|
139
|
-
fontSize: 11,
|
|
140
|
-
fontWeight: "500",
|
|
141
|
-
color: night.color.textSecondary,
|
|
142
|
-
fontFamily: "system"
|
|
143
|
-
},
|
|
144
|
-
labelLarge: {
|
|
145
|
-
fontSize: 13,
|
|
146
|
-
fontWeight: "600",
|
|
147
|
-
letterSpacing: 0.2,
|
|
148
|
-
fontFamily: '"SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'
|
|
149
|
-
},
|
|
150
|
-
count: {
|
|
151
|
-
fontSize: 11,
|
|
152
|
-
fontVariant: ["tabular-nums"],
|
|
153
|
-
fontWeight: "600",
|
|
154
|
-
marginLeft: "auto",
|
|
155
|
-
fontFamily: "system"
|
|
156
|
-
},
|
|
157
|
-
countLarge: {
|
|
158
|
-
fontSize: 13,
|
|
159
|
-
fontWeight: "700",
|
|
160
|
-
fontFamily: '"SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
export default QueryStatus;
|
|
1
|
+
"use strict";import{View as h,Text as u,TouchableOpacity as x,StyleSheet as L}from"react-native";import{buoyColors as e,night as r}from"@buoy-gg/shared-ui";import{jsx as n,jsxs as T}from"react/jsx-runtime";const w=({label:d,color:y,count:s,showLabel:b=true,isActive:a=false,onPress:c,onTouchStart:f,size:p="default",testID:i})=>{const l=p==="large";const m=S=>{const g={green:{bg:e.success+"15",border:e.success+"40",dot:e.success,text:e.success},yellow:{bg:e.warning+"15",border:e.warning+"40",dot:e.warning,text:e.warning},blue:{bg:e.primary+"15",border:e.primary+"40",dot:e.primary,text:e.primary},purple:{bg:r.color.fillSecondary,border:r.color.fillTertiary,dot:r.color.textTertiary,text:r.color.textTertiary},red:{bg:e.error+"15",border:e.error+"40",dot:e.error,text:e.error},gray:{bg:r.color.fillSecondary,border:r.color.fillTertiary,dot:r.color.textTertiary,text:r.color.textTertiary}};return g[S]||g.gray};const o=m(y);return T(x,{"sentry-label":"ignore devtools query status",testID:i,accessibilityRole:"button",accessibilityLabel:`${d}, ${s}${a?", selected":""}`,accessibilityState:{selected:a},style:[t.queryStatusTag,l&&t.queryStatusTagLarge,a&&{backgroundColor:o.bg,borderColor:o.border}],disabled:!c,onPress:c,onPressIn:f,activeOpacity:.7,children:[n(h,{style:[t.dot,l&&t.dotLarge,{backgroundColor:o.dot}]}),b&&n(u,{style:[t.label,l&&t.labelLarge,a&&{color:o.text}],numberOfLines:1,ellipsizeMode:"tail",children:d}),s>0&&n(u,{testID:i?`${i}-count`:void 0,style:[t.count,l&&t.countLarge,{color:o.dot}],numberOfLines:1,children:s})]})};const t=L.create({queryStatusTag:{flexDirection:"row",alignItems:"center",backgroundColor:r.color.buttonSurface,borderRadius:13,paddingHorizontal:10,paddingVertical:5,height:26,gap:6,borderWidth:1,borderColor:r.color.border},queryStatusTagLarge:{borderRadius:16,paddingHorizontal:13,paddingVertical:6,height:32,gap:7},dot:{width:6,height:6,borderRadius:3},dotLarge:{width:8,height:8,borderRadius:4},label:{fontSize:11,fontWeight:"500",color:r.color.textSecondary,fontFamily:"system"},labelLarge:{fontSize:13,fontWeight:"600",letterSpacing:.2,fontFamily:'"SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'},count:{fontSize:11,fontVariant:["tabular-nums"],fontWeight:"600",marginLeft:"auto",fontFamily:"system"},countLarge:{fontSize:13,fontWeight:"700",fontFamily:'"SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}});export default w;
|
|
@@ -1,95 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { ChipStrip, useChipTap } from "@buoy-gg/shared-ui";
|
|
4
|
-
import QueryStatus from "./QueryStatus";
|
|
5
|
-
import useQueryStatusCounts from "../../hooks/useQueryStatusCounts";
|
|
6
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
/**
|
|
8
|
-
* Horizontal status filter bar for queries with scroll-aware tap handling to prevent misfires.
|
|
9
|
-
*/
|
|
10
|
-
const QueryStatusCount = ({
|
|
11
|
-
activeFilter,
|
|
12
|
-
onFilterChange,
|
|
13
|
-
size = "default"
|
|
14
|
-
}) => {
|
|
15
|
-
const {
|
|
16
|
-
fresh,
|
|
17
|
-
stale,
|
|
18
|
-
fetching,
|
|
19
|
-
paused,
|
|
20
|
-
inactive
|
|
21
|
-
} = useQueryStatusCounts();
|
|
22
|
-
const {
|
|
23
|
-
scrollProps,
|
|
24
|
-
onTouchStart: handleTouchStart,
|
|
25
|
-
isTap
|
|
26
|
-
} = useChipTap();
|
|
27
|
-
const handleFilterClick = (filter, event) => {
|
|
28
|
-
if (!isTap(event)) return;
|
|
29
|
-
if (onFilterChange) {
|
|
30
|
-
// Toggle filter: if already active, clear it; otherwise set it
|
|
31
|
-
onFilterChange(activeFilter === filter ? null : filter);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
return /*#__PURE__*/_jsxs(ChipStrip, {
|
|
35
|
-
scrollProps: scrollProps,
|
|
36
|
-
sentryLabel: "ignore devtools query status count scroll",
|
|
37
|
-
children: [/*#__PURE__*/_jsx(QueryStatus, {
|
|
38
|
-
label: "Fresh",
|
|
39
|
-
color: "green",
|
|
40
|
-
count: fresh,
|
|
41
|
-
isActive: activeFilter === "fresh",
|
|
42
|
-
onPress: event => handleFilterClick("fresh", event),
|
|
43
|
-
onTouchStart: handleTouchStart,
|
|
44
|
-
testID: "buoy-rq-status-fresh",
|
|
45
|
-
showLabel: true // Always show labels now
|
|
46
|
-
,
|
|
47
|
-
size: size
|
|
48
|
-
}), /*#__PURE__*/_jsx(QueryStatus, {
|
|
49
|
-
label: "Loading",
|
|
50
|
-
color: "blue",
|
|
51
|
-
count: fetching,
|
|
52
|
-
isActive: activeFilter === "fetching",
|
|
53
|
-
onPress: event => handleFilterClick("fetching", event),
|
|
54
|
-
onTouchStart: handleTouchStart,
|
|
55
|
-
testID: "buoy-rq-status-fetching",
|
|
56
|
-
showLabel: true // Always show labels now
|
|
57
|
-
,
|
|
58
|
-
size: size
|
|
59
|
-
}), /*#__PURE__*/_jsx(QueryStatus, {
|
|
60
|
-
label: "Paused",
|
|
61
|
-
color: "purple",
|
|
62
|
-
count: paused,
|
|
63
|
-
isActive: activeFilter === "paused",
|
|
64
|
-
onPress: event => handleFilterClick("paused", event),
|
|
65
|
-
onTouchStart: handleTouchStart,
|
|
66
|
-
testID: "buoy-rq-status-paused",
|
|
67
|
-
showLabel: true // Always show labels now
|
|
68
|
-
,
|
|
69
|
-
size: size
|
|
70
|
-
}), /*#__PURE__*/_jsx(QueryStatus, {
|
|
71
|
-
label: "Stale",
|
|
72
|
-
color: "yellow",
|
|
73
|
-
count: stale,
|
|
74
|
-
isActive: activeFilter === "stale",
|
|
75
|
-
onPress: event => handleFilterClick("stale", event),
|
|
76
|
-
onTouchStart: handleTouchStart,
|
|
77
|
-
testID: "buoy-rq-status-stale",
|
|
78
|
-
showLabel: true // Always show labels now
|
|
79
|
-
,
|
|
80
|
-
size: size
|
|
81
|
-
}), /*#__PURE__*/_jsx(QueryStatus, {
|
|
82
|
-
label: "Idle",
|
|
83
|
-
color: "gray",
|
|
84
|
-
count: inactive,
|
|
85
|
-
isActive: activeFilter === "inactive",
|
|
86
|
-
onPress: event => handleFilterClick("inactive", event),
|
|
87
|
-
onTouchStart: handleTouchStart,
|
|
88
|
-
testID: "buoy-rq-status-inactive",
|
|
89
|
-
showLabel: true // Always show labels now
|
|
90
|
-
,
|
|
91
|
-
size: size
|
|
92
|
-
})]
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
export default QueryStatusCount;
|
|
1
|
+
"use strict";import{ChipStrip as y,useChipTap as S}from"@buoy-gg/shared-ui";import u from"./QueryStatus";import T from"../../hooks/useQueryStatusCounts";import{jsx as a,jsxs as m}from"react/jsx-runtime";const P=({activeFilter:t,onFilterChange:l,size:o="default"})=>{const{fresh:n,stale:c,fetching:i,paused:h,inactive:p}=T();const{scrollProps:b,onTouchStart:e,isTap:f}=S();const r=(s,d)=>{if(!f(d))return;if(l){l(t===s?null:s)}};return m(y,{scrollProps:b,sentryLabel:"ignore devtools query status count scroll",children:[a(u,{label:"Fresh",color:"green",count:n,isActive:t==="fresh",onPress:s=>r("fresh",s),onTouchStart:e,testID:"buoy-rq-status-fresh",showLabel:true,size:o}),a(u,{label:"Loading",color:"blue",count:i,isActive:t==="fetching",onPress:s=>r("fetching",s),onTouchStart:e,testID:"buoy-rq-status-fetching",showLabel:true,size:o}),a(u,{label:"Paused",color:"purple",count:h,isActive:t==="paused",onPress:s=>r("paused",s),onTouchStart:e,testID:"buoy-rq-status-paused",showLabel:true,size:o}),a(u,{label:"Stale",color:"yellow",count:c,isActive:t==="stale",onPress:s=>r("stale",s),onTouchStart:e,testID:"buoy-rq-status-stale",showLabel:true,size:o}),a(u,{label:"Idle",color:"gray",count:p,isActive:t==="inactive",onPress:s=>r("inactive",s),onTouchStart:e,testID:"buoy-rq-status-inactive",showLabel:true,size:o})]})};export default P;
|
|
@@ -1,56 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { ChipStrip, useChipTap } from "@buoy-gg/shared-ui";
|
|
4
|
-
import QueryStatus from "./QueryStatus";
|
|
5
|
-
import { getStorageTypeLabel, getStorageTypeColor } from "../../utils/storageQueryUtils";
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
const allStorageTypes = ["mmkv", "async", "secure"];
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Storage type filter component following composition principles
|
|
11
|
-
*
|
|
12
|
-
* Applied principles:
|
|
13
|
-
* - Decompose by Responsibility: Dedicated component for storage type filtering
|
|
14
|
-
* - No unnecessary memoization - simple toggle state management [[memory:4875074]]
|
|
15
|
-
*/
|
|
16
|
-
const StorageStatusCount = ({
|
|
17
|
-
activeStorageTypes = new Set(allStorageTypes),
|
|
18
|
-
onStorageTypesChange,
|
|
19
|
-
counts
|
|
20
|
-
}) => {
|
|
21
|
-
const {
|
|
22
|
-
scrollProps,
|
|
23
|
-
onTouchStart: handleTouchStart,
|
|
24
|
-
isTap
|
|
25
|
-
} = useChipTap();
|
|
26
|
-
const handleStorageTypeToggle = (storageType, event) => {
|
|
27
|
-
if (!isTap(event)) return;
|
|
28
|
-
if (onStorageTypesChange) {
|
|
29
|
-
const newStorageTypes = new Set(activeStorageTypes);
|
|
30
|
-
if (newStorageTypes.has(storageType)) {
|
|
31
|
-
newStorageTypes.delete(storageType);
|
|
32
|
-
} else {
|
|
33
|
-
newStorageTypes.add(storageType);
|
|
34
|
-
}
|
|
35
|
-
onStorageTypesChange(newStorageTypes);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
return /*#__PURE__*/_jsx(ChipStrip, {
|
|
39
|
-
scrollProps: scrollProps,
|
|
40
|
-
sentryLabel: "ignore devtools storage status count scroll",
|
|
41
|
-
children: allStorageTypes.map(storageType => {
|
|
42
|
-
const count = counts?.[storageType] ?? 0;
|
|
43
|
-
return /*#__PURE__*/_jsx(QueryStatus, {
|
|
44
|
-
label: getStorageTypeLabel(storageType),
|
|
45
|
-
color: getStorageTypeColor(storageType),
|
|
46
|
-
count: count // Show actual storage query counts
|
|
47
|
-
,
|
|
48
|
-
isActive: activeStorageTypes.has(storageType),
|
|
49
|
-
onPress: event => handleStorageTypeToggle(storageType, event),
|
|
50
|
-
onTouchStart: handleTouchStart,
|
|
51
|
-
showLabel: true
|
|
52
|
-
}, storageType);
|
|
53
|
-
})
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
export default StorageStatusCount;
|
|
1
|
+
"use strict";import{ChipStrip as m,useChipTap as h}from"@buoy-gg/shared-ui";import p from"./QueryStatus";import{getStorageTypeLabel as d,getStorageTypeColor as f}from"../../utils/storageQueryUtils";import{jsx as l}from"react/jsx-runtime";const n=["mmkv","async","secure"];const b=({activeStorageTypes:e=new Set(n),onStorageTypesChange:s,counts:c})=>{const{scrollProps:u,onTouchStart:a,isTap:i}=h();const S=(t,r)=>{if(!i(r))return;if(s){const o=new Set(e);if(o.has(t)){o.delete(t)}else{o.add(t)}s(o)}};return l(m,{scrollProps:u,sentryLabel:"ignore devtools storage status count scroll",children:n.map(t=>{const r=c?.[t]??0;return l(p,{label:d(t),color:f(t),count:r,isActive:e.has(t),onPress:o=>S(t,o),onTouchStart:a,showLabel:true},t)})})};export default b;
|
|
@@ -1,22 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
export { default as Explorer } from "./Explorer";
|
|
4
|
-
export { default as QueryBrowser } from "./QueryBrowser";
|
|
5
|
-
export { default as QueryDetails } from "./QueryDetails";
|
|
6
|
-
export { default as QueryInformation } from "./QueryInformation";
|
|
7
|
-
export { default as QueryActions } from "./QueryActions";
|
|
8
|
-
export { default as QueryRow } from "./QueryRow";
|
|
9
|
-
export { default as QueryStatus } from "./QueryStatus";
|
|
10
|
-
export { default as QueryStatusCount } from "./QueryStatusCount";
|
|
11
|
-
export { default as QueryDetailsChip } from "./QueryDetailsChip";
|
|
12
|
-
export { default as MutationsList } from "./MutationsList";
|
|
13
|
-
export { default as MutationDetails } from "./MutationDetails";
|
|
14
|
-
export { default as MutationInformation } from "./MutationInformation";
|
|
15
|
-
export { default as MutationButton } from "./MutationButton";
|
|
16
|
-
export { default as MutationStatusCount } from "./MutationStatusCount";
|
|
17
|
-
export { default as MutationDetailsChips } from "./MutationDetailsChips";
|
|
18
|
-
export { default as ActionButton } from "./ActionButton";
|
|
19
|
-
export { default as ClearCacheButton } from "./ClearCacheButton";
|
|
20
|
-
export { default as NetworkToggleButton } from "./NetworkToggleButton";
|
|
21
|
-
export { default as StorageStatusCount } from "./StorageStatusCount";
|
|
22
|
-
export { TanstackLogo, CheckCircle, LoadingCircle, PauseCircle, XCircle } from "./svgs";
|
|
1
|
+
"use strict";export{default as Explorer}from"./Explorer";export{default as QueryBrowser}from"./QueryBrowser";export{default as QueryDetails}from"./QueryDetails";export{default as QueryInformation}from"./QueryInformation";export{default as QueryActions}from"./QueryActions";export{default as QueryRow}from"./QueryRow";export{default as QueryStatus}from"./QueryStatus";export{default as QueryStatusCount}from"./QueryStatusCount";export{default as QueryDetailsChip}from"./QueryDetailsChip";export{default as MutationsList}from"./MutationsList";export{default as MutationDetails}from"./MutationDetails";export{default as MutationInformation}from"./MutationInformation";export{default as MutationButton}from"./MutationButton";export{default as MutationStatusCount}from"./MutationStatusCount";export{default as MutationDetailsChips}from"./MutationDetailsChips";export{default as ActionButton}from"./ActionButton";export{default as ClearCacheButton}from"./ClearCacheButton";export{default as NetworkToggleButton}from"./NetworkToggleButton";export{default as StorageStatusCount}from"./StorageStatusCount";export{TanstackLogo,CheckCircle,LoadingCircle,PauseCircle,XCircle}from"./svgs";
|
|
@@ -1,64 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { QueryIcon, CheckCircle as SharedCheckCircle, Activity as SharedActivity, Pause as SharedPause, XCircle as SharedXCircle, buoyColors } from "@buoy-gg/shared-ui";
|
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
/** React Query brand mark used across the dev tools UI. */
|
|
6
|
-
export function TanstackLogo({
|
|
7
|
-
size = 24
|
|
8
|
-
}) {
|
|
9
|
-
return /*#__PURE__*/_jsx(QueryIcon, {
|
|
10
|
-
size: size
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/** Status icon representing successful requests. */
|
|
15
|
-
export function CheckCircle({
|
|
16
|
-
size = 14,
|
|
17
|
-
color = buoyColors.success,
|
|
18
|
-
strokeWidth = 2
|
|
19
|
-
}) {
|
|
20
|
-
return /*#__PURE__*/_jsx(SharedCheckCircle, {
|
|
21
|
-
size: size,
|
|
22
|
-
color: color,
|
|
23
|
-
strokeWidth: strokeWidth
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** Status icon representing in-flight queries or mutations. */
|
|
28
|
-
export function LoadingCircle({
|
|
29
|
-
size = 14,
|
|
30
|
-
color = buoyColors.warning,
|
|
31
|
-
strokeWidth = 2
|
|
32
|
-
}) {
|
|
33
|
-
return /*#__PURE__*/_jsx(SharedActivity, {
|
|
34
|
-
size: size,
|
|
35
|
-
color: color,
|
|
36
|
-
strokeWidth: strokeWidth
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/** Status icon representing paused queries. */
|
|
41
|
-
export function PauseCircle({
|
|
42
|
-
size = 14,
|
|
43
|
-
color = buoyColors.textMuted,
|
|
44
|
-
strokeWidth = 2
|
|
45
|
-
}) {
|
|
46
|
-
return /*#__PURE__*/_jsx(SharedPause, {
|
|
47
|
-
size: size,
|
|
48
|
-
color: color,
|
|
49
|
-
strokeWidth: strokeWidth
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/** Status icon representing errored requests. */
|
|
54
|
-
export function XCircle({
|
|
55
|
-
size = 14,
|
|
56
|
-
color = buoyColors.error,
|
|
57
|
-
strokeWidth = 2
|
|
58
|
-
}) {
|
|
59
|
-
return /*#__PURE__*/_jsx(SharedXCircle, {
|
|
60
|
-
size: size,
|
|
61
|
-
color: color,
|
|
62
|
-
strokeWidth: strokeWidth
|
|
63
|
-
});
|
|
64
|
-
}
|
|
1
|
+
"use strict";import{QueryIcon as c,CheckCircle as s,Activity as n,Pause as u,XCircle as a,buoyColors as i}from"@buoy-gg/shared-ui";import{jsx as o}from"react/jsx-runtime";export function TanstackLogo({size:r=24}){return o(c,{size:r})}export function CheckCircle({size:r=14,color:e=i.success,strokeWidth:t=2}){return o(s,{size:r,color:e,strokeWidth:t})}export function LoadingCircle({size:r=14,color:e=i.warning,strokeWidth:t=2}){return o(n,{size:r,color:e,strokeWidth:t})}export function PauseCircle({size:r=14,color:e=i.textMuted,strokeWidth:t=2}){return o(u,{size:r,color:e,strokeWidth:t})}export function XCircle({size:r=14,color:e=i.error,strokeWidth:t=2}){return o(a,{size:r,color:e,strokeWidth:t})}
|
|
@@ -1,46 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { useMemo } from "react";
|
|
4
|
-
import triggerLoading from "../utils/actions/triggerLoading";
|
|
5
|
-
import refetch from "../utils/actions/refetch";
|
|
6
|
-
import triggerError from "../utils/actions/triggerError";
|
|
7
|
-
import { getQueryStatusLabel } from "../utils/getQueryStatusLabel";
|
|
8
|
-
/**
|
|
9
|
-
* Derives compact action button configuration for the footer. Returns 3 essential buttons
|
|
10
|
-
* (Refetch, Loading, Error) optimized for small device footprints.
|
|
11
|
-
*
|
|
12
|
-
* @param selectedQuery - The query to derive actions for
|
|
13
|
-
* @param queryClient - The query client for executing actions
|
|
14
|
-
* @param queryVersion - Optional version number that increments on query state changes.
|
|
15
|
-
*/
|
|
16
|
-
export function useActionButtons(selectedQuery, queryClient, queryVersion) {
|
|
17
|
-
const actionButtons = useMemo(() => {
|
|
18
|
-
const queryStatus = selectedQuery.state.status;
|
|
19
|
-
const isFetching = getQueryStatusLabel(selectedQuery) === "fetching";
|
|
20
|
-
const buttons = [{
|
|
21
|
-
label: "Refetch",
|
|
22
|
-
variant: "refetch",
|
|
23
|
-
disabled: isFetching,
|
|
24
|
-
onPress: () => refetch({
|
|
25
|
-
query: selectedQuery
|
|
26
|
-
})
|
|
27
|
-
}, {
|
|
28
|
-
label: selectedQuery.state.fetchStatus === "fetching" ? "Restore Loading" : "Trigger Loading",
|
|
29
|
-
variant: "triggerLoading",
|
|
30
|
-
disabled: false,
|
|
31
|
-
onPress: () => triggerLoading({
|
|
32
|
-
query: selectedQuery
|
|
33
|
-
})
|
|
34
|
-
}, {
|
|
35
|
-
label: queryStatus === "error" ? "Restore Error" : "Trigger Error",
|
|
36
|
-
variant: "triggerError",
|
|
37
|
-
disabled: queryStatus === "pending",
|
|
38
|
-
onPress: () => triggerError({
|
|
39
|
-
query: selectedQuery,
|
|
40
|
-
queryClient
|
|
41
|
-
})
|
|
42
|
-
}];
|
|
43
|
-
return buttons;
|
|
44
|
-
}, [selectedQuery, queryClient, queryVersion]);
|
|
45
|
-
return actionButtons;
|
|
46
|
-
}
|
|
1
|
+
"use strict";import{useMemo as e}from"react";import g from"../utils/actions/triggerLoading";import f from"../utils/actions/refetch";import m from"../utils/actions/triggerError";import{getQueryStatusLabel as u}from"../utils/getQueryStatusLabel";export function useActionButtons(r,t,i){const n=e(()=>{const o=r.state.status;const a=u(r)==="fetching";const s=[{label:"Refetch",variant:"refetch",disabled:a,onPress:()=>f({query:r})},{label:r.state.fetchStatus==="fetching"?"Restore Loading":"Trigger Loading",variant:"triggerLoading",disabled:false,onPress:()=>g({query:r})},{label:o==="error"?"Restore Error":"Trigger Error",variant:"triggerError",disabled:o==="pending",onPress:()=>m({query:r,queryClient:t})}];return s},[r,t,i]);return n}
|
|
@@ -1,82 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
|
-
import { useQueryClient } from "@tanstack/react-query";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Tracks all active React Query mutations with lightweight change detection.
|
|
8
|
-
* Mirrors the pattern used in useAllQueries for consistency.
|
|
9
|
-
*/
|
|
10
|
-
function useAllMutations() {
|
|
11
|
-
const queryClient = useQueryClient();
|
|
12
|
-
const [mutations, setMutations] = useState(() => {
|
|
13
|
-
// Initialize with current mutations to avoid flash
|
|
14
|
-
return queryClient.getMutationCache().getAll();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
// Track mutation states using a Map for O(1) lookups
|
|
18
|
-
const mutationStatesRef = useRef(new Map());
|
|
19
|
-
const updateTimerRef = useRef(undefined);
|
|
20
|
-
|
|
21
|
-
// Check if mutations have changed
|
|
22
|
-
const hasMutationsChanged = useCallback(newMutations => {
|
|
23
|
-
const statesMap = mutationStatesRef.current;
|
|
24
|
-
|
|
25
|
-
// Quick length check first
|
|
26
|
-
if (newMutations.length !== statesMap.size) {
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Check if any mutation state has changed
|
|
31
|
-
for (const mutation of newMutations) {
|
|
32
|
-
const prevState = statesMap.get(mutation.mutationId);
|
|
33
|
-
if (!prevState) return true;
|
|
34
|
-
if (prevState.status !== mutation.state.status || prevState.submittedAt !== mutation.state.submittedAt || prevState.isPaused !== mutation.state.isPaused) {
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return false;
|
|
39
|
-
}, []);
|
|
40
|
-
|
|
41
|
-
// Update function
|
|
42
|
-
const updateMutations = useCallback(() => {
|
|
43
|
-
const allMutations = queryClient.getMutationCache().getAll();
|
|
44
|
-
if (hasMutationsChanged(allMutations)) {
|
|
45
|
-
// Update states map
|
|
46
|
-
const newStatesMap = new Map();
|
|
47
|
-
allMutations.forEach(m => {
|
|
48
|
-
newStatesMap.set(m.mutationId, m.state);
|
|
49
|
-
});
|
|
50
|
-
mutationStatesRef.current = newStatesMap;
|
|
51
|
-
setMutations(allMutations);
|
|
52
|
-
}
|
|
53
|
-
}, [queryClient, hasMutationsChanged]);
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
// Initial update
|
|
56
|
-
updateMutations();
|
|
57
|
-
|
|
58
|
-
// Subscribe with event filtering (matching useAllQueries pattern)
|
|
59
|
-
const unsubscribe = queryClient.getMutationCache().subscribe(event => {
|
|
60
|
-
// Process events that affect mutation list
|
|
61
|
-
if (event.type === "added" || event.type === "removed" || event.type === "updated") {
|
|
62
|
-
// Debounce updates to batch rapid changes
|
|
63
|
-
if (updateTimerRef.current) {
|
|
64
|
-
clearTimeout(updateTimerRef.current);
|
|
65
|
-
}
|
|
66
|
-
updateTimerRef.current = setTimeout(() => {
|
|
67
|
-
updateMutations();
|
|
68
|
-
}, 10);
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
return () => {
|
|
72
|
-
unsubscribe();
|
|
73
|
-
if (updateTimerRef.current) {
|
|
74
|
-
clearTimeout(updateTimerRef.current);
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
}, [queryClient, updateMutations]);
|
|
78
|
-
return {
|
|
79
|
-
mutations
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
export default useAllMutations;
|
|
1
|
+
"use strict";import{useCallback as c,useEffect as m,useRef as f,useState as p}from"react";import{useQueryClient as M}from"@tanstack/react-query";function g(){const s=M();const[d,l]=p(()=>{return s.getMutationCache().getAll()});const i=f(new Map);const r=f(void 0);const o=c(e=>{const t=i.current;if(e.length!==t.size){return true}for(const u of e){const n=t.get(u.mutationId);if(!n)return true;if(n.status!==u.state.status||n.submittedAt!==u.state.submittedAt||n.isPaused!==u.state.isPaused){return true}}return false},[]);const a=c(()=>{const e=s.getMutationCache().getAll();if(o(e)){const t=new Map;e.forEach(u=>{t.set(u.mutationId,u.state)});i.current=t;l(e)}},[s,o]);m(()=>{a();const e=s.getMutationCache().subscribe(t=>{if(t.type==="added"||t.type==="removed"||t.type==="updated"){if(r.current){clearTimeout(r.current)}r.current=setTimeout(()=>{a()},10)}});return()=>{e();if(r.current){clearTimeout(r.current)}}},[s,a]);return{mutations:d}}export default g;
|