@buoy-gg/react-query 7.0.40 → 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 (244) hide show
  1. package/README.md +11 -69
  2. package/lib/commonjs/checkPeer.js +1 -0
  3. package/lib/commonjs/checkPeer.web.js +1 -0
  4. package/lib/commonjs/index.js +1 -736
  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 -0
  83. package/lib/module/checkPeer.web.js +1 -0
  84. package/lib/module/index.js +1 -135
  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/typescript/checkPeer.d.ts +1 -0
  163. package/lib/typescript/checkPeer.web.d.ts +2 -0
  164. package/lib/typescript/index.d.ts +1 -0
  165. package/lib/web/index.mjs +11 -0
  166. package/package.json +36 -12
  167. package/lib/typescript/index.d.ts.map +0 -1
  168. package/lib/typescript/preset.d.ts.map +0 -1
  169. package/lib/typescript/react-query/components/DataEditorMode.d.ts.map +0 -1
  170. package/lib/typescript/react-query/components/FilterStatusBadge.d.ts.map +0 -1
  171. package/lib/typescript/react-query/components/MutationBrowserMode.d.ts.map +0 -1
  172. package/lib/typescript/react-query/components/MutationEditorMode.d.ts.map +0 -1
  173. package/lib/typescript/react-query/components/QueryBrowserMode.d.ts.map +0 -1
  174. package/lib/typescript/react-query/components/QueryDebugInfo.d.ts.map +0 -1
  175. package/lib/typescript/react-query/components/QueryFilterViewV3.d.ts.map +0 -1
  176. package/lib/typescript/react-query/components/QuerySelector.d.ts.map +0 -1
  177. package/lib/typescript/react-query/components/ReactQueryDevToolsModal.d.ts.map +0 -1
  178. package/lib/typescript/react-query/components/ReactQuerySection.d.ts.map +0 -1
  179. package/lib/typescript/react-query/components/ReactQueryTracker.d.ts.map +0 -1
  180. package/lib/typescript/react-query/components/WifiToggle.d.ts.map +0 -1
  181. package/lib/typescript/react-query/components/modals/DataEditorModal.d.ts.map +0 -1
  182. package/lib/typescript/react-query/components/modals/MutationBrowserFooter.d.ts.map +0 -1
  183. package/lib/typescript/react-query/components/modals/MutationBrowserModal.d.ts.map +0 -1
  184. package/lib/typescript/react-query/components/modals/MutationEditorModal.d.ts.map +0 -1
  185. package/lib/typescript/react-query/components/modals/QueryBrowserFooter.d.ts.map +0 -1
  186. package/lib/typescript/react-query/components/modals/QueryBrowserModal.d.ts.map +0 -1
  187. package/lib/typescript/react-query/components/modals/ReactQueryModal.d.ts.map +0 -1
  188. package/lib/typescript/react-query/components/modals/ReactQueryModalHeader.d.ts.map +0 -1
  189. package/lib/typescript/react-query/components/modals/SwipeIndicator.d.ts.map +0 -1
  190. package/lib/typescript/react-query/components/query-browser/ActionButton.d.ts.map +0 -1
  191. package/lib/typescript/react-query/components/query-browser/ClearCacheButton.d.ts.map +0 -1
  192. package/lib/typescript/react-query/components/query-browser/Explorer.d.ts.map +0 -1
  193. package/lib/typescript/react-query/components/query-browser/MutationButton.d.ts.map +0 -1
  194. package/lib/typescript/react-query/components/query-browser/MutationDetails.d.ts.map +0 -1
  195. package/lib/typescript/react-query/components/query-browser/MutationDetailsChips.d.ts.map +0 -1
  196. package/lib/typescript/react-query/components/query-browser/MutationInformation.d.ts.map +0 -1
  197. package/lib/typescript/react-query/components/query-browser/MutationStatusCount.d.ts.map +0 -1
  198. package/lib/typescript/react-query/components/query-browser/MutationsList.d.ts.map +0 -1
  199. package/lib/typescript/react-query/components/query-browser/NetworkToggleButton.d.ts.map +0 -1
  200. package/lib/typescript/react-query/components/query-browser/QueryActions.d.ts.map +0 -1
  201. package/lib/typescript/react-query/components/query-browser/QueryBrowser.d.ts.map +0 -1
  202. package/lib/typescript/react-query/components/query-browser/QueryDetails.d.ts.map +0 -1
  203. package/lib/typescript/react-query/components/query-browser/QueryDetailsChip.d.ts.map +0 -1
  204. package/lib/typescript/react-query/components/query-browser/QueryInformation.d.ts.map +0 -1
  205. package/lib/typescript/react-query/components/query-browser/QueryRow.d.ts.map +0 -1
  206. package/lib/typescript/react-query/components/query-browser/QueryStatus.d.ts.map +0 -1
  207. package/lib/typescript/react-query/components/query-browser/QueryStatusCount.d.ts.map +0 -1
  208. package/lib/typescript/react-query/components/query-browser/StorageStatusCount.d.ts.map +0 -1
  209. package/lib/typescript/react-query/components/query-browser/index.d.ts.map +0 -1
  210. package/lib/typescript/react-query/components/query-browser/svgs.d.ts.map +0 -1
  211. package/lib/typescript/react-query/hooks/useActionButtons.d.ts.map +0 -1
  212. package/lib/typescript/react-query/hooks/useAllMutations.d.ts.map +0 -1
  213. package/lib/typescript/react-query/hooks/useAllQueries.d.ts.map +0 -1
  214. package/lib/typescript/react-query/hooks/useModalManager.d.ts.map +0 -1
  215. package/lib/typescript/react-query/hooks/useModalPersistence.d.ts.map +0 -1
  216. package/lib/typescript/react-query/hooks/useMutationActionButtons.d.ts.map +0 -1
  217. package/lib/typescript/react-query/hooks/useQueryStatusCounts.d.ts.map +0 -1
  218. package/lib/typescript/react-query/hooks/useReactQueryState.d.ts.map +0 -1
  219. package/lib/typescript/react-query/hooks/useSelectedMutation.d.ts.map +0 -1
  220. package/lib/typescript/react-query/hooks/useSelectedQuery.d.ts.map +0 -1
  221. package/lib/typescript/react-query/hooks/useStorageQueryCounts.d.ts.map +0 -1
  222. package/lib/typescript/react-query/hooks/useWifiState.d.ts.map +0 -1
  223. package/lib/typescript/react-query/stores/reactQueryEventStore.d.ts.map +0 -1
  224. package/lib/typescript/react-query/sync/dehydrate.d.ts.map +0 -1
  225. package/lib/typescript/react-query/sync/reactQuerySyncAdapter.d.ts.map +0 -1
  226. package/lib/typescript/react-query/sync/snapshotProvider.d.ts.map +0 -1
  227. package/lib/typescript/react-query/sync/useReactQuerySyncAdapter.d.ts.map +0 -1
  228. package/lib/typescript/react-query/types/types.d.ts.map +0 -1
  229. package/lib/typescript/react-query/utils/actions/deleteItem.d.ts.map +0 -1
  230. package/lib/typescript/react-query/utils/actions/emitDevToolsEvent.d.ts.map +0 -1
  231. package/lib/typescript/react-query/utils/actions/invalidate.d.ts.map +0 -1
  232. package/lib/typescript/react-query/utils/actions/refetch.d.ts.map +0 -1
  233. package/lib/typescript/react-query/utils/actions/remove.d.ts.map +0 -1
  234. package/lib/typescript/react-query/utils/actions/reset.d.ts.map +0 -1
  235. package/lib/typescript/react-query/utils/actions/triggerError.d.ts.map +0 -1
  236. package/lib/typescript/react-query/utils/actions/triggerLoading.d.ts.map +0 -1
  237. package/lib/typescript/react-query/utils/deleteNestedDataByPath.d.ts.map +0 -1
  238. package/lib/typescript/react-query/utils/getQueryStatusColor.d.ts.map +0 -1
  239. package/lib/typescript/react-query/utils/getQueryStatusLabel.d.ts.map +0 -1
  240. package/lib/typescript/react-query/utils/getStorageQueryCounts.d.ts.map +0 -1
  241. package/lib/typescript/react-query/utils/modalStorageOperations.d.ts.map +0 -1
  242. package/lib/typescript/react-query/utils/storageQueryUtils.d.ts.map +0 -1
  243. package/lib/typescript/react-query/utils/testIDs.d.ts.map +0 -1
  244. package/lib/typescript/react-query/utils/updateNestedDataByPath.d.ts.map +0 -1
@@ -1,201 +1 @@
1
- "use strict";
2
-
3
- import { View, StyleSheet, Animated } from "react-native";
4
- import { absoluteFill } from "@buoy-gg/shared-ui";
5
- import { useMemo } from "react";
6
- import { ChevronLeft, ChevronRight, night } from "@buoy-gg/shared-ui";
7
-
8
- /**
9
- * Morphing swipe indicator – thin line ➜ pill ➜ circle with a pop-out cue at
10
- * full commit. Visual-only; gesture logic lives upstream.
11
- */
12
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- /* -------------------------------------------------------------------------- */
14
- // VISUAL CONSTANTS – tuned for typical back-gesture UX
15
- /* -------------------------------------------------------------------------- */
16
- const INDICATOR_HEIGHT = 32; // ⬆️ bigger circle (line height)
17
- const MIN_WIDTH = 6; // hairline start
18
- const MAX_WIDTH = INDICATOR_HEIGHT; // circle when width == height
19
- const DEFAULT_MAX_TRANSLATION = 120;
20
- const POP_OUT_START = 0.95; // progress at which pop-out begins
21
- const POP_OUT_SCALE = 1.15; // final scale factor when fully committed
22
-
23
- export function SwipeIndicator({
24
- translationX,
25
- maxTranslation = DEFAULT_MAX_TRANSLATION,
26
- canSwipeLeft = true,
27
- canSwipeRight = true
28
- }) {
29
- /* ---------------- LEFT EDGE (Back) ---------------- */
30
- const leftProgress = useMemo(() => {
31
- return translationX.interpolate({
32
- inputRange: [0, maxTranslation],
33
- outputRange: [0, 1],
34
- extrapolate: "clamp"
35
- });
36
- }, [translationX, maxTranslation]);
37
- const leftIndicatorWidth = useMemo(() => {
38
- return leftProgress.interpolate({
39
- inputRange: [0, 1],
40
- outputRange: [MIN_WIDTH, MAX_WIDTH]
41
- });
42
- }, [leftProgress]);
43
- const leftIndicatorScale = useMemo(() => {
44
- return leftProgress.interpolate({
45
- inputRange: [0, POP_OUT_START, 1],
46
- outputRange: [1, 1, POP_OUT_SCALE]
47
- });
48
- }, [leftProgress]);
49
- const leftIndicatorTranslateX = useMemo(() => {
50
- return leftProgress.interpolate({
51
- inputRange: [0, 0.99, 1],
52
- outputRange: [0, 0, 16]
53
- });
54
- }, [leftProgress]);
55
- const leftIndicatorOpacity = useMemo(() => {
56
- return leftProgress.interpolate({
57
- inputRange: [0, 0.01],
58
- outputRange: [0, 1],
59
- extrapolate: "clamp"
60
- });
61
- }, [leftProgress]);
62
- const leftArrowOpacity = useMemo(() => {
63
- return leftProgress.interpolate({
64
- inputRange: [0, 0.5, 1],
65
- outputRange: [0, 0, 1],
66
- extrapolate: "clamp"
67
- });
68
- }, [leftProgress]);
69
- const leftArrowScale = useMemo(() => {
70
- return leftProgress.interpolate({
71
- inputRange: [0, 0.5, POP_OUT_START, 1],
72
- outputRange: [0.8, 0.8, 1, 1.2]
73
- });
74
- }, [leftProgress]);
75
-
76
- /* ---------------- RIGHT EDGE ---------------- */
77
- const rightProgress = useMemo(() => {
78
- return translationX.interpolate({
79
- inputRange: [-maxTranslation, 0],
80
- outputRange: [1, 0],
81
- extrapolate: "clamp"
82
- });
83
- }, [translationX, maxTranslation]);
84
- const rightIndicatorWidth = useMemo(() => {
85
- return rightProgress.interpolate({
86
- inputRange: [0, 1],
87
- outputRange: [MIN_WIDTH, MAX_WIDTH]
88
- });
89
- }, [rightProgress]);
90
- const rightIndicatorScale = useMemo(() => {
91
- return rightProgress.interpolate({
92
- inputRange: [0, POP_OUT_START, 1],
93
- outputRange: [1, 1, POP_OUT_SCALE]
94
- });
95
- }, [rightProgress]);
96
- const rightIndicatorTranslateX = useMemo(() => {
97
- return rightProgress.interpolate({
98
- inputRange: [0, 0.99, 1],
99
- outputRange: [0, 0, -16]
100
- });
101
- }, [rightProgress]);
102
- const rightIndicatorOpacity = useMemo(() => {
103
- return rightProgress.interpolate({
104
- inputRange: [0, 0.01],
105
- outputRange: [0, 1],
106
- extrapolate: "clamp"
107
- });
108
- }, [rightProgress]);
109
- const rightArrowOpacity = useMemo(() => {
110
- return rightProgress.interpolate({
111
- inputRange: [0, 0.5, 1],
112
- outputRange: [0, 0, 1],
113
- extrapolate: "clamp"
114
- });
115
- }, [rightProgress]);
116
- const rightArrowScale = useMemo(() => {
117
- return rightProgress.interpolate({
118
- inputRange: [0, 0.5, POP_OUT_START, 1],
119
- outputRange: [0.8, 0.8, 1, 1.2]
120
- });
121
- }, [rightProgress]);
122
-
123
- /* ---------------- Render ---------------- */
124
- return /*#__PURE__*/_jsxs(View, {
125
- style: styles.container,
126
- pointerEvents: "none",
127
- children: [canSwipeRight && /*#__PURE__*/_jsx(Animated.View, {
128
- style: [styles.leftWrapper, {
129
- width: leftIndicatorWidth,
130
- height: INDICATOR_HEIGHT,
131
- borderRadius: INDICATOR_HEIGHT / 2,
132
- backgroundColor: night.color.text + "E6",
133
- justifyContent: "center",
134
- alignItems: "center",
135
- opacity: leftIndicatorOpacity,
136
- transform: [{
137
- scale: leftIndicatorScale
138
- }, {
139
- translateX: leftIndicatorTranslateX
140
- }]
141
- }],
142
- children: /*#__PURE__*/_jsx(Animated.View, {
143
- style: {
144
- opacity: leftArrowOpacity,
145
- transform: [{
146
- scale: leftArrowScale
147
- }]
148
- },
149
- children: /*#__PURE__*/_jsx(ChevronLeft, {
150
- size: INDICATOR_HEIGHT * 0.6,
151
- color: night.color.accent,
152
- strokeWidth: 3
153
- })
154
- })
155
- }), canSwipeLeft && /*#__PURE__*/_jsx(Animated.View, {
156
- style: [styles.rightWrapper, {
157
- width: rightIndicatorWidth,
158
- height: INDICATOR_HEIGHT,
159
- borderRadius: INDICATOR_HEIGHT / 2,
160
- backgroundColor: night.color.text + "E6",
161
- justifyContent: "center",
162
- alignItems: "center",
163
- opacity: rightIndicatorOpacity,
164
- transform: [{
165
- scale: rightIndicatorScale
166
- }, {
167
- translateX: rightIndicatorTranslateX
168
- }]
169
- }],
170
- children: /*#__PURE__*/_jsx(Animated.View, {
171
- style: {
172
- opacity: rightArrowOpacity,
173
- transform: [{
174
- scale: rightArrowScale
175
- }]
176
- },
177
- children: /*#__PURE__*/_jsx(ChevronRight, {
178
- size: INDICATOR_HEIGHT * 0.6,
179
- color: night.color.accent,
180
- strokeWidth: 3
181
- })
182
- })
183
- })]
184
- });
185
- }
186
- const styles = StyleSheet.create({
187
- container: {
188
- ...absoluteFill,
189
- zIndex: 1000,
190
- justifyContent: "center",
191
- alignItems: "center"
192
- },
193
- leftWrapper: {
194
- position: "absolute",
195
- left: 16
196
- },
197
- rightWrapper: {
198
- position: "absolute",
199
- right: 16
200
- }
201
- });
1
+ "use strict";import{View as C,StyleSheet as b,Animated as c}from"react-native";import{absoluteFill as j}from"@buoy-gg/shared-ui";import{useMemo as t}from"react";import{ChevronLeft as E,ChevronRight as P,night as p}from"@buoy-gg/shared-ui";import{jsx as o,jsxs as V}from"react/jsx-runtime";const n=32;const s=6;const g=n;const k=120;const u=.95;const R=1.15;export function SwipeIndicator({translationX:a,maxTranslation:i=k,canSwipeLeft:h=true,canSwipeRight:d=true}){const e=t(()=>{return a.interpolate({inputRange:[0,i],outputRange:[0,1],extrapolate:"clamp"})},[a,i]);const f=t(()=>{return e.interpolate({inputRange:[0,1],outputRange:[s,g]})},[e]);const m=t(()=>{return e.interpolate({inputRange:[0,u,1],outputRange:[1,1,R]})},[e]);const I=t(()=>{return e.interpolate({inputRange:[0,.99,1],outputRange:[0,0,16]})},[e]);const y=t(()=>{return e.interpolate({inputRange:[0,.01],outputRange:[0,1],extrapolate:"clamp"})},[e]);const A=t(()=>{return e.interpolate({inputRange:[0,.5,1],outputRange:[0,0,1],extrapolate:"clamp"})},[e]);const w=t(()=>{return e.interpolate({inputRange:[0,.5,u,1],outputRange:[.8,.8,1,1.2]})},[e]);const r=t(()=>{return a.interpolate({inputRange:[-i,0],outputRange:[1,0],extrapolate:"clamp"})},[a,i]);const x=t(()=>{return r.interpolate({inputRange:[0,1],outputRange:[s,g]})},[r]);const _=t(()=>{return r.interpolate({inputRange:[0,u,1],outputRange:[1,1,R]})},[r]);const O=t(()=>{return r.interpolate({inputRange:[0,.99,1],outputRange:[0,0,-16]})},[r]);const S=t(()=>{return r.interpolate({inputRange:[0,.01],outputRange:[0,1],extrapolate:"clamp"})},[r]);const T=t(()=>{return r.interpolate({inputRange:[0,.5,1],outputRange:[0,0,1],extrapolate:"clamp"})},[r]);const W=t(()=>{return r.interpolate({inputRange:[0,.5,u,1],outputRange:[.8,.8,1,1.2]})},[r]);return V(C,{style:l.container,pointerEvents:"none",children:[d&&o(c.View,{style:[l.leftWrapper,{width:f,height:n,borderRadius:n/2,backgroundColor:p.color.text+"E6",justifyContent:"center",alignItems:"center",opacity:y,transform:[{scale:m},{translateX:I}]}],children:o(c.View,{style:{opacity:A,transform:[{scale:w}]},children:o(E,{size:n*.6,color:p.color.accent,strokeWidth:3})})}),h&&o(c.View,{style:[l.rightWrapper,{width:x,height:n,borderRadius:n/2,backgroundColor:p.color.text+"E6",justifyContent:"center",alignItems:"center",opacity:S,transform:[{scale:_},{translateX:O}]}],children:o(c.View,{style:{opacity:T,transform:[{scale:W}]},children:o(P,{size:n*.6,color:p.color.accent,strokeWidth:3})})})]})}const l=b.create({container:{...j,zIndex:1e3,justifyContent:"center",alignItems:"center"},leftWrapper:{position:"absolute",left:16},rightWrapper:{position:"absolute",right:16}});
@@ -1,96 +1 @@
1
- "use strict";
2
-
3
- import { TouchableOpacity, Text, View, StyleSheet } from "react-native";
4
- import { night } from "@buoy-gg/shared-ui";
5
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
- // Clean, minimal color config matching React Query DevTools style
7
- const buttonConfigs = {
8
- refetch: {
9
- dotColor: night.color.accent,
10
- textColor: night.color.text,
11
- borderColor: night.color.border
12
- },
13
- invalidate: {
14
- dotColor: night.color.warning,
15
- textColor: night.color.text,
16
- borderColor: night.color.border
17
- },
18
- reset: {
19
- dotColor: night.color.textSecondary,
20
- textColor: night.color.text,
21
- borderColor: night.color.border
22
- },
23
- remove: {
24
- dotColor: night.color.danger,
25
- textColor: night.color.danger,
26
- borderColor: night.color.danger + "40"
27
- },
28
- triggerLoading: {
29
- dotColor: night.color.info,
30
- textColor: night.color.info,
31
- borderColor: night.color.info + "40"
32
- },
33
- triggerError: {
34
- dotColor: night.color.danger,
35
- textColor: night.color.danger,
36
- borderColor: night.color.danger + "40"
37
- }
38
- };
39
- /** Clean, minimal action button matching React Query DevTools style. */
40
- export default function ActionButton({
41
- onClick,
42
- text,
43
- variant,
44
- disabled,
45
- testID
46
- }) {
47
- const config = buttonConfigs[variant];
48
- return /*#__PURE__*/_jsxs(TouchableOpacity, {
49
- "sentry-label": "ignore devtools action button",
50
- testID: testID,
51
- disabled: disabled,
52
- onPress: onClick,
53
- style: [styles.button, {
54
- borderColor: disabled ? night.color.border : config.borderColor,
55
- opacity: disabled ? 0.4 : 1
56
- }],
57
- activeOpacity: 0.7,
58
- accessibilityRole: "button",
59
- accessibilityLabel: text,
60
- accessibilityState: {
61
- disabled
62
- },
63
- children: [/*#__PURE__*/_jsx(View, {
64
- style: [styles.dot, {
65
- backgroundColor: disabled ? night.color.textTertiary : config.dotColor
66
- }]
67
- }), /*#__PURE__*/_jsx(Text, {
68
- style: [styles.text, {
69
- color: disabled ? night.color.textTertiary : config.textColor
70
- }],
71
- children: text
72
- })]
73
- });
74
- }
75
- const styles = StyleSheet.create({
76
- button: {
77
- flexDirection: "row",
78
- alignItems: "center",
79
- justifyContent: "center",
80
- borderRadius: 4,
81
- borderWidth: 1,
82
- paddingHorizontal: 8,
83
- paddingVertical: 4,
84
- backgroundColor: "transparent"
85
- },
86
- dot: {
87
- width: 6,
88
- height: 6,
89
- borderRadius: 3,
90
- marginRight: 6
91
- },
92
- text: {
93
- fontSize: 12,
94
- fontWeight: "500"
95
- }
96
- });
1
+ "use strict";import{TouchableOpacity as a,Text as s,View as C,StyleSheet as g}from"react-native";import{night as o}from"@buoy-gg/shared-ui";import{jsx as c,jsxs as b}from"react/jsx-runtime";const x={refetch:{dotColor:o.color.accent,textColor:o.color.text,borderColor:o.color.border},invalidate:{dotColor:o.color.warning,textColor:o.color.text,borderColor:o.color.border},reset:{dotColor:o.color.textSecondary,textColor:o.color.text,borderColor:o.color.border},remove:{dotColor:o.color.danger,textColor:o.color.danger,borderColor:o.color.danger+"40"},triggerLoading:{dotColor:o.color.info,textColor:o.color.info,borderColor:o.color.info+"40"},triggerError:{dotColor:o.color.danger,textColor:o.color.danger,borderColor:o.color.danger+"40"}};export default function u({onClick:n,text:l,variant:i,disabled:r,testID:d}){const t=x[i];return b(a,{"sentry-label":"ignore devtools action button",testID:d,disabled:r,onPress:n,style:[e.button,{borderColor:r?o.color.border:t.borderColor,opacity:r?.4:1}],activeOpacity:.7,accessibilityRole:"button",accessibilityLabel:l,accessibilityState:{disabled:r},children:[c(C,{style:[e.dot,{backgroundColor:r?o.color.textTertiary:t.dotColor}]}),c(s,{style:[e.text,{color:r?o.color.textTertiary:t.textColor}],children:l})]})}const e=g.create({button:{flexDirection:"row",alignItems:"center",justifyContent:"center",borderRadius:4,borderWidth:1,paddingHorizontal:8,paddingVertical:4,backgroundColor:"transparent"},dot:{width:6,height:6,borderRadius:3,marginRight:6},text:{fontSize:12,fontWeight:"500"}});
@@ -1,49 +1 @@
1
- "use strict";
2
-
3
- import { TouchableOpacity, StyleSheet } from "react-native";
4
- import { Trash, night } from "@buoy-gg/shared-ui";
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
- /**
7
- * Icon-only button for clearing either the query or mutation cache from the dev tools UI.
8
- */
9
- const ClearCacheButton = ({
10
- type,
11
- onClear,
12
- disabled = false
13
- }) => {
14
- return /*#__PURE__*/_jsx(TouchableOpacity, {
15
- "sentry-label": "ignore devtools clear cache button",
16
- style: [styles.button, disabled && styles.disabledButton],
17
- onPress: onClear,
18
- disabled: disabled,
19
- activeOpacity: 0.7,
20
- accessibilityLabel: `Clear ${type} cache`,
21
- accessibilityRole: "button",
22
- accessibilityState: {
23
- disabled
24
- },
25
- children: /*#__PURE__*/_jsx(Trash, {
26
- size: 16,
27
- strokeWidth: 2,
28
- color: disabled ? night.color.textTertiary : night.color.warning
29
- })
30
- });
31
- };
32
- const styles = StyleSheet.create({
33
- button: {
34
- width: 32,
35
- height: 32,
36
- borderRadius: 6,
37
- backgroundColor: night.color.warningSoft,
38
- justifyContent: "center",
39
- alignItems: "center",
40
- borderWidth: 1,
41
- borderColor: night.color.warning + "33"
42
- },
43
- disabledButton: {
44
- opacity: 0.5,
45
- backgroundColor: night.color.fill,
46
- borderColor: night.color.border
47
- }
48
- });
49
- export default ClearCacheButton;
1
+ "use strict";import{TouchableOpacity as l,StyleSheet as a}from"react-native";import{Trash as n,night as t}from"@buoy-gg/shared-ui";import{jsx as r}from"react/jsx-runtime";const s=({type:c,onClear:i,disabled:o=false})=>{return r(l,{"sentry-label":"ignore devtools clear cache button",style:[e.button,o&&e.disabledButton],onPress:i,disabled:o,activeOpacity:.7,accessibilityLabel:`Clear ${c} cache`,accessibilityRole:"button",accessibilityState:{disabled:o},children:r(n,{size:16,strokeWidth:2,color:o?t.color.textTertiary:t.color.warning})})};const e=a.create({button:{width:32,height:32,borderRadius:6,backgroundColor:t.color.warningSoft,justifyContent:"center",alignItems:"center",borderWidth:1,borderColor:t.color.warning+"33"},disabledButton:{opacity:.5,backgroundColor:t.color.fill,borderColor:t.color.border}});export default s;
@@ -1,70 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * React Query's data explorer — now a thin wrapper over shared-ui's
5
- * {@link LiveExplorer}, which is this component's own implementation hoisted
6
- * so every tool (react-query, zustand, storage, whatever comes next) edits
7
- * data through ONE live editor.
8
- *
9
- * Everything RQ-specific stays here and only here:
10
- * - the WRITER: edits go through `queryClient.setQueryData` against the
11
- * active query (deletes via `deleteItem`, which forces a fresh reference so
12
- * observers re-render);
13
- * - the HANDLE scheme: `explorerTestID` keeps every existing
14
- * `buoy-rq-explorer-*` testID exactly as the Detox suite knows them;
15
- * - the cadence: `debounceMs: 0` — a cache write is free and unlogged, so RQ
16
- * keeps its original per-keystroke behavior.
17
- */
18
-
19
- import { useMemo } from "react";
20
- import { useQueryClient } from "@tanstack/react-query";
21
- import { updateNestedDataByPath } from "../../utils/updateNestedDataByPath";
22
- import deleteItem from "../../utils/actions/deleteItem";
23
- import { explorerTestID } from "../../utils/testIDs";
24
- import { LiveExplorer } from "@buoy-gg/shared-ui/dataViewer";
25
- import { jsx as _jsx } from "react/jsx-runtime";
26
- /**
27
- * Recursive data explorer component used for both editable and read-only JSON
28
- * trees inside the React Query dev tools.
29
- */
30
- export default function Explorer({
31
- editable,
32
- label,
33
- value,
34
- defaultExpanded,
35
- activeQuery,
36
- dataPath,
37
- itemsDeletable,
38
- dataVersion = 0
39
- }) {
40
- const queryClient = useQueryClient();
41
- const writer = useMemo(() => {
42
- if (!activeQuery) return undefined;
43
- return {
44
- update: (path, next) => {
45
- const oldData = activeQuery.state.data;
46
- const newData = updateNestedDataByPath(oldData, path, next);
47
- queryClient.setQueryData(activeQuery.queryKey, newData);
48
- },
49
- remove: path => {
50
- deleteItem({
51
- queryClient,
52
- activeQuery,
53
- dataPath: path
54
- });
55
- }
56
- };
57
- }, [queryClient, activeQuery]);
58
- return /*#__PURE__*/_jsx(LiveExplorer, {
59
- editable: editable,
60
- label: label,
61
- value: value,
62
- defaultExpanded: defaultExpanded,
63
- writer: writer,
64
- dataPath: dataPath,
65
- itemsDeletable: itemsDeletable,
66
- dataVersion: dataVersion,
67
- testIDForPath: explorerTestID,
68
- debounceMs: 0
69
- });
70
- }
1
+ "use strict";import{useMemo as x}from"react";import{useQueryClient as D}from"@tanstack/react-query";import{updateNestedDataByPath as b}from"../../utils/updateNestedDataByPath";import h from"../../utils/actions/deleteItem";import{explorerTestID as P}from"../../utils/testIDs";import{LiveExplorer as c}from"@buoy-gg/shared-ui/dataViewer";import{jsx as w}from"react/jsx-runtime";export default function E({editable:o,label:a,value:s,defaultExpanded:m,activeQuery:t,dataPath:d,itemsDeletable:n,dataVersion:i=0}){const e=D();const l=x(()=>{if(!t)return void 0;return{update:(r,p)=>{const u=t.state.data;const f=b(u,r,p);e.setQueryData(t.queryKey,f)},remove:r=>{h({queryClient:e,activeQuery:t,dataPath:r})}}},[e,t]);return w(c,{editable:o,label:a,value:s,defaultExpanded:m,writer:l,dataPath:d,itemsDeletable:n,dataVersion:i,testIDForPath:P,debounceMs:0})}
@@ -1,186 +1 @@
1
- "use strict";
2
-
3
- import { TouchableOpacity, Text, View, StyleSheet } from "react-native";
4
- import { CheckCircle, LoadingCircle, PauseCircle, XCircle } from "./svgs";
5
- import { buoyColors, night, useRelativeTime, monoFont } from "@buoy-gg/shared-ui";
6
- import { mutationRowTestID } from "../../utils/testIDs";
7
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
- const getMutationText = mutation => {
9
- if (!mutation.options.mutationKey) return "Anonymous Mutation";
10
- const keys = Array.isArray(mutation.options.mutationKey) ? mutation.options.mutationKey : [mutation.options.mutationKey];
11
- return keys.filter(k => k != null).map(k => String(k)).join(" › ") || "Anonymous Mutation";
12
- };
13
- /**
14
- * List-row button for displaying mutation metadata and selecting it for detail inspection.
15
- */
16
- export default function MutationButton({
17
- mutation,
18
- setSelectedMutation,
19
- selected
20
- }) {
21
- const submittedAt = new Date(mutation.state.submittedAt).toLocaleTimeString();
22
-
23
- // Get the best available timestamp for this mutation
24
- const bestTimestamp = (() => {
25
- if (mutation.state.submittedAt && mutation.state.submittedAt > 0) {
26
- return mutation.state.submittedAt;
27
- }
28
- // @ts-ignore - exploring state fields for debugging
29
- const stateAny = mutation.state;
30
- if (stateAny.updatedAt && stateAny.updatedAt > 0) {
31
- return stateAny.updatedAt;
32
- }
33
- return null;
34
- })();
35
- const relativeTime = useRelativeTime(bestTimestamp);
36
- const lastUpdated = relativeTime || `N/A (${mutation.state.submittedAt || 0})`;
37
- const getStatusInfo = () => {
38
- if (mutation.state.isPaused) {
39
- return {
40
- status: "Paused",
41
- color: buoyColors.textMuted,
42
- icon: /*#__PURE__*/_jsx(PauseCircle, {})
43
- };
44
- }
45
- switch (mutation.state.status) {
46
- case "success":
47
- return {
48
- status: "Success",
49
- color: buoyColors.success,
50
- icon: /*#__PURE__*/_jsx(CheckCircle, {})
51
- };
52
- case "error":
53
- return {
54
- status: "Error",
55
- color: buoyColors.error,
56
- icon: /*#__PURE__*/_jsx(XCircle, {})
57
- };
58
- case "pending":
59
- return {
60
- status: "Loading",
61
- color: buoyColors.primary,
62
- icon: /*#__PURE__*/_jsx(LoadingCircle, {})
63
- };
64
- default:
65
- return {
66
- status: "Idle",
67
- color: buoyColors.textMuted,
68
- icon: null
69
- };
70
- }
71
- };
72
- const statusInfo = getStatusInfo();
73
- const mutationText = getMutationText(mutation);
74
- const testID = mutationRowTestID(mutation.options.mutationKey, mutation.mutationId);
75
- return /*#__PURE__*/_jsxs(TouchableOpacity, {
76
- "sentry-label": "ignore devtools mutation button",
77
- testID: testID,
78
- accessibilityRole: "button"
79
- // Same Fabric merge as the query rows: without a spelled-out label the
80
- // row announces as an unnamed button.
81
- ,
82
- accessibilityLabel: `${mutationText}, ${statusInfo.status}`,
83
- onPress: () => setSelectedMutation(mutation === selected ? undefined : mutation),
84
- style: [styles.button, selected?.mutationId === mutation.mutationId && styles.selected],
85
- children: [/*#__PURE__*/_jsxs(View, {
86
- style: styles.rowContent,
87
- children: [/*#__PURE__*/_jsxs(View, {
88
- style: styles.statusSection,
89
- children: [/*#__PURE__*/_jsx(View, {
90
- style: [styles.statusDot, {
91
- backgroundColor: statusInfo.color
92
- }]
93
- }), /*#__PURE__*/_jsxs(View, {
94
- style: styles.statusInfo,
95
- children: [/*#__PURE__*/_jsx(Text, {
96
- testID: `${testID}-status`,
97
- style: [styles.statusLabel, {
98
- color: statusInfo.color
99
- }],
100
- children: statusInfo.status
101
- }), /*#__PURE__*/_jsx(Text, {
102
- style: styles.submittedText,
103
- children: submittedAt
104
- })]
105
- })]
106
- }), /*#__PURE__*/_jsx(View, {
107
- style: styles.mutationSection,
108
- children: /*#__PURE__*/_jsx(Text, {
109
- testID: `${testID}-key`,
110
- style: styles.mutationKey,
111
- children: mutationText
112
- })
113
- })]
114
- }), /*#__PURE__*/_jsx(View, {
115
- style: styles.bottomRightContainer,
116
- children: /*#__PURE__*/_jsx(Text, {
117
- style: styles.bottomRightText,
118
- children: lastUpdated
119
- })
120
- })]
121
- });
122
- }
123
- const styles = StyleSheet.create({
124
- button: {
125
- backgroundColor: night.color.surface,
126
- borderRadius: 8,
127
- borderWidth: 1,
128
- borderColor: night.color.border,
129
- marginHorizontal: 8,
130
- marginVertical: 3,
131
- padding: 12
132
- },
133
- selected: {
134
- backgroundColor: night.color.accentSoft,
135
- borderColor: night.color.accentBorderStrong
136
- },
137
- rowContent: {
138
- flexDirection: "row",
139
- alignItems: "center",
140
- justifyContent: "space-between"
141
- },
142
- statusSection: {
143
- flexDirection: "row",
144
- alignItems: "center",
145
- gap: 8,
146
- flex: 1
147
- },
148
- statusDot: {
149
- width: 8,
150
- height: 8,
151
- borderRadius: 4
152
- },
153
- statusInfo: {
154
- flex: 1
155
- },
156
- statusLabel: {
157
- fontSize: 11,
158
- fontWeight: "600",
159
- lineHeight: 14
160
- },
161
- submittedText: {
162
- fontSize: 10,
163
- color: night.color.textTertiary,
164
- marginTop: 1
165
- },
166
- mutationSection: {
167
- flex: 2,
168
- paddingHorizontal: 12
169
- },
170
- mutationKey: {
171
- fontFamily: monoFont,
172
- fontSize: 12,
173
- color: night.color.text,
174
- lineHeight: 16
175
- },
176
- bottomRightContainer: {
177
- position: "absolute",
178
- bottom: 4,
179
- right: 8
180
- },
181
- bottomRightText: {
182
- fontSize: 9,
183
- color: night.color.textTertiary,
184
- fontFamily: monoFont
185
- }
186
- });
1
+ "use strict";import{TouchableOpacity as C,Text as l,View as n,StyleSheet as S}from"react-native";import{CheckCircle as T,LoadingCircle as A,PauseCircle as I,XCircle as w}from"./svgs";import{buoyColors as i,night as s,useRelativeTime as D,monoFont as b}from"@buoy-gg/shared-ui";import{mutationRowTestID as R}from"../../utils/testIDs";import{jsx as o,jsxs as c}from"react/jsx-runtime";const K=t=>{if(!t.options.mutationKey)return"Anonymous Mutation";const u=Array.isArray(t.options.mutationKey)?t.options.mutationKey:[t.options.mutationKey];return u.filter(r=>r!=null).map(r=>String(r)).join(" \u203A ")||"Anonymous Mutation"};export default function j({mutation:t,setSelectedMutation:u,selected:r}){const f=new Date(t.state.submittedAt).toLocaleTimeString();const g=(()=>{if(t.state.submittedAt&&t.state.submittedAt>0){return t.state.submittedAt}const m=t.state;if(m.updatedAt&&m.updatedAt>0){return m.updatedAt}return null})();const h=D(g);const p=h||`N/A (${t.state.submittedAt||0})`;const x=()=>{if(t.state.isPaused){return{status:"Paused",color:i.textMuted,icon:o(I,{})}}switch(t.state.status){case"success":return{status:"Success",color:i.success,icon:o(T,{})};case"error":return{status:"Error",color:i.error,icon:o(w,{})};case"pending":return{status:"Loading",color:i.primary,icon:o(A,{})};default:return{status:"Idle",color:i.textMuted,icon:null}}};const a=x();const y=K(t);const d=R(t.options.mutationKey,t.mutationId);return c(C,{"sentry-label":"ignore devtools mutation button",testID:d,accessibilityRole:"button",accessibilityLabel:`${y}, ${a.status}`,onPress:()=>u(t===r?void 0:t),style:[e.button,r?.mutationId===t.mutationId&&e.selected],children:[c(n,{style:e.rowContent,children:[c(n,{style:e.statusSection,children:[o(n,{style:[e.statusDot,{backgroundColor:a.color}]}),c(n,{style:e.statusInfo,children:[o(l,{testID:`${d}-status`,style:[e.statusLabel,{color:a.color}],children:a.status}),o(l,{style:e.submittedText,children:f})]})]}),o(n,{style:e.mutationSection,children:o(l,{testID:`${d}-key`,style:e.mutationKey,children:y})})]}),o(n,{style:e.bottomRightContainer,children:o(l,{style:e.bottomRightText,children:p})})]})}const e=S.create({button:{backgroundColor:s.color.surface,borderRadius:8,borderWidth:1,borderColor:s.color.border,marginHorizontal:8,marginVertical:3,padding:12},selected:{backgroundColor:s.color.accentSoft,borderColor:s.color.accentBorderStrong},rowContent:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},statusSection:{flexDirection:"row",alignItems:"center",gap:8,flex:1},statusDot:{width:8,height:8,borderRadius:4},statusInfo:{flex:1},statusLabel:{fontSize:11,fontWeight:"600",lineHeight:14},submittedText:{fontSize:10,color:s.color.textTertiary,marginTop:1},mutationSection:{flex:2,paddingHorizontal:12},mutationKey:{fontFamily:b,fontSize:12,color:s.color.text,lineHeight:16},bottomRightContainer:{position:"absolute",bottom:4,right:8},bottomRightText:{fontSize:9,color:s.color.textTertiary,fontFamily:b}});