@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,187 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.UnifiedEventList = void 0;
7
- var _reactNative = require("react-native");
8
- var _react = require("react");
9
- var _sharedUi = require("@buoy-gg/shared-ui");
10
- var _UnifiedEventItem = require("./UnifiedEventItem");
11
- var _correlationUtils = require("../utils/correlationUtils");
12
- var _testIDs = require("../utils/testIDs");
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- /**
15
- * UnifiedEventList
16
- *
17
- * Scrollable list of unified events with empty state handling.
18
- */
19
-
20
- const UnifiedEventList = exports.UnifiedEventList = /*#__PURE__*/(0, _react.memo)(function UnifiedEventList({
21
- events,
22
- selectedEventId,
23
- expandedEventId,
24
- onEventPress,
25
- onNavigate,
26
- isCapturing,
27
- hiddenEventsCount = 0,
28
- onUpgradePress,
29
- searchText = "",
30
- totalCount = 0,
31
- sourceCount,
32
- enabledSourceCount
33
- }) {
34
- // Precompute correlation counts for efficient rendering
35
- const correlationCountMap = (0, _react.useMemo)(() => (0, _correlationUtils.buildCorrelationCountMap)(events), [events]);
36
- const renderItem = (0, _react.useCallback)(({
37
- item
38
- }) => {
39
- // Get correlation info for this event
40
- const correlationCount = item.correlationId ? correlationCountMap.get(item.correlationId) || 1 : 1;
41
- const correlationLabel = (0, _correlationUtils.getCorrelationLabel)(item, events);
42
- const correlationColor = item.correlationId ? (0, _correlationUtils.getCorrelationColor)(item.correlationId) : undefined;
43
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_UnifiedEventItem.UnifiedEventItem, {
44
- event: item,
45
- isSelected: item.id === selectedEventId,
46
- isExpanded: item.id === expandedEventId,
47
- onPress: () => onEventPress(item),
48
- onNavigate: onNavigate,
49
- correlationCount: correlationCount,
50
- correlationLabel: correlationLabel,
51
- correlationColor: correlationColor
52
- });
53
- }, [selectedEventId, expandedEventId, onEventPress, onNavigate, correlationCountMap, events]);
54
- const keyExtractor = (0, _react.useCallback)(item => item.id, []);
55
-
56
- // Footer showing hidden events count for free tier
57
- const renderFooter = (0, _react.useCallback)(() => {
58
- if (hiddenEventsCount <= 0) return null;
59
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
60
- style: styles.hiddenBanner,
61
- onPress: onUpgradePress,
62
- activeOpacity: 0.8,
63
- testID: `${_testIDs.EVENTS_TEST_ID}-hidden-banner`,
64
- accessibilityRole: "button",
65
- accessibilityLabel: `${hiddenEventsCount} hidden event${hiddenEventsCount !== 1 ? "s" : ""}, upgrade for the full history`,
66
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
67
- style: styles.hiddenBannerLeft,
68
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Zap, {
69
- size: 16,
70
- color: _sharedUi.night.color.accent
71
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
72
- style: styles.hiddenBannerText,
73
- testID: `${_testIDs.EVENTS_TEST_ID}-hidden-count`,
74
- children: [hiddenEventsCount, " hidden event", hiddenEventsCount !== 1 ? "s" : ""]
75
- })]
76
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ProBadge, {})]
77
- });
78
- }, [hiddenEventsCount, onUpgradePress]);
79
- if (events.length === 0) {
80
- const noSources = sourceCount === 0;
81
- const allSourcesOff = enabledSourceCount === 0;
82
-
83
- // Two causes are this tool's own; everything else is the shared
84
- // precedence in `resolveListEmptyState` (which is also what guarantees a
85
- // typed query is never swallowed by the capture state).
86
- const content = noSources ? {
87
- // scanning = "scanning for targets… and finding none". The tool
88
- // auto-discovers its sources, so an empty roster is a scan result,
89
- // not a paused stream.
90
- otto: "scanning",
91
- title: "No Event Sources",
92
- message: "This tool reports on the other Buoy tools.\nInstall one — network, storage, redux, routes — and its events land here."
93
- } : allSourcesOff && !searchText.trim() && totalCount > 0 ? {
94
- otto: "filtering",
95
- title: "Every Source Is Off",
96
- message: `${totalCount} event${totalCount === 1 ? " is" : "s are"} captured. Turn a source chip back on to see them.`
97
- } : (0, _sharedUi.resolveListEmptyState)({
98
- subject: "events",
99
- search: searchText,
100
- total: totalCount,
101
- capturing: isCapturing,
102
- blocked: allSourcesOff ? "Every source chip is off, so there is nothing to search. Turn one back on." : undefined,
103
- waiting: {
104
- // listening = "listening for events; waiting for input" — the
105
- // one OTTO_USES sentence written for exactly this tool.
106
- otto: "listening",
107
- title: "No Events Yet",
108
- message: "Events will appear here as they occur.\nTry interacting with your app."
109
- },
110
- paused: {
111
- title: "Not Capturing",
112
- message: "Event capture is paused. Resume to see events."
113
- }
114
- });
115
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToolEmptyState, {
116
- ...content,
117
- testID: `${_testIDs.EVENTS_TEST_ID}-empty`
118
- // This body is the whole tab, so it centres rather than sitting at the
119
- // top the way an inline panel does.
120
- ,
121
- style: styles.emptyContainer
122
- });
123
- }
124
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.FlatList, {
125
- data: events,
126
- renderItem: renderItem,
127
- keyExtractor: keyExtractor,
128
- testID: `${_testIDs.EVENTS_TEST_ID}-list`,
129
- style: styles.list,
130
- contentContainerStyle: styles.listContent,
131
- ItemSeparatorComponent: () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
132
- style: styles.separator
133
- }),
134
- ListFooterComponent: renderFooter,
135
- showsVerticalScrollIndicator: true,
136
- initialNumToRender: 15,
137
- maxToRenderPerBatch: 10,
138
- windowSize: 10,
139
- removeClippedSubviews: !(typeof process !== "undefined" && process.env?.EXPO_PUBLIC_E2E)
140
- });
141
- });
142
- const styles = _reactNative.StyleSheet.create({
143
- list: {
144
- flex: 1,
145
- // Transparent so JsModal's ToolBackground shows through (the modal paints opaque base beneath it).
146
- backgroundColor: "transparent"
147
- },
148
- listContent: {
149
- paddingVertical: 16
150
- },
151
- separator: {
152
- height: 8
153
- },
154
- emptyContainer: {
155
- // Only the centring — `ToolEmptyState` owns the padding, the type and the
156
- // mascot. Transparent so JsModal's ToolBackground shows through (the modal
157
- // paints opaque base beneath it).
158
- flex: 1,
159
- justifyContent: "center",
160
- backgroundColor: "transparent"
161
- },
162
- hiddenBanner: {
163
- flexDirection: "row",
164
- alignItems: "center",
165
- justifyContent: "space-between",
166
- marginHorizontal: 16,
167
- marginTop: 8,
168
- marginBottom: 16,
169
- paddingVertical: 12,
170
- paddingHorizontal: 16,
171
- backgroundColor: _sharedUi.night.color.surface,
172
- borderRadius: 8,
173
- borderWidth: 1,
174
- borderColor: _sharedUi.night.color.border
175
- },
176
- hiddenBannerLeft: {
177
- flexDirection: "row",
178
- alignItems: "center",
179
- gap: 8
180
- },
181
- hiddenBannerText: {
182
- fontSize: 13,
183
- fontWeight: "500",
184
- color: _sharedUi.night.color.text
185
- }
186
- });
187
- //# sourceMappingURL=UnifiedEventList.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.UnifiedEventList=void 0;var _reactNative=require("react-native");var _react=require("react");var _sharedUi=require("@buoy-gg/shared-ui");var _UnifiedEventItem=require("./UnifiedEventItem");var _correlationUtils=require("../utils/correlationUtils");var _testIDs=require("../utils/testIDs");var _jsxRuntime=require("react/jsx-runtime");const UnifiedEventList=exports.UnifiedEventList=(0,_react.memo)(function E({events:t,selectedEventId:a,expandedEventId:s,onEventPress:l,onNavigate:c,isCapturing:g,hiddenEventsCount:r=0,onUpgradePress:d,searchText:u="",totalCount:o=0,sourceCount:h,enabledSourceCount:f}){const p=(0,_react.useMemo)(()=>(0,_correlationUtils.buildCorrelationCountMap)(t),[t]);const y=(0,_react.useCallback)(({item:e})=>{const n=e.correlationId?p.get(e.correlationId)||1:1;const i=(0,_correlationUtils.getCorrelationLabel)(e,t);const x=e.correlationId?(0,_correlationUtils.getCorrelationColor)(e.correlationId):void 0;return(0,_jsxRuntime.jsx)(_UnifiedEventItem.UnifiedEventItem,{event:e,isSelected:e.id===a,isExpanded:e.id===s,onPress:()=>l(e),onNavigate:c,correlationCount:n,correlationLabel:i,correlationColor:x})},[a,s,l,c,p,t]);const b=(0,_react.useCallback)(e=>e.id,[]);const m=(0,_react.useCallback)(()=>{if(r<=0)return null;return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:styles.hiddenBanner,onPress:d,activeOpacity:.8,testID:`${_testIDs.EVENTS_TEST_ID}-hidden-banner`,accessibilityRole:"button",accessibilityLabel:`${r} hidden event${r!==1?"s":""}, upgrade for the full history`,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.hiddenBannerLeft,children:[(0,_jsxRuntime.jsx)(_sharedUi.Zap,{size:16,color:_sharedUi.night.color.accent}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.hiddenBannerText,testID:`${_testIDs.EVENTS_TEST_ID}-hidden-count`,children:[r," hidden event",r!==1?"s":""]})]}),(0,_jsxRuntime.jsx)(_sharedUi.ProBadge,{})]})},[r,d]);if(t.length===0){const e=h===0;const n=f===0;const i=e?{otto:"scanning",title:"No Event Sources",message:"This tool reports on the other Buoy tools.\nInstall one \u2014 network, storage, redux, routes \u2014 and its events land here."}:n&&!u.trim()&&o>0?{otto:"filtering",title:"Every Source Is Off",message:`${o} event${o===1?" is":"s are"} captured. Turn a source chip back on to see them.`}:(0,_sharedUi.resolveListEmptyState)({subject:"events",search:u,total:o,capturing:g,blocked:n?"Every source chip is off, so there is nothing to search. Turn one back on.":void 0,waiting:{otto:"listening",title:"No Events Yet",message:"Events will appear here as they occur.\nTry interacting with your app."},paused:{title:"Not Capturing",message:"Event capture is paused. Resume to see events."}});return(0,_jsxRuntime.jsx)(_sharedUi.ToolEmptyState,{...i,testID:`${_testIDs.EVENTS_TEST_ID}-empty`,style:styles.emptyContainer})}return(0,_jsxRuntime.jsx)(_reactNative.FlatList,{data:t,renderItem:y,keyExtractor:b,testID:`${_testIDs.EVENTS_TEST_ID}-list`,style:styles.list,contentContainerStyle:styles.listContent,ItemSeparatorComponent:()=>(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.separator}),ListFooterComponent:m,showsVerticalScrollIndicator:true,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,removeClippedSubviews:!(typeof process!=="undefined"&&process.env?.EXPO_PUBLIC_E2E)})});const styles=_reactNative.StyleSheet.create({list:{flex:1,backgroundColor:"transparent"},listContent:{paddingVertical:16},separator:{height:8},emptyContainer:{flex:1,justifyContent:"center",backgroundColor:"transparent"},hiddenBanner:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginHorizontal:16,marginTop:8,marginBottom:16,paddingVertical:12,paddingHorizontal:16,backgroundColor:_sharedUi.night.color.surface,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border},hiddenBannerLeft:{flexDirection:"row",alignItems:"center",gap:8},hiddenBannerText:{fontSize:13,fontWeight:"500",color:_sharedUi.night.color.text}});
@@ -1,130 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.UnifiedEventViewer = UnifiedEventViewer;
7
- var _reactNative = require("react-native");
8
- var _react = require("react");
9
- var _sharedUi = require("@buoy-gg/shared-ui");
10
- var _useUnifiedEvents = require("../hooks/useUnifiedEvents");
11
- var _UnifiedEventFilters = require("./UnifiedEventFilters");
12
- var _UnifiedEventList = require("./UnifiedEventList");
13
- var _UnifiedEventDetail = require("./UnifiedEventDetail");
14
- var _jsxRuntime = require("react/jsx-runtime");
15
- /**
16
- * UnifiedEventViewer
17
- *
18
- * Main component for the unified event timeline.
19
- * Shows events from all sources with filtering and detail view.
20
- */
21
-
22
- function UnifiedEventViewer() {
23
- const {
24
- filteredEvents,
25
- availableSources,
26
- toggleSource,
27
- clearEvents,
28
- totalCount,
29
- filteredCount,
30
- isCapturing
31
- } = (0, _useUnifiedEvents.useUnifiedEvents)();
32
- const [selectedEvent, setSelectedEvent] = (0, _react.useState)(null);
33
- const handleEventPress = (0, _react.useCallback)(event => {
34
- setSelectedEvent(event);
35
- }, []);
36
- const handleBack = (0, _react.useCallback)(() => {
37
- setSelectedEvent(null);
38
- }, []);
39
-
40
- // Show detail view if an event is selected
41
- if (selectedEvent) {
42
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_UnifiedEventDetail.UnifiedEventDetail, {
43
- event: selectedEvent,
44
- onBack: handleBack
45
- });
46
- }
47
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
48
- style: styles.container,
49
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
50
- style: styles.header,
51
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
52
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
53
- style: styles.title,
54
- children: "Events"
55
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
56
- style: styles.subtitle,
57
- children: [totalCount, " event", totalCount !== 1 ? "s" : "", " captured"]
58
- })]
59
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
60
- style: styles.clearButton,
61
- onPress: clearEvents,
62
- activeOpacity: 0.7,
63
- disabled: totalCount === 0,
64
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Trash2, {
65
- size: 16,
66
- color: totalCount === 0 ? _sharedUi.night.color.textTertiary : _sharedUi.night.color.danger
67
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
68
- style: [styles.clearText, {
69
- color: totalCount === 0 ? _sharedUi.night.color.textTertiary : _sharedUi.night.color.danger
70
- }],
71
- children: "Clear"
72
- })]
73
- })]
74
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_UnifiedEventFilters.UnifiedEventFilters, {
75
- availableSources: availableSources,
76
- onToggleSource: toggleSource,
77
- totalCount: totalCount,
78
- filteredCount: filteredCount
79
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_UnifiedEventList.UnifiedEventList, {
80
- events: filteredEvents,
81
- selectedEventId: undefined,
82
- onEventPress: handleEventPress,
83
- isCapturing: isCapturing,
84
- totalCount: totalCount,
85
- sourceCount: availableSources.length,
86
- enabledSourceCount: availableSources.filter(source => source.enabled !== false).length
87
- })]
88
- });
89
- }
90
- const styles = _reactNative.StyleSheet.create({
91
- container: {
92
- flex: 1,
93
- // Transparent so the night sheet's star field shows through.
94
- backgroundColor: "transparent"
95
- },
96
- header: {
97
- flexDirection: "row",
98
- justifyContent: "space-between",
99
- alignItems: "center",
100
- paddingHorizontal: 16,
101
- paddingVertical: 12,
102
- backgroundColor: _sharedUi.night.color.surface,
103
- borderBottomWidth: 1,
104
- borderBottomColor: _sharedUi.night.color.border
105
- },
106
- title: {
107
- fontSize: 20,
108
- fontWeight: "700",
109
- color: _sharedUi.night.color.text
110
- },
111
- subtitle: {
112
- fontSize: 12,
113
- color: _sharedUi.night.color.textTertiary,
114
- marginTop: 2
115
- },
116
- clearButton: {
117
- flexDirection: "row",
118
- alignItems: "center",
119
- gap: 6,
120
- paddingHorizontal: 12,
121
- paddingVertical: 8,
122
- borderRadius: 6,
123
- backgroundColor: _sharedUi.night.color.dangerSoft
124
- },
125
- clearText: {
126
- fontSize: 14,
127
- fontWeight: "600"
128
- }
129
- });
130
- //# sourceMappingURL=UnifiedEventViewer.js.map
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.UnifiedEventViewer=UnifiedEventViewer;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 _jsxRuntime=require("react/jsx-runtime");function UnifiedEventViewer(){const{filteredEvents:o,availableSources:t,toggleSource:l,clearEvents:a,totalCount:e,filteredCount:s,isCapturing:c}=(0,_useUnifiedEvents.useUnifiedEvents)();const[n,i]=(0,_react.useState)(null);const d=(0,_react.useCallback)(r=>{i(r)},[]);const u=(0,_react.useCallback)(()=>{i(null)},[]);if(n){return(0,_jsxRuntime.jsx)(_UnifiedEventDetail.UnifiedEventDetail,{event:n,onBack:u})}return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.container,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.header,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.title,children:"Events"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.subtitle,children:[e," event",e!==1?"s":""," captured"]})]}),(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:styles.clearButton,onPress:a,activeOpacity:.7,disabled:e===0,children:[(0,_jsxRuntime.jsx)(_sharedUi.Trash2,{size:16,color:e===0?_sharedUi.night.color.textTertiary:_sharedUi.night.color.danger}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.clearText,{color:e===0?_sharedUi.night.color.textTertiary:_sharedUi.night.color.danger}],children:"Clear"})]})]}),(0,_jsxRuntime.jsx)(_UnifiedEventFilters.UnifiedEventFilters,{availableSources:t,onToggleSource:l,totalCount:e,filteredCount:s}),(0,_jsxRuntime.jsx)(_UnifiedEventList.UnifiedEventList,{events:o,selectedEventId:void 0,onEventPress:d,isCapturing:c,totalCount:e,sourceCount:t.length,enabledSourceCount:t.filter(r=>r.enabled!==false).length})]})}const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:"transparent"},header:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:16,paddingVertical:12,backgroundColor:_sharedUi.night.color.surface,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.border},title:{fontSize:20,fontWeight:"700",color:_sharedUi.night.color.text},subtitle:{fontSize:12,color:_sharedUi.night.color.textTertiary,marginTop:2},clearButton:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:12,paddingVertical:8,borderRadius:6,backgroundColor:_sharedUi.night.color.dangerSoft},clearText:{fontSize:14,fontWeight:"600"}});