@lvce-editor/chat-debug-view 2.3.0 → 2.5.0
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.
|
@@ -1518,8 +1518,17 @@ const getFilteredEvents = (events, filterValue, showInputEvents) => {
|
|
|
1518
1518
|
return visibleEvents.filter(event => JSON.stringify(event).toLowerCase().includes(normalizedFilter));
|
|
1519
1519
|
};
|
|
1520
1520
|
|
|
1521
|
+
const withSessionEventIds = events => {
|
|
1522
|
+
return events.map((event, index) => {
|
|
1523
|
+
return {
|
|
1524
|
+
...event,
|
|
1525
|
+
eventId: index + 1
|
|
1526
|
+
};
|
|
1527
|
+
});
|
|
1528
|
+
};
|
|
1521
1529
|
const renderItems = (oldState, newState) => {
|
|
1522
|
-
const
|
|
1530
|
+
const eventsWithIds = withSessionEventIds(newState.events);
|
|
1531
|
+
const filteredEvents = getFilteredEvents(eventsWithIds, newState.filterValue, newState.showInputEvents);
|
|
1523
1532
|
const dom = getChatDebugViewDom(newState.sessionId, newState.errorMessage, newState.filterValue, newState.showInputEvents, filteredEvents);
|
|
1524
1533
|
return [SetDom2, newState.uid, dom];
|
|
1525
1534
|
};
|