@buoy-gg/events 7.0.41 → 7.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -64
- package/lib/commonjs/components/EventsCopySettingsView.js +1 -581
- package/lib/commonjs/components/EventsModal.js +1 -378
- package/lib/commonjs/components/ReactQueryEventDetail.js +1 -433
- package/lib/commonjs/components/UnifiedEventDetail.js +1 -565
- package/lib/commonjs/components/UnifiedEventFilters.js +1 -160
- package/lib/commonjs/components/UnifiedEventItem.js +1 -416
- package/lib/commonjs/components/UnifiedEventList.js +1 -187
- package/lib/commonjs/components/UnifiedEventViewer.js +1 -130
- package/lib/commonjs/hooks/useUnifiedEvents.js +1 -419
- package/lib/commonjs/index.js +1 -282
- package/lib/commonjs/preset.js +1 -60
- package/lib/commonjs/sources/sourceIds.js +1 -30
- package/lib/commonjs/stores/unifiedEventStore.js +1 -712
- package/lib/commonjs/sync/eventsSyncAdapter.js +1 -358
- package/lib/commonjs/types/copySettings.js +1 -249
- package/lib/commonjs/types/index.js +1 -17
- package/lib/commonjs/utils/autoDiscoverEventSources.js +1 -1068
- package/lib/commonjs/utils/badgeSelectionStorage.js +1 -126
- package/lib/commonjs/utils/copySettingsStorage.js +1 -43
- package/lib/commonjs/utils/correlationUtils.js +1 -130
- package/lib/commonjs/utils/eventExportFormatter.js +1 -1912
- package/lib/commonjs/utils/eventTransformers.js +1 -496
- package/lib/commonjs/utils/eventVisibility.js +1 -76
- package/lib/commonjs/utils/testIDs.js +1 -91
- package/lib/module/components/EventsCopySettingsView.js +1 -577
- package/lib/module/components/EventsModal.js +1 -374
- package/lib/module/components/ReactQueryEventDetail.js +1 -429
- package/lib/module/components/UnifiedEventDetail.js +1 -561
- package/lib/module/components/UnifiedEventFilters.js +1 -156
- package/lib/module/components/UnifiedEventItem.js +1 -412
- package/lib/module/components/UnifiedEventList.js +1 -183
- package/lib/module/components/UnifiedEventViewer.js +1 -126
- package/lib/module/hooks/useUnifiedEvents.js +1 -416
- package/lib/module/index.js +1 -102
- package/lib/module/preset.js +1 -57
- package/lib/module/sources/sourceIds.js +1 -26
- package/lib/module/stores/unifiedEventStore.js +1 -678
- package/lib/module/sync/eventsSyncAdapter.js +1 -354
- package/lib/module/types/copySettings.js +1 -244
- package/lib/module/types/index.js +1 -37
- package/lib/module/utils/autoDiscoverEventSources.js +1 -1060
- package/lib/module/utils/badgeSelectionStorage.js +1 -116
- package/lib/module/utils/copySettingsStorage.js +1 -37
- package/lib/module/utils/correlationUtils.js +1 -120
- package/lib/module/utils/eventExportFormatter.js +1 -1901
- package/lib/module/utils/eventTransformers.js +1 -487
- package/lib/module/utils/eventVisibility.js +1 -70
- package/lib/module/utils/testIDs.js +1 -83
- package/lib/web/index.mjs +9 -10
- package/package.json +3 -3
- package/lib/commonjs/components/EventsCopySettingsView.js.map +0 -1
- package/lib/commonjs/components/EventsModal.js.map +0 -1
- package/lib/commonjs/components/ReactQueryEventDetail.js.map +0 -1
- package/lib/commonjs/components/UnifiedEventDetail.js.map +0 -1
- package/lib/commonjs/components/UnifiedEventFilters.js.map +0 -1
- package/lib/commonjs/components/UnifiedEventItem.js.map +0 -1
- package/lib/commonjs/components/UnifiedEventList.js.map +0 -1
- package/lib/commonjs/components/UnifiedEventViewer.js.map +0 -1
- package/lib/commonjs/hooks/useUnifiedEvents.js.map +0 -1
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/preset.js.map +0 -1
- package/lib/commonjs/sources/sourceIds.js.map +0 -1
- package/lib/commonjs/stores/unifiedEventStore.js.map +0 -1
- package/lib/commonjs/sync/eventsSyncAdapter.js.map +0 -1
- package/lib/commonjs/types/copySettings.js.map +0 -1
- package/lib/commonjs/types/index.js.map +0 -1
- package/lib/commonjs/utils/autoDiscoverEventSources.js.map +0 -1
- package/lib/commonjs/utils/badgeSelectionStorage.js.map +0 -1
- package/lib/commonjs/utils/copySettingsStorage.js.map +0 -1
- package/lib/commonjs/utils/correlationUtils.js.map +0 -1
- package/lib/commonjs/utils/eventExportFormatter.js.map +0 -1
- package/lib/commonjs/utils/eventTransformers.js.map +0 -1
- package/lib/commonjs/utils/eventVisibility.js.map +0 -1
- package/lib/commonjs/utils/testIDs.js.map +0 -1
- package/lib/module/components/EventsCopySettingsView.js.map +0 -1
- package/lib/module/components/EventsModal.js.map +0 -1
- package/lib/module/components/ReactQueryEventDetail.js.map +0 -1
- package/lib/module/components/UnifiedEventDetail.js.map +0 -1
- package/lib/module/components/UnifiedEventFilters.js.map +0 -1
- package/lib/module/components/UnifiedEventItem.js.map +0 -1
- package/lib/module/components/UnifiedEventList.js.map +0 -1
- package/lib/module/components/UnifiedEventViewer.js.map +0 -1
- package/lib/module/hooks/useUnifiedEvents.js.map +0 -1
- package/lib/module/index.js.map +0 -1
- package/lib/module/preset.js.map +0 -1
- package/lib/module/sources/sourceIds.js.map +0 -1
- package/lib/module/stores/unifiedEventStore.js.map +0 -1
- package/lib/module/sync/eventsSyncAdapter.js.map +0 -1
- package/lib/module/types/copySettings.js.map +0 -1
- package/lib/module/types/index.js.map +0 -1
- package/lib/module/utils/autoDiscoverEventSources.js.map +0 -1
- package/lib/module/utils/badgeSelectionStorage.js.map +0 -1
- package/lib/module/utils/copySettingsStorage.js.map +0 -1
- package/lib/module/utils/correlationUtils.js.map +0 -1
- package/lib/module/utils/eventExportFormatter.js.map +0 -1
- package/lib/module/utils/eventTransformers.js.map +0 -1
- package/lib/module/utils/eventVisibility.js.map +0 -1
- package/lib/module/utils/testIDs.js.map +0 -1
- package/lib/typescript/components/EventsCopySettingsView.d.ts.map +0 -1
- package/lib/typescript/components/EventsModal.d.ts.map +0 -1
- package/lib/typescript/components/ReactQueryEventDetail.d.ts.map +0 -1
- package/lib/typescript/components/UnifiedEventDetail.d.ts.map +0 -1
- package/lib/typescript/components/UnifiedEventFilters.d.ts.map +0 -1
- package/lib/typescript/components/UnifiedEventItem.d.ts.map +0 -1
- package/lib/typescript/components/UnifiedEventList.d.ts.map +0 -1
- package/lib/typescript/components/UnifiedEventViewer.d.ts.map +0 -1
- package/lib/typescript/hooks/useUnifiedEvents.d.ts.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/preset.d.ts.map +0 -1
- package/lib/typescript/sources/sourceIds.d.ts.map +0 -1
- package/lib/typescript/stores/unifiedEventStore.d.ts.map +0 -1
- package/lib/typescript/sync/eventsSyncAdapter.d.ts.map +0 -1
- package/lib/typescript/types/copySettings.d.ts.map +0 -1
- package/lib/typescript/types/index.d.ts.map +0 -1
- package/lib/typescript/utils/autoDiscoverEventSources.d.ts.map +0 -1
- package/lib/typescript/utils/badgeSelectionStorage.d.ts.map +0 -1
- package/lib/typescript/utils/copySettingsStorage.d.ts.map +0 -1
- package/lib/typescript/utils/correlationUtils.d.ts.map +0 -1
- package/lib/typescript/utils/eventExportFormatter.d.ts.map +0 -1
- package/lib/typescript/utils/eventTransformers.d.ts.map +0 -1
- package/lib/typescript/utils/eventVisibility.d.ts.map +0 -1
- package/lib/typescript/utils/testIDs.d.ts.map +0 -1
|
@@ -1,156 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* UnifiedEventFilters
|
|
5
|
-
*
|
|
6
|
-
* Filter bar showing toggleable badges for each available event source.
|
|
7
|
-
* Badges are sorted: enabled first, disabled last.
|
|
8
|
-
* Toggling a badge enables/disables event listening for that source.
|
|
9
|
-
*
|
|
10
|
-
* Badge layout (inspired by React Query DevTools):
|
|
11
|
-
* [subscriber_count] • Label [event_count]
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { View, Text, TouchableOpacity, StyleSheet, ScrollView } from "react-native";
|
|
15
|
-
import { memo } from "react";
|
|
16
|
-
import { night } from "@buoy-gg/shared-ui";
|
|
17
|
-
import { EVENTS_TEST_ID, eventFilterTestID } from "../utils/testIDs";
|
|
18
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
-
export const UnifiedEventFilters = /*#__PURE__*/memo(function UnifiedEventFilters({
|
|
20
|
-
availableSources,
|
|
21
|
-
onToggleSource,
|
|
22
|
-
totalCount,
|
|
23
|
-
filteredCount
|
|
24
|
-
}) {
|
|
25
|
-
if (availableSources.length === 0) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
29
|
-
style: styles.container,
|
|
30
|
-
testID: `${EVENTS_TEST_ID}-filter-bar`,
|
|
31
|
-
children: [/*#__PURE__*/_jsx(ScrollView, {
|
|
32
|
-
horizontal: true,
|
|
33
|
-
showsHorizontalScrollIndicator: false,
|
|
34
|
-
contentContainerStyle: styles.badgesRow,
|
|
35
|
-
testID: `${EVENTS_TEST_ID}-filter-scroll`,
|
|
36
|
-
children: availableSources.map(source => {
|
|
37
|
-
const isEnabled = source.enabled !== false;
|
|
38
|
-
const subscriberCount = source.subscriberCount;
|
|
39
|
-
const hasSubscriberTracking = subscriberCount !== undefined;
|
|
40
|
-
const eventCount = source.count || 0;
|
|
41
|
-
const testID = eventFilterTestID(source.source);
|
|
42
|
-
return /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
43
|
-
testID: testID,
|
|
44
|
-
accessibilityRole: "button"
|
|
45
|
-
// Spelled out, because the chip is a dot, a word and two
|
|
46
|
-
// numbers — three of which Fabric merges into the container,
|
|
47
|
-
// leaving assistive tech with an unnamed control.
|
|
48
|
-
,
|
|
49
|
-
accessibilityLabel: `${source.label} filter, ${isEnabled ? "on" : "off"}, ${eventCount} event${eventCount === 1 ? "" : "s"}`,
|
|
50
|
-
style: [styles.badge, isEnabled ? {
|
|
51
|
-
backgroundColor: night.color.surface,
|
|
52
|
-
borderColor: source.color + "50"
|
|
53
|
-
} : styles.badgeDisabled],
|
|
54
|
-
onPress: () => onToggleSource(source.source),
|
|
55
|
-
activeOpacity: 0.7,
|
|
56
|
-
children: [hasSubscriberTracking && /*#__PURE__*/_jsx(View, {
|
|
57
|
-
style: [styles.countBadge, {
|
|
58
|
-
backgroundColor: isEnabled ? subscriberCount > 0 ? source.color + "25" : night.color.fillSecondary : night.color.fill
|
|
59
|
-
}],
|
|
60
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
61
|
-
style: [styles.countText, {
|
|
62
|
-
color: isEnabled ? subscriberCount > 0 ? source.color : night.color.textTertiary : night.color.textTertiary
|
|
63
|
-
}],
|
|
64
|
-
testID: `${testID}-subscribers`,
|
|
65
|
-
children: subscriberCount
|
|
66
|
-
})
|
|
67
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
68
|
-
style: [styles.dot, {
|
|
69
|
-
backgroundColor: isEnabled ? source.color : night.color.fillTertiary
|
|
70
|
-
}]
|
|
71
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
72
|
-
style: [styles.badgeLabel, {
|
|
73
|
-
color: isEnabled ? night.color.text : night.color.textTertiary
|
|
74
|
-
}],
|
|
75
|
-
numberOfLines: 1,
|
|
76
|
-
testID: `${testID}-label`,
|
|
77
|
-
children: source.label
|
|
78
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
79
|
-
style: [styles.countBadge, {
|
|
80
|
-
backgroundColor: isEnabled ? eventCount > 0 ? source.color + "20" : night.color.fill : night.color.fill
|
|
81
|
-
}],
|
|
82
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
83
|
-
style: [styles.countText, {
|
|
84
|
-
color: isEnabled ? eventCount > 0 ? source.color : night.color.textTertiary : night.color.textTertiary
|
|
85
|
-
}],
|
|
86
|
-
testID: `${testID}-count`,
|
|
87
|
-
children: eventCount
|
|
88
|
-
})
|
|
89
|
-
})]
|
|
90
|
-
}, source.source);
|
|
91
|
-
})
|
|
92
|
-
}), filteredCount < totalCount && /*#__PURE__*/_jsxs(Text, {
|
|
93
|
-
style: styles.filterInfo,
|
|
94
|
-
testID: `${EVENTS_TEST_ID}-showing`,
|
|
95
|
-
children: ["Showing ", filteredCount, " of ", totalCount]
|
|
96
|
-
})]
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
const styles = StyleSheet.create({
|
|
100
|
-
container: {
|
|
101
|
-
paddingVertical: 8,
|
|
102
|
-
// Transparent so the night sheet's star field shows through.
|
|
103
|
-
backgroundColor: "transparent",
|
|
104
|
-
borderBottomWidth: 1,
|
|
105
|
-
borderBottomColor: night.color.border
|
|
106
|
-
},
|
|
107
|
-
badgesRow: {
|
|
108
|
-
flexDirection: "row",
|
|
109
|
-
gap: 8,
|
|
110
|
-
paddingHorizontal: 12
|
|
111
|
-
},
|
|
112
|
-
badge: {
|
|
113
|
-
flexDirection: "row",
|
|
114
|
-
alignItems: "center",
|
|
115
|
-
paddingVertical: 5,
|
|
116
|
-
paddingHorizontal: 6,
|
|
117
|
-
borderRadius: 20,
|
|
118
|
-
borderWidth: 1,
|
|
119
|
-
gap: 6,
|
|
120
|
-
flexShrink: 0
|
|
121
|
-
},
|
|
122
|
-
badgeDisabled: {
|
|
123
|
-
backgroundColor: night.color.surface,
|
|
124
|
-
borderColor: night.color.border,
|
|
125
|
-
opacity: 0.5
|
|
126
|
-
},
|
|
127
|
-
dot: {
|
|
128
|
-
width: 7,
|
|
129
|
-
height: 7,
|
|
130
|
-
borderRadius: 4
|
|
131
|
-
},
|
|
132
|
-
badgeLabel: {
|
|
133
|
-
fontSize: 12,
|
|
134
|
-
fontWeight: "500"
|
|
135
|
-
},
|
|
136
|
-
countBadge: {
|
|
137
|
-
minWidth: 18,
|
|
138
|
-
height: 18,
|
|
139
|
-
borderRadius: 9,
|
|
140
|
-
alignItems: "center",
|
|
141
|
-
justifyContent: "center",
|
|
142
|
-
paddingHorizontal: 5
|
|
143
|
-
},
|
|
144
|
-
countText: {
|
|
145
|
-
fontSize: 10,
|
|
146
|
-
fontWeight: "600",
|
|
147
|
-
fontVariant: ["tabular-nums"]
|
|
148
|
-
},
|
|
149
|
-
filterInfo: {
|
|
150
|
-
marginTop: 6,
|
|
151
|
-
fontSize: 11,
|
|
152
|
-
color: night.color.textTertiary,
|
|
153
|
-
textAlign: "center"
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
//# sourceMappingURL=UnifiedEventFilters.js.map
|
|
1
|
+
"use strict";import{View as a,Text as s,TouchableOpacity as m,StyleSheet as x,ScrollView as p}from"react-native";import{memo as T}from"react";import{night as o}from"@buoy-gg/shared-ui";import{EVENTS_TEST_ID as d,eventFilterTestID as I}from"../utils/testIDs";import{jsx as l,jsxs as b}from"react/jsx-runtime";export const UnifiedEventFilters=T(function D({availableSources:f,onToggleSource:u,totalCount:g,filteredCount:h}){if(f.length===0){return null}return b(a,{style:e.container,testID:`${d}-filter-bar`,children:[l(p,{horizontal:true,showsHorizontalScrollIndicator:false,contentContainerStyle:e.badgesRow,testID:`${d}-filter-scroll`,children:f.map(t=>{const r=t.enabled!==false;const n=t.subscriberCount;const y=n!==void 0;const i=t.count||0;const c=I(t.source);return b(m,{testID:c,accessibilityRole:"button",accessibilityLabel:`${t.label} filter, ${r?"on":"off"}, ${i} event${i===1?"":"s"}`,style:[e.badge,r?{backgroundColor:o.color.surface,borderColor:t.color+"50"}:e.badgeDisabled],onPress:()=>u(t.source),activeOpacity:.7,children:[y&&l(a,{style:[e.countBadge,{backgroundColor:r?n>0?t.color+"25":o.color.fillSecondary:o.color.fill}],children:l(s,{style:[e.countText,{color:r?n>0?t.color:o.color.textTertiary:o.color.textTertiary}],testID:`${c}-subscribers`,children:n})}),l(a,{style:[e.dot,{backgroundColor:r?t.color:o.color.fillTertiary}]}),l(s,{style:[e.badgeLabel,{color:r?o.color.text:o.color.textTertiary}],numberOfLines:1,testID:`${c}-label`,children:t.label}),l(a,{style:[e.countBadge,{backgroundColor:r?i>0?t.color+"20":o.color.fill:o.color.fill}],children:l(s,{style:[e.countText,{color:r?i>0?t.color:o.color.textTertiary:o.color.textTertiary}],testID:`${c}-count`,children:i})})]},t.source)})}),h<g&&b(s,{style:e.filterInfo,testID:`${d}-showing`,children:["Showing ",h," of ",g]})]})});const e=x.create({container:{paddingVertical:8,backgroundColor:"transparent",borderBottomWidth:1,borderBottomColor:o.color.border},badgesRow:{flexDirection:"row",gap:8,paddingHorizontal:12},badge:{flexDirection:"row",alignItems:"center",paddingVertical:5,paddingHorizontal:6,borderRadius:20,borderWidth:1,gap:6,flexShrink:0},badgeDisabled:{backgroundColor:o.color.surface,borderColor:o.color.border,opacity:.5},dot:{width:7,height:7,borderRadius:4},badgeLabel:{fontSize:12,fontWeight:"500"},countBadge:{minWidth:18,height:18,borderRadius:9,alignItems:"center",justifyContent:"center",paddingHorizontal:5},countText:{fontSize:10,fontWeight:"600",fontVariant:["tabular-nums"]},filterInfo:{marginTop:6,fontSize:11,color:o.color.textTertiary,textAlign:"center"}});
|
|
@@ -1,412 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { loadToolModule, getToolModuleVersion } from "@buoy-gg/shared-ui/utils";
|
|
4
|
-
/**
|
|
5
|
-
* UnifiedEventItem
|
|
6
|
-
*
|
|
7
|
-
* Renders a single event in the unified event timeline.
|
|
8
|
-
* Uses shared UI components from other packages when available,
|
|
9
|
-
* falls back to generic CompactRow when packages aren't installed.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { memo } from "react";
|
|
13
|
-
import { View, Text, StyleSheet } from "react-native";
|
|
14
|
-
import { CompactRow, formatRelativeTime, Pill } from "@buoy-gg/shared-ui";
|
|
15
|
-
import { eventRowTestID } from "../utils/testIDs";
|
|
16
|
-
|
|
17
|
-
// ============================================================================
|
|
18
|
-
// Optional Component Loading
|
|
19
|
-
// ============================================================================
|
|
20
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
-
function tryLoadOptionalComponents() {
|
|
22
|
-
const components = {
|
|
23
|
-
StorageEventCard: null,
|
|
24
|
-
getValueType: null,
|
|
25
|
-
ReduxActionItem: null,
|
|
26
|
-
NetworkEventItemCompact: null,
|
|
27
|
-
RouteEventItemCompact: null,
|
|
28
|
-
ZustandStateChangeItem: null,
|
|
29
|
-
JotaiAtomChangeItem: null
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
// Try to load storage components
|
|
33
|
-
try {
|
|
34
|
-
// @ts-ignore - Dynamic import that may not exist
|
|
35
|
-
const storage = loadToolModule("@buoy-gg/storage");
|
|
36
|
-
components.StorageEventCard = storage.StorageEventCard;
|
|
37
|
-
components.getValueType = storage.getValueType;
|
|
38
|
-
} catch {
|
|
39
|
-
// Optional dependency not installed
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// Try to load redux components
|
|
43
|
-
try {
|
|
44
|
-
// @ts-ignore - Dynamic import that may not exist
|
|
45
|
-
const redux = loadToolModule("@buoy-gg/redux");
|
|
46
|
-
components.ReduxActionItem = redux.ReduxActionItem;
|
|
47
|
-
} catch {
|
|
48
|
-
// Optional dependency not installed
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Try to load network components
|
|
52
|
-
try {
|
|
53
|
-
// @ts-ignore - Dynamic import that may not exist
|
|
54
|
-
const network = loadToolModule("@buoy-gg/network");
|
|
55
|
-
components.NetworkEventItemCompact = network.NetworkEventItemCompact;
|
|
56
|
-
} catch {
|
|
57
|
-
// Optional dependency not installed
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Try to load route events components
|
|
61
|
-
try {
|
|
62
|
-
// @ts-ignore - Dynamic import that may not exist
|
|
63
|
-
const routeEvents = loadToolModule("@buoy-gg/route-events");
|
|
64
|
-
components.RouteEventItemCompact = routeEvents.RouteEventItemCompact;
|
|
65
|
-
} catch {
|
|
66
|
-
// Optional dependency not installed
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Try to load zustand components
|
|
70
|
-
try {
|
|
71
|
-
// @ts-ignore - Dynamic import that may not exist
|
|
72
|
-
const zustand = loadToolModule("@buoy-gg/zustand");
|
|
73
|
-
components.ZustandStateChangeItem = zustand.ZustandStateChangeItem;
|
|
74
|
-
} catch {
|
|
75
|
-
// Optional dependency not installed
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Try to load jotai components
|
|
79
|
-
try {
|
|
80
|
-
// @ts-ignore - Dynamic import that may not exist
|
|
81
|
-
const jotai = loadToolModule("@buoy-gg/jotai");
|
|
82
|
-
components.JotaiAtomChangeItem = jotai.JotaiAtomChangeItem;
|
|
83
|
-
} catch {
|
|
84
|
-
// Optional dependency not installed
|
|
85
|
-
}
|
|
86
|
-
return components;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// Cache loaded components
|
|
90
|
-
let optionalComponents;
|
|
91
|
-
let componentVersion = -1;
|
|
92
|
-
function getOptionalComponents() {
|
|
93
|
-
if (!optionalComponents || componentVersion !== getToolModuleVersion()) {
|
|
94
|
-
optionalComponents = tryLoadOptionalComponents();
|
|
95
|
-
componentVersion = getToolModuleVersion();
|
|
96
|
-
}
|
|
97
|
-
return optionalComponents;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// ============================================================================
|
|
101
|
-
// Configuration
|
|
102
|
-
// ============================================================================
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Source configuration for display (used for fallback rendering)
|
|
106
|
-
*/
|
|
107
|
-
const SOURCE_CONFIG = {
|
|
108
|
-
"storage-async": {
|
|
109
|
-
label: "Storage",
|
|
110
|
-
color: "#8B5CF6" // Purple
|
|
111
|
-
},
|
|
112
|
-
"storage-mmkv": {
|
|
113
|
-
label: "MMKV",
|
|
114
|
-
color: "#F59E0B" // Orange
|
|
115
|
-
},
|
|
116
|
-
redux: {
|
|
117
|
-
label: "Redux",
|
|
118
|
-
color: "#3B82F6" // Blue
|
|
119
|
-
},
|
|
120
|
-
network: {
|
|
121
|
-
label: "Network",
|
|
122
|
-
color: "#10B981" // Green
|
|
123
|
-
},
|
|
124
|
-
"react-query": {
|
|
125
|
-
label: "Query",
|
|
126
|
-
color: "#EC4899" // Pink (legacy, kept for backwards compatibility)
|
|
127
|
-
},
|
|
128
|
-
"react-query-query": {
|
|
129
|
-
label: "Query",
|
|
130
|
-
color: "#EC4899" // Pink
|
|
131
|
-
},
|
|
132
|
-
"react-query-mutation": {
|
|
133
|
-
label: "Mutation",
|
|
134
|
-
color: "#F97316" // Orange - distinct from queries
|
|
135
|
-
},
|
|
136
|
-
route: {
|
|
137
|
-
label: "Route",
|
|
138
|
-
color: "#06B6D4" // Cyan
|
|
139
|
-
},
|
|
140
|
-
zustand: {
|
|
141
|
-
label: "Zustand",
|
|
142
|
-
color: "#764ABC" // Purple
|
|
143
|
-
},
|
|
144
|
-
jotai: {
|
|
145
|
-
label: "Jotai",
|
|
146
|
-
color: "#14B8A6" // Teal
|
|
147
|
-
},
|
|
148
|
-
render: {
|
|
149
|
-
label: "Render",
|
|
150
|
-
color: "#F472B6" // Pink
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Get status color based on event status
|
|
156
|
-
*/
|
|
157
|
-
function getStatusColor(status) {
|
|
158
|
-
switch (status) {
|
|
159
|
-
case "success":
|
|
160
|
-
return "#10B981";
|
|
161
|
-
// Green
|
|
162
|
-
case "error":
|
|
163
|
-
return "#EF4444";
|
|
164
|
-
// Red
|
|
165
|
-
case "pending":
|
|
166
|
-
return "#F59E0B";
|
|
167
|
-
// Orange
|
|
168
|
-
case "neutral":
|
|
169
|
-
default:
|
|
170
|
-
return "#6B7280";
|
|
171
|
-
// Gray
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Check if an event is a storage event
|
|
177
|
-
*/
|
|
178
|
-
function isStorageEvent(source) {
|
|
179
|
-
return source === "storage-async" || source === "storage-mmkv";
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// ============================================================================
|
|
183
|
-
// Component
|
|
184
|
-
// ============================================================================
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Correlation badge component - shows linked event indicator
|
|
188
|
-
*/
|
|
189
|
-
function CorrelationBadge({
|
|
190
|
-
label,
|
|
191
|
-
color,
|
|
192
|
-
testID
|
|
193
|
-
}) {
|
|
194
|
-
return /*#__PURE__*/_jsx(Pill, {
|
|
195
|
-
label: label,
|
|
196
|
-
color: color,
|
|
197
|
-
variant: "soft",
|
|
198
|
-
size: "sm",
|
|
199
|
-
style: {
|
|
200
|
-
marginLeft: 6
|
|
201
|
-
},
|
|
202
|
-
testID: testID
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Source badge configuration - short labels for top-right badge
|
|
208
|
-
* Colors match SOURCE_CONFIG used for filter badges
|
|
209
|
-
*/
|
|
210
|
-
const SOURCE_BADGE_LABELS = {
|
|
211
|
-
"storage-async": "STORAGE",
|
|
212
|
-
"storage-mmkv": "MMKV",
|
|
213
|
-
redux: "REDUX",
|
|
214
|
-
network: "NET",
|
|
215
|
-
"react-query": "QUERY",
|
|
216
|
-
"react-query-query": "QUERY",
|
|
217
|
-
"react-query-mutation": "MUTATION",
|
|
218
|
-
route: "ROUTE",
|
|
219
|
-
zustand: "ZUSTAND",
|
|
220
|
-
jotai: "JOTAI",
|
|
221
|
-
render: "RENDER"
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* Source badge wrapper - adds source type badge to top-right of any card
|
|
226
|
-
*/
|
|
227
|
-
function SourceBadgeWrapper({
|
|
228
|
-
source,
|
|
229
|
-
testID,
|
|
230
|
-
children
|
|
231
|
-
}) {
|
|
232
|
-
const color = SOURCE_CONFIG[source].color;
|
|
233
|
-
const label = SOURCE_BADGE_LABELS[source];
|
|
234
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
235
|
-
style: styles.badgeWrapper,
|
|
236
|
-
testID: testID,
|
|
237
|
-
children: [children, /*#__PURE__*/_jsx(View, {
|
|
238
|
-
style: [styles.sourceBadge, {
|
|
239
|
-
backgroundColor: `${color}20`
|
|
240
|
-
}],
|
|
241
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
242
|
-
style: [styles.sourceBadgeText, {
|
|
243
|
-
color
|
|
244
|
-
}],
|
|
245
|
-
testID: testID ? `${testID}-badge` : undefined,
|
|
246
|
-
children: label
|
|
247
|
-
})
|
|
248
|
-
})]
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
export const UnifiedEventItem = /*#__PURE__*/memo(function UnifiedEventItem({
|
|
252
|
-
event,
|
|
253
|
-
onPress,
|
|
254
|
-
isSelected = false,
|
|
255
|
-
isExpanded = false,
|
|
256
|
-
onNavigate,
|
|
257
|
-
correlationCount = 1,
|
|
258
|
-
correlationLabel,
|
|
259
|
-
correlationColor
|
|
260
|
-
}) {
|
|
261
|
-
const {
|
|
262
|
-
StorageEventCard,
|
|
263
|
-
getValueType,
|
|
264
|
-
ReduxActionItem,
|
|
265
|
-
NetworkEventItemCompact,
|
|
266
|
-
RouteEventItemCompact,
|
|
267
|
-
ZustandStateChangeItem,
|
|
268
|
-
JotaiAtomChangeItem
|
|
269
|
-
} = getOptionalComponents();
|
|
270
|
-
const sourceConfig = SOURCE_CONFIG[event.source];
|
|
271
|
-
const statusColor = getStatusColor(event.status);
|
|
272
|
-
const rowTestID = eventRowTestID(event);
|
|
273
|
-
|
|
274
|
-
// For storage events, try to use the shared StorageEventCard component
|
|
275
|
-
if (isStorageEvent(event.source) && StorageEventCard && getValueType) {
|
|
276
|
-
const originalEvent = event.originalEvent;
|
|
277
|
-
const cardData = {
|
|
278
|
-
key: originalEvent.data?.key || "unknown",
|
|
279
|
-
lastAction: originalEvent.action,
|
|
280
|
-
totalOperations: 1,
|
|
281
|
-
lastEventTimestamp: new Date(event.timestamp),
|
|
282
|
-
storageTypes: new Set([originalEvent.storageType || "async"]),
|
|
283
|
-
valueType: originalEvent.data?.value !== undefined ? getValueType(originalEvent.data.value) : undefined
|
|
284
|
-
};
|
|
285
|
-
return /*#__PURE__*/_jsx(SourceBadgeWrapper, {
|
|
286
|
-
source: event.source,
|
|
287
|
-
testID: rowTestID,
|
|
288
|
-
children: /*#__PURE__*/_jsx(StorageEventCard, {
|
|
289
|
-
data: cardData,
|
|
290
|
-
onPress: onPress,
|
|
291
|
-
isSelected: isSelected
|
|
292
|
-
})
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
// For Redux events, try to use the shared ReduxActionItem component
|
|
297
|
-
if (event.source === "redux" && ReduxActionItem) {
|
|
298
|
-
const reduxAction = event.originalEvent;
|
|
299
|
-
return /*#__PURE__*/_jsx(SourceBadgeWrapper, {
|
|
300
|
-
source: event.source,
|
|
301
|
-
testID: rowTestID,
|
|
302
|
-
children: /*#__PURE__*/_jsx(ReduxActionItem, {
|
|
303
|
-
action: reduxAction,
|
|
304
|
-
onPress: () => onPress()
|
|
305
|
-
})
|
|
306
|
-
});
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
// For network events, use the shared NetworkEventItemCompact component
|
|
310
|
-
// Note: No SourceBadgeWrapper needed - network card already has its own badges (FETCH, GQL, etc.)
|
|
311
|
-
if (event.source === "network" && NetworkEventItemCompact) {
|
|
312
|
-
const networkEvent = event.originalEvent;
|
|
313
|
-
return /*#__PURE__*/_jsx(View, {
|
|
314
|
-
testID: rowTestID,
|
|
315
|
-
children: /*#__PURE__*/_jsx(NetworkEventItemCompact, {
|
|
316
|
-
event: networkEvent,
|
|
317
|
-
onPress: () => onPress()
|
|
318
|
-
})
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
// For route events, try to use the shared RouteEventItemCompact component
|
|
323
|
-
if (event.source === "route" && RouteEventItemCompact) {
|
|
324
|
-
const routeEvent = event.originalEvent;
|
|
325
|
-
return /*#__PURE__*/_jsx(SourceBadgeWrapper, {
|
|
326
|
-
source: event.source,
|
|
327
|
-
testID: rowTestID,
|
|
328
|
-
children: /*#__PURE__*/_jsx(RouteEventItemCompact, {
|
|
329
|
-
event: routeEvent,
|
|
330
|
-
visitNumber: 0,
|
|
331
|
-
isExpanded: isExpanded,
|
|
332
|
-
onPress: () => onPress(),
|
|
333
|
-
onNavigate: onNavigate
|
|
334
|
-
})
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
// For Zustand events, try to use the shared ZustandStateChangeItem component
|
|
339
|
-
if (event.source === "zustand" && ZustandStateChangeItem) {
|
|
340
|
-
return /*#__PURE__*/_jsx(SourceBadgeWrapper, {
|
|
341
|
-
source: event.source,
|
|
342
|
-
testID: rowTestID,
|
|
343
|
-
children: /*#__PURE__*/_jsx(ZustandStateChangeItem, {
|
|
344
|
-
change: event.originalEvent,
|
|
345
|
-
onPress: () => onPress()
|
|
346
|
-
})
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
// For Jotai events, try to use the shared JotaiAtomChangeItem component
|
|
351
|
-
if (event.source === "jotai" && JotaiAtomChangeItem) {
|
|
352
|
-
return /*#__PURE__*/_jsx(SourceBadgeWrapper, {
|
|
353
|
-
source: event.source,
|
|
354
|
-
testID: rowTestID,
|
|
355
|
-
children: /*#__PURE__*/_jsx(JotaiAtomChangeItem, {
|
|
356
|
-
change: event.originalEvent,
|
|
357
|
-
onPress: () => onPress()
|
|
358
|
-
})
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
// Fallback: Use CompactRow for all events when specific components aren't available
|
|
363
|
-
const customBadge = correlationLabel && correlationColor ? /*#__PURE__*/_jsx(CorrelationBadge, {
|
|
364
|
-
label: correlationLabel,
|
|
365
|
-
color: correlationColor,
|
|
366
|
-
testID: `${rowTestID}-correlation`
|
|
367
|
-
}) : null;
|
|
368
|
-
return /*#__PURE__*/_jsx(CompactRow
|
|
369
|
-
// Status section - shows source type
|
|
370
|
-
, {
|
|
371
|
-
statusDotColor: sourceConfig.color,
|
|
372
|
-
statusLabel: sourceConfig.label
|
|
373
|
-
// Content section - shows event details
|
|
374
|
-
,
|
|
375
|
-
primaryText: event.title,
|
|
376
|
-
secondaryText: event.subtitle
|
|
377
|
-
// Badge section - shows correlation indicator for linked events
|
|
378
|
-
,
|
|
379
|
-
badgeText: correlationCount > 1 && !correlationLabel ? `${correlationCount}` : "",
|
|
380
|
-
badgeColor: correlationColor || statusColor,
|
|
381
|
-
customBadge: customBadge
|
|
382
|
-
// Timestamp at bottom right
|
|
383
|
-
,
|
|
384
|
-
bottomRightText: formatRelativeTime(new Date(event.timestamp))
|
|
385
|
-
// Interaction
|
|
386
|
-
,
|
|
387
|
-
showChevron: true,
|
|
388
|
-
isSelected: isSelected,
|
|
389
|
-
onPress: onPress,
|
|
390
|
-
testID: rowTestID
|
|
391
|
-
});
|
|
392
|
-
});
|
|
393
|
-
const styles = StyleSheet.create({
|
|
394
|
-
badgeWrapper: {
|
|
395
|
-
position: "relative"
|
|
396
|
-
},
|
|
397
|
-
sourceBadge: {
|
|
398
|
-
position: "absolute",
|
|
399
|
-
top: 4,
|
|
400
|
-
right: 12,
|
|
401
|
-
paddingHorizontal: 6,
|
|
402
|
-
paddingVertical: 2,
|
|
403
|
-
borderRadius: 4,
|
|
404
|
-
zIndex: 10
|
|
405
|
-
},
|
|
406
|
-
sourceBadgeText: {
|
|
407
|
-
fontSize: 8,
|
|
408
|
-
fontWeight: "700",
|
|
409
|
-
letterSpacing: 0.5
|
|
410
|
-
}
|
|
411
|
-
});
|
|
412
|
-
//# sourceMappingURL=UnifiedEventItem.js.map
|
|
1
|
+
"use strict";import{loadToolModule as s,getToolModuleVersion as R}from"@buoy-gg/shared-ui/utils";import{memo as A}from"react";import{View as m,Text as N,StyleSheet as O}from"react-native";import{CompactRow as U,formatRelativeTime as V,Pill as j}from"@buoy-gg/shared-ui";import{eventRowTestID as z}from"../utils/testIDs";import{jsx as o,jsxs as q}from"react/jsx-runtime";function F(){const e={StorageEventCard:null,getValueType:null,ReduxActionItem:null,NetworkEventItemCompact:null,RouteEventItemCompact:null,ZustandStateChangeItem:null,JotaiAtomChangeItem:null};try{const t=s("@buoy-gg/storage");e.StorageEventCard=t.StorageEventCard;e.getValueType=t.getValueType}catch{}try{const t=s("@buoy-gg/redux");e.ReduxActionItem=t.ReduxActionItem}catch{}try{const t=s("@buoy-gg/network");e.NetworkEventItemCompact=t.NetworkEventItemCompact}catch{}try{const t=s("@buoy-gg/route-events");e.RouteEventItemCompact=t.RouteEventItemCompact}catch{}try{const t=s("@buoy-gg/zustand");e.ZustandStateChangeItem=t.ZustandStateChangeItem}catch{}try{const t=s("@buoy-gg/jotai");e.JotaiAtomChangeItem=t.JotaiAtomChangeItem}catch{}return e}let g;let S=-1;function M(){if(!g||S!==R()){g=F();S=R()}return g}const w={"storage-async":{label:"Storage",color:"#8B5CF6"},"storage-mmkv":{label:"MMKV",color:"#F59E0B"},redux:{label:"Redux",color:"#3B82F6"},network:{label:"Network",color:"#10B981"},"react-query":{label:"Query",color:"#EC4899"},"react-query-query":{label:"Query",color:"#EC4899"},"react-query-mutation":{label:"Mutation",color:"#F97316"},route:{label:"Route",color:"#06B6D4"},zustand:{label:"Zustand",color:"#764ABC"},jotai:{label:"Jotai",color:"#14B8A6"},render:{label:"Render",color:"#F472B6"}};function J(e){switch(e){case"success":return"#10B981";case"error":return"#EF4444";case"pending":return"#F59E0B";case"neutral":default:return"#6B7280"}}function Z(e){return e==="storage-async"||e==="storage-mmkv"}function _({label:e,color:t,testID:r}){return o(j,{label:e,color:t,variant:"soft",size:"sm",style:{marginLeft:6},testID:r})}const Q={"storage-async":"STORAGE","storage-mmkv":"MMKV",redux:"REDUX",network:"NET","react-query":"QUERY","react-query-query":"QUERY","react-query-mutation":"MUTATION",route:"ROUTE",zustand:"ZUSTAND",jotai:"JOTAI",render:"RENDER"};function u({source:e,testID:t,children:r}){const c=w[e].color;const l=Q[e];return q(m,{style:p.badgeWrapper,testID:t,children:[r,o(m,{style:[p.sourceBadge,{backgroundColor:`${c}20`}],children:o(N,{style:[p.sourceBadgeText,{color:c}],testID:t?`${t}-badge`:void 0,children:l})})]})}export const UnifiedEventItem=A(function e({event:t,onPress:r,isSelected:c=false,isExpanded:l=false,onNavigate:B,correlationCount:y=1,correlationLabel:i,correlationColor:d}){const{StorageEventCard:E,getValueType:I,ReduxActionItem:C,NetworkEventItemCompact:f,RouteEventItemCompact:h,ZustandStateChangeItem:b,JotaiAtomChangeItem:T}=M();const x=w[t.source];const D=J(t.status);const n=z(t);if(Z(t.source)&&E&&I){const a=t.originalEvent;const k={key:a.data?.key||"unknown",lastAction:a.action,totalOperations:1,lastEventTimestamp:new Date(t.timestamp),storageTypes:new Set([a.storageType||"async"]),valueType:a.data?.value!==void 0?I(a.data.value):void 0};return o(u,{source:t.source,testID:n,children:o(E,{data:k,onPress:r,isSelected:c})})}if(t.source==="redux"&&C){const a=t.originalEvent;return o(u,{source:t.source,testID:n,children:o(C,{action:a,onPress:()=>r()})})}if(t.source==="network"&&f){const a=t.originalEvent;return o(m,{testID:n,children:o(f,{event:a,onPress:()=>r()})})}if(t.source==="route"&&h){const a=t.originalEvent;return o(u,{source:t.source,testID:n,children:o(h,{event:a,visitNumber:0,isExpanded:l,onPress:()=>r(),onNavigate:B})})}if(t.source==="zustand"&&b){return o(u,{source:t.source,testID:n,children:o(b,{change:t.originalEvent,onPress:()=>r()})})}if(t.source==="jotai"&&T){return o(u,{source:t.source,testID:n,children:o(T,{change:t.originalEvent,onPress:()=>r()})})}const v=i&&d?o(_,{label:i,color:d,testID:`${n}-correlation`}):null;return o(U,{statusDotColor:x.color,statusLabel:x.label,primaryText:t.title,secondaryText:t.subtitle,badgeText:y>1&&!i?`${y}`:"",badgeColor:d||D,customBadge:v,bottomRightText:V(new Date(t.timestamp)),showChevron:true,isSelected:c,onPress:r,testID:n})});const p=O.create({badgeWrapper:{position:"relative"},sourceBadge:{position:"absolute",top:4,right:12,paddingHorizontal:6,paddingVertical:2,borderRadius:4,zIndex:10},sourceBadgeText:{fontSize:8,fontWeight:"700",letterSpacing:.5}});
|