@buoy-gg/events 2.1.1

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 (84) hide show
  1. package/LICENSE +58 -0
  2. package/README.md +55 -0
  3. package/lib/commonjs/components/EventsCopySettingsView.js +645 -0
  4. package/lib/commonjs/components/EventsModal.js +263 -0
  5. package/lib/commonjs/components/ReactQueryEventDetail.js +428 -0
  6. package/lib/commonjs/components/UnifiedEventDetail.js +370 -0
  7. package/lib/commonjs/components/UnifiedEventFilters.js +113 -0
  8. package/lib/commonjs/components/UnifiedEventItem.js +349 -0
  9. package/lib/commonjs/components/UnifiedEventList.js +154 -0
  10. package/lib/commonjs/components/UnifiedEventViewer.js +126 -0
  11. package/lib/commonjs/hooks/useUnifiedEvents.js +237 -0
  12. package/lib/commonjs/index.js +205 -0
  13. package/lib/commonjs/package.json +1 -0
  14. package/lib/commonjs/preset.js +66 -0
  15. package/lib/commonjs/stores/unifiedEventStore.js +413 -0
  16. package/lib/commonjs/types/copySettings.js +220 -0
  17. package/lib/commonjs/types/index.js +17 -0
  18. package/lib/commonjs/utils/autoDiscoverEventSources.js +640 -0
  19. package/lib/commonjs/utils/badgeSelectionStorage.js +58 -0
  20. package/lib/commonjs/utils/copySettingsStorage.js +66 -0
  21. package/lib/commonjs/utils/correlationUtils.js +130 -0
  22. package/lib/commonjs/utils/eventExportFormatter.js +1095 -0
  23. package/lib/commonjs/utils/eventTransformers.js +496 -0
  24. package/lib/module/components/EventsCopySettingsView.js +641 -0
  25. package/lib/module/components/EventsModal.js +259 -0
  26. package/lib/module/components/ReactQueryEventDetail.js +424 -0
  27. package/lib/module/components/UnifiedEventDetail.js +366 -0
  28. package/lib/module/components/UnifiedEventFilters.js +109 -0
  29. package/lib/module/components/UnifiedEventItem.js +345 -0
  30. package/lib/module/components/UnifiedEventList.js +150 -0
  31. package/lib/module/components/UnifiedEventViewer.js +122 -0
  32. package/lib/module/hooks/useUnifiedEvents.js +234 -0
  33. package/lib/module/index.js +77 -0
  34. package/lib/module/preset.js +62 -0
  35. package/lib/module/stores/unifiedEventStore.js +387 -0
  36. package/lib/module/types/copySettings.js +215 -0
  37. package/lib/module/types/index.js +37 -0
  38. package/lib/module/utils/autoDiscoverEventSources.js +633 -0
  39. package/lib/module/utils/badgeSelectionStorage.js +52 -0
  40. package/lib/module/utils/copySettingsStorage.js +61 -0
  41. package/lib/module/utils/correlationUtils.js +120 -0
  42. package/lib/module/utils/eventExportFormatter.js +1085 -0
  43. package/lib/module/utils/eventTransformers.js +487 -0
  44. package/lib/typescript/components/EventsCopySettingsView.d.ts +16 -0
  45. package/lib/typescript/components/EventsModal.d.ts +16 -0
  46. package/lib/typescript/components/ReactQueryEventDetail.d.ts +15 -0
  47. package/lib/typescript/components/UnifiedEventDetail.d.ts +15 -0
  48. package/lib/typescript/components/UnifiedEventFilters.d.ts +21 -0
  49. package/lib/typescript/components/UnifiedEventItem.d.ts +26 -0
  50. package/lib/typescript/components/UnifiedEventList.d.ts +27 -0
  51. package/lib/typescript/components/UnifiedEventViewer.d.ts +8 -0
  52. package/lib/typescript/hooks/useUnifiedEvents.d.ts +30 -0
  53. package/lib/typescript/index.d.ts +28 -0
  54. package/lib/typescript/preset.d.ts +62 -0
  55. package/lib/typescript/stores/unifiedEventStore.d.ts +146 -0
  56. package/lib/typescript/types/copySettings.d.ts +179 -0
  57. package/lib/typescript/types/index.d.ts +73 -0
  58. package/lib/typescript/utils/autoDiscoverEventSources.d.ts +74 -0
  59. package/lib/typescript/utils/badgeSelectionStorage.d.ts +21 -0
  60. package/lib/typescript/utils/copySettingsStorage.d.ts +21 -0
  61. package/lib/typescript/utils/correlationUtils.d.ts +36 -0
  62. package/lib/typescript/utils/eventExportFormatter.d.ts +49 -0
  63. package/lib/typescript/utils/eventTransformers.d.ts +119 -0
  64. package/package.json +91 -0
  65. package/src/components/EventsCopySettingsView.tsx +742 -0
  66. package/src/components/EventsModal.tsx +328 -0
  67. package/src/components/ReactQueryEventDetail.tsx +413 -0
  68. package/src/components/UnifiedEventDetail.tsx +371 -0
  69. package/src/components/UnifiedEventFilters.tsx +156 -0
  70. package/src/components/UnifiedEventItem.tsx +396 -0
  71. package/src/components/UnifiedEventList.tsx +197 -0
  72. package/src/components/UnifiedEventViewer.tsx +132 -0
  73. package/src/hooks/useUnifiedEvents.ts +288 -0
  74. package/src/index.tsx +112 -0
  75. package/src/preset.tsx +57 -0
  76. package/src/stores/unifiedEventStore.ts +405 -0
  77. package/src/types/copySettings.ts +269 -0
  78. package/src/types/index.ts +96 -0
  79. package/src/utils/autoDiscoverEventSources.ts +690 -0
  80. package/src/utils/badgeSelectionStorage.ts +51 -0
  81. package/src/utils/copySettingsStorage.ts +61 -0
  82. package/src/utils/correlationUtils.ts +146 -0
  83. package/src/utils/eventExportFormatter.ts +1233 -0
  84. package/src/utils/eventTransformers.ts +567 -0
@@ -0,0 +1,259 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * EventsModal
5
+ *
6
+ * Modal wrapper for the unified events timeline.
7
+ * Uses JsModal for consistent bottom sheet behavior.
8
+ */
9
+
10
+ import { View, StyleSheet, TouchableOpacity, Text, Alert } from "react-native";
11
+ import { useState, useCallback } from "react";
12
+ import { useRouter } from "expo-router";
13
+ import { JsModal, ModalHeader, buoyColors, Trash2, Power, Copy, devToolsStorageKeys, ToolbarCopyButton, UpgradeModal } from "@buoy-gg/shared-ui";
14
+ import { useUnifiedEvents } from "../hooks/useUnifiedEvents";
15
+ import { UnifiedEventFilters } from "./UnifiedEventFilters";
16
+ import { UnifiedEventList } from "./UnifiedEventList";
17
+ import { UnifiedEventDetail } from "./UnifiedEventDetail";
18
+ import { EventsCopySettingsView } from "./EventsCopySettingsView";
19
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
20
+ // Try to load TickProvider from network package for time refresh
21
+ let TickProvider = null;
22
+ try {
23
+ // @ts-ignore - Dynamic import that may not exist
24
+ const network = require("@buoy-gg/network");
25
+ TickProvider = network.TickProvider;
26
+ } catch {
27
+ // Network package not installed, times won't auto-refresh
28
+ }
29
+ export function EventsModal({
30
+ visible,
31
+ onClose,
32
+ onBack,
33
+ onMinimize,
34
+ enableSharedModalDimensions = false
35
+ }) {
36
+ const router = useRouter();
37
+ const {
38
+ filteredEvents,
39
+ availableSources,
40
+ toggleSource,
41
+ clearEvents,
42
+ totalCount,
43
+ filteredCount,
44
+ isCapturing,
45
+ toggleCapturing,
46
+ hiddenEventsCount
47
+ } = useUnifiedEvents();
48
+ const [currentView, setCurrentView] = useState("list");
49
+ const [selectedEvent, setSelectedEvent] = useState(null);
50
+ const [expandedEventId, setExpandedEventId] = useState(null);
51
+ const [showUpgradeModal, setShowUpgradeModal] = useState(false);
52
+
53
+ // Navigation handler for route events
54
+ const handleNavigate = useCallback(pathname => {
55
+ try {
56
+ router.push(pathname);
57
+ } catch (error) {
58
+ Alert.alert("Navigation Error", String(error));
59
+ }
60
+ }, [router]);
61
+ const handleEventPress = useCallback(event => {
62
+ // Route events expand in-place instead of navigating to detail
63
+ if (event.source === "route") {
64
+ setExpandedEventId(prev => prev === event.id ? null : event.id);
65
+ return;
66
+ }
67
+ setSelectedEvent(event);
68
+ setCurrentView("detail");
69
+ }, []);
70
+ const handleBack = useCallback(() => {
71
+ if (currentView === "detail") {
72
+ setSelectedEvent(null);
73
+ setCurrentView("list");
74
+ } else if (currentView === "copySettings") {
75
+ setCurrentView("list");
76
+ }
77
+ }, [currentView]);
78
+ const handleOpenCopySettings = useCallback(() => {
79
+ setCurrentView("copySettings");
80
+ }, []);
81
+ const handleModeChange = useCallback(_mode => {
82
+ // Mode changes handled by JsModal
83
+ }, []);
84
+ const persistenceKey = enableSharedModalDimensions ? devToolsStorageKeys.modal.root() : "buoy-events-modal";
85
+ if (!visible) return null;
86
+ const renderHeaderContent = () => {
87
+ // Detail view header
88
+ if (currentView === "detail" && selectedEvent) {
89
+ const copyData = {
90
+ source: selectedEvent.source,
91
+ title: selectedEvent.title,
92
+ subtitle: selectedEvent.subtitle,
93
+ status: selectedEvent.status,
94
+ timestamp: new Date(selectedEvent.timestamp).toISOString(),
95
+ data: selectedEvent.originalEvent
96
+ };
97
+ return /*#__PURE__*/_jsxs(ModalHeader, {
98
+ children: [/*#__PURE__*/_jsx(ModalHeader.Navigation, {
99
+ onBack: handleBack
100
+ }), /*#__PURE__*/_jsx(ModalHeader.Content, {
101
+ title: selectedEvent.title
102
+ }), /*#__PURE__*/_jsx(ModalHeader.Actions, {
103
+ children: /*#__PURE__*/_jsx(ToolbarCopyButton, {
104
+ value: copyData
105
+ })
106
+ })]
107
+ });
108
+ }
109
+
110
+ // Copy settings view header
111
+ if (currentView === "copySettings") {
112
+ return /*#__PURE__*/_jsxs(ModalHeader, {
113
+ children: [/*#__PURE__*/_jsx(ModalHeader.Navigation, {
114
+ onBack: handleBack
115
+ }), /*#__PURE__*/_jsx(ModalHeader.Content, {
116
+ title: "Copy Settings"
117
+ })]
118
+ });
119
+ }
120
+
121
+ // List view header (default)
122
+ return /*#__PURE__*/_jsxs(ModalHeader, {
123
+ children: [onBack && /*#__PURE__*/_jsx(ModalHeader.Navigation, {
124
+ onBack: onBack
125
+ }), /*#__PURE__*/_jsx(ModalHeader.Content, {
126
+ title: "",
127
+ children: /*#__PURE__*/_jsxs(View, {
128
+ style: styles.headerTitleContainer,
129
+ children: [/*#__PURE__*/_jsx(Text, {
130
+ style: styles.headerTitle,
131
+ children: "Events"
132
+ }), /*#__PURE__*/_jsxs(Text, {
133
+ style: styles.headerSubtitle,
134
+ children: [totalCount, " captured"]
135
+ })]
136
+ })
137
+ }), /*#__PURE__*/_jsxs(ModalHeader.Actions, {
138
+ children: [/*#__PURE__*/_jsx(TouchableOpacity, {
139
+ onPress: handleOpenCopySettings,
140
+ style: [styles.headerActionButton, totalCount === 0 && styles.headerActionButtonDisabled],
141
+ disabled: totalCount === 0,
142
+ children: /*#__PURE__*/_jsx(Copy, {
143
+ size: 14,
144
+ color: totalCount > 0 ? buoyColors.textMuted : buoyColors.textMuted + "50"
145
+ })
146
+ }), /*#__PURE__*/_jsx(TouchableOpacity, {
147
+ onPress: toggleCapturing,
148
+ style: [styles.headerActionButton, isCapturing ? styles.startButton : styles.stopButton],
149
+ children: /*#__PURE__*/_jsx(Power, {
150
+ size: 14,
151
+ color: isCapturing ? buoyColors.success : buoyColors.error
152
+ })
153
+ }), /*#__PURE__*/_jsx(TouchableOpacity, {
154
+ onPress: clearEvents,
155
+ style: [styles.headerActionButton, totalCount === 0 && styles.headerActionButtonDisabled],
156
+ disabled: totalCount === 0,
157
+ children: /*#__PURE__*/_jsx(Trash2, {
158
+ size: 14,
159
+ color: totalCount > 0 ? buoyColors.textMuted : buoyColors.textMuted + "50"
160
+ })
161
+ })]
162
+ })]
163
+ });
164
+ };
165
+ const content = /*#__PURE__*/_jsx(View, {
166
+ style: styles.container,
167
+ children: currentView === "copySettings" ? /*#__PURE__*/_jsx(EventsCopySettingsView, {
168
+ events: filteredEvents
169
+ }) : currentView === "detail" && selectedEvent ? /*#__PURE__*/_jsx(UnifiedEventDetail, {
170
+ event: selectedEvent,
171
+ onBack: handleBack
172
+ }) : /*#__PURE__*/_jsxs(_Fragment, {
173
+ children: [/*#__PURE__*/_jsx(UnifiedEventFilters, {
174
+ availableSources: availableSources,
175
+ onToggleSource: toggleSource,
176
+ totalCount: totalCount,
177
+ filteredCount: filteredCount
178
+ }), /*#__PURE__*/_jsx(UnifiedEventList, {
179
+ events: filteredEvents,
180
+ selectedEventId: undefined,
181
+ expandedEventId: expandedEventId,
182
+ onEventPress: handleEventPress,
183
+ onNavigate: handleNavigate,
184
+ isCapturing: isCapturing,
185
+ hiddenEventsCount: hiddenEventsCount,
186
+ onUpgradePress: () => setShowUpgradeModal(true)
187
+ })]
188
+ })
189
+ });
190
+ return /*#__PURE__*/_jsxs(_Fragment, {
191
+ children: [/*#__PURE__*/_jsx(JsModal, {
192
+ visible: visible,
193
+ onClose: onClose,
194
+ onMinimize: onMinimize,
195
+ persistenceKey: persistenceKey,
196
+ header: {
197
+ showToggleButton: true,
198
+ customContent: renderHeaderContent()
199
+ },
200
+ onModeChange: handleModeChange,
201
+ enablePersistence: true,
202
+ initialMode: "bottomSheet",
203
+ enableGlitchEffects: true,
204
+ styles: {},
205
+ disableScrollWrapper: true,
206
+ children: TickProvider ? /*#__PURE__*/_jsx(TickProvider, {
207
+ children: content
208
+ }) : content
209
+ }), /*#__PURE__*/_jsx(UpgradeModal, {
210
+ visible: showUpgradeModal,
211
+ onClose: () => setShowUpgradeModal(false),
212
+ featureName: "Unlimited Events",
213
+ description: "View your complete event history to debug complex flows and track down issues.",
214
+ benefits: ["Unlimited event history (vs 25 events)", "Export events to Markdown, JSON, or plain text", "Share event flows with teammates", "Feed event context directly to AI assistants"]
215
+ })]
216
+ });
217
+ }
218
+ const styles = StyleSheet.create({
219
+ container: {
220
+ flex: 1,
221
+ backgroundColor: buoyColors.base
222
+ },
223
+ headerTitleContainer: {
224
+ flexDirection: "row",
225
+ alignItems: "baseline",
226
+ gap: 8
227
+ },
228
+ headerTitle: {
229
+ fontSize: 16,
230
+ fontWeight: "600",
231
+ color: buoyColors.text
232
+ },
233
+ headerSubtitle: {
234
+ fontSize: 12,
235
+ color: buoyColors.textMuted
236
+ },
237
+ headerActionButton: {
238
+ width: 32,
239
+ height: 32,
240
+ borderRadius: 8,
241
+ backgroundColor: buoyColors.card,
242
+ borderWidth: 1,
243
+ borderColor: buoyColors.border,
244
+ alignItems: "center",
245
+ justifyContent: "center"
246
+ },
247
+ headerActionButtonDisabled: {
248
+ opacity: 0.55
249
+ },
250
+ startButton: {
251
+ backgroundColor: buoyColors.success + "20",
252
+ borderColor: buoyColors.success + "40"
253
+ },
254
+ stopButton: {
255
+ backgroundColor: buoyColors.error + "20",
256
+ borderColor: buoyColors.error + "40"
257
+ }
258
+ });
259
+ //# sourceMappingURL=EventsModal.js.map
@@ -0,0 +1,424 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * ReactQueryEventDetail
5
+ *
6
+ * Detail view for React Query events in the Events DevTools.
7
+ * Styled similarly to the React Query DevTools detail view.
8
+ *
9
+ * Uses local type definitions to avoid hard dependency on @buoy-gg/react-query.
10
+ */
11
+
12
+ import { memo, useMemo } from "react";
13
+ import { View, Text, StyleSheet, ScrollView } from "react-native";
14
+ import { buoyColors, displayValue } from "@buoy-gg/shared-ui";
15
+ import { DataViewer } from "@buoy-gg/shared-ui/dataViewer";
16
+
17
+ /**
18
+ * Extended React Query event with additional data fields
19
+ */
20
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
21
+ /**
22
+ * Event type display configuration
23
+ */
24
+ const EVENT_TYPE_CONFIG = {
25
+ "query-fetch-start": {
26
+ label: "Query Fetching",
27
+ color: buoyColors.primary,
28
+ icon: "hourglass"
29
+ },
30
+ "query-fetch-success": {
31
+ label: "Query Success",
32
+ color: buoyColors.success,
33
+ icon: "checkmark"
34
+ },
35
+ "query-fetch-error": {
36
+ label: "Query Error",
37
+ color: buoyColors.error,
38
+ icon: "close"
39
+ },
40
+ "query-invalidated": {
41
+ label: "Query Invalidated",
42
+ color: buoyColors.warning,
43
+ icon: "refresh"
44
+ },
45
+ "mutation-start": {
46
+ label: "Mutation Started",
47
+ color: buoyColors.primary,
48
+ icon: "hourglass"
49
+ },
50
+ "mutation-success": {
51
+ label: "Mutation Success",
52
+ color: buoyColors.success,
53
+ icon: "checkmark"
54
+ },
55
+ "mutation-error": {
56
+ label: "Mutation Error",
57
+ color: buoyColors.error,
58
+ icon: "close"
59
+ }
60
+ };
61
+ export const ReactQueryEventDetail = /*#__PURE__*/memo(function ReactQueryEventDetail({
62
+ event
63
+ }) {
64
+ const reactQueryEvent = event.originalEvent;
65
+ const eventConfig = EVENT_TYPE_CONFIG[reactQueryEvent.type] || {
66
+ label: reactQueryEvent.type,
67
+ color: buoyColors.textMuted,
68
+ icon: "help"
69
+ };
70
+ const isQuery = reactQueryEvent.type.startsWith("query-");
71
+ const isMutation = reactQueryEvent.type.startsWith("mutation-");
72
+
73
+ // Format query/mutation key for display
74
+ const keyDisplay = useMemo(() => {
75
+ const key = isQuery ? reactQueryEvent.queryKey : reactQueryEvent.mutationKey;
76
+ if (!key) {
77
+ // For mutations without a key, show the mutation ID
78
+ if (isMutation && reactQueryEvent.mutationId !== undefined) {
79
+ return `Mutation #${reactQueryEvent.mutationId}`;
80
+ }
81
+ return "No key";
82
+ }
83
+ return displayValue(key, true);
84
+ }, [reactQueryEvent, isQuery, isMutation]);
85
+
86
+ // Format timestamp
87
+ const timestamp = new Date(reactQueryEvent.timestamp);
88
+ const timeString = timestamp.toLocaleTimeString("en-US", {
89
+ hour: "2-digit",
90
+ minute: "2-digit",
91
+ second: "2-digit",
92
+ hour12: true
93
+ });
94
+
95
+ // Determine what data to show
96
+ const hasData = isQuery ? !!reactQueryEvent.queryData : !!reactQueryEvent.mutationData;
97
+ const hasError = isQuery ? !!reactQueryEvent.queryError : !!reactQueryEvent.mutationError;
98
+ const hasVariables = isMutation && !!reactQueryEvent.mutationVariables;
99
+ return /*#__PURE__*/_jsxs(ScrollView, {
100
+ style: styles.container,
101
+ contentContainerStyle: styles.contentContainer,
102
+ children: [/*#__PURE__*/_jsx(View, {
103
+ style: styles.section,
104
+ children: /*#__PURE__*/_jsxs(View, {
105
+ style: [styles.eventTypeContainer, {
106
+ borderColor: eventConfig.color + "4D"
107
+ }],
108
+ children: [/*#__PURE__*/_jsx(Text, {
109
+ style: [styles.eventTypeHeader, {
110
+ backgroundColor: eventConfig.color + "15",
111
+ color: eventConfig.color
112
+ }],
113
+ children: eventConfig.label
114
+ }), /*#__PURE__*/_jsxs(View, {
115
+ style: styles.eventTypeContent,
116
+ children: [/*#__PURE__*/_jsxs(View, {
117
+ style: styles.keyRow,
118
+ children: [/*#__PURE__*/_jsx(ScrollView, {
119
+ horizontal: true,
120
+ style: styles.keyScrollView,
121
+ children: /*#__PURE__*/_jsx(Text, {
122
+ style: styles.keyText,
123
+ children: keyDisplay
124
+ })
125
+ }), /*#__PURE__*/_jsx(EventStatusChip, {
126
+ type: reactQueryEvent.type,
127
+ color: eventConfig.color
128
+ })]
129
+ }), reactQueryEvent.duration !== undefined && /*#__PURE__*/_jsxs(View, {
130
+ style: styles.row,
131
+ children: [/*#__PURE__*/_jsx(Text, {
132
+ style: styles.labelText,
133
+ children: "Duration:"
134
+ }), /*#__PURE__*/_jsxs(Text, {
135
+ style: styles.valueText,
136
+ children: [reactQueryEvent.duration.toFixed(0), "ms"]
137
+ })]
138
+ }), /*#__PURE__*/_jsxs(View, {
139
+ style: styles.row,
140
+ children: [/*#__PURE__*/_jsx(Text, {
141
+ style: styles.labelText,
142
+ children: "Timestamp:"
143
+ }), /*#__PURE__*/_jsx(Text, {
144
+ style: styles.valueText,
145
+ children: timeString
146
+ })]
147
+ }), isQuery && reactQueryEvent.queryHash && /*#__PURE__*/_jsxs(View, {
148
+ style: styles.row,
149
+ children: [/*#__PURE__*/_jsx(Text, {
150
+ style: styles.labelText,
151
+ children: "Query Hash:"
152
+ }), /*#__PURE__*/_jsx(Text, {
153
+ style: [styles.valueText, styles.hashText],
154
+ numberOfLines: 1,
155
+ children: reactQueryEvent.queryHash
156
+ })]
157
+ }), isMutation && reactQueryEvent.mutationId !== undefined && /*#__PURE__*/_jsxs(View, {
158
+ style: styles.row,
159
+ children: [/*#__PURE__*/_jsx(Text, {
160
+ style: styles.labelText,
161
+ children: "Mutation ID:"
162
+ }), /*#__PURE__*/_jsxs(Text, {
163
+ style: styles.valueText,
164
+ children: ["#", reactQueryEvent.mutationId]
165
+ })]
166
+ })]
167
+ })]
168
+ })
169
+ }), hasVariables && /*#__PURE__*/_jsx(View, {
170
+ style: styles.section,
171
+ children: /*#__PURE__*/_jsxs(View, {
172
+ style: styles.dataContainer,
173
+ children: [/*#__PURE__*/_jsx(Text, {
174
+ style: [styles.dataHeader, {
175
+ color: buoyColors.warning
176
+ }],
177
+ children: "Variables"
178
+ }), /*#__PURE__*/_jsx(View, {
179
+ style: styles.dataContent,
180
+ children: /*#__PURE__*/_jsx(DataViewer, {
181
+ title: "",
182
+ data: reactQueryEvent.mutationVariables,
183
+ showTypeFilter: false,
184
+ initialExpanded: true
185
+ })
186
+ })]
187
+ })
188
+ }), hasData && /*#__PURE__*/_jsx(View, {
189
+ style: styles.section,
190
+ children: /*#__PURE__*/_jsxs(View, {
191
+ style: styles.dataContainer,
192
+ children: [/*#__PURE__*/_jsx(Text, {
193
+ style: [styles.dataHeader, {
194
+ color: buoyColors.success
195
+ }],
196
+ children: isQuery ? "Query Data" : "Mutation Result"
197
+ }), /*#__PURE__*/_jsx(View, {
198
+ style: styles.dataContent,
199
+ children: /*#__PURE__*/_jsx(DataViewer, {
200
+ title: "",
201
+ data: isQuery ? reactQueryEvent.queryData : reactQueryEvent.mutationData,
202
+ showTypeFilter: false,
203
+ initialExpanded: true
204
+ })
205
+ })]
206
+ })
207
+ }), hasError && /*#__PURE__*/_jsx(View, {
208
+ style: styles.section,
209
+ children: /*#__PURE__*/_jsxs(View, {
210
+ style: [styles.dataContainer, styles.errorContainer],
211
+ children: [/*#__PURE__*/_jsx(Text, {
212
+ style: [styles.dataHeader, styles.errorHeader],
213
+ children: "Error"
214
+ }), /*#__PURE__*/_jsx(View, {
215
+ style: styles.dataContent,
216
+ children: /*#__PURE__*/_jsx(DataViewer, {
217
+ title: "",
218
+ data: isQuery ? reactQueryEvent.queryError : reactQueryEvent.mutationError,
219
+ showTypeFilter: false,
220
+ initialExpanded: true
221
+ })
222
+ })]
223
+ })
224
+ }), /*#__PURE__*/_jsx(View, {
225
+ style: styles.section,
226
+ children: /*#__PURE__*/_jsxs(View, {
227
+ style: styles.dataContainer,
228
+ children: [/*#__PURE__*/_jsx(Text, {
229
+ style: styles.dataHeader,
230
+ children: "Event Details"
231
+ }), /*#__PURE__*/_jsx(View, {
232
+ style: styles.dataContent,
233
+ children: /*#__PURE__*/_jsx(DataViewer, {
234
+ title: "",
235
+ data: reactQueryEvent,
236
+ showTypeFilter: true,
237
+ initialExpanded: false
238
+ })
239
+ })]
240
+ })
241
+ })]
242
+ });
243
+ });
244
+
245
+ /**
246
+ * Status chip component for event type
247
+ */
248
+ function EventStatusChip({
249
+ type,
250
+ color
251
+ }) {
252
+ const getStatusLabel = () => {
253
+ if (type.includes("start")) return "PENDING";
254
+ if (type.includes("success")) return "SUCCESS";
255
+ if (type.includes("error")) return "ERROR";
256
+ if (type.includes("invalidated")) return "INVALIDATED";
257
+ return type.toUpperCase();
258
+ };
259
+ return /*#__PURE__*/_jsx(View, {
260
+ style: [styles.statusChip, {
261
+ backgroundColor: color + "15",
262
+ borderColor: color + "33"
263
+ }],
264
+ children: /*#__PURE__*/_jsx(Text, {
265
+ style: [styles.statusChipText, {
266
+ color
267
+ }],
268
+ children: getStatusLabel()
269
+ })
270
+ });
271
+ }
272
+ const styles = StyleSheet.create({
273
+ container: {
274
+ flex: 1,
275
+ backgroundColor: buoyColors.base
276
+ },
277
+ contentContainer: {
278
+ padding: 8,
279
+ paddingBottom: 24
280
+ },
281
+ section: {
282
+ marginBottom: 12
283
+ },
284
+ // Event type container (like QueryDetails)
285
+ eventTypeContainer: {
286
+ minWidth: 200,
287
+ backgroundColor: buoyColors.card,
288
+ borderRadius: 6,
289
+ borderWidth: 1,
290
+ overflow: "hidden",
291
+ shadowColor: buoyColors.primary,
292
+ shadowOffset: {
293
+ width: 0,
294
+ height: 0
295
+ },
296
+ shadowOpacity: 0.1,
297
+ shadowRadius: 6
298
+ },
299
+ eventTypeHeader: {
300
+ paddingHorizontal: 12,
301
+ paddingVertical: 10,
302
+ fontWeight: "600",
303
+ fontSize: 12,
304
+ borderBottomWidth: 1,
305
+ borderBottomColor: buoyColors.primary + "33",
306
+ letterSpacing: 0.5,
307
+ textTransform: "uppercase",
308
+ fontFamily: "monospace"
309
+ },
310
+ eventTypeContent: {
311
+ padding: 0
312
+ },
313
+ keyRow: {
314
+ flexDirection: "row",
315
+ justifyContent: "space-between",
316
+ alignItems: "center",
317
+ paddingHorizontal: 12,
318
+ paddingVertical: 10,
319
+ borderBottomWidth: 1,
320
+ borderBottomColor: buoyColors.textMuted + "66"
321
+ },
322
+ keyScrollView: {
323
+ flex: 1,
324
+ marginRight: 8
325
+ },
326
+ keyText: {
327
+ fontSize: 12,
328
+ color: buoyColors.text,
329
+ fontFamily: "monospace",
330
+ lineHeight: 18,
331
+ backgroundColor: buoyColors.primary + "15",
332
+ paddingHorizontal: 8,
333
+ paddingVertical: 4,
334
+ borderRadius: 4,
335
+ borderWidth: 1,
336
+ borderColor: buoyColors.primary + "4D"
337
+ },
338
+ row: {
339
+ flexDirection: "row",
340
+ justifyContent: "space-between",
341
+ alignItems: "center",
342
+ paddingHorizontal: 12,
343
+ paddingVertical: 10,
344
+ borderBottomWidth: 1,
345
+ borderBottomColor: buoyColors.textMuted + "66"
346
+ },
347
+ labelText: {
348
+ fontSize: 10,
349
+ color: buoyColors.textSecondary,
350
+ fontWeight: "600",
351
+ letterSpacing: 0.5,
352
+ textTransform: "uppercase",
353
+ fontFamily: "monospace"
354
+ },
355
+ valueText: {
356
+ fontSize: 12,
357
+ color: buoyColors.text,
358
+ fontWeight: "500",
359
+ fontVariant: ["tabular-nums"],
360
+ fontFamily: "monospace"
361
+ },
362
+ hashText: {
363
+ flex: 1,
364
+ textAlign: "right",
365
+ marginLeft: 8
366
+ },
367
+ // Status chip
368
+ statusChip: {
369
+ paddingHorizontal: 8,
370
+ paddingVertical: 4,
371
+ borderWidth: 1,
372
+ borderRadius: 6,
373
+ alignSelf: "flex-start"
374
+ },
375
+ statusChipText: {
376
+ fontSize: 11,
377
+ fontWeight: "600",
378
+ textTransform: "uppercase",
379
+ letterSpacing: 0.5,
380
+ fontFamily: "monospace"
381
+ },
382
+ // Data containers
383
+ dataContainer: {
384
+ minWidth: 200,
385
+ backgroundColor: buoyColors.card,
386
+ borderRadius: 6,
387
+ borderWidth: 1,
388
+ borderColor: buoyColors.primary + "4D",
389
+ overflow: "hidden",
390
+ shadowColor: buoyColors.primary,
391
+ shadowOffset: {
392
+ width: 0,
393
+ height: 0
394
+ },
395
+ shadowOpacity: 0.1,
396
+ shadowRadius: 6
397
+ },
398
+ dataHeader: {
399
+ backgroundColor: buoyColors.primary + "1A",
400
+ paddingHorizontal: 12,
401
+ paddingVertical: 10,
402
+ fontWeight: "600",
403
+ fontSize: 12,
404
+ color: buoyColors.primary,
405
+ borderBottomWidth: 1,
406
+ borderBottomColor: buoyColors.primary + "33",
407
+ letterSpacing: 0.5,
408
+ textTransform: "uppercase",
409
+ fontFamily: "monospace"
410
+ },
411
+ dataContent: {
412
+ padding: 8
413
+ },
414
+ // Error container
415
+ errorContainer: {
416
+ borderColor: buoyColors.error + "4D"
417
+ },
418
+ errorHeader: {
419
+ backgroundColor: buoyColors.error + "1A",
420
+ color: buoyColors.error,
421
+ borderBottomColor: buoyColors.error + "33"
422
+ }
423
+ });
424
+ //# sourceMappingURL=ReactQueryEventDetail.js.map