@djangocfg/ui-tools 2.1.377 → 2.1.379

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.
@@ -24,6 +24,25 @@ export interface ToolCallsProps {
24
24
  renderStreaming?: (text: string, call: ChatToolCall) => ReactNode;
25
25
  /** Single override for all three; specific renderers above take precedence. */
26
26
  renderPayload?: (value: unknown, kind: ToolPayloadKind, call: ChatToolCall) => ReactNode;
27
+ /**
28
+ * Rendered once **after** all tool-call panels — always visible, outside
29
+ * the collapsible panels. Use for rich UI derived from tool outputs (e.g.
30
+ * vehicle cards, map pins, tax breakdowns). Receives the full calls array
31
+ * so the renderer can aggregate across multiple tool calls.
32
+ */
33
+ renderAfterCalls?: (calls: ChatToolCall[]) => ReactNode;
34
+ /**
35
+ * Custom renderer for each individual tool-call panel. When provided,
36
+ * replaces the default collapsible `<ToolCallItem>`. Return `null` to
37
+ * suppress a specific call while still letting others render.
38
+ */
39
+ renderToolCall?: (call: ChatToolCall) => ReactNode;
40
+ /**
41
+ * When `true`, the collapsible tool-call panels are not rendered at all.
42
+ * `renderAfterCalls` still runs — use together to show only rich UI with
43
+ * no raw accordion panels visible.
44
+ */
45
+ hideToolCalls?: boolean;
27
46
  className?: string;
28
47
  }
29
48
 
@@ -35,23 +54,31 @@ export function ToolCalls({
35
54
  renderOutput,
36
55
  renderStreaming,
37
56
  renderPayload,
57
+ renderAfterCalls,
58
+ renderToolCall,
59
+ hideToolCalls = false,
38
60
  className,
39
61
  }: ToolCallsProps) {
40
62
  if (!calls?.length) return null;
41
63
  return (
42
64
  <div className={cn('mt-2 space-y-1.5', className)}>
43
- {calls.map((call) => (
44
- <ToolCallItem
45
- key={call.id}
46
- call={call}
47
- defaultExpanded={defaultExpanded}
48
- expandWhileStreaming={expandWhileStreaming}
49
- renderInput={renderInput}
50
- renderOutput={renderOutput}
51
- renderStreaming={renderStreaming}
52
- renderPayload={renderPayload}
53
- />
54
- ))}
65
+ {!hideToolCalls && calls.map((call) =>
66
+ renderToolCall
67
+ ? <div key={call.id}>{renderToolCall(call)}</div>
68
+ : (
69
+ <ToolCallItem
70
+ key={call.id}
71
+ call={call}
72
+ defaultExpanded={defaultExpanded}
73
+ expandWhileStreaming={expandWhileStreaming}
74
+ renderInput={renderInput}
75
+ renderOutput={renderOutput}
76
+ renderStreaming={renderStreaming}
77
+ renderPayload={renderPayload}
78
+ />
79
+ ),
80
+ )}
81
+ {renderAfterCalls ? renderAfterCalls(calls) : null}
55
82
  </div>
56
83
  );
57
84
  }
@@ -1,14 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkTUZZROQU_cjs = require('./chunk-TUZZROQU.cjs');
4
- require('./chunk-XACCHZH2.cjs');
5
- require('./chunk-OLISEQHS.cjs');
6
-
7
-
8
-
9
- Object.defineProperty(exports, "ChatRoot", {
10
- enumerable: true,
11
- get: function () { return chunkTUZZROQU_cjs.ChatRoot; }
12
- });
13
- //# sourceMappingURL=ChatRoot-AWNBBBH7.cjs.map
14
- //# sourceMappingURL=ChatRoot-AWNBBBH7.cjs.map
@@ -1,5 +0,0 @@
1
- export { ChatRoot } from './chunk-BDWVCSM5.mjs';
2
- import './chunk-NWUT327A.mjs';
3
- import './chunk-N2XQF2OL.mjs';
4
- //# sourceMappingURL=ChatRoot-VJKOAVPQ.mjs.map
5
- //# sourceMappingURL=ChatRoot-VJKOAVPQ.mjs.map