@buoy-gg/events 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 (123) hide show
  1. package/README.md +11 -64
  2. package/lib/commonjs/components/EventsCopySettingsView.js +1 -581
  3. package/lib/commonjs/components/EventsModal.js +1 -378
  4. package/lib/commonjs/components/ReactQueryEventDetail.js +1 -433
  5. package/lib/commonjs/components/UnifiedEventDetail.js +1 -565
  6. package/lib/commonjs/components/UnifiedEventFilters.js +1 -160
  7. package/lib/commonjs/components/UnifiedEventItem.js +1 -416
  8. package/lib/commonjs/components/UnifiedEventList.js +1 -187
  9. package/lib/commonjs/components/UnifiedEventViewer.js +1 -130
  10. package/lib/commonjs/hooks/useUnifiedEvents.js +1 -419
  11. package/lib/commonjs/index.js +1 -282
  12. package/lib/commonjs/preset.js +1 -60
  13. package/lib/commonjs/sources/sourceIds.js +1 -30
  14. package/lib/commonjs/stores/unifiedEventStore.js +1 -712
  15. package/lib/commonjs/sync/eventsSyncAdapter.js +1 -358
  16. package/lib/commonjs/types/copySettings.js +1 -249
  17. package/lib/commonjs/types/index.js +1 -17
  18. package/lib/commonjs/utils/autoDiscoverEventSources.js +1 -1068
  19. package/lib/commonjs/utils/badgeSelectionStorage.js +1 -126
  20. package/lib/commonjs/utils/copySettingsStorage.js +1 -43
  21. package/lib/commonjs/utils/correlationUtils.js +1 -130
  22. package/lib/commonjs/utils/eventExportFormatter.js +1 -1912
  23. package/lib/commonjs/utils/eventTransformers.js +1 -496
  24. package/lib/commonjs/utils/eventVisibility.js +1 -76
  25. package/lib/commonjs/utils/testIDs.js +1 -91
  26. package/lib/module/components/EventsCopySettingsView.js +1 -577
  27. package/lib/module/components/EventsModal.js +1 -374
  28. package/lib/module/components/ReactQueryEventDetail.js +1 -429
  29. package/lib/module/components/UnifiedEventDetail.js +1 -561
  30. package/lib/module/components/UnifiedEventFilters.js +1 -156
  31. package/lib/module/components/UnifiedEventItem.js +1 -412
  32. package/lib/module/components/UnifiedEventList.js +1 -183
  33. package/lib/module/components/UnifiedEventViewer.js +1 -126
  34. package/lib/module/hooks/useUnifiedEvents.js +1 -416
  35. package/lib/module/index.js +1 -102
  36. package/lib/module/preset.js +1 -57
  37. package/lib/module/sources/sourceIds.js +1 -26
  38. package/lib/module/stores/unifiedEventStore.js +1 -678
  39. package/lib/module/sync/eventsSyncAdapter.js +1 -354
  40. package/lib/module/types/copySettings.js +1 -244
  41. package/lib/module/types/index.js +1 -37
  42. package/lib/module/utils/autoDiscoverEventSources.js +1 -1060
  43. package/lib/module/utils/badgeSelectionStorage.js +1 -116
  44. package/lib/module/utils/copySettingsStorage.js +1 -37
  45. package/lib/module/utils/correlationUtils.js +1 -120
  46. package/lib/module/utils/eventExportFormatter.js +1 -1901
  47. package/lib/module/utils/eventTransformers.js +1 -487
  48. package/lib/module/utils/eventVisibility.js +1 -70
  49. package/lib/module/utils/testIDs.js +1 -83
  50. package/lib/web/index.mjs +9 -10
  51. package/package.json +3 -3
  52. package/lib/commonjs/components/EventsCopySettingsView.js.map +0 -1
  53. package/lib/commonjs/components/EventsModal.js.map +0 -1
  54. package/lib/commonjs/components/ReactQueryEventDetail.js.map +0 -1
  55. package/lib/commonjs/components/UnifiedEventDetail.js.map +0 -1
  56. package/lib/commonjs/components/UnifiedEventFilters.js.map +0 -1
  57. package/lib/commonjs/components/UnifiedEventItem.js.map +0 -1
  58. package/lib/commonjs/components/UnifiedEventList.js.map +0 -1
  59. package/lib/commonjs/components/UnifiedEventViewer.js.map +0 -1
  60. package/lib/commonjs/hooks/useUnifiedEvents.js.map +0 -1
  61. package/lib/commonjs/index.js.map +0 -1
  62. package/lib/commonjs/preset.js.map +0 -1
  63. package/lib/commonjs/sources/sourceIds.js.map +0 -1
  64. package/lib/commonjs/stores/unifiedEventStore.js.map +0 -1
  65. package/lib/commonjs/sync/eventsSyncAdapter.js.map +0 -1
  66. package/lib/commonjs/types/copySettings.js.map +0 -1
  67. package/lib/commonjs/types/index.js.map +0 -1
  68. package/lib/commonjs/utils/autoDiscoverEventSources.js.map +0 -1
  69. package/lib/commonjs/utils/badgeSelectionStorage.js.map +0 -1
  70. package/lib/commonjs/utils/copySettingsStorage.js.map +0 -1
  71. package/lib/commonjs/utils/correlationUtils.js.map +0 -1
  72. package/lib/commonjs/utils/eventExportFormatter.js.map +0 -1
  73. package/lib/commonjs/utils/eventTransformers.js.map +0 -1
  74. package/lib/commonjs/utils/eventVisibility.js.map +0 -1
  75. package/lib/commonjs/utils/testIDs.js.map +0 -1
  76. package/lib/module/components/EventsCopySettingsView.js.map +0 -1
  77. package/lib/module/components/EventsModal.js.map +0 -1
  78. package/lib/module/components/ReactQueryEventDetail.js.map +0 -1
  79. package/lib/module/components/UnifiedEventDetail.js.map +0 -1
  80. package/lib/module/components/UnifiedEventFilters.js.map +0 -1
  81. package/lib/module/components/UnifiedEventItem.js.map +0 -1
  82. package/lib/module/components/UnifiedEventList.js.map +0 -1
  83. package/lib/module/components/UnifiedEventViewer.js.map +0 -1
  84. package/lib/module/hooks/useUnifiedEvents.js.map +0 -1
  85. package/lib/module/index.js.map +0 -1
  86. package/lib/module/preset.js.map +0 -1
  87. package/lib/module/sources/sourceIds.js.map +0 -1
  88. package/lib/module/stores/unifiedEventStore.js.map +0 -1
  89. package/lib/module/sync/eventsSyncAdapter.js.map +0 -1
  90. package/lib/module/types/copySettings.js.map +0 -1
  91. package/lib/module/types/index.js.map +0 -1
  92. package/lib/module/utils/autoDiscoverEventSources.js.map +0 -1
  93. package/lib/module/utils/badgeSelectionStorage.js.map +0 -1
  94. package/lib/module/utils/copySettingsStorage.js.map +0 -1
  95. package/lib/module/utils/correlationUtils.js.map +0 -1
  96. package/lib/module/utils/eventExportFormatter.js.map +0 -1
  97. package/lib/module/utils/eventTransformers.js.map +0 -1
  98. package/lib/module/utils/eventVisibility.js.map +0 -1
  99. package/lib/module/utils/testIDs.js.map +0 -1
  100. package/lib/typescript/components/EventsCopySettingsView.d.ts.map +0 -1
  101. package/lib/typescript/components/EventsModal.d.ts.map +0 -1
  102. package/lib/typescript/components/ReactQueryEventDetail.d.ts.map +0 -1
  103. package/lib/typescript/components/UnifiedEventDetail.d.ts.map +0 -1
  104. package/lib/typescript/components/UnifiedEventFilters.d.ts.map +0 -1
  105. package/lib/typescript/components/UnifiedEventItem.d.ts.map +0 -1
  106. package/lib/typescript/components/UnifiedEventList.d.ts.map +0 -1
  107. package/lib/typescript/components/UnifiedEventViewer.d.ts.map +0 -1
  108. package/lib/typescript/hooks/useUnifiedEvents.d.ts.map +0 -1
  109. package/lib/typescript/index.d.ts.map +0 -1
  110. package/lib/typescript/preset.d.ts.map +0 -1
  111. package/lib/typescript/sources/sourceIds.d.ts.map +0 -1
  112. package/lib/typescript/stores/unifiedEventStore.d.ts.map +0 -1
  113. package/lib/typescript/sync/eventsSyncAdapter.d.ts.map +0 -1
  114. package/lib/typescript/types/copySettings.d.ts.map +0 -1
  115. package/lib/typescript/types/index.d.ts.map +0 -1
  116. package/lib/typescript/utils/autoDiscoverEventSources.d.ts.map +0 -1
  117. package/lib/typescript/utils/badgeSelectionStorage.d.ts.map +0 -1
  118. package/lib/typescript/utils/copySettingsStorage.d.ts.map +0 -1
  119. package/lib/typescript/utils/correlationUtils.d.ts.map +0 -1
  120. package/lib/typescript/utils/eventExportFormatter.d.ts.map +0 -1
  121. package/lib/typescript/utils/eventTransformers.d.ts.map +0 -1
  122. package/lib/typescript/utils/eventVisibility.d.ts.map +0 -1
  123. package/lib/typescript/utils/testIDs.d.ts.map +0 -1
@@ -1,433 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ReactQueryEventDetail = void 0;
7
- var _react = require("react");
8
- var _reactNative = require("react-native");
9
- var _sharedUi = require("@buoy-gg/shared-ui");
10
- var _dataViewer = require("@buoy-gg/shared-ui/dataViewer");
11
- var _jsxRuntime = require("react/jsx-runtime");
12
- /**
13
- * ReactQueryEventDetail
14
- *
15
- * Detail view for React Query events in the Events DevTools.
16
- * Styled similarly to the React Query DevTools detail view.
17
- *
18
- * Uses local type definitions to avoid hard dependency on @buoy-gg/react-query.
19
- */
20
-
21
- /**
22
- * Extended React Query event with additional data fields
23
- */
24
-
25
- /**
26
- * Event type display configuration
27
- */
28
- const EVENT_TYPE_CONFIG = {
29
- "query-fetch-start": {
30
- label: "Query Fetching",
31
- color: _sharedUi.night.color.accent,
32
- icon: "hourglass"
33
- },
34
- "query-fetch-success": {
35
- label: "Query Success",
36
- color: _sharedUi.buoyColors.success,
37
- icon: "checkmark"
38
- },
39
- "query-fetch-error": {
40
- label: "Query Error",
41
- color: _sharedUi.buoyColors.error,
42
- icon: "close"
43
- },
44
- "query-invalidated": {
45
- label: "Query Invalidated",
46
- color: _sharedUi.buoyColors.warning,
47
- icon: "refresh"
48
- },
49
- "mutation-start": {
50
- label: "Mutation Started",
51
- color: _sharedUi.night.color.accent,
52
- icon: "hourglass"
53
- },
54
- "mutation-success": {
55
- label: "Mutation Success",
56
- color: _sharedUi.buoyColors.success,
57
- icon: "checkmark"
58
- },
59
- "mutation-error": {
60
- label: "Mutation Error",
61
- color: _sharedUi.buoyColors.error,
62
- icon: "close"
63
- }
64
- };
65
- const ReactQueryEventDetail = exports.ReactQueryEventDetail = /*#__PURE__*/(0, _react.memo)(function ReactQueryEventDetail({
66
- event
67
- }) {
68
- const reactQueryEvent = event.originalEvent;
69
- const eventConfig = EVENT_TYPE_CONFIG[reactQueryEvent.type] || {
70
- label: reactQueryEvent.type,
71
- color: _sharedUi.night.color.textTertiary,
72
- icon: "help"
73
- };
74
- const isQuery = reactQueryEvent.type.startsWith("query-");
75
- const isMutation = reactQueryEvent.type.startsWith("mutation-");
76
-
77
- // Format query/mutation key for display
78
- const keyDisplay = (0, _react.useMemo)(() => {
79
- const key = isQuery ? reactQueryEvent.queryKey : reactQueryEvent.mutationKey;
80
- if (!key) {
81
- // For mutations without a key, show the mutation ID
82
- if (isMutation && reactQueryEvent.mutationId !== undefined) {
83
- return `Mutation #${reactQueryEvent.mutationId}`;
84
- }
85
- return "No key";
86
- }
87
- return (0, _sharedUi.displayValue)(key, true);
88
- }, [reactQueryEvent, isQuery, isMutation]);
89
-
90
- // Format timestamp
91
- const timestamp = new Date(reactQueryEvent.timestamp);
92
- const timeString = timestamp.toLocaleTimeString("en-US", {
93
- hour: "2-digit",
94
- minute: "2-digit",
95
- second: "2-digit",
96
- hour12: true
97
- });
98
-
99
- // Determine what data to show
100
- const hasData = isQuery ? !!reactQueryEvent.queryData : !!reactQueryEvent.mutationData;
101
- const hasError = isQuery ? !!reactQueryEvent.queryError : !!reactQueryEvent.mutationError;
102
- const hasVariables = isMutation && !!reactQueryEvent.mutationVariables;
103
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
104
- style: styles.container,
105
- contentContainerStyle: styles.contentContainer,
106
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
107
- style: styles.section,
108
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
109
- style: [styles.eventTypeContainer, {
110
- borderColor: eventConfig.color + "4D"
111
- }],
112
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
113
- style: [styles.eventTypeHeader, {
114
- backgroundColor: eventConfig.color + "15",
115
- color: eventConfig.color
116
- }],
117
- children: eventConfig.label
118
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
119
- style: styles.eventTypeContent,
120
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
121
- style: styles.keyRow,
122
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
123
- horizontal: true,
124
- style: styles.keyScrollView,
125
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
126
- style: styles.keyText,
127
- children: keyDisplay
128
- })
129
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(EventStatusChip, {
130
- type: reactQueryEvent.type,
131
- color: eventConfig.color
132
- })]
133
- }), reactQueryEvent.duration !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
134
- style: styles.row,
135
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
136
- style: styles.labelText,
137
- children: "Duration:"
138
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
139
- style: styles.valueText,
140
- children: [reactQueryEvent.duration.toFixed(0), "ms"]
141
- })]
142
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
143
- style: styles.row,
144
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
145
- style: styles.labelText,
146
- children: "Timestamp:"
147
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
148
- style: styles.valueText,
149
- children: timeString
150
- })]
151
- }), isQuery && reactQueryEvent.queryHash && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
152
- style: styles.row,
153
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
154
- style: styles.labelText,
155
- children: "Query Hash:"
156
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
157
- style: [styles.valueText, styles.hashText],
158
- numberOfLines: 1,
159
- children: reactQueryEvent.queryHash
160
- })]
161
- }), isMutation && reactQueryEvent.mutationId !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
162
- style: styles.row,
163
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
164
- style: styles.labelText,
165
- children: "Mutation ID:"
166
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
167
- style: styles.valueText,
168
- children: ["#", reactQueryEvent.mutationId]
169
- })]
170
- })]
171
- })]
172
- })
173
- }), hasVariables && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
174
- style: styles.section,
175
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
176
- style: styles.dataContainer,
177
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
178
- style: [styles.dataHeader, {
179
- color: _sharedUi.buoyColors.warning
180
- }],
181
- children: "Variables"
182
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
183
- style: styles.dataContent,
184
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_dataViewer.DataViewer, {
185
- title: "",
186
- data: reactQueryEvent.mutationVariables,
187
- showTypeFilter: true,
188
- rawMode: true,
189
- initialExpanded: true
190
- })
191
- })]
192
- })
193
- }), hasData && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
194
- style: styles.section,
195
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
196
- style: styles.dataContainer,
197
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
198
- style: [styles.dataHeader, {
199
- color: _sharedUi.buoyColors.success
200
- }],
201
- children: isQuery ? "Query Data" : "Mutation Result"
202
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
203
- style: styles.dataContent,
204
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_dataViewer.DataViewer, {
205
- title: "",
206
- data: isQuery ? reactQueryEvent.queryData : reactQueryEvent.mutationData,
207
- showTypeFilter: true,
208
- rawMode: true,
209
- initialExpanded: true
210
- })
211
- })]
212
- })
213
- }), hasError && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
214
- style: styles.section,
215
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
216
- style: [styles.dataContainer, styles.errorContainer],
217
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
218
- style: [styles.dataHeader, styles.errorHeader],
219
- children: "Error"
220
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
221
- style: styles.dataContent,
222
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_dataViewer.DataViewer, {
223
- title: "",
224
- data: isQuery ? reactQueryEvent.queryError : reactQueryEvent.mutationError,
225
- showTypeFilter: true,
226
- rawMode: true,
227
- initialExpanded: true
228
- })
229
- })]
230
- })
231
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
232
- style: styles.section,
233
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
234
- style: styles.dataContainer,
235
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
236
- style: styles.dataHeader,
237
- children: "Event Details"
238
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
239
- style: styles.dataContent,
240
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_dataViewer.DataViewer, {
241
- title: "",
242
- data: reactQueryEvent,
243
- showTypeFilter: true,
244
- rawMode: true,
245
- initialExpanded: false
246
- })
247
- })]
248
- })
249
- })]
250
- });
251
- });
252
-
253
- /**
254
- * Status chip component for event type
255
- */
256
- function EventStatusChip({
257
- type,
258
- color
259
- }) {
260
- const getStatusLabel = () => {
261
- if (type.includes("start")) return "PENDING";
262
- if (type.includes("success")) return "SUCCESS";
263
- if (type.includes("error")) return "ERROR";
264
- if (type.includes("invalidated")) return "INVALIDATED";
265
- return type.toUpperCase();
266
- };
267
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
268
- style: [styles.statusChip, {
269
- backgroundColor: color + "15",
270
- borderColor: color + "33"
271
- }],
272
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
273
- style: [styles.statusChipText, {
274
- color
275
- }],
276
- children: getStatusLabel()
277
- })
278
- });
279
- }
280
- const styles = _reactNative.StyleSheet.create({
281
- container: {
282
- flex: 1,
283
- // Transparent so the night sheet's star field shows through.
284
- backgroundColor: "transparent"
285
- },
286
- contentContainer: {
287
- padding: 8,
288
- paddingBottom: 24
289
- },
290
- section: {
291
- marginBottom: 12
292
- },
293
- // Event type container (like QueryDetails)
294
- eventTypeContainer: {
295
- minWidth: 200,
296
- backgroundColor: _sharedUi.night.color.surface,
297
- borderRadius: 6,
298
- borderWidth: 1,
299
- overflow: "hidden",
300
- shadowColor: _sharedUi.night.color.accent,
301
- shadowOffset: {
302
- width: 0,
303
- height: 0
304
- },
305
- shadowOpacity: 0.1,
306
- shadowRadius: 6
307
- },
308
- eventTypeHeader: {
309
- paddingHorizontal: 12,
310
- paddingVertical: 10,
311
- fontWeight: "600",
312
- fontSize: 12,
313
- borderBottomWidth: 1,
314
- borderBottomColor: _sharedUi.night.color.accentBorder,
315
- letterSpacing: 0.5,
316
- textTransform: "uppercase",
317
- fontFamily: _sharedUi.monoFont
318
- },
319
- eventTypeContent: {
320
- padding: 0
321
- },
322
- keyRow: {
323
- flexDirection: "row",
324
- justifyContent: "space-between",
325
- alignItems: "center",
326
- paddingHorizontal: 12,
327
- paddingVertical: 10,
328
- borderBottomWidth: 1,
329
- borderBottomColor: _sharedUi.night.color.separator
330
- },
331
- keyScrollView: {
332
- flex: 1,
333
- marginRight: 8
334
- },
335
- keyText: {
336
- fontSize: 12,
337
- color: _sharedUi.night.color.text,
338
- fontFamily: _sharedUi.monoFont,
339
- lineHeight: 18,
340
- backgroundColor: _sharedUi.night.color.accentSoft,
341
- paddingHorizontal: 8,
342
- paddingVertical: 4,
343
- borderRadius: 4,
344
- borderWidth: 1,
345
- borderColor: _sharedUi.night.color.accentBorderStrong
346
- },
347
- row: {
348
- flexDirection: "row",
349
- justifyContent: "space-between",
350
- alignItems: "center",
351
- paddingHorizontal: 12,
352
- paddingVertical: 10,
353
- borderBottomWidth: 1,
354
- borderBottomColor: _sharedUi.night.color.separator
355
- },
356
- labelText: {
357
- fontSize: 10,
358
- color: _sharedUi.night.color.textSecondary,
359
- fontWeight: "600",
360
- letterSpacing: 0.5,
361
- textTransform: "uppercase",
362
- fontFamily: _sharedUi.monoFont
363
- },
364
- valueText: {
365
- fontSize: 12,
366
- color: _sharedUi.night.color.text,
367
- fontWeight: "500",
368
- fontVariant: ["tabular-nums"],
369
- fontFamily: _sharedUi.monoFont
370
- },
371
- hashText: {
372
- flex: 1,
373
- textAlign: "right",
374
- marginLeft: 8
375
- },
376
- // Status chip
377
- statusChip: {
378
- paddingHorizontal: 8,
379
- paddingVertical: 4,
380
- borderWidth: 1,
381
- borderRadius: 6,
382
- alignSelf: "flex-start"
383
- },
384
- statusChipText: {
385
- fontSize: 11,
386
- fontWeight: "600",
387
- textTransform: "uppercase",
388
- letterSpacing: 0.5,
389
- fontFamily: _sharedUi.monoFont
390
- },
391
- // Data containers
392
- dataContainer: {
393
- minWidth: 200,
394
- backgroundColor: _sharedUi.night.color.surface,
395
- borderRadius: 6,
396
- borderWidth: 1,
397
- borderColor: _sharedUi.night.color.accentBorderStrong,
398
- overflow: "hidden",
399
- shadowColor: _sharedUi.night.color.accent,
400
- shadowOffset: {
401
- width: 0,
402
- height: 0
403
- },
404
- shadowOpacity: 0.1,
405
- shadowRadius: 6
406
- },
407
- dataHeader: {
408
- backgroundColor: _sharedUi.night.color.accentSoft,
409
- paddingHorizontal: 12,
410
- paddingVertical: 10,
411
- fontWeight: "600",
412
- fontSize: 12,
413
- color: _sharedUi.night.color.accent,
414
- borderBottomWidth: 1,
415
- borderBottomColor: _sharedUi.night.color.accentBorder,
416
- letterSpacing: 0.5,
417
- textTransform: "uppercase",
418
- fontFamily: _sharedUi.monoFont
419
- },
420
- dataContent: {
421
- padding: 8
422
- },
423
- // Error container
424
- errorContainer: {
425
- borderColor: _sharedUi.buoyColors.error + "4D"
426
- },
427
- errorHeader: {
428
- backgroundColor: _sharedUi.buoyColors.error + "1A",
429
- color: _sharedUi.buoyColors.error,
430
- borderBottomColor: _sharedUi.buoyColors.error + "33"
431
- }
432
- });
433
- //# sourceMappingURL=ReactQueryEventDetail.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ReactQueryEventDetail=void 0;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _jsxRuntime=require("react/jsx-runtime");const EVENT_TYPE_CONFIG={"query-fetch-start":{label:"Query Fetching",color:_sharedUi.night.color.accent,icon:"hourglass"},"query-fetch-success":{label:"Query Success",color:_sharedUi.buoyColors.success,icon:"checkmark"},"query-fetch-error":{label:"Query Error",color:_sharedUi.buoyColors.error,icon:"close"},"query-invalidated":{label:"Query Invalidated",color:_sharedUi.buoyColors.warning,icon:"refresh"},"mutation-start":{label:"Mutation Started",color:_sharedUi.night.color.accent,icon:"hourglass"},"mutation-success":{label:"Mutation Success",color:_sharedUi.buoyColors.success,icon:"checkmark"},"mutation-error":{label:"Mutation Error",color:_sharedUi.buoyColors.error,icon:"close"}};const ReactQueryEventDetail=exports.ReactQueryEventDetail=(0,_react.memo)(function r({event:o}){const e=o.originalEvent;const n=EVENT_TYPE_CONFIG[e.type]||{label:e.type,color:_sharedUi.night.color.textTertiary,icon:"help"};const t=e.type.startsWith("query-");const i=e.type.startsWith("mutation-");const l=(0,_react.useMemo)(()=>{const a=t?e.queryKey:e.mutationKey;if(!a){if(i&&e.mutationId!==void 0){return`Mutation #${e.mutationId}`}return"No key"}return(0,_sharedUi.displayValue)(a,true)},[e,t,i]);const s=new Date(e.timestamp);const c=s.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:true});const d=t?!!e.queryData:!!e.mutationData;const u=t?!!e.queryError:!!e.mutationError;const h=i&&!!e.mutationVariables;return(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{style:styles.container,contentContainerStyle:styles.contentContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.eventTypeContainer,{borderColor:n.color+"4D"}],children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.eventTypeHeader,{backgroundColor:n.color+"15",color:n.color}],children:n.label}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.eventTypeContent,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.keyRow,children:[(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{horizontal:true,style:styles.keyScrollView,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.keyText,children:l})}),(0,_jsxRuntime.jsx)(EventStatusChip,{type:e.type,color:n.color})]}),e.duration!==void 0&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.labelText,children:"Duration:"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.valueText,children:[e.duration.toFixed(0),"ms"]})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.labelText,children:"Timestamp:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.valueText,children:c})]}),t&&e.queryHash&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.labelText,children:"Query Hash:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.valueText,styles.hashText],numberOfLines:1,children:e.queryHash})]}),i&&e.mutationId!==void 0&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.labelText,children:"Mutation ID:"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.valueText,children:["#",e.mutationId]})]})]})]})}),h&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.dataContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.dataHeader,{color:_sharedUi.buoyColors.warning}],children:"Variables"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContent,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:e.mutationVariables,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})}),d&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.dataContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.dataHeader,{color:_sharedUi.buoyColors.success}],children:t?"Query Data":"Mutation Result"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContent,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:t?e.queryData:e.mutationData,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})}),u&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.dataContainer,styles.errorContainer],children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.dataHeader,styles.errorHeader],children:"Error"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContent,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:t?e.queryError:e.mutationError,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.dataContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.dataHeader,children:"Event Details"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContent,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:e,showTypeFilter:true,rawMode:true,initialExpanded:false})})]})})]})});function EventStatusChip({type:r,color:o}){const e=()=>{if(r.includes("start"))return"PENDING";if(r.includes("success"))return"SUCCESS";if(r.includes("error"))return"ERROR";if(r.includes("invalidated"))return"INVALIDATED";return r.toUpperCase()};return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.statusChip,{backgroundColor:o+"15",borderColor:o+"33"}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.statusChipText,{color:o}],children:e()})})}const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:"transparent"},contentContainer:{padding:8,paddingBottom:24},section:{marginBottom:12},eventTypeContainer:{minWidth:200,backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,overflow:"hidden",shadowColor:_sharedUi.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},eventTypeHeader:{paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.accentBorder,letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},eventTypeContent:{padding:0},keyRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.separator},keyScrollView:{flex:1,marginRight:8},keyText:{fontSize:12,color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont,lineHeight:18,backgroundColor:_sharedUi.night.color.accentSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:_sharedUi.night.color.accentBorderStrong},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.separator},labelText:{fontSize:10,color:_sharedUi.night.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},valueText:{fontSize:12,color:_sharedUi.night.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:_sharedUi.monoFont},hashText:{flex:1,textAlign:"right",marginLeft:8},statusChip:{paddingHorizontal:8,paddingVertical:4,borderWidth:1,borderRadius:6,alignSelf:"flex-start"},statusChipText:{fontSize:11,fontWeight:"600",textTransform:"uppercase",letterSpacing:.5,fontFamily:_sharedUi.monoFont},dataContainer:{minWidth:200,backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.accentBorderStrong,overflow:"hidden",shadowColor:_sharedUi.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},dataHeader:{backgroundColor:_sharedUi.night.color.accentSoft,paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:_sharedUi.night.color.accent,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.accentBorder,letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},dataContent:{padding:8},errorContainer:{borderColor:_sharedUi.buoyColors.error+"4D"},errorHeader:{backgroundColor:_sharedUi.buoyColors.error+"1A",color:_sharedUi.buoyColors.error,borderBottomColor:_sharedUi.buoyColors.error+"33"}});