@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,565 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.UnifiedEventDetail = void 0;
7
- var _utils = require("@buoy-gg/shared-ui/utils");
8
- var _reactNative = require("react-native");
9
- var _react = require("react");
10
- var _sharedUi = require("@buoy-gg/shared-ui");
11
- var _dataViewer = require("@buoy-gg/shared-ui/dataViewer");
12
- var _ReactQueryEventDetail = require("./ReactQueryEventDetail");
13
- var _testIDs = require("../utils/testIDs");
14
- var _jsxRuntime = require("react/jsx-runtime");
15
- /**
16
- * UnifiedEventDetail
17
- *
18
- * Detail view for a single unified event.
19
- * Uses shared detail components from other packages when available,
20
- * falls back to generic DataViewer when packages aren't installed.
21
- */
22
-
23
- // ============================================================================
24
- // Optional Component Loading
25
- // ============================================================================
26
-
27
- function tryLoadOptionalDetailComponents() {
28
- const components = {
29
- StorageEventDetailContent: null,
30
- ReduxActionDetailContent: null,
31
- NetworkEventDetailView: null,
32
- RenderDetailView: null,
33
- ZustandStateDetailContent: null,
34
- JotaiAtomDetailContent: null,
35
- RouteEventDetail: null
36
- };
37
-
38
- // Try to load storage detail component
39
- try {
40
- // @ts-ignore - Dynamic import that may not exist
41
- const storage = (0, _utils.loadToolModule)("@buoy-gg/storage");
42
- components.StorageEventDetailContent = storage.StorageEventDetailContent;
43
- } catch {
44
- // Optional dependency not installed
45
- }
46
-
47
- // Try to load redux detail component
48
- try {
49
- // @ts-ignore - Dynamic import that may not exist
50
- const redux = (0, _utils.loadToolModule)("@buoy-gg/redux");
51
- components.ReduxActionDetailContent = redux.ReduxActionDetailContent;
52
- } catch {
53
- // Optional dependency not installed
54
- }
55
-
56
- // Try to load network detail component
57
- try {
58
- // @ts-ignore - Dynamic import that may not exist
59
- const network = (0, _utils.loadToolModule)("@buoy-gg/network");
60
- components.NetworkEventDetailView = network.NetworkEventDetailView;
61
- } catch {
62
- // Optional dependency not installed
63
- }
64
-
65
- // Try to load render detail component
66
- try {
67
- // @ts-ignore - Dynamic import that may not exist
68
- const highlightUpdates = (0, _utils.loadToolModule)("@buoy-gg/highlight-updates");
69
- components.RenderDetailView = highlightUpdates.RenderDetailView;
70
- } catch {
71
- // Optional dependency not installed
72
- }
73
-
74
- // Try to load zustand detail component
75
- try {
76
- // @ts-ignore - Dynamic import that may not exist
77
- const zustand = (0, _utils.loadToolModule)("@buoy-gg/zustand");
78
- components.ZustandStateDetailContent = zustand.ZustandStateDetailContent;
79
- } catch {
80
- // Optional dependency not installed
81
- }
82
-
83
- // Try to load jotai detail component
84
- try {
85
- // @ts-ignore - Dynamic import that may not exist
86
- const jotai = (0, _utils.loadToolModule)("@buoy-gg/jotai");
87
- components.JotaiAtomDetailContent = jotai.JotaiAtomDetailContent;
88
- } catch {
89
- // Optional dependency not installed
90
- }
91
-
92
- // Try to load route detail component
93
- try {
94
- // @ts-ignore - Dynamic import that may not exist
95
- const routeEvents = (0, _utils.loadToolModule)("@buoy-gg/route-events");
96
- components.RouteEventDetail = routeEvents.RouteEventDetail;
97
- } catch {
98
- // Optional dependency not installed
99
- }
100
- return components;
101
- }
102
-
103
- // Cache loaded components
104
- let optionalComponents;
105
- let componentVersion = -1;
106
- function getOptionalComponents() {
107
- if (!optionalComponents || componentVersion !== (0, _utils.getToolModuleVersion)()) {
108
- optionalComponents = tryLoadOptionalDetailComponents();
109
- componentVersion = (0, _utils.getToolModuleVersion)();
110
- }
111
- return optionalComponents;
112
- }
113
-
114
- // ============================================================================
115
- // Configuration
116
- // ============================================================================
117
-
118
- /**
119
- * Source configuration for display
120
- */
121
- const SOURCE_CONFIG = {
122
- "storage-async": {
123
- label: "AsyncStorage",
124
- color: "#8B5CF6"
125
- },
126
- "storage-mmkv": {
127
- label: "MMKV",
128
- color: "#F59E0B"
129
- },
130
- redux: {
131
- label: "Redux",
132
- color: "#3B82F6"
133
- },
134
- network: {
135
- label: "Network",
136
- color: "#10B981"
137
- },
138
- "react-query": {
139
- label: "React Query",
140
- color: "#EC4899"
141
- },
142
- "react-query-query": {
143
- label: "Query",
144
- color: "#EC4899"
145
- },
146
- "react-query-mutation": {
147
- label: "Mutation",
148
- color: "#F97316"
149
- },
150
- route: {
151
- label: "Route",
152
- color: "#06B6D4"
153
- },
154
- zustand: {
155
- label: "Zustand",
156
- color: "#764ABC"
157
- },
158
- jotai: {
159
- label: "Jotai",
160
- color: "#14B8A6"
161
- },
162
- render: {
163
- label: "Render",
164
- color: "#F472B6"
165
- }
166
- };
167
-
168
- /**
169
- * Check if an event is a storage event
170
- */
171
- function isStorageEvent(source) {
172
- return source === "storage-async" || source === "storage-mmkv";
173
- }
174
-
175
- /**
176
- * Get value type from a value
177
- */
178
- function getValueType(value) {
179
- const parsed = (0, _sharedUi.parseValue)(value);
180
- if (parsed === null) return "null";
181
- if (parsed === undefined) return "undefined";
182
- if (Array.isArray(parsed)) return "array";
183
- if (typeof parsed === "boolean") return "boolean";
184
- if (typeof parsed === "number") return "number";
185
- if (typeof parsed === "string") return "string";
186
- if (typeof parsed === "object") return "object";
187
- return "undefined";
188
- }
189
-
190
- // ============================================================================
191
- // Component
192
- // ============================================================================
193
-
194
- /** Passthrough used when no network detail wrapper is injected. */
195
- function PassThrough({
196
- children
197
- }) {
198
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
199
- children: children
200
- });
201
- }
202
- const UnifiedEventDetail = exports.UnifiedEventDetail = /*#__PURE__*/(0, _react.memo)(function UnifiedEventDetail({
203
- event,
204
- onBack,
205
- NetworkEventDetailViewComponent,
206
- networkDetailWrapper,
207
- RouteEventDetailComponent,
208
- detailComponents,
209
- onNavigate
210
- }) {
211
- /**
212
- * One resolution point for every per-tool detail page: the `require`-loaded
213
- * set, overridden by whatever the host injected.
214
- */
215
- const resolved = (0, _react.useMemo)(() => ({
216
- ...getOptionalComponents(),
217
- ...detailComponents
218
- }), [detailComponents, (0, _utils.getToolModuleVersion)()]);
219
- const sourceConfig = SOURCE_CONFIG[event.source];
220
- const timestamp = new Date(event.timestamp);
221
- // Shared ignored-domain/URL patterns — drives the "Ignore Domain / Ignore URL
222
- // Pattern" toggles at the bottom of the network detail page so they actually
223
- // work here and stay in sync with the Network tool.
224
- const {
225
- values: ignoredPatternValues,
226
- toggle: toggleIgnoredPattern
227
- } = (0, _sharedUi.useIgnoredPatterns)();
228
-
229
- // For storage events, create a conversation object to use with StorageEventDetailContent
230
- const storageConversation = (0, _react.useMemo)(() => {
231
- if (!isStorageEvent(event.source)) return null;
232
- if (!resolved.StorageEventDetailContent) return null;
233
- const raw = event.originalEvent;
234
-
235
- /**
236
- * `timestamp` is a real `Date` in-process but an ISO STRING once the event
237
- * has crossed a sync transport, and `StorageEventDetailContent` calls
238
- * `date.getHours()` on it. `new Date(...)` is idempotent for a Date, so
239
- * normalising unconditionally costs nothing and covers both. The same
240
- * reasoning is why `event.timestamp` above is wrapped.
241
- */
242
- const originalEvent = {
243
- ...raw,
244
- timestamp: new Date(raw.timestamp)
245
- };
246
-
247
- // Create a conversation with a single event for the detail view
248
- return {
249
- key: originalEvent.data?.key || "unknown",
250
- lastEvent: originalEvent,
251
- events: [originalEvent],
252
- totalOperations: 1,
253
- currentValue: originalEvent.data?.value,
254
- valueType: getValueType(originalEvent.data?.value),
255
- storageTypes: new Set([originalEvent.storageType || "async"])
256
- };
257
- }, [event, resolved]);
258
-
259
- // For storage events, use the shared StorageEventDetailContent if available
260
- if (storageConversation && resolved.StorageEventDetailContent) {
261
- const {
262
- StorageEventDetailContent
263
- } = resolved;
264
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
265
- style: styles.container,
266
- testID: `${_testIDs.EVENTS_TEST_ID}-detail-storage`,
267
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StorageEventDetailContent, {
268
- conversation: storageConversation,
269
- selectedEventIndex: 0,
270
- onEventIndexChange: () => {},
271
- disableInternalFooter: true
272
- })
273
- });
274
- }
275
-
276
- // For Redux events, use the shared ReduxActionDetailContent if available
277
- if (event.source === "redux" && resolved.ReduxActionDetailContent) {
278
- const {
279
- ReduxActionDetailContent
280
- } = resolved;
281
- const reduxAction = event.originalEvent;
282
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
283
- style: styles.container,
284
- testID: `${_testIDs.EVENTS_TEST_ID}-detail-redux`,
285
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ReduxActionDetailContent, {
286
- action: reduxAction,
287
- actions: [reduxAction],
288
- selectedIndex: 0,
289
- onIndexChange: () => {},
290
- disableInternalFooter: true
291
- })
292
- });
293
- }
294
-
295
- // For network events, render the SAME NetworkEventDetailView the Network tool
296
- // uses. Prefer an injected component (desktop), fall back to the dynamically
297
- // required one (mobile). Wire the shared ignored-patterns so the bottom
298
- // "Ignore Domain / Ignore URL Pattern" toggles work, and wrap in the optional
299
- // body-resolver provider so large bodies can be fetched on demand.
300
- const NetworkDetailView = NetworkEventDetailViewComponent ?? resolved.NetworkEventDetailView;
301
- if (event.source === "network" && NetworkDetailView) {
302
- const networkEvent = event.originalEvent;
303
- const NetworkWrapper = networkDetailWrapper ?? PassThrough;
304
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
305
- style: styles.container,
306
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(NetworkWrapper, {
307
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
308
- style: styles.content,
309
- testID: `${_testIDs.EVENTS_TEST_ID}-detail-network`,
310
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(NetworkDetailView, {
311
- event: networkEvent,
312
- ignoredPatterns: ignoredPatternValues,
313
- onTogglePattern: toggleIgnoredPattern
314
- })
315
- })
316
- })
317
- });
318
- }
319
-
320
- // For React Query events, use the specialized ReactQueryEventDetail
321
- if (event.source === "react-query" || event.source === "react-query-query" || event.source === "react-query-mutation") {
322
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
323
- style: styles.container,
324
- testID: `${_testIDs.EVENTS_TEST_ID}-detail-react-query`,
325
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ReactQueryEventDetail.ReactQueryEventDetail, {
326
- event: event
327
- })
328
- });
329
- }
330
-
331
- // For Zustand events, use the shared ZustandStateDetailContent if available
332
- if (event.source === "zustand" && resolved.ZustandStateDetailContent) {
333
- const {
334
- ZustandStateDetailContent
335
- } = resolved;
336
- const zustandChange = event.originalEvent;
337
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
338
- style: styles.container,
339
- testID: `${_testIDs.EVENTS_TEST_ID}-detail-zustand`,
340
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ZustandStateDetailContent, {
341
- change: zustandChange,
342
- changes: [zustandChange],
343
- selectedIndex: 0,
344
- onIndexChange: () => {},
345
- disableInternalFooter: true
346
- })
347
- });
348
- }
349
-
350
- // For Jotai events, use the shared JotaiAtomDetailContent if available
351
- if (event.source === "jotai" && resolved.JotaiAtomDetailContent) {
352
- const {
353
- JotaiAtomDetailContent
354
- } = resolved;
355
- const jotaiChange = event.originalEvent;
356
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
357
- style: styles.container,
358
- testID: `${_testIDs.EVENTS_TEST_ID}-detail-jotai`,
359
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(JotaiAtomDetailContent, {
360
- change: jotaiChange,
361
- changes: [jotaiChange],
362
- selectedIndex: 0,
363
- onIndexChange: () => {},
364
- disableInternalFooter: true
365
- })
366
- });
367
- }
368
-
369
- // For render events, use the RenderDetailView if available
370
- if (event.source === "render" && resolved.RenderDetailView) {
371
- const {
372
- RenderDetailView
373
- } = resolved;
374
- const renderData = event.originalEvent;
375
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
376
- style: styles.container,
377
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
378
- style: styles.content,
379
- testID: `${_testIDs.EVENTS_TEST_ID}-detail-render`,
380
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(RenderDetailView, {
381
- render: renderData.render
382
- })
383
- })
384
- });
385
- }
386
-
387
- // For route events, render the SAME RouteEventDetail the Routes tool uses.
388
- // Prefer an injected component (desktop), fall back to the dynamically required
389
- // one (mobile). onNavigate powers the "Go to route" action.
390
- const RouteDetail = RouteEventDetailComponent ?? resolved.RouteEventDetail;
391
- if (event.source === "route" && RouteDetail) {
392
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
393
- style: styles.container,
394
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
395
- style: styles.container,
396
- testID: `${_testIDs.EVENTS_TEST_ID}-detail-route`,
397
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(RouteDetail, {
398
- event: event.originalEvent,
399
- onNavigate: onNavigate
400
- })
401
- })
402
- });
403
- }
404
-
405
- // For all other events (or when specific components aren't available), show the generic detail view
406
- const getEventData = () => {
407
- return event.originalEvent;
408
- };
409
- const handleCopy = async () => {
410
- await (0, _sharedUi.copyToClipboard)({
411
- source: event.source,
412
- timestamp: timestamp.toISOString(),
413
- title: event.title,
414
- subtitle: event.subtitle,
415
- data: getEventData()
416
- });
417
- };
418
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
419
- style: styles.container,
420
- testID: `${_testIDs.EVENTS_TEST_ID}-detail`,
421
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
422
- style: styles.content,
423
- contentContainerStyle: styles.contentContainer,
424
- testID: `${_testIDs.EVENTS_TEST_ID}-detail-scroll`,
425
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
426
- style: styles.sourceBadgeRow,
427
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
428
- style: [styles.sourceBadge, {
429
- backgroundColor: sourceConfig.color + "20"
430
- }],
431
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
432
- style: [styles.sourceDot, {
433
- backgroundColor: sourceConfig.color
434
- }]
435
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
436
- style: [styles.sourceLabel, {
437
- color: sourceConfig.color
438
- }],
439
- testID: `${_testIDs.EVENTS_TEST_ID}-detail-source`,
440
- children: sourceConfig.label
441
- })]
442
- })
443
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
444
- style: styles.title,
445
- testID: `${_testIDs.EVENTS_TEST_ID}-detail-title`,
446
- children: event.title
447
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
448
- style: styles.subtitle,
449
- testID: `${_testIDs.EVENTS_TEST_ID}-detail-subtitle`,
450
- children: event.subtitle
451
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
452
- style: styles.timestampRow,
453
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
454
- style: styles.timestampLabel,
455
- children: "Timestamp"
456
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
457
- style: styles.timestampValue,
458
- testID: `${_testIDs.EVENTS_TEST_ID}-detail-timestamp`,
459
- children: [timestamp.toLocaleTimeString(), " (", (0, _sharedUi.formatRelativeTime)(timestamp), ")"]
460
- })]
461
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
462
- style: styles.dataSection,
463
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
464
- style: styles.sectionLabel,
465
- children: "Event Data"
466
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
467
- style: styles.dataContainer,
468
- testID: `${_testIDs.EVENTS_TEST_ID}-detail-data`,
469
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_dataViewer.DataViewer, {
470
- testIDPrefix: `${_testIDs.EVENTS_TEST_ID}-detail-data`,
471
- data: getEventData(),
472
- title: "",
473
- showTypeFilter: true,
474
- rawMode: true,
475
- initialExpanded: true
476
- })
477
- })]
478
- })]
479
- })
480
- });
481
- });
482
- const styles = _reactNative.StyleSheet.create({
483
- container: {
484
- flex: 1,
485
- // Transparent so the night sheet's star field shows through.
486
- backgroundColor: "transparent"
487
- },
488
- content: {
489
- flex: 1
490
- },
491
- contentContainer: {
492
- padding: 16
493
- },
494
- sourceBadgeRow: {
495
- flexDirection: "row",
496
- marginBottom: 12
497
- },
498
- sourceBadge: {
499
- flexDirection: "row",
500
- alignItems: "center",
501
- paddingHorizontal: 10,
502
- paddingVertical: 6,
503
- borderRadius: 12,
504
- gap: 6
505
- },
506
- sourceDot: {
507
- width: 6,
508
- height: 6,
509
- borderRadius: 3
510
- },
511
- sourceLabel: {
512
- fontSize: 12,
513
- fontWeight: "600"
514
- },
515
- title: {
516
- fontSize: 24,
517
- fontWeight: "700",
518
- color: _sharedUi.night.color.text,
519
- marginBottom: 4
520
- },
521
- subtitle: {
522
- fontSize: 16,
523
- color: _sharedUi.night.color.textTertiary,
524
- marginBottom: 16
525
- },
526
- timestampRow: {
527
- flexDirection: "row",
528
- justifyContent: "space-between",
529
- alignItems: "center",
530
- paddingVertical: 12,
531
- borderTopWidth: 1,
532
- borderTopColor: _sharedUi.night.color.border,
533
- borderBottomWidth: 1,
534
- borderBottomColor: _sharedUi.night.color.border,
535
- marginBottom: 16
536
- },
537
- timestampLabel: {
538
- fontSize: 14,
539
- color: _sharedUi.night.color.textTertiary
540
- },
541
- timestampValue: {
542
- fontSize: 14,
543
- color: _sharedUi.night.color.text,
544
- fontFamily: _sharedUi.monoFont
545
- },
546
- dataSection: {
547
- marginTop: 8
548
- },
549
- sectionLabel: {
550
- fontSize: 12,
551
- fontWeight: "600",
552
- color: _sharedUi.night.color.textTertiary,
553
- textTransform: "uppercase",
554
- letterSpacing: 0.5,
555
- marginBottom: 8
556
- },
557
- dataContainer: {
558
- backgroundColor: _sharedUi.night.color.surface,
559
- borderRadius: 8,
560
- borderWidth: 1,
561
- borderColor: _sharedUi.night.color.border,
562
- overflow: "hidden"
563
- }
564
- });
565
- //# sourceMappingURL=UnifiedEventDetail.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.UnifiedEventDetail=void 0;var _utils=require("@buoy-gg/shared-ui/utils");var _reactNative=require("react-native");var _react=require("react");var _sharedUi=require("@buoy-gg/shared-ui");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _ReactQueryEventDetail=require("./ReactQueryEventDetail");var _testIDs=require("../utils/testIDs");var _jsxRuntime=require("react/jsx-runtime");function tryLoadOptionalDetailComponents(){const o={StorageEventDetailContent:null,ReduxActionDetailContent:null,NetworkEventDetailView:null,RenderDetailView:null,ZustandStateDetailContent:null,JotaiAtomDetailContent:null,RouteEventDetail:null};try{const e=(0,_utils.loadToolModule)("@buoy-gg/storage");o.StorageEventDetailContent=e.StorageEventDetailContent}catch{}try{const e=(0,_utils.loadToolModule)("@buoy-gg/redux");o.ReduxActionDetailContent=e.ReduxActionDetailContent}catch{}try{const e=(0,_utils.loadToolModule)("@buoy-gg/network");o.NetworkEventDetailView=e.NetworkEventDetailView}catch{}try{const e=(0,_utils.loadToolModule)("@buoy-gg/highlight-updates");o.RenderDetailView=e.RenderDetailView}catch{}try{const e=(0,_utils.loadToolModule)("@buoy-gg/zustand");o.ZustandStateDetailContent=e.ZustandStateDetailContent}catch{}try{const e=(0,_utils.loadToolModule)("@buoy-gg/jotai");o.JotaiAtomDetailContent=e.JotaiAtomDetailContent}catch{}try{const e=(0,_utils.loadToolModule)("@buoy-gg/route-events");o.RouteEventDetail=e.RouteEventDetail}catch{}return o}let optionalComponents;let componentVersion=-1;function getOptionalComponents(){if(!optionalComponents||componentVersion!==(0,_utils.getToolModuleVersion)()){optionalComponents=tryLoadOptionalDetailComponents();componentVersion=(0,_utils.getToolModuleVersion)()}return optionalComponents}const SOURCE_CONFIG={"storage-async":{label:"AsyncStorage",color:"#8B5CF6"},"storage-mmkv":{label:"MMKV",color:"#F59E0B"},redux:{label:"Redux",color:"#3B82F6"},network:{label:"Network",color:"#10B981"},"react-query":{label:"React Query",color:"#EC4899"},"react-query-query":{label:"Query",color:"#EC4899"},"react-query-mutation":{label:"Mutation",color:"#F97316"},route:{label:"Route",color:"#06B6D4"},zustand:{label:"Zustand",color:"#764ABC"},jotai:{label:"Jotai",color:"#14B8A6"},render:{label:"Render",color:"#F472B6"}};function isStorageEvent(o){return o==="storage-async"||o==="storage-mmkv"}function getValueType(o){const e=(0,_sharedUi.parseValue)(o);if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"array";if(typeof e==="boolean")return"boolean";if(typeof e==="number")return"number";if(typeof e==="string")return"string";if(typeof e==="object")return"object";return"undefined"}function PassThrough({children:o}){return(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:o})}const UnifiedEventDetail=exports.UnifiedEventDetail=(0,_react.memo)(function o({event:e,onBack:h,NetworkEventDetailViewComponent:g,networkDetailWrapper:E,RouteEventDetailComponent:D,detailComponents:l,onNavigate:y}){const n=(0,_react.useMemo)(()=>({...getOptionalComponents(),...l}),[l,(0,_utils.getToolModuleVersion)()]);const a=SOURCE_CONFIG[e.source];const i=new Date(e.timestamp);const{values:T,toggle:x}=(0,_sharedUi.useIgnoredPatterns)();const s=(0,_react.useMemo)(()=>{if(!isStorageEvent(e.source))return null;if(!n.StorageEventDetailContent)return null;const r=e.originalEvent;const t={...r,timestamp:new Date(r.timestamp)};return{key:t.data?.key||"unknown",lastEvent:t,events:[t],totalOperations:1,currentValue:t.data?.value,valueType:getValueType(t.data?.value),storageTypes:new Set([t.storageType||"async"])}},[e,n]);if(s&&n.StorageEventDetailContent){const{StorageEventDetailContent:r}=n;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,testID:`${_testIDs.EVENTS_TEST_ID}-detail-storage`,children:(0,_jsxRuntime.jsx)(r,{conversation:s,selectedEventIndex:0,onEventIndexChange:()=>{},disableInternalFooter:true})})}if(e.source==="redux"&&n.ReduxActionDetailContent){const{ReduxActionDetailContent:r}=n;const t=e.originalEvent;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,testID:`${_testIDs.EVENTS_TEST_ID}-detail-redux`,children:(0,_jsxRuntime.jsx)(r,{action:t,actions:[t],selectedIndex:0,onIndexChange:()=>{},disableInternalFooter:true})})}const c=g??n.NetworkEventDetailView;if(e.source==="network"&&c){const r=e.originalEvent;const t=E??PassThrough;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,children:(0,_jsxRuntime.jsx)(t,{children:(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:styles.content,testID:`${_testIDs.EVENTS_TEST_ID}-detail-network`,children:(0,_jsxRuntime.jsx)(c,{event:r,ignoredPatterns:T,onTogglePattern:x})})})})}if(e.source==="react-query"||e.source==="react-query-query"||e.source==="react-query-mutation"){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,testID:`${_testIDs.EVENTS_TEST_ID}-detail-react-query`,children:(0,_jsxRuntime.jsx)(_ReactQueryEventDetail.ReactQueryEventDetail,{event:e})})}if(e.source==="zustand"&&n.ZustandStateDetailContent){const{ZustandStateDetailContent:r}=n;const t=e.originalEvent;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,testID:`${_testIDs.EVENTS_TEST_ID}-detail-zustand`,children:(0,_jsxRuntime.jsx)(r,{change:t,changes:[t],selectedIndex:0,onIndexChange:()=>{},disableInternalFooter:true})})}if(e.source==="jotai"&&n.JotaiAtomDetailContent){const{JotaiAtomDetailContent:r}=n;const t=e.originalEvent;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,testID:`${_testIDs.EVENTS_TEST_ID}-detail-jotai`,children:(0,_jsxRuntime.jsx)(r,{change:t,changes:[t],selectedIndex:0,onIndexChange:()=>{},disableInternalFooter:true})})}if(e.source==="render"&&n.RenderDetailView){const{RenderDetailView:r}=n;const t=e.originalEvent;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,children:(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:styles.content,testID:`${_testIDs.EVENTS_TEST_ID}-detail-render`,children:(0,_jsxRuntime.jsx)(r,{render:t.render})})})}const u=D??n.RouteEventDetail;if(e.source==="route"&&u){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,testID:`${_testIDs.EVENTS_TEST_ID}-detail-route`,children:(0,_jsxRuntime.jsx)(u,{event:e.originalEvent,onNavigate:y})})})}const d=()=>{return e.originalEvent};const m=async()=>{await(0,_sharedUi.copyToClipboard)({source:e.source,timestamp:i.toISOString(),title:e.title,subtitle:e.subtitle,data:d()})};return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,testID:`${_testIDs.EVENTS_TEST_ID}-detail`,children:(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{style:styles.content,contentContainerStyle:styles.contentContainer,testID:`${_testIDs.EVENTS_TEST_ID}-detail-scroll`,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.sourceBadgeRow,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.sourceBadge,{backgroundColor:a.color+"20"}],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.sourceDot,{backgroundColor:a.color}]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.sourceLabel,{color:a.color}],testID:`${_testIDs.EVENTS_TEST_ID}-detail-source`,children:a.label})]})}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.title,testID:`${_testIDs.EVENTS_TEST_ID}-detail-title`,children:e.title}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.subtitle,testID:`${_testIDs.EVENTS_TEST_ID}-detail-subtitle`,children:e.subtitle}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timestampRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.timestampLabel,children:"Timestamp"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.timestampValue,testID:`${_testIDs.EVENTS_TEST_ID}-detail-timestamp`,children:[i.toLocaleTimeString()," (",(0,_sharedUi.formatRelativeTime)(i),")"]})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.dataSection,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionLabel,children:"Event Data"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContainer,testID:`${_testIDs.EVENTS_TEST_ID}-detail-data`,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{testIDPrefix:`${_testIDs.EVENTS_TEST_ID}-detail-data`,data:d(),title:"",showTypeFilter:true,rawMode:true,initialExpanded:true})})]})]})})});const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:"transparent"},content:{flex:1},contentContainer:{padding:16},sourceBadgeRow:{flexDirection:"row",marginBottom:12},sourceBadge:{flexDirection:"row",alignItems:"center",paddingHorizontal:10,paddingVertical:6,borderRadius:12,gap:6},sourceDot:{width:6,height:6,borderRadius:3},sourceLabel:{fontSize:12,fontWeight:"600"},title:{fontSize:24,fontWeight:"700",color:_sharedUi.night.color.text,marginBottom:4},subtitle:{fontSize:16,color:_sharedUi.night.color.textTertiary,marginBottom:16},timestampRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:12,borderTopWidth:1,borderTopColor:_sharedUi.night.color.border,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.border,marginBottom:16},timestampLabel:{fontSize:14,color:_sharedUi.night.color.textTertiary},timestampValue:{fontSize:14,color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont},dataSection:{marginTop:8},sectionLabel:{fontSize:12,fontWeight:"600",color:_sharedUi.night.color.textTertiary,textTransform:"uppercase",letterSpacing:.5,marginBottom:8},dataContainer:{backgroundColor:_sharedUi.night.color.surface,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,overflow:"hidden"}});