@buoy-gg/events 7.0.40 → 7.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/README.md +11 -60
  2. package/lib/commonjs/components/EventsCopySettingsView.js +1 -581
  3. package/lib/commonjs/components/EventsModal.js +1 -387
  4. package/lib/commonjs/components/ReactQueryEventDetail.js +1 -433
  5. package/lib/commonjs/components/UnifiedEventDetail.js +1 -556
  6. package/lib/commonjs/components/UnifiedEventFilters.js +1 -160
  7. package/lib/commonjs/components/UnifiedEventItem.js +1 -417
  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 -1065
  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 -383
  28. package/lib/module/components/ReactQueryEventDetail.js +1 -429
  29. package/lib/module/components/UnifiedEventDetail.js +1 -552
  30. package/lib/module/components/UnifiedEventFilters.js +1 -156
  31. package/lib/module/components/UnifiedEventItem.js +1 -413
  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 -1057
  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/typescript/components/EventsModal.d.ts +1 -7
  51. package/lib/typescript/components/UnifiedEventDetail.d.ts +2 -9
  52. package/lib/typescript/components/UnifiedEventItem.d.ts +0 -7
  53. package/lib/web/index.mjs +12 -0
  54. package/package.json +31 -11
  55. package/lib/commonjs/components/EventsCopySettingsView.js.map +0 -1
  56. package/lib/commonjs/components/EventsModal.js.map +0 -1
  57. package/lib/commonjs/components/ReactQueryEventDetail.js.map +0 -1
  58. package/lib/commonjs/components/UnifiedEventDetail.js.map +0 -1
  59. package/lib/commonjs/components/UnifiedEventFilters.js.map +0 -1
  60. package/lib/commonjs/components/UnifiedEventItem.js.map +0 -1
  61. package/lib/commonjs/components/UnifiedEventList.js.map +0 -1
  62. package/lib/commonjs/components/UnifiedEventViewer.js.map +0 -1
  63. package/lib/commonjs/hooks/useUnifiedEvents.js.map +0 -1
  64. package/lib/commonjs/index.js.map +0 -1
  65. package/lib/commonjs/preset.js.map +0 -1
  66. package/lib/commonjs/sources/sourceIds.js.map +0 -1
  67. package/lib/commonjs/stores/unifiedEventStore.js.map +0 -1
  68. package/lib/commonjs/sync/eventsSyncAdapter.js.map +0 -1
  69. package/lib/commonjs/types/copySettings.js.map +0 -1
  70. package/lib/commonjs/types/index.js.map +0 -1
  71. package/lib/commonjs/utils/autoDiscoverEventSources.js.map +0 -1
  72. package/lib/commonjs/utils/badgeSelectionStorage.js.map +0 -1
  73. package/lib/commonjs/utils/copySettingsStorage.js.map +0 -1
  74. package/lib/commonjs/utils/correlationUtils.js.map +0 -1
  75. package/lib/commonjs/utils/eventExportFormatter.js.map +0 -1
  76. package/lib/commonjs/utils/eventTransformers.js.map +0 -1
  77. package/lib/commonjs/utils/eventVisibility.js.map +0 -1
  78. package/lib/commonjs/utils/testIDs.js.map +0 -1
  79. package/lib/module/components/EventsCopySettingsView.js.map +0 -1
  80. package/lib/module/components/EventsModal.js.map +0 -1
  81. package/lib/module/components/ReactQueryEventDetail.js.map +0 -1
  82. package/lib/module/components/UnifiedEventDetail.js.map +0 -1
  83. package/lib/module/components/UnifiedEventFilters.js.map +0 -1
  84. package/lib/module/components/UnifiedEventItem.js.map +0 -1
  85. package/lib/module/components/UnifiedEventList.js.map +0 -1
  86. package/lib/module/components/UnifiedEventViewer.js.map +0 -1
  87. package/lib/module/hooks/useUnifiedEvents.js.map +0 -1
  88. package/lib/module/index.js.map +0 -1
  89. package/lib/module/preset.js.map +0 -1
  90. package/lib/module/sources/sourceIds.js.map +0 -1
  91. package/lib/module/stores/unifiedEventStore.js.map +0 -1
  92. package/lib/module/sync/eventsSyncAdapter.js.map +0 -1
  93. package/lib/module/types/copySettings.js.map +0 -1
  94. package/lib/module/types/index.js.map +0 -1
  95. package/lib/module/utils/autoDiscoverEventSources.js.map +0 -1
  96. package/lib/module/utils/badgeSelectionStorage.js.map +0 -1
  97. package/lib/module/utils/copySettingsStorage.js.map +0 -1
  98. package/lib/module/utils/correlationUtils.js.map +0 -1
  99. package/lib/module/utils/eventExportFormatter.js.map +0 -1
  100. package/lib/module/utils/eventTransformers.js.map +0 -1
  101. package/lib/module/utils/eventVisibility.js.map +0 -1
  102. package/lib/module/utils/testIDs.js.map +0 -1
  103. package/lib/typescript/components/EventsCopySettingsView.d.ts.map +0 -1
  104. package/lib/typescript/components/EventsModal.d.ts.map +0 -1
  105. package/lib/typescript/components/ReactQueryEventDetail.d.ts.map +0 -1
  106. package/lib/typescript/components/UnifiedEventDetail.d.ts.map +0 -1
  107. package/lib/typescript/components/UnifiedEventFilters.d.ts.map +0 -1
  108. package/lib/typescript/components/UnifiedEventItem.d.ts.map +0 -1
  109. package/lib/typescript/components/UnifiedEventList.d.ts.map +0 -1
  110. package/lib/typescript/components/UnifiedEventViewer.d.ts.map +0 -1
  111. package/lib/typescript/hooks/useUnifiedEvents.d.ts.map +0 -1
  112. package/lib/typescript/index.d.ts.map +0 -1
  113. package/lib/typescript/preset.d.ts.map +0 -1
  114. package/lib/typescript/sources/sourceIds.d.ts.map +0 -1
  115. package/lib/typescript/stores/unifiedEventStore.d.ts.map +0 -1
  116. package/lib/typescript/sync/eventsSyncAdapter.d.ts.map +0 -1
  117. package/lib/typescript/types/copySettings.d.ts.map +0 -1
  118. package/lib/typescript/types/index.d.ts.map +0 -1
  119. package/lib/typescript/utils/autoDiscoverEventSources.d.ts.map +0 -1
  120. package/lib/typescript/utils/badgeSelectionStorage.d.ts.map +0 -1
  121. package/lib/typescript/utils/copySettingsStorage.d.ts.map +0 -1
  122. package/lib/typescript/utils/correlationUtils.d.ts.map +0 -1
  123. package/lib/typescript/utils/eventExportFormatter.d.ts.map +0 -1
  124. package/lib/typescript/utils/eventTransformers.d.ts.map +0 -1
  125. package/lib/typescript/utils/eventVisibility.d.ts.map +0 -1
  126. package/lib/typescript/utils/testIDs.d.ts.map +0 -1
@@ -1,387 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.EventsModal = EventsModal;
7
- exports.EventsToolView = EventsToolView;
8
- var _reactNative = require("react-native");
9
- var _react = require("react");
10
- var _sharedUi = require("@buoy-gg/shared-ui");
11
- var _useUnifiedEvents = require("../hooks/useUnifiedEvents");
12
- var _UnifiedEventFilters = require("./UnifiedEventFilters");
13
- var _UnifiedEventList = require("./UnifiedEventList");
14
- var _UnifiedEventDetail = require("./UnifiedEventDetail");
15
- var _EventsCopySettingsView = require("./EventsCopySettingsView");
16
- var _testIDs = require("../utils/testIDs");
17
- var _jsxRuntime = require("react/jsx-runtime");
18
- /**
19
- * EventsModal
20
- *
21
- * Modal wrapper for the unified events timeline.
22
- * Uses JsModal for consistent bottom sheet behavior.
23
- */
24
-
25
- // Try to load TickProvider from network package for time refresh
26
- let TickProvider = null;
27
- try {
28
- // @ts-ignore - Dynamic import that may not exist
29
- const network = require("@buoy-gg/network");
30
- TickProvider = network.TickProvider;
31
- } catch {
32
- // Network package not installed, times won't auto-refresh
33
- }
34
- function EventsModal({
35
- visible,
36
- onClose,
37
- onBack,
38
- onMinimize,
39
- enableSharedModalDimensions = false,
40
- inline = false,
41
- capturing: capturingProp,
42
- onCapturingChange,
43
- networkDetailWrapper,
44
- NetworkEventDetailViewComponent,
45
- RouteEventDetailComponent,
46
- detailComponents
47
- }) {
48
- const router = (0, _sharedUi.useSafeRouter)();
49
-
50
- // Controlled when the host supplies both halves; otherwise the tool's own
51
- // store is the source of truth.
52
- const controlledCapture = capturingProp != null && onCapturingChange != null;
53
- const {
54
- filteredEvents,
55
- availableSources,
56
- toggleSource,
57
- clearEvents,
58
- totalCount,
59
- filteredCount,
60
- isCapturing: isCapturingLocal,
61
- toggleCapturing: toggleCapturingLocal,
62
- hiddenEventsCount,
63
- searchText,
64
- setSearchText
65
- } = (0, _useUnifiedEvents.useUnifiedEvents)(
66
- // Hand the hook the effective power state so its paused-list boundary
67
- // follows the host's toggle rather than the local persisted one.
68
- controlledCapture ? {
69
- capturingOverride: capturingProp
70
- } : undefined);
71
- const isCapturing = controlledCapture ? capturingProp : isCapturingLocal;
72
- const toggleCapturing = controlledCapture ? () => onCapturingChange(!capturingProp) : toggleCapturingLocal;
73
- const [currentView, setCurrentView] = (0, _react.useState)("list");
74
- const [selectedEvent, setSelectedEvent] = (0, _react.useState)(null);
75
- const [showUpgradeModal, setShowUpgradeModal] = (0, _react.useState)(false);
76
- const [isSearchActive, setIsSearchActive] = (0, _react.useState)(false);
77
- const searchInputRef = (0, _react.useRef)(null);
78
-
79
- // Focus after the input has actually mounted (it replaces the title block).
80
- (0, _react.useEffect)(() => {
81
- if (!isSearchActive) return;
82
- const frame = requestAnimationFrame(() => {
83
- searchInputRef.current?.focus();
84
- });
85
- return () => cancelAnimationFrame(frame);
86
- }, [isSearchActive]);
87
- const closeSearch = (0, _react.useCallback)(() => {
88
- setIsSearchActive(false);
89
- setSearchText("");
90
- }, [setSearchText]);
91
-
92
- // Navigation handler for route events
93
- const handleNavigate = (0, _react.useCallback)(pathname => {
94
- try {
95
- router.push(pathname);
96
- } catch (error) {
97
- _reactNative.Alert.alert("Navigation Error", String(error));
98
- }
99
- }, [router]);
100
- const handleEventPress = (0, _react.useCallback)(event => {
101
- setSelectedEvent(event);
102
- setCurrentView("detail");
103
- }, []);
104
- const handleBack = (0, _react.useCallback)(() => {
105
- if (currentView === "detail") {
106
- setSelectedEvent(null);
107
- setCurrentView("list");
108
- } else if (currentView === "copySettings") {
109
- setCurrentView("list");
110
- }
111
- }, [currentView]);
112
- const handleOpenCopySettings = (0, _react.useCallback)(() => {
113
- setCurrentView("copySettings");
114
- }, []);
115
- const handleModeChange = (0, _react.useCallback)(_mode => {
116
- // Mode changes handled by JsModal
117
- }, []);
118
- const persistenceKey = enableSharedModalDimensions ? _sharedUi.devToolsStorageKeys.modal.root() : "buoy-events-modal";
119
- if (!visible) return null;
120
- const renderHeaderContent = () => {
121
- // Detail view header
122
- if (currentView === "detail" && selectedEvent) {
123
- const copyData = {
124
- source: selectedEvent.source,
125
- title: selectedEvent.title,
126
- subtitle: selectedEvent.subtitle,
127
- status: selectedEvent.status,
128
- timestamp: new Date(selectedEvent.timestamp).toISOString(),
129
- data: selectedEvent.originalEvent
130
- };
131
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_sharedUi.ModalHeader, {
132
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation, {
133
- onBack: handleBack
134
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ModalHeader.Content, {
135
- title: selectedEvent.title,
136
- testID: `${_testIDs.EVENTS_TEST_ID}-detail-heading`
137
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ModalHeader.Actions, {
138
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToolbarCopyButton, {
139
- value: copyData
140
- })
141
- })]
142
- });
143
- }
144
-
145
- // Copy settings view header
146
- if (currentView === "copySettings") {
147
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_sharedUi.ModalHeader, {
148
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation, {
149
- onBack: handleBack
150
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ModalHeader.Content, {
151
- title: "Copy Settings",
152
- testID: `${_testIDs.EVENTS_TEST_ID}-copy-settings-heading`
153
- })]
154
- });
155
- }
156
-
157
- // List view header (default)
158
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_sharedUi.ModalHeader, {
159
- children: [onBack && /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation, {
160
- onBack: onBack
161
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ModalHeader.Content, {
162
- title: "",
163
- children: isSearchActive ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ModalHeader.Search, {
164
- value: searchText,
165
- onChangeText: setSearchText,
166
- onCancel: closeSearch,
167
- placeholder: "Search events...",
168
- accessibilityLabel: "Search events",
169
- iconSize: 14,
170
- testID: `${_testIDs.EVENTS_TEST_ID}-search-field`,
171
- containerTestID: `${_testIDs.EVENTS_TEST_ID}-search`,
172
- clearTestID: `${_testIDs.EVENTS_TEST_ID}-search-clear`
173
- // Stay open while the query still filters the list — collapsing
174
- // it would hide why events are missing.
175
- ,
176
- onBlur: () => {
177
- if (searchText.length === 0) setIsSearchActive(false);
178
- }
179
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
180
- style: styles.headerTitleContainer,
181
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
182
- style: styles.headerTitle,
183
- testID: `${_testIDs.EVENTS_TEST_ID}-title`,
184
- children: "Events"
185
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
186
- style: styles.headerSubtitle,
187
- testID: `${_testIDs.EVENTS_TEST_ID}-count`,
188
- children: [totalCount, " captured"]
189
- })]
190
- })
191
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_sharedUi.ModalHeader.Actions, {
192
- children: [!isSearchActive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
193
- onPress: () => setIsSearchActive(true),
194
- style: [styles.headerActionButton, searchText.length > 0 && styles.headerActionButtonActive],
195
- testID: `${_testIDs.EVENTS_TEST_ID}-search-open`,
196
- accessibilityRole: "button",
197
- accessibilityLabel: "Search events",
198
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Search, {
199
- size: 14,
200
- color: searchText.length > 0 ? _sharedUi.night.color.accent : _sharedUi.night.color.textSecondary
201
- })
202
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
203
- onPress: handleOpenCopySettings,
204
- style: [styles.headerActionButton, totalCount === 0 && styles.headerActionButtonDisabled],
205
- disabled: totalCount === 0,
206
- testID: `${_testIDs.EVENTS_TEST_ID}-copy`,
207
- accessibilityRole: "button",
208
- accessibilityLabel: "Copy events",
209
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Copy, {
210
- size: 14,
211
- color: totalCount > 0 ? _sharedUi.night.color.textSecondary : _sharedUi.night.color.textTertiary
212
- })
213
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.PowerToggleButton, {
214
- isEnabled: isCapturing,
215
- onToggle: toggleCapturing,
216
- testID: `${_testIDs.EVENTS_TEST_ID}-power`,
217
- accessibilityLabel: "Toggle event capture"
218
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
219
- onPress: clearEvents,
220
- style: [styles.headerActionButton, totalCount === 0 && styles.headerActionButtonDisabled],
221
- disabled: totalCount === 0,
222
- testID: `${_testIDs.EVENTS_TEST_ID}-clear`,
223
- accessibilityRole: "button",
224
- accessibilityLabel: "Clear events",
225
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Trash2, {
226
- size: 14,
227
- color: totalCount > 0 ? _sharedUi.night.color.textSecondary : _sharedUi.night.color.textTertiary
228
- })
229
- })]
230
- })]
231
- });
232
- };
233
- const content = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
234
- style: styles.container,
235
- children: currentView === "copySettings" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_EventsCopySettingsView.EventsCopySettingsView, {
236
- events: filteredEvents
237
- }) : currentView === "detail" && selectedEvent ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_UnifiedEventDetail.UnifiedEventDetail, {
238
- event: selectedEvent,
239
- onBack: handleBack,
240
- onNavigate: handleNavigate,
241
- networkDetailWrapper: networkDetailWrapper,
242
- NetworkEventDetailViewComponent: NetworkEventDetailViewComponent,
243
- RouteEventDetailComponent: RouteEventDetailComponent,
244
- detailComponents: detailComponents
245
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
246
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_UnifiedEventFilters.UnifiedEventFilters, {
247
- availableSources: availableSources,
248
- onToggleSource: toggleSource,
249
- totalCount: totalCount,
250
- filteredCount: filteredCount
251
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_UnifiedEventList.UnifiedEventList, {
252
- events: filteredEvents,
253
- selectedEventId: undefined,
254
- expandedEventId: undefined,
255
- onEventPress: handleEventPress,
256
- onNavigate: handleNavigate,
257
- isCapturing: isCapturing,
258
- hiddenEventsCount: hiddenEventsCount,
259
- searchText: searchText
260
- // The three facts an empty list needs to explain ITSELF: what was
261
- // captured before the user's own filters, how many sources exist,
262
- // and how many are on. Without them the list can only guess, and
263
- // its guess used to be "events will appear here" no matter what.
264
- ,
265
- totalCount: totalCount,
266
- sourceCount: availableSources.length,
267
- enabledSourceCount: availableSources.filter(source => source.enabled !== false).length,
268
- onUpgradePress: () => setShowUpgradeModal(true)
269
- })]
270
- })
271
- });
272
- const body = TickProvider ? /*#__PURE__*/(0, _jsxRuntime.jsx)(TickProvider, {
273
- children: content
274
- }) : content;
275
- const upgradeModal = /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
276
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.UpgradeModal, {
277
- visible: showUpgradeModal,
278
- onClose: () => setShowUpgradeModal(false),
279
- featureName: "Unlimited Events",
280
- description: "View your complete event history to debug complex flows and track down issues.",
281
- 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"]
282
- })
283
- });
284
-
285
- // The ONLY difference between the phone and the desktop dashboard is which
286
- // shell the header and body go in. Everything above this line is shared.
287
- if (inline) {
288
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
289
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
290
- style: styles.inlineRoot,
291
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
292
- style: styles.inlineHeader,
293
- ..._sharedUi.windowDragProps,
294
- children: renderHeaderContent()
295
- }), body]
296
- }), upgradeModal]
297
- });
298
- }
299
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
300
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.JsModal, {
301
- visible: visible,
302
- onClose: onClose,
303
- onMinimize: onMinimize,
304
- persistenceKey: persistenceKey,
305
- header: {
306
- showToggleButton: true,
307
- customContent: renderHeaderContent()
308
- },
309
- onModeChange: handleModeChange,
310
- enablePersistence: true,
311
- initialMode: "bottomSheet",
312
- enableGlitchEffects: true,
313
- styles: {},
314
- disableScrollWrapper: true,
315
- children: body
316
- }), upgradeModal]
317
- });
318
- }
319
- const styles = _reactNative.StyleSheet.create({
320
- inlineRoot: {
321
- flex: 1,
322
- minHeight: 0,
323
- // Transparent so the desktop workbench's hoisted sky (one field spanning
324
- // sidebar + panel) shows through — the shell paints its base beneath it.
325
- backgroundColor: "transparent"
326
- },
327
- inlineHeader: {
328
- paddingHorizontal: 12,
329
- paddingVertical: 8,
330
- borderBottomWidth: 1,
331
- borderBottomColor: _sharedUi.buoyColors.border,
332
- // Clear, like Bench — the host's hoisted sky shows through the header.
333
- backgroundColor: "transparent"
334
- },
335
- container: {
336
- flex: 1,
337
- // Transparent so JsModal's ToolBackground shows through (the modal paints opaque base beneath it).
338
- backgroundColor: "transparent"
339
- },
340
- headerTitleContainer: {
341
- flexDirection: "row",
342
- alignItems: "baseline",
343
- gap: 8
344
- },
345
- headerTitle: {
346
- fontSize: 16,
347
- fontWeight: "600",
348
- color: _sharedUi.night.color.text
349
- },
350
- headerSubtitle: {
351
- fontSize: 12,
352
- color: _sharedUi.night.color.textTertiary
353
- },
354
- headerActionButton: {
355
- width: 32,
356
- height: 32,
357
- borderRadius: 8,
358
- backgroundColor: _sharedUi.night.color.buttonSurface,
359
- borderWidth: 1,
360
- borderColor: _sharedUi.night.color.border,
361
- alignItems: "center",
362
- justifyContent: "center"
363
- },
364
- headerActionButtonDisabled: {
365
- opacity: 0.55
366
- },
367
- headerActionButtonActive: {
368
- backgroundColor: _sharedUi.night.color.accentSoft,
369
- borderColor: _sharedUi.night.color.accentBorderStrong
370
- }
371
- });
372
-
373
- /**
374
- * The same events tool as `EventsModal`, rendered INLINE for hosts that place
375
- * tools in a panel rather than a modal. Exists so there is exactly one
376
- * implementation — the desktop dashboard used to ship its own copy of this
377
- * component's header and screen router.
378
- */
379
- function EventsToolView(props = {}) {
380
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(EventsModal, {
381
- ...props,
382
- inline: true,
383
- visible: true,
384
- onClose: () => {}
385
- });
386
- }
387
- //# sourceMappingURL=EventsModal.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.EventsModal=EventsModal;exports.EventsToolView=EventsToolView;var _reactNative=require("react-native");var _react=require("react");var _sharedUi=require("@buoy-gg/shared-ui");var _useUnifiedEvents=require("../hooks/useUnifiedEvents");var _UnifiedEventFilters=require("./UnifiedEventFilters");var _UnifiedEventList=require("./UnifiedEventList");var _UnifiedEventDetail=require("./UnifiedEventDetail");var _EventsCopySettingsView=require("./EventsCopySettingsView");var _testIDs=require("../utils/testIDs");var _jsxRuntime=require("react/jsx-runtime");function EventsModal({visible:i,onClose:m,onBack:v,onMinimize:_,enableSharedModalDimensions:I=false,inline:w=false,capturing:s,onCapturingChange:S,networkDetailWrapper:M,NetworkEventDetailViewComponent:V,RouteEventDetailComponent:k,detailComponents:N}){const E=(0,_sharedUi.useSafeRouter)();const c=s!=null&&S!=null;const{filteredEvents:b,availableSources:d,toggleSource:B,clearEvents:A,totalCount:n,filteredCount:U,isCapturing:H,toggleCapturing:q,hiddenEventsCount:R,searchText:r,setSearchText:u}=(0,_useUnifiedEvents.useUnifiedEvents)(c?{capturingOverride:s}:void 0);const x=c?s:H;const $=c?()=>S(!s):q;const[o,a]=(0,_react.useState)("list");const[e,p]=(0,_react.useState)(null);const[F,T]=(0,_react.useState)(false);const[l,h]=(0,_react.useState)(false);const L=(0,_react.useRef)(null);(0,_react.useEffect)(()=>{if(!l)return;const t=requestAnimationFrame(()=>{L.current?.focus()});return()=>cancelAnimationFrame(t)},[l]);const P=(0,_react.useCallback)(()=>{h(false);u("")},[u]);const f=(0,_react.useCallback)(t=>{try{E.push(t)}catch(J){_reactNative.Alert.alert("Navigation Error",String(J))}},[E]);const z=(0,_react.useCallback)(t=>{p(t);a("detail")},[]);const g=(0,_react.useCallback)(()=>{if(o==="detail"){p(null);a("list")}else if(o==="copySettings"){a("list")}},[o]);const O=(0,_react.useCallback)(()=>{a("copySettings")},[]);const W=(0,_react.useCallback)(t=>{},[]);const K=I?_sharedUi.devToolsStorageKeys.modal.root():"buoy-events-modal";if(!i)return null;const y=()=>{if(o==="detail"&&e){const t={source:e.source,title:e.title,subtitle:e.subtitle,status:e.status,timestamp:new Date(e.timestamp).toISOString(),data:e.originalEvent};return(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader,{children:[(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation,{onBack:g}),(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Content,{title:e.title,testID:`${_testIDs.EVENTS_TEST_ID}-detail-heading`}),(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Actions,{children:(0,_jsxRuntime.jsx)(_sharedUi.ToolbarCopyButton,{value:t})})]})}if(o==="copySettings"){return(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader,{children:[(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation,{onBack:g}),(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Content,{title:"Copy Settings",testID:`${_testIDs.EVENTS_TEST_ID}-copy-settings-heading`})]})}return(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader,{children:[v&&(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Navigation,{onBack:v}),(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Content,{title:"",children:l?(0,_jsxRuntime.jsx)(_sharedUi.ModalHeader.Search,{value:r,onChangeText:u,onCancel:P,placeholder:"Search events...",accessibilityLabel:"Search events",iconSize:14,testID:`${_testIDs.EVENTS_TEST_ID}-search-field`,containerTestID:`${_testIDs.EVENTS_TEST_ID}-search`,clearTestID:`${_testIDs.EVENTS_TEST_ID}-search-clear`,onBlur:()=>{if(r.length===0)h(false)}}):(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerTitleContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerTitle,testID:`${_testIDs.EVENTS_TEST_ID}-title`,children:"Events"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.headerSubtitle,testID:`${_testIDs.EVENTS_TEST_ID}-count`,children:[n," captured"]})]})}),(0,_jsxRuntime.jsxs)(_sharedUi.ModalHeader.Actions,{children:[!l&&(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:()=>h(true),style:[styles.headerActionButton,r.length>0&&styles.headerActionButtonActive],testID:`${_testIDs.EVENTS_TEST_ID}-search-open`,accessibilityRole:"button",accessibilityLabel:"Search events",children:(0,_jsxRuntime.jsx)(_sharedUi.Search,{size:14,color:r.length>0?_sharedUi.night.color.accent:_sharedUi.night.color.textSecondary})}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:O,style:[styles.headerActionButton,n===0&&styles.headerActionButtonDisabled],disabled:n===0,testID:`${_testIDs.EVENTS_TEST_ID}-copy`,accessibilityRole:"button",accessibilityLabel:"Copy events",children:(0,_jsxRuntime.jsx)(_sharedUi.Copy,{size:14,color:n>0?_sharedUi.night.color.textSecondary:_sharedUi.night.color.textTertiary})}),(0,_jsxRuntime.jsx)(_sharedUi.PowerToggleButton,{isEnabled:x,onToggle:$,testID:`${_testIDs.EVENTS_TEST_ID}-power`,accessibilityLabel:"Toggle event capture"}),(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:A,style:[styles.headerActionButton,n===0&&styles.headerActionButtonDisabled],disabled:n===0,testID:`${_testIDs.EVENTS_TEST_ID}-clear`,accessibilityRole:"button",accessibilityLabel:"Clear events",children:(0,_jsxRuntime.jsx)(_sharedUi.Trash2,{size:14,color:n>0?_sharedUi.night.color.textSecondary:_sharedUi.night.color.textTertiary})})]})]})};const C=(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,children:o==="copySettings"?(0,_jsxRuntime.jsx)(_EventsCopySettingsView.EventsCopySettingsView,{events:b}):o==="detail"&&e?(0,_jsxRuntime.jsx)(_UnifiedEventDetail.UnifiedEventDetail,{event:e,onBack:g,onNavigate:f,networkDetailWrapper:M,NetworkEventDetailViewComponent:V,RouteEventDetailComponent:k,detailComponents:N}):(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_UnifiedEventFilters.UnifiedEventFilters,{availableSources:d,onToggleSource:B,totalCount:n,filteredCount:U}),(0,_jsxRuntime.jsx)(_UnifiedEventList.UnifiedEventList,{events:b,selectedEventId:void 0,expandedEventId:void 0,onEventPress:z,onNavigate:f,isCapturing:x,hiddenEventsCount:R,searchText:r,totalCount:n,sourceCount:d.length,enabledSourceCount:d.filter(t=>t.enabled!==false).length,onUpgradePress:()=>T(true)})]})});const j=_sharedUi.TickProvider?(0,_jsxRuntime.jsx)(_sharedUi.TickProvider,{children:C}):C;const D=(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:(0,_jsxRuntime.jsx)(_sharedUi.UpgradeModal,{visible:F,onClose:()=>T(false),featureName:"Unlimited Events",description:"View your complete event history to debug complex flows and track down issues.",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"]})});if(w){return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.inlineRoot,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.inlineHeader,..._sharedUi.windowDragProps,children:y()}),j]}),D]})}return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_sharedUi.JsModal,{visible:i,onClose:m,onMinimize:_,persistenceKey:K,header:{showToggleButton:true,customContent:y()},onModeChange:W,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},disableScrollWrapper:true,children:j}),D]})}const styles=_reactNative.StyleSheet.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:_sharedUi.buoyColors.border,backgroundColor:"transparent"},container:{flex:1,backgroundColor:"transparent"},headerTitleContainer:{flexDirection:"row",alignItems:"baseline",gap:8},headerTitle:{fontSize:16,fontWeight:"600",color:_sharedUi.night.color.text},headerSubtitle:{fontSize:12,color:_sharedUi.night.color.textTertiary},headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:_sharedUi.night.color.buttonSurface,borderWidth:1,borderColor:_sharedUi.night.color.border,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},headerActionButtonActive:{backgroundColor:_sharedUi.night.color.accentSoft,borderColor:_sharedUi.night.color.accentBorderStrong}});function EventsToolView(i={}){return(0,_jsxRuntime.jsx)(EventsModal,{...i,inline:true,visible:true,onClose:()=>{}})}