@buoy-gg/events 7.0.41 → 7.0.43

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