@buoy-gg/events 2.1.1
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/LICENSE +58 -0
- package/README.md +55 -0
- package/lib/commonjs/components/EventsCopySettingsView.js +645 -0
- package/lib/commonjs/components/EventsModal.js +263 -0
- package/lib/commonjs/components/ReactQueryEventDetail.js +428 -0
- package/lib/commonjs/components/UnifiedEventDetail.js +370 -0
- package/lib/commonjs/components/UnifiedEventFilters.js +113 -0
- package/lib/commonjs/components/UnifiedEventItem.js +349 -0
- package/lib/commonjs/components/UnifiedEventList.js +154 -0
- package/lib/commonjs/components/UnifiedEventViewer.js +126 -0
- package/lib/commonjs/hooks/useUnifiedEvents.js +237 -0
- package/lib/commonjs/index.js +205 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/preset.js +66 -0
- package/lib/commonjs/stores/unifiedEventStore.js +413 -0
- package/lib/commonjs/types/copySettings.js +220 -0
- package/lib/commonjs/types/index.js +17 -0
- package/lib/commonjs/utils/autoDiscoverEventSources.js +640 -0
- package/lib/commonjs/utils/badgeSelectionStorage.js +58 -0
- package/lib/commonjs/utils/copySettingsStorage.js +66 -0
- package/lib/commonjs/utils/correlationUtils.js +130 -0
- package/lib/commonjs/utils/eventExportFormatter.js +1095 -0
- package/lib/commonjs/utils/eventTransformers.js +496 -0
- package/lib/module/components/EventsCopySettingsView.js +641 -0
- package/lib/module/components/EventsModal.js +259 -0
- package/lib/module/components/ReactQueryEventDetail.js +424 -0
- package/lib/module/components/UnifiedEventDetail.js +366 -0
- package/lib/module/components/UnifiedEventFilters.js +109 -0
- package/lib/module/components/UnifiedEventItem.js +345 -0
- package/lib/module/components/UnifiedEventList.js +150 -0
- package/lib/module/components/UnifiedEventViewer.js +122 -0
- package/lib/module/hooks/useUnifiedEvents.js +234 -0
- package/lib/module/index.js +77 -0
- package/lib/module/preset.js +62 -0
- package/lib/module/stores/unifiedEventStore.js +387 -0
- package/lib/module/types/copySettings.js +215 -0
- package/lib/module/types/index.js +37 -0
- package/lib/module/utils/autoDiscoverEventSources.js +633 -0
- package/lib/module/utils/badgeSelectionStorage.js +52 -0
- package/lib/module/utils/copySettingsStorage.js +61 -0
- package/lib/module/utils/correlationUtils.js +120 -0
- package/lib/module/utils/eventExportFormatter.js +1085 -0
- package/lib/module/utils/eventTransformers.js +487 -0
- package/lib/typescript/components/EventsCopySettingsView.d.ts +16 -0
- package/lib/typescript/components/EventsModal.d.ts +16 -0
- package/lib/typescript/components/ReactQueryEventDetail.d.ts +15 -0
- package/lib/typescript/components/UnifiedEventDetail.d.ts +15 -0
- package/lib/typescript/components/UnifiedEventFilters.d.ts +21 -0
- package/lib/typescript/components/UnifiedEventItem.d.ts +26 -0
- package/lib/typescript/components/UnifiedEventList.d.ts +27 -0
- package/lib/typescript/components/UnifiedEventViewer.d.ts +8 -0
- package/lib/typescript/hooks/useUnifiedEvents.d.ts +30 -0
- package/lib/typescript/index.d.ts +28 -0
- package/lib/typescript/preset.d.ts +62 -0
- package/lib/typescript/stores/unifiedEventStore.d.ts +146 -0
- package/lib/typescript/types/copySettings.d.ts +179 -0
- package/lib/typescript/types/index.d.ts +73 -0
- package/lib/typescript/utils/autoDiscoverEventSources.d.ts +74 -0
- package/lib/typescript/utils/badgeSelectionStorage.d.ts +21 -0
- package/lib/typescript/utils/copySettingsStorage.d.ts +21 -0
- package/lib/typescript/utils/correlationUtils.d.ts +36 -0
- package/lib/typescript/utils/eventExportFormatter.d.ts +49 -0
- package/lib/typescript/utils/eventTransformers.d.ts +119 -0
- package/package.json +91 -0
- package/src/components/EventsCopySettingsView.tsx +742 -0
- package/src/components/EventsModal.tsx +328 -0
- package/src/components/ReactQueryEventDetail.tsx +413 -0
- package/src/components/UnifiedEventDetail.tsx +371 -0
- package/src/components/UnifiedEventFilters.tsx +156 -0
- package/src/components/UnifiedEventItem.tsx +396 -0
- package/src/components/UnifiedEventList.tsx +197 -0
- package/src/components/UnifiedEventViewer.tsx +132 -0
- package/src/hooks/useUnifiedEvents.ts +288 -0
- package/src/index.tsx +112 -0
- package/src/preset.tsx +57 -0
- package/src/stores/unifiedEventStore.ts +405 -0
- package/src/types/copySettings.ts +269 -0
- package/src/types/index.ts +96 -0
- package/src/utils/autoDiscoverEventSources.ts +690 -0
- package/src/utils/badgeSelectionStorage.ts +51 -0
- package/src/utils/copySettingsStorage.ts +61 -0
- package/src/utils/correlationUtils.ts +146 -0
- package/src/utils/eventExportFormatter.ts +1233 -0
- package/src/utils/eventTransformers.ts +567 -0
|
@@ -0,0 +1,645 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.EventsCopySettingsView = EventsCopySettingsView;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
10
|
+
var _dataViewer = require("@buoy-gg/shared-ui/dataViewer");
|
|
11
|
+
var _copySettings = require("../types/copySettings");
|
|
12
|
+
var _eventExportFormatter = require("../utils/eventExportFormatter");
|
|
13
|
+
var _copySettingsStorage = require("../utils/copySettingsStorage");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
/**
|
|
16
|
+
* EventsCopySettingsView
|
|
17
|
+
*
|
|
18
|
+
* Settings UI for configuring event export format and content.
|
|
19
|
+
* Based on NetworkCopySettingsView pattern.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
// Size thresholds for warnings
|
|
23
|
+
const SIZE_WARNING_THRESHOLD = 50 * 1024; // 50KB
|
|
24
|
+
const SIZE_DANGER_THRESHOLD = 200 * 1024; // 200KB
|
|
25
|
+
|
|
26
|
+
// Helper to format bytes
|
|
27
|
+
function formatBytes(bytes) {
|
|
28
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
29
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
30
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Mock events for preview when no real events exist
|
|
34
|
+
function createMockEvents() {
|
|
35
|
+
const now = Date.now();
|
|
36
|
+
return [{
|
|
37
|
+
id: "mock-1",
|
|
38
|
+
source: "storage-async",
|
|
39
|
+
timestamp: now - 2000,
|
|
40
|
+
title: "Set Item",
|
|
41
|
+
subtitle: "user_cart",
|
|
42
|
+
status: "success",
|
|
43
|
+
originalEvent: {
|
|
44
|
+
action: "setItem",
|
|
45
|
+
key: "user_cart",
|
|
46
|
+
value: {
|
|
47
|
+
items: 2
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}, {
|
|
51
|
+
id: "mock-2",
|
|
52
|
+
source: "react-query-query",
|
|
53
|
+
timestamp: now - 1500,
|
|
54
|
+
title: "cart \u203A items",
|
|
55
|
+
subtitle: "Fetching...",
|
|
56
|
+
status: "pending",
|
|
57
|
+
originalEvent: {
|
|
58
|
+
type: "query-fetch-start",
|
|
59
|
+
queryKey: ["cart", "items"]
|
|
60
|
+
},
|
|
61
|
+
correlationId: "rq-query-cart",
|
|
62
|
+
sequenceInGroup: 1
|
|
63
|
+
}, {
|
|
64
|
+
id: "mock-3",
|
|
65
|
+
source: "react-query-query",
|
|
66
|
+
timestamp: now - 1000,
|
|
67
|
+
title: "cart \u203A items",
|
|
68
|
+
subtitle: "Success \u00B7 500ms",
|
|
69
|
+
status: "success",
|
|
70
|
+
originalEvent: {
|
|
71
|
+
type: "query-fetch-success",
|
|
72
|
+
queryKey: ["cart", "items"],
|
|
73
|
+
data: {
|
|
74
|
+
items: []
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
correlationId: "rq-query-cart",
|
|
78
|
+
sequenceInGroup: 2
|
|
79
|
+
}, {
|
|
80
|
+
id: "mock-4",
|
|
81
|
+
source: "network",
|
|
82
|
+
timestamp: now - 500,
|
|
83
|
+
title: "POST /api/checkout",
|
|
84
|
+
subtitle: "402 \u00B7 450ms",
|
|
85
|
+
status: "error",
|
|
86
|
+
originalEvent: {
|
|
87
|
+
method: "POST",
|
|
88
|
+
url: "/api/checkout",
|
|
89
|
+
status: 402,
|
|
90
|
+
error: "Payment required"
|
|
91
|
+
}
|
|
92
|
+
}];
|
|
93
|
+
}
|
|
94
|
+
function EventsCopySettingsView({
|
|
95
|
+
events = [],
|
|
96
|
+
initialSettings = _copySettings.DEFAULT_COPY_SETTINGS,
|
|
97
|
+
onSettingsChange
|
|
98
|
+
}) {
|
|
99
|
+
const {
|
|
100
|
+
isPro
|
|
101
|
+
} = (0, _sharedUi.useFeatureGate)();
|
|
102
|
+
const [settings, setSettings] = (0, _react.useState)(initialSettings);
|
|
103
|
+
const [isPreviewExpanded, setIsPreviewExpanded] = (0, _react.useState)(false);
|
|
104
|
+
const [isLoaded, setIsLoaded] = (0, _react.useState)(false);
|
|
105
|
+
|
|
106
|
+
// Load persisted settings on mount
|
|
107
|
+
(0, _react.useEffect)(() => {
|
|
108
|
+
let mounted = true;
|
|
109
|
+
(0, _copySettingsStorage.loadCopySettings)().then(savedSettings => {
|
|
110
|
+
if (mounted && savedSettings) {
|
|
111
|
+
setSettings(savedSettings);
|
|
112
|
+
onSettingsChange?.(savedSettings);
|
|
113
|
+
}
|
|
114
|
+
if (mounted) {
|
|
115
|
+
setIsLoaded(true);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
return () => {
|
|
119
|
+
mounted = false;
|
|
120
|
+
};
|
|
121
|
+
}, [onSettingsChange]);
|
|
122
|
+
|
|
123
|
+
// Update internal state, notify parent, and persist
|
|
124
|
+
const updateSettings = (0, _react.useCallback)(newSettings => {
|
|
125
|
+
setSettings(newSettings);
|
|
126
|
+
onSettingsChange?.(newSettings);
|
|
127
|
+
// Persist to storage
|
|
128
|
+
(0, _copySettingsStorage.saveCopySettings)(newSettings);
|
|
129
|
+
}, [onSettingsChange]);
|
|
130
|
+
|
|
131
|
+
// Use mock events if no real events
|
|
132
|
+
const hasLiveData = events.length > 0;
|
|
133
|
+
const previewEvents = hasLiveData ? events : createMockEvents();
|
|
134
|
+
|
|
135
|
+
// Detect active preset
|
|
136
|
+
const activePreset = (0, _react.useMemo)(() => (0, _copySettings.detectActivePreset)(settings), [settings]);
|
|
137
|
+
|
|
138
|
+
// Estimate size
|
|
139
|
+
const estimatedSize = (0, _react.useMemo)(() => (0, _eventExportFormatter.estimateExportSize)(previewEvents, settings), [previewEvents, settings]);
|
|
140
|
+
|
|
141
|
+
// Size warning level
|
|
142
|
+
const sizeWarningLevel = (0, _react.useMemo)(() => {
|
|
143
|
+
if (estimatedSize >= SIZE_DANGER_THRESHOLD) return "danger";
|
|
144
|
+
if (estimatedSize >= SIZE_WARNING_THRESHOLD) return "warning";
|
|
145
|
+
return "none";
|
|
146
|
+
}, [estimatedSize]);
|
|
147
|
+
|
|
148
|
+
// Generate copy text
|
|
149
|
+
const generateCopyText = (0, _react.useCallback)(() => {
|
|
150
|
+
return (0, _eventExportFormatter.generateExport)(previewEvents, settings);
|
|
151
|
+
}, [previewEvents, settings]);
|
|
152
|
+
|
|
153
|
+
// Handle preset selection
|
|
154
|
+
const applyPreset = (0, _react.useCallback)(presetName => {
|
|
155
|
+
const preset = _copySettings.COPY_PRESETS[presetName];
|
|
156
|
+
updateSettings({
|
|
157
|
+
...preset,
|
|
158
|
+
// Convert readonly array to mutable array
|
|
159
|
+
filterSources: [...preset.filterSources]
|
|
160
|
+
});
|
|
161
|
+
}, [updateSettings]);
|
|
162
|
+
|
|
163
|
+
// Handle option changes
|
|
164
|
+
const handleOptionChange = (0, _react.useCallback)((optionId, value) => {
|
|
165
|
+
const [group, key] = optionId.split("::");
|
|
166
|
+
if (group === "preset") {
|
|
167
|
+
applyPreset(key);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (group === "include") {
|
|
171
|
+
updateSettings({
|
|
172
|
+
...settings,
|
|
173
|
+
[key]: !settings[key]
|
|
174
|
+
});
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (group === "format") {
|
|
178
|
+
updateSettings({
|
|
179
|
+
...settings,
|
|
180
|
+
format: value
|
|
181
|
+
});
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (group === "timestamp") {
|
|
185
|
+
updateSettings({
|
|
186
|
+
...settings,
|
|
187
|
+
timestampFormat: value
|
|
188
|
+
});
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
if (group === "filter") {
|
|
192
|
+
updateSettings({
|
|
193
|
+
...settings,
|
|
194
|
+
filterMode: value
|
|
195
|
+
});
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (group === "threshold") {
|
|
199
|
+
updateSettings({
|
|
200
|
+
...settings,
|
|
201
|
+
dataSizeThreshold: value
|
|
202
|
+
});
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
}, [settings, updateSettings, applyPreset]);
|
|
206
|
+
|
|
207
|
+
// Render preview content
|
|
208
|
+
const renderPreviewContent = (0, _react.useCallback)(() => {
|
|
209
|
+
const eventCount = previewEvents.length;
|
|
210
|
+
|
|
211
|
+
// Collapsed state
|
|
212
|
+
if (!isPreviewExpanded) {
|
|
213
|
+
const warningColor = sizeWarningLevel === "danger" ? _sharedUi.macOSColors.semantic.error : sizeWarningLevel === "warning" ? _sharedUi.macOSColors.semantic.warning : _sharedUi.macOSColors.text.secondary;
|
|
214
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
215
|
+
style: styles.collapsedPreview,
|
|
216
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
217
|
+
style: styles.expandButton,
|
|
218
|
+
onPress: () => setIsPreviewExpanded(true),
|
|
219
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
220
|
+
style: styles.expandButtonContent,
|
|
221
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.Eye, {
|
|
222
|
+
size: 16,
|
|
223
|
+
color: _sharedUi.macOSColors.semantic.info
|
|
224
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
225
|
+
style: styles.expandButtonTextContainer,
|
|
226
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
227
|
+
style: styles.expandButtonTitle,
|
|
228
|
+
children: "Show Preview"
|
|
229
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
230
|
+
style: styles.expandButtonSubtitle,
|
|
231
|
+
children: [eventCount, " event", eventCount !== 1 ? "s" : "", " \\u00B7 ~", formatBytes(estimatedSize), !hasLiveData ? " (mock data)" : ""]
|
|
232
|
+
})]
|
|
233
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronDown, {
|
|
234
|
+
size: 16,
|
|
235
|
+
color: _sharedUi.macOSColors.text.muted
|
|
236
|
+
})]
|
|
237
|
+
})
|
|
238
|
+
}), sizeWarningLevel !== "none" && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
239
|
+
style: [styles.sizeWarning, sizeWarningLevel === "danger" && styles.sizeWarningDanger],
|
|
240
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.AlertTriangle, {
|
|
241
|
+
size: 12,
|
|
242
|
+
color: warningColor
|
|
243
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
244
|
+
style: [styles.sizeWarningText, {
|
|
245
|
+
color: warningColor
|
|
246
|
+
}],
|
|
247
|
+
children: sizeWarningLevel === "danger" ? "Very large payload - may cause performance issues" : "Large payload - preview may be slow"
|
|
248
|
+
})]
|
|
249
|
+
})]
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Expanded state
|
|
254
|
+
const exportText = generateCopyText();
|
|
255
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
256
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
257
|
+
style: styles.collapseButton,
|
|
258
|
+
onPress: () => setIsPreviewExpanded(false),
|
|
259
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
260
|
+
style: styles.collapseButtonText,
|
|
261
|
+
children: "Hide Preview"
|
|
262
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ChevronUp, {
|
|
263
|
+
size: 14,
|
|
264
|
+
color: _sharedUi.macOSColors.text.secondary
|
|
265
|
+
})]
|
|
266
|
+
}), settings.format === "json" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_dataViewer.DataViewer, {
|
|
267
|
+
data: JSON.parse(exportText),
|
|
268
|
+
title: "",
|
|
269
|
+
showTypeFilter: false
|
|
270
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
271
|
+
style: styles.previewScroll,
|
|
272
|
+
nestedScrollEnabled: true,
|
|
273
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
274
|
+
style: styles.previewText,
|
|
275
|
+
selectable: isPro,
|
|
276
|
+
children: exportText
|
|
277
|
+
})
|
|
278
|
+
})]
|
|
279
|
+
});
|
|
280
|
+
}, [isPreviewExpanded, previewEvents, settings, estimatedSize, sizeWarningLevel, hasLiveData, generateCopyText, isPro]);
|
|
281
|
+
|
|
282
|
+
// Render preview header actions
|
|
283
|
+
const renderPreviewHeaderActions = (0, _react.useCallback)(() => {
|
|
284
|
+
const summary = (0, _eventExportFormatter.getExportSummary)(previewEvents);
|
|
285
|
+
const statusLabel = hasLiveData ? `${summary.totalEvents} events` : "Mock data (no events captured)";
|
|
286
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
287
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
288
|
+
style: styles.statusLabel,
|
|
289
|
+
children: statusLabel
|
|
290
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToolbarCopyButton, {
|
|
291
|
+
value: generateCopyText()
|
|
292
|
+
})]
|
|
293
|
+
});
|
|
294
|
+
}, [hasLiveData, previewEvents, generateCopyText]);
|
|
295
|
+
|
|
296
|
+
// Build filter config
|
|
297
|
+
const dynamicFilterConfig = (0, _react.useMemo)(() => ({
|
|
298
|
+
sections: [
|
|
299
|
+
// Presets Section
|
|
300
|
+
{
|
|
301
|
+
id: "presets",
|
|
302
|
+
title: "Presets",
|
|
303
|
+
type: "custom",
|
|
304
|
+
data: [{
|
|
305
|
+
id: "preset::llm",
|
|
306
|
+
label: _copySettings.PRESET_METADATA.llm.label,
|
|
307
|
+
icon: _sharedUi.Zap,
|
|
308
|
+
color: _copySettings.PRESET_METADATA.llm.color,
|
|
309
|
+
value: "llm",
|
|
310
|
+
isActive: activePreset === "llm",
|
|
311
|
+
description: _copySettings.PRESET_METADATA.llm.description
|
|
312
|
+
}, {
|
|
313
|
+
id: "preset::bugReport",
|
|
314
|
+
label: _copySettings.PRESET_METADATA.bugReport.label,
|
|
315
|
+
icon: _sharedUi.AlertTriangle,
|
|
316
|
+
color: _copySettings.PRESET_METADATA.bugReport.color,
|
|
317
|
+
value: "bugReport",
|
|
318
|
+
isActive: activePreset === "bugReport",
|
|
319
|
+
description: _copySettings.PRESET_METADATA.bugReport.description
|
|
320
|
+
}, {
|
|
321
|
+
id: "preset::json",
|
|
322
|
+
label: _copySettings.PRESET_METADATA.json.label,
|
|
323
|
+
icon: _sharedUi.FileCode,
|
|
324
|
+
color: _copySettings.PRESET_METADATA.json.color,
|
|
325
|
+
value: "json",
|
|
326
|
+
isActive: activePreset === "json",
|
|
327
|
+
description: _copySettings.PRESET_METADATA.json.description
|
|
328
|
+
}, {
|
|
329
|
+
id: "preset::errors",
|
|
330
|
+
label: _copySettings.PRESET_METADATA.errors.label,
|
|
331
|
+
icon: _sharedUi.XCircle,
|
|
332
|
+
color: _copySettings.PRESET_METADATA.errors.color,
|
|
333
|
+
value: "errors",
|
|
334
|
+
isActive: activePreset === "errors",
|
|
335
|
+
description: _copySettings.PRESET_METADATA.errors.description
|
|
336
|
+
}, {
|
|
337
|
+
id: "preset::minimal",
|
|
338
|
+
label: _copySettings.PRESET_METADATA.minimal.label,
|
|
339
|
+
icon: _sharedUi.FileText,
|
|
340
|
+
color: _copySettings.PRESET_METADATA.minimal.color,
|
|
341
|
+
value: "minimal",
|
|
342
|
+
isActive: activePreset === "minimal",
|
|
343
|
+
description: _copySettings.PRESET_METADATA.minimal.description
|
|
344
|
+
}, {
|
|
345
|
+
id: "preset::custom",
|
|
346
|
+
label: "Custom",
|
|
347
|
+
icon: _sharedUi.Settings,
|
|
348
|
+
color: _sharedUi.macOSColors.text.secondary,
|
|
349
|
+
value: "custom",
|
|
350
|
+
isActive: activePreset === null,
|
|
351
|
+
description: "User-configured"
|
|
352
|
+
}]
|
|
353
|
+
},
|
|
354
|
+
// Include Section
|
|
355
|
+
{
|
|
356
|
+
id: "include",
|
|
357
|
+
title: "Include",
|
|
358
|
+
type: "custom",
|
|
359
|
+
data: [{
|
|
360
|
+
id: "include::includeSource",
|
|
361
|
+
label: "Source",
|
|
362
|
+
value: "includeSource",
|
|
363
|
+
isActive: settings.includeSource
|
|
364
|
+
}, {
|
|
365
|
+
id: "include::includeStatus",
|
|
366
|
+
label: "Status",
|
|
367
|
+
value: "includeStatus",
|
|
368
|
+
isActive: settings.includeStatus
|
|
369
|
+
}, {
|
|
370
|
+
id: "include::includeTitle",
|
|
371
|
+
label: "Title",
|
|
372
|
+
value: "includeTitle",
|
|
373
|
+
isActive: settings.includeTitle
|
|
374
|
+
}, {
|
|
375
|
+
id: "include::includeSubtitle",
|
|
376
|
+
label: "Subtitle",
|
|
377
|
+
value: "includeSubtitle",
|
|
378
|
+
isActive: settings.includeSubtitle
|
|
379
|
+
}, {
|
|
380
|
+
id: "include::includeCorrelation",
|
|
381
|
+
label: "Correlation",
|
|
382
|
+
value: "includeCorrelation",
|
|
383
|
+
isActive: settings.includeCorrelation
|
|
384
|
+
}, {
|
|
385
|
+
id: "include::includeDuration",
|
|
386
|
+
label: "Duration",
|
|
387
|
+
value: "includeDuration",
|
|
388
|
+
isActive: settings.includeDuration
|
|
389
|
+
}, {
|
|
390
|
+
id: "include::includeSummaryHeader",
|
|
391
|
+
label: "Summary",
|
|
392
|
+
value: "includeSummaryHeader",
|
|
393
|
+
isActive: settings.includeSummaryHeader
|
|
394
|
+
}, {
|
|
395
|
+
id: "include::includeEventData",
|
|
396
|
+
label: "Data",
|
|
397
|
+
value: "includeEventData",
|
|
398
|
+
isActive: settings.includeEventData
|
|
399
|
+
}]
|
|
400
|
+
},
|
|
401
|
+
// Format Section
|
|
402
|
+
{
|
|
403
|
+
id: "format",
|
|
404
|
+
title: "Format",
|
|
405
|
+
type: "custom",
|
|
406
|
+
data: [{
|
|
407
|
+
id: "format::markdown",
|
|
408
|
+
label: "Markdown",
|
|
409
|
+
icon: _sharedUi.FileText,
|
|
410
|
+
color: _sharedUi.macOSColors.semantic.info,
|
|
411
|
+
value: "markdown",
|
|
412
|
+
isActive: settings.format === "markdown"
|
|
413
|
+
}, {
|
|
414
|
+
id: "format::json",
|
|
415
|
+
label: "JSON",
|
|
416
|
+
icon: _sharedUi.FileCode,
|
|
417
|
+
color: _sharedUi.macOSColors.semantic.warning,
|
|
418
|
+
value: "json",
|
|
419
|
+
isActive: settings.format === "json"
|
|
420
|
+
}, {
|
|
421
|
+
id: "format::plaintext",
|
|
422
|
+
label: "Text",
|
|
423
|
+
icon: _sharedUi.Hash,
|
|
424
|
+
color: _sharedUi.macOSColors.text.secondary,
|
|
425
|
+
value: "plaintext",
|
|
426
|
+
isActive: settings.format === "plaintext"
|
|
427
|
+
}]
|
|
428
|
+
},
|
|
429
|
+
// Timestamp Section
|
|
430
|
+
{
|
|
431
|
+
id: "timestamp",
|
|
432
|
+
title: "Timestamps",
|
|
433
|
+
type: "custom",
|
|
434
|
+
data: [{
|
|
435
|
+
id: "timestamp::relative",
|
|
436
|
+
label: "Relative",
|
|
437
|
+
value: "relative",
|
|
438
|
+
isActive: settings.timestampFormat === "relative",
|
|
439
|
+
description: "+0ms, +150ms"
|
|
440
|
+
}, {
|
|
441
|
+
id: "timestamp::absolute",
|
|
442
|
+
label: "Absolute",
|
|
443
|
+
value: "absolute",
|
|
444
|
+
isActive: settings.timestampFormat === "absolute",
|
|
445
|
+
description: "ISO format"
|
|
446
|
+
}, {
|
|
447
|
+
id: "timestamp::both",
|
|
448
|
+
label: "Both",
|
|
449
|
+
value: "both",
|
|
450
|
+
isActive: settings.timestampFormat === "both",
|
|
451
|
+
description: "Both formats"
|
|
452
|
+
}]
|
|
453
|
+
},
|
|
454
|
+
// Filter Section
|
|
455
|
+
{
|
|
456
|
+
id: "filter",
|
|
457
|
+
title: "Filter Events",
|
|
458
|
+
type: "custom",
|
|
459
|
+
data: [{
|
|
460
|
+
id: "filter::all",
|
|
461
|
+
label: "All",
|
|
462
|
+
value: "all",
|
|
463
|
+
isActive: settings.filterMode === "all"
|
|
464
|
+
}, {
|
|
465
|
+
id: "filter::errors",
|
|
466
|
+
label: "Errors",
|
|
467
|
+
icon: _sharedUi.XCircle,
|
|
468
|
+
color: _sharedUi.macOSColors.semantic.error,
|
|
469
|
+
value: "errors",
|
|
470
|
+
isActive: settings.filterMode === "errors"
|
|
471
|
+
}, {
|
|
472
|
+
id: "filter::success",
|
|
473
|
+
label: "Success",
|
|
474
|
+
color: _sharedUi.macOSColors.semantic.success,
|
|
475
|
+
value: "success",
|
|
476
|
+
isActive: settings.filterMode === "success"
|
|
477
|
+
}, {
|
|
478
|
+
id: "filter::pending",
|
|
479
|
+
label: "Pending",
|
|
480
|
+
color: _sharedUi.macOSColors.semantic.warning,
|
|
481
|
+
value: "pending",
|
|
482
|
+
isActive: settings.filterMode === "pending"
|
|
483
|
+
}]
|
|
484
|
+
},
|
|
485
|
+
// LLM Optimization Section
|
|
486
|
+
{
|
|
487
|
+
id: "llmOptimization",
|
|
488
|
+
title: "LLM Optimization",
|
|
489
|
+
type: "custom",
|
|
490
|
+
data: [{
|
|
491
|
+
id: "include::compactMode",
|
|
492
|
+
label: "Compact",
|
|
493
|
+
value: "compactMode",
|
|
494
|
+
isActive: settings.compactMode,
|
|
495
|
+
description: "One line per event"
|
|
496
|
+
}, {
|
|
497
|
+
id: "include::smartJsonParsing",
|
|
498
|
+
label: "Smart JSON",
|
|
499
|
+
value: "smartJsonParsing",
|
|
500
|
+
isActive: settings.smartJsonParsing,
|
|
501
|
+
description: "Parse nested JSON"
|
|
502
|
+
}, {
|
|
503
|
+
id: "include::reduxChangedOnly",
|
|
504
|
+
label: "Redux Diff",
|
|
505
|
+
value: "reduxChangedOnly",
|
|
506
|
+
isActive: settings.reduxChangedOnly,
|
|
507
|
+
description: "Only show changes"
|
|
508
|
+
}, {
|
|
509
|
+
id: "include::showStorageDiff",
|
|
510
|
+
label: "Storage Diff",
|
|
511
|
+
value: "showStorageDiff",
|
|
512
|
+
isActive: settings.showStorageDiff,
|
|
513
|
+
description: "Show what changed"
|
|
514
|
+
}, {
|
|
515
|
+
id: "include::stripVerboseFields",
|
|
516
|
+
label: "Strip Noise",
|
|
517
|
+
value: "stripVerboseFields",
|
|
518
|
+
isActive: settings.stripVerboseFields,
|
|
519
|
+
description: "Remove images/descriptions"
|
|
520
|
+
}]
|
|
521
|
+
}],
|
|
522
|
+
previewSection: {
|
|
523
|
+
enabled: true,
|
|
524
|
+
title: "PREVIEW",
|
|
525
|
+
icon: _sharedUi.Eye,
|
|
526
|
+
content: renderPreviewContent,
|
|
527
|
+
headerActions: renderPreviewHeaderActions
|
|
528
|
+
},
|
|
529
|
+
onFilterChange: handleOptionChange
|
|
530
|
+
}), [settings, activePreset, handleOptionChange, renderPreviewContent, renderPreviewHeaderActions]);
|
|
531
|
+
|
|
532
|
+
// Pro gating - show banner at top with preview below (no floating)
|
|
533
|
+
if (!isPro) {
|
|
534
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
|
|
535
|
+
style: styles.gatedContainer,
|
|
536
|
+
contentContainerStyle: styles.gatedContent,
|
|
537
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ProFeatureBanner, {
|
|
538
|
+
featureName: "Events Export",
|
|
539
|
+
description: "Export event flows to share with your team, debug issues, or feed into AI tools.",
|
|
540
|
+
benefits: ["Export to Markdown, JSON, or plain text", "Customizable presets (LLM-ready, Bug Report, JSON)", "Share event flows with teammates", "Feed event context directly to AI assistants"]
|
|
541
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
542
|
+
style: styles.gatedPreview,
|
|
543
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.DynamicFilterView, {
|
|
544
|
+
...dynamicFilterConfig
|
|
545
|
+
})
|
|
546
|
+
})]
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.DynamicFilterView, {
|
|
550
|
+
...dynamicFilterConfig
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
const styles = _reactNative.StyleSheet.create({
|
|
554
|
+
collapsedPreview: {
|
|
555
|
+
gap: 8
|
|
556
|
+
},
|
|
557
|
+
expandButton: {
|
|
558
|
+
backgroundColor: _sharedUi.macOSColors.background.input,
|
|
559
|
+
borderRadius: 8,
|
|
560
|
+
borderWidth: 1,
|
|
561
|
+
borderColor: _sharedUi.macOSColors.border.default,
|
|
562
|
+
padding: 12
|
|
563
|
+
},
|
|
564
|
+
expandButtonContent: {
|
|
565
|
+
flexDirection: "row",
|
|
566
|
+
alignItems: "center",
|
|
567
|
+
gap: 10
|
|
568
|
+
},
|
|
569
|
+
expandButtonTextContainer: {
|
|
570
|
+
flex: 1
|
|
571
|
+
},
|
|
572
|
+
expandButtonTitle: {
|
|
573
|
+
fontSize: 13,
|
|
574
|
+
fontWeight: "600",
|
|
575
|
+
color: _sharedUi.macOSColors.text.primary
|
|
576
|
+
},
|
|
577
|
+
expandButtonSubtitle: {
|
|
578
|
+
fontSize: 11,
|
|
579
|
+
color: _sharedUi.macOSColors.text.secondary,
|
|
580
|
+
marginTop: 2
|
|
581
|
+
},
|
|
582
|
+
collapseButton: {
|
|
583
|
+
flexDirection: "row",
|
|
584
|
+
alignItems: "center",
|
|
585
|
+
justifyContent: "center",
|
|
586
|
+
gap: 6,
|
|
587
|
+
paddingVertical: 8,
|
|
588
|
+
marginBottom: 8,
|
|
589
|
+
backgroundColor: _sharedUi.macOSColors.background.hover,
|
|
590
|
+
borderRadius: 6,
|
|
591
|
+
borderWidth: 1,
|
|
592
|
+
borderColor: _sharedUi.macOSColors.border.default
|
|
593
|
+
},
|
|
594
|
+
collapseButtonText: {
|
|
595
|
+
fontSize: 12,
|
|
596
|
+
fontWeight: "500",
|
|
597
|
+
color: _sharedUi.macOSColors.text.secondary
|
|
598
|
+
},
|
|
599
|
+
sizeWarning: {
|
|
600
|
+
flexDirection: "row",
|
|
601
|
+
alignItems: "center",
|
|
602
|
+
gap: 6,
|
|
603
|
+
paddingHorizontal: 10,
|
|
604
|
+
paddingVertical: 6,
|
|
605
|
+
backgroundColor: _sharedUi.macOSColors.semantic.warningBackground,
|
|
606
|
+
borderRadius: 6,
|
|
607
|
+
borderWidth: 1,
|
|
608
|
+
borderColor: _sharedUi.macOSColors.semantic.warning + "30"
|
|
609
|
+
},
|
|
610
|
+
sizeWarningDanger: {
|
|
611
|
+
backgroundColor: _sharedUi.macOSColors.semantic.errorBackground,
|
|
612
|
+
borderColor: _sharedUi.macOSColors.semantic.error + "30"
|
|
613
|
+
},
|
|
614
|
+
sizeWarningText: {
|
|
615
|
+
fontSize: 11,
|
|
616
|
+
fontWeight: "500",
|
|
617
|
+
flex: 1
|
|
618
|
+
},
|
|
619
|
+
previewScroll: {
|
|
620
|
+
maxHeight: 300
|
|
621
|
+
},
|
|
622
|
+
previewText: {
|
|
623
|
+
fontFamily: "monospace",
|
|
624
|
+
fontSize: 11,
|
|
625
|
+
color: _sharedUi.macOSColors.text.primary,
|
|
626
|
+
lineHeight: 18
|
|
627
|
+
},
|
|
628
|
+
statusLabel: {
|
|
629
|
+
fontSize: 11,
|
|
630
|
+
fontWeight: "600",
|
|
631
|
+
color: _sharedUi.macOSColors.text.muted,
|
|
632
|
+
marginRight: 8
|
|
633
|
+
},
|
|
634
|
+
gatedContainer: {
|
|
635
|
+
flex: 1
|
|
636
|
+
},
|
|
637
|
+
gatedContent: {
|
|
638
|
+
padding: 12,
|
|
639
|
+
gap: 12
|
|
640
|
+
},
|
|
641
|
+
gatedPreview: {
|
|
642
|
+
// No flex: 1 so it doesn't try to fill remaining space
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
//# sourceMappingURL=EventsCopySettingsView.js.map
|