@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.
Files changed (243) hide show
  1. package/README.md +11 -73
  2. package/lib/commonjs/checkPeer.js +1 -8
  3. package/lib/commonjs/checkPeer.web.js +1 -3
  4. package/lib/commonjs/index.js +1 -657
  5. package/lib/commonjs/preset.js +1 -243
  6. package/lib/commonjs/react-query/components/DataEditorMode.js +1 -317
  7. package/lib/commonjs/react-query/components/FilterStatusBadge.js +1 -55
  8. package/lib/commonjs/react-query/components/MutationBrowserMode.js +1 -52
  9. package/lib/commonjs/react-query/components/MutationEditorMode.js +1 -276
  10. package/lib/commonjs/react-query/components/QueryBrowserMode.js +1 -99
  11. package/lib/commonjs/react-query/components/QueryDebugInfo.js +1 -107
  12. package/lib/commonjs/react-query/components/QueryFilterViewV3.js +1 -224
  13. package/lib/commonjs/react-query/components/QuerySelector.js +1 -209
  14. package/lib/commonjs/react-query/components/ReactQueryDevToolsModal.js +1 -91
  15. package/lib/commonjs/react-query/components/ReactQuerySection.js +1 -47
  16. package/lib/commonjs/react-query/components/ReactQueryTracker.js +1 -38
  17. package/lib/commonjs/react-query/components/WifiToggle.js +1 -51
  18. package/lib/commonjs/react-query/components/modals/DataEditorModal.js +1 -103
  19. package/lib/commonjs/react-query/components/modals/MutationBrowserFooter.js +1 -61
  20. package/lib/commonjs/react-query/components/modals/MutationBrowserModal.js +1 -164
  21. package/lib/commonjs/react-query/components/modals/MutationEditorModal.js +1 -106
  22. package/lib/commonjs/react-query/components/modals/QueryBrowserFooter.js +1 -56
  23. package/lib/commonjs/react-query/components/modals/QueryBrowserModal.js +1 -254
  24. package/lib/commonjs/react-query/components/modals/ReactQueryModal.js +1 -83
  25. package/lib/commonjs/react-query/components/modals/ReactQueryModalHeader.js +1 -194
  26. package/lib/commonjs/react-query/components/modals/SwipeIndicator.js +1 -204
  27. package/lib/commonjs/react-query/components/query-browser/ActionButton.js +1 -100
  28. package/lib/commonjs/react-query/components/query-browser/ClearCacheButton.js +1 -53
  29. package/lib/commonjs/react-query/components/query-browser/Explorer.js +1 -75
  30. package/lib/commonjs/react-query/components/query-browser/MutationButton.js +1 -190
  31. package/lib/commonjs/react-query/components/query-browser/MutationDetails.js +1 -124
  32. package/lib/commonjs/react-query/components/query-browser/MutationDetailsChips.js +1 -68
  33. package/lib/commonjs/react-query/components/query-browser/MutationInformation.js +1 -118
  34. package/lib/commonjs/react-query/components/query-browser/MutationStatusCount.js +1 -84
  35. package/lib/commonjs/react-query/components/query-browser/MutationsList.js +1 -220
  36. package/lib/commonjs/react-query/components/query-browser/NetworkToggleButton.js +1 -54
  37. package/lib/commonjs/react-query/components/query-browser/QueryActions.js +1 -124
  38. package/lib/commonjs/react-query/components/query-browser/QueryBrowser.js +1 -181
  39. package/lib/commonjs/react-query/components/query-browser/QueryDetails.js +1 -141
  40. package/lib/commonjs/react-query/components/query-browser/QueryDetailsChip.js +1 -78
  41. package/lib/commonjs/react-query/components/query-browser/QueryInformation.js +1 -95
  42. package/lib/commonjs/react-query/components/query-browser/QueryRow.js +1 -96
  43. package/lib/commonjs/react-query/components/query-browser/QueryStatus.js +1 -167
  44. package/lib/commonjs/react-query/components/query-browser/QueryStatusCount.js +1 -100
  45. package/lib/commonjs/react-query/components/query-browser/StorageStatusCount.js +1 -61
  46. package/lib/commonjs/react-query/components/query-browser/index.js +1 -170
  47. package/lib/commonjs/react-query/components/query-browser/svgs.js +1 -72
  48. package/lib/commonjs/react-query/hooks/useActionButtons.js +1 -51
  49. package/lib/commonjs/react-query/hooks/useAllMutations.js +1 -85
  50. package/lib/commonjs/react-query/hooks/useAllQueries.js +1 -117
  51. package/lib/commonjs/react-query/hooks/useModalManager.js +1 -178
  52. package/lib/commonjs/react-query/hooks/useModalPersistence.js +1 -71
  53. package/lib/commonjs/react-query/hooks/useMutationActionButtons.js +1 -21
  54. package/lib/commonjs/react-query/hooks/useQueryStatusCounts.js +1 -114
  55. package/lib/commonjs/react-query/hooks/useReactQueryState.js +1 -24
  56. package/lib/commonjs/react-query/hooks/useSelectedMutation.js +1 -30
  57. package/lib/commonjs/react-query/hooks/useSelectedQuery.js +1 -96
  58. package/lib/commonjs/react-query/hooks/useStorageQueryCounts.js +1 -28
  59. package/lib/commonjs/react-query/hooks/useWifiState.js +1 -67
  60. package/lib/commonjs/react-query/stores/reactQueryEventStore.js +1 -302
  61. package/lib/commonjs/react-query/sync/dehydrate.js +1 -166
  62. package/lib/commonjs/react-query/sync/reactQuerySyncAdapter.js +1 -593
  63. package/lib/commonjs/react-query/sync/snapshotProvider.js +1 -289
  64. package/lib/commonjs/react-query/sync/useReactQuerySyncAdapter.js +1 -34
  65. package/lib/commonjs/react-query/types/types.js +1 -14
  66. package/lib/commonjs/react-query/utils/actions/deleteItem.js +1 -23
  67. package/lib/commonjs/react-query/utils/actions/emitDevToolsEvent.js +1 -40
  68. package/lib/commonjs/react-query/utils/actions/invalidate.js +1 -15
  69. package/lib/commonjs/react-query/utils/actions/refetch.js +1 -17
  70. package/lib/commonjs/react-query/utils/actions/remove.js +1 -15
  71. package/lib/commonjs/react-query/utils/actions/reset.js +1 -17
  72. package/lib/commonjs/react-query/utils/actions/triggerError.js +1 -33
  73. package/lib/commonjs/react-query/utils/actions/triggerLoading.js +1 -54
  74. package/lib/commonjs/react-query/utils/deleteNestedDataByPath.js +1 -56
  75. package/lib/commonjs/react-query/utils/getQueryStatusColor.js +1 -16
  76. package/lib/commonjs/react-query/utils/getQueryStatusLabel.js +1 -23
  77. package/lib/commonjs/react-query/utils/getStorageQueryCounts.js +1 -35
  78. package/lib/commonjs/react-query/utils/modalStorageOperations.js +1 -127
  79. package/lib/commonjs/react-query/utils/storageQueryUtils.js +1 -149
  80. package/lib/commonjs/react-query/utils/testIDs.js +1 -61
  81. package/lib/commonjs/react-query/utils/updateNestedDataByPath.js +1 -61
  82. package/lib/module/checkPeer.js +1 -8
  83. package/lib/module/checkPeer.web.js +1 -3
  84. package/lib/module/index.js +1 -130
  85. package/lib/module/preset.js +1 -239
  86. package/lib/module/react-query/components/DataEditorMode.js +1 -311
  87. package/lib/module/react-query/components/FilterStatusBadge.js +1 -51
  88. package/lib/module/react-query/components/MutationBrowserMode.js +1 -47
  89. package/lib/module/react-query/components/MutationEditorMode.js +1 -270
  90. package/lib/module/react-query/components/QueryBrowserMode.js +1 -94
  91. package/lib/module/react-query/components/QueryDebugInfo.js +1 -104
  92. package/lib/module/react-query/components/QueryFilterViewV3.js +1 -221
  93. package/lib/module/react-query/components/QuerySelector.js +1 -205
  94. package/lib/module/react-query/components/ReactQueryDevToolsModal.js +1 -87
  95. package/lib/module/react-query/components/ReactQuerySection.js +1 -43
  96. package/lib/module/react-query/components/ReactQueryTracker.js +1 -35
  97. package/lib/module/react-query/components/WifiToggle.js +1 -48
  98. package/lib/module/react-query/components/modals/DataEditorModal.js +1 -99
  99. package/lib/module/react-query/components/modals/MutationBrowserFooter.js +1 -56
  100. package/lib/module/react-query/components/modals/MutationBrowserModal.js +1 -161
  101. package/lib/module/react-query/components/modals/MutationEditorModal.js +1 -102
  102. package/lib/module/react-query/components/modals/QueryBrowserFooter.js +1 -51
  103. package/lib/module/react-query/components/modals/QueryBrowserModal.js +1 -250
  104. package/lib/module/react-query/components/modals/ReactQueryModal.js +1 -79
  105. package/lib/module/react-query/components/modals/ReactQueryModalHeader.js +1 -190
  106. package/lib/module/react-query/components/modals/SwipeIndicator.js +1 -201
  107. package/lib/module/react-query/components/query-browser/ActionButton.js +1 -96
  108. package/lib/module/react-query/components/query-browser/ClearCacheButton.js +1 -49
  109. package/lib/module/react-query/components/query-browser/Explorer.js +1 -70
  110. package/lib/module/react-query/components/query-browser/MutationButton.js +1 -186
  111. package/lib/module/react-query/components/query-browser/MutationDetails.js +1 -119
  112. package/lib/module/react-query/components/query-browser/MutationDetailsChips.js +1 -64
  113. package/lib/module/react-query/components/query-browser/MutationInformation.js +1 -113
  114. package/lib/module/react-query/components/query-browser/MutationStatusCount.js +1 -79
  115. package/lib/module/react-query/components/query-browser/MutationsList.js +1 -215
  116. package/lib/module/react-query/components/query-browser/NetworkToggleButton.js +1 -50
  117. package/lib/module/react-query/components/query-browser/QueryActions.js +1 -119
  118. package/lib/module/react-query/components/query-browser/QueryBrowser.js +1 -176
  119. package/lib/module/react-query/components/query-browser/QueryDetails.js +1 -136
  120. package/lib/module/react-query/components/query-browser/QueryDetailsChip.js +1 -74
  121. package/lib/module/react-query/components/query-browser/QueryInformation.js +1 -90
  122. package/lib/module/react-query/components/query-browser/QueryRow.js +1 -92
  123. package/lib/module/react-query/components/query-browser/QueryStatus.js +1 -163
  124. package/lib/module/react-query/components/query-browser/QueryStatusCount.js +1 -95
  125. package/lib/module/react-query/components/query-browser/StorageStatusCount.js +1 -56
  126. package/lib/module/react-query/components/query-browser/index.js +1 -22
  127. package/lib/module/react-query/components/query-browser/svgs.js +1 -64
  128. package/lib/module/react-query/hooks/useActionButtons.js +1 -46
  129. package/lib/module/react-query/hooks/useAllMutations.js +1 -82
  130. package/lib/module/react-query/hooks/useAllQueries.js +1 -114
  131. package/lib/module/react-query/hooks/useModalManager.js +1 -175
  132. package/lib/module/react-query/hooks/useModalPersistence.js +1 -67
  133. package/lib/module/react-query/hooks/useMutationActionButtons.js +1 -17
  134. package/lib/module/react-query/hooks/useQueryStatusCounts.js +1 -112
  135. package/lib/module/react-query/hooks/useReactQueryState.js +1 -20
  136. package/lib/module/react-query/hooks/useSelectedMutation.js +1 -27
  137. package/lib/module/react-query/hooks/useSelectedQuery.js +1 -92
  138. package/lib/module/react-query/hooks/useStorageQueryCounts.js +1 -25
  139. package/lib/module/react-query/hooks/useWifiState.js +1 -64
  140. package/lib/module/react-query/stores/reactQueryEventStore.js +1 -293
  141. package/lib/module/react-query/sync/dehydrate.js +1 -156
  142. package/lib/module/react-query/sync/reactQuerySyncAdapter.js +1 -589
  143. package/lib/module/react-query/sync/snapshotProvider.js +1 -284
  144. package/lib/module/react-query/sync/useReactQuerySyncAdapter.js +1 -31
  145. package/lib/module/react-query/types/types.js +1 -10
  146. package/lib/module/react-query/utils/actions/deleteItem.js +1 -19
  147. package/lib/module/react-query/utils/actions/emitDevToolsEvent.js +1 -36
  148. package/lib/module/react-query/utils/actions/invalidate.js +1 -11
  149. package/lib/module/react-query/utils/actions/refetch.js +1 -13
  150. package/lib/module/react-query/utils/actions/remove.js +1 -11
  151. package/lib/module/react-query/utils/actions/reset.js +1 -13
  152. package/lib/module/react-query/utils/actions/triggerError.js +1 -29
  153. package/lib/module/react-query/utils/actions/triggerLoading.js +1 -50
  154. package/lib/module/react-query/utils/deleteNestedDataByPath.js +1 -51
  155. package/lib/module/react-query/utils/getQueryStatusColor.js +1 -12
  156. package/lib/module/react-query/utils/getQueryStatusLabel.js +1 -19
  157. package/lib/module/react-query/utils/getStorageQueryCounts.js +1 -31
  158. package/lib/module/react-query/utils/modalStorageOperations.js +1 -117
  159. package/lib/module/react-query/utils/storageQueryUtils.js +1 -140
  160. package/lib/module/react-query/utils/testIDs.js +1 -54
  161. package/lib/module/react-query/utils/updateNestedDataByPath.js +1 -56
  162. package/lib/web/index.mjs +3 -4
  163. package/package.json +3 -3
  164. package/lib/typescript/checkPeer.d.ts.map +0 -1
  165. package/lib/typescript/checkPeer.web.d.ts.map +0 -1
  166. package/lib/typescript/index.d.ts.map +0 -1
  167. package/lib/typescript/preset.d.ts.map +0 -1
  168. package/lib/typescript/react-query/components/DataEditorMode.d.ts.map +0 -1
  169. package/lib/typescript/react-query/components/FilterStatusBadge.d.ts.map +0 -1
  170. package/lib/typescript/react-query/components/MutationBrowserMode.d.ts.map +0 -1
  171. package/lib/typescript/react-query/components/MutationEditorMode.d.ts.map +0 -1
  172. package/lib/typescript/react-query/components/QueryBrowserMode.d.ts.map +0 -1
  173. package/lib/typescript/react-query/components/QueryDebugInfo.d.ts.map +0 -1
  174. package/lib/typescript/react-query/components/QueryFilterViewV3.d.ts.map +0 -1
  175. package/lib/typescript/react-query/components/QuerySelector.d.ts.map +0 -1
  176. package/lib/typescript/react-query/components/ReactQueryDevToolsModal.d.ts.map +0 -1
  177. package/lib/typescript/react-query/components/ReactQuerySection.d.ts.map +0 -1
  178. package/lib/typescript/react-query/components/ReactQueryTracker.d.ts.map +0 -1
  179. package/lib/typescript/react-query/components/WifiToggle.d.ts.map +0 -1
  180. package/lib/typescript/react-query/components/modals/DataEditorModal.d.ts.map +0 -1
  181. package/lib/typescript/react-query/components/modals/MutationBrowserFooter.d.ts.map +0 -1
  182. package/lib/typescript/react-query/components/modals/MutationBrowserModal.d.ts.map +0 -1
  183. package/lib/typescript/react-query/components/modals/MutationEditorModal.d.ts.map +0 -1
  184. package/lib/typescript/react-query/components/modals/QueryBrowserFooter.d.ts.map +0 -1
  185. package/lib/typescript/react-query/components/modals/QueryBrowserModal.d.ts.map +0 -1
  186. package/lib/typescript/react-query/components/modals/ReactQueryModal.d.ts.map +0 -1
  187. package/lib/typescript/react-query/components/modals/ReactQueryModalHeader.d.ts.map +0 -1
  188. package/lib/typescript/react-query/components/modals/SwipeIndicator.d.ts.map +0 -1
  189. package/lib/typescript/react-query/components/query-browser/ActionButton.d.ts.map +0 -1
  190. package/lib/typescript/react-query/components/query-browser/ClearCacheButton.d.ts.map +0 -1
  191. package/lib/typescript/react-query/components/query-browser/Explorer.d.ts.map +0 -1
  192. package/lib/typescript/react-query/components/query-browser/MutationButton.d.ts.map +0 -1
  193. package/lib/typescript/react-query/components/query-browser/MutationDetails.d.ts.map +0 -1
  194. package/lib/typescript/react-query/components/query-browser/MutationDetailsChips.d.ts.map +0 -1
  195. package/lib/typescript/react-query/components/query-browser/MutationInformation.d.ts.map +0 -1
  196. package/lib/typescript/react-query/components/query-browser/MutationStatusCount.d.ts.map +0 -1
  197. package/lib/typescript/react-query/components/query-browser/MutationsList.d.ts.map +0 -1
  198. package/lib/typescript/react-query/components/query-browser/NetworkToggleButton.d.ts.map +0 -1
  199. package/lib/typescript/react-query/components/query-browser/QueryActions.d.ts.map +0 -1
  200. package/lib/typescript/react-query/components/query-browser/QueryBrowser.d.ts.map +0 -1
  201. package/lib/typescript/react-query/components/query-browser/QueryDetails.d.ts.map +0 -1
  202. package/lib/typescript/react-query/components/query-browser/QueryDetailsChip.d.ts.map +0 -1
  203. package/lib/typescript/react-query/components/query-browser/QueryInformation.d.ts.map +0 -1
  204. package/lib/typescript/react-query/components/query-browser/QueryRow.d.ts.map +0 -1
  205. package/lib/typescript/react-query/components/query-browser/QueryStatus.d.ts.map +0 -1
  206. package/lib/typescript/react-query/components/query-browser/QueryStatusCount.d.ts.map +0 -1
  207. package/lib/typescript/react-query/components/query-browser/StorageStatusCount.d.ts.map +0 -1
  208. package/lib/typescript/react-query/components/query-browser/index.d.ts.map +0 -1
  209. package/lib/typescript/react-query/components/query-browser/svgs.d.ts.map +0 -1
  210. package/lib/typescript/react-query/hooks/useActionButtons.d.ts.map +0 -1
  211. package/lib/typescript/react-query/hooks/useAllMutations.d.ts.map +0 -1
  212. package/lib/typescript/react-query/hooks/useAllQueries.d.ts.map +0 -1
  213. package/lib/typescript/react-query/hooks/useModalManager.d.ts.map +0 -1
  214. package/lib/typescript/react-query/hooks/useModalPersistence.d.ts.map +0 -1
  215. package/lib/typescript/react-query/hooks/useMutationActionButtons.d.ts.map +0 -1
  216. package/lib/typescript/react-query/hooks/useQueryStatusCounts.d.ts.map +0 -1
  217. package/lib/typescript/react-query/hooks/useReactQueryState.d.ts.map +0 -1
  218. package/lib/typescript/react-query/hooks/useSelectedMutation.d.ts.map +0 -1
  219. package/lib/typescript/react-query/hooks/useSelectedQuery.d.ts.map +0 -1
  220. package/lib/typescript/react-query/hooks/useStorageQueryCounts.d.ts.map +0 -1
  221. package/lib/typescript/react-query/hooks/useWifiState.d.ts.map +0 -1
  222. package/lib/typescript/react-query/stores/reactQueryEventStore.d.ts.map +0 -1
  223. package/lib/typescript/react-query/sync/dehydrate.d.ts.map +0 -1
  224. package/lib/typescript/react-query/sync/reactQuerySyncAdapter.d.ts.map +0 -1
  225. package/lib/typescript/react-query/sync/snapshotProvider.d.ts.map +0 -1
  226. package/lib/typescript/react-query/sync/useReactQuerySyncAdapter.d.ts.map +0 -1
  227. package/lib/typescript/react-query/types/types.d.ts.map +0 -1
  228. package/lib/typescript/react-query/utils/actions/deleteItem.d.ts.map +0 -1
  229. package/lib/typescript/react-query/utils/actions/emitDevToolsEvent.d.ts.map +0 -1
  230. package/lib/typescript/react-query/utils/actions/invalidate.d.ts.map +0 -1
  231. package/lib/typescript/react-query/utils/actions/refetch.d.ts.map +0 -1
  232. package/lib/typescript/react-query/utils/actions/remove.d.ts.map +0 -1
  233. package/lib/typescript/react-query/utils/actions/reset.d.ts.map +0 -1
  234. package/lib/typescript/react-query/utils/actions/triggerError.d.ts.map +0 -1
  235. package/lib/typescript/react-query/utils/actions/triggerLoading.d.ts.map +0 -1
  236. package/lib/typescript/react-query/utils/deleteNestedDataByPath.d.ts.map +0 -1
  237. package/lib/typescript/react-query/utils/getQueryStatusColor.d.ts.map +0 -1
  238. package/lib/typescript/react-query/utils/getQueryStatusLabel.d.ts.map +0 -1
  239. package/lib/typescript/react-query/utils/getStorageQueryCounts.d.ts.map +0 -1
  240. package/lib/typescript/react-query/utils/modalStorageOperations.d.ts.map +0 -1
  241. package/lib/typescript/react-query/utils/storageQueryUtils.d.ts.map +0 -1
  242. package/lib/typescript/react-query/utils/testIDs.d.ts.map +0 -1
  243. package/lib/typescript/react-query/utils/updateNestedDataByPath.d.ts.map +0 -1
@@ -1,221 +1 @@
1
- "use strict";
2
-
3
- import { useMemo } from "react";
4
- import { DynamicFilterView, buoyColors } from "@buoy-gg/shared-ui";
5
- import { XCircle, Clock, RefreshCw, Globe, Zap, Filter, Eye } from "@buoy-gg/shared-ui";
6
- import { getQueryStatusLabel } from "../utils/getQueryStatusLabel";
7
- import { jsx as _jsx } from "react/jsx-runtime";
8
- /**
9
- * Comprehensive filter control panel for React Query DevTools matching the Network DevTools
10
- * filter UI pattern. Provides status filtering and query key pattern-based filtering.
11
- */
12
- export function QueryFilterViewV3({
13
- queries,
14
- activeFilter,
15
- onFilterChange,
16
- ignoredPatterns,
17
- onPatternToggle,
18
- includedPatterns,
19
- onIncludedPatternToggle
20
- }) {
21
- // Calculate status counts
22
- const statusCounts = useMemo(() => {
23
- const counts = {
24
- all: queries.length,
25
- disabled: 0,
26
- fresh: 0,
27
- stale: 0,
28
- fetching: 0,
29
- paused: 0,
30
- inactive: 0,
31
- error: 0
32
- };
33
- queries.forEach(query => {
34
- // Count by the status LABEL (single source of truth) so the Error chip's
35
- // count matches exactly what the cards show and what the Error filter
36
- // returns. (Previously error was counted off `state.error`, a different
37
- // axis than the label, so the count, cards, and filter could disagree.)
38
- const status = getQueryStatusLabel(query);
39
- if (status === "disabled") counts.disabled++;else if (status === "error") counts.error++;else if (status === "fresh") counts.fresh++;else if (status === "stale") counts.stale++;else if (status === "fetching") counts.fetching++;else if (status === "paused") counts.paused++;else if (status === "inactive") counts.inactive++;
40
- });
41
- return counts;
42
- }, [queries]);
43
-
44
- // Extract available query keys (excluding numeric-only keys)
45
- const availableQueryKeys = useMemo(() => {
46
- const keys = new Set();
47
- queries.forEach(query => {
48
- if (!query?.queryKey) return;
49
- const queryKeys = Array.isArray(query.queryKey) ? query.queryKey : [query.queryKey];
50
- queryKeys.forEach(key => {
51
- if (key != null) {
52
- const keyStr = String(key);
53
- // Skip if key is purely numeric (likely a dynamic ID)
54
- if (!/^\d+$/.test(keyStr)) {
55
- keys.add(keyStr);
56
- }
57
- }
58
- });
59
- });
60
- return Array.from(keys).sort().slice(0, 50); // Limit to 50
61
- }, [queries]);
62
-
63
- // Convert available query keys to suggestion items (just strings)
64
- const suggestionItems = useMemo(() => {
65
- return availableQueryKeys;
66
- }, [availableQueryKeys]);
67
-
68
- // Calculate filtered query count based on active patterns
69
- const filteredCount = useMemo(() => {
70
- let filtered = queries;
71
-
72
- // Apply included patterns filter
73
- if (includedPatterns.size > 0) {
74
- filtered = filtered.filter(query => {
75
- if (!query?.queryKey) return false;
76
- const keys = Array.isArray(query.queryKey) ? query.queryKey : [query.queryKey];
77
- const keyString = keys.filter(k => k != null).map(k => String(k)).join(" ").toLowerCase();
78
- return Array.from(includedPatterns).some(pattern => keyString.includes(pattern.toLowerCase()));
79
- });
80
- }
81
-
82
- // Apply ignored patterns filter
83
- if (ignoredPatterns.size > 0) {
84
- filtered = filtered.filter(query => {
85
- if (!query?.queryKey) return true;
86
- const keys = Array.isArray(query.queryKey) ? query.queryKey : [query.queryKey];
87
- const keyString = keys.filter(k => k != null).map(k => String(k)).join(" ").toLowerCase();
88
- return !Array.from(ignoredPatterns).some(pattern => keyString.includes(pattern.toLowerCase()));
89
- });
90
- }
91
- return filtered.length;
92
- }, [queries, includedPatterns, ignoredPatterns]);
93
-
94
- // Build the filter configuration
95
- const filterConfig = useMemo(() => {
96
- return {
97
- filterSummarySection: {
98
- enabled: true,
99
- totalCount: queries.length,
100
- filteredCount: filteredCount,
101
- includePatterns: includedPatterns,
102
- excludePatterns: ignoredPatterns
103
- },
104
- sections: [
105
- // Status section - radio button style
106
- {
107
- id: "status",
108
- title: "Status",
109
- type: "status",
110
- data: [{
111
- id: "status::all",
112
- label: "All",
113
- count: statusCounts.all,
114
- icon: Globe,
115
- color: buoyColors.primary,
116
- isActive: !activeFilter || activeFilter === "all"
117
- }, {
118
- id: "status::disabled",
119
- label: "Disabled",
120
- count: statusCounts.disabled,
121
- icon: XCircle,
122
- color: buoyColors.textMuted,
123
- isActive: activeFilter === "disabled"
124
- }, {
125
- id: "status::fresh",
126
- label: "Fresh",
127
- count: statusCounts.fresh,
128
- icon: Zap,
129
- color: buoyColors.success,
130
- isActive: activeFilter === "fresh"
131
- }, {
132
- id: "status::stale",
133
- label: "Stale",
134
- count: statusCounts.stale,
135
- icon: Clock,
136
- color: buoyColors.warning,
137
- isActive: activeFilter === "stale"
138
- }, {
139
- id: "status::fetching",
140
- label: "Fetching",
141
- count: statusCounts.fetching,
142
- icon: RefreshCw,
143
- color: buoyColors.primary,
144
- isActive: activeFilter === "fetching"
145
- }, {
146
- id: "status::paused",
147
- label: "Paused",
148
- count: statusCounts.paused,
149
- icon: Clock,
150
- color: buoyColors.textMuted,
151
- isActive: activeFilter === "paused"
152
- }, {
153
- id: "status::inactive",
154
- label: "Inactive",
155
- count: statusCounts.inactive,
156
- icon: Clock,
157
- color: buoyColors.textSecondary,
158
- isActive: activeFilter === "inactive"
159
- }, {
160
- id: "status::error",
161
- label: "Error",
162
- count: statusCounts.error,
163
- icon: XCircle,
164
- color: buoyColors.error,
165
- isActive: activeFilter === "error"
166
- }]
167
- }],
168
- addFilterSection: {
169
- enabled: true,
170
- placeholder: "Enter pattern to exclude...",
171
- title: "EXCLUDE FILTERS",
172
- icon: Filter
173
- },
174
- includeOnlySection: {
175
- enabled: true,
176
- title: "INCLUDE ONLY FILTERS",
177
- description: "Show ONLY queries matching these patterns. All non-matching queries will be hidden.",
178
- placeholder: "Enter pattern to include...",
179
- icon: Eye,
180
- patterns: includedPatterns,
181
- onPatternToggle: onIncludedPatternToggle,
182
- onPatternAdd: onIncludedPatternToggle
183
- },
184
- availableItemsSection: {
185
- enabled: true,
186
- title: "AVAILABLE QUERY KEYS",
187
- emptyMessage: "No queries found. Query keys will appear here once queries are active.",
188
- items: suggestionItems
189
- },
190
- howItWorksSection: {
191
- enabled: true,
192
- title: "HOW QUERY FILTERS WORK",
193
- description: "There are two types of query key filters:",
194
- examples: ["", "INCLUDE ONLY (green):", "• Shows ONLY queries matching the pattern", "• Example: 'rewards' → shows only reward queries", "• When active, non-matching queries are hidden", "", "EXCLUDE (blue):", "• Hides queries matching the pattern", "• Example: 'analytics' → hides analytics queries", "", "Filters are case-insensitive and match partial keys."]
195
- },
196
- activePatterns: ignoredPatterns
197
- };
198
- }, [statusCounts, activeFilter, ignoredPatterns, includedPatterns, suggestionItems, onIncludedPatternToggle, queries.length, filteredCount]);
199
-
200
- // Handle filter item clicks
201
- const handleFilterSelect = itemId => {
202
- const [section, value] = itemId.split("::");
203
- if (section === "status") {
204
- // Status filters are mutually exclusive
205
- if (value === "all" || activeFilter === value) {
206
- onFilterChange(null);
207
- } else {
208
- onFilterChange(value);
209
- }
210
- } else if (section === "suggestion") {
211
- // Toggle pattern
212
- onPatternToggle(value);
213
- }
214
- };
215
- return /*#__PURE__*/_jsx(DynamicFilterView, {
216
- ...filterConfig,
217
- onFilterChange: handleFilterSelect,
218
- onPatternToggle: onPatternToggle,
219
- onPatternAdd: onPatternToggle
220
- });
221
- }
1
+ "use strict";import{useMemo as f}from"react";import{DynamicFilterView as w,buoyColors as l}from"@buoy-gg/shared-ui";import{XCircle as S,Clock as h,RefreshCw as L,Globe as C,Zap as K,Filter as v,Eye as x}from"@buoy-gg/shared-ui";import{getQueryStatusLabel as k}from"../utils/getQueryStatusLabel";import{jsx as I}from"react/jsx-runtime";export function QueryFilterViewV3({queries:o,activeFilter:i,onFilterChange:p,ignoredPatterns:n,onPatternToggle:y,includedPatterns:c,onIncludedPatternToggle:d}){const a=f(()=>{const e={all:o.length,disabled:0,fresh:0,stale:0,fetching:0,paused:0,inactive:0,error:0};o.forEach(t=>{const r=k(t);if(r==="disabled")e.disabled++;else if(r==="error")e.error++;else if(r==="fresh")e.fresh++;else if(r==="stale")e.stale++;else if(r==="fetching")e.fetching++;else if(r==="paused")e.paused++;else if(r==="inactive")e.inactive++});return e},[o]);const m=f(()=>{const e=new Set;o.forEach(t=>{if(!t?.queryKey)return;const r=Array.isArray(t.queryKey)?t.queryKey:[t.queryKey];r.forEach(u=>{if(u!=null){const s=String(u);if(!/^\d+$/.test(s)){e.add(s)}}})});return Array.from(e).sort().slice(0,50)},[o]);const b=f(()=>{return m},[m]);const A=f(()=>{let e=o;if(c.size>0){e=e.filter(t=>{if(!t?.queryKey)return false;const r=Array.isArray(t.queryKey)?t.queryKey:[t.queryKey];const u=r.filter(s=>s!=null).map(s=>String(s)).join(" ").toLowerCase();return Array.from(c).some(s=>u.includes(s.toLowerCase()))})}if(n.size>0){e=e.filter(t=>{if(!t?.queryKey)return true;const r=Array.isArray(t.queryKey)?t.queryKey:[t.queryKey];const u=r.filter(s=>s!=null).map(s=>String(s)).join(" ").toLowerCase();return!Array.from(n).some(s=>u.includes(s.toLowerCase()))})}return e.length},[o,c,n]);const E=f(()=>{return{filterSummarySection:{enabled:true,totalCount:o.length,filteredCount:A,includePatterns:c,excludePatterns:n},sections:[{id:"status",title:"Status",type:"status",data:[{id:"status::all",label:"All",count:a.all,icon:C,color:l.primary,isActive:!i||i==="all"},{id:"status::disabled",label:"Disabled",count:a.disabled,icon:S,color:l.textMuted,isActive:i==="disabled"},{id:"status::fresh",label:"Fresh",count:a.fresh,icon:K,color:l.success,isActive:i==="fresh"},{id:"status::stale",label:"Stale",count:a.stale,icon:h,color:l.warning,isActive:i==="stale"},{id:"status::fetching",label:"Fetching",count:a.fetching,icon:L,color:l.primary,isActive:i==="fetching"},{id:"status::paused",label:"Paused",count:a.paused,icon:h,color:l.textMuted,isActive:i==="paused"},{id:"status::inactive",label:"Inactive",count:a.inactive,icon:h,color:l.textSecondary,isActive:i==="inactive"},{id:"status::error",label:"Error",count:a.error,icon:S,color:l.error,isActive:i==="error"}]}],addFilterSection:{enabled:true,placeholder:"Enter pattern to exclude...",title:"EXCLUDE FILTERS",icon:v},includeOnlySection:{enabled:true,title:"INCLUDE ONLY FILTERS",description:"Show ONLY queries matching these patterns. All non-matching queries will be hidden.",placeholder:"Enter pattern to include...",icon:x,patterns:c,onPatternToggle:d,onPatternAdd:d},availableItemsSection:{enabled:true,title:"AVAILABLE QUERY KEYS",emptyMessage:"No queries found. Query keys will appear here once queries are active.",items:b},howItWorksSection:{enabled:true,title:"HOW QUERY FILTERS WORK",description:"There are two types of query key filters:",examples:["","INCLUDE ONLY (green):","\u2022 Shows ONLY queries matching the pattern","\u2022 Example: 'rewards' \u2192 shows only reward queries","\u2022 When active, non-matching queries are hidden","","EXCLUDE (blue):","\u2022 Hides queries matching the pattern","\u2022 Example: 'analytics' \u2192 hides analytics queries","","Filters are case-insensitive and match partial keys."]},activePatterns:n}},[a,i,n,c,b,d,o.length,A]);const g=e=>{const[t,r]=e.split("::");if(t==="status"){if(r==="all"||i===r){p(null)}else{p(r)}}else if(t==="suggestion"){y(r)}};return I(w,{...E,onFilterChange:g,onPatternToggle:y,onPatternAdd:y})}
@@ -1,205 +1 @@
1
- "use strict";
2
-
3
- import { View, Text, StyleSheet, TouchableOpacity, Modal, ScrollView, Pressable } from "react-native";
4
- import { getQueryStatusColor } from "../utils/getQueryStatusColor";
5
- import { QueryDebugInfo } from "./QueryDebugInfo";
6
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
- /**
8
- * Modal selector that lists all known queries, highlighting status and enabling the user to focus
9
- * a specific query within the dev tools experience.
10
- */
11
- export function QuerySelector({
12
- queries,
13
- selectedQuery,
14
- isOpen,
15
- onClose,
16
- onSelect
17
- }) {
18
- const getQueryDisplayName = query => {
19
- return Array.isArray(query.queryKey) ? query.queryKey.join(" - ") : String(query.queryKey);
20
- };
21
- return /*#__PURE__*/_jsx(Modal, {
22
- accessibilityLabel: "Query selector",
23
- accessibilityHint: "View query selector",
24
- "sentry-label": "ignore query selector",
25
- visible: isOpen,
26
- transparent: true,
27
- animationType: "fade",
28
- onRequestClose: onClose,
29
- children: /*#__PURE__*/_jsx(Pressable, {
30
- accessibilityLabel: "Query selector overlay",
31
- accessibilityHint: "View query selector overlay",
32
- "sentry-label": "ignore query selector overlay",
33
- style: styles.modalOverlay,
34
- onPress: onClose,
35
- children: /*#__PURE__*/_jsxs(View, {
36
- accessibilityLabel: "Query selector content",
37
- accessibilityHint: "View query selector content",
38
- "sentry-label": "ignore query selector content",
39
- style: styles.modalContent,
40
- children: [/*#__PURE__*/_jsxs(View, {
41
- style: styles.modalHeader,
42
- children: [/*#__PURE__*/_jsx(Text, {
43
- style: styles.modalTitle,
44
- children: "Select Query"
45
- }), /*#__PURE__*/_jsxs(Text, {
46
- style: styles.modalSubtitle,
47
- children: [queries.length, " ", queries.length === 1 ? "query" : "queries", " ", "available"]
48
- })]
49
- }), /*#__PURE__*/_jsx(ScrollView, {
50
- accessibilityLabel: "Query selector scroll view",
51
- accessibilityHint: "View query selector scroll view",
52
- "sentry-label": "ignore query selector scroll view",
53
- style: styles.scrollView,
54
- contentContainerStyle: styles.scrollViewContent,
55
- showsVerticalScrollIndicator: true,
56
- children: queries.length === 0 ? /*#__PURE__*/_jsxs(View, {
57
- style: styles.emptyState,
58
- children: [/*#__PURE__*/_jsx(Text, {
59
- style: styles.emptyTitle,
60
- children: "No Queries Found"
61
- }), /*#__PURE__*/_jsxs(Text, {
62
- style: styles.emptyDescription,
63
- children: ["No React Query queries are currently active.", "\n\n", "To see queries here:", "\n", "\u2022 Make API calls using useQuery", "\n", "\u2022 Ensure queries are within QueryClientProvider", "\n", "\u2022 Check console for debugging info"]
64
- }), /*#__PURE__*/_jsx(QueryDebugInfo, {})]
65
- }) : queries.map((query, index) => {
66
- const displayName = getQueryDisplayName(query);
67
- const statusColorName = getQueryStatusColor({
68
- queryState: query.state,
69
- observerCount: query.getObserversCount(),
70
- isStale: query.isStale()
71
- });
72
-
73
- // Convert color names to hex colors
74
- const colorMap = {
75
- blue: "#3B82F6",
76
- gray: "#6B7280",
77
- purple: "#8B5CF6",
78
- yellow: "#F59E0B",
79
- green: "#10B981",
80
- red: "#EF4444"
81
- };
82
- const statusColor = colorMap[statusColorName] || "#6B7280";
83
- const isSelected = query === selectedQuery;
84
- return /*#__PURE__*/_jsxs(TouchableOpacity, {
85
- accessibilityLabel: `Query ${displayName}`,
86
- accessibilityHint: `View query ${displayName}`,
87
- "sentry-label": `ignore query ${displayName}`,
88
- style: [styles.queryItem, isSelected && styles.selectedQueryItem],
89
- onPress: () => onSelect(query),
90
- children: [/*#__PURE__*/_jsx(View, {
91
- style: [styles.statusDot, {
92
- backgroundColor: statusColor
93
- }]
94
- }), /*#__PURE__*/_jsx(Text, {
95
- style: [styles.queryText, isSelected && styles.selectedQueryText],
96
- numberOfLines: 1,
97
- children: displayName
98
- })]
99
- }, `${query.queryHash}-${index}`);
100
- })
101
- })]
102
- })
103
- })
104
- });
105
- }
106
- const styles = StyleSheet.create({
107
- modalOverlay: {
108
- flex: 1,
109
- backgroundColor: "rgba(0, 0, 0, 0.5)",
110
- justifyContent: "center",
111
- alignItems: "center"
112
- },
113
- modalContent: {
114
- backgroundColor: "#1F1F1F",
115
- borderRadius: 8,
116
- width: "80%",
117
- maxHeight: "80%",
118
- minHeight: "50%",
119
- borderWidth: 1,
120
- borderColor: "rgba(255, 255, 255, 0.1)",
121
- flex: 0
122
- },
123
- modalHeader: {
124
- padding: 16,
125
- borderBottomWidth: 1,
126
- borderBottomColor: "rgba(255, 255, 255, 0.1)"
127
- },
128
- modalTitle: {
129
- color: "#FFFFFF",
130
- fontSize: 16,
131
- fontWeight: "600",
132
- marginBottom: 4
133
- },
134
- modalSubtitle: {
135
- color: "#9CA3AF",
136
- fontSize: 12
137
- },
138
- scrollView: {
139
- flex: 1
140
- },
141
- scrollViewContent: {
142
- padding: 8,
143
- flexGrow: 1
144
- },
145
- emptyState: {
146
- padding: 32,
147
- alignItems: "center",
148
- justifyContent: "center"
149
- },
150
- emptyTitle: {
151
- color: "#E5E7EB",
152
- fontSize: 16,
153
- fontWeight: "500",
154
- marginBottom: 8,
155
- textAlign: "center"
156
- },
157
- emptyDescription: {
158
- color: "#9CA3AF",
159
- fontSize: 14,
160
- textAlign: "center",
161
- lineHeight: 20
162
- },
163
- queryItem: {
164
- flexDirection: "row",
165
- alignItems: "center",
166
- padding: 8,
167
- borderRadius: 4
168
- },
169
- selectedQueryItem: {
170
- backgroundColor: "rgba(255, 255, 255, 0.1)"
171
- },
172
- statusDot: {
173
- width: 8,
174
- height: 8,
175
- borderRadius: 4,
176
- marginRight: 8
177
- },
178
- queryText: {
179
- color: "#E5E7EB",
180
- fontSize: 14,
181
- flex: 1
182
- },
183
- selectedQueryText: {
184
- color: "#FFFFFF",
185
- fontWeight: "500"
186
- },
187
- trigger: {
188
- flexDirection: "row",
189
- alignItems: "center",
190
- backgroundColor: "rgba(255, 255, 255, 0.05)",
191
- borderRadius: 4,
192
- paddingHorizontal: 8,
193
- paddingVertical: 6,
194
- borderWidth: 1,
195
- borderColor: "rgba(255, 255, 255, 0.1)",
196
- minWidth: 120,
197
- maxWidth: 200
198
- },
199
- triggerText: {
200
- color: "#E5E7EB",
201
- fontSize: 12,
202
- flex: 1,
203
- marginHorizontal: 6
204
- }
205
- });
1
+ "use strict";import{View as s,Text as l,StyleSheet as p,TouchableOpacity as C,Modal as x,ScrollView as S,Pressable as w}from"react-native";import{getQueryStatusColor as F}from"../utils/getQueryStatusColor";import{QueryDebugInfo as Q}from"./QueryDebugInfo";import{jsx as r,jsxs as o}from"react/jsx-runtime";export function QuerySelector({queries:i,selectedQuery:y,isOpen:d,onClose:a,onSelect:u}){const g=t=>{return Array.isArray(t.queryKey)?t.queryKey.join(" - "):String(t.queryKey)};return r(x,{accessibilityLabel:"Query selector",accessibilityHint:"View query selector","sentry-label":"ignore query selector",visible:d,transparent:true,animationType:"fade",onRequestClose:a,children:r(w,{accessibilityLabel:"Query selector overlay",accessibilityHint:"View query selector overlay","sentry-label":"ignore query selector overlay",style:e.modalOverlay,onPress:a,children:o(s,{accessibilityLabel:"Query selector content",accessibilityHint:"View query selector content","sentry-label":"ignore query selector content",style:e.modalContent,children:[o(s,{style:e.modalHeader,children:[r(l,{style:e.modalTitle,children:"Select Query"}),o(l,{style:e.modalSubtitle,children:[i.length," ",i.length===1?"query":"queries"," ","available"]})]}),r(S,{accessibilityLabel:"Query selector scroll view",accessibilityHint:"View query selector scroll view","sentry-label":"ignore query selector scroll view",style:e.scrollView,contentContainerStyle:e.scrollViewContent,showsVerticalScrollIndicator:true,children:i.length===0?o(s,{style:e.emptyState,children:[r(l,{style:e.emptyTitle,children:"No Queries Found"}),o(l,{style:e.emptyDescription,children:["No React Query queries are currently active.","\n\n","To see queries here:","\n","\u2022 Make API calls using useQuery","\n","\u2022 Ensure queries are within QueryClientProvider","\n","\u2022 Check console for debugging info"]}),r(Q,{})]}):i.map((t,b)=>{const n=g(t);const m=F({queryState:t.state,observerCount:t.getObserversCount(),isStale:t.isStale()});const h={blue:"#3B82F6",gray:"#6B7280",purple:"#8B5CF6",yellow:"#F59E0B",green:"#10B981",red:"#EF4444"};const f=h[m]||"#6B7280";const c=t===y;return o(C,{accessibilityLabel:`Query ${n}`,accessibilityHint:`View query ${n}`,"sentry-label":`ignore query ${n}`,style:[e.queryItem,c&&e.selectedQueryItem],onPress:()=>u(t),children:[r(s,{style:[e.statusDot,{backgroundColor:f}]}),r(l,{style:[e.queryText,c&&e.selectedQueryText],numberOfLines:1,children:n})]},`${t.queryHash}-${b}`)})})]})})})}const e=p.create({modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center"},modalContent:{backgroundColor:"#1F1F1F",borderRadius:8,width:"80%",maxHeight:"80%",minHeight:"50%",borderWidth:1,borderColor:"rgba(255, 255, 255, 0.1)",flex:0},modalHeader:{padding:16,borderBottomWidth:1,borderBottomColor:"rgba(255, 255, 255, 0.1)"},modalTitle:{color:"#FFFFFF",fontSize:16,fontWeight:"600",marginBottom:4},modalSubtitle:{color:"#9CA3AF",fontSize:12},scrollView:{flex:1},scrollViewContent:{padding:8,flexGrow:1},emptyState:{padding:32,alignItems:"center",justifyContent:"center"},emptyTitle:{color:"#E5E7EB",fontSize:16,fontWeight:"500",marginBottom:8,textAlign:"center"},emptyDescription:{color:"#9CA3AF",fontSize:14,textAlign:"center",lineHeight:20},queryItem:{flexDirection:"row",alignItems:"center",padding:8,borderRadius:4},selectedQueryItem:{backgroundColor:"rgba(255, 255, 255, 0.1)"},statusDot:{width:8,height:8,borderRadius:4,marginRight:8},queryText:{color:"#E5E7EB",fontSize:14,flex:1},selectedQueryText:{color:"#FFFFFF",fontWeight:"500"},trigger:{flexDirection:"row",alignItems:"center",backgroundColor:"rgba(255, 255, 255, 0.05)",borderRadius:4,paddingHorizontal:8,paddingVertical:6,borderWidth:1,borderColor:"rgba(255, 255, 255, 0.1)",minWidth:120,maxWidth:200},triggerText:{color:"#E5E7EB",fontSize:12,flex:1,marginHorizontal:6}});
@@ -1,87 +1 @@
1
- "use strict";
2
-
3
- import { useCallback, useState, useEffect } from "react";
4
- import { useQueryClient } from "@tanstack/react-query";
5
- import { TickProvider } from "@buoy-gg/shared-ui";
6
- import { ReactQueryModal } from "./modals/ReactQueryModal";
7
- import { reactQueryEventStore } from "../stores/reactQueryEventStore";
8
-
9
- /** Configuration options for the high-level React Query dev tools modal wrapper. */
10
- import { jsx as _jsx } from "react/jsx-runtime";
11
- /**
12
- * Opinionated wrapper around `ReactQueryModal` that manages selection state and filters so
13
- * consumers can drop in the full dev tools experience with a single component.
14
- */
15
- export function ReactQueryDevToolsModal({
16
- visible,
17
- onClose,
18
- onMinimize,
19
- enableSharedModalDimensions = true
20
- }) {
21
- // Get QueryClient and connect to event store for unified Events DevTools
22
- const queryClient = useQueryClient();
23
- useEffect(() => {
24
- // Connect the QueryClient to the event store so events flow to unified Events DevTools
25
- // Only connect if not already connected (to preserve connection across modal open/close)
26
- if (!reactQueryEventStore.isConnected()) {
27
- reactQueryEventStore.setQueryClient(queryClient);
28
- }
29
- // Don't disconnect on unmount - keep the connection for unified Events DevTools
30
- }, [queryClient]);
31
- const [selectedQueryKey, setSelectedQueryKey] = useState(undefined);
32
- const [selectedMutationId, setSelectedMutationId] = useState(undefined);
33
- const [activeFilter, setActiveFilter] = useState(null);
34
- const [activeTab, setActiveTab] = useState("queries");
35
- const [searchText, setSearchText] = useState("");
36
- const resetState = useCallback(() => {
37
- setSelectedQueryKey(undefined);
38
- setSelectedMutationId(undefined);
39
- setActiveFilter(null);
40
- setActiveTab("queries");
41
- setSearchText("");
42
- }, []);
43
- const handleClose = useCallback(() => {
44
- resetState();
45
- onClose();
46
- }, [onClose, resetState]);
47
- const handleQuerySelect = useCallback(query => {
48
- setSelectedQueryKey(query?.queryKey);
49
- }, []);
50
- const handleMutationSelect = useCallback(mutation => {
51
- setSelectedMutationId(mutation?.mutationId);
52
- }, []);
53
- const handleFilterChange = useCallback(filter => {
54
- setActiveFilter(filter);
55
- }, []);
56
- const handleTabChange = useCallback(tab => {
57
- setActiveTab(tab);
58
- setActiveFilter(null);
59
- setSelectedQueryKey(undefined);
60
- setSelectedMutationId(undefined);
61
- setSearchText("");
62
- }, []);
63
- const handleSearchChange = useCallback(text => {
64
- setSearchText(text);
65
- }, []);
66
- if (!visible) {
67
- return null;
68
- }
69
- return /*#__PURE__*/_jsx(TickProvider, {
70
- children: /*#__PURE__*/_jsx(ReactQueryModal, {
71
- visible: visible,
72
- selectedQueryKey: selectedQueryKey,
73
- selectedMutationId: selectedMutationId,
74
- onQuerySelect: handleQuerySelect,
75
- onMutationSelect: handleMutationSelect,
76
- onClose: handleClose,
77
- onMinimize: onMinimize,
78
- activeFilter: activeFilter,
79
- onFilterChange: handleFilterChange,
80
- activeTab: activeTab,
81
- onTabChange: handleTabChange,
82
- searchText: searchText,
83
- onSearchChange: handleSearchChange,
84
- enableSharedModalDimensions: enableSharedModalDimensions
85
- })
86
- });
87
- }
1
+ "use strict";import{useCallback as t,useState as n,useEffect as q}from"react";import{useQueryClient as I}from"@tanstack/react-query";import{TickProvider as K}from"@buoy-gg/shared-ui";import{ReactQueryModal as j}from"./modals/ReactQueryModal";import{reactQueryEventStore as h}from"../stores/reactQueryEventStore";import{jsx as f}from"react/jsx-runtime";export function ReactQueryDevToolsModal({visible:c,onClose:s,onMinimize:y,enableSharedModalDimensions:m=true}){const l=I();q(()=>{if(!h.isConnected()){h.setQueryClient(l)}},[l]);const[S,r]=n(void 0);const[C,o]=n(void 0);const[Q,i]=n(null);const[T,u]=n("queries");const[v,a]=n("");const d=t(()=>{r(void 0);o(void 0);i(null);u("queries");a("")},[]);const M=t(()=>{d();s()},[s,d]);const b=t(e=>{r(e?.queryKey)},[]);const p=t(e=>{o(e?.mutationId)},[]);const g=t(e=>{i(e)},[]);const x=t(e=>{u(e);i(null);r(void 0);o(void 0);a("")},[]);const F=t(e=>{a(e)},[]);if(!c){return null}return f(K,{children:f(j,{visible:c,selectedQueryKey:S,selectedMutationId:C,onQuerySelect:b,onMutationSelect:p,onClose:M,onMinimize:y,activeFilter:Q,onFilterChange:g,activeTab:T,onTabChange:x,searchText:v,onSearchChange:F,enableSharedModalDimensions:m})})}
@@ -1,43 +1 @@
1
- "use strict";
2
-
3
- import { View } from "react-native";
4
- import { CyberpunkSectionButton, buoyColors } from "@buoy-gg/shared-ui";
5
- import { TanstackLogo } from "./query-browser/svgs";
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
- // Component definition moved outside render to prevent recreation on every render
8
- const TanstackIcon = () => /*#__PURE__*/_jsx(View, {
9
- style: {
10
- width: 24,
11
- height: 24
12
- },
13
- children: /*#__PURE__*/_jsx(TanstackLogo, {})
14
- });
15
-
16
- /**
17
- * React Query section component following composition principles.
18
- * Encapsulates React Query specific business logic and UI.
19
- */
20
- export function ReactQuerySection({
21
- onPress,
22
- getReactBuoySubtitle
23
- }) {
24
- // Format subtitle to be shorter: "45 queries • 10 mutations" → "45Q • 10M"
25
- const formatSubtitle = () => {
26
- const full = getReactBuoySubtitle();
27
- const match = full.match(/(\d+) queries • (\d+) mutations/);
28
- if (match) {
29
- return `${match[1]}Q • ${match[2]}M`;
30
- }
31
- return "No data";
32
- };
33
- return /*#__PURE__*/_jsx(CyberpunkSectionButton, {
34
- id: "react-buoy-dev-tools",
35
- title: "QUERY",
36
- subtitle: formatSubtitle(),
37
- icon: TanstackIcon,
38
- iconColor: buoyColors.error,
39
- iconBackgroundColor: buoyColors.error + "1A",
40
- onPress: onPress,
41
- index: 1
42
- });
43
- }
1
+ "use strict";import{View as s}from"react-native";import{CyberpunkSectionButton as u,buoyColors as r}from"@buoy-gg/shared-ui";import{TanstackLogo as a}from"./query-browser/svgs";import{jsx as t}from"react/jsx-runtime";const m=()=>t(s,{style:{width:24,height:24},children:t(a,{})});export function ReactQuerySection({onPress:e,getReactBuoySubtitle:n}){const i=()=>{const c=n();const o=c.match(/(\d+) queries • (\d+) mutations/);if(o){return`${o[1]}Q \u2022 ${o[2]}M`}return"No data"};return t(u,{id:"react-buoy-dev-tools",title:"QUERY",subtitle:i(),icon:m,iconColor:r.error,iconBackgroundColor:r.error+"1A",onPress:e,index:1})}
@@ -1,35 +1 @@
1
- "use strict";
2
-
3
- import { useContext, useEffect } from "react";
4
- import { QueryClientContext } from "@tanstack/react-query";
5
- import { reactQueryEventStore } from "../stores/reactQueryEventStore";
6
-
7
- /**
8
- * Connects the React Query event store to the app's QueryClient at startup.
9
- *
10
- * Auto-rendered by `FloatingDevTools` (the same treatment `RouteTracker` gets),
11
- * so nobody has to mount it by hand.
12
- *
13
- * Why it has to exist: until this, `setQueryClient` was called from exactly one
14
- * place — `ReactQueryDevToolsModal`'s mount effect — which meant the store had
15
- * no client unless somebody opened the React Query TOOL. Anything else that
16
- * consumes these events was therefore silently empty, and the Events timeline
17
- * showed a React Query badge with a confident `0` on it: not "nothing to
18
- * report" but "nobody was listening", and no way to tell the two apart.
19
- *
20
- * `useContext(QueryClientContext)`, NOT `useQueryClient()`: the hook throws
21
- * when there is no provider above it, and this component is mounted whether or
22
- * not the host app uses React Query at all. An app without a provider just
23
- * reads `undefined` here and nothing connects, which is the old behaviour.
24
- */
25
- export function ReactQueryTracker() {
26
- const queryClient = useContext(QueryClientContext);
27
- useEffect(() => {
28
- if (!queryClient) return;
29
- // The tool connects the same client when it opens; leave that alone rather
30
- // than tearing down its cache subscriptions and rebuilding them.
31
- if (reactQueryEventStore.isConnected()) return;
32
- reactQueryEventStore.setQueryClient(queryClient);
33
- }, [queryClient]);
34
- return null;
35
- }
1
+ "use strict";import{useContext as r,useEffect as n}from"react";import{QueryClientContext as o}from"@tanstack/react-query";import{reactQueryEventStore as t}from"../stores/reactQueryEventStore";export function ReactQueryTracker(){const e=r(o);n(()=>{if(!e)return;if(t.isConnected())return;t.setQueryClient(e)},[e]);return null}
@@ -1,48 +1 @@
1
- "use strict";
2
-
3
- import { TouchableOpacity } from "react-native";
4
- import { Wifi } from "@buoy-gg/shared-ui";
5
- import { useWifiState } from "../hooks/useWifiState";
6
-
7
- /**
8
- * Small icon button that toggles React Query’s online manager, allowing developers to simulate
9
- * offline scenarios directly from the modal header.
10
- */
11
- import { jsx as _jsx } from "react/jsx-runtime";
12
- export function WifiToggle({
13
- size = 16,
14
- testID
15
- }) {
16
- const {
17
- isOnline,
18
- handleWifiToggle
19
- } = useWifiState();
20
- return /*#__PURE__*/_jsx(TouchableOpacity, {
21
- "sentry-label": `ignore toggle WiFi ${isOnline ? "On" : "Off"}`,
22
- testID: testID,
23
- accessibilityRole: "button",
24
- accessibilityLabel: `WiFi ${isOnline ? "On" : "Off"}`,
25
- accessibilityHint: `Tap to turn WiFi ${isOnline ? "off" : "on"} for React Query`,
26
- onPress: handleWifiToggle,
27
- hitSlop: {
28
- top: 10,
29
- bottom: 10,
30
- left: 10,
31
- right: 10
32
- },
33
- activeOpacity: 0.7,
34
- style: {
35
- alignItems: "center",
36
- justifyContent: "center",
37
- width: 14,
38
- flexShrink: 0
39
- },
40
- children: isOnline ? /*#__PURE__*/_jsx(Wifi, {
41
- size: size,
42
- color: "#10B981"
43
- }) : /*#__PURE__*/_jsx(Wifi, {
44
- size: size,
45
- color: "#DC2626"
46
- })
47
- });
48
- }
1
+ "use strict";import{TouchableOpacity as s}from"react-native";import{Wifi as o}from"@buoy-gg/shared-ui";import{useWifiState as l}from"../hooks/useWifiState";import{jsx as t}from"react/jsx-runtime";export function WifiToggle({size:e=16,testID:r}){const{isOnline:i,handleWifiToggle:n}=l();return t(s,{"sentry-label":`ignore toggle WiFi ${i?"On":"Off"}`,testID:r,accessibilityRole:"button",accessibilityLabel:`WiFi ${i?"On":"Off"}`,accessibilityHint:`Tap to turn WiFi ${i?"off":"on"} for React Query`,onPress:n,hitSlop:{top:10,bottom:10,left:10,right:10},activeOpacity:.7,style:{alignItems:"center",justifyContent:"center",width:14,flexShrink:0},children:i?t(o,{size:e,color:"#10B981"}):t(o,{size:e,color:"#DC2626"})})}