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